From: Andrea Bianco Date: Sun, 30 Jan 2022 12:59:53 +0000 (+0100) Subject: Built motion from commit e7fe2cf1.|2.5.50 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22thisimagedoesnotexist.png/%22javascript:;//%22%7B%7Blicense.fax?a=commitdiff_plain;h=5e47aff73bb4a365c3b258c05a13fc6a74927e43;p=motion2.git Built motion from commit e7fe2cf1.|2.5.50 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index b2f002d..d575d34 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-29T18:31:51.546Z", + "time": "2022-01-30T12:49:56.867Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 4f5d478..932ada4 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-29T18:31:51.546Z", + "time": "2022-01-30T12:49:56.867Z", "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 a8f9fe7..4bbca28 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 _0xc43b=['integration','jscripty','urlForward','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','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x4ae139,_0x56de76){var _0x45ada8=function(_0x3ca8f8){while(--_0x3ca8f8){_0x4ae139['push'](_0x4ae139['shift']());}};_0x45ada8(++_0x56de76);}(_0xc43b,0x134));var _0xbc43=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xc43b[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0xbc43('0x0'));module[_0xbc43('0x1')]={'name':{'type':Sequelize[_0xbc43('0x2')],'get':function(_0x4b9bfc){return this[_0xbc43('0x3')](_0xbc43('0x4'));}},'action':{'type':Sequelize[_0xbc43('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xbc43('0x6'),_0xbc43('0x7'),'motionbar',_0xbc43('0x8'),_0xbc43('0x9'),_0xbc43('0xa'),_0xbc43('0xb'),_0xbc43('0xc')]],'msg':_0xbc43('0xd')}},'comment':_0xbc43('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xbc43('0xe')},'data2':{'type':Sequelize[_0xbc43('0x5')](0x1000),'comment':_0xbc43('0xf')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xbc43('0x10')},'data4':{'type':Sequelize[_0xbc43('0x5')](0x1000),'comments':_0xbc43('0x11')},'data5':{'type':Sequelize[_0xbc43('0x5')](0x1000),'comments':_0xbc43('0x12')},'data6':{'type':Sequelize['STRING'],'comments':_0xbc43('0x13')},'data7':{'type':Sequelize[_0xbc43('0x14')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x6112=['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','exports','VIRTUAL','action','STRING','contactManager','motionbar','jscripty','urlForward'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x6112,0x8f));var _0x2611=function(_0x1cfb5c,_0x2cd71e){_0x1cfb5c=_0x1cfb5c-0x0;var _0x49447a=_0x6112[_0x1cfb5c];return _0x49447a;};'use strict';var Sequelize=require(_0x2611('0x0'));module[_0x2611('0x1')]={'name':{'type':Sequelize[_0x2611('0x2')],'get':function(_0x5729dd){return this['getDataValue'](_0x2611('0x3'));}},'action':{'type':Sequelize[_0x2611('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2611('0x5'),'integration',_0x2611('0x6'),_0x2611('0x7'),_0x2611('0x8'),'browser','bot',_0x2611('0x9')]],'msg':_0x2611('0xa')}},'comment':_0x2611('0xa')},'data1':{'type':Sequelize[_0x2611('0x4')](0x1000),'comment':_0x2611('0xb')},'data2':{'type':Sequelize[_0x2611('0x4')](0x1000),'comment':_0x2611('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x2611('0xd')},'data4':{'type':Sequelize[_0x2611('0x4')](0x1000),'comments':_0x2611('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x2611('0xf')},'data6':{'type':Sequelize[_0x2611('0x4')],'comments':_0x2611('0x10')},'data7':{'type':Sequelize[_0x2611('0x11')],'comments':_0x2611('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 25a0e49..da24399 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 _0x92f8=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','Action','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x3c662a,_0x2e64de){var _0x330b60=function(_0x1f00cc){while(--_0x1f00cc){_0x3c662a['push'](_0x3c662a['shift']());}};_0x330b60(++_0x2e64de);}(_0x92f8,0x17c));var _0x892f=function(_0x3f0bfc,_0x104792){_0x3f0bfc=_0x3f0bfc-0x0;var _0x52b0c3=_0x92f8[_0x3f0bfc];return _0x52b0c3;};'use strict';var emlformat=require(_0x892f('0x0'));var rimraf=require(_0x892f('0x1'));var zipdir=require(_0x892f('0x2'));var jsonpatch=require(_0x892f('0x3'));var rp=require(_0x892f('0x4'));var moment=require(_0x892f('0x5'));var BPromise=require(_0x892f('0x6'));var Mustache=require('mustache');var util=require(_0x892f('0x7'));var path=require(_0x892f('0x8'));var sox=require(_0x892f('0x9'));var csv=require(_0x892f('0xa'));var ejs=require(_0x892f('0xb'));var fs=require('fs');var fs_extra=require(_0x892f('0xc'));var _=require(_0x892f('0xd'));var squel=require('squel');var crypto=require(_0x892f('0xe'));var jsforce=require(_0x892f('0xf'));var deskjs=require(_0x892f('0x10'));var toCsv=require('to-csv');var querystring=require(_0x892f('0x11'));var Papa=require('papaparse');var Redis=require(_0x892f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x892f('0x13'));var as=require(_0x892f('0x14'));var hardwareService=require(_0x892f('0x15'));var logger=require(_0x892f('0x16'))(_0x892f('0x17'));var utils=require(_0x892f('0x18'));var config=require(_0x892f('0x19'));var licenseUtil=require(_0x892f('0x1a'));var db=require(_0x892f('0x1b'))['db'];function respondWithStatusCode(_0x1eefc9,_0x513091){_0x513091=_0x513091||0xcc;return function(_0x5a3b36){if(_0x5a3b36){return _0x1eefc9[_0x892f('0x1c')](_0x513091);}return _0x1eefc9[_0x892f('0x1d')](_0x513091)[_0x892f('0x1e')]();};}function respondWithResult(_0x3f6e4f,_0x20a8da){_0x20a8da=_0x20a8da||0xc8;return function(_0x7f122a){if(_0x7f122a){return _0x3f6e4f[_0x892f('0x1d')](_0x20a8da)[_0x892f('0x1f')](_0x7f122a);}};}function respondWithFilteredResult(_0x3001f1,_0x22012a){return function(_0x4bb204){if(_0x4bb204){var _0x437361=typeof _0x22012a['offset']===_0x892f('0x20')&&typeof _0x22012a[_0x892f('0x21')]===_0x892f('0x20');var _0x46007d=_0x4bb204['count'];var _0x5bad1c=_0x437361?0x0:_0x22012a[_0x892f('0x22')];var _0x148157=_0x437361?_0x4bb204[_0x892f('0x23')]:_0x22012a[_0x892f('0x22')]+_0x22012a[_0x892f('0x21')];var _0x7a857c;if(_0x148157>=_0x46007d){_0x148157=_0x46007d;_0x7a857c=0xc8;}else{_0x7a857c=0xce;}_0x3001f1[_0x892f('0x1d')](_0x7a857c);return _0x3001f1[_0x892f('0x24')](_0x892f('0x25'),_0x5bad1c+'-'+_0x148157+'/'+_0x46007d)[_0x892f('0x1f')](_0x4bb204);}return null;};}function patchUpdates(_0x1c25d9){return function(_0x40320d){try{jsonpatch[_0x892f('0x26')](_0x40320d,_0x1c25d9,!![]);}catch(_0x34ec71){return BPromise['reject'](_0x34ec71);}return _0x40320d[_0x892f('0x27')]();};}function saveUpdates(_0x1b20d7,_0x31761b){return function(_0x523110){if(_0x523110){return _0x523110['update'](_0x1b20d7)[_0x892f('0x28')](function(_0x335b71){return _0x335b71;});}return null;};}function removeEntity(_0x459648,_0x6a2c85){return function(_0x409ca7){if(_0x409ca7){return _0x409ca7[_0x892f('0x29')]()[_0x892f('0x28')](function(){_0x459648['status'](0xcc)[_0x892f('0x1e')]();});}};}function handleEntityNotFound(_0x36338d,_0x64e2c3){return function(_0x4a833e){if(!_0x4a833e){_0x36338d[_0x892f('0x1c')](0x194);}return _0x4a833e;};}function handleError(_0xeb4700,_0x2f2a7b){_0x2f2a7b=_0x2f2a7b||0x1f4;return function(_0x453c1d){logger[_0x892f('0x2a')](_0x453c1d[_0x892f('0x2b')]);if(_0x453c1d[_0x892f('0x2c')]){delete _0x453c1d[_0x892f('0x2c')];}_0xeb4700[_0x892f('0x1d')](_0x2f2a7b)[_0x892f('0x2d')](_0x453c1d);};}exports['update']=function(_0x34e8a7,_0x20c8ef){if(_0x34e8a7['body']['id']){delete _0x34e8a7['body']['id'];}return db[_0x892f('0x2e')][_0x892f('0x2f')]({'where':{'id':_0x34e8a7['params']['id']}})[_0x892f('0x28')](handleEntityNotFound(_0x20c8ef,null))[_0x892f('0x28')](saveUpdates(_0x34e8a7[_0x892f('0x30')],null))[_0x892f('0x28')](respondWithResult(_0x20c8ef,null))[_0x892f('0x31')](handleError(_0x20c8ef,null));};exports[_0x892f('0x29')]=function(_0xdb1609,_0x23b4a6){return db[_0x892f('0x2e')][_0x892f('0x2f')]({'where':{'id':_0xdb1609['params']['id']}})[_0x892f('0x28')](handleEntityNotFound(_0x23b4a6,null))[_0x892f('0x28')](removeEntity(_0x23b4a6,null))[_0x892f('0x31')](handleError(_0x23b4a6,null));}; \ No newline at end of file +var _0x5e1a=['crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','stack','name','send','update','body','Action','find','catch','params','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x50b850,_0x797ed2){var _0x348619=function(_0x2b12f5){while(--_0x2b12f5){_0x50b850['push'](_0x50b850['shift']());}};_0x348619(++_0x797ed2);}(_0x5e1a,0x129));var _0xa5e1=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x5e1a[_0x44d9ab];return _0x31485e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa5e1('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5e1('0x1'));var moment=require(_0xa5e1('0x2'));var BPromise=require(_0xa5e1('0x3'));var Mustache=require(_0xa5e1('0x4'));var util=require('util');var path=require(_0xa5e1('0x5'));var sox=require(_0xa5e1('0x6'));var csv=require(_0xa5e1('0x7'));var ejs=require(_0xa5e1('0x8'));var fs=require('fs');var fs_extra=require(_0xa5e1('0x9'));var _=require(_0xa5e1('0xa'));var squel=require('squel');var crypto=require(_0xa5e1('0xb'));var jsforce=require(_0xa5e1('0xc'));var deskjs=require(_0xa5e1('0xd'));var toCsv=require(_0xa5e1('0x7'));var querystring=require('querystring');var Papa=require(_0xa5e1('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa5e1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5e1('0x10'))('api');var utils=require(_0xa5e1('0x11'));var config=require(_0xa5e1('0x12'));var licenseUtil=require(_0xa5e1('0x13'));var db=require(_0xa5e1('0x14'))['db'];function respondWithStatusCode(_0x13d556,_0x4788fd){_0x4788fd=_0x4788fd||0xcc;return function(_0x15e123){if(_0x15e123){return _0x13d556[_0xa5e1('0x15')](_0x4788fd);}return _0x13d556['status'](_0x4788fd)[_0xa5e1('0x16')]();};}function respondWithResult(_0x43e4f0,_0x4e16f5){_0x4e16f5=_0x4e16f5||0xc8;return function(_0x2814f8){if(_0x2814f8){return _0x43e4f0[_0xa5e1('0x17')](_0x4e16f5)[_0xa5e1('0x18')](_0x2814f8);}};}function respondWithFilteredResult(_0x585ac7,_0x1329d0){return function(_0x3c42fc){if(_0x3c42fc){var _0xb31131=typeof _0x1329d0[_0xa5e1('0x19')]===_0xa5e1('0x1a')&&typeof _0x1329d0[_0xa5e1('0x1b')]===_0xa5e1('0x1a');var _0x538e4a=_0x3c42fc[_0xa5e1('0x1c')];var _0x430585=_0xb31131?0x0:_0x1329d0[_0xa5e1('0x19')];var _0x1f8019=_0xb31131?_0x3c42fc[_0xa5e1('0x1c')]:_0x1329d0[_0xa5e1('0x19')]+_0x1329d0[_0xa5e1('0x1b')];var _0x4ca53c;if(_0x1f8019>=_0x538e4a){_0x1f8019=_0x538e4a;_0x4ca53c=0xc8;}else{_0x4ca53c=0xce;}_0x585ac7[_0xa5e1('0x17')](_0x4ca53c);return _0x585ac7[_0xa5e1('0x1d')](_0xa5e1('0x1e'),_0x430585+'-'+_0x1f8019+'/'+_0x538e4a)[_0xa5e1('0x18')](_0x3c42fc);}return null;};}function patchUpdates(_0x2cd19f){return function(_0x56811c){try{jsonpatch[_0xa5e1('0x1f')](_0x56811c,_0x2cd19f,!![]);}catch(_0x46ae8a){return BPromise['reject'](_0x46ae8a);}return _0x56811c[_0xa5e1('0x20')]();};}function saveUpdates(_0x3e8f97,_0x8cd48e){return function(_0x6af19b){if(_0x6af19b){return _0x6af19b['update'](_0x3e8f97)[_0xa5e1('0x21')](function(_0x243077){return _0x243077;});}return null;};}function removeEntity(_0x24ac23,_0x120a37){return function(_0x3a8a7a){if(_0x3a8a7a){return _0x3a8a7a[_0xa5e1('0x22')]()[_0xa5e1('0x21')](function(){_0x24ac23[_0xa5e1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3abb15,_0x352464){return function(_0x5b8f7d){if(!_0x5b8f7d){_0x3abb15[_0xa5e1('0x15')](0x194);}return _0x5b8f7d;};}function handleError(_0x2837cb,_0x4bfe34){_0x4bfe34=_0x4bfe34||0x1f4;return function(_0x4b7c7f){logger['error'](_0x4b7c7f[_0xa5e1('0x23')]);if(_0x4b7c7f['name']){delete _0x4b7c7f[_0xa5e1('0x24')];}_0x2837cb['status'](_0x4bfe34)[_0xa5e1('0x25')](_0x4b7c7f);};}exports[_0xa5e1('0x26')]=function(_0x4ede63,_0x1710a2){if(_0x4ede63['body']['id']){delete _0x4ede63[_0xa5e1('0x27')]['id'];}return db[_0xa5e1('0x28')][_0xa5e1('0x29')]({'where':{'id':_0x4ede63['params']['id']}})[_0xa5e1('0x21')](handleEntityNotFound(_0x1710a2,null))['then'](saveUpdates(_0x4ede63['body'],null))[_0xa5e1('0x21')](respondWithResult(_0x1710a2,null))[_0xa5e1('0x2a')](handleError(_0x1710a2,null));};exports[_0xa5e1('0x22')]=function(_0x48c686,_0x18d555){return db[_0xa5e1('0x28')][_0xa5e1('0x29')]({'where':{'id':_0x48c686[_0xa5e1('0x2b')]['id']}})['then'](handleEntityNotFound(_0x18d555,null))[_0xa5e1('0x21')](removeEntity(_0x18d555,null))[_0xa5e1('0x2a')](handleError(_0x18d555,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index dabdb12..483406b 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 _0x374d=['rimraf','./action.attributes','define','tools_actions','lodash','util','api','path'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x374d,0x144));var _0xd374=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x374d[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xd374('0x0'));var util=require(_0xd374('0x1'));var logger=require('../../config/logger')(_0xd374('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd374('0x3'));var rimraf=require(_0xd374('0x4'));var config=require('../../config/environment');var attributes=require(_0xd374('0x5'));module['exports']=function(_0x1d9a68,_0x31b2b0){return _0x1d9a68[_0xd374('0x6')]('Action',attributes,{'tableName':_0xd374('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x629c=['moment','request-promise','path','rimraf','exports','define','util','../../config/logger','api'];(function(_0x45d8a9,_0x2a64b5){var _0x1bf379=function(_0x3d82dc){while(--_0x3d82dc){_0x45d8a9['push'](_0x45d8a9['shift']());}};_0x1bf379(++_0x2a64b5);}(_0x629c,0x19b));var _0xc629=function(_0x2fb375,_0x486724){_0x2fb375=_0x2fb375-0x0;var _0x43191a=_0x629c[_0x2fb375];return _0x43191a;};'use strict';var _=require('lodash');var util=require(_0xc629('0x0'));var logger=require(_0xc629('0x1'))(_0xc629('0x2'));var moment=require(_0xc629('0x3'));var BPromise=require('bluebird');var rp=require(_0xc629('0x4'));var fs=require('fs');var path=require(_0xc629('0x5'));var rimraf=require(_0xc629('0x6'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xc629('0x7')]=function(_0x209043,_0x1b7204){return _0x209043[_0xc629('0x8')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 2aa81c4..1062733 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x54a266,_0x4f3915){var _0x474b87=function(_0x4ed076){while(--_0x4ed076){_0x54a266['push'](_0x54a266['shift']());}};_0x474b87(++_0x4f3915);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc4aa[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3fa229,_0x54e77b){var _0x2ea450=function(_0x174aaa){while(--_0x174aaa){_0x3fa229['push'](_0x3fa229['shift']());}};_0x2ea450(++_0x54e77b);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3ee829,_0x10a02f){_0x3ee829=_0x3ee829-0x0;var _0x5af899=_0x8ef6[_0x3ee829];return _0x5af899;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Action,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Action,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index a49706e..af6b4ba 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 _0x841c=['Router','fs-extra','../../components/auth/service','./action.controller','put','isAuthenticated','update','delete','/:id','multer','path','connect-timeout'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x841c,0x1ad));var _0xc841=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x841c[_0x35885a];return _0xe86249;};'use strict';var multer=require(_0xc841('0x0'));var util=require('util');var path=require(_0xc841('0x1'));var timeout=require(_0xc841('0x2'));var express=require('express');var router=express[_0xc841('0x3')]();var fs_extra=require(_0xc841('0x4'));var auth=require(_0xc841('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc841('0x6'));router[_0xc841('0x7')]('/:id',auth[_0xc841('0x8')](),controller[_0xc841('0x9')]);router[_0xc841('0xa')](_0xc841('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xec3a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','put','/:id','update','isAuthenticated','destroy','exports','multer','path'];(function(_0x2e4707,_0x2dc563){var _0x2ba053=function(_0x1a5fda){while(--_0x1a5fda){_0x2e4707['push'](_0x2e4707['shift']());}};_0x2ba053(++_0x2dc563);}(_0xec3a,0x1cc));var _0xaec3=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xec3a[_0x4c440b];return _0x2d48cf;};'use strict';var multer=require(_0xaec3('0x0'));var util=require('util');var path=require(_0xaec3('0x1'));var timeout=require(_0xaec3('0x2'));var express=require(_0xaec3('0x3'));var router=express[_0xaec3('0x4')]();var fs_extra=require(_0xaec3('0x5'));var auth=require(_0xaec3('0x6'));var interaction=require(_0xaec3('0x7'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0xaec3('0x8')](_0xaec3('0x9'),auth['isAuthenticated'](),controller[_0xaec3('0xa')]);router['delete'](_0xaec3('0x9'),auth[_0xaec3('0xb')](),controller[_0xaec3('0xc')]);module[_0xaec3('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 9d92e6b..ec5533d 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 _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x26fa1e,_0x3b1ed4){var _0x229228=function(_0x31f9a7){while(--_0x31f9a7){_0x26fa1e['push'](_0x26fa1e['shift']());}};_0x229228(++_0x3b1ed4);}(_0xabce,0x103));var _0xeabc=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xabce[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}}; \ No newline at end of file +var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x5a3440,_0x59ae69){var _0x516fca=function(_0x5db140){while(--_0x5db140){_0x5a3440['push'](_0x5a3440['shift']());}};_0x516fca(++_0x59ae69);}(_0xd8fb,0x99));var _0xbd8f=function(_0x590f28,_0x386302){_0x590f28=_0x590f28-0x0;var _0xea7213=_0xd8fb[_0x590f28];return _0xea7213;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index df10480..52a62b7 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 _0x43fd=['getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','ValidationErrorItem','groupBy','clone','output','web','fullPath','randomstring','generate','csv','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','operator','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','save','update','then','get','CustomReports','destroy','error','stack','send','index','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','includeAll','findAll','rows','catch','rawAttributes','include','AnalyticCustomReport','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value'];(function(_0x475aeb,_0x38d0fa){var _0x4e2330=function(_0x3470b0){while(--_0x3470b0){_0x475aeb['push'](_0x475aeb['shift']());}};_0x4e2330(++_0x38d0fa);}(_0x43fd,0x186));var _0xd43f=function(_0x4bd7e6,_0x57c5ba){_0x4bd7e6=_0x4bd7e6-0x0;var _0x51ad22=_0x43fd[_0x4bd7e6];return _0x51ad22;};'use strict';var emlformat=require(_0xd43f('0x0'));var rimraf=require(_0xd43f('0x1'));var zipdir=require(_0xd43f('0x2'));var jsonpatch=require(_0xd43f('0x3'));var rp=require(_0xd43f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd43f('0x5'));var util=require(_0xd43f('0x6'));var path=require(_0xd43f('0x7'));var sox=require(_0xd43f('0x8'));var csv=require(_0xd43f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd43f('0xa'));var crypto=require(_0xd43f('0xb'));var jsforce=require(_0xd43f('0xc'));var deskjs=require(_0xd43f('0xd'));var toCsv=require(_0xd43f('0x9'));var querystring=require('querystring');var Papa=require(_0xd43f('0xe'));var Redis=require(_0xd43f('0xf'));var authService=require(_0xd43f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd43f('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xd43f('0x12'));var licenseUtil=require(_0xd43f('0x13'));var db=require(_0xd43f('0x14'))['db'];var dbH=require(_0xd43f('0x14'))[_0xd43f('0x15')];function respondWithStatusCode(_0x241c1f,_0xb96903){_0xb96903=_0xb96903||0xcc;return function(_0x13e22f){if(_0x13e22f){return _0x241c1f[_0xd43f('0x16')](_0xb96903);}return _0x241c1f[_0xd43f('0x17')](_0xb96903)[_0xd43f('0x18')]();};}function respondWithResult(_0x3ab445,_0x1683a1){_0x1683a1=_0x1683a1||0xc8;return function(_0x5e9215){if(_0x5e9215){return _0x3ab445[_0xd43f('0x17')](_0x1683a1)[_0xd43f('0x19')](_0x5e9215);}};}function respondWithFilteredResult(_0x239e4e,_0x319a5f){return function(_0x434f98){if(_0x434f98){var _0x344792=typeof _0x319a5f['offset']===_0xd43f('0x1a')&&typeof _0x319a5f[_0xd43f('0x1b')]===_0xd43f('0x1a');var _0xdda6ff=_0x434f98['count'];var _0x595e5c=_0x344792?0x0:_0x319a5f[_0xd43f('0x1c')];var _0x22a607=_0x344792?_0x434f98[_0xd43f('0x1d')]:_0x319a5f[_0xd43f('0x1c')]+_0x319a5f[_0xd43f('0x1b')];var _0x3887ca;if(_0x22a607>=_0xdda6ff){_0x22a607=_0xdda6ff;_0x3887ca=0xc8;}else{_0x3887ca=0xce;}_0x239e4e[_0xd43f('0x17')](_0x3887ca);return _0x239e4e[_0xd43f('0x1e')]('Content-Range',_0x595e5c+'-'+_0x22a607+'/'+_0xdda6ff)[_0xd43f('0x19')](_0x434f98);}return null;};}function patchUpdates(_0xfb6e9e){return function(_0x1b5c44){try{jsonpatch[_0xd43f('0x1f')](_0x1b5c44,_0xfb6e9e,!![]);}catch(_0x3f579e){return BPromise['reject'](_0x3f579e);}return _0x1b5c44[_0xd43f('0x20')]();};}function saveUpdates(_0x498386,_0x43e95d){return function(_0x4d50cc){if(_0x4d50cc){return _0x4d50cc[_0xd43f('0x21')](_0x498386)[_0xd43f('0x22')](function(_0xe481af){return _0xe481af;});}return null;};}function removeEntity(_0x3052a2,_0x262f24){return function(_0x55a24e){if(_0x55a24e){return _0x55a24e['destroy']()[_0xd43f('0x22')](function(){var _0x378f52=_0x55a24e[_0xd43f('0x23')]({'plain':!![]});var _0x4469d2=_0xd43f('0x24');return db['UserProfileResource'][_0xd43f('0x25')]({'where':{'type':_0x4469d2,'resourceId':_0x378f52['id']}})['then'](function(){return _0x55a24e;});})[_0xd43f('0x22')](function(){_0x3052a2[_0xd43f('0x17')](0xcc)[_0xd43f('0x18')]();});}};}function handleEntityNotFound(_0x4e35bb,_0x4a536c){return function(_0xa7a0c){if(!_0xa7a0c){_0x4e35bb[_0xd43f('0x16')](0x194);}return _0xa7a0c;};}function handleError(_0x3d9963,_0x29a9be){_0x29a9be=_0x29a9be||0x1f4;return function(_0x11a022){logger[_0xd43f('0x26')](_0x11a022[_0xd43f('0x27')]);if(_0x11a022['name']){delete _0x11a022['name'];}_0x3d9963[_0xd43f('0x17')](_0x29a9be)[_0xd43f('0x28')](_0x11a022);};}exports[_0xd43f('0x29')]=function(_0x524f18,_0x33d072){var _0xc9f1ca={},_0x44b3cf={},_0x26ba1b={'count':0x0,'rows':[]};var _0x4b0578=_['map'](db['AnalyticCustomReport']['rawAttributes'],function(_0x471f6b){return{'name':_0x471f6b[_0xd43f('0x2a')],'type':_0x471f6b[_0xd43f('0x2b')][_0xd43f('0x2c')]};});_0x44b3cf[_0xd43f('0x2d')]=_[_0xd43f('0x2e')](_0x4b0578,_0xd43f('0x2f'));_0x44b3cf[_0xd43f('0x30')]=_[_0xd43f('0x31')](_0x524f18[_0xd43f('0x30')]);_0x44b3cf[_0xd43f('0x32')]=_[_0xd43f('0x33')](_0x44b3cf[_0xd43f('0x2d')],_0x44b3cf['query']);_0xc9f1ca[_0xd43f('0x34')]=_[_0xd43f('0x33')](_0x44b3cf[_0xd43f('0x2d')],qs[_0xd43f('0x35')](_0x524f18[_0xd43f('0x30')][_0xd43f('0x35')]));_0xc9f1ca[_0xd43f('0x34')]=_0xc9f1ca[_0xd43f('0x34')][_0xd43f('0x36')]?_0xc9f1ca[_0xd43f('0x34')]:_0x44b3cf[_0xd43f('0x2d')];if(!_0x524f18['query'][_0xd43f('0x37')](_0xd43f('0x38'))){_0xc9f1ca['limit']=qs[_0xd43f('0x1b')](_0x524f18[_0xd43f('0x30')][_0xd43f('0x1b')]);_0xc9f1ca[_0xd43f('0x1c')]=qs[_0xd43f('0x1c')](_0x524f18[_0xd43f('0x30')]['offset']);}_0xc9f1ca[_0xd43f('0x39')]=qs[_0xd43f('0x3a')](_0x524f18[_0xd43f('0x30')][_0xd43f('0x3a')]);_0xc9f1ca['where']=qs[_0xd43f('0x32')](_[_0xd43f('0x3b')](_0x524f18[_0xd43f('0x30')],_0x44b3cf[_0xd43f('0x32')]),_0x4b0578);if(_0x524f18[_0xd43f('0x30')]['filter']){_0xc9f1ca[_0xd43f('0x3c')]=_[_0xd43f('0x3d')](_0xc9f1ca[_0xd43f('0x3c')],{'$or':_[_0xd43f('0x2e')](_0x4b0578,function(_0x138d07){if(_0x138d07[_0xd43f('0x2b')]!=='VIRTUAL'){var _0xb5771f={};_0xb5771f[_0x138d07[_0xd43f('0x2f')]]={'$like':'%'+_0x524f18[_0xd43f('0x30')]['filter']+'%'};return _0xb5771f;}})});}_0xc9f1ca=_[_0xd43f('0x3d')]({},_0xc9f1ca,_0x524f18[_0xd43f('0x3e')]);var _0xf4de64={'where':_0xc9f1ca[_0xd43f('0x3c')]};return db['AnalyticCustomReport'][_0xd43f('0x1d')](_0xf4de64)[_0xd43f('0x22')](function(_0x486d9d){_0x26ba1b['count']=_0x486d9d;if(_0x524f18[_0xd43f('0x30')][_0xd43f('0x3f')]){_0xc9f1ca['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xd43f('0x40')](_0xc9f1ca);})[_0xd43f('0x22')](function(_0x299eaf){_0x26ba1b[_0xd43f('0x41')]=_0x299eaf;return _0x26ba1b;})['then'](respondWithFilteredResult(_0x33d072,_0xc9f1ca))[_0xd43f('0x42')](handleError(_0x33d072,null));};exports['show']=function(_0x19cd6a,_0xc48b57){var _0x125332={'raw':![],'where':{'id':_0x19cd6a['params']['id']}},_0x1141cd={};_0x1141cd[_0xd43f('0x2d')]=_[_0xd43f('0x31')](db['AnalyticCustomReport'][_0xd43f('0x43')]);_0x1141cd[_0xd43f('0x30')]=_[_0xd43f('0x31')](_0x19cd6a[_0xd43f('0x30')]);_0x1141cd[_0xd43f('0x32')]=_[_0xd43f('0x33')](_0x1141cd['model'],_0x1141cd[_0xd43f('0x30')]);_0x125332[_0xd43f('0x34')]=_[_0xd43f('0x33')](_0x1141cd[_0xd43f('0x2d')],qs[_0xd43f('0x35')](_0x19cd6a[_0xd43f('0x30')]['fields']));_0x125332[_0xd43f('0x34')]=_0x125332[_0xd43f('0x34')][_0xd43f('0x36')]?_0x125332[_0xd43f('0x34')]:_0x1141cd[_0xd43f('0x2d')];if(_0x19cd6a[_0xd43f('0x30')][_0xd43f('0x3f')]){_0x125332[_0xd43f('0x44')]=[{'all':!![]}];}_0x125332=_[_0xd43f('0x3d')]({},_0x125332,_0x19cd6a['options']);return db[_0xd43f('0x45')][_0xd43f('0x46')](_0x125332)[_0xd43f('0x22')](handleEntityNotFound(_0xc48b57,null))[_0xd43f('0x22')](respondWithResult(_0xc48b57,null))[_0xd43f('0x42')](handleError(_0xc48b57,null));};exports[_0xd43f('0x47')]=function(_0x229424,_0xefa375){return db[_0xd43f('0x45')][_0xd43f('0x47')](_0x229424['body'],{})[_0xd43f('0x22')](function(_0x33d4d0){var _0x43a2b5=_0x229424['user'][_0xd43f('0x23')]({'plain':!![]});if(!_0x43a2b5)throw new Error(_0xd43f('0x48'));if(_0x43a2b5[_0xd43f('0x49')]===_0xd43f('0x4a')){var _0x5e1f24=_0x33d4d0['get']({'plain':!![]});var _0x394c0b=_0xd43f('0x4b');return db[_0xd43f('0x4c')][_0xd43f('0x46')]({'where':{'name':_0x394c0b,'userProfileId':_0x43a2b5[_0xd43f('0x4d')]},'raw':!![]})[_0xd43f('0x22')](function(_0x5c273b){if(_0x5c273b&&_0x5c273b[_0xd43f('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x5e1f24[_0xd43f('0x2f')],'resourceId':_0x5e1f24['id'],'type':'CustomReports','sectionId':_0x5c273b['id']},{})[_0xd43f('0x22')](function(){return _0x33d4d0;});}else{return _0x33d4d0;}})[_0xd43f('0x42')](function(_0x36d3f3){logger[_0xd43f('0x26')](_0xd43f('0x4f'),_0x36d3f3);throw _0x36d3f3;});}return _0x33d4d0;})[_0xd43f('0x22')](respondWithResult(_0xefa375,0xc9))[_0xd43f('0x42')](handleError(_0xefa375,null));};exports[_0xd43f('0x21')]=function(_0x5980ff,_0x107549){if(_0x5980ff[_0xd43f('0x50')]['id']){delete _0x5980ff[_0xd43f('0x50')]['id'];}return db[_0xd43f('0x45')][_0xd43f('0x46')]({'where':{'id':_0x5980ff[_0xd43f('0x51')]['id']}})[_0xd43f('0x22')](handleEntityNotFound(_0x107549,null))[_0xd43f('0x22')](saveUpdates(_0x5980ff[_0xd43f('0x50')],null))['then'](respondWithResult(_0x107549,null))[_0xd43f('0x42')](handleError(_0x107549,null));};exports[_0xd43f('0x25')]=function(_0x213e35,_0x24323c){return db[_0xd43f('0x45')][_0xd43f('0x46')]({'where':{'id':_0x213e35[_0xd43f('0x51')]['id']}})[_0xd43f('0x22')](handleEntityNotFound(_0x24323c,null))[_0xd43f('0x22')](removeEntity(_0x24323c,null))['catch'](handleError(_0x24323c,null));};exports['preview']=function(_0x5cbd95,_0x2558c4){var _0x554792=0xa;var _0x4d67d1=['join',_0xd43f('0x52'),_0xd43f('0x53'),_0xd43f('0x54')];var _0x1196e6={'SUM':_0xd43f('0x55'),'COUNT':_0xd43f('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd43f('0x57'),'MIN':_0xd43f('0x58'),'AVG':_0xd43f('0x59'),'GROUP_CONCAT':_0xd43f('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd43f('0x5b')};var _0x3c9715={'SEC_TO_TIME':_0xd43f('0x5c'),'DATE':_0xd43f('0x5d'),'HOUR':_0xd43f('0x5e'),'ROUND':_0xd43f('0x5f'),'UNIX_TIMESTAMP':_0xd43f('0x60')};var _0x2832e5=function(_0x16c145){return!_['includes']([_0xd43f('0x61'),'IS\x20NOT\x20NULL',_0xd43f('0x62'),_0xd43f('0x63')],_0x16c145);};var _0x575a1a=function(_0x5065ad){if(!_0x5065ad||!_0x5065ad[_0xd43f('0x64')]['length']){return'';}for(var _0x2c15f6='(',_0x11f32b=0x0;_0x11f32b<_0x5065ad[_0xd43f('0x64')]['length'];_0x11f32b+=0x1){_0x11f32b>0x0&&(_0x2c15f6+='\x20'+_0x5065ad['operator']+'\x20');_0x2c15f6+=_0x5065ad['rules'][_0x11f32b][_0xd43f('0x65')]?_0x575a1a(_0x5065ad[_0xd43f('0x64')][_0x11f32b][_0xd43f('0x65')]):_0x5065ad[_0xd43f('0x64')][_0x11f32b][_0xd43f('0x66')]+'\x20'+_0x5065ad[_0xd43f('0x64')][_0x11f32b][_0xd43f('0x67')]+(_0x2832e5(_0x5065ad['rules'][_0x11f32b]['condition'])?'\x20'+_0x5065ad['rules'][_0x11f32b][_0xd43f('0x68')]:'');}return _0x2c15f6+')';};var _0x467c13={'where':{'id':_0x5cbd95[_0xd43f('0x51')]['id']}},_0x4c769f,_0x4849e6,_0x3fe29d,_0x3da882,_0x1d8d6f;_0x467c13=_[_0xd43f('0x3d')]({},_0x467c13,_0x5cbd95[_0xd43f('0x3e')]);return db[_0xd43f('0x45')][_0xd43f('0x46')](_0x467c13)['then'](function(_0x23f97b){if(_0x23f97b){_0x4c769f=_0x23f97b;return _0x23f97b[_0xd43f('0x69')]();}return null;})['then'](function(_0xa3ed66){if(_0xa3ed66){if(!_0xa3ed66[_0xd43f('0x36')]){throw new db[(_0xd43f('0x6a'))]['ValidationErrorItem'](_0xd43f('0x6b'),0x193);}_0x4849e6=_0xa3ed66;return db[_0xd43f('0x6c')][_0xd43f('0x40')]({'raw':!![]});}return null;})[_0xd43f('0x22')](function(_0x225a71){if(_0x225a71){_0x3fe29d=_[_0xd43f('0x6d')](_0x225a71,'id');var _0x40a1c9;var _0x5dd5fa=squel[_0xd43f('0x6e')]();_0x5dd5fa[_0xd43f('0x6f')](_0x4c769f['table']);for(var _0x1924df=0x0;_0x1924df<_0x4849e6[_0xd43f('0x36')];_0x1924df+=0x1){_0x40a1c9=_0x4849e6[_0x1924df][_0xd43f('0x70')]?_0x3fe29d[_0x4849e6[_0x1924df][_0xd43f('0x70')]][_0xd43f('0x71')]:_0x4849e6[_0x1924df][_0xd43f('0x66')];_0x40a1c9=_0x4849e6[_0x1924df]['function']?_[_0xd43f('0x72')](_0x1196e6[_0x4849e6[_0x1924df][_0xd43f('0x73')]],'%s',_0x40a1c9):_0x40a1c9;_0x40a1c9=_0x4849e6[_0x1924df]['format']?_[_0xd43f('0x72')](_0x3c9715[_0x4849e6[_0x1924df][_0xd43f('0x74')]],'%s',_0x40a1c9):_0x40a1c9;if(_0x4849e6[_0x1924df]['groupBy']){_0x5dd5fa[_0xd43f('0x65')](_0x40a1c9);}_0x4849e6[_0x1924df][_0xd43f('0x75')]&&_0x5dd5fa[_0xd43f('0x39')](_0x40a1c9,_0x4849e6[_0x1924df]['orderBy']===_0xd43f('0x76')?![]:!![]);_0x5dd5fa[_0xd43f('0x66')](_0x40a1c9,_0x4849e6[_0x1924df][_0xd43f('0x77')]||_0x40a1c9);}if(_0x4c769f[_0xd43f('0x78')]){_0x4c769f[_0xd43f('0x78')]=JSON[_0xd43f('0x79')](_0x4c769f[_0xd43f('0x78')]);for(var _0x256bde=0x0;_0x256bde<_0x4c769f[_0xd43f('0x78')]['length'];_0x256bde+=0x1){if(_0x4c769f[_0xd43f('0x78')][_0x256bde][_0xd43f('0x2b')]&&_[_0xd43f('0x7a')](_0x4d67d1,_0x4c769f[_0xd43f('0x78')][_0x256bde][_0xd43f('0x2b')])&&_0x4c769f[_0xd43f('0x78')][_0x256bde][_0xd43f('0x7b')]&&_0x4c769f['joins'][_0x256bde][_0xd43f('0x7c')]&&_0x4c769f[_0xd43f('0x78')][_0x256bde][_0xd43f('0x7d')]){_0x5dd5fa[_0x4c769f[_0xd43f('0x78')][_0x256bde][_0xd43f('0x2b')]](_0x4c769f[_0xd43f('0x78')][_0x256bde][_0xd43f('0x7c')],null,util[_0xd43f('0x74')](_0xd43f('0x7e'),_0x4c769f[_0xd43f('0x7f')],_0x4c769f['joins'][_0x256bde][_0xd43f('0x7b')],_0x4c769f[_0xd43f('0x78')][_0x256bde]['foreignTable'],_0x4c769f[_0xd43f('0x78')][_0x256bde][_0xd43f('0x7d')]));}}}if(_0x4c769f[_0xd43f('0x80')]){_0x4c769f['conditions']=JSON[_0xd43f('0x79')](_0x4c769f[_0xd43f('0x80')]);_0x5dd5fa[_0xd43f('0x3c')](_0x575a1a(_0x4c769f['conditions'][_0xd43f('0x65')]));}_0x1d8d6f=_0x5dd5fa['clone']();_0x5dd5fa[_0xd43f('0x1b')](_0x554792);_0x5dd5fa[_0xd43f('0x1c')](0x0);logger[_0xd43f('0x81')](_0xd43f('0x82'),_0x5dd5fa[_0xd43f('0x83')]());return dbH[_0xd43f('0x84')][_0xd43f('0x30')](_0x5dd5fa[_0xd43f('0x83')](),{'type':dbH[_0xd43f('0x84')][_0xd43f('0x85')][_0xd43f('0x86')]});}})[_0xd43f('0x22')](respondWithResult(_0x2558c4,null))[_0xd43f('0x42')](handleError(_0x2558c4,null));};function runReport(_0x1e8375,_0x1c8f40,_0x2d77eb){var _0x23e1e4=_0x1c8f40[_0xd43f('0x2f')];var _0x24fe1c=0xa;var _0x7b3c09=[_0xd43f('0x87'),_0xd43f('0x52'),_0xd43f('0x53'),_0xd43f('0x54')];var _0x1c5b5b={'SUM':_0xd43f('0x55'),'COUNT':_0xd43f('0x56'),'COUNT DISTINCT':_0xd43f('0x88'),'MAX':_0xd43f('0x57'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd43f('0x5a'),'GROUP_CONCAT ASC':_0xd43f('0x89'),'GROUP_CONCAT DESC':_0xd43f('0x5b')};var _0x2ae5ea={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd43f('0x5d'),'HOUR':_0xd43f('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd43f('0x60')};var _0x2a2f41=function(_0xcd972){return!_[_0xd43f('0x7a')]([_0xd43f('0x61'),_0xd43f('0x8a'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xcd972);};var _0x241b0d=function(_0x4b2c83){if(!_0x4b2c83||!_0x4b2c83[_0xd43f('0x64')]['length']){return'';}for(var _0x5cc9b8='(',_0x560f6f=0x0;_0x560f6f<_0x4b2c83[_0xd43f('0x64')]['length'];_0x560f6f+=0x1){_0x560f6f>0x0&&(_0x5cc9b8+='\x20'+_0x4b2c83['operator']+'\x20');_0x5cc9b8+=_0x4b2c83[_0xd43f('0x64')][_0x560f6f][_0xd43f('0x65')]?_0x241b0d(_0x4b2c83[_0xd43f('0x64')][_0x560f6f][_0xd43f('0x65')]):_0x4b2c83[_0xd43f('0x64')][_0x560f6f][_0xd43f('0x66')]+'\x20'+_0x4b2c83['rules'][_0x560f6f]['condition']+(_0x2a2f41(_0x4b2c83[_0xd43f('0x64')][_0x560f6f][_0xd43f('0x67')])?'\x20'+_0x4b2c83['rules'][_0x560f6f]['value']:'');}return _0x5cc9b8+')';};var _0x3b63ab={'where':{'id':_0x1e8375['id']}},_0x4efbd4,_0x357c41,_0x325e28,_0x5442b7,_0x3c03fd;_0x3b63ab=_[_0xd43f('0x3d')]({},_0x3b63ab,_0x2d77eb);return db['AnalyticCustomReport'][_0xd43f('0x46')](_0x3b63ab)[_0xd43f('0x22')](function(_0x2269c9){if(_0x2269c9){_0x4efbd4=_0x2269c9;return _0x2269c9[_0xd43f('0x69')]();}return null;})['then'](function(_0x17f57c){if(_0x17f57c){if(!_0x17f57c[_0xd43f('0x36')]){throw new db[(_0xd43f('0x6a'))][(_0xd43f('0x8b'))](_0xd43f('0x6b'),0x193);}_0x357c41=_0x17f57c;return db['AnalyticMetric'][_0xd43f('0x40')]({'raw':!![]});}return null;})[_0xd43f('0x22')](function(_0x483e49){if(_0x483e49){_0x325e28=_['keyBy'](_0x483e49,'id');var _0x1bf1bb;var _0x37a125=squel[_0xd43f('0x6e')]();_0x37a125[_0xd43f('0x6f')](_0x4efbd4[_0xd43f('0x7f')]);for(var _0x4a3681=0x0;_0x4a3681<_0x357c41[_0xd43f('0x36')];_0x4a3681+=0x1){_0x1bf1bb=_0x357c41[_0x4a3681][_0xd43f('0x70')]?_0x325e28[_0x357c41[_0x4a3681][_0xd43f('0x70')]][_0xd43f('0x71')]:_0x357c41[_0x4a3681][_0xd43f('0x66')];_0x1bf1bb=_0x357c41[_0x4a3681][_0xd43f('0x73')]?_[_0xd43f('0x72')](_0x1c5b5b[_0x357c41[_0x4a3681][_0xd43f('0x73')]],'%s',_0x1bf1bb):_0x1bf1bb;_0x1bf1bb=_0x357c41[_0x4a3681]['format']?_[_0xd43f('0x72')](_0x2ae5ea[_0x357c41[_0x4a3681][_0xd43f('0x74')]],'%s',_0x1bf1bb):_0x1bf1bb;if(_0x357c41[_0x4a3681][_0xd43f('0x8c')]){_0x37a125[_0xd43f('0x65')](_0x1bf1bb);}_0x357c41[_0x4a3681][_0xd43f('0x75')]&&_0x37a125[_0xd43f('0x39')](_0x1bf1bb,_0x357c41[_0x4a3681][_0xd43f('0x75')]===_0xd43f('0x76')?![]:!![]);_0x37a125[_0xd43f('0x66')](_0x1bf1bb,_0x357c41[_0x4a3681]['alias']||_0x1bf1bb);}if(_0x4efbd4[_0xd43f('0x78')]){_0x4efbd4[_0xd43f('0x78')]=JSON[_0xd43f('0x79')](_0x4efbd4[_0xd43f('0x78')]);for(var _0x2c2cd2=0x0;_0x2c2cd2<_0x4efbd4[_0xd43f('0x78')][_0xd43f('0x36')];_0x2c2cd2+=0x1){if(_0x4efbd4[_0xd43f('0x78')][_0x2c2cd2][_0xd43f('0x2b')]&&_[_0xd43f('0x7a')](_0x7b3c09,_0x4efbd4[_0xd43f('0x78')][_0x2c2cd2][_0xd43f('0x2b')])&&_0x4efbd4[_0xd43f('0x78')][_0x2c2cd2][_0xd43f('0x7b')]&&_0x4efbd4[_0xd43f('0x78')][_0x2c2cd2][_0xd43f('0x7c')]&&_0x4efbd4[_0xd43f('0x78')][_0x2c2cd2]['foreignKey']){_0x37a125[_0x4efbd4[_0xd43f('0x78')][_0x2c2cd2]['type']](_0x4efbd4[_0xd43f('0x78')][_0x2c2cd2][_0xd43f('0x7c')],null,util[_0xd43f('0x74')](_0xd43f('0x7e'),_0x4efbd4[_0xd43f('0x7f')],_0x4efbd4[_0xd43f('0x78')][_0x2c2cd2][_0xd43f('0x7b')],_0x4efbd4['joins'][_0x2c2cd2][_0xd43f('0x7c')],_0x4efbd4[_0xd43f('0x78')][_0x2c2cd2][_0xd43f('0x7d')]));}}}if(_0x4efbd4[_0xd43f('0x80')]){_0x4efbd4[_0xd43f('0x80')]=JSON[_0xd43f('0x79')](_0x4efbd4[_0xd43f('0x80')]);_0x37a125[_0xd43f('0x3c')](_0x241b0d(_0x4efbd4['conditions'][_0xd43f('0x65')]));}_0x3c03fd=_0x37a125[_0xd43f('0x8d')]();_0x37a125[_0xd43f('0x1b')](_0x24fe1c);_0x37a125['offset'](0x0);return;}})[_0xd43f('0x22')](function(){if(_0x1c8f40[_0xd43f('0x8e')]===_0xd43f('0x8f')){return null;}var _0x41e7fe=_[_0xd43f('0x3d')](_0x1c8f40,{'name':_0x1c8f40[_0xd43f('0x90')]||_0x1c8f40[_0xd43f('0x2f')]||_0x4efbd4[_0xd43f('0x2f')],'basename':_0x23e1e4,'savename':util[_0xd43f('0x74')]('%s-%s.%s',_0x1c8f40[_0xd43f('0x2f')]||_0x4efbd4['name'],require(_0xd43f('0x91'))[_0xd43f('0x92')](0x4),_0x1c8f40[_0xd43f('0x8e')]||_0xd43f('0x93')),'reportId':_0x4efbd4['id'],'reportType':'custom'});return db[_0xd43f('0x94')][_0xd43f('0x47')](_0x41e7fe,{'raw':!![]});})['then'](function(_0x451087){if(_0x4efbd4[_0xd43f('0x7f')]===_0xd43f('0x95')){_0x3c03fd[_0xd43f('0x3c')](_0x4efbd4[_0xd43f('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1c8f40['startDate'],_0x1c8f40[_0xd43f('0x96')]);}else{_0x3c03fd[_0xd43f('0x3c')](_0x4efbd4[_0xd43f('0x7f')]+_0xd43f('0x97'),_0x1c8f40[_0xd43f('0x98')],_0x1c8f40['endDate']);}if(_0x451087){logger[_0xd43f('0x99')](_0xd43f('0x9a'),_0x3c03fd['toString']());require(_0xd43f('0x9b'))[_0xd43f('0x9c')](path[_0xd43f('0x87')](__dirname,_0xd43f('0x9d'),_0x451087[_0xd43f('0x8e')]),[_0x451087['id'],_0x3c03fd['toString'](),path['join'](__dirname,_0xd43f('0x9e'),_0x451087[_0xd43f('0x9f')]),_0x23e1e4]);return _0x451087;}else{var _0xdb25aa=squel[_0xd43f('0x6e')]();_0xdb25aa['from']('('+_0x3c03fd['toString']()+')',_0xd43f('0xa0'));_0xdb25aa[_0xd43f('0x66')](_0xd43f('0xa1'),_0xd43f('0x1d'));_0x3c03fd['limit'](_0x1c8f40[_0xd43f('0x1b')]||_0x24fe1c);_0x3c03fd[_0xd43f('0x1c')](_0x1c8f40['offset']||0x0);return dbH[_0xd43f('0x84')][_0xd43f('0x30')](_0xdb25aa[_0xd43f('0x83')](),{'type':dbH[_0xd43f('0x84')][_0xd43f('0x85')][_0xd43f('0x86')]})[_0xd43f('0x22')](function(_0x1a2685){if(!_0x1a2685[_0xd43f('0x36')]){_0x5442b7=0x0;}else{_0x5442b7=_0x1a2685[0x0][_0xd43f('0x1d')]||0x0;}return dbH[_0xd43f('0x84')]['query'](_0x3c03fd[_0xd43f('0x83')](),{'type':dbH[_0xd43f('0x84')]['QueryTypes'][_0xd43f('0x86')]});})[_0xd43f('0x22')](function(_0x4e969e){return{'rows':_0x4e969e||[],'count':_0x5442b7};});}});}exports[_0xd43f('0xa2')]=function(_0x1860d3,_0x12523d){return runReport(_0x1860d3[_0xd43f('0x51')],_0x1860d3['query'],_0x1860d3[_0xd43f('0x3e')])[_0xd43f('0x22')](respondWithResult(_0x12523d,null))['catch'](handleError(_0x12523d,null));};exports[_0xd43f('0xa3')]=runReport;exports[_0xd43f('0x30')]=function(_0x31e8ba,_0xb37531){var _0x442a62=0xa;var _0x104def=['join',_0xd43f('0x52'),'right_join',_0xd43f('0x54')];var _0x2c271f={'SUM':_0xd43f('0x55'),'COUNT':_0xd43f('0x56'),'COUNT DISTINCT':_0xd43f('0x88'),'MAX':_0xd43f('0x57'),'MIN':'MIN(%s)','AVG':_0xd43f('0x59'),'GROUP_CONCAT':_0xd43f('0x5a'),'GROUP_CONCAT ASC':_0xd43f('0x89'),'GROUP_CONCAT DESC':_0xd43f('0x5b')};var _0x496619={'SEC_TO_TIME':_0xd43f('0x5c'),'DATE':'DATE(%s)','HOUR':_0xd43f('0x5e'),'ROUND':_0xd43f('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc9c1ba=function(_0x4fcd30){return!_[_0xd43f('0x7a')]([_0xd43f('0x61'),_0xd43f('0x8a'),_0xd43f('0x62'),_0xd43f('0x63')],_0x4fcd30);};var _0xfae877=function(_0x16e1ec){if(!_0x16e1ec||!_0x16e1ec[_0xd43f('0x64')][_0xd43f('0x36')]){return'';}for(var _0x5e9f4d='(',_0x14bee3=0x0;_0x14bee3<_0x16e1ec[_0xd43f('0x64')][_0xd43f('0x36')];_0x14bee3+=0x1){_0x14bee3>0x0&&(_0x5e9f4d+='\x20'+_0x16e1ec[_0xd43f('0xa4')]+'\x20');_0x5e9f4d+=_0x16e1ec[_0xd43f('0x64')][_0x14bee3][_0xd43f('0x65')]?_0xfae877(_0x16e1ec['rules'][_0x14bee3][_0xd43f('0x65')]):_0x16e1ec[_0xd43f('0x64')][_0x14bee3][_0xd43f('0x66')]+'\x20'+_0x16e1ec['rules'][_0x14bee3][_0xd43f('0x67')]+(_0xc9c1ba(_0x16e1ec[_0xd43f('0x64')][_0x14bee3][_0xd43f('0x67')])?'\x20'+_0x16e1ec[_0xd43f('0x64')][_0x14bee3][_0xd43f('0x68')]:'');}return _0x5e9f4d+')';};var _0x4c7eab={'where':{'id':_0x31e8ba[_0xd43f('0x51')]['id']}},_0x1bc00c,_0x40e4f6,_0x485408,_0x42a880,_0x25c76c;_0x4c7eab=_['merge']({},_0x4c7eab,_0x31e8ba[_0xd43f('0x3e')]);return db[_0xd43f('0x45')]['find'](_0x4c7eab)[_0xd43f('0x22')](function(_0x55505c){if(_0x55505c){_0x1bc00c=_0x55505c;return _0x55505c['getFields']();}return null;})['then'](function(_0x5eaf8e){if(_0x5eaf8e){if(!_0x5eaf8e[_0xd43f('0x36')]){throw new db[(_0xd43f('0x6a'))][(_0xd43f('0x8b'))](_0xd43f('0x6b'),0x193);}_0x40e4f6=_0x5eaf8e;return db[_0xd43f('0x6c')][_0xd43f('0x40')]({'raw':!![]});}return null;})[_0xd43f('0x22')](function(_0x509712){if(_0x509712){_0x485408=_[_0xd43f('0x6d')](_0x509712,'id');var _0x1a0217;var _0x2cec28=squel['select']();_0x2cec28[_0xd43f('0x6f')](_0x1bc00c[_0xd43f('0x7f')]);for(var _0x599be2=0x0;_0x599be2<_0x40e4f6['length'];_0x599be2+=0x1){_0x1a0217=_0x40e4f6[_0x599be2][_0xd43f('0x70')]?_0x485408[_0x40e4f6[_0x599be2]['MetricId']]['metric']:_0x40e4f6[_0x599be2][_0xd43f('0x66')];_0x1a0217=_0x40e4f6[_0x599be2][_0xd43f('0x73')]?_[_0xd43f('0x72')](_0x2c271f[_0x40e4f6[_0x599be2][_0xd43f('0x73')]],'%s',_0x1a0217):_0x1a0217;_0x1a0217=_0x40e4f6[_0x599be2][_0xd43f('0x74')]?_[_0xd43f('0x72')](_0x496619[_0x40e4f6[_0x599be2][_0xd43f('0x74')]],'%s',_0x1a0217):_0x1a0217;if(_0x40e4f6[_0x599be2][_0xd43f('0x8c')]){_0x2cec28[_0xd43f('0x65')](_0x1a0217);}_0x40e4f6[_0x599be2][_0xd43f('0x75')]&&_0x2cec28['order'](_0x1a0217,_0x40e4f6[_0x599be2][_0xd43f('0x75')]===_0xd43f('0x76')?![]:!![]);_0x2cec28['field'](_0x1a0217,_0x40e4f6[_0x599be2][_0xd43f('0x77')]||_0x1a0217);}if(_0x1bc00c['joins']){_0x1bc00c[_0xd43f('0x78')]=JSON[_0xd43f('0x79')](_0x1bc00c[_0xd43f('0x78')]);for(var _0x12409=0x0;_0x12409<_0x1bc00c[_0xd43f('0x78')][_0xd43f('0x36')];_0x12409+=0x1){if(_0x1bc00c[_0xd43f('0x78')][_0x12409]['type']&&_[_0xd43f('0x7a')](_0x104def,_0x1bc00c[_0xd43f('0x78')][_0x12409][_0xd43f('0x2b')])&&_0x1bc00c[_0xd43f('0x78')][_0x12409]['parentKey']&&_0x1bc00c[_0xd43f('0x78')][_0x12409][_0xd43f('0x7c')]&&_0x1bc00c['joins'][_0x12409][_0xd43f('0x7d')]){_0x2cec28[_0x1bc00c['joins'][_0x12409][_0xd43f('0x2b')]](_0x1bc00c['joins'][_0x12409][_0xd43f('0x7c')],null,util[_0xd43f('0x74')]('%s.%s\x20=\x20%s.%s',_0x1bc00c[_0xd43f('0x7f')],_0x1bc00c[_0xd43f('0x78')][_0x12409][_0xd43f('0x7b')],_0x1bc00c[_0xd43f('0x78')][_0x12409][_0xd43f('0x7c')],_0x1bc00c['joins'][_0x12409][_0xd43f('0x7d')]));}}}if(_0x1bc00c['conditions']){_0x1bc00c['conditions']=JSON[_0xd43f('0x79')](_0x1bc00c[_0xd43f('0x80')]);_0x2cec28[_0xd43f('0x3c')](_0xfae877(_0x1bc00c[_0xd43f('0x80')][_0xd43f('0x65')]));}_0x25c76c=_0x2cec28[_0xd43f('0x8d')]();_0x2cec28[_0xd43f('0x1b')](_0x442a62);_0x2cec28[_0xd43f('0x1c')](0x0);logger[_0xd43f('0x81')](_0xd43f('0x82'),_0x2cec28[_0xd43f('0x83')]());return dbH['sequelize'][_0xd43f('0x30')](_0x2cec28[_0xd43f('0x83')](),{'type':dbH['sequelize'][_0xd43f('0x85')]['SELECT']});}})[_0xd43f('0x22')](function(){return{'sql':_0x25c76c[_0xd43f('0x83')]()};})[_0xd43f('0x22')](respondWithResult(_0xb37531,null))[_0xd43f('0x42')](handleError(_0xb37531,null));}; \ No newline at end of file +var _0xbbfd=['json','apply','reject','save','then','destroy','get','error','stack','name','index','AnalyticCustomReport','fieldName','type','map','query','filters','intersection','model','fields','attributes','nolimit','sort','where','pick','filter','merge','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','userProfileId','autoAssociation','UserProfileResource','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','joins','parse','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','table','foreignTable','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','DATE(%s)','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range'];(function(_0x351af1,_0x2770f7){var _0x2aaafd=function(_0x149d25){while(--_0x149d25){_0x351af1['push'](_0x351af1['shift']());}};_0x2aaafd(++_0x2770f7);}(_0xbbfd,0x86));var _0xdbbf=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xbbfd[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdbbf('0x0'));var zipdir=require(_0xdbbf('0x1'));var jsonpatch=require(_0xdbbf('0x2'));var rp=require('request-promise');var moment=require(_0xdbbf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdbbf('0x4'));var util=require(_0xdbbf('0x5'));var path=require(_0xdbbf('0x6'));var sox=require(_0xdbbf('0x7'));var csv=require(_0xdbbf('0x8'));var ejs=require(_0xdbbf('0x9'));var fs=require('fs');var fs_extra=require(_0xdbbf('0xa'));var _=require(_0xdbbf('0xb'));var squel=require(_0xdbbf('0xc'));var crypto=require(_0xdbbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdbbf('0xe'));var toCsv=require(_0xdbbf('0x8'));var querystring=require('querystring');var Papa=require(_0xdbbf('0xf'));var Redis=require(_0xdbbf('0x10'));var authService=require(_0xdbbf('0x11'));var qs=require(_0xdbbf('0x12'));var as=require(_0xdbbf('0x13'));var hardwareService=require(_0xdbbf('0x14'));var logger=require(_0xdbbf('0x15'))(_0xdbbf('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdbbf('0x17'));var db=require(_0xdbbf('0x18'))['db'];var dbH=require(_0xdbbf('0x18'))['dbH'];function respondWithStatusCode(_0x20eb8c,_0x475dbf){_0x475dbf=_0x475dbf||0xcc;return function(_0x34a21e){if(_0x34a21e){return _0x20eb8c[_0xdbbf('0x19')](_0x475dbf);}return _0x20eb8c[_0xdbbf('0x1a')](_0x475dbf)[_0xdbbf('0x1b')]();};}function respondWithResult(_0x4dfa93,_0x2bdc38){_0x2bdc38=_0x2bdc38||0xc8;return function(_0x57a05c){if(_0x57a05c){return _0x4dfa93[_0xdbbf('0x1a')](_0x2bdc38)['json'](_0x57a05c);}};}function respondWithFilteredResult(_0x3984a6,_0x4aae54){return function(_0x2fb66b){if(_0x2fb66b){var _0x1c86e4=typeof _0x4aae54['offset']===_0xdbbf('0x1c')&&typeof _0x4aae54[_0xdbbf('0x1d')]===_0xdbbf('0x1c');var _0x4faec3=_0x2fb66b[_0xdbbf('0x1e')];var _0x4f6412=_0x1c86e4?0x0:_0x4aae54[_0xdbbf('0x1f')];var _0x42c3e0=_0x1c86e4?_0x2fb66b['count']:_0x4aae54[_0xdbbf('0x1f')]+_0x4aae54['limit'];var _0x39555f;if(_0x42c3e0>=_0x4faec3){_0x42c3e0=_0x4faec3;_0x39555f=0xc8;}else{_0x39555f=0xce;}_0x3984a6['status'](_0x39555f);return _0x3984a6[_0xdbbf('0x20')](_0xdbbf('0x21'),_0x4f6412+'-'+_0x42c3e0+'/'+_0x4faec3)[_0xdbbf('0x22')](_0x2fb66b);}return null;};}function patchUpdates(_0x5591a6){return function(_0x41f62f){try{jsonpatch[_0xdbbf('0x23')](_0x41f62f,_0x5591a6,!![]);}catch(_0x300088){return BPromise[_0xdbbf('0x24')](_0x300088);}return _0x41f62f[_0xdbbf('0x25')]();};}function saveUpdates(_0x1cb1f1,_0x18bbf5){return function(_0x47a11c){if(_0x47a11c){return _0x47a11c['update'](_0x1cb1f1)[_0xdbbf('0x26')](function(_0x1b44e){return _0x1b44e;});}return null;};}function removeEntity(_0x12d4f6,_0x553185){return function(_0x234016){if(_0x234016){return _0x234016[_0xdbbf('0x27')]()[_0xdbbf('0x26')](function(){var _0x31d534=_0x234016[_0xdbbf('0x28')]({'plain':!![]});var _0x30bc90='CustomReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x30bc90,'resourceId':_0x31d534['id']}})[_0xdbbf('0x26')](function(){return _0x234016;});})[_0xdbbf('0x26')](function(){_0x12d4f6[_0xdbbf('0x1a')](0xcc)[_0xdbbf('0x1b')]();});}};}function handleEntityNotFound(_0x254e81,_0x35ba15){return function(_0x3d1f96){if(!_0x3d1f96){_0x254e81[_0xdbbf('0x19')](0x194);}return _0x3d1f96;};}function handleError(_0x2ae913,_0x1dac6c){_0x1dac6c=_0x1dac6c||0x1f4;return function(_0x5ede4b){logger[_0xdbbf('0x29')](_0x5ede4b[_0xdbbf('0x2a')]);if(_0x5ede4b[_0xdbbf('0x2b')]){delete _0x5ede4b[_0xdbbf('0x2b')];}_0x2ae913[_0xdbbf('0x1a')](_0x1dac6c)['send'](_0x5ede4b);};}exports[_0xdbbf('0x2c')]=function(_0x410089,_0x5d089d){var _0x4f2c78={},_0x16018d={},_0x5c1f68={'count':0x0,'rows':[]};var _0x4a5792=_['map'](db[_0xdbbf('0x2d')]['rawAttributes'],function(_0x4a9f8f){return{'name':_0x4a9f8f[_0xdbbf('0x2e')],'type':_0x4a9f8f[_0xdbbf('0x2f')]['key']};});_0x16018d['model']=_[_0xdbbf('0x30')](_0x4a5792,_0xdbbf('0x2b'));_0x16018d[_0xdbbf('0x31')]=_['keys'](_0x410089[_0xdbbf('0x31')]);_0x16018d[_0xdbbf('0x32')]=_[_0xdbbf('0x33')](_0x16018d[_0xdbbf('0x34')],_0x16018d['query']);_0x4f2c78['attributes']=_[_0xdbbf('0x33')](_0x16018d[_0xdbbf('0x34')],qs[_0xdbbf('0x35')](_0x410089[_0xdbbf('0x31')][_0xdbbf('0x35')]));_0x4f2c78[_0xdbbf('0x36')]=_0x4f2c78[_0xdbbf('0x36')]['length']?_0x4f2c78[_0xdbbf('0x36')]:_0x16018d[_0xdbbf('0x34')];if(!_0x410089[_0xdbbf('0x31')]['hasOwnProperty'](_0xdbbf('0x37'))){_0x4f2c78[_0xdbbf('0x1d')]=qs[_0xdbbf('0x1d')](_0x410089[_0xdbbf('0x31')][_0xdbbf('0x1d')]);_0x4f2c78[_0xdbbf('0x1f')]=qs['offset'](_0x410089[_0xdbbf('0x31')][_0xdbbf('0x1f')]);}_0x4f2c78['order']=qs[_0xdbbf('0x38')](_0x410089['query']['sort']);_0x4f2c78[_0xdbbf('0x39')]=qs[_0xdbbf('0x32')](_[_0xdbbf('0x3a')](_0x410089[_0xdbbf('0x31')],_0x16018d[_0xdbbf('0x32')]),_0x4a5792);if(_0x410089[_0xdbbf('0x31')][_0xdbbf('0x3b')]){_0x4f2c78[_0xdbbf('0x39')]=_[_0xdbbf('0x3c')](_0x4f2c78[_0xdbbf('0x39')],{'$or':_['map'](_0x4a5792,function(_0x46770a){if(_0x46770a['type']!=='VIRTUAL'){var _0x250476={};_0x250476[_0x46770a[_0xdbbf('0x2b')]]={'$like':'%'+_0x410089[_0xdbbf('0x31')]['filter']+'%'};return _0x250476;}})});}_0x4f2c78=_['merge']({},_0x4f2c78,_0x410089['options']);var _0x197d07={'where':_0x4f2c78[_0xdbbf('0x39')]};return db[_0xdbbf('0x2d')][_0xdbbf('0x1e')](_0x197d07)['then'](function(_0x204446){_0x5c1f68[_0xdbbf('0x1e')]=_0x204446;if(_0x410089[_0xdbbf('0x31')]['includeAll']){_0x4f2c78['include']=[{'all':!![]}];}return db[_0xdbbf('0x2d')][_0xdbbf('0x3d')](_0x4f2c78);})[_0xdbbf('0x26')](function(_0x43a6d4){_0x5c1f68[_0xdbbf('0x3e')]=_0x43a6d4;return _0x5c1f68;})[_0xdbbf('0x26')](respondWithFilteredResult(_0x5d089d,_0x4f2c78))[_0xdbbf('0x3f')](handleError(_0x5d089d,null));};exports[_0xdbbf('0x40')]=function(_0x36b1e1,_0x183e73){var _0x20ef82={'raw':![],'where':{'id':_0x36b1e1[_0xdbbf('0x41')]['id']}},_0x258859={};_0x258859[_0xdbbf('0x34')]=_[_0xdbbf('0x42')](db[_0xdbbf('0x2d')][_0xdbbf('0x43')]);_0x258859[_0xdbbf('0x31')]=_[_0xdbbf('0x42')](_0x36b1e1['query']);_0x258859[_0xdbbf('0x32')]=_[_0xdbbf('0x33')](_0x258859[_0xdbbf('0x34')],_0x258859[_0xdbbf('0x31')]);_0x20ef82[_0xdbbf('0x36')]=_[_0xdbbf('0x33')](_0x258859[_0xdbbf('0x34')],qs[_0xdbbf('0x35')](_0x36b1e1[_0xdbbf('0x31')][_0xdbbf('0x35')]));_0x20ef82['attributes']=_0x20ef82[_0xdbbf('0x36')][_0xdbbf('0x44')]?_0x20ef82[_0xdbbf('0x36')]:_0x258859[_0xdbbf('0x34')];if(_0x36b1e1[_0xdbbf('0x31')][_0xdbbf('0x45')]){_0x20ef82[_0xdbbf('0x46')]=[{'all':!![]}];}_0x20ef82=_[_0xdbbf('0x3c')]({},_0x20ef82,_0x36b1e1[_0xdbbf('0x47')]);return db['AnalyticCustomReport'][_0xdbbf('0x48')](_0x20ef82)['then'](handleEntityNotFound(_0x183e73,null))[_0xdbbf('0x26')](respondWithResult(_0x183e73,null))['catch'](handleError(_0x183e73,null));};exports[_0xdbbf('0x49')]=function(_0x52f879,_0xc27cb7){return db['AnalyticCustomReport']['create'](_0x52f879[_0xdbbf('0x4a')],{})['then'](function(_0x1027e9){var _0x15f34f=_0x52f879[_0xdbbf('0x4b')][_0xdbbf('0x28')]({'plain':!![]});if(!_0x15f34f)throw new Error(_0xdbbf('0x4c'));if(_0x15f34f['role']===_0xdbbf('0x4b')){var _0x9c9da=_0x1027e9[_0xdbbf('0x28')]({'plain':!![]});var _0x212ab1=_0xdbbf('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x212ab1,'userProfileId':_0x15f34f[_0xdbbf('0x4e')]},'raw':!![]})[_0xdbbf('0x26')](function(_0x580e2f){if(_0x580e2f&&_0x580e2f[_0xdbbf('0x4f')]===0x0){return db[_0xdbbf('0x50')]['create']({'name':_0x9c9da[_0xdbbf('0x2b')],'resourceId':_0x9c9da['id'],'type':_0xdbbf('0x51'),'sectionId':_0x580e2f['id']},{})[_0xdbbf('0x26')](function(){return _0x1027e9;});}else{return _0x1027e9;}})[_0xdbbf('0x3f')](function(_0x1adb04){logger['error'](_0xdbbf('0x52'),_0x1adb04);throw _0x1adb04;});}return _0x1027e9;})[_0xdbbf('0x26')](respondWithResult(_0xc27cb7,0xc9))['catch'](handleError(_0xc27cb7,null));};exports[_0xdbbf('0x53')]=function(_0x39a035,_0x600a3c){if(_0x39a035[_0xdbbf('0x4a')]['id']){delete _0x39a035[_0xdbbf('0x4a')]['id'];}return db[_0xdbbf('0x2d')]['find']({'where':{'id':_0x39a035[_0xdbbf('0x41')]['id']}})[_0xdbbf('0x26')](handleEntityNotFound(_0x600a3c,null))[_0xdbbf('0x26')](saveUpdates(_0x39a035[_0xdbbf('0x4a')],null))[_0xdbbf('0x26')](respondWithResult(_0x600a3c,null))['catch'](handleError(_0x600a3c,null));};exports['destroy']=function(_0x4f959f,_0x53faa7){return db[_0xdbbf('0x2d')][_0xdbbf('0x48')]({'where':{'id':_0x4f959f[_0xdbbf('0x41')]['id']}})[_0xdbbf('0x26')](handleEntityNotFound(_0x53faa7,null))['then'](removeEntity(_0x53faa7,null))[_0xdbbf('0x3f')](handleError(_0x53faa7,null));};exports[_0xdbbf('0x54')]=function(_0x137d98,_0x4c6612){var _0x5b8058=0xa;var _0x2951bf=[_0xdbbf('0x55'),_0xdbbf('0x56'),_0xdbbf('0x57'),_0xdbbf('0x58')];var _0x4bc9b8={'SUM':_0xdbbf('0x59'),'COUNT':_0xdbbf('0x5a'),'COUNT DISTINCT':_0xdbbf('0x5b'),'MAX':_0xdbbf('0x5c'),'MIN':_0xdbbf('0x5d'),'AVG':_0xdbbf('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xdbbf('0x5f')};var _0x3da128={'SEC_TO_TIME':_0xdbbf('0x60'),'DATE':'DATE(%s)','HOUR':_0xdbbf('0x61'),'ROUND':_0xdbbf('0x62'),'UNIX_TIMESTAMP':_0xdbbf('0x63')};var _0x4963be=function(_0x4588c8){return!_[_0xdbbf('0x64')]([_0xdbbf('0x65'),_0xdbbf('0x66'),_0xdbbf('0x67'),_0xdbbf('0x68')],_0x4588c8);};var _0x503e25=function(_0x594cd8){if(!_0x594cd8||!_0x594cd8[_0xdbbf('0x69')]['length']){return'';}for(var _0x2acde='(',_0x573466=0x0;_0x573466<_0x594cd8[_0xdbbf('0x69')][_0xdbbf('0x44')];_0x573466+=0x1){_0x573466>0x0&&(_0x2acde+='\x20'+_0x594cd8['operator']+'\x20');_0x2acde+=_0x594cd8[_0xdbbf('0x69')][_0x573466]['group']?_0x503e25(_0x594cd8['rules'][_0x573466][_0xdbbf('0x6a')]):_0x594cd8[_0xdbbf('0x69')][_0x573466][_0xdbbf('0x6b')]+'\x20'+_0x594cd8[_0xdbbf('0x69')][_0x573466][_0xdbbf('0x6c')]+(_0x4963be(_0x594cd8['rules'][_0x573466][_0xdbbf('0x6c')])?'\x20'+_0x594cd8[_0xdbbf('0x69')][_0x573466][_0xdbbf('0x6d')]:'');}return _0x2acde+')';};var _0x49312a={'where':{'id':_0x137d98['params']['id']}},_0x257a79,_0x481d40,_0x5e142b,_0x1e8e22,_0xae0fd2;_0x49312a=_['merge']({},_0x49312a,_0x137d98[_0xdbbf('0x47')]);return db[_0xdbbf('0x2d')][_0xdbbf('0x48')](_0x49312a)[_0xdbbf('0x26')](function(_0x122d00){if(_0x122d00){_0x257a79=_0x122d00;return _0x122d00[_0xdbbf('0x6e')]();}return null;})[_0xdbbf('0x26')](function(_0x8944b3){if(_0x8944b3){if(!_0x8944b3[_0xdbbf('0x44')]){throw new db[(_0xdbbf('0x6f'))][(_0xdbbf('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x481d40=_0x8944b3;return db[_0xdbbf('0x71')][_0xdbbf('0x3d')]({'raw':!![]});}return null;})[_0xdbbf('0x26')](function(_0x453b28){if(_0x453b28){_0x5e142b=_[_0xdbbf('0x72')](_0x453b28,'id');var _0x4a2db5;var _0x39bc1c=squel[_0xdbbf('0x73')]();_0x39bc1c[_0xdbbf('0x74')](_0x257a79['table']);for(var _0x1e3f8b=0x0;_0x1e3f8b<_0x481d40[_0xdbbf('0x44')];_0x1e3f8b+=0x1){_0x4a2db5=_0x481d40[_0x1e3f8b][_0xdbbf('0x75')]?_0x5e142b[_0x481d40[_0x1e3f8b][_0xdbbf('0x75')]][_0xdbbf('0x76')]:_0x481d40[_0x1e3f8b][_0xdbbf('0x6b')];_0x4a2db5=_0x481d40[_0x1e3f8b]['function']?_['replace'](_0x4bc9b8[_0x481d40[_0x1e3f8b][_0xdbbf('0x77')]],'%s',_0x4a2db5):_0x4a2db5;_0x4a2db5=_0x481d40[_0x1e3f8b]['format']?_[_0xdbbf('0x78')](_0x3da128[_0x481d40[_0x1e3f8b][_0xdbbf('0x79')]],'%s',_0x4a2db5):_0x4a2db5;if(_0x481d40[_0x1e3f8b]['groupBy']){_0x39bc1c['group'](_0x4a2db5);}_0x481d40[_0x1e3f8b][_0xdbbf('0x7a')]&&_0x39bc1c[_0xdbbf('0x7b')](_0x4a2db5,_0x481d40[_0x1e3f8b][_0xdbbf('0x7a')]===_0xdbbf('0x7c')?![]:!![]);_0x39bc1c[_0xdbbf('0x6b')](_0x4a2db5,_0x481d40[_0x1e3f8b][_0xdbbf('0x7d')]||_0x4a2db5);}if(_0x257a79[_0xdbbf('0x7e')]){_0x257a79[_0xdbbf('0x7e')]=JSON[_0xdbbf('0x7f')](_0x257a79[_0xdbbf('0x7e')]);for(var _0x332399=0x0;_0x332399<_0x257a79['joins'][_0xdbbf('0x44')];_0x332399+=0x1){if(_0x257a79[_0xdbbf('0x7e')][_0x332399][_0xdbbf('0x2f')]&&_[_0xdbbf('0x64')](_0x2951bf,_0x257a79['joins'][_0x332399][_0xdbbf('0x2f')])&&_0x257a79['joins'][_0x332399][_0xdbbf('0x80')]&&_0x257a79['joins'][_0x332399]['foreignTable']&&_0x257a79['joins'][_0x332399][_0xdbbf('0x81')]){_0x39bc1c[_0x257a79['joins'][_0x332399][_0xdbbf('0x2f')]](_0x257a79[_0xdbbf('0x7e')][_0x332399]['foreignTable'],null,util[_0xdbbf('0x79')](_0xdbbf('0x82'),_0x257a79[_0xdbbf('0x83')],_0x257a79[_0xdbbf('0x7e')][_0x332399][_0xdbbf('0x80')],_0x257a79[_0xdbbf('0x7e')][_0x332399][_0xdbbf('0x84')],_0x257a79['joins'][_0x332399]['foreignKey']));}}}if(_0x257a79[_0xdbbf('0x85')]){_0x257a79['conditions']=JSON['parse'](_0x257a79[_0xdbbf('0x85')]);_0x39bc1c[_0xdbbf('0x39')](_0x503e25(_0x257a79[_0xdbbf('0x85')][_0xdbbf('0x6a')]));}_0xae0fd2=_0x39bc1c[_0xdbbf('0x86')]();_0x39bc1c['limit'](_0x5b8058);_0x39bc1c['offset'](0x0);logger[_0xdbbf('0x87')]('Limited\x20Query:',_0x39bc1c[_0xdbbf('0x88')]());return dbH[_0xdbbf('0x89')]['query'](_0x39bc1c[_0xdbbf('0x88')](),{'type':dbH[_0xdbbf('0x89')][_0xdbbf('0x8a')][_0xdbbf('0x8b')]});}})[_0xdbbf('0x26')](respondWithResult(_0x4c6612,null))[_0xdbbf('0x3f')](handleError(_0x4c6612,null));};function runReport(_0x134268,_0x4cd2f6,_0x3afa89){var _0xc527b=_0x4cd2f6['name'];var _0x3f8b0f=0xa;var _0xdaec6b=[_0xdbbf('0x55'),'left_join',_0xdbbf('0x57'),'cross_join'];var _0x9f06d7={'SUM':'SUM(%s)','COUNT':_0xdbbf('0x5a'),'COUNT DISTINCT':_0xdbbf('0x5b'),'MAX':'MAX(%s)','MIN':_0xdbbf('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xdbbf('0x5f')};var _0x5ef9aa={'SEC_TO_TIME':_0xdbbf('0x60'),'DATE':_0xdbbf('0x8c'),'HOUR':_0xdbbf('0x61'),'ROUND':_0xdbbf('0x62'),'UNIX_TIMESTAMP':_0xdbbf('0x63')};var _0x5e3a41=function(_0x41997a){return!_['includes']([_0xdbbf('0x65'),_0xdbbf('0x66'),'IS\x20EMPTY',_0xdbbf('0x68')],_0x41997a);};var _0x235fa3=function(_0x55cbdb){if(!_0x55cbdb||!_0x55cbdb[_0xdbbf('0x69')][_0xdbbf('0x44')]){return'';}for(var _0x447aca='(',_0x4a28cb=0x0;_0x4a28cb<_0x55cbdb[_0xdbbf('0x69')]['length'];_0x4a28cb+=0x1){_0x4a28cb>0x0&&(_0x447aca+='\x20'+_0x55cbdb['operator']+'\x20');_0x447aca+=_0x55cbdb[_0xdbbf('0x69')][_0x4a28cb][_0xdbbf('0x6a')]?_0x235fa3(_0x55cbdb['rules'][_0x4a28cb]['group']):_0x55cbdb[_0xdbbf('0x69')][_0x4a28cb][_0xdbbf('0x6b')]+'\x20'+_0x55cbdb[_0xdbbf('0x69')][_0x4a28cb][_0xdbbf('0x6c')]+(_0x5e3a41(_0x55cbdb[_0xdbbf('0x69')][_0x4a28cb]['condition'])?'\x20'+_0x55cbdb[_0xdbbf('0x69')][_0x4a28cb][_0xdbbf('0x6d')]:'');}return _0x447aca+')';};var _0x1e416c={'where':{'id':_0x134268['id']}},_0x4a25e3,_0x54aed1,_0x49f92e,_0x21e019,_0x8b7fcf;_0x1e416c=_['merge']({},_0x1e416c,_0x3afa89);return db[_0xdbbf('0x2d')][_0xdbbf('0x48')](_0x1e416c)[_0xdbbf('0x26')](function(_0x9fd12d){if(_0x9fd12d){_0x4a25e3=_0x9fd12d;return _0x9fd12d['getFields']();}return null;})[_0xdbbf('0x26')](function(_0x5eef4d){if(_0x5eef4d){if(!_0x5eef4d[_0xdbbf('0x44')]){throw new db['Sequelize'][(_0xdbbf('0x70'))](_0xdbbf('0x8d'),0x193);}_0x54aed1=_0x5eef4d;return db[_0xdbbf('0x71')][_0xdbbf('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x10bbec){if(_0x10bbec){_0x49f92e=_[_0xdbbf('0x72')](_0x10bbec,'id');var _0x59e55d;var _0x3c78e5=squel[_0xdbbf('0x73')]();_0x3c78e5[_0xdbbf('0x74')](_0x4a25e3[_0xdbbf('0x83')]);for(var _0x305bb1=0x0;_0x305bb1<_0x54aed1[_0xdbbf('0x44')];_0x305bb1+=0x1){_0x59e55d=_0x54aed1[_0x305bb1][_0xdbbf('0x75')]?_0x49f92e[_0x54aed1[_0x305bb1][_0xdbbf('0x75')]][_0xdbbf('0x76')]:_0x54aed1[_0x305bb1][_0xdbbf('0x6b')];_0x59e55d=_0x54aed1[_0x305bb1][_0xdbbf('0x77')]?_['replace'](_0x9f06d7[_0x54aed1[_0x305bb1][_0xdbbf('0x77')]],'%s',_0x59e55d):_0x59e55d;_0x59e55d=_0x54aed1[_0x305bb1][_0xdbbf('0x79')]?_[_0xdbbf('0x78')](_0x5ef9aa[_0x54aed1[_0x305bb1][_0xdbbf('0x79')]],'%s',_0x59e55d):_0x59e55d;if(_0x54aed1[_0x305bb1][_0xdbbf('0x8e')]){_0x3c78e5[_0xdbbf('0x6a')](_0x59e55d);}_0x54aed1[_0x305bb1][_0xdbbf('0x7a')]&&_0x3c78e5[_0xdbbf('0x7b')](_0x59e55d,_0x54aed1[_0x305bb1][_0xdbbf('0x7a')]===_0xdbbf('0x7c')?![]:!![]);_0x3c78e5[_0xdbbf('0x6b')](_0x59e55d,_0x54aed1[_0x305bb1]['alias']||_0x59e55d);}if(_0x4a25e3[_0xdbbf('0x7e')]){_0x4a25e3[_0xdbbf('0x7e')]=JSON[_0xdbbf('0x7f')](_0x4a25e3[_0xdbbf('0x7e')]);for(var _0x3dc80d=0x0;_0x3dc80d<_0x4a25e3[_0xdbbf('0x7e')][_0xdbbf('0x44')];_0x3dc80d+=0x1){if(_0x4a25e3['joins'][_0x3dc80d][_0xdbbf('0x2f')]&&_['includes'](_0xdaec6b,_0x4a25e3[_0xdbbf('0x7e')][_0x3dc80d][_0xdbbf('0x2f')])&&_0x4a25e3['joins'][_0x3dc80d][_0xdbbf('0x80')]&&_0x4a25e3['joins'][_0x3dc80d]['foreignTable']&&_0x4a25e3[_0xdbbf('0x7e')][_0x3dc80d][_0xdbbf('0x81')]){_0x3c78e5[_0x4a25e3[_0xdbbf('0x7e')][_0x3dc80d][_0xdbbf('0x2f')]](_0x4a25e3[_0xdbbf('0x7e')][_0x3dc80d]['foreignTable'],null,util[_0xdbbf('0x79')](_0xdbbf('0x82'),_0x4a25e3[_0xdbbf('0x83')],_0x4a25e3[_0xdbbf('0x7e')][_0x3dc80d][_0xdbbf('0x80')],_0x4a25e3['joins'][_0x3dc80d]['foreignTable'],_0x4a25e3[_0xdbbf('0x7e')][_0x3dc80d]['foreignKey']));}}}if(_0x4a25e3[_0xdbbf('0x85')]){_0x4a25e3[_0xdbbf('0x85')]=JSON[_0xdbbf('0x7f')](_0x4a25e3[_0xdbbf('0x85')]);_0x3c78e5['where'](_0x235fa3(_0x4a25e3[_0xdbbf('0x85')][_0xdbbf('0x6a')]));}_0x8b7fcf=_0x3c78e5[_0xdbbf('0x86')]();_0x3c78e5[_0xdbbf('0x1d')](_0x3f8b0f);_0x3c78e5[_0xdbbf('0x1f')](0x0);return;}})[_0xdbbf('0x26')](function(){if(_0x4cd2f6[_0xdbbf('0x8f')]===_0xdbbf('0x90')){return null;}var _0xc29f2b=_['merge'](_0x4cd2f6,{'name':_0x4cd2f6[_0xdbbf('0x91')]||_0x4cd2f6['name']||_0x4a25e3['name'],'basename':_0xc527b,'savename':util[_0xdbbf('0x79')](_0xdbbf('0x92'),_0x4cd2f6[_0xdbbf('0x2b')]||_0x4a25e3[_0xdbbf('0x2b')],require(_0xdbbf('0x93'))[_0xdbbf('0x94')](0x4),_0x4cd2f6[_0xdbbf('0x8f')]||'csv'),'reportId':_0x4a25e3['id'],'reportType':_0xdbbf('0x95')});return db[_0xdbbf('0x96')][_0xdbbf('0x49')](_0xc29f2b,{'raw':!![]});})[_0xdbbf('0x26')](function(_0x2b807f){if(_0x4a25e3[_0xdbbf('0x83')]===_0xdbbf('0x97')){_0x8b7fcf[_0xdbbf('0x39')](_0x4a25e3['table']+_0xdbbf('0x98'),_0x4cd2f6['startDate'],_0x4cd2f6[_0xdbbf('0x99')]);}else{_0x8b7fcf[_0xdbbf('0x39')](_0x4a25e3[_0xdbbf('0x83')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4cd2f6[_0xdbbf('0x9a')],_0x4cd2f6[_0xdbbf('0x99')]);}if(_0x2b807f){logger[_0xdbbf('0x9b')](_0xdbbf('0x9c'),_0x8b7fcf['toString']());require(_0xdbbf('0x9d'))[_0xdbbf('0x9e')](path[_0xdbbf('0x55')](__dirname,_0xdbbf('0x9f'),_0x2b807f['output']),[_0x2b807f['id'],_0x8b7fcf[_0xdbbf('0x88')](),path['join'](__dirname,_0xdbbf('0xa0'),_0x2b807f[_0xdbbf('0xa1')]),_0xc527b]);return _0x2b807f;}else{var _0x2141e2=squel['select']();_0x2141e2['from']('('+_0x8b7fcf[_0xdbbf('0x88')]()+')',_0xdbbf('0xa2'));_0x2141e2[_0xdbbf('0x6b')](_0xdbbf('0xa3'),'count');_0x8b7fcf['limit'](_0x4cd2f6['limit']||_0x3f8b0f);_0x8b7fcf[_0xdbbf('0x1f')](_0x4cd2f6[_0xdbbf('0x1f')]||0x0);return dbH[_0xdbbf('0x89')][_0xdbbf('0x31')](_0x2141e2[_0xdbbf('0x88')](),{'type':dbH[_0xdbbf('0x89')]['QueryTypes'][_0xdbbf('0x8b')]})[_0xdbbf('0x26')](function(_0x36878f){if(!_0x36878f[_0xdbbf('0x44')]){_0x21e019=0x0;}else{_0x21e019=_0x36878f[0x0][_0xdbbf('0x1e')]||0x0;}return dbH[_0xdbbf('0x89')][_0xdbbf('0x31')](_0x8b7fcf[_0xdbbf('0x88')](),{'type':dbH[_0xdbbf('0x89')][_0xdbbf('0x8a')][_0xdbbf('0x8b')]});})['then'](function(_0x408f61){return{'rows':_0x408f61||[],'count':_0x21e019};});}});}exports[_0xdbbf('0xa4')]=function(_0x5ce43a,_0x263509){return runReport(_0x5ce43a[_0xdbbf('0x41')],_0x5ce43a['query'],_0x5ce43a['options'])[_0xdbbf('0x26')](respondWithResult(_0x263509,null))[_0xdbbf('0x3f')](handleError(_0x263509,null));};exports[_0xdbbf('0xa5')]=runReport;exports[_0xdbbf('0x31')]=function(_0x371bcf,_0x2eea5e){var _0x2bf3a1=0xa;var _0x16903a=[_0xdbbf('0x55'),_0xdbbf('0x56'),_0xdbbf('0x57'),_0xdbbf('0x58')];var _0x48d87a={'SUM':_0xdbbf('0x59'),'COUNT':_0xdbbf('0x5a'),'COUNT DISTINCT':_0xdbbf('0x5b'),'MAX':_0xdbbf('0x5c'),'MIN':'MIN(%s)','AVG':_0xdbbf('0x5e'),'GROUP_CONCAT':_0xdbbf('0xa6'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2b6143={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xdbbf('0x8c'),'HOUR':_0xdbbf('0x61'),'ROUND':_0xdbbf('0x62'),'UNIX_TIMESTAMP':_0xdbbf('0x63')};var _0x214280=function(_0x33e697){return!_[_0xdbbf('0x64')]([_0xdbbf('0x65'),_0xdbbf('0x66'),_0xdbbf('0x67'),'IS\x20NOT\x20EMPTY'],_0x33e697);};var _0x26c310=function(_0x13165e){if(!_0x13165e||!_0x13165e[_0xdbbf('0x69')]['length']){return'';}for(var _0x1aad42='(',_0xcc2c8d=0x0;_0xcc2c8d<_0x13165e[_0xdbbf('0x69')][_0xdbbf('0x44')];_0xcc2c8d+=0x1){_0xcc2c8d>0x0&&(_0x1aad42+='\x20'+_0x13165e['operator']+'\x20');_0x1aad42+=_0x13165e[_0xdbbf('0x69')][_0xcc2c8d][_0xdbbf('0x6a')]?_0x26c310(_0x13165e['rules'][_0xcc2c8d][_0xdbbf('0x6a')]):_0x13165e[_0xdbbf('0x69')][_0xcc2c8d][_0xdbbf('0x6b')]+'\x20'+_0x13165e['rules'][_0xcc2c8d][_0xdbbf('0x6c')]+(_0x214280(_0x13165e[_0xdbbf('0x69')][_0xcc2c8d][_0xdbbf('0x6c')])?'\x20'+_0x13165e[_0xdbbf('0x69')][_0xcc2c8d][_0xdbbf('0x6d')]:'');}return _0x1aad42+')';};var _0x342434={'where':{'id':_0x371bcf[_0xdbbf('0x41')]['id']}},_0x1d751d,_0x4748b1,_0x148f73,_0x3867d7,_0x466a00;_0x342434=_[_0xdbbf('0x3c')]({},_0x342434,_0x371bcf[_0xdbbf('0x47')]);return db[_0xdbbf('0x2d')][_0xdbbf('0x48')](_0x342434)[_0xdbbf('0x26')](function(_0x3d89ba){if(_0x3d89ba){_0x1d751d=_0x3d89ba;return _0x3d89ba[_0xdbbf('0x6e')]();}return null;})[_0xdbbf('0x26')](function(_0x1d500e){if(_0x1d500e){if(!_0x1d500e[_0xdbbf('0x44')]){throw new db[(_0xdbbf('0x6f'))][(_0xdbbf('0x70'))](_0xdbbf('0x8d'),0x193);}_0x4748b1=_0x1d500e;return db[_0xdbbf('0x71')]['findAll']({'raw':!![]});}return null;})[_0xdbbf('0x26')](function(_0x406a66){if(_0x406a66){_0x148f73=_['keyBy'](_0x406a66,'id');var _0x174f0c;var _0x293291=squel[_0xdbbf('0x73')]();_0x293291['from'](_0x1d751d[_0xdbbf('0x83')]);for(var _0x4fb823=0x0;_0x4fb823<_0x4748b1[_0xdbbf('0x44')];_0x4fb823+=0x1){_0x174f0c=_0x4748b1[_0x4fb823][_0xdbbf('0x75')]?_0x148f73[_0x4748b1[_0x4fb823][_0xdbbf('0x75')]][_0xdbbf('0x76')]:_0x4748b1[_0x4fb823]['field'];_0x174f0c=_0x4748b1[_0x4fb823][_0xdbbf('0x77')]?_[_0xdbbf('0x78')](_0x48d87a[_0x4748b1[_0x4fb823][_0xdbbf('0x77')]],'%s',_0x174f0c):_0x174f0c;_0x174f0c=_0x4748b1[_0x4fb823][_0xdbbf('0x79')]?_[_0xdbbf('0x78')](_0x2b6143[_0x4748b1[_0x4fb823][_0xdbbf('0x79')]],'%s',_0x174f0c):_0x174f0c;if(_0x4748b1[_0x4fb823][_0xdbbf('0x8e')]){_0x293291[_0xdbbf('0x6a')](_0x174f0c);}_0x4748b1[_0x4fb823][_0xdbbf('0x7a')]&&_0x293291[_0xdbbf('0x7b')](_0x174f0c,_0x4748b1[_0x4fb823][_0xdbbf('0x7a')]===_0xdbbf('0x7c')?![]:!![]);_0x293291[_0xdbbf('0x6b')](_0x174f0c,_0x4748b1[_0x4fb823][_0xdbbf('0x7d')]||_0x174f0c);}if(_0x1d751d['joins']){_0x1d751d[_0xdbbf('0x7e')]=JSON[_0xdbbf('0x7f')](_0x1d751d[_0xdbbf('0x7e')]);for(var _0x29c47f=0x0;_0x29c47f<_0x1d751d[_0xdbbf('0x7e')]['length'];_0x29c47f+=0x1){if(_0x1d751d[_0xdbbf('0x7e')][_0x29c47f][_0xdbbf('0x2f')]&&_['includes'](_0x16903a,_0x1d751d[_0xdbbf('0x7e')][_0x29c47f][_0xdbbf('0x2f')])&&_0x1d751d[_0xdbbf('0x7e')][_0x29c47f][_0xdbbf('0x80')]&&_0x1d751d[_0xdbbf('0x7e')][_0x29c47f]['foreignTable']&&_0x1d751d[_0xdbbf('0x7e')][_0x29c47f][_0xdbbf('0x81')]){_0x293291[_0x1d751d[_0xdbbf('0x7e')][_0x29c47f]['type']](_0x1d751d[_0xdbbf('0x7e')][_0x29c47f][_0xdbbf('0x84')],null,util['format'](_0xdbbf('0x82'),_0x1d751d[_0xdbbf('0x83')],_0x1d751d[_0xdbbf('0x7e')][_0x29c47f][_0xdbbf('0x80')],_0x1d751d[_0xdbbf('0x7e')][_0x29c47f][_0xdbbf('0x84')],_0x1d751d[_0xdbbf('0x7e')][_0x29c47f]['foreignKey']));}}}if(_0x1d751d[_0xdbbf('0x85')]){_0x1d751d[_0xdbbf('0x85')]=JSON[_0xdbbf('0x7f')](_0x1d751d['conditions']);_0x293291['where'](_0x26c310(_0x1d751d[_0xdbbf('0x85')][_0xdbbf('0x6a')]));}_0x466a00=_0x293291[_0xdbbf('0x86')]();_0x293291[_0xdbbf('0x1d')](_0x2bf3a1);_0x293291[_0xdbbf('0x1f')](0x0);logger[_0xdbbf('0x87')](_0xdbbf('0xa7'),_0x293291[_0xdbbf('0x88')]());return dbH[_0xdbbf('0x89')][_0xdbbf('0x31')](_0x293291[_0xdbbf('0x88')](),{'type':dbH['sequelize']['QueryTypes'][_0xdbbf('0x8b')]});}})[_0xdbbf('0x26')](function(){return{'sql':_0x466a00['toString']()};})[_0xdbbf('0x26')](respondWithResult(_0x2eea5e,null))[_0xdbbf('0x3f')](handleError(_0x2eea5e,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 5f67724..b3c891a 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 _0x3752=['request-promise','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x10df87,_0x4e3dcb){var _0x22923d=function(_0x439738){while(--_0x439738){_0x10df87['push'](_0x10df87['shift']());}};_0x22923d(++_0x4e3dcb);}(_0x3752,0x7e));var _0x2375=function(_0x4ca89a,_0x33ffb8){_0x4ca89a=_0x4ca89a-0x0;var _0xfeb04d=_0x3752[_0x4ca89a];return _0xfeb04d;};'use strict';var _=require(_0x2375('0x0'));var util=require(_0x2375('0x1'));var logger=require(_0x2375('0x2'))(_0x2375('0x3'));var moment=require(_0x2375('0x4'));var BPromise=require(_0x2375('0x5'));var rp=require(_0x2375('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2375('0x7'));var attributes=require(_0x2375('0x8'));module[_0x2375('0x9')]=function(_0x3bf10b,_0x248431){return _0x3bf10b[_0x2375('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x2375('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1608=['request-promise','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1608,0x19f));var _0x8160=function(_0x1db566,_0x3ad36f){_0x1db566=_0x1db566-0x0;var _0x1ad5cb=_0x1608[_0x1db566];return _0x1ad5cb;};'use strict';var _=require(_0x8160('0x0'));var util=require(_0x8160('0x1'));var logger=require(_0x8160('0x2'))(_0x8160('0x3'));var moment=require('moment');var BPromise=require(_0x8160('0x4'));var rp=require(_0x8160('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8160('0x6'));var config=require('../../config/environment');var attributes=require(_0x8160('0x7'));module[_0x8160('0x8')]=function(_0x4ecf28,_0x4169b1){return _0x4ecf28[_0x8160('0x9')](_0x8160('0xa'),attributes,{'tableName':_0x8160('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 18c0e8d..f8c007a 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 _0xd4f3=['error','message','info','catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4d570b,_0x490e1b){var _0x401a28=function(_0x2b1c6c){while(--_0x2b1c6c){_0x4d570b['push'](_0x4d570b['shift']());}};_0x401a28(++_0x490e1b);}(_0xd4f3,0x100));var _0x3d4f=function(_0x2fc33d,_0x4a3a73){_0x2fc33d=_0x2fc33d-0x0;var _0x272473=_0xd4f3[_0x2fc33d];return _0x272473;};'use strict';var _=require(_0x3d4f('0x0'));var util=require(_0x3d4f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d4f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d4f('0x3'));var logger=require(_0x3d4f('0x4'))(_0x3d4f('0x5'));var config=require(_0x3d4f('0x6'));var jayson=require(_0x3d4f('0x7'));var client=jayson[_0x3d4f('0x8')][_0x3d4f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x203e19,_0x49cec7,_0x483a11){return new BPromise(function(_0x59ee01,_0x2b5ec5){return client[_0x3d4f('0xa')](_0x203e19,_0x483a11)[_0x3d4f('0xb')](function(_0x53dd36){logger['info'](_0x3d4f('0xc'),_0x49cec7,_0x3d4f('0xd'));logger[_0x3d4f('0xe')](_0x3d4f('0xf'),_0x49cec7,_0x3d4f('0xd'),JSON[_0x3d4f('0x10')](_0x53dd36));if(_0x53dd36[_0x3d4f('0x11')]){if(_0x53dd36['error']['code']===0x1f4){logger[_0x3d4f('0x11')](_0x3d4f('0xc'),_0x49cec7,_0x53dd36[_0x3d4f('0x11')][_0x3d4f('0x12')]);return _0x2b5ec5(_0x53dd36[_0x3d4f('0x11')][_0x3d4f('0x12')]);}logger[_0x3d4f('0x11')](_0x3d4f('0xc'),_0x49cec7,_0x53dd36[_0x3d4f('0x11')]['message']);return _0x59ee01(_0x53dd36[_0x3d4f('0x11')][_0x3d4f('0x12')]);}else{logger[_0x3d4f('0x13')](_0x3d4f('0xc'),_0x49cec7,_0x3d4f('0xd'));_0x59ee01(_0x53dd36['result'][_0x3d4f('0x12')]);}})[_0x3d4f('0x14')](function(_0x7fce1){logger[_0x3d4f('0x11')](_0x3d4f('0xc'),_0x49cec7,_0x7fce1);_0x2b5ec5(_0x7fce1);});});} \ No newline at end of file +var _0x1eb3=['info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then'];(function(_0xd63e3a,_0x1bd6eb){var _0x19c178=function(_0x56be0d){while(--_0x56be0d){_0xd63e3a['push'](_0xd63e3a['shift']());}};_0x19c178(++_0x1bd6eb);}(_0x1eb3,0x9e));var _0x31eb=function(_0x179657,_0x2d69c5){_0x179657=_0x179657-0x0;var _0x5d6762=_0x1eb3[_0x179657];return _0x5d6762;};'use strict';var _=require(_0x31eb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x31eb('0x1'));var rs=require(_0x31eb('0x2'));var fs=require('fs');var Redis=require(_0x31eb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x31eb('0x4'));var logger=require(_0x31eb('0x5'))('rpc');var config=require(_0x31eb('0x6'));var jayson=require(_0x31eb('0x7'));var client=jayson['client'][_0x31eb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf328d8,_0x35e759,_0x26e20f){return new BPromise(function(_0x4a7a3e,_0x37b608){return client['request'](_0xf328d8,_0x26e20f)[_0x31eb('0x9')](function(_0x413604){logger[_0x31eb('0xa')](_0x31eb('0xb'),_0x35e759,_0x31eb('0xc'));logger[_0x31eb('0xd')](_0x31eb('0xe'),_0x35e759,_0x31eb('0xc'),JSON[_0x31eb('0xf')](_0x413604));if(_0x413604[_0x31eb('0x10')]){if(_0x413604[_0x31eb('0x10')][_0x31eb('0x11')]===0x1f4){logger[_0x31eb('0x10')](_0x31eb('0xb'),_0x35e759,_0x413604[_0x31eb('0x10')][_0x31eb('0x12')]);return _0x37b608(_0x413604['error']['message']);}logger[_0x31eb('0x10')](_0x31eb('0xb'),_0x35e759,_0x413604[_0x31eb('0x10')][_0x31eb('0x12')]);return _0x4a7a3e(_0x413604[_0x31eb('0x10')][_0x31eb('0x12')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x35e759,_0x31eb('0xc'));_0x4a7a3e(_0x413604[_0x31eb('0x13')][_0x31eb('0x12')]);}})[_0x31eb('0x14')](function(_0xe0deb9){logger[_0x31eb('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x35e759,_0xe0deb9);_0x37b608(_0xe0deb9);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 25eabc0..95569a5 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 _0xba5e=['Router','fs-extra','get','isAuthenticated','index','show','preview','/:id/run','/:id/query','post','create','update','/:id','destroy','exports','multer','path','connect-timeout','express'];(function(_0x26c19d,_0x3f7b9b){var _0x37d676=function(_0x4d091e){while(--_0x4d091e){_0x26c19d['push'](_0x26c19d['shift']());}};_0x37d676(++_0x3f7b9b);}(_0xba5e,0x12c));var _0xeba5=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xba5e[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0xeba5('0x0'));var util=require('util');var path=require(_0xeba5('0x1'));var timeout=require(_0xeba5('0x2'));var express=require(_0xeba5('0x3'));var router=express[_0xeba5('0x4')]();var fs_extra=require(_0xeba5('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xeba5('0x6')]('/',auth[_0xeba5('0x7')](),controller[_0xeba5('0x8')]);router[_0xeba5('0x6')]('/:id',auth[_0xeba5('0x7')](),controller[_0xeba5('0x9')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller[_0xeba5('0xa')]);router[_0xeba5('0x6')](_0xeba5('0xb'),auth[_0xeba5('0x7')](),controller['run']);router[_0xeba5('0x6')](_0xeba5('0xc'),auth[_0xeba5('0x7')](),controller['query']);router[_0xeba5('0xd')]('/',auth[_0xeba5('0x7')](),controller[_0xeba5('0xe')]);router['put']('/:id',auth[_0xeba5('0x7')](),controller[_0xeba5('0xf')]);router['delete'](_0xeba5('0x10'),auth['isAuthenticated'](),controller[_0xeba5('0x11')]);module[_0xeba5('0x12')]=router; \ No newline at end of file +var _0x80d9=['index','get','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated'];(function(_0x19d5c7,_0x39facb){var _0x523fd1=function(_0x1f2d0e){while(--_0x1f2d0e){_0x19d5c7['push'](_0x19d5c7['shift']());}};_0x523fd1(++_0x39facb);}(_0x80d9,0x1f0));var _0x980d=function(_0x7d9340,_0x308ff6){_0x7d9340=_0x7d9340-0x0;var _0x3a230e=_0x80d9[_0x7d9340];return _0x3a230e;};'use strict';var multer=require(_0x980d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x980d('0x1'));var express=require(_0x980d('0x2'));var router=express['Router']();var fs_extra=require(_0x980d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x980d('0x4'));var config=require(_0x980d('0x5'));var controller=require(_0x980d('0x6'));router['get']('/',auth[_0x980d('0x7')](),controller[_0x980d('0x8')]);router[_0x980d('0x9')](_0x980d('0xa'),auth[_0x980d('0x7')](),controller[_0x980d('0xb')]);router[_0x980d('0x9')](_0x980d('0xc'),auth[_0x980d('0x7')](),controller[_0x980d('0xd')]);router[_0x980d('0x9')](_0x980d('0xe'),auth[_0x980d('0x7')](),controller['run']);router[_0x980d('0x9')](_0x980d('0xf'),auth['isAuthenticated'](),controller[_0x980d('0x10')]);router[_0x980d('0x11')]('/',auth[_0x980d('0x7')](),controller[_0x980d('0x12')]);router[_0x980d('0x13')](_0x980d('0xa'),auth[_0x980d('0x7')](),controller[_0x980d('0x14')]);router[_0x980d('0x15')]('/:id',auth[_0x980d('0x7')](),controller[_0x980d('0x16')]);module[_0x980d('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index f584fb2..d1b574a 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 _0x425d=['sequelize','STRING','TEXT'];(function(_0x33ea32,_0x288fa3){var _0x4fc865=function(_0x12386c){while(--_0x12386c){_0x33ea32['push'](_0x33ea32['shift']());}};_0x4fc865(++_0x288fa3);}(_0x425d,0x1e0));var _0xd425=function(_0x276eb7,_0xcfea0f){_0x276eb7=_0x276eb7-0x0;var _0x120211=_0x425d[_0x276eb7];return _0x120211;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}}; \ No newline at end of file +var _0x53ec=['STRING','TEXT','sequelize','exports'];(function(_0x247896,_0x72eb8f){var _0x1c2ac0=function(_0x41fae1){while(--_0x41fae1){_0x247896['push'](_0x247896['shift']());}};_0x1c2ac0(++_0x72eb8f);}(_0x53ec,0x192));var _0xc53e=function(_0x47cd7b,_0x5630af){_0x47cd7b=_0x47cd7b-0x0;var _0x3e6dbf=_0x53ec[_0x47cd7b];return _0x3e6dbf;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc53e('0x2')]},'parent':{'type':Sequelize[_0xc53e('0x2')]},'table':{'type':Sequelize[_0xc53e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xc53e('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 02a211e..9445870 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 _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x38a045,_0x402d6b){var _0x45c34c=function(_0x2bde36){while(--_0x2bde36){_0x38a045['push'](_0x38a045['shift']());}};_0x45c34c(++_0x402d6b);}(_0x7a54,0x106));var _0x47a5=function(_0x1254bb,_0x1f3a9d){_0x1254bb=_0x1254bb-0x0;var _0x296a15=_0x7a54[_0x1254bb];return _0x296a15;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));}; \ No newline at end of file +var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x124ac4,_0x36faf9){var _0x22772f=function(_0xee418e){while(--_0xee418e){_0x124ac4['push'](_0x124ac4['shift']());}};_0x22772f(++_0x36faf9);}(_0x53ec,0x192));var _0xc53e=function(_0x229f8d,_0x48402c){_0x229f8d=_0x229f8d-0x0;var _0x3e193c=_0x53ec[_0x229f8d];return _0x3e193c;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 92655f6..0c7a1d9 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 _0x1085=['rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x58b488,_0x2c702b){var _0x2e270c=function(_0x16a838){while(--_0x16a838){_0x58b488['push'](_0x58b488['shift']());}};_0x2e270c(++_0x2c702b);}(_0x1085,0xd7));var _0x5108=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1085[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5108('0x0'))(_0x5108('0x1'));var moment=require(_0x5108('0x2'));var BPromise=require(_0x5108('0x3'));var rp=require(_0x5108('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5108('0x5'));var config=require(_0x5108('0x6'));var attributes=require(_0x5108('0x7'));module['exports']=function(_0x11e5e0,_0x4abfaa){return _0x11e5e0[_0x5108('0x8')](_0x5108('0x9'),attributes,{'tableName':_0x5108('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35ee=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x546304,_0x50b057){var _0x2da5dc=function(_0x15c5a6){while(--_0x15c5a6){_0x546304['push'](_0x546304['shift']());}};_0x2da5dc(++_0x50b057);}(_0x35ee,0xc5));var _0xe35e=function(_0x53495b,_0x4cc592){_0x53495b=_0x53495b-0x0;var _0x222ecd=_0x35ee[_0x53495b];return _0x222ecd;};'use strict';var _=require(_0xe35e('0x0'));var util=require(_0xe35e('0x1'));var logger=require(_0xe35e('0x2'))(_0xe35e('0x3'));var moment=require(_0xe35e('0x4'));var BPromise=require(_0xe35e('0x5'));var rp=require(_0xe35e('0x6'));var fs=require('fs');var path=require(_0xe35e('0x7'));var rimraf=require(_0xe35e('0x8'));var config=require(_0xe35e('0x9'));var attributes=require(_0xe35e('0xa'));module[_0xe35e('0xb')]=function(_0x291b2e,_0x48b135){return _0x291b2e[_0xe35e('0xc')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 1b32977..98d8302 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 _0xc440=['request','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x4bac84,_0x5a800d){var _0x4b5c8e=function(_0x594a8d){while(--_0x594a8d){_0x4bac84['push'](_0x4bac84['shift']());}};_0x4b5c8e(++_0x5a800d);}(_0xc440,0x1c0));var _0x0c44=function(_0x41e7d0,_0x22b473){_0x41e7d0=_0x41e7d0-0x0;var _0x274ea9=_0xc440[_0x41e7d0];return _0x274ea9;};'use strict';var _=require(_0x0c44('0x0'));var util=require('util');var moment=require(_0x0c44('0x1'));var BPromise=require(_0x0c44('0x2'));var rs=require(_0x0c44('0x3'));var fs=require('fs');var Redis=require(_0x0c44('0x4'));var db=require(_0x0c44('0x5'))['db'];var utils=require(_0x0c44('0x6'));var logger=require(_0x0c44('0x7'))('rpc');var config=require(_0x0c44('0x8'));var jayson=require(_0x0c44('0x9'));var client=jayson[_0x0c44('0xa')][_0x0c44('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30a98a,_0x48004b,_0x4017a6){return new BPromise(function(_0x3ec14b,_0x1e433b){return client[_0x0c44('0xc')](_0x30a98a,_0x4017a6)['then'](function(_0x4ea9f3){logger['info'](_0x0c44('0xd'),_0x48004b,'request\x20sent');logger[_0x0c44('0xe')](_0x0c44('0xf'),_0x48004b,'request\x20sent',JSON[_0x0c44('0x10')](_0x4ea9f3));if(_0x4ea9f3['error']){if(_0x4ea9f3[_0x0c44('0x11')][_0x0c44('0x12')]===0x1f4){logger[_0x0c44('0x11')](_0x0c44('0xd'),_0x48004b,_0x4ea9f3[_0x0c44('0x11')][_0x0c44('0x13')]);return _0x1e433b(_0x4ea9f3[_0x0c44('0x11')]['message']);}logger[_0x0c44('0x11')](_0x0c44('0xd'),_0x48004b,_0x4ea9f3[_0x0c44('0x11')]['message']);return _0x3ec14b(_0x4ea9f3[_0x0c44('0x11')][_0x0c44('0x13')]);}else{logger[_0x0c44('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x48004b,_0x0c44('0x15'));_0x3ec14b(_0x4ea9f3[_0x0c44('0x16')]['message']);}})['catch'](function(_0x373513){logger['error'](_0x0c44('0xd'),_0x48004b,_0x373513);_0x1e433b(_0x373513);});});} \ No newline at end of file +var _0x7cc6=['AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x446941,_0x3c3b95){var _0x37671a=function(_0x1a96d1){while(--_0x1a96d1){_0x446941['push'](_0x446941['shift']());}};_0x37671a(++_0x3c3b95);}(_0x7cc6,0x196));var _0x67cc=function(_0x337947,_0x172d1d){_0x337947=_0x337947-0x0;var _0x94d843=_0x7cc6[_0x337947];return _0x94d843;};'use strict';var _=require(_0x67cc('0x0'));var util=require(_0x67cc('0x1'));var moment=require(_0x67cc('0x2'));var BPromise=require(_0x67cc('0x3'));var rs=require(_0x67cc('0x4'));var fs=require('fs');var Redis=require(_0x67cc('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x67cc('0x6'))(_0x67cc('0x7'));var config=require(_0x67cc('0x8'));var jayson=require(_0x67cc('0x9'));var client=jayson[_0x67cc('0xa')][_0x67cc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x164834,_0x1edfd1,_0x269353){return new BPromise(function(_0x3b47c6,_0x395871){return client['request'](_0x164834,_0x269353)['then'](function(_0x545ae9){logger['info'](_0x67cc('0xc'),_0x1edfd1,'request\x20sent');logger['debug'](_0x67cc('0xd'),_0x1edfd1,_0x67cc('0xe'),JSON[_0x67cc('0xf')](_0x545ae9));if(_0x545ae9[_0x67cc('0x10')]){if(_0x545ae9[_0x67cc('0x10')][_0x67cc('0x11')]===0x1f4){logger['error'](_0x67cc('0xc'),_0x1edfd1,_0x545ae9[_0x67cc('0x10')]['message']);return _0x395871(_0x545ae9[_0x67cc('0x10')][_0x67cc('0x12')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1edfd1,_0x545ae9[_0x67cc('0x10')][_0x67cc('0x12')]);return _0x3b47c6(_0x545ae9[_0x67cc('0x10')][_0x67cc('0x12')]);}else{logger[_0x67cc('0x13')](_0x67cc('0xc'),_0x1edfd1,_0x67cc('0xe'));_0x3b47c6(_0x545ae9[_0x67cc('0x14')]['message']);}})[_0x67cc('0x15')](function(_0x3139ce){logger[_0x67cc('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1edfd1,_0x3139ce);_0x395871(_0x3139ce);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 7042f21..d0f0069 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 _0xc965=['../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','destroy','exports','multer','express','../../components/auth/service'];(function(_0x4b2251,_0x393f10){var _0x5d22fb=function(_0x10992c){while(--_0x10992c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5d22fb(++_0x393f10);}(_0xc965,0x6f));var _0x5c96=function(_0x2bdf29,_0x40cab0){_0x2bdf29=_0x2bdf29-0x0;var _0x60cb83=_0xc965[_0x2bdf29];return _0x60cb83;};'use strict';var multer=require(_0x5c96('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5c96('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5c96('0x2'));var interaction=require(_0x5c96('0x3'));var config=require('../../config/environment');var controller=require(_0x5c96('0x4'));router[_0x5c96('0x5')]('/',auth[_0x5c96('0x6')](),controller['index']);router[_0x5c96('0x5')](_0x5c96('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x5c96('0x5')](_0x5c96('0x8'),auth[_0x5c96('0x6')](),controller[_0x5c96('0x9')]);router['get'](_0x5c96('0xa'),auth['isAuthenticated'](),controller[_0x5c96('0xb')]);router[_0x5c96('0x5')](_0x5c96('0xc'),auth['isAuthenticated'](),controller[_0x5c96('0xd')]);router[_0x5c96('0xe')]('/',auth[_0x5c96('0x6')](),controller['create']);router[_0x5c96('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x5c96('0x10')]);router['delete'](_0x5c96('0x7'),auth['isAuthenticated'](),controller[_0x5c96('0x11')]);module[_0x5c96('0x12')]=router; \ No newline at end of file +var _0x1a3f=['create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','show','preview','/:id/run','run','query','post'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x1a3f,0x100));var _0xf1a3=function(_0x1e07d9,_0x43cbc9){_0x1e07d9=_0x1e07d9-0x0;var _0xb9f284=_0x1a3f[_0x1e07d9];return _0xb9f284;};'use strict';var multer=require(_0xf1a3('0x0'));var util=require('util');var path=require(_0xf1a3('0x1'));var timeout=require(_0xf1a3('0x2'));var express=require(_0xf1a3('0x3'));var router=express[_0xf1a3('0x4')]();var fs_extra=require(_0xf1a3('0x5'));var auth=require(_0xf1a3('0x6'));var interaction=require(_0xf1a3('0x7'));var config=require(_0xf1a3('0x8'));var controller=require(_0xf1a3('0x9'));router['get']('/',auth[_0xf1a3('0xa')](),controller[_0xf1a3('0xb')]);router[_0xf1a3('0xc')]('/:id',auth[_0xf1a3('0xa')](),controller[_0xf1a3('0xd')]);router[_0xf1a3('0xc')]('/:id/preview',auth[_0xf1a3('0xa')](),controller[_0xf1a3('0xe')]);router['get'](_0xf1a3('0xf'),auth[_0xf1a3('0xa')](),controller[_0xf1a3('0x10')]);router[_0xf1a3('0xc')]('/:id/query',auth[_0xf1a3('0xa')](),controller[_0xf1a3('0x11')]);router[_0xf1a3('0x12')]('/',auth[_0xf1a3('0xa')](),controller[_0xf1a3('0x13')]);router[_0xf1a3('0x14')](_0xf1a3('0x15'),auth[_0xf1a3('0xa')](),controller[_0xf1a3('0x16')]);router[_0xf1a3('0x17')](_0xf1a3('0x15'),auth['isAuthenticated'](),controller[_0xf1a3('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 156cd75..a19f148 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 _0x7763=['DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf','xlsx'];(function(_0x1ef9ef,_0x597194){var _0x4302e5=function(_0x3f3deb){while(--_0x3f3deb){_0x1ef9ef['push'](_0x1ef9ef['shift']());}};_0x4302e5(++_0x597194);}(_0x7763,0x1d9));var _0x3776=function(_0x27adae,_0x375e3a){_0x27adae=_0x27adae-0x0;var _0x125156=_0x7763[_0x27adae];return _0x125156;};'use strict';var Sequelize=require(_0x3776('0x0'));var moment=require(_0x3776('0x1'));module[_0x3776('0x2')]={'name':{'type':Sequelize[_0x3776('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x3776('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x3776('0x4')]('csv',_0x3776('0x5'),_0x3776('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x3776('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3776('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x3776('0x3')],'defaultValue':_0x3776('0x8')},'type':{'type':Sequelize[_0x3776('0x4')](_0x3776('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x3776('0x9')},'reportId':{'type':Sequelize[_0x3776('0xa')](0xb)[_0x3776('0xb')]},'reportType':{'type':Sequelize[_0x3776('0x3')]}}; \ No newline at end of file +var _0x25fe=['pdf','xlsx','DATE','manual','sequelize','moment','STRING','ENUM','csv'];(function(_0x8e9386,_0x3cc60f){var _0x4abf26=function(_0x59de5a){while(--_0x59de5a){_0x8e9386['push'](_0x8e9386['shift']());}};_0x4abf26(++_0x3cc60f);}(_0x25fe,0x109));var _0xe25f=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x25fe[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0xe25f('0x0'));var moment=require(_0xe25f('0x1'));module['exports']={'name':{'type':Sequelize[_0xe25f('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xe25f('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xe25f('0x3')](_0xe25f('0x4'),_0xe25f('0x5'),_0xe25f('0x6')),'allowNull':![],'defaultValue':_0xe25f('0x4')},'savename':{'type':Sequelize[_0xe25f('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe25f('0x7')]},'endDate':{'type':Sequelize[_0xe25f('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xe25f('0x3')](_0xe25f('0x8'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xe25f('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 9e84b28..cf1a910 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 _0xae69=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','get','ExtractedReports','destroy','then','end','error','stack','name','map','rawAttributes','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','rows','catch','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','savename','output','existsSync','join','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','root','server/files/reports','format','%s.%s','toLowerCase','eml-format','zip-dir','request-promise','moment','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xae69,0x163));var _0x9ae6=function(_0x1203aa,_0x5af115){_0x1203aa=_0x1203aa-0x0;var _0x1dfb77=_0xae69[_0x1203aa];return _0x1dfb77;};'use strict';var emlformat=require(_0x9ae6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9ae6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ae6('0x2'));var moment=require(_0x9ae6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9ae6('0x4'));var path=require(_0x9ae6('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9ae6('0x6'));var fs=require('fs');var fs_extra=require(_0x9ae6('0x7'));var _=require(_0x9ae6('0x8'));var squel=require('squel');var crypto=require(_0x9ae6('0x9'));var jsforce=require(_0x9ae6('0xa'));var deskjs=require(_0x9ae6('0xb'));var toCsv=require(_0x9ae6('0xc'));var querystring=require(_0x9ae6('0xd'));var Papa=require('papaparse');var Redis=require(_0x9ae6('0xe'));var authService=require(_0x9ae6('0xf'));var qs=require(_0x9ae6('0x10'));var as=require(_0x9ae6('0x11'));var hardwareService=require(_0x9ae6('0x12'));var logger=require(_0x9ae6('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9ae6('0x14'));var licenseUtil=require(_0x9ae6('0x15'));var db=require(_0x9ae6('0x16'))['db'];function respondWithStatusCode(_0x2b81c6,_0x360ee3){_0x360ee3=_0x360ee3||0xcc;return function(_0x14b648){if(_0x14b648){return _0x2b81c6[_0x9ae6('0x17')](_0x360ee3);}return _0x2b81c6[_0x9ae6('0x18')](_0x360ee3)['end']();};}function respondWithResult(_0x50f287,_0xb165a9){_0xb165a9=_0xb165a9||0xc8;return function(_0x3b0704){if(_0x3b0704){return _0x50f287[_0x9ae6('0x18')](_0xb165a9)[_0x9ae6('0x19')](_0x3b0704);}};}function respondWithFilteredResult(_0x397378,_0x4f52db){return function(_0x5615b9){if(_0x5615b9){var _0x227de1=typeof _0x4f52db[_0x9ae6('0x1a')]==='undefined'&&typeof _0x4f52db[_0x9ae6('0x1b')]===_0x9ae6('0x1c');var _0x39dfe5=_0x5615b9[_0x9ae6('0x1d')];var _0x54c1a2=_0x227de1?0x0:_0x4f52db[_0x9ae6('0x1a')];var _0xee6a74=_0x227de1?_0x5615b9[_0x9ae6('0x1d')]:_0x4f52db[_0x9ae6('0x1a')]+_0x4f52db[_0x9ae6('0x1b')];var _0x16b712;if(_0xee6a74>=_0x39dfe5){_0xee6a74=_0x39dfe5;_0x16b712=0xc8;}else{_0x16b712=0xce;}_0x397378[_0x9ae6('0x18')](_0x16b712);return _0x397378[_0x9ae6('0x1e')](_0x9ae6('0x1f'),_0x54c1a2+'-'+_0xee6a74+'/'+_0x39dfe5)['json'](_0x5615b9);}return null;};}function patchUpdates(_0x3c1c73){return function(_0xb4c286){try{jsonpatch[_0x9ae6('0x20')](_0xb4c286,_0x3c1c73,!![]);}catch(_0x3b93ce){return BPromise[_0x9ae6('0x21')](_0x3b93ce);}return _0xb4c286[_0x9ae6('0x22')]();};}function saveUpdates(_0x5a0be6,_0x3919cf){return function(_0x49be68){if(_0x49be68){return _0x49be68[_0x9ae6('0x23')](_0x5a0be6)['then'](function(_0xd8089e){return _0xd8089e;});}return null;};}function removeEntity(_0x23e4de,_0xb9390b){return function(_0x3ba6d3){if(_0x3ba6d3){return _0x3ba6d3['destroy']()['then'](function(){var _0x12f08e=_0x3ba6d3[_0x9ae6('0x24')]({'plain':!![]});var _0x2b38c5=_0x9ae6('0x25');return db['UserProfileResource'][_0x9ae6('0x26')]({'where':{'type':_0x2b38c5,'resourceId':_0x12f08e['id']}})['then'](function(){return _0x3ba6d3;});})[_0x9ae6('0x27')](function(){_0x23e4de[_0x9ae6('0x18')](0xcc)[_0x9ae6('0x28')]();});}};}function handleEntityNotFound(_0x1cb6a9,_0x2f6cb2){return function(_0x328852){if(!_0x328852){_0x1cb6a9['sendStatus'](0x194);}return _0x328852;};}function handleError(_0x58ed94,_0x1e344c){_0x1e344c=_0x1e344c||0x1f4;return function(_0x13b691){logger[_0x9ae6('0x29')](_0x13b691[_0x9ae6('0x2a')]);if(_0x13b691[_0x9ae6('0x2b')]){delete _0x13b691[_0x9ae6('0x2b')];}_0x58ed94[_0x9ae6('0x18')](_0x1e344c)['send'](_0x13b691);};}exports['index']=function(_0x531c4b,_0x47b298){var _0x13ae9d={},_0x66d787={},_0x364f48={'count':0x0,'rows':[]};var _0x331e0c=_[_0x9ae6('0x2c')](db['AnalyticExtractedReport'][_0x9ae6('0x2d')],function(_0x20a671){return{'name':_0x20a671['fieldName'],'type':_0x20a671['type']['key']};});_0x66d787[_0x9ae6('0x2e')]=_[_0x9ae6('0x2c')](_0x331e0c,_0x9ae6('0x2b'));_0x66d787[_0x9ae6('0x2f')]=_['keys'](_0x531c4b['query']);_0x66d787[_0x9ae6('0x30')]=_['intersection'](_0x66d787[_0x9ae6('0x2e')],_0x66d787['query']);_0x13ae9d[_0x9ae6('0x31')]=_[_0x9ae6('0x32')](_0x66d787['model'],qs[_0x9ae6('0x33')](_0x531c4b[_0x9ae6('0x2f')][_0x9ae6('0x33')]));_0x13ae9d[_0x9ae6('0x31')]=_0x13ae9d[_0x9ae6('0x31')][_0x9ae6('0x34')]?_0x13ae9d['attributes']:_0x66d787[_0x9ae6('0x2e')];if(!_0x531c4b[_0x9ae6('0x2f')][_0x9ae6('0x35')](_0x9ae6('0x36'))){_0x13ae9d[_0x9ae6('0x1b')]=qs[_0x9ae6('0x1b')](_0x531c4b['query']['limit']);_0x13ae9d['offset']=qs[_0x9ae6('0x1a')](_0x531c4b[_0x9ae6('0x2f')][_0x9ae6('0x1a')]);}_0x13ae9d['order']=qs[_0x9ae6('0x37')](_0x531c4b[_0x9ae6('0x2f')]['sort']);_0x13ae9d[_0x9ae6('0x38')]=qs['filters'](_[_0x9ae6('0x39')](_0x531c4b[_0x9ae6('0x2f')],_0x66d787[_0x9ae6('0x30')]),_0x331e0c);if(_0x531c4b[_0x9ae6('0x2f')][_0x9ae6('0x3a')]){_0x13ae9d[_0x9ae6('0x38')]=_[_0x9ae6('0x3b')](_0x13ae9d[_0x9ae6('0x38')],{'$or':_[_0x9ae6('0x2c')](_0x331e0c,function(_0x3e2474){if(_0x3e2474[_0x9ae6('0x3c')]!==_0x9ae6('0x3d')){var _0x16a690={};_0x16a690[_0x3e2474[_0x9ae6('0x2b')]]={'$like':'%'+_0x531c4b['query'][_0x9ae6('0x3a')]+'%'};return _0x16a690;}})});}_0x13ae9d=_[_0x9ae6('0x3b')]({},_0x13ae9d,_0x531c4b[_0x9ae6('0x3e')]);var _0x2a450b={'where':_0x13ae9d[_0x9ae6('0x38')]};return db[_0x9ae6('0x3f')][_0x9ae6('0x1d')](_0x2a450b)['then'](function(_0x2cd0e9){_0x364f48[_0x9ae6('0x1d')]=_0x2cd0e9;if(_0x531c4b[_0x9ae6('0x2f')][_0x9ae6('0x40')]){_0x13ae9d[_0x9ae6('0x41')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x13ae9d);})[_0x9ae6('0x27')](function(_0x321027){_0x364f48[_0x9ae6('0x42')]=_0x321027;return _0x364f48;})[_0x9ae6('0x27')](respondWithFilteredResult(_0x47b298,_0x13ae9d))[_0x9ae6('0x43')](handleError(_0x47b298,null));};exports['show']=function(_0x3d861,_0x54a46b){var _0x26f54a={'raw':!![],'where':{'id':_0x3d861[_0x9ae6('0x44')]['id']}},_0x2d8ac1={};_0x2d8ac1['model']=_['keys'](db['AnalyticExtractedReport'][_0x9ae6('0x2d')]);_0x2d8ac1[_0x9ae6('0x2f')]=_[_0x9ae6('0x45')](_0x3d861[_0x9ae6('0x2f')]);_0x2d8ac1[_0x9ae6('0x30')]=_[_0x9ae6('0x32')](_0x2d8ac1[_0x9ae6('0x2e')],_0x2d8ac1[_0x9ae6('0x2f')]);_0x26f54a[_0x9ae6('0x31')]=_['intersection'](_0x2d8ac1[_0x9ae6('0x2e')],qs[_0x9ae6('0x33')](_0x3d861[_0x9ae6('0x2f')][_0x9ae6('0x33')]));_0x26f54a[_0x9ae6('0x31')]=_0x26f54a[_0x9ae6('0x31')]['length']?_0x26f54a[_0x9ae6('0x31')]:_0x2d8ac1['model'];if(_0x3d861[_0x9ae6('0x2f')][_0x9ae6('0x40')]){_0x26f54a['include']=[{'all':!![]}];}_0x26f54a=_[_0x9ae6('0x3b')]({},_0x26f54a,_0x3d861[_0x9ae6('0x3e')]);return db[_0x9ae6('0x3f')][_0x9ae6('0x46')](_0x26f54a)[_0x9ae6('0x27')](handleEntityNotFound(_0x54a46b,null))[_0x9ae6('0x27')](respondWithResult(_0x54a46b,null))[_0x9ae6('0x43')](handleError(_0x54a46b,null));};exports[_0x9ae6('0x47')]=function(_0x311e7f,_0x268cd0){return db[_0x9ae6('0x3f')]['create'](_0x311e7f['body'],{})[_0x9ae6('0x27')](function(_0x325fd9){var _0x1dcaa6=_0x311e7f['user'][_0x9ae6('0x24')]({'plain':!![]});if(!_0x1dcaa6)throw new Error(_0x9ae6('0x48'));if(_0x1dcaa6['role']===_0x9ae6('0x49')){var _0x2d1e09=_0x325fd9['get']({'plain':!![]});var _0x147e57=_0x9ae6('0x25');return db[_0x9ae6('0x4a')][_0x9ae6('0x46')]({'where':{'name':_0x147e57,'userProfileId':_0x1dcaa6[_0x9ae6('0x4b')]},'raw':!![]})[_0x9ae6('0x27')](function(_0x4f7bbe){if(_0x4f7bbe&&_0x4f7bbe[_0x9ae6('0x4c')]===0x0){return db[_0x9ae6('0x4d')]['create']({'name':_0x2d1e09[_0x9ae6('0x2b')],'resourceId':_0x2d1e09['id'],'type':_0x4f7bbe[_0x9ae6('0x2b')],'sectionId':_0x4f7bbe['id']},{})['then'](function(){return _0x325fd9;});}else{return _0x325fd9;}})['catch'](function(_0x4c4292){logger['error'](_0x9ae6('0x4e'),_0x4c4292);throw _0x4c4292;});}return _0x325fd9;})[_0x9ae6('0x27')](respondWithResult(_0x268cd0,0xc9))[_0x9ae6('0x43')](handleError(_0x268cd0,null));};exports[_0x9ae6('0x23')]=function(_0x5ad69c,_0x24467c){if(_0x5ad69c['body']['id']){delete _0x5ad69c[_0x9ae6('0x4f')]['id'];}return db['AnalyticExtractedReport'][_0x9ae6('0x46')]({'where':{'id':_0x5ad69c[_0x9ae6('0x44')]['id']}})['then'](handleEntityNotFound(_0x24467c,null))[_0x9ae6('0x27')](saveUpdates(_0x5ad69c['body'],null))['then'](respondWithResult(_0x24467c,null))[_0x9ae6('0x43')](handleError(_0x24467c,null));};exports[_0x9ae6('0x26')]=function(_0x53fd6c,_0x311950){return db['AnalyticExtractedReport'][_0x9ae6('0x46')]({'where':{'id':_0x53fd6c['params']['id']}})[_0x9ae6('0x27')](handleEntityNotFound(_0x311950,null))[_0x9ae6('0x27')](removeEntity(_0x311950,null))['catch'](handleError(_0x311950,null));};exports['download']=function(_0x290b96,_0x19268b,_0x4db6c4){return db[_0x9ae6('0x3f')][_0x9ae6('0x46')]({'where':{'id':_0x290b96[_0x9ae6('0x44')]['id']},'attributes':[_0x9ae6('0x2b'),_0x9ae6('0x50'),_0x9ae6('0x51'),_0x9ae6('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x19268b,null))[_0x9ae6('0x27')](function(_0xd99bf3){if(_0xd99bf3){if(!fs[_0x9ae6('0x53')](path[_0x9ae6('0x54')](config['root'],'server/files/reports',_0xd99bf3[_0x9ae6('0x51')]))){throw new db[(_0x9ae6('0x55'))]['ValidationError'](_0x9ae6('0x56'));}if(_0x290b96[_0x9ae6('0x2f')][_0x9ae6('0x57')]){return _0x19268b['sendStatus'](0xc8);}return _0x19268b['download'](path[_0x9ae6('0x54')](config[_0x9ae6('0x58')],_0x9ae6('0x59'),_0xd99bf3[_0x9ae6('0x51')]),util[_0x9ae6('0x5a')](_0x9ae6('0x5b'),_0xd99bf3[_0x9ae6('0x50')]||_0xd99bf3[_0x9ae6('0x2b')],_0xd99bf3[_0x9ae6('0x52')][_0x9ae6('0x5c')]()));}})['catch'](handleError(_0x19268b,null));}; \ No newline at end of file +var _0x7fcc=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','exists','format','%s.%s','toLowerCase','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','get','ExtractedReports','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters'];(function(_0x4ef0d6,_0x369467){var _0x1fb961=function(_0x2db425){while(--_0x2db425){_0x4ef0d6['push'](_0x4ef0d6['shift']());}};_0x1fb961(++_0x369467);}(_0x7fcc,0x1bf));var _0xc7fc=function(_0x3a3885,_0x146058){_0x3a3885=_0x3a3885-0x0;var _0x2ebadb=_0x7fcc[_0x3a3885];return _0x2ebadb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc7fc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc7fc('0x1'));var rp=require(_0xc7fc('0x2'));var moment=require(_0xc7fc('0x3'));var BPromise=require(_0xc7fc('0x4'));var Mustache=require(_0xc7fc('0x5'));var util=require(_0xc7fc('0x6'));var path=require(_0xc7fc('0x7'));var sox=require(_0xc7fc('0x8'));var csv=require(_0xc7fc('0x9'));var ejs=require(_0xc7fc('0xa'));var fs=require('fs');var fs_extra=require(_0xc7fc('0xb'));var _=require('lodash');var squel=require(_0xc7fc('0xc'));var crypto=require(_0xc7fc('0xd'));var jsforce=require(_0xc7fc('0xe'));var deskjs=require(_0xc7fc('0xf'));var toCsv=require(_0xc7fc('0x9'));var querystring=require(_0xc7fc('0x10'));var Papa=require(_0xc7fc('0x11'));var Redis=require(_0xc7fc('0x12'));var authService=require(_0xc7fc('0x13'));var qs=require(_0xc7fc('0x14'));var as=require(_0xc7fc('0x15'));var hardwareService=require(_0xc7fc('0x16'));var logger=require('../../config/logger')(_0xc7fc('0x17'));var utils=require(_0xc7fc('0x18'));var config=require(_0xc7fc('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc7fc('0x1a'))['db'];function respondWithStatusCode(_0x49f977,_0x426195){_0x426195=_0x426195||0xcc;return function(_0x576060){if(_0x576060){return _0x49f977['sendStatus'](_0x426195);}return _0x49f977[_0xc7fc('0x1b')](_0x426195)['end']();};}function respondWithResult(_0x289284,_0x17066f){_0x17066f=_0x17066f||0xc8;return function(_0x31f2a9){if(_0x31f2a9){return _0x289284[_0xc7fc('0x1b')](_0x17066f)[_0xc7fc('0x1c')](_0x31f2a9);}};}function respondWithFilteredResult(_0x4b3ed1,_0x5bf79f){return function(_0x31fab5){if(_0x31fab5){var _0x2c8e0b=typeof _0x5bf79f[_0xc7fc('0x1d')]===_0xc7fc('0x1e')&&typeof _0x5bf79f[_0xc7fc('0x1f')]===_0xc7fc('0x1e');var _0x6cdc85=_0x31fab5[_0xc7fc('0x20')];var _0x214ffb=_0x2c8e0b?0x0:_0x5bf79f['offset'];var _0x3f71c1=_0x2c8e0b?_0x31fab5['count']:_0x5bf79f[_0xc7fc('0x1d')]+_0x5bf79f['limit'];var _0x29802d;if(_0x3f71c1>=_0x6cdc85){_0x3f71c1=_0x6cdc85;_0x29802d=0xc8;}else{_0x29802d=0xce;}_0x4b3ed1[_0xc7fc('0x1b')](_0x29802d);return _0x4b3ed1[_0xc7fc('0x21')](_0xc7fc('0x22'),_0x214ffb+'-'+_0x3f71c1+'/'+_0x6cdc85)[_0xc7fc('0x1c')](_0x31fab5);}return null;};}function patchUpdates(_0x32898d){return function(_0x5ec484){try{jsonpatch['apply'](_0x5ec484,_0x32898d,!![]);}catch(_0x122133){return BPromise[_0xc7fc('0x23')](_0x122133);}return _0x5ec484['save']();};}function saveUpdates(_0x22e845,_0x2bce34){return function(_0x3e4117){if(_0x3e4117){return _0x3e4117[_0xc7fc('0x24')](_0x22e845)['then'](function(_0x1b4d3b){return _0x1b4d3b;});}return null;};}function removeEntity(_0x3894d8,_0x5bf8ea){return function(_0x2f8b4f){if(_0x2f8b4f){return _0x2f8b4f[_0xc7fc('0x25')]()[_0xc7fc('0x26')](function(){var _0x23b59b=_0x2f8b4f[_0xc7fc('0x27')]({'plain':!![]});var _0x37842a=_0xc7fc('0x28');return db[_0xc7fc('0x29')]['destroy']({'where':{'type':_0x37842a,'resourceId':_0x23b59b['id']}})[_0xc7fc('0x26')](function(){return _0x2f8b4f;});})['then'](function(){_0x3894d8[_0xc7fc('0x1b')](0xcc)[_0xc7fc('0x2a')]();});}};}function handleEntityNotFound(_0x1a39c1,_0x1334a2){return function(_0x5a2ba8){if(!_0x5a2ba8){_0x1a39c1[_0xc7fc('0x2b')](0x194);}return _0x5a2ba8;};}function handleError(_0x4d2520,_0xe53101){_0xe53101=_0xe53101||0x1f4;return function(_0xee0461){logger[_0xc7fc('0x2c')](_0xee0461[_0xc7fc('0x2d')]);if(_0xee0461[_0xc7fc('0x2e')]){delete _0xee0461['name'];}_0x4d2520[_0xc7fc('0x1b')](_0xe53101)[_0xc7fc('0x2f')](_0xee0461);};}exports[_0xc7fc('0x30')]=function(_0xa66d6b,_0x2b1dce){var _0x26671e={},_0x325e97={},_0xef204f={'count':0x0,'rows':[]};var _0x1b7cec=_[_0xc7fc('0x31')](db[_0xc7fc('0x32')][_0xc7fc('0x33')],function(_0x56ae8d){return{'name':_0x56ae8d['fieldName'],'type':_0x56ae8d[_0xc7fc('0x34')][_0xc7fc('0x35')]};});_0x325e97[_0xc7fc('0x36')]=_[_0xc7fc('0x31')](_0x1b7cec,_0xc7fc('0x2e'));_0x325e97[_0xc7fc('0x37')]=_[_0xc7fc('0x38')](_0xa66d6b[_0xc7fc('0x37')]);_0x325e97[_0xc7fc('0x39')]=_[_0xc7fc('0x3a')](_0x325e97[_0xc7fc('0x36')],_0x325e97['query']);_0x26671e[_0xc7fc('0x3b')]=_[_0xc7fc('0x3a')](_0x325e97[_0xc7fc('0x36')],qs['fields'](_0xa66d6b[_0xc7fc('0x37')][_0xc7fc('0x3c')]));_0x26671e['attributes']=_0x26671e[_0xc7fc('0x3b')][_0xc7fc('0x3d')]?_0x26671e['attributes']:_0x325e97[_0xc7fc('0x36')];if(!_0xa66d6b[_0xc7fc('0x37')][_0xc7fc('0x3e')](_0xc7fc('0x3f'))){_0x26671e[_0xc7fc('0x1f')]=qs[_0xc7fc('0x1f')](_0xa66d6b[_0xc7fc('0x37')][_0xc7fc('0x1f')]);_0x26671e[_0xc7fc('0x1d')]=qs[_0xc7fc('0x1d')](_0xa66d6b[_0xc7fc('0x37')]['offset']);}_0x26671e[_0xc7fc('0x40')]=qs[_0xc7fc('0x41')](_0xa66d6b[_0xc7fc('0x37')][_0xc7fc('0x41')]);_0x26671e[_0xc7fc('0x42')]=qs[_0xc7fc('0x39')](_[_0xc7fc('0x43')](_0xa66d6b[_0xc7fc('0x37')],_0x325e97[_0xc7fc('0x39')]),_0x1b7cec);if(_0xa66d6b[_0xc7fc('0x37')]['filter']){_0x26671e['where']=_['merge'](_0x26671e[_0xc7fc('0x42')],{'$or':_[_0xc7fc('0x31')](_0x1b7cec,function(_0x5a55b4){if(_0x5a55b4[_0xc7fc('0x34')]!==_0xc7fc('0x44')){var _0x2041c5={};_0x2041c5[_0x5a55b4['name']]={'$like':'%'+_0xa66d6b['query'][_0xc7fc('0x45')]+'%'};return _0x2041c5;}})});}_0x26671e=_[_0xc7fc('0x46')]({},_0x26671e,_0xa66d6b['options']);var _0x554a30={'where':_0x26671e[_0xc7fc('0x42')]};return db[_0xc7fc('0x32')][_0xc7fc('0x20')](_0x554a30)[_0xc7fc('0x26')](function(_0x2c8c90){_0xef204f[_0xc7fc('0x20')]=_0x2c8c90;if(_0xa66d6b[_0xc7fc('0x37')][_0xc7fc('0x47')]){_0x26671e[_0xc7fc('0x48')]=[{'all':!![]}];}return db[_0xc7fc('0x32')]['findAll'](_0x26671e);})[_0xc7fc('0x26')](function(_0x2d35da){_0xef204f[_0xc7fc('0x49')]=_0x2d35da;return _0xef204f;})[_0xc7fc('0x26')](respondWithFilteredResult(_0x2b1dce,_0x26671e))[_0xc7fc('0x4a')](handleError(_0x2b1dce,null));};exports[_0xc7fc('0x4b')]=function(_0x2b289d,_0x227fc1){var _0x4ce04f={'raw':!![],'where':{'id':_0x2b289d[_0xc7fc('0x4c')]['id']}},_0x430a16={};_0x430a16[_0xc7fc('0x36')]=_['keys'](db['AnalyticExtractedReport']['rawAttributes']);_0x430a16['query']=_['keys'](_0x2b289d[_0xc7fc('0x37')]);_0x430a16[_0xc7fc('0x39')]=_[_0xc7fc('0x3a')](_0x430a16['model'],_0x430a16[_0xc7fc('0x37')]);_0x4ce04f['attributes']=_[_0xc7fc('0x3a')](_0x430a16['model'],qs['fields'](_0x2b289d[_0xc7fc('0x37')][_0xc7fc('0x3c')]));_0x4ce04f[_0xc7fc('0x3b')]=_0x4ce04f[_0xc7fc('0x3b')]['length']?_0x4ce04f[_0xc7fc('0x3b')]:_0x430a16[_0xc7fc('0x36')];if(_0x2b289d[_0xc7fc('0x37')][_0xc7fc('0x47')]){_0x4ce04f['include']=[{'all':!![]}];}_0x4ce04f=_[_0xc7fc('0x46')]({},_0x4ce04f,_0x2b289d[_0xc7fc('0x4d')]);return db[_0xc7fc('0x32')][_0xc7fc('0x4e')](_0x4ce04f)[_0xc7fc('0x26')](handleEntityNotFound(_0x227fc1,null))[_0xc7fc('0x26')](respondWithResult(_0x227fc1,null))[_0xc7fc('0x4a')](handleError(_0x227fc1,null));};exports[_0xc7fc('0x4f')]=function(_0x374dc6,_0x52700a){return db[_0xc7fc('0x32')][_0xc7fc('0x4f')](_0x374dc6[_0xc7fc('0x50')],{})[_0xc7fc('0x26')](function(_0x50ce37){var _0x2ebe47=_0x374dc6[_0xc7fc('0x51')]['get']({'plain':!![]});if(!_0x2ebe47)throw new Error(_0xc7fc('0x52'));if(_0x2ebe47[_0xc7fc('0x53')]===_0xc7fc('0x51')){var _0x59c3ee=_0x50ce37[_0xc7fc('0x27')]({'plain':!![]});var _0x466797='ExtractedReports';return db[_0xc7fc('0x54')][_0xc7fc('0x4e')]({'where':{'name':_0x466797,'userProfileId':_0x2ebe47[_0xc7fc('0x55')]},'raw':!![]})[_0xc7fc('0x26')](function(_0x479da8){if(_0x479da8&&_0x479da8[_0xc7fc('0x56')]===0x0){return db[_0xc7fc('0x29')][_0xc7fc('0x4f')]({'name':_0x59c3ee[_0xc7fc('0x2e')],'resourceId':_0x59c3ee['id'],'type':_0x479da8['name'],'sectionId':_0x479da8['id']},{})[_0xc7fc('0x26')](function(){return _0x50ce37;});}else{return _0x50ce37;}})[_0xc7fc('0x4a')](function(_0x379bc2){logger[_0xc7fc('0x2c')](_0xc7fc('0x57'),_0x379bc2);throw _0x379bc2;});}return _0x50ce37;})[_0xc7fc('0x26')](respondWithResult(_0x52700a,0xc9))[_0xc7fc('0x4a')](handleError(_0x52700a,null));};exports['update']=function(_0x1cd446,_0x242e10){if(_0x1cd446[_0xc7fc('0x50')]['id']){delete _0x1cd446[_0xc7fc('0x50')]['id'];}return db[_0xc7fc('0x32')][_0xc7fc('0x4e')]({'where':{'id':_0x1cd446[_0xc7fc('0x4c')]['id']}})[_0xc7fc('0x26')](handleEntityNotFound(_0x242e10,null))['then'](saveUpdates(_0x1cd446[_0xc7fc('0x50')],null))['then'](respondWithResult(_0x242e10,null))[_0xc7fc('0x4a')](handleError(_0x242e10,null));};exports[_0xc7fc('0x25')]=function(_0x2573c3,_0x334e09){return db[_0xc7fc('0x32')][_0xc7fc('0x4e')]({'where':{'id':_0x2573c3[_0xc7fc('0x4c')]['id']}})['then'](handleEntityNotFound(_0x334e09,null))[_0xc7fc('0x26')](removeEntity(_0x334e09,null))[_0xc7fc('0x4a')](handleError(_0x334e09,null));};exports[_0xc7fc('0x58')]=function(_0x106cde,_0x1695f0,_0x4ecbb0){return db[_0xc7fc('0x32')]['find']({'where':{'id':_0x106cde['params']['id']},'attributes':['name',_0xc7fc('0x59'),'savename',_0xc7fc('0x5a')],'raw':!![]})[_0xc7fc('0x26')](handleEntityNotFound(_0x1695f0,null))[_0xc7fc('0x26')](function(_0x48aa51){if(_0x48aa51){if(!fs[_0xc7fc('0x5b')](path[_0xc7fc('0x5c')](config[_0xc7fc('0x5d')],_0xc7fc('0x5e'),_0x48aa51[_0xc7fc('0x5f')]))){throw new db[(_0xc7fc('0x60'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x106cde[_0xc7fc('0x37')][_0xc7fc('0x61')]){return _0x1695f0[_0xc7fc('0x2b')](0xc8);}return _0x1695f0['download'](path[_0xc7fc('0x5c')](config['root'],_0xc7fc('0x5e'),_0x48aa51['savename']),util[_0xc7fc('0x62')](_0xc7fc('0x63'),_0x48aa51[_0xc7fc('0x59')]||_0x48aa51[_0xc7fc('0x2e')],_0x48aa51[_0xc7fc('0x5a')][_0xc7fc('0x64')]()));}})[_0xc7fc('0x4a')](handleError(_0x1695f0,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index c7fee2b..1bfd5c0 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 _0xcf64=['define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x2c98ee,_0x41039a){var _0x37deef=function(_0x3c1e68){while(--_0x3c1e68){_0x2c98ee['push'](_0x2c98ee['shift']());}};_0x37deef(++_0x41039a);}(_0xcf64,0x1e7));var _0x4cf6=function(_0x34102d,_0x5d2401){_0x34102d=_0x34102d-0x0;var _0x47635d=_0xcf64[_0x34102d];return _0x47635d;};'use strict';var _=require('lodash');var util=require(_0x4cf6('0x0'));var logger=require(_0x4cf6('0x1'))(_0x4cf6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4cf6('0x3'));var rimraf=require(_0x4cf6('0x4'));var config=require(_0x4cf6('0x5'));var attributes=require(_0x4cf6('0x6'));module[_0x4cf6('0x7')]=function(_0x36668e,_0x46e003){return _0x36668e[_0x4cf6('0x8')](_0x4cf6('0x9'),attributes,{'tableName':_0x4cf6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2ca=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','exports','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x1a3bcd,_0x2e5e2b){var _0x236969=function(_0x5b2cad){while(--_0x5b2cad){_0x1a3bcd['push'](_0x1a3bcd['shift']());}};_0x236969(++_0x2e5e2b);}(_0xb2ca,0x1d6));var _0xab2c=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb2ca[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xab2c('0x0'));var util=require(_0xab2c('0x1'));var logger=require(_0xab2c('0x2'))(_0xab2c('0x3'));var moment=require(_0xab2c('0x4'));var BPromise=require(_0xab2c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xab2c('0x6'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xab2c('0x7')]=function(_0x25d4d9,_0xe39245){return _0x25d4d9['define'](_0xab2c('0x8'),attributes,{'tableName':_0xab2c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 649cae9..7b5cd17 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 _0x9b89=['jayson/promise','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x303a14,_0x464873){var _0x47ee14=function(_0x1629d0){while(--_0x1629d0){_0x303a14['push'](_0x303a14['shift']());}};_0x47ee14(++_0x464873);}(_0x9b89,0x17d));var _0x99b8=function(_0x4ea906,_0x3b19be){_0x4ea906=_0x4ea906-0x0;var _0x150c3f=_0x9b89[_0x4ea906];return _0x150c3f;};'use strict';var _=require(_0x99b8('0x0'));var util=require(_0x99b8('0x1'));var moment=require(_0x99b8('0x2'));var BPromise=require(_0x99b8('0x3'));var rs=require(_0x99b8('0x4'));var fs=require('fs');var Redis=require(_0x99b8('0x5'));var db=require(_0x99b8('0x6'))['db'];var utils=require(_0x99b8('0x7'));var logger=require('../../config/logger')(_0x99b8('0x8'));var config=require(_0x99b8('0x9'));var jayson=require(_0x99b8('0xa'));var client=jayson[_0x99b8('0xb')][_0x99b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4beb64,_0x351439,_0x56cbd6){return new BPromise(function(_0x14c7e7,_0x2ad940){return client[_0x99b8('0xd')](_0x4beb64,_0x56cbd6)['then'](function(_0x127782){logger['info'](_0x99b8('0xe'),_0x351439,_0x99b8('0xf'));logger['debug'](_0x99b8('0x10'),_0x351439,_0x99b8('0xf'),JSON[_0x99b8('0x11')](_0x127782));if(_0x127782[_0x99b8('0x12')]){if(_0x127782[_0x99b8('0x12')][_0x99b8('0x13')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x351439,_0x127782[_0x99b8('0x12')][_0x99b8('0x14')]);return _0x2ad940(_0x127782[_0x99b8('0x12')][_0x99b8('0x14')]);}logger['error'](_0x99b8('0xe'),_0x351439,_0x127782['error']['message']);return _0x14c7e7(_0x127782[_0x99b8('0x12')][_0x99b8('0x14')]);}else{logger[_0x99b8('0x15')](_0x99b8('0xe'),_0x351439,_0x99b8('0xf'));_0x14c7e7(_0x127782['result']['message']);}})[_0x99b8('0x16')](function(_0x45d7de){logger[_0x99b8('0x12')](_0x99b8('0xe'),_0x351439,_0x45d7de);_0x2ad940(_0x45d7de);});});} \ No newline at end of file +var _0x6691=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x52071d,_0xeb20ce){var _0x4ab920=function(_0xa9f7b9){while(--_0xa9f7b9){_0x52071d['push'](_0x52071d['shift']());}};_0x4ab920(++_0xeb20ce);}(_0x6691,0x134));var _0x1669=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6691[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var moment=require(_0x1669('0x2'));var BPromise=require(_0x1669('0x3'));var rs=require(_0x1669('0x4'));var fs=require('fs');var Redis=require(_0x1669('0x5'));var db=require(_0x1669('0x6'))['db'];var utils=require(_0x1669('0x7'));var logger=require('../../config/logger')(_0x1669('0x8'));var config=require(_0x1669('0x9'));var jayson=require(_0x1669('0xa'));var client=jayson[_0x1669('0xb')][_0x1669('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1810e5,_0x1e3038,_0x40a41b){return new BPromise(function(_0x5c8145,_0x28a69e){return client[_0x1669('0xd')](_0x1810e5,_0x40a41b)[_0x1669('0xe')](function(_0x4be0c7){logger[_0x1669('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e3038,'request\x20sent');logger['debug'](_0x1669('0x10'),_0x1e3038,_0x1669('0x11'),JSON[_0x1669('0x12')](_0x4be0c7));if(_0x4be0c7[_0x1669('0x13')]){if(_0x4be0c7[_0x1669('0x13')][_0x1669('0x14')]===0x1f4){logger[_0x1669('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e3038,_0x4be0c7[_0x1669('0x13')]['message']);return _0x28a69e(_0x4be0c7[_0x1669('0x13')][_0x1669('0x15')]);}logger[_0x1669('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e3038,_0x4be0c7['error'][_0x1669('0x15')]);return _0x5c8145(_0x4be0c7[_0x1669('0x13')][_0x1669('0x15')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e3038,'request\x20sent');_0x5c8145(_0x4be0c7[_0x1669('0x16')][_0x1669('0x15')]);}})[_0x1669('0x17')](function(_0x1038bb){logger[_0x1669('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e3038,_0x1038bb);_0x28a69e(_0x1038bb);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 81313de..be258c7 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 _0x1f14=['isAuthenticated','index','/:id','show','download','post','create','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x1f14,0x104));var _0x41f1=function(_0x1d2ff6,_0x3828db){_0x1d2ff6=_0x1d2ff6-0x0;var _0x52651e=_0x1f14[_0x1d2ff6];return _0x52651e;};'use strict';var multer=require(_0x41f1('0x0'));var util=require(_0x41f1('0x1'));var path=require('path');var timeout=require(_0x41f1('0x2'));var express=require(_0x41f1('0x3'));var router=express['Router']();var fs_extra=require(_0x41f1('0x4'));var auth=require(_0x41f1('0x5'));var interaction=require(_0x41f1('0x6'));var config=require(_0x41f1('0x7'));var controller=require(_0x41f1('0x8'));router[_0x41f1('0x9')]('/',auth[_0x41f1('0xa')](),controller[_0x41f1('0xb')]);router['get'](_0x41f1('0xc'),auth[_0x41f1('0xa')](),controller[_0x41f1('0xd')]);router[_0x41f1('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x41f1('0xe')]);router[_0x41f1('0xf')]('/',auth[_0x41f1('0xa')](),controller[_0x41f1('0x10')]);router['put']('/:id',auth[_0x41f1('0xa')](),controller['update']);router['delete'](_0x41f1('0xc'),auth[_0x41f1('0xa')](),controller['destroy']);module[_0x41f1('0x11')]=router; \ No newline at end of file +var _0x2395=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post','update','delete','exports'];(function(_0x7b7606,_0x559570){var _0x1a5edd=function(_0x5cd0df){while(--_0x5cd0df){_0x7b7606['push'](_0x7b7606['shift']());}};_0x1a5edd(++_0x559570);}(_0x2395,0x98));var _0x5239=function(_0x5ac1d4,_0x569604){_0x5ac1d4=_0x5ac1d4-0x0;var _0x5be735=_0x2395[_0x5ac1d4];return _0x5be735;};'use strict';var multer=require(_0x5239('0x0'));var util=require(_0x5239('0x1'));var path=require(_0x5239('0x2'));var timeout=require(_0x5239('0x3'));var express=require('express');var router=express[_0x5239('0x4')]();var fs_extra=require(_0x5239('0x5'));var auth=require(_0x5239('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5239('0x7'));var controller=require(_0x5239('0x8'));router[_0x5239('0x9')]('/',auth[_0x5239('0xa')](),controller[_0x5239('0xb')]);router[_0x5239('0x9')](_0x5239('0xc'),auth[_0x5239('0xa')](),controller[_0x5239('0xd')]);router['get']('/:id/download',auth[_0x5239('0xa')](),controller[_0x5239('0xe')]);router[_0x5239('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x5239('0xc'),auth['isAuthenticated'](),controller[_0x5239('0x10')]);router[_0x5239('0x11')](_0x5239('0xc'),auth[_0x5239('0xa')](),controller['destroy']);module[_0x5239('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 a9643e2..66e666c 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 _0xc259=['TEXT','STRING','BOOLEAN','exports'];(function(_0x31dde9,_0x12e816){var _0x1fbf2d=function(_0x1d1bf6){while(--_0x1d1bf6){_0x31dde9['push'](_0x31dde9['shift']());}};_0x1fbf2d(++_0x12e816);}(_0xc259,0x7b));var _0x9c25=function(_0x420c28,_0x56f6c0){_0x420c28=_0x420c28-0x0;var _0x307b8=_0xc259[_0x420c28];return _0x307b8;};'use strict';var Sequelize=require('sequelize');module[_0x9c25('0x0')]={'field':{'type':Sequelize[_0x9c25('0x1')]},'alias':{'type':Sequelize[_0x9c25('0x2')]},'function':{'type':Sequelize[_0x9c25('0x2')]},'format':{'type':Sequelize[_0x9c25('0x2')]},'groupBy':{'type':Sequelize[_0x9c25('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9c25('0x2')]},'custom':{'type':Sequelize[_0x9c25('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xdfad=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x4df5d3,_0x522c48){var _0x34a8d=function(_0x52f363){while(--_0x52f363){_0x4df5d3['push'](_0x4df5d3['shift']());}};_0x34a8d(++_0x522c48);}(_0xdfad,0xdd));var _0xddfa=function(_0xcf581b,_0x4359dd){_0xcf581b=_0xcf581b-0x0;var _0x4f454d=_0xdfad[_0xcf581b];return _0x4f454d;};'use strict';var Sequelize=require(_0xddfa('0x0'));module[_0xddfa('0x1')]={'field':{'type':Sequelize[_0xddfa('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xddfa('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xddfa('0x3')]},'custom':{'type':Sequelize[_0xddfa('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index a7e908d..e6bc229 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 _0x340f=['fast-json-patch','request-promise','moment','bluebird','path','fs-extra','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','end','json','offset','limit','undefined','count','status','Content-Range','save','update','destroy','then','sendStatus','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','includeAll','findAll','rows','keys','include','find','catch','create','bulkCreate','body','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf'];(function(_0x133b9f,_0x1ef2b9){var _0x56c5e5=function(_0x5105ac){while(--_0x5105ac){_0x133b9f['push'](_0x133b9f['shift']());}};_0x56c5e5(++_0x1ef2b9);}(_0x340f,0xe8));var _0xf340=function(_0x353583,_0x2463fe){_0x353583=_0x353583-0x0;var _0x4f1028=_0x340f[_0x353583];return _0x4f1028;};'use strict';var emlformat=require(_0xf340('0x0'));var rimraf=require(_0xf340('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf340('0x2'));var rp=require(_0xf340('0x3'));var moment=require(_0xf340('0x4'));var BPromise=require(_0xf340('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf340('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf340('0x7'));var _=require('lodash');var squel=require(_0xf340('0x8'));var crypto=require(_0xf340('0x9'));var jsforce=require(_0xf340('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf340('0xb'));var querystring=require('querystring');var Papa=require(_0xf340('0xc'));var Redis=require(_0xf340('0xd'));var authService=require(_0xf340('0xe'));var qs=require(_0xf340('0xf'));var as=require(_0xf340('0x10'));var hardwareService=require(_0xf340('0x11'));var logger=require(_0xf340('0x12'))(_0xf340('0x13'));var utils=require(_0xf340('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf340('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2dbe08,_0x357015){_0x357015=_0x357015||0xcc;return function(_0x5991c0){if(_0x5991c0){return _0x2dbe08['sendStatus'](_0x357015);}return _0x2dbe08['status'](_0x357015)[_0xf340('0x16')]();};}function respondWithResult(_0x5f244f,_0x529839){_0x529839=_0x529839||0xc8;return function(_0x5cce02){if(_0x5cce02){return _0x5f244f['status'](_0x529839)[_0xf340('0x17')](_0x5cce02);}};}function respondWithFilteredResult(_0x2ea757,_0x4e966e){return function(_0x452647){if(_0x452647){var _0x46c19e=typeof _0x4e966e[_0xf340('0x18')]==='undefined'&&typeof _0x4e966e[_0xf340('0x19')]===_0xf340('0x1a');var _0x53ba55=_0x452647[_0xf340('0x1b')];var _0x406834=_0x46c19e?0x0:_0x4e966e[_0xf340('0x18')];var _0x5be404=_0x46c19e?_0x452647[_0xf340('0x1b')]:_0x4e966e[_0xf340('0x18')]+_0x4e966e['limit'];var _0x43caed;if(_0x5be404>=_0x53ba55){_0x5be404=_0x53ba55;_0x43caed=0xc8;}else{_0x43caed=0xce;}_0x2ea757[_0xf340('0x1c')](_0x43caed);return _0x2ea757['set'](_0xf340('0x1d'),_0x406834+'-'+_0x5be404+'/'+_0x53ba55)[_0xf340('0x17')](_0x452647);}return null;};}function patchUpdates(_0x204be8){return function(_0x23770f){try{jsonpatch['apply'](_0x23770f,_0x204be8,!![]);}catch(_0x1b03cd){return BPromise['reject'](_0x1b03cd);}return _0x23770f[_0xf340('0x1e')]();};}function saveUpdates(_0xc50be5,_0x4fa7e3){return function(_0x489977){if(_0x489977){return _0x489977[_0xf340('0x1f')](_0xc50be5)['then'](function(_0x1ab763){return _0x1ab763;});}return null;};}function removeEntity(_0x7e97a8,_0x1e418a){return function(_0x487c99){if(_0x487c99){return _0x487c99[_0xf340('0x20')]()[_0xf340('0x21')](function(){_0x7e97a8[_0xf340('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4067a2,_0x1260fb){return function(_0xd0d9a4){if(!_0xd0d9a4){_0x4067a2[_0xf340('0x22')](0x194);}return _0xd0d9a4;};}function handleError(_0x2e184e,_0x354f32){_0x354f32=_0x354f32||0x1f4;return function(_0xcaa467){logger['error'](_0xcaa467[_0xf340('0x23')]);if(_0xcaa467[_0xf340('0x24')]){delete _0xcaa467[_0xf340('0x24')];}_0x2e184e['status'](_0x354f32)[_0xf340('0x25')](_0xcaa467);};}exports[_0xf340('0x26')]=function(_0xe0be3e,_0x19b7de){var _0x2253a4={},_0x5e07c1={},_0x51e8da={'count':0x0,'rows':[]};var _0x1f4b63=_['map'](db[_0xf340('0x27')][_0xf340('0x28')],function(_0x1a65e3){return{'name':_0x1a65e3[_0xf340('0x29')],'type':_0x1a65e3[_0xf340('0x2a')][_0xf340('0x2b')]};});_0x5e07c1['model']=_[_0xf340('0x2c')](_0x1f4b63,_0xf340('0x24'));_0x5e07c1[_0xf340('0x2d')]=_['keys'](_0xe0be3e['query']);_0x5e07c1[_0xf340('0x2e')]=_[_0xf340('0x2f')](_0x5e07c1[_0xf340('0x30')],_0x5e07c1[_0xf340('0x2d')]);_0x2253a4[_0xf340('0x31')]=_[_0xf340('0x2f')](_0x5e07c1[_0xf340('0x30')],qs[_0xf340('0x32')](_0xe0be3e[_0xf340('0x2d')][_0xf340('0x32')]));_0x2253a4[_0xf340('0x31')]=_0x2253a4[_0xf340('0x31')][_0xf340('0x33')]?_0x2253a4[_0xf340('0x31')]:_0x5e07c1[_0xf340('0x30')];if(!_0xe0be3e[_0xf340('0x2d')][_0xf340('0x34')](_0xf340('0x35'))){_0x2253a4[_0xf340('0x19')]=qs['limit'](_0xe0be3e['query']['limit']);_0x2253a4[_0xf340('0x18')]=qs[_0xf340('0x18')](_0xe0be3e[_0xf340('0x2d')][_0xf340('0x18')]);}_0x2253a4[_0xf340('0x36')]=qs[_0xf340('0x37')](_0xe0be3e[_0xf340('0x2d')][_0xf340('0x37')]);_0x2253a4[_0xf340('0x38')]=qs[_0xf340('0x2e')](_['pick'](_0xe0be3e['query'],_0x5e07c1[_0xf340('0x2e')]),_0x1f4b63);if(_0xe0be3e[_0xf340('0x2d')]['filter']){_0x2253a4[_0xf340('0x38')]=_['merge'](_0x2253a4[_0xf340('0x38')],{'$or':_[_0xf340('0x2c')](_0x1f4b63,function(_0x23867a){if(_0x23867a['type']!==_0xf340('0x39')){var _0x3a669a={};_0x3a669a[_0x23867a['name']]={'$like':'%'+_0xe0be3e[_0xf340('0x2d')]['filter']+'%'};return _0x3a669a;}})});}_0x2253a4=_[_0xf340('0x3a')]({},_0x2253a4,_0xe0be3e[_0xf340('0x3b')]);var _0x560188={'where':_0x2253a4['where']};return db[_0xf340('0x27')]['count'](_0x560188)[_0xf340('0x21')](function(_0x2e072b){_0x51e8da[_0xf340('0x1b')]=_0x2e072b;if(_0xe0be3e[_0xf340('0x2d')][_0xf340('0x3c')]){_0x2253a4['include']=[{'all':!![]}];}return db[_0xf340('0x27')][_0xf340('0x3d')](_0x2253a4);})[_0xf340('0x21')](function(_0x58ee8c){_0x51e8da[_0xf340('0x3e')]=_0x58ee8c;return _0x51e8da;})[_0xf340('0x21')](respondWithFilteredResult(_0x19b7de,_0x2253a4))['catch'](handleError(_0x19b7de,null));};exports['show']=function(_0x18922c,_0x5dc95f){var _0x32c2db={'raw':![],'where':{'id':_0x18922c['params']['id']}},_0x485475={};_0x485475[_0xf340('0x30')]=_[_0xf340('0x3f')](db[_0xf340('0x27')][_0xf340('0x28')]);_0x485475[_0xf340('0x2d')]=_[_0xf340('0x3f')](_0x18922c[_0xf340('0x2d')]);_0x485475[_0xf340('0x2e')]=_['intersection'](_0x485475[_0xf340('0x30')],_0x485475['query']);_0x32c2db[_0xf340('0x31')]=_['intersection'](_0x485475[_0xf340('0x30')],qs[_0xf340('0x32')](_0x18922c[_0xf340('0x2d')]['fields']));_0x32c2db[_0xf340('0x31')]=_0x32c2db[_0xf340('0x31')][_0xf340('0x33')]?_0x32c2db[_0xf340('0x31')]:_0x485475['model'];if(_0x18922c[_0xf340('0x2d')][_0xf340('0x3c')]){_0x32c2db[_0xf340('0x40')]=[{'all':!![]}];}_0x32c2db=_[_0xf340('0x3a')]({},_0x32c2db,_0x18922c[_0xf340('0x3b')]);return db[_0xf340('0x27')][_0xf340('0x41')](_0x32c2db)[_0xf340('0x21')](handleEntityNotFound(_0x5dc95f,null))[_0xf340('0x21')](respondWithResult(_0x5dc95f,null))[_0xf340('0x42')](handleError(_0x5dc95f,null));};exports[_0xf340('0x43')]=function(_0xa9421e,_0x353441){return db[_0xf340('0x27')][_0xf340('0x43')](_0xa9421e['body'],{})[_0xf340('0x21')](respondWithResult(_0x353441,0xc9))[_0xf340('0x42')](handleError(_0x353441,null));};exports['bulkCreate']=function(_0x58c9b0,_0x3e7d7b){return db['AnalyticFieldReport'][_0xf340('0x44')](_0x58c9b0['body'],{'raw':![],'individualHooks':!![]})[_0xf340('0x21')](respondWithResult(_0x3e7d7b,0xc9))[_0xf340('0x42')](handleError(_0x3e7d7b,null));};exports[_0xf340('0x1f')]=function(_0x4445d4,_0x5118b7){if(_0x4445d4[_0xf340('0x45')]['id']){delete _0x4445d4[_0xf340('0x45')]['id'];}return db[_0xf340('0x27')][_0xf340('0x41')]({'where':{'id':_0x4445d4[_0xf340('0x46')]['id']}})['then'](handleEntityNotFound(_0x5118b7,null))['then'](saveUpdates(_0x4445d4[_0xf340('0x45')],null))[_0xf340('0x21')](respondWithResult(_0x5118b7,null))['catch'](handleError(_0x5118b7,null));};exports[_0xf340('0x20')]=function(_0x28b1cc,_0x22481e){return db['AnalyticFieldReport'][_0xf340('0x41')]({'where':{'id':_0x28b1cc['params']['id']}})[_0xf340('0x21')](handleEntityNotFound(_0x22481e,null))[_0xf340('0x21')](removeEntity(_0x22481e,null))[_0xf340('0x42')](handleError(_0x22481e,null));};exports[_0xf340('0x47')]=function(_0x26236c,_0x53888f){return db[_0xf340('0x27')]['destroy']({'where':{'id':_0x26236c[_0xf340('0x2d')][_0xf340('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0xf340('0x21')](respondWithResult(_0x53888f,0xcc))[_0xf340('0x42')](handleError(_0x53888f,null));};exports[_0xf340('0x49')]=function(_0x132b4c,_0x3f82d3,_0x1265a9){return db[_0xf340('0x4a')][_0xf340('0x4b')]({'where':{'id':_0x132b4c[_0xf340('0x46')]['id']}})[_0xf340('0x21')](handleEntityNotFound(_0x3f82d3,null))[_0xf340('0x21')](function(_0x32b88b){if(_0x32b88b){return db['sequelize'][_0xf340('0x4c')](function(_0x337bce){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x132b4c[_0xf340('0x46')]['id']},'transaction':_0x337bce})[_0xf340('0x21')](function(_0x56d9f2){var _0x36f205=_[_0xf340('0x2c')](_0x132b4c[_0xf340('0x45')],function(_0x26e60c){delete _0x26e60c['id'];_0x26e60c[_0xf340('0x4d')]=_0x132b4c[_0xf340('0x46')]['id'];return _0x26e60c;});return db['AnalyticFieldReport'][_0xf340('0x44')](_0x36f205,{'transaction':_0x337bce});});})[_0xf340('0x21')](function(){return db[_0xf340('0x27')][_0xf340('0x3d')]({'where':{'CustomReportId':_0x132b4c[_0xf340('0x46')]['id']}});});}})[_0xf340('0x21')](respondWithResult(_0x3f82d3,null))['catch'](handleError(_0x3f82d3,null));}; \ No newline at end of file +var _0xa5e4=['rows','includeAll','catch','create','body','bulkCreate','find','params','ids','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','destroy','then','error','name','index','map','AnalyticFieldReport','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','findAll'];(function(_0x49cb5f,_0x6940ff){var _0x12064b=function(_0x2ec5ba){while(--_0x2ec5ba){_0x49cb5f['push'](_0x49cb5f['shift']());}};_0x12064b(++_0x6940ff);}(_0xa5e4,0xee));var _0x4a5e=function(_0x4adfce,_0xadf17e){_0x4adfce=_0x4adfce-0x0;var _0x39de92=_0xa5e4[_0x4adfce];return _0x39de92;};'use strict';var emlformat=require(_0x4a5e('0x0'));var rimraf=require(_0x4a5e('0x1'));var zipdir=require(_0x4a5e('0x2'));var jsonpatch=require(_0x4a5e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4a5e('0x4'));var util=require(_0x4a5e('0x5'));var path=require(_0x4a5e('0x6'));var sox=require(_0x4a5e('0x7'));var csv=require(_0x4a5e('0x8'));var ejs=require(_0x4a5e('0x9'));var fs=require('fs');var fs_extra=require(_0x4a5e('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4a5e('0xb'));var jsforce=require(_0x4a5e('0xc'));var deskjs=require(_0x4a5e('0xd'));var toCsv=require(_0x4a5e('0x8'));var querystring=require(_0x4a5e('0xe'));var Papa=require(_0x4a5e('0xf'));var Redis=require(_0x4a5e('0x10'));var authService=require(_0x4a5e('0x11'));var qs=require(_0x4a5e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a5e('0x13'))(_0x4a5e('0x14'));var utils=require('../../config/utils');var config=require(_0x4a5e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc404ce,_0x4c1ba8){_0x4c1ba8=_0x4c1ba8||0xcc;return function(_0x1c6084){if(_0x1c6084){return _0xc404ce[_0x4a5e('0x16')](_0x4c1ba8);}return _0xc404ce[_0x4a5e('0x17')](_0x4c1ba8)[_0x4a5e('0x18')]();};}function respondWithResult(_0x5a0936,_0x58c417){_0x58c417=_0x58c417||0xc8;return function(_0x35838e){if(_0x35838e){return _0x5a0936[_0x4a5e('0x17')](_0x58c417)[_0x4a5e('0x19')](_0x35838e);}};}function respondWithFilteredResult(_0x1c5725,_0x63a0ba){return function(_0x1ac161){if(_0x1ac161){var _0x171627=typeof _0x63a0ba['offset']===_0x4a5e('0x1a')&&typeof _0x63a0ba[_0x4a5e('0x1b')]===_0x4a5e('0x1a');var _0xb16a6c=_0x1ac161['count'];var _0x3d3529=_0x171627?0x0:_0x63a0ba[_0x4a5e('0x1c')];var _0x11d786=_0x171627?_0x1ac161[_0x4a5e('0x1d')]:_0x63a0ba[_0x4a5e('0x1c')]+_0x63a0ba['limit'];var _0x54c4ef;if(_0x11d786>=_0xb16a6c){_0x11d786=_0xb16a6c;_0x54c4ef=0xc8;}else{_0x54c4ef=0xce;}_0x1c5725[_0x4a5e('0x17')](_0x54c4ef);return _0x1c5725[_0x4a5e('0x1e')](_0x4a5e('0x1f'),_0x3d3529+'-'+_0x11d786+'/'+_0xb16a6c)[_0x4a5e('0x19')](_0x1ac161);}return null;};}function patchUpdates(_0x4b50bb){return function(_0x2eae45){try{jsonpatch[_0x4a5e('0x20')](_0x2eae45,_0x4b50bb,!![]);}catch(_0x344d41){return BPromise[_0x4a5e('0x21')](_0x344d41);}return _0x2eae45['save']();};}function saveUpdates(_0x395d28,_0x4187e0){return function(_0x3ab175){if(_0x3ab175){return _0x3ab175['update'](_0x395d28)['then'](function(_0x2547ec){return _0x2547ec;});}return null;};}function removeEntity(_0x3e919b,_0x349894){return function(_0x40c811){if(_0x40c811){return _0x40c811[_0x4a5e('0x22')]()[_0x4a5e('0x23')](function(){_0x3e919b[_0x4a5e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x198744,_0x50125c){return function(_0x5919a0){if(!_0x5919a0){_0x198744[_0x4a5e('0x16')](0x194);}return _0x5919a0;};}function handleError(_0x4ae0ff,_0x2ab5e5){_0x2ab5e5=_0x2ab5e5||0x1f4;return function(_0x39cc85){logger[_0x4a5e('0x24')](_0x39cc85['stack']);if(_0x39cc85[_0x4a5e('0x25')]){delete _0x39cc85[_0x4a5e('0x25')];}_0x4ae0ff[_0x4a5e('0x17')](_0x2ab5e5)['send'](_0x39cc85);};}exports[_0x4a5e('0x26')]=function(_0x15c3fb,_0x5ac9a5){var _0x589b11={},_0x4f301c={},_0x36d5fd={'count':0x0,'rows':[]};var _0x3bdc54=_[_0x4a5e('0x27')](db[_0x4a5e('0x28')]['rawAttributes'],function(_0x451b1c){return{'name':_0x451b1c[_0x4a5e('0x29')],'type':_0x451b1c[_0x4a5e('0x2a')][_0x4a5e('0x2b')]};});_0x4f301c['model']=_[_0x4a5e('0x27')](_0x3bdc54,_0x4a5e('0x25'));_0x4f301c[_0x4a5e('0x2c')]=_[_0x4a5e('0x2d')](_0x15c3fb[_0x4a5e('0x2c')]);_0x4f301c[_0x4a5e('0x2e')]=_['intersection'](_0x4f301c[_0x4a5e('0x2f')],_0x4f301c[_0x4a5e('0x2c')]);_0x589b11[_0x4a5e('0x30')]=_[_0x4a5e('0x31')](_0x4f301c['model'],qs[_0x4a5e('0x32')](_0x15c3fb[_0x4a5e('0x2c')][_0x4a5e('0x32')]));_0x589b11[_0x4a5e('0x30')]=_0x589b11[_0x4a5e('0x30')][_0x4a5e('0x33')]?_0x589b11[_0x4a5e('0x30')]:_0x4f301c[_0x4a5e('0x2f')];if(!_0x15c3fb['query'][_0x4a5e('0x34')](_0x4a5e('0x35'))){_0x589b11[_0x4a5e('0x1b')]=qs[_0x4a5e('0x1b')](_0x15c3fb['query'][_0x4a5e('0x1b')]);_0x589b11[_0x4a5e('0x1c')]=qs[_0x4a5e('0x1c')](_0x15c3fb[_0x4a5e('0x2c')][_0x4a5e('0x1c')]);}_0x589b11[_0x4a5e('0x36')]=qs[_0x4a5e('0x37')](_0x15c3fb[_0x4a5e('0x2c')][_0x4a5e('0x37')]);_0x589b11[_0x4a5e('0x38')]=qs[_0x4a5e('0x2e')](_['pick'](_0x15c3fb[_0x4a5e('0x2c')],_0x4f301c[_0x4a5e('0x2e')]),_0x3bdc54);if(_0x15c3fb['query']['filter']){_0x589b11[_0x4a5e('0x38')]=_[_0x4a5e('0x39')](_0x589b11[_0x4a5e('0x38')],{'$or':_[_0x4a5e('0x27')](_0x3bdc54,function(_0x505893){if(_0x505893['type']!==_0x4a5e('0x3a')){var _0x5ac49e={};_0x5ac49e[_0x505893[_0x4a5e('0x25')]]={'$like':'%'+_0x15c3fb['query'][_0x4a5e('0x3b')]+'%'};return _0x5ac49e;}})});}_0x589b11=_[_0x4a5e('0x39')]({},_0x589b11,_0x15c3fb[_0x4a5e('0x3c')]);var _0x41b626={'where':_0x589b11[_0x4a5e('0x38')]};return db[_0x4a5e('0x28')][_0x4a5e('0x1d')](_0x41b626)[_0x4a5e('0x23')](function(_0x50d88d){_0x36d5fd['count']=_0x50d88d;if(_0x15c3fb[_0x4a5e('0x2c')]['includeAll']){_0x589b11['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x4a5e('0x3d')](_0x589b11);})['then'](function(_0x415e90){_0x36d5fd[_0x4a5e('0x3e')]=_0x415e90;return _0x36d5fd;})[_0x4a5e('0x23')](respondWithFilteredResult(_0x5ac9a5,_0x589b11))['catch'](handleError(_0x5ac9a5,null));};exports['show']=function(_0x998b65,_0x52468f){var _0x45d3a1={'raw':![],'where':{'id':_0x998b65['params']['id']}},_0x19e5eb={};_0x19e5eb[_0x4a5e('0x2f')]=_['keys'](db[_0x4a5e('0x28')]['rawAttributes']);_0x19e5eb[_0x4a5e('0x2c')]=_['keys'](_0x998b65[_0x4a5e('0x2c')]);_0x19e5eb[_0x4a5e('0x2e')]=_[_0x4a5e('0x31')](_0x19e5eb[_0x4a5e('0x2f')],_0x19e5eb[_0x4a5e('0x2c')]);_0x45d3a1[_0x4a5e('0x30')]=_['intersection'](_0x19e5eb[_0x4a5e('0x2f')],qs[_0x4a5e('0x32')](_0x998b65[_0x4a5e('0x2c')][_0x4a5e('0x32')]));_0x45d3a1[_0x4a5e('0x30')]=_0x45d3a1[_0x4a5e('0x30')]['length']?_0x45d3a1['attributes']:_0x19e5eb[_0x4a5e('0x2f')];if(_0x998b65[_0x4a5e('0x2c')][_0x4a5e('0x3f')]){_0x45d3a1['include']=[{'all':!![]}];}_0x45d3a1=_['merge']({},_0x45d3a1,_0x998b65[_0x4a5e('0x3c')]);return db['AnalyticFieldReport']['find'](_0x45d3a1)[_0x4a5e('0x23')](handleEntityNotFound(_0x52468f,null))[_0x4a5e('0x23')](respondWithResult(_0x52468f,null))[_0x4a5e('0x40')](handleError(_0x52468f,null));};exports['create']=function(_0x42b1c1,_0x31f271){return db['AnalyticFieldReport'][_0x4a5e('0x41')](_0x42b1c1[_0x4a5e('0x42')],{})[_0x4a5e('0x23')](respondWithResult(_0x31f271,0xc9))[_0x4a5e('0x40')](handleError(_0x31f271,null));};exports[_0x4a5e('0x43')]=function(_0xfd035d,_0x28c7f6){return db[_0x4a5e('0x28')][_0x4a5e('0x43')](_0xfd035d[_0x4a5e('0x42')],{'raw':![],'individualHooks':!![]})[_0x4a5e('0x23')](respondWithResult(_0x28c7f6,0xc9))[_0x4a5e('0x40')](handleError(_0x28c7f6,null));};exports['update']=function(_0x765b73,_0x3fa8b3){if(_0x765b73[_0x4a5e('0x42')]['id']){delete _0x765b73[_0x4a5e('0x42')]['id'];}return db[_0x4a5e('0x28')][_0x4a5e('0x44')]({'where':{'id':_0x765b73[_0x4a5e('0x45')]['id']}})[_0x4a5e('0x23')](handleEntityNotFound(_0x3fa8b3,null))[_0x4a5e('0x23')](saveUpdates(_0x765b73[_0x4a5e('0x42')],null))['then'](respondWithResult(_0x3fa8b3,null))[_0x4a5e('0x40')](handleError(_0x3fa8b3,null));};exports[_0x4a5e('0x22')]=function(_0x13a1b8,_0x13b093){return db['AnalyticFieldReport'][_0x4a5e('0x44')]({'where':{'id':_0x13a1b8['params']['id']}})[_0x4a5e('0x23')](handleEntityNotFound(_0x13b093,null))[_0x4a5e('0x23')](removeEntity(_0x13b093,null))[_0x4a5e('0x40')](handleError(_0x13b093,null));};exports['bulkDestroy']=function(_0x14b3ab,_0x1566b2){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x14b3ab[_0x4a5e('0x2c')][_0x4a5e('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x4a5e('0x23')](respondWithResult(_0x1566b2,0xcc))[_0x4a5e('0x40')](handleError(_0x1566b2,null));};exports[_0x4a5e('0x47')]=function(_0x52e44e,_0x406ffe,_0x51835f){return db[_0x4a5e('0x48')]['findOne']({'where':{'id':_0x52e44e[_0x4a5e('0x45')]['id']}})[_0x4a5e('0x23')](handleEntityNotFound(_0x406ffe,null))[_0x4a5e('0x23')](function(_0x5703cd){if(_0x5703cd){return db[_0x4a5e('0x49')][_0x4a5e('0x4a')](function(_0x2b8116){return db[_0x4a5e('0x28')]['destroy']({'where':{'CustomReportId':_0x52e44e[_0x4a5e('0x45')]['id']},'transaction':_0x2b8116})[_0x4a5e('0x23')](function(_0x28b8db){var _0x1197f8=_[_0x4a5e('0x27')](_0x52e44e[_0x4a5e('0x42')],function(_0x4a938b){delete _0x4a938b['id'];_0x4a938b['CustomReportId']=_0x52e44e['params']['id'];return _0x4a938b;});return db[_0x4a5e('0x28')][_0x4a5e('0x43')](_0x1197f8,{'transaction':_0x2b8116});});})['then'](function(){return db[_0x4a5e('0x28')]['findAll']({'where':{'CustomReportId':_0x52e44e['params']['id']}});});}})['then'](respondWithResult(_0x406ffe,null))[_0x4a5e('0x40')](handleError(_0x406ffe,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 188b800..092f9e6 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 _0x59f0=['request-promise','path','../../config/environment','exports','define','analytics_report_fields','lodash','util','api','moment'];(function(_0x4b56c4,_0xfb1534){var _0x531804=function(_0x4c4071){while(--_0x4c4071){_0x4b56c4['push'](_0x4b56c4['shift']());}};_0x531804(++_0xfb1534);}(_0x59f0,0xec));var _0x059f=function(_0x583fa3,_0x43cd55){_0x583fa3=_0x583fa3-0x0;var _0x501bb0=_0x59f0[_0x583fa3];return _0x501bb0;};'use strict';var _=require(_0x059f('0x0'));var util=require(_0x059f('0x1'));var logger=require('../../config/logger')(_0x059f('0x2'));var moment=require(_0x059f('0x3'));var BPromise=require('bluebird');var rp=require(_0x059f('0x4'));var fs=require('fs');var path=require(_0x059f('0x5'));var rimraf=require('rimraf');var config=require(_0x059f('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x059f('0x7')]=function(_0x45ec5a,_0x223bb2){return _0x45ec5a[_0x059f('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x059f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7c1=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport'];(function(_0x25ba6a,_0x4422d6){var _0x1be09a=function(_0x308e7b){while(--_0x308e7b){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x1be09a(++_0x4422d6);}(_0xe7c1,0x108));var _0x1e7c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe7c1[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1e7c('0x0'));var util=require('util');var logger=require(_0x1e7c('0x1'))(_0x1e7c('0x2'));var moment=require(_0x1e7c('0x3'));var BPromise=require(_0x1e7c('0x4'));var rp=require(_0x1e7c('0x5'));var fs=require('fs');var path=require(_0x1e7c('0x6'));var rimraf=require(_0x1e7c('0x7'));var config=require(_0x1e7c('0x8'));var attributes=require(_0x1e7c('0x9'));module[_0x1e7c('0xa')]=function(_0x3bb4f2,_0xcb4f4){return _0x3bb4f2['define'](_0x1e7c('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 39eeb00..896c5c1 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 _0x0805=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x42da94,_0x337285){var _0x16344b=function(_0x3b93bd){while(--_0x3b93bd){_0x42da94['push'](_0x42da94['shift']());}};_0x16344b(++_0x337285);}(_0x0805,0x13c));var _0x5080=function(_0x2b326f,_0x102d26){_0x2b326f=_0x2b326f-0x0;var _0x1c46a6=_0x0805[_0x2b326f];return _0x1c46a6;};'use strict';var _=require(_0x5080('0x0'));var util=require(_0x5080('0x1'));var moment=require(_0x5080('0x2'));var BPromise=require(_0x5080('0x3'));var rs=require(_0x5080('0x4'));var fs=require('fs');var Redis=require(_0x5080('0x5'));var db=require(_0x5080('0x6'))['db'];var utils=require(_0x5080('0x7'));var logger=require('../../config/logger')(_0x5080('0x8'));var config=require(_0x5080('0x9'));var jayson=require(_0x5080('0xa'));var client=jayson[_0x5080('0xb')][_0x5080('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50eddf,_0x4f2c63,_0x4ce8d4){return new BPromise(function(_0xba6a59,_0x429c21){return client[_0x5080('0xd')](_0x50eddf,_0x4ce8d4)['then'](function(_0x18c6be){logger[_0x5080('0xe')](_0x5080('0xf'),_0x4f2c63,_0x5080('0x10'));logger[_0x5080('0x11')](_0x5080('0x12'),_0x4f2c63,_0x5080('0x10'),JSON[_0x5080('0x13')](_0x18c6be));if(_0x18c6be['error']){if(_0x18c6be[_0x5080('0x14')][_0x5080('0x15')]===0x1f4){logger[_0x5080('0x14')](_0x5080('0xf'),_0x4f2c63,_0x18c6be[_0x5080('0x14')][_0x5080('0x16')]);return _0x429c21(_0x18c6be[_0x5080('0x14')][_0x5080('0x16')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x4f2c63,_0x18c6be['error'][_0x5080('0x16')]);return _0xba6a59(_0x18c6be[_0x5080('0x14')][_0x5080('0x16')]);}else{logger[_0x5080('0xe')](_0x5080('0xf'),_0x4f2c63,'request\x20sent');_0xba6a59(_0x18c6be['result']['message']);}})['catch'](function(_0x4a9eb0){logger[_0x5080('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4f2c63,_0x4a9eb0);_0x429c21(_0x4a9eb0);});});} \ No newline at end of file +var _0xe66e=['stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x1212c4,_0xb95f31){var _0x2f63f2=function(_0x48222d){while(--_0x48222d){_0x1212c4['push'](_0x1212c4['shift']());}};_0x2f63f2(++_0xb95f31);}(_0xe66e,0xbd));var _0xee66=function(_0x38aeea,_0x57522a){_0x38aeea=_0x38aeea-0x0;var _0x5e8d2c=_0xe66e[_0x38aeea];return _0x5e8d2c;};'use strict';var _=require(_0xee66('0x0'));var util=require(_0xee66('0x1'));var moment=require(_0xee66('0x2'));var BPromise=require(_0xee66('0x3'));var rs=require(_0xee66('0x4'));var fs=require('fs');var Redis=require(_0xee66('0x5'));var db=require(_0xee66('0x6'))['db'];var utils=require(_0xee66('0x7'));var logger=require(_0xee66('0x8'))(_0xee66('0x9'));var config=require('../../config/environment');var jayson=require(_0xee66('0xa'));var client=jayson[_0xee66('0xb')][_0xee66('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5da8d9,_0x326715,_0x3c3f11){return new BPromise(function(_0x3a816d,_0x330e1e){return client[_0xee66('0xd')](_0x5da8d9,_0x3c3f11)[_0xee66('0xe')](function(_0x8b4b2a){logger[_0xee66('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x326715,_0xee66('0x10'));logger[_0xee66('0x11')](_0xee66('0x12'),_0x326715,_0xee66('0x10'),JSON[_0xee66('0x13')](_0x8b4b2a));if(_0x8b4b2a[_0xee66('0x14')]){if(_0x8b4b2a['error'][_0xee66('0x15')]===0x1f4){logger[_0xee66('0x14')](_0xee66('0x16'),_0x326715,_0x8b4b2a[_0xee66('0x14')][_0xee66('0x17')]);return _0x330e1e(_0x8b4b2a[_0xee66('0x14')][_0xee66('0x17')]);}logger[_0xee66('0x14')](_0xee66('0x16'),_0x326715,_0x8b4b2a[_0xee66('0x14')][_0xee66('0x17')]);return _0x3a816d(_0x8b4b2a[_0xee66('0x14')][_0xee66('0x17')]);}else{logger[_0xee66('0xf')](_0xee66('0x16'),_0x326715,_0xee66('0x10'));_0x3a816d(_0x8b4b2a[_0xee66('0x18')]['message']);}})[_0xee66('0x19')](function(_0x2866b5){logger[_0xee66('0x14')](_0xee66('0x16'),_0x326715,_0x2866b5);_0x330e1e(_0x2866b5);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index c9dce1f..f2cc95b 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(_0x4e2315,_0x417736){var _0x35a59f=function(_0x2de11b){while(--_0x2de11b){_0x4e2315['push'](_0x4e2315['shift']());}};_0x35a59f(++_0x417736);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x1b353c,_0x493626){var _0x3a261f=function(_0xf48bf8){while(--_0xf48bf8){_0x1b353c['push'](_0x1b353c['shift']());}};_0x3a261f(++_0x493626);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 b97f0da..62c4a19 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 _0xaa1b=['sequelize','exports','STRING'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xbaa1('0x0'));module[_0xbaa1('0x1')]={'name':{'type':Sequelize[_0xbaa1('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xbaa1('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xbaa1('0x2')]}}; \ No newline at end of file +var _0x3a25=['exports','STRING','name','TEXT','sequelize'];(function(_0x479c87,_0x321410){var _0x22bafb=function(_0xb38dde){while(--_0xb38dde){_0x479c87['push'](_0x479c87['shift']());}};_0x22bafb(++_0x321410);}(_0x3a25,0x15d));var _0x53a2=function(_0x1aa5b6,_0x3d3dea){_0x1aa5b6=_0x1aa5b6-0x0;var _0x6eb0f7=_0x3a25[_0x1aa5b6];return _0x6eb0f7;};'use strict';var Sequelize=require(_0x53a2('0x0'));module[_0x53a2('0x1')]={'name':{'type':Sequelize[_0x53a2('0x2')],'allowNull':![],'unique':_0x53a2('0x3')},'table':{'type':Sequelize[_0x53a2('0x2')]},'metric':{'type':Sequelize[_0x53a2('0x4')]},'description':{'type':Sequelize[_0x53a2('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index cecc6f4..4b4bd64 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 _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x4bd861,_0x41d6c4){var _0x23dad6=function(_0x23f60c){while(--_0x23f60c){_0x4bd861['push'](_0x4bd861['shift']());}};_0x23dad6(++_0x41d6c4);}(_0x7217,0x19e));var _0x7721=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x7217[_0x36dfbd];return _0x4ecad9;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));}; \ No newline at end of file +var _0x7fbe=['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','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x377a95,_0x5daf8c){var _0x5529ca=function(_0x577b7b){while(--_0x577b7b){_0x377a95['push'](_0x377a95['shift']());}};_0x5529ca(++_0x5daf8c);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xe50651,_0x78b476){_0xe50651=_0xe50651-0x0;var _0xc8931c=_0x7fbe[_0xe50651];return _0xc8931c;};'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(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 22a5b95..cff4de1 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 _0x2dc3=['request-promise','path','rimraf','exports','AnalyticMetric','util','../../config/logger','api','moment','bluebird'];(function(_0x2c8dd6,_0x3d86ca){var _0x55ffca=function(_0x452930){while(--_0x452930){_0x2c8dd6['push'](_0x2c8dd6['shift']());}};_0x55ffca(++_0x3d86ca);}(_0x2dc3,0x127));var _0x32dc=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2dc3[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0x32dc('0x0'));var logger=require(_0x32dc('0x1'))(_0x32dc('0x2'));var moment=require(_0x32dc('0x3'));var BPromise=require(_0x32dc('0x4'));var rp=require(_0x32dc('0x5'));var fs=require('fs');var path=require(_0x32dc('0x6'));var rimraf=require(_0x32dc('0x7'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x32dc('0x8')]=function(_0x58b6ba,_0x1f59d3){return _0x58b6ba['define'](_0x32dc('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf350=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0xf350,0x105));var _0x0f35=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf350[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0f35('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0f35('0x1'));var moment=require(_0x0f35('0x2'));var BPromise=require(_0x0f35('0x3'));var rp=require(_0x0f35('0x4'));var fs=require('fs');var path=require(_0x0f35('0x5'));var rimraf=require(_0x0f35('0x6'));var config=require(_0x0f35('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x557c1d,_0x348399){return _0x557c1d[_0x0f35('0x8')]('AnalyticMetric',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 08192e7..ceb5de9 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 _0x482a=['AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x21baf2,_0x1e4f21){var _0x4aea51=function(_0x447249){while(--_0x447249){_0x21baf2['push'](_0x21baf2['shift']());}};_0x4aea51(++_0x1e4f21);}(_0x482a,0x1eb));var _0xa482=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x482a[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0xa482('0x0'));var util=require(_0xa482('0x1'));var moment=require(_0xa482('0x2'));var BPromise=require(_0xa482('0x3'));var rs=require(_0xa482('0x4'));var fs=require('fs');var Redis=require(_0xa482('0x5'));var db=require(_0xa482('0x6'))['db'];var utils=require(_0xa482('0x7'));var logger=require(_0xa482('0x8'))(_0xa482('0x9'));var config=require('../../config/environment');var jayson=require(_0xa482('0xa'));var client=jayson[_0xa482('0xb')][_0xa482('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ef7ae,_0x1fe721,_0x504396){return new BPromise(function(_0x294adb,_0x31dac9){return client[_0xa482('0xd')](_0x4ef7ae,_0x504396)['then'](function(_0x256613){logger[_0xa482('0xe')](_0xa482('0xf'),_0x1fe721,'request\x20sent');logger['debug'](_0xa482('0x10'),_0x1fe721,_0xa482('0x11'),JSON[_0xa482('0x12')](_0x256613));if(_0x256613[_0xa482('0x13')]){if(_0x256613[_0xa482('0x13')][_0xa482('0x14')]===0x1f4){logger[_0xa482('0x13')](_0xa482('0xf'),_0x1fe721,_0x256613[_0xa482('0x13')][_0xa482('0x15')]);return _0x31dac9(_0x256613[_0xa482('0x13')][_0xa482('0x15')]);}logger[_0xa482('0x13')](_0xa482('0xf'),_0x1fe721,_0x256613[_0xa482('0x13')][_0xa482('0x15')]);return _0x294adb(_0x256613[_0xa482('0x13')]['message']);}else{logger[_0xa482('0xe')](_0xa482('0xf'),_0x1fe721,_0xa482('0x11'));_0x294adb(_0x256613['result'][_0xa482('0x15')]);}})[_0xa482('0x16')](function(_0x2bd19a){logger[_0xa482('0x13')](_0xa482('0xf'),_0x1fe721,_0x2bd19a);_0x31dac9(_0x2bd19a);});});} \ No newline at end of file +var _0x74fd=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x431344,_0x1840f8){var _0x3a6bf6=function(_0xae0376){while(--_0xae0376){_0x431344['push'](_0x431344['shift']());}};_0x3a6bf6(++_0x1840f8);}(_0x74fd,0x134));var _0xd74f=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0x74fd[_0x35485a];return _0x5148e6;};'use strict';var _=require(_0xd74f('0x0'));var util=require(_0xd74f('0x1'));var moment=require(_0xd74f('0x2'));var BPromise=require(_0xd74f('0x3'));var rs=require(_0xd74f('0x4'));var fs=require('fs');var Redis=require(_0xd74f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd74f('0x6'));var logger=require(_0xd74f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd74f('0x8'));var client=jayson[_0xd74f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b8a68,_0x2e9bda,_0x1a132d){return new BPromise(function(_0x1079fe,_0x531ef7){return client[_0xd74f('0xa')](_0x2b8a68,_0x1a132d)[_0xd74f('0xb')](function(_0x5a9a9e){logger[_0xd74f('0xc')](_0xd74f('0xd'),_0x2e9bda,_0xd74f('0xe'));logger['debug'](_0xd74f('0xf'),_0x2e9bda,_0xd74f('0xe'),JSON[_0xd74f('0x10')](_0x5a9a9e));if(_0x5a9a9e[_0xd74f('0x11')]){if(_0x5a9a9e['error'][_0xd74f('0x12')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x2e9bda,_0x5a9a9e['error']['message']);return _0x531ef7(_0x5a9a9e[_0xd74f('0x11')][_0xd74f('0x13')]);}logger[_0xd74f('0x11')](_0xd74f('0xd'),_0x2e9bda,_0x5a9a9e['error'][_0xd74f('0x13')]);return _0x1079fe(_0x5a9a9e[_0xd74f('0x11')][_0xd74f('0x13')]);}else{logger[_0xd74f('0xc')](_0xd74f('0xd'),_0x2e9bda,_0xd74f('0xe'));_0x1079fe(_0x5a9a9e[_0xd74f('0x14')][_0xd74f('0x13')]);}})[_0xd74f('0x15')](function(_0x58a3fd){logger[_0xd74f('0x11')](_0xd74f('0xd'),_0x2e9bda,_0x58a3fd);_0x531ef7(_0x58a3fd);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index ba06a48..7848035 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 _0xe015=['../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','show','post','create','put','delete','destroy','multer','util','path','Router','../../components/auth/service'];(function(_0x4591b5,_0xa100ab){var _0x481cfc=function(_0x552fd1){while(--_0x552fd1){_0x4591b5['push'](_0x4591b5['shift']());}};_0x481cfc(++_0xa100ab);}(_0xe015,0x13b));var _0x5e01=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xe015[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var path=require(_0x5e01('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e01('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5e01('0x4'));var interaction=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var controller=require(_0x5e01('0x7'));router['get']('/',auth[_0x5e01('0x8')](),controller[_0x5e01('0x9')]);router['get']('/:id',auth[_0x5e01('0x8')](),controller[_0x5e01('0xa')]);router[_0x5e01('0xb')]('/',auth[_0x5e01('0x8')](),controller[_0x5e01('0xc')]);router[_0x5e01('0xd')]('/:id',auth[_0x5e01('0x8')](),controller['update']);router[_0x5e01('0xe')]('/:id',auth[_0x5e01('0x8')](),controller[_0x5e01('0xf')]);module['exports']=router; \ No newline at end of file +var _0x43fd=['../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','create','update','delete','destroy','exports','util','express','Router'];(function(_0x1113bd,_0x48fbf1){var _0x983a36=function(_0x4007b6){while(--_0x4007b6){_0x1113bd['push'](_0x1113bd['shift']());}};_0x983a36(++_0x48fbf1);}(_0x43fd,0x1ec));var _0xd43f=function(_0x39bb5d,_0x522ce6){_0x39bb5d=_0x39bb5d-0x0;var _0x3ead95=_0x43fd[_0x39bb5d];return _0x3ead95;};'use strict';var multer=require('multer');var util=require(_0xd43f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd43f('0x1'));var router=express[_0xd43f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd43f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd43f('0x4'));var controller=require(_0xd43f('0x5'));router[_0xd43f('0x6')]('/',auth[_0xd43f('0x7')](),controller['index']);router[_0xd43f('0x6')](_0xd43f('0x8'),auth[_0xd43f('0x7')](),controller[_0xd43f('0x9')]);router['post']('/',auth[_0xd43f('0x7')](),controller[_0xd43f('0xa')]);router['put'](_0xd43f('0x8'),auth[_0xd43f('0x7')](),controller[_0xd43f('0xb')]);router[_0xd43f('0xc')](_0xd43f('0x8'),auth['isAuthenticated'](),controller[_0xd43f('0xd')]);module[_0xd43f('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 342067b..a0c7ba5 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 _0x66e4=['exports'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x66e4,0x8f));var _0x466e=function(_0xeae82f,_0x5139bb){_0xeae82f=_0xeae82f-0x0;var _0x561707=_0x66e4[_0xeae82f];return _0x561707;};'use strict';var Sequelize=require('sequelize');module[_0x466e('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x145c=['TEXT','sequelize'];(function(_0x2778c1,_0x1b0bc2){var _0x1ec2f4=function(_0xa56cf9){while(--_0xa56cf9){_0x2778c1['push'](_0x2778c1['shift']());}};_0x1ec2f4(++_0x1b0bc2);}(_0x145c,0x193));var _0xc145=function(_0x52fdd9,_0x5eef37){_0x52fdd9=_0x52fdd9-0x0;var _0x4c68b3=_0x145c[_0x52fdd9];return _0x4c68b3;};'use strict';var Sequelize=require(_0xc145('0x0'));module['exports']={'tree':{'type':Sequelize[_0xc145('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index d60501d..c6d588e 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 _0xe54b=['offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','rows','catch','params','intersection','length','include','merge','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x4bfd9b,_0x2c9bf0){var _0x4ef3e5=function(_0x4be272){while(--_0x4be272){_0x4bfd9b['push'](_0x4bfd9b['shift']());}};_0x4ef3e5(++_0x2c9bf0);}(_0xe54b,0x77));var _0xbe54=function(_0x2ade53,_0x3e25a8){_0x2ade53=_0x2ade53-0x0;var _0x8fe2f8=_0xe54b[_0x2ade53];return _0x8fe2f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe54('0x0'));var zipdir=require(_0xbe54('0x1'));var jsonpatch=require(_0xbe54('0x2'));var rp=require(_0xbe54('0x3'));var moment=require('moment');var BPromise=require(_0xbe54('0x4'));var Mustache=require(_0xbe54('0x5'));var util=require(_0xbe54('0x6'));var path=require(_0xbe54('0x7'));var sox=require(_0xbe54('0x8'));var csv=require(_0xbe54('0x9'));var ejs=require(_0xbe54('0xa'));var fs=require('fs');var fs_extra=require(_0xbe54('0xb'));var _=require(_0xbe54('0xc'));var squel=require(_0xbe54('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbe54('0x9'));var querystring=require(_0xbe54('0xe'));var Papa=require(_0xbe54('0xf'));var Redis=require(_0xbe54('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbe54('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe54('0x12'))('api');var utils=require(_0xbe54('0x13'));var config=require(_0xbe54('0x14'));var licenseUtil=require(_0xbe54('0x15'));var db=require(_0xbe54('0x16'))['db'];function respondWithStatusCode(_0x2cb1d0,_0x128615){_0x128615=_0x128615||0xcc;return function(_0x73d431){if(_0x73d431){return _0x2cb1d0[_0xbe54('0x17')](_0x128615);}return _0x2cb1d0['status'](_0x128615)[_0xbe54('0x18')]();};}function respondWithResult(_0x325cdb,_0x5bb6ce){_0x5bb6ce=_0x5bb6ce||0xc8;return function(_0x1f9957){if(_0x1f9957){return _0x325cdb['status'](_0x5bb6ce)['json'](_0x1f9957);}};}function respondWithFilteredResult(_0x2ae272,_0x223721){return function(_0x1df4bd){if(_0x1df4bd){var _0x284107=typeof _0x223721[_0xbe54('0x19')]===_0xbe54('0x1a')&&typeof _0x223721[_0xbe54('0x1b')]===_0xbe54('0x1a');var _0x200ec7=_0x1df4bd[_0xbe54('0x1c')];var _0x2e72ef=_0x284107?0x0:_0x223721[_0xbe54('0x19')];var _0x4fee0b=_0x284107?_0x1df4bd[_0xbe54('0x1c')]:_0x223721[_0xbe54('0x19')]+_0x223721[_0xbe54('0x1b')];var _0x219bc2;if(_0x4fee0b>=_0x200ec7){_0x4fee0b=_0x200ec7;_0x219bc2=0xc8;}else{_0x219bc2=0xce;}_0x2ae272[_0xbe54('0x1d')](_0x219bc2);return _0x2ae272[_0xbe54('0x1e')]('Content-Range',_0x2e72ef+'-'+_0x4fee0b+'/'+_0x200ec7)['json'](_0x1df4bd);}return null;};}function patchUpdates(_0x5f43de){return function(_0x46c33e){try{jsonpatch[_0xbe54('0x1f')](_0x46c33e,_0x5f43de,!![]);}catch(_0x200680){return BPromise[_0xbe54('0x20')](_0x200680);}return _0x46c33e[_0xbe54('0x21')]();};}function saveUpdates(_0xd652e,_0x54a34c){return function(_0x24909b){if(_0x24909b){return _0x24909b[_0xbe54('0x22')](_0xd652e)[_0xbe54('0x23')](function(_0x1aa067){return _0x1aa067;});}return null;};}function removeEntity(_0x49bf72,_0x5bf917){return function(_0x3ce4fa){if(_0x3ce4fa){return _0x3ce4fa[_0xbe54('0x24')]()['then'](function(){_0x49bf72['status'](0xcc)[_0xbe54('0x18')]();});}};}function handleEntityNotFound(_0x8594c7,_0x5774d5){return function(_0x12062e){if(!_0x12062e){_0x8594c7[_0xbe54('0x17')](0x194);}return _0x12062e;};}function handleError(_0x55e2cc,_0x10d166){_0x10d166=_0x10d166||0x1f4;return function(_0x4910ca){logger[_0xbe54('0x25')](_0x4910ca[_0xbe54('0x26')]);if(_0x4910ca[_0xbe54('0x27')]){delete _0x4910ca[_0xbe54('0x27')];}_0x55e2cc[_0xbe54('0x1d')](_0x10d166)[_0xbe54('0x28')](_0x4910ca);};}exports[_0xbe54('0x29')]=function(_0x155116,_0x45c0e3){var _0x4c6658={},_0x375594={},_0x4fad98={'count':0x0,'rows':[]};var _0x593152=_[_0xbe54('0x2a')](db[_0xbe54('0x2b')][_0xbe54('0x2c')],function(_0x282198){return{'name':_0x282198[_0xbe54('0x2d')],'type':_0x282198[_0xbe54('0x2e')][_0xbe54('0x2f')]};});_0x375594[_0xbe54('0x30')]=_[_0xbe54('0x2a')](_0x593152,_0xbe54('0x27'));_0x375594[_0xbe54('0x31')]=_['keys'](_0x155116[_0xbe54('0x31')]);_0x375594[_0xbe54('0x32')]=_['intersection'](_0x375594[_0xbe54('0x30')],_0x375594[_0xbe54('0x31')]);_0x4c6658[_0xbe54('0x33')]=_['intersection'](_0x375594[_0xbe54('0x30')],qs[_0xbe54('0x34')](_0x155116[_0xbe54('0x31')]['fields']));_0x4c6658[_0xbe54('0x33')]=_0x4c6658[_0xbe54('0x33')]['length']?_0x4c6658[_0xbe54('0x33')]:_0x375594[_0xbe54('0x30')];if(!_0x155116[_0xbe54('0x31')][_0xbe54('0x35')](_0xbe54('0x36'))){_0x4c6658[_0xbe54('0x1b')]=qs[_0xbe54('0x1b')](_0x155116['query'][_0xbe54('0x1b')]);_0x4c6658['offset']=qs['offset'](_0x155116['query'][_0xbe54('0x19')]);}_0x4c6658[_0xbe54('0x37')]=qs[_0xbe54('0x38')](_0x155116[_0xbe54('0x31')]['sort']);_0x4c6658[_0xbe54('0x39')]=qs[_0xbe54('0x32')](_[_0xbe54('0x3a')](_0x155116[_0xbe54('0x31')],_0x375594[_0xbe54('0x32')]),_0x593152);if(_0x155116['query'][_0xbe54('0x3b')]){_0x4c6658['where']=_['merge'](_0x4c6658[_0xbe54('0x39')],{'$or':_[_0xbe54('0x2a')](_0x593152,function(_0x2a2940){if(_0x2a2940['type']!==_0xbe54('0x3c')){var _0x53224c={};_0x53224c[_0x2a2940[_0xbe54('0x27')]]={'$like':'%'+_0x155116[_0xbe54('0x31')][_0xbe54('0x3b')]+'%'};return _0x53224c;}})});}_0x4c6658=_['merge']({},_0x4c6658,_0x155116['options']);var _0x48d6bf={'where':_0x4c6658[_0xbe54('0x39')]};return db[_0xbe54('0x2b')][_0xbe54('0x1c')](_0x48d6bf)[_0xbe54('0x23')](function(_0x6ca4ee){_0x4fad98[_0xbe54('0x1c')]=_0x6ca4ee;if(_0x155116[_0xbe54('0x31')][_0xbe54('0x3d')]){_0x4c6658['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x4c6658);})['then'](function(_0x3f7e70){_0x4fad98[_0xbe54('0x3e')]=_0x3f7e70;return _0x4fad98;})[_0xbe54('0x23')](respondWithFilteredResult(_0x45c0e3,_0x4c6658))[_0xbe54('0x3f')](handleError(_0x45c0e3,null));};exports['show']=function(_0x27f8ee,_0x20c27f){var _0x25f72a={'raw':!![],'where':{'id':_0x27f8ee[_0xbe54('0x40')]['id']}},_0x3af925={};_0x3af925['model']=_['keys'](db['AnalyticTreeReport'][_0xbe54('0x2c')]);_0x3af925['query']=_['keys'](_0x27f8ee[_0xbe54('0x31')]);_0x3af925['filters']=_[_0xbe54('0x41')](_0x3af925[_0xbe54('0x30')],_0x3af925['query']);_0x25f72a[_0xbe54('0x33')]=_[_0xbe54('0x41')](_0x3af925[_0xbe54('0x30')],qs['fields'](_0x27f8ee[_0xbe54('0x31')]['fields']));_0x25f72a[_0xbe54('0x33')]=_0x25f72a[_0xbe54('0x33')][_0xbe54('0x42')]?_0x25f72a[_0xbe54('0x33')]:_0x3af925[_0xbe54('0x30')];if(_0x27f8ee[_0xbe54('0x31')][_0xbe54('0x3d')]){_0x25f72a[_0xbe54('0x43')]=[{'all':!![]}];}_0x25f72a=_[_0xbe54('0x44')]({},_0x25f72a,_0x27f8ee['options']);return db[_0xbe54('0x2b')]['find'](_0x25f72a)[_0xbe54('0x23')](handleEntityNotFound(_0x20c27f,null))[_0xbe54('0x23')](respondWithResult(_0x20c27f,null))[_0xbe54('0x3f')](handleError(_0x20c27f,null));};exports['create']=function(_0x1af9d1,_0x1e2cd5){return db[_0xbe54('0x2b')][_0xbe54('0x45')](_0x1af9d1[_0xbe54('0x46')],{})[_0xbe54('0x23')](respondWithResult(_0x1e2cd5,0xc9))[_0xbe54('0x3f')](handleError(_0x1e2cd5,null));};exports['update']=function(_0x3819ea,_0x54607e){if(_0x3819ea['body']['id']){delete _0x3819ea['body']['id'];}return db[_0xbe54('0x2b')][_0xbe54('0x47')]({'where':{'id':_0x3819ea['params']['id']}})['then'](handleEntityNotFound(_0x54607e,null))[_0xbe54('0x23')](saveUpdates(_0x3819ea[_0xbe54('0x46')],null))[_0xbe54('0x23')](respondWithResult(_0x54607e,null))[_0xbe54('0x3f')](handleError(_0x54607e,null));};exports[_0xbe54('0x24')]=function(_0xed1201,_0x326b7a){return db[_0xbe54('0x2b')]['find']({'where':{'id':_0xed1201[_0xbe54('0x40')]['id']}})['then'](handleEntityNotFound(_0x326b7a,null))['then'](removeEntity(_0x326b7a,null))[_0xbe54('0x3f')](handleError(_0x326b7a,null));}; \ No newline at end of file +var _0xd478=['count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticTreeReport','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit'];(function(_0x17409c,_0x460ad2){var _0x6b02e8=function(_0x44c685){while(--_0x44c685){_0x17409c['push'](_0x17409c['shift']());}};_0x6b02e8(++_0x460ad2);}(_0xd478,0x163));var _0x8d47=function(_0x9c607a,_0x1cb2c6){_0x9c607a=_0x9c607a-0x0;var _0x3b1311=_0xd478[_0x9c607a];return _0x3b1311;};'use strict';var emlformat=require(_0x8d47('0x0'));var rimraf=require(_0x8d47('0x1'));var zipdir=require(_0x8d47('0x2'));var jsonpatch=require(_0x8d47('0x3'));var rp=require(_0x8d47('0x4'));var moment=require(_0x8d47('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8d47('0x6'));var util=require('util');var path=require(_0x8d47('0x7'));var sox=require(_0x8d47('0x8'));var csv=require('to-csv');var ejs=require(_0x8d47('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d47('0xa'));var squel=require(_0x8d47('0xb'));var crypto=require(_0x8d47('0xc'));var jsforce=require(_0x8d47('0xd'));var deskjs=require(_0x8d47('0xe'));var toCsv=require(_0x8d47('0xf'));var querystring=require(_0x8d47('0x10'));var Papa=require('papaparse');var Redis=require(_0x8d47('0x11'));var authService=require(_0x8d47('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8d47('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d47('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x8d47('0x15'));var licenseUtil=require(_0x8d47('0x16'));var db=require(_0x8d47('0x17'))['db'];function respondWithStatusCode(_0x3006ba,_0x103590){_0x103590=_0x103590||0xcc;return function(_0x10f687){if(_0x10f687){return _0x3006ba[_0x8d47('0x18')](_0x103590);}return _0x3006ba[_0x8d47('0x19')](_0x103590)[_0x8d47('0x1a')]();};}function respondWithResult(_0x241c19,_0x575f34){_0x575f34=_0x575f34||0xc8;return function(_0x32738f){if(_0x32738f){return _0x241c19[_0x8d47('0x19')](_0x575f34)[_0x8d47('0x1b')](_0x32738f);}};}function respondWithFilteredResult(_0x1d7958,_0x2ee561){return function(_0x386eb8){if(_0x386eb8){var _0x3ad271=typeof _0x2ee561['offset']===_0x8d47('0x1c')&&typeof _0x2ee561[_0x8d47('0x1d')]===_0x8d47('0x1c');var _0x5751be=_0x386eb8[_0x8d47('0x1e')];var _0x1d408d=_0x3ad271?0x0:_0x2ee561[_0x8d47('0x1f')];var _0x25d505=_0x3ad271?_0x386eb8[_0x8d47('0x1e')]:_0x2ee561[_0x8d47('0x1f')]+_0x2ee561[_0x8d47('0x1d')];var _0x36fbbd;if(_0x25d505>=_0x5751be){_0x25d505=_0x5751be;_0x36fbbd=0xc8;}else{_0x36fbbd=0xce;}_0x1d7958[_0x8d47('0x19')](_0x36fbbd);return _0x1d7958[_0x8d47('0x20')](_0x8d47('0x21'),_0x1d408d+'-'+_0x25d505+'/'+_0x5751be)[_0x8d47('0x1b')](_0x386eb8);}return null;};}function patchUpdates(_0x20aa14){return function(_0x35c59d){try{jsonpatch[_0x8d47('0x22')](_0x35c59d,_0x20aa14,!![]);}catch(_0x449254){return BPromise[_0x8d47('0x23')](_0x449254);}return _0x35c59d[_0x8d47('0x24')]();};}function saveUpdates(_0x162581,_0xb49f96){return function(_0x24a851){if(_0x24a851){return _0x24a851[_0x8d47('0x25')](_0x162581)[_0x8d47('0x26')](function(_0x126a92){return _0x126a92;});}return null;};}function removeEntity(_0x3061dd,_0x19fe7c){return function(_0x12dc92){if(_0x12dc92){return _0x12dc92[_0x8d47('0x27')]()[_0x8d47('0x26')](function(){_0x3061dd['status'](0xcc)[_0x8d47('0x1a')]();});}};}function handleEntityNotFound(_0x211850,_0x1eb17f){return function(_0x5602e3){if(!_0x5602e3){_0x211850[_0x8d47('0x18')](0x194);}return _0x5602e3;};}function handleError(_0x171010,_0x13eca0){_0x13eca0=_0x13eca0||0x1f4;return function(_0xe33766){logger[_0x8d47('0x28')](_0xe33766[_0x8d47('0x29')]);if(_0xe33766['name']){delete _0xe33766[_0x8d47('0x2a')];}_0x171010[_0x8d47('0x19')](_0x13eca0)[_0x8d47('0x2b')](_0xe33766);};}exports[_0x8d47('0x2c')]=function(_0x37d79b,_0x22c860){var _0x66b205={},_0x1c1ccb={},_0x2f6add={'count':0x0,'rows':[]};var _0x5a25b2=_['map'](db[_0x8d47('0x2d')]['rawAttributes'],function(_0xf2a16a){return{'name':_0xf2a16a[_0x8d47('0x2e')],'type':_0xf2a16a[_0x8d47('0x2f')][_0x8d47('0x30')]};});_0x1c1ccb['model']=_[_0x8d47('0x31')](_0x5a25b2,'name');_0x1c1ccb[_0x8d47('0x32')]=_[_0x8d47('0x33')](_0x37d79b[_0x8d47('0x32')]);_0x1c1ccb[_0x8d47('0x34')]=_['intersection'](_0x1c1ccb[_0x8d47('0x35')],_0x1c1ccb['query']);_0x66b205[_0x8d47('0x36')]=_[_0x8d47('0x37')](_0x1c1ccb[_0x8d47('0x35')],qs[_0x8d47('0x38')](_0x37d79b[_0x8d47('0x32')][_0x8d47('0x38')]));_0x66b205['attributes']=_0x66b205[_0x8d47('0x36')][_0x8d47('0x39')]?_0x66b205[_0x8d47('0x36')]:_0x1c1ccb['model'];if(!_0x37d79b['query'][_0x8d47('0x3a')](_0x8d47('0x3b'))){_0x66b205['limit']=qs[_0x8d47('0x1d')](_0x37d79b['query']['limit']);_0x66b205[_0x8d47('0x1f')]=qs[_0x8d47('0x1f')](_0x37d79b['query'][_0x8d47('0x1f')]);}_0x66b205[_0x8d47('0x3c')]=qs[_0x8d47('0x3d')](_0x37d79b[_0x8d47('0x32')][_0x8d47('0x3d')]);_0x66b205[_0x8d47('0x3e')]=qs[_0x8d47('0x34')](_['pick'](_0x37d79b[_0x8d47('0x32')],_0x1c1ccb[_0x8d47('0x34')]),_0x5a25b2);if(_0x37d79b[_0x8d47('0x32')]['filter']){_0x66b205[_0x8d47('0x3e')]=_[_0x8d47('0x3f')](_0x66b205[_0x8d47('0x3e')],{'$or':_['map'](_0x5a25b2,function(_0x55bb84){if(_0x55bb84[_0x8d47('0x2f')]!==_0x8d47('0x40')){var _0x2ddb86={};_0x2ddb86[_0x55bb84[_0x8d47('0x2a')]]={'$like':'%'+_0x37d79b[_0x8d47('0x32')][_0x8d47('0x41')]+'%'};return _0x2ddb86;}})});}_0x66b205=_['merge']({},_0x66b205,_0x37d79b[_0x8d47('0x42')]);var _0x3765a3={'where':_0x66b205['where']};return db['AnalyticTreeReport'][_0x8d47('0x1e')](_0x3765a3)[_0x8d47('0x26')](function(_0x3d2936){_0x2f6add['count']=_0x3d2936;if(_0x37d79b[_0x8d47('0x32')]['includeAll']){_0x66b205[_0x8d47('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x8d47('0x44')](_0x66b205);})[_0x8d47('0x26')](function(_0x3f610a){_0x2f6add[_0x8d47('0x45')]=_0x3f610a;return _0x2f6add;})[_0x8d47('0x26')](respondWithFilteredResult(_0x22c860,_0x66b205))[_0x8d47('0x46')](handleError(_0x22c860,null));};exports[_0x8d47('0x47')]=function(_0x52e7cc,_0x4f2ced){var _0x39d9fd={'raw':!![],'where':{'id':_0x52e7cc[_0x8d47('0x48')]['id']}},_0x26ed70={};_0x26ed70[_0x8d47('0x35')]=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x26ed70['query']=_['keys'](_0x52e7cc[_0x8d47('0x32')]);_0x26ed70[_0x8d47('0x34')]=_[_0x8d47('0x37')](_0x26ed70[_0x8d47('0x35')],_0x26ed70['query']);_0x39d9fd[_0x8d47('0x36')]=_[_0x8d47('0x37')](_0x26ed70['model'],qs[_0x8d47('0x38')](_0x52e7cc[_0x8d47('0x32')][_0x8d47('0x38')]));_0x39d9fd['attributes']=_0x39d9fd[_0x8d47('0x36')][_0x8d47('0x39')]?_0x39d9fd[_0x8d47('0x36')]:_0x26ed70['model'];if(_0x52e7cc[_0x8d47('0x32')][_0x8d47('0x49')]){_0x39d9fd[_0x8d47('0x43')]=[{'all':!![]}];}_0x39d9fd=_[_0x8d47('0x3f')]({},_0x39d9fd,_0x52e7cc[_0x8d47('0x42')]);return db['AnalyticTreeReport'][_0x8d47('0x4a')](_0x39d9fd)[_0x8d47('0x26')](handleEntityNotFound(_0x4f2ced,null))['then'](respondWithResult(_0x4f2ced,null))['catch'](handleError(_0x4f2ced,null));};exports['create']=function(_0x456fe9,_0x21815d){return db[_0x8d47('0x2d')][_0x8d47('0x4b')](_0x456fe9[_0x8d47('0x4c')],{})[_0x8d47('0x26')](respondWithResult(_0x21815d,0xc9))['catch'](handleError(_0x21815d,null));};exports[_0x8d47('0x25')]=function(_0x20bc13,_0x42e1f8){if(_0x20bc13[_0x8d47('0x4c')]['id']){delete _0x20bc13[_0x8d47('0x4c')]['id'];}return db[_0x8d47('0x2d')][_0x8d47('0x4a')]({'where':{'id':_0x20bc13[_0x8d47('0x48')]['id']}})[_0x8d47('0x26')](handleEntityNotFound(_0x42e1f8,null))[_0x8d47('0x26')](saveUpdates(_0x20bc13[_0x8d47('0x4c')],null))['then'](respondWithResult(_0x42e1f8,null))[_0x8d47('0x46')](handleError(_0x42e1f8,null));};exports[_0x8d47('0x27')]=function(_0x11f928,_0xa514a9){return db[_0x8d47('0x2d')][_0x8d47('0x4a')]({'where':{'id':_0x11f928[_0x8d47('0x48')]['id']}})[_0x8d47('0x26')](handleEntityNotFound(_0xa514a9,null))[_0x8d47('0x26')](removeEntity(_0xa514a9,null))[_0x8d47('0x46')](handleError(_0xa514a9,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index fc30e3a..8da4dd7 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 _0xe34b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees'];(function(_0x38cf75,_0x2aa799){var _0x222b18=function(_0x3a11b9){while(--_0x3a11b9){_0x38cf75['push'](_0x38cf75['shift']());}};_0x222b18(++_0x2aa799);}(_0xe34b,0x1b0));var _0xbe34=function(_0x146be0,_0x39a85e){_0x146be0=_0x146be0-0x0;var _0x1bcc25=_0xe34b[_0x146be0];return _0x1bcc25;};'use strict';var _=require('lodash');var util=require(_0xbe34('0x0'));var logger=require(_0xbe34('0x1'))(_0xbe34('0x2'));var moment=require(_0xbe34('0x3'));var BPromise=require(_0xbe34('0x4'));var rp=require(_0xbe34('0x5'));var fs=require('fs');var path=require(_0xbe34('0x6'));var rimraf=require(_0xbe34('0x7'));var config=require(_0xbe34('0x8'));var attributes=require(_0xbe34('0x9'));module['exports']=function(_0x34659b,_0x1c36c5){return _0x34659b['define'](_0xbe34('0xa'),attributes,{'tableName':_0xbe34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62ee=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x43cb9e,_0x126f18){var _0x36b6d2=function(_0x255521){while(--_0x255521){_0x43cb9e['push'](_0x43cb9e['shift']());}};_0x36b6d2(++_0x126f18);}(_0x62ee,0x133));var _0xe62e=function(_0x55b7fb,_0x55098d){_0x55b7fb=_0x55b7fb-0x0;var _0x1b9c01=_0x62ee[_0x55b7fb];return _0x1b9c01;};'use strict';var _=require(_0xe62e('0x0'));var util=require(_0xe62e('0x1'));var logger=require(_0xe62e('0x2'))(_0xe62e('0x3'));var moment=require(_0xe62e('0x4'));var BPromise=require(_0xe62e('0x5'));var rp=require(_0xe62e('0x6'));var fs=require('fs');var path=require(_0xe62e('0x7'));var rimraf=require('rimraf');var config=require(_0xe62e('0x8'));var attributes=require(_0xe62e('0x9'));module[_0xe62e('0xa')]=function(_0x23dc42,_0x2762f7){return _0x23dc42[_0xe62e('0xb')](_0xe62e('0xc'),attributes,{'tableName':_0xe62e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index c3ccac1..8f1f602 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3b8544,_0x501cdd){var _0x2905d9=function(_0x4b70ce){while(--_0x4b70ce){_0x3b8544['push'](_0x3b8544['shift']());}};_0x2905d9(++_0x501cdd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xc4aa[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x41f464,_0x5db750){var _0x4aea93=function(_0x4eb308){while(--_0x4eb308){_0x41f464['push'](_0x41f464['shift']());}};_0x4aea93(++_0x5db750);}(_0x1261,0x144));var _0x1126=function(_0x5162ed,_0x386cb7){_0x5162ed=_0x5162ed-0x0;var _0x4c579b=_0x1261[_0x5162ed];return _0x4c579b;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 90b40c5..35c5ab7 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 _0x3dbc=['show','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3dbc,0x1e3));var _0xc3db=function(_0x319784,_0x47e6d4){_0x319784=_0x319784-0x0;var _0x1917da=_0x3dbc[_0x319784];return _0x1917da;};'use strict';var multer=require('multer');var util=require(_0xc3db('0x0'));var path=require('path');var timeout=require(_0xc3db('0x1'));var express=require(_0xc3db('0x2'));var router=express[_0xc3db('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc3db('0x4'));var interaction=require(_0xc3db('0x5'));var config=require(_0xc3db('0x6'));var controller=require('./analyticTreeReport.controller');router[_0xc3db('0x7')]('/',auth[_0xc3db('0x8')](),controller[_0xc3db('0x9')]);router[_0xc3db('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc3db('0xa')]);router[_0xc3db('0xb')]('/',auth[_0xc3db('0x8')](),controller[_0xc3db('0xc')]);router['put']('/:id',auth[_0xc3db('0x8')](),controller[_0xc3db('0xd')]);router[_0xc3db('0xe')]('/:id',auth[_0xc3db('0x8')](),controller[_0xc3db('0xf')]);module[_0xc3db('0x10')]=router; \ No newline at end of file +var _0x0bcf=['/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x33beda,_0x442d50){var _0xf54446=function(_0xc7be33){while(--_0xc7be33){_0x33beda['push'](_0x33beda['shift']());}};_0xf54446(++_0x442d50);}(_0x0bcf,0x111));var _0xf0bc=function(_0x5cdde3,_0x9789ce){_0x5cdde3=_0x5cdde3-0x0;var _0x53619d=_0x0bcf[_0x5cdde3];return _0x53619d;};'use strict';var multer=require(_0xf0bc('0x0'));var util=require(_0xf0bc('0x1'));var path=require(_0xf0bc('0x2'));var timeout=require(_0xf0bc('0x3'));var express=require(_0xf0bc('0x4'));var router=express[_0xf0bc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf0bc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf0bc('0x7'));var controller=require(_0xf0bc('0x8'));router[_0xf0bc('0x9')]('/',auth[_0xf0bc('0xa')](),controller[_0xf0bc('0xb')]);router[_0xf0bc('0x9')](_0xf0bc('0xc'),auth[_0xf0bc('0xa')](),controller[_0xf0bc('0xd')]);router[_0xf0bc('0xe')]('/',auth[_0xf0bc('0xa')](),controller['create']);router[_0xf0bc('0xf')](_0xf0bc('0xc'),auth[_0xf0bc('0xa')](),controller['update']);router[_0xf0bc('0x10')]('/:id',auth[_0xf0bc('0xa')](),controller[_0xf0bc('0x11')]);module[_0xf0bc('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 86b7949..d82ec02 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 _0x26bc=['sequelize','exports','STRING'];(function(_0x31a172,_0x4d0544){var _0x2111ef=function(_0x53dd88){while(--_0x53dd88){_0x31a172['push'](_0x31a172['shift']());}};_0x2111ef(++_0x4d0544);}(_0x26bc,0x162));var _0xc26b=function(_0xe0a797,_0x4ee180){_0xe0a797=_0xe0a797-0x0;var _0x58be95=_0x26bc[_0xe0a797];return _0x58be95;};'use strict';var Sequelize=require(_0xc26b('0x0'));module[_0xc26b('0x1')]={'name':{'type':Sequelize[_0xc26b('0x2')]},'basename':{'type':Sequelize[_0xc26b('0x2')]},'type':{'type':Sequelize[_0xc26b('0x2')]}}; \ No newline at end of file +var _0x47d6=['STRING','sequelize','exports'];(function(_0x2c50a6,_0x2a9854){var _0x3e6556=function(_0x3ad784){while(--_0x3ad784){_0x2c50a6['push'](_0x2c50a6['shift']());}};_0x3e6556(++_0x2a9854);}(_0x47d6,0x1de));var _0x647d=function(_0x600b2f,_0x3ffd28){_0x600b2f=_0x600b2f-0x0;var _0x27cc4c=_0x47d6[_0x600b2f];return _0x27cc4c;};'use strict';var Sequelize=require(_0x647d('0x0'));module[_0x647d('0x1')]={'name':{'type':Sequelize[_0x647d('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 2d1bd74..8ea2779 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 _0xa5b3=['../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','rows','catch','show','length','find','includeAll','get','omit','createdAt','updatedAt','body','create','params','file','originalname','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x39016c,_0x1af04a){var _0x1351bb=function(_0x56e636){while(--_0x56e636){_0x39016c['push'](_0x39016c['shift']());}};_0x1351bb(++_0x1af04a);}(_0xa5b3,0x96));var _0x3a5b=function(_0x882fe7,_0x41f3db){_0x882fe7=_0x882fe7-0x0;var _0x4dfce8=_0xa5b3[_0x882fe7];return _0x4dfce8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3a5b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a5b('0x1'));var moment=require('moment');var BPromise=require(_0x3a5b('0x2'));var Mustache=require(_0x3a5b('0x3'));var util=require(_0x3a5b('0x4'));var path=require(_0x3a5b('0x5'));var sox=require(_0x3a5b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3a5b('0x7'));var _=require('lodash');var squel=require(_0x3a5b('0x8'));var crypto=require(_0x3a5b('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3a5b('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3a5b('0xb'));var Papa=require(_0x3a5b('0xc'));var Redis=require('ioredis');var authService=require(_0x3a5b('0xd'));var qs=require(_0x3a5b('0xe'));var as=require(_0x3a5b('0xf'));var hardwareService=require(_0x3a5b('0x10'));var logger=require(_0x3a5b('0x11'))(_0x3a5b('0x12'));var utils=require('../../config/utils');var config=require(_0x3a5b('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e6b82,_0x46d751){_0x46d751=_0x46d751||0xcc;return function(_0x3cafd0){if(_0x3cafd0){return _0x3e6b82[_0x3a5b('0x14')](_0x46d751);}return _0x3e6b82[_0x3a5b('0x15')](_0x46d751)[_0x3a5b('0x16')]();};}function respondWithResult(_0x474554,_0x499bdf){_0x499bdf=_0x499bdf||0xc8;return function(_0x2ce798){if(_0x2ce798){return _0x474554['status'](_0x499bdf)['json'](_0x2ce798);}};}function respondWithFilteredResult(_0x5c2208,_0x19d45b){return function(_0x3a0056){if(_0x3a0056){var _0x57b5af=typeof _0x19d45b[_0x3a5b('0x17')]===_0x3a5b('0x18')&&typeof _0x19d45b[_0x3a5b('0x19')]===_0x3a5b('0x18');var _0x57d061=_0x3a0056['count'];var _0x1c342f=_0x57b5af?0x0:_0x19d45b['offset'];var _0x2ef06c=_0x57b5af?_0x3a0056[_0x3a5b('0x1a')]:_0x19d45b[_0x3a5b('0x17')]+_0x19d45b['limit'];var _0x35f76a;if(_0x2ef06c>=_0x57d061){_0x2ef06c=_0x57d061;_0x35f76a=0xc8;}else{_0x35f76a=0xce;}_0x5c2208[_0x3a5b('0x15')](_0x35f76a);return _0x5c2208[_0x3a5b('0x1b')]('Content-Range',_0x1c342f+'-'+_0x2ef06c+'/'+_0x57d061)[_0x3a5b('0x1c')](_0x3a0056);}return null;};}function patchUpdates(_0x4c8000){return function(_0x4963d3){try{jsonpatch[_0x3a5b('0x1d')](_0x4963d3,_0x4c8000,!![]);}catch(_0x407afe){return BPromise[_0x3a5b('0x1e')](_0x407afe);}return _0x4963d3['save']();};}function saveUpdates(_0x5618da,_0x478f00){return function(_0x1668b4){if(_0x1668b4){return _0x1668b4[_0x3a5b('0x1f')](_0x5618da)[_0x3a5b('0x20')](function(_0x2a5c05){return _0x2a5c05;});}return null;};}function removeEntity(_0x4796fe,_0x59f492){return function(_0x265e62){if(_0x265e62){return _0x265e62[_0x3a5b('0x21')]()[_0x3a5b('0x20')](function(){_0x4796fe[_0x3a5b('0x15')](0xcc)[_0x3a5b('0x16')]();});}};}function handleEntityNotFound(_0x177b9d,_0x3129c3){return function(_0x5c19a7){if(!_0x5c19a7){_0x177b9d['sendStatus'](0x194);}return _0x5c19a7;};}function handleError(_0xa6439d,_0x2c5d40){_0x2c5d40=_0x2c5d40||0x1f4;return function(_0x152589){logger[_0x3a5b('0x22')](_0x152589[_0x3a5b('0x23')]);if(_0x152589[_0x3a5b('0x24')]){delete _0x152589[_0x3a5b('0x24')];}_0xa6439d[_0x3a5b('0x15')](_0x2c5d40)[_0x3a5b('0x25')](_0x152589);};}exports[_0x3a5b('0x26')]=function(_0x2f6036,_0x5d824c){var _0xaf89a8={},_0x12a765={},_0x3b5e09={'count':0x0,'rows':[]};var _0x342045=_[_0x3a5b('0x27')](db[_0x3a5b('0x28')][_0x3a5b('0x29')],function(_0x2c4af2){return{'name':_0x2c4af2[_0x3a5b('0x2a')],'type':_0x2c4af2[_0x3a5b('0x2b')][_0x3a5b('0x2c')]};});_0x12a765[_0x3a5b('0x2d')]=_[_0x3a5b('0x27')](_0x342045,'name');_0x12a765[_0x3a5b('0x2e')]=_[_0x3a5b('0x2f')](_0x2f6036['query']);_0x12a765[_0x3a5b('0x30')]=_[_0x3a5b('0x31')](_0x12a765['model'],_0x12a765[_0x3a5b('0x2e')]);_0xaf89a8[_0x3a5b('0x32')]=_['intersection'](_0x12a765[_0x3a5b('0x2d')],qs['fields'](_0x2f6036[_0x3a5b('0x2e')][_0x3a5b('0x33')]));_0xaf89a8[_0x3a5b('0x32')]=_0xaf89a8[_0x3a5b('0x32')]['length']?_0xaf89a8[_0x3a5b('0x32')]:_0x12a765[_0x3a5b('0x2d')];if(!_0x2f6036[_0x3a5b('0x2e')][_0x3a5b('0x34')](_0x3a5b('0x35'))){_0xaf89a8[_0x3a5b('0x19')]=qs[_0x3a5b('0x19')](_0x2f6036[_0x3a5b('0x2e')][_0x3a5b('0x19')]);_0xaf89a8[_0x3a5b('0x17')]=qs[_0x3a5b('0x17')](_0x2f6036[_0x3a5b('0x2e')][_0x3a5b('0x17')]);}_0xaf89a8[_0x3a5b('0x36')]=qs[_0x3a5b('0x37')](_0x2f6036['query'][_0x3a5b('0x37')]);_0xaf89a8['where']=qs['filters'](_[_0x3a5b('0x38')](_0x2f6036[_0x3a5b('0x2e')],_0x12a765[_0x3a5b('0x30')]),_0x342045);if(_0x2f6036[_0x3a5b('0x2e')][_0x3a5b('0x39')]){_0xaf89a8[_0x3a5b('0x3a')]=_[_0x3a5b('0x3b')](_0xaf89a8[_0x3a5b('0x3a')],{'$or':_[_0x3a5b('0x27')](_0x342045,function(_0x170997){if(_0x170997[_0x3a5b('0x2b')]!=='VIRTUAL'){var _0x4fb548={};_0x4fb548[_0x170997[_0x3a5b('0x24')]]={'$like':'%'+_0x2f6036[_0x3a5b('0x2e')][_0x3a5b('0x39')]+'%'};return _0x4fb548;}})});}_0xaf89a8=_[_0x3a5b('0x3b')]({},_0xaf89a8,_0x2f6036[_0x3a5b('0x3c')]);var _0x4d49b8={'where':_0xaf89a8[_0x3a5b('0x3a')]};return db[_0x3a5b('0x28')][_0x3a5b('0x1a')](_0x4d49b8)['then'](function(_0x2c6de8){_0x3b5e09['count']=_0x2c6de8;if(_0x2f6036[_0x3a5b('0x2e')]['includeAll']){_0xaf89a8[_0x3a5b('0x3d')]=[{'all':!![]}];}return db[_0x3a5b('0x28')]['findAll'](_0xaf89a8);})[_0x3a5b('0x20')](function(_0x3bba1a){_0x3b5e09[_0x3a5b('0x3e')]=_0x3bba1a;return _0x3b5e09;})[_0x3a5b('0x20')](respondWithFilteredResult(_0x5d824c,_0xaf89a8))[_0x3a5b('0x3f')](handleError(_0x5d824c,null));};exports[_0x3a5b('0x40')]=function(_0x2eb180,_0x92d0bd){var _0xb6bdbb={'raw':!![],'where':{'id':_0x2eb180['params']['id']}},_0x52c8a3={};_0x52c8a3[_0x3a5b('0x2d')]=_[_0x3a5b('0x2f')](db[_0x3a5b('0x28')][_0x3a5b('0x29')]);_0x52c8a3[_0x3a5b('0x2e')]=_[_0x3a5b('0x2f')](_0x2eb180[_0x3a5b('0x2e')]);_0x52c8a3[_0x3a5b('0x30')]=_[_0x3a5b('0x31')](_0x52c8a3[_0x3a5b('0x2d')],_0x52c8a3[_0x3a5b('0x2e')]);_0xb6bdbb[_0x3a5b('0x32')]=_[_0x3a5b('0x31')](_0x52c8a3[_0x3a5b('0x2d')],qs[_0x3a5b('0x33')](_0x2eb180['query']['fields']));_0xb6bdbb[_0x3a5b('0x32')]=_0xb6bdbb[_0x3a5b('0x32')][_0x3a5b('0x41')]?_0xb6bdbb[_0x3a5b('0x32')]:_0x52c8a3[_0x3a5b('0x2d')];if(_0x2eb180[_0x3a5b('0x2e')]['includeAll']){_0xb6bdbb[_0x3a5b('0x3d')]=[{'all':!![]}];}_0xb6bdbb=_['merge']({},_0xb6bdbb,_0x2eb180[_0x3a5b('0x3c')]);return db[_0x3a5b('0x28')][_0x3a5b('0x42')](_0xb6bdbb)['then'](handleEntityNotFound(_0x92d0bd,null))['then'](respondWithResult(_0x92d0bd,null))[_0x3a5b('0x3f')](handleError(_0x92d0bd,null));};exports['clone']=function(_0x16c11d,_0x14c214){var _0x2a9ca0={'where':{'id':_0x16c11d['params']['id']}},_0x5443b6={};_0x5443b6[_0x3a5b('0x2d')]=_[_0x3a5b('0x2f')](db['Attachment'][_0x3a5b('0x29')]);_0x2a9ca0[_0x3a5b('0x32')]=_[_0x3a5b('0x31')](_0x5443b6[_0x3a5b('0x2d')],qs[_0x3a5b('0x33')](_0x16c11d[_0x3a5b('0x2e')]['fields']));_0x2a9ca0[_0x3a5b('0x32')]=_0x2a9ca0['attributes'][_0x3a5b('0x41')]?_0x2a9ca0[_0x3a5b('0x32')]:_0x5443b6[_0x3a5b('0x2d')];if(_0x16c11d[_0x3a5b('0x2e')][_0x3a5b('0x43')]){_0x2a9ca0[_0x3a5b('0x3d')]=[{'all':!![]}];}_0x2a9ca0=_[_0x3a5b('0x3b')]({},_0x2a9ca0,_0x16c11d[_0x3a5b('0x3c')]);return db[_0x3a5b('0x28')][_0x3a5b('0x42')](_0x2a9ca0)[_0x3a5b('0x20')](handleEntityNotFound(_0x14c214,null))[_0x3a5b('0x20')](function(_0x503ec0){if(_0x503ec0){var _0x5e5b54=_0x503ec0[_0x3a5b('0x44')]({'plain':!![]});_0x5e5b54=qs[_0x3a5b('0x45')](_0x5e5b54,['id',_0x3a5b('0x46'),_0x3a5b('0x47')]);_0x16c11d[_0x3a5b('0x48')]=_[_0x3a5b('0x45')](_0x16c11d[_0x3a5b('0x48')],['id',_0x3a5b('0x46'),_0x3a5b('0x47')]);return db[_0x3a5b('0x28')][_0x3a5b('0x49')](_[_0x3a5b('0x3b')](_0x5e5b54,_0x16c11d['body']),{'include':_0x16c11d[_0x3a5b('0x2e')][_0x3a5b('0x43')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x14c214,0xc9))[_0x3a5b('0x3f')](handleError(_0x14c214,null));};exports[_0x3a5b('0x1f')]=function(_0x27552c,_0x39ed87){if(_0x27552c[_0x3a5b('0x48')]['id']){delete _0x27552c['body']['id'];}return db[_0x3a5b('0x28')]['find']({'where':{'id':_0x27552c[_0x3a5b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39ed87,null))['then'](saveUpdates(_0x27552c['body'],null))['then'](respondWithResult(_0x39ed87,null))['catch'](handleError(_0x39ed87,null));};exports[_0x3a5b('0x21')]=function(_0x59cc1f,_0x597426){return db[_0x3a5b('0x28')][_0x3a5b('0x42')]({'where':{'id':_0x59cc1f['params']['id']}})[_0x3a5b('0x20')](handleEntityNotFound(_0x597426,null))[_0x3a5b('0x20')](removeEntity(_0x597426,null))[_0x3a5b('0x3f')](handleError(_0x597426,null));};exports[_0x3a5b('0x49')]=function(_0xe5b0d4,_0x5e2df7,_0x14f3e7){_0xe5b0d4['body']['name']=_0xe5b0d4[_0x3a5b('0x4b')][_0x3a5b('0x4c')];_0xe5b0d4[_0x3a5b('0x48')]['basename']=_0xe5b0d4[_0x3a5b('0x4b')]['filename'];_0xe5b0d4['body'][_0x3a5b('0x2b')]=_0xe5b0d4[_0x3a5b('0x4b')]['mimetype'];return db['Attachment'][_0x3a5b('0x49')](_0xe5b0d4[_0x3a5b('0x48')])['then'](respondWithResult(_0x5e2df7,0xc9))[_0x3a5b('0x3f')](handleError(_0x5e2df7,null));};exports['download']=function(_0x251a89,_0x38e341,_0x497c90){return db[_0x3a5b('0x28')]['findOne']({'where':{'id':_0x251a89[_0x3a5b('0x4a')]['id']},'raw':!![]})[_0x3a5b('0x20')](handleEntityNotFound(_0x38e341,null))[_0x3a5b('0x20')](function(_0x266d41){if(_0x266d41){var _0x55f7ec=_0x266d41[_0x3a5b('0x4d')]!==null;var _0x4090d8=path['join'](config[_0x3a5b('0x4e')],_0x3a5b('0x4f'));if(_0x55f7ec){_0x4090d8=path[_0x3a5b('0x50')](_0x4090d8,_0x3a5b('0x51'));}var _0x583e34=path['join'](_0x4090d8,_0x266d41[_0x3a5b('0x52')]);return _0x38e341['download'](_0x583e34);}})[_0x3a5b('0x3f')](handleError(_0x38e341,null));}; \ No newline at end of file +var _0x093f=['merge','options','Attachment','includeAll','findAll','rows','catch','params','rawAttributes','include','clone','find','omit','createdAt','updatedAt','body','originalname','basename','file','filename','create','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','type'];(function(_0x2a5429,_0x1f8326){var _0x264d1a=function(_0x492742){while(--_0x492742){_0x2a5429['push'](_0x2a5429['shift']());}};_0x264d1a(++_0x1f8326);}(_0x093f,0x79));var _0xf093=function(_0x55be78,_0x1d590c){_0x55be78=_0x55be78-0x0;var _0x32d80a=_0x093f[_0x55be78];return _0x32d80a;};'use strict';var emlformat=require(_0xf093('0x0'));var rimraf=require(_0xf093('0x1'));var zipdir=require(_0xf093('0x2'));var jsonpatch=require(_0xf093('0x3'));var rp=require(_0xf093('0x4'));var moment=require('moment');var BPromise=require(_0xf093('0x5'));var Mustache=require(_0xf093('0x6'));var util=require('util');var path=require(_0xf093('0x7'));var sox=require(_0xf093('0x8'));var csv=require(_0xf093('0x9'));var ejs=require(_0xf093('0xa'));var fs=require('fs');var fs_extra=require(_0xf093('0xb'));var _=require(_0xf093('0xc'));var squel=require(_0xf093('0xd'));var crypto=require(_0xf093('0xe'));var jsforce=require(_0xf093('0xf'));var deskjs=require(_0xf093('0x10'));var toCsv=require(_0xf093('0x9'));var querystring=require(_0xf093('0x11'));var Papa=require('papaparse');var Redis=require(_0xf093('0x12'));var authService=require(_0xf093('0x13'));var qs=require(_0xf093('0x14'));var as=require(_0xf093('0x15'));var hardwareService=require(_0xf093('0x16'));var logger=require('../../config/logger')(_0xf093('0x17'));var utils=require(_0xf093('0x18'));var config=require(_0xf093('0x19'));var licenseUtil=require(_0xf093('0x1a'));var db=require(_0xf093('0x1b'))['db'];function respondWithStatusCode(_0x3f29f5,_0x27f0af){_0x27f0af=_0x27f0af||0xcc;return function(_0xeb26ef){if(_0xeb26ef){return _0x3f29f5['sendStatus'](_0x27f0af);}return _0x3f29f5[_0xf093('0x1c')](_0x27f0af)[_0xf093('0x1d')]();};}function respondWithResult(_0x55c2d2,_0x12d73e){_0x12d73e=_0x12d73e||0xc8;return function(_0x39b22e){if(_0x39b22e){return _0x55c2d2['status'](_0x12d73e)[_0xf093('0x1e')](_0x39b22e);}};}function respondWithFilteredResult(_0x264e2b,_0x33969a){return function(_0x234a1d){if(_0x234a1d){var _0x1f9021=typeof _0x33969a[_0xf093('0x1f')]===_0xf093('0x20')&&typeof _0x33969a[_0xf093('0x21')]==='undefined';var _0x50b17f=_0x234a1d[_0xf093('0x22')];var _0x2b2d3b=_0x1f9021?0x0:_0x33969a[_0xf093('0x1f')];var _0x548dbb=_0x1f9021?_0x234a1d['count']:_0x33969a[_0xf093('0x1f')]+_0x33969a[_0xf093('0x21')];var _0x1cc27a;if(_0x548dbb>=_0x50b17f){_0x548dbb=_0x50b17f;_0x1cc27a=0xc8;}else{_0x1cc27a=0xce;}_0x264e2b[_0xf093('0x1c')](_0x1cc27a);return _0x264e2b[_0xf093('0x23')]('Content-Range',_0x2b2d3b+'-'+_0x548dbb+'/'+_0x50b17f)[_0xf093('0x1e')](_0x234a1d);}return null;};}function patchUpdates(_0x815218){return function(_0x35162c){try{jsonpatch[_0xf093('0x24')](_0x35162c,_0x815218,!![]);}catch(_0x1865c9){return BPromise[_0xf093('0x25')](_0x1865c9);}return _0x35162c[_0xf093('0x26')]();};}function saveUpdates(_0x4ab310,_0x3db74b){return function(_0x18cd71){if(_0x18cd71){return _0x18cd71[_0xf093('0x27')](_0x4ab310)[_0xf093('0x28')](function(_0x3f3835){return _0x3f3835;});}return null;};}function removeEntity(_0x7aae8e,_0x4cb76a){return function(_0xff2d82){if(_0xff2d82){return _0xff2d82[_0xf093('0x29')]()['then'](function(){_0x7aae8e[_0xf093('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ca990,_0x26c97b){return function(_0x1d4d40){if(!_0x1d4d40){_0x4ca990[_0xf093('0x2a')](0x194);}return _0x1d4d40;};}function handleError(_0x26e42,_0x254fbd){_0x254fbd=_0x254fbd||0x1f4;return function(_0x37cb4c){logger[_0xf093('0x2b')](_0x37cb4c[_0xf093('0x2c')]);if(_0x37cb4c[_0xf093('0x2d')]){delete _0x37cb4c[_0xf093('0x2d')];}_0x26e42[_0xf093('0x1c')](_0x254fbd)['send'](_0x37cb4c);};}exports[_0xf093('0x2e')]=function(_0x5df7f4,_0x5a794d){var _0x5a2863={},_0x484b4c={},_0x217142={'count':0x0,'rows':[]};var _0x3e87ad=_[_0xf093('0x2f')](db['Attachment']['rawAttributes'],function(_0x338eef){return{'name':_0x338eef[_0xf093('0x30')],'type':_0x338eef['type'][_0xf093('0x31')]};});_0x484b4c[_0xf093('0x32')]=_[_0xf093('0x2f')](_0x3e87ad,_0xf093('0x2d'));_0x484b4c[_0xf093('0x33')]=_[_0xf093('0x34')](_0x5df7f4[_0xf093('0x33')]);_0x484b4c['filters']=_['intersection'](_0x484b4c[_0xf093('0x32')],_0x484b4c['query']);_0x5a2863[_0xf093('0x35')]=_[_0xf093('0x36')](_0x484b4c[_0xf093('0x32')],qs[_0xf093('0x37')](_0x5df7f4[_0xf093('0x33')][_0xf093('0x37')]));_0x5a2863[_0xf093('0x35')]=_0x5a2863[_0xf093('0x35')][_0xf093('0x38')]?_0x5a2863[_0xf093('0x35')]:_0x484b4c[_0xf093('0x32')];if(!_0x5df7f4['query'][_0xf093('0x39')](_0xf093('0x3a'))){_0x5a2863[_0xf093('0x21')]=qs[_0xf093('0x21')](_0x5df7f4['query'][_0xf093('0x21')]);_0x5a2863[_0xf093('0x1f')]=qs[_0xf093('0x1f')](_0x5df7f4[_0xf093('0x33')][_0xf093('0x1f')]);}_0x5a2863[_0xf093('0x3b')]=qs[_0xf093('0x3c')](_0x5df7f4['query'][_0xf093('0x3c')]);_0x5a2863['where']=qs['filters'](_['pick'](_0x5df7f4[_0xf093('0x33')],_0x484b4c[_0xf093('0x3d')]),_0x3e87ad);if(_0x5df7f4['query'][_0xf093('0x3e')]){_0x5a2863[_0xf093('0x3f')]=_['merge'](_0x5a2863[_0xf093('0x3f')],{'$or':_[_0xf093('0x2f')](_0x3e87ad,function(_0x32ff00){if(_0x32ff00[_0xf093('0x40')]!=='VIRTUAL'){var _0x140bbc={};_0x140bbc[_0x32ff00['name']]={'$like':'%'+_0x5df7f4[_0xf093('0x33')][_0xf093('0x3e')]+'%'};return _0x140bbc;}})});}_0x5a2863=_[_0xf093('0x41')]({},_0x5a2863,_0x5df7f4[_0xf093('0x42')]);var _0x13d120={'where':_0x5a2863['where']};return db[_0xf093('0x43')][_0xf093('0x22')](_0x13d120)[_0xf093('0x28')](function(_0x2fb4ea){_0x217142['count']=_0x2fb4ea;if(_0x5df7f4[_0xf093('0x33')][_0xf093('0x44')]){_0x5a2863['include']=[{'all':!![]}];}return db[_0xf093('0x43')][_0xf093('0x45')](_0x5a2863);})[_0xf093('0x28')](function(_0x2754e1){_0x217142[_0xf093('0x46')]=_0x2754e1;return _0x217142;})[_0xf093('0x28')](respondWithFilteredResult(_0x5a794d,_0x5a2863))[_0xf093('0x47')](handleError(_0x5a794d,null));};exports['show']=function(_0x16622c,_0x52f522){var _0x5dc820={'raw':!![],'where':{'id':_0x16622c[_0xf093('0x48')]['id']}},_0xf24fd8={};_0xf24fd8[_0xf093('0x32')]=_[_0xf093('0x34')](db['Attachment'][_0xf093('0x49')]);_0xf24fd8[_0xf093('0x33')]=_[_0xf093('0x34')](_0x16622c[_0xf093('0x33')]);_0xf24fd8[_0xf093('0x3d')]=_[_0xf093('0x36')](_0xf24fd8[_0xf093('0x32')],_0xf24fd8[_0xf093('0x33')]);_0x5dc820[_0xf093('0x35')]=_[_0xf093('0x36')](_0xf24fd8[_0xf093('0x32')],qs[_0xf093('0x37')](_0x16622c[_0xf093('0x33')][_0xf093('0x37')]));_0x5dc820[_0xf093('0x35')]=_0x5dc820[_0xf093('0x35')][_0xf093('0x38')]?_0x5dc820[_0xf093('0x35')]:_0xf24fd8[_0xf093('0x32')];if(_0x16622c[_0xf093('0x33')][_0xf093('0x44')]){_0x5dc820[_0xf093('0x4a')]=[{'all':!![]}];}_0x5dc820=_[_0xf093('0x41')]({},_0x5dc820,_0x16622c[_0xf093('0x42')]);return db['Attachment']['find'](_0x5dc820)[_0xf093('0x28')](handleEntityNotFound(_0x52f522,null))[_0xf093('0x28')](respondWithResult(_0x52f522,null))[_0xf093('0x47')](handleError(_0x52f522,null));};exports[_0xf093('0x4b')]=function(_0x32176a,_0x3c328f){var _0x33f366={'where':{'id':_0x32176a[_0xf093('0x48')]['id']}},_0x31668f={};_0x31668f[_0xf093('0x32')]=_['keys'](db[_0xf093('0x43')]['rawAttributes']);_0x33f366['attributes']=_[_0xf093('0x36')](_0x31668f[_0xf093('0x32')],qs[_0xf093('0x37')](_0x32176a[_0xf093('0x33')][_0xf093('0x37')]));_0x33f366[_0xf093('0x35')]=_0x33f366[_0xf093('0x35')][_0xf093('0x38')]?_0x33f366['attributes']:_0x31668f[_0xf093('0x32')];if(_0x32176a[_0xf093('0x33')][_0xf093('0x44')]){_0x33f366[_0xf093('0x4a')]=[{'all':!![]}];}_0x33f366=_[_0xf093('0x41')]({},_0x33f366,_0x32176a[_0xf093('0x42')]);return db[_0xf093('0x43')][_0xf093('0x4c')](_0x33f366)[_0xf093('0x28')](handleEntityNotFound(_0x3c328f,null))[_0xf093('0x28')](function(_0x156a75){if(_0x156a75){var _0x5053a1=_0x156a75['get']({'plain':!![]});_0x5053a1=qs[_0xf093('0x4d')](_0x5053a1,['id',_0xf093('0x4e'),_0xf093('0x4f')]);_0x32176a['body']=_['omit'](_0x32176a[_0xf093('0x50')],['id',_0xf093('0x4e'),_0xf093('0x4f')]);return db[_0xf093('0x43')]['create'](_[_0xf093('0x41')](_0x5053a1,_0x32176a[_0xf093('0x50')]),{'include':_0x32176a['query'][_0xf093('0x44')]?[{'all':!![]}]:undefined});}})[_0xf093('0x28')](respondWithResult(_0x3c328f,0xc9))['catch'](handleError(_0x3c328f,null));};exports[_0xf093('0x27')]=function(_0x3047a3,_0x1ec30f){if(_0x3047a3[_0xf093('0x50')]['id']){delete _0x3047a3[_0xf093('0x50')]['id'];}return db[_0xf093('0x43')][_0xf093('0x4c')]({'where':{'id':_0x3047a3[_0xf093('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ec30f,null))[_0xf093('0x28')](saveUpdates(_0x3047a3[_0xf093('0x50')],null))[_0xf093('0x28')](respondWithResult(_0x1ec30f,null))['catch'](handleError(_0x1ec30f,null));};exports[_0xf093('0x29')]=function(_0x396869,_0x328079){return db['Attachment']['find']({'where':{'id':_0x396869[_0xf093('0x48')]['id']}})['then'](handleEntityNotFound(_0x328079,null))['then'](removeEntity(_0x328079,null))[_0xf093('0x47')](handleError(_0x328079,null));};exports['create']=function(_0x17f515,_0x7b4494,_0x4b9a7e){_0x17f515[_0xf093('0x50')]['name']=_0x17f515['file'][_0xf093('0x51')];_0x17f515['body'][_0xf093('0x52')]=_0x17f515[_0xf093('0x53')][_0xf093('0x54')];_0x17f515[_0xf093('0x50')]['type']=_0x17f515[_0xf093('0x53')]['mimetype'];return db[_0xf093('0x43')][_0xf093('0x55')](_0x17f515[_0xf093('0x50')])['then'](respondWithResult(_0x7b4494,0xc9))[_0xf093('0x47')](handleError(_0x7b4494,null));};exports['download']=function(_0x1f193b,_0x52e819,_0x57e76a){return db[_0xf093('0x43')][_0xf093('0x56')]({'where':{'id':_0x1f193b['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x52e819,null))[_0xf093('0x28')](function(_0x3a0fea){if(_0x3a0fea){var _0x13c9a3=_0x3a0fea[_0xf093('0x57')]!==null;var _0x4c9e78=path['join'](config[_0xf093('0x58')],_0xf093('0x59'));if(_0x13c9a3){_0x4c9e78=path[_0xf093('0x5a')](_0x4c9e78,_0xf093('0x5b'));}var _0x1c6431=path[_0xf093('0x5a')](_0x4c9e78,_0x3a0fea['basename']);return _0x52e819[_0xf093('0x5c')](_0x1c6431);}})['catch'](handleError(_0x52e819,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index f2b1723..e1764bc 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 _0x35fd=['attachments','lodash','../../config/logger','api','request-promise','path','rimraf','exports','define','Attachment'];(function(_0x450b74,_0x2a4c0e){var _0x326b96=function(_0x56d767){while(--_0x56d767){_0x450b74['push'](_0x450b74['shift']());}};_0x326b96(++_0x2a4c0e);}(_0x35fd,0x15f));var _0xd35f=function(_0x224c4a,_0x37e8dd){_0x224c4a=_0x224c4a-0x0;var _0x36abc3=_0x35fd[_0x224c4a];return _0x36abc3;};'use strict';var _=require(_0xd35f('0x0'));var util=require('util');var logger=require(_0xd35f('0x1'))(_0xd35f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd35f('0x3'));var fs=require('fs');var path=require(_0xd35f('0x4'));var rimraf=require(_0xd35f('0x5'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0xd35f('0x6')]=function(_0x91d3fe,_0xa1a3b5){return _0x91d3fe[_0xd35f('0x7')](_0xd35f('0x8'),attributes,{'tableName':_0xd35f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a15=['bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','moment'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x6a15,0x1dd));var _0x56a1=function(_0x242039,_0x4b3486){_0x242039=_0x242039-0x0;var _0x3d9bba=_0x6a15[_0x242039];return _0x3d9bba;};'use strict';var _=require(_0x56a1('0x0'));var util=require(_0x56a1('0x1'));var logger=require(_0x56a1('0x2'))('api');var moment=require(_0x56a1('0x3'));var BPromise=require(_0x56a1('0x4'));var rp=require(_0x56a1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x56a1('0x6'));var config=require(_0x56a1('0x7'));var attributes=require(_0x56a1('0x8'));module[_0x56a1('0x9')]=function(_0x2a20ac,_0x5ba900){return _0x2a20ac[_0x56a1('0xa')](_0x56a1('0xb'),attributes,{'tableName':_0x56a1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 58881b2..c720a6e 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 _0x5ff3=['http','request','then','info','request\x20sent','debug','stringify','error','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','raw','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ff3,0x17d));var _0x35ff=function(_0xf479f9,_0x1e46b9){_0xf479f9=_0xf479f9-0x0;var _0x2aecc6=_0x5ff3[_0xf479f9];return _0x2aecc6;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var moment=require('moment');var BPromise=require(_0x35ff('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ff('0x2'));var db=require(_0x35ff('0x3'))['db'];var utils=require(_0x35ff('0x4'));var logger=require(_0x35ff('0x5'))('rpc');var config=require(_0x35ff('0x6'));var jayson=require(_0x35ff('0x7'));var client=jayson[_0x35ff('0x8')][_0x35ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30c3ff,_0x495c31,_0x92b403){return new BPromise(function(_0x4c9fab,_0x2e7470){return client[_0x35ff('0xa')](_0x30c3ff,_0x92b403)[_0x35ff('0xb')](function(_0x51967a){logger[_0x35ff('0xc')]('Attachment,\x20%s,\x20%s',_0x495c31,_0x35ff('0xd'));logger[_0x35ff('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x495c31,'request\x20sent',JSON[_0x35ff('0xf')](_0x51967a));if(_0x51967a['error']){if(_0x51967a['error']['code']===0x1f4){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);return _0x2e7470(_0x51967a['error'][_0x35ff('0x12')]);}logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a['error'][_0x35ff('0x12')]);return _0x4c9fab(_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);}else{logger[_0x35ff('0xc')](_0x35ff('0x11'),_0x495c31,_0x35ff('0xd'));_0x4c9fab(_0x51967a[_0x35ff('0x13')][_0x35ff('0x12')]);}})[_0x35ff('0x14')](function(_0x2f3456){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x2f3456);_0x2e7470(_0x2f3456);});});}exports[_0x35ff('0x15')]=function(_0x16c803){var _0x186f6a=this;return new Promise(function(_0x5f470e,_0x2404e5){return db[_0x35ff('0x16')][_0x35ff('0x17')](_0x16c803[_0x35ff('0x18')],{'raw':_0x16c803['options']?_0x16c803['options'][_0x35ff('0x19')]===undefined?!![]:![]:!![]})[_0x35ff('0xb')](function(_0x4c8dd4){logger[_0x35ff('0xc')](_0x35ff('0x15'),_0x16c803);logger[_0x35ff('0xe')](_0x35ff('0x15'),_0x16c803,JSON['stringify'](_0x4c8dd4));_0x5f470e(_0x4c8dd4);})[_0x35ff('0x14')](function(_0x55274b){logger[_0x35ff('0x10')](_0x35ff('0x15'),_0x55274b[_0x35ff('0x12')],_0x16c803);_0x2404e5(_0x186f6a[_0x35ff('0x10')](0x1f4,_0x55274b[_0x35ff('0x12')]));});});}; \ No newline at end of file +var _0xc2cc=['raw','CreateAttachment','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Attachment','create','body','options'];(function(_0x21ae54,_0x41689a){var _0x3cc49=function(_0x1d74fc){while(--_0x1d74fc){_0x21ae54['push'](_0x21ae54['shift']());}};_0x3cc49(++_0x41689a);}(_0xc2cc,0x70));var _0xcc2c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc2cc[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xcc2c('0x0'));var moment=require(_0xcc2c('0x1'));var BPromise=require(_0xcc2c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc2c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc2c('0x4'));var logger=require('../../config/logger')(_0xcc2c('0x5'));var config=require('../../config/environment');var jayson=require(_0xcc2c('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x475a85,_0x4ab837,_0x144b90){return new BPromise(function(_0x5a276f,_0x1d311f){return client['request'](_0x475a85,_0x144b90)['then'](function(_0x2bde97){logger[_0xcc2c('0x7')](_0xcc2c('0x8'),_0x4ab837,_0xcc2c('0x9'));logger[_0xcc2c('0xa')](_0xcc2c('0xb'),_0x4ab837,_0xcc2c('0x9'),JSON[_0xcc2c('0xc')](_0x2bde97));if(_0x2bde97['error']){if(_0x2bde97[_0xcc2c('0xd')]['code']===0x1f4){logger[_0xcc2c('0xd')](_0xcc2c('0x8'),_0x4ab837,_0x2bde97[_0xcc2c('0xd')][_0xcc2c('0xe')]);return _0x1d311f(_0x2bde97['error']['message']);}logger['error'](_0xcc2c('0x8'),_0x4ab837,_0x2bde97[_0xcc2c('0xd')]['message']);return _0x5a276f(_0x2bde97['error'][_0xcc2c('0xe')]);}else{logger['info'](_0xcc2c('0x8'),_0x4ab837,_0xcc2c('0x9'));_0x5a276f(_0x2bde97[_0xcc2c('0xf')][_0xcc2c('0xe')]);}})['catch'](function(_0x5d6189){logger[_0xcc2c('0xd')](_0xcc2c('0x8'),_0x4ab837,_0x5d6189);_0x1d311f(_0x5d6189);});});}exports['CreateAttachment']=function(_0x31849a){var _0x285deb=this;return new Promise(function(_0x440458,_0x2a9f02){return db[_0xcc2c('0x10')][_0xcc2c('0x11')](_0x31849a[_0xcc2c('0x12')],{'raw':_0x31849a['options']?_0x31849a[_0xcc2c('0x13')][_0xcc2c('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x4d22fe){logger['info'](_0xcc2c('0x15'),_0x31849a);logger['debug'](_0xcc2c('0x15'),_0x31849a,JSON[_0xcc2c('0xc')](_0x4d22fe));_0x440458(_0x4d22fe);})['catch'](function(_0x321279){logger[_0xcc2c('0xd')]('CreateAttachment',_0x321279[_0xcc2c('0xe')],_0x31849a);_0x2a9f02(_0x285deb['error'](0x1f4,_0x321279[_0xcc2c('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 7eca057..15462ba 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x3ab914,_0x3f9083){var _0x3cb49b=function(_0x492f17){while(--_0x492f17){_0x3ab914['push'](_0x3ab914['shift']());}};_0x3cb49b(++_0x3f9083);}(_0x5f2f,0x73));var _0xf5f2=function(_0xd38d53,_0x17d20e){_0xd38d53=_0xd38d53-0x0;var _0x2ceeda=_0x5f2f[_0xd38d53];return _0x2ceeda;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0x0b0e[_0x500c0];return _0xdd146f;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 6527e23..df4a8f7 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 _0xf56e=['inspect','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','agent','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','send','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','User','passport-local','Strategy','util','../../components/auth/service','../../config/utils','../../config/logger','api','undefined','activedirectory','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xf56e,0x152));var _0xef56=function(_0x4fcd7f,_0x7d9f0b){_0x4fcd7f=_0x4fcd7f-0x0;var _0x5958c3=_0xf56e[_0x4fcd7f];return _0x5958c3;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xef56('0x0'))[_0xef56('0x1')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0xef56('0x2'));var db=require('../../mysqldb')['db'];var authService=require(_0xef56('0x3'));var utils=require(_0xef56('0x4'));var config=require('../../config/environment');var logger=require(_0xef56('0x5'))(_0xef56('0x6'));function isActiveDirectoryConfigured(_0x3f2e7a){var _0x4307b0=![];if(typeof _0x3f2e7a['activedirectory']!==_0xef56('0x7')){_0x4307b0=_0x3f2e7a[_0xef56('0x8')][_0xef56('0x9')]&&_0x3f2e7a[_0xef56('0x8')][_0xef56('0xa')]&&_0x3f2e7a[_0xef56('0x8')][_0xef56('0xb')];}return _0x4307b0;}function adAuthenticate(_0x3e2a15,_0x2a3181,_0x3cb7f5){return new BPromise(function(_0x5bb480,_0x1270c5){try{var _0x2746da=new ActiveDirectory(_0x3e2a15);_0x2746da[_0xef56('0xc')](_0x2a3181,_0x3cb7f5,function(_0x4d7534,_0x57add5){if(_0x4d7534){logger['error'](_0xef56('0xd'),_0x2a3181,util[_0xef56('0xe')](_0x4d7534,{'showHidden':![],'depth':null}));_0x1270c5('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x57add5){logger[_0xef56('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x2a3181);_0x1270c5('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5bb480(_0x57add5);}});}catch(_0x5413d3){_0x1270c5(_0x5413d3);}});}function ActiveDirectoryAuthenticate(_0x118ed8,_0x1a4aca,_0x3e464d,_0xb15f49){var _0x3efc90,_0x43465f;if(!isActiveDirectoryConfigured(config)){logger[_0xef56('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x1a4aca);return _0xb15f49(null,![],{'message':_0xef56('0x10')});}return db[_0xef56('0x11')][_0xef56('0x12')]({'where':{'id':0x1},'attributes':[_0xef56('0x13'),_0xef56('0x14')],'raw':!![]})[_0xef56('0x15')](function(_0x2f42d9){_0x3efc90=_0x2f42d9;if(!_0x3efc90[_0xef56('0x13')]){logger[_0xef56('0xf')](_0xef56('0x16'),_0x1a4aca);throw new Error(_0xef56('0x10'));}return _0x118ed8['findOne']({'logging':!![],'attributes':['id',_0xef56('0x17'),_0xef56('0x18'),_0xef56('0x19'),_0xef56('0x1a'),_0xef56('0x1b'),_0xef56('0x1c'),'blockedAt','online'],'where':{'name':_0x1a4aca,'role':{'$or':['admin','user',_0xef56('0x1d')]},'adSsoEnabled':!![]}});})[_0xef56('0x15')](function(_0x2535fd){if(!_0x2535fd||_0x2535fd&&_0x2535fd[_0xef56('0x17')]!==_0x1a4aca){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x43465f=_0x2535fd;var _0x3f686f=_0x43465f['name']+'@'+config[_0xef56('0x8')][_0xef56('0xb')];return adAuthenticate(config[_0xef56('0x8')],_0x3f686f,_0x3e464d);})[_0xef56('0x15')](function(_0x41c9dc){if(_0x43465f[_0xef56('0x1b')]){throw new Error(_0xef56('0x10'));}if(_0x3efc90[_0xef56('0x14')]>0x0){if(_0x43465f['blocked']){if(moment(_0x43465f[_0xef56('0x1e')])[_0xef56('0x1f')](_0x3efc90[_0xef56('0x14')],_0xef56('0x20'))>moment()){throw new Error(_0xef56('0x10'));}return utils[_0xef56('0x21')](_0x43465f,0x0,![],null)['then'](function(){return utils[_0xef56('0x22')](_0x43465f);})[_0xef56('0x15')](function(){return _0xb15f49(null,_0x43465f);});}else{return utils['getLicense'](_0x43465f)[_0xef56('0x15')](function(){return _0xb15f49(null,_0x43465f);});}}else{return utils['getLicense'](_0x43465f)[_0xef56('0x15')](function(){return _0xb15f49(null,_0x43465f);});}})[_0xef56('0x23')](function(_0x379ed8){return _0xb15f49(null,![],_0x379ed8);});}function handleError(_0x5474b5,_0xc23118,_0x336f32){return _0x5474b5[_0xef56('0x24')](_0xc23118||0x1f4)[_0xef56('0x25')]({'message':_0x336f32?_0x336f32['message']||_0x336f32:''});}exports['login']=function(_0x4e3609,_0x11237f,_0xfe8681){passport[_0xef56('0xc')]('ad-login',function(_0x17caa8,_0x3c8e55,_0x123871){var _0x26d5d8=_0x17caa8||_0x123871;if(_0x26d5d8){return handleError(_0x11237f,0x191,_0x26d5d8);}if(!_0x3c8e55){return handleError(_0x11237f,0x194,{'message':_0xef56('0x26')});}else{var _0x15900d={'payload':{'id':_0x3c8e55['id'],'role':_0x3c8e55[_0xef56('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0xef56('0x27')](_0x15900d)[_0xef56('0x15')](function(_0x841b66){_0x11237f[_0xef56('0x28')]({'id':_0x3c8e55['id'],'token':_0x841b66,'statusCall':'','isAlreadyLogged':_0x3c8e55[_0xef56('0x29')]});});}})(_0x4e3609,_0x11237f,_0xfe8681);};passport[_0xef56('0x2a')]('ad-login',new LocalStrategy({'usernameField':_0xef56('0x17'),'passwordField':'password'},function(_0x3faed5,_0x48d570,_0x1c346a){return ActiveDirectoryAuthenticate(db[_0xef56('0x2b')],_0x3faed5,_0x48d570,_0x1c346a);})); \ No newline at end of file +var _0x2dc3=['Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','User','passport','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','baseDN','activedirectory','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','blocked','admin','user','agent','add','minutes','getLicense','status','message','login','ad-login'];(function(_0x180dd5,_0x50824e){var _0x3b80b7=function(_0x5cb3a4){while(--_0x5cb3a4){_0x180dd5['push'](_0x180dd5['shift']());}};_0x3b80b7(++_0x50824e);}(_0x2dc3,0x16e));var _0x32dc=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2dc3[_0x3947c9];return _0x2e7871;};'use strict';var passport=require(_0x32dc('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0x32dc('0x1'));var BPromise=require('bluebird');var util=require(_0x32dc('0x2'));var db=require(_0x32dc('0x3'))['db'];var authService=require(_0x32dc('0x4'));var utils=require(_0x32dc('0x5'));var config=require(_0x32dc('0x6'));var logger=require(_0x32dc('0x7'))(_0x32dc('0x8'));function isActiveDirectoryConfigured(_0x513b23){var _0x3c20d1=![];if(typeof _0x513b23['activedirectory']!=='undefined'){_0x3c20d1=_0x513b23['activedirectory'][_0x32dc('0x9')]&&_0x513b23[_0x32dc('0xa')][_0x32dc('0xb')]&&_0x513b23['activedirectory'][_0x32dc('0xc')];}return _0x3c20d1;}function adAuthenticate(_0x16a61d,_0x1680fb,_0x310c9c){return new BPromise(function(_0x5eb136,_0x575a14){try{var _0x3c2d47=new ActiveDirectory(_0x16a61d);_0x3c2d47[_0x32dc('0xd')](_0x1680fb,_0x310c9c,function(_0x416515,_0xa9a3f3){if(_0x416515){logger[_0x32dc('0xe')](_0x32dc('0xf'),_0x1680fb,util[_0x32dc('0x10')](_0x416515,{'showHidden':![],'depth':null}));_0x575a14(_0x32dc('0x11'));}else if(!_0xa9a3f3){logger[_0x32dc('0xe')](_0x32dc('0x12'),_0x1680fb);_0x575a14('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5eb136(_0xa9a3f3);}});}catch(_0x4336fa){_0x575a14(_0x4336fa);}});}function ActiveDirectoryAuthenticate(_0x4016a7,_0x38f4d2,_0x37c2e4,_0x3959e3){var _0x5c43ac,_0x4f4837;if(!isActiveDirectoryConfigured(config)){logger[_0x32dc('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x38f4d2);return _0x3959e3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x32dc('0x13')][_0x32dc('0x14')]({'where':{'id':0x1},'attributes':[_0x32dc('0x15'),_0x32dc('0x16')],'raw':!![]})[_0x32dc('0x17')](function(_0x3176e0){_0x5c43ac=_0x3176e0;if(!_0x5c43ac[_0x32dc('0x15')]){logger['error'](_0x32dc('0x18'),_0x38f4d2);throw new Error(_0x32dc('0x11'));}return _0x4016a7[_0x32dc('0x14')]({'logging':!![],'attributes':['id',_0x32dc('0x19'),_0x32dc('0x1a'),'salt',_0x32dc('0x1b'),'disabled',_0x32dc('0x1c'),'blockedAt','online'],'where':{'name':_0x38f4d2,'role':{'$or':[_0x32dc('0x1d'),_0x32dc('0x1e'),_0x32dc('0x1f')]},'adSsoEnabled':!![]}});})[_0x32dc('0x17')](function(_0xeaa5e4){if(!_0xeaa5e4||_0xeaa5e4&&_0xeaa5e4[_0x32dc('0x19')]!==_0x38f4d2){throw new Error(_0x32dc('0x11'));}_0x4f4837=_0xeaa5e4;var _0x25a1a=_0x4f4837[_0x32dc('0x19')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0x32dc('0xa')],_0x25a1a,_0x37c2e4);})[_0x32dc('0x17')](function(_0x18d2b5){if(_0x4f4837['disabled']){throw new Error(_0x32dc('0x11'));}if(_0x5c43ac[_0x32dc('0x16')]>0x0){if(_0x4f4837[_0x32dc('0x1c')]){if(moment(_0x4f4837['blockedAt'])[_0x32dc('0x20')](_0x5c43ac[_0x32dc('0x16')],_0x32dc('0x21'))>moment()){throw new Error(_0x32dc('0x11'));}return utils['clearBlockUser'](_0x4f4837,0x0,![],null)[_0x32dc('0x17')](function(){return utils['getLicense'](_0x4f4837);})[_0x32dc('0x17')](function(){return _0x3959e3(null,_0x4f4837);});}else{return utils[_0x32dc('0x22')](_0x4f4837)[_0x32dc('0x17')](function(){return _0x3959e3(null,_0x4f4837);});}}else{return utils[_0x32dc('0x22')](_0x4f4837)[_0x32dc('0x17')](function(){return _0x3959e3(null,_0x4f4837);});}})['catch'](function(_0x4b9ce5){return _0x3959e3(null,![],_0x4b9ce5);});}function handleError(_0x494ed5,_0x28df12,_0x4cbf88){return _0x494ed5[_0x32dc('0x23')](_0x28df12||0x1f4)['send']({'message':_0x4cbf88?_0x4cbf88[_0x32dc('0x24')]||_0x4cbf88:''});}exports[_0x32dc('0x25')]=function(_0x4d2d9e,_0x109760,_0x2c48e9){passport['authenticate'](_0x32dc('0x26'),function(_0x5108f5,_0x441f81,_0x2b178d){var _0x25dbe9=_0x5108f5||_0x2b178d;if(_0x25dbe9){return handleError(_0x109760,0x191,_0x25dbe9);}if(!_0x441f81){return handleError(_0x109760,0x194,{'message':_0x32dc('0x27')});}else{var _0x5325f7={'payload':{'id':_0x441f81['id'],'role':_0x441f81[_0x32dc('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x32dc('0x28')](_0x5325f7)[_0x32dc('0x17')](function(_0x1f369c){_0x109760[_0x32dc('0x29')]({'id':_0x441f81['id'],'token':_0x1f369c,'statusCall':'','isAlreadyLogged':_0x441f81[_0x32dc('0x2a')]});});}})(_0x4d2d9e,_0x109760,_0x2c48e9);};passport[_0x32dc('0x2b')](_0x32dc('0x26'),new LocalStrategy({'usernameField':_0x32dc('0x19'),'passwordField':'password'},function(_0x4f1a57,_0x32c59e,_0x8bfa9b){return ActiveDirectoryAuthenticate(db[_0x32dc('0x2c')],_0x4f1a57,_0x32c59e,_0x8bfa9b);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 55156a3..803e69a 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 _0xfbaa=['express','./authActiveDirectory.controller','post','login','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xfbaa,0xc3));var _0xafba=function(_0x420d8d,_0x78b67f){_0x420d8d=_0x420d8d-0x0;var _0x4865d7=_0xfbaa[_0x420d8d];return _0x4865d7;};'use strict';var express=require(_0xafba('0x0'));var router=express['Router']();var controller=require(_0xafba('0x1'));router[_0xafba('0x2')]('/',controller[_0xafba('0x3')]);module[_0xafba('0x4')]=router; \ No newline at end of file +var _0x3ea1=['Router','post','exports','express'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3ea1,0xd7));var _0x13ea=function(_0x1a7b8b,_0xe53a61){_0x1a7b8b=_0x1a7b8b-0x0;var _0x4e55f4=_0x3ea1[_0x1a7b8b];return _0x4e55f4;};'use strict';var express=require(_0x13ea('0x0'));var router=express[_0x13ea('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x13ea('0x2')]('/',controller['login']);module[_0x13ea('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index d8b8d41..73d9718 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(_0x1a6c58,_0x1d2fc2){var _0x3f1052=function(_0x4d9988){while(--_0x4d9988){_0x1a6c58['push'](_0x1a6c58['shift']());}};_0x3f1052(++_0x1d2fc2);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7a54,0x106));var _0x47a5=function(_0x1aed40,_0x4dc125){_0x1aed40=_0x1aed40-0x0;var _0x231ff1=_0x7a54[_0x1aed40];return _0x231ff1;};'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 7611617..8d79201 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 _0xb524=['isMiddleware','passport','Router','./authGoogle.controller','get','/callback'];(function(_0x4d08a2,_0x4364f0){var _0x19f095=function(_0x223565){while(--_0x223565){_0x4d08a2['push'](_0x4d08a2['shift']());}};_0x19f095(++_0x4364f0);}(_0xb524,0xcd));var _0x4b52=function(_0x6d83ef,_0x530b14){_0x6d83ef=_0x6d83ef-0x0;var _0x332092=_0xb524[_0x6d83ef];return _0x332092;};'use strict';var express=require('express');var passport=require(_0x4b52('0x0'));var router=express[_0x4b52('0x1')]();var controller=require(_0x4b52('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router['get']('/',controller['login']);router[_0x4b52('0x3')](_0x4b52('0x4'),controller['callback'],authService[_0x4b52('0x5')],userController['login'],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file +var _0x7490=['login','callback','isMiddleware','setTokenCookie','exports','Router','./authGoogle.controller','../user/user.controller.js','get'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x7490,0x164));var _0x0749=function(_0x5f0796,_0x449268){_0x5f0796=_0x5f0796-0x0;var _0x1c54fd=_0x7490[_0x5f0796];return _0x1c54fd;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x0749('0x0')]();var controller=require(_0x0749('0x1'));var userController=require(_0x0749('0x2'));var authService=require('../../components/auth/service');router[_0x0749('0x3')]('/',controller[_0x0749('0x4')]);router[_0x0749('0x3')]('/callback',controller[_0x0749('0x5')],authService[_0x0749('0x6')],userController[_0x0749('0x4')],authService[_0x0749('0x7')]);module[_0x0749('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 00c7192..e41c432 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 _0x9243=['authenticate','disabled','blockedAt','minutes','clearBlockUser','add','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','stringify','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','trim','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','resetPasswordExpires','use','util','passport','passport-local','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','blocked','loginAttempts','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9243,0x89));var _0x3924=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x9243[_0xf26d40];return _0x50b68c;};'use strict';var util=require(_0x3924('0x0'));var passport=require(_0x3924('0x1'));var LocalStrategy=require(_0x3924('0x2'))[_0x3924('0x3')];var jayson=require('jayson/promise');var _=require(_0x3924('0x4'));var rs=require('randomstring');var moment=require(_0x3924('0x5'));var db=require(_0x3924('0x6'))['db'];var authService=require(_0x3924('0x7'));var utils=require(_0x3924('0x8'));var client=jayson[_0x3924('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x725fc9,_0x53ad93,_0x3fe0d9,_0x3307e5){var _0x22576d,_0x24bd4b;return db['Setting'][_0x3924('0xa')]({'where':{'id':0x1},'attributes':[_0x3924('0xb'),_0x3924('0xc')],'raw':!![]})['then'](function(_0x534113){_0x22576d=_0x534113;return _0x725fc9[_0x3924('0xa')]({'attributes':['id',_0x3924('0xd'),_0x3924('0xe'),_0x3924('0xf'),_0x3924('0x10'),'disabled',_0x3924('0x11'),'blockedAt',_0x3924('0x12')],'where':{'name':_0x53ad93,'role':{'$or':['admin',_0x3924('0x13'),_0x3924('0x14')]}}});})[_0x3924('0x15')](function(_0x55ddda){if(!_0x55ddda||_0x55ddda&&_0x55ddda[_0x3924('0xd')]!==_0x53ad93){throw new Error(_0x3924('0x16'));}else{_0x24bd4b=_0x55ddda;return _0x24bd4b;}})[_0x3924('0x15')](function(){_0x24bd4b[_0x3924('0x17')](_0x3fe0d9,function(_0x41e73f,_0x2125b3){var _0x135f38=_0x24bd4b[_0x3924('0x12')]+0x1;if(_0x41e73f){return _0x3307e5(_0x41e73f);}else if(!_0x2125b3){if(_0x24bd4b[_0x3924('0x18')]){return _0x3307e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x22576d[_0x3924('0xb')]>0x0){if(_0x24bd4b[_0x3924('0x11')]){if(_0x22576d[_0x3924('0xc')]>0x0){if(moment(_0x24bd4b[_0x3924('0x19')])['add'](_0x22576d['blockDuration'],_0x3924('0x1a'))>moment()){return _0x3307e5(null,![],{'message':_0x3924('0x16')});}else{return utils['clearBlockUser'](_0x24bd4b,_0x135f38,![],null)[_0x3924('0x15')](function(){return _0x3307e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3307e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x135f38>=_0x22576d[_0x3924('0xb')]){return utils[_0x3924('0x1b')](_0x24bd4b,0x0,!![],moment())[_0x3924('0x15')](function(){return _0x3307e5(null,![],{'message':_0x3924('0x16')});});}else{return utils[_0x3924('0x1b')](_0x24bd4b,_0x135f38,![],null)[_0x3924('0x15')](function(){return _0x3307e5(null,![],{'message':_0x3924('0x16')});});}}}else{return _0x3307e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x24bd4b[_0x3924('0x18')]){return _0x3307e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x22576d[_0x3924('0xb')]>0x0){if(_0x24bd4b[_0x3924('0x11')]){if(_0x22576d[_0x3924('0xc')]>0x0){if(moment(_0x24bd4b[_0x3924('0x19')])[_0x3924('0x1c')](_0x22576d[_0x3924('0xc')],'minutes')>moment()){return _0x3307e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3924('0x1b')](_0x24bd4b,0x0,![],null)[_0x3924('0x15')](function(){return utils[_0x3924('0x1d')](_0x24bd4b);})[_0x3924('0x15')](function(){return _0x3307e5(null,_0x24bd4b);});}}else{return _0x3307e5(null,![],{'message':_0x3924('0x16')});}}else{return utils[_0x3924('0x1b')](_0x24bd4b,0x0,![],null)[_0x3924('0x15')](function(){return utils[_0x3924('0x1d')](_0x24bd4b);})[_0x3924('0x15')](function(){return _0x3307e5(null,_0x24bd4b);})[_0x3924('0x1e')](function(_0x479c4e){return _0x3307e5(null,![],_0x479c4e);});}}else{if(_0x24bd4b[_0x3924('0x11')]){return _0x3307e5(null,![],{'message':_0x3924('0x16')});}else{return utils[_0x3924('0x1d')](_0x24bd4b)[_0x3924('0x15')](function(){return _0x3307e5(null,_0x24bd4b);});}}}});})['catch'](function(_0x272c1b){return _0x3307e5(null,![],_0x272c1b);});}function sendServiceMail(_0x39ee7b){return db['MailAccount'][_0x3924('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x3924('0xd'),_0x3924('0x20')],'include':[{'model':db[_0x3924('0x21')],'as':_0x3924('0x22'),'include':[{'model':db[_0x3924('0x23')],'as':_0x3924('0x23')}]}]})[_0x3924('0x15')](function(_0x3219ae){if(!_0x3219ae){throw new Error(_0x3924('0x24'));}var _0xd198ae=_0x3219ae[_0x3924('0x25')]();var _0x12c3c0={'account':_0xd198ae,'message':_[_0x3924('0x26')]({'from':util[_0x3924('0x27')](_0x3924('0x28'),_0x3219ae[_0x3924('0xd')],_0x3219ae[_0x3924('0x20')]||_0x3219ae[_0x3924('0x22')][_0x3924('0x13')])},_0x39ee7b)};return client[_0x3924('0x29')](_0x3924('0x2a'),_0x12c3c0);})[_0x3924('0x15')](function(_0x15468d){if(_0x15468d[_0x3924('0x2b')]){throw new Error(util[_0x3924('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x15468d[_0x3924('0x2b')]['message']||JSON[_0x3924('0x2c')](_0x15468d[_0x3924('0x2b')])));}return!![];});}function handleError(_0x344239,_0x4ed998,_0xb8df0b){return _0x344239[_0x3924('0x2d')](_0x4ed998||0x1f4)[_0x3924('0x2e')]({'message':_0xb8df0b?_0xb8df0b[_0x3924('0x2f')]||_0xb8df0b:''});}exports[_0x3924('0x30')]=function(_0x15ee8c,_0x6a55d9,_0x48a695){passport[_0x3924('0x17')](_0x3924('0x31'),function(_0x2147a2,_0x49d266,_0x24098e){var _0x2f1d67=_0x2147a2||_0x24098e;if(_0x2f1d67){return handleError(_0x6a55d9,0x191,_0x2f1d67);}if(!_0x49d266){return handleError(_0x6a55d9,0x194,{'message':_0x3924('0x32')});}else{var _0x2884ce={'payload':{'id':_0x49d266['id'],'role':_0x49d266[_0x3924('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x3924('0x33')](_0x2884ce)[_0x3924('0x15')](function(_0x5f00a2){_0x6a55d9[_0x3924('0x34')]({'id':_0x49d266['id'],'token':_0x5f00a2,'statusCall':'','isAlreadyLogged':_0x49d266[_0x3924('0x35')]});});}})(_0x15ee8c,_0x6a55d9,_0x48a695);};exports['forgot']=function(_0x43fea3,_0x3d8aed){if(!_0x43fea3[_0x3924('0x36')][_0x3924('0x20')]){return handleError(_0x3d8aed,0x1f4,{'message':_0x3924('0x37')});}var _0x6eb28e=rs['generate']();_0x43fea3[_0x3924('0x36')]['email']=_0x43fea3[_0x3924('0x36')][_0x3924('0x20')][_0x3924('0x38')]()['toLowerCase']();var _0xc87c94;return db[_0x3924('0x39')][_0x3924('0xa')]({'where':{'id':0x1},'attributes':[_0x3924('0xb'),_0x3924('0xc')],'raw':!![]})['then'](function(_0x16e1a6){_0xc87c94=_0x16e1a6;return db['User'][_0x3924('0x1f')]({'where':{'email':_0x43fea3['body']['email']}});})['then'](function(_0x51bffa){if(!_0x51bffa){throw new Error(_0x3924('0x3a'));}if(_0x51bffa[_0x3924('0x18')]){throw new Error(_0x3924('0x3b'));}if(_0x51bffa['blocked']){if(moment(_0x51bffa[_0x3924('0x19')])[_0x3924('0x1c')](_0xc87c94[_0x3924('0xc')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x51bffa['blocked']=![];_0x51bffa[_0x3924('0x19')]=null;}}_0x51bffa['resetPasswordToken']=_0x6eb28e;_0x51bffa['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x51bffa[_0x3924('0x3c')]();})[_0x3924('0x15')](function(){return sendServiceMail({'to':_0x43fea3['body']['email'],'subject':_0x3924('0x3d'),'text':_0x3924('0x3e')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x3924('0x3f')+_0x43fea3[_0x3924('0x40')]['host']+_0x3924('0x41')+_0x6eb28e+'\x0a\x0a'+_0x3924('0x42')});})['then'](function(){_0x3d8aed['status'](0xc8)[_0x3924('0x2e')]({'message':_0x3924('0x43')});})['catch'](function(_0x178dcf){return handleError(_0x3d8aed,0x1f4,_0x178dcf);});};exports[_0x3924('0x44')]=function(_0x9d324d,_0x315802){return db[_0x3924('0x45')][_0x3924('0x1f')]({'where':{'resetPasswordToken':_0x9d324d['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x3924('0x15')](function(_0x56b99d){if(!_0x56b99d){throw new Error(_0x3924('0x46'));}return db[_0x3924('0x39')][_0x3924('0xa')]({'attributes':['id',_0x3924('0x47'),_0x3924('0x48'),_0x3924('0x49')]})[_0x3924('0x15')](function(_0x2caf03){if(_0x2caf03[_0x3924('0x47')])authService[_0x3924('0x4a')](_0x9d324d[_0x3924('0x36')][_0x3924('0xe')]);if(!_0x2caf03[_0x3924('0x48')]||!_0x56b99d[_0x3924('0x4b')])return _0x56b99d;authService[_0x3924('0x4c')](_0x9d324d[_0x3924('0x36')][_0x3924('0xe')],_0x56b99d[_0x3924('0x4b')],_0x2caf03['passwordHistoryLimit']);return _0x56b99d;})['then'](function(){_0x56b99d[_0x3924('0xe')]=_0x9d324d[_0x3924('0x36')][_0x3924('0xe')];_0x56b99d[_0x3924('0x4d')]=null;_0x56b99d[_0x3924('0x4e')]=null;return _0x56b99d[_0x3924('0x3c')]();});})[_0x3924('0x15')](function(){_0x315802[_0x3924('0x2d')](0xc8)['send']({'message':'Password\x20reset!'});})['catch'](function(_0x2a24cf){return handleError(_0x315802,0x1f4,_0x2a24cf);});};passport[_0x3924('0x4f')](_0x3924('0x31'),new LocalStrategy({'usernameField':_0x3924('0xd'),'passwordField':_0x3924('0xe')},function(_0x19ed5b,_0x31ed30,_0x50a59a){return localAuthenticate(db[_0x3924('0x45')],_0x19ed5b,_0x31ed30,_0x50a59a);})); \ No newline at end of file +var _0x8b7c=['merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','User','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','allowedLoginAttempts','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions'];(function(_0x274638,_0x578968){var _0x5755df=function(_0x3227d5){while(--_0x3227d5){_0x274638['push'](_0x274638['shift']());}};_0x5755df(++_0x578968);}(_0x8b7c,0xcb));var _0xc8b7=function(_0x37ef22,_0x348c92){_0x37ef22=_0x37ef22-0x0;var _0x49eeb3=_0x8b7c[_0x37ef22];return _0x49eeb3;};'use strict';var util=require(_0xc8b7('0x0'));var passport=require('passport');var LocalStrategy=require(_0xc8b7('0x1'))[_0xc8b7('0x2')];var jayson=require(_0xc8b7('0x3'));var _=require(_0xc8b7('0x4'));var rs=require(_0xc8b7('0x5'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xc8b7('0x6'));var utils=require(_0xc8b7('0x7'));var client=jayson[_0xc8b7('0x8')][_0xc8b7('0x9')]({'port':0x232b});function localAuthenticate(_0x5ade05,_0x4484c7,_0x413bf6,_0x408faf){var _0x9751cd,_0x3c24a2;return db[_0xc8b7('0xa')][_0xc8b7('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc8b7('0xc')],'raw':!![]})[_0xc8b7('0xd')](function(_0xedbdd7){_0x9751cd=_0xedbdd7;return _0x5ade05[_0xc8b7('0xb')]({'attributes':['id',_0xc8b7('0xe'),_0xc8b7('0xf'),_0xc8b7('0x10'),_0xc8b7('0x11'),_0xc8b7('0x12'),_0xc8b7('0x13'),_0xc8b7('0x14'),'loginAttempts'],'where':{'name':_0x4484c7,'role':{'$or':['admin',_0xc8b7('0x15'),'agent']}}});})[_0xc8b7('0xd')](function(_0x12c7c5){if(!_0x12c7c5||_0x12c7c5&&_0x12c7c5[_0xc8b7('0xe')]!==_0x4484c7){throw new Error(_0xc8b7('0x16'));}else{_0x3c24a2=_0x12c7c5;return _0x3c24a2;}})['then'](function(){_0x3c24a2['authenticate'](_0x413bf6,function(_0x22c5c9,_0x1c6ed6){var _0x296007=_0x3c24a2[_0xc8b7('0x17')]+0x1;if(_0x22c5c9){return _0x408faf(_0x22c5c9);}else if(!_0x1c6ed6){if(_0x3c24a2[_0xc8b7('0x12')]){return _0x408faf(null,![],{'message':_0xc8b7('0x16')});}else if(_0x9751cd[_0xc8b7('0x18')]>0x0){if(_0x3c24a2[_0xc8b7('0x13')]){if(_0x9751cd[_0xc8b7('0xc')]>0x0){if(moment(_0x3c24a2[_0xc8b7('0x14')])['add'](_0x9751cd[_0xc8b7('0xc')],_0xc8b7('0x19'))>moment()){return _0x408faf(null,![],{'message':_0xc8b7('0x16')});}else{return utils[_0xc8b7('0x1a')](_0x3c24a2,_0x296007,![],null)['then'](function(){return _0x408faf(null,![],{'message':_0xc8b7('0x16')});});}}else{return _0x408faf(null,![],{'message':_0xc8b7('0x16')});}}else{if(_0x296007>=_0x9751cd['allowedLoginAttempts']){return utils[_0xc8b7('0x1a')](_0x3c24a2,0x0,!![],moment())[_0xc8b7('0xd')](function(){return _0x408faf(null,![],{'message':_0xc8b7('0x16')});});}else{return utils[_0xc8b7('0x1a')](_0x3c24a2,_0x296007,![],null)[_0xc8b7('0xd')](function(){return _0x408faf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x408faf(null,![],{'message':_0xc8b7('0x16')});}}else{if(_0x3c24a2[_0xc8b7('0x12')]){return _0x408faf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x9751cd[_0xc8b7('0x18')]>0x0){if(_0x3c24a2[_0xc8b7('0x13')]){if(_0x9751cd[_0xc8b7('0xc')]>0x0){if(moment(_0x3c24a2['blockedAt'])[_0xc8b7('0x1b')](_0x9751cd[_0xc8b7('0xc')],'minutes')>moment()){return _0x408faf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc8b7('0x1a')](_0x3c24a2,0x0,![],null)['then'](function(){return utils[_0xc8b7('0x1c')](_0x3c24a2);})[_0xc8b7('0xd')](function(){return _0x408faf(null,_0x3c24a2);});}}else{return _0x408faf(null,![],{'message':_0xc8b7('0x16')});}}else{return utils[_0xc8b7('0x1a')](_0x3c24a2,0x0,![],null)['then'](function(){return utils[_0xc8b7('0x1c')](_0x3c24a2);})['then'](function(){return _0x408faf(null,_0x3c24a2);})[_0xc8b7('0x1d')](function(_0xe13f63){return _0x408faf(null,![],_0xe13f63);});}}else{if(_0x3c24a2[_0xc8b7('0x13')]){return _0x408faf(null,![],{'message':_0xc8b7('0x16')});}else{return utils[_0xc8b7('0x1c')](_0x3c24a2)[_0xc8b7('0xd')](function(){return _0x408faf(null,_0x3c24a2);});}}}});})[_0xc8b7('0x1d')](function(_0xc679df){return _0x408faf(null,![],_0xc679df);});}function sendServiceMail(_0x3174e8){return db[_0xc8b7('0x1e')][_0xc8b7('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xc8b7('0xe'),_0xc8b7('0x20')],'include':[{'model':db['MailServerOut'],'as':_0xc8b7('0x21'),'include':[{'model':db['CloudProvider'],'as':_0xc8b7('0x22')}]}]})[_0xc8b7('0xd')](function(_0x5229b6){if(!_0x5229b6){throw new Error(_0xc8b7('0x23'));}var _0x27fabc=_0x5229b6[_0xc8b7('0x24')]();var _0x3e59df={'account':_0x27fabc,'message':_[_0xc8b7('0x25')]({'from':util[_0xc8b7('0x26')](_0xc8b7('0x27'),_0x5229b6['name'],_0x5229b6['email']||_0x5229b6['Smtp'][_0xc8b7('0x15')])},_0x3174e8)};return client[_0xc8b7('0x28')](_0xc8b7('0x29'),_0x3e59df);})[_0xc8b7('0xd')](function(_0x94af1d){if(_0x94af1d['error']){throw new Error(util[_0xc8b7('0x26')](_0xc8b7('0x2a'),_0x94af1d[_0xc8b7('0x2b')][_0xc8b7('0x2c')]||JSON[_0xc8b7('0x2d')](_0x94af1d[_0xc8b7('0x2b')])));}return!![];});}function handleError(_0x8c231,_0x2af11e,_0xc11aa2){return _0x8c231[_0xc8b7('0x2e')](_0x2af11e||0x1f4)[_0xc8b7('0x2f')]({'message':_0xc11aa2?_0xc11aa2[_0xc8b7('0x2c')]||_0xc11aa2:''});}exports[_0xc8b7('0x30')]=function(_0x2d423d,_0x1c0168,_0x11a1f2){passport[_0xc8b7('0x31')](_0xc8b7('0x32'),function(_0xbc2988,_0x157244,_0xefa2a6){var _0x4ad09f=_0xbc2988||_0xefa2a6;if(_0x4ad09f){return handleError(_0x1c0168,0x191,_0x4ad09f);}if(!_0x157244){return handleError(_0x1c0168,0x194,{'message':_0xc8b7('0x33')});}else{var _0x562aa2={'payload':{'id':_0x157244['id'],'role':_0x157244[_0xc8b7('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xc8b7('0x34')](_0x562aa2)[_0xc8b7('0xd')](function(_0x1ef7fb){_0x1c0168[_0xc8b7('0x35')]({'id':_0x157244['id'],'token':_0x1ef7fb,'statusCall':'','isAlreadyLogged':_0x157244[_0xc8b7('0x36')]});});}})(_0x2d423d,_0x1c0168,_0x11a1f2);};exports[_0xc8b7('0x37')]=function(_0x287581,_0x248185){if(!_0x287581[_0xc8b7('0x38')][_0xc8b7('0x20')]){return handleError(_0x248185,0x1f4,{'message':_0xc8b7('0x39')});}var _0x7e9f=rs['generate']();_0x287581['body'][_0xc8b7('0x20')]=_0x287581['body']['email']['trim']()['toLowerCase']();var _0x3796c7;return db[_0xc8b7('0xa')][_0xc8b7('0xb')]({'where':{'id':0x1},'attributes':[_0xc8b7('0x18'),_0xc8b7('0xc')],'raw':!![]})[_0xc8b7('0xd')](function(_0x5f0077){_0x3796c7=_0x5f0077;return db[_0xc8b7('0x3a')][_0xc8b7('0x1f')]({'where':{'email':_0x287581['body'][_0xc8b7('0x20')]}});})[_0xc8b7('0xd')](function(_0x406b55){if(!_0x406b55){throw new Error(_0xc8b7('0x3b'));}if(_0x406b55[_0xc8b7('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x406b55[_0xc8b7('0x13')]){if(moment(_0x406b55['blockedAt'])[_0xc8b7('0x1b')](_0x3796c7['blockDuration'],_0xc8b7('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x406b55[_0xc8b7('0x13')]=![];_0x406b55[_0xc8b7('0x14')]=null;}}_0x406b55[_0xc8b7('0x3c')]=_0x7e9f;_0x406b55[_0xc8b7('0x3d')]=Date['now']()+0x36ee80;return _0x406b55[_0xc8b7('0x3e')]();})[_0xc8b7('0xd')](function(){return sendServiceMail({'to':_0x287581['body']['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xc8b7('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xc8b7('0x40')+_0x287581[_0xc8b7('0x41')][_0xc8b7('0x42')]+_0xc8b7('0x43')+_0x7e9f+'\x0a\x0a'+_0xc8b7('0x44')});})[_0xc8b7('0xd')](function(){_0x248185[_0xc8b7('0x2e')](0xc8)[_0xc8b7('0x2f')]({'message':'Reset\x20Email\x20sent!'});})[_0xc8b7('0x1d')](function(_0x3cc1e4){return handleError(_0x248185,0x1f4,_0x3cc1e4);});};exports[_0xc8b7('0x45')]=function(_0x240126,_0xf67095){return db[_0xc8b7('0x3a')][_0xc8b7('0x1f')]({'where':{'resetPasswordToken':_0x240126[_0xc8b7('0x46')][_0xc8b7('0x47')],'resetPasswordExpires':{'$gt':Date[_0xc8b7('0x48')]()}}})['then'](function(_0x664616){if(!_0x664616){throw new Error(_0xc8b7('0x49'));}return db[_0xc8b7('0xa')][_0xc8b7('0xb')]({'attributes':['id',_0xc8b7('0x4a'),'enforcePasswordHistory','passwordHistoryLimit']})[_0xc8b7('0xd')](function(_0x31d8a5){if(_0x31d8a5[_0xc8b7('0x4a')])authService[_0xc8b7('0x4b')](_0x240126['body'][_0xc8b7('0xf')]);if(!_0x31d8a5['enforcePasswordHistory']||!_0x664616[_0xc8b7('0x4c')])return _0x664616;authService[_0xc8b7('0x4d')](_0x240126['body'][_0xc8b7('0xf')],_0x664616[_0xc8b7('0x4c')],_0x31d8a5['passwordHistoryLimit']);return _0x664616;})[_0xc8b7('0xd')](function(){_0x664616[_0xc8b7('0xf')]=_0x240126[_0xc8b7('0x38')][_0xc8b7('0xf')];_0x664616[_0xc8b7('0x3c')]=null;_0x664616[_0xc8b7('0x3d')]=null;return _0x664616[_0xc8b7('0x3e')]();});})[_0xc8b7('0xd')](function(){_0xf67095[_0xc8b7('0x2e')](0xc8)[_0xc8b7('0x2f')]({'message':_0xc8b7('0x4e')});})['catch'](function(_0x123ccf){return handleError(_0xf67095,0x1f4,_0x123ccf);});};passport[_0xc8b7('0x4f')](_0xc8b7('0x32'),new LocalStrategy({'usernameField':_0xc8b7('0xe'),'passwordField':_0xc8b7('0xf')},function(_0x50fbd1,_0x143f80,_0x2998e1){return localAuthenticate(db[_0xc8b7('0x3a')],_0x50fbd1,_0x143f80,_0x2998e1);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index ab962c5..b85aafa 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 _0xfe75=['/forgot','forgot','/reset/:token','reset','exports','express','./authLocal.controller','post'];(function(_0x15bdd4,_0x5b47b8){var _0xd80929=function(_0x247ddd){while(--_0x247ddd){_0x15bdd4['push'](_0x15bdd4['shift']());}};_0xd80929(++_0x5b47b8);}(_0xfe75,0x18d));var _0x5fe7=function(_0xfbd1fa,_0x1aa285){_0xfbd1fa=_0xfbd1fa-0x0;var _0x4ffb52=_0xfe75[_0xfbd1fa];return _0x4ffb52;};'use strict';var express=require(_0x5fe7('0x0'));var router=express['Router']();var controller=require(_0x5fe7('0x1'));router[_0x5fe7('0x2')]('/',controller['login']);router['post'](_0x5fe7('0x3'),controller[_0x5fe7('0x4')]);router[_0x5fe7('0x2')](_0x5fe7('0x5'),controller[_0x5fe7('0x6')]);module[_0x5fe7('0x7')]=router; \ No newline at end of file +var _0x6095=['reset','exports','express','Router','login','/forgot','forgot','post','/reset/:token'];(function(_0x3c0f17,_0x4c1795){var _0x595c21=function(_0x2b83e2){while(--_0x2b83e2){_0x3c0f17['push'](_0x3c0f17['shift']());}};_0x595c21(++_0x4c1795);}(_0x6095,0x110));var _0x5609=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x6095[_0x288f5e];return _0x476cc9;};'use strict';var express=require(_0x5609('0x0'));var router=express[_0x5609('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x5609('0x2')]);router['post'](_0x5609('0x3'),controller[_0x5609('0x4')]);router[_0x5609('0x5')](_0x5609('0x6'),controller[_0x5609('0x7')]);module[_0x5609('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 3de4a83..5f5deba 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 _0x5793=['STRING','sequelize','exports'];(function(_0x87242b,_0x33afdd){var _0x5da66d=function(_0x16a5c9){while(--_0x16a5c9){_0x87242b['push'](_0x87242b['shift']());}};_0x5da66d(++_0x33afdd);}(_0x5793,0xf7));var _0x3579=function(_0x1b4f07,_0x16ce16){_0x1b4f07=_0x1b4f07-0x0;var _0x291dc0=_0x5793[_0x1b4f07];return _0x291dc0;};'use strict';var Sequelize=require(_0x3579('0x0'));module[_0x3579('0x1')]={'name':{'type':Sequelize[_0x3579('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x3579('0x2')]},'description':{'type':Sequelize[_0x3579('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xc032=['BOOLEAN','STRING'];(function(_0x50b847,_0x301d67){var _0x320acf=function(_0xb643af){while(--_0xb643af){_0x50b847['push'](_0x50b847['shift']());}};_0x320acf(++_0x301d67);}(_0xc032,0x1a9));var _0x2c03=function(_0x575beb,_0x715d7){_0x575beb=_0x575beb-0x0;var _0x4c77c9=_0xc032[_0x575beb];return _0x4c77c9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2c03('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x2c03('0x0')]},'description':{'type':Sequelize[_0x2c03('0x0')]},'status':{'type':Sequelize[_0x2c03('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 2863aaf..fe1217e 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 _0x23c7=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','rawAttributes','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','Automation','intersection','find','create','body','params','addConditions','omit','ids','findOne','Condition','getConditions','hasOwnProperty','Action','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','desk.js'];(function(_0x5404f6,_0x5900a7){var _0x13230b=function(_0x15be12){while(--_0x15be12){_0x5404f6['push'](_0x5404f6['shift']());}};_0x13230b(++_0x5900a7);}(_0x23c7,0x196));var _0x723c=function(_0x1e689e,_0x52abd7){_0x1e689e=_0x1e689e-0x0;var _0x571b73=_0x23c7[_0x1e689e];return _0x571b73;};'use strict';var emlformat=require(_0x723c('0x0'));var rimraf=require(_0x723c('0x1'));var zipdir=require(_0x723c('0x2'));var jsonpatch=require(_0x723c('0x3'));var rp=require(_0x723c('0x4'));var moment=require(_0x723c('0x5'));var BPromise=require(_0x723c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x723c('0x7'));var sox=require(_0x723c('0x8'));var csv=require(_0x723c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x723c('0xa'));var _=require('lodash');var squel=require(_0x723c('0xb'));var crypto=require(_0x723c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x723c('0xd'));var toCsv=require(_0x723c('0x9'));var querystring=require(_0x723c('0xe'));var Papa=require(_0x723c('0xf'));var Redis=require(_0x723c('0x10'));var authService=require(_0x723c('0x11'));var qs=require(_0x723c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x723c('0x13'))(_0x723c('0x14'));var utils=require(_0x723c('0x15'));var config=require(_0x723c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10b45e,_0x3c2b7f){_0x3c2b7f=_0x3c2b7f||0xcc;return function(_0x1a5e4a){if(_0x1a5e4a){return _0x10b45e[_0x723c('0x17')](_0x3c2b7f);}return _0x10b45e[_0x723c('0x18')](_0x3c2b7f)['end']();};}function respondWithResult(_0x37be10,_0x419bdf){_0x419bdf=_0x419bdf||0xc8;return function(_0xb55094){if(_0xb55094){return _0x37be10['status'](_0x419bdf)[_0x723c('0x19')](_0xb55094);}};}function respondWithFilteredResult(_0x1b9d9b,_0x16f388){return function(_0x41418a){if(_0x41418a){var _0x5f5cdf=typeof _0x16f388[_0x723c('0x1a')]===_0x723c('0x1b')&&typeof _0x16f388[_0x723c('0x1c')]==='undefined';var _0x576365=_0x41418a[_0x723c('0x1d')];var _0x17b4ad=_0x5f5cdf?0x0:_0x16f388[_0x723c('0x1a')];var _0x34541e=_0x5f5cdf?_0x41418a['count']:_0x16f388[_0x723c('0x1a')]+_0x16f388['limit'];var _0x281353;if(_0x34541e>=_0x576365){_0x34541e=_0x576365;_0x281353=0xc8;}else{_0x281353=0xce;}_0x1b9d9b[_0x723c('0x18')](_0x281353);return _0x1b9d9b[_0x723c('0x1e')](_0x723c('0x1f'),_0x17b4ad+'-'+_0x34541e+'/'+_0x576365)[_0x723c('0x19')](_0x41418a);}return null;};}function patchUpdates(_0x26c08d){return function(_0x51256c){try{jsonpatch[_0x723c('0x20')](_0x51256c,_0x26c08d,!![]);}catch(_0x2f89e6){return BPromise[_0x723c('0x21')](_0x2f89e6);}return _0x51256c[_0x723c('0x22')]();};}function saveUpdates(_0x496814,_0x904754){return function(_0x311474){if(_0x311474){return _0x311474['update'](_0x496814)[_0x723c('0x23')](function(_0x305c0a){return _0x305c0a;});}return null;};}function removeEntity(_0x16dade,_0x56766e){return function(_0x31dc68){if(_0x31dc68){return _0x31dc68[_0x723c('0x24')]()[_0x723c('0x23')](function(){_0x16dade[_0x723c('0x18')](0xcc)[_0x723c('0x25')]();});}};}function handleEntityNotFound(_0x42c35f,_0x51fc19){return function(_0xe40c1b){if(!_0xe40c1b){_0x42c35f[_0x723c('0x17')](0x194);}return _0xe40c1b;};}function handleError(_0x3dd6a9,_0x47ca29){_0x47ca29=_0x47ca29||0x1f4;return function(_0x5da838){logger[_0x723c('0x26')](_0x5da838[_0x723c('0x27')]);if(_0x5da838[_0x723c('0x28')]){delete _0x5da838[_0x723c('0x28')];}_0x3dd6a9[_0x723c('0x18')](_0x47ca29)[_0x723c('0x29')](_0x5da838);};}exports['index']=function(_0x2f5289,_0xbf5499){var _0x3d48ff={},_0x3311ed={},_0x4de30a={'count':0x0,'rows':[]};var _0xb90522=_['map'](db['Automation'][_0x723c('0x2a')],function(_0x38ae0e){return{'name':_0x38ae0e['fieldName'],'type':_0x38ae0e['type'][_0x723c('0x2b')]};});_0x3311ed[_0x723c('0x2c')]=_[_0x723c('0x2d')](_0xb90522,'name');_0x3311ed[_0x723c('0x2e')]=_[_0x723c('0x2f')](_0x2f5289[_0x723c('0x2e')]);_0x3311ed[_0x723c('0x30')]=_['intersection'](_0x3311ed[_0x723c('0x2c')],_0x3311ed['query']);_0x3d48ff[_0x723c('0x31')]=_['intersection'](_0x3311ed[_0x723c('0x2c')],qs[_0x723c('0x32')](_0x2f5289[_0x723c('0x2e')][_0x723c('0x32')]));_0x3d48ff[_0x723c('0x31')]=_0x3d48ff['attributes'][_0x723c('0x33')]?_0x3d48ff['attributes']:_0x3311ed['model'];if(!_0x2f5289[_0x723c('0x2e')]['hasOwnProperty'](_0x723c('0x34'))){_0x3d48ff[_0x723c('0x1c')]=qs[_0x723c('0x1c')](_0x2f5289['query']['limit']);_0x3d48ff['offset']=qs[_0x723c('0x1a')](_0x2f5289[_0x723c('0x2e')]['offset']);}_0x3d48ff[_0x723c('0x35')]=qs[_0x723c('0x36')](_0x2f5289[_0x723c('0x2e')][_0x723c('0x36')]);_0x3d48ff[_0x723c('0x37')]=qs[_0x723c('0x30')](_[_0x723c('0x38')](_0x2f5289['query'],_0x3311ed['filters']),_0xb90522);if(_0x2f5289[_0x723c('0x2e')][_0x723c('0x39')]){_0x3d48ff[_0x723c('0x37')]=_[_0x723c('0x3a')](_0x3d48ff[_0x723c('0x37')],{'$or':_[_0x723c('0x2d')](_0xb90522,function(_0x2ab5f9){if(_0x2ab5f9[_0x723c('0x3b')]!==_0x723c('0x3c')){var _0x49924f={};_0x49924f[_0x2ab5f9[_0x723c('0x28')]]={'$like':'%'+_0x2f5289['query']['filter']+'%'};return _0x49924f;}})});}_0x3d48ff=_[_0x723c('0x3a')]({},_0x3d48ff,_0x2f5289[_0x723c('0x3d')]);var _0x4d7d3c={'where':_0x3d48ff[_0x723c('0x37')]};return db['Automation'][_0x723c('0x1d')](_0x4d7d3c)['then'](function(_0x580d51){_0x4de30a['count']=_0x580d51;if(_0x2f5289[_0x723c('0x2e')][_0x723c('0x3e')]){_0x3d48ff[_0x723c('0x3f')]=[{'all':!![]}];}return db['Automation'][_0x723c('0x40')](_0x3d48ff);})[_0x723c('0x23')](function(_0x40ade7){_0x4de30a[_0x723c('0x41')]=_0x40ade7;return _0x4de30a;})[_0x723c('0x23')](respondWithFilteredResult(_0xbf5499,_0x3d48ff))[_0x723c('0x42')](handleError(_0xbf5499,null));};exports[_0x723c('0x43')]=function(_0x21dff6,_0x469a3a){var _0x34d5c1={'raw':![],'where':{'id':_0x21dff6['params']['id']}},_0x4b96d1={};_0x4b96d1[_0x723c('0x2c')]=_[_0x723c('0x2f')](db[_0x723c('0x44')][_0x723c('0x2a')]);_0x4b96d1[_0x723c('0x2e')]=_[_0x723c('0x2f')](_0x21dff6['query']);_0x4b96d1['filters']=_[_0x723c('0x45')](_0x4b96d1['model'],_0x4b96d1['query']);_0x34d5c1[_0x723c('0x31')]=_[_0x723c('0x45')](_0x4b96d1['model'],qs[_0x723c('0x32')](_0x21dff6[_0x723c('0x2e')][_0x723c('0x32')]));_0x34d5c1[_0x723c('0x31')]=_0x34d5c1[_0x723c('0x31')][_0x723c('0x33')]?_0x34d5c1[_0x723c('0x31')]:_0x4b96d1['model'];if(_0x21dff6[_0x723c('0x2e')][_0x723c('0x3e')]){_0x34d5c1['include']=[{'all':!![]}];}_0x34d5c1=_[_0x723c('0x3a')]({},_0x34d5c1,_0x21dff6[_0x723c('0x3d')]);return db[_0x723c('0x44')][_0x723c('0x46')](_0x34d5c1)[_0x723c('0x23')](handleEntityNotFound(_0x469a3a,null))[_0x723c('0x23')](respondWithResult(_0x469a3a,null))[_0x723c('0x42')](handleError(_0x469a3a,null));};exports[_0x723c('0x47')]=function(_0x594c67,_0x4d3313){return db[_0x723c('0x44')][_0x723c('0x47')](_0x594c67['body'],{})[_0x723c('0x23')](respondWithResult(_0x4d3313,0xc9))[_0x723c('0x42')](handleError(_0x4d3313,null));};exports['update']=function(_0x4c5756,_0x209b93){if(_0x4c5756[_0x723c('0x48')]['id']){delete _0x4c5756[_0x723c('0x48')]['id'];}return db[_0x723c('0x44')][_0x723c('0x46')]({'where':{'id':_0x4c5756[_0x723c('0x49')]['id']}})[_0x723c('0x23')](handleEntityNotFound(_0x209b93,null))[_0x723c('0x23')](saveUpdates(_0x4c5756[_0x723c('0x48')],null))[_0x723c('0x23')](respondWithResult(_0x209b93,null))['catch'](handleError(_0x209b93,null));};exports[_0x723c('0x24')]=function(_0x4b18bb,_0x240537){return db[_0x723c('0x44')]['find']({'where':{'id':_0x4b18bb[_0x723c('0x49')]['id']}})['then'](handleEntityNotFound(_0x240537,null))['then'](removeEntity(_0x240537,null))[_0x723c('0x42')](handleError(_0x240537,null));};exports[_0x723c('0x4a')]=function(_0x3961bb,_0x11df52,_0x2e1404){return db['Condition']['find']({'where':{'id':_0x3961bb[_0x723c('0x49')]['id']}})[_0x723c('0x23')](handleEntityNotFound(_0x11df52,null))[_0x723c('0x23')](function(_0x459df4){if(_0x459df4){return _0x459df4[_0x723c('0x4a')](_0x3961bb[_0x723c('0x48')]['ids'],_[_0x723c('0x4b')](_0x3961bb[_0x723c('0x48')],[_0x723c('0x4c'),'id'])||{});}})[_0x723c('0x23')](respondWithResult(_0x11df52,null))[_0x723c('0x42')](handleError(_0x11df52,null));};exports['getConditions']=function(_0x184e7e,_0x3cd27e,_0x6c95bf){var _0x3592db={};var _0x483f47={};var _0x546029;var _0x33ce10;return db['Automation'][_0x723c('0x4d')]({'where':{'id':_0x184e7e[_0x723c('0x49')]['id']}})[_0x723c('0x23')](handleEntityNotFound(_0x3cd27e,null))['then'](function(_0x3208e5){if(_0x3208e5){_0x546029=_0x3208e5;_0x483f47[_0x723c('0x2c')]=_[_0x723c('0x2f')](db[_0x723c('0x4e')][_0x723c('0x2a')]);_0x483f47['query']=_[_0x723c('0x2f')](_0x184e7e['query']);_0x483f47[_0x723c('0x30')]=_[_0x723c('0x45')](_0x483f47[_0x723c('0x2c')],_0x483f47['query']);_0x3592db[_0x723c('0x31')]=_[_0x723c('0x45')](_0x483f47[_0x723c('0x2c')],qs[_0x723c('0x32')](_0x184e7e['query'][_0x723c('0x32')]));_0x3592db[_0x723c('0x31')]=_0x3592db['attributes'][_0x723c('0x33')]?_0x3592db[_0x723c('0x31')]:_0x483f47['model'];_0x3592db['order']=qs['sort'](_0x184e7e[_0x723c('0x2e')][_0x723c('0x36')]);_0x3592db[_0x723c('0x37')]=qs[_0x723c('0x30')](_[_0x723c('0x38')](_0x184e7e[_0x723c('0x2e')],_0x483f47[_0x723c('0x30')]));if(_0x184e7e[_0x723c('0x2e')][_0x723c('0x39')]){_0x3592db['where']=_[_0x723c('0x3a')](_0x3592db[_0x723c('0x37')],{'$or':_[_0x723c('0x2d')](_0x3592db[_0x723c('0x31')],function(_0x4652ee){var _0x181464={};_0x181464[_0x4652ee]={'$like':'%'+_0x184e7e[_0x723c('0x2e')][_0x723c('0x39')]+'%'};return _0x181464;})});}_0x3592db=_[_0x723c('0x3a')]({},_0x3592db,_0x184e7e['options']);return _0x546029[_0x723c('0x4f')](_0x3592db);}})['then'](function(_0x380f00){if(_0x380f00){_0x33ce10=_0x380f00[_0x723c('0x33')];if(!_0x184e7e['query'][_0x723c('0x50')](_0x723c('0x34'))){_0x3592db['limit']=qs['limit'](_0x184e7e['query'][_0x723c('0x1c')]);_0x3592db['offset']=qs[_0x723c('0x1a')](_0x184e7e[_0x723c('0x2e')][_0x723c('0x1a')]);}return _0x546029['getConditions'](_0x3592db);}})[_0x723c('0x23')](function(_0x42988e){if(_0x42988e){return _0x42988e?{'count':_0x33ce10,'rows':_0x42988e}:null;}})[_0x723c('0x23')](respondWithResult(_0x3cd27e,null))[_0x723c('0x42')](handleError(_0x3cd27e,null));};exports['addActions']=function(_0x2e1199,_0x4a99b6,_0x1855d8){return db[_0x723c('0x51')][_0x723c('0x46')]({'where':{'id':_0x2e1199[_0x723c('0x49')]['id']}})[_0x723c('0x23')](handleEntityNotFound(_0x4a99b6,null))[_0x723c('0x23')](function(_0x3e472a){if(_0x3e472a){return _0x3e472a[_0x723c('0x52')](_0x2e1199[_0x723c('0x48')][_0x723c('0x4c')],_[_0x723c('0x4b')](_0x2e1199[_0x723c('0x48')],[_0x723c('0x4c'),'id'])||{});}})[_0x723c('0x23')](respondWithResult(_0x4a99b6,null))[_0x723c('0x42')](handleError(_0x4a99b6,null));};exports[_0x723c('0x53')]=function(_0x46f4eb,_0x4fdf1d,_0xb79bd7){var _0xa612ff={};var _0x29da06={};var _0x52ffe1;var _0x2fc2c2;return db[_0x723c('0x44')][_0x723c('0x4d')]({'where':{'id':_0x46f4eb[_0x723c('0x49')]['id']}})[_0x723c('0x23')](handleEntityNotFound(_0x4fdf1d,null))['then'](function(_0xa4b052){if(_0xa4b052){_0x52ffe1=_0xa4b052;_0x29da06[_0x723c('0x2c')]=_[_0x723c('0x2f')](db[_0x723c('0x51')][_0x723c('0x2a')]);_0x29da06['query']=_[_0x723c('0x2f')](_0x46f4eb[_0x723c('0x2e')]);_0x29da06[_0x723c('0x30')]=_['intersection'](_0x29da06[_0x723c('0x2c')],_0x29da06['query']);_0xa612ff[_0x723c('0x31')]=_[_0x723c('0x45')](_0x29da06['model'],qs[_0x723c('0x32')](_0x46f4eb[_0x723c('0x2e')][_0x723c('0x32')]));_0xa612ff[_0x723c('0x31')]=_0xa612ff[_0x723c('0x31')][_0x723c('0x33')]?_0xa612ff[_0x723c('0x31')]:_0x29da06[_0x723c('0x2c')];_0xa612ff[_0x723c('0x35')]=qs[_0x723c('0x36')](_0x46f4eb[_0x723c('0x2e')][_0x723c('0x36')]);_0xa612ff[_0x723c('0x37')]=qs['filters'](_[_0x723c('0x38')](_0x46f4eb[_0x723c('0x2e')],_0x29da06['filters']));if(_0x46f4eb['query'][_0x723c('0x39')]){_0xa612ff[_0x723c('0x37')]=_[_0x723c('0x3a')](_0xa612ff[_0x723c('0x37')],{'$or':_[_0x723c('0x2d')](_0xa612ff['attributes'],function(_0x9c7f3){var _0x43233d={};_0x43233d[_0x9c7f3]={'$like':'%'+_0x46f4eb['query'][_0x723c('0x39')]+'%'};return _0x43233d;})});}_0xa612ff=_[_0x723c('0x3a')]({},_0xa612ff,_0x46f4eb[_0x723c('0x3d')]);return _0x52ffe1[_0x723c('0x53')](_0xa612ff);}})[_0x723c('0x23')](function(_0x3e349e){if(_0x3e349e){_0x2fc2c2=_0x3e349e[_0x723c('0x33')];if(!_0x46f4eb[_0x723c('0x2e')][_0x723c('0x50')]('nolimit')){_0xa612ff[_0x723c('0x1c')]=qs[_0x723c('0x1c')](_0x46f4eb[_0x723c('0x2e')][_0x723c('0x1c')]);_0xa612ff[_0x723c('0x1a')]=qs['offset'](_0x46f4eb['query'][_0x723c('0x1a')]);}return _0x52ffe1['getActions'](_0xa612ff);}})[_0x723c('0x23')](function(_0x2f7b36){if(_0x2f7b36){return _0x2f7b36?{'count':_0x2fc2c2,'rows':_0x2f7b36}:null;}})[_0x723c('0x23')](respondWithResult(_0x4fdf1d,null))['catch'](handleError(_0x4fdf1d,null));}; \ No newline at end of file +var _0x6e62=['mustache','util','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Automation','includeAll','rows','catch','show','params','keys','include','find','create','body','update','Condition','addConditions','ids','omit','getConditions','findOne','addActions','getActions','Action','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1b1ed8,_0x2b0f38){var _0x33e1d6=function(_0x545491){while(--_0x545491){_0x1b1ed8['push'](_0x1b1ed8['shift']());}};_0x33e1d6(++_0x2b0f38);}(_0x6e62,0xf3));var _0x26e6=function(_0x1f8d6c,_0x3234d9){_0x1f8d6c=_0x1f8d6c-0x0;var _0x518aef=_0x6e62[_0x1f8d6c];return _0x518aef;};'use strict';var emlformat=require(_0x26e6('0x0'));var rimraf=require(_0x26e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x26e6('0x2'));var rp=require(_0x26e6('0x3'));var moment=require(_0x26e6('0x4'));var BPromise=require(_0x26e6('0x5'));var Mustache=require(_0x26e6('0x6'));var util=require(_0x26e6('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x26e6('0x8'));var fs=require('fs');var fs_extra=require(_0x26e6('0x9'));var _=require(_0x26e6('0xa'));var squel=require('squel');var crypto=require(_0x26e6('0xb'));var jsforce=require(_0x26e6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x26e6('0xd'));var querystring=require('querystring');var Papa=require(_0x26e6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x26e6('0xf'));var as=require(_0x26e6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26e6('0x11'))(_0x26e6('0x12'));var utils=require(_0x26e6('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x26e6('0x14'));var db=require(_0x26e6('0x15'))['db'];function respondWithStatusCode(_0x103ba2,_0x3a3bda){_0x3a3bda=_0x3a3bda||0xcc;return function(_0x19a6a9){if(_0x19a6a9){return _0x103ba2[_0x26e6('0x16')](_0x3a3bda);}return _0x103ba2[_0x26e6('0x17')](_0x3a3bda)[_0x26e6('0x18')]();};}function respondWithResult(_0x246e76,_0xa71287){_0xa71287=_0xa71287||0xc8;return function(_0x428060){if(_0x428060){return _0x246e76[_0x26e6('0x17')](_0xa71287)[_0x26e6('0x19')](_0x428060);}};}function respondWithFilteredResult(_0x40cdb6,_0x10326f){return function(_0x2a392f){if(_0x2a392f){var _0x2cddc3=typeof _0x10326f[_0x26e6('0x1a')]===_0x26e6('0x1b')&&typeof _0x10326f[_0x26e6('0x1c')]===_0x26e6('0x1b');var _0x1f33c2=_0x2a392f[_0x26e6('0x1d')];var _0x5803bc=_0x2cddc3?0x0:_0x10326f[_0x26e6('0x1a')];var _0x4d63cf=_0x2cddc3?_0x2a392f[_0x26e6('0x1d')]:_0x10326f['offset']+_0x10326f['limit'];var _0x30fb96;if(_0x4d63cf>=_0x1f33c2){_0x4d63cf=_0x1f33c2;_0x30fb96=0xc8;}else{_0x30fb96=0xce;}_0x40cdb6['status'](_0x30fb96);return _0x40cdb6[_0x26e6('0x1e')](_0x26e6('0x1f'),_0x5803bc+'-'+_0x4d63cf+'/'+_0x1f33c2)[_0x26e6('0x19')](_0x2a392f);}return null;};}function patchUpdates(_0x4e6866){return function(_0x46dbdd){try{jsonpatch['apply'](_0x46dbdd,_0x4e6866,!![]);}catch(_0x340cdb){return BPromise[_0x26e6('0x20')](_0x340cdb);}return _0x46dbdd[_0x26e6('0x21')]();};}function saveUpdates(_0x402d58,_0x3c22da){return function(_0x572dc1){if(_0x572dc1){return _0x572dc1['update'](_0x402d58)[_0x26e6('0x22')](function(_0x3c64d3){return _0x3c64d3;});}return null;};}function removeEntity(_0x50066b,_0xbfaa65){return function(_0x1e2c90){if(_0x1e2c90){return _0x1e2c90[_0x26e6('0x23')]()[_0x26e6('0x22')](function(){_0x50066b[_0x26e6('0x17')](0xcc)[_0x26e6('0x18')]();});}};}function handleEntityNotFound(_0x2f8a8e,_0x40eb75){return function(_0x1f66b2){if(!_0x1f66b2){_0x2f8a8e[_0x26e6('0x16')](0x194);}return _0x1f66b2;};}function handleError(_0x24c939,_0x1a79a6){_0x1a79a6=_0x1a79a6||0x1f4;return function(_0x3dc2fc){logger['error'](_0x3dc2fc[_0x26e6('0x24')]);if(_0x3dc2fc[_0x26e6('0x25')]){delete _0x3dc2fc[_0x26e6('0x25')];}_0x24c939[_0x26e6('0x17')](_0x1a79a6)[_0x26e6('0x26')](_0x3dc2fc);};}exports[_0x26e6('0x27')]=function(_0x488a80,_0xa1cf71){var _0x24d6c8={},_0x34be3d={},_0x412c73={'count':0x0,'rows':[]};var _0x2badfd=_[_0x26e6('0x28')](db['Automation'][_0x26e6('0x29')],function(_0x121e20){return{'name':_0x121e20[_0x26e6('0x2a')],'type':_0x121e20[_0x26e6('0x2b')][_0x26e6('0x2c')]};});_0x34be3d[_0x26e6('0x2d')]=_[_0x26e6('0x28')](_0x2badfd,_0x26e6('0x25'));_0x34be3d[_0x26e6('0x2e')]=_['keys'](_0x488a80[_0x26e6('0x2e')]);_0x34be3d['filters']=_[_0x26e6('0x2f')](_0x34be3d[_0x26e6('0x2d')],_0x34be3d[_0x26e6('0x2e')]);_0x24d6c8[_0x26e6('0x30')]=_[_0x26e6('0x2f')](_0x34be3d['model'],qs[_0x26e6('0x31')](_0x488a80[_0x26e6('0x2e')][_0x26e6('0x31')]));_0x24d6c8['attributes']=_0x24d6c8[_0x26e6('0x30')][_0x26e6('0x32')]?_0x24d6c8['attributes']:_0x34be3d['model'];if(!_0x488a80['query'][_0x26e6('0x33')](_0x26e6('0x34'))){_0x24d6c8[_0x26e6('0x1c')]=qs[_0x26e6('0x1c')](_0x488a80[_0x26e6('0x2e')][_0x26e6('0x1c')]);_0x24d6c8[_0x26e6('0x1a')]=qs[_0x26e6('0x1a')](_0x488a80[_0x26e6('0x2e')][_0x26e6('0x1a')]);}_0x24d6c8[_0x26e6('0x35')]=qs[_0x26e6('0x36')](_0x488a80[_0x26e6('0x2e')]['sort']);_0x24d6c8[_0x26e6('0x37')]=qs[_0x26e6('0x38')](_[_0x26e6('0x39')](_0x488a80[_0x26e6('0x2e')],_0x34be3d[_0x26e6('0x38')]),_0x2badfd);if(_0x488a80[_0x26e6('0x2e')][_0x26e6('0x3a')]){_0x24d6c8[_0x26e6('0x37')]=_[_0x26e6('0x3b')](_0x24d6c8[_0x26e6('0x37')],{'$or':_[_0x26e6('0x28')](_0x2badfd,function(_0x255b78){if(_0x255b78[_0x26e6('0x2b')]!==_0x26e6('0x3c')){var _0x216625={};_0x216625[_0x255b78[_0x26e6('0x25')]]={'$like':'%'+_0x488a80['query'][_0x26e6('0x3a')]+'%'};return _0x216625;}})});}_0x24d6c8=_[_0x26e6('0x3b')]({},_0x24d6c8,_0x488a80[_0x26e6('0x3d')]);var _0x5b3107={'where':_0x24d6c8[_0x26e6('0x37')]};return db[_0x26e6('0x3e')][_0x26e6('0x1d')](_0x5b3107)['then'](function(_0x23d398){_0x412c73[_0x26e6('0x1d')]=_0x23d398;if(_0x488a80['query'][_0x26e6('0x3f')]){_0x24d6c8['include']=[{'all':!![]}];}return db['Automation']['findAll'](_0x24d6c8);})[_0x26e6('0x22')](function(_0x38f800){_0x412c73[_0x26e6('0x40')]=_0x38f800;return _0x412c73;})['then'](respondWithFilteredResult(_0xa1cf71,_0x24d6c8))[_0x26e6('0x41')](handleError(_0xa1cf71,null));};exports[_0x26e6('0x42')]=function(_0x5ca5e0,_0x2be949){var _0x2d11f4={'raw':![],'where':{'id':_0x5ca5e0[_0x26e6('0x43')]['id']}},_0x3a6196={};_0x3a6196[_0x26e6('0x2d')]=_[_0x26e6('0x44')](db[_0x26e6('0x3e')][_0x26e6('0x29')]);_0x3a6196[_0x26e6('0x2e')]=_[_0x26e6('0x44')](_0x5ca5e0['query']);_0x3a6196[_0x26e6('0x38')]=_[_0x26e6('0x2f')](_0x3a6196['model'],_0x3a6196['query']);_0x2d11f4[_0x26e6('0x30')]=_[_0x26e6('0x2f')](_0x3a6196[_0x26e6('0x2d')],qs[_0x26e6('0x31')](_0x5ca5e0[_0x26e6('0x2e')][_0x26e6('0x31')]));_0x2d11f4[_0x26e6('0x30')]=_0x2d11f4[_0x26e6('0x30')]['length']?_0x2d11f4['attributes']:_0x3a6196[_0x26e6('0x2d')];if(_0x5ca5e0[_0x26e6('0x2e')]['includeAll']){_0x2d11f4[_0x26e6('0x45')]=[{'all':!![]}];}_0x2d11f4=_[_0x26e6('0x3b')]({},_0x2d11f4,_0x5ca5e0['options']);return db[_0x26e6('0x3e')][_0x26e6('0x46')](_0x2d11f4)['then'](handleEntityNotFound(_0x2be949,null))[_0x26e6('0x22')](respondWithResult(_0x2be949,null))[_0x26e6('0x41')](handleError(_0x2be949,null));};exports['create']=function(_0x2f4e04,_0x390a6a){return db[_0x26e6('0x3e')][_0x26e6('0x47')](_0x2f4e04[_0x26e6('0x48')],{})[_0x26e6('0x22')](respondWithResult(_0x390a6a,0xc9))[_0x26e6('0x41')](handleError(_0x390a6a,null));};exports[_0x26e6('0x49')]=function(_0x363eb1,_0x3ebffb){if(_0x363eb1['body']['id']){delete _0x363eb1[_0x26e6('0x48')]['id'];}return db[_0x26e6('0x3e')]['find']({'where':{'id':_0x363eb1[_0x26e6('0x43')]['id']}})[_0x26e6('0x22')](handleEntityNotFound(_0x3ebffb,null))[_0x26e6('0x22')](saveUpdates(_0x363eb1['body'],null))[_0x26e6('0x22')](respondWithResult(_0x3ebffb,null))[_0x26e6('0x41')](handleError(_0x3ebffb,null));};exports[_0x26e6('0x23')]=function(_0x8ff84c,_0x45597e){return db[_0x26e6('0x3e')]['find']({'where':{'id':_0x8ff84c[_0x26e6('0x43')]['id']}})['then'](handleEntityNotFound(_0x45597e,null))['then'](removeEntity(_0x45597e,null))[_0x26e6('0x41')](handleError(_0x45597e,null));};exports['addConditions']=function(_0xc2075,_0xea10d8,_0x26da72){return db[_0x26e6('0x4a')][_0x26e6('0x46')]({'where':{'id':_0xc2075[_0x26e6('0x43')]['id']}})[_0x26e6('0x22')](handleEntityNotFound(_0xea10d8,null))[_0x26e6('0x22')](function(_0x258408){if(_0x258408){return _0x258408[_0x26e6('0x4b')](_0xc2075[_0x26e6('0x48')][_0x26e6('0x4c')],_[_0x26e6('0x4d')](_0xc2075['body'],[_0x26e6('0x4c'),'id'])||{});}})[_0x26e6('0x22')](respondWithResult(_0xea10d8,null))['catch'](handleError(_0xea10d8,null));};exports[_0x26e6('0x4e')]=function(_0x59bff4,_0x98303a,_0x1b5911){var _0x5440ad={};var _0x591e13={};var _0x1f1c95;var _0x3b1f3e;return db[_0x26e6('0x3e')][_0x26e6('0x4f')]({'where':{'id':_0x59bff4[_0x26e6('0x43')]['id']}})['then'](handleEntityNotFound(_0x98303a,null))[_0x26e6('0x22')](function(_0x4f1435){if(_0x4f1435){_0x1f1c95=_0x4f1435;_0x591e13[_0x26e6('0x2d')]=_[_0x26e6('0x44')](db[_0x26e6('0x4a')][_0x26e6('0x29')]);_0x591e13[_0x26e6('0x2e')]=_[_0x26e6('0x44')](_0x59bff4[_0x26e6('0x2e')]);_0x591e13[_0x26e6('0x38')]=_[_0x26e6('0x2f')](_0x591e13[_0x26e6('0x2d')],_0x591e13[_0x26e6('0x2e')]);_0x5440ad[_0x26e6('0x30')]=_[_0x26e6('0x2f')](_0x591e13['model'],qs[_0x26e6('0x31')](_0x59bff4[_0x26e6('0x2e')][_0x26e6('0x31')]));_0x5440ad[_0x26e6('0x30')]=_0x5440ad['attributes'][_0x26e6('0x32')]?_0x5440ad[_0x26e6('0x30')]:_0x591e13[_0x26e6('0x2d')];_0x5440ad[_0x26e6('0x35')]=qs['sort'](_0x59bff4[_0x26e6('0x2e')][_0x26e6('0x36')]);_0x5440ad[_0x26e6('0x37')]=qs[_0x26e6('0x38')](_[_0x26e6('0x39')](_0x59bff4[_0x26e6('0x2e')],_0x591e13[_0x26e6('0x38')]));if(_0x59bff4[_0x26e6('0x2e')][_0x26e6('0x3a')]){_0x5440ad[_0x26e6('0x37')]=_[_0x26e6('0x3b')](_0x5440ad[_0x26e6('0x37')],{'$or':_[_0x26e6('0x28')](_0x5440ad['attributes'],function(_0x7c371c){var _0x52e5c4={};_0x52e5c4[_0x7c371c]={'$like':'%'+_0x59bff4[_0x26e6('0x2e')][_0x26e6('0x3a')]+'%'};return _0x52e5c4;})});}_0x5440ad=_['merge']({},_0x5440ad,_0x59bff4['options']);return _0x1f1c95[_0x26e6('0x4e')](_0x5440ad);}})[_0x26e6('0x22')](function(_0x211616){if(_0x211616){_0x3b1f3e=_0x211616[_0x26e6('0x32')];if(!_0x59bff4[_0x26e6('0x2e')]['hasOwnProperty'](_0x26e6('0x34'))){_0x5440ad['limit']=qs[_0x26e6('0x1c')](_0x59bff4[_0x26e6('0x2e')][_0x26e6('0x1c')]);_0x5440ad['offset']=qs['offset'](_0x59bff4['query'][_0x26e6('0x1a')]);}return _0x1f1c95[_0x26e6('0x4e')](_0x5440ad);}})[_0x26e6('0x22')](function(_0x44454c){if(_0x44454c){return _0x44454c?{'count':_0x3b1f3e,'rows':_0x44454c}:null;}})['then'](respondWithResult(_0x98303a,null))[_0x26e6('0x41')](handleError(_0x98303a,null));};exports[_0x26e6('0x50')]=function(_0x28ea7d,_0x4497fa,_0xc784a1){return db['Action']['find']({'where':{'id':_0x28ea7d['params']['id']}})[_0x26e6('0x22')](handleEntityNotFound(_0x4497fa,null))[_0x26e6('0x22')](function(_0x58b91b){if(_0x58b91b){return _0x58b91b[_0x26e6('0x50')](_0x28ea7d[_0x26e6('0x48')][_0x26e6('0x4c')],_[_0x26e6('0x4d')](_0x28ea7d[_0x26e6('0x48')],[_0x26e6('0x4c'),'id'])||{});}})[_0x26e6('0x22')](respondWithResult(_0x4497fa,null))['catch'](handleError(_0x4497fa,null));};exports[_0x26e6('0x51')]=function(_0x382327,_0xef93db,_0x4c9ee5){var _0x11d159={};var _0x5bc03e={};var _0x3006d7;var _0x45b5d9;return db['Automation'][_0x26e6('0x4f')]({'where':{'id':_0x382327[_0x26e6('0x43')]['id']}})[_0x26e6('0x22')](handleEntityNotFound(_0xef93db,null))[_0x26e6('0x22')](function(_0x2218f6){if(_0x2218f6){_0x3006d7=_0x2218f6;_0x5bc03e[_0x26e6('0x2d')]=_[_0x26e6('0x44')](db[_0x26e6('0x52')][_0x26e6('0x29')]);_0x5bc03e[_0x26e6('0x2e')]=_[_0x26e6('0x44')](_0x382327[_0x26e6('0x2e')]);_0x5bc03e['filters']=_[_0x26e6('0x2f')](_0x5bc03e[_0x26e6('0x2d')],_0x5bc03e[_0x26e6('0x2e')]);_0x11d159[_0x26e6('0x30')]=_['intersection'](_0x5bc03e[_0x26e6('0x2d')],qs[_0x26e6('0x31')](_0x382327[_0x26e6('0x2e')][_0x26e6('0x31')]));_0x11d159['attributes']=_0x11d159['attributes'][_0x26e6('0x32')]?_0x11d159[_0x26e6('0x30')]:_0x5bc03e[_0x26e6('0x2d')];_0x11d159['order']=qs[_0x26e6('0x36')](_0x382327['query']['sort']);_0x11d159[_0x26e6('0x37')]=qs[_0x26e6('0x38')](_[_0x26e6('0x39')](_0x382327['query'],_0x5bc03e[_0x26e6('0x38')]));if(_0x382327[_0x26e6('0x2e')][_0x26e6('0x3a')]){_0x11d159['where']=_[_0x26e6('0x3b')](_0x11d159['where'],{'$or':_[_0x26e6('0x28')](_0x11d159['attributes'],function(_0x5cc4ee){var _0x518be3={};_0x518be3[_0x5cc4ee]={'$like':'%'+_0x382327[_0x26e6('0x2e')][_0x26e6('0x3a')]+'%'};return _0x518be3;})});}_0x11d159=_[_0x26e6('0x3b')]({},_0x11d159,_0x382327[_0x26e6('0x3d')]);return _0x3006d7[_0x26e6('0x51')](_0x11d159);}})['then'](function(_0x3847e2){if(_0x3847e2){_0x45b5d9=_0x3847e2[_0x26e6('0x32')];if(!_0x382327[_0x26e6('0x2e')][_0x26e6('0x33')](_0x26e6('0x34'))){_0x11d159[_0x26e6('0x1c')]=qs[_0x26e6('0x1c')](_0x382327[_0x26e6('0x2e')][_0x26e6('0x1c')]);_0x11d159[_0x26e6('0x1a')]=qs[_0x26e6('0x1a')](_0x382327[_0x26e6('0x2e')]['offset']);}return _0x3006d7['getActions'](_0x11d159);}})[_0x26e6('0x22')](function(_0x302930){if(_0x302930){return _0x302930?{'count':_0x45b5d9,'rows':_0x302930}:null;}})[_0x26e6('0x22')](respondWithResult(_0xef93db,null))[_0x26e6('0x41')](handleError(_0xef93db,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index f585585..f06be36 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 _0xa2f4=['define','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports'];(function(_0x3658dd,_0xfa5782){var _0x226b60=function(_0x2a792d){while(--_0x2a792d){_0x3658dd['push'](_0x3658dd['shift']());}};_0x226b60(++_0xfa5782);}(_0xa2f4,0xc7));var _0x4a2f=function(_0x552097,_0x225983){_0x552097=_0x552097-0x0;var _0x2a98a0=_0xa2f4[_0x552097];return _0x2a98a0;};'use strict';var _=require(_0x4a2f('0x0'));var util=require(_0x4a2f('0x1'));var logger=require(_0x4a2f('0x2'))(_0x4a2f('0x3'));var moment=require('moment');var BPromise=require(_0x4a2f('0x4'));var rp=require(_0x4a2f('0x5'));var fs=require('fs');var path=require(_0x4a2f('0x6'));var rimraf=require(_0x4a2f('0x7'));var config=require(_0x4a2f('0x8'));var attributes=require(_0x4a2f('0x9'));module[_0x4a2f('0xa')]=function(_0x15319a,_0x2bcf24){return _0x15319a[_0x4a2f('0xb')](_0x4a2f('0xc'),attributes,{'tableName':_0x4a2f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x180f=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util'];(function(_0x30875b,_0x16915f){var _0x29a78a=function(_0x3da822){while(--_0x3da822){_0x30875b['push'](_0x30875b['shift']());}};_0x29a78a(++_0x16915f);}(_0x180f,0x136));var _0xf180=function(_0x2c1e7a,_0x155f86){_0x2c1e7a=_0x2c1e7a-0x0;var _0xcacb4f=_0x180f[_0x2c1e7a];return _0xcacb4f;};'use strict';var _=require(_0xf180('0x0'));var util=require(_0xf180('0x1'));var logger=require(_0xf180('0x2'))('api');var moment=require(_0xf180('0x3'));var BPromise=require(_0xf180('0x4'));var rp=require(_0xf180('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf180('0x6'));var config=require(_0xf180('0x7'));var attributes=require(_0xf180('0x8'));module[_0xf180('0x9')]=function(_0x31f8c0,_0x2fece9){return _0x31f8c0['define'](_0xf180('0xa'),attributes,{'tableName':_0xf180('0xb'),'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 7bccfcf..f8bcf84 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 _0x341c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring'];(function(_0x5e56d4,_0x1edae9){var _0x5c0784=function(_0x516ab1){while(--_0x516ab1){_0x5e56d4['push'](_0x5e56d4['shift']());}};_0x5c0784(++_0x1edae9);}(_0x341c,0xcc));var _0xc341=function(_0x74a76c,_0x87c60d){_0x74a76c=_0x74a76c-0x0;var _0x3d8e25=_0x341c[_0x74a76c];return _0x3d8e25;};'use strict';var _=require(_0xc341('0x0'));var util=require('util');var moment=require(_0xc341('0x1'));var BPromise=require('bluebird');var rs=require(_0xc341('0x2'));var fs=require('fs');var Redis=require(_0xc341('0x3'));var db=require(_0xc341('0x4'))['db'];var utils=require(_0xc341('0x5'));var logger=require(_0xc341('0x6'))(_0xc341('0x7'));var config=require(_0xc341('0x8'));var jayson=require(_0xc341('0x9'));var client=jayson['client'][_0xc341('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13c5b4,_0x296387,_0x31ce96){return new BPromise(function(_0x3e83c9,_0x53aab7){return client[_0xc341('0xb')](_0x13c5b4,_0x31ce96)[_0xc341('0xc')](function(_0x3f08b0){logger[_0xc341('0xd')](_0xc341('0xe'),_0x296387,_0xc341('0xf'));logger['debug'](_0xc341('0x10'),_0x296387,_0xc341('0xf'),JSON[_0xc341('0x11')](_0x3f08b0));if(_0x3f08b0[_0xc341('0x12')]){if(_0x3f08b0[_0xc341('0x12')][_0xc341('0x13')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x296387,_0x3f08b0[_0xc341('0x12')][_0xc341('0x14')]);return _0x53aab7(_0x3f08b0[_0xc341('0x12')][_0xc341('0x14')]);}logger[_0xc341('0x12')]('Automation,\x20%s,\x20%s',_0x296387,_0x3f08b0[_0xc341('0x12')][_0xc341('0x14')]);return _0x3e83c9(_0x3f08b0[_0xc341('0x12')][_0xc341('0x14')]);}else{logger[_0xc341('0xd')](_0xc341('0xe'),_0x296387,_0xc341('0xf'));_0x3e83c9(_0x3f08b0[_0xc341('0x15')][_0xc341('0x14')]);}})[_0xc341('0x16')](function(_0x1d499c){logger['error']('Automation,\x20%s,\x20%s',_0x296387,_0x1d499c);_0x53aab7(_0x1d499c);});});} \ No newline at end of file +var _0xd906=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','moment'];(function(_0x96ad7d,_0x1017ba){var _0x32d63a=function(_0xb47ad9){while(--_0xb47ad9){_0x96ad7d['push'](_0x96ad7d['shift']());}};_0x32d63a(++_0x1017ba);}(_0xd906,0x6b));var _0x6d90=function(_0x4d6049,_0x6fa762){_0x4d6049=_0x4d6049-0x0;var _0x1d4f4c=_0xd906[_0x4d6049];return _0x1d4f4c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6d90('0x0'));var BPromise=require(_0x6d90('0x1'));var rs=require(_0x6d90('0x2'));var fs=require('fs');var Redis=require(_0x6d90('0x3'));var db=require(_0x6d90('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d90('0x5'))(_0x6d90('0x6'));var config=require(_0x6d90('0x7'));var jayson=require(_0x6d90('0x8'));var client=jayson['client'][_0x6d90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19eb61,_0xd120f6,_0x160c7d){return new BPromise(function(_0x219737,_0x5d0ed4){return client['request'](_0x19eb61,_0x160c7d)['then'](function(_0x41c0a3){logger[_0x6d90('0xa')](_0x6d90('0xb'),_0xd120f6,_0x6d90('0xc'));logger[_0x6d90('0xd')](_0x6d90('0xe'),_0xd120f6,_0x6d90('0xc'),JSON['stringify'](_0x41c0a3));if(_0x41c0a3[_0x6d90('0xf')]){if(_0x41c0a3['error'][_0x6d90('0x10')]===0x1f4){logger['error'](_0x6d90('0xb'),_0xd120f6,_0x41c0a3[_0x6d90('0xf')][_0x6d90('0x11')]);return _0x5d0ed4(_0x41c0a3[_0x6d90('0xf')][_0x6d90('0x11')]);}logger[_0x6d90('0xf')](_0x6d90('0xb'),_0xd120f6,_0x41c0a3[_0x6d90('0xf')]['message']);return _0x219737(_0x41c0a3[_0x6d90('0xf')][_0x6d90('0x11')]);}else{logger[_0x6d90('0xa')](_0x6d90('0xb'),_0xd120f6,_0x6d90('0xc'));_0x219737(_0x41c0a3['result'][_0x6d90('0x11')]);}})['catch'](function(_0x379439){logger['error'](_0x6d90('0xb'),_0xd120f6,_0x379439);_0x5d0ed4(_0x379439);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c3ea129..21a5524 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 _0xf041=['post','addConditions','addActions','put','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions'];(function(_0x1c1f17,_0x1cc243){var _0x41aa9f=function(_0x574438){while(--_0x574438){_0x1c1f17['push'](_0x1c1f17['shift']());}};_0x41aa9f(++_0x1cc243);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f04('0x0'));var timeout=require(_0x1f04('0x1'));var express=require(_0x1f04('0x2'));var router=express[_0x1f04('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1f04('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1f04('0x5'));var controller=require('./automation.controller');router['get']('/',auth[_0x1f04('0x6')](),controller['index']);router[_0x1f04('0x7')](_0x1f04('0x8'),auth[_0x1f04('0x6')](),controller[_0x1f04('0x9')]);router['get'](_0x1f04('0xa'),auth[_0x1f04('0x6')](),controller[_0x1f04('0xb')]);router[_0x1f04('0x7')](_0x1f04('0xc'),auth[_0x1f04('0x6')](),controller[_0x1f04('0xd')]);router[_0x1f04('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1f04('0xe')](_0x1f04('0xa'),auth[_0x1f04('0x6')](),controller[_0x1f04('0xf')]);router[_0x1f04('0xe')](_0x1f04('0xc'),auth[_0x1f04('0x6')](),controller[_0x1f04('0x10')]);router[_0x1f04('0x11')](_0x1f04('0x8'),auth[_0x1f04('0x6')](),controller['update']);router['delete'](_0x1f04('0x8'),auth[_0x1f04('0x6')](),controller[_0x1f04('0x12')]);module['exports']=router; \ No newline at end of file +var _0x746f=['isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0x54d49e,_0x5d9911){var _0x4af0f1=function(_0xf117b3){while(--_0xf117b3){_0x54d49e['push'](_0x54d49e['shift']());}};_0x4af0f1(++_0x5d9911);}(_0x746f,0x9c));var _0xf746=function(_0x415960,_0x19ff07){_0x415960=_0x415960-0x0;var _0x1abd2c=_0x746f[_0x415960];return _0x1abd2c;};'use strict';var multer=require(_0xf746('0x0'));var util=require(_0xf746('0x1'));var path=require(_0xf746('0x2'));var timeout=require(_0xf746('0x3'));var express=require(_0xf746('0x4'));var router=express[_0xf746('0x5')]();var fs_extra=require(_0xf746('0x6'));var auth=require(_0xf746('0x7'));var interaction=require(_0xf746('0x8'));var config=require(_0xf746('0x9'));var controller=require(_0xf746('0xa'));router[_0xf746('0xb')]('/',auth[_0xf746('0xc')](),controller[_0xf746('0xd')]);router[_0xf746('0xb')](_0xf746('0xe'),auth[_0xf746('0xc')](),controller[_0xf746('0xf')]);router[_0xf746('0xb')](_0xf746('0x10'),auth[_0xf746('0xc')](),controller[_0xf746('0x11')]);router[_0xf746('0xb')](_0xf746('0x12'),auth[_0xf746('0xc')](),controller['getActions']);router[_0xf746('0x13')]('/',auth[_0xf746('0xc')](),controller[_0xf746('0x14')]);router['post'](_0xf746('0x10'),auth['isAuthenticated'](),controller[_0xf746('0x15')]);router[_0xf746('0x13')](_0xf746('0x12'),auth[_0xf746('0xc')](),controller[_0xf746('0x16')]);router[_0xf746('0x17')]('/:id',auth[_0xf746('0xc')](),controller[_0xf746('0x18')]);router[_0xf746('0x19')]('/:id',auth[_0xf746('0xc')](),controller[_0xf746('0x1a')]);module[_0xf746('0x1b')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 91e028a..02c5325 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 _0xeb7c=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\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)','sequelize','STRING','name','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','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,*,*,*','ENUM','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting'];(function(_0x663a3b,_0x551af3){var _0x5b6211=function(_0x540053){while(--_0x540053){_0x663a3b['push'](_0x663a3b['shift']());}};_0x5b6211(++_0x551af3);}(_0xeb7c,0x10c));var _0xceb7=function(_0x5c1c13,_0x223388){_0x5c1c13=_0x5c1c13-0x0;var _0x4d9e2f=_0xeb7c[_0x5c1c13];return _0x4d9e2f;};'use strict';var Sequelize=require(_0xceb7('0x0'));module['exports']={'name':{'type':Sequelize[_0xceb7('0x1')],'unique':_0xceb7('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xceb7('0x1')]},'active':{'type':Sequelize[_0xceb7('0x3')],'defaultValue':0x0,'comment':_0xceb7('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xceb7('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb7('0x6')},'dialCongestionMaxRetry':{'type':Sequelize[_0xceb7('0x7')](0x3)[_0xceb7('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xceb7('0x7')](0x5)[_0xceb7('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb7('0x8')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceb7('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb7('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0xceb7('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb7('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xceb7('0x7')](0x3)[_0xceb7('0x5')],'defaultValue':0x3,'comment':_0xceb7('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xceb7('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb7('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xceb7('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xceb7('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xceb7('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xceb7('0xf')](_0xceb7('0x10'),_0xceb7('0x11'),'onlyIfOpen'),'defaultValue':_0xceb7('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xceb7('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xceb7('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xceb7('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xceb7('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xceb7('0x7')](0x9)[_0xceb7('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xceb7('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceb7('0x14')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xceb7('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xceb7('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xceb7('0x7')](0x9)[_0xceb7('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xceb7('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xceb7('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xceb7('0x7')](0x5)[_0xceb7('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xceb7('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceb7('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0xceb7('0xf')]('DESC',_0xceb7('0x18')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xceb7('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xceb7('0x7')](0x3)[_0xceb7('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xceb7('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceb7('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb7('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xceb7('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb7('0x1a')},'dialDropMaxRetry':{'type':Sequelize[_0xceb7('0x7')](0x3)[_0xceb7('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xceb7('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xceb7('0x7')](0x3)[_0xceb7('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb7('0x1b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xceb7('0x7')](0x5)[_0xceb7('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xceb7('0x7')](0x3)[_0xceb7('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb7('0x1c')},'dialMachineRetryFrequency':{'type':Sequelize[_0xceb7('0x7')](0x5)[_0xceb7('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb7('0x1d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xceb7('0x7')](0x3)[_0xceb7('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb7('0x1e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xceb7('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb7('0x1f')}}; \ No newline at end of file +var _0x4cba=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x41eda4,_0x453462){var _0x1d0189=function(_0x299c41){while(--_0x299c41){_0x41eda4['push'](_0x41eda4['shift']());}};_0x1d0189(++_0x453462);}(_0x4cba,0x119));var _0xa4cb=function(_0x3d7183,_0x319b5f){_0x3d7183=_0x3d7183-0x0;var _0x5419ae=_0x4cba[_0x3d7183];return _0x5419ae;};'use strict';var Sequelize=require('sequelize');module[_0xa4cb('0x0')]={'name':{'type':Sequelize[_0xa4cb('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa4cb('0x2')](_0xa4cb('0x3')),'allowNull':![],'defaultValue':_0xa4cb('0x3')},'description':{'type':Sequelize[_0xa4cb('0x1')]},'active':{'type':Sequelize[_0xa4cb('0x4')],'defaultValue':0x0,'comment':_0xa4cb('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xa4cb('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa4cb('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa4cb('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa4cb('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xa4cb('0x8')](0x3)[_0xa4cb('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4cb('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa4cb('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4cb('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa4cb('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4cb('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xa4cb('0x8')](0x3)[_0xa4cb('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4cb('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa4cb('0x8')](0x5)[_0xa4cb('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4cb('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa4cb('0x8')](0x3)[_0xa4cb('0x6')],'defaultValue':0x3,'comment':_0xa4cb('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa4cb('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4cb('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa4cb('0x8')](0x3)[_0xa4cb('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa4cb('0x10')},'dialTimezone':{'type':Sequelize[_0xa4cb('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa4cb('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xa4cb('0x2')](_0xa4cb('0x11'),_0xa4cb('0x12'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa4cb('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xa4cb('0x8')](0x9)[_0xa4cb('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa4cb('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xa4cb('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa4cb('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa4cb('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa4cb('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xa4cb('0x8')](0x9)[_0xa4cb('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa4cb('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa4cb('0x8')](0x9)[_0xa4cb('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa4cb('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa4cb('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa4cb('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa4cb('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa4cb('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa4cb('0x2')](_0xa4cb('0x19'),_0xa4cb('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xa4cb('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa4cb('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa4cb('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa4cb('0x8')](0x3)[_0xa4cb('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa4cb('0x8')](0x5)[_0xa4cb('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4cb('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0xa4cb('0x8')](0x3)[_0xa4cb('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4cb('0x1d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa4cb('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa4cb('0x8')](0x3)[_0xa4cb('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4cb('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa4cb('0x8')](0x5)[_0xa4cb('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4cb('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0xa4cb('0x8')](0x3)[_0xa4cb('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4cb('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa4cb('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa4cb('0x8')](0x3)[_0xa4cb('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4cb('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa4cb('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4cb('0x22')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index b03b105..245c96b 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 _0x32f6=['all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','Campaign','rawAttributes','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','merge','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','userProfileId','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','field','ListId\x20=\x20?','CmListId','toString','phone\x20IS\x20NOT\x20NULL','from','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','sequelize'];(function(_0x19da38,_0xc24ab4){var _0x4e63ee=function(_0x201ae9){while(--_0x201ae9){_0x19da38['push'](_0x19da38['shift']());}};_0x4e63ee(++_0xc24ab4);}(_0x32f6,0x118));var _0x632f=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x32f6[_0x12f688];return _0x59c3de;};'use strict';var emlformat=require(_0x632f('0x0'));var rimraf=require(_0x632f('0x1'));var zipdir=require(_0x632f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x632f('0x3'));var BPromise=require(_0x632f('0x4'));var Mustache=require(_0x632f('0x5'));var util=require(_0x632f('0x6'));var path=require('path');var sox=require(_0x632f('0x7'));var csv=require(_0x632f('0x8'));var ejs=require(_0x632f('0x9'));var fs=require('fs');var fs_extra=require(_0x632f('0xa'));var _=require(_0x632f('0xb'));var squel=require(_0x632f('0xc'));var crypto=require(_0x632f('0xd'));var jsforce=require(_0x632f('0xe'));var deskjs=require(_0x632f('0xf'));var toCsv=require(_0x632f('0x8'));var querystring=require(_0x632f('0x10'));var Papa=require(_0x632f('0x11'));var Redis=require(_0x632f('0x12'));var authService=require(_0x632f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x632f('0x14'));var hardwareService=require(_0x632f('0x15'));var logger=require('../../config/logger')(_0x632f('0x16'));var utils=require(_0x632f('0x17'));var config=require(_0x632f('0x18'));var licenseUtil=require(_0x632f('0x19'));var db=require(_0x632f('0x1a'))['db'];function respondWithStatusCode(_0x2612a1,_0x1da8be){_0x1da8be=_0x1da8be||0xcc;return function(_0x438d9e){if(_0x438d9e){return _0x2612a1[_0x632f('0x1b')](_0x1da8be);}return _0x2612a1[_0x632f('0x1c')](_0x1da8be)[_0x632f('0x1d')]();};}function respondWithResult(_0x5e1e1c,_0x223e04){_0x223e04=_0x223e04||0xc8;return function(_0x5b3023){if(_0x5b3023){return _0x5e1e1c[_0x632f('0x1c')](_0x223e04)['json'](_0x5b3023);}};}function respondWithFilteredResult(_0x289bba,_0x149479){return function(_0xccbf66){if(_0xccbf66){var _0x1870e4=typeof _0x149479[_0x632f('0x1e')]==='undefined'&&typeof _0x149479[_0x632f('0x1f')]===_0x632f('0x20');var _0x5278c4=_0xccbf66[_0x632f('0x21')];var _0x4724fe=_0x1870e4?0x0:_0x149479[_0x632f('0x1e')];var _0x19dc71=_0x1870e4?_0xccbf66[_0x632f('0x21')]:_0x149479[_0x632f('0x1e')]+_0x149479[_0x632f('0x1f')];var _0x78f376;if(_0x19dc71>=_0x5278c4){_0x19dc71=_0x5278c4;_0x78f376=0xc8;}else{_0x78f376=0xce;}_0x289bba[_0x632f('0x1c')](_0x78f376);return _0x289bba[_0x632f('0x22')]('Content-Range',_0x4724fe+'-'+_0x19dc71+'/'+_0x5278c4)[_0x632f('0x23')](_0xccbf66);}return null;};}function patchUpdates(_0x11de97){return function(_0x4b662d){try{jsonpatch[_0x632f('0x24')](_0x4b662d,_0x11de97,!![]);}catch(_0x3d747f){return BPromise[_0x632f('0x25')](_0x3d747f);}return _0x4b662d[_0x632f('0x26')]();};}function saveUpdates(_0x28d854,_0x1734d0){return function(_0x7fed67){if(_0x7fed67){return _0x7fed67[_0x632f('0x27')](_0x28d854)[_0x632f('0x28')](function(_0x596c63){return _0x596c63;});}return null;};}function removeEntity(_0x1feb2c,_0x22bd47){return function(_0x442f1b){if(_0x442f1b){return _0x442f1b['destroy']()[_0x632f('0x28')](function(){var _0x36ce49=_0x442f1b[_0x632f('0x29')]({'plain':!![]});var _0x52088c=_0x632f('0x2a');return db[_0x632f('0x2b')][_0x632f('0x2c')]({'where':{'type':_0x52088c,'resourceId':_0x36ce49['id']}})[_0x632f('0x28')](function(){return _0x442f1b;});})['then'](function(){_0x1feb2c[_0x632f('0x1c')](0xcc)[_0x632f('0x1d')]();});}};}function handleEntityNotFound(_0x3c09c4,_0x3c74b1){return function(_0x3947bb){if(!_0x3947bb){_0x3c09c4['sendStatus'](0x194);}return _0x3947bb;};}function handleError(_0x47dc58,_0x1751e7){_0x1751e7=_0x1751e7||0x1f4;return function(_0x4f084c){logger[_0x632f('0x2d')](_0x4f084c[_0x632f('0x2e')]);if(_0x4f084c[_0x632f('0x2f')]){delete _0x4f084c[_0x632f('0x2f')];}_0x47dc58[_0x632f('0x1c')](_0x1751e7)[_0x632f('0x30')](_0x4f084c);};}exports[_0x632f('0x31')]=function(_0x5ee770,_0x530c53){var _0x2e5584={},_0x11e903={},_0x1ffcab={'count':0x0,'rows':[]};var _0x2bbd55=_['map'](db[_0x632f('0x32')][_0x632f('0x33')],function(_0x16548b){return{'name':_0x16548b['fieldName'],'type':_0x16548b['type']['key']};});_0x11e903[_0x632f('0x34')]=_[_0x632f('0x35')](_0x2bbd55,_0x632f('0x2f'));_0x11e903[_0x632f('0x36')]=_['keys'](_0x5ee770[_0x632f('0x36')]);_0x11e903['filters']=_['intersection'](_0x11e903[_0x632f('0x34')],_0x11e903['query']);_0x2e5584[_0x632f('0x37')]=_[_0x632f('0x38')](_0x11e903[_0x632f('0x34')],qs['fields'](_0x5ee770['query'][_0x632f('0x39')]));_0x2e5584[_0x632f('0x37')]=_0x2e5584[_0x632f('0x37')][_0x632f('0x3a')]?_0x2e5584[_0x632f('0x37')]:_0x11e903[_0x632f('0x34')];if(!_0x5ee770[_0x632f('0x36')][_0x632f('0x3b')](_0x632f('0x3c'))){_0x2e5584[_0x632f('0x1f')]=qs['limit'](_0x5ee770['query'][_0x632f('0x1f')]);_0x2e5584[_0x632f('0x1e')]=qs[_0x632f('0x1e')](_0x5ee770[_0x632f('0x36')][_0x632f('0x1e')]);}_0x2e5584[_0x632f('0x3d')]=qs[_0x632f('0x3e')](_0x5ee770['query']['sort']);_0x2e5584[_0x632f('0x3f')]=qs[_0x632f('0x40')](_[_0x632f('0x41')](_0x5ee770[_0x632f('0x36')],_0x11e903[_0x632f('0x40')]),_0x2bbd55);if(_0x5ee770[_0x632f('0x36')][_0x632f('0x42')]){_0x2e5584['where']=_['merge'](_0x2e5584['where'],{'$or':_[_0x632f('0x35')](_0x2bbd55,function(_0x302161){if(_0x302161[_0x632f('0x43')]!=='VIRTUAL'){var _0x2f43bb={};_0x2f43bb[_0x302161[_0x632f('0x2f')]]={'$like':'%'+_0x5ee770[_0x632f('0x36')][_0x632f('0x42')]+'%'};return _0x2f43bb;}})});}_0x2e5584=_[_0x632f('0x44')]({},_0x2e5584,_0x5ee770['options']);var _0x467510={'where':_0x2e5584['where']};return db[_0x632f('0x32')][_0x632f('0x21')](_0x467510)[_0x632f('0x28')](function(_0x5ef581){_0x1ffcab[_0x632f('0x21')]=_0x5ef581;if(_0x5ee770[_0x632f('0x36')][_0x632f('0x45')]){_0x2e5584[_0x632f('0x46')]=[{'all':!![]}];}return db[_0x632f('0x32')][_0x632f('0x47')](_0x2e5584);})[_0x632f('0x28')](function(_0x255f70){_0x1ffcab[_0x632f('0x48')]=_0x255f70;return _0x1ffcab;})[_0x632f('0x28')](respondWithFilteredResult(_0x530c53,_0x2e5584))[_0x632f('0x49')](handleError(_0x530c53,null));};exports['show']=function(_0x657179,_0x257bea){var _0xb55e1={'raw':![],'where':{'id':_0x657179[_0x632f('0x4a')]['id']}},_0x989da5={};_0x989da5['model']=_['keys'](db[_0x632f('0x32')][_0x632f('0x33')]);_0x989da5[_0x632f('0x36')]=_[_0x632f('0x4b')](_0x657179[_0x632f('0x36')]);_0x989da5[_0x632f('0x40')]=_['intersection'](_0x989da5[_0x632f('0x34')],_0x989da5['query']);_0xb55e1[_0x632f('0x37')]=_[_0x632f('0x38')](_0x989da5['model'],qs['fields'](_0x657179[_0x632f('0x36')][_0x632f('0x39')]));_0xb55e1['attributes']=_0xb55e1['attributes']['length']?_0xb55e1['attributes']:_0x989da5[_0x632f('0x34')];if(_0x657179[_0x632f('0x36')][_0x632f('0x45')]){_0xb55e1[_0x632f('0x46')]=[{'all':!![]}];}_0xb55e1=_['merge']({},_0xb55e1,_0x657179[_0x632f('0x4c')]);return db[_0x632f('0x32')][_0x632f('0x4d')](_0xb55e1)['then'](handleEntityNotFound(_0x257bea,null))[_0x632f('0x28')](respondWithResult(_0x257bea,null))[_0x632f('0x49')](handleError(_0x257bea,null));};exports[_0x632f('0x4e')]=function(_0x25ebff,_0x1cdfbe){return db[_0x632f('0x32')][_0x632f('0x4e')](_0x25ebff[_0x632f('0x4f')],{})[_0x632f('0x28')](function(_0x558241){var _0x441d3d=_0x25ebff[_0x632f('0x50')][_0x632f('0x29')]({'plain':!![]});if(!_0x441d3d)throw new Error(_0x632f('0x51'));if(_0x441d3d['role']===_0x632f('0x50')){var _0x10dc62=_0x558241[_0x632f('0x29')]({'plain':!![]});var _0xf8107f=_0x632f('0x2a');return db[_0x632f('0x52')][_0x632f('0x4d')]({'where':{'name':_0xf8107f,'userProfileId':_0x441d3d['userProfileId']},'raw':!![]})['then'](function(_0x34224c){if(_0x34224c&&_0x34224c[_0x632f('0x53')]===0x0){return db[_0x632f('0x2b')][_0x632f('0x4e')]({'name':_0x10dc62[_0x632f('0x2f')],'resourceId':_0x10dc62['id'],'type':_0x34224c['name'],'sectionId':_0x34224c['id']},{})[_0x632f('0x28')](function(){return _0x558241;});}else{return _0x558241;}})[_0x632f('0x49')](function(_0x172190){logger[_0x632f('0x2d')](_0x632f('0x54'),_0x172190);throw _0x172190;});}return _0x558241;})[_0x632f('0x28')](respondWithResult(_0x1cdfbe,0xc9))[_0x632f('0x49')](handleError(_0x1cdfbe,null));};exports['clone']=function(_0x51f698,_0x422d01){var _0x3847c7={'where':{'id':_0x51f698[_0x632f('0x4a')]['id']}},_0x1ca6d4={};_0x1ca6d4['model']=_['keys'](db[_0x632f('0x32')]['rawAttributes']);_0x3847c7['attributes']=_[_0x632f('0x38')](_0x1ca6d4[_0x632f('0x34')],qs['fields'](_0x51f698[_0x632f('0x36')][_0x632f('0x39')]));_0x3847c7[_0x632f('0x37')]=_0x3847c7[_0x632f('0x37')][_0x632f('0x3a')]?_0x3847c7[_0x632f('0x37')]:_0x1ca6d4[_0x632f('0x34')];if(_0x51f698[_0x632f('0x36')][_0x632f('0x45')]){_0x3847c7['include']=[{'all':!![]}];}_0x3847c7=_[_0x632f('0x44')]({},_0x3847c7,_0x51f698[_0x632f('0x4c')]);return db[_0x632f('0x32')][_0x632f('0x4d')](_0x3847c7)[_0x632f('0x28')](handleEntityNotFound(_0x422d01,null))[_0x632f('0x28')](function(_0x118aa0){if(_0x118aa0){var _0x48cd18=_0x118aa0[_0x632f('0x29')]({'plain':!![]});_0x48cd18=qs[_0x632f('0x55')](_0x48cd18,['id',_0x632f('0x56'),_0x632f('0x57')]);_0x51f698[_0x632f('0x4f')]=_[_0x632f('0x55')](_0x51f698[_0x632f('0x4f')],['id',_0x632f('0x56'),_0x632f('0x57')]);return db['Campaign'][_0x632f('0x4e')](_[_0x632f('0x44')](_0x48cd18,_0x51f698[_0x632f('0x4f')]),{'include':_0x51f698['query'][_0x632f('0x45')]?[{'all':!![]}]:undefined})[_0x632f('0x28')](function(_0x3fba20){var _0x1122eb=_0x51f698[_0x632f('0x50')][_0x632f('0x29')]({'plain':!![]});if(!_0x1122eb)throw new Error(_0x632f('0x51'));if(_0x1122eb['role']===_0x632f('0x50')){var _0x219828=_0x3fba20['get']({'plain':!![]});var _0x298372='IvrCampaigns';return db[_0x632f('0x52')]['find']({'where':{'name':_0x298372,'userProfileId':_0x1122eb[_0x632f('0x58')]},'raw':!![]})['then'](function(_0xc9088c){if(_0xc9088c&&_0xc9088c['autoAssociation']===0x0){return db[_0x632f('0x2b')]['create']({'name':_0x219828[_0x632f('0x2f')],'resourceId':_0x219828['id'],'type':_0xc9088c[_0x632f('0x2f')],'sectionId':_0xc9088c['id']},{})[_0x632f('0x28')](function(){return _0x3fba20;});}else{return _0x3fba20;}})[_0x632f('0x49')](function(_0x47483b){logger[_0x632f('0x2d')](_0x632f('0x54'),_0x47483b);throw _0x47483b;});}return _0x3fba20;});}})[_0x632f('0x28')](respondWithResult(_0x422d01,0xc9))[_0x632f('0x49')](handleError(_0x422d01,null));};exports[_0x632f('0x27')]=function(_0xfb72ab,_0x4a9932){if(_0xfb72ab[_0x632f('0x4f')]['id']){delete _0xfb72ab[_0x632f('0x4f')]['id'];}return db[_0x632f('0x32')][_0x632f('0x4d')]({'where':{'id':_0xfb72ab[_0x632f('0x4a')]['id']}})[_0x632f('0x28')](handleEntityNotFound(_0x4a9932,null))[_0x632f('0x28')](saveUpdates(_0xfb72ab[_0x632f('0x4f')],null))[_0x632f('0x28')](respondWithResult(_0x4a9932,null))[_0x632f('0x49')](handleError(_0x4a9932,null));};exports['destroy']=function(_0x48c38e,_0x43feff){return db['Campaign'][_0x632f('0x4d')]({'where':{'id':_0x48c38e[_0x632f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x43feff,null))[_0x632f('0x28')](removeEntity(_0x43feff,null))[_0x632f('0x49')](handleError(_0x43feff,null));};exports[_0x632f('0x59')]=function(_0x1b95d7,_0x547b8a,_0x27684a){var _0x442285={'raw':!![],'where':{}};var _0x23a95f={};var _0x1e5d9e={'count':0x0,'rows':[]};return db[_0x632f('0x32')][_0x632f('0x5a')]({'where':{'id':_0x1b95d7['params']['id']}})[_0x632f('0x28')](handleEntityNotFound(_0x547b8a,null))[_0x632f('0x28')](function(_0x370c29){if(_0x370c29){_0x23a95f[_0x632f('0x34')]=_['keys'](db['CmHopper'][_0x632f('0x33')]);_0x23a95f[_0x632f('0x36')]=_['keys'](_0x1b95d7['query']);_0x23a95f[_0x632f('0x40')]=_['intersection'](_0x23a95f[_0x632f('0x34')],_0x23a95f[_0x632f('0x36')]);_0x442285[_0x632f('0x37')]=_[_0x632f('0x38')](_0x23a95f[_0x632f('0x34')],qs['fields'](_0x1b95d7[_0x632f('0x36')][_0x632f('0x39')]));_0x442285['attributes']=_0x442285[_0x632f('0x37')][_0x632f('0x3a')]?_0x442285[_0x632f('0x37')]:_0x23a95f[_0x632f('0x34')];if(!_0x1b95d7[_0x632f('0x36')][_0x632f('0x3b')](_0x632f('0x3c'))){_0x442285['limit']=qs[_0x632f('0x1f')](_0x1b95d7[_0x632f('0x36')][_0x632f('0x1f')]);_0x442285[_0x632f('0x1e')]=qs[_0x632f('0x1e')](_0x1b95d7[_0x632f('0x36')]['offset']);}_0x442285[_0x632f('0x3d')]=qs[_0x632f('0x3e')](_0x1b95d7['query'][_0x632f('0x3e')]);_0x442285[_0x632f('0x3f')]=qs[_0x632f('0x40')](_[_0x632f('0x41')](_0x1b95d7['query'],_0x23a95f[_0x632f('0x40')]));_0x442285['where'][_0x632f('0x5b')]=_0x370c29['id'];if(_0x1b95d7[_0x632f('0x36')][_0x632f('0x42')]){_0x442285[_0x632f('0x3f')]=_[_0x632f('0x44')](_0x442285[_0x632f('0x3f')],{'$or':_[_0x632f('0x35')](_0x442285[_0x632f('0x37')],function(_0x58d53f){var _0x366d94={};_0x366d94[_0x58d53f]={'$like':'%'+_0x1b95d7[_0x632f('0x36')][_0x632f('0x42')]+'%'};return _0x366d94;})});}_0x442285=_[_0x632f('0x44')]({},_0x442285,_0x1b95d7[_0x632f('0x4c')]);return db['CmHopper']['count']({'where':_0x442285['where']})[_0x632f('0x28')](function(_0x2281cf){_0x1e5d9e['count']=_0x2281cf;if(_0x1b95d7[_0x632f('0x36')][_0x632f('0x45')]){_0x442285['include']=[{'all':!![]}];}return db[_0x632f('0x5c')][_0x632f('0x47')](_0x442285);})[_0x632f('0x28')](function(_0x18af02){_0x1e5d9e[_0x632f('0x48')]=_0x18af02;return _0x1e5d9e;});}})[_0x632f('0x28')](respondWithFilteredResult(_0x547b8a,_0x442285))[_0x632f('0x49')](handleError(_0x547b8a,null));};exports[_0x632f('0x5d')]=function(_0x17912d,_0x2963ca,_0x40ece3){var _0x1045f4={'raw':!![],'where':{}};var _0x4affab={};var _0x432d29={'count':0x0,'rows':[]};return db[_0x632f('0x32')][_0x632f('0x5a')]({'where':{'id':_0x17912d[_0x632f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2963ca,null))[_0x632f('0x28')](function(_0x43f606){if(_0x43f606){_0x4affab[_0x632f('0x34')]=_[_0x632f('0x4b')](db[_0x632f('0x5e')][_0x632f('0x33')]);_0x4affab['query']=_['keys'](_0x17912d[_0x632f('0x36')]);_0x4affab[_0x632f('0x40')]=_[_0x632f('0x38')](_0x4affab[_0x632f('0x34')],_0x4affab[_0x632f('0x36')]);_0x1045f4[_0x632f('0x37')]=_[_0x632f('0x38')](_0x4affab['model'],qs[_0x632f('0x39')](_0x17912d[_0x632f('0x36')][_0x632f('0x39')]));_0x1045f4[_0x632f('0x37')]=_0x1045f4[_0x632f('0x37')][_0x632f('0x3a')]?_0x1045f4[_0x632f('0x37')]:_0x4affab['model'];if(!_0x17912d[_0x632f('0x36')]['hasOwnProperty']('nolimit')){_0x1045f4[_0x632f('0x1f')]=qs[_0x632f('0x1f')](_0x17912d[_0x632f('0x36')][_0x632f('0x1f')]);_0x1045f4[_0x632f('0x1e')]=qs[_0x632f('0x1e')](_0x17912d[_0x632f('0x36')][_0x632f('0x1e')]);}_0x1045f4['order']=qs[_0x632f('0x3e')](_0x17912d[_0x632f('0x36')][_0x632f('0x3e')]);_0x1045f4[_0x632f('0x3f')]=qs[_0x632f('0x40')](_[_0x632f('0x41')](_0x17912d[_0x632f('0x36')],_0x4affab[_0x632f('0x40')]));_0x1045f4[_0x632f('0x3f')][_0x632f('0x5b')]=_0x43f606['id'];if(_0x17912d['query'][_0x632f('0x42')]){_0x1045f4['where']=_[_0x632f('0x44')](_0x1045f4[_0x632f('0x3f')],{'$or':_['map'](_0x1045f4['attributes'],function(_0x78af24){var _0x4a0c95={};_0x4a0c95[_0x78af24]={'$like':'%'+_0x17912d[_0x632f('0x36')][_0x632f('0x42')]+'%'};return _0x4a0c95;})});}_0x1045f4=_['merge']({},_0x1045f4,_0x17912d[_0x632f('0x4c')]);return db['CmHopperHistory'][_0x632f('0x21')]({'where':_0x1045f4[_0x632f('0x3f')]})[_0x632f('0x28')](function(_0x38f32e){_0x432d29[_0x632f('0x21')]=_0x38f32e;if(_0x17912d[_0x632f('0x36')][_0x632f('0x45')]){_0x1045f4[_0x632f('0x46')]=[{'all':!![]}];}return db[_0x632f('0x5e')][_0x632f('0x47')](_0x1045f4);})['then'](function(_0x46d69c){_0x432d29['rows']=_0x46d69c;return _0x432d29;});}})[_0x632f('0x28')](respondWithFilteredResult(_0x2963ca,_0x1045f4))[_0x632f('0x49')](handleError(_0x2963ca,null));};exports[_0x632f('0x5f')]=function(_0x3cbd3e,_0xa15cc1,_0x2f952f){var _0x760e9f={'raw':!![],'where':{}};var _0x7e3eb={};var _0x400397={'count':0x0,'rows':[]};return db[_0x632f('0x32')]['findOne']({'where':{'id':_0x3cbd3e[_0x632f('0x4a')]['id']}})[_0x632f('0x28')](handleEntityNotFound(_0xa15cc1,null))[_0x632f('0x28')](function(_0x283c67){if(_0x283c67){_0x7e3eb['model']=_[_0x632f('0x4b')](db[_0x632f('0x60')][_0x632f('0x33')]);_0x7e3eb[_0x632f('0x36')]=_[_0x632f('0x4b')](_0x3cbd3e[_0x632f('0x36')]);_0x7e3eb['filters']=_['intersection'](_0x7e3eb[_0x632f('0x34')],_0x7e3eb[_0x632f('0x36')]);_0x760e9f[_0x632f('0x37')]=_['intersection'](_0x7e3eb['model'],qs[_0x632f('0x39')](_0x3cbd3e[_0x632f('0x36')][_0x632f('0x39')]));_0x760e9f[_0x632f('0x37')]=_0x760e9f[_0x632f('0x37')][_0x632f('0x3a')]?_0x760e9f['attributes']:_0x7e3eb[_0x632f('0x34')];if(!_0x3cbd3e[_0x632f('0x36')]['hasOwnProperty'](_0x632f('0x3c'))){_0x760e9f[_0x632f('0x1f')]=qs[_0x632f('0x1f')](_0x3cbd3e[_0x632f('0x36')][_0x632f('0x1f')]);_0x760e9f[_0x632f('0x1e')]=qs[_0x632f('0x1e')](_0x3cbd3e[_0x632f('0x36')][_0x632f('0x1e')]);}_0x760e9f[_0x632f('0x3d')]=qs[_0x632f('0x3e')](_0x3cbd3e['query'][_0x632f('0x3e')]);_0x760e9f['where']=qs[_0x632f('0x40')](_['pick'](_0x3cbd3e[_0x632f('0x36')],_0x7e3eb[_0x632f('0x40')]));_0x760e9f['where']['CampaignId']=_0x283c67['id'];if(_0x3cbd3e[_0x632f('0x36')][_0x632f('0x42')]){_0x760e9f[_0x632f('0x3f')]=_['merge'](_0x760e9f[_0x632f('0x3f')],{'$or':_[_0x632f('0x35')](_0x760e9f['attributes'],function(_0x51d816){var _0xe89187={};_0xe89187[_0x51d816]={'$like':'%'+_0x3cbd3e[_0x632f('0x36')]['filter']+'%'};return _0xe89187;})});}_0x760e9f=_['merge']({},_0x760e9f,_0x3cbd3e['options']);return db[_0x632f('0x60')][_0x632f('0x21')]({'where':_0x760e9f[_0x632f('0x3f')]})[_0x632f('0x28')](function(_0x1605bb){_0x400397[_0x632f('0x21')]=_0x1605bb;if(_0x3cbd3e['query'][_0x632f('0x45')]){_0x760e9f[_0x632f('0x46')]=[{'all':!![]}];}return db[_0x632f('0x60')][_0x632f('0x47')](_0x760e9f);})['then'](function(_0x14ae55){_0x400397[_0x632f('0x48')]=_0x14ae55;return _0x400397;});}})[_0x632f('0x28')](respondWithFilteredResult(_0xa15cc1,_0x760e9f))['catch'](handleError(_0xa15cc1,null));};exports[_0x632f('0x61')]=function(_0x5bd218,_0x5ad1d6,_0x259286){var _0x2ad039={'raw':!![],'where':{}};var _0x59dd60={};var _0x3665a3={'count':0x0,'rows':[]};return db[_0x632f('0x32')][_0x632f('0x5a')]({'where':{'id':_0x5bd218['params']['id']}})[_0x632f('0x28')](handleEntityNotFound(_0x5ad1d6,null))[_0x632f('0x28')](function(_0x1c336d){if(_0x1c336d){_0x59dd60[_0x632f('0x34')]=_['keys'](db[_0x632f('0x62')][_0x632f('0x33')]);_0x59dd60[_0x632f('0x36')]=_[_0x632f('0x4b')](_0x5bd218[_0x632f('0x36')]);_0x59dd60[_0x632f('0x40')]=_[_0x632f('0x38')](_0x59dd60[_0x632f('0x34')],_0x59dd60[_0x632f('0x36')]);_0x2ad039[_0x632f('0x37')]=_[_0x632f('0x38')](_0x59dd60[_0x632f('0x34')],qs['fields'](_0x5bd218[_0x632f('0x36')]['fields']));_0x2ad039[_0x632f('0x37')]=_0x2ad039[_0x632f('0x37')][_0x632f('0x3a')]?_0x2ad039[_0x632f('0x37')]:_0x59dd60['model'];if(!_0x5bd218[_0x632f('0x36')][_0x632f('0x3b')](_0x632f('0x3c'))){_0x2ad039['limit']=qs[_0x632f('0x1f')](_0x5bd218[_0x632f('0x36')][_0x632f('0x1f')]);_0x2ad039[_0x632f('0x1e')]=qs[_0x632f('0x1e')](_0x5bd218[_0x632f('0x36')]['offset']);}_0x2ad039[_0x632f('0x3d')]=qs[_0x632f('0x3e')](_0x5bd218[_0x632f('0x36')][_0x632f('0x3e')]);_0x2ad039[_0x632f('0x3f')]=qs[_0x632f('0x40')](_[_0x632f('0x41')](_0x5bd218[_0x632f('0x36')],_0x59dd60[_0x632f('0x40')]));_0x2ad039[_0x632f('0x3f')][_0x632f('0x5b')]=_0x1c336d['id'];if(_0x5bd218[_0x632f('0x36')][_0x632f('0x42')]){_0x2ad039[_0x632f('0x3f')]=_[_0x632f('0x44')](_0x2ad039[_0x632f('0x3f')],{'$or':_[_0x632f('0x35')](_0x2ad039[_0x632f('0x37')],function(_0x571e61){var _0x17f27a={};_0x17f27a[_0x571e61]={'$like':'%'+_0x5bd218['query']['filter']+'%'};return _0x17f27a;})});}_0x2ad039=_[_0x632f('0x44')]({},_0x2ad039,_0x5bd218[_0x632f('0x4c')]);return db[_0x632f('0x62')][_0x632f('0x21')]({'where':_0x2ad039[_0x632f('0x3f')]})['then'](function(_0x129792){_0x3665a3[_0x632f('0x21')]=_0x129792;if(_0x5bd218['query'][_0x632f('0x45')]){_0x2ad039[_0x632f('0x46')]=[{'all':!![]}];}return db[_0x632f('0x62')][_0x632f('0x47')](_0x2ad039);})['then'](function(_0x48ba45){_0x3665a3['rows']=_0x48ba45;return _0x3665a3;});}})[_0x632f('0x28')](respondWithFilteredResult(_0x5ad1d6,_0x2ad039))[_0x632f('0x49')](handleError(_0x5ad1d6,null));};exports[_0x632f('0x63')]=function(_0x18a7aa,_0x58a879,_0xfb74d2){var _0x4243df={};var _0x276fd5={};var _0x448093;var _0x2b7054;return db[_0x632f('0x32')][_0x632f('0x5a')]({'where':{'id':_0x18a7aa[_0x632f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x58a879,null))['then'](function(_0x4b66ad){if(_0x4b66ad){_0x448093=_0x4b66ad;_0x276fd5[_0x632f('0x34')]=_[_0x632f('0x4b')](db['CmList']['rawAttributes']);_0x276fd5[_0x632f('0x36')]=_['keys'](_0x18a7aa[_0x632f('0x36')]);_0x276fd5['filters']=_['intersection'](_0x276fd5['model'],_0x276fd5[_0x632f('0x36')]);_0x4243df[_0x632f('0x37')]=_[_0x632f('0x38')](_0x276fd5[_0x632f('0x34')],qs[_0x632f('0x39')](_0x18a7aa[_0x632f('0x36')]['fields']));_0x4243df['attributes']=_0x4243df[_0x632f('0x37')][_0x632f('0x3a')]?_0x4243df[_0x632f('0x37')]:_0x276fd5[_0x632f('0x34')];_0x4243df['order']=qs[_0x632f('0x3e')](_0x18a7aa[_0x632f('0x36')][_0x632f('0x3e')]);_0x4243df[_0x632f('0x3f')]=qs[_0x632f('0x40')](_['pick'](_0x18a7aa[_0x632f('0x36')],_0x276fd5[_0x632f('0x40')]));if(_0x18a7aa[_0x632f('0x36')]['filter']){_0x4243df['where']=_['merge'](_0x4243df[_0x632f('0x3f')],{'$or':_[_0x632f('0x35')](_0x4243df[_0x632f('0x37')],function(_0x3b5788){var _0xb467a={};_0xb467a[_0x3b5788]={'$like':'%'+_0x18a7aa[_0x632f('0x36')][_0x632f('0x42')]+'%'};return _0xb467a;})});}_0x4243df=_['merge']({},_0x4243df,_0x18a7aa[_0x632f('0x4c')]);return _0x448093[_0x632f('0x63')](_0x4243df);}})['then'](function(_0xa1a3c2){if(_0xa1a3c2){_0x2b7054=_0xa1a3c2['length'];if(!_0x18a7aa[_0x632f('0x36')][_0x632f('0x3b')](_0x632f('0x3c'))){_0x4243df[_0x632f('0x1f')]=qs[_0x632f('0x1f')](_0x18a7aa[_0x632f('0x36')][_0x632f('0x1f')]);_0x4243df[_0x632f('0x1e')]=qs['offset'](_0x18a7aa[_0x632f('0x36')][_0x632f('0x1e')]);}return _0x448093[_0x632f('0x63')](_0x4243df);}})[_0x632f('0x28')](function(_0x50e06f){if(_0x50e06f){return _0x50e06f?{'count':_0x2b7054,'rows':_0x50e06f}:null;}})['then'](respondWithResult(_0x58a879,null))[_0x632f('0x49')](handleError(_0x58a879,null));};exports[_0x632f('0x64')]=function(_0x3edfad,_0x30504c,_0x56acef){var _0x3e31eb,_0x43577b;return db['Campaign'][_0x632f('0x4d')]({'where':{'id':_0x3edfad[_0x632f('0x4a')]['id']}})[_0x632f('0x28')](handleEntityNotFound(_0x30504c,null))[_0x632f('0x28')](function(_0x562b3e){if(_0x562b3e){_0x43577b=_0x562b3e;return _0x562b3e[_0x632f('0x64')](_0x3edfad['body'][_0x632f('0x65')],_[_0x632f('0x55')](_0x3edfad['body'],[_0x632f('0x65'),'id'])||{});}return null;})[_0x632f('0x66')](function(_0x3fafa7){var _0x2a089c;_0x3e31eb=_0x3fafa7||[];var _0x2c2435=[];if(_0x3fafa7){for(var _0x230447=0x0;_0x230447<_0x3fafa7[_0x632f('0x3a')];_0x230447+=0x1){var _0x52516b=_0x3fafa7[_0x230447][_0x632f('0x29')]({'plain':!![]});_0x43577b[_0x632f('0x67')]=_0x3edfad[_0x632f('0x4f')][_0x632f('0x67')]?_0x3edfad['body'][_0x632f('0x67')]:_0x43577b[_0x632f('0x67')];switch(_0x43577b[_0x632f('0x67')]){case _0x632f('0x68'):_0x2a089c=squel[_0x632f('0x69')]()[_0x632f('0x6a')](_0x632f('0x6b'))[_0x632f('0x6c')]([_0x632f('0x6d'),_0x632f('0x6e'),_0x632f('0x6f'),_0x632f('0x70'),_0x632f('0x5b'),_0x632f('0x56'),_0x632f('0x57')],squel[_0x632f('0x71')]()['field'](_0x632f('0x6d'),'phone')['field'](_0x632f('0x72'),_0x632f('0x6e'))['field']('id','ContactId')[_0x632f('0x73')](_0x52516b['CmListId']['toString'](),_0x632f('0x70'))[_0x632f('0x73')](_0x3edfad[_0x632f('0x4a')]['id']['toString'](),_0x632f('0x5b'))['field'](_0x632f('0x72'),_0x632f('0x56'))[_0x632f('0x73')]('NOW()',_0x632f('0x57'))['from']('cm_contacts')[_0x632f('0x3f')]('deletedAt\x20IS\x20NULL')[_0x632f('0x3f')](_0x632f('0x74'),_0x52516b[_0x632f('0x75')][_0x632f('0x76')]())[_0x632f('0x3f')](_0x632f('0x77'))[_0x632f('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')[_0x632f('0x78')]('cm_hopper_final')[_0x632f('0x3f')](_0x632f('0x79'),_0x3edfad[_0x632f('0x4a')]['id']['toString']()))[_0x632f('0x3f')](_0x632f('0x7a'),squel[_0x632f('0x71')]()[_0x632f('0x73')](_0x632f('0x7b'))[_0x632f('0x78')](_0x632f('0x6b'))[_0x632f('0x3f')]('CampaignId\x20=\x20?',_0x3edfad[_0x632f('0x4a')]['id'][_0x632f('0x76')]())))[_0x632f('0x76')]();break;case _0x632f('0x7c'):_0x2a089c=squel[_0x632f('0x69')]()[_0x632f('0x6a')]('cm_hopper')[_0x632f('0x6c')]([_0x632f('0x6d'),_0x632f('0x6e'),'ContactId',_0x632f('0x70'),_0x632f('0x5b'),'createdAt','updatedAt'],squel[_0x632f('0x71')]()['field']('phone','phone')[_0x632f('0x73')](_0x632f('0x72'),_0x632f('0x6e'))['field']('id',_0x632f('0x6f'))[_0x632f('0x73')](_0x52516b[_0x632f('0x75')][_0x632f('0x76')](),_0x632f('0x70'))[_0x632f('0x73')](_0x3edfad[_0x632f('0x4a')]['id']['toString'](),_0x632f('0x5b'))['field'](_0x632f('0x72'),_0x632f('0x56'))[_0x632f('0x73')]('NOW()',_0x632f('0x57'))[_0x632f('0x78')](_0x632f('0x7d'))['where'](_0x632f('0x7e'))[_0x632f('0x3f')]('ListId\x20=\x20?',_0x52516b[_0x632f('0x75')][_0x632f('0x76')]())[_0x632f('0x3f')](_0x632f('0x77'))['where'](_0x632f('0x7a'),squel[_0x632f('0x71')]()[_0x632f('0x73')](_0x632f('0x7b'))[_0x632f('0x78')]('cm_hopper')[_0x632f('0x3f')](_0x632f('0x79'),_0x3edfad[_0x632f('0x4a')]['id'][_0x632f('0x76')]())))['toString']();break;default:_0x2a089c=squel['insert']()[_0x632f('0x6a')](_0x632f('0x6b'))[_0x632f('0x6c')](['phone',_0x632f('0x6e'),_0x632f('0x6f'),_0x632f('0x70'),_0x632f('0x5b'),_0x632f('0x56'),_0x632f('0x57')],squel[_0x632f('0x71')]()[_0x632f('0x73')]('phone',_0x632f('0x6d'))[_0x632f('0x73')]('NOW()','scheduledAt')[_0x632f('0x73')]('id',_0x632f('0x6f'))[_0x632f('0x73')](_0x52516b[_0x632f('0x75')][_0x632f('0x76')](),_0x632f('0x70'))[_0x632f('0x73')](_0x3edfad['params']['id'][_0x632f('0x76')](),'CampaignId')[_0x632f('0x73')]('NOW()',_0x632f('0x56'))['field'](_0x632f('0x72'),_0x632f('0x57'))[_0x632f('0x78')](_0x632f('0x7d'))['where']('deletedAt\x20IS\x20NULL')[_0x632f('0x3f')](_0x632f('0x74'),_0x52516b[_0x632f('0x75')][_0x632f('0x76')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x632f('0x76')]();}_0x2c2435['push'](db[_0x632f('0x7f')][_0x632f('0x36')](_0x2a089c));}return BPromise[_0x632f('0x80')](_0x2c2435);}})[_0x632f('0x28')](function(){return _0x3e31eb;})[_0x632f('0x28')](respondWithResult(_0x30504c,null))['catch'](handleError(_0x30504c,null));};exports[_0x632f('0x81')]=function(_0x3785de,_0x1b1134,_0x21b41b){return db[_0x632f('0x32')][_0x632f('0x4d')]({'where':{'id':_0x3785de[_0x632f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1b1134,null))[_0x632f('0x28')](function(_0xa0abb){if(_0xa0abb){return _0xa0abb[_0x632f('0x81')](_0x3785de[_0x632f('0x36')]['ids']);}})[_0x632f('0x28')](function(_0x224acd){if(_0x224acd){return db[_0x632f('0x5c')][_0x632f('0x2c')]({'where':{'ListId':_0x3785de[_0x632f('0x36')][_0x632f('0x65')],'CampaignId':_0x3785de['params']['id']}})['then'](function(){return _0x224acd;});}})[_0x632f('0x28')](respondWithStatusCode(_0x1b1134,null))[_0x632f('0x49')](handleError(_0x1b1134,null));};exports[_0x632f('0x82')]=function(_0x14d7d3,_0x3aa82f,_0x1ee0c4){var _0xe1d43f={};var _0xb553cd={};var _0x5a6880;var _0x44cb6f;return db[_0x632f('0x32')][_0x632f('0x5a')]({'where':{'id':_0x14d7d3[_0x632f('0x4a')]['id']}})[_0x632f('0x28')](handleEntityNotFound(_0x3aa82f,null))['then'](function(_0x1f2ef5){if(_0x1f2ef5){_0x5a6880=_0x1f2ef5;_0xb553cd['model']=_[_0x632f('0x4b')](db[_0x632f('0x83')][_0x632f('0x33')]);_0xb553cd['query']=_['keys'](_0x14d7d3[_0x632f('0x36')]);_0xb553cd[_0x632f('0x40')]=_[_0x632f('0x38')](_0xb553cd[_0x632f('0x34')],_0xb553cd[_0x632f('0x36')]);_0xe1d43f[_0x632f('0x37')]=_['intersection'](_0xb553cd[_0x632f('0x34')],qs[_0x632f('0x39')](_0x14d7d3['query'][_0x632f('0x39')]));_0xe1d43f['attributes']=_0xe1d43f[_0x632f('0x37')][_0x632f('0x3a')]?_0xe1d43f[_0x632f('0x37')]:_0xb553cd[_0x632f('0x34')];_0xe1d43f[_0x632f('0x3d')]=qs[_0x632f('0x3e')](_0x14d7d3['query'][_0x632f('0x3e')]);_0xe1d43f[_0x632f('0x3f')]=qs[_0x632f('0x40')](_[_0x632f('0x41')](_0x14d7d3[_0x632f('0x36')],_0xb553cd[_0x632f('0x40')]));if(_0x14d7d3[_0x632f('0x36')]['filter']){_0xe1d43f['where']=_[_0x632f('0x44')](_0xe1d43f[_0x632f('0x3f')],{'$or':_[_0x632f('0x35')](_0xe1d43f[_0x632f('0x37')],function(_0x24689e){var _0x5c3a95={};_0x5c3a95[_0x24689e]={'$like':'%'+_0x14d7d3[_0x632f('0x36')][_0x632f('0x42')]+'%'};return _0x5c3a95;})});}_0xe1d43f=_['merge']({},_0xe1d43f,_0x14d7d3[_0x632f('0x4c')]);return _0x5a6880[_0x632f('0x82')](_0xe1d43f);}})['then'](function(_0x37e840){if(_0x37e840){_0x44cb6f=_0x37e840['length'];if(!_0x14d7d3[_0x632f('0x36')][_0x632f('0x3b')]('nolimit')){_0xe1d43f[_0x632f('0x1f')]=qs[_0x632f('0x1f')](_0x14d7d3[_0x632f('0x36')][_0x632f('0x1f')]);_0xe1d43f[_0x632f('0x1e')]=qs[_0x632f('0x1e')](_0x14d7d3['query'][_0x632f('0x1e')]);}return _0x5a6880[_0x632f('0x82')](_0xe1d43f);}})['then'](function(_0x2ba4e5){if(_0x2ba4e5){return _0x2ba4e5?{'count':_0x44cb6f,'rows':_0x2ba4e5}:null;}})[_0x632f('0x28')](respondWithResult(_0x3aa82f,null))['catch'](handleError(_0x3aa82f,null));};exports[_0x632f('0x84')]=function(_0x25f86d,_0x2a23e1,_0x3b1801){var _0x3ebba8,_0x599e76;return db[_0x632f('0x32')][_0x632f('0x4d')]({'where':{'id':_0x25f86d[_0x632f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2a23e1,null))[_0x632f('0x28')](function(_0x3343f7){if(_0x3343f7){_0x599e76=_0x3343f7;return _0x3343f7['addBlackLists'](_0x25f86d[_0x632f('0x4f')][_0x632f('0x65')],_[_0x632f('0x55')](_0x25f86d[_0x632f('0x4f')],[_0x632f('0x65'),'id'])||{});}return null;})[_0x632f('0x66')](function(_0x3a5085){var _0x125363;_0x3ebba8=_0x3a5085||[];var _0x124df3=[];if(_0x3a5085){for(var _0x23f406=0x0;_0x23f406<_0x3a5085[_0x632f('0x3a')];_0x23f406+=0x1){var _0x37ba4c=_0x3a5085[_0x23f406][_0x632f('0x29')]({'plain':!![]});_0x125363=squel[_0x632f('0x69')]()[_0x632f('0x6a')](_0x632f('0x85'))[_0x632f('0x6c')]([_0x632f('0x6d'),_0x632f('0x6f'),_0x632f('0x70'),_0x632f('0x5b'),_0x632f('0x56'),_0x632f('0x57')],squel[_0x632f('0x71')]()[_0x632f('0x73')](_0x632f('0x6d'),_0x632f('0x6d'))[_0x632f('0x73')]('id',_0x632f('0x6f'))['field'](_0x37ba4c[_0x632f('0x75')][_0x632f('0x76')](),_0x632f('0x70'))[_0x632f('0x73')](_0x25f86d[_0x632f('0x4a')]['id'][_0x632f('0x76')](),_0x632f('0x5b'))[_0x632f('0x73')](_0x632f('0x72'),_0x632f('0x56'))[_0x632f('0x73')](_0x632f('0x72'),_0x632f('0x57'))[_0x632f('0x78')](_0x632f('0x7d'))[_0x632f('0x3f')](_0x632f('0x7e'))[_0x632f('0x3f')](_0x632f('0x74'),_0x37ba4c[_0x632f('0x75')]['toString']())[_0x632f('0x3f')](_0x632f('0x77')))[_0x632f('0x76')]();_0x124df3[_0x632f('0x86')](db[_0x632f('0x7f')][_0x632f('0x36')](_0x125363));}return BPromise['all'](_0x124df3);}})['then'](function(){return _0x3ebba8;})[_0x632f('0x28')](respondWithResult(_0x2a23e1,null))['catch'](handleError(_0x2a23e1,null));};exports[_0x632f('0x87')]=function(_0x9d105d,_0x32f66e,_0x25242b){return db[_0x632f('0x32')]['find']({'where':{'id':_0x9d105d['params']['id']}})['then'](handleEntityNotFound(_0x32f66e,null))[_0x632f('0x28')](function(_0x177e8a){if(_0x177e8a){return _0x177e8a[_0x632f('0x87')](_0x9d105d[_0x632f('0x36')][_0x632f('0x65')]);}})[_0x632f('0x28')](function(_0x315b35){if(_0x315b35){return db['CmHopperBlack'][_0x632f('0x2c')]({'where':{'ListId':_0x9d105d[_0x632f('0x36')]['ids'],'CampaignId':_0x9d105d[_0x632f('0x4a')]['id']}})['then'](function(){return _0x315b35;});}})[_0x632f('0x28')](respondWithStatusCode(_0x32f66e,null))[_0x632f('0x49')](handleError(_0x32f66e,null));}; \ No newline at end of file +var _0xb4dd=['end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','Campaign','count','include','findAll','catch','show','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','includeAll','omit','createdAt','body','updatedAt','findOne','CmHopper','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','select','cm_contacts','push','sequelize','all','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x165194,_0x31a93e){var _0x2975f0=function(_0x49ae22){while(--_0x49ae22){_0x165194['push'](_0x165194['shift']());}};_0x2975f0(++_0x31a93e);}(_0xb4dd,0xfb));var _0xdb4d=function(_0x3bb458,_0x2528e9){_0x3bb458=_0x3bb458-0x0;var _0x546258=_0xb4dd[_0x3bb458];return _0x546258;};'use strict';var emlformat=require(_0xdb4d('0x0'));var rimraf=require(_0xdb4d('0x1'));var zipdir=require(_0xdb4d('0x2'));var jsonpatch=require(_0xdb4d('0x3'));var rp=require(_0xdb4d('0x4'));var moment=require(_0xdb4d('0x5'));var BPromise=require(_0xdb4d('0x6'));var Mustache=require(_0xdb4d('0x7'));var util=require(_0xdb4d('0x8'));var path=require(_0xdb4d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb4d('0xa'));var _=require('lodash');var squel=require(_0xdb4d('0xb'));var crypto=require(_0xdb4d('0xc'));var jsforce=require(_0xdb4d('0xd'));var deskjs=require(_0xdb4d('0xe'));var toCsv=require(_0xdb4d('0xf'));var querystring=require(_0xdb4d('0x10'));var Papa=require(_0xdb4d('0x11'));var Redis=require(_0xdb4d('0x12'));var authService=require(_0xdb4d('0x13'));var qs=require(_0xdb4d('0x14'));var as=require(_0xdb4d('0x15'));var hardwareService=require(_0xdb4d('0x16'));var logger=require(_0xdb4d('0x17'))('api');var utils=require(_0xdb4d('0x18'));var config=require(_0xdb4d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb4d('0x1a'))['db'];function respondWithStatusCode(_0x2e54da,_0x589faf){_0x589faf=_0x589faf||0xcc;return function(_0x5d2402){if(_0x5d2402){return _0x2e54da[_0xdb4d('0x1b')](_0x589faf);}return _0x2e54da[_0xdb4d('0x1c')](_0x589faf)[_0xdb4d('0x1d')]();};}function respondWithResult(_0x55351d,_0x46aba1){_0x46aba1=_0x46aba1||0xc8;return function(_0x445e23){if(_0x445e23){return _0x55351d[_0xdb4d('0x1c')](_0x46aba1)[_0xdb4d('0x1e')](_0x445e23);}};}function respondWithFilteredResult(_0xae8ac9,_0x36e204){return function(_0x41a8c2){if(_0x41a8c2){var _0xec9122=typeof _0x36e204[_0xdb4d('0x1f')]===_0xdb4d('0x20')&&typeof _0x36e204[_0xdb4d('0x21')]==='undefined';var _0x50325b=_0x41a8c2['count'];var _0x48aa7e=_0xec9122?0x0:_0x36e204[_0xdb4d('0x1f')];var _0x315ea8=_0xec9122?_0x41a8c2['count']:_0x36e204['offset']+_0x36e204['limit'];var _0x57d3e0;if(_0x315ea8>=_0x50325b){_0x315ea8=_0x50325b;_0x57d3e0=0xc8;}else{_0x57d3e0=0xce;}_0xae8ac9[_0xdb4d('0x1c')](_0x57d3e0);return _0xae8ac9[_0xdb4d('0x22')]('Content-Range',_0x48aa7e+'-'+_0x315ea8+'/'+_0x50325b)[_0xdb4d('0x1e')](_0x41a8c2);}return null;};}function patchUpdates(_0x396c01){return function(_0x17ab0e){try{jsonpatch[_0xdb4d('0x23')](_0x17ab0e,_0x396c01,!![]);}catch(_0x41993f){return BPromise[_0xdb4d('0x24')](_0x41993f);}return _0x17ab0e[_0xdb4d('0x25')]();};}function saveUpdates(_0x336246,_0x45564d){return function(_0x3d1e22){if(_0x3d1e22){return _0x3d1e22[_0xdb4d('0x26')](_0x336246)[_0xdb4d('0x27')](function(_0x247d6a){return _0x247d6a;});}return null;};}function removeEntity(_0x4a1fa2,_0x5c19d0){return function(_0x4dc3fd){if(_0x4dc3fd){return _0x4dc3fd[_0xdb4d('0x28')]()[_0xdb4d('0x27')](function(){var _0x21aa4d=_0x4dc3fd[_0xdb4d('0x29')]({'plain':!![]});var _0x4879b2=_0xdb4d('0x2a');return db[_0xdb4d('0x2b')][_0xdb4d('0x28')]({'where':{'type':_0x4879b2,'resourceId':_0x21aa4d['id']}})[_0xdb4d('0x27')](function(){return _0x4dc3fd;});})['then'](function(){_0x4a1fa2['status'](0xcc)[_0xdb4d('0x1d')]();});}};}function handleEntityNotFound(_0x4d18a7,_0x143487){return function(_0x3921b4){if(!_0x3921b4){_0x4d18a7[_0xdb4d('0x1b')](0x194);}return _0x3921b4;};}function handleError(_0x53376f,_0x8fba5b){_0x8fba5b=_0x8fba5b||0x1f4;return function(_0x23c719){logger[_0xdb4d('0x2c')](_0x23c719['stack']);if(_0x23c719[_0xdb4d('0x2d')]){delete _0x23c719[_0xdb4d('0x2d')];}_0x53376f[_0xdb4d('0x1c')](_0x8fba5b)[_0xdb4d('0x2e')](_0x23c719);};}exports[_0xdb4d('0x2f')]=function(_0x3eb3c2,_0x571ec5){var _0x3bcb10={},_0x216872={},_0xcee447={'count':0x0,'rows':[]};var _0x5c0951=_[_0xdb4d('0x30')](db['Campaign']['rawAttributes'],function(_0x1492f5){return{'name':_0x1492f5[_0xdb4d('0x31')],'type':_0x1492f5[_0xdb4d('0x32')][_0xdb4d('0x33')]};});_0x216872[_0xdb4d('0x34')]=_[_0xdb4d('0x30')](_0x5c0951,_0xdb4d('0x2d'));_0x216872[_0xdb4d('0x35')]=_[_0xdb4d('0x36')](_0x3eb3c2['query']);_0x216872[_0xdb4d('0x37')]=_[_0xdb4d('0x38')](_0x216872[_0xdb4d('0x34')],_0x216872['query']);_0x3bcb10[_0xdb4d('0x39')]=_[_0xdb4d('0x38')](_0x216872[_0xdb4d('0x34')],qs[_0xdb4d('0x3a')](_0x3eb3c2['query']['fields']));_0x3bcb10[_0xdb4d('0x39')]=_0x3bcb10[_0xdb4d('0x39')][_0xdb4d('0x3b')]?_0x3bcb10['attributes']:_0x216872[_0xdb4d('0x34')];if(!_0x3eb3c2['query'][_0xdb4d('0x3c')](_0xdb4d('0x3d'))){_0x3bcb10['limit']=qs[_0xdb4d('0x21')](_0x3eb3c2[_0xdb4d('0x35')][_0xdb4d('0x21')]);_0x3bcb10[_0xdb4d('0x1f')]=qs[_0xdb4d('0x1f')](_0x3eb3c2[_0xdb4d('0x35')][_0xdb4d('0x1f')]);}_0x3bcb10[_0xdb4d('0x3e')]=qs[_0xdb4d('0x3f')](_0x3eb3c2['query'][_0xdb4d('0x3f')]);_0x3bcb10['where']=qs['filters'](_[_0xdb4d('0x40')](_0x3eb3c2['query'],_0x216872[_0xdb4d('0x37')]),_0x5c0951);if(_0x3eb3c2[_0xdb4d('0x35')][_0xdb4d('0x41')]){_0x3bcb10['where']=_[_0xdb4d('0x42')](_0x3bcb10['where'],{'$or':_[_0xdb4d('0x30')](_0x5c0951,function(_0x4a4d8f){if(_0x4a4d8f[_0xdb4d('0x32')]!==_0xdb4d('0x43')){var _0x2c805e={};_0x2c805e[_0x4a4d8f[_0xdb4d('0x2d')]]={'$like':'%'+_0x3eb3c2[_0xdb4d('0x35')][_0xdb4d('0x41')]+'%'};return _0x2c805e;}})});}_0x3bcb10=_['merge']({},_0x3bcb10,_0x3eb3c2[_0xdb4d('0x44')]);var _0xa612a4={'where':_0x3bcb10[_0xdb4d('0x45')]};return db[_0xdb4d('0x46')][_0xdb4d('0x47')](_0xa612a4)[_0xdb4d('0x27')](function(_0x28cc28){_0xcee447[_0xdb4d('0x47')]=_0x28cc28;if(_0x3eb3c2[_0xdb4d('0x35')]['includeAll']){_0x3bcb10[_0xdb4d('0x48')]=[{'all':!![]}];}return db['Campaign'][_0xdb4d('0x49')](_0x3bcb10);})[_0xdb4d('0x27')](function(_0x44300b){_0xcee447['rows']=_0x44300b;return _0xcee447;})[_0xdb4d('0x27')](respondWithFilteredResult(_0x571ec5,_0x3bcb10))[_0xdb4d('0x4a')](handleError(_0x571ec5,null));};exports[_0xdb4d('0x4b')]=function(_0x4e1616,_0x6c290b){var _0x3a2fad={'raw':![],'where':{'id':_0x4e1616['params']['id']}},_0x1724da={};_0x1724da[_0xdb4d('0x34')]=_[_0xdb4d('0x36')](db[_0xdb4d('0x46')][_0xdb4d('0x4c')]);_0x1724da[_0xdb4d('0x35')]=_[_0xdb4d('0x36')](_0x4e1616[_0xdb4d('0x35')]);_0x1724da[_0xdb4d('0x37')]=_['intersection'](_0x1724da['model'],_0x1724da[_0xdb4d('0x35')]);_0x3a2fad['attributes']=_[_0xdb4d('0x38')](_0x1724da[_0xdb4d('0x34')],qs['fields'](_0x4e1616['query'][_0xdb4d('0x3a')]));_0x3a2fad[_0xdb4d('0x39')]=_0x3a2fad[_0xdb4d('0x39')][_0xdb4d('0x3b')]?_0x3a2fad['attributes']:_0x1724da['model'];if(_0x4e1616['query']['includeAll']){_0x3a2fad[_0xdb4d('0x48')]=[{'all':!![]}];}_0x3a2fad=_[_0xdb4d('0x42')]({},_0x3a2fad,_0x4e1616[_0xdb4d('0x44')]);return db[_0xdb4d('0x46')][_0xdb4d('0x4d')](_0x3a2fad)[_0xdb4d('0x27')](handleEntityNotFound(_0x6c290b,null))[_0xdb4d('0x27')](respondWithResult(_0x6c290b,null))[_0xdb4d('0x4a')](handleError(_0x6c290b,null));};exports[_0xdb4d('0x4e')]=function(_0x13c81d,_0x22d885){return db[_0xdb4d('0x46')]['create'](_0x13c81d['body'],{})[_0xdb4d('0x27')](function(_0x5cc731){var _0x594251=_0x13c81d[_0xdb4d('0x4f')]['get']({'plain':!![]});if(!_0x594251)throw new Error(_0xdb4d('0x50'));if(_0x594251[_0xdb4d('0x51')]===_0xdb4d('0x4f')){var _0x3529fe=_0x5cc731[_0xdb4d('0x29')]({'plain':!![]});var _0x54b085=_0xdb4d('0x2a');return db[_0xdb4d('0x52')]['find']({'where':{'name':_0x54b085,'userProfileId':_0x594251[_0xdb4d('0x53')]},'raw':!![]})[_0xdb4d('0x27')](function(_0x2ef70){if(_0x2ef70&&_0x2ef70[_0xdb4d('0x54')]===0x0){return db['UserProfileResource'][_0xdb4d('0x4e')]({'name':_0x3529fe[_0xdb4d('0x2d')],'resourceId':_0x3529fe['id'],'type':_0x2ef70[_0xdb4d('0x2d')],'sectionId':_0x2ef70['id']},{})['then'](function(){return _0x5cc731;});}else{return _0x5cc731;}})[_0xdb4d('0x4a')](function(_0x489272){logger[_0xdb4d('0x2c')](_0xdb4d('0x55'),_0x489272);throw _0x489272;});}return _0x5cc731;})[_0xdb4d('0x27')](respondWithResult(_0x22d885,0xc9))['catch'](handleError(_0x22d885,null));};exports[_0xdb4d('0x56')]=function(_0x59b0c1,_0x1132bd){var _0x53fba1={'where':{'id':_0x59b0c1[_0xdb4d('0x57')]['id']}},_0x20e3e6={};_0x20e3e6[_0xdb4d('0x34')]=_[_0xdb4d('0x36')](db[_0xdb4d('0x46')]['rawAttributes']);_0x53fba1[_0xdb4d('0x39')]=_[_0xdb4d('0x38')](_0x20e3e6['model'],qs[_0xdb4d('0x3a')](_0x59b0c1[_0xdb4d('0x35')][_0xdb4d('0x3a')]));_0x53fba1['attributes']=_0x53fba1[_0xdb4d('0x39')][_0xdb4d('0x3b')]?_0x53fba1[_0xdb4d('0x39')]:_0x20e3e6[_0xdb4d('0x34')];if(_0x59b0c1[_0xdb4d('0x35')][_0xdb4d('0x58')]){_0x53fba1[_0xdb4d('0x48')]=[{'all':!![]}];}_0x53fba1=_[_0xdb4d('0x42')]({},_0x53fba1,_0x59b0c1['options']);return db[_0xdb4d('0x46')][_0xdb4d('0x4d')](_0x53fba1)[_0xdb4d('0x27')](handleEntityNotFound(_0x1132bd,null))[_0xdb4d('0x27')](function(_0x4a3a1d){if(_0x4a3a1d){var _0x49b4f6=_0x4a3a1d['get']({'plain':!![]});_0x49b4f6=qs[_0xdb4d('0x59')](_0x49b4f6,['id',_0xdb4d('0x5a'),'updatedAt']);_0x59b0c1[_0xdb4d('0x5b')]=_['omit'](_0x59b0c1[_0xdb4d('0x5b')],['id',_0xdb4d('0x5a'),_0xdb4d('0x5c')]);return db[_0xdb4d('0x46')][_0xdb4d('0x4e')](_['merge'](_0x49b4f6,_0x59b0c1[_0xdb4d('0x5b')]),{'include':_0x59b0c1['query'][_0xdb4d('0x58')]?[{'all':!![]}]:undefined})[_0xdb4d('0x27')](function(_0xbfde6d){var _0x1fc94f=_0x59b0c1[_0xdb4d('0x4f')][_0xdb4d('0x29')]({'plain':!![]});if(!_0x1fc94f)throw new Error(_0xdb4d('0x50'));if(_0x1fc94f[_0xdb4d('0x51')]==='user'){var _0xc63a73=_0xbfde6d[_0xdb4d('0x29')]({'plain':!![]});var _0x4ada57=_0xdb4d('0x2a');return db[_0xdb4d('0x52')]['find']({'where':{'name':_0x4ada57,'userProfileId':_0x1fc94f[_0xdb4d('0x53')]},'raw':!![]})[_0xdb4d('0x27')](function(_0x1f7dda){if(_0x1f7dda&&_0x1f7dda['autoAssociation']===0x0){return db[_0xdb4d('0x2b')][_0xdb4d('0x4e')]({'name':_0xc63a73[_0xdb4d('0x2d')],'resourceId':_0xc63a73['id'],'type':_0x1f7dda[_0xdb4d('0x2d')],'sectionId':_0x1f7dda['id']},{})['then'](function(){return _0xbfde6d;});}else{return _0xbfde6d;}})[_0xdb4d('0x4a')](function(_0x553fbc){logger[_0xdb4d('0x2c')](_0xdb4d('0x55'),_0x553fbc);throw _0x553fbc;});}return _0xbfde6d;});}})[_0xdb4d('0x27')](respondWithResult(_0x1132bd,0xc9))['catch'](handleError(_0x1132bd,null));};exports[_0xdb4d('0x26')]=function(_0x1f5f9f,_0x5ba73f){if(_0x1f5f9f[_0xdb4d('0x5b')]['id']){delete _0x1f5f9f[_0xdb4d('0x5b')]['id'];}return db[_0xdb4d('0x46')][_0xdb4d('0x4d')]({'where':{'id':_0x1f5f9f['params']['id']}})['then'](handleEntityNotFound(_0x5ba73f,null))[_0xdb4d('0x27')](saveUpdates(_0x1f5f9f['body'],null))['then'](respondWithResult(_0x5ba73f,null))[_0xdb4d('0x4a')](handleError(_0x5ba73f,null));};exports[_0xdb4d('0x28')]=function(_0x25808c,_0x56fb6f){return db[_0xdb4d('0x46')][_0xdb4d('0x4d')]({'where':{'id':_0x25808c[_0xdb4d('0x57')]['id']}})[_0xdb4d('0x27')](handleEntityNotFound(_0x56fb6f,null))[_0xdb4d('0x27')](removeEntity(_0x56fb6f,null))[_0xdb4d('0x4a')](handleError(_0x56fb6f,null));};exports['getHoppers']=function(_0x2c3007,_0xa245f3,_0x43ccab){var _0x3f750d={'raw':!![],'where':{}};var _0x13690f={};var _0x12986f={'count':0x0,'rows':[]};return db['Campaign'][_0xdb4d('0x5d')]({'where':{'id':_0x2c3007[_0xdb4d('0x57')]['id']}})[_0xdb4d('0x27')](handleEntityNotFound(_0xa245f3,null))[_0xdb4d('0x27')](function(_0x5d9219){if(_0x5d9219){_0x13690f['model']=_[_0xdb4d('0x36')](db[_0xdb4d('0x5e')]['rawAttributes']);_0x13690f[_0xdb4d('0x35')]=_[_0xdb4d('0x36')](_0x2c3007[_0xdb4d('0x35')]);_0x13690f[_0xdb4d('0x37')]=_[_0xdb4d('0x38')](_0x13690f[_0xdb4d('0x34')],_0x13690f[_0xdb4d('0x35')]);_0x3f750d[_0xdb4d('0x39')]=_['intersection'](_0x13690f[_0xdb4d('0x34')],qs[_0xdb4d('0x3a')](_0x2c3007[_0xdb4d('0x35')][_0xdb4d('0x3a')]));_0x3f750d[_0xdb4d('0x39')]=_0x3f750d[_0xdb4d('0x39')][_0xdb4d('0x3b')]?_0x3f750d[_0xdb4d('0x39')]:_0x13690f[_0xdb4d('0x34')];if(!_0x2c3007['query'][_0xdb4d('0x3c')]('nolimit')){_0x3f750d['limit']=qs['limit'](_0x2c3007['query'][_0xdb4d('0x21')]);_0x3f750d[_0xdb4d('0x1f')]=qs[_0xdb4d('0x1f')](_0x2c3007[_0xdb4d('0x35')][_0xdb4d('0x1f')]);}_0x3f750d[_0xdb4d('0x3e')]=qs[_0xdb4d('0x3f')](_0x2c3007[_0xdb4d('0x35')]['sort']);_0x3f750d[_0xdb4d('0x45')]=qs[_0xdb4d('0x37')](_[_0xdb4d('0x40')](_0x2c3007[_0xdb4d('0x35')],_0x13690f[_0xdb4d('0x37')]));_0x3f750d[_0xdb4d('0x45')][_0xdb4d('0x5f')]=_0x5d9219['id'];if(_0x2c3007[_0xdb4d('0x35')][_0xdb4d('0x41')]){_0x3f750d[_0xdb4d('0x45')]=_[_0xdb4d('0x42')](_0x3f750d['where'],{'$or':_['map'](_0x3f750d[_0xdb4d('0x39')],function(_0x36f92d){var _0x45a898={};_0x45a898[_0x36f92d]={'$like':'%'+_0x2c3007[_0xdb4d('0x35')][_0xdb4d('0x41')]+'%'};return _0x45a898;})});}_0x3f750d=_[_0xdb4d('0x42')]({},_0x3f750d,_0x2c3007[_0xdb4d('0x44')]);return db[_0xdb4d('0x5e')][_0xdb4d('0x47')]({'where':_0x3f750d['where']})[_0xdb4d('0x27')](function(_0x230d89){_0x12986f[_0xdb4d('0x47')]=_0x230d89;if(_0x2c3007['query']['includeAll']){_0x3f750d['include']=[{'all':!![]}];}return db[_0xdb4d('0x5e')]['findAll'](_0x3f750d);})[_0xdb4d('0x27')](function(_0x513107){_0x12986f[_0xdb4d('0x60')]=_0x513107;return _0x12986f;});}})[_0xdb4d('0x27')](respondWithFilteredResult(_0xa245f3,_0x3f750d))['catch'](handleError(_0xa245f3,null));};exports[_0xdb4d('0x61')]=function(_0xe106ce,_0x7ec06e,_0x52fcbe){var _0x52310f={'raw':!![],'where':{}};var _0x5a6bec={};var _0x166c2f={'count':0x0,'rows':[]};return db[_0xdb4d('0x46')][_0xdb4d('0x5d')]({'where':{'id':_0xe106ce[_0xdb4d('0x57')]['id']}})['then'](handleEntityNotFound(_0x7ec06e,null))['then'](function(_0x4121c2){if(_0x4121c2){_0x5a6bec[_0xdb4d('0x34')]=_[_0xdb4d('0x36')](db['CmHopperHistory']['rawAttributes']);_0x5a6bec[_0xdb4d('0x35')]=_[_0xdb4d('0x36')](_0xe106ce['query']);_0x5a6bec[_0xdb4d('0x37')]=_[_0xdb4d('0x38')](_0x5a6bec[_0xdb4d('0x34')],_0x5a6bec['query']);_0x52310f[_0xdb4d('0x39')]=_['intersection'](_0x5a6bec['model'],qs['fields'](_0xe106ce[_0xdb4d('0x35')]['fields']));_0x52310f[_0xdb4d('0x39')]=_0x52310f[_0xdb4d('0x39')][_0xdb4d('0x3b')]?_0x52310f[_0xdb4d('0x39')]:_0x5a6bec['model'];if(!_0xe106ce[_0xdb4d('0x35')][_0xdb4d('0x3c')](_0xdb4d('0x3d'))){_0x52310f[_0xdb4d('0x21')]=qs['limit'](_0xe106ce[_0xdb4d('0x35')][_0xdb4d('0x21')]);_0x52310f[_0xdb4d('0x1f')]=qs[_0xdb4d('0x1f')](_0xe106ce[_0xdb4d('0x35')][_0xdb4d('0x1f')]);}_0x52310f['order']=qs['sort'](_0xe106ce[_0xdb4d('0x35')][_0xdb4d('0x3f')]);_0x52310f[_0xdb4d('0x45')]=qs[_0xdb4d('0x37')](_[_0xdb4d('0x40')](_0xe106ce[_0xdb4d('0x35')],_0x5a6bec[_0xdb4d('0x37')]));_0x52310f['where'][_0xdb4d('0x5f')]=_0x4121c2['id'];if(_0xe106ce[_0xdb4d('0x35')][_0xdb4d('0x41')]){_0x52310f['where']=_[_0xdb4d('0x42')](_0x52310f['where'],{'$or':_[_0xdb4d('0x30')](_0x52310f['attributes'],function(_0x279eb9){var _0x18a08f={};_0x18a08f[_0x279eb9]={'$like':'%'+_0xe106ce[_0xdb4d('0x35')][_0xdb4d('0x41')]+'%'};return _0x18a08f;})});}_0x52310f=_[_0xdb4d('0x42')]({},_0x52310f,_0xe106ce['options']);return db[_0xdb4d('0x62')][_0xdb4d('0x47')]({'where':_0x52310f[_0xdb4d('0x45')]})[_0xdb4d('0x27')](function(_0x5ee0b1){_0x166c2f[_0xdb4d('0x47')]=_0x5ee0b1;if(_0xe106ce[_0xdb4d('0x35')]['includeAll']){_0x52310f[_0xdb4d('0x48')]=[{'all':!![]}];}return db[_0xdb4d('0x62')]['findAll'](_0x52310f);})[_0xdb4d('0x27')](function(_0x1be064){_0x166c2f[_0xdb4d('0x60')]=_0x1be064;return _0x166c2f;});}})[_0xdb4d('0x27')](respondWithFilteredResult(_0x7ec06e,_0x52310f))['catch'](handleError(_0x7ec06e,null));};exports[_0xdb4d('0x63')]=function(_0x559c40,_0x337bb7,_0xfaf232){var _0x419c80={'raw':!![],'where':{}};var _0x38e450={};var _0x5b2f85={'count':0x0,'rows':[]};return db[_0xdb4d('0x46')][_0xdb4d('0x5d')]({'where':{'id':_0x559c40[_0xdb4d('0x57')]['id']}})['then'](handleEntityNotFound(_0x337bb7,null))[_0xdb4d('0x27')](function(_0x5b9a7e){if(_0x5b9a7e){_0x38e450[_0xdb4d('0x34')]=_[_0xdb4d('0x36')](db['CmHopperFinal']['rawAttributes']);_0x38e450[_0xdb4d('0x35')]=_[_0xdb4d('0x36')](_0x559c40[_0xdb4d('0x35')]);_0x38e450[_0xdb4d('0x37')]=_[_0xdb4d('0x38')](_0x38e450['model'],_0x38e450[_0xdb4d('0x35')]);_0x419c80[_0xdb4d('0x39')]=_['intersection'](_0x38e450['model'],qs[_0xdb4d('0x3a')](_0x559c40[_0xdb4d('0x35')]['fields']));_0x419c80['attributes']=_0x419c80[_0xdb4d('0x39')][_0xdb4d('0x3b')]?_0x419c80['attributes']:_0x38e450[_0xdb4d('0x34')];if(!_0x559c40[_0xdb4d('0x35')]['hasOwnProperty'](_0xdb4d('0x3d'))){_0x419c80[_0xdb4d('0x21')]=qs[_0xdb4d('0x21')](_0x559c40[_0xdb4d('0x35')]['limit']);_0x419c80[_0xdb4d('0x1f')]=qs['offset'](_0x559c40[_0xdb4d('0x35')][_0xdb4d('0x1f')]);}_0x419c80[_0xdb4d('0x3e')]=qs['sort'](_0x559c40[_0xdb4d('0x35')][_0xdb4d('0x3f')]);_0x419c80[_0xdb4d('0x45')]=qs[_0xdb4d('0x37')](_['pick'](_0x559c40[_0xdb4d('0x35')],_0x38e450[_0xdb4d('0x37')]));_0x419c80['where'][_0xdb4d('0x5f')]=_0x5b9a7e['id'];if(_0x559c40[_0xdb4d('0x35')][_0xdb4d('0x41')]){_0x419c80[_0xdb4d('0x45')]=_['merge'](_0x419c80[_0xdb4d('0x45')],{'$or':_[_0xdb4d('0x30')](_0x419c80['attributes'],function(_0x2851ed){var _0x22f1cb={};_0x22f1cb[_0x2851ed]={'$like':'%'+_0x559c40[_0xdb4d('0x35')][_0xdb4d('0x41')]+'%'};return _0x22f1cb;})});}_0x419c80=_[_0xdb4d('0x42')]({},_0x419c80,_0x559c40[_0xdb4d('0x44')]);return db[_0xdb4d('0x64')][_0xdb4d('0x47')]({'where':_0x419c80[_0xdb4d('0x45')]})[_0xdb4d('0x27')](function(_0x33cc2c){_0x5b2f85[_0xdb4d('0x47')]=_0x33cc2c;if(_0x559c40[_0xdb4d('0x35')][_0xdb4d('0x58')]){_0x419c80[_0xdb4d('0x48')]=[{'all':!![]}];}return db[_0xdb4d('0x64')][_0xdb4d('0x49')](_0x419c80);})[_0xdb4d('0x27')](function(_0x54821d){_0x5b2f85[_0xdb4d('0x60')]=_0x54821d;return _0x5b2f85;});}})['then'](respondWithFilteredResult(_0x337bb7,_0x419c80))['catch'](handleError(_0x337bb7,null));};exports[_0xdb4d('0x65')]=function(_0x55414a,_0x42a4e5,_0x39d58f){var _0x415053={'raw':!![],'where':{}};var _0x5966e4={};var _0x2bb63c={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x55414a[_0xdb4d('0x57')]['id']}})[_0xdb4d('0x27')](handleEntityNotFound(_0x42a4e5,null))[_0xdb4d('0x27')](function(_0x3815d1){if(_0x3815d1){_0x5966e4['model']=_[_0xdb4d('0x36')](db[_0xdb4d('0x66')]['rawAttributes']);_0x5966e4[_0xdb4d('0x35')]=_[_0xdb4d('0x36')](_0x55414a[_0xdb4d('0x35')]);_0x5966e4[_0xdb4d('0x37')]=_['intersection'](_0x5966e4['model'],_0x5966e4[_0xdb4d('0x35')]);_0x415053[_0xdb4d('0x39')]=_[_0xdb4d('0x38')](_0x5966e4[_0xdb4d('0x34')],qs[_0xdb4d('0x3a')](_0x55414a[_0xdb4d('0x35')][_0xdb4d('0x3a')]));_0x415053[_0xdb4d('0x39')]=_0x415053['attributes'][_0xdb4d('0x3b')]?_0x415053[_0xdb4d('0x39')]:_0x5966e4[_0xdb4d('0x34')];if(!_0x55414a[_0xdb4d('0x35')][_0xdb4d('0x3c')](_0xdb4d('0x3d'))){_0x415053[_0xdb4d('0x21')]=qs['limit'](_0x55414a['query'][_0xdb4d('0x21')]);_0x415053[_0xdb4d('0x1f')]=qs[_0xdb4d('0x1f')](_0x55414a[_0xdb4d('0x35')][_0xdb4d('0x1f')]);}_0x415053[_0xdb4d('0x3e')]=qs['sort'](_0x55414a[_0xdb4d('0x35')][_0xdb4d('0x3f')]);_0x415053['where']=qs['filters'](_[_0xdb4d('0x40')](_0x55414a[_0xdb4d('0x35')],_0x5966e4[_0xdb4d('0x37')]));_0x415053[_0xdb4d('0x45')]['CampaignId']=_0x3815d1['id'];if(_0x55414a['query'][_0xdb4d('0x41')]){_0x415053[_0xdb4d('0x45')]=_[_0xdb4d('0x42')](_0x415053[_0xdb4d('0x45')],{'$or':_['map'](_0x415053[_0xdb4d('0x39')],function(_0x17c44b){var _0x3589ae={};_0x3589ae[_0x17c44b]={'$like':'%'+_0x55414a[_0xdb4d('0x35')][_0xdb4d('0x41')]+'%'};return _0x3589ae;})});}_0x415053=_['merge']({},_0x415053,_0x55414a[_0xdb4d('0x44')]);return db[_0xdb4d('0x66')][_0xdb4d('0x47')]({'where':_0x415053[_0xdb4d('0x45')]})[_0xdb4d('0x27')](function(_0x4195bf){_0x2bb63c['count']=_0x4195bf;if(_0x55414a[_0xdb4d('0x35')][_0xdb4d('0x58')]){_0x415053[_0xdb4d('0x48')]=[{'all':!![]}];}return db[_0xdb4d('0x66')][_0xdb4d('0x49')](_0x415053);})[_0xdb4d('0x27')](function(_0x879117){_0x2bb63c[_0xdb4d('0x60')]=_0x879117;return _0x2bb63c;});}})[_0xdb4d('0x27')](respondWithFilteredResult(_0x42a4e5,_0x415053))['catch'](handleError(_0x42a4e5,null));};exports[_0xdb4d('0x67')]=function(_0x73c500,_0x4d4929,_0x369702){var _0x5d8376={};var _0x22003e={};var _0x2fe1ae;var _0x53254d;return db[_0xdb4d('0x46')][_0xdb4d('0x5d')]({'where':{'id':_0x73c500[_0xdb4d('0x57')]['id']}})[_0xdb4d('0x27')](handleEntityNotFound(_0x4d4929,null))[_0xdb4d('0x27')](function(_0x3cad61){if(_0x3cad61){_0x2fe1ae=_0x3cad61;_0x22003e[_0xdb4d('0x34')]=_['keys'](db['CmList']['rawAttributes']);_0x22003e[_0xdb4d('0x35')]=_[_0xdb4d('0x36')](_0x73c500[_0xdb4d('0x35')]);_0x22003e[_0xdb4d('0x37')]=_['intersection'](_0x22003e[_0xdb4d('0x34')],_0x22003e[_0xdb4d('0x35')]);_0x5d8376[_0xdb4d('0x39')]=_['intersection'](_0x22003e[_0xdb4d('0x34')],qs[_0xdb4d('0x3a')](_0x73c500[_0xdb4d('0x35')][_0xdb4d('0x3a')]));_0x5d8376[_0xdb4d('0x39')]=_0x5d8376[_0xdb4d('0x39')]['length']?_0x5d8376[_0xdb4d('0x39')]:_0x22003e[_0xdb4d('0x34')];_0x5d8376['order']=qs[_0xdb4d('0x3f')](_0x73c500[_0xdb4d('0x35')][_0xdb4d('0x3f')]);_0x5d8376[_0xdb4d('0x45')]=qs[_0xdb4d('0x37')](_['pick'](_0x73c500[_0xdb4d('0x35')],_0x22003e[_0xdb4d('0x37')]));if(_0x73c500['query']['filter']){_0x5d8376[_0xdb4d('0x45')]=_[_0xdb4d('0x42')](_0x5d8376[_0xdb4d('0x45')],{'$or':_[_0xdb4d('0x30')](_0x5d8376[_0xdb4d('0x39')],function(_0xf6a1f9){var _0x4ebf2f={};_0x4ebf2f[_0xf6a1f9]={'$like':'%'+_0x73c500['query'][_0xdb4d('0x41')]+'%'};return _0x4ebf2f;})});}_0x5d8376=_[_0xdb4d('0x42')]({},_0x5d8376,_0x73c500['options']);return _0x2fe1ae[_0xdb4d('0x67')](_0x5d8376);}})[_0xdb4d('0x27')](function(_0x183c81){if(_0x183c81){_0x53254d=_0x183c81['length'];if(!_0x73c500['query'][_0xdb4d('0x3c')]('nolimit')){_0x5d8376[_0xdb4d('0x21')]=qs[_0xdb4d('0x21')](_0x73c500[_0xdb4d('0x35')]['limit']);_0x5d8376['offset']=qs['offset'](_0x73c500[_0xdb4d('0x35')][_0xdb4d('0x1f')]);}return _0x2fe1ae[_0xdb4d('0x67')](_0x5d8376);}})[_0xdb4d('0x27')](function(_0x2b8302){if(_0x2b8302){return _0x2b8302?{'count':_0x53254d,'rows':_0x2b8302}:null;}})[_0xdb4d('0x27')](respondWithResult(_0x4d4929,null))[_0xdb4d('0x4a')](handleError(_0x4d4929,null));};exports[_0xdb4d('0x68')]=function(_0x397274,_0x214d76,_0x10e458){var _0x50198f,_0x51d3ba;return db[_0xdb4d('0x46')][_0xdb4d('0x4d')]({'where':{'id':_0x397274['params']['id']}})[_0xdb4d('0x27')](handleEntityNotFound(_0x214d76,null))[_0xdb4d('0x27')](function(_0x572646){if(_0x572646){_0x51d3ba=_0x572646;return _0x572646[_0xdb4d('0x68')](_0x397274[_0xdb4d('0x5b')][_0xdb4d('0x69')],_[_0xdb4d('0x59')](_0x397274[_0xdb4d('0x5b')],[_0xdb4d('0x69'),'id'])||{});}return null;})[_0xdb4d('0x6a')](function(_0x1f9e45){var _0x149c28;_0x50198f=_0x1f9e45||[];var _0x548b83=[];if(_0x1f9e45){for(var _0x521bb9=0x0;_0x521bb9<_0x1f9e45[_0xdb4d('0x3b')];_0x521bb9+=0x1){var _0x3359b0=_0x1f9e45[_0x521bb9][_0xdb4d('0x29')]({'plain':!![]});_0x51d3ba['dialCheckDuplicateType']=_0x397274[_0xdb4d('0x5b')][_0xdb4d('0x6b')]?_0x397274[_0xdb4d('0x5b')][_0xdb4d('0x6b')]:_0x51d3ba[_0xdb4d('0x6b')];switch(_0x51d3ba['dialCheckDuplicateType']){case'always':_0x149c28=squel[_0xdb4d('0x6c')]()[_0xdb4d('0x6d')](_0xdb4d('0x6e'))[_0xdb4d('0x6f')]([_0xdb4d('0x70'),_0xdb4d('0x71'),_0xdb4d('0x72'),_0xdb4d('0x73'),_0xdb4d('0x5f'),_0xdb4d('0x5a'),'updatedAt'],squel['select']()[_0xdb4d('0x74')](_0xdb4d('0x70'),_0xdb4d('0x70'))['field'](_0xdb4d('0x75'),_0xdb4d('0x71'))['field']('id','ContactId')[_0xdb4d('0x74')](_0x3359b0[_0xdb4d('0x76')][_0xdb4d('0x77')](),_0xdb4d('0x73'))[_0xdb4d('0x74')](_0x397274[_0xdb4d('0x57')]['id']['toString'](),_0xdb4d('0x5f'))[_0xdb4d('0x74')]('NOW()',_0xdb4d('0x5a'))[_0xdb4d('0x74')](_0xdb4d('0x75'),'updatedAt')[_0xdb4d('0x78')]('cm_contacts')[_0xdb4d('0x45')](_0xdb4d('0x79'))[_0xdb4d('0x45')](_0xdb4d('0x7a'),_0x3359b0[_0xdb4d('0x76')][_0xdb4d('0x77')]())[_0xdb4d('0x45')](_0xdb4d('0x7b'))[_0xdb4d('0x45')](_0xdb4d('0x7c'),squel['select']()['field'](_0xdb4d('0x7d'))['from']('cm_hopper_final')[_0xdb4d('0x45')](_0xdb4d('0x7e'),_0x397274[_0xdb4d('0x57')]['id'][_0xdb4d('0x77')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xdb4d('0x74')](_0xdb4d('0x7f'))[_0xdb4d('0x78')]('cm_hopper')['where'](_0xdb4d('0x7e'),_0x397274['params']['id'][_0xdb4d('0x77')]())))[_0xdb4d('0x77')]();break;case _0xdb4d('0x80'):_0x149c28=squel[_0xdb4d('0x6c')]()[_0xdb4d('0x6d')](_0xdb4d('0x6e'))[_0xdb4d('0x6f')](['phone',_0xdb4d('0x71'),_0xdb4d('0x72'),_0xdb4d('0x73'),_0xdb4d('0x5f'),_0xdb4d('0x5a'),_0xdb4d('0x5c')],squel[_0xdb4d('0x81')]()[_0xdb4d('0x74')](_0xdb4d('0x70'),'phone')[_0xdb4d('0x74')](_0xdb4d('0x75'),_0xdb4d('0x71'))[_0xdb4d('0x74')]('id',_0xdb4d('0x72'))[_0xdb4d('0x74')](_0x3359b0[_0xdb4d('0x76')][_0xdb4d('0x77')](),_0xdb4d('0x73'))[_0xdb4d('0x74')](_0x397274[_0xdb4d('0x57')]['id'][_0xdb4d('0x77')](),'CampaignId')[_0xdb4d('0x74')](_0xdb4d('0x75'),_0xdb4d('0x5a'))[_0xdb4d('0x74')](_0xdb4d('0x75'),'updatedAt')['from']('cm_contacts')[_0xdb4d('0x45')](_0xdb4d('0x79'))[_0xdb4d('0x45')](_0xdb4d('0x7a'),_0x3359b0[_0xdb4d('0x76')][_0xdb4d('0x77')]())['where'](_0xdb4d('0x7b'))[_0xdb4d('0x45')](_0xdb4d('0x7c'),squel[_0xdb4d('0x81')]()[_0xdb4d('0x74')]('COALESCE(phone,\x27\x27)')[_0xdb4d('0x78')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x397274[_0xdb4d('0x57')]['id'][_0xdb4d('0x77')]())))[_0xdb4d('0x77')]();break;default:_0x149c28=squel[_0xdb4d('0x6c')]()[_0xdb4d('0x6d')]('cm_hopper')[_0xdb4d('0x6f')]([_0xdb4d('0x70'),_0xdb4d('0x71'),_0xdb4d('0x72'),_0xdb4d('0x73'),_0xdb4d('0x5f'),_0xdb4d('0x5a'),_0xdb4d('0x5c')],squel[_0xdb4d('0x81')]()[_0xdb4d('0x74')]('phone',_0xdb4d('0x70'))[_0xdb4d('0x74')](_0xdb4d('0x75'),_0xdb4d('0x71'))['field']('id',_0xdb4d('0x72'))[_0xdb4d('0x74')](_0x3359b0[_0xdb4d('0x76')][_0xdb4d('0x77')](),_0xdb4d('0x73'))[_0xdb4d('0x74')](_0x397274[_0xdb4d('0x57')]['id'][_0xdb4d('0x77')](),'CampaignId')['field'](_0xdb4d('0x75'),_0xdb4d('0x5a'))[_0xdb4d('0x74')](_0xdb4d('0x75'),_0xdb4d('0x5c'))[_0xdb4d('0x78')](_0xdb4d('0x82'))[_0xdb4d('0x45')](_0xdb4d('0x79'))[_0xdb4d('0x45')]('ListId\x20=\x20?',_0x3359b0[_0xdb4d('0x76')]['toString']())['where'](_0xdb4d('0x7b')))[_0xdb4d('0x77')]();}_0x548b83[_0xdb4d('0x83')](db[_0xdb4d('0x84')][_0xdb4d('0x35')](_0x149c28));}return BPromise[_0xdb4d('0x85')](_0x548b83);}})[_0xdb4d('0x27')](function(){return _0x50198f;})[_0xdb4d('0x27')](respondWithResult(_0x214d76,null))[_0xdb4d('0x4a')](handleError(_0x214d76,null));};exports[_0xdb4d('0x86')]=function(_0x14fda4,_0x6d2495,_0x48810c){return db[_0xdb4d('0x46')][_0xdb4d('0x4d')]({'where':{'id':_0x14fda4['params']['id']}})[_0xdb4d('0x27')](handleEntityNotFound(_0x6d2495,null))[_0xdb4d('0x27')](function(_0x1ac25f){if(_0x1ac25f){return _0x1ac25f[_0xdb4d('0x86')](_0x14fda4[_0xdb4d('0x35')][_0xdb4d('0x69')]);}})['then'](function(_0x293615){if(_0x293615){return db[_0xdb4d('0x5e')][_0xdb4d('0x28')]({'where':{'ListId':_0x14fda4[_0xdb4d('0x35')][_0xdb4d('0x69')],'CampaignId':_0x14fda4[_0xdb4d('0x57')]['id']}})['then'](function(){return _0x293615;});}})[_0xdb4d('0x27')](respondWithStatusCode(_0x6d2495,null))[_0xdb4d('0x4a')](handleError(_0x6d2495,null));};exports['getBlackLists']=function(_0x1b7592,_0x30338b,_0x12a535){var _0x9e3c19={};var _0x49f98a={};var _0x3b854a;var _0x495585;return db['Campaign'][_0xdb4d('0x5d')]({'where':{'id':_0x1b7592[_0xdb4d('0x57')]['id']}})[_0xdb4d('0x27')](handleEntityNotFound(_0x30338b,null))[_0xdb4d('0x27')](function(_0x33e8bd){if(_0x33e8bd){_0x3b854a=_0x33e8bd;_0x49f98a[_0xdb4d('0x34')]=_[_0xdb4d('0x36')](db[_0xdb4d('0x87')]['rawAttributes']);_0x49f98a[_0xdb4d('0x35')]=_[_0xdb4d('0x36')](_0x1b7592[_0xdb4d('0x35')]);_0x49f98a[_0xdb4d('0x37')]=_['intersection'](_0x49f98a[_0xdb4d('0x34')],_0x49f98a[_0xdb4d('0x35')]);_0x9e3c19[_0xdb4d('0x39')]=_[_0xdb4d('0x38')](_0x49f98a[_0xdb4d('0x34')],qs[_0xdb4d('0x3a')](_0x1b7592['query'][_0xdb4d('0x3a')]));_0x9e3c19[_0xdb4d('0x39')]=_0x9e3c19[_0xdb4d('0x39')][_0xdb4d('0x3b')]?_0x9e3c19['attributes']:_0x49f98a['model'];_0x9e3c19[_0xdb4d('0x3e')]=qs[_0xdb4d('0x3f')](_0x1b7592[_0xdb4d('0x35')]['sort']);_0x9e3c19[_0xdb4d('0x45')]=qs[_0xdb4d('0x37')](_[_0xdb4d('0x40')](_0x1b7592[_0xdb4d('0x35')],_0x49f98a[_0xdb4d('0x37')]));if(_0x1b7592[_0xdb4d('0x35')][_0xdb4d('0x41')]){_0x9e3c19[_0xdb4d('0x45')]=_['merge'](_0x9e3c19[_0xdb4d('0x45')],{'$or':_[_0xdb4d('0x30')](_0x9e3c19[_0xdb4d('0x39')],function(_0x51b384){var _0x4f372b={};_0x4f372b[_0x51b384]={'$like':'%'+_0x1b7592[_0xdb4d('0x35')][_0xdb4d('0x41')]+'%'};return _0x4f372b;})});}_0x9e3c19=_[_0xdb4d('0x42')]({},_0x9e3c19,_0x1b7592[_0xdb4d('0x44')]);return _0x3b854a['getBlackLists'](_0x9e3c19);}})['then'](function(_0x53f7dd){if(_0x53f7dd){_0x495585=_0x53f7dd[_0xdb4d('0x3b')];if(!_0x1b7592[_0xdb4d('0x35')][_0xdb4d('0x3c')](_0xdb4d('0x3d'))){_0x9e3c19[_0xdb4d('0x21')]=qs[_0xdb4d('0x21')](_0x1b7592[_0xdb4d('0x35')][_0xdb4d('0x21')]);_0x9e3c19['offset']=qs[_0xdb4d('0x1f')](_0x1b7592[_0xdb4d('0x35')][_0xdb4d('0x1f')]);}return _0x3b854a[_0xdb4d('0x88')](_0x9e3c19);}})[_0xdb4d('0x27')](function(_0x15edd5){if(_0x15edd5){return _0x15edd5?{'count':_0x495585,'rows':_0x15edd5}:null;}})[_0xdb4d('0x27')](respondWithResult(_0x30338b,null))[_0xdb4d('0x4a')](handleError(_0x30338b,null));};exports[_0xdb4d('0x89')]=function(_0x4d0c21,_0x1bf6bc,_0x2ef7e7){var _0x5986ed,_0x473b07;return db[_0xdb4d('0x46')][_0xdb4d('0x4d')]({'where':{'id':_0x4d0c21[_0xdb4d('0x57')]['id']}})[_0xdb4d('0x27')](handleEntityNotFound(_0x1bf6bc,null))[_0xdb4d('0x27')](function(_0x45ae49){if(_0x45ae49){_0x473b07=_0x45ae49;return _0x45ae49[_0xdb4d('0x89')](_0x4d0c21[_0xdb4d('0x5b')]['ids'],_[_0xdb4d('0x59')](_0x4d0c21[_0xdb4d('0x5b')],['ids','id'])||{});}return null;})['spread'](function(_0x4142d9){var _0x189e67;_0x5986ed=_0x4142d9||[];var _0x37c782=[];if(_0x4142d9){for(var _0x515cf4=0x0;_0x515cf4<_0x4142d9[_0xdb4d('0x3b')];_0x515cf4+=0x1){var _0xdff872=_0x4142d9[_0x515cf4][_0xdb4d('0x29')]({'plain':!![]});_0x189e67=squel[_0xdb4d('0x6c')]()[_0xdb4d('0x6d')](_0xdb4d('0x8a'))[_0xdb4d('0x6f')](['phone',_0xdb4d('0x72'),_0xdb4d('0x73'),'CampaignId','createdAt',_0xdb4d('0x5c')],squel[_0xdb4d('0x81')]()[_0xdb4d('0x74')](_0xdb4d('0x70'),_0xdb4d('0x70'))[_0xdb4d('0x74')]('id',_0xdb4d('0x72'))['field'](_0xdff872['CmListId'][_0xdb4d('0x77')](),_0xdb4d('0x73'))[_0xdb4d('0x74')](_0x4d0c21[_0xdb4d('0x57')]['id'][_0xdb4d('0x77')](),_0xdb4d('0x5f'))['field'](_0xdb4d('0x75'),_0xdb4d('0x5a'))[_0xdb4d('0x74')](_0xdb4d('0x75'),'updatedAt')[_0xdb4d('0x78')](_0xdb4d('0x82'))[_0xdb4d('0x45')](_0xdb4d('0x79'))[_0xdb4d('0x45')](_0xdb4d('0x7a'),_0xdff872['CmListId'][_0xdb4d('0x77')]())[_0xdb4d('0x45')](_0xdb4d('0x7b')))[_0xdb4d('0x77')]();_0x37c782[_0xdb4d('0x83')](db[_0xdb4d('0x84')][_0xdb4d('0x35')](_0x189e67));}return BPromise[_0xdb4d('0x85')](_0x37c782);}})[_0xdb4d('0x27')](function(){return _0x5986ed;})[_0xdb4d('0x27')](respondWithResult(_0x1bf6bc,null))[_0xdb4d('0x4a')](handleError(_0x1bf6bc,null));};exports['removeBlackLists']=function(_0x253f3e,_0xd8c926,_0x1255c6){return db[_0xdb4d('0x46')][_0xdb4d('0x4d')]({'where':{'id':_0x253f3e['params']['id']}})[_0xdb4d('0x27')](handleEntityNotFound(_0xd8c926,null))[_0xdb4d('0x27')](function(_0x5cb646){if(_0x5cb646){return _0x5cb646[_0xdb4d('0x8b')](_0x253f3e[_0xdb4d('0x35')][_0xdb4d('0x69')]);}})[_0xdb4d('0x27')](function(_0x506d14){if(_0x506d14){return db[_0xdb4d('0x66')]['destroy']({'where':{'ListId':_0x253f3e[_0xdb4d('0x35')][_0xdb4d('0x69')],'CampaignId':_0x253f3e[_0xdb4d('0x57')]['id']}})['then'](function(){return _0x506d14;});}})[_0xdb4d('0x27')](respondWithStatusCode(_0xd8c926,null))['catch'](handleError(_0xd8c926,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 5fd12da..343233a 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(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4dc5eb,_0x8e2c9a){var _0x55a235=function(_0x4269c4){while(--_0x4269c4){_0x4dc5eb['push'](_0x4dc5eb['shift']());}};_0x55a235(++_0x8e2c9a);}(_0x7a54,0x106));var _0x47a5=function(_0x42cd00,_0x5b5ab5){_0x42cd00=_0x42cd00-0x0;var _0x4a1077=_0x7a54[_0x42cd00];return _0x4a1077;};'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 19ca22f..c442ca8 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 _0x5178=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','include','map','model','then','util','moment','bluebird'];(function(_0x319674,_0x3be6e7){var _0x5b140a=function(_0x20277d){while(--_0x20277d){_0x319674['push'](_0x319674['shift']());}};_0x5b140a(++_0x3be6e7);}(_0x5178,0x171));var _0x8517=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5178[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x8517('0x0'));var moment=require(_0x8517('0x1'));var BPromise=require(_0x8517('0x2'));var rs=require(_0x8517('0x3'));var fs=require('fs');var Redis=require(_0x8517('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8517('0x5'))(_0x8517('0x6'));var config=require('../../config/environment');var jayson=require(_0x8517('0x7'));var client=jayson['client'][_0x8517('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45498e,_0x3615b2,_0x10f918){return new BPromise(function(_0x25146d,_0x49739b){return client[_0x8517('0x9')](_0x45498e,_0x10f918)['then'](function(_0x485677){logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,'request\x20sent');logger[_0x8517('0xc')](_0x8517('0xd'),_0x3615b2,_0x8517('0xe'),JSON[_0x8517('0xf')](_0x485677));if(_0x485677[_0x8517('0x10')]){if(_0x485677[_0x8517('0x10')][_0x8517('0x11')]===0x1f4){logger[_0x8517('0x10')]('Campaign,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x49739b(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}logger[_0x8517('0x10')]('Campaign,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x25146d(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}else{logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,_0x8517('0xe'));_0x25146d(_0x485677[_0x8517('0x13')][_0x8517('0x12')]);}})[_0x8517('0x14')](function(_0x22b687){logger[_0x8517('0x10')]('Campaign,\x20%s,\x20%s',_0x3615b2,_0x22b687);_0x49739b(_0x22b687);});});}exports[_0x8517('0x15')]=function(_0x100b76){var _0x38e0f3=this;return new Promise(function(_0xf1b53b,_0x64875e){return db[_0x8517('0x16')][_0x8517('0x17')]({'raw':_0x100b76['options']?_0x100b76[_0x8517('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x100b76['options']?_0x100b76[_0x8517('0x18')][_0x8517('0x19')]||null:null,'attributes':_0x100b76[_0x8517('0x18')]?_0x100b76[_0x8517('0x18')][_0x8517('0x1a')]||null:null,'limit':_0x100b76[_0x8517('0x18')]?_0x100b76['options']['limit']||null:null,'include':_0x100b76[_0x8517('0x18')]?_0x100b76[_0x8517('0x18')][_0x8517('0x1b')]?_[_0x8517('0x1c')](_0x100b76[_0x8517('0x18')][_0x8517('0x1b')],function(_0x5f02ee){return{'model':db[_0x5f02ee[_0x8517('0x1d')]],'as':_0x5f02ee['as'],'attributes':_0x5f02ee[_0x8517('0x1a')],'include':_0x5f02ee['include']?_[_0x8517('0x1c')](_0x5f02ee[_0x8517('0x1b')],function(_0x42c779){return{'model':db[_0x42c779['model']],'as':_0x42c779['as'],'attributes':_0x42c779[_0x8517('0x1a')],'include':_0x42c779['include']?_[_0x8517('0x1c')](_0x42c779[_0x8517('0x1b')],function(_0x448211){return{'model':db[_0x448211[_0x8517('0x1d')]],'as':_0x448211['as'],'attributes':_0x448211[_0x8517('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8517('0x1e')](function(_0x481ceb){logger[_0x8517('0xa')]('GetCampaign',_0x100b76);logger[_0x8517('0xc')](_0x8517('0x15'),_0x100b76,JSON[_0x8517('0xf')](_0x481ceb));_0xf1b53b(_0x481ceb);})[_0x8517('0x14')](function(_0x3e6f89){logger[_0x8517('0x10')]('GetCampaign',_0x3e6f89[_0x8517('0x12')],_0x100b76);_0x64875e(_0x38e0f3['error'](0x1f4,_0x3e6f89[_0x8517('0x12')]));});});}; \ No newline at end of file +var _0x8388=['stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','Campaign,\x20%s,\x20%s','info','result','catch','GetCampaign','findAll','options','raw','where','limit','include','map','model','attributes','then'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x8388,0x18d));var _0x8838=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x8388[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var moment=require(_0x8838('0x2'));var BPromise=require(_0x8838('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8838('0x4'));var db=require(_0x8838('0x5'))['db'];var utils=require(_0x8838('0x6'));var logger=require(_0x8838('0x7'))(_0x8838('0x8'));var config=require('../../config/environment');var jayson=require(_0x8838('0x9'));var client=jayson[_0x8838('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xca2d0f,_0x2d9615,_0x27707c){return new BPromise(function(_0x56596f,_0x4645f4){return client['request'](_0xca2d0f,_0x27707c)['then'](function(_0x8555b2){logger['info']('Campaign,\x20%s,\x20%s',_0x2d9615,_0x8838('0xb'));logger[_0x8838('0xc')](_0x8838('0xd'),_0x2d9615,_0x8838('0xb'),JSON['stringify'](_0x8555b2));if(_0x8555b2[_0x8838('0xe')]){if(_0x8555b2[_0x8838('0xe')][_0x8838('0xf')]===0x1f4){logger[_0x8838('0xe')]('Campaign,\x20%s,\x20%s',_0x2d9615,_0x8555b2[_0x8838('0xe')]['message']);return _0x4645f4(_0x8555b2['error'][_0x8838('0x10')]);}logger[_0x8838('0xe')](_0x8838('0x11'),_0x2d9615,_0x8555b2[_0x8838('0xe')][_0x8838('0x10')]);return _0x56596f(_0x8555b2[_0x8838('0xe')][_0x8838('0x10')]);}else{logger[_0x8838('0x12')]('Campaign,\x20%s,\x20%s',_0x2d9615,_0x8838('0xb'));_0x56596f(_0x8555b2[_0x8838('0x13')]['message']);}})[_0x8838('0x14')](function(_0xab3fb8){logger[_0x8838('0xe')]('Campaign,\x20%s,\x20%s',_0x2d9615,_0xab3fb8);_0x4645f4(_0xab3fb8);});});}exports[_0x8838('0x15')]=function(_0x522d44){var _0xc4129=this;return new Promise(function(_0x204120,_0xe9e4f4){return db['Campaign'][_0x8838('0x16')]({'raw':_0x522d44[_0x8838('0x17')]?_0x522d44['options'][_0x8838('0x18')]===undefined?!![]:![]:!![],'where':_0x522d44[_0x8838('0x17')]?_0x522d44['options'][_0x8838('0x19')]||null:null,'attributes':_0x522d44[_0x8838('0x17')]?_0x522d44['options']['attributes']||null:null,'limit':_0x522d44[_0x8838('0x17')]?_0x522d44[_0x8838('0x17')][_0x8838('0x1a')]||null:null,'include':_0x522d44[_0x8838('0x17')]?_0x522d44[_0x8838('0x17')][_0x8838('0x1b')]?_[_0x8838('0x1c')](_0x522d44[_0x8838('0x17')][_0x8838('0x1b')],function(_0x56a4de){return{'model':db[_0x56a4de[_0x8838('0x1d')]],'as':_0x56a4de['as'],'attributes':_0x56a4de['attributes'],'include':_0x56a4de[_0x8838('0x1b')]?_[_0x8838('0x1c')](_0x56a4de['include'],function(_0x50b05a){return{'model':db[_0x50b05a[_0x8838('0x1d')]],'as':_0x50b05a['as'],'attributes':_0x50b05a[_0x8838('0x1e')],'include':_0x50b05a[_0x8838('0x1b')]?_[_0x8838('0x1c')](_0x50b05a[_0x8838('0x1b')],function(_0x1b3153){return{'model':db[_0x1b3153[_0x8838('0x1d')]],'as':_0x1b3153['as'],'attributes':_0x1b3153[_0x8838('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8838('0x1f')](function(_0x34ba38){logger['info']('GetCampaign',_0x522d44);logger[_0x8838('0xc')]('GetCampaign',_0x522d44,JSON[_0x8838('0x20')](_0x34ba38));_0x204120(_0x34ba38);})[_0x8838('0x14')](function(_0x5da3b0){logger['error'](_0x8838('0x15'),_0x5da3b0['message'],_0x522d44);_0xe9e4f4(_0xc4129['error'](0x1f4,_0x5da3b0[_0x8838('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index e62269e..64fe662 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 _0x49e9=['isAuthenticated','/:id','show','/:id/hoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./campaign.controller','get'];(function(_0x37dee5,_0x894eb5){var _0x42544b=function(_0x31d562){while(--_0x31d562){_0x37dee5['push'](_0x37dee5['shift']());}};_0x42544b(++_0x894eb5);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var path=require('path');var timeout=require(_0x949e('0x2'));var express=require(_0x949e('0x3'));var router=express[_0x949e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x949e('0x5'));var config=require('../../config/environment');var controller=require(_0x949e('0x6'));router[_0x949e('0x7')]('/',auth[_0x949e('0x8')](),controller['index']);router[_0x949e('0x7')](_0x949e('0x9'),auth[_0x949e('0x8')](),controller[_0x949e('0xa')]);router[_0x949e('0x7')](_0x949e('0xb'),auth[_0x949e('0x8')](),controller['getHoppers']);router[_0x949e('0x7')]('/:id/hopper_histories',auth[_0x949e('0x8')](),controller[_0x949e('0xc')]);router[_0x949e('0x7')]('/:id/hopper_finals',auth[_0x949e('0x8')](),controller[_0x949e('0xd')]);router[_0x949e('0x7')](_0x949e('0xe'),auth[_0x949e('0x8')](),controller[_0x949e('0xf')]);router[_0x949e('0x7')](_0x949e('0x10'),auth[_0x949e('0x8')](),controller[_0x949e('0x11')]);router[_0x949e('0x7')](_0x949e('0x12'),auth[_0x949e('0x8')](),controller[_0x949e('0x13')]);router[_0x949e('0x14')]('/',auth['isAuthenticated'](),controller[_0x949e('0x15')]);router[_0x949e('0x14')](_0x949e('0x16'),auth[_0x949e('0x8')](),controller['clone']);router[_0x949e('0x14')](_0x949e('0x10'),auth['isAuthenticated'](),controller[_0x949e('0x17')]);router[_0x949e('0x14')](_0x949e('0x12'),auth[_0x949e('0x8')](),controller[_0x949e('0x18')]);router['put'](_0x949e('0x9'),auth[_0x949e('0x8')](),controller[_0x949e('0x19')]);router[_0x949e('0x1a')](_0x949e('0x9'),auth[_0x949e('0x8')](),controller[_0x949e('0x1b')]);router[_0x949e('0x1a')](_0x949e('0x10'),auth[_0x949e('0x8')](),controller[_0x949e('0x1c')]);router[_0x949e('0x1a')](_0x949e('0x12'),auth[_0x949e('0x8')](),controller[_0x949e('0x1d')]);module[_0x949e('0x1e')]=router; \ No newline at end of file +var _0xac52=['removeBlackLists','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','put','delete','destroy','removeLists'];(function(_0x28872a,_0x4cff96){var _0x2c7f9a=function(_0x3300c7){while(--_0x3300c7){_0x28872a['push'](_0x28872a['shift']());}};_0x2c7f9a(++_0x4cff96);}(_0xac52,0x122));var _0x2ac5=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0xac52[_0x4e93a9];return _0x43013c;};'use strict';var multer=require('multer');var util=require(_0x2ac5('0x0'));var path=require(_0x2ac5('0x1'));var timeout=require(_0x2ac5('0x2'));var express=require(_0x2ac5('0x3'));var router=express[_0x2ac5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ac5('0x5'));var interaction=require(_0x2ac5('0x6'));var config=require('../../config/environment');var controller=require(_0x2ac5('0x7'));router[_0x2ac5('0x8')]('/',auth[_0x2ac5('0x9')](),controller['index']);router['get'](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xb')]);router[_0x2ac5('0x8')](_0x2ac5('0xc'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xd')]);router[_0x2ac5('0x8')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller['getHopperHistories']);router[_0x2ac5('0x8')](_0x2ac5('0xf'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x10')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x2ac5('0x11')]);router[_0x2ac5('0x8')](_0x2ac5('0x12'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x13')]);router['get'](_0x2ac5('0x14'),auth['isAuthenticated'](),controller[_0x2ac5('0x15')]);router[_0x2ac5('0x16')]('/',auth[_0x2ac5('0x9')](),controller['create']);router['post'](_0x2ac5('0x17'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x18')]);router[_0x2ac5('0x16')](_0x2ac5('0x12'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x19')]);router[_0x2ac5('0x16')](_0x2ac5('0x14'),auth[_0x2ac5('0x9')](),controller['addBlackLists']);router[_0x2ac5('0x1a')](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller['update']);router[_0x2ac5('0x1b')](_0x2ac5('0xa'),auth['isAuthenticated'](),controller[_0x2ac5('0x1c')]);router[_0x2ac5('0x1b')](_0x2ac5('0x12'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x1d')]);router[_0x2ac5('0x1b')](_0x2ac5('0x14'),auth['isAuthenticated'](),controller[_0x2ac5('0x1e')]);module[_0x2ac5('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index d50beda..8a8614b 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 _0x5075=['key','sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x119ffc,_0x2bfa14){var _0x21603f=function(_0x43c105){while(--_0x43c105){_0x119ffc['push'](_0x119ffc['shift']());}};_0x21603f(++_0x2bfa14);}(_0x5075,0x15f));var _0x5507=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0x5075[_0x1b02bb];return _0x131245;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'key':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x5507('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'name':{'type':Sequelize[_0x5507('0x4')],'get':function(){return this[_0x5507('0x5')](_0x5507('0x6'));}}}; \ No newline at end of file +var _0x577e=['STRING','TEXT','getDataValue','key','sequelize','exports'];(function(_0x2f2fd0,_0x3c980d){var _0x44f94f=function(_0x1fb033){while(--_0x1fb033){_0x2f2fd0['push'](_0x2f2fd0['shift']());}};_0x44f94f(++_0x3c980d);}(_0x577e,0xdc));var _0xe577=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0x577e[_0x4b4f24];return _0x1c13d4;};'use strict';var Sequelize=require(_0xe577('0x0'));module[_0xe577('0x1')]={'key':{'type':Sequelize[_0xe577('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xe577('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xe577('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe577('0x4')](_0xe577('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index eb85a6a..917fff7 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 _0x95e2=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','show','params','catch','body','find','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId'];(function(_0x466f46,_0x53cb02){var _0x3fad5d=function(_0x58ce80){while(--_0x58ce80){_0x466f46['push'](_0x466f46['shift']());}};_0x3fad5d(++_0x53cb02);}(_0x95e2,0x113));var _0x295e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x95e2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x295e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x295e('0x1'));var jsonpatch=require(_0x295e('0x2'));var rp=require('request-promise');var moment=require(_0x295e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x295e('0x4'));var path=require(_0x295e('0x5'));var sox=require(_0x295e('0x6'));var csv=require(_0x295e('0x7'));var ejs=require(_0x295e('0x8'));var fs=require('fs');var fs_extra=require(_0x295e('0x9'));var _=require(_0x295e('0xa'));var squel=require('squel');var crypto=require(_0x295e('0xb'));var jsforce=require(_0x295e('0xc'));var deskjs=require(_0x295e('0xd'));var toCsv=require(_0x295e('0x7'));var querystring=require(_0x295e('0xe'));var Papa=require(_0x295e('0xf'));var Redis=require(_0x295e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x295e('0x11'));var as=require(_0x295e('0x12'));var hardwareService=require(_0x295e('0x13'));var logger=require(_0x295e('0x14'))('api');var utils=require(_0x295e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x295e('0x16'));var db=require(_0x295e('0x17'))['db'];function respondWithStatusCode(_0x519644,_0x2e5002){_0x2e5002=_0x2e5002||0xcc;return function(_0x5bd4ef){if(_0x5bd4ef){return _0x519644['sendStatus'](_0x2e5002);}return _0x519644[_0x295e('0x18')](_0x2e5002)[_0x295e('0x19')]();};}function respondWithResult(_0x1138a9,_0x5d06d5){_0x5d06d5=_0x5d06d5||0xc8;return function(_0x1fd731){if(_0x1fd731){return _0x1138a9[_0x295e('0x18')](_0x5d06d5)[_0x295e('0x1a')](_0x1fd731);}};}function respondWithFilteredResult(_0x2757de,_0x24ac86){return function(_0x14c1ea){if(_0x14c1ea){var _0x1f1aac=typeof _0x24ac86[_0x295e('0x1b')]===_0x295e('0x1c')&&typeof _0x24ac86[_0x295e('0x1d')]===_0x295e('0x1c');var _0x460440=_0x14c1ea[_0x295e('0x1e')];var _0x5a4671=_0x1f1aac?0x0:_0x24ac86[_0x295e('0x1b')];var _0x4a9a09=_0x1f1aac?_0x14c1ea[_0x295e('0x1e')]:_0x24ac86[_0x295e('0x1b')]+_0x24ac86['limit'];var _0x4e2085;if(_0x4a9a09>=_0x460440){_0x4a9a09=_0x460440;_0x4e2085=0xc8;}else{_0x4e2085=0xce;}_0x2757de[_0x295e('0x18')](_0x4e2085);return _0x2757de[_0x295e('0x1f')]('Content-Range',_0x5a4671+'-'+_0x4a9a09+'/'+_0x460440)[_0x295e('0x1a')](_0x14c1ea);}return null;};}function patchUpdates(_0x5b4a7a){return function(_0x2ff97e){try{jsonpatch[_0x295e('0x20')](_0x2ff97e,_0x5b4a7a,!![]);}catch(_0x4371b6){return BPromise[_0x295e('0x21')](_0x4371b6);}return _0x2ff97e[_0x295e('0x22')]();};}function saveUpdates(_0x3362f3,_0x1304b8){return function(_0x3bb554){if(_0x3bb554){return _0x3bb554[_0x295e('0x23')](_0x3362f3)['then'](function(_0x5d380c){return _0x5d380c;});}return null;};}function removeEntity(_0x2d0e09,_0x39e73a){return function(_0x28b91f){if(_0x28b91f){return _0x28b91f[_0x295e('0x24')]()[_0x295e('0x25')](function(){var _0x5d4f87=_0x28b91f['get']({'plain':!![]});var _0x230d97=_0x295e('0x26');return db[_0x295e('0x27')][_0x295e('0x24')]({'where':{'type':_0x230d97,'resourceId':_0x5d4f87['id']}})[_0x295e('0x25')](function(){return _0x28b91f;});})[_0x295e('0x25')](function(){_0x2d0e09[_0x295e('0x18')](0xcc)[_0x295e('0x19')]();});}};}function handleEntityNotFound(_0x3587fb,_0x584d90){return function(_0x4dea8d){if(!_0x4dea8d){_0x3587fb[_0x295e('0x28')](0x194);}return _0x4dea8d;};}function handleError(_0x553a0b,_0x49f666){_0x49f666=_0x49f666||0x1f4;return function(_0x3fcdb5){logger[_0x295e('0x29')](_0x3fcdb5[_0x295e('0x2a')]);if(_0x3fcdb5[_0x295e('0x2b')]){delete _0x3fcdb5[_0x295e('0x2b')];}_0x553a0b[_0x295e('0x18')](_0x49f666)[_0x295e('0x2c')](_0x3fcdb5);};}exports[_0x295e('0x2d')]=function(_0x535801,_0x3620cd){var _0x23518f={},_0xd96174={},_0x358fb6={'count':0x0,'rows':[]};var _0x16ed0a=_['map'](db[_0x295e('0x2e')][_0x295e('0x2f')],function(_0x29c692){return{'name':_0x29c692[_0x295e('0x30')],'type':_0x29c692[_0x295e('0x31')]['key']};});_0xd96174[_0x295e('0x32')]=_[_0x295e('0x33')](_0x16ed0a,_0x295e('0x2b'));_0xd96174['query']=_[_0x295e('0x34')](_0x535801[_0x295e('0x35')]);_0xd96174[_0x295e('0x36')]=_[_0x295e('0x37')](_0xd96174[_0x295e('0x32')],_0xd96174[_0x295e('0x35')]);_0x23518f[_0x295e('0x38')]=_[_0x295e('0x37')](_0xd96174['model'],qs[_0x295e('0x39')](_0x535801['query'][_0x295e('0x39')]));_0x23518f[_0x295e('0x38')]=_0x23518f[_0x295e('0x38')][_0x295e('0x3a')]?_0x23518f[_0x295e('0x38')]:_0xd96174[_0x295e('0x32')];if(!_0x535801['query'][_0x295e('0x3b')](_0x295e('0x3c'))){_0x23518f[_0x295e('0x1d')]=qs[_0x295e('0x1d')](_0x535801[_0x295e('0x35')]['limit']);_0x23518f[_0x295e('0x1b')]=qs[_0x295e('0x1b')](_0x535801[_0x295e('0x35')][_0x295e('0x1b')]);}_0x23518f[_0x295e('0x3d')]=qs['sort'](_0x535801[_0x295e('0x35')][_0x295e('0x3e')]);_0x23518f[_0x295e('0x3f')]=qs[_0x295e('0x36')](_[_0x295e('0x40')](_0x535801['query'],_0xd96174[_0x295e('0x36')]),_0x16ed0a);if(_0x535801[_0x295e('0x35')]['filter']){_0x23518f['where']=_[_0x295e('0x41')](_0x23518f[_0x295e('0x3f')],{'$or':[{'key':{'$like':'%'+_0x535801[_0x295e('0x35')][_0x295e('0x42')]+'%'}},{'value':{'$like':'%'+_0x535801[_0x295e('0x35')][_0x295e('0x42')]+'%'}}]});}_0x23518f=_[_0x295e('0x41')]({},_0x23518f,_0x535801[_0x295e('0x43')]);var _0x1688d7={'where':_0x23518f[_0x295e('0x3f')]};return db[_0x295e('0x2e')][_0x295e('0x1e')](_0x1688d7)[_0x295e('0x25')](function(_0x312326){_0x358fb6[_0x295e('0x1e')]=_0x312326;if(_0x535801[_0x295e('0x35')][_0x295e('0x44')]){_0x23518f[_0x295e('0x45')]=[{'all':!![]}];}return db[_0x295e('0x2e')][_0x295e('0x46')](_0x23518f);})[_0x295e('0x25')](function(_0x349337){_0x358fb6['rows']=_0x349337;return _0x358fb6;})[_0x295e('0x25')](respondWithFilteredResult(_0x3620cd,_0x23518f))['catch'](handleError(_0x3620cd,null));};exports[_0x295e('0x47')]=function(_0x4fc28c,_0x14f45f){var _0x19e013={'raw':!![],'where':{'id':_0x4fc28c[_0x295e('0x48')]['id']}},_0x527422={};_0x527422[_0x295e('0x32')]=_[_0x295e('0x34')](db[_0x295e('0x2e')][_0x295e('0x2f')]);_0x527422[_0x295e('0x35')]=_[_0x295e('0x34')](_0x4fc28c[_0x295e('0x35')]);_0x527422[_0x295e('0x36')]=_[_0x295e('0x37')](_0x527422[_0x295e('0x32')],_0x527422['query']);_0x19e013[_0x295e('0x38')]=_[_0x295e('0x37')](_0x527422[_0x295e('0x32')],qs[_0x295e('0x39')](_0x4fc28c[_0x295e('0x35')][_0x295e('0x39')]));_0x19e013[_0x295e('0x38')]=_0x19e013[_0x295e('0x38')][_0x295e('0x3a')]?_0x19e013[_0x295e('0x38')]:_0x527422['model'];if(_0x4fc28c[_0x295e('0x35')][_0x295e('0x44')]){_0x19e013['include']=[{'all':!![]}];}_0x19e013=_[_0x295e('0x41')]({},_0x19e013,_0x4fc28c[_0x295e('0x43')]);return db['CannedAnswer']['find'](_0x19e013)[_0x295e('0x25')](handleEntityNotFound(_0x14f45f,null))[_0x295e('0x25')](respondWithResult(_0x14f45f,null))[_0x295e('0x49')](handleError(_0x14f45f,null));};exports[_0x295e('0x23')]=function(_0x1c434e,_0xb59234){if(_0x1c434e[_0x295e('0x4a')]['id']){delete _0x1c434e[_0x295e('0x4a')]['id'];}return db[_0x295e('0x2e')][_0x295e('0x4b')]({'where':{'id':_0x1c434e[_0x295e('0x48')]['id']}})[_0x295e('0x25')](handleEntityNotFound(_0xb59234,null))['then'](saveUpdates(_0x1c434e[_0x295e('0x4a')],null))[_0x295e('0x25')](respondWithResult(_0xb59234,null))[_0x295e('0x49')](handleError(_0xb59234,null));};exports['destroy']=function(_0x351191,_0x231b06){return db[_0x295e('0x2e')][_0x295e('0x4b')]({'where':{'id':_0x351191[_0x295e('0x48')]['id']}})[_0x295e('0x25')](handleEntityNotFound(_0x231b06,null))[_0x295e('0x25')](removeEntity(_0x231b06,null))[_0x295e('0x49')](handleError(_0x231b06,null));};exports[_0x295e('0x4c')]=function(_0x40f74e,_0x28da7e){var _0x40a9dc={'key':_0x40f74e[_0x295e('0x4a')][_0x295e('0x4d')]};if(_0x40f74e['body'][_0x295e('0x4e')]){_0x40a9dc[_0x295e('0x4e')]=_0x40f74e[_0x295e('0x4a')][_0x295e('0x4e')];}else if(_0x40f74e[_0x295e('0x4a')][_0x295e('0x4f')]){_0x40a9dc['SmsAccountId']=_0x40f74e[_0x295e('0x4a')][_0x295e('0x4f')];}else if(_0x40f74e['body'][_0x295e('0x50')]){_0x40a9dc[_0x295e('0x50')]=_0x40f74e[_0x295e('0x4a')]['OpenchannelAccountId'];}else if(_0x40f74e[_0x295e('0x4a')][_0x295e('0x51')]){_0x40a9dc['ChatWebsiteId']=_0x40f74e[_0x295e('0x4a')][_0x295e('0x51')];}return db[_0x295e('0x2e')][_0x295e('0x4b')]({'where':_0x40a9dc})[_0x295e('0x25')](function(_0x2e53e6){if(_0x2e53e6){throw new db[(_0x295e('0x52'))][(_0x295e('0x53'))](_0x295e('0x54'));}return db[_0x295e('0x2e')]['create'](_0x40f74e[_0x295e('0x4a')]);})[_0x295e('0x25')](function(_0x5b025e){var _0x2f140c=_0x40f74e['user']['get']({'plain':!![]});if(!_0x2f140c)throw new Error(_0x295e('0x55'));if(_0x2f140c['role']==='user'){var _0x2ccb93=_0x5b025e[_0x295e('0x56')]({'plain':!![]});return db[_0x295e('0x57')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x2f140c[_0x295e('0x58')]},'raw':!![]})['then'](function(_0x5cf4d8){if(_0x5cf4d8&&_0x5cf4d8[_0x295e('0x59')]===0x0){return db[_0x295e('0x27')]['create']({'name':_0x2ccb93[_0x295e('0x2b')],'resourceId':_0x2ccb93['id'],'type':_0x5cf4d8[_0x295e('0x2b')],'sectionId':_0x5cf4d8['id']},{})['then'](function(){return _0x5b025e;});}else{return _0x5b025e;}})[_0x295e('0x49')](function(_0x5a25a6){logger['error'](_0x295e('0x5a'),_0x5a25a6);throw _0x5a25a6;});}return _0x5b025e;})[_0x295e('0x25')](respondWithResult(_0x28da7e,0xc9))[_0x295e('0x49')](handleError(_0x28da7e,null));}; \ No newline at end of file +var _0xac02=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','save','then','get','CannedAnswers','error','stack','send','index','CannedAnswer','rawAttributes','type','model','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','params','keys','find','update','body','destroy','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api'];(function(_0x2668ed,_0x1bcf98){var _0x2864c2=function(_0x104aa7){while(--_0x104aa7){_0x2668ed['push'](_0x2668ed['shift']());}};_0x2864c2(++_0x1bcf98);}(_0xac02,0x17a));var _0x2ac0=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xac02[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x2ac0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2ac0('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2ac0('0x2'));var Mustache=require(_0x2ac0('0x3'));var util=require(_0x2ac0('0x4'));var path=require(_0x2ac0('0x5'));var sox=require(_0x2ac0('0x6'));var csv=require(_0x2ac0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ac0('0x8'));var squel=require(_0x2ac0('0x9'));var crypto=require(_0x2ac0('0xa'));var jsforce=require(_0x2ac0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2ac0('0x7'));var querystring=require('querystring');var Papa=require(_0x2ac0('0xc'));var Redis=require(_0x2ac0('0xd'));var authService=require(_0x2ac0('0xe'));var qs=require(_0x2ac0('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2ac0('0x10'));var utils=require(_0x2ac0('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x2ac0('0x12'));var db=require(_0x2ac0('0x13'))['db'];function respondWithStatusCode(_0x433543,_0x36aefc){_0x36aefc=_0x36aefc||0xcc;return function(_0x4dd1a6){if(_0x4dd1a6){return _0x433543[_0x2ac0('0x14')](_0x36aefc);}return _0x433543[_0x2ac0('0x15')](_0x36aefc)[_0x2ac0('0x16')]();};}function respondWithResult(_0x37d8ae,_0x15a3cb){_0x15a3cb=_0x15a3cb||0xc8;return function(_0x1efb0f){if(_0x1efb0f){return _0x37d8ae[_0x2ac0('0x15')](_0x15a3cb)['json'](_0x1efb0f);}};}function respondWithFilteredResult(_0xabd694,_0x22de53){return function(_0x4b128c){if(_0x4b128c){var _0x90e4d5=typeof _0x22de53[_0x2ac0('0x17')]===_0x2ac0('0x18')&&typeof _0x22de53['limit']==='undefined';var _0xd4acab=_0x4b128c[_0x2ac0('0x19')];var _0xd7d5bc=_0x90e4d5?0x0:_0x22de53['offset'];var _0x1c7d43=_0x90e4d5?_0x4b128c[_0x2ac0('0x19')]:_0x22de53[_0x2ac0('0x17')]+_0x22de53[_0x2ac0('0x1a')];var _0x8a3420;if(_0x1c7d43>=_0xd4acab){_0x1c7d43=_0xd4acab;_0x8a3420=0xc8;}else{_0x8a3420=0xce;}_0xabd694[_0x2ac0('0x15')](_0x8a3420);return _0xabd694['set'](_0x2ac0('0x1b'),_0xd7d5bc+'-'+_0x1c7d43+'/'+_0xd4acab)[_0x2ac0('0x1c')](_0x4b128c);}return null;};}function patchUpdates(_0x35dc0a){return function(_0x492ad2){try{jsonpatch[_0x2ac0('0x1d')](_0x492ad2,_0x35dc0a,!![]);}catch(_0x141a55){return BPromise['reject'](_0x141a55);}return _0x492ad2[_0x2ac0('0x1e')]();};}function saveUpdates(_0x11c534,_0x22bef2){return function(_0x4974cf){if(_0x4974cf){return _0x4974cf['update'](_0x11c534)[_0x2ac0('0x1f')](function(_0x4bb55c){return _0x4bb55c;});}return null;};}function removeEntity(_0x4b3477,_0x9f48db){return function(_0x34551a){if(_0x34551a){return _0x34551a['destroy']()[_0x2ac0('0x1f')](function(){var _0x281030=_0x34551a[_0x2ac0('0x20')]({'plain':!![]});var _0x19ab3d=_0x2ac0('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x19ab3d,'resourceId':_0x281030['id']}})['then'](function(){return _0x34551a;});})['then'](function(){_0x4b3477['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x33f99e,_0x203c65){return function(_0x30aa4a){if(!_0x30aa4a){_0x33f99e['sendStatus'](0x194);}return _0x30aa4a;};}function handleError(_0x3139cf,_0x53c132){_0x53c132=_0x53c132||0x1f4;return function(_0x521c4a){logger[_0x2ac0('0x22')](_0x521c4a[_0x2ac0('0x23')]);if(_0x521c4a['name']){delete _0x521c4a['name'];}_0x3139cf[_0x2ac0('0x15')](_0x53c132)[_0x2ac0('0x24')](_0x521c4a);};}exports[_0x2ac0('0x25')]=function(_0xbcb286,_0x585ed9){var _0x5950ef={},_0x51de68={},_0x500db4={'count':0x0,'rows':[]};var _0x3b319f=_['map'](db[_0x2ac0('0x26')][_0x2ac0('0x27')],function(_0xc40276){return{'name':_0xc40276['fieldName'],'type':_0xc40276[_0x2ac0('0x28')]['key']};});_0x51de68[_0x2ac0('0x29')]=_[_0x2ac0('0x2a')](_0x3b319f,_0x2ac0('0x2b'));_0x51de68[_0x2ac0('0x2c')]=_['keys'](_0xbcb286[_0x2ac0('0x2c')]);_0x51de68[_0x2ac0('0x2d')]=_[_0x2ac0('0x2e')](_0x51de68['model'],_0x51de68[_0x2ac0('0x2c')]);_0x5950ef[_0x2ac0('0x2f')]=_[_0x2ac0('0x2e')](_0x51de68['model'],qs['fields'](_0xbcb286[_0x2ac0('0x2c')][_0x2ac0('0x30')]));_0x5950ef[_0x2ac0('0x2f')]=_0x5950ef['attributes'][_0x2ac0('0x31')]?_0x5950ef['attributes']:_0x51de68['model'];if(!_0xbcb286['query'][_0x2ac0('0x32')](_0x2ac0('0x33'))){_0x5950ef['limit']=qs['limit'](_0xbcb286['query'][_0x2ac0('0x1a')]);_0x5950ef[_0x2ac0('0x17')]=qs['offset'](_0xbcb286[_0x2ac0('0x2c')][_0x2ac0('0x17')]);}_0x5950ef['order']=qs[_0x2ac0('0x34')](_0xbcb286[_0x2ac0('0x2c')][_0x2ac0('0x34')]);_0x5950ef[_0x2ac0('0x35')]=qs[_0x2ac0('0x2d')](_[_0x2ac0('0x36')](_0xbcb286[_0x2ac0('0x2c')],_0x51de68['filters']),_0x3b319f);if(_0xbcb286[_0x2ac0('0x2c')]['filter']){_0x5950ef[_0x2ac0('0x35')]=_['merge'](_0x5950ef[_0x2ac0('0x35')],{'$or':[{'key':{'$like':'%'+_0xbcb286[_0x2ac0('0x2c')][_0x2ac0('0x37')]+'%'}},{'value':{'$like':'%'+_0xbcb286[_0x2ac0('0x2c')]['filter']+'%'}}]});}_0x5950ef=_[_0x2ac0('0x38')]({},_0x5950ef,_0xbcb286['options']);var _0x3a0e15={'where':_0x5950ef[_0x2ac0('0x35')]};return db['CannedAnswer']['count'](_0x3a0e15)['then'](function(_0x367baf){_0x500db4[_0x2ac0('0x19')]=_0x367baf;if(_0xbcb286[_0x2ac0('0x2c')][_0x2ac0('0x39')]){_0x5950ef[_0x2ac0('0x3a')]=[{'all':!![]}];}return db[_0x2ac0('0x26')]['findAll'](_0x5950ef);})[_0x2ac0('0x1f')](function(_0x5a99fd){_0x500db4['rows']=_0x5a99fd;return _0x500db4;})['then'](respondWithFilteredResult(_0x585ed9,_0x5950ef))['catch'](handleError(_0x585ed9,null));};exports['show']=function(_0x3b687c,_0x50ceed){var _0x1a19f7={'raw':!![],'where':{'id':_0x3b687c[_0x2ac0('0x3b')]['id']}},_0x54df6c={};_0x54df6c[_0x2ac0('0x29')]=_[_0x2ac0('0x3c')](db['CannedAnswer'][_0x2ac0('0x27')]);_0x54df6c[_0x2ac0('0x2c')]=_[_0x2ac0('0x3c')](_0x3b687c[_0x2ac0('0x2c')]);_0x54df6c['filters']=_[_0x2ac0('0x2e')](_0x54df6c[_0x2ac0('0x29')],_0x54df6c[_0x2ac0('0x2c')]);_0x1a19f7['attributes']=_[_0x2ac0('0x2e')](_0x54df6c[_0x2ac0('0x29')],qs[_0x2ac0('0x30')](_0x3b687c[_0x2ac0('0x2c')][_0x2ac0('0x30')]));_0x1a19f7[_0x2ac0('0x2f')]=_0x1a19f7[_0x2ac0('0x2f')][_0x2ac0('0x31')]?_0x1a19f7[_0x2ac0('0x2f')]:_0x54df6c[_0x2ac0('0x29')];if(_0x3b687c[_0x2ac0('0x2c')][_0x2ac0('0x39')]){_0x1a19f7[_0x2ac0('0x3a')]=[{'all':!![]}];}_0x1a19f7=_[_0x2ac0('0x38')]({},_0x1a19f7,_0x3b687c['options']);return db[_0x2ac0('0x26')][_0x2ac0('0x3d')](_0x1a19f7)[_0x2ac0('0x1f')](handleEntityNotFound(_0x50ceed,null))['then'](respondWithResult(_0x50ceed,null))['catch'](handleError(_0x50ceed,null));};exports[_0x2ac0('0x3e')]=function(_0x6b2143,_0x192ce9){if(_0x6b2143['body']['id']){delete _0x6b2143['body']['id'];}return db[_0x2ac0('0x26')][_0x2ac0('0x3d')]({'where':{'id':_0x6b2143[_0x2ac0('0x3b')]['id']}})[_0x2ac0('0x1f')](handleEntityNotFound(_0x192ce9,null))[_0x2ac0('0x1f')](saveUpdates(_0x6b2143[_0x2ac0('0x3f')],null))[_0x2ac0('0x1f')](respondWithResult(_0x192ce9,null))['catch'](handleError(_0x192ce9,null));};exports[_0x2ac0('0x40')]=function(_0x2e2f1a,_0x147d8c){return db[_0x2ac0('0x26')][_0x2ac0('0x3d')]({'where':{'id':_0x2e2f1a[_0x2ac0('0x3b')]['id']}})[_0x2ac0('0x1f')](handleEntityNotFound(_0x147d8c,null))['then'](removeEntity(_0x147d8c,null))[_0x2ac0('0x41')](handleError(_0x147d8c,null));};exports[_0x2ac0('0x42')]=function(_0x314b5a,_0x3b9ac0){var _0x26d803={'key':_0x314b5a['body']['key']};if(_0x314b5a[_0x2ac0('0x3f')]['MailAccountId']){_0x26d803['MailAccountId']=_0x314b5a[_0x2ac0('0x3f')][_0x2ac0('0x43')];}else if(_0x314b5a[_0x2ac0('0x3f')][_0x2ac0('0x44')]){_0x26d803[_0x2ac0('0x44')]=_0x314b5a[_0x2ac0('0x3f')][_0x2ac0('0x44')];}else if(_0x314b5a['body']['OpenchannelAccountId']){_0x26d803[_0x2ac0('0x45')]=_0x314b5a[_0x2ac0('0x3f')]['OpenchannelAccountId'];}else if(_0x314b5a[_0x2ac0('0x3f')][_0x2ac0('0x46')]){_0x26d803['ChatWebsiteId']=_0x314b5a[_0x2ac0('0x3f')][_0x2ac0('0x46')];}return db[_0x2ac0('0x26')][_0x2ac0('0x3d')]({'where':_0x26d803})[_0x2ac0('0x1f')](function(_0x270af5){if(_0x270af5){throw new db[(_0x2ac0('0x47'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer']['create'](_0x314b5a[_0x2ac0('0x3f')]);})[_0x2ac0('0x1f')](function(_0x2c8d4c){var _0x14a2e4=_0x314b5a[_0x2ac0('0x48')]['get']({'plain':!![]});if(!_0x14a2e4)throw new Error(_0x2ac0('0x49'));if(_0x14a2e4[_0x2ac0('0x4a')]===_0x2ac0('0x48')){var _0x277f99=_0x2c8d4c[_0x2ac0('0x20')]({'plain':!![]});return db['UserProfileSection'][_0x2ac0('0x3d')]({'where':{'name':_0x2ac0('0x21'),'userProfileId':_0x14a2e4[_0x2ac0('0x4b')]},'raw':!![]})[_0x2ac0('0x1f')](function(_0x12a073){if(_0x12a073&&_0x12a073[_0x2ac0('0x4c')]===0x0){return db[_0x2ac0('0x4d')][_0x2ac0('0x42')]({'name':_0x277f99['name'],'resourceId':_0x277f99['id'],'type':_0x12a073[_0x2ac0('0x2b')],'sectionId':_0x12a073['id']},{})['then'](function(){return _0x2c8d4c;});}else{return _0x2c8d4c;}})[_0x2ac0('0x41')](function(_0x383c9a){logger[_0x2ac0('0x22')](_0x2ac0('0x4e'),_0x383c9a);throw _0x383c9a;});}return _0x2c8d4c;})[_0x2ac0('0x1f')](respondWithResult(_0x3b9ac0,0xc9))[_0x2ac0('0x41')](handleError(_0x3b9ac0,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 547e7fb..dd4b2e8 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 _0xd490=['request-promise','path','./cannedAnswer.attributes','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x48a24a,_0x3cb63c){var _0x5e35d8=function(_0x406d56){while(--_0x406d56){_0x48a24a['push'](_0x48a24a['shift']());}};_0x5e35d8(++_0x3cb63c);}(_0xd490,0xd7));var _0x0d49=function(_0x5b3ae9,_0x1332fc){_0x5b3ae9=_0x5b3ae9-0x0;var _0x113f50=_0xd490[_0x5b3ae9];return _0x113f50;};'use strict';var _=require(_0x0d49('0x0'));var util=require('util');var logger=require(_0x0d49('0x1'))(_0x0d49('0x2'));var moment=require(_0x0d49('0x3'));var BPromise=require(_0x0d49('0x4'));var rp=require(_0x0d49('0x5'));var fs=require('fs');var path=require(_0x0d49('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0d49('0x7'));module['exports']=function(_0x11a5b4,_0x18b70b){return _0x11a5b4['define'](_0x0d49('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0d49('0x9'),'collate':_0x0d49('0xa')});}; \ No newline at end of file +var _0xd64e=['moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x4c3653,_0x3db18e){var _0x3bf619=function(_0x209749){while(--_0x209749){_0x4c3653['push'](_0x4c3653['shift']());}};_0x3bf619(++_0x3db18e);}(_0xd64e,0x102));var _0xed64=function(_0x2fc9a5,_0x235b92){_0x2fc9a5=_0x2fc9a5-0x0;var _0x3fd730=_0xd64e[_0x2fc9a5];return _0x3fd730;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xed64('0x0'))(_0xed64('0x1'));var moment=require(_0xed64('0x2'));var BPromise=require('bluebird');var rp=require(_0xed64('0x3'));var fs=require('fs');var path=require(_0xed64('0x4'));var rimraf=require(_0xed64('0x5'));var config=require(_0xed64('0x6'));var attributes=require(_0xed64('0x7'));module[_0xed64('0x8')]=function(_0x5953f8,_0x33b11c){return _0x5953f8[_0xed64('0x9')](_0xed64('0xa'),attributes,{'tableName':_0xed64('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xed64('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 36f247b..2296285 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(_0x1fca2a,_0x5a8934){var _0xce64d8=function(_0x621d84){while(--_0x621d84){_0x1fca2a['push'](_0x1fca2a['shift']());}};_0xce64d8(++_0x5a8934);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x3c87b2,_0x51a0ca){var _0x143327=function(_0x77dd76){while(--_0x77dd76){_0x3c87b2['push'](_0x3c87b2['shift']());}};_0x143327(++_0x51a0ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 e2804e0..6ff345c 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 _0x9beb=['show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id'];(function(_0x74415f,_0x53a87a){var _0x593f5c=function(_0x1f07c8){while(--_0x1f07c8){_0x74415f['push'](_0x74415f['shift']());}};_0x593f5c(++_0x53a87a);}(_0x9beb,0x181));var _0xb9be=function(_0x1f29c2,_0x10b19c){_0x1f29c2=_0x1f29c2-0x0;var _0x2898a3=_0x9beb[_0x1f29c2];return _0x2898a3;};'use strict';var multer=require('multer');var util=require(_0xb9be('0x0'));var path=require(_0xb9be('0x1'));var timeout=require(_0xb9be('0x2'));var express=require(_0xb9be('0x3'));var router=express[_0xb9be('0x4')]();var fs_extra=require(_0xb9be('0x5'));var auth=require(_0xb9be('0x6'));var interaction=require(_0xb9be('0x7'));var config=require(_0xb9be('0x8'));var controller=require(_0xb9be('0x9'));router['get']('/',auth[_0xb9be('0xa')](),controller[_0xb9be('0xb')]);router[_0xb9be('0xc')](_0xb9be('0xd'),auth[_0xb9be('0xa')](),controller[_0xb9be('0xe')]);router[_0xb9be('0xf')]('/',auth[_0xb9be('0xa')](),controller[_0xb9be('0x10')]);router[_0xb9be('0x11')](_0xb9be('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xb9be('0x12')](_0xb9be('0xd'),auth[_0xb9be('0xa')](),controller[_0xb9be('0x13')]);module[_0xb9be('0x14')]=router; \ No newline at end of file +var _0xa44f=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x52c7f4,_0x2b3ad5){var _0x513d5b=function(_0x39bb23){while(--_0x39bb23){_0x52c7f4['push'](_0x52c7f4['shift']());}};_0x513d5b(++_0x2b3ad5);}(_0xa44f,0xf9));var _0xfa44=function(_0x251c1c,_0x5b3164){_0x251c1c=_0x251c1c-0x0;var _0x3f6ae7=_0xa44f[_0x251c1c];return _0x3f6ae7;};'use strict';var multer=require(_0xfa44('0x0'));var util=require(_0xfa44('0x1'));var path=require('path');var timeout=require(_0xfa44('0x2'));var express=require(_0xfa44('0x3'));var router=express[_0xfa44('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfa44('0x5'));var interaction=require(_0xfa44('0x6'));var config=require(_0xfa44('0x7'));var controller=require('./cannedAnswer.controller');router[_0xfa44('0x8')]('/',auth[_0xfa44('0x9')](),controller[_0xfa44('0xa')]);router[_0xfa44('0x8')]('/:id',auth[_0xfa44('0x9')](),controller[_0xfa44('0xb')]);router[_0xfa44('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xfa44('0xd'),auth['isAuthenticated'](),controller[_0xfa44('0xe')]);router[_0xfa44('0xf')](_0xfa44('0xd'),auth[_0xfa44('0x9')](),controller[_0xfa44('0x10')]);module[_0xfa44('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 71c463f..c4d81e0 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 _0xe189=['sequelize','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x101ed5,_0x4f5c30){var _0x5ae524=function(_0x568fd2){while(--_0x568fd2){_0x101ed5['push'](_0x101ed5['shift']());}};_0x5ae524(++_0x4f5c30);}(_0xe189,0x194));var _0x9e18=function(_0x51d320,_0x342f0b){_0x51d320=_0x51d320-0x0;var _0x4dee61=_0xe189[_0x51d320];return _0x4dee61;};'use strict';var Sequelize=require(_0x9e18('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x9e18('0x1')},'clid':{'type':Sequelize[_0x9e18('0x2')]},'src':{'type':Sequelize[_0x9e18('0x2')]},'dst':{'type':Sequelize[_0x9e18('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x9e18('0x2')]},'lastapp':{'type':Sequelize[_0x9e18('0x2')]},'lastdata':{'type':Sequelize[_0x9e18('0x2')]},'duration':{'type':Sequelize[_0x9e18('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9e18('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9e18('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x9e18('0x2')]},'userfield':{'type':Sequelize[_0x9e18('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x9e18('0x2')]},'sequence':{'type':Sequelize[_0x9e18('0x2')]},'peeraccount':{'type':Sequelize[_0x9e18('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x9e18('0x2')]}}; \ No newline at end of file +var _0x45c8=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x34b936,_0x29eec9){var _0x238426=function(_0xaac1cb){while(--_0xaac1cb){_0x34b936['push'](_0x34b936['shift']());}};_0x238426(++_0x29eec9);}(_0x45c8,0xef));var _0x845c=function(_0x190eb1,_0x20cfb8){_0x190eb1=_0x190eb1-0x0;var _0x20aea5=_0x45c8[_0x190eb1];return _0x20aea5;};'use strict';var Sequelize=require(_0x845c('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x845c('0x1')],'allowNull':![],'defaultValue':_0x845c('0x2')},'clid':{'type':Sequelize[_0x845c('0x3')]},'src':{'type':Sequelize[_0x845c('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x845c('0x3')]},'lastdata':{'type':Sequelize[_0x845c('0x3')]},'duration':{'type':Sequelize[_0x845c('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x845c('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x845c('0x3')]},'userfield':{'type':Sequelize[_0x845c('0x3')]},'uniqueid':{'type':Sequelize[_0x845c('0x3')]},'linkedid':{'type':Sequelize[_0x845c('0x3')]},'sequence':{'type':Sequelize[_0x845c('0x3')]},'peeraccount':{'type':Sequelize[_0x845c('0x3')]},'type':{'type':Sequelize[_0x845c('0x3')]},'tag':{'type':Sequelize[_0x845c('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 1d9f752..9690c7d 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 _0xd6d6=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type'];(function(_0x15e90d,_0x3a68b9){var _0x252c63=function(_0x5c6929){while(--_0x5c6929){_0x15e90d['push'](_0x15e90d['shift']());}};_0x252c63(++_0x3a68b9);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x10669d,_0x9e471a){_0x10669d=_0x10669d-0x0;var _0x57b51e=_0xd6d6[_0x10669d];return _0x57b51e;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0xf0df7f,_0x12fab2){return function(_0x554f8e){if(!_0x554f8e){_0xf0df7f[_0x6d6d('0x19')](0x194);}return _0x554f8e;};}function handleError(_0x2b5e31,_0x235451){_0x235451=_0x235451||0x1f4;return function(_0x126ac8){logger[_0x6d6d('0x29')](_0x126ac8[_0x6d6d('0x2a')]);if(_0x126ac8[_0x6d6d('0x2b')]){delete _0x126ac8['name'];}_0x2b5e31[_0x6d6d('0x1a')](_0x235451)[_0x6d6d('0x2c')](_0x126ac8);};}exports['index']=function(_0x553645,_0x3edcce){var _0x5273cd={},_0x8a9a84={},_0x57341f={'count':0x0,'rows':[]};var _0xde3272=_[_0x6d6d('0x2d')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')],function(_0x64d1f7){return{'name':_0x64d1f7[_0x6d6d('0x30')],'type':_0x64d1f7[_0x6d6d('0x31')][_0x6d6d('0x32')]};});_0x8a9a84[_0x6d6d('0x33')]=_[_0x6d6d('0x2d')](_0xde3272,'name');_0x8a9a84[_0x6d6d('0x34')]=_['keys'](_0x553645[_0x6d6d('0x34')]);_0x8a9a84[_0x6d6d('0x35')]=_[_0x6d6d('0x36')](_0x8a9a84[_0x6d6d('0x33')],_0x8a9a84['query']);_0x5273cd[_0x6d6d('0x37')]=_['intersection'](_0x8a9a84[_0x6d6d('0x33')],qs[_0x6d6d('0x38')](_0x553645['query'][_0x6d6d('0x38')]));_0x5273cd[_0x6d6d('0x37')]=_0x5273cd[_0x6d6d('0x37')][_0x6d6d('0x39')]?_0x5273cd[_0x6d6d('0x37')]:_0x8a9a84[_0x6d6d('0x33')];if(!_0x553645[_0x6d6d('0x34')][_0x6d6d('0x3a')](_0x6d6d('0x3b'))){_0x5273cd[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x1e')]);_0x5273cd[_0x6d6d('0x1f')]=qs['offset'](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x1f')]);}_0x5273cd[_0x6d6d('0x3c')]=qs[_0x6d6d('0x3d')](_0x553645['query']['sort']);_0x5273cd[_0x6d6d('0x3e')]=qs[_0x6d6d('0x35')](_[_0x6d6d('0x3f')](_0x553645['query'],_0x8a9a84[_0x6d6d('0x35')]),_0xde3272);if(_0x553645[_0x6d6d('0x34')][_0x6d6d('0x40')]){_0x5273cd[_0x6d6d('0x3e')]=_['merge'](_0x5273cd['where'],{'$or':_['map'](_0xde3272,function(_0x62620d){if(_0x62620d[_0x6d6d('0x31')]!==_0x6d6d('0x41')){var _0x22a49a={};_0x22a49a[_0x62620d['name']]={'$like':'%'+_0x553645[_0x6d6d('0x34')][_0x6d6d('0x40')]+'%'};return _0x22a49a;}})});}_0x5273cd=_[_0x6d6d('0x42')]({},_0x5273cd,_0x553645[_0x6d6d('0x43')]);var _0x3d632c={'where':_0x5273cd[_0x6d6d('0x3e')]};return db['Cdr'][_0x6d6d('0x20')](_0x3d632c)[_0x6d6d('0x27')](function(_0x42aff0){_0x57341f[_0x6d6d('0x20')]=_0x42aff0;if(_0x553645[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x5273cd[_0x6d6d('0x45')]=[{'all':!![]}];}return db['Cdr'][_0x6d6d('0x46')](_0x5273cd);})[_0x6d6d('0x27')](function(_0x16e177){_0x57341f[_0x6d6d('0x47')]=_0x16e177;return _0x57341f;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x3edcce,_0x5273cd))['catch'](handleError(_0x3edcce,null));};exports[_0x6d6d('0x48')]=function(_0x39f2a9,_0x55dba8){var _0x452de2={'raw':!![],'where':{'id':_0x39f2a9[_0x6d6d('0x49')]['id']}},_0x50dc17={};_0x50dc17[_0x6d6d('0x33')]=_['keys'](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')]);_0x50dc17[_0x6d6d('0x34')]=_[_0x6d6d('0x4a')](_0x39f2a9[_0x6d6d('0x34')]);_0x50dc17['filters']=_['intersection'](_0x50dc17[_0x6d6d('0x33')],_0x50dc17['query']);_0x452de2['attributes']=_[_0x6d6d('0x36')](_0x50dc17[_0x6d6d('0x33')],qs[_0x6d6d('0x38')](_0x39f2a9['query'][_0x6d6d('0x38')]));_0x452de2['attributes']=_0x452de2[_0x6d6d('0x37')][_0x6d6d('0x39')]?_0x452de2[_0x6d6d('0x37')]:_0x50dc17[_0x6d6d('0x33')];if(_0x39f2a9[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x452de2[_0x6d6d('0x45')]=[{'all':!![]}];}_0x452de2=_['merge']({},_0x452de2,_0x39f2a9[_0x6d6d('0x43')]);return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')](_0x452de2)[_0x6d6d('0x27')](handleEntityNotFound(_0x55dba8,null))[_0x6d6d('0x27')](respondWithResult(_0x55dba8,null))[_0x6d6d('0x4c')](handleError(_0x55dba8,null));};exports[_0x6d6d('0x4d')]=function(_0x1d2b20,_0x24cec2){return db['Cdr']['create'](_0x1d2b20[_0x6d6d('0x4e')],{})[_0x6d6d('0x27')](respondWithResult(_0x24cec2,0xc9))[_0x6d6d('0x4c')](handleError(_0x24cec2,null));};exports[_0x6d6d('0x26')]=function(_0xe2a20e,_0x492834){if(_0xe2a20e[_0x6d6d('0x4e')]['id']){delete _0xe2a20e[_0x6d6d('0x4e')]['id'];}return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')]({'where':{'id':_0xe2a20e[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x492834,null))[_0x6d6d('0x27')](saveUpdates(_0xe2a20e[_0x6d6d('0x4e')],null))[_0x6d6d('0x27')](respondWithResult(_0x492834,null))[_0x6d6d('0x4c')](handleError(_0x492834,null));};exports[_0x6d6d('0x28')]=function(_0x175e26,_0x4d9811){return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')]({'where':{'id':_0x175e26[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x4d9811,null))[_0x6d6d('0x27')](removeEntity(_0x4d9811,null))['catch'](handleError(_0x4d9811,null));};exports[_0x6d6d('0x4f')]=function(_0x36bc5a,_0x45340b){return db['Cdr']['describe']()[_0x6d6d('0x27')](respondWithResult(_0x45340b,null))['catch'](handleError(_0x45340b,null));}; \ No newline at end of file +var _0x446c=['name','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','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','destroy','error','stack'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x446c,0x156));var _0xc446=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x446c[_0x50007c];return _0x5c1ec7;};'use strict';var emlformat=require(_0xc446('0x0'));var rimraf=require(_0xc446('0x1'));var zipdir=require(_0xc446('0x2'));var jsonpatch=require(_0xc446('0x3'));var rp=require('request-promise');var moment=require(_0xc446('0x4'));var BPromise=require(_0xc446('0x5'));var Mustache=require(_0xc446('0x6'));var util=require('util');var path=require(_0xc446('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc446('0x8'));var fs=require('fs');var fs_extra=require(_0xc446('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc446('0xa'));var jsforce=require(_0xc446('0xb'));var deskjs=require(_0xc446('0xc'));var toCsv=require(_0xc446('0xd'));var querystring=require(_0xc446('0xe'));var Papa=require('papaparse');var Redis=require(_0xc446('0xf'));var authService=require(_0xc446('0x10'));var qs=require(_0xc446('0x11'));var as=require(_0xc446('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc446('0x13'))(_0xc446('0x14'));var utils=require(_0xc446('0x15'));var config=require(_0xc446('0x16'));var licenseUtil=require(_0xc446('0x17'));var db=require(_0xc446('0x18'))['db'];function respondWithStatusCode(_0x1a2099,_0x19083f){_0x19083f=_0x19083f||0xcc;return function(_0x22a70e){if(_0x22a70e){return _0x1a2099[_0xc446('0x19')](_0x19083f);}return _0x1a2099[_0xc446('0x1a')](_0x19083f)[_0xc446('0x1b')]();};}function respondWithResult(_0x1cfc0a,_0x72faac){_0x72faac=_0x72faac||0xc8;return function(_0x21d8e4){if(_0x21d8e4){return _0x1cfc0a[_0xc446('0x1a')](_0x72faac)[_0xc446('0x1c')](_0x21d8e4);}};}function respondWithFilteredResult(_0x20e51b,_0x2b09db){return function(_0x5d2701){if(_0x5d2701){var _0x3ba115=typeof _0x2b09db[_0xc446('0x1d')]===_0xc446('0x1e')&&typeof _0x2b09db[_0xc446('0x1f')]===_0xc446('0x1e');var _0x274040=_0x5d2701[_0xc446('0x20')];var _0x30038f=_0x3ba115?0x0:_0x2b09db[_0xc446('0x1d')];var _0x606af1=_0x3ba115?_0x5d2701['count']:_0x2b09db[_0xc446('0x1d')]+_0x2b09db[_0xc446('0x1f')];var _0x5cd0c1;if(_0x606af1>=_0x274040){_0x606af1=_0x274040;_0x5cd0c1=0xc8;}else{_0x5cd0c1=0xce;}_0x20e51b[_0xc446('0x1a')](_0x5cd0c1);return _0x20e51b[_0xc446('0x21')](_0xc446('0x22'),_0x30038f+'-'+_0x606af1+'/'+_0x274040)[_0xc446('0x1c')](_0x5d2701);}return null;};}function patchUpdates(_0x409a8e){return function(_0x37108c){try{jsonpatch[_0xc446('0x23')](_0x37108c,_0x409a8e,!![]);}catch(_0xc18765){return BPromise[_0xc446('0x24')](_0xc18765);}return _0x37108c[_0xc446('0x25')]();};}function saveUpdates(_0x5ce5f7,_0x35aedc){return function(_0x1ea08b){if(_0x1ea08b){return _0x1ea08b[_0xc446('0x26')](_0x5ce5f7)[_0xc446('0x27')](function(_0x3596f4){return _0x3596f4;});}return null;};}function removeEntity(_0xb696e,_0x36a6f5){return function(_0x1b785a){if(_0x1b785a){return _0x1b785a[_0xc446('0x28')]()[_0xc446('0x27')](function(){_0xb696e[_0xc446('0x1a')](0xcc)[_0xc446('0x1b')]();});}};}function handleEntityNotFound(_0x25f58d,_0x438410){return function(_0x16133b){if(!_0x16133b){_0x25f58d[_0xc446('0x19')](0x194);}return _0x16133b;};}function handleError(_0x465e18,_0x51933d){_0x51933d=_0x51933d||0x1f4;return function(_0xb3ab06){logger[_0xc446('0x29')](_0xb3ab06[_0xc446('0x2a')]);if(_0xb3ab06[_0xc446('0x2b')]){delete _0xb3ab06[_0xc446('0x2b')];}_0x465e18[_0xc446('0x1a')](_0x51933d)['send'](_0xb3ab06);};}exports['index']=function(_0x37532c,_0x1b2dc8){var _0x19f57f={},_0x865c07={},_0x4ea05e={'count':0x0,'rows':[]};var _0x420fcb=_[_0xc446('0x2c')](db[_0xc446('0x2d')][_0xc446('0x2e')],function(_0x1bd4e6){return{'name':_0x1bd4e6[_0xc446('0x2f')],'type':_0x1bd4e6[_0xc446('0x30')][_0xc446('0x31')]};});_0x865c07[_0xc446('0x32')]=_[_0xc446('0x2c')](_0x420fcb,'name');_0x865c07['query']=_['keys'](_0x37532c[_0xc446('0x33')]);_0x865c07[_0xc446('0x34')]=_[_0xc446('0x35')](_0x865c07[_0xc446('0x32')],_0x865c07[_0xc446('0x33')]);_0x19f57f[_0xc446('0x36')]=_[_0xc446('0x35')](_0x865c07['model'],qs[_0xc446('0x37')](_0x37532c[_0xc446('0x33')][_0xc446('0x37')]));_0x19f57f[_0xc446('0x36')]=_0x19f57f[_0xc446('0x36')]['length']?_0x19f57f[_0xc446('0x36')]:_0x865c07[_0xc446('0x32')];if(!_0x37532c[_0xc446('0x33')][_0xc446('0x38')](_0xc446('0x39'))){_0x19f57f[_0xc446('0x1f')]=qs[_0xc446('0x1f')](_0x37532c[_0xc446('0x33')]['limit']);_0x19f57f['offset']=qs[_0xc446('0x1d')](_0x37532c[_0xc446('0x33')][_0xc446('0x1d')]);}_0x19f57f['order']=qs[_0xc446('0x3a')](_0x37532c[_0xc446('0x33')][_0xc446('0x3a')]);_0x19f57f['where']=qs['filters'](_['pick'](_0x37532c[_0xc446('0x33')],_0x865c07['filters']),_0x420fcb);if(_0x37532c[_0xc446('0x33')][_0xc446('0x3b')]){_0x19f57f['where']=_[_0xc446('0x3c')](_0x19f57f[_0xc446('0x3d')],{'$or':_[_0xc446('0x2c')](_0x420fcb,function(_0x2beba1){if(_0x2beba1['type']!==_0xc446('0x3e')){var _0xb9c7e6={};_0xb9c7e6[_0x2beba1['name']]={'$like':'%'+_0x37532c[_0xc446('0x33')][_0xc446('0x3b')]+'%'};return _0xb9c7e6;}})});}_0x19f57f=_[_0xc446('0x3c')]({},_0x19f57f,_0x37532c[_0xc446('0x3f')]);var _0xf3400e={'where':_0x19f57f['where']};return db[_0xc446('0x2d')][_0xc446('0x20')](_0xf3400e)[_0xc446('0x27')](function(_0xf8c80c){_0x4ea05e[_0xc446('0x20')]=_0xf8c80c;if(_0x37532c['query'][_0xc446('0x40')]){_0x19f57f[_0xc446('0x41')]=[{'all':!![]}];}return db[_0xc446('0x2d')][_0xc446('0x42')](_0x19f57f);})[_0xc446('0x27')](function(_0x5e65d5){_0x4ea05e[_0xc446('0x43')]=_0x5e65d5;return _0x4ea05e;})['then'](respondWithFilteredResult(_0x1b2dc8,_0x19f57f))[_0xc446('0x44')](handleError(_0x1b2dc8,null));};exports[_0xc446('0x45')]=function(_0x520ffd,_0x3287ce){var _0x5e250b={'raw':!![],'where':{'id':_0x520ffd[_0xc446('0x46')]['id']}},_0x29f36f={};_0x29f36f[_0xc446('0x32')]=_[_0xc446('0x47')](db['Cdr'][_0xc446('0x2e')]);_0x29f36f[_0xc446('0x33')]=_[_0xc446('0x47')](_0x520ffd['query']);_0x29f36f[_0xc446('0x34')]=_[_0xc446('0x35')](_0x29f36f[_0xc446('0x32')],_0x29f36f[_0xc446('0x33')]);_0x5e250b[_0xc446('0x36')]=_[_0xc446('0x35')](_0x29f36f[_0xc446('0x32')],qs[_0xc446('0x37')](_0x520ffd[_0xc446('0x33')][_0xc446('0x37')]));_0x5e250b[_0xc446('0x36')]=_0x5e250b[_0xc446('0x36')][_0xc446('0x48')]?_0x5e250b[_0xc446('0x36')]:_0x29f36f[_0xc446('0x32')];if(_0x520ffd['query']['includeAll']){_0x5e250b[_0xc446('0x41')]=[{'all':!![]}];}_0x5e250b=_[_0xc446('0x3c')]({},_0x5e250b,_0x520ffd['options']);return db['Cdr']['find'](_0x5e250b)['then'](handleEntityNotFound(_0x3287ce,null))[_0xc446('0x27')](respondWithResult(_0x3287ce,null))[_0xc446('0x44')](handleError(_0x3287ce,null));};exports[_0xc446('0x49')]=function(_0x2fc1bf,_0x19ca3d){return db[_0xc446('0x2d')][_0xc446('0x49')](_0x2fc1bf[_0xc446('0x4a')],{})[_0xc446('0x27')](respondWithResult(_0x19ca3d,0xc9))[_0xc446('0x44')](handleError(_0x19ca3d,null));};exports['update']=function(_0x40aa4f,_0x317559){if(_0x40aa4f[_0xc446('0x4a')]['id']){delete _0x40aa4f['body']['id'];}return db[_0xc446('0x2d')]['find']({'where':{'id':_0x40aa4f[_0xc446('0x46')]['id']}})[_0xc446('0x27')](handleEntityNotFound(_0x317559,null))[_0xc446('0x27')](saveUpdates(_0x40aa4f[_0xc446('0x4a')],null))[_0xc446('0x27')](respondWithResult(_0x317559,null))['catch'](handleError(_0x317559,null));};exports[_0xc446('0x28')]=function(_0x5415e5,_0x26ec5f){return db['Cdr'][_0xc446('0x4b')]({'where':{'id':_0x5415e5['params']['id']}})[_0xc446('0x27')](handleEntityNotFound(_0x26ec5f,null))[_0xc446('0x27')](removeEntity(_0x26ec5f,null))['catch'](handleError(_0x26ec5f,null));};exports['describe']=function(_0x1a66fd,_0x5759af){return db[_0xc446('0x2d')][_0xc446('0x4c')]()[_0xc446('0x27')](respondWithResult(_0x5759af,null))[_0xc446('0x44')](handleError(_0x5759af,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 2dbcca1..0421c4c 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(_0x9dbbdb,_0x40551a){var _0x5f4548=function(_0x9a10ca){while(--_0x9a10ca){_0x9dbbdb['push'](_0x9dbbdb['shift']());}};_0x5f4548(++_0x40551a);}(_0x7a54,0x106));var _0x47a5=function(_0x157bf7,_0x527be6){_0x157bf7=_0x157bf7-0x0;var _0x18b867=_0x7a54[_0x157bf7];return _0x18b867;};'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(_0x393e00,_0x491061){var _0x2c826b=function(_0x511c5b){while(--_0x511c5b){_0x393e00['push'](_0x393e00['shift']());}};_0x2c826b(++_0x491061);}(_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 eac4df8..a74f89a 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 _0x5460=['result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5460,0x75));var _0x0546=function(_0x41c76f,_0x339363){_0x41c76f=_0x41c76f-0x0;var _0x22fefb=_0x5460[_0x41c76f];return _0x22fefb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0546('0x0'));var BPromise=require(_0x0546('0x1'));var rs=require(_0x0546('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0546('0x3'))['db'];var utils=require(_0x0546('0x4'));var logger=require(_0x0546('0x5'))(_0x0546('0x6'));var config=require(_0x0546('0x7'));var jayson=require(_0x0546('0x8'));var client=jayson[_0x0546('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f1bd4,_0xd5510c,_0xf904f1){return new BPromise(function(_0x4eb162,_0x518b3b){return client[_0x0546('0xa')](_0x3f1bd4,_0xf904f1)[_0x0546('0xb')](function(_0x2cb259){logger[_0x0546('0xc')](_0x0546('0xd'),_0xd5510c,'request\x20sent');logger[_0x0546('0xe')](_0x0546('0xf'),_0xd5510c,_0x0546('0x10'),JSON[_0x0546('0x11')](_0x2cb259));if(_0x2cb259[_0x0546('0x12')]){if(_0x2cb259[_0x0546('0x12')][_0x0546('0x13')]===0x1f4){logger[_0x0546('0x12')]('Cdr,\x20%s,\x20%s',_0xd5510c,_0x2cb259['error'][_0x0546('0x14')]);return _0x518b3b(_0x2cb259[_0x0546('0x12')]['message']);}logger[_0x0546('0x12')](_0x0546('0xd'),_0xd5510c,_0x2cb259['error'][_0x0546('0x14')]);return _0x4eb162(_0x2cb259[_0x0546('0x12')][_0x0546('0x14')]);}else{logger[_0x0546('0xc')](_0x0546('0xd'),_0xd5510c,_0x0546('0x10'));_0x4eb162(_0x2cb259[_0x0546('0x15')]['message']);}})[_0x0546('0x16')](function(_0x44b033){logger[_0x0546('0x12')](_0x0546('0xd'),_0xd5510c,_0x44b033);_0x518b3b(_0x44b033);});});} \ No newline at end of file +var _0x5458=['moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util'];(function(_0x1de441,_0xb9b663){var _0x1148c0=function(_0x325ee5){while(--_0x325ee5){_0x1de441['push'](_0x1de441['shift']());}};_0x1148c0(++_0xb9b663);}(_0x5458,0x108));var _0x8545=function(_0x329a7a,_0xb9345b){_0x329a7a=_0x329a7a-0x0;var _0x4f8576=_0x5458[_0x329a7a];return _0x4f8576;};'use strict';var _=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var moment=require(_0x8545('0x2'));var BPromise=require('bluebird');var rs=require(_0x8545('0x3'));var fs=require('fs');var Redis=require(_0x8545('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8545('0x5'));var logger=require('../../config/logger')(_0x8545('0x6'));var config=require(_0x8545('0x7'));var jayson=require(_0x8545('0x8'));var client=jayson['client'][_0x8545('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f38d6,_0x43a281,_0x571d63){return new BPromise(function(_0x580029,_0x4e9c73){return client['request'](_0x3f38d6,_0x571d63)[_0x8545('0xa')](function(_0x1d4629){logger[_0x8545('0xb')](_0x8545('0xc'),_0x43a281,_0x8545('0xd'));logger['debug'](_0x8545('0xe'),_0x43a281,_0x8545('0xd'),JSON[_0x8545('0xf')](_0x1d4629));if(_0x1d4629[_0x8545('0x10')]){if(_0x1d4629['error'][_0x8545('0x11')]===0x1f4){logger[_0x8545('0x10')]('Cdr,\x20%s,\x20%s',_0x43a281,_0x1d4629[_0x8545('0x10')]['message']);return _0x4e9c73(_0x1d4629[_0x8545('0x10')][_0x8545('0x12')]);}logger[_0x8545('0x10')](_0x8545('0xc'),_0x43a281,_0x1d4629[_0x8545('0x10')][_0x8545('0x12')]);return _0x580029(_0x1d4629[_0x8545('0x10')]['message']);}else{logger['info'](_0x8545('0xc'),_0x43a281,_0x8545('0xd'));_0x580029(_0x1d4629['result']['message']);}})['catch'](function(_0x42eb76){logger[_0x8545('0x10')](_0x8545('0xc'),_0x43a281,_0x42eb76);_0x4e9c73(_0x42eb76);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 5539ff2..e665ef3 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 _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(_0x3e57d1,_0x92cfe8){var _0x2d1413=function(_0x43ec48){while(--_0x43ec48){_0x3e57d1['push'](_0x3e57d1['shift']());}};_0x2d1413(++_0x92cfe8);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e4c55,_0x1415eb){_0x1e4c55=_0x1e4c55-0x0;var _0x511ab5=_0xb10b[_0x1e4c55];return _0x511ab5;};'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 _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(_0x4f1496,_0x4064c5){var _0x175991=function(_0x42e07e){while(--_0x42e07e){_0x4f1496['push'](_0x4f1496['shift']());}};_0x175991(++_0x4064c5);}(_0xb10b,0x12a));var _0xbb10=function(_0x488b4d,_0x233540){_0x488b4d=_0x488b4d-0x0;var _0x51ee8f=_0xb10b[_0x488b4d];return _0x51ee8f;};'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 c16d240..c9288ba 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 _0x1d7e=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x93462d,_0x4679b2){var _0xc0bce3=function(_0xec7e93){while(--_0xec7e93){_0x93462d['push'](_0x93462d['shift']());}};_0xc0bce3(++_0x4679b2);}(_0x1d7e,0x15f));var _0xe1d7=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x1d7e[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0xe1d7('0x0'));module[_0xe1d7('0x1')]={'priority':{'type':Sequelize[_0xe1d7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe1d7('0x3')],'allowNull':![],'defaultValue':_0xe1d7('0x4')},'appdata':{'type':Sequelize[_0xe1d7('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe1d7('0x3')],'defaultValue':_0xe1d7('0x6')}}; \ No newline at end of file +var _0x239b=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x1977bf,_0x452153){var _0x27fd52=function(_0x1b50a3){while(--_0x1b50a3){_0x1977bf['push'](_0x1977bf['shift']());}};_0x27fd52(++_0x452153);}(_0x239b,0xd5));var _0xb239=function(_0x47aea7,_0x163565){_0x47aea7=_0x47aea7-0x0;var _0x54dba1=_0x239b[_0x47aea7];return _0x54dba1;};'use strict';var Sequelize=require(_0xb239('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb239('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb239('0x2')],'allowNull':![],'defaultValue':_0xb239('0x3')},'appdata':{'type':Sequelize[_0xb239('0x4')]()},'description':{'type':Sequelize[_0xb239('0x2')]},'interval':{'type':Sequelize[_0xb239('0x2')],'defaultValue':_0xb239('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 33a8930..ef051ba 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 _0x2cae=['keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model'];(function(_0x5641e3,_0x1437ae){var _0x4065e8=function(_0x55dbf9){while(--_0x55dbf9){_0x5641e3['push'](_0x5641e3['shift']());}};_0x4065e8(++_0x1437ae);}(_0x2cae,0x16b));var _0xe2ca=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x2cae[_0x28611e];return _0x530f69;};'use strict';var emlformat=require(_0xe2ca('0x0'));var rimraf=require(_0xe2ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe2ca('0x2'));var moment=require(_0xe2ca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe2ca('0x4'));var util=require(_0xe2ca('0x5'));var path=require(_0xe2ca('0x6'));var sox=require(_0xe2ca('0x7'));var csv=require('to-csv');var ejs=require(_0xe2ca('0x8'));var fs=require('fs');var fs_extra=require(_0xe2ca('0x9'));var _=require('lodash');var squel=require(_0xe2ca('0xa'));var crypto=require('crypto');var jsforce=require(_0xe2ca('0xb'));var deskjs=require(_0xe2ca('0xc'));var toCsv=require(_0xe2ca('0xd'));var querystring=require(_0xe2ca('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe2ca('0xf'));var hardwareService=require(_0xe2ca('0x10'));var logger=require(_0xe2ca('0x11'))(_0xe2ca('0x12'));var utils=require(_0xe2ca('0x13'));var config=require(_0xe2ca('0x14'));var licenseUtil=require(_0xe2ca('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1138ee,_0x2773cc){_0x2773cc=_0x2773cc||0xcc;return function(_0x199237){if(_0x199237){return _0x1138ee[_0xe2ca('0x16')](_0x2773cc);}return _0x1138ee[_0xe2ca('0x17')](_0x2773cc)['end']();};}function respondWithResult(_0x31f283,_0x3cfcc9){_0x3cfcc9=_0x3cfcc9||0xc8;return function(_0x27c3ad){if(_0x27c3ad){return _0x31f283[_0xe2ca('0x17')](_0x3cfcc9)[_0xe2ca('0x18')](_0x27c3ad);}};}function respondWithFilteredResult(_0x3a9612,_0x1c1514){return function(_0x29cdcf){if(_0x29cdcf){var _0x326340=typeof _0x1c1514[_0xe2ca('0x19')]==='undefined'&&typeof _0x1c1514[_0xe2ca('0x1a')]==='undefined';var _0x4ca8fd=_0x29cdcf[_0xe2ca('0x1b')];var _0x18cd42=_0x326340?0x0:_0x1c1514['offset'];var _0x393c23=_0x326340?_0x29cdcf[_0xe2ca('0x1b')]:_0x1c1514[_0xe2ca('0x19')]+_0x1c1514['limit'];var _0x4380fb;if(_0x393c23>=_0x4ca8fd){_0x393c23=_0x4ca8fd;_0x4380fb=0xc8;}else{_0x4380fb=0xce;}_0x3a9612[_0xe2ca('0x17')](_0x4380fb);return _0x3a9612[_0xe2ca('0x1c')]('Content-Range',_0x18cd42+'-'+_0x393c23+'/'+_0x4ca8fd)[_0xe2ca('0x18')](_0x29cdcf);}return null;};}function patchUpdates(_0x56b574){return function(_0x16f418){try{jsonpatch[_0xe2ca('0x1d')](_0x16f418,_0x56b574,!![]);}catch(_0x60d8e8){return BPromise[_0xe2ca('0x1e')](_0x60d8e8);}return _0x16f418[_0xe2ca('0x1f')]();};}function saveUpdates(_0x1b98d8,_0x50af69){return function(_0x1a1522){if(_0x1a1522){return _0x1a1522[_0xe2ca('0x20')](_0x1b98d8)[_0xe2ca('0x21')](function(_0x2ca129){return _0x2ca129;});}return null;};}function removeEntity(_0x18a6c6,_0x2772b5){return function(_0xa1fa2b){if(_0xa1fa2b){return _0xa1fa2b[_0xe2ca('0x22')]()[_0xe2ca('0x21')](function(){_0x18a6c6['status'](0xcc)[_0xe2ca('0x23')]();});}};}function handleEntityNotFound(_0x272bb3,_0x3f3d6e){return function(_0xc52f5e){if(!_0xc52f5e){_0x272bb3[_0xe2ca('0x16')](0x194);}return _0xc52f5e;};}function handleError(_0x4b2a2e,_0x524b6c){_0x524b6c=_0x524b6c||0x1f4;return function(_0x20ac37){logger[_0xe2ca('0x24')](_0x20ac37[_0xe2ca('0x25')]);if(_0x20ac37[_0xe2ca('0x26')]){delete _0x20ac37[_0xe2ca('0x26')];}_0x4b2a2e[_0xe2ca('0x17')](_0x524b6c)[_0xe2ca('0x27')](_0x20ac37);};}exports[_0xe2ca('0x28')]=function(_0x565e9b,_0x5df46f){var _0x333665={'raw':!![],'where':{'id':_0x565e9b[_0xe2ca('0x29')]['id']}},_0x300d0e={};_0x300d0e[_0xe2ca('0x2a')]=_[_0xe2ca('0x2b')](db[_0xe2ca('0x2c')][_0xe2ca('0x2d')]);_0x300d0e[_0xe2ca('0x2e')]=_[_0xe2ca('0x2b')](_0x565e9b[_0xe2ca('0x2e')]);_0x300d0e[_0xe2ca('0x2f')]=_[_0xe2ca('0x30')](_0x300d0e[_0xe2ca('0x2a')],_0x300d0e[_0xe2ca('0x2e')]);_0x333665['attributes']=_[_0xe2ca('0x30')](_0x300d0e[_0xe2ca('0x2a')],qs[_0xe2ca('0x31')](_0x565e9b[_0xe2ca('0x2e')][_0xe2ca('0x31')]));_0x333665[_0xe2ca('0x32')]=_0x333665[_0xe2ca('0x32')]['length']?_0x333665['attributes']:_0x300d0e['model'];if(_0x565e9b[_0xe2ca('0x2e')][_0xe2ca('0x33')]){_0x333665[_0xe2ca('0x34')]=[{'all':!![]}];}_0x333665=_[_0xe2ca('0x35')]({},_0x333665,_0x565e9b[_0xe2ca('0x36')]);return db['ChatApplication'][_0xe2ca('0x37')](_0x333665)[_0xe2ca('0x21')](handleEntityNotFound(_0x5df46f,null))['then'](respondWithResult(_0x5df46f,null))[_0xe2ca('0x38')](handleError(_0x5df46f,null));};exports[_0xe2ca('0x20')]=function(_0x21d7bf,_0x48b0f8){if(_0x21d7bf[_0xe2ca('0x39')]['id']){delete _0x21d7bf[_0xe2ca('0x39')]['id'];}return db[_0xe2ca('0x2c')]['find']({'where':{'id':_0x21d7bf[_0xe2ca('0x29')]['id']}})['then'](handleEntityNotFound(_0x48b0f8,null))[_0xe2ca('0x21')](saveUpdates(_0x21d7bf['body'],null))['then'](respondWithResult(_0x48b0f8,null))[_0xe2ca('0x38')](handleError(_0x48b0f8,null));};exports[_0xe2ca('0x22')]=function(_0x2dbf5e,_0x57e784){return db[_0xe2ca('0x2c')][_0xe2ca('0x37')]({'where':{'id':_0x2dbf5e[_0xe2ca('0x29')]['id']}})[_0xe2ca('0x21')](handleEntityNotFound(_0x57e784,null))['then'](removeEntity(_0x57e784,null))['catch'](handleError(_0x57e784,null));}; \ No newline at end of file +var _0xbf6e=['save','update','then','destroy','error','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','ChatApplication','find','body','params','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf6e,0x149));var _0xebf6=function(_0x283690,_0x45c348){_0x283690=_0x283690-0x0;var _0x1b57d0=_0xbf6e[_0x283690];return _0x1b57d0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xebf6('0x0'));var jsonpatch=require(_0xebf6('0x1'));var rp=require(_0xebf6('0x2'));var moment=require(_0xebf6('0x3'));var BPromise=require(_0xebf6('0x4'));var Mustache=require(_0xebf6('0x5'));var util=require(_0xebf6('0x6'));var path=require('path');var sox=require(_0xebf6('0x7'));var csv=require(_0xebf6('0x8'));var ejs=require(_0xebf6('0x9'));var fs=require('fs');var fs_extra=require(_0xebf6('0xa'));var _=require(_0xebf6('0xb'));var squel=require(_0xebf6('0xc'));var crypto=require(_0xebf6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xebf6('0xe'));var toCsv=require(_0xebf6('0x8'));var querystring=require(_0xebf6('0xf'));var Papa=require('papaparse');var Redis=require(_0xebf6('0x10'));var authService=require(_0xebf6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xebf6('0x12'));var hardwareService=require(_0xebf6('0x13'));var logger=require(_0xebf6('0x14'))(_0xebf6('0x15'));var utils=require(_0xebf6('0x16'));var config=require(_0xebf6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xebf6('0x18'))['db'];function respondWithStatusCode(_0xedc361,_0x4919f1){_0x4919f1=_0x4919f1||0xcc;return function(_0x332ca0){if(_0x332ca0){return _0xedc361[_0xebf6('0x19')](_0x4919f1);}return _0xedc361[_0xebf6('0x1a')](_0x4919f1)[_0xebf6('0x1b')]();};}function respondWithResult(_0x3f69e6,_0x4dbf51){_0x4dbf51=_0x4dbf51||0xc8;return function(_0x4c01f4){if(_0x4c01f4){return _0x3f69e6['status'](_0x4dbf51)[_0xebf6('0x1c')](_0x4c01f4);}};}function respondWithFilteredResult(_0x1ae2f7,_0x50d80f){return function(_0x35570e){if(_0x35570e){var _0x2c980f=typeof _0x50d80f[_0xebf6('0x1d')]===_0xebf6('0x1e')&&typeof _0x50d80f[_0xebf6('0x1f')]===_0xebf6('0x1e');var _0x219621=_0x35570e[_0xebf6('0x20')];var _0x2d3984=_0x2c980f?0x0:_0x50d80f[_0xebf6('0x1d')];var _0x55fa31=_0x2c980f?_0x35570e['count']:_0x50d80f[_0xebf6('0x1d')]+_0x50d80f[_0xebf6('0x1f')];var _0x10051e;if(_0x55fa31>=_0x219621){_0x55fa31=_0x219621;_0x10051e=0xc8;}else{_0x10051e=0xce;}_0x1ae2f7[_0xebf6('0x1a')](_0x10051e);return _0x1ae2f7[_0xebf6('0x21')](_0xebf6('0x22'),_0x2d3984+'-'+_0x55fa31+'/'+_0x219621)[_0xebf6('0x1c')](_0x35570e);}return null;};}function patchUpdates(_0x80f523){return function(_0x4fb497){try{jsonpatch[_0xebf6('0x23')](_0x4fb497,_0x80f523,!![]);}catch(_0x81fdb3){return BPromise[_0xebf6('0x24')](_0x81fdb3);}return _0x4fb497[_0xebf6('0x25')]();};}function saveUpdates(_0x6303ac,_0x14c8ac){return function(_0x2f419e){if(_0x2f419e){return _0x2f419e[_0xebf6('0x26')](_0x6303ac)[_0xebf6('0x27')](function(_0x2e32c6){return _0x2e32c6;});}return null;};}function removeEntity(_0x232074,_0x2dd2ed){return function(_0x43c4e2){if(_0x43c4e2){return _0x43c4e2[_0xebf6('0x28')]()[_0xebf6('0x27')](function(){_0x232074[_0xebf6('0x1a')](0xcc)[_0xebf6('0x1b')]();});}};}function handleEntityNotFound(_0x1534b2,_0x3b58cb){return function(_0x4dadf7){if(!_0x4dadf7){_0x1534b2['sendStatus'](0x194);}return _0x4dadf7;};}function handleError(_0x2605a2,_0x4dc5be){_0x4dc5be=_0x4dc5be||0x1f4;return function(_0x230d84){logger[_0xebf6('0x29')](_0x230d84['stack']);if(_0x230d84['name']){delete _0x230d84[_0xebf6('0x2a')];}_0x2605a2[_0xebf6('0x1a')](_0x4dc5be)[_0xebf6('0x2b')](_0x230d84);};}exports[_0xebf6('0x2c')]=function(_0xedaaeb,_0x2dc0cf){var _0x7976d={'raw':!![],'where':{'id':_0xedaaeb['params']['id']}},_0x7551ce={};_0x7551ce[_0xebf6('0x2d')]=_[_0xebf6('0x2e')](db['ChatApplication'][_0xebf6('0x2f')]);_0x7551ce[_0xebf6('0x30')]=_['keys'](_0xedaaeb[_0xebf6('0x30')]);_0x7551ce[_0xebf6('0x31')]=_[_0xebf6('0x32')](_0x7551ce[_0xebf6('0x2d')],_0x7551ce[_0xebf6('0x30')]);_0x7976d[_0xebf6('0x33')]=_['intersection'](_0x7551ce[_0xebf6('0x2d')],qs[_0xebf6('0x34')](_0xedaaeb['query']['fields']));_0x7976d[_0xebf6('0x33')]=_0x7976d[_0xebf6('0x33')]['length']?_0x7976d[_0xebf6('0x33')]:_0x7551ce[_0xebf6('0x2d')];if(_0xedaaeb['query'][_0xebf6('0x35')]){_0x7976d[_0xebf6('0x36')]=[{'all':!![]}];}_0x7976d=_[_0xebf6('0x37')]({},_0x7976d,_0xedaaeb['options']);return db[_0xebf6('0x38')][_0xebf6('0x39')](_0x7976d)[_0xebf6('0x27')](handleEntityNotFound(_0x2dc0cf,null))[_0xebf6('0x27')](respondWithResult(_0x2dc0cf,null))['catch'](handleError(_0x2dc0cf,null));};exports['update']=function(_0x262af2,_0x46ef2d){if(_0x262af2['body']['id']){delete _0x262af2[_0xebf6('0x3a')]['id'];}return db[_0xebf6('0x38')]['find']({'where':{'id':_0x262af2[_0xebf6('0x3b')]['id']}})[_0xebf6('0x27')](handleEntityNotFound(_0x46ef2d,null))[_0xebf6('0x27')](saveUpdates(_0x262af2[_0xebf6('0x3a')],null))[_0xebf6('0x27')](respondWithResult(_0x46ef2d,null))['catch'](handleError(_0x46ef2d,null));};exports[_0xebf6('0x28')]=function(_0x48943e,_0x3a09fe){return db['ChatApplication'][_0xebf6('0x39')]({'where':{'id':_0x48943e[_0xebf6('0x3b')]['id']}})[_0xebf6('0x27')](handleEntityNotFound(_0x3a09fe,null))[_0xebf6('0x27')](removeEntity(_0x3a09fe,null))[_0xebf6('0x3c')](handleError(_0x3a09fe,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index b3f12d4..cb296e0 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 _0x4c3c=['util','api','request-promise','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x278b09,_0x15449b){var _0xeb6da8=function(_0x1276ca){while(--_0x1276ca){_0x278b09['push'](_0x278b09['shift']());}};_0xeb6da8(++_0x15449b);}(_0x4c3c,0x1e3));var _0xc4c3=function(_0x28041b,_0x12093b){_0x28041b=_0x28041b-0x0;var _0x11a839=_0x4c3c[_0x28041b];return _0x11a839;};'use strict';var _=require(_0xc4c3('0x0'));var util=require(_0xc4c3('0x1'));var logger=require('../../config/logger')(_0xc4c3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc4c3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc4c3('0x4'));var attributes=require(_0xc4c3('0x5'));module[_0xc4c3('0x6')]=function(_0x36cea1,_0x1cb620){return _0x36cea1[_0xc4c3('0x7')](_0xc4c3('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc4c3('0x9'),'collate':_0xc4c3('0xa')});}; \ No newline at end of file +var _0x11d2=['api','moment','bluebird','path','rimraf','../../config/environment','define','ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x4e2e41,_0x530062){var _0x5b5e11=function(_0x846113){while(--_0x846113){_0x4e2e41['push'](_0x4e2e41['shift']());}};_0x5b5e11(++_0x530062);}(_0x11d2,0x1c4));var _0x211d=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x11d2[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x211d('0x0'));var util=require(_0x211d('0x1'));var logger=require(_0x211d('0x2'))(_0x211d('0x3'));var moment=require(_0x211d('0x4'));var BPromise=require(_0x211d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x211d('0x6'));var rimraf=require(_0x211d('0x7'));var config=require(_0x211d('0x8'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x432001,_0x46e411){return _0x432001[_0x211d('0x9')](_0x211d('0xa'),attributes,{'tableName':_0x211d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x211d('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 117e6df..87d9859 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 _0xdf56=['util','moment','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x12a5a9,_0x454056){var _0x490dbb=function(_0x11b1cc){while(--_0x11b1cc){_0x12a5a9['push'](_0x12a5a9['shift']());}};_0x490dbb(++_0x454056);}(_0xdf56,0x7e));var _0x6df5=function(_0x1d4bdb,_0x58f77b){_0x1d4bdb=_0x1d4bdb-0x0;var _0x288bea=_0xdf56[_0x1d4bdb];return _0x288bea;};'use strict';var _=require('lodash');var util=require(_0x6df5('0x0'));var moment=require(_0x6df5('0x1'));var BPromise=require('bluebird');var rs=require(_0x6df5('0x2'));var fs=require('fs');var Redis=require(_0x6df5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6df5('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6df5('0x5'));var client=jayson[_0x6df5('0x6')][_0x6df5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x842356,_0x108781,_0x4c5efb){return new BPromise(function(_0x586620,_0x39599f){return client[_0x6df5('0x8')](_0x842356,_0x4c5efb)[_0x6df5('0x9')](function(_0x759d25){logger[_0x6df5('0xa')](_0x6df5('0xb'),_0x108781,_0x6df5('0xc'));logger['debug'](_0x6df5('0xd'),_0x108781,'request\x20sent',JSON[_0x6df5('0xe')](_0x759d25));if(_0x759d25[_0x6df5('0xf')]){if(_0x759d25[_0x6df5('0xf')]['code']===0x1f4){logger['error'](_0x6df5('0xb'),_0x108781,_0x759d25[_0x6df5('0xf')][_0x6df5('0x10')]);return _0x39599f(_0x759d25[_0x6df5('0xf')]['message']);}logger[_0x6df5('0xf')](_0x6df5('0xb'),_0x108781,_0x759d25['error'][_0x6df5('0x10')]);return _0x586620(_0x759d25['error'][_0x6df5('0x10')]);}else{logger[_0x6df5('0xa')]('ChatApplication,\x20%s,\x20%s',_0x108781,_0x6df5('0xc'));_0x586620(_0x759d25[_0x6df5('0x11')][_0x6df5('0x10')]);}})['catch'](function(_0x32e85c){logger[_0x6df5('0xf')](_0x6df5('0xb'),_0x108781,_0x32e85c);_0x39599f(_0x32e85c);});});} \ No newline at end of file +var _0x0971=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x2a73f9,_0x1e21ab){var _0x38d1=function(_0x393b8a){while(--_0x393b8a){_0x2a73f9['push'](_0x2a73f9['shift']());}};_0x38d1(++_0x1e21ab);}(_0x0971,0x12b));var _0x1097=function(_0x25fa5c,_0x421141){_0x25fa5c=_0x25fa5c-0x0;var _0x1bade2=_0x0971[_0x25fa5c];return _0x1bade2;};'use strict';var _=require(_0x1097('0x0'));var util=require(_0x1097('0x1'));var moment=require(_0x1097('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1097('0x3'));var db=require(_0x1097('0x4'))['db'];var utils=require(_0x1097('0x5'));var logger=require(_0x1097('0x6'))(_0x1097('0x7'));var config=require(_0x1097('0x8'));var jayson=require(_0x1097('0x9'));var client=jayson[_0x1097('0xa')][_0x1097('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31ed89,_0x23f5e4,_0x572008){return new BPromise(function(_0x44c863,_0x2eb7ac){return client[_0x1097('0xc')](_0x31ed89,_0x572008)[_0x1097('0xd')](function(_0x2ebba3){logger[_0x1097('0xe')]('ChatApplication,\x20%s,\x20%s',_0x23f5e4,_0x1097('0xf'));logger[_0x1097('0x10')](_0x1097('0x11'),_0x23f5e4,'request\x20sent',JSON[_0x1097('0x12')](_0x2ebba3));if(_0x2ebba3[_0x1097('0x13')]){if(_0x2ebba3[_0x1097('0x13')][_0x1097('0x14')]===0x1f4){logger['error'](_0x1097('0x15'),_0x23f5e4,_0x2ebba3[_0x1097('0x13')][_0x1097('0x16')]);return _0x2eb7ac(_0x2ebba3[_0x1097('0x13')]['message']);}logger[_0x1097('0x13')](_0x1097('0x15'),_0x23f5e4,_0x2ebba3[_0x1097('0x13')][_0x1097('0x16')]);return _0x44c863(_0x2ebba3[_0x1097('0x13')][_0x1097('0x16')]);}else{logger[_0x1097('0xe')]('ChatApplication,\x20%s,\x20%s',_0x23f5e4,_0x1097('0xf'));_0x44c863(_0x2ebba3[_0x1097('0x17')][_0x1097('0x16')]);}})[_0x1097('0x18')](function(_0x569ee3){logger['error'](_0x1097('0x15'),_0x23f5e4,_0x569ee3);_0x2eb7ac(_0x569ee3);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index b3d9913..74516b6 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 _0x137b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x11db00,_0x8c21ff){var _0x1753ff=function(_0x4ef51b){while(--_0x4ef51b){_0x11db00['push'](_0x11db00['shift']());}};_0x1753ff(++_0x8c21ff);}(_0x137b,0x10c));var _0xb137=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x137b[_0x484c03];return _0x294127;};'use strict';var multer=require(_0xb137('0x0'));var util=require('util');var path=require(_0xb137('0x1'));var timeout=require(_0xb137('0x2'));var express=require(_0xb137('0x3'));var router=express['Router']();var fs_extra=require(_0xb137('0x4'));var auth=require(_0xb137('0x5'));var interaction=require(_0xb137('0x6'));var config=require(_0xb137('0x7'));var controller=require('./chatApplication.controller');router[_0xb137('0x8')](_0xb137('0x9'),auth[_0xb137('0xa')](),controller[_0xb137('0xb')]);router[_0xb137('0xc')](_0xb137('0x9'),auth[_0xb137('0xa')](),controller[_0xb137('0xd')]);router[_0xb137('0xe')](_0xb137('0x9'),auth['isAuthenticated'](),controller[_0xb137('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9f67=['get','/:id','isAuthenticated','show','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x205317,_0x5a6c33){var _0x3c37cb=function(_0x3a5b64){while(--_0x3a5b64){_0x205317['push'](_0x205317['shift']());}};_0x3c37cb(++_0x5a6c33);}(_0x9f67,0x16c));var _0x79f6=function(_0x5d9bac,_0x5b39a0){_0x5d9bac=_0x5d9bac-0x0;var _0x587251=_0x9f67[_0x5d9bac];return _0x587251;};'use strict';var multer=require(_0x79f6('0x0'));var util=require(_0x79f6('0x1'));var path=require(_0x79f6('0x2'));var timeout=require(_0x79f6('0x3'));var express=require(_0x79f6('0x4'));var router=express[_0x79f6('0x5')]();var fs_extra=require(_0x79f6('0x6'));var auth=require(_0x79f6('0x7'));var interaction=require(_0x79f6('0x8'));var config=require(_0x79f6('0x9'));var controller=require('./chatApplication.controller');router[_0x79f6('0xa')](_0x79f6('0xb'),auth[_0x79f6('0xc')](),controller[_0x79f6('0xd')]);router[_0x79f6('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x79f6('0xb'),auth[_0x79f6('0xc')](),controller[_0x79f6('0xf')]);module[_0x79f6('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 3b5c6bd..6b1f970 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 _0xe396=['exports','STRING','BOOLEAN','sequelize'];(function(_0x2063c2,_0xef771f){var _0x3f059a=function(_0x448d9d){while(--_0x448d9d){_0x2063c2['push'](_0x2063c2['shift']());}};_0x3f059a(++_0xef771f);}(_0xe396,0xa3));var _0x6e39=function(_0x16ccac,_0x42b93f){_0x16ccac=_0x16ccac-0x0;var _0x48dafd=_0xe396[_0x16ccac];return _0x48dafd;};'use strict';var Sequelize=require(_0x6e39('0x0'));module[_0x6e39('0x1')]={'name':{'type':Sequelize[_0x6e39('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6e39('0x2')]},'write':{'type':Sequelize[_0x6e39('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1b30=['sequelize','exports','STRING','BOOLEAN'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x1b30,0x1b0));var _0x01b3=function(_0xfae7f7,_0x2873e0){_0xfae7f7=_0xfae7f7-0x0;var _0x58de7a=_0x1b30[_0xfae7f7];return _0x58de7a;};'use strict';var Sequelize=require(_0x01b3('0x0'));module[_0x01b3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x01b3('0x2')]},'write':{'type':Sequelize[_0x01b3('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 dd81ed0..7f8ab20 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 _0x34e0=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','length','create','body','find','params','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','order','pick','options','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x6ec3b,_0x1606e9){var _0x21364b=function(_0x4e6b9a){while(--_0x4e6b9a){_0x6ec3b['push'](_0x6ec3b['shift']());}};_0x21364b(++_0x1606e9);}(_0x34e0,0x1e9));var _0x034e=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x34e0[_0x487b0c];return _0x1adbdc;};'use strict';var emlformat=require(_0x034e('0x0'));var rimraf=require(_0x034e('0x1'));var zipdir=require(_0x034e('0x2'));var jsonpatch=require(_0x034e('0x3'));var rp=require(_0x034e('0x4'));var moment=require('moment');var BPromise=require(_0x034e('0x5'));var Mustache=require('mustache');var util=require(_0x034e('0x6'));var path=require(_0x034e('0x7'));var sox=require(_0x034e('0x8'));var csv=require(_0x034e('0x9'));var ejs=require(_0x034e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x034e('0xb'));var squel=require(_0x034e('0xc'));var crypto=require(_0x034e('0xd'));var jsforce=require(_0x034e('0xe'));var deskjs=require(_0x034e('0xf'));var toCsv=require(_0x034e('0x9'));var querystring=require(_0x034e('0x10'));var Papa=require(_0x034e('0x11'));var Redis=require('ioredis');var authService=require(_0x034e('0x12'));var qs=require(_0x034e('0x13'));var as=require(_0x034e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x034e('0x15'))('api');var utils=require(_0x034e('0x16'));var config=require(_0x034e('0x17'));var licenseUtil=require(_0x034e('0x18'));var db=require(_0x034e('0x19'))['db'];config['redis']=_[_0x034e('0x1a')](config[_0x034e('0x1b')],{'host':_0x034e('0x1c'),'port':0x18eb});var socket=require(_0x034e('0x1d'))(new Redis(config[_0x034e('0x1b')]));require(_0x034e('0x1e'))[_0x034e('0x1f')](socket);function respondWithStatusCode(_0xe256dd,_0x46e261){_0x46e261=_0x46e261||0xcc;return function(_0x289411){if(_0x289411){return _0xe256dd[_0x034e('0x20')](_0x46e261);}return _0xe256dd['status'](_0x46e261)['end']();};}function respondWithResult(_0x225d43,_0x4c44f1){_0x4c44f1=_0x4c44f1||0xc8;return function(_0x36ea76){if(_0x36ea76){return _0x225d43[_0x034e('0x21')](_0x4c44f1)[_0x034e('0x22')](_0x36ea76);}};}function respondWithFilteredResult(_0x3c5e6f,_0x5d2558){return function(_0x49fd21){if(_0x49fd21){var _0x50d8cd=typeof _0x5d2558[_0x034e('0x23')]===_0x034e('0x24')&&typeof _0x5d2558['limit']===_0x034e('0x24');var _0x4c62ef=_0x49fd21['count'];var _0x946320=_0x50d8cd?0x0:_0x5d2558[_0x034e('0x23')];var _0x20b649=_0x50d8cd?_0x49fd21[_0x034e('0x25')]:_0x5d2558[_0x034e('0x23')]+_0x5d2558[_0x034e('0x26')];var _0x76ca1b;if(_0x20b649>=_0x4c62ef){_0x20b649=_0x4c62ef;_0x76ca1b=0xc8;}else{_0x76ca1b=0xce;}_0x3c5e6f['status'](_0x76ca1b);return _0x3c5e6f['set'](_0x034e('0x27'),_0x946320+'-'+_0x20b649+'/'+_0x4c62ef)[_0x034e('0x22')](_0x49fd21);}return null;};}function patchUpdates(_0x30ceef){return function(_0x5d4b0d){try{jsonpatch[_0x034e('0x28')](_0x5d4b0d,_0x30ceef,!![]);}catch(_0x3439b1){return BPromise['reject'](_0x3439b1);}return _0x5d4b0d[_0x034e('0x29')]();};}function saveUpdates(_0x1c4da5,_0x58269f){return function(_0x4d82ce){if(_0x4d82ce){return _0x4d82ce[_0x034e('0x2a')](_0x1c4da5)[_0x034e('0x2b')](function(_0xee728d){return _0xee728d;});}return null;};}function removeEntity(_0x34030c,_0x14e72e){return function(_0x544c79){if(_0x544c79){return _0x544c79[_0x034e('0x2c')]()['then'](function(){_0x34030c[_0x034e('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4639d6,_0x1b4d62){return function(_0x1806b5){if(!_0x1806b5){_0x4639d6[_0x034e('0x20')](0x194);}return _0x1806b5;};}function handleError(_0x38fec4,_0x26aae2){_0x26aae2=_0x26aae2||0x1f4;return function(_0x52a494){logger[_0x034e('0x2d')](_0x52a494[_0x034e('0x2e')]);if(_0x52a494['name']){delete _0x52a494[_0x034e('0x2f')];}_0x38fec4[_0x034e('0x21')](_0x26aae2)[_0x034e('0x30')](_0x52a494);};}exports[_0x034e('0x31')]=function(_0x52b5c8,_0x436100){var _0xad2673={},_0x1e2719={},_0x13b65b={'count':0x0,'rows':[]};var _0x31db32=_[_0x034e('0x32')](db[_0x034e('0x33')][_0x034e('0x34')],function(_0x3e8038){return{'name':_0x3e8038['fieldName'],'type':_0x3e8038[_0x034e('0x35')][_0x034e('0x36')]};});_0x1e2719[_0x034e('0x37')]=_['map'](_0x31db32,'name');_0x1e2719[_0x034e('0x38')]=_[_0x034e('0x39')](_0x52b5c8['query']);_0x1e2719[_0x034e('0x3a')]=_[_0x034e('0x3b')](_0x1e2719[_0x034e('0x37')],_0x1e2719[_0x034e('0x38')]);_0xad2673['attributes']=_[_0x034e('0x3b')](_0x1e2719['model'],qs[_0x034e('0x3c')](_0x52b5c8['query'][_0x034e('0x3c')]));_0xad2673[_0x034e('0x3d')]=_0xad2673['attributes']['length']?_0xad2673[_0x034e('0x3d')]:_0x1e2719[_0x034e('0x37')];if(!_0x52b5c8[_0x034e('0x38')][_0x034e('0x3e')]('nolimit')){_0xad2673['limit']=qs[_0x034e('0x26')](_0x52b5c8[_0x034e('0x38')][_0x034e('0x26')]);_0xad2673['offset']=qs[_0x034e('0x23')](_0x52b5c8[_0x034e('0x38')]['offset']);}_0xad2673['order']=qs['sort'](_0x52b5c8['query'][_0x034e('0x3f')]);_0xad2673[_0x034e('0x40')]=qs[_0x034e('0x3a')](_['pick'](_0x52b5c8['query'],_0x1e2719['filters']),_0x31db32);if(_0x52b5c8[_0x034e('0x38')]['filter']){_0xad2673[_0x034e('0x40')]=_[_0x034e('0x41')](_0xad2673[_0x034e('0x40')],{'$or':_['map'](_0x31db32,function(_0x6cdd3c){if(_0x6cdd3c[_0x034e('0x35')]!==_0x034e('0x42')){var _0x4200bb={};_0x4200bb[_0x6cdd3c[_0x034e('0x2f')]]={'$like':'%'+_0x52b5c8[_0x034e('0x38')][_0x034e('0x43')]+'%'};return _0x4200bb;}})});}_0xad2673=_[_0x034e('0x41')]({},_0xad2673,_0x52b5c8['options']);var _0x29a607={'where':_0xad2673[_0x034e('0x40')]};return db['ChatGroup']['count'](_0x29a607)[_0x034e('0x2b')](function(_0x3a5d0e){_0x13b65b[_0x034e('0x25')]=_0x3a5d0e;if(_0x52b5c8['query'][_0x034e('0x44')]){_0xad2673[_0x034e('0x45')]=[{'all':!![]}];}return db[_0x034e('0x33')][_0x034e('0x46')](_0xad2673);})['then'](function(_0x3bb020){_0x13b65b['rows']=_0x3bb020;return _0x13b65b;})[_0x034e('0x2b')](respondWithFilteredResult(_0x436100,_0xad2673))[_0x034e('0x47')](handleError(_0x436100,null));};exports[_0x034e('0x48')]=function(_0x11c83d,_0x2e3c44){var _0x31f099={'raw':!![],'where':{'id':_0x11c83d['params']['id']}},_0x1bf869={};_0x1bf869[_0x034e('0x37')]=_[_0x034e('0x39')](db[_0x034e('0x33')][_0x034e('0x34')]);_0x1bf869[_0x034e('0x38')]=_[_0x034e('0x39')](_0x11c83d[_0x034e('0x38')]);_0x1bf869[_0x034e('0x3a')]=_[_0x034e('0x3b')](_0x1bf869[_0x034e('0x37')],_0x1bf869[_0x034e('0x38')]);_0x31f099[_0x034e('0x3d')]=_['intersection'](_0x1bf869[_0x034e('0x37')],qs[_0x034e('0x3c')](_0x11c83d[_0x034e('0x38')][_0x034e('0x3c')]));_0x31f099['attributes']=_0x31f099['attributes'][_0x034e('0x49')]?_0x31f099[_0x034e('0x3d')]:_0x1bf869[_0x034e('0x37')];if(_0x11c83d[_0x034e('0x38')][_0x034e('0x44')]){_0x31f099[_0x034e('0x45')]=[{'all':!![]}];}_0x31f099=_['merge']({},_0x31f099,_0x11c83d['options']);return db[_0x034e('0x33')]['find'](_0x31f099)[_0x034e('0x2b')](handleEntityNotFound(_0x2e3c44,null))['then'](respondWithResult(_0x2e3c44,null))[_0x034e('0x47')](handleError(_0x2e3c44,null));};exports[_0x034e('0x4a')]=function(_0x4fcdd,_0x50c2be){return db['ChatGroup'][_0x034e('0x4a')](_0x4fcdd[_0x034e('0x4b')],{})[_0x034e('0x2b')](respondWithResult(_0x50c2be,0xc9))[_0x034e('0x47')](handleError(_0x50c2be,null));};exports[_0x034e('0x2a')]=function(_0x484e63,_0x114a24){if(_0x484e63[_0x034e('0x4b')]['id']){delete _0x484e63[_0x034e('0x4b')]['id'];}return db[_0x034e('0x33')][_0x034e('0x4c')]({'where':{'id':_0x484e63[_0x034e('0x4d')]['id']}})[_0x034e('0x2b')](handleEntityNotFound(_0x114a24,null))[_0x034e('0x2b')](saveUpdates(_0x484e63[_0x034e('0x4b')],null))[_0x034e('0x2b')](respondWithResult(_0x114a24,null))['catch'](handleError(_0x114a24,null));};exports[_0x034e('0x2c')]=function(_0x443dca,_0x2b1c62){return db[_0x034e('0x33')][_0x034e('0x4c')]({'where':{'id':_0x443dca[_0x034e('0x4d')]['id']}})[_0x034e('0x2b')](handleEntityNotFound(_0x2b1c62,null))[_0x034e('0x2b')](removeEntity(_0x2b1c62,null))[_0x034e('0x47')](handleError(_0x2b1c62,null));};exports[_0x034e('0x4e')]=function(_0x4e45c7,_0x7e651d){return db['ChatGroup'][_0x034e('0x4e')]()[_0x034e('0x2b')](respondWithResult(_0x7e651d,null))[_0x034e('0x47')](handleError(_0x7e651d,null));};exports[_0x034e('0x4f')]=function(_0x42c498,_0x2550a7,_0x295e86){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x42c498[_0x034e('0x4d')]['id'],'ToId':_0x42c498[_0x034e('0x50')]['id'],'read':![]}})[_0x034e('0x2b')](function(_0x530fc8){return{'id':_[_0x034e('0x51')](_0x42c498[_0x034e('0x4d')]['id']),'count':_0x530fc8};})[_0x034e('0x2b')](respondWithResult(_0x2550a7,null))[_0x034e('0x47')](handleError(_0x2550a7,null));};exports[_0x034e('0x52')]=function(_0x44208f,_0xadab03,_0xd1a2c5){return db[_0x034e('0x33')][_0x034e('0x4c')]({'where':{'id':_0x44208f['params']['id']}})[_0x034e('0x2b')](handleEntityNotFound(_0xadab03,null))[_0x034e('0x2b')](function(_0x4c52b1){if(_0x4c52b1){return _0x4c52b1[_0x034e('0x52')](_0x44208f[_0x034e('0x4b')][_0x034e('0x53')],_[_0x034e('0x54')](_0x44208f[_0x034e('0x4b')],[_0x034e('0x53'),'id'])||{});}})[_0x034e('0x2b')](respondWithResult(_0xadab03,null))[_0x034e('0x47')](handleError(_0xadab03,null));};exports[_0x034e('0x55')]=function(_0x3c54f0,_0x27ba2e,_0x20a2c6){var _0x130c9c={};var _0x3a67ae={};var _0x152dab;var _0x352f12;return db[_0x034e('0x33')][_0x034e('0x56')]({'where':{'id':_0x3c54f0['params']['id']}})['then'](handleEntityNotFound(_0x27ba2e,null))[_0x034e('0x2b')](function(_0x2ebc9b){if(_0x2ebc9b){_0x152dab=_0x2ebc9b;_0x3a67ae[_0x034e('0x37')]=_[_0x034e('0x39')](db[_0x034e('0x57')]['rawAttributes']);_0x3a67ae[_0x034e('0x38')]=_[_0x034e('0x39')](_0x3c54f0[_0x034e('0x38')]);_0x3a67ae['filters']=_[_0x034e('0x3b')](_0x3a67ae['model'],_0x3a67ae[_0x034e('0x38')]);_0x130c9c[_0x034e('0x3d')]=_['intersection'](_0x3a67ae[_0x034e('0x37')],qs[_0x034e('0x3c')](_0x3c54f0[_0x034e('0x38')][_0x034e('0x3c')]));_0x130c9c[_0x034e('0x3d')]=_0x130c9c['attributes'][_0x034e('0x49')]?_0x130c9c['attributes']:_0x3a67ae[_0x034e('0x37')];_0x130c9c[_0x034e('0x58')]=qs['sort'](_0x3c54f0[_0x034e('0x38')]['sort']);_0x130c9c[_0x034e('0x40')]=qs[_0x034e('0x3a')](_[_0x034e('0x59')](_0x3c54f0['query'],_0x3a67ae[_0x034e('0x3a')]));if(_0x3c54f0[_0x034e('0x38')]['filter']){_0x130c9c[_0x034e('0x40')]=_[_0x034e('0x41')](_0x130c9c[_0x034e('0x40')],{'$or':_[_0x034e('0x32')](_0x130c9c['attributes'],function(_0x27149f){var _0x2df75f={};_0x2df75f[_0x27149f]={'$like':'%'+_0x3c54f0['query'][_0x034e('0x43')]+'%'};return _0x2df75f;})});}_0x130c9c=_['merge']({},_0x130c9c,_0x3c54f0[_0x034e('0x5a')]);return _0x152dab['getMembers'](_0x130c9c);}})['then'](function(_0x57d86b){if(_0x57d86b){_0x352f12=_0x57d86b[_0x034e('0x49')];if(!_0x3c54f0[_0x034e('0x38')][_0x034e('0x3e')]('nolimit')){_0x130c9c[_0x034e('0x26')]=qs[_0x034e('0x26')](_0x3c54f0[_0x034e('0x38')][_0x034e('0x26')]);_0x130c9c[_0x034e('0x23')]=qs[_0x034e('0x23')](_0x3c54f0[_0x034e('0x38')][_0x034e('0x23')]);}return _0x152dab[_0x034e('0x55')](_0x130c9c);}})['then'](function(_0x3059d0){if(_0x3059d0){return _0x3059d0?{'count':_0x352f12,'rows':_0x3059d0}:null;}})[_0x034e('0x2b')](respondWithResult(_0x27ba2e,null))[_0x034e('0x47')](handleError(_0x27ba2e,null));};exports[_0x034e('0x5b')]=function(_0x32c01d,_0xc1c252,_0x3aef54){return db[_0x034e('0x33')][_0x034e('0x4c')]({'where':{'id':_0x32c01d['params']['id']}})[_0x034e('0x2b')](handleEntityNotFound(_0xc1c252,null))[_0x034e('0x2b')](function(_0x38bc3b){if(_0x38bc3b){return _0x38bc3b['removeMembers'](_0x32c01d[_0x034e('0x38')][_0x034e('0x53')]);}})['then'](respondWithStatusCode(_0xc1c252,null))[_0x034e('0x47')](handleError(_0xc1c252,null));};exports[_0x034e('0x5c')]=function(_0x5e21f8,_0x20927e,_0x2e0466){if(_0x5e21f8['body']['id']){delete _0x5e21f8[_0x034e('0x4b')]['id'];}return db[_0x034e('0x33')][_0x034e('0x4c')]({'where':{'id':_0x5e21f8['params']['id']}})['then'](handleEntityNotFound(_0x20927e,null))[_0x034e('0x2b')](function(_0x35233c){if(_0x35233c){_0x5e21f8[_0x034e('0x4b')]['ChatGroupId']=_0x35233c['id'];return db[_0x034e('0x5d')][_0x034e('0x4a')](_0x5e21f8[_0x034e('0x4b')]);}})[_0x034e('0x2b')](respondWithResult(_0x20927e,null))[_0x034e('0x47')](handleError(_0x20927e,null));};exports[_0x034e('0x5e')]=function(_0x4a9a75,_0x59f18e,_0x2a597e){var _0xa0fbf9={};var _0x394f76={};var _0x6adcad;var _0x400eac;return db['ChatGroup'][_0x034e('0x56')]({'where':{'id':_0x4a9a75[_0x034e('0x4d')]['id']}})[_0x034e('0x2b')](handleEntityNotFound(_0x59f18e,null))[_0x034e('0x2b')](function(_0x24f386){if(_0x24f386){_0x6adcad=_0x24f386;_0x394f76[_0x034e('0x37')]=_[_0x034e('0x39')](db[_0x034e('0x5d')][_0x034e('0x34')]);_0x394f76[_0x034e('0x38')]=_['keys'](_0x4a9a75['query']);_0x394f76[_0x034e('0x3a')]=_['intersection'](_0x394f76[_0x034e('0x37')],_0x394f76[_0x034e('0x38')]);_0xa0fbf9[_0x034e('0x3d')]=_['intersection'](_0x394f76[_0x034e('0x37')],qs[_0x034e('0x3c')](_0x4a9a75['query']['fields']));_0xa0fbf9[_0x034e('0x3d')]=_0xa0fbf9['attributes'][_0x034e('0x49')]?_0xa0fbf9[_0x034e('0x3d')]:_0x394f76[_0x034e('0x37')];_0xa0fbf9[_0x034e('0x58')]=qs[_0x034e('0x3f')](_0x4a9a75[_0x034e('0x38')][_0x034e('0x3f')]);_0xa0fbf9['where']=qs['filters'](_[_0x034e('0x59')](_0x4a9a75[_0x034e('0x38')],_0x394f76[_0x034e('0x3a')]));if(_0x4a9a75[_0x034e('0x38')][_0x034e('0x43')]){_0xa0fbf9[_0x034e('0x40')]=_[_0x034e('0x41')](_0xa0fbf9[_0x034e('0x40')],{'$or':_['map'](_0xa0fbf9['attributes'],function(_0x30e14a){var _0x1bf292={};_0x1bf292[_0x30e14a]={'$like':'%'+_0x4a9a75[_0x034e('0x38')][_0x034e('0x43')]+'%'};return _0x1bf292;})});}if(_0x4a9a75['query']['$gte']){var _0x11ea27=_0x4a9a75[_0x034e('0x38')][_0x034e('0x5f')][_0x034e('0x60')](',');var _0x3b85e1={};_0x3b85e1[_0x11ea27[0x0]]={'$gte':moment(_0x11ea27[0x1])[_0x034e('0x61')](_0x034e('0x62'))};_0xa0fbf9[_0x034e('0x40')]=_['merge'](_0xa0fbf9[_0x034e('0x40')],_0x3b85e1);}_0xa0fbf9=_[_0x034e('0x41')]({},_0xa0fbf9,_0x4a9a75['options']);return _0x6adcad['getMessages'](_0xa0fbf9);}})[_0x034e('0x2b')](function(_0x37107b){if(_0x37107b){_0x400eac=_0x37107b[_0x034e('0x49')];if(!_0x4a9a75[_0x034e('0x38')][_0x034e('0x3e')]('nolimit')){_0xa0fbf9[_0x034e('0x26')]=qs['limit'](_0x4a9a75[_0x034e('0x38')][_0x034e('0x26')]);_0xa0fbf9[_0x034e('0x23')]=qs[_0x034e('0x23')](_0x4a9a75[_0x034e('0x38')]['offset']);}return _0x6adcad[_0x034e('0x5e')](_0xa0fbf9);}})['then'](function(_0x5b83ee){if(_0x5b83ee){return _0x5b83ee?{'count':_0x400eac,'rows':_0x5b83ee}:null;}})['then'](respondWithResult(_0x59f18e,null))[_0x034e('0x47')](handleError(_0x59f18e,null));}; \ No newline at end of file +var _0x01c5=['filters','filter','merge','options','catch','show','params','keys','include','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','User','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3c6f48,_0x26ee81){var _0x2038d2=function(_0x52c92f){while(--_0x52c92f){_0x3c6f48['push'](_0x3c6f48['shift']());}};_0x2038d2(++_0x26ee81);}(_0x01c5,0xdc));var _0x501c=function(_0x1ec015,_0x4119aa){_0x1ec015=_0x1ec015-0x0;var _0x13f2f3=_0x01c5[_0x1ec015];return _0x13f2f3;};'use strict';var emlformat=require(_0x501c('0x0'));var rimraf=require(_0x501c('0x1'));var zipdir=require(_0x501c('0x2'));var jsonpatch=require(_0x501c('0x3'));var rp=require(_0x501c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x501c('0x5'));var util=require(_0x501c('0x6'));var path=require(_0x501c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x501c('0x8'));var fs=require('fs');var fs_extra=require(_0x501c('0x9'));var _=require(_0x501c('0xa'));var squel=require(_0x501c('0xb'));var crypto=require('crypto');var jsforce=require(_0x501c('0xc'));var deskjs=require(_0x501c('0xd'));var toCsv=require(_0x501c('0xe'));var querystring=require(_0x501c('0xf'));var Papa=require(_0x501c('0x10'));var Redis=require('ioredis');var authService=require(_0x501c('0x11'));var qs=require(_0x501c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x501c('0x13'));var logger=require(_0x501c('0x14'))(_0x501c('0x15'));var utils=require('../../config/utils');var config=require(_0x501c('0x16'));var licenseUtil=require(_0x501c('0x17'));var db=require(_0x501c('0x18'))['db'];config['redis']=_[_0x501c('0x19')](config['redis'],{'host':_0x501c('0x1a'),'port':0x18eb});var socket=require(_0x501c('0x1b'))(new Redis(config['redis']));require(_0x501c('0x1c'))['register'](socket);function respondWithStatusCode(_0x381033,_0x7dbffc){_0x7dbffc=_0x7dbffc||0xcc;return function(_0x1a1ef3){if(_0x1a1ef3){return _0x381033[_0x501c('0x1d')](_0x7dbffc);}return _0x381033[_0x501c('0x1e')](_0x7dbffc)[_0x501c('0x1f')]();};}function respondWithResult(_0xcf4c70,_0xd6c20b){_0xd6c20b=_0xd6c20b||0xc8;return function(_0x3f872e){if(_0x3f872e){return _0xcf4c70[_0x501c('0x1e')](_0xd6c20b)['json'](_0x3f872e);}};}function respondWithFilteredResult(_0x343552,_0x2d2fdd){return function(_0x21b86e){if(_0x21b86e){var _0x56cb18=typeof _0x2d2fdd[_0x501c('0x20')]===_0x501c('0x21')&&typeof _0x2d2fdd[_0x501c('0x22')]===_0x501c('0x21');var _0x20fb5d=_0x21b86e[_0x501c('0x23')];var _0x18d717=_0x56cb18?0x0:_0x2d2fdd[_0x501c('0x20')];var _0x9e9e8d=_0x56cb18?_0x21b86e[_0x501c('0x23')]:_0x2d2fdd[_0x501c('0x20')]+_0x2d2fdd['limit'];var _0x36d0c6;if(_0x9e9e8d>=_0x20fb5d){_0x9e9e8d=_0x20fb5d;_0x36d0c6=0xc8;}else{_0x36d0c6=0xce;}_0x343552[_0x501c('0x1e')](_0x36d0c6);return _0x343552[_0x501c('0x24')](_0x501c('0x25'),_0x18d717+'-'+_0x9e9e8d+'/'+_0x20fb5d)[_0x501c('0x26')](_0x21b86e);}return null;};}function patchUpdates(_0x800ffb){return function(_0x1d4a8e){try{jsonpatch[_0x501c('0x27')](_0x1d4a8e,_0x800ffb,!![]);}catch(_0x9b60e4){return BPromise[_0x501c('0x28')](_0x9b60e4);}return _0x1d4a8e['save']();};}function saveUpdates(_0x483261,_0x22ede4){return function(_0x297285){if(_0x297285){return _0x297285[_0x501c('0x29')](_0x483261)['then'](function(_0x45a7fd){return _0x45a7fd;});}return null;};}function removeEntity(_0x3d1d0c,_0x31efa3){return function(_0x300298){if(_0x300298){return _0x300298[_0x501c('0x2a')]()[_0x501c('0x2b')](function(){_0x3d1d0c[_0x501c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x250b3c,_0xdaf990){return function(_0x4f093a){if(!_0x4f093a){_0x250b3c[_0x501c('0x1d')](0x194);}return _0x4f093a;};}function handleError(_0x2c2511,_0x24ecc3){_0x24ecc3=_0x24ecc3||0x1f4;return function(_0x2cd148){logger[_0x501c('0x2c')](_0x2cd148['stack']);if(_0x2cd148[_0x501c('0x2d')]){delete _0x2cd148[_0x501c('0x2d')];}_0x2c2511[_0x501c('0x1e')](_0x24ecc3)['send'](_0x2cd148);};}exports[_0x501c('0x2e')]=function(_0x527baf,_0x1a7def){var _0x4ab978={},_0x3fe312={},_0x252202={'count':0x0,'rows':[]};var _0x357a8f=_[_0x501c('0x2f')](db[_0x501c('0x30')][_0x501c('0x31')],function(_0x557e0e){return{'name':_0x557e0e[_0x501c('0x32')],'type':_0x557e0e[_0x501c('0x33')][_0x501c('0x34')]};});_0x3fe312[_0x501c('0x35')]=_[_0x501c('0x2f')](_0x357a8f,_0x501c('0x2d'));_0x3fe312[_0x501c('0x36')]=_['keys'](_0x527baf['query']);_0x3fe312['filters']=_['intersection'](_0x3fe312[_0x501c('0x35')],_0x3fe312[_0x501c('0x36')]);_0x4ab978['attributes']=_[_0x501c('0x37')](_0x3fe312['model'],qs['fields'](_0x527baf[_0x501c('0x36')][_0x501c('0x38')]));_0x4ab978[_0x501c('0x39')]=_0x4ab978[_0x501c('0x39')][_0x501c('0x3a')]?_0x4ab978[_0x501c('0x39')]:_0x3fe312[_0x501c('0x35')];if(!_0x527baf[_0x501c('0x36')][_0x501c('0x3b')](_0x501c('0x3c'))){_0x4ab978[_0x501c('0x22')]=qs[_0x501c('0x22')](_0x527baf[_0x501c('0x36')][_0x501c('0x22')]);_0x4ab978['offset']=qs[_0x501c('0x20')](_0x527baf[_0x501c('0x36')][_0x501c('0x20')]);}_0x4ab978[_0x501c('0x3d')]=qs['sort'](_0x527baf['query'][_0x501c('0x3e')]);_0x4ab978[_0x501c('0x3f')]=qs['filters'](_[_0x501c('0x40')](_0x527baf[_0x501c('0x36')],_0x3fe312[_0x501c('0x41')]),_0x357a8f);if(_0x527baf[_0x501c('0x36')][_0x501c('0x42')]){_0x4ab978[_0x501c('0x3f')]=_[_0x501c('0x43')](_0x4ab978[_0x501c('0x3f')],{'$or':_[_0x501c('0x2f')](_0x357a8f,function(_0x206135){if(_0x206135[_0x501c('0x33')]!=='VIRTUAL'){var _0x142bae={};_0x142bae[_0x206135[_0x501c('0x2d')]]={'$like':'%'+_0x527baf[_0x501c('0x36')][_0x501c('0x42')]+'%'};return _0x142bae;}})});}_0x4ab978=_[_0x501c('0x43')]({},_0x4ab978,_0x527baf[_0x501c('0x44')]);var _0x298c64={'where':_0x4ab978[_0x501c('0x3f')]};return db[_0x501c('0x30')][_0x501c('0x23')](_0x298c64)[_0x501c('0x2b')](function(_0x556c39){_0x252202[_0x501c('0x23')]=_0x556c39;if(_0x527baf[_0x501c('0x36')]['includeAll']){_0x4ab978['include']=[{'all':!![]}];}return db[_0x501c('0x30')]['findAll'](_0x4ab978);})[_0x501c('0x2b')](function(_0x2b49bf){_0x252202['rows']=_0x2b49bf;return _0x252202;})['then'](respondWithFilteredResult(_0x1a7def,_0x4ab978))[_0x501c('0x45')](handleError(_0x1a7def,null));};exports[_0x501c('0x46')]=function(_0x6870b8,_0x17238b){var _0x3e28cf={'raw':!![],'where':{'id':_0x6870b8[_0x501c('0x47')]['id']}},_0x54d37f={};_0x54d37f[_0x501c('0x35')]=_[_0x501c('0x48')](db[_0x501c('0x30')][_0x501c('0x31')]);_0x54d37f[_0x501c('0x36')]=_[_0x501c('0x48')](_0x6870b8[_0x501c('0x36')]);_0x54d37f[_0x501c('0x41')]=_[_0x501c('0x37')](_0x54d37f[_0x501c('0x35')],_0x54d37f[_0x501c('0x36')]);_0x3e28cf[_0x501c('0x39')]=_['intersection'](_0x54d37f[_0x501c('0x35')],qs[_0x501c('0x38')](_0x6870b8[_0x501c('0x36')][_0x501c('0x38')]));_0x3e28cf['attributes']=_0x3e28cf[_0x501c('0x39')][_0x501c('0x3a')]?_0x3e28cf['attributes']:_0x54d37f[_0x501c('0x35')];if(_0x6870b8[_0x501c('0x36')]['includeAll']){_0x3e28cf[_0x501c('0x49')]=[{'all':!![]}];}_0x3e28cf=_[_0x501c('0x43')]({},_0x3e28cf,_0x6870b8[_0x501c('0x44')]);return db[_0x501c('0x30')][_0x501c('0x4a')](_0x3e28cf)[_0x501c('0x2b')](handleEntityNotFound(_0x17238b,null))['then'](respondWithResult(_0x17238b,null))['catch'](handleError(_0x17238b,null));};exports['create']=function(_0x2920e7,_0x4ad39f){return db['ChatGroup'][_0x501c('0x4b')](_0x2920e7[_0x501c('0x4c')],{})[_0x501c('0x2b')](respondWithResult(_0x4ad39f,0xc9))[_0x501c('0x45')](handleError(_0x4ad39f,null));};exports[_0x501c('0x29')]=function(_0x49cff3,_0xc58843){if(_0x49cff3['body']['id']){delete _0x49cff3['body']['id'];}return db[_0x501c('0x30')][_0x501c('0x4a')]({'where':{'id':_0x49cff3[_0x501c('0x47')]['id']}})['then'](handleEntityNotFound(_0xc58843,null))[_0x501c('0x2b')](saveUpdates(_0x49cff3[_0x501c('0x4c')],null))['then'](respondWithResult(_0xc58843,null))[_0x501c('0x45')](handleError(_0xc58843,null));};exports[_0x501c('0x2a')]=function(_0xf8e4d2,_0x2564ea){return db[_0x501c('0x30')]['find']({'where':{'id':_0xf8e4d2[_0x501c('0x47')]['id']}})[_0x501c('0x2b')](handleEntityNotFound(_0x2564ea,null))[_0x501c('0x2b')](removeEntity(_0x2564ea,null))[_0x501c('0x45')](handleError(_0x2564ea,null));};exports[_0x501c('0x4d')]=function(_0x160a9e,_0x32f21f){return db[_0x501c('0x30')]['describe']()['then'](respondWithResult(_0x32f21f,null))[_0x501c('0x45')](handleError(_0x32f21f,null));};exports[_0x501c('0x4e')]=function(_0x34b476,_0x5578ca,_0x3c972f){return db[_0x501c('0x4f')][_0x501c('0x23')]({'where':{'ChatGroupId':_0x34b476[_0x501c('0x47')]['id'],'ToId':_0x34b476[_0x501c('0x50')]['id'],'read':![]}})['then'](function(_0x5ad953){return{'id':_[_0x501c('0x51')](_0x34b476['params']['id']),'count':_0x5ad953};})['then'](respondWithResult(_0x5578ca,null))['catch'](handleError(_0x5578ca,null));};exports[_0x501c('0x52')]=function(_0x121622,_0x3262e6,_0x40b7d3){return db[_0x501c('0x30')][_0x501c('0x4a')]({'where':{'id':_0x121622[_0x501c('0x47')]['id']}})[_0x501c('0x2b')](handleEntityNotFound(_0x3262e6,null))[_0x501c('0x2b')](function(_0x469598){if(_0x469598){return _0x469598['addMembers'](_0x121622['body'][_0x501c('0x53')],_[_0x501c('0x54')](_0x121622[_0x501c('0x4c')],[_0x501c('0x53'),'id'])||{});}})[_0x501c('0x2b')](respondWithResult(_0x3262e6,null))[_0x501c('0x45')](handleError(_0x3262e6,null));};exports['getMembers']=function(_0x4824b8,_0x10b260,_0x5cb4df){var _0x3de079={};var _0x37a04e={};var _0xc8bb36;var _0x5023bc;return db['ChatGroup'][_0x501c('0x55')]({'where':{'id':_0x4824b8[_0x501c('0x47')]['id']}})[_0x501c('0x2b')](handleEntityNotFound(_0x10b260,null))[_0x501c('0x2b')](function(_0x3c5bb0){if(_0x3c5bb0){_0xc8bb36=_0x3c5bb0;_0x37a04e['model']=_[_0x501c('0x48')](db[_0x501c('0x56')][_0x501c('0x31')]);_0x37a04e[_0x501c('0x36')]=_['keys'](_0x4824b8[_0x501c('0x36')]);_0x37a04e['filters']=_[_0x501c('0x37')](_0x37a04e[_0x501c('0x35')],_0x37a04e['query']);_0x3de079[_0x501c('0x39')]=_[_0x501c('0x37')](_0x37a04e[_0x501c('0x35')],qs[_0x501c('0x38')](_0x4824b8[_0x501c('0x36')][_0x501c('0x38')]));_0x3de079[_0x501c('0x39')]=_0x3de079['attributes'][_0x501c('0x3a')]?_0x3de079[_0x501c('0x39')]:_0x37a04e[_0x501c('0x35')];_0x3de079[_0x501c('0x3d')]=qs[_0x501c('0x3e')](_0x4824b8[_0x501c('0x36')][_0x501c('0x3e')]);_0x3de079[_0x501c('0x3f')]=qs[_0x501c('0x41')](_[_0x501c('0x40')](_0x4824b8[_0x501c('0x36')],_0x37a04e[_0x501c('0x41')]));if(_0x4824b8[_0x501c('0x36')][_0x501c('0x42')]){_0x3de079['where']=_['merge'](_0x3de079['where'],{'$or':_['map'](_0x3de079[_0x501c('0x39')],function(_0x531be3){var _0x487b2b={};_0x487b2b[_0x531be3]={'$like':'%'+_0x4824b8[_0x501c('0x36')][_0x501c('0x42')]+'%'};return _0x487b2b;})});}_0x3de079=_[_0x501c('0x43')]({},_0x3de079,_0x4824b8[_0x501c('0x44')]);return _0xc8bb36[_0x501c('0x57')](_0x3de079);}})[_0x501c('0x2b')](function(_0x581120){if(_0x581120){_0x5023bc=_0x581120[_0x501c('0x3a')];if(!_0x4824b8[_0x501c('0x36')][_0x501c('0x3b')](_0x501c('0x3c'))){_0x3de079[_0x501c('0x22')]=qs[_0x501c('0x22')](_0x4824b8[_0x501c('0x36')][_0x501c('0x22')]);_0x3de079[_0x501c('0x20')]=qs['offset'](_0x4824b8[_0x501c('0x36')][_0x501c('0x20')]);}return _0xc8bb36['getMembers'](_0x3de079);}})['then'](function(_0x38c486){if(_0x38c486){return _0x38c486?{'count':_0x5023bc,'rows':_0x38c486}:null;}})[_0x501c('0x2b')](respondWithResult(_0x10b260,null))['catch'](handleError(_0x10b260,null));};exports['removeMembers']=function(_0x44174d,_0x398f58,_0x1724a7){return db[_0x501c('0x30')][_0x501c('0x4a')]({'where':{'id':_0x44174d[_0x501c('0x47')]['id']}})[_0x501c('0x2b')](handleEntityNotFound(_0x398f58,null))[_0x501c('0x2b')](function(_0x5b2805){if(_0x5b2805){return _0x5b2805[_0x501c('0x58')](_0x44174d['query'][_0x501c('0x53')]);}})[_0x501c('0x2b')](respondWithStatusCode(_0x398f58,null))['catch'](handleError(_0x398f58,null));};exports[_0x501c('0x59')]=function(_0x1647b6,_0x71243f,_0x194afd){if(_0x1647b6['body']['id']){delete _0x1647b6['body']['id'];}return db['ChatGroup'][_0x501c('0x4a')]({'where':{'id':_0x1647b6[_0x501c('0x47')]['id']}})[_0x501c('0x2b')](handleEntityNotFound(_0x71243f,null))['then'](function(_0x2e6eba){if(_0x2e6eba){_0x1647b6['body'][_0x501c('0x5a')]=_0x2e6eba['id'];return db[_0x501c('0x4f')][_0x501c('0x4b')](_0x1647b6['body']);}})[_0x501c('0x2b')](respondWithResult(_0x71243f,null))[_0x501c('0x45')](handleError(_0x71243f,null));};exports[_0x501c('0x5b')]=function(_0x1f1082,_0x6a04b8,_0x247035){var _0x5ec245={};var _0xfc367b={};var _0x33a41d;var _0x1064e0;return db[_0x501c('0x30')][_0x501c('0x55')]({'where':{'id':_0x1f1082[_0x501c('0x47')]['id']}})[_0x501c('0x2b')](handleEntityNotFound(_0x6a04b8,null))[_0x501c('0x2b')](function(_0x36f427){if(_0x36f427){_0x33a41d=_0x36f427;_0xfc367b[_0x501c('0x35')]=_[_0x501c('0x48')](db[_0x501c('0x4f')]['rawAttributes']);_0xfc367b['query']=_['keys'](_0x1f1082['query']);_0xfc367b['filters']=_[_0x501c('0x37')](_0xfc367b['model'],_0xfc367b['query']);_0x5ec245[_0x501c('0x39')]=_[_0x501c('0x37')](_0xfc367b[_0x501c('0x35')],qs[_0x501c('0x38')](_0x1f1082['query']['fields']));_0x5ec245['attributes']=_0x5ec245[_0x501c('0x39')][_0x501c('0x3a')]?_0x5ec245[_0x501c('0x39')]:_0xfc367b['model'];_0x5ec245[_0x501c('0x3d')]=qs[_0x501c('0x3e')](_0x1f1082['query'][_0x501c('0x3e')]);_0x5ec245['where']=qs[_0x501c('0x41')](_[_0x501c('0x40')](_0x1f1082[_0x501c('0x36')],_0xfc367b['filters']));if(_0x1f1082[_0x501c('0x36')][_0x501c('0x42')]){_0x5ec245[_0x501c('0x3f')]=_[_0x501c('0x43')](_0x5ec245[_0x501c('0x3f')],{'$or':_[_0x501c('0x2f')](_0x5ec245['attributes'],function(_0x36c9c6){var _0x3f178a={};_0x3f178a[_0x36c9c6]={'$like':'%'+_0x1f1082['query'][_0x501c('0x42')]+'%'};return _0x3f178a;})});}if(_0x1f1082[_0x501c('0x36')]['$gte']){var _0x14f5fc=_0x1f1082[_0x501c('0x36')][_0x501c('0x5c')][_0x501c('0x5d')](',');var _0x21e151={};_0x21e151[_0x14f5fc[0x0]]={'$gte':moment(_0x14f5fc[0x1])['format'](_0x501c('0x5e'))};_0x5ec245[_0x501c('0x3f')]=_[_0x501c('0x43')](_0x5ec245[_0x501c('0x3f')],_0x21e151);}_0x5ec245=_[_0x501c('0x43')]({},_0x5ec245,_0x1f1082[_0x501c('0x44')]);return _0x33a41d[_0x501c('0x5b')](_0x5ec245);}})[_0x501c('0x2b')](function(_0x277ddc){if(_0x277ddc){_0x1064e0=_0x277ddc[_0x501c('0x3a')];if(!_0x1f1082[_0x501c('0x36')][_0x501c('0x3b')](_0x501c('0x3c'))){_0x5ec245[_0x501c('0x22')]=qs['limit'](_0x1f1082[_0x501c('0x36')][_0x501c('0x22')]);_0x5ec245['offset']=qs[_0x501c('0x20')](_0x1f1082[_0x501c('0x36')][_0x501c('0x20')]);}return _0x33a41d['getMessages'](_0x5ec245);}})[_0x501c('0x2b')](function(_0x4d85ae){if(_0x4d85ae){return _0x4d85ae?{'count':_0x1064e0,'rows':_0x4d85ae}:null;}})['then'](respondWithResult(_0x6a04b8,null))['catch'](handleError(_0x6a04b8,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 2df342d..ecfdd3d 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 _0x7b5f=['hook','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove'];(function(_0xe9bf31,_0x4481ac){var _0x41c53a=function(_0x4380ae){while(--_0x4380ae){_0xe9bf31['push'](_0xe9bf31['shift']());}};_0x41c53a(++_0x4481ac);}(_0x7b5f,0x1ac));var _0xf7b5=function(_0x32cf1e,_0x4aa713){_0x32cf1e=_0x32cf1e-0x0;var _0x1899b9=_0x7b5f[_0x32cf1e];return _0x1899b9;};'use strict';var EventEmitter=require(_0xf7b5('0x0'));var ChatGroup=require(_0xf7b5('0x1'))['db'][_0xf7b5('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf7b5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf7b5('0x4'),'afterDestroy':_0xf7b5('0x5')};function emitEvent(_0x3a3b77){return function(_0x74d691,_0x3160b6,_0x81f8dd){ChatGroupEvents['emit'](_0x3a3b77+':'+_0x74d691['id'],_0x74d691);ChatGroupEvents['emit'](_0x3a3b77,_0x74d691);_0x81f8dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xf7b5('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x5df5=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3b2af0,_0x5388dd){var _0x2ef716=function(_0x2aa0bb){while(--_0x2aa0bb){_0x3b2af0['push'](_0x3b2af0['shift']());}};_0x2ef716(++_0x5388dd);}(_0x5df5,0x70));var _0x55df=function(_0x45056b,_0x16778){_0x45056b=_0x45056b-0x0;var _0x3d32a8=_0x5df5[_0x45056b];return _0x3d32a8;};'use strict';var EventEmitter=require(_0x55df('0x0'));var ChatGroup=require(_0x55df('0x1'))['db'][_0x55df('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x55df('0x3')](0x0);var events={'afterCreate':_0x55df('0x4'),'afterUpdate':_0x55df('0x5'),'afterDestroy':_0x55df('0x6')};function emitEvent(_0x2cd710){return function(_0x46c8eb,_0xd368b0,_0x21464e){ChatGroupEvents[_0x55df('0x7')](_0x2cd710+':'+_0x46c8eb['id'],_0x46c8eb);ChatGroupEvents[_0x55df('0x7')](_0x2cd710,_0x46c8eb);_0x21464e(null);};}for(var e in events){if(events[_0x55df('0x8')](e)){var event=events[e];ChatGroup[_0x55df('0x9')](e,emitEvent(event));}}module[_0x55df('0xa')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index cb6ab4f..ee8aa2b 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 _0xc2e8=['ChatGroup','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','define'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0xc2e8,0xd2));var _0x8c2e=function(_0xdd5f,_0x13b310){_0xdd5f=_0xdd5f-0x0;var _0x34e257=_0xc2e8[_0xdd5f];return _0x34e257;};'use strict';var _=require(_0x8c2e('0x0'));var util=require(_0x8c2e('0x1'));var logger=require(_0x8c2e('0x2'))('api');var moment=require(_0x8c2e('0x3'));var BPromise=require(_0x8c2e('0x4'));var rp=require(_0x8c2e('0x5'));var fs=require('fs');var path=require(_0x8c2e('0x6'));var rimraf=require(_0x8c2e('0x7'));var config=require('../../config/environment');var attributes=require(_0x8c2e('0x8'));module['exports']=function(_0x20e89c,_0x21653c){return _0x20e89c[_0x8c2e('0x9')](_0x8c2e('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1411=['exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x35ca9c,_0x44b0c7){var _0x4dd5bd=function(_0x31b1d6){while(--_0x31b1d6){_0x35ca9c['push'](_0x35ca9c['shift']());}};_0x4dd5bd(++_0x44b0c7);}(_0x1411,0x1cc));var _0x1141=function(_0x24b477,_0x30393b){_0x24b477=_0x24b477-0x0;var _0x4041a6=_0x1411[_0x24b477];return _0x4041a6;};'use strict';var _=require(_0x1141('0x0'));var util=require(_0x1141('0x1'));var logger=require(_0x1141('0x2'))('api');var moment=require(_0x1141('0x3'));var BPromise=require(_0x1141('0x4'));var rp=require(_0x1141('0x5'));var fs=require('fs');var path=require(_0x1141('0x6'));var rimraf=require('rimraf');var config=require(_0x1141('0x7'));var attributes=require('./chatGroup.attributes');module[_0x1141('0x8')]=function(_0x221450,_0xd804cf){return _0x221450[_0x1141('0x9')](_0x1141('0xa'),attributes,{'tableName':_0x1141('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 90f9954..cfac0ad 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 _0x45c9=['rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1075b8,_0xd606e2){var _0x5d047f=function(_0x5e6652){while(--_0x5e6652){_0x1075b8['push'](_0x1075b8['shift']());}};_0x5d047f(++_0xd606e2);}(_0x45c9,0x96));var _0x945c=function(_0x4dcfc3,_0x65e123){_0x4dcfc3=_0x4dcfc3-0x0;var _0x400cd8=_0x45c9[_0x4dcfc3];return _0x400cd8;};'use strict';var _=require('lodash');var util=require(_0x945c('0x0'));var moment=require('moment');var BPromise=require(_0x945c('0x1'));var rs=require(_0x945c('0x2'));var fs=require('fs');var Redis=require(_0x945c('0x3'));var db=require(_0x945c('0x4'))['db'];var utils=require(_0x945c('0x5'));var logger=require('../../config/logger')(_0x945c('0x6'));var config=require('../../config/environment');var jayson=require(_0x945c('0x7'));var client=jayson[_0x945c('0x8')][_0x945c('0x9')]({'port':0x232a});config[_0x945c('0xa')]=_[_0x945c('0xb')](config[_0x945c('0xa')],{'host':_0x945c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x945c('0xa')]));require('./chatGroup.socket')[_0x945c('0xd')](socket);function respondWithRpcPromise(_0x569568,_0x3e46e1,_0x4e0f64){return new BPromise(function(_0x2a8d86,_0x11c8ce){return client[_0x945c('0xe')](_0x569568,_0x4e0f64)[_0x945c('0xf')](function(_0x1a6954){logger[_0x945c('0x10')](_0x945c('0x11'),_0x3e46e1,_0x945c('0x12'));logger[_0x945c('0x13')](_0x945c('0x14'),_0x3e46e1,_0x945c('0x12'),JSON[_0x945c('0x15')](_0x1a6954));if(_0x1a6954[_0x945c('0x16')]){if(_0x1a6954[_0x945c('0x16')]['code']===0x1f4){logger[_0x945c('0x16')](_0x945c('0x11'),_0x3e46e1,_0x1a6954[_0x945c('0x16')][_0x945c('0x17')]);return _0x11c8ce(_0x1a6954[_0x945c('0x16')][_0x945c('0x17')]);}logger[_0x945c('0x16')]('ChatGroup,\x20%s,\x20%s',_0x3e46e1,_0x1a6954[_0x945c('0x16')][_0x945c('0x17')]);return _0x2a8d86(_0x1a6954[_0x945c('0x16')]['message']);}else{logger[_0x945c('0x10')](_0x945c('0x11'),_0x3e46e1,_0x945c('0x12'));_0x2a8d86(_0x1a6954[_0x945c('0x18')][_0x945c('0x17')]);}})[_0x945c('0x19')](function(_0x59f759){logger[_0x945c('0x16')](_0x945c('0x11'),_0x3e46e1,_0x59f759);_0x11c8ce(_0x59f759);});});} \ No newline at end of file +var _0x18d6=['debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent'];(function(_0x4faf89,_0x1b3eb4){var _0x50e0fd=function(_0x54509d){while(--_0x54509d){_0x4faf89['push'](_0x4faf89['shift']());}};_0x50e0fd(++_0x1b3eb4);}(_0x18d6,0x166));var _0x618d=function(_0x56ac6c,_0x472c9b){_0x56ac6c=_0x56ac6c-0x0;var _0x4fb5ec=_0x18d6[_0x56ac6c];return _0x4fb5ec;};'use strict';var _=require(_0x618d('0x0'));var util=require(_0x618d('0x1'));var moment=require('moment');var BPromise=require(_0x618d('0x2'));var rs=require(_0x618d('0x3'));var fs=require('fs');var Redis=require(_0x618d('0x4'));var db=require(_0x618d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x618d('0x6'))(_0x618d('0x7'));var config=require('../../config/environment');var jayson=require(_0x618d('0x8'));var client=jayson['client'][_0x618d('0x9')]({'port':0x232a});config[_0x618d('0xa')]=_['defaults'](config[_0x618d('0xa')],{'host':_0x618d('0xb'),'port':0x18eb});var socket=require(_0x618d('0xc'))(new Redis(config[_0x618d('0xa')]));require(_0x618d('0xd'))[_0x618d('0xe')](socket);function respondWithRpcPromise(_0x449195,_0x48bd76,_0x24b06b){return new BPromise(function(_0x1adabe,_0x4b4b47){return client[_0x618d('0xf')](_0x449195,_0x24b06b)[_0x618d('0x10')](function(_0x27e61a){logger[_0x618d('0x11')](_0x618d('0x12'),_0x48bd76,_0x618d('0x13'));logger[_0x618d('0x14')](_0x618d('0x15'),_0x48bd76,_0x618d('0x13'),JSON[_0x618d('0x16')](_0x27e61a));if(_0x27e61a['error']){if(_0x27e61a['error'][_0x618d('0x17')]===0x1f4){logger[_0x618d('0x18')](_0x618d('0x12'),_0x48bd76,_0x27e61a[_0x618d('0x18')][_0x618d('0x19')]);return _0x4b4b47(_0x27e61a[_0x618d('0x18')][_0x618d('0x19')]);}logger[_0x618d('0x18')](_0x618d('0x12'),_0x48bd76,_0x27e61a[_0x618d('0x18')][_0x618d('0x19')]);return _0x1adabe(_0x27e61a[_0x618d('0x18')][_0x618d('0x19')]);}else{logger['info'](_0x618d('0x12'),_0x48bd76,_0x618d('0x13'));_0x1adabe(_0x27e61a[_0x618d('0x1a')][_0x618d('0x19')]);}})['catch'](function(_0x28efb4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x48bd76,_0x28efb4);_0x4b4b47(_0x28efb4);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 84d5864..99f12fd 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 _0xfd58=['save','remove','update','emit','removeListener','register','length','chatGroup:'];(function(_0x1559a0,_0x9b8fd7){var _0x37e36f=function(_0x1bf6ad){while(--_0x1bf6ad){_0x1559a0['push'](_0x1559a0['shift']());}};_0x37e36f(++_0x9b8fd7);}(_0xfd58,0x170));var _0x8fd5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfd58[_0x321bb2];return _0x9c12ed;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x8fd5('0x0'),_0x8fd5('0x1'),_0x8fd5('0x2')];function createListener(_0x22cfa5,_0x5b99ff){return function(_0x5d3086){_0x5b99ff[_0x8fd5('0x3')](_0x22cfa5,_0x5d3086);};}function removeListener(_0x25baec,_0x1822b3){return function(){ChatGroupEvents[_0x8fd5('0x4')](_0x25baec,_0x1822b3);};}exports[_0x8fd5('0x5')]=function(_0x39053d){for(var _0xd17657=0x0,_0x2ab8d9=events[_0x8fd5('0x6')];_0xd17657<_0x2ab8d9;_0xd17657++){var _0x53ebf7=events[_0xd17657];var _0x33c0be=createListener(_0x8fd5('0x7')+_0x53ebf7,_0x39053d);ChatGroupEvents['on'](_0x53ebf7,_0x33c0be);}}; \ No newline at end of file +var _0x868a=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x7c74f3,_0xa3191c){var _0x34c1da=function(_0x40beda){while(--_0x40beda){_0x7c74f3['push'](_0x7c74f3['shift']());}};_0x34c1da(++_0xa3191c);}(_0x868a,0x1ec));var _0xa868=function(_0x2d111d,_0x43236c){_0x2d111d=_0x2d111d-0x0;var _0x4fe821=_0x868a[_0x2d111d];return _0x4fe821;};'use strict';var ChatGroupEvents=require(_0xa868('0x0'));var events=[_0xa868('0x1'),_0xa868('0x2'),_0xa868('0x3')];function createListener(_0x49c3ef,_0x3bea46){return function(_0x27ecef){_0x3bea46['emit'](_0x49c3ef,_0x27ecef);};}function removeListener(_0x1625fe,_0x273ea1){return function(){ChatGroupEvents[_0xa868('0x4')](_0x1625fe,_0x273ea1);};}exports[_0xa868('0x5')]=function(_0x3f691b){for(var _0x1c2caa=0x0,_0x4e2a16=events[_0xa868('0x6')];_0x1c2caa<_0x4e2a16;_0x1c2caa++){var _0x2c3e57=events[_0x1c2caa];var _0x571f27=createListener(_0xa868('0x7')+_0x2c3e57,_0x3f691b);ChatGroupEvents['on'](_0x2c3e57,_0x571f27);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 0ca9216..13971de 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 _0x02b1=['delete','destroy','removeMembers','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','create','post','/:id/members','addMembers','addMessage','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x02b1,0x112));var _0x102b=function(_0x459bf3,_0x5a5a7a){_0x459bf3=_0x459bf3-0x0;var _0x19bb7e=_0x02b1[_0x459bf3];return _0x19bb7e;};'use strict';var multer=require(_0x102b('0x0'));var util=require(_0x102b('0x1'));var path=require(_0x102b('0x2'));var timeout=require('connect-timeout');var express=require(_0x102b('0x3'));var router=express[_0x102b('0x4')]();var fs_extra=require(_0x102b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x102b('0x6'));var config=require('../../config/environment');var controller=require(_0x102b('0x7'));router['get']('/',auth[_0x102b('0x8')](),controller[_0x102b('0x9')]);router[_0x102b('0xa')](_0x102b('0xb'),auth[_0x102b('0x8')](),controller[_0x102b('0xc')]);router[_0x102b('0xa')](_0x102b('0xd'),auth[_0x102b('0x8')](),controller[_0x102b('0xe')]);router['get'](_0x102b('0xf'),auth[_0x102b('0x8')](),controller[_0x102b('0x10')]);router['get']('/:id/members',auth[_0x102b('0x8')](),controller[_0x102b('0x11')]);router[_0x102b('0xa')](_0x102b('0x12'),auth[_0x102b('0x8')](),controller[_0x102b('0x13')]);router['post']('/',auth[_0x102b('0x8')](),controller[_0x102b('0x14')]);router[_0x102b('0x15')](_0x102b('0x16'),auth[_0x102b('0x8')](),controller[_0x102b('0x17')]);router[_0x102b('0x15')](_0x102b('0x12'),auth[_0x102b('0x8')](),controller[_0x102b('0x18')]);router['put'](_0x102b('0xd'),auth[_0x102b('0x8')](),controller[_0x102b('0x19')]);router[_0x102b('0x1a')]('/:id',auth[_0x102b('0x8')](),controller[_0x102b('0x1b')]);router[_0x102b('0x1a')](_0x102b('0x16'),auth[_0x102b('0x8')](),controller[_0x102b('0x1c')]);module[_0x102b('0x1d')]=router; \ No newline at end of file +var _0xd426=['create','post','addMembers','/:id/messages','addMessage','put','update','destroy','delete','removeMembers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','describe','/:id','show','/:id/unread','/:id/members','getMembers','getMessages'];(function(_0xd4ac62,_0x396930){var _0x5f38d3=function(_0x136f81){while(--_0x136f81){_0xd4ac62['push'](_0xd4ac62['shift']());}};_0x5f38d3(++_0x396930);}(_0xd426,0xa1));var _0x6d42=function(_0x908eb6,_0x59199b){_0x908eb6=_0x908eb6-0x0;var _0x511a09=_0xd426[_0x908eb6];return _0x511a09;};'use strict';var multer=require(_0x6d42('0x0'));var util=require('util');var path=require(_0x6d42('0x1'));var timeout=require(_0x6d42('0x2'));var express=require(_0x6d42('0x3'));var router=express[_0x6d42('0x4')]();var fs_extra=require(_0x6d42('0x5'));var auth=require(_0x6d42('0x6'));var interaction=require(_0x6d42('0x7'));var config=require(_0x6d42('0x8'));var controller=require(_0x6d42('0x9'));router[_0x6d42('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x6d42('0xb')](),controller[_0x6d42('0xc')]);router[_0x6d42('0xa')](_0x6d42('0xd'),auth[_0x6d42('0xb')](),controller[_0x6d42('0xe')]);router[_0x6d42('0xa')](_0x6d42('0xf'),auth[_0x6d42('0xb')](),controller['getUnread']);router['get'](_0x6d42('0x10'),auth[_0x6d42('0xb')](),controller[_0x6d42('0x11')]);router[_0x6d42('0xa')]('/:id/messages',auth[_0x6d42('0xb')](),controller[_0x6d42('0x12')]);router['post']('/',auth[_0x6d42('0xb')](),controller[_0x6d42('0x13')]);router[_0x6d42('0x14')](_0x6d42('0x10'),auth[_0x6d42('0xb')](),controller[_0x6d42('0x15')]);router[_0x6d42('0x14')](_0x6d42('0x16'),auth[_0x6d42('0xb')](),controller[_0x6d42('0x17')]);router[_0x6d42('0x18')](_0x6d42('0xd'),auth[_0x6d42('0xb')](),controller[_0x6d42('0x19')]);router['delete'](_0x6d42('0xd'),auth[_0x6d42('0xb')](),controller[_0x6d42('0x1a')]);router[_0x6d42('0x1b')]('/:id/members',auth[_0x6d42('0xb')](),controller[_0x6d42('0x1c')]);module[_0x6d42('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index c6dc385..14b2202 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 _0x7633=['DATE','sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','STRING','long'];(function(_0x516cd9,_0x3e3e4a){var _0x12e271=function(_0x55d680){while(--_0x55d680){_0x516cd9['push'](_0x516cd9['shift']());}};_0x12e271(++_0x3e3e4a);}(_0x7633,0x1c4));var _0x3763=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7633[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x3763('0x0'));module[_0x3763('0x1')]={'closed':{'type':Sequelize[_0x3763('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3763('0x3')]},'ratingType':{'type':Sequelize[_0x3763('0x4')]('star',_0x3763('0x5')),'defaultValue':_0x3763('0x6')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x3763('0x7')]},'mailTranscript':{'type':Sequelize[_0x3763('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3763('0x8')]},'thirdDisposition':{'type':Sequelize[_0x3763('0x8')]},'note':{'type':Sequelize[_0x3763('0x8')]},'browserName':{'type':Sequelize[_0x3763('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x3763('0x8')]},'deviceModel':{'type':Sequelize[_0x3763('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x3763('0x8')]},'referer':{'type':Sequelize[_0x3763('0x7')]},'customerIp':{'type':Sequelize[_0x3763('0x8')]},'formData':{'type':Sequelize[_0x3763('0x7')](_0x3763('0x9'))},'read1stAt':{'type':Sequelize[_0x3763('0xa')]},'lastMsgAt':{'type':Sequelize[_0x3763('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x3763('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3763('0x8')]},'customerPort':{'type':Sequelize[_0x3763('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x3763('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x23a3=['DATE','long','ENUM','out','BOOLEAN','INTEGER','star','thumb','TEXT','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x23a3,0x131));var _0x323a=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0x23a3[_0x946518];return _0x909b69;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x323a('0x0')]},'ratingType':{'type':Sequelize['ENUM'](_0x323a('0x1'),_0x323a('0x2')),'defaultValue':_0x323a('0x1')},'ratingMessage':{'type':Sequelize[_0x323a('0x3')]},'pathTranscript':{'type':Sequelize[_0x323a('0x3')]},'mailTranscript':{'type':Sequelize[_0x323a('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x323a('0x5')]},'disposition':{'type':Sequelize[_0x323a('0x4')]},'secondDisposition':{'type':Sequelize[_0x323a('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x323a('0x4')]},'browserName':{'type':Sequelize[_0x323a('0x4')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x323a('0x4')]},'osVersion':{'type':Sequelize[_0x323a('0x4')]},'deviceModel':{'type':Sequelize[_0x323a('0x4')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x323a('0x4')]},'referer':{'type':Sequelize[_0x323a('0x3')]},'customerIp':{'type':Sequelize[_0x323a('0x4')]},'formData':{'type':Sequelize[_0x323a('0x3')](_0x323a('0x6'))},'read1stAt':{'type':Sequelize[_0x323a('0x5')]},'lastMsgAt':{'type':Sequelize[_0x323a('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x323a('0x7')]('in',_0x323a('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x323a('0x4')]},'customerPort':{'type':Sequelize[_0x323a('0x4')]},'vidaooSessionId':{'type':Sequelize[_0x323a('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x323a('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 4016d34..5f478d2 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 _0x5c12=['Interaction\x20already\x20assigned','disposition','AbandonInteraction','basename','file','filename','mimetype','Attachment','attachmentDownload','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','ChatMessage','User','Messages','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','alias','agent_fullname','direction','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','setTags','spread','Tag','emit','removeTags','server','files','tmp','transcript-%d-%s.zip','Contact','firstName','attachments','Owner','Account','browserName','referer','customerPort','N.A.','existsSync','createReadStream','pipe','createWriteStream','lastName','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','unlinkSync','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','send','merge','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','answered','unmanaged','total','UserId','waiting','closed','abandoned','talking','index','ChatInteraction','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','field','color','from','select','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','`\x20=\x200','having','`\x20>\x200','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','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','start','buildExpression','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','toString','keyBy','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','groupBy','ChatInteractionId','push','all','rows','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found'];(function(_0x26790e,_0x4c09e8){var _0x17b987=function(_0x27db37){while(--_0x27db37){_0x26790e['push'](_0x26790e['shift']());}};_0x17b987(++_0x4c09e8);}(_0x5c12,0x188));var _0x25c1=function(_0x460666,_0x24bfa0){_0x460666=_0x460666-0x0;var _0x555cbf=_0x5c12[_0x460666];return _0x555cbf;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x25c1('0x0'));var rp=require(_0x25c1('0x1'));var moment=require('moment');var BPromise=require(_0x25c1('0x2'));var Mustache=require(_0x25c1('0x3'));var util=require(_0x25c1('0x4'));var path=require(_0x25c1('0x5'));var ejs=require(_0x25c1('0x6'));var fs=require('fs');var _=require(_0x25c1('0x7'));var squel=require(_0x25c1('0x8'));var Redis=require('ioredis');var qs=require(_0x25c1('0x9'));var as=require(_0x25c1('0xa'));var pdf=require(_0x25c1('0xb'));var logger=require('../../config/logger')('api');var config=require(_0x25c1('0xc'));var db=require(_0x25c1('0xd'))['db'];config[_0x25c1('0xe')]=_[_0x25c1('0xf')](config[_0x25c1('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x25c1('0x10'))(new Redis(config[_0x25c1('0xe')]));require(_0x25c1('0x11'))[_0x25c1('0x12')](socket);var jayson=require(_0x25c1('0x13'));var client=jayson['client'][_0x25c1('0x14')]({'port':0x232b});var client9004=jayson[_0x25c1('0x15')]['http']({'port':0x232c});function respondWithRpcPromise(_0x256ecd,_0x209af5,_0x323d3c,_0x329ba9){return new BPromise(function(_0x5d3d11,_0x569ef9){var _0x4ef5d7=_0x329ba9||client;return _0x4ef5d7['request'](_0x256ecd,_0x323d3c)[_0x25c1('0x16')](function(_0x1412ed){logger[_0x25c1('0x17')](_0x25c1('0x18'),_0x209af5,_0x25c1('0x19'));logger['debug'](_0x25c1('0x1a'),_0x209af5,'request\x20sent',JSON['stringify'](_0x1412ed));if(_0x1412ed['error']){if(_0x1412ed[_0x25c1('0x1b')][_0x25c1('0x1c')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x209af5,_0x1412ed[_0x25c1('0x1b')]['message']);return _0x569ef9(_0x1412ed[_0x25c1('0x1b')][_0x25c1('0x1d')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x209af5,_0x1412ed['error'][_0x25c1('0x1d')]);return _0x5d3d11(_0x1412ed[_0x25c1('0x1b')][_0x25c1('0x1d')]);}else{logger[_0x25c1('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x209af5,_0x25c1('0x19'));_0x5d3d11(_0x1412ed[_0x25c1('0x1e')][_0x25c1('0x1d')]);}})[_0x25c1('0x1f')](function(_0x517a46){logger['error'](_0x25c1('0x18'),_0x209af5,_0x517a46);_0x569ef9(_0x517a46);});});}function respondWithStatusCode(_0xac3335,_0x396ed5){_0x396ed5=_0x396ed5||0xcc;return function(_0x1c61e7){if(_0x1c61e7){return _0xac3335[_0x25c1('0x20')](_0x396ed5);}return _0xac3335[_0x25c1('0x21')](_0x396ed5)[_0x25c1('0x22')]();};}function respondWithResult(_0x324ea9,_0x14ffd9){_0x14ffd9=_0x14ffd9||0xc8;return function(_0x261604){if(_0x261604){return _0x324ea9[_0x25c1('0x21')](_0x14ffd9)[_0x25c1('0x23')](_0x261604);}};}function respondWithFilteredResult(_0x399d72,_0x4915cc){return function(_0x2dadae){if(_0x2dadae){var _0x20dbb9=typeof _0x4915cc[_0x25c1('0x24')]===_0x25c1('0x25')&&typeof _0x4915cc[_0x25c1('0x26')]===_0x25c1('0x25');var _0x5ad776=_0x2dadae[_0x25c1('0x27')];var _0x428ce8=_0x20dbb9?0x0:_0x4915cc[_0x25c1('0x24')];var _0x38c1d5=_0x20dbb9?_0x2dadae[_0x25c1('0x27')]:_0x4915cc[_0x25c1('0x24')]+_0x4915cc['limit'];var _0x1e498;if(_0x38c1d5>=_0x5ad776){_0x38c1d5=_0x5ad776;_0x1e498=0xc8;}else{_0x1e498=0xce;}_0x399d72['status'](_0x1e498);return _0x399d72[_0x25c1('0x28')](_0x25c1('0x29'),_0x428ce8+'-'+_0x38c1d5+'/'+_0x5ad776)[_0x25c1('0x23')](_0x2dadae);}return null;};}function saveUpdates(_0x41bc82){return function(_0x2e80b5){if(_0x2e80b5){return _0x2e80b5[_0x25c1('0x2a')](_0x41bc82)[_0x25c1('0x16')](function(_0x23f2f6){return _0x23f2f6;});}return null;};}function removeEntity(_0x402f32){return function(_0x4d9882){if(_0x4d9882){return _0x4d9882[_0x25c1('0x2b')]()['then'](function(){_0x402f32['status'](0xcc)[_0x25c1('0x22')]();});}};}function handleEntityNotFound(_0x1dc3a7){return function(_0x4ef790){if(!_0x4ef790){_0x1dc3a7[_0x25c1('0x20')](0x194);}return _0x4ef790;};}function handleError(_0x5a5a32,_0x3bfcff){_0x3bfcff=_0x3bfcff||0x1f4;return function(_0x4834b3){logger[_0x25c1('0x1b')](_0x4834b3[_0x25c1('0x2c')]);if(_0x4834b3[_0x25c1('0x2d')]){delete _0x4834b3[_0x25c1('0x2d')];}_0x5a5a32[_0x25c1('0x21')](_0x3bfcff)[_0x25c1('0x2e')](_0x4834b3);};}function getMustacheRender(_0x461d23,_0x167477){return Mustache['render'](_0x461d23,_[_0x25c1('0x2f')](_0x167477['body'],{'contact':_0x167477[_0x25c1('0x30')],'message':_0x167477['message'],'agent':_0x167477[_0x25c1('0x31')],'interaction':_0x167477[_0x25c1('0x32')],'account':_0x167477[_0x25c1('0x33')]}))||'';}function getInteractionUsers(_0x2f86de,_0x390083){return new BPromise(function(_0x92184a,_0x35e632){try{if(_0x390083[_0x2f86de['id']]){_0x2f86de[_0x25c1('0x34')]=_[_0x25c1('0x35')](_0x390083[_0x2f86de['id']],function(_0x2d060c){return{'id':_0x2d060c['id'],'fullname':_0x2d060c[_0x25c1('0x36')]};});}}catch(_0x3f02f2){_0x35e632(_0x3f02f2);}_0x92184a(_0x2f86de);});}function getInteractionTags(_0x1041a3,_0x1b6e92){return new BPromise(function(_0x266f3b,_0x14288b){try{if(_0x1041a3[_0x25c1('0x37')]){_0x1041a3[_0x25c1('0x38')]=[];_0x1041a3[_0x25c1('0x37')][_0x25c1('0x39')](',')['forEach'](function(_0x32cc49){_0x1041a3[_0x25c1('0x38')]['push'](_0x1b6e92[_0x32cc49]);});}delete _0x1041a3[_0x25c1('0x37')];}catch(_0x5eca99){_0x14288b(_0x5eca99);}_0x266f3b(_0x1041a3);});}function updateChatInteraction(_0x32b3a4,_0x4f978c,_0x4326fb){return new BPromise(function(_0x3aca68,_0x1cf0b8){return getInteractionUsers(_0x32b3a4,_0x4326fb)[_0x25c1('0x16')](function(_0xbc20a3){return getInteractionTags(_0xbc20a3,_0x4f978c);})['then'](function(_0x1fe6d7){return getStateInteraction(_0x1fe6d7);})['then'](function(_0x1d9940){_0x3aca68(_0x1d9940);})[_0x25c1('0x1f')](function(_0x6d588a){_0x1cf0b8(_0x6d588a);});});}function getStateInteraction(_0x17fc23){return new BPromise(function(_0x57c65a){_0x17fc23['waiting']=0x0;_0x17fc23['talking']=0x0;_0x17fc23[_0x25c1('0x3a')]=0x0;_0x17fc23[_0x25c1('0x3b')]=0x0;_0x17fc23['abandoned']=0x0;_0x17fc23[_0x25c1('0x3c')]=0x0;if(!_0x17fc23['closed']&&!_0x17fc23[_0x25c1('0x3d')]){_0x17fc23[_0x25c1('0x3e')]+=0x1;}if(!_0x17fc23[_0x25c1('0x3f')]&&_0x17fc23['UserId']){_0x17fc23['talking']+=0x1;if(_0x17fc23['waiting']){_0x17fc23[_0x25c1('0x3e')]-=0x1;}}if(_0x17fc23[_0x25c1('0x3f')]&&_0x17fc23['disposition']===_0x25c1('0x40')){_0x17fc23[_0x25c1('0x40')]+=0x1;if(_0x17fc23[_0x25c1('0x3e')]){_0x17fc23['waiting']-=0x1;}}else if(_0x17fc23['closed']&&!_0x17fc23['UserId']&&_0x17fc23['disposition']){_0x17fc23[_0x25c1('0x3b')]+=0x1;if(_0x17fc23[_0x25c1('0x3e')]){_0x17fc23['waiting']-=0x1;}}else if(_0x17fc23[_0x25c1('0x3f')]&&_0x17fc23[_0x25c1('0x3d')]){_0x17fc23[_0x25c1('0x3a')]+=0x1;if(_0x17fc23[_0x25c1('0x41')]){_0x17fc23[_0x25c1('0x41')]-=0x1;}}_0x17fc23[_0x25c1('0x3c')]+=0x1;_0x57c65a(_0x17fc23);});}exports[_0x25c1('0x42')]=function(_0x552174,_0x545934){var _0x28fc89={},_0x43d96a={},_0x389547={'count':0x0,'rows':[]};var _0x4bed0a=_[_0x25c1('0x35')](db[_0x25c1('0x43')][_0x25c1('0x44')],function(_0xa009d1){return{'name':_0xa009d1['fieldName'],'type':_0xa009d1[_0x25c1('0x45')][_0x25c1('0x46')]};});_0x43d96a[_0x25c1('0x47')]=_[_0x25c1('0x35')](_0x4bed0a,'name');_0x43d96a['query']=_[_0x25c1('0x48')](_0x552174[_0x25c1('0x49')]);_0x43d96a[_0x25c1('0x4a')]=_[_0x25c1('0x4b')](_0x43d96a['model'],_0x43d96a[_0x25c1('0x49')]);_0x28fc89[_0x25c1('0x4c')]=_['intersection'](_0x43d96a[_0x25c1('0x47')],qs[_0x25c1('0x4d')](_0x552174[_0x25c1('0x49')][_0x25c1('0x4d')]));_0x28fc89['attributes']=_0x28fc89['attributes'][_0x25c1('0x4e')]?_0x28fc89[_0x25c1('0x4c')]:_0x43d96a[_0x25c1('0x47')];if(!_0x552174['query'][_0x25c1('0x4f')](_0x25c1('0x50'))){_0x28fc89['limit']=qs[_0x25c1('0x26')](_0x552174[_0x25c1('0x49')][_0x25c1('0x26')]);_0x28fc89[_0x25c1('0x24')]=qs[_0x25c1('0x24')](_0x552174[_0x25c1('0x49')][_0x25c1('0x24')]);}_0x28fc89['order']=qs['sort'](_0x552174['query'][_0x25c1('0x51')]);_0x28fc89['where']=qs[_0x25c1('0x4a')](_[_0x25c1('0x52')](_0x552174[_0x25c1('0x49')],_0x43d96a[_0x25c1('0x4a')]),_0x4bed0a);var _0x40fe57=[];var _0x1b72e5=squel['select']()[_0x25c1('0x53')]('id')[_0x25c1('0x53')](_0x25c1('0x2d'))[_0x25c1('0x53')](_0x25c1('0x54'))[_0x25c1('0x55')]('tools_tags');var _0x411c5c=squel[_0x25c1('0x56')]()[_0x25c1('0x53')](_0x25c1('0x57'))[_0x25c1('0x53')]('u.fullname')[_0x25c1('0x53')](_0x25c1('0x58'))['from'](_0x25c1('0x59'),'ui')[_0x25c1('0x5a')](_0x25c1('0x5b'),'u',_0x25c1('0x5c'));var _0x30ca5d=squel[_0x25c1('0x56')]()['from'](_0x25c1('0x5d'),'i')[_0x25c1('0x5a')](_0x25c1('0x5e'),'c',_0x25c1('0x5f'))[_0x25c1('0x5a')](_0x25c1('0x5b'),'o',_0x25c1('0x60'))[_0x25c1('0x5a')](_0x25c1('0x61'),'a',_0x25c1('0x62'))[_0x25c1('0x5a')](_0x25c1('0x63'),'me',_0x25c1('0x64'))[_0x25c1('0x5a')]('chat_interaction_has_tags','it',_0x25c1('0x65'))[_0x25c1('0x5a')](_0x25c1('0x66'),'t',_0x25c1('0x67'));var _0x3d3ea2=squel[_0x25c1('0x68')]();var _0xb3cbfc=[];var _0x5c3124=squel[_0x25c1('0x68')]();var _0x571d1a;if(_0x552174[_0x25c1('0x49')][_0x25c1('0x69')]){_0x571d1a=as[_0x25c1('0x6a')](_0x552174[_0x25c1('0x49')][_0x25c1('0x69')]);var _0x23ba04=_0x571d1a[_0x25c1('0x6b')];for(var _0x19df83=0x0;_0x19df83<_0x571d1a['conditions'][_0x25c1('0x4e')];_0x19df83++){var _0xa65e9e=_0x571d1a[_0x25c1('0x6c')][_0x19df83];var _0x2a7f35='i';var _0xa41216=_[_0x25c1('0x6d')](_0x4bed0a,[_0x25c1('0x2d'),_0xa65e9e['field']]);if(!_0xa41216){switch(_0xa65e9e[_0x25c1('0x53')]){case'unreadMessages':if(_0xa65e9e['value']==0x1){_0x30ca5d['having']('`'+_0xa65e9e[_0x25c1('0x53')]+_0x25c1('0x6e'));}else{_0x30ca5d[_0x25c1('0x6f')]('`'+_0xa65e9e[_0x25c1('0x53')]+_0x25c1('0x70'));}break;case'Contact':if(_0xa65e9e[_0x25c1('0x71')]==='$substring'){if(_0xa65e9e[_0x25c1('0x72')][_0x25c1('0x39')]('\x20')[_0x25c1('0x4e')]>0x1){_0x3d3ea2[_0x23ba04](_0x25c1('0x73'),qs[_0x25c1('0x74')](_0xa65e9e[_0x25c1('0x72')]),null);}else{var _0x11bdc4='%'+_0xa65e9e['value']+'%';_0x3d3ea2[_0x23ba04](_0x25c1('0x75'),_0x11bdc4,_0x11bdc4,_0x11bdc4);}}else{_0xa41216=_[_0x25c1('0x6d')](_0x4bed0a,[_0x25c1('0x2d'),_0x25c1('0x76')]);_0xa65e9e[_0x25c1('0x53')]=_0x25c1('0x76');_0x55efcf=as['buildExpression'](_0x2a7f35,_0xa41216[_0x25c1('0x45')],_0xa65e9e);_0x3d3ea2[_0x23ba04](_0x55efcf['text'],_0x55efcf[_0x25c1('0x72')]['start'],_0x55efcf['value'][_0x25c1('0x22')]);}break;case'Tag':var _0x56929c=_0xa65e9e['value']['split'](',')[_0x25c1('0x35')](function(_0x5244f9){return Number(_0x5244f9);});_0x56929c[_0x25c1('0x77')](function(_0x17dd76){_0x5c3124['or'](_0x25c1('0x78'),'%,'+_0x17dd76+',%');});_0xb3cbfc=_[_0x25c1('0x79')](_0xb3cbfc,_0x56929c);break;case'User':if(_0xa65e9e['operator']===_0x25c1('0x7a')){_0x3d3ea2[_0x23ba04](_0x25c1('0x7b'),'%'+_0xa65e9e['value']+'%',null);}else{_0xa41216=_[_0x25c1('0x6d')](_0x4bed0a,[_0x25c1('0x2d'),_0x25c1('0x3d')]);_0xa65e9e['field']=_0x25c1('0x3d');_0x55efcf=as['buildExpression'](_0x2a7f35,_0xa41216[_0x25c1('0x45')],_0xa65e9e);_0x3d3ea2[_0x23ba04](_0x55efcf[_0x25c1('0x7c')],_0x55efcf[_0x25c1('0x72')]['start'],_0x55efcf[_0x25c1('0x72')][_0x25c1('0x22')]);}break;case _0x25c1('0x7d'):_0x55efcf=as['buildExpression']('me',null,_0xa65e9e);_0x3d3ea2[_0x23ba04](_0x55efcf[_0x25c1('0x7c')],_0x55efcf[_0x25c1('0x72')][_0x25c1('0x7e')],_0x55efcf[_0x25c1('0x72')][_0x25c1('0x22')]);break;}}else{var _0x55efcf=as[_0x25c1('0x7f')](_0x2a7f35,_0xa41216[_0x25c1('0x45')],_0xa65e9e);_0x3d3ea2[_0x23ba04](_0x55efcf[_0x25c1('0x7c')],_0x55efcf[_0x25c1('0x72')][_0x25c1('0x7e')],_0x55efcf[_0x25c1('0x72')][_0x25c1('0x22')]);}}}else{var _0x14bfa4=_(_0x552174['query'])[_0x25c1('0x48')]()[_0x25c1('0x35')](function(_0x138376){return _[_0x25c1('0x80')](_0x4bed0a,[_0x25c1('0x2d'),_0x138376])?_0x138376:undefined;})[_0x25c1('0x81')]()[_0x25c1('0x72')]();if(!_[_0x25c1('0x82')](_0x14bfa4)){_0x14bfa4[_0x25c1('0x77')](function(_0x46de21){if(_0x46de21===_0x25c1('0x83')){_0x30ca5d['where'](_0x25c1('0x84'),[]['concat'](_0x552174[_0x25c1('0x49')][_0x46de21]));}else if(_0x46de21===_0x25c1('0x85')){var _0x593e17=JSON[_0x25c1('0x86')](_0x552174[_0x25c1('0x49')][_0x46de21])[_0x25c1('0x87')];var _0x48fc08=JSON[_0x25c1('0x86')](_0x552174[_0x25c1('0x49')][_0x46de21])['$lte'];_0x30ca5d[_0x25c1('0x88')](_0x25c1('0x89'),_0x593e17,_0x48fc08);}else{if(_0x552174[_0x25c1('0x49')][_0x46de21]==='null'){_0x30ca5d[_0x25c1('0x88')]('i.'+_0x46de21+_0x25c1('0x8a'));}else{_0x30ca5d[_0x25c1('0x88')]('i.'+_0x46de21+_0x25c1('0x8b'),_0x552174['query'][_0x46de21]);}}});}if(_0x552174[_0x25c1('0x49')]['read']){if(_0x552174[_0x25c1('0x49')][_0x25c1('0x8c')]==0x1){_0x30ca5d['having'](_0x25c1('0x8d'));}else{_0x30ca5d['having'](_0x25c1('0x8e'));}}if(_0x552174[_0x25c1('0x49')][_0x25c1('0x8f')]){_0xb3cbfc=_[_0x25c1('0x90')](_0x552174[_0x25c1('0x49')][_0x25c1('0x8f')])?_0x552174[_0x25c1('0x49')]['tag']:new Array(_0x552174['query'][_0x25c1('0x8f')]);_0xb3cbfc[_0x25c1('0x77')](function(_0x5c867e){_0x5c3124['or'](_0x25c1('0x78'),'%,'+_0x5c867e+',%');});}if(_0x552174[_0x25c1('0x49')][_0x25c1('0x91')]){var _0x483bdd=_0x552174['query'][_0x25c1('0x91')]['replace']('\x5c','\x5c\x5c')[_0x25c1('0x92')](/'/g,'\x27\x27');if(qs[_0x25c1('0x93')](_0x483bdd)){_0x3d3ea2['or'](_0x25c1('0x94'),_0x483bdd+'%');}else{_0x3d3ea2['or'](_0x25c1('0x95'),qs['getFullTextValue'](_0x483bdd))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x483bdd+'%');}}}_0x30ca5d[_0x25c1('0x88')](_0x3d3ea2);_0x30ca5d['group'](_0x25c1('0x96'));var _0x77b14a={'type':db[_0x25c1('0x97')]['QueryTypes'][_0x25c1('0x98')],'raw':!![]};var _0x116743=_0x30ca5d[_0x25c1('0x99')]();_0x116743[_0x25c1('0x53')](_0x25c1('0x96'));_0x116743[_0x25c1('0x53')](_0x25c1('0x9a'),_0x25c1('0x9b'));if(_0x28fc89[_0x25c1('0x9c')]){_0x28fc89[_0x25c1('0x9c')][_0x25c1('0x77')](function(_0x512da8){var _0x2fba76=_0x512da8[0x0]==='contactName'?_0x512da8[0x0]:'i.'+_0x512da8[0x0];_0x30ca5d[_0x25c1('0x9c')](_0x2fba76,_0x512da8[0x1]===_0x25c1('0x9d')?![]:!![]);});}if(!_[_0x25c1('0x82')](_0xb3cbfc)){_0x30ca5d[_0x25c1('0x6f')](_0x5c3124);_0x116743[_0x25c1('0x88')](_0x25c1('0x9e'),_0xb3cbfc);}BPromise[_0x25c1('0x9f')]()['then'](function(){if(!_0x571d1a){if(_0x552174['query'][_0x25c1('0x83')])return;_0x116743['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x30ca5d[_0x25c1('0x88')](_0x25c1('0xa0'));return;}if(_0x552174[_0x25c1('0xa1')][_0x25c1('0xa2')]!==_0x25c1('0x31'))return;return _0x552174[_0x25c1('0xa1')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x25c1('0x16')](function(_0xfcfe5){if(_[_0x25c1('0x82')](_0xfcfe5)){_0x116743[_0x25c1('0x88')]('i.ChatWebsiteId\x20IS\x20NULL');_0x30ca5d[_0x25c1('0x88')](_0x25c1('0xa3'));}else{_0x116743[_0x25c1('0x88')](_0x25c1('0x84'),_['map'](_0xfcfe5,'id'));_0x30ca5d[_0x25c1('0x88')](_0x25c1('0x84'),_[_0x25c1('0x35')](_0xfcfe5,'id'));}});})[_0x25c1('0x16')](function(){if(_0x552174[_0x25c1('0xa1')]['role']===_0x25c1('0x31')&&!_0x571d1a&&!_0x552174['query'][_0x25c1('0x83')])return[];return db['sequelize'][_0x25c1('0x49')](_0x116743[_0x25c1('0xa4')](),_0x77b14a);})[_0x25c1('0x16')](function(_0x4bc48f){_0x389547[_0x25c1('0x27')]=_0x4bc48f['length'];if(_0x389547[_0x25c1('0x27')]===0x0)return[];return db['sequelize'][_0x25c1('0x49')](_0x1b72e5[_0x25c1('0xa4')](),_0x77b14a)[_0x25c1('0x16')](function(_0x137725){_0x40fe57=_[_0x25c1('0xa5')](_0x137725,'id');_0x77b14a=_[_0x25c1('0x2f')](_0x77b14a,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x552174[_0x25c1('0x49')][_0x25c1('0x4d')]){_0x28fc89[_0x25c1('0x4c')]['forEach'](function(_0x5d93ab){_0x30ca5d[_0x25c1('0x53')]('i.'+_0x5d93ab);});}else{_0x30ca5d[_0x25c1('0x53')](_0x25c1('0x9a'),_0x25c1('0x9b'));_0x30ca5d[_0x25c1('0x53')](_0x25c1('0xa6'),_0x25c1('0xa7'));_0x30ca5d['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0x30ca5d['field'](_0x25c1('0xa8'),_0x25c1('0xa9'));_0x30ca5d[_0x25c1('0x53')](_0x25c1('0xaa'));_0x30ca5d[_0x25c1('0x53')](_0x25c1('0xab'),_0x25c1('0xac'));_0x30ca5d[_0x25c1('0x53')](_0x25c1('0xad'),_0x25c1('0xae'));_0x30ca5d[_0x25c1('0x53')](_0x25c1('0xaf'),_0x25c1('0xb0'));_0x30ca5d[_0x25c1('0x53')](_0x25c1('0xb1'),'Contact.phone');_0x30ca5d[_0x25c1('0x53')](_0x25c1('0xb2'),'Contact.mobile');_0x30ca5d[_0x25c1('0x53')](_0x25c1('0xb3'),'Contact.fax');_0x30ca5d['field']('o.fullname','Owner.fullname');_0x30ca5d[_0x25c1('0x53')](_0x25c1('0xb4'),_0x25c1('0xb5'));_0x30ca5d['field'](_0x25c1('0xb6'),_0x25c1('0x37'));}if(_0x28fc89[_0x25c1('0x26')])_0x30ca5d['limit'](_0x28fc89[_0x25c1('0x26')]);if(_0x28fc89[_0x25c1('0x24')])_0x30ca5d['offset'](_0x28fc89[_0x25c1('0x24')]);return db[_0x25c1('0xb7')][_0x25c1('0x49')](_0x30ca5d[_0x25c1('0xa4')](),_0x77b14a);})[_0x25c1('0x16')](function(_0x47d354){if(_0x47d354[_0x25c1('0x4e')]>0x0)_0x411c5c[_0x25c1('0x88')]('ui.ChatInteractionId\x20IN\x20?',_[_0x25c1('0x35')](_0x47d354,'id'));return db[_0x25c1('0xb7')][_0x25c1('0x49')](_0x411c5c[_0x25c1('0xa4')](),_0x77b14a)[_0x25c1('0x16')](function(_0x14196d){var _0x12247b=_[_0x25c1('0xb8')](_0x14196d,_0x25c1('0xb9'));var _0x589b20=[];_0x47d354[_0x25c1('0x77')](function(_0x30a6d8){_0x589b20[_0x25c1('0xba')](updateChatInteraction(_0x30a6d8,_0x40fe57,_0x12247b));});return BPromise[_0x25c1('0xbb')](_0x589b20);});});})['then'](function(_0x2dcbb8){_0x389547[_0x25c1('0xbc')]=_0x2dcbb8;return _0x389547;})[_0x25c1('0x16')](respondWithFilteredResult(_0x545934,_0x28fc89))[_0x25c1('0x1f')](handleError(_0x545934,null));};exports[_0x25c1('0xbd')]=function(_0x2fd02c,_0x1308a1){var _0x239b80={'raw':![],'where':{'id':_0x2fd02c[_0x25c1('0xbe')]['id']}},_0x49f697={};_0x49f697['model']=_[_0x25c1('0x48')](db[_0x25c1('0x43')][_0x25c1('0x44')]);_0x49f697[_0x25c1('0x49')]=_[_0x25c1('0x48')](_0x2fd02c[_0x25c1('0x49')]);_0x49f697['filters']=_[_0x25c1('0x4b')](_0x49f697[_0x25c1('0x47')],_0x49f697['query']);_0x239b80[_0x25c1('0x4c')]=_[_0x25c1('0x4b')](_0x49f697[_0x25c1('0x47')],qs[_0x25c1('0x4d')](_0x2fd02c[_0x25c1('0x49')][_0x25c1('0x4d')]));_0x239b80[_0x25c1('0x4c')]=_0x239b80[_0x25c1('0x4c')][_0x25c1('0x4e')]?_0x239b80[_0x25c1('0x4c')]:_0x49f697[_0x25c1('0x47')];if(_0x2fd02c['query'][_0x25c1('0xbf')]){_0x239b80[_0x25c1('0xc0')]=[{'all':!![]}];}_0x239b80=_['merge']({},_0x239b80,_0x2fd02c[_0x25c1('0xc1')]);return db[_0x25c1('0x43')][_0x25c1('0x6d')](_0x239b80)[_0x25c1('0x16')](handleEntityNotFound(_0x1308a1,null))[_0x25c1('0x16')](respondWithResult(_0x1308a1,null))[_0x25c1('0x1f')](handleError(_0x1308a1,null));};exports[_0x25c1('0xc2')]=function(_0x8e2b7b,_0x2d325d){return db[_0x25c1('0x43')]['create'](_0x8e2b7b[_0x25c1('0x7d')],{})['then'](respondWithResult(_0x2d325d,0xc9))[_0x25c1('0x1f')](handleError(_0x2d325d,null));};exports[_0x25c1('0x2a')]=function(_0x3d9c53,_0x3bf69f){if(_0x3d9c53['body']['id']){delete _0x3d9c53[_0x25c1('0x7d')]['id'];}return db[_0x25c1('0x43')][_0x25c1('0x6d')]({'where':{'id':_0x3d9c53[_0x25c1('0xbe')]['id']}})['then'](handleEntityNotFound(_0x3bf69f,null))['then'](saveUpdates(_0x3d9c53['body'],null))[_0x25c1('0x16')](respondWithResult(_0x3bf69f,null))[_0x25c1('0x1f')](handleError(_0x3bf69f,null));};exports[_0x25c1('0x2b')]=function(_0x423dbe,_0x1605f6){return db[_0x25c1('0x43')][_0x25c1('0x6d')]({'where':{'id':_0x423dbe['params']['id']}})[_0x25c1('0x16')](handleEntityNotFound(_0x1605f6,null))['then'](removeEntity(_0x1605f6,null))['catch'](handleError(_0x1605f6,null));};exports[_0x25c1('0xc3')]=function(_0x402557,_0x46f384){return db[_0x25c1('0x43')][_0x25c1('0xc3')]()[_0x25c1('0x16')](respondWithResult(_0x46f384,null))[_0x25c1('0x1f')](handleError(_0x46f384,null));};exports[_0x25c1('0xc4')]=function(_0x12bd96,_0x576a97){var _0x53259d=_0x12bd96['params']['id'];var _0x327119;var _0xff391d;var _0x59085d;return db[_0x25c1('0x43')][_0x25c1('0xc5')]({'where':{'id':_0x53259d}})['then'](function(_0x16a8e7){_0x327119=_0x16a8e7;return db[_0x25c1('0xc6')][_0x25c1('0xc5')]({'where':{'id':_0x16a8e7[_0x25c1('0x83')]},'attributes':['id',_0x25c1('0xc7'),_0x25c1('0xc8'),_0x25c1('0xc9'),_0x25c1('0xca'),_0x25c1('0xcb')],'raw':!![]});})[_0x25c1('0x16')](function(_0x483c05){if(_0x483c05&&_0x483c05[_0x25c1('0xc7')]&&_0x483c05[_0x25c1('0xc8')]){_0xff391d=_0x483c05;var _0x30bd45={'interaction':{'id':_0x53259d},'agent':{'id':_0x12bd96['user']['id'],'name':_0x12bd96[_0x25c1('0xa1')][_0x25c1('0x2d')],'fullname':_0x12bd96[_0x25c1('0xa1')]['fullname'],'email':_0x12bd96[_0x25c1('0xa1')][_0x25c1('0xcc')]},'contact':_0x12bd96[_0x25c1('0x7d')][_0x25c1('0x30')],'account':_0x12bd96[_0x25c1('0x7d')][_0x25c1('0x33')]};var _0x583cf4={'rejectUnauthorized':![],'method':_0x25c1('0xcd'),'url':_0x25c1('0xce'),'headers':{'X-APIKEY':_0x483c05[_0x25c1('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x12bd96[_0x25c1('0xa1')]['email']],'buttons':null,'topic':_0xff391d[_0x25c1('0xc9')],'note':_[_0x25c1('0xcf')](_0xff391d[_0x25c1('0xca')])?null:getMustacheRender(_0xff391d[_0x25c1('0xca')],_0x30bd45),'metadata':null},'redirect':_0x25c1('0xd0'),'json':!![]};try{if(!_[_0x25c1('0xcf')](_0xff391d[_0x25c1('0xcb')])){var _0x1665a2=getMustacheRender(_0xff391d[_0x25c1('0xcb')],_0x30bd45);var _0xe6283b=JSON['parse'](_0x1665a2);_0x583cf4[_0x25c1('0x7d')][_0x25c1('0xd1')]=_0xe6283b;}}catch(_0x2fa46e){throw new db[(_0x25c1('0x97'))][(_0x25c1('0xd2'))](_0x25c1('0xd3'));}return rp(_0x583cf4);}else{throw new db['Sequelize']['ValidationError'](_0x25c1('0xd4'));}})[_0x25c1('0x16')](function(_0x1f4965){_0x59085d=_0x1f4965;if(_0x59085d['id']){var _0x169c61={'body':_0x59085d[_0x25c1('0xd5')],'ChatWebsiteId':_0xff391d['id'],'ChatInteractionId':_0x327119['id'],'direction':_0x25c1('0xd6'),'UserId':_0x12bd96['user']['id']};return db['ChatMessage']['create'](_0x169c61,{});}else{throw new db[(_0x25c1('0x97'))][(_0x25c1('0xd2'))](_0x25c1('0xd7'));}})['then'](function(){return _0x327119[_0x25c1('0xd8')]({'vidaooSessionId':_0x59085d['id']});})[_0x25c1('0x16')](respondWithResult(_0x576a97,null))[_0x25c1('0x1f')](handleError(_0x576a97,null));};exports[_0x25c1('0xd9')]=function(_0x145fc4,_0x18829e){if(_0x145fc4[_0x25c1('0x7d')]['id']){delete _0x145fc4[_0x25c1('0x7d')]['id'];}return db[_0x25c1('0x43')][_0x25c1('0x6d')]({'where':{'id':_0x145fc4[_0x25c1('0xbe')]['id']},'include':[{'model':db[_0x25c1('0xda')],'as':'Contact'}]})[_0x25c1('0x16')](handleEntityNotFound(_0x18829e,null))[_0x25c1('0x16')](saveUpdates(_0x145fc4['body'],null))[_0x25c1('0x16')](respondWithResult(_0x18829e,null))[_0x25c1('0x1f')](handleError(_0x18829e,null));};exports[_0x25c1('0xdb')]=function(_0x28af6d,_0xd3bda4){if(_0x28af6d['body']['id']){delete _0x28af6d[_0x25c1('0x7d')]['id'];}return db[_0x25c1('0x43')][_0x25c1('0x6d')]({'where':{'id':_0x28af6d[_0x25c1('0xbe')]['id']}})['then'](function(_0x81d62f){if(!_0x81d62f){logger['error'](_0x25c1('0xdc'),_0x25c1('0xdb'),0x194,_0x25c1('0xdd'));_0xd3bda4['sendStatus'](0x194);}else{if(_0x81d62f[_0x25c1('0x3d')]){throw new db[(_0x25c1('0x97'))][(_0x25c1('0xd2'))](_0x25c1('0xde'));}}return _0x81d62f;})[_0x25c1('0x16')](function(_0x230f47){if(_0x230f47){return _0x230f47[_0x25c1('0x2a')]({'closed':_0x28af6d[_0x25c1('0x7d')][_0x25c1('0x3f')],'disposition':_0x28af6d['body'][_0x25c1('0xdf')]})[_0x25c1('0x16')](function(_0x3b5769){return _0x3b5769;});}})[_0x25c1('0x16')](function(){return respondWithRpcPromise(_0x25c1('0xe0'),'abandon',_0x28af6d[_0x25c1('0x7d')],client9004);})[_0x25c1('0x16')](respondWithResult(_0xd3bda4,null))[_0x25c1('0x1f')](handleError(_0xd3bda4,null));};exports['attachmentUpload']=function(_0xc6345a,_0x386a3d){_0xc6345a[_0x25c1('0x7d')]['name']=_0xc6345a['file']['originalname'];_0xc6345a[_0x25c1('0x7d')][_0x25c1('0xe1')]=_0xc6345a[_0x25c1('0xe2')][_0x25c1('0xe3')];_0xc6345a[_0x25c1('0x7d')][_0x25c1('0x45')]=_0xc6345a[_0x25c1('0xe2')][_0x25c1('0xe4')];return db[_0x25c1('0xe5')][_0x25c1('0xc2')](_0xc6345a[_0x25c1('0x7d')])['then'](respondWithResult(_0x386a3d,0xc9))['catch'](handleError(_0x386a3d,null));};exports[_0x25c1('0xe6')]=function(_0x39306b,_0x17d6dd){return db[_0x25c1('0x43')][_0x25c1('0xc5')]({'where':{'id':_0x39306b['params']['id']},'raw':!![]})[_0x25c1('0x16')](handleEntityNotFound(_0x17d6dd,null))['then'](function(_0x3a9e3b){if(_0x3a9e3b){if(_0x3a9e3b[_0x25c1('0x3f')]){return _0x17d6dd[_0x25c1('0x21')](0x193)[_0x25c1('0x23')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x25c1('0xc5')]({'where':{'id':_0x39306b[_0x25c1('0x49')][_0x25c1('0xe7')]},'raw':!![]})['then'](handleEntityNotFound(_0x17d6dd,null));}})['then'](function(_0x2b0c7f){if(_0x2b0c7f){var _0xd9acda=_0x2b0c7f['ChatOfflineMessageId']!==null;var _0x177463=path[_0x25c1('0xe8')](config[_0x25c1('0xe9')],_0x25c1('0xea'));if(_0xd9acda){_0x177463=path[_0x25c1('0xe8')](_0x177463,_0x25c1('0xeb'));}var _0x28af2d=path[_0x25c1('0xe8')](_0x177463,_0x2b0c7f[_0x25c1('0xe1')]);return _0x17d6dd[_0x25c1('0xec')](_0x28af2d);}})[_0x25c1('0x1f')](handleError(_0x17d6dd,null));};exports[_0x25c1('0xed')]=function(_0x1f53c3,_0x2f71f6){var _0x5c6bbb=null;var _0x38e111=null;var _0x20d482=null;if(_0x1f53c3['body']['id']){delete _0x1f53c3[_0x25c1('0x7d')]['id'];}if(_0x1f53c3['body'][_0x25c1('0xee')]){_0x20d482=path[_0x25c1('0xe8')](config['root'],_0x25c1('0xef'),util[_0x25c1('0xf0')](_0x25c1('0xf1'),Date[_0x25c1('0xf2')]()));_0x1f53c3[_0x25c1('0x7d')]['pathTranscript']=_0x20d482;}return db[_0x25c1('0x43')][_0x25c1('0x6d')]({'where':{'id':_0x1f53c3[_0x25c1('0xbe')]['id']},'include':[{'model':db[_0x25c1('0xf3')],'as':'Messages','include':[{'model':db[_0x25c1('0xf4')],'as':_0x25c1('0xf4')}]}]})[_0x25c1('0x16')](handleEntityNotFound(_0x2f71f6,null))['then'](saveUpdates(_0x1f53c3[_0x25c1('0x7d')],null))[_0x25c1('0x16')](function(_0x47288a){if(_0x47288a){_0x5c6bbb=_0x47288a;return db[_0x25c1('0xc6')][_0x25c1('0x6d')]({'where':{'id':_0x5c6bbb[_0x25c1('0x83')]}});}})[_0x25c1('0x16')](function(_0x7d1584){if(_0x7d1584){_0x38e111=_0x7d1584;return db['CmContact']['find']({'where':{'id':_0x5c6bbb['ContactId']}});}})[_0x25c1('0x16')](function(_0x93f06){if(_0x93f06){if(_0x20d482){var _0x9d24d2=null;for(var _0x529ea6=0x1;_0x529ea6<_0x5c6bbb[_0x25c1('0xf5')][_0x25c1('0x4e')];++_0x529ea6){_0x9d24d2=_0x5c6bbb[_0x25c1('0xf5')][_0x529ea6];var _0x412b5a=_0x9d24d2[_0x25c1('0x3d')]?util[_0x25c1('0xf0')](_0x25c1('0xf6'),_0x38e111['agentAlias'],_0x9d24d2[_0x25c1('0x3d')]):_0x25c1('0xf7');var _0x5679ab=_0x1f53c3[_0x25c1('0x7d')][_0x25c1('0xf8')]||util[_0x25c1('0xf0')](_0x25c1('0xf6'),_0x25c1('0xf9'),_0x9d24d2[_0x25c1('0x76')]);switch(_0x38e111[_0x25c1('0xfa')]){case _0x25c1('0xfb'):_0x412b5a=_0x9d24d2[_0x25c1('0x3d')]?util[_0x25c1('0xf0')](_0x25c1('0xf6'),_0x38e111[_0x25c1('0xfc')],_0x9d24d2[_0x25c1('0x3d')]):_0x25c1('0xf7');break;case _0x25c1('0xfd'):_0x412b5a=_0x9d24d2['UserId']?_0x9d24d2['User'][_0x25c1('0xfe')]||_0x9d24d2[_0x25c1('0xf4')]['fullname']:_0x25c1('0xf7');break;case _0x25c1('0xff'):_0x412b5a=_0x9d24d2[_0x25c1('0x3d')]?_0x9d24d2['User'][_0x25c1('0x36')]:_0x25c1('0xf7');break;default:_0x412b5a=_0x9d24d2[_0x25c1('0x3d')]?util[_0x25c1('0xf0')](_0x25c1('0xf6'),_0x38e111['agentAlias'],_0x9d24d2[_0x25c1('0x3d')]):_0x25c1('0xf7');}var _0x1c6686=util[_0x25c1('0xf0')]('[%s]\x20%s:\x20%s\x0a',moment(_0x9d24d2['createdAt'])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x9d24d2[_0x25c1('0x100')]==='in'?_0x5679ab:_0x412b5a,_0x9d24d2['body']);if(!_0x9d24d2[_0x25c1('0x101')]){fs['appendFileSync'](_0x20d482,_0x1c6686);}}return db[_0x25c1('0x102')][_0x25c1('0xc5')]({'where':{'service':!![]},'include':[{'model':db[_0x25c1('0x103')],'as':_0x25c1('0x104'),'raw':!![],'include':[{'model':db[_0x25c1('0x105')],'as':_0x25c1('0x105'),'raw':!![]}]}]});}}})[_0x25c1('0x16')](function(_0x4d07d4){if(!_0x4d07d4||!_0x4d07d4['Smtp']||!_0x1f53c3[_0x25c1('0x7d')])return _0x5c6bbb;var _0x474d22=_0x4d07d4[_0x25c1('0x106')]();return respondWithRpcPromise(_0x25c1('0x107'),_0x25c1('0x108'),{'account':_0x474d22,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x4d07d4[_0x25c1('0x2d')],_0x4d07d4[_0x25c1('0xcc')]||_0x4d07d4[_0x25c1('0x104')][_0x25c1('0xa1')]),'to':_0x1f53c3[_0x25c1('0x7d')][_0x25c1('0xee')],'subject':_0x25c1('0x109'),'text':util[_0x25c1('0xf0')](_0x25c1('0x10a'),_0x1f53c3[_0x25c1('0x7d')][_0x25c1('0xee')]),'attachments':[{'path':_0x20d482}]}})[_0x25c1('0x16')](function(){return _0x5c6bbb;})['catch'](function(_0x30e70a){logger['error'](_0x30e70a);});})[_0x25c1('0x16')](respondWithStatusCode(_0x2f71f6,0xc8))[_0x25c1('0x1f')](handleError(_0x2f71f6,null));};exports[_0x25c1('0x10b')]=function(_0x10b2c0,_0x4fdca2){return db[_0x25c1('0xf3')]['find']({'where':{'id':_0x10b2c0['params']['id']}})[_0x25c1('0x16')](handleEntityNotFound(_0x4fdca2,null))[_0x25c1('0x16')](function(_0x567ea4){if(_0x567ea4){return _0x567ea4['addMessage'](_0x10b2c0[_0x25c1('0x7d')][_0x25c1('0x10c')],_[_0x25c1('0x10d')](_0x10b2c0[_0x25c1('0x7d')],[_0x25c1('0x10c'),'id'])||{});}})['then'](respondWithResult(_0x4fdca2,null))[_0x25c1('0x1f')](handleError(_0x4fdca2,null));};exports[_0x25c1('0x10e')]=function(_0x53a35d,_0x5816c3){var _0x38ed31={'raw':![],'where':{}};var _0x287354={};var _0x33a141={'count':0x0,'rows':[]};return db[_0x25c1('0x43')][_0x25c1('0xc5')]({'where':{'id':_0x53a35d[_0x25c1('0xbe')]['id']}})[_0x25c1('0x16')](handleEntityNotFound(_0x5816c3,null))[_0x25c1('0x16')](function(_0x364f94){if(_0x364f94){_0x287354[_0x25c1('0x47')]=_[_0x25c1('0x48')](db[_0x25c1('0xf3')][_0x25c1('0x44')]);_0x287354[_0x25c1('0x49')]=_[_0x25c1('0x48')](_0x53a35d[_0x25c1('0x49')]);_0x287354[_0x25c1('0x4a')]=_[_0x25c1('0x4b')](_0x287354[_0x25c1('0x47')],_0x287354[_0x25c1('0x49')]);_0x38ed31[_0x25c1('0x4c')]=_[_0x25c1('0x4b')](_0x287354[_0x25c1('0x47')],qs[_0x25c1('0x4d')](_0x53a35d[_0x25c1('0x49')][_0x25c1('0x4d')]));_0x38ed31['attributes']=_0x38ed31[_0x25c1('0x4c')]['length']?_0x38ed31[_0x25c1('0x4c')]:_0x287354['model'];if(!_0x53a35d['query']['hasOwnProperty']('nolimit')){_0x38ed31[_0x25c1('0x26')]=qs[_0x25c1('0x26')](_0x53a35d[_0x25c1('0x49')]['limit']);_0x38ed31['offset']=qs[_0x25c1('0x24')](_0x53a35d[_0x25c1('0x49')]['offset']);}_0x38ed31[_0x25c1('0x9c')]=qs[_0x25c1('0x51')](_0x53a35d[_0x25c1('0x49')][_0x25c1('0x51')]);_0x38ed31[_0x25c1('0x88')]=qs[_0x25c1('0x4a')](_[_0x25c1('0x52')](_0x53a35d[_0x25c1('0x49')],_0x287354['filters']));_0x38ed31[_0x25c1('0x88')][_0x25c1('0xb9')]=_0x364f94['id'];if(_0x53a35d['query']['filter']){_0x38ed31['where']=_[_0x25c1('0x2f')](_0x38ed31[_0x25c1('0x88')],{'$or':_[_0x25c1('0x35')](_0x38ed31[_0x25c1('0x4c')],function(_0x2757e7){var _0x4bbf3c={};_0x4bbf3c[_0x2757e7]={'$like':'%'+_0x53a35d[_0x25c1('0x49')][_0x25c1('0x91')]+'%'};return _0x4bbf3c;})});}if(_0x53a35d['query'][_0x25c1('0x87')]){var _0x9aba08=_0x53a35d[_0x25c1('0x49')][_0x25c1('0x87')][_0x25c1('0x39')](',');var _0x4bf7b2={};_0x4bf7b2[_0x9aba08[0x0]]={'$gte':moment(_0x9aba08[0x1])[_0x25c1('0xf0')](_0x25c1('0x10f'))};_0x38ed31[_0x25c1('0x88')]=_[_0x25c1('0x2f')](_0x38ed31[_0x25c1('0x88')],_0x4bf7b2);}_0x38ed31=_[_0x25c1('0x2f')]({},_0x38ed31,_0x53a35d[_0x25c1('0xc1')]);return db[_0x25c1('0xf3')][_0x25c1('0x27')]({'where':_0x38ed31['where']})[_0x25c1('0x16')](function(_0x485b8e){_0x33a141[_0x25c1('0x27')]=_0x485b8e;if(_0x53a35d['query'][_0x25c1('0xbf')]){_0x38ed31[_0x25c1('0xc0')]=[{'all':!![]}];}return db[_0x25c1('0xf3')][_0x25c1('0x110')](_0x38ed31);})[_0x25c1('0x16')](function(_0x44b339){_0x33a141[_0x25c1('0xbc')]=_0x44b339;return _0x33a141;});}})['then'](respondWithFilteredResult(_0x5816c3,_0x38ed31))['catch'](handleError(_0x5816c3,null));};exports[_0x25c1('0x111')]=function(_0x346e7a,_0x3d27f5){var _0x5d9abc={'where':{}},_0x2eecfe={},_0x42c358={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x25c1('0xc5')]({'where':{'id':_0x346e7a[_0x25c1('0xbe')]['id']}})[_0x25c1('0x16')](handleEntityNotFound(_0x3d27f5,null))[_0x25c1('0x16')](function(_0x1e77f4){if(_0x1e77f4){_0x2eecfe[_0x25c1('0x47')]=_['keys'](db[_0x25c1('0xf3')][_0x25c1('0x44')]);_0x2eecfe[_0x25c1('0x49')]=_[_0x25c1('0x48')](_0x346e7a[_0x25c1('0x49')]);_0x2eecfe[_0x25c1('0x4a')]=_[_0x25c1('0x4b')](_0x2eecfe[_0x25c1('0x47')],_0x2eecfe[_0x25c1('0x49')]);_0x5d9abc[_0x25c1('0x4c')]=_[_0x25c1('0x4b')](_0x2eecfe[_0x25c1('0x47')],qs[_0x25c1('0x4d')](_0x346e7a[_0x25c1('0x49')][_0x25c1('0x4d')]));_0x5d9abc[_0x25c1('0x4c')]=_0x5d9abc[_0x25c1('0x4c')][_0x25c1('0x4e')]?_0x5d9abc[_0x25c1('0x4c')]:_0x2eecfe[_0x25c1('0x47')];if(!_0x346e7a[_0x25c1('0x49')][_0x25c1('0x4f')]('nolimit')){_0x5d9abc[_0x25c1('0x26')]=qs['limit'](_0x346e7a['query'][_0x25c1('0x26')]);_0x5d9abc[_0x25c1('0x24')]=qs[_0x25c1('0x24')](_0x346e7a[_0x25c1('0x49')]['offset']);}_0x5d9abc[_0x25c1('0x9c')]=qs[_0x25c1('0x51')](_0x346e7a[_0x25c1('0x49')][_0x25c1('0x51')]);_0x5d9abc[_0x25c1('0x88')]=qs[_0x25c1('0x4a')](_[_0x25c1('0x52')](_0x346e7a[_0x25c1('0x49')],_0x2eecfe[_0x25c1('0x4a')]));_0x5d9abc[_0x25c1('0x88')][_0x25c1('0xb9')]=_0x1e77f4['id'];if(_0x346e7a[_0x25c1('0x49')][_0x25c1('0x91')]){_0x5d9abc[_0x25c1('0x88')]=_['merge'](_0x5d9abc['where'],{'$or':_['map'](_0x5d9abc[_0x25c1('0x4c')],function(_0x4782a1){var _0x5476fd={};_0x5476fd[_0x4782a1]={'$like':'%'+_0x346e7a[_0x25c1('0x49')][_0x25c1('0x91')]+'%'};return _0x5476fd;})});}_0x5d9abc[_0x25c1('0x88')][_0x25c1('0x101')]=![];if(_0x346e7a[_0x25c1('0x49')]['id']){_0x5d9abc['where']['id']={'$gt':_0x346e7a[_0x25c1('0x49')]['id']};}_0x5d9abc=_[_0x25c1('0x2f')]({},_0x5d9abc,_0x346e7a[_0x25c1('0xc1')]);return db[_0x25c1('0xf3')]['count']({'where':_0x5d9abc[_0x25c1('0x88')]})[_0x25c1('0x16')](function(_0x41a852){_0x42c358[_0x25c1('0x27')]=_0x41a852;_0x5d9abc[_0x25c1('0xc0')]=[];if(_0x346e7a[_0x25c1('0x49')][_0x25c1('0x112')]){_0x5d9abc[_0x25c1('0xc0')][_0x25c1('0xba')]({'model':db[_0x25c1('0xf4')],'as':_0x25c1('0xf4'),'attributes':['id','fullname',_0x25c1('0xfe')]});}if(_0x346e7a['query'][_0x25c1('0xbf')]){_0x5d9abc[_0x25c1('0xc0')]=[{'all':!![]}];}return db[_0x25c1('0xf3')][_0x25c1('0x110')](_0x5d9abc);})[_0x25c1('0x16')](function(_0x490a5a){_0x42c358[_0x25c1('0xbc')]=_0x490a5a;return _0x42c358;});}})[_0x25c1('0x16')](respondWithFilteredResult(_0x3d27f5,_0x5d9abc))['catch'](handleError(_0x3d27f5,null));};exports[_0x25c1('0x113')]=function(_0x794186,_0x369eae){return db[_0x25c1('0x43')][_0x25c1('0x6d')]({'where':{'id':_0x794186[_0x25c1('0xbe')]['id']}})[_0x25c1('0x16')](handleEntityNotFound(_0x369eae,null))[_0x25c1('0x16')](function(_0xb7f731){if(_0xb7f731){return _0xb7f731[_0x25c1('0x114')](_0x794186[_0x25c1('0x7d')][_0x25c1('0x10c')],_[_0x25c1('0x10d')](_0x794186[_0x25c1('0x7d')],[_0x25c1('0x10c'),'id'])||{})[_0x25c1('0x115')](function(){return db[_0x25c1('0x116')]['findAll']({'attributes':['id',_0x25c1('0x2d'),_0x25c1('0x54')],'where':{'id':_0x794186[_0x25c1('0x7d')][_0x25c1('0x10c')]}});})[_0x25c1('0x16')](function(_0x567eaa){socket[_0x25c1('0x117')]('chatInteractionTags:save',{'id':Number(_0x794186['params']['id']),'tags':_0x567eaa||[]});return{'id':Number(_0x794186[_0x25c1('0xbe')]['id']),'tags':_0x567eaa||[]};});}})['then'](respondWithResult(_0x369eae,null))[_0x25c1('0x1f')](handleError(_0x369eae,null));};exports[_0x25c1('0x118')]=function(_0x4db32e,_0x1ef23b){return db[_0x25c1('0x43')]['find']({'where':{'id':_0x4db32e[_0x25c1('0xbe')]['id']}})[_0x25c1('0x16')](handleEntityNotFound(_0x1ef23b,null))[_0x25c1('0x16')](function(_0x398c71){if(_0x398c71){return _0x398c71['removeTags'](_0x4db32e[_0x25c1('0x49')][_0x25c1('0x10c')]);}})[_0x25c1('0x16')](respondWithStatusCode(_0x1ef23b,null))[_0x25c1('0x1f')](handleError(_0x1ef23b,null));};exports[_0x25c1('0xec')]=function(_0x239d47,_0x709325){var _0x397cdb=moment()['unix']()['toString']();var _0x2218d9=path[_0x25c1('0xe8')](config[_0x25c1('0xe9')],_0x25c1('0x119'),_0x25c1('0x11a'),_0x25c1('0x11b'));var _0x27835b=path[_0x25c1('0xe8')](config[_0x25c1('0xe9')],_0x25c1('0x119'),'files','attachments');var _0x2b87d2=path[_0x25c1('0xe8')](_0x2218d9,_0x397cdb);var _0x2d6283=util[_0x25c1('0xf0')](_0x25c1('0x11c'),_0x239d47['params']['id'],_0x397cdb);var _0x366f6c=path[_0x25c1('0xe8')](_0x2218d9,_0x2d6283);var _0x4ab3db=[];_0x4ab3db[_0x25c1('0xba')]({'model':db['User'],'as':_0x25c1('0xf4'),'attributes':['id',_0x25c1('0x36')],'raw':!![]});_0x4ab3db[_0x25c1('0xba')]({'model':db[_0x25c1('0xda')],'as':_0x25c1('0x11d'),'attributes':['id',_0x25c1('0x11e'),'lastName'],'raw':!![]});if(_0x239d47[_0x25c1('0x49')][_0x25c1('0x11f')]){_0x4ab3db['push']({'model':db[_0x25c1('0xe5')],'as':_0x25c1('0xe5'),'raw':!![]});}var _0x5dc403=[{'model':db[_0x25c1('0xf3')],'as':'Messages','attributes':['id',_0x25c1('0x7d'),_0x25c1('0x85'),_0x25c1('0x100'),_0x25c1('0x101'),'read'],'include':_0x4ab3db}];_0x5dc403['push']({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x25c1('0x2d')]});_0x5dc403[_0x25c1('0xba')]({'model':db[_0x25c1('0xf4')],'as':_0x25c1('0x120'),'attributes':['id','fullname']});return db[_0x25c1('0x43')][_0x25c1('0x6d')]({'where':{'id':_0x239d47[_0x25c1('0xbe')]['id']},'include':_0x5dc403})[_0x25c1('0x16')](handleEntityNotFound(_0x709325,null))[_0x25c1('0x16')](function(_0x2fc76c){if(_0x2fc76c){var _0x7b4c19=_0x2fc76c['get']({'plain':!![]});fs['mkdirSync'](_0x2b87d2);var _0x571289={'channel':'Chat','account':_0x7b4c19[_0x25c1('0x121')]['name'],'agent':_0x7b4c19[_0x25c1('0x120')]?_0x7b4c19[_0x25c1('0x120')][_0x25c1('0x36')]:'N.A.','createdAt':moment(_0x7b4c19[_0x25c1('0x85')])[_0x25c1('0xf0')]('YYYY-MM-DD\x20HH:mm:ss')[_0x25c1('0xa4')](),'closedAt':_0x7b4c19[_0x25c1('0x3f')]?moment(_0x7b4c19['closedAt'])[_0x25c1('0xf0')]('YYYY-MM-DD\x20HH:mm:ss')[_0x25c1('0xa4')]():'','disposition':_0x7b4c19[_0x25c1('0xdf')],'chatInfo':{'browser':_0x7b4c19[_0x25c1('0x122')],'os':_0x7b4c19['osName'],'referer':_0x7b4c19[_0x25c1('0x123')],'customerIp':_0x7b4c19['customerIp'],'customerPort':_0x7b4c19[_0x25c1('0x124')]?_0x7b4c19['customerPort']:_0x25c1('0x125')},'messages':_(_0x7b4c19[_0x25c1('0xf5')])['tail']()[_0x25c1('0x91')]({'secret':![]})[_0x25c1('0x35')](function(_0x11e82f){if(_0x11e82f[_0x25c1('0xe5')]){var _0x2d73d5=path[_0x25c1('0xe8')](_0x27835b,_0x11e82f[_0x25c1('0xe5')]['basename']);if(fs[_0x25c1('0x126')](_0x2d73d5)){fs[_0x25c1('0x127')](_0x2d73d5)[_0x25c1('0x128')](fs[_0x25c1('0x129')](path[_0x25c1('0xe8')](_0x2b87d2,_0x11e82f['Attachment'][_0x25c1('0xe1')])));}}return{'date':moment(_0x11e82f['createdAt'])[_0x25c1('0xf0')](_0x25c1('0x10f'))[_0x25c1('0xa4')](),'sender':_0x11e82f[_0x25c1('0x100')]===_0x25c1('0xd6')?_0x11e82f[_0x25c1('0xf4')]?_0x11e82f['User'][_0x25c1('0x36')]:_0x25c1('0xf7'):_0x11e82f[_0x25c1('0x11d')][_0x25c1('0x11e')]+(_0x11e82f[_0x25c1('0x11d')][_0x25c1('0x12a')]?'\x20'+_0x11e82f[_0x25c1('0x11d')]['lastName']:''),'body':_0x11e82f[_0x25c1('0xe5')]?_0x11e82f['Attachment'][_0x25c1('0xe1')]:_0x11e82f[_0x25c1('0x7d')],'direction':_0x11e82f['direction']===_0x25c1('0xd6')?'A':'C','secret':_0x11e82f[_0x25c1('0x101')],'read':_0x11e82f['read'],'attachment':_0x11e82f[_0x25c1('0xe5')]};})[_0x25c1('0x72')]()};return ejs['renderFile'](path[_0x25c1('0xe8')](config[_0x25c1('0xe9')],'server',_0x25c1('0x12b'),_0x25c1('0x12c')),{'interaction':_0x571289})[_0x25c1('0x16')](function(_0x29d142){var _0x3fb5ed=path[_0x25c1('0xe8')](_0x2b87d2,_0x25c1('0x12d')+_0x7b4c19['id']+'-'+_0x397cdb+_0x25c1('0x12e'));var _0x1547ac={'path':_0x3fb5ed,'channel':_0x25c1('0x12f'),'interactionId':_0x7b4c19['id']};return pdf[_0x25c1('0x130')](_0x29d142,_0x1547ac);})[_0x25c1('0x16')](function(){return new Promise(function(_0x45d150,_0x17f776){zipdir(_0x2b87d2,{'saveTo':_0x366f6c},function(_0x246ed8,_0x5f4c8d){if(_0x246ed8)return _0x17f776(_0x246ed8);return _0x45d150(_0x5f4c8d);});})[_0x25c1('0x16')](function(){return new BPromise(function(_0x265362,_0x4ad924){rimraf(_0x2b87d2,function(_0x51c0e7){if(_0x51c0e7)_0x4ad924(_0x51c0e7);return _0x265362();});});})['then'](function(){return _0x709325[_0x25c1('0xec')](_0x366f6c,_0x2d6283,function(_0x4c7055){if(_0x4c7055){logger['error'](_0x25c1('0x131'),_0x4c7055);}else{fs[_0x25c1('0x132')](_0x366f6c);}});});});}else{return _0x709325['sendStatus'](0xc8);}})[_0x25c1('0x1f')](handleError(_0x709325,null));}; \ No newline at end of file +var _0x9c44=['join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','CmContact','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','findAll','options','addTags','spread','emit','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','sendStatus','request-promise','moment','bluebird','mustache','util','path','squel','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','update','name','send','merge','body','contact','interaction','account','Users','map','TagIds','split','forEach','Tags','push','waiting','talking','answered','unmanaged','abandoned','total','UserId','closed','disposition','index','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','some','compact','isEmpty','ChatWebsiteId','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','destroy','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','create','ValidationError','updateAttributes','abandon','AbandonInteraction','file','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x49c4('0x0'));var moment=require(_0x49c4('0x1'));var BPromise=require(_0x49c4('0x2'));var Mustache=require(_0x49c4('0x3'));var util=require(_0x49c4('0x4'));var path=require(_0x49c4('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x49c4('0x6'));var Redis=require('ioredis');var qs=require(_0x49c4('0x7'));var as=require(_0x49c4('0x8'));var pdf=require(_0x49c4('0x9'));var logger=require(_0x49c4('0xa'))(_0x49c4('0xb'));var config=require('../../config/environment');var db=require(_0x49c4('0xc'))['db'];config[_0x49c4('0xd')]=_[_0x49c4('0xe')](config[_0x49c4('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x49c4('0xd')]));require(_0x49c4('0xf'))['register'](socket);var jayson=require(_0x49c4('0x10'));var client=jayson[_0x49c4('0x11')]['http']({'port':0x232b});var client9004=jayson['client'][_0x49c4('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x6d1b08,_0x5487cd,_0x7df3a9,_0x403bfb){return new BPromise(function(_0x5f2fd9,_0x1909fe){var _0x280996=_0x403bfb||client;return _0x280996[_0x49c4('0x13')](_0x6d1b08,_0x7df3a9)[_0x49c4('0x14')](function(_0x12777c){logger[_0x49c4('0x15')](_0x49c4('0x16'),_0x5487cd,_0x49c4('0x17'));logger['debug'](_0x49c4('0x18'),_0x5487cd,_0x49c4('0x17'),JSON[_0x49c4('0x19')](_0x12777c));if(_0x12777c[_0x49c4('0x1a')]){if(_0x12777c[_0x49c4('0x1a')]['code']===0x1f4){logger[_0x49c4('0x1a')](_0x49c4('0x16'),_0x5487cd,_0x12777c['error']['message']);return _0x1909fe(_0x12777c[_0x49c4('0x1a')][_0x49c4('0x1b')]);}logger[_0x49c4('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5487cd,_0x12777c[_0x49c4('0x1a')]['message']);return _0x5f2fd9(_0x12777c[_0x49c4('0x1a')][_0x49c4('0x1b')]);}else{logger[_0x49c4('0x15')](_0x49c4('0x16'),_0x5487cd,_0x49c4('0x17'));_0x5f2fd9(_0x12777c[_0x49c4('0x1c')][_0x49c4('0x1b')]);}})[_0x49c4('0x1d')](function(_0x2197d2){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5487cd,_0x2197d2);_0x1909fe(_0x2197d2);});});}function respondWithStatusCode(_0x57f502,_0x1c99b1){_0x1c99b1=_0x1c99b1||0xcc;return function(_0x4f0b62){if(_0x4f0b62){return _0x57f502['sendStatus'](_0x1c99b1);}return _0x57f502[_0x49c4('0x1e')](_0x1c99b1)[_0x49c4('0x1f')]();};}function respondWithResult(_0x26c640,_0xd335e4){_0xd335e4=_0xd335e4||0xc8;return function(_0x4811c4){if(_0x4811c4){return _0x26c640['status'](_0xd335e4)[_0x49c4('0x20')](_0x4811c4);}};}function respondWithFilteredResult(_0x9cb797,_0x565423){return function(_0x207358){if(_0x207358){var _0x43e014=typeof _0x565423[_0x49c4('0x21')]===_0x49c4('0x22')&&typeof _0x565423['limit']==='undefined';var _0x449960=_0x207358['count'];var _0x3800b7=_0x43e014?0x0:_0x565423[_0x49c4('0x21')];var _0x3f1708=_0x43e014?_0x207358[_0x49c4('0x23')]:_0x565423['offset']+_0x565423[_0x49c4('0x24')];var _0x2b2793;if(_0x3f1708>=_0x449960){_0x3f1708=_0x449960;_0x2b2793=0xc8;}else{_0x2b2793=0xce;}_0x9cb797[_0x49c4('0x1e')](_0x2b2793);return _0x9cb797[_0x49c4('0x25')](_0x49c4('0x26'),_0x3800b7+'-'+_0x3f1708+'/'+_0x449960)[_0x49c4('0x20')](_0x207358);}return null;};}function saveUpdates(_0x26ba17){return function(_0x427b26){if(_0x427b26){return _0x427b26[_0x49c4('0x27')](_0x26ba17)[_0x49c4('0x14')](function(_0x46f7ea){return _0x46f7ea;});}return null;};}function removeEntity(_0x4ea6ea){return function(_0x4f4495){if(_0x4f4495){return _0x4f4495['destroy']()[_0x49c4('0x14')](function(){_0x4ea6ea[_0x49c4('0x1e')](0xcc)[_0x49c4('0x1f')]();});}};}function handleEntityNotFound(_0x27e467){return function(_0x28eb47){if(!_0x28eb47){_0x27e467['sendStatus'](0x194);}return _0x28eb47;};}function handleError(_0x38ad77,_0x116eb4){_0x116eb4=_0x116eb4||0x1f4;return function(_0x2e7a69){logger[_0x49c4('0x1a')](_0x2e7a69['stack']);if(_0x2e7a69['name']){delete _0x2e7a69[_0x49c4('0x28')];}_0x38ad77[_0x49c4('0x1e')](_0x116eb4)[_0x49c4('0x29')](_0x2e7a69);};}function getMustacheRender(_0x13b3b4,_0xd38540){return Mustache['render'](_0x13b3b4,_[_0x49c4('0x2a')](_0xd38540[_0x49c4('0x2b')],{'contact':_0xd38540[_0x49c4('0x2c')],'message':_0xd38540['message'],'agent':_0xd38540['agent'],'interaction':_0xd38540[_0x49c4('0x2d')],'account':_0xd38540[_0x49c4('0x2e')]}))||'';}function getInteractionUsers(_0x3bec0a,_0x1238c0){return new BPromise(function(_0x2b45a1,_0x2cf897){try{if(_0x1238c0[_0x3bec0a['id']]){_0x3bec0a[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x1238c0[_0x3bec0a['id']],function(_0x3209cd){return{'id':_0x3209cd['id'],'fullname':_0x3209cd['fullname']};});}}catch(_0x2d34ca){_0x2cf897(_0x2d34ca);}_0x2b45a1(_0x3bec0a);});}function getInteractionTags(_0x5b96df,_0xdda586){return new BPromise(function(_0x349791,_0x2625a6){try{if(_0x5b96df[_0x49c4('0x31')]){_0x5b96df['Tags']=[];_0x5b96df[_0x49c4('0x31')][_0x49c4('0x32')](',')[_0x49c4('0x33')](function(_0x4e913a){_0x5b96df[_0x49c4('0x34')][_0x49c4('0x35')](_0xdda586[_0x4e913a]);});}delete _0x5b96df[_0x49c4('0x31')];}catch(_0x5e5366){_0x2625a6(_0x5e5366);}_0x349791(_0x5b96df);});}function updateChatInteraction(_0x1ba7a0,_0x24c177,_0x143916){return new BPromise(function(_0x2ba76a,_0x70e552){return getInteractionUsers(_0x1ba7a0,_0x143916)[_0x49c4('0x14')](function(_0x1e506a){return getInteractionTags(_0x1e506a,_0x24c177);})['then'](function(_0x2d2510){return getStateInteraction(_0x2d2510);})[_0x49c4('0x14')](function(_0x32b172){_0x2ba76a(_0x32b172);})[_0x49c4('0x1d')](function(_0x41ad28){_0x70e552(_0x41ad28);});});}function getStateInteraction(_0x29dd5d){return new BPromise(function(_0x1be62d){_0x29dd5d[_0x49c4('0x36')]=0x0;_0x29dd5d[_0x49c4('0x37')]=0x0;_0x29dd5d[_0x49c4('0x38')]=0x0;_0x29dd5d[_0x49c4('0x39')]=0x0;_0x29dd5d[_0x49c4('0x3a')]=0x0;_0x29dd5d[_0x49c4('0x3b')]=0x0;if(!_0x29dd5d['closed']&&!_0x29dd5d[_0x49c4('0x3c')]){_0x29dd5d['waiting']+=0x1;}if(!_0x29dd5d[_0x49c4('0x3d')]&&_0x29dd5d[_0x49c4('0x3c')]){_0x29dd5d[_0x49c4('0x37')]+=0x1;if(_0x29dd5d[_0x49c4('0x36')]){_0x29dd5d[_0x49c4('0x36')]-=0x1;}}if(_0x29dd5d[_0x49c4('0x3d')]&&_0x29dd5d['disposition']==='abandoned'){_0x29dd5d[_0x49c4('0x3a')]+=0x1;if(_0x29dd5d[_0x49c4('0x36')]){_0x29dd5d[_0x49c4('0x36')]-=0x1;}}else if(_0x29dd5d[_0x49c4('0x3d')]&&!_0x29dd5d['UserId']&&_0x29dd5d[_0x49c4('0x3e')]){_0x29dd5d[_0x49c4('0x39')]+=0x1;if(_0x29dd5d[_0x49c4('0x36')]){_0x29dd5d[_0x49c4('0x36')]-=0x1;}}else if(_0x29dd5d[_0x49c4('0x3d')]&&_0x29dd5d[_0x49c4('0x3c')]){_0x29dd5d[_0x49c4('0x38')]+=0x1;if(_0x29dd5d[_0x49c4('0x37')]){_0x29dd5d[_0x49c4('0x37')]-=0x1;}}_0x29dd5d['total']+=0x1;_0x1be62d(_0x29dd5d);});}exports[_0x49c4('0x3f')]=function(_0x4d27d0,_0x33696e){var _0x628423={},_0x301def={},_0x258abe={'count':0x0,'rows':[]};var _0x2d93d8=_['map'](db[_0x49c4('0x40')][_0x49c4('0x41')],function(_0x384862){return{'name':_0x384862[_0x49c4('0x42')],'type':_0x384862[_0x49c4('0x43')][_0x49c4('0x44')]};});_0x301def[_0x49c4('0x45')]=_['map'](_0x2d93d8,_0x49c4('0x28'));_0x301def['query']=_[_0x49c4('0x46')](_0x4d27d0[_0x49c4('0x47')]);_0x301def[_0x49c4('0x48')]=_[_0x49c4('0x49')](_0x301def[_0x49c4('0x45')],_0x301def[_0x49c4('0x47')]);_0x628423[_0x49c4('0x4a')]=_['intersection'](_0x301def[_0x49c4('0x45')],qs[_0x49c4('0x4b')](_0x4d27d0['query'][_0x49c4('0x4b')]));_0x628423[_0x49c4('0x4a')]=_0x628423[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x628423['attributes']:_0x301def['model'];if(!_0x4d27d0[_0x49c4('0x47')]['hasOwnProperty'](_0x49c4('0x4d'))){_0x628423[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x24')]);_0x628423[_0x49c4('0x21')]=qs[_0x49c4('0x21')](_0x4d27d0['query'][_0x49c4('0x21')]);}_0x628423[_0x49c4('0x4e')]=qs[_0x49c4('0x4f')](_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x4f')]);_0x628423[_0x49c4('0x50')]=qs[_0x49c4('0x48')](_[_0x49c4('0x51')](_0x4d27d0[_0x49c4('0x47')],_0x301def[_0x49c4('0x48')]),_0x2d93d8);var _0x5b822f=[];var _0x5e63f0=squel[_0x49c4('0x52')]()[_0x49c4('0x53')]('id')['field']('name')[_0x49c4('0x53')]('color')['from'](_0x49c4('0x54'));var _0x4081a5=squel[_0x49c4('0x52')]()[_0x49c4('0x53')](_0x49c4('0x55'))[_0x49c4('0x53')](_0x49c4('0x56'))['field'](_0x49c4('0x57'))[_0x49c4('0x58')](_0x49c4('0x59'),'ui')[_0x49c4('0x5a')](_0x49c4('0x5b'),'u',_0x49c4('0x5c'));var _0x5d24f3=squel['select']()[_0x49c4('0x58')](_0x49c4('0x5d'),'i')[_0x49c4('0x5a')](_0x49c4('0x5e'),'c',_0x49c4('0x5f'))[_0x49c4('0x5a')](_0x49c4('0x5b'),'o','o.id\x20=\x20i.UserId')[_0x49c4('0x5a')](_0x49c4('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x49c4('0x5a')]('chat_messages','me',_0x49c4('0x61'))[_0x49c4('0x5a')](_0x49c4('0x62'),'it',_0x49c4('0x63'))[_0x49c4('0x5a')](_0x49c4('0x54'),'t',_0x49c4('0x64'));var _0x2f520f=squel['expr']();var _0x3894e0=[];var _0x27b9c2=squel['expr']();var _0x10dec7;if(_0x4d27d0[_0x49c4('0x47')]['search']){_0x10dec7=as[_0x49c4('0x65')](_0x4d27d0[_0x49c4('0x47')]['search']);var _0x4dc54d=_0x10dec7['sqlOperator'];for(var _0x513879=0x0;_0x513879<_0x10dec7[_0x49c4('0x66')]['length'];_0x513879++){var _0xb20a5d=_0x10dec7[_0x49c4('0x66')][_0x513879];var _0x515240='i';var _0x679134=_[_0x49c4('0x67')](_0x2d93d8,['name',_0xb20a5d[_0x49c4('0x53')]]);if(!_0x679134){switch(_0xb20a5d[_0x49c4('0x53')]){case _0x49c4('0x68'):if(_0xb20a5d[_0x49c4('0x69')]==0x1){_0x5d24f3['having']('`'+_0xb20a5d[_0x49c4('0x53')]+_0x49c4('0x6a'));}else{_0x5d24f3[_0x49c4('0x6b')]('`'+_0xb20a5d[_0x49c4('0x53')]+'`\x20>\x200');}break;case _0x49c4('0x6c'):if(_0xb20a5d['operator']==='$substring'){if(_0xb20a5d['value']['split']('\x20')[_0x49c4('0x4c')]>0x1){_0x2f520f[_0x4dc54d](_0x49c4('0x6d'),qs[_0x49c4('0x6e')](_0xb20a5d[_0x49c4('0x69')]),null);}else{var _0x5b056e='%'+_0xb20a5d['value']+'%';_0x2f520f[_0x4dc54d](_0x49c4('0x6f'),_0x5b056e,_0x5b056e,_0x5b056e);}}else{_0x679134=_[_0x49c4('0x67')](_0x2d93d8,[_0x49c4('0x28'),_0x49c4('0x70')]);_0xb20a5d[_0x49c4('0x53')]=_0x49c4('0x70');_0x191afb=as[_0x49c4('0x71')](_0x515240,_0x679134[_0x49c4('0x43')],_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb['text'],_0x191afb[_0x49c4('0x69')]['start'],_0x191afb[_0x49c4('0x69')][_0x49c4('0x1f')]);}break;case _0x49c4('0x72'):var _0x1ea1b4=_0xb20a5d[_0x49c4('0x69')][_0x49c4('0x32')](',')[_0x49c4('0x30')](function(_0x3feb0b){return Number(_0x3feb0b);});_0x1ea1b4[_0x49c4('0x33')](function(_0x1743d0){_0x27b9c2['or'](_0x49c4('0x73'),'%,'+_0x1743d0+',%');});_0x3894e0=_[_0x49c4('0x74')](_0x3894e0,_0x1ea1b4);break;case _0x49c4('0x75'):if(_0xb20a5d[_0x49c4('0x76')]===_0x49c4('0x77')){_0x2f520f[_0x4dc54d](_0x49c4('0x78'),'%'+_0xb20a5d[_0x49c4('0x69')]+'%',null);}else{_0x679134=_[_0x49c4('0x67')](_0x2d93d8,['name','UserId']);_0xb20a5d[_0x49c4('0x53')]=_0x49c4('0x3c');_0x191afb=as['buildExpression'](_0x515240,_0x679134[_0x49c4('0x43')],_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb[_0x49c4('0x79')],_0x191afb[_0x49c4('0x69')][_0x49c4('0x7a')],_0x191afb['value']['end']);}break;case'body':_0x191afb=as[_0x49c4('0x71')]('me',null,_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb[_0x49c4('0x79')],_0x191afb[_0x49c4('0x69')][_0x49c4('0x7a')],_0x191afb[_0x49c4('0x69')][_0x49c4('0x1f')]);break;}}else{var _0x191afb=as[_0x49c4('0x71')](_0x515240,_0x679134[_0x49c4('0x43')],_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb['text'],_0x191afb[_0x49c4('0x69')][_0x49c4('0x7a')],_0x191afb[_0x49c4('0x69')]['end']);}}}else{var _0x4448b9=_(_0x4d27d0[_0x49c4('0x47')])[_0x49c4('0x46')]()[_0x49c4('0x30')](function(_0x1f25be){return _[_0x49c4('0x7b')](_0x2d93d8,[_0x49c4('0x28'),_0x1f25be])?_0x1f25be:undefined;})[_0x49c4('0x7c')]()['value']();if(!_[_0x49c4('0x7d')](_0x4448b9)){_0x4448b9[_0x49c4('0x33')](function(_0x85540f){if(_0x85540f===_0x49c4('0x7e')){_0x5d24f3[_0x49c4('0x50')]('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x4d27d0[_0x49c4('0x47')][_0x85540f]));}else if(_0x85540f==='createdAt'){var _0x34cf49=JSON['parse'](_0x4d27d0[_0x49c4('0x47')][_0x85540f])[_0x49c4('0x7f')];var _0x3b03dd=JSON[_0x49c4('0x80')](_0x4d27d0['query'][_0x85540f])[_0x49c4('0x81')];_0x5d24f3[_0x49c4('0x50')](_0x49c4('0x82'),_0x34cf49,_0x3b03dd);}else{if(_0x4d27d0[_0x49c4('0x47')][_0x85540f]===_0x49c4('0x83')){_0x5d24f3[_0x49c4('0x50')]('i.'+_0x85540f+_0x49c4('0x84'));}else{_0x5d24f3[_0x49c4('0x50')]('i.'+_0x85540f+_0x49c4('0x85'),_0x4d27d0[_0x49c4('0x47')][_0x85540f]);}}});}if(_0x4d27d0['query'][_0x49c4('0x86')]){if(_0x4d27d0[_0x49c4('0x47')]['read']==0x1){_0x5d24f3[_0x49c4('0x6b')]('`unreadMessages`\x20=\x200');}else{_0x5d24f3[_0x49c4('0x6b')](_0x49c4('0x87'));}}if(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x88')]){_0x3894e0=_[_0x49c4('0x89')](_0x4d27d0['query'][_0x49c4('0x88')])?_0x4d27d0[_0x49c4('0x47')]['tag']:new Array(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x88')]);_0x3894e0['forEach'](function(_0xbd12b9){_0x27b9c2['or'](_0x49c4('0x73'),'%,'+_0xbd12b9+',%');});}if(_0x4d27d0['query'][_0x49c4('0x8a')]){var _0x993d00=_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x8a')]['replace']('\x5c','\x5c\x5c')[_0x49c4('0x8b')](/'/g,'\x27\x27');if(qs[_0x49c4('0x8c')](_0x993d00)){_0x2f520f['or']('i.id\x20LIKE\x20?',_0x993d00+'%');}else{_0x2f520f['or'](_0x49c4('0x8d'),qs['getFullTextValue'](_0x993d00))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x993d00+'%');}}}_0x5d24f3[_0x49c4('0x50')](_0x2f520f);_0x5d24f3['group']('i.id');var _0x39cacf={'type':db[_0x49c4('0x8e')]['QueryTypes'][_0x49c4('0x8f')],'raw':!![]};var _0x5c3509=_0x5d24f3['clone']();_0x5c3509['field'](_0x49c4('0x90'));_0x5c3509[_0x49c4('0x53')](_0x49c4('0x91'),_0x49c4('0x68'));if(_0x628423['order']){_0x628423['order'][_0x49c4('0x33')](function(_0x48705c){var _0x2c560e=_0x48705c[0x0]==='contactName'?_0x48705c[0x0]:'i.'+_0x48705c[0x0];_0x5d24f3[_0x49c4('0x4e')](_0x2c560e,_0x48705c[0x1]===_0x49c4('0x92')?![]:!![]);});}if(!_[_0x49c4('0x7d')](_0x3894e0)){_0x5d24f3[_0x49c4('0x6b')](_0x27b9c2);_0x5c3509[_0x49c4('0x50')](_0x49c4('0x93'),_0x3894e0);}BPromise[_0x49c4('0x94')]()['then'](function(){if(!_0x10dec7){if(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x7e')])return;_0x5c3509[_0x49c4('0x50')](_0x49c4('0x95'));_0x5d24f3[_0x49c4('0x50')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x4d27d0[_0x49c4('0x96')][_0x49c4('0x97')]!==_0x49c4('0x98'))return;return _0x4d27d0['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x49c4('0x14')](function(_0x27b31d){if(_[_0x49c4('0x7d')](_0x27b31d)){_0x5c3509[_0x49c4('0x50')](_0x49c4('0x99'));_0x5d24f3['where'](_0x49c4('0x99'));}else{_0x5c3509[_0x49c4('0x50')](_0x49c4('0x9a'),_[_0x49c4('0x30')](_0x27b31d,'id'));_0x5d24f3['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x49c4('0x30')](_0x27b31d,'id'));}});})[_0x49c4('0x14')](function(){if(_0x4d27d0[_0x49c4('0x96')][_0x49c4('0x97')]===_0x49c4('0x98')&&!_0x10dec7&&!_0x4d27d0['query'][_0x49c4('0x7e')])return[];return db[_0x49c4('0x9b')][_0x49c4('0x47')](_0x5c3509[_0x49c4('0x9c')](),_0x39cacf);})[_0x49c4('0x14')](function(_0x8f37e5){_0x258abe['count']=_0x8f37e5[_0x49c4('0x4c')];if(_0x258abe[_0x49c4('0x23')]===0x0)return[];return db[_0x49c4('0x9b')][_0x49c4('0x47')](_0x5e63f0['toString'](),_0x39cacf)['then'](function(_0xa96f53){_0x5b822f=_['keyBy'](_0xa96f53,'id');_0x39cacf=_[_0x49c4('0x2a')](_0x39cacf,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x4b')]){_0x628423[_0x49c4('0x4a')][_0x49c4('0x33')](function(_0x4eebc9){_0x5d24f3['field']('i.'+_0x4eebc9);});}else{_0x5d24f3[_0x49c4('0x53')](_0x49c4('0x91'),_0x49c4('0x68'));_0x5d24f3['field']('a.key',_0x49c4('0x9d'));_0x5d24f3['field']('a.mandatoryDisposition',_0x49c4('0x9e'));_0x5d24f3['field'](_0x49c4('0x9f'),_0x49c4('0xa0'));_0x5d24f3['field'](_0x49c4('0xa1'));_0x5d24f3[_0x49c4('0x53')]('c.firstName','Contact.firstName');_0x5d24f3[_0x49c4('0x53')]('c.lastName',_0x49c4('0xa2'));_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xa3'),_0x49c4('0xa4'));_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xa5'),_0x49c4('0xa6'));_0x5d24f3['field'](_0x49c4('0xa7'),_0x49c4('0xa8'));_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xa9'),_0x49c4('0xaa'));_0x5d24f3['field'](_0x49c4('0xab'),'Owner.fullname');_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xac'),_0x49c4('0xad'));_0x5d24f3[_0x49c4('0x53')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x49c4('0x31'));}if(_0x628423[_0x49c4('0x24')])_0x5d24f3[_0x49c4('0x24')](_0x628423[_0x49c4('0x24')]);if(_0x628423[_0x49c4('0x21')])_0x5d24f3[_0x49c4('0x21')](_0x628423['offset']);return db[_0x49c4('0x9b')]['query'](_0x5d24f3[_0x49c4('0x9c')](),_0x39cacf);})[_0x49c4('0x14')](function(_0x1db53d){if(_0x1db53d[_0x49c4('0x4c')]>0x0)_0x4081a5['where'](_0x49c4('0xae'),_[_0x49c4('0x30')](_0x1db53d,'id'));return db['sequelize'][_0x49c4('0x47')](_0x4081a5[_0x49c4('0x9c')](),_0x39cacf)['then'](function(_0x562f47){var _0x25f1c7=_[_0x49c4('0xaf')](_0x562f47,_0x49c4('0xb0'));var _0x1aa3a3=[];_0x1db53d[_0x49c4('0x33')](function(_0x15e403){_0x1aa3a3[_0x49c4('0x35')](updateChatInteraction(_0x15e403,_0x5b822f,_0x25f1c7));});return BPromise[_0x49c4('0xb1')](_0x1aa3a3);});});})[_0x49c4('0x14')](function(_0x117c64){_0x258abe[_0x49c4('0xb2')]=_0x117c64;return _0x258abe;})['then'](respondWithFilteredResult(_0x33696e,_0x628423))['catch'](handleError(_0x33696e,null));};exports[_0x49c4('0xb3')]=function(_0x1e286e,_0xccdf6d){var _0x5be042={'raw':![],'where':{'id':_0x1e286e[_0x49c4('0xb4')]['id']}},_0x1276bf={};_0x1276bf['model']=_[_0x49c4('0x46')](db['ChatInteraction'][_0x49c4('0x41')]);_0x1276bf[_0x49c4('0x47')]=_[_0x49c4('0x46')](_0x1e286e[_0x49c4('0x47')]);_0x1276bf['filters']=_[_0x49c4('0x49')](_0x1276bf[_0x49c4('0x45')],_0x1276bf[_0x49c4('0x47')]);_0x5be042[_0x49c4('0x4a')]=_[_0x49c4('0x49')](_0x1276bf['model'],qs['fields'](_0x1e286e['query'][_0x49c4('0x4b')]));_0x5be042[_0x49c4('0x4a')]=_0x5be042[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x5be042[_0x49c4('0x4a')]:_0x1276bf['model'];if(_0x1e286e[_0x49c4('0x47')][_0x49c4('0xb5')]){_0x5be042[_0x49c4('0xb6')]=[{'all':!![]}];}_0x5be042=_[_0x49c4('0x2a')]({},_0x5be042,_0x1e286e['options']);return db[_0x49c4('0x40')][_0x49c4('0x67')](_0x5be042)[_0x49c4('0x14')](handleEntityNotFound(_0xccdf6d,null))[_0x49c4('0x14')](respondWithResult(_0xccdf6d,null))[_0x49c4('0x1d')](handleError(_0xccdf6d,null));};exports['create']=function(_0x1d9e1a,_0x9b622d){return db[_0x49c4('0x40')]['create'](_0x1d9e1a[_0x49c4('0x2b')],{})[_0x49c4('0x14')](respondWithResult(_0x9b622d,0xc9))[_0x49c4('0x1d')](handleError(_0x9b622d,null));};exports['update']=function(_0x97f579,_0x491231){if(_0x97f579['body']['id']){delete _0x97f579[_0x49c4('0x2b')]['id'];}return db[_0x49c4('0x40')]['find']({'where':{'id':_0x97f579[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x491231,null))[_0x49c4('0x14')](saveUpdates(_0x97f579[_0x49c4('0x2b')],null))[_0x49c4('0x14')](respondWithResult(_0x491231,null))[_0x49c4('0x1d')](handleError(_0x491231,null));};exports[_0x49c4('0xb7')]=function(_0x219133,_0x59dbef){return db['ChatInteraction'][_0x49c4('0x67')]({'where':{'id':_0x219133[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x59dbef,null))['then'](removeEntity(_0x59dbef,null))['catch'](handleError(_0x59dbef,null));};exports[_0x49c4('0xb8')]=function(_0x3222ec,_0xd979f7){return db[_0x49c4('0x40')][_0x49c4('0xb8')]()[_0x49c4('0x14')](respondWithResult(_0xd979f7,null))[_0x49c4('0x1d')](handleError(_0xd979f7,null));};exports[_0x49c4('0xb9')]=function(_0x318008,_0x1e2dd3){var _0xa42e74=_0x318008[_0x49c4('0xb4')]['id'];var _0x352b67;var _0xbfb25b;var _0x4cc855;return db[_0x49c4('0x40')][_0x49c4('0xba')]({'where':{'id':_0xa42e74}})[_0x49c4('0x14')](function(_0x318aaf){_0x352b67=_0x318aaf;return db['ChatWebsite']['findOne']({'where':{'id':_0x318aaf[_0x49c4('0x7e')]},'attributes':['id','vidaooApiKey',_0x49c4('0xbb'),_0x49c4('0xbc'),_0x49c4('0xbd'),_0x49c4('0xbe')],'raw':!![]});})[_0x49c4('0x14')](function(_0x45a2ef){if(_0x45a2ef&&_0x45a2ef[_0x49c4('0xbf')]&&_0x45a2ef[_0x49c4('0xbb')]){_0xbfb25b=_0x45a2ef;var _0x31ba95={'interaction':{'id':_0xa42e74},'agent':{'id':_0x318008[_0x49c4('0x96')]['id'],'name':_0x318008[_0x49c4('0x96')][_0x49c4('0x28')],'fullname':_0x318008['user'][_0x49c4('0xc0')],'email':_0x318008[_0x49c4('0x96')][_0x49c4('0xc1')]},'contact':_0x318008['body'][_0x49c4('0x2c')],'account':_0x318008['body'][_0x49c4('0x2e')]};var _0x82925={'rejectUnauthorized':![],'method':_0x49c4('0xc2'),'url':_0x49c4('0xc3'),'headers':{'X-APIKEY':_0x45a2ef['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x318008[_0x49c4('0x96')]['email']],'buttons':null,'topic':_0xbfb25b['vidaooTopic'],'note':_[_0x49c4('0xc4')](_0xbfb25b[_0x49c4('0xbd')])?null:getMustacheRender(_0xbfb25b[_0x49c4('0xbd')],_0x31ba95),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0xbfb25b[_0x49c4('0xbe')])){var _0x1221de=getMustacheRender(_0xbfb25b[_0x49c4('0xbe')],_0x31ba95);var _0x330512=JSON[_0x49c4('0x80')](_0x1221de);_0x82925[_0x49c4('0x2b')][_0x49c4('0xc5')]=_0x330512;}}catch(_0x19f30b){throw new db[(_0x49c4('0x8e'))]['ValidationError'](_0x49c4('0xc6'));}return rp(_0x82925);}else{throw new db[(_0x49c4('0x8e'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x49c4('0x14')](function(_0x4d5481){_0x4cc855=_0x4d5481;if(_0x4cc855['id']){var _0xefec38={'body':_0x4cc855['join_url'],'ChatWebsiteId':_0xbfb25b['id'],'ChatInteractionId':_0x352b67['id'],'direction':_0x49c4('0xc7'),'UserId':_0x318008['user']['id']};return db[_0x49c4('0xc8')][_0x49c4('0xc9')](_0xefec38,{});}else{throw new db[(_0x49c4('0x8e'))][(_0x49c4('0xca'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x352b67[_0x49c4('0xcb')]({'vidaooSessionId':_0x4cc855['id']});})[_0x49c4('0x14')](respondWithResult(_0x1e2dd3,null))[_0x49c4('0x1d')](handleError(_0x1e2dd3,null));};exports['customUpdate']=function(_0x367d3d,_0x1814c4){if(_0x367d3d['body']['id']){delete _0x367d3d['body']['id'];}return db[_0x49c4('0x40')][_0x49c4('0x67')]({'where':{'id':_0x367d3d[_0x49c4('0xb4')]['id']},'include':[{'model':db['CmContact'],'as':_0x49c4('0x6c')}]})[_0x49c4('0x14')](handleEntityNotFound(_0x1814c4,null))[_0x49c4('0x14')](saveUpdates(_0x367d3d[_0x49c4('0x2b')],null))['then'](respondWithResult(_0x1814c4,null))[_0x49c4('0x1d')](handleError(_0x1814c4,null));};exports['abandon']=function(_0x4d0a28,_0xf5f718){if(_0x4d0a28[_0x49c4('0x2b')]['id']){delete _0x4d0a28[_0x49c4('0x2b')]['id'];}return db[_0x49c4('0x40')]['find']({'where':{'id':_0x4d0a28[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](function(_0xa6f48){if(!_0xa6f48){logger[_0x49c4('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x49c4('0xcc'),0x194,'entity\x20not\x20found');_0xf5f718['sendStatus'](0x194);}else{if(_0xa6f48[_0x49c4('0x3c')]){throw new db[(_0x49c4('0x8e'))][(_0x49c4('0xca'))]('Interaction\x20already\x20assigned');}}return _0xa6f48;})[_0x49c4('0x14')](function(_0x4a874a){if(_0x4a874a){return _0x4a874a[_0x49c4('0x27')]({'closed':_0x4d0a28[_0x49c4('0x2b')][_0x49c4('0x3d')],'disposition':_0x4d0a28[_0x49c4('0x2b')][_0x49c4('0x3e')]})[_0x49c4('0x14')](function(_0x2b31ac){return _0x2b31ac;});}})['then'](function(){return respondWithRpcPromise(_0x49c4('0xcd'),_0x49c4('0xcc'),_0x4d0a28[_0x49c4('0x2b')],client9004);})[_0x49c4('0x14')](respondWithResult(_0xf5f718,null))['catch'](handleError(_0xf5f718,null));};exports['attachmentUpload']=function(_0x4c15ff,_0x2d4f8a){_0x4c15ff[_0x49c4('0x2b')][_0x49c4('0x28')]=_0x4c15ff[_0x49c4('0xce')][_0x49c4('0xcf')];_0x4c15ff[_0x49c4('0x2b')][_0x49c4('0xd0')]=_0x4c15ff['file'][_0x49c4('0xd1')];_0x4c15ff[_0x49c4('0x2b')]['type']=_0x4c15ff['file']['mimetype'];return db[_0x49c4('0xd2')][_0x49c4('0xc9')](_0x4c15ff[_0x49c4('0x2b')])[_0x49c4('0x14')](respondWithResult(_0x2d4f8a,0xc9))[_0x49c4('0x1d')](handleError(_0x2d4f8a,null));};exports[_0x49c4('0xd3')]=function(_0x2f36c6,_0x5039fc){return db[_0x49c4('0x40')][_0x49c4('0xba')]({'where':{'id':_0x2f36c6[_0x49c4('0xb4')]['id']},'raw':!![]})[_0x49c4('0x14')](handleEntityNotFound(_0x5039fc,null))['then'](function(_0x3440ad){if(_0x3440ad){if(_0x3440ad[_0x49c4('0x3d')]){return _0x5039fc[_0x49c4('0x1e')](0x193)[_0x49c4('0x20')]({'status':0x193,'message':_0x49c4('0xd4')});}return db['Attachment'][_0x49c4('0xba')]({'where':{'id':_0x2f36c6['query']['attachId']},'raw':!![]})[_0x49c4('0x14')](handleEntityNotFound(_0x5039fc,null));}})[_0x49c4('0x14')](function(_0x113beb){if(_0x113beb){var _0x35289f=_0x113beb[_0x49c4('0xd5')]!==null;var _0x5b9591=path[_0x49c4('0xd6')](config[_0x49c4('0xd7')],_0x49c4('0xd8'));if(_0x35289f){_0x5b9591=path['join'](_0x5b9591,_0x49c4('0xd9'));}var _0x45c34a=path['join'](_0x5b9591,_0x113beb[_0x49c4('0xd0')]);return _0x5039fc[_0x49c4('0xda')](_0x45c34a);}})[_0x49c4('0x1d')](handleError(_0x5039fc,null));};exports[_0x49c4('0xdb')]=function(_0x2ef538,_0x163128){var _0x1679ca=null;var _0x4b0114=null;var _0x261d61=null;if(_0x2ef538[_0x49c4('0x2b')]['id']){delete _0x2ef538[_0x49c4('0x2b')]['id'];}if(_0x2ef538[_0x49c4('0x2b')][_0x49c4('0xdc')]){_0x261d61=path['join'](config[_0x49c4('0xd7')],_0x49c4('0xdd'),util[_0x49c4('0xde')](_0x49c4('0xdf'),Date[_0x49c4('0xe0')]()));_0x2ef538['body'][_0x49c4('0xe1')]=_0x261d61;}return db[_0x49c4('0x40')][_0x49c4('0x67')]({'where':{'id':_0x2ef538[_0x49c4('0xb4')]['id']},'include':[{'model':db[_0x49c4('0xc8')],'as':_0x49c4('0xe2'),'include':[{'model':db[_0x49c4('0x75')],'as':_0x49c4('0x75')}]}]})[_0x49c4('0x14')](handleEntityNotFound(_0x163128,null))[_0x49c4('0x14')](saveUpdates(_0x2ef538['body'],null))[_0x49c4('0x14')](function(_0x1b6966){if(_0x1b6966){_0x1679ca=_0x1b6966;return db[_0x49c4('0xe3')][_0x49c4('0x67')]({'where':{'id':_0x1679ca[_0x49c4('0x7e')]}});}})['then'](function(_0x501786){if(_0x501786){_0x4b0114=_0x501786;return db[_0x49c4('0xe4')][_0x49c4('0x67')]({'where':{'id':_0x1679ca[_0x49c4('0x70')]}});}})[_0x49c4('0x14')](function(_0xd87f7e){if(_0xd87f7e){if(_0x261d61){var _0x25d2a1=null;for(var _0x58d24f=0x1;_0x58d24f<_0x1679ca[_0x49c4('0xe2')][_0x49c4('0x4c')];++_0x58d24f){_0x25d2a1=_0x1679ca['Messages'][_0x58d24f];var _0x386595=_0x25d2a1['UserId']?util[_0x49c4('0xde')](_0x49c4('0xe5'),_0x4b0114[_0x49c4('0xe6')],_0x25d2a1['UserId']):_0x49c4('0xe7');var _0x4f431e=_0x2ef538[_0x49c4('0x2b')]['customer']||util['format'](_0x49c4('0xe5'),_0x49c4('0xe8'),_0x25d2a1[_0x49c4('0x70')]);switch(_0x4b0114[_0x49c4('0xe9')]){case _0x49c4('0xea'):_0x386595=_0x25d2a1[_0x49c4('0x3c')]?util['format']('%s%d',_0x4b0114[_0x49c4('0xe6')],_0x25d2a1[_0x49c4('0x3c')]):_0x49c4('0xe7');break;case _0x49c4('0xeb'):_0x386595=_0x25d2a1[_0x49c4('0x3c')]?_0x25d2a1[_0x49c4('0x75')][_0x49c4('0xec')]||_0x25d2a1['User']['fullname']:'System';break;case'agent_fullname':_0x386595=_0x25d2a1[_0x49c4('0x3c')]?_0x25d2a1['User'][_0x49c4('0xc0')]:_0x49c4('0xe7');break;default:_0x386595=_0x25d2a1[_0x49c4('0x3c')]?util['format']('%s%d',_0x4b0114[_0x49c4('0xe6')],_0x25d2a1[_0x49c4('0x3c')]):'System';}var _0x4323ec=util[_0x49c4('0xde')](_0x49c4('0xed'),moment(_0x25d2a1[_0x49c4('0xee')])[_0x49c4('0xde')](_0x49c4('0xef')),_0x25d2a1['direction']==='in'?_0x4f431e:_0x386595,_0x25d2a1[_0x49c4('0x2b')]);if(!_0x25d2a1[_0x49c4('0xf0')]){fs[_0x49c4('0xf1')](_0x261d61,_0x4323ec);}}return db['MailAccount'][_0x49c4('0xba')]({'where':{'service':!![]},'include':[{'model':db[_0x49c4('0xf2')],'as':_0x49c4('0xf3'),'raw':!![],'include':[{'model':db[_0x49c4('0xf4')],'as':_0x49c4('0xf4'),'raw':!![]}]}]});}}})[_0x49c4('0x14')](function(_0x82c4bf){if(!_0x82c4bf||!_0x82c4bf[_0x49c4('0xf3')]||!_0x2ef538['body'])return _0x1679ca;var _0x2fc500=_0x82c4bf[_0x49c4('0xf5')]();return respondWithRpcPromise(_0x49c4('0xf6'),_0x49c4('0xf7'),{'account':_0x2fc500,'message':{'from':util[_0x49c4('0xde')](_0x49c4('0xf8'),_0x82c4bf['name'],_0x82c4bf[_0x49c4('0xc1')]||_0x82c4bf[_0x49c4('0xf3')][_0x49c4('0x96')]),'to':_0x2ef538[_0x49c4('0x2b')][_0x49c4('0xdc')],'subject':_0x49c4('0xf9'),'text':util[_0x49c4('0xde')](_0x49c4('0xfa'),_0x2ef538[_0x49c4('0x2b')][_0x49c4('0xdc')]),'attachments':[{'path':_0x261d61}]}})[_0x49c4('0x14')](function(){return _0x1679ca;})[_0x49c4('0x1d')](function(_0x471e28){logger[_0x49c4('0x1a')](_0x471e28);});})['then'](respondWithStatusCode(_0x163128,0xc8))['catch'](handleError(_0x163128,null));};exports[_0x49c4('0xfb')]=function(_0x3b6fd2,_0x4c07b3){return db['ChatMessage'][_0x49c4('0x67')]({'where':{'id':_0x3b6fd2['params']['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x4c07b3,null))[_0x49c4('0x14')](function(_0x1ac2c0){if(_0x1ac2c0){return _0x1ac2c0[_0x49c4('0xfb')](_0x3b6fd2[_0x49c4('0x2b')][_0x49c4('0xfc')],_[_0x49c4('0xfd')](_0x3b6fd2[_0x49c4('0x2b')],['ids','id'])||{});}})[_0x49c4('0x14')](respondWithResult(_0x4c07b3,null))[_0x49c4('0x1d')](handleError(_0x4c07b3,null));};exports[_0x49c4('0xfe')]=function(_0xd2ee5e,_0x201909){var _0x5b2cc8={'raw':![],'where':{}};var _0x2bfa4f={};var _0x2b507f={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x49c4('0xba')]({'where':{'id':_0xd2ee5e[_0x49c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0x201909,null))[_0x49c4('0x14')](function(_0x3119a5){if(_0x3119a5){_0x2bfa4f[_0x49c4('0x45')]=_['keys'](db[_0x49c4('0xc8')][_0x49c4('0x41')]);_0x2bfa4f[_0x49c4('0x47')]=_[_0x49c4('0x46')](_0xd2ee5e['query']);_0x2bfa4f[_0x49c4('0x48')]=_['intersection'](_0x2bfa4f[_0x49c4('0x45')],_0x2bfa4f[_0x49c4('0x47')]);_0x5b2cc8[_0x49c4('0x4a')]=_[_0x49c4('0x49')](_0x2bfa4f['model'],qs[_0x49c4('0x4b')](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x4b')]));_0x5b2cc8[_0x49c4('0x4a')]=_0x5b2cc8[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x5b2cc8['attributes']:_0x2bfa4f['model'];if(!_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0xff')](_0x49c4('0x4d'))){_0x5b2cc8[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x24')]);_0x5b2cc8[_0x49c4('0x21')]=qs[_0x49c4('0x21')](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x21')]);}_0x5b2cc8[_0x49c4('0x4e')]=qs['sort'](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x4f')]);_0x5b2cc8['where']=qs[_0x49c4('0x48')](_['pick'](_0xd2ee5e[_0x49c4('0x47')],_0x2bfa4f[_0x49c4('0x48')]));_0x5b2cc8['where'][_0x49c4('0xb0')]=_0x3119a5['id'];if(_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x8a')]){_0x5b2cc8[_0x49c4('0x50')]=_[_0x49c4('0x2a')](_0x5b2cc8['where'],{'$or':_[_0x49c4('0x30')](_0x5b2cc8['attributes'],function(_0x1c74ce){var _0x216896={};_0x216896[_0x1c74ce]={'$like':'%'+_0xd2ee5e[_0x49c4('0x47')]['filter']+'%'};return _0x216896;})});}if(_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x7f')]){var _0x37ec56=_0xd2ee5e['query']['$gte'][_0x49c4('0x32')](',');var _0x590586={};_0x590586[_0x37ec56[0x0]]={'$gte':moment(_0x37ec56[0x1])[_0x49c4('0xde')](_0x49c4('0x100'))};_0x5b2cc8[_0x49c4('0x50')]=_[_0x49c4('0x2a')](_0x5b2cc8['where'],_0x590586);}_0x5b2cc8=_['merge']({},_0x5b2cc8,_0xd2ee5e['options']);return db[_0x49c4('0xc8')][_0x49c4('0x23')]({'where':_0x5b2cc8[_0x49c4('0x50')]})[_0x49c4('0x14')](function(_0x5255f7){_0x2b507f[_0x49c4('0x23')]=_0x5255f7;if(_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0xb5')]){_0x5b2cc8[_0x49c4('0xb6')]=[{'all':!![]}];}return db[_0x49c4('0xc8')][_0x49c4('0x101')](_0x5b2cc8);})[_0x49c4('0x14')](function(_0x1d2931){_0x2b507f[_0x49c4('0xb2')]=_0x1d2931;return _0x2b507f;});}})[_0x49c4('0x14')](respondWithFilteredResult(_0x201909,_0x5b2cc8))[_0x49c4('0x1d')](handleError(_0x201909,null));};exports['getMyMessages']=function(_0x16e808,_0x514446){var _0x3308c4={'where':{}},_0x3683d7={},_0x4feb6f={'count':0x0,'rows':[]};return db[_0x49c4('0x40')]['findOne']({'where':{'id':_0x16e808[_0x49c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0x514446,null))['then'](function(_0x577ae6){if(_0x577ae6){_0x3683d7[_0x49c4('0x45')]=_[_0x49c4('0x46')](db[_0x49c4('0xc8')]['rawAttributes']);_0x3683d7[_0x49c4('0x47')]=_['keys'](_0x16e808[_0x49c4('0x47')]);_0x3683d7[_0x49c4('0x48')]=_[_0x49c4('0x49')](_0x3683d7['model'],_0x3683d7[_0x49c4('0x47')]);_0x3308c4[_0x49c4('0x4a')]=_[_0x49c4('0x49')](_0x3683d7[_0x49c4('0x45')],qs[_0x49c4('0x4b')](_0x16e808['query'][_0x49c4('0x4b')]));_0x3308c4[_0x49c4('0x4a')]=_0x3308c4[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x3308c4['attributes']:_0x3683d7['model'];if(!_0x16e808[_0x49c4('0x47')][_0x49c4('0xff')]('nolimit')){_0x3308c4[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0x16e808[_0x49c4('0x47')][_0x49c4('0x24')]);_0x3308c4['offset']=qs[_0x49c4('0x21')](_0x16e808[_0x49c4('0x47')]['offset']);}_0x3308c4['order']=qs[_0x49c4('0x4f')](_0x16e808[_0x49c4('0x47')][_0x49c4('0x4f')]);_0x3308c4[_0x49c4('0x50')]=qs[_0x49c4('0x48')](_['pick'](_0x16e808[_0x49c4('0x47')],_0x3683d7['filters']));_0x3308c4[_0x49c4('0x50')][_0x49c4('0xb0')]=_0x577ae6['id'];if(_0x16e808[_0x49c4('0x47')][_0x49c4('0x8a')]){_0x3308c4['where']=_['merge'](_0x3308c4['where'],{'$or':_[_0x49c4('0x30')](_0x3308c4[_0x49c4('0x4a')],function(_0x14d5ca){var _0x2cb936={};_0x2cb936[_0x14d5ca]={'$like':'%'+_0x16e808['query']['filter']+'%'};return _0x2cb936;})});}_0x3308c4[_0x49c4('0x50')]['secret']=![];if(_0x16e808[_0x49c4('0x47')]['id']){_0x3308c4[_0x49c4('0x50')]['id']={'$gt':_0x16e808['query']['id']};}_0x3308c4=_[_0x49c4('0x2a')]({},_0x3308c4,_0x16e808[_0x49c4('0x102')]);return db[_0x49c4('0xc8')]['count']({'where':_0x3308c4[_0x49c4('0x50')]})[_0x49c4('0x14')](function(_0x1a5755){_0x4feb6f['count']=_0x1a5755;_0x3308c4[_0x49c4('0xb6')]=[];if(_0x16e808[_0x49c4('0x47')]['includeAgent']){_0x3308c4[_0x49c4('0xb6')][_0x49c4('0x35')]({'model':db['User'],'as':_0x49c4('0x75'),'attributes':['id',_0x49c4('0xc0'),_0x49c4('0xec')]});}if(_0x16e808[_0x49c4('0x47')][_0x49c4('0xb5')]){_0x3308c4['include']=[{'all':!![]}];}return db[_0x49c4('0xc8')][_0x49c4('0x101')](_0x3308c4);})['then'](function(_0x5a4b35){_0x4feb6f[_0x49c4('0xb2')]=_0x5a4b35;return _0x4feb6f;});}})[_0x49c4('0x14')](respondWithFilteredResult(_0x514446,_0x3308c4))['catch'](handleError(_0x514446,null));};exports[_0x49c4('0x103')]=function(_0x55bb71,_0x4059b0){return db[_0x49c4('0x40')]['find']({'where':{'id':_0x55bb71[_0x49c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0x4059b0,null))[_0x49c4('0x14')](function(_0x17ab2c){if(_0x17ab2c){return _0x17ab2c['setTags'](_0x55bb71[_0x49c4('0x2b')][_0x49c4('0xfc')],_['omit'](_0x55bb71['body'],[_0x49c4('0xfc'),'id'])||{})[_0x49c4('0x104')](function(){return db[_0x49c4('0x72')][_0x49c4('0x101')]({'attributes':['id',_0x49c4('0x28'),'color'],'where':{'id':_0x55bb71[_0x49c4('0x2b')][_0x49c4('0xfc')]}});})[_0x49c4('0x14')](function(_0xd62ca){socket[_0x49c4('0x105')]('chatInteractionTags:save',{'id':Number(_0x55bb71[_0x49c4('0xb4')]['id']),'tags':_0xd62ca||[]});return{'id':Number(_0x55bb71[_0x49c4('0xb4')]['id']),'tags':_0xd62ca||[]};});}})[_0x49c4('0x14')](respondWithResult(_0x4059b0,null))[_0x49c4('0x1d')](handleError(_0x4059b0,null));};exports[_0x49c4('0x106')]=function(_0x39abbf,_0x3de5d8){return db[_0x49c4('0x40')]['find']({'where':{'id':_0x39abbf[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x3de5d8,null))[_0x49c4('0x14')](function(_0x5a4b4c){if(_0x5a4b4c){return _0x5a4b4c['removeTags'](_0x39abbf[_0x49c4('0x47')]['ids']);}})[_0x49c4('0x14')](respondWithStatusCode(_0x3de5d8,null))[_0x49c4('0x1d')](handleError(_0x3de5d8,null));};exports[_0x49c4('0xda')]=function(_0x3f0e74,_0x55f423){var _0x3ce0f9=moment()[_0x49c4('0x107')]()[_0x49c4('0x9c')]();var _0x156a4f=path['join'](config[_0x49c4('0xd7')],_0x49c4('0x108'),'files',_0x49c4('0x109'));var _0x22005f=path[_0x49c4('0xd6')](config[_0x49c4('0xd7')],_0x49c4('0x108'),_0x49c4('0x10a'),_0x49c4('0x10b'));var _0x1d3b1a=path['join'](_0x156a4f,_0x3ce0f9);var _0x4eb6ba=util['format'](_0x49c4('0x10c'),_0x3f0e74[_0x49c4('0xb4')]['id'],_0x3ce0f9);var _0x418ead=path[_0x49c4('0xd6')](_0x156a4f,_0x4eb6ba);var _0x39ff8b=[];_0x39ff8b['push']({'model':db[_0x49c4('0x75')],'as':_0x49c4('0x75'),'attributes':['id',_0x49c4('0xc0')],'raw':!![]});_0x39ff8b[_0x49c4('0x35')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x49c4('0x10d'),_0x49c4('0x10e')],'raw':!![]});if(_0x3f0e74[_0x49c4('0x47')][_0x49c4('0x10b')]){_0x39ff8b[_0x49c4('0x35')]({'model':db[_0x49c4('0xd2')],'as':'Attachment','raw':!![]});}var _0x58a5c9=[{'model':db[_0x49c4('0xc8')],'as':_0x49c4('0xe2'),'attributes':['id',_0x49c4('0x2b'),_0x49c4('0xee'),_0x49c4('0x10f'),'secret',_0x49c4('0x86')],'include':_0x39ff8b}];_0x58a5c9[_0x49c4('0x35')]({'model':db[_0x49c4('0xe3')],'as':_0x49c4('0x110'),'attributes':['id',_0x49c4('0x28')]});_0x58a5c9[_0x49c4('0x35')]({'model':db[_0x49c4('0x75')],'as':_0x49c4('0x111'),'attributes':['id',_0x49c4('0xc0')]});return db['ChatInteraction'][_0x49c4('0x67')]({'where':{'id':_0x3f0e74[_0x49c4('0xb4')]['id']},'include':_0x58a5c9})[_0x49c4('0x14')](handleEntityNotFound(_0x55f423,null))[_0x49c4('0x14')](function(_0xe5bb64){if(_0xe5bb64){var _0x5e5ca3=_0xe5bb64[_0x49c4('0x112')]({'plain':!![]});fs[_0x49c4('0x113')](_0x1d3b1a);var _0x485c2d={'channel':_0x49c4('0x114'),'account':_0x5e5ca3['Account'][_0x49c4('0x28')],'agent':_0x5e5ca3['Owner']?_0x5e5ca3[_0x49c4('0x111')][_0x49c4('0xc0')]:'N.A.','createdAt':moment(_0x5e5ca3[_0x49c4('0xee')])['format'](_0x49c4('0x100'))[_0x49c4('0x9c')](),'closedAt':_0x5e5ca3[_0x49c4('0x3d')]?moment(_0x5e5ca3[_0x49c4('0x115')])[_0x49c4('0xde')]('YYYY-MM-DD\x20HH:mm:ss')[_0x49c4('0x9c')]():'','disposition':_0x5e5ca3[_0x49c4('0x3e')],'chatInfo':{'browser':_0x5e5ca3[_0x49c4('0x116')],'os':_0x5e5ca3[_0x49c4('0x117')],'referer':_0x5e5ca3[_0x49c4('0x118')],'customerIp':_0x5e5ca3[_0x49c4('0x119')],'customerPort':_0x5e5ca3[_0x49c4('0x11a')]?_0x5e5ca3[_0x49c4('0x11a')]:'N.A.'},'messages':_(_0x5e5ca3[_0x49c4('0xe2')])[_0x49c4('0x11b')]()[_0x49c4('0x8a')]({'secret':![]})[_0x49c4('0x30')](function(_0x341528){if(_0x341528[_0x49c4('0xd2')]){var _0x2a0ef8=path[_0x49c4('0xd6')](_0x22005f,_0x341528[_0x49c4('0xd2')][_0x49c4('0xd0')]);if(fs[_0x49c4('0x11c')](_0x2a0ef8)){fs[_0x49c4('0x11d')](_0x2a0ef8)['pipe'](fs[_0x49c4('0x11e')](path['join'](_0x1d3b1a,_0x341528[_0x49c4('0xd2')][_0x49c4('0xd0')])));}}return{'date':moment(_0x341528[_0x49c4('0xee')])[_0x49c4('0xde')](_0x49c4('0x100'))[_0x49c4('0x9c')](),'sender':_0x341528[_0x49c4('0x10f')]===_0x49c4('0xc7')?_0x341528[_0x49c4('0x75')]?_0x341528[_0x49c4('0x75')][_0x49c4('0xc0')]:_0x49c4('0xe7'):_0x341528[_0x49c4('0x6c')][_0x49c4('0x10d')]+(_0x341528[_0x49c4('0x6c')]['lastName']?'\x20'+_0x341528[_0x49c4('0x6c')][_0x49c4('0x10e')]:''),'body':_0x341528['Attachment']?_0x341528[_0x49c4('0xd2')]['basename']:_0x341528[_0x49c4('0x2b')],'direction':_0x341528[_0x49c4('0x10f')]===_0x49c4('0xc7')?'A':'C','secret':_0x341528[_0x49c4('0xf0')],'read':_0x341528[_0x49c4('0x86')],'attachment':_0x341528['Attachment']};})['value']()};return ejs[_0x49c4('0x11f')](path[_0x49c4('0xd6')](config[_0x49c4('0xd7')],'server',_0x49c4('0x120'),_0x49c4('0x121')),{'interaction':_0x485c2d})['then'](function(_0x6a1d66){var _0x563f95=path['join'](_0x1d3b1a,'transcript-'+_0x5e5ca3['id']+'-'+_0x3ce0f9+_0x49c4('0x122'));var _0x442210={'path':_0x563f95,'channel':_0x49c4('0x114'),'interactionId':_0x5e5ca3['id']};return pdf[_0x49c4('0x123')](_0x6a1d66,_0x442210);})[_0x49c4('0x14')](function(){return new Promise(function(_0x547d37,_0x223fa2){zipdir(_0x1d3b1a,{'saveTo':_0x418ead},function(_0x147d5e,_0x29674d){if(_0x147d5e)return _0x223fa2(_0x147d5e);return _0x547d37(_0x29674d);});})['then'](function(){return new BPromise(function(_0x17b015,_0x724d15){rimraf(_0x1d3b1a,function(_0x3350da){if(_0x3350da)_0x724d15(_0x3350da);return _0x17b015();});});})[_0x49c4('0x14')](function(){return _0x55f423[_0x49c4('0xda')](_0x418ead,_0x4eb6ba,function(_0x146c6e){if(_0x146c6e){logger[_0x49c4('0x1a')](_0x49c4('0x124'),_0x146c6e);}else{fs[_0x49c4('0x125')](_0x418ead);}});});});}else{return _0x55f423[_0x49c4('0x126')](0xc8);}})[_0x49c4('0x1d')](handleError(_0x55f423,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 208c689..447f495 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 _0xd367=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x5886a7,_0x11a0a4){var _0x1d03ee=function(_0x3cf39e){while(--_0x3cf39e){_0x5886a7['push'](_0x5886a7['shift']());}};_0x1d03ee(++_0x11a0a4);}(_0xd367,0xbf));var _0x7d36=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd367[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x7d36('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x7d36('0x1'))['db'][_0x7d36('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x7d36('0x3')](0x0);var events={'afterCreate':_0x7d36('0x4'),'afterUpdate':_0x7d36('0x5'),'afterDestroy':_0x7d36('0x6')};function emitEvent(_0x405395){return function(_0x132c04,_0x34cc33,_0x220057){_0x132c04[_0x7d36('0x7')]({'attributes':['id'],'raw':!![]})[_0x7d36('0x8')](function(_0x2116cb){_0x132c04[_0x7d36('0x9')](_0x7d36('0xa'),_0x2116cb[_0x7d36('0xb')](function(_0xf6f485){return{'id':_0xf6f485['id']};}));return ChatMessage[_0x7d36('0xc')]({'where':{'ChatInteractionId':_0x132c04['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7d36('0x8')](function(_0x4087c8){_0x132c04[_0x7d36('0x9')](_0x7d36('0xd'),_0x4087c8['length']);ChatInteractionEvents[_0x7d36('0xe')](_0x405395+':'+_0x132c04['id'],_0x132c04);ChatInteractionEvents[_0x7d36('0xe')](_0x405395,_0x132c04);_0x220057(null);})[_0x7d36('0xf')](_0x220057(null));};}for(var e in events){if(events[_0x7d36('0x10')](e)){var event=events[e];ChatInteraction[_0x7d36('0x11')](e,emitEvent(event));}}module[_0x7d36('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0x98a7=['getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x23c4cc,_0x4368a7){var _0x544784=function(_0x21705f){while(--_0x21705f){_0x23c4cc['push'](_0x23c4cc['shift']());}};_0x544784(++_0x4368a7);}(_0x98a7,0x11e));var _0x798a=function(_0x49d8af,_0x4c16a6){_0x49d8af=_0x49d8af-0x0;var _0x5a03ae=_0x98a7[_0x49d8af];return _0x5a03ae;};'use strict';var EventEmitter=require(_0x798a('0x0'));var ChatInteraction=require(_0x798a('0x1'))['db'][_0x798a('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x798a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x798a('0x4')](0x0);var events={'afterCreate':_0x798a('0x5'),'afterUpdate':_0x798a('0x6'),'afterDestroy':_0x798a('0x7')};function emitEvent(_0x3f06fc){return function(_0x2582eb,_0x232156,_0x3b8ede){_0x2582eb[_0x798a('0x8')]({'attributes':['id'],'raw':!![]})[_0x798a('0x9')](function(_0x3e3eec){_0x2582eb['setDataValue'](_0x798a('0xa'),_0x3e3eec[_0x798a('0xb')](function(_0x1ceb63){return{'id':_0x1ceb63['id']};}));return ChatMessage[_0x798a('0xc')]({'where':{'ChatInteractionId':_0x2582eb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x798a('0x9')](function(_0x46e2f8){_0x2582eb[_0x798a('0xd')](_0x798a('0xe'),_0x46e2f8[_0x798a('0xf')]);ChatInteractionEvents[_0x798a('0x10')](_0x3f06fc+':'+_0x2582eb['id'],_0x2582eb);ChatInteractionEvents[_0x798a('0x10')](_0x3f06fc,_0x2582eb);_0x3b8ede(null);})[_0x798a('0x11')](_0x3b8ede(null));};}for(var e in events){if(events[_0x798a('0x12')](e)){var event=events[e];ChatInteraction[_0x798a('0x13')](e,emitEvent(event));}}module[_0x798a('0x14')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 6b00959..4475d94 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 _0xa552=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','rimraf','define','ChatInteraction','chat_interactions'];(function(_0x58ced8,_0x202c27){var _0x15e21a=function(_0x4106f2){while(--_0x4106f2){_0x58ced8['push'](_0x58ced8['shift']());}};_0x15e21a(++_0x202c27);}(_0xa552,0x197));var _0x2a55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa552[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2a55('0x0'));var util=require(_0x2a55('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2a55('0x2'));var BPromise=require(_0x2a55('0x3'));var rp=require(_0x2a55('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a55('0x5'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x5d1ed8,_0x2a15c6){return _0x5d1ed8[_0x2a55('0x6')](_0x2a55('0x7'),attributes,{'tableName':_0x2a55('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x590615,_0x583ee2,_0x26da30){if(_0x590615[_0x2a55('0x9')](_0x2a55('0xa'))){_0x590615[_0x2a55('0xb')]=moment()[_0x2a55('0xc')](_0x2a55('0xd'));}_0x26da30(null,_0x590615);}},'charset':_0x2a55('0xe'),'collate':_0x2a55('0xf')});}; \ No newline at end of file +var _0x7586=['path','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x27432c,_0x4f2249){var _0x501c4e=function(_0x35f993){while(--_0x35f993){_0x27432c['push'](_0x27432c['shift']());}};_0x501c4e(++_0x4f2249);}(_0x7586,0xb4));var _0x6758=function(_0x382168,_0xe03b6a){_0x382168=_0x382168-0x0;var _0x3ecf7e=_0x7586[_0x382168];return _0x3ecf7e;};'use strict';var _=require(_0x6758('0x0'));var util=require(_0x6758('0x1'));var logger=require(_0x6758('0x2'))(_0x6758('0x3'));var moment=require(_0x6758('0x4'));var BPromise=require(_0x6758('0x5'));var rp=require(_0x6758('0x6'));var fs=require('fs');var path=require(_0x6758('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x6758('0x8')]=function(_0x382f31,_0x45000b){return _0x382f31[_0x6758('0x9')](_0x6758('0xa'),attributes,{'tableName':_0x6758('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3dc565,_0x90e1e,_0x454b2c){if(_0x3dc565[_0x6758('0xc')](_0x6758('0xd'))){_0x3dc565[_0x6758('0xe')]=moment()[_0x6758('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x454b2c(null,_0x3dc565);}},'charset':'utf8mb4','collate':_0x6758('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 6b22f9f..8fbf8a3 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 _0xcdce=['catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','AddTagsToChatInteraction','find','addTags','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result'];(function(_0x1c70a6,_0x181310){var _0x33783c=function(_0x3b7118){while(--_0x3b7118){_0x1c70a6['push'](_0x1c70a6['shift']());}};_0x33783c(++_0x181310);}(_0xcdce,0xeb));var _0xecdc=function(_0x120bf8,_0x4e3509){_0x120bf8=_0x120bf8-0x0;var _0x43e434=_0xcdce[_0x120bf8];return _0x43e434;};'use strict';var _=require('lodash');var util=require(_0xecdc('0x0'));var moment=require('moment');var BPromise=require(_0xecdc('0x1'));var rs=require(_0xecdc('0x2'));var fs=require('fs');var Redis=require(_0xecdc('0x3'));var db=require(_0xecdc('0x4'))['db'];var utils=require(_0xecdc('0x5'));var logger=require(_0xecdc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xecdc('0x7'));var client=jayson[_0xecdc('0x8')]['http']({'port':0x232a});config[_0xecdc('0x9')]=_[_0xecdc('0xa')](config[_0xecdc('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xecdc('0xb'))(new Redis(config['redis']));require(_0xecdc('0xc'))[_0xecdc('0xd')](socket);function respondWithRpcPromise(_0x41d192,_0xae72e9,_0x4d6b85){return new BPromise(function(_0x4a5d62,_0xfa3ae2){return client['request'](_0x41d192,_0x4d6b85)['then'](function(_0x3e5254){logger['info']('ChatInteraction,\x20%s,\x20%s',_0xae72e9,_0xecdc('0xe'));logger[_0xecdc('0xf')](_0xecdc('0x10'),_0xae72e9,'request\x20sent',JSON[_0xecdc('0x11')](_0x3e5254));if(_0x3e5254[_0xecdc('0x12')]){if(_0x3e5254['error'][_0xecdc('0x13')]===0x1f4){logger[_0xecdc('0x12')](_0xecdc('0x14'),_0xae72e9,_0x3e5254[_0xecdc('0x12')][_0xecdc('0x15')]);return _0xfa3ae2(_0x3e5254[_0xecdc('0x12')][_0xecdc('0x15')]);}logger[_0xecdc('0x12')](_0xecdc('0x14'),_0xae72e9,_0x3e5254[_0xecdc('0x12')]['message']);return _0x4a5d62(_0x3e5254[_0xecdc('0x12')][_0xecdc('0x15')]);}else{logger[_0xecdc('0x16')]('ChatInteraction,\x20%s,\x20%s',_0xae72e9,'request\x20sent');_0x4a5d62(_0x3e5254[_0xecdc('0x17')][_0xecdc('0x15')]);}})[_0xecdc('0x18')](function(_0x3b199e){logger[_0xecdc('0x12')](_0xecdc('0x14'),_0xae72e9,_0x3b199e);_0xfa3ae2(_0x3b199e);});});}exports[_0xecdc('0x19')]=function(_0x277b14){var _0x3fd107=this;return new Promise(function(_0x59de03,_0x393d5a){return db[_0xecdc('0x1a')]['update'](_0x277b14[_0xecdc('0x1b')],{'raw':_0x277b14[_0xecdc('0x1c')]?_0x277b14[_0xecdc('0x1c')][_0xecdc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x277b14[_0xecdc('0x1c')]?_0x277b14[_0xecdc('0x1c')][_0xecdc('0x1e')]||null:null,'attributes':_0x277b14[_0xecdc('0x1c')]?_0x277b14[_0xecdc('0x1c')]['attributes']||null:null,'limit':_0x277b14[_0xecdc('0x1c')]?_0x277b14['options']['limit']||null:null})['then'](function(_0x4c13ea){logger[_0xecdc('0x16')]('UpdateChatInteraction',_0x277b14);logger['debug'](_0xecdc('0x19'),_0x277b14,JSON['stringify'](_0x4c13ea));_0x59de03(_0x4c13ea);})[_0xecdc('0x18')](function(_0x540bdf){logger[_0xecdc('0x12')]('UpdateChatInteraction',_0x540bdf[_0xecdc('0x15')],_0x277b14);_0x393d5a(_0x3fd107[_0xecdc('0x12')](0x1f4,_0x540bdf[_0xecdc('0x15')]));});});};exports[_0xecdc('0x1f')]=function(_0x309133){return new Promise(function(_0x3d111a,_0x3974ec){return db['ChatInteraction'][_0xecdc('0x20')]({'where':_0x309133['options']?_0x309133[_0xecdc('0x1c')][_0xecdc('0x1e')]||null:null})['then'](function(_0x399e08){if(_0x399e08){return _0x399e08[_0xecdc('0x21')](_0x309133['body']['ids'],_[_0xecdc('0x22')](_0x309133[_0xecdc('0x1b')],['ids','id'])||{});}})[_0xecdc('0x23')](function(_0x534aa4){logger[_0xecdc('0x16')]('AddTags',_0x309133);logger[_0xecdc('0xf')](_0xecdc('0x24'),_0x309133,JSON[_0xecdc('0x11')](_0x534aa4));_0x3d111a(_0x534aa4);})[_0xecdc('0x18')](function(_0x442e20){logger['error'](_0xecdc('0x24'),_0x442e20[_0xecdc('0x15')],_0x309133);_0x3974ec(_this['error'](0x1f4,_0x442e20[_0xecdc('0x15')]));});});}; \ No newline at end of file +var _0x1bb9=['options','raw','where','attributes','limit','then','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','body','omit','ids','spread','AddTags','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','register','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction','update'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x1bb9,0x8b));var _0x91bb=function(_0x6ca7f4,_0x51a5df){_0x6ca7f4=_0x6ca7f4-0x0;var _0x494fa6=_0x1bb9[_0x6ca7f4];return _0x494fa6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x91bb('0x0'));var BPromise=require(_0x91bb('0x1'));var rs=require(_0x91bb('0x2'));var fs=require('fs');var Redis=require(_0x91bb('0x3'));var db=require(_0x91bb('0x4'))['db'];var utils=require(_0x91bb('0x5'));var logger=require('../../config/logger')(_0x91bb('0x6'));var config=require(_0x91bb('0x7'));var jayson=require(_0x91bb('0x8'));var client=jayson[_0x91bb('0x9')]['http']({'port':0x232a});config[_0x91bb('0xa')]=_['defaults'](config['redis'],{'host':_0x91bb('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')[_0x91bb('0xc')](socket);function respondWithRpcPromise(_0x1434b8,_0x961206,_0x55badc){return new BPromise(function(_0x5c635e,_0x4a8389){return client['request'](_0x1434b8,_0x55badc)['then'](function(_0x32237e){logger[_0x91bb('0xd')](_0x91bb('0xe'),_0x961206,_0x91bb('0xf'));logger['debug'](_0x91bb('0x10'),_0x961206,'request\x20sent',JSON[_0x91bb('0x11')](_0x32237e));if(_0x32237e[_0x91bb('0x12')]){if(_0x32237e['error'][_0x91bb('0x13')]===0x1f4){logger[_0x91bb('0x12')](_0x91bb('0xe'),_0x961206,_0x32237e[_0x91bb('0x12')][_0x91bb('0x14')]);return _0x4a8389(_0x32237e[_0x91bb('0x12')][_0x91bb('0x14')]);}logger[_0x91bb('0x12')](_0x91bb('0xe'),_0x961206,_0x32237e[_0x91bb('0x12')][_0x91bb('0x14')]);return _0x5c635e(_0x32237e['error'][_0x91bb('0x14')]);}else{logger[_0x91bb('0xd')]('ChatInteraction,\x20%s,\x20%s',_0x961206,_0x91bb('0xf'));_0x5c635e(_0x32237e[_0x91bb('0x15')][_0x91bb('0x14')]);}})[_0x91bb('0x16')](function(_0x317d09){logger[_0x91bb('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x961206,_0x317d09);_0x4a8389(_0x317d09);});});}exports['UpdateChatInteraction']=function(_0x120123){var _0x36bcd0=this;return new Promise(function(_0x3ab111,_0x578e41){return db[_0x91bb('0x17')][_0x91bb('0x18')](_0x120123['body'],{'raw':_0x120123[_0x91bb('0x19')]?_0x120123[_0x91bb('0x19')][_0x91bb('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x120123[_0x91bb('0x19')]?_0x120123['options'][_0x91bb('0x1b')]||null:null,'attributes':_0x120123[_0x91bb('0x19')]?_0x120123[_0x91bb('0x19')][_0x91bb('0x1c')]||null:null,'limit':_0x120123[_0x91bb('0x19')]?_0x120123['options'][_0x91bb('0x1d')]||null:null})[_0x91bb('0x1e')](function(_0x59818c){logger['info'](_0x91bb('0x1f'),_0x120123);logger['debug']('UpdateChatInteraction',_0x120123,JSON['stringify'](_0x59818c));_0x3ab111(_0x59818c);})[_0x91bb('0x16')](function(_0x327d80){logger['error']('UpdateChatInteraction',_0x327d80[_0x91bb('0x14')],_0x120123);_0x578e41(_0x36bcd0[_0x91bb('0x12')](0x1f4,_0x327d80[_0x91bb('0x14')]));});});};exports[_0x91bb('0x20')]=function(_0x312db2){return new Promise(function(_0x2feb3c,_0x22c7c5){return db[_0x91bb('0x17')][_0x91bb('0x21')]({'where':_0x312db2[_0x91bb('0x19')]?_0x312db2['options'][_0x91bb('0x1b')]||null:null})['then'](function(_0x26ab52){if(_0x26ab52){return _0x26ab52[_0x91bb('0x22')](_0x312db2[_0x91bb('0x23')]['ids'],_[_0x91bb('0x24')](_0x312db2[_0x91bb('0x23')],[_0x91bb('0x25'),'id'])||{});}})[_0x91bb('0x26')](function(_0x9aac7e){logger[_0x91bb('0xd')](_0x91bb('0x27'),_0x312db2);logger[_0x91bb('0x28')](_0x91bb('0x27'),_0x312db2,JSON['stringify'](_0x9aac7e));_0x2feb3c(_0x9aac7e);})[_0x91bb('0x16')](function(_0x5bd99b){logger[_0x91bb('0x12')]('AddTags',_0x5bd99b[_0x91bb('0x14')],_0x312db2);_0x22c7c5(_this[_0x91bb('0x12')](0x1f4,_0x5bd99b[_0x91bb('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index c8098a2..9a63b8e 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 _0x0faf=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','remove'];(function(_0x1adb5d,_0x1e36cc){var _0x3acc58=function(_0x30a5ac){while(--_0x30a5ac){_0x1adb5d['push'](_0x1adb5d['shift']());}};_0x3acc58(++_0x1e36cc);}(_0x0faf,0x132));var _0xf0fa=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0x0faf[_0x507403];return _0x1327c;};'use strict';var ChatInteractionEvents=require(_0xf0fa('0x0'));var events=['save',_0xf0fa('0x1'),_0xf0fa('0x2')];function createListener(_0x2c6207,_0x35a260){return function(_0xccb93e){_0x35a260[_0xf0fa('0x3')](_0x2c6207,_0xccb93e);};}function removeListener(_0x515b12,_0xc83253){return function(){ChatInteractionEvents[_0xf0fa('0x4')](_0x515b12,_0xc83253);};}exports['register']=function(_0x3637a3){for(var _0x44ffa0=0x0,_0x25b5c4=events[_0xf0fa('0x5')];_0x44ffa0<_0x25b5c4;_0x44ffa0++){var _0x2db1d9=events[_0x44ffa0];var _0x587865=createListener(_0xf0fa('0x6')+_0x2db1d9,_0x3637a3);ChatInteractionEvents['on'](_0x2db1d9,_0x587865);}}; \ No newline at end of file +var _0x2d90=['register','length','./chatInteraction.events','save','remove','update','removeListener'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2d90,0x1c2));var _0x02d9=function(_0x58e642,_0xfa9d23){_0x58e642=_0x58e642-0x0;var _0x487afc=_0x2d90[_0x58e642];return _0x487afc;};'use strict';var ChatInteractionEvents=require(_0x02d9('0x0'));var events=[_0x02d9('0x1'),_0x02d9('0x2'),_0x02d9('0x3')];function createListener(_0x12d542,_0x594f49){return function(_0x158f97){_0x594f49['emit'](_0x12d542,_0x158f97);};}function removeListener(_0x2daf5d,_0xd95cb3){return function(){ChatInteractionEvents[_0x02d9('0x4')](_0x2daf5d,_0xd95cb3);};}exports[_0x02d9('0x5')]=function(_0x14895d){for(var _0x3811f9=0x0,_0x5ce735=events[_0x02d9('0x6')];_0x3811f9<_0x5ce735;_0x3811f9++){var _0x355722=events[_0x3811f9];var _0x21f370=createListener('chatInteraction:'+_0x355722,_0x14895d);ChatInteractionEvents['on'](_0x355722,_0x21f370);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 23c3e4e..fae27f1 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 _0x6bbb=['/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','index','get','/describe','isAuthenticated','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','format','%s-%s','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','put','/:id','tracked','update','/:id/abandon','abandon'];(function(_0x135448,_0x4ca19f){var _0x28389e=function(_0x5a2113){while(--_0x5a2113){_0x135448['push'](_0x135448['shift']());}};_0x28389e(++_0x4ca19f);}(_0x6bbb,0xa6));var _0xb6bb=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0x6bbb[_0x44cb92];return _0x56b9e6;};'use strict';var multer=require(_0xb6bb('0x0'));var util=require('util');var path=require(_0xb6bb('0x1'));var timeout=require(_0xb6bb('0x2'));var express=require(_0xb6bb('0x3'));var router=express[_0xb6bb('0x4')]();var fs_extra=require(_0xb6bb('0x5'));var auth=require(_0xb6bb('0x6'));var interaction=require(_0xb6bb('0x7'));var config=require(_0xb6bb('0x8'));var controller=require(_0xb6bb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb6bb('0xa')]);router[_0xb6bb('0xb')](_0xb6bb('0xc'),auth[_0xb6bb('0xd')](),controller[_0xb6bb('0xe')]);router[_0xb6bb('0xb')]('/:id',auth[_0xb6bb('0xf')](),controller[_0xb6bb('0x10')]);router[_0xb6bb('0xb')](_0xb6bb('0x11'),auth[_0xb6bb('0xf')](),controller[_0xb6bb('0x12')]);router[_0xb6bb('0xb')]('/:id/messages',auth[_0xb6bb('0xd')](),controller[_0xb6bb('0x13')]);router['get'](_0xb6bb('0x14'),auth[_0xb6bb('0xf')](),controller[_0xb6bb('0x15')]);router[_0xb6bb('0xb')](_0xb6bb('0x16'),auth[_0xb6bb('0xd')](),controller['download']);router[_0xb6bb('0x17')]('/',auth[_0xb6bb('0xd')](),controller[_0xb6bb('0x18')]);router[_0xb6bb('0x17')](_0xb6bb('0x19'),auth[_0xb6bb('0xd')](),controller[_0xb6bb('0x1a')]);var upload=multer({'storage':multer[_0xb6bb('0x1b')]({'destination':function(_0xbf4ed9,_0x147790,_0x3de449){_0x3de449(null,path[_0xb6bb('0x1c')](config['root'],'server/files/attachments/'));},'filename':function(_0x3759cc,_0x119345,_0x2fa519){_0x2fa519(null,util[_0xb6bb('0x1d')](_0xb6bb('0x1e'),Date['now'](),_0x119345[_0xb6bb('0x1f')][_0xb6bb('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0xb6bb('0x21')](_0xb6bb('0x22')),controller[_0xb6bb('0x23')]);router[_0xb6bb('0x17')]('/:id/messages',auth[_0xb6bb('0xf')](),controller[_0xb6bb('0x24')]);router[_0xb6bb('0x17')](_0xb6bb('0x25'),auth[_0xb6bb('0xd')](),interaction['tracked'](_0xb6bb('0x26'),_0xb6bb('0x27')),controller['addTags']);router[_0xb6bb('0x28')](_0xb6bb('0x29'),auth['isAuthenticated'](),interaction[_0xb6bb('0x2a')](_0xb6bb('0x26'),'chatinteraction:update'),controller[_0xb6bb('0x2b')]);router['put']('/:id/custom_update',controller['customUpdate']);router[_0xb6bb('0x28')](_0xb6bb('0x2c'),auth['isChatInteractionAuthorized'](),controller[_0xb6bb('0x2d')]);router[_0xb6bb('0x28')](_0xb6bb('0x2e'),controller[_0xb6bb('0x2f')]);router[_0xb6bb('0x30')](_0xb6bb('0x29'),auth[_0xb6bb('0xd')](),interaction[_0xb6bb('0x2a')](_0xb6bb('0x26'),_0xb6bb('0x31')),controller[_0xb6bb('0x32')]);router[_0xb6bb('0x30')](_0xb6bb('0x25'),auth[_0xb6bb('0xd')](),controller[_0xb6bb('0x33')]);module[_0xb6bb('0x34')]=router; \ No newline at end of file +var _0xfc34=['tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/abandon','abandon','/:id/close','close','delete','multer','util','path','express','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','get','/:id','show','/:id/attachment_download','attachmentDownload','/:id/messages','isChatInteractionAuthorized','getMyMessages','/:id/download','download','create','post','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags'];(function(_0x367336,_0x18c229){var _0x3423a7=function(_0xa8fa05){while(--_0xa8fa05){_0x367336['push'](_0x367336['shift']());}};_0x3423a7(++_0x18c229);}(_0xfc34,0x147));var _0x4fc3=function(_0x705b98,_0x1c345b){_0x705b98=_0x705b98-0x0;var _0x47b72f=_0xfc34[_0x705b98];return _0x47b72f;};'use strict';var multer=require(_0x4fc3('0x0'));var util=require(_0x4fc3('0x1'));var path=require(_0x4fc3('0x2'));var timeout=require('connect-timeout');var express=require(_0x4fc3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4fc3('0x4'));var config=require(_0x4fc3('0x5'));var controller=require(_0x4fc3('0x6'));router['get']('/',auth[_0x4fc3('0x7')](),controller['index']);router['get']('/describe',auth[_0x4fc3('0x7')](),controller['describe']);router[_0x4fc3('0x8')](_0x4fc3('0x9'),auth['isChatInteractionAuthorized'](),controller[_0x4fc3('0xa')]);router[_0x4fc3('0x8')](_0x4fc3('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x4fc3('0xc')]);router['get'](_0x4fc3('0xd'),auth[_0x4fc3('0x7')](),controller['getMessages']);router[_0x4fc3('0x8')]('/:id/my_messages',auth[_0x4fc3('0xe')](),controller[_0x4fc3('0xf')]);router['get'](_0x4fc3('0x10'),auth['isAuthenticated'](),controller[_0x4fc3('0x11')]);router['post']('/',auth[_0x4fc3('0x7')](),controller[_0x4fc3('0x12')]);router[_0x4fc3('0x13')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x4fc3('0x14')]);var upload=multer({'storage':multer[_0x4fc3('0x15')]({'destination':function(_0x53d882,_0x429329,_0x34ac67){_0x34ac67(null,path[_0x4fc3('0x16')](config[_0x4fc3('0x17')],_0x4fc3('0x18')));},'filename':function(_0x3d9b1a,_0x4c884d,_0x1df4a1){_0x1df4a1(null,util[_0x4fc3('0x19')](_0x4fc3('0x1a'),Date['now'](),_0x4c884d[_0x4fc3('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4fc3('0x13')](_0x4fc3('0x1c'),upload[_0x4fc3('0x1d')](_0x4fc3('0x1e')),controller[_0x4fc3('0x1f')]);router[_0x4fc3('0x13')](_0x4fc3('0xd'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x4fc3('0x13')](_0x4fc3('0x20'),auth['isAuthenticated'](),interaction[_0x4fc3('0x21')](_0x4fc3('0x22'),_0x4fc3('0x23')),controller[_0x4fc3('0x24')]);router[_0x4fc3('0x25')]('/:id',auth[_0x4fc3('0x7')](),interaction[_0x4fc3('0x21')](_0x4fc3('0x22'),_0x4fc3('0x26')),controller[_0x4fc3('0x27')]);router[_0x4fc3('0x25')]('/:id/custom_update',controller['customUpdate']);router[_0x4fc3('0x25')](_0x4fc3('0x28'),auth['isChatInteractionAuthorized'](),controller[_0x4fc3('0x29')]);router['put'](_0x4fc3('0x2a'),controller[_0x4fc3('0x2b')]);router[_0x4fc3('0x2c')]('/:id',auth[_0x4fc3('0x7')](),interaction['tracked'](_0x4fc3('0x22'),'chatinteraction:destroy'),controller['destroy']);router[_0x4fc3('0x2c')](_0x4fc3('0x20'),auth[_0x4fc3('0x7')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 248ee6f..b36a479 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 _0x2a1d=['sequelize','exports','TEXT','INTEGER'];(function(_0x36847d,_0x3273a7){var _0x3f3617=function(_0x55fa47){while(--_0x55fa47){_0x36847d['push'](_0x36847d['shift']());}};_0x3f3617(++_0x3273a7);}(_0x2a1d,0x144));var _0xd2a1=function(_0x554c70,_0xf212c6){_0x554c70=_0x554c70-0x0;var _0xe830fa=_0x2a1d[_0x554c70];return _0xe830fa;};'use strict';var Sequelize=require(_0xd2a1('0x0'));module[_0xd2a1('0x1')]={'body':{'type':Sequelize[_0xd2a1('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd2a1('0x3')]}}; \ No newline at end of file +var _0x8089=['INTEGER','medium','BOOLEAN'];(function(_0x3bf957,_0x168c65){var _0x551cc=function(_0x5368e8){while(--_0x5368e8){_0x3bf957['push'](_0x3bf957['shift']());}};_0x551cc(++_0x168c65);}(_0x8089,0x1d5));var _0x9808=function(_0x2c767d,_0x1b8935){_0x2c767d=_0x2c767d-0x0;var _0x1893c6=_0x8089[_0x2c767d];return _0x1893c6;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x9808('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x9808('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9808('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index efaadaa..dff0f36 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 _0x4cad=['sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','create','body','describe','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','findAll','agent','user','fullname','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','filter','createdAt','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x2b824d,_0x424788){var _0x573ed4=function(_0x2c312c){while(--_0x2c312c){_0x2b824d['push'](_0x2b824d['shift']());}};_0x573ed4(++_0x424788);}(_0x4cad,0x1e5));var _0xd4ca=function(_0x1204ac,_0x36fd4d){_0x1204ac=_0x1204ac-0x0;var _0x429afa=_0x4cad[_0x1204ac];return _0x429afa;};'use strict';var emlformat=require(_0xd4ca('0x0'));var rimraf=require(_0xd4ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4ca('0x2'));var rp=require(_0xd4ca('0x3'));var moment=require('moment');var BPromise=require(_0xd4ca('0x4'));var Mustache=require(_0xd4ca('0x5'));var util=require(_0xd4ca('0x6'));var path=require(_0xd4ca('0x7'));var sox=require(_0xd4ca('0x8'));var csv=require(_0xd4ca('0x9'));var ejs=require(_0xd4ca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4ca('0xb'));var squel=require(_0xd4ca('0xc'));var crypto=require('crypto');var jsforce=require(_0xd4ca('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd4ca('0x9'));var querystring=require('querystring');var Papa=require(_0xd4ca('0xe'));var Redis=require(_0xd4ca('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd4ca('0x10'));var as=require(_0xd4ca('0x11'));var hardwareService=require(_0xd4ca('0x12'));var logger=require(_0xd4ca('0x13'))(_0xd4ca('0x14'));var utils=require(_0xd4ca('0x15'));var config=require(_0xd4ca('0x16'));var licenseUtil=require(_0xd4ca('0x17'));var db=require(_0xd4ca('0x18'))['db'];config[_0xd4ca('0x19')]=_[_0xd4ca('0x1a')](config[_0xd4ca('0x19')],{'host':_0xd4ca('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd4ca('0x19')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x47b9bc,_0x11a379){_0x11a379=_0x11a379||0xcc;return function(_0x488cc8){if(_0x488cc8){return _0x47b9bc[_0xd4ca('0x1c')](_0x11a379);}return _0x47b9bc[_0xd4ca('0x1d')](_0x11a379)[_0xd4ca('0x1e')]();};}function respondWithResult(_0x55857b,_0x44d34d){_0x44d34d=_0x44d34d||0xc8;return function(_0x468b87){if(_0x468b87){return _0x55857b[_0xd4ca('0x1d')](_0x44d34d)['json'](_0x468b87);}};}function respondWithFilteredResult(_0x19feb0,_0x342e62){return function(_0x3881d0){if(_0x3881d0){var _0x412dd6=typeof _0x342e62[_0xd4ca('0x1f')]===_0xd4ca('0x20')&&typeof _0x342e62[_0xd4ca('0x21')]===_0xd4ca('0x20');var _0x27c50b=_0x3881d0['count'];var _0x4e328b=_0x412dd6?0x0:_0x342e62['offset'];var _0x22432e=_0x412dd6?_0x3881d0[_0xd4ca('0x22')]:_0x342e62[_0xd4ca('0x1f')]+_0x342e62[_0xd4ca('0x21')];var _0x1f04e7;if(_0x22432e>=_0x27c50b){_0x22432e=_0x27c50b;_0x1f04e7=0xc8;}else{_0x1f04e7=0xce;}_0x19feb0[_0xd4ca('0x1d')](_0x1f04e7);return _0x19feb0[_0xd4ca('0x23')]('Content-Range',_0x4e328b+'-'+_0x22432e+'/'+_0x27c50b)['json'](_0x3881d0);}return null;};}function patchUpdates(_0x1f15e3){return function(_0x91d66d){try{jsonpatch[_0xd4ca('0x24')](_0x91d66d,_0x1f15e3,!![]);}catch(_0x29044c){return BPromise[_0xd4ca('0x25')](_0x29044c);}return _0x91d66d['save']();};}function saveUpdates(_0x217f14,_0x309838){return function(_0x9a6993){if(_0x9a6993){return _0x9a6993[_0xd4ca('0x26')](_0x217f14)[_0xd4ca('0x27')](function(_0x3b252e){return _0x3b252e;});}return null;};}function removeEntity(_0x4340e3,_0x45125e){return function(_0x1539ce){if(_0x1539ce){return _0x1539ce[_0xd4ca('0x28')]()[_0xd4ca('0x27')](function(){_0x4340e3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20a984,_0x18c326){return function(_0x2276ac){if(!_0x2276ac){_0x20a984['sendStatus'](0x194);}return _0x2276ac;};}function handleError(_0x5d45f2,_0x3c9378){_0x3c9378=_0x3c9378||0x1f4;return function(_0x28e5ba){logger[_0xd4ca('0x29')](_0x28e5ba[_0xd4ca('0x2a')]);if(_0x28e5ba[_0xd4ca('0x2b')]){delete _0x28e5ba[_0xd4ca('0x2b')];}_0x5d45f2[_0xd4ca('0x1d')](_0x3c9378)['send'](_0x28e5ba);};}exports[_0xd4ca('0x2c')]=function(_0x255814,_0x22b9d){var _0x4580c6={},_0xd858f={},_0x21a81f={'count':0x0,'rows':[]};var _0x128c8f=_[_0xd4ca('0x2d')](db[_0xd4ca('0x2e')][_0xd4ca('0x2f')],function(_0xcb5070){return{'name':_0xcb5070[_0xd4ca('0x30')],'type':_0xcb5070[_0xd4ca('0x31')][_0xd4ca('0x32')]};});_0xd858f[_0xd4ca('0x33')]=_[_0xd4ca('0x2d')](_0x128c8f,_0xd4ca('0x2b'));_0xd858f[_0xd4ca('0x34')]=_['keys'](_0x255814[_0xd4ca('0x34')]);_0xd858f[_0xd4ca('0x35')]=_[_0xd4ca('0x36')](_0xd858f['model'],_0xd858f[_0xd4ca('0x34')]);_0x4580c6[_0xd4ca('0x37')]=_[_0xd4ca('0x36')](_0xd858f[_0xd4ca('0x33')],qs[_0xd4ca('0x38')](_0x255814['query'][_0xd4ca('0x38')]));_0x4580c6[_0xd4ca('0x37')]=_0x4580c6[_0xd4ca('0x37')][_0xd4ca('0x39')]?_0x4580c6['attributes']:_0xd858f[_0xd4ca('0x33')];if(!_0x255814['query']['hasOwnProperty'](_0xd4ca('0x3a'))){_0x4580c6['limit']=qs[_0xd4ca('0x21')](_0x255814['query'][_0xd4ca('0x21')]);_0x4580c6[_0xd4ca('0x1f')]=qs[_0xd4ca('0x1f')](_0x255814['query'][_0xd4ca('0x1f')]);}_0x4580c6[_0xd4ca('0x3b')]=qs[_0xd4ca('0x3c')](_0x255814[_0xd4ca('0x34')]['sort']);_0x4580c6[_0xd4ca('0x3d')]=qs[_0xd4ca('0x35')](_[_0xd4ca('0x3e')](_0x255814[_0xd4ca('0x34')],_0xd858f[_0xd4ca('0x35')]),_0x128c8f);if(_0x255814[_0xd4ca('0x34')]['filter']){_0x4580c6['where']=_[_0xd4ca('0x3f')](_0x4580c6[_0xd4ca('0x3d')],{'$or':_[_0xd4ca('0x2d')](_0x128c8f,function(_0x3c28a1){if(_0x3c28a1[_0xd4ca('0x31')]!==_0xd4ca('0x40')){var _0x594727={};_0x594727[_0x3c28a1[_0xd4ca('0x2b')]]={'$like':'%'+_0x255814[_0xd4ca('0x34')]['filter']+'%'};return _0x594727;}})});}_0x4580c6=_[_0xd4ca('0x3f')]({},_0x4580c6,_0x255814[_0xd4ca('0x41')]);var _0xa65643={'where':_0x4580c6['where']};return db['ChatInternalMessage']['count'](_0xa65643)[_0xd4ca('0x27')](function(_0x2ee31a){_0x21a81f[_0xd4ca('0x22')]=_0x2ee31a;if(_0x255814[_0xd4ca('0x34')][_0xd4ca('0x42')]){_0x4580c6[_0xd4ca('0x43')]=[{'all':!![]}];}return db[_0xd4ca('0x2e')]['findAll'](_0x4580c6);})[_0xd4ca('0x27')](function(_0x49cd1c){_0x21a81f[_0xd4ca('0x44')]=_0x49cd1c;return _0x21a81f;})[_0xd4ca('0x27')](respondWithFilteredResult(_0x22b9d,_0x4580c6))[_0xd4ca('0x45')](handleError(_0x22b9d,null));};exports['show']=function(_0x29e52c,_0x52291f){var _0x5be141={'raw':!![],'where':{'id':_0x29e52c[_0xd4ca('0x46')]['id']}},_0x1facc0={};_0x1facc0[_0xd4ca('0x33')]=_[_0xd4ca('0x47')](db[_0xd4ca('0x2e')][_0xd4ca('0x2f')]);_0x1facc0[_0xd4ca('0x34')]=_[_0xd4ca('0x47')](_0x29e52c[_0xd4ca('0x34')]);_0x1facc0['filters']=_[_0xd4ca('0x36')](_0x1facc0[_0xd4ca('0x33')],_0x1facc0[_0xd4ca('0x34')]);_0x5be141[_0xd4ca('0x37')]=_[_0xd4ca('0x36')](_0x1facc0[_0xd4ca('0x33')],qs[_0xd4ca('0x38')](_0x29e52c[_0xd4ca('0x34')][_0xd4ca('0x38')]));_0x5be141[_0xd4ca('0x37')]=_0x5be141[_0xd4ca('0x37')][_0xd4ca('0x39')]?_0x5be141[_0xd4ca('0x37')]:_0x1facc0[_0xd4ca('0x33')];if(_0x29e52c[_0xd4ca('0x34')]['includeAll']){_0x5be141[_0xd4ca('0x43')]=[{'all':!![]}];}_0x5be141=_[_0xd4ca('0x3f')]({},_0x5be141,_0x29e52c[_0xd4ca('0x41')]);return db['ChatInternalMessage'][_0xd4ca('0x48')](_0x5be141)['then'](handleEntityNotFound(_0x52291f,null))['then'](respondWithResult(_0x52291f,null))[_0xd4ca('0x45')](handleError(_0x52291f,null));};exports[_0xd4ca('0x49')]=function(_0x3692fc,_0x931c13){return db[_0xd4ca('0x2e')][_0xd4ca('0x49')](_0x3692fc[_0xd4ca('0x4a')],{})['then'](respondWithResult(_0x931c13,0xc9))['catch'](handleError(_0x931c13,null));};exports['update']=function(_0x212978,_0x5a8c42){if(_0x212978[_0xd4ca('0x4a')]['id']){delete _0x212978[_0xd4ca('0x4a')]['id'];}return db[_0xd4ca('0x2e')]['find']({'where':{'id':_0x212978['params']['id']}})[_0xd4ca('0x27')](handleEntityNotFound(_0x5a8c42,null))[_0xd4ca('0x27')](saveUpdates(_0x212978['body'],null))[_0xd4ca('0x27')](respondWithResult(_0x5a8c42,null))[_0xd4ca('0x45')](handleError(_0x5a8c42,null));};exports['destroy']=function(_0x184c1f,_0xa84530){return db[_0xd4ca('0x2e')][_0xd4ca('0x48')]({'where':{'id':_0x184c1f[_0xd4ca('0x46')]['id']}})[_0xd4ca('0x27')](handleEntityNotFound(_0xa84530,null))[_0xd4ca('0x27')](removeEntity(_0xa84530,null))[_0xd4ca('0x45')](handleError(_0xa84530,null));};exports[_0xd4ca('0x4b')]=function(_0x3a4892,_0x2fcb05){return db[_0xd4ca('0x2e')]['describe']()[_0xd4ca('0x27')](respondWithResult(_0x2fcb05,null))[_0xd4ca('0x45')](handleError(_0x2fcb05,null));};function wrapUser(_0x3c976d){return function(_0x597a3d){var _0x171a6d=_0x3c976d['get']({'plain':!![]});_0x171a6d[_0xd4ca('0x4c')]=[];if(_0x597a3d){_0x171a6d[_0xd4ca('0x4d')]=_0x597a3d['createdAt'];_0x171a6d[_0xd4ca('0x4e')]=_0x597a3d;}else{_0x171a6d[_0xd4ca('0x4d')]=moment(0x0)[_0xd4ca('0x4f')](_0xd4ca('0x50'));_0x171a6d['lastMessage']={};}return _0x171a6d;};}exports[_0xd4ca('0x51')]=function(_0x2bd263,_0x3f02b9,_0x11dab1){var _0x4ece7c=[];return db['User'][_0xd4ca('0x52')]({'where':{'role':[_0xd4ca('0x53'),'admin',_0xd4ca('0x54')]},'attributes':['id',_0xd4ca('0x55'),_0xd4ca('0x2b'),'role',_0xd4ca('0x56'),_0xd4ca('0x57'),_0xd4ca('0x58'),_0xd4ca('0x59'),'allowmessenger',_0xd4ca('0x5a')],'order':qs[_0xd4ca('0x3c')]('-online'),'include':[{'model':db[_0xd4ca('0x5b')],'as':_0xd4ca('0x5c'),'attributes':['id','name',_0xd4ca('0x31')],'through':{'attributes':[]}}]})[_0xd4ca('0x27')](function(_0x44f656){if(_0x44f656){var _0x31e5fd=_0x2bd263[_0xd4ca('0x54')]['get']({'plain':!![]});if(!_0x31e5fd)throw new Error(_0xd4ca('0x5d'));if(_0x31e5fd[_0xd4ca('0x5e')]===_0xd4ca('0x54')){return db[_0xd4ca('0x5f')][_0xd4ca('0x48')]({'where':{'name':_0xd4ca('0x60'),'userProfileId':_0x31e5fd[_0xd4ca('0x61')]},'raw':!![]})[_0xd4ca('0x27')](function(_0x38bffd){if(_0x38bffd){if(_0x38bffd[_0xd4ca('0x62')]===0x0){return db[_0xd4ca('0x63')][_0xd4ca('0x52')]({'where':{'sectionId':_0x38bffd['id']},'raw':!![]})['then'](function(_0xc7845d){var _0x3eda99=[];if(_[_0xd4ca('0x64')](_0xc7845d)){_0x3eda99=_['filter'](_0x44f656,function(_0x29da09){if(_0x29da09[_0xd4ca('0x5e')]!==_0xd4ca('0x53')){return _0x29da09;}});return _0x3eda99;}else{for(var _0x349a0f=0x0;_0x349a0f<_0x44f656[_0xd4ca('0x39')];_0x349a0f++){var _0x4d79b6=_0x44f656[_0x349a0f];if(_0x4d79b6[_0xd4ca('0x5e')]==='agent'){var _0xa6c936=_['find'](_0xc7845d,function(_0x2ff998){return _0x2ff998[_0xd4ca('0x65')]===_0x4d79b6['id'];});if(_0xa6c936)_0x3eda99['push'](_0x4d79b6);}else{_0x3eda99[_0xd4ca('0x66')](_0x4d79b6);}}return _0x3eda99;}});}else{return _0x44f656;}}else{var _0x40b614=_[_0xd4ca('0x67')](_0x44f656,function(_0x66d55a){if(_0x66d55a['role']!=='agent'){return _0x66d55a;}});return _0x40b614;}});}else{return _0x44f656;}}})['then'](function(_0xaafc61){var _0x497ad6=[];if(_0xaafc61){_0x4ece7c=_0xaafc61;for(var _0x2bae35=0x0;_0x2bae35<_0xaafc61[_0xd4ca('0x39')];_0x2bae35+=0x1){_0x4ece7c[_0x2bae35]['messages']=[];_0x497ad6['push'](db[_0xd4ca('0x2e')][_0xd4ca('0x48')]({'where':{'FromId':[_0x2bd263[_0xd4ca('0x54')]['id'],_0xaafc61[_0x2bae35]['id']],'ToId':[_0x2bd263[_0xd4ca('0x54')]['id'],_0xaafc61[_0x2bae35]['id']],'ChatGroupId':null},'attributes':['id',_0xd4ca('0x68'),'FromId',_0xd4ca('0x69'),_0xd4ca('0x6a'),_0xd4ca('0x4a')],'order':qs[_0xd4ca('0x3c')](_0xd4ca('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0xaafc61[_0x2bae35])));}return BPromise[_0xd4ca('0x6c')](_0x497ad6);}return[];})[_0xd4ca('0x27')](function(_0x2281bb){return{'rows':_0x2281bb,'count':_0x2281bb[_0xd4ca('0x39')]};})[_0xd4ca('0x27')](respondWithResult(_0x3f02b9,null))[_0xd4ca('0x45')](handleError(_0x3f02b9,null));}; \ No newline at end of file +var _0xb48b=['getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','isEmpty','resourceId','push','ToId','read','-createdAt','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','Content-Range','reject','update','then','end','sendStatus','error','stack','name','send','index','ChatInternalMessage','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','keys','find','catch','body','params','destroy','describe','lastMessageAt','createdAt','lastMessage','format'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0xb48b,0x160));var _0xbb48=function(_0x43b3e3,_0x7ec844){_0x43b3e3=_0x43b3e3-0x0;var _0x1856c7=_0xb48b[_0x43b3e3];return _0x1856c7;};'use strict';var emlformat=require(_0xbb48('0x0'));var rimraf=require(_0xbb48('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb48('0x2'));var rp=require(_0xbb48('0x3'));var moment=require(_0xbb48('0x4'));var BPromise=require(_0xbb48('0x5'));var Mustache=require(_0xbb48('0x6'));var util=require(_0xbb48('0x7'));var path=require(_0xbb48('0x8'));var sox=require(_0xbb48('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb48('0xa'));var _=require('lodash');var squel=require(_0xbb48('0xb'));var crypto=require(_0xbb48('0xc'));var jsforce=require(_0xbb48('0xd'));var deskjs=require(_0xbb48('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbb48('0xf'));var Papa=require(_0xbb48('0x10'));var Redis=require(_0xbb48('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbb48('0x12'));var hardwareService=require(_0xbb48('0x13'));var logger=require(_0xbb48('0x14'))(_0xbb48('0x15'));var utils=require('../../config/utils');var config=require(_0xbb48('0x16'));var licenseUtil=require(_0xbb48('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xbb48('0x18')](config[_0xbb48('0x19')],{'host':_0xbb48('0x1a'),'port':0x18eb});var socket=require(_0xbb48('0x1b'))(new Redis(config[_0xbb48('0x19')]));require(_0xbb48('0x1c'))[_0xbb48('0x1d')](socket);function respondWithStatusCode(_0x4b19c8,_0xe6efef){_0xe6efef=_0xe6efef||0xcc;return function(_0x55a40e){if(_0x55a40e){return _0x4b19c8['sendStatus'](_0xe6efef);}return _0x4b19c8[_0xbb48('0x1e')](_0xe6efef)['end']();};}function respondWithResult(_0x36ebed,_0x2a4476){_0x2a4476=_0x2a4476||0xc8;return function(_0x477111){if(_0x477111){return _0x36ebed[_0xbb48('0x1e')](_0x2a4476)[_0xbb48('0x1f')](_0x477111);}};}function respondWithFilteredResult(_0x5bfcf5,_0x26ce48){return function(_0x3267d4){if(_0x3267d4){var _0x2d6ca3=typeof _0x26ce48[_0xbb48('0x20')]===_0xbb48('0x21')&&typeof _0x26ce48['limit']===_0xbb48('0x21');var _0x943df1=_0x3267d4['count'];var _0x1bf11a=_0x2d6ca3?0x0:_0x26ce48[_0xbb48('0x20')];var _0x2b8fe1=_0x2d6ca3?_0x3267d4['count']:_0x26ce48[_0xbb48('0x20')]+_0x26ce48['limit'];var _0x28dd87;if(_0x2b8fe1>=_0x943df1){_0x2b8fe1=_0x943df1;_0x28dd87=0xc8;}else{_0x28dd87=0xce;}_0x5bfcf5[_0xbb48('0x1e')](_0x28dd87);return _0x5bfcf5['set'](_0xbb48('0x22'),_0x1bf11a+'-'+_0x2b8fe1+'/'+_0x943df1)[_0xbb48('0x1f')](_0x3267d4);}return null;};}function patchUpdates(_0x49bf71){return function(_0x42e271){try{jsonpatch['apply'](_0x42e271,_0x49bf71,!![]);}catch(_0x12576e){return BPromise[_0xbb48('0x23')](_0x12576e);}return _0x42e271['save']();};}function saveUpdates(_0x20504f,_0x530315){return function(_0x56fe83){if(_0x56fe83){return _0x56fe83[_0xbb48('0x24')](_0x20504f)['then'](function(_0x4a2306){return _0x4a2306;});}return null;};}function removeEntity(_0x3a5bd1,_0x27d75e){return function(_0x21f210){if(_0x21f210){return _0x21f210['destroy']()[_0xbb48('0x25')](function(){_0x3a5bd1[_0xbb48('0x1e')](0xcc)[_0xbb48('0x26')]();});}};}function handleEntityNotFound(_0x26b0c9,_0x330592){return function(_0x5eacdf){if(!_0x5eacdf){_0x26b0c9[_0xbb48('0x27')](0x194);}return _0x5eacdf;};}function handleError(_0x8d01f3,_0x1cd753){_0x1cd753=_0x1cd753||0x1f4;return function(_0x42a2ed){logger[_0xbb48('0x28')](_0x42a2ed[_0xbb48('0x29')]);if(_0x42a2ed[_0xbb48('0x2a')]){delete _0x42a2ed['name'];}_0x8d01f3['status'](_0x1cd753)[_0xbb48('0x2b')](_0x42a2ed);};}exports[_0xbb48('0x2c')]=function(_0x49f1cf,_0x29c761){var _0x55d6cd={},_0x22aabc={},_0x408d72={'count':0x0,'rows':[]};var _0x35a357=_['map'](db[_0xbb48('0x2d')][_0xbb48('0x2e')],function(_0x500b6a){return{'name':_0x500b6a['fieldName'],'type':_0x500b6a[_0xbb48('0x2f')][_0xbb48('0x30')]};});_0x22aabc[_0xbb48('0x31')]=_[_0xbb48('0x32')](_0x35a357,_0xbb48('0x2a'));_0x22aabc[_0xbb48('0x33')]=_['keys'](_0x49f1cf['query']);_0x22aabc[_0xbb48('0x34')]=_['intersection'](_0x22aabc[_0xbb48('0x31')],_0x22aabc['query']);_0x55d6cd[_0xbb48('0x35')]=_[_0xbb48('0x36')](_0x22aabc[_0xbb48('0x31')],qs[_0xbb48('0x37')](_0x49f1cf[_0xbb48('0x33')][_0xbb48('0x37')]));_0x55d6cd[_0xbb48('0x35')]=_0x55d6cd[_0xbb48('0x35')][_0xbb48('0x38')]?_0x55d6cd[_0xbb48('0x35')]:_0x22aabc[_0xbb48('0x31')];if(!_0x49f1cf[_0xbb48('0x33')][_0xbb48('0x39')](_0xbb48('0x3a'))){_0x55d6cd['limit']=qs[_0xbb48('0x3b')](_0x49f1cf[_0xbb48('0x33')][_0xbb48('0x3b')]);_0x55d6cd[_0xbb48('0x20')]=qs[_0xbb48('0x20')](_0x49f1cf['query'][_0xbb48('0x20')]);}_0x55d6cd[_0xbb48('0x3c')]=qs['sort'](_0x49f1cf[_0xbb48('0x33')][_0xbb48('0x3d')]);_0x55d6cd[_0xbb48('0x3e')]=qs[_0xbb48('0x34')](_[_0xbb48('0x3f')](_0x49f1cf[_0xbb48('0x33')],_0x22aabc[_0xbb48('0x34')]),_0x35a357);if(_0x49f1cf[_0xbb48('0x33')][_0xbb48('0x40')]){_0x55d6cd['where']=_[_0xbb48('0x41')](_0x55d6cd['where'],{'$or':_[_0xbb48('0x32')](_0x35a357,function(_0x288524){if(_0x288524[_0xbb48('0x2f')]!==_0xbb48('0x42')){var _0xf0b86={};_0xf0b86[_0x288524['name']]={'$like':'%'+_0x49f1cf[_0xbb48('0x33')][_0xbb48('0x40')]+'%'};return _0xf0b86;}})});}_0x55d6cd=_['merge']({},_0x55d6cd,_0x49f1cf[_0xbb48('0x43')]);var _0xb01d83={'where':_0x55d6cd[_0xbb48('0x3e')]};return db[_0xbb48('0x2d')][_0xbb48('0x44')](_0xb01d83)[_0xbb48('0x25')](function(_0x2f9100){_0x408d72[_0xbb48('0x44')]=_0x2f9100;if(_0x49f1cf[_0xbb48('0x33')][_0xbb48('0x45')]){_0x55d6cd[_0xbb48('0x46')]=[{'all':!![]}];}return db[_0xbb48('0x2d')][_0xbb48('0x47')](_0x55d6cd);})['then'](function(_0x2ac2a8){_0x408d72['rows']=_0x2ac2a8;return _0x408d72;})['then'](respondWithFilteredResult(_0x29c761,_0x55d6cd))['catch'](handleError(_0x29c761,null));};exports[_0xbb48('0x48')]=function(_0xbd124c,_0x248dab){var _0x2fe679={'raw':!![],'where':{'id':_0xbd124c['params']['id']}},_0xc1d708={};_0xc1d708[_0xbb48('0x31')]=_[_0xbb48('0x49')](db[_0xbb48('0x2d')]['rawAttributes']);_0xc1d708[_0xbb48('0x33')]=_[_0xbb48('0x49')](_0xbd124c[_0xbb48('0x33')]);_0xc1d708[_0xbb48('0x34')]=_['intersection'](_0xc1d708['model'],_0xc1d708[_0xbb48('0x33')]);_0x2fe679[_0xbb48('0x35')]=_['intersection'](_0xc1d708[_0xbb48('0x31')],qs[_0xbb48('0x37')](_0xbd124c[_0xbb48('0x33')]['fields']));_0x2fe679['attributes']=_0x2fe679[_0xbb48('0x35')][_0xbb48('0x38')]?_0x2fe679['attributes']:_0xc1d708['model'];if(_0xbd124c[_0xbb48('0x33')][_0xbb48('0x45')]){_0x2fe679[_0xbb48('0x46')]=[{'all':!![]}];}_0x2fe679=_[_0xbb48('0x41')]({},_0x2fe679,_0xbd124c[_0xbb48('0x43')]);return db[_0xbb48('0x2d')][_0xbb48('0x4a')](_0x2fe679)['then'](handleEntityNotFound(_0x248dab,null))[_0xbb48('0x25')](respondWithResult(_0x248dab,null))['catch'](handleError(_0x248dab,null));};exports['create']=function(_0x4a0f8d,_0x235bb6){return db[_0xbb48('0x2d')]['create'](_0x4a0f8d['body'],{})[_0xbb48('0x25')](respondWithResult(_0x235bb6,0xc9))[_0xbb48('0x4b')](handleError(_0x235bb6,null));};exports['update']=function(_0x51e59b,_0x4533a4){if(_0x51e59b[_0xbb48('0x4c')]['id']){delete _0x51e59b['body']['id'];}return db[_0xbb48('0x2d')][_0xbb48('0x4a')]({'where':{'id':_0x51e59b[_0xbb48('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4533a4,null))['then'](saveUpdates(_0x51e59b[_0xbb48('0x4c')],null))[_0xbb48('0x25')](respondWithResult(_0x4533a4,null))[_0xbb48('0x4b')](handleError(_0x4533a4,null));};exports[_0xbb48('0x4e')]=function(_0x43d9e8,_0x56cf57){return db['ChatInternalMessage'][_0xbb48('0x4a')]({'where':{'id':_0x43d9e8[_0xbb48('0x4d')]['id']}})['then'](handleEntityNotFound(_0x56cf57,null))[_0xbb48('0x25')](removeEntity(_0x56cf57,null))[_0xbb48('0x4b')](handleError(_0x56cf57,null));};exports[_0xbb48('0x4f')]=function(_0x344d2e,_0x30f5cd){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0x30f5cd,null))['catch'](handleError(_0x30f5cd,null));};function wrapUser(_0x49958c){return function(_0x2aa43c){var _0x2dcd42=_0x49958c['get']({'plain':!![]});_0x2dcd42['messages']=[];if(_0x2aa43c){_0x2dcd42[_0xbb48('0x50')]=_0x2aa43c[_0xbb48('0x51')];_0x2dcd42[_0xbb48('0x52')]=_0x2aa43c;}else{_0x2dcd42[_0xbb48('0x50')]=moment(0x0)[_0xbb48('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x2dcd42[_0xbb48('0x52')]={};}return _0x2dcd42;};}exports[_0xbb48('0x54')]=function(_0x12d030,_0x2dfb59,_0x16eb10){var _0x5c6428=[];return db[_0xbb48('0x55')]['findAll']({'where':{'role':[_0xbb48('0x56'),_0xbb48('0x57'),_0xbb48('0x58')]},'attributes':['id',_0xbb48('0x59'),'name',_0xbb48('0x5a'),_0xbb48('0x5b'),_0xbb48('0x5c'),_0xbb48('0x5d'),_0xbb48('0x5e'),_0xbb48('0x5f'),_0xbb48('0x60')],'order':qs[_0xbb48('0x3d')](_0xbb48('0x61')),'include':[{'model':db['VoiceQueue'],'as':_0xbb48('0x62'),'attributes':['id',_0xbb48('0x2a'),_0xbb48('0x2f')],'through':{'attributes':[]}}]})[_0xbb48('0x25')](function(_0x413aad){if(_0x413aad){var _0x2727a5=_0x12d030[_0xbb48('0x58')]['get']({'plain':!![]});if(!_0x2727a5)throw new Error(_0xbb48('0x63'));if(_0x2727a5[_0xbb48('0x5a')]===_0xbb48('0x58')){return db[_0xbb48('0x64')]['find']({'where':{'name':_0xbb48('0x65'),'userProfileId':_0x2727a5[_0xbb48('0x66')]},'raw':!![]})['then'](function(_0xf269d2){if(_0xf269d2){if(_0xf269d2['autoAssociation']===0x0){return db['UserProfileResource'][_0xbb48('0x47')]({'where':{'sectionId':_0xf269d2['id']},'raw':!![]})[_0xbb48('0x25')](function(_0x19dd65){var _0x124da0=[];if(_[_0xbb48('0x67')](_0x19dd65)){_0x124da0=_['filter'](_0x413aad,function(_0x55a44c){if(_0x55a44c['role']!=='agent'){return _0x55a44c;}});return _0x124da0;}else{for(var _0x46cd9f=0x0;_0x46cd9f<_0x413aad[_0xbb48('0x38')];_0x46cd9f++){var _0x1af4b2=_0x413aad[_0x46cd9f];if(_0x1af4b2[_0xbb48('0x5a')]===_0xbb48('0x56')){var _0xeb5680=_[_0xbb48('0x4a')](_0x19dd65,function(_0x4a96a4){return _0x4a96a4[_0xbb48('0x68')]===_0x1af4b2['id'];});if(_0xeb5680)_0x124da0[_0xbb48('0x69')](_0x1af4b2);}else{_0x124da0[_0xbb48('0x69')](_0x1af4b2);}}return _0x124da0;}});}else{return _0x413aad;}}else{var _0x513ad6=_[_0xbb48('0x40')](_0x413aad,function(_0x5edc3b){if(_0x5edc3b[_0xbb48('0x5a')]!==_0xbb48('0x56')){return _0x5edc3b;}});return _0x513ad6;}});}else{return _0x413aad;}}})['then'](function(_0xd65f90){var _0x38ebf3=[];if(_0xd65f90){_0x5c6428=_0xd65f90;for(var _0x1eb124=0x0;_0x1eb124<_0xd65f90[_0xbb48('0x38')];_0x1eb124+=0x1){_0x5c6428[_0x1eb124]['messages']=[];_0x38ebf3['push'](db[_0xbb48('0x2d')][_0xbb48('0x4a')]({'where':{'FromId':[_0x12d030[_0xbb48('0x58')]['id'],_0xd65f90[_0x1eb124]['id']],'ToId':[_0x12d030[_0xbb48('0x58')]['id'],_0xd65f90[_0x1eb124]['id']],'ChatGroupId':null},'attributes':['id',_0xbb48('0x51'),'FromId',_0xbb48('0x6a'),_0xbb48('0x6b'),_0xbb48('0x4c')],'order':qs['sort'](_0xbb48('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbb48('0x25')](wrapUser(_0xd65f90[_0x1eb124])));}return BPromise['all'](_0x38ebf3);}return[];})[_0xbb48('0x25')](function(_0x4053fc){return{'rows':_0x4053fc,'count':_0x4053fc[_0xbb48('0x38')]};})[_0xbb48('0x25')](respondWithResult(_0x2dfb59,null))['catch'](handleError(_0x2dfb59,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 9f14790..6578e13 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 _0x3266=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3266,0x6a));var _0x6326=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x3266[_0x580647];return _0x5f0792;};'use strict';var EventEmitter=require(_0x6326('0x0'));var ChatInternalMessage=require(_0x6326('0x1'))['db'][_0x6326('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6326('0x3')](0x0);var events={'afterCreate':_0x6326('0x4'),'afterUpdate':_0x6326('0x5'),'afterDestroy':_0x6326('0x6')};function emitEvent(_0x365dbf){return function(_0x265264,_0x5a6b4d,_0x30b22e){ChatInternalMessageEvents['emit'](_0x365dbf+':'+_0x265264['id'],_0x265264);ChatInternalMessageEvents[_0x6326('0x7')](_0x365dbf,_0x265264);_0x30b22e(null);};}for(var e in events){if(events[_0x6326('0x8')](e)){var event=events[e];ChatInternalMessage[_0x6326('0x9')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x399e=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2536ea,_0xada864){var _0x299473=function(_0xcb1b34){while(--_0xcb1b34){_0x2536ea['push'](_0x2536ea['shift']());}};_0x299473(++_0xada864);}(_0x399e,0x106));var _0xe399=function(_0x26fc3b,_0x2b1be3){_0x26fc3b=_0x26fc3b-0x0;var _0x380e31=_0x399e[_0x26fc3b];return _0x380e31;};'use strict';var EventEmitter=require(_0xe399('0x0'));var ChatInternalMessage=require(_0xe399('0x1'))['db'][_0xe399('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe399('0x3')](0x0);var events={'afterCreate':_0xe399('0x4'),'afterUpdate':_0xe399('0x5'),'afterDestroy':_0xe399('0x6')};function emitEvent(_0x1fd7ce){return function(_0x40dd0e,_0x2382a6,_0x3542ed){ChatInternalMessageEvents['emit'](_0x1fd7ce+':'+_0x40dd0e['id'],_0x40dd0e);ChatInternalMessageEvents[_0xe399('0x7')](_0x1fd7ce,_0x40dd0e);_0x3542ed(null);};}for(var e in events){if(events[_0xe399('0x8')](e)){var event=events[e];ChatInternalMessage[_0xe399('0x9')](e,emitEvent(event));}}module[_0xe399('0xa')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 10968a8..765589a 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 _0x99c9=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x3df3ec,_0xd7156d){var _0x1666ac=function(_0xd8be4d){while(--_0xd8be4d){_0x3df3ec['push'](_0x3df3ec['shift']());}};_0x1666ac(++_0xd7156d);}(_0x99c9,0xe9));var _0x999c=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x99c9[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var logger=require(_0x999c('0x2'))(_0x999c('0x3'));var moment=require(_0x999c('0x4'));var BPromise=require('bluebird');var rp=require(_0x999c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x999c('0x6'));var config=require(_0x999c('0x7'));var attributes=require(_0x999c('0x8'));module['exports']=function(_0x235904,_0x2eb49c){return _0x235904['define']('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x999c('0x9'),'collate':_0x999c('0xa')});}; \ No newline at end of file +var _0x2cfa=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','chat_internal_messages','utf8mb4_unicode_ci'];(function(_0xacb1e2,_0x55e0ab){var _0x463815=function(_0x413c3b){while(--_0x413c3b){_0xacb1e2['push'](_0xacb1e2['shift']());}};_0x463815(++_0x55e0ab);}(_0x2cfa,0xa8));var _0xa2cf=function(_0x26a906,_0x3d135c){_0x26a906=_0x26a906-0x0;var _0x495575=_0x2cfa[_0x26a906];return _0x495575;};'use strict';var _=require(_0xa2cf('0x0'));var util=require(_0xa2cf('0x1'));var logger=require(_0xa2cf('0x2'))(_0xa2cf('0x3'));var moment=require(_0xa2cf('0x4'));var BPromise=require(_0xa2cf('0x5'));var rp=require(_0xa2cf('0x6'));var fs=require('fs');var path=require(_0xa2cf('0x7'));var rimraf=require(_0xa2cf('0x8'));var config=require(_0xa2cf('0x9'));var attributes=require('./chatInternalMessage.attributes');module[_0xa2cf('0xa')]=function(_0x4b4512,_0x450baf){return _0x4b4512[_0xa2cf('0xb')]('ChatInternalMessage',attributes,{'tableName':_0xa2cf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa2cf('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index ccc4dc3..2c6c740 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 _0xd4f4=['result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd4f4,0x6d));var _0x4d4f=function(_0x34addd,_0xa05fe4){_0x34addd=_0x34addd-0x0;var _0x1c9500=_0xd4f4[_0x34addd];return _0x1c9500;};'use strict';var _=require(_0x4d4f('0x0'));var util=require('util');var moment=require(_0x4d4f('0x1'));var BPromise=require(_0x4d4f('0x2'));var rs=require(_0x4d4f('0x3'));var fs=require('fs');var Redis=require(_0x4d4f('0x4'));var db=require(_0x4d4f('0x5'))['db'];var utils=require(_0x4d4f('0x6'));var logger=require('../../config/logger')(_0x4d4f('0x7'));var config=require(_0x4d4f('0x8'));var jayson=require(_0x4d4f('0x9'));var client=jayson[_0x4d4f('0xa')][_0x4d4f('0xb')]({'port':0x232a});config[_0x4d4f('0xc')]=_['defaults'](config[_0x4d4f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4d4f('0xd'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x4d4f('0xe')](socket);function respondWithRpcPromise(_0xe45812,_0x4c3ce9,_0x25458c){return new BPromise(function(_0x2201c4,_0x5993a3){return client[_0x4d4f('0xf')](_0xe45812,_0x25458c)[_0x4d4f('0x10')](function(_0x3d325d){logger[_0x4d4f('0x11')](_0x4d4f('0x12'),_0x4c3ce9,'request\x20sent');logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0x4c3ce9,_0x4d4f('0x15'),JSON[_0x4d4f('0x16')](_0x3d325d));if(_0x3d325d[_0x4d4f('0x17')]){if(_0x3d325d[_0x4d4f('0x17')][_0x4d4f('0x18')]===0x1f4){logger[_0x4d4f('0x17')](_0x4d4f('0x12'),_0x4c3ce9,_0x3d325d[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x5993a3(_0x3d325d[_0x4d4f('0x17')]['message']);}logger['error'](_0x4d4f('0x12'),_0x4c3ce9,_0x3d325d[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x2201c4(_0x3d325d[_0x4d4f('0x17')][_0x4d4f('0x19')]);}else{logger[_0x4d4f('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x4c3ce9,_0x4d4f('0x15'));_0x2201c4(_0x3d325d[_0x4d4f('0x1a')][_0x4d4f('0x19')]);}})['catch'](function(_0x550df7){logger[_0x4d4f('0x17')](_0x4d4f('0x12'),_0x4c3ce9,_0x550df7);_0x5993a3(_0x550df7);});});} \ No newline at end of file +var _0x9e38=['request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x4d4b38,_0x3c7e9a){var _0xfc7e88=function(_0x5df386){while(--_0x5df386){_0x4d4b38['push'](_0x4d4b38['shift']());}};_0xfc7e88(++_0x3c7e9a);}(_0x9e38,0x107));var _0x89e3=function(_0x1f16de,_0x548eb9){_0x1f16de=_0x1f16de-0x0;var _0x36cd80=_0x9e38[_0x1f16de];return _0x36cd80;};'use strict';var _=require(_0x89e3('0x0'));var util=require('util');var moment=require(_0x89e3('0x1'));var BPromise=require(_0x89e3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89e3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x89e3('0x4'));var logger=require(_0x89e3('0x5'))('rpc');var config=require(_0x89e3('0x6'));var jayson=require(_0x89e3('0x7'));var client=jayson[_0x89e3('0x8')]['http']({'port':0x232a});config[_0x89e3('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x89e3('0xa'))(new Redis(config['redis']));require(_0x89e3('0xb'))[_0x89e3('0xc')](socket);function respondWithRpcPromise(_0x363043,_0x347574,_0x6ea60f){return new BPromise(function(_0x28718e,_0x570ac5){return client[_0x89e3('0xd')](_0x363043,_0x6ea60f)['then'](function(_0x52fcaa){logger[_0x89e3('0xe')](_0x89e3('0xf'),_0x347574,_0x89e3('0x10'));logger[_0x89e3('0x11')](_0x89e3('0x12'),_0x347574,'request\x20sent',JSON['stringify'](_0x52fcaa));if(_0x52fcaa[_0x89e3('0x13')]){if(_0x52fcaa[_0x89e3('0x13')][_0x89e3('0x14')]===0x1f4){logger[_0x89e3('0x13')](_0x89e3('0xf'),_0x347574,_0x52fcaa[_0x89e3('0x13')][_0x89e3('0x15')]);return _0x570ac5(_0x52fcaa[_0x89e3('0x13')][_0x89e3('0x15')]);}logger[_0x89e3('0x13')](_0x89e3('0xf'),_0x347574,_0x52fcaa[_0x89e3('0x13')][_0x89e3('0x15')]);return _0x28718e(_0x52fcaa[_0x89e3('0x13')][_0x89e3('0x15')]);}else{logger[_0x89e3('0xe')](_0x89e3('0xf'),_0x347574,'request\x20sent');_0x28718e(_0x52fcaa['result'][_0x89e3('0x15')]);}})[_0x89e3('0x16')](function(_0x20fdaf){logger[_0x89e3('0x13')](_0x89e3('0xf'),_0x347574,_0x20fdaf);_0x570ac5(_0x20fdaf);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 88f9c11..16020be 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 _0xf164=['length','./chatInternalMessage.events','remove','update','removeListener','register'];(function(_0x34799f,_0xeeb8d9){var _0x348163=function(_0x892c78){while(--_0x892c78){_0x34799f['push'](_0x34799f['shift']());}};_0x348163(++_0xeeb8d9);}(_0xf164,0x12d));var _0x4f16=function(_0x4cb03b,_0x47d402){_0x4cb03b=_0x4cb03b-0x0;var _0x132ba4=_0xf164[_0x4cb03b];return _0x132ba4;};'use strict';var ChatInternalMessageEvents=require(_0x4f16('0x0'));var events=['save',_0x4f16('0x1'),_0x4f16('0x2')];function createListener(_0x9b8b0c,_0x3de103){return function(_0x1b14fb){_0x3de103['emit'](_0x9b8b0c,_0x1b14fb);};}function removeListener(_0x47e579,_0x3a0b85){return function(){ChatInternalMessageEvents[_0x4f16('0x3')](_0x47e579,_0x3a0b85);};}exports[_0x4f16('0x4')]=function(_0x281100){for(var _0x6fb05=0x0,_0x3e5df4=events[_0x4f16('0x5')];_0x6fb05<_0x3e5df4;_0x6fb05++){var _0x4fafd4=events[_0x6fb05];var _0x5d945e=createListener('chatInternalMessage:'+_0x4fafd4,_0x281100);ChatInternalMessageEvents['on'](_0x4fafd4,_0x5d945e);}}; \ No newline at end of file +var _0xa42f=['chatInternalMessage:','./chatInternalMessage.events','save','emit','removeListener','register','length'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xa42f,0xa2));var _0xfa42=function(_0x18fb44,_0x432893){_0x18fb44=_0x18fb44-0x0;var _0x3d3bd3=_0xa42f[_0x18fb44];return _0x3d3bd3;};'use strict';var ChatInternalMessageEvents=require(_0xfa42('0x0'));var events=[_0xfa42('0x1'),'remove','update'];function createListener(_0x53f776,_0x23f9a4){return function(_0x4f5251){_0x23f9a4[_0xfa42('0x2')](_0x53f776,_0x4f5251);};}function removeListener(_0x206e49,_0x47b955){return function(){ChatInternalMessageEvents[_0xfa42('0x3')](_0x206e49,_0x47b955);};}exports[_0xfa42('0x4')]=function(_0x3a6053){for(var _0x205564=0x0,_0x489227=events[_0xfa42('0x5')];_0x205564<_0x489227;_0x205564++){var _0x41223d=events[_0x205564];var _0x1bf95a=createListener(_0xfa42('0x6')+_0x41223d,_0x3a6053);ChatInternalMessageEvents['on'](_0x41223d,_0x1bf95a);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index b3629e4..ea6d832 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 _0x1e9a=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers'];(function(_0x50b2e7,_0x16bea5){var _0x8c493d=function(_0x2bc15b){while(--_0x2bc15b){_0x50b2e7['push'](_0x50b2e7['shift']());}};_0x8c493d(++_0x16bea5);}(_0x1e9a,0xd9));var _0xa1e9=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x1e9a[_0x4b7895];return _0x264180;};'use strict';var multer=require(_0xa1e9('0x0'));var util=require(_0xa1e9('0x1'));var path=require(_0xa1e9('0x2'));var timeout=require(_0xa1e9('0x3'));var express=require(_0xa1e9('0x4'));var router=express[_0xa1e9('0x5')]();var fs_extra=require(_0xa1e9('0x6'));var auth=require(_0xa1e9('0x7'));var interaction=require(_0xa1e9('0x8'));var config=require('../../config/environment');var controller=require(_0xa1e9('0x9'));router[_0xa1e9('0xa')]('/',auth[_0xa1e9('0xb')](),controller[_0xa1e9('0xc')]);router[_0xa1e9('0xa')](_0xa1e9('0xd'),auth[_0xa1e9('0xb')](),controller[_0xa1e9('0xe')]);router['get'](_0xa1e9('0xf'),auth['isAuthenticated'](),controller[_0xa1e9('0x10')]);router['get'](_0xa1e9('0x11'),auth['isAuthenticated'](),controller[_0xa1e9('0x12')]);router[_0xa1e9('0x13')]('/',auth[_0xa1e9('0xb')](),controller[_0xa1e9('0x14')]);router[_0xa1e9('0x15')](_0xa1e9('0x11'),controller[_0xa1e9('0x16')]);router[_0xa1e9('0x17')](_0xa1e9('0x11'),auth['isAuthenticated'](),controller[_0xa1e9('0x18')]);module[_0xa1e9('0x19')]=router; \ No newline at end of file +var _0x9dda=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/users','getUsers','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9dda,0x166));var _0xa9dd=function(_0x3b310e,_0x10c711){_0x3b310e=_0x3b310e-0x0;var _0x144fb2=_0x9dda[_0x3b310e];return _0x144fb2;};'use strict';var multer=require(_0xa9dd('0x0'));var util=require(_0xa9dd('0x1'));var path=require(_0xa9dd('0x2'));var timeout=require(_0xa9dd('0x3'));var express=require(_0xa9dd('0x4'));var router=express[_0xa9dd('0x5')]();var fs_extra=require(_0xa9dd('0x6'));var auth=require(_0xa9dd('0x7'));var interaction=require(_0xa9dd('0x8'));var config=require(_0xa9dd('0x9'));var controller=require('./chatInternalMessage.controller');router[_0xa9dd('0xa')]('/',auth[_0xa9dd('0xb')](),controller[_0xa9dd('0xc')]);router['get']('/describe',auth[_0xa9dd('0xb')](),controller[_0xa9dd('0xd')]);router[_0xa9dd('0xa')](_0xa9dd('0xe'),auth[_0xa9dd('0xb')](),controller[_0xa9dd('0xf')]);router[_0xa9dd('0xa')](_0xa9dd('0x10'),auth[_0xa9dd('0xb')](),controller[_0xa9dd('0x11')]);router[_0xa9dd('0x12')]('/',auth[_0xa9dd('0xb')](),controller[_0xa9dd('0x13')]);router[_0xa9dd('0x14')](_0xa9dd('0x10'),controller['update']);router[_0xa9dd('0x15')](_0xa9dd('0x10'),auth[_0xa9dd('0xb')](),controller[_0xa9dd('0x16')]);module[_0xa9dd('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index b73a9bf..465c648 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 _0x5b12=['out','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5b12,0xa3));var _0x25b1=function(_0x406a50,_0x5178b6){_0x406a50=_0x406a50-0x0;var _0x18afd9=_0x5b12[_0x406a50];return _0x18afd9;};'use strict';var Sequelize=require(_0x25b1('0x0'));module[_0x25b1('0x1')]={'body':{'type':Sequelize[_0x25b1('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x25b1('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x25b1('0x4')]('in',_0x25b1('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x25b1('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x173d=['exports','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x40ed03,_0x2d01fa){var _0x455107=function(_0xde9813){while(--_0xde9813){_0x40ed03['push'](_0x40ed03['shift']());}};_0x455107(++_0x2d01fa);}(_0x173d,0x108));var _0xd173=function(_0x2ea143,_0x19c835){_0x2ea143=_0x2ea143-0x0;var _0x9bbf2c=_0x173d[_0x2ea143];return _0x9bbf2c;};'use strict';var Sequelize=require('sequelize');module[_0xd173('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd173('0x1')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd173('0x2')]('in',_0xd173('0x3')),'defaultValue':_0xd173('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd173('0x4')]},'providerName':{'type':Sequelize[_0xd173('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 76de722..301c3ea 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 _0xee05=['include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','describe','chat-interactions','accept','chat','read','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize','rejectmessage','merge','parse','rimraf','zip-dir','fast-json-patch','bluebird','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','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','result','ChatMessage,\x20%s,\x20%s','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','end','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','options'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0xee05,0x1c8));var _0x5ee0=function(_0x22a2aa,_0x258d18){_0x22a2aa=_0x22a2aa-0x0;var _0x21f853=_0xee05[_0x22a2aa];return _0x21f853;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ee0('0x0'));var zipdir=require(_0x5ee0('0x1'));var jsonpatch=require(_0x5ee0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ee0('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5ee0('0x4'));var sox=require(_0x5ee0('0x5'));var csv=require('to-csv');var ejs=require(_0x5ee0('0x6'));var fs=require('fs');var fs_extra=require(_0x5ee0('0x7'));var _=require(_0x5ee0('0x8'));var squel=require(_0x5ee0('0x9'));var crypto=require(_0x5ee0('0xa'));var jsforce=require(_0x5ee0('0xb'));var deskjs=require(_0x5ee0('0xc'));var toCsv=require(_0x5ee0('0xd'));var querystring=require(_0x5ee0('0xe'));var Papa=require(_0x5ee0('0xf'));var Redis=require(_0x5ee0('0x10'));var authService=require(_0x5ee0('0x11'));var qs=require(_0x5ee0('0x12'));var as=require(_0x5ee0('0x13'));var hardwareService=require(_0x5ee0('0x14'));var logger=require(_0x5ee0('0x15'))(_0x5ee0('0x16'));var utils=require('../../config/utils');var config=require(_0x5ee0('0x17'));var licenseUtil=require(_0x5ee0('0x18'));var db=require(_0x5ee0('0x19'))['db'];config[_0x5ee0('0x1a')]=_['defaults'](config['redis'],{'host':_0x5ee0('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ee0('0x1a')]));require('./chatMessage.socket')[_0x5ee0('0x1c')](socket);var jayson=require(_0x5ee0('0x1d'));var client=jayson[_0x5ee0('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0x5ee0('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x33b942,_0x114e3f,_0x468a04,_0x50a2eb){return new BPromise(function(_0x14f4e3,_0x163005){var _0x460af1=_0x50a2eb||client;return _0x460af1[_0x5ee0('0x20')](_0x33b942,_0x468a04)[_0x5ee0('0x21')](function(_0x543b8a){logger[_0x5ee0('0x22')]('ChatMessage,\x20%s,\x20%s',_0x114e3f,_0x5ee0('0x23'));logger[_0x5ee0('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x114e3f,_0x5ee0('0x23'),JSON[_0x5ee0('0x25')](_0x543b8a));if(_0x543b8a[_0x5ee0('0x26')]){if(_0x543b8a[_0x5ee0('0x26')][_0x5ee0('0x27')]===0x1f4){logger[_0x5ee0('0x26')]('ChatMessage,\x20%s,\x20%s',_0x114e3f,_0x543b8a[_0x5ee0('0x26')][_0x5ee0('0x28')]);return _0x163005(_0x543b8a[_0x5ee0('0x26')][_0x5ee0('0x28')]);}logger[_0x5ee0('0x26')]('ChatMessage,\x20%s,\x20%s',_0x114e3f,_0x543b8a[_0x5ee0('0x26')][_0x5ee0('0x28')]);return _0x14f4e3(_0x543b8a['error'][_0x5ee0('0x28')]);}else{logger[_0x5ee0('0x22')]('ChatMessage,\x20%s,\x20%s',_0x114e3f,_0x5ee0('0x23'));_0x14f4e3(_0x543b8a[_0x5ee0('0x29')][_0x5ee0('0x28')]);}})['catch'](function(_0x112019){logger[_0x5ee0('0x26')](_0x5ee0('0x2a'),_0x114e3f,_0x112019);_0x163005(_0x112019);});});}function respondWithStatusCode(_0x337824,_0x5cc818){_0x5cc818=_0x5cc818||0xcc;return function(_0x457cd7){if(_0x457cd7){return _0x337824[_0x5ee0('0x2b')](_0x5cc818);}return _0x337824[_0x5ee0('0x2c')](_0x5cc818)['end']();};}function respondWithResult(_0x58da0d,_0x2c2c09){_0x2c2c09=_0x2c2c09||0xc8;return function(_0x5a59ee){if(_0x5a59ee){return _0x58da0d[_0x5ee0('0x2c')](_0x2c2c09)[_0x5ee0('0x2d')](_0x5a59ee);}};}function respondWithFilteredResult(_0x163ca7,_0x52573b){return function(_0x365245){if(_0x365245){var _0x57f9a0=typeof _0x52573b[_0x5ee0('0x2e')]===_0x5ee0('0x2f')&&typeof _0x52573b[_0x5ee0('0x30')]==='undefined';var _0x35301c=_0x365245[_0x5ee0('0x31')];var _0x32ee79=_0x57f9a0?0x0:_0x52573b[_0x5ee0('0x2e')];var _0x25fec5=_0x57f9a0?_0x365245[_0x5ee0('0x31')]:_0x52573b[_0x5ee0('0x2e')]+_0x52573b[_0x5ee0('0x30')];var _0x43c80c;if(_0x25fec5>=_0x35301c){_0x25fec5=_0x35301c;_0x43c80c=0xc8;}else{_0x43c80c=0xce;}_0x163ca7[_0x5ee0('0x2c')](_0x43c80c);return _0x163ca7[_0x5ee0('0x32')]('Content-Range',_0x32ee79+'-'+_0x25fec5+'/'+_0x35301c)['json'](_0x365245);}return null;};}function patchUpdates(_0x1ebac6){return function(_0xb2256b){try{jsonpatch[_0x5ee0('0x33')](_0xb2256b,_0x1ebac6,!![]);}catch(_0x146be6){return BPromise[_0x5ee0('0x34')](_0x146be6);}return _0xb2256b['save']();};}function saveUpdates(_0xbb5f20,_0x45afb1){return function(_0x16632d){if(_0x16632d){return _0x16632d[_0x5ee0('0x35')](_0xbb5f20)['then'](function(_0x52822b){return _0x52822b;});}return null;};}function removeEntity(_0x357f16,_0x463199){return function(_0x539229){if(_0x539229){return _0x539229['destroy']()[_0x5ee0('0x21')](function(){_0x357f16['status'](0xcc)[_0x5ee0('0x36')]();});}};}function handleEntityNotFound(_0x4b5c67,_0x261379){return function(_0x51a06a){if(!_0x51a06a){_0x4b5c67['sendStatus'](0x194);}return _0x51a06a;};}function handleError(_0x13794a,_0x3dcbc1){_0x3dcbc1=_0x3dcbc1||0x1f4;return function(_0x13e711){logger['error'](_0x13e711[_0x5ee0('0x37')]);if(_0x13e711[_0x5ee0('0x38')]){delete _0x13e711['name'];}_0x13794a['status'](_0x3dcbc1)[_0x5ee0('0x39')](_0x13e711);};}exports[_0x5ee0('0x3a')]=function(_0x159042,_0x49a8bb){var _0x4a776b={},_0x423bf0={},_0x158053={'count':0x0,'rows':[]};var _0x566017=_['map'](db[_0x5ee0('0x3b')][_0x5ee0('0x3c')],function(_0x1c30a6){return{'name':_0x1c30a6[_0x5ee0('0x3d')],'type':_0x1c30a6[_0x5ee0('0x3e')][_0x5ee0('0x3f')]};});_0x423bf0[_0x5ee0('0x40')]=_[_0x5ee0('0x41')](_0x566017,_0x5ee0('0x38'));_0x423bf0[_0x5ee0('0x42')]=_[_0x5ee0('0x43')](_0x159042[_0x5ee0('0x42')]);_0x423bf0[_0x5ee0('0x44')]=_[_0x5ee0('0x45')](_0x423bf0[_0x5ee0('0x40')],_0x423bf0[_0x5ee0('0x42')]);_0x4a776b['attributes']=_['intersection'](_0x423bf0[_0x5ee0('0x40')],qs['fields'](_0x159042[_0x5ee0('0x42')][_0x5ee0('0x46')]));_0x4a776b[_0x5ee0('0x47')]=_0x4a776b[_0x5ee0('0x47')][_0x5ee0('0x48')]?_0x4a776b[_0x5ee0('0x47')]:_0x423bf0[_0x5ee0('0x40')];if(!_0x159042['query'][_0x5ee0('0x49')]('nolimit')){_0x4a776b['limit']=qs[_0x5ee0('0x30')](_0x159042[_0x5ee0('0x42')][_0x5ee0('0x30')]);_0x4a776b[_0x5ee0('0x2e')]=qs[_0x5ee0('0x2e')](_0x159042['query']['offset']);}_0x4a776b[_0x5ee0('0x4a')]=qs[_0x5ee0('0x4b')](_0x159042[_0x5ee0('0x42')]['sort']);_0x4a776b[_0x5ee0('0x4c')]=qs[_0x5ee0('0x44')](_['pick'](_0x159042[_0x5ee0('0x42')],_0x423bf0[_0x5ee0('0x44')]),_0x566017);if(_0x159042[_0x5ee0('0x42')]['filter']){_0x4a776b[_0x5ee0('0x4c')]=_['merge'](_0x4a776b[_0x5ee0('0x4c')],{'$or':_[_0x5ee0('0x41')](_0x566017,function(_0x4a26e6){if(_0x4a26e6[_0x5ee0('0x3e')]!==_0x5ee0('0x4d')){var _0x5a3caf={};_0x5a3caf[_0x4a26e6['name']]={'$like':'%'+_0x159042[_0x5ee0('0x42')][_0x5ee0('0x4e')]+'%'};return _0x5a3caf;}})});}_0x4a776b=_['merge']({},_0x4a776b,_0x159042[_0x5ee0('0x4f')]);var _0x22ecb4={'where':_0x4a776b[_0x5ee0('0x4c')]};return db[_0x5ee0('0x3b')][_0x5ee0('0x31')](_0x22ecb4)[_0x5ee0('0x21')](function(_0xdddb34){_0x158053[_0x5ee0('0x31')]=_0xdddb34;if(_0x159042[_0x5ee0('0x42')]['includeAll']){_0x4a776b[_0x5ee0('0x50')]=[{'all':!![]}];}return db[_0x5ee0('0x3b')][_0x5ee0('0x51')](_0x4a776b);})[_0x5ee0('0x21')](function(_0x2f9e01){_0x158053[_0x5ee0('0x52')]=_0x2f9e01;return _0x158053;})[_0x5ee0('0x21')](respondWithFilteredResult(_0x49a8bb,_0x4a776b))[_0x5ee0('0x53')](handleError(_0x49a8bb,null));};exports[_0x5ee0('0x54')]=function(_0x2e11b0,_0x5d9d10){var _0x2677f3={'raw':!![],'where':{'id':_0x2e11b0[_0x5ee0('0x55')]['id']}},_0x58ca00={};_0x58ca00['model']=_[_0x5ee0('0x43')](db['ChatMessage']['rawAttributes']);_0x58ca00[_0x5ee0('0x42')]=_[_0x5ee0('0x43')](_0x2e11b0[_0x5ee0('0x42')]);_0x58ca00[_0x5ee0('0x44')]=_[_0x5ee0('0x45')](_0x58ca00[_0x5ee0('0x40')],_0x58ca00[_0x5ee0('0x42')]);_0x2677f3[_0x5ee0('0x47')]=_[_0x5ee0('0x45')](_0x58ca00[_0x5ee0('0x40')],qs[_0x5ee0('0x46')](_0x2e11b0['query'][_0x5ee0('0x46')]));_0x2677f3['attributes']=_0x2677f3[_0x5ee0('0x47')]['length']?_0x2677f3[_0x5ee0('0x47')]:_0x58ca00['model'];if(_0x2e11b0[_0x5ee0('0x42')][_0x5ee0('0x56')]){_0x2677f3[_0x5ee0('0x50')]=[{'all':!![]}];}_0x2677f3=_['merge']({},_0x2677f3,_0x2e11b0[_0x5ee0('0x4f')]);return db[_0x5ee0('0x3b')][_0x5ee0('0x57')](_0x2677f3)['then'](handleEntityNotFound(_0x5d9d10,null))[_0x5ee0('0x21')](respondWithResult(_0x5d9d10,null))[_0x5ee0('0x53')](handleError(_0x5d9d10,null));};exports['create']=function(_0x428c90,_0x3cbb34){return db['ChatMessage'][_0x5ee0('0x58')](_0x428c90[_0x5ee0('0x59')],{})[_0x5ee0('0x21')](respondWithResult(_0x3cbb34,0xc9))[_0x5ee0('0x53')](handleError(_0x3cbb34,null));};exports[_0x5ee0('0x35')]=function(_0x1a208b,_0x551361){if(_0x1a208b[_0x5ee0('0x59')]['id']){delete _0x1a208b['body']['id'];}return db[_0x5ee0('0x3b')][_0x5ee0('0x57')]({'where':{'id':_0x1a208b['params']['id']}})['then'](handleEntityNotFound(_0x551361,null))[_0x5ee0('0x21')](saveUpdates(_0x1a208b[_0x5ee0('0x59')],null))[_0x5ee0('0x21')](respondWithResult(_0x551361,null))[_0x5ee0('0x53')](handleError(_0x551361,null));};exports[_0x5ee0('0x5a')]=function(_0x48adb4,_0x43f7ae){return db['ChatMessage']['find']({'where':{'id':_0x48adb4[_0x5ee0('0x55')]['id']}})[_0x5ee0('0x21')](handleEntityNotFound(_0x43f7ae,null))[_0x5ee0('0x21')](removeEntity(_0x43f7ae,null))[_0x5ee0('0x53')](handleError(_0x43f7ae,null));};exports['describe']=function(_0x3c5a01,_0x2ee0b3){return db[_0x5ee0('0x3b')][_0x5ee0('0x5b')]()['then'](respondWithResult(_0x2ee0b3,null))[_0x5ee0('0x53')](handleError(_0x2ee0b3,null));};var interaction_log=require(_0x5ee0('0x15'))(_0x5ee0('0x5c'));exports[_0x5ee0('0x5d')]=function(_0xafb356,_0x4f78d2,_0x177193){var _0x51569e={'agent':{},'channel':_0x5ee0('0x5e')};if(_0xafb356[_0x5ee0('0x59')]['id']){delete _0xafb356[_0x5ee0('0x59')]['id'];}_0xafb356[_0x5ee0('0x59')][_0x5ee0('0x5f')]=!![];_0xafb356[_0x5ee0('0x59')]['readAt']=moment()['format'](_0x5ee0('0x60'));_0xafb356['body'][_0x5ee0('0x61')]=_0xafb356['body'][_0x5ee0('0x61')]||_0xafb356['user']['id'];_0x51569e[_0x5ee0('0x62')]['id']=_0xafb356[_0x5ee0('0x59')][_0x5ee0('0x61')];return db[_0x5ee0('0x3b')][_0x5ee0('0x57')]({'where':{'id':_0xafb356['params']['id'],'UserId':null}})[_0x5ee0('0x21')](handleEntityNotFound(_0x4f78d2,null))[_0x5ee0('0x21')](saveUpdates(_0xafb356['body'],null))[_0x5ee0('0x21')](function(_0x16f006){if(_0x16f006){_0x51569e[_0x5ee0('0x28')]=_0x16f006['get']({'plain':!![]});return db[_0x5ee0('0x63')]['find']({'where':{'id':_0x16f006['ChatInteractionId']}});}return null;})[_0x5ee0('0x21')](handleEntityNotFound(_0x4f78d2,null))[_0x5ee0('0x21')](function(_0x56bdb1){if(_0x56bdb1){return _0x56bdb1[_0x5ee0('0x35')]({'UserId':_0xafb356[_0x5ee0('0x59')]['UserId'],'read1stAt':_[_0x5ee0('0x64')](_0x56bdb1['read1stAt'])?moment()['format'](_0x5ee0('0x60')):undefined});}return null;})[_0x5ee0('0x21')](function(_0x176fbd){if(_0x176fbd){_0x51569e[_0x5ee0('0x65')]=_0x176fbd['get']({'plain':!![]});interaction_log['info'](_0x5ee0('0x66'),_0xafb356[_0x5ee0('0x67')]['id'],_0xafb356[_0x5ee0('0x67')][_0x5ee0('0x38')],_0xafb356[_0x5ee0('0x67')][_0x5ee0('0x68')],_0x51569e[_0x5ee0('0x65')]['id'],_0xafb356['body']?JSON[_0x5ee0('0x25')](_0xafb356[_0x5ee0('0x59')]):'null');return respondWithRpcPromise(_0x5ee0('0x69'),'acceptMessage',_0x51569e);}return null;})['then'](function(_0x2b41f6){var _0x3a4d76=_0x5ee0('0x6a')+_0x2b41f6[_0x5ee0('0x28')][_0x5ee0('0x6b')];return db[_0x5ee0('0x6c')]['query'](_0x3a4d76,{'type':db['Sequelize'][_0x5ee0('0x6d')][_0x5ee0('0x6e')],'raw':!![]})[_0x5ee0('0x21')](function(_0x178876){return _0x178876;});})['then'](function(_0x1e0956){if(_0x1e0956){_0x51569e['message'][_0x5ee0('0x6f')]=_0x1e0956[0x0];if(!_0xafb356['body']['UserId'])return;return db[_0x5ee0('0x70')][_0x5ee0('0x57')]({'where':{'id':_0xafb356['body'][_0x5ee0('0x61')],'role':'agent'},'attributes':['id',_0x5ee0('0x38'),_0x5ee0('0x71'),_0x5ee0('0x72'),_0x5ee0('0x73')],'raw':!![]});}return null;})[_0x5ee0('0x21')](function(_0x4ee9d7){if(!_0x4ee9d7)return null;_0x51569e['message'][_0x5ee0('0x62')]=_0x4ee9d7;return _0x51569e;})['then'](function(_0x24187b){if(_0x24187b){if(_0xafb356[_0x5ee0('0x59')][_0x5ee0('0x74')]){_0x51569e[_0x5ee0('0x28')][_0x5ee0('0x75')]=util[_0x5ee0('0x76')](_0x5ee0('0x77'),_0xafb356[_0x5ee0('0x67')][_0x5ee0('0x38')]);_0x51569e['message']['channel']=_0x51569e[_0x5ee0('0x78')];_0x51569e[_0x5ee0('0x28')][_0x5ee0('0x79')]=_0x51569e[_0x5ee0('0x78')];_0x51569e[_0x5ee0('0x28')][_0x5ee0('0x7a')]=_0x5ee0('0x5d');return respondWithRpcPromise(_0x5ee0('0x7b'),_0x5ee0('0x7b'),{'event':_0x5ee0('0x7c'),'message':_['merge'](_0x51569e[_0x5ee0('0x28')],JSON['parse'](_0x51569e[_0x5ee0('0x65')]['formData']))},client9002)[_0x5ee0('0x21')](function(){return _0x51569e;});}return _0x51569e;}return null;})[_0x5ee0('0x21')](respondWithResult(_0x4f78d2,null))[_0x5ee0('0x53')](handleError(_0x4f78d2,null));};var interaction_log=require(_0x5ee0('0x15'))(_0x5ee0('0x5c'));exports[_0x5ee0('0x34')]=function(_0x84dc92,_0x44c45f,_0x31a7db){var _0x4201cd={'agent':{},'channel':_0x5ee0('0x5e')};if(_0x84dc92[_0x5ee0('0x59')]['id']){delete _0x84dc92[_0x5ee0('0x59')]['id'];}_0x84dc92['body'][_0x5ee0('0x61')]=_0x84dc92['body'][_0x5ee0('0x61')]||_0x84dc92[_0x5ee0('0x67')]['id'];_0x4201cd[_0x5ee0('0x62')]['id']=_0x84dc92[_0x5ee0('0x59')]['UserId'];return db[_0x5ee0('0x3b')][_0x5ee0('0x57')]({'where':{'id':_0x84dc92['params']['id'],'UserId':null}})[_0x5ee0('0x21')](handleEntityNotFound(_0x44c45f,null))[_0x5ee0('0x21')](function(_0x304126){if(_0x304126){_0x4201cd[_0x5ee0('0x28')]=_0x304126['get']({'plain':!![]});return db[_0x5ee0('0x63')]['find']({'where':{'id':_0x304126['ChatInteractionId']}});}return null;})[_0x5ee0('0x21')](handleEntityNotFound(_0x44c45f,null))[_0x5ee0('0x21')](function(_0x54f311){if(_0x54f311){_0x4201cd[_0x5ee0('0x65')]=_0x54f311[_0x5ee0('0x7d')]({'plain':!![]});interaction_log[_0x5ee0('0x22')](_0x5ee0('0x7e'),_0x84dc92[_0x5ee0('0x67')]['id'],_0x84dc92['user']['name'],_0x84dc92['user'][_0x5ee0('0x68')],_0x4201cd['interaction']['id'],_0x84dc92[_0x5ee0('0x59')]?JSON[_0x5ee0('0x25')](_0x84dc92[_0x5ee0('0x59')]):_0x5ee0('0x7f'));return respondWithRpcPromise(_0x5ee0('0x80'),_0x5ee0('0x81'),_0x4201cd);}return null;})[_0x5ee0('0x21')](function(_0x50a45f){var _0x45e49b=_0x5ee0('0x6a')+_0x50a45f[_0x5ee0('0x28')][_0x5ee0('0x6b')];return db[_0x5ee0('0x6c')][_0x5ee0('0x42')](_0x45e49b,{'type':db[_0x5ee0('0x82')][_0x5ee0('0x6d')][_0x5ee0('0x6e')],'raw':!![]})['then'](function(_0x35eb72){return _0x35eb72;});})['then'](function(_0x3364e1){if(_0x3364e1){_0x4201cd['message'][_0x5ee0('0x6f')]=_0x3364e1[0x0];if(!_0x84dc92['body']['UserId'])return;return db[_0x5ee0('0x70')][_0x5ee0('0x57')]({'where':{'id':_0x84dc92[_0x5ee0('0x59')][_0x5ee0('0x61')],'role':_0x5ee0('0x62')},'attributes':['id',_0x5ee0('0x38'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x5ee0('0x21')](function(_0x44326c){if(!_0x44326c)return null;_0x4201cd[_0x5ee0('0x28')][_0x5ee0('0x62')]=_0x44326c;return _0x4201cd;})['then'](function(_0x2bb953){if(_0x2bb953){_0x2bb953[_0x5ee0('0x28')]['interface']=util[_0x5ee0('0x76')]('SIP/%s',_0x84dc92[_0x5ee0('0x67')][_0x5ee0('0x38')]);_0x2bb953[_0x5ee0('0x28')][_0x5ee0('0x78')]=_0x4201cd[_0x5ee0('0x78')];_0x2bb953['message'][_0x5ee0('0x79')]=_0x4201cd[_0x5ee0('0x78')];_0x2bb953['message']['event']=_0x5ee0('0x34');respondWithRpcPromise(_0x5ee0('0x7b'),'EventManager',{'event':_0x5ee0('0x83'),'message':_[_0x5ee0('0x84')](_0x4201cd[_0x5ee0('0x28')],JSON[_0x5ee0('0x85')](_0x4201cd[_0x5ee0('0x65')]['formData']))},client9002);return _0x4201cd;}return null;})[_0x5ee0('0x21')](respondWithResult(_0x44c45f,null))[_0x5ee0('0x53')](handleError(_0x44c45f,null));}; \ No newline at end of file +var _0x4144=['type','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','show','params','create','update','body','find','describe','../../config/logger','chat-interactions','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','ChatInteractionId','RejectMessage','rejectMessage','sequelize','User','fullname','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','destroy','then','stack','send','index','map','ChatMessage','rawAttributes','fieldName'];(function(_0x23b104,_0x1f52ce){var _0x567195=function(_0x154a41){while(--_0x154a41){_0x23b104['push'](_0x23b104['shift']());}};_0x567195(++_0x1f52ce);}(_0x4144,0x1ce));var _0x4414=function(_0x4d58b0,_0xd40c06){_0x4d58b0=_0x4d58b0-0x0;var _0x37447d=_0x4144[_0x4d58b0];return _0x37447d;};'use strict';var emlformat=require(_0x4414('0x0'));var rimraf=require(_0x4414('0x1'));var zipdir=require(_0x4414('0x2'));var jsonpatch=require(_0x4414('0x3'));var rp=require(_0x4414('0x4'));var moment=require(_0x4414('0x5'));var BPromise=require(_0x4414('0x6'));var Mustache=require(_0x4414('0x7'));var util=require(_0x4414('0x8'));var path=require(_0x4414('0x9'));var sox=require(_0x4414('0xa'));var csv=require(_0x4414('0xb'));var ejs=require(_0x4414('0xc'));var fs=require('fs');var fs_extra=require(_0x4414('0xd'));var _=require(_0x4414('0xe'));var squel=require(_0x4414('0xf'));var crypto=require('crypto');var jsforce=require(_0x4414('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4414('0x11'));var Papa=require(_0x4414('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4414('0x13'));var as=require(_0x4414('0x14'));var hardwareService=require(_0x4414('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x4414('0x16'));var config=require(_0x4414('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4414('0x18'))['db'];config[_0x4414('0x19')]=_[_0x4414('0x1a')](config[_0x4414('0x19')],{'host':_0x4414('0x1b'),'port':0x18eb});var socket=require(_0x4414('0x1c'))(new Redis(config[_0x4414('0x19')]));require(_0x4414('0x1d'))[_0x4414('0x1e')](socket);var jayson=require(_0x4414('0x1f'));var client=jayson[_0x4414('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x4414('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fa44e,_0x2fbd52,_0x275431,_0x4e0632){return new BPromise(function(_0x38e68b,_0x45c127){var _0x16b23a=_0x4e0632||client;return _0x16b23a[_0x4414('0x21')](_0x3fa44e,_0x275431)['then'](function(_0x2bc469){logger[_0x4414('0x22')](_0x4414('0x23'),_0x2fbd52,_0x4414('0x24'));logger['debug'](_0x4414('0x25'),_0x2fbd52,_0x4414('0x24'),JSON[_0x4414('0x26')](_0x2bc469));if(_0x2bc469[_0x4414('0x27')]){if(_0x2bc469[_0x4414('0x27')]['code']===0x1f4){logger[_0x4414('0x27')](_0x4414('0x23'),_0x2fbd52,_0x2bc469[_0x4414('0x27')][_0x4414('0x28')]);return _0x45c127(_0x2bc469[_0x4414('0x27')][_0x4414('0x28')]);}logger[_0x4414('0x27')](_0x4414('0x23'),_0x2fbd52,_0x2bc469['error'][_0x4414('0x28')]);return _0x38e68b(_0x2bc469[_0x4414('0x27')]['message']);}else{logger[_0x4414('0x22')]('ChatMessage,\x20%s,\x20%s',_0x2fbd52,_0x4414('0x24'));_0x38e68b(_0x2bc469['result']['message']);}})[_0x4414('0x29')](function(_0x998e80){logger[_0x4414('0x27')]('ChatMessage,\x20%s,\x20%s',_0x2fbd52,_0x998e80);_0x45c127(_0x998e80);});});}function respondWithStatusCode(_0x26a0a3,_0x7bc02){_0x7bc02=_0x7bc02||0xcc;return function(_0x2b3a67){if(_0x2b3a67){return _0x26a0a3[_0x4414('0x2a')](_0x7bc02);}return _0x26a0a3['status'](_0x7bc02)[_0x4414('0x2b')]();};}function respondWithResult(_0x18be9c,_0x4d1d06){_0x4d1d06=_0x4d1d06||0xc8;return function(_0x125ae9){if(_0x125ae9){return _0x18be9c[_0x4414('0x2c')](_0x4d1d06)[_0x4414('0x2d')](_0x125ae9);}};}function respondWithFilteredResult(_0x4a29cc,_0x5a8ab7){return function(_0x14d24b){if(_0x14d24b){var _0xd0549a=typeof _0x5a8ab7[_0x4414('0x2e')]===_0x4414('0x2f')&&typeof _0x5a8ab7[_0x4414('0x30')]===_0x4414('0x2f');var _0x15c890=_0x14d24b[_0x4414('0x31')];var _0xf5be9b=_0xd0549a?0x0:_0x5a8ab7['offset'];var _0x4ba134=_0xd0549a?_0x14d24b[_0x4414('0x31')]:_0x5a8ab7[_0x4414('0x2e')]+_0x5a8ab7['limit'];var _0x3e2320;if(_0x4ba134>=_0x15c890){_0x4ba134=_0x15c890;_0x3e2320=0xc8;}else{_0x3e2320=0xce;}_0x4a29cc[_0x4414('0x2c')](_0x3e2320);return _0x4a29cc['set'](_0x4414('0x32'),_0xf5be9b+'-'+_0x4ba134+'/'+_0x15c890)[_0x4414('0x2d')](_0x14d24b);}return null;};}function patchUpdates(_0x4a0cbb){return function(_0x2fe93a){try{jsonpatch['apply'](_0x2fe93a,_0x4a0cbb,!![]);}catch(_0x483f17){return BPromise[_0x4414('0x33')](_0x483f17);}return _0x2fe93a[_0x4414('0x34')]();};}function saveUpdates(_0x1e0a5d,_0xf83959){return function(_0x2b31b1){if(_0x2b31b1){return _0x2b31b1['update'](_0x1e0a5d)['then'](function(_0x5e7e8f){return _0x5e7e8f;});}return null;};}function removeEntity(_0x466ff3,_0x137824){return function(_0x33c6ac){if(_0x33c6ac){return _0x33c6ac[_0x4414('0x35')]()[_0x4414('0x36')](function(){_0x466ff3['status'](0xcc)[_0x4414('0x2b')]();});}};}function handleEntityNotFound(_0x909cc7,_0x560287){return function(_0x4c8e0f){if(!_0x4c8e0f){_0x909cc7[_0x4414('0x2a')](0x194);}return _0x4c8e0f;};}function handleError(_0xfa68c6,_0x138a13){_0x138a13=_0x138a13||0x1f4;return function(_0x19f5d3){logger[_0x4414('0x27')](_0x19f5d3[_0x4414('0x37')]);if(_0x19f5d3['name']){delete _0x19f5d3['name'];}_0xfa68c6['status'](_0x138a13)[_0x4414('0x38')](_0x19f5d3);};}exports[_0x4414('0x39')]=function(_0x1629a4,_0x5ccbde){var _0x12e35d={},_0x366fb3={},_0x454ddc={'count':0x0,'rows':[]};var _0x43d2a3=_[_0x4414('0x3a')](db[_0x4414('0x3b')][_0x4414('0x3c')],function(_0x4d7282){return{'name':_0x4d7282[_0x4414('0x3d')],'type':_0x4d7282[_0x4414('0x3e')]['key']};});_0x366fb3[_0x4414('0x3f')]=_['map'](_0x43d2a3,_0x4414('0x40'));_0x366fb3[_0x4414('0x41')]=_[_0x4414('0x42')](_0x1629a4['query']);_0x366fb3[_0x4414('0x43')]=_[_0x4414('0x44')](_0x366fb3['model'],_0x366fb3[_0x4414('0x41')]);_0x12e35d[_0x4414('0x45')]=_['intersection'](_0x366fb3[_0x4414('0x3f')],qs[_0x4414('0x46')](_0x1629a4['query'][_0x4414('0x46')]));_0x12e35d[_0x4414('0x45')]=_0x12e35d[_0x4414('0x45')][_0x4414('0x47')]?_0x12e35d[_0x4414('0x45')]:_0x366fb3[_0x4414('0x3f')];if(!_0x1629a4['query']['hasOwnProperty'](_0x4414('0x48'))){_0x12e35d[_0x4414('0x30')]=qs[_0x4414('0x30')](_0x1629a4[_0x4414('0x41')][_0x4414('0x30')]);_0x12e35d[_0x4414('0x2e')]=qs['offset'](_0x1629a4[_0x4414('0x41')][_0x4414('0x2e')]);}_0x12e35d[_0x4414('0x49')]=qs[_0x4414('0x4a')](_0x1629a4[_0x4414('0x41')][_0x4414('0x4a')]);_0x12e35d[_0x4414('0x4b')]=qs[_0x4414('0x43')](_[_0x4414('0x4c')](_0x1629a4['query'],_0x366fb3['filters']),_0x43d2a3);if(_0x1629a4[_0x4414('0x41')]['filter']){_0x12e35d[_0x4414('0x4b')]=_[_0x4414('0x4d')](_0x12e35d[_0x4414('0x4b')],{'$or':_[_0x4414('0x3a')](_0x43d2a3,function(_0x2c7632){if(_0x2c7632[_0x4414('0x3e')]!==_0x4414('0x4e')){var _0xd56387={};_0xd56387[_0x2c7632[_0x4414('0x40')]]={'$like':'%'+_0x1629a4[_0x4414('0x41')]['filter']+'%'};return _0xd56387;}})});}_0x12e35d=_[_0x4414('0x4d')]({},_0x12e35d,_0x1629a4[_0x4414('0x4f')]);var _0x2214ca={'where':_0x12e35d[_0x4414('0x4b')]};return db['ChatMessage'][_0x4414('0x31')](_0x2214ca)[_0x4414('0x36')](function(_0x454917){_0x454ddc[_0x4414('0x31')]=_0x454917;if(_0x1629a4[_0x4414('0x41')][_0x4414('0x50')]){_0x12e35d[_0x4414('0x51')]=[{'all':!![]}];}return db['ChatMessage'][_0x4414('0x52')](_0x12e35d);})[_0x4414('0x36')](function(_0x11f06a){_0x454ddc['rows']=_0x11f06a;return _0x454ddc;})[_0x4414('0x36')](respondWithFilteredResult(_0x5ccbde,_0x12e35d))[_0x4414('0x29')](handleError(_0x5ccbde,null));};exports[_0x4414('0x53')]=function(_0x2d42f3,_0x447f9d){var _0xb65119={'raw':!![],'where':{'id':_0x2d42f3[_0x4414('0x54')]['id']}},_0x560b76={};_0x560b76[_0x4414('0x3f')]=_[_0x4414('0x42')](db[_0x4414('0x3b')][_0x4414('0x3c')]);_0x560b76['query']=_[_0x4414('0x42')](_0x2d42f3[_0x4414('0x41')]);_0x560b76['filters']=_[_0x4414('0x44')](_0x560b76[_0x4414('0x3f')],_0x560b76[_0x4414('0x41')]);_0xb65119['attributes']=_['intersection'](_0x560b76['model'],qs[_0x4414('0x46')](_0x2d42f3[_0x4414('0x41')][_0x4414('0x46')]));_0xb65119['attributes']=_0xb65119[_0x4414('0x45')][_0x4414('0x47')]?_0xb65119['attributes']:_0x560b76[_0x4414('0x3f')];if(_0x2d42f3[_0x4414('0x41')][_0x4414('0x50')]){_0xb65119[_0x4414('0x51')]=[{'all':!![]}];}_0xb65119=_[_0x4414('0x4d')]({},_0xb65119,_0x2d42f3['options']);return db[_0x4414('0x3b')]['find'](_0xb65119)[_0x4414('0x36')](handleEntityNotFound(_0x447f9d,null))[_0x4414('0x36')](respondWithResult(_0x447f9d,null))[_0x4414('0x29')](handleError(_0x447f9d,null));};exports[_0x4414('0x55')]=function(_0x42a78e,_0x237b4b){return db[_0x4414('0x3b')]['create'](_0x42a78e['body'],{})['then'](respondWithResult(_0x237b4b,0xc9))[_0x4414('0x29')](handleError(_0x237b4b,null));};exports[_0x4414('0x56')]=function(_0x4c8330,_0x5d5601){if(_0x4c8330[_0x4414('0x57')]['id']){delete _0x4c8330[_0x4414('0x57')]['id'];}return db[_0x4414('0x3b')][_0x4414('0x58')]({'where':{'id':_0x4c8330[_0x4414('0x54')]['id']}})[_0x4414('0x36')](handleEntityNotFound(_0x5d5601,null))['then'](saveUpdates(_0x4c8330[_0x4414('0x57')],null))[_0x4414('0x36')](respondWithResult(_0x5d5601,null))[_0x4414('0x29')](handleError(_0x5d5601,null));};exports['destroy']=function(_0x13e873,_0x47b1d9){return db[_0x4414('0x3b')][_0x4414('0x58')]({'where':{'id':_0x13e873['params']['id']}})[_0x4414('0x36')](handleEntityNotFound(_0x47b1d9,null))[_0x4414('0x36')](removeEntity(_0x47b1d9,null))[_0x4414('0x29')](handleError(_0x47b1d9,null));};exports[_0x4414('0x59')]=function(_0x5157be,_0x405dbc){return db[_0x4414('0x3b')][_0x4414('0x59')]()[_0x4414('0x36')](respondWithResult(_0x405dbc,null))[_0x4414('0x29')](handleError(_0x405dbc,null));};var interaction_log=require(_0x4414('0x5a'))(_0x4414('0x5b'));exports['accept']=function(_0x3ba75c,_0xdb0fbd,_0x5a1b41){var _0x3b343e={'agent':{},'channel':_0x4414('0x5c')};if(_0x3ba75c[_0x4414('0x57')]['id']){delete _0x3ba75c['body']['id'];}_0x3ba75c[_0x4414('0x57')]['read']=!![];_0x3ba75c['body']['readAt']=moment()[_0x4414('0x5d')](_0x4414('0x5e'));_0x3ba75c[_0x4414('0x57')][_0x4414('0x5f')]=_0x3ba75c[_0x4414('0x57')][_0x4414('0x5f')]||_0x3ba75c[_0x4414('0x60')]['id'];_0x3b343e['agent']['id']=_0x3ba75c[_0x4414('0x57')][_0x4414('0x5f')];return db['ChatMessage'][_0x4414('0x58')]({'where':{'id':_0x3ba75c[_0x4414('0x54')]['id'],'UserId':null}})[_0x4414('0x36')](handleEntityNotFound(_0xdb0fbd,null))[_0x4414('0x36')](saveUpdates(_0x3ba75c[_0x4414('0x57')],null))['then'](function(_0x273937){if(_0x273937){_0x3b343e['message']=_0x273937[_0x4414('0x61')]({'plain':!![]});return db[_0x4414('0x62')]['find']({'where':{'id':_0x273937['ChatInteractionId']}});}return null;})[_0x4414('0x36')](handleEntityNotFound(_0xdb0fbd,null))[_0x4414('0x36')](function(_0x58832e){if(_0x58832e){return _0x58832e[_0x4414('0x56')]({'UserId':_0x3ba75c[_0x4414('0x57')][_0x4414('0x5f')],'read1stAt':_[_0x4414('0x63')](_0x58832e[_0x4414('0x64')])?moment()[_0x4414('0x5d')](_0x4414('0x5e')):undefined});}return null;})['then'](function(_0x356900){if(_0x356900){_0x3b343e['interaction']=_0x356900[_0x4414('0x61')]({'plain':!![]});interaction_log[_0x4414('0x22')](_0x4414('0x65'),_0x3ba75c[_0x4414('0x60')]['id'],_0x3ba75c[_0x4414('0x60')][_0x4414('0x40')],_0x3ba75c[_0x4414('0x60')][_0x4414('0x66')],_0x3b343e[_0x4414('0x67')]['id'],_0x3ba75c[_0x4414('0x57')]?JSON[_0x4414('0x26')](_0x3ba75c['body']):_0x4414('0x68'));return respondWithRpcPromise(_0x4414('0x69'),'acceptMessage',_0x3b343e);}return null;})[_0x4414('0x36')](function(_0x3dc5f6){var _0x77a7f8=_0x4414('0x6a')+_0x3dc5f6[_0x4414('0x28')][_0x4414('0x6b')];return db['sequelize'][_0x4414('0x41')](_0x77a7f8,{'type':db[_0x4414('0x6c')][_0x4414('0x6d')][_0x4414('0x6e')],'raw':!![]})[_0x4414('0x36')](function(_0x2647f9){return _0x2647f9;});})['then'](function(_0x4b8e08){if(_0x4b8e08){_0x3b343e[_0x4414('0x28')]['contact']=_0x4b8e08[0x0];if(!_0x3ba75c[_0x4414('0x57')][_0x4414('0x5f')])return;return db['User'][_0x4414('0x58')]({'where':{'id':_0x3ba75c[_0x4414('0x57')][_0x4414('0x5f')],'role':'agent'},'attributes':['id',_0x4414('0x40'),'fullname',_0x4414('0x6f'),_0x4414('0x70')],'raw':!![]});}return null;})[_0x4414('0x36')](function(_0x3c613c){if(!_0x3c613c)return null;_0x3b343e[_0x4414('0x28')][_0x4414('0x71')]=_0x3c613c;return _0x3b343e;})[_0x4414('0x36')](function(_0x13a1bd){if(_0x13a1bd){if(_0x3ba75c[_0x4414('0x57')][_0x4414('0x72')]){_0x3b343e[_0x4414('0x28')][_0x4414('0x73')]=util[_0x4414('0x5d')](_0x4414('0x74'),_0x3ba75c[_0x4414('0x60')][_0x4414('0x40')]);_0x3b343e[_0x4414('0x28')]['channel']=_0x3b343e[_0x4414('0x75')];_0x3b343e[_0x4414('0x28')][_0x4414('0x76')]=_0x3b343e[_0x4414('0x75')];_0x3b343e[_0x4414('0x28')][_0x4414('0x77')]=_0x4414('0x78');return respondWithRpcPromise(_0x4414('0x79'),_0x4414('0x79'),{'event':_0x4414('0x7a'),'message':_[_0x4414('0x4d')](_0x3b343e[_0x4414('0x28')],JSON[_0x4414('0x7b')](_0x3b343e[_0x4414('0x67')][_0x4414('0x7c')]))},client9002)[_0x4414('0x36')](function(){return _0x3b343e;});}return _0x3b343e;}return null;})[_0x4414('0x36')](respondWithResult(_0xdb0fbd,null))[_0x4414('0x29')](handleError(_0xdb0fbd,null));};var interaction_log=require(_0x4414('0x5a'))(_0x4414('0x5b'));exports[_0x4414('0x33')]=function(_0x5be01c,_0x2d4619,_0xbc0119){var _0x6f6345={'agent':{},'channel':'chat'};if(_0x5be01c['body']['id']){delete _0x5be01c[_0x4414('0x57')]['id'];}_0x5be01c[_0x4414('0x57')][_0x4414('0x5f')]=_0x5be01c[_0x4414('0x57')][_0x4414('0x5f')]||_0x5be01c[_0x4414('0x60')]['id'];_0x6f6345[_0x4414('0x71')]['id']=_0x5be01c[_0x4414('0x57')][_0x4414('0x5f')];return db[_0x4414('0x3b')][_0x4414('0x58')]({'where':{'id':_0x5be01c[_0x4414('0x54')]['id'],'UserId':null}})[_0x4414('0x36')](handleEntityNotFound(_0x2d4619,null))[_0x4414('0x36')](function(_0x3fe542){if(_0x3fe542){_0x6f6345[_0x4414('0x28')]=_0x3fe542[_0x4414('0x61')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x3fe542[_0x4414('0x7d')]}});}return null;})[_0x4414('0x36')](handleEntityNotFound(_0x2d4619,null))['then'](function(_0x2c16cf){if(_0x2c16cf){_0x6f6345[_0x4414('0x67')]=_0x2c16cf[_0x4414('0x61')]({'plain':!![]});interaction_log[_0x4414('0x22')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5be01c[_0x4414('0x60')]['id'],_0x5be01c[_0x4414('0x60')][_0x4414('0x40')],_0x5be01c[_0x4414('0x60')][_0x4414('0x66')],_0x6f6345[_0x4414('0x67')]['id'],_0x5be01c[_0x4414('0x57')]?JSON['stringify'](_0x5be01c[_0x4414('0x57')]):_0x4414('0x68'));return respondWithRpcPromise(_0x4414('0x7e'),_0x4414('0x7f'),_0x6f6345);}return null;})[_0x4414('0x36')](function(_0x26a634){var _0x150fbe=_0x4414('0x6a')+_0x26a634[_0x4414('0x28')][_0x4414('0x6b')];return db[_0x4414('0x80')][_0x4414('0x41')](_0x150fbe,{'type':db[_0x4414('0x6c')][_0x4414('0x6d')][_0x4414('0x6e')],'raw':!![]})[_0x4414('0x36')](function(_0x2cd7e6){return _0x2cd7e6;});})[_0x4414('0x36')](function(_0x543291){if(_0x543291){_0x6f6345[_0x4414('0x28')]['contact']=_0x543291[0x0];if(!_0x5be01c[_0x4414('0x57')][_0x4414('0x5f')])return;return db[_0x4414('0x81')][_0x4414('0x58')]({'where':{'id':_0x5be01c[_0x4414('0x57')]['UserId'],'role':_0x4414('0x71')},'attributes':['id',_0x4414('0x40'),_0x4414('0x82'),_0x4414('0x6f'),'internal'],'raw':!![]});}return null;})[_0x4414('0x36')](function(_0x5bba3b){if(!_0x5bba3b)return null;_0x6f6345[_0x4414('0x28')][_0x4414('0x71')]=_0x5bba3b;return _0x6f6345;})['then'](function(_0x3282fb){if(_0x3282fb){_0x3282fb[_0x4414('0x28')][_0x4414('0x73')]=util['format']('SIP/%s',_0x5be01c['user'][_0x4414('0x40')]);_0x3282fb[_0x4414('0x28')][_0x4414('0x75')]=_0x6f6345['channel'];_0x3282fb[_0x4414('0x28')][_0x4414('0x76')]=_0x6f6345[_0x4414('0x75')];_0x3282fb[_0x4414('0x28')][_0x4414('0x77')]=_0x4414('0x33');respondWithRpcPromise('EventManager',_0x4414('0x79'),{'event':'rejectmessage','message':_[_0x4414('0x4d')](_0x6f6345[_0x4414('0x28')],JSON[_0x4414('0x7b')](_0x6f6345[_0x4414('0x67')][_0x4414('0x7c')]))},client9002);return _0x6f6345;}return null;})[_0x4414('0x36')](respondWithResult(_0x2d4619,null))[_0x4414('0x29')](handleError(_0x2d4619,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index d8f20a9..876e0d9 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 _0x4fc2=['emit','hasOwnProperty','exports','ChatMessage','update','remove'];(function(_0x2f5102,_0x41ee06){var _0x3a20ea=function(_0x5317f0){while(--_0x5317f0){_0x2f5102['push'](_0x2f5102['shift']());}};_0x3a20ea(++_0x41ee06);}(_0x4fc2,0x99));var _0x24fc=function(_0x38231c,_0x1a5931){_0x38231c=_0x38231c-0x0;var _0x5be4e8=_0x4fc2[_0x38231c];return _0x5be4e8;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x24fc('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x24fc('0x1'),'afterDestroy':_0x24fc('0x2')};function emitEvent(_0x1ddcfe){return function(_0x3d0180,_0x227674,_0x3c5625){ChatMessageEvents['emit'](_0x1ddcfe+':'+_0x3d0180['id'],_0x3d0180);ChatMessageEvents[_0x24fc('0x3')](_0x1ddcfe,_0x3d0180);_0x3c5625(null);};}for(var e in events){if(events[_0x24fc('0x4')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x24fc('0x5')]=ChatMessageEvents; \ No newline at end of file +var _0x22b7=['setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x22b7,0x97));var _0x722b=function(_0x294a77,_0x8a359d){_0x294a77=_0x294a77-0x0;var _0x17db6d=_0x22b7[_0x294a77];return _0x17db6d;};'use strict';var EventEmitter=require(_0x722b('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x722b('0x1')](0x0);var events={'afterCreate':_0x722b('0x2'),'afterUpdate':_0x722b('0x3'),'afterDestroy':_0x722b('0x4')};function emitEvent(_0x6f62c6){return function(_0x3eb85b,_0x1a1732,_0x6986a3){ChatMessageEvents['emit'](_0x6f62c6+':'+_0x3eb85b['id'],_0x3eb85b);ChatMessageEvents['emit'](_0x6f62c6,_0x3eb85b);_0x6986a3(null);};}for(var e in events){if(events[_0x722b('0x5')](e)){var event=events[e];ChatMessage[_0x722b('0x6')](e,emitEvent(event));}}module[_0x722b('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index a775757..a326c40 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 _0xc434=['then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc434,0x17a));var _0x4c43=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc434[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0x4c43('0x0'));var logger=require(_0x4c43('0x1'))(_0x4c43('0x2'));var moment=require(_0x4c43('0x3'));var BPromise=require(_0x4c43('0x4'));var rp=require(_0x4c43('0x5'));var fs=require('fs');var path=require(_0x4c43('0x6'));var rimraf=require(_0x4c43('0x7'));var config=require(_0x4c43('0x8'));var attributes=require('./chatMessage.attributes');module[_0x4c43('0x9')]=function(_0x1c6a96,_0x8d5a2c){return _0x1c6a96[_0x4c43('0xa')]('ChatMessage',attributes,{'tableName':_0x4c43('0xb'),'paranoid':![],'indexes':[{'name':_0x4c43('0xc'),'fields':[_0x4c43('0xd')],'type':_0x4c43('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x553fb3,_0x400fdb,_0x5426ae){var _0xfc7da5=_0x1c6a96[_0x4c43('0xf')];var _0x58f807=_0x553fb3[_0x4c43('0x10')]({'plain':!![]});if(_0x58f807['direction'][_0x4c43('0x11')]()==='in'||_0x58f807[_0x4c43('0x12')][_0x4c43('0x11')]()===_0x4c43('0x13')&&!_0x58f807[_0x4c43('0x14')]&&!_[_0x4c43('0x15')](_0x58f807[_0x4c43('0x16')])){_0xfc7da5[_0x4c43('0x17')]['findOne']({'where':{'id':_0x58f807[_0x4c43('0x18')]}})[_0x4c43('0x19')](function(_0xc4df2a){if(_0xc4df2a){_0xc4df2a[_0x4c43('0x1a')]({'lastMsgAt':_0x58f807[_0x4c43('0x1b')],'lastMsgDirection':_0x58f807[_0x4c43('0x12')]['toLowerCase']()});}})[_0x4c43('0x1c')](function(_0x24b0c3){console['error'](_0x24b0c3);});}_0x5426ae();}},'charset':_0x4c43('0x1d'),'collate':_0x4c43('0x1e')});}; \ No newline at end of file +var _0x6fd7=['catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update'];(function(_0x3cf3e6,_0x4538ce){var _0x24711c=function(_0x6333a4){while(--_0x6333a4){_0x3cf3e6['push'](_0x3cf3e6['shift']());}};_0x24711c(++_0x4538ce);}(_0x6fd7,0x11c));var _0x76fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6fd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x76fd('0x0'));var util=require('util');var logger=require(_0x76fd('0x1'))(_0x76fd('0x2'));var moment=require('moment');var BPromise=require(_0x76fd('0x3'));var rp=require(_0x76fd('0x4'));var fs=require('fs');var path=require(_0x76fd('0x5'));var rimraf=require('rimraf');var config=require(_0x76fd('0x6'));var attributes=require(_0x76fd('0x7'));module['exports']=function(_0x23ae7d,_0x19242f){return _0x23ae7d['define']('ChatMessage',attributes,{'tableName':_0x76fd('0x8'),'paranoid':![],'indexes':[{'name':_0x76fd('0x9'),'fields':[_0x76fd('0xa')],'type':_0x76fd('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ba2e7,_0x28a3fe,_0x530846){var _0x27432e=_0x23ae7d[_0x76fd('0xc')];var _0x5eb376=_0x2ba2e7[_0x76fd('0xd')]({'plain':!![]});if(_0x5eb376[_0x76fd('0xe')][_0x76fd('0xf')]()==='in'||_0x5eb376[_0x76fd('0xe')][_0x76fd('0xf')]()===_0x76fd('0x10')&&!_0x5eb376[_0x76fd('0x11')]&&!_[_0x76fd('0x12')](_0x5eb376[_0x76fd('0x13')])){_0x27432e[_0x76fd('0x14')]['findOne']({'where':{'id':_0x5eb376[_0x76fd('0x15')]}})[_0x76fd('0x16')](function(_0x2b8739){if(_0x2b8739){_0x2b8739[_0x76fd('0x17')]({'lastMsgAt':_0x5eb376['createdAt'],'lastMsgDirection':_0x5eb376['direction'][_0x76fd('0xf')]()});}})[_0x76fd('0x18')](function(_0x5edbe4){console[_0x76fd('0x19')](_0x5edbe4);});}_0x530846();}},'charset':_0x76fd('0x1a'),'collate':_0x76fd('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index fbd7d6f..b72b47d 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 _0x6c18=['client','http','defaults','redis','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1dda93,_0x2b7426){var _0xf16237=function(_0x283c55){while(--_0x283c55){_0x1dda93['push'](_0x1dda93['shift']());}};_0xf16237(++_0x2b7426);}(_0x6c18,0x195));var _0x86c1=function(_0x347515,_0x2bd900){_0x347515=_0x347515-0x0;var _0x5c0e1c=_0x6c18[_0x347515];return _0x5c0e1c;};'use strict';var _=require(_0x86c1('0x0'));var util=require(_0x86c1('0x1'));var moment=require(_0x86c1('0x2'));var BPromise=require(_0x86c1('0x3'));var rs=require(_0x86c1('0x4'));var fs=require('fs');var Redis=require(_0x86c1('0x5'));var db=require(_0x86c1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x86c1('0x7'))(_0x86c1('0x8'));var config=require(_0x86c1('0x9'));var jayson=require(_0x86c1('0xa'));var client=jayson[_0x86c1('0xb')][_0x86c1('0xc')]({'port':0x232a});config['redis']=_[_0x86c1('0xd')](config[_0x86c1('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x86c1('0xe')]));require('./chatMessage.socket')[_0x86c1('0xf')](socket);function respondWithRpcPromise(_0xbf820a,_0x1e8cf6,_0x229f17){return new BPromise(function(_0x1eac1e,_0x50f633){return client['request'](_0xbf820a,_0x229f17)[_0x86c1('0x10')](function(_0x373ea1){logger[_0x86c1('0x11')](_0x86c1('0x12'),_0x1e8cf6,_0x86c1('0x13'));logger[_0x86c1('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1e8cf6,_0x86c1('0x13'),JSON[_0x86c1('0x15')](_0x373ea1));if(_0x373ea1[_0x86c1('0x16')]){if(_0x373ea1['error'][_0x86c1('0x17')]===0x1f4){logger[_0x86c1('0x16')](_0x86c1('0x12'),_0x1e8cf6,_0x373ea1[_0x86c1('0x16')]['message']);return _0x50f633(_0x373ea1['error'][_0x86c1('0x18')]);}logger[_0x86c1('0x16')](_0x86c1('0x12'),_0x1e8cf6,_0x373ea1['error'][_0x86c1('0x18')]);return _0x1eac1e(_0x373ea1['error'][_0x86c1('0x18')]);}else{logger[_0x86c1('0x11')](_0x86c1('0x12'),_0x1e8cf6,_0x86c1('0x13'));_0x1eac1e(_0x373ea1[_0x86c1('0x19')][_0x86c1('0x18')]);}})[_0x86c1('0x1a')](function(_0x119fbe){logger[_0x86c1('0x16')](_0x86c1('0x12'),_0x1e8cf6,_0x119fbe);_0x50f633(_0x119fbe);});});}exports[_0x86c1('0x1b')]=function(_0x4f9c5d){var _0x3c5e79=this;return new Promise(function(_0x4f9370,_0xb937cf){return db[_0x86c1('0x1c')][_0x86c1('0x1d')](_0x4f9c5d['body'],{'raw':_0x4f9c5d[_0x86c1('0x1e')]?_0x4f9c5d[_0x86c1('0x1e')][_0x86c1('0x1f')]===undefined?!![]:![]:!![]})[_0x86c1('0x10')](function(_0x5ae985){logger[_0x86c1('0x11')]('CreateChatMessage',_0x4f9c5d);logger['debug'](_0x86c1('0x1b'),_0x4f9c5d,JSON[_0x86c1('0x15')](_0x5ae985));_0x4f9370(_0x5ae985);})['catch'](function(_0x454c67){logger[_0x86c1('0x16')](_0x86c1('0x1b'),_0x454c67[_0x86c1('0x18')],_0x4f9c5d);_0xb937cf(_0x3c5e79['error'](0x1f4,_0x454c67['message']));});});}; \ No newline at end of file +var _0xbff1=['CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch'];(function(_0x5853d6,_0x4b418a){var _0x4902ae=function(_0x36e7c9){while(--_0x36e7c9){_0x5853d6['push'](_0x5853d6['shift']());}};_0x4902ae(++_0x4b418a);}(_0xbff1,0x1e6));var _0x1bff=function(_0x35e507,_0x171e16){_0x35e507=_0x35e507-0x0;var _0x51b71b=_0xbff1[_0x35e507];return _0x51b71b;};'use strict';var _=require(_0x1bff('0x0'));var util=require(_0x1bff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1bff('0x2'));var fs=require('fs');var Redis=require(_0x1bff('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1bff('0x4'));var config=require(_0x1bff('0x5'));var jayson=require(_0x1bff('0x6'));var client=jayson[_0x1bff('0x7')][_0x1bff('0x8')]({'port':0x232a});config[_0x1bff('0x9')]=_[_0x1bff('0xa')](config[_0x1bff('0x9')],{'host':_0x1bff('0xb'),'port':0x18eb});var socket=require(_0x1bff('0xc'))(new Redis(config[_0x1bff('0x9')]));require(_0x1bff('0xd'))[_0x1bff('0xe')](socket);function respondWithRpcPromise(_0x42dded,_0x5a567e,_0x2e8ae2){return new BPromise(function(_0xb7841b,_0x478c3e){return client[_0x1bff('0xf')](_0x42dded,_0x2e8ae2)[_0x1bff('0x10')](function(_0x423561){logger[_0x1bff('0x11')](_0x1bff('0x12'),_0x5a567e,'request\x20sent');logger['debug'](_0x1bff('0x13'),_0x5a567e,'request\x20sent',JSON[_0x1bff('0x14')](_0x423561));if(_0x423561[_0x1bff('0x15')]){if(_0x423561[_0x1bff('0x15')]['code']===0x1f4){logger['error'](_0x1bff('0x12'),_0x5a567e,_0x423561['error'][_0x1bff('0x16')]);return _0x478c3e(_0x423561[_0x1bff('0x15')][_0x1bff('0x16')]);}logger[_0x1bff('0x15')](_0x1bff('0x12'),_0x5a567e,_0x423561[_0x1bff('0x15')][_0x1bff('0x16')]);return _0xb7841b(_0x423561['error'][_0x1bff('0x16')]);}else{logger[_0x1bff('0x11')](_0x1bff('0x12'),_0x5a567e,_0x1bff('0x17'));_0xb7841b(_0x423561[_0x1bff('0x18')][_0x1bff('0x16')]);}})[_0x1bff('0x19')](function(_0x172f0a){logger['error']('ChatMessage,\x20%s,\x20%s',_0x5a567e,_0x172f0a);_0x478c3e(_0x172f0a);});});}exports[_0x1bff('0x1a')]=function(_0x2d0c8a){var _0x8f6730=this;return new Promise(function(_0x3608c5,_0x14bf15){return db[_0x1bff('0x1b')][_0x1bff('0x1c')](_0x2d0c8a[_0x1bff('0x1d')],{'raw':_0x2d0c8a[_0x1bff('0x1e')]?_0x2d0c8a[_0x1bff('0x1e')][_0x1bff('0x1f')]===undefined?!![]:![]:!![]})[_0x1bff('0x10')](function(_0x59118e){logger[_0x1bff('0x11')](_0x1bff('0x1a'),_0x2d0c8a);logger['debug'](_0x1bff('0x1a'),_0x2d0c8a,JSON[_0x1bff('0x14')](_0x59118e));_0x3608c5(_0x59118e);})['catch'](function(_0x314dfd){logger[_0x1bff('0x15')]('CreateChatMessage',_0x314dfd['message'],_0x2d0c8a);_0x14bf15(_0x8f6730[_0x1bff('0x15')](0x1f4,_0x314dfd['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 05aa096..589cb35 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 _0x55ca=['removeListener','register','./chatMessage.events','save'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x55ca,0x126));var _0xa55c=function(_0x2c5340,_0x5c86e5){_0x2c5340=_0x2c5340-0x0;var _0x3c505e=_0x55ca[_0x2c5340];return _0x3c505e;};'use strict';var ChatMessageEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),'remove','update'];function createListener(_0x49875a,_0x1c6ec3){return function(_0x267ea0){_0x1c6ec3['emit'](_0x49875a,_0x267ea0);};}function removeListener(_0x3b478a,_0x2db02a){return function(){ChatMessageEvents[_0xa55c('0x2')](_0x3b478a,_0x2db02a);};}exports[_0xa55c('0x3')]=function(_0x3c97c8){for(var _0x279caa=0x0,_0x36b623=events['length'];_0x279caa<_0x36b623;_0x279caa++){var _0x2121fd=events[_0x279caa];var _0x2537f0=createListener('chatMessage:'+_0x2121fd,_0x3c97c8);ChatMessageEvents['on'](_0x2121fd,_0x2537f0);}}; \ No newline at end of file +var _0x3645=['emit','removeListener','register','length','save','remove','update'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x3645,0x154));var _0x5364=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0x3645[_0x50e593];return _0x3821d0;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5364('0x0'),_0x5364('0x1'),_0x5364('0x2')];function createListener(_0x28eafb,_0x2d71d7){return function(_0x2f629b){_0x2d71d7[_0x5364('0x3')](_0x28eafb,_0x2f629b);};}function removeListener(_0x5a63bf,_0x334a16){return function(){ChatMessageEvents[_0x5364('0x4')](_0x5a63bf,_0x334a16);};}exports[_0x5364('0x5')]=function(_0x1f9c6b){for(var _0x417c44=0x0,_0x7933a5=events[_0x5364('0x6')];_0x417c44<_0x7933a5;_0x417c44++){var _0x43fb3f=events[_0x417c44];var _0x3c1b21=createListener('chatMessage:'+_0x43fb3f,_0x1f9c6b);ChatMessageEvents['on'](_0x43fb3f,_0x3c1b21);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index b9ec286..6b46456 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 _0xf453=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','tracked','chat','chatmessage:create','create','put','/:id','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x577087,_0x119fa4){var _0xc85fd5=function(_0x497c84){while(--_0x497c84){_0x577087['push'](_0x577087['shift']());}};_0xc85fd5(++_0x119fa4);}(_0xf453,0xa8));var _0x3f45=function(_0x5a5db5,_0x1f4853){_0x5a5db5=_0x5a5db5-0x0;var _0x151e5c=_0xf453[_0x5a5db5];return _0x151e5c;};'use strict';var multer=require(_0x3f45('0x0'));var util=require(_0x3f45('0x1'));var path=require(_0x3f45('0x2'));var timeout=require(_0x3f45('0x3'));var express=require(_0x3f45('0x4'));var router=express[_0x3f45('0x5')]();var fs_extra=require(_0x3f45('0x6'));var auth=require(_0x3f45('0x7'));var interaction=require(_0x3f45('0x8'));var config=require('../../config/environment');var controller=require(_0x3f45('0x9'));router[_0x3f45('0xa')]('/',auth[_0x3f45('0xb')](),controller[_0x3f45('0xc')]);router[_0x3f45('0xa')](_0x3f45('0xd'),auth['isAuthenticated'](),controller[_0x3f45('0xe')]);router['get']('/:id',auth[_0x3f45('0xb')](),controller[_0x3f45('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x3f45('0x10')](_0x3f45('0x11'),_0x3f45('0x12')),controller[_0x3f45('0x13')]);router[_0x3f45('0x14')](_0x3f45('0x15'),controller['update']);router[_0x3f45('0x14')]('/:id/accept',auth[_0x3f45('0xb')](),controller[_0x3f45('0x16')]);router['put'](_0x3f45('0x17'),auth[_0x3f45('0xb')](),controller[_0x3f45('0x18')]);router[_0x3f45('0x19')]('/:id',auth[_0x3f45('0xb')](),controller[_0x3f45('0x1a')]);module[_0x3f45('0x1b')]=router; \ No newline at end of file +var _0x6341=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','put','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4c7ac1,_0x8d28bb){var _0x53a962=function(_0xe335c){while(--_0xe335c){_0x4c7ac1['push'](_0x4c7ac1['shift']());}};_0x53a962(++_0x8d28bb);}(_0x6341,0x11a));var _0x1634=function(_0x1edfb0,_0x210068){_0x1edfb0=_0x1edfb0-0x0;var _0x11630f=_0x6341[_0x1edfb0];return _0x11630f;};'use strict';var multer=require(_0x1634('0x0'));var util=require('util');var path=require(_0x1634('0x1'));var timeout=require(_0x1634('0x2'));var express=require(_0x1634('0x3'));var router=express[_0x1634('0x4')]();var fs_extra=require(_0x1634('0x5'));var auth=require(_0x1634('0x6'));var interaction=require(_0x1634('0x7'));var config=require(_0x1634('0x8'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x1634('0x9')](),controller[_0x1634('0xa')]);router[_0x1634('0xb')](_0x1634('0xc'),auth['isAuthenticated'](),controller[_0x1634('0xd')]);router['get'](_0x1634('0xe'),auth['isAuthenticated'](),controller[_0x1634('0xf')]);router[_0x1634('0x10')]('/',auth[_0x1634('0x9')](),interaction[_0x1634('0x11')](_0x1634('0x12'),_0x1634('0x13')),controller['create']);router[_0x1634('0x14')](_0x1634('0xe'),controller['update']);router[_0x1634('0x14')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1634('0x14')](_0x1634('0x15'),auth[_0x1634('0x9')](),controller[_0x1634('0x16')]);router[_0x1634('0x17')]('/:id',auth[_0x1634('0x9')](),controller[_0x1634('0x18')]);module[_0x1634('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index b86dc2c..b801bae 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['medium','exports','TEXT'];(function(_0x2b7908,_0x53b8d5){var _0x4ddbb7=function(_0x299ac5){while(--_0x299ac5){_0x2b7908['push'](_0x2b7908['shift']());}};_0x4ddbb7(++_0x53b8d5);}(_0x2032,0xd9));var _0x2203=function(_0x141e35,_0x4c474b){_0x141e35=_0x141e35-0x0;var _0x1310f1=_0x2032[_0x141e35];return _0x1310f1;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x5f66=['medium','TEXT','exports'];(function(_0x54b254,_0x875cd7){var _0xc24259=function(_0x2e4a16){while(--_0x2e4a16){_0x54b254['push'](_0x54b254['shift']());}};_0xc24259(++_0x875cd7);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 7b46684..741f1bb 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7a54,0x106));var _0x47a5=function(_0x269a35,_0x3b2129){_0x269a35=_0x269a35-0x0;var _0x4c4c66=_0x7a54[_0x269a35];return _0x4c4c66;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x31bbd8,_0x46ce93){var _0x264a23=function(_0xd94c66){while(--_0xd94c66){_0x31bbd8['push'](_0x31bbd8['shift']());}};_0x264a23(++_0x46ce93);}(_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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index e4245f9..9ab2692 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 _0xfcb2=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatOfflineMessage'];(function(_0x678c26,_0x343c5d){var _0x4fc253=function(_0x19366c){while(--_0x19366c){_0x678c26['push'](_0x678c26['shift']());}};_0x4fc253(++_0x343c5d);}(_0xfcb2,0x1ae));var _0x2fcb=function(_0x2258a4,_0x3defca){_0x2258a4=_0x2258a4-0x0;var _0x3ba628=_0xfcb2[_0x2258a4];return _0x3ba628;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x2fcb('0x0'))['db'][_0x2fcb('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x2fcb('0x2')](0x0);var events={'afterCreate':_0x2fcb('0x3'),'afterUpdate':'update','afterDestroy':_0x2fcb('0x4')};function emitEvent(_0x5e8f55){return function(_0x30350f,_0x139a56,_0xfdb412){ChatOfflineMessageEvents[_0x2fcb('0x5')](_0x5e8f55+':'+_0x30350f['id'],_0x30350f);ChatOfflineMessageEvents['emit'](_0x5e8f55,_0x30350f);_0xfdb412(null);};}for(var e in events){if(events[_0x2fcb('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x2fcb('0x7')](e,emitEvent(event));}}module[_0x2fcb('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x1219=['save','remove','emit','hasOwnProperty','exports','events','setMaxListeners'];(function(_0x4587d8,_0x33379a){var _0x5d6b8e=function(_0x24b2a9){while(--_0x24b2a9){_0x4587d8['push'](_0x4587d8['shift']());}};_0x5d6b8e(++_0x33379a);}(_0x1219,0x1e8));var _0x9121=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1219[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x9121('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9121('0x1')](0x0);var events={'afterCreate':_0x9121('0x2'),'afterUpdate':'update','afterDestroy':_0x9121('0x3')};function emitEvent(_0x42d6ec){return function(_0x554268,_0x160acb,_0x51e796){ChatOfflineMessageEvents['emit'](_0x42d6ec+':'+_0x554268['id'],_0x554268);ChatOfflineMessageEvents[_0x9121('0x4')](_0x42d6ec,_0x554268);_0x51e796(null);};}for(var e in events){if(events[_0x9121('0x5')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x9121('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 27f8427..a0e75ed 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 _0x1afc=['ChatOfflineMessage','utf8mb4_unicode_ci','exports','define'];(function(_0xeac3cb,_0x18e4a5){var _0x3fa5dd=function(_0x5a7137){while(--_0x5a7137){_0xeac3cb['push'](_0xeac3cb['shift']());}};_0x3fa5dd(++_0x18e4a5);}(_0x1afc,0xe2));var _0xc1af=function(_0x114894,_0x139164){_0x114894=_0x114894-0x0;var _0x5ab69c=_0x1afc[_0x114894];return _0x5ab69c;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xc1af('0x0')]=function(_0x5009fd){return _0x5009fd[_0xc1af('0x1')](_0xc1af('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc1af('0x3')});}; \ No newline at end of file +var _0x2516=['ChatOfflineMessage','utf8mb4','exports'];(function(_0x300ad1,_0x1e6e46){var _0x59d01e=function(_0x5372d8){while(--_0x5372d8){_0x300ad1['push'](_0x300ad1['shift']());}};_0x59d01e(++_0x1e6e46);}(_0x2516,0xa1));var _0x6251=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x2516[_0xa6cc5c];return _0x44803d;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x6251('0x0')]=function(_0x348ed6){return _0x348ed6['define'](_0x6251('0x1'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6251('0x2'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 0130093..4e60dbf 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 _0x861a=['stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0x1259af,_0x4d1b93){var _0x27a0f3=function(_0x31d2a8){while(--_0x31d2a8){_0x1259af['push'](_0x1259af['shift']());}};_0x27a0f3(++_0x4d1b93);}(_0x861a,0x194));var _0xa861=function(_0x3c6b5f,_0x387ec5){_0x3c6b5f=_0x3c6b5f-0x0;var _0x54252c=_0x861a[_0x3c6b5f];return _0x54252c;};'use strict';var _=require(_0xa861('0x0'));var util=require('util');var moment=require(_0xa861('0x1'));var BPromise=require(_0xa861('0x2'));var rs=require(_0xa861('0x3'));var fs=require('fs');var Redis=require(_0xa861('0x4'));var db=require(_0xa861('0x5'))['db'];var utils=require(_0xa861('0x6'));var logger=require('../../config/logger')(_0xa861('0x7'));var config=require(_0xa861('0x8'));var jayson=require(_0xa861('0x9'));var client=jayson[_0xa861('0xa')][_0xa861('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bc6cb,_0x2c9016,_0x410918){return new BPromise(function(_0x46e2ce,_0x300ab7){return client[_0xa861('0xc')](_0x5bc6cb,_0x410918)[_0xa861('0xd')](function(_0x24e3ad){logger[_0xa861('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2c9016,'request\x20sent');logger[_0xa861('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x2c9016,'request\x20sent',JSON[_0xa861('0x10')](_0x24e3ad));if(_0x24e3ad[_0xa861('0x11')]){if(_0x24e3ad[_0xa861('0x11')]['code']===0x1f4){logger[_0xa861('0x11')](_0xa861('0x12'),_0x2c9016,_0x24e3ad[_0xa861('0x11')][_0xa861('0x13')]);return _0x300ab7(_0x24e3ad[_0xa861('0x11')]['message']);}logger['error'](_0xa861('0x12'),_0x2c9016,_0x24e3ad['error']['message']);return _0x46e2ce(_0x24e3ad[_0xa861('0x11')][_0xa861('0x13')]);}else{logger[_0xa861('0xe')](_0xa861('0x12'),_0x2c9016,'request\x20sent');_0x46e2ce(_0x24e3ad[_0xa861('0x14')]['message']);}})['catch'](function(_0x5503fd){logger[_0xa861('0x11')](_0xa861('0x12'),_0x2c9016,_0x5503fd);_0x300ab7(_0x5503fd);});});} \ No newline at end of file +var _0xac47=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x56500a,_0x5953c7){var _0x333977=function(_0x374007){while(--_0x374007){_0x56500a['push'](_0x56500a['shift']());}};_0x333977(++_0x5953c7);}(_0xac47,0x1af));var _0x7ac4=function(_0x347c14,_0xf2472f){_0x347c14=_0x347c14-0x0;var _0x46deb8=_0xac47[_0x347c14];return _0x46deb8;};'use strict';var _=require(_0x7ac4('0x0'));var util=require(_0x7ac4('0x1'));var moment=require(_0x7ac4('0x2'));var BPromise=require(_0x7ac4('0x3'));var rs=require(_0x7ac4('0x4'));var fs=require('fs');var Redis=require(_0x7ac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ac4('0x6'));var logger=require(_0x7ac4('0x7'))('rpc');var config=require(_0x7ac4('0x8'));var jayson=require(_0x7ac4('0x9'));var client=jayson[_0x7ac4('0xa')][_0x7ac4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x438c8e,_0x5c3623,_0x18c34d){return new BPromise(function(_0x435e68,_0xd8ec5f){return client[_0x7ac4('0xc')](_0x438c8e,_0x18c34d)[_0x7ac4('0xd')](function(_0x112fa0){logger[_0x7ac4('0xe')](_0x7ac4('0xf'),_0x5c3623,_0x7ac4('0x10'));logger[_0x7ac4('0x11')](_0x7ac4('0x12'),_0x5c3623,'request\x20sent',JSON[_0x7ac4('0x13')](_0x112fa0));if(_0x112fa0[_0x7ac4('0x14')]){if(_0x112fa0[_0x7ac4('0x14')]['code']===0x1f4){logger[_0x7ac4('0x14')](_0x7ac4('0xf'),_0x5c3623,_0x112fa0[_0x7ac4('0x14')]['message']);return _0xd8ec5f(_0x112fa0['error'][_0x7ac4('0x15')]);}logger[_0x7ac4('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5c3623,_0x112fa0[_0x7ac4('0x14')][_0x7ac4('0x15')]);return _0x435e68(_0x112fa0[_0x7ac4('0x14')][_0x7ac4('0x15')]);}else{logger['info'](_0x7ac4('0xf'),_0x5c3623,_0x7ac4('0x10'));_0x435e68(_0x112fa0[_0x7ac4('0x16')][_0x7ac4('0x15')]);}})[_0x7ac4('0x17')](function(_0x334141){logger[_0x7ac4('0x14')](_0x7ac4('0xf'),_0x5c3623,_0x334141);_0xd8ec5f(_0x334141);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index fdadfb5..4f49f18 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 _0x3b3b=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x3b3b,0x169));var _0xb3b3=function(_0x28d417,_0x253557){_0x28d417=_0x28d417-0x0;var _0x5b96f4=_0x3b3b[_0x28d417];return _0x5b96f4;};'use strict';var multer=require('multer');var util=require(_0xb3b3('0x0'));var path=require(_0xb3b3('0x1'));var timeout=require(_0xb3b3('0x2'));var express=require(_0xb3b3('0x3'));var router=express[_0xb3b3('0x4')]();var fs_extra=require(_0xb3b3('0x5'));var auth=require(_0xb3b3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb3b3('0x7'));var controller=require(_0xb3b3('0x8'));router[_0xb3b3('0x9')]('/',auth[_0xb3b3('0xa')](),controller[_0xb3b3('0xb')]);router['get'](_0xb3b3('0xc'),auth[_0xb3b3('0xa')](),controller[_0xb3b3('0xd')]);router[_0xb3b3('0x9')](_0xb3b3('0xe'),auth[_0xb3b3('0xa')](),controller['show']);router[_0xb3b3('0xf')]('/',auth[_0xb3b3('0xa')](),controller[_0xb3b3('0x10')]);router[_0xb3b3('0x11')](_0xb3b3('0xe'),auth[_0xb3b3('0xa')](),controller['update']);router[_0xb3b3('0x12')](_0xb3b3('0xe'),auth[_0xb3b3('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6e3c=['/describe','describe','/:id','show','post','create','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x6e3c,0xdb));var _0xc6e3=function(_0x492e2e,_0x5ce525){_0x492e2e=_0x492e2e-0x0;var _0x5344ec=_0x6e3c[_0x492e2e];return _0x5344ec;};'use strict';var multer=require(_0xc6e3('0x0'));var util=require(_0xc6e3('0x1'));var path=require(_0xc6e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xc6e3('0x3'));var router=express['Router']();var fs_extra=require(_0xc6e3('0x4'));var auth=require(_0xc6e3('0x5'));var interaction=require(_0xc6e3('0x6'));var config=require(_0xc6e3('0x7'));var controller=require(_0xc6e3('0x8'));router['get']('/',auth[_0xc6e3('0x9')](),controller[_0xc6e3('0xa')]);router[_0xc6e3('0xb')](_0xc6e3('0xc'),auth[_0xc6e3('0x9')](),controller[_0xc6e3('0xd')]);router[_0xc6e3('0xb')](_0xc6e3('0xe'),auth[_0xc6e3('0x9')](),controller[_0xc6e3('0xf')]);router[_0xc6e3('0x10')]('/',auth['isAuthenticated'](),controller[_0xc6e3('0x11')]);router[_0xc6e3('0x12')](_0xc6e3('0xe'),auth[_0xc6e3('0x9')](),controller[_0xc6e3('0x13')]);router[_0xc6e3('0x14')](_0xc6e3('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 2ce33d0..3a3ff93 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 _0x5453=['ENUM','mouseOver','STRING','INTEGER','exports'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0x5453,0x68));var _0x3545=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5453[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0x3545('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3545('0x1')](_0x3545('0x2'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x3545('0x3')]},'timeout':{'type':Sequelize[_0x3545('0x4')]}}; \ No newline at end of file +var _0xd5e8=['ENUM','timeout','INTEGER','sequelize','exports','STRING'];(function(_0x4d98d5,_0x253a00){var _0x53d960=function(_0x2d198c){while(--_0x2d198c){_0x4d98d5['push'](_0x4d98d5['shift']());}};_0x53d960(++_0x253a00);}(_0xd5e8,0x123));var _0x8d5e=function(_0x58d5e5,_0x362776){_0x58d5e5=_0x58d5e5-0x0;var _0x7ed8c9=_0xd5e8[_0x58d5e5];return _0x7ed8c9;};'use strict';var Sequelize=require(_0x8d5e('0x0'));module[_0x8d5e('0x1')]={'name':{'type':Sequelize[_0x8d5e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8d5e('0x3')]('mouseOver',_0x8d5e('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x8d5e('0x2')]},'timeout':{'type':Sequelize[_0x8d5e('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 5a2e07e..79c80a2 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 _0xa276=['querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','find','catch','body','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel'];(function(_0x6970d3,_0x14a3d2){var _0x4b7550=function(_0x48e474){while(--_0x48e474){_0x6970d3['push'](_0x6970d3['shift']());}};_0x4b7550(++_0x14a3d2);}(_0xa276,0x9a));var _0x6a27=function(_0x55123c,_0x586007){_0x55123c=_0x55123c-0x0;var _0x29acf3=_0xa276[_0x55123c];return _0x29acf3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a27('0x0'));var zipdir=require(_0x6a27('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a27('0x2'));var moment=require(_0x6a27('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6a27('0x4'));var util=require(_0x6a27('0x5'));var path=require(_0x6a27('0x6'));var sox=require('sox');var csv=require(_0x6a27('0x7'));var ejs=require(_0x6a27('0x8'));var fs=require('fs');var fs_extra=require(_0x6a27('0x9'));var _=require('lodash');var squel=require(_0x6a27('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a27('0xb'));var Papa=require(_0x6a27('0xc'));var Redis=require(_0x6a27('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6a27('0xe'));var hardwareService=require(_0x6a27('0xf'));var logger=require(_0x6a27('0x10'))(_0x6a27('0x11'));var utils=require(_0x6a27('0x12'));var config=require(_0x6a27('0x13'));var licenseUtil=require(_0x6a27('0x14'));var db=require(_0x6a27('0x15'))['db'];function respondWithStatusCode(_0x394307,_0x4a7209){_0x4a7209=_0x4a7209||0xcc;return function(_0x96472c){if(_0x96472c){return _0x394307['sendStatus'](_0x4a7209);}return _0x394307['status'](_0x4a7209)[_0x6a27('0x16')]();};}function respondWithResult(_0x1e987f,_0x39ef85){_0x39ef85=_0x39ef85||0xc8;return function(_0x5b28c6){if(_0x5b28c6){return _0x1e987f[_0x6a27('0x17')](_0x39ef85)[_0x6a27('0x18')](_0x5b28c6);}};}function respondWithFilteredResult(_0x318b61,_0x8f297b){return function(_0x294ac7){if(_0x294ac7){var _0x523e6d=typeof _0x8f297b['offset']===_0x6a27('0x19')&&typeof _0x8f297b[_0x6a27('0x1a')]===_0x6a27('0x19');var _0x4339d3=_0x294ac7[_0x6a27('0x1b')];var _0x1d5925=_0x523e6d?0x0:_0x8f297b['offset'];var _0x3fd414=_0x523e6d?_0x294ac7[_0x6a27('0x1b')]:_0x8f297b[_0x6a27('0x1c')]+_0x8f297b[_0x6a27('0x1a')];var _0x50ddcc;if(_0x3fd414>=_0x4339d3){_0x3fd414=_0x4339d3;_0x50ddcc=0xc8;}else{_0x50ddcc=0xce;}_0x318b61[_0x6a27('0x17')](_0x50ddcc);return _0x318b61[_0x6a27('0x1d')](_0x6a27('0x1e'),_0x1d5925+'-'+_0x3fd414+'/'+_0x4339d3)[_0x6a27('0x18')](_0x294ac7);}return null;};}function patchUpdates(_0x57649a){return function(_0x531d60){try{jsonpatch[_0x6a27('0x1f')](_0x531d60,_0x57649a,!![]);}catch(_0x4231c3){return BPromise['reject'](_0x4231c3);}return _0x531d60[_0x6a27('0x20')]();};}function saveUpdates(_0x2a7fdf,_0x13fc15){return function(_0x167076){if(_0x167076){return _0x167076[_0x6a27('0x21')](_0x2a7fdf)[_0x6a27('0x22')](function(_0x29348c){return _0x29348c;});}return null;};}function removeEntity(_0x13e148,_0x5e3a2e){return function(_0x241029){if(_0x241029){return _0x241029[_0x6a27('0x23')]()[_0x6a27('0x22')](function(){_0x13e148[_0x6a27('0x17')](0xcc)[_0x6a27('0x16')]();});}};}function handleEntityNotFound(_0x5f4897,_0x5b725c){return function(_0x30454b){if(!_0x30454b){_0x5f4897[_0x6a27('0x24')](0x194);}return _0x30454b;};}function handleError(_0x73dc52,_0x354781){_0x354781=_0x354781||0x1f4;return function(_0x54fc6c){logger[_0x6a27('0x25')](_0x54fc6c['stack']);if(_0x54fc6c['name']){delete _0x54fc6c[_0x6a27('0x26')];}_0x73dc52[_0x6a27('0x17')](_0x354781)['send'](_0x54fc6c);};}exports[_0x6a27('0x27')]=function(_0x52cc5d,_0x35fe1c){var _0xa42f9c={'raw':!![],'where':{'id':_0x52cc5d[_0x6a27('0x28')]['id']}},_0x5140b2={};_0x5140b2[_0x6a27('0x29')]=_[_0x6a27('0x2a')](db[_0x6a27('0x2b')][_0x6a27('0x2c')]);_0x5140b2[_0x6a27('0x2d')]=_[_0x6a27('0x2a')](_0x52cc5d[_0x6a27('0x2d')]);_0x5140b2['filters']=_[_0x6a27('0x2e')](_0x5140b2[_0x6a27('0x29')],_0x5140b2[_0x6a27('0x2d')]);_0xa42f9c[_0x6a27('0x2f')]=_['intersection'](_0x5140b2['model'],qs[_0x6a27('0x30')](_0x52cc5d['query'][_0x6a27('0x30')]));_0xa42f9c[_0x6a27('0x2f')]=_0xa42f9c[_0x6a27('0x2f')][_0x6a27('0x31')]?_0xa42f9c[_0x6a27('0x2f')]:_0x5140b2[_0x6a27('0x29')];if(_0x52cc5d[_0x6a27('0x2d')][_0x6a27('0x32')]){_0xa42f9c['include']=[{'all':!![]}];}_0xa42f9c=_[_0x6a27('0x33')]({},_0xa42f9c,_0x52cc5d['options']);return db[_0x6a27('0x2b')][_0x6a27('0x34')](_0xa42f9c)[_0x6a27('0x22')](handleEntityNotFound(_0x35fe1c,null))[_0x6a27('0x22')](respondWithResult(_0x35fe1c,null))[_0x6a27('0x35')](handleError(_0x35fe1c,null));};exports['create']=function(_0xabaac8,_0x316bb5){return db['ChatProactiveAction']['create'](_0xabaac8[_0x6a27('0x36')],{})[_0x6a27('0x22')](respondWithResult(_0x316bb5,0xc9))[_0x6a27('0x35')](handleError(_0x316bb5,null));};exports[_0x6a27('0x21')]=function(_0x1d9c1c,_0x3c3ad2){if(_0x1d9c1c['body']['id']){delete _0x1d9c1c[_0x6a27('0x36')]['id'];}return db['ChatProactiveAction'][_0x6a27('0x34')]({'where':{'id':_0x1d9c1c[_0x6a27('0x28')]['id']}})[_0x6a27('0x22')](handleEntityNotFound(_0x3c3ad2,null))[_0x6a27('0x22')](saveUpdates(_0x1d9c1c[_0x6a27('0x36')],null))[_0x6a27('0x22')](respondWithResult(_0x3c3ad2,null))[_0x6a27('0x35')](handleError(_0x3c3ad2,null));};exports[_0x6a27('0x23')]=function(_0x55020d,_0x43c9f3){return db['ChatProactiveAction']['find']({'where':{'id':_0x55020d[_0x6a27('0x28')]['id']}})[_0x6a27('0x22')](handleEntityNotFound(_0x43c9f3,null))[_0x6a27('0x22')](removeEntity(_0x43c9f3,null))[_0x6a27('0x35')](handleError(_0x43c9f3,null));}; \ No newline at end of file +var _0x62da=['ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','options','catch','create','body','update','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','save','then','stack','name','show','params','model','keys'];(function(_0x301dc6,_0xeb39b5){var _0x5d3f65=function(_0x3b6bb5){while(--_0x3b6bb5){_0x301dc6['push'](_0x301dc6['shift']());}};_0x5d3f65(++_0xeb39b5);}(_0x62da,0xc0));var _0xa62d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62da[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xa62d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa62d('0x1'));var jsonpatch=require(_0xa62d('0x2'));var rp=require(_0xa62d('0x3'));var moment=require(_0xa62d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa62d('0x5'));var util=require(_0xa62d('0x6'));var path=require(_0xa62d('0x7'));var sox=require(_0xa62d('0x8'));var csv=require(_0xa62d('0x9'));var ejs=require(_0xa62d('0xa'));var fs=require('fs');var fs_extra=require(_0xa62d('0xb'));var _=require(_0xa62d('0xc'));var squel=require(_0xa62d('0xd'));var crypto=require(_0xa62d('0xe'));var jsforce=require(_0xa62d('0xf'));var deskjs=require(_0xa62d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa62d('0x11'));var Papa=require(_0xa62d('0x12'));var Redis=require('ioredis');var authService=require(_0xa62d('0x13'));var qs=require(_0xa62d('0x14'));var as=require(_0xa62d('0x15'));var hardwareService=require(_0xa62d('0x16'));var logger=require(_0xa62d('0x17'))('api');var utils=require(_0xa62d('0x18'));var config=require(_0xa62d('0x19'));var licenseUtil=require(_0xa62d('0x1a'));var db=require(_0xa62d('0x1b'))['db'];function respondWithStatusCode(_0x1bcbd1,_0x34a938){_0x34a938=_0x34a938||0xcc;return function(_0x42093f){if(_0x42093f){return _0x1bcbd1[_0xa62d('0x1c')](_0x34a938);}return _0x1bcbd1[_0xa62d('0x1d')](_0x34a938)['end']();};}function respondWithResult(_0xa45469,_0x454371){_0x454371=_0x454371||0xc8;return function(_0x21ee83){if(_0x21ee83){return _0xa45469['status'](_0x454371)[_0xa62d('0x1e')](_0x21ee83);}};}function respondWithFilteredResult(_0x266330,_0x196ab8){return function(_0x3915ac){if(_0x3915ac){var _0x405cbf=typeof _0x196ab8['offset']===_0xa62d('0x1f')&&typeof _0x196ab8[_0xa62d('0x20')]===_0xa62d('0x1f');var _0x5506fd=_0x3915ac['count'];var _0x192e4e=_0x405cbf?0x0:_0x196ab8[_0xa62d('0x21')];var _0x8394e6=_0x405cbf?_0x3915ac[_0xa62d('0x22')]:_0x196ab8[_0xa62d('0x21')]+_0x196ab8['limit'];var _0x56e9a5;if(_0x8394e6>=_0x5506fd){_0x8394e6=_0x5506fd;_0x56e9a5=0xc8;}else{_0x56e9a5=0xce;}_0x266330[_0xa62d('0x1d')](_0x56e9a5);return _0x266330[_0xa62d('0x23')]('Content-Range',_0x192e4e+'-'+_0x8394e6+'/'+_0x5506fd)[_0xa62d('0x1e')](_0x3915ac);}return null;};}function patchUpdates(_0x5054c2){return function(_0xcaed36){try{jsonpatch['apply'](_0xcaed36,_0x5054c2,!![]);}catch(_0x43151e){return BPromise['reject'](_0x43151e);}return _0xcaed36[_0xa62d('0x24')]();};}function saveUpdates(_0x239d44,_0x31060b){return function(_0x5a4234){if(_0x5a4234){return _0x5a4234['update'](_0x239d44)[_0xa62d('0x25')](function(_0x14bd61){return _0x14bd61;});}return null;};}function removeEntity(_0x34e115,_0x40e577){return function(_0x5a5bb5){if(_0x5a5bb5){return _0x5a5bb5['destroy']()['then'](function(){_0x34e115[_0xa62d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36cfff,_0x1499ba){return function(_0x4e81d6){if(!_0x4e81d6){_0x36cfff['sendStatus'](0x194);}return _0x4e81d6;};}function handleError(_0x2527be,_0x5375bc){_0x5375bc=_0x5375bc||0x1f4;return function(_0x191dd6){logger['error'](_0x191dd6[_0xa62d('0x26')]);if(_0x191dd6['name']){delete _0x191dd6[_0xa62d('0x27')];}_0x2527be[_0xa62d('0x1d')](_0x5375bc)['send'](_0x191dd6);};}exports[_0xa62d('0x28')]=function(_0x4e954f,_0x31c426){var _0xfe2686={'raw':!![],'where':{'id':_0x4e954f[_0xa62d('0x29')]['id']}},_0xfab048={};_0xfab048[_0xa62d('0x2a')]=_[_0xa62d('0x2b')](db[_0xa62d('0x2c')][_0xa62d('0x2d')]);_0xfab048[_0xa62d('0x2e')]=_['keys'](_0x4e954f['query']);_0xfab048[_0xa62d('0x2f')]=_['intersection'](_0xfab048[_0xa62d('0x2a')],_0xfab048['query']);_0xfe2686[_0xa62d('0x30')]=_[_0xa62d('0x31')](_0xfab048['model'],qs[_0xa62d('0x32')](_0x4e954f[_0xa62d('0x2e')][_0xa62d('0x32')]));_0xfe2686[_0xa62d('0x30')]=_0xfe2686['attributes'][_0xa62d('0x33')]?_0xfe2686[_0xa62d('0x30')]:_0xfab048[_0xa62d('0x2a')];if(_0x4e954f[_0xa62d('0x2e')][_0xa62d('0x34')]){_0xfe2686['include']=[{'all':!![]}];}_0xfe2686=_['merge']({},_0xfe2686,_0x4e954f[_0xa62d('0x35')]);return db[_0xa62d('0x2c')]['find'](_0xfe2686)[_0xa62d('0x25')](handleEntityNotFound(_0x31c426,null))[_0xa62d('0x25')](respondWithResult(_0x31c426,null))[_0xa62d('0x36')](handleError(_0x31c426,null));};exports[_0xa62d('0x37')]=function(_0x599822,_0x3abab6){return db[_0xa62d('0x2c')][_0xa62d('0x37')](_0x599822[_0xa62d('0x38')],{})[_0xa62d('0x25')](respondWithResult(_0x3abab6,0xc9))[_0xa62d('0x36')](handleError(_0x3abab6,null));};exports[_0xa62d('0x39')]=function(_0x43a895,_0x1f3494){if(_0x43a895['body']['id']){delete _0x43a895[_0xa62d('0x38')]['id'];}return db[_0xa62d('0x2c')][_0xa62d('0x3a')]({'where':{'id':_0x43a895[_0xa62d('0x29')]['id']}})[_0xa62d('0x25')](handleEntityNotFound(_0x1f3494,null))[_0xa62d('0x25')](saveUpdates(_0x43a895[_0xa62d('0x38')],null))[_0xa62d('0x25')](respondWithResult(_0x1f3494,null))[_0xa62d('0x36')](handleError(_0x1f3494,null));};exports['destroy']=function(_0x16df50,_0x124268){return db['ChatProactiveAction'][_0xa62d('0x3a')]({'where':{'id':_0x16df50[_0xa62d('0x29')]['id']}})[_0xa62d('0x25')](handleEntityNotFound(_0x124268,null))[_0xa62d('0x25')](removeEntity(_0x124268,null))['catch'](handleError(_0x124268,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index b11793c..3232fa4 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 _0x4c93=['define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x53f707,_0x51a2f7){var _0x10a9f5=function(_0x14b513){while(--_0x14b513){_0x53f707['push'](_0x53f707['shift']());}};_0x10a9f5(++_0x51a2f7);}(_0x4c93,0x1d1));var _0x34c9=function(_0x5b5d10,_0x4ebc90){_0x5b5d10=_0x5b5d10-0x0;var _0x5138ab=_0x4c93[_0x5b5d10];return _0x5138ab;};'use strict';var _=require(_0x34c9('0x0'));var util=require(_0x34c9('0x1'));var logger=require(_0x34c9('0x2'))(_0x34c9('0x3'));var moment=require('moment');var BPromise=require(_0x34c9('0x4'));var rp=require(_0x34c9('0x5'));var fs=require('fs');var path=require(_0x34c9('0x6'));var rimraf=require(_0x34c9('0x7'));var config=require(_0x34c9('0x8'));var attributes=require(_0x34c9('0x9'));module[_0x34c9('0xa')]=function(_0xf719bc,_0x4ada44){return _0xf719bc[_0x34c9('0xb')](_0x34c9('0xc'),attributes,{'tableName':_0x34c9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42ad=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x311c3c,_0x2e4fcc){var _0x5591c0=function(_0x1efbe6){while(--_0x1efbe6){_0x311c3c['push'](_0x311c3c['shift']());}};_0x5591c0(++_0x2e4fcc);}(_0x42ad,0x68));var _0xd42a=function(_0x2c8991,_0x4a2970){_0x2c8991=_0x2c8991-0x0;var _0x2129c9=_0x42ad[_0x2c8991];return _0x2129c9;};'use strict';var _=require(_0xd42a('0x0'));var util=require(_0xd42a('0x1'));var logger=require(_0xd42a('0x2'))(_0xd42a('0x3'));var moment=require(_0xd42a('0x4'));var BPromise=require(_0xd42a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd42a('0x6'));var rimraf=require(_0xd42a('0x7'));var config=require('../../config/environment');var attributes=require(_0xd42a('0x8'));module[_0xd42a('0x9')]=function(_0x5db48d,_0x582deb){return _0x5db48d[_0xd42a('0xa')](_0xd42a('0xb'),attributes,{'tableName':_0xd42a('0xc'),'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 ae24226..db6c6ce 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 _0xac69=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xac69,0x160));var _0x9ac6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xac69[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9ac6('0x0'));var util=require(_0x9ac6('0x1'));var moment=require(_0x9ac6('0x2'));var BPromise=require(_0x9ac6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ac6('0x4'));var db=require(_0x9ac6('0x5'))['db'];var utils=require(_0x9ac6('0x6'));var logger=require(_0x9ac6('0x7'))(_0x9ac6('0x8'));var config=require(_0x9ac6('0x9'));var jayson=require(_0x9ac6('0xa'));var client=jayson[_0x9ac6('0xb')][_0x9ac6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb02b1,_0x2ed8c6,_0x46f97f){return new BPromise(function(_0x3c7456,_0x23c51b){return client[_0x9ac6('0xd')](_0xb02b1,_0x46f97f)[_0x9ac6('0xe')](function(_0x93803e){logger[_0x9ac6('0xf')](_0x9ac6('0x10'),_0x2ed8c6,'request\x20sent');logger[_0x9ac6('0x11')](_0x9ac6('0x12'),_0x2ed8c6,_0x9ac6('0x13'),JSON[_0x9ac6('0x14')](_0x93803e));if(_0x93803e[_0x9ac6('0x15')]){if(_0x93803e['error'][_0x9ac6('0x16')]===0x1f4){logger[_0x9ac6('0x15')](_0x9ac6('0x10'),_0x2ed8c6,_0x93803e['error'][_0x9ac6('0x17')]);return _0x23c51b(_0x93803e['error'][_0x9ac6('0x17')]);}logger['error'](_0x9ac6('0x10'),_0x2ed8c6,_0x93803e[_0x9ac6('0x15')][_0x9ac6('0x17')]);return _0x3c7456(_0x93803e[_0x9ac6('0x15')][_0x9ac6('0x17')]);}else{logger[_0x9ac6('0xf')](_0x9ac6('0x10'),_0x2ed8c6,_0x9ac6('0x13'));_0x3c7456(_0x93803e[_0x9ac6('0x18')]['message']);}})['catch'](function(_0x5b73bb){logger[_0x9ac6('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x2ed8c6,_0x5b73bb);_0x23c51b(_0x5b73bb);});});} \ No newline at end of file +var _0xc554=['then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1ddb32,_0x42f48b){var _0x5b5036=function(_0x51f50e){while(--_0x51f50e){_0x1ddb32['push'](_0x1ddb32['shift']());}};_0x5b5036(++_0x42f48b);}(_0xc554,0x196));var _0x4c55=function(_0x3f4f3b,_0x2d7be2){_0x3f4f3b=_0x3f4f3b-0x0;var _0xfc6f02=_0xc554[_0x3f4f3b];return _0xfc6f02;};'use strict';var _=require(_0x4c55('0x0'));var util=require('util');var moment=require(_0x4c55('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c55('0x2'));var fs=require('fs');var Redis=require(_0x4c55('0x3'));var db=require(_0x4c55('0x4'))['db'];var utils=require(_0x4c55('0x5'));var logger=require(_0x4c55('0x6'))(_0x4c55('0x7'));var config=require(_0x4c55('0x8'));var jayson=require(_0x4c55('0x9'));var client=jayson[_0x4c55('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a11d6,_0x40c478,_0x392c5a){return new BPromise(function(_0x567521,_0x36311b){return client[_0x4c55('0xb')](_0x4a11d6,_0x392c5a)[_0x4c55('0xc')](function(_0x470c24){logger[_0x4c55('0xd')](_0x4c55('0xe'),_0x40c478,'request\x20sent');logger[_0x4c55('0xf')](_0x4c55('0x10'),_0x40c478,_0x4c55('0x11'),JSON[_0x4c55('0x12')](_0x470c24));if(_0x470c24[_0x4c55('0x13')]){if(_0x470c24['error']['code']===0x1f4){logger[_0x4c55('0x13')](_0x4c55('0xe'),_0x40c478,_0x470c24[_0x4c55('0x13')][_0x4c55('0x14')]);return _0x36311b(_0x470c24['error'][_0x4c55('0x14')]);}logger[_0x4c55('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x40c478,_0x470c24[_0x4c55('0x13')]['message']);return _0x567521(_0x470c24['error'][_0x4c55('0x14')]);}else{logger['info'](_0x4c55('0xe'),_0x40c478,_0x4c55('0x11'));_0x567521(_0x470c24[_0x4c55('0x15')][_0x4c55('0x14')]);}})['catch'](function(_0x458a40){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x40c478,_0x458a40);_0x36311b(_0x458a40);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 7227683..eaee829 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 _0xdbf5=['post','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x2b634f,_0x585e28){var _0x56e0ba=function(_0x416657){while(--_0x416657){_0x2b634f['push'](_0x2b634f['shift']());}};_0x56e0ba(++_0x585e28);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x39805e,_0x56a3c0){_0x39805e=_0x39805e-0x0;var _0x44eb0b=_0xdbf5[_0x39805e];return _0x44eb0b;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')](_0x5dbf('0x9'),auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xb')]);router[_0x5dbf('0xc')]('/',auth[_0x5dbf('0xa')](),controller['create']);router[_0x5dbf('0xd')]('/:id',auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xe')]);router[_0x5dbf('0xf')](_0x5dbf('0x9'),auth['isAuthenticated'](),controller[_0x5dbf('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x2eb2,0x19f));var _0x22eb=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x2eb2[_0x45e98e];return _0x374dba;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 2d9a8fa..8c5f50d 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 _0xf0b2=['name','STRING','INTEGER','ENUM','rrmemory','sequelize'];(function(_0xd06df9,_0x42eb29){var _0x144a22=function(_0x4634a2){while(--_0x4634a2){_0xd06df9['push'](_0xd06df9['shift']());}};_0x144a22(++_0x42eb29);}(_0xf0b2,0x18b));var _0x2f0b=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xf0b2[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0x2f0b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x2f0b('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2f0b('0x2')]},'timeout':{'type':Sequelize[_0x2f0b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2f0b('0x4')](_0x2f0b('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x6279=['beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6279,0x1dc));var _0x9627=function(_0x4ccf96,_0x34978e){_0x4ccf96=_0x4ccf96-0x0;var _0xd103b7=_0x6279[_0x4ccf96];return _0xd103b7;};'use strict';var Sequelize=require(_0x9627('0x0'));module[_0x9627('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9627('0x2')]},'timeout':{'type':Sequelize[_0x9627('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x9627('0x4'),_0x9627('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index c788565..03a09f7 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 _0xf952=['describe','getMembers','UserChatQueue','nolimit','sort','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','%s/%s','getTeams','findOne','Team','addTeams','ids','online','voicePause','flatMap','Agents','transaction','each','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','includes','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','get','ChatQueues','stack','name','send','map','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','ChatQueue','include','findAll','rows','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy'];(function(_0x15a6b6,_0x5bdea4){var _0x29ec64=function(_0x4a5d39){while(--_0x4a5d39){_0x15a6b6['push'](_0x15a6b6['shift']());}};_0x29ec64(++_0x5bdea4);}(_0xf952,0x1f2));var _0x2f95=function(_0x4f2b55,_0x4735dc){_0x4f2b55=_0x4f2b55-0x0;var _0x51692c=_0xf952[_0x4f2b55];return _0x51692c;};'use strict';var emlformat=require(_0x2f95('0x0'));var rimraf=require(_0x2f95('0x1'));var zipdir=require(_0x2f95('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2f95('0x3'));var BPromise=require(_0x2f95('0x4'));var Mustache=require(_0x2f95('0x5'));var util=require(_0x2f95('0x6'));var path=require(_0x2f95('0x7'));var sox=require(_0x2f95('0x8'));var csv=require(_0x2f95('0x9'));var ejs=require(_0x2f95('0xa'));var fs=require('fs');var fs_extra=require(_0x2f95('0xb'));var _=require(_0x2f95('0xc'));var squel=require(_0x2f95('0xd'));var crypto=require(_0x2f95('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2f95('0x9'));var querystring=require('querystring');var Papa=require(_0x2f95('0xf'));var Redis=require(_0x2f95('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2f95('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f95('0x12'));var logger=require(_0x2f95('0x13'))('api');var utils=require(_0x2f95('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2f95('0x15'));var db=require('../../mysqldb')['db'];config[_0x2f95('0x16')]=_[_0x2f95('0x17')](config[_0x2f95('0x16')],{'host':_0x2f95('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2f95('0x19'))[_0x2f95('0x1a')](socket);var jayson=require(_0x2f95('0x1b'));var client=jayson[_0x2f95('0x1c')][_0x2f95('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x50db0d,_0x265f97,_0x70c917,_0x10977e){return new BPromise(function(_0x2f4f42,_0x4c680e){var _0x3dfb2e=_0x10977e||client;return _0x3dfb2e[_0x2f95('0x1e')](_0x50db0d,_0x70c917)[_0x2f95('0x1f')](function(_0x5d15ca){logger[_0x2f95('0x20')](_0x2f95('0x21'),_0x265f97,_0x2f95('0x22'));logger[_0x2f95('0x23')](_0x2f95('0x24'),_0x265f97,_0x2f95('0x22'),JSON[_0x2f95('0x25')](_0x5d15ca));if(_0x5d15ca['error']){if(_0x5d15ca[_0x2f95('0x26')]['code']===0x1f4){logger[_0x2f95('0x26')](_0x2f95('0x21'),_0x265f97,_0x5d15ca[_0x2f95('0x26')][_0x2f95('0x27')]);return _0x4c680e(_0x5d15ca[_0x2f95('0x26')][_0x2f95('0x27')]);}logger[_0x2f95('0x26')](_0x2f95('0x21'),_0x265f97,_0x5d15ca['error'][_0x2f95('0x27')]);return _0x2f4f42(_0x5d15ca[_0x2f95('0x26')]['message']);}else{logger[_0x2f95('0x20')](_0x2f95('0x21'),_0x265f97,_0x2f95('0x22'));_0x2f4f42(_0x5d15ca[_0x2f95('0x28')][_0x2f95('0x27')]);}})[_0x2f95('0x29')](function(_0x59d39f){logger[_0x2f95('0x26')](_0x2f95('0x21'),_0x265f97,_0x59d39f);_0x4c680e(_0x59d39f);});});}function respondWithStatusCode(_0x43c507,_0x45c71b){_0x45c71b=_0x45c71b||0xcc;return function(_0x1c8bed){if(_0x1c8bed){return _0x43c507[_0x2f95('0x2a')](_0x45c71b);}return _0x43c507[_0x2f95('0x2b')](_0x45c71b)[_0x2f95('0x2c')]();};}function respondWithResult(_0xa2544c,_0x1802e0){_0x1802e0=_0x1802e0||0xc8;return function(_0xb68ec8){if(_0xb68ec8){return _0xa2544c[_0x2f95('0x2b')](_0x1802e0)[_0x2f95('0x2d')](_0xb68ec8);}};}function respondWithFilteredResult(_0x5b2940,_0x286aea){return function(_0x4dad8c){if(_0x4dad8c){var _0x4a981e=typeof _0x286aea[_0x2f95('0x2e')]==='undefined'&&typeof _0x286aea[_0x2f95('0x2f')]===_0x2f95('0x30');var _0x1d8854=_0x4dad8c['count'];var _0x4d609a=_0x4a981e?0x0:_0x286aea[_0x2f95('0x2e')];var _0x23eb9c=_0x4a981e?_0x4dad8c[_0x2f95('0x31')]:_0x286aea[_0x2f95('0x2e')]+_0x286aea[_0x2f95('0x2f')];var _0x320b20;if(_0x23eb9c>=_0x1d8854){_0x23eb9c=_0x1d8854;_0x320b20=0xc8;}else{_0x320b20=0xce;}_0x5b2940[_0x2f95('0x2b')](_0x320b20);return _0x5b2940[_0x2f95('0x32')](_0x2f95('0x33'),_0x4d609a+'-'+_0x23eb9c+'/'+_0x1d8854)[_0x2f95('0x2d')](_0x4dad8c);}return null;};}function patchUpdates(_0x57f0d9){return function(_0x487d2a){try{jsonpatch[_0x2f95('0x34')](_0x487d2a,_0x57f0d9,!![]);}catch(_0x1a9c75){return BPromise['reject'](_0x1a9c75);}return _0x487d2a[_0x2f95('0x35')]();};}function saveUpdates(_0x239d57,_0x477b67){return function(_0x1b5af9){if(_0x1b5af9){return _0x1b5af9['update'](_0x239d57)[_0x2f95('0x1f')](function(_0x2d137d){return _0x2d137d;});}return null;};}function removeEntity(_0x5c8d56,_0x2e1c83){return function(_0x578361){if(_0x578361){return _0x578361['destroy']()[_0x2f95('0x1f')](function(){var _0x145d6e=_0x578361[_0x2f95('0x36')]({'plain':!![]});var _0x3ad839=_0x2f95('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x3ad839,'resourceId':_0x145d6e['id']}})[_0x2f95('0x1f')](function(){return _0x578361;});})[_0x2f95('0x1f')](function(){_0x5c8d56[_0x2f95('0x2b')](0xcc)[_0x2f95('0x2c')]();});}};}function handleEntityNotFound(_0x2d52f5,_0x4ee077){return function(_0x4747b8){if(!_0x4747b8){_0x2d52f5['sendStatus'](0x194);}return _0x4747b8;};}function handleError(_0x5c3b6d,_0x1dff06){_0x1dff06=_0x1dff06||0x1f4;return function(_0x2d0f70){logger['error'](_0x2d0f70[_0x2f95('0x38')]);if(_0x2d0f70['name']){delete _0x2d0f70[_0x2f95('0x39')];}_0x5c3b6d[_0x2f95('0x2b')](_0x1dff06)[_0x2f95('0x3a')](_0x2d0f70);};}exports['index']=function(_0x117fe1,_0x410a10){var _0xa79db2={},_0x2fbefc={},_0x586e07={'count':0x0,'rows':[]};var _0x49d035=_[_0x2f95('0x3b')](db['ChatQueue'][_0x2f95('0x3c')],function(_0x1ce9af){return{'name':_0x1ce9af[_0x2f95('0x3d')],'type':_0x1ce9af[_0x2f95('0x3e')]['key']};});_0x2fbefc['model']=_[_0x2f95('0x3b')](_0x49d035,'name');_0x2fbefc['query']=_[_0x2f95('0x3f')](_0x117fe1[_0x2f95('0x40')]);_0x2fbefc[_0x2f95('0x41')]=_[_0x2f95('0x42')](_0x2fbefc[_0x2f95('0x43')],_0x2fbefc[_0x2f95('0x40')]);_0xa79db2[_0x2f95('0x44')]=_[_0x2f95('0x42')](_0x2fbefc[_0x2f95('0x43')],qs[_0x2f95('0x45')](_0x117fe1[_0x2f95('0x40')][_0x2f95('0x45')]));_0xa79db2['attributes']=_0xa79db2[_0x2f95('0x44')]['length']?_0xa79db2[_0x2f95('0x44')]:_0x2fbefc[_0x2f95('0x43')];if(!_0x117fe1[_0x2f95('0x40')][_0x2f95('0x46')]('nolimit')){_0xa79db2[_0x2f95('0x2f')]=qs[_0x2f95('0x2f')](_0x117fe1['query'][_0x2f95('0x2f')]);_0xa79db2[_0x2f95('0x2e')]=qs[_0x2f95('0x2e')](_0x117fe1[_0x2f95('0x40')][_0x2f95('0x2e')]);}_0xa79db2[_0x2f95('0x47')]=qs['sort'](_0x117fe1[_0x2f95('0x40')]['sort']);_0xa79db2[_0x2f95('0x48')]=qs['filters'](_[_0x2f95('0x49')](_0x117fe1[_0x2f95('0x40')],_0x2fbefc['filters']),_0x49d035);if(_0x117fe1[_0x2f95('0x40')][_0x2f95('0x4a')]){_0xa79db2['where']=_['merge'](_0xa79db2[_0x2f95('0x48')],{'$or':_[_0x2f95('0x3b')](_0x49d035,function(_0x26b992){if(_0x26b992[_0x2f95('0x3e')]!==_0x2f95('0x4b')){var _0x5da8b9={};_0x5da8b9[_0x26b992[_0x2f95('0x39')]]={'$like':'%'+_0x117fe1[_0x2f95('0x40')]['filter']+'%'};return _0x5da8b9;}})});}_0xa79db2=_[_0x2f95('0x4c')]({},_0xa79db2,_0x117fe1[_0x2f95('0x4d')]);var _0x51cbab={'where':_0xa79db2['where']};return db[_0x2f95('0x4e')][_0x2f95('0x31')](_0x51cbab)[_0x2f95('0x1f')](function(_0xad89d1){_0x586e07[_0x2f95('0x31')]=_0xad89d1;if(_0x117fe1[_0x2f95('0x40')]['includeAll']){_0xa79db2[_0x2f95('0x4f')]=[{'all':!![]}];}return db[_0x2f95('0x4e')][_0x2f95('0x50')](_0xa79db2);})[_0x2f95('0x1f')](function(_0x26a75c){_0x586e07[_0x2f95('0x51')]=_0x26a75c;return _0x586e07;})['then'](respondWithFilteredResult(_0x410a10,_0xa79db2))['catch'](handleError(_0x410a10,null));};exports['show']=function(_0x52d6f7,_0x2c15cd){var _0xa60781={'raw':!![],'where':{'id':_0x52d6f7[_0x2f95('0x52')]['id']}},_0x50ce29={};_0x50ce29[_0x2f95('0x43')]=_[_0x2f95('0x3f')](db[_0x2f95('0x4e')]['rawAttributes']);_0x50ce29[_0x2f95('0x40')]=_['keys'](_0x52d6f7[_0x2f95('0x40')]);_0x50ce29[_0x2f95('0x41')]=_[_0x2f95('0x42')](_0x50ce29[_0x2f95('0x43')],_0x50ce29[_0x2f95('0x40')]);_0xa60781[_0x2f95('0x44')]=_[_0x2f95('0x42')](_0x50ce29[_0x2f95('0x43')],qs['fields'](_0x52d6f7[_0x2f95('0x40')]['fields']));_0xa60781[_0x2f95('0x44')]=_0xa60781[_0x2f95('0x44')][_0x2f95('0x53')]?_0xa60781['attributes']:_0x50ce29[_0x2f95('0x43')];if(_0x52d6f7['query']['includeAll']){_0xa60781['include']=[{'all':!![]}];}_0xa60781=_[_0x2f95('0x4c')]({},_0xa60781,_0x52d6f7['options']);return db[_0x2f95('0x4e')][_0x2f95('0x54')](_0xa60781)[_0x2f95('0x1f')](handleEntityNotFound(_0x2c15cd,null))[_0x2f95('0x1f')](respondWithResult(_0x2c15cd,null))[_0x2f95('0x29')](handleError(_0x2c15cd,null));};exports[_0x2f95('0x55')]=function(_0xe4d388,_0x590ad8){return db[_0x2f95('0x4e')][_0x2f95('0x55')](_0xe4d388[_0x2f95('0x56')],{})[_0x2f95('0x1f')](function(_0x4b4179){var _0x894eae=_0xe4d388[_0x2f95('0x57')]['get']({'plain':!![]});if(!_0x894eae)throw new Error(_0x2f95('0x58'));if(_0x894eae['role']===_0x2f95('0x57')){var _0x2fa3eb=_0x4b4179['get']({'plain':!![]});var _0x3bffb6=_0x2f95('0x37');return db[_0x2f95('0x59')]['find']({'where':{'name':_0x3bffb6,'userProfileId':_0x894eae[_0x2f95('0x5a')]},'raw':!![]})[_0x2f95('0x1f')](function(_0x289d83){if(_0x289d83&&_0x289d83[_0x2f95('0x5b')]===0x0){return db['UserProfileResource'][_0x2f95('0x55')]({'name':_0x2fa3eb[_0x2f95('0x39')],'resourceId':_0x2fa3eb['id'],'type':_0x289d83[_0x2f95('0x39')],'sectionId':_0x289d83['id']},{})[_0x2f95('0x1f')](function(){return _0x4b4179;});}else{return _0x4b4179;}})[_0x2f95('0x29')](function(_0x190609){logger[_0x2f95('0x26')](_0x2f95('0x5c'),_0x190609);throw _0x190609;});}return _0x4b4179;})[_0x2f95('0x1f')](respondWithResult(_0x590ad8,0xc9))[_0x2f95('0x29')](handleError(_0x590ad8,null));};exports['update']=function(_0x2ea5b9,_0x11b8d1){if(_0x2ea5b9[_0x2f95('0x56')]['id']){delete _0x2ea5b9[_0x2f95('0x56')]['id'];}return db[_0x2f95('0x4e')][_0x2f95('0x54')]({'where':{'id':_0x2ea5b9[_0x2f95('0x52')]['id']}})['then'](handleEntityNotFound(_0x11b8d1,null))[_0x2f95('0x1f')](saveUpdates(_0x2ea5b9[_0x2f95('0x56')],null))[_0x2f95('0x1f')](respondWithResult(_0x11b8d1,null))[_0x2f95('0x29')](handleError(_0x11b8d1,null));};exports[_0x2f95('0x5d')]=function(_0x26348a,_0x232692){return db[_0x2f95('0x4e')][_0x2f95('0x54')]({'where':{'id':_0x26348a['params']['id']}})[_0x2f95('0x1f')](handleEntityNotFound(_0x232692,null))[_0x2f95('0x1f')](removeEntity(_0x232692,null))[_0x2f95('0x29')](handleError(_0x232692,null));};exports[_0x2f95('0x5e')]=function(_0x133ea1,_0x308035){return db[_0x2f95('0x4e')][_0x2f95('0x5e')]()['then'](respondWithResult(_0x308035,null))[_0x2f95('0x29')](handleError(_0x308035,null));};exports[_0x2f95('0x5f')]=function(_0x43ee8e,_0x1be025,_0x4924b5){var _0x48891a={'raw':!![],'where':{}},_0x38dcbc={},_0x45c5a0;return db[_0x2f95('0x4e')]['findOne']({'where':{'id':_0x43ee8e[_0x2f95('0x52')]['id']}})['then'](handleEntityNotFound(_0x1be025,null))[_0x2f95('0x1f')](function(_0x4bc368){if(_0x4bc368){_0x45c5a0=_0x4bc368['get']({'plain':!![]});_0x38dcbc[_0x2f95('0x43')]=_[_0x2f95('0x3f')](db[_0x2f95('0x60')][_0x2f95('0x3c')]);_0x38dcbc['query']=_[_0x2f95('0x3f')](_0x43ee8e[_0x2f95('0x40')]);_0x38dcbc[_0x2f95('0x41')]=_[_0x2f95('0x42')](_0x38dcbc['model'],_0x38dcbc[_0x2f95('0x40')]);_0x48891a[_0x2f95('0x44')]=_[_0x2f95('0x42')](_0x38dcbc[_0x2f95('0x43')],qs['fields'](_0x43ee8e['query']['fields']));_0x48891a[_0x2f95('0x44')]=_0x48891a[_0x2f95('0x44')]['length']?_0x48891a['attributes']:_0x38dcbc[_0x2f95('0x43')];if(!_0x43ee8e[_0x2f95('0x40')][_0x2f95('0x46')](_0x2f95('0x61'))){_0x48891a['limit']=qs[_0x2f95('0x2f')](_0x43ee8e[_0x2f95('0x40')][_0x2f95('0x2f')]);_0x48891a['offset']=qs[_0x2f95('0x2e')](_0x43ee8e['query']['offset']);}_0x48891a[_0x2f95('0x47')]=qs[_0x2f95('0x62')](_0x43ee8e[_0x2f95('0x40')][_0x2f95('0x62')]);_0x48891a['where']=qs[_0x2f95('0x41')](_[_0x2f95('0x49')](_0x43ee8e['query'],_0x38dcbc[_0x2f95('0x41')]));_0x48891a['where'][_0x2f95('0x63')]=_0x4bc368['id'];if(_0x43ee8e[_0x2f95('0x40')]['filter']){_0x48891a[_0x2f95('0x48')]=_['merge'](_0x48891a[_0x2f95('0x48')],{'$or':_[_0x2f95('0x3b')](_0x48891a[_0x2f95('0x44')],function(_0x5e8050){var _0x5c3ef8={};_0x5c3ef8[_0x5e8050]={'$like':'%'+_0x43ee8e['query'][_0x2f95('0x4a')]+'%'};return _0x5c3ef8;})});}_0x48891a=_['merge']({},_0x48891a,_0x43ee8e[_0x2f95('0x4d')]);return db[_0x2f95('0x60')][_0x2f95('0x50')](_0x48891a);}})[_0x2f95('0x1f')](function(_0x2cd56e){if(_0x2cd56e){return db[_0x2f95('0x64')][_0x2f95('0x65')]({'where':{'id':_[_0x2f95('0x3b')](_0x2cd56e,'UserId'),'role':_0x2f95('0x66')},'attributes':['id',_0x2f95('0x39'),_0x2f95('0x67'),_0x2f95('0x68'),_0x2f95('0x69')]});}})[_0x2f95('0x1f')](function(_0x50f726){if(_0x50f726){return{'count':_0x50f726['count'],'rows':_[_0x2f95('0x3b')](_0x50f726[_0x2f95('0x51')],function(_0x5a603d){return{'membername':_0x5a603d[_0x2f95('0x39')],'UserId':_0x5a603d['id'],'queue_name':_0x45c5a0['name'],'ChatQueueId':_0x45c5a0['id'],'interface':util['format'](_0x2f95('0x6a'),'SIP',_0x5a603d['name']),'penalty':0x0,'paused':_0x5a603d[_0x2f95('0x67')],'createdAt':_0x5a603d[_0x2f95('0x69')],'updatedAt':_0x5a603d[_0x2f95('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2f95('0x1f')](respondWithFilteredResult(_0x1be025,_0x48891a))['catch'](handleError(_0x1be025,null));};exports[_0x2f95('0x6b')]=function(_0x1d4292,_0x316d69,_0x51e39b){var _0x515923={};var _0x9eacfa={};var _0x2c87e5;var _0x7c5bf7;return db[_0x2f95('0x4e')][_0x2f95('0x6c')]({'where':{'id':_0x1d4292[_0x2f95('0x52')]['id']}})[_0x2f95('0x1f')](handleEntityNotFound(_0x316d69,null))[_0x2f95('0x1f')](function(_0x2f058a){if(_0x2f058a){_0x2c87e5=_0x2f058a;_0x9eacfa[_0x2f95('0x43')]=_[_0x2f95('0x3f')](db[_0x2f95('0x6d')][_0x2f95('0x3c')]);_0x9eacfa[_0x2f95('0x40')]=_[_0x2f95('0x3f')](_0x1d4292['query']);_0x9eacfa[_0x2f95('0x41')]=_['intersection'](_0x9eacfa[_0x2f95('0x43')],_0x9eacfa[_0x2f95('0x40')]);_0x515923[_0x2f95('0x44')]=_[_0x2f95('0x42')](_0x9eacfa[_0x2f95('0x43')],qs[_0x2f95('0x45')](_0x1d4292[_0x2f95('0x40')]['fields']));_0x515923[_0x2f95('0x44')]=_0x515923[_0x2f95('0x44')][_0x2f95('0x53')]?_0x515923['attributes']:_0x9eacfa['model'];_0x515923[_0x2f95('0x47')]=qs['sort'](_0x1d4292[_0x2f95('0x40')][_0x2f95('0x62')]);_0x515923[_0x2f95('0x48')]=qs[_0x2f95('0x41')](_[_0x2f95('0x49')](_0x1d4292[_0x2f95('0x40')],_0x9eacfa[_0x2f95('0x41')]));if(_0x1d4292['query']['filter']){_0x515923['where']=_[_0x2f95('0x4c')](_0x515923['where'],{'$or':_[_0x2f95('0x3b')](_0x515923['attributes'],function(_0x2874bc){var _0x5108b0={};_0x5108b0[_0x2874bc]={'$like':'%'+_0x1d4292[_0x2f95('0x40')]['filter']+'%'};return _0x5108b0;})});}_0x515923=_[_0x2f95('0x4c')]({},_0x515923,_0x1d4292['options']);return _0x2c87e5[_0x2f95('0x6b')](_0x515923);}})[_0x2f95('0x1f')](function(_0x3d85da){if(_0x3d85da){_0x7c5bf7=_0x3d85da['length'];if(!_0x1d4292['query']['hasOwnProperty'](_0x2f95('0x61'))){_0x515923[_0x2f95('0x2f')]=qs['limit'](_0x1d4292[_0x2f95('0x40')][_0x2f95('0x2f')]);_0x515923[_0x2f95('0x2e')]=qs[_0x2f95('0x2e')](_0x1d4292[_0x2f95('0x40')][_0x2f95('0x2e')]);}return _0x2c87e5[_0x2f95('0x6b')](_0x515923);}})[_0x2f95('0x1f')](function(_0xf3611a){if(_0xf3611a){return _0xf3611a?{'count':_0x7c5bf7,'rows':_0xf3611a}:null;}})[_0x2f95('0x1f')](respondWithResult(_0x316d69,null))['catch'](handleError(_0x316d69,null));};exports[_0x2f95('0x6e')]=function(_0x46d9cc,_0x4c62fe,_0x832499){var _0x10f5af=_0x46d9cc[_0x2f95('0x56')][_0x2f95('0x6f')];return db['Team'][_0x2f95('0x50')]({'where':{'id':_0x10f5af},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x2f95('0x39'),_0x2f95('0x70'),_0x2f95('0x71'),'interface'],'raw':!![]}]})[_0x2f95('0x1f')](function(_0x5e6a78){if(_0x5e6a78){var _0x172f82=_[_0x2f95('0x72')](_0x5e6a78,function(_0x317df5){var _0x37db4=_0x317df5[_0x2f95('0x36')]({'plain':!![]});return _0x37db4[_0x2f95('0x73')];});return db[_0x2f95('0x4e')][_0x2f95('0x54')]({'where':{'id':_0x46d9cc[_0x2f95('0x52')]['id']}})['then'](function(_0x6b1083){return db['sequelize'][_0x2f95('0x74')](function(_0x23bd0a){return _0x6b1083['addTeams'](_0x10f5af,{'transaction':_0x23bd0a})[_0x2f95('0x1f')](function(){return BPromise[_0x2f95('0x75')](_0x172f82,function(_0x209f8b){return db[_0x2f95('0x60')]['findOrCreate']({'where':{'UserId':_0x209f8b['id'],'ChatQueueId':_0x46d9cc[_0x2f95('0x52')]['id']},'transaction':_0x23bd0a});});})[_0x2f95('0x1f')](function(){_0x172f82[_0x2f95('0x76')](function(_0x2b4b7d){socket[_0x2f95('0x77')](_0x2f95('0x78'),{'UserId':_0x2b4b7d['id'],'ChatQueueId':_0x6b1083['id']});});});});});}})['then'](respondWithStatusCode(_0x4c62fe,null))[_0x2f95('0x29')](handleError(_0x4c62fe,null));};exports[_0x2f95('0x79')]=function(_0x7d17b8,_0x9167a9,_0x424c8d){return db[_0x2f95('0x6d')][_0x2f95('0x50')]({'where':{'id':_0x7d17b8['query'][_0x2f95('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x2f95('0x64')],'as':_0x2f95('0x73'),'attributes':['id'],'raw':!![]}]})[_0x2f95('0x1f')](handleEntityNotFound(_0x9167a9,null))[_0x2f95('0x1f')](function(_0x2d0094){var _0x121a5b=_[_0x2f95('0x3b')](_0x2d0094,'id');var _0x3464f8=[];var _0x3933b3=[];var _0x12b784=squel[_0x2f95('0x7a')]();_0x12b784[_0x2f95('0x7b')](_0x2f95('0x7c'))[_0x2f95('0x7d')](_0x2f95('0x7e'),'tq')[_0x2f95('0x7f')](_0x2f95('0x80'),'ut',_0x2f95('0x81'))[_0x2f95('0x48')](_0x2f95('0x82'),_0x7d17b8[_0x2f95('0x52')]['id']);for(var _0x3a10f3=0x0;_0x3a10f3<_0x2d0094[_0x2f95('0x53')];_0x3a10f3+=0x1){let _0x3cb60c=_0x2d0094[_0x3a10f3];for(var _0x1b18dc=0x0;_0x1b18dc<_0x3cb60c[_0x2f95('0x73')][_0x2f95('0x53')];_0x1b18dc+=0x1){let _0x65a559=_0x3cb60c[_0x2f95('0x73')][_0x1b18dc];var _0x5d3c0b=_0x12b784['clone']();_0x5d3c0b[_0x2f95('0x48')](_0x2f95('0x83'),_0x65a559['id']);_0x3933b3[_0x2f95('0x84')](db['sequelize']['query'](_0x5d3c0b[_0x2f95('0x85')](),{'type':db[_0x2f95('0x86')][_0x2f95('0x87')][_0x2f95('0x88')]})[_0x2f95('0x1f')](function(_0x213323){if(_0x213323[_0x2f95('0x53')]===0x1){return _0x65a559['id'];}else{var _0xcfd9d6=_[_0x2f95('0x89')](_['map'](_0x213323,'TeamId'),function(_0x21f7f1){return _[_0x2f95('0x8a')](_0x121a5b,_0x21f7f1);});if(_0xcfd9d6){return _0x65a559['id'];}}}));}}return BPromise['all'](_0x3933b3)[_0x2f95('0x1f')](function(_0x2140a6){_0x3464f8=_(_0x3464f8)[_0x2f95('0x8b')](_0x2140a6)['compact']()[_0x2f95('0x8c')]();return db[_0x2f95('0x4e')][_0x2f95('0x54')]({'where':{'id':_0x7d17b8[_0x2f95('0x52')]['id']}})[_0x2f95('0x1f')](function(_0xdbe987){return db['sequelize'][_0x2f95('0x74')](function(_0x3b838a){return _0xdbe987['removeTeams'](_0x7d17b8[_0x2f95('0x40')][_0x2f95('0x6f')],{'transaction':_0x3b838a})[_0x2f95('0x1f')](function(){if(!_[_0x2f95('0x8d')](_0x3464f8)){return _0xdbe987[_0x2f95('0x8e')](_0x3464f8,{'transaction':_0x3b838a});}})[_0x2f95('0x1f')](function(){_0x3464f8[_0x2f95('0x76')](function(_0x3592eb){socket[_0x2f95('0x77')](_0x2f95('0x8f'),{'UserId':_0x3592eb,'ChatQueueId':_0xdbe987['id']});});});});});});})[_0x2f95('0x1f')](respondWithStatusCode(_0x9167a9,null))[_0x2f95('0x29')](handleError(_0x9167a9,null));};exports[_0x2f95('0x90')]=function(_0x2e5aa4,_0x51a993,_0x171c7e){return db[_0x2f95('0x4e')][_0x2f95('0x54')]({'where':{'id':_0x2e5aa4['params']['id']}})['then'](handleEntityNotFound(_0x51a993,null))[_0x2f95('0x1f')](function(_0x292ef4){if(_0x292ef4){return _0x292ef4['addAgents'](_0x2e5aa4[_0x2f95('0x56')][_0x2f95('0x6f')],_['omit'](_0x2e5aa4[_0x2f95('0x56')],['ids','id'])||{})[_0x2f95('0x91')](function(_0x5ce0fd){for(var _0x50733c=0x0;_0x50733c<_0x2e5aa4[_0x2f95('0x56')]['ids'][_0x2f95('0x53')];_0x50733c+=0x1){socket['emit'](_0x2f95('0x78'),{'UserId':Number(_0x2e5aa4[_0x2f95('0x56')]['ids'][_0x50733c]),'ChatQueueId':Number(_0x2e5aa4[_0x2f95('0x52')]['id'])});}return _0x5ce0fd;});}})[_0x2f95('0x1f')](respondWithResult(_0x51a993,null))['catch'](handleError(_0x51a993,null));};exports['removeAgents']=function(_0xaa9fec,_0x41b335,_0x542b76){return db[_0x2f95('0x4e')][_0x2f95('0x54')]({'where':{'id':_0xaa9fec[_0x2f95('0x52')]['id']}})[_0x2f95('0x1f')](handleEntityNotFound(_0x41b335,null))[_0x2f95('0x1f')](function(_0x375ab0){if(_0x375ab0){return _0x375ab0[_0x2f95('0x8e')](_0xaa9fec[_0x2f95('0x40')]['ids'])[_0x2f95('0x1f')](function(){if(_[_0x2f95('0x92')](_0xaa9fec[_0x2f95('0x40')]['ids'])){for(var _0x1876bd=0x0;_0x1876bd<_0xaa9fec[_0x2f95('0x40')][_0x2f95('0x6f')][_0x2f95('0x53')];_0x1876bd+=0x1){socket[_0x2f95('0x77')]('userChatQueue:remove',{'UserId':Number(_0xaa9fec[_0x2f95('0x40')]['ids'][_0x1876bd]),'ChatQueueId':Number(_0xaa9fec[_0x2f95('0x52')]['id'])});}}else{socket[_0x2f95('0x77')](_0x2f95('0x8f'),{'UserId':Number(_0xaa9fec[_0x2f95('0x40')][_0x2f95('0x6f')]),'ChatQueueId':Number(_0xaa9fec[_0x2f95('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x41b335,null))[_0x2f95('0x29')](handleError(_0x41b335,null));};exports[_0x2f95('0x93')]=function(_0x2eb188,_0x4a9884,_0x30a249){var _0x148041={};var _0x17cc25={};var _0x3edd33;var _0x4a0cea;return db[_0x2f95('0x4e')][_0x2f95('0x6c')]({'where':{'id':_0x2eb188[_0x2f95('0x52')]['id']}})[_0x2f95('0x1f')](handleEntityNotFound(_0x4a9884,null))['then'](function(_0x2ed15b){if(_0x2ed15b){_0x3edd33=_0x2ed15b;_0x17cc25['model']=_[_0x2f95('0x3f')](db[_0x2f95('0x64')]['rawAttributes']);_0x17cc25[_0x2f95('0x40')]=_['keys'](_0x2eb188[_0x2f95('0x40')]);_0x17cc25['filters']=_[_0x2f95('0x42')](_0x17cc25[_0x2f95('0x43')],_0x17cc25[_0x2f95('0x40')]);_0x148041[_0x2f95('0x44')]=_['intersection'](_0x17cc25['model'],qs[_0x2f95('0x45')](_0x2eb188['query'][_0x2f95('0x45')]));_0x148041['attributes']=_0x148041[_0x2f95('0x44')]['length']?_0x148041[_0x2f95('0x44')]:_0x17cc25[_0x2f95('0x43')];_0x148041[_0x2f95('0x47')]=qs[_0x2f95('0x62')](_0x2eb188[_0x2f95('0x40')][_0x2f95('0x62')]);_0x148041[_0x2f95('0x48')]=qs[_0x2f95('0x41')](_[_0x2f95('0x49')](_0x2eb188['query'],_0x17cc25[_0x2f95('0x41')]));if(_0x2eb188[_0x2f95('0x40')][_0x2f95('0x4a')]){_0x148041[_0x2f95('0x48')]=_[_0x2f95('0x4c')](_0x148041['where'],{'$or':_[_0x2f95('0x3b')](_0x148041[_0x2f95('0x44')],function(_0x460692){var _0x489400={};_0x489400[_0x460692]={'$like':'%'+_0x2eb188[_0x2f95('0x40')][_0x2f95('0x4a')]+'%'};return _0x489400;})});}_0x148041=_[_0x2f95('0x4c')]({},_0x148041,_0x2eb188[_0x2f95('0x4d')]);return _0x3edd33[_0x2f95('0x93')](_0x148041);}})[_0x2f95('0x1f')](function(_0x36f6e1){if(_0x36f6e1){_0x4a0cea=_0x36f6e1[_0x2f95('0x53')];if(!_0x2eb188[_0x2f95('0x40')][_0x2f95('0x46')]('nolimit')){_0x148041['limit']=qs['limit'](_0x2eb188[_0x2f95('0x40')][_0x2f95('0x2f')]);_0x148041[_0x2f95('0x2e')]=qs[_0x2f95('0x2e')](_0x2eb188[_0x2f95('0x40')][_0x2f95('0x2e')]);}return _0x3edd33[_0x2f95('0x93')](_0x148041);}})[_0x2f95('0x1f')](function(_0x3bf5fc){if(_0x3bf5fc){return _0x3bf5fc?{'count':_0x4a0cea,'rows':_0x3bf5fc}:null;}})[_0x2f95('0x1f')](respondWithResult(_0x4a9884,null))[_0x2f95('0x29')](handleError(_0x4a9884,null));}; \ No newline at end of file +var _0xd087=['request\x20sent','stringify','error','message','result','status','end','json','undefined','limit','offset','set','apply','reject','save','update','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','ChatQueue','count','includeAll','include','findAll','catch','show','params','length','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','createdAt','rows','format','chatPause','updatedAt','getTeams','Team','addTeams','ids','interface','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','value','removeAgents','addAgents','spread','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','http','request','then','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x58c9cd,_0x1440cb){var _0x30df0f=function(_0xde8df9){while(--_0xde8df9){_0x58c9cd['push'](_0x58c9cd['shift']());}};_0x30df0f(++_0x1440cb);}(_0xd087,0xfe));var _0x7d08=function(_0x5b45fb,_0x4a8523){_0x5b45fb=_0x5b45fb-0x0;var _0x43c96e=_0xd087[_0x5b45fb];return _0x43c96e;};'use strict';var emlformat=require(_0x7d08('0x0'));var rimraf=require(_0x7d08('0x1'));var zipdir=require(_0x7d08('0x2'));var jsonpatch=require(_0x7d08('0x3'));var rp=require(_0x7d08('0x4'));var moment=require(_0x7d08('0x5'));var BPromise=require(_0x7d08('0x6'));var Mustache=require(_0x7d08('0x7'));var util=require(_0x7d08('0x8'));var path=require('path');var sox=require(_0x7d08('0x9'));var csv=require(_0x7d08('0xa'));var ejs=require(_0x7d08('0xb'));var fs=require('fs');var fs_extra=require(_0x7d08('0xc'));var _=require('lodash');var squel=require(_0x7d08('0xd'));var crypto=require(_0x7d08('0xe'));var jsforce=require(_0x7d08('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7d08('0xa'));var querystring=require(_0x7d08('0x10'));var Papa=require('papaparse');var Redis=require(_0x7d08('0x11'));var authService=require(_0x7d08('0x12'));var qs=require(_0x7d08('0x13'));var as=require(_0x7d08('0x14'));var hardwareService=require(_0x7d08('0x15'));var logger=require(_0x7d08('0x16'))(_0x7d08('0x17'));var utils=require(_0x7d08('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7d08('0x19'))['db'];config['redis']=_[_0x7d08('0x1a')](config['redis'],{'host':_0x7d08('0x1b'),'port':0x18eb});var socket=require(_0x7d08('0x1c'))(new Redis(config[_0x7d08('0x1d')]));require(_0x7d08('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7d08('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x221f82,_0x38d22f,_0x17393c,_0x55beed){return new BPromise(function(_0x458ddb,_0x384ed8){var _0x43f484=_0x55beed||client;return _0x43f484[_0x7d08('0x20')](_0x221f82,_0x17393c)[_0x7d08('0x21')](function(_0x602b9e){logger['info'](_0x7d08('0x22'),_0x38d22f,'request\x20sent');logger['debug'](_0x7d08('0x23'),_0x38d22f,_0x7d08('0x24'),JSON[_0x7d08('0x25')](_0x602b9e));if(_0x602b9e[_0x7d08('0x26')]){if(_0x602b9e[_0x7d08('0x26')]['code']===0x1f4){logger['error'](_0x7d08('0x22'),_0x38d22f,_0x602b9e[_0x7d08('0x26')][_0x7d08('0x27')]);return _0x384ed8(_0x602b9e['error']['message']);}logger['error'](_0x7d08('0x22'),_0x38d22f,_0x602b9e[_0x7d08('0x26')][_0x7d08('0x27')]);return _0x458ddb(_0x602b9e[_0x7d08('0x26')][_0x7d08('0x27')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x38d22f,_0x7d08('0x24'));_0x458ddb(_0x602b9e[_0x7d08('0x28')]['message']);}})['catch'](function(_0x2abf6b){logger[_0x7d08('0x26')](_0x7d08('0x22'),_0x38d22f,_0x2abf6b);_0x384ed8(_0x2abf6b);});});}function respondWithStatusCode(_0x5b11e4,_0x4ecf34){_0x4ecf34=_0x4ecf34||0xcc;return function(_0x4e64ff){if(_0x4e64ff){return _0x5b11e4['sendStatus'](_0x4ecf34);}return _0x5b11e4[_0x7d08('0x29')](_0x4ecf34)[_0x7d08('0x2a')]();};}function respondWithResult(_0x556ee6,_0x8f3f3a){_0x8f3f3a=_0x8f3f3a||0xc8;return function(_0x2db255){if(_0x2db255){return _0x556ee6['status'](_0x8f3f3a)[_0x7d08('0x2b')](_0x2db255);}};}function respondWithFilteredResult(_0x1b0aa9,_0x56c58a){return function(_0x2ad774){if(_0x2ad774){var _0x417ca4=typeof _0x56c58a['offset']===_0x7d08('0x2c')&&typeof _0x56c58a[_0x7d08('0x2d')]===_0x7d08('0x2c');var _0x5a0ad4=_0x2ad774['count'];var _0x4786d0=_0x417ca4?0x0:_0x56c58a['offset'];var _0xf9cb4b=_0x417ca4?_0x2ad774['count']:_0x56c58a[_0x7d08('0x2e')]+_0x56c58a['limit'];var _0x183fd2;if(_0xf9cb4b>=_0x5a0ad4){_0xf9cb4b=_0x5a0ad4;_0x183fd2=0xc8;}else{_0x183fd2=0xce;}_0x1b0aa9[_0x7d08('0x29')](_0x183fd2);return _0x1b0aa9[_0x7d08('0x2f')]('Content-Range',_0x4786d0+'-'+_0xf9cb4b+'/'+_0x5a0ad4)[_0x7d08('0x2b')](_0x2ad774);}return null;};}function patchUpdates(_0x10637f){return function(_0x2fa78f){try{jsonpatch[_0x7d08('0x30')](_0x2fa78f,_0x10637f,!![]);}catch(_0x14c48a){return BPromise[_0x7d08('0x31')](_0x14c48a);}return _0x2fa78f[_0x7d08('0x32')]();};}function saveUpdates(_0x28bd59,_0x474ede){return function(_0x4cfdbb){if(_0x4cfdbb){return _0x4cfdbb[_0x7d08('0x33')](_0x28bd59)[_0x7d08('0x21')](function(_0x18c62f){return _0x18c62f;});}return null;};}function removeEntity(_0x404af6,_0x4edef1){return function(_0x3a338e){if(_0x3a338e){return _0x3a338e['destroy']()[_0x7d08('0x21')](function(){var _0x212901=_0x3a338e['get']({'plain':!![]});var _0x3943f1=_0x7d08('0x34');return db[_0x7d08('0x35')]['destroy']({'where':{'type':_0x3943f1,'resourceId':_0x212901['id']}})['then'](function(){return _0x3a338e;});})[_0x7d08('0x21')](function(){_0x404af6[_0x7d08('0x29')](0xcc)[_0x7d08('0x2a')]();});}};}function handleEntityNotFound(_0x45ce67,_0x2b031a){return function(_0x2603fa){if(!_0x2603fa){_0x45ce67[_0x7d08('0x36')](0x194);}return _0x2603fa;};}function handleError(_0x38a2f5,_0x3277ab){_0x3277ab=_0x3277ab||0x1f4;return function(_0x5f2f59){logger[_0x7d08('0x26')](_0x5f2f59[_0x7d08('0x37')]);if(_0x5f2f59['name']){delete _0x5f2f59[_0x7d08('0x38')];}_0x38a2f5[_0x7d08('0x29')](_0x3277ab)[_0x7d08('0x39')](_0x5f2f59);};}exports[_0x7d08('0x3a')]=function(_0x1ff17c,_0x4d0937){var _0x1bf91e={},_0x3433ca={},_0x1a246f={'count':0x0,'rows':[]};var _0x36577f=_[_0x7d08('0x3b')](db['ChatQueue'][_0x7d08('0x3c')],function(_0x258ae1){return{'name':_0x258ae1[_0x7d08('0x3d')],'type':_0x258ae1[_0x7d08('0x3e')][_0x7d08('0x3f')]};});_0x3433ca['model']=_[_0x7d08('0x3b')](_0x36577f,_0x7d08('0x38'));_0x3433ca[_0x7d08('0x40')]=_[_0x7d08('0x41')](_0x1ff17c[_0x7d08('0x40')]);_0x3433ca['filters']=_[_0x7d08('0x42')](_0x3433ca[_0x7d08('0x43')],_0x3433ca['query']);_0x1bf91e[_0x7d08('0x44')]=_[_0x7d08('0x42')](_0x3433ca[_0x7d08('0x43')],qs[_0x7d08('0x45')](_0x1ff17c['query'][_0x7d08('0x45')]));_0x1bf91e['attributes']=_0x1bf91e['attributes']['length']?_0x1bf91e[_0x7d08('0x44')]:_0x3433ca[_0x7d08('0x43')];if(!_0x1ff17c['query'][_0x7d08('0x46')](_0x7d08('0x47'))){_0x1bf91e[_0x7d08('0x2d')]=qs[_0x7d08('0x2d')](_0x1ff17c[_0x7d08('0x40')]['limit']);_0x1bf91e['offset']=qs['offset'](_0x1ff17c[_0x7d08('0x40')][_0x7d08('0x2e')]);}_0x1bf91e[_0x7d08('0x48')]=qs[_0x7d08('0x49')](_0x1ff17c[_0x7d08('0x40')]['sort']);_0x1bf91e[_0x7d08('0x4a')]=qs['filters'](_[_0x7d08('0x4b')](_0x1ff17c['query'],_0x3433ca[_0x7d08('0x4c')]),_0x36577f);if(_0x1ff17c[_0x7d08('0x40')][_0x7d08('0x4d')]){_0x1bf91e['where']=_[_0x7d08('0x4e')](_0x1bf91e['where'],{'$or':_[_0x7d08('0x3b')](_0x36577f,function(_0x3c9b9f){if(_0x3c9b9f[_0x7d08('0x3e')]!=='VIRTUAL'){var _0x2e6e93={};_0x2e6e93[_0x3c9b9f[_0x7d08('0x38')]]={'$like':'%'+_0x1ff17c[_0x7d08('0x40')][_0x7d08('0x4d')]+'%'};return _0x2e6e93;}})});}_0x1bf91e=_['merge']({},_0x1bf91e,_0x1ff17c[_0x7d08('0x4f')]);var _0x532111={'where':_0x1bf91e[_0x7d08('0x4a')]};return db[_0x7d08('0x50')][_0x7d08('0x51')](_0x532111)[_0x7d08('0x21')](function(_0xf912f1){_0x1a246f[_0x7d08('0x51')]=_0xf912f1;if(_0x1ff17c[_0x7d08('0x40')][_0x7d08('0x52')]){_0x1bf91e[_0x7d08('0x53')]=[{'all':!![]}];}return db['ChatQueue'][_0x7d08('0x54')](_0x1bf91e);})[_0x7d08('0x21')](function(_0x1b3983){_0x1a246f['rows']=_0x1b3983;return _0x1a246f;})[_0x7d08('0x21')](respondWithFilteredResult(_0x4d0937,_0x1bf91e))[_0x7d08('0x55')](handleError(_0x4d0937,null));};exports[_0x7d08('0x56')]=function(_0x39f6e3,_0x492917){var _0x5f53d2={'raw':!![],'where':{'id':_0x39f6e3[_0x7d08('0x57')]['id']}},_0x18a6d1={};_0x18a6d1['model']=_[_0x7d08('0x41')](db[_0x7d08('0x50')]['rawAttributes']);_0x18a6d1[_0x7d08('0x40')]=_[_0x7d08('0x41')](_0x39f6e3[_0x7d08('0x40')]);_0x18a6d1['filters']=_[_0x7d08('0x42')](_0x18a6d1[_0x7d08('0x43')],_0x18a6d1[_0x7d08('0x40')]);_0x5f53d2[_0x7d08('0x44')]=_['intersection'](_0x18a6d1[_0x7d08('0x43')],qs['fields'](_0x39f6e3[_0x7d08('0x40')]['fields']));_0x5f53d2['attributes']=_0x5f53d2[_0x7d08('0x44')][_0x7d08('0x58')]?_0x5f53d2[_0x7d08('0x44')]:_0x18a6d1[_0x7d08('0x43')];if(_0x39f6e3[_0x7d08('0x40')][_0x7d08('0x52')]){_0x5f53d2['include']=[{'all':!![]}];}_0x5f53d2=_[_0x7d08('0x4e')]({},_0x5f53d2,_0x39f6e3['options']);return db['ChatQueue']['find'](_0x5f53d2)[_0x7d08('0x21')](handleEntityNotFound(_0x492917,null))[_0x7d08('0x21')](respondWithResult(_0x492917,null))[_0x7d08('0x55')](handleError(_0x492917,null));};exports[_0x7d08('0x59')]=function(_0x550765,_0x4eabfd){return db[_0x7d08('0x50')][_0x7d08('0x59')](_0x550765['body'],{})[_0x7d08('0x21')](function(_0x14f5b3){var _0x1cb95c=_0x550765[_0x7d08('0x5a')][_0x7d08('0x5b')]({'plain':!![]});if(!_0x1cb95c)throw new Error(_0x7d08('0x5c'));if(_0x1cb95c[_0x7d08('0x5d')]==='user'){var _0x28accb=_0x14f5b3[_0x7d08('0x5b')]({'plain':!![]});var _0x4109f0=_0x7d08('0x34');return db[_0x7d08('0x5e')][_0x7d08('0x5f')]({'where':{'name':_0x4109f0,'userProfileId':_0x1cb95c['userProfileId']},'raw':!![]})['then'](function(_0x60f46d){if(_0x60f46d&&_0x60f46d[_0x7d08('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x28accb[_0x7d08('0x38')],'resourceId':_0x28accb['id'],'type':_0x60f46d[_0x7d08('0x38')],'sectionId':_0x60f46d['id']},{})[_0x7d08('0x21')](function(){return _0x14f5b3;});}else{return _0x14f5b3;}})[_0x7d08('0x55')](function(_0x3c1cab){logger[_0x7d08('0x26')](_0x7d08('0x61'),_0x3c1cab);throw _0x3c1cab;});}return _0x14f5b3;})[_0x7d08('0x21')](respondWithResult(_0x4eabfd,0xc9))[_0x7d08('0x55')](handleError(_0x4eabfd,null));};exports[_0x7d08('0x33')]=function(_0x114094,_0x85381c){if(_0x114094['body']['id']){delete _0x114094[_0x7d08('0x62')]['id'];}return db[_0x7d08('0x50')]['find']({'where':{'id':_0x114094['params']['id']}})[_0x7d08('0x21')](handleEntityNotFound(_0x85381c,null))[_0x7d08('0x21')](saveUpdates(_0x114094[_0x7d08('0x62')],null))[_0x7d08('0x21')](respondWithResult(_0x85381c,null))[_0x7d08('0x55')](handleError(_0x85381c,null));};exports['destroy']=function(_0x54aed2,_0x5709a1){return db[_0x7d08('0x50')][_0x7d08('0x5f')]({'where':{'id':_0x54aed2['params']['id']}})[_0x7d08('0x21')](handleEntityNotFound(_0x5709a1,null))[_0x7d08('0x21')](removeEntity(_0x5709a1,null))['catch'](handleError(_0x5709a1,null));};exports[_0x7d08('0x63')]=function(_0x3ee1a7,_0x559602){return db[_0x7d08('0x50')][_0x7d08('0x63')]()[_0x7d08('0x21')](respondWithResult(_0x559602,null))['catch'](handleError(_0x559602,null));};exports['getMembers']=function(_0x590c71,_0x40e76b,_0x111b14){var _0x523e56={'raw':!![],'where':{}},_0x35fbfe={},_0x3a1ab4;return db[_0x7d08('0x50')][_0x7d08('0x64')]({'where':{'id':_0x590c71[_0x7d08('0x57')]['id']}})[_0x7d08('0x21')](handleEntityNotFound(_0x40e76b,null))[_0x7d08('0x21')](function(_0x236a82){if(_0x236a82){_0x3a1ab4=_0x236a82[_0x7d08('0x5b')]({'plain':!![]});_0x35fbfe[_0x7d08('0x43')]=_[_0x7d08('0x41')](db[_0x7d08('0x65')]['rawAttributes']);_0x35fbfe['query']=_[_0x7d08('0x41')](_0x590c71[_0x7d08('0x40')]);_0x35fbfe[_0x7d08('0x4c')]=_[_0x7d08('0x42')](_0x35fbfe['model'],_0x35fbfe[_0x7d08('0x40')]);_0x523e56[_0x7d08('0x44')]=_[_0x7d08('0x42')](_0x35fbfe[_0x7d08('0x43')],qs[_0x7d08('0x45')](_0x590c71['query'][_0x7d08('0x45')]));_0x523e56['attributes']=_0x523e56[_0x7d08('0x44')]['length']?_0x523e56[_0x7d08('0x44')]:_0x35fbfe['model'];if(!_0x590c71['query']['hasOwnProperty']('nolimit')){_0x523e56[_0x7d08('0x2d')]=qs[_0x7d08('0x2d')](_0x590c71[_0x7d08('0x40')]['limit']);_0x523e56[_0x7d08('0x2e')]=qs[_0x7d08('0x2e')](_0x590c71['query'][_0x7d08('0x2e')]);}_0x523e56['order']=qs[_0x7d08('0x49')](_0x590c71[_0x7d08('0x40')]['sort']);_0x523e56[_0x7d08('0x4a')]=qs[_0x7d08('0x4c')](_['pick'](_0x590c71[_0x7d08('0x40')],_0x35fbfe[_0x7d08('0x4c')]));_0x523e56[_0x7d08('0x4a')][_0x7d08('0x66')]=_0x236a82['id'];if(_0x590c71[_0x7d08('0x40')][_0x7d08('0x4d')]){_0x523e56[_0x7d08('0x4a')]=_[_0x7d08('0x4e')](_0x523e56[_0x7d08('0x4a')],{'$or':_[_0x7d08('0x3b')](_0x523e56[_0x7d08('0x44')],function(_0x2f44e1){var _0x4d371c={};_0x4d371c[_0x2f44e1]={'$like':'%'+_0x590c71[_0x7d08('0x40')]['filter']+'%'};return _0x4d371c;})});}_0x523e56=_[_0x7d08('0x4e')]({},_0x523e56,_0x590c71['options']);return db['UserChatQueue'][_0x7d08('0x54')](_0x523e56);}})[_0x7d08('0x21')](function(_0x5afb31){if(_0x5afb31){return db[_0x7d08('0x67')][_0x7d08('0x68')]({'where':{'id':_[_0x7d08('0x3b')](_0x5afb31,_0x7d08('0x69')),'role':_0x7d08('0x6a')},'attributes':['id',_0x7d08('0x38'),'chatPause','updatedAt',_0x7d08('0x6b')]});}})[_0x7d08('0x21')](function(_0x1cc7aa){if(_0x1cc7aa){return{'count':_0x1cc7aa[_0x7d08('0x51')],'rows':_[_0x7d08('0x3b')](_0x1cc7aa[_0x7d08('0x6c')],function(_0x3f43f8){return{'membername':_0x3f43f8[_0x7d08('0x38')],'UserId':_0x3f43f8['id'],'queue_name':_0x3a1ab4['name'],'ChatQueueId':_0x3a1ab4['id'],'interface':util[_0x7d08('0x6d')]('%s/%s','SIP',_0x3f43f8[_0x7d08('0x38')]),'penalty':0x0,'paused':_0x3f43f8[_0x7d08('0x6e')],'createdAt':_0x3f43f8[_0x7d08('0x6b')],'updatedAt':_0x3f43f8[_0x7d08('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x40e76b,_0x523e56))['catch'](handleError(_0x40e76b,null));};exports[_0x7d08('0x70')]=function(_0x1afd3b,_0x85518,_0x578e2b){var _0x597d38={};var _0x572376={};var _0x59cbd3;var _0x93209c;return db['ChatQueue'][_0x7d08('0x64')]({'where':{'id':_0x1afd3b[_0x7d08('0x57')]['id']}})[_0x7d08('0x21')](handleEntityNotFound(_0x85518,null))[_0x7d08('0x21')](function(_0x23ff32){if(_0x23ff32){_0x59cbd3=_0x23ff32;_0x572376[_0x7d08('0x43')]=_[_0x7d08('0x41')](db[_0x7d08('0x71')][_0x7d08('0x3c')]);_0x572376['query']=_['keys'](_0x1afd3b[_0x7d08('0x40')]);_0x572376[_0x7d08('0x4c')]=_[_0x7d08('0x42')](_0x572376[_0x7d08('0x43')],_0x572376[_0x7d08('0x40')]);_0x597d38[_0x7d08('0x44')]=_[_0x7d08('0x42')](_0x572376[_0x7d08('0x43')],qs[_0x7d08('0x45')](_0x1afd3b['query'][_0x7d08('0x45')]));_0x597d38[_0x7d08('0x44')]=_0x597d38[_0x7d08('0x44')][_0x7d08('0x58')]?_0x597d38[_0x7d08('0x44')]:_0x572376[_0x7d08('0x43')];_0x597d38['order']=qs['sort'](_0x1afd3b['query'][_0x7d08('0x49')]);_0x597d38['where']=qs[_0x7d08('0x4c')](_[_0x7d08('0x4b')](_0x1afd3b[_0x7d08('0x40')],_0x572376[_0x7d08('0x4c')]));if(_0x1afd3b[_0x7d08('0x40')][_0x7d08('0x4d')]){_0x597d38[_0x7d08('0x4a')]=_['merge'](_0x597d38[_0x7d08('0x4a')],{'$or':_[_0x7d08('0x3b')](_0x597d38[_0x7d08('0x44')],function(_0x5e8537){var _0x3c0579={};_0x3c0579[_0x5e8537]={'$like':'%'+_0x1afd3b['query'][_0x7d08('0x4d')]+'%'};return _0x3c0579;})});}_0x597d38=_[_0x7d08('0x4e')]({},_0x597d38,_0x1afd3b[_0x7d08('0x4f')]);return _0x59cbd3[_0x7d08('0x70')](_0x597d38);}})[_0x7d08('0x21')](function(_0x5e4cf0){if(_0x5e4cf0){_0x93209c=_0x5e4cf0[_0x7d08('0x58')];if(!_0x1afd3b['query'][_0x7d08('0x46')]('nolimit')){_0x597d38[_0x7d08('0x2d')]=qs[_0x7d08('0x2d')](_0x1afd3b['query'][_0x7d08('0x2d')]);_0x597d38['offset']=qs[_0x7d08('0x2e')](_0x1afd3b[_0x7d08('0x40')][_0x7d08('0x2e')]);}return _0x59cbd3[_0x7d08('0x70')](_0x597d38);}})[_0x7d08('0x21')](function(_0x1c2cfb){if(_0x1c2cfb){return _0x1c2cfb?{'count':_0x93209c,'rows':_0x1c2cfb}:null;}})[_0x7d08('0x21')](respondWithResult(_0x85518,null))[_0x7d08('0x55')](handleError(_0x85518,null));};exports[_0x7d08('0x72')]=function(_0x527c74,_0x5e4121,_0xc517a4){var _0x520a1d=_0x527c74['body'][_0x7d08('0x73')];return db[_0x7d08('0x71')][_0x7d08('0x54')]({'where':{'id':_0x520a1d},'attributes':['id'],'include':[{'model':db[_0x7d08('0x67')],'as':'Agents','attributes':['id',_0x7d08('0x38'),'online','voicePause',_0x7d08('0x74')],'raw':!![]}]})[_0x7d08('0x21')](function(_0x5ae41d){if(_0x5ae41d){var _0x4fda41=_[_0x7d08('0x75')](_0x5ae41d,function(_0x219c5d){var _0x104648=_0x219c5d['get']({'plain':!![]});return _0x104648[_0x7d08('0x76')];});return db[_0x7d08('0x50')]['find']({'where':{'id':_0x527c74[_0x7d08('0x57')]['id']}})['then'](function(_0x3f6bd9){return db[_0x7d08('0x77')][_0x7d08('0x78')](function(_0x47727c){return _0x3f6bd9[_0x7d08('0x72')](_0x520a1d,{'transaction':_0x47727c})[_0x7d08('0x21')](function(){return BPromise['each'](_0x4fda41,function(_0x2f7621){return db[_0x7d08('0x65')][_0x7d08('0x79')]({'where':{'UserId':_0x2f7621['id'],'ChatQueueId':_0x527c74[_0x7d08('0x57')]['id']},'transaction':_0x47727c});});})[_0x7d08('0x21')](function(){_0x4fda41[_0x7d08('0x7a')](function(_0x434945){socket[_0x7d08('0x7b')]('userChatQueue:save',{'UserId':_0x434945['id'],'ChatQueueId':_0x3f6bd9['id']});});});});});}})[_0x7d08('0x21')](respondWithStatusCode(_0x5e4121,null))['catch'](handleError(_0x5e4121,null));};exports['removeTeams']=function(_0x50986f,_0x50e19c,_0x723410){return db['Team'][_0x7d08('0x54')]({'where':{'id':_0x50986f[_0x7d08('0x40')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7d08('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7d08('0x21')](handleEntityNotFound(_0x50e19c,null))[_0x7d08('0x21')](function(_0x97207b){var _0x3e8060=_[_0x7d08('0x3b')](_0x97207b,'id');var _0x5835dc=[];var _0x4b07e0=[];var _0x59b1f7=squel[_0x7d08('0x7c')]();_0x59b1f7['field'](_0x7d08('0x7d'))[_0x7d08('0x7e')]('team_has_chat_queues','tq')[_0x7d08('0x7f')](_0x7d08('0x80'),'ut',_0x7d08('0x81'))['where'](_0x7d08('0x82'),_0x50986f['params']['id']);for(var _0x291b05=0x0;_0x291b05<_0x97207b[_0x7d08('0x58')];_0x291b05+=0x1){let _0x301329=_0x97207b[_0x291b05];for(var _0x4e6818=0x0;_0x4e6818<_0x301329['Agents']['length'];_0x4e6818+=0x1){let _0x3e47ad=_0x301329[_0x7d08('0x76')][_0x4e6818];var _0x215693=_0x59b1f7[_0x7d08('0x83')]();_0x215693[_0x7d08('0x4a')](_0x7d08('0x84'),_0x3e47ad['id']);_0x4b07e0[_0x7d08('0x85')](db[_0x7d08('0x77')][_0x7d08('0x40')](_0x215693['toString'](),{'type':db[_0x7d08('0x77')]['QueryTypes'][_0x7d08('0x86')]})[_0x7d08('0x21')](function(_0x3765eb){if(_0x3765eb[_0x7d08('0x58')]===0x1){return _0x3e47ad['id'];}else{var _0x37e5a5=_[_0x7d08('0x87')](_['map'](_0x3765eb,_0x7d08('0x88')),function(_0x9ad11e){return _[_0x7d08('0x89')](_0x3e8060,_0x9ad11e);});if(_0x37e5a5){return _0x3e47ad['id'];}}}));}}return BPromise['all'](_0x4b07e0)[_0x7d08('0x21')](function(_0x32a8e4){_0x5835dc=_(_0x5835dc)['union'](_0x32a8e4)['compact']()[_0x7d08('0x8a')]();return db[_0x7d08('0x50')]['find']({'where':{'id':_0x50986f[_0x7d08('0x57')]['id']}})[_0x7d08('0x21')](function(_0x10badc){return db[_0x7d08('0x77')]['transaction'](function(_0x456d81){return _0x10badc['removeTeams'](_0x50986f[_0x7d08('0x40')]['ids'],{'transaction':_0x456d81})['then'](function(){if(!_['isEmpty'](_0x5835dc)){return _0x10badc[_0x7d08('0x8b')](_0x5835dc,{'transaction':_0x456d81});}})[_0x7d08('0x21')](function(){_0x5835dc[_0x7d08('0x7a')](function(_0x3b84d0){socket['emit']('userChatQueue:remove',{'UserId':_0x3b84d0,'ChatQueueId':_0x10badc['id']});});});});});});})['then'](respondWithStatusCode(_0x50e19c,null))[_0x7d08('0x55')](handleError(_0x50e19c,null));};exports[_0x7d08('0x8c')]=function(_0x115c41,_0x181297,_0x3f7183){return db[_0x7d08('0x50')][_0x7d08('0x5f')]({'where':{'id':_0x115c41[_0x7d08('0x57')]['id']}})[_0x7d08('0x21')](handleEntityNotFound(_0x181297,null))[_0x7d08('0x21')](function(_0x170f27){if(_0x170f27){return _0x170f27[_0x7d08('0x8c')](_0x115c41['body']['ids'],_['omit'](_0x115c41[_0x7d08('0x62')],['ids','id'])||{})[_0x7d08('0x8d')](function(_0x4ccac3){for(var _0x34a4ec=0x0;_0x34a4ec<_0x115c41[_0x7d08('0x62')][_0x7d08('0x73')][_0x7d08('0x58')];_0x34a4ec+=0x1){socket[_0x7d08('0x7b')]('userChatQueue:save',{'UserId':Number(_0x115c41[_0x7d08('0x62')]['ids'][_0x34a4ec]),'ChatQueueId':Number(_0x115c41[_0x7d08('0x57')]['id'])});}return _0x4ccac3;});}})[_0x7d08('0x21')](respondWithResult(_0x181297,null))[_0x7d08('0x55')](handleError(_0x181297,null));};exports[_0x7d08('0x8b')]=function(_0x41e033,_0x36016f,_0x81e2f9){return db[_0x7d08('0x50')][_0x7d08('0x5f')]({'where':{'id':_0x41e033[_0x7d08('0x57')]['id']}})[_0x7d08('0x21')](handleEntityNotFound(_0x36016f,null))[_0x7d08('0x21')](function(_0x3d9452){if(_0x3d9452){return _0x3d9452[_0x7d08('0x8b')](_0x41e033[_0x7d08('0x40')][_0x7d08('0x73')])[_0x7d08('0x21')](function(){if(_[_0x7d08('0x8e')](_0x41e033[_0x7d08('0x40')][_0x7d08('0x73')])){for(var _0x5e9335=0x0;_0x5e9335<_0x41e033[_0x7d08('0x40')][_0x7d08('0x73')][_0x7d08('0x58')];_0x5e9335+=0x1){socket[_0x7d08('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x41e033[_0x7d08('0x40')][_0x7d08('0x73')][_0x5e9335]),'ChatQueueId':Number(_0x41e033['params']['id'])});}}else{socket[_0x7d08('0x7b')](_0x7d08('0x8f'),{'UserId':Number(_0x41e033['query']['ids']),'ChatQueueId':Number(_0x41e033[_0x7d08('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x36016f,null))[_0x7d08('0x55')](handleError(_0x36016f,null));};exports[_0x7d08('0x90')]=function(_0x41ff26,_0x6ab1ab,_0x361a3c){var _0x397d23={};var _0x4ad04d={};var _0x2a58f9;var _0x5789c2;return db[_0x7d08('0x50')][_0x7d08('0x64')]({'where':{'id':_0x41ff26[_0x7d08('0x57')]['id']}})[_0x7d08('0x21')](handleEntityNotFound(_0x6ab1ab,null))[_0x7d08('0x21')](function(_0x4f682e){if(_0x4f682e){_0x2a58f9=_0x4f682e;_0x4ad04d['model']=_[_0x7d08('0x41')](db['User'][_0x7d08('0x3c')]);_0x4ad04d[_0x7d08('0x40')]=_['keys'](_0x41ff26[_0x7d08('0x40')]);_0x4ad04d[_0x7d08('0x4c')]=_[_0x7d08('0x42')](_0x4ad04d[_0x7d08('0x43')],_0x4ad04d[_0x7d08('0x40')]);_0x397d23[_0x7d08('0x44')]=_[_0x7d08('0x42')](_0x4ad04d['model'],qs[_0x7d08('0x45')](_0x41ff26['query'][_0x7d08('0x45')]));_0x397d23[_0x7d08('0x44')]=_0x397d23[_0x7d08('0x44')]['length']?_0x397d23[_0x7d08('0x44')]:_0x4ad04d[_0x7d08('0x43')];_0x397d23[_0x7d08('0x48')]=qs[_0x7d08('0x49')](_0x41ff26['query']['sort']);_0x397d23[_0x7d08('0x4a')]=qs['filters'](_['pick'](_0x41ff26[_0x7d08('0x40')],_0x4ad04d[_0x7d08('0x4c')]));if(_0x41ff26[_0x7d08('0x40')][_0x7d08('0x4d')]){_0x397d23[_0x7d08('0x4a')]=_[_0x7d08('0x4e')](_0x397d23[_0x7d08('0x4a')],{'$or':_[_0x7d08('0x3b')](_0x397d23[_0x7d08('0x44')],function(_0x10a8cc){var _0x2ede5c={};_0x2ede5c[_0x10a8cc]={'$like':'%'+_0x41ff26[_0x7d08('0x40')]['filter']+'%'};return _0x2ede5c;})});}_0x397d23=_[_0x7d08('0x4e')]({},_0x397d23,_0x41ff26[_0x7d08('0x4f')]);return _0x2a58f9[_0x7d08('0x90')](_0x397d23);}})[_0x7d08('0x21')](function(_0x4d6fdd){if(_0x4d6fdd){_0x5789c2=_0x4d6fdd[_0x7d08('0x58')];if(!_0x41ff26[_0x7d08('0x40')][_0x7d08('0x46')](_0x7d08('0x47'))){_0x397d23[_0x7d08('0x2d')]=qs[_0x7d08('0x2d')](_0x41ff26[_0x7d08('0x40')][_0x7d08('0x2d')]);_0x397d23['offset']=qs[_0x7d08('0x2e')](_0x41ff26[_0x7d08('0x40')][_0x7d08('0x2e')]);}return _0x2a58f9[_0x7d08('0x90')](_0x397d23);}})['then'](function(_0x5ba04b){if(_0x5ba04b){return _0x5ba04b?{'count':_0x5789c2,'rows':_0x5ba04b}:null;}})[_0x7d08('0x21')](respondWithResult(_0x6ab1ab,null))['catch'](handleError(_0x6ab1ab,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 1a5fc89..f2783e8 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 _0xdf0a=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x200785,_0x243eb9){var _0x4d018f=function(_0x34c155){while(--_0x34c155){_0x200785['push'](_0x200785['shift']());}};_0x4d018f(++_0x243eb9);}(_0xdf0a,0x1a9));var _0xadf0=function(_0x4689da,_0x27449b){_0x4689da=_0x4689da-0x0;var _0x1c3037=_0xdf0a[_0x4689da];return _0x1c3037;};'use strict';var EventEmitter=require(_0xadf0('0x0'));var ChatQueue=require(_0xadf0('0x1'))['db'][_0xadf0('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xadf0('0x3')](0x0);var events={'afterCreate':_0xadf0('0x4'),'afterUpdate':'update','afterDestroy':_0xadf0('0x5')};function emitEvent(_0x50f8a2){return function(_0x54af37,_0x183ad1,_0x1c5842){ChatQueueEvents['emit'](_0x50f8a2+':'+_0x54af37['id'],_0x54af37);ChatQueueEvents[_0xadf0('0x6')](_0x50f8a2,_0x54af37);_0x1c5842(null);};}for(var e in events){if(events[_0xadf0('0x7')](e)){var event=events[e];ChatQueue[_0xadf0('0x8')](e,emitEvent(event));}}module[_0xadf0('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0xa442=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x1ea1be,_0x3a97b8){var _0x84f949=function(_0x334ba1){while(--_0x334ba1){_0x1ea1be['push'](_0x1ea1be['shift']());}};_0x84f949(++_0x3a97b8);}(_0xa442,0x197));var _0x2a44=function(_0x3c279f,_0x3d472e){_0x3c279f=_0x3c279f-0x0;var _0x148ad4=_0xa442[_0x3c279f];return _0x148ad4;};'use strict';var EventEmitter=require(_0x2a44('0x0'));var ChatQueue=require(_0x2a44('0x1'))['db'][_0x2a44('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2a44('0x3'),'afterUpdate':_0x2a44('0x4'),'afterDestroy':_0x2a44('0x5')};function emitEvent(_0x488431){return function(_0x1838fb,_0x2c8760,_0x3a6302){ChatQueueEvents['emit'](_0x488431+':'+_0x1838fb['id'],_0x1838fb);ChatQueueEvents[_0x2a44('0x6')](_0x488431,_0x1838fb);_0x3a6302(null);};}for(var e in events){if(events[_0x2a44('0x7')](e)){var event=events[e];ChatQueue[_0x2a44('0x8')](e,emitEvent(event));}}module[_0x2a44('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index ca3d99e..6d54d7f 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 _0x4f2d=['chat_queues','util','moment','path','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4f2d,0x9a));var _0xd4f2=function(_0x4a9628,_0xd1aaba){_0x4a9628=_0x4a9628-0x0;var _0x282875=_0x4f2d[_0x4a9628];return _0x282875;};'use strict';var _=require('lodash');var util=require(_0xd4f2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd4f2('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4f2('0x2'));var rimraf=require(_0xd4f2('0x3'));var config=require(_0xd4f2('0x4'));var attributes=require(_0xd4f2('0x5'));module['exports']=function(_0x5193e1,_0x35fbef){return _0x5193e1[_0xd4f2('0x6')](_0xd4f2('0x7'),attributes,{'tableName':_0xd4f2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e37=['../../config/environment','./chatQueue.attributes','exports','chat_queues','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x549e49,_0x94ee2f){var _0x53fdd3=function(_0x3a7710){while(--_0x3a7710){_0x549e49['push'](_0x549e49['shift']());}};_0x53fdd3(++_0x94ee2f);}(_0x1e37,0x190));var _0x71e3=function(_0x199965,_0x2ce299){_0x199965=_0x199965-0x0;var _0x1043bb=_0x1e37[_0x199965];return _0x1043bb;};'use strict';var _=require(_0x71e3('0x0'));var util=require(_0x71e3('0x1'));var logger=require(_0x71e3('0x2'))('api');var moment=require(_0x71e3('0x3'));var BPromise=require(_0x71e3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x71e3('0x5'));var rimraf=require(_0x71e3('0x6'));var config=require(_0x71e3('0x7'));var attributes=require(_0x71e3('0x8'));module[_0x71e3('0x9')]=function(_0x4462a8,_0x42c1a8){return _0x4462a8['define']('ChatQueue',attributes,{'tableName':_0x71e3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 98a59b4..63e0784 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 _0x86bc=['GetChatQueue','findAll','options','raw','attributes','limit','include','map','model','stringify','ChatQueue','find','where','ShowChatQueue','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x1f62c3,_0x1ff95b){var _0x385c1c=function(_0x1db580){while(--_0x1db580){_0x1f62c3['push'](_0x1f62c3['shift']());}};_0x385c1c(++_0x1ff95b);}(_0x86bc,0x1b1));var _0xc86b=function(_0x19a54f,_0x51f8da){_0x19a54f=_0x19a54f-0x0;var _0x7baa25=_0x86bc[_0x19a54f];return _0x7baa25;};'use strict';var _=require(_0xc86b('0x0'));var util=require('util');var moment=require(_0xc86b('0x1'));var BPromise=require(_0xc86b('0x2'));var rs=require(_0xc86b('0x3'));var fs=require('fs');var Redis=require(_0xc86b('0x4'));var db=require(_0xc86b('0x5'))['db'];var utils=require(_0xc86b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc86b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc86b('0x8')]['http']({'port':0x232a});config['redis']=_[_0xc86b('0x9')](config[_0xc86b('0xa')],{'host':_0xc86b('0xb'),'port':0x18eb});var socket=require(_0xc86b('0xc'))(new Redis(config[_0xc86b('0xa')]));require('./chatQueue.socket')[_0xc86b('0xd')](socket);function respondWithRpcPromise(_0x320f92,_0x207e57,_0x2472a){return new BPromise(function(_0x28de01,_0x3c05c1){return client[_0xc86b('0xe')](_0x320f92,_0x2472a)[_0xc86b('0xf')](function(_0x4e2620){logger[_0xc86b('0x10')](_0xc86b('0x11'),_0x207e57,_0xc86b('0x12'));logger['debug'](_0xc86b('0x13'),_0x207e57,'request\x20sent',JSON['stringify'](_0x4e2620));if(_0x4e2620[_0xc86b('0x14')]){if(_0x4e2620[_0xc86b('0x14')]['code']===0x1f4){logger[_0xc86b('0x14')]('ChatQueue,\x20%s,\x20%s',_0x207e57,_0x4e2620[_0xc86b('0x14')][_0xc86b('0x15')]);return _0x3c05c1(_0x4e2620[_0xc86b('0x14')][_0xc86b('0x15')]);}logger[_0xc86b('0x14')]('ChatQueue,\x20%s,\x20%s',_0x207e57,_0x4e2620[_0xc86b('0x14')][_0xc86b('0x15')]);return _0x28de01(_0x4e2620[_0xc86b('0x14')][_0xc86b('0x15')]);}else{logger['info'](_0xc86b('0x11'),_0x207e57,_0xc86b('0x12'));_0x28de01(_0x4e2620[_0xc86b('0x16')][_0xc86b('0x15')]);}})['catch'](function(_0x18c2d1){logger[_0xc86b('0x14')]('ChatQueue,\x20%s,\x20%s',_0x207e57,_0x18c2d1);_0x3c05c1(_0x18c2d1);});});}exports[_0xc86b('0x17')]=function(_0x2ade00){var _0x5236f5=this;return new Promise(function(_0x58446d,_0x2d9172){return db['ChatQueue'][_0xc86b('0x18')]({'raw':_0x2ade00['options']?_0x2ade00[_0xc86b('0x19')][_0xc86b('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ade00['options']?_0x2ade00[_0xc86b('0x19')]['where']||null:null,'attributes':_0x2ade00[_0xc86b('0x19')]?_0x2ade00[_0xc86b('0x19')][_0xc86b('0x1b')]||null:null,'limit':_0x2ade00[_0xc86b('0x19')]?_0x2ade00['options'][_0xc86b('0x1c')]||null:null,'include':_0x2ade00[_0xc86b('0x19')]?_0x2ade00[_0xc86b('0x19')][_0xc86b('0x1d')]?_[_0xc86b('0x1e')](_0x2ade00['options'][_0xc86b('0x1d')],function(_0x564f1){return{'model':db[_0x564f1[_0xc86b('0x1f')]],'as':_0x564f1['as'],'attributes':_0x564f1[_0xc86b('0x1b')],'include':_0x564f1[_0xc86b('0x1d')]?_['map'](_0x564f1[_0xc86b('0x1d')],function(_0x57c7fd){return{'model':db[_0x57c7fd[_0xc86b('0x1f')]],'as':_0x57c7fd['as'],'attributes':_0x57c7fd[_0xc86b('0x1b')],'include':_0x57c7fd[_0xc86b('0x1d')]?_[_0xc86b('0x1e')](_0x57c7fd[_0xc86b('0x1d')],function(_0x4482dc){return{'model':db[_0x4482dc[_0xc86b('0x1f')]],'as':_0x4482dc['as'],'attributes':_0x4482dc[_0xc86b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc86b('0xf')](function(_0x35ca48){logger[_0xc86b('0x10')]('GetChatQueue',_0x2ade00);logger['debug']('GetChatQueue',_0x2ade00,JSON[_0xc86b('0x20')](_0x35ca48));_0x58446d(_0x35ca48);})['catch'](function(_0x4fb2bd){logger[_0xc86b('0x14')](_0xc86b('0x17'),_0x4fb2bd[_0xc86b('0x15')],_0x2ade00);_0x2d9172(_0x5236f5[_0xc86b('0x14')](0x1f4,_0x4fb2bd[_0xc86b('0x15')]));});});};exports['ShowChatQueue']=function(_0x56f3f5){var _0x115223=this;return new Promise(function(_0x282301,_0x9e4348){return db[_0xc86b('0x21')][_0xc86b('0x22')]({'raw':_0x56f3f5[_0xc86b('0x19')]?_0x56f3f5[_0xc86b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x56f3f5[_0xc86b('0x19')]?_0x56f3f5['options'][_0xc86b('0x23')]||null:null,'attributes':_0x56f3f5[_0xc86b('0x19')]?_0x56f3f5[_0xc86b('0x19')][_0xc86b('0x1b')]||null:null,'include':_0x56f3f5[_0xc86b('0x19')]?_0x56f3f5['options'][_0xc86b('0x1d')]?_[_0xc86b('0x1e')](_0x56f3f5[_0xc86b('0x19')]['include'],function(_0x359f35){return{'model':db[_0x359f35['model']],'as':_0x359f35['as'],'attributes':_0x359f35['attributes'],'include':_0x359f35[_0xc86b('0x1d')]?_['map'](_0x359f35['include'],function(_0x1d5486){return{'model':db[_0x1d5486[_0xc86b('0x1f')]],'as':_0x1d5486['as'],'attributes':_0x1d5486[_0xc86b('0x1b')],'include':_0x1d5486['include']?_['map'](_0x1d5486[_0xc86b('0x1d')],function(_0x2a11d3){return{'model':db[_0x2a11d3['model']],'as':_0x2a11d3['as'],'attributes':_0x2a11d3['attributes']};}):[]};}):[]};}):[]:[]})[_0xc86b('0xf')](function(_0x2116be){logger[_0xc86b('0x10')](_0xc86b('0x24'),_0x56f3f5);logger['debug'](_0xc86b('0x24'),_0x56f3f5,JSON[_0xc86b('0x20')](_0x2116be));_0x282301(_0x2116be);})[_0xc86b('0x25')](function(_0x419695){logger[_0xc86b('0x14')](_0xc86b('0x24'),_0x419695[_0xc86b('0x15')],_0x56f3f5);_0x9e4348(_0x115223[_0xc86b('0x14')](0x1f4,_0x419695['message']));});});}; \ No newline at end of file +var _0x281d=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','catch','find','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis'];(function(_0x49c3ab,_0x4639c6){var _0x2c2432=function(_0x2078bd){while(--_0x2078bd){_0x49c3ab['push'](_0x49c3ab['shift']());}};_0x2c2432(++_0x4639c6);}(_0x281d,0x195));var _0xd281=function(_0x4dcb7a,_0x45f4f8){_0x4dcb7a=_0x4dcb7a-0x0;var _0x56703f=_0x281d[_0x4dcb7a];return _0x56703f;};'use strict';var _=require(_0xd281('0x0'));var util=require(_0xd281('0x1'));var moment=require('moment');var BPromise=require(_0xd281('0x2'));var rs=require(_0xd281('0x3'));var fs=require('fs');var Redis=require(_0xd281('0x4'));var db=require(_0xd281('0x5'))['db'];var utils=require(_0xd281('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xd281('0x7'));var jayson=require(_0xd281('0x8'));var client=jayson[_0xd281('0x9')][_0xd281('0xa')]({'port':0x232a});config['redis']=_[_0xd281('0xb')](config['redis'],{'host':_0xd281('0xc'),'port':0x18eb});var socket=require(_0xd281('0xd'))(new Redis(config[_0xd281('0xe')]));require(_0xd281('0xf'))[_0xd281('0x10')](socket);function respondWithRpcPromise(_0x201ce2,_0x575190,_0x2b6a1b){return new BPromise(function(_0x2ab275,_0x534755){return client[_0xd281('0x11')](_0x201ce2,_0x2b6a1b)[_0xd281('0x12')](function(_0x35b25b){logger[_0xd281('0x13')](_0xd281('0x14'),_0x575190,'request\x20sent');logger[_0xd281('0x15')](_0xd281('0x16'),_0x575190,_0xd281('0x17'),JSON['stringify'](_0x35b25b));if(_0x35b25b[_0xd281('0x18')]){if(_0x35b25b[_0xd281('0x18')][_0xd281('0x19')]===0x1f4){logger[_0xd281('0x18')]('ChatQueue,\x20%s,\x20%s',_0x575190,_0x35b25b[_0xd281('0x18')][_0xd281('0x1a')]);return _0x534755(_0x35b25b[_0xd281('0x18')][_0xd281('0x1a')]);}logger[_0xd281('0x18')](_0xd281('0x14'),_0x575190,_0x35b25b[_0xd281('0x18')][_0xd281('0x1a')]);return _0x2ab275(_0x35b25b[_0xd281('0x18')][_0xd281('0x1a')]);}else{logger['info'](_0xd281('0x14'),_0x575190,'request\x20sent');_0x2ab275(_0x35b25b[_0xd281('0x1b')][_0xd281('0x1a')]);}})['catch'](function(_0x3a7cfd){logger[_0xd281('0x18')](_0xd281('0x14'),_0x575190,_0x3a7cfd);_0x534755(_0x3a7cfd);});});}exports[_0xd281('0x1c')]=function(_0x3d6e8a){var _0x211c78=this;return new Promise(function(_0x4c84e2,_0xcf20e6){return db[_0xd281('0x1d')][_0xd281('0x1e')]({'raw':_0x3d6e8a[_0xd281('0x1f')]?_0x3d6e8a[_0xd281('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3d6e8a[_0xd281('0x1f')]?_0x3d6e8a['options'][_0xd281('0x20')]||null:null,'attributes':_0x3d6e8a[_0xd281('0x1f')]?_0x3d6e8a[_0xd281('0x1f')][_0xd281('0x21')]||null:null,'limit':_0x3d6e8a[_0xd281('0x1f')]?_0x3d6e8a[_0xd281('0x1f')][_0xd281('0x22')]||null:null,'include':_0x3d6e8a[_0xd281('0x1f')]?_0x3d6e8a[_0xd281('0x1f')][_0xd281('0x23')]?_[_0xd281('0x24')](_0x3d6e8a['options'][_0xd281('0x23')],function(_0x3b91b2){return{'model':db[_0x3b91b2[_0xd281('0x25')]],'as':_0x3b91b2['as'],'attributes':_0x3b91b2[_0xd281('0x21')],'include':_0x3b91b2['include']?_[_0xd281('0x24')](_0x3b91b2[_0xd281('0x23')],function(_0x3df7e5){return{'model':db[_0x3df7e5[_0xd281('0x25')]],'as':_0x3df7e5['as'],'attributes':_0x3df7e5[_0xd281('0x21')],'include':_0x3df7e5['include']?_['map'](_0x3df7e5[_0xd281('0x23')],function(_0x2172a4){return{'model':db[_0x2172a4[_0xd281('0x25')]],'as':_0x2172a4['as'],'attributes':_0x2172a4[_0xd281('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7ff5fe){logger[_0xd281('0x13')](_0xd281('0x1c'),_0x3d6e8a);logger[_0xd281('0x15')](_0xd281('0x1c'),_0x3d6e8a,JSON['stringify'](_0x7ff5fe));_0x4c84e2(_0x7ff5fe);})[_0xd281('0x26')](function(_0x4b2d64){logger['error'](_0xd281('0x1c'),_0x4b2d64[_0xd281('0x1a')],_0x3d6e8a);_0xcf20e6(_0x211c78[_0xd281('0x18')](0x1f4,_0x4b2d64[_0xd281('0x1a')]));});});};exports['ShowChatQueue']=function(_0x3d725d){var _0x57b6e7=this;return new Promise(function(_0x224773,_0xd7e06d){return db['ChatQueue'][_0xd281('0x27')]({'raw':_0x3d725d[_0xd281('0x1f')]?_0x3d725d[_0xd281('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3d725d[_0xd281('0x1f')]?_0x3d725d[_0xd281('0x1f')][_0xd281('0x20')]||null:null,'attributes':_0x3d725d[_0xd281('0x1f')]?_0x3d725d[_0xd281('0x1f')][_0xd281('0x21')]||null:null,'include':_0x3d725d['options']?_0x3d725d[_0xd281('0x1f')][_0xd281('0x23')]?_[_0xd281('0x24')](_0x3d725d[_0xd281('0x1f')][_0xd281('0x23')],function(_0x1ac40){return{'model':db[_0x1ac40['model']],'as':_0x1ac40['as'],'attributes':_0x1ac40[_0xd281('0x21')],'include':_0x1ac40[_0xd281('0x23')]?_['map'](_0x1ac40[_0xd281('0x23')],function(_0x7f29c2){return{'model':db[_0x7f29c2['model']],'as':_0x7f29c2['as'],'attributes':_0x7f29c2[_0xd281('0x21')],'include':_0x7f29c2[_0xd281('0x23')]?_['map'](_0x7f29c2[_0xd281('0x23')],function(_0x788f40){return{'model':db[_0x788f40[_0xd281('0x25')]],'as':_0x788f40['as'],'attributes':_0x788f40['attributes']};}):[]};}):[]};}):[]:[]})[_0xd281('0x12')](function(_0x5b9a62){logger[_0xd281('0x13')](_0xd281('0x28'),_0x3d725d);logger['debug'](_0xd281('0x28'),_0x3d725d,JSON['stringify'](_0x5b9a62));_0x224773(_0x5b9a62);})[_0xd281('0x26')](function(_0x10101a){logger[_0xd281('0x18')](_0xd281('0x28'),_0x10101a[_0xd281('0x1a')],_0x3d725d);_0xd7e06d(_0x57b6e7[_0xd281('0x18')](0x1f4,_0x10101a[_0xd281('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index da333b5..af60562 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 _0x7bae=['remove','update','emit','removeListener','register','length','chatQueue:'];(function(_0x1379c7,_0x53496f){var _0x262625=function(_0x36d80e){while(--_0x36d80e){_0x1379c7['push'](_0x1379c7['shift']());}};_0x262625(++_0x53496f);}(_0x7bae,0x13b));var _0xe7ba=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x7bae[_0x4e9628];return _0x27bc8c;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xe7ba('0x0'),_0xe7ba('0x1')];function createListener(_0x503803,_0x3963c7){return function(_0x4f2e91){_0x3963c7[_0xe7ba('0x2')](_0x503803,_0x4f2e91);};}function removeListener(_0x10908b,_0x166acb){return function(){ChatQueueEvents[_0xe7ba('0x3')](_0x10908b,_0x166acb);};}exports[_0xe7ba('0x4')]=function(_0xfd3a22){for(var _0x2d31df=0x0,_0x3c5e59=events[_0xe7ba('0x5')];_0x2d31df<_0x3c5e59;_0x2d31df++){var _0x34fb18=events[_0x2d31df];var _0x160565=createListener(_0xe7ba('0x6')+_0x34fb18,_0xfd3a22);ChatQueueEvents['on'](_0x34fb18,_0x160565);}}; \ No newline at end of file +var _0xd13e=['removeListener','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x25a0b9,_0x86e28f){var _0x30b9ab=function(_0x883a4){while(--_0x883a4){_0x25a0b9['push'](_0x25a0b9['shift']());}};_0x30b9ab(++_0x86e28f);}(_0xd13e,0x193));var _0xed13=function(_0x33f3c1,_0x3e2dcb){_0x33f3c1=_0x33f3c1-0x0;var _0x3ce409=_0xd13e[_0x33f3c1];return _0x3ce409;};'use strict';var ChatQueueEvents=require(_0xed13('0x0'));var events=[_0xed13('0x1'),_0xed13('0x2'),_0xed13('0x3')];function createListener(_0x50b476,_0x1a064e){return function(_0x5cdb65){_0x1a064e[_0xed13('0x4')](_0x50b476,_0x5cdb65);};}function removeListener(_0x59d4db,_0x46158d){return function(){ChatQueueEvents[_0xed13('0x5')](_0x59d4db,_0x46158d);};}exports['register']=function(_0x50de44){for(var _0x5142bd=0x0,_0x95ff4c=events[_0xed13('0x6')];_0x5142bd<_0x95ff4c;_0x5142bd++){var _0xab0fff=events[_0x5142bd];var _0x3b3984=createListener(_0xed13('0x7')+_0xab0fff,_0x50de44);ChatQueueEvents['on'](_0xab0fff,_0x3b3984);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 2b3bc82..7fe735f 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x5dc6a7,_0x1fe8f5){var _0x1bd8e4=function(_0x33e2ad){while(--_0x33e2ad){_0x5dc6a7['push'](_0x5dc6a7['shift']());}};_0x1bd8e4(++_0x1fe8f5);}(_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('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0xe7d77d,_0x12c159){var _0x4114d5=function(_0x262df4){while(--_0x262df4){_0xe7d77d['push'](_0xe7d77d['shift']());}};_0x4114d5(++_0x12c159);}(_0xe14b,0x93));var _0xbe14=function(_0x38359e,_0x37191b){_0x38359e=_0x38359e-0x0;var _0x623335=_0xe14b[_0x38359e];return _0x623335;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index f3ccdc3..20fffc9 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 _0xfbcb=['exports','STRING','DATE','moment','sequelize'];(function(_0x10a19a,_0x1a45ec){var _0x3f7183=function(_0x33ef0c){while(--_0x33ef0c){_0x10a19a['push'](_0x10a19a['shift']());}};_0x3f7183(++_0x1a45ec);}(_0xfbcb,0xd0));var _0xbfbc=function(_0x39444a,_0x54bb08){_0x39444a=_0x39444a-0x0;var _0x54ca26=_0xfbcb[_0x39444a];return _0x54ca26;};'use strict';var moment=require(_0xbfbc('0x0'));var Sequelize=require(_0xbfbc('0x1'));module[_0xbfbc('0x2')]={'uniqueid':{'type':Sequelize[_0xbfbc('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xbfbc('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbfbc('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xbfbc('0x3')]}}; \ No newline at end of file +var _0x8d5a=['sequelize','exports','STRING','DATE','moment'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x8d5a,0x9f));var _0xa8d5=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x8d5a[_0x2b4411];return _0x8e41ef;};'use strict';var moment=require(_0xa8d5('0x0'));var Sequelize=require(_0xa8d5('0x1'));module[_0xa8d5('0x2')]={'uniqueid':{'type':Sequelize[_0xa8d5('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa8d5('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa8d5('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index ee03653..3e4716e 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 _0x9c63=['querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','update','then','destroy','stack','name','send','index','ChatQueueReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x5a9b03,_0x1f37a7){var _0x17f72c=function(_0x4af997){while(--_0x4af997){_0x5a9b03['push'](_0x5a9b03['shift']());}};_0x17f72c(++_0x1f37a7);}(_0x9c63,0x1a7));var _0x39c6=function(_0x20e864,_0x97df2f){_0x20e864=_0x20e864-0x0;var _0x50535b=_0x9c63[_0x20e864];return _0x50535b;};'use strict';var emlformat=require(_0x39c6('0x0'));var rimraf=require(_0x39c6('0x1'));var zipdir=require(_0x39c6('0x2'));var jsonpatch=require(_0x39c6('0x3'));var rp=require(_0x39c6('0x4'));var moment=require('moment');var BPromise=require(_0x39c6('0x5'));var Mustache=require(_0x39c6('0x6'));var util=require('util');var path=require('path');var sox=require(_0x39c6('0x7'));var csv=require(_0x39c6('0x8'));var ejs=require(_0x39c6('0x9'));var fs=require('fs');var fs_extra=require(_0x39c6('0xa'));var _=require(_0x39c6('0xb'));var squel=require(_0x39c6('0xc'));var crypto=require('crypto');var jsforce=require(_0x39c6('0xd'));var deskjs=require(_0x39c6('0xe'));var toCsv=require(_0x39c6('0x8'));var querystring=require(_0x39c6('0xf'));var Papa=require(_0x39c6('0x10'));var Redis=require('ioredis');var authService=require(_0x39c6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x39c6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39c6('0x13'))(_0x39c6('0x14'));var utils=require(_0x39c6('0x15'));var config=require(_0x39c6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x39c6('0x17'))['db'];function respondWithStatusCode(_0x5a9e9a,_0x58a65f){_0x58a65f=_0x58a65f||0xcc;return function(_0x1f3e1d){if(_0x1f3e1d){return _0x5a9e9a[_0x39c6('0x18')](_0x58a65f);}return _0x5a9e9a[_0x39c6('0x19')](_0x58a65f)[_0x39c6('0x1a')]();};}function respondWithResult(_0x504041,_0x124d43){_0x124d43=_0x124d43||0xc8;return function(_0x4c83dc){if(_0x4c83dc){return _0x504041[_0x39c6('0x19')](_0x124d43)[_0x39c6('0x1b')](_0x4c83dc);}};}function respondWithFilteredResult(_0x2ac896,_0x4c732a){return function(_0x5e3046){if(_0x5e3046){var _0x4581d7=typeof _0x4c732a[_0x39c6('0x1c')]==='undefined'&&typeof _0x4c732a[_0x39c6('0x1d')]===_0x39c6('0x1e');var _0x10ffb8=_0x5e3046[_0x39c6('0x1f')];var _0x129613=_0x4581d7?0x0:_0x4c732a[_0x39c6('0x1c')];var _0x518536=_0x4581d7?_0x5e3046['count']:_0x4c732a['offset']+_0x4c732a['limit'];var _0x524702;if(_0x518536>=_0x10ffb8){_0x518536=_0x10ffb8;_0x524702=0xc8;}else{_0x524702=0xce;}_0x2ac896[_0x39c6('0x19')](_0x524702);return _0x2ac896['set']('Content-Range',_0x129613+'-'+_0x518536+'/'+_0x10ffb8)[_0x39c6('0x1b')](_0x5e3046);}return null;};}function patchUpdates(_0x37dce5){return function(_0x1d91aa){try{jsonpatch[_0x39c6('0x20')](_0x1d91aa,_0x37dce5,!![]);}catch(_0x5608dd){return BPromise['reject'](_0x5608dd);}return _0x1d91aa['save']();};}function saveUpdates(_0x35fc85,_0x588c1d){return function(_0x5d4083){if(_0x5d4083){return _0x5d4083[_0x39c6('0x21')](_0x35fc85)[_0x39c6('0x22')](function(_0x358f6f){return _0x358f6f;});}return null;};}function removeEntity(_0x2e88a3,_0x3e4d7d){return function(_0x33132f){if(_0x33132f){return _0x33132f[_0x39c6('0x23')]()[_0x39c6('0x22')](function(){_0x2e88a3[_0x39c6('0x19')](0xcc)[_0x39c6('0x1a')]();});}};}function handleEntityNotFound(_0x2fd3a7,_0x3018f6){return function(_0x3e49ca){if(!_0x3e49ca){_0x2fd3a7[_0x39c6('0x18')](0x194);}return _0x3e49ca;};}function handleError(_0x1ebdf2,_0x46d0c3){_0x46d0c3=_0x46d0c3||0x1f4;return function(_0x1708e7){logger['error'](_0x1708e7[_0x39c6('0x24')]);if(_0x1708e7[_0x39c6('0x25')]){delete _0x1708e7[_0x39c6('0x25')];}_0x1ebdf2['status'](_0x46d0c3)[_0x39c6('0x26')](_0x1708e7);};}exports[_0x39c6('0x27')]=function(_0x185869,_0x179f15){var _0x5c07f7={},_0x4937c4={},_0x43d1be={'count':0x0,'rows':[]};var _0x243d47=_['map'](db[_0x39c6('0x28')]['rawAttributes'],function(_0x520e8a){return{'name':_0x520e8a[_0x39c6('0x29')],'type':_0x520e8a[_0x39c6('0x2a')][_0x39c6('0x2b')]};});_0x4937c4[_0x39c6('0x2c')]=_[_0x39c6('0x2d')](_0x243d47,_0x39c6('0x25'));_0x4937c4[_0x39c6('0x2e')]=_[_0x39c6('0x2f')](_0x185869[_0x39c6('0x2e')]);_0x4937c4[_0x39c6('0x30')]=_[_0x39c6('0x31')](_0x4937c4[_0x39c6('0x2c')],_0x4937c4[_0x39c6('0x2e')]);_0x5c07f7[_0x39c6('0x32')]=_[_0x39c6('0x31')](_0x4937c4[_0x39c6('0x2c')],qs[_0x39c6('0x33')](_0x185869['query']['fields']));_0x5c07f7[_0x39c6('0x32')]=_0x5c07f7[_0x39c6('0x32')][_0x39c6('0x34')]?_0x5c07f7[_0x39c6('0x32')]:_0x4937c4[_0x39c6('0x2c')];if(!_0x185869[_0x39c6('0x2e')][_0x39c6('0x35')]('nolimit')){_0x5c07f7[_0x39c6('0x1d')]=qs[_0x39c6('0x1d')](_0x185869['query']['limit']);_0x5c07f7[_0x39c6('0x1c')]=qs[_0x39c6('0x1c')](_0x185869[_0x39c6('0x2e')][_0x39c6('0x1c')]);}_0x5c07f7[_0x39c6('0x36')]=qs[_0x39c6('0x37')](_0x185869[_0x39c6('0x2e')][_0x39c6('0x37')]);_0x5c07f7[_0x39c6('0x38')]=qs[_0x39c6('0x30')](_[_0x39c6('0x39')](_0x185869[_0x39c6('0x2e')],_0x4937c4[_0x39c6('0x30')]),_0x243d47);if(_0x185869['query']['filter']){_0x5c07f7[_0x39c6('0x38')]=_[_0x39c6('0x3a')](_0x5c07f7[_0x39c6('0x38')],{'$or':_['map'](_0x243d47,function(_0x2eda73){if(_0x2eda73[_0x39c6('0x2a')]!==_0x39c6('0x3b')){var _0xd92ccc={};_0xd92ccc[_0x2eda73['name']]={'$like':'%'+_0x185869['query'][_0x39c6('0x3c')]+'%'};return _0xd92ccc;}})});}_0x5c07f7=_['merge']({},_0x5c07f7,_0x185869[_0x39c6('0x3d')]);var _0x18aae9={'where':_0x5c07f7[_0x39c6('0x38')]};return db[_0x39c6('0x28')]['count'](_0x18aae9)[_0x39c6('0x22')](function(_0x8e4821){_0x43d1be[_0x39c6('0x1f')]=_0x8e4821;if(_0x185869[_0x39c6('0x2e')][_0x39c6('0x3e')]){_0x5c07f7[_0x39c6('0x3f')]=[{'all':!![]}];}return db[_0x39c6('0x28')][_0x39c6('0x40')](_0x5c07f7);})[_0x39c6('0x22')](function(_0x4bf748){_0x43d1be['rows']=_0x4bf748;return _0x43d1be;})[_0x39c6('0x22')](respondWithFilteredResult(_0x179f15,_0x5c07f7))['catch'](handleError(_0x179f15,null));};exports[_0x39c6('0x41')]=function(_0x4c3bf2,_0x4989ac){var _0x3642fc={'raw':!![],'where':{'id':_0x4c3bf2[_0x39c6('0x42')]['id']}},_0x1f6d26={};_0x1f6d26['model']=_[_0x39c6('0x2f')](db[_0x39c6('0x28')][_0x39c6('0x43')]);_0x1f6d26[_0x39c6('0x2e')]=_[_0x39c6('0x2f')](_0x4c3bf2[_0x39c6('0x2e')]);_0x1f6d26['filters']=_['intersection'](_0x1f6d26[_0x39c6('0x2c')],_0x1f6d26[_0x39c6('0x2e')]);_0x3642fc['attributes']=_[_0x39c6('0x31')](_0x1f6d26[_0x39c6('0x2c')],qs['fields'](_0x4c3bf2[_0x39c6('0x2e')][_0x39c6('0x33')]));_0x3642fc[_0x39c6('0x32')]=_0x3642fc[_0x39c6('0x32')][_0x39c6('0x34')]?_0x3642fc[_0x39c6('0x32')]:_0x1f6d26['model'];if(_0x4c3bf2[_0x39c6('0x2e')][_0x39c6('0x3e')]){_0x3642fc[_0x39c6('0x3f')]=[{'all':!![]}];}_0x3642fc=_[_0x39c6('0x3a')]({},_0x3642fc,_0x4c3bf2[_0x39c6('0x3d')]);return db['ChatQueueReport'][_0x39c6('0x44')](_0x3642fc)['then'](handleEntityNotFound(_0x4989ac,null))[_0x39c6('0x22')](respondWithResult(_0x4989ac,null))[_0x39c6('0x45')](handleError(_0x4989ac,null));};exports[_0x39c6('0x46')]=function(_0x15dc9a,_0x144130){return db[_0x39c6('0x28')][_0x39c6('0x46')](_0x15dc9a[_0x39c6('0x47')],{})['then'](respondWithResult(_0x144130,0xc9))[_0x39c6('0x45')](handleError(_0x144130,null));};exports[_0x39c6('0x21')]=function(_0x209bda,_0x3147e2){if(_0x209bda[_0x39c6('0x47')]['id']){delete _0x209bda[_0x39c6('0x47')]['id'];}return db[_0x39c6('0x28')][_0x39c6('0x44')]({'where':{'id':_0x209bda[_0x39c6('0x42')]['id']}})['then'](handleEntityNotFound(_0x3147e2,null))[_0x39c6('0x22')](saveUpdates(_0x209bda[_0x39c6('0x47')],null))[_0x39c6('0x22')](respondWithResult(_0x3147e2,null))['catch'](handleError(_0x3147e2,null));};exports[_0x39c6('0x23')]=function(_0x56df9b,_0x34f0bf){return db['ChatQueueReport'][_0x39c6('0x44')]({'where':{'id':_0x56df9b[_0x39c6('0x42')]['id']}})[_0x39c6('0x22')](handleEntityNotFound(_0x34f0bf,null))['then'](removeEntity(_0x34f0bf,null))[_0x39c6('0x45')](handleError(_0x34f0bf,null));};exports[_0x39c6('0x48')]=function(_0x348228,_0x27e8e7){return db[_0x39c6('0x28')][_0x39c6('0x48')]()['then'](respondWithResult(_0x27e8e7,null))[_0x39c6('0x45')](handleError(_0x27e8e7,null));}; \ No newline at end of file +var _0xe056=['zip-dir','fast-json-patch','request-promise','bluebird','util','path','fs-extra','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','stack','name','send','map','ChatQueueReport','fieldName','type','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','params','fields','merge','find','catch','create','body','destroy','describe'];(function(_0x475741,_0x30bf38){var _0x4e34ec=function(_0x2e91c9){while(--_0x2e91c9){_0x475741['push'](_0x475741['shift']());}};_0x4e34ec(++_0x30bf38);}(_0xe056,0xdb));var _0x6e05=function(_0x55c00d,_0x520cb6){_0x55c00d=_0x55c00d-0x0;var _0x254a8f=_0xe056[_0x55c00d];return _0x254a8f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6e05('0x0'));var jsonpatch=require(_0x6e05('0x1'));var rp=require(_0x6e05('0x2'));var moment=require('moment');var BPromise=require(_0x6e05('0x3'));var Mustache=require('mustache');var util=require(_0x6e05('0x4'));var path=require(_0x6e05('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e05('0x6'));var _=require(_0x6e05('0x7'));var squel=require(_0x6e05('0x8'));var crypto=require('crypto');var jsforce=require(_0x6e05('0x9'));var deskjs=require(_0x6e05('0xa'));var toCsv=require(_0x6e05('0xb'));var querystring=require(_0x6e05('0xc'));var Papa=require(_0x6e05('0xd'));var Redis=require('ioredis');var authService=require(_0x6e05('0xe'));var qs=require(_0x6e05('0xf'));var as=require(_0x6e05('0x10'));var hardwareService=require(_0x6e05('0x11'));var logger=require(_0x6e05('0x12'))(_0x6e05('0x13'));var utils=require('../../config/utils');var config=require(_0x6e05('0x14'));var licenseUtil=require(_0x6e05('0x15'));var db=require(_0x6e05('0x16'))['db'];function respondWithStatusCode(_0x5eaf38,_0x111a7c){_0x111a7c=_0x111a7c||0xcc;return function(_0x41ce19){if(_0x41ce19){return _0x5eaf38[_0x6e05('0x17')](_0x111a7c);}return _0x5eaf38[_0x6e05('0x18')](_0x111a7c)[_0x6e05('0x19')]();};}function respondWithResult(_0x4f4fab,_0x20afe3){_0x20afe3=_0x20afe3||0xc8;return function(_0x291d2c){if(_0x291d2c){return _0x4f4fab['status'](_0x20afe3)['json'](_0x291d2c);}};}function respondWithFilteredResult(_0x37b270,_0x45567a){return function(_0xb0c230){if(_0xb0c230){var _0x5c778b=typeof _0x45567a[_0x6e05('0x1a')]==='undefined'&&typeof _0x45567a[_0x6e05('0x1b')]===_0x6e05('0x1c');var _0x517326=_0xb0c230['count'];var _0x9d1e04=_0x5c778b?0x0:_0x45567a[_0x6e05('0x1a')];var _0x4418c6=_0x5c778b?_0xb0c230[_0x6e05('0x1d')]:_0x45567a[_0x6e05('0x1a')]+_0x45567a['limit'];var _0x13d0aa;if(_0x4418c6>=_0x517326){_0x4418c6=_0x517326;_0x13d0aa=0xc8;}else{_0x13d0aa=0xce;}_0x37b270['status'](_0x13d0aa);return _0x37b270['set'](_0x6e05('0x1e'),_0x9d1e04+'-'+_0x4418c6+'/'+_0x517326)[_0x6e05('0x1f')](_0xb0c230);}return null;};}function patchUpdates(_0xe49265){return function(_0x3d9c12){try{jsonpatch[_0x6e05('0x20')](_0x3d9c12,_0xe49265,!![]);}catch(_0x31c52e){return BPromise[_0x6e05('0x21')](_0x31c52e);}return _0x3d9c12[_0x6e05('0x22')]();};}function saveUpdates(_0x488055,_0x1438a6){return function(_0x4db161){if(_0x4db161){return _0x4db161[_0x6e05('0x23')](_0x488055)[_0x6e05('0x24')](function(_0x3eb6e4){return _0x3eb6e4;});}return null;};}function removeEntity(_0x5988b5,_0x5dc6dc){return function(_0x447d4b){if(_0x447d4b){return _0x447d4b['destroy']()[_0x6e05('0x24')](function(){_0x5988b5[_0x6e05('0x18')](0xcc)[_0x6e05('0x19')]();});}};}function handleEntityNotFound(_0x3444ea,_0x3a268b){return function(_0x19f3a6){if(!_0x19f3a6){_0x3444ea[_0x6e05('0x17')](0x194);}return _0x19f3a6;};}function handleError(_0x5d7701,_0x3b8842){_0x3b8842=_0x3b8842||0x1f4;return function(_0x3bdfef){logger['error'](_0x3bdfef[_0x6e05('0x25')]);if(_0x3bdfef[_0x6e05('0x26')]){delete _0x3bdfef['name'];}_0x5d7701['status'](_0x3b8842)[_0x6e05('0x27')](_0x3bdfef);};}exports['index']=function(_0x2d421f,_0x3c2504){var _0x4c8852={},_0x4e15c7={},_0x3f19f7={'count':0x0,'rows':[]};var _0x15138d=_[_0x6e05('0x28')](db[_0x6e05('0x29')]['rawAttributes'],function(_0x2bc108){return{'name':_0x2bc108[_0x6e05('0x2a')],'type':_0x2bc108[_0x6e05('0x2b')]['key']};});_0x4e15c7[_0x6e05('0x2c')]=_['map'](_0x15138d,'name');_0x4e15c7['query']=_[_0x6e05('0x2d')](_0x2d421f[_0x6e05('0x2e')]);_0x4e15c7[_0x6e05('0x2f')]=_[_0x6e05('0x30')](_0x4e15c7[_0x6e05('0x2c')],_0x4e15c7[_0x6e05('0x2e')]);_0x4c8852[_0x6e05('0x31')]=_['intersection'](_0x4e15c7[_0x6e05('0x2c')],qs['fields'](_0x2d421f[_0x6e05('0x2e')]['fields']));_0x4c8852[_0x6e05('0x31')]=_0x4c8852['attributes'][_0x6e05('0x32')]?_0x4c8852['attributes']:_0x4e15c7[_0x6e05('0x2c')];if(!_0x2d421f['query'][_0x6e05('0x33')](_0x6e05('0x34'))){_0x4c8852[_0x6e05('0x1b')]=qs[_0x6e05('0x1b')](_0x2d421f[_0x6e05('0x2e')][_0x6e05('0x1b')]);_0x4c8852['offset']=qs[_0x6e05('0x1a')](_0x2d421f[_0x6e05('0x2e')][_0x6e05('0x1a')]);}_0x4c8852[_0x6e05('0x35')]=qs['sort'](_0x2d421f['query'][_0x6e05('0x36')]);_0x4c8852['where']=qs[_0x6e05('0x2f')](_[_0x6e05('0x37')](_0x2d421f[_0x6e05('0x2e')],_0x4e15c7[_0x6e05('0x2f')]),_0x15138d);if(_0x2d421f['query'][_0x6e05('0x38')]){_0x4c8852['where']=_['merge'](_0x4c8852[_0x6e05('0x39')],{'$or':_['map'](_0x15138d,function(_0x547950){if(_0x547950[_0x6e05('0x2b')]!==_0x6e05('0x3a')){var _0x2ec523={};_0x2ec523[_0x547950[_0x6e05('0x26')]]={'$like':'%'+_0x2d421f['query'][_0x6e05('0x38')]+'%'};return _0x2ec523;}})});}_0x4c8852=_['merge']({},_0x4c8852,_0x2d421f[_0x6e05('0x3b')]);var _0x3cf0e5={'where':_0x4c8852['where']};return db[_0x6e05('0x29')][_0x6e05('0x1d')](_0x3cf0e5)[_0x6e05('0x24')](function(_0x2498b7){_0x3f19f7['count']=_0x2498b7;if(_0x2d421f['query'][_0x6e05('0x3c')]){_0x4c8852[_0x6e05('0x3d')]=[{'all':!![]}];}return db[_0x6e05('0x29')][_0x6e05('0x3e')](_0x4c8852);})[_0x6e05('0x24')](function(_0x5df453){_0x3f19f7[_0x6e05('0x3f')]=_0x5df453;return _0x3f19f7;})['then'](respondWithFilteredResult(_0x3c2504,_0x4c8852))['catch'](handleError(_0x3c2504,null));};exports['show']=function(_0x4a4f56,_0xeabd51){var _0x562dd8={'raw':!![],'where':{'id':_0x4a4f56[_0x6e05('0x40')]['id']}},_0x506515={};_0x506515[_0x6e05('0x2c')]=_[_0x6e05('0x2d')](db[_0x6e05('0x29')]['rawAttributes']);_0x506515[_0x6e05('0x2e')]=_['keys'](_0x4a4f56[_0x6e05('0x2e')]);_0x506515['filters']=_[_0x6e05('0x30')](_0x506515['model'],_0x506515[_0x6e05('0x2e')]);_0x562dd8['attributes']=_[_0x6e05('0x30')](_0x506515[_0x6e05('0x2c')],qs[_0x6e05('0x41')](_0x4a4f56['query']['fields']));_0x562dd8[_0x6e05('0x31')]=_0x562dd8[_0x6e05('0x31')]['length']?_0x562dd8[_0x6e05('0x31')]:_0x506515[_0x6e05('0x2c')];if(_0x4a4f56[_0x6e05('0x2e')][_0x6e05('0x3c')]){_0x562dd8[_0x6e05('0x3d')]=[{'all':!![]}];}_0x562dd8=_[_0x6e05('0x42')]({},_0x562dd8,_0x4a4f56[_0x6e05('0x3b')]);return db[_0x6e05('0x29')][_0x6e05('0x43')](_0x562dd8)[_0x6e05('0x24')](handleEntityNotFound(_0xeabd51,null))[_0x6e05('0x24')](respondWithResult(_0xeabd51,null))[_0x6e05('0x44')](handleError(_0xeabd51,null));};exports[_0x6e05('0x45')]=function(_0x3dc9d9,_0x30f81c){return db[_0x6e05('0x29')]['create'](_0x3dc9d9[_0x6e05('0x46')],{})[_0x6e05('0x24')](respondWithResult(_0x30f81c,0xc9))[_0x6e05('0x44')](handleError(_0x30f81c,null));};exports[_0x6e05('0x23')]=function(_0x5aada1,_0x5158cb){if(_0x5aada1[_0x6e05('0x46')]['id']){delete _0x5aada1['body']['id'];}return db[_0x6e05('0x29')][_0x6e05('0x43')]({'where':{'id':_0x5aada1[_0x6e05('0x40')]['id']}})[_0x6e05('0x24')](handleEntityNotFound(_0x5158cb,null))['then'](saveUpdates(_0x5aada1[_0x6e05('0x46')],null))[_0x6e05('0x24')](respondWithResult(_0x5158cb,null))[_0x6e05('0x44')](handleError(_0x5158cb,null));};exports[_0x6e05('0x47')]=function(_0x2e6cc1,_0x518ae6){return db[_0x6e05('0x29')][_0x6e05('0x43')]({'where':{'id':_0x2e6cc1['params']['id']}})[_0x6e05('0x24')](handleEntityNotFound(_0x518ae6,null))[_0x6e05('0x24')](removeEntity(_0x518ae6,null))[_0x6e05('0x44')](handleError(_0x518ae6,null));};exports[_0x6e05('0x48')]=function(_0x955e53,_0x4c28e6){return db[_0x6e05('0x29')][_0x6e05('0x48')]()[_0x6e05('0x24')](respondWithResult(_0x4c28e6,null))[_0x6e05('0x44')](handleError(_0x4c28e6,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 20e5a98..e71818b 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x5eeab4,_0x54e64d){var _0x17db45=function(_0x48f859){while(--_0x48f859){_0x5eeab4['push'](_0x5eeab4['shift']());}};_0x17db45(++_0x54e64d);}(_0x757a,0xde));var _0xa757=function(_0x5beefa,_0x23c13d){_0x5beefa=_0x5beefa-0x0;var _0x5504c3=_0x757a[_0x5beefa];return _0x5504c3;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x31fde5,_0x102465){var _0x2579c1=function(_0x599106){while(--_0x599106){_0x31fde5['push'](_0x31fde5['shift']());}};_0x2579c1(++_0x102465);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 74eff32..73ce835 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 _0x769d=['ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateChatQueueReport','ChatQueueReport','options','raw','then','catch','UpdateChatQueueReport','update','body','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info'];(function(_0x15d6d5,_0x38c614){var _0x56a52d=function(_0x37cb9f){while(--_0x37cb9f){_0x15d6d5['push'](_0x15d6d5['shift']());}};_0x56a52d(++_0x38c614);}(_0x769d,0x132));var _0xd769=function(_0x16b816,_0x59c5f7){_0x16b816=_0x16b816-0x0;var _0xcbca40=_0x769d[_0x16b816];return _0xcbca40;};'use strict';var _=require(_0xd769('0x0'));var util=require(_0xd769('0x1'));var moment=require(_0xd769('0x2'));var BPromise=require(_0xd769('0x3'));var rs=require(_0xd769('0x4'));var fs=require('fs');var Redis=require(_0xd769('0x5'));var db=require(_0xd769('0x6'))['db'];var utils=require(_0xd769('0x7'));var logger=require(_0xd769('0x8'))(_0xd769('0x9'));var config=require('../../config/environment');var jayson=require(_0xd769('0xa'));var client=jayson[_0xd769('0xb')][_0xd769('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39bb4c,_0x22fa61,_0xced3ae){return new BPromise(function(_0x2dfd2b,_0x4cb6e6){return client['request'](_0x39bb4c,_0xced3ae)['then'](function(_0x36ec60){logger[_0xd769('0xd')](_0xd769('0xe'),_0x22fa61,'request\x20sent');logger[_0xd769('0xf')](_0xd769('0x10'),_0x22fa61,_0xd769('0x11'),JSON[_0xd769('0x12')](_0x36ec60));if(_0x36ec60['error']){if(_0x36ec60[_0xd769('0x13')]['code']===0x1f4){logger[_0xd769('0x13')](_0xd769('0xe'),_0x22fa61,_0x36ec60[_0xd769('0x13')][_0xd769('0x14')]);return _0x4cb6e6(_0x36ec60[_0xd769('0x13')]['message']);}logger[_0xd769('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x22fa61,_0x36ec60[_0xd769('0x13')][_0xd769('0x14')]);return _0x2dfd2b(_0x36ec60[_0xd769('0x13')][_0xd769('0x14')]);}else{logger[_0xd769('0xd')](_0xd769('0xe'),_0x22fa61,_0xd769('0x11'));_0x2dfd2b(_0x36ec60[_0xd769('0x15')]['message']);}})['catch'](function(_0x5222fc){logger[_0xd769('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x22fa61,_0x5222fc);_0x4cb6e6(_0x5222fc);});});}exports[_0xd769('0x16')]=function(_0x4c6719){var _0x2d499b=this;return new Promise(function(_0x409134,_0x394a92){return db[_0xd769('0x17')]['create'](_0x4c6719['body'],{'raw':_0x4c6719['options']?_0x4c6719[_0xd769('0x18')][_0xd769('0x19')]===undefined?!![]:![]:!![]})[_0xd769('0x1a')](function(_0x322771){logger['info'](_0xd769('0x16'),_0x4c6719);logger[_0xd769('0xf')]('CreateChatQueueReport',_0x4c6719,JSON[_0xd769('0x12')](_0x322771));_0x409134(_0x322771);})[_0xd769('0x1b')](function(_0x36c220){logger['error'](_0xd769('0x16'),_0x36c220[_0xd769('0x14')],_0x4c6719);_0x394a92(_0x2d499b[_0xd769('0x13')](0x1f4,_0x36c220['message']));});});};exports[_0xd769('0x1c')]=function(_0x52e77a){var _0x5b9ac8=this;return new Promise(function(_0x1336e0,_0x9ec648){return db[_0xd769('0x17')][_0xd769('0x1d')](_0x52e77a[_0xd769('0x1e')],{'raw':_0x52e77a[_0xd769('0x18')]?_0x52e77a[_0xd769('0x18')][_0xd769('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52e77a[_0xd769('0x18')]?_0x52e77a[_0xd769('0x18')]['where']||null:null,'attributes':_0x52e77a[_0xd769('0x18')]?_0x52e77a['options'][_0xd769('0x1f')]||null:null,'limit':_0x52e77a[_0xd769('0x18')]?_0x52e77a[_0xd769('0x18')]['limit']||null:null})['then'](function(_0x15f8f7){logger[_0xd769('0xd')]('UpdateChatQueueReport',_0x52e77a);logger[_0xd769('0xf')](_0xd769('0x1c'),_0x52e77a,JSON['stringify'](_0x15f8f7));_0x1336e0(_0x15f8f7);})[_0xd769('0x1b')](function(_0x3db963){logger['error'](_0xd769('0x1c'),_0x3db963[_0xd769('0x14')],_0x52e77a);_0x9ec648(_0x5b9ac8[_0xd769('0x13')](0x1f4,_0x3db963[_0xd769('0x14')]));});});}; \ No newline at end of file +var _0x14e9=['message','request\x20sent','result','catch','CreateChatQueueReport','options','raw','stringify','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','util','moment','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0xaa1cab,_0x5f54b2){var _0x48cbeb=function(_0x58c0c8){while(--_0x58c0c8){_0xaa1cab['push'](_0xaa1cab['shift']());}};_0x48cbeb(++_0x5f54b2);}(_0x14e9,0x126));var _0x914e=function(_0x29e849,_0x4c5a26){_0x29e849=_0x29e849-0x0;var _0x57f144=_0x14e9[_0x29e849];return _0x57f144;};'use strict';var _=require(_0x914e('0x0'));var util=require(_0x914e('0x1'));var moment=require(_0x914e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x914e('0x3'));var logger=require('../../config/logger')(_0x914e('0x4'));var config=require(_0x914e('0x5'));var jayson=require(_0x914e('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x400d61,_0x591250,_0x1f6b12){return new BPromise(function(_0x1dba13,_0x4a7d08){return client['request'](_0x400d61,_0x1f6b12)[_0x914e('0x7')](function(_0x4f3b1b){logger[_0x914e('0x8')](_0x914e('0x9'),_0x591250,'request\x20sent');logger[_0x914e('0xa')](_0x914e('0xb'),_0x591250,'request\x20sent',JSON['stringify'](_0x4f3b1b));if(_0x4f3b1b['error']){if(_0x4f3b1b[_0x914e('0xc')][_0x914e('0xd')]===0x1f4){logger[_0x914e('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x591250,_0x4f3b1b[_0x914e('0xc')][_0x914e('0xe')]);return _0x4a7d08(_0x4f3b1b['error']['message']);}logger[_0x914e('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x591250,_0x4f3b1b[_0x914e('0xc')]['message']);return _0x1dba13(_0x4f3b1b['error']['message']);}else{logger[_0x914e('0x8')]('ChatQueueReport,\x20%s,\x20%s',_0x591250,_0x914e('0xf'));_0x1dba13(_0x4f3b1b[_0x914e('0x10')][_0x914e('0xe')]);}})[_0x914e('0x11')](function(_0x30b800){logger[_0x914e('0xc')](_0x914e('0x9'),_0x591250,_0x30b800);_0x4a7d08(_0x30b800);});});}exports[_0x914e('0x12')]=function(_0x147d6f){var _0x1b53d4=this;return new Promise(function(_0xce5e07,_0x193a47){return db['ChatQueueReport']['create'](_0x147d6f['body'],{'raw':_0x147d6f[_0x914e('0x13')]?_0x147d6f[_0x914e('0x13')][_0x914e('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x5d5e12){logger[_0x914e('0x8')](_0x914e('0x12'),_0x147d6f);logger['debug'](_0x914e('0x12'),_0x147d6f,JSON[_0x914e('0x15')](_0x5d5e12));_0xce5e07(_0x5d5e12);})[_0x914e('0x11')](function(_0x12e387){logger[_0x914e('0xc')](_0x914e('0x12'),_0x12e387[_0x914e('0xe')],_0x147d6f);_0x193a47(_0x1b53d4[_0x914e('0xc')](0x1f4,_0x12e387[_0x914e('0xe')]));});});};exports[_0x914e('0x16')]=function(_0x4477fe){var _0x46de39=this;return new Promise(function(_0x5cac0f,_0x3eddbb){return db['ChatQueueReport'][_0x914e('0x17')](_0x4477fe[_0x914e('0x18')],{'raw':_0x4477fe[_0x914e('0x13')]?_0x4477fe[_0x914e('0x13')][_0x914e('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4477fe[_0x914e('0x13')]?_0x4477fe[_0x914e('0x13')][_0x914e('0x19')]||null:null,'attributes':_0x4477fe['options']?_0x4477fe[_0x914e('0x13')][_0x914e('0x1a')]||null:null,'limit':_0x4477fe[_0x914e('0x13')]?_0x4477fe['options'][_0x914e('0x1b')]||null:null})[_0x914e('0x7')](function(_0x362a77){logger[_0x914e('0x8')](_0x914e('0x16'),_0x4477fe);logger['debug'](_0x914e('0x16'),_0x4477fe,JSON[_0x914e('0x15')](_0x362a77));_0x5cac0f(_0x362a77);})[_0x914e('0x11')](function(_0x45c3fb){logger[_0x914e('0xc')](_0x914e('0x16'),_0x45c3fb['message'],_0x4477fe);_0x3eddbb(_0x46de39[_0x914e('0xc')](0x1f4,_0x45c3fb[_0x914e('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 15a5234..26151de 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 _0xf74d=['index','/describe','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xf74d,0x149));var _0xdf74=function(_0x218ed8,_0x488d2f){_0x218ed8=_0x218ed8-0x0;var _0x2cc496=_0xf74d[_0x218ed8];return _0x2cc496;};'use strict';var multer=require(_0xdf74('0x0'));var util=require(_0xdf74('0x1'));var path=require(_0xdf74('0x2'));var timeout=require(_0xdf74('0x3'));var express=require(_0xdf74('0x4'));var router=express['Router']();var fs_extra=require(_0xdf74('0x5'));var auth=require(_0xdf74('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdf74('0x7'));var controller=require(_0xdf74('0x8'));router[_0xdf74('0x9')]('/',auth[_0xdf74('0xa')](),controller[_0xdf74('0xb')]);router[_0xdf74('0x9')](_0xdf74('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xdf74('0x9')](_0xdf74('0xd'),auth[_0xdf74('0xa')](),controller[_0xdf74('0xe')]);router['post']('/',auth[_0xdf74('0xa')](),controller[_0xdf74('0xf')]);router[_0xdf74('0x10')]('/:id',auth[_0xdf74('0xa')](),controller[_0xdf74('0x11')]);router[_0xdf74('0x12')](_0xdf74('0xd'),auth['isAuthenticated'](),controller[_0xdf74('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1ce7=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','multer','util','path','connect-timeout','express'];(function(_0x5a5aa5,_0x5a2718){var _0x4afd2c=function(_0x3a31ef){while(--_0x3a31ef){_0x5a5aa5['push'](_0x5a5aa5['shift']());}};_0x4afd2c(++_0x5a2718);}(_0x1ce7,0x79));var _0x71ce=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0x1ce7[_0x2d4421];return _0x2d3b01;};'use strict';var multer=require(_0x71ce('0x0'));var util=require(_0x71ce('0x1'));var path=require(_0x71ce('0x2'));var timeout=require(_0x71ce('0x3'));var express=require(_0x71ce('0x4'));var router=express[_0x71ce('0x5')]();var fs_extra=require(_0x71ce('0x6'));var auth=require(_0x71ce('0x7'));var interaction=require(_0x71ce('0x8'));var config=require(_0x71ce('0x9'));var controller=require(_0x71ce('0xa'));router[_0x71ce('0xb')]('/',auth[_0x71ce('0xc')](),controller[_0x71ce('0xd')]);router[_0x71ce('0xb')](_0x71ce('0xe'),auth[_0x71ce('0xc')](),controller[_0x71ce('0xf')]);router[_0x71ce('0xb')](_0x71ce('0x10'),auth[_0x71ce('0xc')](),controller[_0x71ce('0x11')]);router[_0x71ce('0x12')]('/',auth[_0x71ce('0xc')](),controller['create']);router['put'](_0x71ce('0x10'),auth[_0x71ce('0xc')](),controller[_0x71ce('0x13')]);router[_0x71ce('0x14')](_0x71ce('0x10'),auth[_0x71ce('0xc')](),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 44f9fe9..7022f5b 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x58f1ef,_0x4cf4d5){var _0x2ef772=function(_0x3b04ab){while(--_0x3b04ab){_0x58f1ef['push'](_0x58f1ef['shift']());}};_0x2ef772(++_0x4cf4d5);}(_0x34e8,0x12c));var _0x834e=function(_0x56938f,_0x34a52d){_0x56938f=_0x56938f-0x0;var _0x4b79b8=_0x34e8[_0x56938f];return _0x4b79b8;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x5ada26,_0x331a0c){var _0x129656=function(_0x4dbb81){while(--_0x4dbb81){_0x5ada26['push'](_0x5ada26['shift']());}};_0x129656(++_0x331a0c);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x00bb[_0x1ac595];return _0x455fff;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 5078d2e..9fcc8ce 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 _0x8e8f=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','name','send','map','ChatTransferReport','rawAttributes','type','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache'];(function(_0x3d94ef,_0x12ea90){var _0x205e97=function(_0x4107c4){while(--_0x4107c4){_0x3d94ef['push'](_0x3d94ef['shift']());}};_0x205e97(++_0x12ea90);}(_0x8e8f,0x16d));var _0xf8e8=function(_0x414e9e,_0x1575f6){_0x414e9e=_0x414e9e-0x0;var _0x31141f=_0x8e8f[_0x414e9e];return _0x31141f;};'use strict';var emlformat=require(_0xf8e8('0x0'));var rimraf=require(_0xf8e8('0x1'));var zipdir=require(_0xf8e8('0x2'));var jsonpatch=require(_0xf8e8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf8e8('0x4'));var util=require(_0xf8e8('0x5'));var path=require(_0xf8e8('0x6'));var sox=require(_0xf8e8('0x7'));var csv=require(_0xf8e8('0x8'));var ejs=require(_0xf8e8('0x9'));var fs=require('fs');var fs_extra=require(_0xf8e8('0xa'));var _=require(_0xf8e8('0xb'));var squel=require(_0xf8e8('0xc'));var crypto=require('crypto');var jsforce=require(_0xf8e8('0xd'));var deskjs=require(_0xf8e8('0xe'));var toCsv=require(_0xf8e8('0x8'));var querystring=require(_0xf8e8('0xf'));var Papa=require(_0xf8e8('0x10'));var Redis=require(_0xf8e8('0x11'));var authService=require(_0xf8e8('0x12'));var qs=require(_0xf8e8('0x13'));var as=require(_0xf8e8('0x14'));var hardwareService=require(_0xf8e8('0x15'));var logger=require(_0xf8e8('0x16'))('api');var utils=require(_0xf8e8('0x17'));var config=require(_0xf8e8('0x18'));var licenseUtil=require(_0xf8e8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x132afa,_0x5ea064){_0x5ea064=_0x5ea064||0xcc;return function(_0x53ed6e){if(_0x53ed6e){return _0x132afa[_0xf8e8('0x1a')](_0x5ea064);}return _0x132afa[_0xf8e8('0x1b')](_0x5ea064)[_0xf8e8('0x1c')]();};}function respondWithResult(_0x590c39,_0x1b37d5){_0x1b37d5=_0x1b37d5||0xc8;return function(_0x2387ad){if(_0x2387ad){return _0x590c39[_0xf8e8('0x1b')](_0x1b37d5)[_0xf8e8('0x1d')](_0x2387ad);}};}function respondWithFilteredResult(_0x6cf1db,_0x5021b3){return function(_0x28809d){if(_0x28809d){var _0xa964ef=typeof _0x5021b3[_0xf8e8('0x1e')]===_0xf8e8('0x1f')&&typeof _0x5021b3[_0xf8e8('0x20')]===_0xf8e8('0x1f');var _0x10adf6=_0x28809d[_0xf8e8('0x21')];var _0x37d804=_0xa964ef?0x0:_0x5021b3[_0xf8e8('0x1e')];var _0x1f8a3a=_0xa964ef?_0x28809d[_0xf8e8('0x21')]:_0x5021b3[_0xf8e8('0x1e')]+_0x5021b3[_0xf8e8('0x20')];var _0x380019;if(_0x1f8a3a>=_0x10adf6){_0x1f8a3a=_0x10adf6;_0x380019=0xc8;}else{_0x380019=0xce;}_0x6cf1db[_0xf8e8('0x1b')](_0x380019);return _0x6cf1db[_0xf8e8('0x22')](_0xf8e8('0x23'),_0x37d804+'-'+_0x1f8a3a+'/'+_0x10adf6)['json'](_0x28809d);}return null;};}function patchUpdates(_0x27cac0){return function(_0x688467){try{jsonpatch['apply'](_0x688467,_0x27cac0,!![]);}catch(_0x524f39){return BPromise[_0xf8e8('0x24')](_0x524f39);}return _0x688467['save']();};}function saveUpdates(_0x420f5f,_0x38ccd7){return function(_0x5f5a73){if(_0x5f5a73){return _0x5f5a73[_0xf8e8('0x25')](_0x420f5f)[_0xf8e8('0x26')](function(_0x157f86){return _0x157f86;});}return null;};}function removeEntity(_0x316008,_0xe79d09){return function(_0x46c106){if(_0x46c106){return _0x46c106[_0xf8e8('0x27')]()[_0xf8e8('0x26')](function(){_0x316008[_0xf8e8('0x1b')](0xcc)[_0xf8e8('0x1c')]();});}};}function handleEntityNotFound(_0x5dcf73,_0x6e7e){return function(_0x49ae97){if(!_0x49ae97){_0x5dcf73[_0xf8e8('0x1a')](0x194);}return _0x49ae97;};}function handleError(_0x1892ed,_0x1b1129){_0x1b1129=_0x1b1129||0x1f4;return function(_0x5a8a2e){logger[_0xf8e8('0x28')](_0x5a8a2e['stack']);if(_0x5a8a2e[_0xf8e8('0x29')]){delete _0x5a8a2e[_0xf8e8('0x29')];}_0x1892ed[_0xf8e8('0x1b')](_0x1b1129)[_0xf8e8('0x2a')](_0x5a8a2e);};}exports['index']=function(_0x1cf46d,_0x30bd54){var _0xb7c1e={},_0x19d0a0={},_0x661b84={'count':0x0,'rows':[]};var _0x37ae2d=_[_0xf8e8('0x2b')](db[_0xf8e8('0x2c')][_0xf8e8('0x2d')],function(_0x3676db){return{'name':_0x3676db['fieldName'],'type':_0x3676db[_0xf8e8('0x2e')][_0xf8e8('0x2f')]};});_0x19d0a0[_0xf8e8('0x30')]=_[_0xf8e8('0x2b')](_0x37ae2d,_0xf8e8('0x29'));_0x19d0a0['query']=_[_0xf8e8('0x31')](_0x1cf46d['query']);_0x19d0a0[_0xf8e8('0x32')]=_[_0xf8e8('0x33')](_0x19d0a0[_0xf8e8('0x30')],_0x19d0a0['query']);_0xb7c1e[_0xf8e8('0x34')]=_['intersection'](_0x19d0a0[_0xf8e8('0x30')],qs[_0xf8e8('0x35')](_0x1cf46d[_0xf8e8('0x36')]['fields']));_0xb7c1e[_0xf8e8('0x34')]=_0xb7c1e['attributes']['length']?_0xb7c1e[_0xf8e8('0x34')]:_0x19d0a0[_0xf8e8('0x30')];if(!_0x1cf46d[_0xf8e8('0x36')][_0xf8e8('0x37')](_0xf8e8('0x38'))){_0xb7c1e['limit']=qs[_0xf8e8('0x20')](_0x1cf46d[_0xf8e8('0x36')][_0xf8e8('0x20')]);_0xb7c1e[_0xf8e8('0x1e')]=qs[_0xf8e8('0x1e')](_0x1cf46d[_0xf8e8('0x36')][_0xf8e8('0x1e')]);}_0xb7c1e[_0xf8e8('0x39')]=qs['sort'](_0x1cf46d[_0xf8e8('0x36')]['sort']);_0xb7c1e['where']=qs[_0xf8e8('0x32')](_['pick'](_0x1cf46d[_0xf8e8('0x36')],_0x19d0a0[_0xf8e8('0x32')]),_0x37ae2d);if(_0x1cf46d[_0xf8e8('0x36')][_0xf8e8('0x3a')]){_0xb7c1e[_0xf8e8('0x3b')]=_[_0xf8e8('0x3c')](_0xb7c1e[_0xf8e8('0x3b')],{'$or':_[_0xf8e8('0x2b')](_0x37ae2d,function(_0x29f00a){if(_0x29f00a[_0xf8e8('0x2e')]!==_0xf8e8('0x3d')){var _0x391d8a={};_0x391d8a[_0x29f00a[_0xf8e8('0x29')]]={'$like':'%'+_0x1cf46d[_0xf8e8('0x36')][_0xf8e8('0x3a')]+'%'};return _0x391d8a;}})});}_0xb7c1e=_[_0xf8e8('0x3c')]({},_0xb7c1e,_0x1cf46d[_0xf8e8('0x3e')]);var _0xe76139={'where':_0xb7c1e[_0xf8e8('0x3b')]};return db[_0xf8e8('0x2c')][_0xf8e8('0x21')](_0xe76139)[_0xf8e8('0x26')](function(_0xe829d3){_0x661b84[_0xf8e8('0x21')]=_0xe829d3;if(_0x1cf46d[_0xf8e8('0x36')][_0xf8e8('0x3f')]){_0xb7c1e[_0xf8e8('0x40')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xf8e8('0x41')](_0xb7c1e);})[_0xf8e8('0x26')](function(_0x1da5de){_0x661b84['rows']=_0x1da5de;return _0x661b84;})[_0xf8e8('0x26')](respondWithFilteredResult(_0x30bd54,_0xb7c1e))[_0xf8e8('0x42')](handleError(_0x30bd54,null));};exports[_0xf8e8('0x43')]=function(_0x410264,_0x34eaa7){var _0x4ec116={'raw':!![],'where':{'id':_0x410264[_0xf8e8('0x44')]['id']}},_0x3b2b1c={};_0x3b2b1c[_0xf8e8('0x30')]=_[_0xf8e8('0x31')](db['ChatTransferReport'][_0xf8e8('0x2d')]);_0x3b2b1c[_0xf8e8('0x36')]=_[_0xf8e8('0x31')](_0x410264[_0xf8e8('0x36')]);_0x3b2b1c[_0xf8e8('0x32')]=_[_0xf8e8('0x33')](_0x3b2b1c[_0xf8e8('0x30')],_0x3b2b1c[_0xf8e8('0x36')]);_0x4ec116['attributes']=_['intersection'](_0x3b2b1c['model'],qs['fields'](_0x410264['query'][_0xf8e8('0x35')]));_0x4ec116['attributes']=_0x4ec116[_0xf8e8('0x34')][_0xf8e8('0x45')]?_0x4ec116[_0xf8e8('0x34')]:_0x3b2b1c['model'];if(_0x410264['query'][_0xf8e8('0x3f')]){_0x4ec116[_0xf8e8('0x40')]=[{'all':!![]}];}_0x4ec116=_[_0xf8e8('0x3c')]({},_0x4ec116,_0x410264[_0xf8e8('0x3e')]);return db[_0xf8e8('0x2c')][_0xf8e8('0x46')](_0x4ec116)['then'](handleEntityNotFound(_0x34eaa7,null))[_0xf8e8('0x26')](respondWithResult(_0x34eaa7,null))[_0xf8e8('0x42')](handleError(_0x34eaa7,null));};exports[_0xf8e8('0x47')]=function(_0xaff1cc,_0x266c73){return db[_0xf8e8('0x2c')][_0xf8e8('0x47')](_0xaff1cc[_0xf8e8('0x48')],{})[_0xf8e8('0x26')](respondWithResult(_0x266c73,0xc9))[_0xf8e8('0x42')](handleError(_0x266c73,null));};exports[_0xf8e8('0x25')]=function(_0x5b6a98,_0x51146e){if(_0x5b6a98[_0xf8e8('0x48')]['id']){delete _0x5b6a98[_0xf8e8('0x48')]['id'];}return db[_0xf8e8('0x2c')][_0xf8e8('0x46')]({'where':{'id':_0x5b6a98['params']['id']}})[_0xf8e8('0x26')](handleEntityNotFound(_0x51146e,null))[_0xf8e8('0x26')](saveUpdates(_0x5b6a98[_0xf8e8('0x48')],null))[_0xf8e8('0x26')](respondWithResult(_0x51146e,null))[_0xf8e8('0x42')](handleError(_0x51146e,null));};exports[_0xf8e8('0x27')]=function(_0xe53949,_0x3c84a1){return db[_0xf8e8('0x2c')][_0xf8e8('0x46')]({'where':{'id':_0xe53949['params']['id']}})[_0xf8e8('0x26')](handleEntityNotFound(_0x3c84a1,null))[_0xf8e8('0x26')](removeEntity(_0x3c84a1,null))[_0xf8e8('0x42')](handleError(_0x3c84a1,null));};exports[_0xf8e8('0x49')]=function(_0x4b967a,_0x5518ee){return db['ChatTransferReport'][_0xf8e8('0x49')]()[_0xf8e8('0x26')](respondWithResult(_0x5518ee,null))['catch'](handleError(_0x5518ee,null));}; \ No newline at end of file +var _0xfd3e=['pick','filter','where','options','includeAll','include','findAll','rows','params','keys','length','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','status','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order'];(function(_0xef55b,_0x205f6a){var _0x15c2a9=function(_0x5cb0d0){while(--_0x5cb0d0){_0xef55b['push'](_0xef55b['shift']());}};_0x15c2a9(++_0x205f6a);}(_0xfd3e,0xed));var _0xefd3=function(_0x1b10ad,_0x4499ef){_0x1b10ad=_0x1b10ad-0x0;var _0x1a833b=_0xfd3e[_0x1b10ad];return _0x1a833b;};'use strict';var emlformat=require(_0xefd3('0x0'));var rimraf=require(_0xefd3('0x1'));var zipdir=require(_0xefd3('0x2'));var jsonpatch=require(_0xefd3('0x3'));var rp=require(_0xefd3('0x4'));var moment=require(_0xefd3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xefd3('0x6'));var util=require(_0xefd3('0x7'));var path=require(_0xefd3('0x8'));var sox=require(_0xefd3('0x9'));var csv=require(_0xefd3('0xa'));var ejs=require(_0xefd3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xefd3('0xc'));var squel=require(_0xefd3('0xd'));var crypto=require(_0xefd3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xefd3('0xf'));var toCsv=require(_0xefd3('0xa'));var querystring=require(_0xefd3('0x10'));var Papa=require(_0xefd3('0x11'));var Redis=require(_0xefd3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xefd3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xefd3('0x14'))(_0xefd3('0x15'));var utils=require(_0xefd3('0x16'));var config=require(_0xefd3('0x17'));var licenseUtil=require(_0xefd3('0x18'));var db=require(_0xefd3('0x19'))['db'];function respondWithStatusCode(_0xd9f455,_0x1ad918){_0x1ad918=_0x1ad918||0xcc;return function(_0x424b14){if(_0x424b14){return _0xd9f455[_0xefd3('0x1a')](_0x1ad918);}return _0xd9f455['status'](_0x1ad918)[_0xefd3('0x1b')]();};}function respondWithResult(_0x14721d,_0x4a2fd2){_0x4a2fd2=_0x4a2fd2||0xc8;return function(_0x71e7f9){if(_0x71e7f9){return _0x14721d['status'](_0x4a2fd2)[_0xefd3('0x1c')](_0x71e7f9);}};}function respondWithFilteredResult(_0x3b83f4,_0x216ee0){return function(_0x3bd158){if(_0x3bd158){var _0x296824=typeof _0x216ee0[_0xefd3('0x1d')]==='undefined'&&typeof _0x216ee0[_0xefd3('0x1e')]===_0xefd3('0x1f');var _0x3ef528=_0x3bd158[_0xefd3('0x20')];var _0x2a7d16=_0x296824?0x0:_0x216ee0['offset'];var _0x2ef54d=_0x296824?_0x3bd158[_0xefd3('0x20')]:_0x216ee0[_0xefd3('0x1d')]+_0x216ee0['limit'];var _0x1cec8c;if(_0x2ef54d>=_0x3ef528){_0x2ef54d=_0x3ef528;_0x1cec8c=0xc8;}else{_0x1cec8c=0xce;}_0x3b83f4['status'](_0x1cec8c);return _0x3b83f4[_0xefd3('0x21')]('Content-Range',_0x2a7d16+'-'+_0x2ef54d+'/'+_0x3ef528)[_0xefd3('0x1c')](_0x3bd158);}return null;};}function patchUpdates(_0x304d40){return function(_0x201f20){try{jsonpatch[_0xefd3('0x22')](_0x201f20,_0x304d40,!![]);}catch(_0xe6707c){return BPromise[_0xefd3('0x23')](_0xe6707c);}return _0x201f20[_0xefd3('0x24')]();};}function saveUpdates(_0x405060,_0x597efa){return function(_0xbcdab7){if(_0xbcdab7){return _0xbcdab7[_0xefd3('0x25')](_0x405060)[_0xefd3('0x26')](function(_0x359c1b){return _0x359c1b;});}return null;};}function removeEntity(_0x5e1e09,_0x4ec3f1){return function(_0x14e25f){if(_0x14e25f){return _0x14e25f[_0xefd3('0x27')]()[_0xefd3('0x26')](function(){_0x5e1e09[_0xefd3('0x28')](0xcc)[_0xefd3('0x1b')]();});}};}function handleEntityNotFound(_0x5f9c6e,_0x23353a){return function(_0x33f97b){if(!_0x33f97b){_0x5f9c6e[_0xefd3('0x1a')](0x194);}return _0x33f97b;};}function handleError(_0x1682a9,_0x234f3e){_0x234f3e=_0x234f3e||0x1f4;return function(_0x4d35c5){logger[_0xefd3('0x29')](_0x4d35c5[_0xefd3('0x2a')]);if(_0x4d35c5[_0xefd3('0x2b')]){delete _0x4d35c5[_0xefd3('0x2b')];}_0x1682a9['status'](_0x234f3e)[_0xefd3('0x2c')](_0x4d35c5);};}exports['index']=function(_0x2998f6,_0x6d01af){var _0x825817={},_0x4f67a2={},_0x4ed998={'count':0x0,'rows':[]};var _0x2271be=_[_0xefd3('0x2d')](db[_0xefd3('0x2e')][_0xefd3('0x2f')],function(_0x1929ff){return{'name':_0x1929ff[_0xefd3('0x30')],'type':_0x1929ff[_0xefd3('0x31')][_0xefd3('0x32')]};});_0x4f67a2[_0xefd3('0x33')]=_[_0xefd3('0x2d')](_0x2271be,_0xefd3('0x2b'));_0x4f67a2['query']=_['keys'](_0x2998f6[_0xefd3('0x34')]);_0x4f67a2[_0xefd3('0x35')]=_[_0xefd3('0x36')](_0x4f67a2[_0xefd3('0x33')],_0x4f67a2[_0xefd3('0x34')]);_0x825817['attributes']=_[_0xefd3('0x36')](_0x4f67a2[_0xefd3('0x33')],qs[_0xefd3('0x37')](_0x2998f6[_0xefd3('0x34')][_0xefd3('0x37')]));_0x825817[_0xefd3('0x38')]=_0x825817[_0xefd3('0x38')]['length']?_0x825817[_0xefd3('0x38')]:_0x4f67a2[_0xefd3('0x33')];if(!_0x2998f6[_0xefd3('0x34')][_0xefd3('0x39')]('nolimit')){_0x825817[_0xefd3('0x1e')]=qs[_0xefd3('0x1e')](_0x2998f6[_0xefd3('0x34')][_0xefd3('0x1e')]);_0x825817[_0xefd3('0x1d')]=qs['offset'](_0x2998f6['query'][_0xefd3('0x1d')]);}_0x825817[_0xefd3('0x3a')]=qs['sort'](_0x2998f6['query']['sort']);_0x825817['where']=qs[_0xefd3('0x35')](_[_0xefd3('0x3b')](_0x2998f6[_0xefd3('0x34')],_0x4f67a2[_0xefd3('0x35')]),_0x2271be);if(_0x2998f6[_0xefd3('0x34')][_0xefd3('0x3c')]){_0x825817[_0xefd3('0x3d')]=_['merge'](_0x825817[_0xefd3('0x3d')],{'$or':_[_0xefd3('0x2d')](_0x2271be,function(_0x31d25e){if(_0x31d25e[_0xefd3('0x31')]!=='VIRTUAL'){var _0xf0d45a={};_0xf0d45a[_0x31d25e['name']]={'$like':'%'+_0x2998f6['query'][_0xefd3('0x3c')]+'%'};return _0xf0d45a;}})});}_0x825817=_['merge']({},_0x825817,_0x2998f6[_0xefd3('0x3e')]);var _0xa59970={'where':_0x825817[_0xefd3('0x3d')]};return db[_0xefd3('0x2e')]['count'](_0xa59970)[_0xefd3('0x26')](function(_0x250227){_0x4ed998[_0xefd3('0x20')]=_0x250227;if(_0x2998f6[_0xefd3('0x34')][_0xefd3('0x3f')]){_0x825817[_0xefd3('0x40')]=[{'all':!![]}];}return db[_0xefd3('0x2e')][_0xefd3('0x41')](_0x825817);})['then'](function(_0x282526){_0x4ed998[_0xefd3('0x42')]=_0x282526;return _0x4ed998;})[_0xefd3('0x26')](respondWithFilteredResult(_0x6d01af,_0x825817))['catch'](handleError(_0x6d01af,null));};exports['show']=function(_0x3ecf5e,_0x571a3b){var _0x38c7b0={'raw':!![],'where':{'id':_0x3ecf5e[_0xefd3('0x43')]['id']}},_0x2ac44c={};_0x2ac44c['model']=_[_0xefd3('0x44')](db[_0xefd3('0x2e')]['rawAttributes']);_0x2ac44c[_0xefd3('0x34')]=_[_0xefd3('0x44')](_0x3ecf5e[_0xefd3('0x34')]);_0x2ac44c[_0xefd3('0x35')]=_['intersection'](_0x2ac44c['model'],_0x2ac44c[_0xefd3('0x34')]);_0x38c7b0[_0xefd3('0x38')]=_['intersection'](_0x2ac44c[_0xefd3('0x33')],qs[_0xefd3('0x37')](_0x3ecf5e[_0xefd3('0x34')][_0xefd3('0x37')]));_0x38c7b0['attributes']=_0x38c7b0[_0xefd3('0x38')][_0xefd3('0x45')]?_0x38c7b0[_0xefd3('0x38')]:_0x2ac44c['model'];if(_0x3ecf5e[_0xefd3('0x34')][_0xefd3('0x3f')]){_0x38c7b0[_0xefd3('0x40')]=[{'all':!![]}];}_0x38c7b0=_['merge']({},_0x38c7b0,_0x3ecf5e[_0xefd3('0x3e')]);return db[_0xefd3('0x2e')]['find'](_0x38c7b0)[_0xefd3('0x26')](handleEntityNotFound(_0x571a3b,null))['then'](respondWithResult(_0x571a3b,null))[_0xefd3('0x46')](handleError(_0x571a3b,null));};exports['create']=function(_0x5199bb,_0x3a432f){return db[_0xefd3('0x2e')]['create'](_0x5199bb[_0xefd3('0x47')],{})[_0xefd3('0x26')](respondWithResult(_0x3a432f,0xc9))['catch'](handleError(_0x3a432f,null));};exports[_0xefd3('0x25')]=function(_0x4509a3,_0x418af0){if(_0x4509a3[_0xefd3('0x47')]['id']){delete _0x4509a3['body']['id'];}return db[_0xefd3('0x2e')][_0xefd3('0x48')]({'where':{'id':_0x4509a3[_0xefd3('0x43')]['id']}})[_0xefd3('0x26')](handleEntityNotFound(_0x418af0,null))['then'](saveUpdates(_0x4509a3[_0xefd3('0x47')],null))[_0xefd3('0x26')](respondWithResult(_0x418af0,null))[_0xefd3('0x46')](handleError(_0x418af0,null));};exports[_0xefd3('0x27')]=function(_0x4add97,_0x4f14fc){return db['ChatTransferReport'][_0xefd3('0x48')]({'where':{'id':_0x4add97[_0xefd3('0x43')]['id']}})[_0xefd3('0x26')](handleEntityNotFound(_0x4f14fc,null))[_0xefd3('0x26')](removeEntity(_0x4f14fc,null))[_0xefd3('0x46')](handleError(_0x4f14fc,null));};exports[_0xefd3('0x49')]=function(_0x2112bc,_0x1ae01e){return db['ChatTransferReport'][_0xefd3('0x49')]()[_0xefd3('0x26')](respondWithResult(_0x1ae01e,null))[_0xefd3('0x46')](handleError(_0x1ae01e,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 1c91741..dc0e3f0 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 _0x46ae=['path','../../config/environment','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2aa9d8,_0x229c09){var _0x5da03a=function(_0x224481){while(--_0x224481){_0x2aa9d8['push'](_0x2aa9d8['shift']());}};_0x5da03a(++_0x229c09);}(_0x46ae,0x19b));var _0xe46a=function(_0x4f232a,_0x529d8){_0x4f232a=_0x4f232a-0x0;var _0x4fda49=_0x46ae[_0x4f232a];return _0x4fda49;};'use strict';var _=require(_0xe46a('0x0'));var util=require(_0xe46a('0x1'));var logger=require(_0xe46a('0x2'))(_0xe46a('0x3'));var moment=require(_0xe46a('0x4'));var BPromise=require(_0xe46a('0x5'));var rp=require(_0xe46a('0x6'));var fs=require('fs');var path=require(_0xe46a('0x7'));var rimraf=require('rimraf');var config=require(_0xe46a('0x8'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x2078e3,_0xb69651){return _0x2078e3['define']('ChatTransferReport',attributes,{'tableName':_0xe46a('0x9'),'paranoid':![],'indexes':[{'name':_0xe46a('0xa'),'fields':[_0xe46a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5265=['exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x5e6c4b,_0x2d814e){var _0x288631=function(_0x201756){while(--_0x201756){_0x5e6c4b['push'](_0x5e6c4b['shift']());}};_0x288631(++_0x2d814e);}(_0x5265,0xa0));var _0x5526=function(_0x175598,_0x3380a9){_0x175598=_0x175598-0x0;var _0x3e5586=_0x5265[_0x175598];return _0x3e5586;};'use strict';var _=require(_0x5526('0x0'));var util=require(_0x5526('0x1'));var logger=require(_0x5526('0x2'))(_0x5526('0x3'));var moment=require(_0x5526('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5526('0x5'));var rimraf=require(_0x5526('0x6'));var config=require(_0x5526('0x7'));var attributes=require(_0x5526('0x8'));module[_0x5526('0x9')]=function(_0x3e500e,_0x3cfde0){return _0x3e500e['define'](_0x5526('0xa'),attributes,{'tableName':_0x5526('0xb'),'paranoid':![],'indexes':[{'name':_0x5526('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index eda8e76..2deb3c3 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 _0x6c9c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatTransferReport,\x20%s,\x20%s','info','result','lodash'];(function(_0x185c47,_0x170b23){var _0x15c135=function(_0x39f071){while(--_0x39f071){_0x185c47['push'](_0x185c47['shift']());}};_0x15c135(++_0x170b23);}(_0x6c9c,0x149));var _0xc6c9=function(_0x5b5202,_0x2ddc6e){_0x5b5202=_0x5b5202-0x0;var _0x55c452=_0x6c9c[_0x5b5202];return _0x55c452;};'use strict';var _=require(_0xc6c9('0x0'));var util=require('util');var moment=require(_0xc6c9('0x1'));var BPromise=require(_0xc6c9('0x2'));var rs=require(_0xc6c9('0x3'));var fs=require('fs');var Redis=require(_0xc6c9('0x4'));var db=require(_0xc6c9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6c9('0x6'))(_0xc6c9('0x7'));var config=require(_0xc6c9('0x8'));var jayson=require(_0xc6c9('0x9'));var client=jayson[_0xc6c9('0xa')][_0xc6c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd2cd0a,_0x14db95,_0x55df5b){return new BPromise(function(_0x335bd8,_0x1a8a9e){return client[_0xc6c9('0xc')](_0xd2cd0a,_0x55df5b)[_0xc6c9('0xd')](function(_0x1d76ad){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x14db95,_0xc6c9('0xe'));logger['debug'](_0xc6c9('0xf'),_0x14db95,'request\x20sent',JSON[_0xc6c9('0x10')](_0x1d76ad));if(_0x1d76ad['error']){if(_0x1d76ad[_0xc6c9('0x11')]['code']===0x1f4){logger[_0xc6c9('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x14db95,_0x1d76ad[_0xc6c9('0x11')]['message']);return _0x1a8a9e(_0x1d76ad[_0xc6c9('0x11')][_0xc6c9('0x12')]);}logger['error'](_0xc6c9('0x13'),_0x14db95,_0x1d76ad[_0xc6c9('0x11')][_0xc6c9('0x12')]);return _0x335bd8(_0x1d76ad[_0xc6c9('0x11')][_0xc6c9('0x12')]);}else{logger[_0xc6c9('0x14')](_0xc6c9('0x13'),_0x14db95,_0xc6c9('0xe'));_0x335bd8(_0x1d76ad[_0xc6c9('0x15')][_0xc6c9('0x12')]);}})['catch'](function(_0x5390e6){logger[_0xc6c9('0x11')](_0xc6c9('0x13'),_0x14db95,_0x5390e6);_0x1a8a9e(_0x5390e6);});});} \ No newline at end of file +var _0x214b=['jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xbbeb3b,_0x20b620){var _0x1213f0=function(_0x237618){while(--_0x237618){_0xbbeb3b['push'](_0xbbeb3b['shift']());}};_0x1213f0(++_0x20b620);}(_0x214b,0x1c0));var _0xb214=function(_0x56aa3e,_0x2c0b27){_0x56aa3e=_0x56aa3e-0x0;var _0x22aada=_0x214b[_0x56aa3e];return _0x22aada;};'use strict';var _=require(_0xb214('0x0'));var util=require(_0xb214('0x1'));var moment=require('moment');var BPromise=require(_0xb214('0x2'));var rs=require(_0xb214('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb214('0x4'))['db'];var utils=require(_0xb214('0x5'));var logger=require(_0xb214('0x6'))(_0xb214('0x7'));var config=require('../../config/environment');var jayson=require(_0xb214('0x8'));var client=jayson[_0xb214('0x9')][_0xb214('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dc2ef,_0x2e3c4f,_0xb4d21a){return new BPromise(function(_0x2e47bb,_0x5378b2){return client[_0xb214('0xb')](_0x5dc2ef,_0xb4d21a)[_0xb214('0xc')](function(_0x1db1bb){logger['info'](_0xb214('0xd'),_0x2e3c4f,_0xb214('0xe'));logger[_0xb214('0xf')](_0xb214('0x10'),_0x2e3c4f,_0xb214('0xe'),JSON[_0xb214('0x11')](_0x1db1bb));if(_0x1db1bb['error']){if(_0x1db1bb[_0xb214('0x12')][_0xb214('0x13')]===0x1f4){logger[_0xb214('0x12')](_0xb214('0xd'),_0x2e3c4f,_0x1db1bb[_0xb214('0x12')][_0xb214('0x14')]);return _0x5378b2(_0x1db1bb[_0xb214('0x12')][_0xb214('0x14')]);}logger['error'](_0xb214('0xd'),_0x2e3c4f,_0x1db1bb[_0xb214('0x12')][_0xb214('0x14')]);return _0x2e47bb(_0x1db1bb[_0xb214('0x12')][_0xb214('0x14')]);}else{logger[_0xb214('0x15')](_0xb214('0xd'),_0x2e3c4f,_0xb214('0xe'));_0x2e47bb(_0x1db1bb[_0xb214('0x16')][_0xb214('0x14')]);}})[_0xb214('0x17')](function(_0x1a3999){logger[_0xb214('0x12')](_0xb214('0xd'),_0x2e3c4f,_0x1a3999);_0x5378b2(_0x1a3999);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 2fb2ca4..8bc5dfb 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 _0x13b9=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','index','get','/describe','isAuthenticated','/:id','show','create','put','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0x2b2c7f,_0x4c987){var _0x5aa2c2=function(_0x5080b1){while(--_0x5080b1){_0x2b2c7f['push'](_0x2b2c7f['shift']());}};_0x5aa2c2(++_0x4c987);}(_0x13b9,0x152));var _0x913b=function(_0x466e03,_0x1b0e3d){_0x466e03=_0x466e03-0x0;var _0x1ecaa2=_0x13b9[_0x466e03];return _0x1ecaa2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x913b('0x0'));var timeout=require(_0x913b('0x1'));var express=require(_0x913b('0x2'));var router=express[_0x913b('0x3')]();var fs_extra=require(_0x913b('0x4'));var auth=require(_0x913b('0x5'));var interaction=require(_0x913b('0x6'));var config=require('../../config/environment');var controller=require(_0x913b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x913b('0x8')]);router[_0x913b('0x9')](_0x913b('0xa'),auth[_0x913b('0xb')](),controller['describe']);router[_0x913b('0x9')](_0x913b('0xc'),auth[_0x913b('0xb')](),controller[_0x913b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x913b('0xe')]);router[_0x913b('0xf')](_0x913b('0xc'),auth[_0x913b('0xb')](),controller[_0x913b('0x10')]);router['delete'](_0x913b('0xc'),auth['isAuthenticated'](),controller[_0x913b('0x11')]);module[_0x913b('0x12')]=router; \ No newline at end of file +var _0x0e89=['isAuthenticated','describe','/:id','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','/describe'];(function(_0x2da6ae,_0x4c6c86){var _0x444e37=function(_0x48a542){while(--_0x48a542){_0x2da6ae['push'](_0x2da6ae['shift']());}};_0x444e37(++_0x4c6c86);}(_0x0e89,0x16d));var _0x90e8=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x0e89[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0x90e8('0x0'));var util=require(_0x90e8('0x1'));var path=require(_0x90e8('0x2'));var timeout=require(_0x90e8('0x3'));var express=require(_0x90e8('0x4'));var router=express[_0x90e8('0x5')]();var fs_extra=require(_0x90e8('0x6'));var auth=require(_0x90e8('0x7'));var interaction=require(_0x90e8('0x8'));var config=require(_0x90e8('0x9'));var controller=require(_0x90e8('0xa'));router[_0x90e8('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x90e8('0xb')](_0x90e8('0xc'),auth[_0x90e8('0xd')](),controller[_0x90e8('0xe')]);router[_0x90e8('0xb')](_0x90e8('0xf'),auth[_0x90e8('0xd')](),controller['show']);router['post']('/',auth[_0x90e8('0xd')](),controller[_0x90e8('0x10')]);router['put']('/:id',auth[_0x90e8('0xd')](),controller[_0x90e8('0x11')]);router[_0x90e8('0x12')](_0x90e8('0xf'),auth[_0x90e8('0xd')](),controller[_0x90e8('0x13')]);module[_0x90e8('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 76e93f1..d40f9c2 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 _0x1be1=['textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','TEXT','stringify','input','name','getDataValue','onlineForm','parse','setDataValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1be1,0x192));var _0x11be=function(_0x28af70,_0x1ed39f){_0x28af70=_0x28af70-0x0;var _0x5bc238=_0x1be1[_0x28af70];return _0x5bc238;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x11be('0x0')]={'name':{'type':Sequelize[_0x11be('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x11be('0x2')},'description':{'type':Sequelize[_0x11be('0x1')]},'mapKey':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x3')},'key':{'type':Sequelize[_0x11be('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11be('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x11be('0x1')],'allowNull':![],'defaultValue':_0x11be('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x11be('0x1')],'allowNull':![],'defaultValue':_0x11be('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11be('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x11be('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x11be('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x11be('0x8')](_0x11be('0x9'),_0x11be('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0xb')},'start_chat_button':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xe')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x10')},'noteTitle':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x12')},'closingMessageButton':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x13')},'ratingType':{'type':Sequelize[_0x11be('0x8')](_0x11be('0x14'),_0x11be('0x15')),'defaultValue':_0x11be('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x11be('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x11be('0x16')],'defaultValue':function(){return JSON[_0x11be('0x17')]({'items':[{'type':_0x11be('0x18'),'variable':null,'config':{'placeholder':_0x11be('0x19'),'type':'text','required':!![]},'props':{'title':_0x11be('0x19'),'helpText':''}},{'type':_0x11be('0x18'),'props':{'title':_0x11be('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x11be('0x1a')](_0x11be('0x1b'))?JSON[_0x11be('0x1c')](this['getDataValue'](_0x11be('0x1b'))):{};},'set':function(_0x518e2b){return this[_0x11be('0x1d')]('onlineForm',JSON[_0x11be('0x17')](_0x518e2b));}},'offlineForm':{'type':Sequelize[_0x11be('0x16')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x11be('0x18'),'props':{'title':_0x11be('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x11be('0x3'),'type':_0x11be('0x3')},'variable':null},{'type':_0x11be('0x1e'),'config':{'placeholder':_0x11be('0x1f')},'props':{'title':_0x11be('0x1f'),'helpText':_0x11be('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x11be('0x1a')]('offlineForm')?JSON[_0x11be('0x1c')](this['getDataValue'](_0x11be('0x21'))):{};},'set':function(_0x147b62){return this['setDataValue']('offlineForm',JSON[_0x11be('0x17')](_0x147b62));}},'token':{'type':Sequelize[_0x11be('0x1')],'defaultValue':function(){return rs[_0x11be('0x22')]();}},'autoclose':{'type':Sequelize[_0x11be('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x11be('0x1')]},'forwardOffline':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x11be('0x1')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x23')},'waitingMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x25')},'offlineMessageBody':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x11be('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x26')},'skipUnmanaged':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x27')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'timezone':{'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[_0x11be('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x11be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x11be('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x28')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x29')},'defaultTitle':{'type':Sequelize[_0x11be('0x1')]},'customerAvatar':{'type':Sequelize[_0x11be('0x16')]},'showCustomerAvatar':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x11be('0x1')],'allowNull':![],'defaultValue':_0x11be('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x11be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x11be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x2b')},'systemAvatar':{'type':Sequelize[_0x11be('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x11be('0x6')],'comment':_0x11be('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2618f5){if(!_0x2618f5)this[_0x11be('0x1d')]('mandatoryDispositionPauseId',null);this[_0x11be('0x1d')](_0x11be('0x2d'),_0x2618f5);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x11be('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11be('0x2e')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x11be('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x11be('0x16')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x11be('0x16')]}}; \ No newline at end of file +var _0x4ea3=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','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.','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0x4ea3,0x70));var _0x34ea=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4ea3[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x34ea('0x0'));var rs=require(_0x34ea('0x1'));module[_0x34ea('0x2')]={'name':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x34ea('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x5')},'key':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x6')},'customerAlias':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x34ea('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x34ea('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x34ea('0xa')](_0x34ea('0xb'),_0x34ea('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0xd')},'start_chat_button':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0xe')},'offline_chat_button':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0xf')},'header_offline':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x10')},'download_transcript':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x34ea('0x12')]},'closingQuestion':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x14')},'noteTitle':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x16')},'closingMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0xf')},'skipMessageButton':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x18')},'conditionAgreement':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x19')},'ratingType':{'type':Sequelize['ENUM']('star',_0x34ea('0x1a')),'defaultValue':_0x34ea('0x1b')},'ratingStarsNumber':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x34ea('0x1c'),'variable':null,'config':{'placeholder':_0x34ea('0x1d'),'type':_0x34ea('0x1e'),'required':!![]},'props':{'title':_0x34ea('0x1d'),'helpText':''}},{'type':_0x34ea('0x1c'),'props':{'title':_0x34ea('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x34ea('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x34ea('0x1f')](_0x34ea('0x20'))?JSON[_0x34ea('0x21')](this['getDataValue']('onlineForm')):{};},'set':function(_0x564d1b){return this[_0x34ea('0x22')](_0x34ea('0x20'),JSON[_0x34ea('0x23')](_0x564d1b));}},'offlineForm':{'type':Sequelize[_0x34ea('0x12')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x34ea('0x1c'),'props':{'title':_0x34ea('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x34ea('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x34ea('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x34ea('0x1f')](_0x34ea('0x25'))?JSON[_0x34ea('0x21')](this['getDataValue'](_0x34ea('0x25'))):{};},'set':function(_0x59b9f6){return this[_0x34ea('0x22')]('offlineForm',JSON[_0x34ea('0x23')](_0x59b9f6));}},'token':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':function(){return rs[_0x34ea('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x27')},'waitingMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x18')},'sendUnmanaged':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x34ea('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x34ea('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x34ea('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x2c')},'verticalAlignment':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x2d')},'defaultTitle':{'type':Sequelize[_0x34ea('0x3')]},'customerAvatar':{'type':Sequelize[_0x34ea('0x12')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x34ea('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x2f')},'systemAvatar':{'type':Sequelize[_0x34ea('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x34ea('0x9')],'comment':_0x34ea('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![],'comment':_0x34ea('0x31'),'set':function(_0xa1ff39){if(!_0xa1ff39)this[_0x34ea('0x22')](_0x34ea('0x32'),null);this[_0x34ea('0x22')](_0x34ea('0x33'),_0xa1ff39);}},'vidaooEscalation':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x34ea('0x3')]},'vidaooTopic':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x34ea('0x35');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x34ea('0x12')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 198510f..74cdbb2 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 _0x4de3=['defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','count','set','Content-Range','update','UserProfileResource','destroy','end','stack','name','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','model','map','intersection','query','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','Pause','keys','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','ChatWebsiteId','Disposition','findOne','nolimit','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','sitepic','file','filename','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','agentAvatar','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','setUA','headers','user-agent','getResult','chat','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','ValidationError','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','CmList','List','CmContact','Contacts','ChatApplication','Applications','applications','list','priority','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','referer','browser','format','version','unknown','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose','push','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','notify','offline','describe','send','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','files','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','MailAccountId','subjectOffline','toPairsIn','mapValues','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','remove','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','../../config/license/util','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','color','labelText','textColor','textButtonColor','hideWhenOffline','IntervalId','addApplications','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4de3,0x11f));var _0x34de=function(_0x2c4ed1,_0x241e33){_0x2c4ed1=_0x2c4ed1-0x0;var _0x27480e=_0x4de3[_0x2c4ed1];return _0x27480e;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x34de('0x0'));var util=require(_0x34de('0x1'));var path=require(_0x34de('0x2'));var ejs=require(_0x34de('0x3'));var fs=require('fs');var fs_extra=require(_0x34de('0x4'));var _=require(_0x34de('0x5'));var querystring=require(_0x34de('0x6'));var Redis=require(_0x34de('0x7'));var qs=require(_0x34de('0x8'));var logger=require(_0x34de('0x9'))(_0x34de('0xa'));var config=require(_0x34de('0xb'));var db=require(_0x34de('0xc'))['db'];config[_0x34de('0xd')]=_[_0x34de('0xe')](config['redis'],{'host':_0x34de('0xf'),'port':0x18eb});var socket=require(_0x34de('0x10'))(new Redis(config[_0x34de('0xd')]));require(_0x34de('0x11'))[_0x34de('0x12')](socket);var htmlToText=require(_0x34de('0x13'));var jayson=require(_0x34de('0x14'));var client=jayson[_0x34de('0x15')][_0x34de('0x16')]({'port':0x232c});var client9002=jayson[_0x34de('0x15')][_0x34de('0x16')]({'port':0x232a});var client9003=jayson['client'][_0x34de('0x16')]({'port':0x232b});var client9001=jayson[_0x34de('0x15')][_0x34de('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x3c5a73,_0xabbf9,_0x42b049,_0x1f59bc){return new BPromise(function(_0x5ed0db,_0x5d259f){var _0x3e6786=_0x1f59bc||client;return _0x3e6786['request'](_0x3c5a73,_0x42b049)[_0x34de('0x17')](function(_0x25664a){logger[_0x34de('0x18')](_0x34de('0x19'),_0xabbf9,_0x34de('0x1a'));logger[_0x34de('0x1b')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xabbf9,_0x34de('0x1a'),JSON[_0x34de('0x1c')](_0x25664a));if(_0x25664a[_0x34de('0x1d')]){if(_0x25664a[_0x34de('0x1d')][_0x34de('0x1e')]===0x1f4){logger[_0x34de('0x1d')](_0x34de('0x19'),_0xabbf9,_0x25664a[_0x34de('0x1d')][_0x34de('0x1f')]);return _0x5d259f(_0x25664a[_0x34de('0x1d')]['message']);}logger[_0x34de('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0xabbf9,_0x25664a[_0x34de('0x1d')][_0x34de('0x1f')]);return _0x5ed0db(_0x25664a[_0x34de('0x1d')][_0x34de('0x1f')]);}else{logger[_0x34de('0x18')](_0x34de('0x19'),_0xabbf9,_0x34de('0x1a'));_0x5ed0db(_0x25664a[_0x34de('0x20')][_0x34de('0x1f')]);}})['catch'](function(_0x2b51e7){logger[_0x34de('0x1d')](_0x34de('0x19'),_0xabbf9,_0x2b51e7);_0x5d259f(_0x2b51e7);});});}function respondWithStatusCode(_0x33f80a,_0xa778eb){_0xa778eb=_0xa778eb||0xcc;return function(_0x1137c5){if(_0x1137c5){return _0x33f80a[_0x34de('0x21')](_0xa778eb);}return _0x33f80a['status'](_0xa778eb)['end']();};}function respondWithResult(_0x54017d,_0x59b449){_0x59b449=_0x59b449||0xc8;return function(_0x460d78){if(_0x460d78){return _0x54017d[_0x34de('0x22')](_0x59b449)[_0x34de('0x23')](_0x460d78);}};}function respondWithFilteredResult(_0x3493cf,_0xe6e089){return function(_0x2d8298){if(_0x2d8298){var _0x57b8ed=typeof _0xe6e089[_0x34de('0x24')]===_0x34de('0x25')&&typeof _0xe6e089['limit']===_0x34de('0x25');var _0x2aad57=_0x2d8298[_0x34de('0x26')];var _0x2b7708=_0x57b8ed?0x0:_0xe6e089['offset'];var _0x171477=_0x57b8ed?_0x2d8298['count']:_0xe6e089[_0x34de('0x24')]+_0xe6e089['limit'];var _0x10bdeb;if(_0x171477>=_0x2aad57){_0x171477=_0x2aad57;_0x10bdeb=0xc8;}else{_0x10bdeb=0xce;}_0x3493cf[_0x34de('0x22')](_0x10bdeb);return _0x3493cf[_0x34de('0x27')](_0x34de('0x28'),_0x2b7708+'-'+_0x171477+'/'+_0x2aad57)[_0x34de('0x23')](_0x2d8298);}return null;};}function saveUpdates(_0x43700a){return function(_0x4a67f1){if(_0x4a67f1){return _0x4a67f1[_0x34de('0x29')](_0x43700a)['then'](function(_0x10fdcc){return _0x10fdcc;});}return null;};}function removeEntity(_0x2e2a07){return function(_0x245c24){if(_0x245c24){return _0x245c24['destroy']()[_0x34de('0x17')](function(){var _0x34f8ba=_0x245c24['get']({'plain':!![]});var _0x26246e='ChatWebsites';return db[_0x34de('0x2a')][_0x34de('0x2b')]({'where':{'type':_0x26246e,'resourceId':_0x34f8ba['id']}})[_0x34de('0x17')](function(){return _0x245c24;});})['then'](function(){_0x2e2a07[_0x34de('0x22')](0xcc)[_0x34de('0x2c')]();});}};}function handleEntityNotFound(_0xffb59){return function(_0x46fe28){if(!_0x46fe28){_0xffb59['sendStatus'](0x194);}return _0x46fe28;};}function handleError(_0x1beb0e,_0x390e1d){_0x390e1d=_0x390e1d||0x1f4;return function(_0x46e8ff){logger[_0x34de('0x1d')](_0x46e8ff[_0x34de('0x2d')]);if(_0x46e8ff[_0x34de('0x2e')]){delete _0x46e8ff['name'];}_0x1beb0e[_0x34de('0x22')](_0x390e1d)['send'](_0x46e8ff);};}exports['index']=function(_0x1ad85f,_0x101eb8){var _0x58c249={'include':[{'model':db['Pause'],'as':_0x34de('0x2f')}]},_0x26ef15={},_0x165340={'count':0x0,'rows':[]};var _0x7622cc=_['map'](db[_0x34de('0x30')][_0x34de('0x31')],function(_0x583eb3){return{'name':_0x583eb3[_0x34de('0x32')],'type':_0x583eb3[_0x34de('0x33')]['key']};});_0x26ef15[_0x34de('0x34')]=_[_0x34de('0x35')](_0x7622cc,_0x34de('0x2e'));_0x26ef15['query']=_['keys'](_0x1ad85f['query']);_0x26ef15['filters']=_[_0x34de('0x36')](_0x26ef15[_0x34de('0x34')],_0x26ef15[_0x34de('0x37')]);_0x58c249[_0x34de('0x38')]=_[_0x34de('0x36')](_0x26ef15[_0x34de('0x34')],qs[_0x34de('0x39')](_0x1ad85f[_0x34de('0x37')][_0x34de('0x39')]));_0x58c249[_0x34de('0x38')]=_0x58c249['attributes'][_0x34de('0x3a')]?_0x58c249[_0x34de('0x38')]:_0x26ef15[_0x34de('0x34')];if(!_0x1ad85f[_0x34de('0x37')][_0x34de('0x3b')]('nolimit')){_0x58c249['limit']=qs[_0x34de('0x3c')](_0x1ad85f[_0x34de('0x37')]['limit']);_0x58c249[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x1ad85f['query'][_0x34de('0x24')]);}_0x58c249['order']=qs[_0x34de('0x3d')](_0x1ad85f[_0x34de('0x37')][_0x34de('0x3d')]);_0x58c249[_0x34de('0x3e')]=qs['filters'](_[_0x34de('0x3f')](_0x1ad85f[_0x34de('0x37')],_0x26ef15[_0x34de('0x40')]),_0x7622cc);if(_0x1ad85f[_0x34de('0x37')][_0x34de('0x41')]){_0x58c249[_0x34de('0x3e')]=_[_0x34de('0x42')](_0x58c249['where'],{'$or':_[_0x34de('0x35')](_0x7622cc,function(_0x47ca69){if(_0x47ca69['type']!==_0x34de('0x43')){var _0x3edf89={};_0x3edf89[_0x47ca69[_0x34de('0x2e')]]={'$like':'%'+_0x1ad85f[_0x34de('0x37')][_0x34de('0x41')]+'%'};return _0x3edf89;}})});}_0x58c249=_[_0x34de('0x42')]({},_0x58c249,_0x1ad85f['options']);var _0x193c83={'where':_0x58c249['where']};return db[_0x34de('0x30')]['count'](_0x193c83)[_0x34de('0x17')](function(_0xf75355){_0x165340[_0x34de('0x26')]=_0xf75355;if(_0x1ad85f['query'][_0x34de('0x44')]){_0x58c249[_0x34de('0x45')]=[{'all':!![]}];}return db[_0x34de('0x30')][_0x34de('0x46')](_0x58c249);})['then'](function(_0x1a1542){_0x165340['rows']=_0x1a1542;return _0x165340;})['then'](respondWithFilteredResult(_0x101eb8,_0x58c249))[_0x34de('0x47')](handleError(_0x101eb8,null));};exports[_0x34de('0x48')]=function(_0x222d74,_0x4301cb){var _0x4168f1={'raw':![],'where':{'id':_0x222d74[_0x34de('0x49')]['id']},'include':[{'model':db[_0x34de('0x4a')],'as':_0x34de('0x2f')}]},_0x50f2d={};_0x50f2d['model']=_[_0x34de('0x4b')](db[_0x34de('0x30')][_0x34de('0x31')]);_0x50f2d[_0x34de('0x37')]=_[_0x34de('0x4b')](_0x222d74['query']);_0x50f2d[_0x34de('0x40')]=_[_0x34de('0x36')](_0x50f2d[_0x34de('0x34')],_0x50f2d[_0x34de('0x37')]);_0x4168f1[_0x34de('0x38')]=_[_0x34de('0x36')](_0x50f2d[_0x34de('0x34')],qs[_0x34de('0x39')](_0x222d74[_0x34de('0x37')][_0x34de('0x39')]));_0x4168f1[_0x34de('0x38')]=_0x4168f1[_0x34de('0x38')]['length']?_0x4168f1[_0x34de('0x38')]:_0x50f2d[_0x34de('0x34')];if(_0x222d74['query'][_0x34de('0x44')]){_0x4168f1[_0x34de('0x45')]=[{'all':!![]}];}_0x4168f1=_[_0x34de('0x42')]({},_0x4168f1,_0x222d74[_0x34de('0x4c')]);return db[_0x34de('0x30')]['find'](_0x4168f1)[_0x34de('0x17')](handleEntityNotFound(_0x4301cb,null))[_0x34de('0x17')](respondWithResult(_0x4301cb,null))[_0x34de('0x47')](handleError(_0x4301cb,null));};exports[_0x34de('0x4d')]=function(_0xcdd424,_0x5df8b0){return db[_0x34de('0x30')][_0x34de('0x4d')](_0xcdd424[_0x34de('0x4e')],{})['then'](function(_0x528b1a){var _0x1df636=_0xcdd424['user'][_0x34de('0x4f')]({'plain':!![]});if(!_0x1df636)throw new Error(_0x34de('0x50'));if(_0x1df636[_0x34de('0x51')]===_0x34de('0x52')){var _0x299323=_0x528b1a[_0x34de('0x4f')]({'plain':!![]});var _0x12c0fa='ChatWebsites';return db[_0x34de('0x53')][_0x34de('0x54')]({'where':{'name':_0x12c0fa,'userProfileId':_0x1df636[_0x34de('0x55')]},'raw':!![]})[_0x34de('0x17')](function(_0x2ad3fc){if(_0x2ad3fc&&_0x2ad3fc[_0x34de('0x56')]===0x0){return db[_0x34de('0x2a')]['create']({'name':_0x299323[_0x34de('0x2e')],'resourceId':_0x299323['id'],'type':_0x2ad3fc[_0x34de('0x2e')],'sectionId':_0x2ad3fc['id']},{})[_0x34de('0x17')](function(){return _0x528b1a;});}else{return _0x528b1a;}})[_0x34de('0x47')](function(_0x1e30a4){logger[_0x34de('0x1d')](_0x34de('0x57'),_0x1e30a4);throw _0x1e30a4;});}return _0x528b1a;})[_0x34de('0x17')](respondWithResult(_0x5df8b0,0xc9))[_0x34de('0x47')](handleError(_0x5df8b0,null));};exports[_0x34de('0x29')]=function(_0x349e10,_0xb50c16){if(_0x349e10[_0x34de('0x4e')]['id']){delete _0x349e10['body']['id'];}return db[_0x34de('0x30')][_0x34de('0x54')]({'where':{'id':_0x349e10['params']['id']},'include':[{'model':db[_0x34de('0x4a')],'as':'mandatoryDispositionPause'}]})[_0x34de('0x17')](handleEntityNotFound(_0xb50c16,null))['then'](saveUpdates(_0x349e10['body'],null))['then'](respondWithResult(_0xb50c16,null))[_0x34de('0x47')](handleError(_0xb50c16,null));};exports['destroy']=function(_0x8f1d03,_0x496bb7){return db[_0x34de('0x30')][_0x34de('0x54')]({'where':{'id':_0x8f1d03[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x496bb7,null))['then'](removeEntity(_0x496bb7,null))[_0x34de('0x47')](handleError(_0x496bb7,null));};exports['describe']=function(_0x5378f5,_0x2e230f){return db[_0x34de('0x30')]['describe']()[_0x34de('0x17')](respondWithResult(_0x2e230f,null))[_0x34de('0x47')](handleError(_0x2e230f,null));};exports[_0x34de('0x58')]=function(_0x2052b4,_0x5b0be6){if(_0x2052b4['body']['id']){delete _0x2052b4[_0x34de('0x4e')]['id'];}return db[_0x34de('0x30')][_0x34de('0x54')]({'where':{'id':_0x2052b4[_0x34de('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b0be6,null))[_0x34de('0x17')](function(_0x248676){if(_0x248676){_0x2052b4[_0x34de('0x4e')][_0x34de('0x59')]=_0x248676['id'];return db[_0x34de('0x5a')][_0x34de('0x4d')](_0x2052b4['body']);}})['then'](respondWithResult(_0x5b0be6,null))[_0x34de('0x47')](handleError(_0x5b0be6,null));};exports['getDispositions']=function(_0x5657c1,_0xa1b3b6){var _0x502053={'raw':![],'where':{}};var _0x2b48bf={};var _0x842bc1={'count':0x0,'rows':[]};return db[_0x34de('0x30')][_0x34de('0x5b')]({'where':{'id':_0x5657c1[_0x34de('0x49')]['id']}})['then'](handleEntityNotFound(_0xa1b3b6,null))[_0x34de('0x17')](function(_0x877d11){if(_0x877d11){_0x2b48bf['model']=_['keys'](db[_0x34de('0x5a')][_0x34de('0x31')]);_0x2b48bf[_0x34de('0x37')]=_['keys'](_0x5657c1[_0x34de('0x37')]);_0x2b48bf['filters']=_['intersection'](_0x2b48bf[_0x34de('0x34')],_0x2b48bf[_0x34de('0x37')]);_0x502053[_0x34de('0x38')]=_[_0x34de('0x36')](_0x2b48bf[_0x34de('0x34')],qs[_0x34de('0x39')](_0x5657c1[_0x34de('0x37')]['fields']));_0x502053[_0x34de('0x38')]=_0x502053[_0x34de('0x38')][_0x34de('0x3a')]?_0x502053[_0x34de('0x38')]:_0x2b48bf[_0x34de('0x34')];if(!_0x5657c1[_0x34de('0x37')]['hasOwnProperty'](_0x34de('0x5c'))){_0x502053[_0x34de('0x3c')]=qs[_0x34de('0x3c')](_0x5657c1[_0x34de('0x37')][_0x34de('0x3c')]);_0x502053['offset']=qs[_0x34de('0x24')](_0x5657c1['query']['offset']);}_0x502053['order']=qs[_0x34de('0x3d')](_0x5657c1[_0x34de('0x37')]['sort']);_0x502053[_0x34de('0x3e')]=qs['filters'](_[_0x34de('0x3f')](_0x5657c1['query'],_0x2b48bf['filters']));_0x502053[_0x34de('0x3e')][_0x34de('0x59')]=_0x877d11['id'];if(_0x5657c1[_0x34de('0x37')][_0x34de('0x41')]){_0x502053[_0x34de('0x3e')]=_[_0x34de('0x42')](_0x502053[_0x34de('0x3e')],{'$or':_[_0x34de('0x35')](_0x502053[_0x34de('0x38')],function(_0x1960c1){var _0x1b8dae={};_0x1b8dae[_0x1960c1]={'$like':'%'+_0x5657c1[_0x34de('0x37')][_0x34de('0x41')]+'%'};return _0x1b8dae;})});}_0x502053=_[_0x34de('0x42')]({},_0x502053,_0x5657c1[_0x34de('0x4c')]);return db[_0x34de('0x5a')][_0x34de('0x26')]({'where':_0x502053[_0x34de('0x3e')]})[_0x34de('0x17')](function(_0x37aae4){_0x842bc1[_0x34de('0x26')]=_0x37aae4;if(_0x5657c1[_0x34de('0x37')][_0x34de('0x44')]){_0x502053[_0x34de('0x45')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x502053);})[_0x34de('0x17')](function(_0x42f19d){_0x842bc1[_0x34de('0x5d')]=_0x42f19d;return _0x842bc1;});}})[_0x34de('0x17')](respondWithFilteredResult(_0xa1b3b6,_0x502053))[_0x34de('0x47')](handleError(_0xa1b3b6,null));};exports[_0x34de('0x5e')]=function(_0x368c43,_0x3f3498){return db[_0x34de('0x30')]['find']({'where':{'id':_0x368c43[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x3f3498,null))[_0x34de('0x17')](function(_0x2824af){if(_0x2824af){return _0x2824af[_0x34de('0x5e')](_0x368c43[_0x34de('0x37')][_0x34de('0x5f')]);}})[_0x34de('0x17')](respondWithStatusCode(_0x3f3498,null))['catch'](handleError(_0x3f3498,null));};exports[_0x34de('0x60')]=function(_0x28ae6c,_0x19a9bc){if(_0x28ae6c[_0x34de('0x4e')]['id']){delete _0x28ae6c['body']['id'];}return db[_0x34de('0x30')][_0x34de('0x54')]({'where':{'id':_0x28ae6c[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x19a9bc,null))[_0x34de('0x17')](function(_0x3c4d09){if(_0x3c4d09){_0x28ae6c['body'][_0x34de('0x59')]=_0x3c4d09['id'];return db[_0x34de('0x61')][_0x34de('0x4d')](_0x28ae6c[_0x34de('0x4e')]);}})[_0x34de('0x17')](respondWithResult(_0x19a9bc,null))[_0x34de('0x47')](handleError(_0x19a9bc,null));};exports[_0x34de('0x62')]=function(_0x1df26a,_0x5766f9){var _0x46d8eb={'raw':![],'where':{}};var _0x4e8b80={};var _0x43a4dd={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x34de('0x5b')]({'where':{'id':_0x1df26a[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x5766f9,null))['then'](function(_0x57e488){if(_0x57e488){_0x4e8b80['model']=_['keys'](db[_0x34de('0x61')][_0x34de('0x31')]);_0x4e8b80[_0x34de('0x37')]=_[_0x34de('0x4b')](_0x1df26a[_0x34de('0x37')]);_0x4e8b80[_0x34de('0x40')]=_['intersection'](_0x4e8b80[_0x34de('0x34')],_0x4e8b80['query']);_0x46d8eb['attributes']=_[_0x34de('0x36')](_0x4e8b80[_0x34de('0x34')],qs[_0x34de('0x39')](_0x1df26a[_0x34de('0x37')][_0x34de('0x39')]));_0x46d8eb[_0x34de('0x38')]=_0x46d8eb[_0x34de('0x38')][_0x34de('0x3a')]?_0x46d8eb[_0x34de('0x38')]:_0x4e8b80[_0x34de('0x34')];if(!_0x1df26a[_0x34de('0x37')]['hasOwnProperty']('nolimit')){_0x46d8eb[_0x34de('0x3c')]=qs['limit'](_0x1df26a[_0x34de('0x37')][_0x34de('0x3c')]);_0x46d8eb[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x1df26a[_0x34de('0x37')][_0x34de('0x24')]);}_0x46d8eb[_0x34de('0x63')]=qs['sort'](_0x1df26a[_0x34de('0x37')][_0x34de('0x3d')]);_0x46d8eb[_0x34de('0x3e')]=qs[_0x34de('0x40')](_[_0x34de('0x3f')](_0x1df26a[_0x34de('0x37')],_0x4e8b80['filters']));_0x46d8eb[_0x34de('0x3e')]['ChatWebsiteId']=_0x57e488['id'];if(_0x1df26a[_0x34de('0x37')][_0x34de('0x41')]){_0x46d8eb[_0x34de('0x3e')]=_[_0x34de('0x42')](_0x46d8eb[_0x34de('0x3e')],{'$or':_[_0x34de('0x35')](_0x46d8eb[_0x34de('0x38')],function(_0x8b6435){var _0x95d1cd={};_0x95d1cd[_0x8b6435]={'$like':'%'+_0x1df26a['query']['filter']+'%'};return _0x95d1cd;})});}_0x46d8eb=_[_0x34de('0x42')]({},_0x46d8eb,_0x1df26a[_0x34de('0x4c')]);return db['CannedAnswer']['count']({'where':_0x46d8eb[_0x34de('0x3e')]})[_0x34de('0x17')](function(_0x1cc4a5){_0x43a4dd[_0x34de('0x26')]=_0x1cc4a5;if(_0x1df26a[_0x34de('0x37')][_0x34de('0x44')]){_0x46d8eb['include']=[{'all':!![]}];}return db[_0x34de('0x61')][_0x34de('0x46')](_0x46d8eb);})[_0x34de('0x17')](function(_0x256e2a){_0x43a4dd[_0x34de('0x5d')]=_0x256e2a;return _0x43a4dd;});}})[_0x34de('0x17')](respondWithFilteredResult(_0x5766f9,_0x46d8eb))[_0x34de('0x47')](handleError(_0x5766f9,null));};exports[_0x34de('0x64')]=function(_0x5cce3f,_0x28e2e4){return db[_0x34de('0x30')][_0x34de('0x54')]({'where':{'id':_0x5cce3f[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x28e2e4,null))[_0x34de('0x17')](function(_0x4b8c0c){if(_0x4b8c0c){return _0x4b8c0c[_0x34de('0x64')](_0x5cce3f[_0x34de('0x37')][_0x34de('0x5f')]);}})[_0x34de('0x17')](respondWithStatusCode(_0x28e2e4,null))[_0x34de('0x47')](handleError(_0x28e2e4,null));};exports['addLogo']=function(_0x573520,_0x16f67d){_0x573520[_0x34de('0x4e')][_0x34de('0x65')]=_0x573520[_0x34de('0x66')][_0x34de('0x67')];return db[_0x34de('0x30')][_0x34de('0x54')]({'where':{'id':_0x573520[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x16f67d,null))[_0x34de('0x17')](saveUpdates(_0x573520[_0x34de('0x4e')],null))[_0x34de('0x17')](respondWithResult(_0x16f67d,null))[_0x34de('0x47')](handleError(_0x16f67d,null));};exports['addAvatar']=function(_0x5062a7,_0x2c0201){_0x5062a7['body']['agentAvatar']=_0x5062a7[_0x34de('0x66')][_0x34de('0x67')];return db['ChatWebsite']['find']({'where':{'id':_0x5062a7['params']['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x2c0201,null))['then'](saveUpdates(_0x5062a7[_0x34de('0x4e')],null))[_0x34de('0x17')](respondWithResult(_0x2c0201,null))[_0x34de('0x47')](handleError(_0x2c0201,null));};exports['addCustomerAvatar']=function(_0x44fd2c,_0x8c7e99){_0x44fd2c[_0x34de('0x4e')]['customerAvatar']=_0x44fd2c['file'][_0x34de('0x67')];return db['ChatWebsite'][_0x34de('0x54')]({'where':{'id':_0x44fd2c[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x8c7e99,null))[_0x34de('0x17')](saveUpdates(_0x44fd2c[_0x34de('0x4e')],null))['then'](respondWithResult(_0x8c7e99,null))[_0x34de('0x47')](handleError(_0x8c7e99,null));};exports[_0x34de('0x68')]=function(_0x587660,_0x1bd2c0){_0x587660[_0x34de('0x4e')][_0x34de('0x69')]=_0x587660[_0x34de('0x66')]['filename'];return db['ChatWebsite'][_0x34de('0x54')]({'where':{'id':_0x587660[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x1bd2c0,null))[_0x34de('0x17')](saveUpdates(_0x587660[_0x34de('0x4e')],null))[_0x34de('0x17')](respondWithResult(_0x1bd2c0,null))[_0x34de('0x47')](handleError(_0x1bd2c0,null));};exports['getLogo']=function(_0x18dae5,_0x4744eb){var _0x5128d0=path[_0x34de('0x6a')](config[_0x34de('0x6b')],_0x34de('0x6c'));var _0x2ee231={'where':{'id':_0x18dae5[_0x34de('0x49')]['id']},'attributes':['id',_0x34de('0x65')],'raw':!![]};var _0x1a948f=![];return require('../../config/license/util')[_0x34de('0x6d')]()[_0x34de('0x17')](function(_0xa06933){if(_0xa06933){_0x1a948f=_0xa06933[_0x34de('0x6e')];}})[_0x34de('0x17')](function(){return db[_0x34de('0x30')][_0x34de('0x54')](_0x2ee231);})[_0x34de('0x17')](handleEntityNotFound(_0x4744eb,null))[_0x34de('0x17')](function(_0x2f3c11){if(_0x2f3c11){if(!_[_0x34de('0x6f')](_0x2f3c11[_0x34de('0x65')])){if(fs[_0x34de('0x70')](path[_0x34de('0x6a')](config['root'],'server/files/images/logos/',_0x2f3c11[_0x34de('0x65')]))&&_0x1a948f){_0x5128d0=path[_0x34de('0x6a')](config[_0x34de('0x6b')],_0x34de('0x71'),_0x2f3c11[_0x34de('0x65')]);}}return _0x4744eb[_0x34de('0x72')](_0x5128d0);}})[_0x34de('0x47')](handleError(_0x4744eb,null));};exports[_0x34de('0x73')]=function(_0x33ac7f,_0x15b107){var _0x2dda03=path[_0x34de('0x6a')](config[_0x34de('0x6b')],'server/files/images/avatars/default_avatar.png');var _0x1603f8={'where':{'id':_0x33ac7f['params']['id']},'attributes':['id',_0x34de('0x74')],'raw':!![]};return db[_0x34de('0x30')][_0x34de('0x54')](_0x1603f8)[_0x34de('0x17')](handleEntityNotFound(_0x15b107,null))[_0x34de('0x17')](function(_0x22adab){if(_0x22adab){if(!_[_0x34de('0x6f')](_0x22adab[_0x34de('0x74')])){if(fs[_0x34de('0x70')](path[_0x34de('0x6a')](config[_0x34de('0x6b')],_0x34de('0x75'),_0x22adab[_0x34de('0x74')]))){_0x2dda03=path[_0x34de('0x6a')](config[_0x34de('0x6b')],_0x34de('0x75'),_0x22adab[_0x34de('0x74')]);}}return _0x15b107[_0x34de('0x72')](_0x2dda03);}})['catch'](handleError(_0x15b107,null));};exports[_0x34de('0x76')]=function(_0x35aba9,_0x5b8be8){var _0x2f0e83=path[_0x34de('0x6a')](config[_0x34de('0x6b')],_0x34de('0x77'));var _0x27b452={'where':{'id':_0x35aba9[_0x34de('0x49')]['id']},'attributes':['id',_0x34de('0x78'),_0x34de('0x79')],'raw':!![]};return db[_0x34de('0x30')][_0x34de('0x54')](_0x27b452)['then'](handleEntityNotFound(_0x5b8be8,null))[_0x34de('0x17')](function(_0x2006ab){if(_0x2006ab){if(!_[_0x34de('0x6f')](_0x2006ab[_0x34de('0x78')])){if(fs['existsSync'](path[_0x34de('0x6a')](config[_0x34de('0x6b')],_0x34de('0x75'),_0x2006ab['customerAvatar']))&&_0x2006ab[_0x34de('0x79')]){_0x2f0e83=path['join'](config[_0x34de('0x6b')],_0x34de('0x75'),_0x2006ab[_0x34de('0x78')]);}}return _0x5b8be8['download'](_0x2f0e83);}})[_0x34de('0x47')](handleError(_0x5b8be8,null));};exports[_0x34de('0x7a')]=function(_0x2797ae,_0x452d36){var _0x21a98d=path[_0x34de('0x6a')](config[_0x34de('0x6b')],_0x34de('0x7b'));var _0x3f18f3={'where':{'id':_0x2797ae[_0x34de('0x49')]['id']},'attributes':['id',_0x34de('0x69')],'raw':!![]};return db[_0x34de('0x30')][_0x34de('0x54')](_0x3f18f3)[_0x34de('0x17')](handleEntityNotFound(_0x452d36,null))[_0x34de('0x17')](function(_0x54491b){if(_0x54491b){if(!_[_0x34de('0x6f')](_0x54491b[_0x34de('0x69')])){if(fs['existsSync'](path['join'](config[_0x34de('0x6b')],_0x34de('0x75'),_0x54491b[_0x34de('0x69')]))){_0x21a98d=path[_0x34de('0x6a')](config[_0x34de('0x6b')],_0x34de('0x75'),_0x54491b[_0x34de('0x69')]);}}return _0x452d36[_0x34de('0x72')](_0x21a98d);}})[_0x34de('0x47')](handleError(_0x452d36,null));};exports['notify']=function(_0x2e7dcc,_0x24e8ce){var _0x5260c6=require(_0x34de('0x7c'));var _0x4f5f0d=new _0x5260c6();var _0x376c55=_0x4f5f0d[_0x34de('0x7d')](_0x2e7dcc[_0x34de('0x7e')][_0x34de('0x7f')])[_0x34de('0x80')]();var _0x5d985b={'body':_0x2e7dcc['body'],'channel':_0x34de('0x81')};var _0x446745=[];var _0x5f1305=[];var _0x57edbf={};var _0x468387=![];return db['CmContact']['describe']()[_0x34de('0x17')](function(_0x4e7ba5){if(!_0x4e7ba5){throw new db['Sequelize']['ValidationError'](_0x34de('0x82'));}_0x446745=_[_0x34de('0x83')](_[_0x34de('0x4b')](_0x4e7ba5),[_0x34de('0x84'),_0x34de('0x85')]);_0x5f1305=_['difference'](_[_0x34de('0x4b')](_0x4e7ba5),[_0x34de('0x84'),_0x34de('0x85'),_0x34de('0x86'),_0x34de('0x87')]);if(_0x2e7dcc[_0x34de('0x4e')]['id']){delete _0x2e7dcc[_0x34de('0x4e')]['id'];}if(_[_0x34de('0x6f')](_0x2e7dcc[_0x34de('0x4e')][_0x34de('0x88')])){throw new db[(_0x34de('0x89'))][(_0x34de('0x8a'))](_0x34de('0x8b'));}if(_[_0x34de('0x6f')](_0x2e7dcc[_0x34de('0x4e')]['body'])||_0x2e7dcc[_0x34de('0x4e')][_0x34de('0x4e')]===''){throw new db[(_0x34de('0x89'))][(_0x34de('0x8a'))](_0x34de('0x8c'));}if(_[_0x34de('0x6f')](_0x2e7dcc['body'][_0x34de('0x8d')])){throw new db['Sequelize'][(_0x34de('0x8a'))](_0x34de('0x8e')+_0x5f1305);}if(!_['includes'](_0x5f1305,_0x2e7dcc[_0x34de('0x4e')][_0x34de('0x8d')])){throw new db[(_0x34de('0x89'))][(_0x34de('0x8a'))](_0x34de('0x8f')+_0x5f1305);}_0x57edbf[_0x2e7dcc[_0x34de('0x4e')][_0x34de('0x8d')]]=_0x2e7dcc[_0x34de('0x4e')][_0x34de('0x88')];})[_0x34de('0x17')](function(){return db[_0x34de('0x30')]['find']({'where':{'id':_0x2e7dcc[_0x34de('0x49')]['id']},'include':[{'model':db[_0x34de('0x90')],'as':_0x34de('0x91'),'include':[{'model':db[_0x34de('0x92')],'as':_0x34de('0x93'),'where':_0x57edbf,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x34de('0x94')],'as':_0x34de('0x95')}]});})['then'](handleEntityNotFound(_0x24e8ce,null))[_0x34de('0x17')](function(_0x5885d7){if(_0x5885d7&&_0x5885d7[_0x34de('0x91')]){_0x5d985b['account']=_0x5885d7;_0x5d985b[_0x34de('0x96')]=_0x5885d7['Applications'];_0x5d985b[_0x34de('0x97')]=_0x5885d7[_0x34de('0x91')];_0x5d985b['applications']=_['orderBy'](_0x5d985b[_0x34de('0x96')],[_0x34de('0x98')],['asc']);if(_0x5d985b[_0x34de('0x99')][_0x34de('0x95')]){delete _0x5d985b[_0x34de('0x99')][_0x34de('0x95')];}if(_0x5d985b[_0x34de('0x99')][_0x34de('0x91')]&&_0x5d985b[_0x34de('0x99')][_0x34de('0x91')]['Contacts'][_0x34de('0x3a')]){return _0x5d985b['account'][_0x34de('0x91')][_0x34de('0x93')][0x0];}var _0x58c414=_[_0x34de('0xe')](_0x2e7dcc[_0x34de('0x4e')],{'firstName':_0x2e7dcc[_0x34de('0x4e')]['from'],'ListId':_0x5885d7['ListId']});_0x58c414[_0x2e7dcc[_0x34de('0x4e')][_0x34de('0x8d')]]=_0x2e7dcc[_0x34de('0x4e')][_0x34de('0x88')];return db['CmContact'][_0x34de('0x4d')](_0x58c414,{'fields':_0x446745,'raw':!![]});}})[_0x34de('0x17')](handleEntityNotFound(_0x24e8ce,null))['then'](function(_0x4910c6){_0x5d985b[_0x34de('0x9a')]=_0x4910c6;var _0x33b26a=_0x2e7dcc[_0x34de('0x4e')][_0x34de('0x9b')];if(_0x2e7dcc[_0x34de('0x7e')]['cf-connecting-ip']){_0x33b26a=_0x2e7dcc[_0x34de('0x7e')][_0x34de('0x9c')];}else if(_0x2e7dcc[_0x34de('0x7e')][_0x34de('0x9d')]){_0x33b26a=_[_0x34de('0x9e')](_0x2e7dcc[_0x34de('0x7e')][_0x34de('0x9d')][_0x34de('0x9f')](','));}if(_0x4910c6){var _0x1f4e81={'ContactId':_0x4910c6['id'],'ChatWebsiteId':_0x2e7dcc['params']['id'],'from':(_0x4910c6['firstName']||'')+'\x20'+(_0x4910c6['lastName']||''),'customerIp':_0x33b26a,'customerPort':_0x2e7dcc[_0x34de('0x7e')][_0x34de('0xa0')]?_0x2e7dcc[_0x34de('0x7e')][_0x34de('0xa0')]:null,'referer':_0x2e7dcc[_0x34de('0x4e')][_0x34de('0xa1')],'browserName':_0x376c55[_0x34de('0xa2')][_0x34de('0x2e')]&&_0x376c55[_0x34de('0xa2')]['version']?util[_0x34de('0xa3')]('%s\x20%s',_0x376c55['browser'][_0x34de('0x2e')],_0x376c55[_0x34de('0xa2')][_0x34de('0xa4')]):_0x34de('0xa5'),'browserVersion':_0x376c55['browser'][_0x34de('0xa4')]||_0x34de('0xa5'),'osName':util['format'](_0x34de('0xa6'),_0x376c55['os'][_0x34de('0x2e')],_0x376c55['os'][_0x34de('0xa4')]),'osVersion':_0x376c55['os'][_0x34de('0xa4')],'deviceModel':_0x376c55[_0x34de('0xa7')][_0x34de('0x34')]&&_0x376c55[_0x34de('0xa7')][_0x34de('0xa8')]?util[_0x34de('0xa3')]('%s\x20%s\x20%s',_0x376c55[_0x34de('0xa7')][_0x34de('0x34')],_0x376c55[_0x34de('0xa7')][_0x34de('0xa8')],_0x376c55[_0x34de('0xa7')]['type']):null,'deviceVendor':_0x376c55[_0x34de('0xa7')]['vendor'],'deviceType':_0x376c55['device'][_0x34de('0x33')],'formData':JSON[_0x34de('0x1c')](_0x2e7dcc['body'])};var _0x4d98ed={'ChatWebsiteId':_0x2e7dcc[_0x34de('0x49')]['id'],'closed':![]};if(_0x2e7dcc['body']['threadId']){_0x4d98ed[_0x34de('0xa9')]=_0x2e7dcc[_0x34de('0x4e')][_0x34de('0xa9')];return db[_0x34de('0xaa')][_0x34de('0x54')]({'where':_0x4d98ed})['then'](function(_0x4d288b){if(_0x4d288b){return[_0x4d288b,![]];}_0x1f4e81[_0x34de('0xa9')]=_0x2e7dcc[_0x34de('0x4e')][_0x34de('0xa9')];_0x1f4e81[_0x34de('0xab')]=_0x2e7dcc[_0x34de('0x4e')][_0x34de('0xab')];return db['ChatInteraction'][_0x34de('0x4d')](_0x1f4e81)['then'](function(_0x29f589){return[_0x29f589,!![]];});});}_0x4d98ed[_0x34de('0xac')]=_0x4910c6['id'];if(_0x2e7dcc['body'][_0x34de('0xad')]&&_0x2e7dcc['body']['interaction']['id']){_0x4d98ed['id']=_0x2e7dcc[_0x34de('0x4e')][_0x34de('0xad')]['id'];return db[_0x34de('0xaa')][_0x34de('0x54')]({'where':_0x4d98ed})['then'](function(_0x444076){if(_0x444076){return[_0x444076,![]];}return db[_0x34de('0xaa')][_0x34de('0x4d')](_0x1f4e81)[_0x34de('0x17')](function(_0x332531){return[_0x332531,!![]];});});}return db['ChatInteraction'][_0x34de('0x4d')](_0x1f4e81)[_0x34de('0x17')](function(_0x16d573){return[_0x16d573,!![]];});}})[_0x34de('0xae')](function(_0x3767ae,_0x4e5d4c){if(_0x3767ae){_0x468387=_0x4e5d4c;if(!_0x4e5d4c){var _0x4ea557={'from':(_0x5d985b[_0x34de('0x9a')][_0x34de('0xaf')]||'')+'\x20'+(_0x5d985b['contact']['lastName']||'')};if(_0x2e7dcc[_0x34de('0x4e')][_0x34de('0xa9')]&&_0x2e7dcc['body'][_0x34de('0xb0')]&&_0x2e7dcc[_0x34de('0x4e')][_0x34de('0xa9')]!=_0x2e7dcc['body'][_0x34de('0xb0')]){_0x4ea557[_0x34de('0xa9')]=_0x2e7dcc[_0x34de('0x4e')][_0x34de('0xb0')];}return _0x3767ae['update'](_0x4ea557);}else{return _0x3767ae;}}})[_0x34de('0x17')](function(_0x25b217){_0x5d985b['interaction']=_0x25b217[_0x34de('0x4f')]({'plain':!![]});_0x5d985b[_0x34de('0xad')][_0x34de('0xb1')]=_0x468387;if(_0x5d985b[_0x34de('0xad')][_0x34de('0xb1')]){if(_0x5d985b[_0x34de('0x99')][_0x34de('0xb2')]){_0x5d985b[_0x34de('0x96')][_0x34de('0xb3')]({'id':0x0,'priority':_0x5d985b['applications'][_0x34de('0x3a')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x34de('0xb4')});}}return db['ChatMessage'][_0x34de('0x4d')]({'body':_0x2e7dcc[_0x34de('0x4e')][_0x34de('0x4e')],'ChatWebsiteId':_0x2e7dcc[_0x34de('0x49')]['id'],'ChatInteractionId':_0x25b217['id'],'direction':'in','ContactId':_0x5d985b[_0x34de('0x9a')]['id'],'AttachmentId':_0x2e7dcc[_0x34de('0x4e')][_0x34de('0xb5')]});})['then'](function(_0x147f9f){_0x5d985b[_0x34de('0x1f')]=_0x147f9f;if(_0x5d985b[_0x34de('0xad')][_0x34de('0xb6')]){return db[_0x34de('0xb7')][_0x34de('0x54')]({'attributes':['id','name'],'where':{'id':_0x5d985b['interaction'][_0x34de('0xb6')]}})[_0x34de('0x17')](function(_0x163065){if(_0x163065){_0x5d985b[_0x34de('0x96')][_0x34de('0xb8')]({'id':0x0,'priority':0x0,'app':_0x34de('0xb9'),'appdata':_0x163065['name']+','+(_0x5d985b[_0x34de('0x99')][_0x34de('0xba')]||0xa),'interval':_0x34de('0xb4')});_0x5d985b[_0x34de('0xbb')]=!![];}return respondWithRpcPromise('Start',_0x34de('0xbc'),_0x5d985b);});}return respondWithRpcPromise(_0x34de('0xbd'),_0x34de('0xbc'),_0x5d985b);})['then'](function(_0x52da09){respondWithRpcPromise('EventManager',_0x34de('0xbe'),{'event':_0x34de('0xbf'),'message':_0x52da09},client9002);return _0x52da09;})[_0x34de('0x17')](respondWithResult(_0x24e8ce,null))[_0x34de('0x47')](handleError(_0x24e8ce,null));};exports[_0x34de('0xc0')]=function(_0x5b6f6c,_0x15e637){var _0x2ff3e0,_0x540042,_0x4dcfbe;var _0x5807b5=[];var _0x1ef402={};var _0x1ffb67=_0x5b6f6c['files']||[];var _0x433564=[];var _0x53fd4a;return db[_0x34de('0x92')][_0x34de('0xc1')]()[_0x34de('0x17')](function(_0x3921f9){if(!_0x3921f9){throw new db[(_0x34de('0x89'))][(_0x34de('0x8a'))](_0x34de('0x82'));}_0x5807b5=_[_0x34de('0x83')](_['keys'](_0x3921f9),['createdAt',_0x34de('0x85'),'CompanyId','ListId']);if(_0x5b6f6c[_0x34de('0x4e')]['id']){delete _0x5b6f6c[_0x34de('0x4e')]['id'];}if(_['isNil'](_0x5b6f6c[_0x34de('0x4e')][_0x34de('0x88')])){throw _0x15e637['status'](0x1f4)[_0x34de('0xc2')](new db[(_0x34de('0x89'))][(_0x34de('0x8a'))]('from\x20is\x20mandatory'));}if(_[_0x34de('0x6f')](_0x5b6f6c[_0x34de('0x4e')][_0x34de('0x4e')])||_0x5b6f6c[_0x34de('0x4e')][_0x34de('0x4e')]===''){throw _0x15e637[_0x34de('0x22')](0x1f4)['send'](new db[(_0x34de('0x89'))]['ValidationError'](_0x34de('0x8c')));}if(_[_0x34de('0x6f')](_0x5b6f6c['body'][_0x34de('0xc3')])){throw _0x15e637[_0x34de('0x22')](0x1f4)[_0x34de('0xc2')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5807b5));}if(!_[_0x34de('0xc4')](_0x5807b5,_0x5b6f6c['body'][_0x34de('0xc3')])){throw _0x15e637[_0x34de('0x22')](0x1f4)[_0x34de('0xc2')](new db[(_0x34de('0x89'))][(_0x34de('0x8a'))](_0x34de('0xc5')+_0x5807b5));}_0x1ef402[_0x5b6f6c[_0x34de('0x4e')][_0x34de('0xc3')]]=_0x5b6f6c[_0x34de('0x4e')]['from'];})[_0x34de('0x17')](function(){return db[_0x34de('0x30')]['find']({'where':{'id':_0x5b6f6c[_0x34de('0x49')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x34de('0xc6')],'as':'MailAccount'}]});})[_0x34de('0x17')](handleEntityNotFound(_0x15e637,null))[_0x34de('0x17')](function(_0x3e867f){if(_0x3e867f&&_0x3e867f[_0x34de('0x91')]){_0x540042=_0x3e867f;var _0x2973a3=_[_0x34de('0xe')](_0x5b6f6c[_0x34de('0x4e')],{'firstName':_0x5b6f6c[_0x34de('0x4e')][_0x34de('0x88')],'phone':_0x5b6f6c[_0x34de('0x4e')][_0x34de('0x88')],'ListId':_0x3e867f['ListId']});_0x2973a3[_0x5b6f6c[_0x34de('0x4e')][_0x34de('0xc3')]]=_0x5b6f6c[_0x34de('0x4e')]['from'];return db[_0x34de('0x92')][_0x34de('0xc7')]({'where':_0x1ef402,'defaults':_0x2973a3});}})['spread'](function(_0x11d231){if(_0x11d231){_0x4dcfbe=_0x11d231;var _0x539e0a=fs[_0x34de('0xc8')](path[_0x34de('0x6a')](config['root'],_0x34de('0xc9')),_0x34de('0xca'));var _0x40358c=ejs[_0x34de('0xcb')](_0x539e0a,{'body':_[_0x34de('0xcc')](_0x5b6f6c['body'][_0x34de('0x4e')]),'bodyTitle':_0x540042[_0x34de('0xcd')]});return db['ChatOfflineMessage'][_0x34de('0x4d')]({'body':_0x40358c,'plainBody':htmlToText[_0x34de('0xce')](_0x40358c),'ContactId':_0x11d231['id'],'ChatWebsiteId':_0x540042['id']});}})[_0x34de('0x17')](function(_0x3fd1e5){_0x53fd4a=_0x3fd1e5;if(_0x1ffb67['length']){var _0x376f97=_0x1ffb67[_0x34de('0x35')](function(_0x4a79fe){return{'name':_0x4a79fe[_0x34de('0xcf')],'basename':_0x4a79fe[_0x34de('0x67')],'type':_0x4a79fe[_0x34de('0xd0')],'ChatOfflineMessageId':_0x3fd1e5['id']};});_0x433564=_0x376f97[_0x34de('0x35')](_0x445030=>{var _0x1be9ec={'filename':_0x445030[_0x34de('0x2e')],'path':path[_0x34de('0x6a')](config[_0x34de('0x6b')],_0x34de('0xd1'),_0x34de('0xd2'),'attachments',_0x34de('0xd3'),_0x445030[_0x34de('0xd4')])};return _0x1be9ec;});if(!_0x540042[_0x34de('0xd5')]){return db[_0x34de('0xd6')]['transaction'](function(_0x10c574){return db[_0x34de('0xd7')][_0x34de('0xd8')](_0x376f97,{'transaction':_0x10c574});});}}})[_0x34de('0x17')](function(){if(_0x53fd4a){_0x2ff3e0=_0x53fd4a;return db[_0x34de('0xc6')][_0x34de('0x5b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x34de('0xd9'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x34de('0xda'),'raw':!![]}]}]});}})[_0x34de('0x17')](function(_0x159d1b){if(_0x159d1b&&_0x159d1b[_0x34de('0xd9')]&&_0x540042[_0x34de('0xdb')]&&_0x540042[_0x34de('0xdc')]){var _0x206755=_0x159d1b['getSmtpOptions']();return respondWithRpcPromise(_0x34de('0xdd'),_0x34de('0xde'),{'account':_0x206755,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x159d1b[_0x34de('0x2e')],_0x159d1b['email']||_0x159d1b[_0x34de('0xd9')][_0x34de('0x52')]),'to':_0x540042[_0x34de('0xdc')],'subject':_0x540042['offlineMessageSubject'],'html':_0x2ff3e0['body'],'attachments':_0x433564}},client9003)[_0x34de('0x17')](function(){return _0x2ff3e0;})[_0x34de('0x47')](function(_0x182738){logger['error'](_0x182738);});}})[_0x34de('0x17')](function(){if(_0x540042&&_0x540042[_0x34de('0xd5')]&&_0x540042[_0x34de('0xdf')]){var _0x20c90a=[];if(_0x1ffb67[_0x34de('0x3a')]){_0x20c90a=_0x1ffb67[_0x34de('0x35')](function(_0x31bc38){return{'name':_0x31bc38[_0x34de('0xcf')],'basename':_0x31bc38[_0x34de('0x67')],'type':_0x31bc38['mimetype'],'ChatOfflineMessageId':_0x53fd4a['id']};});}var _0x4a2441;if(!_[_0x34de('0x6f')](_0x540042[_0x34de('0xe0')])){var _0x3fa257=_[_0x34de('0x35')](_0x5b6f6c['body'],function(_0xf9873a){return _0xf9873a;});var _0x4c4e9f=_[_0x34de('0xe1')](_0x3fa257)[0x0];var _0x37c5c2=_[_0x34de('0xe2')](_0x4c4e9f,function(_0x3bd154){return _0x3bd154;});_0x4a2441=_0x37c5c2[0x1][_0x540042['subjectOffline']];}var _0x1b165a={'from':_0x4dcfbe[_0x34de('0xe3')],'firstName':_0x4dcfbe[_0x34de('0xaf')],'lastName':_0x4dcfbe['lastName'],'mapKey':_0x34de('0xe3'),'message':{'from':_0x4dcfbe[_0x34de('0xe3')],'to':_0x540042[_0x34de('0xc6')][_0x34de('0xe3')],'cc':'','subject':_[_0x34de('0x6f')](_0x4a2441)?_0x540042[_0x34de('0xe4')]:_0x4a2441,'messageId':'','sentAt':new Date(),'attach':_0x20c90a['length'],'attachments':_0x20c90a,'originChannel':_0x34de('0xe5'),'ChatWebsiteId':_0x540042['id'],'ChatOfflineMessageId':_0x2ff3e0['id'],'originTo':_0x540042[_0x34de('0xc6')][_0x34de('0xe3')]},'body':_0x2ff3e0[_0x34de('0x4e')]};var _0x4f2e03={'account':{'id':_0x540042[_0x34de('0xdf')]},'body':_0x1b165a,'log':_0x34de('0xe6')};return respondWithRpcPromise('NotifyMailAccount',_0x34de('0xe7'),_0x4f2e03,client9001)[_0x34de('0x17')](function(){return _0x2ff3e0;})[_0x34de('0x47')](function(_0x5e4e3d){logger['error'](_0x5e4e3d);});}return;})[_0x34de('0x17')](function(){if(_0x2ff3e0){return _0x2ff3e0;}})['then'](respondWithResult(_0x15e637,null))[_0x34de('0x47')](function(_0x31f736){logger[_0x34de('0x1d')](_0x34de('0x47'),_0x31f736);for(var _0x1709c5 of _0x1ffb67){var _0x10e17a=path[_0x34de('0x6a')](config[_0x34de('0x6b')],_0x34de('0xd1'),'files',_0x34de('0xe8'),_0x34de('0xd3'),_0x1709c5[_0x34de('0x67')]);fs_extra[_0x34de('0xe9')](_0x10e17a)['catch'](function(_0x2b7879){logger[_0x34de('0x1d')]('Could\x20not\x20remove\x20attachment\x20file',_0x10e17a,_0x2b7879);});}});};exports[_0x34de('0xea')]=function(_0xef28fe,_0x55f39a){return db[_0x34de('0xaa')]['find']({'where':{'id':_0xef28fe[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x55f39a,null))[_0x34de('0x17')](function(_0x2f738e){if(_0x2f738e){return _0x2f738e[_0x34de('0xea')](_0xef28fe['body'][_0x34de('0x5f')],_[_0x34de('0xeb')](_0xef28fe[_0x34de('0x4e')],[_0x34de('0x5f'),'id'])||{});}})[_0x34de('0x17')](respondWithResult(_0x55f39a,null))[_0x34de('0x47')](handleError(_0x55f39a,null));};exports['getInteractions']=function(_0x272725,_0x374ea4){var _0x138f25={'raw':![],'where':{}};var _0x44b6e9={};var _0x445ed5={'count':0x0,'rows':[]};return db[_0x34de('0x30')][_0x34de('0x5b')]({'where':{'id':_0x272725[_0x34de('0x49')]['id']}})['then'](handleEntityNotFound(_0x374ea4,null))[_0x34de('0x17')](function(_0x3b30e7){if(_0x3b30e7){_0x44b6e9[_0x34de('0x34')]=_[_0x34de('0x4b')](db[_0x34de('0xaa')][_0x34de('0x31')]);_0x44b6e9[_0x34de('0x37')]=_[_0x34de('0x4b')](_0x272725['query']);_0x44b6e9['filters']=_[_0x34de('0x36')](_0x44b6e9[_0x34de('0x34')],_0x44b6e9['query']);_0x138f25[_0x34de('0x38')]=_[_0x34de('0x36')](_0x44b6e9[_0x34de('0x34')],qs[_0x34de('0x39')](_0x272725[_0x34de('0x37')][_0x34de('0x39')]));_0x138f25['attributes']=_0x138f25[_0x34de('0x38')][_0x34de('0x3a')]?_0x138f25[_0x34de('0x38')]:_0x44b6e9['model'];if(!_0x272725[_0x34de('0x37')][_0x34de('0x3b')](_0x34de('0x5c'))){_0x138f25[_0x34de('0x3c')]=qs['limit'](_0x272725['query'][_0x34de('0x3c')]);_0x138f25[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x272725['query'][_0x34de('0x24')]);}_0x138f25[_0x34de('0x63')]=qs[_0x34de('0x3d')](_0x272725['query'][_0x34de('0x3d')]);_0x138f25[_0x34de('0x3e')]=qs[_0x34de('0x40')](_[_0x34de('0x3f')](_0x272725['query'],_0x44b6e9[_0x34de('0x40')]));_0x138f25[_0x34de('0x3e')][_0x34de('0x59')]=_0x3b30e7['id'];if(_0x272725[_0x34de('0x37')][_0x34de('0x41')]){_0x138f25[_0x34de('0x3e')]=_[_0x34de('0x42')](_0x138f25[_0x34de('0x3e')],{'$or':_[_0x34de('0x35')](_0x138f25[_0x34de('0x38')],function(_0x248f55){var _0x3e1d25={};_0x3e1d25[_0x248f55]={'$like':'%'+_0x272725[_0x34de('0x37')]['filter']+'%'};return _0x3e1d25;})});}_0x138f25=_[_0x34de('0x42')]({},_0x138f25,_0x272725[_0x34de('0x4c')]);return db[_0x34de('0xaa')][_0x34de('0x26')]({'where':_0x138f25[_0x34de('0x3e')]})[_0x34de('0x17')](function(_0x186c99){_0x445ed5['count']=_0x186c99;if(_0x272725['query']['includeAll']){_0x138f25[_0x34de('0x45')]=[{'model':db[_0x34de('0x92')],'as':_0x34de('0xec'),'required':![]},{'model':db[_0x34de('0xb7')],'as':_0x34de('0xed'),'attributes':[_0x34de('0x2e'),_0x34de('0xee'),_0x34de('0xef')],'required':![]},{'model':db[_0x34de('0xf0')],'as':_0x34de('0xf1'),'attributes':['id',_0x34de('0x2e'),'color'],'where':_0x272725[_0x34de('0x37')]['tag']?{'id':_0x272725['query'][_0x34de('0xf2')]}:undefined,'required':_0x272725[_0x34de('0x37')]['tag']?!![]:![]}];}return db[_0x34de('0xaa')][_0x34de('0x46')](_0x138f25);})[_0x34de('0x17')](function(_0x4b4544){_0x445ed5[_0x34de('0x5d')]=_0x4b4544;return _0x445ed5;});}})['then'](respondWithFilteredResult(_0x374ea4,_0x138f25))['catch'](handleError(_0x374ea4,null));};function iftimePromise(_0x872c7,_0x3a174e){return respondWithRpcPromise(_0x34de('0xf3'),_0x34de('0xf4'),{'command':_0x3a174e[_0x34de('0xf5')]?util[_0x34de('0xa3')](_0x34de('0xf6'),_0x872c7['interval'],_0x3a174e['timezone']):util[_0x34de('0xa3')](_0x34de('0xf7'),_0x872c7[_0x34de('0xf8')])},client9002)['then'](function(_0x528754){var _0x2db976=_0x528754&&_0x528754[_0x34de('0xf9')](_0x34de('0xfa'))>=0x0?!![]:![];logger[_0x34de('0x18')](_0x34de('0xfb'),_0x3a174e['id'],_0x872c7['id'],_0x872c7[_0x34de('0xf8')],_0x2db976?_0x34de('0xfc'):'OFFLINE',_0x3a174e['timezone']?_0x3a174e['timezone']:_0x34de('0xfd'));return _0x2db976;})[_0x34de('0x47')](function(_0x44b122){logger[_0x34de('0x1d')](_0x34de('0xfb'),_0x3a174e['id'],_0x872c7['id'],_0x872c7[_0x34de('0xf8')],util[_0x34de('0xfe')](_0x44b122,{'showHidden':![],'depth':null}),_0x3a174e[_0x34de('0xf5')]?_0x3a174e[_0x34de('0xf5')]:'No\x20timezone');return![];});}exports[_0x34de('0xf4')]=function(_0x1cc868,_0x40023f){var _0x294fe0=0x0;var _0x4871fc=0x0;var _0x465279=![];var _0x46d917;var _0x4bab4e;return db[_0x34de('0x30')][_0x34de('0x54')]({'where':{'id':_0x1cc868[_0x34de('0x49')]['id']},'include':[{'model':db[_0x34de('0xff')],'as':_0x34de('0xff'),'include':[{'model':db[_0x34de('0xff')],'as':'Intervals','attributes':['id',_0x34de('0xf8')],'raw':!![]}]}]})[_0x34de('0x17')](handleEntityNotFound(_0x40023f,null))[_0x34de('0x17')](function(_0xc336fa){if(_0xc336fa){_0x46d917=_0xc336fa;return _0xc336fa['getProactiveActions']({'raw':!![]});}})['then'](function(_0x23ef7f){if(_0x46d917){if(_0x23ef7f){_0x4bab4e=_0x23ef7f;}}return require(_0x34de('0x100'))[_0x34de('0x6d')]();})[_0x34de('0x17')](function(_0x3426b2){if(_0x3426b2){_0x4871fc=_0x3426b2[_0x34de('0x101')];_0x465279=_0x3426b2['custom'];}})[_0x34de('0x17')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0xead287){_0x294fe0=_0xead287;if(_0x4871fc&&_0xead287>_0x4871fc){return db[_0x34de('0x102')][_0x34de('0x5b')]({'where':{'id':0x1}})[_0x34de('0x17')](function(_0x151154){if(_0x151154){_0x151154[_0x34de('0x103')](_0x34de('0x104'));}});}})['then'](function(){if(_0x46d917['Interval']&&_0x46d917[_0x34de('0xff')][_0x34de('0x105')]){var _0x2d7387=[];for(var _0x157c04=0x0;_0x157c04<_0x46d917[_0x34de('0xff')][_0x34de('0x105')][_0x34de('0x3a')];_0x157c04++){var _0x4e0732=_0x46d917[_0x34de('0xff')][_0x34de('0x105')][_0x157c04][_0x34de('0x4f')]({'plain':!![]});_0x2d7387[_0x34de('0xb3')](iftimePromise(_0x4e0732,_0x46d917));}return BPromise[_0x34de('0x106')](_0x2d7387)[_0x34de('0x17')](function(_0x5077f3){return _[_0x34de('0x107')](_0x5077f3);});}else{return!![];}})[_0x34de('0x17')](function(_0x3373b0){var _0x5ae0d2=fs[_0x34de('0xc8')](path['join'](config[_0x34de('0x6b')],_0x34de('0x108')),'utf8');var _0x16d942={'remote':_0x46d917[_0x34de('0x109')],'query':querystring['stringify'](_['merge'](_0x46d917['get']({'plain':!![]}),{'customerIp':_0x1cc868[_0x34de('0x7e')][_0x34de('0x9d')]||_0x1cc868[_0x34de('0x7e')][_0x34de('0x10a')]||_0x1cc868[_0x34de('0x10b')][_0x34de('0x10c')]||_0x1cc868['ip'],'referer':_0x1cc868[_0x34de('0x7e')][_0x34de('0xa1')],'openedInteractions':_0x294fe0,'maxInteractions':_0x4871fc,'virtual':_0x465279[_0x34de('0x101')],'online':_0x3373b0,'custom':_0x465279}))['replace'](/'/g,'\x5c\x27')};_0x40023f[_0x34de('0xc2')](ejs[_0x34de('0xcb')](Mustache['render'](_0x5ae0d2,_0x16d942),{'proactiveActions':_0x4bab4e,'alignment':_0x46d917[_0x34de('0x10d')],'verticalAlignment':_0x46d917[_0x34de('0x10e')],'div_color':_0x46d917[_0x34de('0x10f')],'labelText':_0x46d917[_0x34de('0x110')],'text_color':_0x46d917[_0x34de('0x111')],'text_button_color':_0x46d917[_0x34de('0x112')],'button_color':_0x46d917['color_button'],'background_color':_0x46d917['backgroundColor'],'hideWhenOffline':_0x46d917[_0x34de('0x113')],'interval':_0x46d917[_0x34de('0x114')]}));})[_0x34de('0x47')](handleError(_0x40023f,null));};exports[_0x34de('0x115')]=function(_0xff9f9a,_0xbea686){var _0x2fe698=_0xff9f9a['params']['id'];var _0x450acd=_0xff9f9a[_0x34de('0x4e')];var _0x4a3398=0xc8;var _0xbb2677=null;return db[_0x34de('0xd6')]['transaction']({'isolationLevel':db[_0x34de('0xd6')]['Transaction']['ISOLATION_LEVELS'][_0x34de('0x116')]},function(_0x1b597c){return db[_0x34de('0x30')]['findOne']({'where':{'id':_0x2fe698},'transaction':_0x1b597c})[_0x34de('0x17')](function(_0x42076a){if(_0x42076a){return db['ChatApplication'][_0x34de('0x2b')]({'where':{'ChatWebsiteId':_0x2fe698},'transaction':_0x1b597c})['then'](function(){var _0x26c627=_[_0x34de('0x35')](_0x450acd,function(_0x5f06cd){_0x5f06cd[_0x34de('0x59')]=_0x2fe698;return _0x5f06cd;});return db[_0x34de('0x94')]['bulkCreate'](_0x26c627,{'transaction':_0x1b597c});});}else{_0x4a3398=0x194;_0xbb2677=[];}});})[_0x34de('0x17')](function(){if(_0x4a3398!==0x194){return db[_0x34de('0x94')][_0x34de('0x117')]({'where':{'ChatWebsiteId':_0x2fe698},'order':_0x34de('0x98')})['then'](function(_0x170860){_0xbb2677=_0x170860;});}})[_0x34de('0x47')](function(_0xf61cbb){_0x4a3398=0x1f4;logger['error'](_0xf61cbb['stack']);if(_0xf61cbb[_0x34de('0x2e')]){delete _0xf61cbb['name'];}_0xbb2677=_0xf61cbb;})[_0x34de('0x118')](function(){if(_0xbb2677===null){_0xbea686[_0x34de('0x21')](_0x4a3398);}else{if(_0x4a3398===0x1f4){_0xbea686[_0x34de('0x22')](_0x4a3398)[_0x34de('0xc2')](_0xbb2677);}else{_0xbea686['status'](_0x4a3398)[_0x34de('0x23')](_0xbb2677);}}});};exports[_0x34de('0x119')]=function(_0x248331,_0x2e0181){var _0x43ca03={};var _0x1fe158={};var _0xec40e0;var _0xdb981a;return db[_0x34de('0x30')][_0x34de('0x5b')]({'where':{'id':_0x248331['params']['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x2e0181,null))['then'](function(_0x4e622a){if(_0x4e622a){_0xec40e0=_0x4e622a;_0x1fe158[_0x34de('0x34')]=_['keys'](db['ChatApplication'][_0x34de('0x31')]);_0x1fe158[_0x34de('0x37')]=_[_0x34de('0x4b')](_0x248331[_0x34de('0x37')]);_0x1fe158[_0x34de('0x40')]=_[_0x34de('0x36')](_0x1fe158[_0x34de('0x34')],_0x1fe158[_0x34de('0x37')]);_0x43ca03['attributes']=_[_0x34de('0x36')](_0x1fe158[_0x34de('0x34')],qs[_0x34de('0x39')](_0x248331['query'][_0x34de('0x39')]));_0x43ca03[_0x34de('0x38')]=_0x43ca03[_0x34de('0x38')][_0x34de('0x3a')]?_0x43ca03['attributes']:_0x1fe158[_0x34de('0x34')];_0x43ca03['order']=qs[_0x34de('0x3d')](_0x248331[_0x34de('0x37')][_0x34de('0x3d')]);_0x43ca03[_0x34de('0x3e')]=qs[_0x34de('0x40')](_[_0x34de('0x3f')](_0x248331[_0x34de('0x37')],_0x1fe158[_0x34de('0x40')]));if(_0x248331['query']['filter']){_0x43ca03[_0x34de('0x3e')]=_[_0x34de('0x42')](_0x43ca03[_0x34de('0x3e')],{'$or':_[_0x34de('0x35')](_0x43ca03[_0x34de('0x38')],function(_0x72a86e){var _0x206ba9={};_0x206ba9[_0x72a86e]={'$like':'%'+_0x248331[_0x34de('0x37')]['filter']+'%'};return _0x206ba9;})});}_0x43ca03=_[_0x34de('0x42')]({},_0x43ca03,_0x248331[_0x34de('0x4c')]);return _0xec40e0[_0x34de('0x119')](_0x43ca03);}})['then'](function(_0x16a281){if(_0x16a281){_0xdb981a=_0x16a281['length'];if(!_0x248331[_0x34de('0x37')]['hasOwnProperty']('nolimit')){_0x43ca03['limit']=qs[_0x34de('0x3c')](_0x248331[_0x34de('0x37')][_0x34de('0x3c')]);_0x43ca03[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x248331[_0x34de('0x37')][_0x34de('0x24')]);}return _0xec40e0[_0x34de('0x119')](_0x43ca03);}})[_0x34de('0x17')](function(_0x49e5f8){if(_0x49e5f8){return _0x49e5f8?{'count':_0xdb981a,'rows':_0x49e5f8}:null;}})[_0x34de('0x17')](respondWithResult(_0x2e0181,null))['catch'](handleError(_0x2e0181,null));};exports[_0x34de('0x11a')]=function(_0x50c8f2,_0x578b62){return db[_0x34de('0x11b')][_0x34de('0x54')]({'where':{'id':_0x50c8f2[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x578b62,null))[_0x34de('0x17')](function(_0x84139a){if(_0x84139a){return _0x84139a['addProactiveActions'](_0x50c8f2['body'][_0x34de('0x5f')],_['omit'](_0x50c8f2[_0x34de('0x4e')],['ids','id'])||{});}})[_0x34de('0x17')](respondWithResult(_0x578b62,null))[_0x34de('0x47')](handleError(_0x578b62,null));};exports['getProactiveActions']=function(_0x42f781,_0x63f62a){var _0x59a407={};var _0x530d8c={};var _0x36b975;var _0x4ae312;return db[_0x34de('0x30')][_0x34de('0x5b')]({'where':{'id':_0x42f781['params']['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x63f62a,null))[_0x34de('0x17')](function(_0x3bdecd){if(_0x3bdecd){_0x36b975=_0x3bdecd;_0x530d8c['model']=_['keys'](db[_0x34de('0x11c')]['rawAttributes']);_0x530d8c[_0x34de('0x37')]=_['keys'](_0x42f781[_0x34de('0x37')]);_0x530d8c[_0x34de('0x40')]=_['intersection'](_0x530d8c[_0x34de('0x34')],_0x530d8c[_0x34de('0x37')]);_0x59a407[_0x34de('0x38')]=_[_0x34de('0x36')](_0x530d8c[_0x34de('0x34')],qs[_0x34de('0x39')](_0x42f781[_0x34de('0x37')][_0x34de('0x39')]));_0x59a407['attributes']=_0x59a407[_0x34de('0x38')][_0x34de('0x3a')]?_0x59a407[_0x34de('0x38')]:_0x530d8c[_0x34de('0x34')];_0x59a407[_0x34de('0x63')]=qs[_0x34de('0x3d')](_0x42f781['query'][_0x34de('0x3d')]);_0x59a407[_0x34de('0x3e')]=qs[_0x34de('0x40')](_[_0x34de('0x3f')](_0x42f781['query'],_0x530d8c[_0x34de('0x40')]));if(_0x42f781[_0x34de('0x37')][_0x34de('0x41')]){_0x59a407[_0x34de('0x3e')]=_[_0x34de('0x42')](_0x59a407['where'],{'$or':_['map'](_0x59a407[_0x34de('0x38')],function(_0x53569a){var _0xc47fb8={};_0xc47fb8[_0x53569a]={'$like':'%'+_0x42f781[_0x34de('0x37')]['filter']+'%'};return _0xc47fb8;})});}_0x59a407=_[_0x34de('0x42')]({},_0x59a407,_0x42f781['options']);return _0x36b975[_0x34de('0x11d')](_0x59a407);}})[_0x34de('0x17')](function(_0x371b48){if(_0x371b48){_0x4ae312=_0x371b48[_0x34de('0x3a')];if(!_0x42f781[_0x34de('0x37')][_0x34de('0x3b')]('nolimit')){_0x59a407['limit']=qs[_0x34de('0x3c')](_0x42f781[_0x34de('0x37')][_0x34de('0x3c')]);_0x59a407[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x42f781['query'][_0x34de('0x24')]);}return _0x36b975[_0x34de('0x11d')](_0x59a407);}})[_0x34de('0x17')](function(_0x54774c){if(_0x54774c){return _0x54774c?{'count':_0x4ae312,'rows':_0x54774c}:null;}})['then'](respondWithResult(_0x63f62a,null))[_0x34de('0x47')](handleError(_0x63f62a,null));};exports[_0x34de('0x11e')]=function(_0x146bb8,_0x221ea5){var _0x17c5ed=_0x146bb8[_0x34de('0x37')]['online']===_0x34de('0x11f')?_0x34de('0x120'):_0x34de('0x121');return db[_0x34de('0x30')][_0x34de('0x54')]({'attributes':['id',_0x17c5ed],'where':{'id':_0x146bb8[_0x34de('0x49')]['id']}})['then'](handleEntityNotFound(_0x221ea5,null))[_0x34de('0x17')](function(_0x58df67){if(_0x58df67){var _0x1ce757=_0x58df67[_0x17c5ed];var _0x2cffff=_0x1ce757&&_0x1ce757[_0x34de('0x122')]?_0x1ce757[_0x34de('0x122')]:[];_0x221ea5[_0x34de('0xc2')]({'fromKey':_[_0x34de('0x6f')](_0x1ce757[_0x34de('0x123')])?undefined:_0x1ce757[_0x34de('0x123')],'count':_0x2cffff[_0x34de('0x3a')],'rows':_0x2cffff});}})[_0x34de('0x47')](handleError(_0x221ea5,null));};exports[_0x34de('0x124')]=function(_0x11dbcf,_0xeedcad){var _0x319fbd={'raw':![],'where':{}};var _0x44b97a={};var _0x92860d={'count':0x0,'rows':[]};return db[_0x34de('0x30')][_0x34de('0x5b')]({'where':{'id':_0x11dbcf[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0xeedcad,null))['then'](function(_0x4184eb){if(_0x4184eb){_0x44b97a[_0x34de('0x34')]=_[_0x34de('0x4b')](db[_0x34de('0x125')]['rawAttributes']);_0x44b97a[_0x34de('0x37')]=_['keys'](_0x11dbcf[_0x34de('0x37')]);_0x44b97a[_0x34de('0x40')]=_['intersection'](_0x44b97a[_0x34de('0x34')],_0x44b97a[_0x34de('0x37')]);_0x319fbd[_0x34de('0x38')]=_[_0x34de('0x36')](_0x44b97a[_0x34de('0x34')],qs['fields'](_0x11dbcf['query'][_0x34de('0x39')]));_0x319fbd[_0x34de('0x38')]=_0x319fbd[_0x34de('0x38')][_0x34de('0x3a')]?_0x319fbd[_0x34de('0x38')]:_0x44b97a[_0x34de('0x34')];if(!_0x11dbcf[_0x34de('0x37')][_0x34de('0x3b')](_0x34de('0x5c'))){_0x319fbd[_0x34de('0x3c')]=qs[_0x34de('0x3c')](_0x11dbcf[_0x34de('0x37')][_0x34de('0x3c')]);_0x319fbd[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x11dbcf[_0x34de('0x37')]['offset']);}_0x319fbd['order']=qs[_0x34de('0x3d')](_0x11dbcf[_0x34de('0x37')]['sort']);_0x319fbd[_0x34de('0x3e')]=qs[_0x34de('0x40')](_[_0x34de('0x3f')](_0x11dbcf[_0x34de('0x37')],_0x44b97a[_0x34de('0x40')]));_0x319fbd['where']['ChatWebsiteId']=_0x4184eb['id'];if(_0x11dbcf[_0x34de('0x37')]['filter']){_0x319fbd['where']=_[_0x34de('0x42')](_0x319fbd[_0x34de('0x3e')],{'$or':_[_0x34de('0x35')](_0x319fbd['attributes'],function(_0x3dff99){var _0x13fd5e={};_0x13fd5e[_0x3dff99]={'$like':'%'+_0x11dbcf[_0x34de('0x37')]['filter']+'%'};return _0x13fd5e;})});}_0x319fbd=_[_0x34de('0x42')]({},_0x319fbd,_0x11dbcf[_0x34de('0x4c')]);return db[_0x34de('0x125')][_0x34de('0x26')]({'where':_0x319fbd[_0x34de('0x3e')]})[_0x34de('0x17')](function(_0x436675){_0x92860d[_0x34de('0x26')]=_0x436675;if(_0x11dbcf['query'][_0x34de('0x44')]){_0x319fbd[_0x34de('0x45')]=[{'all':!![]}];}else{_0x319fbd[_0x34de('0x45')]=[{'model':db['CmContact'],'as':_0x34de('0xec'),'required':![]},{'model':db[_0x34de('0xd7')],'as':_0x34de('0x126'),'required':![]}];}return db[_0x34de('0x125')]['findAll'](_0x319fbd);})[_0x34de('0x17')](function(_0x218dd5){_0x92860d['rows']=_0x218dd5;return _0x92860d;});}})[_0x34de('0x17')](respondWithFilteredResult(_0xeedcad,_0x319fbd))[_0x34de('0x47')](handleError(_0xeedcad,null));};exports[_0x34de('0x127')]=function(_0x280810,_0x1107b3){return db[_0x34de('0x30')]['find']({'where':{'id':_0x280810[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x1107b3,null))[_0x34de('0x17')](function(_0x48d8d8){if(_0x48d8d8){return _0x48d8d8[_0x34de('0x127')](_0x280810[_0x34de('0x4e')]['ids'],_[_0x34de('0xeb')](_0x280810['body'],['ids','id'])||{})['spread'](function(_0x325e0e){for(var _0x3901e9=0x0;_0x3901e9<_0x280810['body']['ids']['length'];_0x3901e9+=0x1){socket[_0x34de('0x128')]('userChatWebsite:save',{'UserId':Number(_0x280810['body'][_0x34de('0x5f')][_0x3901e9]),'ChatWebsiteId':Number(_0x280810[_0x34de('0x49')]['id'])});}return _0x325e0e;});}})[_0x34de('0x17')](respondWithResult(_0x1107b3,null))[_0x34de('0x47')](handleError(_0x1107b3,null));};exports[_0x34de('0x129')]=function(_0x21d287,_0x2b1564){return db[_0x34de('0x30')][_0x34de('0x54')]({'where':{'id':_0x21d287[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x2b1564,null))['then'](function(_0x37655b){if(_0x37655b){return _0x37655b[_0x34de('0x129')](_0x21d287[_0x34de('0x37')][_0x34de('0x5f')])[_0x34de('0x17')](function(){if(_[_0x34de('0x12a')](_0x21d287[_0x34de('0x37')][_0x34de('0x5f')])){for(var _0x3619f5=0x0;_0x3619f5<_0x21d287[_0x34de('0x37')][_0x34de('0x5f')][_0x34de('0x3a')];_0x3619f5+=0x1){socket[_0x34de('0x128')](_0x34de('0x12b'),{'UserId':Number(_0x21d287[_0x34de('0x37')][_0x34de('0x5f')][_0x3619f5]),'ChatWebsiteId':Number(_0x21d287[_0x34de('0x49')]['id'])});}}else{socket[_0x34de('0x128')](_0x34de('0x12b'),{'UserId':Number(_0x21d287[_0x34de('0x37')][_0x34de('0x5f')]),'ChatWebsiteId':Number(_0x21d287[_0x34de('0x49')]['id'])});}});}})[_0x34de('0x17')](respondWithStatusCode(_0x2b1564,null))[_0x34de('0x47')](handleError(_0x2b1564,null));};exports[_0x34de('0x12c')]=function(_0x571661,_0x26d43f){var _0x1f45f7={};var _0x195e40={};var _0x5a201f;var _0x52d963;return db['ChatWebsite'][_0x34de('0x5b')]({'where':{'id':_0x571661[_0x34de('0x49')]['id']}})[_0x34de('0x17')](handleEntityNotFound(_0x26d43f,null))['then'](function(_0x2dfc33){if(_0x2dfc33){_0x5a201f=_0x2dfc33;_0x195e40[_0x34de('0x34')]=_[_0x34de('0x4b')](db['User'][_0x34de('0x31')]);_0x195e40[_0x34de('0x37')]=_[_0x34de('0x4b')](_0x571661['query']);_0x195e40[_0x34de('0x40')]=_[_0x34de('0x36')](_0x195e40[_0x34de('0x34')],_0x195e40[_0x34de('0x37')]);_0x1f45f7[_0x34de('0x38')]=_[_0x34de('0x36')](_0x195e40['model'],qs[_0x34de('0x39')](_0x571661[_0x34de('0x37')][_0x34de('0x39')]));_0x1f45f7['attributes']=_0x1f45f7[_0x34de('0x38')][_0x34de('0x3a')]?_0x1f45f7['attributes']:_0x195e40[_0x34de('0x34')];_0x1f45f7['order']=qs[_0x34de('0x3d')](_0x571661[_0x34de('0x37')][_0x34de('0x3d')]);_0x1f45f7[_0x34de('0x3e')]=qs[_0x34de('0x40')](_['pick'](_0x571661[_0x34de('0x37')],_0x195e40[_0x34de('0x40')]));if(_0x571661[_0x34de('0x37')][_0x34de('0x41')]){_0x1f45f7[_0x34de('0x3e')]=_[_0x34de('0x42')](_0x1f45f7['where'],{'$or':_[_0x34de('0x35')](_0x1f45f7[_0x34de('0x38')],function(_0x2a36fb){var _0x39fe0d={};_0x39fe0d[_0x2a36fb]={'$like':'%'+_0x571661['query'][_0x34de('0x41')]+'%'};return _0x39fe0d;})});}_0x1f45f7=_['merge']({},_0x1f45f7,_0x571661[_0x34de('0x4c')]);return _0x5a201f[_0x34de('0x12c')](_0x1f45f7);}})[_0x34de('0x17')](function(_0x5edf46){if(_0x5edf46){_0x52d963=_0x5edf46[_0x34de('0x3a')];if(!_0x571661[_0x34de('0x37')][_0x34de('0x3b')](_0x34de('0x5c'))){_0x1f45f7[_0x34de('0x3c')]=qs[_0x34de('0x3c')](_0x571661['query'][_0x34de('0x3c')]);_0x1f45f7['offset']=qs['offset'](_0x571661[_0x34de('0x37')][_0x34de('0x24')]);}return _0x5a201f[_0x34de('0x12c')](_0x1f45f7);}})['then'](function(_0x42c929){if(_0x42c929){return _0x42c929?{'count':_0x52d963,'rows':_0x42c929}:null;}})['then'](respondWithResult(_0x26d43f,null))['catch'](handleError(_0x26d43f,null));}; \ No newline at end of file +var _0x2855=['first','x-forwarded-for','split','lastName','x-real-port','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','push','close','unmanaged','*,*,*,*','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','createdAt','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','fromString','originalname','server','files','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','firstName','Chat','NotifyMailAccount','notifyMail','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','internal','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','replace','render','verticalAlignment','color','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatWebsite.socket','register','html-to-text','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','name','send','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','model','map','keys','intersection','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','options','findAll','rows','show','params','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','user-agent','getResult','chat','ValidationError','no\x20available\x20attributes','difference','updatedAt','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Applications','account','applications','orderBy','priority','asc','Contacts','defaults','ListId','contact','customerIp','headers','cf-connecting-ip'];(function(_0x6a2228,_0x4a1d8b){var _0x2d7c81=function(_0x53bf1e){while(--_0x53bf1e){_0x6a2228['push'](_0x6a2228['shift']());}};_0x2d7c81(++_0x4a1d8b);}(_0x2855,0x93));var _0x5285=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2855[_0x3b380d];return _0x54502b;};'use strict';var BPromise=require(_0x5285('0x0'));var Mustache=require('mustache');var util=require(_0x5285('0x1'));var path=require(_0x5285('0x2'));var ejs=require(_0x5285('0x3'));var fs=require('fs');var fs_extra=require(_0x5285('0x4'));var _=require(_0x5285('0x5'));var querystring=require(_0x5285('0x6'));var Redis=require(_0x5285('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x5285('0x8'))(_0x5285('0x9'));var config=require(_0x5285('0xa'));var db=require(_0x5285('0xb'))['db'];config[_0x5285('0xc')]=_['defaults'](config[_0x5285('0xc')],{'host':_0x5285('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5285('0xc')]));require(_0x5285('0xe'))[_0x5285('0xf')](socket);var htmlToText=require(_0x5285('0x10'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5285('0x11')]({'port':0x232c});var client9002=jayson[_0x5285('0x12')][_0x5285('0x11')]({'port':0x232a});var client9003=jayson['client'][_0x5285('0x11')]({'port':0x232b});var client9001=jayson[_0x5285('0x12')][_0x5285('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x13039e,_0x37db7c,_0x37a447,_0x492221){return new BPromise(function(_0x5d903a,_0x28fed9){var _0x42039a=_0x492221||client;return _0x42039a[_0x5285('0x13')](_0x13039e,_0x37a447)[_0x5285('0x14')](function(_0x21d37b){logger[_0x5285('0x15')](_0x5285('0x16'),_0x37db7c,'request\x20sent');logger['debug'](_0x5285('0x17'),_0x37db7c,_0x5285('0x18'),JSON[_0x5285('0x19')](_0x21d37b));if(_0x21d37b['error']){if(_0x21d37b[_0x5285('0x1a')][_0x5285('0x1b')]===0x1f4){logger[_0x5285('0x1a')](_0x5285('0x16'),_0x37db7c,_0x21d37b['error'][_0x5285('0x1c')]);return _0x28fed9(_0x21d37b[_0x5285('0x1a')][_0x5285('0x1c')]);}logger[_0x5285('0x1a')](_0x5285('0x16'),_0x37db7c,_0x21d37b[_0x5285('0x1a')][_0x5285('0x1c')]);return _0x5d903a(_0x21d37b[_0x5285('0x1a')][_0x5285('0x1c')]);}else{logger[_0x5285('0x15')](_0x5285('0x16'),_0x37db7c,'request\x20sent');_0x5d903a(_0x21d37b[_0x5285('0x1d')][_0x5285('0x1c')]);}})[_0x5285('0x1e')](function(_0x353127){logger[_0x5285('0x1a')](_0x5285('0x16'),_0x37db7c,_0x353127);_0x28fed9(_0x353127);});});}function respondWithStatusCode(_0x363984,_0x5614e5){_0x5614e5=_0x5614e5||0xcc;return function(_0x53f207){if(_0x53f207){return _0x363984[_0x5285('0x1f')](_0x5614e5);}return _0x363984[_0x5285('0x20')](_0x5614e5)[_0x5285('0x21')]();};}function respondWithResult(_0x2dfad5,_0x47b147){_0x47b147=_0x47b147||0xc8;return function(_0x43ea84){if(_0x43ea84){return _0x2dfad5['status'](_0x47b147)['json'](_0x43ea84);}};}function respondWithFilteredResult(_0x134143,_0x2ba637){return function(_0x498f07){if(_0x498f07){var _0x311e73=typeof _0x2ba637[_0x5285('0x22')]===_0x5285('0x23')&&typeof _0x2ba637[_0x5285('0x24')]===_0x5285('0x23');var _0x533f44=_0x498f07['count'];var _0x146183=_0x311e73?0x0:_0x2ba637[_0x5285('0x22')];var _0x1845fe=_0x311e73?_0x498f07[_0x5285('0x25')]:_0x2ba637[_0x5285('0x22')]+_0x2ba637[_0x5285('0x24')];var _0x948d5a;if(_0x1845fe>=_0x533f44){_0x1845fe=_0x533f44;_0x948d5a=0xc8;}else{_0x948d5a=0xce;}_0x134143[_0x5285('0x20')](_0x948d5a);return _0x134143[_0x5285('0x26')](_0x5285('0x27'),_0x146183+'-'+_0x1845fe+'/'+_0x533f44)[_0x5285('0x28')](_0x498f07);}return null;};}function saveUpdates(_0x44d60c){return function(_0x1e5c91){if(_0x1e5c91){return _0x1e5c91[_0x5285('0x29')](_0x44d60c)[_0x5285('0x14')](function(_0x341331){return _0x341331;});}return null;};}function removeEntity(_0x413bc9){return function(_0x393dcd){if(_0x393dcd){return _0x393dcd[_0x5285('0x2a')]()['then'](function(){var _0x508716=_0x393dcd[_0x5285('0x2b')]({'plain':!![]});var _0x4bebda=_0x5285('0x2c');return db[_0x5285('0x2d')][_0x5285('0x2a')]({'where':{'type':_0x4bebda,'resourceId':_0x508716['id']}})[_0x5285('0x14')](function(){return _0x393dcd;});})[_0x5285('0x14')](function(){_0x413bc9[_0x5285('0x20')](0xcc)[_0x5285('0x21')]();});}};}function handleEntityNotFound(_0x332122){return function(_0x408152){if(!_0x408152){_0x332122[_0x5285('0x1f')](0x194);}return _0x408152;};}function handleError(_0x51429a,_0x56d6e0){_0x56d6e0=_0x56d6e0||0x1f4;return function(_0x3a1f59){logger[_0x5285('0x1a')](_0x3a1f59['stack']);if(_0x3a1f59[_0x5285('0x2e')]){delete _0x3a1f59[_0x5285('0x2e')];}_0x51429a[_0x5285('0x20')](_0x56d6e0)[_0x5285('0x2f')](_0x3a1f59);};}exports[_0x5285('0x30')]=function(_0x20862c,_0x86285d){var _0x1be59f={'include':[{'model':db['Pause'],'as':_0x5285('0x31')}]},_0xf1139={},_0x1dcfde={'count':0x0,'rows':[]};var _0x1960a1=_['map'](db[_0x5285('0x32')][_0x5285('0x33')],function(_0x25f52a){return{'name':_0x25f52a[_0x5285('0x34')],'type':_0x25f52a['type'][_0x5285('0x35')]};});_0xf1139[_0x5285('0x36')]=_[_0x5285('0x37')](_0x1960a1,_0x5285('0x2e'));_0xf1139['query']=_[_0x5285('0x38')](_0x20862c['query']);_0xf1139['filters']=_[_0x5285('0x39')](_0xf1139[_0x5285('0x36')],_0xf1139[_0x5285('0x3a')]);_0x1be59f[_0x5285('0x3b')]=_[_0x5285('0x39')](_0xf1139[_0x5285('0x36')],qs[_0x5285('0x3c')](_0x20862c['query'][_0x5285('0x3c')]));_0x1be59f[_0x5285('0x3b')]=_0x1be59f[_0x5285('0x3b')][_0x5285('0x3d')]?_0x1be59f[_0x5285('0x3b')]:_0xf1139[_0x5285('0x36')];if(!_0x20862c[_0x5285('0x3a')]['hasOwnProperty'](_0x5285('0x3e'))){_0x1be59f[_0x5285('0x24')]=qs[_0x5285('0x24')](_0x20862c[_0x5285('0x3a')][_0x5285('0x24')]);_0x1be59f[_0x5285('0x22')]=qs[_0x5285('0x22')](_0x20862c[_0x5285('0x3a')][_0x5285('0x22')]);}_0x1be59f[_0x5285('0x3f')]=qs[_0x5285('0x40')](_0x20862c[_0x5285('0x3a')]['sort']);_0x1be59f[_0x5285('0x41')]=qs[_0x5285('0x42')](_[_0x5285('0x43')](_0x20862c[_0x5285('0x3a')],_0xf1139[_0x5285('0x42')]),_0x1960a1);if(_0x20862c['query'][_0x5285('0x44')]){_0x1be59f[_0x5285('0x41')]=_[_0x5285('0x45')](_0x1be59f[_0x5285('0x41')],{'$or':_[_0x5285('0x37')](_0x1960a1,function(_0x390591){if(_0x390591[_0x5285('0x46')]!=='VIRTUAL'){var _0x540b2b={};_0x540b2b[_0x390591[_0x5285('0x2e')]]={'$like':'%'+_0x20862c[_0x5285('0x3a')]['filter']+'%'};return _0x540b2b;}})});}_0x1be59f=_[_0x5285('0x45')]({},_0x1be59f,_0x20862c[_0x5285('0x47')]);var _0x47025e={'where':_0x1be59f['where']};return db[_0x5285('0x32')][_0x5285('0x25')](_0x47025e)['then'](function(_0x2bf3a1){_0x1dcfde[_0x5285('0x25')]=_0x2bf3a1;if(_0x20862c[_0x5285('0x3a')]['includeAll']){_0x1be59f['include']=[{'all':!![]}];}return db[_0x5285('0x32')][_0x5285('0x48')](_0x1be59f);})[_0x5285('0x14')](function(_0x949e51){_0x1dcfde[_0x5285('0x49')]=_0x949e51;return _0x1dcfde;})[_0x5285('0x14')](respondWithFilteredResult(_0x86285d,_0x1be59f))[_0x5285('0x1e')](handleError(_0x86285d,null));};exports[_0x5285('0x4a')]=function(_0x20543d,_0x3c2541){var _0x263328={'raw':![],'where':{'id':_0x20543d[_0x5285('0x4b')]['id']},'include':[{'model':db['Pause'],'as':_0x5285('0x31')}]},_0x267204={};_0x267204[_0x5285('0x36')]=_[_0x5285('0x38')](db[_0x5285('0x32')]['rawAttributes']);_0x267204['query']=_[_0x5285('0x38')](_0x20543d[_0x5285('0x3a')]);_0x267204['filters']=_['intersection'](_0x267204['model'],_0x267204['query']);_0x263328[_0x5285('0x3b')]=_[_0x5285('0x39')](_0x267204[_0x5285('0x36')],qs[_0x5285('0x3c')](_0x20543d[_0x5285('0x3a')][_0x5285('0x3c')]));_0x263328[_0x5285('0x3b')]=_0x263328[_0x5285('0x3b')]['length']?_0x263328[_0x5285('0x3b')]:_0x267204[_0x5285('0x36')];if(_0x20543d[_0x5285('0x3a')][_0x5285('0x4c')]){_0x263328[_0x5285('0x4d')]=[{'all':!![]}];}_0x263328=_['merge']({},_0x263328,_0x20543d[_0x5285('0x47')]);return db[_0x5285('0x32')][_0x5285('0x4e')](_0x263328)[_0x5285('0x14')](handleEntityNotFound(_0x3c2541,null))['then'](respondWithResult(_0x3c2541,null))[_0x5285('0x1e')](handleError(_0x3c2541,null));};exports['create']=function(_0x5e0337,_0x340050){return db[_0x5285('0x32')][_0x5285('0x4f')](_0x5e0337[_0x5285('0x50')],{})['then'](function(_0x20c87f){var _0x3b272a=_0x5e0337['user'][_0x5285('0x2b')]({'plain':!![]});if(!_0x3b272a)throw new Error(_0x5285('0x51'));if(_0x3b272a[_0x5285('0x52')]===_0x5285('0x53')){var _0x5907d3=_0x20c87f[_0x5285('0x2b')]({'plain':!![]});var _0x527104=_0x5285('0x2c');return db[_0x5285('0x54')][_0x5285('0x4e')]({'where':{'name':_0x527104,'userProfileId':_0x3b272a[_0x5285('0x55')]},'raw':!![]})[_0x5285('0x14')](function(_0x9f42b1){if(_0x9f42b1&&_0x9f42b1[_0x5285('0x56')]===0x0){return db[_0x5285('0x2d')][_0x5285('0x4f')]({'name':_0x5907d3[_0x5285('0x2e')],'resourceId':_0x5907d3['id'],'type':_0x9f42b1[_0x5285('0x2e')],'sectionId':_0x9f42b1['id']},{})['then'](function(){return _0x20c87f;});}else{return _0x20c87f;}})['catch'](function(_0x53cde0){logger['error'](_0x5285('0x57'),_0x53cde0);throw _0x53cde0;});}return _0x20c87f;})['then'](respondWithResult(_0x340050,0xc9))[_0x5285('0x1e')](handleError(_0x340050,null));};exports[_0x5285('0x29')]=function(_0x28cfb4,_0x18081c){if(_0x28cfb4[_0x5285('0x50')]['id']){delete _0x28cfb4[_0x5285('0x50')]['id'];}return db[_0x5285('0x32')][_0x5285('0x4e')]({'where':{'id':_0x28cfb4['params']['id']},'include':[{'model':db['Pause'],'as':_0x5285('0x31')}]})['then'](handleEntityNotFound(_0x18081c,null))[_0x5285('0x14')](saveUpdates(_0x28cfb4[_0x5285('0x50')],null))['then'](respondWithResult(_0x18081c,null))[_0x5285('0x1e')](handleError(_0x18081c,null));};exports[_0x5285('0x2a')]=function(_0x34ff8f,_0x4b36ad){return db[_0x5285('0x32')][_0x5285('0x4e')]({'where':{'id':_0x34ff8f[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x4b36ad,null))['then'](removeEntity(_0x4b36ad,null))[_0x5285('0x1e')](handleError(_0x4b36ad,null));};exports['describe']=function(_0x2140f1,_0xf526a7){return db['ChatWebsite'][_0x5285('0x58')]()[_0x5285('0x14')](respondWithResult(_0xf526a7,null))[_0x5285('0x1e')](handleError(_0xf526a7,null));};exports[_0x5285('0x59')]=function(_0x5eb3e9,_0x587d88){if(_0x5eb3e9['body']['id']){delete _0x5eb3e9[_0x5285('0x50')]['id'];}return db[_0x5285('0x32')][_0x5285('0x4e')]({'where':{'id':_0x5eb3e9[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x587d88,null))[_0x5285('0x14')](function(_0x31ede1){if(_0x31ede1){_0x5eb3e9[_0x5285('0x50')][_0x5285('0x5a')]=_0x31ede1['id'];return db[_0x5285('0x5b')][_0x5285('0x4f')](_0x5eb3e9['body']);}})[_0x5285('0x14')](respondWithResult(_0x587d88,null))['catch'](handleError(_0x587d88,null));};exports[_0x5285('0x5c')]=function(_0x1607c2,_0xd10661){var _0x4495f7={'raw':![],'where':{}};var _0x3e38ca={};var _0x2b2945={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5285('0x5d')]({'where':{'id':_0x1607c2['params']['id']}})['then'](handleEntityNotFound(_0xd10661,null))[_0x5285('0x14')](function(_0x2a7428){if(_0x2a7428){_0x3e38ca['model']=_[_0x5285('0x38')](db[_0x5285('0x5b')]['rawAttributes']);_0x3e38ca['query']=_[_0x5285('0x38')](_0x1607c2['query']);_0x3e38ca['filters']=_[_0x5285('0x39')](_0x3e38ca[_0x5285('0x36')],_0x3e38ca[_0x5285('0x3a')]);_0x4495f7[_0x5285('0x3b')]=_[_0x5285('0x39')](_0x3e38ca[_0x5285('0x36')],qs[_0x5285('0x3c')](_0x1607c2['query'][_0x5285('0x3c')]));_0x4495f7[_0x5285('0x3b')]=_0x4495f7[_0x5285('0x3b')]['length']?_0x4495f7[_0x5285('0x3b')]:_0x3e38ca['model'];if(!_0x1607c2[_0x5285('0x3a')][_0x5285('0x5e')]('nolimit')){_0x4495f7[_0x5285('0x24')]=qs[_0x5285('0x24')](_0x1607c2[_0x5285('0x3a')]['limit']);_0x4495f7[_0x5285('0x22')]=qs[_0x5285('0x22')](_0x1607c2[_0x5285('0x3a')][_0x5285('0x22')]);}_0x4495f7[_0x5285('0x3f')]=qs[_0x5285('0x40')](_0x1607c2[_0x5285('0x3a')][_0x5285('0x40')]);_0x4495f7[_0x5285('0x41')]=qs[_0x5285('0x42')](_[_0x5285('0x43')](_0x1607c2[_0x5285('0x3a')],_0x3e38ca['filters']));_0x4495f7['where'][_0x5285('0x5a')]=_0x2a7428['id'];if(_0x1607c2[_0x5285('0x3a')][_0x5285('0x44')]){_0x4495f7['where']=_[_0x5285('0x45')](_0x4495f7[_0x5285('0x41')],{'$or':_['map'](_0x4495f7['attributes'],function(_0x371840){var _0x5b5908={};_0x5b5908[_0x371840]={'$like':'%'+_0x1607c2[_0x5285('0x3a')]['filter']+'%'};return _0x5b5908;})});}_0x4495f7=_[_0x5285('0x45')]({},_0x4495f7,_0x1607c2[_0x5285('0x47')]);return db['Disposition'][_0x5285('0x25')]({'where':_0x4495f7[_0x5285('0x41')]})[_0x5285('0x14')](function(_0x38723a){_0x2b2945['count']=_0x38723a;if(_0x1607c2['query'][_0x5285('0x4c')]){_0x4495f7[_0x5285('0x4d')]=[{'all':!![]}];}return db[_0x5285('0x5b')][_0x5285('0x48')](_0x4495f7);})['then'](function(_0x4a47c6){_0x2b2945['rows']=_0x4a47c6;return _0x2b2945;});}})['then'](respondWithFilteredResult(_0xd10661,_0x4495f7))['catch'](handleError(_0xd10661,null));};exports['removeDispositions']=function(_0x32d4de,_0x5da5a9){return db['ChatWebsite'][_0x5285('0x4e')]({'where':{'id':_0x32d4de[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x5da5a9,null))[_0x5285('0x14')](function(_0x282a63){if(_0x282a63){return _0x282a63[_0x5285('0x5f')](_0x32d4de[_0x5285('0x3a')][_0x5285('0x60')]);}})[_0x5285('0x14')](respondWithStatusCode(_0x5da5a9,null))[_0x5285('0x1e')](handleError(_0x5da5a9,null));};exports['addAnswer']=function(_0x139afe,_0x34608b){if(_0x139afe[_0x5285('0x50')]['id']){delete _0x139afe[_0x5285('0x50')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x139afe[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x34608b,null))['then'](function(_0x1ca826){if(_0x1ca826){_0x139afe[_0x5285('0x50')][_0x5285('0x5a')]=_0x1ca826['id'];return db[_0x5285('0x61')]['create'](_0x139afe[_0x5285('0x50')]);}})[_0x5285('0x14')](respondWithResult(_0x34608b,null))[_0x5285('0x1e')](handleError(_0x34608b,null));};exports[_0x5285('0x62')]=function(_0x1ad334,_0x35e0d0){var _0x57ebb2={'raw':![],'where':{}};var _0x1d9bf2={};var _0x3f9738={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5285('0x5d')]({'where':{'id':_0x1ad334[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x35e0d0,null))[_0x5285('0x14')](function(_0xf8eb9f){if(_0xf8eb9f){_0x1d9bf2[_0x5285('0x36')]=_[_0x5285('0x38')](db[_0x5285('0x61')]['rawAttributes']);_0x1d9bf2[_0x5285('0x3a')]=_[_0x5285('0x38')](_0x1ad334[_0x5285('0x3a')]);_0x1d9bf2[_0x5285('0x42')]=_[_0x5285('0x39')](_0x1d9bf2['model'],_0x1d9bf2[_0x5285('0x3a')]);_0x57ebb2['attributes']=_[_0x5285('0x39')](_0x1d9bf2['model'],qs['fields'](_0x1ad334[_0x5285('0x3a')]['fields']));_0x57ebb2[_0x5285('0x3b')]=_0x57ebb2[_0x5285('0x3b')]['length']?_0x57ebb2[_0x5285('0x3b')]:_0x1d9bf2['model'];if(!_0x1ad334['query'][_0x5285('0x5e')](_0x5285('0x3e'))){_0x57ebb2['limit']=qs[_0x5285('0x24')](_0x1ad334[_0x5285('0x3a')]['limit']);_0x57ebb2[_0x5285('0x22')]=qs[_0x5285('0x22')](_0x1ad334[_0x5285('0x3a')]['offset']);}_0x57ebb2[_0x5285('0x3f')]=qs[_0x5285('0x40')](_0x1ad334[_0x5285('0x3a')]['sort']);_0x57ebb2[_0x5285('0x41')]=qs[_0x5285('0x42')](_[_0x5285('0x43')](_0x1ad334[_0x5285('0x3a')],_0x1d9bf2[_0x5285('0x42')]));_0x57ebb2[_0x5285('0x41')][_0x5285('0x5a')]=_0xf8eb9f['id'];if(_0x1ad334['query']['filter']){_0x57ebb2[_0x5285('0x41')]=_['merge'](_0x57ebb2['where'],{'$or':_[_0x5285('0x37')](_0x57ebb2[_0x5285('0x3b')],function(_0x3ef656){var _0x5f36df={};_0x5f36df[_0x3ef656]={'$like':'%'+_0x1ad334[_0x5285('0x3a')]['filter']+'%'};return _0x5f36df;})});}_0x57ebb2=_[_0x5285('0x45')]({},_0x57ebb2,_0x1ad334['options']);return db[_0x5285('0x61')][_0x5285('0x25')]({'where':_0x57ebb2[_0x5285('0x41')]})[_0x5285('0x14')](function(_0x50af44){_0x3f9738['count']=_0x50af44;if(_0x1ad334['query']['includeAll']){_0x57ebb2['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x57ebb2);})[_0x5285('0x14')](function(_0x5c9dca){_0x3f9738[_0x5285('0x49')]=_0x5c9dca;return _0x3f9738;});}})['then'](respondWithFilteredResult(_0x35e0d0,_0x57ebb2))[_0x5285('0x1e')](handleError(_0x35e0d0,null));};exports[_0x5285('0x63')]=function(_0x148a5,_0x3e7516){return db[_0x5285('0x32')]['find']({'where':{'id':_0x148a5[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x3e7516,null))[_0x5285('0x14')](function(_0x3b4716){if(_0x3b4716){return _0x3b4716[_0x5285('0x63')](_0x148a5[_0x5285('0x3a')][_0x5285('0x60')]);}})[_0x5285('0x14')](respondWithStatusCode(_0x3e7516,null))[_0x5285('0x1e')](handleError(_0x3e7516,null));};exports[_0x5285('0x64')]=function(_0x5b46ed,_0x161a39){_0x5b46ed[_0x5285('0x50')][_0x5285('0x65')]=_0x5b46ed[_0x5285('0x66')][_0x5285('0x67')];return db[_0x5285('0x32')][_0x5285('0x4e')]({'where':{'id':_0x5b46ed['params']['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x161a39,null))[_0x5285('0x14')](saveUpdates(_0x5b46ed[_0x5285('0x50')],null))['then'](respondWithResult(_0x161a39,null))[_0x5285('0x1e')](handleError(_0x161a39,null));};exports[_0x5285('0x68')]=function(_0x56a23c,_0x1f9819){_0x56a23c['body'][_0x5285('0x69')]=_0x56a23c[_0x5285('0x66')]['filename'];return db[_0x5285('0x32')][_0x5285('0x4e')]({'where':{'id':_0x56a23c[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x1f9819,null))[_0x5285('0x14')](saveUpdates(_0x56a23c[_0x5285('0x50')],null))['then'](respondWithResult(_0x1f9819,null))['catch'](handleError(_0x1f9819,null));};exports[_0x5285('0x6a')]=function(_0x29b545,_0x4453e1){_0x29b545['body'][_0x5285('0x6b')]=_0x29b545[_0x5285('0x66')]['filename'];return db[_0x5285('0x32')][_0x5285('0x4e')]({'where':{'id':_0x29b545['params']['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x4453e1,null))[_0x5285('0x14')](saveUpdates(_0x29b545['body'],null))[_0x5285('0x14')](respondWithResult(_0x4453e1,null))['catch'](handleError(_0x4453e1,null));};exports[_0x5285('0x6c')]=function(_0x142ae3,_0x515a3c){_0x142ae3['body']['systemAvatar']=_0x142ae3[_0x5285('0x66')][_0x5285('0x67')];return db[_0x5285('0x32')]['find']({'where':{'id':_0x142ae3['params']['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x515a3c,null))['then'](saveUpdates(_0x142ae3[_0x5285('0x50')],null))['then'](respondWithResult(_0x515a3c,null))[_0x5285('0x1e')](handleError(_0x515a3c,null));};exports[_0x5285('0x6d')]=function(_0x32f4b4,_0x33aa27){var _0x23dbbb=path[_0x5285('0x6e')](config[_0x5285('0x6f')],_0x5285('0x70'));var _0x56b295={'where':{'id':_0x32f4b4[_0x5285('0x4b')]['id']},'attributes':['id',_0x5285('0x65')],'raw':!![]};var _0x248630=![];return require(_0x5285('0x71'))[_0x5285('0x72')]()[_0x5285('0x14')](function(_0x58e998){if(_0x58e998){_0x248630=_0x58e998[_0x5285('0x73')];}})[_0x5285('0x14')](function(){return db[_0x5285('0x32')][_0x5285('0x4e')](_0x56b295);})[_0x5285('0x14')](handleEntityNotFound(_0x33aa27,null))[_0x5285('0x14')](function(_0x306115){if(_0x306115){if(!_[_0x5285('0x74')](_0x306115[_0x5285('0x65')])){if(fs[_0x5285('0x75')](path['join'](config[_0x5285('0x6f')],_0x5285('0x76'),_0x306115[_0x5285('0x65')]))&&_0x248630){_0x23dbbb=path[_0x5285('0x6e')](config[_0x5285('0x6f')],_0x5285('0x76'),_0x306115['sitepic']);}}return _0x33aa27[_0x5285('0x77')](_0x23dbbb);}})[_0x5285('0x1e')](handleError(_0x33aa27,null));};exports[_0x5285('0x78')]=function(_0x123efc,_0x421e9e){var _0x424bd4=path[_0x5285('0x6e')](config[_0x5285('0x6f')],'server/files/images/avatars/default_avatar.png');var _0x4ae946={'where':{'id':_0x123efc['params']['id']},'attributes':['id',_0x5285('0x69')],'raw':!![]};return db[_0x5285('0x32')][_0x5285('0x4e')](_0x4ae946)[_0x5285('0x14')](handleEntityNotFound(_0x421e9e,null))[_0x5285('0x14')](function(_0x2bce98){if(_0x2bce98){if(!_[_0x5285('0x74')](_0x2bce98[_0x5285('0x69')])){if(fs['existsSync'](path[_0x5285('0x6e')](config[_0x5285('0x6f')],_0x5285('0x79'),_0x2bce98[_0x5285('0x69')]))){_0x424bd4=path[_0x5285('0x6e')](config[_0x5285('0x6f')],_0x5285('0x79'),_0x2bce98[_0x5285('0x69')]);}}return _0x421e9e['download'](_0x424bd4);}})['catch'](handleError(_0x421e9e,null));};exports[_0x5285('0x7a')]=function(_0x1a8cdc,_0x25ece1){var _0x303cb6=path[_0x5285('0x6e')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x22a080={'where':{'id':_0x1a8cdc[_0x5285('0x4b')]['id']},'attributes':['id',_0x5285('0x6b'),_0x5285('0x7b')],'raw':!![]};return db[_0x5285('0x32')]['find'](_0x22a080)[_0x5285('0x14')](handleEntityNotFound(_0x25ece1,null))['then'](function(_0x2fae62){if(_0x2fae62){if(!_[_0x5285('0x74')](_0x2fae62[_0x5285('0x6b')])){if(fs[_0x5285('0x75')](path[_0x5285('0x6e')](config[_0x5285('0x6f')],_0x5285('0x79'),_0x2fae62[_0x5285('0x6b')]))&&_0x2fae62[_0x5285('0x7b')]){_0x303cb6=path['join'](config[_0x5285('0x6f')],_0x5285('0x79'),_0x2fae62[_0x5285('0x6b')]);}}return _0x25ece1[_0x5285('0x77')](_0x303cb6);}})[_0x5285('0x1e')](handleError(_0x25ece1,null));};exports[_0x5285('0x7c')]=function(_0x51dbcc,_0x49f336){var _0x395e4f=path[_0x5285('0x6e')](config[_0x5285('0x6f')],_0x5285('0x7d'));var _0x301104={'where':{'id':_0x51dbcc[_0x5285('0x4b')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x5285('0x4e')](_0x301104)[_0x5285('0x14')](handleEntityNotFound(_0x49f336,null))[_0x5285('0x14')](function(_0x5c3c45){if(_0x5c3c45){if(!_[_0x5285('0x74')](_0x5c3c45[_0x5285('0x7e')])){if(fs[_0x5285('0x75')](path['join'](config[_0x5285('0x6f')],'server/files/images/avatars/',_0x5c3c45[_0x5285('0x7e')]))){_0x395e4f=path[_0x5285('0x6e')](config['root'],_0x5285('0x79'),_0x5c3c45['systemAvatar']);}}return _0x49f336['download'](_0x395e4f);}})['catch'](handleError(_0x49f336,null));};exports[_0x5285('0x7f')]=function(_0x4e94fb,_0x571e5b){var _0x1d2f44=require(_0x5285('0x80'));var _0x5a3ed2=new _0x1d2f44();var _0x3046df=_0x5a3ed2[_0x5285('0x81')](_0x4e94fb['headers'][_0x5285('0x82')])[_0x5285('0x83')]();var _0x494ff4={'body':_0x4e94fb['body'],'channel':_0x5285('0x84')};var _0x3b3036=[];var _0x1ac0c=[];var _0x4113b8={};var _0x47b43e=![];return db['CmContact'][_0x5285('0x58')]()[_0x5285('0x14')](function(_0x230964){if(!_0x230964){throw new db['Sequelize'][(_0x5285('0x85'))](_0x5285('0x86'));}_0x3b3036=_[_0x5285('0x87')](_[_0x5285('0x38')](_0x230964),['createdAt','updatedAt']);_0x1ac0c=_['difference'](_['keys'](_0x230964),['createdAt',_0x5285('0x88'),'CompanyId','ListId']);if(_0x4e94fb[_0x5285('0x50')]['id']){delete _0x4e94fb['body']['id'];}if(_[_0x5285('0x74')](_0x4e94fb[_0x5285('0x50')][_0x5285('0x89')])){throw new db[(_0x5285('0x8a'))][(_0x5285('0x85'))](_0x5285('0x8b'));}if(_[_0x5285('0x74')](_0x4e94fb['body'][_0x5285('0x50')])||_0x4e94fb['body'][_0x5285('0x50')]===''){throw new db[(_0x5285('0x8a'))][(_0x5285('0x85'))](_0x5285('0x8c'));}if(_[_0x5285('0x74')](_0x4e94fb['body'][_0x5285('0x8d')])){throw new db[(_0x5285('0x8a'))]['ValidationError'](_0x5285('0x8e')+_0x1ac0c);}if(!_[_0x5285('0x8f')](_0x1ac0c,_0x4e94fb[_0x5285('0x50')]['mapKey'])){throw new db[(_0x5285('0x8a'))][(_0x5285('0x85'))](_0x5285('0x90')+_0x1ac0c);}_0x4113b8[_0x4e94fb['body'][_0x5285('0x8d')]]=_0x4e94fb[_0x5285('0x50')][_0x5285('0x89')];})[_0x5285('0x14')](function(){return db['ChatWebsite'][_0x5285('0x4e')]({'where':{'id':_0x4e94fb[_0x5285('0x4b')]['id']},'include':[{'model':db[_0x5285('0x91')],'as':_0x5285('0x92'),'include':[{'model':db[_0x5285('0x93')],'as':'Contacts','where':_0x4113b8,'limit':0x1,'order':[[_0x5285('0x88'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x5285('0x94')}]});})[_0x5285('0x14')](handleEntityNotFound(_0x571e5b,null))['then'](function(_0x2ed938){if(_0x2ed938&&_0x2ed938[_0x5285('0x92')]){_0x494ff4[_0x5285('0x95')]=_0x2ed938;_0x494ff4[_0x5285('0x96')]=_0x2ed938[_0x5285('0x94')];_0x494ff4['list']=_0x2ed938[_0x5285('0x92')];_0x494ff4[_0x5285('0x96')]=_[_0x5285('0x97')](_0x494ff4[_0x5285('0x96')],[_0x5285('0x98')],[_0x5285('0x99')]);if(_0x494ff4[_0x5285('0x95')][_0x5285('0x94')]){delete _0x494ff4[_0x5285('0x95')][_0x5285('0x94')];}if(_0x494ff4[_0x5285('0x95')][_0x5285('0x92')]&&_0x494ff4[_0x5285('0x95')][_0x5285('0x92')][_0x5285('0x9a')]['length']){return _0x494ff4[_0x5285('0x95')][_0x5285('0x92')][_0x5285('0x9a')][0x0];}var _0x432abf=_[_0x5285('0x9b')](_0x4e94fb[_0x5285('0x50')],{'firstName':_0x4e94fb['body'][_0x5285('0x89')],'ListId':_0x2ed938[_0x5285('0x9c')]});_0x432abf[_0x4e94fb['body'][_0x5285('0x8d')]]=_0x4e94fb['body']['from'];return db['CmContact'][_0x5285('0x4f')](_0x432abf,{'fields':_0x3b3036,'raw':!![]});}})[_0x5285('0x14')](handleEntityNotFound(_0x571e5b,null))[_0x5285('0x14')](function(_0x3c93d7){_0x494ff4[_0x5285('0x9d')]=_0x3c93d7;var _0x311ae4=_0x4e94fb[_0x5285('0x50')][_0x5285('0x9e')];if(_0x4e94fb[_0x5285('0x9f')][_0x5285('0xa0')]){_0x311ae4=_0x4e94fb[_0x5285('0x9f')]['cf-connecting-ip'];}else if(_0x4e94fb[_0x5285('0x9f')]['x-forwarded-for']){_0x311ae4=_[_0x5285('0xa1')](_0x4e94fb[_0x5285('0x9f')][_0x5285('0xa2')][_0x5285('0xa3')](','));}if(_0x3c93d7){var _0x175311={'ContactId':_0x3c93d7['id'],'ChatWebsiteId':_0x4e94fb[_0x5285('0x4b')]['id'],'from':(_0x3c93d7['firstName']||'')+'\x20'+(_0x3c93d7[_0x5285('0xa4')]||''),'customerIp':_0x311ae4,'customerPort':_0x4e94fb[_0x5285('0x9f')][_0x5285('0xa5')]?_0x4e94fb['headers'][_0x5285('0xa5')]:null,'referer':_0x4e94fb[_0x5285('0x50')]['referer'],'browserName':_0x3046df['browser'][_0x5285('0x2e')]&&_0x3046df[_0x5285('0xa6')][_0x5285('0xa7')]?util[_0x5285('0xa8')]('%s\x20%s',_0x3046df[_0x5285('0xa6')][_0x5285('0x2e')],_0x3046df[_0x5285('0xa6')]['version']):_0x5285('0xa9'),'browserVersion':_0x3046df[_0x5285('0xa6')][_0x5285('0xa7')]||_0x5285('0xa9'),'osName':util[_0x5285('0xa8')](_0x5285('0xaa'),_0x3046df['os'][_0x5285('0x2e')],_0x3046df['os'][_0x5285('0xa7')]),'osVersion':_0x3046df['os'][_0x5285('0xa7')],'deviceModel':_0x3046df[_0x5285('0xab')][_0x5285('0x36')]&&_0x3046df['device'][_0x5285('0xac')]?util[_0x5285('0xa8')](_0x5285('0xad'),_0x3046df['device'][_0x5285('0x36')],_0x3046df[_0x5285('0xab')][_0x5285('0xac')],_0x3046df[_0x5285('0xab')][_0x5285('0x46')]):null,'deviceVendor':_0x3046df[_0x5285('0xab')][_0x5285('0xac')],'deviceType':_0x3046df[_0x5285('0xab')]['type'],'formData':JSON[_0x5285('0x19')](_0x4e94fb['body'])};var _0x569840={'ChatWebsiteId':_0x4e94fb[_0x5285('0x4b')]['id'],'closed':![]};if(_0x4e94fb[_0x5285('0x50')]['threadId']){_0x569840[_0x5285('0xae')]=_0x4e94fb[_0x5285('0x50')][_0x5285('0xae')];return db[_0x5285('0xaf')][_0x5285('0x4e')]({'where':_0x569840})[_0x5285('0x14')](function(_0x23c7c3){if(_0x23c7c3){return[_0x23c7c3,![]];}_0x175311[_0x5285('0xae')]=_0x4e94fb['body'][_0x5285('0xae')];_0x175311[_0x5285('0xb0')]=_0x4e94fb[_0x5285('0x50')]['externalUrl'];return db[_0x5285('0xaf')][_0x5285('0x4f')](_0x175311)['then'](function(_0x4e4a13){return[_0x4e4a13,!![]];});});}_0x569840[_0x5285('0xb1')]=_0x3c93d7['id'];if(_0x4e94fb['body'][_0x5285('0xb2')]&&_0x4e94fb[_0x5285('0x50')]['interaction']['id']){_0x569840['id']=_0x4e94fb[_0x5285('0x50')][_0x5285('0xb2')]['id'];return db[_0x5285('0xaf')][_0x5285('0x4e')]({'where':_0x569840})['then'](function(_0x1964f3){if(_0x1964f3){return[_0x1964f3,![]];}return db[_0x5285('0xaf')][_0x5285('0x4f')](_0x175311)[_0x5285('0x14')](function(_0x3f4081){return[_0x3f4081,!![]];});});}return db[_0x5285('0xaf')][_0x5285('0x4f')](_0x175311)[_0x5285('0x14')](function(_0x475043){return[_0x475043,!![]];});}})[_0x5285('0xb3')](function(_0x5b862c,_0x21db2d){if(_0x5b862c){_0x47b43e=_0x21db2d;if(!_0x21db2d){var _0x373066={'from':(_0x494ff4[_0x5285('0x9d')]['firstName']||'')+'\x20'+(_0x494ff4['contact']['lastName']||'')};if(_0x4e94fb[_0x5285('0x50')][_0x5285('0xae')]&&_0x4e94fb['body'][_0x5285('0xb4')]&&_0x4e94fb[_0x5285('0x50')][_0x5285('0xae')]!=_0x4e94fb['body'][_0x5285('0xb4')]){_0x373066[_0x5285('0xae')]=_0x4e94fb['body'][_0x5285('0xb4')];}return _0x5b862c[_0x5285('0x29')](_0x373066);}else{return _0x5b862c;}}})[_0x5285('0x14')](function(_0x3667f8){_0x494ff4[_0x5285('0xb2')]=_0x3667f8[_0x5285('0x2b')]({'plain':!![]});_0x494ff4[_0x5285('0xb2')]['created']=_0x47b43e;if(_0x494ff4[_0x5285('0xb2')]['created']){if(_0x494ff4['account']['autoclose']){_0x494ff4[_0x5285('0x96')][_0x5285('0xb5')]({'id':0x0,'priority':_0x494ff4[_0x5285('0x96')][_0x5285('0x3d')]+0x1,'app':_0x5285('0xb6'),'appdata':_0x5285('0xb7'),'interval':_0x5285('0xb8')});}}return db['ChatMessage'][_0x5285('0x4f')]({'body':_0x4e94fb[_0x5285('0x50')][_0x5285('0x50')],'ChatWebsiteId':_0x4e94fb[_0x5285('0x4b')]['id'],'ChatInteractionId':_0x3667f8['id'],'direction':'in','ContactId':_0x494ff4[_0x5285('0x9d')]['id'],'AttachmentId':_0x4e94fb[_0x5285('0x50')][_0x5285('0xb9')]});})[_0x5285('0x14')](function(_0x54282d){_0x494ff4[_0x5285('0x1c')]=_0x54282d;if(_0x494ff4[_0x5285('0xb2')]['UserId']){return db[_0x5285('0xba')][_0x5285('0x4e')]({'attributes':['id',_0x5285('0x2e')],'where':{'id':_0x494ff4[_0x5285('0xb2')]['UserId']}})[_0x5285('0x14')](function(_0x389403){if(_0x389403){_0x494ff4['applications'][_0x5285('0xbb')]({'id':0x0,'priority':0x0,'app':_0x5285('0xbc'),'appdata':_0x389403[_0x5285('0x2e')]+','+(_0x494ff4[_0x5285('0x95')][_0x5285('0xbd')]||0xa),'interval':_0x5285('0xb8')});_0x494ff4['forcedOwnership']=!![];}return respondWithRpcPromise(_0x5285('0xbe'),_0x5285('0xbf'),_0x494ff4);});}return respondWithRpcPromise(_0x5285('0xbe'),_0x5285('0xbf'),_0x494ff4);})[_0x5285('0x14')](function(_0x491133){respondWithRpcPromise('EventManager',_0x5285('0xc0'),{'event':'notify','message':_0x491133},client9002);return _0x491133;})['then'](respondWithResult(_0x571e5b,null))[_0x5285('0x1e')](handleError(_0x571e5b,null));};exports[_0x5285('0xc1')]=function(_0x583648,_0x203fd0){var _0x412282,_0x254b89,_0x121252;var _0x753535=[];var _0x5aca84={};var _0x3cdaad=_0x583648['files']||[];var _0x2350b5=[];var _0x560a91;return db[_0x5285('0x93')][_0x5285('0x58')]()['then'](function(_0x40ede7){if(!_0x40ede7){throw new db['Sequelize'][(_0x5285('0x85'))](_0x5285('0x86'));}_0x753535=_[_0x5285('0x87')](_[_0x5285('0x38')](_0x40ede7),[_0x5285('0xc2'),_0x5285('0x88'),_0x5285('0xc3'),_0x5285('0x9c')]);if(_0x583648[_0x5285('0x50')]['id']){delete _0x583648[_0x5285('0x50')]['id'];}if(_['isNil'](_0x583648[_0x5285('0x50')][_0x5285('0x89')])){throw _0x203fd0[_0x5285('0x20')](0x1f4)[_0x5285('0x2f')](new db[(_0x5285('0x8a'))][(_0x5285('0x85'))]('from\x20is\x20mandatory'));}if(_[_0x5285('0x74')](_0x583648['body'][_0x5285('0x50')])||_0x583648[_0x5285('0x50')][_0x5285('0x50')]===''){throw _0x203fd0['status'](0x1f4)['send'](new db[(_0x5285('0x8a'))]['ValidationError'](_0x5285('0x8c')));}if(_['isNil'](_0x583648['body'][_0x5285('0xc4')])){throw _0x203fd0['status'](0x1f4)[_0x5285('0x2f')](new db['Sequelize'][(_0x5285('0x85'))](_0x5285('0xc5')+_0x753535));}if(!_[_0x5285('0x8f')](_0x753535,_0x583648[_0x5285('0x50')][_0x5285('0xc4')])){throw _0x203fd0['status'](0x1f4)[_0x5285('0x2f')](new db[(_0x5285('0x8a'))]['ValidationError'](_0x5285('0xc6')+_0x753535));}_0x5aca84[_0x583648['body'][_0x5285('0xc4')]]=_0x583648['body']['from'];})[_0x5285('0x14')](function(){return db[_0x5285('0x32')][_0x5285('0x4e')]({'where':{'id':_0x583648['params']['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x5285('0xc7')],'as':_0x5285('0xc7')}]});})['then'](handleEntityNotFound(_0x203fd0,null))['then'](function(_0xc62c4e){if(_0xc62c4e&&_0xc62c4e[_0x5285('0x92')]){_0x254b89=_0xc62c4e;var _0x5092a1=_[_0x5285('0x9b')](_0x583648['body'],{'firstName':_0x583648['body'][_0x5285('0x89')],'phone':_0x583648[_0x5285('0x50')][_0x5285('0x89')],'ListId':_0xc62c4e[_0x5285('0x9c')]});_0x5092a1[_0x583648[_0x5285('0x50')]['mapKeyOffline']]=_0x583648['body']['from'];return db[_0x5285('0x93')]['findOrCreate']({'where':_0x5aca84,'defaults':_0x5092a1});}})[_0x5285('0xb3')](function(_0x52d397){if(_0x52d397){_0x121252=_0x52d397;var _0xb3e76=fs[_0x5285('0xc8')](path[_0x5285('0x6e')](config['root'],_0x5285('0xc9')),'utf8');var _0x5251fc=ejs['render'](_0xb3e76,{'body':_['toPairs'](_0x583648[_0x5285('0x50')][_0x5285('0x50')]),'bodyTitle':_0x254b89['offlineMessageBody']});return db['ChatOfflineMessage']['create']({'body':_0x5251fc,'plainBody':htmlToText[_0x5285('0xca')](_0x5251fc),'ContactId':_0x52d397['id'],'ChatWebsiteId':_0x254b89['id']});}})[_0x5285('0x14')](function(_0x3f6dd9){_0x560a91=_0x3f6dd9;if(_0x3cdaad[_0x5285('0x3d')]){var _0x2f66ba=_0x3cdaad[_0x5285('0x37')](function(_0x55d9e9){return{'name':_0x55d9e9[_0x5285('0xcb')],'basename':_0x55d9e9[_0x5285('0x67')],'type':_0x55d9e9['mimetype'],'ChatOfflineMessageId':_0x3f6dd9['id']};});_0x2350b5=_0x2f66ba[_0x5285('0x37')](_0x58333d=>{var _0x171364={'filename':_0x58333d[_0x5285('0x2e')],'path':path[_0x5285('0x6e')](config['root'],_0x5285('0xcc'),_0x5285('0xcd'),'attachments',_0x5285('0xce'),_0x58333d['basename'])};return _0x171364;});if(!_0x254b89[_0x5285('0xcf')]){return db[_0x5285('0xd0')][_0x5285('0xd1')](function(_0x2a74e9){return db[_0x5285('0xd2')][_0x5285('0xd3')](_0x2f66ba,{'transaction':_0x2a74e9});});}}})[_0x5285('0x14')](function(){if(_0x560a91){_0x412282=_0x560a91;return db[_0x5285('0xc7')][_0x5285('0x5d')]({'where':{'service':!![]},'include':[{'model':db[_0x5285('0xd4')],'as':_0x5285('0xd5'),'raw':!![],'include':[{'model':db[_0x5285('0xd6')],'as':_0x5285('0xd6'),'raw':!![]}]}]});}})[_0x5285('0x14')](function(_0x25983e){if(_0x25983e&&_0x25983e[_0x5285('0xd5')]&&_0x254b89[_0x5285('0xd7')]&&_0x254b89['forwardOfflineAddress']){var _0x3a2263=_0x25983e[_0x5285('0xd8')]();return respondWithRpcPromise('SendMail',_0x5285('0xd9'),{'account':_0x3a2263,'message':{'from':util[_0x5285('0xa8')](_0x5285('0xda'),_0x25983e['name'],_0x25983e[_0x5285('0xdb')]||_0x25983e[_0x5285('0xd5')][_0x5285('0x53')]),'to':_0x254b89['forwardOfflineAddress'],'subject':_0x254b89[_0x5285('0xdc')],'html':_0x412282[_0x5285('0x50')],'attachments':_0x2350b5}},client9003)['then'](function(){return _0x412282;})[_0x5285('0x1e')](function(_0x2cae73){logger[_0x5285('0x1a')](_0x2cae73);});}})[_0x5285('0x14')](function(){if(_0x254b89&&_0x254b89['openNewInteraction']&&_0x254b89[_0x5285('0xdd')]){var _0x4bdcac=[];if(_0x3cdaad[_0x5285('0x3d')]){_0x4bdcac=_0x3cdaad[_0x5285('0x37')](function(_0x300055){return{'name':_0x300055['originalname'],'basename':_0x300055[_0x5285('0x67')],'type':_0x300055[_0x5285('0xde')],'ChatOfflineMessageId':_0x560a91['id']};});}var _0x5e2e19;if(!_['isNil'](_0x254b89[_0x5285('0xdf')])){var _0x129381=_['map'](_0x583648[_0x5285('0x50')],function(_0xd55e07){return _0xd55e07;});var _0x3baaa2=_[_0x5285('0xe0')](_0x129381)[0x0];var _0x3da01b=_[_0x5285('0xe1')](_0x3baaa2,function(_0x38b9fe){return _0x38b9fe;});_0x5e2e19=_0x3da01b[0x1][_0x254b89[_0x5285('0xdf')]];}var _0x199f58={'from':_0x121252[_0x5285('0xdb')],'firstName':_0x121252[_0x5285('0xe2')],'lastName':_0x121252['lastName'],'mapKey':_0x5285('0xdb'),'message':{'from':_0x121252[_0x5285('0xdb')],'to':_0x254b89['MailAccount']['email'],'cc':'','subject':_[_0x5285('0x74')](_0x5e2e19)?_0x254b89[_0x5285('0xdc')]:_0x5e2e19,'messageId':'','sentAt':new Date(),'attach':_0x4bdcac[_0x5285('0x3d')],'attachments':_0x4bdcac,'originChannel':_0x5285('0xe3'),'ChatWebsiteId':_0x254b89['id'],'ChatOfflineMessageId':_0x412282['id'],'originTo':_0x254b89['MailAccount']['email']},'body':_0x412282[_0x5285('0x50')]};var _0x418f5e={'account':{'id':_0x254b89['MailAccountId']},'body':_0x199f58,'log':_0x5285('0xe4')};return respondWithRpcPromise(_0x5285('0xe4'),_0x5285('0xe5'),_0x418f5e,client9001)['then'](function(){return _0x412282;})[_0x5285('0x1e')](function(_0x7bfee6){logger[_0x5285('0x1a')](_0x7bfee6);});}return;})['then'](function(){if(_0x412282){return _0x412282;}})[_0x5285('0x14')](respondWithResult(_0x203fd0,null))['catch'](function(_0x2323b4){logger[_0x5285('0x1a')](_0x5285('0x1e'),_0x2323b4);for(var _0x14aa04 of _0x3cdaad){var _0x56519e=path[_0x5285('0x6e')](config[_0x5285('0x6f')],_0x5285('0xcc'),_0x5285('0xcd'),_0x5285('0xe6'),_0x5285('0xce'),_0x14aa04[_0x5285('0x67')]);fs_extra['remove'](_0x56519e)[_0x5285('0x1e')](function(_0xa0e321){logger[_0x5285('0x1a')](_0x5285('0xe7'),_0x56519e,_0xa0e321);});}});};exports[_0x5285('0xe8')]=function(_0xe2e70f,_0x1590c9){return db[_0x5285('0xaf')][_0x5285('0x4e')]({'where':{'id':_0xe2e70f[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x1590c9,null))[_0x5285('0x14')](function(_0x48a71b){if(_0x48a71b){return _0x48a71b[_0x5285('0xe8')](_0xe2e70f['body']['ids'],_[_0x5285('0xe9')](_0xe2e70f['body'],[_0x5285('0x60'),'id'])||{});}})['then'](respondWithResult(_0x1590c9,null))['catch'](handleError(_0x1590c9,null));};exports[_0x5285('0xea')]=function(_0x154f6c,_0x57a245){var _0x25fc76={'raw':![],'where':{}};var _0xfff2c0={};var _0x1dc484={'count':0x0,'rows':[]};return db[_0x5285('0x32')][_0x5285('0x5d')]({'where':{'id':_0x154f6c[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x57a245,null))[_0x5285('0x14')](function(_0xb0c156){if(_0xb0c156){_0xfff2c0[_0x5285('0x36')]=_[_0x5285('0x38')](db[_0x5285('0xaf')][_0x5285('0x33')]);_0xfff2c0[_0x5285('0x3a')]=_['keys'](_0x154f6c['query']);_0xfff2c0['filters']=_['intersection'](_0xfff2c0[_0x5285('0x36')],_0xfff2c0['query']);_0x25fc76[_0x5285('0x3b')]=_[_0x5285('0x39')](_0xfff2c0[_0x5285('0x36')],qs['fields'](_0x154f6c[_0x5285('0x3a')][_0x5285('0x3c')]));_0x25fc76['attributes']=_0x25fc76[_0x5285('0x3b')][_0x5285('0x3d')]?_0x25fc76[_0x5285('0x3b')]:_0xfff2c0[_0x5285('0x36')];if(!_0x154f6c[_0x5285('0x3a')]['hasOwnProperty']('nolimit')){_0x25fc76[_0x5285('0x24')]=qs[_0x5285('0x24')](_0x154f6c['query'][_0x5285('0x24')]);_0x25fc76[_0x5285('0x22')]=qs[_0x5285('0x22')](_0x154f6c[_0x5285('0x3a')][_0x5285('0x22')]);}_0x25fc76[_0x5285('0x3f')]=qs[_0x5285('0x40')](_0x154f6c['query'][_0x5285('0x40')]);_0x25fc76['where']=qs['filters'](_[_0x5285('0x43')](_0x154f6c[_0x5285('0x3a')],_0xfff2c0[_0x5285('0x42')]));_0x25fc76[_0x5285('0x41')][_0x5285('0x5a')]=_0xb0c156['id'];if(_0x154f6c[_0x5285('0x3a')][_0x5285('0x44')]){_0x25fc76[_0x5285('0x41')]=_[_0x5285('0x45')](_0x25fc76[_0x5285('0x41')],{'$or':_[_0x5285('0x37')](_0x25fc76['attributes'],function(_0xf28d9f){var _0x8b2651={};_0x8b2651[_0xf28d9f]={'$like':'%'+_0x154f6c[_0x5285('0x3a')][_0x5285('0x44')]+'%'};return _0x8b2651;})});}_0x25fc76=_[_0x5285('0x45')]({},_0x25fc76,_0x154f6c['options']);return db[_0x5285('0xaf')][_0x5285('0x25')]({'where':_0x25fc76[_0x5285('0x41')]})[_0x5285('0x14')](function(_0x69c89){_0x1dc484[_0x5285('0x25')]=_0x69c89;if(_0x154f6c[_0x5285('0x3a')][_0x5285('0x4c')]){_0x25fc76[_0x5285('0x4d')]=[{'model':db[_0x5285('0x93')],'as':_0x5285('0xeb'),'required':![]},{'model':db[_0x5285('0xba')],'as':'Owner','attributes':['name',_0x5285('0xec'),_0x5285('0xed')],'required':![]},{'model':db['Tag'],'as':_0x5285('0xee'),'attributes':['id',_0x5285('0x2e'),'color'],'where':_0x154f6c[_0x5285('0x3a')][_0x5285('0xef')]?{'id':_0x154f6c[_0x5285('0x3a')]['tag']}:undefined,'required':_0x154f6c[_0x5285('0x3a')][_0x5285('0xef')]?!![]:![]}];}return db['ChatInteraction'][_0x5285('0x48')](_0x25fc76);})[_0x5285('0x14')](function(_0x50b30a){_0x1dc484['rows']=_0x50b30a;return _0x1dc484;});}})['then'](respondWithFilteredResult(_0x57a245,_0x25fc76))[_0x5285('0x1e')](handleError(_0x57a245,null));};function iftimePromise(_0x45922c,_0xd5c408){return respondWithRpcPromise(_0x5285('0xf0'),_0x5285('0xf1'),{'command':_0xd5c408[_0x5285('0xf2')]?util[_0x5285('0xa8')](_0x5285('0xf3'),_0x45922c[_0x5285('0xf4')],_0xd5c408[_0x5285('0xf2')]):util[_0x5285('0xa8')](_0x5285('0xf5'),_0x45922c[_0x5285('0xf4')])},client9002)[_0x5285('0x14')](function(_0x8449c3){var _0x181a10=_0x8449c3&&_0x8449c3[_0x5285('0xf6')](_0x5285('0xf7'))>=0x0?!![]:![];logger[_0x5285('0x15')](_0x5285('0xf8'),_0xd5c408['id'],_0x45922c['id'],_0x45922c['interval'],_0x181a10?_0x5285('0xf9'):_0x5285('0xfa'),_0xd5c408[_0x5285('0xf2')]?_0xd5c408[_0x5285('0xf2')]:_0x5285('0xfb'));return _0x181a10;})[_0x5285('0x1e')](function(_0x9fed3b){logger[_0x5285('0x1a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xd5c408['id'],_0x45922c['id'],_0x45922c[_0x5285('0xf4')],util[_0x5285('0xfc')](_0x9fed3b,{'showHidden':![],'depth':null}),_0xd5c408[_0x5285('0xf2')]?_0xd5c408[_0x5285('0xf2')]:_0x5285('0xfb'));return![];});}exports['getSnippet']=function(_0x324c73,_0x5297e2){var _0x556b77=0x0;var _0x37cb49=0x0;var _0x7318d4=![];var _0x536930;var _0x473815;return db['ChatWebsite']['find']({'where':{'id':_0x324c73[_0x5285('0x4b')]['id']},'include':[{'model':db[_0x5285('0xfd')],'as':_0x5285('0xfd'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x5285('0xf4')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x5297e2,null))['then'](function(_0x33c118){if(_0x33c118){_0x536930=_0x33c118;return _0x33c118[_0x5285('0xfe')]({'raw':!![]});}})[_0x5285('0x14')](function(_0x2f9e8a){if(_0x536930){if(_0x2f9e8a){_0x473815=_0x2f9e8a;}}return require(_0x5285('0x71'))[_0x5285('0x72')]();})['then'](function(_0x98c13e){if(_0x98c13e){_0x37cb49=_0x98c13e[_0x5285('0xff')];_0x7318d4=_0x98c13e[_0x5285('0x73')];}})[_0x5285('0x14')](function(){return db['ChatInteraction'][_0x5285('0x25')]({'where':{'closed':![]}});})[_0x5285('0x14')](function(_0x4de760){_0x556b77=_0x4de760;if(_0x37cb49&&_0x4de760>_0x37cb49){return db[_0x5285('0x100')][_0x5285('0x5d')]({'where':{'id':0x1}})[_0x5285('0x14')](function(_0x5a89ce){if(_0x5a89ce){_0x5a89ce[_0x5285('0x101')](_0x5285('0x102'));}});}})[_0x5285('0x14')](function(){if(_0x536930[_0x5285('0xfd')]&&_0x536930[_0x5285('0xfd')][_0x5285('0x103')]){var _0x4db063=[];for(var _0x37a076=0x0;_0x37a076<_0x536930['Interval'][_0x5285('0x103')][_0x5285('0x3d')];_0x37a076++){var _0x555ed2=_0x536930[_0x5285('0xfd')][_0x5285('0x103')][_0x37a076]['get']({'plain':!![]});_0x4db063['push'](iftimePromise(_0x555ed2,_0x536930));}return BPromise[_0x5285('0x104')](_0x4db063)[_0x5285('0x14')](function(_0x1160fe){return _[_0x5285('0x105')](_0x1160fe);});}else{return!![];}})[_0x5285('0x14')](function(_0x6b61a7){var _0x5ff249=fs[_0x5285('0xc8')](path[_0x5285('0x6e')](config[_0x5285('0x6f')],_0x5285('0x106')),'utf8');var _0x5741ff={'remote':_0x536930[_0x5285('0x107')],'query':querystring[_0x5285('0x19')](_[_0x5285('0x45')](_0x536930[_0x5285('0x2b')]({'plain':!![]}),{'customerIp':_0x324c73[_0x5285('0x9f')][_0x5285('0xa2')]||_0x324c73[_0x5285('0x9f')][_0x5285('0x108')]||_0x324c73[_0x5285('0x109')][_0x5285('0x10a')]||_0x324c73['ip'],'referer':_0x324c73[_0x5285('0x9f')][_0x5285('0x10b')],'openedInteractions':_0x556b77,'maxInteractions':_0x37cb49,'virtual':_0x7318d4[_0x5285('0xff')],'online':_0x6b61a7,'custom':_0x7318d4}))[_0x5285('0x10c')](/'/g,'\x5c\x27')};_0x5297e2['send'](ejs['render'](Mustache[_0x5285('0x10d')](_0x5ff249,_0x5741ff),{'proactiveActions':_0x473815,'alignment':_0x536930['alignment'],'verticalAlignment':_0x536930[_0x5285('0x10e')],'div_color':_0x536930[_0x5285('0x10f')],'labelText':_0x536930[_0x5285('0x110')],'text_color':_0x536930[_0x5285('0x111')],'text_button_color':_0x536930[_0x5285('0x112')],'button_color':_0x536930[_0x5285('0x113')],'background_color':_0x536930[_0x5285('0x114')],'hideWhenOffline':_0x536930[_0x5285('0x115')],'interval':_0x536930[_0x5285('0x116')]}));})[_0x5285('0x1e')](handleError(_0x5297e2,null));};exports[_0x5285('0x117')]=function(_0x3c182e,_0xdf989e){var _0x17c85a=_0x3c182e['params']['id'];var _0x16354f=_0x3c182e[_0x5285('0x50')];var _0x19ca61=0xc8;var _0x208c04=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x5285('0xd0')][_0x5285('0x118')][_0x5285('0x119')][_0x5285('0x11a')]},function(_0x432862){return db['ChatWebsite'][_0x5285('0x5d')]({'where':{'id':_0x17c85a},'transaction':_0x432862})[_0x5285('0x14')](function(_0x2bd98b){if(_0x2bd98b){return db[_0x5285('0x11b')][_0x5285('0x2a')]({'where':{'ChatWebsiteId':_0x17c85a},'transaction':_0x432862})[_0x5285('0x14')](function(){var _0x37f63f=_[_0x5285('0x37')](_0x16354f,function(_0x364574){_0x364574[_0x5285('0x5a')]=_0x17c85a;return _0x364574;});return db[_0x5285('0x11b')][_0x5285('0xd3')](_0x37f63f,{'transaction':_0x432862});});}else{_0x19ca61=0x194;_0x208c04=[];}});})[_0x5285('0x14')](function(){if(_0x19ca61!==0x194){return db['ChatApplication'][_0x5285('0x11c')]({'where':{'ChatWebsiteId':_0x17c85a},'order':_0x5285('0x98')})[_0x5285('0x14')](function(_0x100cde){_0x208c04=_0x100cde;});}})[_0x5285('0x1e')](function(_0x5e5deb){_0x19ca61=0x1f4;logger['error'](_0x5e5deb[_0x5285('0x11d')]);if(_0x5e5deb[_0x5285('0x2e')]){delete _0x5e5deb[_0x5285('0x2e')];}_0x208c04=_0x5e5deb;})[_0x5285('0x11e')](function(){if(_0x208c04===null){_0xdf989e[_0x5285('0x1f')](_0x19ca61);}else{if(_0x19ca61===0x1f4){_0xdf989e['status'](_0x19ca61)[_0x5285('0x2f')](_0x208c04);}else{_0xdf989e[_0x5285('0x20')](_0x19ca61)['json'](_0x208c04);}}});};exports[_0x5285('0x11f')]=function(_0x434595,_0x4c1091){var _0x57f616={};var _0x49e8eb={};var _0x378aaa;var _0x3af240;return db[_0x5285('0x32')][_0x5285('0x5d')]({'where':{'id':_0x434595[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x4c1091,null))['then'](function(_0x25155a){if(_0x25155a){_0x378aaa=_0x25155a;_0x49e8eb[_0x5285('0x36')]=_['keys'](db['ChatApplication'][_0x5285('0x33')]);_0x49e8eb[_0x5285('0x3a')]=_['keys'](_0x434595[_0x5285('0x3a')]);_0x49e8eb[_0x5285('0x42')]=_[_0x5285('0x39')](_0x49e8eb[_0x5285('0x36')],_0x49e8eb[_0x5285('0x3a')]);_0x57f616[_0x5285('0x3b')]=_[_0x5285('0x39')](_0x49e8eb[_0x5285('0x36')],qs['fields'](_0x434595['query'][_0x5285('0x3c')]));_0x57f616[_0x5285('0x3b')]=_0x57f616[_0x5285('0x3b')][_0x5285('0x3d')]?_0x57f616[_0x5285('0x3b')]:_0x49e8eb['model'];_0x57f616[_0x5285('0x3f')]=qs['sort'](_0x434595['query'][_0x5285('0x40')]);_0x57f616[_0x5285('0x41')]=qs[_0x5285('0x42')](_[_0x5285('0x43')](_0x434595['query'],_0x49e8eb[_0x5285('0x42')]));if(_0x434595[_0x5285('0x3a')][_0x5285('0x44')]){_0x57f616[_0x5285('0x41')]=_['merge'](_0x57f616[_0x5285('0x41')],{'$or':_[_0x5285('0x37')](_0x57f616['attributes'],function(_0x191045){var _0x3e8bc6={};_0x3e8bc6[_0x191045]={'$like':'%'+_0x434595[_0x5285('0x3a')][_0x5285('0x44')]+'%'};return _0x3e8bc6;})});}_0x57f616=_['merge']({},_0x57f616,_0x434595[_0x5285('0x47')]);return _0x378aaa['getApplications'](_0x57f616);}})[_0x5285('0x14')](function(_0x2687a){if(_0x2687a){_0x3af240=_0x2687a[_0x5285('0x3d')];if(!_0x434595['query']['hasOwnProperty'](_0x5285('0x3e'))){_0x57f616[_0x5285('0x24')]=qs['limit'](_0x434595[_0x5285('0x3a')][_0x5285('0x24')]);_0x57f616[_0x5285('0x22')]=qs[_0x5285('0x22')](_0x434595[_0x5285('0x3a')][_0x5285('0x22')]);}return _0x378aaa[_0x5285('0x11f')](_0x57f616);}})[_0x5285('0x14')](function(_0x4c2999){if(_0x4c2999){return _0x4c2999?{'count':_0x3af240,'rows':_0x4c2999}:null;}})['then'](respondWithResult(_0x4c1091,null))['catch'](handleError(_0x4c1091,null));};exports[_0x5285('0x120')]=function(_0xa52148,_0x54272f){return db[_0x5285('0x121')][_0x5285('0x4e')]({'where':{'id':_0xa52148[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x54272f,null))[_0x5285('0x14')](function(_0x33bf12){if(_0x33bf12){return _0x33bf12[_0x5285('0x120')](_0xa52148[_0x5285('0x50')][_0x5285('0x60')],_[_0x5285('0xe9')](_0xa52148[_0x5285('0x50')],['ids','id'])||{});}})[_0x5285('0x14')](respondWithResult(_0x54272f,null))[_0x5285('0x1e')](handleError(_0x54272f,null));};exports[_0x5285('0xfe')]=function(_0xfe4cef,_0x1573b6){var _0x36d201={};var _0x498c97={};var _0x327abf;var _0x4b8ed4;return db[_0x5285('0x32')][_0x5285('0x5d')]({'where':{'id':_0xfe4cef[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x1573b6,null))['then'](function(_0x346a6f){if(_0x346a6f){_0x327abf=_0x346a6f;_0x498c97[_0x5285('0x36')]=_[_0x5285('0x38')](db[_0x5285('0x122')]['rawAttributes']);_0x498c97[_0x5285('0x3a')]=_['keys'](_0xfe4cef[_0x5285('0x3a')]);_0x498c97[_0x5285('0x42')]=_[_0x5285('0x39')](_0x498c97[_0x5285('0x36')],_0x498c97[_0x5285('0x3a')]);_0x36d201['attributes']=_[_0x5285('0x39')](_0x498c97[_0x5285('0x36')],qs['fields'](_0xfe4cef['query'][_0x5285('0x3c')]));_0x36d201['attributes']=_0x36d201[_0x5285('0x3b')]['length']?_0x36d201[_0x5285('0x3b')]:_0x498c97['model'];_0x36d201['order']=qs[_0x5285('0x40')](_0xfe4cef[_0x5285('0x3a')][_0x5285('0x40')]);_0x36d201[_0x5285('0x41')]=qs[_0x5285('0x42')](_[_0x5285('0x43')](_0xfe4cef[_0x5285('0x3a')],_0x498c97['filters']));if(_0xfe4cef[_0x5285('0x3a')][_0x5285('0x44')]){_0x36d201['where']=_[_0x5285('0x45')](_0x36d201['where'],{'$or':_['map'](_0x36d201[_0x5285('0x3b')],function(_0xa59047){var _0x2d5913={};_0x2d5913[_0xa59047]={'$like':'%'+_0xfe4cef[_0x5285('0x3a')][_0x5285('0x44')]+'%'};return _0x2d5913;})});}_0x36d201=_[_0x5285('0x45')]({},_0x36d201,_0xfe4cef[_0x5285('0x47')]);return _0x327abf['getProactiveActions'](_0x36d201);}})[_0x5285('0x14')](function(_0x45525a){if(_0x45525a){_0x4b8ed4=_0x45525a[_0x5285('0x3d')];if(!_0xfe4cef['query'][_0x5285('0x5e')](_0x5285('0x3e'))){_0x36d201['limit']=qs[_0x5285('0x24')](_0xfe4cef[_0x5285('0x3a')][_0x5285('0x24')]);_0x36d201[_0x5285('0x22')]=qs[_0x5285('0x22')](_0xfe4cef['query'][_0x5285('0x22')]);}return _0x327abf[_0x5285('0xfe')](_0x36d201);}})[_0x5285('0x14')](function(_0x589e16){if(_0x589e16){return _0x589e16?{'count':_0x4b8ed4,'rows':_0x589e16}:null;}})['then'](respondWithResult(_0x1573b6,null))['catch'](handleError(_0x1573b6,null));};exports[_0x5285('0x123')]=function(_0x185513,_0x367b0a){var _0x76311c=_0x185513[_0x5285('0x3a')][_0x5285('0x124')]===_0x5285('0x125')?_0x5285('0x126'):_0x5285('0x127');return db[_0x5285('0x32')]['find']({'attributes':['id',_0x76311c],'where':{'id':_0x185513[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x367b0a,null))['then'](function(_0x30d732){if(_0x30d732){var _0x702c66=_0x30d732[_0x76311c];var _0x2c547e=_0x702c66&&_0x702c66[_0x5285('0x128')]?_0x702c66[_0x5285('0x128')]:[];_0x367b0a['send']({'fromKey':_[_0x5285('0x74')](_0x702c66[_0x5285('0x129')])?undefined:_0x702c66[_0x5285('0x129')],'count':_0x2c547e[_0x5285('0x3d')],'rows':_0x2c547e});}})[_0x5285('0x1e')](handleError(_0x367b0a,null));};exports[_0x5285('0x12a')]=function(_0x406de9,_0x5ed2d7){var _0x4aab7b={'raw':![],'where':{}};var _0x16b311={};var _0x5cbb01={'count':0x0,'rows':[]};return db[_0x5285('0x32')][_0x5285('0x5d')]({'where':{'id':_0x406de9[_0x5285('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5ed2d7,null))[_0x5285('0x14')](function(_0x41a7e6){if(_0x41a7e6){_0x16b311[_0x5285('0x36')]=_[_0x5285('0x38')](db['ChatOfflineMessage'][_0x5285('0x33')]);_0x16b311[_0x5285('0x3a')]=_['keys'](_0x406de9[_0x5285('0x3a')]);_0x16b311[_0x5285('0x42')]=_[_0x5285('0x39')](_0x16b311[_0x5285('0x36')],_0x16b311[_0x5285('0x3a')]);_0x4aab7b['attributes']=_[_0x5285('0x39')](_0x16b311[_0x5285('0x36')],qs[_0x5285('0x3c')](_0x406de9[_0x5285('0x3a')][_0x5285('0x3c')]));_0x4aab7b[_0x5285('0x3b')]=_0x4aab7b[_0x5285('0x3b')][_0x5285('0x3d')]?_0x4aab7b[_0x5285('0x3b')]:_0x16b311['model'];if(!_0x406de9[_0x5285('0x3a')][_0x5285('0x5e')]('nolimit')){_0x4aab7b['limit']=qs[_0x5285('0x24')](_0x406de9[_0x5285('0x3a')][_0x5285('0x24')]);_0x4aab7b[_0x5285('0x22')]=qs['offset'](_0x406de9[_0x5285('0x3a')][_0x5285('0x22')]);}_0x4aab7b[_0x5285('0x3f')]=qs[_0x5285('0x40')](_0x406de9[_0x5285('0x3a')][_0x5285('0x40')]);_0x4aab7b[_0x5285('0x41')]=qs[_0x5285('0x42')](_[_0x5285('0x43')](_0x406de9[_0x5285('0x3a')],_0x16b311[_0x5285('0x42')]));_0x4aab7b[_0x5285('0x41')][_0x5285('0x5a')]=_0x41a7e6['id'];if(_0x406de9[_0x5285('0x3a')][_0x5285('0x44')]){_0x4aab7b[_0x5285('0x41')]=_[_0x5285('0x45')](_0x4aab7b['where'],{'$or':_[_0x5285('0x37')](_0x4aab7b['attributes'],function(_0x1cce0e){var _0x2976d6={};_0x2976d6[_0x1cce0e]={'$like':'%'+_0x406de9['query'][_0x5285('0x44')]+'%'};return _0x2976d6;})});}_0x4aab7b=_[_0x5285('0x45')]({},_0x4aab7b,_0x406de9[_0x5285('0x47')]);return db[_0x5285('0x12b')][_0x5285('0x25')]({'where':_0x4aab7b[_0x5285('0x41')]})[_0x5285('0x14')](function(_0x35d67e){_0x5cbb01[_0x5285('0x25')]=_0x35d67e;if(_0x406de9[_0x5285('0x3a')][_0x5285('0x4c')]){_0x4aab7b[_0x5285('0x4d')]=[{'all':!![]}];}else{_0x4aab7b[_0x5285('0x4d')]=[{'model':db[_0x5285('0x93')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0x5285('0x12c'),'required':![]}];}return db[_0x5285('0x12b')][_0x5285('0x48')](_0x4aab7b);})[_0x5285('0x14')](function(_0x200e09){_0x5cbb01[_0x5285('0x49')]=_0x200e09;return _0x5cbb01;});}})[_0x5285('0x14')](respondWithFilteredResult(_0x5ed2d7,_0x4aab7b))[_0x5285('0x1e')](handleError(_0x5ed2d7,null));};exports[_0x5285('0x12d')]=function(_0xcfe4bb,_0x3328b1){return db[_0x5285('0x32')][_0x5285('0x4e')]({'where':{'id':_0xcfe4bb[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x3328b1,null))[_0x5285('0x14')](function(_0x2c296a){if(_0x2c296a){return _0x2c296a['addAgents'](_0xcfe4bb[_0x5285('0x50')][_0x5285('0x60')],_[_0x5285('0xe9')](_0xcfe4bb['body'],[_0x5285('0x60'),'id'])||{})['spread'](function(_0x5e8b5d){for(var _0x34064e=0x0;_0x34064e<_0xcfe4bb[_0x5285('0x50')][_0x5285('0x60')][_0x5285('0x3d')];_0x34064e+=0x1){socket[_0x5285('0x12e')](_0x5285('0x12f'),{'UserId':Number(_0xcfe4bb[_0x5285('0x50')][_0x5285('0x60')][_0x34064e]),'ChatWebsiteId':Number(_0xcfe4bb[_0x5285('0x4b')]['id'])});}return _0x5e8b5d;});}})[_0x5285('0x14')](respondWithResult(_0x3328b1,null))['catch'](handleError(_0x3328b1,null));};exports[_0x5285('0x130')]=function(_0x30b18c,_0x442401){return db[_0x5285('0x32')]['find']({'where':{'id':_0x30b18c['params']['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x442401,null))[_0x5285('0x14')](function(_0x3f3697){if(_0x3f3697){return _0x3f3697['removeAgents'](_0x30b18c[_0x5285('0x3a')][_0x5285('0x60')])[_0x5285('0x14')](function(){if(_[_0x5285('0x131')](_0x30b18c[_0x5285('0x3a')][_0x5285('0x60')])){for(var _0x4ba7ff=0x0;_0x4ba7ff<_0x30b18c[_0x5285('0x3a')][_0x5285('0x60')][_0x5285('0x3d')];_0x4ba7ff+=0x1){socket['emit'](_0x5285('0x132'),{'UserId':Number(_0x30b18c[_0x5285('0x3a')][_0x5285('0x60')][_0x4ba7ff]),'ChatWebsiteId':Number(_0x30b18c[_0x5285('0x4b')]['id'])});}}else{socket[_0x5285('0x12e')]('userChatWebsite:remove',{'UserId':Number(_0x30b18c[_0x5285('0x3a')][_0x5285('0x60')]),'ChatWebsiteId':Number(_0x30b18c[_0x5285('0x4b')]['id'])});}});}})[_0x5285('0x14')](respondWithStatusCode(_0x442401,null))[_0x5285('0x1e')](handleError(_0x442401,null));};exports['getAgents']=function(_0xb7bcb6,_0x1c5c49){var _0x5354b5={};var _0x53f65a={};var _0x22297b;var _0x1a88e9;return db[_0x5285('0x32')]['findOne']({'where':{'id':_0xb7bcb6[_0x5285('0x4b')]['id']}})[_0x5285('0x14')](handleEntityNotFound(_0x1c5c49,null))[_0x5285('0x14')](function(_0x2abdc3){if(_0x2abdc3){_0x22297b=_0x2abdc3;_0x53f65a[_0x5285('0x36')]=_[_0x5285('0x38')](db[_0x5285('0xba')][_0x5285('0x33')]);_0x53f65a[_0x5285('0x3a')]=_[_0x5285('0x38')](_0xb7bcb6[_0x5285('0x3a')]);_0x53f65a[_0x5285('0x42')]=_[_0x5285('0x39')](_0x53f65a[_0x5285('0x36')],_0x53f65a['query']);_0x5354b5[_0x5285('0x3b')]=_[_0x5285('0x39')](_0x53f65a[_0x5285('0x36')],qs[_0x5285('0x3c')](_0xb7bcb6[_0x5285('0x3a')]['fields']));_0x5354b5[_0x5285('0x3b')]=_0x5354b5[_0x5285('0x3b')][_0x5285('0x3d')]?_0x5354b5[_0x5285('0x3b')]:_0x53f65a['model'];_0x5354b5[_0x5285('0x3f')]=qs[_0x5285('0x40')](_0xb7bcb6['query'][_0x5285('0x40')]);_0x5354b5[_0x5285('0x41')]=qs['filters'](_['pick'](_0xb7bcb6['query'],_0x53f65a['filters']));if(_0xb7bcb6['query'][_0x5285('0x44')]){_0x5354b5[_0x5285('0x41')]=_[_0x5285('0x45')](_0x5354b5[_0x5285('0x41')],{'$or':_[_0x5285('0x37')](_0x5354b5['attributes'],function(_0x4da0db){var _0x4fd74f={};_0x4fd74f[_0x4da0db]={'$like':'%'+_0xb7bcb6[_0x5285('0x3a')][_0x5285('0x44')]+'%'};return _0x4fd74f;})});}_0x5354b5=_[_0x5285('0x45')]({},_0x5354b5,_0xb7bcb6['options']);return _0x22297b['getAgents'](_0x5354b5);}})['then'](function(_0x1eba62){if(_0x1eba62){_0x1a88e9=_0x1eba62[_0x5285('0x3d')];if(!_0xb7bcb6[_0x5285('0x3a')]['hasOwnProperty'](_0x5285('0x3e'))){_0x5354b5[_0x5285('0x24')]=qs[_0x5285('0x24')](_0xb7bcb6[_0x5285('0x3a')][_0x5285('0x24')]);_0x5354b5[_0x5285('0x22')]=qs[_0x5285('0x22')](_0xb7bcb6['query'][_0x5285('0x22')]);}return _0x22297b[_0x5285('0x133')](_0x5354b5);}})[_0x5285('0x14')](function(_0x55d942){if(_0x55d942){return _0x55d942?{'count':_0x1a88e9,'rows':_0x55d942}:null;}})['then'](respondWithResult(_0x1c5c49,null))[_0x5285('0x1e')](handleError(_0x1c5c49,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 286cbc2..3944842 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 _0x7a2d=['hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a2d,0x142));var _0xd7a2=function(_0x5281fb,_0x3c091d){_0x5281fb=_0x5281fb-0x0;var _0x14b6e9=_0x7a2d[_0x5281fb];return _0x14b6e9;};'use strict';var EventEmitter=require(_0xd7a2('0x0'));var ChatWebsite=require(_0xd7a2('0x1'))['db'][_0xd7a2('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd7a2('0x3')](0x0);var events={'afterCreate':_0xd7a2('0x4'),'afterUpdate':_0xd7a2('0x5'),'afterDestroy':_0xd7a2('0x6')};function emitEvent(_0x4b5379){return function(_0x500472,_0x7370d9,_0x146786){ChatWebsiteEvents[_0xd7a2('0x7')](_0x4b5379+':'+_0x500472['id'],_0x500472);ChatWebsiteEvents[_0xd7a2('0x7')](_0x4b5379,_0x500472);_0x146786(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xd7a2('0x8')](e,emitEvent(event));}}module[_0xd7a2('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x95d9=['ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x10ab33,_0x2baf3d){var _0x1b6f44=function(_0x3670af){while(--_0x3670af){_0x10ab33['push'](_0x10ab33['shift']());}};_0x1b6f44(++_0x2baf3d);}(_0x95d9,0x97));var _0x995d=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x95d9[_0x16d10f];return _0x50c823;};'use strict';var EventEmitter=require(_0x995d('0x0'));var ChatWebsite=require(_0x995d('0x1'))['db'][_0x995d('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x995d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x995d('0x4'),'afterDestroy':_0x995d('0x5')};function emitEvent(_0x1932c3){return function(_0x5b44d3,_0x225c17,_0x14e096){ChatWebsiteEvents[_0x995d('0x6')](_0x1932c3+':'+_0x5b44d3['id'],_0x5b44d3);ChatWebsiteEvents[_0x995d('0x6')](_0x1932c3,_0x5b44d3);_0x14e096(null);};}for(var e in events){if(events[_0x995d('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x995d('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 41f3044..2cbbe0f 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 _0x30b1=['moment','path','../../config/environment','./chatWebsite.attributes','define','chat_websites','lodash','util','../../config/logger','api'];(function(_0x265a86,_0x4bfa53){var _0x37c033=function(_0xb96339){while(--_0xb96339){_0x265a86['push'](_0x265a86['shift']());}};_0x37c033(++_0x4bfa53);}(_0x30b1,0x16e));var _0x130b=function(_0x5877f0,_0x5e3cba){_0x5877f0=_0x5877f0-0x0;var _0x59a00d=_0x30b1[_0x5877f0];return _0x59a00d;};'use strict';var _=require(_0x130b('0x0'));var util=require(_0x130b('0x1'));var logger=require(_0x130b('0x2'))(_0x130b('0x3'));var moment=require(_0x130b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x130b('0x5'));var rimraf=require('rimraf');var config=require(_0x130b('0x6'));var attributes=require(_0x130b('0x7'));module['exports']=function(_0x255f0f,_0x1f61a3){return _0x255f0f[_0x130b('0x8')]('ChatWebsite',attributes,{'tableName':_0x130b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8013=['../../config/environment','./chatWebsite.attributes','chat_websites','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x50bace,_0x16f8b7){var _0x25dc5e=function(_0x52340c){while(--_0x52340c){_0x50bace['push'](_0x50bace['shift']());}};_0x25dc5e(++_0x16f8b7);}(_0x8013,0x186));var _0x3801=function(_0x21524e,_0x46a290){_0x21524e=_0x21524e-0x0;var _0x565275=_0x8013[_0x21524e];return _0x565275;};'use strict';var _=require(_0x3801('0x0'));var util=require(_0x3801('0x1'));var logger=require(_0x3801('0x2'))('api');var moment=require(_0x3801('0x3'));var BPromise=require(_0x3801('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3801('0x5'));var rimraf=require('rimraf');var config=require(_0x3801('0x6'));var attributes=require(_0x3801('0x7'));module['exports']=function(_0x1665f4,_0xaa4de5){return _0x1665f4['define']('ChatWebsite',attributes,{'tableName':_0x3801('0x8'),'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 104d49f..9e9c95e 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 _0x93f8=['socket.io-emitter','register','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x44a4d1,_0x8a1ec0){var _0x35dd2e=function(_0x364650){while(--_0x364650){_0x44a4d1['push'](_0x44a4d1['shift']());}};_0x35dd2e(++_0x8a1ec0);}(_0x93f8,0x19c));var _0x893f=function(_0xaaf5a6,_0x4fcaf7){_0xaaf5a6=_0xaaf5a6-0x0;var _0xa50e57=_0x93f8[_0xaaf5a6];return _0xa50e57;};'use strict';var _=require(_0x893f('0x0'));var util=require('util');var moment=require(_0x893f('0x1'));var BPromise=require('bluebird');var rs=require(_0x893f('0x2'));var fs=require('fs');var Redis=require(_0x893f('0x3'));var db=require(_0x893f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x893f('0x5'))(_0x893f('0x6'));var config=require('../../config/environment');var jayson=require(_0x893f('0x7'));var client=jayson[_0x893f('0x8')][_0x893f('0x9')]({'port':0x232a});config['redis']=_[_0x893f('0xa')](config[_0x893f('0xb')],{'host':_0x893f('0xc'),'port':0x18eb});var socket=require(_0x893f('0xd'))(new Redis(config[_0x893f('0xb')]));require('./chatWebsite.socket')[_0x893f('0xe')](socket);function respondWithRpcPromise(_0x4fde71,_0x3623a7,_0x2422a4){return new BPromise(function(_0x4d653d,_0x3e0b31){return client['request'](_0x4fde71,_0x2422a4)[_0x893f('0xf')](function(_0x5ef303){logger[_0x893f('0x10')](_0x893f('0x11'),_0x3623a7,'request\x20sent');logger[_0x893f('0x12')](_0x893f('0x13'),_0x3623a7,_0x893f('0x14'),JSON[_0x893f('0x15')](_0x5ef303));if(_0x5ef303[_0x893f('0x16')]){if(_0x5ef303['error'][_0x893f('0x17')]===0x1f4){logger['error'](_0x893f('0x11'),_0x3623a7,_0x5ef303['error'][_0x893f('0x18')]);return _0x3e0b31(_0x5ef303['error'][_0x893f('0x18')]);}logger[_0x893f('0x16')](_0x893f('0x11'),_0x3623a7,_0x5ef303[_0x893f('0x16')]['message']);return _0x4d653d(_0x5ef303['error']['message']);}else{logger[_0x893f('0x10')](_0x893f('0x11'),_0x3623a7,_0x893f('0x14'));_0x4d653d(_0x5ef303['result'][_0x893f('0x18')]);}})['catch'](function(_0x21428f){logger[_0x893f('0x16')](_0x893f('0x11'),_0x3623a7,_0x21428f);_0x3e0b31(_0x21428f);});});} \ No newline at end of file +var _0x599a=['debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','request\x20sent'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x599a,0xbd));var _0xa599=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x599a[_0x213518];return _0x1baf75;};'use strict';var _=require(_0xa599('0x0'));var util=require('util');var moment=require(_0xa599('0x1'));var BPromise=require(_0xa599('0x2'));var rs=require(_0xa599('0x3'));var fs=require('fs');var Redis=require(_0xa599('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa599('0x5'))(_0xa599('0x6'));var config=require(_0xa599('0x7'));var jayson=require(_0xa599('0x8'));var client=jayson[_0xa599('0x9')][_0xa599('0xa')]({'port':0x232a});config[_0xa599('0xb')]=_[_0xa599('0xc')](config[_0xa599('0xb')],{'host':_0xa599('0xd'),'port':0x18eb});var socket=require(_0xa599('0xe'))(new Redis(config['redis']));require(_0xa599('0xf'))[_0xa599('0x10')](socket);function respondWithRpcPromise(_0x6fee34,_0x1751ce,_0x353e55){return new BPromise(function(_0x314bd1,_0x42037c){return client[_0xa599('0x11')](_0x6fee34,_0x353e55)[_0xa599('0x12')](function(_0x2b9b94){logger[_0xa599('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x1751ce,_0xa599('0x14'));logger[_0xa599('0x15')](_0xa599('0x16'),_0x1751ce,'request\x20sent',JSON[_0xa599('0x17')](_0x2b9b94));if(_0x2b9b94[_0xa599('0x18')]){if(_0x2b9b94[_0xa599('0x18')][_0xa599('0x19')]===0x1f4){logger['error'](_0xa599('0x1a'),_0x1751ce,_0x2b9b94['error'][_0xa599('0x1b')]);return _0x42037c(_0x2b9b94[_0xa599('0x18')][_0xa599('0x1b')]);}logger['error'](_0xa599('0x1a'),_0x1751ce,_0x2b9b94[_0xa599('0x18')][_0xa599('0x1b')]);return _0x314bd1(_0x2b9b94['error']['message']);}else{logger[_0xa599('0x13')](_0xa599('0x1a'),_0x1751ce,_0xa599('0x14'));_0x314bd1(_0x2b9b94[_0xa599('0x1c')]['message']);}})[_0xa599('0x1d')](function(_0x5e9362){logger[_0xa599('0x18')](_0xa599('0x1a'),_0x1751ce,_0x5e9362);_0x42037c(_0x5e9362);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 7f00eae..1c58b0c 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 _0xb306=['chatWebsite:','./chatWebsite.events','save','remove','removeListener','length'];(function(_0x401609,_0x5eb61d){var _0x35fd57=function(_0x5dcddd){while(--_0x5dcddd){_0x401609['push'](_0x401609['shift']());}};_0x35fd57(++_0x5eb61d);}(_0xb306,0x10f));var _0x6b30=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb306[_0x321bb2];return _0x9c12ed;};'use strict';var ChatWebsiteEvents=require(_0x6b30('0x0'));var events=[_0x6b30('0x1'),_0x6b30('0x2'),'update'];function createListener(_0x162d1e,_0x55dbf9){return function(_0x409ec1){_0x55dbf9['emit'](_0x162d1e,_0x409ec1);};}function removeListener(_0x35a640,_0x322ad8){return function(){ChatWebsiteEvents[_0x6b30('0x3')](_0x35a640,_0x322ad8);};}exports['register']=function(_0x479757){for(var _0x4f014c=0x0,_0x1c9d2a=events[_0x6b30('0x4')];_0x4f014c<_0x1c9d2a;_0x4f014c++){var _0x5e528b=events[_0x4f014c];var _0x146bbf=createListener(_0x6b30('0x5')+_0x5e528b,_0x479757);ChatWebsiteEvents['on'](_0x5e528b,_0x146bbf);}}; \ No newline at end of file +var _0x0005=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update','emit'];(function(_0x22312b,_0x1f0890){var _0x48748b=function(_0x451582){while(--_0x451582){_0x22312b['push'](_0x22312b['shift']());}};_0x48748b(++_0x1f0890);}(_0x0005,0x15a));var _0x5000=function(_0x139d45,_0x27981b){_0x139d45=_0x139d45-0x0;var _0x4d5f49=_0x0005[_0x139d45];return _0x4d5f49;};'use strict';var ChatWebsiteEvents=require(_0x5000('0x0'));var events=[_0x5000('0x1'),_0x5000('0x2'),_0x5000('0x3')];function createListener(_0x59aab5,_0x5a52a3){return function(_0x437175){_0x5a52a3[_0x5000('0x4')](_0x59aab5,_0x437175);};}function removeListener(_0x470c7b,_0x4d0aae){return function(){ChatWebsiteEvents[_0x5000('0x5')](_0x470c7b,_0x4d0aae);};}exports[_0x5000('0x6')]=function(_0x227d71){for(var _0x28d4f8=0x0,_0x165ca4=events[_0x5000('0x7')];_0x28d4f8<_0x165ca4;_0x28d4f8++){var _0x234b98=events[_0x28d4f8];var _0x412b13=createListener(_0x5000('0x8')+_0x234b98,_0x227d71);ChatWebsiteEvents['on'](_0x234b98,_0x412b13);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index ff2a9c2..fe55527 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 _0x940b=['addApplications','addProactiveActions','addAgents','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','originalname','file','addLogo','format','%s-%s','now','single','addAvatar','root','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x940b,0x117));var _0xb940=function(_0x5e1175,_0x2a76bb){_0x5e1175=_0x5e1175-0x0;var _0x440414=_0x940b[_0x5e1175];return _0x440414;};'use strict';var multer=require(_0xb940('0x0'));var util=require(_0xb940('0x1'));var path=require(_0xb940('0x2'));var timeout=require(_0xb940('0x3'));var express=require('express');var router=express[_0xb940('0x4')]();var fs_extra=require(_0xb940('0x5'));var auth=require(_0xb940('0x6'));var interaction=require(_0xb940('0x7'));var config=require(_0xb940('0x8'));var controller=require('./chatWebsite.controller');router[_0xb940('0x9')]('/',auth[_0xb940('0xa')](),controller[_0xb940('0xb')]);router['get'](_0xb940('0xc'),auth[_0xb940('0xa')](),controller['describe']);router[_0xb940('0x9')](_0xb940('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xb940('0x9')]('/:id/dispositions',auth[_0xb940('0xa')](),controller['getDispositions']);router['get'](_0xb940('0xe'),auth[_0xb940('0xa')](),controller['getAnswers']);router[_0xb940('0x9')](_0xb940('0xf'),controller[_0xb940('0x10')]);router['get'](_0xb940('0x11'),controller[_0xb940('0x12')]);router['get'](_0xb940('0x13'),controller[_0xb940('0x14')]);router[_0xb940('0x9')]('/:id/system_avatar',controller[_0xb940('0x15')]);router['get'](_0xb940('0x16'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xb940('0x9')](_0xb940('0x17'),controller['getSnippet']);router[_0xb940('0x9')](_0xb940('0x18'),auth['isAuthenticated'](),controller[_0xb940('0x19')]);router[_0xb940('0x9')](_0xb940('0x1a'),auth[_0xb940('0xa')](),controller['getProactiveActions']);router[_0xb940('0x9')](_0xb940('0x1b'),controller[_0xb940('0x1c')]);router[_0xb940('0x9')](_0xb940('0x1d'),auth[_0xb940('0xa')](),controller['getOfflineMessages']);router[_0xb940('0x9')](_0xb940('0x1e'),auth[_0xb940('0xa')](),controller[_0xb940('0x1f')]);router[_0xb940('0x20')]('/',auth[_0xb940('0xa')](),controller['create']);router[_0xb940('0x20')](_0xb940('0x21'),auth[_0xb940('0xa')](),controller[_0xb940('0x22')]);router['post'](_0xb940('0xe'),auth[_0xb940('0xa')](),controller[_0xb940('0x23')]);var upload=multer({'storage':multer[_0xb940('0x24')]({'destination':function(_0xb2dd39,_0x18cbd6,_0x33e5c2){_0x33e5c2(null,path[_0xb940('0x25')](config['root'],_0xb940('0x26')));},'filename':function(_0x2de12d,_0x47e608,_0xf64fc4){_0xf64fc4(null,util['format']('%s-%s',Date['now'](),_0x47e608[_0xb940('0x27')]));}})});router[_0xb940('0x20')](_0xb940('0xf'),upload['single'](_0xb940('0x28')),controller[_0xb940('0x29')]);var upload=multer({'storage':multer[_0xb940('0x24')]({'destination':function(_0x2ff572,_0x51fde0,_0x6ebb37){_0x6ebb37(null,path[_0xb940('0x25')](config['root'],'server/files/images/avatars/'));},'filename':function(_0xc7d5dd,_0x4123d2,_0x4bdc4e){_0x4bdc4e(null,util[_0xb940('0x2a')](_0xb940('0x2b'),Date[_0xb940('0x2c')](),_0x4123d2['originalname']));}})});router[_0xb940('0x20')](_0xb940('0x11'),upload[_0xb940('0x2d')](_0xb940('0x28')),controller[_0xb940('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5f17f2,_0x469ef7,_0x437150){_0x437150(null,path[_0xb940('0x25')](config[_0xb940('0x2f')],_0xb940('0x30')));},'filename':function(_0x134df2,_0x583198,_0x34a752){_0x34a752(null,util['format'](_0xb940('0x2b'),Date[_0xb940('0x2c')](),_0x583198[_0xb940('0x27')]));}})});router[_0xb940('0x20')](_0xb940('0x13'),upload[_0xb940('0x2d')](_0xb940('0x28')),controller[_0xb940('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2eabf3,_0x1d8231,_0x107db9){_0x107db9(null,path[_0xb940('0x25')](config[_0xb940('0x2f')],_0xb940('0x30')));},'filename':function(_0x292edf,_0x23a1b6,_0xfac6f6){_0xfac6f6(null,util[_0xb940('0x2a')](_0xb940('0x2b'),Date[_0xb940('0x2c')](),_0x23a1b6['originalname']));}})});router[_0xb940('0x20')]('/:id/system_avatar',upload['single'](_0xb940('0x28')),controller[_0xb940('0x32')]);router[_0xb940('0x20')](_0xb940('0x33'),controller[_0xb940('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xb940('0x24')]({'destination':function(_0x1ab398,_0x35938b,_0x4a5134){const _0x2fdf51=path[_0xb940('0x25')](config[_0xb940('0x2f')],_0xb940('0x35'),_0xb940('0x36'),_0xb940('0x37'));fs_extra[_0xb940('0x38')](_0x2fdf51,function(){_0x4a5134(null,_0x2fdf51);});},'filename':function(_0x204ee9,_0x429538,_0x30a3b5){const _0x575b33=_0x429538[_0xb940('0x27')][_0xb940('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x41a75f=path['extname'](_0x575b33);const _0x213edd=Date[_0xb940('0x2c')]()+'-'+_0x575b33[_0xb940('0x39')](_0x41a75f,'')+_0x41a75f;_0x30a3b5(null,_0x213edd);}})});router[_0xb940('0x20')](_0xb940('0x3a'),offlineUploadMulter[_0xb940('0x3b')](),controller['offline']);router['post'](_0xb940('0x16'),auth[_0xb940('0xa')](),controller[_0xb940('0x3c')]);router[_0xb940('0x20')](_0xb940('0x18'),auth['isAuthenticated'](),controller[_0xb940('0x3d')]);router['post']('/:id/proactive_actions',auth[_0xb940('0xa')](),controller[_0xb940('0x3e')]);router['post'](_0xb940('0x1e'),auth[_0xb940('0xa')](),controller[_0xb940('0x3f')]);router['put']('/:id',auth[_0xb940('0xa')](),controller[_0xb940('0x40')]);router[_0xb940('0x41')](_0xb940('0xd'),auth[_0xb940('0xa')](),controller[_0xb940('0x42')]);router[_0xb940('0x41')](_0xb940('0x21'),auth[_0xb940('0xa')](),controller['removeDispositions']);router['delete'](_0xb940('0xe'),auth[_0xb940('0xa')](),controller['removeAnswers']);router['delete'](_0xb940('0x1e'),auth['isAuthenticated'](),controller[_0xb940('0x43')]);module['exports']=router; \ No newline at end of file +var _0x4c4c=['/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','/:id/applications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/notify','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addApplications','/:id/proactive_actions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo'];(function(_0x3714a4,_0x63e53c){var _0xb50db1=function(_0x5eeee6){while(--_0x5eeee6){_0x3714a4['push'](_0x3714a4['shift']());}};_0xb50db1(++_0x63e53c);}(_0x4c4c,0x106));var _0xc4c4=function(_0x2a18dd,_0x10eb94){_0x2a18dd=_0x2a18dd-0x0;var _0x412ea5=_0x4c4c[_0x2a18dd];return _0x412ea5;};'use strict';var multer=require(_0xc4c4('0x0'));var util=require(_0xc4c4('0x1'));var path=require(_0xc4c4('0x2'));var timeout=require(_0xc4c4('0x3'));var express=require('express');var router=express[_0xc4c4('0x4')]();var fs_extra=require(_0xc4c4('0x5'));var auth=require(_0xc4c4('0x6'));var interaction=require(_0xc4c4('0x7'));var config=require('../../config/environment');var controller=require(_0xc4c4('0x8'));router[_0xc4c4('0x9')]('/',auth[_0xc4c4('0xa')](),controller['index']);router[_0xc4c4('0x9')]('/describe',auth[_0xc4c4('0xa')](),controller[_0xc4c4('0xb')]);router[_0xc4c4('0x9')]('/:id',auth[_0xc4c4('0xa')](),controller[_0xc4c4('0xc')]);router[_0xc4c4('0x9')](_0xc4c4('0xd'),auth[_0xc4c4('0xa')](),controller[_0xc4c4('0xe')]);router[_0xc4c4('0x9')](_0xc4c4('0xf'),auth['isAuthenticated'](),controller[_0xc4c4('0x10')]);router[_0xc4c4('0x9')](_0xc4c4('0x11'),controller['getLogo']);router[_0xc4c4('0x9')](_0xc4c4('0x12'),controller['getAvatar']);router[_0xc4c4('0x9')](_0xc4c4('0x13'),controller[_0xc4c4('0x14')]);router[_0xc4c4('0x9')](_0xc4c4('0x15'),controller[_0xc4c4('0x16')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0xc4c4('0x9')](_0xc4c4('0x17'),controller[_0xc4c4('0x18')]);router['get'](_0xc4c4('0x19'),auth[_0xc4c4('0xa')](),controller['getApplications']);router[_0xc4c4('0x9')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xc4c4('0x1a')]);router[_0xc4c4('0x9')](_0xc4c4('0x1b'),controller[_0xc4c4('0x1c')]);router[_0xc4c4('0x9')](_0xc4c4('0x1d'),auth[_0xc4c4('0xa')](),controller[_0xc4c4('0x1e')]);router[_0xc4c4('0x9')](_0xc4c4('0x1f'),auth[_0xc4c4('0xa')](),controller[_0xc4c4('0x20')]);router[_0xc4c4('0x21')]('/',auth[_0xc4c4('0xa')](),controller[_0xc4c4('0x22')]);router[_0xc4c4('0x21')](_0xc4c4('0xd'),auth['isAuthenticated'](),controller[_0xc4c4('0x23')]);router[_0xc4c4('0x21')]('/:id/canned_answers',auth[_0xc4c4('0xa')](),controller[_0xc4c4('0x24')]);var upload=multer({'storage':multer[_0xc4c4('0x25')]({'destination':function(_0x394793,_0x5c006e,_0x4dc359){_0x4dc359(null,path[_0xc4c4('0x26')](config[_0xc4c4('0x27')],_0xc4c4('0x28')));},'filename':function(_0x5bf35e,_0x22a339,_0x94443){_0x94443(null,util[_0xc4c4('0x29')](_0xc4c4('0x2a'),Date[_0xc4c4('0x2b')](),_0x22a339[_0xc4c4('0x2c')]));}})});router[_0xc4c4('0x21')](_0xc4c4('0x11'),upload[_0xc4c4('0x2d')](_0xc4c4('0x2e')),controller[_0xc4c4('0x2f')]);var upload=multer({'storage':multer[_0xc4c4('0x25')]({'destination':function(_0xe73c7d,_0x5a25c4,_0x124d36){_0x124d36(null,path['join'](config[_0xc4c4('0x27')],_0xc4c4('0x30')));},'filename':function(_0x123026,_0x1aa343,_0x205498){_0x205498(null,util[_0xc4c4('0x29')]('%s-%s',Date[_0xc4c4('0x2b')](),_0x1aa343['originalname']));}})});router[_0xc4c4('0x21')]('/:id/avatar',upload['single'](_0xc4c4('0x2e')),controller[_0xc4c4('0x31')]);var upload=multer({'storage':multer[_0xc4c4('0x25')]({'destination':function(_0x328312,_0x292b61,_0x1e4469){_0x1e4469(null,path[_0xc4c4('0x26')](config[_0xc4c4('0x27')],_0xc4c4('0x30')));},'filename':function(_0x3672a6,_0x404835,_0x57bf93){_0x57bf93(null,util[_0xc4c4('0x29')](_0xc4c4('0x2a'),Date['now'](),_0x404835[_0xc4c4('0x2c')]));}})});router['post'](_0xc4c4('0x13'),upload[_0xc4c4('0x2d')]('file'),controller[_0xc4c4('0x32')]);var upload=multer({'storage':multer[_0xc4c4('0x25')]({'destination':function(_0x56075a,_0x476894,_0x15dc75){_0x15dc75(null,path[_0xc4c4('0x26')](config[_0xc4c4('0x27')],'server/files/images/avatars/'));},'filename':function(_0x338867,_0x4331f4,_0x257356){_0x257356(null,util['format'](_0xc4c4('0x2a'),Date[_0xc4c4('0x2b')](),_0x4331f4[_0xc4c4('0x2c')]));}})});router['post'](_0xc4c4('0x15'),upload[_0xc4c4('0x2d')](_0xc4c4('0x2e')),controller['addSystemAvatar']);router[_0xc4c4('0x21')](_0xc4c4('0x33'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xc4c4('0x25')]({'destination':function(_0x4731d3,_0x166693,_0x481aab){const _0x376975=path[_0xc4c4('0x26')](config[_0xc4c4('0x27')],'server/files',_0xc4c4('0x34'),_0xc4c4('0x35'));fs_extra[_0xc4c4('0x36')](_0x376975,function(){_0x481aab(null,_0x376975);});},'filename':function(_0x2646a5,_0x4f7411,_0x4e415d){const _0x49aa2c=_0x4f7411[_0xc4c4('0x2c')][_0xc4c4('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x34b521=path['extname'](_0x49aa2c);const _0x2b620b=Date[_0xc4c4('0x2b')]()+'-'+_0x49aa2c['replace'](_0x34b521,'')+_0x34b521;_0x4e415d(null,_0x2b620b);}})});router[_0xc4c4('0x21')](_0xc4c4('0x38'),offlineUploadMulter[_0xc4c4('0x39')](),controller[_0xc4c4('0x3a')]);router['post']('/:id/interactions',auth[_0xc4c4('0xa')](),controller['addInteraction']);router[_0xc4c4('0x21')]('/:id/applications',auth[_0xc4c4('0xa')](),controller[_0xc4c4('0x3b')]);router[_0xc4c4('0x21')](_0xc4c4('0x3c'),auth[_0xc4c4('0xa')](),controller['addProactiveActions']);router[_0xc4c4('0x21')](_0xc4c4('0x1f'),auth[_0xc4c4('0xa')](),controller[_0xc4c4('0x3d')]);router[_0xc4c4('0x3e')](_0xc4c4('0x3f'),auth['isAuthenticated'](),controller[_0xc4c4('0x40')]);router[_0xc4c4('0x41')](_0xc4c4('0x3f'),auth['isAuthenticated'](),controller[_0xc4c4('0x42')]);router[_0xc4c4('0x41')](_0xc4c4('0xd'),auth[_0xc4c4('0xa')](),controller[_0xc4c4('0x43')]);router[_0xc4c4('0x41')](_0xc4c4('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xc4c4('0x41')](_0xc4c4('0x1f'),auth['isAuthenticated'](),controller[_0xc4c4('0x44')]);module[_0xc4c4('0x45')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 008eefe..fadf4de 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc4f=['exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated'];(function(_0xbe4c61,_0x24e06a){var _0x35076d=function(_0x126a03){while(--_0x126a03){_0xbe4c61['push'](_0xbe4c61['shift']());}};_0x35076d(++_0x24e06a);}(_0xdc4f,0x9d));var _0xfdc4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdc4f[_0x20a584];return _0x4b41a8;};var beaverLogger=require(_0xfdc4('0x0'));var express=require(_0xfdc4('0x1'));var auth=require(_0xfdc4('0x2'));var config=require(_0xfdc4('0x3'));var router=express[_0xfdc4('0x4')]();var isProduction=config[_0xfdc4('0x5')]===_0xfdc4('0x6')||![];function clientSideLogs(_0x215aaf,_0xd359b0,_0x20b469){var _0x3b89f3=_0x215aaf['app'][_0xfdc4('0x7')]('client-side-logger');if(!_0x3b89f3){throw new Error(_0xfdc4('0x8'));}return beaverLogger[_0xfdc4('0x9')]({'uri':_0xfdc4('0xa'),'logger':_0x3b89f3,'enableCors':!isProduction})(_0x215aaf,_0xd359b0,_0x20b469);}router['use'](auth[_0xfdc4('0xb')](),clientSideLogs);module[_0xfdc4('0xc')]=router; \ No newline at end of file +var _0x56f3=['../config/environment','Router','env','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service'];(function(_0x4e6c83,_0xbec105){var _0x16c113=function(_0x3e5a2f){while(--_0x3e5a2f){_0x4e6c83['push'](_0x4e6c83['shift']());}};_0x16c113(++_0xbec105);}(_0x56f3,0xce));var _0x356f=function(_0x93e16a,_0x13cec2){_0x93e16a=_0x93e16a-0x0;var _0xe4c01=_0x56f3[_0x93e16a];return _0xe4c01;};var beaverLogger=require(_0x356f('0x0'));var express=require('express');var auth=require(_0x356f('0x1'));var config=require(_0x356f('0x2'));var router=express[_0x356f('0x3')]();var isProduction=config[_0x356f('0x4')]==='production'||![];function clientSideLogs(_0x408208,_0x51df72,_0x457c5d){var _0x4f2fd4=_0x408208[_0x356f('0x5')]['get'](_0x356f('0x6'));if(!_0x4f2fd4){throw new Error(_0x356f('0x7'));}return beaverLogger[_0x356f('0x8')]({'uri':_0x356f('0x9'),'logger':_0x4f2fd4,'enableCors':!isProduction})(_0x408208,_0x51df72,_0x457c5d);}router[_0x356f('0xa')](auth[_0x356f('0xb')](),clientSideLogs);module[_0x356f('0xc')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 4f1f942..945432b 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 _0x0a8e=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365'];(function(_0xe1fa6b,_0x24c4c9){var _0x16e21f=function(_0x2cd9bd){while(--_0x2cd9bd){_0xe1fa6b['push'](_0xe1fa6b['shift']());}};_0x16e21f(++_0x24c4c9);}(_0x0a8e,0x165));var _0xe0a8=function(_0x319ed4,_0x3320bc){_0x319ed4=_0x319ed4-0x0;var _0x2d30e0=_0x0a8e[_0x319ed4];return _0x2d30e0;};'use strict';var Sequelize=require('sequelize');module[_0xe0a8('0x0')]={'name':{'type':Sequelize[_0xe0a8('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xe0a8('0x2'),_0xe0a8('0x3'),_0xe0a8('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xe0a8('0x5')](_0xe0a8('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0xe0a8('0x1')],'comment':_0xe0a8('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0xe0a8('0x8')},'data3':{'type':Sequelize[_0xe0a8('0x1')],'comment':_0xe0a8('0x9')},'data4':{'type':Sequelize[_0xe0a8('0x1')],'comment':_0xe0a8('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xe0a8('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xe0a8('0xb')],'comment':_0xe0a8('0xc')}}; \ No newline at end of file +var _0xf34f=['STRING','ENUM','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20refresh_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0xf34f,0xec));var _0xff34=function(_0x47b8cb,_0x3e1146){_0x47b8cb=_0x47b8cb-0x0;var _0x230721=_0xf34f[_0x47b8cb];return _0x230721;};'use strict';var Sequelize=require(_0xff34('0x0'));module[_0xff34('0x1')]={'name':{'type':Sequelize[_0xff34('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xff34('0x3')]('AmazonAWS',_0xff34('0x4'),_0xff34('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xff34('0x3')](_0xff34('0x6'),_0xff34('0x7'))},'data1':{'type':Sequelize[_0xff34('0x2')],'comment':_0xff34('0x8')},'data2':{'type':Sequelize[_0xff34('0x2')],'comment':_0xff34('0x9')},'data3':{'type':Sequelize[_0xff34('0x2')],'comment':_0xff34('0xa')},'data4':{'type':Sequelize[_0xff34('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':_0xff34('0xb')},'data7':{'type':Sequelize[_0xff34('0xc')],'comment':_0xff34('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 2e0dee9..8db527e 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 _0x8c35=['catch','create','body','Name\x20parameter\x20not\x20specified','service','values','includes','join','encryptString','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','set','update','then','destroy','stack','name','send','padEnd','slice','map','CloudProvider','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','MicrosoftAzure','decryptString','data3','show','params','find'];(function(_0x24c811,_0x3bb49a){var _0x536236=function(_0x3d0f87){while(--_0x3d0f87){_0x24c811['push'](_0x24c811['shift']());}};_0x536236(++_0x3bb49a);}(_0x8c35,0x87));var _0x58c3=function(_0x46ccb7,_0x48cc17){_0x46ccb7=_0x46ccb7-0x0;var _0x51d584=_0x8c35[_0x46ccb7];return _0x51d584;};'use strict';var _=require(_0x58c3('0x0'));var Redis=require(_0x58c3('0x1'));var qs=require(_0x58c3('0x2'));var encryptor=require(_0x58c3('0x3'));var config=require('../../config/environment');var logger=require(_0x58c3('0x4'))(_0x58c3('0x5'));var db=require(_0x58c3('0x6'))['db'];var oauth=require(_0x58c3('0x7'));config[_0x58c3('0x8')]=_['defaults'](config['redis'],{'host':_0x58c3('0x9'),'port':0x18eb});var socket=require(_0x58c3('0xa'))(new Redis(config[_0x58c3('0x8')]));var redis=new Redis(config[_0x58c3('0x8')]);function respondWithStatusCode(_0xaec8b5,_0x548c1d){_0x548c1d=_0x548c1d||0xcc;return function(_0x43af6a){if(_0x43af6a){return _0xaec8b5[_0x58c3('0xb')](_0x548c1d);}return _0xaec8b5[_0x58c3('0xc')](_0x548c1d)[_0x58c3('0xd')]();};}function respondWithResult(_0x5aa678,_0x12835f){_0x12835f=_0x12835f||0xc8;return function(_0x3f2522){if(_0x3f2522){return _0x5aa678[_0x58c3('0xc')](_0x12835f)[_0x58c3('0xe')](_0x3f2522);}};}function respondWithFilteredResult(_0xcabda5,_0x581949){return function(_0x2595aa){if(_0x2595aa){var _0x138858=typeof _0x581949[_0x58c3('0xf')]===_0x58c3('0x10')&&typeof _0x581949['limit']===_0x58c3('0x10');var _0x1337cc=_0x2595aa[_0x58c3('0x11')];var _0x5ed5bf=_0x138858?0x0:_0x581949[_0x58c3('0xf')];var _0x3f70d1=_0x138858?_0x2595aa[_0x58c3('0x11')]:_0x581949[_0x58c3('0xf')]+_0x581949[_0x58c3('0x12')];var _0x1038fb;if(_0x3f70d1>=_0x1337cc){_0x3f70d1=_0x1337cc;_0x1038fb=0xc8;}else{_0x1038fb=0xce;}_0xcabda5['status'](_0x1038fb);return _0xcabda5[_0x58c3('0x13')]('Content-Range',_0x5ed5bf+'-'+_0x3f70d1+'/'+_0x1337cc)[_0x58c3('0xe')](_0x2595aa);}return null;};}function saveUpdates(_0x5722db){return function(_0x1bdb85){if(_0x1bdb85){return _0x1bdb85[_0x58c3('0x14')](_0x5722db)[_0x58c3('0x15')](function(_0x1c40f5){return _0x1c40f5;});}return null;};}function removeEntity(_0x1350a1){return function(_0x30ed1b){if(_0x30ed1b){return _0x30ed1b[_0x58c3('0x16')]()[_0x58c3('0x15')](function(){_0x1350a1[_0x58c3('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55a345){return function(_0x2f7e6d){if(!_0x2f7e6d){_0x55a345[_0x58c3('0xb')](0x194);}return _0x2f7e6d;};}function handleError(_0x3bcd4e,_0x2463d3){_0x2463d3=_0x2463d3||0x1f4;return function(_0x411267){logger['error'](_0x411267[_0x58c3('0x17')]);if(_0x411267[_0x58c3('0x18')]){delete _0x411267[_0x58c3('0x18')];}_0x3bcd4e[_0x58c3('0xc')](_0x2463d3)[_0x58c3('0x19')](_0x411267);};}function maskClientSecret(_0x42bdb2){return _[_0x58c3('0x1a')](_0x42bdb2[_0x58c3('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x3737da,_0x553c7){var _0x5afc96={},_0x6370ee={},_0x4a9fe7={'count':0x0,'rows':[]};var _0x4e9baa=_[_0x58c3('0x1c')](db[_0x58c3('0x1d')]['rawAttributes'],function(_0x92a20f){return{'name':_0x92a20f['fieldName'],'type':_0x92a20f['type'][_0x58c3('0x1e')]};});_0x6370ee[_0x58c3('0x1f')]=_[_0x58c3('0x1c')](_0x4e9baa,'name');_0x6370ee['query']=_[_0x58c3('0x20')](_0x3737da[_0x58c3('0x21')]);_0x6370ee[_0x58c3('0x22')]=_[_0x58c3('0x23')](_0x6370ee[_0x58c3('0x1f')],_0x6370ee[_0x58c3('0x21')]);_0x5afc96['attributes']=_[_0x58c3('0x23')](_0x6370ee['model'],qs[_0x58c3('0x24')](_0x3737da[_0x58c3('0x21')][_0x58c3('0x24')]));_0x5afc96[_0x58c3('0x25')]=_0x5afc96['attributes'][_0x58c3('0x26')]?_0x5afc96[_0x58c3('0x25')]:_0x6370ee['model'];if(!_0x3737da[_0x58c3('0x21')][_0x58c3('0x27')](_0x58c3('0x28'))){_0x5afc96[_0x58c3('0x12')]=qs[_0x58c3('0x12')](_0x3737da[_0x58c3('0x21')][_0x58c3('0x12')]);_0x5afc96['offset']=qs[_0x58c3('0xf')](_0x3737da[_0x58c3('0x21')][_0x58c3('0xf')]);}_0x5afc96[_0x58c3('0x29')]=qs[_0x58c3('0x2a')](_0x3737da[_0x58c3('0x21')][_0x58c3('0x2a')]);_0x5afc96[_0x58c3('0x2b')]=qs[_0x58c3('0x22')](_[_0x58c3('0x2c')](_0x3737da[_0x58c3('0x21')],_0x6370ee[_0x58c3('0x22')]),_0x4e9baa);if(_0x3737da['query'][_0x58c3('0x2d')]){_0x5afc96[_0x58c3('0x2b')]=_[_0x58c3('0x2e')](_0x5afc96[_0x58c3('0x2b')],{'$or':_[_0x58c3('0x1c')](_0x4e9baa,function(_0x529f5a){if(_0x529f5a[_0x58c3('0x2f')]!==_0x58c3('0x30')){var _0x11a145={};_0x11a145[_0x529f5a['name']]={'$like':'%'+_0x3737da[_0x58c3('0x21')][_0x58c3('0x2d')]+'%'};return _0x11a145;}})});}_0x5afc96=_[_0x58c3('0x2e')]({},_0x5afc96,_0x3737da[_0x58c3('0x31')]);var _0x102f3f={'where':_0x5afc96[_0x58c3('0x2b')]};return db['CloudProvider']['count'](_0x102f3f)[_0x58c3('0x15')](function(_0x35de48){_0x4a9fe7[_0x58c3('0x11')]=_0x35de48;if(_0x3737da[_0x58c3('0x21')][_0x58c3('0x32')]){_0x5afc96[_0x58c3('0x33')]=[{'all':!![]}];}return db[_0x58c3('0x1d')][_0x58c3('0x34')](_0x5afc96);})[_0x58c3('0x15')](function(_0x181708){_0x4a9fe7['rows']=_[_0x58c3('0x1c')](_0x181708,function(_0x54a36d){if(_0x54a36d['service']===_0x58c3('0x35')){var _0x2eb117=encryptor[_0x58c3('0x36')](_0x54a36d[_0x58c3('0x37')]);_0x54a36d[_0x58c3('0x37')]=maskClientSecret(_0x2eb117);}return _0x54a36d;});return _0x4a9fe7;})[_0x58c3('0x15')](respondWithFilteredResult(_0x553c7,_0x5afc96))['catch'](handleError(_0x553c7,null));};exports[_0x58c3('0x38')]=function(_0xfd3c59,_0x1cb69e){var _0x3c6a5e={'raw':!![],'where':{'id':_0xfd3c59[_0x58c3('0x39')]['id']}},_0x1dfa13={};_0x1dfa13[_0x58c3('0x1f')]=_[_0x58c3('0x20')](db[_0x58c3('0x1d')]['rawAttributes']);_0x1dfa13[_0x58c3('0x21')]=_[_0x58c3('0x20')](_0xfd3c59[_0x58c3('0x21')]);_0x1dfa13['filters']=_[_0x58c3('0x23')](_0x1dfa13[_0x58c3('0x1f')],_0x1dfa13[_0x58c3('0x21')]);_0x3c6a5e[_0x58c3('0x25')]=_[_0x58c3('0x23')](_0x1dfa13[_0x58c3('0x1f')],qs[_0x58c3('0x24')](_0xfd3c59[_0x58c3('0x21')]['fields']));_0x3c6a5e[_0x58c3('0x25')]=_0x3c6a5e[_0x58c3('0x25')][_0x58c3('0x26')]?_0x3c6a5e[_0x58c3('0x25')]:_0x1dfa13[_0x58c3('0x1f')];if(_0xfd3c59[_0x58c3('0x21')][_0x58c3('0x32')]){_0x3c6a5e[_0x58c3('0x33')]=[{'all':!![]}];}_0x3c6a5e=_[_0x58c3('0x2e')]({},_0x3c6a5e,_0xfd3c59['options']);return db[_0x58c3('0x1d')][_0x58c3('0x3a')](_0x3c6a5e)[_0x58c3('0x15')](handleEntityNotFound(_0x1cb69e,null))[_0x58c3('0x15')](function(_0x198edd){if(_0x198edd['service']==='MicrosoftAzure'){var _0x3ebf16=encryptor[_0x58c3('0x36')](_0x198edd['data3']);_0x198edd['data3']=maskClientSecret(_0x3ebf16);}return _0x198edd;})[_0x58c3('0x15')](respondWithResult(_0x1cb69e,null))[_0x58c3('0x3b')](handleError(_0x1cb69e,null));};exports[_0x58c3('0x3c')]=function(_0x40750b,_0x1a37ef){if(!_0x40750b[_0x58c3('0x3d')][_0x58c3('0x18')])throw new Error(_0x58c3('0x3e'));if(!_0x40750b['body']['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x36b5b4=db[_0x58c3('0x1d')]['rawAttributes'][_0x58c3('0x3f')][_0x58c3('0x40')];if(!_0x36b5b4[_0x58c3('0x41')](_0x40750b[_0x58c3('0x3d')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x36b5b4[_0x58c3('0x42')](',\x20'));if(_0x40750b[_0x58c3('0x3d')]['service']===_0x58c3('0x35')&&_0x40750b['body'][_0x58c3('0x37')]){_0x40750b[_0x58c3('0x3d')]['data3']=encryptor[_0x58c3('0x43')](_0x40750b[_0x58c3('0x3d')][_0x58c3('0x37')]);}return db[_0x58c3('0x1d')][_0x58c3('0x3c')](_0x40750b[_0x58c3('0x3d')],{})[_0x58c3('0x15')](respondWithResult(_0x1a37ef,0xc9))[_0x58c3('0x3b')](handleError(_0x1a37ef,null));};exports[_0x58c3('0x14')]=function(_0x42216f,_0x1adc0c){if(_0x42216f[_0x58c3('0x3d')]['id']){delete _0x42216f[_0x58c3('0x3d')]['id'];}return db[_0x58c3('0x1d')][_0x58c3('0x3a')]({'where':{'id':_0x42216f[_0x58c3('0x39')]['id']}})['then'](handleEntityNotFound(_0x1adc0c,null))[_0x58c3('0x15')](function(_0x5a78de){if(_0x5a78de[_0x58c3('0x3f')]===_0x58c3('0x35')&&_0x42216f['body'][_0x58c3('0x37')]){_0x42216f[_0x58c3('0x3d')][_0x58c3('0x37')]=encryptor[_0x58c3('0x43')](_0x42216f[_0x58c3('0x3d')][_0x58c3('0x37')]);}return _0x5a78de;})[_0x58c3('0x15')](saveUpdates(_0x42216f[_0x58c3('0x3d')],null))[_0x58c3('0x15')](respondWithResult(_0x1adc0c,null))[_0x58c3('0x3b')](handleError(_0x1adc0c,null));};exports['destroy']=function(_0xe2cd90,_0x41e396){return db[_0x58c3('0x1d')][_0x58c3('0x3a')]({'where':{'id':_0xe2cd90['params']['id']}})[_0x58c3('0x15')](handleEntityNotFound(_0x41e396,null))[_0x58c3('0x15')](removeEntity(_0x41e396,null))[_0x58c3('0x3b')](handleError(_0x41e396,null));};exports['oauth2MicrosoftAuthorize']=function(_0xf43cdf,_0x850d1c){return db['CloudProvider'][_0x58c3('0x44')]({'where':{'id':_0xf43cdf[_0x58c3('0x39')]['id']},'raw':!![]})[_0x58c3('0x15')](function(_0x4b9bac){if(!_0x4b9bac)return _0x850d1c[_0x58c3('0xb')](0x194);return{'url':oauth[_0x58c3('0x45')](_0x4b9bac,_0xf43cdf[_0x58c3('0x46')]['id'])};})[_0x58c3('0x15')](respondWithResult(_0x850d1c,null))[_0x58c3('0x3b')](handleError(_0x850d1c,null));};exports[_0x58c3('0x47')]=function(_0x23723b,_0x122ef9){var _0x131005=_0x23723b[_0x58c3('0x3d')];var _0x2c7998;var _0x47b212;if(_0x131005['error'])throw _0x131005;redis['get'](_0x131005[_0x58c3('0x48')])['then'](function(_0x513c47){if(!_0x513c47)throw new Error(_0x58c3('0x49'));_0x2c7998=JSON[_0x58c3('0x4a')](_0x513c47);var _0xa8586a=Buffer[_0x58c3('0x4b')](_0x131005[_0x58c3('0x48')],_0x58c3('0x4c'))[_0x58c3('0x4d')](_0x58c3('0x4e'));_0x47b212=JSON[_0x58c3('0x4a')](_0xa8586a);if(!oauth[_0x58c3('0x4f')](_0x131005['id_token'],_0x2c7998[_0x58c3('0x50')]))throw new Error(_0x58c3('0x51'));redis[_0x58c3('0x52')](_0x131005[_0x58c3('0x48')]);return oauth[_0x58c3('0x53')](_0x131005['code'],_0x2c7998);})[_0x58c3('0x15')](function(_0x93ed9e){_0x2c7998[_0x58c3('0x54')]=_0x93ed9e[_0x58c3('0x55')];_0x2c7998[_0x58c3('0x56')]=_0x93ed9e[_0x58c3('0x57')];return db[_0x58c3('0x1d')][_0x58c3('0x14')]({'data5':_0x2c7998[_0x58c3('0x54')],'data6':_0x2c7998[_0x58c3('0x56')]},{'where':{'id':_0x2c7998['id']}});})['then'](function(){oauth[_0x58c3('0x58')](_0x2c7998);socket[_0x58c3('0x59')](_0x58c3('0x5a'),{'id':_0x47b212['id']});return;})[_0x58c3('0x15')](respondWithStatusCode(_0x122ef9,null))['catch'](function(_0x4eb6bc){if(_0x47b212){socket[_0x58c3('0x59')](_0x58c3('0x5b'),{'id':_0x47b212['id']});}if(!_0x2c7998){logger['error'](_0x58c3('0x5c'),_0x4eb6bc);return _0x122ef9[_0x58c3('0xc')](0x1f4)[_0x58c3('0x19')](_0x4eb6bc[_0x58c3('0x5d')]);}logger[_0x58c3('0x5e')](_0x58c3('0x5f'),_0x2c7998['id'],JSON[_0x58c3('0x60')](_0x4eb6bc));});}; \ No newline at end of file +var _0xd6cc=['fieldName','key','map','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','then','include','findAll','rows','service','decryptString','data3','catch','show','params','keys','includeAll','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','MicrosoftAzure','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','parse','from','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','defaults','redis','socket.io-emitter','sendStatus','status','json','offset','undefined','update','destroy','error','stack','send','padEnd','slice','CloudProvider','rawAttributes'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd6cc,0x165));var _0xcd6c=function(_0x477a4b,_0x3e440e){_0x477a4b=_0x477a4b-0x0;var _0x4eca78=_0xd6cc[_0x477a4b];return _0x4eca78;};'use strict';var _=require(_0xcd6c('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xcd6c('0x1'));var config=require(_0xcd6c('0x2'));var logger=require(_0xcd6c('0x3'))(_0xcd6c('0x4'));var db=require(_0xcd6c('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0xcd6c('0x6')](config[_0xcd6c('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xcd6c('0x8'))(new Redis(config[_0xcd6c('0x7')]));var redis=new Redis(config[_0xcd6c('0x7')]);function respondWithStatusCode(_0x40b512,_0x151898){_0x151898=_0x151898||0xcc;return function(_0x5190aa){if(_0x5190aa){return _0x40b512[_0xcd6c('0x9')](_0x151898);}return _0x40b512['status'](_0x151898)['end']();};}function respondWithResult(_0x10960d,_0x355e4b){_0x355e4b=_0x355e4b||0xc8;return function(_0x447533){if(_0x447533){return _0x10960d[_0xcd6c('0xa')](_0x355e4b)[_0xcd6c('0xb')](_0x447533);}};}function respondWithFilteredResult(_0x5bc625,_0x32e433){return function(_0x26b2fb){if(_0x26b2fb){var _0x486aee=typeof _0x32e433[_0xcd6c('0xc')]===_0xcd6c('0xd')&&typeof _0x32e433['limit']===_0xcd6c('0xd');var _0x5e2cd4=_0x26b2fb['count'];var _0x9df326=_0x486aee?0x0:_0x32e433[_0xcd6c('0xc')];var _0x317415=_0x486aee?_0x26b2fb['count']:_0x32e433[_0xcd6c('0xc')]+_0x32e433['limit'];var _0x23ac5a;if(_0x317415>=_0x5e2cd4){_0x317415=_0x5e2cd4;_0x23ac5a=0xc8;}else{_0x23ac5a=0xce;}_0x5bc625[_0xcd6c('0xa')](_0x23ac5a);return _0x5bc625['set']('Content-Range',_0x9df326+'-'+_0x317415+'/'+_0x5e2cd4)[_0xcd6c('0xb')](_0x26b2fb);}return null;};}function saveUpdates(_0x1d10e1){return function(_0x1fae77){if(_0x1fae77){return _0x1fae77[_0xcd6c('0xe')](_0x1d10e1)['then'](function(_0x4f4f49){return _0x4f4f49;});}return null;};}function removeEntity(_0x2b71cc){return function(_0x348905){if(_0x348905){return _0x348905[_0xcd6c('0xf')]()['then'](function(){_0x2b71cc[_0xcd6c('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ad535){return function(_0x5972f5){if(!_0x5972f5){_0x5ad535['sendStatus'](0x194);}return _0x5972f5;};}function handleError(_0x333c98,_0x28e0a2){_0x28e0a2=_0x28e0a2||0x1f4;return function(_0x418af9){logger[_0xcd6c('0x10')](_0x418af9[_0xcd6c('0x11')]);if(_0x418af9['name']){delete _0x418af9['name'];}_0x333c98['status'](_0x28e0a2)[_0xcd6c('0x12')](_0x418af9);};}function maskClientSecret(_0x40100e){return _[_0xcd6c('0x13')](_0x40100e[_0xcd6c('0x14')](0x0,0x3),0x14,'*');}exports['index']=function(_0x3c66fc,_0x596f5a){var _0x190b38={},_0x2795db={},_0x1fad1c={'count':0x0,'rows':[]};var _0x55cf00=_['map'](db[_0xcd6c('0x15')][_0xcd6c('0x16')],function(_0x452e35){return{'name':_0x452e35[_0xcd6c('0x17')],'type':_0x452e35['type'][_0xcd6c('0x18')]};});_0x2795db['model']=_[_0xcd6c('0x19')](_0x55cf00,_0xcd6c('0x1a'));_0x2795db[_0xcd6c('0x1b')]=_['keys'](_0x3c66fc[_0xcd6c('0x1b')]);_0x2795db[_0xcd6c('0x1c')]=_[_0xcd6c('0x1d')](_0x2795db[_0xcd6c('0x1e')],_0x2795db[_0xcd6c('0x1b')]);_0x190b38[_0xcd6c('0x1f')]=_[_0xcd6c('0x1d')](_0x2795db[_0xcd6c('0x1e')],qs[_0xcd6c('0x20')](_0x3c66fc[_0xcd6c('0x1b')][_0xcd6c('0x20')]));_0x190b38['attributes']=_0x190b38['attributes'][_0xcd6c('0x21')]?_0x190b38[_0xcd6c('0x1f')]:_0x2795db['model'];if(!_0x3c66fc[_0xcd6c('0x1b')][_0xcd6c('0x22')](_0xcd6c('0x23'))){_0x190b38[_0xcd6c('0x24')]=qs[_0xcd6c('0x24')](_0x3c66fc[_0xcd6c('0x1b')][_0xcd6c('0x24')]);_0x190b38[_0xcd6c('0xc')]=qs[_0xcd6c('0xc')](_0x3c66fc[_0xcd6c('0x1b')][_0xcd6c('0xc')]);}_0x190b38[_0xcd6c('0x25')]=qs[_0xcd6c('0x26')](_0x3c66fc[_0xcd6c('0x1b')][_0xcd6c('0x26')]);_0x190b38[_0xcd6c('0x27')]=qs['filters'](_[_0xcd6c('0x28')](_0x3c66fc[_0xcd6c('0x1b')],_0x2795db[_0xcd6c('0x1c')]),_0x55cf00);if(_0x3c66fc['query'][_0xcd6c('0x29')]){_0x190b38[_0xcd6c('0x27')]=_[_0xcd6c('0x2a')](_0x190b38['where'],{'$or':_[_0xcd6c('0x19')](_0x55cf00,function(_0x17549f){if(_0x17549f[_0xcd6c('0x2b')]!==_0xcd6c('0x2c')){var _0x5eb095={};_0x5eb095[_0x17549f[_0xcd6c('0x1a')]]={'$like':'%'+_0x3c66fc[_0xcd6c('0x1b')][_0xcd6c('0x29')]+'%'};return _0x5eb095;}})});}_0x190b38=_[_0xcd6c('0x2a')]({},_0x190b38,_0x3c66fc[_0xcd6c('0x2d')]);var _0x5b7c3e={'where':_0x190b38[_0xcd6c('0x27')]};return db[_0xcd6c('0x15')][_0xcd6c('0x2e')](_0x5b7c3e)[_0xcd6c('0x2f')](function(_0x523c79){_0x1fad1c[_0xcd6c('0x2e')]=_0x523c79;if(_0x3c66fc[_0xcd6c('0x1b')]['includeAll']){_0x190b38[_0xcd6c('0x30')]=[{'all':!![]}];}return db[_0xcd6c('0x15')][_0xcd6c('0x31')](_0x190b38);})[_0xcd6c('0x2f')](function(_0x2bbcd8){_0x1fad1c[_0xcd6c('0x32')]=_[_0xcd6c('0x19')](_0x2bbcd8,function(_0x4a75f2){if(_0x4a75f2[_0xcd6c('0x33')]==='MicrosoftAzure'){var _0x5387a6=encryptor[_0xcd6c('0x34')](_0x4a75f2[_0xcd6c('0x35')]);_0x4a75f2['data3']=maskClientSecret(_0x5387a6);}return _0x4a75f2;});return _0x1fad1c;})[_0xcd6c('0x2f')](respondWithFilteredResult(_0x596f5a,_0x190b38))[_0xcd6c('0x36')](handleError(_0x596f5a,null));};exports[_0xcd6c('0x37')]=function(_0x5bde96,_0x50e9f6){var _0x25b9b3={'raw':!![],'where':{'id':_0x5bde96[_0xcd6c('0x38')]['id']}},_0x368230={};_0x368230['model']=_[_0xcd6c('0x39')](db[_0xcd6c('0x15')][_0xcd6c('0x16')]);_0x368230['query']=_[_0xcd6c('0x39')](_0x5bde96[_0xcd6c('0x1b')]);_0x368230['filters']=_[_0xcd6c('0x1d')](_0x368230[_0xcd6c('0x1e')],_0x368230['query']);_0x25b9b3[_0xcd6c('0x1f')]=_[_0xcd6c('0x1d')](_0x368230[_0xcd6c('0x1e')],qs[_0xcd6c('0x20')](_0x5bde96[_0xcd6c('0x1b')]['fields']));_0x25b9b3['attributes']=_0x25b9b3[_0xcd6c('0x1f')][_0xcd6c('0x21')]?_0x25b9b3[_0xcd6c('0x1f')]:_0x368230['model'];if(_0x5bde96['query'][_0xcd6c('0x3a')]){_0x25b9b3[_0xcd6c('0x30')]=[{'all':!![]}];}_0x25b9b3=_[_0xcd6c('0x2a')]({},_0x25b9b3,_0x5bde96['options']);return db[_0xcd6c('0x15')][_0xcd6c('0x3b')](_0x25b9b3)['then'](handleEntityNotFound(_0x50e9f6,null))['then'](function(_0xbe1c21){if(_0xbe1c21['service']==='MicrosoftAzure'){var _0x3352c7=encryptor['decryptString'](_0xbe1c21['data3']);_0xbe1c21['data3']=maskClientSecret(_0x3352c7);}return _0xbe1c21;})[_0xcd6c('0x2f')](respondWithResult(_0x50e9f6,null))['catch'](handleError(_0x50e9f6,null));};exports[_0xcd6c('0x3c')]=function(_0xa38f4f,_0x1097bd){if(!_0xa38f4f[_0xcd6c('0x3d')][_0xcd6c('0x1a')])throw new Error(_0xcd6c('0x3e'));if(!_0xa38f4f['body'][_0xcd6c('0x33')])throw new Error(_0xcd6c('0x3f'));var _0x1fc004=db[_0xcd6c('0x15')]['rawAttributes'][_0xcd6c('0x33')][_0xcd6c('0x40')];if(!_0x1fc004['includes'](_0xa38f4f['body'][_0xcd6c('0x33')]))throw new Error(_0xcd6c('0x41')+_0x1fc004[_0xcd6c('0x42')](',\x20'));if(_0xa38f4f[_0xcd6c('0x3d')][_0xcd6c('0x33')]==='MicrosoftAzure'&&_0xa38f4f['body'][_0xcd6c('0x35')]){_0xa38f4f[_0xcd6c('0x3d')][_0xcd6c('0x35')]=encryptor[_0xcd6c('0x43')](_0xa38f4f[_0xcd6c('0x3d')][_0xcd6c('0x35')]);}return db[_0xcd6c('0x15')]['create'](_0xa38f4f[_0xcd6c('0x3d')],{})[_0xcd6c('0x2f')](respondWithResult(_0x1097bd,0xc9))['catch'](handleError(_0x1097bd,null));};exports[_0xcd6c('0xe')]=function(_0x48aa4f,_0x356acb){if(_0x48aa4f['body']['id']){delete _0x48aa4f[_0xcd6c('0x3d')]['id'];}return db['CloudProvider'][_0xcd6c('0x3b')]({'where':{'id':_0x48aa4f[_0xcd6c('0x38')]['id']}})[_0xcd6c('0x2f')](handleEntityNotFound(_0x356acb,null))[_0xcd6c('0x2f')](function(_0x335ed3){if(_0x335ed3['service']===_0xcd6c('0x44')&&_0x48aa4f[_0xcd6c('0x3d')][_0xcd6c('0x35')]){_0x48aa4f[_0xcd6c('0x3d')]['data3']=encryptor[_0xcd6c('0x43')](_0x48aa4f[_0xcd6c('0x3d')]['data3']);}return _0x335ed3;})[_0xcd6c('0x2f')](saveUpdates(_0x48aa4f[_0xcd6c('0x3d')],null))[_0xcd6c('0x2f')](respondWithResult(_0x356acb,null))[_0xcd6c('0x36')](handleError(_0x356acb,null));};exports[_0xcd6c('0xf')]=function(_0x2218b1,_0x4b04ab){return db['CloudProvider'][_0xcd6c('0x3b')]({'where':{'id':_0x2218b1[_0xcd6c('0x38')]['id']}})[_0xcd6c('0x2f')](handleEntityNotFound(_0x4b04ab,null))[_0xcd6c('0x2f')](removeEntity(_0x4b04ab,null))[_0xcd6c('0x36')](handleError(_0x4b04ab,null));};exports[_0xcd6c('0x45')]=function(_0x4776fa,_0x43f380){return db['CloudProvider'][_0xcd6c('0x46')]({'where':{'id':_0x4776fa[_0xcd6c('0x38')]['id']},'raw':!![]})['then'](function(_0x3f3228){if(!_0x3f3228)return _0x43f380[_0xcd6c('0x9')](0x194);return{'url':oauth[_0xcd6c('0x47')](_0x3f3228,_0x4776fa['user']['id'])};})['then'](respondWithResult(_0x43f380,null))[_0xcd6c('0x36')](handleError(_0x43f380,null));};exports[_0xcd6c('0x48')]=function(_0x474521,_0x2a2895){var _0x50dadd=_0x474521[_0xcd6c('0x3d')];var _0x3a5e97;var _0x4d5b43;if(_0x50dadd[_0xcd6c('0x10')])throw _0x50dadd;redis[_0xcd6c('0x49')](_0x50dadd[_0xcd6c('0x4a')])['then'](function(_0x32ec51){if(!_0x32ec51)throw new Error('Invalid\x20state\x20parameter');_0x3a5e97=JSON[_0xcd6c('0x4b')](_0x32ec51);var _0x132415=Buffer[_0xcd6c('0x4c')](_0x50dadd[_0xcd6c('0x4a')],'base64')['toString'](_0xcd6c('0x4d'));_0x4d5b43=JSON[_0xcd6c('0x4b')](_0x132415);if(!oauth[_0xcd6c('0x4e')](_0x50dadd[_0xcd6c('0x4f')],_0x3a5e97[_0xcd6c('0x50')]))throw new Error(_0xcd6c('0x51'));redis[_0xcd6c('0x52')](_0x50dadd['state']);return oauth[_0xcd6c('0x53')](_0x50dadd[_0xcd6c('0x54')],_0x3a5e97);})[_0xcd6c('0x2f')](function(_0x52b3b2){_0x3a5e97[_0xcd6c('0x55')]=_0x52b3b2[_0xcd6c('0x56')];_0x3a5e97[_0xcd6c('0x57')]=_0x52b3b2['refresh_token'];return db['CloudProvider'][_0xcd6c('0xe')]({'data5':_0x3a5e97[_0xcd6c('0x55')],'data6':_0x3a5e97[_0xcd6c('0x57')]},{'where':{'id':_0x3a5e97['id']}});})[_0xcd6c('0x2f')](function(){oauth[_0xcd6c('0x58')](_0x3a5e97);socket[_0xcd6c('0x59')](_0xcd6c('0x5a'),{'id':_0x4d5b43['id']});return;})[_0xcd6c('0x2f')](respondWithStatusCode(_0x2a2895,null))[_0xcd6c('0x36')](function(_0xfc02d3){if(_0x4d5b43){socket[_0xcd6c('0x59')]('microsoftAuthorization:error',{'id':_0x4d5b43['id']});}if(!_0x3a5e97){logger[_0xcd6c('0x10')](_0xcd6c('0x5b'),_0xfc02d3);return _0x2a2895['status'](0x1f4)[_0xcd6c('0x12')](_0xfc02d3[_0xcd6c('0x5c')]);}logger[_0xcd6c('0x10')](_0xcd6c('0x5d'),_0x3a5e97['id'],JSON[_0xcd6c('0x5e')](_0xfc02d3));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 0bb9b59..40698a2 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 _0xc9bc=['moment','bluebird','request-promise','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util'];(function(_0x3b7fb0,_0x553e21){var _0x3b7fc5=function(_0x286bdc){while(--_0x286bdc){_0x3b7fb0['push'](_0x3b7fb0['shift']());}};_0x3b7fc5(++_0x553e21);}(_0xc9bc,0xda));var _0xcc9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcc9b('0x0'));var util=require(_0xcc9b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcc9b('0x2'));var BPromise=require(_0xcc9b('0x3'));var rp=require(_0xcc9b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcc9b('0x5'));var attributes=require(_0xcc9b('0x6'));module[_0xcc9b('0x7')]=function(_0x40d0a0,_0x4e9846){return _0x40d0a0[_0xcc9b('0x8')](_0xcc9b('0x9'),attributes,{'tableName':_0xcc9b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6283=['bluebird','request-promise','path','rimraf','../../config/environment','CloudProvider','cloud_providers','lodash','../../config/logger','moment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6283,0xbb));var _0x3628=function(_0x419abf,_0x44502d){_0x419abf=_0x419abf-0x0;var _0x27d0c7=_0x6283[_0x419abf];return _0x27d0c7;};'use strict';var _=require(_0x3628('0x0'));var util=require('util');var logger=require(_0x3628('0x1'))('api');var moment=require(_0x3628('0x2'));var BPromise=require(_0x3628('0x3'));var rp=require(_0x3628('0x4'));var fs=require('fs');var path=require(_0x3628('0x5'));var rimraf=require(_0x3628('0x6'));var config=require(_0x3628('0x7'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x1ac3d4,_0x462525){return _0x1ac3d4['define'](_0x3628('0x8'),attributes,{'tableName':_0x3628('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 87b96e9..82486c1 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8cbb=['[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','Dynamics365','push','data7','/.default','join','type','Outlook365','replace','{TENANT_ID}','data2','code','from','stringify','toString','hex','client_id','data1','response_type','redirect_uri','data4','form_post','scope','state','nonce','oauth2Claims','oauth2/','set','payload','iss','aud','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','catch','inspect'];(function(_0x44cd05,_0x4809ca){var _0x59d0e0=function(_0x340cb0){while(--_0x340cb0){_0x44cd05['push'](_0x44cd05['shift']());}};_0x59d0e0(++_0x4809ca);}(_0x8cbb,0x178));var _0xb8cb=function(_0x1c5462,_0x47253f){_0x1c5462=_0x1c5462-0x0;var _0x240ba1=_0x8cbb[_0x1c5462];return _0x240ba1;};'use strict';var _=require('lodash');var crypto=require(_0xb8cb('0x0'));var jwt=require(_0xb8cb('0x1'));var moment=require(_0xb8cb('0x2'));var Redis=require(_0xb8cb('0x3'));var rp=require(_0xb8cb('0x4'));var util=require(_0xb8cb('0x5'));var encryptor=require(_0xb8cb('0x6'));var config=require(_0xb8cb('0x7'));var logger=require(_0xb8cb('0x8'))(_0xb8cb('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0xb8cb('0xa')]=_[_0xb8cb('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xb8cb('0xa')]);var MICROSOFT_AUTH_URL=_0xb8cb('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xb8cb('0xd'),_0xb8cb('0xe'),_0xb8cb('0xf'),_0xb8cb('0x10'),_0xb8cb('0x11'),_0xb8cb('0x12'),_0xb8cb('0x13')],'Dynamics365':[_0xb8cb('0xd'),_0xb8cb('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xb8cb('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0xb8cb('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x32f6da){var _0x2f525b=_[_0xb8cb('0x16')](AZURE_AUTH_SCOPES[_0x32f6da['type']]);if(_0x32f6da['type']===_0xb8cb('0x17'))_0x2f525b[_0xb8cb('0x18')](_0x32f6da[_0xb8cb('0x19')]+_0xb8cb('0x1a'));return _0x2f525b[_0xb8cb('0x1b')]('\x20');}function getAccessTokenScope(_0x3891e3){if(_0x3891e3[_0xb8cb('0x1c')]===_0xb8cb('0x1d'))return _0xb8cb('0x11');if(_0x3891e3[_0xb8cb('0x1c')]===_0xb8cb('0x17'))return _0x3891e3[_0xb8cb('0x19')]+_0xb8cb('0x1a');}function generateMicrosoftAuthorizationUrl(_0x242115,_0x255c2b){var _0x114826=MICROSOFT_AUTH_URL[_0xb8cb('0x1e')](_0xb8cb('0x1f'),_0x242115[_0xb8cb('0x20')]);var _0x5d9e35=[_0xb8cb('0x21'),'id_token'];var _0x178e12=Buffer[_0xb8cb('0x22')](JSON[_0xb8cb('0x23')]({'id':_0x255c2b}))[_0xb8cb('0x24')]('base64');var _0x3a191b=crypto['randomBytes'](0x10)[_0xb8cb('0x24')](_0xb8cb('0x25'));var _0x429a33=getAuthorizationScopes(_0x242115);var _0x454d5b=[{'key':_0xb8cb('0x26'),'value':_0x242115[_0xb8cb('0x27')]},{'key':_0xb8cb('0x28'),'value':encodeURIComponent(_0x5d9e35[_0xb8cb('0x1b')]('\x20'))},{'key':_0xb8cb('0x29'),'value':_0x242115[_0xb8cb('0x2a')]},{'key':'response_mode','value':_0xb8cb('0x2b')},{'key':_0xb8cb('0x2c'),'value':encodeURIComponent(_0x429a33)},{'key':_0xb8cb('0x2d'),'value':_0x178e12},{'key':_0xb8cb('0x2e'),'value':_0x3a191b},{'key':'prompt','value':'login'}];var _0x3f2cc2=_0x114826+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x454d5b,function(_0x509f9d){return _0x509f9d['key']+'='+_0x509f9d['value'];})[_0xb8cb('0x1b')]('&');_0x242115[_0xb8cb('0x2f')]={'issuer':_0x114826[_0xb8cb('0x1e')](_0xb8cb('0x30'),''),'audience':_0x242115[_0xb8cb('0x27')],'state':_0x178e12,'nonce':_0x3a191b};redis[_0xb8cb('0x31')](_0x178e12,JSON['stringify'](_0x242115));return _0x3f2cc2;}function isValidIdToken(_0x5370ff,_0x39ef19){try{var _0x3b6d4b=jwt['decode'](_0x5370ff,{'complete':!![]});var _0x13aa5e=_0x3b6d4b[_0xb8cb('0x32')];if(_0x13aa5e[_0xb8cb('0x33')]!==_0x39ef19['issuer'])return![];if(_0x13aa5e[_0xb8cb('0x34')]!==_0x39ef19['audience'])return![];if(_0x13aa5e[_0xb8cb('0x2e')]!==_0x39ef19[_0xb8cb('0x2e')])return![];if(moment()['isAfter'](moment[_0xb8cb('0x35')](_0x13aa5e[_0xb8cb('0x36')])))return![];return!![];}catch(_0x1beb99){throw _0x1beb99;}}function refreshOauth2MicrosoftAccessToken(_0x5dc574){return Promise[_0xb8cb('0x37')]()[_0xb8cb('0x38')](function(){if(_0x5dc574[_0xb8cb('0x39')])return _0x5dc574;return db[_0xb8cb('0x3a')][_0xb8cb('0x3b')]({'where':{'id':_0x5dc574['id']},'raw':!![]});})[_0xb8cb('0x38')](function(_0x633963){var _0x2bb0a8={'grant_type':_0xb8cb('0x3c'),'refresh_token':_0x633963[_0xb8cb('0x3d')],'scope':getAccessTokenScope(_0x633963),'redirect_uri':_0x633963[_0xb8cb('0x2a')],'client_id':_0x633963[_0xb8cb('0x27')],'client_secret':encryptor[_0xb8cb('0x3e')](_0x633963['data3'])};var _0x18aa8c={'method':_0xb8cb('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xb8cb('0x1f'),_0x633963[_0xb8cb('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2bb0a8,'json':!![]};return rp(_0x18aa8c);})[_0xb8cb('0x38')](function(_0x2346d3){_0x5dc574[_0xb8cb('0x40')]=_0x2346d3['access_token'];_0x5dc574[_0xb8cb('0x3d')]=_0x2346d3[_0xb8cb('0x3c')];return db[_0xb8cb('0x3a')][_0xb8cb('0x41')]({'data5':_0x5dc574[_0xb8cb('0x40')],'data6':_0x5dc574[_0xb8cb('0x3d')]},{'where':{'id':_0x5dc574['id']}});})[_0xb8cb('0x38')](function(){return _0x5dc574;})['catch'](function(_0x1b7b1e){logger[_0xb8cb('0x42')](_0xb8cb('0x43'),_0x5dc574['id'],_0x1b7b1e);});}function getOauth2MicrosoftAccessToken(_0x1bcf58,_0x2a56f0){var _0x4fd6d8={'grant_type':_0xb8cb('0x44'),'code':_0x1bcf58,'scope':getAccessTokenScope(_0x2a56f0),'redirect_uri':_0x2a56f0[_0xb8cb('0x2a')],'client_id':_0x2a56f0['data1'],'client_secret':encryptor[_0xb8cb('0x3e')](_0x2a56f0[_0xb8cb('0x39')])};var _0x44e6a3={'method':_0xb8cb('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xb8cb('0x1e')](_0xb8cb('0x1f'),_0x2a56f0[_0xb8cb('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4fd6d8,'json':!![]};return rp(_0x44e6a3);}function startRefreshInterval(_0x57b330){var _0x368fc9=schedule[_0xb8cb('0x45')];if(_0x368fc9[_0x57b330['id']])clearInterval(_0x368fc9[_0x57b330['id']]);_0x368fc9[_0x57b330['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x57b330['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x368fc9;}function startAllRefreshIntervals(){return db[_0xb8cb('0x3a')][_0xb8cb('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x41de55){var _0x12cc53=_0x41de55[_0xb8cb('0x16')](function(_0x2ef019){return refreshOauth2MicrosoftAccessToken(_0x2ef019)[_0xb8cb('0x38')](function(_0x53b4c5){startRefreshInterval(_0x53b4c5);});});return Promise[_0xb8cb('0x47')](_0x12cc53);})[_0xb8cb('0x48')](function(_0x351b0e){var _0x456f2c=_0x351b0e?util[_0xb8cb('0x49')](_0x351b0e,{'showHidden':![],'depth':null}):'';logger['error'](_0xb8cb('0x4a'),_0x456f2c);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x105f=['from','stringify','toString','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','value','oauth2Claims','oauth2/','payload','iss','issuer','aud','audience','isAfter','unix','then','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','data2','access_token','CloudProvider','update','catch','error','authorization_code','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','ioredis','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','offline_access','/authorize','map','type','Dynamics365','push','data7','/.default','join','replace'];(function(_0x3be2f4,_0x10adc6){var _0x322b2d=function(_0x3fafb5){while(--_0x3fafb5){_0x3be2f4['push'](_0x3be2f4['shift']());}};_0x322b2d(++_0x10adc6);}(_0x105f,0x74));var _0xf105=function(_0x5ba7f2,_0x5cd294){_0x5ba7f2=_0x5ba7f2-0x0;var _0x2746e=_0x105f[_0x5ba7f2];return _0x2746e;};'use strict';var _=require('lodash');var crypto=require(_0xf105('0x0'));var jwt=require(_0xf105('0x1'));var moment=require('moment');var Redis=require(_0xf105('0x2'));var rp=require('request-promise');var util=require(_0xf105('0x3'));var encryptor=require(_0xf105('0x4'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xf105('0x5'));var schedule=require(_0xf105('0x6'));var db=require(_0xf105('0x7'))['db'];config['redis']=_[_0xf105('0x8')](config[_0xf105('0x9')],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xf105('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf105('0xb'),'profile',_0xf105('0xc'),'offline_access',_0xf105('0xd'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xf105('0xb'),_0xf105('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0xf105('0xf');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x49b7d4){var _0x4c21b4=_[_0xf105('0x10')](AZURE_AUTH_SCOPES[_0x49b7d4[_0xf105('0x11')]]);if(_0x49b7d4[_0xf105('0x11')]===_0xf105('0x12'))_0x4c21b4[_0xf105('0x13')](_0x49b7d4[_0xf105('0x14')]+_0xf105('0x15'));return _0x4c21b4[_0xf105('0x16')]('\x20');}function getAccessTokenScope(_0x36de8f){if(_0x36de8f[_0xf105('0x11')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x36de8f[_0xf105('0x11')]===_0xf105('0x12'))return _0x36de8f[_0xf105('0x14')]+_0xf105('0x15');}function generateMicrosoftAuthorizationUrl(_0x504fa2,_0xc8461e){var _0x3a2d9a=MICROSOFT_AUTH_URL[_0xf105('0x17')]('{TENANT_ID}',_0x504fa2['data2']);var _0x4310ba=['code','id_token'];var _0x402dd5=Buffer[_0xf105('0x18')](JSON[_0xf105('0x19')]({'id':_0xc8461e}))[_0xf105('0x1a')]('base64');var _0xdb63a8=crypto[_0xf105('0x1b')](0x10)[_0xf105('0x1a')](_0xf105('0x1c'));var _0x4b8d45=getAuthorizationScopes(_0x504fa2);var _0x13f0d8=[{'key':_0xf105('0x1d'),'value':_0x504fa2[_0xf105('0x1e')]},{'key':_0xf105('0x1f'),'value':encodeURIComponent(_0x4310ba[_0xf105('0x16')]('\x20'))},{'key':_0xf105('0x20'),'value':_0x504fa2[_0xf105('0x21')]},{'key':_0xf105('0x22'),'value':_0xf105('0x23')},{'key':'scope','value':encodeURIComponent(_0x4b8d45)},{'key':_0xf105('0x24'),'value':_0x402dd5},{'key':_0xf105('0x25'),'value':_0xdb63a8},{'key':_0xf105('0x26'),'value':'login'}];var _0x4babf2=_0x3a2d9a+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf105('0x10')](_0x13f0d8,function(_0x4a91ce){return _0x4a91ce['key']+'='+_0x4a91ce[_0xf105('0x27')];})['join']('&');_0x504fa2[_0xf105('0x28')]={'issuer':_0x3a2d9a[_0xf105('0x17')](_0xf105('0x29'),''),'audience':_0x504fa2[_0xf105('0x1e')],'state':_0x402dd5,'nonce':_0xdb63a8};redis['set'](_0x402dd5,JSON[_0xf105('0x19')](_0x504fa2));return _0x4babf2;}function isValidIdToken(_0x5b2e1c,_0x1de201){try{var _0x33cb36=jwt['decode'](_0x5b2e1c,{'complete':!![]});var _0x129794=_0x33cb36[_0xf105('0x2a')];if(_0x129794[_0xf105('0x2b')]!==_0x1de201[_0xf105('0x2c')])return![];if(_0x129794[_0xf105('0x2d')]!==_0x1de201[_0xf105('0x2e')])return![];if(_0x129794[_0xf105('0x25')]!==_0x1de201[_0xf105('0x25')])return![];if(moment()[_0xf105('0x2f')](moment[_0xf105('0x30')](_0x129794['exp'])))return![];return!![];}catch(_0x190cfe){throw _0x190cfe;}}function refreshOauth2MicrosoftAccessToken(_0x10fcb8){return Promise['resolve']()[_0xf105('0x31')](function(){if(_0x10fcb8['data3'])return _0x10fcb8;return db['CloudProvider'][_0xf105('0x32')]({'where':{'id':_0x10fcb8['id']},'raw':!![]});})['then'](function(_0xa29b9b){var _0x1808e5={'grant_type':_0xf105('0x33'),'refresh_token':_0xa29b9b[_0xf105('0x34')],'scope':getAccessTokenScope(_0xa29b9b),'redirect_uri':_0xa29b9b[_0xf105('0x21')],'client_id':_0xa29b9b[_0xf105('0x1e')],'client_secret':encryptor[_0xf105('0x35')](_0xa29b9b['data3'])};var _0x15e4a3={'method':_0xf105('0x36'),'uri':MICROSOFT_AUTH_URL[_0xf105('0x17')](_0xf105('0x37'),_0xa29b9b[_0xf105('0x38')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1808e5,'json':!![]};return rp(_0x15e4a3);})['then'](function(_0x4a0e2e){_0x10fcb8['data5']=_0x4a0e2e[_0xf105('0x39')];_0x10fcb8['data6']=_0x4a0e2e[_0xf105('0x33')];return db[_0xf105('0x3a')][_0xf105('0x3b')]({'data5':_0x10fcb8['data5'],'data6':_0x10fcb8[_0xf105('0x34')]},{'where':{'id':_0x10fcb8['id']}});})[_0xf105('0x31')](function(){return _0x10fcb8;})[_0xf105('0x3c')](function(_0x1ee8c9){logger[_0xf105('0x3d')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x10fcb8['id'],_0x1ee8c9);});}function getOauth2MicrosoftAccessToken(_0x1cc133,_0x185778){var _0x56a7cd={'grant_type':_0xf105('0x3e'),'code':_0x1cc133,'scope':getAccessTokenScope(_0x185778),'redirect_uri':_0x185778[_0xf105('0x21')],'client_id':_0x185778[_0xf105('0x1e')],'client_secret':encryptor[_0xf105('0x35')](_0x185778['data3'])};var _0x1c5f5d={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xf105('0x17')](_0xf105('0x37'),_0x185778[_0xf105('0x38')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x56a7cd,'json':!![]};return rp(_0x1c5f5d);}function startRefreshInterval(_0x2fd7c6){var _0x256480=schedule[_0xf105('0x3f')];if(_0x256480[_0x2fd7c6['id']])clearInterval(_0x256480[_0x2fd7c6['id']]);_0x256480[_0x2fd7c6['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xf105('0x40')](this,{'id':_0x2fd7c6['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf105('0x3f')]=_0x256480;}function startAllRefreshIntervals(){return db[_0xf105('0x3a')][_0xf105('0x41')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf105('0x31')](function(_0x2b0179){var _0x525f63=_0x2b0179[_0xf105('0x10')](function(_0x312178){return refreshOauth2MicrosoftAccessToken(_0x312178)['then'](function(_0x3dde71){startRefreshInterval(_0x3dde71);});});return Promise[_0xf105('0x42')](_0x525f63);})[_0xf105('0x3c')](function(_0x1ce099){var _0x4800b3=_0x1ce099?util[_0xf105('0x43')](_0x1ce099,{'showHidden':![],'depth':null}):'';logger[_0xf105('0x3d')](_0xf105('0x44'),_0x4800b3);});}module[_0xf105('0x45')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 4b0657c..6faa3e7 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 _0xae24=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4b3acc,_0x3df83c){var _0x29cd65=function(_0x33d8d0){while(--_0x33d8d0){_0x4b3acc['push'](_0x4b3acc['shift']());}};_0x29cd65(++_0x3df83c);}(_0xae24,0x180));var _0x4ae2=function(_0x9b62e3,_0x223ec4){_0x9b62e3=_0x9b62e3-0x0;var _0x17d1bc=_0xae24[_0x9b62e3];return _0x17d1bc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4ae2('0x0'));var BPromise=require(_0x4ae2('0x1'));var rs=require(_0x4ae2('0x2'));var fs=require('fs');var Redis=require(_0x4ae2('0x3'));var db=require(_0x4ae2('0x4'))['db'];var utils=require(_0x4ae2('0x5'));var logger=require(_0x4ae2('0x6'))(_0x4ae2('0x7'));var config=require(_0x4ae2('0x8'));var jayson=require(_0x4ae2('0x9'));var client=jayson['client'][_0x4ae2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46b90b,_0xda7751,_0x596c50){return new BPromise(function(_0x583af6,_0x1533d0){return client[_0x4ae2('0xb')](_0x46b90b,_0x596c50)[_0x4ae2('0xc')](function(_0x1b19cd){logger[_0x4ae2('0xd')](_0x4ae2('0xe'),_0xda7751,_0x4ae2('0xf'));logger[_0x4ae2('0x10')](_0x4ae2('0x11'),_0xda7751,'request\x20sent',JSON[_0x4ae2('0x12')](_0x1b19cd));if(_0x1b19cd[_0x4ae2('0x13')]){if(_0x1b19cd['error'][_0x4ae2('0x14')]===0x1f4){logger['error'](_0x4ae2('0xe'),_0xda7751,_0x1b19cd[_0x4ae2('0x13')]['message']);return _0x1533d0(_0x1b19cd[_0x4ae2('0x13')]['message']);}logger[_0x4ae2('0x13')](_0x4ae2('0xe'),_0xda7751,_0x1b19cd['error'][_0x4ae2('0x15')]);return _0x583af6(_0x1b19cd[_0x4ae2('0x13')][_0x4ae2('0x15')]);}else{logger[_0x4ae2('0xd')](_0x4ae2('0xe'),_0xda7751,_0x4ae2('0xf'));_0x583af6(_0x1b19cd[_0x4ae2('0x16')][_0x4ae2('0x15')]);}})[_0x4ae2('0x17')](function(_0x154df2){logger[_0x4ae2('0x13')]('CloudProvider,\x20%s,\x20%s',_0xda7751,_0x154df2);_0x1533d0(_0x154df2);});});} \ No newline at end of file +var _0x6ab9=['jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x46d960,_0x1e39ec){var _0xb573f5=function(_0x23656a){while(--_0x23656a){_0x46d960['push'](_0x46d960['shift']());}};_0xb573f5(++_0x1e39ec);}(_0x6ab9,0x19a));var _0x96ab=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x6ab9[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0x96ab('0x0'));var util=require(_0x96ab('0x1'));var moment=require('moment');var BPromise=require(_0x96ab('0x2'));var rs=require(_0x96ab('0x3'));var fs=require('fs');var Redis=require(_0x96ab('0x4'));var db=require(_0x96ab('0x5'))['db'];var utils=require(_0x96ab('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x96ab('0x7'));var jayson=require(_0x96ab('0x8'));var client=jayson[_0x96ab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d2a35,_0xf8e2b1,_0x516cf7){return new BPromise(function(_0x313efb,_0x1e3f17){return client[_0x96ab('0xa')](_0x3d2a35,_0x516cf7)[_0x96ab('0xb')](function(_0x39b50e){logger[_0x96ab('0xc')](_0x96ab('0xd'),_0xf8e2b1,_0x96ab('0xe'));logger[_0x96ab('0xf')](_0x96ab('0x10'),_0xf8e2b1,_0x96ab('0xe'),JSON[_0x96ab('0x11')](_0x39b50e));if(_0x39b50e[_0x96ab('0x12')]){if(_0x39b50e['error'][_0x96ab('0x13')]===0x1f4){logger['error'](_0x96ab('0xd'),_0xf8e2b1,_0x39b50e[_0x96ab('0x12')][_0x96ab('0x14')]);return _0x1e3f17(_0x39b50e[_0x96ab('0x12')][_0x96ab('0x14')]);}logger[_0x96ab('0x12')](_0x96ab('0xd'),_0xf8e2b1,_0x39b50e[_0x96ab('0x12')][_0x96ab('0x14')]);return _0x313efb(_0x39b50e[_0x96ab('0x12')][_0x96ab('0x14')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0xf8e2b1,_0x96ab('0xe'));_0x313efb(_0x39b50e[_0x96ab('0x15')][_0x96ab('0x14')]);}})['catch'](function(_0x43e35e){logger[_0x96ab('0x12')]('CloudProvider,\x20%s,\x20%s',_0xf8e2b1,_0x43e35e);_0x1e3f17(_0x43e35e);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 219c87f..0e37aa1 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xadb5,0xad));var _0x5adb=function(_0x2f147f,_0x25e3f9){_0x2f147f=_0x2f147f-0x0;var _0x4b489b=_0xadb5[_0x2f147f];return _0x4b489b;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file +var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x468624,_0x4733e2){var _0x1f55be=function(_0x2c76eb){while(--_0x2c76eb){_0x468624['push'](_0x468624['shift']());}};_0x1f55be(++_0x4733e2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index d6258e6..22d1ec7 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 _0x1b0b=['STRING','name','sequelize'];(function(_0xd4470d,_0x47318d){var _0x5544c5=function(_0x3486cb){while(--_0x3486cb){_0xd4470d['push'](_0xd4470d['shift']());}};_0x5544c5(++_0x47318d);}(_0x1b0b,0x16d));var _0xb1b0=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x1b0b[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0xb1b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xb1b0('0x1')],'unique':_0xb1b0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb1b0('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xb1b0('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xb1b0('0x1')]},'type':{'type':Sequelize[_0xb1b0('0x1')]},'street':{'type':Sequelize[_0xb1b0('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xb1b0('0x1')]},'country':{'type':Sequelize[_0xb1b0('0x1')]},'email':{'type':Sequelize[_0xb1b0('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb1b0('0x1')]},'sStreet':{'type':Sequelize[_0xb1b0('0x1')]},'sPostalCode':{'type':Sequelize[_0xb1b0('0x1')]},'sCity':{'type':Sequelize[_0xb1b0('0x1')]},'sCountry':{'type':Sequelize[_0xb1b0('0x1')]},'description':{'type':Sequelize[_0xb1b0('0x1')]}}; \ No newline at end of file +var _0xe3fb=['sequelize','STRING','name'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xe3fb,0x9c));var _0xbe3f=function(_0x41cd93,_0x382eb8){_0x41cd93=_0x41cd93-0x0;var _0x58a7f8=_0xe3fb[_0x41cd93];return _0x58a7f8;};'use strict';var Sequelize=require(_0xbe3f('0x0'));module['exports']={'name':{'type':Sequelize[_0xbe3f('0x1')],'unique':_0xbe3f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xbe3f('0x1')]},'website':{'type':Sequelize[_0xbe3f('0x1')]},'phone':{'type':Sequelize[_0xbe3f('0x1')]},'fax':{'type':Sequelize[_0xbe3f('0x1')]},'type':{'type':Sequelize[_0xbe3f('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xbe3f('0x1')]},'city':{'type':Sequelize[_0xbe3f('0x1')]},'country':{'type':Sequelize[_0xbe3f('0x1')]},'email':{'type':Sequelize[_0xbe3f('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbe3f('0x1')]},'sStreet':{'type':Sequelize[_0xbe3f('0x1')]},'sPostalCode':{'type':Sequelize[_0xbe3f('0x1')]},'sCity':{'type':Sequelize[_0xbe3f('0x1')]},'sCountry':{'type':Sequelize[_0xbe3f('0x1')]},'description':{'type':Sequelize[_0xbe3f('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index aa0414f..e31ce99 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 _0x816c=['query','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','map','options','includeAll','include','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','ids','omit','getContacts','pick','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','Companies','UserProfileResource','destroy','error','send','index','CmCompany','describe','model','keys'];(function(_0x4cbb95,_0x4a3da5){var _0x567495=function(_0x3397c0){while(--_0x3397c0){_0x4cbb95['push'](_0x4cbb95['shift']());}};_0x567495(++_0x4a3da5);}(_0x816c,0x119));var _0xc816=function(_0x265fd0,_0x384bf5){_0x265fd0=_0x265fd0-0x0;var _0x3a6ce1=_0x816c[_0x265fd0];return _0x3a6ce1;};'use strict';var emlformat=require(_0xc816('0x0'));var rimraf=require(_0xc816('0x1'));var zipdir=require(_0xc816('0x2'));var jsonpatch=require(_0xc816('0x3'));var rp=require('request-promise');var moment=require(_0xc816('0x4'));var BPromise=require(_0xc816('0x5'));var Mustache=require(_0xc816('0x6'));var util=require(_0xc816('0x7'));var path=require(_0xc816('0x8'));var sox=require(_0xc816('0x9'));var csv=require(_0xc816('0xa'));var ejs=require(_0xc816('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc816('0xc'));var squel=require(_0xc816('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc816('0xe'));var toCsv=require(_0xc816('0xa'));var querystring=require(_0xc816('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc816('0x10'));var qs=require(_0xc816('0x11'));var as=require(_0xc816('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc816('0x13'))('api');var utils=require(_0xc816('0x14'));var config=require(_0xc816('0x15'));var licenseUtil=require(_0xc816('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ccea6,_0x38c6e3){_0x38c6e3=_0x38c6e3||0xcc;return function(_0x825fa3){if(_0x825fa3){return _0x2ccea6[_0xc816('0x17')](_0x38c6e3);}return _0x2ccea6[_0xc816('0x18')](_0x38c6e3)[_0xc816('0x19')]();};}function respondWithResult(_0xd36602,_0x28b88c){_0x28b88c=_0x28b88c||0xc8;return function(_0x240243){if(_0x240243){return _0xd36602[_0xc816('0x18')](_0x28b88c)[_0xc816('0x1a')](_0x240243);}};}function respondWithFilteredResult(_0x40be37,_0x471dca){return function(_0x5dcc0e){if(_0x5dcc0e){var _0x2a5cda=typeof _0x471dca[_0xc816('0x1b')]===_0xc816('0x1c')&&typeof _0x471dca[_0xc816('0x1d')]===_0xc816('0x1c');var _0x1bf73a=_0x5dcc0e[_0xc816('0x1e')];var _0x1336cb=_0x2a5cda?0x0:_0x471dca[_0xc816('0x1b')];var _0x4c3ae6=_0x2a5cda?_0x5dcc0e[_0xc816('0x1e')]:_0x471dca[_0xc816('0x1b')]+_0x471dca[_0xc816('0x1d')];var _0x37be7e;if(_0x4c3ae6>=_0x1bf73a){_0x4c3ae6=_0x1bf73a;_0x37be7e=0xc8;}else{_0x37be7e=0xce;}_0x40be37[_0xc816('0x18')](_0x37be7e);return _0x40be37['set'](_0xc816('0x1f'),_0x1336cb+'-'+_0x4c3ae6+'/'+_0x1bf73a)[_0xc816('0x1a')](_0x5dcc0e);}return null;};}function patchUpdates(_0x36af42){return function(_0x1e7af7){try{jsonpatch[_0xc816('0x20')](_0x1e7af7,_0x36af42,!![]);}catch(_0x4c60f4){return BPromise[_0xc816('0x21')](_0x4c60f4);}return _0x1e7af7[_0xc816('0x22')]();};}function saveUpdates(_0x1c59e7,_0x145723){return function(_0x281032){if(_0x281032){return _0x281032['update'](_0x1c59e7)[_0xc816('0x23')](function(_0x2fbd3c){return _0x2fbd3c;});}return null;};}function removeEntity(_0x445bae,_0x50fb58){return function(_0x3a6d64){if(_0x3a6d64){return _0x3a6d64['destroy']()[_0xc816('0x23')](function(){var _0x847710=_0x3a6d64[_0xc816('0x24')]({'plain':!![]});var _0x1b89d8=_0xc816('0x25');return db[_0xc816('0x26')][_0xc816('0x27')]({'where':{'type':_0x1b89d8,'resourceId':_0x847710['id']}})[_0xc816('0x23')](function(){return _0x3a6d64;});})[_0xc816('0x23')](function(){_0x445bae[_0xc816('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfbf4e4,_0x3f9d27){return function(_0x48b486){if(!_0x48b486){_0xfbf4e4[_0xc816('0x17')](0x194);}return _0x48b486;};}function handleError(_0x7652fb,_0x23d0b7){_0x23d0b7=_0x23d0b7||0x1f4;return function(_0x159e3f){logger[_0xc816('0x28')](_0x159e3f['stack']);if(_0x159e3f['name']){delete _0x159e3f['name'];}_0x7652fb[_0xc816('0x18')](_0x23d0b7)[_0xc816('0x29')](_0x159e3f);};}exports[_0xc816('0x2a')]=function(_0x397d80,_0x2ecbb3){var _0x1f39cc={},_0x5df332={},_0x31230b={'count':0x0,'rows':[]};return db[_0xc816('0x2b')][_0xc816('0x2c')]()[_0xc816('0x23')](function(_0x488b7c){_0x5df332[_0xc816('0x2d')]=_[_0xc816('0x2e')](_0x488b7c);_0x5df332[_0xc816('0x2f')]=_[_0xc816('0x2e')](_0x397d80[_0xc816('0x2f')]);_0x5df332[_0xc816('0x30')]=_['intersection'](_0x5df332[_0xc816('0x2d')],_0x5df332[_0xc816('0x2f')]);_0x1f39cc[_0xc816('0x31')]=_[_0xc816('0x32')](_0x5df332[_0xc816('0x2d')],qs[_0xc816('0x33')](_0x397d80[_0xc816('0x2f')][_0xc816('0x33')]));_0x1f39cc[_0xc816('0x31')]=_0x1f39cc[_0xc816('0x31')][_0xc816('0x34')]?_0x1f39cc[_0xc816('0x31')]:_0x5df332['model'];if(!_0x397d80[_0xc816('0x2f')]['hasOwnProperty']('nolimit')){_0x1f39cc[_0xc816('0x1d')]=qs[_0xc816('0x1d')](_0x397d80[_0xc816('0x2f')][_0xc816('0x1d')]);_0x1f39cc[_0xc816('0x1b')]=qs['offset'](_0x397d80['query'][_0xc816('0x1b')]);}_0x1f39cc[_0xc816('0x35')]=qs[_0xc816('0x36')](_0x397d80['query'][_0xc816('0x36')]);_0x1f39cc[_0xc816('0x37')]=qs[_0xc816('0x30')](_['pick'](_0x397d80[_0xc816('0x2f')],_0x5df332['filters']),_0x488b7c);if(_0x397d80[_0xc816('0x2f')][_0xc816('0x38')]){_0x1f39cc[_0xc816('0x37')]=_[_0xc816('0x39')](_0x1f39cc[_0xc816('0x37')],{'$or':_[_0xc816('0x3a')](_0x1f39cc[_0xc816('0x31')],function(_0x1556ea){var _0x59183c={};_0x59183c[_0x1556ea]={'$like':'%'+_0x397d80[_0xc816('0x2f')][_0xc816('0x38')]+'%'};return _0x59183c;})});}_0x1f39cc=_[_0xc816('0x39')]({},_0x1f39cc,_0x397d80[_0xc816('0x3b')]);var _0x4d7776={'where':_0x1f39cc[_0xc816('0x37')]};return db['CmCompany']['count'](_0x4d7776)[_0xc816('0x23')](function(_0x3bf6f0){_0x31230b['count']=_0x3bf6f0;if(_0x397d80[_0xc816('0x2f')][_0xc816('0x3c')]){_0x1f39cc[_0xc816('0x3d')]=[{'all':!![]}];}return db[_0xc816('0x2b')]['findAll'](_0x1f39cc);})[_0xc816('0x23')](function(_0x373d1f){_0x31230b['rows']=_0x373d1f;return _0x31230b;})[_0xc816('0x23')](respondWithFilteredResult(_0x2ecbb3,_0x1f39cc))[_0xc816('0x3e')](handleError(_0x2ecbb3,null));})[_0xc816('0x3e')](handleError(_0x2ecbb3,null));};exports['show']=function(_0x4987ac,_0x62174f){var _0x1d8ace={'raw':![],'where':{'id':_0x4987ac[_0xc816('0x3f')]['id']}},_0x2d33ff={};_0x2d33ff[_0xc816('0x2d')]=_[_0xc816('0x2e')](db[_0xc816('0x2b')]['rawAttributes']);_0x2d33ff[_0xc816('0x2f')]=_['keys'](_0x4987ac[_0xc816('0x2f')]);_0x2d33ff[_0xc816('0x30')]=_[_0xc816('0x32')](_0x2d33ff[_0xc816('0x2d')],_0x2d33ff[_0xc816('0x2f')]);_0x1d8ace[_0xc816('0x31')]=_[_0xc816('0x32')](_0x2d33ff['model'],qs[_0xc816('0x33')](_0x4987ac[_0xc816('0x2f')][_0xc816('0x33')]));_0x1d8ace[_0xc816('0x31')]=_0x1d8ace[_0xc816('0x31')]['length']?_0x1d8ace[_0xc816('0x31')]:_0x2d33ff[_0xc816('0x2d')];if(_0x4987ac['query'][_0xc816('0x3c')]){_0x1d8ace[_0xc816('0x3d')]=[{'all':!![]}];}_0x1d8ace=_[_0xc816('0x39')]({},_0x1d8ace,_0x4987ac[_0xc816('0x3b')]);return db[_0xc816('0x2b')][_0xc816('0x40')](_0x1d8ace)[_0xc816('0x23')](handleEntityNotFound(_0x62174f,null))[_0xc816('0x23')](respondWithResult(_0x62174f,null))[_0xc816('0x3e')](handleError(_0x62174f,null));};exports['create']=function(_0x2c6d9a,_0x522e68){return db[_0xc816('0x2b')][_0xc816('0x41')](_0x2c6d9a[_0xc816('0x42')],{})[_0xc816('0x23')](function(_0x15beda){var _0x4ee722=_0x2c6d9a[_0xc816('0x43')][_0xc816('0x24')]({'plain':!![]});if(!_0x4ee722)throw new Error(_0xc816('0x44'));if(_0x4ee722[_0xc816('0x45')]==='user'){var _0x2e883c=_0x15beda[_0xc816('0x24')]({'plain':!![]});var _0x53ab5e='Companies';return db[_0xc816('0x46')]['find']({'where':{'name':_0x53ab5e,'userProfileId':_0x4ee722[_0xc816('0x47')]},'raw':!![]})[_0xc816('0x23')](function(_0x35d8c9){if(_0x35d8c9&&_0x35d8c9['autoAssociation']===0x0){return db[_0xc816('0x26')][_0xc816('0x41')]({'name':_0x2e883c[_0xc816('0x48')],'resourceId':_0x2e883c['id'],'type':_0x35d8c9[_0xc816('0x48')],'sectionId':_0x35d8c9['id']},{})[_0xc816('0x23')](function(){return _0x15beda;});}else{return _0x15beda;}})['catch'](function(_0x3d4cc9){logger[_0xc816('0x28')](_0xc816('0x49'),_0x3d4cc9);throw _0x3d4cc9;});}return _0x15beda;})['then'](respondWithResult(_0x522e68,0xc9))['catch'](handleError(_0x522e68,null));};exports[_0xc816('0x4a')]=function(_0x314678,_0x428e59){if(_0x314678[_0xc816('0x42')]['id']){delete _0x314678[_0xc816('0x42')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x314678[_0xc816('0x3f')]['id']}})['then'](handleEntityNotFound(_0x428e59,null))['then'](saveUpdates(_0x314678[_0xc816('0x42')],null))['then'](respondWithResult(_0x428e59,null))[_0xc816('0x3e')](handleError(_0x428e59,null));};exports['destroy']=function(_0x5a4f3f,_0x354547){return db[_0xc816('0x2b')][_0xc816('0x40')]({'where':{'id':_0x5a4f3f[_0xc816('0x3f')]['id']}})[_0xc816('0x23')](handleEntityNotFound(_0x354547,null))[_0xc816('0x23')](removeEntity(_0x354547,null))[_0xc816('0x3e')](handleError(_0x354547,null));};exports[_0xc816('0x2c')]=function(_0x2da5b7,_0xb52cde){return db['CmCompany'][_0xc816('0x2c')]()[_0xc816('0x23')](respondWithResult(_0xb52cde,null))[_0xc816('0x3e')](handleError(_0xb52cde,null));};exports[_0xc816('0x4b')]=function(_0xe4ab04,_0x30d71d,_0x3d51d7){return db['CmContact'][_0xc816('0x40')]({'where':{'id':_0xe4ab04[_0xc816('0x3f')]['id']}})[_0xc816('0x23')](handleEntityNotFound(_0x30d71d,null))[_0xc816('0x23')](function(_0xae7a03){if(_0xae7a03){return _0xae7a03[_0xc816('0x4b')](_0xe4ab04[_0xc816('0x42')][_0xc816('0x4c')],_[_0xc816('0x4d')](_0xe4ab04[_0xc816('0x42')],[_0xc816('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x30d71d,null))[_0xc816('0x3e')](handleError(_0x30d71d,null));};exports[_0xc816('0x4e')]=function(_0x5f979b,_0x5b24e6,_0x3ee857){var _0x4dbc4e={};var _0x52b5a9={};var _0x2151e8;var _0x11e4ee;return db['CmCompany']['findOne']({'where':{'id':_0x5f979b['params']['id']}})[_0xc816('0x23')](handleEntityNotFound(_0x5b24e6,null))[_0xc816('0x23')](function(_0x216d95){if(_0x216d95){_0x2151e8=_0x216d95;_0x52b5a9[_0xc816('0x2d')]=_[_0xc816('0x2e')](db['CmContact']['rawAttributes']);_0x52b5a9[_0xc816('0x2f')]=_[_0xc816('0x2e')](_0x5f979b[_0xc816('0x2f')]);_0x52b5a9[_0xc816('0x30')]=_['intersection'](_0x52b5a9[_0xc816('0x2d')],_0x52b5a9[_0xc816('0x2f')]);_0x4dbc4e[_0xc816('0x31')]=_[_0xc816('0x32')](_0x52b5a9['model'],qs[_0xc816('0x33')](_0x5f979b[_0xc816('0x2f')][_0xc816('0x33')]));_0x4dbc4e['attributes']=_0x4dbc4e[_0xc816('0x31')]['length']?_0x4dbc4e['attributes']:_0x52b5a9[_0xc816('0x2d')];_0x4dbc4e[_0xc816('0x35')]=qs[_0xc816('0x36')](_0x5f979b[_0xc816('0x2f')][_0xc816('0x36')]);_0x4dbc4e[_0xc816('0x37')]=qs['filters'](_[_0xc816('0x4f')](_0x5f979b[_0xc816('0x2f')],_0x52b5a9[_0xc816('0x30')]));if(_0x5f979b[_0xc816('0x2f')][_0xc816('0x38')]){_0x4dbc4e[_0xc816('0x37')]=_[_0xc816('0x39')](_0x4dbc4e[_0xc816('0x37')],{'$or':_[_0xc816('0x3a')](_0x4dbc4e[_0xc816('0x31')],function(_0x361a13){var _0x323911={};_0x323911[_0x361a13]={'$like':'%'+_0x5f979b['query'][_0xc816('0x38')]+'%'};return _0x323911;})});}_0x4dbc4e=_['merge']({},_0x4dbc4e,_0x5f979b[_0xc816('0x3b')]);return _0x2151e8[_0xc816('0x4e')](_0x4dbc4e);}})[_0xc816('0x23')](function(_0x54c259){if(_0x54c259){_0x11e4ee=_0x54c259[_0xc816('0x34')];if(!_0x5f979b['query'][_0xc816('0x50')](_0xc816('0x51'))){_0x4dbc4e[_0xc816('0x1d')]=qs[_0xc816('0x1d')](_0x5f979b[_0xc816('0x2f')][_0xc816('0x1d')]);_0x4dbc4e[_0xc816('0x1b')]=qs[_0xc816('0x1b')](_0x5f979b[_0xc816('0x2f')]['offset']);}return _0x2151e8['getContacts'](_0x4dbc4e);}})[_0xc816('0x23')](function(_0x59a771){if(_0x59a771){return _0x59a771?{'count':_0x11e4ee,'rows':_0x59a771}:null;}})[_0xc816('0x23')](respondWithResult(_0x5b24e6,null))[_0xc816('0x3e')](handleError(_0x5b24e6,null));}; \ No newline at end of file +var _0x4796=['role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','omit','getContacts','findOne','rawAttributes','hasOwnProperty','nolimit','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','end','error','stack','name','send','index','CmCompany','describe','keys','query','filters','model','intersection','fields','attributes','order','sort','where','pick','filter','map','merge','options','includeAll','include','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x36c3ac,_0x4e0f0d){var _0x249daa=function(_0x3ccd08){while(--_0x3ccd08){_0x36c3ac['push'](_0x36c3ac['shift']());}};_0x249daa(++_0x4e0f0d);}(_0x4796,0x1bf));var _0x6479=function(_0x3a6e93,_0x1fce45){_0x3a6e93=_0x3a6e93-0x0;var _0x50302e=_0x4796[_0x3a6e93];return _0x50302e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6479('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6479('0x1'));var rp=require(_0x6479('0x2'));var moment=require(_0x6479('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6479('0x4'));var path=require('path');var sox=require(_0x6479('0x5'));var csv=require(_0x6479('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6479('0x7'));var _=require(_0x6479('0x8'));var squel=require(_0x6479('0x9'));var crypto=require(_0x6479('0xa'));var jsforce=require(_0x6479('0xb'));var deskjs=require(_0x6479('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6479('0xd'));var Papa=require('papaparse');var Redis=require(_0x6479('0xe'));var authService=require(_0x6479('0xf'));var qs=require(_0x6479('0x10'));var as=require(_0x6479('0x11'));var hardwareService=require(_0x6479('0x12'));var logger=require(_0x6479('0x13'))(_0x6479('0x14'));var utils=require(_0x6479('0x15'));var config=require(_0x6479('0x16'));var licenseUtil=require(_0x6479('0x17'));var db=require(_0x6479('0x18'))['db'];function respondWithStatusCode(_0x281202,_0x5555bc){_0x5555bc=_0x5555bc||0xcc;return function(_0x570c98){if(_0x570c98){return _0x281202[_0x6479('0x19')](_0x5555bc);}return _0x281202[_0x6479('0x1a')](_0x5555bc)['end']();};}function respondWithResult(_0x3635d7,_0x4594d1){_0x4594d1=_0x4594d1||0xc8;return function(_0x2a3eee){if(_0x2a3eee){return _0x3635d7['status'](_0x4594d1)[_0x6479('0x1b')](_0x2a3eee);}};}function respondWithFilteredResult(_0x4e83fa,_0x2b6c4f){return function(_0x46c5be){if(_0x46c5be){var _0x18a265=typeof _0x2b6c4f[_0x6479('0x1c')]==='undefined'&&typeof _0x2b6c4f[_0x6479('0x1d')]===_0x6479('0x1e');var _0x4af1a1=_0x46c5be['count'];var _0x47ed74=_0x18a265?0x0:_0x2b6c4f[_0x6479('0x1c')];var _0x41cdd6=_0x18a265?_0x46c5be[_0x6479('0x1f')]:_0x2b6c4f[_0x6479('0x1c')]+_0x2b6c4f['limit'];var _0x77fc8;if(_0x41cdd6>=_0x4af1a1){_0x41cdd6=_0x4af1a1;_0x77fc8=0xc8;}else{_0x77fc8=0xce;}_0x4e83fa['status'](_0x77fc8);return _0x4e83fa[_0x6479('0x20')](_0x6479('0x21'),_0x47ed74+'-'+_0x41cdd6+'/'+_0x4af1a1)[_0x6479('0x1b')](_0x46c5be);}return null;};}function patchUpdates(_0x1559d6){return function(_0x489c54){try{jsonpatch[_0x6479('0x22')](_0x489c54,_0x1559d6,!![]);}catch(_0x5780c1){return BPromise['reject'](_0x5780c1);}return _0x489c54[_0x6479('0x23')]();};}function saveUpdates(_0x51c1d1,_0x2f6618){return function(_0x5c90e7){if(_0x5c90e7){return _0x5c90e7[_0x6479('0x24')](_0x51c1d1)[_0x6479('0x25')](function(_0x36d2a0){return _0x36d2a0;});}return null;};}function removeEntity(_0x2459e6,_0x26d0c9){return function(_0x40b28e){if(_0x40b28e){return _0x40b28e[_0x6479('0x26')]()[_0x6479('0x25')](function(){var _0xa07a70=_0x40b28e[_0x6479('0x27')]({'plain':!![]});var _0x2c5ec1=_0x6479('0x28');return db[_0x6479('0x29')][_0x6479('0x26')]({'where':{'type':_0x2c5ec1,'resourceId':_0xa07a70['id']}})[_0x6479('0x25')](function(){return _0x40b28e;});})[_0x6479('0x25')](function(){_0x2459e6[_0x6479('0x1a')](0xcc)[_0x6479('0x2a')]();});}};}function handleEntityNotFound(_0x3c03fb,_0x18a38e){return function(_0x1f6283){if(!_0x1f6283){_0x3c03fb['sendStatus'](0x194);}return _0x1f6283;};}function handleError(_0x244c3f,_0x5f3dcd){_0x5f3dcd=_0x5f3dcd||0x1f4;return function(_0x1d8c74){logger[_0x6479('0x2b')](_0x1d8c74[_0x6479('0x2c')]);if(_0x1d8c74[_0x6479('0x2d')]){delete _0x1d8c74[_0x6479('0x2d')];}_0x244c3f['status'](_0x5f3dcd)[_0x6479('0x2e')](_0x1d8c74);};}exports[_0x6479('0x2f')]=function(_0x4129e2,_0x2ec740){var _0x2005c5={},_0x6752f0={},_0x51e5e7={'count':0x0,'rows':[]};return db[_0x6479('0x30')][_0x6479('0x31')]()['then'](function(_0x38136f){_0x6752f0['model']=_[_0x6479('0x32')](_0x38136f);_0x6752f0[_0x6479('0x33')]=_['keys'](_0x4129e2[_0x6479('0x33')]);_0x6752f0[_0x6479('0x34')]=_['intersection'](_0x6752f0[_0x6479('0x35')],_0x6752f0['query']);_0x2005c5['attributes']=_[_0x6479('0x36')](_0x6752f0['model'],qs[_0x6479('0x37')](_0x4129e2[_0x6479('0x33')][_0x6479('0x37')]));_0x2005c5[_0x6479('0x38')]=_0x2005c5[_0x6479('0x38')]['length']?_0x2005c5['attributes']:_0x6752f0['model'];if(!_0x4129e2[_0x6479('0x33')]['hasOwnProperty']('nolimit')){_0x2005c5[_0x6479('0x1d')]=qs[_0x6479('0x1d')](_0x4129e2[_0x6479('0x33')]['limit']);_0x2005c5['offset']=qs[_0x6479('0x1c')](_0x4129e2[_0x6479('0x33')]['offset']);}_0x2005c5[_0x6479('0x39')]=qs[_0x6479('0x3a')](_0x4129e2[_0x6479('0x33')]['sort']);_0x2005c5[_0x6479('0x3b')]=qs['filters'](_[_0x6479('0x3c')](_0x4129e2[_0x6479('0x33')],_0x6752f0[_0x6479('0x34')]),_0x38136f);if(_0x4129e2[_0x6479('0x33')][_0x6479('0x3d')]){_0x2005c5[_0x6479('0x3b')]=_['merge'](_0x2005c5['where'],{'$or':_[_0x6479('0x3e')](_0x2005c5[_0x6479('0x38')],function(_0x5d9ba0){var _0x4bb7bf={};_0x4bb7bf[_0x5d9ba0]={'$like':'%'+_0x4129e2[_0x6479('0x33')][_0x6479('0x3d')]+'%'};return _0x4bb7bf;})});}_0x2005c5=_[_0x6479('0x3f')]({},_0x2005c5,_0x4129e2[_0x6479('0x40')]);var _0x13f6fc={'where':_0x2005c5['where']};return db[_0x6479('0x30')][_0x6479('0x1f')](_0x13f6fc)['then'](function(_0xc06df5){_0x51e5e7[_0x6479('0x1f')]=_0xc06df5;if(_0x4129e2['query'][_0x6479('0x41')]){_0x2005c5[_0x6479('0x42')]=[{'all':!![]}];}return db[_0x6479('0x30')]['findAll'](_0x2005c5);})[_0x6479('0x25')](function(_0xe08cd2){_0x51e5e7['rows']=_0xe08cd2;return _0x51e5e7;})[_0x6479('0x25')](respondWithFilteredResult(_0x2ec740,_0x2005c5))[_0x6479('0x43')](handleError(_0x2ec740,null));})['catch'](handleError(_0x2ec740,null));};exports[_0x6479('0x44')]=function(_0x44f86a,_0x178377){var _0x98f568={'raw':![],'where':{'id':_0x44f86a['params']['id']}},_0x574955={};_0x574955[_0x6479('0x35')]=_['keys'](db['CmCompany']['rawAttributes']);_0x574955['query']=_[_0x6479('0x32')](_0x44f86a['query']);_0x574955['filters']=_[_0x6479('0x36')](_0x574955['model'],_0x574955[_0x6479('0x33')]);_0x98f568[_0x6479('0x38')]=_[_0x6479('0x36')](_0x574955[_0x6479('0x35')],qs['fields'](_0x44f86a['query'][_0x6479('0x37')]));_0x98f568[_0x6479('0x38')]=_0x98f568[_0x6479('0x38')][_0x6479('0x45')]?_0x98f568[_0x6479('0x38')]:_0x574955[_0x6479('0x35')];if(_0x44f86a[_0x6479('0x33')][_0x6479('0x41')]){_0x98f568[_0x6479('0x42')]=[{'all':!![]}];}_0x98f568=_[_0x6479('0x3f')]({},_0x98f568,_0x44f86a[_0x6479('0x40')]);return db[_0x6479('0x30')][_0x6479('0x46')](_0x98f568)[_0x6479('0x25')](handleEntityNotFound(_0x178377,null))['then'](respondWithResult(_0x178377,null))[_0x6479('0x43')](handleError(_0x178377,null));};exports[_0x6479('0x47')]=function(_0xacfee4,_0x4097e7){return db[_0x6479('0x30')][_0x6479('0x47')](_0xacfee4[_0x6479('0x48')],{})[_0x6479('0x25')](function(_0x53216b){var _0x3afb1d=_0xacfee4[_0x6479('0x49')]['get']({'plain':!![]});if(!_0x3afb1d)throw new Error(_0x6479('0x4a'));if(_0x3afb1d[_0x6479('0x4b')]===_0x6479('0x49')){var _0x5b7c90=_0x53216b[_0x6479('0x27')]({'plain':!![]});var _0x226d5b=_0x6479('0x28');return db['UserProfileSection'][_0x6479('0x46')]({'where':{'name':_0x226d5b,'userProfileId':_0x3afb1d[_0x6479('0x4c')]},'raw':!![]})['then'](function(_0x92eae6){if(_0x92eae6&&_0x92eae6['autoAssociation']===0x0){return db['UserProfileResource'][_0x6479('0x47')]({'name':_0x5b7c90[_0x6479('0x2d')],'resourceId':_0x5b7c90['id'],'type':_0x92eae6['name'],'sectionId':_0x92eae6['id']},{})[_0x6479('0x25')](function(){return _0x53216b;});}else{return _0x53216b;}})[_0x6479('0x43')](function(_0x3548c5){logger['error'](_0x6479('0x4d'),_0x3548c5);throw _0x3548c5;});}return _0x53216b;})['then'](respondWithResult(_0x4097e7,0xc9))[_0x6479('0x43')](handleError(_0x4097e7,null));};exports[_0x6479('0x24')]=function(_0x23f92d,_0x197889){if(_0x23f92d[_0x6479('0x48')]['id']){delete _0x23f92d[_0x6479('0x48')]['id'];}return db[_0x6479('0x30')][_0x6479('0x46')]({'where':{'id':_0x23f92d[_0x6479('0x4e')]['id']}})[_0x6479('0x25')](handleEntityNotFound(_0x197889,null))['then'](saveUpdates(_0x23f92d[_0x6479('0x48')],null))['then'](respondWithResult(_0x197889,null))[_0x6479('0x43')](handleError(_0x197889,null));};exports[_0x6479('0x26')]=function(_0x4b33f2,_0x4df883){return db[_0x6479('0x30')][_0x6479('0x46')]({'where':{'id':_0x4b33f2[_0x6479('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4df883,null))[_0x6479('0x25')](removeEntity(_0x4df883,null))[_0x6479('0x43')](handleError(_0x4df883,null));};exports['describe']=function(_0x29b1be,_0x305b2b){return db['CmCompany'][_0x6479('0x31')]()[_0x6479('0x25')](respondWithResult(_0x305b2b,null))[_0x6479('0x43')](handleError(_0x305b2b,null));};exports[_0x6479('0x4f')]=function(_0x157a61,_0x44d177,_0x20f5c1){return db[_0x6479('0x50')][_0x6479('0x46')]({'where':{'id':_0x157a61[_0x6479('0x4e')]['id']}})['then'](handleEntityNotFound(_0x44d177,null))['then'](function(_0x722844){if(_0x722844){return _0x722844['addContacts'](_0x157a61[_0x6479('0x48')]['ids'],_[_0x6479('0x51')](_0x157a61[_0x6479('0x48')],['ids','id'])||{});}})[_0x6479('0x25')](respondWithResult(_0x44d177,null))[_0x6479('0x43')](handleError(_0x44d177,null));};exports[_0x6479('0x52')]=function(_0x46182c,_0x4d7a52,_0x562ef4){var _0x4fb1ed={};var _0x13d86b={};var _0x41ead2;var _0x375a27;return db[_0x6479('0x30')][_0x6479('0x53')]({'where':{'id':_0x46182c['params']['id']}})[_0x6479('0x25')](handleEntityNotFound(_0x4d7a52,null))[_0x6479('0x25')](function(_0x4ce142){if(_0x4ce142){_0x41ead2=_0x4ce142;_0x13d86b[_0x6479('0x35')]=_[_0x6479('0x32')](db[_0x6479('0x50')][_0x6479('0x54')]);_0x13d86b[_0x6479('0x33')]=_['keys'](_0x46182c[_0x6479('0x33')]);_0x13d86b['filters']=_['intersection'](_0x13d86b[_0x6479('0x35')],_0x13d86b[_0x6479('0x33')]);_0x4fb1ed[_0x6479('0x38')]=_[_0x6479('0x36')](_0x13d86b['model'],qs[_0x6479('0x37')](_0x46182c[_0x6479('0x33')][_0x6479('0x37')]));_0x4fb1ed[_0x6479('0x38')]=_0x4fb1ed[_0x6479('0x38')][_0x6479('0x45')]?_0x4fb1ed[_0x6479('0x38')]:_0x13d86b[_0x6479('0x35')];_0x4fb1ed[_0x6479('0x39')]=qs['sort'](_0x46182c[_0x6479('0x33')]['sort']);_0x4fb1ed[_0x6479('0x3b')]=qs[_0x6479('0x34')](_[_0x6479('0x3c')](_0x46182c[_0x6479('0x33')],_0x13d86b[_0x6479('0x34')]));if(_0x46182c[_0x6479('0x33')][_0x6479('0x3d')]){_0x4fb1ed['where']=_[_0x6479('0x3f')](_0x4fb1ed['where'],{'$or':_[_0x6479('0x3e')](_0x4fb1ed[_0x6479('0x38')],function(_0x2bd2d3){var _0x3aba70={};_0x3aba70[_0x2bd2d3]={'$like':'%'+_0x46182c[_0x6479('0x33')][_0x6479('0x3d')]+'%'};return _0x3aba70;})});}_0x4fb1ed=_[_0x6479('0x3f')]({},_0x4fb1ed,_0x46182c['options']);return _0x41ead2[_0x6479('0x52')](_0x4fb1ed);}})['then'](function(_0xebe49b){if(_0xebe49b){_0x375a27=_0xebe49b['length'];if(!_0x46182c[_0x6479('0x33')][_0x6479('0x55')](_0x6479('0x56'))){_0x4fb1ed[_0x6479('0x1d')]=qs['limit'](_0x46182c['query']['limit']);_0x4fb1ed[_0x6479('0x1c')]=qs['offset'](_0x46182c[_0x6479('0x33')][_0x6479('0x1c')]);}return _0x41ead2[_0x6479('0x52')](_0x4fb1ed);}})[_0x6479('0x25')](function(_0x13dc26){if(_0x13dc26){return _0x13dc26?{'count':_0x375a27,'rows':_0x13dc26}:null;}})[_0x6479('0x25')](respondWithResult(_0x4d7a52,null))[_0x6479('0x43')](handleError(_0x4d7a52,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 2593431..7fdc0be 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 _0xcf9f=['define','lodash','util','api','moment','bluebird','path','../../config/environment','./cmCompany.attributes','exports'];(function(_0x321131,_0x266081){var _0x21557a=function(_0x1fc140){while(--_0x1fc140){_0x321131['push'](_0x321131['shift']());}};_0x21557a(++_0x266081);}(_0xcf9f,0xb5));var _0xfcf9=function(_0x2facd6,_0x2aaf16){_0x2facd6=_0x2facd6-0x0;var _0x4fbcb0=_0xcf9f[_0x2facd6];return _0x4fbcb0;};'use strict';var _=require(_0xfcf9('0x0'));var util=require(_0xfcf9('0x1'));var logger=require('../../config/logger')(_0xfcf9('0x2'));var moment=require(_0xfcf9('0x3'));var BPromise=require(_0xfcf9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfcf9('0x5'));var rimraf=require('rimraf');var config=require(_0xfcf9('0x6'));var attributes=require(_0xfcf9('0x7'));module[_0xfcf9('0x8')]=function(_0x4d74e7,_0x39c9c9){return _0x4d74e7[_0xfcf9('0x9')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d59=['moment','rimraf','exports','define','CmCompany','cm_companies','lodash','util'];(function(_0x381cf1,_0xdb8d09){var _0x3625e9=function(_0x5b9e1f){while(--_0x5b9e1f){_0x381cf1['push'](_0x381cf1['shift']());}};_0x3625e9(++_0xdb8d09);}(_0x3d59,0x1d6));var _0x93d5=function(_0x4c889f,_0x223c2f){_0x4c889f=_0x4c889f-0x0;var _0x24ddcd=_0x3d59[_0x4c889f];return _0x24ddcd;};'use strict';var _=require(_0x93d5('0x0'));var util=require(_0x93d5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x93d5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x93d5('0x3'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x93d5('0x4')]=function(_0xde5c76,_0x3e3351){return _0xde5c76[_0x93d5('0x5')](_0x93d5('0x6'),attributes,{'tableName':_0x93d5('0x7'),'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 5353089..de6ed90 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 _0xc259=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc259,0x9b));var _0x9c25=function(_0x558270,_0x4e4c68){_0x558270=_0x558270-0x0;var _0xcab0b0=_0xc259[_0x558270];return _0xcab0b0;};'use strict';var _=require(_0x9c25('0x0'));var util=require(_0x9c25('0x1'));var moment=require(_0x9c25('0x2'));var BPromise=require(_0x9c25('0x3'));var rs=require(_0x9c25('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c25('0x5'))['db'];var utils=require(_0x9c25('0x6'));var logger=require(_0x9c25('0x7'))(_0x9c25('0x8'));var config=require(_0x9c25('0x9'));var jayson=require(_0x9c25('0xa'));var client=jayson['client'][_0x9c25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e27e0,_0x37147,_0x3bfab3){return new BPromise(function(_0x1f6195,_0x327145){return client[_0x9c25('0xc')](_0x1e27e0,_0x3bfab3)['then'](function(_0x399294){logger['info'](_0x9c25('0xd'),_0x37147,_0x9c25('0xe'));logger[_0x9c25('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x37147,_0x9c25('0xe'),JSON[_0x9c25('0x10')](_0x399294));if(_0x399294[_0x9c25('0x11')]){if(_0x399294[_0x9c25('0x11')][_0x9c25('0x12')]===0x1f4){logger[_0x9c25('0x11')](_0x9c25('0xd'),_0x37147,_0x399294['error'][_0x9c25('0x13')]);return _0x327145(_0x399294[_0x9c25('0x11')]['message']);}logger[_0x9c25('0x11')](_0x9c25('0xd'),_0x37147,_0x399294[_0x9c25('0x11')][_0x9c25('0x13')]);return _0x1f6195(_0x399294[_0x9c25('0x11')][_0x9c25('0x13')]);}else{logger[_0x9c25('0x14')](_0x9c25('0xd'),_0x37147,_0x9c25('0xe'));_0x1f6195(_0x399294[_0x9c25('0x15')]['message']);}})[_0x9c25('0x16')](function(_0x43f782){logger['error'](_0x9c25('0xd'),_0x37147,_0x43f782);_0x327145(_0x43f782);});});} \ No newline at end of file +var _0x8d46=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','code','error','message','CmCompany,\x20%s,\x20%s','result','catch','util','moment','bluebird'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x8d46,0xbd));var _0x68d4=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8d46[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x68d4('0x0'));var moment=require(_0x68d4('0x1'));var BPromise=require(_0x68d4('0x2'));var rs=require(_0x68d4('0x3'));var fs=require('fs');var Redis=require(_0x68d4('0x4'));var db=require(_0x68d4('0x5'))['db'];var utils=require(_0x68d4('0x6'));var logger=require(_0x68d4('0x7'))(_0x68d4('0x8'));var config=require(_0x68d4('0x9'));var jayson=require(_0x68d4('0xa'));var client=jayson[_0x68d4('0xb')][_0x68d4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e6ce0,_0x8ebe17,_0x5ce4f1){return new BPromise(function(_0x44f6bd,_0x549011){return client[_0x68d4('0xd')](_0x3e6ce0,_0x5ce4f1)['then'](function(_0x13822e){logger[_0x68d4('0xe')]('CmCompany,\x20%s,\x20%s',_0x8ebe17,_0x68d4('0xf'));logger[_0x68d4('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x8ebe17,_0x68d4('0xf'),JSON[_0x68d4('0x11')](_0x13822e));if(_0x13822e['error']){if(_0x13822e['error'][_0x68d4('0x12')]===0x1f4){logger[_0x68d4('0x13')]('CmCompany,\x20%s,\x20%s',_0x8ebe17,_0x13822e[_0x68d4('0x13')][_0x68d4('0x14')]);return _0x549011(_0x13822e[_0x68d4('0x13')][_0x68d4('0x14')]);}logger[_0x68d4('0x13')](_0x68d4('0x15'),_0x8ebe17,_0x13822e[_0x68d4('0x13')][_0x68d4('0x14')]);return _0x44f6bd(_0x13822e[_0x68d4('0x13')][_0x68d4('0x14')]);}else{logger['info'](_0x68d4('0x15'),_0x8ebe17,_0x68d4('0xf'));_0x44f6bd(_0x13822e[_0x68d4('0x16')][_0x68d4('0x14')]);}})[_0x68d4('0x17')](function(_0x688a14){logger['error']('CmCompany,\x20%s,\x20%s',_0x8ebe17,_0x688a14);_0x549011(_0x688a14);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 9626808..6fb09a2 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 _0xbec1=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/contacts','post','addContacts','put'];(function(_0x4bd3ae,_0x5c4edb){var _0x13cf8c=function(_0x5e1184){while(--_0x5e1184){_0x4bd3ae['push'](_0x4bd3ae['shift']());}};_0x13cf8c(++_0x5c4edb);}(_0xbec1,0x152));var _0x1bec=function(_0x25166c,_0x26c838){_0x25166c=_0x25166c-0x0;var _0x1021f2=_0xbec1[_0x25166c];return _0x1021f2;};'use strict';var multer=require(_0x1bec('0x0'));var util=require(_0x1bec('0x1'));var path=require(_0x1bec('0x2'));var timeout=require(_0x1bec('0x3'));var express=require(_0x1bec('0x4'));var router=express[_0x1bec('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1bec('0x7'));var controller=require(_0x1bec('0x8'));router['get']('/',auth[_0x1bec('0x9')](),controller[_0x1bec('0xa')]);router[_0x1bec('0xb')](_0x1bec('0xc'),auth[_0x1bec('0x9')](),controller['describe']);router[_0x1bec('0xb')](_0x1bec('0xd'),auth['isAuthenticated'](),controller[_0x1bec('0xe')]);router[_0x1bec('0xb')](_0x1bec('0xf'),auth[_0x1bec('0x9')](),controller['getContacts']);router['post']('/',auth[_0x1bec('0x9')](),controller['create']);router[_0x1bec('0x10')]('/:id/contacts',auth[_0x1bec('0x9')](),controller[_0x1bec('0x11')]);router[_0x1bec('0x12')](_0x1bec('0xd'),auth[_0x1bec('0x9')](),controller['update']);router[_0x1bec('0x13')](_0x1bec('0xd'),auth[_0x1bec('0x9')](),controller['destroy']);module[_0x1bec('0x14')]=router; \ No newline at end of file +var _0x8c7f=['../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x4002fe,_0x4f4d32){var _0x3ca77b=function(_0x5917b2){while(--_0x5917b2){_0x4002fe['push'](_0x4002fe['shift']());}};_0x3ca77b(++_0x4f4d32);}(_0x8c7f,0xa2));var _0xf8c7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8c7f[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xf8c7('0x0'));var util=require(_0xf8c7('0x1'));var path=require(_0xf8c7('0x2'));var timeout=require(_0xf8c7('0x3'));var express=require(_0xf8c7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf8c7('0x5'));var interaction=require(_0xf8c7('0x6'));var config=require('../../config/environment');var controller=require(_0xf8c7('0x7'));router[_0xf8c7('0x8')]('/',auth[_0xf8c7('0x9')](),controller[_0xf8c7('0xa')]);router[_0xf8c7('0x8')]('/describe',auth[_0xf8c7('0x9')](),controller[_0xf8c7('0xb')]);router['get'](_0xf8c7('0xc'),auth[_0xf8c7('0x9')](),controller[_0xf8c7('0xd')]);router['get'](_0xf8c7('0xe'),auth[_0xf8c7('0x9')](),controller[_0xf8c7('0xf')]);router[_0xf8c7('0x10')]('/',auth['isAuthenticated'](),controller[_0xf8c7('0x11')]);router[_0xf8c7('0x10')](_0xf8c7('0xe'),auth[_0xf8c7('0x9')](),controller['addContacts']);router['put'](_0xf8c7('0xc'),auth[_0xf8c7('0x9')](),controller[_0xf8c7('0x12')]);router[_0xf8c7('0x13')](_0xf8c7('0xc'),auth[_0xf8c7('0x9')](),controller[_0xf8c7('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 636941f..7b11285 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 _0x757a=['STRING','TEXT','INTEGER','UNSIGNED','DATE','sequelize','exports'];(function(_0x39e164,_0x2cb93b){var _0x13fa6b=function(_0x511cb2){while(--_0x511cb2){_0x39e164['push'](_0x39e164['shift']());}};_0x13fa6b(++_0x2cb93b);}(_0x757a,0xde));var _0xa757=function(_0x101fd8,_0x69e68e){_0x101fd8=_0x101fd8-0x0;var _0x45ad7f=_0x757a[_0x101fd8];return _0x45ad7f;};'use strict';var _=require('lodash');var Sequelize=require(_0xa757('0x0'));module[_0xa757('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xa757('0x2')]},'city':{'type':Sequelize[_0xa757('0x2')]},'country':{'type':Sequelize[_0xa757('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa757('0x2')]},'description':{'type':Sequelize[_0xa757('0x3')]},'phone':{'type':Sequelize[_0xa757('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xa757('0x2')]},'email':{'type':Sequelize[_0xa757('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xa757('0x2')]},'fb_data':{'type':Sequelize[_0xa757('0x2')]},'twitter':{'type':Sequelize[_0xa757('0x2')]},'skype':{'type':Sequelize[_0xa757('0x2')]},'teams':{'type':Sequelize[_0xa757('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa757('0x2')]},'wechat':{'type':Sequelize[_0xa757('0x2')]},'telegram':{'type':Sequelize[_0xa757('0x2')]},'UserId':{'type':Sequelize[_0xa757('0x4')]},'priority':{'type':Sequelize[_0xa757('0x4')](0x2)[_0xa757('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa757('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb10b=['TEXT','INTEGER','UNSIGNED','DATE','lodash','exports','STRING'];(function(_0x26d146,_0x48f2fa){var _0x553290=function(_0xb1e96d){while(--_0xb1e96d){_0x26d146['push'](_0x26d146['shift']());}};_0x553290(++_0x48f2fa);}(_0xb10b,0x12a));var _0xbb10=function(_0x51639a,_0x35f006){_0x51639a=_0x51639a-0x0;var _0x3abae4=_0xb10b[_0x51639a];return _0x3abae4;};'use strict';var _=require(_0xbb10('0x0'));var Sequelize=require('sequelize');module[_0xbb10('0x1')]={'firstName':{'type':Sequelize[_0xbb10('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xbb10('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xbb10('0x2')]},'city':{'type':Sequelize[_0xbb10('0x2')]},'country':{'type':Sequelize[_0xbb10('0x2')]},'dateOfBirth':{'type':Sequelize[_0xbb10('0x2')]},'description':{'type':Sequelize[_0xbb10('0x3')]},'phone':{'type':Sequelize[_0xbb10('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbb10('0x2')]},'email':{'type':Sequelize[_0xbb10('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xbb10('0x2')]},'fb_data':{'type':Sequelize[_0xbb10('0x2')]},'twitter':{'type':Sequelize[_0xbb10('0x2')]},'skype':{'type':Sequelize[_0xbb10('0x2')]},'teams':{'type':Sequelize[_0xbb10('0x2')]},'viber':{'type':Sequelize[_0xbb10('0x2')]},'line':{'type':Sequelize[_0xbb10('0x2')]},'wechat':{'type':Sequelize[_0xbb10('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xbb10('0x4')](0x2)[_0xbb10('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xbb10('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xbb10('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 03d3ef9..4336aa5 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 _0xbb1e=['GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','describe','columnName','displayName','analytics','CmCustomField','findAll','values','merge','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','ChatInteraction','ChatMessage','update','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','create','dialTimezone','utcOffset','timezones','bulkCreate','duplicates','$or','findOrCreate','spread','show','color','$and','format','cf_%d','omit','pickBy','table','setFields','phone','getTags','rawAttributes','options','setTags','ids','ContactId','includeAll','include','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','meta','import','binding','No\x20phone\x20column\x20specified','socket_timestamp','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','Invalid\x20channel','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','starttime','endtime','duration','note','createdAt','userDisposition','userThirdDisposition','alias','findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','UserId','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingValue','referer','externalUrl','threadId','Interaction','Owner','flatten','sortBy','reverse','bluebird','util','path','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','./cmContact.socket','status','json','offset','undefined','limit','count','set','then','destroy','end','sendStatus','stack','name','send','CmContact','keys','startsWith','cf_','push','findOne','trimStart','all','length','fieldType','type','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','conditions','find','Tag','value','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','datetime','castTo','DATE','buildExpression','text','start','map','filter','isNil','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','split','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.id','QueryTypes','SELECT','DESC','having','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','c.lastName','c.phone','c.email','c.ListId','c.createdAt','c.CompanyId'];(function(_0x3dcabf,_0x3af156){var _0x4ad179=function(_0x1c6a69){while(--_0x1c6a69){_0x3dcabf['push'](_0x3dcabf['shift']());}};_0x4ad179(++_0x3af156);}(_0xbb1e,0x1bd));var _0xebb1=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbb1e[_0x1ac595];return _0x455fff;};'use strict';var moment=require('moment');var BPromise=require(_0xebb1('0x0'));var util=require(_0xebb1('0x1'));var path=require(_0xebb1('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0xebb1('0x3'));var Papa=require(_0xebb1('0x4'));var Redis=require(_0xebb1('0x5'));var qs=require(_0xebb1('0x6'));var as=require(_0xebb1('0x7'));var logger=require(_0xebb1('0x8'))(_0xebb1('0x9'));var config=require(_0xebb1('0xa'));var shared=require(_0xebb1('0xb'));var db=require('../../mysqldb')['db'];config[_0xebb1('0xc')]=_[_0xebb1('0xd')](config['redis'],{'host':_0xebb1('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xebb1('0xf'))['register'](socket);function respondWithResult(_0x5d47c4,_0x19e5e4){_0x19e5e4=_0x19e5e4||0xc8;return function(_0x47cb67){if(_0x47cb67){return _0x5d47c4[_0xebb1('0x10')](_0x19e5e4)[_0xebb1('0x11')](_0x47cb67);}};}function respondWithFilteredResult(_0x18faf1,_0x49e678){return function(_0xc97362){if(_0xc97362){var _0x1440a4=typeof _0x49e678[_0xebb1('0x12')]===_0xebb1('0x13')&&typeof _0x49e678[_0xebb1('0x14')]===_0xebb1('0x13');var _0x2ef9d0=_0xc97362[_0xebb1('0x15')];var _0x4d5094=_0x1440a4?0x0:_0x49e678[_0xebb1('0x12')];var _0x22d61b=_0x1440a4?_0xc97362[_0xebb1('0x15')]:_0x49e678['offset']+_0x49e678[_0xebb1('0x14')];var _0xb92f54;if(_0x22d61b>=_0x2ef9d0){_0x22d61b=_0x2ef9d0;_0xb92f54=0xc8;}else{_0xb92f54=0xce;}_0x18faf1[_0xebb1('0x10')](_0xb92f54);return _0x18faf1[_0xebb1('0x16')]('Content-Range',_0x4d5094+'-'+_0x22d61b+'/'+_0x2ef9d0)[_0xebb1('0x11')](_0xc97362);}return null;};}function saveUpdates(_0x1aa214){return function(_0x2e9563){if(_0x2e9563){return _0x2e9563['update'](_0x1aa214)[_0xebb1('0x17')](function(_0x3d116e){return _0x3d116e;});}return null;};}function removeEntity(_0x12ea6b){return function(_0x42c1bc){if(_0x42c1bc){return _0x42c1bc[_0xebb1('0x18')]()['then'](function(){_0x12ea6b[_0xebb1('0x10')](0xcc)[_0xebb1('0x19')]();});}};}function handleEntityNotFound(_0xd95664){return function(_0x24c5cc){if(!_0x24c5cc){_0xd95664[_0xebb1('0x1a')](0x194);}return _0x24c5cc;};}function handleError(_0x2418c2,_0x416bf3){_0x416bf3=_0x416bf3||0x1f4;return function(_0x4f2583){logger['error'](_0x4f2583[_0xebb1('0x1b')]);if(_0x4f2583['name']){delete _0x4f2583[_0xebb1('0x1c')];}_0x2418c2[_0xebb1('0x10')](_0x416bf3)[_0xebb1('0x1d')](_0x4f2583);};}exports['index']=function(_0x52f35f,_0x46b273){var _0xdc0bd0={},_0x2c73db={},_0x22acb1={'count':0x0,'rows':[]};return db[_0xebb1('0x1e')]['describe']()[_0xebb1('0x17')](function(_0x4500ab){var _0x3ae018=[];for(var _0x59801c=0x0;_0x59801c0x1){_0x3d54f0['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x58ba20),null);}else{if(qs[_0xebb1('0x5e')](_0x58ba20)){_0x3d54f0['or']('c.id\x20LIKE\x20?',_0x58ba20+'%');_0x3d54f0['or'](_0xebb1('0x5f'),_0x58ba20+'%');_0x3d54f0['or'](_0xebb1('0x60'),_0x58ba20+'%');_0x3d54f0['or'](_0xebb1('0x61'),_0x58ba20+'%');}else if(qs['isEmail'](_0x58ba20)){_0x3d54f0['or'](_0xebb1('0x62'),_0x58ba20+'%');}else{_0x3d54f0['or'](_0xebb1('0x63'),'%'+_0x58ba20+'%');_0x3d54f0['or']('c.lastName\x20LIKE\x20?','%'+_0x58ba20+'%');_0x3d54f0['or'](_0xebb1('0x62'),'%'+_0x58ba20+'%');}}}}_0x3e0173[_0xebb1('0x33')](_0x3d54f0);_0x3e0173['group'](_0xebb1('0x64'));var _0x383cbf={'type':db['Sequelize'][_0xebb1('0x65')][_0xebb1('0x66')],'raw':!![]};var _0x54f36d=_0x3e0173['clone']()[_0xebb1('0x36')]('c.id');if(_0xdc0bd0[_0xebb1('0x31')]){_0xdc0bd0[_0xebb1('0x31')][_0xebb1('0x55')](function(_0x559695){_0x3e0173[_0xebb1('0x31')]('c.'+_0x559695[0x0],_0x559695[0x1]===_0xebb1('0x67')?![]:!![]);});}if(!_['isEmpty'](_0x34e982)){_0x3e0173[_0xebb1('0x68')](_0x578704);_0x54f36d[_0xebb1('0x33')]('t.id\x20IN\x20?',_0x34e982);}BPromise[_0xebb1('0x69')]()[_0xebb1('0x17')](function(){if(!_0x333d84)return;if(_0x52f35f[_0xebb1('0x6a')][_0xebb1('0x6b')]!==_0xebb1('0x6c'))return;if(!_[_0xebb1('0x6d')](_0x333d84[_0xebb1('0x41')],[_0xebb1('0x36'),_0xebb1('0x47')])){return _0x52f35f[_0xebb1('0x6a')][_0xebb1('0x6e')]({'attributes':['id'],'raw':!![]})[_0xebb1('0x17')](function(_0x497c22){if(_[_0xebb1('0x54')](_0x497c22)){_0x54f36d[_0xebb1('0x33')](_0xebb1('0x6f'));_0x3e0173[_0xebb1('0x33')](_0xebb1('0x6f'));}else{_0x54f36d[_0xebb1('0x33')](_0xebb1('0x57'),_['map'](_0x497c22,'id'));_0x3e0173['where'](_0xebb1('0x57'),_[_0xebb1('0x50')](_0x497c22,'id'));}});}})[_0xebb1('0x17')](function(){if(_0x52f35f[_0xebb1('0x6a')][_0xebb1('0x6b')]===_0xebb1('0x6c')&&!_0x333d84&&!_0x52f35f['query'][_0xebb1('0x56')])return[];return db[_0xebb1('0x70')]['query'](_0x54f36d[_0xebb1('0x71')](),_0x383cbf);})[_0xebb1('0x17')](function(_0x3bdd71){_0x22acb1['count']=_0x3bdd71[_0xebb1('0x26')];if(_0x22acb1['count']===0x0)return[];return db[_0xebb1('0x70')]['query'](_0x5bea42['toString'](),_0x383cbf)[_0xebb1('0x17')](function(_0x10d532){_0x4064ae=_[_0xebb1('0x72')](_0x10d532,'id');_0x383cbf=_['merge'](_0x383cbf,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x52f35f['query'][_0xebb1('0x2e')]){_0xdc0bd0[_0xebb1('0x2c')]['forEach'](function(_0x39b0d6){_0x3e0173[_0xebb1('0x36')]('c.'+_0x39b0d6);});}else{_0x3e0173[_0xebb1('0x36')](_0xebb1('0x64'));_0x3e0173[_0xebb1('0x36')]('c.firstName');_0x3e0173['field'](_0xebb1('0x73'));_0x3e0173[_0xebb1('0x36')](_0xebb1('0x74'));_0x3e0173[_0xebb1('0x36')]('c.mobile');_0x3e0173[_0xebb1('0x36')]('c.fax');_0x3e0173[_0xebb1('0x36')](_0xebb1('0x75'));_0x3e0173[_0xebb1('0x36')](_0xebb1('0x76'));_0x3e0173[_0xebb1('0x36')](_0xebb1('0x77'));_0x3e0173[_0xebb1('0x36')]('c.deletedAt');_0x3e0173['field'](_0xebb1('0x78'));_0x3e0173[_0xebb1('0x36')](_0xebb1('0x79'),_0xebb1('0x7a'));}if(_0xdc0bd0[_0xebb1('0x14')])_0x3e0173[_0xebb1('0x14')](_0xdc0bd0[_0xebb1('0x14')]);if(_0xdc0bd0['offset'])_0x3e0173['offset'](_0xdc0bd0[_0xebb1('0x12')]);return db[_0xebb1('0x70')]['query'](_0x3e0173[_0xebb1('0x71')](),_0x383cbf);});})[_0xebb1('0x17')](function(_0x48fe90){_0x48fe90[_0xebb1('0x55')](function(_0x203cb1){if(_0x203cb1['TagIds']){_0x203cb1[_0xebb1('0x7b')]=[];_0x203cb1['TagIds'][_0xebb1('0x5d')](',')[_0xebb1('0x55')](function(_0x20e43f){_0x203cb1[_0xebb1('0x7b')][_0xebb1('0x22')](_0x4064ae[_0x20e43f]);});}delete _0x203cb1[_0xebb1('0x7a')];});_0x22acb1[_0xebb1('0x7c')]=_0x48fe90;return _0x22acb1;})['then'](respondWithFilteredResult(_0x46b273,_0xdc0bd0));})[_0xebb1('0x7d')](handleError(_0x46b273,null));};exports[_0xebb1('0x18')]=function(_0x1369b4,_0xcce191){return db[_0xebb1('0x1e')][_0xebb1('0x42')]({'where':{'id':_0x1369b4[_0xebb1('0x7e')]['id']}})['then'](handleEntityNotFound(_0xcce191,null))[_0xebb1('0x17')](removeEntity(_0xcce191,null))['catch'](handleError(_0xcce191,null));};exports[_0xebb1('0x7f')]=function(_0x312e90,_0x58707f){return db[_0xebb1('0x1e')][_0xebb1('0x7f')]()['then'](function(_0x89ad99){delete _0x89ad99['tags'];for(var _0x483be7=0x0;_0x483be7=_0x55061c){_0x4bae3d=_0x55061c;_0x44370a=0xc8;}else{_0x44370a=0xce;}_0x5a6c3a[_0xb546('0x14')](_0x44370a);return _0x5a6c3a[_0xb546('0x15')](_0xb546('0x16'),_0x45abc6+'-'+_0x4bae3d+'/'+_0x55061c)[_0xb546('0x17')](_0x1a7610);}return null;};}function saveUpdates(_0x18bd14){return function(_0x54dacc){if(_0x54dacc){return _0x54dacc[_0xb546('0x18')](_0x18bd14)[_0xb546('0x19')](function(_0x31241d){return _0x31241d;});}return null;};}function removeEntity(_0xc8a273){return function(_0xa730c){if(_0xa730c){return _0xa730c[_0xb546('0x1a')]()[_0xb546('0x19')](function(){_0xc8a273[_0xb546('0x14')](0xcc)[_0xb546('0x1b')]();});}};}function handleEntityNotFound(_0x2fa4a7){return function(_0x2ad5c9){if(!_0x2ad5c9){_0x2fa4a7[_0xb546('0x1c')](0x194);}return _0x2ad5c9;};}function handleError(_0x1a1019,_0x53697d){_0x53697d=_0x53697d||0x1f4;return function(_0x4a9321){logger[_0xb546('0x1d')](_0x4a9321[_0xb546('0x1e')]);if(_0x4a9321[_0xb546('0x1f')]){delete _0x4a9321[_0xb546('0x1f')];}_0x1a1019[_0xb546('0x14')](_0x53697d)[_0xb546('0x20')](_0x4a9321);};}exports[_0xb546('0x21')]=function(_0x405a84,_0x1d6f1a){var _0x45ce12={},_0x39551f={},_0xa693e1={'count':0x0,'rows':[]};return db[_0xb546('0x22')][_0xb546('0x23')]()[_0xb546('0x19')](function(_0x30c6c0){var _0x2e1183=[];for(var _0x1c9761=0x0;_0x1c97610x1){_0x3135fc['or'](_0xb546('0x64'),qs['getFullTextValue'](_0x48649e),null);}else{if(qs[_0xb546('0x65')](_0x48649e)){_0x3135fc['or']('c.id\x20LIKE\x20?',_0x48649e+'%');_0x3135fc['or']('c.phone\x20LIKE\x20?',_0x48649e+'%');_0x3135fc['or'](_0xb546('0x66'),_0x48649e+'%');_0x3135fc['or'](_0xb546('0x67'),_0x48649e+'%');}else if(qs[_0xb546('0x68')](_0x48649e)){_0x3135fc['or']('c.email\x20LIKE\x20?',_0x48649e+'%');}else{_0x3135fc['or'](_0xb546('0x69'),'%'+_0x48649e+'%');_0x3135fc['or'](_0xb546('0x6a'),'%'+_0x48649e+'%');_0x3135fc['or'](_0xb546('0x6b'),'%'+_0x48649e+'%');}}}}_0x1fc3a0[_0xb546('0x36')](_0x3135fc);_0x1fc3a0[_0xb546('0x6c')](_0xb546('0x6d'));var _0xd92b30={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x5d74c9=_0x1fc3a0[_0xb546('0x6e')]()[_0xb546('0x39')](_0xb546('0x6d'));if(_0x45ce12[_0xb546('0x34')]){_0x45ce12[_0xb546('0x34')][_0xb546('0x4e')](function(_0x22bd0e){_0x1fc3a0[_0xb546('0x34')]('c.'+_0x22bd0e[0x0],_0x22bd0e[0x1]===_0xb546('0x6f')?![]:!![]);});}if(!_['isEmpty'](_0x149e94)){_0x1fc3a0[_0xb546('0x70')](_0x2a0dfd);_0x5d74c9[_0xb546('0x36')](_0xb546('0x71'),_0x149e94);}BPromise[_0xb546('0x72')]()[_0xb546('0x19')](function(){if(!_0x31b37c)return;if(_0x405a84[_0xb546('0x73')]['role']!==_0xb546('0x74'))return;if(!_['some'](_0x31b37c['conditions'],[_0xb546('0x39'),_0xb546('0x51')])){return _0x405a84[_0xb546('0x73')][_0xb546('0x75')]({'attributes':['id'],'raw':!![]})[_0xb546('0x19')](function(_0x506567){if(_['isEmpty'](_0x506567)){_0x5d74c9[_0xb546('0x36')]('c.ListId\x20IS\x20NULL');_0x1fc3a0['where'](_0xb546('0x76'));}else{_0x5d74c9['where'](_0xb546('0x5e'),_['map'](_0x506567,'id'));_0x1fc3a0[_0xb546('0x36')](_0xb546('0x5e'),_[_0xb546('0x4d')](_0x506567,'id'));}});}})['then'](function(){if(_0x405a84[_0xb546('0x73')][_0xb546('0x77')]===_0xb546('0x74')&&!_0x31b37c&&!_0x405a84[_0xb546('0x2e')][_0xb546('0x5d')])return[];return db['sequelize']['query'](_0x5d74c9[_0xb546('0x78')](),_0xd92b30);})['then'](function(_0x2667dd){_0xa693e1[_0xb546('0x11')]=_0x2667dd[_0xb546('0x25')];if(_0xa693e1['count']===0x0)return[];return db['sequelize'][_0xb546('0x2e')](_0x396c99[_0xb546('0x78')](),_0xd92b30)[_0xb546('0x19')](function(_0x2baf32){_0x1bed81=_[_0xb546('0x79')](_0x2baf32,'id');_0xd92b30=_['merge'](_0xd92b30,{'model':db[_0xb546('0x22')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x405a84[_0xb546('0x2e')][_0xb546('0x31')]){_0x45ce12['attributes']['forEach'](function(_0x220d45){_0x1fc3a0[_0xb546('0x39')]('c.'+_0x220d45);});}else{_0x1fc3a0['field'](_0xb546('0x6d'));_0x1fc3a0['field'](_0xb546('0x7a'));_0x1fc3a0[_0xb546('0x39')](_0xb546('0x7b'));_0x1fc3a0[_0xb546('0x39')](_0xb546('0x7c'));_0x1fc3a0[_0xb546('0x39')]('c.mobile');_0x1fc3a0[_0xb546('0x39')](_0xb546('0x7d'));_0x1fc3a0['field']('c.email');_0x1fc3a0[_0xb546('0x39')](_0xb546('0x7e'));_0x1fc3a0[_0xb546('0x39')](_0xb546('0x7f'));_0x1fc3a0[_0xb546('0x39')](_0xb546('0x80'));_0x1fc3a0[_0xb546('0x39')](_0xb546('0x81'));_0x1fc3a0[_0xb546('0x39')](_0xb546('0x82'),_0xb546('0x83'));}if(_0x45ce12['limit'])_0x1fc3a0[_0xb546('0x13')](_0x45ce12[_0xb546('0x13')]);if(_0x45ce12[_0xb546('0x12')])_0x1fc3a0[_0xb546('0x12')](_0x45ce12[_0xb546('0x12')]);return db['sequelize'][_0xb546('0x2e')](_0x1fc3a0[_0xb546('0x78')](),_0xd92b30);});})[_0xb546('0x19')](function(_0x2c09a0){_0x2c09a0[_0xb546('0x4e')](function(_0x1d8323){if(_0x1d8323['TagIds']){_0x1d8323[_0xb546('0x84')]=[];_0x1d8323[_0xb546('0x83')][_0xb546('0x4c')](',')[_0xb546('0x4e')](function(_0x550355){_0x1d8323[_0xb546('0x84')]['push'](_0x1bed81[_0x550355]);});}delete _0x1d8323[_0xb546('0x83')];});_0xa693e1[_0xb546('0x85')]=_0x2c09a0;return _0xa693e1;})['then'](respondWithFilteredResult(_0x1d6f1a,_0x45ce12));})[_0xb546('0x86')](handleError(_0x1d6f1a,null));};exports['destroy']=function(_0x5f51f1,_0x2490d9){return db['CmContact'][_0xb546('0x49')]({'where':{'id':_0x5f51f1[_0xb546('0x87')]['id']}})[_0xb546('0x19')](handleEntityNotFound(_0x2490d9,null))[_0xb546('0x19')](removeEntity(_0x2490d9,null))['catch'](handleError(_0x2490d9,null));};exports[_0xb546('0x23')]=function(_0x18f247,_0x2f6013){return db[_0xb546('0x22')][_0xb546('0x23')]()[_0xb546('0x19')](function(_0x7a9951){delete _0x7a9951[_0xb546('0x88')];for(var _0x2746fe=0x0;_0x2746fe{}\s\\|]/g,'-');_0x96498a(null,util['format'](_0x4b72('0x25'),path[_0x4b72('0x26')](_0x145bb8[_0x4b72('0x23')],path[_0x4b72('0x27')](_0x145bb8['originalname'])),Date[_0x4b72('0x28')](),path[_0x4b72('0x27')](_0x145bb8[_0x4b72('0x23')])));}})});router['post']('/csv',upload['single'](_0x4b72('0x29')),controller[_0x4b72('0x2a')]);var upload=multer({'storage':multer[_0x4b72('0x1f')]({'destination':function(_0x4cb560,_0x29df02,_0x51fdda){_0x51fdda(null,path[_0x4b72('0x20')](config[_0x4b72('0x21')],'server/files/tmp'));},'filename':function(_0x175c08,_0xc696e8,_0x4a2f02){_0xc696e8[_0x4b72('0x23')]=_0xc696e8[_0x4b72('0x23')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4a2f02(null,util['format'](_0x4b72('0x25'),path[_0x4b72('0x26')](_0xc696e8[_0x4b72('0x23')],path[_0x4b72('0x27')](_0xc696e8[_0x4b72('0x23')])),Date[_0x4b72('0x28')](),path[_0x4b72('0x27')](_0xc696e8[_0x4b72('0x23')])));}})});router[_0x4b72('0x1b')](_0x4b72('0x2b'),upload[_0x4b72('0x2c')](_0x4b72('0x29')),controller[_0x4b72('0x2d')]);router[_0x4b72('0x1b')](_0x4b72('0x2e'),auth[_0x4b72('0x7')](),controller[_0x4b72('0x2f')]);router[_0x4b72('0x30')](_0x4b72('0xc'),auth[_0x4b72('0x7')](),controller[_0x4b72('0x31')]);router[_0x4b72('0x32')](_0x4b72('0xc'),auth[_0x4b72('0x7')](),controller['destroy']);module[_0x4b72('0x33')]=router; \ No newline at end of file +var _0xbdd7=['delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmContact.controller','get','isAuthenticated','index','/describe','describe','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/journey','getJourney','merge','post','create','bulkCreate','setTags','join','root','originalname','replace','format','%s-%s%s','basename','now','extname','/csv','single','file','uploadCsv','diskStorage','server/files/tmp','/upload','upload','put','/:id','update'];(function(_0x767b59,_0xe668bd){var _0x2fa004=function(_0x4a99f8){while(--_0x4a99f8){_0x767b59['push'](_0x767b59['shift']());}};_0x2fa004(++_0xe668bd);}(_0xbdd7,0x15f));var _0x7bdd=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbdd7[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7bdd('0x0'));var util=require(_0x7bdd('0x1'));var path=require(_0x7bdd('0x2'));var timeout=require(_0x7bdd('0x3'));var express=require(_0x7bdd('0x4'));var router=express[_0x7bdd('0x5')]();var fs_extra=require(_0x7bdd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7bdd('0x7'));var config=require('../../config/environment');var controller=require(_0x7bdd('0x8'));router[_0x7bdd('0x9')]('/',auth[_0x7bdd('0xa')](),controller[_0x7bdd('0xb')]);router[_0x7bdd('0x9')](_0x7bdd('0xc'),auth['isAuthenticated'](),controller[_0x7bdd('0xd')]);router[_0x7bdd('0x9')]('/:id',auth[_0x7bdd('0xa')](),controller[_0x7bdd('0xe')]);router['get'](_0x7bdd('0xf'),auth[_0x7bdd('0xa')](),controller[_0x7bdd('0x10')]);router[_0x7bdd('0x9')](_0x7bdd('0x11'),auth[_0x7bdd('0xa')](),controller[_0x7bdd('0x12')]);router[_0x7bdd('0x9')](_0x7bdd('0x13'),auth[_0x7bdd('0xa')](),controller[_0x7bdd('0x14')]);router[_0x7bdd('0x9')](_0x7bdd('0x15'),auth[_0x7bdd('0xa')](),controller['getHopperFinals']);router[_0x7bdd('0x9')]('/:id/jscripty_sessions',auth[_0x7bdd('0xa')](),controller['getJscriptySessions']);router['get'](_0x7bdd('0x16'),auth[_0x7bdd('0xa')](),controller[_0x7bdd('0x17')]);router['post']('/merge',auth['isAuthenticated'](),controller[_0x7bdd('0x18')]);router[_0x7bdd('0x19')]('/',auth[_0x7bdd('0xa')](),controller[_0x7bdd('0x1a')]);router[_0x7bdd('0x19')]('/create_many',auth[_0x7bdd('0xa')](),controller[_0x7bdd('0x1b')]);router[_0x7bdd('0x19')](_0x7bdd('0xf'),auth['isAuthenticated'](),controller[_0x7bdd('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1c3c75,_0x4e4f2b,_0x1b8359){_0x1b8359(null,path[_0x7bdd('0x1d')](config[_0x7bdd('0x1e')],'server/files/tmp'));},'filename':function(_0xa4751b,_0x2d17f0,_0x4c7035){_0x2d17f0[_0x7bdd('0x1f')]=_0x2d17f0[_0x7bdd('0x1f')][_0x7bdd('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4c7035(null,util[_0x7bdd('0x21')](_0x7bdd('0x22'),path[_0x7bdd('0x23')](_0x2d17f0[_0x7bdd('0x1f')],path['extname'](_0x2d17f0[_0x7bdd('0x1f')])),Date[_0x7bdd('0x24')](),path[_0x7bdd('0x25')](_0x2d17f0[_0x7bdd('0x1f')])));}})});router[_0x7bdd('0x19')](_0x7bdd('0x26'),upload[_0x7bdd('0x27')](_0x7bdd('0x28')),controller[_0x7bdd('0x29')]);var upload=multer({'storage':multer[_0x7bdd('0x2a')]({'destination':function(_0x56aec3,_0x2004cc,_0x50ff23){_0x50ff23(null,path[_0x7bdd('0x1d')](config[_0x7bdd('0x1e')],_0x7bdd('0x2b')));},'filename':function(_0xdf8cfc,_0x129d6a,_0x1a6a21){_0x129d6a[_0x7bdd('0x1f')]=_0x129d6a[_0x7bdd('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1a6a21(null,util[_0x7bdd('0x21')](_0x7bdd('0x22'),path[_0x7bdd('0x23')](_0x129d6a[_0x7bdd('0x1f')],path[_0x7bdd('0x25')](_0x129d6a[_0x7bdd('0x1f')])),Date['now'](),path[_0x7bdd('0x25')](_0x129d6a[_0x7bdd('0x1f')])));}})});router[_0x7bdd('0x19')](_0x7bdd('0x2c'),upload['single'](_0x7bdd('0x28')),controller[_0x7bdd('0x2d')]);router[_0x7bdd('0x19')]('/upload/:id',auth[_0x7bdd('0xa')](),controller['import']);router[_0x7bdd('0x2e')](_0x7bdd('0x2f'),auth['isAuthenticated'](),controller[_0x7bdd('0x30')]);router[_0x7bdd('0x31')](_0x7bdd('0x2f'),auth[_0x7bdd('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index a33cbf2..11fb7c1 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 _0xff0f=['parse','values','stringify','BOOLEAN','voice','exports','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select'];(function(_0x3abb9a,_0x43a20a){var _0x3d70f6=function(_0xca58c8){while(--_0xca58c8){_0x3abb9a['push'](_0x3abb9a['shift']());}};_0x3d70f6(++_0x43a20a);}(_0xff0f,0xf5));var _0xfff0=function(_0x3ed1a0,_0x2a4505){_0x3ed1a0=_0x3ed1a0-0x0;var _0x47d58f=_0xff0f[_0x3ed1a0];return _0x47d58f;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0xfff0('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x21749c){return this[_0xfff0('0x1')](_0xfff0('0x2'));}},'alias':{'type':Sequelize[_0xfff0('0x3')],'allowNull':![],'set':function(_0x36e858){this[_0xfff0('0x4')](_0xfff0('0x2'),_0x36e858?_0x36e858:this[_0xfff0('0x1')](_0xfff0('0x5')));}},'type':{'type':Sequelize[_0xfff0('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0xfff0('0x6')](_0xfff0('0x7')),'get':function(){if(this[_0xfff0('0x1')](_0xfff0('0x8'))===_0xfff0('0x9')){return JSON[_0xfff0('0xa')](this[_0xfff0('0x1')](_0xfff0('0xb')));}else{return this[_0xfff0('0x1')]('values');}},'set':function(_0x4575b4){if(Array['isArray'](_0x4575b4)){this['setDataValue'](_0xfff0('0xb'),JSON[_0xfff0('0xc')](_0x4575b4));}else{this[_0xfff0('0x4')]('values',_0x4575b4);}}},'required':{'type':Sequelize[_0xfff0('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xfff0('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xfff0('0xe'))}}; \ No newline at end of file +var _0x44ec=['STRING','setDataValue','name','TEXT','long','type','values','isArray','stringify','BOOLEAN','ENUM','voice','lodash','exports','getDataValue','alias'];(function(_0x46f479,_0xff76bb){var _0x3644bd=function(_0x1180b5){while(--_0x1180b5){_0x46f479['push'](_0x46f479['shift']());}};_0x3644bd(++_0xff76bb);}(_0x44ec,0xac));var _0xc44e=function(_0x21fc96,_0x2df0fe){_0x21fc96=_0x21fc96-0x0;var _0x2e00b0=_0x44ec[_0x21fc96];return _0x2e00b0;};'use strict';var Sequelize=require('sequelize');var _=require(_0xc44e('0x0'));module[_0xc44e('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x55e6d3){return this[_0xc44e('0x2')](_0xc44e('0x3'));}},'alias':{'type':Sequelize[_0xc44e('0x4')],'allowNull':![],'set':function(_0x425b99){this[_0xc44e('0x5')]('alias',_0x425b99?_0x425b99:this[_0xc44e('0x2')](_0xc44e('0x6')));}},'type':{'type':Sequelize[_0xc44e('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xc44e('0x7')](_0xc44e('0x8')),'get':function(){if(this[_0xc44e('0x2')](_0xc44e('0x9'))==='select'){return JSON['parse'](this[_0xc44e('0x2')](_0xc44e('0xa')));}else{return this[_0xc44e('0x2')](_0xc44e('0xa'));}},'set':function(_0x33de27){if(Array[_0xc44e('0xb')](_0x33de27)){this[_0xc44e('0x5')](_0xc44e('0xa'),JSON[_0xc44e('0xc')](_0x33de27));}else{this[_0xc44e('0x5')](_0xc44e('0xa'),_0x33de27);}}},'required':{'type':Sequelize[_0xc44e('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xc44e('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xc44e('0xe')](_0xc44e('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 3d9efa7..e04f9c8 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 _0xd509=['addColumn','cm_contacts','format','cf_%d','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','limit','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','CmCustomField','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','body','find','create','sequelize','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface'];(function(_0x4d07a4,_0x1e9163){var _0x3fd940=function(_0x418f35){while(--_0x418f35){_0x4d07a4['push'](_0x4d07a4['shift']());}};_0x3fd940(++_0x1e9163);}(_0xd509,0xfd));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9d50('0x0'));var jsonpatch=require(_0x9d50('0x1'));var rp=require(_0x9d50('0x2'));var moment=require(_0x9d50('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9d50('0x4'));var util=require(_0x9d50('0x5'));var path=require(_0x9d50('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9d50('0x7'));var fs=require('fs');var fs_extra=require(_0x9d50('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9d50('0x9'));var toCsv=require('to-csv');var querystring=require(_0x9d50('0xa'));var Papa=require(_0x9d50('0xb'));var Redis=require(_0x9d50('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x9d50('0xd'));var as=require(_0x9d50('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9d50('0xf'));var utils=require('../../config/utils');var config=require(_0x9d50('0x10'));var licenseUtil=require(_0x9d50('0x11'));var db=require(_0x9d50('0x12'))['db'];function respondWithStatusCode(_0x17dea7,_0x248669){_0x248669=_0x248669||0xcc;return function(_0x51cdcc){if(_0x51cdcc){return _0x17dea7['sendStatus'](_0x248669);}return _0x17dea7[_0x9d50('0x13')](_0x248669)[_0x9d50('0x14')]();};}function respondWithResult(_0x219ec5,_0x2f8b8c){_0x2f8b8c=_0x2f8b8c||0xc8;return function(_0x4d366b){if(_0x4d366b){return _0x219ec5[_0x9d50('0x13')](_0x2f8b8c)[_0x9d50('0x15')](_0x4d366b);}};}function respondWithFilteredResult(_0x5dd65c,_0x1db8e8){return function(_0x6f9a93){if(_0x6f9a93){var _0xd52158=typeof _0x1db8e8['offset']===_0x9d50('0x16')&&typeof _0x1db8e8['limit']===_0x9d50('0x16');var _0x488dba=_0x6f9a93['count'];var _0x3648b9=_0xd52158?0x0:_0x1db8e8[_0x9d50('0x17')];var _0x373433=_0xd52158?_0x6f9a93[_0x9d50('0x18')]:_0x1db8e8[_0x9d50('0x17')]+_0x1db8e8[_0x9d50('0x19')];var _0x262bfd;if(_0x373433>=_0x488dba){_0x373433=_0x488dba;_0x262bfd=0xc8;}else{_0x262bfd=0xce;}_0x5dd65c[_0x9d50('0x13')](_0x262bfd);return _0x5dd65c[_0x9d50('0x1a')](_0x9d50('0x1b'),_0x3648b9+'-'+_0x373433+'/'+_0x488dba)[_0x9d50('0x15')](_0x6f9a93);}return null;};}function patchUpdates(_0x535200){return function(_0x1d3c2a){try{jsonpatch['apply'](_0x1d3c2a,_0x535200,!![]);}catch(_0x232e21){return BPromise[_0x9d50('0x1c')](_0x232e21);}return _0x1d3c2a['save']();};}function saveUpdates(_0x194246,_0x43f21f){return function(_0x43eedb){if(_0x43eedb){return _0x43eedb[_0x9d50('0x1d')](_0x194246)[_0x9d50('0x1e')](function(_0x483da6){return _0x483da6;});}return null;};}function removeEntity(_0xedba8d,_0x11638e){return function(_0x50b2e9){if(_0x50b2e9){return _0x50b2e9[_0x9d50('0x1f')]()[_0x9d50('0x1e')](function(){_0xedba8d[_0x9d50('0x13')](0xcc)[_0x9d50('0x14')]();});}};}function handleEntityNotFound(_0x5345f3,_0x19b6ff){return function(_0x2b2c03){if(!_0x2b2c03){_0x5345f3[_0x9d50('0x20')](0x194);}return _0x2b2c03;};}function handleError(_0x78e76e,_0x56bd59){_0x56bd59=_0x56bd59||0x1f4;return function(_0x5cb452){logger[_0x9d50('0x21')](_0x5cb452[_0x9d50('0x22')]);if(_0x5cb452[_0x9d50('0x23')]){delete _0x5cb452[_0x9d50('0x23')];}_0x78e76e[_0x9d50('0x13')](_0x56bd59)[_0x9d50('0x24')](_0x5cb452);};}exports[_0x9d50('0x25')]=function(_0x5875ad,_0x521fbf){var _0x336086={},_0x3f5aff={},_0x52f222={'count':0x0,'rows':[]};var _0x228867=_[_0x9d50('0x26')](db[_0x9d50('0x27')]['rawAttributes'],function(_0x34f52b){return{'name':_0x34f52b[_0x9d50('0x28')],'type':_0x34f52b[_0x9d50('0x29')][_0x9d50('0x2a')]};});_0x3f5aff['model']=_['differenceBy'](_[_0x9d50('0x26')](_0x228867,_0x9d50('0x23')),[_0x9d50('0x23')]);_0x3f5aff[_0x9d50('0x2b')]=_['keys'](_0x5875ad[_0x9d50('0x2b')]);_0x3f5aff[_0x9d50('0x2c')]=_[_0x9d50('0x2d')](_0x3f5aff[_0x9d50('0x2e')],_0x3f5aff[_0x9d50('0x2b')]);_0x336086[_0x9d50('0x2f')]=_[_0x9d50('0x2d')](_0x3f5aff[_0x9d50('0x2e')],qs[_0x9d50('0x30')](_0x5875ad[_0x9d50('0x2b')][_0x9d50('0x30')]));_0x336086[_0x9d50('0x2f')]=_0x336086['attributes']['length']?_0x336086['attributes']:_0x3f5aff[_0x9d50('0x2e')];if(!_0x5875ad[_0x9d50('0x2b')][_0x9d50('0x31')](_0x9d50('0x32'))){_0x336086[_0x9d50('0x19')]=qs[_0x9d50('0x19')](_0x5875ad[_0x9d50('0x2b')][_0x9d50('0x19')]);_0x336086['offset']=qs[_0x9d50('0x17')](_0x5875ad['query'][_0x9d50('0x17')]);}_0x336086['order']=qs[_0x9d50('0x33')](_0x5875ad[_0x9d50('0x2b')][_0x9d50('0x33')]);_0x336086[_0x9d50('0x34')]=qs[_0x9d50('0x2c')](_['pick'](_0x5875ad[_0x9d50('0x2b')],_0x3f5aff[_0x9d50('0x2c')]),_0x228867);if(_0x5875ad['query'][_0x9d50('0x35')]){_0x336086['where']=_['merge'](_0x336086[_0x9d50('0x34')],{'$or':_[_0x9d50('0x26')](_0x228867,function(_0x5add38){if(_0x5add38[_0x9d50('0x29')]!==_0x9d50('0x36')){var _0x439031={};_0x439031[_0x5add38[_0x9d50('0x23')]]={'$like':'%'+_0x5875ad[_0x9d50('0x2b')][_0x9d50('0x35')]+'%'};return _0x439031;}})});}_0x336086=_[_0x9d50('0x37')]({},_0x336086,_0x5875ad[_0x9d50('0x38')]);var _0x382d18={'where':_0x336086['where']};return db[_0x9d50('0x27')][_0x9d50('0x18')](_0x382d18)[_0x9d50('0x1e')](function(_0x3af70b){_0x52f222[_0x9d50('0x18')]=_0x3af70b;if(_0x5875ad['query'][_0x9d50('0x39')]){_0x336086['include']=[{'all':!![]}];}return db[_0x9d50('0x27')][_0x9d50('0x3a')](_0x336086);})[_0x9d50('0x1e')](function(_0x5012ac){_0x52f222[_0x9d50('0x3b')]=_0x5012ac;return _0x52f222;})[_0x9d50('0x1e')](respondWithFilteredResult(_0x521fbf,_0x336086))[_0x9d50('0x3c')](handleError(_0x521fbf,null));};exports[_0x9d50('0x3d')]=function(_0xa411a4,_0x15c82d){var _0x998cf6={'raw':!![],'where':{'id':_0xa411a4[_0x9d50('0x3e')]['id']}},_0x591b95={};_0x591b95['model']=_[_0x9d50('0x3f')](db[_0x9d50('0x27')][_0x9d50('0x40')]);_0x591b95[_0x9d50('0x2b')]=_['keys'](_0xa411a4['query']);_0x591b95['filters']=_[_0x9d50('0x2d')](_0x591b95[_0x9d50('0x2e')],_0x591b95['query']);_0x998cf6[_0x9d50('0x2f')]=_[_0x9d50('0x2d')](_0x591b95[_0x9d50('0x2e')],qs[_0x9d50('0x30')](_0xa411a4[_0x9d50('0x2b')][_0x9d50('0x30')]));_0x998cf6[_0x9d50('0x2f')]=_0x998cf6[_0x9d50('0x2f')][_0x9d50('0x41')]?_0x998cf6['attributes']:_0x591b95[_0x9d50('0x2e')];if(_0xa411a4[_0x9d50('0x2b')][_0x9d50('0x39')]){_0x998cf6['include']=[{'all':!![]}];}_0x998cf6=_[_0x9d50('0x37')]({},_0x998cf6,_0xa411a4[_0x9d50('0x38')]);return db[_0x9d50('0x27')]['find'](_0x998cf6)['then'](handleEntityNotFound(_0x15c82d,null))['then'](respondWithResult(_0x15c82d,null))[_0x9d50('0x3c')](handleError(_0x15c82d,null));};exports[_0x9d50('0x1d')]=function(_0x42a773,_0x5c7e2c){if(_0x42a773[_0x9d50('0x42')]['id']){delete _0x42a773[_0x9d50('0x42')]['id'];}return db[_0x9d50('0x27')]['find']({'where':{'id':_0x42a773['params']['id']}})[_0x9d50('0x1e')](handleEntityNotFound(_0x5c7e2c,null))[_0x9d50('0x1e')](saveUpdates(_0x42a773[_0x9d50('0x42')],null))['then'](respondWithResult(_0x5c7e2c,null))['catch'](handleError(_0x5c7e2c,null));};exports['destroy']=function(_0x1d2bdf,_0x3efcec){return db[_0x9d50('0x27')][_0x9d50('0x43')]({'where':{'id':_0x1d2bdf[_0x9d50('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3efcec,null))[_0x9d50('0x1e')](removeEntity(_0x3efcec,null))['catch'](handleError(_0x3efcec,null));};exports[_0x9d50('0x44')]=function(_0x56111f,_0x410f5f){var _0x5cee4a;return db[_0x9d50('0x45')]['transaction'](function(_0x2d4297){return db[_0x9d50('0x27')][_0x9d50('0x44')](_0x56111f[_0x9d50('0x42')],{'transaction':_0x2d4297})['then'](function(_0x14349f){_0x5cee4a=_0x14349f;var _0x2ad31d={'type':db[_0x9d50('0x46')][_0x9d50('0x47')],'transaction':_0x2d4297};switch(_0x56111f['body'][_0x9d50('0x29')]){case _0x9d50('0x48'):_0x2ad31d[_0x9d50('0x29')]=db[_0x9d50('0x46')][_0x9d50('0x47')];break;case _0x9d50('0x49'):_0x2ad31d[_0x9d50('0x29')]=db[_0x9d50('0x46')][_0x9d50('0x4a')];break;case _0x9d50('0x4b'):_0x2ad31d[_0x9d50('0x29')]=db[_0x9d50('0x46')][_0x9d50('0x4c')];_0x2ad31d[_0x9d50('0x4d')]=![];break;default:}return db['sequelize'][_0x9d50('0x4e')][_0x9d50('0x4f')](_0x9d50('0x50'),util[_0x9d50('0x51')](_0x9d50('0x52'),_0x5cee4a['id']),_0x2ad31d);})[_0x9d50('0x1e')](function(){return _0x5cee4a;});})[_0x9d50('0x1e')](respondWithResult(_0x410f5f,0xc9))[_0x9d50('0x3c')](handleError(_0x410f5f,null));}; \ No newline at end of file +var _0x8b20=['ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','CmCustomField','rawAttributes','type','model','differenceBy','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','filters','find','body','create','sequelize','transaction','Sequelize','TEXT','INTEGER','switch','defaultValue','queryInterface','cm_contacts','format','cf_%d','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x8b20,0xf4));var _0x08b2=function(_0x5db74b,_0x3b5003){_0x5db74b=_0x5db74b-0x0;var _0x5e2aad=_0x8b20[_0x5db74b];return _0x5e2aad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x08b2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x08b2('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x08b2('0x2'));var Mustache=require(_0x08b2('0x3'));var util=require(_0x08b2('0x4'));var path=require(_0x08b2('0x5'));var sox=require(_0x08b2('0x6'));var csv=require(_0x08b2('0x7'));var ejs=require(_0x08b2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08b2('0x9'));var squel=require(_0x08b2('0xa'));var crypto=require(_0x08b2('0xb'));var jsforce=require(_0x08b2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x08b2('0x7'));var querystring=require('querystring');var Papa=require(_0x08b2('0xd'));var Redis=require(_0x08b2('0xe'));var authService=require(_0x08b2('0xf'));var qs=require(_0x08b2('0x10'));var as=require(_0x08b2('0x11'));var hardwareService=require(_0x08b2('0x12'));var logger=require('../../config/logger')(_0x08b2('0x13'));var utils=require('../../config/utils');var config=require(_0x08b2('0x14'));var licenseUtil=require(_0x08b2('0x15'));var db=require(_0x08b2('0x16'))['db'];function respondWithStatusCode(_0x2d44c7,_0x138563){_0x138563=_0x138563||0xcc;return function(_0x5ceea6){if(_0x5ceea6){return _0x2d44c7['sendStatus'](_0x138563);}return _0x2d44c7[_0x08b2('0x17')](_0x138563)[_0x08b2('0x18')]();};}function respondWithResult(_0x29f6c5,_0x472089){_0x472089=_0x472089||0xc8;return function(_0x2f93d8){if(_0x2f93d8){return _0x29f6c5[_0x08b2('0x17')](_0x472089)[_0x08b2('0x19')](_0x2f93d8);}};}function respondWithFilteredResult(_0x45750e,_0x4bea9c){return function(_0x18d721){if(_0x18d721){var _0x15d9e0=typeof _0x4bea9c[_0x08b2('0x1a')]===_0x08b2('0x1b')&&typeof _0x4bea9c[_0x08b2('0x1c')]===_0x08b2('0x1b');var _0x9f8350=_0x18d721[_0x08b2('0x1d')];var _0x15cf83=_0x15d9e0?0x0:_0x4bea9c['offset'];var _0x353fa5=_0x15d9e0?_0x18d721['count']:_0x4bea9c['offset']+_0x4bea9c['limit'];var _0x1b6168;if(_0x353fa5>=_0x9f8350){_0x353fa5=_0x9f8350;_0x1b6168=0xc8;}else{_0x1b6168=0xce;}_0x45750e[_0x08b2('0x17')](_0x1b6168);return _0x45750e[_0x08b2('0x1e')](_0x08b2('0x1f'),_0x15cf83+'-'+_0x353fa5+'/'+_0x9f8350)[_0x08b2('0x19')](_0x18d721);}return null;};}function patchUpdates(_0x59974){return function(_0xd08d48){try{jsonpatch[_0x08b2('0x20')](_0xd08d48,_0x59974,!![]);}catch(_0xaca164){return BPromise[_0x08b2('0x21')](_0xaca164);}return _0xd08d48[_0x08b2('0x22')]();};}function saveUpdates(_0x1a51d6,_0x6bd18e){return function(_0xb217b5){if(_0xb217b5){return _0xb217b5[_0x08b2('0x23')](_0x1a51d6)[_0x08b2('0x24')](function(_0x405e5e){return _0x405e5e;});}return null;};}function removeEntity(_0x260711,_0x5771c9){return function(_0x43ef26){if(_0x43ef26){return _0x43ef26[_0x08b2('0x25')]()[_0x08b2('0x24')](function(){_0x260711['status'](0xcc)[_0x08b2('0x18')]();});}};}function handleEntityNotFound(_0x2b4e39,_0x4112d1){return function(_0x2fa85d){if(!_0x2fa85d){_0x2b4e39[_0x08b2('0x26')](0x194);}return _0x2fa85d;};}function handleError(_0x3ab679,_0x29d20a){_0x29d20a=_0x29d20a||0x1f4;return function(_0x43a020){logger['error'](_0x43a020[_0x08b2('0x27')]);if(_0x43a020[_0x08b2('0x28')]){delete _0x43a020['name'];}_0x3ab679[_0x08b2('0x17')](_0x29d20a)[_0x08b2('0x29')](_0x43a020);};}exports[_0x08b2('0x2a')]=function(_0x473e7a,_0x3f2068){var _0x27230e={},_0x15b57c={},_0x444529={'count':0x0,'rows':[]};var _0x3a3df6=_[_0x08b2('0x2b')](db[_0x08b2('0x2c')][_0x08b2('0x2d')],function(_0x1d9ed4){return{'name':_0x1d9ed4['fieldName'],'type':_0x1d9ed4[_0x08b2('0x2e')]['key']};});_0x15b57c[_0x08b2('0x2f')]=_[_0x08b2('0x30')](_[_0x08b2('0x2b')](_0x3a3df6,_0x08b2('0x28')),[_0x08b2('0x28')]);_0x15b57c['query']=_['keys'](_0x473e7a['query']);_0x15b57c['filters']=_[_0x08b2('0x31')](_0x15b57c[_0x08b2('0x2f')],_0x15b57c[_0x08b2('0x32')]);_0x27230e['attributes']=_[_0x08b2('0x31')](_0x15b57c[_0x08b2('0x2f')],qs[_0x08b2('0x33')](_0x473e7a[_0x08b2('0x32')]['fields']));_0x27230e['attributes']=_0x27230e[_0x08b2('0x34')]['length']?_0x27230e[_0x08b2('0x34')]:_0x15b57c[_0x08b2('0x2f')];if(!_0x473e7a['query'][_0x08b2('0x35')](_0x08b2('0x36'))){_0x27230e['limit']=qs[_0x08b2('0x1c')](_0x473e7a[_0x08b2('0x32')]['limit']);_0x27230e['offset']=qs['offset'](_0x473e7a[_0x08b2('0x32')]['offset']);}_0x27230e[_0x08b2('0x37')]=qs[_0x08b2('0x38')](_0x473e7a['query'][_0x08b2('0x38')]);_0x27230e[_0x08b2('0x39')]=qs['filters'](_[_0x08b2('0x3a')](_0x473e7a[_0x08b2('0x32')],_0x15b57c['filters']),_0x3a3df6);if(_0x473e7a[_0x08b2('0x32')][_0x08b2('0x3b')]){_0x27230e['where']=_[_0x08b2('0x3c')](_0x27230e[_0x08b2('0x39')],{'$or':_[_0x08b2('0x2b')](_0x3a3df6,function(_0x20d8c7){if(_0x20d8c7[_0x08b2('0x2e')]!==_0x08b2('0x3d')){var _0x43d482={};_0x43d482[_0x20d8c7[_0x08b2('0x28')]]={'$like':'%'+_0x473e7a[_0x08b2('0x32')][_0x08b2('0x3b')]+'%'};return _0x43d482;}})});}_0x27230e=_[_0x08b2('0x3c')]({},_0x27230e,_0x473e7a[_0x08b2('0x3e')]);var _0x30ab0a={'where':_0x27230e['where']};return db['CmCustomField'][_0x08b2('0x1d')](_0x30ab0a)['then'](function(_0x205f16){_0x444529[_0x08b2('0x1d')]=_0x205f16;if(_0x473e7a['query'][_0x08b2('0x3f')]){_0x27230e[_0x08b2('0x40')]=[{'all':!![]}];}return db[_0x08b2('0x2c')]['findAll'](_0x27230e);})[_0x08b2('0x24')](function(_0x323588){_0x444529['rows']=_0x323588;return _0x444529;})[_0x08b2('0x24')](respondWithFilteredResult(_0x3f2068,_0x27230e))[_0x08b2('0x41')](handleError(_0x3f2068,null));};exports[_0x08b2('0x42')]=function(_0x35aa54,_0x1bc3c6){var _0x5ef395={'raw':!![],'where':{'id':_0x35aa54[_0x08b2('0x43')]['id']}},_0x144fed={};_0x144fed[_0x08b2('0x2f')]=_[_0x08b2('0x44')](db[_0x08b2('0x2c')]['rawAttributes']);_0x144fed[_0x08b2('0x32')]=_['keys'](_0x35aa54[_0x08b2('0x32')]);_0x144fed[_0x08b2('0x45')]=_[_0x08b2('0x31')](_0x144fed['model'],_0x144fed[_0x08b2('0x32')]);_0x5ef395[_0x08b2('0x34')]=_[_0x08b2('0x31')](_0x144fed[_0x08b2('0x2f')],qs[_0x08b2('0x33')](_0x35aa54[_0x08b2('0x32')][_0x08b2('0x33')]));_0x5ef395[_0x08b2('0x34')]=_0x5ef395['attributes']['length']?_0x5ef395[_0x08b2('0x34')]:_0x144fed[_0x08b2('0x2f')];if(_0x35aa54['query'][_0x08b2('0x3f')]){_0x5ef395[_0x08b2('0x40')]=[{'all':!![]}];}_0x5ef395=_[_0x08b2('0x3c')]({},_0x5ef395,_0x35aa54[_0x08b2('0x3e')]);return db[_0x08b2('0x2c')][_0x08b2('0x46')](_0x5ef395)[_0x08b2('0x24')](handleEntityNotFound(_0x1bc3c6,null))[_0x08b2('0x24')](respondWithResult(_0x1bc3c6,null))['catch'](handleError(_0x1bc3c6,null));};exports[_0x08b2('0x23')]=function(_0x482460,_0x29873d){if(_0x482460[_0x08b2('0x47')]['id']){delete _0x482460[_0x08b2('0x47')]['id'];}return db[_0x08b2('0x2c')][_0x08b2('0x46')]({'where':{'id':_0x482460[_0x08b2('0x43')]['id']}})[_0x08b2('0x24')](handleEntityNotFound(_0x29873d,null))['then'](saveUpdates(_0x482460[_0x08b2('0x47')],null))[_0x08b2('0x24')](respondWithResult(_0x29873d,null))[_0x08b2('0x41')](handleError(_0x29873d,null));};exports[_0x08b2('0x25')]=function(_0x4188fc,_0x513d10){return db[_0x08b2('0x2c')][_0x08b2('0x46')]({'where':{'id':_0x4188fc[_0x08b2('0x43')]['id']}})[_0x08b2('0x24')](handleEntityNotFound(_0x513d10,null))['then'](removeEntity(_0x513d10,null))[_0x08b2('0x41')](handleError(_0x513d10,null));};exports[_0x08b2('0x48')]=function(_0x3da486,_0x571396){var _0x68e1db;return db[_0x08b2('0x49')][_0x08b2('0x4a')](function(_0x5e39e7){return db[_0x08b2('0x2c')][_0x08b2('0x48')](_0x3da486['body'],{'transaction':_0x5e39e7})[_0x08b2('0x24')](function(_0x11242f){_0x68e1db=_0x11242f;var _0x2f73c8={'type':db[_0x08b2('0x4b')][_0x08b2('0x4c')],'transaction':_0x5e39e7};switch(_0x3da486[_0x08b2('0x47')][_0x08b2('0x2e')]){case'text':_0x2f73c8['type']=db[_0x08b2('0x4b')]['TEXT'];break;case'number':_0x2f73c8['type']=db[_0x08b2('0x4b')][_0x08b2('0x4d')];break;case _0x08b2('0x4e'):_0x2f73c8['type']=db['Sequelize']['BOOLEAN'];_0x2f73c8[_0x08b2('0x4f')]=![];break;default:}return db['sequelize'][_0x08b2('0x50')]['addColumn'](_0x08b2('0x51'),util[_0x08b2('0x52')](_0x08b2('0x53'),_0x68e1db['id']),_0x2f73c8);})['then'](function(){return _0x68e1db;});})[_0x08b2('0x24')](respondWithResult(_0x571396,0xc9))['catch'](handleError(_0x571396,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 1343cb1..823dcd2 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 _0x8500=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','lodash'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x8500,0xc5));var _0x0850=function(_0xaf87ad,_0x3d976f){_0xaf87ad=_0xaf87ad-0x0;var _0x12d518=_0x8500[_0xaf87ad];return _0x12d518;};'use strict';var _=require(_0x0850('0x0'));var util=require('util');var logger=require(_0x0850('0x1'))(_0x0850('0x2'));var moment=require(_0x0850('0x3'));var BPromise=require('bluebird');var rp=require(_0x0850('0x4'));var fs=require('fs');var path=require(_0x0850('0x5'));var rimraf=require(_0x0850('0x6'));var config=require(_0x0850('0x7'));var attributes=require(_0x0850('0x8'));module[_0x0850('0x9')]=function(_0x13b4aa,_0x5d91c9){return _0x13b4aa[_0x0850('0xa')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9526=['path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','moment','bluebird','request-promise'];(function(_0x1be26c,_0x353db4){var _0x27e923=function(_0x304db8){while(--_0x304db8){_0x1be26c['push'](_0x1be26c['shift']());}};_0x27e923(++_0x353db4);}(_0x9526,0xd3));var _0x6952=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0x9526[_0x511bd1];return _0x4c48ec;};'use strict';var _=require(_0x6952('0x0'));var util=require(_0x6952('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6952('0x2'));var BPromise=require(_0x6952('0x3'));var rp=require(_0x6952('0x4'));var fs=require('fs');var path=require(_0x6952('0x5'));var rimraf=require(_0x6952('0x6'));var config=require(_0x6952('0x7'));var attributes=require(_0x6952('0x8'));module[_0x6952('0x9')]=function(_0x4f627a,_0x2019ae){return _0x4f627a[_0x6952('0xa')]('CmCustomField',attributes,{'tableName':_0x6952('0xb'),'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 c7d5a96..ea7a198 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 _0x574c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x51e173,_0x3bfef0){var _0x14c367=function(_0x3777b3){while(--_0x3777b3){_0x51e173['push'](_0x51e173['shift']());}};_0x14c367(++_0x3bfef0);}(_0x574c,0x7b));var _0xc574=function(_0x519905,_0xcdb715){_0x519905=_0x519905-0x0;var _0x4e2b91=_0x574c[_0x519905];return _0x4e2b91;};'use strict';var _=require(_0xc574('0x0'));var util=require(_0xc574('0x1'));var moment=require(_0xc574('0x2'));var BPromise=require(_0xc574('0x3'));var rs=require(_0xc574('0x4'));var fs=require('fs');var Redis=require(_0xc574('0x5'));var db=require(_0xc574('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc574('0x7'))(_0xc574('0x8'));var config=require(_0xc574('0x9'));var jayson=require(_0xc574('0xa'));var client=jayson[_0xc574('0xb')][_0xc574('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x590feb,_0x1c5506,_0x3315c0){return new BPromise(function(_0x3fcfd1,_0x36e3f2){return client[_0xc574('0xd')](_0x590feb,_0x3315c0)[_0xc574('0xe')](function(_0x55c5f8){logger[_0xc574('0xf')](_0xc574('0x10'),_0x1c5506,_0xc574('0x11'));logger[_0xc574('0x12')](_0xc574('0x13'),_0x1c5506,_0xc574('0x11'),JSON[_0xc574('0x14')](_0x55c5f8));if(_0x55c5f8[_0xc574('0x15')]){if(_0x55c5f8['error'][_0xc574('0x16')]===0x1f4){logger['error'](_0xc574('0x10'),_0x1c5506,_0x55c5f8[_0xc574('0x15')][_0xc574('0x17')]);return _0x36e3f2(_0x55c5f8[_0xc574('0x15')][_0xc574('0x17')]);}logger[_0xc574('0x15')](_0xc574('0x10'),_0x1c5506,_0x55c5f8[_0xc574('0x15')]['message']);return _0x3fcfd1(_0x55c5f8[_0xc574('0x15')][_0xc574('0x17')]);}else{logger[_0xc574('0xf')](_0xc574('0x10'),_0x1c5506,_0xc574('0x11'));_0x3fcfd1(_0x55c5f8['result'][_0xc574('0x17')]);}})[_0xc574('0x18')](function(_0x4f9fd3){logger[_0xc574('0x15')](_0xc574('0x10'),_0x1c5506,_0x4f9fd3);_0x36e3f2(_0x4f9fd3);});});} \ No newline at end of file +var _0x5e70=['moment','bluebird','randomstring','../../mysqldb','../../config/environment','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','util'];(function(_0x5cfdf7,_0x58324a){var _0x3b670a=function(_0x2ee2e0){while(--_0x2ee2e0){_0x5cfdf7['push'](_0x5cfdf7['shift']());}};_0x3b670a(++_0x58324a);}(_0x5e70,0x131));var _0x05e7=function(_0x2512d3,_0x510268){_0x2512d3=_0x2512d3-0x0;var _0x431e02=_0x5e70[_0x2512d3];return _0x431e02;};'use strict';var _=require('lodash');var util=require(_0x05e7('0x0'));var moment=require(_0x05e7('0x1'));var BPromise=require(_0x05e7('0x2'));var rs=require(_0x05e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x05e7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x05e7('0x6')][_0x05e7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2a959f,_0x26d891,_0x200d62){return new BPromise(function(_0x39f101,_0x190ecd){return client[_0x05e7('0x8')](_0x2a959f,_0x200d62)[_0x05e7('0x9')](function(_0x2ea2b3){logger[_0x05e7('0xa')](_0x05e7('0xb'),_0x26d891,_0x05e7('0xc'));logger[_0x05e7('0xd')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x26d891,_0x05e7('0xc'),JSON['stringify'](_0x2ea2b3));if(_0x2ea2b3[_0x05e7('0xe')]){if(_0x2ea2b3[_0x05e7('0xe')][_0x05e7('0xf')]===0x1f4){logger[_0x05e7('0xe')](_0x05e7('0xb'),_0x26d891,_0x2ea2b3[_0x05e7('0xe')]['message']);return _0x190ecd(_0x2ea2b3['error'][_0x05e7('0x10')]);}logger[_0x05e7('0xe')]('CmCustomField,\x20%s,\x20%s',_0x26d891,_0x2ea2b3[_0x05e7('0xe')][_0x05e7('0x10')]);return _0x39f101(_0x2ea2b3[_0x05e7('0xe')][_0x05e7('0x10')]);}else{logger[_0x05e7('0xa')](_0x05e7('0xb'),_0x26d891,_0x05e7('0xc'));_0x39f101(_0x2ea2b3['result'][_0x05e7('0x10')]);}})[_0x05e7('0x11')](function(_0x39d4ea){logger['error'](_0x05e7('0xb'),_0x26d891,_0x39d4ea);_0x190ecd(_0x39d4ea);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index d9082a9..614475a 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 _0xf5dc=['isAuthenticated','index','/:id','show','post','create','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get'];(function(_0x1a014b,_0x48acae){var _0x462258=function(_0x1473be){while(--_0x1473be){_0x1a014b['push'](_0x1a014b['shift']());}};_0x462258(++_0x48acae);}(_0xf5dc,0x117));var _0xcf5d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf5dc[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcf5d('0x0'));var timeout=require(_0xcf5d('0x1'));var express=require('express');var router=express[_0xcf5d('0x2')]();var fs_extra=require(_0xcf5d('0x3'));var auth=require(_0xcf5d('0x4'));var interaction=require(_0xcf5d('0x5'));var config=require(_0xcf5d('0x6'));var controller=require(_0xcf5d('0x7'));router[_0xcf5d('0x8')]('/',auth[_0xcf5d('0x9')](),controller[_0xcf5d('0xa')]);router[_0xcf5d('0x8')](_0xcf5d('0xb'),auth[_0xcf5d('0x9')](),controller[_0xcf5d('0xc')]);router[_0xcf5d('0xd')]('/',auth['isAuthenticated'](),controller[_0xcf5d('0xe')]);router['put'](_0xcf5d('0xb'),auth[_0xcf5d('0x9')](),controller['update']);router['delete'](_0xcf5d('0xb'),auth[_0xcf5d('0x9')](),controller[_0xcf5d('0xf')]);module['exports']=router; \ No newline at end of file +var _0x815b=['multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./cmCustomField.controller','get','index','isAuthenticated','create','put','/:id','update','delete','destroy','exports'];(function(_0x3744de,_0x1bf18e){var _0x287ca4=function(_0x56626c){while(--_0x56626c){_0x3744de['push'](_0x3744de['shift']());}};_0x287ca4(++_0x1bf18e);}(_0x815b,0xb4));var _0xb815=function(_0x4fda9d,_0x5cb351){_0x4fda9d=_0x4fda9d-0x0;var _0x4bfe28=_0x815b[_0x4fda9d];return _0x4bfe28;};'use strict';var multer=require(_0xb815('0x0'));var util=require(_0xb815('0x1'));var path=require(_0xb815('0x2'));var timeout=require(_0xb815('0x3'));var express=require(_0xb815('0x4'));var router=express['Router']();var fs_extra=require(_0xb815('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb815('0x6'));var controller=require(_0xb815('0x7'));router[_0xb815('0x8')]('/',auth['isAuthenticated'](),controller[_0xb815('0x9')]);router[_0xb815('0x8')]('/:id',auth[_0xb815('0xa')](),controller['show']);router['post']('/',auth[_0xb815('0xa')](),controller[_0xb815('0xb')]);router[_0xb815('0xc')](_0xb815('0xd'),auth[_0xb815('0xa')](),controller[_0xb815('0xe')]);router[_0xb815('0xf')](_0xb815('0xd'),auth['isAuthenticated'](),controller[_0xb815('0x10')]);module[_0xb815('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 570835d..513053c 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 _0x14a0=['UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x310b9f,_0x3ac8c1){var _0x56cc4f=function(_0x49b879){while(--_0x49b879){_0x310b9f['push'](_0x310b9f['shift']());}};_0x56cc4f(++_0x3ac8c1);}(_0x14a0,0x8e));var _0x014a=function(_0x3a4377,_0x4c2b34){_0x3a4377=_0x3a4377-0x0;var _0x1d46ab=_0x14a0[_0x3a4377];return _0x1d46ab;};'use strict';var moment=require('moment');var Sequelize=require(_0x014a('0x0'));module[_0x014a('0x1')]={'phone':{'type':Sequelize[_0x014a('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x014a('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x014a('0x4')],'defaultValue':moment()[_0x014a('0x5')](_0x014a('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x014a('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x014a('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x014a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x014a('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x014a('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x014a('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x014a('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x014a('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x014a('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x014a('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x014a('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x014a('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xd4a2=['BOOLEAN','UNSIGNED','contactListQueue','moment','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x5138e0,_0x24fbbc){var _0x18e57b=function(_0x5eda17){while(--_0x5eda17){_0x5138e0['push'](_0x5138e0['shift']());}};_0x18e57b(++_0x24fbbc);}(_0xd4a2,0x173));var _0x2d4a=function(_0x483b3b,_0x3fd4ee){_0x483b3b=_0x483b3b-0x0;var _0x554b3f=_0xd4a2[_0x483b3b];return _0x554b3f;};'use strict';var moment=require(_0x2d4a('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x2d4a('0x1')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x2d4a('0x2')],'defaultValue':moment()['format'](_0x2d4a('0x3'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2d4a('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2d4a('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x2d4a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2d4a('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2d4a('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2d4a('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x2d4a('0x5')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x2d4a('0x4')],'unique':_0x2d4a('0x7')},'ListId':{'type':Sequelize[_0x2d4a('0x4')],'unique':_0x2d4a('0x7')},'UserId':{'type':Sequelize[_0x2d4a('0x4')]},'VoiceQueueId':{'type':Sequelize[_0x2d4a('0x4')],'unique':_0x2d4a('0x7')},'CampaignId':{'type':Sequelize[_0x2d4a('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x2d4a('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2d4a('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2d4a('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x2d4a('0x2')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 5332515..d7beba6 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 _0x4f08=['hopperId','findOne','scheduledat','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','status','Content-Range','apply','save','update','then','error','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','firstName','lastName','isNil','finally','CmHopperFinal','CmContact','outbound','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','isEmpty','hopperIds','ASC','scheduledAt','dialOrderByScheduledAt','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','recallme','LOCK','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','getVoiceQueues','preview'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4f08,0xaa));var _0x84f0=function(_0x1a4f3c,_0x5ec1b6){_0x1a4f3c=_0x1a4f3c-0x0;var _0x18797d=_0x4f08[_0x1a4f3c];return _0x18797d;};'use strict';var emlformat=require(_0x84f0('0x0'));var rimraf=require(_0x84f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x84f0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x84f0('0x3'));var Mustache=require(_0x84f0('0x4'));var util=require(_0x84f0('0x5'));var path=require(_0x84f0('0x6'));var sox=require(_0x84f0('0x7'));var csv=require(_0x84f0('0x8'));var ejs=require(_0x84f0('0x9'));var fs=require('fs');var fs_extra=require(_0x84f0('0xa'));var _=require(_0x84f0('0xb'));var squel=require('squel');var crypto=require(_0x84f0('0xc'));var jsforce=require(_0x84f0('0xd'));var deskjs=require(_0x84f0('0xe'));var toCsv=require(_0x84f0('0x8'));var querystring=require(_0x84f0('0xf'));var Papa=require(_0x84f0('0x10'));var Redis=require(_0x84f0('0x11'));var authService=require(_0x84f0('0x12'));var qs=require(_0x84f0('0x13'));var as=require(_0x84f0('0x14'));var hardwareService=require(_0x84f0('0x15'));var logger=require(_0x84f0('0x16'))('api');var utils=require(_0x84f0('0x17'));var config=require(_0x84f0('0x18'));var shared=require(_0x84f0('0x18'));var licenseUtil=require(_0x84f0('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47debb,_0x8a079d){_0x8a079d=_0x8a079d||0xcc;return function(_0x3c46be){if(_0x3c46be){return _0x47debb[_0x84f0('0x1a')](_0x8a079d);}return _0x47debb['status'](_0x8a079d)[_0x84f0('0x1b')]();};}function respondWithResult(_0x2f8e41,_0x36a567){_0x36a567=_0x36a567||0xc8;return function(_0x17a29e){if(_0x17a29e){return _0x2f8e41['status'](_0x36a567)[_0x84f0('0x1c')](_0x17a29e);}};}function respondWithFilteredResult(_0x12afb6,_0x50da57){return function(_0x345df4){if(_0x345df4){var _0x566916=typeof _0x50da57[_0x84f0('0x1d')]===_0x84f0('0x1e')&&typeof _0x50da57['limit']===_0x84f0('0x1e');var _0x575208=_0x345df4[_0x84f0('0x1f')];var _0x297133=_0x566916?0x0:_0x50da57[_0x84f0('0x1d')];var _0x4b57f5=_0x566916?_0x345df4[_0x84f0('0x1f')]:_0x50da57[_0x84f0('0x1d')]+_0x50da57['limit'];var _0xe824b;if(_0x4b57f5>=_0x575208){_0x4b57f5=_0x575208;_0xe824b=0xc8;}else{_0xe824b=0xce;}_0x12afb6[_0x84f0('0x20')](_0xe824b);return _0x12afb6['set'](_0x84f0('0x21'),_0x297133+'-'+_0x4b57f5+'/'+_0x575208)['json'](_0x345df4);}return null;};}function patchUpdates(_0xdb3e6a){return function(_0x4b8479){try{jsonpatch[_0x84f0('0x22')](_0x4b8479,_0xdb3e6a,!![]);}catch(_0x371ceb){return BPromise['reject'](_0x371ceb);}return _0x4b8479[_0x84f0('0x23')]();};}function saveUpdates(_0x32d5c2,_0x107c36){return function(_0x1b7a4a){if(_0x1b7a4a){return _0x1b7a4a[_0x84f0('0x24')](_0x32d5c2)[_0x84f0('0x25')](function(_0x5ea19b){return _0x5ea19b;});}return null;};}function removeEntity(_0x1359f2,_0x332092){return function(_0x22ccfc){if(_0x22ccfc){return _0x22ccfc['destroy']()[_0x84f0('0x25')](function(){_0x1359f2[_0x84f0('0x20')](0xcc)[_0x84f0('0x1b')]();});}};}function handleEntityNotFound(_0x196d71,_0x649698){return function(_0x10e9cc){if(!_0x10e9cc){_0x196d71['sendStatus'](0x194);}return _0x10e9cc;};}function handleError(_0x67b1b2,_0x7679e6){_0x7679e6=_0x7679e6||0x1f4;return function(_0x3131e6){logger[_0x84f0('0x26')](_0x3131e6['stack']);if(_0x3131e6[_0x84f0('0x27')]){delete _0x3131e6[_0x84f0('0x27')];}_0x67b1b2[_0x84f0('0x20')](_0x7679e6)[_0x84f0('0x28')](_0x3131e6);};}exports[_0x84f0('0x29')]=function(_0x3dc83c,_0x3e4f40){var _0x844c1b={},_0x3c0a8d={},_0x133981={'count':0x0,'rows':[]};var _0x80a1be=_[_0x84f0('0x2a')](db[_0x84f0('0x2b')][_0x84f0('0x2c')],function(_0x4ba6f5){return{'name':_0x4ba6f5[_0x84f0('0x2d')],'type':_0x4ba6f5[_0x84f0('0x2e')][_0x84f0('0x2f')]};});_0x3c0a8d[_0x84f0('0x30')]=_[_0x84f0('0x2a')](_0x80a1be,_0x84f0('0x27'));_0x3c0a8d[_0x84f0('0x31')]=_[_0x84f0('0x32')](_0x3dc83c[_0x84f0('0x31')]);_0x3c0a8d[_0x84f0('0x33')]=_[_0x84f0('0x34')](_0x3c0a8d['model'],_0x3c0a8d[_0x84f0('0x31')]);_0x3c0a8d[_0x84f0('0x33')]=_[_0x84f0('0x35')](_0x3c0a8d[_0x84f0('0x33')],[_0x84f0('0x36'),_0x84f0('0x37'),_0x84f0('0x38'),_0x84f0('0x39'),'$lt',_0x84f0('0x3a'),'$ne','$eq',_0x84f0('0x3b'),'$between',_0x84f0('0x3c'),_0x84f0('0x3d'),_0x84f0('0x3e'),_0x84f0('0x3f'),_0x84f0('0x40'),_0x84f0('0x41'),_0x84f0('0x42'),_0x84f0('0x3f'),'$overlap',_0x84f0('0x43'),_0x84f0('0x44'),_0x84f0('0x45')]);_0x844c1b['attributes']=_[_0x84f0('0x34')](_0x3c0a8d['model'],qs[_0x84f0('0x46')](_0x3dc83c[_0x84f0('0x31')][_0x84f0('0x46')]));_0x844c1b[_0x84f0('0x47')]=_0x844c1b['attributes'][_0x84f0('0x48')]?_0x844c1b[_0x84f0('0x47')]:_0x3c0a8d[_0x84f0('0x30')];if(!_0x3dc83c[_0x84f0('0x31')][_0x84f0('0x49')](_0x84f0('0x4a'))){_0x844c1b[_0x84f0('0x4b')]=qs['limit'](_0x3dc83c[_0x84f0('0x31')]['limit']);_0x844c1b[_0x84f0('0x1d')]=qs[_0x84f0('0x1d')](_0x3dc83c[_0x84f0('0x31')][_0x84f0('0x1d')]);}_0x844c1b[_0x84f0('0x4c')]=qs[_0x84f0('0x4d')](_0x3dc83c[_0x84f0('0x31')][_0x84f0('0x4d')]);_0x844c1b[_0x84f0('0x4e')]=qs['filters'](_[_0x84f0('0x4f')](_0x3dc83c[_0x84f0('0x31')],_0x3c0a8d[_0x84f0('0x33')]),_0x80a1be);if(_0x3dc83c[_0x84f0('0x31')]['filter']){_0x844c1b[_0x84f0('0x4e')]=_['merge'](_0x844c1b[_0x84f0('0x4e')],{'$or':_[_0x84f0('0x2a')](_0x80a1be,function(_0x52feb6){if(_0x52feb6[_0x84f0('0x2e')]!==_0x84f0('0x50')){var _0x441052={};_0x441052[_0x52feb6['name']]={'$like':'%'+_0x3dc83c[_0x84f0('0x31')][_0x84f0('0x51')]+'%'};return _0x441052;}})});}_0x844c1b=_['merge']({},_0x844c1b,_0x3dc83c[_0x84f0('0x52')]);var _0x3445be={'where':_0x844c1b['where']};return db[_0x84f0('0x2b')][_0x84f0('0x1f')](_0x3445be)['then'](function(_0xa2b706){_0x133981['count']=_0xa2b706;if(_0x3dc83c['query'][_0x84f0('0x53')]){_0x844c1b['include']=[{'all':!![]}];}return db[_0x84f0('0x2b')][_0x84f0('0x54')](_0x844c1b);})[_0x84f0('0x25')](function(_0x363c38){_0x133981[_0x84f0('0x55')]=_0x363c38;return _0x133981;})[_0x84f0('0x25')](respondWithFilteredResult(_0x3e4f40,_0x844c1b))[_0x84f0('0x56')](handleError(_0x3e4f40,null));};exports[_0x84f0('0x57')]=function(_0x59cf30,_0x321088){var _0x1bfcc0={'raw':!![],'where':{'id':_0x59cf30[_0x84f0('0x58')]['id']}},_0x383e12={};_0x383e12[_0x84f0('0x30')]=_[_0x84f0('0x32')](db[_0x84f0('0x2b')][_0x84f0('0x2c')]);_0x383e12[_0x84f0('0x31')]=_['keys'](_0x59cf30[_0x84f0('0x31')]);_0x383e12['filters']=_['intersection'](_0x383e12['model'],_0x383e12['query']);_0x1bfcc0[_0x84f0('0x47')]=_[_0x84f0('0x34')](_0x383e12[_0x84f0('0x30')],qs['fields'](_0x59cf30['query'][_0x84f0('0x46')]));_0x1bfcc0[_0x84f0('0x47')]=_0x1bfcc0['attributes']['length']?_0x1bfcc0[_0x84f0('0x47')]:_0x383e12[_0x84f0('0x30')];if(_0x59cf30[_0x84f0('0x31')]['includeAll']){_0x1bfcc0[_0x84f0('0x59')]=[{'all':!![]}];}_0x1bfcc0=_[_0x84f0('0x5a')]({},_0x1bfcc0,_0x59cf30[_0x84f0('0x52')]);return db[_0x84f0('0x2b')][_0x84f0('0x5b')](_0x1bfcc0)[_0x84f0('0x25')](handleEntityNotFound(_0x321088,null))[_0x84f0('0x25')](respondWithResult(_0x321088,null))[_0x84f0('0x56')](handleError(_0x321088,null));};exports[_0x84f0('0x5c')]=function(_0x270e1c,_0x298b48){return db[_0x84f0('0x2b')][_0x84f0('0x5c')](_0x270e1c[_0x84f0('0x5d')],{})[_0x84f0('0x25')](respondWithResult(_0x298b48,0xc9))['catch'](handleError(_0x298b48,null));};exports[_0x84f0('0x24')]=function(_0x4bc889,_0x37af5c){if(_0x4bc889[_0x84f0('0x5d')]['id']){delete _0x4bc889[_0x84f0('0x5d')]['id'];}return db[_0x84f0('0x2b')][_0x84f0('0x5b')]({'where':{'id':_0x4bc889['params']['id']}})[_0x84f0('0x25')](handleEntityNotFound(_0x37af5c,null))[_0x84f0('0x25')](saveUpdates(_0x4bc889[_0x84f0('0x5d')],null))['then'](respondWithResult(_0x37af5c,null))[_0x84f0('0x56')](handleError(_0x37af5c,null));};exports[_0x84f0('0x5e')]=function(_0x59e868,_0xb7a061){return db[_0x84f0('0x2b')][_0x84f0('0x5e')]()[_0x84f0('0x25')](respondWithResult(_0xb7a061,null))[_0x84f0('0x56')](handleError(_0xb7a061,null));};exports['destroy']=function(_0x484956,_0x23af60){var _0x578686;return db[_0x84f0('0x2b')][_0x84f0('0x5b')]({'where':{'id':_0x484956[_0x84f0('0x58')]['id']}})[_0x84f0('0x25')](handleEntityNotFound(_0x23af60,null))[_0x84f0('0x25')](function(_0x415d0a){if(_0x415d0a){return _0x415d0a[_0x84f0('0x5f')]()[_0x84f0('0x25')](function(_0x380bfd){return _0x380bfd;});}})[_0x84f0('0x25')](function(_0x3d41ff){_0x578686=_0x3d41ff;if(_0x3d41ff){if(_0x3d41ff['VoiceQueueId']||_0x3d41ff['CampaignId']){return db[_0x3d41ff[_0x84f0('0x60')]?_0x84f0('0x61'):_0x84f0('0x62')]['find']({'where':{'id':_0x3d41ff['VoiceQueueId']?_0x3d41ff[_0x84f0('0x60')]:_0x3d41ff[_0x84f0('0x63')]},'attributes':['id',_0x84f0('0x27')],'raw':!![]});}}})[_0x84f0('0x25')](function(_0x349f6a){var _0x2df9cd={};if(_0x349f6a){_['merge'](_0x2df9cd,_[_0x84f0('0x64')](_0x578686['dataValues'],[_0x84f0('0x65'),_0x84f0('0x66'),'id']));_0x2df9cd[_0x84f0('0x67')]=0x15;_0x2df9cd[_0x84f0('0x68')]=_0x84f0('0x69');_0x2df9cd['campaign']=_0x349f6a[_0x84f0('0x27')];_0x2df9cd[_0x84f0('0x6a')]=_0x484956[_0x84f0('0x6b')]['name'];_0x2df9cd[_0x84f0('0x6c')]=_0x484956[_0x84f0('0x6b')]['id'];_0x2df9cd[_0x84f0('0x69')]=!![];_0x2df9cd['deletedat']=moment()[_0x84f0('0x6d')](_0x84f0('0x6e'));_0x2df9cd[_0x84f0('0x6f')]=_0x578686[_0x84f0('0x70')];_0x2df9cd[_0x84f0('0x71')]=_0x578686[_0x84f0('0x60')]?_0x84f0('0x72'):_0x84f0('0x73');return db['CmContact'][_0x84f0('0x5b')]({'where':{'id':_0x2df9cd['ContactId']},'attributes':[_0x84f0('0x74'),_0x84f0('0x75')]})['then'](function(_0x3b570a){if(!_[_0x84f0('0x76')](_0x23af60)&&!_[_0x84f0('0x76')](_0x3b570a[_0x84f0('0x74')])){_0x2df9cd['calleridname']=_0x3b570a['firstName'];if(!_[_0x84f0('0x76')](_0x3b570a[_0x84f0('0x75')])){_0x2df9cd['calleridname']+='\x20'+_0x3b570a[_0x84f0('0x75')];}}})[_0x84f0('0x77')](function(){return db[_0x84f0('0x78')][_0x84f0('0x5c')](_0x2df9cd);});}})[_0x84f0('0x25')](function(){return _0x23af60[_0x84f0('0x20')](0xcc)[_0x84f0('0x1b')]();})['catch'](handleError(_0x23af60,null));};exports['getPreview']=function(_0x41bdad,_0x312ebd,_0x55bc96){var _0x40e3b2=[];return db[_0x84f0('0x79')]['describe']()[_0x84f0('0x25')](function(_0x13bd7c){_0x40e3b2=_[_0x84f0('0x32')](_0x13bd7c);return _0x41bdad[_0x84f0('0x6b')]['getVoiceQueues']({'where':{'type':_0x84f0('0x7a'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt',_0x84f0('0x7b')],'raw':!![]});})[_0x84f0('0x25')](function(_0x541805){if(_0x541805&&_0x541805[_0x84f0('0x48')]){return db[_0x84f0('0x7c')][_0x84f0('0x7d')](function(_0x1b1e36){var _0xe9f127={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x84f0('0x6d')](_0x84f0('0x6e'))},'VoiceQueueId':{'$in':_[_0x84f0('0x2a')](_0x541805,'id')},'$or':[{'UserId':null},{'UserId':_0x41bdad[_0x84f0('0x6b')]['id']}]};var _0x4a7d09={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x541805)['filter']([_0x84f0('0x7b'),0x0])['map']('id')[_0x84f0('0x7e')]()},'$or':[{'UserId':null},{'UserId':_0x41bdad[_0x84f0('0x6b')]['id']}]};var _0x3ba963={'$or':[_0xe9f127,_0x4a7d09]};var _0x509075=[];if(_0x41bdad['body'][_0x84f0('0x7f')]&&_0x41bdad[_0x84f0('0x5d')][_0x84f0('0x7f')]==='prev'){if(!_[_0x84f0('0x80')](_0x41bdad[_0x84f0('0x5d')][_0x84f0('0x81')])){_0x3ba963['id']={'$in':_0x41bdad[_0x84f0('0x5d')]['hopperIds']};}_0x509075=[['priority',_0x84f0('0x82')],[_0x84f0('0x83'),_0x541805[0x0][_0x84f0('0x84')]==='ASC'?'DESC':_0x84f0('0x82')],db[_0x84f0('0x7c')]['literal'](_0x84f0('0x85')),['id','DESC']];}else{if(!_[_0x84f0('0x80')](_0x41bdad[_0x84f0('0x5d')][_0x84f0('0x81')])){_0x3ba963['id']={'$notIn':_0x41bdad['body'][_0x84f0('0x81')]};}_0x509075=[[_0x84f0('0x86'),_0x84f0('0x87')],[_0x84f0('0x83'),_0x541805[0x0][_0x84f0('0x84')]],db['sequelize'][_0x84f0('0x88')](_0x84f0('0x89')),['id',_0x84f0('0x82')]];}return db[_0x84f0('0x2b')]['findOne']({'attributes':['id','scheduledat',_0x84f0('0x8a')],'where':_0x3ba963,'order':_0x509075,'transaction':_0x1b1e36,'lock':_0x1b1e36[_0x84f0('0x8b')][_0x84f0('0x8c')],'include':[{'model':db[_0x84f0('0x79')],'as':_0x84f0('0x8d'),'attributes':_0x40e3b2,'include':[{'model':db[_0x84f0('0x8e')],'as':_0x84f0('0x8f'),'attributes':['id',_0x84f0('0x27')]}]},{'model':db['CmList'],'as':_0x84f0('0x90'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0x84f0('0x91'),'attributes':['id',_0x84f0('0x27'),_0x84f0('0x92')]}]})[_0x84f0('0x25')](function(_0x5cf41d){if(_0x5cf41d){return _0x5cf41d['update']({'UserId':_0x41bdad[_0x84f0('0x6b')]['id']},{'transaction':_0x1b1e36});}});});}})[_0x84f0('0x25')](handleEntityNotFound(_0x312ebd,null))[_0x84f0('0x25')](respondWithResult(_0x312ebd,null))[_0x84f0('0x56')](handleError(_0x312ebd,null));};exports[_0x84f0('0x93')]=function(_0x1b2e37,_0x595740,_0x2d9b98){var _0x533906=[];return db[_0x84f0('0x79')]['describe']()['then'](function(_0x35c9ad){_0x533906=_[_0x84f0('0x32')](_0x35c9ad);return _0x1b2e37[_0x84f0('0x6b')][_0x84f0('0x94')]({'where':{'type':_0x84f0('0x7a'),'dialActive':!![],'dialMethod':_0x84f0('0x95')},'attributes':['id',_0x84f0('0x84'),_0x84f0('0x7b')],'raw':!![]});})[_0x84f0('0x25')](function(_0x467a9b){if(_0x467a9b&&_0x467a9b[_0x84f0('0x48')]){return db[_0x84f0('0x7c')][_0x84f0('0x7d')](function(_0x23556c){var _0x3b2a9e={'active':![],'recallme':!![],'id':_0x1b2e37[_0x84f0('0x5d')][_0x84f0('0x96')]};return db[_0x84f0('0x2b')][_0x84f0('0x97')]({'attributes':['id',_0x84f0('0x98'),_0x84f0('0x8a')],'where':_0x3b2a9e,'transaction':_0x23556c,'lock':_0x23556c[_0x84f0('0x8b')][_0x84f0('0x8c')],'include':[{'model':db[_0x84f0('0x79')],'as':_0x84f0('0x8d'),'attributes':_0x533906,'include':[{'model':db[_0x84f0('0x8e')],'as':_0x84f0('0x8f'),'attributes':['id',_0x84f0('0x27')]}]},{'model':db['CmList'],'as':_0x84f0('0x90'),'attributes':['id',_0x84f0('0x27')]},{'model':db[_0x84f0('0x61')],'as':'Queue','attributes':['id',_0x84f0('0x27'),_0x84f0('0x92')]}]})[_0x84f0('0x25')](function(_0x9b28b6){if(_0x9b28b6){return _0x9b28b6[_0x84f0('0x24')]({'UserId':_0x1b2e37[_0x84f0('0x6b')]['id']},{'transaction':_0x23556c});}});});}})[_0x84f0('0x25')](handleEntityNotFound(_0x595740,null))[_0x84f0('0x25')](respondWithResult(_0x595740,null))[_0x84f0('0x56')](handleError(_0x595740,null));};exports[_0x84f0('0x99')]=function(_0x3159ed,_0x519b1d,_0x3e0d1f){return _0x3159ed[_0x84f0('0x6b')][_0x84f0('0x94')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x84f0('0x95')},'attributes':['id'],'raw':!![]})['then'](function(_0xb00b4e){if(_0xb00b4e&&_0xb00b4e[_0x84f0('0x48')]){return db['CmHopper'][_0x84f0('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x84f0('0x6e'))},'VoiceQueueId':{'$in':_[_0x84f0('0x2a')](_0xb00b4e,'id')},'$or':[{'UserId':null},{'UserId':_0x3159ed[_0x84f0('0x6b')]['id']}]}});}return 0x0;})[_0x84f0('0x25')](function(_0x368a31){if(!_[_0x84f0('0x76')](_0x368a31)&&_['isNumber'](_0x368a31)){return _0x519b1d[_0x84f0('0x20')](0xc8)[_0x84f0('0x1c')]({'contacts':_0x368a31});}else{logger[_0x84f0('0x26')](_0x84f0('0x9a'),_0x84f0('0x99'),0x194,_0x84f0('0x9b'));_0x519b1d[_0x84f0('0x1a')](0x194);}})[_0x84f0('0x56')](handleError(_0x519b1d,null));};exports[_0x84f0('0x9c')]=function(_0x1a9293,_0x109d23,_0x5a0256){var _0x591a99=shared[_0x84f0('0x9d')];var _0x5ff8a9=[];_[_0x84f0('0x2a')](_0x591a99,function(_0x16e8dc){_0x5ff8a9[_0x84f0('0x9e')]({'id':_0x16e8dc[_0x84f0('0x27')],'name':_0x16e8dc[_0x84f0('0x27')],'utcOffset':_0x16e8dc[_0x84f0('0x9f')]});});return _0x109d23['status'](0xc8)[_0x84f0('0x1c')]({'tz':_0x5ff8a9});};exports['getTimezone']=function(_0xb57824,_0x46b7a1,_0x226849){var _0x4cf705=shared[_0x84f0('0x9d')];var _0x417554={};if(!_['isNil'](_0x4cf705[_0xb57824[_0x84f0('0x5d')]['id']]))_0x417554=_0x4cf705[_0xb57824['body']['id']];return _0x46b7a1[_0x84f0('0x20')](0xc8)['json'](_0x417554);}; \ No newline at end of file +var _0xb48d=['$between','$notBetween','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','CmHopper','then','includeAll','include','findAll','rows','catch','show','options','find','create','body','describe','params','CampaignId','VoiceQueueId','Campaign','omit','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','CmContact','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','value','direction','prev','hopperIds','scheduledAt','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','List','VoiceQueue','Queue','getPreviewRecall','recallme','CmList','dialActive','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','timezones','push','utcOffset','getTimezone','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$eq','$not'];(function(_0x435f22,_0x2e49c0){var _0x2d46d9=function(_0xfdbe05){while(--_0xfdbe05){_0x435f22['push'](_0x435f22['shift']());}};_0x2d46d9(++_0x2e49c0);}(_0xb48d,0x194));var _0xdb48=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xb48d[_0xbd08b4];return _0x314f1e;};'use strict';var emlformat=require(_0xdb48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb48('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb48('0x2'));var moment=require(_0xdb48('0x3'));var BPromise=require(_0xdb48('0x4'));var Mustache=require(_0xdb48('0x5'));var util=require('util');var path=require(_0xdb48('0x6'));var sox=require('sox');var csv=require(_0xdb48('0x7'));var ejs=require(_0xdb48('0x8'));var fs=require('fs');var fs_extra=require(_0xdb48('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb48('0xa'));var jsforce=require(_0xdb48('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdb48('0x7'));var querystring=require(_0xdb48('0xc'));var Papa=require('papaparse');var Redis=require(_0xdb48('0xd'));var authService=require(_0xdb48('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb48('0xf'));var logger=require(_0xdb48('0x10'))(_0xdb48('0x11'));var utils=require('../../config/utils');var config=require(_0xdb48('0x12'));var shared=require(_0xdb48('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb48('0x13'))['db'];function respondWithStatusCode(_0x3cbfee,_0x41e006){_0x41e006=_0x41e006||0xcc;return function(_0x354eec){if(_0x354eec){return _0x3cbfee[_0xdb48('0x14')](_0x41e006);}return _0x3cbfee[_0xdb48('0x15')](_0x41e006)['end']();};}function respondWithResult(_0x43df86,_0x142eaf){_0x142eaf=_0x142eaf||0xc8;return function(_0x33c327){if(_0x33c327){return _0x43df86['status'](_0x142eaf)[_0xdb48('0x16')](_0x33c327);}};}function respondWithFilteredResult(_0x518dac,_0x453d6b){return function(_0x3180d7){if(_0x3180d7){var _0x364e57=typeof _0x453d6b[_0xdb48('0x17')]===_0xdb48('0x18')&&typeof _0x453d6b['limit']==='undefined';var _0x3c646f=_0x3180d7[_0xdb48('0x19')];var _0x4a2d3f=_0x364e57?0x0:_0x453d6b[_0xdb48('0x17')];var _0x429d5d=_0x364e57?_0x3180d7['count']:_0x453d6b['offset']+_0x453d6b[_0xdb48('0x1a')];var _0xf6ce43;if(_0x429d5d>=_0x3c646f){_0x429d5d=_0x3c646f;_0xf6ce43=0xc8;}else{_0xf6ce43=0xce;}_0x518dac[_0xdb48('0x15')](_0xf6ce43);return _0x518dac['set'](_0xdb48('0x1b'),_0x4a2d3f+'-'+_0x429d5d+'/'+_0x3c646f)[_0xdb48('0x16')](_0x3180d7);}return null;};}function patchUpdates(_0x58604e){return function(_0x3e0f13){try{jsonpatch[_0xdb48('0x1c')](_0x3e0f13,_0x58604e,!![]);}catch(_0x3e980e){return BPromise[_0xdb48('0x1d')](_0x3e980e);}return _0x3e0f13[_0xdb48('0x1e')]();};}function saveUpdates(_0x5e63b3,_0x2746c4){return function(_0x465d95){if(_0x465d95){return _0x465d95[_0xdb48('0x1f')](_0x5e63b3)['then'](function(_0x5aedc1){return _0x5aedc1;});}return null;};}function removeEntity(_0x52c046,_0x3ad23a){return function(_0x3cdbbd){if(_0x3cdbbd){return _0x3cdbbd[_0xdb48('0x20')]()['then'](function(){_0x52c046[_0xdb48('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b3344,_0x3a5bdd){return function(_0x161e7f){if(!_0x161e7f){_0x3b3344['sendStatus'](0x194);}return _0x161e7f;};}function handleError(_0x483940,_0x139139){_0x139139=_0x139139||0x1f4;return function(_0x3b4917){logger[_0xdb48('0x21')](_0x3b4917['stack']);if(_0x3b4917[_0xdb48('0x22')]){delete _0x3b4917[_0xdb48('0x22')];}_0x483940['status'](_0x139139)['send'](_0x3b4917);};}exports[_0xdb48('0x23')]=function(_0x2cdfa4,_0x2adb1e){var _0x2f55c6={},_0x549b18={},_0x58c3d1={'count':0x0,'rows':[]};var _0x2b3bb6=_[_0xdb48('0x24')](db['CmHopper'][_0xdb48('0x25')],function(_0xb0afbd){return{'name':_0xb0afbd[_0xdb48('0x26')],'type':_0xb0afbd[_0xdb48('0x27')][_0xdb48('0x28')]};});_0x549b18[_0xdb48('0x29')]=_['map'](_0x2b3bb6,_0xdb48('0x22'));_0x549b18[_0xdb48('0x2a')]=_[_0xdb48('0x2b')](_0x2cdfa4[_0xdb48('0x2a')]);_0x549b18[_0xdb48('0x2c')]=_[_0xdb48('0x2d')](_0x549b18['model'],_0x549b18['query']);_0x549b18[_0xdb48('0x2c')]=_[_0xdb48('0x2e')](_0x549b18[_0xdb48('0x2c')],[_0xdb48('0x2f'),_0xdb48('0x30'),_0xdb48('0x31'),_0xdb48('0x32'),_0xdb48('0x33'),_0xdb48('0x34'),'$ne',_0xdb48('0x35'),_0xdb48('0x36'),_0xdb48('0x37'),_0xdb48('0x38'),'$in','$notIn',_0xdb48('0x39'),_0xdb48('0x3a'),_0xdb48('0x3b'),_0xdb48('0x3c'),_0xdb48('0x39'),_0xdb48('0x3d'),_0xdb48('0x3e'),_0xdb48('0x3f'),'$any']);_0x2f55c6['attributes']=_[_0xdb48('0x2d')](_0x549b18['model'],qs[_0xdb48('0x40')](_0x2cdfa4[_0xdb48('0x2a')][_0xdb48('0x40')]));_0x2f55c6[_0xdb48('0x41')]=_0x2f55c6[_0xdb48('0x41')][_0xdb48('0x42')]?_0x2f55c6[_0xdb48('0x41')]:_0x549b18[_0xdb48('0x29')];if(!_0x2cdfa4['query'][_0xdb48('0x43')](_0xdb48('0x44'))){_0x2f55c6['limit']=qs[_0xdb48('0x1a')](_0x2cdfa4[_0xdb48('0x2a')][_0xdb48('0x1a')]);_0x2f55c6[_0xdb48('0x17')]=qs['offset'](_0x2cdfa4['query'][_0xdb48('0x17')]);}_0x2f55c6[_0xdb48('0x45')]=qs['sort'](_0x2cdfa4['query'][_0xdb48('0x46')]);_0x2f55c6[_0xdb48('0x47')]=qs[_0xdb48('0x2c')](_[_0xdb48('0x48')](_0x2cdfa4['query'],_0x549b18['filters']),_0x2b3bb6);if(_0x2cdfa4[_0xdb48('0x2a')][_0xdb48('0x49')]){_0x2f55c6[_0xdb48('0x47')]=_[_0xdb48('0x4a')](_0x2f55c6[_0xdb48('0x47')],{'$or':_[_0xdb48('0x24')](_0x2b3bb6,function(_0x3ba7d3){if(_0x3ba7d3[_0xdb48('0x27')]!==_0xdb48('0x4b')){var _0x4838b8={};_0x4838b8[_0x3ba7d3[_0xdb48('0x22')]]={'$like':'%'+_0x2cdfa4[_0xdb48('0x2a')]['filter']+'%'};return _0x4838b8;}})});}_0x2f55c6=_[_0xdb48('0x4a')]({},_0x2f55c6,_0x2cdfa4['options']);var _0x3dbd88={'where':_0x2f55c6['where']};return db[_0xdb48('0x4c')][_0xdb48('0x19')](_0x3dbd88)[_0xdb48('0x4d')](function(_0x22040a){_0x58c3d1[_0xdb48('0x19')]=_0x22040a;if(_0x2cdfa4[_0xdb48('0x2a')][_0xdb48('0x4e')]){_0x2f55c6[_0xdb48('0x4f')]=[{'all':!![]}];}return db[_0xdb48('0x4c')][_0xdb48('0x50')](_0x2f55c6);})[_0xdb48('0x4d')](function(_0x3145ca){_0x58c3d1[_0xdb48('0x51')]=_0x3145ca;return _0x58c3d1;})[_0xdb48('0x4d')](respondWithFilteredResult(_0x2adb1e,_0x2f55c6))[_0xdb48('0x52')](handleError(_0x2adb1e,null));};exports[_0xdb48('0x53')]=function(_0x3990c1,_0x31bbb2){var _0x7ee186={'raw':!![],'where':{'id':_0x3990c1['params']['id']}},_0x5c05bd={};_0x5c05bd[_0xdb48('0x29')]=_[_0xdb48('0x2b')](db[_0xdb48('0x4c')]['rawAttributes']);_0x5c05bd[_0xdb48('0x2a')]=_[_0xdb48('0x2b')](_0x3990c1[_0xdb48('0x2a')]);_0x5c05bd[_0xdb48('0x2c')]=_[_0xdb48('0x2d')](_0x5c05bd['model'],_0x5c05bd[_0xdb48('0x2a')]);_0x7ee186['attributes']=_[_0xdb48('0x2d')](_0x5c05bd[_0xdb48('0x29')],qs[_0xdb48('0x40')](_0x3990c1[_0xdb48('0x2a')]['fields']));_0x7ee186[_0xdb48('0x41')]=_0x7ee186['attributes'][_0xdb48('0x42')]?_0x7ee186[_0xdb48('0x41')]:_0x5c05bd[_0xdb48('0x29')];if(_0x3990c1[_0xdb48('0x2a')][_0xdb48('0x4e')]){_0x7ee186[_0xdb48('0x4f')]=[{'all':!![]}];}_0x7ee186=_[_0xdb48('0x4a')]({},_0x7ee186,_0x3990c1[_0xdb48('0x54')]);return db[_0xdb48('0x4c')][_0xdb48('0x55')](_0x7ee186)['then'](handleEntityNotFound(_0x31bbb2,null))['then'](respondWithResult(_0x31bbb2,null))[_0xdb48('0x52')](handleError(_0x31bbb2,null));};exports[_0xdb48('0x56')]=function(_0x46b83b,_0xb15119){return db['CmHopper']['create'](_0x46b83b['body'],{})[_0xdb48('0x4d')](respondWithResult(_0xb15119,0xc9))[_0xdb48('0x52')](handleError(_0xb15119,null));};exports[_0xdb48('0x1f')]=function(_0x57a4e5,_0x3b6bb0){if(_0x57a4e5['body']['id']){delete _0x57a4e5[_0xdb48('0x57')]['id'];}return db[_0xdb48('0x4c')][_0xdb48('0x55')]({'where':{'id':_0x57a4e5['params']['id']}})['then'](handleEntityNotFound(_0x3b6bb0,null))[_0xdb48('0x4d')](saveUpdates(_0x57a4e5[_0xdb48('0x57')],null))[_0xdb48('0x4d')](respondWithResult(_0x3b6bb0,null))[_0xdb48('0x52')](handleError(_0x3b6bb0,null));};exports['describe']=function(_0x461509,_0x620555){return db[_0xdb48('0x4c')][_0xdb48('0x58')]()[_0xdb48('0x4d')](respondWithResult(_0x620555,null))[_0xdb48('0x52')](handleError(_0x620555,null));};exports[_0xdb48('0x20')]=function(_0x5d95d7,_0x5dee38){var _0x36145b;return db[_0xdb48('0x4c')][_0xdb48('0x55')]({'where':{'id':_0x5d95d7[_0xdb48('0x59')]['id']}})['then'](handleEntityNotFound(_0x5dee38,null))[_0xdb48('0x4d')](function(_0x1d622d){if(_0x1d622d){return _0x1d622d['destroy']()['then'](function(_0x2a1ca6){return _0x2a1ca6;});}})[_0xdb48('0x4d')](function(_0x49907f){_0x36145b=_0x49907f;if(_0x49907f){if(_0x49907f['VoiceQueueId']||_0x49907f[_0xdb48('0x5a')]){return db[_0x49907f[_0xdb48('0x5b')]?'VoiceQueue':_0xdb48('0x5c')][_0xdb48('0x55')]({'where':{'id':_0x49907f[_0xdb48('0x5b')]?_0x49907f[_0xdb48('0x5b')]:_0x49907f[_0xdb48('0x5a')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x5c329c){var _0x8c092a={};if(_0x5c329c){_[_0xdb48('0x4a')](_0x8c092a,_[_0xdb48('0x5d')](_0x36145b['dataValues'],[_0xdb48('0x5e'),_0xdb48('0x5f'),'id']));_0x8c092a[_0xdb48('0x60')]=0x15;_0x8c092a['statedesc']=_0xdb48('0x61');_0x8c092a[_0xdb48('0x62')]=_0x5c329c[_0xdb48('0x22')];_0x8c092a[_0xdb48('0x63')]=_0x5d95d7[_0xdb48('0x64')][_0xdb48('0x22')];_0x8c092a[_0xdb48('0x65')]=_0x5d95d7['user']['id'];_0x8c092a['deleted']=!![];_0x8c092a['deletedat']=moment()[_0xdb48('0x66')](_0xdb48('0x67'));_0x8c092a[_0xdb48('0x68')]=_0x36145b['phone'];_0x8c092a[_0xdb48('0x69')]=_0x36145b['VoiceQueueId']?_0xdb48('0x6a'):'ivr';return db[_0xdb48('0x6b')][_0xdb48('0x55')]({'where':{'id':_0x8c092a['ContactId']},'attributes':['firstName',_0xdb48('0x6c')]})[_0xdb48('0x4d')](function(_0x2dc34c){if(!_[_0xdb48('0x6d')](_0x5dee38)&&!_[_0xdb48('0x6d')](_0x2dc34c[_0xdb48('0x6e')])){_0x8c092a[_0xdb48('0x6f')]=_0x2dc34c[_0xdb48('0x6e')];if(!_['isNil'](_0x2dc34c[_0xdb48('0x6c')])){_0x8c092a[_0xdb48('0x6f')]+='\x20'+_0x2dc34c[_0xdb48('0x6c')];}}})[_0xdb48('0x70')](function(){return db[_0xdb48('0x71')][_0xdb48('0x56')](_0x8c092a);});}})[_0xdb48('0x4d')](function(){return _0x5dee38['status'](0xcc)['end']();})[_0xdb48('0x52')](handleError(_0x5dee38,null));};exports[_0xdb48('0x72')]=function(_0x177bf6,_0x3a8f36,_0x23f422){var _0x1553de=[];return db[_0xdb48('0x6b')]['describe']()[_0xdb48('0x4d')](function(_0x39075e){_0x1553de=_['keys'](_0x39075e);return _0x177bf6[_0xdb48('0x64')][_0xdb48('0x73')]({'where':{'type':_0xdb48('0x74'),'dialActive':!![],'dialMethod':_0xdb48('0x75')},'attributes':['id',_0xdb48('0x76'),_0xdb48('0x77')],'raw':!![]});})['then'](function(_0x248521){if(_0x248521&&_0x248521[_0xdb48('0x42')]){return db[_0xdb48('0x78')]['transaction'](function(_0x3847d7){var _0x1d6513={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xdb48('0x66')](_0xdb48('0x67'))},'VoiceQueueId':{'$in':_[_0xdb48('0x24')](_0x248521,'id')},'$or':[{'UserId':null},{'UserId':_0x177bf6[_0xdb48('0x64')]['id']}]};var _0x305a02={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x248521)[_0xdb48('0x49')]([_0xdb48('0x77'),0x0])[_0xdb48('0x24')]('id')[_0xdb48('0x79')]()},'$or':[{'UserId':null},{'UserId':_0x177bf6[_0xdb48('0x64')]['id']}]};var _0x3a94e0={'$or':[_0x1d6513,_0x305a02]};var _0x31b755=[];if(_0x177bf6['body'][_0xdb48('0x7a')]&&_0x177bf6['body'][_0xdb48('0x7a')]===_0xdb48('0x7b')){if(!_['isEmpty'](_0x177bf6[_0xdb48('0x57')][_0xdb48('0x7c')])){_0x3a94e0['id']={'$in':_0x177bf6[_0xdb48('0x57')][_0xdb48('0x7c')]};}_0x31b755=[['priority','ASC'],[_0xdb48('0x7d'),_0x248521[0x0]['dialOrderByScheduledAt']===_0xdb48('0x7e')?_0xdb48('0x7f'):_0xdb48('0x7e')],db[_0xdb48('0x78')]['literal'](_0xdb48('0x80')),['id',_0xdb48('0x7f')]];}else{if(!_[_0xdb48('0x81')](_0x177bf6['body'][_0xdb48('0x7c')])){_0x3a94e0['id']={'$notIn':_0x177bf6[_0xdb48('0x57')]['hopperIds']};}_0x31b755=[['priority',_0xdb48('0x7f')],[_0xdb48('0x7d'),_0x248521[0x0][_0xdb48('0x76')]],db[_0xdb48('0x78')][_0xdb48('0x82')](_0xdb48('0x83')),['id',_0xdb48('0x7e')]];}return db[_0xdb48('0x4c')][_0xdb48('0x84')]({'attributes':['id',_0xdb48('0x85'),'recallme'],'where':_0x3a94e0,'order':_0x31b755,'transaction':_0x3847d7,'lock':_0x3847d7[_0xdb48('0x86')][_0xdb48('0x87')],'include':[{'model':db[_0xdb48('0x6b')],'as':_0xdb48('0x88'),'attributes':_0x1553de,'include':[{'model':db[_0xdb48('0x89')],'as':_0xdb48('0x8a'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0xdb48('0x8b'),'attributes':['id',_0xdb48('0x22')]},{'model':db[_0xdb48('0x8c')],'as':_0xdb48('0x8d'),'attributes':['id',_0xdb48('0x22'),'dialActive']}]})[_0xdb48('0x4d')](function(_0x2f2f13){if(_0x2f2f13){return _0x2f2f13['update']({'UserId':_0x177bf6['user']['id']},{'transaction':_0x3847d7});}});});}})[_0xdb48('0x4d')](handleEntityNotFound(_0x3a8f36,null))[_0xdb48('0x4d')](respondWithResult(_0x3a8f36,null))[_0xdb48('0x52')](handleError(_0x3a8f36,null));};exports[_0xdb48('0x8e')]=function(_0x40362e,_0x4fdb61,_0x45d1e7){var _0x403aa1=[];return db[_0xdb48('0x6b')][_0xdb48('0x58')]()['then'](function(_0x24c173){_0x403aa1=_[_0xdb48('0x2b')](_0x24c173);return _0x40362e[_0xdb48('0x64')][_0xdb48('0x73')]({'where':{'type':_0xdb48('0x74'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xdb48('0x76'),_0xdb48('0x77')],'raw':!![]});})[_0xdb48('0x4d')](function(_0x2c95a2){if(_0x2c95a2&&_0x2c95a2[_0xdb48('0x42')]){return db[_0xdb48('0x78')]['transaction'](function(_0x38d209){var _0x554a90={'active':![],'recallme':!![],'id':_0x40362e[_0xdb48('0x57')]['hopperId']};return db[_0xdb48('0x4c')][_0xdb48('0x84')]({'attributes':['id','scheduledat',_0xdb48('0x8f')],'where':_0x554a90,'transaction':_0x38d209,'lock':_0x38d209[_0xdb48('0x86')][_0xdb48('0x87')],'include':[{'model':db[_0xdb48('0x6b')],'as':'Contact','attributes':_0x403aa1,'include':[{'model':db[_0xdb48('0x89')],'as':_0xdb48('0x8a'),'attributes':['id',_0xdb48('0x22')]}]},{'model':db[_0xdb48('0x90')],'as':_0xdb48('0x8b'),'attributes':['id',_0xdb48('0x22')]},{'model':db[_0xdb48('0x8c')],'as':_0xdb48('0x8d'),'attributes':['id','name',_0xdb48('0x91')]}]})[_0xdb48('0x4d')](function(_0x48be17){if(_0x48be17){return _0x48be17[_0xdb48('0x1f')]({'UserId':_0x40362e[_0xdb48('0x64')]['id']},{'transaction':_0x38d209});}});});}})['then'](handleEntityNotFound(_0x4fdb61,null))['then'](respondWithResult(_0x4fdb61,null))[_0xdb48('0x52')](handleError(_0x4fdb61,null));};exports['getOpenContacts']=function(_0xa97d2b,_0x585bc6,_0x2a4a88){return _0xa97d2b[_0xdb48('0x64')][_0xdb48('0x73')]({'where':{'type':_0xdb48('0x74'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0xc44112){if(_0xc44112&&_0xc44112['length']){return db[_0xdb48('0x4c')][_0xdb48('0x19')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xdb48('0x66')](_0xdb48('0x67'))},'VoiceQueueId':{'$in':_[_0xdb48('0x24')](_0xc44112,'id')},'$or':[{'UserId':null},{'UserId':_0xa97d2b['user']['id']}]}});}return 0x0;})['then'](function(_0x31cf35){if(!_[_0xdb48('0x6d')](_0x31cf35)&&_[_0xdb48('0x92')](_0x31cf35)){return _0x585bc6[_0xdb48('0x15')](0xc8)[_0xdb48('0x16')]({'contacts':_0x31cf35});}else{logger['error'](_0xdb48('0x93'),_0xdb48('0x94'),0x194,'entity\x20not\x20found');_0x585bc6[_0xdb48('0x14')](0x194);}})[_0xdb48('0x52')](handleError(_0x585bc6,null));};exports['getTimezones']=function(_0x2de475,_0x5ab026,_0x4c393f){var _0x3a4252=shared[_0xdb48('0x95')];var _0x18afd3=[];_['map'](_0x3a4252,function(_0x3931ca){_0x18afd3[_0xdb48('0x96')]({'id':_0x3931ca['name'],'name':_0x3931ca['name'],'utcOffset':_0x3931ca[_0xdb48('0x97')]});});return _0x5ab026[_0xdb48('0x15')](0xc8)['json']({'tz':_0x18afd3});};exports[_0xdb48('0x98')]=function(_0x4f414a,_0x68e20f,_0x1e54d5){var _0x4e3672=shared[_0xdb48('0x95')];var _0x24af05={};if(!_['isNil'](_0x4e3672[_0x4f414a[_0xdb48('0x57')]['id']]))_0x24af05=_0x4e3672[_0x4f414a[_0xdb48('0x57')]['id']];return _0x68e20f[_0xdb48('0x15')](0xc8)[_0xdb48('0x16')](_0x24af05);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index dc1334e..c55927f 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 _0xeda8=['exports','define','cm_hopper','scheduledat','phone','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0xafd73f,_0x532970){var _0x1fb0a1=function(_0xb53c05){while(--_0xb53c05){_0xafd73f['push'](_0xafd73f['shift']());}};_0x1fb0a1(++_0x532970);}(_0xeda8,0x104));var _0x8eda=function(_0x137b97,_0x34a205){_0x137b97=_0x137b97-0x0;var _0x9e3bfa=_0xeda8[_0x137b97];return _0x9e3bfa;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('CmHopper',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[{'name':_0x8eda('0xd'),'fields':[_0x8eda('0xd')]},{'name':_0x8eda('0xe'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1623=['scheduledat','phone','priority','lodash','api','moment','bluebird','request-promise','path','./cmHopper.attributes','CmHopper','cm_hopper'];(function(_0x27c805,_0x3c98dc){var _0x5c18a0=function(_0x367add){while(--_0x367add){_0x27c805['push'](_0x27c805['shift']());}};_0x5c18a0(++_0x3c98dc);}(_0x1623,0xab));var _0x3162=function(_0x233727,_0x29de06){_0x233727=_0x233727-0x0;var _0x51f6ef=_0x1623[_0x233727];return _0x51f6ef;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));module['exports']=function(_0x1b55f2,_0x428de6){return _0x1b55f2['define'](_0x3162('0x7'),attributes,{'tableName':_0x3162('0x8'),'paranoid':![],'indexes':[{'name':_0x3162('0x9'),'fields':[_0x3162('0x9')]},{'name':_0x3162('0xa'),'fields':[_0x3162('0xa')]},{'name':_0x3162('0xb'),'fields':[_0x3162('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index c02e3dd..dc33bab 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 _0x9b2b=['keys','Agent','name','voicePause','length','push','includes','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','sequelize','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','describe','UserId','GetCmHopperPreview','GetContactByPhone','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','User','CmList','List','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','twilio/lib/webhooks/webhooks','then','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','catch','GetCmHopper','findAll','options','raw','attributes','limit','map','include','model','info','ShowCmHopper','CmHopper','find','where','create','body','CreateCmHopper','update','UpdateCmHopper','DestroyCmHopper','destroy','CmContact','order','UPDATE','Contact'];(function(_0x33e9ea,_0x373bb9){var _0x19b47d=function(_0x30931e){while(--_0x30931e){_0x33e9ea['push'](_0x33e9ea['shift']());}};_0x19b47d(++_0x373bb9);}(_0x9b2b,0x13a));var _0xb9b2=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0x9b2b[_0x39780c];return _0x53c19b;};'use strict';var _=require(_0xb9b2('0x0'));var util=require('util');var moment=require(_0xb9b2('0x1'));var BPromise=require(_0xb9b2('0x2'));var rs=require(_0xb9b2('0x3'));var fs=require('fs');var Redis=require(_0xb9b2('0x4'));var db=require(_0xb9b2('0x5'))['db'];var utils=require(_0xb9b2('0x6'));var logger=require(_0xb9b2('0x7'))(_0xb9b2('0x8'));var config=require(_0xb9b2('0x9'));var jayson=require('jayson/promise');const {validateExpressRequest}=require(_0xb9b2('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1fbe2e,_0x1e244,_0xec6493){return new BPromise(function(_0x5c499,_0x36c865){return client['request'](_0x1fbe2e,_0xec6493)[_0xb9b2('0xb')](function(_0x24c1c6){logger['info'](_0xb9b2('0xc'),_0x1e244,'request\x20sent');logger[_0xb9b2('0xd')](_0xb9b2('0xe'),_0x1e244,'request\x20sent',JSON[_0xb9b2('0xf')](_0x24c1c6));if(_0x24c1c6['error']){if(_0x24c1c6['error'][_0xb9b2('0x10')]===0x1f4){logger[_0xb9b2('0x11')](_0xb9b2('0xc'),_0x1e244,_0x24c1c6[_0xb9b2('0x11')][_0xb9b2('0x12')]);return _0x36c865(_0x24c1c6['error'][_0xb9b2('0x12')]);}logger[_0xb9b2('0x11')](_0xb9b2('0xc'),_0x1e244,_0x24c1c6['error'][_0xb9b2('0x12')]);return _0x5c499(_0x24c1c6[_0xb9b2('0x11')][_0xb9b2('0x12')]);}else{logger['info'](_0xb9b2('0xc'),_0x1e244,_0xb9b2('0x13'));_0x5c499(_0x24c1c6['result'][_0xb9b2('0x12')]);}})[_0xb9b2('0x14')](function(_0x4b77d4){logger['error'](_0xb9b2('0xc'),_0x1e244,_0x4b77d4);_0x36c865(_0x4b77d4);});});}exports[_0xb9b2('0x15')]=function(_0xf1df0e){var _0x214421=this;return new Promise(function(_0x235bcc,_0x312ca6){return db['CmHopper'][_0xb9b2('0x16')]({'raw':_0xf1df0e[_0xb9b2('0x17')]?_0xf1df0e[_0xb9b2('0x17')][_0xb9b2('0x18')]===undefined?!![]:![]:!![],'where':_0xf1df0e[_0xb9b2('0x17')]?_0xf1df0e[_0xb9b2('0x17')]['where']||null:null,'attributes':_0xf1df0e[_0xb9b2('0x17')]?_0xf1df0e[_0xb9b2('0x17')][_0xb9b2('0x19')]||null:null,'limit':_0xf1df0e[_0xb9b2('0x17')]?_0xf1df0e['options'][_0xb9b2('0x1a')]||null:null,'include':_0xf1df0e['options']?_0xf1df0e[_0xb9b2('0x17')]['include']?_[_0xb9b2('0x1b')](_0xf1df0e[_0xb9b2('0x17')][_0xb9b2('0x1c')],function(_0xfad0f5){return{'model':db[_0xfad0f5[_0xb9b2('0x1d')]],'as':_0xfad0f5['as'],'attributes':_0xfad0f5[_0xb9b2('0x19')],'include':_0xfad0f5[_0xb9b2('0x1c')]?_['map'](_0xfad0f5[_0xb9b2('0x1c')],function(_0x373661){return{'model':db[_0x373661['model']],'as':_0x373661['as'],'attributes':_0x373661['attributes'],'include':_0x373661[_0xb9b2('0x1c')]?_[_0xb9b2('0x1b')](_0x373661['include'],function(_0x1f5a5c){return{'model':db[_0x1f5a5c[_0xb9b2('0x1d')]],'as':_0x1f5a5c['as'],'attributes':_0x1f5a5c[_0xb9b2('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32189d){logger[_0xb9b2('0x1e')]('GetCmHopper',_0xf1df0e);logger['debug'](_0xb9b2('0x15'),_0xf1df0e,JSON[_0xb9b2('0xf')](_0x32189d));_0x235bcc(_0x32189d);})[_0xb9b2('0x14')](function(_0x3323dc){logger[_0xb9b2('0x11')](_0xb9b2('0x15'),_0x3323dc[_0xb9b2('0x12')],_0xf1df0e);_0x312ca6(_0x214421[_0xb9b2('0x11')](0x1f4,_0x3323dc[_0xb9b2('0x12')]));});});};exports[_0xb9b2('0x1f')]=function(_0x26c0ca){var _0x204c35=this;return new Promise(function(_0x2dd04e,_0xf56936){return db[_0xb9b2('0x20')][_0xb9b2('0x21')]({'raw':_0x26c0ca[_0xb9b2('0x17')]?_0x26c0ca[_0xb9b2('0x17')][_0xb9b2('0x18')]===undefined?!![]:![]:!![],'where':_0x26c0ca['options']?_0x26c0ca['options'][_0xb9b2('0x22')]||null:null,'attributes':_0x26c0ca['options']?_0x26c0ca[_0xb9b2('0x17')][_0xb9b2('0x19')]||null:null,'include':_0x26c0ca[_0xb9b2('0x17')]?_0x26c0ca[_0xb9b2('0x17')][_0xb9b2('0x1c')]?_[_0xb9b2('0x1b')](_0x26c0ca[_0xb9b2('0x17')][_0xb9b2('0x1c')],function(_0x5b842a){return{'model':db[_0x5b842a['model']],'as':_0x5b842a['as'],'attributes':_0x5b842a[_0xb9b2('0x19')],'include':_0x5b842a[_0xb9b2('0x1c')]?_['map'](_0x5b842a[_0xb9b2('0x1c')],function(_0xc8a7fe){return{'model':db[_0xc8a7fe['model']],'as':_0xc8a7fe['as'],'attributes':_0xc8a7fe[_0xb9b2('0x19')],'include':_0xc8a7fe['include']?_[_0xb9b2('0x1b')](_0xc8a7fe['include'],function(_0x4947e){return{'model':db[_0x4947e[_0xb9b2('0x1d')]],'as':_0x4947e['as'],'attributes':_0x4947e['attributes']};}):[]};}):[]};}):[]:[]})[_0xb9b2('0xb')](function(_0x137a9c){logger[_0xb9b2('0x1e')](_0xb9b2('0x1f'),_0x26c0ca);logger['debug'](_0xb9b2('0x1f'),_0x26c0ca,JSON['stringify'](_0x137a9c));_0x2dd04e(_0x137a9c);})[_0xb9b2('0x14')](function(_0x304be1){logger[_0xb9b2('0x11')](_0xb9b2('0x1f'),_0x304be1[_0xb9b2('0x12')],_0x26c0ca);_0xf56936(_0x204c35[_0xb9b2('0x11')](0x1f4,_0x304be1[_0xb9b2('0x12')]));});});};exports['CreateCmHopper']=function(_0x18c58a){var _0xb54c7e=this;return new Promise(function(_0x132c6c,_0x33044d){return db[_0xb9b2('0x20')][_0xb9b2('0x23')](_0x18c58a[_0xb9b2('0x24')],{'raw':_0x18c58a[_0xb9b2('0x17')]?_0x18c58a[_0xb9b2('0x17')][_0xb9b2('0x18')]===undefined?!![]:![]:!![]})[_0xb9b2('0xb')](function(_0x4cedc6){logger[_0xb9b2('0x1e')](_0xb9b2('0x25'),_0x18c58a);logger[_0xb9b2('0xd')](_0xb9b2('0x25'),_0x18c58a,JSON[_0xb9b2('0xf')](_0x4cedc6));_0x132c6c(_0x4cedc6);})[_0xb9b2('0x14')](function(_0x424788){logger['error'](_0xb9b2('0x25'),_0x424788[_0xb9b2('0x12')],_0x18c58a);_0x33044d(_0xb54c7e[_0xb9b2('0x11')](0x1f4,_0x424788['message']));});});};exports['UpdateCmHopper']=function(_0x53fff5){var _0x1e408c=this;return new Promise(function(_0x4d397c,_0x524c75){return db[_0xb9b2('0x20')][_0xb9b2('0x26')](_0x53fff5[_0xb9b2('0x24')],{'raw':_0x53fff5[_0xb9b2('0x17')]?_0x53fff5[_0xb9b2('0x17')][_0xb9b2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53fff5[_0xb9b2('0x17')]?_0x53fff5[_0xb9b2('0x17')]['where']||null:null,'attributes':_0x53fff5['options']?_0x53fff5[_0xb9b2('0x17')]['attributes']||null:null,'limit':_0x53fff5['options']?_0x53fff5[_0xb9b2('0x17')][_0xb9b2('0x1a')]||null:null})['then'](function(_0x24fb0b){logger[_0xb9b2('0x1e')]('UpdateCmHopper',_0x53fff5);logger[_0xb9b2('0x1e')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xb9b2('0xf')](_0x53fff5['options'][_0xb9b2('0x22')]),_0x53fff5['body']['active']);logger[_0xb9b2('0xd')](_0xb9b2('0x27'),_0x53fff5,JSON[_0xb9b2('0xf')](_0x24fb0b));_0x4d397c(_0x24fb0b);})['catch'](function(_0x1f955c){logger[_0xb9b2('0x11')](_0xb9b2('0x27'),_0x1f955c[_0xb9b2('0x12')],_0x53fff5);_0x524c75(_0x1e408c['error'](0x1f4,_0x1f955c[_0xb9b2('0x12')]));});});};exports[_0xb9b2('0x28')]=function(_0xdf0544){var _0x3ed6b0=this;return new Promise(function(_0xa0ec06,_0x2592fd){return db[_0xb9b2('0x20')][_0xb9b2('0x29')]({'where':_0xdf0544[_0xb9b2('0x17')]?_0xdf0544[_0xb9b2('0x17')][_0xb9b2('0x22')]||null:null})['then'](function(_0x3ffae7){logger[_0xb9b2('0x1e')](_0xb9b2('0x28'),_0xdf0544);logger[_0xb9b2('0xd')](_0xb9b2('0x28'),_0xdf0544,JSON[_0xb9b2('0xf')](_0x3ffae7));_0xa0ec06(_0x3ffae7);})[_0xb9b2('0x14')](function(_0x537b8a){logger[_0xb9b2('0x11')](_0xb9b2('0x28'),_0x537b8a[_0xb9b2('0x12')],_0xdf0544);_0x2592fd(_0x3ed6b0[_0xb9b2('0x11')](0x1f4,_0x537b8a['message']));});});};exports['GetContactDialer']=function(_0x374e3b){var _0x41bf7b=this;return new Promise(function(_0x5e7206,_0x5755b3){return db[_0xb9b2('0x2a')]['describe']()[_0xb9b2('0xb')](function(_0x1b9686){return db['sequelize']['transaction'](function(_0x2fbc2d){return db[_0xb9b2('0x20')][_0xb9b2('0x16')]({'where':_0x374e3b[_0xb9b2('0x17')]?_0x374e3b[_0xb9b2('0x17')][_0xb9b2('0x22')]||null:null,'attributes':_0x374e3b['options']?_0x374e3b['options']['attributes']||null:null,'limit':_0x374e3b[_0xb9b2('0x17')]?_0x374e3b[_0xb9b2('0x17')][_0xb9b2('0x1a')]||null:null,'order':_0x374e3b[_0xb9b2('0x17')]?_0x374e3b[_0xb9b2('0x17')][_0xb9b2('0x2b')]||null:null,'transaction':_0x2fbc2d,'lock':_0x2fbc2d['LOCK'][_0xb9b2('0x2c')],'include':[{'model':db[_0xb9b2('0x2a')],'as':_0xb9b2('0x2d'),'attributes':_[_0xb9b2('0x2e')](_0x1b9686)},{'model':db['User'],'as':_0xb9b2('0x2f'),'attributes':['id',_0xb9b2('0x30'),_0xb9b2('0x31')]}]})[_0xb9b2('0xb')](function(_0x49ec57){var _0x47d648=[];var _0x20382b=[];for(var _0x3c06a0=0x0;_0x3c06a0<_0x49ec57[_0xb9b2('0x32')];_0x3c06a0+=0x1){var _0x17d74b=_0x49ec57[_0x3c06a0]['UserId'];if(_0x17d74b===null){_0x47d648[_0xb9b2('0x33')](_0x49ec57[_0x3c06a0][_0xb9b2('0x26')](_0x374e3b[_0xb9b2('0x24')],{'transaction':_0x2fbc2d}));}else if(!_0x20382b[_0xb9b2('0x34')](_0x17d74b)){_0x20382b['push'](_0x17d74b);_0x47d648[_0xb9b2('0x33')](_0x49ec57[_0x3c06a0][_0xb9b2('0x26')](_0x374e3b['body'],{'transaction':_0x2fbc2d}));}}return BPromise[_0xb9b2('0x35')](_0x47d648);});})[_0xb9b2('0xb')](function(_0x5204e8){logger[_0xb9b2('0x1e')](_0xb9b2('0x36'),_0x374e3b);if(_0x5204e8['length']>0x0){logger[_0xb9b2('0x1e')](_0xb9b2('0x37'),_0x5204e8[0x0][_0xb9b2('0x38')]['id'],_0x5204e8[0x0][_0xb9b2('0x38')][_0xb9b2('0x39')],_0x5204e8[0x0][_0xb9b2('0x38')][_0xb9b2('0x3a')]);}logger['debug'](_0xb9b2('0x36'),_0x374e3b,JSON[_0xb9b2('0xf')](_0x5204e8));_0x5e7206(_0x5204e8);})[_0xb9b2('0x14')](function(_0x312c87){logger[_0xb9b2('0x11')](_0xb9b2('0x36'),_0x312c87['message'],_0x374e3b);_0x5755b3(_0x41bf7b['error'](0x1f4,_0x312c87['message']));});});});};exports[_0xb9b2('0x3b')]=function(_0x86daa4){var _0xe2cee=this;return new Promise(function(_0x5a8e7,_0xb5005f){return db[_0xb9b2('0x3c')][_0xb9b2('0x3d')](function(_0x3f9bcd){return db[_0xb9b2('0x3e')][_0xb9b2('0x23')](_0x86daa4[_0xb9b2('0x24')],{'raw':_0x86daa4['options']?_0x86daa4['options'][_0xb9b2('0x18')]===undefined?!![]:![]:!![],'transaction':_0x3f9bcd})['then'](function(){logger[_0xb9b2('0x1e')](_0xb9b2('0x3f'),JSON[_0xb9b2('0xf')](_0x86daa4[_0xb9b2('0x17')]['where']),_0x86daa4[_0xb9b2('0x17')][_0xb9b2('0x22')]['active']);return db[_0xb9b2('0x20')][_0xb9b2('0x29')]({'where':_0x86daa4[_0xb9b2('0x17')]?_0x86daa4[_0xb9b2('0x17')][_0xb9b2('0x22')]||null:null,'transaction':_0x3f9bcd});});})[_0xb9b2('0xb')](function(_0x39e378){logger[_0xb9b2('0x1e')](_0xb9b2('0x3b'),_0x86daa4);logger['debug']('MoveContactManagedDialer',_0x86daa4,JSON['stringify'](_0x39e378));_0x5a8e7(_0x39e378);})[_0xb9b2('0x14')](function(_0xbfb59f){logger[_0xb9b2('0x11')]('MoveContactManagedDialer',_0xbfb59f['message'],_0x86daa4);_0xb5005f(_0xe2cee['error'](0x1f4,_0xbfb59f[_0xb9b2('0x12')]));});});};exports[_0xb9b2('0x40')]=function(_0x26ede4){var _0x36cdf2=this;return new Promise(function(_0x502a85,_0x2ca37f){return db[_0xb9b2('0x20')][_0xb9b2('0x16')]({'raw':_0x26ede4[_0xb9b2('0x17')]?_0x26ede4[_0xb9b2('0x17')][_0xb9b2('0x18')]===undefined?!![]:![]:!![],'where':_0x26ede4[_0xb9b2('0x17')]?_0x26ede4[_0xb9b2('0x17')][_0xb9b2('0x22')]||null:null,'attributes':[[db[_0xb9b2('0x3c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb9b2('0x3c')][_0xb9b2('0x41')](_0xb9b2('0x42')+util[_0xb9b2('0x43')](_0xb9b2('0x44'),moment()[_0xb9b2('0x43')](_0xb9b2('0x45')))+_0xb9b2('0x46')))),_0xb9b2('0x47')]]})[_0xb9b2('0xb')](function(_0x3e20be){logger[_0xb9b2('0x1e')](_0xb9b2('0x40'),_0x26ede4);logger[_0xb9b2('0xd')](_0xb9b2('0x40'),_0x26ede4,JSON[_0xb9b2('0xf')](_0x3e20be));_0x502a85(_0x3e20be);})[_0xb9b2('0x14')](function(_0x2f7265){logger['error'](_0xb9b2('0x40'),_0x2f7265[_0xb9b2('0x12')],_0x26ede4);_0x2ca37f(_0x36cdf2[_0xb9b2('0x11')](0x1f4,_0x2f7265[_0xb9b2('0x12')]));});});};exports[_0xb9b2('0x48')]=function(_0x259a99){var _0x59c84e=this;return new Promise(function(_0x55d765,_0x29a2cd){return db[_0xb9b2('0x2a')][_0xb9b2('0x49')]()[_0xb9b2('0xb')](function(_0x42febf){return db[_0xb9b2('0x3c')][_0xb9b2('0x3d')](function(_0x1691ad){return db[_0xb9b2('0x20')][_0xb9b2('0x16')]({'where':_0x259a99[_0xb9b2('0x17')]?_0x259a99[_0xb9b2('0x17')][_0xb9b2('0x22')]||null:null,'attributes':_0x259a99[_0xb9b2('0x17')]?_0x259a99['options'][_0xb9b2('0x19')]||null:null,'limit':0x1,'order':_0x259a99[_0xb9b2('0x17')]?_0x259a99[_0xb9b2('0x17')][_0xb9b2('0x2b')]||null:null,'group':db['CmHopper'][_0xb9b2('0x4a')],'transaction':_0x1691ad,'lock':_0x1691ad['LOCK'][_0xb9b2('0x2c')],'include':_0x259a99[_0xb9b2('0x17')]?_0x259a99[_0xb9b2('0x17')]['include']?_[_0xb9b2('0x1b')](_0x259a99['options'][_0xb9b2('0x1c')],function(_0x4afa9a){return{'model':db[_0x4afa9a[_0xb9b2('0x1d')]],'as':_0x4afa9a['as'],'attributes':_0x4afa9a[_0xb9b2('0x19')],'include':_0x4afa9a['include']?_[_0xb9b2('0x1b')](_0x4afa9a[_0xb9b2('0x1c')],function(_0x1bb5c8){return{'model':db[_0x1bb5c8[_0xb9b2('0x1d')]],'as':_0x1bb5c8['as'],'attributes':_0x1bb5c8['attributes'],'include':_0x1bb5c8['include']?_[_0xb9b2('0x1b')](_0x1bb5c8[_0xb9b2('0x1c')],function(_0x2f4f75){return{'model':db[_0x2f4f75['model']],'as':_0x2f4f75['as'],'attributes':_0x2f4f75['attributes']};}):[]};}):[]};}):[]:[]})[_0xb9b2('0xb')](function(_0x16958e){var _0x4e8265=[];for(var _0x31947d=0x0;_0x31947d<_0x16958e[_0xb9b2('0x32')];_0x31947d+=0x1){_0x4e8265['push'](_0x16958e[_0x31947d][_0xb9b2('0x26')](_0x259a99[_0xb9b2('0x24')],{'transaction':_0x1691ad}));}return BPromise[_0xb9b2('0x35')](_0x4e8265);});})['then'](function(_0x271c30){logger[_0xb9b2('0x1e')]('GetContactRecallMe',_0x259a99);logger[_0xb9b2('0xd')](_0xb9b2('0x48'),_0x259a99,JSON[_0xb9b2('0xf')](_0x271c30));_0x55d765(_0x271c30);})[_0xb9b2('0x14')](function(_0x91ab60){logger[_0xb9b2('0x11')](_0xb9b2('0x48'),_0x91ab60[_0xb9b2('0x12')],_0x259a99);_0x29a2cd(_0x59c84e[_0xb9b2('0x11')](0x1f4,_0x91ab60['message']));});});});};exports[_0xb9b2('0x4b')]=function(_0x3e7de7){var _0x3401a6=this;return new Promise(function(_0x321197,_0x2c6277){db[_0xb9b2('0x2a')]['describe']()[_0xb9b2('0xb')](function(_0x5b67a2){return db[_0xb9b2('0x20')][_0xb9b2('0x16')]({'raw':_0x3e7de7[_0xb9b2('0x17')]?_0x3e7de7[_0xb9b2('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3e7de7[_0xb9b2('0x17')]?_0x3e7de7[_0xb9b2('0x17')][_0xb9b2('0x22')]||null:null,'attributes':_0x3e7de7[_0xb9b2('0x17')]?_0x3e7de7[_0xb9b2('0x17')]['attributes']||null:null,'limit':_0x3e7de7[_0xb9b2('0x17')]?_0x3e7de7[_0xb9b2('0x17')][_0xb9b2('0x1a')]||null:null,'include':_0x3e7de7['options']?_0x3e7de7[_0xb9b2('0x17')]['include']?_[_0xb9b2('0x1b')](_0x3e7de7['options']['include'],function(_0x3cff52){return{'model':db[_0x3cff52['model']],'as':_0x3cff52['as'],'attributes':_0x3cff52['as']===_0xb9b2('0x2d')?_[_0xb9b2('0x2e')](_0x5b67a2):_0x3cff52[_0xb9b2('0x19')],'include':_0x3cff52[_0xb9b2('0x1c')]?_[_0xb9b2('0x1b')](_0x3cff52[_0xb9b2('0x1c')],function(_0x80afc4){return{'model':db[_0x80afc4[_0xb9b2('0x1d')]],'as':_0x80afc4['as'],'attributes':_0x80afc4[_0xb9b2('0x19')],'include':_0x80afc4[_0xb9b2('0x1c')]?_[_0xb9b2('0x1b')](_0x80afc4['include'],function(_0x548e18){return{'model':db[_0x548e18[_0xb9b2('0x1d')]],'as':_0x548e18['as'],'attributes':_0x548e18[_0xb9b2('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb9b2('0xb')](function(_0x521d57){logger[_0xb9b2('0x1e')](_0xb9b2('0x15'),_0x3e7de7);logger['debug'](_0xb9b2('0x15'),_0x3e7de7,JSON['stringify'](_0x521d57));_0x321197(_0x521d57);})['catch'](function(_0x5c79f2){logger['error'](_0xb9b2('0x15'),_0x5c79f2[_0xb9b2('0x12')],_0x3e7de7);_0x2c6277(_0x3401a6[_0xb9b2('0x11')](0x1f4,_0x5c79f2[_0xb9b2('0x12')]));});});});};exports[_0xb9b2('0x4c')]=function(_0x48483f){var _0x44c6f7=this;return new Promise(function(_0x27b937,_0x2d6958){return db['CmContact'][_0xb9b2('0x4d')]({'raw':!![],'where':{'phone':_0x48483f[_0xb9b2('0x17')][_0xb9b2('0x22')][_0xb9b2('0x4e')]},'attributes':['id','dialTimezone'],'order':[['id',_0xb9b2('0x4f')]]})[_0xb9b2('0xb')](function(_0x2a2fb8){logger[_0xb9b2('0x1e')]('getContactByPhone',_0x48483f);logger[_0xb9b2('0xd')]('getContactByPhone',_0x48483f,JSON[_0xb9b2('0xf')](_0x2a2fb8));_0x27b937(_0x2a2fb8);})[_0xb9b2('0x14')](function(_0x18216e){logger[_0xb9b2('0x11')](_0xb9b2('0x50'),_0x18216e[_0xb9b2('0x12')],_0x48483f);_0x2d6958(_0x44c6f7[_0xb9b2('0x11')](0x1f4,_0x18216e[_0xb9b2('0x12')]));});});};exports['ResetActiveCalls']=function(_0x421115){var _0x50624d=this;return new Promise(function(_0x58b3ca,_0x291251){return db[_0xb9b2('0x3c')][_0xb9b2('0x3d')](function(_0x598560){return db['CmHopper'][_0xb9b2('0x26')]({'active':![]},{'where':{},'transaction':_0x598560})[_0xb9b2('0xb')](function(_0x4f4409){logger[_0xb9b2('0x1e')](_0xb9b2('0x51'),_0x421115);logger[_0xb9b2('0xd')](_0xb9b2('0x51'),_0x421115,JSON[_0xb9b2('0xf')](_0x4f4409));_0x58b3ca(_0x4f4409);})[_0xb9b2('0x14')](function(_0x204039){logger[_0xb9b2('0x11')]('ResetActiveCalls',_0x204039[_0xb9b2('0x12')],_0x421115);_0x291251(_0x50624d[_0xb9b2('0x11')](0x1f4,_0x204039[_0xb9b2('0x12')]));});});});};exports[_0xb9b2('0x52')]=function(_0x2342d1){var _0x1c1882=this;var _0x53e8a3=_0x2342d1['body']['where'][_0xb9b2('0x53')];var _0xd7ff4f=_0x2342d1[_0xb9b2('0x24')][_0xb9b2('0x22')][_0xb9b2('0x54')];return new Promise(function(_0x4c4b05,_0x590d63){return db[_0xb9b2('0x20')][_0xb9b2('0x16')]({'where':{'voiceQueueId':_0x53e8a3,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0xb9b2('0x41')](_0xb9b2('0x55')+_0xd7ff4f+_0xb9b2('0x56'))}},'include':[{'model':db['CmContact'],'as':_0xb9b2('0x2d')},{'model':db[_0xb9b2('0x57')],'as':_0xb9b2('0x2f'),'attributes':['id',_0xb9b2('0x30'),_0xb9b2('0x31')]},{'model':db[_0xb9b2('0x58')],'as':_0xb9b2('0x59')}]})[_0xb9b2('0xb')](function(_0x5dca47){return db[_0xb9b2('0x3c')][_0xb9b2('0x3d')](function(_0x399170){return db[_0xb9b2('0x20')][_0xb9b2('0x26')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x53e8a3,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xb9b2('0x3c')][_0xb9b2('0x41')]('NOW()\x20+\x20INTERVAL\x20'+_0xd7ff4f+_0xb9b2('0x56'))}},'transaction':_0x399170})['then'](function(_0x25bcdf){_0x4c4b05(_0x5dca47);})[_0xb9b2('0x14')](function(_0x43de09){logger[_0xb9b2('0x11')]('CmHopperHandlePreviewRecallNotifications',_0x43de09[_0xb9b2('0x12')],_0x2342d1);_0x590d63(validateExpressRequest);});});})[_0xb9b2('0x14')](function(_0x313a97){logger[_0xb9b2('0x11')](_0xb9b2('0x52'),_0x313a97[_0xb9b2('0x12')],_0x2342d1);_0x590d63(_0x1c1882[_0xb9b2('0x11')](0x1f4,_0x313a97['message']));});});}; \ No newline at end of file +var _0xaa72=['keys','Agent','name','voicePause','length','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','GetCmHopperPreview','GetContactByPhone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','List','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','client','request','then','request\x20sent','debug','stringify','error','code','message','info','CmHopper,\x20%s,\x20%s','catch','GetCmHopper','findAll','options','raw','attributes','limit','include','map','model','CmHopper','find','where','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact'];(function(_0x3f1193,_0x3e28bd){var _0x111f6e=function(_0x1b9f7a){while(--_0x1b9f7a){_0x3f1193['push'](_0x3f1193['shift']());}};_0x111f6e(++_0x3e28bd);}(_0xaa72,0x1c3));var _0x2aa7=function(_0x263f2c,_0x1dc98d){_0x263f2c=_0x263f2c-0x0;var _0x37c897=_0xaa72[_0x263f2c];return _0x37c897;};'use strict';var _=require(_0x2aa7('0x0'));var util=require(_0x2aa7('0x1'));var moment=require(_0x2aa7('0x2'));var BPromise=require(_0x2aa7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2aa7('0x4'))['db'];var utils=require(_0x2aa7('0x5'));var logger=require(_0x2aa7('0x6'))(_0x2aa7('0x7'));var config=require(_0x2aa7('0x8'));var jayson=require(_0x2aa7('0x9'));const {validateExpressRequest}=require(_0x2aa7('0xa'));var client=jayson[_0x2aa7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8579ad,_0xb5ab36,_0x1bf5ed){return new BPromise(function(_0x33c008,_0x7468f0){return client[_0x2aa7('0xc')](_0x8579ad,_0x1bf5ed)[_0x2aa7('0xd')](function(_0x10ae93){logger['info']('CmHopper,\x20%s,\x20%s',_0xb5ab36,_0x2aa7('0xe'));logger[_0x2aa7('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xb5ab36,_0x2aa7('0xe'),JSON[_0x2aa7('0x10')](_0x10ae93));if(_0x10ae93[_0x2aa7('0x11')]){if(_0x10ae93[_0x2aa7('0x11')][_0x2aa7('0x12')]===0x1f4){logger[_0x2aa7('0x11')]('CmHopper,\x20%s,\x20%s',_0xb5ab36,_0x10ae93[_0x2aa7('0x11')][_0x2aa7('0x13')]);return _0x7468f0(_0x10ae93['error']['message']);}logger[_0x2aa7('0x11')]('CmHopper,\x20%s,\x20%s',_0xb5ab36,_0x10ae93[_0x2aa7('0x11')][_0x2aa7('0x13')]);return _0x33c008(_0x10ae93[_0x2aa7('0x11')]['message']);}else{logger[_0x2aa7('0x14')](_0x2aa7('0x15'),_0xb5ab36,_0x2aa7('0xe'));_0x33c008(_0x10ae93['result'][_0x2aa7('0x13')]);}})[_0x2aa7('0x16')](function(_0x233206){logger[_0x2aa7('0x11')]('CmHopper,\x20%s,\x20%s',_0xb5ab36,_0x233206);_0x7468f0(_0x233206);});});}exports[_0x2aa7('0x17')]=function(_0x172e85){var _0x580b54=this;return new Promise(function(_0x7a74ce,_0x4cbedc){return db['CmHopper'][_0x2aa7('0x18')]({'raw':_0x172e85[_0x2aa7('0x19')]?_0x172e85[_0x2aa7('0x19')][_0x2aa7('0x1a')]===undefined?!![]:![]:!![],'where':_0x172e85['options']?_0x172e85[_0x2aa7('0x19')]['where']||null:null,'attributes':_0x172e85[_0x2aa7('0x19')]?_0x172e85[_0x2aa7('0x19')][_0x2aa7('0x1b')]||null:null,'limit':_0x172e85[_0x2aa7('0x19')]?_0x172e85[_0x2aa7('0x19')][_0x2aa7('0x1c')]||null:null,'include':_0x172e85[_0x2aa7('0x19')]?_0x172e85['options'][_0x2aa7('0x1d')]?_[_0x2aa7('0x1e')](_0x172e85[_0x2aa7('0x19')][_0x2aa7('0x1d')],function(_0x106ec6){return{'model':db[_0x106ec6[_0x2aa7('0x1f')]],'as':_0x106ec6['as'],'attributes':_0x106ec6[_0x2aa7('0x1b')],'include':_0x106ec6[_0x2aa7('0x1d')]?_[_0x2aa7('0x1e')](_0x106ec6[_0x2aa7('0x1d')],function(_0x51b013){return{'model':db[_0x51b013[_0x2aa7('0x1f')]],'as':_0x51b013['as'],'attributes':_0x51b013[_0x2aa7('0x1b')],'include':_0x51b013[_0x2aa7('0x1d')]?_['map'](_0x51b013[_0x2aa7('0x1d')],function(_0x2836af){return{'model':db[_0x2836af[_0x2aa7('0x1f')]],'as':_0x2836af['as'],'attributes':_0x2836af[_0x2aa7('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a7658){logger[_0x2aa7('0x14')]('GetCmHopper',_0x172e85);logger['debug'](_0x2aa7('0x17'),_0x172e85,JSON[_0x2aa7('0x10')](_0x2a7658));_0x7a74ce(_0x2a7658);})['catch'](function(_0x4d3c14){logger['error'](_0x2aa7('0x17'),_0x4d3c14[_0x2aa7('0x13')],_0x172e85);_0x4cbedc(_0x580b54[_0x2aa7('0x11')](0x1f4,_0x4d3c14['message']));});});};exports['ShowCmHopper']=function(_0xfe1639){var _0x3a0a0f=this;return new Promise(function(_0x299960,_0x50ac0f){return db[_0x2aa7('0x20')][_0x2aa7('0x21')]({'raw':_0xfe1639[_0x2aa7('0x19')]?_0xfe1639['options'][_0x2aa7('0x1a')]===undefined?!![]:![]:!![],'where':_0xfe1639[_0x2aa7('0x19')]?_0xfe1639[_0x2aa7('0x19')][_0x2aa7('0x22')]||null:null,'attributes':_0xfe1639[_0x2aa7('0x19')]?_0xfe1639[_0x2aa7('0x19')][_0x2aa7('0x1b')]||null:null,'include':_0xfe1639[_0x2aa7('0x19')]?_0xfe1639[_0x2aa7('0x19')][_0x2aa7('0x1d')]?_[_0x2aa7('0x1e')](_0xfe1639[_0x2aa7('0x19')][_0x2aa7('0x1d')],function(_0x4f2bfa){return{'model':db[_0x4f2bfa[_0x2aa7('0x1f')]],'as':_0x4f2bfa['as'],'attributes':_0x4f2bfa[_0x2aa7('0x1b')],'include':_0x4f2bfa[_0x2aa7('0x1d')]?_[_0x2aa7('0x1e')](_0x4f2bfa[_0x2aa7('0x1d')],function(_0x45fc5a){return{'model':db[_0x45fc5a[_0x2aa7('0x1f')]],'as':_0x45fc5a['as'],'attributes':_0x45fc5a[_0x2aa7('0x1b')],'include':_0x45fc5a[_0x2aa7('0x1d')]?_[_0x2aa7('0x1e')](_0x45fc5a[_0x2aa7('0x1d')],function(_0x182901){return{'model':db[_0x182901[_0x2aa7('0x1f')]],'as':_0x182901['as'],'attributes':_0x182901[_0x2aa7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2aa7('0xd')](function(_0x24df3d){logger['info'](_0x2aa7('0x23'),_0xfe1639);logger[_0x2aa7('0xf')](_0x2aa7('0x23'),_0xfe1639,JSON['stringify'](_0x24df3d));_0x299960(_0x24df3d);})['catch'](function(_0x92f9bd){logger[_0x2aa7('0x11')](_0x2aa7('0x23'),_0x92f9bd['message'],_0xfe1639);_0x50ac0f(_0x3a0a0f['error'](0x1f4,_0x92f9bd[_0x2aa7('0x13')]));});});};exports[_0x2aa7('0x24')]=function(_0x15c622){var _0x3253d5=this;return new Promise(function(_0x2cc384,_0x1f57fa){return db[_0x2aa7('0x20')][_0x2aa7('0x25')](_0x15c622[_0x2aa7('0x26')],{'raw':_0x15c622[_0x2aa7('0x19')]?_0x15c622['options'][_0x2aa7('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4b97c5){logger[_0x2aa7('0x14')]('CreateCmHopper',_0x15c622);logger[_0x2aa7('0xf')](_0x2aa7('0x24'),_0x15c622,JSON['stringify'](_0x4b97c5));_0x2cc384(_0x4b97c5);})['catch'](function(_0x1e0239){logger[_0x2aa7('0x11')](_0x2aa7('0x24'),_0x1e0239['message'],_0x15c622);_0x1f57fa(_0x3253d5[_0x2aa7('0x11')](0x1f4,_0x1e0239[_0x2aa7('0x13')]));});});};exports[_0x2aa7('0x27')]=function(_0x496b03){var _0x30c7dd=this;return new Promise(function(_0x320ab3,_0x4ffbf7){return db['CmHopper'][_0x2aa7('0x28')](_0x496b03[_0x2aa7('0x26')],{'raw':_0x496b03[_0x2aa7('0x19')]?_0x496b03['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x496b03[_0x2aa7('0x19')]?_0x496b03['options'][_0x2aa7('0x22')]||null:null,'attributes':_0x496b03[_0x2aa7('0x19')]?_0x496b03[_0x2aa7('0x19')][_0x2aa7('0x1b')]||null:null,'limit':_0x496b03[_0x2aa7('0x19')]?_0x496b03[_0x2aa7('0x19')][_0x2aa7('0x1c')]||null:null})[_0x2aa7('0xd')](function(_0xce81f1){logger[_0x2aa7('0x14')](_0x2aa7('0x27'),_0x496b03);logger[_0x2aa7('0x14')](_0x2aa7('0x29'),JSON[_0x2aa7('0x10')](_0x496b03[_0x2aa7('0x19')][_0x2aa7('0x22')]),_0x496b03[_0x2aa7('0x26')][_0x2aa7('0x2a')]);logger[_0x2aa7('0xf')](_0x2aa7('0x27'),_0x496b03,JSON['stringify'](_0xce81f1));_0x320ab3(_0xce81f1);})[_0x2aa7('0x16')](function(_0x578c0d){logger[_0x2aa7('0x11')]('UpdateCmHopper',_0x578c0d['message'],_0x496b03);_0x4ffbf7(_0x30c7dd[_0x2aa7('0x11')](0x1f4,_0x578c0d[_0x2aa7('0x13')]));});});};exports[_0x2aa7('0x2b')]=function(_0x59943d){var _0x2b1e41=this;return new Promise(function(_0x360b61,_0x276eec){return db[_0x2aa7('0x20')]['destroy']({'where':_0x59943d[_0x2aa7('0x19')]?_0x59943d['options'][_0x2aa7('0x22')]||null:null})[_0x2aa7('0xd')](function(_0x543ad9){logger[_0x2aa7('0x14')](_0x2aa7('0x2b'),_0x59943d);logger[_0x2aa7('0xf')]('DestroyCmHopper',_0x59943d,JSON['stringify'](_0x543ad9));_0x360b61(_0x543ad9);})[_0x2aa7('0x16')](function(_0xcae7d3){logger['error'](_0x2aa7('0x2b'),_0xcae7d3[_0x2aa7('0x13')],_0x59943d);_0x276eec(_0x2b1e41[_0x2aa7('0x11')](0x1f4,_0xcae7d3[_0x2aa7('0x13')]));});});};exports[_0x2aa7('0x2c')]=function(_0x28d150){var _0x4fd445=this;return new Promise(function(_0x3cf110,_0x15c149){return db[_0x2aa7('0x2d')][_0x2aa7('0x2e')]()['then'](function(_0x19b829){return db[_0x2aa7('0x2f')][_0x2aa7('0x30')](function(_0x38bb57){return db['CmHopper'][_0x2aa7('0x18')]({'where':_0x28d150['options']?_0x28d150[_0x2aa7('0x19')][_0x2aa7('0x22')]||null:null,'attributes':_0x28d150[_0x2aa7('0x19')]?_0x28d150[_0x2aa7('0x19')][_0x2aa7('0x1b')]||null:null,'limit':_0x28d150['options']?_0x28d150[_0x2aa7('0x19')][_0x2aa7('0x1c')]||null:null,'order':_0x28d150[_0x2aa7('0x19')]?_0x28d150[_0x2aa7('0x19')][_0x2aa7('0x31')]||null:null,'transaction':_0x38bb57,'lock':_0x38bb57[_0x2aa7('0x32')][_0x2aa7('0x33')],'include':[{'model':db['CmContact'],'as':_0x2aa7('0x34'),'attributes':_[_0x2aa7('0x35')](_0x19b829)},{'model':db['User'],'as':_0x2aa7('0x36'),'attributes':['id',_0x2aa7('0x37'),_0x2aa7('0x38')]}]})[_0x2aa7('0xd')](function(_0x3c2882){var _0x2d08d5=[];var _0x22a2ff=[];for(var _0x2c7256=0x0;_0x2c7256<_0x3c2882[_0x2aa7('0x39')];_0x2c7256+=0x1){var _0x28cfb0=_0x3c2882[_0x2c7256]['UserId'];if(_0x28cfb0===null){_0x2d08d5[_0x2aa7('0x3a')](_0x3c2882[_0x2c7256]['update'](_0x28d150[_0x2aa7('0x26')],{'transaction':_0x38bb57}));}else if(!_0x22a2ff[_0x2aa7('0x3b')](_0x28cfb0)){_0x22a2ff[_0x2aa7('0x3a')](_0x28cfb0);_0x2d08d5[_0x2aa7('0x3a')](_0x3c2882[_0x2c7256]['update'](_0x28d150['body'],{'transaction':_0x38bb57}));}}return BPromise[_0x2aa7('0x3c')](_0x2d08d5);});})[_0x2aa7('0xd')](function(_0x2b5c7a){logger[_0x2aa7('0x14')]('GetContactDialer',_0x28d150);if(_0x2b5c7a[_0x2aa7('0x39')]>0x0){logger[_0x2aa7('0x14')](_0x2aa7('0x3d'),_0x2b5c7a[0x0][_0x2aa7('0x3e')]['id'],_0x2b5c7a[0x0][_0x2aa7('0x3e')]['ContactId'],_0x2b5c7a[0x0]['dataValues'][_0x2aa7('0x2a')]);}logger['debug'](_0x2aa7('0x2c'),_0x28d150,JSON[_0x2aa7('0x10')](_0x2b5c7a));_0x3cf110(_0x2b5c7a);})[_0x2aa7('0x16')](function(_0x2321d2){logger[_0x2aa7('0x11')](_0x2aa7('0x2c'),_0x2321d2[_0x2aa7('0x13')],_0x28d150);_0x15c149(_0x4fd445[_0x2aa7('0x11')](0x1f4,_0x2321d2[_0x2aa7('0x13')]));});});});};exports[_0x2aa7('0x3f')]=function(_0x565dba){var _0x1daf24=this;return new Promise(function(_0x28ec5f,_0x518fea){return db[_0x2aa7('0x2f')][_0x2aa7('0x30')](function(_0x5afebf){return db[_0x2aa7('0x40')][_0x2aa7('0x25')](_0x565dba[_0x2aa7('0x26')],{'raw':_0x565dba[_0x2aa7('0x19')]?_0x565dba[_0x2aa7('0x19')][_0x2aa7('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x5afebf})[_0x2aa7('0xd')](function(){logger[_0x2aa7('0x14')](_0x2aa7('0x41'),JSON[_0x2aa7('0x10')](_0x565dba[_0x2aa7('0x19')][_0x2aa7('0x22')]),_0x565dba['options'][_0x2aa7('0x22')][_0x2aa7('0x2a')]);return db[_0x2aa7('0x20')][_0x2aa7('0x42')]({'where':_0x565dba['options']?_0x565dba[_0x2aa7('0x19')][_0x2aa7('0x22')]||null:null,'transaction':_0x5afebf});});})[_0x2aa7('0xd')](function(_0x3eb5ac){logger[_0x2aa7('0x14')]('MoveContactManagedDialer',_0x565dba);logger[_0x2aa7('0xf')](_0x2aa7('0x3f'),_0x565dba,JSON[_0x2aa7('0x10')](_0x3eb5ac));_0x28ec5f(_0x3eb5ac);})[_0x2aa7('0x16')](function(_0x906dbd){logger[_0x2aa7('0x11')](_0x2aa7('0x3f'),_0x906dbd[_0x2aa7('0x13')],_0x565dba);_0x518fea(_0x1daf24[_0x2aa7('0x11')](0x1f4,_0x906dbd[_0x2aa7('0x13')]));});});};exports[_0x2aa7('0x43')]=function(_0x10399a){var _0x5310a5=this;return new Promise(function(_0x9b0176,_0x63a23b){return db[_0x2aa7('0x20')][_0x2aa7('0x18')]({'raw':_0x10399a[_0x2aa7('0x19')]?_0x10399a[_0x2aa7('0x19')][_0x2aa7('0x1a')]===undefined?!![]:![]:!![],'where':_0x10399a[_0x2aa7('0x19')]?_0x10399a['options'][_0x2aa7('0x22')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2aa7('0x2f')][_0x2aa7('0x44')](_0x2aa7('0x45')+util[_0x2aa7('0x46')](_0x2aa7('0x47'),moment()[_0x2aa7('0x46')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x2aa7('0x48')))),_0x2aa7('0x49')]]})[_0x2aa7('0xd')](function(_0xf6eab6){logger['info']('CountReScheduled',_0x10399a);logger[_0x2aa7('0xf')](_0x2aa7('0x43'),_0x10399a,JSON[_0x2aa7('0x10')](_0xf6eab6));_0x9b0176(_0xf6eab6);})[_0x2aa7('0x16')](function(_0x4c443e){logger[_0x2aa7('0x11')](_0x2aa7('0x43'),_0x4c443e['message'],_0x10399a);_0x63a23b(_0x5310a5[_0x2aa7('0x11')](0x1f4,_0x4c443e[_0x2aa7('0x13')]));});});};exports[_0x2aa7('0x4a')]=function(_0x152341){var _0x58550d=this;return new Promise(function(_0x24d1a5,_0x3e9b08){return db['CmContact'][_0x2aa7('0x2e')]()[_0x2aa7('0xd')](function(_0x210143){return db['sequelize'][_0x2aa7('0x30')](function(_0x1d5c63){return db['CmHopper'][_0x2aa7('0x18')]({'where':_0x152341[_0x2aa7('0x19')]?_0x152341[_0x2aa7('0x19')][_0x2aa7('0x22')]||null:null,'attributes':_0x152341[_0x2aa7('0x19')]?_0x152341[_0x2aa7('0x19')][_0x2aa7('0x1b')]||null:null,'limit':0x1,'order':_0x152341[_0x2aa7('0x19')]?_0x152341[_0x2aa7('0x19')][_0x2aa7('0x31')]||null:null,'group':db[_0x2aa7('0x20')][_0x2aa7('0x4b')],'transaction':_0x1d5c63,'lock':_0x1d5c63[_0x2aa7('0x32')][_0x2aa7('0x33')],'include':_0x152341[_0x2aa7('0x19')]?_0x152341['options'][_0x2aa7('0x1d')]?_[_0x2aa7('0x1e')](_0x152341['options'][_0x2aa7('0x1d')],function(_0x188245){return{'model':db[_0x188245['model']],'as':_0x188245['as'],'attributes':_0x188245[_0x2aa7('0x1b')],'include':_0x188245['include']?_[_0x2aa7('0x1e')](_0x188245['include'],function(_0xf658a8){return{'model':db[_0xf658a8['model']],'as':_0xf658a8['as'],'attributes':_0xf658a8['attributes'],'include':_0xf658a8['include']?_['map'](_0xf658a8[_0x2aa7('0x1d')],function(_0x10b887){return{'model':db[_0x10b887[_0x2aa7('0x1f')]],'as':_0x10b887['as'],'attributes':_0x10b887[_0x2aa7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2aa7('0xd')](function(_0x98b75b){var _0x5ab21b=[];for(var _0x30ece8=0x0;_0x30ece8<_0x98b75b['length'];_0x30ece8+=0x1){_0x5ab21b[_0x2aa7('0x3a')](_0x98b75b[_0x30ece8][_0x2aa7('0x28')](_0x152341[_0x2aa7('0x26')],{'transaction':_0x1d5c63}));}return BPromise[_0x2aa7('0x3c')](_0x5ab21b);});})['then'](function(_0x57500e){logger['info'](_0x2aa7('0x4a'),_0x152341);logger[_0x2aa7('0xf')]('GetContactRecallMe',_0x152341,JSON['stringify'](_0x57500e));_0x24d1a5(_0x57500e);})['catch'](function(_0x11ede9){logger[_0x2aa7('0x11')](_0x2aa7('0x4a'),_0x11ede9['message'],_0x152341);_0x3e9b08(_0x58550d[_0x2aa7('0x11')](0x1f4,_0x11ede9[_0x2aa7('0x13')]));});});});};exports[_0x2aa7('0x4c')]=function(_0x493800){var _0x715a32=this;return new Promise(function(_0x3d50df,_0x3ac8d4){db['CmContact'][_0x2aa7('0x2e')]()[_0x2aa7('0xd')](function(_0x5292a4){return db['CmHopper'][_0x2aa7('0x18')]({'raw':_0x493800[_0x2aa7('0x19')]?_0x493800[_0x2aa7('0x19')][_0x2aa7('0x1a')]===undefined?!![]:![]:!![],'where':_0x493800[_0x2aa7('0x19')]?_0x493800[_0x2aa7('0x19')][_0x2aa7('0x22')]||null:null,'attributes':_0x493800[_0x2aa7('0x19')]?_0x493800['options']['attributes']||null:null,'limit':_0x493800[_0x2aa7('0x19')]?_0x493800[_0x2aa7('0x19')][_0x2aa7('0x1c')]||null:null,'include':_0x493800[_0x2aa7('0x19')]?_0x493800[_0x2aa7('0x19')]['include']?_[_0x2aa7('0x1e')](_0x493800[_0x2aa7('0x19')]['include'],function(_0x1e76b7){return{'model':db[_0x1e76b7['model']],'as':_0x1e76b7['as'],'attributes':_0x1e76b7['as']==='Contact'?_[_0x2aa7('0x35')](_0x5292a4):_0x1e76b7[_0x2aa7('0x1b')],'include':_0x1e76b7['include']?_['map'](_0x1e76b7[_0x2aa7('0x1d')],function(_0x241521){return{'model':db[_0x241521[_0x2aa7('0x1f')]],'as':_0x241521['as'],'attributes':_0x241521[_0x2aa7('0x1b')],'include':_0x241521[_0x2aa7('0x1d')]?_[_0x2aa7('0x1e')](_0x241521['include'],function(_0x5a600a){return{'model':db[_0x5a600a[_0x2aa7('0x1f')]],'as':_0x5a600a['as'],'attributes':_0x5a600a[_0x2aa7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2aa7('0xd')](function(_0x4251d5){logger['info'](_0x2aa7('0x17'),_0x493800);logger['debug'](_0x2aa7('0x17'),_0x493800,JSON[_0x2aa7('0x10')](_0x4251d5));_0x3d50df(_0x4251d5);})[_0x2aa7('0x16')](function(_0x13b4eb){logger[_0x2aa7('0x11')](_0x2aa7('0x17'),_0x13b4eb['message'],_0x493800);_0x3ac8d4(_0x715a32[_0x2aa7('0x11')](0x1f4,_0x13b4eb[_0x2aa7('0x13')]));});});});};exports[_0x2aa7('0x4d')]=function(_0xd8f7e7){var _0x451993=this;return new Promise(function(_0x12d9b6,_0x4e89a8){return db[_0x2aa7('0x2d')]['findOne']({'raw':!![],'where':{'phone':_0xd8f7e7['options'][_0x2aa7('0x22')]['phone']},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x2aa7('0xd')](function(_0x8dc85f){logger[_0x2aa7('0x14')](_0x2aa7('0x4e'),_0xd8f7e7);logger[_0x2aa7('0xf')](_0x2aa7('0x4e'),_0xd8f7e7,JSON[_0x2aa7('0x10')](_0x8dc85f));_0x12d9b6(_0x8dc85f);})[_0x2aa7('0x16')](function(_0x23feb3){logger['error'](_0x2aa7('0x4e'),_0x23feb3[_0x2aa7('0x13')],_0xd8f7e7);_0x4e89a8(_0x451993[_0x2aa7('0x11')](0x1f4,_0x23feb3[_0x2aa7('0x13')]));});});};exports[_0x2aa7('0x4f')]=function(_0xa7536c){var _0x1a6234=this;return new Promise(function(_0x29399e,_0x1fe5f5){return db[_0x2aa7('0x2f')][_0x2aa7('0x30')](function(_0xca8124){return db[_0x2aa7('0x20')][_0x2aa7('0x28')]({'active':![]},{'where':{},'transaction':_0xca8124})['then'](function(_0x231686){logger[_0x2aa7('0x14')](_0x2aa7('0x4f'),_0xa7536c);logger[_0x2aa7('0xf')](_0x2aa7('0x4f'),_0xa7536c,JSON[_0x2aa7('0x10')](_0x231686));_0x29399e(_0x231686);})[_0x2aa7('0x16')](function(_0x2e9942){logger['error'](_0x2aa7('0x4f'),_0x2e9942[_0x2aa7('0x13')],_0xa7536c);_0x1fe5f5(_0x1a6234['error'](0x1f4,_0x2e9942[_0x2aa7('0x13')]));});});});};exports[_0x2aa7('0x50')]=function(_0x36bec9){var _0x30113c=this;var _0x3e79ca=_0x36bec9[_0x2aa7('0x26')][_0x2aa7('0x22')]['voiceQueueId'];var _0xc086f0=_0x36bec9[_0x2aa7('0x26')][_0x2aa7('0x22')]['interval'];return new Promise(function(_0x295f20,_0x1495d7){return db[_0x2aa7('0x20')]['findAll']({'where':{'voiceQueueId':_0x3e79ca,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0x2aa7('0x44')](_0x2aa7('0x51')+_0xc086f0+_0x2aa7('0x52'))}},'include':[{'model':db[_0x2aa7('0x2d')],'as':_0x2aa7('0x34')},{'model':db['User'],'as':_0x2aa7('0x36'),'attributes':['id',_0x2aa7('0x37'),_0x2aa7('0x38')]},{'model':db['CmList'],'as':_0x2aa7('0x53')}]})[_0x2aa7('0xd')](function(_0x5236d2){return db[_0x2aa7('0x2f')][_0x2aa7('0x30')](function(_0x1f1a63){return db[_0x2aa7('0x20')][_0x2aa7('0x28')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x3e79ca,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x2aa7('0x2f')]['literal'](_0x2aa7('0x51')+_0xc086f0+_0x2aa7('0x52'))}},'transaction':_0x1f1a63})[_0x2aa7('0xd')](function(_0x25162a){_0x295f20(_0x5236d2);})[_0x2aa7('0x16')](function(_0x4e50f9){logger[_0x2aa7('0x11')](_0x2aa7('0x50'),_0x4e50f9[_0x2aa7('0x13')],_0x36bec9);_0x1495d7(validateExpressRequest);});});})['catch'](function(_0xfbd744){logger['error'](_0x2aa7('0x50'),_0xfbd744[_0x2aa7('0x13')],_0x36bec9);_0x1495d7(_0x30113c['error'](0x1f4,_0xfbd744[_0x2aa7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index f6118a6..c695ae8 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 _0x0806=['destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','post','create','/preview','getPreview','getTimezone','update','delete'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x0806,0x1ef));var _0x6080=function(_0x4450ec,_0x46c816){_0x4450ec=_0x4450ec-0x0;var _0x367d6a=_0x0806[_0x4450ec];return _0x367d6a;};'use strict';var multer=require(_0x6080('0x0'));var util=require(_0x6080('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6080('0x2'));var router=express[_0x6080('0x3')]();var fs_extra=require(_0x6080('0x4'));var auth=require(_0x6080('0x5'));var interaction=require(_0x6080('0x6'));var config=require('../../config/environment');var controller=require(_0x6080('0x7'));router[_0x6080('0x8')]('/',auth[_0x6080('0x9')](),controller['index']);router[_0x6080('0x8')](_0x6080('0xa'),auth[_0x6080('0x9')](),controller[_0x6080('0xb')]);router[_0x6080('0x8')](_0x6080('0xc'),auth[_0x6080('0x9')](),controller[_0x6080('0xd')]);router[_0x6080('0x8')](_0x6080('0xe'),auth[_0x6080('0x9')](),controller[_0x6080('0xf')]);router['get'](_0x6080('0x10'),auth[_0x6080('0x9')](),controller[_0x6080('0x11')]);router[_0x6080('0x12')]('/',auth[_0x6080('0x9')](),controller[_0x6080('0x13')]);router[_0x6080('0x12')](_0x6080('0x14'),auth[_0x6080('0x9')](),controller[_0x6080('0x15')]);router[_0x6080('0x12')]('/timezone',auth[_0x6080('0x9')](),controller[_0x6080('0x16')]);router['post']('/previewrecall',auth[_0x6080('0x9')](),controller['getPreviewRecall']);router['put'](_0x6080('0x10'),auth[_0x6080('0x9')](),controller[_0x6080('0x17')]);router[_0x6080('0x18')](_0x6080('0x10'),auth[_0x6080('0x9')](),controller[_0x6080('0x19')]);module['exports']=router; \ No newline at end of file +var _0x5bec=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts','/timezones','getTimezones','/:id','show','post','create','/preview','/timezone','/previewrecall','getPreviewRecall','put','delete','multer','util'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0x5bec,0x85));var _0xc5be=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5bec[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0xc5be('0x0'));var util=require(_0xc5be('0x1'));var path=require(_0xc5be('0x2'));var timeout=require(_0xc5be('0x3'));var express=require(_0xc5be('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc5be('0x5'));var interaction=require(_0xc5be('0x6'));var config=require(_0xc5be('0x7'));var controller=require(_0xc5be('0x8'));router[_0xc5be('0x9')]('/',auth['isAuthenticated'](),controller[_0xc5be('0xa')]);router[_0xc5be('0x9')](_0xc5be('0xb'),auth[_0xc5be('0xc')](),controller[_0xc5be('0xd')]);router[_0xc5be('0x9')](_0xc5be('0xe'),auth[_0xc5be('0xc')](),controller['getOpenContacts']);router[_0xc5be('0x9')](_0xc5be('0xf'),auth[_0xc5be('0xc')](),controller[_0xc5be('0x10')]);router[_0xc5be('0x9')](_0xc5be('0x11'),auth[_0xc5be('0xc')](),controller[_0xc5be('0x12')]);router[_0xc5be('0x13')]('/',auth[_0xc5be('0xc')](),controller[_0xc5be('0x14')]);router['post'](_0xc5be('0x15'),auth[_0xc5be('0xc')](),controller['getPreview']);router['post'](_0xc5be('0x16'),auth['isAuthenticated'](),controller['getTimezone']);router['post'](_0xc5be('0x17'),auth[_0xc5be('0xc')](),controller[_0xc5be('0x18')]);router[_0xc5be('0x19')](_0xc5be('0x11'),auth[_0xc5be('0xc')](),controller['update']);router[_0xc5be('0x1a')](_0xc5be('0x11'),auth[_0xc5be('0xc')](),controller['destroy']);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 284dc32..84656c4 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 _0xe548=['exports','STRING','INTEGER','moment','sequelize'];(function(_0x360b87,_0x4d3a5e){var _0x241f29=function(_0x1a7441){while(--_0x1a7441){_0x360b87['push'](_0x360b87['shift']());}};_0x241f29(++_0x4d3a5e);}(_0xe548,0x184));var _0x8e54=function(_0x1ca4cc,_0x402c23){_0x1ca4cc=_0x1ca4cc-0x0;var _0x108010=_0xe548[_0x1ca4cc];return _0x108010;};'use strict';var moment=require(_0x8e54('0x0'));var Sequelize=require(_0x8e54('0x1'));module[_0x8e54('0x2')]={'phone':{'type':Sequelize[_0x8e54('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x8e54('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x76c1=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0x76c1,0x87));var _0x176c=function(_0x52e0ee,_0x52f7c1){_0x52e0ee=_0x52e0ee-0x0;var _0x32534c=_0x76c1[_0x52e0ee];return _0x32534c;};'use strict';var moment=require(_0x176c('0x0'));var Sequelize=require(_0x176c('0x1'));module[_0x176c('0x2')]={'phone':{'type':Sequelize[_0x176c('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x176c('0x4')],'unique':_0x176c('0x5')},'ListId':{'type':Sequelize[_0x176c('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x176c('0x4')],'unique':_0x176c('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 518bcd5..bcc9b43 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 _0x9242=['show','params','find','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy','error','name','send','map','CmHopperBlack','rawAttributes','type','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','then','includeAll','include','findAll','catch'];(function(_0x2c8db2,_0x2fc833){var _0x1afcc8=function(_0x5e4990){while(--_0x5e4990){_0x2c8db2['push'](_0x2c8db2['shift']());}};_0x1afcc8(++_0x2fc833);}(_0x9242,0x1a3));var _0x2924=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x9242[_0x51c819];return _0x15c5d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2924('0x0'));var zipdir=require(_0x2924('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2924('0x2'));var moment=require(_0x2924('0x3'));var BPromise=require(_0x2924('0x4'));var Mustache=require(_0x2924('0x5'));var util=require('util');var path=require(_0x2924('0x6'));var sox=require(_0x2924('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2924('0x8'));var _=require(_0x2924('0x9'));var squel=require(_0x2924('0xa'));var crypto=require(_0x2924('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2924('0xc'));var querystring=require(_0x2924('0xd'));var Papa=require(_0x2924('0xe'));var Redis=require(_0x2924('0xf'));var authService=require(_0x2924('0x10'));var qs=require(_0x2924('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2924('0x12'))('api');var utils=require(_0x2924('0x13'));var config=require(_0x2924('0x14'));var licenseUtil=require(_0x2924('0x15'));var db=require(_0x2924('0x16'))['db'];function respondWithStatusCode(_0x147463,_0x57d393){_0x57d393=_0x57d393||0xcc;return function(_0x2ce80d){if(_0x2ce80d){return _0x147463[_0x2924('0x17')](_0x57d393);}return _0x147463[_0x2924('0x18')](_0x57d393)[_0x2924('0x19')]();};}function respondWithResult(_0x529c12,_0x25ff35){_0x25ff35=_0x25ff35||0xc8;return function(_0x26b7c1){if(_0x26b7c1){return _0x529c12[_0x2924('0x18')](_0x25ff35)[_0x2924('0x1a')](_0x26b7c1);}};}function respondWithFilteredResult(_0x502d2c,_0x4b2776){return function(_0x2b7e0e){if(_0x2b7e0e){var _0x1af6c4=typeof _0x4b2776['offset']===_0x2924('0x1b')&&typeof _0x4b2776[_0x2924('0x1c')]===_0x2924('0x1b');var _0xabf091=_0x2b7e0e['count'];var _0x2eb2e0=_0x1af6c4?0x0:_0x4b2776[_0x2924('0x1d')];var _0x40dfcc=_0x1af6c4?_0x2b7e0e[_0x2924('0x1e')]:_0x4b2776[_0x2924('0x1d')]+_0x4b2776[_0x2924('0x1c')];var _0x1fa04d;if(_0x40dfcc>=_0xabf091){_0x40dfcc=_0xabf091;_0x1fa04d=0xc8;}else{_0x1fa04d=0xce;}_0x502d2c['status'](_0x1fa04d);return _0x502d2c[_0x2924('0x1f')]('Content-Range',_0x2eb2e0+'-'+_0x40dfcc+'/'+_0xabf091)['json'](_0x2b7e0e);}return null;};}function patchUpdates(_0x752fee){return function(_0x211439){try{jsonpatch[_0x2924('0x20')](_0x211439,_0x752fee,!![]);}catch(_0x2c1e22){return BPromise[_0x2924('0x21')](_0x2c1e22);}return _0x211439[_0x2924('0x22')]();};}function saveUpdates(_0x2ecd3c,_0x2ec147){return function(_0x1226e4){if(_0x1226e4){return _0x1226e4[_0x2924('0x23')](_0x2ecd3c)['then'](function(_0x1d650e){return _0x1d650e;});}return null;};}function removeEntity(_0x159e00,_0x184654){return function(_0x31aae4){if(_0x31aae4){return _0x31aae4[_0x2924('0x24')]()['then'](function(){_0x159e00[_0x2924('0x18')](0xcc)[_0x2924('0x19')]();});}};}function handleEntityNotFound(_0x130bf4,_0x236f15){return function(_0x3c16be){if(!_0x3c16be){_0x130bf4[_0x2924('0x17')](0x194);}return _0x3c16be;};}function handleError(_0x1a9b12,_0x4dc8c9){_0x4dc8c9=_0x4dc8c9||0x1f4;return function(_0x4cbe8e){logger[_0x2924('0x25')](_0x4cbe8e['stack']);if(_0x4cbe8e[_0x2924('0x26')]){delete _0x4cbe8e['name'];}_0x1a9b12[_0x2924('0x18')](_0x4dc8c9)[_0x2924('0x27')](_0x4cbe8e);};}exports['index']=function(_0x45ea1a,_0x5ee280){var _0x47fbff={},_0x4b060e={},_0x21bbe1={'count':0x0,'rows':[]};var _0x2399ff=_[_0x2924('0x28')](db[_0x2924('0x29')][_0x2924('0x2a')],function(_0x250e22){return{'name':_0x250e22['fieldName'],'type':_0x250e22[_0x2924('0x2b')]['key']};});_0x4b060e[_0x2924('0x2c')]=_[_0x2924('0x28')](_0x2399ff,_0x2924('0x26'));_0x4b060e[_0x2924('0x2d')]=_['keys'](_0x45ea1a[_0x2924('0x2d')]);_0x4b060e['filters']=_[_0x2924('0x2e')](_0x4b060e[_0x2924('0x2c')],_0x4b060e[_0x2924('0x2d')]);_0x47fbff[_0x2924('0x2f')]=_[_0x2924('0x2e')](_0x4b060e[_0x2924('0x2c')],qs[_0x2924('0x30')](_0x45ea1a[_0x2924('0x2d')][_0x2924('0x30')]));_0x47fbff[_0x2924('0x2f')]=_0x47fbff[_0x2924('0x2f')][_0x2924('0x31')]?_0x47fbff['attributes']:_0x4b060e[_0x2924('0x2c')];if(!_0x45ea1a['query']['hasOwnProperty'](_0x2924('0x32'))){_0x47fbff[_0x2924('0x1c')]=qs[_0x2924('0x1c')](_0x45ea1a[_0x2924('0x2d')][_0x2924('0x1c')]);_0x47fbff[_0x2924('0x1d')]=qs[_0x2924('0x1d')](_0x45ea1a[_0x2924('0x2d')]['offset']);}_0x47fbff[_0x2924('0x33')]=qs[_0x2924('0x34')](_0x45ea1a[_0x2924('0x2d')][_0x2924('0x34')]);_0x47fbff[_0x2924('0x35')]=qs[_0x2924('0x36')](_[_0x2924('0x37')](_0x45ea1a[_0x2924('0x2d')],_0x4b060e[_0x2924('0x36')]),_0x2399ff);if(_0x45ea1a[_0x2924('0x2d')][_0x2924('0x38')]){_0x47fbff[_0x2924('0x35')]=_[_0x2924('0x39')](_0x47fbff[_0x2924('0x35')],{'$or':_['map'](_0x2399ff,function(_0x4217a5){if(_0x4217a5[_0x2924('0x2b')]!=='VIRTUAL'){var _0xe8902e={};_0xe8902e[_0x4217a5[_0x2924('0x26')]]={'$like':'%'+_0x45ea1a[_0x2924('0x2d')][_0x2924('0x38')]+'%'};return _0xe8902e;}})});}_0x47fbff=_['merge']({},_0x47fbff,_0x45ea1a[_0x2924('0x3a')]);var _0x4f9856={'where':_0x47fbff[_0x2924('0x35')]};return db['CmHopperBlack'][_0x2924('0x1e')](_0x4f9856)[_0x2924('0x3b')](function(_0x31295f){_0x21bbe1[_0x2924('0x1e')]=_0x31295f;if(_0x45ea1a[_0x2924('0x2d')][_0x2924('0x3c')]){_0x47fbff[_0x2924('0x3d')]=[{'all':!![]}];}return db[_0x2924('0x29')][_0x2924('0x3e')](_0x47fbff);})[_0x2924('0x3b')](function(_0x587b62){_0x21bbe1['rows']=_0x587b62;return _0x21bbe1;})['then'](respondWithFilteredResult(_0x5ee280,_0x47fbff))[_0x2924('0x3f')](handleError(_0x5ee280,null));};exports[_0x2924('0x40')]=function(_0x3663e6,_0x7adfd2){var _0x1c9d95={'raw':!![],'where':{'id':_0x3663e6[_0x2924('0x41')]['id']}},_0x4a910d={};_0x4a910d[_0x2924('0x2c')]=_['keys'](db[_0x2924('0x29')][_0x2924('0x2a')]);_0x4a910d[_0x2924('0x2d')]=_['keys'](_0x3663e6[_0x2924('0x2d')]);_0x4a910d[_0x2924('0x36')]=_['intersection'](_0x4a910d[_0x2924('0x2c')],_0x4a910d[_0x2924('0x2d')]);_0x1c9d95[_0x2924('0x2f')]=_[_0x2924('0x2e')](_0x4a910d[_0x2924('0x2c')],qs[_0x2924('0x30')](_0x3663e6['query'][_0x2924('0x30')]));_0x1c9d95[_0x2924('0x2f')]=_0x1c9d95[_0x2924('0x2f')][_0x2924('0x31')]?_0x1c9d95['attributes']:_0x4a910d[_0x2924('0x2c')];if(_0x3663e6[_0x2924('0x2d')][_0x2924('0x3c')]){_0x1c9d95['include']=[{'all':!![]}];}_0x1c9d95=_[_0x2924('0x39')]({},_0x1c9d95,_0x3663e6[_0x2924('0x3a')]);return db['CmHopperBlack'][_0x2924('0x42')](_0x1c9d95)['then'](handleEntityNotFound(_0x7adfd2,null))[_0x2924('0x3b')](respondWithResult(_0x7adfd2,null))[_0x2924('0x3f')](handleError(_0x7adfd2,null));};exports['update']=function(_0x2a0c91,_0x4f530f){if(_0x2a0c91[_0x2924('0x43')]['id']){delete _0x2a0c91['body']['id'];}return db[_0x2924('0x29')]['find']({'where':{'id':_0x2a0c91[_0x2924('0x41')]['id']}})[_0x2924('0x3b')](handleEntityNotFound(_0x4f530f,null))[_0x2924('0x3b')](saveUpdates(_0x2a0c91['body'],null))[_0x2924('0x3b')](respondWithResult(_0x4f530f,null))['catch'](handleError(_0x4f530f,null));};exports[_0x2924('0x24')]=function(_0x4ae18b,_0x558ca0){return db['CmHopperBlack'][_0x2924('0x42')]({'where':{'id':_0x4ae18b[_0x2924('0x41')]['id']}})['then'](handleEntityNotFound(_0x558ca0,null))[_0x2924('0x3b')](removeEntity(_0x558ca0,null))[_0x2924('0x3f')](handleError(_0x558ca0,null));};exports[_0x2924('0x44')]=function(_0x249eb2,_0x3e48f1){return db[_0x2924('0x29')]['describe']()[_0x2924('0x3b')](respondWithResult(_0x3e48f1,null))[_0x2924('0x3f')](handleError(_0x3e48f1,null));}; \ No newline at end of file +var _0x1e06=['update','then','destroy','sendStatus','stack','name','send','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','findAll','rows','show','includeAll','find','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject'];(function(_0x4402b6,_0x56401d){var _0x2504c1=function(_0xd2b244){while(--_0xd2b244){_0x4402b6['push'](_0x4402b6['shift']());}};_0x2504c1(++_0x56401d);}(_0x1e06,0x1c9));var _0x61e0=function(_0x992e89,_0x2f7896){_0x992e89=_0x992e89-0x0;var _0x51eaa1=_0x1e06[_0x992e89];return _0x51eaa1;};'use strict';var emlformat=require(_0x61e0('0x0'));var rimraf=require(_0x61e0('0x1'));var zipdir=require(_0x61e0('0x2'));var jsonpatch=require(_0x61e0('0x3'));var rp=require(_0x61e0('0x4'));var moment=require('moment');var BPromise=require(_0x61e0('0x5'));var Mustache=require(_0x61e0('0x6'));var util=require('util');var path=require('path');var sox=require(_0x61e0('0x7'));var csv=require(_0x61e0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x61e0('0x9'));var squel=require(_0x61e0('0xa'));var crypto=require(_0x61e0('0xb'));var jsforce=require(_0x61e0('0xc'));var deskjs=require(_0x61e0('0xd'));var toCsv=require(_0x61e0('0x8'));var querystring=require(_0x61e0('0xe'));var Papa=require(_0x61e0('0xf'));var Redis=require(_0x61e0('0x10'));var authService=require(_0x61e0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x61e0('0x12'));var hardwareService=require(_0x61e0('0x13'));var logger=require('../../config/logger')(_0x61e0('0x14'));var utils=require('../../config/utils');var config=require(_0x61e0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x61e0('0x16'))['db'];function respondWithStatusCode(_0x1f9251,_0x261d3b){_0x261d3b=_0x261d3b||0xcc;return function(_0x258664){if(_0x258664){return _0x1f9251['sendStatus'](_0x261d3b);}return _0x1f9251[_0x61e0('0x17')](_0x261d3b)[_0x61e0('0x18')]();};}function respondWithResult(_0x3b61bb,_0x28204a){_0x28204a=_0x28204a||0xc8;return function(_0x243dd8){if(_0x243dd8){return _0x3b61bb[_0x61e0('0x17')](_0x28204a)[_0x61e0('0x19')](_0x243dd8);}};}function respondWithFilteredResult(_0x512c82,_0x4703fa){return function(_0x8adc47){if(_0x8adc47){var _0x457851=typeof _0x4703fa['offset']===_0x61e0('0x1a')&&typeof _0x4703fa[_0x61e0('0x1b')]===_0x61e0('0x1a');var _0x5345de=_0x8adc47[_0x61e0('0x1c')];var _0x3d5eed=_0x457851?0x0:_0x4703fa['offset'];var _0x34a9b1=_0x457851?_0x8adc47['count']:_0x4703fa[_0x61e0('0x1d')]+_0x4703fa[_0x61e0('0x1b')];var _0xf04a63;if(_0x34a9b1>=_0x5345de){_0x34a9b1=_0x5345de;_0xf04a63=0xc8;}else{_0xf04a63=0xce;}_0x512c82[_0x61e0('0x17')](_0xf04a63);return _0x512c82[_0x61e0('0x1e')](_0x61e0('0x1f'),_0x3d5eed+'-'+_0x34a9b1+'/'+_0x5345de)[_0x61e0('0x19')](_0x8adc47);}return null;};}function patchUpdates(_0x476d14){return function(_0x3206a0){try{jsonpatch['apply'](_0x3206a0,_0x476d14,!![]);}catch(_0x225573){return BPromise[_0x61e0('0x20')](_0x225573);}return _0x3206a0['save']();};}function saveUpdates(_0x4cdde8,_0x586a02){return function(_0x2d9dd5){if(_0x2d9dd5){return _0x2d9dd5[_0x61e0('0x21')](_0x4cdde8)[_0x61e0('0x22')](function(_0x42756d){return _0x42756d;});}return null;};}function removeEntity(_0x593cc7,_0x5d80b9){return function(_0x1ff5b0){if(_0x1ff5b0){return _0x1ff5b0[_0x61e0('0x23')]()['then'](function(){_0x593cc7[_0x61e0('0x17')](0xcc)[_0x61e0('0x18')]();});}};}function handleEntityNotFound(_0x523b53,_0x270258){return function(_0x47a46c){if(!_0x47a46c){_0x523b53[_0x61e0('0x24')](0x194);}return _0x47a46c;};}function handleError(_0x28f564,_0x52f781){_0x52f781=_0x52f781||0x1f4;return function(_0x4e7fbe){logger['error'](_0x4e7fbe[_0x61e0('0x25')]);if(_0x4e7fbe[_0x61e0('0x26')]){delete _0x4e7fbe[_0x61e0('0x26')];}_0x28f564[_0x61e0('0x17')](_0x52f781)[_0x61e0('0x27')](_0x4e7fbe);};}exports['index']=function(_0x3df5fa,_0x2c2aa0){var _0x3a0c12={},_0x36ff0a={},_0x4f9c95={'count':0x0,'rows':[]};var _0x45371c=_['map'](db[_0x61e0('0x28')][_0x61e0('0x29')],function(_0x354843){return{'name':_0x354843[_0x61e0('0x2a')],'type':_0x354843[_0x61e0('0x2b')][_0x61e0('0x2c')]};});_0x36ff0a[_0x61e0('0x2d')]=_[_0x61e0('0x2e')](_0x45371c,'name');_0x36ff0a['query']=_[_0x61e0('0x2f')](_0x3df5fa[_0x61e0('0x30')]);_0x36ff0a['filters']=_[_0x61e0('0x31')](_0x36ff0a['model'],_0x36ff0a[_0x61e0('0x30')]);_0x3a0c12[_0x61e0('0x32')]=_[_0x61e0('0x31')](_0x36ff0a['model'],qs[_0x61e0('0x33')](_0x3df5fa[_0x61e0('0x30')]['fields']));_0x3a0c12[_0x61e0('0x32')]=_0x3a0c12[_0x61e0('0x32')][_0x61e0('0x34')]?_0x3a0c12['attributes']:_0x36ff0a[_0x61e0('0x2d')];if(!_0x3df5fa[_0x61e0('0x30')]['hasOwnProperty'](_0x61e0('0x35'))){_0x3a0c12[_0x61e0('0x1b')]=qs[_0x61e0('0x1b')](_0x3df5fa[_0x61e0('0x30')][_0x61e0('0x1b')]);_0x3a0c12[_0x61e0('0x1d')]=qs[_0x61e0('0x1d')](_0x3df5fa[_0x61e0('0x30')][_0x61e0('0x1d')]);}_0x3a0c12['order']=qs['sort'](_0x3df5fa[_0x61e0('0x30')][_0x61e0('0x36')]);_0x3a0c12[_0x61e0('0x37')]=qs[_0x61e0('0x38')](_['pick'](_0x3df5fa[_0x61e0('0x30')],_0x36ff0a[_0x61e0('0x38')]),_0x45371c);if(_0x3df5fa[_0x61e0('0x30')]['filter']){_0x3a0c12[_0x61e0('0x37')]=_[_0x61e0('0x39')](_0x3a0c12[_0x61e0('0x37')],{'$or':_['map'](_0x45371c,function(_0x303774){if(_0x303774[_0x61e0('0x2b')]!==_0x61e0('0x3a')){var _0xe168f4={};_0xe168f4[_0x303774[_0x61e0('0x26')]]={'$like':'%'+_0x3df5fa[_0x61e0('0x30')][_0x61e0('0x3b')]+'%'};return _0xe168f4;}})});}_0x3a0c12=_['merge']({},_0x3a0c12,_0x3df5fa[_0x61e0('0x3c')]);var _0xea048b={'where':_0x3a0c12[_0x61e0('0x37')]};return db[_0x61e0('0x28')]['count'](_0xea048b)['then'](function(_0x2687a8){_0x4f9c95[_0x61e0('0x1c')]=_0x2687a8;if(_0x3df5fa[_0x61e0('0x30')]['includeAll']){_0x3a0c12['include']=[{'all':!![]}];}return db[_0x61e0('0x28')][_0x61e0('0x3d')](_0x3a0c12);})[_0x61e0('0x22')](function(_0x5905a5){_0x4f9c95[_0x61e0('0x3e')]=_0x5905a5;return _0x4f9c95;})[_0x61e0('0x22')](respondWithFilteredResult(_0x2c2aa0,_0x3a0c12))['catch'](handleError(_0x2c2aa0,null));};exports[_0x61e0('0x3f')]=function(_0x90c0fb,_0x537d68){var _0xd412bc={'raw':!![],'where':{'id':_0x90c0fb['params']['id']}},_0x153a69={};_0x153a69[_0x61e0('0x2d')]=_[_0x61e0('0x2f')](db['CmHopperBlack'][_0x61e0('0x29')]);_0x153a69[_0x61e0('0x30')]=_[_0x61e0('0x2f')](_0x90c0fb[_0x61e0('0x30')]);_0x153a69[_0x61e0('0x38')]=_[_0x61e0('0x31')](_0x153a69[_0x61e0('0x2d')],_0x153a69[_0x61e0('0x30')]);_0xd412bc[_0x61e0('0x32')]=_[_0x61e0('0x31')](_0x153a69[_0x61e0('0x2d')],qs[_0x61e0('0x33')](_0x90c0fb[_0x61e0('0x30')]['fields']));_0xd412bc[_0x61e0('0x32')]=_0xd412bc[_0x61e0('0x32')][_0x61e0('0x34')]?_0xd412bc[_0x61e0('0x32')]:_0x153a69[_0x61e0('0x2d')];if(_0x90c0fb[_0x61e0('0x30')][_0x61e0('0x40')]){_0xd412bc['include']=[{'all':!![]}];}_0xd412bc=_[_0x61e0('0x39')]({},_0xd412bc,_0x90c0fb['options']);return db[_0x61e0('0x28')][_0x61e0('0x41')](_0xd412bc)['then'](handleEntityNotFound(_0x537d68,null))[_0x61e0('0x22')](respondWithResult(_0x537d68,null))[_0x61e0('0x42')](handleError(_0x537d68,null));};exports[_0x61e0('0x21')]=function(_0xeb7ff,_0xd345e4){if(_0xeb7ff[_0x61e0('0x43')]['id']){delete _0xeb7ff['body']['id'];}return db[_0x61e0('0x28')][_0x61e0('0x41')]({'where':{'id':_0xeb7ff[_0x61e0('0x44')]['id']}})[_0x61e0('0x22')](handleEntityNotFound(_0xd345e4,null))[_0x61e0('0x22')](saveUpdates(_0xeb7ff[_0x61e0('0x43')],null))['then'](respondWithResult(_0xd345e4,null))['catch'](handleError(_0xd345e4,null));};exports[_0x61e0('0x23')]=function(_0x11ea11,_0x2d020d){return db[_0x61e0('0x28')]['find']({'where':{'id':_0x11ea11[_0x61e0('0x44')]['id']}})['then'](handleEntityNotFound(_0x2d020d,null))[_0x61e0('0x22')](removeEntity(_0x2d020d,null))[_0x61e0('0x42')](handleError(_0x2d020d,null));};exports['describe']=function(_0x2bb808,_0x17a05a){return db[_0x61e0('0x28')][_0x61e0('0x45')]()[_0x61e0('0x22')](respondWithResult(_0x17a05a,null))[_0x61e0('0x42')](handleError(_0x17a05a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 40c304d..d48a2b7 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 _0x4524=['./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x21b9e0,_0x4357ba){var _0x15c344=function(_0x4debd5){while(--_0x4debd5){_0x21b9e0['push'](_0x21b9e0['shift']());}};_0x15c344(++_0x4357ba);}(_0x4524,0x180));var _0x4452=function(_0x2dd10a,_0x59a648){_0x2dd10a=_0x2dd10a-0x0;var _0x3c5aa0=_0x4524[_0x2dd10a];return _0x3c5aa0;};'use strict';var _=require(_0x4452('0x0'));var util=require('util');var logger=require(_0x4452('0x1'))('api');var moment=require(_0x4452('0x2'));var BPromise=require('bluebird');var rp=require(_0x4452('0x3'));var fs=require('fs');var path=require(_0x4452('0x4'));var rimraf=require('rimraf');var config=require(_0x4452('0x5'));var attributes=require(_0x4452('0x6'));module[_0x4452('0x7')]=function(_0x4061df,_0x5a1a08){return _0x4061df[_0x4452('0x8')](_0x4452('0x9'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d1a=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black'];(function(_0x1e7d4f,_0x26498b){var _0x4e7016=function(_0x4b9e66){while(--_0x4b9e66){_0x1e7d4f['push'](_0x1e7d4f['shift']());}};_0x4e7016(++_0x26498b);}(_0x7d1a,0x150));var _0xa7d1=function(_0x59ab45,_0x4122d9){_0x59ab45=_0x59ab45-0x0;var _0x59abea=_0x7d1a[_0x59ab45];return _0x59abea;};'use strict';var _=require(_0xa7d1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa7d1('0x1'));var moment=require(_0xa7d1('0x2'));var BPromise=require(_0xa7d1('0x3'));var rp=require(_0xa7d1('0x4'));var fs=require('fs');var path=require(_0xa7d1('0x5'));var rimraf=require(_0xa7d1('0x6'));var config=require(_0xa7d1('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0xa7d1('0x8')]=function(_0x3323de,_0x27ca08){return _0x3323de[_0xa7d1('0x9')](_0xa7d1('0xa'),attributes,{'tableName':_0xa7d1('0xb'),'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 f43bafd..65632ca 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 _0xa0d6=['jayson/promise','http','request','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','attributes','include','map','model','then','update','raw','where','limit','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x28836b,_0x389433){var _0x51f3f8=function(_0x503226){while(--_0x503226){_0x28836b['push'](_0x28836b['shift']());}};_0x51f3f8(++_0x389433);}(_0xa0d6,0xe0));var _0x6a0d=function(_0x5c3735,_0x390575){_0x5c3735=_0x5c3735-0x0;var _0x4de745=_0xa0d6[_0x5c3735];return _0x4de745;};'use strict';var _=require(_0x6a0d('0x0'));var util=require(_0x6a0d('0x1'));var moment=require(_0x6a0d('0x2'));var BPromise=require(_0x6a0d('0x3'));var rs=require(_0x6a0d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a0d('0x5'))['db'];var utils=require(_0x6a0d('0x6'));var logger=require(_0x6a0d('0x7'))(_0x6a0d('0x8'));var config=require(_0x6a0d('0x9'));var jayson=require(_0x6a0d('0xa'));var client=jayson['client'][_0x6a0d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1304c2,_0x5c37ca,_0x109486){return new BPromise(function(_0x3c1d6b,_0x3ee795){return client[_0x6a0d('0xc')](_0x1304c2,_0x109486)['then'](function(_0x2ee5be){logger[_0x6a0d('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x5c37ca,_0x6a0d('0xe'));logger[_0x6a0d('0xf')](_0x6a0d('0x10'),_0x5c37ca,_0x6a0d('0xe'),JSON[_0x6a0d('0x11')](_0x2ee5be));if(_0x2ee5be[_0x6a0d('0x12')]){if(_0x2ee5be[_0x6a0d('0x12')][_0x6a0d('0x13')]===0x1f4){logger[_0x6a0d('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x5c37ca,_0x2ee5be[_0x6a0d('0x12')]['message']);return _0x3ee795(_0x2ee5be[_0x6a0d('0x12')]['message']);}logger[_0x6a0d('0x12')](_0x6a0d('0x14'),_0x5c37ca,_0x2ee5be['error'][_0x6a0d('0x15')]);return _0x3c1d6b(_0x2ee5be['error'][_0x6a0d('0x15')]);}else{logger[_0x6a0d('0xd')](_0x6a0d('0x14'),_0x5c37ca,_0x6a0d('0xe'));_0x3c1d6b(_0x2ee5be[_0x6a0d('0x16')][_0x6a0d('0x15')]);}})[_0x6a0d('0x17')](function(_0x25b00e){logger[_0x6a0d('0x12')](_0x6a0d('0x14'),_0x5c37ca,_0x25b00e);_0x3ee795(_0x25b00e);});});}exports[_0x6a0d('0x18')]=function(_0x2abb25){var _0x693fce=this;return new Promise(function(_0x382141,_0x1b677a){return db[_0x6a0d('0x19')][_0x6a0d('0x1a')]({'raw':_0x2abb25[_0x6a0d('0x1b')]?_0x2abb25[_0x6a0d('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2abb25[_0x6a0d('0x1b')]?_0x2abb25[_0x6a0d('0x1b')]['where']||null:null,'attributes':_0x2abb25[_0x6a0d('0x1b')]?_0x2abb25[_0x6a0d('0x1b')][_0x6a0d('0x1c')]||null:null,'limit':_0x2abb25[_0x6a0d('0x1b')]?_0x2abb25[_0x6a0d('0x1b')]['limit']||null:null,'include':_0x2abb25[_0x6a0d('0x1b')]?_0x2abb25[_0x6a0d('0x1b')][_0x6a0d('0x1d')]?_[_0x6a0d('0x1e')](_0x2abb25[_0x6a0d('0x1b')][_0x6a0d('0x1d')],function(_0x22b9e4){return{'model':db[_0x22b9e4[_0x6a0d('0x1f')]],'as':_0x22b9e4['as'],'attributes':_0x22b9e4[_0x6a0d('0x1c')],'include':_0x22b9e4[_0x6a0d('0x1d')]?_[_0x6a0d('0x1e')](_0x22b9e4[_0x6a0d('0x1d')],function(_0x50567a){return{'model':db[_0x50567a['model']],'as':_0x50567a['as'],'attributes':_0x50567a['attributes'],'include':_0x50567a['include']?_[_0x6a0d('0x1e')](_0x50567a[_0x6a0d('0x1d')],function(_0xdbf2fa){return{'model':db[_0xdbf2fa['model']],'as':_0xdbf2fa['as'],'attributes':_0xdbf2fa[_0x6a0d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6a0d('0x20')](function(_0x34ba0e){logger[_0x6a0d('0xd')](_0x6a0d('0x18'),_0x2abb25);logger['debug'](_0x6a0d('0x18'),_0x2abb25,JSON[_0x6a0d('0x11')](_0x34ba0e));_0x382141(_0x34ba0e);})[_0x6a0d('0x17')](function(_0x1d13ae){logger[_0x6a0d('0x12')](_0x6a0d('0x18'),_0x1d13ae[_0x6a0d('0x15')],_0x2abb25);_0x1b677a(_0x693fce[_0x6a0d('0x12')](0x1f4,_0x1d13ae[_0x6a0d('0x15')]));});});};exports['UpdateCmHopperBlack']=function(_0x196fa7){var _0x5cb7e9=this;return new Promise(function(_0x105e66,_0x546e02){return db[_0x6a0d('0x19')][_0x6a0d('0x21')](_0x196fa7['body'],{'raw':_0x196fa7['options']?_0x196fa7[_0x6a0d('0x1b')][_0x6a0d('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x196fa7[_0x6a0d('0x1b')]?_0x196fa7[_0x6a0d('0x1b')][_0x6a0d('0x23')]||null:null,'attributes':_0x196fa7['options']?_0x196fa7[_0x6a0d('0x1b')]['attributes']||null:null,'limit':_0x196fa7[_0x6a0d('0x1b')]?_0x196fa7[_0x6a0d('0x1b')][_0x6a0d('0x24')]||null:null})[_0x6a0d('0x20')](function(_0x248983){logger[_0x6a0d('0xd')]('UpdateCmHopperBlack',_0x196fa7);logger[_0x6a0d('0xf')](_0x6a0d('0x25'),_0x196fa7,JSON[_0x6a0d('0x11')](_0x248983));_0x105e66(_0x248983);})[_0x6a0d('0x17')](function(_0x41c107){logger[_0x6a0d('0x12')](_0x6a0d('0x25'),_0x41c107[_0x6a0d('0x15')],_0x196fa7);_0x546e02(_0x5cb7e9['error'](0x1f4,_0x41c107[_0x6a0d('0x15')]));});});};exports[_0x6a0d('0x26')]=function(_0x7dbee0){var _0x1c2058=this;return new Promise(function(_0xbe010d,_0x3a8f9e){return db['CmHopperBlack']['destroy']({'where':_0x7dbee0['options']?_0x7dbee0[_0x6a0d('0x1b')]['where']||null:null})[_0x6a0d('0x20')](function(_0x497d3f){logger['info'](_0x6a0d('0x26'),_0x7dbee0);logger[_0x6a0d('0xf')](_0x6a0d('0x26'),_0x7dbee0,JSON[_0x6a0d('0x11')](_0x497d3f));_0xbe010d(_0x497d3f);})[_0x6a0d('0x17')](function(_0xf9965b){logger[_0x6a0d('0x12')]('DestroyCmHopperBlack',_0xf9965b[_0x6a0d('0x15')],_0x7dbee0);_0x3a8f9e(_0x1c2058[_0x6a0d('0x12')](0x1f4,_0xf9965b[_0x6a0d('0x15')]));});});}; \ No newline at end of file +var _0x218e=['DestroyCmHopperBlack','CmHopperBlack','destroy','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopperBlack','findAll','options','limit','include','map','model','attributes','UpdateCmHopperBlack','update','body','raw','where'];(function(_0x383dbb,_0x17d41b){var _0x6e8bde=function(_0x2740f1){while(--_0x2740f1){_0x383dbb['push'](_0x383dbb['shift']());}};_0x6e8bde(++_0x17d41b);}(_0x218e,0xa7));var _0xe218=function(_0x253055,_0x439514){_0x253055=_0x253055-0x0;var _0x4f5633=_0x218e[_0x253055];return _0x4f5633;};'use strict';var _=require(_0xe218('0x0'));var util=require(_0xe218('0x1'));var moment=require(_0xe218('0x2'));var BPromise=require('bluebird');var rs=require(_0xe218('0x3'));var fs=require('fs');var Redis=require(_0xe218('0x4'));var db=require(_0xe218('0x5'))['db'];var utils=require(_0xe218('0x6'));var logger=require(_0xe218('0x7'))(_0xe218('0x8'));var config=require(_0xe218('0x9'));var jayson=require(_0xe218('0xa'));var client=jayson[_0xe218('0xb')][_0xe218('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb1d9aa,_0x3adb7c,_0x4b21fb){return new BPromise(function(_0x582ab9,_0x4b9b3d){return client['request'](_0xb1d9aa,_0x4b21fb)[_0xe218('0xd')](function(_0x1c1428){logger[_0xe218('0xe')](_0xe218('0xf'),_0x3adb7c,'request\x20sent');logger[_0xe218('0x10')](_0xe218('0x11'),_0x3adb7c,_0xe218('0x12'),JSON[_0xe218('0x13')](_0x1c1428));if(_0x1c1428[_0xe218('0x14')]){if(_0x1c1428['error'][_0xe218('0x15')]===0x1f4){logger[_0xe218('0x14')](_0xe218('0xf'),_0x3adb7c,_0x1c1428[_0xe218('0x14')][_0xe218('0x16')]);return _0x4b9b3d(_0x1c1428[_0xe218('0x14')]['message']);}logger[_0xe218('0x14')](_0xe218('0xf'),_0x3adb7c,_0x1c1428['error'][_0xe218('0x16')]);return _0x582ab9(_0x1c1428[_0xe218('0x14')]['message']);}else{logger[_0xe218('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x3adb7c,'request\x20sent');_0x582ab9(_0x1c1428[_0xe218('0x17')][_0xe218('0x16')]);}})[_0xe218('0x18')](function(_0x16bef0){logger[_0xe218('0x14')](_0xe218('0xf'),_0x3adb7c,_0x16bef0);_0x4b9b3d(_0x16bef0);});});}exports[_0xe218('0x19')]=function(_0x276be4){var _0x577218=this;return new Promise(function(_0x22655f,_0x149f64){return db['CmHopperBlack'][_0xe218('0x1a')]({'raw':_0x276be4[_0xe218('0x1b')]?_0x276be4[_0xe218('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x276be4[_0xe218('0x1b')]?_0x276be4[_0xe218('0x1b')]['where']||null:null,'attributes':_0x276be4[_0xe218('0x1b')]?_0x276be4[_0xe218('0x1b')]['attributes']||null:null,'limit':_0x276be4[_0xe218('0x1b')]?_0x276be4[_0xe218('0x1b')][_0xe218('0x1c')]||null:null,'include':_0x276be4[_0xe218('0x1b')]?_0x276be4['options'][_0xe218('0x1d')]?_[_0xe218('0x1e')](_0x276be4[_0xe218('0x1b')][_0xe218('0x1d')],function(_0x5f37d5){return{'model':db[_0x5f37d5[_0xe218('0x1f')]],'as':_0x5f37d5['as'],'attributes':_0x5f37d5['attributes'],'include':_0x5f37d5[_0xe218('0x1d')]?_[_0xe218('0x1e')](_0x5f37d5[_0xe218('0x1d')],function(_0x54dd56){return{'model':db[_0x54dd56['model']],'as':_0x54dd56['as'],'attributes':_0x54dd56[_0xe218('0x20')],'include':_0x54dd56[_0xe218('0x1d')]?_['map'](_0x54dd56[_0xe218('0x1d')],function(_0x4d8f60){return{'model':db[_0x4d8f60[_0xe218('0x1f')]],'as':_0x4d8f60['as'],'attributes':_0x4d8f60['attributes']};}):[]};}):[]};}):[]:[]})[_0xe218('0xd')](function(_0x1fcae9){logger['info']('GetCmHopperBlack',_0x276be4);logger[_0xe218('0x10')]('GetCmHopperBlack',_0x276be4,JSON['stringify'](_0x1fcae9));_0x22655f(_0x1fcae9);})[_0xe218('0x18')](function(_0x352c1f){logger['error']('GetCmHopperBlack',_0x352c1f[_0xe218('0x16')],_0x276be4);_0x149f64(_0x577218[_0xe218('0x14')](0x1f4,_0x352c1f[_0xe218('0x16')]));});});};exports[_0xe218('0x21')]=function(_0x2b3248){var _0x841def=this;return new Promise(function(_0x1621f6,_0x1d109f){return db['CmHopperBlack'][_0xe218('0x22')](_0x2b3248[_0xe218('0x23')],{'raw':_0x2b3248[_0xe218('0x1b')]?_0x2b3248['options'][_0xe218('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b3248['options']?_0x2b3248['options'][_0xe218('0x25')]||null:null,'attributes':_0x2b3248[_0xe218('0x1b')]?_0x2b3248[_0xe218('0x1b')][_0xe218('0x20')]||null:null,'limit':_0x2b3248[_0xe218('0x1b')]?_0x2b3248[_0xe218('0x1b')][_0xe218('0x1c')]||null:null})[_0xe218('0xd')](function(_0x45c0b8){logger[_0xe218('0xe')]('UpdateCmHopperBlack',_0x2b3248);logger[_0xe218('0x10')](_0xe218('0x21'),_0x2b3248,JSON['stringify'](_0x45c0b8));_0x1621f6(_0x45c0b8);})['catch'](function(_0x1ba985){logger[_0xe218('0x14')](_0xe218('0x21'),_0x1ba985['message'],_0x2b3248);_0x1d109f(_0x841def[_0xe218('0x14')](0x1f4,_0x1ba985[_0xe218('0x16')]));});});};exports[_0xe218('0x26')]=function(_0x5de5c1){var _0x4e4319=this;return new Promise(function(_0x47915d,_0x5b6c32){return db[_0xe218('0x27')][_0xe218('0x28')]({'where':_0x5de5c1['options']?_0x5de5c1[_0xe218('0x1b')]['where']||null:null})[_0xe218('0xd')](function(_0x528cbe){logger[_0xe218('0xe')](_0xe218('0x26'),_0x5de5c1);logger['debug']('DestroyCmHopperBlack',_0x5de5c1,JSON[_0xe218('0x13')](_0x528cbe));_0x47915d(_0x528cbe);})[_0xe218('0x18')](function(_0x31492c){logger[_0xe218('0x14')](_0xe218('0x26'),_0x31492c[_0xe218('0x16')],_0x5de5c1);_0x5b6c32(_0x4e4319[_0xe218('0x14')](0x1f4,_0x31492c[_0xe218('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index fb4d4ec..ef0f013 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 _0x2ef3=['describe','/:id','show','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','/describe','isAuthenticated'];(function(_0x46889b,_0x1a2e3b){var _0x402ff4=function(_0x25a64b){while(--_0x25a64b){_0x46889b['push'](_0x46889b['shift']());}};_0x402ff4(++_0x1a2e3b);}(_0x2ef3,0xba));var _0x32ef=function(_0x517fa7,_0x240c49){_0x517fa7=_0x517fa7-0x0;var _0x13ab6e=_0x2ef3[_0x517fa7];return _0x13ab6e;};'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')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x32ef('0x10')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4c60=['connect-timeout','Router','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','/:id','show','update','exports','multer','util','path'];(function(_0x3e1a4d,_0x413c5f){var _0x52a01f=function(_0x505f6e){while(--_0x505f6e){_0x3e1a4d['push'](_0x3e1a4d['shift']());}};_0x52a01f(++_0x413c5f);}(_0x4c60,0xc1));var _0x04c6=function(_0xe64028,_0xdfcb3){_0xe64028=_0xe64028-0x0;var _0xca3b7f=_0x4c60[_0xe64028];return _0xca3b7f;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('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(_0x04c6('0x5'));router[_0x04c6('0x6')]('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0x8')]);router[_0x04c6('0x6')](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller['describe']);router[_0x04c6('0x6')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x04c6('0xc')]);router['delete'](_0x04c6('0xa'),auth[_0x04c6('0x7')](),controller['destroy']);module[_0x04c6('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index d56607f..3bb00c8 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 _0xcdff=['BOOLEAN','DATE','INTEGER','STRING','getDataValue','endtime','setDataValue','followuptime','diff','seconds'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xcdff,0x169));var _0xfcdf=function(_0x445779,_0x4d1e77){_0x445779=_0x445779-0x0;var _0x1643fb=_0xcdff[_0x445779];return _0x1643fb;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xfcdf('0x0')]},'countbusyretry':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xfcdf('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xfcdf('0x2')]},'originatecalleridname':{'type':Sequelize[_0xfcdf('0x2')]},'calleridnum':{'type':Sequelize[_0xfcdf('0x2')]},'calleridname':{'type':Sequelize[_0xfcdf('0x2')]},'starttime':{'type':Sequelize[_0xfcdf('0x0')]},'responsetime':{'type':Sequelize[_0xfcdf('0x0')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xfcdf('0x0')]},'endtime':{'type':Sequelize[_0xfcdf('0x0')]},'ringtime':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xfcdf('0x2')]},'membername':{'type':Sequelize[_0xfcdf('0x2')]},'reason':{'type':Sequelize[_0xfcdf('0x2')]},'disposition':{'type':Sequelize[_0xfcdf('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xfcdf('0x2')]},'dispositionat':{'type':Sequelize[_0xfcdf('0x0')],'set':function(_0x1e05e5){var _0x322c9b=this[_0xfcdf('0x3')](_0xfcdf('0x4'));if(_0x322c9b&&_0x1e05e5){this[_0xfcdf('0x5')](_0xfcdf('0x6'),moment(_0x1e05e5)[_0xfcdf('0x7')](moment(_0x322c9b),_0xfcdf('0x8')));}return this[_0xfcdf('0x5')]('dispositionat',_0x1e05e5);}},'amd':{'type':Sequelize[_0xfcdf('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0xfcdf('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xfcdf('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xfcdf('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfcdf('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfcdf('0x0')]},'deleted':{'type':Sequelize[_0xfcdf('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xfcdf('0x0')]},'recallme':{'type':Sequelize[_0xfcdf('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x999e=['followuptime','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x999e,0xac));var _0xe999=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x999e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe999('0x0'));var moment=require(_0xe999('0x1'));module[_0xe999('0x2')]={'state':{'type':Sequelize[_0xe999('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xe999('0x4')]},'scheduledat':{'type':Sequelize[_0xe999('0x5')]},'countbusyretry':{'type':Sequelize[_0xe999('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe999('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe999('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe999('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xe999('0x4')]},'calleridnum':{'type':Sequelize[_0xe999('0x4')]},'calleridname':{'type':Sequelize[_0xe999('0x4')]},'starttime':{'type':Sequelize[_0xe999('0x5')]},'responsetime':{'type':Sequelize[_0xe999('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xe999('0x5')]},'endtime':{'type':Sequelize[_0xe999('0x5')]},'ringtime':{'type':Sequelize[_0xe999('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe999('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xe999('0x4')]},'campaigntype':{'type':Sequelize[_0xe999('0x4')]},'membername':{'type':Sequelize[_0xe999('0x4')]},'reason':{'type':Sequelize[_0xe999('0x4')]},'disposition':{'type':Sequelize[_0xe999('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe999('0x4')]},'dispositionat':{'type':Sequelize[_0xe999('0x5')],'set':function(_0x160590){var _0x4f759f=this[_0xe999('0x6')](_0xe999('0x7'));if(_0x4f759f&&_0x160590){this['setDataValue'](_0xe999('0x8'),moment(_0x160590)['diff'](moment(_0x4f759f),_0xe999('0x9')));}return this['setDataValue'](_0xe999('0xa'),_0x160590);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xe999('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xe999('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xe999('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xe999('0x5')]},'callback':{'type':Sequelize[_0xe999('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe999('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xe999('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xe999('0x5')]},'recallme':{'type':Sequelize[_0xe999('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xe999('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xe999('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe999('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe999('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe999('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe999('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 7707e22..053a85d 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 _0x57ca=['state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','cm_hopper','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','toString','group','moveContactsIvrCampaignHopperFinal','scheduledAt','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','from','state\x20=\x204','checkContactHopper','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','CmHopperFinal','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','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','answeringMachine','countContactsIvrCampaignHopperFinal','noAnswerContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?'];(function(_0x42b6f7,_0x3b64eb){var _0x4021f2=function(_0x58f498){while(--_0x58f498){_0x42b6f7['push'](_0x42b6f7['shift']());}};_0x4021f2(++_0x3b64eb);}(_0x57ca,0x108));var _0xa57c=function(_0x258ee3,_0x4e983b){_0x258ee3=_0x258ee3-0x0;var _0x5b2228=_0x57ca[_0x258ee3];return _0x5b2228;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':!![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')]()['then'](respondWithResult(_0x44ea0a,null))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x5082ef,_0x232675){if(_0x5082ef['body'][_0xa57c('0x42')]){delete _0x5082ef[_0xa57c('0x43')]['uniqueid'];}return db[_0xa57c('0x2a')][_0xa57c('0x3f')]({'where':{'uniqueid':_0x5082ef[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x232675,null))[_0xa57c('0x21')](saveUpdates(_0x5082ef['body'],null))[_0xa57c('0x21')](respondWithResult(_0x232675,null))[_0xa57c('0x40')](handleError(_0x232675,null));};exports[_0xa57c('0x44')]=function(_0xd57bac,_0x2e4b84,_0x5ace6d){return db[_0xa57c('0x2a')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0xd57bac['params']['id']},'attributes':[[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db['sequelize']['literal'](_0xa57c('0x47')))),_0xa57c('0x48')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x4a')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db['sequelize'][_0xa57c('0x49')](_0xa57c('0x4b')))),_0xa57c('0x4c')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xa57c('0x4d')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x4e')))),_0xa57c('0x4f')],[db['sequelize']['fn']('COUNT',db[_0xa57c('0x45')]['fn']('IF',db['sequelize'][_0xa57c('0x49')](_0xa57c('0x50')))),_0xa57c('0x51')],[db['sequelize']['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')]['literal'](_0xa57c('0x52')))),_0xa57c('0x53')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x54')))),_0xa57c('0x55')]]})[_0xa57c('0x21')](handleEntityNotFound(_0x2e4b84,null))['then'](respondWithResult(_0x2e4b84,null))[_0xa57c('0x40')](handleError(_0x2e4b84,null));};exports[_0xa57c('0x56')]=function(_0x1899ad,_0xb19d93,_0x2adcf6){return db[_0xa57c('0x2a')][_0xa57c('0x3d')]({'raw':![],'where':{'CampaignId':_0x1899ad[_0xa57c('0x3e')]['id']},'attributes':[[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x47')))),_0xa57c('0x48')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0xa57c('0x57')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x4b')))),'busyContacts'],[db[_0xa57c('0x45')]['fn']('COUNT',db[_0xa57c('0x45')]['fn']('IF',db['sequelize'][_0xa57c('0x49')]('`state`\x20=\x208,\x201,\x20null'))),_0xa57c('0x4d')],[db[_0xa57c('0x45')]['fn']('COUNT',db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x4e')))),'dropContacts'],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x50')))),_0xa57c('0x51')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x52')))),_0xa57c('0x53')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')]['literal'](_0xa57c('0x54')))),_0xa57c('0x55')]]})[_0xa57c('0x21')](handleEntityNotFound(_0xb19d93,null))['then'](respondWithResult(_0xb19d93,null))[_0xa57c('0x40')](handleError(_0xb19d93,null));};exports[_0xa57c('0x58')]=function(_0x1be631,_0x47e3d5,_0x571e10){return db[_0xa57c('0x59')][_0xa57c('0x3f')]({'where':{'id':_0x1be631[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x47e3d5,null))[_0xa57c('0x21')](function(_0x39411b){var _0x2a7aab;if(_0x39411b){_0x2a7aab=squel[_0xa57c('0x5a')]()[_0xa57c('0x5b')]('cm_hopper')[_0xa57c('0x5c')]([_0xa57c('0x5d'),'scheduledAt',_0xa57c('0x5e'),_0xa57c('0x5f'),_0xa57c('0x60'),_0xa57c('0x61'),_0xa57c('0x62')],squel[_0xa57c('0x63')]()[_0xa57c('0x64')](_0xa57c('0x65'),'phone')[_0xa57c('0x64')](_0xa57c('0x66'),'scheduledAt')[_0xa57c('0x64')](_0xa57c('0x67'),'ContactId')['field'](_0xa57c('0x68'),_0xa57c('0x5f'))[_0xa57c('0x64')](_0xa57c('0x69'),_0xa57c('0x60'))['field'](_0xa57c('0x66'),_0xa57c('0x61'))[_0xa57c('0x64')]('NOW()',_0xa57c('0x62'))['from'](_0xa57c('0x6a'))[_0xa57c('0x37')](_0xa57c('0x6b'),_0x1be631[_0xa57c('0x3e')]['id']['toString']())[_0xa57c('0x37')](_0xa57c('0x6c'),_0x1be631[_0xa57c('0x43')][_0xa57c('0x6d')]['toString']())[_0xa57c('0x37')](_0xa57c('0x6e'))[_0xa57c('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa57c('0x63')]()[_0xa57c('0x64')](_0xa57c('0x5d'))['from'](_0xa57c('0x6f'))[_0xa57c('0x37')](_0xa57c('0x6b'),_0x1be631[_0xa57c('0x3e')]['id']['toString']()))[_0xa57c('0x37')](_0xa57c('0x70'),squel['select']()[_0xa57c('0x64')](_0xa57c('0x71'))['from'](_0xa57c('0x6a'))['where'](_0xa57c('0x6b'),_0x1be631[_0xa57c('0x3e')]['id'][_0xa57c('0x72')]())[_0xa57c('0x37')]('state\x20=\x204'))[_0xa57c('0x73')](_0xa57c('0x5e')))[_0xa57c('0x72')]();return db[_0xa57c('0x45')][_0xa57c('0x2e')](_0x2a7aab);}return[];})[_0xa57c('0x21')](respondWithResult(_0x47e3d5,null))[_0xa57c('0x40')](handleError(_0x47e3d5,null));};exports[_0xa57c('0x74')]=function(_0x1129f,_0x2c4e6c,_0x46dbb1){return db['Campaign']['find']({'where':{'id':_0x1129f['params']['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x2c4e6c,null))['then'](function(_0x43c430){var _0x442dc7;if(_0x43c430){_0x442dc7=squel[_0xa57c('0x5a')]()['into'](_0xa57c('0x6f'))[_0xa57c('0x5c')]([_0xa57c('0x5d'),_0xa57c('0x75'),_0xa57c('0x5e'),_0xa57c('0x5f'),_0xa57c('0x76'),'createdAt',_0xa57c('0x62')],squel[_0xa57c('0x63')]()['field']('ANY_VALUE(calleridnum)',_0xa57c('0x5d'))[_0xa57c('0x64')]('NOW()','scheduledAt')[_0xa57c('0x64')]('ANY_VALUE(ContactId)',_0xa57c('0x5e'))[_0xa57c('0x64')]('ANY_VALUE(ListId)',_0xa57c('0x5f'))[_0xa57c('0x64')](_0xa57c('0x77'),_0xa57c('0x76'))[_0xa57c('0x64')]('NOW()',_0xa57c('0x61'))['field'](_0xa57c('0x66'),_0xa57c('0x62'))['from']('cm_hopper_final')['where'](_0xa57c('0x78'),_0x1129f['params']['id']['toString']())[_0xa57c('0x37')](_0xa57c('0x6c'),_0x1129f[_0xa57c('0x43')]['state'][_0xa57c('0x72')]())[_0xa57c('0x37')](_0xa57c('0x6e'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa57c('0x63')]()['field'](_0xa57c('0x5d'))[_0xa57c('0x79')]('cm_hopper')[_0xa57c('0x37')]('CampaignId\x20=\x20?',_0x1129f['params']['id']['toString']()))[_0xa57c('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xa57c('0x71'))[_0xa57c('0x79')]('cm_hopper_final')[_0xa57c('0x37')](_0xa57c('0x78'),_0x1129f[_0xa57c('0x3e')]['id']['toString']())[_0xa57c('0x37')](_0xa57c('0x7a')))[_0xa57c('0x73')](_0xa57c('0x5e')))['toString']();return db['sequelize'][_0xa57c('0x2e')](_0x442dc7);}return[];})['then'](respondWithResult(_0x2c4e6c,null))[_0xa57c('0x40')](handleError(_0x2c4e6c,null));};exports[_0xa57c('0x7b')]=function(_0x2cc12b,_0x4dc6ac,_0x138c4e){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x2cc12b[_0xa57c('0x43')]['VoiceQueueId'],'CampaignId':_0x2cc12b[_0xa57c('0x43')][_0xa57c('0x76')],'ContactId':_0x2cc12b['body']['ContactId']}})[_0xa57c('0x21')](handleEntityNotFound(_0x4dc6ac,null))[_0xa57c('0x21')](function(_0x50a940){if(_0x50a940){return _0x50a940;}return null;})['then'](respondWithResult(_0x4dc6ac,null))[_0xa57c('0x40')](handleError(_0x4dc6ac,null));}; \ No newline at end of file +var _0xacf4=['reject','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','intersection','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','select','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','NOW()','CampaignId\x20=\x20?','checkContactHopper','CmHopper','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x248355,_0x356c62){var _0x2ee7b1=function(_0x42504c){while(--_0x42504c){_0x248355['push'](_0x248355['shift']());}};_0x2ee7b1(++_0x356c62);}(_0xacf4,0xe7));var _0x4acf=function(_0x22cb0f,_0x37c81a){_0x22cb0f=_0x22cb0f-0x0;var _0x51317f=_0xacf4[_0x22cb0f];return _0x51317f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['CmHopperFinal'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':!![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['CmHopperFinal']['describe']()[_0x4acf('0x21')](respondWithResult(_0x2d946c,null))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x33bc52,_0x287406){if(_0x33bc52[_0x4acf('0x47')][_0x4acf('0x48')]){delete _0x33bc52[_0x4acf('0x47')][_0x4acf('0x48')];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'uniqueid':_0x33bc52[_0x4acf('0x41')]['id']}})['then'](handleEntityNotFound(_0x287406,null))[_0x4acf('0x21')](saveUpdates(_0x33bc52[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x287406,null))[_0x4acf('0x3f')](handleError(_0x287406,null));};exports[_0x4acf('0x49')]=function(_0x3cf54a,_0x2785b9,_0x2d0561){return db[_0x4acf('0x29')][_0x4acf('0x3d')]({'raw':![],'where':{'VoiceQueueId':_0x3cf54a[_0x4acf('0x41')]['id']},'attributes':[[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')]('`state`\x20=\x200,\x201,\x20null'))),_0x4acf('0x4d')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x4e')))),_0x4acf('0x4f')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x50')))),'busyContacts'],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x51')))),_0x4acf('0x52')],[db['sequelize']['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x4acf('0x53')],[db['sequelize']['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x54')))),_0x4acf('0x55')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')]('`state`\x20=\x2022,\x201,\x20null'))),_0x4acf('0x56')],[db[_0x4acf('0x4a')]['fn']('COUNT',db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')]['literal'](_0x4acf('0x57')))),_0x4acf('0x58')]]})[_0x4acf('0x21')](handleEntityNotFound(_0x2785b9,null))['then'](respondWithResult(_0x2785b9,null))[_0x4acf('0x3f')](handleError(_0x2785b9,null));};exports[_0x4acf('0x59')]=function(_0xb5bd81,_0x452ee6,_0x54b093){return db[_0x4acf('0x29')][_0x4acf('0x3d')]({'raw':![],'where':{'CampaignId':_0xb5bd81[_0x4acf('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x5a')))),_0x4acf('0x4d')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x4e')))),_0x4acf('0x4f')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x50')))),_0x4acf('0x5b')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x4acf('0x52')],[db['sequelize']['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x4acf('0x5c')))),_0x4acf('0x53')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db['sequelize'][_0x4acf('0x4c')](_0x4acf('0x5d')))),_0x4acf('0x56')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db['sequelize'][_0x4acf('0x4c')]('`state`\x20=\x2019,\x201,\x20null'))),_0x4acf('0x58')]]})[_0x4acf('0x21')](handleEntityNotFound(_0x452ee6,null))[_0x4acf('0x21')](respondWithResult(_0x452ee6,null))[_0x4acf('0x3f')](handleError(_0x452ee6,null));};exports[_0x4acf('0x5e')]=function(_0x173655,_0x1f2dbc,_0xc0d942){return db[_0x4acf('0x5f')][_0x4acf('0x45')]({'where':{'id':_0x173655[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x1f2dbc,null))['then'](function(_0x11f356){var _0xacca91;if(_0x11f356){_0xacca91=squel[_0x4acf('0x60')]()[_0x4acf('0x61')](_0x4acf('0x62'))[_0x4acf('0x63')]([_0x4acf('0x64'),_0x4acf('0x65'),_0x4acf('0x66'),_0x4acf('0x67'),'VoiceQueueId',_0x4acf('0x68'),_0x4acf('0x69')],squel['select']()[_0x4acf('0x6a')](_0x4acf('0x6b'),'phone')[_0x4acf('0x6a')]('NOW()','scheduledAt')[_0x4acf('0x6a')]('ANY_VALUE(ContactId)',_0x4acf('0x66'))[_0x4acf('0x6a')](_0x4acf('0x6c'),_0x4acf('0x67'))['field'](_0x4acf('0x6d'),_0x4acf('0x6e'))['field']('NOW()','createdAt')[_0x4acf('0x6a')]('NOW()',_0x4acf('0x69'))[_0x4acf('0x6f')](_0x4acf('0x70'))['where'](_0x4acf('0x71'),_0x173655[_0x4acf('0x41')]['id']['toString']())[_0x4acf('0x35')](_0x4acf('0x72'),_0x173655['body'][_0x4acf('0x73')][_0x4acf('0x74')]())[_0x4acf('0x35')](_0x4acf('0x75'))[_0x4acf('0x35')](_0x4acf('0x76'),squel['select']()[_0x4acf('0x6a')]('phone')[_0x4acf('0x6f')](_0x4acf('0x62'))['where']('VoiceQueueId\x20=\x20?',_0x173655['params']['id'][_0x4acf('0x74')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x4acf('0x6a')]('calleridnum')[_0x4acf('0x6f')](_0x4acf('0x70'))[_0x4acf('0x35')](_0x4acf('0x71'),_0x173655[_0x4acf('0x41')]['id']['toString']())['where'](_0x4acf('0x77')))[_0x4acf('0x78')](_0x4acf('0x66')))[_0x4acf('0x74')]();return db[_0x4acf('0x4a')]['query'](_0xacca91);}return[];})[_0x4acf('0x21')](respondWithResult(_0x1f2dbc,null))[_0x4acf('0x3f')](handleError(_0x1f2dbc,null));};exports[_0x4acf('0x79')]=function(_0x453c6d,_0x1a82e7,_0x3d02c7){return db[_0x4acf('0x7a')]['find']({'where':{'id':_0x453c6d[_0x4acf('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a82e7,null))[_0x4acf('0x21')](function(_0x1bbe6d){var _0x2a36e2;if(_0x1bbe6d){_0x2a36e2=squel[_0x4acf('0x60')]()[_0x4acf('0x61')]('cm_hopper')[_0x4acf('0x63')](['phone',_0x4acf('0x65'),_0x4acf('0x66'),'ListId',_0x4acf('0x7b'),_0x4acf('0x68'),_0x4acf('0x69')],squel[_0x4acf('0x7c')]()[_0x4acf('0x6a')]('ANY_VALUE(calleridnum)',_0x4acf('0x64'))['field']('NOW()',_0x4acf('0x65'))[_0x4acf('0x6a')](_0x4acf('0x7d'),_0x4acf('0x66'))['field']('ANY_VALUE(ListId)',_0x4acf('0x67'))[_0x4acf('0x6a')](_0x4acf('0x7e'),_0x4acf('0x7b'))[_0x4acf('0x6a')](_0x4acf('0x7f'),_0x4acf('0x68'))[_0x4acf('0x6a')]('NOW()','updatedAt')[_0x4acf('0x6f')](_0x4acf('0x70'))[_0x4acf('0x35')](_0x4acf('0x80'),_0x453c6d[_0x4acf('0x41')]['id'][_0x4acf('0x74')]())[_0x4acf('0x35')](_0x4acf('0x72'),_0x453c6d[_0x4acf('0x47')]['state'][_0x4acf('0x74')]())[_0x4acf('0x35')](_0x4acf('0x75'))[_0x4acf('0x35')](_0x4acf('0x76'),squel[_0x4acf('0x7c')]()[_0x4acf('0x6a')](_0x4acf('0x64'))[_0x4acf('0x6f')](_0x4acf('0x62'))[_0x4acf('0x35')](_0x4acf('0x80'),_0x453c6d[_0x4acf('0x41')]['id']['toString']()))[_0x4acf('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x4acf('0x7c')]()[_0x4acf('0x6a')]('calleridnum')[_0x4acf('0x6f')](_0x4acf('0x70'))['where']('CampaignId\x20=\x20?',_0x453c6d[_0x4acf('0x41')]['id'][_0x4acf('0x74')]())['where']('state\x20=\x204'))[_0x4acf('0x78')](_0x4acf('0x66')))[_0x4acf('0x74')]();return db[_0x4acf('0x4a')]['query'](_0x2a36e2);}return[];})[_0x4acf('0x21')](respondWithResult(_0x1a82e7,null))[_0x4acf('0x3f')](handleError(_0x1a82e7,null));};exports[_0x4acf('0x81')]=function(_0x34e1ea,_0x43e9bf,_0x367ad4){return db[_0x4acf('0x82')]['findOne']({'where':{'VoiceQueueId':_0x34e1ea[_0x4acf('0x47')][_0x4acf('0x6e')],'CampaignId':_0x34e1ea[_0x4acf('0x47')]['CampaignId'],'ContactId':_0x34e1ea[_0x4acf('0x47')][_0x4acf('0x66')]}})[_0x4acf('0x21')](handleEntityNotFound(_0x43e9bf,null))[_0x4acf('0x21')](function(_0x37ffab){if(_0x37ffab){return _0x37ffab;}return null;})[_0x4acf('0x21')](respondWithResult(_0x43e9bf,null))[_0x4acf('0x3f')](handleError(_0x43e9bf,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 431bdda..49bbada 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 _0xeb95=['exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmHopperFinal.attributes'];(function(_0x259a87,_0x1a2113){var _0x35017e=function(_0x2178da){while(--_0x2178da){_0x259a87['push'](_0x259a87['shift']());}};_0x35017e(++_0x1a2113);}(_0xeb95,0x155));var _0x5eb9=function(_0x28e15e,_0x67565){_0x28e15e=_0x28e15e-0x0;var _0x104c41=_0xeb95[_0x28e15e];return _0x104c41;};'use strict';var _=require(_0x5eb9('0x0'));var util=require(_0x5eb9('0x1'));var logger=require(_0x5eb9('0x2'))(_0x5eb9('0x3'));var moment=require(_0x5eb9('0x4'));var BPromise=require(_0x5eb9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5eb9('0x6'));var rimraf=require('rimraf');var config=require(_0x5eb9('0x7'));var attributes=require(_0x5eb9('0x8'));module[_0x5eb9('0x9')]=function(_0x4e4852,_0x5abd38){return _0x4e4852[_0x5eb9('0xa')]('CmHopperFinal',attributes,{'tableName':_0x5eb9('0xb'),'paranoid':![],'indexes':[{'name':_0x5eb9('0xc'),'fields':['calleridnum']},{'name':_0x5eb9('0xd'),'fields':[_0x5eb9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6af4=['exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','bluebird','request-promise','path','./cmHopperFinal.attributes'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0x6af4,0x68));var _0x46af=function(_0x10437d,_0x79c80f){_0x10437d=_0x10437d-0x0;var _0x457365=_0x6af4[_0x10437d];return _0x457365;};'use strict';var _=require(_0x46af('0x0'));var util=require(_0x46af('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x46af('0x2'));var rp=require(_0x46af('0x3'));var fs=require('fs');var path=require(_0x46af('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x46af('0x5'));module[_0x46af('0x6')]=function(_0xff6a31,_0x4d0b3a){return _0xff6a31['define'](_0x46af('0x7'),attributes,{'tableName':_0x46af('0x8'),'paranoid':![],'indexes':[{'name':_0x46af('0x9'),'fields':[_0x46af('0x9')]},{'name':'uniqueid','fields':[_0x46af('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index ce9ce00..68e89d9 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(_0x14fe13,_0x48b516){var _0x29d465=function(_0x38269a){while(--_0x38269a){_0x14fe13['push'](_0x14fe13['shift']());}};_0x29d465(++_0x48b516);}(_0xb10b,0x12a));var _0xbb10=function(_0x443ec0,_0x186140){_0x443ec0=_0x443ec0-0x0;var _0x227249=_0xb10b[_0x443ec0];return _0x227249;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3b48aa,_0x1a1695){var _0xe8e2fd=function(_0xaf0ee){while(--_0xaf0ee){_0x3b48aa['push'](_0x3b48aa['shift']());}};_0xe8e2fd(++_0x1a1695);}(_0x7a54,0x106));var _0x47a5=function(_0x48a1e1,_0x23b713){_0x48a1e1=_0x48a1e1-0x0;var _0xc7ad70=_0x7a54[_0x48a1e1];return _0xc7ad70;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 4c9e452..9dbac78 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 _0x065e=['put','update','exports','multer','express','Router','fs-extra','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','post','moveContactsIvrCampaignHopperFinal','/checkContactHopper'];(function(_0x5d07ce,_0x1b0315){var _0x91c4d3=function(_0xfac0ab){while(--_0xfac0ab){_0x5d07ce['push'](_0x5d07ce['shift']());}};_0x91c4d3(++_0x1b0315);}(_0x065e,0x1a7));var _0xe065=function(_0x4acdd2,_0x5b40d2){_0x4acdd2=_0x4acdd2-0x0;var _0xeeac93=_0x065e[_0x4acdd2];return _0xeeac93;};'use strict';var multer=require(_0xe065('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe065('0x1'));var router=express[_0xe065('0x2')]();var fs_extra=require(_0xe065('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe065('0x4'));var controller=require(_0xe065('0x5'));router['get']('/',auth[_0xe065('0x6')](),controller[_0xe065('0x7')]);router[_0xe065('0x8')]('/describe',auth[_0xe065('0x6')](),controller['describe']);router[_0xe065('0x8')](_0xe065('0x9'),auth[_0xe065('0x6')](),controller[_0xe065('0xa')]);router[_0xe065('0x8')]('/voice/queue/countAttributes/:id',auth[_0xe065('0x6')](),controller[_0xe065('0xb')]);router[_0xe065('0x8')](_0xe065('0xc'),auth[_0xe065('0x6')](),controller[_0xe065('0xd')]);router['post']('/voice/queue/moveContacts/:id',auth[_0xe065('0x6')](),controller[_0xe065('0xe')]);router[_0xe065('0xf')]('/voice/campaign/moveContacts/:id',auth[_0xe065('0x6')](),controller[_0xe065('0x10')]);router[_0xe065('0xf')](_0xe065('0x11'),auth[_0xe065('0x6')](),controller['checkContactHopper']);router[_0xe065('0x12')](_0xe065('0x9'),auth[_0xe065('0x6')](),controller[_0xe065('0x13')]);module[_0xe065('0x14')]=router; \ No newline at end of file +var _0x8a85=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','/describe','isAuthenticated','describe','show','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post'];(function(_0x3f49ae,_0x3373e){var _0x5a901e=function(_0x505805){while(--_0x505805){_0x3f49ae['push'](_0x3f49ae['shift']());}};_0x5a901e(++_0x3373e);}(_0x8a85,0x64));var _0x58a8=function(_0x43fa2b,_0x1150bc){_0x43fa2b=_0x43fa2b-0x0;var _0x7830c9=_0x8a85[_0x43fa2b];return _0x7830c9;};'use strict';var multer=require('multer');var util=require(_0x58a8('0x0'));var path=require('path');var timeout=require(_0x58a8('0x1'));var express=require(_0x58a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x58a8('0x3'));var interaction=require(_0x58a8('0x4'));var config=require(_0x58a8('0x5'));var controller=require(_0x58a8('0x6'));router[_0x58a8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x58a8('0x7')](_0x58a8('0x8'),auth[_0x58a8('0x9')](),controller[_0x58a8('0xa')]);router[_0x58a8('0x7')]('/:id',auth[_0x58a8('0x9')](),controller[_0x58a8('0xb')]);router[_0x58a8('0x7')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router[_0x58a8('0x7')](_0x58a8('0xc'),auth[_0x58a8('0x9')](),controller[_0x58a8('0xd')]);router[_0x58a8('0xe')](_0x58a8('0xf'),auth[_0x58a8('0x9')](),controller[_0x58a8('0x10')]);router['post'](_0x58a8('0x11'),auth[_0x58a8('0x9')](),controller[_0x58a8('0x12')]);router[_0x58a8('0xe')]('/checkContactHopper',auth[_0x58a8('0x9')](),controller[_0x58a8('0x13')]);router[_0x58a8('0x14')]('/:id',auth[_0x58a8('0x9')](),controller[_0x58a8('0x15')]);module[_0x58a8('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 5a99f94..492055b 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 _0xc1fc=['STRING','BOOLEAN','exports','INTEGER','DATE'];(function(_0x380df2,_0x281a15){var _0x47f4df=function(_0x132241){while(--_0x132241){_0x380df2['push'](_0x380df2['shift']());}};_0x47f4df(++_0x281a15);}(_0xc1fc,0x93));var _0xcc1f=function(_0x1fa078,_0x635078){_0x1fa078=_0x1fa078-0x0;var _0x4732ca=_0xc1fc[_0x1fa078];return _0x4732ca;};'use strict';var Sequelize=require('sequelize');module[_0xcc1f('0x0')]={'state':{'type':Sequelize[_0xcc1f('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xcc1f('0x2')]},'countbusyretry':{'type':Sequelize[_0xcc1f('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcc1f('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcc1f('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xcc1f('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xcc1f('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xcc1f('0x3')]},'originatecalleridname':{'type':Sequelize[_0xcc1f('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xcc1f('0x2')]},'responsetime':{'type':Sequelize[_0xcc1f('0x2')]},'answertime':{'type':Sequelize[_0xcc1f('0x2')]},'droptime':{'type':Sequelize[_0xcc1f('0x2')]},'endtime':{'type':Sequelize[_0xcc1f('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xcc1f('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xcc1f('0x3')]},'campaign':{'type':Sequelize[_0xcc1f('0x3')]},'campaigntype':{'type':Sequelize[_0xcc1f('0x3')]},'membername':{'type':Sequelize[_0xcc1f('0x3')]},'reason':{'type':Sequelize[_0xcc1f('0x3')]},'amd':{'type':Sequelize[_0xcc1f('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xcc1f('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xcc1f('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xcc1f('0x2')]},'recallme':{'type':Sequelize[_0xcc1f('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xcc1f('0x2')]},'edited':{'type':Sequelize[_0xcc1f('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xcc1f('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcc1f('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xcc1f('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcc1f('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xcc1f('0x3')]}}; \ No newline at end of file +var _0x6588=['STRING','DATE','BOOLEAN','sequelize','INTEGER'];(function(_0x16e455,_0x5eb4f2){var _0x49d816=function(_0x3dde25){while(--_0x3dde25){_0x16e455['push'](_0x16e455['shift']());}};_0x49d816(++_0x5eb4f2);}(_0x6588,0xc1));var _0x8658=function(_0x87506e,_0x5680ec){_0x87506e=_0x87506e-0x0;var _0x5496a4=_0x6588[_0x87506e];return _0x5496a4;};'use strict';var Sequelize=require(_0x8658('0x0'));module['exports']={'state':{'type':Sequelize[_0x8658('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x8658('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8658('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8658('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8658('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x8658('0x2')]},'originatecalleridname':{'type':Sequelize[_0x8658('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8658('0x2')]},'starttime':{'type':Sequelize[_0x8658('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x8658('0x3')]},'droptime':{'type':Sequelize[_0x8658('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8658('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8658('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8658('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x8658('0x2')]},'membername':{'type':Sequelize[_0x8658('0x2')]},'reason':{'type':Sequelize[_0x8658('0x2')]},'amd':{'type':Sequelize[_0x8658('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x8658('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8658('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x8658('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x8658('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x8658('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8658('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8658('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8658('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8658('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index a34ba7f..7875cdf 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 _0x2877=['index','map','CmHopperHistory','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','describe','update','uniqueid','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','error','stack','name'];(function(_0x112d30,_0x39fdbd){var _0x157ef8=function(_0x1494ce){while(--_0x1494ce){_0x112d30['push'](_0x112d30['shift']());}};_0x157ef8(++_0x39fdbd);}(_0x2877,0x133));var _0x7287=function(_0x5b1525,_0x1c97c5){_0x5b1525=_0x5b1525-0x0;var _0x5b16c8=_0x2877[_0x5b1525];return _0x5b16c8;};'use strict';var emlformat=require(_0x7287('0x0'));var rimraf=require(_0x7287('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7287('0x2'));var moment=require('moment');var BPromise=require(_0x7287('0x3'));var Mustache=require('mustache');var util=require(_0x7287('0x4'));var path=require(_0x7287('0x5'));var sox=require(_0x7287('0x6'));var csv=require(_0x7287('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7287('0x8'));var _=require(_0x7287('0x9'));var squel=require(_0x7287('0xa'));var crypto=require(_0x7287('0xb'));var jsforce=require(_0x7287('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7287('0x7'));var querystring=require(_0x7287('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7287('0xe'));var hardwareService=require(_0x7287('0xf'));var logger=require(_0x7287('0x10'))(_0x7287('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7287('0x12'))['db'];function respondWithStatusCode(_0x11952e,_0x40bdc6){_0x40bdc6=_0x40bdc6||0xcc;return function(_0x3e4b74){if(_0x3e4b74){return _0x11952e[_0x7287('0x13')](_0x40bdc6);}return _0x11952e[_0x7287('0x14')](_0x40bdc6)[_0x7287('0x15')]();};}function respondWithResult(_0x15e59a,_0x2e3532){_0x2e3532=_0x2e3532||0xc8;return function(_0x310898){if(_0x310898){return _0x15e59a[_0x7287('0x14')](_0x2e3532)['json'](_0x310898);}};}function respondWithFilteredResult(_0x309dd1,_0x2a8ea9){return function(_0x2d67f6){if(_0x2d67f6){var _0x67edad=typeof _0x2a8ea9[_0x7287('0x16')]===_0x7287('0x17')&&typeof _0x2a8ea9[_0x7287('0x18')]==='undefined';var _0x2c7e98=_0x2d67f6[_0x7287('0x19')];var _0x5dbf0b=_0x67edad?0x0:_0x2a8ea9['offset'];var _0x3b2fb0=_0x67edad?_0x2d67f6['count']:_0x2a8ea9[_0x7287('0x16')]+_0x2a8ea9[_0x7287('0x18')];var _0x470f8a;if(_0x3b2fb0>=_0x2c7e98){_0x3b2fb0=_0x2c7e98;_0x470f8a=0xc8;}else{_0x470f8a=0xce;}_0x309dd1[_0x7287('0x14')](_0x470f8a);return _0x309dd1[_0x7287('0x1a')](_0x7287('0x1b'),_0x5dbf0b+'-'+_0x3b2fb0+'/'+_0x2c7e98)['json'](_0x2d67f6);}return null;};}function patchUpdates(_0x55de7b){return function(_0x152dab){try{jsonpatch['apply'](_0x152dab,_0x55de7b,!![]);}catch(_0x1fdfb6){return BPromise['reject'](_0x1fdfb6);}return _0x152dab[_0x7287('0x1c')]();};}function saveUpdates(_0x2ac4cf,_0x1c5ec1){return function(_0x307f29){if(_0x307f29){return _0x307f29['update'](_0x2ac4cf)[_0x7287('0x1d')](function(_0x3ff4a2){return _0x3ff4a2;});}return null;};}function removeEntity(_0x3858ad,_0x4c0fd7){return function(_0x5f5dec){if(_0x5f5dec){return _0x5f5dec['destroy']()[_0x7287('0x1d')](function(){_0x3858ad[_0x7287('0x14')](0xcc)[_0x7287('0x15')]();});}};}function handleEntityNotFound(_0x4a76bf,_0x42a657){return function(_0x5d4d34){if(!_0x5d4d34){_0x4a76bf[_0x7287('0x13')](0x194);}return _0x5d4d34;};}function handleError(_0x25ab7a,_0x20068f){_0x20068f=_0x20068f||0x1f4;return function(_0x26431f){logger[_0x7287('0x1e')](_0x26431f[_0x7287('0x1f')]);if(_0x26431f['name']){delete _0x26431f[_0x7287('0x20')];}_0x25ab7a[_0x7287('0x14')](_0x20068f)['send'](_0x26431f);};}exports[_0x7287('0x21')]=function(_0x2a8fa6,_0x2719f1){var _0x37c2e9={},_0x97bf2a={},_0x17e126={'count':0x0,'rows':[]};var _0x59f5ae=_[_0x7287('0x22')](db[_0x7287('0x23')][_0x7287('0x24')],function(_0xcabee9){return{'name':_0xcabee9[_0x7287('0x25')],'type':_0xcabee9[_0x7287('0x26')][_0x7287('0x27')]};});_0x97bf2a['model']=_['map'](_0x59f5ae,_0x7287('0x20'));_0x97bf2a['query']=_[_0x7287('0x28')](_0x2a8fa6[_0x7287('0x29')]);_0x97bf2a[_0x7287('0x2a')]=_[_0x7287('0x2b')](_0x97bf2a[_0x7287('0x2c')],_0x97bf2a['query']);_0x37c2e9[_0x7287('0x2d')]=_[_0x7287('0x2b')](_0x97bf2a[_0x7287('0x2c')],qs[_0x7287('0x2e')](_0x2a8fa6['query'][_0x7287('0x2e')]));_0x37c2e9[_0x7287('0x2d')]=_0x37c2e9[_0x7287('0x2d')]['length']?_0x37c2e9[_0x7287('0x2d')]:_0x97bf2a['model'];if(!_0x2a8fa6['query'][_0x7287('0x2f')](_0x7287('0x30'))){_0x37c2e9[_0x7287('0x18')]=qs[_0x7287('0x18')](_0x2a8fa6[_0x7287('0x29')][_0x7287('0x18')]);_0x37c2e9[_0x7287('0x16')]=qs[_0x7287('0x16')](_0x2a8fa6[_0x7287('0x29')][_0x7287('0x16')]);}_0x37c2e9[_0x7287('0x31')]=qs['sort'](_0x2a8fa6[_0x7287('0x29')]['sort']);_0x37c2e9[_0x7287('0x32')]=qs[_0x7287('0x2a')](_[_0x7287('0x33')](_0x2a8fa6[_0x7287('0x29')],_0x97bf2a[_0x7287('0x2a')]),_0x59f5ae);if(_0x2a8fa6[_0x7287('0x29')][_0x7287('0x34')]){_0x37c2e9['where']=_[_0x7287('0x35')](_0x37c2e9[_0x7287('0x32')],{'$or':_[_0x7287('0x22')](_0x59f5ae,function(_0x1e93a1){if(_0x1e93a1[_0x7287('0x26')]!==_0x7287('0x36')){var _0x3ee96e={};_0x3ee96e[_0x1e93a1['name']]={'$like':'%'+_0x2a8fa6[_0x7287('0x29')][_0x7287('0x34')]+'%'};return _0x3ee96e;}})});}_0x37c2e9=_[_0x7287('0x35')]({},_0x37c2e9,_0x2a8fa6[_0x7287('0x37')]);var _0x540a38={'where':_0x37c2e9[_0x7287('0x32')]};return db[_0x7287('0x23')][_0x7287('0x19')](_0x540a38)[_0x7287('0x1d')](function(_0xd7181f){_0x17e126[_0x7287('0x19')]=_0xd7181f;if(_0x2a8fa6[_0x7287('0x29')][_0x7287('0x38')]){_0x37c2e9[_0x7287('0x39')]=[{'all':!![]}];}return db[_0x7287('0x23')][_0x7287('0x3a')](_0x37c2e9);})['then'](function(_0x287614){_0x17e126[_0x7287('0x3b')]=_0x287614;return _0x17e126;})['then'](respondWithFilteredResult(_0x2719f1,_0x37c2e9))[_0x7287('0x3c')](handleError(_0x2719f1,null));};exports[_0x7287('0x3d')]=function(_0x2def7a,_0x23e472){var _0x4e914f={'raw':!![],'where':{'id':_0x2def7a[_0x7287('0x3e')]['id']}},_0x1ef00d={};_0x1ef00d[_0x7287('0x2c')]=_[_0x7287('0x28')](db[_0x7287('0x23')][_0x7287('0x24')]);_0x1ef00d[_0x7287('0x29')]=_[_0x7287('0x28')](_0x2def7a[_0x7287('0x29')]);_0x1ef00d[_0x7287('0x2a')]=_[_0x7287('0x2b')](_0x1ef00d[_0x7287('0x2c')],_0x1ef00d[_0x7287('0x29')]);_0x4e914f['attributes']=_['intersection'](_0x1ef00d[_0x7287('0x2c')],qs['fields'](_0x2def7a['query']['fields']));_0x4e914f[_0x7287('0x2d')]=_0x4e914f[_0x7287('0x2d')]['length']?_0x4e914f['attributes']:_0x1ef00d[_0x7287('0x2c')];if(_0x2def7a[_0x7287('0x29')][_0x7287('0x38')]){_0x4e914f[_0x7287('0x39')]=[{'all':!![]}];}_0x4e914f=_['merge']({},_0x4e914f,_0x2def7a['options']);return db[_0x7287('0x23')]['find'](_0x4e914f)[_0x7287('0x1d')](handleEntityNotFound(_0x23e472,null))[_0x7287('0x1d')](respondWithResult(_0x23e472,null))[_0x7287('0x3c')](handleError(_0x23e472,null));};exports[_0x7287('0x3f')]=function(_0x4aa806,_0x5af38c){return db['CmHopperHistory'][_0x7287('0x3f')](_0x4aa806[_0x7287('0x40')],{})[_0x7287('0x1d')](respondWithResult(_0x5af38c,0xc9))['catch'](handleError(_0x5af38c,null));};exports[_0x7287('0x41')]=function(_0x27926b,_0x4c160f){return db[_0x7287('0x23')]['describe']()['then'](respondWithResult(_0x4c160f,null))[_0x7287('0x3c')](handleError(_0x4c160f,null));};exports[_0x7287('0x42')]=function(_0xe517cb,_0x56b7a6){if(_0xe517cb[_0x7287('0x40')][_0x7287('0x43')]){delete _0xe517cb[_0x7287('0x40')][_0x7287('0x43')];}return db[_0x7287('0x23')]['find']({'where':{'uniqueid':_0xe517cb[_0x7287('0x3e')]['id']}})[_0x7287('0x1d')](handleEntityNotFound(_0x56b7a6,null))[_0x7287('0x1d')](saveUpdates(_0xe517cb[_0x7287('0x40')],null))[_0x7287('0x1d')](respondWithResult(_0x56b7a6,null))[_0x7287('0x3c')](handleError(_0x56b7a6,null));}; \ No newline at end of file +var _0x08f4=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','keys','include','find','create','body','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','intersection'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x08f4,0xfe));var _0x408f=function(_0x7a32f5,_0x3dac72){_0x7a32f5=_0x7a32f5-0x0;var _0x2111cc=_0x08f4[_0x7a32f5];return _0x2111cc;};'use strict';var emlformat=require(_0x408f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x408f('0x1'));var jsonpatch=require(_0x408f('0x2'));var rp=require(_0x408f('0x3'));var moment=require(_0x408f('0x4'));var BPromise=require(_0x408f('0x5'));var Mustache=require(_0x408f('0x6'));var util=require('util');var path=require(_0x408f('0x7'));var sox=require(_0x408f('0x8'));var csv=require(_0x408f('0x9'));var ejs=require(_0x408f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x408f('0xb'));var squel=require(_0x408f('0xc'));var crypto=require(_0x408f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x408f('0xe'));var toCsv=require(_0x408f('0x9'));var querystring=require(_0x408f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x408f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x408f('0x11'));var logger=require(_0x408f('0x12'))(_0x408f('0x13'));var utils=require('../../config/utils');var config=require(_0x408f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x408f('0x15'))['db'];function respondWithStatusCode(_0x1c161b,_0x237919){_0x237919=_0x237919||0xcc;return function(_0x4d3467){if(_0x4d3467){return _0x1c161b[_0x408f('0x16')](_0x237919);}return _0x1c161b[_0x408f('0x17')](_0x237919)[_0x408f('0x18')]();};}function respondWithResult(_0x6bf573,_0x4c58cb){_0x4c58cb=_0x4c58cb||0xc8;return function(_0x3d3b67){if(_0x3d3b67){return _0x6bf573['status'](_0x4c58cb)['json'](_0x3d3b67);}};}function respondWithFilteredResult(_0x2036c7,_0x324e2e){return function(_0x5ed277){if(_0x5ed277){var _0x556e4e=typeof _0x324e2e['offset']===_0x408f('0x19')&&typeof _0x324e2e[_0x408f('0x1a')]===_0x408f('0x19');var _0x395310=_0x5ed277[_0x408f('0x1b')];var _0x4ead88=_0x556e4e?0x0:_0x324e2e[_0x408f('0x1c')];var _0x5cea39=_0x556e4e?_0x5ed277[_0x408f('0x1b')]:_0x324e2e[_0x408f('0x1c')]+_0x324e2e[_0x408f('0x1a')];var _0x2075a2;if(_0x5cea39>=_0x395310){_0x5cea39=_0x395310;_0x2075a2=0xc8;}else{_0x2075a2=0xce;}_0x2036c7[_0x408f('0x17')](_0x2075a2);return _0x2036c7[_0x408f('0x1d')](_0x408f('0x1e'),_0x4ead88+'-'+_0x5cea39+'/'+_0x395310)[_0x408f('0x1f')](_0x5ed277);}return null;};}function patchUpdates(_0x1fcd74){return function(_0x14e5bf){try{jsonpatch[_0x408f('0x20')](_0x14e5bf,_0x1fcd74,!![]);}catch(_0x1c9f69){return BPromise[_0x408f('0x21')](_0x1c9f69);}return _0x14e5bf[_0x408f('0x22')]();};}function saveUpdates(_0x2cfbb5,_0x5e27c3){return function(_0x5e511b){if(_0x5e511b){return _0x5e511b[_0x408f('0x23')](_0x2cfbb5)[_0x408f('0x24')](function(_0x29b003){return _0x29b003;});}return null;};}function removeEntity(_0x2881e1,_0x18014f){return function(_0x5233bc){if(_0x5233bc){return _0x5233bc[_0x408f('0x25')]()[_0x408f('0x24')](function(){_0x2881e1[_0x408f('0x17')](0xcc)[_0x408f('0x18')]();});}};}function handleEntityNotFound(_0x373428,_0x473230){return function(_0x288c81){if(!_0x288c81){_0x373428[_0x408f('0x16')](0x194);}return _0x288c81;};}function handleError(_0x2464f8,_0x5d5723){_0x5d5723=_0x5d5723||0x1f4;return function(_0x156be0){logger['error'](_0x156be0[_0x408f('0x26')]);if(_0x156be0[_0x408f('0x27')]){delete _0x156be0['name'];}_0x2464f8[_0x408f('0x17')](_0x5d5723)[_0x408f('0x28')](_0x156be0);};}exports['index']=function(_0x381646,_0x47cecc){var _0x255eb6={},_0x235bff={},_0x43abee={'count':0x0,'rows':[]};var _0x45188d=_[_0x408f('0x29')](db[_0x408f('0x2a')][_0x408f('0x2b')],function(_0x81f7f7){return{'name':_0x81f7f7[_0x408f('0x2c')],'type':_0x81f7f7[_0x408f('0x2d')][_0x408f('0x2e')]};});_0x235bff[_0x408f('0x2f')]=_['map'](_0x45188d,_0x408f('0x27'));_0x235bff[_0x408f('0x30')]=_['keys'](_0x381646[_0x408f('0x30')]);_0x235bff['filters']=_[_0x408f('0x31')](_0x235bff[_0x408f('0x2f')],_0x235bff['query']);_0x255eb6[_0x408f('0x32')]=_[_0x408f('0x31')](_0x235bff[_0x408f('0x2f')],qs[_0x408f('0x33')](_0x381646[_0x408f('0x30')][_0x408f('0x33')]));_0x255eb6[_0x408f('0x32')]=_0x255eb6[_0x408f('0x32')][_0x408f('0x34')]?_0x255eb6[_0x408f('0x32')]:_0x235bff[_0x408f('0x2f')];if(!_0x381646[_0x408f('0x30')][_0x408f('0x35')](_0x408f('0x36'))){_0x255eb6['limit']=qs[_0x408f('0x1a')](_0x381646[_0x408f('0x30')][_0x408f('0x1a')]);_0x255eb6[_0x408f('0x1c')]=qs[_0x408f('0x1c')](_0x381646[_0x408f('0x30')]['offset']);}_0x255eb6[_0x408f('0x37')]=qs[_0x408f('0x38')](_0x381646['query'][_0x408f('0x38')]);_0x255eb6[_0x408f('0x39')]=qs[_0x408f('0x3a')](_[_0x408f('0x3b')](_0x381646[_0x408f('0x30')],_0x235bff[_0x408f('0x3a')]),_0x45188d);if(_0x381646[_0x408f('0x30')][_0x408f('0x3c')]){_0x255eb6[_0x408f('0x39')]=_['merge'](_0x255eb6[_0x408f('0x39')],{'$or':_[_0x408f('0x29')](_0x45188d,function(_0x54d871){if(_0x54d871['type']!==_0x408f('0x3d')){var _0x5d5afe={};_0x5d5afe[_0x54d871[_0x408f('0x27')]]={'$like':'%'+_0x381646[_0x408f('0x30')]['filter']+'%'};return _0x5d5afe;}})});}_0x255eb6=_[_0x408f('0x3e')]({},_0x255eb6,_0x381646[_0x408f('0x3f')]);var _0x3f2f97={'where':_0x255eb6['where']};return db['CmHopperHistory'][_0x408f('0x1b')](_0x3f2f97)[_0x408f('0x24')](function(_0x461985){_0x43abee['count']=_0x461985;if(_0x381646[_0x408f('0x30')][_0x408f('0x40')]){_0x255eb6['include']=[{'all':!![]}];}return db[_0x408f('0x2a')][_0x408f('0x41')](_0x255eb6);})[_0x408f('0x24')](function(_0x28c26e){_0x43abee[_0x408f('0x42')]=_0x28c26e;return _0x43abee;})['then'](respondWithFilteredResult(_0x47cecc,_0x255eb6))[_0x408f('0x43')](handleError(_0x47cecc,null));};exports['show']=function(_0x176df3,_0x45a950){var _0x46fd7b={'raw':!![],'where':{'id':_0x176df3[_0x408f('0x44')]['id']}},_0x4a8cee={};_0x4a8cee[_0x408f('0x2f')]=_[_0x408f('0x45')](db[_0x408f('0x2a')][_0x408f('0x2b')]);_0x4a8cee[_0x408f('0x30')]=_[_0x408f('0x45')](_0x176df3[_0x408f('0x30')]);_0x4a8cee[_0x408f('0x3a')]=_[_0x408f('0x31')](_0x4a8cee[_0x408f('0x2f')],_0x4a8cee[_0x408f('0x30')]);_0x46fd7b['attributes']=_[_0x408f('0x31')](_0x4a8cee[_0x408f('0x2f')],qs[_0x408f('0x33')](_0x176df3['query']['fields']));_0x46fd7b[_0x408f('0x32')]=_0x46fd7b[_0x408f('0x32')][_0x408f('0x34')]?_0x46fd7b[_0x408f('0x32')]:_0x4a8cee[_0x408f('0x2f')];if(_0x176df3[_0x408f('0x30')][_0x408f('0x40')]){_0x46fd7b[_0x408f('0x46')]=[{'all':!![]}];}_0x46fd7b=_[_0x408f('0x3e')]({},_0x46fd7b,_0x176df3[_0x408f('0x3f')]);return db[_0x408f('0x2a')][_0x408f('0x47')](_0x46fd7b)['then'](handleEntityNotFound(_0x45a950,null))[_0x408f('0x24')](respondWithResult(_0x45a950,null))[_0x408f('0x43')](handleError(_0x45a950,null));};exports['create']=function(_0x2c557a,_0x39ef73){return db[_0x408f('0x2a')][_0x408f('0x48')](_0x2c557a[_0x408f('0x49')],{})[_0x408f('0x24')](respondWithResult(_0x39ef73,0xc9))[_0x408f('0x43')](handleError(_0x39ef73,null));};exports[_0x408f('0x4a')]=function(_0x95a74a,_0x3ea68c){return db[_0x408f('0x2a')][_0x408f('0x4a')]()[_0x408f('0x24')](respondWithResult(_0x3ea68c,null))[_0x408f('0x43')](handleError(_0x3ea68c,null));};exports[_0x408f('0x23')]=function(_0x3d8a5c,_0x25ccdb){if(_0x3d8a5c['body'][_0x408f('0x4b')]){delete _0x3d8a5c[_0x408f('0x49')][_0x408f('0x4b')];}return db[_0x408f('0x2a')][_0x408f('0x47')]({'where':{'uniqueid':_0x3d8a5c[_0x408f('0x44')]['id']}})[_0x408f('0x24')](handleEntityNotFound(_0x25ccdb,null))[_0x408f('0x24')](saveUpdates(_0x3d8a5c[_0x408f('0x49')],null))[_0x408f('0x24')](respondWithResult(_0x25ccdb,null))['catch'](handleError(_0x25ccdb,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index fc3ffb1..cb193f5 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 _0xc113=['path','rimraf','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xc113,0x1ab));var _0x3c11=function(_0xabe2be,_0x1b4e8c){_0xabe2be=_0xabe2be-0x0;var _0x2ef005=_0xc113[_0xabe2be];return _0x2ef005;};'use strict';var _=require(_0x3c11('0x0'));var util=require(_0x3c11('0x1'));var logger=require(_0x3c11('0x2'))(_0x3c11('0x3'));var moment=require(_0x3c11('0x4'));var BPromise=require(_0x3c11('0x5'));var rp=require(_0x3c11('0x6'));var fs=require('fs');var path=require(_0x3c11('0x7'));var rimraf=require(_0x3c11('0x8'));var config=require('../../config/environment');var attributes=require(_0x3c11('0x9'));module[_0x3c11('0xa')]=function(_0x595e66,_0x3dd753){return _0x595e66[_0x3c11('0xb')](_0x3c11('0xc'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x3c11('0xd'),'fields':['endtime']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7bd0=['CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','define'];(function(_0x2e53e1,_0x12aed1){var _0x3a23de=function(_0xd84699){while(--_0xd84699){_0x2e53e1['push'](_0x2e53e1['shift']());}};_0x3a23de(++_0x12aed1);}(_0x7bd0,0x111));var _0x07bd=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x7bd0[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var logger=require(_0x07bd('0x2'))(_0x07bd('0x3'));var moment=require(_0x07bd('0x4'));var BPromise=require(_0x07bd('0x5'));var rp=require(_0x07bd('0x6'));var fs=require('fs');var path=require(_0x07bd('0x7'));var rimraf=require('rimraf');var config=require(_0x07bd('0x8'));var attributes=require(_0x07bd('0x9'));module[_0x07bd('0xa')]=function(_0x313548,_0x3e8349){return _0x313548[_0x07bd('0xb')](_0x07bd('0xc'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x07bd('0xd'),'fields':['endtime']},{'name':_0x07bd('0xe'),'fields':[_0x07bd('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 3744a03..468bffc 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 _0x630e=['COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`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','outboundRejectCallsDay','GetCampaignHopperHistory','col','ivrAnswerCallsDay','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','where','sequelize'];(function(_0x295e3e,_0x30b417){var _0x4c8a9c=function(_0x2f4ef1){while(--_0x2f4ef1){_0x295e3e['push'](_0x295e3e['shift']());}};_0x4c8a9c(++_0x30b417);}(_0x630e,0x1af));var _0xe630=function(_0x2c1199,_0x243422){_0x2c1199=_0x2c1199-0x0;var _0x3a1d9a=_0x630e[_0x2c1199];return _0x3a1d9a;};'use strict';var _=require(_0xe630('0x0'));var util=require('util');var moment=require(_0xe630('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe630('0x2'));var db=require(_0xe630('0x3'))['db'];var utils=require(_0xe630('0x4'));var logger=require('../../config/logger')(_0xe630('0x5'));var config=require(_0xe630('0x6'));var jayson=require(_0xe630('0x7'));var client=jayson[_0xe630('0x8')][_0xe630('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x481b21,_0x20193d,_0x34bad4){return new BPromise(function(_0x5a73ad,_0x267926){return client['request'](_0x481b21,_0x34bad4)[_0xe630('0xa')](function(_0x3da641){logger[_0xe630('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x20193d,'request\x20sent');logger[_0xe630('0xc')](_0xe630('0xd'),_0x20193d,_0xe630('0xe'),JSON[_0xe630('0xf')](_0x3da641));if(_0x3da641['error']){if(_0x3da641[_0xe630('0x10')][_0xe630('0x11')]===0x1f4){logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);return _0x267926(_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);}logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);return _0x5a73ad(_0x3da641[_0xe630('0x10')]['message']);}else{logger[_0xe630('0xb')](_0xe630('0x12'),_0x20193d,_0xe630('0xe'));_0x5a73ad(_0x3da641[_0xe630('0x14')][_0xe630('0x13')]);}})[_0xe630('0x15')](function(_0x26a2b7){logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x26a2b7);_0x267926(_0x26a2b7);});});}exports[_0xe630('0x16')]=function(_0x3dbcf6){var _0x9721fa=this;return new Promise(function(_0xafcf13,_0x79213e){return db[_0xe630('0x17')][_0xe630('0x18')](_0x3dbcf6[_0xe630('0x19')],{'raw':_0x3dbcf6[_0xe630('0x1a')]?_0x3dbcf6[_0xe630('0x1a')][_0xe630('0x1b')]===undefined?!![]:![]:!![]})[_0xe630('0xa')](function(_0x22fa75){logger[_0xe630('0xb')](_0xe630('0x16'),_0x3dbcf6);logger[_0xe630('0xc')](_0xe630('0x16'),_0x3dbcf6,JSON['stringify'](_0x22fa75));_0xafcf13(_0x22fa75);})[_0xe630('0x15')](function(_0x35e869){logger[_0xe630('0x10')]('CreateCmHopperHistory',_0x35e869[_0xe630('0x13')],_0x3dbcf6);_0x79213e(_0x9721fa[_0xe630('0x10')](0x1f4,_0x35e869[_0xe630('0x13')]));});});};exports['AvgHandleTime']=function(_0x2d797c){var _0x30bd2e=this;return new Promise(function(_0x11fc10,_0x30b079){return db[_0xe630('0x17')][_0xe630('0x1c')]({'raw':_0x2d797c[_0xe630('0x1a')]?_0x2d797c['options'][_0xe630('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d797c[_0xe630('0x1a')]?_0x2d797c['options'][_0xe630('0x1d')]||null:null,'attributes':[[db[_0xe630('0x1e')]['fn'](_0xe630('0x1f'),db['sequelize']['col']('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn']('COUNT',db[_0xe630('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xe630('0x20')))),_0xe630('0x21')],[db[_0xe630('0x1e')]['fn'](_0xe630('0x1f'),db[_0xe630('0x1e')]['fn']('IF',db[_0xe630('0x1e')][_0xe630('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),_0xe630('0x23')],[db[_0xe630('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xe630('0x22')]('`state`\x20=\x2011,\x201,\x20null'))),_0xe630('0x24')],[db[_0xe630('0x1e')]['fn'](_0xe630('0x25'),db[_0xe630('0x1e')]['fn']('IF',db[_0xe630('0x1e')][_0xe630('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xe630('0x26')],[db['sequelize']['fn']('AVG',db[_0xe630('0x1e')]['fn']('IF',db[_0xe630('0x1e')][_0xe630('0x22')](_0xe630('0x27')))),'predictiveIntervalAvgTalktime']]})[_0xe630('0xa')](function(_0x1cb1e5){logger[_0xe630('0xb')](_0xe630('0x28'),_0x2d797c);logger[_0xe630('0xc')](_0xe630('0x28'),_0x2d797c,JSON[_0xe630('0xf')](_0x1cb1e5));_0x11fc10(_0x1cb1e5);})['catch'](function(_0xafcf1c){logger['error'](_0xe630('0x28'),_0xafcf1c[_0xe630('0x13')],_0x2d797c);_0x30b079(_0x30bd2e[_0xe630('0x10')](0x1f4,_0xafcf1c[_0xe630('0x13')]));});});};exports[_0xe630('0x29')]=function(_0x3db4ab){var _0x341173=this;return new Promise(function(_0x24d694,_0x58da07){return db[_0xe630('0x17')][_0xe630('0x1c')]({'raw':_0x3db4ab['options']?_0x3db4ab['options']['raw']===undefined?!![]:![]:!![],'where':_0x3db4ab['options']?_0x3db4ab[_0xe630('0x1a')][_0xe630('0x1d')]||null:null,'attributes':[[_0xe630('0x2a'),_0xe630('0x2b')],[db[_0xe630('0x1e')]['fn'](_0xe630('0x1f'),db[_0xe630('0x1e')]['fn']('IF',db[_0xe630('0x1e')][_0xe630('0x22')](_0xe630('0x2c')))),_0xe630('0x2d')],[db[_0xe630('0x1e')]['fn'](_0xe630('0x1f'),db[_0xe630('0x1e')]['fn']('IF',db[_0xe630('0x1e')][_0xe630('0x22')](_0xe630('0x2e')))),_0xe630('0x2f')],[db[_0xe630('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xe630('0x22')](_0xe630('0x20')))),_0xe630('0x30')],[db['sequelize']['fn'](_0xe630('0x1f'),db[_0xe630('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xe630('0x31')))),'outboundBusyCallsDay'],[db[_0xe630('0x1e')]['fn'](_0xe630('0x1f'),db[_0xe630('0x1e')]['fn']('IF',db['sequelize'][_0xe630('0x22')](_0xe630('0x32')))),_0xe630('0x33')],[db[_0xe630('0x1e')]['fn']('COUNT',db[_0xe630('0x1e')]['fn']('IF',db[_0xe630('0x1e')]['literal'](_0xe630('0x34')))),_0xe630('0x35')],[db[_0xe630('0x1e')]['fn'](_0xe630('0x1f'),db['sequelize']['fn']('IF',db[_0xe630('0x1e')][_0xe630('0x22')](_0xe630('0x36')))),'outboundDropCallsDayCallersExit'],[db[_0xe630('0x1e')]['fn'](_0xe630('0x1f'),db[_0xe630('0x1e')]['fn']('IF',db[_0xe630('0x1e')]['literal'](_0xe630('0x37')))),'outboundUnknownCallsDay'],[db[_0xe630('0x1e')]['fn']('COUNT',db[_0xe630('0x1e')]['fn']('IF',db[_0xe630('0x1e')][_0xe630('0x22')](_0xe630('0x38')))),_0xe630('0x39')],[db[_0xe630('0x1e')]['fn']('COUNT',db[_0xe630('0x1e')]['fn']('IF',db['sequelize'][_0xe630('0x22')](_0xe630('0x3a')))),_0xe630('0x3b')],[db[_0xe630('0x1e')]['fn'](_0xe630('0x1f'),db[_0xe630('0x1e')]['fn']('IF',db[_0xe630('0x1e')][_0xe630('0x22')](_0xe630('0x3c')))),'outboundRejectCallsDay'],[db[_0xe630('0x1e')]['fn']('COUNT',db[_0xe630('0x1e')]['fn']('IF',db[_0xe630('0x1e')][_0xe630('0x22')](_0xe630('0x3d')))),'outboundAnswerAgiCallsDay'],[db[_0xe630('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe630('0x1e')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0xe630('0x3e')],[db[_0xe630('0x1e')]['fn']('COUNT',db[_0xe630('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':['campaign']})[_0xe630('0xa')](function(_0xf0f784){logger['info']('GetVoiceQueueHopperHistory',_0x3db4ab);logger['debug'](_0xe630('0x29'),_0x3db4ab,JSON['stringify'](_0xf0f784));_0x24d694(_0xf0f784);})[_0xe630('0x15')](function(_0x264ed8){logger[_0xe630('0x10')](_0xe630('0x29'),_0x264ed8['message'],_0x3db4ab);_0x58da07(_0x341173[_0xe630('0x10')](0x1f4,_0x264ed8[_0xe630('0x13')]));});});};exports[_0xe630('0x3f')]=function(_0xb68796){var _0x4a9ee6=this;return new Promise(function(_0x48c724,_0x34db04){return db[_0xe630('0x17')]['findAll']({'raw':_0xb68796[_0xe630('0x1a')]?_0xb68796[_0xe630('0x1a')][_0xe630('0x1b')]===undefined?!![]:![]:!![],'where':_0xb68796[_0xe630('0x1a')]?_0xb68796['options'][_0xe630('0x1d')]||null:null,'attributes':[[_0xe630('0x2a'),'name'],[db[_0xe630('0x1e')]['fn'](_0xe630('0x1f'),db[_0xe630('0x1e')][_0xe630('0x40')]('id')),'ivrTotalCallsDays'],[db[_0xe630('0x1e')]['fn'](_0xe630('0x1f'),db['sequelize']['fn']('IF',db[_0xe630('0x1e')][_0xe630('0x22')](_0xe630('0x20')))),_0xe630('0x41')]],'group':[_0xe630('0x2a')]})[_0xe630('0xa')](function(_0xae13d1){logger[_0xe630('0xb')](_0xe630('0x3f'),_0xb68796);logger[_0xe630('0xc')](_0xe630('0x3f'),_0xb68796,JSON[_0xe630('0xf')](_0xae13d1));_0x48c724(_0xae13d1);})[_0xe630('0x15')](function(_0x426177){logger['error'](_0xe630('0x3f'),_0x426177[_0xe630('0x13')],_0xb68796);_0x34db04(_0x4a9ee6[_0xe630('0x10')](0x1f4,_0x426177[_0xe630('0x13')]));});});}; \ No newline at end of file +var _0x5433=['outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','name','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','catch','CreateCmHopperHistory','create','body','options','raw','debug','AvgHandleTime','CmHopperHistory','sequelize','COUNT','col','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','findAll','where','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5433,0x9f));var _0x3543=function(_0x1a1550,_0x5f344b){_0x1a1550=_0x1a1550-0x0;var _0x4baaa3=_0x5433[_0x1a1550];return _0x4baaa3;};'use strict';var _=require(_0x3543('0x0'));var util=require(_0x3543('0x1'));var moment=require(_0x3543('0x2'));var BPromise=require(_0x3543('0x3'));var rs=require(_0x3543('0x4'));var fs=require('fs');var Redis=require(_0x3543('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3543('0x6'));var logger=require(_0x3543('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3543('0x8'));var client=jayson[_0x3543('0x9')][_0x3543('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34abfe,_0x5e8b5d,_0x24794a){return new BPromise(function(_0x13339f,_0x4b8027){return client[_0x3543('0xb')](_0x34abfe,_0x24794a)[_0x3543('0xc')](function(_0x382389){logger[_0x3543('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x5e8b5d,_0x3543('0xe'));logger['debug'](_0x3543('0xf'),_0x5e8b5d,_0x3543('0xe'),JSON[_0x3543('0x10')](_0x382389));if(_0x382389[_0x3543('0x11')]){if(_0x382389[_0x3543('0x11')][_0x3543('0x12')]===0x1f4){logger[_0x3543('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x5e8b5d,_0x382389['error'][_0x3543('0x13')]);return _0x4b8027(_0x382389['error'][_0x3543('0x13')]);}logger[_0x3543('0x11')](_0x3543('0x14'),_0x5e8b5d,_0x382389['error'][_0x3543('0x13')]);return _0x13339f(_0x382389['error'][_0x3543('0x13')]);}else{logger[_0x3543('0xd')](_0x3543('0x14'),_0x5e8b5d,_0x3543('0xe'));_0x13339f(_0x382389['result']['message']);}})[_0x3543('0x15')](function(_0xb315bb){logger['error'](_0x3543('0x14'),_0x5e8b5d,_0xb315bb);_0x4b8027(_0xb315bb);});});}exports[_0x3543('0x16')]=function(_0x1f0464){var _0x3ccf05=this;return new Promise(function(_0x5eafb7,_0x17415e){return db['CmHopperHistory'][_0x3543('0x17')](_0x1f0464[_0x3543('0x18')],{'raw':_0x1f0464['options']?_0x1f0464[_0x3543('0x19')][_0x3543('0x1a')]===undefined?!![]:![]:!![]})[_0x3543('0xc')](function(_0x68a303){logger[_0x3543('0xd')](_0x3543('0x16'),_0x1f0464);logger[_0x3543('0x1b')](_0x3543('0x16'),_0x1f0464,JSON['stringify'](_0x68a303));_0x5eafb7(_0x68a303);})[_0x3543('0x15')](function(_0x2ce501){logger['error'](_0x3543('0x16'),_0x2ce501[_0x3543('0x13')],_0x1f0464);_0x17415e(_0x3ccf05[_0x3543('0x11')](0x1f4,_0x2ce501[_0x3543('0x13')]));});});};exports[_0x3543('0x1c')]=function(_0x542c77){var _0x40b133=this;return new Promise(function(_0x3c0e94,_0x9d6ff5){return db[_0x3543('0x1d')]['findAll']({'raw':_0x542c77[_0x3543('0x19')]?_0x542c77[_0x3543('0x19')][_0x3543('0x1a')]===undefined?!![]:![]:!![],'where':_0x542c77[_0x3543('0x19')]?_0x542c77[_0x3543('0x19')]['where']||null:null,'attributes':[[db[_0x3543('0x1e')]['fn'](_0x3543('0x1f'),db[_0x3543('0x1e')][_0x3543('0x20')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0x3543('0x1f'),db['sequelize']['fn']('IF',db[_0x3543('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x3543('0x21')],[db[_0x3543('0x1e')]['fn'](_0x3543('0x1f'),db['sequelize']['fn']('IF',db[_0x3543('0x1e')][_0x3543('0x22')](_0x3543('0x23')))),_0x3543('0x24')],[db[_0x3543('0x1e')]['fn'](_0x3543('0x1f'),db[_0x3543('0x1e')]['fn']('IF',db[_0x3543('0x1e')][_0x3543('0x22')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x3543('0x1e')]['fn'](_0x3543('0x25'),db[_0x3543('0x1e')]['fn']('IF',db[_0x3543('0x1e')][_0x3543('0x22')](_0x3543('0x26')))),_0x3543('0x27')],[db[_0x3543('0x1e')]['fn'](_0x3543('0x25'),db[_0x3543('0x1e')]['fn']('IF',db[_0x3543('0x1e')][_0x3543('0x22')](_0x3543('0x28')))),_0x3543('0x29')]]})[_0x3543('0xc')](function(_0x164ef8){logger[_0x3543('0xd')](_0x3543('0x1c'),_0x542c77);logger['debug'](_0x3543('0x1c'),_0x542c77,JSON['stringify'](_0x164ef8));_0x3c0e94(_0x164ef8);})[_0x3543('0x15')](function(_0x1e7303){logger[_0x3543('0x11')](_0x3543('0x1c'),_0x1e7303[_0x3543('0x13')],_0x542c77);_0x9d6ff5(_0x40b133['error'](0x1f4,_0x1e7303[_0x3543('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x4d7c8){var _0x32cbe2=this;return new Promise(function(_0x462b45,_0x4f2d1c){return db[_0x3543('0x1d')][_0x3543('0x2a')]({'raw':_0x4d7c8[_0x3543('0x19')]?_0x4d7c8[_0x3543('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4d7c8[_0x3543('0x19')]?_0x4d7c8['options'][_0x3543('0x2b')]||null:null,'attributes':[['campaign','name'],[db['sequelize']['fn'](_0x3543('0x1f'),db[_0x3543('0x1e')]['fn']('IF',db['sequelize'][_0x3543('0x22')](_0x3543('0x2c')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x3543('0x1e')]['fn']('IF',db[_0x3543('0x1e')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x3543('0x2d')],[db[_0x3543('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3543('0x1e')][_0x3543('0x22')](_0x3543('0x2e')))),_0x3543('0x2f')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3543('0x1e')][_0x3543('0x22')](_0x3543('0x30')))),'outboundBusyCallsDay'],[db['sequelize']['fn'](_0x3543('0x1f'),db[_0x3543('0x1e')]['fn']('IF',db[_0x3543('0x1e')][_0x3543('0x22')](_0x3543('0x31')))),_0x3543('0x32')],[db[_0x3543('0x1e')]['fn'](_0x3543('0x1f'),db[_0x3543('0x1e')]['fn']('IF',db[_0x3543('0x1e')][_0x3543('0x22')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x3543('0x33')],[db[_0x3543('0x1e')]['fn'](_0x3543('0x1f'),db[_0x3543('0x1e')]['fn']('IF',db[_0x3543('0x1e')][_0x3543('0x22')](_0x3543('0x34')))),_0x3543('0x35')],[db['sequelize']['fn'](_0x3543('0x1f'),db[_0x3543('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0x3543('0x36')],[db['sequelize']['fn']('COUNT',db[_0x3543('0x1e')]['fn']('IF',db[_0x3543('0x1e')][_0x3543('0x22')](_0x3543('0x37')))),_0x3543('0x38')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3543('0x1e')][_0x3543('0x22')](_0x3543('0x39')))),_0x3543('0x3a')],[db[_0x3543('0x1e')]['fn'](_0x3543('0x1f'),db['sequelize']['fn']('IF',db[_0x3543('0x1e')]['literal'](_0x3543('0x3b')))),'outboundRejectCallsDay'],[db[_0x3543('0x1e')]['fn'](_0x3543('0x1f'),db[_0x3543('0x1e')]['fn']('IF',db[_0x3543('0x1e')][_0x3543('0x22')](_0x3543('0x3c')))),_0x3543('0x3d')],[db[_0x3543('0x1e')]['fn'](_0x3543('0x1f'),db['sequelize']['fn']('IF',db[_0x3543('0x1e')]['literal'](_0x3543('0x3e')))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x3543('0x1e')]['fn']('IF',db[_0x3543('0x1e')][_0x3543('0x22')](_0x3543('0x3f')))),_0x3543('0x40')]],'group':[_0x3543('0x41')]})[_0x3543('0xc')](function(_0x26f0b8){logger[_0x3543('0xd')](_0x3543('0x42'),_0x4d7c8);logger['debug'](_0x3543('0x42'),_0x4d7c8,JSON['stringify'](_0x26f0b8));_0x462b45(_0x26f0b8);})[_0x3543('0x15')](function(_0x1b7b6c){logger[_0x3543('0x11')](_0x3543('0x42'),_0x1b7b6c[_0x3543('0x13')],_0x4d7c8);_0x4f2d1c(_0x32cbe2['error'](0x1f4,_0x1b7b6c[_0x3543('0x13')]));});});};exports[_0x3543('0x43')]=function(_0x5211cf){var _0x195cc5=this;return new Promise(function(_0x574205,_0x48bc83){return db[_0x3543('0x1d')][_0x3543('0x2a')]({'raw':_0x5211cf[_0x3543('0x19')]?_0x5211cf[_0x3543('0x19')][_0x3543('0x1a')]===undefined?!![]:![]:!![],'where':_0x5211cf[_0x3543('0x19')]?_0x5211cf[_0x3543('0x19')]['where']||null:null,'attributes':[['campaign',_0x3543('0x44')],[db[_0x3543('0x1e')]['fn']('COUNT',db['sequelize'][_0x3543('0x20')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x3543('0x1f'),db[_0x3543('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x3543('0x2e')))),_0x3543('0x45')]],'group':['campaign']})[_0x3543('0xc')](function(_0x112b06){logger[_0x3543('0xd')]('GetCampaignHopperHistory',_0x5211cf);logger['debug'](_0x3543('0x43'),_0x5211cf,JSON[_0x3543('0x10')](_0x112b06));_0x574205(_0x112b06);})['catch'](function(_0x268779){logger[_0x3543('0x11')](_0x3543('0x43'),_0x268779[_0x3543('0x13')],_0x5211cf);_0x48bc83(_0x195cc5[_0x3543('0x11')](0x1f4,_0x268779['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index fe8488b..f4be911 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 _0x8156=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','exports'];(function(_0x45889f,_0x4e6ed6){var _0x5bcd43=function(_0x5c0dda){while(--_0x5c0dda){_0x45889f['push'](_0x45889f['shift']());}};_0x5bcd43(++_0x4e6ed6);}(_0x8156,0x85));var _0x6815=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8156[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x6815('0x0'));var util=require(_0x6815('0x1'));var path=require(_0x6815('0x2'));var timeout=require(_0x6815('0x3'));var express=require('express');var router=express[_0x6815('0x4')]();var fs_extra=require(_0x6815('0x5'));var auth=require(_0x6815('0x6'));var interaction=require(_0x6815('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0x6815('0x8')](),controller[_0x6815('0x9')]);router[_0x6815('0xa')](_0x6815('0xb'),auth[_0x6815('0x8')](),controller[_0x6815('0xc')]);router[_0x6815('0xa')](_0x6815('0xd'),auth[_0x6815('0x8')](),controller[_0x6815('0xe')]);router['post']('/',auth[_0x6815('0x8')](),controller[_0x6815('0xf')]);router[_0x6815('0x10')]('/:id',auth[_0x6815('0x8')](),controller[_0x6815('0x11')]);module[_0x6815('0x12')]=router; \ No newline at end of file +var _0x869f=['/:id','update','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','get','/describe','describe','show','create'];(function(_0x33d3db,_0xc41985){var _0x1564c0=function(_0x39ca5d){while(--_0x39ca5d){_0x33d3db['push'](_0x33d3db['shift']());}};_0x1564c0(++_0xc41985);}(_0x869f,0x1b2));var _0xf869=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x869f[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0xf869('0x0'));var util=require(_0xf869('0x1'));var path=require(_0xf869('0x2'));var timeout=require(_0xf869('0x3'));var express=require(_0xf869('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf869('0x5'));var config=require(_0xf869('0x6'));var controller=require(_0xf869('0x7'));router['get']('/',auth[_0xf869('0x8')](),controller['index']);router[_0xf869('0x9')](_0xf869('0xa'),auth[_0xf869('0x8')](),controller[_0xf869('0xb')]);router[_0xf869('0x9')]('/:id',auth[_0xf869('0x8')](),controller[_0xf869('0xc')]);router['post']('/',auth[_0xf869('0x8')](),controller[_0xf869('0xd')]);router['put'](_0xf869('0xe'),auth[_0xf869('0x8')](),controller[_0xf869('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 9c408d1..ef2cc17 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 _0x4a25=['sequelize','STRING'];(function(_0x58c248,_0x2e1d63){var _0x469d39=function(_0x5309f7){while(--_0x5309f7){_0x58c248['push'](_0x58c248['shift']());}};_0x469d39(++_0x2e1d63);}(_0x4a25,0x1d4));var _0x54a2=function(_0x3ff4a3,_0xa5bfa6){_0x3ff4a3=_0x3ff4a3-0x0;var _0x38676f=_0x4a25[_0x3ff4a3];return _0x38676f;};'use strict';var Sequelize=require(_0x54a2('0x0'));module['exports']={'name':{'type':Sequelize[_0x54a2('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x54a2('0x1')]},'dialPrefix':{'type':Sequelize[_0x54a2('0x1')]}}; \ No newline at end of file +var _0x8f1f=['sequelize','name','STRING'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x8f1f,0xe1));var _0xf8f1=function(_0x3c11e5,_0x72618c){_0x3c11e5=_0x3c11e5-0x0;var _0x163e43=_0x8f1f[_0x3c11e5];return _0x163e43;};'use strict';var Sequelize=require(_0xf8f1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf8f1('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf8f1('0x2')]},'dialPrefix':{'type':Sequelize[_0xf8f1('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 669ad2b..891e676 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 _0x0b85=['download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','Sequelize','TEXT','text','number','BOOLEAN','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','./cmList.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','get','then','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','user','Lists','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','keys','nolimit','addContacts','CmContact','tags','isArray','join','push','omit','ids','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','format','isEmpty','now','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv'];(function(_0xe46f8a,_0x4742a6){var _0x398dbe=function(_0x28e670){while(--_0x28e670){_0xe46f8a['push'](_0xe46f8a['shift']());}};_0x398dbe(++_0x4742a6);}(_0x0b85,0xa4));var _0x50b8=function(_0xfe8756,_0x64c7a4){_0xfe8756=_0xfe8756-0x0;var _0x4dd5a4=_0x0b85[_0xfe8756];return _0x4dd5a4;};'use strict';var emlformat=require(_0x50b8('0x0'));var rimraf=require(_0x50b8('0x1'));var zipdir=require(_0x50b8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x50b8('0x3'));var BPromise=require(_0x50b8('0x4'));var Mustache=require('mustache');var util=require(_0x50b8('0x5'));var path=require(_0x50b8('0x6'));var sox=require(_0x50b8('0x7'));var csv=require('to-csv');var ejs=require(_0x50b8('0x8'));var fs=require('fs');var fs_extra=require(_0x50b8('0x9'));var _=require(_0x50b8('0xa'));var squel=require('squel');var crypto=require(_0x50b8('0xb'));var jsforce=require(_0x50b8('0xc'));var deskjs=require(_0x50b8('0xd'));var toCsv=require(_0x50b8('0xe'));var querystring=require('querystring');var Papa=require(_0x50b8('0xf'));var Redis=require(_0x50b8('0x10'));var authService=require(_0x50b8('0x11'));var qs=require(_0x50b8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x50b8('0x13'));var utils=require('../../config/utils');var config=require(_0x50b8('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x50b8('0x15')]=_[_0x50b8('0x16')](config['redis'],{'host':_0x50b8('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x50b8('0x15')]));require(_0x50b8('0x18'))['register'](socket);function respondWithStatusCode(_0x2c14e4,_0x1222b5){_0x1222b5=_0x1222b5||0xcc;return function(_0x40b617){if(_0x40b617){return _0x2c14e4[_0x50b8('0x19')](_0x1222b5);}return _0x2c14e4[_0x50b8('0x1a')](_0x1222b5)[_0x50b8('0x1b')]();};}function respondWithResult(_0x22c082,_0x443ea8){_0x443ea8=_0x443ea8||0xc8;return function(_0x4b63bc){if(_0x4b63bc){return _0x22c082[_0x50b8('0x1a')](_0x443ea8)[_0x50b8('0x1c')](_0x4b63bc);}};}function respondWithFilteredResult(_0x144735,_0x3227c0){return function(_0x6fb338){if(_0x6fb338){var _0x2a58f8=typeof _0x3227c0[_0x50b8('0x1d')]===_0x50b8('0x1e')&&typeof _0x3227c0[_0x50b8('0x1f')]===_0x50b8('0x1e');var _0x5d1759=_0x6fb338[_0x50b8('0x20')];var _0x6ed8bf=_0x2a58f8?0x0:_0x3227c0[_0x50b8('0x1d')];var _0x1b0497=_0x2a58f8?_0x6fb338[_0x50b8('0x20')]:_0x3227c0[_0x50b8('0x1d')]+_0x3227c0[_0x50b8('0x1f')];var _0x2a29f1;if(_0x1b0497>=_0x5d1759){_0x1b0497=_0x5d1759;_0x2a29f1=0xc8;}else{_0x2a29f1=0xce;}_0x144735[_0x50b8('0x1a')](_0x2a29f1);return _0x144735[_0x50b8('0x21')](_0x50b8('0x22'),_0x6ed8bf+'-'+_0x1b0497+'/'+_0x5d1759)[_0x50b8('0x1c')](_0x6fb338);}return null;};}function patchUpdates(_0x40b8c2){return function(_0x22d5b9){try{jsonpatch['apply'](_0x22d5b9,_0x40b8c2,!![]);}catch(_0xfea9e1){return BPromise[_0x50b8('0x23')](_0xfea9e1);}return _0x22d5b9[_0x50b8('0x24')]();};}function saveUpdates(_0x189fc7,_0x27ee90){return function(_0x48c5de){if(_0x48c5de){return _0x48c5de['update'](_0x189fc7)['then'](function(_0x41fe69){return _0x41fe69;});}return null;};}function removeEntity(_0x4a672c,_0x23483b){return function(_0x59ef6d){if(_0x59ef6d){return _0x59ef6d[_0x50b8('0x25')]()['then'](function(){var _0x2b4fa0=_0x59ef6d[_0x50b8('0x26')]({'plain':!![]});var _0x208df4='Lists';return db['UserProfileResource']['destroy']({'where':{'type':_0x208df4,'resourceId':_0x2b4fa0['id']}})[_0x50b8('0x27')](function(){return _0x59ef6d;});})[_0x50b8('0x27')](function(){_0x4a672c['status'](0xcc)[_0x50b8('0x1b')]();});}};}function handleEntityNotFound(_0x66ccc1,_0x4a455b){return function(_0x1ad4a1){if(!_0x1ad4a1){_0x66ccc1[_0x50b8('0x19')](0x194);}return _0x1ad4a1;};}function handleError(_0x44de4b,_0x29c269){_0x29c269=_0x29c269||0x1f4;return function(_0x541372){logger['error'](_0x541372[_0x50b8('0x28')]);if(_0x541372[_0x50b8('0x29')]){delete _0x541372[_0x50b8('0x29')];}_0x44de4b['status'](_0x29c269)[_0x50b8('0x2a')](_0x541372);};}exports[_0x50b8('0x2b')]=function(_0x55b5bd,_0x1ed7e8){var _0x2e3394={},_0x1aa879={},_0x4ff8a2={'count':0x0,'rows':[]};var _0x4bba6e=_[_0x50b8('0x2c')](db[_0x50b8('0x2d')][_0x50b8('0x2e')],function(_0x1157e3){return{'name':_0x1157e3[_0x50b8('0x2f')],'type':_0x1157e3[_0x50b8('0x30')]['key']};});_0x1aa879['model']=_[_0x50b8('0x2c')](_0x4bba6e,'name');_0x1aa879[_0x50b8('0x31')]=_['keys'](_0x55b5bd[_0x50b8('0x31')]);_0x1aa879[_0x50b8('0x32')]=_[_0x50b8('0x33')](_0x1aa879[_0x50b8('0x34')],_0x1aa879[_0x50b8('0x31')]);_0x2e3394[_0x50b8('0x35')]=_[_0x50b8('0x33')](_0x1aa879[_0x50b8('0x34')],qs['fields'](_0x55b5bd[_0x50b8('0x31')][_0x50b8('0x36')]));_0x2e3394[_0x50b8('0x35')]=_0x2e3394[_0x50b8('0x35')][_0x50b8('0x37')]?_0x2e3394[_0x50b8('0x35')]:_0x1aa879[_0x50b8('0x34')];if(!_0x55b5bd[_0x50b8('0x31')][_0x50b8('0x38')]('nolimit')){_0x2e3394[_0x50b8('0x1f')]=qs[_0x50b8('0x1f')](_0x55b5bd[_0x50b8('0x31')][_0x50b8('0x1f')]);_0x2e3394[_0x50b8('0x1d')]=qs[_0x50b8('0x1d')](_0x55b5bd[_0x50b8('0x31')]['offset']);}_0x2e3394[_0x50b8('0x39')]=qs[_0x50b8('0x3a')](_0x55b5bd[_0x50b8('0x31')][_0x50b8('0x3a')]);_0x2e3394['where']=qs['filters'](_[_0x50b8('0x3b')](_0x55b5bd[_0x50b8('0x31')],_0x1aa879[_0x50b8('0x32')]),_0x4bba6e);if(_0x55b5bd[_0x50b8('0x31')][_0x50b8('0x3c')]){_0x2e3394[_0x50b8('0x3d')]=_[_0x50b8('0x3e')](_0x2e3394[_0x50b8('0x3d')],{'$or':_['map'](_0x4bba6e,function(_0x1386f5){if(_0x1386f5[_0x50b8('0x30')]!==_0x50b8('0x3f')){var _0x139749={};_0x139749[_0x1386f5[_0x50b8('0x29')]]={'$like':'%'+_0x55b5bd[_0x50b8('0x31')][_0x50b8('0x3c')]+'%'};return _0x139749;}})});}_0x2e3394=_[_0x50b8('0x3e')]({},_0x2e3394,_0x55b5bd[_0x50b8('0x40')]);var _0x368e09={'where':_0x2e3394[_0x50b8('0x3d')]};return db[_0x50b8('0x2d')][_0x50b8('0x20')](_0x368e09)[_0x50b8('0x27')](function(_0x5dae77){_0x4ff8a2['count']=_0x5dae77;if(_0x55b5bd[_0x50b8('0x31')][_0x50b8('0x41')]){_0x2e3394[_0x50b8('0x42')]=[{'all':!![]}];}return db['CmList'][_0x50b8('0x43')](_0x2e3394);})['then'](function(_0x44fe3f){_0x4ff8a2[_0x50b8('0x44')]=_0x44fe3f;return _0x4ff8a2;})[_0x50b8('0x27')](respondWithFilteredResult(_0x1ed7e8,_0x2e3394))[_0x50b8('0x45')](handleError(_0x1ed7e8,null));};exports[_0x50b8('0x46')]=function(_0x477713,_0x5559cd){var _0x25de27={'raw':![],'where':{'id':_0x477713['params']['id']}},_0x5025a={};_0x5025a[_0x50b8('0x34')]=_['keys'](db['CmList'][_0x50b8('0x2e')]);_0x5025a[_0x50b8('0x31')]=_['keys'](_0x477713[_0x50b8('0x31')]);_0x5025a[_0x50b8('0x32')]=_[_0x50b8('0x33')](_0x5025a[_0x50b8('0x34')],_0x5025a[_0x50b8('0x31')]);_0x25de27['attributes']=_['intersection'](_0x5025a[_0x50b8('0x34')],qs[_0x50b8('0x36')](_0x477713[_0x50b8('0x31')][_0x50b8('0x36')]));_0x25de27[_0x50b8('0x35')]=_0x25de27[_0x50b8('0x35')][_0x50b8('0x37')]?_0x25de27[_0x50b8('0x35')]:_0x5025a['model'];if(_0x477713['query']['includeAll']){_0x25de27[_0x50b8('0x42')]=[{'all':!![]}];}_0x25de27=_[_0x50b8('0x3e')]({},_0x25de27,_0x477713[_0x50b8('0x40')]);return db[_0x50b8('0x2d')]['find'](_0x25de27)[_0x50b8('0x27')](handleEntityNotFound(_0x5559cd,null))[_0x50b8('0x27')](respondWithResult(_0x5559cd,null))[_0x50b8('0x45')](handleError(_0x5559cd,null));};exports[_0x50b8('0x47')]=function(_0x30e736,_0x16c7fd){return db['CmList']['create'](_0x30e736['body'],{})[_0x50b8('0x27')](function(_0x32ffbc){var _0x56a3c6=_0x30e736['user'][_0x50b8('0x26')]({'plain':!![]});if(!_0x56a3c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56a3c6['role']===_0x50b8('0x48')){var _0xb4ca5d=_0x32ffbc[_0x50b8('0x26')]({'plain':!![]});var _0x266b3a=_0x50b8('0x49');return db[_0x50b8('0x4a')][_0x50b8('0x4b')]({'where':{'name':_0x266b3a,'userProfileId':_0x56a3c6[_0x50b8('0x4c')]},'raw':!![]})['then'](function(_0x3858a9){if(_0x3858a9&&_0x3858a9[_0x50b8('0x4d')]===0x0){return db[_0x50b8('0x4e')]['create']({'name':_0xb4ca5d['name'],'resourceId':_0xb4ca5d['id'],'type':_0x3858a9['name'],'sectionId':_0x3858a9['id']},{})[_0x50b8('0x27')](function(){return _0x32ffbc;});}else{return _0x32ffbc;}})['catch'](function(_0x4a62fb){logger[_0x50b8('0x4f')](_0x50b8('0x50'),_0x4a62fb);throw _0x4a62fb;});}return _0x32ffbc;})[_0x50b8('0x27')](respondWithResult(_0x16c7fd,0xc9))['catch'](handleError(_0x16c7fd,null));};exports[_0x50b8('0x51')]=function(_0x36eaff,_0x33f5bf){if(_0x36eaff[_0x50b8('0x52')]['id']){delete _0x36eaff[_0x50b8('0x52')]['id'];}return db['CmList'][_0x50b8('0x4b')]({'where':{'id':_0x36eaff[_0x50b8('0x53')]['id']}})['then'](handleEntityNotFound(_0x33f5bf,null))[_0x50b8('0x27')](saveUpdates(_0x36eaff[_0x50b8('0x52')],null))[_0x50b8('0x27')](respondWithResult(_0x33f5bf,null))[_0x50b8('0x45')](handleError(_0x33f5bf,null));};exports[_0x50b8('0x25')]=function(_0x490993,_0x34ded5){return db['CmList']['find']({'where':{'id':_0x490993[_0x50b8('0x53')]['id']}})[_0x50b8('0x27')](handleEntityNotFound(_0x34ded5,null))['then'](removeEntity(_0x34ded5,null))[_0x50b8('0x45')](handleError(_0x34ded5,null));};exports[_0x50b8('0x54')]=function(_0x58bb95,_0x4a0dd3){return db['CmList']['describe']()[_0x50b8('0x27')](respondWithResult(_0x4a0dd3,null))['catch'](handleError(_0x4a0dd3,null));};exports[_0x50b8('0x55')]=function(_0x1d688e,_0x366495,_0x226dc5){if(_0x1d688e[_0x50b8('0x52')]['id']){delete _0x1d688e[_0x50b8('0x52')]['id'];}return db['CmList']['find']({'where':{'id':_0x1d688e['params']['id']}})[_0x50b8('0x27')](handleEntityNotFound(_0x366495,null))[_0x50b8('0x27')](function(_0x475b4a){if(_0x475b4a){_0x1d688e[_0x50b8('0x52')][_0x50b8('0x56')]=_0x475b4a['id'];return db[_0x50b8('0x57')][_0x50b8('0x47')](_0x1d688e[_0x50b8('0x52')]);}})[_0x50b8('0x27')](respondWithResult(_0x366495,null))[_0x50b8('0x45')](handleError(_0x366495,null));};exports[_0x50b8('0x58')]=function(_0x35958f,_0x1a3f9e,_0x5c28e7){var _0x58dcd6={'raw':![],'where':{}};var _0x2746fb={};var _0x6eaa89={'count':0x0,'rows':[]};return db[_0x50b8('0x2d')][_0x50b8('0x59')]({'where':{'id':_0x35958f[_0x50b8('0x53')]['id']}})[_0x50b8('0x27')](handleEntityNotFound(_0x1a3f9e,null))[_0x50b8('0x27')](function(_0x56d553){if(_0x56d553){_0x2746fb['model']=_['keys'](db[_0x50b8('0x57')][_0x50b8('0x2e')]);_0x2746fb[_0x50b8('0x31')]=_[_0x50b8('0x5a')](_0x35958f['query']);_0x2746fb[_0x50b8('0x32')]=_[_0x50b8('0x33')](_0x2746fb[_0x50b8('0x34')],_0x2746fb[_0x50b8('0x31')]);_0x58dcd6[_0x50b8('0x35')]=_[_0x50b8('0x33')](_0x2746fb[_0x50b8('0x34')],qs[_0x50b8('0x36')](_0x35958f[_0x50b8('0x31')]['fields']));_0x58dcd6[_0x50b8('0x35')]=_0x58dcd6[_0x50b8('0x35')][_0x50b8('0x37')]?_0x58dcd6[_0x50b8('0x35')]:_0x2746fb[_0x50b8('0x34')];if(!_0x35958f[_0x50b8('0x31')][_0x50b8('0x38')](_0x50b8('0x5b'))){_0x58dcd6['limit']=qs[_0x50b8('0x1f')](_0x35958f[_0x50b8('0x31')]['limit']);_0x58dcd6[_0x50b8('0x1d')]=qs[_0x50b8('0x1d')](_0x35958f[_0x50b8('0x31')][_0x50b8('0x1d')]);}_0x58dcd6[_0x50b8('0x39')]=qs[_0x50b8('0x3a')](_0x35958f[_0x50b8('0x31')][_0x50b8('0x3a')]);_0x58dcd6[_0x50b8('0x3d')]=qs[_0x50b8('0x32')](_['pick'](_0x35958f[_0x50b8('0x31')],_0x2746fb[_0x50b8('0x32')]));_0x58dcd6[_0x50b8('0x3d')][_0x50b8('0x56')]=_0x56d553['id'];if(_0x35958f[_0x50b8('0x31')][_0x50b8('0x3c')]){_0x58dcd6[_0x50b8('0x3d')]=_[_0x50b8('0x3e')](_0x58dcd6[_0x50b8('0x3d')],{'$or':_[_0x50b8('0x2c')](_0x58dcd6[_0x50b8('0x35')],function(_0x276e55){var _0x4a5ce5={};_0x4a5ce5[_0x276e55]={'$like':'%'+_0x35958f[_0x50b8('0x31')][_0x50b8('0x3c')]+'%'};return _0x4a5ce5;})});}_0x58dcd6=_['merge']({},_0x58dcd6,_0x35958f[_0x50b8('0x40')]);return db[_0x50b8('0x57')][_0x50b8('0x20')]({'where':_0x58dcd6['where']})[_0x50b8('0x27')](function(_0x363487){_0x6eaa89[_0x50b8('0x20')]=_0x363487;if(_0x35958f[_0x50b8('0x31')][_0x50b8('0x41')]){_0x58dcd6['include']=[{'all':!![]}];}return db[_0x50b8('0x57')][_0x50b8('0x43')](_0x58dcd6);})['then'](function(_0xd880bc){_0x6eaa89[_0x50b8('0x44')]=_0xd880bc;return _0x6eaa89;});}})[_0x50b8('0x27')](respondWithFilteredResult(_0x1a3f9e,_0x58dcd6))[_0x50b8('0x45')](handleError(_0x1a3f9e,null));};exports['removeDispositions']=function(_0x3ac38f,_0x34c3be,_0x35db0f){return db[_0x50b8('0x2d')][_0x50b8('0x4b')]({'where':{'id':_0x3ac38f[_0x50b8('0x53')]['id']}})['then'](handleEntityNotFound(_0x34c3be,null))[_0x50b8('0x27')](function(_0xc49cf2){if(_0xc49cf2){return _0xc49cf2['removeDispositions'](_0x3ac38f['query']['ids']);}})[_0x50b8('0x27')](respondWithStatusCode(_0x34c3be,null))[_0x50b8('0x45')](handleError(_0x34c3be,null));};exports[_0x50b8('0x5c')]=function(_0x24d3c3,_0xcd8e18,_0x387d5a){return db[_0x50b8('0x2d')][_0x50b8('0x4b')]({'where':{'id':_0x24d3c3[_0x50b8('0x53')]['id']}})['then'](handleEntityNotFound(_0xcd8e18,null))[_0x50b8('0x27')](function(_0x4aedba){if(_0x4aedba){var _0x3e9dbc=[];var _0x57a80a={'success':[],'errors':[]};return db[_0x50b8('0x5d')][_0x50b8('0x54')]()[_0x50b8('0x27')](function(_0x4b43ec){if(_0x24d3c3['body'][_0x50b8('0x5e')]&&_[_0x50b8('0x5f')](_0x24d3c3[_0x50b8('0x52')][_0x50b8('0x5e')])){if(_0x24d3c3[_0x50b8('0x52')][_0x50b8('0x5e')][_0x50b8('0x37')]){_0x24d3c3[_0x50b8('0x52')][_0x50b8('0x5e')]=_0x24d3c3[_0x50b8('0x52')][_0x50b8('0x5e')][_0x50b8('0x60')](';')+';';}else{_0x24d3c3[_0x50b8('0x52')][_0x50b8('0x5e')]=null;}}else{_0x24d3c3[_0x50b8('0x52')][_0x50b8('0x5e')]=null;}if(_0x24d3c3[_0x50b8('0x52')]&&_[_0x50b8('0x5f')](_0x24d3c3[_0x50b8('0x52')])){for(var _0x26f79a=0x0;_0x26f79a<_0x24d3c3[_0x50b8('0x52')][_0x50b8('0x37')];_0x26f79a+=0x1){_0x24d3c3[_0x50b8('0x52')][_0x26f79a]['ListId']=_0x24d3c3['params']['id'];_0x3e9dbc[_0x50b8('0x61')](_0x24d3c3[_0x50b8('0x52')][_0x26f79a]);}return BPromise['each'](_0x3e9dbc,function(_0x84da78){return db[_0x50b8('0x5d')][_0x50b8('0x47')](_[_0x50b8('0x62')](_0x84da78,[_0x50b8('0x63'),'id'])||{},{'fields':_[_0x50b8('0x5a')](_0x4b43ec),'raw':!![]})['then'](function(_0x34f06e){_0x57a80a[_0x50b8('0x64')][_0x50b8('0x61')](_0x34f06e[_0x50b8('0x65')]);})[_0x50b8('0x45')](function(_0x2c84e5){_0x57a80a['errors'][_0x50b8('0x61')]({'data':_0x84da78,'error':_0x2c84e5[_0x50b8('0x66')]});});})[_0x50b8('0x27')](function(_0x41fdc6){return _0x57a80a;})['catch'](function(_0x2facb8){return _0x2facb8;});}else{_0xcd8e18['status'](0x190)['json']({'message':_0x50b8('0x67')});}});}})[_0x50b8('0x27')](respondWithResult(_0xcd8e18,null))['catch'](handleError(_0xcd8e18,null));};exports[_0x50b8('0x68')]=function(_0x19fe20,_0x3e80b5,_0x5e9b12){var _0x2e4b7f;return db[_0x50b8('0x2d')]['find']({'where':{'id':_0x19fe20[_0x50b8('0x53')]['id']},'include':[{'model':db[_0x50b8('0x69')],'as':_0x50b8('0x6a')}]})[_0x50b8('0x27')](handleEntityNotFound(_0x3e80b5,null))[_0x50b8('0x27')](function(_0xd76149){if(_0xd76149){_0x2e4b7f=_0xd76149;return db[_0x50b8('0x5d')][_0x50b8('0x2e')];}})[_0x50b8('0x27')](function(_0x28612e){if(_0x28612e){var _0xb96f89={};var _0x52b0fe={};_0x52b0fe['model']=_[_0x50b8('0x6b')](_['keys'](_0x28612e),_[_0x50b8('0x2c')](_0x2e4b7f[_0x50b8('0x6a')],function(_0x49af7c){return util['format'](_0x50b8('0x6c'),_0x49af7c['id']);}));_0x52b0fe[_0x50b8('0x31')]=_[_0x50b8('0x5a')](_0x19fe20[_0x50b8('0x31')]);_0x52b0fe[_0x50b8('0x32')]=_['intersection'](_0x52b0fe[_0x50b8('0x34')],_0x52b0fe[_0x50b8('0x31')]);_0xb96f89[_0x50b8('0x35')]=_['intersection'](_0x52b0fe['model'],qs[_0x50b8('0x36')](_0x19fe20[_0x50b8('0x31')]['fields']));_0xb96f89[_0x50b8('0x35')]=_0xb96f89[_0x50b8('0x35')][_0x50b8('0x37')]?_0xb96f89[_0x50b8('0x35')]:_0x52b0fe[_0x50b8('0x34')];if(!_0x19fe20[_0x50b8('0x31')]['hasOwnProperty'](_0x50b8('0x5b'))){_0xb96f89['limit']=qs['limit'](_0x19fe20['query'][_0x50b8('0x1f')]);_0xb96f89[_0x50b8('0x1d')]=qs[_0x50b8('0x1d')](_0x19fe20[_0x50b8('0x31')]['offset']);}_0xb96f89[_0x50b8('0x39')]=qs[_0x50b8('0x3a')](_0x19fe20[_0x50b8('0x31')]['sort']);_0xb96f89[_0x50b8('0x3d')]=qs['filters'](_[_0x50b8('0x3b')](_0x19fe20[_0x50b8('0x31')],_0x52b0fe[_0x50b8('0x32')]));_0xb96f89[_0x50b8('0x6d')]=!![];if(_0x19fe20[_0x50b8('0x31')][_0x50b8('0x3c')]){_0xb96f89[_0x50b8('0x3d')]=_[_0x50b8('0x3e')](_0xb96f89[_0x50b8('0x3d')],{'$or':_[_0x50b8('0x2c')](_0xb96f89[_0x50b8('0x35')],function(_0x471f97){var _0x14fa02={};_0x14fa02[_0x471f97]={'$like':'%'+_0x19fe20[_0x50b8('0x31')][_0x50b8('0x3c')]+'%'};return _0x14fa02;})});}_0xb96f89=_[_0x50b8('0x3e')]({},_0xb96f89,_0x19fe20[_0x50b8('0x40')]);return _0x2e4b7f['getContacts'](_0xb96f89);}})[_0x50b8('0x27')](respondWithResult(_0x3e80b5,null))['catch'](handleError(_0x3e80b5,null));};exports[_0x50b8('0x6e')]=function(_0x2aa0b4,_0x1a418f,_0x53bd5d){var _0x14705e;return db[_0x50b8('0x2d')][_0x50b8('0x4b')]({'where':{'id':_0x2aa0b4[_0x50b8('0x53')]['id']},'include':[{'model':db[_0x50b8('0x69')],'as':_0x50b8('0x6a')}]})[_0x50b8('0x27')](handleEntityNotFound(_0x1a418f,null))['then'](function(_0x2113a1){if(_0x2113a1){_0x14705e=_0x2113a1;return db['CmContact'][_0x50b8('0x2e')];}})['then'](function(_0x59213f){if(_0x59213f){var _0x31ea6c={};var _0x458ba1={};_0x458ba1[_0x50b8('0x34')]=_[_0x50b8('0x6b')](_['keys'](_0x59213f),_['map'](_0x14705e[_0x50b8('0x6a')],function(_0x31e3c1){return util[_0x50b8('0x6f')](_0x50b8('0x6c'),_0x31e3c1['id']);}));_0x458ba1[_0x50b8('0x31')]=_[_0x50b8('0x5a')](_0x2aa0b4[_0x50b8('0x31')]);_0x458ba1['filters']=_['intersection'](_0x458ba1[_0x50b8('0x34')],_0x458ba1[_0x50b8('0x31')]);_0x31ea6c[_0x50b8('0x35')]=_[_0x50b8('0x33')](_0x458ba1[_0x50b8('0x34')],qs[_0x50b8('0x36')](_0x2aa0b4[_0x50b8('0x31')][_0x50b8('0x36')]));_0x31ea6c[_0x50b8('0x35')]=_0x31ea6c[_0x50b8('0x35')]['length']?_0x31ea6c[_0x50b8('0x35')]:_0x458ba1[_0x50b8('0x34')];if(!_0x2aa0b4['query'][_0x50b8('0x38')](_0x50b8('0x5b'))){_0x31ea6c[_0x50b8('0x1f')]=qs['limit'](_0x2aa0b4[_0x50b8('0x31')][_0x50b8('0x1f')]);_0x31ea6c[_0x50b8('0x1d')]=qs[_0x50b8('0x1d')](_0x2aa0b4['query'][_0x50b8('0x1d')]);}_0x31ea6c['order']=qs[_0x50b8('0x3a')](_0x2aa0b4[_0x50b8('0x31')][_0x50b8('0x3a')]);_0x31ea6c[_0x50b8('0x3d')]=qs[_0x50b8('0x32')](_['pick'](_0x2aa0b4[_0x50b8('0x31')],_0x458ba1['filters']));_0x31ea6c[_0x50b8('0x6d')]=!![];if(_0x2aa0b4['query']['filter']){_0x31ea6c[_0x50b8('0x3d')]=_[_0x50b8('0x3e')](_0x31ea6c[_0x50b8('0x3d')],{'$or':_[_0x50b8('0x2c')](_0x31ea6c[_0x50b8('0x35')],function(_0x433708){var _0x5d3945={};_0x5d3945[_0x433708]={'$like':'%'+_0x2aa0b4[_0x50b8('0x31')][_0x50b8('0x3c')]+'%'};return _0x5d3945;})});}_0x31ea6c=_[_0x50b8('0x3e')]({},_0x31ea6c,_0x2aa0b4[_0x50b8('0x40')]);return _0x14705e['getContacts'](_0x31ea6c);}})[_0x50b8('0x27')](function(_0x47cb8c){if(!_[_0x50b8('0x70')](_0x47cb8c)){var _0x33e530=toCsv(_0x47cb8c);var _0xe67a28=Date[_0x50b8('0x71')]();fs['writeFileSync'](util[_0x50b8('0x6f')]('/tmp/list_%d_%s.csv',_0x14705e['id'],_0xe67a28),_0x33e530);_0x1a418f[_0x50b8('0x72')](_0x50b8('0x73'),_0x50b8('0x74')+util[_0x50b8('0x6f')](_0x50b8('0x75'),_0x14705e['id'],_0xe67a28));_0x1a418f[_0x50b8('0x72')](_0x50b8('0x76'),_0x50b8('0x77'));return _0x1a418f[_0x50b8('0x78')](util[_0x50b8('0x6f')](_0x50b8('0x79'),_0x14705e['id'],_0xe67a28));}else{return _0x1a418f['sendStatus'](0xcc);}})['catch'](handleError(_0x1a418f,null));};exports[_0x50b8('0x7a')]=function(_0x1578ae,_0x4e842a,_0xd2949c){var _0x24b248;delete _0x1578ae[_0x50b8('0x52')]['id'];return db['CmList'][_0x50b8('0x59')]({'where':{'id':_0x1578ae[_0x50b8('0x53')]['id']}})[_0x50b8('0x27')](handleEntityNotFound(_0x4e842a,null))[_0x50b8('0x27')](function(_0x17d27f){if(_0x17d27f){return db[_0x50b8('0x7b')][_0x50b8('0x7c')](function(_0x26f6db){return db[_0x50b8('0x69')][_0x50b8('0x47')](_0x1578ae[_0x50b8('0x52')],{'transaction':_0x26f6db})[_0x50b8('0x27')](function(_0x320523){_0x24b248=_0x320523;return _0x17d27f['addCustomFields'](_0x320523,{'transaction':_0x26f6db});})[_0x50b8('0x27')](function(){var _0xa49054={'type':db[_0x50b8('0x7d')][_0x50b8('0x7e')],'transaction':_0x26f6db};switch(_0x1578ae['body'][_0x50b8('0x30')]){case _0x50b8('0x7f'):_0xa49054[_0x50b8('0x30')]=db['Sequelize'][_0x50b8('0x7e')];break;case _0x50b8('0x80'):_0xa49054[_0x50b8('0x30')]=db[_0x50b8('0x7d')]['INTEGER'];break;case'switch':_0xa49054['type']=db[_0x50b8('0x7d')][_0x50b8('0x81')];_0xa49054['defaultValue']=![];break;default:}return db['sequelize'][_0x50b8('0x82')]['addColumn'](_0x50b8('0x83'),util[_0x50b8('0x6f')](_0x50b8('0x84'),_0x24b248['id']),_0xa49054);})[_0x50b8('0x27')](function(){return _0x24b248;});});}})[_0x50b8('0x27')](respondWithResult(_0x4e842a,null))[_0x50b8('0x45')](handleError(_0x4e842a,null));};exports[_0x50b8('0x85')]=function(_0x9a89a4,_0xe5deb,_0x804b18){var _0x22612e={};var _0x5e52c2={};var _0x3c58cb;var _0x332293;return db['CmList'][_0x50b8('0x59')]({'where':{'id':_0x9a89a4[_0x50b8('0x53')]['id']}})[_0x50b8('0x27')](handleEntityNotFound(_0xe5deb,null))[_0x50b8('0x27')](function(_0x5eeb66){if(_0x5eeb66){_0x3c58cb=_0x5eeb66;_0x5e52c2[_0x50b8('0x34')]=_[_0x50b8('0x5a')](db[_0x50b8('0x69')][_0x50b8('0x2e')]);_0x5e52c2[_0x50b8('0x31')]=_[_0x50b8('0x5a')](_0x9a89a4[_0x50b8('0x31')]);_0x5e52c2[_0x50b8('0x32')]=_[_0x50b8('0x33')](_0x5e52c2[_0x50b8('0x34')],_0x5e52c2[_0x50b8('0x31')]);_0x22612e['attributes']=_[_0x50b8('0x33')](_0x5e52c2[_0x50b8('0x34')],qs['fields'](_0x9a89a4[_0x50b8('0x31')]['fields']));_0x22612e['attributes']=_0x22612e[_0x50b8('0x35')][_0x50b8('0x37')]?_0x22612e[_0x50b8('0x35')]:_0x5e52c2[_0x50b8('0x34')];_0x22612e[_0x50b8('0x39')]=qs[_0x50b8('0x3a')](_0x9a89a4['query'][_0x50b8('0x3a')]);_0x22612e[_0x50b8('0x3d')]=qs[_0x50b8('0x32')](_[_0x50b8('0x3b')](_0x9a89a4[_0x50b8('0x31')],_0x5e52c2['filters']));_0x22612e['where']=_[_0x50b8('0x3e')](_0x22612e['where'],{'$or':[{'ListId':_0x5eeb66['id']},{'ListId':null}]});if(_0x9a89a4[_0x50b8('0x31')]['filter']){_0x22612e[_0x50b8('0x3d')]=_[_0x50b8('0x3e')](_0x22612e[_0x50b8('0x3d')],{'$or':_[_0x50b8('0x2c')](_0x22612e['attributes'],function(_0x3a7fa4){var _0xa1fba={};_0xa1fba[_0x3a7fa4]={'$like':'%'+_0x9a89a4['query'][_0x50b8('0x3c')]+'%'};return _0xa1fba;})});}_0x22612e=_[_0x50b8('0x3e')]({},_0x22612e,_0x9a89a4['options']);return db[_0x50b8('0x69')][_0x50b8('0x86')](_0x22612e);}})['then'](respondWithResult(_0xe5deb,null))[_0x50b8('0x45')](handleError(_0xe5deb,null));};exports['addAgents']=function(_0x283e10,_0x1f0e81,_0x2cb187){return db[_0x50b8('0x2d')]['find']({'where':{'id':_0x283e10[_0x50b8('0x53')]['id']}})['then'](handleEntityNotFound(_0x1f0e81,null))[_0x50b8('0x27')](function(_0x5e433d){if(_0x5e433d){return _0x5e433d['addAgents'](_0x283e10[_0x50b8('0x52')][_0x50b8('0x63')],_[_0x50b8('0x62')](_0x283e10[_0x50b8('0x52')],[_0x50b8('0x63'),'id'])||{})[_0x50b8('0x87')](function(_0x343fc8){for(var _0x58d87c=0x0;_0x58d87c<_0x283e10[_0x50b8('0x52')][_0x50b8('0x63')][_0x50b8('0x37')];_0x58d87c+=0x1){socket[_0x50b8('0x88')](_0x50b8('0x89'),{'UserId':Number(_0x283e10[_0x50b8('0x52')]['ids'][_0x58d87c]),'CmListId':Number(_0x283e10[_0x50b8('0x53')]['id'])});}return _0x343fc8;});}})[_0x50b8('0x27')](respondWithResult(_0x1f0e81,null))[_0x50b8('0x45')](handleError(_0x1f0e81,null));};exports[_0x50b8('0x8a')]=function(_0x270a83,_0x41da18,_0x36d393){return db[_0x50b8('0x2d')]['find']({'where':{'id':_0x270a83[_0x50b8('0x53')]['id']}})[_0x50b8('0x27')](handleEntityNotFound(_0x41da18,null))['then'](function(_0x1227ac){if(_0x1227ac){return _0x1227ac[_0x50b8('0x8a')](_0x270a83['query'][_0x50b8('0x63')])[_0x50b8('0x27')](function(){if(_['isArray'](_0x270a83[_0x50b8('0x31')][_0x50b8('0x63')])){for(var _0x28660f=0x0;_0x28660f<_0x270a83[_0x50b8('0x31')]['ids']['length'];_0x28660f+=0x1){socket['emit'](_0x50b8('0x8b'),{'UserId':Number(_0x270a83[_0x50b8('0x31')][_0x50b8('0x63')][_0x28660f]),'CmListId':Number(_0x270a83[_0x50b8('0x53')]['id'])});}}else{socket[_0x50b8('0x88')](_0x50b8('0x8b'),{'UserId':Number(_0x270a83[_0x50b8('0x31')][_0x50b8('0x63')]),'CmListId':Number(_0x270a83[_0x50b8('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x41da18,null))['catch'](handleError(_0x41da18,null));};exports[_0x50b8('0x8c')]=function(_0x37edfa,_0x5d6a5e,_0x3f4eee){var _0x308033={};var _0x213f3e={};var _0x44724b;var _0x11c4b3;return db[_0x50b8('0x2d')][_0x50b8('0x59')]({'where':{'id':_0x37edfa[_0x50b8('0x53')]['id']}})['then'](handleEntityNotFound(_0x5d6a5e,null))['then'](function(_0x4eed67){if(_0x4eed67){_0x44724b=_0x4eed67;_0x213f3e[_0x50b8('0x34')]=_[_0x50b8('0x5a')](db[_0x50b8('0x8d')]['rawAttributes']);_0x213f3e[_0x50b8('0x31')]=_[_0x50b8('0x5a')](_0x37edfa[_0x50b8('0x31')]);_0x213f3e[_0x50b8('0x32')]=_['intersection'](_0x213f3e['model'],_0x213f3e[_0x50b8('0x31')]);_0x308033['attributes']=_['intersection'](_0x213f3e[_0x50b8('0x34')],qs[_0x50b8('0x36')](_0x37edfa[_0x50b8('0x31')]['fields']));_0x308033[_0x50b8('0x35')]=_0x308033[_0x50b8('0x35')][_0x50b8('0x37')]?_0x308033[_0x50b8('0x35')]:_0x213f3e['model'];_0x308033[_0x50b8('0x39')]=qs[_0x50b8('0x3a')](_0x37edfa['query']['sort']);_0x308033[_0x50b8('0x3d')]=qs[_0x50b8('0x32')](_[_0x50b8('0x3b')](_0x37edfa[_0x50b8('0x31')],_0x213f3e['filters']));if(_0x37edfa[_0x50b8('0x31')]['filter']){_0x308033[_0x50b8('0x3d')]=_[_0x50b8('0x3e')](_0x308033[_0x50b8('0x3d')],{'$or':_['map'](_0x308033[_0x50b8('0x35')],function(_0x33df20){var _0x1925f6={};_0x1925f6[_0x33df20]={'$like':'%'+_0x37edfa['query'][_0x50b8('0x3c')]+'%'};return _0x1925f6;})});}_0x308033=_[_0x50b8('0x3e')]({},_0x308033,_0x37edfa[_0x50b8('0x40')]);return _0x44724b['getAgents'](_0x308033);}})[_0x50b8('0x27')](function(_0x47c759){if(_0x47c759){_0x11c4b3=_0x47c759[_0x50b8('0x37')];if(!_0x37edfa[_0x50b8('0x31')]['hasOwnProperty']('nolimit')){_0x308033['limit']=qs[_0x50b8('0x1f')](_0x37edfa[_0x50b8('0x31')][_0x50b8('0x1f')]);_0x308033[_0x50b8('0x1d')]=qs[_0x50b8('0x1d')](_0x37edfa[_0x50b8('0x31')]['offset']);}return _0x44724b[_0x50b8('0x8c')](_0x308033);}})[_0x50b8('0x27')](function(_0x5a79ef){if(_0x5a79ef){return _0x5a79ef?{'count':_0x11c4b3,'rows':_0x5a79ef}:null;}})[_0x50b8('0x27')](respondWithResult(_0x5d6a5e,null))[_0x50b8('0x45')](handleError(_0x5d6a5e,null));}; \ No newline at end of file +var _0xe592=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','Lists','UserProfileResource','sendStatus','error','name','send','index','CmList','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','findOne','rawAttributes','ListId','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','omit','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','getContactsCsv','raw','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format'];(function(_0x30aba0,_0xedc6e8){var _0x1a1cfd=function(_0x4a7cbb){while(--_0x4a7cbb){_0x30aba0['push'](_0x30aba0['shift']());}};_0x1a1cfd(++_0xedc6e8);}(_0xe592,0x1a6));var _0x2e59=function(_0x5f25b3,_0x35481a){_0x5f25b3=_0x5f25b3-0x0;var _0x4ab9bf=_0xe592[_0x5f25b3];return _0x4ab9bf;};'use strict';var emlformat=require(_0x2e59('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2e59('0x1'));var rp=require(_0x2e59('0x2'));var moment=require(_0x2e59('0x3'));var BPromise=require(_0x2e59('0x4'));var Mustache=require(_0x2e59('0x5'));var util=require(_0x2e59('0x6'));var path=require(_0x2e59('0x7'));var sox=require(_0x2e59('0x8'));var csv=require(_0x2e59('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e59('0xa'));var _=require('lodash');var squel=require(_0x2e59('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2e59('0xc'));var toCsv=require(_0x2e59('0x9'));var querystring=require(_0x2e59('0xd'));var Papa=require('papaparse');var Redis=require(_0x2e59('0xe'));var authService=require(_0x2e59('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2e59('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e59('0x11'))(_0x2e59('0x12'));var utils=require(_0x2e59('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2e59('0x14'));var db=require(_0x2e59('0x15'))['db'];config[_0x2e59('0x16')]=_[_0x2e59('0x17')](config['redis'],{'host':_0x2e59('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e59('0x16')]));require(_0x2e59('0x19'))[_0x2e59('0x1a')](socket);function respondWithStatusCode(_0x2e276f,_0x4332f0){_0x4332f0=_0x4332f0||0xcc;return function(_0x1c0dbf){if(_0x1c0dbf){return _0x2e276f['sendStatus'](_0x4332f0);}return _0x2e276f[_0x2e59('0x1b')](_0x4332f0)[_0x2e59('0x1c')]();};}function respondWithResult(_0x40cc2c,_0x1b43cb){_0x1b43cb=_0x1b43cb||0xc8;return function(_0x57ed4a){if(_0x57ed4a){return _0x40cc2c[_0x2e59('0x1b')](_0x1b43cb)[_0x2e59('0x1d')](_0x57ed4a);}};}function respondWithFilteredResult(_0x328d6d,_0x3a9874){return function(_0x4a3f07){if(_0x4a3f07){var _0x4f32ea=typeof _0x3a9874['offset']===_0x2e59('0x1e')&&typeof _0x3a9874[_0x2e59('0x1f')]===_0x2e59('0x1e');var _0x59f3b8=_0x4a3f07[_0x2e59('0x20')];var _0xb5d62d=_0x4f32ea?0x0:_0x3a9874[_0x2e59('0x21')];var _0x28eda7=_0x4f32ea?_0x4a3f07[_0x2e59('0x20')]:_0x3a9874[_0x2e59('0x21')]+_0x3a9874[_0x2e59('0x1f')];var _0x5d1b64;if(_0x28eda7>=_0x59f3b8){_0x28eda7=_0x59f3b8;_0x5d1b64=0xc8;}else{_0x5d1b64=0xce;}_0x328d6d['status'](_0x5d1b64);return _0x328d6d[_0x2e59('0x22')](_0x2e59('0x23'),_0xb5d62d+'-'+_0x28eda7+'/'+_0x59f3b8)[_0x2e59('0x1d')](_0x4a3f07);}return null;};}function patchUpdates(_0xd8041e){return function(_0x4115d6){try{jsonpatch[_0x2e59('0x24')](_0x4115d6,_0xd8041e,!![]);}catch(_0x1fd6ad){return BPromise[_0x2e59('0x25')](_0x1fd6ad);}return _0x4115d6[_0x2e59('0x26')]();};}function saveUpdates(_0x43aadf,_0x341ec2){return function(_0x27f0e4){if(_0x27f0e4){return _0x27f0e4[_0x2e59('0x27')](_0x43aadf)[_0x2e59('0x28')](function(_0x27ab4d){return _0x27ab4d;});}return null;};}function removeEntity(_0xc8cc9,_0x16de44){return function(_0x3e805c){if(_0x3e805c){return _0x3e805c[_0x2e59('0x29')]()[_0x2e59('0x28')](function(){var _0x3680c9=_0x3e805c['get']({'plain':!![]});var _0x3f4d74=_0x2e59('0x2a');return db[_0x2e59('0x2b')][_0x2e59('0x29')]({'where':{'type':_0x3f4d74,'resourceId':_0x3680c9['id']}})[_0x2e59('0x28')](function(){return _0x3e805c;});})[_0x2e59('0x28')](function(){_0xc8cc9['status'](0xcc)[_0x2e59('0x1c')]();});}};}function handleEntityNotFound(_0x5397a6,_0x227992){return function(_0x47d04a){if(!_0x47d04a){_0x5397a6[_0x2e59('0x2c')](0x194);}return _0x47d04a;};}function handleError(_0x3e0de9,_0x59ab9c){_0x59ab9c=_0x59ab9c||0x1f4;return function(_0x34c4eb){logger[_0x2e59('0x2d')](_0x34c4eb['stack']);if(_0x34c4eb[_0x2e59('0x2e')]){delete _0x34c4eb[_0x2e59('0x2e')];}_0x3e0de9[_0x2e59('0x1b')](_0x59ab9c)[_0x2e59('0x2f')](_0x34c4eb);};}exports[_0x2e59('0x30')]=function(_0x4ed7c7,_0x1f8e7b){var _0x114b9a={},_0x431ef6={},_0x40184e={'count':0x0,'rows':[]};var _0x14b4f8=_['map'](db[_0x2e59('0x31')]['rawAttributes'],function(_0x368363){return{'name':_0x368363[_0x2e59('0x32')],'type':_0x368363[_0x2e59('0x33')][_0x2e59('0x34')]};});_0x431ef6[_0x2e59('0x35')]=_[_0x2e59('0x36')](_0x14b4f8,_0x2e59('0x2e'));_0x431ef6[_0x2e59('0x37')]=_['keys'](_0x4ed7c7['query']);_0x431ef6[_0x2e59('0x38')]=_[_0x2e59('0x39')](_0x431ef6['model'],_0x431ef6[_0x2e59('0x37')]);_0x114b9a[_0x2e59('0x3a')]=_[_0x2e59('0x39')](_0x431ef6['model'],qs[_0x2e59('0x3b')](_0x4ed7c7['query']['fields']));_0x114b9a[_0x2e59('0x3a')]=_0x114b9a[_0x2e59('0x3a')][_0x2e59('0x3c')]?_0x114b9a['attributes']:_0x431ef6[_0x2e59('0x35')];if(!_0x4ed7c7[_0x2e59('0x37')][_0x2e59('0x3d')](_0x2e59('0x3e'))){_0x114b9a[_0x2e59('0x1f')]=qs[_0x2e59('0x1f')](_0x4ed7c7[_0x2e59('0x37')]['limit']);_0x114b9a[_0x2e59('0x21')]=qs[_0x2e59('0x21')](_0x4ed7c7[_0x2e59('0x37')]['offset']);}_0x114b9a[_0x2e59('0x3f')]=qs[_0x2e59('0x40')](_0x4ed7c7[_0x2e59('0x37')]['sort']);_0x114b9a['where']=qs[_0x2e59('0x38')](_[_0x2e59('0x41')](_0x4ed7c7[_0x2e59('0x37')],_0x431ef6[_0x2e59('0x38')]),_0x14b4f8);if(_0x4ed7c7[_0x2e59('0x37')]['filter']){_0x114b9a[_0x2e59('0x42')]=_[_0x2e59('0x43')](_0x114b9a[_0x2e59('0x42')],{'$or':_[_0x2e59('0x36')](_0x14b4f8,function(_0x44adc5){if(_0x44adc5[_0x2e59('0x33')]!==_0x2e59('0x44')){var _0x3d99c8={};_0x3d99c8[_0x44adc5['name']]={'$like':'%'+_0x4ed7c7['query'][_0x2e59('0x45')]+'%'};return _0x3d99c8;}})});}_0x114b9a=_[_0x2e59('0x43')]({},_0x114b9a,_0x4ed7c7[_0x2e59('0x46')]);var _0x5510f3={'where':_0x114b9a['where']};return db[_0x2e59('0x31')][_0x2e59('0x20')](_0x5510f3)[_0x2e59('0x28')](function(_0x2bee0a){_0x40184e[_0x2e59('0x20')]=_0x2bee0a;if(_0x4ed7c7[_0x2e59('0x37')][_0x2e59('0x47')]){_0x114b9a[_0x2e59('0x48')]=[{'all':!![]}];}return db[_0x2e59('0x31')][_0x2e59('0x49')](_0x114b9a);})[_0x2e59('0x28')](function(_0x283ec8){_0x40184e[_0x2e59('0x4a')]=_0x283ec8;return _0x40184e;})[_0x2e59('0x28')](respondWithFilteredResult(_0x1f8e7b,_0x114b9a))['catch'](handleError(_0x1f8e7b,null));};exports[_0x2e59('0x4b')]=function(_0x323125,_0x31844a){var _0x2e7ec5={'raw':![],'where':{'id':_0x323125[_0x2e59('0x4c')]['id']}},_0x1582a9={};_0x1582a9[_0x2e59('0x35')]=_[_0x2e59('0x4d')](db[_0x2e59('0x31')]['rawAttributes']);_0x1582a9['query']=_['keys'](_0x323125[_0x2e59('0x37')]);_0x1582a9[_0x2e59('0x38')]=_[_0x2e59('0x39')](_0x1582a9['model'],_0x1582a9['query']);_0x2e7ec5[_0x2e59('0x3a')]=_[_0x2e59('0x39')](_0x1582a9['model'],qs[_0x2e59('0x3b')](_0x323125['query'][_0x2e59('0x3b')]));_0x2e7ec5[_0x2e59('0x3a')]=_0x2e7ec5['attributes']['length']?_0x2e7ec5['attributes']:_0x1582a9['model'];if(_0x323125[_0x2e59('0x37')][_0x2e59('0x47')]){_0x2e7ec5[_0x2e59('0x48')]=[{'all':!![]}];}_0x2e7ec5=_[_0x2e59('0x43')]({},_0x2e7ec5,_0x323125[_0x2e59('0x46')]);return db[_0x2e59('0x31')][_0x2e59('0x4e')](_0x2e7ec5)[_0x2e59('0x28')](handleEntityNotFound(_0x31844a,null))[_0x2e59('0x28')](respondWithResult(_0x31844a,null))[_0x2e59('0x4f')](handleError(_0x31844a,null));};exports[_0x2e59('0x50')]=function(_0x34bbdc,_0x270508){return db['CmList'][_0x2e59('0x50')](_0x34bbdc[_0x2e59('0x51')],{})[_0x2e59('0x28')](function(_0xc34379){var _0x86acce=_0x34bbdc['user'][_0x2e59('0x52')]({'plain':!![]});if(!_0x86acce)throw new Error(_0x2e59('0x53'));if(_0x86acce['role']==='user'){var _0x29420e=_0xc34379[_0x2e59('0x52')]({'plain':!![]});var _0x36b77c=_0x2e59('0x2a');return db['UserProfileSection'][_0x2e59('0x4e')]({'where':{'name':_0x36b77c,'userProfileId':_0x86acce[_0x2e59('0x54')]},'raw':!![]})[_0x2e59('0x28')](function(_0x232fd1){if(_0x232fd1&&_0x232fd1[_0x2e59('0x55')]===0x0){return db[_0x2e59('0x2b')][_0x2e59('0x50')]({'name':_0x29420e[_0x2e59('0x2e')],'resourceId':_0x29420e['id'],'type':_0x232fd1[_0x2e59('0x2e')],'sectionId':_0x232fd1['id']},{})[_0x2e59('0x28')](function(){return _0xc34379;});}else{return _0xc34379;}})[_0x2e59('0x4f')](function(_0x34c907){logger[_0x2e59('0x2d')](_0x2e59('0x56'),_0x34c907);throw _0x34c907;});}return _0xc34379;})[_0x2e59('0x28')](respondWithResult(_0x270508,0xc9))[_0x2e59('0x4f')](handleError(_0x270508,null));};exports[_0x2e59('0x27')]=function(_0x16580c,_0xb057cb){if(_0x16580c[_0x2e59('0x51')]['id']){delete _0x16580c[_0x2e59('0x51')]['id'];}return db[_0x2e59('0x31')]['find']({'where':{'id':_0x16580c[_0x2e59('0x4c')]['id']}})['then'](handleEntityNotFound(_0xb057cb,null))[_0x2e59('0x28')](saveUpdates(_0x16580c[_0x2e59('0x51')],null))[_0x2e59('0x28')](respondWithResult(_0xb057cb,null))['catch'](handleError(_0xb057cb,null));};exports['destroy']=function(_0x2276d1,_0xf2a8cc){return db[_0x2e59('0x31')][_0x2e59('0x4e')]({'where':{'id':_0x2276d1[_0x2e59('0x4c')]['id']}})['then'](handleEntityNotFound(_0xf2a8cc,null))[_0x2e59('0x28')](removeEntity(_0xf2a8cc,null))[_0x2e59('0x4f')](handleError(_0xf2a8cc,null));};exports['describe']=function(_0x3b8d25,_0x5b6d69){return db[_0x2e59('0x31')][_0x2e59('0x57')]()[_0x2e59('0x28')](respondWithResult(_0x5b6d69,null))['catch'](handleError(_0x5b6d69,null));};exports['addDisposition']=function(_0x4cfc25,_0x281414,_0x30791e){if(_0x4cfc25[_0x2e59('0x51')]['id']){delete _0x4cfc25['body']['id'];}return db[_0x2e59('0x31')][_0x2e59('0x4e')]({'where':{'id':_0x4cfc25[_0x2e59('0x4c')]['id']}})[_0x2e59('0x28')](handleEntityNotFound(_0x281414,null))[_0x2e59('0x28')](function(_0x47b083){if(_0x47b083){_0x4cfc25[_0x2e59('0x51')]['ListId']=_0x47b083['id'];return db[_0x2e59('0x58')]['create'](_0x4cfc25[_0x2e59('0x51')]);}})[_0x2e59('0x28')](respondWithResult(_0x281414,null))[_0x2e59('0x4f')](handleError(_0x281414,null));};exports['getDispositions']=function(_0x1aa8b5,_0x30271f,_0x4342ed){var _0x33d244={'raw':![],'where':{}};var _0x143266={};var _0x338617={'count':0x0,'rows':[]};return db[_0x2e59('0x31')][_0x2e59('0x59')]({'where':{'id':_0x1aa8b5[_0x2e59('0x4c')]['id']}})[_0x2e59('0x28')](handleEntityNotFound(_0x30271f,null))[_0x2e59('0x28')](function(_0x18522f){if(_0x18522f){_0x143266[_0x2e59('0x35')]=_[_0x2e59('0x4d')](db[_0x2e59('0x58')][_0x2e59('0x5a')]);_0x143266[_0x2e59('0x37')]=_[_0x2e59('0x4d')](_0x1aa8b5[_0x2e59('0x37')]);_0x143266['filters']=_[_0x2e59('0x39')](_0x143266[_0x2e59('0x35')],_0x143266[_0x2e59('0x37')]);_0x33d244['attributes']=_[_0x2e59('0x39')](_0x143266[_0x2e59('0x35')],qs['fields'](_0x1aa8b5['query'][_0x2e59('0x3b')]));_0x33d244[_0x2e59('0x3a')]=_0x33d244[_0x2e59('0x3a')][_0x2e59('0x3c')]?_0x33d244[_0x2e59('0x3a')]:_0x143266['model'];if(!_0x1aa8b5['query'][_0x2e59('0x3d')]('nolimit')){_0x33d244['limit']=qs[_0x2e59('0x1f')](_0x1aa8b5[_0x2e59('0x37')][_0x2e59('0x1f')]);_0x33d244['offset']=qs[_0x2e59('0x21')](_0x1aa8b5[_0x2e59('0x37')][_0x2e59('0x21')]);}_0x33d244[_0x2e59('0x3f')]=qs[_0x2e59('0x40')](_0x1aa8b5[_0x2e59('0x37')][_0x2e59('0x40')]);_0x33d244[_0x2e59('0x42')]=qs['filters'](_[_0x2e59('0x41')](_0x1aa8b5[_0x2e59('0x37')],_0x143266[_0x2e59('0x38')]));_0x33d244['where'][_0x2e59('0x5b')]=_0x18522f['id'];if(_0x1aa8b5[_0x2e59('0x37')][_0x2e59('0x45')]){_0x33d244['where']=_[_0x2e59('0x43')](_0x33d244[_0x2e59('0x42')],{'$or':_[_0x2e59('0x36')](_0x33d244[_0x2e59('0x3a')],function(_0x34bab5){var _0x29c84a={};_0x29c84a[_0x34bab5]={'$like':'%'+_0x1aa8b5['query'][_0x2e59('0x45')]+'%'};return _0x29c84a;})});}_0x33d244=_['merge']({},_0x33d244,_0x1aa8b5['options']);return db[_0x2e59('0x58')][_0x2e59('0x20')]({'where':_0x33d244[_0x2e59('0x42')]})[_0x2e59('0x28')](function(_0x56adf2){_0x338617['count']=_0x56adf2;if(_0x1aa8b5[_0x2e59('0x37')][_0x2e59('0x47')]){_0x33d244[_0x2e59('0x48')]=[{'all':!![]}];}return db['Disposition'][_0x2e59('0x49')](_0x33d244);})[_0x2e59('0x28')](function(_0x5a10cc){_0x338617[_0x2e59('0x4a')]=_0x5a10cc;return _0x338617;});}})[_0x2e59('0x28')](respondWithFilteredResult(_0x30271f,_0x33d244))[_0x2e59('0x4f')](handleError(_0x30271f,null));};exports[_0x2e59('0x5c')]=function(_0x31b332,_0x15250a,_0x21dfe8){return db[_0x2e59('0x31')]['find']({'where':{'id':_0x31b332[_0x2e59('0x4c')]['id']}})[_0x2e59('0x28')](handleEntityNotFound(_0x15250a,null))[_0x2e59('0x28')](function(_0x1886da){if(_0x1886da){return _0x1886da[_0x2e59('0x5c')](_0x31b332['query'][_0x2e59('0x5d')]);}})[_0x2e59('0x28')](respondWithStatusCode(_0x15250a,null))[_0x2e59('0x4f')](handleError(_0x15250a,null));};exports[_0x2e59('0x5e')]=function(_0x78e5e6,_0x25b910,_0x170bc9){return db['CmList'][_0x2e59('0x4e')]({'where':{'id':_0x78e5e6[_0x2e59('0x4c')]['id']}})[_0x2e59('0x28')](handleEntityNotFound(_0x25b910,null))[_0x2e59('0x28')](function(_0xa53907){if(_0xa53907){var _0x481479=[];var _0xfdd3c7={'success':[],'errors':[]};return db[_0x2e59('0x5f')]['describe']()[_0x2e59('0x28')](function(_0x225d37){if(_0x78e5e6[_0x2e59('0x51')][_0x2e59('0x60')]&&_['isArray'](_0x78e5e6[_0x2e59('0x51')][_0x2e59('0x60')])){if(_0x78e5e6[_0x2e59('0x51')][_0x2e59('0x60')]['length']){_0x78e5e6[_0x2e59('0x51')][_0x2e59('0x60')]=_0x78e5e6[_0x2e59('0x51')][_0x2e59('0x60')]['join'](';')+';';}else{_0x78e5e6[_0x2e59('0x51')][_0x2e59('0x60')]=null;}}else{_0x78e5e6[_0x2e59('0x51')][_0x2e59('0x60')]=null;}if(_0x78e5e6[_0x2e59('0x51')]&&_[_0x2e59('0x61')](_0x78e5e6[_0x2e59('0x51')])){for(var _0x45ee70=0x0;_0x45ee70<_0x78e5e6[_0x2e59('0x51')][_0x2e59('0x3c')];_0x45ee70+=0x1){_0x78e5e6[_0x2e59('0x51')][_0x45ee70][_0x2e59('0x5b')]=_0x78e5e6[_0x2e59('0x4c')]['id'];_0x481479[_0x2e59('0x62')](_0x78e5e6[_0x2e59('0x51')][_0x45ee70]);}return BPromise['each'](_0x481479,function(_0x531a32){return db['CmContact'][_0x2e59('0x50')](_[_0x2e59('0x63')](_0x531a32,[_0x2e59('0x5d'),'id'])||{},{'fields':_[_0x2e59('0x4d')](_0x225d37),'raw':!![]})[_0x2e59('0x28')](function(_0x616d14){_0xfdd3c7['success'][_0x2e59('0x62')](_0x616d14['dataValues']);})[_0x2e59('0x4f')](function(_0x2a7ade){_0xfdd3c7[_0x2e59('0x64')][_0x2e59('0x62')]({'data':_0x531a32,'error':_0x2a7ade['message']});});})[_0x2e59('0x28')](function(_0x3ee394){return _0xfdd3c7;})[_0x2e59('0x4f')](function(_0x564752){return _0x564752;});}else{_0x25b910[_0x2e59('0x1b')](0x190)['json']({'message':_0x2e59('0x65')});}});}})[_0x2e59('0x28')](respondWithResult(_0x25b910,null))[_0x2e59('0x4f')](handleError(_0x25b910,null));};exports[_0x2e59('0x66')]=function(_0x3d08f8,_0x5e8dca,_0x34114e){var _0x187ab2;return db[_0x2e59('0x31')][_0x2e59('0x4e')]({'where':{'id':_0x3d08f8[_0x2e59('0x4c')]['id']},'include':[{'model':db[_0x2e59('0x67')],'as':_0x2e59('0x68')}]})['then'](handleEntityNotFound(_0x5e8dca,null))[_0x2e59('0x28')](function(_0x2525f0){if(_0x2525f0){_0x187ab2=_0x2525f0;return db['CmContact']['rawAttributes'];}})[_0x2e59('0x28')](function(_0x56e0f7){if(_0x56e0f7){var _0x18d0e5={};var _0x57851c={};_0x57851c['model']=_[_0x2e59('0x69')](_[_0x2e59('0x4d')](_0x56e0f7),_[_0x2e59('0x36')](_0x187ab2[_0x2e59('0x68')],function(_0x2b0360){return util[_0x2e59('0x6a')](_0x2e59('0x6b'),_0x2b0360['id']);}));_0x57851c[_0x2e59('0x37')]=_['keys'](_0x3d08f8['query']);_0x57851c[_0x2e59('0x38')]=_[_0x2e59('0x39')](_0x57851c[_0x2e59('0x35')],_0x57851c[_0x2e59('0x37')]);_0x18d0e5[_0x2e59('0x3a')]=_[_0x2e59('0x39')](_0x57851c[_0x2e59('0x35')],qs[_0x2e59('0x3b')](_0x3d08f8['query']['fields']));_0x18d0e5[_0x2e59('0x3a')]=_0x18d0e5['attributes']['length']?_0x18d0e5[_0x2e59('0x3a')]:_0x57851c['model'];if(!_0x3d08f8[_0x2e59('0x37')][_0x2e59('0x3d')](_0x2e59('0x3e'))){_0x18d0e5['limit']=qs[_0x2e59('0x1f')](_0x3d08f8[_0x2e59('0x37')][_0x2e59('0x1f')]);_0x18d0e5['offset']=qs['offset'](_0x3d08f8[_0x2e59('0x37')][_0x2e59('0x21')]);}_0x18d0e5[_0x2e59('0x3f')]=qs[_0x2e59('0x40')](_0x3d08f8[_0x2e59('0x37')][_0x2e59('0x40')]);_0x18d0e5['where']=qs[_0x2e59('0x38')](_[_0x2e59('0x41')](_0x3d08f8[_0x2e59('0x37')],_0x57851c[_0x2e59('0x38')]));_0x18d0e5['raw']=!![];if(_0x3d08f8[_0x2e59('0x37')]['filter']){_0x18d0e5[_0x2e59('0x42')]=_[_0x2e59('0x43')](_0x18d0e5[_0x2e59('0x42')],{'$or':_[_0x2e59('0x36')](_0x18d0e5['attributes'],function(_0x50d05d){var _0x5d6880={};_0x5d6880[_0x50d05d]={'$like':'%'+_0x3d08f8[_0x2e59('0x37')][_0x2e59('0x45')]+'%'};return _0x5d6880;})});}_0x18d0e5=_[_0x2e59('0x43')]({},_0x18d0e5,_0x3d08f8[_0x2e59('0x46')]);return _0x187ab2['getContacts'](_0x18d0e5);}})[_0x2e59('0x28')](respondWithResult(_0x5e8dca,null))[_0x2e59('0x4f')](handleError(_0x5e8dca,null));};exports[_0x2e59('0x6c')]=function(_0x544e31,_0x2839ff,_0xf3b0ae){var _0x4c6aff;return db[_0x2e59('0x31')]['find']({'where':{'id':_0x544e31[_0x2e59('0x4c')]['id']},'include':[{'model':db[_0x2e59('0x67')],'as':_0x2e59('0x68')}]})[_0x2e59('0x28')](handleEntityNotFound(_0x2839ff,null))[_0x2e59('0x28')](function(_0x506a82){if(_0x506a82){_0x4c6aff=_0x506a82;return db[_0x2e59('0x5f')][_0x2e59('0x5a')];}})['then'](function(_0x5aabb9){if(_0x5aabb9){var _0x3bdbe2={};var _0x5eae16={};_0x5eae16['model']=_['concat'](_[_0x2e59('0x4d')](_0x5aabb9),_[_0x2e59('0x36')](_0x4c6aff[_0x2e59('0x68')],function(_0x5d1986){return util['format'](_0x2e59('0x6b'),_0x5d1986['id']);}));_0x5eae16[_0x2e59('0x37')]=_[_0x2e59('0x4d')](_0x544e31['query']);_0x5eae16[_0x2e59('0x38')]=_[_0x2e59('0x39')](_0x5eae16[_0x2e59('0x35')],_0x5eae16[_0x2e59('0x37')]);_0x3bdbe2[_0x2e59('0x3a')]=_[_0x2e59('0x39')](_0x5eae16['model'],qs['fields'](_0x544e31[_0x2e59('0x37')][_0x2e59('0x3b')]));_0x3bdbe2[_0x2e59('0x3a')]=_0x3bdbe2[_0x2e59('0x3a')][_0x2e59('0x3c')]?_0x3bdbe2['attributes']:_0x5eae16[_0x2e59('0x35')];if(!_0x544e31[_0x2e59('0x37')][_0x2e59('0x3d')]('nolimit')){_0x3bdbe2['limit']=qs['limit'](_0x544e31[_0x2e59('0x37')][_0x2e59('0x1f')]);_0x3bdbe2[_0x2e59('0x21')]=qs[_0x2e59('0x21')](_0x544e31[_0x2e59('0x37')][_0x2e59('0x21')]);}_0x3bdbe2[_0x2e59('0x3f')]=qs[_0x2e59('0x40')](_0x544e31[_0x2e59('0x37')][_0x2e59('0x40')]);_0x3bdbe2[_0x2e59('0x42')]=qs[_0x2e59('0x38')](_[_0x2e59('0x41')](_0x544e31['query'],_0x5eae16[_0x2e59('0x38')]));_0x3bdbe2[_0x2e59('0x6d')]=!![];if(_0x544e31[_0x2e59('0x37')][_0x2e59('0x45')]){_0x3bdbe2[_0x2e59('0x42')]=_[_0x2e59('0x43')](_0x3bdbe2['where'],{'$or':_[_0x2e59('0x36')](_0x3bdbe2[_0x2e59('0x3a')],function(_0x244675){var _0x1dc610={};_0x1dc610[_0x244675]={'$like':'%'+_0x544e31['query'][_0x2e59('0x45')]+'%'};return _0x1dc610;})});}_0x3bdbe2=_[_0x2e59('0x43')]({},_0x3bdbe2,_0x544e31[_0x2e59('0x46')]);return _0x4c6aff[_0x2e59('0x66')](_0x3bdbe2);}})[_0x2e59('0x28')](function(_0x44d8f9){if(!_[_0x2e59('0x6e')](_0x44d8f9)){var _0x475ca8=toCsv(_0x44d8f9);var _0x2b3897=Date['now']();fs[_0x2e59('0x6f')](util[_0x2e59('0x6a')](_0x2e59('0x70'),_0x4c6aff['id'],_0x2b3897),_0x475ca8);_0x2839ff[_0x2e59('0x71')]('Content-disposition',_0x2e59('0x72')+util[_0x2e59('0x6a')](_0x2e59('0x73'),_0x4c6aff['id'],_0x2b3897));_0x2839ff[_0x2e59('0x71')](_0x2e59('0x74'),_0x2e59('0x75'));return _0x2839ff[_0x2e59('0x76')](util[_0x2e59('0x6a')]('/tmp/list_%d_%s.csv',_0x4c6aff['id'],_0x2b3897));}else{return _0x2839ff[_0x2e59('0x2c')](0xcc);}})[_0x2e59('0x4f')](handleError(_0x2839ff,null));};exports['addCustomField']=function(_0x3565ab,_0x2e3850,_0x2aaa7a){var _0x820a9f;delete _0x3565ab[_0x2e59('0x51')]['id'];return db[_0x2e59('0x31')][_0x2e59('0x59')]({'where':{'id':_0x3565ab['params']['id']}})['then'](handleEntityNotFound(_0x2e3850,null))[_0x2e59('0x28')](function(_0x448077){if(_0x448077){return db[_0x2e59('0x77')][_0x2e59('0x78')](function(_0xd4f793){return db[_0x2e59('0x67')][_0x2e59('0x50')](_0x3565ab['body'],{'transaction':_0xd4f793})[_0x2e59('0x28')](function(_0x50c9d6){_0x820a9f=_0x50c9d6;return _0x448077['addCustomFields'](_0x50c9d6,{'transaction':_0xd4f793});})[_0x2e59('0x28')](function(){var _0x386278={'type':db[_0x2e59('0x79')][_0x2e59('0x7a')],'transaction':_0xd4f793};switch(_0x3565ab[_0x2e59('0x51')][_0x2e59('0x33')]){case _0x2e59('0x7b'):_0x386278[_0x2e59('0x33')]=db[_0x2e59('0x79')][_0x2e59('0x7a')];break;case _0x2e59('0x7c'):_0x386278[_0x2e59('0x33')]=db[_0x2e59('0x79')][_0x2e59('0x7d')];break;case _0x2e59('0x7e'):_0x386278[_0x2e59('0x33')]=db[_0x2e59('0x79')][_0x2e59('0x7f')];_0x386278['defaultValue']=![];break;default:}return db[_0x2e59('0x77')][_0x2e59('0x80')][_0x2e59('0x81')](_0x2e59('0x82'),util[_0x2e59('0x6a')](_0x2e59('0x83'),_0x820a9f['id']),_0x386278);})['then'](function(){return _0x820a9f;});});}})[_0x2e59('0x28')](respondWithResult(_0x2e3850,null))[_0x2e59('0x4f')](handleError(_0x2e3850,null));};exports[_0x2e59('0x84')]=function(_0x25bf33,_0x48bc10,_0x593acb){var _0x1011ed={};var _0x1ae101={};var _0x1a6393;var _0x23c77a;return db[_0x2e59('0x31')][_0x2e59('0x59')]({'where':{'id':_0x25bf33[_0x2e59('0x4c')]['id']}})[_0x2e59('0x28')](handleEntityNotFound(_0x48bc10,null))['then'](function(_0x4c1116){if(_0x4c1116){_0x1a6393=_0x4c1116;_0x1ae101[_0x2e59('0x35')]=_[_0x2e59('0x4d')](db[_0x2e59('0x67')][_0x2e59('0x5a')]);_0x1ae101[_0x2e59('0x37')]=_['keys'](_0x25bf33[_0x2e59('0x37')]);_0x1ae101[_0x2e59('0x38')]=_[_0x2e59('0x39')](_0x1ae101['model'],_0x1ae101['query']);_0x1011ed[_0x2e59('0x3a')]=_['intersection'](_0x1ae101[_0x2e59('0x35')],qs[_0x2e59('0x3b')](_0x25bf33[_0x2e59('0x37')][_0x2e59('0x3b')]));_0x1011ed[_0x2e59('0x3a')]=_0x1011ed[_0x2e59('0x3a')][_0x2e59('0x3c')]?_0x1011ed[_0x2e59('0x3a')]:_0x1ae101[_0x2e59('0x35')];_0x1011ed[_0x2e59('0x3f')]=qs[_0x2e59('0x40')](_0x25bf33[_0x2e59('0x37')][_0x2e59('0x40')]);_0x1011ed['where']=qs['filters'](_[_0x2e59('0x41')](_0x25bf33[_0x2e59('0x37')],_0x1ae101['filters']));_0x1011ed['where']=_[_0x2e59('0x43')](_0x1011ed['where'],{'$or':[{'ListId':_0x4c1116['id']},{'ListId':null}]});if(_0x25bf33[_0x2e59('0x37')][_0x2e59('0x45')]){_0x1011ed[_0x2e59('0x42')]=_[_0x2e59('0x43')](_0x1011ed[_0x2e59('0x42')],{'$or':_[_0x2e59('0x36')](_0x1011ed[_0x2e59('0x3a')],function(_0x4bafce){var _0x4d00d3={};_0x4d00d3[_0x4bafce]={'$like':'%'+_0x25bf33[_0x2e59('0x37')]['filter']+'%'};return _0x4d00d3;})});}_0x1011ed=_[_0x2e59('0x43')]({},_0x1011ed,_0x25bf33['options']);return db[_0x2e59('0x67')][_0x2e59('0x85')](_0x1011ed);}})[_0x2e59('0x28')](respondWithResult(_0x48bc10,null))[_0x2e59('0x4f')](handleError(_0x48bc10,null));};exports[_0x2e59('0x86')]=function(_0x2eba62,_0x22b838,_0x7c086d){return db[_0x2e59('0x31')][_0x2e59('0x4e')]({'where':{'id':_0x2eba62['params']['id']}})[_0x2e59('0x28')](handleEntityNotFound(_0x22b838,null))[_0x2e59('0x28')](function(_0x38087a){if(_0x38087a){return _0x38087a[_0x2e59('0x86')](_0x2eba62[_0x2e59('0x51')][_0x2e59('0x5d')],_['omit'](_0x2eba62[_0x2e59('0x51')],[_0x2e59('0x5d'),'id'])||{})[_0x2e59('0x87')](function(_0x5413fb){for(var _0x1e2093=0x0;_0x1e2093<_0x2eba62[_0x2e59('0x51')][_0x2e59('0x5d')]['length'];_0x1e2093+=0x1){socket[_0x2e59('0x88')](_0x2e59('0x89'),{'UserId':Number(_0x2eba62[_0x2e59('0x51')]['ids'][_0x1e2093]),'CmListId':Number(_0x2eba62[_0x2e59('0x4c')]['id'])});}return _0x5413fb;});}})[_0x2e59('0x28')](respondWithResult(_0x22b838,null))[_0x2e59('0x4f')](handleError(_0x22b838,null));};exports[_0x2e59('0x8a')]=function(_0x22bcc5,_0x55d66c,_0x24bd41){return db[_0x2e59('0x31')][_0x2e59('0x4e')]({'where':{'id':_0x22bcc5[_0x2e59('0x4c')]['id']}})[_0x2e59('0x28')](handleEntityNotFound(_0x55d66c,null))[_0x2e59('0x28')](function(_0x314dcb){if(_0x314dcb){return _0x314dcb[_0x2e59('0x8a')](_0x22bcc5['query'][_0x2e59('0x5d')])[_0x2e59('0x28')](function(){if(_['isArray'](_0x22bcc5[_0x2e59('0x37')][_0x2e59('0x5d')])){for(var _0x3369b9=0x0;_0x3369b9<_0x22bcc5[_0x2e59('0x37')][_0x2e59('0x5d')][_0x2e59('0x3c')];_0x3369b9+=0x1){socket[_0x2e59('0x88')](_0x2e59('0x8b'),{'UserId':Number(_0x22bcc5[_0x2e59('0x37')][_0x2e59('0x5d')][_0x3369b9]),'CmListId':Number(_0x22bcc5[_0x2e59('0x4c')]['id'])});}}else{socket[_0x2e59('0x88')](_0x2e59('0x8b'),{'UserId':Number(_0x22bcc5[_0x2e59('0x37')][_0x2e59('0x5d')]),'CmListId':Number(_0x22bcc5['params']['id'])});}});}})[_0x2e59('0x28')](respondWithStatusCode(_0x55d66c,null))['catch'](handleError(_0x55d66c,null));};exports[_0x2e59('0x8c')]=function(_0x28c2a2,_0x3f08b2,_0x18cc23){var _0x14d6da={};var _0x5e05a4={};var _0x228135;var _0x119619;return db[_0x2e59('0x31')]['findOne']({'where':{'id':_0x28c2a2[_0x2e59('0x4c')]['id']}})[_0x2e59('0x28')](handleEntityNotFound(_0x3f08b2,null))[_0x2e59('0x28')](function(_0x8c4707){if(_0x8c4707){_0x228135=_0x8c4707;_0x5e05a4[_0x2e59('0x35')]=_[_0x2e59('0x4d')](db['User'][_0x2e59('0x5a')]);_0x5e05a4['query']=_['keys'](_0x28c2a2[_0x2e59('0x37')]);_0x5e05a4['filters']=_[_0x2e59('0x39')](_0x5e05a4['model'],_0x5e05a4['query']);_0x14d6da[_0x2e59('0x3a')]=_[_0x2e59('0x39')](_0x5e05a4['model'],qs[_0x2e59('0x3b')](_0x28c2a2[_0x2e59('0x37')][_0x2e59('0x3b')]));_0x14d6da[_0x2e59('0x3a')]=_0x14d6da[_0x2e59('0x3a')]['length']?_0x14d6da[_0x2e59('0x3a')]:_0x5e05a4[_0x2e59('0x35')];_0x14d6da[_0x2e59('0x3f')]=qs[_0x2e59('0x40')](_0x28c2a2[_0x2e59('0x37')]['sort']);_0x14d6da[_0x2e59('0x42')]=qs[_0x2e59('0x38')](_[_0x2e59('0x41')](_0x28c2a2[_0x2e59('0x37')],_0x5e05a4[_0x2e59('0x38')]));if(_0x28c2a2['query'][_0x2e59('0x45')]){_0x14d6da[_0x2e59('0x42')]=_[_0x2e59('0x43')](_0x14d6da['where'],{'$or':_[_0x2e59('0x36')](_0x14d6da[_0x2e59('0x3a')],function(_0x31317b){var _0x5ce5ff={};_0x5ce5ff[_0x31317b]={'$like':'%'+_0x28c2a2[_0x2e59('0x37')]['filter']+'%'};return _0x5ce5ff;})});}_0x14d6da=_[_0x2e59('0x43')]({},_0x14d6da,_0x28c2a2[_0x2e59('0x46')]);return _0x228135[_0x2e59('0x8c')](_0x14d6da);}})[_0x2e59('0x28')](function(_0x3bdc4b){if(_0x3bdc4b){_0x119619=_0x3bdc4b[_0x2e59('0x3c')];if(!_0x28c2a2[_0x2e59('0x37')]['hasOwnProperty']('nolimit')){_0x14d6da[_0x2e59('0x1f')]=qs[_0x2e59('0x1f')](_0x28c2a2['query'][_0x2e59('0x1f')]);_0x14d6da[_0x2e59('0x21')]=qs[_0x2e59('0x21')](_0x28c2a2[_0x2e59('0x37')]['offset']);}return _0x228135['getAgents'](_0x14d6da);}})[_0x2e59('0x28')](function(_0x26e7e4){if(_0x26e7e4){return _0x26e7e4?{'count':_0x119619,'rows':_0x26e7e4}:null;}})[_0x2e59('0x28')](respondWithResult(_0x3f08b2,null))[_0x2e59('0x4f')](handleError(_0x3f08b2,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index b8524be..6c09a2c 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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x5eea2d,_0x5ef0ae){_0x5eea2d=_0x5eea2d-0x0;var _0x3f156c=_0x3e74[_0x5eea2d];return _0x3f156c;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x37a9d7,_0x2b6fde){var _0x1343d3=function(_0x3bde45){while(--_0x3bde45){_0x37a9d7['push'](_0x37a9d7['shift']());}};_0x1343d3(++_0x2b6fde);}(_0x5fc3,0xa8));var _0x35fc=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0x5fc3[_0x35485a];return _0x5148e6;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 0f75c89..dc83e89 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 _0x2547=['rimraf','./cmList.attributes','exports','CmList','cm_lists','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4ba2d2,_0x9f2ef){var _0x179cc9=function(_0x89e18f){while(--_0x89e18f){_0x4ba2d2['push'](_0x4ba2d2['shift']());}};_0x179cc9(++_0x9f2ef);}(_0x2547,0x1cd));var _0x7254=function(_0x2f9523,_0x19c8d7){_0x2f9523=_0x2f9523-0x0;var _0xd88af0=_0x2547[_0x2f9523];return _0xd88af0;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var moment=require(_0x7254('0x3'));var BPromise=require(_0x7254('0x4'));var rp=require(_0x7254('0x5'));var fs=require('fs');var path=require(_0x7254('0x6'));var rimraf=require(_0x7254('0x7'));var config=require('../../config/environment');var attributes=require(_0x7254('0x8'));module[_0x7254('0x9')]=function(_0x67f427,_0x119f66){return _0x67f427['define'](_0x7254('0xa'),attributes,{'tableName':_0x7254('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./cmList.attributes','exports','define','CmList','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x356b97,_0x299f59){var _0x28265d=function(_0x4cf9de){while(--_0x4cf9de){_0x356b97['push'](_0x356b97['shift']());}};_0x28265d(++_0x299f59);}(_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 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':'cm_lists','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 a68452d..576f75c 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 _0x104c=['../../config/utils','../../config/logger','rpc','client','http','redis','defaults','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','bluebird','randomstring'];(function(_0x2bf5a4,_0x156ac3){var _0x15226e=function(_0x28b136){while(--_0x28b136){_0x2bf5a4['push'](_0x2bf5a4['shift']());}};_0x15226e(++_0x156ac3);}(_0x104c,0x110));var _0xc104=function(_0x19fcb8,_0x6b081e){_0x19fcb8=_0x19fcb8-0x0;var _0x3bd3b8=_0x104c[_0x19fcb8];return _0x3bd3b8;};'use strict';var _=require('lodash');var util=require(_0xc104('0x0'));var moment=require(_0xc104('0x1'));var BPromise=require(_0xc104('0x2'));var rs=require(_0xc104('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc104('0x4'));var logger=require(_0xc104('0x5'))(_0xc104('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc104('0x7')][_0xc104('0x8')]({'port':0x232a});config[_0xc104('0x9')]=_[_0xc104('0xa')](config[_0xc104('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc104('0x9')]));require(_0xc104('0xb'))[_0xc104('0xc')](socket);function respondWithRpcPromise(_0x4ff18f,_0x254614,_0x1162b8){return new BPromise(function(_0x41e8ae,_0x3ebc20){return client[_0xc104('0xd')](_0x4ff18f,_0x1162b8)[_0xc104('0xe')](function(_0x19804d){logger[_0xc104('0xf')](_0xc104('0x10'),_0x254614,_0xc104('0x11'));logger[_0xc104('0x12')]('CmList,\x20%s,\x20%s,\x20%s',_0x254614,_0xc104('0x11'),JSON[_0xc104('0x13')](_0x19804d));if(_0x19804d[_0xc104('0x14')]){if(_0x19804d['error']['code']===0x1f4){logger[_0xc104('0x14')](_0xc104('0x10'),_0x254614,_0x19804d[_0xc104('0x14')][_0xc104('0x15')]);return _0x3ebc20(_0x19804d[_0xc104('0x14')][_0xc104('0x15')]);}logger['error'](_0xc104('0x10'),_0x254614,_0x19804d[_0xc104('0x14')][_0xc104('0x15')]);return _0x41e8ae(_0x19804d['error'][_0xc104('0x15')]);}else{logger[_0xc104('0xf')](_0xc104('0x10'),_0x254614,_0xc104('0x11'));_0x41e8ae(_0x19804d['result']['message']);}})[_0xc104('0x16')](function(_0x5a78fd){logger['error']('CmList,\x20%s,\x20%s',_0x254614,_0x5a78fd);_0x3ebc20(_0x5a78fd);});});} \ No newline at end of file +var _0xd0d6=['request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s'];(function(_0x665e5e,_0x715c0b){var _0x213d01=function(_0x4d524d){while(--_0x4d524d){_0x665e5e['push'](_0x665e5e['shift']());}};_0x213d01(++_0x715c0b);}(_0xd0d6,0x164));var _0x6d0d=function(_0x4af70a,_0x1583cc){_0x4af70a=_0x4af70a-0x0;var _0x32e1d9=_0xd0d6[_0x4af70a];return _0x32e1d9;};'use strict';var _=require(_0x6d0d('0x0'));var util=require(_0x6d0d('0x1'));var moment=require(_0x6d0d('0x2'));var BPromise=require(_0x6d0d('0x3'));var rs=require(_0x6d0d('0x4'));var fs=require('fs');var Redis=require(_0x6d0d('0x5'));var db=require(_0x6d0d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d0d('0x7'))(_0x6d0d('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d0d('0x9'));var client=jayson[_0x6d0d('0xa')][_0x6d0d('0xb')]({'port':0x232a});config[_0x6d0d('0xc')]=_[_0x6d0d('0xd')](config['redis'],{'host':_0x6d0d('0xe'),'port':0x18eb});var socket=require(_0x6d0d('0xf'))(new Redis(config[_0x6d0d('0xc')]));require(_0x6d0d('0x10'))[_0x6d0d('0x11')](socket);function respondWithRpcPromise(_0x2cd59e,_0x3ea3ff,_0x10afbe){return new BPromise(function(_0x5d2750,_0x1210c9){return client[_0x6d0d('0x12')](_0x2cd59e,_0x10afbe)[_0x6d0d('0x13')](function(_0x27c591){logger['info'](_0x6d0d('0x14'),_0x3ea3ff,_0x6d0d('0x15'));logger[_0x6d0d('0x16')](_0x6d0d('0x17'),_0x3ea3ff,_0x6d0d('0x15'),JSON[_0x6d0d('0x18')](_0x27c591));if(_0x27c591[_0x6d0d('0x19')]){if(_0x27c591[_0x6d0d('0x19')]['code']===0x1f4){logger[_0x6d0d('0x19')]('CmList,\x20%s,\x20%s',_0x3ea3ff,_0x27c591[_0x6d0d('0x19')]['message']);return _0x1210c9(_0x27c591[_0x6d0d('0x19')][_0x6d0d('0x1a')]);}logger[_0x6d0d('0x19')](_0x6d0d('0x14'),_0x3ea3ff,_0x27c591[_0x6d0d('0x19')]['message']);return _0x5d2750(_0x27c591[_0x6d0d('0x19')][_0x6d0d('0x1a')]);}else{logger[_0x6d0d('0x1b')](_0x6d0d('0x14'),_0x3ea3ff,_0x6d0d('0x15'));_0x5d2750(_0x27c591[_0x6d0d('0x1c')][_0x6d0d('0x1a')]);}})['catch'](function(_0x3906f5){logger['error'](_0x6d0d('0x14'),_0x3ea3ff,_0x3906f5);_0x1210c9(_0x3906f5);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index ff5acf3..2afbb7c 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 _0xccca=['length','remove','update','removeListener','register'];(function(_0x45a33a,_0xfaf6bd){var _0x139beb=function(_0x3234e9){while(--_0x3234e9){_0x45a33a['push'](_0x45a33a['shift']());}};_0x139beb(++_0xfaf6bd);}(_0xccca,0xb5));var _0xaccc=function(_0x1faaca,_0x26498b){_0x1faaca=_0x1faaca-0x0;var _0x3a84fa=_0xccca[_0x1faaca];return _0x3a84fa;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0xaccc('0x0'),_0xaccc('0x1')];function createListener(_0x55051a,_0x3620f7){return function(_0x4f8ddf){_0x3620f7['emit'](_0x55051a,_0x4f8ddf);};}function removeListener(_0x2a3ab8,_0x5c7600){return function(){CmListEvents[_0xaccc('0x2')](_0x2a3ab8,_0x5c7600);};}exports[_0xaccc('0x3')]=function(_0xdd83ce){for(var _0x149ec7=0x0,_0x5d3f54=events[_0xaccc('0x4')];_0x149ec7<_0x5d3f54;_0x149ec7++){var _0x630441=events[_0x149ec7];var _0x57b586=createListener('cmList:'+_0x630441,_0xdd83ce);CmListEvents['on'](_0x630441,_0x57b586);}}; \ No newline at end of file +var _0x91fd=['cmList:','save','update','emit','removeListener','register'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x91fd,0xc1));var _0xd91f=function(_0x41abe0,_0x430ed7){_0x41abe0=_0x41abe0-0x0;var _0x453500=_0x91fd[_0x41abe0];return _0x453500;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xd91f('0x0'),'remove',_0xd91f('0x1')];function createListener(_0x46a7c6,_0x37a536){return function(_0x438b26){_0x37a536[_0xd91f('0x2')](_0x46a7c6,_0x438b26);};}function removeListener(_0x1bc182,_0x5546fe){return function(){CmListEvents[_0xd91f('0x3')](_0x1bc182,_0x5546fe);};}exports[_0xd91f('0x4')]=function(_0x4b6f83){for(var _0x5e2bac=0x0,_0x454895=events['length'];_0x5e2bac<_0x454895;_0x5e2bac++){var _0x2ef39a=events[_0x5e2bac];var _0x2ffc63=createListener(_0xd91f('0x5')+_0x2ef39a,_0x4b6f83);CmListEvents['on'](_0x2ef39a,_0x2ffc63);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 7f41571..583b215 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 _0x4444=['describe','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','addDisposition','addContacts','addCustomField','/:id/users','put','delete','/:id','removeDispositions','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmList.controller','index','get','/describe','isAuthenticated'];(function(_0x2cf367,_0x416e52){var _0x228b25=function(_0x4c0ccf){while(--_0x4c0ccf){_0x2cf367['push'](_0x2cf367['shift']());}};_0x228b25(++_0x416e52);}(_0x4444,0xa3));var _0x4444=function(_0x1fbeaf,_0x256fbd){_0x1fbeaf=_0x1fbeaf-0x0;var _0x13daa3=_0x4444[_0x1fbeaf];return _0x13daa3;};'use strict';var multer=require(_0x4444('0x0'));var util=require(_0x4444('0x1'));var path=require('path');var timeout=require(_0x4444('0x2'));var express=require(_0x4444('0x3'));var router=express[_0x4444('0x4')]();var fs_extra=require(_0x4444('0x5'));var auth=require(_0x4444('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4444('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4444('0x8')]);router[_0x4444('0x9')](_0x4444('0xa'),auth[_0x4444('0xb')](),controller[_0x4444('0xc')]);router[_0x4444('0x9')]('/:id',auth[_0x4444('0xb')](),controller[_0x4444('0xd')]);router[_0x4444('0x9')](_0x4444('0xe'),auth[_0x4444('0xb')](),controller[_0x4444('0xf')]);router[_0x4444('0x9')](_0x4444('0x10'),auth[_0x4444('0xb')](),controller[_0x4444('0x11')]);router[_0x4444('0x9')](_0x4444('0x12'),auth['isAuthenticated'](),controller[_0x4444('0x13')]);router['get'](_0x4444('0x14'),auth[_0x4444('0xb')](),controller[_0x4444('0x15')]);router[_0x4444('0x9')]('/:id/users',auth[_0x4444('0xb')](),controller[_0x4444('0x16')]);router[_0x4444('0x17')]('/',auth[_0x4444('0xb')](),controller[_0x4444('0x18')]);router[_0x4444('0x17')](_0x4444('0xe'),auth[_0x4444('0xb')](),controller[_0x4444('0x19')]);router[_0x4444('0x17')](_0x4444('0x10'),auth['isAuthenticated'](),controller[_0x4444('0x1a')]);router[_0x4444('0x17')]('/:id/fields',auth[_0x4444('0xb')](),controller[_0x4444('0x1b')]);router[_0x4444('0x17')](_0x4444('0x1c'),auth[_0x4444('0xb')](),controller['addAgents']);router[_0x4444('0x1d')]('/:id',auth[_0x4444('0xb')](),controller['update']);router[_0x4444('0x1e')](_0x4444('0x1f'),auth[_0x4444('0xb')](),controller['destroy']);router[_0x4444('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x4444('0x20')]);router['delete'](_0x4444('0x1c'),auth['isAuthenticated'](),controller[_0x4444('0x21')]);module[_0x4444('0x22')]=router; \ No newline at end of file +var _0xedc3=['show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','/:id/users','getAgents','post','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x30f3c8,_0x4540ad){var _0x3bb3b6=function(_0xa26293){while(--_0xa26293){_0x30f3c8['push'](_0x30f3c8['shift']());}};_0x3bb3b6(++_0x4540ad);}(_0xedc3,0xfb));var _0x3edc=function(_0x2fa1ad,_0x48f010){_0x2fa1ad=_0x2fa1ad-0x0;var _0x403ba1=_0xedc3[_0x2fa1ad];return _0x403ba1;};'use strict';var multer=require('multer');var util=require(_0x3edc('0x0'));var path=require(_0x3edc('0x1'));var timeout=require('connect-timeout');var express=require(_0x3edc('0x2'));var router=express[_0x3edc('0x3')]();var fs_extra=require(_0x3edc('0x4'));var auth=require(_0x3edc('0x5'));var interaction=require(_0x3edc('0x6'));var config=require('../../config/environment');var controller=require('./cmList.controller');router['get']('/',auth[_0x3edc('0x7')](),controller[_0x3edc('0x8')]);router[_0x3edc('0x9')](_0x3edc('0xa'),auth[_0x3edc('0x7')](),controller[_0x3edc('0xb')]);router[_0x3edc('0x9')](_0x3edc('0xc'),auth['isAuthenticated'](),controller[_0x3edc('0xd')]);router[_0x3edc('0x9')](_0x3edc('0xe'),auth[_0x3edc('0x7')](),controller['getDispositions']);router[_0x3edc('0x9')](_0x3edc('0xf'),auth[_0x3edc('0x7')](),controller[_0x3edc('0x10')]);router[_0x3edc('0x9')](_0x3edc('0x11'),auth[_0x3edc('0x7')](),controller['getContactsCsv']);router[_0x3edc('0x9')](_0x3edc('0x12'),auth[_0x3edc('0x7')](),controller['getCustomFields']);router[_0x3edc('0x9')](_0x3edc('0x13'),auth[_0x3edc('0x7')](),controller[_0x3edc('0x14')]);router['post']('/',auth[_0x3edc('0x7')](),controller['create']);router[_0x3edc('0x15')](_0x3edc('0xe'),auth[_0x3edc('0x7')](),controller[_0x3edc('0x16')]);router[_0x3edc('0x15')](_0x3edc('0xf'),auth[_0x3edc('0x7')](),controller[_0x3edc('0x17')]);router[_0x3edc('0x15')](_0x3edc('0x12'),auth[_0x3edc('0x7')](),controller[_0x3edc('0x18')]);router[_0x3edc('0x15')](_0x3edc('0x13'),auth[_0x3edc('0x7')](),controller[_0x3edc('0x19')]);router[_0x3edc('0x1a')](_0x3edc('0xc'),auth['isAuthenticated'](),controller[_0x3edc('0x1b')]);router[_0x3edc('0x1c')](_0x3edc('0xc'),auth[_0x3edc('0x7')](),controller[_0x3edc('0x1d')]);router[_0x3edc('0x1c')](_0x3edc('0xe'),auth[_0x3edc('0x7')](),controller[_0x3edc('0x1e')]);router[_0x3edc('0x1c')](_0x3edc('0x13'),auth[_0x3edc('0x7')](),controller[_0x3edc('0x1f')]);module[_0x3edc('0x20')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index db8bdca..a47e602 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 _0xb3d6=['field','STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x53bb1a,_0x57ffd5){var _0x26a477=function(_0x2e9c7d){while(--_0x2e9c7d){_0x53bb1a['push'](_0x53bb1a['shift']());}};_0x26a477(++_0x57ffd5);}(_0xb3d6,0x13a));var _0x6b3d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb3d6[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x6b3d('0x0'));module[_0x6b3d('0x1')]={'name':{'type':Sequelize[_0x6b3d('0x2')],'get':function(_0x5eb233){return this[_0x6b3d('0x3')](_0x6b3d('0x4'));}},'field':{'type':Sequelize[_0x6b3d('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5f88=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f88,0x66));var _0x85f8=function(_0x5abd4a,_0x5a7dc3){_0x5abd4a=_0x5abd4a-0x0;var _0x14e774=_0x5f88[_0x5abd4a];return _0x14e774;};'use strict';var Sequelize=require(_0x85f8('0x0'));module[_0x85f8('0x1')]={'name':{'type':Sequelize[_0x85f8('0x2')],'get':function(_0x293ac0){return this[_0x85f8('0x3')](_0x85f8('0x4'));}},'field':{'type':Sequelize[_0x85f8('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x85f8('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index c0f0475..f65038f 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(_0x155b2f,_0x927966){var _0x14f331=function(_0xf8b17a){while(--_0xf8b17a){_0x155b2f['push'](_0x155b2f['shift']());}};_0x14f331(++_0x927966);}(_0x7a54,0x106));var _0x47a5=function(_0x3c8755,_0x385e99){_0x3c8755=_0x3c8755-0x0;var _0xf3f28d=_0x7a54[_0x3c8755];return _0xf3f28d;};'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(_0x5319a6,_0x590ce6){var _0x5afd8e=function(_0x326bde){while(--_0x326bde){_0x5319a6['push'](_0x5319a6['shift']());}};_0x5afd8e(++_0x590ce6);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 23db0ba..0c3a3c8 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 _0x2bc5=['bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','../../config/logger','api','moment'];(function(_0xeac5c1,_0x31fc3f){var _0x5836bc=function(_0x50e2cf){while(--_0x50e2cf){_0xeac5c1['push'](_0xeac5c1['shift']());}};_0x5836bc(++_0x31fc3f);}(_0x2bc5,0x71));var _0x52bc=function(_0x1c5db9,_0x2ec26d){_0x1c5db9=_0x1c5db9-0x0;var _0x34ebeb=_0x2bc5[_0x1c5db9];return _0x34ebeb;};'use strict';var _=require(_0x52bc('0x0'));var util=require('util');var logger=require(_0x52bc('0x1'))(_0x52bc('0x2'));var moment=require(_0x52bc('0x3'));var BPromise=require(_0x52bc('0x4'));var rp=require(_0x52bc('0x5'));var fs=require('fs');var path=require(_0x52bc('0x6'));var rimraf=require(_0x52bc('0x7'));var config=require('../../config/environment');var attributes=require(_0x52bc('0x8'));module[_0x52bc('0x9')]=function(_0x58f4b7,_0x19c99b){return _0x58f4b7[_0x52bc('0xa')](_0x52bc('0xb'),attributes,{'tableName':_0x52bc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a51=['path','rimraf','../../config/environment','./condition.attributes','exports','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3957fd,_0x4ebc7c){var _0x1d3946=function(_0x58b7c7){while(--_0x58b7c7){_0x3957fd['push'](_0x3957fd['shift']());}};_0x1d3946(++_0x4ebc7c);}(_0x3a51,0x158));var _0x13a5=function(_0x134ee5,_0x274de7){_0x134ee5=_0x134ee5-0x0;var _0x5bf854=_0x3a51[_0x134ee5];return _0x5bf854;};'use strict';var _=require(_0x13a5('0x0'));var util=require(_0x13a5('0x1'));var logger=require(_0x13a5('0x2'))(_0x13a5('0x3'));var moment=require(_0x13a5('0x4'));var BPromise=require(_0x13a5('0x5'));var rp=require(_0x13a5('0x6'));var fs=require('fs');var path=require(_0x13a5('0x7'));var rimraf=require(_0x13a5('0x8'));var config=require(_0x13a5('0x9'));var attributes=require(_0x13a5('0xa'));module[_0x13a5('0xb')]=function(_0x2b0321,_0x5d4f50){return _0x2b0321['define']('Condition',attributes,{'tableName':_0x13a5('0xc'),'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 ceb5a36..2282848 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 _0x604d=['info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then'];(function(_0x32168c,_0x262fc4){var _0x270be6=function(_0x2318b2){while(--_0x2318b2){_0x32168c['push'](_0x32168c['shift']());}};_0x270be6(++_0x262fc4);}(_0x604d,0x170));var _0xd604=function(_0xdda14b,_0xf92546){_0xdda14b=_0xdda14b-0x0;var _0x3ae153=_0x604d[_0xdda14b];return _0x3ae153;};'use strict';var _=require(_0xd604('0x0'));var util=require(_0xd604('0x1'));var moment=require(_0xd604('0x2'));var BPromise=require('bluebird');var rs=require(_0xd604('0x3'));var fs=require('fs');var Redis=require(_0xd604('0x4'));var db=require(_0xd604('0x5'))['db'];var utils=require(_0xd604('0x6'));var logger=require(_0xd604('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd604('0x8'));var client=jayson[_0xd604('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568f21,_0x301f61,_0x534a74){return new BPromise(function(_0x4a1611,_0x6727da){return client[_0xd604('0xa')](_0x568f21,_0x534a74)[_0xd604('0xb')](function(_0x3926ca){logger[_0xd604('0xc')](_0xd604('0xd'),_0x301f61,_0xd604('0xe'));logger['debug'](_0xd604('0xf'),_0x301f61,_0xd604('0xe'),JSON['stringify'](_0x3926ca));if(_0x3926ca[_0xd604('0x10')]){if(_0x3926ca['error'][_0xd604('0x11')]===0x1f4){logger[_0xd604('0x10')]('Condition,\x20%s,\x20%s',_0x301f61,_0x3926ca[_0xd604('0x10')][_0xd604('0x12')]);return _0x6727da(_0x3926ca['error'][_0xd604('0x12')]);}logger[_0xd604('0x10')](_0xd604('0xd'),_0x301f61,_0x3926ca['error'][_0xd604('0x12')]);return _0x4a1611(_0x3926ca['error'][_0xd604('0x12')]);}else{logger[_0xd604('0xc')](_0xd604('0xd'),_0x301f61,_0xd604('0xe'));_0x4a1611(_0x3926ca['result'][_0xd604('0x12')]);}})[_0xd604('0x13')](function(_0x908650){logger[_0xd604('0x10')](_0xd604('0xd'),_0x301f61,_0x908650);_0x6727da(_0x908650);});});} \ No newline at end of file +var _0x6117=['client','http','request','then','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','error','Condition,\x20%s,\x20%s','message','info','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x443fe6,_0xcc1e25){var _0x1dfbee=function(_0x4263a0){while(--_0x4263a0){_0x443fe6['push'](_0x443fe6['shift']());}};_0x1dfbee(++_0xcc1e25);}(_0x6117,0x1cc));var _0x7611=function(_0x52ef2b,_0x4ead61){_0x52ef2b=_0x52ef2b-0x0;var _0x199a2c=_0x6117[_0x52ef2b];return _0x199a2c;};'use strict';var _=require(_0x7611('0x0'));var util=require(_0x7611('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7611('0x2'));var fs=require('fs');var Redis=require(_0x7611('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7611('0x4'));var logger=require(_0x7611('0x5'))(_0x7611('0x6'));var config=require('../../config/environment');var jayson=require(_0x7611('0x7'));var client=jayson[_0x7611('0x8')][_0x7611('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39cb8f,_0x263aae,_0x4f587b){return new BPromise(function(_0x194431,_0x1a5b51){return client[_0x7611('0xa')](_0x39cb8f,_0x4f587b)[_0x7611('0xb')](function(_0x3b6ff9){logger['info']('Condition,\x20%s,\x20%s',_0x263aae,_0x7611('0xc'));logger['debug'](_0x7611('0xd'),_0x263aae,_0x7611('0xc'),JSON['stringify'](_0x3b6ff9));if(_0x3b6ff9[_0x7611('0xe')]){if(_0x3b6ff9[_0x7611('0xe')]['code']===0x1f4){logger['error'](_0x7611('0xf'),_0x263aae,_0x3b6ff9[_0x7611('0xe')][_0x7611('0x10')]);return _0x1a5b51(_0x3b6ff9['error']['message']);}logger[_0x7611('0xe')](_0x7611('0xf'),_0x263aae,_0x3b6ff9[_0x7611('0xe')][_0x7611('0x10')]);return _0x194431(_0x3b6ff9[_0x7611('0xe')]['message']);}else{logger[_0x7611('0x11')]('Condition,\x20%s,\x20%s',_0x263aae,_0x7611('0xc'));_0x194431(_0x3b6ff9['result']['message']);}})['catch'](function(_0x28dd33){logger['error'](_0x7611('0xf'),_0x263aae,_0x28dd33);_0x1a5b51(_0x28dd33);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index f18c9e1..1b59ea1 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 _0x5b70=['update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','/:id','isAuthenticated'];(function(_0x2a67e0,_0x38d4be){var _0x4c9274=function(_0x277245){while(--_0x277245){_0x2a67e0['push'](_0x2a67e0['shift']());}};_0x4c9274(++_0x38d4be);}(_0x5b70,0x1ee));var _0x05b7=function(_0x2b9a23,_0x49be94){_0x2b9a23=_0x2b9a23-0x0;var _0x5c3f07=_0x5b70[_0x2b9a23];return _0x5c3f07;};'use strict';var multer=require(_0x05b7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x05b7('0x1'));var express=require(_0x05b7('0x2'));var router=express[_0x05b7('0x3')]();var fs_extra=require(_0x05b7('0x4'));var auth=require(_0x05b7('0x5'));var interaction=require(_0x05b7('0x6'));var config=require('../../config/environment');var controller=require(_0x05b7('0x7'));router['put'](_0x05b7('0x8'),auth[_0x05b7('0x9')](),controller[_0x05b7('0xa')]);router[_0x05b7('0xb')](_0x05b7('0x8'),auth[_0x05b7('0x9')](),controller[_0x05b7('0xc')]);module[_0x05b7('0xd')]=router; \ No newline at end of file +var _0x736e=['Router','fs-extra','../../config/environment','./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express'];(function(_0x4cd375,_0x212889){var _0x52a181=function(_0x466d43){while(--_0x466d43){_0x4cd375['push'](_0x4cd375['shift']());}};_0x52a181(++_0x212889);}(_0x736e,0x182));var _0xe736=function(_0x4cba1d,_0x208207){_0x4cba1d=_0x4cba1d-0x0;var _0x2846a8=_0x736e[_0x4cba1d];return _0x2846a8;};'use strict';var multer=require(_0xe736('0x0'));var util=require(_0xe736('0x1'));var path=require('path');var timeout=require(_0xe736('0x2'));var express=require(_0xe736('0x3'));var router=express[_0xe736('0x4')]();var fs_extra=require(_0xe736('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe736('0x6'));var controller=require(_0xe736('0x7'));router[_0xe736('0x8')]('/:id',auth[_0xe736('0x9')](),controller[_0xe736('0xa')]);router[_0xe736('0xb')](_0xe736('0xc'),auth[_0xe736('0x9')](),controller[_0xe736('0xd')]);module[_0xe736('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 0d8e921..afd81d3 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['exports','STRING'];(function(_0x56b20e,_0x428d3c){var _0x3b2ee3=function(_0x2d8a68){while(--_0x2d8a68){_0x56b20e['push'](_0x56b20e['shift']());}};_0x3b2ee3(++_0x428d3c);}(_0x757a,0xde));var _0xa757=function(_0x2b1743,_0x587219){_0x2b1743=_0x2b1743-0x0;var _0x38f366=_0x757a[_0x2b1743];return _0x38f366;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0xb7e7,0x121));var _0x7b7e=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xb7e7[_0x278e3c];return _0x3e2d9b;};'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 3445ac1..ed3cd07 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 _0x7094=['length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','show','params','filters','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','updatedAt','omit','createdAt','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrSmsAccounts','web-report','attrReport','reportType','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','order','nolimit','getItems','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','end','status','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','UserProfileResource','sendStatus','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','name','keys','intersection','attributes','fields','query'];(function(_0x236450,_0x242e95){var _0x5ebe7b=function(_0x2280cc){while(--_0x2280cc){_0x236450['push'](_0x236450['shift']());}};_0x5ebe7b(++_0x242e95);}(_0x7094,0xd0));var _0x4709=function(_0x789d5b,_0x1f9369){_0x789d5b=_0x789d5b-0x0;var _0x39a0e1=_0x7094[_0x789d5b];return _0x39a0e1;};'use strict';var emlformat=require(_0x4709('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4709('0x1'));var jsonpatch=require(_0x4709('0x2'));var rp=require(_0x4709('0x3'));var moment=require(_0x4709('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4709('0x5'));var path=require('path');var sox=require(_0x4709('0x6'));var csv=require(_0x4709('0x7'));var ejs=require(_0x4709('0x8'));var fs=require('fs');var fs_extra=require(_0x4709('0x9'));var _=require(_0x4709('0xa'));var squel=require(_0x4709('0xb'));var crypto=require(_0x4709('0xc'));var jsforce=require(_0x4709('0xd'));var deskjs=require(_0x4709('0xe'));var toCsv=require(_0x4709('0x7'));var querystring=require(_0x4709('0xf'));var Papa=require(_0x4709('0x10'));var Redis=require(_0x4709('0x11'));var authService=require(_0x4709('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4709('0x13'));var hardwareService=require(_0x4709('0x14'));var logger=require(_0x4709('0x15'))(_0x4709('0x16'));var utils=require('../../config/utils');var config=require(_0x4709('0x17'));var licenseUtil=require(_0x4709('0x18'));var db=require(_0x4709('0x19'))['db'];config[_0x4709('0x1a')]=_['defaults'](config[_0x4709('0x1a')],{'host':_0x4709('0x1b'),'port':0x18eb});var socket=require(_0x4709('0x1c'))(new Redis(config[_0x4709('0x1a')]));require(_0x4709('0x1d'))[_0x4709('0x1e')](socket);function respondWithStatusCode(_0x110b36,_0x144735){_0x144735=_0x144735||0xcc;return function(_0x29ec9d){if(_0x29ec9d){return _0x110b36['sendStatus'](_0x144735);}return _0x110b36['status'](_0x144735)[_0x4709('0x1f')]();};}function respondWithResult(_0x29222b,_0x3a4928){_0x3a4928=_0x3a4928||0xc8;return function(_0x17ccc6){if(_0x17ccc6){return _0x29222b[_0x4709('0x20')](_0x3a4928)[_0x4709('0x21')](_0x17ccc6);}};}function respondWithFilteredResult(_0x5c54e8,_0x3c3eb5){return function(_0x17e067){if(_0x17e067){var _0x50f8f=typeof _0x3c3eb5[_0x4709('0x22')]==='undefined'&&typeof _0x3c3eb5['limit']===_0x4709('0x23');var _0x5a9d77=_0x17e067['count'];var _0x498e4d=_0x50f8f?0x0:_0x3c3eb5[_0x4709('0x22')];var _0xe5c7ac=_0x50f8f?_0x17e067['count']:_0x3c3eb5[_0x4709('0x22')]+_0x3c3eb5[_0x4709('0x24')];var _0x1ce2a9;if(_0xe5c7ac>=_0x5a9d77){_0xe5c7ac=_0x5a9d77;_0x1ce2a9=0xc8;}else{_0x1ce2a9=0xce;}_0x5c54e8['status'](_0x1ce2a9);return _0x5c54e8[_0x4709('0x25')](_0x4709('0x26'),_0x498e4d+'-'+_0xe5c7ac+'/'+_0x5a9d77)[_0x4709('0x21')](_0x17e067);}return null;};}function patchUpdates(_0x7d7e0d){return function(_0x2bd96a){try{jsonpatch[_0x4709('0x27')](_0x2bd96a,_0x7d7e0d,!![]);}catch(_0x2ec058){return BPromise['reject'](_0x2ec058);}return _0x2bd96a['save']();};}function saveUpdates(_0x44d879,_0xd04927){return function(_0x1919c6){if(_0x1919c6){return _0x1919c6[_0x4709('0x28')](_0x44d879)[_0x4709('0x29')](function(_0x31a1f3){return _0x31a1f3;});}return null;};}function removeEntity(_0x3e30eb,_0x969f07){return function(_0x1673ff){if(_0x1673ff){return _0x1673ff[_0x4709('0x2a')]()[_0x4709('0x29')](function(){var _0x48773c=_0x1673ff['get']({'plain':!![]});var _0x12027a='CustomDashboards';return db[_0x4709('0x2b')][_0x4709('0x2a')]({'where':{'type':_0x12027a,'resourceId':_0x48773c['id']}})[_0x4709('0x29')](function(){return _0x1673ff;});})[_0x4709('0x29')](function(){_0x3e30eb[_0x4709('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13b3b1,_0x5218f3){return function(_0x223070){if(!_0x223070){_0x13b3b1[_0x4709('0x2c')](0x194);}return _0x223070;};}function handleError(_0x53dc30,_0x212209){_0x212209=_0x212209||0x1f4;return function(_0x5cb5eb){logger['error'](_0x5cb5eb['stack']);if(_0x5cb5eb['name']){delete _0x5cb5eb['name'];}_0x53dc30[_0x4709('0x20')](_0x212209)[_0x4709('0x2d')](_0x5cb5eb);};}exports[_0x4709('0x2e')]=function(_0x59e3b6,_0x3abbe5){var _0x37b1d9={},_0x2031e4={},_0x27fb42={'count':0x0,'rows':[]};var _0x11e06d=_[_0x4709('0x2f')](db[_0x4709('0x30')][_0x4709('0x31')],function(_0x4447e9){return{'name':_0x4447e9[_0x4709('0x32')],'type':_0x4447e9[_0x4709('0x33')][_0x4709('0x34')]};});_0x2031e4[_0x4709('0x35')]=_['map'](_0x11e06d,_0x4709('0x36'));_0x2031e4['query']=_[_0x4709('0x37')](_0x59e3b6['query']);_0x2031e4['filters']=_[_0x4709('0x38')](_0x2031e4[_0x4709('0x35')],_0x2031e4['query']);_0x37b1d9[_0x4709('0x39')]=_[_0x4709('0x38')](_0x2031e4['model'],qs[_0x4709('0x3a')](_0x59e3b6[_0x4709('0x3b')][_0x4709('0x3a')]));_0x37b1d9[_0x4709('0x39')]=_0x37b1d9[_0x4709('0x39')][_0x4709('0x3c')]?_0x37b1d9[_0x4709('0x39')]:_0x2031e4[_0x4709('0x35')];if(!_0x59e3b6[_0x4709('0x3b')][_0x4709('0x3d')]('nolimit')){_0x37b1d9[_0x4709('0x24')]=qs['limit'](_0x59e3b6[_0x4709('0x3b')]['limit']);_0x37b1d9[_0x4709('0x22')]=qs[_0x4709('0x22')](_0x59e3b6[_0x4709('0x3b')][_0x4709('0x22')]);}_0x37b1d9['order']=qs[_0x4709('0x3e')](_0x59e3b6[_0x4709('0x3b')]['sort']);_0x37b1d9[_0x4709('0x3f')]=qs['filters'](_[_0x4709('0x40')](_0x59e3b6[_0x4709('0x3b')],_0x2031e4['filters']),_0x11e06d);if(_0x59e3b6[_0x4709('0x3b')][_0x4709('0x41')]){_0x37b1d9[_0x4709('0x3f')]=_[_0x4709('0x42')](_0x37b1d9['where'],{'$or':_[_0x4709('0x2f')](_0x11e06d,function(_0x109b9b){if(_0x109b9b[_0x4709('0x33')]!==_0x4709('0x43')){var _0x1c67cb={};_0x1c67cb[_0x109b9b[_0x4709('0x36')]]={'$like':'%'+_0x59e3b6[_0x4709('0x3b')][_0x4709('0x41')]+'%'};return _0x1c67cb;}})});}_0x37b1d9=_[_0x4709('0x42')]({},_0x37b1d9,_0x59e3b6['options']);var _0x1d6cb4={'where':_0x37b1d9[_0x4709('0x3f')]};return db['Dashboard'][_0x4709('0x44')](_0x1d6cb4)['then'](function(_0x3f9b8d){_0x27fb42[_0x4709('0x44')]=_0x3f9b8d;if(_0x59e3b6['query'][_0x4709('0x45')]){_0x37b1d9['include']=[{'all':!![]}];}return db[_0x4709('0x30')][_0x4709('0x46')](_0x37b1d9);})[_0x4709('0x29')](function(_0x2cdba5){_0x27fb42[_0x4709('0x47')]=_0x2cdba5;return _0x27fb42;})[_0x4709('0x29')](respondWithFilteredResult(_0x3abbe5,_0x37b1d9))['catch'](handleError(_0x3abbe5,null));};exports[_0x4709('0x48')]=function(_0x4393bd,_0x29f17c){var _0x6dee30={'raw':![],'where':{'id':_0x4393bd[_0x4709('0x49')]['id']}},_0x62d792={};_0x62d792[_0x4709('0x35')]=_[_0x4709('0x37')](db[_0x4709('0x30')][_0x4709('0x31')]);_0x62d792[_0x4709('0x3b')]=_[_0x4709('0x37')](_0x4393bd[_0x4709('0x3b')]);_0x62d792[_0x4709('0x4a')]=_[_0x4709('0x38')](_0x62d792['model'],_0x62d792['query']);_0x6dee30[_0x4709('0x39')]=_[_0x4709('0x38')](_0x62d792['model'],qs[_0x4709('0x3a')](_0x4393bd[_0x4709('0x3b')]['fields']));_0x6dee30[_0x4709('0x39')]=_0x6dee30[_0x4709('0x39')][_0x4709('0x3c')]?_0x6dee30[_0x4709('0x39')]:_0x62d792[_0x4709('0x35')];if(_0x4393bd[_0x4709('0x3b')][_0x4709('0x45')]){_0x6dee30[_0x4709('0x4b')]=[{'all':!![]}];}_0x6dee30=_[_0x4709('0x42')]({},_0x6dee30,_0x4393bd['options']);return db[_0x4709('0x30')][_0x4709('0x4c')](_0x6dee30)['then'](handleEntityNotFound(_0x29f17c,null))[_0x4709('0x29')](respondWithResult(_0x29f17c,null))['catch'](handleError(_0x29f17c,null));};exports[_0x4709('0x4d')]=function(_0x4d9f22,_0x1c8087){return db[_0x4709('0x30')][_0x4709('0x4d')](_0x4d9f22[_0x4709('0x4e')],{})[_0x4709('0x29')](function(_0x6bea76){var _0x31a5aa=_0x4d9f22[_0x4709('0x4f')][_0x4709('0x50')]({'plain':!![]});if(!_0x31a5aa)throw new Error(_0x4709('0x51'));if(_0x31a5aa[_0x4709('0x52')]===_0x4709('0x4f')){var _0x56d485=_0x6bea76[_0x4709('0x50')]({'plain':!![]});var _0x5f303a='CustomDashboards';return db[_0x4709('0x53')][_0x4709('0x4c')]({'where':{'name':_0x5f303a,'userProfileId':_0x31a5aa[_0x4709('0x54')]},'raw':!![]})['then'](function(_0x459a84){if(_0x459a84&&_0x459a84[_0x4709('0x55')]===0x0){return db[_0x4709('0x2b')]['create']({'name':_0x56d485[_0x4709('0x36')],'resourceId':_0x56d485['id'],'type':_0x459a84[_0x4709('0x36')],'sectionId':_0x459a84['id']},{})[_0x4709('0x29')](function(){return _0x6bea76;});}else{return _0x6bea76;}})[_0x4709('0x56')](function(_0x4fdeb7){logger[_0x4709('0x57')](_0x4709('0x58'),_0x4fdeb7);throw _0x4fdeb7;});}return _0x6bea76;})['then'](respondWithResult(_0x1c8087,0xc9))[_0x4709('0x56')](handleError(_0x1c8087,null));};exports[_0x4709('0x59')]=function(_0x1793b8,_0x2dbe52){var _0x51dac3={'where':{'id':_0x1793b8['params']['id']}},_0xf06476={};_0xf06476[_0x4709('0x35')]=_[_0x4709('0x37')](db[_0x4709('0x30')][_0x4709('0x31')]);_0x51dac3[_0x4709('0x39')]=_[_0x4709('0x38')](_0xf06476[_0x4709('0x35')],qs[_0x4709('0x3a')](_0x1793b8[_0x4709('0x3b')]['fields']));_0x51dac3[_0x4709('0x39')]=_0x51dac3[_0x4709('0x39')][_0x4709('0x3c')]?_0x51dac3['attributes']:_0xf06476['model'];if(_0x1793b8['query'][_0x4709('0x45')]){_0x51dac3['include']=[{'all':!![]}];}_0x51dac3=_['merge']({},_0x51dac3,_0x1793b8[_0x4709('0x5a')]);return db[_0x4709('0x30')][_0x4709('0x4c')](_0x51dac3)[_0x4709('0x29')](handleEntityNotFound(_0x2dbe52,null))['then'](function(_0x52cad6){if(_0x52cad6){var _0x4ee949=_0x52cad6[_0x4709('0x50')]({'plain':!![]});_0x4ee949=qs['omit'](_0x4ee949,['id','createdAt',_0x4709('0x5b')]);_0x1793b8['body']=_[_0x4709('0x5c')](_0x1793b8[_0x4709('0x4e')],['id',_0x4709('0x5d'),_0x4709('0x5b')]);return db[_0x4709('0x30')]['create'](_['merge'](_0x4ee949,_0x1793b8['body']),{'include':_0x1793b8['query'][_0x4709('0x45')]?[{'all':!![]}]:undefined})[_0x4709('0x29')](function(_0x2d2834){var _0x39b486=_0x1793b8['user']['get']({'plain':!![]});if(!_0x39b486)throw new Error(_0x4709('0x51'));if(_0x39b486[_0x4709('0x52')]===_0x4709('0x4f')){var _0x3889c9=_0x2d2834[_0x4709('0x50')]({'plain':!![]});var _0x211d49='CustomDashboards';return db[_0x4709('0x53')]['find']({'where':{'name':_0x211d49,'userProfileId':_0x39b486[_0x4709('0x54')]},'raw':!![]})[_0x4709('0x29')](function(_0x709d8){if(_0x709d8&&_0x709d8[_0x4709('0x55')]===0x0){return db[_0x4709('0x2b')][_0x4709('0x4d')]({'name':_0x3889c9[_0x4709('0x36')],'resourceId':_0x3889c9['id'],'type':_0x709d8[_0x4709('0x36')],'sectionId':_0x709d8['id']},{})[_0x4709('0x29')](function(){return _0x2d2834;});}else{return _0x2d2834;}})[_0x4709('0x56')](function(_0x5996aa){logger[_0x4709('0x57')](_0x4709('0x58'),_0x5996aa);throw _0x5996aa;});}return _0x2d2834;});}})[_0x4709('0x29')](respondWithResult(_0x2dbe52,0xc9))[_0x4709('0x56')](handleError(_0x2dbe52,null));};exports[_0x4709('0x28')]=function(_0x3005d8,_0x57d119){if(_0x3005d8[_0x4709('0x4e')]['id']){delete _0x3005d8[_0x4709('0x4e')]['id'];}return db[_0x4709('0x30')][_0x4709('0x4c')]({'where':{'id':_0x3005d8['params']['id']}})[_0x4709('0x29')](handleEntityNotFound(_0x57d119,null))[_0x4709('0x29')](saveUpdates(_0x3005d8[_0x4709('0x4e')],null))[_0x4709('0x29')](respondWithResult(_0x57d119,null))['catch'](handleError(_0x57d119,null));};exports[_0x4709('0x2a')]=function(_0x42ee71,_0x5cea04){return db[_0x4709('0x30')][_0x4709('0x4c')]({'where':{'id':_0x42ee71[_0x4709('0x49')]['id']}})[_0x4709('0x29')](handleEntityNotFound(_0x5cea04,null))[_0x4709('0x29')](removeEntity(_0x5cea04,null))['catch'](handleError(_0x5cea04,null));};function widgetAttributes(_0x4cb53a){try{switch(_0x4cb53a[_0x4709('0x33')]){case _0x4709('0x5e'):return[{'name':_0x4709('0x5f'),'value':_0x4cb53a[_0x4709('0x5f')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a[_0x4709('0x60')][0x0]?_0x4cb53a[_0x4709('0x60')][0x0][_0x4709('0x61')]:undefined)||_0x4709('0x62')}];case _0x4709('0x63'):return[{'name':_0x4709('0x64'),'value':_0x4cb53a['attrPath']||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a[_0x4709('0x60')][0x0]?_0x4cb53a[_0x4709('0x60')][0x0][_0x4709('0x61')]:undefined)||''}];case _0x4709('0x65'):return[{'name':_0x4709('0x66'),'value':_0x4cb53a[_0x4709('0x66')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a['attrs'][0x0]?_0x4cb53a[_0x4709('0x60')][0x0][_0x4709('0x61')]:undefined)||_0x4709('0x67')},{'name':_0x4709('0x68'),'value':_0x4cb53a[_0x4709('0x68')]||(_0x4cb53a['attrs']&&_0x4cb53a[_0x4709('0x60')][0x1]?_0x4cb53a[_0x4709('0x60')][0x1][_0x4709('0x61')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x4cb53a[_0x4709('0x69')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a[_0x4709('0x60')][0x2]?_0x4cb53a['attrs'][0x2][_0x4709('0x61')]:undefined)||0xc}];case _0x4709('0x6a'):return[{'name':_0x4709('0x6b'),'value':_0x4cb53a['attrMetric']||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a['attrs'][0x0]?_0x4cb53a['attrs'][0x0][_0x4709('0x61')]:undefined)||_0x4709('0x6c')},{'name':_0x4709('0x6d'),'value':_0x4cb53a[_0x4709('0x6d')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a['attrs'][0x1]?_0x4cb53a[_0x4709('0x60')][0x1][_0x4709('0x61')]:undefined)||[]},{'name':'attrFontSize','value':_0x4cb53a[_0x4709('0x69')]||(_0x4cb53a['attrs']&&_0x4cb53a['attrs'][0x2]?_0x4cb53a[_0x4709('0x60')][0x2][_0x4709('0x61')]:undefined)||0x14},{'name':_0x4709('0x6e'),'value':_0x4cb53a[_0x4709('0x6e')]||(_0x4cb53a['attrs']&&_0x4cb53a[_0x4709('0x60')][0x3]?_0x4cb53a[_0x4709('0x60')][0x3]['value']:undefined)||_0x4709('0x6f')},{'name':_0x4709('0x70'),'value':_0x4cb53a['attrEmailAccounts']||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a['attrs'][0x4]?_0x4cb53a[_0x4709('0x60')][0x4][_0x4709('0x61')]:undefined)||''},{'name':_0x4709('0x71'),'value':_0x4cb53a[_0x4709('0x71')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a[_0x4709('0x60')][0x5]?_0x4cb53a[_0x4709('0x60')][0x5][_0x4709('0x61')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x4cb53a['attrSmsAccounts']||(_0x4cb53a['attrs']&&_0x4cb53a[_0x4709('0x60')][0x6]?_0x4cb53a[_0x4709('0x60')][0x6][_0x4709('0x61')]:undefined)||''},{'name':_0x4709('0x72'),'value':_0x4cb53a[_0x4709('0x72')]||(_0x4cb53a['attrs']&&_0x4cb53a[_0x4709('0x60')][0x7]?_0x4cb53a[_0x4709('0x60')][0x7]['value']:undefined)||''},{'name':_0x4709('0x73'),'value':_0x4cb53a[_0x4709('0x73')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a['attrs'][0x8]?_0x4cb53a['attrs'][0x8][_0x4709('0x61')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4cb53a[_0x4709('0x74')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a['attrs'][0x9]?_0x4cb53a[_0x4709('0x60')][0x9]['value']:undefined)||''}];case'multibar-chart':case _0x4709('0x75'):return[{'name':_0x4709('0x76'),'value':_0x4cb53a['attrSerie1']||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a['attrs'][0x0]?_0x4cb53a[_0x4709('0x60')][0x0]['value']:undefined)||_0x4709('0x6c')},{'name':_0x4709('0x77'),'value':_0x4cb53a[_0x4709('0x77')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a[_0x4709('0x60')][0x1]?_0x4cb53a[_0x4709('0x60')][0x1]['value']:undefined)||null},{'name':_0x4709('0x78'),'value':_0x4cb53a[_0x4709('0x78')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a[_0x4709('0x60')][0x2]?_0x4cb53a[_0x4709('0x60')][0x2][_0x4709('0x61')]:undefined)||null},{'name':_0x4709('0x6d'),'value':_0x4cb53a['attrVoiceQueues']||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a[_0x4709('0x60')][0x3]?_0x4cb53a['attrs'][0x3][_0x4709('0x61')]:undefined)||[]},{'name':_0x4709('0x6e'),'value':_0x4cb53a[_0x4709('0x6e')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a[_0x4709('0x60')][0x4]?_0x4cb53a[_0x4709('0x60')][0x4]['value']:undefined)||_0x4709('0x6f')},{'name':_0x4709('0x70'),'value':_0x4cb53a[_0x4709('0x70')]||(_0x4cb53a['attrs']&&_0x4cb53a['attrs'][0x5]?_0x4cb53a['attrs'][0x5][_0x4709('0x61')]:undefined)||''},{'name':_0x4709('0x71'),'value':_0x4cb53a[_0x4709('0x71')]||(_0x4cb53a['attrs']&&_0x4cb53a[_0x4709('0x60')][0x6]?_0x4cb53a[_0x4709('0x60')][0x6][_0x4709('0x61')]:undefined)||''},{'name':_0x4709('0x79'),'value':_0x4cb53a[_0x4709('0x79')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a[_0x4709('0x60')][0x7]?_0x4cb53a[_0x4709('0x60')][0x7][_0x4709('0x61')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x4cb53a[_0x4709('0x72')]||(_0x4cb53a['attrs']&&_0x4cb53a[_0x4709('0x60')][0x8]?_0x4cb53a[_0x4709('0x60')][0x8][_0x4709('0x61')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x4cb53a[_0x4709('0x73')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a[_0x4709('0x60')][0x9]?_0x4cb53a[_0x4709('0x60')][0x9]['value']:undefined)||''},{'name':_0x4709('0x74'),'value':_0x4cb53a[_0x4709('0x74')]||(_0x4cb53a['attrs']&&_0x4cb53a[_0x4709('0x60')][0xa]?_0x4cb53a['attrs'][0xa][_0x4709('0x61')]:undefined)||''}];case _0x4709('0x7a'):return[{'name':_0x4709('0x7b'),'type':_0x4cb53a[_0x4709('0x7c')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a['attrs'][0x0]?_0x4cb53a[_0x4709('0x60')][0x0][_0x4709('0x33')]:undefined)||null,'value':_0x4cb53a[_0x4709('0x7b')]||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a[_0x4709('0x60')][0x0]?_0x4cb53a[_0x4709('0x60')][0x0][_0x4709('0x61')]:undefined)||null},{'name':'attrRefresh','value':_0x4cb53a['attrRefresh']||(_0x4cb53a[_0x4709('0x60')]&&_0x4cb53a[_0x4709('0x60')][0x1]?_0x4cb53a[_0x4709('0x60')][0x1][_0x4709('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x4d0874){logger['error'](_0x4709('0x7d'),JSON[_0x4709('0x7e')](_0x4d0874));return[];}}exports[_0x4709('0x7f')]=function(_0x499e5d,_0x2136b6,_0x2d60d1){if(_0x499e5d[_0x4709('0x4e')]['id']){delete _0x499e5d[_0x4709('0x4e')]['id'];}return db[_0x4709('0x30')]['find']({'where':{'id':_0x499e5d[_0x4709('0x49')]['id']}})[_0x4709('0x29')](handleEntityNotFound(_0x2136b6,null))['then'](function(_0xb488e1){if(_0xb488e1){_0x499e5d['body'][_0x4709('0x80')]=_0xb488e1['id'];_0x499e5d['body']['attrs']=widgetAttributes(_0x499e5d['body']);return db[_0x4709('0x81')][_0x4709('0x4d')](_0x499e5d[_0x4709('0x4e')]);}})[_0x4709('0x29')](respondWithResult(_0x2136b6,null))['catch'](handleError(_0x2136b6,null));};exports['getItems']=function(_0x59be4f,_0x429845,_0x3b4747){var _0x3de5a7={};var _0x482b52={};var _0x5423c8;var _0xeae872;return db[_0x4709('0x30')][_0x4709('0x82')]({'where':{'id':_0x59be4f[_0x4709('0x49')]['id']}})[_0x4709('0x29')](handleEntityNotFound(_0x429845,null))[_0x4709('0x29')](function(_0x6ae8ac){if(_0x6ae8ac){_0x5423c8=_0x6ae8ac;_0x482b52[_0x4709('0x35')]=_[_0x4709('0x37')](db['DashboardItem'][_0x4709('0x31')]);_0x482b52[_0x4709('0x3b')]=_[_0x4709('0x37')](_0x59be4f[_0x4709('0x3b')]);_0x482b52['filters']=_[_0x4709('0x38')](_0x482b52[_0x4709('0x35')],_0x482b52[_0x4709('0x3b')]);_0x3de5a7[_0x4709('0x39')]=_[_0x4709('0x38')](_0x482b52[_0x4709('0x35')],qs[_0x4709('0x3a')](_0x59be4f[_0x4709('0x3b')][_0x4709('0x3a')]));_0x3de5a7['attributes']=_0x3de5a7[_0x4709('0x39')][_0x4709('0x3c')]?_0x3de5a7[_0x4709('0x39')]:_0x482b52[_0x4709('0x35')];_0x3de5a7[_0x4709('0x83')]=qs[_0x4709('0x3e')](_0x59be4f[_0x4709('0x3b')][_0x4709('0x3e')]);_0x3de5a7['where']=qs[_0x4709('0x4a')](_[_0x4709('0x40')](_0x59be4f[_0x4709('0x3b')],_0x482b52[_0x4709('0x4a')]));if(_0x59be4f['query'][_0x4709('0x41')]){_0x3de5a7['where']=_[_0x4709('0x42')](_0x3de5a7[_0x4709('0x3f')],{'$or':_['map'](_0x3de5a7['attributes'],function(_0x202029){var _0x2ee899={};_0x2ee899[_0x202029]={'$like':'%'+_0x59be4f['query'][_0x4709('0x41')]+'%'};return _0x2ee899;})});}_0x3de5a7=_[_0x4709('0x42')]({},_0x3de5a7,_0x59be4f['options']);return _0x5423c8['getItems'](_0x3de5a7);}})[_0x4709('0x29')](function(_0x2119fe){if(_0x2119fe){_0xeae872=_0x2119fe[_0x4709('0x3c')];if(!_0x59be4f[_0x4709('0x3b')][_0x4709('0x3d')](_0x4709('0x84'))){_0x3de5a7[_0x4709('0x24')]=qs[_0x4709('0x24')](_0x59be4f[_0x4709('0x3b')]['limit']);_0x3de5a7[_0x4709('0x22')]=qs[_0x4709('0x22')](_0x59be4f[_0x4709('0x3b')][_0x4709('0x22')]);}return _0x5423c8[_0x4709('0x85')](_0x3de5a7);}})['then'](function(_0x3235f1){if(_0x3235f1){return _0x3235f1?{'count':_0xeae872,'rows':_0x3235f1}:null;}})[_0x4709('0x29')](respondWithResult(_0x429845,null))[_0x4709('0x56')](handleError(_0x429845,null));}; \ No newline at end of file +var _0x9517=['role','CustomDashboards','create','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrWhatsappAccounts','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','pick','eml-format','rimraf','zip-dir','fast-json-patch','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','error','name','index','map','Dashboard','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','include','rows','catch','show','merge','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','params','rawAttributes','includeAll','options','omit','createdAt','updatedAt'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9517,0x121));var _0x7951=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9517[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x7951('0x0'));var rimraf=require(_0x7951('0x1'));var zipdir=require(_0x7951('0x2'));var jsonpatch=require(_0x7951('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7951('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7951('0x5'));var squel=require(_0x7951('0x6'));var crypto=require(_0x7951('0x7'));var jsforce=require(_0x7951('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7951('0x9'));var Redis=require('ioredis');var authService=require(_0x7951('0xa'));var qs=require(_0x7951('0xb'));var as=require(_0x7951('0xc'));var hardwareService=require(_0x7951('0xd'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7951('0xe'));var licenseUtil=require(_0x7951('0xf'));var db=require(_0x7951('0x10'))['db'];config[_0x7951('0x11')]=_[_0x7951('0x12')](config[_0x7951('0x11')],{'host':_0x7951('0x13'),'port':0x18eb});var socket=require(_0x7951('0x14'))(new Redis(config[_0x7951('0x11')]));require(_0x7951('0x15'))[_0x7951('0x16')](socket);function respondWithStatusCode(_0x289c27,_0x482baa){_0x482baa=_0x482baa||0xcc;return function(_0x1bb101){if(_0x1bb101){return _0x289c27[_0x7951('0x17')](_0x482baa);}return _0x289c27[_0x7951('0x18')](_0x482baa)[_0x7951('0x19')]();};}function respondWithResult(_0x139a7f,_0x169d30){_0x169d30=_0x169d30||0xc8;return function(_0x209923){if(_0x209923){return _0x139a7f[_0x7951('0x18')](_0x169d30)[_0x7951('0x1a')](_0x209923);}};}function respondWithFilteredResult(_0x38b39e,_0x46a3cc){return function(_0x2e5130){if(_0x2e5130){var _0x16a72b=typeof _0x46a3cc[_0x7951('0x1b')]===_0x7951('0x1c')&&typeof _0x46a3cc[_0x7951('0x1d')]===_0x7951('0x1c');var _0x540973=_0x2e5130[_0x7951('0x1e')];var _0xf6767c=_0x16a72b?0x0:_0x46a3cc['offset'];var _0x3138e0=_0x16a72b?_0x2e5130['count']:_0x46a3cc['offset']+_0x46a3cc[_0x7951('0x1d')];var _0x627c61;if(_0x3138e0>=_0x540973){_0x3138e0=_0x540973;_0x627c61=0xc8;}else{_0x627c61=0xce;}_0x38b39e[_0x7951('0x18')](_0x627c61);return _0x38b39e[_0x7951('0x1f')](_0x7951('0x20'),_0xf6767c+'-'+_0x3138e0+'/'+_0x540973)[_0x7951('0x1a')](_0x2e5130);}return null;};}function patchUpdates(_0x550cbd){return function(_0x13be3d){try{jsonpatch[_0x7951('0x21')](_0x13be3d,_0x550cbd,!![]);}catch(_0x4518a4){return BPromise[_0x7951('0x22')](_0x4518a4);}return _0x13be3d[_0x7951('0x23')]();};}function saveUpdates(_0x30ecdd,_0x26397e){return function(_0x532e2b){if(_0x532e2b){return _0x532e2b[_0x7951('0x24')](_0x30ecdd)[_0x7951('0x25')](function(_0x53257a){return _0x53257a;});}return null;};}function removeEntity(_0x30a377,_0x9d4357){return function(_0x4e8496){if(_0x4e8496){return _0x4e8496[_0x7951('0x26')]()[_0x7951('0x25')](function(){var _0x3d4a56=_0x4e8496[_0x7951('0x27')]({'plain':!![]});var _0x4cd512='CustomDashboards';return db['UserProfileResource'][_0x7951('0x26')]({'where':{'type':_0x4cd512,'resourceId':_0x3d4a56['id']}})[_0x7951('0x25')](function(){return _0x4e8496;});})[_0x7951('0x25')](function(){_0x30a377[_0x7951('0x18')](0xcc)[_0x7951('0x19')]();});}};}function handleEntityNotFound(_0x2b0eff,_0x706b8c){return function(_0x3e3c45){if(!_0x3e3c45){_0x2b0eff[_0x7951('0x17')](0x194);}return _0x3e3c45;};}function handleError(_0x14854e,_0x1266a6){_0x1266a6=_0x1266a6||0x1f4;return function(_0x50fe81){logger[_0x7951('0x28')](_0x50fe81['stack']);if(_0x50fe81[_0x7951('0x29')]){delete _0x50fe81[_0x7951('0x29')];}_0x14854e[_0x7951('0x18')](_0x1266a6)['send'](_0x50fe81);};}exports[_0x7951('0x2a')]=function(_0x1025e7,_0x2b9523){var _0x2eb30d={},_0x2ba8d3={},_0x22dcca={'count':0x0,'rows':[]};var _0xe2e544=_[_0x7951('0x2b')](db[_0x7951('0x2c')]['rawAttributes'],function(_0x5a7544){return{'name':_0x5a7544[_0x7951('0x2d')],'type':_0x5a7544['type'][_0x7951('0x2e')]};});_0x2ba8d3['model']=_[_0x7951('0x2b')](_0xe2e544,'name');_0x2ba8d3[_0x7951('0x2f')]=_[_0x7951('0x30')](_0x1025e7['query']);_0x2ba8d3[_0x7951('0x31')]=_[_0x7951('0x32')](_0x2ba8d3['model'],_0x2ba8d3[_0x7951('0x2f')]);_0x2eb30d[_0x7951('0x33')]=_[_0x7951('0x32')](_0x2ba8d3[_0x7951('0x34')],qs[_0x7951('0x35')](_0x1025e7['query']['fields']));_0x2eb30d[_0x7951('0x33')]=_0x2eb30d[_0x7951('0x33')][_0x7951('0x36')]?_0x2eb30d[_0x7951('0x33')]:_0x2ba8d3['model'];if(!_0x1025e7['query'][_0x7951('0x37')](_0x7951('0x38'))){_0x2eb30d[_0x7951('0x1d')]=qs['limit'](_0x1025e7[_0x7951('0x2f')]['limit']);_0x2eb30d[_0x7951('0x1b')]=qs[_0x7951('0x1b')](_0x1025e7['query'][_0x7951('0x1b')]);}_0x2eb30d[_0x7951('0x39')]=qs[_0x7951('0x3a')](_0x1025e7['query'][_0x7951('0x3a')]);_0x2eb30d[_0x7951('0x3b')]=qs[_0x7951('0x31')](_['pick'](_0x1025e7['query'],_0x2ba8d3[_0x7951('0x31')]),_0xe2e544);if(_0x1025e7[_0x7951('0x2f')][_0x7951('0x3c')]){_0x2eb30d[_0x7951('0x3b')]=_['merge'](_0x2eb30d[_0x7951('0x3b')],{'$or':_[_0x7951('0x2b')](_0xe2e544,function(_0x3d57ad){if(_0x3d57ad[_0x7951('0x3d')]!==_0x7951('0x3e')){var _0x4a5481={};_0x4a5481[_0x3d57ad['name']]={'$like':'%'+_0x1025e7[_0x7951('0x2f')][_0x7951('0x3c')]+'%'};return _0x4a5481;}})});}_0x2eb30d=_['merge']({},_0x2eb30d,_0x1025e7['options']);var _0x593c66={'where':_0x2eb30d['where']};return db[_0x7951('0x2c')]['count'](_0x593c66)[_0x7951('0x25')](function(_0x12e8c3){_0x22dcca['count']=_0x12e8c3;if(_0x1025e7[_0x7951('0x2f')]['includeAll']){_0x2eb30d[_0x7951('0x3f')]=[{'all':!![]}];}return db[_0x7951('0x2c')]['findAll'](_0x2eb30d);})['then'](function(_0x4a2fe3){_0x22dcca[_0x7951('0x40')]=_0x4a2fe3;return _0x22dcca;})['then'](respondWithFilteredResult(_0x2b9523,_0x2eb30d))[_0x7951('0x41')](handleError(_0x2b9523,null));};exports[_0x7951('0x42')]=function(_0x2e2245,_0x5739b4){var _0x164f5f={'raw':![],'where':{'id':_0x2e2245['params']['id']}},_0x58864a={};_0x58864a['model']=_[_0x7951('0x30')](db[_0x7951('0x2c')]['rawAttributes']);_0x58864a[_0x7951('0x2f')]=_[_0x7951('0x30')](_0x2e2245[_0x7951('0x2f')]);_0x58864a[_0x7951('0x31')]=_['intersection'](_0x58864a[_0x7951('0x34')],_0x58864a['query']);_0x164f5f['attributes']=_[_0x7951('0x32')](_0x58864a['model'],qs['fields'](_0x2e2245[_0x7951('0x2f')][_0x7951('0x35')]));_0x164f5f[_0x7951('0x33')]=_0x164f5f['attributes'][_0x7951('0x36')]?_0x164f5f[_0x7951('0x33')]:_0x58864a[_0x7951('0x34')];if(_0x2e2245[_0x7951('0x2f')]['includeAll']){_0x164f5f['include']=[{'all':!![]}];}_0x164f5f=_[_0x7951('0x43')]({},_0x164f5f,_0x2e2245['options']);return db[_0x7951('0x2c')]['find'](_0x164f5f)[_0x7951('0x25')](handleEntityNotFound(_0x5739b4,null))[_0x7951('0x25')](respondWithResult(_0x5739b4,null))[_0x7951('0x41')](handleError(_0x5739b4,null));};exports['create']=function(_0x720c65,_0x580243){return db['Dashboard']['create'](_0x720c65[_0x7951('0x44')],{})[_0x7951('0x25')](function(_0xcbfaf2){var _0x23371c=_0x720c65[_0x7951('0x45')]['get']({'plain':!![]});if(!_0x23371c)throw new Error(_0x7951('0x46'));if(_0x23371c['role']==='user'){var _0x5cf20f=_0xcbfaf2[_0x7951('0x27')]({'plain':!![]});var _0x209380='CustomDashboards';return db[_0x7951('0x47')][_0x7951('0x48')]({'where':{'name':_0x209380,'userProfileId':_0x23371c[_0x7951('0x49')]},'raw':!![]})[_0x7951('0x25')](function(_0x6d49fa){if(_0x6d49fa&&_0x6d49fa[_0x7951('0x4a')]===0x0){return db[_0x7951('0x4b')]['create']({'name':_0x5cf20f[_0x7951('0x29')],'resourceId':_0x5cf20f['id'],'type':_0x6d49fa[_0x7951('0x29')],'sectionId':_0x6d49fa['id']},{})[_0x7951('0x25')](function(){return _0xcbfaf2;});}else{return _0xcbfaf2;}})['catch'](function(_0x4e0641){logger[_0x7951('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e0641);throw _0x4e0641;});}return _0xcbfaf2;})[_0x7951('0x25')](respondWithResult(_0x580243,0xc9))[_0x7951('0x41')](handleError(_0x580243,null));};exports['clone']=function(_0x5a7c07,_0x4e4de4){var _0x4e5525={'where':{'id':_0x5a7c07[_0x7951('0x4c')]['id']}},_0x1eac57={};_0x1eac57[_0x7951('0x34')]=_[_0x7951('0x30')](db[_0x7951('0x2c')][_0x7951('0x4d')]);_0x4e5525['attributes']=_['intersection'](_0x1eac57[_0x7951('0x34')],qs['fields'](_0x5a7c07['query'][_0x7951('0x35')]));_0x4e5525[_0x7951('0x33')]=_0x4e5525[_0x7951('0x33')]['length']?_0x4e5525[_0x7951('0x33')]:_0x1eac57[_0x7951('0x34')];if(_0x5a7c07[_0x7951('0x2f')][_0x7951('0x4e')]){_0x4e5525[_0x7951('0x3f')]=[{'all':!![]}];}_0x4e5525=_['merge']({},_0x4e5525,_0x5a7c07[_0x7951('0x4f')]);return db[_0x7951('0x2c')][_0x7951('0x48')](_0x4e5525)[_0x7951('0x25')](handleEntityNotFound(_0x4e4de4,null))[_0x7951('0x25')](function(_0x3535b7){if(_0x3535b7){var _0x43bb94=_0x3535b7[_0x7951('0x27')]({'plain':!![]});_0x43bb94=qs[_0x7951('0x50')](_0x43bb94,['id',_0x7951('0x51'),_0x7951('0x52')]);_0x5a7c07['body']=_[_0x7951('0x50')](_0x5a7c07[_0x7951('0x44')],['id',_0x7951('0x51'),_0x7951('0x52')]);return db[_0x7951('0x2c')]['create'](_[_0x7951('0x43')](_0x43bb94,_0x5a7c07['body']),{'include':_0x5a7c07[_0x7951('0x2f')]['includeAll']?[{'all':!![]}]:undefined})[_0x7951('0x25')](function(_0x3609ba){var _0x1a8629=_0x5a7c07['user']['get']({'plain':!![]});if(!_0x1a8629)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a8629[_0x7951('0x53')]===_0x7951('0x45')){var _0x2cb0ea=_0x3609ba['get']({'plain':!![]});var _0x3ee74b=_0x7951('0x54');return db[_0x7951('0x47')][_0x7951('0x48')]({'where':{'name':_0x3ee74b,'userProfileId':_0x1a8629[_0x7951('0x49')]},'raw':!![]})[_0x7951('0x25')](function(_0x2312f5){if(_0x2312f5&&_0x2312f5[_0x7951('0x4a')]===0x0){return db[_0x7951('0x4b')][_0x7951('0x55')]({'name':_0x2cb0ea[_0x7951('0x29')],'resourceId':_0x2cb0ea['id'],'type':_0x2312f5['name'],'sectionId':_0x2312f5['id']},{})[_0x7951('0x25')](function(){return _0x3609ba;});}else{return _0x3609ba;}})[_0x7951('0x41')](function(_0x7e5e85){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7e5e85);throw _0x7e5e85;});}return _0x3609ba;});}})[_0x7951('0x25')](respondWithResult(_0x4e4de4,0xc9))[_0x7951('0x41')](handleError(_0x4e4de4,null));};exports['update']=function(_0x50f2bf,_0x2ad980){if(_0x50f2bf[_0x7951('0x44')]['id']){delete _0x50f2bf['body']['id'];}return db['Dashboard'][_0x7951('0x48')]({'where':{'id':_0x50f2bf[_0x7951('0x4c')]['id']}})[_0x7951('0x25')](handleEntityNotFound(_0x2ad980,null))[_0x7951('0x25')](saveUpdates(_0x50f2bf['body'],null))[_0x7951('0x25')](respondWithResult(_0x2ad980,null))['catch'](handleError(_0x2ad980,null));};exports['destroy']=function(_0xc8bc6d,_0x23aba1){return db[_0x7951('0x2c')][_0x7951('0x48')]({'where':{'id':_0xc8bc6d[_0x7951('0x4c')]['id']}})['then'](handleEntityNotFound(_0x23aba1,null))['then'](removeEntity(_0x23aba1,null))['catch'](handleError(_0x23aba1,null));};function widgetAttributes(_0x2c2b4b){try{switch(_0x2c2b4b[_0x7951('0x3d')]){case'iframe':return[{'name':_0x7951('0x56'),'value':_0x2c2b4b['attrUrl']||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x0]?_0x2c2b4b['attrs'][0x0]['value']:undefined)||_0x7951('0x58')}];case'custom':return[{'name':'attrPath','value':_0x2c2b4b[_0x7951('0x59')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x0]?_0x2c2b4b[_0x7951('0x57')][0x0][_0x7951('0x5a')]:undefined)||''}];case _0x7951('0x5b'):return[{'name':_0x7951('0x5c'),'value':_0x2c2b4b[_0x7951('0x5c')]||(_0x2c2b4b['attrs']&&_0x2c2b4b[_0x7951('0x57')][0x0]?_0x2c2b4b[_0x7951('0x57')][0x0][_0x7951('0x5a')]:undefined)||'HH:mm:ss'},{'name':_0x7951('0x5d'),'value':_0x2c2b4b[_0x7951('0x5d')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x1]?_0x2c2b4b[_0x7951('0x57')][0x1][_0x7951('0x5a')]:undefined)||_0x7951('0x5e')},{'name':_0x7951('0x5f'),'value':_0x2c2b4b[_0x7951('0x5f')]||(_0x2c2b4b['attrs']&&_0x2c2b4b['attrs'][0x2]?_0x2c2b4b[_0x7951('0x57')][0x2][_0x7951('0x5a')]:undefined)||0xc}];case _0x7951('0x60'):return[{'name':_0x7951('0x61'),'value':_0x2c2b4b[_0x7951('0x61')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b['attrs'][0x0]?_0x2c2b4b['attrs'][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x2c2b4b[_0x7951('0x62')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x1]?_0x2c2b4b['attrs'][0x1][_0x7951('0x5a')]:undefined)||[]},{'name':_0x7951('0x5f'),'value':_0x2c2b4b[_0x7951('0x5f')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x2]?_0x2c2b4b[_0x7951('0x57')][0x2][_0x7951('0x5a')]:undefined)||0x14},{'name':'attrChannel','value':_0x2c2b4b[_0x7951('0x63')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b['attrs'][0x3]?_0x2c2b4b[_0x7951('0x57')][0x3][_0x7951('0x5a')]:undefined)||_0x7951('0x64')},{'name':_0x7951('0x65'),'value':_0x2c2b4b[_0x7951('0x65')]||(_0x2c2b4b['attrs']&&_0x2c2b4b[_0x7951('0x57')][0x4]?_0x2c2b4b[_0x7951('0x57')][0x4][_0x7951('0x5a')]:undefined)||''},{'name':_0x7951('0x66'),'value':_0x2c2b4b[_0x7951('0x66')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x5]?_0x2c2b4b[_0x7951('0x57')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x2c2b4b['attrSmsAccounts']||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x6]?_0x2c2b4b[_0x7951('0x57')][0x6][_0x7951('0x5a')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2c2b4b['attrOpenchannelAccounts']||(_0x2c2b4b['attrs']&&_0x2c2b4b[_0x7951('0x57')][0x7]?_0x2c2b4b[_0x7951('0x57')][0x7][_0x7951('0x5a')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2c2b4b[_0x7951('0x67')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x8]?_0x2c2b4b['attrs'][0x8][_0x7951('0x5a')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2c2b4b['attrChatWebsites']||(_0x2c2b4b['attrs']&&_0x2c2b4b[_0x7951('0x57')][0x9]?_0x2c2b4b[_0x7951('0x57')][0x9][_0x7951('0x5a')]:undefined)||''}];case _0x7951('0x68'):case _0x7951('0x69'):return[{'name':_0x7951('0x6a'),'value':_0x2c2b4b['attrSerie1']||(_0x2c2b4b['attrs']&&_0x2c2b4b[_0x7951('0x57')][0x0]?_0x2c2b4b[_0x7951('0x57')][0x0][_0x7951('0x5a')]:undefined)||_0x7951('0x6b')},{'name':_0x7951('0x6c'),'value':_0x2c2b4b[_0x7951('0x6c')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x1]?_0x2c2b4b['attrs'][0x1]['value']:undefined)||null},{'name':_0x7951('0x6d'),'value':_0x2c2b4b[_0x7951('0x6d')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x2]?_0x2c2b4b[_0x7951('0x57')][0x2]['value']:undefined)||null},{'name':_0x7951('0x62'),'value':_0x2c2b4b[_0x7951('0x62')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x3]?_0x2c2b4b[_0x7951('0x57')][0x3][_0x7951('0x5a')]:undefined)||[]},{'name':_0x7951('0x63'),'value':_0x2c2b4b['attrChannel']||(_0x2c2b4b['attrs']&&_0x2c2b4b['attrs'][0x4]?_0x2c2b4b[_0x7951('0x57')][0x4]['value']:undefined)||'voice'},{'name':_0x7951('0x65'),'value':_0x2c2b4b[_0x7951('0x65')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b['attrs'][0x5]?_0x2c2b4b[_0x7951('0x57')][0x5][_0x7951('0x5a')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x2c2b4b[_0x7951('0x66')]||(_0x2c2b4b['attrs']&&_0x2c2b4b['attrs'][0x6]?_0x2c2b4b[_0x7951('0x57')][0x6][_0x7951('0x5a')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x2c2b4b[_0x7951('0x6e')]||(_0x2c2b4b['attrs']&&_0x2c2b4b[_0x7951('0x57')][0x7]?_0x2c2b4b[_0x7951('0x57')][0x7][_0x7951('0x5a')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2c2b4b[_0x7951('0x6f')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b['attrs'][0x8]?_0x2c2b4b[_0x7951('0x57')][0x8][_0x7951('0x5a')]:undefined)||''},{'name':_0x7951('0x67'),'value':_0x2c2b4b[_0x7951('0x67')]||(_0x2c2b4b['attrs']&&_0x2c2b4b[_0x7951('0x57')][0x9]?_0x2c2b4b['attrs'][0x9]['value']:undefined)||''},{'name':_0x7951('0x70'),'value':_0x2c2b4b[_0x7951('0x70')]||(_0x2c2b4b['attrs']&&_0x2c2b4b[_0x7951('0x57')][0xa]?_0x2c2b4b[_0x7951('0x57')][0xa][_0x7951('0x5a')]:undefined)||''}];case _0x7951('0x71'):return[{'name':'attrReport','type':_0x2c2b4b['reportType']||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x0]?_0x2c2b4b['attrs'][0x0]['type']:undefined)||null,'value':_0x2c2b4b[_0x7951('0x72')]||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x0]?_0x2c2b4b[_0x7951('0x57')][0x0]['value']:undefined)||null},{'name':_0x7951('0x73'),'value':_0x2c2b4b['attrRefresh']||(_0x2c2b4b[_0x7951('0x57')]&&_0x2c2b4b[_0x7951('0x57')][0x1]?_0x2c2b4b[_0x7951('0x57')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4d0742){logger[_0x7951('0x28')](_0x7951('0x74'),JSON[_0x7951('0x75')](_0x4d0742));return[];}}exports[_0x7951('0x76')]=function(_0xfc6aba,_0xd5079c,_0x118aed){if(_0xfc6aba[_0x7951('0x44')]['id']){delete _0xfc6aba[_0x7951('0x44')]['id'];}return db[_0x7951('0x2c')][_0x7951('0x48')]({'where':{'id':_0xfc6aba[_0x7951('0x4c')]['id']}})[_0x7951('0x25')](handleEntityNotFound(_0xd5079c,null))[_0x7951('0x25')](function(_0x3beb2d){if(_0x3beb2d){_0xfc6aba[_0x7951('0x44')][_0x7951('0x77')]=_0x3beb2d['id'];_0xfc6aba['body'][_0x7951('0x57')]=widgetAttributes(_0xfc6aba[_0x7951('0x44')]);return db[_0x7951('0x78')][_0x7951('0x55')](_0xfc6aba[_0x7951('0x44')]);}})[_0x7951('0x25')](respondWithResult(_0xd5079c,null))[_0x7951('0x41')](handleError(_0xd5079c,null));};exports[_0x7951('0x79')]=function(_0x5a0071,_0x5b431e,_0x18ea0b){var _0xe3418e={};var _0x4f6324={};var _0x5719f4;var _0x1d89dc;return db[_0x7951('0x2c')][_0x7951('0x7a')]({'where':{'id':_0x5a0071[_0x7951('0x4c')]['id']}})[_0x7951('0x25')](handleEntityNotFound(_0x5b431e,null))[_0x7951('0x25')](function(_0x3b038d){if(_0x3b038d){_0x5719f4=_0x3b038d;_0x4f6324[_0x7951('0x34')]=_[_0x7951('0x30')](db['DashboardItem'][_0x7951('0x4d')]);_0x4f6324[_0x7951('0x2f')]=_[_0x7951('0x30')](_0x5a0071[_0x7951('0x2f')]);_0x4f6324[_0x7951('0x31')]=_[_0x7951('0x32')](_0x4f6324[_0x7951('0x34')],_0x4f6324[_0x7951('0x2f')]);_0xe3418e['attributes']=_[_0x7951('0x32')](_0x4f6324[_0x7951('0x34')],qs['fields'](_0x5a0071['query'][_0x7951('0x35')]));_0xe3418e[_0x7951('0x33')]=_0xe3418e[_0x7951('0x33')]['length']?_0xe3418e[_0x7951('0x33')]:_0x4f6324[_0x7951('0x34')];_0xe3418e['order']=qs['sort'](_0x5a0071['query'][_0x7951('0x3a')]);_0xe3418e[_0x7951('0x3b')]=qs[_0x7951('0x31')](_[_0x7951('0x7b')](_0x5a0071['query'],_0x4f6324[_0x7951('0x31')]));if(_0x5a0071[_0x7951('0x2f')]['filter']){_0xe3418e[_0x7951('0x3b')]=_[_0x7951('0x43')](_0xe3418e[_0x7951('0x3b')],{'$or':_[_0x7951('0x2b')](_0xe3418e[_0x7951('0x33')],function(_0x5d6f32){var _0x2717f3={};_0x2717f3[_0x5d6f32]={'$like':'%'+_0x5a0071[_0x7951('0x2f')][_0x7951('0x3c')]+'%'};return _0x2717f3;})});}_0xe3418e=_[_0x7951('0x43')]({},_0xe3418e,_0x5a0071[_0x7951('0x4f')]);return _0x5719f4[_0x7951('0x79')](_0xe3418e);}})[_0x7951('0x25')](function(_0x301138){if(_0x301138){_0x1d89dc=_0x301138['length'];if(!_0x5a0071[_0x7951('0x2f')][_0x7951('0x37')](_0x7951('0x38'))){_0xe3418e['limit']=qs['limit'](_0x5a0071['query'][_0x7951('0x1d')]);_0xe3418e['offset']=qs[_0x7951('0x1b')](_0x5a0071[_0x7951('0x2f')][_0x7951('0x1b')]);}return _0x5719f4[_0x7951('0x79')](_0xe3418e);}})[_0x7951('0x25')](function(_0x30e214){if(_0x30e214){return _0x30e214?{'count':_0x1d89dc,'rows':_0x30e214}:null;}})[_0x7951('0x25')](respondWithResult(_0x5b431e,null))[_0x7951('0x41')](handleError(_0x5b431e,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index ad09416..5ec14d2 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 _0xb5f8=['events','../../mysqldb','Dashboard','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x483d2a,_0x4bffba){var _0x5ba5d5=function(_0x33e56a){while(--_0x33e56a){_0x483d2a['push'](_0x483d2a['shift']());}};_0x5ba5d5(++_0x4bffba);}(_0xb5f8,0x168));var _0x8b5f=function(_0x367d88,_0x2e288f){_0x367d88=_0x367d88-0x0;var _0x30de82=_0xb5f8[_0x367d88];return _0x30de82;};'use strict';var EventEmitter=require(_0x8b5f('0x0'));var Dashboard=require(_0x8b5f('0x1'))['db'][_0x8b5f('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8b5f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8b5f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3047a7){return function(_0xb70eb8,_0x46e6b5,_0xe1a7d0){DashboardEvents['emit'](_0x3047a7+':'+_0xb70eb8['id'],_0xb70eb8);DashboardEvents[_0x8b5f('0x5')](_0x3047a7,_0xb70eb8);_0xe1a7d0(null);};}for(var e in events){if(events[_0x8b5f('0x6')](e)){var event=events[e];Dashboard[_0x8b5f('0x7')](e,emitEvent(event));}}module[_0x8b5f('0x8')]=DashboardEvents; \ No newline at end of file +var _0x3b4e=['hasOwnProperty','hook','exports','../../mysqldb','Dashboard','remove','emit'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3b4e,0x15a));var _0xe3b4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b4e[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xe3b4('0x0'))['db'][_0xe3b4('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe3b4('0x2')};function emitEvent(_0x13989c){return function(_0x1151bf,_0x14d0c,_0x556eec){DashboardEvents[_0xe3b4('0x3')](_0x13989c+':'+_0x1151bf['id'],_0x1151bf);DashboardEvents[_0xe3b4('0x3')](_0x13989c,_0x1151bf);_0x556eec(null);};}for(var e in events){if(events[_0xe3b4('0x4')](e)){var event=events[e];Dashboard[_0xe3b4('0x5')](e,emitEvent(event));}}module[_0xe3b4('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 09c972c..2c6738c 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 _0xd44f=['define','Dashboard','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x22b4df,_0x2971f3){var _0xb778a6=function(_0x355607){while(--_0x355607){_0x22b4df['push'](_0x22b4df['shift']());}};_0xb778a6(++_0x2971f3);}(_0xd44f,0x1c4));var _0xfd44=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xd44f[_0x1203f];return _0x365f0a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfd44('0x0'))('api');var moment=require(_0xfd44('0x1'));var BPromise=require(_0xfd44('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd44('0x3'));var rimraf=require(_0xfd44('0x4'));var config=require(_0xfd44('0x5'));var attributes=require('./dashboard.attributes');module[_0xfd44('0x6')]=function(_0x1a9bec,_0xda2abf){return _0x1a9bec[_0xfd44('0x7')](_0xfd44('0x8'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11d0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./dashboard.attributes','define','Dashboard','dashboards','lodash','util'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0x11d0,0x76));var _0x011d=function(_0x244f9a,_0x583207){_0x244f9a=_0x244f9a-0x0;var _0x34ca8d=_0x11d0[_0x244f9a];return _0x34ca8d;};'use strict';var _=require(_0x011d('0x0'));var util=require(_0x011d('0x1'));var logger=require(_0x011d('0x2'))(_0x011d('0x3'));var moment=require(_0x011d('0x4'));var BPromise=require(_0x011d('0x5'));var rp=require(_0x011d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x011d('0x7'));var config=require('../../config/environment');var attributes=require(_0x011d('0x8'));module['exports']=function(_0x47384a,_0x512f39){return _0x47384a[_0x011d('0x9')](_0x011d('0xa'),attributes,{'tableName':_0x011d('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 d7ee017..86248c5 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 _0x4dfa=['../../config/environment','http','redis','defaults','register','request','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','bluebird','ioredis','rpc'];(function(_0x408b9c,_0x2e922b){var _0x56be70=function(_0x31726b){while(--_0x31726b){_0x408b9c['push'](_0x408b9c['shift']());}};_0x56be70(++_0x2e922b);}(_0x4dfa,0xec));var _0xa4df=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4dfa[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xa4df('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa4df('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4df('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa4df('0x3'));var config=require(_0xa4df('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa4df('0x5')]({'port':0x232a});config[_0xa4df('0x6')]=_[_0xa4df('0x7')](config[_0xa4df('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0xa4df('0x8')](socket);function respondWithRpcPromise(_0x4cc832,_0x1ce9ef,_0x5cd317){return new BPromise(function(_0x59caaa,_0x446d4a){return client[_0xa4df('0x9')](_0x4cc832,_0x5cd317)['then'](function(_0xf4ce10){logger['info'](_0xa4df('0xa'),_0x1ce9ef,_0xa4df('0xb'));logger[_0xa4df('0xc')](_0xa4df('0xd'),_0x1ce9ef,_0xa4df('0xb'),JSON[_0xa4df('0xe')](_0xf4ce10));if(_0xf4ce10[_0xa4df('0xf')]){if(_0xf4ce10[_0xa4df('0xf')][_0xa4df('0x10')]===0x1f4){logger[_0xa4df('0xf')](_0xa4df('0xa'),_0x1ce9ef,_0xf4ce10[_0xa4df('0xf')][_0xa4df('0x11')]);return _0x446d4a(_0xf4ce10[_0xa4df('0xf')][_0xa4df('0x11')]);}logger[_0xa4df('0xf')](_0xa4df('0xa'),_0x1ce9ef,_0xf4ce10['error'][_0xa4df('0x11')]);return _0x59caaa(_0xf4ce10['error']['message']);}else{logger[_0xa4df('0x12')](_0xa4df('0xa'),_0x1ce9ef,_0xa4df('0xb'));_0x59caaa(_0xf4ce10[_0xa4df('0x13')][_0xa4df('0x11')]);}})['catch'](function(_0x56c369){logger[_0xa4df('0xf')](_0xa4df('0xa'),_0x1ce9ef,_0x56c369);_0x446d4a(_0x56c369);});});} \ No newline at end of file +var _0xe764=['request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s'];(function(_0x417a4e,_0x4abd7f){var _0x3444e9=function(_0x1f03f5){while(--_0x1f03f5){_0x417a4e['push'](_0x417a4e['shift']());}};_0x3444e9(++_0x4abd7f);}(_0xe764,0x11f));var _0x4e76=function(_0x2ecf03,_0x2adccf){_0x2ecf03=_0x2ecf03-0x0;var _0x4418ab=_0xe764[_0x2ecf03];return _0x4418ab;};'use strict';var _=require(_0x4e76('0x0'));var util=require(_0x4e76('0x1'));var moment=require(_0x4e76('0x2'));var BPromise=require(_0x4e76('0x3'));var rs=require(_0x4e76('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e76('0x5'))['db'];var utils=require(_0x4e76('0x6'));var logger=require(_0x4e76('0x7'))(_0x4e76('0x8'));var config=require(_0x4e76('0x9'));var jayson=require(_0x4e76('0xa'));var client=jayson[_0x4e76('0xb')][_0x4e76('0xc')]({'port':0x232a});config[_0x4e76('0xd')]=_[_0x4e76('0xe')](config[_0x4e76('0xd')],{'host':_0x4e76('0xf'),'port':0x18eb});var socket=require(_0x4e76('0x10'))(new Redis(config['redis']));require(_0x4e76('0x11'))[_0x4e76('0x12')](socket);function respondWithRpcPromise(_0x1a6970,_0x5cf7af,_0x54d40a){return new BPromise(function(_0x2e38dc,_0x30f16e){return client[_0x4e76('0x13')](_0x1a6970,_0x54d40a)[_0x4e76('0x14')](function(_0x36aca5){logger[_0x4e76('0x15')](_0x4e76('0x16'),_0x5cf7af,_0x4e76('0x17'));logger[_0x4e76('0x18')](_0x4e76('0x19'),_0x5cf7af,_0x4e76('0x17'),JSON[_0x4e76('0x1a')](_0x36aca5));if(_0x36aca5[_0x4e76('0x1b')]){if(_0x36aca5[_0x4e76('0x1b')][_0x4e76('0x1c')]===0x1f4){logger[_0x4e76('0x1b')]('Dashboard,\x20%s,\x20%s',_0x5cf7af,_0x36aca5[_0x4e76('0x1b')][_0x4e76('0x1d')]);return _0x30f16e(_0x36aca5[_0x4e76('0x1b')][_0x4e76('0x1d')]);}logger[_0x4e76('0x1b')](_0x4e76('0x16'),_0x5cf7af,_0x36aca5['error'][_0x4e76('0x1d')]);return _0x2e38dc(_0x36aca5[_0x4e76('0x1b')][_0x4e76('0x1d')]);}else{logger[_0x4e76('0x15')]('Dashboard,\x20%s,\x20%s',_0x5cf7af,_0x4e76('0x17'));_0x2e38dc(_0x36aca5[_0x4e76('0x1e')][_0x4e76('0x1d')]);}})['catch'](function(_0x4c9d32){logger[_0x4e76('0x1b')](_0x4e76('0x16'),_0x5cf7af,_0x4c9d32);_0x30f16e(_0x4c9d32);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index f027e51..ee387bd 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 _0xeb7a=['removeListener','register','length','dashboard:','remove','update'];(function(_0x17dc92,_0x2e9db7){var _0x517303=function(_0x597fd0){while(--_0x597fd0){_0x17dc92['push'](_0x17dc92['shift']());}};_0x517303(++_0x2e9db7);}(_0xeb7a,0x166));var _0xaeb7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb7a[_0x3dd15e];return _0x231fd0;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0xaeb7('0x0'),_0xaeb7('0x1')];function createListener(_0x303e52,_0x57ae03){return function(_0x12a2eb){_0x57ae03['emit'](_0x303e52,_0x12a2eb);};}function removeListener(_0x54f1d5,_0x17edba){return function(){DashboardEvents[_0xaeb7('0x2')](_0x54f1d5,_0x17edba);};}exports[_0xaeb7('0x3')]=function(_0x55931f){for(var _0x348523=0x0,_0xccabf3=events[_0xaeb7('0x4')];_0x348523<_0xccabf3;_0x348523++){var _0x144c6d=events[_0x348523];var _0x3a0453=createListener(_0xaeb7('0x5')+_0x144c6d,_0x55931f);DashboardEvents['on'](_0x144c6d,_0x3a0453);}}; \ No newline at end of file +var _0xa7eb=['register','length','dashboard:','./dashboard.events','remove','update','emit'];(function(_0x209946,_0x579c4f){var _0x765974=function(_0xc392e8){while(--_0xc392e8){_0x209946['push'](_0x209946['shift']());}};_0x765974(++_0x579c4f);}(_0xa7eb,0x1df));var _0xba7e=function(_0x38eed4,_0xcaf6c4){_0x38eed4=_0x38eed4-0x0;var _0x637060=_0xa7eb[_0x38eed4];return _0x637060;};'use strict';var DashboardEvents=require(_0xba7e('0x0'));var events=['save',_0xba7e('0x1'),_0xba7e('0x2')];function createListener(_0x4b7152,_0x4895db){return function(_0x2f5192){_0x4895db[_0xba7e('0x3')](_0x4b7152,_0x2f5192);};}function removeListener(_0x1e1ae8,_0x4cdaea){return function(){DashboardEvents['removeListener'](_0x1e1ae8,_0x4cdaea);};}exports[_0xba7e('0x4')]=function(_0x293a06){for(var _0x58b260=0x0,_0x395ce2=events[_0xba7e('0x5')];_0x58b260<_0x395ce2;_0x58b260++){var _0x39913e=events[_0x58b260];var _0x4aa6cc=createListener(_0xba7e('0x6')+_0x39913e,_0x293a06);DashboardEvents['on'](_0x39913e,_0x4aa6cc);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 815471a..05ed3b8 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 _0x708e=['post','create','clone','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','/:id/items'];(function(_0xe1c518,_0x400c45){var _0x5c1b90=function(_0x589c11){while(--_0x589c11){_0xe1c518['push'](_0xe1c518['shift']());}};_0x5c1b90(++_0x400c45);}(_0x708e,0x9b));var _0xe708=function(_0x33f31b,_0x550ae9){_0x33f31b=_0x33f31b-0x0;var _0x33514e=_0x708e[_0x33f31b];return _0x33514e;};'use strict';var multer=require(_0xe708('0x0'));var util=require('util');var path=require(_0xe708('0x1'));var timeout=require('connect-timeout');var express=require(_0xe708('0x2'));var router=express[_0xe708('0x3')]();var fs_extra=require(_0xe708('0x4'));var auth=require(_0xe708('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe708('0x6'));var controller=require(_0xe708('0x7'));router[_0xe708('0x8')]('/',auth[_0xe708('0x9')](),controller[_0xe708('0xa')]);router[_0xe708('0x8')](_0xe708('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe708('0x8')](_0xe708('0xc'),auth[_0xe708('0x9')](),controller['getItems']);router[_0xe708('0xd')]('/',auth[_0xe708('0x9')](),controller[_0xe708('0xe')]);router[_0xe708('0xd')]('/:id/clone',auth[_0xe708('0x9')](),controller[_0xe708('0xf')]);router[_0xe708('0xd')](_0xe708('0xc'),auth[_0xe708('0x9')](),controller['addItem']);router[_0xe708('0x10')]('/:id',auth[_0xe708('0x9')](),controller[_0xe708('0x11')]);router[_0xe708('0x12')](_0xe708('0xb'),auth[_0xe708('0x9')](),controller[_0xe708('0x13')]);module[_0xe708('0x14')]=router; \ No newline at end of file +var _0xa410=['/:id','/:id/items','post','create','clone','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0xa410,0x15e));var _0x0a41=function(_0x4ea2a0,_0x2ccb70){_0x4ea2a0=_0x4ea2a0-0x0;var _0x25a7af=_0xa410[_0x4ea2a0];return _0x25a7af;};'use strict';var multer=require('multer');var util=require(_0x0a41('0x0'));var path=require(_0x0a41('0x1'));var timeout=require(_0x0a41('0x2'));var express=require(_0x0a41('0x3'));var router=express[_0x0a41('0x4')]();var fs_extra=require(_0x0a41('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0a41('0x6'));var config=require(_0x0a41('0x7'));var controller=require('./dashboard.controller');router[_0x0a41('0x8')]('/',auth[_0x0a41('0x9')](),controller[_0x0a41('0xa')]);router['get'](_0x0a41('0xb'),auth[_0x0a41('0x9')](),controller['show']);router[_0x0a41('0x8')](_0x0a41('0xc'),auth[_0x0a41('0x9')](),controller['getItems']);router[_0x0a41('0xd')]('/',auth[_0x0a41('0x9')](),controller[_0x0a41('0xe')]);router[_0x0a41('0xd')]('/:id/clone',auth[_0x0a41('0x9')](),controller[_0x0a41('0xf')]);router[_0x0a41('0xd')](_0x0a41('0xc'),auth[_0x0a41('0x9')](),controller['addItem']);router['put'](_0x0a41('0xb'),auth[_0x0a41('0x9')](),controller['update']);router[_0x0a41('0x10')](_0x0a41('0xb'),auth[_0x0a41('0x9')](),controller[_0x0a41('0x11')]);module[_0x0a41('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 7d4015f..84445f8 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(_0x1125e8,_0x3c2e35){var _0x29cab3=function(_0x5e5bb6){while(--_0x5e5bb6){_0x1125e8['push'](_0x1125e8['shift']());}};_0x29cab3(++_0x3c2e35);}(_0x2ef3,0xba));var _0x32ef=function(_0x1bc95f,_0x24ed3d){_0x1bc95f=_0x1bc95f-0x0;var _0x255368=_0x2ef3[_0x1bc95f];return _0x255368;};'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 _0x524e=['exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','lodash'];(function(_0x4a9556,_0x4ab8b6){var _0x2aba59=function(_0x4cd825){while(--_0x4cd825){_0x4a9556['push'](_0x4a9556['shift']());}};_0x2aba59(++_0x4ab8b6);}(_0x524e,0x15e));var _0xe524=function(_0x2af3b6,_0x23cee7){_0x2af3b6=_0x2af3b6-0x0;var _0x3a5190=_0x524e[_0x2af3b6];return _0x3a5190;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0xe524('0x0'));module[_0xe524('0x1')]={'title':{'type':Sequelize[_0xe524('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe524('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xe524('0x3')](_0xe524('0x4')),'get':function(){try{return JSON[_0xe524('0x5')](this[_0xe524('0x6')](_0xe524('0x7')));}catch(_0x110cff){return[];}},'set':function(_0x4f75d6){try{this[_0xe524('0x8')](_0xe524('0x7'),JSON[_0xe524('0x9')](_0x4f75d6));}catch(_0x533c14){this[_0xe524('0x8')](_0xe524('0x7'),JSON[_0xe524('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xe524('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xe524('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xe524('0xa')]},'col':{'type':Sequelize[_0xe524('0xa')]},'background':{'type':Sequelize[_0xe524('0x2')],'allowNull':![],'defaultValue':_0xe524('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xe524('0x2')],'allowNull':![],'defaultValue':_0xe524('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xe524('0x2')]},'titleFontSize':{'type':Sequelize[_0xe524('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 96ef2e0..8180cf8 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 _0x2bd8=['attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','total','attrSerie2','attrSerie3','voice','attrFaxAccounts','web-report','attrReport','reportType','stringify','create','body','catch','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./dashboardItem.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','params','type','iframe','attrUrl','value','attrPath','attrs','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter'];(function(_0x5c53a1,_0xe83fc7){var _0x489089=function(_0x36957b){while(--_0x36957b){_0x5c53a1['push'](_0x5c53a1['shift']());}};_0x489089(++_0xe83fc7);}(_0x2bd8,0x130));var _0x82bd=function(_0x407586,_0x1067d1){_0x407586=_0x407586-0x0;var _0x23a623=_0x2bd8[_0x407586];return _0x23a623;};'use strict';var emlformat=require(_0x82bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82bd('0x1'));var jsonpatch=require(_0x82bd('0x2'));var rp=require(_0x82bd('0x3'));var moment=require(_0x82bd('0x4'));var BPromise=require(_0x82bd('0x5'));var Mustache=require(_0x82bd('0x6'));var util=require(_0x82bd('0x7'));var path=require('path');var sox=require(_0x82bd('0x8'));var csv=require(_0x82bd('0x9'));var ejs=require(_0x82bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x82bd('0x13'))['db'];config['redis']=_[_0x82bd('0x14')](config['redis'],{'host':_0x82bd('0x15'),'port':0x18eb});var socket=require(_0x82bd('0x16'))(new Redis(config[_0x82bd('0x17')]));require(_0x82bd('0x18'))['register'](socket);function respondWithStatusCode(_0x446ffc,_0xd43e79){_0xd43e79=_0xd43e79||0xcc;return function(_0x52e533){if(_0x52e533){return _0x446ffc[_0x82bd('0x19')](_0xd43e79);}return _0x446ffc['status'](_0xd43e79)[_0x82bd('0x1a')]();};}function respondWithResult(_0x433e7d,_0x2c5155){_0x2c5155=_0x2c5155||0xc8;return function(_0x300982){if(_0x300982){return _0x433e7d[_0x82bd('0x1b')](_0x2c5155)[_0x82bd('0x1c')](_0x300982);}};}function respondWithFilteredResult(_0x387d21,_0xb7a986){return function(_0x31a350){if(_0x31a350){var _0xf180aa=typeof _0xb7a986[_0x82bd('0x1d')]===_0x82bd('0x1e')&&typeof _0xb7a986[_0x82bd('0x1f')]===_0x82bd('0x1e');var _0x4a1e62=_0x31a350['count'];var _0x283ce7=_0xf180aa?0x0:_0xb7a986[_0x82bd('0x1d')];var _0x2ee27c=_0xf180aa?_0x31a350[_0x82bd('0x20')]:_0xb7a986[_0x82bd('0x1d')]+_0xb7a986[_0x82bd('0x1f')];var _0x2c1810;if(_0x2ee27c>=_0x4a1e62){_0x2ee27c=_0x4a1e62;_0x2c1810=0xc8;}else{_0x2c1810=0xce;}_0x387d21[_0x82bd('0x1b')](_0x2c1810);return _0x387d21[_0x82bd('0x21')](_0x82bd('0x22'),_0x283ce7+'-'+_0x2ee27c+'/'+_0x4a1e62)[_0x82bd('0x1c')](_0x31a350);}return null;};}function patchUpdates(_0x177025){return function(_0x1ca91f){try{jsonpatch[_0x82bd('0x23')](_0x1ca91f,_0x177025,!![]);}catch(_0x3d9f03){return BPromise[_0x82bd('0x24')](_0x3d9f03);}return _0x1ca91f[_0x82bd('0x25')]();};}function saveUpdates(_0x3b6b93,_0x673943){return function(_0x547e45){if(_0x547e45){return _0x547e45['update'](_0x3b6b93)[_0x82bd('0x26')](function(_0x436ecd){return _0x436ecd;});}return null;};}function removeEntity(_0x1cb292,_0x3eb6a5){return function(_0x25cb16){if(_0x25cb16){return _0x25cb16[_0x82bd('0x27')]()[_0x82bd('0x26')](function(){_0x1cb292[_0x82bd('0x1b')](0xcc)[_0x82bd('0x1a')]();});}};}function handleEntityNotFound(_0x2add80,_0x53a2a6){return function(_0x5bd22f){if(!_0x5bd22f){_0x2add80['sendStatus'](0x194);}return _0x5bd22f;};}function handleError(_0x5d1015,_0x714d70){_0x714d70=_0x714d70||0x1f4;return function(_0x52bcd8){logger[_0x82bd('0x28')](_0x52bcd8[_0x82bd('0x29')]);if(_0x52bcd8[_0x82bd('0x2a')]){delete _0x52bcd8['name'];}_0x5d1015['status'](_0x714d70)['send'](_0x52bcd8);};}exports[_0x82bd('0x2b')]=function(_0x2a5867,_0x40884f){var _0x580ba8={'raw':![],'where':{'id':_0x2a5867['params']['id']}},_0x166c46={};_0x166c46[_0x82bd('0x2c')]=_[_0x82bd('0x2d')](db[_0x82bd('0x2e')][_0x82bd('0x2f')]);_0x166c46[_0x82bd('0x30')]=_[_0x82bd('0x2d')](_0x2a5867['query']);_0x166c46[_0x82bd('0x31')]=_[_0x82bd('0x32')](_0x166c46[_0x82bd('0x2c')],_0x166c46['query']);_0x580ba8[_0x82bd('0x33')]=_['intersection'](_0x166c46['model'],qs[_0x82bd('0x34')](_0x2a5867[_0x82bd('0x30')][_0x82bd('0x34')]));_0x580ba8[_0x82bd('0x33')]=_0x580ba8[_0x82bd('0x33')][_0x82bd('0x35')]?_0x580ba8[_0x82bd('0x33')]:_0x166c46[_0x82bd('0x2c')];if(_0x2a5867[_0x82bd('0x30')][_0x82bd('0x36')]){_0x580ba8[_0x82bd('0x37')]=[{'all':!![]}];}_0x580ba8=_[_0x82bd('0x38')]({},_0x580ba8,_0x2a5867[_0x82bd('0x39')]);return db[_0x82bd('0x2e')][_0x82bd('0x3a')](_0x580ba8)[_0x82bd('0x26')](handleEntityNotFound(_0x40884f,null))[_0x82bd('0x26')](respondWithResult(_0x40884f,null))['catch'](handleError(_0x40884f,null));};exports['destroy']=function(_0x59319d,_0x3fea10){return db[_0x82bd('0x2e')]['find']({'where':{'id':_0x59319d[_0x82bd('0x3b')]['id']}})['then'](handleEntityNotFound(_0x3fea10,null))['then'](removeEntity(_0x3fea10,null))['catch'](handleError(_0x3fea10,null));};function widgetAttributes(_0x2b7675){try{switch(_0x2b7675[_0x82bd('0x3c')]){case _0x82bd('0x3d'):return[{'name':_0x82bd('0x3e'),'value':_0x2b7675[_0x82bd('0x3e')]||(_0x2b7675['attrs']&&_0x2b7675['attrs'][0x0]?_0x2b7675['attrs'][0x0][_0x82bd('0x3f')]:undefined)||'https://'}];case'custom':return[{'name':_0x82bd('0x40'),'value':_0x2b7675[_0x82bd('0x40')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x0]?_0x2b7675[_0x82bd('0x41')][0x0][_0x82bd('0x3f')]:undefined)||''}];case _0x82bd('0x42'):return[{'name':_0x82bd('0x43'),'value':_0x2b7675[_0x82bd('0x43')]||(_0x2b7675['attrs']&&_0x2b7675['attrs'][0x0]?_0x2b7675[_0x82bd('0x41')][0x0][_0x82bd('0x3f')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x2b7675[_0x82bd('0x44')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675['attrs'][0x1]?_0x2b7675[_0x82bd('0x41')][0x1][_0x82bd('0x3f')]:undefined)||_0x82bd('0x45')},{'name':_0x82bd('0x46'),'value':_0x2b7675[_0x82bd('0x46')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x2]?_0x2b7675[_0x82bd('0x41')][0x2][_0x82bd('0x3f')]:undefined)||0xc}];case _0x82bd('0x47'):return[{'name':_0x82bd('0x48'),'value':_0x2b7675[_0x82bd('0x48')]||(_0x2b7675['attrs']&&_0x2b7675[_0x82bd('0x41')][0x0]?_0x2b7675[_0x82bd('0x41')][0x0]['value']:undefined)||'total'},{'name':_0x82bd('0x49'),'value':_0x2b7675[_0x82bd('0x49')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x1]?_0x2b7675[_0x82bd('0x41')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x2b7675[_0x82bd('0x46')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675['attrs'][0x2]?_0x2b7675[_0x82bd('0x41')][0x2]['value']:undefined)||0x14},{'name':_0x82bd('0x4a'),'value':_0x2b7675[_0x82bd('0x4a')]||(_0x2b7675['attrs']&&_0x2b7675[_0x82bd('0x41')][0x3]?_0x2b7675[_0x82bd('0x41')][0x3]['value']:undefined)||'voice'},{'name':_0x82bd('0x4b'),'value':_0x2b7675['attrEmailAccounts']||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x4]?_0x2b7675[_0x82bd('0x41')][0x4][_0x82bd('0x3f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x2b7675['attrFaxAccounts']||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x5]?_0x2b7675['attrs'][0x5][_0x82bd('0x3f')]:undefined)||''},{'name':_0x82bd('0x4c'),'value':_0x2b7675[_0x82bd('0x4c')]||(_0x2b7675['attrs']&&_0x2b7675[_0x82bd('0x41')][0x6]?_0x2b7675[_0x82bd('0x41')][0x6][_0x82bd('0x3f')]:undefined)||''},{'name':_0x82bd('0x4d'),'value':_0x2b7675[_0x82bd('0x4d')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x7]?_0x2b7675[_0x82bd('0x41')][0x7][_0x82bd('0x3f')]:undefined)||''},{'name':_0x82bd('0x4e'),'value':_0x2b7675[_0x82bd('0x4e')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x8]?_0x2b7675['attrs'][0x8][_0x82bd('0x3f')]:undefined)||''},{'name':_0x82bd('0x4f'),'value':_0x2b7675['attrChatWebsites']||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x9]?_0x2b7675[_0x82bd('0x41')][0x9][_0x82bd('0x3f')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x82bd('0x50'),'value':_0x2b7675['attrSerie1']||(_0x2b7675['attrs']&&_0x2b7675[_0x82bd('0x41')][0x0]?_0x2b7675['attrs'][0x0]['value']:undefined)||_0x82bd('0x51')},{'name':_0x82bd('0x52'),'value':_0x2b7675[_0x82bd('0x52')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x1]?_0x2b7675[_0x82bd('0x41')][0x1][_0x82bd('0x3f')]:undefined)||null},{'name':_0x82bd('0x53'),'value':_0x2b7675[_0x82bd('0x53')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x2]?_0x2b7675[_0x82bd('0x41')][0x2][_0x82bd('0x3f')]:undefined)||null},{'name':_0x82bd('0x49'),'value':_0x2b7675[_0x82bd('0x49')]||(_0x2b7675['attrs']&&_0x2b7675[_0x82bd('0x41')][0x3]?_0x2b7675[_0x82bd('0x41')][0x3][_0x82bd('0x3f')]:undefined)||[]},{'name':_0x82bd('0x4a'),'value':_0x2b7675[_0x82bd('0x4a')]||(_0x2b7675['attrs']&&_0x2b7675['attrs'][0x4]?_0x2b7675['attrs'][0x4]['value']:undefined)||_0x82bd('0x54')},{'name':_0x82bd('0x4b'),'value':_0x2b7675[_0x82bd('0x4b')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675['attrs'][0x5]?_0x2b7675['attrs'][0x5][_0x82bd('0x3f')]:undefined)||''},{'name':_0x82bd('0x55'),'value':_0x2b7675[_0x82bd('0x55')]||(_0x2b7675['attrs']&&_0x2b7675[_0x82bd('0x41')][0x6]?_0x2b7675[_0x82bd('0x41')][0x6][_0x82bd('0x3f')]:undefined)||''},{'name':_0x82bd('0x4c'),'value':_0x2b7675[_0x82bd('0x4c')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x7]?_0x2b7675[_0x82bd('0x41')][0x7][_0x82bd('0x3f')]:undefined)||''},{'name':_0x82bd('0x4d'),'value':_0x2b7675[_0x82bd('0x4d')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x8]?_0x2b7675[_0x82bd('0x41')][0x8][_0x82bd('0x3f')]:undefined)||''},{'name':_0x82bd('0x4e'),'value':_0x2b7675[_0x82bd('0x4e')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675['attrs'][0x9]?_0x2b7675[_0x82bd('0x41')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x2b7675[_0x82bd('0x4f')]||(_0x2b7675['attrs']&&_0x2b7675[_0x82bd('0x41')][0xa]?_0x2b7675[_0x82bd('0x41')][0xa][_0x82bd('0x3f')]:undefined)||''}];case _0x82bd('0x56'):return[{'name':_0x82bd('0x57'),'type':_0x2b7675[_0x82bd('0x58')]||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x0]?_0x2b7675[_0x82bd('0x41')][0x0][_0x82bd('0x3c')]:undefined)||null,'value':_0x2b7675[_0x82bd('0x57')]||(_0x2b7675['attrs']&&_0x2b7675['attrs'][0x0]?_0x2b7675[_0x82bd('0x41')][0x0][_0x82bd('0x3f')]:undefined)||null},{'name':'attrRefresh','value':_0x2b7675['attrRefresh']||(_0x2b7675[_0x82bd('0x41')]&&_0x2b7675[_0x82bd('0x41')][0x1]?_0x2b7675[_0x82bd('0x41')][0x1][_0x82bd('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x5c2f56){logger[_0x82bd('0x28')]('widgetAttributes:\x20%s',JSON[_0x82bd('0x59')](_0x5c2f56));return[];}}exports[_0x82bd('0x5a')]=function(_0x51b3dd,_0x27d247){if(_0x51b3dd[_0x82bd('0x5b')]){_0x51b3dd[_0x82bd('0x5b')][_0x82bd('0x41')]=widgetAttributes(_0x51b3dd['body']);}return db[_0x82bd('0x2e')][_0x82bd('0x5a')](_0x51b3dd[_0x82bd('0x5b')],{})[_0x82bd('0x26')](respondWithResult(_0x27d247,0xc9))[_0x82bd('0x5c')](handleError(_0x27d247,null));};exports[_0x82bd('0x5d')]=function(_0x73c194,_0x19af06){if(_0x73c194[_0x82bd('0x5b')]['id']){delete _0x73c194['body']['id'];}_0x73c194[_0x82bd('0x5b')]['attrs']=widgetAttributes(_0x73c194['body']);return db[_0x82bd('0x2e')][_0x82bd('0x3a')]({'where':{'id':_0x73c194['params']['id']}})[_0x82bd('0x26')](handleEntityNotFound(_0x19af06,null))['then'](saveUpdates(_0x73c194[_0x82bd('0x5b')],null))[_0x82bd('0x26')](respondWithResult(_0x19af06,null))['catch'](handleError(_0x19af06,null));}; \ No newline at end of file +var _0x6c14=['stringify','create','body','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','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','show','params','model','keys','DashboardItem','query','intersection','attributes','fields','length','includeAll','options','find','catch','destroy','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','attrMetric','total','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s'];(function(_0x5707e7,_0x5b5796){var _0x138c30=function(_0x4176f9){while(--_0x4176f9){_0x5707e7['push'](_0x5707e7['shift']());}};_0x138c30(++_0x5b5796);}(_0x6c14,0xd1));var _0x46c1=function(_0x122955,_0x311d5c){_0x122955=_0x122955-0x0;var _0x5d5f87=_0x6c14[_0x122955];return _0x5d5f87;};'use strict';var emlformat=require(_0x46c1('0x0'));var rimraf=require(_0x46c1('0x1'));var zipdir=require(_0x46c1('0x2'));var jsonpatch=require(_0x46c1('0x3'));var rp=require(_0x46c1('0x4'));var moment=require('moment');var BPromise=require(_0x46c1('0x5'));var Mustache=require(_0x46c1('0x6'));var util=require(_0x46c1('0x7'));var path=require('path');var sox=require(_0x46c1('0x8'));var csv=require(_0x46c1('0x9'));var ejs=require(_0x46c1('0xa'));var fs=require('fs');var fs_extra=require(_0x46c1('0xb'));var _=require(_0x46c1('0xc'));var squel=require(_0x46c1('0xd'));var crypto=require(_0x46c1('0xe'));var jsforce=require(_0x46c1('0xf'));var deskjs=require(_0x46c1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x46c1('0x11'));var Papa=require(_0x46c1('0x12'));var Redis=require(_0x46c1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x46c1('0x14'));var as=require(_0x46c1('0x15'));var hardwareService=require(_0x46c1('0x16'));var logger=require('../../config/logger')(_0x46c1('0x17'));var utils=require(_0x46c1('0x18'));var config=require(_0x46c1('0x19'));var licenseUtil=require(_0x46c1('0x1a'));var db=require('../../mysqldb')['db'];config[_0x46c1('0x1b')]=_[_0x46c1('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x46c1('0x1d'))(new Redis(config[_0x46c1('0x1b')]));require(_0x46c1('0x1e'))[_0x46c1('0x1f')](socket);function respondWithStatusCode(_0x12437d,_0x5c771e){_0x5c771e=_0x5c771e||0xcc;return function(_0x436fb6){if(_0x436fb6){return _0x12437d[_0x46c1('0x20')](_0x5c771e);}return _0x12437d[_0x46c1('0x21')](_0x5c771e)[_0x46c1('0x22')]();};}function respondWithResult(_0x3ce709,_0x4a075f){_0x4a075f=_0x4a075f||0xc8;return function(_0x5f1dc1){if(_0x5f1dc1){return _0x3ce709[_0x46c1('0x21')](_0x4a075f)[_0x46c1('0x23')](_0x5f1dc1);}};}function respondWithFilteredResult(_0xad4a1b,_0x33dcc7){return function(_0x466899){if(_0x466899){var _0xae104a=typeof _0x33dcc7[_0x46c1('0x24')]==='undefined'&&typeof _0x33dcc7[_0x46c1('0x25')]===_0x46c1('0x26');var _0x537a9d=_0x466899['count'];var _0x17ff1d=_0xae104a?0x0:_0x33dcc7['offset'];var _0x5b5290=_0xae104a?_0x466899[_0x46c1('0x27')]:_0x33dcc7[_0x46c1('0x24')]+_0x33dcc7[_0x46c1('0x25')];var _0x261c6d;if(_0x5b5290>=_0x537a9d){_0x5b5290=_0x537a9d;_0x261c6d=0xc8;}else{_0x261c6d=0xce;}_0xad4a1b[_0x46c1('0x21')](_0x261c6d);return _0xad4a1b[_0x46c1('0x28')](_0x46c1('0x29'),_0x17ff1d+'-'+_0x5b5290+'/'+_0x537a9d)[_0x46c1('0x23')](_0x466899);}return null;};}function patchUpdates(_0x3db7b1){return function(_0x2b50b8){try{jsonpatch[_0x46c1('0x2a')](_0x2b50b8,_0x3db7b1,!![]);}catch(_0x217c2c){return BPromise[_0x46c1('0x2b')](_0x217c2c);}return _0x2b50b8[_0x46c1('0x2c')]();};}function saveUpdates(_0x37fa8c,_0x1a1add){return function(_0x138843){if(_0x138843){return _0x138843[_0x46c1('0x2d')](_0x37fa8c)[_0x46c1('0x2e')](function(_0x361c66){return _0x361c66;});}return null;};}function removeEntity(_0x4209e6,_0x2924b8){return function(_0xaded78){if(_0xaded78){return _0xaded78['destroy']()['then'](function(){_0x4209e6[_0x46c1('0x21')](0xcc)[_0x46c1('0x22')]();});}};}function handleEntityNotFound(_0x54f5e3,_0x2b94aa){return function(_0xe710e8){if(!_0xe710e8){_0x54f5e3[_0x46c1('0x20')](0x194);}return _0xe710e8;};}function handleError(_0x1410fe,_0x2cffd1){_0x2cffd1=_0x2cffd1||0x1f4;return function(_0x3fdaea){logger['error'](_0x3fdaea[_0x46c1('0x2f')]);if(_0x3fdaea[_0x46c1('0x30')]){delete _0x3fdaea[_0x46c1('0x30')];}_0x1410fe[_0x46c1('0x21')](_0x2cffd1)[_0x46c1('0x31')](_0x3fdaea);};}exports[_0x46c1('0x32')]=function(_0x316f21,_0x55b4e6){var _0xb33e57={'raw':![],'where':{'id':_0x316f21[_0x46c1('0x33')]['id']}},_0x5448f4={};_0x5448f4[_0x46c1('0x34')]=_[_0x46c1('0x35')](db[_0x46c1('0x36')]['rawAttributes']);_0x5448f4['query']=_[_0x46c1('0x35')](_0x316f21[_0x46c1('0x37')]);_0x5448f4['filters']=_[_0x46c1('0x38')](_0x5448f4[_0x46c1('0x34')],_0x5448f4[_0x46c1('0x37')]);_0xb33e57[_0x46c1('0x39')]=_['intersection'](_0x5448f4[_0x46c1('0x34')],qs[_0x46c1('0x3a')](_0x316f21['query'][_0x46c1('0x3a')]));_0xb33e57['attributes']=_0xb33e57[_0x46c1('0x39')][_0x46c1('0x3b')]?_0xb33e57[_0x46c1('0x39')]:_0x5448f4[_0x46c1('0x34')];if(_0x316f21[_0x46c1('0x37')][_0x46c1('0x3c')]){_0xb33e57['include']=[{'all':!![]}];}_0xb33e57=_['merge']({},_0xb33e57,_0x316f21[_0x46c1('0x3d')]);return db['DashboardItem'][_0x46c1('0x3e')](_0xb33e57)['then'](handleEntityNotFound(_0x55b4e6,null))['then'](respondWithResult(_0x55b4e6,null))[_0x46c1('0x3f')](handleError(_0x55b4e6,null));};exports[_0x46c1('0x40')]=function(_0x2ebd3e,_0x52e43f){return db[_0x46c1('0x36')][_0x46c1('0x3e')]({'where':{'id':_0x2ebd3e[_0x46c1('0x33')]['id']}})['then'](handleEntityNotFound(_0x52e43f,null))[_0x46c1('0x2e')](removeEntity(_0x52e43f,null))[_0x46c1('0x3f')](handleError(_0x52e43f,null));};function widgetAttributes(_0x2dabf9){try{switch(_0x2dabf9[_0x46c1('0x41')]){case _0x46c1('0x42'):return[{'name':_0x46c1('0x43'),'value':_0x2dabf9[_0x46c1('0x43')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0x0]?_0x2dabf9['attrs'][0x0][_0x46c1('0x45')]:undefined)||_0x46c1('0x46')}];case _0x46c1('0x47'):return[{'name':_0x46c1('0x48'),'value':_0x2dabf9[_0x46c1('0x48')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9['attrs'][0x0]?_0x2dabf9[_0x46c1('0x44')][0x0]['value']:undefined)||''}];case _0x46c1('0x49'):return[{'name':_0x46c1('0x4a'),'value':_0x2dabf9[_0x46c1('0x4a')]||(_0x2dabf9['attrs']&&_0x2dabf9[_0x46c1('0x44')][0x0]?_0x2dabf9['attrs'][0x0][_0x46c1('0x45')]:undefined)||_0x46c1('0x4b')},{'name':'attrTimezone','value':_0x2dabf9['attrTimezone']||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9['attrs'][0x1]?_0x2dabf9[_0x46c1('0x44')][0x1][_0x46c1('0x45')]:undefined)||_0x46c1('0x4c')},{'name':'attrFontSize','value':_0x2dabf9[_0x46c1('0x4d')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9['attrs'][0x2]?_0x2dabf9[_0x46c1('0x44')][0x2][_0x46c1('0x45')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x2dabf9[_0x46c1('0x4e')]||(_0x2dabf9['attrs']&&_0x2dabf9[_0x46c1('0x44')][0x0]?_0x2dabf9[_0x46c1('0x44')][0x0][_0x46c1('0x45')]:undefined)||_0x46c1('0x4f')},{'name':'attrVoiceQueues','value':_0x2dabf9['attrVoiceQueues']||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0x1]?_0x2dabf9[_0x46c1('0x44')][0x1][_0x46c1('0x45')]:undefined)||[]},{'name':'attrFontSize','value':_0x2dabf9[_0x46c1('0x4d')]||(_0x2dabf9['attrs']&&_0x2dabf9['attrs'][0x2]?_0x2dabf9[_0x46c1('0x44')][0x2][_0x46c1('0x45')]:undefined)||0x14},{'name':'attrChannel','value':_0x2dabf9[_0x46c1('0x50')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0x3]?_0x2dabf9[_0x46c1('0x44')][0x3][_0x46c1('0x45')]:undefined)||_0x46c1('0x51')},{'name':'attrEmailAccounts','value':_0x2dabf9[_0x46c1('0x52')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0x4]?_0x2dabf9[_0x46c1('0x44')][0x4]['value']:undefined)||''},{'name':_0x46c1('0x53'),'value':_0x2dabf9[_0x46c1('0x53')]||(_0x2dabf9['attrs']&&_0x2dabf9[_0x46c1('0x44')][0x5]?_0x2dabf9[_0x46c1('0x44')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x2dabf9[_0x46c1('0x54')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0x6]?_0x2dabf9['attrs'][0x6][_0x46c1('0x45')]:undefined)||''},{'name':_0x46c1('0x55'),'value':_0x2dabf9[_0x46c1('0x55')]||(_0x2dabf9['attrs']&&_0x2dabf9[_0x46c1('0x44')][0x7]?_0x2dabf9[_0x46c1('0x44')][0x7][_0x46c1('0x45')]:undefined)||''},{'name':_0x46c1('0x56'),'value':_0x2dabf9[_0x46c1('0x56')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0x8]?_0x2dabf9[_0x46c1('0x44')][0x8][_0x46c1('0x45')]:undefined)||''},{'name':_0x46c1('0x57'),'value':_0x2dabf9[_0x46c1('0x57')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0x9]?_0x2dabf9[_0x46c1('0x44')][0x9][_0x46c1('0x45')]:undefined)||''}];case _0x46c1('0x58'):case _0x46c1('0x59'):return[{'name':'attrSerie1','value':_0x2dabf9[_0x46c1('0x5a')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0x0]?_0x2dabf9[_0x46c1('0x44')][0x0][_0x46c1('0x45')]:undefined)||_0x46c1('0x4f')},{'name':_0x46c1('0x5b'),'value':_0x2dabf9['attrSerie2']||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0x1]?_0x2dabf9[_0x46c1('0x44')][0x1][_0x46c1('0x45')]:undefined)||null},{'name':_0x46c1('0x5c'),'value':_0x2dabf9[_0x46c1('0x5c')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0x2]?_0x2dabf9['attrs'][0x2][_0x46c1('0x45')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x2dabf9[_0x46c1('0x5d')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0x3]?_0x2dabf9['attrs'][0x3][_0x46c1('0x45')]:undefined)||[]},{'name':_0x46c1('0x50'),'value':_0x2dabf9[_0x46c1('0x50')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0x4]?_0x2dabf9[_0x46c1('0x44')][0x4][_0x46c1('0x45')]:undefined)||_0x46c1('0x51')},{'name':_0x46c1('0x52'),'value':_0x2dabf9[_0x46c1('0x52')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9['attrs'][0x5]?_0x2dabf9[_0x46c1('0x44')][0x5][_0x46c1('0x45')]:undefined)||''},{'name':_0x46c1('0x53'),'value':_0x2dabf9[_0x46c1('0x53')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9['attrs'][0x6]?_0x2dabf9[_0x46c1('0x44')][0x6][_0x46c1('0x45')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x2dabf9[_0x46c1('0x54')]||(_0x2dabf9['attrs']&&_0x2dabf9[_0x46c1('0x44')][0x7]?_0x2dabf9[_0x46c1('0x44')][0x7][_0x46c1('0x45')]:undefined)||''},{'name':_0x46c1('0x55'),'value':_0x2dabf9[_0x46c1('0x55')]||(_0x2dabf9['attrs']&&_0x2dabf9[_0x46c1('0x44')][0x8]?_0x2dabf9[_0x46c1('0x44')][0x8][_0x46c1('0x45')]:undefined)||''},{'name':_0x46c1('0x56'),'value':_0x2dabf9['attrWhatsappAccounts']||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9['attrs'][0x9]?_0x2dabf9[_0x46c1('0x44')][0x9]['value']:undefined)||''},{'name':_0x46c1('0x57'),'value':_0x2dabf9['attrChatWebsites']||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0xa]?_0x2dabf9['attrs'][0xa][_0x46c1('0x45')]:undefined)||''}];case _0x46c1('0x5e'):return[{'name':_0x46c1('0x5f'),'type':_0x2dabf9[_0x46c1('0x60')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9['attrs'][0x0]?_0x2dabf9[_0x46c1('0x44')][0x0]['type']:undefined)||null,'value':_0x2dabf9[_0x46c1('0x5f')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9['attrs'][0x0]?_0x2dabf9['attrs'][0x0][_0x46c1('0x45')]:undefined)||null},{'name':'attrRefresh','value':_0x2dabf9[_0x46c1('0x61')]||(_0x2dabf9[_0x46c1('0x44')]&&_0x2dabf9[_0x46c1('0x44')][0x1]?_0x2dabf9[_0x46c1('0x44')][0x1][_0x46c1('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x2f9ae5){logger[_0x46c1('0x62')](_0x46c1('0x63'),JSON[_0x46c1('0x64')](_0x2f9ae5));return[];}}exports[_0x46c1('0x65')]=function(_0x150fd0,_0x5bd29c){if(_0x150fd0[_0x46c1('0x66')]){_0x150fd0[_0x46c1('0x66')][_0x46c1('0x44')]=widgetAttributes(_0x150fd0[_0x46c1('0x66')]);}return db[_0x46c1('0x36')][_0x46c1('0x65')](_0x150fd0['body'],{})[_0x46c1('0x2e')](respondWithResult(_0x5bd29c,0xc9))[_0x46c1('0x3f')](handleError(_0x5bd29c,null));};exports[_0x46c1('0x2d')]=function(_0x49cc94,_0x301f6c){if(_0x49cc94[_0x46c1('0x66')]['id']){delete _0x49cc94['body']['id'];}_0x49cc94[_0x46c1('0x66')][_0x46c1('0x44')]=widgetAttributes(_0x49cc94[_0x46c1('0x66')]);return db[_0x46c1('0x36')][_0x46c1('0x3e')]({'where':{'id':_0x49cc94[_0x46c1('0x33')]['id']}})[_0x46c1('0x2e')](handleEntityNotFound(_0x301f6c,null))[_0x46c1('0x2e')](saveUpdates(_0x49cc94['body'],null))['then'](respondWithResult(_0x301f6c,null))[_0x46c1('0x3f')](handleError(_0x301f6c,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 77db589..042911c 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 _0x5e6c=['hasOwnProperty','hook','../../mysqldb','DashboardItem','save','emit'];(function(_0x3af021,_0x53a68a){var _0x4d5b44=function(_0x2bd601){while(--_0x2bd601){_0x3af021['push'](_0x3af021['shift']());}};_0x4d5b44(++_0x53a68a);}(_0x5e6c,0x1dc));var _0xc5e6=function(_0x5bf0d6,_0x31ba9c){_0x5bf0d6=_0x5bf0d6-0x0;var _0x163f86=_0x5e6c[_0x5bf0d6];return _0x163f86;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xc5e6('0x0'))['db'][_0xc5e6('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc5e6('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5bb81d){return function(_0x3c392e,_0x107078,_0x59f827){DashboardItemEvents[_0xc5e6('0x3')](_0x5bb81d+':'+_0x3c392e['id'],_0x3c392e);DashboardItemEvents['emit'](_0x5bb81d,_0x3c392e);_0x59f827(null);};}for(var e in events){if(events[_0xc5e6('0x4')](e)){var event=events[e];DashboardItem[_0xc5e6('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xc932=['emit','hasOwnProperty','hook','exports','events','DashboardItem','setMaxListeners','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc932,0x74));var _0x2c93=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xc932[_0x5a3cf0];return _0x5a64ee;};'use strict';var EventEmitter=require(_0x2c93('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x2c93('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x2c93('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2c93('0x3')};function emitEvent(_0x2ff244){return function(_0x3ddb17,_0x4e213f,_0xa5a511){DashboardItemEvents[_0x2c93('0x4')](_0x2ff244+':'+_0x3ddb17['id'],_0x3ddb17);DashboardItemEvents[_0x2c93('0x4')](_0x2ff244,_0x3ddb17);_0xa5a511(null);};}for(var e in events){if(events[_0x2c93('0x5')](e)){var event=events[e];DashboardItem[_0x2c93('0x6')](e,emitEvent(event));}}module[_0x2c93('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 21c1a21..a787a26 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 _0x36a2=['api','moment','request-promise','path','rimraf','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','lodash','util','../../config/logger'];(function(_0x28d5e5,_0xa13c8e){var _0x288ab4=function(_0x795fac){while(--_0x795fac){_0x28d5e5['push'](_0x28d5e5['shift']());}};_0x288ab4(++_0xa13c8e);}(_0x36a2,0x105));var _0x236a=function(_0x48c4ef,_0x319d44){_0x48c4ef=_0x48c4ef-0x0;var _0x435715=_0x36a2[_0x48c4ef];return _0x435715;};'use strict';var _=require(_0x236a('0x0'));var util=require(_0x236a('0x1'));var logger=require(_0x236a('0x2'))(_0x236a('0x3'));var moment=require(_0x236a('0x4'));var BPromise=require('bluebird');var rp=require(_0x236a('0x5'));var fs=require('fs');var path=require(_0x236a('0x6'));var rimraf=require(_0x236a('0x7'));var config=require('../../config/environment');var attributes=require(_0x236a('0x8'));module[_0x236a('0x9')]=function(_0x35f388,_0xc19022){return _0x35f388['define'](_0x236a('0xa'),attributes,{'tableName':_0x236a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bd7=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash','../../config/logger','api','moment'];(function(_0x434de0,_0x582f98){var _0x42e9da=function(_0x58393b){while(--_0x58393b){_0x434de0['push'](_0x434de0['shift']());}};_0x42e9da(++_0x582f98);}(_0x2bd7,0x1d0));var _0x72bd=function(_0x21cd05,_0x129948){_0x21cd05=_0x21cd05-0x0;var _0x110115=_0x2bd7[_0x21cd05];return _0x110115;};'use strict';var _=require(_0x72bd('0x0'));var util=require('util');var logger=require(_0x72bd('0x1'))(_0x72bd('0x2'));var moment=require(_0x72bd('0x3'));var BPromise=require(_0x72bd('0x4'));var rp=require(_0x72bd('0x5'));var fs=require('fs');var path=require(_0x72bd('0x6'));var rimraf=require(_0x72bd('0x7'));var config=require(_0x72bd('0x8'));var attributes=require('./dashboardItem.attributes');module[_0x72bd('0x9')]=function(_0x318163,_0x3f4f07){return _0x318163[_0x72bd('0xa')](_0x72bd('0xb'),attributes,{'tableName':_0x72bd('0xc'),'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 320c97e..d28aae7 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 _0x1b6e=['../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x1b6e,0xfe));var _0xe1b6=function(_0x4f26f6,_0x4860aa){_0x4f26f6=_0x4f26f6-0x0;var _0x2cd10a=_0x1b6e[_0x4f26f6];return _0x2cd10a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe1b6('0x0'));var BPromise=require(_0xe1b6('0x1'));var rs=require(_0xe1b6('0x2'));var fs=require('fs');var Redis=require(_0xe1b6('0x3'));var db=require(_0xe1b6('0x4'))['db'];var utils=require(_0xe1b6('0x5'));var logger=require(_0xe1b6('0x6'))(_0xe1b6('0x7'));var config=require('../../config/environment');var jayson=require(_0xe1b6('0x8'));var client=jayson[_0xe1b6('0x9')]['http']({'port':0x232a});config[_0xe1b6('0xa')]=_[_0xe1b6('0xb')](config['redis'],{'host':_0xe1b6('0xc'),'port':0x18eb});var socket=require(_0xe1b6('0xd'))(new Redis(config[_0xe1b6('0xa')]));require(_0xe1b6('0xe'))[_0xe1b6('0xf')](socket);function respondWithRpcPromise(_0x383c9c,_0xa6209e,_0x109b96){return new BPromise(function(_0x3d7651,_0xf614ca){return client['request'](_0x383c9c,_0x109b96)['then'](function(_0x39f62e){logger[_0xe1b6('0x10')](_0xe1b6('0x11'),_0xa6209e,_0xe1b6('0x12'));logger['debug'](_0xe1b6('0x13'),_0xa6209e,_0xe1b6('0x12'),JSON[_0xe1b6('0x14')](_0x39f62e));if(_0x39f62e[_0xe1b6('0x15')]){if(_0x39f62e['error'][_0xe1b6('0x16')]===0x1f4){logger[_0xe1b6('0x15')]('DashboardItem,\x20%s,\x20%s',_0xa6209e,_0x39f62e[_0xe1b6('0x15')][_0xe1b6('0x17')]);return _0xf614ca(_0x39f62e[_0xe1b6('0x15')][_0xe1b6('0x17')]);}logger[_0xe1b6('0x15')]('DashboardItem,\x20%s,\x20%s',_0xa6209e,_0x39f62e[_0xe1b6('0x15')][_0xe1b6('0x17')]);return _0x3d7651(_0x39f62e['error'][_0xe1b6('0x17')]);}else{logger['info'](_0xe1b6('0x11'),_0xa6209e,'request\x20sent');_0x3d7651(_0x39f62e[_0xe1b6('0x18')][_0xe1b6('0x17')]);}})[_0xe1b6('0x19')](function(_0x5d9311){logger[_0xe1b6('0x15')]('DashboardItem,\x20%s,\x20%s',_0xa6209e,_0x5d9311);_0xf614ca(_0x5d9311);});});} \ No newline at end of file +var _0x1d8e=['defaults','redis','socket.io-emitter','./dashboardItem.socket','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d8e,0x11c));var _0xe1d8=function(_0x119d25,_0x588c8){_0x119d25=_0x119d25-0x0;var _0x39cf30=_0x1d8e[_0x119d25];return _0x39cf30;};'use strict';var _=require(_0xe1d8('0x0'));var util=require(_0xe1d8('0x1'));var moment=require(_0xe1d8('0x2'));var BPromise=require('bluebird');var rs=require(_0xe1d8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe1d8('0x4'));var logger=require(_0xe1d8('0x5'))(_0xe1d8('0x6'));var config=require(_0xe1d8('0x7'));var jayson=require(_0xe1d8('0x8'));var client=jayson['client'][_0xe1d8('0x9')]({'port':0x232a});config['redis']=_[_0xe1d8('0xa')](config[_0xe1d8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe1d8('0xc'))(new Redis(config[_0xe1d8('0xb')]));require(_0xe1d8('0xd'))['register'](socket);function respondWithRpcPromise(_0xf263a7,_0x1122cb,_0x378891){return new BPromise(function(_0x40f3a8,_0x39e50d){return client[_0xe1d8('0xe')](_0xf263a7,_0x378891)['then'](function(_0x139479){logger[_0xe1d8('0xf')](_0xe1d8('0x10'),_0x1122cb,_0xe1d8('0x11'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x1122cb,_0xe1d8('0x11'),JSON['stringify'](_0x139479));if(_0x139479['error']){if(_0x139479[_0xe1d8('0x12')][_0xe1d8('0x13')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x1122cb,_0x139479[_0xe1d8('0x12')]['message']);return _0x39e50d(_0x139479[_0xe1d8('0x12')][_0xe1d8('0x14')]);}logger[_0xe1d8('0x12')](_0xe1d8('0x10'),_0x1122cb,_0x139479[_0xe1d8('0x12')][_0xe1d8('0x14')]);return _0x40f3a8(_0x139479[_0xe1d8('0x12')][_0xe1d8('0x14')]);}else{logger['info'](_0xe1d8('0x10'),_0x1122cb,_0xe1d8('0x11'));_0x40f3a8(_0x139479['result'][_0xe1d8('0x14')]);}})['catch'](function(_0x4cf4a2){logger['error']('DashboardItem,\x20%s,\x20%s',_0x1122cb,_0x4cf4a2);_0x39e50d(_0x4cf4a2);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 9366d58..499f46c 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 _0xedb7=['emit','removeListener','register','length','./dashboardItem.events','save','remove','update'];(function(_0x272e18,_0x75e43c){var _0x572ca9=function(_0xf2b51a){while(--_0xf2b51a){_0x272e18['push'](_0x272e18['shift']());}};_0x572ca9(++_0x75e43c);}(_0xedb7,0xd4));var _0x7edb=function(_0x101308,_0x214c56){_0x101308=_0x101308-0x0;var _0x57b7c8=_0xedb7[_0x101308];return _0x57b7c8;};'use strict';var DashboardItemEvents=require(_0x7edb('0x0'));var events=[_0x7edb('0x1'),_0x7edb('0x2'),_0x7edb('0x3')];function createListener(_0x5d1522,_0x24b78d){return function(_0x403938){_0x24b78d[_0x7edb('0x4')](_0x5d1522,_0x403938);};}function removeListener(_0x4da957,_0x36d1cf){return function(){DashboardItemEvents[_0x7edb('0x5')](_0x4da957,_0x36d1cf);};}exports[_0x7edb('0x6')]=function(_0x1d8918){for(var _0xd508cd=0x0,_0x152a9f=events[_0x7edb('0x7')];_0xd508cd<_0x152a9f;_0xd508cd++){var _0x13e357=events[_0xd508cd];var _0x507098=createListener('dashboardItem:'+_0x13e357,_0x1d8918);DashboardItemEvents['on'](_0x13e357,_0x507098);}}; \ No newline at end of file +var _0x493a=['length','dashboardItem:','./dashboardItem.events','save','remove','update','removeListener','register'];(function(_0x2bdf4d,_0x471af9){var _0x1ab16b=function(_0x3bcb27){while(--_0x3bcb27){_0x2bdf4d['push'](_0x2bdf4d['shift']());}};_0x1ab16b(++_0x471af9);}(_0x493a,0x10a));var _0xa493=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x493a[_0x4b2436];return _0x4f5ab2;};'use strict';var DashboardItemEvents=require(_0xa493('0x0'));var events=[_0xa493('0x1'),_0xa493('0x2'),_0xa493('0x3')];function createListener(_0x1565fd,_0x277e51){return function(_0x56f458){_0x277e51['emit'](_0x1565fd,_0x56f458);};}function removeListener(_0x4900ba,_0xbf658b){return function(){DashboardItemEvents[_0xa493('0x4')](_0x4900ba,_0xbf658b);};}exports[_0xa493('0x5')]=function(_0x564196){for(var _0x5f176a=0x0,_0x2cad4b=events[_0xa493('0x6')];_0x5f176a<_0x2cad4b;_0x5f176a++){var _0x588cd5=events[_0x5f176a];var _0x1b67ec=createListener(_0xa493('0x7')+_0x588cd5,_0x564196);DashboardItemEvents['on'](_0x588cd5,_0x1b67ec);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 2457a68..ccd663d 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 _0xb8e5=['../../components/auth/service','./dashboardItem.controller','/:id','isAuthenticated','show','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1d579a,_0x1eca72){var _0x4d900c=function(_0x1b0a93){while(--_0x1b0a93){_0x1d579a['push'](_0x1d579a['shift']());}};_0x4d900c(++_0x1eca72);}(_0xb8e5,0xea));var _0x5b8e=function(_0x3bfb7c,_0x3dabf3){_0x3bfb7c=_0x3bfb7c-0x0;var _0x5efb75=_0xb8e5[_0x3bfb7c];return _0x5efb75;};'use strict';var multer=require('multer');var util=require(_0x5b8e('0x0'));var path=require(_0x5b8e('0x1'));var timeout=require(_0x5b8e('0x2'));var express=require(_0x5b8e('0x3'));var router=express[_0x5b8e('0x4')]();var fs_extra=require(_0x5b8e('0x5'));var auth=require(_0x5b8e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5b8e('0x7'));router['get'](_0x5b8e('0x8'),auth[_0x5b8e('0x9')](),controller[_0x5b8e('0xa')]);router['post']('/',auth[_0x5b8e('0x9')](),controller[_0x5b8e('0xb')]);router[_0x5b8e('0xc')]('/:id',auth[_0x5b8e('0x9')](),controller[_0x5b8e('0xd')]);router[_0x5b8e('0xe')]('/:id',auth[_0x5b8e('0x9')](),controller[_0x5b8e('0xf')]);module['exports']=router; \ No newline at end of file +var _0x6a48=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','create','update','delete','isAuthenticated','destroy','exports'];(function(_0x31e245,_0x3be1e3){var _0x59e24d=function(_0x176fed){while(--_0x176fed){_0x31e245['push'](_0x31e245['shift']());}};_0x59e24d(++_0x3be1e3);}(_0x6a48,0x10a));var _0x86a4=function(_0x43d442,_0x1f1c54){_0x43d442=_0x43d442-0x0;var _0x4febed=_0x6a48[_0x43d442];return _0x4febed;};'use strict';var multer=require(_0x86a4('0x0'));var util=require('util');var path=require(_0x86a4('0x1'));var timeout=require(_0x86a4('0x2'));var express=require(_0x86a4('0x3'));var router=express[_0x86a4('0x4')]();var fs_extra=require(_0x86a4('0x5'));var auth=require(_0x86a4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x86a4('0x7'));var controller=require(_0x86a4('0x8'));router[_0x86a4('0x9')](_0x86a4('0xa'),auth['isAuthenticated'](),controller[_0x86a4('0xb')]);router[_0x86a4('0xc')]('/',auth['isAuthenticated'](),controller[_0x86a4('0xd')]);router['put'](_0x86a4('0xa'),auth['isAuthenticated'](),controller[_0x86a4('0xe')]);router[_0x86a4('0xf')]('/:id',auth[_0x86a4('0x10')](),controller[_0x86a4('0x11')]);module[_0x86a4('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index d433e41..5af7d77 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 _0x76ca=['second','third','sequelize','exports','STRING','ENUM','first'];(function(_0x44bd5d,_0x3e9389){var _0x12a8a4=function(_0xb4eb20){while(--_0xb4eb20){_0x44bd5d['push'](_0x44bd5d['shift']());}};_0x12a8a4(++_0x3e9389);}(_0x76ca,0x1f3));var _0xa76c=function(_0x3afdaf,_0x1e2e98){_0x3afdaf=_0x3afdaf-0x0;var _0x10374f=_0x76ca[_0x3afdaf];return _0x10374f;};'use strict';var Sequelize=require(_0xa76c('0x0'));module[_0xa76c('0x1')]={'name':{'type':Sequelize[_0xa76c('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x4'),_0xa76c('0x5'),_0xa76c('0x6')),'allowNull':![],'defaultValue':_0xa76c('0x4')},'description':{'type':Sequelize[_0xa76c('0x2')]}}; \ No newline at end of file +var _0x6f9d=['first','second','third','STRING'];(function(_0x4d7707,_0x9784ca){var _0x5d3421=function(_0x57dd26){while(--_0x57dd26){_0x4d7707['push'](_0x4d7707['shift']());}};_0x5d3421(++_0x9784ca);}(_0x6f9d,0xfb));var _0xd6f9=function(_0xc940bf,_0x4a378f){_0xc940bf=_0xc940bf-0x0;var _0x36e7f2=_0x6f9d[_0xc940bf];return _0x36e7f2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd6f9('0x0')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xd6f9('0x1'),_0xd6f9('0x2'),_0xd6f9('0x3')),'allowNull':![],'defaultValue':_0xd6f9('0x1')},'description':{'type':Sequelize[_0xd6f9('0x0')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 2fc99c5..0d5738d 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 _0xff00=['keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','rawAttributes','find','catch','create','body','user','role','get','UserProfileSection','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','set','reject','save','update','then','destroy','Dispositions','UserProfileResource','end','error','name','send','index','map','Disposition','type','key','query'];(function(_0x2e3eea,_0x44102f){var _0xc7942c=function(_0x379d63){while(--_0x379d63){_0x2e3eea['push'](_0x2e3eea['shift']());}};_0xc7942c(++_0x44102f);}(_0xff00,0x1a6));var _0x0ff0=function(_0x59a760,_0x545a0d){_0x59a760=_0x59a760-0x0;var _0x4a0a38=_0xff00[_0x59a760];return _0x4a0a38;};'use strict';var emlformat=require(_0x0ff0('0x0'));var rimraf=require(_0x0ff0('0x1'));var zipdir=require(_0x0ff0('0x2'));var jsonpatch=require(_0x0ff0('0x3'));var rp=require('request-promise');var moment=require(_0x0ff0('0x4'));var BPromise=require(_0x0ff0('0x5'));var Mustache=require('mustache');var util=require(_0x0ff0('0x6'));var path=require(_0x0ff0('0x7'));var sox=require(_0x0ff0('0x8'));var csv=require(_0x0ff0('0x9'));var ejs=require(_0x0ff0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ff0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0ff0('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ff0('0xd'));var Redis=require('ioredis');var authService=require(_0x0ff0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0ff0('0xf'));var hardwareService=require(_0x0ff0('0x10'));var logger=require(_0x0ff0('0x11'))(_0x0ff0('0x12'));var utils=require('../../config/utils');var config=require(_0x0ff0('0x13'));var licenseUtil=require(_0x0ff0('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2581b7,_0xaf8e0a){_0xaf8e0a=_0xaf8e0a||0xcc;return function(_0x20a119){if(_0x20a119){return _0x2581b7[_0x0ff0('0x15')](_0xaf8e0a);}return _0x2581b7['status'](_0xaf8e0a)['end']();};}function respondWithResult(_0x5d1498,_0x173c54){_0x173c54=_0x173c54||0xc8;return function(_0x1e3d57){if(_0x1e3d57){return _0x5d1498['status'](_0x173c54)[_0x0ff0('0x16')](_0x1e3d57);}};}function respondWithFilteredResult(_0x482610,_0x4154dc){return function(_0x10d422){if(_0x10d422){var _0x43bd62=typeof _0x4154dc[_0x0ff0('0x17')]===_0x0ff0('0x18')&&typeof _0x4154dc[_0x0ff0('0x19')]===_0x0ff0('0x18');var _0x55ad62=_0x10d422[_0x0ff0('0x1a')];var _0x433a08=_0x43bd62?0x0:_0x4154dc[_0x0ff0('0x17')];var _0x1e5eef=_0x43bd62?_0x10d422[_0x0ff0('0x1a')]:_0x4154dc[_0x0ff0('0x17')]+_0x4154dc['limit'];var _0x42d0a6;if(_0x1e5eef>=_0x55ad62){_0x1e5eef=_0x55ad62;_0x42d0a6=0xc8;}else{_0x42d0a6=0xce;}_0x482610[_0x0ff0('0x1b')](_0x42d0a6);return _0x482610[_0x0ff0('0x1c')]('Content-Range',_0x433a08+'-'+_0x1e5eef+'/'+_0x55ad62)[_0x0ff0('0x16')](_0x10d422);}return null;};}function patchUpdates(_0x3fed17){return function(_0x220a92){try{jsonpatch['apply'](_0x220a92,_0x3fed17,!![]);}catch(_0x3c9a0c){return BPromise[_0x0ff0('0x1d')](_0x3c9a0c);}return _0x220a92[_0x0ff0('0x1e')]();};}function saveUpdates(_0xe81b94,_0x274849){return function(_0x5b3f8d){if(_0x5b3f8d){return _0x5b3f8d[_0x0ff0('0x1f')](_0xe81b94)[_0x0ff0('0x20')](function(_0x327682){return _0x327682;});}return null;};}function removeEntity(_0x283e3c,_0x3bcf4b){return function(_0x1de31e){if(_0x1de31e){return _0x1de31e[_0x0ff0('0x21')]()[_0x0ff0('0x20')](function(){var _0x985831=_0x1de31e['get']({'plain':!![]});var _0x1a9d06=_0x0ff0('0x22');return db[_0x0ff0('0x23')]['destroy']({'where':{'type':_0x1a9d06,'resourceId':_0x985831['id']}})[_0x0ff0('0x20')](function(){return _0x1de31e;});})['then'](function(){_0x283e3c[_0x0ff0('0x1b')](0xcc)[_0x0ff0('0x24')]();});}};}function handleEntityNotFound(_0x42e4ee,_0x514655){return function(_0x104977){if(!_0x104977){_0x42e4ee['sendStatus'](0x194);}return _0x104977;};}function handleError(_0x5c3ae6,_0xf352d3){_0xf352d3=_0xf352d3||0x1f4;return function(_0x28c66b){logger[_0x0ff0('0x25')](_0x28c66b['stack']);if(_0x28c66b['name']){delete _0x28c66b[_0x0ff0('0x26')];}_0x5c3ae6['status'](_0xf352d3)[_0x0ff0('0x27')](_0x28c66b);};}exports[_0x0ff0('0x28')]=function(_0x5736a4,_0x4c300f){var _0x5116ba={},_0x299617={},_0xec1ce2={'count':0x0,'rows':[]};var _0x55c005=_[_0x0ff0('0x29')](db[_0x0ff0('0x2a')]['rawAttributes'],function(_0x9ed018){return{'name':_0x9ed018['fieldName'],'type':_0x9ed018[_0x0ff0('0x2b')][_0x0ff0('0x2c')]};});_0x299617['model']=_[_0x0ff0('0x29')](_0x55c005,_0x0ff0('0x26'));_0x299617[_0x0ff0('0x2d')]=_[_0x0ff0('0x2e')](_0x5736a4['query']);_0x299617[_0x0ff0('0x2f')]=_[_0x0ff0('0x30')](_0x299617[_0x0ff0('0x31')],_0x299617['query']);_0x5116ba['attributes']=_['intersection'](_0x299617[_0x0ff0('0x31')],qs['fields'](_0x5736a4[_0x0ff0('0x2d')][_0x0ff0('0x32')]));_0x5116ba[_0x0ff0('0x33')]=_0x5116ba[_0x0ff0('0x33')][_0x0ff0('0x34')]?_0x5116ba['attributes']:_0x299617[_0x0ff0('0x31')];if(!_0x5736a4[_0x0ff0('0x2d')]['hasOwnProperty'](_0x0ff0('0x35'))){_0x5116ba['limit']=qs[_0x0ff0('0x19')](_0x5736a4[_0x0ff0('0x2d')]['limit']);_0x5116ba[_0x0ff0('0x17')]=qs[_0x0ff0('0x17')](_0x5736a4['query'][_0x0ff0('0x17')]);}_0x5116ba[_0x0ff0('0x36')]=qs[_0x0ff0('0x37')](_0x5736a4['query'][_0x0ff0('0x37')]);_0x5116ba[_0x0ff0('0x38')]=qs[_0x0ff0('0x2f')](_[_0x0ff0('0x39')](_0x5736a4['query'],_0x299617[_0x0ff0('0x2f')]),_0x55c005);if(_0x5736a4[_0x0ff0('0x2d')][_0x0ff0('0x3a')]){_0x5116ba[_0x0ff0('0x38')]=_[_0x0ff0('0x3b')](_0x5116ba['where'],{'$or':_[_0x0ff0('0x29')](_0x55c005,function(_0x24a1a8){if(_0x24a1a8[_0x0ff0('0x2b')]!==_0x0ff0('0x3c')){var _0x339d68={};_0x339d68[_0x24a1a8[_0x0ff0('0x26')]]={'$like':'%'+_0x5736a4[_0x0ff0('0x2d')][_0x0ff0('0x3a')]+'%'};return _0x339d68;}})});}_0x5116ba=_['merge']({},_0x5116ba,_0x5736a4[_0x0ff0('0x3d')]);var _0x16b52a={'where':_0x5116ba['where']};return db['Disposition'][_0x0ff0('0x1a')](_0x16b52a)[_0x0ff0('0x20')](function(_0x24bd09){_0xec1ce2['count']=_0x24bd09;if(_0x5736a4[_0x0ff0('0x2d')][_0x0ff0('0x3e')]){_0x5116ba['include']=[{'all':!![]}];}return db[_0x0ff0('0x2a')][_0x0ff0('0x3f')](_0x5116ba);})[_0x0ff0('0x20')](function(_0x1efeee){_0xec1ce2[_0x0ff0('0x40')]=_0x1efeee;return _0xec1ce2;})[_0x0ff0('0x20')](respondWithFilteredResult(_0x4c300f,_0x5116ba))['catch'](handleError(_0x4c300f,null));};exports[_0x0ff0('0x41')]=function(_0x571935,_0x787d36){var _0x1e0c1e={'raw':!![],'where':{'id':_0x571935['params']['id']}},_0x2cd42a={};_0x2cd42a[_0x0ff0('0x31')]=_[_0x0ff0('0x2e')](db[_0x0ff0('0x2a')][_0x0ff0('0x42')]);_0x2cd42a['query']=_['keys'](_0x571935[_0x0ff0('0x2d')]);_0x2cd42a[_0x0ff0('0x2f')]=_[_0x0ff0('0x30')](_0x2cd42a[_0x0ff0('0x31')],_0x2cd42a[_0x0ff0('0x2d')]);_0x1e0c1e['attributes']=_[_0x0ff0('0x30')](_0x2cd42a['model'],qs[_0x0ff0('0x32')](_0x571935[_0x0ff0('0x2d')]['fields']));_0x1e0c1e[_0x0ff0('0x33')]=_0x1e0c1e['attributes'][_0x0ff0('0x34')]?_0x1e0c1e[_0x0ff0('0x33')]:_0x2cd42a[_0x0ff0('0x31')];if(_0x571935[_0x0ff0('0x2d')][_0x0ff0('0x3e')]){_0x1e0c1e['include']=[{'all':!![]}];}_0x1e0c1e=_[_0x0ff0('0x3b')]({},_0x1e0c1e,_0x571935[_0x0ff0('0x3d')]);return db['Disposition'][_0x0ff0('0x43')](_0x1e0c1e)[_0x0ff0('0x20')](handleEntityNotFound(_0x787d36,null))[_0x0ff0('0x20')](respondWithResult(_0x787d36,null))[_0x0ff0('0x44')](handleError(_0x787d36,null));};exports[_0x0ff0('0x45')]=function(_0x19df39,_0x3b1672){return db[_0x0ff0('0x2a')][_0x0ff0('0x45')](_0x19df39[_0x0ff0('0x46')],{})[_0x0ff0('0x20')](function(_0x166494){var _0x4e9591=_0x19df39[_0x0ff0('0x47')]['get']({'plain':!![]});if(!_0x4e9591)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e9591[_0x0ff0('0x48')]===_0x0ff0('0x47')){var _0x305309=_0x166494[_0x0ff0('0x49')]({'plain':!![]});var _0x1292a1='Dispositions';return db[_0x0ff0('0x4a')][_0x0ff0('0x43')]({'where':{'name':_0x1292a1,'userProfileId':_0x4e9591[_0x0ff0('0x4b')]},'raw':!![]})[_0x0ff0('0x20')](function(_0x2a9807){if(_0x2a9807&&_0x2a9807[_0x0ff0('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x305309[_0x0ff0('0x26')],'resourceId':_0x305309['id'],'type':_0x2a9807[_0x0ff0('0x26')],'sectionId':_0x2a9807['id']},{})['then'](function(){return _0x166494;});}else{return _0x166494;}})[_0x0ff0('0x44')](function(_0x3e96bc){logger[_0x0ff0('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e96bc);throw _0x3e96bc;});}return _0x166494;})['then'](respondWithResult(_0x3b1672,0xc9))[_0x0ff0('0x44')](handleError(_0x3b1672,null));};exports['update']=function(_0x2d65d1,_0x1cc2d3){if(_0x2d65d1[_0x0ff0('0x46')]['id']){delete _0x2d65d1[_0x0ff0('0x46')]['id'];}return db[_0x0ff0('0x2a')][_0x0ff0('0x43')]({'where':{'id':_0x2d65d1['params']['id']}})['then'](handleEntityNotFound(_0x1cc2d3,null))[_0x0ff0('0x20')](saveUpdates(_0x2d65d1[_0x0ff0('0x46')],null))[_0x0ff0('0x20')](respondWithResult(_0x1cc2d3,null))[_0x0ff0('0x44')](handleError(_0x1cc2d3,null));};exports[_0x0ff0('0x21')]=function(_0x2e2a5d,_0x17b53a){return db[_0x0ff0('0x2a')]['find']({'where':{'id':_0x2e2a5d[_0x0ff0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x17b53a,null))[_0x0ff0('0x20')](removeEntity(_0x17b53a,null))[_0x0ff0('0x44')](handleError(_0x17b53a,null));}; \ No newline at end of file +var _0x377e=['then','destroy','get','Dispositions','sendStatus','stack','name','send','index','map','Disposition','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update'];(function(_0x24cc60,_0x1561b3){var _0x5a5be8=function(_0x66fbc1){while(--_0x66fbc1){_0x24cc60['push'](_0x24cc60['shift']());}};_0x5a5be8(++_0x1561b3);}(_0x377e,0x1d9));var _0xe377=function(_0xf47a36,_0x4b834f){_0xf47a36=_0xf47a36-0x0;var _0x31ba2b=_0x377e[_0xf47a36];return _0x31ba2b;};'use strict';var emlformat=require(_0xe377('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe377('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe377('0x2'));var moment=require(_0xe377('0x3'));var BPromise=require(_0xe377('0x4'));var Mustache=require(_0xe377('0x5'));var util=require('util');var path=require(_0xe377('0x6'));var sox=require(_0xe377('0x7'));var csv=require('to-csv');var ejs=require(_0xe377('0x8'));var fs=require('fs');var fs_extra=require(_0xe377('0x9'));var _=require(_0xe377('0xa'));var squel=require(_0xe377('0xb'));var crypto=require('crypto');var jsforce=require(_0xe377('0xc'));var deskjs=require(_0xe377('0xd'));var toCsv=require(_0xe377('0xe'));var querystring=require('querystring');var Papa=require(_0xe377('0xf'));var Redis=require(_0xe377('0x10'));var authService=require(_0xe377('0x11'));var qs=require(_0xe377('0x12'));var as=require(_0xe377('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe377('0x14'))('api');var utils=require(_0xe377('0x15'));var config=require(_0xe377('0x16'));var licenseUtil=require(_0xe377('0x17'));var db=require(_0xe377('0x18'))['db'];function respondWithStatusCode(_0x559b27,_0xafdb98){_0xafdb98=_0xafdb98||0xcc;return function(_0xcb4349){if(_0xcb4349){return _0x559b27['sendStatus'](_0xafdb98);}return _0x559b27['status'](_0xafdb98)[_0xe377('0x19')]();};}function respondWithResult(_0x1f4a95,_0xfd6f8c){_0xfd6f8c=_0xfd6f8c||0xc8;return function(_0xd75e80){if(_0xd75e80){return _0x1f4a95[_0xe377('0x1a')](_0xfd6f8c)[_0xe377('0x1b')](_0xd75e80);}};}function respondWithFilteredResult(_0x16d1f3,_0x4a4265){return function(_0xb14cc1){if(_0xb14cc1){var _0x496405=typeof _0x4a4265[_0xe377('0x1c')]===_0xe377('0x1d')&&typeof _0x4a4265[_0xe377('0x1e')]===_0xe377('0x1d');var _0x35de93=_0xb14cc1[_0xe377('0x1f')];var _0x50167f=_0x496405?0x0:_0x4a4265['offset'];var _0x5e3dc9=_0x496405?_0xb14cc1[_0xe377('0x1f')]:_0x4a4265['offset']+_0x4a4265['limit'];var _0xba35fc;if(_0x5e3dc9>=_0x35de93){_0x5e3dc9=_0x35de93;_0xba35fc=0xc8;}else{_0xba35fc=0xce;}_0x16d1f3['status'](_0xba35fc);return _0x16d1f3[_0xe377('0x20')](_0xe377('0x21'),_0x50167f+'-'+_0x5e3dc9+'/'+_0x35de93)[_0xe377('0x1b')](_0xb14cc1);}return null;};}function patchUpdates(_0x7fea6c){return function(_0x2ba4bc){try{jsonpatch[_0xe377('0x22')](_0x2ba4bc,_0x7fea6c,!![]);}catch(_0x107b5d){return BPromise[_0xe377('0x23')](_0x107b5d);}return _0x2ba4bc['save']();};}function saveUpdates(_0x4280a9,_0x180029){return function(_0x508387){if(_0x508387){return _0x508387[_0xe377('0x24')](_0x4280a9)[_0xe377('0x25')](function(_0x1775cb){return _0x1775cb;});}return null;};}function removeEntity(_0xeefd86,_0x49a2ca){return function(_0x3fea16){if(_0x3fea16){return _0x3fea16[_0xe377('0x26')]()['then'](function(){var _0x34559d=_0x3fea16[_0xe377('0x27')]({'plain':!![]});var _0x1df952=_0xe377('0x28');return db['UserProfileResource'][_0xe377('0x26')]({'where':{'type':_0x1df952,'resourceId':_0x34559d['id']}})[_0xe377('0x25')](function(){return _0x3fea16;});})[_0xe377('0x25')](function(){_0xeefd86[_0xe377('0x1a')](0xcc)[_0xe377('0x19')]();});}};}function handleEntityNotFound(_0x534ffb,_0x1b2edc){return function(_0x472b67){if(!_0x472b67){_0x534ffb[_0xe377('0x29')](0x194);}return _0x472b67;};}function handleError(_0x2840a8,_0x43cee5){_0x43cee5=_0x43cee5||0x1f4;return function(_0x8f4082){logger['error'](_0x8f4082[_0xe377('0x2a')]);if(_0x8f4082[_0xe377('0x2b')]){delete _0x8f4082[_0xe377('0x2b')];}_0x2840a8[_0xe377('0x1a')](_0x43cee5)[_0xe377('0x2c')](_0x8f4082);};}exports[_0xe377('0x2d')]=function(_0x27c934,_0x5a571b){var _0x39dc0b={},_0x395c6d={},_0x3da971={'count':0x0,'rows':[]};var _0x1335dc=_[_0xe377('0x2e')](db[_0xe377('0x2f')]['rawAttributes'],function(_0x132651){return{'name':_0x132651[_0xe377('0x30')],'type':_0x132651[_0xe377('0x31')][_0xe377('0x32')]};});_0x395c6d[_0xe377('0x33')]=_[_0xe377('0x2e')](_0x1335dc,'name');_0x395c6d[_0xe377('0x34')]=_[_0xe377('0x35')](_0x27c934[_0xe377('0x34')]);_0x395c6d[_0xe377('0x36')]=_[_0xe377('0x37')](_0x395c6d[_0xe377('0x33')],_0x395c6d[_0xe377('0x34')]);_0x39dc0b['attributes']=_[_0xe377('0x37')](_0x395c6d['model'],qs[_0xe377('0x38')](_0x27c934['query'][_0xe377('0x38')]));_0x39dc0b['attributes']=_0x39dc0b[_0xe377('0x39')][_0xe377('0x3a')]?_0x39dc0b['attributes']:_0x395c6d[_0xe377('0x33')];if(!_0x27c934['query'][_0xe377('0x3b')]('nolimit')){_0x39dc0b['limit']=qs[_0xe377('0x1e')](_0x27c934[_0xe377('0x34')]['limit']);_0x39dc0b['offset']=qs[_0xe377('0x1c')](_0x27c934[_0xe377('0x34')][_0xe377('0x1c')]);}_0x39dc0b['order']=qs[_0xe377('0x3c')](_0x27c934['query'][_0xe377('0x3c')]);_0x39dc0b[_0xe377('0x3d')]=qs[_0xe377('0x36')](_[_0xe377('0x3e')](_0x27c934['query'],_0x395c6d[_0xe377('0x36')]),_0x1335dc);if(_0x27c934[_0xe377('0x34')][_0xe377('0x3f')]){_0x39dc0b[_0xe377('0x3d')]=_[_0xe377('0x40')](_0x39dc0b['where'],{'$or':_[_0xe377('0x2e')](_0x1335dc,function(_0x53673f){if(_0x53673f[_0xe377('0x31')]!==_0xe377('0x41')){var _0x28d859={};_0x28d859[_0x53673f[_0xe377('0x2b')]]={'$like':'%'+_0x27c934[_0xe377('0x34')][_0xe377('0x3f')]+'%'};return _0x28d859;}})});}_0x39dc0b=_['merge']({},_0x39dc0b,_0x27c934[_0xe377('0x42')]);var _0x4ff841={'where':_0x39dc0b[_0xe377('0x3d')]};return db[_0xe377('0x2f')][_0xe377('0x1f')](_0x4ff841)[_0xe377('0x25')](function(_0x5dd93c){_0x3da971['count']=_0x5dd93c;if(_0x27c934['query'][_0xe377('0x43')]){_0x39dc0b['include']=[{'all':!![]}];}return db[_0xe377('0x2f')][_0xe377('0x44')](_0x39dc0b);})['then'](function(_0x486bc9){_0x3da971[_0xe377('0x45')]=_0x486bc9;return _0x3da971;})[_0xe377('0x25')](respondWithFilteredResult(_0x5a571b,_0x39dc0b))[_0xe377('0x46')](handleError(_0x5a571b,null));};exports[_0xe377('0x47')]=function(_0x1e03ad,_0x2e6d4c){var _0x3d5ab0={'raw':!![],'where':{'id':_0x1e03ad['params']['id']}},_0x571499={};_0x571499[_0xe377('0x33')]=_[_0xe377('0x35')](db[_0xe377('0x2f')][_0xe377('0x48')]);_0x571499[_0xe377('0x34')]=_[_0xe377('0x35')](_0x1e03ad[_0xe377('0x34')]);_0x571499['filters']=_['intersection'](_0x571499[_0xe377('0x33')],_0x571499['query']);_0x3d5ab0[_0xe377('0x39')]=_[_0xe377('0x37')](_0x571499['model'],qs['fields'](_0x1e03ad[_0xe377('0x34')]['fields']));_0x3d5ab0[_0xe377('0x39')]=_0x3d5ab0[_0xe377('0x39')][_0xe377('0x3a')]?_0x3d5ab0[_0xe377('0x39')]:_0x571499['model'];if(_0x1e03ad[_0xe377('0x34')][_0xe377('0x43')]){_0x3d5ab0[_0xe377('0x49')]=[{'all':!![]}];}_0x3d5ab0=_[_0xe377('0x40')]({},_0x3d5ab0,_0x1e03ad[_0xe377('0x42')]);return db[_0xe377('0x2f')][_0xe377('0x4a')](_0x3d5ab0)[_0xe377('0x25')](handleEntityNotFound(_0x2e6d4c,null))[_0xe377('0x25')](respondWithResult(_0x2e6d4c,null))[_0xe377('0x46')](handleError(_0x2e6d4c,null));};exports[_0xe377('0x4b')]=function(_0x4d030b,_0x1e885a){return db[_0xe377('0x2f')][_0xe377('0x4b')](_0x4d030b[_0xe377('0x4c')],{})[_0xe377('0x25')](function(_0x41301d){var _0x3f3626=_0x4d030b[_0xe377('0x4d')][_0xe377('0x27')]({'plain':!![]});if(!_0x3f3626)throw new Error(_0xe377('0x4e'));if(_0x3f3626['role']===_0xe377('0x4d')){var _0x325c05=_0x41301d['get']({'plain':!![]});var _0x3e7399=_0xe377('0x28');return db[_0xe377('0x4f')][_0xe377('0x4a')]({'where':{'name':_0x3e7399,'userProfileId':_0x3f3626[_0xe377('0x50')]},'raw':!![]})[_0xe377('0x25')](function(_0x43731a){if(_0x43731a&&_0x43731a['autoAssociation']===0x0){return db[_0xe377('0x51')]['create']({'name':_0x325c05[_0xe377('0x2b')],'resourceId':_0x325c05['id'],'type':_0x43731a[_0xe377('0x2b')],'sectionId':_0x43731a['id']},{})['then'](function(){return _0x41301d;});}else{return _0x41301d;}})['catch'](function(_0x50c268){logger[_0xe377('0x52')](_0xe377('0x53'),_0x50c268);throw _0x50c268;});}return _0x41301d;})[_0xe377('0x25')](respondWithResult(_0x1e885a,0xc9))[_0xe377('0x46')](handleError(_0x1e885a,null));};exports[_0xe377('0x24')]=function(_0x303be6,_0x3a1b1f){if(_0x303be6[_0xe377('0x4c')]['id']){delete _0x303be6['body']['id'];}return db['Disposition']['find']({'where':{'id':_0x303be6['params']['id']}})[_0xe377('0x25')](handleEntityNotFound(_0x3a1b1f,null))[_0xe377('0x25')](saveUpdates(_0x303be6[_0xe377('0x4c')],null))['then'](respondWithResult(_0x3a1b1f,null))['catch'](handleError(_0x3a1b1f,null));};exports[_0xe377('0x26')]=function(_0x588a33,_0xf547e3){return db[_0xe377('0x2f')][_0xe377('0x4a')]({'where':{'id':_0x588a33[_0xe377('0x54')]['id']}})[_0xe377('0x25')](handleEntityNotFound(_0xf547e3,null))['then'](removeEntity(_0xf547e3,null))['catch'](handleError(_0xf547e3,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index cd71c8d..49b7a3d 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 _0xb284=['name_voice','ListId','name','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_whatsapp','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions'];(function(_0x2abe6c,_0xf74f56){var _0x4a7db1=function(_0x3ff6b4){while(--_0x3ff6b4){_0x2abe6c['push'](_0x2abe6c['shift']());}};_0x4a7db1(++_0xf74f56);}(_0xb284,0x1ee));var _0x4b28=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb284[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4b28('0x0'));var util=require(_0x4b28('0x1'));var logger=require('../../config/logger')(_0x4b28('0x2'));var moment=require(_0x4b28('0x3'));var BPromise=require(_0x4b28('0x4'));var rp=require(_0x4b28('0x5'));var fs=require('fs');var path=require(_0x4b28('0x6'));var rimraf=require('rimraf');var config=require(_0x4b28('0x7'));var attributes=require(_0x4b28('0x8'));module[_0x4b28('0x9')]=function(_0x1b0f86,_0x20fa0a){return _0x1b0f86['define'](_0x4b28('0xa'),attributes,{'tableName':_0x4b28('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x4b28('0xc'),'fields':['name',_0x4b28('0xd')]},{'unique':!![],'name':'name_chat','fields':[_0x4b28('0xe'),_0x4b28('0xf')]},{'unique':!![],'name':_0x4b28('0x10'),'fields':[_0x4b28('0xe'),_0x4b28('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0x4b28('0xe'),_0x4b28('0x12')]},{'unique':!![],'name':_0x4b28('0x13'),'fields':[_0x4b28('0xe'),_0x4b28('0x14')]},{'unique':!![],'name':'name_openchannel','fields':[_0x4b28('0xe'),'OpenchannelAccountId']},{'unique':!![],'name':_0x4b28('0x15'),'fields':[_0x4b28('0xe'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x32d6=['lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name','name_chat','name_mail','MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId'];(function(_0x1390bb,_0x555328){var _0x1bc00a=function(_0x455a15){while(--_0x455a15){_0x1390bb['push'](_0x1390bb['shift']());}};_0x1bc00a(++_0x555328);}(_0x32d6,0x11e));var _0x632d=function(_0x2c562e,_0x827aa9){_0x2c562e=_0x2c562e-0x0;var _0x42b4bf=_0x32d6[_0x2c562e];return _0x42b4bf;};'use strict';var _=require(_0x632d('0x0'));var util=require('util');var logger=require(_0x632d('0x1'))('api');var moment=require(_0x632d('0x2'));var BPromise=require(_0x632d('0x3'));var rp=require(_0x632d('0x4'));var fs=require('fs');var path=require(_0x632d('0x5'));var rimraf=require('rimraf');var config=require(_0x632d('0x6'));var attributes=require(_0x632d('0x7'));module[_0x632d('0x8')]=function(_0x151b7b,_0x3cf76a){return _0x151b7b[_0x632d('0x9')](_0x632d('0xa'),attributes,{'tableName':_0x632d('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x632d('0xc'),'ListId']},{'unique':!![],'name':_0x632d('0xd'),'fields':[_0x632d('0xc'),'ChatWebsiteId']},{'unique':!![],'name':_0x632d('0xe'),'fields':['name',_0x632d('0xf')]},{'unique':!![],'name':'name_sms','fields':[_0x632d('0xc'),_0x632d('0x10')]},{'unique':!![],'name':_0x632d('0x11'),'fields':[_0x632d('0xc'),_0x632d('0x12')]},{'unique':!![],'name':_0x632d('0x13'),'fields':['name',_0x632d('0x14')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x632d('0xc'),_0x632d('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 64a9b36..8839d52 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(_0x2ab0b6,_0x34078f){var _0x1bd9bb=function(_0x461cb1){while(--_0x461cb1){_0x2ab0b6['push'](_0x2ab0b6['shift']());}};_0x1bd9bb(++_0x34078f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x47080d,_0x51afa2){var _0x2228bc=function(_0x3b5202){while(--_0x3b5202){_0x47080d['push'](_0x47080d['shift']());}};_0x2228bc(++_0x51afa2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 3e58263..a62690e 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 _0x60c7=['update','delete','exports','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','/:id','show','post'];(function(_0xe3c2de,_0x450b01){var _0x1a73d4=function(_0x382736){while(--_0x382736){_0xe3c2de['push'](_0xe3c2de['shift']());}};_0x1a73d4(++_0x450b01);}(_0x60c7,0xb9));var _0x760c=function(_0x577623,_0x392653){_0x577623=_0x577623-0x0;var _0xb9c348=_0x60c7[_0x577623];return _0xb9c348;};'use strict';var multer=require('multer');var util=require(_0x760c('0x0'));var path=require('path');var timeout=require(_0x760c('0x1'));var express=require('express');var router=express[_0x760c('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x760c('0x3'));var config=require(_0x760c('0x4'));var controller=require(_0x760c('0x5'));router['get']('/',auth[_0x760c('0x6')](),controller[_0x760c('0x7')]);router['get'](_0x760c('0x8'),auth['isAuthenticated'](),controller[_0x760c('0x9')]);router[_0x760c('0xa')]('/',auth[_0x760c('0x6')](),controller['create']);router['put'](_0x760c('0x8'),auth[_0x760c('0x6')](),controller[_0x760c('0xb')]);router[_0x760c('0xc')](_0x760c('0x8'),auth[_0x760c('0x6')](),controller['destroy']);module[_0x760c('0xd')]=router; \ No newline at end of file +var _0x7f6c=['/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./disposition.controller','isAuthenticated','get'];(function(_0x325b84,_0x3bf56a){var _0x172769=function(_0x128ea9){while(--_0x128ea9){_0x325b84['push'](_0x325b84['shift']());}};_0x172769(++_0x3bf56a);}(_0x7f6c,0x1b8));var _0xc7f6=function(_0x106636,_0x564f0b){_0x106636=_0x106636-0x0;var _0x5868c1=_0x7f6c[_0x106636];return _0x5868c1;};'use strict';var multer=require('multer');var util=require(_0xc7f6('0x0'));var path=require(_0xc7f6('0x1'));var timeout=require(_0xc7f6('0x2'));var express=require(_0xc7f6('0x3'));var router=express[_0xc7f6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc7f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc7f6('0x6'));var controller=require(_0xc7f6('0x7'));router['get']('/',auth[_0xc7f6('0x8')](),controller['index']);router[_0xc7f6('0x9')](_0xc7f6('0xa'),auth[_0xc7f6('0x8')](),controller['show']);router[_0xc7f6('0xb')]('/',auth[_0xc7f6('0x8')](),controller[_0xc7f6('0xc')]);router[_0xc7f6('0xd')](_0xc7f6('0xa'),auth['isAuthenticated'](),controller[_0xc7f6('0xe')]);router[_0xc7f6('0xf')](_0xc7f6('0xa'),auth[_0xc7f6('0x8')](),controller[_0xc7f6('0x10')]);module[_0xc7f6('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index ee6575b..4d15d77 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 _0xf9de=['KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','2400','4800','7200','14400','9600','12000','INTEGER','IAX','DADHI'];(function(_0x31fd35,_0x158155){var _0x574b81=function(_0x200faa){while(--_0x200faa){_0x31fd35['push'](_0x31fd35['shift']());}};_0x574b81(++_0x158155);}(_0xf9de,0x99));var _0xef9d=function(_0x554671,_0x546995){_0x554671=_0x554671-0x0;var _0x335a5c=_0xf9de[_0x554671];return _0x335a5c;};'use strict';var Sequelize=require(_0xef9d('0x0'));module[_0xef9d('0x1')]={'name':{'type':Sequelize[_0xef9d('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xef9d('0x3')](_0xef9d('0x4'),'no'),'defaultValue':_0xef9d('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xef9d('0x2')],'unique':_0xef9d('0x5')},'minrate':{'type':Sequelize['ENUM'](_0xef9d('0x6'),_0xef9d('0x7'),_0xef9d('0x8'),'9600','12000',_0xef9d('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xef9d('0x3')](_0xef9d('0x6'),_0xef9d('0x7'),_0xef9d('0x8'),_0xef9d('0xa'),_0xef9d('0xb'),'14400'),'defaultValue':_0xef9d('0x9')},'modem':{'type':Sequelize[_0xef9d('0x2')],'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[_0xef9d('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xef9d('0x3')]('SIP',_0xef9d('0xd'),_0xef9d('0xe'),_0xef9d('0xf')),'defaultValue':_0xef9d('0x10')},'key':{'type':Sequelize[_0xef9d('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xef9d('0x11')],'defaultValue':function(){return _0xef9d('0x12');}},'notificationSound':{'type':Sequelize[_0xef9d('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xef9d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xef9d('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xef9d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xef9d('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xef9d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xef9d('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xef9d('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xef9d('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x533f65){if(!_0x533f65)this['setDataValue'](_0xef9d('0x15'),null);this[_0xef9d('0x16')](_0xef9d('0x17'),_0x533f65);}}}; \ No newline at end of file +var _0xeae7=['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','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','9600','12000','14400','SIP','IAX'];(function(_0x17eb2d,_0x30bfbe){var _0x47cb19=function(_0x122480){while(--_0x122480){_0x17eb2d['push'](_0x17eb2d['shift']());}};_0x47cb19(++_0x30bfbe);}(_0xeae7,0x13c));var _0x7eae=function(_0x228ac9,_0x42f065){_0x228ac9=_0x228ac9-0x0;var _0x69fe02=_0xeae7[_0x228ac9];return _0x69fe02;};'use strict';var Sequelize=require(_0x7eae('0x0'));module[_0x7eae('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7eae('0x2')]},'ecm':{'type':Sequelize[_0x7eae('0x3')](_0x7eae('0x4'),'no'),'defaultValue':_0x7eae('0x4')},'headerinfo':{'type':Sequelize[_0x7eae('0x2')],'defaultValue':_0x7eae('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x7eae('0x6')},'minrate':{'type':Sequelize[_0x7eae('0x3')](_0x7eae('0x7'),_0x7eae('0x8'),'7200',_0x7eae('0x9'),_0x7eae('0xa'),_0x7eae('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x7eae('0x3')](_0x7eae('0x7'),_0x7eae('0x8'),'7200','9600',_0x7eae('0xa'),_0x7eae('0xb')),'defaultValue':_0x7eae('0xb')},'modem':{'type':Sequelize[_0x7eae('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x7eae('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x7eae('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x7eae('0x3')](_0x7eae('0xc'),_0x7eae('0xd'),'DADHI','KHOMP'),'defaultValue':_0x7eae('0xc')},'key':{'type':Sequelize[_0x7eae('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7eae('0xe');}},'notificationSound':{'type':Sequelize[_0x7eae('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7eae('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7eae('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7eae('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7eae('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7eae('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x7eae('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x7eae('0xf')],'defaultValue':![],'comment':_0x7eae('0x12'),'set':function(_0xc5679){if(!_0xc5679)this[_0x7eae('0x13')](_0x7eae('0x14'),null);this['setDataValue'](_0x7eae('0x15'),_0xc5679);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 9b8e4dd..7b15b70 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 _0x7eeb=['from','\x22%s\x22\x20<%s>','List\x20not\x20found','filename','Contact\x20not\x20found','ContactId','Messages','dataValues','SendFax','addAgents','spread','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','FaxAccounts','UserProfileResource','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','addDisposition','FaxAccountId','Disposition','findOne','order','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','FaxInteraction','addInteraction','omit','Contact','User','Owner','fullname','internal','Tag','Tags','tag','transaction','sequelize','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','priority','getApplications','localstationid','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','ecm','headerinfo','maxrate','modem','FAXOPT(','Set','Wait','addAccountApplications','updateAccountApplications','VoiceExtension','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','CmContact','Contacts','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil'];(function(_0x20295d,_0x39caf6){var _0x125ca2=function(_0x2ebf44){while(--_0x2ebf44){_0x20295d['push'](_0x20295d['shift']());}};_0x125ca2(++_0x39caf6);}(_0x7eeb,0xcf));var _0xb7ee=function(_0x26e727,_0x3e65be){_0x26e727=_0x26e727-0x0;var _0x563800=_0x7eeb[_0x26e727];return _0x563800;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb7ee('0x0'));var zipdir=require(_0xb7ee('0x1'));var jsonpatch=require(_0xb7ee('0x2'));var rp=require(_0xb7ee('0x3'));var moment=require(_0xb7ee('0x4'));var BPromise=require(_0xb7ee('0x5'));var Mustache=require(_0xb7ee('0x6'));var util=require(_0xb7ee('0x7'));var path=require(_0xb7ee('0x8'));var sox=require('sox');var csv=require(_0xb7ee('0x9'));var ejs=require(_0xb7ee('0xa'));var fs=require('fs');var fs_extra=require(_0xb7ee('0xb'));var _=require(_0xb7ee('0xc'));var squel=require('squel');var crypto=require(_0xb7ee('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb7ee('0xe'));var toCsv=require(_0xb7ee('0x9'));var querystring=require(_0xb7ee('0xf'));var Papa=require(_0xb7ee('0x10'));var Redis=require(_0xb7ee('0x11'));var authService=require(_0xb7ee('0x12'));var qs=require(_0xb7ee('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7ee('0x14'));var logger=require(_0xb7ee('0x15'))('api');var utils=require(_0xb7ee('0x16'));var config=require(_0xb7ee('0x17'));var licenseUtil=require(_0xb7ee('0x18'));var db=require(_0xb7ee('0x19'))['db'];config[_0xb7ee('0x1a')]=_[_0xb7ee('0x1b')](config[_0xb7ee('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xb7ee('0x1c'))(new Redis(config['redis']));require('./faxAccount.socket')[_0xb7ee('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb7ee('0x1e')][_0xb7ee('0x1f')]({'port':0x232c});var client9002=jayson[_0xb7ee('0x1e')][_0xb7ee('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3c6f66,_0x42060c,_0x172760,_0x415fd8){return new BPromise(function(_0x5f2a46,_0x22b2ce){var _0x2c86ef=_0x415fd8||client;return _0x2c86ef[_0xb7ee('0x20')](_0x3c6f66,_0x172760)[_0xb7ee('0x21')](function(_0x327219){logger[_0xb7ee('0x22')](_0xb7ee('0x23'),_0x42060c,'request\x20sent');logger['debug'](_0xb7ee('0x24'),_0x42060c,_0xb7ee('0x25'),JSON[_0xb7ee('0x26')](_0x327219));if(_0x327219['error']){if(_0x327219[_0xb7ee('0x27')][_0xb7ee('0x28')]===0x1f4){logger['error'](_0xb7ee('0x23'),_0x42060c,_0x327219[_0xb7ee('0x27')][_0xb7ee('0x29')]);return _0x22b2ce(_0x327219[_0xb7ee('0x27')][_0xb7ee('0x29')]);}logger['error'](_0xb7ee('0x23'),_0x42060c,_0x327219[_0xb7ee('0x27')][_0xb7ee('0x29')]);return _0x5f2a46(_0x327219['error'][_0xb7ee('0x29')]);}else{logger[_0xb7ee('0x22')]('FaxAccount,\x20%s,\x20%s',_0x42060c,_0xb7ee('0x25'));_0x5f2a46(_0x327219[_0xb7ee('0x2a')][_0xb7ee('0x29')]);}})[_0xb7ee('0x2b')](function(_0x282507){logger[_0xb7ee('0x27')](_0xb7ee('0x23'),_0x42060c,_0x282507);_0x22b2ce(_0x282507);});});}function respondWithStatusCode(_0x45b0d6,_0x2daeca){_0x2daeca=_0x2daeca||0xcc;return function(_0x531592){if(_0x531592){return _0x45b0d6[_0xb7ee('0x2c')](_0x2daeca);}return _0x45b0d6['status'](_0x2daeca)['end']();};}function respondWithResult(_0x49e06e,_0x51bc02){_0x51bc02=_0x51bc02||0xc8;return function(_0xe1c043){if(_0xe1c043){return _0x49e06e[_0xb7ee('0x2d')](_0x51bc02)[_0xb7ee('0x2e')](_0xe1c043);}};}function respondWithFilteredResult(_0x2ad462,_0x3788e0){return function(_0x4df0e0){if(_0x4df0e0){var _0x40feb5=typeof _0x3788e0[_0xb7ee('0x2f')]===_0xb7ee('0x30')&&typeof _0x3788e0[_0xb7ee('0x31')]==='undefined';var _0x2edbb5=_0x4df0e0[_0xb7ee('0x32')];var _0x6118eb=_0x40feb5?0x0:_0x3788e0[_0xb7ee('0x2f')];var _0x36c7e9=_0x40feb5?_0x4df0e0['count']:_0x3788e0['offset']+_0x3788e0[_0xb7ee('0x31')];var _0x2fea6d;if(_0x36c7e9>=_0x2edbb5){_0x36c7e9=_0x2edbb5;_0x2fea6d=0xc8;}else{_0x2fea6d=0xce;}_0x2ad462[_0xb7ee('0x2d')](_0x2fea6d);return _0x2ad462['set'](_0xb7ee('0x33'),_0x6118eb+'-'+_0x36c7e9+'/'+_0x2edbb5)[_0xb7ee('0x2e')](_0x4df0e0);}return null;};}function patchUpdates(_0x2860c2){return function(_0x49973e){try{jsonpatch[_0xb7ee('0x34')](_0x49973e,_0x2860c2,!![]);}catch(_0x4d4480){return BPromise['reject'](_0x4d4480);}return _0x49973e[_0xb7ee('0x35')]();};}function saveUpdates(_0x303be4,_0x12cf99){return function(_0x4ed375){if(_0x4ed375){return _0x4ed375[_0xb7ee('0x36')](_0x303be4)['then'](function(_0x12f29f){return _0x12f29f;});}return null;};}function removeEntity(_0x1b844d,_0x4fe7c7){return function(_0x1830b0){if(_0x1830b0){return _0x1830b0['destroy']()[_0xb7ee('0x21')](function(){var _0x2b9969=_0x1830b0['get']({'plain':!![]});var _0x59bea3=_0xb7ee('0x37');return db[_0xb7ee('0x38')][_0xb7ee('0x39')]({'where':{'type':_0x59bea3,'resourceId':_0x2b9969['id']}})[_0xb7ee('0x21')](function(){return _0x1830b0;});})['then'](function(){_0x1b844d[_0xb7ee('0x2d')](0xcc)[_0xb7ee('0x3a')]();});}};}function handleEntityNotFound(_0x2ed935,_0x46627b){return function(_0x3b86ba){if(!_0x3b86ba){_0x2ed935[_0xb7ee('0x2c')](0x194);}return _0x3b86ba;};}function handleError(_0x427016,_0x3d0fde){_0x3d0fde=_0x3d0fde||0x1f4;return function(_0x166ebe){logger[_0xb7ee('0x27')](_0x166ebe[_0xb7ee('0x3b')]);if(_0x166ebe[_0xb7ee('0x3c')]){delete _0x166ebe[_0xb7ee('0x3c')];}_0x427016[_0xb7ee('0x2d')](_0x3d0fde)[_0xb7ee('0x3d')](_0x166ebe);};}exports[_0xb7ee('0x3e')]=function(_0x878744,_0x196f9c){var _0x497342={'include':[{'model':db[_0xb7ee('0x3f')],'as':_0xb7ee('0x40')}]},_0xfadf21={},_0x133823={'count':0x0,'rows':[]};var _0x4eb7e2=_['map'](db[_0xb7ee('0x41')][_0xb7ee('0x42')],function(_0x648b52){return{'name':_0x648b52[_0xb7ee('0x43')],'type':_0x648b52[_0xb7ee('0x44')]['key']};});_0xfadf21['model']=_[_0xb7ee('0x45')](_0x4eb7e2,_0xb7ee('0x3c'));_0xfadf21['query']=_[_0xb7ee('0x46')](_0x878744[_0xb7ee('0x47')]);_0xfadf21[_0xb7ee('0x48')]=_[_0xb7ee('0x49')](_0xfadf21[_0xb7ee('0x4a')],_0xfadf21['query']);_0x497342[_0xb7ee('0x4b')]=_[_0xb7ee('0x49')](_0xfadf21[_0xb7ee('0x4a')],qs[_0xb7ee('0x4c')](_0x878744[_0xb7ee('0x47')]['fields']));_0x497342[_0xb7ee('0x4b')]=_0x497342['attributes'][_0xb7ee('0x4d')]?_0x497342[_0xb7ee('0x4b')]:_0xfadf21[_0xb7ee('0x4a')];if(!_0x878744['query'][_0xb7ee('0x4e')](_0xb7ee('0x4f'))){_0x497342[_0xb7ee('0x31')]=qs[_0xb7ee('0x31')](_0x878744[_0xb7ee('0x47')][_0xb7ee('0x31')]);_0x497342['offset']=qs[_0xb7ee('0x2f')](_0x878744['query']['offset']);}_0x497342['order']=qs[_0xb7ee('0x50')](_0x878744[_0xb7ee('0x47')][_0xb7ee('0x50')]);_0x497342[_0xb7ee('0x51')]=qs[_0xb7ee('0x48')](_[_0xb7ee('0x52')](_0x878744['query'],_0xfadf21[_0xb7ee('0x48')]),_0x4eb7e2);if(_0x878744['query'][_0xb7ee('0x53')]){_0x497342[_0xb7ee('0x51')]=_[_0xb7ee('0x54')](_0x497342[_0xb7ee('0x51')],{'$or':_[_0xb7ee('0x45')](_0x4eb7e2,function(_0x230931){if(_0x230931[_0xb7ee('0x44')]!=='VIRTUAL'){var _0xcaa756={};_0xcaa756[_0x230931['name']]={'$like':'%'+_0x878744[_0xb7ee('0x47')][_0xb7ee('0x53')]+'%'};return _0xcaa756;}})});}_0x497342=_[_0xb7ee('0x54')]({},_0x497342,_0x878744['options']);var _0x3c2419={'where':_0x497342[_0xb7ee('0x51')]};return db['FaxAccount'][_0xb7ee('0x32')](_0x3c2419)[_0xb7ee('0x21')](function(_0x1256f7){_0x133823[_0xb7ee('0x32')]=_0x1256f7;if(_0x878744['query'][_0xb7ee('0x55')]){_0x497342[_0xb7ee('0x56')]=[{'all':!![]}];}return db[_0xb7ee('0x41')][_0xb7ee('0x57')](_0x497342);})[_0xb7ee('0x21')](function(_0x42e093){_0x133823[_0xb7ee('0x58')]=_0x42e093;return _0x133823;})[_0xb7ee('0x21')](respondWithFilteredResult(_0x196f9c,_0x497342))[_0xb7ee('0x2b')](handleError(_0x196f9c,null));};exports[_0xb7ee('0x59')]=function(_0x1ef101,_0x298dd9){var _0x2b3e98={'raw':![],'where':{'id':_0x1ef101['params']['id']},'include':[{'model':db[_0xb7ee('0x3f')],'as':'mandatoryDispositionPause'}]},_0xd207f9={};_0xd207f9['model']=_['keys'](db[_0xb7ee('0x41')][_0xb7ee('0x42')]);_0xd207f9[_0xb7ee('0x47')]=_[_0xb7ee('0x46')](_0x1ef101[_0xb7ee('0x47')]);_0xd207f9[_0xb7ee('0x48')]=_['intersection'](_0xd207f9[_0xb7ee('0x4a')],_0xd207f9['query']);_0x2b3e98[_0xb7ee('0x4b')]=_[_0xb7ee('0x49')](_0xd207f9[_0xb7ee('0x4a')],qs[_0xb7ee('0x4c')](_0x1ef101['query']['fields']));_0x2b3e98['attributes']=_0x2b3e98[_0xb7ee('0x4b')][_0xb7ee('0x4d')]?_0x2b3e98[_0xb7ee('0x4b')]:_0xd207f9['model'];if(_0x1ef101[_0xb7ee('0x47')][_0xb7ee('0x55')]){_0x2b3e98[_0xb7ee('0x56')]=[{'all':!![]}];}_0x2b3e98=_['merge']({},_0x2b3e98,_0x1ef101[_0xb7ee('0x5a')]);return db['FaxAccount'][_0xb7ee('0x5b')](_0x2b3e98)[_0xb7ee('0x21')](handleEntityNotFound(_0x298dd9,null))['then'](respondWithResult(_0x298dd9,null))[_0xb7ee('0x2b')](handleError(_0x298dd9,null));};exports[_0xb7ee('0x5c')]=function(_0xd07305,_0x1fb2f9){return db[_0xb7ee('0x41')]['create'](_0xd07305[_0xb7ee('0x5d')],{})[_0xb7ee('0x21')](function(_0x4da63b){var _0x3f398a=_0xd07305[_0xb7ee('0x5e')][_0xb7ee('0x5f')]({'plain':!![]});if(!_0x3f398a)throw new Error(_0xb7ee('0x60'));if(_0x3f398a[_0xb7ee('0x61')]===_0xb7ee('0x5e')){var _0x3842f4=_0x4da63b[_0xb7ee('0x5f')]({'plain':!![]});var _0x2787ea=_0xb7ee('0x37');return db[_0xb7ee('0x62')][_0xb7ee('0x5b')]({'where':{'name':_0x2787ea,'userProfileId':_0x3f398a[_0xb7ee('0x63')]},'raw':!![]})[_0xb7ee('0x21')](function(_0x5e4cce){if(_0x5e4cce&&_0x5e4cce[_0xb7ee('0x64')]===0x0){return db['UserProfileResource'][_0xb7ee('0x5c')]({'name':_0x3842f4[_0xb7ee('0x3c')],'resourceId':_0x3842f4['id'],'type':_0x5e4cce[_0xb7ee('0x3c')],'sectionId':_0x5e4cce['id']},{})[_0xb7ee('0x21')](function(){return _0x4da63b;});}else{return _0x4da63b;}})[_0xb7ee('0x2b')](function(_0x392aa0){logger[_0xb7ee('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x392aa0);throw _0x392aa0;});}return _0x4da63b;})['then'](respondWithResult(_0x1fb2f9,0xc9))[_0xb7ee('0x2b')](handleError(_0x1fb2f9,null));};exports[_0xb7ee('0x36')]=function(_0x519170,_0x3c01ed){if(_0x519170[_0xb7ee('0x5d')]['id']){delete _0x519170['body']['id'];}return db[_0xb7ee('0x41')]['find']({'where':{'id':_0x519170['params']['id']},'include':[{'model':db[_0xb7ee('0x3f')],'as':'mandatoryDispositionPause'}]})[_0xb7ee('0x21')](handleEntityNotFound(_0x3c01ed,null))[_0xb7ee('0x21')](saveUpdates(_0x519170[_0xb7ee('0x5d')],null))[_0xb7ee('0x21')](respondWithResult(_0x3c01ed,null))[_0xb7ee('0x2b')](handleError(_0x3c01ed,null));};exports[_0xb7ee('0x39')]=function(_0x3ab4dd,_0x878df0){return db[_0xb7ee('0x41')]['find']({'where':{'id':_0x3ab4dd[_0xb7ee('0x65')]['id']}})['then'](handleEntityNotFound(_0x878df0,null))[_0xb7ee('0x21')](removeEntity(_0x878df0,null))[_0xb7ee('0x2b')](handleError(_0x878df0,null));};exports['describe']=function(_0x4f2e20,_0x1eb127){return db[_0xb7ee('0x41')][_0xb7ee('0x66')]()['then'](respondWithResult(_0x1eb127,null))['catch'](handleError(_0x1eb127,null));};exports[_0xb7ee('0x67')]=function(_0xe33d3b,_0x22b70a,_0x5dc623){if(_0xe33d3b[_0xb7ee('0x5d')]['id']){delete _0xe33d3b[_0xb7ee('0x5d')]['id'];}return db[_0xb7ee('0x41')][_0xb7ee('0x5b')]({'where':{'id':_0xe33d3b[_0xb7ee('0x65')]['id']}})[_0xb7ee('0x21')](handleEntityNotFound(_0x22b70a,null))[_0xb7ee('0x21')](function(_0x5e4536){if(_0x5e4536){_0xe33d3b[_0xb7ee('0x5d')][_0xb7ee('0x68')]=_0x5e4536['id'];return db[_0xb7ee('0x69')][_0xb7ee('0x5c')](_0xe33d3b['body']);}})[_0xb7ee('0x21')](respondWithResult(_0x22b70a,null))[_0xb7ee('0x2b')](handleError(_0x22b70a,null));};exports['getDispositions']=function(_0x3f2292,_0x348e38,_0x1df9ad){var _0x3c2818={'raw':![],'where':{}};var _0x4ce034={};var _0x425bd6={'count':0x0,'rows':[]};return db['FaxAccount'][_0xb7ee('0x6a')]({'where':{'id':_0x3f2292['params']['id']}})[_0xb7ee('0x21')](handleEntityNotFound(_0x348e38,null))['then'](function(_0x41d14a){if(_0x41d14a){_0x4ce034[_0xb7ee('0x4a')]=_['keys'](db[_0xb7ee('0x69')][_0xb7ee('0x42')]);_0x4ce034['query']=_[_0xb7ee('0x46')](_0x3f2292[_0xb7ee('0x47')]);_0x4ce034[_0xb7ee('0x48')]=_[_0xb7ee('0x49')](_0x4ce034[_0xb7ee('0x4a')],_0x4ce034[_0xb7ee('0x47')]);_0x3c2818[_0xb7ee('0x4b')]=_['intersection'](_0x4ce034[_0xb7ee('0x4a')],qs[_0xb7ee('0x4c')](_0x3f2292['query']['fields']));_0x3c2818['attributes']=_0x3c2818['attributes'][_0xb7ee('0x4d')]?_0x3c2818[_0xb7ee('0x4b')]:_0x4ce034['model'];if(!_0x3f2292['query'][_0xb7ee('0x4e')](_0xb7ee('0x4f'))){_0x3c2818[_0xb7ee('0x31')]=qs[_0xb7ee('0x31')](_0x3f2292[_0xb7ee('0x47')]['limit']);_0x3c2818[_0xb7ee('0x2f')]=qs[_0xb7ee('0x2f')](_0x3f2292[_0xb7ee('0x47')][_0xb7ee('0x2f')]);}_0x3c2818[_0xb7ee('0x6b')]=qs[_0xb7ee('0x50')](_0x3f2292[_0xb7ee('0x47')][_0xb7ee('0x50')]);_0x3c2818[_0xb7ee('0x51')]=qs[_0xb7ee('0x48')](_[_0xb7ee('0x52')](_0x3f2292[_0xb7ee('0x47')],_0x4ce034[_0xb7ee('0x48')]));_0x3c2818[_0xb7ee('0x51')][_0xb7ee('0x68')]=_0x41d14a['id'];if(_0x3f2292[_0xb7ee('0x47')][_0xb7ee('0x53')]){_0x3c2818['where']=_[_0xb7ee('0x54')](_0x3c2818['where'],{'$or':_['map'](_0x3c2818['attributes'],function(_0x552d88){var _0x4544c3={};_0x4544c3[_0x552d88]={'$like':'%'+_0x3f2292[_0xb7ee('0x47')][_0xb7ee('0x53')]+'%'};return _0x4544c3;})});}_0x3c2818=_[_0xb7ee('0x54')]({},_0x3c2818,_0x3f2292['options']);return db[_0xb7ee('0x69')][_0xb7ee('0x32')]({'where':_0x3c2818[_0xb7ee('0x51')]})[_0xb7ee('0x21')](function(_0x47e9f9){_0x425bd6['count']=_0x47e9f9;if(_0x3f2292['query'][_0xb7ee('0x55')]){_0x3c2818[_0xb7ee('0x56')]=[{'all':!![]}];}return db[_0xb7ee('0x69')][_0xb7ee('0x57')](_0x3c2818);})[_0xb7ee('0x21')](function(_0x331ad5){_0x425bd6['rows']=_0x331ad5;return _0x425bd6;});}})['then'](respondWithFilteredResult(_0x348e38,_0x3c2818))[_0xb7ee('0x2b')](handleError(_0x348e38,null));};exports[_0xb7ee('0x6c')]=function(_0x4cd248,_0x262efd,_0x2b649d){return db[_0xb7ee('0x41')][_0xb7ee('0x5b')]({'where':{'id':_0x4cd248[_0xb7ee('0x65')]['id']}})['then'](handleEntityNotFound(_0x262efd,null))['then'](function(_0x1000e8){if(_0x1000e8){return _0x1000e8['removeDispositions'](_0x4cd248[_0xb7ee('0x47')]['ids']);}})[_0xb7ee('0x21')](respondWithStatusCode(_0x262efd,null))[_0xb7ee('0x2b')](handleError(_0x262efd,null));};exports[_0xb7ee('0x6d')]=function(_0x4f474c,_0x311d0d,_0x2d8058){if(_0x4f474c[_0xb7ee('0x5d')]['id']){delete _0x4f474c[_0xb7ee('0x5d')]['id'];}return db['FaxAccount'][_0xb7ee('0x5b')]({'where':{'id':_0x4f474c[_0xb7ee('0x65')]['id']}})[_0xb7ee('0x21')](handleEntityNotFound(_0x311d0d,null))['then'](function(_0x4130ad){if(_0x4130ad){_0x4f474c['body'][_0xb7ee('0x68')]=_0x4130ad['id'];return db['CannedAnswer'][_0xb7ee('0x5c')](_0x4f474c[_0xb7ee('0x5d')]);}})['then'](respondWithResult(_0x311d0d,null))[_0xb7ee('0x2b')](handleError(_0x311d0d,null));};exports['getAnswers']=function(_0x318a26,_0x18c732,_0x28146b){var _0x1d3f38={'raw':![],'where':{}};var _0x3ed4af={};var _0x1af305={'count':0x0,'rows':[]};return db[_0xb7ee('0x41')]['findOne']({'where':{'id':_0x318a26['params']['id']}})['then'](handleEntityNotFound(_0x18c732,null))[_0xb7ee('0x21')](function(_0x490ece){if(_0x490ece){_0x3ed4af[_0xb7ee('0x4a')]=_[_0xb7ee('0x46')](db[_0xb7ee('0x6e')][_0xb7ee('0x42')]);_0x3ed4af[_0xb7ee('0x47')]=_[_0xb7ee('0x46')](_0x318a26[_0xb7ee('0x47')]);_0x3ed4af[_0xb7ee('0x48')]=_[_0xb7ee('0x49')](_0x3ed4af[_0xb7ee('0x4a')],_0x3ed4af[_0xb7ee('0x47')]);_0x1d3f38['attributes']=_['intersection'](_0x3ed4af['model'],qs[_0xb7ee('0x4c')](_0x318a26[_0xb7ee('0x47')][_0xb7ee('0x4c')]));_0x1d3f38['attributes']=_0x1d3f38[_0xb7ee('0x4b')][_0xb7ee('0x4d')]?_0x1d3f38['attributes']:_0x3ed4af[_0xb7ee('0x4a')];if(!_0x318a26[_0xb7ee('0x47')][_0xb7ee('0x4e')](_0xb7ee('0x4f'))){_0x1d3f38['limit']=qs[_0xb7ee('0x31')](_0x318a26[_0xb7ee('0x47')][_0xb7ee('0x31')]);_0x1d3f38[_0xb7ee('0x2f')]=qs['offset'](_0x318a26[_0xb7ee('0x47')]['offset']);}_0x1d3f38['order']=qs[_0xb7ee('0x50')](_0x318a26[_0xb7ee('0x47')]['sort']);_0x1d3f38[_0xb7ee('0x51')]=qs['filters'](_[_0xb7ee('0x52')](_0x318a26[_0xb7ee('0x47')],_0x3ed4af[_0xb7ee('0x48')]));_0x1d3f38[_0xb7ee('0x51')][_0xb7ee('0x68')]=_0x490ece['id'];if(_0x318a26[_0xb7ee('0x47')]['filter']){_0x1d3f38[_0xb7ee('0x51')]=_[_0xb7ee('0x54')](_0x1d3f38[_0xb7ee('0x51')],{'$or':_[_0xb7ee('0x45')](_0x1d3f38[_0xb7ee('0x4b')],function(_0x23cc94){var _0x3b7612={};_0x3b7612[_0x23cc94]={'$like':'%'+_0x318a26[_0xb7ee('0x47')]['filter']+'%'};return _0x3b7612;})});}_0x1d3f38=_[_0xb7ee('0x54')]({},_0x1d3f38,_0x318a26[_0xb7ee('0x5a')]);return db[_0xb7ee('0x6e')][_0xb7ee('0x32')]({'where':_0x1d3f38[_0xb7ee('0x51')]})['then'](function(_0x4d6d58){_0x1af305[_0xb7ee('0x32')]=_0x4d6d58;if(_0x318a26[_0xb7ee('0x47')]['includeAll']){_0x1d3f38['include']=[{'all':!![]}];}return db[_0xb7ee('0x6e')]['findAll'](_0x1d3f38);})[_0xb7ee('0x21')](function(_0x40f493){_0x1af305['rows']=_0x40f493;return _0x1af305;});}})['then'](respondWithFilteredResult(_0x18c732,_0x1d3f38))['catch'](handleError(_0x18c732,null));};exports['removeAnswers']=function(_0x29cfe8,_0x3a7512,_0x391e60){return db['FaxAccount']['find']({'where':{'id':_0x29cfe8[_0xb7ee('0x65')]['id']}})[_0xb7ee('0x21')](handleEntityNotFound(_0x3a7512,null))[_0xb7ee('0x21')](function(_0x21ab46){if(_0x21ab46){return _0x21ab46[_0xb7ee('0x6f')](_0x29cfe8[_0xb7ee('0x47')][_0xb7ee('0x70')]);}})[_0xb7ee('0x21')](respondWithStatusCode(_0x3a7512,null))['catch'](handleError(_0x3a7512,null));};exports['addInteraction']=function(_0x20a3f8,_0x339520,_0x23433b){return db[_0xb7ee('0x71')][_0xb7ee('0x5b')]({'where':{'id':_0x20a3f8['params']['id']}})[_0xb7ee('0x21')](handleEntityNotFound(_0x339520,null))['then'](function(_0x323b18){if(_0x323b18){return _0x323b18[_0xb7ee('0x72')](_0x20a3f8[_0xb7ee('0x5d')]['ids'],_[_0xb7ee('0x73')](_0x20a3f8[_0xb7ee('0x5d')],[_0xb7ee('0x70'),'id'])||{});}})['then'](respondWithResult(_0x339520,null))[_0xb7ee('0x2b')](handleError(_0x339520,null));};exports['getInteractions']=function(_0x2f82a8,_0x443e88,_0x6b6338){var _0x5a513d={'raw':![],'where':{}};var _0x4b20c9={};var _0x1a708f={'count':0x0,'rows':[]};return db[_0xb7ee('0x41')][_0xb7ee('0x6a')]({'where':{'id':_0x2f82a8[_0xb7ee('0x65')]['id']}})[_0xb7ee('0x21')](handleEntityNotFound(_0x443e88,null))['then'](function(_0x52925b){if(_0x52925b){_0x4b20c9[_0xb7ee('0x4a')]=_[_0xb7ee('0x46')](db[_0xb7ee('0x71')][_0xb7ee('0x42')]);_0x4b20c9['query']=_[_0xb7ee('0x46')](_0x2f82a8[_0xb7ee('0x47')]);_0x4b20c9[_0xb7ee('0x48')]=_['intersection'](_0x4b20c9[_0xb7ee('0x4a')],_0x4b20c9[_0xb7ee('0x47')]);_0x5a513d[_0xb7ee('0x4b')]=_[_0xb7ee('0x49')](_0x4b20c9[_0xb7ee('0x4a')],qs[_0xb7ee('0x4c')](_0x2f82a8['query'][_0xb7ee('0x4c')]));_0x5a513d[_0xb7ee('0x4b')]=_0x5a513d[_0xb7ee('0x4b')][_0xb7ee('0x4d')]?_0x5a513d[_0xb7ee('0x4b')]:_0x4b20c9['model'];if(!_0x2f82a8[_0xb7ee('0x47')][_0xb7ee('0x4e')](_0xb7ee('0x4f'))){_0x5a513d[_0xb7ee('0x31')]=qs[_0xb7ee('0x31')](_0x2f82a8[_0xb7ee('0x47')][_0xb7ee('0x31')]);_0x5a513d[_0xb7ee('0x2f')]=qs[_0xb7ee('0x2f')](_0x2f82a8[_0xb7ee('0x47')][_0xb7ee('0x2f')]);}_0x5a513d[_0xb7ee('0x6b')]=qs['sort'](_0x2f82a8[_0xb7ee('0x47')][_0xb7ee('0x50')]);_0x5a513d['where']=qs[_0xb7ee('0x48')](_[_0xb7ee('0x52')](_0x2f82a8[_0xb7ee('0x47')],_0x4b20c9['filters']));_0x5a513d[_0xb7ee('0x51')][_0xb7ee('0x68')]=_0x52925b['id'];if(_0x2f82a8['query'][_0xb7ee('0x53')]){_0x5a513d[_0xb7ee('0x51')]=_[_0xb7ee('0x54')](_0x5a513d[_0xb7ee('0x51')],{'$or':_['map'](_0x5a513d[_0xb7ee('0x4b')],function(_0x1dd7a5){var _0x178637={};_0x178637[_0x1dd7a5]={'$like':'%'+_0x2f82a8[_0xb7ee('0x47')][_0xb7ee('0x53')]+'%'};return _0x178637;})});}_0x5a513d=_[_0xb7ee('0x54')]({},_0x5a513d,_0x2f82a8[_0xb7ee('0x5a')]);return db['FaxInteraction'][_0xb7ee('0x32')]({'where':_0x5a513d[_0xb7ee('0x51')]})['then'](function(_0x5dc286){_0x1a708f[_0xb7ee('0x32')]=_0x5dc286;if(_0x2f82a8[_0xb7ee('0x47')][_0xb7ee('0x55')]){_0x5a513d[_0xb7ee('0x56')]=[{'model':db['CmContact'],'as':_0xb7ee('0x74'),'required':![]},{'model':db[_0xb7ee('0x75')],'as':_0xb7ee('0x76'),'attributes':[_0xb7ee('0x3c'),_0xb7ee('0x77'),_0xb7ee('0x78')],'required':![]},{'model':db[_0xb7ee('0x79')],'as':_0xb7ee('0x7a'),'attributes':['id',_0xb7ee('0x3c'),'color'],'where':_0x2f82a8[_0xb7ee('0x47')][_0xb7ee('0x7b')]?{'id':_0x2f82a8[_0xb7ee('0x47')][_0xb7ee('0x7b')]}:undefined,'required':_0x2f82a8[_0xb7ee('0x47')][_0xb7ee('0x7b')]?!![]:![]}];}return db[_0xb7ee('0x71')][_0xb7ee('0x57')](_0x5a513d);})[_0xb7ee('0x21')](function(_0x34511c){_0x1a708f[_0xb7ee('0x58')]=_0x34511c;return _0x1a708f;});}})[_0xb7ee('0x21')](respondWithFilteredResult(_0x443e88,_0x5a513d))['catch'](handleError(_0x443e88,null));};exports['addApplications']=function(_0x1c061c,_0x5121b8){var _0x580d04=_0x1c061c[_0xb7ee('0x65')]['id'];var _0x323249=_0x1c061c[_0xb7ee('0x5d')];var _0x3a1828=0xc8;var _0x5997e4=null;return db['sequelize'][_0xb7ee('0x7c')]({'isolationLevel':db[_0xb7ee('0x7d')][_0xb7ee('0x7e')]['ISOLATION_LEVELS'][_0xb7ee('0x7f')]},function(_0x3ad314){return db['FaxAccount'][_0xb7ee('0x6a')]({'where':{'id':_0x580d04},'transaction':_0x3ad314})['then'](function(_0x35327c){if(_0x35327c){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x580d04},'transaction':_0x3ad314})[_0xb7ee('0x21')](function(){var _0x5c3eab=_[_0xb7ee('0x45')](_0x323249,function(_0x1d01c3){_0x1d01c3['FaxAccountId']=_0x580d04;return _0x1d01c3;});return db[_0xb7ee('0x80')][_0xb7ee('0x81')](_0x5c3eab,{'transaction':_0x3ad314});});}else{_0x3a1828=0x194;_0x5997e4=[];}});})[_0xb7ee('0x21')](function(){if(_0x3a1828!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x580d04},'order':_0xb7ee('0x82')})[_0xb7ee('0x21')](function(_0x21fcfb){_0x5997e4=_0x21fcfb;});}})[_0xb7ee('0x2b')](function(_0x1573d9){_0x3a1828=0x1f4;logger['error'](_0x1573d9[_0xb7ee('0x3b')]);if(_0x1573d9[_0xb7ee('0x3c')]){delete _0x1573d9[_0xb7ee('0x3c')];}_0x5997e4=_0x1573d9;})['finally'](function(){if(_0x5997e4===null){_0x5121b8[_0xb7ee('0x2c')](_0x3a1828);}else{if(_0x3a1828===0x1f4){_0x5121b8[_0xb7ee('0x2d')](_0x3a1828)[_0xb7ee('0x3d')](_0x5997e4);}else{_0x5121b8[_0xb7ee('0x2d')](_0x3a1828)[_0xb7ee('0x2e')](_0x5997e4);}}});};exports[_0xb7ee('0x83')]=function(_0x17df53,_0x30268f,_0x47e8ab){var _0x209668={};var _0x330829={};var _0x108954;var _0x245476;return db[_0xb7ee('0x41')][_0xb7ee('0x6a')]({'where':{'id':_0x17df53['params']['id']}})[_0xb7ee('0x21')](handleEntityNotFound(_0x30268f,null))[_0xb7ee('0x21')](function(_0x54ecc2){if(_0x54ecc2){_0x108954=_0x54ecc2;_0x330829[_0xb7ee('0x4a')]=_[_0xb7ee('0x46')](db['FaxApplication']['rawAttributes']);_0x330829[_0xb7ee('0x47')]=_[_0xb7ee('0x46')](_0x17df53[_0xb7ee('0x47')]);_0x330829[_0xb7ee('0x48')]=_[_0xb7ee('0x49')](_0x330829[_0xb7ee('0x4a')],_0x330829['query']);_0x209668[_0xb7ee('0x4b')]=_['intersection'](_0x330829[_0xb7ee('0x4a')],qs[_0xb7ee('0x4c')](_0x17df53['query'][_0xb7ee('0x4c')]));_0x209668[_0xb7ee('0x4b')]=_0x209668['attributes'][_0xb7ee('0x4d')]?_0x209668[_0xb7ee('0x4b')]:_0x330829['model'];_0x209668[_0xb7ee('0x6b')]=qs[_0xb7ee('0x50')](_0x17df53[_0xb7ee('0x47')]['sort']);_0x209668[_0xb7ee('0x51')]=qs['filters'](_['pick'](_0x17df53[_0xb7ee('0x47')],_0x330829[_0xb7ee('0x48')]));if(_0x17df53[_0xb7ee('0x47')]['filter']){_0x209668[_0xb7ee('0x51')]=_[_0xb7ee('0x54')](_0x209668['where'],{'$or':_[_0xb7ee('0x45')](_0x209668[_0xb7ee('0x4b')],function(_0x1fc6bc){var _0x3b301d={};_0x3b301d[_0x1fc6bc]={'$like':'%'+_0x17df53[_0xb7ee('0x47')]['filter']+'%'};return _0x3b301d;})});}_0x209668=_[_0xb7ee('0x54')]({},_0x209668,_0x17df53[_0xb7ee('0x5a')]);return _0x108954[_0xb7ee('0x83')](_0x209668);}})[_0xb7ee('0x21')](function(_0x535131){if(_0x535131){_0x245476=_0x535131[_0xb7ee('0x4d')];if(!_0x17df53[_0xb7ee('0x47')]['hasOwnProperty'](_0xb7ee('0x4f'))){_0x209668[_0xb7ee('0x31')]=qs[_0xb7ee('0x31')](_0x17df53['query']['limit']);_0x209668[_0xb7ee('0x2f')]=qs[_0xb7ee('0x2f')](_0x17df53['query'][_0xb7ee('0x2f')]);}return _0x108954[_0xb7ee('0x83')](_0x209668);}})[_0xb7ee('0x21')](function(_0x30cc07){if(_0x30cc07){return _0x30cc07?{'count':_0x245476,'rows':_0x30cc07}:null;}})[_0xb7ee('0x21')](respondWithResult(_0x30268f,null))[_0xb7ee('0x2b')](handleError(_0x30268f,null));};function Extension(_0x57714e,_0x31ede5,_0x213c84,_0x3d860a){this['context']='from-voip-provider';this['exten']=_0x57714e[_0xb7ee('0x84')];this['app']=_0x3d860a;this[_0xb7ee('0x44')]=_0xb7ee('0x85');this[_0xb7ee('0x86')]=_0xb7ee('0x87');this[_0xb7ee('0x68')]=_0x57714e['id'];this[_0xb7ee('0x82')]=_0x31ede5;this[_0xb7ee('0x88')]=_0x213c84;}function createExtensionsReciveFax(_0x3fb9bb){var _0x2a0fa5=0x1;var _0x25ea73=[];_0x25ea73[_0xb7ee('0x89')](new Extension(_0x3fb9bb,_0x2a0fa5,'',_0xb7ee('0x8a')));_0x2a0fa5+=0x1;_0x25ea73[_0xb7ee('0x89')](new Extension(_0x3fb9bb,_0x2a0fa5,_0xb7ee('0x8b'),'Set'));_0x2a0fa5+=0x1;for(var _0x28e422 in _0x3fb9bb){if(_0x3fb9bb['hasOwnProperty'](_0x28e422)&&(_0x28e422===_0xb7ee('0x8c')||_0x28e422===_0xb7ee('0x84')||_0x28e422==='gateway'||_0x28e422==='faxdetect'||_0x28e422===_0xb7ee('0x8d')||_0x28e422===_0xb7ee('0x8e')||_0x28e422==='minrate'||_0x28e422===_0xb7ee('0x8f')||_0x28e422==='t38timeout')){_0x25ea73[_0xb7ee('0x89')](new Extension(_0x3fb9bb,_0x2a0fa5,_0xb7ee('0x90')+_0x28e422+')='+_0x3fb9bb[_0x28e422],_0xb7ee('0x91')));_0x2a0fa5+=0x1;}}_0x25ea73[_0xb7ee('0x89')](new Extension(_0x3fb9bb,_0x2a0fa5,'6',_0xb7ee('0x92')));_0x2a0fa5+=0x1;_0x25ea73[_0xb7ee('0x89')](new Extension(_0x3fb9bb,_0x2a0fa5,'/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'));_0x2a0fa5=0x0;return _0x25ea73;}exports[_0xb7ee('0x93')]=function(_0x49ab90,_0x4c7d72,_0x4b20cc){var _0x4549ef;return db['sequelize']['transaction'](function(_0x389fa3){return db[_0xb7ee('0x41')][_0xb7ee('0x5c')](_0x49ab90['body'],{'transaction':_0x389fa3})[_0xb7ee('0x21')](function(_0x4c0996){_0x4549ef=_0x4c0996['get']({'plain':!![]});return db['VoiceExtension'][_0xb7ee('0x81')](createExtensionsReciveFax(_0x4549ef),{'transaction':_0x389fa3});});})[_0xb7ee('0x21')](function(){return _0x4549ef;})[_0xb7ee('0x21')](respondWithResult(_0x4c7d72,null))[_0xb7ee('0x2b')](handleError(_0x4c7d72,null));};exports[_0xb7ee('0x94')]=function(_0x54b240,_0x195829,_0x376050){var _0x2b235;return db[_0xb7ee('0x7d')][_0xb7ee('0x7c')](function(_0x2bd950){return db['FaxAccount'][_0xb7ee('0x36')](_0x54b240[_0xb7ee('0x5d')],{'where':{'id':_0x54b240[_0xb7ee('0x5d')]['id']},'transaction':_0x2bd950})['then'](function(_0x944f9a){return db[_0xb7ee('0x95')]['destroy']({'where':{'FaxAccountId':_0x54b240[_0xb7ee('0x5d')]['id']},'transaction':_0x2bd950})['then'](function(_0x1af929){return db[_0xb7ee('0x95')][_0xb7ee('0x81')](createExtensionsReciveFax(_[_0xb7ee('0x73')](_0x54b240['body'],[_0xb7ee('0x96'),_0xb7ee('0x97'),_0xb7ee('0x98'),_0xb7ee('0x99'),_0xb7ee('0x9a'),_0xb7ee('0x9b')])),{'transaction':_0x2bd950});});});})[_0xb7ee('0x21')](function(){return db[_0xb7ee('0x41')][_0xb7ee('0x9c')](_0x54b240[_0xb7ee('0x5d')]['id']);})[_0xb7ee('0x21')](respondWithResult(_0x195829,null))['catch'](handleError(_0x195829,null));};exports[_0xb7ee('0x9d')]=function(_0x288d97,_0x42d259,_0x322b2d){var _0x1c7756={'raw':!![],'where':{}};var _0x11fa05={};var _0x21b933={'count':0x0,'rows':[]};return db[_0xb7ee('0x41')][_0xb7ee('0x6a')]({'where':{'id':_0x288d97[_0xb7ee('0x65')]['id']}})[_0xb7ee('0x21')](handleEntityNotFound(_0x42d259,null))['then'](function(_0x13da25){if(_0x13da25){_0x11fa05[_0xb7ee('0x4a')]=_[_0xb7ee('0x46')](db['FaxMessage'][_0xb7ee('0x42')]);_0x11fa05[_0xb7ee('0x47')]=_[_0xb7ee('0x46')](_0x288d97[_0xb7ee('0x47')]);_0x11fa05['filters']=_['intersection'](_0x11fa05[_0xb7ee('0x4a')],_0x11fa05['query']);_0x1c7756[_0xb7ee('0x4b')]=_[_0xb7ee('0x49')](_0x11fa05['model'],qs[_0xb7ee('0x4c')](_0x288d97[_0xb7ee('0x47')][_0xb7ee('0x4c')]));_0x1c7756[_0xb7ee('0x4b')]=_0x1c7756[_0xb7ee('0x4b')][_0xb7ee('0x4d')]?_0x1c7756[_0xb7ee('0x4b')]:_0x11fa05['model'];if(!_0x288d97[_0xb7ee('0x47')][_0xb7ee('0x4e')](_0xb7ee('0x4f'))){_0x1c7756['limit']=qs[_0xb7ee('0x31')](_0x288d97['query'][_0xb7ee('0x31')]);_0x1c7756[_0xb7ee('0x2f')]=qs[_0xb7ee('0x2f')](_0x288d97[_0xb7ee('0x47')][_0xb7ee('0x2f')]);}_0x1c7756[_0xb7ee('0x6b')]=qs[_0xb7ee('0x50')](_0x288d97['query'][_0xb7ee('0x50')]);_0x1c7756[_0xb7ee('0x51')]=qs['filters'](_['pick'](_0x288d97[_0xb7ee('0x47')],_0x11fa05[_0xb7ee('0x48')]));_0x1c7756[_0xb7ee('0x51')][_0xb7ee('0x68')]=_0x13da25['id'];if(_0x288d97[_0xb7ee('0x47')][_0xb7ee('0x53')]){_0x1c7756[_0xb7ee('0x51')]=_[_0xb7ee('0x54')](_0x1c7756['where'],{'$or':_[_0xb7ee('0x45')](_0x1c7756[_0xb7ee('0x4b')],function(_0x1d17fc){var _0x4c506a={};_0x4c506a[_0x1d17fc]={'$like':'%'+_0x288d97[_0xb7ee('0x47')][_0xb7ee('0x53')]+'%'};return _0x4c506a;})});}if(_0x288d97[_0xb7ee('0x47')][_0xb7ee('0x9e')]){var _0x24d4c3=_0x288d97[_0xb7ee('0x47')]['$gte'][_0xb7ee('0x9f')](',');var _0xe83df={};_0xe83df[_0x24d4c3[0x0]]={'$gte':moment(_0x24d4c3[0x1])[_0xb7ee('0xa0')](_0xb7ee('0xa1'))};_0x1c7756[_0xb7ee('0x51')]=_[_0xb7ee('0x54')](_0x1c7756[_0xb7ee('0x51')],_0xe83df);}_0x1c7756=_[_0xb7ee('0x54')]({},_0x1c7756,_0x288d97['options']);return db[_0xb7ee('0xa2')][_0xb7ee('0x32')]({'where':_0x1c7756[_0xb7ee('0x51')]})['then'](function(_0x57376b){_0x21b933['count']=_0x57376b;if(_0x288d97[_0xb7ee('0x47')][_0xb7ee('0x55')]){_0x1c7756[_0xb7ee('0x56')]=[{'all':!![]}];}return db[_0xb7ee('0xa2')][_0xb7ee('0x57')](_0x1c7756);})[_0xb7ee('0x21')](function(_0xc4dd43){_0x21b933[_0xb7ee('0x58')]=_0xc4dd43;return _0x21b933;});}})[_0xb7ee('0x21')](respondWithFilteredResult(_0x42d259,_0x1c7756))[_0xb7ee('0x2b')](handleError(_0x42d259,null));};exports[_0xb7ee('0x3d')]=function(_0x3d1df8,_0x41884b,_0x237b14){var _0x4c17b7,_0x3e76a8={},_0x45e040;if(_0x3d1df8[_0xb7ee('0x5d')]['to']){_0x45e040=_0x3d1df8['body']['to'][0x0];}return db[_0xb7ee('0x41')][_0xb7ee('0x5b')]({'where':{'id':_0x3d1df8['params']['id']},'include':[{'model':db[_0xb7ee('0xa3')],'as':_0xb7ee('0xa4'),'include':[{'model':db[_0xb7ee('0xa5')],'as':_0xb7ee('0xa6'),'where':{'fax':_0x45e040},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xb7ee('0x21')](handleEntityNotFound(_0x41884b,null))[_0xb7ee('0x21')](function(_0x17bc36){_0x4c17b7=_0x17bc36;if(_0x3d1df8[_0xb7ee('0x5d')]['attachments']&&_0x3d1df8[_0xb7ee('0x5d')][_0xb7ee('0xa7')][_0xb7ee('0x4d')]){for(var _0xb363cc=0x0;_0xb363cc<_0x3d1df8[_0xb7ee('0x5d')][_0xb7ee('0xa7')]['length'];_0xb363cc+=0x1){_0x3d1df8[_0xb7ee('0x5d')][_0xb7ee('0xa7')][_0xb363cc]={'filename':_0x3d1df8['body'][_0xb7ee('0xa7')][_0xb363cc][_0xb7ee('0x3c')],'id':_0x3d1df8['body'][_0xb7ee('0xa7')][_0xb363cc]['id'],'path':path[_0xb7ee('0xa8')](config['root'],_0xb7ee('0xa9'),_0x3d1df8['body'][_0xb7ee('0xa7')][_0xb363cc][_0xb7ee('0xaa')])};}}return respondWithRpcPromise(_0xb7ee('0xab'),_0xb7ee('0xab'),{'FaxAccountId':_[_0xb7ee('0xac')](_0x3d1df8[_0xb7ee('0x65')]['id'])?undefined:_0x3d1df8[_0xb7ee('0x65')]['id'],'path':_[_0xb7ee('0xac')](_0x3d1df8[_0xb7ee('0x5d')][_0xb7ee('0xa7')][0x0][_0xb7ee('0x8')])?undefined:_0x3d1df8[_0xb7ee('0x5d')][_0xb7ee('0xa7')][0x0][_0xb7ee('0x8')],'fax':_['isNil'](_0x3d1df8[_0xb7ee('0x5d')]['to'][0x0])?undefined:_0x3d1df8[_0xb7ee('0x5d')]['to'][0x0]},client9002);})['then'](function(){if(_0x4c17b7){if(_[_0xb7ee('0xac')](_0x3d1df8[_0xb7ee('0x5d')]['from'])){_0x3d1df8[_0xb7ee('0x5d')][_0xb7ee('0xad')]=util['format'](_0xb7ee('0xae'),_0x4c17b7[_0xb7ee('0x3c')],_0x4c17b7['fax']);}if(_0x4c17b7['List']){if(_0x4c17b7[_0xb7ee('0xa4')][_0xb7ee('0xa6')][_0xb7ee('0x4d')]){return _0x4c17b7[_0xb7ee('0xa4')]['Contacts'][0x0];}else{return db[_0xb7ee('0xa5')][_0xb7ee('0x5c')](_['defaults'](_0x3d1df8[_0xb7ee('0x5d')],{'firstName':_0x3d1df8[_0xb7ee('0x5d')]['to'][0x0],'phone':_0x3d1df8[_0xb7ee('0x5d')]['to'][0x0],'fax':_0x3d1df8[_0xb7ee('0x5d')]['to'][0x0],'ListId':_0x4c17b7['ListId']}));}}else{throw new Error(_0xb7ee('0xaf'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xb7ee('0x21')](function(_0x479ecb){if(_0x479ecb){return db['FaxInteraction'][_0xb7ee('0x5b')]({'where':{'ContactId':_0x479ecb['id'],'closed':![],'FaxAccountId':_0x4c17b7['id']}})[_0xb7ee('0x21')](function(_0x40230b){if(_0x40230b){return[_0x40230b,![]];}return db[_0xb7ee('0x71')]['create']({'UserId':_0x3d1df8[_0xb7ee('0x5e')]['id'],'ContactId':_0x479ecb['id'],'FaxAccountId':_0x4c17b7['id'],'fax':_0x3d1df8[_0xb7ee('0x5d')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xb7ee('0x54')](_0x3d1df8[_0xb7ee('0x5d')],{'read':![],'body':_0x3d1df8[_0xb7ee('0x5d')][_0xb7ee('0xa7')][0x0][_0xb7ee('0xb0')],'FaxAccountId':_0x4c17b7['id'],'UserId':_0x3d1df8[_0xb7ee('0x5e')]['id'],'ContactId':_0x479ecb['id'],'AttachmentId':_0x3d1df8[_0xb7ee('0x5d')][_0xb7ee('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0xb7ee('0xa2')],'as':'Messages'}]})[_0xb7ee('0x21')](function(_0x2ebef8){return[_0x2ebef8,!![]];});});}else{throw new Error(_0xb7ee('0xb1'));}})['spread'](function(_0x29eedb,_0x5e74f0){if(_0x5e74f0){return _0x29eedb;}return db[_0xb7ee('0xa2')][_0xb7ee('0x5c')]({'direction':'out','read':![],'body':_0x3d1df8['body']['attachments'][0x0][_0xb7ee('0xb0')],'FaxAccountId':_0x4c17b7['id'],'FaxInteractionId':_0x29eedb['id'],'UserId':_0x3d1df8[_0xb7ee('0x5e')]['id'],'ContactId':_0x29eedb[_0xb7ee('0xb2')],'AttachmentId':_0x3d1df8[_0xb7ee('0x5d')][_0xb7ee('0xa7')][0x0]['id']})[_0xb7ee('0x21')](function(_0x37d145){_0x29eedb['dataValues'][_0xb7ee('0xb3')]=[];_0x29eedb[_0xb7ee('0xb4')][_0xb7ee('0xb3')][_0xb7ee('0x89')](_0x37d145['dataValues']);return _0x29eedb;});})[_0xb7ee('0x21')](function(_0x2bff31){respondWithRpcPromise(_0xb7ee('0xb5'),_0xb7ee('0xb5'),{'FaxAccountId':_[_0xb7ee('0xac')](_0x3d1df8['params']['id'])?undefined:_0x3d1df8[_0xb7ee('0x65')]['id'],'path':_[_0xb7ee('0xac')](_0x3d1df8[_0xb7ee('0x5d')][_0xb7ee('0xa7')][0x0][_0xb7ee('0x8')])?undefined:_0x3d1df8[_0xb7ee('0x5d')][_0xb7ee('0xa7')][0x0][_0xb7ee('0x8')],'fax':_['isNil'](_0x3d1df8[_0xb7ee('0x5d')]['to'][0x0])?undefined:_0x3d1df8['body']['to'][0x0],'AttachmentId':_0x3d1df8[_0xb7ee('0x5d')][_0xb7ee('0xa7')][0x0]['id']},client9002)['then'](function(_0x3e91bf){logger[_0xb7ee('0x22')]('SendFaxRpc,\x20%s',_0x3e91bf);})[_0xb7ee('0x2b')](function(_0x138ae8){logger[_0xb7ee('0x22')]('SendFaxRpc,\x20%s',_0x138ae8);});return _0x2bff31;})[_0xb7ee('0x21')](respondWithResult(_0x41884b,null))['catch'](handleError(_0x41884b,null));};exports[_0xb7ee('0xb6')]=function(_0x7730a2,_0x68d0ac,_0x427c85){return db['FaxAccount'][_0xb7ee('0x5b')]({'where':{'id':_0x7730a2[_0xb7ee('0x65')]['id']}})['then'](handleEntityNotFound(_0x68d0ac,null))[_0xb7ee('0x21')](function(_0xb6a127){if(_0xb6a127){return _0xb6a127['addAgents'](_0x7730a2[_0xb7ee('0x5d')][_0xb7ee('0x70')],_[_0xb7ee('0x73')](_0x7730a2[_0xb7ee('0x5d')],['ids','id'])||{})[_0xb7ee('0xb7')](function(_0x42103a){for(var _0x21ac0d=0x0;_0x21ac0d<_0x7730a2['body'][_0xb7ee('0x70')][_0xb7ee('0x4d')];_0x21ac0d+=0x1){socket['emit'](_0xb7ee('0xb8'),{'UserId':Number(_0x7730a2[_0xb7ee('0x5d')][_0xb7ee('0x70')][_0x21ac0d]),'FaxAccountId':Number(_0x7730a2[_0xb7ee('0x65')]['id'])});}return _0x42103a;});}})[_0xb7ee('0x21')](respondWithResult(_0x68d0ac,null))[_0xb7ee('0x2b')](handleError(_0x68d0ac,null));};exports[_0xb7ee('0xb9')]=function(_0x10b681,_0x2599f9,_0x12b6ec){return db[_0xb7ee('0x41')][_0xb7ee('0x5b')]({'where':{'id':_0x10b681['params']['id']}})[_0xb7ee('0x21')](handleEntityNotFound(_0x2599f9,null))['then'](function(_0xc710b1){if(_0xc710b1){return _0xc710b1[_0xb7ee('0xb9')](_0x10b681[_0xb7ee('0x47')][_0xb7ee('0x70')])[_0xb7ee('0x21')](function(){if(_[_0xb7ee('0xba')](_0x10b681[_0xb7ee('0x47')]['ids'])){for(var _0x3763c5=0x0;_0x3763c5<_0x10b681[_0xb7ee('0x47')][_0xb7ee('0x70')][_0xb7ee('0x4d')];_0x3763c5+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x10b681[_0xb7ee('0x47')][_0xb7ee('0x70')][_0x3763c5]),'FaxAccountId':Number(_0x10b681[_0xb7ee('0x65')]['id'])});}}else{socket[_0xb7ee('0xbb')](_0xb7ee('0xbc'),{'UserId':Number(_0x10b681[_0xb7ee('0x47')]['ids']),'FaxAccountId':Number(_0x10b681[_0xb7ee('0x65')]['id'])});}});}})[_0xb7ee('0x21')](respondWithStatusCode(_0x2599f9,null))[_0xb7ee('0x2b')](handleError(_0x2599f9,null));};exports[_0xb7ee('0xbd')]=function(_0x5d8f4d,_0x398e3e,_0xcb9967){var _0x2a3fa6={};var _0x3a52d5={};var _0x1cafdc;var _0x395cb7;return db[_0xb7ee('0x41')][_0xb7ee('0x6a')]({'where':{'id':_0x5d8f4d[_0xb7ee('0x65')]['id']}})[_0xb7ee('0x21')](handleEntityNotFound(_0x398e3e,null))[_0xb7ee('0x21')](function(_0x390897){if(_0x390897){_0x1cafdc=_0x390897;_0x3a52d5[_0xb7ee('0x4a')]=_[_0xb7ee('0x46')](db[_0xb7ee('0x75')][_0xb7ee('0x42')]);_0x3a52d5[_0xb7ee('0x47')]=_[_0xb7ee('0x46')](_0x5d8f4d[_0xb7ee('0x47')]);_0x3a52d5[_0xb7ee('0x48')]=_['intersection'](_0x3a52d5[_0xb7ee('0x4a')],_0x3a52d5[_0xb7ee('0x47')]);_0x2a3fa6['attributes']=_['intersection'](_0x3a52d5[_0xb7ee('0x4a')],qs[_0xb7ee('0x4c')](_0x5d8f4d[_0xb7ee('0x47')]['fields']));_0x2a3fa6['attributes']=_0x2a3fa6[_0xb7ee('0x4b')][_0xb7ee('0x4d')]?_0x2a3fa6[_0xb7ee('0x4b')]:_0x3a52d5['model'];_0x2a3fa6[_0xb7ee('0x6b')]=qs[_0xb7ee('0x50')](_0x5d8f4d[_0xb7ee('0x47')][_0xb7ee('0x50')]);_0x2a3fa6[_0xb7ee('0x51')]=qs['filters'](_[_0xb7ee('0x52')](_0x5d8f4d[_0xb7ee('0x47')],_0x3a52d5[_0xb7ee('0x48')]));if(_0x5d8f4d[_0xb7ee('0x47')][_0xb7ee('0x53')]){_0x2a3fa6[_0xb7ee('0x51')]=_[_0xb7ee('0x54')](_0x2a3fa6['where'],{'$or':_['map'](_0x2a3fa6[_0xb7ee('0x4b')],function(_0x53b4ce){var _0x5d8a2d={};_0x5d8a2d[_0x53b4ce]={'$like':'%'+_0x5d8f4d[_0xb7ee('0x47')][_0xb7ee('0x53')]+'%'};return _0x5d8a2d;})});}_0x2a3fa6=_[_0xb7ee('0x54')]({},_0x2a3fa6,_0x5d8f4d[_0xb7ee('0x5a')]);return _0x1cafdc[_0xb7ee('0xbd')](_0x2a3fa6);}})[_0xb7ee('0x21')](function(_0x17502c){if(_0x17502c){_0x395cb7=_0x17502c['length'];if(!_0x5d8f4d[_0xb7ee('0x47')][_0xb7ee('0x4e')](_0xb7ee('0x4f'))){_0x2a3fa6[_0xb7ee('0x31')]=qs[_0xb7ee('0x31')](_0x5d8f4d[_0xb7ee('0x47')][_0xb7ee('0x31')]);_0x2a3fa6['offset']=qs[_0xb7ee('0x2f')](_0x5d8f4d[_0xb7ee('0x47')]['offset']);}return _0x1cafdc[_0xb7ee('0xbd')](_0x2a3fa6);}})['then'](function(_0xd5f30b){if(_0xd5f30b){return _0xd5f30b?{'count':_0x395cb7,'rows':_0xd5f30b}:null;}})[_0xb7ee('0x21')](respondWithResult(_0x398e3e,null))['catch'](handleError(_0x398e3e,null));}; \ No newline at end of file +var _0x1ab1=['appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','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','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','tech','key','createdAt','updatedAt','TrunkId','ListId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','server/files/attachments','basename','isNil','from','\x22%s\x22\x20<%s>','defaults','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','http','client','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','rawAttributes','intersection','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','FaxApplication','findAndCountAll','finally','getApplications','context','from-voip-provider','exten','localstationid','app','Fax\x20Extension'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0x1ab1,0x1c8));var _0x11ab=function(_0x501881,_0x53aa91){_0x501881=_0x501881-0x0;var _0x15a491=_0x1ab1[_0x501881];return _0x15a491;};'use strict';var emlformat=require(_0x11ab('0x0'));var rimraf=require(_0x11ab('0x1'));var zipdir=require(_0x11ab('0x2'));var jsonpatch=require(_0x11ab('0x3'));var rp=require(_0x11ab('0x4'));var moment=require('moment');var BPromise=require(_0x11ab('0x5'));var Mustache=require(_0x11ab('0x6'));var util=require(_0x11ab('0x7'));var path=require(_0x11ab('0x8'));var sox=require(_0x11ab('0x9'));var csv=require(_0x11ab('0xa'));var ejs=require(_0x11ab('0xb'));var fs=require('fs');var fs_extra=require(_0x11ab('0xc'));var _=require(_0x11ab('0xd'));var squel=require(_0x11ab('0xe'));var crypto=require(_0x11ab('0xf'));var jsforce=require(_0x11ab('0x10'));var deskjs=require(_0x11ab('0x11'));var toCsv=require(_0x11ab('0xa'));var querystring=require(_0x11ab('0x12'));var Papa=require(_0x11ab('0x13'));var Redis=require(_0x11ab('0x14'));var authService=require(_0x11ab('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x11ab('0x16'))(_0x11ab('0x17'));var utils=require('../../config/utils');var config=require(_0x11ab('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x11ab('0x19'))['db'];config[_0x11ab('0x1a')]=_['defaults'](config[_0x11ab('0x1a')],{'host':_0x11ab('0x1b'),'port':0x18eb});var socket=require(_0x11ab('0x1c'))(new Redis(config[_0x11ab('0x1a')]));require(_0x11ab('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x11ab('0x1e')]({'port':0x232c});var client9002=jayson[_0x11ab('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x456d2c,_0x159b81,_0x398ee1,_0x1dbfb1){return new BPromise(function(_0x351f0d,_0x514309){var _0x5b4baf=_0x1dbfb1||client;return _0x5b4baf[_0x11ab('0x20')](_0x456d2c,_0x398ee1)[_0x11ab('0x21')](function(_0x4eeaaf){logger['info'](_0x11ab('0x22'),_0x159b81,_0x11ab('0x23'));logger[_0x11ab('0x24')](_0x11ab('0x25'),_0x159b81,'request\x20sent',JSON[_0x11ab('0x26')](_0x4eeaaf));if(_0x4eeaaf[_0x11ab('0x27')]){if(_0x4eeaaf[_0x11ab('0x27')][_0x11ab('0x28')]===0x1f4){logger[_0x11ab('0x27')](_0x11ab('0x22'),_0x159b81,_0x4eeaaf['error'][_0x11ab('0x29')]);return _0x514309(_0x4eeaaf['error'][_0x11ab('0x29')]);}logger[_0x11ab('0x27')](_0x11ab('0x22'),_0x159b81,_0x4eeaaf[_0x11ab('0x27')][_0x11ab('0x29')]);return _0x351f0d(_0x4eeaaf[_0x11ab('0x27')][_0x11ab('0x29')]);}else{logger[_0x11ab('0x2a')](_0x11ab('0x22'),_0x159b81,_0x11ab('0x23'));_0x351f0d(_0x4eeaaf[_0x11ab('0x2b')][_0x11ab('0x29')]);}})[_0x11ab('0x2c')](function(_0x34a16b){logger[_0x11ab('0x27')]('FaxAccount,\x20%s,\x20%s',_0x159b81,_0x34a16b);_0x514309(_0x34a16b);});});}function respondWithStatusCode(_0x22e189,_0x28a2ef){_0x28a2ef=_0x28a2ef||0xcc;return function(_0x3d70f8){if(_0x3d70f8){return _0x22e189[_0x11ab('0x2d')](_0x28a2ef);}return _0x22e189['status'](_0x28a2ef)['end']();};}function respondWithResult(_0x16382b,_0x81e9be){_0x81e9be=_0x81e9be||0xc8;return function(_0x28a201){if(_0x28a201){return _0x16382b[_0x11ab('0x2e')](_0x81e9be)[_0x11ab('0x2f')](_0x28a201);}};}function respondWithFilteredResult(_0x460299,_0x2207da){return function(_0x1c6ee8){if(_0x1c6ee8){var _0x1339d1=typeof _0x2207da[_0x11ab('0x30')]===_0x11ab('0x31')&&typeof _0x2207da['limit']===_0x11ab('0x31');var _0x15d94e=_0x1c6ee8['count'];var _0x166e4b=_0x1339d1?0x0:_0x2207da[_0x11ab('0x30')];var _0x40daec=_0x1339d1?_0x1c6ee8[_0x11ab('0x32')]:_0x2207da[_0x11ab('0x30')]+_0x2207da[_0x11ab('0x33')];var _0x5a0406;if(_0x40daec>=_0x15d94e){_0x40daec=_0x15d94e;_0x5a0406=0xc8;}else{_0x5a0406=0xce;}_0x460299[_0x11ab('0x2e')](_0x5a0406);return _0x460299[_0x11ab('0x34')](_0x11ab('0x35'),_0x166e4b+'-'+_0x40daec+'/'+_0x15d94e)['json'](_0x1c6ee8);}return null;};}function patchUpdates(_0x500ac3){return function(_0x613df9){try{jsonpatch[_0x11ab('0x36')](_0x613df9,_0x500ac3,!![]);}catch(_0x4f6561){return BPromise['reject'](_0x4f6561);}return _0x613df9[_0x11ab('0x37')]();};}function saveUpdates(_0x48869a,_0x27cf40){return function(_0x282de4){if(_0x282de4){return _0x282de4[_0x11ab('0x38')](_0x48869a)['then'](function(_0x58584b){return _0x58584b;});}return null;};}function removeEntity(_0x36e7b3,_0x40ddcf){return function(_0x4dd0be){if(_0x4dd0be){return _0x4dd0be[_0x11ab('0x39')]()[_0x11ab('0x21')](function(){var _0xf3a9bc=_0x4dd0be[_0x11ab('0x3a')]({'plain':!![]});var _0x28f08c='FaxAccounts';return db[_0x11ab('0x3b')][_0x11ab('0x39')]({'where':{'type':_0x28f08c,'resourceId':_0xf3a9bc['id']}})[_0x11ab('0x21')](function(){return _0x4dd0be;});})[_0x11ab('0x21')](function(){_0x36e7b3[_0x11ab('0x2e')](0xcc)[_0x11ab('0x3c')]();});}};}function handleEntityNotFound(_0x8938ff,_0x38a482){return function(_0x3d10bc){if(!_0x3d10bc){_0x8938ff['sendStatus'](0x194);}return _0x3d10bc;};}function handleError(_0x5d7e98,_0x63cbda){_0x63cbda=_0x63cbda||0x1f4;return function(_0x55be16){logger[_0x11ab('0x27')](_0x55be16[_0x11ab('0x3d')]);if(_0x55be16[_0x11ab('0x3e')]){delete _0x55be16[_0x11ab('0x3e')];}_0x5d7e98[_0x11ab('0x2e')](_0x63cbda)[_0x11ab('0x3f')](_0x55be16);};}exports[_0x11ab('0x40')]=function(_0x2b75c3,_0x3c1648){var _0x4b2082={'include':[{'model':db[_0x11ab('0x41')],'as':_0x11ab('0x42')}]},_0x5aaa75={},_0x4a3a9e={'count':0x0,'rows':[]};var _0x6b4093=_[_0x11ab('0x43')](db[_0x11ab('0x44')]['rawAttributes'],function(_0x34562d){return{'name':_0x34562d[_0x11ab('0x45')],'type':_0x34562d['type']['key']};});_0x5aaa75[_0x11ab('0x46')]=_[_0x11ab('0x43')](_0x6b4093,_0x11ab('0x3e'));_0x5aaa75[_0x11ab('0x47')]=_['keys'](_0x2b75c3[_0x11ab('0x47')]);_0x5aaa75[_0x11ab('0x48')]=_['intersection'](_0x5aaa75[_0x11ab('0x46')],_0x5aaa75['query']);_0x4b2082['attributes']=_['intersection'](_0x5aaa75[_0x11ab('0x46')],qs[_0x11ab('0x49')](_0x2b75c3[_0x11ab('0x47')][_0x11ab('0x49')]));_0x4b2082[_0x11ab('0x4a')]=_0x4b2082['attributes'][_0x11ab('0x4b')]?_0x4b2082['attributes']:_0x5aaa75[_0x11ab('0x46')];if(!_0x2b75c3[_0x11ab('0x47')][_0x11ab('0x4c')](_0x11ab('0x4d'))){_0x4b2082['limit']=qs[_0x11ab('0x33')](_0x2b75c3[_0x11ab('0x47')][_0x11ab('0x33')]);_0x4b2082['offset']=qs['offset'](_0x2b75c3['query'][_0x11ab('0x30')]);}_0x4b2082[_0x11ab('0x4e')]=qs[_0x11ab('0x4f')](_0x2b75c3[_0x11ab('0x47')][_0x11ab('0x4f')]);_0x4b2082[_0x11ab('0x50')]=qs['filters'](_[_0x11ab('0x51')](_0x2b75c3[_0x11ab('0x47')],_0x5aaa75['filters']),_0x6b4093);if(_0x2b75c3[_0x11ab('0x47')][_0x11ab('0x52')]){_0x4b2082[_0x11ab('0x50')]=_[_0x11ab('0x53')](_0x4b2082[_0x11ab('0x50')],{'$or':_[_0x11ab('0x43')](_0x6b4093,function(_0x1f392c){if(_0x1f392c[_0x11ab('0x54')]!==_0x11ab('0x55')){var _0xcaff51={};_0xcaff51[_0x1f392c[_0x11ab('0x3e')]]={'$like':'%'+_0x2b75c3[_0x11ab('0x47')]['filter']+'%'};return _0xcaff51;}})});}_0x4b2082=_[_0x11ab('0x53')]({},_0x4b2082,_0x2b75c3[_0x11ab('0x56')]);var _0x32ad2e={'where':_0x4b2082[_0x11ab('0x50')]};return db['FaxAccount'][_0x11ab('0x32')](_0x32ad2e)[_0x11ab('0x21')](function(_0x1c596a){_0x4a3a9e[_0x11ab('0x32')]=_0x1c596a;if(_0x2b75c3[_0x11ab('0x47')][_0x11ab('0x57')]){_0x4b2082['include']=[{'all':!![]}];}return db['FaxAccount'][_0x11ab('0x58')](_0x4b2082);})[_0x11ab('0x21')](function(_0x9ae581){_0x4a3a9e[_0x11ab('0x59')]=_0x9ae581;return _0x4a3a9e;})[_0x11ab('0x21')](respondWithFilteredResult(_0x3c1648,_0x4b2082))['catch'](handleError(_0x3c1648,null));};exports[_0x11ab('0x5a')]=function(_0x2da1d4,_0x5e0b41){var _0x4c67f9={'raw':![],'where':{'id':_0x2da1d4[_0x11ab('0x5b')]['id']},'include':[{'model':db[_0x11ab('0x41')],'as':_0x11ab('0x42')}]},_0x3947b2={};_0x3947b2[_0x11ab('0x46')]=_[_0x11ab('0x5c')](db[_0x11ab('0x44')][_0x11ab('0x5d')]);_0x3947b2[_0x11ab('0x47')]=_[_0x11ab('0x5c')](_0x2da1d4['query']);_0x3947b2[_0x11ab('0x48')]=_['intersection'](_0x3947b2[_0x11ab('0x46')],_0x3947b2[_0x11ab('0x47')]);_0x4c67f9[_0x11ab('0x4a')]=_[_0x11ab('0x5e')](_0x3947b2[_0x11ab('0x46')],qs[_0x11ab('0x49')](_0x2da1d4[_0x11ab('0x47')][_0x11ab('0x49')]));_0x4c67f9[_0x11ab('0x4a')]=_0x4c67f9[_0x11ab('0x4a')][_0x11ab('0x4b')]?_0x4c67f9[_0x11ab('0x4a')]:_0x3947b2['model'];if(_0x2da1d4['query'][_0x11ab('0x57')]){_0x4c67f9[_0x11ab('0x5f')]=[{'all':!![]}];}_0x4c67f9=_[_0x11ab('0x53')]({},_0x4c67f9,_0x2da1d4[_0x11ab('0x56')]);return db[_0x11ab('0x44')][_0x11ab('0x60')](_0x4c67f9)[_0x11ab('0x21')](handleEntityNotFound(_0x5e0b41,null))['then'](respondWithResult(_0x5e0b41,null))[_0x11ab('0x2c')](handleError(_0x5e0b41,null));};exports[_0x11ab('0x61')]=function(_0x3ba229,_0x71d4c4){return db[_0x11ab('0x44')][_0x11ab('0x61')](_0x3ba229['body'],{})['then'](function(_0x28965e){var _0x6ad82c=_0x3ba229[_0x11ab('0x62')][_0x11ab('0x3a')]({'plain':!![]});if(!_0x6ad82c)throw new Error(_0x11ab('0x63'));if(_0x6ad82c[_0x11ab('0x64')]===_0x11ab('0x62')){var _0x20b319=_0x28965e[_0x11ab('0x3a')]({'plain':!![]});var _0x36d6b0='FaxAccounts';return db[_0x11ab('0x65')][_0x11ab('0x60')]({'where':{'name':_0x36d6b0,'userProfileId':_0x6ad82c[_0x11ab('0x66')]},'raw':!![]})[_0x11ab('0x21')](function(_0xd23198){if(_0xd23198&&_0xd23198[_0x11ab('0x67')]===0x0){return db['UserProfileResource'][_0x11ab('0x61')]({'name':_0x20b319[_0x11ab('0x3e')],'resourceId':_0x20b319['id'],'type':_0xd23198['name'],'sectionId':_0xd23198['id']},{})['then'](function(){return _0x28965e;});}else{return _0x28965e;}})[_0x11ab('0x2c')](function(_0x27d934){logger[_0x11ab('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27d934);throw _0x27d934;});}return _0x28965e;})[_0x11ab('0x21')](respondWithResult(_0x71d4c4,0xc9))['catch'](handleError(_0x71d4c4,null));};exports['update']=function(_0x2e8c18,_0x5d1fd0){if(_0x2e8c18[_0x11ab('0x68')]['id']){delete _0x2e8c18[_0x11ab('0x68')]['id'];}return db[_0x11ab('0x44')][_0x11ab('0x60')]({'where':{'id':_0x2e8c18['params']['id']},'include':[{'model':db[_0x11ab('0x41')],'as':_0x11ab('0x42')}]})['then'](handleEntityNotFound(_0x5d1fd0,null))[_0x11ab('0x21')](saveUpdates(_0x2e8c18[_0x11ab('0x68')],null))[_0x11ab('0x21')](respondWithResult(_0x5d1fd0,null))[_0x11ab('0x2c')](handleError(_0x5d1fd0,null));};exports[_0x11ab('0x39')]=function(_0x4872fe,_0x2ce7cc){return db[_0x11ab('0x44')]['find']({'where':{'id':_0x4872fe[_0x11ab('0x5b')]['id']}})[_0x11ab('0x21')](handleEntityNotFound(_0x2ce7cc,null))[_0x11ab('0x21')](removeEntity(_0x2ce7cc,null))['catch'](handleError(_0x2ce7cc,null));};exports[_0x11ab('0x69')]=function(_0x155e11,_0x73b1e1){return db[_0x11ab('0x44')]['describe']()[_0x11ab('0x21')](respondWithResult(_0x73b1e1,null))['catch'](handleError(_0x73b1e1,null));};exports[_0x11ab('0x6a')]=function(_0x49f26b,_0x3c2c72,_0x274c93){if(_0x49f26b[_0x11ab('0x68')]['id']){delete _0x49f26b['body']['id'];}return db['FaxAccount']['find']({'where':{'id':_0x49f26b[_0x11ab('0x5b')]['id']}})[_0x11ab('0x21')](handleEntityNotFound(_0x3c2c72,null))[_0x11ab('0x21')](function(_0x268a05){if(_0x268a05){_0x49f26b[_0x11ab('0x68')][_0x11ab('0x6b')]=_0x268a05['id'];return db[_0x11ab('0x6c')][_0x11ab('0x61')](_0x49f26b[_0x11ab('0x68')]);}})[_0x11ab('0x21')](respondWithResult(_0x3c2c72,null))['catch'](handleError(_0x3c2c72,null));};exports[_0x11ab('0x6d')]=function(_0x4960d9,_0x45f0e5,_0x18fb85){var _0x3077b7={'raw':![],'where':{}};var _0x21617b={};var _0x39c071={'count':0x0,'rows':[]};return db[_0x11ab('0x44')][_0x11ab('0x6e')]({'where':{'id':_0x4960d9[_0x11ab('0x5b')]['id']}})['then'](handleEntityNotFound(_0x45f0e5,null))[_0x11ab('0x21')](function(_0x2b4aba){if(_0x2b4aba){_0x21617b['model']=_[_0x11ab('0x5c')](db[_0x11ab('0x6c')][_0x11ab('0x5d')]);_0x21617b['query']=_['keys'](_0x4960d9[_0x11ab('0x47')]);_0x21617b[_0x11ab('0x48')]=_[_0x11ab('0x5e')](_0x21617b[_0x11ab('0x46')],_0x21617b[_0x11ab('0x47')]);_0x3077b7['attributes']=_[_0x11ab('0x5e')](_0x21617b[_0x11ab('0x46')],qs['fields'](_0x4960d9[_0x11ab('0x47')][_0x11ab('0x49')]));_0x3077b7[_0x11ab('0x4a')]=_0x3077b7[_0x11ab('0x4a')]['length']?_0x3077b7[_0x11ab('0x4a')]:_0x21617b[_0x11ab('0x46')];if(!_0x4960d9[_0x11ab('0x47')][_0x11ab('0x4c')]('nolimit')){_0x3077b7[_0x11ab('0x33')]=qs[_0x11ab('0x33')](_0x4960d9[_0x11ab('0x47')][_0x11ab('0x33')]);_0x3077b7[_0x11ab('0x30')]=qs[_0x11ab('0x30')](_0x4960d9[_0x11ab('0x47')][_0x11ab('0x30')]);}_0x3077b7['order']=qs[_0x11ab('0x4f')](_0x4960d9[_0x11ab('0x47')][_0x11ab('0x4f')]);_0x3077b7[_0x11ab('0x50')]=qs[_0x11ab('0x48')](_[_0x11ab('0x51')](_0x4960d9[_0x11ab('0x47')],_0x21617b[_0x11ab('0x48')]));_0x3077b7['where'][_0x11ab('0x6b')]=_0x2b4aba['id'];if(_0x4960d9[_0x11ab('0x47')][_0x11ab('0x52')]){_0x3077b7[_0x11ab('0x50')]=_[_0x11ab('0x53')](_0x3077b7[_0x11ab('0x50')],{'$or':_[_0x11ab('0x43')](_0x3077b7[_0x11ab('0x4a')],function(_0x358802){var _0x5c902f={};_0x5c902f[_0x358802]={'$like':'%'+_0x4960d9[_0x11ab('0x47')][_0x11ab('0x52')]+'%'};return _0x5c902f;})});}_0x3077b7=_[_0x11ab('0x53')]({},_0x3077b7,_0x4960d9[_0x11ab('0x56')]);return db[_0x11ab('0x6c')][_0x11ab('0x32')]({'where':_0x3077b7[_0x11ab('0x50')]})[_0x11ab('0x21')](function(_0x33273c){_0x39c071[_0x11ab('0x32')]=_0x33273c;if(_0x4960d9[_0x11ab('0x47')][_0x11ab('0x57')]){_0x3077b7['include']=[{'all':!![]}];}return db['Disposition'][_0x11ab('0x58')](_0x3077b7);})[_0x11ab('0x21')](function(_0x4c0b73){_0x39c071[_0x11ab('0x59')]=_0x4c0b73;return _0x39c071;});}})[_0x11ab('0x21')](respondWithFilteredResult(_0x45f0e5,_0x3077b7))[_0x11ab('0x2c')](handleError(_0x45f0e5,null));};exports[_0x11ab('0x6f')]=function(_0x19620a,_0x23f001,_0x200601){return db[_0x11ab('0x44')][_0x11ab('0x60')]({'where':{'id':_0x19620a[_0x11ab('0x5b')]['id']}})[_0x11ab('0x21')](handleEntityNotFound(_0x23f001,null))[_0x11ab('0x21')](function(_0x8a3635){if(_0x8a3635){return _0x8a3635[_0x11ab('0x6f')](_0x19620a[_0x11ab('0x47')][_0x11ab('0x70')]);}})[_0x11ab('0x21')](respondWithStatusCode(_0x23f001,null))['catch'](handleError(_0x23f001,null));};exports[_0x11ab('0x71')]=function(_0x1bcde7,_0x5a7db5,_0x26d4b4){if(_0x1bcde7[_0x11ab('0x68')]['id']){delete _0x1bcde7[_0x11ab('0x68')]['id'];}return db[_0x11ab('0x44')][_0x11ab('0x60')]({'where':{'id':_0x1bcde7[_0x11ab('0x5b')]['id']}})[_0x11ab('0x21')](handleEntityNotFound(_0x5a7db5,null))['then'](function(_0x22f1cc){if(_0x22f1cc){_0x1bcde7['body']['FaxAccountId']=_0x22f1cc['id'];return db['CannedAnswer'][_0x11ab('0x61')](_0x1bcde7[_0x11ab('0x68')]);}})[_0x11ab('0x21')](respondWithResult(_0x5a7db5,null))[_0x11ab('0x2c')](handleError(_0x5a7db5,null));};exports[_0x11ab('0x72')]=function(_0x37efa3,_0x3bb188,_0x283ee9){var _0x44b4d9={'raw':![],'where':{}};var _0x56cca7={};var _0x2f7df6={'count':0x0,'rows':[]};return db[_0x11ab('0x44')][_0x11ab('0x6e')]({'where':{'id':_0x37efa3[_0x11ab('0x5b')]['id']}})[_0x11ab('0x21')](handleEntityNotFound(_0x3bb188,null))[_0x11ab('0x21')](function(_0x1ffa23){if(_0x1ffa23){_0x56cca7['model']=_[_0x11ab('0x5c')](db[_0x11ab('0x73')][_0x11ab('0x5d')]);_0x56cca7[_0x11ab('0x47')]=_['keys'](_0x37efa3['query']);_0x56cca7[_0x11ab('0x48')]=_[_0x11ab('0x5e')](_0x56cca7[_0x11ab('0x46')],_0x56cca7['query']);_0x44b4d9[_0x11ab('0x4a')]=_[_0x11ab('0x5e')](_0x56cca7[_0x11ab('0x46')],qs[_0x11ab('0x49')](_0x37efa3['query']['fields']));_0x44b4d9[_0x11ab('0x4a')]=_0x44b4d9[_0x11ab('0x4a')][_0x11ab('0x4b')]?_0x44b4d9['attributes']:_0x56cca7[_0x11ab('0x46')];if(!_0x37efa3['query'][_0x11ab('0x4c')](_0x11ab('0x4d'))){_0x44b4d9[_0x11ab('0x33')]=qs[_0x11ab('0x33')](_0x37efa3['query']['limit']);_0x44b4d9[_0x11ab('0x30')]=qs[_0x11ab('0x30')](_0x37efa3[_0x11ab('0x47')][_0x11ab('0x30')]);}_0x44b4d9[_0x11ab('0x4e')]=qs[_0x11ab('0x4f')](_0x37efa3['query'][_0x11ab('0x4f')]);_0x44b4d9[_0x11ab('0x50')]=qs[_0x11ab('0x48')](_[_0x11ab('0x51')](_0x37efa3['query'],_0x56cca7['filters']));_0x44b4d9['where']['FaxAccountId']=_0x1ffa23['id'];if(_0x37efa3[_0x11ab('0x47')][_0x11ab('0x52')]){_0x44b4d9[_0x11ab('0x50')]=_[_0x11ab('0x53')](_0x44b4d9[_0x11ab('0x50')],{'$or':_['map'](_0x44b4d9[_0x11ab('0x4a')],function(_0x374e4e){var _0x3ca35a={};_0x3ca35a[_0x374e4e]={'$like':'%'+_0x37efa3[_0x11ab('0x47')][_0x11ab('0x52')]+'%'};return _0x3ca35a;})});}_0x44b4d9=_['merge']({},_0x44b4d9,_0x37efa3[_0x11ab('0x56')]);return db['CannedAnswer'][_0x11ab('0x32')]({'where':_0x44b4d9[_0x11ab('0x50')]})['then'](function(_0x10ed13){_0x2f7df6[_0x11ab('0x32')]=_0x10ed13;if(_0x37efa3['query'][_0x11ab('0x57')]){_0x44b4d9[_0x11ab('0x5f')]=[{'all':!![]}];}return db[_0x11ab('0x73')][_0x11ab('0x58')](_0x44b4d9);})[_0x11ab('0x21')](function(_0x29f4cd){_0x2f7df6[_0x11ab('0x59')]=_0x29f4cd;return _0x2f7df6;});}})[_0x11ab('0x21')](respondWithFilteredResult(_0x3bb188,_0x44b4d9))[_0x11ab('0x2c')](handleError(_0x3bb188,null));};exports[_0x11ab('0x74')]=function(_0x47e8aa,_0x507404,_0x1ec59d){return db[_0x11ab('0x44')][_0x11ab('0x60')]({'where':{'id':_0x47e8aa[_0x11ab('0x5b')]['id']}})['then'](handleEntityNotFound(_0x507404,null))[_0x11ab('0x21')](function(_0x8095db){if(_0x8095db){return _0x8095db[_0x11ab('0x74')](_0x47e8aa[_0x11ab('0x47')][_0x11ab('0x70')]);}})[_0x11ab('0x21')](respondWithStatusCode(_0x507404,null))[_0x11ab('0x2c')](handleError(_0x507404,null));};exports[_0x11ab('0x75')]=function(_0x553655,_0x47487a,_0x1db7a6){return db[_0x11ab('0x76')][_0x11ab('0x60')]({'where':{'id':_0x553655[_0x11ab('0x5b')]['id']}})[_0x11ab('0x21')](handleEntityNotFound(_0x47487a,null))[_0x11ab('0x21')](function(_0xdc9897){if(_0xdc9897){return _0xdc9897[_0x11ab('0x75')](_0x553655[_0x11ab('0x68')][_0x11ab('0x70')],_[_0x11ab('0x77')](_0x553655[_0x11ab('0x68')],[_0x11ab('0x70'),'id'])||{});}})[_0x11ab('0x21')](respondWithResult(_0x47487a,null))[_0x11ab('0x2c')](handleError(_0x47487a,null));};exports['getInteractions']=function(_0x35f3ff,_0x57d613,_0x14d790){var _0x13a23d={'raw':![],'where':{}};var _0x290448={};var _0x19f122={'count':0x0,'rows':[]};return db[_0x11ab('0x44')][_0x11ab('0x6e')]({'where':{'id':_0x35f3ff[_0x11ab('0x5b')]['id']}})[_0x11ab('0x21')](handleEntityNotFound(_0x57d613,null))['then'](function(_0x2a9cd9){if(_0x2a9cd9){_0x290448['model']=_[_0x11ab('0x5c')](db[_0x11ab('0x76')]['rawAttributes']);_0x290448[_0x11ab('0x47')]=_[_0x11ab('0x5c')](_0x35f3ff[_0x11ab('0x47')]);_0x290448[_0x11ab('0x48')]=_[_0x11ab('0x5e')](_0x290448[_0x11ab('0x46')],_0x290448['query']);_0x13a23d[_0x11ab('0x4a')]=_[_0x11ab('0x5e')](_0x290448[_0x11ab('0x46')],qs[_0x11ab('0x49')](_0x35f3ff[_0x11ab('0x47')]['fields']));_0x13a23d[_0x11ab('0x4a')]=_0x13a23d[_0x11ab('0x4a')]['length']?_0x13a23d['attributes']:_0x290448[_0x11ab('0x46')];if(!_0x35f3ff[_0x11ab('0x47')][_0x11ab('0x4c')](_0x11ab('0x4d'))){_0x13a23d[_0x11ab('0x33')]=qs[_0x11ab('0x33')](_0x35f3ff['query']['limit']);_0x13a23d[_0x11ab('0x30')]=qs[_0x11ab('0x30')](_0x35f3ff['query'][_0x11ab('0x30')]);}_0x13a23d[_0x11ab('0x4e')]=qs[_0x11ab('0x4f')](_0x35f3ff['query'][_0x11ab('0x4f')]);_0x13a23d[_0x11ab('0x50')]=qs[_0x11ab('0x48')](_[_0x11ab('0x51')](_0x35f3ff[_0x11ab('0x47')],_0x290448[_0x11ab('0x48')]));_0x13a23d[_0x11ab('0x50')]['FaxAccountId']=_0x2a9cd9['id'];if(_0x35f3ff[_0x11ab('0x47')][_0x11ab('0x52')]){_0x13a23d['where']=_[_0x11ab('0x53')](_0x13a23d[_0x11ab('0x50')],{'$or':_[_0x11ab('0x43')](_0x13a23d[_0x11ab('0x4a')],function(_0x5cf0d0){var _0x22cc9d={};_0x22cc9d[_0x5cf0d0]={'$like':'%'+_0x35f3ff[_0x11ab('0x47')][_0x11ab('0x52')]+'%'};return _0x22cc9d;})});}_0x13a23d=_[_0x11ab('0x53')]({},_0x13a23d,_0x35f3ff[_0x11ab('0x56')]);return db['FaxInteraction']['count']({'where':_0x13a23d[_0x11ab('0x50')]})[_0x11ab('0x21')](function(_0x1057a0){_0x19f122[_0x11ab('0x32')]=_0x1057a0;if(_0x35f3ff[_0x11ab('0x47')]['includeAll']){_0x13a23d[_0x11ab('0x5f')]=[{'model':db[_0x11ab('0x78')],'as':_0x11ab('0x79'),'required':![]},{'model':db[_0x11ab('0x7a')],'as':'Owner','attributes':[_0x11ab('0x3e'),_0x11ab('0x7b'),_0x11ab('0x7c')],'required':![]},{'model':db[_0x11ab('0x7d')],'as':_0x11ab('0x7e'),'attributes':['id',_0x11ab('0x3e'),_0x11ab('0x7f')],'where':_0x35f3ff[_0x11ab('0x47')]['tag']?{'id':_0x35f3ff[_0x11ab('0x47')][_0x11ab('0x80')]}:undefined,'required':_0x35f3ff[_0x11ab('0x47')][_0x11ab('0x80')]?!![]:![]}];}return db['FaxInteraction'][_0x11ab('0x58')](_0x13a23d);})[_0x11ab('0x21')](function(_0x35348f){_0x19f122[_0x11ab('0x59')]=_0x35348f;return _0x19f122;});}})['then'](respondWithFilteredResult(_0x57d613,_0x13a23d))[_0x11ab('0x2c')](handleError(_0x57d613,null));};exports[_0x11ab('0x81')]=function(_0x13967e,_0xcd9eef){var _0x34fc48=_0x13967e[_0x11ab('0x5b')]['id'];var _0x23ef23=_0x13967e['body'];var _0x5c1f56=0xc8;var _0xd0a065=null;return db[_0x11ab('0x82')][_0x11ab('0x83')]({'isolationLevel':db[_0x11ab('0x82')][_0x11ab('0x84')][_0x11ab('0x85')]['READ_COMMITTED']},function(_0x458b85){return db['FaxAccount'][_0x11ab('0x6e')]({'where':{'id':_0x34fc48},'transaction':_0x458b85})[_0x11ab('0x21')](function(_0x3deee6){if(_0x3deee6){return db[_0x11ab('0x86')][_0x11ab('0x39')]({'where':{'FaxAccountId':_0x34fc48},'transaction':_0x458b85})[_0x11ab('0x21')](function(){var _0x215a69=_[_0x11ab('0x43')](_0x23ef23,function(_0xc7dd18){_0xc7dd18[_0x11ab('0x6b')]=_0x34fc48;return _0xc7dd18;});return db[_0x11ab('0x86')]['bulkCreate'](_0x215a69,{'transaction':_0x458b85});});}else{_0x5c1f56=0x194;_0xd0a065=[];}});})['then'](function(){if(_0x5c1f56!==0x194){return db[_0x11ab('0x86')][_0x11ab('0x87')]({'where':{'FaxAccountId':_0x34fc48},'order':'priority'})[_0x11ab('0x21')](function(_0x380943){_0xd0a065=_0x380943;});}})[_0x11ab('0x2c')](function(_0x121ec9){_0x5c1f56=0x1f4;logger['error'](_0x121ec9[_0x11ab('0x3d')]);if(_0x121ec9[_0x11ab('0x3e')]){delete _0x121ec9[_0x11ab('0x3e')];}_0xd0a065=_0x121ec9;})[_0x11ab('0x88')](function(){if(_0xd0a065===null){_0xcd9eef[_0x11ab('0x2d')](_0x5c1f56);}else{if(_0x5c1f56===0x1f4){_0xcd9eef[_0x11ab('0x2e')](_0x5c1f56)['send'](_0xd0a065);}else{_0xcd9eef[_0x11ab('0x2e')](_0x5c1f56)[_0x11ab('0x2f')](_0xd0a065);}}});};exports[_0x11ab('0x89')]=function(_0x120f13,_0x24e834,_0x2461d2){var _0x292a6f={};var _0x5a49f1={};var _0x5a53f2;var _0x16dafd;return db['FaxAccount'][_0x11ab('0x6e')]({'where':{'id':_0x120f13[_0x11ab('0x5b')]['id']}})[_0x11ab('0x21')](handleEntityNotFound(_0x24e834,null))[_0x11ab('0x21')](function(_0x3e3924){if(_0x3e3924){_0x5a53f2=_0x3e3924;_0x5a49f1['model']=_[_0x11ab('0x5c')](db[_0x11ab('0x86')][_0x11ab('0x5d')]);_0x5a49f1[_0x11ab('0x47')]=_[_0x11ab('0x5c')](_0x120f13[_0x11ab('0x47')]);_0x5a49f1['filters']=_[_0x11ab('0x5e')](_0x5a49f1[_0x11ab('0x46')],_0x5a49f1[_0x11ab('0x47')]);_0x292a6f[_0x11ab('0x4a')]=_[_0x11ab('0x5e')](_0x5a49f1['model'],qs[_0x11ab('0x49')](_0x120f13[_0x11ab('0x47')][_0x11ab('0x49')]));_0x292a6f[_0x11ab('0x4a')]=_0x292a6f['attributes'][_0x11ab('0x4b')]?_0x292a6f[_0x11ab('0x4a')]:_0x5a49f1[_0x11ab('0x46')];_0x292a6f['order']=qs['sort'](_0x120f13[_0x11ab('0x47')][_0x11ab('0x4f')]);_0x292a6f[_0x11ab('0x50')]=qs[_0x11ab('0x48')](_[_0x11ab('0x51')](_0x120f13[_0x11ab('0x47')],_0x5a49f1[_0x11ab('0x48')]));if(_0x120f13[_0x11ab('0x47')][_0x11ab('0x52')]){_0x292a6f['where']=_[_0x11ab('0x53')](_0x292a6f['where'],{'$or':_[_0x11ab('0x43')](_0x292a6f[_0x11ab('0x4a')],function(_0x1909f9){var _0x5e7536={};_0x5e7536[_0x1909f9]={'$like':'%'+_0x120f13[_0x11ab('0x47')][_0x11ab('0x52')]+'%'};return _0x5e7536;})});}_0x292a6f=_['merge']({},_0x292a6f,_0x120f13[_0x11ab('0x56')]);return _0x5a53f2[_0x11ab('0x89')](_0x292a6f);}})[_0x11ab('0x21')](function(_0x90224a){if(_0x90224a){_0x16dafd=_0x90224a[_0x11ab('0x4b')];if(!_0x120f13[_0x11ab('0x47')][_0x11ab('0x4c')](_0x11ab('0x4d'))){_0x292a6f[_0x11ab('0x33')]=qs[_0x11ab('0x33')](_0x120f13[_0x11ab('0x47')][_0x11ab('0x33')]);_0x292a6f[_0x11ab('0x30')]=qs['offset'](_0x120f13[_0x11ab('0x47')]['offset']);}return _0x5a53f2[_0x11ab('0x89')](_0x292a6f);}})['then'](function(_0x3cd97e){if(_0x3cd97e){return _0x3cd97e?{'count':_0x16dafd,'rows':_0x3cd97e}:null;}})[_0x11ab('0x21')](respondWithResult(_0x24e834,null))[_0x11ab('0x2c')](handleError(_0x24e834,null));};function Extension(_0x34506c,_0x38b472,_0x362fb1,_0x541d5e){this[_0x11ab('0x8a')]=_0x11ab('0x8b');this[_0x11ab('0x8c')]=_0x34506c[_0x11ab('0x8d')];this[_0x11ab('0x8e')]=_0x541d5e;this[_0x11ab('0x54')]='system';this['description']=_0x11ab('0x8f');this['FaxAccountId']=_0x34506c['id'];this['priority']=_0x38b472;this[_0x11ab('0x90')]=_0x362fb1;}function createExtensionsReciveFax(_0x23f0c3){var _0x508132=0x1;var _0x3a4e90=[];_0x3a4e90[_0x11ab('0x91')](new Extension(_0x23f0c3,_0x508132,'',_0x11ab('0x92')));_0x508132+=0x1;_0x3a4e90[_0x11ab('0x91')](new Extension(_0x23f0c3,_0x508132,_0x11ab('0x93'),_0x11ab('0x94')));_0x508132+=0x1;for(var _0x1db91b in _0x23f0c3){if(_0x23f0c3[_0x11ab('0x4c')](_0x1db91b)&&(_0x1db91b===_0x11ab('0x95')||_0x1db91b===_0x11ab('0x8d')||_0x1db91b===_0x11ab('0x96')||_0x1db91b===_0x11ab('0x97')||_0x1db91b===_0x11ab('0x98')||_0x1db91b===_0x11ab('0x99')||_0x1db91b===_0x11ab('0x9a')||_0x1db91b==='modem'||_0x1db91b===_0x11ab('0x9b'))){_0x3a4e90[_0x11ab('0x91')](new Extension(_0x23f0c3,_0x508132,_0x11ab('0x9c')+_0x1db91b+')='+_0x23f0c3[_0x1db91b],_0x11ab('0x94')));_0x508132+=0x1;}}_0x3a4e90[_0x11ab('0x91')](new Extension(_0x23f0c3,_0x508132,'6','Wait'));_0x508132+=0x1;_0x3a4e90[_0x11ab('0x91')](new Extension(_0x23f0c3,_0x508132,_0x11ab('0x9d'),_0x11ab('0x9e')));_0x508132=0x0;return _0x3a4e90;}exports[_0x11ab('0x9f')]=function(_0x2ee28c,_0x53c39a,_0x46aefd){var _0x5745f2;return db[_0x11ab('0x82')]['transaction'](function(_0x4f29b7){return db['FaxAccount'][_0x11ab('0x61')](_0x2ee28c[_0x11ab('0x68')],{'transaction':_0x4f29b7})[_0x11ab('0x21')](function(_0x539829){_0x5745f2=_0x539829[_0x11ab('0x3a')]({'plain':!![]});return db[_0x11ab('0xa0')][_0x11ab('0xa1')](createExtensionsReciveFax(_0x5745f2),{'transaction':_0x4f29b7});});})['then'](function(){return _0x5745f2;})[_0x11ab('0x21')](respondWithResult(_0x53c39a,null))[_0x11ab('0x2c')](handleError(_0x53c39a,null));};exports[_0x11ab('0xa2')]=function(_0x550dd5,_0x1de756,_0x261f4d){var _0x1a52b8;return db[_0x11ab('0x82')][_0x11ab('0x83')](function(_0x25a6af){return db['FaxAccount'][_0x11ab('0x38')](_0x550dd5[_0x11ab('0x68')],{'where':{'id':_0x550dd5[_0x11ab('0x68')]['id']},'transaction':_0x25a6af})['then'](function(_0x3507cd){return db[_0x11ab('0xa0')][_0x11ab('0x39')]({'where':{'FaxAccountId':_0x550dd5[_0x11ab('0x68')]['id']},'transaction':_0x25a6af})[_0x11ab('0x21')](function(_0x4c1ddb){return db[_0x11ab('0xa0')][_0x11ab('0xa1')](createExtensionsReciveFax(_['omit'](_0x550dd5['body'],[_0x11ab('0xa3'),_0x11ab('0xa4'),_0x11ab('0xa5'),_0x11ab('0xa6'),_0x11ab('0xa7'),_0x11ab('0xa8')])),{'transaction':_0x25a6af});});});})[_0x11ab('0x21')](function(){return db[_0x11ab('0x44')]['findById'](_0x550dd5['body']['id']);})[_0x11ab('0x21')](respondWithResult(_0x1de756,null))[_0x11ab('0x2c')](handleError(_0x1de756,null));};exports['getMessages']=function(_0x5137ba,_0x4853d2,_0x417172){var _0x59af84={'raw':!![],'where':{}};var _0xa46c57={};var _0x4f2c39={'count':0x0,'rows':[]};return db[_0x11ab('0x44')][_0x11ab('0x6e')]({'where':{'id':_0x5137ba[_0x11ab('0x5b')]['id']}})[_0x11ab('0x21')](handleEntityNotFound(_0x4853d2,null))['then'](function(_0x5af67f){if(_0x5af67f){_0xa46c57['model']=_[_0x11ab('0x5c')](db['FaxMessage'][_0x11ab('0x5d')]);_0xa46c57[_0x11ab('0x47')]=_[_0x11ab('0x5c')](_0x5137ba[_0x11ab('0x47')]);_0xa46c57[_0x11ab('0x48')]=_[_0x11ab('0x5e')](_0xa46c57[_0x11ab('0x46')],_0xa46c57[_0x11ab('0x47')]);_0x59af84[_0x11ab('0x4a')]=_[_0x11ab('0x5e')](_0xa46c57[_0x11ab('0x46')],qs[_0x11ab('0x49')](_0x5137ba[_0x11ab('0x47')][_0x11ab('0x49')]));_0x59af84['attributes']=_0x59af84[_0x11ab('0x4a')][_0x11ab('0x4b')]?_0x59af84['attributes']:_0xa46c57[_0x11ab('0x46')];if(!_0x5137ba[_0x11ab('0x47')][_0x11ab('0x4c')](_0x11ab('0x4d'))){_0x59af84[_0x11ab('0x33')]=qs[_0x11ab('0x33')](_0x5137ba['query'][_0x11ab('0x33')]);_0x59af84['offset']=qs[_0x11ab('0x30')](_0x5137ba['query'][_0x11ab('0x30')]);}_0x59af84[_0x11ab('0x4e')]=qs[_0x11ab('0x4f')](_0x5137ba[_0x11ab('0x47')][_0x11ab('0x4f')]);_0x59af84[_0x11ab('0x50')]=qs['filters'](_['pick'](_0x5137ba[_0x11ab('0x47')],_0xa46c57[_0x11ab('0x48')]));_0x59af84[_0x11ab('0x50')][_0x11ab('0x6b')]=_0x5af67f['id'];if(_0x5137ba[_0x11ab('0x47')][_0x11ab('0x52')]){_0x59af84[_0x11ab('0x50')]=_[_0x11ab('0x53')](_0x59af84['where'],{'$or':_[_0x11ab('0x43')](_0x59af84[_0x11ab('0x4a')],function(_0x3dece8){var _0x57a340={};_0x57a340[_0x3dece8]={'$like':'%'+_0x5137ba[_0x11ab('0x47')][_0x11ab('0x52')]+'%'};return _0x57a340;})});}if(_0x5137ba[_0x11ab('0x47')][_0x11ab('0xa9')]){var _0x2c1716=_0x5137ba[_0x11ab('0x47')]['$gte'][_0x11ab('0xaa')](',');var _0x3121b6={};_0x3121b6[_0x2c1716[0x0]]={'$gte':moment(_0x2c1716[0x1])[_0x11ab('0xab')](_0x11ab('0xac'))};_0x59af84[_0x11ab('0x50')]=_[_0x11ab('0x53')](_0x59af84[_0x11ab('0x50')],_0x3121b6);}_0x59af84=_['merge']({},_0x59af84,_0x5137ba[_0x11ab('0x56')]);return db[_0x11ab('0xad')][_0x11ab('0x32')]({'where':_0x59af84['where']})[_0x11ab('0x21')](function(_0x24f7d3){_0x4f2c39[_0x11ab('0x32')]=_0x24f7d3;if(_0x5137ba[_0x11ab('0x47')][_0x11ab('0x57')]){_0x59af84[_0x11ab('0x5f')]=[{'all':!![]}];}return db[_0x11ab('0xad')]['findAll'](_0x59af84);})[_0x11ab('0x21')](function(_0x166989){_0x4f2c39[_0x11ab('0x59')]=_0x166989;return _0x4f2c39;});}})['then'](respondWithFilteredResult(_0x4853d2,_0x59af84))[_0x11ab('0x2c')](handleError(_0x4853d2,null));};exports[_0x11ab('0x3f')]=function(_0x3f32b7,_0x10ec9e,_0x39e7a3){var _0x2cd89c,_0x2217aa={},_0x2dc005;if(_0x3f32b7[_0x11ab('0x68')]['to']){_0x2dc005=_0x3f32b7[_0x11ab('0x68')]['to'][0x0];}return db[_0x11ab('0x44')]['find']({'where':{'id':_0x3f32b7[_0x11ab('0x5b')]['id']},'include':[{'model':db[_0x11ab('0xae')],'as':_0x11ab('0xaf'),'include':[{'model':db[_0x11ab('0x78')],'as':_0x11ab('0xb0'),'where':{'fax':_0x2dc005},'limit':0x1,'order':[[_0x11ab('0xa6'),_0x11ab('0xb1')]]}]}]})[_0x11ab('0x21')](handleEntityNotFound(_0x10ec9e,null))[_0x11ab('0x21')](function(_0x11dc9b){_0x2cd89c=_0x11dc9b;if(_0x3f32b7[_0x11ab('0x68')]['attachments']&&_0x3f32b7[_0x11ab('0x68')][_0x11ab('0xb2')][_0x11ab('0x4b')]){for(var _0x146b79=0x0;_0x146b79<_0x3f32b7[_0x11ab('0x68')]['attachments'][_0x11ab('0x4b')];_0x146b79+=0x1){_0x3f32b7['body'][_0x11ab('0xb2')][_0x146b79]={'filename':_0x3f32b7[_0x11ab('0x68')]['attachments'][_0x146b79][_0x11ab('0x3e')],'id':_0x3f32b7['body'][_0x11ab('0xb2')][_0x146b79]['id'],'path':path['join'](config['root'],_0x11ab('0xb3'),_0x3f32b7[_0x11ab('0x68')][_0x11ab('0xb2')][_0x146b79][_0x11ab('0xb4')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0x11ab('0xb5')](_0x3f32b7[_0x11ab('0x5b')]['id'])?undefined:_0x3f32b7[_0x11ab('0x5b')]['id'],'path':_[_0x11ab('0xb5')](_0x3f32b7['body'][_0x11ab('0xb2')][0x0][_0x11ab('0x8')])?undefined:_0x3f32b7[_0x11ab('0x68')][_0x11ab('0xb2')][0x0][_0x11ab('0x8')],'fax':_[_0x11ab('0xb5')](_0x3f32b7[_0x11ab('0x68')]['to'][0x0])?undefined:_0x3f32b7['body']['to'][0x0]},client9002);})[_0x11ab('0x21')](function(){if(_0x2cd89c){if(_[_0x11ab('0xb5')](_0x3f32b7[_0x11ab('0x68')][_0x11ab('0xb6')])){_0x3f32b7['body'][_0x11ab('0xb6')]=util['format'](_0x11ab('0xb7'),_0x2cd89c[_0x11ab('0x3e')],_0x2cd89c['fax']);}if(_0x2cd89c['List']){if(_0x2cd89c[_0x11ab('0xaf')][_0x11ab('0xb0')][_0x11ab('0x4b')]){return _0x2cd89c[_0x11ab('0xaf')][_0x11ab('0xb0')][0x0];}else{return db[_0x11ab('0x78')][_0x11ab('0x61')](_[_0x11ab('0xb8')](_0x3f32b7[_0x11ab('0x68')],{'firstName':_0x3f32b7[_0x11ab('0x68')]['to'][0x0],'phone':_0x3f32b7[_0x11ab('0x68')]['to'][0x0],'fax':_0x3f32b7[_0x11ab('0x68')]['to'][0x0],'ListId':_0x2cd89c[_0x11ab('0xa8')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x509c3d){if(_0x509c3d){return db[_0x11ab('0x76')][_0x11ab('0x60')]({'where':{'ContactId':_0x509c3d['id'],'closed':![],'FaxAccountId':_0x2cd89c['id']}})['then'](function(_0x12e65c){if(_0x12e65c){return[_0x12e65c,![]];}return db[_0x11ab('0x76')][_0x11ab('0x61')]({'UserId':_0x3f32b7[_0x11ab('0x62')]['id'],'ContactId':_0x509c3d['id'],'FaxAccountId':_0x2cd89c['id'],'fax':_0x3f32b7[_0x11ab('0x68')]['to'][0x0],'firstMsgDirection':_0x11ab('0xb9'),'Messages':[_['merge'](_0x3f32b7['body'],{'read':![],'body':_0x3f32b7[_0x11ab('0x68')][_0x11ab('0xb2')][0x0][_0x11ab('0xba')],'FaxAccountId':_0x2cd89c['id'],'UserId':_0x3f32b7[_0x11ab('0x62')]['id'],'ContactId':_0x509c3d['id'],'AttachmentId':_0x3f32b7[_0x11ab('0x68')][_0x11ab('0xb2')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x11ab('0xbb')}]})[_0x11ab('0x21')](function(_0x44b90b){return[_0x44b90b,!![]];});});}else{throw new Error(_0x11ab('0xbc'));}})[_0x11ab('0xbd')](function(_0x53ffa6,_0x2c64b7){if(_0x2c64b7){return _0x53ffa6;}return db['FaxMessage'][_0x11ab('0x61')]({'direction':'out','read':![],'body':_0x3f32b7[_0x11ab('0x68')]['attachments'][0x0][_0x11ab('0xba')],'FaxAccountId':_0x2cd89c['id'],'FaxInteractionId':_0x53ffa6['id'],'UserId':_0x3f32b7['user']['id'],'ContactId':_0x53ffa6['ContactId'],'AttachmentId':_0x3f32b7[_0x11ab('0x68')]['attachments'][0x0]['id']})['then'](function(_0x273c31){_0x53ffa6[_0x11ab('0xbe')][_0x11ab('0xbb')]=[];_0x53ffa6['dataValues']['Messages'][_0x11ab('0x91')](_0x273c31[_0x11ab('0xbe')]);return _0x53ffa6;});})[_0x11ab('0x21')](function(_0x2205a8){respondWithRpcPromise(_0x11ab('0xbf'),'SendFax',{'FaxAccountId':_['isNil'](_0x3f32b7['params']['id'])?undefined:_0x3f32b7[_0x11ab('0x5b')]['id'],'path':_[_0x11ab('0xb5')](_0x3f32b7[_0x11ab('0x68')][_0x11ab('0xb2')][0x0][_0x11ab('0x8')])?undefined:_0x3f32b7[_0x11ab('0x68')][_0x11ab('0xb2')][0x0][_0x11ab('0x8')],'fax':_['isNil'](_0x3f32b7[_0x11ab('0x68')]['to'][0x0])?undefined:_0x3f32b7[_0x11ab('0x68')]['to'][0x0],'AttachmentId':_0x3f32b7['body'][_0x11ab('0xb2')][0x0]['id']},client9002)[_0x11ab('0x21')](function(_0x38471f){logger[_0x11ab('0x2a')](_0x11ab('0xc0'),_0x38471f);})['catch'](function(_0xacddc4){logger['info']('SendFaxRpc,\x20%s',_0xacddc4);});return _0x2205a8;})[_0x11ab('0x21')](respondWithResult(_0x10ec9e,null))[_0x11ab('0x2c')](handleError(_0x10ec9e,null));};exports[_0x11ab('0xc1')]=function(_0x2fccc1,_0x16a8f7,_0x3e57df){return db[_0x11ab('0x44')][_0x11ab('0x60')]({'where':{'id':_0x2fccc1[_0x11ab('0x5b')]['id']}})[_0x11ab('0x21')](handleEntityNotFound(_0x16a8f7,null))[_0x11ab('0x21')](function(_0x31a56e){if(_0x31a56e){return _0x31a56e[_0x11ab('0xc1')](_0x2fccc1['body'][_0x11ab('0x70')],_[_0x11ab('0x77')](_0x2fccc1[_0x11ab('0x68')],[_0x11ab('0x70'),'id'])||{})[_0x11ab('0xbd')](function(_0x2aac27){for(var _0x277261=0x0;_0x277261<_0x2fccc1[_0x11ab('0x68')][_0x11ab('0x70')][_0x11ab('0x4b')];_0x277261+=0x1){socket[_0x11ab('0xc2')](_0x11ab('0xc3'),{'UserId':Number(_0x2fccc1[_0x11ab('0x68')]['ids'][_0x277261]),'FaxAccountId':Number(_0x2fccc1[_0x11ab('0x5b')]['id'])});}return _0x2aac27;});}})[_0x11ab('0x21')](respondWithResult(_0x16a8f7,null))[_0x11ab('0x2c')](handleError(_0x16a8f7,null));};exports[_0x11ab('0xc4')]=function(_0x44759a,_0x5ae217,_0x76f60d){return db[_0x11ab('0x44')][_0x11ab('0x60')]({'where':{'id':_0x44759a['params']['id']}})['then'](handleEntityNotFound(_0x5ae217,null))[_0x11ab('0x21')](function(_0x127a1f){if(_0x127a1f){return _0x127a1f[_0x11ab('0xc4')](_0x44759a[_0x11ab('0x47')]['ids'])[_0x11ab('0x21')](function(){if(_[_0x11ab('0xc5')](_0x44759a[_0x11ab('0x47')][_0x11ab('0x70')])){for(var _0x181c6e=0x0;_0x181c6e<_0x44759a[_0x11ab('0x47')]['ids'][_0x11ab('0x4b')];_0x181c6e+=0x1){socket[_0x11ab('0xc2')](_0x11ab('0xc6'),{'UserId':Number(_0x44759a[_0x11ab('0x47')][_0x11ab('0x70')][_0x181c6e]),'FaxAccountId':Number(_0x44759a[_0x11ab('0x5b')]['id'])});}}else{socket['emit'](_0x11ab('0xc6'),{'UserId':Number(_0x44759a['query'][_0x11ab('0x70')]),'FaxAccountId':Number(_0x44759a[_0x11ab('0x5b')]['id'])});}});}})[_0x11ab('0x21')](respondWithStatusCode(_0x5ae217,null))['catch'](handleError(_0x5ae217,null));};exports[_0x11ab('0xc7')]=function(_0x568363,_0x40b4ac,_0x5c58a3){var _0x14cc44={};var _0x3d0927={};var _0x9870e6;var _0x28ae1a;return db[_0x11ab('0x44')][_0x11ab('0x6e')]({'where':{'id':_0x568363[_0x11ab('0x5b')]['id']}})[_0x11ab('0x21')](handleEntityNotFound(_0x40b4ac,null))[_0x11ab('0x21')](function(_0x32cb3b){if(_0x32cb3b){_0x9870e6=_0x32cb3b;_0x3d0927[_0x11ab('0x46')]=_[_0x11ab('0x5c')](db[_0x11ab('0x7a')][_0x11ab('0x5d')]);_0x3d0927[_0x11ab('0x47')]=_[_0x11ab('0x5c')](_0x568363[_0x11ab('0x47')]);_0x3d0927[_0x11ab('0x48')]=_['intersection'](_0x3d0927[_0x11ab('0x46')],_0x3d0927[_0x11ab('0x47')]);_0x14cc44[_0x11ab('0x4a')]=_[_0x11ab('0x5e')](_0x3d0927[_0x11ab('0x46')],qs[_0x11ab('0x49')](_0x568363[_0x11ab('0x47')][_0x11ab('0x49')]));_0x14cc44['attributes']=_0x14cc44['attributes'][_0x11ab('0x4b')]?_0x14cc44[_0x11ab('0x4a')]:_0x3d0927['model'];_0x14cc44[_0x11ab('0x4e')]=qs[_0x11ab('0x4f')](_0x568363[_0x11ab('0x47')][_0x11ab('0x4f')]);_0x14cc44[_0x11ab('0x50')]=qs[_0x11ab('0x48')](_[_0x11ab('0x51')](_0x568363[_0x11ab('0x47')],_0x3d0927[_0x11ab('0x48')]));if(_0x568363[_0x11ab('0x47')]['filter']){_0x14cc44[_0x11ab('0x50')]=_[_0x11ab('0x53')](_0x14cc44[_0x11ab('0x50')],{'$or':_[_0x11ab('0x43')](_0x14cc44[_0x11ab('0x4a')],function(_0xafc82d){var _0xef8c7f={};_0xef8c7f[_0xafc82d]={'$like':'%'+_0x568363[_0x11ab('0x47')]['filter']+'%'};return _0xef8c7f;})});}_0x14cc44=_['merge']({},_0x14cc44,_0x568363[_0x11ab('0x56')]);return _0x9870e6[_0x11ab('0xc7')](_0x14cc44);}})[_0x11ab('0x21')](function(_0x4aeeac){if(_0x4aeeac){_0x28ae1a=_0x4aeeac[_0x11ab('0x4b')];if(!_0x568363[_0x11ab('0x47')][_0x11ab('0x4c')]('nolimit')){_0x14cc44[_0x11ab('0x33')]=qs[_0x11ab('0x33')](_0x568363['query'][_0x11ab('0x33')]);_0x14cc44[_0x11ab('0x30')]=qs[_0x11ab('0x30')](_0x568363[_0x11ab('0x47')][_0x11ab('0x30')]);}return _0x9870e6[_0x11ab('0xc7')](_0x14cc44);}})[_0x11ab('0x21')](function(_0x58de71){if(_0x58de71){return _0x58de71?{'count':_0x28ae1a,'rows':_0x58de71}:null;}})['then'](respondWithResult(_0x40b4ac,null))[_0x11ab('0x2c')](handleError(_0x40b4ac,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 5377181..08db69a 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 _0xd66d=['events','FaxAccount','update','emit','hasOwnProperty','hook','exports'];(function(_0x1ed84c,_0x4f3751){var _0x2cc896=function(_0x1d75a5){while(--_0x1d75a5){_0x1ed84c['push'](_0x1ed84c['shift']());}};_0x2cc896(++_0x4f3751);}(_0xd66d,0x12d));var _0xdd66=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xd66d[_0x580647];return _0x5f0792;};'use strict';var EventEmitter=require(_0xdd66('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xdd66('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xdd66('0x2'),'afterDestroy':'remove'};function emitEvent(_0x35ec93){return function(_0xce83f7,_0x4b9c32,_0x4491b4){FaxAccountEvents[_0xdd66('0x3')](_0x35ec93+':'+_0xce83f7['id'],_0xce83f7);FaxAccountEvents[_0xdd66('0x3')](_0x35ec93,_0xce83f7);_0x4491b4(null);};}for(var e in events){if(events[_0xdd66('0x4')](e)){var event=events[e];FaxAccount[_0xdd66('0x5')](e,emitEvent(event));}}module[_0xdd66('0x6')]=FaxAccountEvents; \ No newline at end of file +var _0x93ed=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update'];(function(_0x14122b,_0x1df7c5){var _0x1b0b9d=function(_0x5e29e1){while(--_0x5e29e1){_0x14122b['push'](_0x14122b['shift']());}};_0x1b0b9d(++_0x1df7c5);}(_0x93ed,0x125));var _0xd93e=function(_0x2d5aca,_0x19beca){_0x2d5aca=_0x2d5aca-0x0;var _0x24ae42=_0x93ed[_0x2d5aca];return _0x24ae42;};'use strict';var EventEmitter=require(_0xd93e('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xd93e('0x1')](0x0);var events={'afterCreate':_0xd93e('0x2'),'afterUpdate':_0xd93e('0x3'),'afterDestroy':_0xd93e('0x4')};function emitEvent(_0x286c6d){return function(_0x26994d,_0x486f3d,_0xbc0166){FaxAccountEvents[_0xd93e('0x5')](_0x286c6d+':'+_0x26994d['id'],_0x26994d);FaxAccountEvents[_0xd93e('0x5')](_0x286c6d,_0x26994d);_0xbc0166(null);};}for(var e in events){if(events[_0xd93e('0x6')](e)){var event=events[e];FaxAccount[_0xd93e('0x7')](e,emitEvent(event));}}module[_0xd93e('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 1b1f115..e22168b 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 _0xc92c=['fax_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x2a2417,_0x28cbb6){var _0x4a0ae1=function(_0x10fe87){while(--_0x10fe87){_0x2a2417['push'](_0x2a2417['shift']());}};_0x4a0ae1(++_0x28cbb6);}(_0xc92c,0x139));var _0xcc92=function(_0x5320f0,_0x5e9601){_0x5320f0=_0x5320f0-0x0;var _0x497132=_0xc92c[_0x5320f0];return _0x497132;};'use strict';var _=require(_0xcc92('0x0'));var util=require('util');var logger=require(_0xcc92('0x1'))(_0xcc92('0x2'));var moment=require(_0xcc92('0x3'));var BPromise=require(_0xcc92('0x4'));var rp=require(_0xcc92('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcc92('0x6'));var attributes=require(_0xcc92('0x7'));module[_0xcc92('0x8')]=function(_0x3c3763,_0x3933b4){return _0x3c3763[_0xcc92('0x9')](_0xcc92('0xa'),attributes,{'tableName':_0xcc92('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa088=['../../config/environment','./faxAccount.attributes','exports','define','fax_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x21d6ff,_0xb9d12e){var _0x67f3c2=function(_0x153335){while(--_0x153335){_0x21d6ff['push'](_0x21d6ff['shift']());}};_0x67f3c2(++_0xb9d12e);}(_0xa088,0x14a));var _0x8a08=function(_0x540a19,_0x1ddfb3){_0x540a19=_0x540a19-0x0;var _0x5db5eb=_0xa088[_0x540a19];return _0x5db5eb;};'use strict';var _=require(_0x8a08('0x0'));var util=require(_0x8a08('0x1'));var logger=require(_0x8a08('0x2'))(_0x8a08('0x3'));var moment=require(_0x8a08('0x4'));var BPromise=require('bluebird');var rp=require(_0x8a08('0x5'));var fs=require('fs');var path=require(_0x8a08('0x6'));var rimraf=require(_0x8a08('0x7'));var config=require(_0x8a08('0x8'));var attributes=require(_0x8a08('0x9'));module[_0x8a08('0xa')]=function(_0x501c74,_0x13f0f5){return _0x501c74[_0x8a08('0xb')]('FaxAccount',attributes,{'tableName':_0x8a08('0xc'),'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 c014275..dc55d00 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 _0x27ad=['createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','FaxApplication','get','applications','list','priority','asc','Contacts','length','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','name','waitForTheAssignedAgent','startRouting','Start','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','difference','keys'];(function(_0x58da8a,_0x1c0584){var _0x5ba3a3=function(_0x31552b){while(--_0x31552b){_0x58da8a['push'](_0x58da8a['shift']());}};_0x5ba3a3(++_0x1c0584);}(_0x27ad,0x146));var _0xd27a=function(_0x58fca5,_0x286478){_0x58fca5=_0x58fca5-0x0;var _0x557657=_0x27ad[_0x58fca5];return _0x557657;};'use strict';var _=require(_0xd27a('0x0'));var util=require(_0xd27a('0x1'));var moment=require('moment');var BPromise=require(_0xd27a('0x2'));var rs=require(_0xd27a('0x3'));var fs=require('fs');var Redis=require(_0xd27a('0x4'));var db=require(_0xd27a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd27a('0x6'))(_0xd27a('0x7'));var config=require(_0xd27a('0x8'));var jayson=require(_0xd27a('0x9'));var client=jayson[_0xd27a('0xa')][_0xd27a('0xb')]({'port':0x232c});config['redis']=_[_0xd27a('0xc')](config[_0xd27a('0xd')],{'host':_0xd27a('0xe'),'port':0x18eb});var socket=require(_0xd27a('0xf'))(new Redis(config['redis']));require(_0xd27a('0x10'))[_0xd27a('0x11')](socket);function respondWithRpcPromise(_0x9ecab7,_0x5d43ae,_0x8ae74f){return new BPromise(function(_0x44e2fc,_0x56b595){return client[_0xd27a('0x12')](_0x9ecab7,_0x8ae74f)[_0xd27a('0x13')](function(_0x287b69){logger[_0xd27a('0x14')]('FaxAccount,\x20%s,\x20%s',_0x5d43ae,_0xd27a('0x15'));logger[_0xd27a('0x16')](_0xd27a('0x17'),_0x5d43ae,_0xd27a('0x15'),JSON[_0xd27a('0x18')](_0x287b69));if(_0x287b69['error']){if(_0x287b69[_0xd27a('0x19')][_0xd27a('0x1a')]===0x1f4){logger[_0xd27a('0x19')](_0xd27a('0x1b'),_0x5d43ae,_0x287b69[_0xd27a('0x19')]['message']);return _0x56b595(_0x287b69[_0xd27a('0x19')][_0xd27a('0x1c')]);}logger[_0xd27a('0x19')](_0xd27a('0x1b'),_0x5d43ae,_0x287b69['error'][_0xd27a('0x1c')]);return _0x44e2fc(_0x287b69[_0xd27a('0x19')]['message']);}else{logger[_0xd27a('0x14')](_0xd27a('0x1b'),_0x5d43ae,'request\x20sent');_0x44e2fc(_0x287b69[_0xd27a('0x1d')][_0xd27a('0x1c')]);}})['catch'](function(_0xced9a){logger['error'](_0xd27a('0x1b'),_0x5d43ae,_0xced9a);_0x56b595(_0xced9a);});});}exports[_0xd27a('0x1e')]=function(_0x2a6b12){var _0x269b72=this;return new Promise(function(_0x1a15ec,_0x323244){return db[_0xd27a('0x1f')][_0xd27a('0x20')]({'raw':_0x2a6b12[_0xd27a('0x21')]?_0x2a6b12[_0xd27a('0x21')][_0xd27a('0x22')]===undefined?!![]:![]:!![],'where':_0x2a6b12[_0xd27a('0x21')]?_0x2a6b12[_0xd27a('0x21')]['where']||null:null,'attributes':_0x2a6b12['options']?_0x2a6b12['options'][_0xd27a('0x23')]||null:null,'limit':_0x2a6b12[_0xd27a('0x21')]?_0x2a6b12[_0xd27a('0x21')][_0xd27a('0x24')]||null:null,'include':_0x2a6b12['options']?_0x2a6b12['options'][_0xd27a('0x25')]?_[_0xd27a('0x26')](_0x2a6b12[_0xd27a('0x21')]['include'],function(_0x25e78b){return{'model':db[_0x25e78b[_0xd27a('0x27')]],'as':_0x25e78b['as'],'attributes':_0x25e78b[_0xd27a('0x23')],'include':_0x25e78b['include']?_[_0xd27a('0x26')](_0x25e78b[_0xd27a('0x25')],function(_0x47bd98){return{'model':db[_0x47bd98['model']],'as':_0x47bd98['as'],'attributes':_0x47bd98['attributes'],'include':_0x47bd98[_0xd27a('0x25')]?_[_0xd27a('0x26')](_0x47bd98[_0xd27a('0x25')],function(_0x75922c){return{'model':db[_0x75922c[_0xd27a('0x27')]],'as':_0x75922c['as'],'attributes':_0x75922c['attributes']};}):[]};}):[]};}):[]:[]})[_0xd27a('0x13')](function(_0x9a477b){logger[_0xd27a('0x14')](_0xd27a('0x1e'),_0x2a6b12);logger[_0xd27a('0x16')]('GetFaxAccount',_0x2a6b12,JSON[_0xd27a('0x18')](_0x9a477b));_0x1a15ec(_0x9a477b);})[_0xd27a('0x28')](function(_0x5971f2){logger[_0xd27a('0x19')](_0xd27a('0x1e'),_0x5971f2[_0xd27a('0x1c')],_0x2a6b12);_0x323244(_0x269b72[_0xd27a('0x19')](0x1f4,_0x5971f2[_0xd27a('0x1c')]));});});};exports[_0xd27a('0x29')]=function(_0x180a77,_0x77c5e9,_0x2f8894){var _0x5d0546=this;return new Promise(function(_0x431c56,_0x32b3b9){var _0x55c95e={'body':_0x180a77[_0xd27a('0x2a')],'channel':_0xd27a('0x2b')};var _0x21242c=[];var _0x10bee6=[];var _0x34a619={};return db[_0xd27a('0x2c')][_0xd27a('0x2d')]()[_0xd27a('0x13')](function(_0x372053){if(!_0x372053){throw new db[(_0xd27a('0x2e'))][(_0xd27a('0x2f'))]('no\x20available\x20attributes');}_0x21242c=_[_0xd27a('0x30')](_[_0xd27a('0x31')](_0x372053),[_0xd27a('0x32'),_0xd27a('0x33')]);_0x10bee6=_[_0xd27a('0x30')](_['keys'](_0x372053),[_0xd27a('0x32'),_0xd27a('0x33'),_0xd27a('0x34'),_0xd27a('0x35')]);if(_0x180a77[_0xd27a('0x2a')]['id']){delete _0x180a77[_0xd27a('0x2a')]['id'];}if(_[_0xd27a('0x36')](_0x180a77['body'][_0xd27a('0x37')])){throw new db[(_0xd27a('0x2e'))][(_0xd27a('0x2f'))](_0xd27a('0x38'));}if(_[_0xd27a('0x36')](_0x180a77[_0xd27a('0x2a')][_0xd27a('0x2a')])||_0x180a77['body'][_0xd27a('0x2a')]===''){throw new db[(_0xd27a('0x2e'))][(_0xd27a('0x2f'))](_0xd27a('0x39'));}if(_[_0xd27a('0x36')](_0x180a77['body'][_0xd27a('0x3a')])){throw new db['Sequelize'][(_0xd27a('0x2f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x10bee6);}if(!_[_0xd27a('0x3b')](_0x10bee6,_0x180a77[_0xd27a('0x2a')][_0xd27a('0x3a')])){throw new db[(_0xd27a('0x2e'))]['ValidationError'](_0xd27a('0x3c')+_0x10bee6);}_0x34a619[_0x180a77[_0xd27a('0x2a')][_0xd27a('0x3a')]]=_0x180a77['body']['from'];})[_0xd27a('0x13')](function(){return db[_0xd27a('0x1f')]['find']({'where':{'id':_0x180a77[_0xd27a('0x3d')]['id']},'include':[{'model':db[_0xd27a('0x3e')],'as':_0xd27a('0x3f'),'include':[{'model':db[_0xd27a('0x2c')],'as':'Contacts','where':_0x34a619,'limit':0x1,'order':[[_0xd27a('0x33'),'DESC']]}]},{'model':db[_0xd27a('0x40')],'as':'Applications'}]});})[_0xd27a('0x13')](function(_0x13f290){if(_0x13f290&&_0x13f290[_0xd27a('0x3f')]){var _0x26afc2=_0x13f290[_0xd27a('0x41')]({'plain':!![]});_0x55c95e[_0xd27a('0x3d')]=_0x26afc2;_0x55c95e[_0xd27a('0x42')]=_0x26afc2['Applications'];_0x55c95e[_0xd27a('0x43')]=_0x26afc2[_0xd27a('0x3f')];_0x55c95e[_0xd27a('0x42')]=_['orderBy'](_0x55c95e[_0xd27a('0x42')],[_0xd27a('0x44')],[_0xd27a('0x45')]);if(_0x55c95e[_0xd27a('0x3d')]['Applications']){delete _0x55c95e[_0xd27a('0x3d')]['Applications'];}if(_0x55c95e[_0xd27a('0x3d')][_0xd27a('0x3f')]&&_0x55c95e[_0xd27a('0x3d')]['List'][_0xd27a('0x46')][_0xd27a('0x47')]){return _0x55c95e[_0xd27a('0x3d')][_0xd27a('0x3f')][_0xd27a('0x46')][0x0];}var _0x4b9715=_[_0xd27a('0xc')](_0x180a77[_0xd27a('0x2a')],{'firstName':_0x180a77[_0xd27a('0x2a')]['from'],'ListId':_0x26afc2[_0xd27a('0x35')]});_0x4b9715[_0x180a77[_0xd27a('0x2a')][_0xd27a('0x3a')]]=_0x180a77[_0xd27a('0x2a')][_0xd27a('0x37')];return db[_0xd27a('0x2c')][_0xd27a('0x48')](_0x4b9715,{'fields':_0x21242c,'raw':!![]});}})[_0xd27a('0x13')](function(_0x2f2807){_0x55c95e[_0xd27a('0x49')]=_0x2f2807;if(_0x2f2807){var _0x121446={'ContactId':_0x2f2807['id'],'FaxAccountId':_0x180a77[_0xd27a('0x3d')]['id'],'fax':_0x2f2807[_0xd27a('0x2b')]};return db[_0xd27a('0x4a')][_0xd27a('0x4b')]({'where':{'ContactId':_0x2f2807['id'],'closed':![],'FaxAccountId':_0x180a77[_0xd27a('0x3d')]['id']}})[_0xd27a('0x13')](function(_0x2b6b38){if(_0x2b6b38){return[_0x2b6b38,![]];}return db['FaxInteraction']['create'](_0x121446)[_0xd27a('0x13')](function(_0x127e59){return[_0x127e59,!![]];});});}else{throw new Error(_0xd27a('0x4c'));}})[_0xd27a('0x4d')](function(_0x546712,_0x52a383){var _0x489c98=_0x546712['get']({'plain':!![]});if(_0x52a383){if(_0x55c95e[_0xd27a('0x3d')][_0xd27a('0x4e')]){_0x55c95e[_0xd27a('0x42')][_0xd27a('0x4f')]({'id':0x0,'priority':_0x55c95e[_0xd27a('0x42')][_0xd27a('0x47')]+0x1,'app':_0xd27a('0x50'),'appdata':'unmanaged','interval':_0xd27a('0x51')});}_0x489c98[_0xd27a('0x52')]=!![];}else{_0x489c98[_0xd27a('0x52')]=![];}_0x55c95e[_0xd27a('0x53')]=_0x489c98;return db[_0xd27a('0x54')][_0xd27a('0x48')]({'body':_0x180a77['body'][_0xd27a('0x2a')],'FaxAccountId':_0x180a77[_0xd27a('0x3d')]['id'],'FaxInteractionId':_0x546712['id'],'direction':'in','ContactId':_0x546712[_0xd27a('0x55')],'AttachmentId':_0x180a77[_0xd27a('0x2a')][_0xd27a('0x56')]});})[_0xd27a('0x13')](function(_0x36ac46){_0x55c95e['message']=_0x36ac46;if(_0x55c95e[_0xd27a('0x53')][_0xd27a('0x57')]){return db[_0xd27a('0x58')]['find']({'attributes':['id','name'],'where':{'id':_0x55c95e[_0xd27a('0x53')][_0xd27a('0x57')]}})[_0xd27a('0x13')](function(_0x48f615){if(_0x48f615){_0x55c95e[_0xd27a('0x42')][_0xd27a('0x59')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x48f615[_0xd27a('0x5a')]+','+(_0x55c95e[_0xd27a('0x3d')][_0xd27a('0x5b')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xd27a('0x5c'),_0x55c95e);});}return respondWithRpcPromise(_0xd27a('0x5d'),_0xd27a('0x5c'),_0x55c95e);})[_0xd27a('0x13')](function(_0x143bb0){_0x431c56(_0x143bb0);})['catch'](function(_0x45f380){_0x32b3b9(_0x5d0546[_0xd27a('0x19')](0x1f4,_0x45f380[_0xd27a('0x1c')]));});});}; \ No newline at end of file +var _0x0dd6=['FaxApplication','Applications','List','get','orderBy','applications','priority','asc','Contacts','length','create','contact','FaxInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','AttachmentId','interaction','User','name','UserId','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxAccount.socket','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','where','limit','include','model','attributes','map','info','body','fax','describe','ValidationError','difference','keys','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','find','account','CmContact','DESC'];(function(_0x2bda5c,_0x154414){var _0xbd842e=function(_0x50becd){while(--_0x50becd){_0x2bda5c['push'](_0x2bda5c['shift']());}};_0xbd842e(++_0x154414);}(_0x0dd6,0x72));var _0x60dd=function(_0x394456,_0x4cca96){_0x394456=_0x394456-0x0;var _0x1b6b35=_0x0dd6[_0x394456];return _0x1b6b35;};'use strict';var _=require('lodash');var util=require(_0x60dd('0x0'));var moment=require(_0x60dd('0x1'));var BPromise=require(_0x60dd('0x2'));var rs=require(_0x60dd('0x3'));var fs=require('fs');var Redis=require(_0x60dd('0x4'));var db=require(_0x60dd('0x5'))['db'];var utils=require(_0x60dd('0x6'));var logger=require(_0x60dd('0x7'))(_0x60dd('0x8'));var config=require(_0x60dd('0x9'));var jayson=require(_0x60dd('0xa'));var client=jayson[_0x60dd('0xb')]['http']({'port':0x232c});config['redis']=_['defaults'](config[_0x60dd('0xc')],{'host':_0x60dd('0xd'),'port':0x18eb});var socket=require(_0x60dd('0xe'))(new Redis(config[_0x60dd('0xc')]));require(_0x60dd('0xf'))['register'](socket);function respondWithRpcPromise(_0x4a0ada,_0x4acdeb,_0x59300c){return new BPromise(function(_0x7dd07a,_0x26c9fb){return client[_0x60dd('0x10')](_0x4a0ada,_0x59300c)[_0x60dd('0x11')](function(_0x4b879f){logger['info'](_0x60dd('0x12'),_0x4acdeb,_0x60dd('0x13'));logger[_0x60dd('0x14')](_0x60dd('0x15'),_0x4acdeb,'request\x20sent',JSON[_0x60dd('0x16')](_0x4b879f));if(_0x4b879f[_0x60dd('0x17')]){if(_0x4b879f['error'][_0x60dd('0x18')]===0x1f4){logger[_0x60dd('0x17')]('FaxAccount,\x20%s,\x20%s',_0x4acdeb,_0x4b879f[_0x60dd('0x17')][_0x60dd('0x19')]);return _0x26c9fb(_0x4b879f['error'][_0x60dd('0x19')]);}logger[_0x60dd('0x17')](_0x60dd('0x12'),_0x4acdeb,_0x4b879f[_0x60dd('0x17')][_0x60dd('0x19')]);return _0x7dd07a(_0x4b879f[_0x60dd('0x17')][_0x60dd('0x19')]);}else{logger['info'](_0x60dd('0x12'),_0x4acdeb,_0x60dd('0x13'));_0x7dd07a(_0x4b879f[_0x60dd('0x1a')][_0x60dd('0x19')]);}})[_0x60dd('0x1b')](function(_0x4fcb59){logger[_0x60dd('0x17')](_0x60dd('0x12'),_0x4acdeb,_0x4fcb59);_0x26c9fb(_0x4fcb59);});});}exports[_0x60dd('0x1c')]=function(_0x247f78){var _0x294750=this;return new Promise(function(_0x142d2e,_0xfa101){return db[_0x60dd('0x1d')]['findAll']({'raw':_0x247f78[_0x60dd('0x1e')]?_0x247f78['options']['raw']===undefined?!![]:![]:!![],'where':_0x247f78[_0x60dd('0x1e')]?_0x247f78[_0x60dd('0x1e')][_0x60dd('0x1f')]||null:null,'attributes':_0x247f78[_0x60dd('0x1e')]?_0x247f78['options']['attributes']||null:null,'limit':_0x247f78['options']?_0x247f78[_0x60dd('0x1e')][_0x60dd('0x20')]||null:null,'include':_0x247f78['options']?_0x247f78[_0x60dd('0x1e')][_0x60dd('0x21')]?_['map'](_0x247f78[_0x60dd('0x1e')][_0x60dd('0x21')],function(_0xd37ef0){return{'model':db[_0xd37ef0[_0x60dd('0x22')]],'as':_0xd37ef0['as'],'attributes':_0xd37ef0[_0x60dd('0x23')],'include':_0xd37ef0[_0x60dd('0x21')]?_[_0x60dd('0x24')](_0xd37ef0['include'],function(_0x1c3f89){return{'model':db[_0x1c3f89[_0x60dd('0x22')]],'as':_0x1c3f89['as'],'attributes':_0x1c3f89[_0x60dd('0x23')],'include':_0x1c3f89['include']?_[_0x60dd('0x24')](_0x1c3f89['include'],function(_0x506453){return{'model':db[_0x506453[_0x60dd('0x22')]],'as':_0x506453['as'],'attributes':_0x506453[_0x60dd('0x23')]};}):[]};}):[]};}):[]:[]})[_0x60dd('0x11')](function(_0x5ec9d6){logger[_0x60dd('0x25')]('GetFaxAccount',_0x247f78);logger[_0x60dd('0x14')](_0x60dd('0x1c'),_0x247f78,JSON[_0x60dd('0x16')](_0x5ec9d6));_0x142d2e(_0x5ec9d6);})['catch'](function(_0x27ed04){logger['error'](_0x60dd('0x1c'),_0x27ed04[_0x60dd('0x19')],_0x247f78);_0xfa101(_0x294750[_0x60dd('0x17')](0x1f4,_0x27ed04['message']));});});};exports['NotifyFaxAccount']=function(_0x2d4da0,_0x38cc3d,_0x3a6fbb){var _0x142d81=this;return new Promise(function(_0xe5001d,_0x46255e){var _0x45c4f5={'body':_0x2d4da0[_0x60dd('0x26')],'channel':_0x60dd('0x27')};var _0x339f54=[];var _0x39f1ac=[];var _0x2c0bca={};return db['CmContact'][_0x60dd('0x28')]()['then'](function(_0x44522d){if(!_0x44522d){throw new db['Sequelize'][(_0x60dd('0x29'))]('no\x20available\x20attributes');}_0x339f54=_[_0x60dd('0x2a')](_[_0x60dd('0x2b')](_0x44522d),[_0x60dd('0x2c'),_0x60dd('0x2d')]);_0x39f1ac=_[_0x60dd('0x2a')](_[_0x60dd('0x2b')](_0x44522d),['createdAt',_0x60dd('0x2d'),'CompanyId',_0x60dd('0x2e')]);if(_0x2d4da0[_0x60dd('0x26')]['id']){delete _0x2d4da0['body']['id'];}if(_['isNil'](_0x2d4da0[_0x60dd('0x26')][_0x60dd('0x2f')])){throw new db['Sequelize']['ValidationError'](_0x60dd('0x30'));}if(_[_0x60dd('0x31')](_0x2d4da0[_0x60dd('0x26')][_0x60dd('0x26')])||_0x2d4da0[_0x60dd('0x26')][_0x60dd('0x26')]===''){throw new db[(_0x60dd('0x32'))][(_0x60dd('0x29'))](_0x60dd('0x33'));}if(_[_0x60dd('0x31')](_0x2d4da0[_0x60dd('0x26')][_0x60dd('0x34')])){throw new db['Sequelize'][(_0x60dd('0x29'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39f1ac);}if(!_[_0x60dd('0x35')](_0x39f1ac,_0x2d4da0[_0x60dd('0x26')]['mapKey'])){throw new db[(_0x60dd('0x32'))][(_0x60dd('0x29'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39f1ac);}_0x2c0bca[_0x2d4da0[_0x60dd('0x26')]['mapKey']]=_0x2d4da0[_0x60dd('0x26')]['from'];})[_0x60dd('0x11')](function(){return db[_0x60dd('0x1d')][_0x60dd('0x36')]({'where':{'id':_0x2d4da0[_0x60dd('0x37')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x60dd('0x38')],'as':'Contacts','where':_0x2c0bca,'limit':0x1,'order':[[_0x60dd('0x2d'),_0x60dd('0x39')]]}]},{'model':db[_0x60dd('0x3a')],'as':_0x60dd('0x3b')}]});})['then'](function(_0x1ab279){if(_0x1ab279&&_0x1ab279[_0x60dd('0x3c')]){var _0x94b2b2=_0x1ab279[_0x60dd('0x3d')]({'plain':!![]});_0x45c4f5['account']=_0x94b2b2;_0x45c4f5['applications']=_0x94b2b2[_0x60dd('0x3b')];_0x45c4f5['list']=_0x94b2b2[_0x60dd('0x3c')];_0x45c4f5['applications']=_[_0x60dd('0x3e')](_0x45c4f5[_0x60dd('0x3f')],[_0x60dd('0x40')],[_0x60dd('0x41')]);if(_0x45c4f5['account'][_0x60dd('0x3b')]){delete _0x45c4f5[_0x60dd('0x37')][_0x60dd('0x3b')];}if(_0x45c4f5['account'][_0x60dd('0x3c')]&&_0x45c4f5[_0x60dd('0x37')][_0x60dd('0x3c')][_0x60dd('0x42')][_0x60dd('0x43')]){return _0x45c4f5['account'][_0x60dd('0x3c')]['Contacts'][0x0];}var _0x523e66=_['defaults'](_0x2d4da0[_0x60dd('0x26')],{'firstName':_0x2d4da0['body'][_0x60dd('0x2f')],'ListId':_0x94b2b2[_0x60dd('0x2e')]});_0x523e66[_0x2d4da0[_0x60dd('0x26')][_0x60dd('0x34')]]=_0x2d4da0[_0x60dd('0x26')][_0x60dd('0x2f')];return db[_0x60dd('0x38')][_0x60dd('0x44')](_0x523e66,{'fields':_0x339f54,'raw':!![]});}})[_0x60dd('0x11')](function(_0x40f4a6){_0x45c4f5[_0x60dd('0x45')]=_0x40f4a6;if(_0x40f4a6){var _0x12bec7={'ContactId':_0x40f4a6['id'],'FaxAccountId':_0x2d4da0[_0x60dd('0x37')]['id'],'fax':_0x40f4a6[_0x60dd('0x27')]};return db[_0x60dd('0x46')][_0x60dd('0x36')]({'where':{'ContactId':_0x40f4a6['id'],'closed':![],'FaxAccountId':_0x2d4da0[_0x60dd('0x37')]['id']}})['then'](function(_0x5bccf3){if(_0x5bccf3){return[_0x5bccf3,![]];}return db[_0x60dd('0x46')][_0x60dd('0x44')](_0x12bec7)[_0x60dd('0x11')](function(_0x475475){return[_0x475475,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x60dd('0x47')](function(_0x45b835,_0xe918d2){var _0x4ba3d6=_0x45b835['get']({'plain':!![]});if(_0xe918d2){if(_0x45c4f5['account'][_0x60dd('0x48')]){_0x45c4f5[_0x60dd('0x3f')][_0x60dd('0x49')]({'id':0x0,'priority':_0x45c4f5[_0x60dd('0x3f')]['length']+0x1,'app':_0x60dd('0x4a'),'appdata':_0x60dd('0x4b'),'interval':_0x60dd('0x4c')});}_0x4ba3d6[_0x60dd('0x4d')]=!![];}else{_0x4ba3d6['created']=![];}_0x45c4f5['interaction']=_0x4ba3d6;return db[_0x60dd('0x4e')][_0x60dd('0x44')]({'body':_0x2d4da0[_0x60dd('0x26')]['body'],'FaxAccountId':_0x2d4da0[_0x60dd('0x37')]['id'],'FaxInteractionId':_0x45b835['id'],'direction':'in','ContactId':_0x45b835['ContactId'],'AttachmentId':_0x2d4da0['body'][_0x60dd('0x4f')]});})[_0x60dd('0x11')](function(_0x5b8493){_0x45c4f5['message']=_0x5b8493;if(_0x45c4f5[_0x60dd('0x50')]['UserId']){return db[_0x60dd('0x51')]['find']({'attributes':['id',_0x60dd('0x52')],'where':{'id':_0x45c4f5[_0x60dd('0x50')][_0x60dd('0x53')]}})['then'](function(_0x147733){if(_0x147733){_0x45c4f5[_0x60dd('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x147733['name']+','+(_0x45c4f5['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x60dd('0x54'),_0x60dd('0x55'),_0x45c4f5);});}return respondWithRpcPromise(_0x60dd('0x54'),_0x60dd('0x55'),_0x45c4f5);})[_0x60dd('0x11')](function(_0x953d67){_0xe5001d(_0x953d67);})[_0x60dd('0x1b')](function(_0x21b091){_0x46255e(_0x142d81[_0x60dd('0x17')](0x1f4,_0x21b091[_0x60dd('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 3a4b9e4..0f1588c 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 _0xdb31=['remove','update','emit','removeListener','length','faxAccount:','./faxAccount.events','save'];(function(_0x4aedd9,_0x49c805){var _0x5eda00=function(_0x244e97){while(--_0x244e97){_0x4aedd9['push'](_0x4aedd9['shift']());}};_0x5eda00(++_0x49c805);}(_0xdb31,0xae));var _0x1db3=function(_0x5f36cd,_0x37d4c9){_0x5f36cd=_0x5f36cd-0x0;var _0x49832a=_0xdb31[_0x5f36cd];return _0x49832a;};'use strict';var FaxAccountEvents=require(_0x1db3('0x0'));var events=[_0x1db3('0x1'),_0x1db3('0x2'),_0x1db3('0x3')];function createListener(_0x3e2847,_0x1c1aa2){return function(_0x3e3684){_0x1c1aa2[_0x1db3('0x4')](_0x3e2847,_0x3e3684);};}function removeListener(_0x456222,_0x835905){return function(){FaxAccountEvents[_0x1db3('0x5')](_0x456222,_0x835905);};}exports['register']=function(_0x2615c3){for(var _0x41b7b1=0x0,_0x3bdbb7=events[_0x1db3('0x6')];_0x41b7b1<_0x3bdbb7;_0x41b7b1++){var _0x368076=events[_0x41b7b1];var _0x1e9fad=createListener(_0x1db3('0x7')+_0x368076,_0x2615c3);FaxAccountEvents['on'](_0x368076,_0x1e9fad);}}; \ No newline at end of file +var _0xad93=['remove','update','emit','register','faxAccount:','./faxAccount.events'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0xad93,0x19d));var _0x3ad9=function(_0x37656c,_0x50bded){_0x37656c=_0x37656c-0x0;var _0x5d2447=_0xad93[_0x37656c];return _0x5d2447;};'use strict';var FaxAccountEvents=require(_0x3ad9('0x0'));var events=['save',_0x3ad9('0x1'),_0x3ad9('0x2')];function createListener(_0x33ce73,_0x4f4c6b){return function(_0x11f4d9){_0x4f4c6b[_0x3ad9('0x3')](_0x33ce73,_0x11f4d9);};}function removeListener(_0x38c580,_0x295522){return function(){FaxAccountEvents['removeListener'](_0x38c580,_0x295522);};}exports[_0x3ad9('0x4')]=function(_0x2e5f34){for(var _0x40773a=0x0,_0x1f3d1e=events['length'];_0x40773a<_0x1f3d1e;_0x40773a++){var _0x31aee6=events[_0x40773a];var _0x4c385a=createListener(_0x3ad9('0x5')+_0x31aee6,_0x2e5f34);FaxAccountEvents['on'](_0x31aee6,_0x4c385a);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 72502d8..a1cdd6e 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(_0x3d368b,_0x4db0e3){var _0x29cea0=function(_0x31caf6){while(--_0x31caf6){_0x3d368b['push'](_0x3d368b['shift']());}};_0x29cea0(++_0x4db0e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x15f5e4,_0x5b6b4c){var _0x4830e5=function(_0x112a4d){while(--_0x112a4d){_0x15f5e4['push'](_0x15f5e4['shift']());}};_0x4830e5(++_0x5b6b4c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 5970fb5..c184375 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 _0x777b=['INTEGER','TEXT','STRING','*,*,*,*','exports'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0x777b,0x185));var _0xb777=function(_0x1e6337,_0x50251e){_0x1e6337=_0x1e6337-0x0;var _0x78b0cc=_0x777b[_0x1e6337];return _0x78b0cc;};'use strict';var Sequelize=require('sequelize');module[_0xb777('0x0')]={'priority':{'type':Sequelize[_0xb777('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb777('0x2')]()},'description':{'type':Sequelize[_0xb777('0x3')]},'interval':{'type':Sequelize[_0xb777('0x3')],'defaultValue':_0xb777('0x4')}}; \ No newline at end of file +var _0x1800=['INTEGER','STRING','sequelize','exports'];(function(_0x1d4a58,_0xc7e320){var _0x100709=function(_0x2f1014){while(--_0x2f1014){_0x1d4a58['push'](_0x1d4a58['shift']());}};_0x100709(++_0xc7e320);}(_0x1800,0x19e));var _0x0180=function(_0x17b2a2,_0x355a07){_0x17b2a2=_0x17b2a2-0x0;var _0x25be00=_0x1800[_0x17b2a2];return _0x25be00;};'use strict';var Sequelize=require(_0x0180('0x0'));module[_0x0180('0x1')]={'priority':{'type':Sequelize[_0x0180('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0180('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0180('0x3')]},'interval':{'type':Sequelize[_0x0180('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index c62e55a..12ed5c9 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 _0x221c=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','rows','show','params','keys','includeAll','include','options','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x221c,0xfb));var _0xc221=function(_0x58d82e,_0x4f22e6){_0x58d82e=_0x58d82e-0x0;var _0x46526e=_0x221c[_0x58d82e];return _0x46526e;};'use strict';var emlformat=require(_0xc221('0x0'));var rimraf=require(_0xc221('0x1'));var zipdir=require(_0xc221('0x2'));var jsonpatch=require(_0xc221('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc221('0x4'));var util=require('util');var path=require(_0xc221('0x5'));var sox=require(_0xc221('0x6'));var csv=require('to-csv');var ejs=require(_0xc221('0x7'));var fs=require('fs');var fs_extra=require(_0xc221('0x8'));var _=require(_0xc221('0x9'));var squel=require(_0xc221('0xa'));var crypto=require(_0xc221('0xb'));var jsforce=require(_0xc221('0xc'));var deskjs=require(_0xc221('0xd'));var toCsv=require(_0xc221('0xe'));var querystring=require('querystring');var Papa=require(_0xc221('0xf'));var Redis=require(_0xc221('0x10'));var authService=require(_0xc221('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc221('0x12'));var hardwareService=require(_0xc221('0x13'));var logger=require(_0xc221('0x14'))(_0xc221('0x15'));var utils=require(_0xc221('0x16'));var config=require(_0xc221('0x17'));var licenseUtil=require(_0xc221('0x18'));var db=require(_0xc221('0x19'))['db'];function respondWithStatusCode(_0x876900,_0x4bea58){_0x4bea58=_0x4bea58||0xcc;return function(_0xedd316){if(_0xedd316){return _0x876900[_0xc221('0x1a')](_0x4bea58);}return _0x876900[_0xc221('0x1b')](_0x4bea58)['end']();};}function respondWithResult(_0x912629,_0x19aa70){_0x19aa70=_0x19aa70||0xc8;return function(_0x37750c){if(_0x37750c){return _0x912629[_0xc221('0x1b')](_0x19aa70)[_0xc221('0x1c')](_0x37750c);}};}function respondWithFilteredResult(_0x20668f,_0x2a8bc2){return function(_0x3cf37e){if(_0x3cf37e){var _0x28dbc6=typeof _0x2a8bc2['offset']===_0xc221('0x1d')&&typeof _0x2a8bc2[_0xc221('0x1e')]===_0xc221('0x1d');var _0x5e49fd=_0x3cf37e[_0xc221('0x1f')];var _0x490fe2=_0x28dbc6?0x0:_0x2a8bc2[_0xc221('0x20')];var _0x29c2fe=_0x28dbc6?_0x3cf37e[_0xc221('0x1f')]:_0x2a8bc2[_0xc221('0x20')]+_0x2a8bc2['limit'];var _0x408242;if(_0x29c2fe>=_0x5e49fd){_0x29c2fe=_0x5e49fd;_0x408242=0xc8;}else{_0x408242=0xce;}_0x20668f[_0xc221('0x1b')](_0x408242);return _0x20668f[_0xc221('0x21')](_0xc221('0x22'),_0x490fe2+'-'+_0x29c2fe+'/'+_0x5e49fd)[_0xc221('0x1c')](_0x3cf37e);}return null;};}function patchUpdates(_0x21838e){return function(_0x1aeb21){try{jsonpatch[_0xc221('0x23')](_0x1aeb21,_0x21838e,!![]);}catch(_0x238070){return BPromise['reject'](_0x238070);}return _0x1aeb21[_0xc221('0x24')]();};}function saveUpdates(_0x20e04a,_0x633f4b){return function(_0x2f1f96){if(_0x2f1f96){return _0x2f1f96[_0xc221('0x25')](_0x20e04a)[_0xc221('0x26')](function(_0x43c656){return _0x43c656;});}return null;};}function removeEntity(_0x253ac7,_0x4c42b9){return function(_0x57c52e){if(_0x57c52e){return _0x57c52e[_0xc221('0x27')]()[_0xc221('0x26')](function(){_0x253ac7[_0xc221('0x1b')](0xcc)[_0xc221('0x28')]();});}};}function handleEntityNotFound(_0x277181,_0x12f682){return function(_0x86234){if(!_0x86234){_0x277181['sendStatus'](0x194);}return _0x86234;};}function handleError(_0x1dae87,_0x200b1a){_0x200b1a=_0x200b1a||0x1f4;return function(_0x5b061b){logger[_0xc221('0x29')](_0x5b061b[_0xc221('0x2a')]);if(_0x5b061b[_0xc221('0x2b')]){delete _0x5b061b[_0xc221('0x2b')];}_0x1dae87[_0xc221('0x1b')](_0x200b1a)[_0xc221('0x2c')](_0x5b061b);};}exports[_0xc221('0x2d')]=function(_0x539e79,_0x4d3afe){var _0x41b0b2={},_0x3331af={},_0x67f28b={'count':0x0,'rows':[]};var _0x55d081=_[_0xc221('0x2e')](db[_0xc221('0x2f')][_0xc221('0x30')],function(_0x1d03b8){return{'name':_0x1d03b8[_0xc221('0x31')],'type':_0x1d03b8[_0xc221('0x32')][_0xc221('0x33')]};});_0x3331af[_0xc221('0x34')]=_[_0xc221('0x2e')](_0x55d081,_0xc221('0x2b'));_0x3331af[_0xc221('0x35')]=_['keys'](_0x539e79[_0xc221('0x35')]);_0x3331af[_0xc221('0x36')]=_[_0xc221('0x37')](_0x3331af[_0xc221('0x34')],_0x3331af[_0xc221('0x35')]);_0x41b0b2[_0xc221('0x38')]=_[_0xc221('0x37')](_0x3331af[_0xc221('0x34')],qs[_0xc221('0x39')](_0x539e79[_0xc221('0x35')][_0xc221('0x39')]));_0x41b0b2[_0xc221('0x38')]=_0x41b0b2['attributes'][_0xc221('0x3a')]?_0x41b0b2[_0xc221('0x38')]:_0x3331af[_0xc221('0x34')];if(!_0x539e79[_0xc221('0x35')][_0xc221('0x3b')](_0xc221('0x3c'))){_0x41b0b2[_0xc221('0x1e')]=qs[_0xc221('0x1e')](_0x539e79[_0xc221('0x35')][_0xc221('0x1e')]);_0x41b0b2[_0xc221('0x20')]=qs['offset'](_0x539e79['query'][_0xc221('0x20')]);}_0x41b0b2['order']=qs[_0xc221('0x3d')](_0x539e79[_0xc221('0x35')][_0xc221('0x3d')]);_0x41b0b2[_0xc221('0x3e')]=qs['filters'](_[_0xc221('0x3f')](_0x539e79[_0xc221('0x35')],_0x3331af['filters']),_0x55d081);if(_0x539e79[_0xc221('0x35')][_0xc221('0x40')]){_0x41b0b2[_0xc221('0x3e')]=_[_0xc221('0x41')](_0x41b0b2['where'],{'$or':_[_0xc221('0x2e')](_0x55d081,function(_0x4191f0){if(_0x4191f0[_0xc221('0x32')]!=='VIRTUAL'){var _0x2c34b6={};_0x2c34b6[_0x4191f0[_0xc221('0x2b')]]={'$like':'%'+_0x539e79[_0xc221('0x35')][_0xc221('0x40')]+'%'};return _0x2c34b6;}})});}_0x41b0b2=_['merge']({},_0x41b0b2,_0x539e79['options']);var _0x340c9b={'where':_0x41b0b2[_0xc221('0x3e')]};return db[_0xc221('0x2f')]['count'](_0x340c9b)[_0xc221('0x26')](function(_0xecc977){_0x67f28b[_0xc221('0x1f')]=_0xecc977;if(_0x539e79[_0xc221('0x35')]['includeAll']){_0x41b0b2['include']=[{'all':!![]}];}return db[_0xc221('0x2f')]['findAll'](_0x41b0b2);})[_0xc221('0x26')](function(_0x2913e9){_0x67f28b[_0xc221('0x42')]=_0x2913e9;return _0x67f28b;})[_0xc221('0x26')](respondWithFilteredResult(_0x4d3afe,_0x41b0b2))['catch'](handleError(_0x4d3afe,null));};exports[_0xc221('0x43')]=function(_0xc6e59,_0x348283){var _0x290312={'raw':!![],'where':{'id':_0xc6e59[_0xc221('0x44')]['id']}},_0x473c08={};_0x473c08[_0xc221('0x34')]=_[_0xc221('0x45')](db[_0xc221('0x2f')][_0xc221('0x30')]);_0x473c08[_0xc221('0x35')]=_[_0xc221('0x45')](_0xc6e59[_0xc221('0x35')]);_0x473c08['filters']=_[_0xc221('0x37')](_0x473c08['model'],_0x473c08[_0xc221('0x35')]);_0x290312['attributes']=_[_0xc221('0x37')](_0x473c08[_0xc221('0x34')],qs[_0xc221('0x39')](_0xc6e59[_0xc221('0x35')][_0xc221('0x39')]));_0x290312[_0xc221('0x38')]=_0x290312[_0xc221('0x38')][_0xc221('0x3a')]?_0x290312[_0xc221('0x38')]:_0x473c08['model'];if(_0xc6e59['query'][_0xc221('0x46')]){_0x290312[_0xc221('0x47')]=[{'all':!![]}];}_0x290312=_[_0xc221('0x41')]({},_0x290312,_0xc6e59[_0xc221('0x48')]);return db[_0xc221('0x2f')][_0xc221('0x49')](_0x290312)[_0xc221('0x26')](handleEntityNotFound(_0x348283,null))[_0xc221('0x26')](respondWithResult(_0x348283,null))['catch'](handleError(_0x348283,null));};exports['create']=function(_0x3f43b3,_0x35cf1c){return db[_0xc221('0x2f')]['create'](_0x3f43b3[_0xc221('0x4a')],{})['then'](respondWithResult(_0x35cf1c,0xc9))[_0xc221('0x4b')](handleError(_0x35cf1c,null));};exports[_0xc221('0x25')]=function(_0x7bf6b3,_0x521120){if(_0x7bf6b3[_0xc221('0x4a')]['id']){delete _0x7bf6b3[_0xc221('0x4a')]['id'];}return db['FaxApplication'][_0xc221('0x49')]({'where':{'id':_0x7bf6b3[_0xc221('0x44')]['id']}})['then'](handleEntityNotFound(_0x521120,null))[_0xc221('0x26')](saveUpdates(_0x7bf6b3[_0xc221('0x4a')],null))[_0xc221('0x26')](respondWithResult(_0x521120,null))[_0xc221('0x4b')](handleError(_0x521120,null));};exports[_0xc221('0x27')]=function(_0x155c20,_0x433830){return db[_0xc221('0x2f')][_0xc221('0x49')]({'where':{'id':_0x155c20[_0xc221('0x44')]['id']}})[_0xc221('0x26')](handleEntityNotFound(_0x433830,null))[_0xc221('0x26')](removeEntity(_0x433830,null))[_0xc221('0x4b')](handleError(_0x433830,null));}; \ No newline at end of file +var _0x60af=['findAll','rows','catch','show','params','options','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','FaxApplication','rawAttributes','type','model','keys','query','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include'];(function(_0x1b8f6f,_0x3dacc0){var _0x15410d=function(_0x1071d1){while(--_0x1071d1){_0x1b8f6f['push'](_0x1b8f6f['shift']());}};_0x15410d(++_0x3dacc0);}(_0x60af,0x97));var _0xf60a=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x60af[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf60a('0x0'));var jsonpatch=require(_0xf60a('0x1'));var rp=require(_0xf60a('0x2'));var moment=require(_0xf60a('0x3'));var BPromise=require(_0xf60a('0x4'));var Mustache=require(_0xf60a('0x5'));var util=require(_0xf60a('0x6'));var path=require(_0xf60a('0x7'));var sox=require(_0xf60a('0x8'));var csv=require(_0xf60a('0x9'));var ejs=require(_0xf60a('0xa'));var fs=require('fs');var fs_extra=require(_0xf60a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf60a('0xc'));var deskjs=require(_0xf60a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf60a('0xe'));var Papa=require(_0xf60a('0xf'));var Redis=require(_0xf60a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf60a('0x11'));var as=require(_0xf60a('0x12'));var hardwareService=require(_0xf60a('0x13'));var logger=require(_0xf60a('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xf60a('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c19ad,_0x4029a9){_0x4029a9=_0x4029a9||0xcc;return function(_0x154491){if(_0x154491){return _0x2c19ad['sendStatus'](_0x4029a9);}return _0x2c19ad[_0xf60a('0x16')](_0x4029a9)[_0xf60a('0x17')]();};}function respondWithResult(_0x9e499b,_0x85869b){_0x85869b=_0x85869b||0xc8;return function(_0x38a7f9){if(_0x38a7f9){return _0x9e499b[_0xf60a('0x16')](_0x85869b)['json'](_0x38a7f9);}};}function respondWithFilteredResult(_0x4ff42e,_0x527fbd){return function(_0x5147fd){if(_0x5147fd){var _0xc8a08b=typeof _0x527fbd[_0xf60a('0x18')]===_0xf60a('0x19')&&typeof _0x527fbd[_0xf60a('0x1a')]===_0xf60a('0x19');var _0x1c8f93=_0x5147fd[_0xf60a('0x1b')];var _0x42c5ec=_0xc8a08b?0x0:_0x527fbd[_0xf60a('0x18')];var _0x219cf=_0xc8a08b?_0x5147fd[_0xf60a('0x1b')]:_0x527fbd[_0xf60a('0x18')]+_0x527fbd[_0xf60a('0x1a')];var _0x1e9c26;if(_0x219cf>=_0x1c8f93){_0x219cf=_0x1c8f93;_0x1e9c26=0xc8;}else{_0x1e9c26=0xce;}_0x4ff42e[_0xf60a('0x16')](_0x1e9c26);return _0x4ff42e['set'](_0xf60a('0x1c'),_0x42c5ec+'-'+_0x219cf+'/'+_0x1c8f93)[_0xf60a('0x1d')](_0x5147fd);}return null;};}function patchUpdates(_0x2e9ad3){return function(_0xce6944){try{jsonpatch[_0xf60a('0x1e')](_0xce6944,_0x2e9ad3,!![]);}catch(_0x1bda03){return BPromise[_0xf60a('0x1f')](_0x1bda03);}return _0xce6944[_0xf60a('0x20')]();};}function saveUpdates(_0x31ba89,_0x329ab7){return function(_0x6ede2d){if(_0x6ede2d){return _0x6ede2d[_0xf60a('0x21')](_0x31ba89)[_0xf60a('0x22')](function(_0x28030e){return _0x28030e;});}return null;};}function removeEntity(_0x354bd6,_0xacef66){return function(_0x10509d){if(_0x10509d){return _0x10509d[_0xf60a('0x23')]()[_0xf60a('0x22')](function(){_0x354bd6[_0xf60a('0x16')](0xcc)[_0xf60a('0x17')]();});}};}function handleEntityNotFound(_0x42fa11,_0x1eea3e){return function(_0x5506db){if(!_0x5506db){_0x42fa11[_0xf60a('0x24')](0x194);}return _0x5506db;};}function handleError(_0x1b094e,_0x427b9a){_0x427b9a=_0x427b9a||0x1f4;return function(_0x5e5ba0){logger['error'](_0x5e5ba0[_0xf60a('0x25')]);if(_0x5e5ba0[_0xf60a('0x26')]){delete _0x5e5ba0[_0xf60a('0x26')];}_0x1b094e[_0xf60a('0x16')](_0x427b9a)[_0xf60a('0x27')](_0x5e5ba0);};}exports[_0xf60a('0x28')]=function(_0x21e8a9,_0x4e5777){var _0x31b2e2={},_0xd4fbe8={},_0x1804c0={'count':0x0,'rows':[]};var _0x5d7b63=_[_0xf60a('0x29')](db[_0xf60a('0x2a')][_0xf60a('0x2b')],function(_0x2b2fed){return{'name':_0x2b2fed['fieldName'],'type':_0x2b2fed[_0xf60a('0x2c')]['key']};});_0xd4fbe8[_0xf60a('0x2d')]=_[_0xf60a('0x29')](_0x5d7b63,'name');_0xd4fbe8['query']=_[_0xf60a('0x2e')](_0x21e8a9[_0xf60a('0x2f')]);_0xd4fbe8['filters']=_[_0xf60a('0x30')](_0xd4fbe8[_0xf60a('0x2d')],_0xd4fbe8[_0xf60a('0x2f')]);_0x31b2e2[_0xf60a('0x31')]=_[_0xf60a('0x30')](_0xd4fbe8[_0xf60a('0x2d')],qs[_0xf60a('0x32')](_0x21e8a9[_0xf60a('0x2f')]['fields']));_0x31b2e2['attributes']=_0x31b2e2[_0xf60a('0x31')][_0xf60a('0x33')]?_0x31b2e2[_0xf60a('0x31')]:_0xd4fbe8[_0xf60a('0x2d')];if(!_0x21e8a9[_0xf60a('0x2f')]['hasOwnProperty'](_0xf60a('0x34'))){_0x31b2e2['limit']=qs[_0xf60a('0x1a')](_0x21e8a9['query'][_0xf60a('0x1a')]);_0x31b2e2[_0xf60a('0x18')]=qs['offset'](_0x21e8a9['query'][_0xf60a('0x18')]);}_0x31b2e2['order']=qs[_0xf60a('0x35')](_0x21e8a9[_0xf60a('0x2f')][_0xf60a('0x35')]);_0x31b2e2['where']=qs[_0xf60a('0x36')](_[_0xf60a('0x37')](_0x21e8a9[_0xf60a('0x2f')],_0xd4fbe8['filters']),_0x5d7b63);if(_0x21e8a9['query'][_0xf60a('0x38')]){_0x31b2e2[_0xf60a('0x39')]=_[_0xf60a('0x3a')](_0x31b2e2[_0xf60a('0x39')],{'$or':_[_0xf60a('0x29')](_0x5d7b63,function(_0x10f20a){if(_0x10f20a['type']!==_0xf60a('0x3b')){var _0x206f4a={};_0x206f4a[_0x10f20a[_0xf60a('0x26')]]={'$like':'%'+_0x21e8a9[_0xf60a('0x2f')][_0xf60a('0x38')]+'%'};return _0x206f4a;}})});}_0x31b2e2=_[_0xf60a('0x3a')]({},_0x31b2e2,_0x21e8a9['options']);var _0x25c935={'where':_0x31b2e2[_0xf60a('0x39')]};return db[_0xf60a('0x2a')]['count'](_0x25c935)[_0xf60a('0x22')](function(_0x1dd8fb){_0x1804c0[_0xf60a('0x1b')]=_0x1dd8fb;if(_0x21e8a9[_0xf60a('0x2f')][_0xf60a('0x3c')]){_0x31b2e2[_0xf60a('0x3d')]=[{'all':!![]}];}return db['FaxApplication'][_0xf60a('0x3e')](_0x31b2e2);})[_0xf60a('0x22')](function(_0x515ed0){_0x1804c0[_0xf60a('0x3f')]=_0x515ed0;return _0x1804c0;})[_0xf60a('0x22')](respondWithFilteredResult(_0x4e5777,_0x31b2e2))[_0xf60a('0x40')](handleError(_0x4e5777,null));};exports[_0xf60a('0x41')]=function(_0x40aa93,_0x2d61ac){var _0x33b71a={'raw':!![],'where':{'id':_0x40aa93[_0xf60a('0x42')]['id']}},_0x4ddfa0={};_0x4ddfa0['model']=_[_0xf60a('0x2e')](db[_0xf60a('0x2a')]['rawAttributes']);_0x4ddfa0['query']=_[_0xf60a('0x2e')](_0x40aa93[_0xf60a('0x2f')]);_0x4ddfa0[_0xf60a('0x36')]=_[_0xf60a('0x30')](_0x4ddfa0[_0xf60a('0x2d')],_0x4ddfa0[_0xf60a('0x2f')]);_0x33b71a[_0xf60a('0x31')]=_[_0xf60a('0x30')](_0x4ddfa0[_0xf60a('0x2d')],qs[_0xf60a('0x32')](_0x40aa93[_0xf60a('0x2f')][_0xf60a('0x32')]));_0x33b71a[_0xf60a('0x31')]=_0x33b71a[_0xf60a('0x31')][_0xf60a('0x33')]?_0x33b71a[_0xf60a('0x31')]:_0x4ddfa0[_0xf60a('0x2d')];if(_0x40aa93['query'][_0xf60a('0x3c')]){_0x33b71a[_0xf60a('0x3d')]=[{'all':!![]}];}_0x33b71a=_[_0xf60a('0x3a')]({},_0x33b71a,_0x40aa93[_0xf60a('0x43')]);return db[_0xf60a('0x2a')][_0xf60a('0x44')](_0x33b71a)[_0xf60a('0x22')](handleEntityNotFound(_0x2d61ac,null))[_0xf60a('0x22')](respondWithResult(_0x2d61ac,null))[_0xf60a('0x40')](handleError(_0x2d61ac,null));};exports[_0xf60a('0x45')]=function(_0x3f0cad,_0x2fc543){return db[_0xf60a('0x2a')][_0xf60a('0x45')](_0x3f0cad['body'],{})['then'](respondWithResult(_0x2fc543,0xc9))[_0xf60a('0x40')](handleError(_0x2fc543,null));};exports[_0xf60a('0x21')]=function(_0x3d0ce8,_0x558983){if(_0x3d0ce8[_0xf60a('0x46')]['id']){delete _0x3d0ce8[_0xf60a('0x46')]['id'];}return db[_0xf60a('0x2a')][_0xf60a('0x44')]({'where':{'id':_0x3d0ce8[_0xf60a('0x42')]['id']}})[_0xf60a('0x22')](handleEntityNotFound(_0x558983,null))[_0xf60a('0x22')](saveUpdates(_0x3d0ce8[_0xf60a('0x46')],null))['then'](respondWithResult(_0x558983,null))[_0xf60a('0x40')](handleError(_0x558983,null));};exports[_0xf60a('0x23')]=function(_0xd7b626,_0xf5a397){return db['FaxApplication']['find']({'where':{'id':_0xd7b626[_0xf60a('0x42')]['id']}})[_0xf60a('0x22')](handleEntityNotFound(_0xf5a397,null))[_0xf60a('0x22')](removeEntity(_0xf5a397,null))[_0xf60a('0x40')](handleError(_0xf5a397,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index bdaf0a6..27346f5 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 _0x00cf=['request-promise','path','rimraf','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x00cf,0x134));var _0xf00c=function(_0x40e260,_0x3adb95){_0x40e260=_0x40e260-0x0;var _0x32e15c=_0x00cf[_0x40e260];return _0x32e15c;};'use strict';var _=require(_0xf00c('0x0'));var util=require(_0xf00c('0x1'));var logger=require('../../config/logger')(_0xf00c('0x2'));var moment=require(_0xf00c('0x3'));var BPromise=require('bluebird');var rp=require(_0xf00c('0x4'));var fs=require('fs');var path=require(_0xf00c('0x5'));var rimraf=require(_0xf00c('0x6'));var config=require('../../config/environment');var attributes=require(_0xf00c('0x7'));module[_0xf00c('0x8')]=function(_0x559637,_0x59bf13){return _0x559637[_0xf00c('0x9')](_0xf00c('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf00c('0xb'),'collate':_0xf00c('0xc')});}; \ No newline at end of file +var _0xe73d=['request-promise','rimraf','./faxApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird'];(function(_0x49efbe,_0x20fd39){var _0x432b66=function(_0x248790){while(--_0x248790){_0x49efbe['push'](_0x49efbe['shift']());}};_0x432b66(++_0x20fd39);}(_0xe73d,0x72));var _0xde73=function(_0x5a0ab5,_0x35aa99){_0x5a0ab5=_0x5a0ab5-0x0;var _0x73e449=_0xe73d[_0x5a0ab5];return _0x73e449;};'use strict';var _=require('lodash');var util=require(_0xde73('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xde73('0x1'));var BPromise=require(_0xde73('0x2'));var rp=require(_0xde73('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde73('0x4'));var config=require('../../config/environment');var attributes=require(_0xde73('0x5'));module[_0xde73('0x6')]=function(_0x43d55c,_0x4f9ad6){return _0x43d55c['define']('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde73('0x7'),'collate':_0xde73('0x8')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 2748acb..d7151a1 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 _0x846e=['UpdateFaxApplication','update','body','options','where','attributes','limit','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch'];(function(_0x5b6d79,_0x1dff75){var _0x393a6e=function(_0x9baa98){while(--_0x9baa98){_0x5b6d79['push'](_0x5b6d79['shift']());}};_0x393a6e(++_0x1dff75);}(_0x846e,0x1a7));var _0xe846=function(_0xf36116,_0xa41e84){_0xf36116=_0xf36116-0x0;var _0x17179d=_0x846e[_0xf36116];return _0x17179d;};'use strict';var _=require('lodash');var util=require(_0xe846('0x0'));var moment=require('moment');var BPromise=require(_0xe846('0x1'));var rs=require(_0xe846('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe846('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe846('0x4'))('rpc');var config=require(_0xe846('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe846('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33072f,_0x36976d,_0x104374){return new BPromise(function(_0xfa8c7f,_0x319e94){return client[_0xe846('0x7')](_0x33072f,_0x104374)[_0xe846('0x8')](function(_0xa5b0b0){logger[_0xe846('0x9')]('FaxApplication,\x20%s,\x20%s',_0x36976d,_0xe846('0xa'));logger[_0xe846('0xb')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x36976d,'request\x20sent',JSON[_0xe846('0xc')](_0xa5b0b0));if(_0xa5b0b0[_0xe846('0xd')]){if(_0xa5b0b0[_0xe846('0xd')][_0xe846('0xe')]===0x1f4){logger['error'](_0xe846('0xf'),_0x36976d,_0xa5b0b0['error'][_0xe846('0x10')]);return _0x319e94(_0xa5b0b0[_0xe846('0xd')][_0xe846('0x10')]);}logger['error'](_0xe846('0xf'),_0x36976d,_0xa5b0b0[_0xe846('0xd')]['message']);return _0xfa8c7f(_0xa5b0b0[_0xe846('0xd')][_0xe846('0x10')]);}else{logger['info'](_0xe846('0xf'),_0x36976d,_0xe846('0xa'));_0xfa8c7f(_0xa5b0b0[_0xe846('0x11')][_0xe846('0x10')]);}})[_0xe846('0x12')](function(_0x40deae){logger['error'](_0xe846('0xf'),_0x36976d,_0x40deae);_0x319e94(_0x40deae);});});}exports[_0xe846('0x13')]=function(_0x53526b){var _0x2bf298=this;return new Promise(function(_0x4254c7,_0x3ccda3){return db['FaxApplication'][_0xe846('0x14')](_0x53526b[_0xe846('0x15')],{'raw':_0x53526b[_0xe846('0x16')]?_0x53526b[_0xe846('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53526b[_0xe846('0x16')]?_0x53526b[_0xe846('0x16')][_0xe846('0x17')]||null:null,'attributes':_0x53526b[_0xe846('0x16')]?_0x53526b[_0xe846('0x16')][_0xe846('0x18')]||null:null,'limit':_0x53526b[_0xe846('0x16')]?_0x53526b['options'][_0xe846('0x19')]||null:null})[_0xe846('0x8')](function(_0xf4f6f8){logger[_0xe846('0x9')](_0xe846('0x13'),_0x53526b);logger[_0xe846('0xb')]('UpdateFaxApplication',_0x53526b,JSON[_0xe846('0xc')](_0xf4f6f8));_0x4254c7(_0xf4f6f8);})[_0xe846('0x12')](function(_0x24557d){logger[_0xe846('0xd')](_0xe846('0x13'),_0x24557d[_0xe846('0x10')],_0x53526b);_0x3ccda3(_0x2bf298['error'](0x1f4,_0x24557d[_0xe846('0x10')]));});});}; \ No newline at end of file +var _0xaffe=['then','UpdateFaxApplication','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','FaxApplication','update','body','options','raw','limit'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xaffe,0x158));var _0xeaff=function(_0x1bea73,_0x869252){_0x1bea73=_0x1bea73-0x0;var _0x31a6e7=_0xaffe[_0x1bea73];return _0x31a6e7;};'use strict';var _=require(_0xeaff('0x0'));var util=require(_0xeaff('0x1'));var moment=require(_0xeaff('0x2'));var BPromise=require('bluebird');var rs=require(_0xeaff('0x3'));var fs=require('fs');var Redis=require(_0xeaff('0x4'));var db=require(_0xeaff('0x5'))['db'];var utils=require(_0xeaff('0x6'));var logger=require(_0xeaff('0x7'))(_0xeaff('0x8'));var config=require(_0xeaff('0x9'));var jayson=require(_0xeaff('0xa'));var client=jayson[_0xeaff('0xb')][_0xeaff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x17149c,_0x418a10,_0x5bc230){return new BPromise(function(_0x123f65,_0xf39aa5){return client[_0xeaff('0xd')](_0x17149c,_0x5bc230)['then'](function(_0xfd8f46){logger[_0xeaff('0xe')](_0xeaff('0xf'),_0x418a10,_0xeaff('0x10'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x418a10,_0xeaff('0x10'),JSON[_0xeaff('0x11')](_0xfd8f46));if(_0xfd8f46[_0xeaff('0x12')]){if(_0xfd8f46[_0xeaff('0x12')][_0xeaff('0x13')]===0x1f4){logger[_0xeaff('0x12')](_0xeaff('0xf'),_0x418a10,_0xfd8f46[_0xeaff('0x12')][_0xeaff('0x14')]);return _0xf39aa5(_0xfd8f46[_0xeaff('0x12')][_0xeaff('0x14')]);}logger[_0xeaff('0x12')](_0xeaff('0xf'),_0x418a10,_0xfd8f46[_0xeaff('0x12')][_0xeaff('0x14')]);return _0x123f65(_0xfd8f46[_0xeaff('0x12')][_0xeaff('0x14')]);}else{logger[_0xeaff('0xe')]('FaxApplication,\x20%s,\x20%s',_0x418a10,'request\x20sent');_0x123f65(_0xfd8f46['result'][_0xeaff('0x14')]);}})[_0xeaff('0x15')](function(_0xdba06e){logger[_0xeaff('0x12')](_0xeaff('0xf'),_0x418a10,_0xdba06e);_0xf39aa5(_0xdba06e);});});}exports['UpdateFaxApplication']=function(_0x4c63a4){var _0x419eda=this;return new Promise(function(_0x4b6cc2,_0x589cf3){return db[_0xeaff('0x16')][_0xeaff('0x17')](_0x4c63a4[_0xeaff('0x18')],{'raw':_0x4c63a4[_0xeaff('0x19')]?_0x4c63a4[_0xeaff('0x19')][_0xeaff('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c63a4[_0xeaff('0x19')]?_0x4c63a4['options']['where']||null:null,'attributes':_0x4c63a4['options']?_0x4c63a4[_0xeaff('0x19')]['attributes']||null:null,'limit':_0x4c63a4[_0xeaff('0x19')]?_0x4c63a4[_0xeaff('0x19')][_0xeaff('0x1b')]||null:null})[_0xeaff('0x1c')](function(_0x2a5e7a){logger[_0xeaff('0xe')](_0xeaff('0x1d'),_0x4c63a4);logger[_0xeaff('0x1e')](_0xeaff('0x1d'),_0x4c63a4,JSON[_0xeaff('0x11')](_0x2a5e7a));_0x4b6cc2(_0x2a5e7a);})['catch'](function(_0x347dff){logger['error'](_0xeaff('0x1d'),_0x347dff[_0xeaff('0x14')],_0x4c63a4);_0x589cf3(_0x419eda['error'](0x1f4,_0x347dff[_0xeaff('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 52602d5..9a35a55 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6324=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x5811ea,_0x5ea11a){var _0x428d37=function(_0x43241f){while(--_0x43241f){_0x5811ea['push'](_0x5811ea['shift']());}};_0x428d37(++_0x5ea11a);}(_0x6324,0x142));var _0x4632=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0x6324[_0x1a8bbc];return _0x212fc2;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./faxApplication.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0xb')]('/',auth['isAuthenticated'](),controller[_0x4632('0xc')]);router[_0x4632('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4632('0xe')]);router[_0x4632('0xf')](_0x4632('0x10'),auth[_0x4632('0x8')](),controller[_0x4632('0x11')]);module[_0x4632('0x12')]=router; \ No newline at end of file +var _0x4213=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x6f9ca,_0x1d39b5){var _0x4bda83=function(_0x3c94b6){while(--_0x3c94b6){_0x6f9ca['push'](_0x6f9ca['shift']());}};_0x4bda83(++_0x1d39b5);}(_0x4213,0x77));var _0x3421=function(_0x689e1d,_0x2ba8fd){_0x689e1d=_0x689e1d-0x0;var _0x2daafc=_0x4213[_0x689e1d];return _0x2daafc;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0xe')]('/',auth[_0x3421('0xa')](),controller['create']);router[_0x3421('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3421('0x10')]);router['delete'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 4404fc5..2b196c8 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 _0xe773=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x5e6980,_0x40ceb2){var _0x15b138=function(_0x59ee93){while(--_0x59ee93){_0x5e6980['push'](_0x5e6980['shift']());}};_0x15b138(++_0x40ceb2);}(_0xe773,0x1ad));var _0x3e77=function(_0x2d5a47,_0x2af1df){_0x2d5a47=_0x2d5a47-0x0;var _0x5990b1=_0xe773[_0x2d5a47];return _0x5990b1;};'use strict';var Sequelize=require(_0x3e77('0x0'));module[_0x3e77('0x1')]={'closed':{'type':Sequelize[_0x3e77('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3e77('0x3')]},'disposition':{'type':Sequelize[_0x3e77('0x4')]},'secondDisposition':{'type':Sequelize[_0x3e77('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3e77('0x3')]},'fax':{'type':Sequelize[_0x3e77('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3e77('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3e77('0x5')]('in',_0x3e77('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x4e66=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x4dd8b2,_0x7421f7){var _0x28fb0a=function(_0x3882fd){while(--_0x3882fd){_0x4dd8b2['push'](_0x4dd8b2['shift']());}};_0x28fb0a(++_0x7421f7);}(_0x4e66,0x83));var _0x64e6=function(_0x18a433,_0x1bb62e){_0x18a433=_0x18a433-0x0;var _0x392384=_0x4e66[_0x18a433];return _0x392384;};'use strict';var Sequelize=require(_0x64e6('0x0'));module[_0x64e6('0x1')]={'closed':{'type':Sequelize[_0x64e6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x64e6('0x3')]},'disposition':{'type':Sequelize[_0x64e6('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x64e6('0x4')]},'note':{'type':Sequelize[_0x64e6('0x4')]},'read1stAt':{'type':Sequelize[_0x64e6('0x3')]},'fax':{'type':Sequelize[_0x64e6('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x64e6('0x5')]('in',_0x64e6('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x64e6('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x64e6('0x5')]('in',_0x64e6('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index db35a94..636e22e 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 _0xde15=['key','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','select','field','from','u.id','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','$substring','value','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','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','where','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','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.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','isEmpty','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','FaxAccountId','sequelize','toString','keyBy','merge','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','c.phone','c.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','all','rows','show','params','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','spread','emit','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','existsSync','createReadStream','createWriteStream','log','err','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','Users','map','fullname','Tags','TagIds','split','catch','waiting','talking','unmanaged','total','closed','UserId','answered','index','FaxInteraction','rawAttributes','fieldName','type'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xde15,0x16f));var _0x5de1=function(_0x50e01a,_0x48c43e){_0x50e01a=_0x50e01a-0x0;var _0x32190a=_0xde15[_0x50e01a];return _0x32190a;};'use strict';var emlformat=require(_0x5de1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5de1('0x1'));var jsonpatch=require(_0x5de1('0x2'));var rp=require(_0x5de1('0x3'));var moment=require(_0x5de1('0x4'));var BPromise=require(_0x5de1('0x5'));var Mustache=require(_0x5de1('0x6'));var util=require('util');var path=require(_0x5de1('0x7'));var sox=require('sox');var csv=require(_0x5de1('0x8'));var ejs=require(_0x5de1('0x9'));var fs=require('fs');var fs_extra=require(_0x5de1('0xa'));var _=require(_0x5de1('0xb'));var squel=require(_0x5de1('0xc'));var crypto=require(_0x5de1('0xd'));var jsforce=require(_0x5de1('0xe'));var deskjs=require(_0x5de1('0xf'));var toCsv=require(_0x5de1('0x8'));var querystring=require(_0x5de1('0x10'));var Papa=require('papaparse');var Redis=require(_0x5de1('0x11'));var authService=require(_0x5de1('0x12'));var qs=require(_0x5de1('0x13'));var as=require(_0x5de1('0x14'));var hardwareService=require(_0x5de1('0x15'));var logger=require(_0x5de1('0x16'))(_0x5de1('0x17'));var utils=require(_0x5de1('0x18'));var config=require(_0x5de1('0x19'));var licenseUtil=require(_0x5de1('0x1a'));var db=require(_0x5de1('0x1b'))['db'];config[_0x5de1('0x1c')]=_['defaults'](config[_0x5de1('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x5de1('0x1d'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x5de1('0x1e')](socket);function respondWithStatusCode(_0x670290,_0x45e77f){_0x45e77f=_0x45e77f||0xcc;return function(_0x53c64b){if(_0x53c64b){return _0x670290[_0x5de1('0x1f')](_0x45e77f);}return _0x670290[_0x5de1('0x20')](_0x45e77f)[_0x5de1('0x21')]();};}function respondWithResult(_0x2ba42,_0x3fb8b0){_0x3fb8b0=_0x3fb8b0||0xc8;return function(_0x58ffe0){if(_0x58ffe0){return _0x2ba42[_0x5de1('0x20')](_0x3fb8b0)['json'](_0x58ffe0);}};}function respondWithFilteredResult(_0xb26ca1,_0x2ede99){return function(_0x35ce91){if(_0x35ce91){var _0x9e18d9=typeof _0x2ede99[_0x5de1('0x22')]===_0x5de1('0x23')&&typeof _0x2ede99[_0x5de1('0x24')]==='undefined';var _0x21b995=_0x35ce91[_0x5de1('0x25')];var _0x22bc33=_0x9e18d9?0x0:_0x2ede99[_0x5de1('0x22')];var _0x465c86=_0x9e18d9?_0x35ce91[_0x5de1('0x25')]:_0x2ede99[_0x5de1('0x22')]+_0x2ede99[_0x5de1('0x24')];var _0x3e2a75;if(_0x465c86>=_0x21b995){_0x465c86=_0x21b995;_0x3e2a75=0xc8;}else{_0x3e2a75=0xce;}_0xb26ca1['status'](_0x3e2a75);return _0xb26ca1[_0x5de1('0x26')](_0x5de1('0x27'),_0x22bc33+'-'+_0x465c86+'/'+_0x21b995)['json'](_0x35ce91);}return null;};}function patchUpdates(_0xd85a14){return function(_0x38657e){try{jsonpatch[_0x5de1('0x28')](_0x38657e,_0xd85a14,!![]);}catch(_0x5d7894){return BPromise[_0x5de1('0x29')](_0x5d7894);}return _0x38657e[_0x5de1('0x2a')]();};}function saveUpdates(_0x3e27a6,_0x504afd){return function(_0x14ae0b){if(_0x14ae0b){return _0x14ae0b[_0x5de1('0x2b')](_0x3e27a6)[_0x5de1('0x2c')](function(_0x298b51){return _0x298b51;});}return null;};}function removeEntity(_0x3ec8c1,_0x3e645c){return function(_0x5647d5){if(_0x5647d5){return _0x5647d5['destroy']()[_0x5de1('0x2c')](function(){_0x3ec8c1[_0x5de1('0x20')](0xcc)[_0x5de1('0x21')]();});}};}function handleEntityNotFound(_0x3c5e23,_0x167712){return function(_0x4c0558){if(!_0x4c0558){_0x3c5e23['sendStatus'](0x194);}return _0x4c0558;};}function handleError(_0x66358d,_0x41909b){_0x41909b=_0x41909b||0x1f4;return function(_0x38b4c6){logger['error'](_0x38b4c6[_0x5de1('0x2d')]);if(_0x38b4c6[_0x5de1('0x2e')]){delete _0x38b4c6['name'];}_0x66358d[_0x5de1('0x20')](_0x41909b)[_0x5de1('0x2f')](_0x38b4c6);};}function getInteractionUsers(_0x516a25,_0x40b7c6){return new BPromise(function(_0xfbedd0,_0x5708d4){try{if(_0x40b7c6[_0x516a25['id']]){_0x516a25[_0x5de1('0x30')]=_[_0x5de1('0x31')](_0x40b7c6[_0x516a25['id']],function(_0x36f7f0){return{'id':_0x36f7f0['id'],'fullname':_0x36f7f0[_0x5de1('0x32')]};});}}catch(_0x357fc6){_0x5708d4(_0x357fc6);}_0xfbedd0(_0x516a25);});}function getInteractionTags(_0x4df7df,_0xa4dabf){return new BPromise(function(_0x4434f8,_0x5769b9){try{if(_0x4df7df['TagIds']){_0x4df7df[_0x5de1('0x33')]=[];_0x4df7df[_0x5de1('0x34')][_0x5de1('0x35')](',')['forEach'](function(_0xbc3e21){_0x4df7df[_0x5de1('0x33')]['push'](_0xa4dabf[_0xbc3e21]);});}delete _0x4df7df[_0x5de1('0x34')];}catch(_0x3f60c3){_0x5769b9(_0x3f60c3);}_0x4434f8(_0x4df7df);});}function updateFaxInteraction(_0x4799e8,_0x5bd22c,_0x41bbe4){return new BPromise(function(_0x56b97f,_0x20b6c9){return getInteractionUsers(_0x4799e8,_0x41bbe4)[_0x5de1('0x2c')](function(_0x4f6a0c){return getInteractionTags(_0x4f6a0c,_0x5bd22c);})[_0x5de1('0x2c')](function(_0x18ea6a){return getStateInteraction(_0x18ea6a);})['then'](function(_0x298f11){_0x56b97f(_0x298f11);})[_0x5de1('0x36')](function(_0x3caf2d){_0x20b6c9(_0x3caf2d);});});}function getStateInteraction(_0x10679a){return new BPromise(function(_0x57f9ea){_0x10679a[_0x5de1('0x37')]=0x0;_0x10679a[_0x5de1('0x38')]=0x0;_0x10679a['answered']=0x0;_0x10679a[_0x5de1('0x39')]=0x0;_0x10679a[_0x5de1('0x3a')]=0x0;if(!_0x10679a[_0x5de1('0x3b')]&&!_0x10679a['UserId']){_0x10679a['waiting']+=0x1;}if(!_0x10679a[_0x5de1('0x3b')]&&_0x10679a[_0x5de1('0x3c')]){_0x10679a['talking']+=0x1;if(_0x10679a[_0x5de1('0x37')]){_0x10679a[_0x5de1('0x37')]-=0x1;}}if(_0x10679a['closed']&&_0x10679a[_0x5de1('0x3c')]){_0x10679a[_0x5de1('0x3d')]+=0x1;if(_0x10679a['talking']){_0x10679a[_0x5de1('0x38')]-=0x1;}}if(_0x10679a['closed']&&!_0x10679a[_0x5de1('0x3c')]){_0x10679a[_0x5de1('0x39')]+=0x1;if(_0x10679a[_0x5de1('0x37')]){_0x10679a[_0x5de1('0x37')]-=0x1;}}_0x10679a[_0x5de1('0x3a')]+=0x1;_0x57f9ea(_0x10679a);});}exports[_0x5de1('0x3e')]=function(_0x2b762c,_0x3457d4){var _0x77eef6={},_0xbcfade={},_0x238fbf={'count':0x0,'rows':[]};var _0xcfc9e6=_[_0x5de1('0x31')](db[_0x5de1('0x3f')][_0x5de1('0x40')],function(_0x1f2aaa){return{'name':_0x1f2aaa[_0x5de1('0x41')],'type':_0x1f2aaa[_0x5de1('0x42')][_0x5de1('0x43')]};});_0xbcfade['model']=_[_0x5de1('0x31')](_0xcfc9e6,_0x5de1('0x2e'));_0xbcfade['query']=_[_0x5de1('0x44')](_0x2b762c[_0x5de1('0x45')]);_0xbcfade[_0x5de1('0x46')]=_['intersection'](_0xbcfade[_0x5de1('0x47')],_0xbcfade['query']);_0x77eef6['attributes']=_[_0x5de1('0x48')](_0xbcfade[_0x5de1('0x47')],qs[_0x5de1('0x49')](_0x2b762c['query']['fields']));_0x77eef6[_0x5de1('0x4a')]=_0x77eef6[_0x5de1('0x4a')]['length']?_0x77eef6[_0x5de1('0x4a')]:_0xbcfade[_0x5de1('0x47')];if(!_0x2b762c[_0x5de1('0x45')][_0x5de1('0x4b')](_0x5de1('0x4c'))){_0x77eef6[_0x5de1('0x24')]=qs[_0x5de1('0x24')](_0x2b762c[_0x5de1('0x45')][_0x5de1('0x24')]);_0x77eef6[_0x5de1('0x22')]=qs[_0x5de1('0x22')](_0x2b762c[_0x5de1('0x45')]['offset']);}_0x77eef6[_0x5de1('0x4d')]=qs[_0x5de1('0x4e')](_0x2b762c[_0x5de1('0x45')][_0x5de1('0x4e')]);_0x77eef6['where']=qs[_0x5de1('0x46')](_['pick'](_0x2b762c[_0x5de1('0x45')],_0xbcfade['filters']),_0xcfc9e6);var _0x5a1e30=[];var _0x4f2f6e=squel[_0x5de1('0x4f')]()['field']('id')[_0x5de1('0x50')](_0x5de1('0x2e'))['field']('color')[_0x5de1('0x51')]('tools_tags');var _0x4b0b7b=squel[_0x5de1('0x4f')]()['field'](_0x5de1('0x52'))[_0x5de1('0x50')]('u.fullname')[_0x5de1('0x50')]('ui.FaxInteractionId')['from'](_0x5de1('0x53'),'ui')[_0x5de1('0x54')]('users','u',_0x5de1('0x55'));var _0x554599=squel[_0x5de1('0x4f')]()[_0x5de1('0x51')](_0x5de1('0x56'),'i')[_0x5de1('0x54')]('cm_contacts','c',_0x5de1('0x57'))[_0x5de1('0x54')]('users','o',_0x5de1('0x58'))[_0x5de1('0x54')](_0x5de1('0x59'),'a',_0x5de1('0x5a'))[_0x5de1('0x54')](_0x5de1('0x5b'),'me',_0x5de1('0x5c'))[_0x5de1('0x54')](_0x5de1('0x5d'),'it','it.FaxInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0x5de1('0x5e'));var _0x356e24=squel[_0x5de1('0x5f')]();var _0x3e2a92=[];var _0x4005e5=squel[_0x5de1('0x5f')]();var _0x8a706e;if(_0x2b762c[_0x5de1('0x45')][_0x5de1('0x60')]){_0x8a706e=as['parseSearch'](_0x2b762c[_0x5de1('0x45')][_0x5de1('0x60')]);var _0x2d0e1a=_0x8a706e[_0x5de1('0x61')];for(var _0x3f5623=0x0;_0x3f5623<_0x8a706e[_0x5de1('0x62')]['length'];_0x3f5623++){var _0x12f386=_0x8a706e['conditions'][_0x3f5623];var _0x240af6='i';var _0x3822c6=_[_0x5de1('0x63')](_0xcfc9e6,[_0x5de1('0x2e'),_0x12f386[_0x5de1('0x50')]]);if(!_0x3822c6){switch(_0x12f386[_0x5de1('0x50')]){case _0x5de1('0x64'):if(_0x12f386['value']==0x1){_0x554599[_0x5de1('0x65')]('`'+_0x12f386[_0x5de1('0x50')]+_0x5de1('0x66'));}else{_0x554599[_0x5de1('0x65')]('`'+_0x12f386[_0x5de1('0x50')]+'`\x20>\x200');}break;case'Contact':if(_0x12f386['operator']===_0x5de1('0x67')){if(_0x12f386[_0x5de1('0x68')][_0x5de1('0x35')]('\x20')[_0x5de1('0x69')]>0x1){_0x356e24[_0x2d0e1a](_0x5de1('0x6a'),qs[_0x5de1('0x6b')](_0x12f386[_0x5de1('0x68')]),null);}else{var _0xa5a02c='%'+_0x12f386[_0x5de1('0x68')]+'%';_0x356e24[_0x2d0e1a](_0x5de1('0x6c'),_0xa5a02c,_0xa5a02c,_0xa5a02c);}}else{_0x3822c6=_[_0x5de1('0x63')](_0xcfc9e6,['name',_0x5de1('0x6d')]);_0x12f386[_0x5de1('0x50')]=_0x5de1('0x6d');_0x19b709=as[_0x5de1('0x6e')](_0x240af6,_0x3822c6[_0x5de1('0x42')],_0x12f386);_0x356e24[_0x2d0e1a](_0x19b709[_0x5de1('0x6f')],_0x19b709[_0x5de1('0x68')][_0x5de1('0x70')],_0x19b709[_0x5de1('0x68')][_0x5de1('0x21')]);}break;case _0x5de1('0x71'):var _0x3d3c5a=_0x12f386[_0x5de1('0x68')]['split'](',')[_0x5de1('0x31')](function(_0x5d255f){return Number(_0x5d255f);});_0x3d3c5a[_0x5de1('0x72')](function(_0x4ddaa4){_0x4005e5['or'](_0x5de1('0x73'),'%,'+_0x4ddaa4+',%');});_0x3e2a92=_['union'](_0x3e2a92,_0x3d3c5a);break;case'User':if(_0x12f386[_0x5de1('0x74')]===_0x5de1('0x67')){_0x356e24[_0x2d0e1a](_0x5de1('0x75'),'%'+_0x12f386[_0x5de1('0x68')]+'%',null);}else{_0x3822c6=_[_0x5de1('0x63')](_0xcfc9e6,[_0x5de1('0x2e'),_0x5de1('0x3c')]);_0x12f386[_0x5de1('0x50')]='UserId';_0x19b709=as['buildExpression'](_0x240af6,_0x3822c6['type'],_0x12f386);_0x356e24[_0x2d0e1a](_0x19b709[_0x5de1('0x6f')],_0x19b709[_0x5de1('0x68')][_0x5de1('0x70')],_0x19b709[_0x5de1('0x68')]['end']);}break;case'body':_0x19b709=as[_0x5de1('0x6e')]('me',null,_0x12f386);_0x356e24[_0x2d0e1a](_0x19b709[_0x5de1('0x6f')],_0x19b709[_0x5de1('0x68')][_0x5de1('0x70')],_0x19b709[_0x5de1('0x68')][_0x5de1('0x21')]);break;}}else{var _0x19b709=as[_0x5de1('0x6e')](_0x240af6,_0x3822c6['type'],_0x12f386);_0x356e24[_0x2d0e1a](_0x19b709[_0x5de1('0x6f')],_0x19b709[_0x5de1('0x68')]['start'],_0x19b709[_0x5de1('0x68')][_0x5de1('0x21')]);}}}else{var _0x319986=_(_0x2b762c[_0x5de1('0x45')])[_0x5de1('0x44')]()[_0x5de1('0x31')](function(_0x35b2bd){return _[_0x5de1('0x76')](_0xcfc9e6,[_0x5de1('0x2e'),_0x35b2bd])?_0x35b2bd:undefined;})['compact']()[_0x5de1('0x68')]();if(!_['isEmpty'](_0x319986)){_0x319986[_0x5de1('0x72')](function(_0x335ddd){if(_0x335ddd==='FaxAccountId'){_0x554599[_0x5de1('0x77')]('i.FaxAccountId\x20IN\x20?',[][_0x5de1('0x78')](_0x2b762c[_0x5de1('0x45')][_0x335ddd]));}else if(_0x335ddd===_0x5de1('0x79')){var _0x50d6b7=JSON['parse'](_0x2b762c[_0x5de1('0x45')][_0x335ddd])[_0x5de1('0x7a')];var _0x53e7bb=JSON[_0x5de1('0x7b')](_0x2b762c[_0x5de1('0x45')][_0x335ddd])[_0x5de1('0x7c')];_0x554599[_0x5de1('0x77')](_0x5de1('0x7d'),_0x50d6b7,_0x53e7bb);}else{if(_0x2b762c[_0x5de1('0x45')][_0x335ddd]===_0x5de1('0x7e')){_0x554599['where']('i.'+_0x335ddd+_0x5de1('0x7f'));}else{_0x554599['where']('i.'+_0x335ddd+_0x5de1('0x80'),_0x2b762c[_0x5de1('0x45')][_0x335ddd]);}}});}if(_0x2b762c[_0x5de1('0x45')][_0x5de1('0x81')]){if(_0x2b762c[_0x5de1('0x45')][_0x5de1('0x81')]==0x1){_0x554599[_0x5de1('0x65')](_0x5de1('0x82'));}else{_0x554599[_0x5de1('0x65')](_0x5de1('0x83'));}}if(_0x2b762c['query'][_0x5de1('0x84')]){_0x3e2a92=_['isArray'](_0x2b762c[_0x5de1('0x45')][_0x5de1('0x84')])?_0x2b762c[_0x5de1('0x45')][_0x5de1('0x84')]:new Array(_0x2b762c['query'][_0x5de1('0x84')]);_0x3e2a92[_0x5de1('0x72')](function(_0x1f8f97){_0x4005e5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1f8f97+',%');});}if(_0x2b762c[_0x5de1('0x45')][_0x5de1('0x85')]){var _0x1c0bc0=_0x2b762c[_0x5de1('0x45')][_0x5de1('0x85')][_0x5de1('0x86')]('\x5c','\x5c\x5c')[_0x5de1('0x86')](/'/g,'\x27\x27');if(qs[_0x5de1('0x87')](_0x1c0bc0)){_0x356e24['or'](_0x5de1('0x88'),_0x1c0bc0+'%')['or'](_0x5de1('0x89'),_0x1c0bc0+'%');}_0x356e24['or'](_0x5de1('0x8a'),_0x1c0bc0+'%');}}_0x554599[_0x5de1('0x77')](_0x356e24);_0x554599['group'](_0x5de1('0x8b'));var _0x26026d={'type':db['Sequelize'][_0x5de1('0x8c')][_0x5de1('0x8d')],'raw':!![]};var _0x31730b=_0x554599[_0x5de1('0x8e')]();_0x31730b['field']('i.id');_0x31730b['field'](_0x5de1('0x8f'),_0x5de1('0x64'));if(_0x77eef6[_0x5de1('0x4d')]){_0x77eef6[_0x5de1('0x4d')][_0x5de1('0x72')](function(_0x4662d2){var _0x9e9d07=_0x4662d2[0x0]===_0x5de1('0x90')?_0x4662d2[0x0]:'i.'+_0x4662d2[0x0];_0x554599['order'](_0x9e9d07,_0x4662d2[0x1]===_0x5de1('0x91')?![]:!![]);});}if(!_['isEmpty'](_0x3e2a92)){_0x554599['having'](_0x4005e5);_0x31730b[_0x5de1('0x77')](_0x5de1('0x92'),_0x3e2a92);}BPromise[_0x5de1('0x93')]()[_0x5de1('0x2c')](function(){if(!_0x8a706e){if(_0x2b762c['query']['FaxAccountId'])return;_0x31730b[_0x5de1('0x77')](_0x5de1('0x94'));_0x554599['where'](_0x5de1('0x94'));return;}if(_0x2b762c[_0x5de1('0x95')][_0x5de1('0x96')]!==_0x5de1('0x97'))return;return _0x2b762c['user']['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x5de1('0x2c')](function(_0x24cdb5){if(_[_0x5de1('0x98')](_0x24cdb5)){_0x31730b[_0x5de1('0x77')](_0x5de1('0x99'));_0x554599[_0x5de1('0x77')](_0x5de1('0x99'));}else{_0x31730b['where'](_0x5de1('0x9a'),_[_0x5de1('0x31')](_0x24cdb5,'id'));_0x554599['where'](_0x5de1('0x9a'),_[_0x5de1('0x31')](_0x24cdb5,'id'));}});})[_0x5de1('0x2c')](function(){if(_0x2b762c[_0x5de1('0x95')][_0x5de1('0x96')]===_0x5de1('0x97')&&!_0x8a706e&&!_0x2b762c[_0x5de1('0x45')][_0x5de1('0x9b')])return[];return db[_0x5de1('0x9c')]['query'](_0x31730b[_0x5de1('0x9d')](),_0x26026d);})[_0x5de1('0x2c')](function(_0x572322){_0x238fbf[_0x5de1('0x25')]=_0x572322[_0x5de1('0x69')];if(_0x238fbf[_0x5de1('0x25')]===0x0)return[];return db[_0x5de1('0x9c')][_0x5de1('0x45')](_0x4f2f6e[_0x5de1('0x9d')](),_0x26026d)[_0x5de1('0x2c')](function(_0x13e237){_0x5a1e30=_[_0x5de1('0x9e')](_0x13e237,'id');_0x26026d=_[_0x5de1('0x9f')](_0x26026d,{'model':db[_0x5de1('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b762c[_0x5de1('0x45')]['fields']){_0x77eef6[_0x5de1('0x4a')]['forEach'](function(_0x3d0e3c){_0x554599[_0x5de1('0x50')]('i.'+_0x3d0e3c);});}else{_0x554599['field'](_0x5de1('0x8f'),_0x5de1('0x64'));_0x554599['field']('a.key',_0x5de1('0xa0'));_0x554599[_0x5de1('0x50')](_0x5de1('0xa1'),_0x5de1('0xa2'));_0x554599['field'](_0x5de1('0xa3'),_0x5de1('0x90'));_0x554599[_0x5de1('0x50')](_0x5de1('0xa4'));_0x554599[_0x5de1('0x50')](_0x5de1('0xa5'),_0x5de1('0xa6'));_0x554599[_0x5de1('0x50')](_0x5de1('0xa7'),'Contact.lastName');_0x554599[_0x5de1('0x50')]('c.email','Contact.email');_0x554599['field'](_0x5de1('0xa8'),'Contact.phone');_0x554599[_0x5de1('0x50')](_0x5de1('0xa9'),'Contact.mobile');_0x554599[_0x5de1('0x50')](_0x5de1('0xaa'),'Contact.fax');_0x554599[_0x5de1('0x50')]('o.fullname',_0x5de1('0xab'));_0x554599['field'](_0x5de1('0xac'),_0x5de1('0xad'));_0x554599[_0x5de1('0x50')](_0x5de1('0xae'),_0x5de1('0x34'));}if(_0x77eef6[_0x5de1('0x24')])_0x554599[_0x5de1('0x24')](_0x77eef6[_0x5de1('0x24')]);if(_0x77eef6[_0x5de1('0x22')])_0x554599['offset'](_0x77eef6[_0x5de1('0x22')]);return db[_0x5de1('0x9c')][_0x5de1('0x45')](_0x554599['toString'](),_0x26026d);})[_0x5de1('0x2c')](function(_0x109df1){if(_0x109df1[_0x5de1('0x69')]>0x0)_0x4b0b7b[_0x5de1('0x77')]('ui.FaxInteractionId\x20IN\x20?',_[_0x5de1('0x31')](_0x109df1,'id'));return db[_0x5de1('0x9c')][_0x5de1('0x45')](_0x4b0b7b[_0x5de1('0x9d')](),_0x26026d)[_0x5de1('0x2c')](function(_0xca8ed5){var _0x527dc8=_[_0x5de1('0xaf')](_0xca8ed5,'FaxInteractionId');var _0x554205=[];_0x109df1['forEach'](function(_0x279da0){_0x554205[_0x5de1('0xb0')](updateFaxInteraction(_0x279da0,_0x5a1e30,_0x527dc8));});return BPromise[_0x5de1('0xb1')](_0x554205);});});})[_0x5de1('0x2c')](function(_0x5dc730){_0x238fbf[_0x5de1('0xb2')]=_0x5dc730;return _0x238fbf;})[_0x5de1('0x2c')](respondWithFilteredResult(_0x3457d4,_0x77eef6))[_0x5de1('0x36')](handleError(_0x3457d4,null));};exports[_0x5de1('0xb3')]=function(_0x4137f8,_0x1563be){var _0xae2fb5={'raw':![],'where':{'id':_0x4137f8[_0x5de1('0xb4')]['id']}},_0x523389={};_0x523389[_0x5de1('0x47')]=_[_0x5de1('0x44')](db[_0x5de1('0x3f')][_0x5de1('0x40')]);_0x523389[_0x5de1('0x45')]=_['keys'](_0x4137f8[_0x5de1('0x45')]);_0x523389[_0x5de1('0x46')]=_[_0x5de1('0x48')](_0x523389['model'],_0x523389[_0x5de1('0x45')]);_0xae2fb5['attributes']=_['intersection'](_0x523389['model'],qs[_0x5de1('0x49')](_0x4137f8[_0x5de1('0x45')][_0x5de1('0x49')]));_0xae2fb5['attributes']=_0xae2fb5[_0x5de1('0x4a')][_0x5de1('0x69')]?_0xae2fb5['attributes']:_0x523389[_0x5de1('0x47')];if(_0x4137f8['query']['includeAll']){_0xae2fb5['include']=[{'all':!![]}];}_0xae2fb5=_[_0x5de1('0x9f')]({},_0xae2fb5,_0x4137f8['options']);return db[_0x5de1('0x3f')][_0x5de1('0x63')](_0xae2fb5)[_0x5de1('0x2c')](handleEntityNotFound(_0x1563be,null))[_0x5de1('0x2c')](respondWithResult(_0x1563be,null))[_0x5de1('0x36')](handleError(_0x1563be,null));};exports['create']=function(_0x254c56,_0x100408){return db[_0x5de1('0x3f')][_0x5de1('0xb5')](_0x254c56[_0x5de1('0xb6')],{})[_0x5de1('0x2c')](respondWithResult(_0x100408,0xc9))[_0x5de1('0x36')](handleError(_0x100408,null));};exports[_0x5de1('0x2b')]=function(_0x189348,_0x5c7d5e){if(_0x189348[_0x5de1('0xb6')]['id']){delete _0x189348[_0x5de1('0xb6')]['id'];}return db['FaxInteraction'][_0x5de1('0x63')]({'where':{'id':_0x189348[_0x5de1('0xb4')]['id']}})[_0x5de1('0x2c')](handleEntityNotFound(_0x5c7d5e,null))['then'](saveUpdates(_0x189348[_0x5de1('0xb6')],null))['then'](respondWithResult(_0x5c7d5e,null))[_0x5de1('0x36')](handleError(_0x5c7d5e,null));};exports['destroy']=function(_0x4ecbf2,_0x4c7f31){return db[_0x5de1('0x3f')][_0x5de1('0x63')]({'where':{'id':_0x4ecbf2[_0x5de1('0xb4')]['id']}})[_0x5de1('0x2c')](handleEntityNotFound(_0x4c7f31,null))[_0x5de1('0x2c')](removeEntity(_0x4c7f31,null))[_0x5de1('0x36')](handleError(_0x4c7f31,null));};exports[_0x5de1('0xb7')]=function(_0x69ece1,_0xcd5ff5){return db[_0x5de1('0x3f')][_0x5de1('0xb7')]()['then'](respondWithResult(_0xcd5ff5,null))[_0x5de1('0x36')](handleError(_0xcd5ff5,null));};exports[_0x5de1('0xb8')]=function(_0x28c7a2,_0x1a945d,_0x1e41f5){return db[_0x5de1('0xb9')][_0x5de1('0x63')]({'where':{'id':_0x28c7a2[_0x5de1('0xb4')]['id']}})[_0x5de1('0x2c')](handleEntityNotFound(_0x1a945d,null))[_0x5de1('0x2c')](function(_0x26c370){if(_0x26c370){return _0x26c370[_0x5de1('0xb8')](_0x28c7a2['body'][_0x5de1('0xba')],_[_0x5de1('0xbb')](_0x28c7a2[_0x5de1('0xb6')],[_0x5de1('0xba'),'id'])||{});}})[_0x5de1('0x2c')](respondWithResult(_0x1a945d,null))['catch'](handleError(_0x1a945d,null));};exports[_0x5de1('0xbc')]=function(_0x21dc92,_0x2a7f65,_0x2bfeef){var _0x54aa90={'raw':![],'where':{}};var _0x22e81f={};var _0x5d7fec={'count':0x0,'rows':[]};return db[_0x5de1('0x3f')][_0x5de1('0xbd')]({'where':{'id':_0x21dc92[_0x5de1('0xb4')]['id']}})[_0x5de1('0x2c')](handleEntityNotFound(_0x2a7f65,null))[_0x5de1('0x2c')](function(_0x361365){if(_0x361365){_0x22e81f[_0x5de1('0x47')]=_[_0x5de1('0x44')](db[_0x5de1('0xb9')][_0x5de1('0x40')]);_0x22e81f[_0x5de1('0x45')]=_[_0x5de1('0x44')](_0x21dc92[_0x5de1('0x45')]);_0x22e81f['filters']=_[_0x5de1('0x48')](_0x22e81f[_0x5de1('0x47')],_0x22e81f[_0x5de1('0x45')]);_0x54aa90[_0x5de1('0x4a')]=_[_0x5de1('0x48')](_0x22e81f['model'],qs[_0x5de1('0x49')](_0x21dc92[_0x5de1('0x45')][_0x5de1('0x49')]));_0x54aa90[_0x5de1('0x4a')]=_0x54aa90[_0x5de1('0x4a')][_0x5de1('0x69')]?_0x54aa90[_0x5de1('0x4a')]:_0x22e81f['model'];if(!_0x21dc92[_0x5de1('0x45')]['hasOwnProperty']('nolimit')){_0x54aa90[_0x5de1('0x24')]=qs[_0x5de1('0x24')](_0x21dc92[_0x5de1('0x45')][_0x5de1('0x24')]);_0x54aa90[_0x5de1('0x22')]=qs[_0x5de1('0x22')](_0x21dc92[_0x5de1('0x45')][_0x5de1('0x22')]);}_0x54aa90[_0x5de1('0x4d')]=qs['sort'](_0x21dc92[_0x5de1('0x45')][_0x5de1('0x4e')]);_0x54aa90['where']=qs[_0x5de1('0x46')](_[_0x5de1('0xbe')](_0x21dc92[_0x5de1('0x45')],_0x22e81f['filters']));_0x54aa90[_0x5de1('0x77')]['FaxInteractionId']=_0x361365['id'];if(_0x21dc92['query'][_0x5de1('0x85')]){_0x54aa90[_0x5de1('0x77')]=_[_0x5de1('0x9f')](_0x54aa90[_0x5de1('0x77')],{'$or':_[_0x5de1('0x31')](_0x54aa90[_0x5de1('0x4a')],function(_0x3f4dc9){var _0x477eab={};_0x477eab[_0x3f4dc9]={'$like':'%'+_0x21dc92[_0x5de1('0x45')]['filter']+'%'};return _0x477eab;})});}if(_0x21dc92[_0x5de1('0x45')][_0x5de1('0x7a')]){var _0xd10f4f=_0x21dc92[_0x5de1('0x45')][_0x5de1('0x7a')]['split'](',');var _0x3bc636={};_0x3bc636[_0xd10f4f[0x0]]={'$gte':moment(_0xd10f4f[0x1])[_0x5de1('0xbf')](_0x5de1('0xc0'))};_0x54aa90['where']=_[_0x5de1('0x9f')](_0x54aa90['where'],_0x3bc636);}_0x54aa90=_['merge']({},_0x54aa90,_0x21dc92[_0x5de1('0xc1')]);return db[_0x5de1('0xb9')][_0x5de1('0x25')]({'where':_0x54aa90[_0x5de1('0x77')]})['then'](function(_0x69a6fa){_0x5d7fec[_0x5de1('0x25')]=_0x69a6fa;if(_0x21dc92[_0x5de1('0x45')][_0x5de1('0xc2')]){_0x54aa90['include']=[{'all':!![]}];}return db[_0x5de1('0xb9')][_0x5de1('0xc3')](_0x54aa90);})[_0x5de1('0x2c')](function(_0x3b2917){_0x5d7fec[_0x5de1('0xb2')]=_0x3b2917;return _0x5d7fec;});}})[_0x5de1('0x2c')](respondWithFilteredResult(_0x2a7f65,_0x54aa90))[_0x5de1('0x36')](handleError(_0x2a7f65,null));};exports[_0x5de1('0xc4')]=function(_0x52e9cb,_0x15d850,_0x1a69a1){return db[_0x5de1('0x3f')][_0x5de1('0x63')]({'where':{'id':_0x52e9cb['params']['id']}})[_0x5de1('0x2c')](handleEntityNotFound(_0x15d850,null))[_0x5de1('0x2c')](function(_0x445d40){if(_0x445d40){return _0x445d40['setTags'](_0x52e9cb[_0x5de1('0xb6')][_0x5de1('0xba')],_[_0x5de1('0xbb')](_0x52e9cb[_0x5de1('0xb6')],['ids','id'])||{})[_0x5de1('0xc5')](function(){return db[_0x5de1('0x71')][_0x5de1('0xc3')]({'attributes':['id','name','color'],'where':{'id':_0x52e9cb['body'][_0x5de1('0xba')]}});})[_0x5de1('0x2c')](function(_0xd14778){socket[_0x5de1('0xc6')]('faxInteractionTags:save',{'id':Number(_0x52e9cb['params']['id']),'tags':_0xd14778||[]});return{'id':Number(_0x52e9cb[_0x5de1('0xb4')]['id']),'tags':_0xd14778||[]};});}})['then'](respondWithResult(_0x15d850,null))['catch'](handleError(_0x15d850,null));};exports[_0x5de1('0xc7')]=function(_0x4198ce,_0x28aec4,_0x2c5def){return db['FaxInteraction'][_0x5de1('0x63')]({'where':{'id':_0x4198ce[_0x5de1('0xb4')]['id']}})[_0x5de1('0x2c')](handleEntityNotFound(_0x28aec4,null))['then'](function(_0x2b7ff1){if(_0x2b7ff1){return _0x2b7ff1[_0x5de1('0xc7')](_0x4198ce['query'][_0x5de1('0xba')]);}})[_0x5de1('0x2c')](respondWithStatusCode(_0x28aec4,null))[_0x5de1('0x36')](handleError(_0x28aec4,null));};exports[_0x5de1('0xc8')]=function(_0x4da59e,_0x2c66b3){var _0x30f345=moment()[_0x5de1('0xc9')]()[_0x5de1('0x9d')]();var _0xc1bf75=path[_0x5de1('0xca')](config[_0x5de1('0xcb')],_0x5de1('0xcc'),_0x5de1('0xcd'),'tmp');var _0x2b5094=path['join'](config[_0x5de1('0xcb')],'server','files',_0x5de1('0xce'));var _0x264582=path['join'](_0xc1bf75,_0x30f345);var _0x5ec161=util['format'](_0x5de1('0xcf'),_0x4da59e['params']['id'],_0x30f345);var _0x20125f=path['join'](_0xc1bf75,_0x5ec161);var _0x59da0d=[];_0x59da0d[_0x5de1('0xb0')]({'model':db[_0x5de1('0xd0')],'as':_0x5de1('0xd0'),'raw':!![]});var _0x25d64e=[{'model':db[_0x5de1('0xb9')],'as':_0x5de1('0xd1'),'attributes':['id',_0x5de1('0xb6'),_0x5de1('0x79')],'include':_0x59da0d}];return db[_0x5de1('0x3f')][_0x5de1('0x63')]({'where':{'id':_0x4da59e[_0x5de1('0xb4')]['id']},'include':_0x25d64e})['then'](handleEntityNotFound(_0x2c66b3,null))[_0x5de1('0x2c')](function(_0x3bafcb){if(_0x3bafcb&&_0x3bafcb[_0x5de1('0xd1')]){var _0x110ecf=_0x3bafcb[_0x5de1('0xd2')]({'plain':!![]});fs[_0x5de1('0xd3')](_0x264582);for(var _0x48b9c4=0x0;_0x48b9c4<_0x110ecf['Messages'][_0x5de1('0x69')];_0x48b9c4++){var _0x41af31=_0x110ecf[_0x5de1('0xd1')][_0x48b9c4][_0x5de1('0xd0')];if(_0x41af31){var _0x3d0365=path[_0x5de1('0xca')](_0x2b5094,_0x41af31['basename']);if(fs[_0x5de1('0xd4')](_0x3d0365)){fs[_0x5de1('0xd5')](_0x3d0365)['pipe'](fs[_0x5de1('0xd6')](path[_0x5de1('0xca')](_0x264582,_0x41af31['basename'])));}}}return BPromise[_0x5de1('0x93')]()[_0x5de1('0x2c')](function(){return new BPromise(function(_0x18ef44,_0x4ca9ef){zipdir(_0x264582,{'saveTo':_0x20125f},function(_0xc14c8a,_0x4566f8){if(_0xc14c8a)return _0x4ca9ef(_0xc14c8a);return _0x18ef44(_0x4566f8);});})[_0x5de1('0x2c')](function(){return new BPromise(function(_0x5cbfc3,_0x226c6c){rimraf(_0x264582,function(_0xc68ff0){if(_0xc68ff0)_0x226c6c(_0xc68ff0);return _0x5cbfc3();});});})[_0x5de1('0x2c')](function(){return _0x2c66b3[_0x5de1('0xc8')](_0x20125f,_0x5ec161,function(_0x321f6e){if(_0x321f6e){console[_0x5de1('0xd7')](_0x5de1('0xd8'),_0x321f6e);}else{fs['unlinkSync'](_0x20125f);}});});});}else{return _0x2c66b3[_0x5de1('0x1f')](0xc8);}})[_0x5de1('0x36')](handleError(_0x2c66b3,null));}; \ No newline at end of file +var _0xf270=['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','a.id\x20=\x20i.FaxAccountId','fax_messages','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','having','`\x20=\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','ContactId','type','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?','buildExpression','body','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','catch','show','params','rawAttributes','includeAll','include','create','update','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','faxInteractionTags:save','removeTags','download','unix','join','root','server','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','existsSync','pipe','createWriteStream','basename','resolve','log','unlinkSync','eml-format','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/util','redis','defaults','localhost','./faxInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','end','error','stack','name','Users','map','fullname','TagIds','forEach','Tags','then','waiting','talking','answered','UserId','closed','unmanaged','index','FaxInteraction','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId'];(function(_0x28905e,_0x4a7ca2){var _0x15f4ec=function(_0x1b6ce5){while(--_0x1b6ce5){_0x28905e['push'](_0x28905e['shift']());}};_0x15f4ec(++_0x4a7ca2);}(_0xf270,0x85));var _0x0f27=function(_0x30f030,_0xd03b7a){_0x30f030=_0x30f030-0x0;var _0xf7614f=_0xf270[_0x30f030];return _0xf7614f;};'use strict';var emlformat=require(_0x0f27('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0f27('0x1'));var rp=require('request-promise');var moment=require(_0x0f27('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0f27('0x3'));var util=require(_0x0f27('0x4'));var path=require(_0x0f27('0x5'));var sox=require(_0x0f27('0x6'));var csv=require('to-csv');var ejs=require(_0x0f27('0x7'));var fs=require('fs');var fs_extra=require(_0x0f27('0x8'));var _=require(_0x0f27('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0f27('0xa'));var toCsv=require(_0x0f27('0xb'));var querystring=require(_0x0f27('0xc'));var Papa=require('papaparse');var Redis=require(_0x0f27('0xd'));var authService=require(_0x0f27('0xe'));var qs=require(_0x0f27('0xf'));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('../../config/environment');var licenseUtil=require(_0x0f27('0x10'));var db=require('../../mysqldb')['db'];config[_0x0f27('0x11')]=_[_0x0f27('0x12')](config[_0x0f27('0x11')],{'host':_0x0f27('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0f27('0x14'))[_0x0f27('0x15')](socket);function respondWithStatusCode(_0x2d3324,_0x3c4b8c){_0x3c4b8c=_0x3c4b8c||0xcc;return function(_0x3bde55){if(_0x3bde55){return _0x2d3324['sendStatus'](_0x3c4b8c);}return _0x2d3324['status'](_0x3c4b8c)['end']();};}function respondWithResult(_0x219634,_0x1fecc2){_0x1fecc2=_0x1fecc2||0xc8;return function(_0x957125){if(_0x957125){return _0x219634[_0x0f27('0x16')](_0x1fecc2)[_0x0f27('0x17')](_0x957125);}};}function respondWithFilteredResult(_0x172131,_0x3dc20b){return function(_0x51d4c4){if(_0x51d4c4){var _0x42f86b=typeof _0x3dc20b[_0x0f27('0x18')]===_0x0f27('0x19')&&typeof _0x3dc20b[_0x0f27('0x1a')]==='undefined';var _0xd2cbce=_0x51d4c4[_0x0f27('0x1b')];var _0x146952=_0x42f86b?0x0:_0x3dc20b[_0x0f27('0x18')];var _0x42919f=_0x42f86b?_0x51d4c4[_0x0f27('0x1b')]:_0x3dc20b[_0x0f27('0x18')]+_0x3dc20b[_0x0f27('0x1a')];var _0x5b9074;if(_0x42919f>=_0xd2cbce){_0x42919f=_0xd2cbce;_0x5b9074=0xc8;}else{_0x5b9074=0xce;}_0x172131[_0x0f27('0x16')](_0x5b9074);return _0x172131[_0x0f27('0x1c')](_0x0f27('0x1d'),_0x146952+'-'+_0x42919f+'/'+_0xd2cbce)[_0x0f27('0x17')](_0x51d4c4);}return null;};}function patchUpdates(_0x2e1f8d){return function(_0x1e55c0){try{jsonpatch[_0x0f27('0x1e')](_0x1e55c0,_0x2e1f8d,!![]);}catch(_0x1086c6){return BPromise[_0x0f27('0x1f')](_0x1086c6);}return _0x1e55c0[_0x0f27('0x20')]();};}function saveUpdates(_0x2e9723,_0x1cbc3f){return function(_0x1d8551){if(_0x1d8551){return _0x1d8551['update'](_0x2e9723)['then'](function(_0x149530){return _0x149530;});}return null;};}function removeEntity(_0x3248f7,_0x248f13){return function(_0x2aa684){if(_0x2aa684){return _0x2aa684[_0x0f27('0x21')]()['then'](function(){_0x3248f7[_0x0f27('0x16')](0xcc)[_0x0f27('0x22')]();});}};}function handleEntityNotFound(_0x2530b6,_0x3f57fd){return function(_0x1e77fe){if(!_0x1e77fe){_0x2530b6['sendStatus'](0x194);}return _0x1e77fe;};}function handleError(_0x457b59,_0x20064d){_0x20064d=_0x20064d||0x1f4;return function(_0x4ffc78){logger[_0x0f27('0x23')](_0x4ffc78[_0x0f27('0x24')]);if(_0x4ffc78['name']){delete _0x4ffc78[_0x0f27('0x25')];}_0x457b59[_0x0f27('0x16')](_0x20064d)['send'](_0x4ffc78);};}function getInteractionUsers(_0xee96c4,_0x53cdd5){return new BPromise(function(_0x39e59e,_0xf274a4){try{if(_0x53cdd5[_0xee96c4['id']]){_0xee96c4[_0x0f27('0x26')]=_[_0x0f27('0x27')](_0x53cdd5[_0xee96c4['id']],function(_0x54a2c8){return{'id':_0x54a2c8['id'],'fullname':_0x54a2c8[_0x0f27('0x28')]};});}}catch(_0x5ad123){_0xf274a4(_0x5ad123);}_0x39e59e(_0xee96c4);});}function getInteractionTags(_0x5472e8,_0x121186){return new BPromise(function(_0x323e26,_0x39f1cb){try{if(_0x5472e8[_0x0f27('0x29')]){_0x5472e8['Tags']=[];_0x5472e8[_0x0f27('0x29')]['split'](',')[_0x0f27('0x2a')](function(_0x525f61){_0x5472e8[_0x0f27('0x2b')]['push'](_0x121186[_0x525f61]);});}delete _0x5472e8['TagIds'];}catch(_0x46f166){_0x39f1cb(_0x46f166);}_0x323e26(_0x5472e8);});}function updateFaxInteraction(_0x371f3e,_0x5ea5cf,_0x10cf90){return new BPromise(function(_0x2ef9cc,_0x14d868){return getInteractionUsers(_0x371f3e,_0x10cf90)['then'](function(_0x13b2f3){return getInteractionTags(_0x13b2f3,_0x5ea5cf);})[_0x0f27('0x2c')](function(_0x2e4d92){return getStateInteraction(_0x2e4d92);})[_0x0f27('0x2c')](function(_0x23946f){_0x2ef9cc(_0x23946f);})['catch'](function(_0x3f1ea7){_0x14d868(_0x3f1ea7);});});}function getStateInteraction(_0x3698b3){return new BPromise(function(_0x3183ae){_0x3698b3[_0x0f27('0x2d')]=0x0;_0x3698b3[_0x0f27('0x2e')]=0x0;_0x3698b3[_0x0f27('0x2f')]=0x0;_0x3698b3['unmanaged']=0x0;_0x3698b3['total']=0x0;if(!_0x3698b3['closed']&&!_0x3698b3[_0x0f27('0x30')]){_0x3698b3[_0x0f27('0x2d')]+=0x1;}if(!_0x3698b3[_0x0f27('0x31')]&&_0x3698b3['UserId']){_0x3698b3[_0x0f27('0x2e')]+=0x1;if(_0x3698b3[_0x0f27('0x2d')]){_0x3698b3[_0x0f27('0x2d')]-=0x1;}}if(_0x3698b3[_0x0f27('0x31')]&&_0x3698b3['UserId']){_0x3698b3[_0x0f27('0x2f')]+=0x1;if(_0x3698b3[_0x0f27('0x2e')]){_0x3698b3[_0x0f27('0x2e')]-=0x1;}}if(_0x3698b3['closed']&&!_0x3698b3[_0x0f27('0x30')]){_0x3698b3[_0x0f27('0x32')]+=0x1;if(_0x3698b3[_0x0f27('0x2d')]){_0x3698b3['waiting']-=0x1;}}_0x3698b3['total']+=0x1;_0x3183ae(_0x3698b3);});}exports[_0x0f27('0x33')]=function(_0x110318,_0x546357){var _0x338182={},_0x3c17ea={},_0x170736={'count':0x0,'rows':[]};var _0x317f1d=_[_0x0f27('0x27')](db[_0x0f27('0x34')]['rawAttributes'],function(_0x5e4f22){return{'name':_0x5e4f22[_0x0f27('0x35')],'type':_0x5e4f22['type']['key']};});_0x3c17ea[_0x0f27('0x36')]=_['map'](_0x317f1d,'name');_0x3c17ea[_0x0f27('0x37')]=_[_0x0f27('0x38')](_0x110318[_0x0f27('0x37')]);_0x3c17ea[_0x0f27('0x39')]=_[_0x0f27('0x3a')](_0x3c17ea[_0x0f27('0x36')],_0x3c17ea[_0x0f27('0x37')]);_0x338182['attributes']=_[_0x0f27('0x3a')](_0x3c17ea[_0x0f27('0x36')],qs[_0x0f27('0x3b')](_0x110318[_0x0f27('0x37')][_0x0f27('0x3b')]));_0x338182['attributes']=_0x338182[_0x0f27('0x3c')][_0x0f27('0x3d')]?_0x338182[_0x0f27('0x3c')]:_0x3c17ea[_0x0f27('0x36')];if(!_0x110318[_0x0f27('0x37')][_0x0f27('0x3e')](_0x0f27('0x3f'))){_0x338182[_0x0f27('0x1a')]=qs['limit'](_0x110318['query']['limit']);_0x338182['offset']=qs[_0x0f27('0x18')](_0x110318[_0x0f27('0x37')]['offset']);}_0x338182['order']=qs[_0x0f27('0x40')](_0x110318[_0x0f27('0x37')][_0x0f27('0x40')]);_0x338182[_0x0f27('0x41')]=qs[_0x0f27('0x39')](_[_0x0f27('0x42')](_0x110318[_0x0f27('0x37')],_0x3c17ea['filters']),_0x317f1d);var _0x353395=[];var _0x58c4c4=squel[_0x0f27('0x43')]()[_0x0f27('0x44')]('id')[_0x0f27('0x44')](_0x0f27('0x25'))[_0x0f27('0x44')](_0x0f27('0x45'))[_0x0f27('0x46')](_0x0f27('0x47'));var _0x39c9fe=squel['select']()['field'](_0x0f27('0x48'))['field'](_0x0f27('0x49'))[_0x0f27('0x44')](_0x0f27('0x4a'))['from'](_0x0f27('0x4b'),'ui')[_0x0f27('0x4c')](_0x0f27('0x4d'),'u',_0x0f27('0x4e'));var _0x4c417d=squel[_0x0f27('0x43')]()[_0x0f27('0x46')](_0x0f27('0x4f'),'i')[_0x0f27('0x4c')](_0x0f27('0x50'),'c',_0x0f27('0x51'))[_0x0f27('0x4c')](_0x0f27('0x4d'),'o','o.id\x20=\x20i.UserId')[_0x0f27('0x4c')]('fax_accounts','a',_0x0f27('0x52'))[_0x0f27('0x4c')](_0x0f27('0x53'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x0f27('0x4c')]('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0x0f27('0x4c')]('tools_tags','t',_0x0f27('0x54'));var _0x5e5da9=squel[_0x0f27('0x55')]();var _0x2e553d=[];var _0x5df1c0=squel['expr']();var _0x48e3c4;if(_0x110318['query']['search']){_0x48e3c4=as[_0x0f27('0x56')](_0x110318[_0x0f27('0x37')][_0x0f27('0x57')]);var _0x20bf27=_0x48e3c4['sqlOperator'];for(var _0x4f91e4=0x0;_0x4f91e4<_0x48e3c4['conditions'][_0x0f27('0x3d')];_0x4f91e4++){var _0x3d835e=_0x48e3c4[_0x0f27('0x58')][_0x4f91e4];var _0x2e8cfb='i';var _0x948fbd=_[_0x0f27('0x59')](_0x317f1d,[_0x0f27('0x25'),_0x3d835e[_0x0f27('0x44')]]);if(!_0x948fbd){switch(_0x3d835e['field']){case _0x0f27('0x5a'):if(_0x3d835e['value']==0x1){_0x4c417d[_0x0f27('0x5b')]('`'+_0x3d835e[_0x0f27('0x44')]+_0x0f27('0x5c'));}else{_0x4c417d[_0x0f27('0x5b')]('`'+_0x3d835e[_0x0f27('0x44')]+'`\x20>\x200');}break;case'Contact':if(_0x3d835e[_0x0f27('0x5d')]===_0x0f27('0x5e')){if(_0x3d835e['value'][_0x0f27('0x5f')]('\x20')[_0x0f27('0x3d')]>0x1){_0x5e5da9[_0x20bf27](_0x0f27('0x60'),qs[_0x0f27('0x61')](_0x3d835e['value']),null);}else{var _0x4734ae='%'+_0x3d835e[_0x0f27('0x62')]+'%';_0x5e5da9[_0x20bf27]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4734ae,_0x4734ae,_0x4734ae);}}else{_0x948fbd=_[_0x0f27('0x59')](_0x317f1d,[_0x0f27('0x25'),'ContactId']);_0x3d835e['field']=_0x0f27('0x63');_0xe3aa72=as['buildExpression'](_0x2e8cfb,_0x948fbd[_0x0f27('0x64')],_0x3d835e);_0x5e5da9[_0x20bf27](_0xe3aa72[_0x0f27('0x65')],_0xe3aa72[_0x0f27('0x62')][_0x0f27('0x66')],_0xe3aa72[_0x0f27('0x62')][_0x0f27('0x22')]);}break;case'Tag':var _0x10a7ed=_0x3d835e[_0x0f27('0x62')][_0x0f27('0x5f')](',')[_0x0f27('0x27')](function(_0x19a1b1){return Number(_0x19a1b1);});_0x10a7ed[_0x0f27('0x2a')](function(_0x9f9f9d){_0x5df1c0['or'](_0x0f27('0x67'),'%,'+_0x9f9f9d+',%');});_0x2e553d=_[_0x0f27('0x68')](_0x2e553d,_0x10a7ed);break;case _0x0f27('0x69'):if(_0x3d835e['operator']===_0x0f27('0x5e')){_0x5e5da9[_0x20bf27](_0x0f27('0x6a'),'%'+_0x3d835e[_0x0f27('0x62')]+'%',null);}else{_0x948fbd=_[_0x0f27('0x59')](_0x317f1d,['name',_0x0f27('0x30')]);_0x3d835e[_0x0f27('0x44')]=_0x0f27('0x30');_0xe3aa72=as[_0x0f27('0x6b')](_0x2e8cfb,_0x948fbd['type'],_0x3d835e);_0x5e5da9[_0x20bf27](_0xe3aa72[_0x0f27('0x65')],_0xe3aa72[_0x0f27('0x62')][_0x0f27('0x66')],_0xe3aa72[_0x0f27('0x62')][_0x0f27('0x22')]);}break;case _0x0f27('0x6c'):_0xe3aa72=as[_0x0f27('0x6b')]('me',null,_0x3d835e);_0x5e5da9[_0x20bf27](_0xe3aa72[_0x0f27('0x65')],_0xe3aa72[_0x0f27('0x62')][_0x0f27('0x66')],_0xe3aa72[_0x0f27('0x62')]['end']);break;}}else{var _0xe3aa72=as['buildExpression'](_0x2e8cfb,_0x948fbd[_0x0f27('0x64')],_0x3d835e);_0x5e5da9[_0x20bf27](_0xe3aa72[_0x0f27('0x65')],_0xe3aa72['value'][_0x0f27('0x66')],_0xe3aa72[_0x0f27('0x62')][_0x0f27('0x22')]);}}}else{var _0x48bfe7=_(_0x110318[_0x0f27('0x37')])['keys']()[_0x0f27('0x27')](function(_0x3e1e0c){return _[_0x0f27('0x6d')](_0x317f1d,[_0x0f27('0x25'),_0x3e1e0c])?_0x3e1e0c:undefined;})['compact']()[_0x0f27('0x62')]();if(!_[_0x0f27('0x6e')](_0x48bfe7)){_0x48bfe7['forEach'](function(_0xcef02b){if(_0xcef02b===_0x0f27('0x6f')){_0x4c417d[_0x0f27('0x41')](_0x0f27('0x70'),[][_0x0f27('0x71')](_0x110318[_0x0f27('0x37')][_0xcef02b]));}else if(_0xcef02b===_0x0f27('0x72')){var _0x1bcfef=JSON[_0x0f27('0x73')](_0x110318[_0x0f27('0x37')][_0xcef02b])[_0x0f27('0x74')];var _0x3d6a5d=JSON[_0x0f27('0x73')](_0x110318['query'][_0xcef02b])[_0x0f27('0x75')];_0x4c417d[_0x0f27('0x41')](_0x0f27('0x76'),_0x1bcfef,_0x3d6a5d);}else{if(_0x110318[_0x0f27('0x37')][_0xcef02b]==='null'){_0x4c417d[_0x0f27('0x41')]('i.'+_0xcef02b+'\x20IS\x20NULL');}else{_0x4c417d[_0x0f27('0x41')]('i.'+_0xcef02b+_0x0f27('0x77'),_0x110318[_0x0f27('0x37')][_0xcef02b]);}}});}if(_0x110318[_0x0f27('0x37')][_0x0f27('0x78')]){if(_0x110318[_0x0f27('0x37')][_0x0f27('0x78')]==0x1){_0x4c417d['having'](_0x0f27('0x79'));}else{_0x4c417d['having'](_0x0f27('0x7a'));}}if(_0x110318[_0x0f27('0x37')][_0x0f27('0x7b')]){_0x2e553d=_[_0x0f27('0x7c')](_0x110318[_0x0f27('0x37')][_0x0f27('0x7b')])?_0x110318[_0x0f27('0x37')][_0x0f27('0x7b')]:new Array(_0x110318[_0x0f27('0x37')][_0x0f27('0x7b')]);_0x2e553d[_0x0f27('0x2a')](function(_0x6fbeb5){_0x5df1c0['or'](_0x0f27('0x67'),'%,'+_0x6fbeb5+',%');});}if(_0x110318[_0x0f27('0x37')]['filter']){var _0x3c1935=_0x110318[_0x0f27('0x37')][_0x0f27('0x7d')][_0x0f27('0x7e')]('\x5c','\x5c\x5c')[_0x0f27('0x7e')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3c1935)){_0x5e5da9['or'](_0x0f27('0x7f'),_0x3c1935+'%')['or'](_0x0f27('0x80'),_0x3c1935+'%');}_0x5e5da9['or'](_0x0f27('0x81'),_0x3c1935+'%');}}_0x4c417d[_0x0f27('0x41')](_0x5e5da9);_0x4c417d[_0x0f27('0x82')]('i.id');var _0x53151d={'type':db[_0x0f27('0x83')][_0x0f27('0x84')][_0x0f27('0x85')],'raw':!![]};var _0x34dda4=_0x4c417d['clone']();_0x34dda4[_0x0f27('0x44')](_0x0f27('0x86'));_0x34dda4[_0x0f27('0x44')](_0x0f27('0x87'),'unreadMessages');if(_0x338182[_0x0f27('0x88')]){_0x338182['order']['forEach'](function(_0x569c8f){var _0x15bf97=_0x569c8f[0x0]===_0x0f27('0x89')?_0x569c8f[0x0]:'i.'+_0x569c8f[0x0];_0x4c417d[_0x0f27('0x88')](_0x15bf97,_0x569c8f[0x1]===_0x0f27('0x8a')?![]:!![]);});}if(!_[_0x0f27('0x6e')](_0x2e553d)){_0x4c417d['having'](_0x5df1c0);_0x34dda4[_0x0f27('0x41')](_0x0f27('0x8b'),_0x2e553d);}BPromise['resolve']()[_0x0f27('0x2c')](function(){if(!_0x48e3c4){if(_0x110318[_0x0f27('0x37')]['FaxAccountId'])return;_0x34dda4[_0x0f27('0x41')](_0x0f27('0x8c'));_0x4c417d[_0x0f27('0x41')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x110318[_0x0f27('0x8d')][_0x0f27('0x8e')]!=='agent')return;return _0x110318[_0x0f27('0x8d')][_0x0f27('0x8f')]({'attributes':['id'],'raw':!![]})[_0x0f27('0x2c')](function(_0x35ee63){if(_[_0x0f27('0x6e')](_0x35ee63)){_0x34dda4['where'](_0x0f27('0x90'));_0x4c417d[_0x0f27('0x41')](_0x0f27('0x90'));}else{_0x34dda4['where'](_0x0f27('0x70'),_[_0x0f27('0x27')](_0x35ee63,'id'));_0x4c417d[_0x0f27('0x41')](_0x0f27('0x70'),_[_0x0f27('0x27')](_0x35ee63,'id'));}});})[_0x0f27('0x2c')](function(){if(_0x110318[_0x0f27('0x8d')][_0x0f27('0x8e')]===_0x0f27('0x91')&&!_0x48e3c4&&!_0x110318['query'][_0x0f27('0x6f')])return[];return db[_0x0f27('0x92')][_0x0f27('0x37')](_0x34dda4[_0x0f27('0x93')](),_0x53151d);})[_0x0f27('0x2c')](function(_0x4a5a82){_0x170736['count']=_0x4a5a82[_0x0f27('0x3d')];if(_0x170736[_0x0f27('0x1b')]===0x0)return[];return db[_0x0f27('0x92')][_0x0f27('0x37')](_0x58c4c4[_0x0f27('0x93')](),_0x53151d)[_0x0f27('0x2c')](function(_0x525ce8){_0x353395=_[_0x0f27('0x94')](_0x525ce8,'id');_0x53151d=_[_0x0f27('0x95')](_0x53151d,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x110318[_0x0f27('0x37')][_0x0f27('0x3b')]){_0x338182['attributes'][_0x0f27('0x2a')](function(_0x4ada46){_0x4c417d[_0x0f27('0x44')]('i.'+_0x4ada46);});}else{_0x4c417d['field'](_0x0f27('0x87'),_0x0f27('0x5a'));_0x4c417d[_0x0f27('0x44')]('a.key','Account.key');_0x4c417d[_0x0f27('0x44')](_0x0f27('0x96'),'Account.mandatoryDisposition');_0x4c417d[_0x0f27('0x44')]('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');_0x4c417d['field'](_0x0f27('0x97'));_0x4c417d['field'](_0x0f27('0x98'),_0x0f27('0x99'));_0x4c417d[_0x0f27('0x44')]('c.lastName',_0x0f27('0x9a'));_0x4c417d[_0x0f27('0x44')](_0x0f27('0x9b'),_0x0f27('0x9c'));_0x4c417d[_0x0f27('0x44')]('c.phone',_0x0f27('0x9d'));_0x4c417d[_0x0f27('0x44')](_0x0f27('0x9e'),_0x0f27('0x9f'));_0x4c417d[_0x0f27('0x44')]('c.fax',_0x0f27('0xa0'));_0x4c417d[_0x0f27('0x44')]('o.fullname',_0x0f27('0xa1'));_0x4c417d[_0x0f27('0x44')](_0x0f27('0xa2'),'Owner.internal');_0x4c417d[_0x0f27('0x44')](_0x0f27('0xa3'),_0x0f27('0x29'));}if(_0x338182['limit'])_0x4c417d[_0x0f27('0x1a')](_0x338182['limit']);if(_0x338182[_0x0f27('0x18')])_0x4c417d[_0x0f27('0x18')](_0x338182[_0x0f27('0x18')]);return db[_0x0f27('0x92')][_0x0f27('0x37')](_0x4c417d['toString'](),_0x53151d);})[_0x0f27('0x2c')](function(_0x519542){if(_0x519542[_0x0f27('0x3d')]>0x0)_0x39c9fe[_0x0f27('0x41')](_0x0f27('0xa4'),_['map'](_0x519542,'id'));return db[_0x0f27('0x92')][_0x0f27('0x37')](_0x39c9fe[_0x0f27('0x93')](),_0x53151d)['then'](function(_0x4e1bc9){var _0x3872b2=_['groupBy'](_0x4e1bc9,_0x0f27('0xa5'));var _0x177b2e=[];_0x519542[_0x0f27('0x2a')](function(_0x4b97c8){_0x177b2e['push'](updateFaxInteraction(_0x4b97c8,_0x353395,_0x3872b2));});return BPromise[_0x0f27('0xa6')](_0x177b2e);});});})[_0x0f27('0x2c')](function(_0x513e38){_0x170736[_0x0f27('0xa7')]=_0x513e38;return _0x170736;})['then'](respondWithFilteredResult(_0x546357,_0x338182))[_0x0f27('0xa8')](handleError(_0x546357,null));};exports[_0x0f27('0xa9')]=function(_0x19e9ae,_0xaaa2f0){var _0x5597e2={'raw':![],'where':{'id':_0x19e9ae[_0x0f27('0xaa')]['id']}},_0xde55f6={};_0xde55f6[_0x0f27('0x36')]=_[_0x0f27('0x38')](db[_0x0f27('0x34')][_0x0f27('0xab')]);_0xde55f6['query']=_[_0x0f27('0x38')](_0x19e9ae[_0x0f27('0x37')]);_0xde55f6[_0x0f27('0x39')]=_[_0x0f27('0x3a')](_0xde55f6['model'],_0xde55f6['query']);_0x5597e2['attributes']=_[_0x0f27('0x3a')](_0xde55f6['model'],qs[_0x0f27('0x3b')](_0x19e9ae[_0x0f27('0x37')][_0x0f27('0x3b')]));_0x5597e2['attributes']=_0x5597e2[_0x0f27('0x3c')][_0x0f27('0x3d')]?_0x5597e2['attributes']:_0xde55f6[_0x0f27('0x36')];if(_0x19e9ae[_0x0f27('0x37')][_0x0f27('0xac')]){_0x5597e2[_0x0f27('0xad')]=[{'all':!![]}];}_0x5597e2=_[_0x0f27('0x95')]({},_0x5597e2,_0x19e9ae['options']);return db[_0x0f27('0x34')][_0x0f27('0x59')](_0x5597e2)[_0x0f27('0x2c')](handleEntityNotFound(_0xaaa2f0,null))[_0x0f27('0x2c')](respondWithResult(_0xaaa2f0,null))['catch'](handleError(_0xaaa2f0,null));};exports['create']=function(_0xd7ff86,_0x208346){return db[_0x0f27('0x34')][_0x0f27('0xae')](_0xd7ff86['body'],{})[_0x0f27('0x2c')](respondWithResult(_0x208346,0xc9))['catch'](handleError(_0x208346,null));};exports[_0x0f27('0xaf')]=function(_0x3f7c66,_0x3815a4){if(_0x3f7c66['body']['id']){delete _0x3f7c66[_0x0f27('0x6c')]['id'];}return db[_0x0f27('0x34')][_0x0f27('0x59')]({'where':{'id':_0x3f7c66[_0x0f27('0xaa')]['id']}})[_0x0f27('0x2c')](handleEntityNotFound(_0x3815a4,null))[_0x0f27('0x2c')](saveUpdates(_0x3f7c66['body'],null))[_0x0f27('0x2c')](respondWithResult(_0x3815a4,null))[_0x0f27('0xa8')](handleError(_0x3815a4,null));};exports['destroy']=function(_0x4a1115,_0x9aff4c){return db['FaxInteraction'][_0x0f27('0x59')]({'where':{'id':_0x4a1115[_0x0f27('0xaa')]['id']}})[_0x0f27('0x2c')](handleEntityNotFound(_0x9aff4c,null))[_0x0f27('0x2c')](removeEntity(_0x9aff4c,null))[_0x0f27('0xa8')](handleError(_0x9aff4c,null));};exports[_0x0f27('0xb0')]=function(_0x3575e6,_0x1b1154){return db[_0x0f27('0x34')]['describe']()[_0x0f27('0x2c')](respondWithResult(_0x1b1154,null))[_0x0f27('0xa8')](handleError(_0x1b1154,null));};exports[_0x0f27('0xb1')]=function(_0x3dc0b4,_0x1d4315,_0x80d2e0){return db[_0x0f27('0xb2')][_0x0f27('0x59')]({'where':{'id':_0x3dc0b4[_0x0f27('0xaa')]['id']}})[_0x0f27('0x2c')](handleEntityNotFound(_0x1d4315,null))[_0x0f27('0x2c')](function(_0x34132b){if(_0x34132b){return _0x34132b[_0x0f27('0xb1')](_0x3dc0b4[_0x0f27('0x6c')][_0x0f27('0xb3')],_[_0x0f27('0xb4')](_0x3dc0b4[_0x0f27('0x6c')],[_0x0f27('0xb3'),'id'])||{});}})['then'](respondWithResult(_0x1d4315,null))[_0x0f27('0xa8')](handleError(_0x1d4315,null));};exports[_0x0f27('0xb5')]=function(_0xc11373,_0x5a5597,_0xdcf8d8){var _0x53d197={'raw':![],'where':{}};var _0x4b3945={};var _0x59df1f={'count':0x0,'rows':[]};return db[_0x0f27('0x34')][_0x0f27('0xb6')]({'where':{'id':_0xc11373[_0x0f27('0xaa')]['id']}})[_0x0f27('0x2c')](handleEntityNotFound(_0x5a5597,null))[_0x0f27('0x2c')](function(_0x12048a){if(_0x12048a){_0x4b3945['model']=_[_0x0f27('0x38')](db['FaxMessage'][_0x0f27('0xab')]);_0x4b3945[_0x0f27('0x37')]=_[_0x0f27('0x38')](_0xc11373[_0x0f27('0x37')]);_0x4b3945[_0x0f27('0x39')]=_[_0x0f27('0x3a')](_0x4b3945['model'],_0x4b3945[_0x0f27('0x37')]);_0x53d197[_0x0f27('0x3c')]=_['intersection'](_0x4b3945[_0x0f27('0x36')],qs[_0x0f27('0x3b')](_0xc11373[_0x0f27('0x37')][_0x0f27('0x3b')]));_0x53d197[_0x0f27('0x3c')]=_0x53d197[_0x0f27('0x3c')][_0x0f27('0x3d')]?_0x53d197[_0x0f27('0x3c')]:_0x4b3945['model'];if(!_0xc11373[_0x0f27('0x37')]['hasOwnProperty'](_0x0f27('0x3f'))){_0x53d197[_0x0f27('0x1a')]=qs[_0x0f27('0x1a')](_0xc11373[_0x0f27('0x37')][_0x0f27('0x1a')]);_0x53d197['offset']=qs[_0x0f27('0x18')](_0xc11373['query'][_0x0f27('0x18')]);}_0x53d197[_0x0f27('0x88')]=qs[_0x0f27('0x40')](_0xc11373[_0x0f27('0x37')][_0x0f27('0x40')]);_0x53d197['where']=qs['filters'](_[_0x0f27('0x42')](_0xc11373[_0x0f27('0x37')],_0x4b3945[_0x0f27('0x39')]));_0x53d197[_0x0f27('0x41')][_0x0f27('0xa5')]=_0x12048a['id'];if(_0xc11373[_0x0f27('0x37')][_0x0f27('0x7d')]){_0x53d197[_0x0f27('0x41')]=_['merge'](_0x53d197[_0x0f27('0x41')],{'$or':_['map'](_0x53d197['attributes'],function(_0x2bc4d9){var _0x357ffa={};_0x357ffa[_0x2bc4d9]={'$like':'%'+_0xc11373['query'][_0x0f27('0x7d')]+'%'};return _0x357ffa;})});}if(_0xc11373['query'][_0x0f27('0x74')]){var _0x492644=_0xc11373[_0x0f27('0x37')]['$gte'][_0x0f27('0x5f')](',');var _0x48e753={};_0x48e753[_0x492644[0x0]]={'$gte':moment(_0x492644[0x1])[_0x0f27('0xb7')](_0x0f27('0xb8'))};_0x53d197['where']=_['merge'](_0x53d197[_0x0f27('0x41')],_0x48e753);}_0x53d197=_[_0x0f27('0x95')]({},_0x53d197,_0xc11373['options']);return db[_0x0f27('0xb2')]['count']({'where':_0x53d197[_0x0f27('0x41')]})[_0x0f27('0x2c')](function(_0x70f244){_0x59df1f[_0x0f27('0x1b')]=_0x70f244;if(_0xc11373[_0x0f27('0x37')][_0x0f27('0xac')]){_0x53d197[_0x0f27('0xad')]=[{'all':!![]}];}return db['FaxMessage'][_0x0f27('0xb9')](_0x53d197);})['then'](function(_0xf14408){_0x59df1f[_0x0f27('0xa7')]=_0xf14408;return _0x59df1f;});}})[_0x0f27('0x2c')](respondWithFilteredResult(_0x5a5597,_0x53d197))[_0x0f27('0xa8')](handleError(_0x5a5597,null));};exports['addTags']=function(_0x1cf858,_0x5b028e,_0x4a0eed){return db['FaxInteraction'][_0x0f27('0x59')]({'where':{'id':_0x1cf858[_0x0f27('0xaa')]['id']}})['then'](handleEntityNotFound(_0x5b028e,null))[_0x0f27('0x2c')](function(_0x6c3e13){if(_0x6c3e13){return _0x6c3e13[_0x0f27('0xba')](_0x1cf858['body'][_0x0f27('0xb3')],_[_0x0f27('0xb4')](_0x1cf858[_0x0f27('0x6c')],['ids','id'])||{})[_0x0f27('0xbb')](function(){return db['Tag'][_0x0f27('0xb9')]({'attributes':['id',_0x0f27('0x25'),_0x0f27('0x45')],'where':{'id':_0x1cf858[_0x0f27('0x6c')]['ids']}});})[_0x0f27('0x2c')](function(_0x5bcb95){socket['emit'](_0x0f27('0xbc'),{'id':Number(_0x1cf858[_0x0f27('0xaa')]['id']),'tags':_0x5bcb95||[]});return{'id':Number(_0x1cf858[_0x0f27('0xaa')]['id']),'tags':_0x5bcb95||[]};});}})[_0x0f27('0x2c')](respondWithResult(_0x5b028e,null))['catch'](handleError(_0x5b028e,null));};exports[_0x0f27('0xbd')]=function(_0x576cbb,_0x4bfdb9,_0x44f25b){return db[_0x0f27('0x34')]['find']({'where':{'id':_0x576cbb[_0x0f27('0xaa')]['id']}})[_0x0f27('0x2c')](handleEntityNotFound(_0x4bfdb9,null))['then'](function(_0x25a731){if(_0x25a731){return _0x25a731[_0x0f27('0xbd')](_0x576cbb[_0x0f27('0x37')][_0x0f27('0xb3')]);}})['then'](respondWithStatusCode(_0x4bfdb9,null))[_0x0f27('0xa8')](handleError(_0x4bfdb9,null));};exports[_0x0f27('0xbe')]=function(_0xc4124b,_0x234886){var _0x1a6f3f=moment()[_0x0f27('0xbf')]()[_0x0f27('0x93')]();var _0x2af199=path[_0x0f27('0xc0')](config[_0x0f27('0xc1')],_0x0f27('0xc2'),'files',_0x0f27('0xc3'));var _0x5d70a1=path['join'](config[_0x0f27('0xc1')],_0x0f27('0xc2'),'files',_0x0f27('0xc4'));var _0x3dc4fd=path[_0x0f27('0xc0')](_0x2af199,_0x1a6f3f);var _0x24ad53=util['format'](_0x0f27('0xc5'),_0xc4124b['params']['id'],_0x1a6f3f);var _0x2480ea=path['join'](_0x2af199,_0x24ad53);var _0x2e7c80=[];_0x2e7c80['push']({'model':db[_0x0f27('0xc6')],'as':'Attachment','raw':!![]});var _0x1b9913=[{'model':db[_0x0f27('0xb2')],'as':'Messages','attributes':['id',_0x0f27('0x6c'),_0x0f27('0x72')],'include':_0x2e7c80}];return db[_0x0f27('0x34')][_0x0f27('0x59')]({'where':{'id':_0xc4124b[_0x0f27('0xaa')]['id']},'include':_0x1b9913})[_0x0f27('0x2c')](handleEntityNotFound(_0x234886,null))[_0x0f27('0x2c')](function(_0x5ec368){if(_0x5ec368&&_0x5ec368[_0x0f27('0xc7')]){var _0x5b5373=_0x5ec368[_0x0f27('0xc8')]({'plain':!![]});fs['mkdirSync'](_0x3dc4fd);for(var _0x4ea28=0x0;_0x4ea28<_0x5b5373[_0x0f27('0xc7')][_0x0f27('0x3d')];_0x4ea28++){var _0x450086=_0x5b5373[_0x0f27('0xc7')][_0x4ea28][_0x0f27('0xc6')];if(_0x450086){var _0x922a6d=path[_0x0f27('0xc0')](_0x5d70a1,_0x450086['basename']);if(fs[_0x0f27('0xc9')](_0x922a6d)){fs['createReadStream'](_0x922a6d)[_0x0f27('0xca')](fs[_0x0f27('0xcb')](path[_0x0f27('0xc0')](_0x3dc4fd,_0x450086[_0x0f27('0xcc')])));}}}return BPromise[_0x0f27('0xcd')]()['then'](function(){return new BPromise(function(_0x529998,_0x3d5172){zipdir(_0x3dc4fd,{'saveTo':_0x2480ea},function(_0x12b35f,_0x261444){if(_0x12b35f)return _0x3d5172(_0x12b35f);return _0x529998(_0x261444);});})[_0x0f27('0x2c')](function(){return new BPromise(function(_0x5ce1d2,_0x463168){rimraf(_0x3dc4fd,function(_0x14a6b1){if(_0x14a6b1)_0x463168(_0x14a6b1);return _0x5ce1d2();});});})['then'](function(){return _0x234886['download'](_0x2480ea,_0x24ad53,function(_0x1d8bee){if(_0x1d8bee){console[_0x0f27('0xce')]('err',_0x1d8bee);}else{fs[_0x0f27('0xcf')](_0x2480ea);}});});});}else{return _0x234886['sendStatus'](0xc8);}})[_0x0f27('0xa8')](handleError(_0x234886,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index b5d62e2..f02dc30 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 _0x4da6=['setMaxListeners','save','update','remove','then','Users','findAll','setDataValue','unreadMessages','length','catch','hasOwnProperty','hook','exports','events','FaxInteraction','../../mysqldb','FaxMessage'];(function(_0x399b6e,_0x3ef3fd){var _0x145cf3=function(_0x7bc119){while(--_0x7bc119){_0x399b6e['push'](_0x399b6e['shift']());}};_0x145cf3(++_0x3ef3fd);}(_0x4da6,0x1d0));var _0x64da=function(_0x295a9c,_0x23e57c){_0x295a9c=_0x295a9c-0x0;var _0x3edd5d=_0x4da6[_0x295a9c];return _0x3edd5d;};'use strict';var EventEmitter=require(_0x64da('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x64da('0x1')];var FaxMessage=require(_0x64da('0x2'))['db'][_0x64da('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x64da('0x4')](0x0);var events={'afterCreate':_0x64da('0x5'),'afterUpdate':_0x64da('0x6'),'afterDestroy':_0x64da('0x7')};function emitEvent(_0x59472f){return function(_0x463946,_0x27e196,_0x438b3c){_0x463946['getUsers']({'attributes':['id'],'raw':!![]})[_0x64da('0x8')](function(_0x9e4073){_0x463946['setDataValue'](_0x64da('0x9'),_0x9e4073['map'](function(_0x4b37ce){return{'id':_0x4b37ce['id']};}));return FaxMessage[_0x64da('0xa')]({'where':{'FaxInteractionId':_0x463946['id'],'direction':'in','read':![]},'raw':!![]});})[_0x64da('0x8')](function(_0x5eb63c){_0x463946[_0x64da('0xb')](_0x64da('0xc'),_0x5eb63c[_0x64da('0xd')]);FaxInteractionEvents['emit'](_0x59472f+':'+_0x463946['id'],_0x463946);FaxInteractionEvents['emit'](_0x59472f,_0x463946);_0x438b3c(null);})[_0x64da('0xe')](_0x438b3c(null));};}for(var e in events){if(events[_0x64da('0xf')](e)){var event=events[e];FaxInteraction[_0x64da('0x10')](e,emitEvent(event));}}module[_0x64da('0x11')]=FaxInteractionEvents; \ No newline at end of file +var _0x1268=['setDataValue','Users','findAll','then','length','emit','catch','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1268,0xf5));var _0x8126=function(_0xdbe2fc,_0xebf2bb){_0xdbe2fc=_0xdbe2fc-0x0;var _0x8e4218=_0x1268[_0xdbe2fc];return _0x8e4218;};'use strict';var EventEmitter=require(_0x8126('0x0'));var FaxInteraction=require(_0x8126('0x1'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x8126('0x2')](0x0);var events={'afterCreate':_0x8126('0x3'),'afterUpdate':_0x8126('0x4'),'afterDestroy':_0x8126('0x5')};function emitEvent(_0x4ebcb6){return function(_0x2ea3e4,_0x3bc4e0,_0x1b0323){_0x2ea3e4[_0x8126('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x390c11){_0x2ea3e4[_0x8126('0x7')](_0x8126('0x8'),_0x390c11['map'](function(_0x5a9245){return{'id':_0x5a9245['id']};}));return FaxMessage[_0x8126('0x9')]({'where':{'FaxInteractionId':_0x2ea3e4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8126('0xa')](function(_0x4a4768){_0x2ea3e4['setDataValue']('unreadMessages',_0x4a4768[_0x8126('0xb')]);FaxInteractionEvents[_0x8126('0xc')](_0x4ebcb6+':'+_0x2ea3e4['id'],_0x2ea3e4);FaxInteractionEvents[_0x8126('0xc')](_0x4ebcb6,_0x2ea3e4);_0x1b0323(null);})[_0x8126('0xd')](_0x1b0323(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 5fc6e43..1eb3379 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 _0xde03=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions','changed','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x453171,_0x15484c){var _0x459c54=function(_0x4efd49){while(--_0x4efd49){_0x453171['push'](_0x453171['shift']());}};_0x459c54(++_0x15484c);}(_0xde03,0x1a2));var _0x3de0=function(_0x9adaf8,_0x5ed3b6){_0x9adaf8=_0x9adaf8-0x0;var _0x1d815b=_0xde03[_0x9adaf8];return _0x1d815b;};'use strict';var _=require(_0x3de0('0x0'));var util=require(_0x3de0('0x1'));var logger=require('../../config/logger')(_0x3de0('0x2'));var moment=require(_0x3de0('0x3'));var BPromise=require(_0x3de0('0x4'));var rp=require(_0x3de0('0x5'));var fs=require('fs');var path=require(_0x3de0('0x6'));var rimraf=require(_0x3de0('0x7'));var config=require(_0x3de0('0x8'));var attributes=require(_0x3de0('0x9'));module[_0x3de0('0xa')]=function(_0x2a1ae8,_0x5b4f05){return _0x2a1ae8[_0x3de0('0xb')]('FaxInteraction',attributes,{'tableName':_0x3de0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2be5a1,_0x4632a8,_0x195eb7){if(_0x2be5a1[_0x3de0('0xd')]('closed')){_0x2be5a1['closedAt']=moment()['format'](_0x3de0('0xe'));}_0x195eb7(null,_0x2be5a1);}}});}; \ No newline at end of file +var _0xa77e=['./faxInteraction.attributes','define','fax_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x7cbcb7,_0x3b2c76){var _0x5ebb7b=function(_0x306b64){while(--_0x306b64){_0x7cbcb7['push'](_0x7cbcb7['shift']());}};_0x5ebb7b(++_0x3b2c76);}(_0xa77e,0x197));var _0xea77=function(_0xef9e80,_0x2d2ce4){_0xef9e80=_0xef9e80-0x0;var _0x59c501=_0xa77e[_0xef9e80];return _0x59c501;};'use strict';var _=require(_0xea77('0x0'));var util=require(_0xea77('0x1'));var logger=require(_0xea77('0x2'))('api');var moment=require(_0xea77('0x3'));var BPromise=require(_0xea77('0x4'));var rp=require(_0xea77('0x5'));var fs=require('fs');var path=require(_0xea77('0x6'));var rimraf=require(_0xea77('0x7'));var config=require(_0xea77('0x8'));var attributes=require(_0xea77('0x9'));module['exports']=function(_0x148122,_0x3ce0e7){return _0x148122[_0xea77('0xa')]('FaxInteraction',attributes,{'tableName':_0xea77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4db826,_0x25037f,_0x4543d8){if(_0x4db826['changed'](_0xea77('0xc'))){_0x4db826[_0xea77('0xd')]=moment()[_0xea77('0xe')](_0xea77('0xf'));}_0x4543d8(null,_0x4db826);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 28234df..41c178e 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 _0x74d6=['spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','addTags','ids','omit'];(function(_0x621fa5,_0x2589b6){var _0xea18a0=function(_0x55498c){while(--_0x55498c){_0x621fa5['push'](_0x621fa5['shift']());}};_0xea18a0(++_0x2589b6);}(_0x74d6,0x1db));var _0x674d=function(_0x1d5933,_0x583e35){_0x1d5933=_0x1d5933-0x0;var _0x202e37=_0x74d6[_0x1d5933];return _0x202e37;};'use strict';var _=require(_0x674d('0x0'));var util=require(_0x674d('0x1'));var moment=require(_0x674d('0x2'));var BPromise=require('bluebird');var rs=require(_0x674d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x674d('0x4'))['db'];var utils=require(_0x674d('0x5'));var logger=require(_0x674d('0x6'))(_0x674d('0x7'));var config=require(_0x674d('0x8'));var jayson=require(_0x674d('0x9'));var client=jayson[_0x674d('0xa')][_0x674d('0xb')]({'port':0x232a});config[_0x674d('0xc')]=_[_0x674d('0xd')](config[_0x674d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x674d('0xe'))(new Redis(config[_0x674d('0xc')]));require('./faxInteraction.socket')[_0x674d('0xf')](socket);function respondWithRpcPromise(_0x28075c,_0x4c0bd7,_0x3d1f3e){return new BPromise(function(_0x148598,_0x5a2d51){return client[_0x674d('0x10')](_0x28075c,_0x3d1f3e)[_0x674d('0x11')](function(_0x10dac2){logger[_0x674d('0x12')](_0x674d('0x13'),_0x4c0bd7,_0x674d('0x14'));logger[_0x674d('0x15')](_0x674d('0x16'),_0x4c0bd7,_0x674d('0x14'),JSON[_0x674d('0x17')](_0x10dac2));if(_0x10dac2[_0x674d('0x18')]){if(_0x10dac2['error'][_0x674d('0x19')]===0x1f4){logger['error'](_0x674d('0x13'),_0x4c0bd7,_0x10dac2[_0x674d('0x18')][_0x674d('0x1a')]);return _0x5a2d51(_0x10dac2['error'][_0x674d('0x1a')]);}logger[_0x674d('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x4c0bd7,_0x10dac2[_0x674d('0x18')][_0x674d('0x1a')]);return _0x148598(_0x10dac2['error'][_0x674d('0x1a')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x4c0bd7,_0x674d('0x14'));_0x148598(_0x10dac2['result'][_0x674d('0x1a')]);}})[_0x674d('0x1b')](function(_0x1b8b92){logger[_0x674d('0x18')](_0x674d('0x13'),_0x4c0bd7,_0x1b8b92);_0x5a2d51(_0x1b8b92);});});}exports[_0x674d('0x1c')]=function(_0x35680b){var _0x49d99b=this;return new Promise(function(_0x2138fd,_0xc1e800){return db[_0x674d('0x1d')][_0x674d('0x1e')](_0x35680b[_0x674d('0x1f')],{'raw':_0x35680b[_0x674d('0x20')]?_0x35680b[_0x674d('0x20')][_0x674d('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35680b['options']?_0x35680b['options'][_0x674d('0x22')]||null:null,'attributes':_0x35680b[_0x674d('0x20')]?_0x35680b[_0x674d('0x20')][_0x674d('0x23')]||null:null,'limit':_0x35680b[_0x674d('0x20')]?_0x35680b[_0x674d('0x20')][_0x674d('0x24')]||null:null})[_0x674d('0x11')](function(_0x3ec926){logger[_0x674d('0x12')](_0x674d('0x1c'),_0x35680b);logger['debug']('UpdateFaxInteraction',_0x35680b,JSON[_0x674d('0x17')](_0x3ec926));_0x2138fd(_0x3ec926);})[_0x674d('0x1b')](function(_0x225c91){logger[_0x674d('0x18')](_0x674d('0x1c'),_0x225c91[_0x674d('0x1a')],_0x35680b);_0xc1e800(_0x49d99b[_0x674d('0x18')](0x1f4,_0x225c91[_0x674d('0x1a')]));});});};exports[_0x674d('0x25')]=function(_0x4c4dd8){return new Promise(function(_0x5e0ac7,_0x5ac6a2){return db[_0x674d('0x1d')]['find']({'where':_0x4c4dd8[_0x674d('0x20')]?_0x4c4dd8[_0x674d('0x20')][_0x674d('0x22')]||null:null})['then'](function(_0x363370){if(_0x363370){return _0x363370[_0x674d('0x26')](_0x4c4dd8['body'][_0x674d('0x27')],_[_0x674d('0x28')](_0x4c4dd8[_0x674d('0x1f')],['ids','id'])||{});}})[_0x674d('0x29')](function(_0xc53295){logger[_0x674d('0x12')](_0x674d('0x2a'),_0x4c4dd8);logger['debug'](_0x674d('0x2a'),_0x4c4dd8,JSON[_0x674d('0x17')](_0xc53295));_0x5e0ac7(_0xc53295);})[_0x674d('0x1b')](function(_0x38f49d){logger['error']('AddTags',_0x38f49d[_0x674d('0x1a')],_0x4c4dd8);_0x5ac6a2(_this[_0x674d('0x18')](0x1f4,_0x38f49d['message']));});});}; \ No newline at end of file +var _0x650e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','message','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','limit','stringify','catch','addTags','body','ids','omit','AddTags'];(function(_0x1a8132,_0x1d4978){var _0x5b9329=function(_0x1f1447){while(--_0x1f1447){_0x1a8132['push'](_0x1a8132['shift']());}};_0x5b9329(++_0x1d4978);}(_0x650e,0x14d));var _0xe650=function(_0x1b3926,_0x252450){_0x1b3926=_0x1b3926-0x0;var _0x1d00cc=_0x650e[_0x1b3926];return _0x1d00cc;};'use strict';var _=require(_0xe650('0x0'));var util=require(_0xe650('0x1'));var moment=require(_0xe650('0x2'));var BPromise=require(_0xe650('0x3'));var rs=require(_0xe650('0x4'));var fs=require('fs');var Redis=require(_0xe650('0x5'));var db=require(_0xe650('0x6'))['db'];var utils=require(_0xe650('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe650('0x8'));var client=jayson['client'][_0xe650('0x9')]({'port':0x232a});config[_0xe650('0xa')]=_[_0xe650('0xb')](config[_0xe650('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe650('0xc'))(new Redis(config[_0xe650('0xa')]));require(_0xe650('0xd'))['register'](socket);function respondWithRpcPromise(_0x36addc,_0x5832ea,_0x5c20b8){return new BPromise(function(_0x5d9fa6,_0x43e1bc){return client['request'](_0x36addc,_0x5c20b8)[_0xe650('0xe')](function(_0x19a348){logger[_0xe650('0xf')](_0xe650('0x10'),_0x5832ea,_0xe650('0x11'));logger[_0xe650('0x12')](_0xe650('0x13'),_0x5832ea,_0xe650('0x11'),JSON['stringify'](_0x19a348));if(_0x19a348[_0xe650('0x14')]){if(_0x19a348[_0xe650('0x14')]['code']===0x1f4){logger['error'](_0xe650('0x10'),_0x5832ea,_0x19a348[_0xe650('0x14')][_0xe650('0x15')]);return _0x43e1bc(_0x19a348['error'][_0xe650('0x15')]);}logger[_0xe650('0x14')](_0xe650('0x10'),_0x5832ea,_0x19a348[_0xe650('0x14')][_0xe650('0x15')]);return _0x5d9fa6(_0x19a348[_0xe650('0x14')][_0xe650('0x15')]);}else{logger[_0xe650('0xf')](_0xe650('0x10'),_0x5832ea,'request\x20sent');_0x5d9fa6(_0x19a348['result'][_0xe650('0x15')]);}})['catch'](function(_0x366469){logger[_0xe650('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x5832ea,_0x366469);_0x43e1bc(_0x366469);});});}exports[_0xe650('0x16')]=function(_0xa3294){var _0x3bce6e=this;return new Promise(function(_0x1086d4,_0x4b33d0){return db[_0xe650('0x17')][_0xe650('0x18')](_0xa3294['body'],{'raw':_0xa3294[_0xe650('0x19')]?_0xa3294['options'][_0xe650('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa3294['options']?_0xa3294[_0xe650('0x19')][_0xe650('0x1b')]||null:null,'attributes':_0xa3294['options']?_0xa3294[_0xe650('0x19')][_0xe650('0x1c')]||null:null,'limit':_0xa3294[_0xe650('0x19')]?_0xa3294[_0xe650('0x19')][_0xe650('0x1d')]||null:null})[_0xe650('0xe')](function(_0x2cb859){logger['info'](_0xe650('0x16'),_0xa3294);logger[_0xe650('0x12')](_0xe650('0x16'),_0xa3294,JSON[_0xe650('0x1e')](_0x2cb859));_0x1086d4(_0x2cb859);})[_0xe650('0x1f')](function(_0x53d2ae){logger['error'](_0xe650('0x16'),_0x53d2ae[_0xe650('0x15')],_0xa3294);_0x4b33d0(_0x3bce6e[_0xe650('0x14')](0x1f4,_0x53d2ae[_0xe650('0x15')]));});});};exports['AddTagsToFaxInteraction']=function(_0x2daa2f){return new Promise(function(_0x567ef4,_0x270646){return db[_0xe650('0x17')]['find']({'where':_0x2daa2f['options']?_0x2daa2f['options'][_0xe650('0x1b')]||null:null})[_0xe650('0xe')](function(_0x393a34){if(_0x393a34){return _0x393a34[_0xe650('0x20')](_0x2daa2f[_0xe650('0x21')][_0xe650('0x22')],_[_0xe650('0x23')](_0x2daa2f['body'],['ids','id'])||{});}})['spread'](function(_0x5ed873){logger['info'](_0xe650('0x24'),_0x2daa2f);logger[_0xe650('0x12')]('AddTags',_0x2daa2f,JSON['stringify'](_0x5ed873));_0x567ef4(_0x5ed873);})[_0xe650('0x1f')](function(_0x372292){logger[_0xe650('0x14')](_0xe650('0x24'),_0x372292[_0xe650('0x15')],_0x2daa2f);_0x270646(_this[_0xe650('0x14')](0x1f4,_0x372292[_0xe650('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 860270a..d5c7a26 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 _0xaeb3=['register','./faxInteraction.events','save','remove','removeListener'];(function(_0x32d9fe,_0x213473){var _0x1b8f8e=function(_0x39c16c){while(--_0x39c16c){_0x32d9fe['push'](_0x32d9fe['shift']());}};_0x1b8f8e(++_0x213473);}(_0xaeb3,0x1cd));var _0x3aeb=function(_0xf0339b,_0x21a8ca){_0xf0339b=_0xf0339b-0x0;var _0x14d27f=_0xaeb3[_0xf0339b];return _0x14d27f;};'use strict';var FaxInteractionEvents=require(_0x3aeb('0x0'));var events=[_0x3aeb('0x1'),_0x3aeb('0x2'),'update'];function createListener(_0x9e2adb,_0x5ac256){return function(_0x276085){_0x5ac256['emit'](_0x9e2adb,_0x276085);};}function removeListener(_0x4a25a5,_0x4d259c){return function(){FaxInteractionEvents[_0x3aeb('0x3')](_0x4a25a5,_0x4d259c);};}exports[_0x3aeb('0x4')]=function(_0x3b2212){for(var _0x39edd5=0x0,_0x484be1=events['length'];_0x39edd5<_0x484be1;_0x39edd5++){var _0xfebd1e=events[_0x39edd5];var _0x272e80=createListener('faxInteraction:'+_0xfebd1e,_0x3b2212);FaxInteractionEvents['on'](_0xfebd1e,_0x272e80);}}; \ No newline at end of file +var _0xd940=['register','length','faxInteraction:','./faxInteraction.events','save','update','removeListener'];(function(_0x1f8770,_0x360766){var _0x4634fc=function(_0x57dd11){while(--_0x57dd11){_0x1f8770['push'](_0x1f8770['shift']());}};_0x4634fc(++_0x360766);}(_0xd940,0x184));var _0x0d94=function(_0x216428,_0x5d20ea){_0x216428=_0x216428-0x0;var _0x313dd4=_0xd940[_0x216428];return _0x313dd4;};'use strict';var FaxInteractionEvents=require(_0x0d94('0x0'));var events=[_0x0d94('0x1'),'remove',_0x0d94('0x2')];function createListener(_0x1b4b7e,_0x1c6864){return function(_0x195ef9){_0x1c6864['emit'](_0x1b4b7e,_0x195ef9);};}function removeListener(_0x503256,_0x3f67f4){return function(){FaxInteractionEvents[_0x0d94('0x3')](_0x503256,_0x3f67f4);};}exports[_0x0d94('0x4')]=function(_0x2ab706){for(var _0x4fa47e=0x0,_0x45e839=events[_0x0d94('0x5')];_0x4fa47e<_0x45e839;_0x4fa47e++){var _0x1fcc46=events[_0x4fa47e];var _0x3582c8=createListener(_0x0d94('0x6')+_0x1fcc46,_0x2ab706);FaxInteractionEvents['on'](_0x1fcc46,_0x3582c8);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 18ec450..655969c 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 _0x2451=['destroy','removeTags','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','faxinteraction:addtags','addTags','fax','faxinteraction:update','update','delete'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x2451,0xb7));var _0x1245=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0x2451[_0x39e164];return _0x13fa6b;};'use strict';var multer=require(_0x1245('0x0'));var util=require(_0x1245('0x1'));var path=require(_0x1245('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1245('0x3'));var auth=require(_0x1245('0x4'));var interaction=require(_0x1245('0x5'));var config=require(_0x1245('0x6'));var controller=require(_0x1245('0x7'));router['get']('/',auth[_0x1245('0x8')](),controller[_0x1245('0x9')]);router[_0x1245('0xa')]('/describe',auth[_0x1245('0x8')](),controller['describe']);router['get'](_0x1245('0xb'),auth[_0x1245('0x8')](),controller[_0x1245('0xc')]);router[_0x1245('0xa')](_0x1245('0xd'),auth[_0x1245('0x8')](),controller[_0x1245('0xe')]);router[_0x1245('0xa')](_0x1245('0xf'),auth['isAuthenticated'](),controller[_0x1245('0x10')]);router[_0x1245('0x11')]('/',auth['isAuthenticated'](),controller[_0x1245('0x12')]);router[_0x1245('0x11')](_0x1245('0xd'),auth[_0x1245('0x8')](),controller['addMessage']);router[_0x1245('0x11')](_0x1245('0x13'),auth[_0x1245('0x8')](),interaction[_0x1245('0x14')]('fax',_0x1245('0x15')),controller[_0x1245('0x16')]);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x1245('0x14')](_0x1245('0x17'),_0x1245('0x18')),controller[_0x1245('0x19')]);router[_0x1245('0x1a')](_0x1245('0xb'),auth[_0x1245('0x8')](),interaction[_0x1245('0x14')]('fax','faxinteraction:destroy'),controller[_0x1245('0x1b')]);router[_0x1245('0x1a')](_0x1245('0x13'),auth['isAuthenticated'](),controller[_0x1245('0x1c')]);module[_0x1245('0x1d')]=router; \ No newline at end of file +var _0x1cd5=['show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','fax','faxinteraction:addtags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x56092a,_0x291ce5){var _0x1c9558=function(_0x5bf0c5){while(--_0x5bf0c5){_0x56092a['push'](_0x56092a['shift']());}};_0x1c9558(++_0x291ce5);}(_0x1cd5,0x193));var _0x51cd=function(_0x2563bc,_0x272dbd){_0x2563bc=_0x2563bc-0x0;var _0xa24815=_0x1cd5[_0x2563bc];return _0xa24815;};'use strict';var multer=require(_0x51cd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x51cd('0x1'));var express=require('express');var router=express[_0x51cd('0x2')]();var fs_extra=require(_0x51cd('0x3'));var auth=require(_0x51cd('0x4'));var interaction=require(_0x51cd('0x5'));var config=require('../../config/environment');var controller=require(_0x51cd('0x6'));router[_0x51cd('0x7')]('/',auth[_0x51cd('0x8')](),controller[_0x51cd('0x9')]);router[_0x51cd('0x7')](_0x51cd('0xa'),auth[_0x51cd('0x8')](),controller[_0x51cd('0xb')]);router[_0x51cd('0x7')](_0x51cd('0xc'),auth[_0x51cd('0x8')](),controller[_0x51cd('0xd')]);router[_0x51cd('0x7')](_0x51cd('0xe'),auth['isAuthenticated'](),controller[_0x51cd('0xf')]);router[_0x51cd('0x7')](_0x51cd('0x10'),auth[_0x51cd('0x8')](),controller[_0x51cd('0x11')]);router[_0x51cd('0x12')]('/',auth[_0x51cd('0x8')](),controller[_0x51cd('0x13')]);router[_0x51cd('0x12')](_0x51cd('0xe'),auth[_0x51cd('0x8')](),controller[_0x51cd('0x14')]);router[_0x51cd('0x12')](_0x51cd('0x15'),auth[_0x51cd('0x8')](),interaction['tracked'](_0x51cd('0x16'),_0x51cd('0x17')),controller['addTags']);router[_0x51cd('0x18')](_0x51cd('0xc'),auth[_0x51cd('0x8')](),interaction['tracked']('fax',_0x51cd('0x19')),controller[_0x51cd('0x1a')]);router['delete']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x51cd('0x16'),_0x51cd('0x1b')),controller[_0x51cd('0x1c')]);router[_0x51cd('0x1d')](_0x51cd('0x15'),auth[_0x51cd('0x8')](),controller[_0x51cd('0x1e')]);module[_0x51cd('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 9d18fe5..4621c2c 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 _0x4a81=['DATE','sequelize','exports','TEXT','medium','out'];(function(_0x381917,_0x2a6d98){var _0x4d2b05=function(_0x8abf90){while(--_0x8abf90){_0x381917['push'](_0x381917['shift']());}};_0x4d2b05(++_0x2a6d98);}(_0x4a81,0x1b7));var _0x14a8=function(_0x1af09f,_0x14b9ec){_0x1af09f=_0x1af09f-0x0;var _0xfab72=_0x4a81[_0x1af09f];return _0xfab72;};'use strict';var Sequelize=require(_0x14a8('0x0'));module[_0x14a8('0x1')]={'body':{'type':Sequelize[_0x14a8('0x2')](_0x14a8('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x14a8('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x14a8('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x14a8('0x5')]}}; \ No newline at end of file +var _0xe5d5=['out','DATE','TEXT','BOOLEAN'];(function(_0x3ec8e0,_0x87383a){var _0x5d0ea4=function(_0x4a0579){while(--_0x4a0579){_0x3ec8e0['push'](_0x3ec8e0['shift']());}};_0x5d0ea4(++_0x87383a);}(_0xe5d5,0x156));var _0x5e5d=function(_0x2798d3,_0x3222ca){_0x2798d3=_0x2798d3-0x0;var _0x2f1ee2=_0xe5d5[_0x2798d3];return _0x2f1ee2;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x5e5d('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5e5d('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5e5d('0x2')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x5e5d('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0x5e5d('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index a261737..9f83a50 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 _0xfedd=['apply','reject','save','update','destroy','stack','name','send','index','FaxMessage','rawAttributes','key','map','query','keys','model','attributes','intersection','fields','hasOwnProperty','sort','pick','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','params','length','include','options','find','body','describe','../../config/logger','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','channel','motionChannel','accept','EventManager','acceptmessage','fax-interactions','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','event','rejectmessage','CmContact','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range'];(function(_0x4569cb,_0x2c4969){var _0x137d51=function(_0x2b9d09){while(--_0x2b9d09){_0x4569cb['push'](_0x4569cb['shift']());}};_0x137d51(++_0x2c4969);}(_0xfedd,0x187));var _0xdfed=function(_0x5dd13a,_0xb74bf){_0x5dd13a=_0x5dd13a-0x0;var _0x22f845=_0xfedd[_0x5dd13a];return _0x22f845;};'use strict';var emlformat=require(_0xdfed('0x0'));var rimraf=require(_0xdfed('0x1'));var zipdir=require(_0xdfed('0x2'));var jsonpatch=require(_0xdfed('0x3'));var rp=require('request-promise');var moment=require(_0xdfed('0x4'));var BPromise=require(_0xdfed('0x5'));var Mustache=require(_0xdfed('0x6'));var util=require(_0xdfed('0x7'));var path=require(_0xdfed('0x8'));var sox=require(_0xdfed('0x9'));var csv=require(_0xdfed('0xa'));var ejs=require(_0xdfed('0xb'));var fs=require('fs');var fs_extra=require(_0xdfed('0xc'));var _=require(_0xdfed('0xd'));var squel=require(_0xdfed('0xe'));var crypto=require(_0xdfed('0xf'));var jsforce=require(_0xdfed('0x10'));var deskjs=require(_0xdfed('0x11'));var toCsv=require(_0xdfed('0xa'));var querystring=require(_0xdfed('0x12'));var Papa=require(_0xdfed('0x13'));var Redis=require(_0xdfed('0x14'));var authService=require(_0xdfed('0x15'));var qs=require(_0xdfed('0x16'));var as=require(_0xdfed('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdfed('0x18'));var utils=require(_0xdfed('0x19'));var config=require(_0xdfed('0x1a'));var licenseUtil=require(_0xdfed('0x1b'));var db=require(_0xdfed('0x1c'))['db'];config[_0xdfed('0x1d')]=_[_0xdfed('0x1e')](config[_0xdfed('0x1d')],{'host':_0xdfed('0x1f'),'port':0x18eb});var socket=require(_0xdfed('0x20'))(new Redis(config[_0xdfed('0x1d')]));require(_0xdfed('0x21'))[_0xdfed('0x22')](socket);var jayson=require(_0xdfed('0x23'));var client=jayson[_0xdfed('0x24')]['http']({'port':0x232c});var client9002=jayson[_0xdfed('0x24')][_0xdfed('0x25')]({'port':0x232a});function respondWithRpcPromise(_0x38b820,_0xf88f77,_0x20302a,_0xe81388){return new BPromise(function(_0x399495,_0x570778){var _0x590e06=_0xe81388||client;return _0x590e06['request'](_0x38b820,_0x20302a)[_0xdfed('0x26')](function(_0x191c32){logger[_0xdfed('0x27')](_0xdfed('0x28'),_0xf88f77,_0xdfed('0x29'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0xf88f77,'request\x20sent',JSON[_0xdfed('0x2a')](_0x191c32));if(_0x191c32[_0xdfed('0x2b')]){if(_0x191c32[_0xdfed('0x2b')]['code']===0x1f4){logger[_0xdfed('0x2b')](_0xdfed('0x28'),_0xf88f77,_0x191c32[_0xdfed('0x2b')][_0xdfed('0x2c')]);return _0x570778(_0x191c32[_0xdfed('0x2b')][_0xdfed('0x2c')]);}logger[_0xdfed('0x2b')](_0xdfed('0x28'),_0xf88f77,_0x191c32[_0xdfed('0x2b')]['message']);return _0x399495(_0x191c32[_0xdfed('0x2b')][_0xdfed('0x2c')]);}else{logger[_0xdfed('0x27')](_0xdfed('0x28'),_0xf88f77,_0xdfed('0x29'));_0x399495(_0x191c32[_0xdfed('0x2d')]['message']);}})[_0xdfed('0x2e')](function(_0x27f7d9){logger[_0xdfed('0x2b')](_0xdfed('0x28'),_0xf88f77,_0x27f7d9);_0x570778(_0x27f7d9);});});}function respondWithStatusCode(_0xf970cb,_0x198a2c){_0x198a2c=_0x198a2c||0xcc;return function(_0x3e7946){if(_0x3e7946){return _0xf970cb[_0xdfed('0x2f')](_0x198a2c);}return _0xf970cb[_0xdfed('0x30')](_0x198a2c)[_0xdfed('0x31')]();};}function respondWithResult(_0x306c83,_0x344de4){_0x344de4=_0x344de4||0xc8;return function(_0x35ca01){if(_0x35ca01){return _0x306c83['status'](_0x344de4)[_0xdfed('0x32')](_0x35ca01);}};}function respondWithFilteredResult(_0x9ac35a,_0x5d0ae6){return function(_0x1f6b51){if(_0x1f6b51){var _0x508398=typeof _0x5d0ae6[_0xdfed('0x33')]===_0xdfed('0x34')&&typeof _0x5d0ae6[_0xdfed('0x35')]===_0xdfed('0x34');var _0x3a1b72=_0x1f6b51['count'];var _0x426289=_0x508398?0x0:_0x5d0ae6[_0xdfed('0x33')];var _0x349762=_0x508398?_0x1f6b51['count']:_0x5d0ae6[_0xdfed('0x33')]+_0x5d0ae6['limit'];var _0x56e33c;if(_0x349762>=_0x3a1b72){_0x349762=_0x3a1b72;_0x56e33c=0xc8;}else{_0x56e33c=0xce;}_0x9ac35a['status'](_0x56e33c);return _0x9ac35a[_0xdfed('0x36')](_0xdfed('0x37'),_0x426289+'-'+_0x349762+'/'+_0x3a1b72)[_0xdfed('0x32')](_0x1f6b51);}return null;};}function patchUpdates(_0x9de0ed){return function(_0x1917ef){try{jsonpatch[_0xdfed('0x38')](_0x1917ef,_0x9de0ed,!![]);}catch(_0x2f0f14){return BPromise[_0xdfed('0x39')](_0x2f0f14);}return _0x1917ef[_0xdfed('0x3a')]();};}function saveUpdates(_0x53872c,_0x1e0315){return function(_0x518942){if(_0x518942){return _0x518942[_0xdfed('0x3b')](_0x53872c)[_0xdfed('0x26')](function(_0x51acb6){return _0x51acb6;});}return null;};}function removeEntity(_0x2daf25,_0x3d2d7c){return function(_0x466dca){if(_0x466dca){return _0x466dca[_0xdfed('0x3c')]()[_0xdfed('0x26')](function(){_0x2daf25['status'](0xcc)[_0xdfed('0x31')]();});}};}function handleEntityNotFound(_0xc94f53,_0x30c0b6){return function(_0x2a578d){if(!_0x2a578d){_0xc94f53[_0xdfed('0x2f')](0x194);}return _0x2a578d;};}function handleError(_0x530f1c,_0x2aed9e){_0x2aed9e=_0x2aed9e||0x1f4;return function(_0x1b6465){logger['error'](_0x1b6465[_0xdfed('0x3d')]);if(_0x1b6465[_0xdfed('0x3e')]){delete _0x1b6465['name'];}_0x530f1c[_0xdfed('0x30')](_0x2aed9e)[_0xdfed('0x3f')](_0x1b6465);};}exports[_0xdfed('0x40')]=function(_0x199da6,_0x1aff15){var _0x5abf32={},_0xd5ecf4={},_0x114339={'count':0x0,'rows':[]};var _0x9eac50=_['map'](db[_0xdfed('0x41')][_0xdfed('0x42')],function(_0x1840c3){return{'name':_0x1840c3['fieldName'],'type':_0x1840c3['type'][_0xdfed('0x43')]};});_0xd5ecf4['model']=_[_0xdfed('0x44')](_0x9eac50,'name');_0xd5ecf4[_0xdfed('0x45')]=_[_0xdfed('0x46')](_0x199da6[_0xdfed('0x45')]);_0xd5ecf4['filters']=_['intersection'](_0xd5ecf4[_0xdfed('0x47')],_0xd5ecf4[_0xdfed('0x45')]);_0x5abf32[_0xdfed('0x48')]=_[_0xdfed('0x49')](_0xd5ecf4['model'],qs['fields'](_0x199da6[_0xdfed('0x45')][_0xdfed('0x4a')]));_0x5abf32['attributes']=_0x5abf32['attributes']['length']?_0x5abf32[_0xdfed('0x48')]:_0xd5ecf4[_0xdfed('0x47')];if(!_0x199da6[_0xdfed('0x45')][_0xdfed('0x4b')]('nolimit')){_0x5abf32['limit']=qs['limit'](_0x199da6['query'][_0xdfed('0x35')]);_0x5abf32[_0xdfed('0x33')]=qs[_0xdfed('0x33')](_0x199da6[_0xdfed('0x45')]['offset']);}_0x5abf32['order']=qs[_0xdfed('0x4c')](_0x199da6[_0xdfed('0x45')][_0xdfed('0x4c')]);_0x5abf32['where']=qs['filters'](_[_0xdfed('0x4d')](_0x199da6[_0xdfed('0x45')],_0xd5ecf4[_0xdfed('0x4e')]),_0x9eac50);if(_0x199da6[_0xdfed('0x45')][_0xdfed('0x4f')]){_0x5abf32[_0xdfed('0x50')]=_[_0xdfed('0x51')](_0x5abf32['where'],{'$or':_['map'](_0x9eac50,function(_0x5089f7){if(_0x5089f7['type']!==_0xdfed('0x52')){var _0x5aa468={};_0x5aa468[_0x5089f7[_0xdfed('0x3e')]]={'$like':'%'+_0x199da6['query'][_0xdfed('0x4f')]+'%'};return _0x5aa468;}})});}_0x5abf32=_[_0xdfed('0x51')]({},_0x5abf32,_0x199da6['options']);var _0x27f8d={'where':_0x5abf32[_0xdfed('0x50')]};return db[_0xdfed('0x41')][_0xdfed('0x53')](_0x27f8d)['then'](function(_0x4acc39){_0x114339['count']=_0x4acc39;if(_0x199da6[_0xdfed('0x45')][_0xdfed('0x54')]){_0x5abf32['include']=[{'all':!![]}];}return db[_0xdfed('0x41')][_0xdfed('0x55')](_0x5abf32);})[_0xdfed('0x26')](function(_0x36f3f9){_0x114339['rows']=_0x36f3f9;return _0x114339;})[_0xdfed('0x26')](respondWithFilteredResult(_0x1aff15,_0x5abf32))[_0xdfed('0x2e')](handleError(_0x1aff15,null));};exports['show']=function(_0x3a2436,_0x5ee63f){var _0x5e8851={'raw':!![],'where':{'id':_0x3a2436[_0xdfed('0x56')]['id']}},_0x36613b={};_0x36613b[_0xdfed('0x47')]=_[_0xdfed('0x46')](db[_0xdfed('0x41')][_0xdfed('0x42')]);_0x36613b[_0xdfed('0x45')]=_[_0xdfed('0x46')](_0x3a2436['query']);_0x36613b[_0xdfed('0x4e')]=_['intersection'](_0x36613b[_0xdfed('0x47')],_0x36613b[_0xdfed('0x45')]);_0x5e8851[_0xdfed('0x48')]=_[_0xdfed('0x49')](_0x36613b[_0xdfed('0x47')],qs[_0xdfed('0x4a')](_0x3a2436[_0xdfed('0x45')][_0xdfed('0x4a')]));_0x5e8851[_0xdfed('0x48')]=_0x5e8851[_0xdfed('0x48')][_0xdfed('0x57')]?_0x5e8851[_0xdfed('0x48')]:_0x36613b['model'];if(_0x3a2436['query'][_0xdfed('0x54')]){_0x5e8851[_0xdfed('0x58')]=[{'all':!![]}];}_0x5e8851=_[_0xdfed('0x51')]({},_0x5e8851,_0x3a2436[_0xdfed('0x59')]);return db[_0xdfed('0x41')][_0xdfed('0x5a')](_0x5e8851)[_0xdfed('0x26')](handleEntityNotFound(_0x5ee63f,null))[_0xdfed('0x26')](respondWithResult(_0x5ee63f,null))[_0xdfed('0x2e')](handleError(_0x5ee63f,null));};exports[_0xdfed('0x3b')]=function(_0x3b0fb5,_0x587b87){if(_0x3b0fb5['body']['id']){delete _0x3b0fb5[_0xdfed('0x5b')]['id'];}return db[_0xdfed('0x41')][_0xdfed('0x5a')]({'where':{'id':_0x3b0fb5[_0xdfed('0x56')]['id']}})[_0xdfed('0x26')](handleEntityNotFound(_0x587b87,null))['then'](saveUpdates(_0x3b0fb5[_0xdfed('0x5b')],null))[_0xdfed('0x26')](respondWithResult(_0x587b87,null))[_0xdfed('0x2e')](handleError(_0x587b87,null));};exports[_0xdfed('0x3c')]=function(_0x24c67f,_0x18b77d){return db[_0xdfed('0x41')][_0xdfed('0x5a')]({'where':{'id':_0x24c67f[_0xdfed('0x56')]['id']}})[_0xdfed('0x26')](handleEntityNotFound(_0x18b77d,null))[_0xdfed('0x26')](removeEntity(_0x18b77d,null))['catch'](handleError(_0x18b77d,null));};exports['describe']=function(_0x1adefc,_0x51064b){return db[_0xdfed('0x41')][_0xdfed('0x5c')]()['then'](respondWithResult(_0x51064b,null))[_0xdfed('0x2e')](handleError(_0x51064b,null));};var interaction_log=require(_0xdfed('0x5d'))('fax-interactions');exports['accept']=function(_0x2adc70,_0x8d159a,_0x5c48cd){var _0x231766={'agent':{},'channel':_0xdfed('0x5e')};if(_0x2adc70[_0xdfed('0x5b')]['id']){delete _0x2adc70[_0xdfed('0x5b')]['id'];}_0x2adc70[_0xdfed('0x5b')][_0xdfed('0x5f')]=!![];_0x2adc70['body']['readAt']=moment()[_0xdfed('0x60')](_0xdfed('0x61'));_0x2adc70[_0xdfed('0x5b')][_0xdfed('0x62')]=_0x2adc70[_0xdfed('0x5b')][_0xdfed('0x62')]||_0x2adc70['user']['id'];_0x231766[_0xdfed('0x63')]['id']=_0x2adc70[_0xdfed('0x5b')]['UserId'];return db[_0xdfed('0x41')][_0xdfed('0x5a')]({'where':{'id':_0x2adc70[_0xdfed('0x56')]['id'],'UserId':null}})[_0xdfed('0x26')](handleEntityNotFound(_0x8d159a,null))[_0xdfed('0x26')](saveUpdates(_0x2adc70['body'],null))[_0xdfed('0x26')](function(_0x159355){if(_0x159355){_0x231766['message']=_0x159355[_0xdfed('0x64')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x159355[_0xdfed('0x65')]}});}return null;})[_0xdfed('0x26')](handleEntityNotFound(_0x8d159a,null))[_0xdfed('0x26')](function(_0x1ae825){if(_0x1ae825){return _0x1ae825[_0xdfed('0x3b')]({'UserId':_0x2adc70['body'][_0xdfed('0x62')],'read1stAt':_[_0xdfed('0x66')](_0x1ae825[_0xdfed('0x67')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdfed('0x26')](function(_0x532638){if(_0x532638){_0x231766[_0xdfed('0x68')]=_0x532638['get']({'plain':!![]});interaction_log[_0xdfed('0x27')](_0xdfed('0x69'),_0x2adc70[_0xdfed('0x6a')]['id'],_0x2adc70[_0xdfed('0x6a')][_0xdfed('0x3e')],_0x2adc70['user'][_0xdfed('0x6b')],_0x231766[_0xdfed('0x68')]['id'],_0x2adc70['body']?JSON[_0xdfed('0x2a')](_0x2adc70[_0xdfed('0x5b')]):_0xdfed('0x6c'));return respondWithRpcPromise(_0xdfed('0x6d'),_0xdfed('0x6e'),_0x231766);}return null;})[_0xdfed('0x26')](function(_0x480b46){var _0x54c5ad=_0xdfed('0x6f')+_0x480b46['message'][_0xdfed('0x70')];return db['sequelize'][_0xdfed('0x45')](_0x54c5ad,{'type':db[_0xdfed('0x71')][_0xdfed('0x72')][_0xdfed('0x73')],'raw':!![]})[_0xdfed('0x26')](function(_0x9e9611){return _0x9e9611;});})['then'](function(_0x1c3113){if(_0x1c3113){_0x231766[_0xdfed('0x2c')][_0xdfed('0x74')]=_0x1c3113[0x0];if(!_0x2adc70[_0xdfed('0x5b')][_0xdfed('0x62')])return;return db[_0xdfed('0x75')][_0xdfed('0x5a')]({'where':{'id':_0x2adc70[_0xdfed('0x5b')]['UserId'],'role':_0xdfed('0x63')},'attributes':['id',_0xdfed('0x3e'),_0xdfed('0x76'),_0xdfed('0x77'),_0xdfed('0x78')],'raw':!![]});}return null;})[_0xdfed('0x26')](function(_0x35547e){if(!_0x35547e)return null;_0x231766[_0xdfed('0x2c')][_0xdfed('0x63')]=_0x35547e;return _0x231766;})[_0xdfed('0x26')](function(_0x3ddc23){if(_0x3ddc23){if(_0x2adc70[_0xdfed('0x5b')]['manual']){_0x231766[_0xdfed('0x2c')][_0xdfed('0x79')]=util[_0xdfed('0x60')]('SIP/%s',_0x2adc70[_0xdfed('0x6a')]['name']);_0x231766[_0xdfed('0x2c')][_0xdfed('0x7a')]=_0x231766[_0xdfed('0x7a')];_0x231766[_0xdfed('0x2c')][_0xdfed('0x7b')]=_0x231766[_0xdfed('0x7a')];_0x231766[_0xdfed('0x2c')]['event']=_0xdfed('0x7c');return respondWithRpcPromise(_0xdfed('0x7d'),_0xdfed('0x7d'),{'event':_0xdfed('0x7e'),'message':_0x231766['message']},client9002)[_0xdfed('0x26')](function(){return _0x231766;});}return _0x231766;}return null;})[_0xdfed('0x26')](respondWithResult(_0x8d159a,null))[_0xdfed('0x2e')](handleError(_0x8d159a,null));};var interaction_log=require('../../config/logger')(_0xdfed('0x7f'));exports[_0xdfed('0x39')]=function(_0x348bd6,_0x4f2e29,_0x4e1132){var _0x4913bf={'agent':{},'channel':_0xdfed('0x5e')};if(_0x348bd6[_0xdfed('0x5b')]['id']){delete _0x348bd6[_0xdfed('0x5b')]['id'];}_0x348bd6[_0xdfed('0x5b')][_0xdfed('0x62')]=_0x348bd6['body'][_0xdfed('0x62')]||_0x348bd6[_0xdfed('0x6a')]['id'];_0x4913bf[_0xdfed('0x63')]['id']=_0x348bd6[_0xdfed('0x5b')][_0xdfed('0x62')];return db[_0xdfed('0x41')]['find']({'where':{'id':_0x348bd6[_0xdfed('0x56')]['id'],'UserId':null}})[_0xdfed('0x26')](handleEntityNotFound(_0x4f2e29,null))[_0xdfed('0x26')](function(_0x29243a){if(_0x29243a){_0x4913bf[_0xdfed('0x2c')]=_0x29243a[_0xdfed('0x64')]({'plain':!![]});return db[_0xdfed('0x80')][_0xdfed('0x5a')]({'where':{'id':_0x29243a[_0xdfed('0x65')]}});}return null;})[_0xdfed('0x26')](handleEntityNotFound(_0x4f2e29,null))[_0xdfed('0x26')](function(_0x3d80c2){if(_0x3d80c2){_0x4913bf[_0xdfed('0x68')]=_0x3d80c2['get']({'plain':!![]});interaction_log[_0xdfed('0x27')](_0xdfed('0x81'),_0x348bd6['user']['id'],_0x348bd6[_0xdfed('0x6a')]['name'],_0x348bd6[_0xdfed('0x6a')][_0xdfed('0x6b')],_0x4913bf[_0xdfed('0x68')]['id'],_0x348bd6[_0xdfed('0x5b')]?JSON[_0xdfed('0x2a')](_0x348bd6[_0xdfed('0x5b')]):'null');return respondWithRpcPromise(_0xdfed('0x82'),_0xdfed('0x83'),_0x4913bf);}return null;})[_0xdfed('0x26')](function(_0x40b07f){var _0x28e024='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x40b07f[_0xdfed('0x2c')][_0xdfed('0x70')];return db['sequelize'][_0xdfed('0x45')](_0x28e024,{'type':db[_0xdfed('0x71')][_0xdfed('0x72')][_0xdfed('0x73')],'raw':!![]})[_0xdfed('0x26')](function(_0x2d7061){return _0x2d7061;});})[_0xdfed('0x26')](function(_0x4aace3){if(_0x4aace3){_0x4913bf[_0xdfed('0x2c')][_0xdfed('0x74')]=_0x4aace3[0x0];if(!_0x348bd6[_0xdfed('0x5b')][_0xdfed('0x62')])return;return db[_0xdfed('0x75')][_0xdfed('0x5a')]({'where':{'id':_0x348bd6[_0xdfed('0x5b')][_0xdfed('0x62')],'role':'agent'},'attributes':['id','name',_0xdfed('0x76'),'email','internal'],'raw':!![]});}return null;})[_0xdfed('0x26')](function(_0x92f6a8){if(!_0x92f6a8)return null;_0x4913bf['message'][_0xdfed('0x63')]=_0x92f6a8;return _0x4913bf;})[_0xdfed('0x26')](function(_0x4732a5){if(_0x4732a5){_0x4732a5[_0xdfed('0x2c')][_0xdfed('0x79')]=util[_0xdfed('0x60')](_0xdfed('0x84'),_0x348bd6[_0xdfed('0x6a')]['name']);_0x4732a5[_0xdfed('0x2c')][_0xdfed('0x7a')]=_0x4913bf['channel'];_0x4732a5[_0xdfed('0x2c')][_0xdfed('0x7b')]=_0x4913bf['channel'];_0x4732a5[_0xdfed('0x2c')][_0xdfed('0x85')]=_0xdfed('0x39');respondWithRpcPromise('EventManager',_0xdfed('0x7d'),{'event':_0xdfed('0x86'),'message':_0x4732a5['message']},client9002);return _0x4913bf;}return null;})[_0xdfed('0x26')](respondWithResult(_0x4f2e29,null))['catch'](handleError(_0x4f2e29,null));};exports['create']=function(_0x3e9135,_0x7f028a){var _0x1fd1dd;return db[_0xdfed('0x41')]['create'](_0x3e9135[_0xdfed('0x5b')],{})[_0xdfed('0x26')](function(_0x5a6987){_0x1fd1dd=_0x5a6987;return db[_0xdfed('0x87')]['findOne']({'where':{'id':_0x1fd1dd['ContactId']}});})['then'](function(_0x53c7b9){if(_[_0xdfed('0x66')](_0x53c7b9)){return;}else{_0x1fd1dd[_0xdfed('0x5e')]=_0x53c7b9[_0xdfed('0x5e')];return db[_0xdfed('0x88')][_0xdfed('0x89')]({'where':{'id':_0x1fd1dd[_0xdfed('0x8a')]}});}})[_0xdfed('0x26')](function(_0x5763dd){return respondWithRpcPromise(_0xdfed('0x8b'),'SendFax',{'FaxAccountId':_['isNil'](_0x3e9135[_0xdfed('0x5b')])?undefined:_0x3e9135[_0xdfed('0x5b')][_0xdfed('0x8c')],'path':_[_0xdfed('0x66')](_0x5763dd)?undefined:util[_0xdfed('0x60')](_0xdfed('0x8d'),_0x5763dd[_0xdfed('0x8e')]),'fax':_[_0xdfed('0x66')](_0x1fd1dd[_0xdfed('0x5e')])?undefined:_0x1fd1dd[_0xdfed('0x5e')],'AttachmentId':_0x1fd1dd['AttachmentId']},client9002);})[_0xdfed('0x26')](respondWithResult(_0x7f028a,0xc9))['catch'](handleError(_0x7f028a,null));};exports[_0xdfed('0x8f')]=function(_0x206c20,_0x262759){var _0x2bb6b7=path[_0xdfed('0x90')](config[_0xdfed('0x91')],_0xdfed('0x92'),_0xdfed('0x93'),_0xdfed('0x94'));return db[_0xdfed('0x41')]['find']({'where':{'id':_0x206c20['params']['id']},'include':[{'model':db[_0xdfed('0x88')],'as':_0xdfed('0x88')}]})['then'](handleEntityNotFound(_0x262759,null))[_0xdfed('0x26')](function(_0x47d2aa){if(_0x47d2aa){return _0x262759['download'](path[_0xdfed('0x90')](_0x2bb6b7,_0x47d2aa[_0xdfed('0x88')][_0xdfed('0x8e')]));}})[_0xdfed('0x2e')](handleError(_0x262759,null));}; \ No newline at end of file +var _0xcb14=['code','FaxMessage,\x20%s,\x20%s','message','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','attributes','intersection','model','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','includeAll','include','FaxMessage','findAll','rows','catch','show','params','length','merge','options','update','body','find','describe','../../config/logger','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','agent','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','sequelize','Sequelize','User','fullname','rejectmessage','create','Attachment','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3ec274,_0x2eb0d7){var _0x2b1466=function(_0x4133e1){while(--_0x4133e1){_0x3ec274['push'](_0x3ec274['shift']());}};_0x2b1466(++_0x2eb0d7);}(_0xcb14,0x6b));var _0x4cb1=function(_0x1026d2,_0x42fe66){_0x1026d2=_0x1026d2-0x0;var _0x4a6773=_0xcb14[_0x1026d2];return _0x4a6773;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4cb1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4cb1('0x1'));var rp=require(_0x4cb1('0x2'));var moment=require(_0x4cb1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4cb1('0x4'));var util=require('util');var path=require(_0x4cb1('0x5'));var sox=require('sox');var csv=require(_0x4cb1('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4cb1('0x7'));var _=require(_0x4cb1('0x8'));var squel=require(_0x4cb1('0x9'));var crypto=require(_0x4cb1('0xa'));var jsforce=require(_0x4cb1('0xb'));var deskjs=require(_0x4cb1('0xc'));var toCsv=require(_0x4cb1('0x6'));var querystring=require(_0x4cb1('0xd'));var Papa=require(_0x4cb1('0xe'));var Redis=require(_0x4cb1('0xf'));var authService=require(_0x4cb1('0x10'));var qs=require(_0x4cb1('0x11'));var as=require(_0x4cb1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4cb1('0x13'));var utils=require(_0x4cb1('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4cb1('0x15'));var db=require(_0x4cb1('0x16'))['db'];config[_0x4cb1('0x17')]=_[_0x4cb1('0x18')](config[_0x4cb1('0x17')],{'host':_0x4cb1('0x19'),'port':0x18eb});var socket=require(_0x4cb1('0x1a'))(new Redis(config[_0x4cb1('0x17')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x4cb1('0x1b'));var client=jayson[_0x4cb1('0x1c')][_0x4cb1('0x1d')]({'port':0x232c});var client9002=jayson[_0x4cb1('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28ecca,_0x371e65,_0x2d97c1,_0x23726d){return new BPromise(function(_0x55bc1a,_0x4e1bb0){var _0x401180=_0x23726d||client;return _0x401180[_0x4cb1('0x1e')](_0x28ecca,_0x2d97c1)[_0x4cb1('0x1f')](function(_0x573549){logger[_0x4cb1('0x20')]('FaxMessage,\x20%s,\x20%s',_0x371e65,_0x4cb1('0x21'));logger[_0x4cb1('0x22')](_0x4cb1('0x23'),_0x371e65,_0x4cb1('0x21'),JSON[_0x4cb1('0x24')](_0x573549));if(_0x573549[_0x4cb1('0x25')]){if(_0x573549[_0x4cb1('0x25')][_0x4cb1('0x26')]===0x1f4){logger[_0x4cb1('0x25')](_0x4cb1('0x27'),_0x371e65,_0x573549['error'][_0x4cb1('0x28')]);return _0x4e1bb0(_0x573549[_0x4cb1('0x25')]['message']);}logger[_0x4cb1('0x25')]('FaxMessage,\x20%s,\x20%s',_0x371e65,_0x573549[_0x4cb1('0x25')][_0x4cb1('0x28')]);return _0x55bc1a(_0x573549[_0x4cb1('0x25')][_0x4cb1('0x28')]);}else{logger[_0x4cb1('0x20')](_0x4cb1('0x27'),_0x371e65,_0x4cb1('0x21'));_0x55bc1a(_0x573549['result'][_0x4cb1('0x28')]);}})['catch'](function(_0x500f2d){logger[_0x4cb1('0x25')]('FaxMessage,\x20%s,\x20%s',_0x371e65,_0x500f2d);_0x4e1bb0(_0x500f2d);});});}function respondWithStatusCode(_0x390114,_0x18db6a){_0x18db6a=_0x18db6a||0xcc;return function(_0x31d896){if(_0x31d896){return _0x390114[_0x4cb1('0x29')](_0x18db6a);}return _0x390114[_0x4cb1('0x2a')](_0x18db6a)[_0x4cb1('0x2b')]();};}function respondWithResult(_0x2bc906,_0x39f55e){_0x39f55e=_0x39f55e||0xc8;return function(_0x162aff){if(_0x162aff){return _0x2bc906[_0x4cb1('0x2a')](_0x39f55e)['json'](_0x162aff);}};}function respondWithFilteredResult(_0x12ce8a,_0x56e653){return function(_0x4e665e){if(_0x4e665e){var _0x37ab10=typeof _0x56e653[_0x4cb1('0x2c')]===_0x4cb1('0x2d')&&typeof _0x56e653[_0x4cb1('0x2e')]===_0x4cb1('0x2d');var _0x59d10d=_0x4e665e[_0x4cb1('0x2f')];var _0x484e8d=_0x37ab10?0x0:_0x56e653[_0x4cb1('0x2c')];var _0x547cd7=_0x37ab10?_0x4e665e[_0x4cb1('0x2f')]:_0x56e653[_0x4cb1('0x2c')]+_0x56e653[_0x4cb1('0x2e')];var _0x53056f;if(_0x547cd7>=_0x59d10d){_0x547cd7=_0x59d10d;_0x53056f=0xc8;}else{_0x53056f=0xce;}_0x12ce8a['status'](_0x53056f);return _0x12ce8a['set'](_0x4cb1('0x30'),_0x484e8d+'-'+_0x547cd7+'/'+_0x59d10d)[_0x4cb1('0x31')](_0x4e665e);}return null;};}function patchUpdates(_0xa79a8d){return function(_0x1ee854){try{jsonpatch['apply'](_0x1ee854,_0xa79a8d,!![]);}catch(_0x51f3c9){return BPromise[_0x4cb1('0x32')](_0x51f3c9);}return _0x1ee854[_0x4cb1('0x33')]();};}function saveUpdates(_0xf5f7b6,_0x1e58bd){return function(_0x2a1435){if(_0x2a1435){return _0x2a1435['update'](_0xf5f7b6)['then'](function(_0x5a8bc5){return _0x5a8bc5;});}return null;};}function removeEntity(_0x4f1df0,_0x4abe31){return function(_0x5d1951){if(_0x5d1951){return _0x5d1951[_0x4cb1('0x34')]()[_0x4cb1('0x1f')](function(){_0x4f1df0['status'](0xcc)[_0x4cb1('0x2b')]();});}};}function handleEntityNotFound(_0x1f1cd1,_0x372646){return function(_0x15a0aa){if(!_0x15a0aa){_0x1f1cd1['sendStatus'](0x194);}return _0x15a0aa;};}function handleError(_0x410b38,_0x546346){_0x546346=_0x546346||0x1f4;return function(_0x24189b){logger[_0x4cb1('0x25')](_0x24189b[_0x4cb1('0x35')]);if(_0x24189b[_0x4cb1('0x36')]){delete _0x24189b[_0x4cb1('0x36')];}_0x410b38['status'](_0x546346)[_0x4cb1('0x37')](_0x24189b);};}exports[_0x4cb1('0x38')]=function(_0x26c955,_0x27cbad){var _0x4bc20a={},_0x1d783c={},_0x50489c={'count':0x0,'rows':[]};var _0x56a809=_[_0x4cb1('0x39')](db['FaxMessage'][_0x4cb1('0x3a')],function(_0x2e340a){return{'name':_0x2e340a[_0x4cb1('0x3b')],'type':_0x2e340a['type'][_0x4cb1('0x3c')]};});_0x1d783c['model']=_[_0x4cb1('0x39')](_0x56a809,_0x4cb1('0x36'));_0x1d783c[_0x4cb1('0x3d')]=_[_0x4cb1('0x3e')](_0x26c955[_0x4cb1('0x3d')]);_0x1d783c['filters']=_['intersection'](_0x1d783c['model'],_0x1d783c[_0x4cb1('0x3d')]);_0x4bc20a[_0x4cb1('0x3f')]=_[_0x4cb1('0x40')](_0x1d783c[_0x4cb1('0x41')],qs[_0x4cb1('0x42')](_0x26c955[_0x4cb1('0x3d')][_0x4cb1('0x42')]));_0x4bc20a['attributes']=_0x4bc20a[_0x4cb1('0x3f')]['length']?_0x4bc20a[_0x4cb1('0x3f')]:_0x1d783c[_0x4cb1('0x41')];if(!_0x26c955[_0x4cb1('0x3d')][_0x4cb1('0x43')](_0x4cb1('0x44'))){_0x4bc20a[_0x4cb1('0x2e')]=qs[_0x4cb1('0x2e')](_0x26c955[_0x4cb1('0x3d')][_0x4cb1('0x2e')]);_0x4bc20a[_0x4cb1('0x2c')]=qs[_0x4cb1('0x2c')](_0x26c955[_0x4cb1('0x3d')][_0x4cb1('0x2c')]);}_0x4bc20a['order']=qs[_0x4cb1('0x45')](_0x26c955['query'][_0x4cb1('0x45')]);_0x4bc20a[_0x4cb1('0x46')]=qs[_0x4cb1('0x47')](_[_0x4cb1('0x48')](_0x26c955[_0x4cb1('0x3d')],_0x1d783c[_0x4cb1('0x47')]),_0x56a809);if(_0x26c955['query'][_0x4cb1('0x49')]){_0x4bc20a[_0x4cb1('0x46')]=_['merge'](_0x4bc20a['where'],{'$or':_[_0x4cb1('0x39')](_0x56a809,function(_0x39aff3){if(_0x39aff3['type']!=='VIRTUAL'){var _0x636144={};_0x636144[_0x39aff3[_0x4cb1('0x36')]]={'$like':'%'+_0x26c955[_0x4cb1('0x3d')][_0x4cb1('0x49')]+'%'};return _0x636144;}})});}_0x4bc20a=_['merge']({},_0x4bc20a,_0x26c955['options']);var _0x4cadc1={'where':_0x4bc20a['where']};return db['FaxMessage'][_0x4cb1('0x2f')](_0x4cadc1)['then'](function(_0x2b603e){_0x50489c['count']=_0x2b603e;if(_0x26c955[_0x4cb1('0x3d')][_0x4cb1('0x4a')]){_0x4bc20a[_0x4cb1('0x4b')]=[{'all':!![]}];}return db[_0x4cb1('0x4c')][_0x4cb1('0x4d')](_0x4bc20a);})[_0x4cb1('0x1f')](function(_0x2c2c83){_0x50489c[_0x4cb1('0x4e')]=_0x2c2c83;return _0x50489c;})[_0x4cb1('0x1f')](respondWithFilteredResult(_0x27cbad,_0x4bc20a))[_0x4cb1('0x4f')](handleError(_0x27cbad,null));};exports[_0x4cb1('0x50')]=function(_0x458800,_0x43f9ab){var _0x18d51c={'raw':!![],'where':{'id':_0x458800[_0x4cb1('0x51')]['id']}},_0x56ce43={};_0x56ce43[_0x4cb1('0x41')]=_[_0x4cb1('0x3e')](db['FaxMessage'][_0x4cb1('0x3a')]);_0x56ce43['query']=_['keys'](_0x458800[_0x4cb1('0x3d')]);_0x56ce43[_0x4cb1('0x47')]=_['intersection'](_0x56ce43[_0x4cb1('0x41')],_0x56ce43['query']);_0x18d51c[_0x4cb1('0x3f')]=_[_0x4cb1('0x40')](_0x56ce43[_0x4cb1('0x41')],qs['fields'](_0x458800[_0x4cb1('0x3d')]['fields']));_0x18d51c[_0x4cb1('0x3f')]=_0x18d51c[_0x4cb1('0x3f')][_0x4cb1('0x52')]?_0x18d51c[_0x4cb1('0x3f')]:_0x56ce43[_0x4cb1('0x41')];if(_0x458800[_0x4cb1('0x3d')][_0x4cb1('0x4a')]){_0x18d51c[_0x4cb1('0x4b')]=[{'all':!![]}];}_0x18d51c=_[_0x4cb1('0x53')]({},_0x18d51c,_0x458800[_0x4cb1('0x54')]);return db[_0x4cb1('0x4c')]['find'](_0x18d51c)['then'](handleEntityNotFound(_0x43f9ab,null))['then'](respondWithResult(_0x43f9ab,null))[_0x4cb1('0x4f')](handleError(_0x43f9ab,null));};exports[_0x4cb1('0x55')]=function(_0x4f733c,_0x2887dd){if(_0x4f733c[_0x4cb1('0x56')]['id']){delete _0x4f733c[_0x4cb1('0x56')]['id'];}return db[_0x4cb1('0x4c')][_0x4cb1('0x57')]({'where':{'id':_0x4f733c[_0x4cb1('0x51')]['id']}})[_0x4cb1('0x1f')](handleEntityNotFound(_0x2887dd,null))[_0x4cb1('0x1f')](saveUpdates(_0x4f733c[_0x4cb1('0x56')],null))['then'](respondWithResult(_0x2887dd,null))[_0x4cb1('0x4f')](handleError(_0x2887dd,null));};exports['destroy']=function(_0x147030,_0x109560){return db[_0x4cb1('0x4c')]['find']({'where':{'id':_0x147030[_0x4cb1('0x51')]['id']}})['then'](handleEntityNotFound(_0x109560,null))[_0x4cb1('0x1f')](removeEntity(_0x109560,null))[_0x4cb1('0x4f')](handleError(_0x109560,null));};exports[_0x4cb1('0x58')]=function(_0x202f8c,_0x340cd0){return db['FaxMessage'][_0x4cb1('0x58')]()['then'](respondWithResult(_0x340cd0,null))[_0x4cb1('0x4f')](handleError(_0x340cd0,null));};var interaction_log=require(_0x4cb1('0x59'))(_0x4cb1('0x5a'));exports['accept']=function(_0x549790,_0x105f07,_0x13187d){var _0x91957b={'agent':{},'channel':_0x4cb1('0x5b')};if(_0x549790[_0x4cb1('0x56')]['id']){delete _0x549790[_0x4cb1('0x56')]['id'];}_0x549790[_0x4cb1('0x56')][_0x4cb1('0x5c')]=!![];_0x549790[_0x4cb1('0x56')][_0x4cb1('0x5d')]=moment()[_0x4cb1('0x5e')](_0x4cb1('0x5f'));_0x549790[_0x4cb1('0x56')][_0x4cb1('0x60')]=_0x549790[_0x4cb1('0x56')][_0x4cb1('0x60')]||_0x549790[_0x4cb1('0x61')]['id'];_0x91957b['agent']['id']=_0x549790[_0x4cb1('0x56')]['UserId'];return db[_0x4cb1('0x4c')][_0x4cb1('0x57')]({'where':{'id':_0x549790[_0x4cb1('0x51')]['id'],'UserId':null}})[_0x4cb1('0x1f')](handleEntityNotFound(_0x105f07,null))[_0x4cb1('0x1f')](saveUpdates(_0x549790[_0x4cb1('0x56')],null))['then'](function(_0x4caab5){if(_0x4caab5){_0x91957b[_0x4cb1('0x28')]=_0x4caab5[_0x4cb1('0x62')]({'plain':!![]});return db[_0x4cb1('0x63')][_0x4cb1('0x57')]({'where':{'id':_0x4caab5['FaxInteractionId']}});}return null;})[_0x4cb1('0x1f')](handleEntityNotFound(_0x105f07,null))[_0x4cb1('0x1f')](function(_0xcebad9){if(_0xcebad9){return _0xcebad9[_0x4cb1('0x55')]({'UserId':_0x549790[_0x4cb1('0x56')][_0x4cb1('0x60')],'read1stAt':_[_0x4cb1('0x64')](_0xcebad9[_0x4cb1('0x65')])?moment()[_0x4cb1('0x5e')](_0x4cb1('0x5f')):undefined});}return null;})[_0x4cb1('0x1f')](function(_0x3b4e0f){if(_0x3b4e0f){_0x91957b['interaction']=_0x3b4e0f['get']({'plain':!![]});interaction_log['info'](_0x4cb1('0x66'),_0x549790[_0x4cb1('0x61')]['id'],_0x549790[_0x4cb1('0x61')][_0x4cb1('0x36')],_0x549790[_0x4cb1('0x61')][_0x4cb1('0x67')],_0x91957b[_0x4cb1('0x68')]['id'],_0x549790[_0x4cb1('0x56')]?JSON[_0x4cb1('0x24')](_0x549790['body']):_0x4cb1('0x69'));return respondWithRpcPromise(_0x4cb1('0x6a'),_0x4cb1('0x6b'),_0x91957b);}return null;})[_0x4cb1('0x1f')](function(_0xd79f0c){var _0x546e62=_0x4cb1('0x6c')+_0xd79f0c['message']['ContactId'];return db['sequelize']['query'](_0x546e62,{'type':db['Sequelize'][_0x4cb1('0x6d')][_0x4cb1('0x6e')],'raw':!![]})[_0x4cb1('0x1f')](function(_0x5be2b7){return _0x5be2b7;});})[_0x4cb1('0x1f')](function(_0x2f97f9){if(_0x2f97f9){_0x91957b[_0x4cb1('0x28')][_0x4cb1('0x6f')]=_0x2f97f9[0x0];if(!_0x549790['body'][_0x4cb1('0x60')])return;return db['User'][_0x4cb1('0x57')]({'where':{'id':_0x549790['body'][_0x4cb1('0x60')],'role':_0x4cb1('0x70')},'attributes':['id',_0x4cb1('0x36'),'fullname',_0x4cb1('0x71'),_0x4cb1('0x72')],'raw':!![]});}return null;})[_0x4cb1('0x1f')](function(_0x9eb458){if(!_0x9eb458)return null;_0x91957b[_0x4cb1('0x28')][_0x4cb1('0x70')]=_0x9eb458;return _0x91957b;})[_0x4cb1('0x1f')](function(_0x3109f5){if(_0x3109f5){if(_0x549790[_0x4cb1('0x56')][_0x4cb1('0x73')]){_0x91957b[_0x4cb1('0x28')][_0x4cb1('0x74')]=util[_0x4cb1('0x5e')](_0x4cb1('0x75'),_0x549790[_0x4cb1('0x61')][_0x4cb1('0x36')]);_0x91957b['message'][_0x4cb1('0x76')]=_0x91957b[_0x4cb1('0x76')];_0x91957b[_0x4cb1('0x28')][_0x4cb1('0x77')]=_0x91957b[_0x4cb1('0x76')];_0x91957b[_0x4cb1('0x28')][_0x4cb1('0x78')]=_0x4cb1('0x79');return respondWithRpcPromise(_0x4cb1('0x7a'),_0x4cb1('0x7a'),{'event':_0x4cb1('0x7b'),'message':_0x91957b[_0x4cb1('0x28')]},client9002)[_0x4cb1('0x1f')](function(){return _0x91957b;});}return _0x91957b;}return null;})['then'](respondWithResult(_0x105f07,null))[_0x4cb1('0x4f')](handleError(_0x105f07,null));};var interaction_log=require(_0x4cb1('0x59'))('fax-interactions');exports['reject']=function(_0x2073f4,_0x56f21e,_0xbd8bdb){var _0x340815={'agent':{},'channel':_0x4cb1('0x5b')};if(_0x2073f4[_0x4cb1('0x56')]['id']){delete _0x2073f4['body']['id'];}_0x2073f4[_0x4cb1('0x56')][_0x4cb1('0x60')]=_0x2073f4['body'][_0x4cb1('0x60')]||_0x2073f4[_0x4cb1('0x61')]['id'];_0x340815['agent']['id']=_0x2073f4['body'][_0x4cb1('0x60')];return db['FaxMessage'][_0x4cb1('0x57')]({'where':{'id':_0x2073f4['params']['id'],'UserId':null}})[_0x4cb1('0x1f')](handleEntityNotFound(_0x56f21e,null))[_0x4cb1('0x1f')](function(_0x166443){if(_0x166443){_0x340815['message']=_0x166443[_0x4cb1('0x62')]({'plain':!![]});return db['FaxInteraction'][_0x4cb1('0x57')]({'where':{'id':_0x166443['FaxInteractionId']}});}return null;})[_0x4cb1('0x1f')](handleEntityNotFound(_0x56f21e,null))[_0x4cb1('0x1f')](function(_0x2dbb9d){if(_0x2dbb9d){_0x340815[_0x4cb1('0x68')]=_0x2dbb9d['get']({'plain':!![]});interaction_log[_0x4cb1('0x20')](_0x4cb1('0x7c'),_0x2073f4[_0x4cb1('0x61')]['id'],_0x2073f4['user'][_0x4cb1('0x36')],_0x2073f4[_0x4cb1('0x61')][_0x4cb1('0x67')],_0x340815[_0x4cb1('0x68')]['id'],_0x2073f4['body']?JSON[_0x4cb1('0x24')](_0x2073f4['body']):_0x4cb1('0x69'));return respondWithRpcPromise(_0x4cb1('0x7d'),'rejectMessage',_0x340815);}return null;})['then'](function(_0x55567d){var _0x5f393e=_0x4cb1('0x6c')+_0x55567d[_0x4cb1('0x28')][_0x4cb1('0x7e')];return db[_0x4cb1('0x7f')][_0x4cb1('0x3d')](_0x5f393e,{'type':db[_0x4cb1('0x80')][_0x4cb1('0x6d')]['SELECT'],'raw':!![]})[_0x4cb1('0x1f')](function(_0x4f8648){return _0x4f8648;});})['then'](function(_0x5e074b){if(_0x5e074b){_0x340815[_0x4cb1('0x28')][_0x4cb1('0x6f')]=_0x5e074b[0x0];if(!_0x2073f4[_0x4cb1('0x56')][_0x4cb1('0x60')])return;return db[_0x4cb1('0x81')][_0x4cb1('0x57')]({'where':{'id':_0x2073f4[_0x4cb1('0x56')][_0x4cb1('0x60')],'role':_0x4cb1('0x70')},'attributes':['id',_0x4cb1('0x36'),_0x4cb1('0x82'),_0x4cb1('0x71'),_0x4cb1('0x72')],'raw':!![]});}return null;})[_0x4cb1('0x1f')](function(_0xe91f12){if(!_0xe91f12)return null;_0x340815[_0x4cb1('0x28')]['agent']=_0xe91f12;return _0x340815;})[_0x4cb1('0x1f')](function(_0x25fe46){if(_0x25fe46){_0x25fe46[_0x4cb1('0x28')][_0x4cb1('0x74')]=util['format'](_0x4cb1('0x75'),_0x2073f4[_0x4cb1('0x61')][_0x4cb1('0x36')]);_0x25fe46[_0x4cb1('0x28')][_0x4cb1('0x76')]=_0x340815[_0x4cb1('0x76')];_0x25fe46[_0x4cb1('0x28')]['motionChannel']=_0x340815['channel'];_0x25fe46[_0x4cb1('0x28')][_0x4cb1('0x78')]=_0x4cb1('0x32');respondWithRpcPromise(_0x4cb1('0x7a'),_0x4cb1('0x7a'),{'event':_0x4cb1('0x83'),'message':_0x25fe46[_0x4cb1('0x28')]},client9002);return _0x340815;}return null;})['then'](respondWithResult(_0x56f21e,null))[_0x4cb1('0x4f')](handleError(_0x56f21e,null));};exports[_0x4cb1('0x84')]=function(_0x152812,_0x13ee8c){var _0x54db09;return db[_0x4cb1('0x4c')][_0x4cb1('0x84')](_0x152812['body'],{})[_0x4cb1('0x1f')](function(_0x5dd113){_0x54db09=_0x5dd113;return db['CmContact']['findOne']({'where':{'id':_0x54db09[_0x4cb1('0x7e')]}});})['then'](function(_0x5e7d13){if(_[_0x4cb1('0x64')](_0x5e7d13)){return;}else{_0x54db09[_0x4cb1('0x5b')]=_0x5e7d13['fax'];return db[_0x4cb1('0x85')][_0x4cb1('0x86')]({'where':{'id':_0x54db09[_0x4cb1('0x87')]}});}})[_0x4cb1('0x1f')](function(_0x19e9cf){return respondWithRpcPromise(_0x4cb1('0x88'),_0x4cb1('0x88'),{'FaxAccountId':_[_0x4cb1('0x64')](_0x152812[_0x4cb1('0x56')])?undefined:_0x152812['body']['FaxAccountId'],'path':_[_0x4cb1('0x64')](_0x19e9cf)?undefined:util[_0x4cb1('0x5e')](_0x4cb1('0x89'),_0x19e9cf[_0x4cb1('0x8a')]),'fax':_['isNil'](_0x54db09[_0x4cb1('0x5b')])?undefined:_0x54db09['fax'],'AttachmentId':_0x54db09[_0x4cb1('0x87')]},client9002);})[_0x4cb1('0x1f')](respondWithResult(_0x13ee8c,0xc9))[_0x4cb1('0x4f')](handleError(_0x13ee8c,null));};exports[_0x4cb1('0x8b')]=function(_0x2c7c1d,_0x4e6ea3){var _0x2419d0=path[_0x4cb1('0x8c')](config[_0x4cb1('0x8d')],_0x4cb1('0x8e'),_0x4cb1('0x8f'),_0x4cb1('0x90'));return db['FaxMessage'][_0x4cb1('0x57')]({'where':{'id':_0x2c7c1d['params']['id']},'include':[{'model':db[_0x4cb1('0x85')],'as':_0x4cb1('0x85')}]})[_0x4cb1('0x1f')](handleEntityNotFound(_0x4e6ea3,null))[_0x4cb1('0x1f')](function(_0x3c3018){if(_0x3c3018){return _0x4e6ea3[_0x4cb1('0x8b')](path[_0x4cb1('0x8c')](_0x2419d0,_0x3c3018[_0x4cb1('0x85')][_0x4cb1('0x8a')]));}})['catch'](handleError(_0x4e6ea3,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index b488b7c..41e937a 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 _0xd9ce=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x26e8bc,_0x453f37){var _0x146be4=function(_0x2f97d3){while(--_0x2f97d3){_0x26e8bc['push'](_0x26e8bc['shift']());}};_0x146be4(++_0x453f37);}(_0xd9ce,0xeb));var _0xed9c=function(_0x188cc8,_0xd39746){_0x188cc8=_0x188cc8-0x0;var _0x4cb155=_0xd9ce[_0x188cc8];return _0x4cb155;};'use strict';var EventEmitter=require(_0xed9c('0x0'));var FaxMessage=require(_0xed9c('0x1'))['db'][_0xed9c('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xed9c('0x3')](0x0);var events={'afterCreate':_0xed9c('0x4'),'afterUpdate':_0xed9c('0x5'),'afterDestroy':_0xed9c('0x6')};function emitEvent(_0x1cd5b5){return function(_0x5903b6,_0x3c9c4a,_0xd13461){FaxMessageEvents[_0xed9c('0x7')](_0x1cd5b5+':'+_0x5903b6['id'],_0x5903b6);FaxMessageEvents[_0xed9c('0x7')](_0x1cd5b5,_0x5903b6);_0xd13461(null);};}for(var e in events){if(events[_0xed9c('0x8')](e)){var event=events[e];FaxMessage[_0xed9c('0x9')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x3079=['../../mysqldb','FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x5c50f7,_0x312a25){var _0x41aa2d=function(_0x239e67){while(--_0x239e67){_0x5c50f7['push'](_0x5c50f7['shift']());}};_0x41aa2d(++_0x312a25);}(_0x3079,0x110));var _0x9307=function(_0x299796,_0x453e14){_0x299796=_0x299796-0x0;var _0x5044fe=_0x3079[_0x299796];return _0x5044fe;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x9307('0x0'))['db'][_0x9307('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9307('0x2')](0x0);var events={'afterCreate':_0x9307('0x3'),'afterUpdate':'update','afterDestroy':_0x9307('0x4')};function emitEvent(_0x1f7680){return function(_0x513b2c,_0x57c9a6,_0x42c46a){FaxMessageEvents[_0x9307('0x5')](_0x1f7680+':'+_0x513b2c['id'],_0x513b2c);FaxMessageEvents[_0x9307('0x5')](_0x1f7680,_0x513b2c);_0x42c46a(null);};}for(var e in events){if(events[_0x9307('0x6')](e)){var event=events[e];FaxMessage[_0x9307('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index b5fcd41..ef80deb 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 _0x3182=['utf8mb4_unicode_ci','util','api','request-promise','rimraf','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','then','update','catch'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3182,0x199));var _0x2318=function(_0x8879c9,_0x586a6a){_0x8879c9=_0x8879c9-0x0;var _0x49758a=_0x3182[_0x8879c9];return _0x49758a;};'use strict';var _=require('lodash');var util=require(_0x2318('0x0'));var logger=require('../../config/logger')(_0x2318('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2318('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2318('0x3'));var config=require('../../config/environment');var attributes=require(_0x2318('0x4'));module['exports']=function(_0x930663,_0x10900b){return _0x930663[_0x2318('0x5')](_0x2318('0x6'),attributes,{'tableName':_0x2318('0x7'),'paranoid':![],'indexes':[{'name':_0x2318('0x8'),'fields':[_0x2318('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2684dc,_0x3effd2,_0x22e90f){var _0xfcbf8c=_0x930663[_0x2318('0xa')];var _0x8f834d=_0x2684dc[_0x2318('0xb')]({'plain':!![]});if(_0x8f834d['direction']['toLowerCase']()==='in'||_0x8f834d[_0x2318('0xc')][_0x2318('0xd')]()===_0x2318('0xe')&&!_0x8f834d[_0x2318('0xf')]&&!_[_0x2318('0x10')](_0x8f834d[_0x2318('0x11')])){_0xfcbf8c[_0x2318('0x12')][_0x2318('0x13')]({'where':{'id':_0x8f834d['FaxInteractionId']}})[_0x2318('0x14')](function(_0x34929b){if(_0x34929b){_0x34929b[_0x2318('0x15')]({'lastMsgAt':_0x8f834d['createdAt'],'lastMsgDirection':_0x8f834d[_0x2318('0xc')][_0x2318('0xd')]()});}})[_0x2318('0x16')](function(_0x1cff30){console['error'](_0x1cff30);});}_0x22e90f();}},'charset':'utf8mb4','collate':_0x2318('0x17')});}; \ No newline at end of file +var _0xcf11=['toLowerCase','out','secret','FaxInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','direction'];(function(_0x372ac7,_0x48f2da){var _0x44eb4f=function(_0x176e02){while(--_0x176e02){_0x372ac7['push'](_0x372ac7['shift']());}};_0x44eb4f(++_0x48f2da);}(_0xcf11,0x15b));var _0x1cf1=function(_0x16ed87,_0x1be1a2){_0x16ed87=_0x16ed87-0x0;var _0xc1a1d8=_0xcf11[_0x16ed87];return _0xc1a1d8;};'use strict';var _=require(_0x1cf1('0x0'));var util=require('util');var logger=require(_0x1cf1('0x1'))(_0x1cf1('0x2'));var moment=require(_0x1cf1('0x3'));var BPromise=require(_0x1cf1('0x4'));var rp=require(_0x1cf1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1cf1('0x6'));var config=require(_0x1cf1('0x7'));var attributes=require(_0x1cf1('0x8'));module[_0x1cf1('0x9')]=function(_0x514a81,_0x1fab2b){return _0x514a81[_0x1cf1('0xa')](_0x1cf1('0xb'),attributes,{'tableName':_0x1cf1('0xc'),'paranoid':![],'indexes':[{'name':_0x1cf1('0xd'),'fields':['body'],'type':_0x1cf1('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5f10b5,_0x4a883f,_0x78cb46){var _0x16ce32=_0x514a81[_0x1cf1('0xf')];var _0x101505=_0x5f10b5['get']({'plain':!![]});if(_0x101505[_0x1cf1('0x10')]['toLowerCase']()==='in'||_0x101505[_0x1cf1('0x10')][_0x1cf1('0x11')]()===_0x1cf1('0x12')&&!_0x101505[_0x1cf1('0x13')]&&!_['isNil'](_0x101505['UserId'])){_0x16ce32['FaxInteraction']['findOne']({'where':{'id':_0x101505[_0x1cf1('0x14')]}})['then'](function(_0x32681a){if(_0x32681a){_0x32681a[_0x1cf1('0x15')]({'lastMsgAt':_0x101505[_0x1cf1('0x16')],'lastMsgDirection':_0x101505[_0x1cf1('0x10')][_0x1cf1('0x11')]()});}})['catch'](function(_0x5df040){console[_0x1cf1('0x17')](_0x5df040);});}_0x78cb46();}},'charset':_0x1cf1('0x18'),'collate':_0x1cf1('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 38025cb..0459ef6 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 _0xedd9=['create','body','raw','CreateFaxMessage','catch','FaxMessage','update','options','where','attributes','limit','UpdateFaxMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2c4010,_0x1bc816){var _0x40cdf9=function(_0x1f6e78){while(--_0x1f6e78){_0x2c4010['push'](_0x2c4010['shift']());}};_0x40cdf9(++_0x1bc816);}(_0xedd9,0xfc));var _0x9edd=function(_0x588292,_0x30c2e6){_0x588292=_0x588292-0x0;var _0x2bd7a0=_0xedd9[_0x588292];return _0x2bd7a0;};'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});config['redis']=_[_0x9edd('0xc')](config['redis'],{'host':_0x9edd('0xd'),'port':0x18eb});var socket=require(_0x9edd('0xe'))(new Redis(config[_0x9edd('0xf')]));require(_0x9edd('0x10'))['register'](socket);function respondWithRpcPromise(_0x494a24,_0x5d2f90,_0x2076fc){return new BPromise(function(_0x138767,_0x523026){return client[_0x9edd('0x11')](_0x494a24,_0x2076fc)[_0x9edd('0x12')](function(_0x5b6c00){logger[_0x9edd('0x13')](_0x9edd('0x14'),_0x5d2f90,_0x9edd('0x15'));logger[_0x9edd('0x16')](_0x9edd('0x17'),_0x5d2f90,_0x9edd('0x15'),JSON[_0x9edd('0x18')](_0x5b6c00));if(_0x5b6c00[_0x9edd('0x19')]){if(_0x5b6c00['error'][_0x9edd('0x1a')]===0x1f4){logger[_0x9edd('0x19')](_0x9edd('0x14'),_0x5d2f90,_0x5b6c00[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x523026(_0x5b6c00[_0x9edd('0x19')][_0x9edd('0x1b')]);}logger[_0x9edd('0x19')]('FaxMessage,\x20%s,\x20%s',_0x5d2f90,_0x5b6c00[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x138767(_0x5b6c00[_0x9edd('0x19')]['message']);}else{logger[_0x9edd('0x13')](_0x9edd('0x14'),_0x5d2f90,_0x9edd('0x15'));_0x138767(_0x5b6c00['result'][_0x9edd('0x1b')]);}})['catch'](function(_0x2cdcef){logger[_0x9edd('0x19')]('FaxMessage,\x20%s,\x20%s',_0x5d2f90,_0x2cdcef);_0x523026(_0x2cdcef);});});}exports['CreateFaxMessage']=function(_0x45c3ab){var _0x50338f=this;return new Promise(function(_0x27a95a,_0x54a03f){return db['FaxMessage'][_0x9edd('0x1c')](_0x45c3ab[_0x9edd('0x1d')],{'raw':_0x45c3ab['options']?_0x45c3ab['options'][_0x9edd('0x1e')]===undefined?!![]:![]:!![]})[_0x9edd('0x12')](function(_0x477878){logger['info'](_0x9edd('0x1f'),_0x45c3ab);logger[_0x9edd('0x16')](_0x9edd('0x1f'),_0x45c3ab,JSON[_0x9edd('0x18')](_0x477878));_0x27a95a(_0x477878);})[_0x9edd('0x20')](function(_0x4c75d2){logger[_0x9edd('0x19')](_0x9edd('0x1f'),_0x4c75d2[_0x9edd('0x1b')],_0x45c3ab);_0x54a03f(_0x50338f[_0x9edd('0x19')](0x1f4,_0x4c75d2[_0x9edd('0x1b')]));});});};exports['UpdateFaxMessage']=function(_0x4b3d1b){var _0x3276ee=this;return new Promise(function(_0xfeca7b,_0x8d67aa){return db[_0x9edd('0x21')][_0x9edd('0x22')](_0x4b3d1b['body'],{'raw':_0x4b3d1b['options']?_0x4b3d1b[_0x9edd('0x23')][_0x9edd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b3d1b[_0x9edd('0x23')]?_0x4b3d1b['options'][_0x9edd('0x24')]||null:null,'attributes':_0x4b3d1b[_0x9edd('0x23')]?_0x4b3d1b[_0x9edd('0x23')][_0x9edd('0x25')]||null:null,'limit':_0x4b3d1b['options']?_0x4b3d1b[_0x9edd('0x23')][_0x9edd('0x26')]||null:null})[_0x9edd('0x12')](function(_0x12c1bc){logger[_0x9edd('0x13')](_0x9edd('0x27'),_0x4b3d1b);logger[_0x9edd('0x16')](_0x9edd('0x27'),_0x4b3d1b,JSON[_0x9edd('0x18')](_0x12c1bc));_0xfeca7b(_0x12c1bc);})[_0x9edd('0x20')](function(_0x4fd03f){logger[_0x9edd('0x19')](_0x9edd('0x27'),_0x4fd03f[_0x9edd('0x1b')],_0x4b3d1b);_0x8d67aa(_0x3276ee[_0x9edd('0x19')](0x1f4,_0x4fd03f['message']));});});}; \ No newline at end of file +var _0xb821=['register','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','create','body','options','raw','stringify','UpdateFaxMessage','FaxMessage','update','where','attributes','limit','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0xa9000b,_0x46e9d1){var _0xa2beca=function(_0x203c43){while(--_0x203c43){_0xa9000b['push'](_0xa9000b['shift']());}};_0xa2beca(++_0x46e9d1);}(_0xb821,0xa7));var _0x1b82=function(_0x25a67c,_0x1605c3){_0x25a67c=_0x25a67c-0x0;var _0x37a8c0=_0xb821[_0x25a67c];return _0x37a8c0;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});config[_0x1b82('0x8')]=_[_0x1b82('0x9')](config[_0x1b82('0x8')],{'host':_0x1b82('0xa'),'port':0x18eb});var socket=require(_0x1b82('0xb'))(new Redis(config[_0x1b82('0x8')]));require(_0x1b82('0xc'))[_0x1b82('0xd')](socket);function respondWithRpcPromise(_0x4955b5,_0x4011f2,_0x30c6ee){return new BPromise(function(_0x44dfd4,_0x14c57a){return client[_0x1b82('0xe')](_0x4955b5,_0x30c6ee)[_0x1b82('0xf')](function(_0x739f99){logger[_0x1b82('0x10')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x1b82('0x11'));logger[_0x1b82('0x12')](_0x1b82('0x13'),_0x4011f2,_0x1b82('0x11'),JSON['stringify'](_0x739f99));if(_0x739f99[_0x1b82('0x14')]){if(_0x739f99['error']['code']===0x1f4){logger[_0x1b82('0x14')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x739f99[_0x1b82('0x14')][_0x1b82('0x15')]);return _0x14c57a(_0x739f99['error'][_0x1b82('0x15')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x739f99[_0x1b82('0x14')]['message']);return _0x44dfd4(_0x739f99[_0x1b82('0x14')][_0x1b82('0x15')]);}else{logger[_0x1b82('0x10')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,'request\x20sent');_0x44dfd4(_0x739f99[_0x1b82('0x16')]['message']);}})[_0x1b82('0x17')](function(_0x1002a1){logger[_0x1b82('0x14')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x1002a1);_0x14c57a(_0x1002a1);});});}exports[_0x1b82('0x18')]=function(_0x2b6ee8){var _0x11af50=this;return new Promise(function(_0x46e5e2,_0x10d45c){return db['FaxMessage'][_0x1b82('0x19')](_0x2b6ee8[_0x1b82('0x1a')],{'raw':_0x2b6ee8[_0x1b82('0x1b')]?_0x2b6ee8[_0x1b82('0x1b')][_0x1b82('0x1c')]===undefined?!![]:![]:!![]})[_0x1b82('0xf')](function(_0x2d07f4){logger['info'](_0x1b82('0x18'),_0x2b6ee8);logger[_0x1b82('0x12')]('CreateFaxMessage',_0x2b6ee8,JSON[_0x1b82('0x1d')](_0x2d07f4));_0x46e5e2(_0x2d07f4);})[_0x1b82('0x17')](function(_0x1ad9d6){logger['error'](_0x1b82('0x18'),_0x1ad9d6['message'],_0x2b6ee8);_0x10d45c(_0x11af50['error'](0x1f4,_0x1ad9d6['message']));});});};exports[_0x1b82('0x1e')]=function(_0x149d0f){var _0xfd00d1=this;return new Promise(function(_0x257b79,_0x548a3b){return db[_0x1b82('0x1f')][_0x1b82('0x20')](_0x149d0f[_0x1b82('0x1a')],{'raw':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x21')]||null:null,'attributes':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x22')]||null:null,'limit':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f['options'][_0x1b82('0x23')]||null:null})[_0x1b82('0xf')](function(_0x155a34){logger[_0x1b82('0x10')](_0x1b82('0x1e'),_0x149d0f);logger[_0x1b82('0x12')](_0x1b82('0x1e'),_0x149d0f,JSON[_0x1b82('0x1d')](_0x155a34));_0x257b79(_0x155a34);})[_0x1b82('0x17')](function(_0x362657){logger['error'](_0x1b82('0x1e'),_0x362657[_0x1b82('0x15')],_0x149d0f);_0x548a3b(_0xfd00d1[_0x1b82('0x14')](0x1f4,_0x362657[_0x1b82('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b69a368..a67eac8 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 _0xb1d6=['save','remove','emit','removeListener','register','length','./faxMessage.events'];(function(_0x1d6f82,_0x1e3208){var _0x1d9c09=function(_0x1312a3){while(--_0x1312a3){_0x1d6f82['push'](_0x1d6f82['shift']());}};_0x1d9c09(++_0x1e3208);}(_0xb1d6,0x19c));var _0x6b1d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb1d6[_0x14add3];return _0x4a174f;};'use strict';var FaxMessageEvents=require(_0x6b1d('0x0'));var events=[_0x6b1d('0x1'),_0x6b1d('0x2'),'update'];function createListener(_0x2824c9,_0x16dc57){return function(_0x22628e){_0x16dc57[_0x6b1d('0x3')](_0x2824c9,_0x22628e);};}function removeListener(_0x10bbf0,_0x2817e0){return function(){FaxMessageEvents[_0x6b1d('0x4')](_0x10bbf0,_0x2817e0);};}exports[_0x6b1d('0x5')]=function(_0x23db43){for(var _0x4d37aa=0x0,_0x587836=events[_0x6b1d('0x6')];_0x4d37aa<_0x587836;_0x4d37aa++){var _0xc9766b=events[_0x4d37aa];var _0x1adf86=createListener('faxMessage:'+_0xc9766b,_0x23db43);FaxMessageEvents['on'](_0xc9766b,_0x1adf86);}}; \ No newline at end of file +var _0x13ae=['save','remove','update','emit','removeListener','length','./faxMessage.events'];(function(_0xaa87e,_0x28eea1){var _0x1843d4=function(_0x4d0fe2){while(--_0x4d0fe2){_0xaa87e['push'](_0xaa87e['shift']());}};_0x1843d4(++_0x28eea1);}(_0x13ae,0xa0));var _0xe13a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x13ae[_0x465028];return _0xb783d4;};'use strict';var FaxMessageEvents=require(_0xe13a('0x0'));var events=[_0xe13a('0x1'),_0xe13a('0x2'),_0xe13a('0x3')];function createListener(_0x191041,_0x3fe9b9){return function(_0x2b76ce){_0x3fe9b9[_0xe13a('0x4')](_0x191041,_0x2b76ce);};}function removeListener(_0x22a7c3,_0x52405e){return function(){FaxMessageEvents[_0xe13a('0x5')](_0x22a7c3,_0x52405e);};}exports['register']=function(_0x417f07){for(var _0x2033cc=0x0,_0x36e77d=events[_0xe13a('0x6')];_0x2033cc<_0x36e77d;_0x2033cc++){var _0x366dc1=events[_0x2033cc];var _0x5c777f=createListener('faxMessage:'+_0x366dc1,_0x417f07);FaxMessageEvents['on'](_0x366dc1,_0x5c777f);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index fd30648..9dd6570 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 _0x1be1=['create','put','update','/:id/accept','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','describe','/:id','/:id/download','download','post','tracked','faxmessage:create'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x1be1,0x192));var _0x11be=function(_0x4e0d7c,_0x8129fd){_0x4e0d7c=_0x4e0d7c-0x0;var _0x1a2f6d=_0x1be1[_0x4e0d7c];return _0x1a2f6d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/describe',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0x7')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller['show']);router[_0x11be('0x7')](_0x11be('0xb'),auth['isAuthenticated'](),controller[_0x11be('0xc')]);router[_0x11be('0xd')]('/',auth[_0x11be('0x8')](),interaction[_0x11be('0xe')]('fax',_0x11be('0xf')),controller[_0x11be('0x10')]);router[_0x11be('0x11')]('/:id',auth[_0x11be('0x8')](),controller[_0x11be('0x12')]);router['put'](_0x11be('0x13'),auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router['delete'](_0x11be('0xa'),auth['isAuthenticated'](),controller[_0x11be('0x14')]);module[_0x11be('0x15')]=router; \ No newline at end of file +var _0xc6d8=['describe','/:id','show','/:id/download','download','post','tracked','faxmessage:create','update','put','/:id/accept','accept','/:id/reject','delete','exports','multer','path','express','fs-extra','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x7637ea,_0x145dfe){var _0x14d2f6=function(_0x1e17d6){while(--_0x1e17d6){_0x7637ea['push'](_0x7637ea['shift']());}};_0x14d2f6(++_0x145dfe);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x1f754a,_0x38709f){_0x1f754a=_0x1f754a-0x0;var _0x4b1c93=_0xc6d8[_0x1f754a];return _0x4b1c93;};'use strict';var multer=require(_0x8c6d('0x0'));var util=require('util');var path=require(_0x8c6d('0x1'));var timeout=require('connect-timeout');var express=require(_0x8c6d('0x2'));var router=express['Router']();var fs_extra=require(_0x8c6d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8c6d('0x4'));var controller=require(_0x8c6d('0x5'));router[_0x8c6d('0x6')]('/',auth[_0x8c6d('0x7')](),controller[_0x8c6d('0x8')]);router[_0x8c6d('0x6')](_0x8c6d('0x9'),auth['isAuthenticated'](),controller[_0x8c6d('0xa')]);router[_0x8c6d('0x6')](_0x8c6d('0xb'),auth['isAuthenticated'](),controller[_0x8c6d('0xc')]);router[_0x8c6d('0x6')](_0x8c6d('0xd'),auth[_0x8c6d('0x7')](),controller[_0x8c6d('0xe')]);router[_0x8c6d('0xf')]('/',auth[_0x8c6d('0x7')](),interaction[_0x8c6d('0x10')]('fax',_0x8c6d('0x11')),controller['create']);router['put'](_0x8c6d('0xb'),auth[_0x8c6d('0x7')](),controller[_0x8c6d('0x12')]);router[_0x8c6d('0x13')](_0x8c6d('0x14'),auth[_0x8c6d('0x7')](),controller[_0x8c6d('0x15')]);router[_0x8c6d('0x13')](_0x8c6d('0x16'),auth[_0x8c6d('0x7')](),controller['reject']);router[_0x8c6d('0x17')]('/:id',auth[_0x8c6d('0x7')](),controller['destroy']);module[_0x8c6d('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 e96adb3..eb4f01d 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 _0x8738=['STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x8738,0x1aa));var _0x8873=function(_0x54d547,_0x3f7c8f){_0x54d547=_0x54d547-0x0;var _0x1d09aa=_0x8738[_0x54d547];return _0x1d09aa;};'use strict';var Sequelize=require(_0x8873('0x0'));module['exports']={'name':{'type':Sequelize[_0x8873('0x1')],'unique':_0x8873('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8873('0x1')]},'timeout':{'type':Sequelize[_0x8873('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8873('0x4')](_0x8873('0x5'),'beepall',_0x8873('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xffdd=['INTEGER','ENUM','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x2022ba,_0x1cee00){var _0x58d704=function(_0x178e4f){while(--_0x178e4f){_0x2022ba['push'](_0x2022ba['shift']());}};_0x58d704(++_0x1cee00);}(_0xffdd,0x193));var _0xdffd=function(_0xfcb368,_0x23b5c0){_0xfcb368=_0xfcb368-0x0;var _0x2d0e92=_0xffdd[_0xfcb368];return _0x2d0e92;};'use strict';var Sequelize=require(_0xdffd('0x0'));module[_0xdffd('0x1')]={'name':{'type':Sequelize[_0xdffd('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xdffd('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdffd('0x4')]('rrmemory',_0xdffd('0x5'),_0xdffd('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xdffd('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 c96af02..b1ed7f4 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 _0xf0be=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','FaxQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','FaxQueue','fieldName','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','get','user','UserProfileSection','userProfileId','autoAssociation','body','getMembers','findOne','keys','hasOwnProperty','FaxQueueId','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','select','field','tq.TeamId','from','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','spread','userFaxQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','../../components/auth/service'];(function(_0x2eaa8b,_0x3b815f){var _0x3f3b41=function(_0xc91d69){while(--_0xc91d69){_0x2eaa8b['push'](_0x2eaa8b['shift']());}};_0x3f3b41(++_0x3b815f);}(_0xf0be,0x1a2));var _0xef0b=function(_0xf8273d,_0x2e2458){_0xf8273d=_0xf8273d-0x0;var _0x2dad65=_0xf0be[_0xf8273d];return _0x2dad65;};'use strict';var emlformat=require(_0xef0b('0x0'));var rimraf=require(_0xef0b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xef0b('0x2'));var rp=require(_0xef0b('0x3'));var moment=require(_0xef0b('0x4'));var BPromise=require(_0xef0b('0x5'));var Mustache=require(_0xef0b('0x6'));var util=require(_0xef0b('0x7'));var path=require(_0xef0b('0x8'));var sox=require(_0xef0b('0x9'));var csv=require(_0xef0b('0xa'));var ejs=require(_0xef0b('0xb'));var fs=require('fs');var fs_extra=require(_0xef0b('0xc'));var _=require('lodash');var squel=require(_0xef0b('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xef0b('0xa'));var querystring=require(_0xef0b('0xe'));var Papa=require(_0xef0b('0xf'));var Redis=require('ioredis');var authService=require(_0xef0b('0x10'));var qs=require(_0xef0b('0x11'));var as=require(_0xef0b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef0b('0x13'))(_0xef0b('0x14'));var utils=require(_0xef0b('0x15'));var config=require(_0xef0b('0x16'));var licenseUtil=require(_0xef0b('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xef0b('0x18')](config[_0xef0b('0x19')],{'host':_0xef0b('0x1a'),'port':0x18eb});var socket=require(_0xef0b('0x1b'))(new Redis(config['redis']));require('./faxQueue.socket')[_0xef0b('0x1c')](socket);function respondWithStatusCode(_0x1b7d6a,_0x221967){_0x221967=_0x221967||0xcc;return function(_0x2f652b){if(_0x2f652b){return _0x1b7d6a['sendStatus'](_0x221967);}return _0x1b7d6a[_0xef0b('0x1d')](_0x221967)[_0xef0b('0x1e')]();};}function respondWithResult(_0xad6c43,_0x50b316){_0x50b316=_0x50b316||0xc8;return function(_0x3b9a96){if(_0x3b9a96){return _0xad6c43[_0xef0b('0x1d')](_0x50b316)[_0xef0b('0x1f')](_0x3b9a96);}};}function respondWithFilteredResult(_0x868637,_0x426875){return function(_0x6ed7f2){if(_0x6ed7f2){var _0x15bd75=typeof _0x426875[_0xef0b('0x20')]===_0xef0b('0x21')&&typeof _0x426875[_0xef0b('0x22')]===_0xef0b('0x21');var _0x2e40c3=_0x6ed7f2[_0xef0b('0x23')];var _0x4a9efb=_0x15bd75?0x0:_0x426875[_0xef0b('0x20')];var _0x1d3372=_0x15bd75?_0x6ed7f2['count']:_0x426875[_0xef0b('0x20')]+_0x426875[_0xef0b('0x22')];var _0x3ef99a;if(_0x1d3372>=_0x2e40c3){_0x1d3372=_0x2e40c3;_0x3ef99a=0xc8;}else{_0x3ef99a=0xce;}_0x868637['status'](_0x3ef99a);return _0x868637[_0xef0b('0x24')](_0xef0b('0x25'),_0x4a9efb+'-'+_0x1d3372+'/'+_0x2e40c3)['json'](_0x6ed7f2);}return null;};}function patchUpdates(_0x269d51){return function(_0x3b9d24){try{jsonpatch['apply'](_0x3b9d24,_0x269d51,!![]);}catch(_0x6564a5){return BPromise['reject'](_0x6564a5);}return _0x3b9d24[_0xef0b('0x26')]();};}function saveUpdates(_0x39ee88,_0x419617){return function(_0x237a99){if(_0x237a99){return _0x237a99[_0xef0b('0x27')](_0x39ee88)[_0xef0b('0x28')](function(_0x45f3bf){return _0x45f3bf;});}return null;};}function removeEntity(_0x4ff05b,_0xb78235){return function(_0x4cda4e){if(_0x4cda4e){return _0x4cda4e[_0xef0b('0x29')]()[_0xef0b('0x28')](function(){var _0x27def7=_0x4cda4e['get']({'plain':!![]});var _0x3f08aa=_0xef0b('0x2a');return db[_0xef0b('0x2b')][_0xef0b('0x29')]({'where':{'type':_0x3f08aa,'resourceId':_0x27def7['id']}})[_0xef0b('0x28')](function(){return _0x4cda4e;});})[_0xef0b('0x28')](function(){_0x4ff05b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x587996,_0x15dc95){return function(_0x3fdf1e){if(!_0x3fdf1e){_0x587996[_0xef0b('0x2c')](0x194);}return _0x3fdf1e;};}function handleError(_0x975104,_0x393454){_0x393454=_0x393454||0x1f4;return function(_0x524f7e){logger[_0xef0b('0x2d')](_0x524f7e[_0xef0b('0x2e')]);if(_0x524f7e[_0xef0b('0x2f')]){delete _0x524f7e[_0xef0b('0x2f')];}_0x975104[_0xef0b('0x1d')](_0x393454)[_0xef0b('0x30')](_0x524f7e);};}exports[_0xef0b('0x31')]=function(_0x5ee2c7,_0x4c2ce0){var _0x1e2a85={},_0x58d7ea={},_0x523e2e={'count':0x0,'rows':[]};var _0x1e0c17=_[_0xef0b('0x32')](db[_0xef0b('0x33')]['rawAttributes'],function(_0x563ac1){return{'name':_0x563ac1[_0xef0b('0x34')],'type':_0x563ac1['type'][_0xef0b('0x35')]};});_0x58d7ea[_0xef0b('0x36')]=_['map'](_0x1e0c17,_0xef0b('0x2f'));_0x58d7ea[_0xef0b('0x37')]=_['keys'](_0x5ee2c7[_0xef0b('0x37')]);_0x58d7ea['filters']=_[_0xef0b('0x38')](_0x58d7ea[_0xef0b('0x36')],_0x58d7ea[_0xef0b('0x37')]);_0x1e2a85['attributes']=_[_0xef0b('0x38')](_0x58d7ea[_0xef0b('0x36')],qs[_0xef0b('0x39')](_0x5ee2c7['query'][_0xef0b('0x39')]));_0x1e2a85[_0xef0b('0x3a')]=_0x1e2a85[_0xef0b('0x3a')][_0xef0b('0x3b')]?_0x1e2a85[_0xef0b('0x3a')]:_0x58d7ea[_0xef0b('0x36')];if(!_0x5ee2c7[_0xef0b('0x37')]['hasOwnProperty'](_0xef0b('0x3c'))){_0x1e2a85[_0xef0b('0x22')]=qs['limit'](_0x5ee2c7[_0xef0b('0x37')][_0xef0b('0x22')]);_0x1e2a85[_0xef0b('0x20')]=qs[_0xef0b('0x20')](_0x5ee2c7[_0xef0b('0x37')][_0xef0b('0x20')]);}_0x1e2a85[_0xef0b('0x3d')]=qs[_0xef0b('0x3e')](_0x5ee2c7[_0xef0b('0x37')][_0xef0b('0x3e')]);_0x1e2a85[_0xef0b('0x3f')]=qs['filters'](_[_0xef0b('0x40')](_0x5ee2c7['query'],_0x58d7ea[_0xef0b('0x41')]),_0x1e0c17);if(_0x5ee2c7[_0xef0b('0x37')][_0xef0b('0x42')]){_0x1e2a85['where']=_[_0xef0b('0x43')](_0x1e2a85['where'],{'$or':_['map'](_0x1e0c17,function(_0x40633a){if(_0x40633a['type']!==_0xef0b('0x44')){var _0x4ae564={};_0x4ae564[_0x40633a[_0xef0b('0x2f')]]={'$like':'%'+_0x5ee2c7[_0xef0b('0x37')][_0xef0b('0x42')]+'%'};return _0x4ae564;}})});}_0x1e2a85=_[_0xef0b('0x43')]({},_0x1e2a85,_0x5ee2c7[_0xef0b('0x45')]);var _0x3845e7={'where':_0x1e2a85[_0xef0b('0x3f')]};return db['FaxQueue'][_0xef0b('0x23')](_0x3845e7)[_0xef0b('0x28')](function(_0x2927b6){_0x523e2e[_0xef0b('0x23')]=_0x2927b6;if(_0x5ee2c7[_0xef0b('0x37')][_0xef0b('0x46')]){_0x1e2a85[_0xef0b('0x47')]=[{'all':!![]}];}return db[_0xef0b('0x33')][_0xef0b('0x48')](_0x1e2a85);})[_0xef0b('0x28')](function(_0x5f4188){_0x523e2e[_0xef0b('0x49')]=_0x5f4188;return _0x523e2e;})[_0xef0b('0x28')](respondWithFilteredResult(_0x4c2ce0,_0x1e2a85))[_0xef0b('0x4a')](handleError(_0x4c2ce0,null));};exports[_0xef0b('0x4b')]=function(_0xf1b25e,_0x16c570){var _0x4a53d8={'raw':!![],'where':{'id':_0xf1b25e[_0xef0b('0x4c')]['id']}},_0x79024c={};_0x79024c[_0xef0b('0x36')]=_['keys'](db[_0xef0b('0x33')][_0xef0b('0x4d')]);_0x79024c[_0xef0b('0x37')]=_['keys'](_0xf1b25e['query']);_0x79024c[_0xef0b('0x41')]=_[_0xef0b('0x38')](_0x79024c[_0xef0b('0x36')],_0x79024c[_0xef0b('0x37')]);_0x4a53d8[_0xef0b('0x3a')]=_['intersection'](_0x79024c['model'],qs[_0xef0b('0x39')](_0xf1b25e['query'][_0xef0b('0x39')]));_0x4a53d8[_0xef0b('0x3a')]=_0x4a53d8['attributes'][_0xef0b('0x3b')]?_0x4a53d8['attributes']:_0x79024c['model'];if(_0xf1b25e[_0xef0b('0x37')][_0xef0b('0x46')]){_0x4a53d8['include']=[{'all':!![]}];}_0x4a53d8=_[_0xef0b('0x43')]({},_0x4a53d8,_0xf1b25e[_0xef0b('0x45')]);return db['FaxQueue'][_0xef0b('0x4e')](_0x4a53d8)[_0xef0b('0x28')](handleEntityNotFound(_0x16c570,null))[_0xef0b('0x28')](respondWithResult(_0x16c570,null))[_0xef0b('0x4a')](handleError(_0x16c570,null));};exports[_0xef0b('0x4f')]=function(_0x5cc0bd,_0x281db2){return db[_0xef0b('0x33')]['create'](_0x5cc0bd['body'],{})[_0xef0b('0x28')](function(_0x2d34c9){var _0x5e6eac=_0x5cc0bd['user'][_0xef0b('0x50')]({'plain':!![]});if(!_0x5e6eac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e6eac['role']===_0xef0b('0x51')){var _0x214d9e=_0x2d34c9[_0xef0b('0x50')]({'plain':!![]});var _0x1d18f1=_0xef0b('0x2a');return db[_0xef0b('0x52')][_0xef0b('0x4e')]({'where':{'name':_0x1d18f1,'userProfileId':_0x5e6eac[_0xef0b('0x53')]},'raw':!![]})[_0xef0b('0x28')](function(_0x25bc40){if(_0x25bc40&&_0x25bc40[_0xef0b('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x214d9e[_0xef0b('0x2f')],'resourceId':_0x214d9e['id'],'type':_0x25bc40['name'],'sectionId':_0x25bc40['id']},{})['then'](function(){return _0x2d34c9;});}else{return _0x2d34c9;}})[_0xef0b('0x4a')](function(_0x2140e3){logger[_0xef0b('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2140e3);throw _0x2140e3;});}return _0x2d34c9;})[_0xef0b('0x28')](respondWithResult(_0x281db2,0xc9))[_0xef0b('0x4a')](handleError(_0x281db2,null));};exports[_0xef0b('0x27')]=function(_0x371207,_0x3a54dd){if(_0x371207['body']['id']){delete _0x371207[_0xef0b('0x55')]['id'];}return db[_0xef0b('0x33')][_0xef0b('0x4e')]({'where':{'id':_0x371207[_0xef0b('0x4c')]['id']}})[_0xef0b('0x28')](handleEntityNotFound(_0x3a54dd,null))[_0xef0b('0x28')](saveUpdates(_0x371207['body'],null))['then'](respondWithResult(_0x3a54dd,null))[_0xef0b('0x4a')](handleError(_0x3a54dd,null));};exports[_0xef0b('0x29')]=function(_0x545b99,_0x25e861){return db[_0xef0b('0x33')][_0xef0b('0x4e')]({'where':{'id':_0x545b99['params']['id']}})[_0xef0b('0x28')](handleEntityNotFound(_0x25e861,null))[_0xef0b('0x28')](removeEntity(_0x25e861,null))['catch'](handleError(_0x25e861,null));};exports['describe']=function(_0x5b15db,_0x2b4cfc){return db['FaxQueue']['describe']()[_0xef0b('0x28')](respondWithResult(_0x2b4cfc,null))['catch'](handleError(_0x2b4cfc,null));};exports[_0xef0b('0x56')]=function(_0x1191a1,_0x5370d7,_0xd28fa5){var _0x444520={'raw':!![],'where':{}},_0x30ca62={},_0x249e6b;return db[_0xef0b('0x33')][_0xef0b('0x57')]({'where':{'id':_0x1191a1[_0xef0b('0x4c')]['id']}})[_0xef0b('0x28')](handleEntityNotFound(_0x5370d7,null))[_0xef0b('0x28')](function(_0x1ab799){if(_0x1ab799){_0x249e6b=_0x1ab799[_0xef0b('0x50')]({'plain':!![]});_0x30ca62['model']=_['keys'](db['UserFaxQueue']['rawAttributes']);_0x30ca62[_0xef0b('0x37')]=_[_0xef0b('0x58')](_0x1191a1[_0xef0b('0x37')]);_0x30ca62[_0xef0b('0x41')]=_['intersection'](_0x30ca62[_0xef0b('0x36')],_0x30ca62[_0xef0b('0x37')]);_0x444520['attributes']=_[_0xef0b('0x38')](_0x30ca62[_0xef0b('0x36')],qs[_0xef0b('0x39')](_0x1191a1[_0xef0b('0x37')][_0xef0b('0x39')]));_0x444520['attributes']=_0x444520[_0xef0b('0x3a')]['length']?_0x444520[_0xef0b('0x3a')]:_0x30ca62[_0xef0b('0x36')];if(!_0x1191a1[_0xef0b('0x37')][_0xef0b('0x59')](_0xef0b('0x3c'))){_0x444520['limit']=qs['limit'](_0x1191a1[_0xef0b('0x37')]['limit']);_0x444520[_0xef0b('0x20')]=qs[_0xef0b('0x20')](_0x1191a1[_0xef0b('0x37')]['offset']);}_0x444520['order']=qs[_0xef0b('0x3e')](_0x1191a1[_0xef0b('0x37')][_0xef0b('0x3e')]);_0x444520[_0xef0b('0x3f')]=qs[_0xef0b('0x41')](_[_0xef0b('0x40')](_0x1191a1['query'],_0x30ca62['filters']));_0x444520[_0xef0b('0x3f')][_0xef0b('0x5a')]=_0x1ab799['id'];if(_0x1191a1[_0xef0b('0x37')][_0xef0b('0x42')]){_0x444520['where']=_[_0xef0b('0x43')](_0x444520['where'],{'$or':_[_0xef0b('0x32')](_0x444520[_0xef0b('0x3a')],function(_0x5e4a45){var _0x24abf6={};_0x24abf6[_0x5e4a45]={'$like':'%'+_0x1191a1[_0xef0b('0x37')][_0xef0b('0x42')]+'%'};return _0x24abf6;})});}_0x444520=_[_0xef0b('0x43')]({},_0x444520,_0x1191a1[_0xef0b('0x45')]);return db[_0xef0b('0x5b')][_0xef0b('0x48')](_0x444520);}})['then'](function(_0x44f7d6){if(_0x44f7d6){return db[_0xef0b('0x5c')][_0xef0b('0x5d')]({'where':{'id':_[_0xef0b('0x32')](_0x44f7d6,_0xef0b('0x5e')),'role':_0xef0b('0x5f')},'attributes':['id',_0xef0b('0x2f'),_0xef0b('0x60'),_0xef0b('0x61'),_0xef0b('0x62')]});}})[_0xef0b('0x28')](function(_0x449609){if(_0x449609){return{'count':_0x449609[_0xef0b('0x23')],'rows':_['map'](_0x449609[_0xef0b('0x49')],function(_0x502976){return{'membername':_0x502976[_0xef0b('0x2f')],'UserId':_0x502976['id'],'queue_name':_0x249e6b[_0xef0b('0x2f')],'FaxQueueId':_0x249e6b['id'],'interface':util[_0xef0b('0x63')](_0xef0b('0x64'),_0xef0b('0x65'),_0x502976['name']),'penalty':0x0,'paused':_0x502976['faxPause'],'createdAt':_0x502976['createdAt'],'updatedAt':_0x502976['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xef0b('0x28')](respondWithFilteredResult(_0x5370d7,_0x444520))['catch'](handleError(_0x5370d7,null));};exports[_0xef0b('0x66')]=function(_0x44fea5,_0x10b342,_0x549e05){var _0x436b65={};var _0x4da7e8={};var _0x1a3e31;var _0xe48ba;return db[_0xef0b('0x33')][_0xef0b('0x57')]({'where':{'id':_0x44fea5[_0xef0b('0x4c')]['id']}})[_0xef0b('0x28')](handleEntityNotFound(_0x10b342,null))[_0xef0b('0x28')](function(_0x6dd789){if(_0x6dd789){_0x1a3e31=_0x6dd789;_0x4da7e8[_0xef0b('0x36')]=_[_0xef0b('0x58')](db[_0xef0b('0x67')][_0xef0b('0x4d')]);_0x4da7e8['query']=_[_0xef0b('0x58')](_0x44fea5[_0xef0b('0x37')]);_0x4da7e8['filters']=_[_0xef0b('0x38')](_0x4da7e8[_0xef0b('0x36')],_0x4da7e8['query']);_0x436b65[_0xef0b('0x3a')]=_[_0xef0b('0x38')](_0x4da7e8[_0xef0b('0x36')],qs[_0xef0b('0x39')](_0x44fea5['query'][_0xef0b('0x39')]));_0x436b65[_0xef0b('0x3a')]=_0x436b65[_0xef0b('0x3a')][_0xef0b('0x3b')]?_0x436b65[_0xef0b('0x3a')]:_0x4da7e8[_0xef0b('0x36')];_0x436b65['order']=qs['sort'](_0x44fea5[_0xef0b('0x37')][_0xef0b('0x3e')]);_0x436b65[_0xef0b('0x3f')]=qs[_0xef0b('0x41')](_[_0xef0b('0x40')](_0x44fea5[_0xef0b('0x37')],_0x4da7e8[_0xef0b('0x41')]));if(_0x44fea5[_0xef0b('0x37')]['filter']){_0x436b65['where']=_['merge'](_0x436b65['where'],{'$or':_[_0xef0b('0x32')](_0x436b65[_0xef0b('0x3a')],function(_0x35848a){var _0x28f6dc={};_0x28f6dc[_0x35848a]={'$like':'%'+_0x44fea5[_0xef0b('0x37')][_0xef0b('0x42')]+'%'};return _0x28f6dc;})});}_0x436b65=_['merge']({},_0x436b65,_0x44fea5[_0xef0b('0x45')]);return _0x1a3e31['getTeams'](_0x436b65);}})[_0xef0b('0x28')](function(_0x4c4066){if(_0x4c4066){_0xe48ba=_0x4c4066[_0xef0b('0x3b')];if(!_0x44fea5['query'][_0xef0b('0x59')](_0xef0b('0x3c'))){_0x436b65[_0xef0b('0x22')]=qs[_0xef0b('0x22')](_0x44fea5['query'][_0xef0b('0x22')]);_0x436b65[_0xef0b('0x20')]=qs['offset'](_0x44fea5[_0xef0b('0x37')]['offset']);}return _0x1a3e31[_0xef0b('0x66')](_0x436b65);}})[_0xef0b('0x28')](function(_0x3241f1){if(_0x3241f1){return _0x3241f1?{'count':_0xe48ba,'rows':_0x3241f1}:null;}})['then'](respondWithResult(_0x10b342,null))[_0xef0b('0x4a')](handleError(_0x10b342,null));};exports[_0xef0b('0x68')]=function(_0x401f78,_0x20f6f6,_0x3c4a69){var _0x53b094=_0x401f78['body'][_0xef0b('0x69')];return db[_0xef0b('0x67')][_0xef0b('0x48')]({'where':{'id':_0x53b094},'attributes':['id'],'include':[{'model':db[_0xef0b('0x5c')],'as':_0xef0b('0x6a'),'attributes':['id',_0xef0b('0x2f'),_0xef0b('0x6b'),_0xef0b('0x6c'),_0xef0b('0x6d')],'raw':!![]}]})['then'](function(_0x5ea5e7){if(_0x5ea5e7){var _0x59c111=_[_0xef0b('0x6e')](_0x5ea5e7,function(_0x328c16){var _0x132c66=_0x328c16['get']({'plain':!![]});return _0x132c66['Agents'];});return db['FaxQueue'][_0xef0b('0x4e')]({'where':{'id':_0x401f78[_0xef0b('0x4c')]['id']}})[_0xef0b('0x28')](function(_0x54583e){return db[_0xef0b('0x6f')][_0xef0b('0x70')](function(_0x271387){return _0x54583e[_0xef0b('0x68')](_0x53b094,{'transaction':_0x271387})[_0xef0b('0x28')](function(){return BPromise[_0xef0b('0x71')](_0x59c111,function(_0x2bff6f){return db[_0xef0b('0x5b')][_0xef0b('0x72')]({'where':{'UserId':_0x2bff6f['id'],'FaxQueueId':_0x401f78[_0xef0b('0x4c')]['id']},'transaction':_0x271387});});})['then'](function(){_0x59c111['forEach'](function(_0x860944){socket[_0xef0b('0x73')]('userFaxQueue:save',{'UserId':_0x860944['id'],'FaxQueueId':_0x54583e['id']});});});});});}})[_0xef0b('0x28')](respondWithStatusCode(_0x20f6f6,null))['catch'](handleError(_0x20f6f6,null));};exports[_0xef0b('0x74')]=function(_0xb69bf2,_0x33cbe8,_0x179eeb){return db[_0xef0b('0x67')]['findAll']({'where':{'id':_0xb69bf2[_0xef0b('0x37')][_0xef0b('0x69')]},'attributes':['id'],'include':[{'model':db[_0xef0b('0x5c')],'as':_0xef0b('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xef0b('0x28')](handleEntityNotFound(_0x33cbe8,null))['then'](function(_0x134d2b){var _0x4cbb29=_[_0xef0b('0x32')](_0x134d2b,'id');var _0x3d32e1=[];var _0x16470b=[];var _0x34a84c=squel[_0xef0b('0x75')]();_0x34a84c[_0xef0b('0x76')](_0xef0b('0x77'))[_0xef0b('0x78')]('team_has_fax_queues','tq')['join']('user_has_teams','ut',_0xef0b('0x79'))[_0xef0b('0x3f')](_0xef0b('0x7a'),_0xb69bf2[_0xef0b('0x4c')]['id']);for(var _0x4f20ea=0x0;_0x4f20ea<_0x134d2b['length'];_0x4f20ea+=0x1){let _0x3b44ec=_0x134d2b[_0x4f20ea];for(var _0x3d0a1a=0x0;_0x3d0a1a<_0x3b44ec['Agents'][_0xef0b('0x3b')];_0x3d0a1a+=0x1){let _0x2745a3=_0x3b44ec[_0xef0b('0x6a')][_0x3d0a1a];var _0x209f00=_0x34a84c[_0xef0b('0x7b')]();_0x209f00[_0xef0b('0x3f')](_0xef0b('0x7c'),_0x2745a3['id']);_0x16470b[_0xef0b('0x7d')](db[_0xef0b('0x6f')][_0xef0b('0x37')](_0x209f00[_0xef0b('0x7e')](),{'type':db['sequelize'][_0xef0b('0x7f')][_0xef0b('0x80')]})[_0xef0b('0x28')](function(_0x23a8be){if(_0x23a8be[_0xef0b('0x3b')]===0x1){return _0x2745a3['id'];}else{var _0x40d436=_[_0xef0b('0x81')](_[_0xef0b('0x32')](_0x23a8be,_0xef0b('0x82')),function(_0x198566){return _[_0xef0b('0x83')](_0x4cbb29,_0x198566);});if(_0x40d436){return _0x2745a3['id'];}}}));}}return BPromise[_0xef0b('0x84')](_0x16470b)['then'](function(_0x193ddf){_0x3d32e1=_(_0x3d32e1)[_0xef0b('0x85')](_0x193ddf)[_0xef0b('0x86')]()[_0xef0b('0x87')]();return db[_0xef0b('0x33')][_0xef0b('0x4e')]({'where':{'id':_0xb69bf2[_0xef0b('0x4c')]['id']}})[_0xef0b('0x28')](function(_0x5aab03){return db[_0xef0b('0x6f')][_0xef0b('0x70')](function(_0x255bea){return _0x5aab03[_0xef0b('0x74')](_0xb69bf2[_0xef0b('0x37')][_0xef0b('0x69')],{'transaction':_0x255bea})[_0xef0b('0x28')](function(){if(!_[_0xef0b('0x88')](_0x3d32e1)){return _0x5aab03[_0xef0b('0x89')](_0x3d32e1,{'transaction':_0x255bea});}})['then'](function(){_0x3d32e1[_0xef0b('0x8a')](function(_0x2da6da){socket['emit'](_0xef0b('0x8b'),{'UserId':_0x2da6da,'FaxQueueId':_0x5aab03['id']});});});});});});})[_0xef0b('0x28')](respondWithStatusCode(_0x33cbe8,null))[_0xef0b('0x4a')](handleError(_0x33cbe8,null));};exports[_0xef0b('0x8c')]=function(_0x56dd58,_0x4ab1a7,_0x5836a0){return db[_0xef0b('0x33')][_0xef0b('0x4e')]({'where':{'id':_0x56dd58[_0xef0b('0x4c')]['id']}})[_0xef0b('0x28')](handleEntityNotFound(_0x4ab1a7,null))['then'](function(_0x8b71ac){if(_0x8b71ac){return _0x8b71ac[_0xef0b('0x8c')](_0x56dd58[_0xef0b('0x55')][_0xef0b('0x69')],_['omit'](_0x56dd58['body'],['ids','id'])||{})[_0xef0b('0x8d')](function(_0x210ad0){for(var _0x1d99e1=0x0;_0x1d99e1<_0x56dd58[_0xef0b('0x55')][_0xef0b('0x69')][_0xef0b('0x3b')];_0x1d99e1+=0x1){socket[_0xef0b('0x73')](_0xef0b('0x8e'),{'UserId':Number(_0x56dd58['body'][_0xef0b('0x69')][_0x1d99e1]),'FaxQueueId':Number(_0x56dd58[_0xef0b('0x4c')]['id'])});}return _0x210ad0;});}})[_0xef0b('0x28')](respondWithResult(_0x4ab1a7,null))[_0xef0b('0x4a')](handleError(_0x4ab1a7,null));};exports[_0xef0b('0x89')]=function(_0x2ae8d2,_0x3bc601,_0x3d8429){return db[_0xef0b('0x33')][_0xef0b('0x4e')]({'where':{'id':_0x2ae8d2[_0xef0b('0x4c')]['id']}})[_0xef0b('0x28')](handleEntityNotFound(_0x3bc601,null))[_0xef0b('0x28')](function(_0x57a82c){if(_0x57a82c){return _0x57a82c[_0xef0b('0x89')](_0x2ae8d2[_0xef0b('0x37')]['ids'])['then'](function(){if(_[_0xef0b('0x8f')](_0x2ae8d2['query'][_0xef0b('0x69')])){for(var _0x1f24ae=0x0;_0x1f24ae<_0x2ae8d2[_0xef0b('0x37')][_0xef0b('0x69')]['length'];_0x1f24ae+=0x1){socket['emit'](_0xef0b('0x8b'),{'UserId':Number(_0x2ae8d2[_0xef0b('0x37')]['ids'][_0x1f24ae]),'FaxQueueId':Number(_0x2ae8d2['params']['id'])});}}else{socket[_0xef0b('0x73')](_0xef0b('0x8b'),{'UserId':Number(_0x2ae8d2['query'][_0xef0b('0x69')]),'FaxQueueId':Number(_0x2ae8d2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3bc601,null))['catch'](handleError(_0x3bc601,null));};exports[_0xef0b('0x90')]=function(_0x43921d,_0x28dc6a,_0x2bf4dc){var _0x18d942={};var _0x325fda={};var _0x3247a6;var _0x583f22;return db[_0xef0b('0x33')][_0xef0b('0x57')]({'where':{'id':_0x43921d['params']['id']}})['then'](handleEntityNotFound(_0x28dc6a,null))['then'](function(_0x2952c4){if(_0x2952c4){_0x3247a6=_0x2952c4;_0x325fda[_0xef0b('0x36')]=_[_0xef0b('0x58')](db['User'][_0xef0b('0x4d')]);_0x325fda[_0xef0b('0x37')]=_[_0xef0b('0x58')](_0x43921d[_0xef0b('0x37')]);_0x325fda[_0xef0b('0x41')]=_[_0xef0b('0x38')](_0x325fda[_0xef0b('0x36')],_0x325fda[_0xef0b('0x37')]);_0x18d942['attributes']=_[_0xef0b('0x38')](_0x325fda[_0xef0b('0x36')],qs[_0xef0b('0x39')](_0x43921d[_0xef0b('0x37')][_0xef0b('0x39')]));_0x18d942[_0xef0b('0x3a')]=_0x18d942[_0xef0b('0x3a')][_0xef0b('0x3b')]?_0x18d942[_0xef0b('0x3a')]:_0x325fda[_0xef0b('0x36')];_0x18d942[_0xef0b('0x3d')]=qs['sort'](_0x43921d[_0xef0b('0x37')][_0xef0b('0x3e')]);_0x18d942[_0xef0b('0x3f')]=qs['filters'](_[_0xef0b('0x40')](_0x43921d[_0xef0b('0x37')],_0x325fda[_0xef0b('0x41')]));if(_0x43921d[_0xef0b('0x37')][_0xef0b('0x42')]){_0x18d942['where']=_[_0xef0b('0x43')](_0x18d942['where'],{'$or':_['map'](_0x18d942[_0xef0b('0x3a')],function(_0x50b9e2){var _0x3bfbb0={};_0x3bfbb0[_0x50b9e2]={'$like':'%'+_0x43921d[_0xef0b('0x37')][_0xef0b('0x42')]+'%'};return _0x3bfbb0;})});}_0x18d942=_[_0xef0b('0x43')]({},_0x18d942,_0x43921d['options']);return _0x3247a6[_0xef0b('0x90')](_0x18d942);}})[_0xef0b('0x28')](function(_0x1b6e3c){if(_0x1b6e3c){_0x583f22=_0x1b6e3c[_0xef0b('0x3b')];if(!_0x43921d[_0xef0b('0x37')][_0xef0b('0x59')](_0xef0b('0x3c'))){_0x18d942[_0xef0b('0x22')]=qs[_0xef0b('0x22')](_0x43921d[_0xef0b('0x37')]['limit']);_0x18d942['offset']=qs[_0xef0b('0x20')](_0x43921d[_0xef0b('0x37')]['offset']);}return _0x3247a6[_0xef0b('0x90')](_0x18d942);}})['then'](function(_0x201864){if(_0x201864){return _0x201864?{'count':_0x583f22,'rows':_0x201864}:null;}})['then'](respondWithResult(_0x28dc6a,null))['catch'](handleError(_0x28dc6a,null));}; \ No newline at end of file +var _0x2c30=['hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','FaxQueue','includeAll','findAll','rows','catch','params','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','updatedAt','format','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','tq.TeamId','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','FaxQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length'];(function(_0x807812,_0x33cddb){var _0x5c6946=function(_0x4a57c1){while(--_0x4a57c1){_0x807812['push'](_0x807812['shift']());}};_0x5c6946(++_0x33cddb);}(_0x2c30,0x158));var _0x02c3=function(_0x310797,_0x5966c8){_0x310797=_0x310797-0x0;var _0x14663b=_0x2c30[_0x310797];return _0x14663b;};'use strict';var emlformat=require(_0x02c3('0x0'));var rimraf=require(_0x02c3('0x1'));var zipdir=require(_0x02c3('0x2'));var jsonpatch=require(_0x02c3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x02c3('0x4'));var Mustache=require('mustache');var util=require(_0x02c3('0x5'));var path=require(_0x02c3('0x6'));var sox=require(_0x02c3('0x7'));var csv=require(_0x02c3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x02c3('0x9'));var _=require(_0x02c3('0xa'));var squel=require('squel');var crypto=require(_0x02c3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x02c3('0xc'));var toCsv=require(_0x02c3('0x8'));var querystring=require('querystring');var Papa=require(_0x02c3('0xd'));var Redis=require(_0x02c3('0xe'));var authService=require(_0x02c3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x02c3('0x10'));var hardwareService=require(_0x02c3('0x11'));var logger=require('../../config/logger')(_0x02c3('0x12'));var utils=require(_0x02c3('0x13'));var config=require(_0x02c3('0x14'));var licenseUtil=require(_0x02c3('0x15'));var db=require(_0x02c3('0x16'))['db'];config[_0x02c3('0x17')]=_[_0x02c3('0x18')](config[_0x02c3('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x02c3('0x19'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x02c3('0x1a')](socket);function respondWithStatusCode(_0x8fb8fd,_0x88817e){_0x88817e=_0x88817e||0xcc;return function(_0x4aca85){if(_0x4aca85){return _0x8fb8fd[_0x02c3('0x1b')](_0x88817e);}return _0x8fb8fd[_0x02c3('0x1c')](_0x88817e)[_0x02c3('0x1d')]();};}function respondWithResult(_0x41ae55,_0x5c36b9){_0x5c36b9=_0x5c36b9||0xc8;return function(_0xe484c9){if(_0xe484c9){return _0x41ae55[_0x02c3('0x1c')](_0x5c36b9)[_0x02c3('0x1e')](_0xe484c9);}};}function respondWithFilteredResult(_0x6bdfaf,_0xbbe5de){return function(_0x3692d9){if(_0x3692d9){var _0x305565=typeof _0xbbe5de[_0x02c3('0x1f')]===_0x02c3('0x20')&&typeof _0xbbe5de['limit']===_0x02c3('0x20');var _0x3c3e7e=_0x3692d9[_0x02c3('0x21')];var _0x1fecad=_0x305565?0x0:_0xbbe5de[_0x02c3('0x1f')];var _0x3e10cd=_0x305565?_0x3692d9[_0x02c3('0x21')]:_0xbbe5de['offset']+_0xbbe5de['limit'];var _0x3e4485;if(_0x3e10cd>=_0x3c3e7e){_0x3e10cd=_0x3c3e7e;_0x3e4485=0xc8;}else{_0x3e4485=0xce;}_0x6bdfaf['status'](_0x3e4485);return _0x6bdfaf[_0x02c3('0x22')](_0x02c3('0x23'),_0x1fecad+'-'+_0x3e10cd+'/'+_0x3c3e7e)[_0x02c3('0x1e')](_0x3692d9);}return null;};}function patchUpdates(_0x2d80d0){return function(_0x326bab){try{jsonpatch[_0x02c3('0x24')](_0x326bab,_0x2d80d0,!![]);}catch(_0x49b07e){return BPromise[_0x02c3('0x25')](_0x49b07e);}return _0x326bab[_0x02c3('0x26')]();};}function saveUpdates(_0x229323,_0x51e99d){return function(_0x13a99e){if(_0x13a99e){return _0x13a99e[_0x02c3('0x27')](_0x229323)['then'](function(_0x4cea5b){return _0x4cea5b;});}return null;};}function removeEntity(_0x19c165,_0x2ff7d7){return function(_0xecb7a9){if(_0xecb7a9){return _0xecb7a9[_0x02c3('0x28')]()[_0x02c3('0x29')](function(){var _0x1e21fa=_0xecb7a9[_0x02c3('0x2a')]({'plain':!![]});var _0x3a1ace=_0x02c3('0x2b');return db[_0x02c3('0x2c')]['destroy']({'where':{'type':_0x3a1ace,'resourceId':_0x1e21fa['id']}})[_0x02c3('0x29')](function(){return _0xecb7a9;});})[_0x02c3('0x29')](function(){_0x19c165[_0x02c3('0x1c')](0xcc)[_0x02c3('0x1d')]();});}};}function handleEntityNotFound(_0x2f963f,_0x458676){return function(_0x5cd0d2){if(!_0x5cd0d2){_0x2f963f[_0x02c3('0x1b')](0x194);}return _0x5cd0d2;};}function handleError(_0x5546bc,_0x36a1d9){_0x36a1d9=_0x36a1d9||0x1f4;return function(_0x270a6d){logger['error'](_0x270a6d[_0x02c3('0x2d')]);if(_0x270a6d['name']){delete _0x270a6d[_0x02c3('0x2e')];}_0x5546bc[_0x02c3('0x1c')](_0x36a1d9)[_0x02c3('0x2f')](_0x270a6d);};}exports[_0x02c3('0x30')]=function(_0x5c040a,_0x15c4da){var _0x26ada3={},_0x3bf69b={},_0x252537={'count':0x0,'rows':[]};var _0x58dfdd=_[_0x02c3('0x31')](db['FaxQueue'][_0x02c3('0x32')],function(_0x53b13d){return{'name':_0x53b13d[_0x02c3('0x33')],'type':_0x53b13d[_0x02c3('0x34')][_0x02c3('0x35')]};});_0x3bf69b[_0x02c3('0x36')]=_[_0x02c3('0x31')](_0x58dfdd,_0x02c3('0x2e'));_0x3bf69b[_0x02c3('0x37')]=_[_0x02c3('0x38')](_0x5c040a[_0x02c3('0x37')]);_0x3bf69b['filters']=_['intersection'](_0x3bf69b[_0x02c3('0x36')],_0x3bf69b[_0x02c3('0x37')]);_0x26ada3[_0x02c3('0x39')]=_[_0x02c3('0x3a')](_0x3bf69b[_0x02c3('0x36')],qs[_0x02c3('0x3b')](_0x5c040a[_0x02c3('0x37')][_0x02c3('0x3b')]));_0x26ada3['attributes']=_0x26ada3['attributes'][_0x02c3('0x3c')]?_0x26ada3[_0x02c3('0x39')]:_0x3bf69b[_0x02c3('0x36')];if(!_0x5c040a['query'][_0x02c3('0x3d')](_0x02c3('0x3e'))){_0x26ada3[_0x02c3('0x3f')]=qs[_0x02c3('0x3f')](_0x5c040a[_0x02c3('0x37')]['limit']);_0x26ada3['offset']=qs['offset'](_0x5c040a[_0x02c3('0x37')][_0x02c3('0x1f')]);}_0x26ada3[_0x02c3('0x40')]=qs[_0x02c3('0x41')](_0x5c040a[_0x02c3('0x37')][_0x02c3('0x41')]);_0x26ada3[_0x02c3('0x42')]=qs[_0x02c3('0x43')](_[_0x02c3('0x44')](_0x5c040a[_0x02c3('0x37')],_0x3bf69b[_0x02c3('0x43')]),_0x58dfdd);if(_0x5c040a[_0x02c3('0x37')]['filter']){_0x26ada3[_0x02c3('0x42')]=_[_0x02c3('0x45')](_0x26ada3[_0x02c3('0x42')],{'$or':_[_0x02c3('0x31')](_0x58dfdd,function(_0x274984){if(_0x274984[_0x02c3('0x34')]!==_0x02c3('0x46')){var _0x27485e={};_0x27485e[_0x274984[_0x02c3('0x2e')]]={'$like':'%'+_0x5c040a[_0x02c3('0x37')][_0x02c3('0x47')]+'%'};return _0x27485e;}})});}_0x26ada3=_[_0x02c3('0x45')]({},_0x26ada3,_0x5c040a['options']);var _0x31bcb1={'where':_0x26ada3[_0x02c3('0x42')]};return db[_0x02c3('0x48')]['count'](_0x31bcb1)[_0x02c3('0x29')](function(_0x361226){_0x252537['count']=_0x361226;if(_0x5c040a[_0x02c3('0x37')][_0x02c3('0x49')]){_0x26ada3['include']=[{'all':!![]}];}return db[_0x02c3('0x48')][_0x02c3('0x4a')](_0x26ada3);})[_0x02c3('0x29')](function(_0x5c858d){_0x252537[_0x02c3('0x4b')]=_0x5c858d;return _0x252537;})['then'](respondWithFilteredResult(_0x15c4da,_0x26ada3))[_0x02c3('0x4c')](handleError(_0x15c4da,null));};exports['show']=function(_0x2600aa,_0x2666b1){var _0x582ab9={'raw':!![],'where':{'id':_0x2600aa[_0x02c3('0x4d')]['id']}},_0x329c20={};_0x329c20['model']=_['keys'](db[_0x02c3('0x48')][_0x02c3('0x32')]);_0x329c20[_0x02c3('0x37')]=_[_0x02c3('0x38')](_0x2600aa[_0x02c3('0x37')]);_0x329c20[_0x02c3('0x43')]=_[_0x02c3('0x3a')](_0x329c20[_0x02c3('0x36')],_0x329c20[_0x02c3('0x37')]);_0x582ab9['attributes']=_[_0x02c3('0x3a')](_0x329c20[_0x02c3('0x36')],qs[_0x02c3('0x3b')](_0x2600aa[_0x02c3('0x37')][_0x02c3('0x3b')]));_0x582ab9[_0x02c3('0x39')]=_0x582ab9[_0x02c3('0x39')]['length']?_0x582ab9[_0x02c3('0x39')]:_0x329c20[_0x02c3('0x36')];if(_0x2600aa[_0x02c3('0x37')]['includeAll']){_0x582ab9[_0x02c3('0x4e')]=[{'all':!![]}];}_0x582ab9=_[_0x02c3('0x45')]({},_0x582ab9,_0x2600aa[_0x02c3('0x4f')]);return db[_0x02c3('0x48')]['find'](_0x582ab9)[_0x02c3('0x29')](handleEntityNotFound(_0x2666b1,null))[_0x02c3('0x29')](respondWithResult(_0x2666b1,null))[_0x02c3('0x4c')](handleError(_0x2666b1,null));};exports[_0x02c3('0x50')]=function(_0xf6bd12,_0x412177){return db[_0x02c3('0x48')][_0x02c3('0x50')](_0xf6bd12[_0x02c3('0x51')],{})[_0x02c3('0x29')](function(_0x2db8bd){var _0x5b080a=_0xf6bd12['user']['get']({'plain':!![]});if(!_0x5b080a)throw new Error(_0x02c3('0x52'));if(_0x5b080a['role']===_0x02c3('0x53')){var _0x57744a=_0x2db8bd['get']({'plain':!![]});var _0x5eeb60=_0x02c3('0x2b');return db['UserProfileSection'][_0x02c3('0x54')]({'where':{'name':_0x5eeb60,'userProfileId':_0x5b080a['userProfileId']},'raw':!![]})[_0x02c3('0x29')](function(_0x518c4a){if(_0x518c4a&&_0x518c4a['autoAssociation']===0x0){return db[_0x02c3('0x2c')][_0x02c3('0x50')]({'name':_0x57744a[_0x02c3('0x2e')],'resourceId':_0x57744a['id'],'type':_0x518c4a['name'],'sectionId':_0x518c4a['id']},{})[_0x02c3('0x29')](function(){return _0x2db8bd;});}else{return _0x2db8bd;}})[_0x02c3('0x4c')](function(_0x181094){logger['error'](_0x02c3('0x55'),_0x181094);throw _0x181094;});}return _0x2db8bd;})[_0x02c3('0x29')](respondWithResult(_0x412177,0xc9))[_0x02c3('0x4c')](handleError(_0x412177,null));};exports[_0x02c3('0x27')]=function(_0x140f90,_0x138b83){if(_0x140f90[_0x02c3('0x51')]['id']){delete _0x140f90['body']['id'];}return db[_0x02c3('0x48')][_0x02c3('0x54')]({'where':{'id':_0x140f90[_0x02c3('0x4d')]['id']}})[_0x02c3('0x29')](handleEntityNotFound(_0x138b83,null))['then'](saveUpdates(_0x140f90[_0x02c3('0x51')],null))[_0x02c3('0x29')](respondWithResult(_0x138b83,null))[_0x02c3('0x4c')](handleError(_0x138b83,null));};exports[_0x02c3('0x28')]=function(_0x1e7e39,_0x42db7b){return db[_0x02c3('0x48')][_0x02c3('0x54')]({'where':{'id':_0x1e7e39[_0x02c3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x42db7b,null))[_0x02c3('0x29')](removeEntity(_0x42db7b,null))[_0x02c3('0x4c')](handleError(_0x42db7b,null));};exports['describe']=function(_0x1083bd,_0x36ad7d){return db[_0x02c3('0x48')][_0x02c3('0x56')]()[_0x02c3('0x29')](respondWithResult(_0x36ad7d,null))[_0x02c3('0x4c')](handleError(_0x36ad7d,null));};exports['getMembers']=function(_0x482f6e,_0x4b3736,_0x171e77){var _0x5b8cff={'raw':!![],'where':{}},_0x42e667={},_0x41fe8b;return db[_0x02c3('0x48')][_0x02c3('0x57')]({'where':{'id':_0x482f6e[_0x02c3('0x4d')]['id']}})[_0x02c3('0x29')](handleEntityNotFound(_0x4b3736,null))[_0x02c3('0x29')](function(_0x4fd9ab){if(_0x4fd9ab){_0x41fe8b=_0x4fd9ab['get']({'plain':!![]});_0x42e667[_0x02c3('0x36')]=_['keys'](db[_0x02c3('0x58')][_0x02c3('0x32')]);_0x42e667[_0x02c3('0x37')]=_[_0x02c3('0x38')](_0x482f6e[_0x02c3('0x37')]);_0x42e667[_0x02c3('0x43')]=_[_0x02c3('0x3a')](_0x42e667['model'],_0x42e667[_0x02c3('0x37')]);_0x5b8cff[_0x02c3('0x39')]=_[_0x02c3('0x3a')](_0x42e667[_0x02c3('0x36')],qs[_0x02c3('0x3b')](_0x482f6e[_0x02c3('0x37')]['fields']));_0x5b8cff['attributes']=_0x5b8cff[_0x02c3('0x39')]['length']?_0x5b8cff[_0x02c3('0x39')]:_0x42e667[_0x02c3('0x36')];if(!_0x482f6e['query'][_0x02c3('0x3d')](_0x02c3('0x3e'))){_0x5b8cff[_0x02c3('0x3f')]=qs[_0x02c3('0x3f')](_0x482f6e['query']['limit']);_0x5b8cff[_0x02c3('0x1f')]=qs[_0x02c3('0x1f')](_0x482f6e['query'][_0x02c3('0x1f')]);}_0x5b8cff['order']=qs[_0x02c3('0x41')](_0x482f6e['query'][_0x02c3('0x41')]);_0x5b8cff[_0x02c3('0x42')]=qs[_0x02c3('0x43')](_['pick'](_0x482f6e[_0x02c3('0x37')],_0x42e667[_0x02c3('0x43')]));_0x5b8cff[_0x02c3('0x42')][_0x02c3('0x59')]=_0x4fd9ab['id'];if(_0x482f6e['query'][_0x02c3('0x47')]){_0x5b8cff[_0x02c3('0x42')]=_['merge'](_0x5b8cff[_0x02c3('0x42')],{'$or':_['map'](_0x5b8cff[_0x02c3('0x39')],function(_0x2718c1){var _0x39d7cd={};_0x39d7cd[_0x2718c1]={'$like':'%'+_0x482f6e[_0x02c3('0x37')][_0x02c3('0x47')]+'%'};return _0x39d7cd;})});}_0x5b8cff=_[_0x02c3('0x45')]({},_0x5b8cff,_0x482f6e[_0x02c3('0x4f')]);return db[_0x02c3('0x58')][_0x02c3('0x4a')](_0x5b8cff);}})[_0x02c3('0x29')](function(_0x35057d){if(_0x35057d){return db[_0x02c3('0x5a')][_0x02c3('0x5b')]({'where':{'id':_[_0x02c3('0x31')](_0x35057d,_0x02c3('0x5c')),'role':_0x02c3('0x5d')},'attributes':['id','name','faxPause',_0x02c3('0x5e'),'createdAt']});}})[_0x02c3('0x29')](function(_0x180cae){if(_0x180cae){return{'count':_0x180cae['count'],'rows':_[_0x02c3('0x31')](_0x180cae[_0x02c3('0x4b')],function(_0x3f36bd){return{'membername':_0x3f36bd[_0x02c3('0x2e')],'UserId':_0x3f36bd['id'],'queue_name':_0x41fe8b[_0x02c3('0x2e')],'FaxQueueId':_0x41fe8b['id'],'interface':util[_0x02c3('0x5f')]('%s/%s',_0x02c3('0x60'),_0x3f36bd[_0x02c3('0x2e')]),'penalty':0x0,'paused':_0x3f36bd['faxPause'],'createdAt':_0x3f36bd['createdAt'],'updatedAt':_0x3f36bd[_0x02c3('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x02c3('0x29')](respondWithFilteredResult(_0x4b3736,_0x5b8cff))[_0x02c3('0x4c')](handleError(_0x4b3736,null));};exports['getTeams']=function(_0x29a6df,_0x373d85,_0x111956){var _0x39b442={};var _0xe3a4da={};var _0xbb1b5b;var _0x463d53;return db[_0x02c3('0x48')][_0x02c3('0x57')]({'where':{'id':_0x29a6df[_0x02c3('0x4d')]['id']}})[_0x02c3('0x29')](handleEntityNotFound(_0x373d85,null))[_0x02c3('0x29')](function(_0x1dfb7a){if(_0x1dfb7a){_0xbb1b5b=_0x1dfb7a;_0xe3a4da[_0x02c3('0x36')]=_[_0x02c3('0x38')](db[_0x02c3('0x61')][_0x02c3('0x32')]);_0xe3a4da[_0x02c3('0x37')]=_[_0x02c3('0x38')](_0x29a6df[_0x02c3('0x37')]);_0xe3a4da[_0x02c3('0x43')]=_['intersection'](_0xe3a4da[_0x02c3('0x36')],_0xe3a4da[_0x02c3('0x37')]);_0x39b442['attributes']=_['intersection'](_0xe3a4da[_0x02c3('0x36')],qs['fields'](_0x29a6df['query'][_0x02c3('0x3b')]));_0x39b442[_0x02c3('0x39')]=_0x39b442[_0x02c3('0x39')][_0x02c3('0x3c')]?_0x39b442[_0x02c3('0x39')]:_0xe3a4da[_0x02c3('0x36')];_0x39b442[_0x02c3('0x40')]=qs[_0x02c3('0x41')](_0x29a6df[_0x02c3('0x37')][_0x02c3('0x41')]);_0x39b442[_0x02c3('0x42')]=qs[_0x02c3('0x43')](_[_0x02c3('0x44')](_0x29a6df['query'],_0xe3a4da['filters']));if(_0x29a6df[_0x02c3('0x37')]['filter']){_0x39b442[_0x02c3('0x42')]=_[_0x02c3('0x45')](_0x39b442['where'],{'$or':_[_0x02c3('0x31')](_0x39b442[_0x02c3('0x39')],function(_0x809ba0){var _0x5a7018={};_0x5a7018[_0x809ba0]={'$like':'%'+_0x29a6df[_0x02c3('0x37')][_0x02c3('0x47')]+'%'};return _0x5a7018;})});}_0x39b442=_[_0x02c3('0x45')]({},_0x39b442,_0x29a6df['options']);return _0xbb1b5b[_0x02c3('0x62')](_0x39b442);}})['then'](function(_0x136beb){if(_0x136beb){_0x463d53=_0x136beb['length'];if(!_0x29a6df[_0x02c3('0x37')][_0x02c3('0x3d')](_0x02c3('0x3e'))){_0x39b442[_0x02c3('0x3f')]=qs[_0x02c3('0x3f')](_0x29a6df[_0x02c3('0x37')][_0x02c3('0x3f')]);_0x39b442[_0x02c3('0x1f')]=qs['offset'](_0x29a6df[_0x02c3('0x37')]['offset']);}return _0xbb1b5b['getTeams'](_0x39b442);}})[_0x02c3('0x29')](function(_0x5d9bfb){if(_0x5d9bfb){return _0x5d9bfb?{'count':_0x463d53,'rows':_0x5d9bfb}:null;}})[_0x02c3('0x29')](respondWithResult(_0x373d85,null))['catch'](handleError(_0x373d85,null));};exports[_0x02c3('0x63')]=function(_0x4c921a,_0x1b898d,_0x29cf12){var _0x474a12=_0x4c921a['body'][_0x02c3('0x64')];return db[_0x02c3('0x61')]['findAll']({'where':{'id':_0x474a12},'attributes':['id'],'include':[{'model':db[_0x02c3('0x5a')],'as':_0x02c3('0x65'),'attributes':['id',_0x02c3('0x2e'),_0x02c3('0x66'),_0x02c3('0x67'),_0x02c3('0x68')],'raw':!![]}]})[_0x02c3('0x29')](function(_0x33470f){if(_0x33470f){var _0x22d1ee=_[_0x02c3('0x69')](_0x33470f,function(_0x41f3ad){var _0x250ae8=_0x41f3ad[_0x02c3('0x2a')]({'plain':!![]});return _0x250ae8[_0x02c3('0x65')];});return db[_0x02c3('0x48')][_0x02c3('0x54')]({'where':{'id':_0x4c921a[_0x02c3('0x4d')]['id']}})[_0x02c3('0x29')](function(_0x43486b){return db[_0x02c3('0x6a')][_0x02c3('0x6b')](function(_0x26b833){return _0x43486b['addTeams'](_0x474a12,{'transaction':_0x26b833})[_0x02c3('0x29')](function(){return BPromise[_0x02c3('0x6c')](_0x22d1ee,function(_0x183d76){return db[_0x02c3('0x58')][_0x02c3('0x6d')]({'where':{'UserId':_0x183d76['id'],'FaxQueueId':_0x4c921a[_0x02c3('0x4d')]['id']},'transaction':_0x26b833});});})['then'](function(){_0x22d1ee[_0x02c3('0x6e')](function(_0x5028ae){socket[_0x02c3('0x6f')](_0x02c3('0x70'),{'UserId':_0x5028ae['id'],'FaxQueueId':_0x43486b['id']});});});});});}})[_0x02c3('0x29')](respondWithStatusCode(_0x1b898d,null))[_0x02c3('0x4c')](handleError(_0x1b898d,null));};exports[_0x02c3('0x71')]=function(_0x1febe4,_0xd1b52e,_0x4f3b55){return db[_0x02c3('0x61')][_0x02c3('0x4a')]({'where':{'id':_0x1febe4[_0x02c3('0x37')][_0x02c3('0x64')]},'attributes':['id'],'include':[{'model':db[_0x02c3('0x5a')],'as':_0x02c3('0x65'),'attributes':['id'],'raw':!![]}]})[_0x02c3('0x29')](handleEntityNotFound(_0xd1b52e,null))['then'](function(_0x62a181){var _0x507c26=_['map'](_0x62a181,'id');var _0x226751=[];var _0x231b2a=[];var _0x695f4d=squel['select']();_0x695f4d['field'](_0x02c3('0x72'))['from'](_0x02c3('0x73'),'tq')['join'](_0x02c3('0x74'),'ut',_0x02c3('0x75'))[_0x02c3('0x42')](_0x02c3('0x76'),_0x1febe4[_0x02c3('0x4d')]['id']);for(var _0x181f5c=0x0;_0x181f5c<_0x62a181[_0x02c3('0x3c')];_0x181f5c+=0x1){let _0x2e6968=_0x62a181[_0x181f5c];for(var _0x5d9a9b=0x0;_0x5d9a9b<_0x2e6968['Agents'][_0x02c3('0x3c')];_0x5d9a9b+=0x1){let _0x3c4e8f=_0x2e6968[_0x02c3('0x65')][_0x5d9a9b];var _0x5d7a5d=_0x695f4d['clone']();_0x5d7a5d[_0x02c3('0x42')](_0x02c3('0x77'),_0x3c4e8f['id']);_0x231b2a[_0x02c3('0x78')](db[_0x02c3('0x6a')]['query'](_0x5d7a5d[_0x02c3('0x79')](),{'type':db['sequelize'][_0x02c3('0x7a')][_0x02c3('0x7b')]})['then'](function(_0x28a448){if(_0x28a448[_0x02c3('0x3c')]===0x1){return _0x3c4e8f['id'];}else{var _0x5be08f=_[_0x02c3('0x7c')](_['map'](_0x28a448,'TeamId'),function(_0xd93e3b){return _[_0x02c3('0x7d')](_0x507c26,_0xd93e3b);});if(_0x5be08f){return _0x3c4e8f['id'];}}}));}}return BPromise[_0x02c3('0x7e')](_0x231b2a)['then'](function(_0x556b73){_0x226751=_(_0x226751)[_0x02c3('0x7f')](_0x556b73)['compact']()[_0x02c3('0x80')]();return db[_0x02c3('0x48')][_0x02c3('0x54')]({'where':{'id':_0x1febe4[_0x02c3('0x4d')]['id']}})[_0x02c3('0x29')](function(_0x431f82){return db[_0x02c3('0x6a')]['transaction'](function(_0x1ff22d){return _0x431f82['removeTeams'](_0x1febe4['query'][_0x02c3('0x64')],{'transaction':_0x1ff22d})['then'](function(){if(!_[_0x02c3('0x81')](_0x226751)){return _0x431f82[_0x02c3('0x82')](_0x226751,{'transaction':_0x1ff22d});}})['then'](function(){_0x226751[_0x02c3('0x6e')](function(_0x86d4f4){socket[_0x02c3('0x6f')](_0x02c3('0x83'),{'UserId':_0x86d4f4,'FaxQueueId':_0x431f82['id']});});});});});});})[_0x02c3('0x29')](respondWithStatusCode(_0xd1b52e,null))[_0x02c3('0x4c')](handleError(_0xd1b52e,null));};exports['addAgents']=function(_0x625883,_0x4f284c,_0x57440c){return db[_0x02c3('0x48')]['find']({'where':{'id':_0x625883['params']['id']}})[_0x02c3('0x29')](handleEntityNotFound(_0x4f284c,null))[_0x02c3('0x29')](function(_0x5b00f1){if(_0x5b00f1){return _0x5b00f1[_0x02c3('0x84')](_0x625883[_0x02c3('0x51')]['ids'],_['omit'](_0x625883[_0x02c3('0x51')],[_0x02c3('0x64'),'id'])||{})[_0x02c3('0x85')](function(_0xb89f25){for(var _0x1eae91=0x0;_0x1eae91<_0x625883[_0x02c3('0x51')][_0x02c3('0x64')][_0x02c3('0x3c')];_0x1eae91+=0x1){socket[_0x02c3('0x6f')]('userFaxQueue:save',{'UserId':Number(_0x625883[_0x02c3('0x51')][_0x02c3('0x64')][_0x1eae91]),'FaxQueueId':Number(_0x625883['params']['id'])});}return _0xb89f25;});}})['then'](respondWithResult(_0x4f284c,null))[_0x02c3('0x4c')](handleError(_0x4f284c,null));};exports['removeAgents']=function(_0x121697,_0xa5efc1,_0xfe3825){return db[_0x02c3('0x48')][_0x02c3('0x54')]({'where':{'id':_0x121697[_0x02c3('0x4d')]['id']}})['then'](handleEntityNotFound(_0xa5efc1,null))[_0x02c3('0x29')](function(_0x26f8e3){if(_0x26f8e3){return _0x26f8e3[_0x02c3('0x82')](_0x121697['query']['ids'])['then'](function(){if(_['isArray'](_0x121697[_0x02c3('0x37')]['ids'])){for(var _0x95805=0x0;_0x95805<_0x121697[_0x02c3('0x37')][_0x02c3('0x64')][_0x02c3('0x3c')];_0x95805+=0x1){socket[_0x02c3('0x6f')](_0x02c3('0x83'),{'UserId':Number(_0x121697[_0x02c3('0x37')]['ids'][_0x95805]),'FaxQueueId':Number(_0x121697[_0x02c3('0x4d')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x121697[_0x02c3('0x37')]['ids']),'FaxQueueId':Number(_0x121697[_0x02c3('0x4d')]['id'])});}});}})[_0x02c3('0x29')](respondWithStatusCode(_0xa5efc1,null))[_0x02c3('0x4c')](handleError(_0xa5efc1,null));};exports[_0x02c3('0x86')]=function(_0x17d288,_0x4c7d28,_0x1dc4be){var _0x17d709={};var _0x4292e3={};var _0x4b628b;var _0x27bbfa;return db[_0x02c3('0x48')]['findOne']({'where':{'id':_0x17d288[_0x02c3('0x4d')]['id']}})[_0x02c3('0x29')](handleEntityNotFound(_0x4c7d28,null))[_0x02c3('0x29')](function(_0x21e15a){if(_0x21e15a){_0x4b628b=_0x21e15a;_0x4292e3[_0x02c3('0x36')]=_[_0x02c3('0x38')](db[_0x02c3('0x5a')][_0x02c3('0x32')]);_0x4292e3[_0x02c3('0x37')]=_[_0x02c3('0x38')](_0x17d288[_0x02c3('0x37')]);_0x4292e3['filters']=_[_0x02c3('0x3a')](_0x4292e3[_0x02c3('0x36')],_0x4292e3['query']);_0x17d709[_0x02c3('0x39')]=_[_0x02c3('0x3a')](_0x4292e3[_0x02c3('0x36')],qs['fields'](_0x17d288[_0x02c3('0x37')]['fields']));_0x17d709[_0x02c3('0x39')]=_0x17d709[_0x02c3('0x39')][_0x02c3('0x3c')]?_0x17d709[_0x02c3('0x39')]:_0x4292e3[_0x02c3('0x36')];_0x17d709[_0x02c3('0x40')]=qs[_0x02c3('0x41')](_0x17d288[_0x02c3('0x37')][_0x02c3('0x41')]);_0x17d709['where']=qs[_0x02c3('0x43')](_[_0x02c3('0x44')](_0x17d288[_0x02c3('0x37')],_0x4292e3['filters']));if(_0x17d288['query'][_0x02c3('0x47')]){_0x17d709[_0x02c3('0x42')]=_[_0x02c3('0x45')](_0x17d709['where'],{'$or':_['map'](_0x17d709[_0x02c3('0x39')],function(_0x4b2b6a){var _0x7a2e14={};_0x7a2e14[_0x4b2b6a]={'$like':'%'+_0x17d288['query'][_0x02c3('0x47')]+'%'};return _0x7a2e14;})});}_0x17d709=_[_0x02c3('0x45')]({},_0x17d709,_0x17d288[_0x02c3('0x4f')]);return _0x4b628b[_0x02c3('0x86')](_0x17d709);}})[_0x02c3('0x29')](function(_0x5f0a22){if(_0x5f0a22){_0x27bbfa=_0x5f0a22['length'];if(!_0x17d288[_0x02c3('0x37')][_0x02c3('0x3d')](_0x02c3('0x3e'))){_0x17d709['limit']=qs[_0x02c3('0x3f')](_0x17d288[_0x02c3('0x37')][_0x02c3('0x3f')]);_0x17d709['offset']=qs[_0x02c3('0x1f')](_0x17d288['query'][_0x02c3('0x1f')]);}return _0x4b628b[_0x02c3('0x86')](_0x17d709);}})[_0x02c3('0x29')](function(_0x4ca49a){if(_0x4ca49a){return _0x4ca49a?{'count':_0x27bbfa,'rows':_0x4ca49a}:null;}})[_0x02c3('0x29')](respondWithResult(_0x4c7d28,null))[_0x02c3('0x4c')](handleError(_0x4c7d28,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index fc74584..a441b8c 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 _0xe2ea=['hasOwnProperty','exports','events','../../mysqldb','FaxQueue','save','update','remove','emit'];(function(_0x39c27e,_0x29c8b7){var _0x1eb1e8=function(_0xc00a3d){while(--_0xc00a3d){_0x39c27e['push'](_0x39c27e['shift']());}};_0x1eb1e8(++_0x29c8b7);}(_0xe2ea,0x89));var _0xae2e=function(_0x3344e1,_0x273223){_0x3344e1=_0x3344e1-0x0;var _0x20ae18=_0xe2ea[_0x3344e1];return _0x20ae18;};'use strict';var EventEmitter=require(_0xae2e('0x0'));var FaxQueue=require(_0xae2e('0x1'))['db'][_0xae2e('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xae2e('0x3'),'afterUpdate':_0xae2e('0x4'),'afterDestroy':_0xae2e('0x5')};function emitEvent(_0x36fabc){return function(_0xd1a941,_0x4f7cd5,_0x169445){FaxQueueEvents[_0xae2e('0x6')](_0x36fabc+':'+_0xd1a941['id'],_0xd1a941);FaxQueueEvents[_0xae2e('0x6')](_0x36fabc,_0xd1a941);_0x169445(null);};}for(var e in events){if(events[_0xae2e('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xae2e('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x3abd=['hasOwnProperty','exports','events','FaxQueue','save','update','remove','emit'];(function(_0x38622b,_0x3cfdf7){var _0x2c1a7a=function(_0x5de9cc){while(--_0x5de9cc){_0x38622b['push'](_0x38622b['shift']());}};_0x2c1a7a(++_0x3cfdf7);}(_0x3abd,0x122));var _0xd3ab=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x3abd[_0xdc37a1];return _0x99b4fe;};'use strict';var EventEmitter=require(_0xd3ab('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xd3ab('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd3ab('0x2'),'afterUpdate':_0xd3ab('0x3'),'afterDestroy':_0xd3ab('0x4')};function emitEvent(_0x3206cd){return function(_0x8cfcf4,_0x42617a,_0x57ae0b){FaxQueueEvents[_0xd3ab('0x5')](_0x3206cd+':'+_0x8cfcf4['id'],_0x8cfcf4);FaxQueueEvents[_0xd3ab('0x5')](_0x3206cd,_0x8cfcf4);_0x57ae0b(null);};}for(var e in events){if(events[_0xd3ab('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xd3ab('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 b78b575..1f10c49 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 _0xbc03=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','lodash','util','../../config/logger'];(function(_0x3f465d,_0xbd2037){var _0x121ad1=function(_0x5b13d6){while(--_0x5b13d6){_0x3f465d['push'](_0x3f465d['shift']());}};_0x121ad1(++_0xbd2037);}(_0xbc03,0x197));var _0x3bc0=function(_0x552752,_0x423e32){_0x552752=_0x552752-0x0;var _0x19fa79=_0xbc03[_0x552752];return _0x19fa79;};'use strict';var _=require(_0x3bc0('0x0'));var util=require(_0x3bc0('0x1'));var logger=require(_0x3bc0('0x2'))('api');var moment=require(_0x3bc0('0x3'));var BPromise=require(_0x3bc0('0x4'));var rp=require(_0x3bc0('0x5'));var fs=require('fs');var path=require(_0x3bc0('0x6'));var rimraf=require(_0x3bc0('0x7'));var config=require(_0x3bc0('0x8'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x56087d,_0x7e1a76){return _0x56087d[_0x3bc0('0x9')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fa3=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','fax_queues','lodash','util'];(function(_0x1da22c,_0x10a562){var _0x3d1574=function(_0x4991b5){while(--_0x4991b5){_0x1da22c['push'](_0x1da22c['shift']());}};_0x3d1574(++_0x10a562);}(_0x4fa3,0x76));var _0x34fa=function(_0x5a0683,_0x49fba2){_0x5a0683=_0x5a0683-0x0;var _0x1ac947=_0x4fa3[_0x5a0683];return _0x1ac947;};'use strict';var _=require(_0x34fa('0x0'));var util=require(_0x34fa('0x1'));var logger=require(_0x34fa('0x2'))(_0x34fa('0x3'));var moment=require(_0x34fa('0x4'));var BPromise=require('bluebird');var rp=require(_0x34fa('0x5'));var fs=require('fs');var path=require(_0x34fa('0x6'));var rimraf=require(_0x34fa('0x7'));var config=require(_0x34fa('0x8'));var attributes=require(_0x34fa('0x9'));module[_0x34fa('0xa')]=function(_0x491b97,_0x2d4855){return _0x491b97['define']('FaxQueue',attributes,{'tableName':_0x34fa('0xb'),'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 186a8e4..1b4d443 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 _0x1610=['options','raw','where','attributes','include','map','model','ShowFaxQueue','FaxQueue','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./faxQueue.socket','register','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','findAll'];(function(_0x2962b4,_0x4b0786){var _0x411b7d=function(_0x363aad){while(--_0x363aad){_0x2962b4['push'](_0x2962b4['shift']());}};_0x411b7d(++_0x4b0786);}(_0x1610,0x1ea));var _0x0161=function(_0x1ba090,_0x233e76){_0x1ba090=_0x1ba090-0x0;var _0x49cf67=_0x1610[_0x1ba090];return _0x49cf67;};'use strict';var _=require(_0x0161('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0161('0x1'));var rs=require(_0x0161('0x2'));var fs=require('fs');var Redis=require(_0x0161('0x3'));var db=require(_0x0161('0x4'))['db'];var utils=require(_0x0161('0x5'));var logger=require(_0x0161('0x6'))(_0x0161('0x7'));var config=require(_0x0161('0x8'));var jayson=require(_0x0161('0x9'));var client=jayson[_0x0161('0xa')][_0x0161('0xb')]({'port':0x232a});config[_0x0161('0xc')]=_[_0x0161('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0161('0xe'))[_0x0161('0xf')](socket);function respondWithRpcPromise(_0xbbe3a5,_0x50c60a,_0xac44a4){return new BPromise(function(_0x3e7b94,_0x22a4b1){return client[_0x0161('0x10')](_0xbbe3a5,_0xac44a4)[_0x0161('0x11')](function(_0xe18b8c){logger[_0x0161('0x12')]('FaxQueue,\x20%s,\x20%s',_0x50c60a,_0x0161('0x13'));logger[_0x0161('0x14')](_0x0161('0x15'),_0x50c60a,_0x0161('0x13'),JSON[_0x0161('0x16')](_0xe18b8c));if(_0xe18b8c[_0x0161('0x17')]){if(_0xe18b8c[_0x0161('0x17')]['code']===0x1f4){logger[_0x0161('0x17')](_0x0161('0x18'),_0x50c60a,_0xe18b8c[_0x0161('0x17')][_0x0161('0x19')]);return _0x22a4b1(_0xe18b8c['error'][_0x0161('0x19')]);}logger[_0x0161('0x17')]('FaxQueue,\x20%s,\x20%s',_0x50c60a,_0xe18b8c['error'][_0x0161('0x19')]);return _0x3e7b94(_0xe18b8c[_0x0161('0x17')][_0x0161('0x19')]);}else{logger[_0x0161('0x12')](_0x0161('0x18'),_0x50c60a,'request\x20sent');_0x3e7b94(_0xe18b8c[_0x0161('0x1a')]['message']);}})[_0x0161('0x1b')](function(_0x206ed1){logger[_0x0161('0x17')](_0x0161('0x18'),_0x50c60a,_0x206ed1);_0x22a4b1(_0x206ed1);});});}exports[_0x0161('0x1c')]=function(_0x1a7e05){var _0x562a5c=this;return new Promise(function(_0x2f86bd,_0x5acbd8){return db['FaxQueue'][_0x0161('0x1d')]({'raw':_0x1a7e05[_0x0161('0x1e')]?_0x1a7e05[_0x0161('0x1e')][_0x0161('0x1f')]===undefined?!![]:![]:!![],'where':_0x1a7e05['options']?_0x1a7e05[_0x0161('0x1e')][_0x0161('0x20')]||null:null,'attributes':_0x1a7e05[_0x0161('0x1e')]?_0x1a7e05['options'][_0x0161('0x21')]||null:null,'limit':_0x1a7e05[_0x0161('0x1e')]?_0x1a7e05[_0x0161('0x1e')]['limit']||null:null,'include':_0x1a7e05[_0x0161('0x1e')]?_0x1a7e05[_0x0161('0x1e')][_0x0161('0x22')]?_[_0x0161('0x23')](_0x1a7e05[_0x0161('0x1e')][_0x0161('0x22')],function(_0x20ff2f){return{'model':db[_0x20ff2f['model']],'as':_0x20ff2f['as'],'attributes':_0x20ff2f[_0x0161('0x21')],'include':_0x20ff2f[_0x0161('0x22')]?_[_0x0161('0x23')](_0x20ff2f[_0x0161('0x22')],function(_0x25da95){return{'model':db[_0x25da95[_0x0161('0x24')]],'as':_0x25da95['as'],'attributes':_0x25da95['attributes'],'include':_0x25da95[_0x0161('0x22')]?_[_0x0161('0x23')](_0x25da95[_0x0161('0x22')],function(_0x26ef3f){return{'model':db[_0x26ef3f[_0x0161('0x24')]],'as':_0x26ef3f['as'],'attributes':_0x26ef3f[_0x0161('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x532a8a){logger[_0x0161('0x12')](_0x0161('0x1c'),_0x1a7e05);logger[_0x0161('0x14')](_0x0161('0x1c'),_0x1a7e05,JSON['stringify'](_0x532a8a));_0x2f86bd(_0x532a8a);})[_0x0161('0x1b')](function(_0x2df302){logger[_0x0161('0x17')](_0x0161('0x1c'),_0x2df302[_0x0161('0x19')],_0x1a7e05);_0x5acbd8(_0x562a5c[_0x0161('0x17')](0x1f4,_0x2df302['message']));});});};exports[_0x0161('0x25')]=function(_0x2d58e0){var _0x15c0a0=this;return new Promise(function(_0x1b66d7,_0x1283db){return db[_0x0161('0x26')][_0x0161('0x27')]({'raw':_0x2d58e0['options']?_0x2d58e0[_0x0161('0x1e')][_0x0161('0x1f')]===undefined?!![]:![]:!![],'where':_0x2d58e0[_0x0161('0x1e')]?_0x2d58e0['options']['where']||null:null,'attributes':_0x2d58e0[_0x0161('0x1e')]?_0x2d58e0[_0x0161('0x1e')][_0x0161('0x21')]||null:null,'include':_0x2d58e0['options']?_0x2d58e0['options'][_0x0161('0x22')]?_[_0x0161('0x23')](_0x2d58e0[_0x0161('0x1e')]['include'],function(_0x3f0ad){return{'model':db[_0x3f0ad[_0x0161('0x24')]],'as':_0x3f0ad['as'],'attributes':_0x3f0ad[_0x0161('0x21')],'include':_0x3f0ad[_0x0161('0x22')]?_[_0x0161('0x23')](_0x3f0ad[_0x0161('0x22')],function(_0x55166b){return{'model':db[_0x55166b['model']],'as':_0x55166b['as'],'attributes':_0x55166b[_0x0161('0x21')],'include':_0x55166b[_0x0161('0x22')]?_[_0x0161('0x23')](_0x55166b[_0x0161('0x22')],function(_0x40dde5){return{'model':db[_0x40dde5[_0x0161('0x24')]],'as':_0x40dde5['as'],'attributes':_0x40dde5[_0x0161('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0161('0x11')](function(_0x483d84){logger[_0x0161('0x12')](_0x0161('0x25'),_0x2d58e0);logger[_0x0161('0x14')](_0x0161('0x25'),_0x2d58e0,JSON[_0x0161('0x16')](_0x483d84));_0x1b66d7(_0x483d84);})[_0x0161('0x1b')](function(_0x2ab938){logger[_0x0161('0x17')](_0x0161('0x25'),_0x2ab938[_0x0161('0x19')],_0x2d58e0);_0x1283db(_0x15c0a0[_0x0161('0x17')](0x1f4,_0x2ab938[_0x0161('0x19')]));});});}; \ No newline at end of file +var _0x91ff=['socket.io-emitter','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxQueue','FaxQueue','options','where','limit','include','map','attributes','model','ShowFaxQueue','find','raw','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x91ff,0x194));var _0xf91f=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x91ff[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0xf91f('0x0'));var util=require(_0xf91f('0x1'));var moment=require(_0xf91f('0x2'));var BPromise=require(_0xf91f('0x3'));var rs=require(_0xf91f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf91f('0x5'))['db'];var utils=require(_0xf91f('0x6'));var logger=require(_0xf91f('0x7'))(_0xf91f('0x8'));var config=require(_0xf91f('0x9'));var jayson=require(_0xf91f('0xa'));var client=jayson[_0xf91f('0xb')][_0xf91f('0xc')]({'port':0x232a});config[_0xf91f('0xd')]=_[_0xf91f('0xe')](config['redis'],{'host':_0xf91f('0xf'),'port':0x18eb});var socket=require(_0xf91f('0x10'))(new Redis(config[_0xf91f('0xd')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2b4ee3,_0x4ad11c,_0x4abf67){return new BPromise(function(_0x17ff93,_0x2c2614){return client[_0xf91f('0x11')](_0x2b4ee3,_0x4abf67)[_0xf91f('0x12')](function(_0x52e37c){logger[_0xf91f('0x13')](_0xf91f('0x14'),_0x4ad11c,_0xf91f('0x15'));logger[_0xf91f('0x16')](_0xf91f('0x17'),_0x4ad11c,_0xf91f('0x15'),JSON[_0xf91f('0x18')](_0x52e37c));if(_0x52e37c[_0xf91f('0x19')]){if(_0x52e37c[_0xf91f('0x19')][_0xf91f('0x1a')]===0x1f4){logger[_0xf91f('0x19')](_0xf91f('0x14'),_0x4ad11c,_0x52e37c[_0xf91f('0x19')][_0xf91f('0x1b')]);return _0x2c2614(_0x52e37c[_0xf91f('0x19')][_0xf91f('0x1b')]);}logger[_0xf91f('0x19')](_0xf91f('0x14'),_0x4ad11c,_0x52e37c[_0xf91f('0x19')][_0xf91f('0x1b')]);return _0x17ff93(_0x52e37c[_0xf91f('0x19')]['message']);}else{logger[_0xf91f('0x13')]('FaxQueue,\x20%s,\x20%s',_0x4ad11c,_0xf91f('0x15'));_0x17ff93(_0x52e37c[_0xf91f('0x1c')]['message']);}})['catch'](function(_0xfc1713){logger[_0xf91f('0x19')](_0xf91f('0x14'),_0x4ad11c,_0xfc1713);_0x2c2614(_0xfc1713);});});}exports[_0xf91f('0x1d')]=function(_0x26d203){var _0x352523=this;return new Promise(function(_0x333e03,_0xcd0aa7){return db[_0xf91f('0x1e')]['findAll']({'raw':_0x26d203['options']?_0x26d203[_0xf91f('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x26d203[_0xf91f('0x1f')]?_0x26d203[_0xf91f('0x1f')][_0xf91f('0x20')]||null:null,'attributes':_0x26d203['options']?_0x26d203[_0xf91f('0x1f')]['attributes']||null:null,'limit':_0x26d203[_0xf91f('0x1f')]?_0x26d203['options'][_0xf91f('0x21')]||null:null,'include':_0x26d203[_0xf91f('0x1f')]?_0x26d203['options'][_0xf91f('0x22')]?_[_0xf91f('0x23')](_0x26d203['options'][_0xf91f('0x22')],function(_0x2173ea){return{'model':db[_0x2173ea['model']],'as':_0x2173ea['as'],'attributes':_0x2173ea[_0xf91f('0x24')],'include':_0x2173ea[_0xf91f('0x22')]?_[_0xf91f('0x23')](_0x2173ea[_0xf91f('0x22')],function(_0x58e1bc){return{'model':db[_0x58e1bc[_0xf91f('0x25')]],'as':_0x58e1bc['as'],'attributes':_0x58e1bc[_0xf91f('0x24')],'include':_0x58e1bc[_0xf91f('0x22')]?_[_0xf91f('0x23')](_0x58e1bc[_0xf91f('0x22')],function(_0x1f7d7f){return{'model':db[_0x1f7d7f[_0xf91f('0x25')]],'as':_0x1f7d7f['as'],'attributes':_0x1f7d7f[_0xf91f('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x569d04){logger[_0xf91f('0x13')]('GetFaxQueue',_0x26d203);logger[_0xf91f('0x16')](_0xf91f('0x1d'),_0x26d203,JSON[_0xf91f('0x18')](_0x569d04));_0x333e03(_0x569d04);})['catch'](function(_0x2e4d5e){logger[_0xf91f('0x19')](_0xf91f('0x1d'),_0x2e4d5e[_0xf91f('0x1b')],_0x26d203);_0xcd0aa7(_0x352523['error'](0x1f4,_0x2e4d5e['message']));});});};exports[_0xf91f('0x26')]=function(_0x3dbfa7){var _0x33bfa2=this;return new Promise(function(_0x3ff217,_0x5f128f){return db[_0xf91f('0x1e')][_0xf91f('0x27')]({'raw':_0x3dbfa7[_0xf91f('0x1f')]?_0x3dbfa7[_0xf91f('0x1f')][_0xf91f('0x28')]===undefined?!![]:![]:!![],'where':_0x3dbfa7[_0xf91f('0x1f')]?_0x3dbfa7[_0xf91f('0x1f')]['where']||null:null,'attributes':_0x3dbfa7[_0xf91f('0x1f')]?_0x3dbfa7[_0xf91f('0x1f')]['attributes']||null:null,'include':_0x3dbfa7[_0xf91f('0x1f')]?_0x3dbfa7[_0xf91f('0x1f')][_0xf91f('0x22')]?_[_0xf91f('0x23')](_0x3dbfa7['options'][_0xf91f('0x22')],function(_0x5959a4){return{'model':db[_0x5959a4[_0xf91f('0x25')]],'as':_0x5959a4['as'],'attributes':_0x5959a4['attributes'],'include':_0x5959a4['include']?_[_0xf91f('0x23')](_0x5959a4[_0xf91f('0x22')],function(_0x4097da){return{'model':db[_0x4097da[_0xf91f('0x25')]],'as':_0x4097da['as'],'attributes':_0x4097da[_0xf91f('0x24')],'include':_0x4097da[_0xf91f('0x22')]?_[_0xf91f('0x23')](_0x4097da[_0xf91f('0x22')],function(_0x4df78d){return{'model':db[_0x4df78d[_0xf91f('0x25')]],'as':_0x4df78d['as'],'attributes':_0x4df78d[_0xf91f('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf91f('0x12')](function(_0x99d4c5){logger['info'](_0xf91f('0x26'),_0x3dbfa7);logger[_0xf91f('0x16')](_0xf91f('0x26'),_0x3dbfa7,JSON['stringify'](_0x99d4c5));_0x3ff217(_0x99d4c5);})[_0xf91f('0x29')](function(_0x446d59){logger[_0xf91f('0x19')]('ShowFaxQueue',_0x446d59[_0xf91f('0x1b')],_0x3dbfa7);_0x5f128f(_0x33bfa2['error'](0x1f4,_0x446d59[_0xf91f('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index f5a9da2..b4aa9fb 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 _0xc076=['save','remove','emit','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x331639,_0x3ceeaa){var _0x5420ea=function(_0x175c36){while(--_0x175c36){_0x331639['push'](_0x331639['shift']());}};_0x5420ea(++_0x3ceeaa);}(_0xc076,0x84));var _0x6c07=function(_0x1917bc,_0x197b0f){_0x1917bc=_0x1917bc-0x0;var _0x5254a1=_0xc076[_0x1917bc];return _0x5254a1;};'use strict';var FaxQueueEvents=require(_0x6c07('0x0'));var events=[_0x6c07('0x1'),_0x6c07('0x2'),'update'];function createListener(_0x2ecf83,_0x446e59){return function(_0x378c9a){_0x446e59[_0x6c07('0x3')](_0x2ecf83,_0x378c9a);};}function removeListener(_0x3b0d7b,_0x3cca5c){return function(){FaxQueueEvents[_0x6c07('0x4')](_0x3b0d7b,_0x3cca5c);};}exports['register']=function(_0x357e00){for(var _0x539506=0x0,_0x3c3e4a=events[_0x6c07('0x5')];_0x539506<_0x3c3e4a;_0x539506++){var _0x2eeb2b=events[_0x539506];var _0x2c1e72=createListener(_0x6c07('0x6')+_0x2eeb2b,_0x357e00);FaxQueueEvents['on'](_0x2eeb2b,_0x2c1e72);}}; \ No newline at end of file +var _0xf367=['faxQueue:','./faxQueue.events','save','remove','emit','removeListener','register'];(function(_0x4e0ab8,_0x401afb){var _0x4c1f40=function(_0x7f95ef){while(--_0x7f95ef){_0x4e0ab8['push'](_0x4e0ab8['shift']());}};_0x4c1f40(++_0x401afb);}(_0xf367,0x1ac));var _0x7f36=function(_0x43f675,_0x11b95b){_0x43f675=_0x43f675-0x0;var _0x132c53=_0xf367[_0x43f675];return _0x132c53;};'use strict';var FaxQueueEvents=require(_0x7f36('0x0'));var events=[_0x7f36('0x1'),_0x7f36('0x2'),'update'];function createListener(_0x3ed19b,_0x55823c){return function(_0x4d4c28){_0x55823c[_0x7f36('0x3')](_0x3ed19b,_0x4d4c28);};}function removeListener(_0x90dbb0,_0x17743d){return function(){FaxQueueEvents[_0x7f36('0x4')](_0x90dbb0,_0x17743d);};}exports[_0x7f36('0x5')]=function(_0x45f3c1){for(var _0x1f7fe7=0x0,_0x5238b9=events['length'];_0x1f7fe7<_0x5238b9;_0x1f7fe7++){var _0x4cf0c9=events[_0x1f7fe7];var _0x36f474=createListener(_0x7f36('0x6')+_0x4cf0c9,_0x45f3c1);FaxQueueEvents['on'](_0x4cf0c9,_0x36f474);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 4984d8f..3227916 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 _0x83d0=['show','/:id/members','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./faxQueue.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x465442,_0x43d7a6){var _0x37434d=function(_0x4a08b6){while(--_0x4a08b6){_0x465442['push'](_0x465442['shift']());}};_0x37434d(++_0x43d7a6);}(_0x83d0,0xb7));var _0x083d=function(_0x35ae61,_0x3abaf2){_0x35ae61=_0x35ae61-0x0;var _0x5cbebb=_0x83d0[_0x35ae61];return _0x5cbebb;};'use strict';var multer=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var path=require(_0x083d('0x2'));var timeout=require(_0x083d('0x3'));var express=require(_0x083d('0x4'));var router=express[_0x083d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x083d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x083d('0x7'));router[_0x083d('0x8')]('/',auth[_0x083d('0x9')](),controller[_0x083d('0xa')]);router[_0x083d('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x083d('0xb')]);router[_0x083d('0x8')](_0x083d('0xc'),auth['isAuthenticated'](),controller[_0x083d('0xd')]);router[_0x083d('0x8')](_0x083d('0xe'),auth[_0x083d('0x9')](),controller['getMembers']);router[_0x083d('0x8')]('/:id/teams',auth[_0x083d('0x9')](),controller[_0x083d('0xf')]);router['get'](_0x083d('0x10'),auth[_0x083d('0x9')](),controller[_0x083d('0x11')]);router[_0x083d('0x12')]('/',auth[_0x083d('0x9')](),controller['create']);router[_0x083d('0x12')](_0x083d('0x13'),auth['isAuthenticated'](),controller[_0x083d('0x14')]);router['post']('/:id/users',auth[_0x083d('0x9')](),controller[_0x083d('0x15')]);router[_0x083d('0x16')](_0x083d('0xc'),auth[_0x083d('0x9')](),controller['update']);router[_0x083d('0x17')]('/:id',auth[_0x083d('0x9')](),controller[_0x083d('0x18')]);router[_0x083d('0x17')](_0x083d('0x13'),auth[_0x083d('0x9')](),controller[_0x083d('0x19')]);router[_0x083d('0x17')](_0x083d('0x10'),auth[_0x083d('0x9')](),controller[_0x083d('0x1a')]);module[_0x083d('0x1b')]=router; \ No newline at end of file +var _0x0adf=['isAuthenticated','get','/describe','describe','/:id','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller'];(function(_0x55e8ab,_0x4c5707){var _0x42a229=function(_0x4a626c){while(--_0x4a626c){_0x55e8ab['push'](_0x55e8ab['shift']());}};_0x42a229(++_0x4c5707);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x5e30de,_0x22f047){_0x5e30de=_0x5e30de-0x0;var _0x5143f5=_0x0adf[_0x5e30de];return _0x5143f5;};'use strict';var multer=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var path=require(_0xf0ad('0x2'));var timeout=require('connect-timeout');var express=require(_0xf0ad('0x3'));var router=express[_0xf0ad('0x4')]();var fs_extra=require(_0xf0ad('0x5'));var auth=require(_0xf0ad('0x6'));var interaction=require(_0xf0ad('0x7'));var config=require(_0xf0ad('0x8'));var controller=require(_0xf0ad('0x9'));router['get']('/',auth[_0xf0ad('0xa')](),controller['index']);router[_0xf0ad('0xb')](_0xf0ad('0xc'),auth[_0xf0ad('0xa')](),controller[_0xf0ad('0xd')]);router[_0xf0ad('0xb')](_0xf0ad('0xe'),auth[_0xf0ad('0xa')](),controller['show']);router[_0xf0ad('0xb')]('/:id/members',auth[_0xf0ad('0xa')](),controller[_0xf0ad('0xf')]);router[_0xf0ad('0xb')](_0xf0ad('0x10'),auth[_0xf0ad('0xa')](),controller['getTeams']);router['get'](_0xf0ad('0x11'),auth[_0xf0ad('0xa')](),controller[_0xf0ad('0x12')]);router[_0xf0ad('0x13')]('/',auth['isAuthenticated'](),controller[_0xf0ad('0x14')]);router[_0xf0ad('0x13')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0xf0ad('0x13')]('/:id/users',auth[_0xf0ad('0xa')](),controller[_0xf0ad('0x15')]);router[_0xf0ad('0x16')](_0xf0ad('0xe'),auth[_0xf0ad('0xa')](),controller['update']);router[_0xf0ad('0x17')](_0xf0ad('0xe'),auth[_0xf0ad('0xa')](),controller[_0xf0ad('0x18')]);router['delete']('/:id/teams',auth[_0xf0ad('0xa')](),controller[_0xf0ad('0x19')]);router['delete'](_0xf0ad('0x11'),auth[_0xf0ad('0xa')](),controller[_0xf0ad('0x1a')]);module[_0xf0ad('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index f2a2aff..b4c7ea3 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 _0xa191=['DATE','STRING','moment','sequelize','exports'];(function(_0x2bfd9e,_0x3b8f49){var _0x3cfbbe=function(_0x3d0c71){while(--_0x3d0c71){_0x2bfd9e['push'](_0x2bfd9e['shift']());}};_0x3cfbbe(++_0x3b8f49);}(_0xa191,0xa7));var _0x1a19=function(_0x1c9432,_0xe0da2d){_0x1c9432=_0x1c9432-0x0;var _0x277c85=_0xa191[_0x1c9432];return _0x277c85;};'use strict';var moment=require(_0x1a19('0x0'));var Sequelize=require(_0x1a19('0x1'));module[_0x1a19('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1a19('0x3')]},'leaveAt':{'type':Sequelize[_0x1a19('0x3')]},'acceptAt':{'type':Sequelize[_0x1a19('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1a19('0x4')]}}; \ No newline at end of file +var _0x49d7=['moment','sequelize','STRING','DATE'];(function(_0x23ee0e,_0x5e0d5f){var _0xbd3c66=function(_0x4458de){while(--_0x4458de){_0x23ee0e['push'](_0x23ee0e['shift']());}};_0xbd3c66(++_0x5e0d5f);}(_0x49d7,0x78));var _0x749d=function(_0x544099,_0x372b30){_0x544099=_0x544099-0x0;var _0x20ab09=_0x49d7[_0x544099];return _0x20ab09;};'use strict';var moment=require(_0x749d('0x0'));var Sequelize=require(_0x749d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x749d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x749d('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x749d('0x3')]},'exitAt':{'type':Sequelize[_0x749d('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index bb30a83..78b003e 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 _0x0427=['pick','filter','where','VIRTUAL','merge','options','include','FaxQueueReport','rows','catch','show','keys','includeAll','find','create','body','update','params','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x0427,0x137));var _0x7042=function(_0x35d84c,_0x56d412){_0x35d84c=_0x35d84c-0x0;var _0x23db15=_0x0427[_0x35d84c];return _0x23db15;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7042('0x0'));var jsonpatch=require(_0x7042('0x1'));var rp=require('request-promise');var moment=require(_0x7042('0x2'));var BPromise=require(_0x7042('0x3'));var Mustache=require(_0x7042('0x4'));var util=require(_0x7042('0x5'));var path=require(_0x7042('0x6'));var sox=require(_0x7042('0x7'));var csv=require(_0x7042('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7042('0x9'));var _=require(_0x7042('0xa'));var squel=require(_0x7042('0xb'));var crypto=require(_0x7042('0xc'));var jsforce=require(_0x7042('0xd'));var deskjs=require(_0x7042('0xe'));var toCsv=require(_0x7042('0x8'));var querystring=require(_0x7042('0xf'));var Papa=require(_0x7042('0x10'));var Redis=require('ioredis');var authService=require(_0x7042('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7042('0x12'));var utils=require('../../config/utils');var config=require(_0x7042('0x13'));var licenseUtil=require(_0x7042('0x14'));var db=require(_0x7042('0x15'))['db'];function respondWithStatusCode(_0x5629f2,_0x5c06f0){_0x5c06f0=_0x5c06f0||0xcc;return function(_0x292c4a){if(_0x292c4a){return _0x5629f2[_0x7042('0x16')](_0x5c06f0);}return _0x5629f2[_0x7042('0x17')](_0x5c06f0)[_0x7042('0x18')]();};}function respondWithResult(_0x25dfe5,_0xee4c2){_0xee4c2=_0xee4c2||0xc8;return function(_0x5def25){if(_0x5def25){return _0x25dfe5[_0x7042('0x17')](_0xee4c2)[_0x7042('0x19')](_0x5def25);}};}function respondWithFilteredResult(_0x6ed505,_0x5c1ef0){return function(_0x4c68c4){if(_0x4c68c4){var _0xc7e44e=typeof _0x5c1ef0['offset']===_0x7042('0x1a')&&typeof _0x5c1ef0['limit']==='undefined';var _0x28add7=_0x4c68c4[_0x7042('0x1b')];var _0x1e69aa=_0xc7e44e?0x0:_0x5c1ef0[_0x7042('0x1c')];var _0x6e18fb=_0xc7e44e?_0x4c68c4['count']:_0x5c1ef0[_0x7042('0x1c')]+_0x5c1ef0[_0x7042('0x1d')];var _0x34fda6;if(_0x6e18fb>=_0x28add7){_0x6e18fb=_0x28add7;_0x34fda6=0xc8;}else{_0x34fda6=0xce;}_0x6ed505[_0x7042('0x17')](_0x34fda6);return _0x6ed505[_0x7042('0x1e')]('Content-Range',_0x1e69aa+'-'+_0x6e18fb+'/'+_0x28add7)[_0x7042('0x19')](_0x4c68c4);}return null;};}function patchUpdates(_0x580f84){return function(_0x363f3c){try{jsonpatch['apply'](_0x363f3c,_0x580f84,!![]);}catch(_0x3b8203){return BPromise[_0x7042('0x1f')](_0x3b8203);}return _0x363f3c[_0x7042('0x20')]();};}function saveUpdates(_0x456dfc,_0x484c82){return function(_0x5a224b){if(_0x5a224b){return _0x5a224b['update'](_0x456dfc)[_0x7042('0x21')](function(_0x30a722){return _0x30a722;});}return null;};}function removeEntity(_0x3af8bc,_0x1949fe){return function(_0x48d529){if(_0x48d529){return _0x48d529[_0x7042('0x22')]()[_0x7042('0x21')](function(){_0x3af8bc[_0x7042('0x17')](0xcc)[_0x7042('0x18')]();});}};}function handleEntityNotFound(_0x459ff6,_0x54445b){return function(_0xc5fed3){if(!_0xc5fed3){_0x459ff6[_0x7042('0x16')](0x194);}return _0xc5fed3;};}function handleError(_0xf3c3f9,_0x1a05d1){_0x1a05d1=_0x1a05d1||0x1f4;return function(_0x2e4dbe){logger[_0x7042('0x23')](_0x2e4dbe[_0x7042('0x24')]);if(_0x2e4dbe[_0x7042('0x25')]){delete _0x2e4dbe[_0x7042('0x25')];}_0xf3c3f9[_0x7042('0x17')](_0x1a05d1)[_0x7042('0x26')](_0x2e4dbe);};}exports[_0x7042('0x27')]=function(_0x88c156,_0x1b6a29){var _0x101b89={},_0x3203f3={},_0x477972={'count':0x0,'rows':[]};var _0xa7461d=_[_0x7042('0x28')](db['FaxQueueReport']['rawAttributes'],function(_0x37cf52){return{'name':_0x37cf52[_0x7042('0x29')],'type':_0x37cf52[_0x7042('0x2a')][_0x7042('0x2b')]};});_0x3203f3[_0x7042('0x2c')]=_[_0x7042('0x28')](_0xa7461d,_0x7042('0x25'));_0x3203f3['query']=_['keys'](_0x88c156[_0x7042('0x2d')]);_0x3203f3[_0x7042('0x2e')]=_['intersection'](_0x3203f3[_0x7042('0x2c')],_0x3203f3[_0x7042('0x2d')]);_0x101b89['attributes']=_[_0x7042('0x2f')](_0x3203f3[_0x7042('0x2c')],qs[_0x7042('0x30')](_0x88c156[_0x7042('0x2d')][_0x7042('0x30')]));_0x101b89['attributes']=_0x101b89[_0x7042('0x31')]['length']?_0x101b89['attributes']:_0x3203f3[_0x7042('0x2c')];if(!_0x88c156['query'][_0x7042('0x32')](_0x7042('0x33'))){_0x101b89['limit']=qs[_0x7042('0x1d')](_0x88c156['query'][_0x7042('0x1d')]);_0x101b89[_0x7042('0x1c')]=qs[_0x7042('0x1c')](_0x88c156[_0x7042('0x2d')][_0x7042('0x1c')]);}_0x101b89[_0x7042('0x34')]=qs[_0x7042('0x35')](_0x88c156[_0x7042('0x2d')][_0x7042('0x35')]);_0x101b89['where']=qs[_0x7042('0x2e')](_[_0x7042('0x36')](_0x88c156[_0x7042('0x2d')],_0x3203f3['filters']),_0xa7461d);if(_0x88c156['query'][_0x7042('0x37')]){_0x101b89[_0x7042('0x38')]=_['merge'](_0x101b89[_0x7042('0x38')],{'$or':_[_0x7042('0x28')](_0xa7461d,function(_0x349198){if(_0x349198[_0x7042('0x2a')]!==_0x7042('0x39')){var _0x3abd08={};_0x3abd08[_0x349198[_0x7042('0x25')]]={'$like':'%'+_0x88c156[_0x7042('0x2d')][_0x7042('0x37')]+'%'};return _0x3abd08;}})});}_0x101b89=_[_0x7042('0x3a')]({},_0x101b89,_0x88c156[_0x7042('0x3b')]);var _0x4232c2={'where':_0x101b89[_0x7042('0x38')]};return db['FaxQueueReport']['count'](_0x4232c2)[_0x7042('0x21')](function(_0x43f372){_0x477972[_0x7042('0x1b')]=_0x43f372;if(_0x88c156[_0x7042('0x2d')]['includeAll']){_0x101b89[_0x7042('0x3c')]=[{'all':!![]}];}return db[_0x7042('0x3d')]['findAll'](_0x101b89);})['then'](function(_0x1f8e68){_0x477972[_0x7042('0x3e')]=_0x1f8e68;return _0x477972;})[_0x7042('0x21')](respondWithFilteredResult(_0x1b6a29,_0x101b89))[_0x7042('0x3f')](handleError(_0x1b6a29,null));};exports[_0x7042('0x40')]=function(_0x4a4e90,_0x5de476){var _0x2c8d2a={'raw':!![],'where':{'id':_0x4a4e90['params']['id']}},_0x3897fc={};_0x3897fc[_0x7042('0x2c')]=_[_0x7042('0x41')](db[_0x7042('0x3d')]['rawAttributes']);_0x3897fc['query']=_[_0x7042('0x41')](_0x4a4e90[_0x7042('0x2d')]);_0x3897fc[_0x7042('0x2e')]=_['intersection'](_0x3897fc[_0x7042('0x2c')],_0x3897fc[_0x7042('0x2d')]);_0x2c8d2a['attributes']=_[_0x7042('0x2f')](_0x3897fc[_0x7042('0x2c')],qs[_0x7042('0x30')](_0x4a4e90[_0x7042('0x2d')][_0x7042('0x30')]));_0x2c8d2a[_0x7042('0x31')]=_0x2c8d2a[_0x7042('0x31')]['length']?_0x2c8d2a[_0x7042('0x31')]:_0x3897fc[_0x7042('0x2c')];if(_0x4a4e90['query'][_0x7042('0x42')]){_0x2c8d2a[_0x7042('0x3c')]=[{'all':!![]}];}_0x2c8d2a=_[_0x7042('0x3a')]({},_0x2c8d2a,_0x4a4e90[_0x7042('0x3b')]);return db[_0x7042('0x3d')][_0x7042('0x43')](_0x2c8d2a)['then'](handleEntityNotFound(_0x5de476,null))['then'](respondWithResult(_0x5de476,null))['catch'](handleError(_0x5de476,null));};exports[_0x7042('0x44')]=function(_0x55ecfe,_0x4821d3){return db[_0x7042('0x3d')]['create'](_0x55ecfe[_0x7042('0x45')],{})[_0x7042('0x21')](respondWithResult(_0x4821d3,0xc9))[_0x7042('0x3f')](handleError(_0x4821d3,null));};exports[_0x7042('0x46')]=function(_0x1a22d5,_0x11e7ce){if(_0x1a22d5[_0x7042('0x45')]['id']){delete _0x1a22d5[_0x7042('0x45')]['id'];}return db[_0x7042('0x3d')][_0x7042('0x43')]({'where':{'id':_0x1a22d5[_0x7042('0x47')]['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x11e7ce,null))[_0x7042('0x21')](saveUpdates(_0x1a22d5['body'],null))[_0x7042('0x21')](respondWithResult(_0x11e7ce,null))[_0x7042('0x3f')](handleError(_0x11e7ce,null));};exports[_0x7042('0x22')]=function(_0x81b898,_0x3fcf0e){return db[_0x7042('0x3d')][_0x7042('0x43')]({'where':{'id':_0x81b898[_0x7042('0x47')]['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x3fcf0e,null))[_0x7042('0x21')](removeEntity(_0x3fcf0e,null))[_0x7042('0x3f')](handleError(_0x3fcf0e,null));};exports[_0x7042('0x48')]=function(_0x79f988,_0x4d1518){return db[_0x7042('0x3d')]['describe']()[_0x7042('0x21')](respondWithResult(_0x4d1518,null))[_0x7042('0x3f')](handleError(_0x4d1518,null));}; \ No newline at end of file +var _0x01d3=['path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','index','FaxQueueReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','VIRTUAL','include','rows','catch','show','params','includeAll','options','create','body','find','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x589be8,_0xa4f89a){var _0x3d00bc=function(_0xef6c59){while(--_0xef6c59){_0x589be8['push'](_0x589be8['shift']());}};_0x3d00bc(++_0xa4f89a);}(_0x01d3,0xdb));var _0x301d=function(_0x5ebf8b,_0x43e753){_0x5ebf8b=_0x5ebf8b-0x0;var _0x3dfc6a=_0x01d3[_0x5ebf8b];return _0x3dfc6a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x301d('0x0'));var jsonpatch=require(_0x301d('0x1'));var rp=require(_0x301d('0x2'));var moment=require('moment');var BPromise=require(_0x301d('0x3'));var Mustache=require(_0x301d('0x4'));var util=require(_0x301d('0x5'));var path=require(_0x301d('0x6'));var sox=require(_0x301d('0x7'));var csv=require('to-csv');var ejs=require(_0x301d('0x8'));var fs=require('fs');var fs_extra=require(_0x301d('0x9'));var _=require(_0x301d('0xa'));var squel=require(_0x301d('0xb'));var crypto=require(_0x301d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x301d('0xd'));var toCsv=require(_0x301d('0xe'));var querystring=require(_0x301d('0xf'));var Papa=require(_0x301d('0x10'));var Redis=require(_0x301d('0x11'));var authService=require(_0x301d('0x12'));var qs=require(_0x301d('0x13'));var as=require(_0x301d('0x14'));var hardwareService=require(_0x301d('0x15'));var logger=require('../../config/logger')(_0x301d('0x16'));var utils=require(_0x301d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x301d('0x18'));var db=require(_0x301d('0x19'))['db'];function respondWithStatusCode(_0x2eb3af,_0x53bfe2){_0x53bfe2=_0x53bfe2||0xcc;return function(_0x496f0c){if(_0x496f0c){return _0x2eb3af[_0x301d('0x1a')](_0x53bfe2);}return _0x2eb3af[_0x301d('0x1b')](_0x53bfe2)[_0x301d('0x1c')]();};}function respondWithResult(_0x377c7f,_0x11bacf){_0x11bacf=_0x11bacf||0xc8;return function(_0x5bdd8a){if(_0x5bdd8a){return _0x377c7f[_0x301d('0x1b')](_0x11bacf)['json'](_0x5bdd8a);}};}function respondWithFilteredResult(_0x1d4fb4,_0xc35239){return function(_0x4fd833){if(_0x4fd833){var _0x10d277=typeof _0xc35239[_0x301d('0x1d')]===_0x301d('0x1e')&&typeof _0xc35239[_0x301d('0x1f')]===_0x301d('0x1e');var _0x1c409b=_0x4fd833[_0x301d('0x20')];var _0x2c7afb=_0x10d277?0x0:_0xc35239[_0x301d('0x1d')];var _0x3a2ad2=_0x10d277?_0x4fd833[_0x301d('0x20')]:_0xc35239[_0x301d('0x1d')]+_0xc35239[_0x301d('0x1f')];var _0x3d75e5;if(_0x3a2ad2>=_0x1c409b){_0x3a2ad2=_0x1c409b;_0x3d75e5=0xc8;}else{_0x3d75e5=0xce;}_0x1d4fb4[_0x301d('0x1b')](_0x3d75e5);return _0x1d4fb4['set']('Content-Range',_0x2c7afb+'-'+_0x3a2ad2+'/'+_0x1c409b)['json'](_0x4fd833);}return null;};}function patchUpdates(_0x31c94e){return function(_0x17ee2a){try{jsonpatch[_0x301d('0x21')](_0x17ee2a,_0x31c94e,!![]);}catch(_0x4d8006){return BPromise[_0x301d('0x22')](_0x4d8006);}return _0x17ee2a[_0x301d('0x23')]();};}function saveUpdates(_0x5b6631,_0x485f96){return function(_0x292c89){if(_0x292c89){return _0x292c89[_0x301d('0x24')](_0x5b6631)[_0x301d('0x25')](function(_0x3fa47d){return _0x3fa47d;});}return null;};}function removeEntity(_0x549e57,_0x1119da){return function(_0x2491b8){if(_0x2491b8){return _0x2491b8[_0x301d('0x26')]()[_0x301d('0x25')](function(){_0x549e57[_0x301d('0x1b')](0xcc)[_0x301d('0x1c')]();});}};}function handleEntityNotFound(_0x4fae3d,_0x470b7a){return function(_0xb315b6){if(!_0xb315b6){_0x4fae3d[_0x301d('0x1a')](0x194);}return _0xb315b6;};}function handleError(_0x2f7092,_0x31ce2c){_0x31ce2c=_0x31ce2c||0x1f4;return function(_0x23c934){logger[_0x301d('0x27')](_0x23c934[_0x301d('0x28')]);if(_0x23c934['name']){delete _0x23c934[_0x301d('0x29')];}_0x2f7092['status'](_0x31ce2c)['send'](_0x23c934);};}exports[_0x301d('0x2a')]=function(_0x52eb42,_0x326722){var _0x119143={},_0x362c68={},_0x46127a={'count':0x0,'rows':[]};var _0xb6a139=_['map'](db[_0x301d('0x2b')][_0x301d('0x2c')],function(_0x2385ef){return{'name':_0x2385ef[_0x301d('0x2d')],'type':_0x2385ef['type']['key']};});_0x362c68['model']=_['map'](_0xb6a139,_0x301d('0x29'));_0x362c68[_0x301d('0x2e')]=_[_0x301d('0x2f')](_0x52eb42[_0x301d('0x2e')]);_0x362c68[_0x301d('0x30')]=_[_0x301d('0x31')](_0x362c68[_0x301d('0x32')],_0x362c68[_0x301d('0x2e')]);_0x119143[_0x301d('0x33')]=_[_0x301d('0x31')](_0x362c68['model'],qs[_0x301d('0x34')](_0x52eb42[_0x301d('0x2e')][_0x301d('0x34')]));_0x119143[_0x301d('0x33')]=_0x119143[_0x301d('0x33')][_0x301d('0x35')]?_0x119143[_0x301d('0x33')]:_0x362c68[_0x301d('0x32')];if(!_0x52eb42[_0x301d('0x2e')][_0x301d('0x36')]('nolimit')){_0x119143['limit']=qs[_0x301d('0x1f')](_0x52eb42[_0x301d('0x2e')][_0x301d('0x1f')]);_0x119143[_0x301d('0x1d')]=qs[_0x301d('0x1d')](_0x52eb42['query'][_0x301d('0x1d')]);}_0x119143[_0x301d('0x37')]=qs[_0x301d('0x38')](_0x52eb42['query'][_0x301d('0x38')]);_0x119143['where']=qs[_0x301d('0x30')](_[_0x301d('0x39')](_0x52eb42[_0x301d('0x2e')],_0x362c68[_0x301d('0x30')]),_0xb6a139);if(_0x52eb42[_0x301d('0x2e')][_0x301d('0x3a')]){_0x119143[_0x301d('0x3b')]=_[_0x301d('0x3c')](_0x119143['where'],{'$or':_[_0x301d('0x3d')](_0xb6a139,function(_0x2a1459){if(_0x2a1459[_0x301d('0x3e')]!==_0x301d('0x3f')){var _0xc4e7ff={};_0xc4e7ff[_0x2a1459['name']]={'$like':'%'+_0x52eb42['query']['filter']+'%'};return _0xc4e7ff;}})});}_0x119143=_[_0x301d('0x3c')]({},_0x119143,_0x52eb42['options']);var _0x35047e={'where':_0x119143[_0x301d('0x3b')]};return db[_0x301d('0x2b')][_0x301d('0x20')](_0x35047e)[_0x301d('0x25')](function(_0x5ee9cc){_0x46127a[_0x301d('0x20')]=_0x5ee9cc;if(_0x52eb42['query']['includeAll']){_0x119143[_0x301d('0x40')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x119143);})[_0x301d('0x25')](function(_0x168211){_0x46127a[_0x301d('0x41')]=_0x168211;return _0x46127a;})[_0x301d('0x25')](respondWithFilteredResult(_0x326722,_0x119143))[_0x301d('0x42')](handleError(_0x326722,null));};exports[_0x301d('0x43')]=function(_0x499ca8,_0x16a7ca){var _0x29ef1d={'raw':!![],'where':{'id':_0x499ca8[_0x301d('0x44')]['id']}},_0x3dd5f5={};_0x3dd5f5[_0x301d('0x32')]=_[_0x301d('0x2f')](db[_0x301d('0x2b')]['rawAttributes']);_0x3dd5f5[_0x301d('0x2e')]=_['keys'](_0x499ca8['query']);_0x3dd5f5[_0x301d('0x30')]=_[_0x301d('0x31')](_0x3dd5f5['model'],_0x3dd5f5[_0x301d('0x2e')]);_0x29ef1d[_0x301d('0x33')]=_['intersection'](_0x3dd5f5['model'],qs[_0x301d('0x34')](_0x499ca8[_0x301d('0x2e')][_0x301d('0x34')]));_0x29ef1d['attributes']=_0x29ef1d['attributes'][_0x301d('0x35')]?_0x29ef1d[_0x301d('0x33')]:_0x3dd5f5[_0x301d('0x32')];if(_0x499ca8[_0x301d('0x2e')][_0x301d('0x45')]){_0x29ef1d['include']=[{'all':!![]}];}_0x29ef1d=_[_0x301d('0x3c')]({},_0x29ef1d,_0x499ca8[_0x301d('0x46')]);return db[_0x301d('0x2b')]['find'](_0x29ef1d)[_0x301d('0x25')](handleEntityNotFound(_0x16a7ca,null))[_0x301d('0x25')](respondWithResult(_0x16a7ca,null))[_0x301d('0x42')](handleError(_0x16a7ca,null));};exports[_0x301d('0x47')]=function(_0x54cce3,_0x2c1fc8){return db['FaxQueueReport'][_0x301d('0x47')](_0x54cce3['body'],{})[_0x301d('0x25')](respondWithResult(_0x2c1fc8,0xc9))[_0x301d('0x42')](handleError(_0x2c1fc8,null));};exports[_0x301d('0x24')]=function(_0x155912,_0x2ed897){if(_0x155912[_0x301d('0x48')]['id']){delete _0x155912[_0x301d('0x48')]['id'];}return db[_0x301d('0x2b')][_0x301d('0x49')]({'where':{'id':_0x155912['params']['id']}})[_0x301d('0x25')](handleEntityNotFound(_0x2ed897,null))[_0x301d('0x25')](saveUpdates(_0x155912[_0x301d('0x48')],null))[_0x301d('0x25')](respondWithResult(_0x2ed897,null))['catch'](handleError(_0x2ed897,null));};exports[_0x301d('0x26')]=function(_0x5c1d19,_0x59d4f4){return db['FaxQueueReport'][_0x301d('0x49')]({'where':{'id':_0x5c1d19['params']['id']}})['then'](handleEntityNotFound(_0x59d4f4,null))[_0x301d('0x25')](removeEntity(_0x59d4f4,null))[_0x301d('0x42')](handleError(_0x59d4f4,null));};exports[_0x301d('0x4a')]=function(_0x29cb7b,_0x243cb2){return db[_0x301d('0x2b')][_0x301d('0x4a')]()[_0x301d('0x25')](respondWithResult(_0x243cb2,null))[_0x301d('0x42')](handleError(_0x243cb2,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 9051c7b..cb59b85 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 _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x258232,_0x2c3ad2){var _0x242cf6=function(_0xf9c171){while(--_0xf9c171){_0x258232['push'](_0x258232['shift']());}};_0x242cf6(++_0x2c3ad2);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc4aa[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x31badc,_0x70932b){var _0x1c2bb5=function(_0x3ad711){while(--_0x3ad711){_0x31badc['push'](_0x31badc['shift']());}};_0x1c2bb5(++_0x70932b);}(_0x5fab,0x177));var _0xb5fa=function(_0x4dca38,_0x5dfae1){_0x4dca38=_0x4dca38-0x0;var _0x44656c=_0x5fab[_0x4dca38];return _0x44656c;};'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':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index b3e8ee0..2a9b61a 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 _0x44ea=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','info','request\x20sent','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','debug','UpdateFaxQueueReport','update','raw','where','attributes','limit','lodash','moment','randomstring'];(function(_0x5d6ad2,_0x2e8b1b){var _0x2e21b8=function(_0x201435){while(--_0x201435){_0x5d6ad2['push'](_0x5d6ad2['shift']());}};_0x2e21b8(++_0x2e8b1b);}(_0x44ea,0x151));var _0xa44e=function(_0x4e6a0c,_0x4bb54c){_0x4e6a0c=_0x4e6a0c-0x0;var _0xcf2d47=_0x44ea[_0x4e6a0c];return _0xcf2d47;};'use strict';var _=require(_0xa44e('0x0'));var util=require('util');var moment=require(_0xa44e('0x1'));var BPromise=require('bluebird');var rs=require(_0xa44e('0x2'));var fs=require('fs');var Redis=require(_0xa44e('0x3'));var db=require(_0xa44e('0x4'))['db'];var utils=require(_0xa44e('0x5'));var logger=require(_0xa44e('0x6'))(_0xa44e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa44e('0x8')][_0xa44e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5525af,_0x12c66a,_0x28172a){return new BPromise(function(_0xcac66c,_0x5381ad){return client[_0xa44e('0xa')](_0x5525af,_0x28172a)[_0xa44e('0xb')](function(_0x820dcf){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x12c66a,'request\x20sent');logger['debug'](_0xa44e('0xc'),_0x12c66a,'request\x20sent',JSON[_0xa44e('0xd')](_0x820dcf));if(_0x820dcf[_0xa44e('0xe')]){if(_0x820dcf[_0xa44e('0xe')][_0xa44e('0xf')]===0x1f4){logger[_0xa44e('0xe')](_0xa44e('0x10'),_0x12c66a,_0x820dcf[_0xa44e('0xe')][_0xa44e('0x11')]);return _0x5381ad(_0x820dcf[_0xa44e('0xe')][_0xa44e('0x11')]);}logger[_0xa44e('0xe')](_0xa44e('0x10'),_0x12c66a,_0x820dcf[_0xa44e('0xe')][_0xa44e('0x11')]);return _0xcac66c(_0x820dcf['error']['message']);}else{logger[_0xa44e('0x12')](_0xa44e('0x10'),_0x12c66a,_0xa44e('0x13'));_0xcac66c(_0x820dcf[_0xa44e('0x14')][_0xa44e('0x11')]);}})[_0xa44e('0x15')](function(_0x55fd72){logger[_0xa44e('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x12c66a,_0x55fd72);_0x5381ad(_0x55fd72);});});}exports[_0xa44e('0x16')]=function(_0x472c14){var _0x1d4cc5=this;return new Promise(function(_0x8bac6c,_0x22dccb){return db[_0xa44e('0x17')][_0xa44e('0x18')](_0x472c14[_0xa44e('0x19')],{'raw':_0x472c14['options']?_0x472c14[_0xa44e('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xa44e('0xb')](function(_0x1073d8){logger[_0xa44e('0x12')](_0xa44e('0x16'),_0x472c14);logger[_0xa44e('0x1b')](_0xa44e('0x16'),_0x472c14,JSON[_0xa44e('0xd')](_0x1073d8));_0x8bac6c(_0x1073d8);})[_0xa44e('0x15')](function(_0x1d44e3){logger[_0xa44e('0xe')](_0xa44e('0x16'),_0x1d44e3[_0xa44e('0x11')],_0x472c14);_0x22dccb(_0x1d4cc5[_0xa44e('0xe')](0x1f4,_0x1d44e3[_0xa44e('0x11')]));});});};exports[_0xa44e('0x1c')]=function(_0x32c8f2){var _0x570df4=this;return new Promise(function(_0x12838b,_0x44d221){return db['FaxQueueReport'][_0xa44e('0x1d')](_0x32c8f2[_0xa44e('0x19')],{'raw':_0x32c8f2['options']?_0x32c8f2[_0xa44e('0x1a')][_0xa44e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32c8f2[_0xa44e('0x1a')]?_0x32c8f2['options'][_0xa44e('0x1f')]||null:null,'attributes':_0x32c8f2[_0xa44e('0x1a')]?_0x32c8f2[_0xa44e('0x1a')][_0xa44e('0x20')]||null:null,'limit':_0x32c8f2[_0xa44e('0x1a')]?_0x32c8f2['options'][_0xa44e('0x21')]||null:null})['then'](function(_0x30ca5c){logger[_0xa44e('0x12')](_0xa44e('0x1c'),_0x32c8f2);logger[_0xa44e('0x1b')](_0xa44e('0x1c'),_0x32c8f2,JSON[_0xa44e('0xd')](_0x30ca5c));_0x12838b(_0x30ca5c);})[_0xa44e('0x15')](function(_0x2b09c4){logger[_0xa44e('0xe')](_0xa44e('0x1c'),_0x2b09c4[_0xa44e('0x11')],_0x32c8f2);_0x44d221(_0x570df4[_0xa44e('0xe')](0x1f4,_0x2b09c4['message']));});});}; \ No newline at end of file +var _0x7a19=['raw','where','lodash','util','bluebird','../../config/utils','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FaxQueueReport','create','body','options','then','UpdateFaxQueueReport','update'];(function(_0x1baf3,_0xdbbdae){var _0x4caf0f=function(_0x6366c1){while(--_0x6366c1){_0x1baf3['push'](_0x1baf3['shift']());}};_0x4caf0f(++_0xdbbdae);}(_0x7a19,0x1f0));var _0x97a1=function(_0x4ca2f8,_0x1db080){_0x4ca2f8=_0x4ca2f8-0x0;var _0x3db45c=_0x7a19[_0x4ca2f8];return _0x3db45c;};'use strict';var _=require(_0x97a1('0x0'));var util=require(_0x97a1('0x1'));var moment=require('moment');var BPromise=require(_0x97a1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x97a1('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x97a1('0x4'));var client=jayson[_0x97a1('0x5')][_0x97a1('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5bbb7d,_0x146203,_0x3dbf21){return new BPromise(function(_0x1f691e,_0x2f1bec){return client[_0x97a1('0x7')](_0x5bbb7d,_0x3dbf21)['then'](function(_0x5169a1){logger[_0x97a1('0x8')](_0x97a1('0x9'),_0x146203,'request\x20sent');logger[_0x97a1('0xa')](_0x97a1('0xb'),_0x146203,'request\x20sent',JSON[_0x97a1('0xc')](_0x5169a1));if(_0x5169a1[_0x97a1('0xd')]){if(_0x5169a1['error']['code']===0x1f4){logger[_0x97a1('0xd')](_0x97a1('0x9'),_0x146203,_0x5169a1[_0x97a1('0xd')][_0x97a1('0xe')]);return _0x2f1bec(_0x5169a1[_0x97a1('0xd')][_0x97a1('0xe')]);}logger[_0x97a1('0xd')](_0x97a1('0x9'),_0x146203,_0x5169a1[_0x97a1('0xd')][_0x97a1('0xe')]);return _0x1f691e(_0x5169a1[_0x97a1('0xd')][_0x97a1('0xe')]);}else{logger[_0x97a1('0x8')](_0x97a1('0x9'),_0x146203,'request\x20sent');_0x1f691e(_0x5169a1[_0x97a1('0xf')][_0x97a1('0xe')]);}})[_0x97a1('0x10')](function(_0x187d00){logger['error'](_0x97a1('0x9'),_0x146203,_0x187d00);_0x2f1bec(_0x187d00);});});}exports['CreateFaxQueueReport']=function(_0x311de9){var _0x1822a9=this;return new Promise(function(_0x23f41c,_0x3a30ac){return db[_0x97a1('0x11')][_0x97a1('0x12')](_0x311de9[_0x97a1('0x13')],{'raw':_0x311de9[_0x97a1('0x14')]?_0x311de9['options']['raw']===undefined?!![]:![]:!![]})[_0x97a1('0x15')](function(_0x4e6f6a){logger[_0x97a1('0x8')]('CreateFaxQueueReport',_0x311de9);logger[_0x97a1('0xa')]('CreateFaxQueueReport',_0x311de9,JSON['stringify'](_0x4e6f6a));_0x23f41c(_0x4e6f6a);})[_0x97a1('0x10')](function(_0x45cc46){logger[_0x97a1('0xd')]('CreateFaxQueueReport',_0x45cc46[_0x97a1('0xe')],_0x311de9);_0x3a30ac(_0x1822a9[_0x97a1('0xd')](0x1f4,_0x45cc46[_0x97a1('0xe')]));});});};exports[_0x97a1('0x16')]=function(_0xa055cf){var _0x4244fb=this;return new Promise(function(_0x4bb318,_0x5aa196){return db[_0x97a1('0x11')][_0x97a1('0x17')](_0xa055cf[_0x97a1('0x13')],{'raw':_0xa055cf['options']?_0xa055cf[_0x97a1('0x14')][_0x97a1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa055cf[_0x97a1('0x14')]?_0xa055cf[_0x97a1('0x14')][_0x97a1('0x19')]||null:null,'attributes':_0xa055cf['options']?_0xa055cf[_0x97a1('0x14')]['attributes']||null:null,'limit':_0xa055cf[_0x97a1('0x14')]?_0xa055cf[_0x97a1('0x14')]['limit']||null:null})[_0x97a1('0x15')](function(_0x5f4870){logger[_0x97a1('0x8')]('UpdateFaxQueueReport',_0xa055cf);logger[_0x97a1('0xa')](_0x97a1('0x16'),_0xa055cf,JSON[_0x97a1('0xc')](_0x5f4870));_0x4bb318(_0x5f4870);})[_0x97a1('0x10')](function(_0x57fe26){logger['error']('UpdateFaxQueueReport',_0x57fe26['message'],_0xa055cf);_0x5aa196(_0x4244fb[_0x97a1('0xd')](0x1f4,_0x57fe26[_0x97a1('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index d4575c6..e81707a 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 _0xab10=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4f8902,_0x502ecd){var _0x3408ac=function(_0x5550b2){while(--_0x5550b2){_0x4f8902['push'](_0x4f8902['shift']());}};_0x3408ac(++_0x502ecd);}(_0xab10,0x116));var _0x0ab1=function(_0x54f38f,_0x4e5b91){_0x54f38f=_0x54f38f-0x0;var _0x372183=_0xab10[_0x54f38f];return _0x372183;};'use strict';var multer=require(_0x0ab1('0x0'));var util=require(_0x0ab1('0x1'));var path=require('path');var timeout=require(_0x0ab1('0x2'));var express=require(_0x0ab1('0x3'));var router=express[_0x0ab1('0x4')]();var fs_extra=require(_0x0ab1('0x5'));var auth=require(_0x0ab1('0x6'));var interaction=require(_0x0ab1('0x7'));var config=require(_0x0ab1('0x8'));var controller=require('./faxQueueReport.controller');router[_0x0ab1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0ab1('0x9')]('/describe',auth[_0x0ab1('0xa')](),controller['describe']);router[_0x0ab1('0x9')](_0x0ab1('0xb'),auth[_0x0ab1('0xa')](),controller[_0x0ab1('0xc')]);router[_0x0ab1('0xd')]('/',auth[_0x0ab1('0xa')](),controller[_0x0ab1('0xe')]);router['put'](_0x0ab1('0xb'),auth[_0x0ab1('0xa')](),controller[_0x0ab1('0xf')]);router[_0x0ab1('0x10')](_0x0ab1('0xb'),auth['isAuthenticated'](),controller[_0x0ab1('0x11')]);module[_0x0ab1('0x12')]=router; \ No newline at end of file +var _0xe703=['delete','destroy','multer','util','path','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','post','/:id','update'];(function(_0x49a84b,_0x17c1be){var _0x171650=function(_0x1cc9cf){while(--_0x1cc9cf){_0x49a84b['push'](_0x49a84b['shift']());}};_0x171650(++_0x17c1be);}(_0xe703,0x102));var _0x3e70=function(_0x5cb5bf,_0x135279){_0x5cb5bf=_0x5cb5bf-0x0;var _0x28d199=_0xe703[_0x5cb5bf];return _0x28d199;};'use strict';var multer=require(_0x3e70('0x0'));var util=require(_0x3e70('0x1'));var path=require(_0x3e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e70('0x3'));var router=express['Router']();var fs_extra=require(_0x3e70('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3e70('0x5'));var controller=require('./faxQueueReport.controller');router[_0x3e70('0x6')]('/',auth[_0x3e70('0x7')](),controller[_0x3e70('0x8')]);router[_0x3e70('0x6')](_0x3e70('0x9'),auth['isAuthenticated'](),controller[_0x3e70('0xa')]);router['get']('/:id',auth[_0x3e70('0x7')](),controller['show']);router[_0x3e70('0xb')]('/',auth[_0x3e70('0x7')](),controller['create']);router['put'](_0x3e70('0xc'),auth['isAuthenticated'](),controller[_0x3e70('0xd')]);router[_0x3e70('0xe')](_0x3e70('0xc'),auth[_0x3e70('0x7')](),controller[_0x3e70('0xf')]);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 76433a9..72574c8 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x480310,_0x1f2e64){var _0x12a0ec=function(_0x580c07){while(--_0x580c07){_0x480310['push'](_0x480310['shift']());}};_0x12a0ec(++_0x1f2e64);}(_0xedd9,0xfc));var _0x9edd=function(_0x530804,_0x44e860){_0x530804=_0x530804-0x0;var _0x3c0f69=_0xedd9[_0x530804];return _0x3c0f69;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4574d0,_0x3362b7){_0x4574d0=_0x4574d0-0x0;var _0xad5aab=_0xb43b[_0x4574d0];return _0xad5aab;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 0cdf2a5..40f960c 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 _0x5378=['sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','FaxTransferReport','count','includeAll','include','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','end'];(function(_0x5d33a9,_0x1d72e9){var _0x59ec9d=function(_0x3505b3){while(--_0x3505b3){_0x5d33a9['push'](_0x5d33a9['shift']());}};_0x59ec9d(++_0x1d72e9);}(_0x5378,0x1ef));var _0x8537=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5378[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x8537('0x0'));var rimraf=require(_0x8537('0x1'));var zipdir=require(_0x8537('0x2'));var jsonpatch=require(_0x8537('0x3'));var rp=require(_0x8537('0x4'));var moment=require(_0x8537('0x5'));var BPromise=require(_0x8537('0x6'));var Mustache=require(_0x8537('0x7'));var util=require(_0x8537('0x8'));var path=require(_0x8537('0x9'));var sox=require(_0x8537('0xa'));var csv=require(_0x8537('0xb'));var ejs=require(_0x8537('0xc'));var fs=require('fs');var fs_extra=require(_0x8537('0xd'));var _=require('lodash');var squel=require(_0x8537('0xe'));var crypto=require(_0x8537('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8537('0x10'));var Papa=require(_0x8537('0x11'));var Redis=require(_0x8537('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8537('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8537('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x8537('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8537('0x16'));var db=require(_0x8537('0x17'))['db'];function respondWithStatusCode(_0xb7f074,_0x10044e){_0x10044e=_0x10044e||0xcc;return function(_0x3f82d6){if(_0x3f82d6){return _0xb7f074['sendStatus'](_0x10044e);}return _0xb7f074[_0x8537('0x18')](_0x10044e)['end']();};}function respondWithResult(_0x530595,_0x4c8605){_0x4c8605=_0x4c8605||0xc8;return function(_0x156590){if(_0x156590){return _0x530595[_0x8537('0x18')](_0x4c8605)[_0x8537('0x19')](_0x156590);}};}function respondWithFilteredResult(_0xcacd5b,_0xb1a4e){return function(_0x4ded28){if(_0x4ded28){var _0x45f835=typeof _0xb1a4e[_0x8537('0x1a')]===_0x8537('0x1b')&&typeof _0xb1a4e[_0x8537('0x1c')]==='undefined';var _0x5b8ccf=_0x4ded28['count'];var _0x332271=_0x45f835?0x0:_0xb1a4e[_0x8537('0x1a')];var _0x2e874e=_0x45f835?_0x4ded28['count']:_0xb1a4e[_0x8537('0x1a')]+_0xb1a4e[_0x8537('0x1c')];var _0x358c0c;if(_0x2e874e>=_0x5b8ccf){_0x2e874e=_0x5b8ccf;_0x358c0c=0xc8;}else{_0x358c0c=0xce;}_0xcacd5b[_0x8537('0x18')](_0x358c0c);return _0xcacd5b[_0x8537('0x1d')](_0x8537('0x1e'),_0x332271+'-'+_0x2e874e+'/'+_0x5b8ccf)[_0x8537('0x19')](_0x4ded28);}return null;};}function patchUpdates(_0x38c221){return function(_0x2b353e){try{jsonpatch[_0x8537('0x1f')](_0x2b353e,_0x38c221,!![]);}catch(_0x528267){return BPromise[_0x8537('0x20')](_0x528267);}return _0x2b353e[_0x8537('0x21')]();};}function saveUpdates(_0x59f942,_0x266533){return function(_0xcd5c2c){if(_0xcd5c2c){return _0xcd5c2c[_0x8537('0x22')](_0x59f942)[_0x8537('0x23')](function(_0x567f4f){return _0x567f4f;});}return null;};}function removeEntity(_0x330787,_0x972860){return function(_0x4e6794){if(_0x4e6794){return _0x4e6794['destroy']()['then'](function(){_0x330787[_0x8537('0x18')](0xcc)[_0x8537('0x24')]();});}};}function handleEntityNotFound(_0x227765,_0x1be6ea){return function(_0x9baff7){if(!_0x9baff7){_0x227765[_0x8537('0x25')](0x194);}return _0x9baff7;};}function handleError(_0x28cb5f,_0x28802e){_0x28802e=_0x28802e||0x1f4;return function(_0x231546){logger[_0x8537('0x26')](_0x231546[_0x8537('0x27')]);if(_0x231546[_0x8537('0x28')]){delete _0x231546[_0x8537('0x28')];}_0x28cb5f['status'](_0x28802e)[_0x8537('0x29')](_0x231546);};}exports[_0x8537('0x2a')]=function(_0x5343b5,_0x46a138){var _0x1023f9={},_0xf0ef70={},_0x42b341={'count':0x0,'rows':[]};var _0x520c7a=_[_0x8537('0x2b')](db['FaxTransferReport'][_0x8537('0x2c')],function(_0x4213e5){return{'name':_0x4213e5[_0x8537('0x2d')],'type':_0x4213e5[_0x8537('0x2e')][_0x8537('0x2f')]};});_0xf0ef70[_0x8537('0x30')]=_['map'](_0x520c7a,_0x8537('0x28'));_0xf0ef70['query']=_[_0x8537('0x31')](_0x5343b5[_0x8537('0x32')]);_0xf0ef70[_0x8537('0x33')]=_[_0x8537('0x34')](_0xf0ef70[_0x8537('0x30')],_0xf0ef70[_0x8537('0x32')]);_0x1023f9[_0x8537('0x35')]=_[_0x8537('0x34')](_0xf0ef70[_0x8537('0x30')],qs[_0x8537('0x36')](_0x5343b5[_0x8537('0x32')]['fields']));_0x1023f9['attributes']=_0x1023f9['attributes']['length']?_0x1023f9[_0x8537('0x35')]:_0xf0ef70[_0x8537('0x30')];if(!_0x5343b5[_0x8537('0x32')][_0x8537('0x37')]('nolimit')){_0x1023f9[_0x8537('0x1c')]=qs[_0x8537('0x1c')](_0x5343b5[_0x8537('0x32')][_0x8537('0x1c')]);_0x1023f9[_0x8537('0x1a')]=qs[_0x8537('0x1a')](_0x5343b5['query'][_0x8537('0x1a')]);}_0x1023f9[_0x8537('0x38')]=qs[_0x8537('0x39')](_0x5343b5['query'][_0x8537('0x39')]);_0x1023f9['where']=qs[_0x8537('0x33')](_[_0x8537('0x3a')](_0x5343b5[_0x8537('0x32')],_0xf0ef70['filters']),_0x520c7a);if(_0x5343b5[_0x8537('0x32')]['filter']){_0x1023f9[_0x8537('0x3b')]=_[_0x8537('0x3c')](_0x1023f9[_0x8537('0x3b')],{'$or':_[_0x8537('0x2b')](_0x520c7a,function(_0x48126c){if(_0x48126c['type']!==_0x8537('0x3d')){var _0x2708f0={};_0x2708f0[_0x48126c[_0x8537('0x28')]]={'$like':'%'+_0x5343b5['query'][_0x8537('0x3e')]+'%'};return _0x2708f0;}})});}_0x1023f9=_[_0x8537('0x3c')]({},_0x1023f9,_0x5343b5['options']);var _0x6243ff={'where':_0x1023f9[_0x8537('0x3b')]};return db[_0x8537('0x3f')][_0x8537('0x40')](_0x6243ff)[_0x8537('0x23')](function(_0x55f8ed){_0x42b341[_0x8537('0x40')]=_0x55f8ed;if(_0x5343b5[_0x8537('0x32')][_0x8537('0x41')]){_0x1023f9[_0x8537('0x42')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x1023f9);})[_0x8537('0x23')](function(_0x2cf41e){_0x42b341[_0x8537('0x43')]=_0x2cf41e;return _0x42b341;})[_0x8537('0x23')](respondWithFilteredResult(_0x46a138,_0x1023f9))[_0x8537('0x44')](handleError(_0x46a138,null));};exports[_0x8537('0x45')]=function(_0x5c0cce,_0xf61259){var _0x38f1d4={'raw':!![],'where':{'id':_0x5c0cce[_0x8537('0x46')]['id']}},_0x408f30={};_0x408f30[_0x8537('0x30')]=_['keys'](db[_0x8537('0x3f')][_0x8537('0x2c')]);_0x408f30[_0x8537('0x32')]=_[_0x8537('0x31')](_0x5c0cce[_0x8537('0x32')]);_0x408f30[_0x8537('0x33')]=_['intersection'](_0x408f30[_0x8537('0x30')],_0x408f30[_0x8537('0x32')]);_0x38f1d4[_0x8537('0x35')]=_[_0x8537('0x34')](_0x408f30[_0x8537('0x30')],qs[_0x8537('0x36')](_0x5c0cce[_0x8537('0x32')]['fields']));_0x38f1d4[_0x8537('0x35')]=_0x38f1d4[_0x8537('0x35')]['length']?_0x38f1d4[_0x8537('0x35')]:_0x408f30[_0x8537('0x30')];if(_0x5c0cce[_0x8537('0x32')][_0x8537('0x41')]){_0x38f1d4['include']=[{'all':!![]}];}_0x38f1d4=_['merge']({},_0x38f1d4,_0x5c0cce[_0x8537('0x47')]);return db[_0x8537('0x3f')][_0x8537('0x48')](_0x38f1d4)[_0x8537('0x23')](handleEntityNotFound(_0xf61259,null))[_0x8537('0x23')](respondWithResult(_0xf61259,null))[_0x8537('0x44')](handleError(_0xf61259,null));};exports[_0x8537('0x49')]=function(_0x1c3e66,_0x31d3dc){return db[_0x8537('0x3f')]['create'](_0x1c3e66[_0x8537('0x4a')],{})[_0x8537('0x23')](respondWithResult(_0x31d3dc,0xc9))[_0x8537('0x44')](handleError(_0x31d3dc,null));};exports['update']=function(_0x137c56,_0x5e3b33){if(_0x137c56[_0x8537('0x4a')]['id']){delete _0x137c56[_0x8537('0x4a')]['id'];}return db[_0x8537('0x3f')][_0x8537('0x48')]({'where':{'id':_0x137c56['params']['id']}})[_0x8537('0x23')](handleEntityNotFound(_0x5e3b33,null))[_0x8537('0x23')](saveUpdates(_0x137c56['body'],null))[_0x8537('0x23')](respondWithResult(_0x5e3b33,null))['catch'](handleError(_0x5e3b33,null));};exports['destroy']=function(_0x86ee05,_0x1c4f39){return db['FaxTransferReport']['find']({'where':{'id':_0x86ee05[_0x8537('0x46')]['id']}})[_0x8537('0x23')](handleEntityNotFound(_0x1c4f39,null))['then'](removeEntity(_0x1c4f39,null))[_0x8537('0x44')](handleError(_0x1c4f39,null));};exports[_0x8537('0x4b')]=function(_0x5c1914,_0x637a62){return db[_0x8537('0x3f')][_0x8537('0x4b')]()[_0x8537('0x23')](respondWithResult(_0x637a62,null))[_0x8537('0x44')](handleError(_0x637a62,null));}; \ No newline at end of file +var _0x9393=['moment','bluebird','mustache','util','path','to-csv','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','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FaxTransferReport','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0x9393,0x18d));var _0x3939=function(_0x594335,_0x40266c){_0x594335=_0x594335-0x0;var _0x487d93=_0x9393[_0x594335];return _0x487d93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3939('0x0'));var zipdir=require(_0x3939('0x1'));var jsonpatch=require(_0x3939('0x2'));var rp=require('request-promise');var moment=require(_0x3939('0x3'));var BPromise=require(_0x3939('0x4'));var Mustache=require(_0x3939('0x5'));var util=require(_0x3939('0x6'));var path=require(_0x3939('0x7'));var sox=require('sox');var csv=require(_0x3939('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3939('0x9'));var _=require(_0x3939('0xa'));var squel=require(_0x3939('0xb'));var crypto=require(_0x3939('0xc'));var jsforce=require(_0x3939('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3939('0xe'));var Papa=require(_0x3939('0xf'));var Redis=require(_0x3939('0x10'));var authService=require(_0x3939('0x11'));var qs=require(_0x3939('0x12'));var as=require(_0x3939('0x13'));var hardwareService=require(_0x3939('0x14'));var logger=require(_0x3939('0x15'))('api');var utils=require(_0x3939('0x16'));var config=require(_0x3939('0x17'));var licenseUtil=require(_0x3939('0x18'));var db=require(_0x3939('0x19'))['db'];function respondWithStatusCode(_0x4687ba,_0x4d58d3){_0x4d58d3=_0x4d58d3||0xcc;return function(_0x2b9a34){if(_0x2b9a34){return _0x4687ba[_0x3939('0x1a')](_0x4d58d3);}return _0x4687ba['status'](_0x4d58d3)[_0x3939('0x1b')]();};}function respondWithResult(_0x25b7e8,_0x4832b3){_0x4832b3=_0x4832b3||0xc8;return function(_0x525b0e){if(_0x525b0e){return _0x25b7e8[_0x3939('0x1c')](_0x4832b3)[_0x3939('0x1d')](_0x525b0e);}};}function respondWithFilteredResult(_0x3d7f69,_0x553661){return function(_0x42d22f){if(_0x42d22f){var _0x2a990d=typeof _0x553661['offset']===_0x3939('0x1e')&&typeof _0x553661[_0x3939('0x1f')]===_0x3939('0x1e');var _0x51eede=_0x42d22f['count'];var _0x4dae1e=_0x2a990d?0x0:_0x553661[_0x3939('0x20')];var _0x346f08=_0x2a990d?_0x42d22f[_0x3939('0x21')]:_0x553661[_0x3939('0x20')]+_0x553661[_0x3939('0x1f')];var _0x3c88e4;if(_0x346f08>=_0x51eede){_0x346f08=_0x51eede;_0x3c88e4=0xc8;}else{_0x3c88e4=0xce;}_0x3d7f69[_0x3939('0x1c')](_0x3c88e4);return _0x3d7f69[_0x3939('0x22')](_0x3939('0x23'),_0x4dae1e+'-'+_0x346f08+'/'+_0x51eede)[_0x3939('0x1d')](_0x42d22f);}return null;};}function patchUpdates(_0x19b05f){return function(_0x4c8e46){try{jsonpatch[_0x3939('0x24')](_0x4c8e46,_0x19b05f,!![]);}catch(_0x48d773){return BPromise[_0x3939('0x25')](_0x48d773);}return _0x4c8e46[_0x3939('0x26')]();};}function saveUpdates(_0xad8511,_0x29baa6){return function(_0x42da8d){if(_0x42da8d){return _0x42da8d[_0x3939('0x27')](_0xad8511)[_0x3939('0x28')](function(_0x5c7412){return _0x5c7412;});}return null;};}function removeEntity(_0x379520,_0x18e3e9){return function(_0x42c3de){if(_0x42c3de){return _0x42c3de[_0x3939('0x29')]()['then'](function(){_0x379520[_0x3939('0x1c')](0xcc)[_0x3939('0x1b')]();});}};}function handleEntityNotFound(_0x5c9c3a,_0xaec292){return function(_0x5a5e8){if(!_0x5a5e8){_0x5c9c3a[_0x3939('0x1a')](0x194);}return _0x5a5e8;};}function handleError(_0x3c533e,_0x3d14e2){_0x3d14e2=_0x3d14e2||0x1f4;return function(_0x43d548){logger[_0x3939('0x2a')](_0x43d548[_0x3939('0x2b')]);if(_0x43d548[_0x3939('0x2c')]){delete _0x43d548[_0x3939('0x2c')];}_0x3c533e[_0x3939('0x1c')](_0x3d14e2)[_0x3939('0x2d')](_0x43d548);};}exports[_0x3939('0x2e')]=function(_0x1800c4,_0xb34565){var _0xaae29b={},_0x11ae7b={},_0x39df5a={'count':0x0,'rows':[]};var _0x36b639=_['map'](db[_0x3939('0x2f')][_0x3939('0x30')],function(_0x5ada7d){return{'name':_0x5ada7d['fieldName'],'type':_0x5ada7d['type'][_0x3939('0x31')]};});_0x11ae7b[_0x3939('0x32')]=_[_0x3939('0x33')](_0x36b639,_0x3939('0x2c'));_0x11ae7b[_0x3939('0x34')]=_[_0x3939('0x35')](_0x1800c4['query']);_0x11ae7b[_0x3939('0x36')]=_['intersection'](_0x11ae7b[_0x3939('0x32')],_0x11ae7b[_0x3939('0x34')]);_0xaae29b['attributes']=_[_0x3939('0x37')](_0x11ae7b['model'],qs[_0x3939('0x38')](_0x1800c4[_0x3939('0x34')]['fields']));_0xaae29b[_0x3939('0x39')]=_0xaae29b[_0x3939('0x39')][_0x3939('0x3a')]?_0xaae29b[_0x3939('0x39')]:_0x11ae7b[_0x3939('0x32')];if(!_0x1800c4[_0x3939('0x34')][_0x3939('0x3b')](_0x3939('0x3c'))){_0xaae29b[_0x3939('0x1f')]=qs[_0x3939('0x1f')](_0x1800c4['query'][_0x3939('0x1f')]);_0xaae29b[_0x3939('0x20')]=qs[_0x3939('0x20')](_0x1800c4[_0x3939('0x34')][_0x3939('0x20')]);}_0xaae29b[_0x3939('0x3d')]=qs[_0x3939('0x3e')](_0x1800c4[_0x3939('0x34')][_0x3939('0x3e')]);_0xaae29b[_0x3939('0x3f')]=qs[_0x3939('0x36')](_['pick'](_0x1800c4['query'],_0x11ae7b['filters']),_0x36b639);if(_0x1800c4[_0x3939('0x34')]['filter']){_0xaae29b[_0x3939('0x3f')]=_[_0x3939('0x40')](_0xaae29b[_0x3939('0x3f')],{'$or':_[_0x3939('0x33')](_0x36b639,function(_0x9300f6){if(_0x9300f6[_0x3939('0x41')]!==_0x3939('0x42')){var _0x3af6aa={};_0x3af6aa[_0x9300f6[_0x3939('0x2c')]]={'$like':'%'+_0x1800c4[_0x3939('0x34')][_0x3939('0x43')]+'%'};return _0x3af6aa;}})});}_0xaae29b=_[_0x3939('0x40')]({},_0xaae29b,_0x1800c4[_0x3939('0x44')]);var _0x5ce1b9={'where':_0xaae29b[_0x3939('0x3f')]};return db[_0x3939('0x2f')][_0x3939('0x21')](_0x5ce1b9)[_0x3939('0x28')](function(_0x3c1d01){_0x39df5a[_0x3939('0x21')]=_0x3c1d01;if(_0x1800c4[_0x3939('0x34')][_0x3939('0x45')]){_0xaae29b[_0x3939('0x46')]=[{'all':!![]}];}return db[_0x3939('0x2f')][_0x3939('0x47')](_0xaae29b);})[_0x3939('0x28')](function(_0xaeadd8){_0x39df5a[_0x3939('0x48')]=_0xaeadd8;return _0x39df5a;})[_0x3939('0x28')](respondWithFilteredResult(_0xb34565,_0xaae29b))[_0x3939('0x49')](handleError(_0xb34565,null));};exports[_0x3939('0x4a')]=function(_0x3aa424,_0x2b6173){var _0x14fe84={'raw':!![],'where':{'id':_0x3aa424[_0x3939('0x4b')]['id']}},_0x402854={};_0x402854[_0x3939('0x32')]=_[_0x3939('0x35')](db[_0x3939('0x2f')][_0x3939('0x30')]);_0x402854[_0x3939('0x34')]=_[_0x3939('0x35')](_0x3aa424[_0x3939('0x34')]);_0x402854[_0x3939('0x36')]=_[_0x3939('0x37')](_0x402854[_0x3939('0x32')],_0x402854[_0x3939('0x34')]);_0x14fe84[_0x3939('0x39')]=_[_0x3939('0x37')](_0x402854[_0x3939('0x32')],qs['fields'](_0x3aa424[_0x3939('0x34')][_0x3939('0x38')]));_0x14fe84['attributes']=_0x14fe84[_0x3939('0x39')]['length']?_0x14fe84[_0x3939('0x39')]:_0x402854[_0x3939('0x32')];if(_0x3aa424[_0x3939('0x34')][_0x3939('0x45')]){_0x14fe84['include']=[{'all':!![]}];}_0x14fe84=_[_0x3939('0x40')]({},_0x14fe84,_0x3aa424[_0x3939('0x44')]);return db[_0x3939('0x2f')][_0x3939('0x4c')](_0x14fe84)[_0x3939('0x28')](handleEntityNotFound(_0x2b6173,null))['then'](respondWithResult(_0x2b6173,null))[_0x3939('0x49')](handleError(_0x2b6173,null));};exports['create']=function(_0x271802,_0x313c76){return db[_0x3939('0x2f')][_0x3939('0x4d')](_0x271802['body'],{})[_0x3939('0x28')](respondWithResult(_0x313c76,0xc9))[_0x3939('0x49')](handleError(_0x313c76,null));};exports[_0x3939('0x27')]=function(_0x44bb60,_0x5e6d13){if(_0x44bb60[_0x3939('0x4e')]['id']){delete _0x44bb60['body']['id'];}return db[_0x3939('0x2f')][_0x3939('0x4c')]({'where':{'id':_0x44bb60[_0x3939('0x4b')]['id']}})[_0x3939('0x28')](handleEntityNotFound(_0x5e6d13,null))['then'](saveUpdates(_0x44bb60[_0x3939('0x4e')],null))['then'](respondWithResult(_0x5e6d13,null))['catch'](handleError(_0x5e6d13,null));};exports['destroy']=function(_0x550ec0,_0x17634d){return db[_0x3939('0x2f')][_0x3939('0x4c')]({'where':{'id':_0x550ec0[_0x3939('0x4b')]['id']}})[_0x3939('0x28')](handleEntityNotFound(_0x17634d,null))[_0x3939('0x28')](removeEntity(_0x17634d,null))['catch'](handleError(_0x17634d,null));};exports['describe']=function(_0x4d31ea,_0x5de92c){return db[_0x3939('0x2f')][_0x3939('0x4f')]()[_0x3939('0x28')](respondWithResult(_0x5de92c,null))[_0x3939('0x49')](handleError(_0x5de92c,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index e9cd9b4..d5c1250 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 _0x9be2=['rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x9be2,0x85));var _0x29be=function(_0x587b2b,_0x215ce5){_0x587b2b=_0x587b2b-0x0;var _0x95ae76=_0x9be2[_0x587b2b];return _0x95ae76;};'use strict';var _=require(_0x29be('0x0'));var util=require(_0x29be('0x1'));var logger=require(_0x29be('0x2'))('api');var moment=require(_0x29be('0x3'));var BPromise=require(_0x29be('0x4'));var rp=require(_0x29be('0x5'));var fs=require('fs');var path=require(_0x29be('0x6'));var rimraf=require(_0x29be('0x7'));var config=require(_0x29be('0x8'));var attributes=require(_0x29be('0x9'));module[_0x29be('0xa')]=function(_0x259217,_0x29c580){return _0x259217[_0x29be('0xb')](_0x29be('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x29be('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfad1=['FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','define'];(function(_0x1c2e8e,_0x168e8a){var _0x3db1ab=function(_0x2c285b){while(--_0x2c285b){_0x1c2e8e['push'](_0x1c2e8e['shift']());}};_0x3db1ab(++_0x168e8a);}(_0xfad1,0xd3));var _0x1fad=function(_0x15a0be,_0x52dbbb){_0x15a0be=_0x15a0be-0x0;var _0x1e8ead=_0xfad1[_0x15a0be];return _0x1e8ead;};'use strict';var _=require('lodash');var util=require(_0x1fad('0x0'));var logger=require(_0x1fad('0x1'))('api');var moment=require(_0x1fad('0x2'));var BPromise=require(_0x1fad('0x3'));var rp=require(_0x1fad('0x4'));var fs=require('fs');var path=require(_0x1fad('0x5'));var rimraf=require(_0x1fad('0x6'));var config=require('../../config/environment');var attributes=require(_0x1fad('0x7'));module[_0x1fad('0x8')]=function(_0x56aac3,_0x5f4a4c){return _0x56aac3[_0x1fad('0x9')](_0x1fad('0xa'),attributes,{'tableName':_0x1fad('0xb'),'paranoid':![],'indexes':[{'name':_0x1fad('0xc'),'fields':[_0x1fad('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 07f0f2c..a989071 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 _0xdabe=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xdabe,0x9b));var _0xedab=function(_0x4bbe6c,_0x47e67a){_0x4bbe6c=_0x4bbe6c-0x0;var _0x1d519a=_0xdabe[_0x4bbe6c];return _0x1d519a;};'use strict';var _=require(_0xedab('0x0'));var util=require(_0xedab('0x1'));var moment=require(_0xedab('0x2'));var BPromise=require('bluebird');var rs=require(_0xedab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedab('0x4'))['db'];var utils=require(_0xedab('0x5'));var logger=require(_0xedab('0x6'))('rpc');var config=require(_0xedab('0x7'));var jayson=require(_0xedab('0x8'));var client=jayson['client'][_0xedab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58a4f5,_0x20ba0a,_0x1d04f2){return new BPromise(function(_0x8aed64,_0x4e8f4a){return client[_0xedab('0xa')](_0x58a4f5,_0x1d04f2)[_0xedab('0xb')](function(_0x276dee){logger[_0xedab('0xc')](_0xedab('0xd'),_0x20ba0a,_0xedab('0xe'));logger[_0xedab('0xf')](_0xedab('0x10'),_0x20ba0a,_0xedab('0xe'),JSON[_0xedab('0x11')](_0x276dee));if(_0x276dee['error']){if(_0x276dee[_0xedab('0x12')][_0xedab('0x13')]===0x1f4){logger[_0xedab('0x12')](_0xedab('0xd'),_0x20ba0a,_0x276dee['error'][_0xedab('0x14')]);return _0x4e8f4a(_0x276dee[_0xedab('0x12')][_0xedab('0x14')]);}logger[_0xedab('0x12')](_0xedab('0xd'),_0x20ba0a,_0x276dee[_0xedab('0x12')][_0xedab('0x14')]);return _0x8aed64(_0x276dee[_0xedab('0x12')]['message']);}else{logger[_0xedab('0xc')](_0xedab('0xd'),_0x20ba0a,'request\x20sent');_0x8aed64(_0x276dee[_0xedab('0x15')]['message']);}})[_0xedab('0x16')](function(_0x3e3613){logger[_0xedab('0x12')](_0xedab('0xd'),_0x20ba0a,_0x3e3613);_0x4e8f4a(_0x3e3613);});});} \ No newline at end of file +var _0xfd89=['../../config/logger','rpc','client','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x49a950,_0x449851){var _0x62f04b=function(_0x250ff5){while(--_0x250ff5){_0x49a950['push'](_0x49a950['shift']());}};_0x62f04b(++_0x449851);}(_0xfd89,0x186));var _0x9fd8=function(_0x2da8c5,_0x6f64a1){_0x2da8c5=_0x2da8c5-0x0;var _0x26c5ea=_0xfd89[_0x2da8c5];return _0x26c5ea;};'use strict';var _=require(_0x9fd8('0x0'));var util=require(_0x9fd8('0x1'));var moment=require(_0x9fd8('0x2'));var BPromise=require('bluebird');var rs=require(_0x9fd8('0x3'));var fs=require('fs');var Redis=require(_0x9fd8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9fd8('0x5'));var logger=require(_0x9fd8('0x6'))(_0x9fd8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9fd8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38e4d9,_0x7e2dae,_0x1bc491){return new BPromise(function(_0x5cefa9,_0x1b8686){return client[_0x9fd8('0x9')](_0x38e4d9,_0x1bc491)[_0x9fd8('0xa')](function(_0x450f83){logger[_0x9fd8('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x7e2dae,_0x9fd8('0xc'));logger[_0x9fd8('0xd')](_0x9fd8('0xe'),_0x7e2dae,_0x9fd8('0xc'),JSON[_0x9fd8('0xf')](_0x450f83));if(_0x450f83[_0x9fd8('0x10')]){if(_0x450f83[_0x9fd8('0x10')][_0x9fd8('0x11')]===0x1f4){logger[_0x9fd8('0x10')](_0x9fd8('0x12'),_0x7e2dae,_0x450f83[_0x9fd8('0x10')][_0x9fd8('0x13')]);return _0x1b8686(_0x450f83['error'][_0x9fd8('0x13')]);}logger['error'](_0x9fd8('0x12'),_0x7e2dae,_0x450f83[_0x9fd8('0x10')]['message']);return _0x5cefa9(_0x450f83[_0x9fd8('0x10')][_0x9fd8('0x13')]);}else{logger['info'](_0x9fd8('0x12'),_0x7e2dae,_0x9fd8('0xc'));_0x5cefa9(_0x450f83[_0x9fd8('0x14')][_0x9fd8('0x13')]);}})[_0x9fd8('0x15')](function(_0x1619b0){logger[_0x9fd8('0x10')](_0x9fd8('0x12'),_0x7e2dae,_0x1619b0);_0x1b8686(_0x1619b0);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 69f8866..302acb0 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 _0x668d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','create','put','update','/:id','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x668d,0x1a2));var _0xd668=function(_0x33832f,_0x40c45f){_0x33832f=_0x33832f-0x0;var _0x575466=_0x668d[_0x33832f];return _0x575466;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd668('0x0'));var timeout=require(_0xd668('0x1'));var express=require(_0xd668('0x2'));var router=express[_0xd668('0x3')]();var fs_extra=require(_0xd668('0x4'));var auth=require(_0xd668('0x5'));var interaction=require(_0xd668('0x6'));var config=require(_0xd668('0x7'));var controller=require(_0xd668('0x8'));router[_0xd668('0x9')]('/',auth[_0xd668('0xa')](),controller['index']);router[_0xd668('0x9')](_0xd668('0xb'),auth[_0xd668('0xa')](),controller[_0xd668('0xc')]);router[_0xd668('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd668('0xa')](),controller[_0xd668('0xd')]);router[_0xd668('0xe')]('/:id',auth[_0xd668('0xa')](),controller[_0xd668('0xf')]);router['delete'](_0xd668('0x10'),auth['isAuthenticated'](),controller[_0xd668('0x11')]);module[_0xd668('0x12')]=router; \ No newline at end of file +var _0xa5ee=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','describe','/:id','show','create','put','delete','destroy','exports','multer','util','path'];(function(_0x3466a8,_0x99c531){var _0x452d3d=function(_0x173424){while(--_0x173424){_0x3466a8['push'](_0x3466a8['shift']());}};_0x452d3d(++_0x99c531);}(_0xa5ee,0xa8));var _0xea5e=function(_0x5a461b,_0x104cf5){_0x5a461b=_0x5a461b-0x0;var _0x5232f8=_0xa5ee[_0x5a461b];return _0x5232f8;};'use strict';var multer=require(_0xea5e('0x0'));var util=require(_0xea5e('0x1'));var path=require(_0xea5e('0x2'));var timeout=require(_0xea5e('0x3'));var express=require(_0xea5e('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xea5e('0x5'));var interaction=require(_0xea5e('0x6'));var config=require(_0xea5e('0x7'));var controller=require(_0xea5e('0x8'));router[_0xea5e('0x9')]('/',auth[_0xea5e('0xa')](),controller['index']);router[_0xea5e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xea5e('0xb')]);router[_0xea5e('0x9')](_0xea5e('0xc'),auth['isAuthenticated'](),controller[_0xea5e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xea5e('0xe')]);router[_0xea5e('0xf')](_0xea5e('0xc'),auth[_0xea5e('0xa')](),controller['update']);router[_0xea5e('0x10')](_0xea5e('0xc'),auth[_0xea5e('0xa')](),controller[_0xea5e('0x11')]);module[_0xea5e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 154e757..a5d9ec1 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 _0xb72d=['addConfiguration','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create'];(function(_0x13d615,_0x2c5b8b){var _0x3478bd=function(_0x5aa9ea){while(--_0x5aa9ea){_0x13d615['push'](_0x13d615['shift']());}};_0x3478bd(++_0x2c5b8b);}(_0xb72d,0x88));var _0xdb72=function(_0x52997d,_0x597a7d){_0x52997d=_0x52997d-0x0;var _0xe85e00=_0xb72d[_0x52997d];return _0xe85e00;};'use strict';var multer=require(_0xdb72('0x0'));var util=require(_0xdb72('0x1'));var path=require(_0xdb72('0x2'));var timeout=require(_0xdb72('0x3'));var express=require(_0xdb72('0x4'));var router=express[_0xdb72('0x5')]();var fs_extra=require(_0xdb72('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdb72('0x7'));var config=require('../../config/environment');var controller=require(_0xdb72('0x8'));router[_0xdb72('0x9')]('/',auth[_0xdb72('0xa')](),controller[_0xdb72('0xb')]);router['get'](_0xdb72('0xc'),auth[_0xdb72('0xa')](),controller['show']);router[_0xdb72('0x9')](_0xdb72('0xd'),auth['isAuthenticated'](),controller[_0xdb72('0xe')]);router[_0xdb72('0x9')](_0xdb72('0xf'),auth['isAuthenticated'](),controller[_0xdb72('0x10')]);router['post']('/',auth[_0xdb72('0xa')](),controller[_0xdb72('0x11')]);router['post'](_0xdb72('0xd'),auth[_0xdb72('0xa')](),controller[_0xdb72('0x12')]);router[_0xdb72('0x13')](_0xdb72('0xc'),auth[_0xdb72('0xa')](),controller[_0xdb72('0x14')]);router['delete'](_0xdb72('0xc'),auth[_0xdb72('0xa')](),controller[_0xdb72('0x15')]);module['exports']=router; \ No newline at end of file +var _0x20f2=['/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x1bba6b,_0x54c76d){var _0x54b311=function(_0x47a554){while(--_0x47a554){_0x1bba6b['push'](_0x1bba6b['shift']());}};_0x54b311(++_0x54c76d);}(_0x20f2,0x1e6));var _0x220f=function(_0x5e9aee,_0x4d8277){_0x5e9aee=_0x5e9aee-0x0;var _0x59e353=_0x20f2[_0x5e9aee];return _0x59e353;};'use strict';var multer=require(_0x220f('0x0'));var util=require(_0x220f('0x1'));var path=require(_0x220f('0x2'));var timeout=require(_0x220f('0x3'));var express=require(_0x220f('0x4'));var router=express[_0x220f('0x5')]();var fs_extra=require(_0x220f('0x6'));var auth=require(_0x220f('0x7'));var interaction=require(_0x220f('0x8'));var config=require(_0x220f('0x9'));var controller=require(_0x220f('0xa'));router[_0x220f('0xb')]('/',auth[_0x220f('0xc')](),controller[_0x220f('0xd')]);router[_0x220f('0xb')](_0x220f('0xe'),auth['isAuthenticated'](),controller[_0x220f('0xf')]);router[_0x220f('0xb')](_0x220f('0x10'),auth[_0x220f('0xc')](),controller[_0x220f('0x11')]);router[_0x220f('0xb')](_0x220f('0x12'),auth[_0x220f('0xc')](),controller[_0x220f('0x13')]);router[_0x220f('0x14')]('/',auth[_0x220f('0xc')](),controller[_0x220f('0x15')]);router[_0x220f('0x14')](_0x220f('0x10'),auth[_0x220f('0xc')](),controller[_0x220f('0x16')]);router[_0x220f('0x17')]('/:id',auth[_0x220f('0xc')](),controller[_0x220f('0x18')]);router[_0x220f('0x19')](_0x220f('0xe'),auth[_0x220f('0xc')](),controller[_0x220f('0x1a')]);module[_0x220f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index e15a69a..47edd53 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 _0xd7d4=['ENUM','basic','integrationTab','newTab','sequelize','STRING'];(function(_0x556f4b,_0xd016bd){var _0x40f061=function(_0x281aca){while(--_0x281aca){_0x556f4b['push'](_0x556f4b['shift']());}};_0x40f061(++_0xd016bd);}(_0xd7d4,0x130));var _0x4d7d=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0xd7d4[_0x56b138];return _0x3df878;};'use strict';var Sequelize=require(_0x4d7d('0x0'));module['exports']={'name':{'type':Sequelize[_0x4d7d('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d7d('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x4d7d('0x2')](_0x4d7d('0x3')),'defaultValue':_0x4d7d('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x4d7d('0x1')]},'consumerSecret':{'type':Sequelize[_0x4d7d('0x1')]},'token':{'type':Sequelize[_0x4d7d('0x1')]},'tokenSecret':{'type':Sequelize[_0x4d7d('0x1')]},'serverUrl':{'type':Sequelize[_0x4d7d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4d7d('0x2')](_0x4d7d('0x4'),_0x4d7d('0x5')),'defaultValue':_0x4d7d('0x4')}}; \ No newline at end of file +var _0xa7a0=['ENUM','integrationTab','sequelize','exports','STRING'];(function(_0x27237c,_0x36f1d4){var _0x1f412e=function(_0x1ea8aa){while(--_0x1ea8aa){_0x27237c['push'](_0x27237c['shift']());}};_0x1f412e(++_0x36f1d4);}(_0xa7a0,0x70));var _0x0a7a=function(_0x2de4c3,_0x1dbc68){_0x2de4c3=_0x2de4c3-0x0;var _0x348a79=_0xa7a0[_0x2de4c3];return _0x348a79;};'use strict';var Sequelize=require(_0x0a7a('0x0'));module[_0x0a7a('0x1')]={'name':{'type':Sequelize[_0x0a7a('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0a7a('0x2')]},'remoteUri':{'type':Sequelize[_0x0a7a('0x2')]},'authType':{'type':Sequelize[_0x0a7a('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x0a7a('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x0a7a('0x2')]},'serverUrl':{'type':Sequelize[_0x0a7a('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a7a('0x4'),'newTab'),'defaultValue':_0x0a7a('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index e05140e..9230176 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 _0x51ae=['findOne','DeskConfiguration','filter','nolimit','getConfigurations','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','DeskField','Subjects','priority','remoteUri','authType','password','consumerKey','consumerSecret','tokenSecret','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Authorization','Basic\x20%s','username','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','name','send','index','map','DeskAccount','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy'];(function(_0x5b6375,_0x4d6280){var _0x17858d=function(_0x4bc1ae){while(--_0x4bc1ae){_0x5b6375['push'](_0x5b6375['shift']());}};_0x17858d(++_0x4d6280);}(_0x51ae,0x182));var _0xe51a=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x51ae[_0x2f3848];return _0x102668;};'use strict';var emlformat=require(_0xe51a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe51a('0x1'));var jsonpatch=require(_0xe51a('0x2'));var rp=require('request-promise');var moment=require(_0xe51a('0x3'));var BPromise=require(_0xe51a('0x4'));var Mustache=require(_0xe51a('0x5'));var util=require(_0xe51a('0x6'));var path=require(_0xe51a('0x7'));var sox=require(_0xe51a('0x8'));var csv=require(_0xe51a('0x9'));var ejs=require(_0xe51a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe51a('0xb'));var crypto=require('crypto');var jsforce=require(_0xe51a('0xc'));var deskjs=require(_0xe51a('0xd'));var toCsv=require(_0xe51a('0x9'));var querystring=require(_0xe51a('0xe'));var Papa=require(_0xe51a('0xf'));var Redis=require(_0xe51a('0x10'));var authService=require(_0xe51a('0x11'));var qs=require(_0xe51a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe51a('0x13'));var logger=require(_0xe51a('0x14'))(_0xe51a('0x15'));var utils=require(_0xe51a('0x16'));var config=require(_0xe51a('0x17'));var licenseUtil=require(_0xe51a('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe51a('0x19'));function respondWithStatusCode(_0x2b92bb,_0x115e8e){_0x115e8e=_0x115e8e||0xcc;return function(_0x3edbf1){if(_0x3edbf1){return _0x2b92bb[_0xe51a('0x1a')](_0x115e8e);}return _0x2b92bb[_0xe51a('0x1b')](_0x115e8e)[_0xe51a('0x1c')]();};}function respondWithResult(_0x582010,_0x221791){_0x221791=_0x221791||0xc8;return function(_0x24b657){if(_0x24b657){return _0x582010[_0xe51a('0x1b')](_0x221791)[_0xe51a('0x1d')](_0x24b657);}};}function respondWithFilteredResult(_0x46717c,_0x4155a4){return function(_0x22f99b){if(_0x22f99b){var _0x592226=typeof _0x4155a4[_0xe51a('0x1e')]===_0xe51a('0x1f')&&typeof _0x4155a4['limit']===_0xe51a('0x1f');var _0xe8b46b=_0x22f99b[_0xe51a('0x20')];var _0x1c33a8=_0x592226?0x0:_0x4155a4[_0xe51a('0x1e')];var _0x3046b3=_0x592226?_0x22f99b['count']:_0x4155a4[_0xe51a('0x1e')]+_0x4155a4[_0xe51a('0x21')];var _0x455f02;if(_0x3046b3>=_0xe8b46b){_0x3046b3=_0xe8b46b;_0x455f02=0xc8;}else{_0x455f02=0xce;}_0x46717c['status'](_0x455f02);return _0x46717c[_0xe51a('0x22')](_0xe51a('0x23'),_0x1c33a8+'-'+_0x3046b3+'/'+_0xe8b46b)[_0xe51a('0x1d')](_0x22f99b);}return null;};}function patchUpdates(_0x5cd81f){return function(_0x5cce32){try{jsonpatch[_0xe51a('0x24')](_0x5cce32,_0x5cd81f,!![]);}catch(_0x1be6b1){return BPromise[_0xe51a('0x25')](_0x1be6b1);}return _0x5cce32['save']();};}function saveUpdates(_0x3adb7d,_0x521190){return function(_0x290ef9){if(_0x290ef9){return _0x290ef9[_0xe51a('0x26')](_0x3adb7d)['then'](function(_0x2e79a3){return _0x2e79a3;});}return null;};}function removeEntity(_0x429d69,_0x388ccf){return function(_0x40d163){if(_0x40d163){return _0x40d163['destroy']()[_0xe51a('0x27')](function(){_0x429d69[_0xe51a('0x1b')](0xcc)[_0xe51a('0x1c')]();});}};}function handleEntityNotFound(_0x2cb02f,_0x5371ee){return function(_0x6bf68e){if(!_0x6bf68e){_0x2cb02f['sendStatus'](0x194);}return _0x6bf68e;};}function handleError(_0x4717c5,_0x21efda){_0x21efda=_0x21efda||0x1f4;return function(_0x12d8f1){logger[_0xe51a('0x28')](_0x12d8f1['stack']);if(_0x12d8f1[_0xe51a('0x29')]){delete _0x12d8f1[_0xe51a('0x29')];}_0x4717c5['status'](_0x21efda)[_0xe51a('0x2a')](_0x12d8f1);};}exports[_0xe51a('0x2b')]=function(_0x375d5d,_0x4d6b4c){var _0x230856={},_0x176f2a={},_0x68547={'count':0x0,'rows':[]};var _0x2a8989=_[_0xe51a('0x2c')](db[_0xe51a('0x2d')][_0xe51a('0x2e')],function(_0x2494ce){return{'name':_0x2494ce['fieldName'],'type':_0x2494ce[_0xe51a('0x2f')]['key']};});_0x176f2a[_0xe51a('0x30')]=_['map'](_0x2a8989,_0xe51a('0x29'));_0x176f2a[_0xe51a('0x31')]=_['keys'](_0x375d5d['query']);_0x176f2a[_0xe51a('0x32')]=_[_0xe51a('0x33')](_0x176f2a[_0xe51a('0x30')],_0x176f2a[_0xe51a('0x31')]);_0x230856['attributes']=_[_0xe51a('0x33')](_0x176f2a['model'],qs[_0xe51a('0x34')](_0x375d5d[_0xe51a('0x31')][_0xe51a('0x34')]));_0x230856[_0xe51a('0x35')]=_0x230856[_0xe51a('0x35')][_0xe51a('0x36')]?_0x230856[_0xe51a('0x35')]:_0x176f2a[_0xe51a('0x30')];if(!_0x375d5d[_0xe51a('0x31')]['hasOwnProperty']('nolimit')){_0x230856[_0xe51a('0x21')]=qs[_0xe51a('0x21')](_0x375d5d[_0xe51a('0x31')][_0xe51a('0x21')]);_0x230856[_0xe51a('0x1e')]=qs[_0xe51a('0x1e')](_0x375d5d[_0xe51a('0x31')][_0xe51a('0x1e')]);}_0x230856[_0xe51a('0x37')]=qs[_0xe51a('0x38')](_0x375d5d['query'][_0xe51a('0x38')]);_0x230856[_0xe51a('0x39')]=qs[_0xe51a('0x32')](_[_0xe51a('0x3a')](_0x375d5d[_0xe51a('0x31')],_0x176f2a[_0xe51a('0x32')]),_0x2a8989);if(_0x375d5d[_0xe51a('0x31')]['filter']){_0x230856[_0xe51a('0x39')]=_[_0xe51a('0x3b')](_0x230856['where'],{'$or':_[_0xe51a('0x2c')](_0x2a8989,function(_0xadcaf1){if(_0xadcaf1[_0xe51a('0x2f')]!==_0xe51a('0x3c')){var _0x3711a9={};_0x3711a9[_0xadcaf1[_0xe51a('0x29')]]={'$like':'%'+_0x375d5d[_0xe51a('0x31')]['filter']+'%'};return _0x3711a9;}})});}_0x230856=_['merge']({},_0x230856,_0x375d5d[_0xe51a('0x3d')]);var _0x335954={'where':_0x230856[_0xe51a('0x39')]};return db[_0xe51a('0x2d')][_0xe51a('0x20')](_0x335954)[_0xe51a('0x27')](function(_0x44a08a){_0x68547['count']=_0x44a08a;if(_0x375d5d[_0xe51a('0x31')][_0xe51a('0x3e')]){_0x230856[_0xe51a('0x3f')]=[{'all':!![]}];}return db[_0xe51a('0x2d')][_0xe51a('0x40')](_0x230856);})[_0xe51a('0x27')](function(_0x8e2bef){_0x68547[_0xe51a('0x41')]=_0x8e2bef;return _0x68547;})[_0xe51a('0x27')](respondWithFilteredResult(_0x4d6b4c,_0x230856))[_0xe51a('0x42')](handleError(_0x4d6b4c,null));};exports[_0xe51a('0x43')]=function(_0x2a4f6f,_0xaa8e1a){var _0x2400d5={'raw':![],'where':{'id':_0x2a4f6f[_0xe51a('0x44')]['id']}},_0x50af58={};_0x50af58[_0xe51a('0x30')]=_[_0xe51a('0x45')](db[_0xe51a('0x2d')][_0xe51a('0x2e')]);_0x50af58['query']=_[_0xe51a('0x45')](_0x2a4f6f[_0xe51a('0x31')]);_0x50af58[_0xe51a('0x32')]=_[_0xe51a('0x33')](_0x50af58['model'],_0x50af58[_0xe51a('0x31')]);_0x2400d5[_0xe51a('0x35')]=_[_0xe51a('0x33')](_0x50af58['model'],qs[_0xe51a('0x34')](_0x2a4f6f[_0xe51a('0x31')]['fields']));_0x2400d5['attributes']=_0x2400d5['attributes'][_0xe51a('0x36')]?_0x2400d5['attributes']:_0x50af58[_0xe51a('0x30')];if(_0x2a4f6f[_0xe51a('0x31')][_0xe51a('0x3e')]){_0x2400d5[_0xe51a('0x3f')]=[{'all':!![]}];}_0x2400d5=_[_0xe51a('0x3b')]({},_0x2400d5,_0x2a4f6f[_0xe51a('0x3d')]);return db[_0xe51a('0x2d')][_0xe51a('0x46')](_0x2400d5)[_0xe51a('0x27')](handleEntityNotFound(_0xaa8e1a,null))['then'](respondWithResult(_0xaa8e1a,null))[_0xe51a('0x42')](handleError(_0xaa8e1a,null));};exports[_0xe51a('0x47')]=function(_0x4c8375,_0x2b2e20){return db[_0xe51a('0x2d')][_0xe51a('0x47')](_0x4c8375['body'],{})[_0xe51a('0x27')](respondWithResult(_0x2b2e20,0xc9))['catch'](handleError(_0x2b2e20,null));};exports[_0xe51a('0x26')]=function(_0x3bf91a,_0x57dfbe){if(_0x3bf91a['body']['id']){delete _0x3bf91a[_0xe51a('0x48')]['id'];}return db[_0xe51a('0x2d')][_0xe51a('0x46')]({'where':{'id':_0x3bf91a[_0xe51a('0x44')]['id']}})[_0xe51a('0x27')](handleEntityNotFound(_0x57dfbe,null))[_0xe51a('0x27')](saveUpdates(_0x3bf91a[_0xe51a('0x48')],null))[_0xe51a('0x27')](respondWithResult(_0x57dfbe,null))[_0xe51a('0x42')](handleError(_0x57dfbe,null));};exports[_0xe51a('0x49')]=function(_0x330d15,_0x36a991){return db[_0xe51a('0x2d')][_0xe51a('0x46')]({'where':{'id':_0x330d15['params']['id']}})['then'](handleEntityNotFound(_0x36a991,null))[_0xe51a('0x27')](removeEntity(_0x36a991,null))['catch'](handleError(_0x36a991,null));};exports['getConfigurations']=function(_0x49b740,_0x5254e2,_0x189cc9){var _0x1e0128={};var _0x56bc70={};var _0x10241;var _0x5cdf33;return db[_0xe51a('0x2d')][_0xe51a('0x4a')]({'where':{'id':_0x49b740['params']['id']}})[_0xe51a('0x27')](handleEntityNotFound(_0x5254e2,null))[_0xe51a('0x27')](function(_0x294646){if(_0x294646){_0x10241=_0x294646;_0x56bc70['model']=_[_0xe51a('0x45')](db[_0xe51a('0x4b')]['rawAttributes']);_0x56bc70[_0xe51a('0x31')]=_['keys'](_0x49b740[_0xe51a('0x31')]);_0x56bc70[_0xe51a('0x32')]=_[_0xe51a('0x33')](_0x56bc70[_0xe51a('0x30')],_0x56bc70[_0xe51a('0x31')]);_0x1e0128['attributes']=_[_0xe51a('0x33')](_0x56bc70[_0xe51a('0x30')],qs['fields'](_0x49b740[_0xe51a('0x31')]['fields']));_0x1e0128[_0xe51a('0x35')]=_0x1e0128['attributes']['length']?_0x1e0128['attributes']:_0x56bc70[_0xe51a('0x30')];_0x1e0128['order']=qs['sort'](_0x49b740['query'][_0xe51a('0x38')]);_0x1e0128[_0xe51a('0x39')]=qs[_0xe51a('0x32')](_[_0xe51a('0x3a')](_0x49b740[_0xe51a('0x31')],_0x56bc70[_0xe51a('0x32')]));if(_0x49b740[_0xe51a('0x31')][_0xe51a('0x4c')]){_0x1e0128[_0xe51a('0x39')]=_['merge'](_0x1e0128['where'],{'$or':_[_0xe51a('0x2c')](_0x1e0128[_0xe51a('0x35')],function(_0xda9695){var _0xdf682a={};_0xdf682a[_0xda9695]={'$like':'%'+_0x49b740[_0xe51a('0x31')][_0xe51a('0x4c')]+'%'};return _0xdf682a;})});}_0x1e0128=_[_0xe51a('0x3b')]({},_0x1e0128,_0x49b740[_0xe51a('0x3d')]);return _0x10241['getConfigurations'](_0x1e0128);}})[_0xe51a('0x27')](function(_0x3eacd4){if(_0x3eacd4){_0x5cdf33=_0x3eacd4[_0xe51a('0x36')];if(!_0x49b740[_0xe51a('0x31')]['hasOwnProperty'](_0xe51a('0x4d'))){_0x1e0128['limit']=qs[_0xe51a('0x21')](_0x49b740[_0xe51a('0x31')][_0xe51a('0x21')]);_0x1e0128['offset']=qs['offset'](_0x49b740[_0xe51a('0x31')]['offset']);}return _0x10241[_0xe51a('0x4e')](_0x1e0128);}})[_0xe51a('0x27')](function(_0x566b2a){if(_0x566b2a){return _0x566b2a?{'count':_0x5cdf33,'rows':_0x566b2a}:null;}})[_0xe51a('0x27')](respondWithResult(_0x5254e2,null))[_0xe51a('0x42')](handleError(_0x5254e2,null));};exports[_0xe51a('0x4f')]=function(_0x3ec301,_0x56cf08,_0x2f74bf){if(_0x3ec301[_0xe51a('0x48')]['id']){delete _0x3ec301[_0xe51a('0x48')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x3ec301[_0xe51a('0x44')]['id']}})[_0xe51a('0x27')](handleEntityNotFound(_0x56cf08,null))[_0xe51a('0x27')](function(_0x5b4ee5){if(_0x5b4ee5){_0x3ec301[_0xe51a('0x48')]['AccountId']=_0x5b4ee5['id'];_0x3ec301[_0xe51a('0x48')]['Subjects']=integrations[_0xe51a('0x50')](_0x3ec301[_0xe51a('0x48')][_0xe51a('0x51')],_0x3ec301[_0xe51a('0x48')][_0xe51a('0x2f')]);_0x3ec301[_0xe51a('0x48')][_0xe51a('0x52')]=integrations[_0xe51a('0x53')](_0x3ec301[_0xe51a('0x48')][_0xe51a('0x51')],_0x3ec301[_0xe51a('0x48')]['type']);return db[_0xe51a('0x4b')]['create'](_0x3ec301[_0xe51a('0x48')],{'include':[{'model':db[_0xe51a('0x54')],'as':_0xe51a('0x55')},{'model':db['DeskField'],'as':_0xe51a('0x52')}]});}return null;})['then'](respondWithResult(_0x56cf08,null))[_0xe51a('0x42')](handleError(_0x56cf08,null));};exports['getFields']=function(_0x78e7e9,_0x4d09b9,_0x545524){var _0x10f679=[{'name':'priority','label':_0xe51a('0x56'),'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 _0x232718='';return db[_0xe51a('0x2d')]['findOne']({'where':{'id':_0x78e7e9[_0xe51a('0x44')]['id']},'attributes':['id',_0xe51a('0x57'),_0xe51a('0x58'),'username',_0xe51a('0x59'),_0xe51a('0x5a'),_0xe51a('0x5b'),'token',_0xe51a('0x5c')]})[_0xe51a('0x27')](handleEntityNotFound(_0x4d09b9,null))[_0xe51a('0x27')](function(_0x1b2a4d){if(_0x1b2a4d){_0x232718=_0x1b2a4d['remoteUri'];var _0x205d5=_0x232718['slice'](-0x1);if(_0x205d5==='/'){_0x232718=_0x232718[_0xe51a('0x5d')](0x0,_0x232718[_0xe51a('0x5e')](_0x205d5));}var _0x2165c1={'method':_0xe51a('0x5f'),'uri':util[_0xe51a('0x60')](_0xe51a('0x61'),_0x232718),'headers':{'Content-Type':_0xe51a('0x62'),'Accept':_0xe51a('0x62')},'json':!![]};if(_0x1b2a4d[_0xe51a('0x58')]==='basic'){_0x2165c1[_0xe51a('0x63')][_0xe51a('0x64')]=util[_0xe51a('0x60')](_0xe51a('0x65'),new Buffer(util['format']('%s:%s',_0x1b2a4d[_0xe51a('0x66')],_0x1b2a4d['password']))['toString'](_0xe51a('0x67')));}return rp(_0x2165c1)[_0xe51a('0x27')](function(_0x496178){return _0x10f679[_0xe51a('0x68')](_[_0xe51a('0x2c')](_0x496178[_0xe51a('0x69')][_0xe51a('0x6a')],function(_0x1a85eb){return{'id':_0x1a85eb[_0xe51a('0x29')],'name':_0x1a85eb[_0xe51a('0x29')],'type':_0x1a85eb[_0xe51a('0x2f')],'active':_0x1a85eb[_0xe51a('0x6b')],'label':_0x1a85eb[_0xe51a('0x6c')],'custom':!![]};}));});}})[_0xe51a('0x27')](function(_0x4f6ee3){return{'count':_0x4f6ee3['length'],'rows':_0x4f6ee3};})[_0xe51a('0x27')](respondWithResult(_0x4d09b9,null))[_0xe51a('0x42')](function(_0x39e19b){var _0x16bba1=_0x78e7e9[_0xe51a('0x31')][_0xe51a('0x6d')]?0x1f4:_0x39e19b[_0xe51a('0x6e')]||0x1f4;logger[_0xe51a('0x28')](_0xe51a('0x6f'),_0xe51a('0x70'),_0x16bba1,JSON[_0xe51a('0x71')](_0x39e19b));delete _0x39e19b[_0xe51a('0x29')];if(_0x16bba1===0x191){_0x16bba1=0x190;}_0x4d09b9['status'](_0x16bba1)[_0xe51a('0x2a')](_0x78e7e9['query']['test']?{'message':_0xe51a('0x72'),'statusCode':_0x39e19b['statusCode']}:_0x39e19b);});}; \ No newline at end of file +var _0x797d=['headers','Authorization','Basic\x20%s','username','password','toString','concat','_embedded','entries','active','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','include','findAll','rows','catch','show','options','find','create','body','params','findOne','DeskConfiguration','getConfigurations','nolimit','Descriptions','channel','DeskField','priority','remoteUri','authType','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','application/json','basic'];(function(_0x41bdd4,_0x3d5c76){var _0x5c03a6=function(_0x59634a){while(--_0x59634a){_0x41bdd4['push'](_0x41bdd4['shift']());}};_0x5c03a6(++_0x3d5c76);}(_0x797d,0x7c));var _0xd797=function(_0x45b89e,_0x426d42){_0x45b89e=_0x45b89e-0x0;var _0x1fdb9a=_0x797d[_0x45b89e];return _0x1fdb9a;};'use strict';var emlformat=require(_0xd797('0x0'));var rimraf=require(_0xd797('0x1'));var zipdir=require(_0xd797('0x2'));var jsonpatch=require(_0xd797('0x3'));var rp=require(_0xd797('0x4'));var moment=require(_0xd797('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd797('0x6'));var util=require(_0xd797('0x7'));var path=require(_0xd797('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd797('0x9'));var fs=require('fs');var fs_extra=require(_0xd797('0xa'));var _=require(_0xd797('0xb'));var squel=require(_0xd797('0xc'));var crypto=require('crypto');var jsforce=require(_0xd797('0xd'));var deskjs=require(_0xd797('0xe'));var toCsv=require(_0xd797('0xf'));var querystring=require(_0xd797('0x10'));var Papa=require(_0xd797('0x11'));var Redis=require(_0xd797('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd797('0x13'));var hardwareService=require(_0xd797('0x14'));var logger=require(_0xd797('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd797('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4db93a,_0x201057){_0x201057=_0x201057||0xcc;return function(_0x1d327f){if(_0x1d327f){return _0x4db93a[_0xd797('0x17')](_0x201057);}return _0x4db93a['status'](_0x201057)[_0xd797('0x18')]();};}function respondWithResult(_0x530685,_0x7c735){_0x7c735=_0x7c735||0xc8;return function(_0x42b7a9){if(_0x42b7a9){return _0x530685[_0xd797('0x19')](_0x7c735)['json'](_0x42b7a9);}};}function respondWithFilteredResult(_0x1a2406,_0x19b047){return function(_0x12fe09){if(_0x12fe09){var _0x438f6e=typeof _0x19b047[_0xd797('0x1a')]===_0xd797('0x1b')&&typeof _0x19b047[_0xd797('0x1c')]===_0xd797('0x1b');var _0x4c5ecd=_0x12fe09[_0xd797('0x1d')];var _0x1a8a2=_0x438f6e?0x0:_0x19b047['offset'];var _0x3fc8ee=_0x438f6e?_0x12fe09[_0xd797('0x1d')]:_0x19b047['offset']+_0x19b047['limit'];var _0x604920;if(_0x3fc8ee>=_0x4c5ecd){_0x3fc8ee=_0x4c5ecd;_0x604920=0xc8;}else{_0x604920=0xce;}_0x1a2406[_0xd797('0x19')](_0x604920);return _0x1a2406[_0xd797('0x1e')](_0xd797('0x1f'),_0x1a8a2+'-'+_0x3fc8ee+'/'+_0x4c5ecd)[_0xd797('0x20')](_0x12fe09);}return null;};}function patchUpdates(_0x28a0e7){return function(_0xb8a027){try{jsonpatch['apply'](_0xb8a027,_0x28a0e7,!![]);}catch(_0x3d0b9c){return BPromise[_0xd797('0x21')](_0x3d0b9c);}return _0xb8a027[_0xd797('0x22')]();};}function saveUpdates(_0x1c8025,_0x144815){return function(_0x508e39){if(_0x508e39){return _0x508e39[_0xd797('0x23')](_0x1c8025)[_0xd797('0x24')](function(_0x1014a1){return _0x1014a1;});}return null;};}function removeEntity(_0x3c75d5,_0x1c3859){return function(_0x43d079){if(_0x43d079){return _0x43d079[_0xd797('0x25')]()[_0xd797('0x24')](function(){_0x3c75d5[_0xd797('0x19')](0xcc)[_0xd797('0x18')]();});}};}function handleEntityNotFound(_0x1fd015,_0x2f2e6c){return function(_0x575367){if(!_0x575367){_0x1fd015[_0xd797('0x17')](0x194);}return _0x575367;};}function handleError(_0x27b6bd,_0x36b790){_0x36b790=_0x36b790||0x1f4;return function(_0x5890e8){logger['error'](_0x5890e8[_0xd797('0x26')]);if(_0x5890e8[_0xd797('0x27')]){delete _0x5890e8['name'];}_0x27b6bd[_0xd797('0x19')](_0x36b790)[_0xd797('0x28')](_0x5890e8);};}exports[_0xd797('0x29')]=function(_0x443a8d,_0x24335d){var _0x4528e8={},_0x315ded={},_0x28c460={'count':0x0,'rows':[]};var _0xdbc24c=_[_0xd797('0x2a')](db[_0xd797('0x2b')][_0xd797('0x2c')],function(_0x417398){return{'name':_0x417398[_0xd797('0x2d')],'type':_0x417398[_0xd797('0x2e')][_0xd797('0x2f')]};});_0x315ded[_0xd797('0x30')]=_[_0xd797('0x2a')](_0xdbc24c,_0xd797('0x27'));_0x315ded[_0xd797('0x31')]=_[_0xd797('0x32')](_0x443a8d[_0xd797('0x31')]);_0x315ded[_0xd797('0x33')]=_[_0xd797('0x34')](_0x315ded[_0xd797('0x30')],_0x315ded['query']);_0x4528e8[_0xd797('0x35')]=_[_0xd797('0x34')](_0x315ded[_0xd797('0x30')],qs['fields'](_0x443a8d[_0xd797('0x31')][_0xd797('0x36')]));_0x4528e8[_0xd797('0x35')]=_0x4528e8[_0xd797('0x35')][_0xd797('0x37')]?_0x4528e8[_0xd797('0x35')]:_0x315ded[_0xd797('0x30')];if(!_0x443a8d[_0xd797('0x31')]['hasOwnProperty']('nolimit')){_0x4528e8[_0xd797('0x1c')]=qs[_0xd797('0x1c')](_0x443a8d[_0xd797('0x31')][_0xd797('0x1c')]);_0x4528e8[_0xd797('0x1a')]=qs[_0xd797('0x1a')](_0x443a8d[_0xd797('0x31')][_0xd797('0x1a')]);}_0x4528e8[_0xd797('0x38')]=qs['sort'](_0x443a8d['query'][_0xd797('0x39')]);_0x4528e8[_0xd797('0x3a')]=qs['filters'](_['pick'](_0x443a8d['query'],_0x315ded[_0xd797('0x33')]),_0xdbc24c);if(_0x443a8d[_0xd797('0x31')][_0xd797('0x3b')]){_0x4528e8[_0xd797('0x3a')]=_['merge'](_0x4528e8[_0xd797('0x3a')],{'$or':_[_0xd797('0x2a')](_0xdbc24c,function(_0x1860c8){if(_0x1860c8[_0xd797('0x2e')]!=='VIRTUAL'){var _0x320d31={};_0x320d31[_0x1860c8[_0xd797('0x27')]]={'$like':'%'+_0x443a8d[_0xd797('0x31')][_0xd797('0x3b')]+'%'};return _0x320d31;}})});}_0x4528e8=_[_0xd797('0x3c')]({},_0x4528e8,_0x443a8d['options']);var _0x58bdf7={'where':_0x4528e8['where']};return db['DeskAccount'][_0xd797('0x1d')](_0x58bdf7)['then'](function(_0x411ab8){_0x28c460[_0xd797('0x1d')]=_0x411ab8;if(_0x443a8d[_0xd797('0x31')]['includeAll']){_0x4528e8[_0xd797('0x3d')]=[{'all':!![]}];}return db[_0xd797('0x2b')][_0xd797('0x3e')](_0x4528e8);})['then'](function(_0x38cb9f){_0x28c460[_0xd797('0x3f')]=_0x38cb9f;return _0x28c460;})['then'](respondWithFilteredResult(_0x24335d,_0x4528e8))[_0xd797('0x40')](handleError(_0x24335d,null));};exports[_0xd797('0x41')]=function(_0x9c3e56,_0x26c1ae){var _0x604c3b={'raw':![],'where':{'id':_0x9c3e56['params']['id']}},_0x5437ac={};_0x5437ac['model']=_[_0xd797('0x32')](db[_0xd797('0x2b')][_0xd797('0x2c')]);_0x5437ac[_0xd797('0x31')]=_[_0xd797('0x32')](_0x9c3e56['query']);_0x5437ac[_0xd797('0x33')]=_[_0xd797('0x34')](_0x5437ac[_0xd797('0x30')],_0x5437ac[_0xd797('0x31')]);_0x604c3b[_0xd797('0x35')]=_[_0xd797('0x34')](_0x5437ac[_0xd797('0x30')],qs[_0xd797('0x36')](_0x9c3e56[_0xd797('0x31')][_0xd797('0x36')]));_0x604c3b[_0xd797('0x35')]=_0x604c3b[_0xd797('0x35')][_0xd797('0x37')]?_0x604c3b['attributes']:_0x5437ac[_0xd797('0x30')];if(_0x9c3e56[_0xd797('0x31')]['includeAll']){_0x604c3b[_0xd797('0x3d')]=[{'all':!![]}];}_0x604c3b=_[_0xd797('0x3c')]({},_0x604c3b,_0x9c3e56[_0xd797('0x42')]);return db[_0xd797('0x2b')][_0xd797('0x43')](_0x604c3b)[_0xd797('0x24')](handleEntityNotFound(_0x26c1ae,null))['then'](respondWithResult(_0x26c1ae,null))[_0xd797('0x40')](handleError(_0x26c1ae,null));};exports['create']=function(_0x44302e,_0x32db99){return db[_0xd797('0x2b')][_0xd797('0x44')](_0x44302e[_0xd797('0x45')],{})['then'](respondWithResult(_0x32db99,0xc9))[_0xd797('0x40')](handleError(_0x32db99,null));};exports[_0xd797('0x23')]=function(_0x2ce77d,_0x2b4abe){if(_0x2ce77d[_0xd797('0x45')]['id']){delete _0x2ce77d['body']['id'];}return db[_0xd797('0x2b')]['find']({'where':{'id':_0x2ce77d['params']['id']}})[_0xd797('0x24')](handleEntityNotFound(_0x2b4abe,null))[_0xd797('0x24')](saveUpdates(_0x2ce77d[_0xd797('0x45')],null))[_0xd797('0x24')](respondWithResult(_0x2b4abe,null))['catch'](handleError(_0x2b4abe,null));};exports['destroy']=function(_0x4b2089,_0x2e4cc0){return db[_0xd797('0x2b')][_0xd797('0x43')]({'where':{'id':_0x4b2089[_0xd797('0x46')]['id']}})[_0xd797('0x24')](handleEntityNotFound(_0x2e4cc0,null))[_0xd797('0x24')](removeEntity(_0x2e4cc0,null))[_0xd797('0x40')](handleError(_0x2e4cc0,null));};exports['getConfigurations']=function(_0x3cf4f3,_0x4ec5bd,_0x40227d){var _0x416b9d={};var _0x292240={};var _0x26d815;var _0x42e83b;return db['DeskAccount'][_0xd797('0x47')]({'where':{'id':_0x3cf4f3[_0xd797('0x46')]['id']}})[_0xd797('0x24')](handleEntityNotFound(_0x4ec5bd,null))[_0xd797('0x24')](function(_0x482504){if(_0x482504){_0x26d815=_0x482504;_0x292240['model']=_['keys'](db[_0xd797('0x48')]['rawAttributes']);_0x292240[_0xd797('0x31')]=_['keys'](_0x3cf4f3[_0xd797('0x31')]);_0x292240[_0xd797('0x33')]=_['intersection'](_0x292240['model'],_0x292240[_0xd797('0x31')]);_0x416b9d['attributes']=_[_0xd797('0x34')](_0x292240[_0xd797('0x30')],qs[_0xd797('0x36')](_0x3cf4f3[_0xd797('0x31')][_0xd797('0x36')]));_0x416b9d[_0xd797('0x35')]=_0x416b9d['attributes'][_0xd797('0x37')]?_0x416b9d['attributes']:_0x292240[_0xd797('0x30')];_0x416b9d[_0xd797('0x38')]=qs['sort'](_0x3cf4f3[_0xd797('0x31')]['sort']);_0x416b9d['where']=qs[_0xd797('0x33')](_['pick'](_0x3cf4f3[_0xd797('0x31')],_0x292240[_0xd797('0x33')]));if(_0x3cf4f3[_0xd797('0x31')][_0xd797('0x3b')]){_0x416b9d[_0xd797('0x3a')]=_[_0xd797('0x3c')](_0x416b9d['where'],{'$or':_[_0xd797('0x2a')](_0x416b9d['attributes'],function(_0xbf69d3){var _0x3f0b43={};_0x3f0b43[_0xbf69d3]={'$like':'%'+_0x3cf4f3[_0xd797('0x31')][_0xd797('0x3b')]+'%'};return _0x3f0b43;})});}_0x416b9d=_[_0xd797('0x3c')]({},_0x416b9d,_0x3cf4f3[_0xd797('0x42')]);return _0x26d815[_0xd797('0x49')](_0x416b9d);}})[_0xd797('0x24')](function(_0x5896bb){if(_0x5896bb){_0x42e83b=_0x5896bb['length'];if(!_0x3cf4f3[_0xd797('0x31')]['hasOwnProperty'](_0xd797('0x4a'))){_0x416b9d[_0xd797('0x1c')]=qs['limit'](_0x3cf4f3['query'][_0xd797('0x1c')]);_0x416b9d[_0xd797('0x1a')]=qs['offset'](_0x3cf4f3[_0xd797('0x31')][_0xd797('0x1a')]);}return _0x26d815[_0xd797('0x49')](_0x416b9d);}})[_0xd797('0x24')](function(_0x567137){if(_0x567137){return _0x567137?{'count':_0x42e83b,'rows':_0x567137}:null;}})[_0xd797('0x24')](respondWithResult(_0x4ec5bd,null))[_0xd797('0x40')](handleError(_0x4ec5bd,null));};exports['addConfiguration']=function(_0x5017fb,_0x46af5e,_0x22ed10){if(_0x5017fb['body']['id']){delete _0x5017fb['body']['id'];}return db[_0xd797('0x2b')][_0xd797('0x47')]({'where':{'id':_0x5017fb[_0xd797('0x46')]['id']}})[_0xd797('0x24')](handleEntityNotFound(_0x46af5e,null))[_0xd797('0x24')](function(_0x5602dd){if(_0x5602dd){_0x5017fb['body']['AccountId']=_0x5602dd['id'];_0x5017fb['body']['Subjects']=integrations['getSubjects'](_0x5017fb['body']['channel'],_0x5017fb['body'][_0xd797('0x2e')]);_0x5017fb['body'][_0xd797('0x4b')]=integrations['getDescriptions'](_0x5017fb[_0xd797('0x45')][_0xd797('0x4c')],_0x5017fb[_0xd797('0x45')][_0xd797('0x2e')]);return db[_0xd797('0x48')]['create'](_0x5017fb['body'],{'include':[{'model':db[_0xd797('0x4d')],'as':'Subjects'},{'model':db[_0xd797('0x4d')],'as':_0xd797('0x4b')}]});}return null;})[_0xd797('0x24')](respondWithResult(_0x46af5e,null))[_0xd797('0x40')](handleError(_0x46af5e,null));};exports['getFields']=function(_0x16ec03,_0x2756aa,_0x325d4e){var _0x2731aa=[{'name':'priority','label':_0xd797('0x4e'),'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 _0x212daf='';return db[_0xd797('0x2b')][_0xd797('0x47')]({'where':{'id':_0x16ec03[_0xd797('0x46')]['id']},'attributes':['id',_0xd797('0x4f'),_0xd797('0x50'),'username','password',_0xd797('0x51'),_0xd797('0x52'),_0xd797('0x53'),_0xd797('0x54')]})['then'](handleEntityNotFound(_0x2756aa,null))['then'](function(_0x5f17de){if(_0x5f17de){_0x212daf=_0x5f17de[_0xd797('0x4f')];var _0x1fd0e8=_0x212daf[_0xd797('0x55')](-0x1);if(_0x1fd0e8==='/'){_0x212daf=_0x212daf[_0xd797('0x56')](0x0,_0x212daf[_0xd797('0x57')](_0x1fd0e8));}var _0x274ea7={'method':_0xd797('0x58'),'uri':util[_0xd797('0x59')]('%s/custom_fields',_0x212daf),'headers':{'Content-Type':_0xd797('0x5a'),'Accept':_0xd797('0x5a')},'json':!![]};if(_0x5f17de['authType']===_0xd797('0x5b')){_0x274ea7[_0xd797('0x5c')][_0xd797('0x5d')]=util[_0xd797('0x59')](_0xd797('0x5e'),new Buffer(util['format']('%s:%s',_0x5f17de[_0xd797('0x5f')],_0x5f17de[_0xd797('0x60')]))[_0xd797('0x61')]('base64'));}return rp(_0x274ea7)[_0xd797('0x24')](function(_0x5a1634){return _0x2731aa[_0xd797('0x62')](_['map'](_0x5a1634[_0xd797('0x63')][_0xd797('0x64')],function(_0x53ad07){return{'id':_0x53ad07[_0xd797('0x27')],'name':_0x53ad07[_0xd797('0x27')],'type':_0x53ad07['type'],'active':_0x53ad07[_0xd797('0x65')],'label':_0x53ad07[_0xd797('0x66')],'custom':!![]};}));});}})['then'](function(_0x521c5e){return{'count':_0x521c5e['length'],'rows':_0x521c5e};})[_0xd797('0x24')](respondWithResult(_0x2756aa,null))[_0xd797('0x40')](function(_0x26f5a1){var _0x41ce6f=_0x16ec03['query'][_0xd797('0x67')]?0x1f4:_0x26f5a1[_0xd797('0x68')]||0x1f4;logger[_0xd797('0x69')](_0xd797('0x6a'),'getFields',_0x41ce6f,JSON['stringify'](_0x26f5a1));delete _0x26f5a1['name'];if(_0x41ce6f===0x191){_0x41ce6f=0x190;}_0x2756aa['status'](_0x41ce6f)[_0xd797('0x28')](_0x16ec03[_0xd797('0x31')][_0xd797('0x67')]?{'message':_0xd797('0x6b'),'statusCode':_0x26f5a1[_0xd797('0x68')]}:_0x26f5a1);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index d4ca664..21d2333 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 _0x880a=['int_desk_accounts','util','api','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','DeskAccount'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0x880a,0x9b));var _0xa880=function(_0x1aacfa,_0x353b2a){_0x1aacfa=_0x1aacfa-0x0;var _0x3cb1b9=_0x880a[_0x1aacfa];return _0x3cb1b9;};'use strict';var _=require('lodash');var util=require(_0xa880('0x0'));var logger=require('../../config/logger')(_0xa880('0x1'));var moment=require(_0xa880('0x2'));var BPromise=require(_0xa880('0x3'));var rp=require(_0xa880('0x4'));var fs=require('fs');var path=require(_0xa880('0x5'));var rimraf=require(_0xa880('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xa880('0x7'));module[_0xa880('0x8')]=function(_0x41794b,_0x1377aa){return _0x41794b['define'](_0xa880('0x9'),attributes,{'tableName':_0xa880('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa19=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','DeskAccount','lodash','util'];(function(_0x403cff,_0x1cf463){var _0x5a7c56=function(_0x1bab9d){while(--_0x1bab9d){_0x403cff['push'](_0x403cff['shift']());}};_0x5a7c56(++_0x1cf463);}(_0xaa19,0x18a));var _0x9aa1=function(_0x59ecf6,_0x113df8){_0x59ecf6=_0x59ecf6-0x0;var _0x182c3c=_0xaa19[_0x59ecf6];return _0x182c3c;};'use strict';var _=require(_0x9aa1('0x0'));var util=require(_0x9aa1('0x1'));var logger=require(_0x9aa1('0x2'))(_0x9aa1('0x3'));var moment=require(_0x9aa1('0x4'));var BPromise=require(_0x9aa1('0x5'));var rp=require(_0x9aa1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9aa1('0x7'));var config=require(_0x9aa1('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x9aa1('0x9')]=function(_0x13f168,_0x5a87b9){return _0x13f168[_0x9aa1('0xa')](_0x9aa1('0xb'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index d29f37a..01a3a79 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 _0x277d=['rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','code','error','DeskAccount,\x20%s,\x20%s','message','info','result','catch','DeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetDeskAccount','find','ShowDeskAccount','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x2cb58b,_0x5a879d){var _0xe9dd9c=function(_0x11e835){while(--_0x11e835){_0x2cb58b['push'](_0x2cb58b['shift']());}};_0xe9dd9c(++_0x5a879d);}(_0x277d,0x1c1));var _0xd277=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x277d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd277('0x0'));var util=require(_0xd277('0x1'));var moment=require(_0xd277('0x2'));var BPromise=require(_0xd277('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd277('0x4'))['db'];var utils=require(_0xd277('0x5'));var logger=require('../../config/logger')(_0xd277('0x6'));var config=require(_0xd277('0x7'));var jayson=require(_0xd277('0x8'));var client=jayson['client'][_0xd277('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52cc14,_0x2f9832,_0x17e800){return new BPromise(function(_0x34a5c6,_0x30b3fb){return client[_0xd277('0xa')](_0x52cc14,_0x17e800)[_0xd277('0xb')](function(_0x335cb2){logger['info']('DeskAccount,\x20%s,\x20%s',_0x2f9832,_0xd277('0xc'));logger[_0xd277('0xd')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x2f9832,_0xd277('0xc'),JSON[_0xd277('0xe')](_0x335cb2));if(_0x335cb2['error']){if(_0x335cb2['error'][_0xd277('0xf')]===0x1f4){logger[_0xd277('0x10')](_0xd277('0x11'),_0x2f9832,_0x335cb2['error'][_0xd277('0x12')]);return _0x30b3fb(_0x335cb2[_0xd277('0x10')][_0xd277('0x12')]);}logger[_0xd277('0x10')](_0xd277('0x11'),_0x2f9832,_0x335cb2[_0xd277('0x10')]['message']);return _0x34a5c6(_0x335cb2[_0xd277('0x10')][_0xd277('0x12')]);}else{logger[_0xd277('0x13')](_0xd277('0x11'),_0x2f9832,_0xd277('0xc'));_0x34a5c6(_0x335cb2[_0xd277('0x14')][_0xd277('0x12')]);}})[_0xd277('0x15')](function(_0xf20f4e){logger[_0xd277('0x10')](_0xd277('0x11'),_0x2f9832,_0xf20f4e);_0x30b3fb(_0xf20f4e);});});}exports['GetDeskAccount']=function(_0x366e8f){var _0x5ee255=this;return new Promise(function(_0x5c10d4,_0x24ccc3){return db[_0xd277('0x16')][_0xd277('0x17')]({'raw':_0x366e8f[_0xd277('0x18')]?_0x366e8f[_0xd277('0x18')][_0xd277('0x19')]===undefined?!![]:![]:!![],'where':_0x366e8f[_0xd277('0x18')]?_0x366e8f[_0xd277('0x18')][_0xd277('0x1a')]||null:null,'attributes':_0x366e8f[_0xd277('0x18')]?_0x366e8f[_0xd277('0x18')][_0xd277('0x1b')]||null:null,'limit':_0x366e8f[_0xd277('0x18')]?_0x366e8f[_0xd277('0x18')][_0xd277('0x1c')]||null:null,'include':_0x366e8f[_0xd277('0x18')]?_0x366e8f[_0xd277('0x18')]['include']?_[_0xd277('0x1d')](_0x366e8f[_0xd277('0x18')][_0xd277('0x1e')],function(_0x3b574c){return{'model':db[_0x3b574c[_0xd277('0x1f')]],'as':_0x3b574c['as'],'attributes':_0x3b574c[_0xd277('0x1b')],'include':_0x3b574c[_0xd277('0x1e')]?_[_0xd277('0x1d')](_0x3b574c[_0xd277('0x1e')],function(_0x8760c9){return{'model':db[_0x8760c9[_0xd277('0x1f')]],'as':_0x8760c9['as'],'attributes':_0x8760c9[_0xd277('0x1b')],'include':_0x8760c9['include']?_[_0xd277('0x1d')](_0x8760c9[_0xd277('0x1e')],function(_0x54628d){return{'model':db[_0x54628d[_0xd277('0x1f')]],'as':_0x54628d['as'],'attributes':_0x54628d[_0xd277('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x974d0c){logger[_0xd277('0x13')]('GetDeskAccount',_0x366e8f);logger[_0xd277('0xd')](_0xd277('0x20'),_0x366e8f,JSON[_0xd277('0xe')](_0x974d0c));_0x5c10d4(_0x974d0c);})[_0xd277('0x15')](function(_0x32c6e6){logger[_0xd277('0x10')]('GetDeskAccount',_0x32c6e6[_0xd277('0x12')],_0x366e8f);_0x24ccc3(_0x5ee255[_0xd277('0x10')](0x1f4,_0x32c6e6[_0xd277('0x12')]));});});};exports['ShowDeskAccount']=function(_0x20279f){var _0x3d5b98=this;return new Promise(function(_0x32e550,_0x37deeb){return db[_0xd277('0x16')][_0xd277('0x21')]({'raw':_0x20279f[_0xd277('0x18')]?_0x20279f[_0xd277('0x18')][_0xd277('0x19')]===undefined?!![]:![]:!![],'where':_0x20279f[_0xd277('0x18')]?_0x20279f['options']['where']||null:null,'attributes':_0x20279f['options']?_0x20279f[_0xd277('0x18')][_0xd277('0x1b')]||null:null,'include':_0x20279f[_0xd277('0x18')]?_0x20279f[_0xd277('0x18')][_0xd277('0x1e')]?_[_0xd277('0x1d')](_0x20279f['options'][_0xd277('0x1e')],function(_0x5d0196){return{'model':db[_0x5d0196[_0xd277('0x1f')]],'as':_0x5d0196['as'],'attributes':_0x5d0196['attributes'],'include':_0x5d0196['include']?_[_0xd277('0x1d')](_0x5d0196[_0xd277('0x1e')],function(_0x54af5a){return{'model':db[_0x54af5a[_0xd277('0x1f')]],'as':_0x54af5a['as'],'attributes':_0x54af5a['attributes'],'include':_0x54af5a['include']?_[_0xd277('0x1d')](_0x54af5a[_0xd277('0x1e')],function(_0x4e4fbb){return{'model':db[_0x4e4fbb[_0xd277('0x1f')]],'as':_0x4e4fbb['as'],'attributes':_0x4e4fbb[_0xd277('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44f171){logger[_0xd277('0x13')](_0xd277('0x22'),_0x20279f);logger[_0xd277('0xd')](_0xd277('0x22'),_0x20279f,JSON[_0xd277('0xe')](_0x44f171));_0x32e550(_0x44f171);})[_0xd277('0x15')](function(_0x264b7e){logger[_0xd277('0x10')](_0xd277('0x22'),_0x264b7e[_0xd277('0x12')],_0x20279f);_0x37deeb(_0x3d5b98[_0xd277('0x10')](0x1f4,_0x264b7e['message']));});});}; \ No newline at end of file +var _0x117b=['info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','DeskAccount','find','ShowDeskAccount','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x22a190,_0x1e215b){var _0x227527=function(_0x25a116){while(--_0x25a116){_0x22a190['push'](_0x22a190['shift']());}};_0x227527(++_0x1e215b);}(_0x117b,0xe2));var _0xb117=function(_0x438b70,_0x247dc5){_0x438b70=_0x438b70-0x0;var _0x47968b=_0x117b[_0x438b70];return _0x47968b;};'use strict';var _=require('lodash');var util=require(_0xb117('0x0'));var moment=require(_0xb117('0x1'));var BPromise=require(_0xb117('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb117('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb117('0x4'));var logger=require(_0xb117('0x5'))(_0xb117('0x6'));var config=require(_0xb117('0x7'));var jayson=require(_0xb117('0x8'));var client=jayson[_0xb117('0x9')][_0xb117('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x410ed7,_0x15b78f,_0x3b0945){return new BPromise(function(_0x45b3c8,_0x5ccb53){return client['request'](_0x410ed7,_0x3b0945)[_0xb117('0xb')](function(_0x2a3fe2){logger[_0xb117('0xc')](_0xb117('0xd'),_0x15b78f,_0xb117('0xe'));logger[_0xb117('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x15b78f,_0xb117('0xe'),JSON[_0xb117('0x10')](_0x2a3fe2));if(_0x2a3fe2[_0xb117('0x11')]){if(_0x2a3fe2['error'][_0xb117('0x12')]===0x1f4){logger['error'](_0xb117('0xd'),_0x15b78f,_0x2a3fe2[_0xb117('0x11')]['message']);return _0x5ccb53(_0x2a3fe2[_0xb117('0x11')]['message']);}logger[_0xb117('0x11')](_0xb117('0xd'),_0x15b78f,_0x2a3fe2['error'][_0xb117('0x13')]);return _0x45b3c8(_0x2a3fe2[_0xb117('0x11')][_0xb117('0x13')]);}else{logger[_0xb117('0xc')](_0xb117('0xd'),_0x15b78f,'request\x20sent');_0x45b3c8(_0x2a3fe2['result']['message']);}})[_0xb117('0x14')](function(_0x12aeec){logger['error'](_0xb117('0xd'),_0x15b78f,_0x12aeec);_0x5ccb53(_0x12aeec);});});}exports['GetDeskAccount']=function(_0x2898e8){var _0x1d9f45=this;return new Promise(function(_0x49dbdb,_0x522181){return db['DeskAccount'][_0xb117('0x15')]({'raw':_0x2898e8[_0xb117('0x16')]?_0x2898e8[_0xb117('0x16')][_0xb117('0x17')]===undefined?!![]:![]:!![],'where':_0x2898e8[_0xb117('0x16')]?_0x2898e8[_0xb117('0x16')][_0xb117('0x18')]||null:null,'attributes':_0x2898e8[_0xb117('0x16')]?_0x2898e8[_0xb117('0x16')][_0xb117('0x19')]||null:null,'limit':_0x2898e8[_0xb117('0x16')]?_0x2898e8[_0xb117('0x16')][_0xb117('0x1a')]||null:null,'include':_0x2898e8['options']?_0x2898e8[_0xb117('0x16')][_0xb117('0x1b')]?_[_0xb117('0x1c')](_0x2898e8[_0xb117('0x16')][_0xb117('0x1b')],function(_0x4afce5){return{'model':db[_0x4afce5['model']],'as':_0x4afce5['as'],'attributes':_0x4afce5[_0xb117('0x19')],'include':_0x4afce5[_0xb117('0x1b')]?_[_0xb117('0x1c')](_0x4afce5[_0xb117('0x1b')],function(_0x151f41){return{'model':db[_0x151f41[_0xb117('0x1d')]],'as':_0x151f41['as'],'attributes':_0x151f41[_0xb117('0x19')],'include':_0x151f41[_0xb117('0x1b')]?_[_0xb117('0x1c')](_0x151f41[_0xb117('0x1b')],function(_0x19fe75){return{'model':db[_0x19fe75[_0xb117('0x1d')]],'as':_0x19fe75['as'],'attributes':_0x19fe75[_0xb117('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb117('0xb')](function(_0x511c9e){logger[_0xb117('0xc')](_0xb117('0x1e'),_0x2898e8);logger[_0xb117('0xf')]('GetDeskAccount',_0x2898e8,JSON[_0xb117('0x10')](_0x511c9e));_0x49dbdb(_0x511c9e);})[_0xb117('0x14')](function(_0x3ca832){logger[_0xb117('0x11')](_0xb117('0x1e'),_0x3ca832['message'],_0x2898e8);_0x522181(_0x1d9f45['error'](0x1f4,_0x3ca832['message']));});});};exports['ShowDeskAccount']=function(_0x30aced){var _0x2c08b6=this;return new Promise(function(_0x446451,_0x3d811b){return db[_0xb117('0x1f')][_0xb117('0x20')]({'raw':_0x30aced['options']?_0x30aced[_0xb117('0x16')][_0xb117('0x17')]===undefined?!![]:![]:!![],'where':_0x30aced[_0xb117('0x16')]?_0x30aced[_0xb117('0x16')][_0xb117('0x18')]||null:null,'attributes':_0x30aced['options']?_0x30aced[_0xb117('0x16')][_0xb117('0x19')]||null:null,'include':_0x30aced[_0xb117('0x16')]?_0x30aced[_0xb117('0x16')][_0xb117('0x1b')]?_[_0xb117('0x1c')](_0x30aced[_0xb117('0x16')][_0xb117('0x1b')],function(_0x311d14){return{'model':db[_0x311d14['model']],'as':_0x311d14['as'],'attributes':_0x311d14[_0xb117('0x19')],'include':_0x311d14['include']?_[_0xb117('0x1c')](_0x311d14[_0xb117('0x1b')],function(_0x19dfa6){return{'model':db[_0x19dfa6['model']],'as':_0x19dfa6['as'],'attributes':_0x19dfa6['attributes'],'include':_0x19dfa6[_0xb117('0x1b')]?_[_0xb117('0x1c')](_0x19dfa6[_0xb117('0x1b')],function(_0x5df4dc){return{'model':db[_0x5df4dc[_0xb117('0x1d')]],'as':_0x5df4dc['as'],'attributes':_0x5df4dc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fde24){logger[_0xb117('0xc')](_0xb117('0x21'),_0x30aced);logger[_0xb117('0xf')](_0xb117('0x21'),_0x30aced,JSON['stringify'](_0x2fde24));_0x446451(_0x2fde24);})[_0xb117('0x14')](function(_0x560f51){logger['error'](_0xb117('0x21'),_0x560f51[_0xb117('0x13')],_0x30aced);_0x3d811b(_0x2c08b6[_0xb117('0x11')](0x1f4,_0x560f51[_0xb117('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index d817012..607bdf8 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3eeff9,_0x1cd028){var _0x102ed6=function(_0x2fc534){while(--_0x2fc534){_0x3eeff9['push'](_0x3eeff9['shift']());}};_0x102ed6(++_0x1cd028);}(_0x008c,0x188));var _0xc008=function(_0xf58288,_0x35333c){_0xf58288=_0xf58288-0x0;var _0x196e87=_0x008c[_0xf58288];return _0x196e87;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x2d9d6f,_0x5dd47f){var _0x571297=function(_0x51c72f){while(--_0x51c72f){_0x2d9d6f['push'](_0x2d9d6f['shift']());}};_0x571297(++_0x5dd47f);}(_0x3e74,0x175));var _0x43e7=function(_0x26bc27,_0xd7dabe){_0x26bc27=_0x26bc27-0x0;var _0x3c8e83=_0x3e74[_0x26bc27];return _0x3c8e83;};'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 cd42a22..b261dd7 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 _0x4afc=['sequelize','STRING'];(function(_0x3a3c81,_0x253ca1){var _0x53acaf=function(_0x585113){while(--_0x585113){_0x3a3c81['push'](_0x3a3c81['shift']());}};_0x53acaf(++_0x253ca1);}(_0x4afc,0xa0));var _0xc4af=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x4afc[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require(_0xc4af('0x0'));module['exports']={'name':{'type':Sequelize[_0xc4af('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x34fd=['exports','STRING','sequelize'];(function(_0x2b2bcf,_0x1fae8c){var _0x490f54=function(_0x170926){while(--_0x170926){_0x2b2bcf['push'](_0x2b2bcf['shift']());}};_0x490f54(++_0x1fae8c);}(_0x34fd,0x19a));var _0xd34f=function(_0x36d1b6,_0x317571){_0x36d1b6=_0x36d1b6-0x0;var _0x23226d=_0x34fd[_0x36d1b6];return _0x23226d;};'use strict';var Sequelize=require(_0xd34f('0x0'));module[_0xd34f('0x1')]={'name':{'type':Sequelize[_0xd34f('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 1b2c2ad..b038e2f 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 _0x942d=['create','body','getFields','findOne','DeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','DeskConfiguration','count','includeAll','findAll','rows','catch','show','params','include','find'];(function(_0x3f1e6b,_0x3f9001){var _0x34ab17=function(_0x2ab7e4){while(--_0x2ab7e4){_0x3f1e6b['push'](_0x3f1e6b['shift']());}};_0x34ab17(++_0x3f9001);}(_0x942d,0x105));var _0xd942=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x942d[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xd942('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd942('0x1'));var jsonpatch=require(_0xd942('0x2'));var rp=require(_0xd942('0x3'));var moment=require(_0xd942('0x4'));var BPromise=require(_0xd942('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd942('0x6'));var sox=require(_0xd942('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd942('0x8'));var crypto=require(_0xd942('0x9'));var jsforce=require(_0xd942('0xa'));var deskjs=require(_0xd942('0xb'));var toCsv=require(_0xd942('0xc'));var querystring=require(_0xd942('0xd'));var Papa=require('papaparse');var Redis=require(_0xd942('0xe'));var authService=require(_0xd942('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd942('0x10'));var logger=require('../../config/logger')(_0xd942('0x11'));var utils=require(_0xd942('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd942('0x13'));var db=require(_0xd942('0x14'))['db'];function respondWithStatusCode(_0x42ded2,_0x1f3eb5){_0x1f3eb5=_0x1f3eb5||0xcc;return function(_0x3d410c){if(_0x3d410c){return _0x42ded2['sendStatus'](_0x1f3eb5);}return _0x42ded2[_0xd942('0x15')](_0x1f3eb5)[_0xd942('0x16')]();};}function respondWithResult(_0x29c7cb,_0x474407){_0x474407=_0x474407||0xc8;return function(_0x4ca7f4){if(_0x4ca7f4){return _0x29c7cb['status'](_0x474407)[_0xd942('0x17')](_0x4ca7f4);}};}function respondWithFilteredResult(_0x5ba41b,_0x3dbfd){return function(_0x5d936a){if(_0x5d936a){var _0x1394d6=typeof _0x3dbfd[_0xd942('0x18')]===_0xd942('0x19')&&typeof _0x3dbfd['limit']===_0xd942('0x19');var _0x631380=_0x5d936a['count'];var _0xd4a5de=_0x1394d6?0x0:_0x3dbfd[_0xd942('0x18')];var _0x13394f=_0x1394d6?_0x5d936a['count']:_0x3dbfd['offset']+_0x3dbfd[_0xd942('0x1a')];var _0x134b10;if(_0x13394f>=_0x631380){_0x13394f=_0x631380;_0x134b10=0xc8;}else{_0x134b10=0xce;}_0x5ba41b['status'](_0x134b10);return _0x5ba41b[_0xd942('0x1b')](_0xd942('0x1c'),_0xd4a5de+'-'+_0x13394f+'/'+_0x631380)[_0xd942('0x17')](_0x5d936a);}return null;};}function patchUpdates(_0x147ab9){return function(_0x3091fb){try{jsonpatch[_0xd942('0x1d')](_0x3091fb,_0x147ab9,!![]);}catch(_0x1bbee9){return BPromise[_0xd942('0x1e')](_0x1bbee9);}return _0x3091fb[_0xd942('0x1f')]();};}function saveUpdates(_0x3b3c50,_0x12dc36){return function(_0x15a619){if(_0x15a619){return _0x15a619[_0xd942('0x20')](_0x3b3c50)[_0xd942('0x21')](function(_0x3becb4){return _0x3becb4;});}return null;};}function removeEntity(_0xc47ef7,_0x5902d0){return function(_0x208a97){if(_0x208a97){return _0x208a97[_0xd942('0x22')]()[_0xd942('0x21')](function(){_0xc47ef7[_0xd942('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f41c,_0x531db4){return function(_0x23a7a2){if(!_0x23a7a2){_0x12f41c[_0xd942('0x23')](0x194);}return _0x23a7a2;};}function handleError(_0xfd1085,_0x2b6a20){_0x2b6a20=_0x2b6a20||0x1f4;return function(_0x45bf24){logger[_0xd942('0x24')](_0x45bf24['stack']);if(_0x45bf24['name']){delete _0x45bf24[_0xd942('0x25')];}_0xfd1085['status'](_0x2b6a20)[_0xd942('0x26')](_0x45bf24);};}exports[_0xd942('0x27')]=function(_0xe18e47,_0xc8d079){var _0x5b0030={},_0x4b20c4={},_0x2c490a={'count':0x0,'rows':[]};var _0x5829a9=_['map'](db['DeskConfiguration'][_0xd942('0x28')],function(_0x2d381b){return{'name':_0x2d381b[_0xd942('0x29')],'type':_0x2d381b[_0xd942('0x2a')]['key']};});_0x4b20c4[_0xd942('0x2b')]=_[_0xd942('0x2c')](_0x5829a9,_0xd942('0x25'));_0x4b20c4['query']=_[_0xd942('0x2d')](_0xe18e47[_0xd942('0x2e')]);_0x4b20c4['filters']=_[_0xd942('0x2f')](_0x4b20c4[_0xd942('0x2b')],_0x4b20c4[_0xd942('0x2e')]);_0x5b0030[_0xd942('0x30')]=_[_0xd942('0x2f')](_0x4b20c4[_0xd942('0x2b')],qs[_0xd942('0x31')](_0xe18e47[_0xd942('0x2e')][_0xd942('0x31')]));_0x5b0030[_0xd942('0x30')]=_0x5b0030[_0xd942('0x30')][_0xd942('0x32')]?_0x5b0030[_0xd942('0x30')]:_0x4b20c4[_0xd942('0x2b')];if(!_0xe18e47[_0xd942('0x2e')][_0xd942('0x33')](_0xd942('0x34'))){_0x5b0030[_0xd942('0x1a')]=qs['limit'](_0xe18e47[_0xd942('0x2e')]['limit']);_0x5b0030[_0xd942('0x18')]=qs[_0xd942('0x18')](_0xe18e47[_0xd942('0x2e')][_0xd942('0x18')]);}_0x5b0030[_0xd942('0x35')]=qs[_0xd942('0x36')](_0xe18e47['query'][_0xd942('0x36')]);_0x5b0030[_0xd942('0x37')]=qs[_0xd942('0x38')](_['pick'](_0xe18e47[_0xd942('0x2e')],_0x4b20c4[_0xd942('0x38')]),_0x5829a9);if(_0xe18e47[_0xd942('0x2e')][_0xd942('0x39')]){_0x5b0030[_0xd942('0x37')]=_[_0xd942('0x3a')](_0x5b0030[_0xd942('0x37')],{'$or':_[_0xd942('0x2c')](_0x5829a9,function(_0x2379f3){if(_0x2379f3[_0xd942('0x2a')]!==_0xd942('0x3b')){var _0x4f38e5={};_0x4f38e5[_0x2379f3[_0xd942('0x25')]]={'$like':'%'+_0xe18e47[_0xd942('0x2e')][_0xd942('0x39')]+'%'};return _0x4f38e5;}})});}_0x5b0030=_[_0xd942('0x3a')]({},_0x5b0030,_0xe18e47[_0xd942('0x3c')]);var _0x3983a7={'where':_0x5b0030[_0xd942('0x37')]};return db[_0xd942('0x3d')][_0xd942('0x3e')](_0x3983a7)[_0xd942('0x21')](function(_0x128de7){_0x2c490a[_0xd942('0x3e')]=_0x128de7;if(_0xe18e47[_0xd942('0x2e')][_0xd942('0x3f')]){_0x5b0030['include']=[{'all':!![]}];}return db[_0xd942('0x3d')][_0xd942('0x40')](_0x5b0030);})[_0xd942('0x21')](function(_0x544016){_0x2c490a[_0xd942('0x41')]=_0x544016;return _0x2c490a;})[_0xd942('0x21')](respondWithFilteredResult(_0xc8d079,_0x5b0030))[_0xd942('0x42')](handleError(_0xc8d079,null));};exports[_0xd942('0x43')]=function(_0x3a3a6a,_0x35408f){var _0xd554ff={'raw':![],'where':{'id':_0x3a3a6a[_0xd942('0x44')]['id']}},_0x28de5d={};_0x28de5d[_0xd942('0x2b')]=_[_0xd942('0x2d')](db[_0xd942('0x3d')][_0xd942('0x28')]);_0x28de5d[_0xd942('0x2e')]=_[_0xd942('0x2d')](_0x3a3a6a['query']);_0x28de5d[_0xd942('0x38')]=_['intersection'](_0x28de5d[_0xd942('0x2b')],_0x28de5d[_0xd942('0x2e')]);_0xd554ff[_0xd942('0x30')]=_[_0xd942('0x2f')](_0x28de5d['model'],qs[_0xd942('0x31')](_0x3a3a6a[_0xd942('0x2e')]['fields']));_0xd554ff[_0xd942('0x30')]=_0xd554ff['attributes'][_0xd942('0x32')]?_0xd554ff[_0xd942('0x30')]:_0x28de5d[_0xd942('0x2b')];if(_0x3a3a6a[_0xd942('0x2e')][_0xd942('0x3f')]){_0xd554ff[_0xd942('0x45')]=[{'all':!![]}];}_0xd554ff=_[_0xd942('0x3a')]({},_0xd554ff,_0x3a3a6a[_0xd942('0x3c')]);return db[_0xd942('0x3d')][_0xd942('0x46')](_0xd554ff)[_0xd942('0x21')](handleEntityNotFound(_0x35408f,null))[_0xd942('0x21')](respondWithResult(_0x35408f,null))[_0xd942('0x42')](handleError(_0x35408f,null));};exports[_0xd942('0x47')]=function(_0x3ff277,_0x132417){return db[_0xd942('0x3d')][_0xd942('0x47')](_0x3ff277[_0xd942('0x48')],{})['then'](respondWithResult(_0x132417,0xc9))['catch'](handleError(_0x132417,null));};exports[_0xd942('0x20')]=function(_0x164f33,_0x3a9439){if(_0x164f33[_0xd942('0x48')]['id']){delete _0x164f33['body']['id'];}return db[_0xd942('0x3d')][_0xd942('0x46')]({'where':{'id':_0x164f33['params']['id']}})[_0xd942('0x21')](handleEntityNotFound(_0x3a9439,null))[_0xd942('0x21')](saveUpdates(_0x164f33[_0xd942('0x48')],null))[_0xd942('0x21')](respondWithResult(_0x3a9439,null))['catch'](handleError(_0x3a9439,null));};exports[_0xd942('0x22')]=function(_0x363603,_0x2bebf2){return db[_0xd942('0x3d')]['find']({'where':{'id':_0x363603[_0xd942('0x44')]['id']}})['then'](handleEntityNotFound(_0x2bebf2,null))[_0xd942('0x21')](removeEntity(_0x2bebf2,null))[_0xd942('0x42')](handleError(_0x2bebf2,null));};exports[_0xd942('0x49')]=function(_0x49afe9,_0x330027,_0x58154f){var _0x624029={};var _0x15599e={};var _0x1bbe11;var _0x3a3ec5;return db['DeskConfiguration'][_0xd942('0x4a')]({'where':{'id':_0x49afe9[_0xd942('0x44')]['id']}})['then'](handleEntityNotFound(_0x330027,null))[_0xd942('0x21')](function(_0x2fbe82){if(_0x2fbe82){_0x1bbe11=_0x2fbe82;_0x15599e[_0xd942('0x2b')]=_[_0xd942('0x2d')](db[_0xd942('0x4b')][_0xd942('0x28')]);_0x15599e[_0xd942('0x2e')]=_[_0xd942('0x2d')](_0x49afe9[_0xd942('0x2e')]);_0x15599e[_0xd942('0x38')]=_['intersection'](_0x15599e[_0xd942('0x2b')],_0x15599e['query']);_0x624029[_0xd942('0x30')]=_['intersection'](_0x15599e[_0xd942('0x2b')],qs['fields'](_0x49afe9['query'][_0xd942('0x31')]));_0x624029[_0xd942('0x30')]=_0x624029[_0xd942('0x30')][_0xd942('0x32')]?_0x624029[_0xd942('0x30')]:_0x15599e[_0xd942('0x2b')];_0x624029['order']=qs[_0xd942('0x36')](_0x49afe9['query'][_0xd942('0x36')]);_0x624029['where']=qs['filters'](_[_0xd942('0x4c')](_0x49afe9['query'],_0x15599e[_0xd942('0x38')]));if(_0x49afe9['query']['filter']){_0x624029['where']=_[_0xd942('0x3a')](_0x624029['where'],{'$or':_[_0xd942('0x2c')](_0x624029['attributes'],function(_0x1e05be){var _0x208d45={};_0x208d45[_0x1e05be]={'$like':'%'+_0x49afe9[_0xd942('0x2e')]['filter']+'%'};return _0x208d45;})});}_0x624029=_[_0xd942('0x3a')]({},_0x624029,_0x49afe9[_0xd942('0x3c')]);return _0x1bbe11[_0xd942('0x49')](_0x624029);}})[_0xd942('0x21')](function(_0x19d404){if(_0x19d404){_0x3a3ec5=_0x19d404['length'];if(!_0x49afe9[_0xd942('0x2e')]['hasOwnProperty'](_0xd942('0x34'))){_0x624029[_0xd942('0x1a')]=qs[_0xd942('0x1a')](_0x49afe9[_0xd942('0x2e')]['limit']);_0x624029[_0xd942('0x18')]=qs[_0xd942('0x18')](_0x49afe9[_0xd942('0x2e')][_0xd942('0x18')]);}return _0x1bbe11[_0xd942('0x49')](_0x624029);}})[_0xd942('0x21')](function(_0x583217){if(_0x583217){return _0x583217?{'count':_0x3a3ec5,'rows':_0x583217}:null;}})[_0xd942('0x21')](respondWithResult(_0x330027,null))[_0xd942('0x42')](handleError(_0x330027,null));};exports[_0xd942('0x4d')]=function(_0xf699d0,_0x2826a4,_0x4c5d75){var _0x119c21={};var _0x38b37d={};var _0x298654;var _0x283549;return db['DeskConfiguration'][_0xd942('0x4a')]({'where':{'id':_0xf699d0[_0xd942('0x44')]['id']}})[_0xd942('0x21')](handleEntityNotFound(_0x2826a4,null))[_0xd942('0x21')](function(_0x5665ed){if(_0x5665ed){_0x298654=_0x5665ed;_0x38b37d[_0xd942('0x2b')]=_[_0xd942('0x2d')](db[_0xd942('0x4b')]['rawAttributes']);_0x38b37d['query']=_[_0xd942('0x2d')](_0xf699d0['query']);_0x38b37d[_0xd942('0x38')]=_[_0xd942('0x2f')](_0x38b37d[_0xd942('0x2b')],_0x38b37d['query']);_0x119c21[_0xd942('0x30')]=_[_0xd942('0x2f')](_0x38b37d[_0xd942('0x2b')],qs[_0xd942('0x31')](_0xf699d0[_0xd942('0x2e')]['fields']));_0x119c21['attributes']=_0x119c21[_0xd942('0x30')][_0xd942('0x32')]?_0x119c21[_0xd942('0x30')]:_0x38b37d[_0xd942('0x2b')];_0x119c21['order']=qs['sort'](_0xf699d0[_0xd942('0x2e')]['sort']);_0x119c21[_0xd942('0x37')]=qs[_0xd942('0x38')](_[_0xd942('0x4c')](_0xf699d0[_0xd942('0x2e')],_0x38b37d[_0xd942('0x38')]));if(_0xf699d0['query']['filter']){_0x119c21[_0xd942('0x37')]=_[_0xd942('0x3a')](_0x119c21[_0xd942('0x37')],{'$or':_[_0xd942('0x2c')](_0x119c21['attributes'],function(_0x2d775b){var _0x412d7c={};_0x412d7c[_0x2d775b]={'$like':'%'+_0xf699d0[_0xd942('0x2e')][_0xd942('0x39')]+'%'};return _0x412d7c;})});}_0x119c21=_[_0xd942('0x3a')]({},_0x119c21,_0xf699d0[_0xd942('0x3c')]);return _0x298654[_0xd942('0x4d')](_0x119c21);}})[_0xd942('0x21')](function(_0x14d2e9){if(_0x14d2e9){_0x283549=_0x14d2e9['length'];if(!_0xf699d0[_0xd942('0x2e')][_0xd942('0x33')]('nolimit')){_0x119c21[_0xd942('0x1a')]=qs['limit'](_0xf699d0['query'][_0xd942('0x1a')]);_0x119c21[_0xd942('0x18')]=qs[_0xd942('0x18')](_0xf699d0[_0xd942('0x2e')]['offset']);}return _0x298654[_0xd942('0x4d')](_0x119c21);}})['then'](function(_0x37e68f){if(_0x37e68f){return _0x37e68f?{'count':_0x283549,'rows':_0x37e68f}:null;}})['then'](respondWithResult(_0x2826a4,null))[_0xd942('0x42')](handleError(_0x2826a4,null));};exports[_0xd942('0x4e')]=function(_0x276483,_0x2f2cc3,_0x9b3d48){var _0x3d3464={};var _0x3866a2={};var _0xe1b6e7;var _0x136e6a;return db[_0xd942('0x3d')][_0xd942('0x4a')]({'where':{'id':_0x276483[_0xd942('0x44')]['id']}})[_0xd942('0x21')](handleEntityNotFound(_0x2f2cc3,null))[_0xd942('0x21')](function(_0x4aa2d7){if(_0x4aa2d7){_0xe1b6e7=_0x4aa2d7;_0x3866a2[_0xd942('0x2b')]=_[_0xd942('0x2d')](db[_0xd942('0x4b')][_0xd942('0x28')]);_0x3866a2[_0xd942('0x2e')]=_[_0xd942('0x2d')](_0x276483[_0xd942('0x2e')]);_0x3866a2[_0xd942('0x38')]=_['intersection'](_0x3866a2[_0xd942('0x2b')],_0x3866a2[_0xd942('0x2e')]);_0x3d3464['attributes']=_[_0xd942('0x2f')](_0x3866a2[_0xd942('0x2b')],qs[_0xd942('0x31')](_0x276483[_0xd942('0x2e')][_0xd942('0x31')]));_0x3d3464[_0xd942('0x30')]=_0x3d3464['attributes'][_0xd942('0x32')]?_0x3d3464[_0xd942('0x30')]:_0x3866a2['model'];_0x3d3464[_0xd942('0x35')]=qs['sort'](_0x276483[_0xd942('0x2e')]['sort']);_0x3d3464[_0xd942('0x37')]=qs[_0xd942('0x38')](_['pick'](_0x276483[_0xd942('0x2e')],_0x3866a2['filters']));if(_0x276483[_0xd942('0x2e')][_0xd942('0x39')]){_0x3d3464[_0xd942('0x37')]=_['merge'](_0x3d3464[_0xd942('0x37')],{'$or':_[_0xd942('0x2c')](_0x3d3464[_0xd942('0x30')],function(_0x3e3bc9){var _0x153777={};_0x153777[_0x3e3bc9]={'$like':'%'+_0x276483[_0xd942('0x2e')]['filter']+'%'};return _0x153777;})});}_0x3d3464=_['merge']({},_0x3d3464,_0x276483[_0xd942('0x3c')]);return _0xe1b6e7['getDescriptions'](_0x3d3464);}})[_0xd942('0x21')](function(_0x2368ea){if(_0x2368ea){_0x136e6a=_0x2368ea[_0xd942('0x32')];if(!_0x276483[_0xd942('0x2e')][_0xd942('0x33')](_0xd942('0x34'))){_0x3d3464[_0xd942('0x1a')]=qs['limit'](_0x276483[_0xd942('0x2e')]['limit']);_0x3d3464[_0xd942('0x18')]=qs[_0xd942('0x18')](_0x276483[_0xd942('0x2e')][_0xd942('0x18')]);}return _0xe1b6e7[_0xd942('0x4e')](_0x3d3464);}})['then'](function(_0xa087c){if(_0xa087c){return _0xa087c?{'count':_0x136e6a,'rows':_0xa087c}:null;}})['then'](respondWithResult(_0x2f2cc3,null))[_0xd942('0x42')](handleError(_0x2f2cc3,null));};exports[_0xd942('0x4f')]=function(_0x25418d,_0xe5c65a,_0x2d1087){var _0x2f9043={};var _0xb432a0={};var _0x569e92;var _0x3363e9;return db[_0xd942('0x3d')][_0xd942('0x4a')]({'where':{'id':_0x25418d['params']['id']}})[_0xd942('0x21')](handleEntityNotFound(_0xe5c65a,null))['then'](function(_0x572f9e){if(_0x572f9e){_0x569e92=_0x572f9e;_0xb432a0[_0xd942('0x2b')]=_[_0xd942('0x2d')](db[_0xd942('0x50')][_0xd942('0x28')]);_0xb432a0[_0xd942('0x2e')]=_['keys'](_0x25418d['query']);_0xb432a0[_0xd942('0x38')]=_[_0xd942('0x2f')](_0xb432a0[_0xd942('0x2b')],_0xb432a0[_0xd942('0x2e')]);_0x2f9043[_0xd942('0x30')]=_['intersection'](_0xb432a0[_0xd942('0x2b')],qs[_0xd942('0x31')](_0x25418d['query'][_0xd942('0x31')]));_0x2f9043['attributes']=_0x2f9043[_0xd942('0x30')][_0xd942('0x32')]?_0x2f9043['attributes']:_0xb432a0[_0xd942('0x2b')];_0x2f9043[_0xd942('0x35')]=qs[_0xd942('0x36')](_0x25418d[_0xd942('0x2e')][_0xd942('0x36')]);_0x2f9043[_0xd942('0x37')]=qs['filters'](_['pick'](_0x25418d[_0xd942('0x2e')],_0xb432a0[_0xd942('0x38')]));if(_0x25418d[_0xd942('0x2e')][_0xd942('0x39')]){_0x2f9043[_0xd942('0x37')]=_[_0xd942('0x3a')](_0x2f9043[_0xd942('0x37')],{'$or':_[_0xd942('0x2c')](_0x2f9043['attributes'],function(_0x5a60d7){var _0x84a308={};_0x84a308[_0x5a60d7]={'$like':'%'+_0x25418d[_0xd942('0x2e')][_0xd942('0x39')]+'%'};return _0x84a308;})});}_0x2f9043=_[_0xd942('0x3a')]({},_0x2f9043,_0x25418d['options']);return _0x569e92[_0xd942('0x4f')](_0x2f9043);}})[_0xd942('0x21')](function(_0x654181){if(_0x654181){_0x3363e9=_0x654181[_0xd942('0x32')];if(!_0x25418d[_0xd942('0x2e')]['hasOwnProperty'](_0xd942('0x34'))){_0x2f9043[_0xd942('0x1a')]=qs['limit'](_0x25418d[_0xd942('0x2e')][_0xd942('0x1a')]);_0x2f9043[_0xd942('0x18')]=qs['offset'](_0x25418d['query'][_0xd942('0x18')]);}return _0x569e92[_0xd942('0x4f')](_0x2f9043);}})['then'](function(_0x315a25){if(_0x315a25){return _0x315a25?{'count':_0x3363e9,'rows':_0x315a25}:null;}})[_0xd942('0x21')](respondWithResult(_0xe5c65a,null))[_0xd942('0x42')](handleError(_0xe5c65a,null));};exports[_0xd942('0x51')]=function(_0x1c18aa,_0x2a563d,_0x4a1aa0){if(_0x1c18aa[_0xd942('0x48')]['id']){delete _0x1c18aa[_0xd942('0x48')]['id'];}return db[_0xd942('0x3d')]['findOne']({'where':{'id':_0x1c18aa[_0xd942('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a563d,null))[_0xd942('0x21')](function(_0x34032b){if(_0x34032b){return _0x34032b[_0xd942('0x51')](_0x1c18aa['body'][_0xd942('0x52')]||[]);}return null;})[_0xd942('0x21')](respondWithResult(_0x2a563d,null))[_0xd942('0x42')](handleError(_0x2a563d,null));}; \ No newline at end of file +var _0xf33c=['count','offset','apply','reject','update','then','status','end','sendStatus','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','DeskConfiguration','includeAll','include','show','params','find','body','catch','destroy','getFields','findOne','order','pick','nolimit','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','undefined','limit'];(function(_0x468ab5,_0x4e8cbc){var _0x26df2b=function(_0x40b949){while(--_0x40b949){_0x468ab5['push'](_0x468ab5['shift']());}};_0x26df2b(++_0x4e8cbc);}(_0xf33c,0x84));var _0xcf33=function(_0x34398b,_0x40658c){_0x34398b=_0x34398b-0x0;var _0x484c43=_0xf33c[_0x34398b];return _0x484c43;};'use strict';var emlformat=require(_0xcf33('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcf33('0x1'));var rp=require(_0xcf33('0x2'));var moment=require('moment');var BPromise=require(_0xcf33('0x3'));var Mustache=require(_0xcf33('0x4'));var util=require('util');var path=require('path');var sox=require(_0xcf33('0x5'));var csv=require('to-csv');var ejs=require(_0xcf33('0x6'));var fs=require('fs');var fs_extra=require(_0xcf33('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcf33('0x8'));var jsforce=require(_0xcf33('0x9'));var deskjs=require(_0xcf33('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcf33('0xb'));var Redis=require(_0xcf33('0xc'));var authService=require(_0xcf33('0xd'));var qs=require(_0xcf33('0xe'));var as=require(_0xcf33('0xf'));var hardwareService=require(_0xcf33('0x10'));var logger=require(_0xcf33('0x11'))(_0xcf33('0x12'));var utils=require(_0xcf33('0x13'));var config=require(_0xcf33('0x14'));var licenseUtil=require(_0xcf33('0x15'));var db=require(_0xcf33('0x16'))['db'];function respondWithStatusCode(_0x118ac3,_0x5daa39){_0x5daa39=_0x5daa39||0xcc;return function(_0x286874){if(_0x286874){return _0x118ac3['sendStatus'](_0x5daa39);}return _0x118ac3['status'](_0x5daa39)['end']();};}function respondWithResult(_0x1b8292,_0x2d019c){_0x2d019c=_0x2d019c||0xc8;return function(_0x5e4b93){if(_0x5e4b93){return _0x1b8292['status'](_0x2d019c)[_0xcf33('0x17')](_0x5e4b93);}};}function respondWithFilteredResult(_0x4f8d75,_0x58d977){return function(_0x20754c){if(_0x20754c){var _0x25e91b=typeof _0x58d977['offset']===_0xcf33('0x18')&&typeof _0x58d977[_0xcf33('0x19')]==='undefined';var _0x266795=_0x20754c[_0xcf33('0x1a')];var _0x47c461=_0x25e91b?0x0:_0x58d977[_0xcf33('0x1b')];var _0x3c172b=_0x25e91b?_0x20754c[_0xcf33('0x1a')]:_0x58d977[_0xcf33('0x1b')]+_0x58d977[_0xcf33('0x19')];var _0x1ef030;if(_0x3c172b>=_0x266795){_0x3c172b=_0x266795;_0x1ef030=0xc8;}else{_0x1ef030=0xce;}_0x4f8d75['status'](_0x1ef030);return _0x4f8d75['set']('Content-Range',_0x47c461+'-'+_0x3c172b+'/'+_0x266795)[_0xcf33('0x17')](_0x20754c);}return null;};}function patchUpdates(_0x32392a){return function(_0x30d860){try{jsonpatch[_0xcf33('0x1c')](_0x30d860,_0x32392a,!![]);}catch(_0x1098ec){return BPromise[_0xcf33('0x1d')](_0x1098ec);}return _0x30d860['save']();};}function saveUpdates(_0x1f4bb2,_0x1a969f){return function(_0xf93791){if(_0xf93791){return _0xf93791[_0xcf33('0x1e')](_0x1f4bb2)[_0xcf33('0x1f')](function(_0x3ba1e0){return _0x3ba1e0;});}return null;};}function removeEntity(_0x4b4164,_0x25a102){return function(_0x15d25f){if(_0x15d25f){return _0x15d25f['destroy']()['then'](function(){_0x4b4164[_0xcf33('0x20')](0xcc)[_0xcf33('0x21')]();});}};}function handleEntityNotFound(_0x1001d8,_0x28457e){return function(_0x11b580){if(!_0x11b580){_0x1001d8[_0xcf33('0x22')](0x194);}return _0x11b580;};}function handleError(_0x2f10c2,_0x43b936){_0x43b936=_0x43b936||0x1f4;return function(_0x4ce8e2){logger[_0xcf33('0x23')](_0x4ce8e2['stack']);if(_0x4ce8e2[_0xcf33('0x24')]){delete _0x4ce8e2[_0xcf33('0x24')];}_0x2f10c2['status'](_0x43b936)['send'](_0x4ce8e2);};}exports[_0xcf33('0x25')]=function(_0xe9f213,_0x5b4065){var _0x1c6ec3={},_0xb6ff01={},_0x2e8c32={'count':0x0,'rows':[]};var _0x3e4183=_[_0xcf33('0x26')](db['DeskConfiguration'][_0xcf33('0x27')],function(_0x284a51){return{'name':_0x284a51[_0xcf33('0x28')],'type':_0x284a51[_0xcf33('0x29')][_0xcf33('0x2a')]};});_0xb6ff01[_0xcf33('0x2b')]=_['map'](_0x3e4183,_0xcf33('0x24'));_0xb6ff01[_0xcf33('0x2c')]=_[_0xcf33('0x2d')](_0xe9f213[_0xcf33('0x2c')]);_0xb6ff01[_0xcf33('0x2e')]=_[_0xcf33('0x2f')](_0xb6ff01['model'],_0xb6ff01[_0xcf33('0x2c')]);_0x1c6ec3[_0xcf33('0x30')]=_[_0xcf33('0x2f')](_0xb6ff01[_0xcf33('0x2b')],qs[_0xcf33('0x31')](_0xe9f213[_0xcf33('0x2c')][_0xcf33('0x31')]));_0x1c6ec3[_0xcf33('0x30')]=_0x1c6ec3[_0xcf33('0x30')][_0xcf33('0x32')]?_0x1c6ec3[_0xcf33('0x30')]:_0xb6ff01['model'];if(!_0xe9f213[_0xcf33('0x2c')][_0xcf33('0x33')]('nolimit')){_0x1c6ec3[_0xcf33('0x19')]=qs[_0xcf33('0x19')](_0xe9f213['query'][_0xcf33('0x19')]);_0x1c6ec3[_0xcf33('0x1b')]=qs[_0xcf33('0x1b')](_0xe9f213['query'][_0xcf33('0x1b')]);}_0x1c6ec3['order']=qs[_0xcf33('0x34')](_0xe9f213[_0xcf33('0x2c')]['sort']);_0x1c6ec3['where']=qs[_0xcf33('0x2e')](_['pick'](_0xe9f213['query'],_0xb6ff01['filters']),_0x3e4183);if(_0xe9f213['query'][_0xcf33('0x35')]){_0x1c6ec3[_0xcf33('0x36')]=_[_0xcf33('0x37')](_0x1c6ec3[_0xcf33('0x36')],{'$or':_[_0xcf33('0x26')](_0x3e4183,function(_0x47b625){if(_0x47b625['type']!==_0xcf33('0x38')){var _0x49ecff={};_0x49ecff[_0x47b625[_0xcf33('0x24')]]={'$like':'%'+_0xe9f213[_0xcf33('0x2c')][_0xcf33('0x35')]+'%'};return _0x49ecff;}})});}_0x1c6ec3=_[_0xcf33('0x37')]({},_0x1c6ec3,_0xe9f213[_0xcf33('0x39')]);var _0x538ab8={'where':_0x1c6ec3['where']};return db[_0xcf33('0x3a')][_0xcf33('0x1a')](_0x538ab8)['then'](function(_0x419bbf){_0x2e8c32['count']=_0x419bbf;if(_0xe9f213[_0xcf33('0x2c')][_0xcf33('0x3b')]){_0x1c6ec3[_0xcf33('0x3c')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x1c6ec3);})['then'](function(_0x58f77c){_0x2e8c32['rows']=_0x58f77c;return _0x2e8c32;})[_0xcf33('0x1f')](respondWithFilteredResult(_0x5b4065,_0x1c6ec3))['catch'](handleError(_0x5b4065,null));};exports[_0xcf33('0x3d')]=function(_0xe607b7,_0x398556){var _0x38e36b={'raw':![],'where':{'id':_0xe607b7[_0xcf33('0x3e')]['id']}},_0x92ed5={};_0x92ed5[_0xcf33('0x2b')]=_[_0xcf33('0x2d')](db[_0xcf33('0x3a')][_0xcf33('0x27')]);_0x92ed5[_0xcf33('0x2c')]=_[_0xcf33('0x2d')](_0xe607b7['query']);_0x92ed5[_0xcf33('0x2e')]=_['intersection'](_0x92ed5[_0xcf33('0x2b')],_0x92ed5[_0xcf33('0x2c')]);_0x38e36b[_0xcf33('0x30')]=_[_0xcf33('0x2f')](_0x92ed5['model'],qs[_0xcf33('0x31')](_0xe607b7[_0xcf33('0x2c')][_0xcf33('0x31')]));_0x38e36b[_0xcf33('0x30')]=_0x38e36b[_0xcf33('0x30')][_0xcf33('0x32')]?_0x38e36b[_0xcf33('0x30')]:_0x92ed5[_0xcf33('0x2b')];if(_0xe607b7[_0xcf33('0x2c')][_0xcf33('0x3b')]){_0x38e36b['include']=[{'all':!![]}];}_0x38e36b=_[_0xcf33('0x37')]({},_0x38e36b,_0xe607b7[_0xcf33('0x39')]);return db[_0xcf33('0x3a')][_0xcf33('0x3f')](_0x38e36b)[_0xcf33('0x1f')](handleEntityNotFound(_0x398556,null))[_0xcf33('0x1f')](respondWithResult(_0x398556,null))['catch'](handleError(_0x398556,null));};exports['create']=function(_0x404fa5,_0x255243){return db[_0xcf33('0x3a')]['create'](_0x404fa5[_0xcf33('0x40')],{})[_0xcf33('0x1f')](respondWithResult(_0x255243,0xc9))[_0xcf33('0x41')](handleError(_0x255243,null));};exports[_0xcf33('0x1e')]=function(_0x205dcf,_0x2d132b){if(_0x205dcf[_0xcf33('0x40')]['id']){delete _0x205dcf[_0xcf33('0x40')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x205dcf[_0xcf33('0x3e')]['id']}})[_0xcf33('0x1f')](handleEntityNotFound(_0x2d132b,null))[_0xcf33('0x1f')](saveUpdates(_0x205dcf[_0xcf33('0x40')],null))[_0xcf33('0x1f')](respondWithResult(_0x2d132b,null))[_0xcf33('0x41')](handleError(_0x2d132b,null));};exports[_0xcf33('0x42')]=function(_0x26530a,_0x2e5fc0){return db[_0xcf33('0x3a')][_0xcf33('0x3f')]({'where':{'id':_0x26530a['params']['id']}})['then'](handleEntityNotFound(_0x2e5fc0,null))[_0xcf33('0x1f')](removeEntity(_0x2e5fc0,null))[_0xcf33('0x41')](handleError(_0x2e5fc0,null));};exports[_0xcf33('0x43')]=function(_0x5247d9,_0x3c67d9,_0x683a82){var _0x5e815e={};var _0x5f29f2={};var _0x4e5031;var _0x114946;return db[_0xcf33('0x3a')][_0xcf33('0x44')]({'where':{'id':_0x5247d9['params']['id']}})[_0xcf33('0x1f')](handleEntityNotFound(_0x3c67d9,null))[_0xcf33('0x1f')](function(_0x5dcbb8){if(_0x5dcbb8){_0x4e5031=_0x5dcbb8;_0x5f29f2[_0xcf33('0x2b')]=_[_0xcf33('0x2d')](db['DeskField'][_0xcf33('0x27')]);_0x5f29f2['query']=_[_0xcf33('0x2d')](_0x5247d9[_0xcf33('0x2c')]);_0x5f29f2[_0xcf33('0x2e')]=_['intersection'](_0x5f29f2['model'],_0x5f29f2[_0xcf33('0x2c')]);_0x5e815e[_0xcf33('0x30')]=_[_0xcf33('0x2f')](_0x5f29f2[_0xcf33('0x2b')],qs['fields'](_0x5247d9[_0xcf33('0x2c')]['fields']));_0x5e815e[_0xcf33('0x30')]=_0x5e815e[_0xcf33('0x30')]['length']?_0x5e815e[_0xcf33('0x30')]:_0x5f29f2[_0xcf33('0x2b')];_0x5e815e[_0xcf33('0x45')]=qs[_0xcf33('0x34')](_0x5247d9[_0xcf33('0x2c')][_0xcf33('0x34')]);_0x5e815e['where']=qs['filters'](_[_0xcf33('0x46')](_0x5247d9[_0xcf33('0x2c')],_0x5f29f2['filters']));if(_0x5247d9[_0xcf33('0x2c')][_0xcf33('0x35')]){_0x5e815e[_0xcf33('0x36')]=_[_0xcf33('0x37')](_0x5e815e[_0xcf33('0x36')],{'$or':_[_0xcf33('0x26')](_0x5e815e[_0xcf33('0x30')],function(_0x4b8a89){var _0x33666f={};_0x33666f[_0x4b8a89]={'$like':'%'+_0x5247d9[_0xcf33('0x2c')][_0xcf33('0x35')]+'%'};return _0x33666f;})});}_0x5e815e=_[_0xcf33('0x37')]({},_0x5e815e,_0x5247d9[_0xcf33('0x39')]);return _0x4e5031[_0xcf33('0x43')](_0x5e815e);}})['then'](function(_0x190a3e){if(_0x190a3e){_0x114946=_0x190a3e[_0xcf33('0x32')];if(!_0x5247d9[_0xcf33('0x2c')]['hasOwnProperty'](_0xcf33('0x47'))){_0x5e815e[_0xcf33('0x19')]=qs[_0xcf33('0x19')](_0x5247d9[_0xcf33('0x2c')][_0xcf33('0x19')]);_0x5e815e[_0xcf33('0x1b')]=qs['offset'](_0x5247d9[_0xcf33('0x2c')][_0xcf33('0x1b')]);}return _0x4e5031[_0xcf33('0x43')](_0x5e815e);}})[_0xcf33('0x1f')](function(_0x2a4e17){if(_0x2a4e17){return _0x2a4e17?{'count':_0x114946,'rows':_0x2a4e17}:null;}})[_0xcf33('0x1f')](respondWithResult(_0x3c67d9,null))[_0xcf33('0x41')](handleError(_0x3c67d9,null));};exports[_0xcf33('0x48')]=function(_0x146746,_0x4de747,_0x3633d4){var _0x4dc147={};var _0x4f18c6={};var _0xa19550;var _0x6448ea;return db[_0xcf33('0x3a')][_0xcf33('0x44')]({'where':{'id':_0x146746[_0xcf33('0x3e')]['id']}})[_0xcf33('0x1f')](handleEntityNotFound(_0x4de747,null))[_0xcf33('0x1f')](function(_0x26e1dc){if(_0x26e1dc){_0xa19550=_0x26e1dc;_0x4f18c6['model']=_['keys'](db[_0xcf33('0x49')][_0xcf33('0x27')]);_0x4f18c6['query']=_['keys'](_0x146746[_0xcf33('0x2c')]);_0x4f18c6[_0xcf33('0x2e')]=_[_0xcf33('0x2f')](_0x4f18c6[_0xcf33('0x2b')],_0x4f18c6['query']);_0x4dc147['attributes']=_[_0xcf33('0x2f')](_0x4f18c6['model'],qs[_0xcf33('0x31')](_0x146746['query'][_0xcf33('0x31')]));_0x4dc147[_0xcf33('0x30')]=_0x4dc147[_0xcf33('0x30')][_0xcf33('0x32')]?_0x4dc147[_0xcf33('0x30')]:_0x4f18c6[_0xcf33('0x2b')];_0x4dc147[_0xcf33('0x45')]=qs['sort'](_0x146746[_0xcf33('0x2c')][_0xcf33('0x34')]);_0x4dc147['where']=qs[_0xcf33('0x2e')](_['pick'](_0x146746[_0xcf33('0x2c')],_0x4f18c6[_0xcf33('0x2e')]));if(_0x146746[_0xcf33('0x2c')]['filter']){_0x4dc147[_0xcf33('0x36')]=_[_0xcf33('0x37')](_0x4dc147[_0xcf33('0x36')],{'$or':_['map'](_0x4dc147['attributes'],function(_0x50f846){var _0x135486={};_0x135486[_0x50f846]={'$like':'%'+_0x146746[_0xcf33('0x2c')][_0xcf33('0x35')]+'%'};return _0x135486;})});}_0x4dc147=_[_0xcf33('0x37')]({},_0x4dc147,_0x146746[_0xcf33('0x39')]);return _0xa19550[_0xcf33('0x48')](_0x4dc147);}})[_0xcf33('0x1f')](function(_0x2fbb2f){if(_0x2fbb2f){_0x6448ea=_0x2fbb2f[_0xcf33('0x32')];if(!_0x146746[_0xcf33('0x2c')][_0xcf33('0x33')](_0xcf33('0x47'))){_0x4dc147[_0xcf33('0x19')]=qs['limit'](_0x146746[_0xcf33('0x2c')][_0xcf33('0x19')]);_0x4dc147[_0xcf33('0x1b')]=qs['offset'](_0x146746[_0xcf33('0x2c')][_0xcf33('0x1b')]);}return _0xa19550['getSubjects'](_0x4dc147);}})['then'](function(_0x84d192){if(_0x84d192){return _0x84d192?{'count':_0x6448ea,'rows':_0x84d192}:null;}})['then'](respondWithResult(_0x4de747,null))[_0xcf33('0x41')](handleError(_0x4de747,null));};exports[_0xcf33('0x4a')]=function(_0x34d9c1,_0x1220ee,_0x1af768){var _0xe4960f={};var _0x169bde={};var _0x34ff8b;var _0x3fa20b;return db['DeskConfiguration'][_0xcf33('0x44')]({'where':{'id':_0x34d9c1['params']['id']}})[_0xcf33('0x1f')](handleEntityNotFound(_0x1220ee,null))[_0xcf33('0x1f')](function(_0x42d77d){if(_0x42d77d){_0x34ff8b=_0x42d77d;_0x169bde[_0xcf33('0x2b')]=_[_0xcf33('0x2d')](db[_0xcf33('0x49')][_0xcf33('0x27')]);_0x169bde[_0xcf33('0x2c')]=_[_0xcf33('0x2d')](_0x34d9c1['query']);_0x169bde[_0xcf33('0x2e')]=_[_0xcf33('0x2f')](_0x169bde[_0xcf33('0x2b')],_0x169bde[_0xcf33('0x2c')]);_0xe4960f['attributes']=_['intersection'](_0x169bde[_0xcf33('0x2b')],qs[_0xcf33('0x31')](_0x34d9c1[_0xcf33('0x2c')][_0xcf33('0x31')]));_0xe4960f[_0xcf33('0x30')]=_0xe4960f[_0xcf33('0x30')][_0xcf33('0x32')]?_0xe4960f[_0xcf33('0x30')]:_0x169bde[_0xcf33('0x2b')];_0xe4960f['order']=qs[_0xcf33('0x34')](_0x34d9c1[_0xcf33('0x2c')]['sort']);_0xe4960f['where']=qs[_0xcf33('0x2e')](_[_0xcf33('0x46')](_0x34d9c1[_0xcf33('0x2c')],_0x169bde[_0xcf33('0x2e')]));if(_0x34d9c1[_0xcf33('0x2c')][_0xcf33('0x35')]){_0xe4960f[_0xcf33('0x36')]=_[_0xcf33('0x37')](_0xe4960f['where'],{'$or':_['map'](_0xe4960f[_0xcf33('0x30')],function(_0x1c411f){var _0x4daa5f={};_0x4daa5f[_0x1c411f]={'$like':'%'+_0x34d9c1[_0xcf33('0x2c')][_0xcf33('0x35')]+'%'};return _0x4daa5f;})});}_0xe4960f=_[_0xcf33('0x37')]({},_0xe4960f,_0x34d9c1[_0xcf33('0x39')]);return _0x34ff8b['getDescriptions'](_0xe4960f);}})[_0xcf33('0x1f')](function(_0x16db3f){if(_0x16db3f){_0x3fa20b=_0x16db3f[_0xcf33('0x32')];if(!_0x34d9c1['query'][_0xcf33('0x33')](_0xcf33('0x47'))){_0xe4960f[_0xcf33('0x19')]=qs['limit'](_0x34d9c1[_0xcf33('0x2c')][_0xcf33('0x19')]);_0xe4960f[_0xcf33('0x1b')]=qs['offset'](_0x34d9c1[_0xcf33('0x2c')][_0xcf33('0x1b')]);}return _0x34ff8b['getDescriptions'](_0xe4960f);}})[_0xcf33('0x1f')](function(_0x56e11b){if(_0x56e11b){return _0x56e11b?{'count':_0x3fa20b,'rows':_0x56e11b}:null;}})[_0xcf33('0x1f')](respondWithResult(_0x1220ee,null))[_0xcf33('0x41')](handleError(_0x1220ee,null));};exports[_0xcf33('0x4b')]=function(_0x1643dc,_0x2422a9,_0x2ec051){var _0x25a6fc={};var _0x12199d={};var _0x388500;var _0xe519bc;return db[_0xcf33('0x3a')][_0xcf33('0x44')]({'where':{'id':_0x1643dc['params']['id']}})['then'](handleEntityNotFound(_0x2422a9,null))[_0xcf33('0x1f')](function(_0x1166c9){if(_0x1166c9){_0x388500=_0x1166c9;_0x12199d[_0xcf33('0x2b')]=_[_0xcf33('0x2d')](db[_0xcf33('0x4c')][_0xcf33('0x27')]);_0x12199d['query']=_['keys'](_0x1643dc[_0xcf33('0x2c')]);_0x12199d[_0xcf33('0x2e')]=_['intersection'](_0x12199d[_0xcf33('0x2b')],_0x12199d[_0xcf33('0x2c')]);_0x25a6fc['attributes']=_[_0xcf33('0x2f')](_0x12199d['model'],qs[_0xcf33('0x31')](_0x1643dc[_0xcf33('0x2c')][_0xcf33('0x31')]));_0x25a6fc[_0xcf33('0x30')]=_0x25a6fc[_0xcf33('0x30')][_0xcf33('0x32')]?_0x25a6fc[_0xcf33('0x30')]:_0x12199d[_0xcf33('0x2b')];_0x25a6fc[_0xcf33('0x45')]=qs[_0xcf33('0x34')](_0x1643dc[_0xcf33('0x2c')][_0xcf33('0x34')]);_0x25a6fc[_0xcf33('0x36')]=qs[_0xcf33('0x2e')](_[_0xcf33('0x46')](_0x1643dc['query'],_0x12199d[_0xcf33('0x2e')]));if(_0x1643dc['query'][_0xcf33('0x35')]){_0x25a6fc['where']=_[_0xcf33('0x37')](_0x25a6fc['where'],{'$or':_[_0xcf33('0x26')](_0x25a6fc['attributes'],function(_0x5b5b46){var _0xb3e0da={};_0xb3e0da[_0x5b5b46]={'$like':'%'+_0x1643dc[_0xcf33('0x2c')][_0xcf33('0x35')]+'%'};return _0xb3e0da;})});}_0x25a6fc=_[_0xcf33('0x37')]({},_0x25a6fc,_0x1643dc[_0xcf33('0x39')]);return _0x388500[_0xcf33('0x4b')](_0x25a6fc);}})[_0xcf33('0x1f')](function(_0x4ffb13){if(_0x4ffb13){_0xe519bc=_0x4ffb13['length'];if(!_0x1643dc[_0xcf33('0x2c')][_0xcf33('0x33')](_0xcf33('0x47'))){_0x25a6fc[_0xcf33('0x19')]=qs[_0xcf33('0x19')](_0x1643dc[_0xcf33('0x2c')][_0xcf33('0x19')]);_0x25a6fc[_0xcf33('0x1b')]=qs[_0xcf33('0x1b')](_0x1643dc['query'][_0xcf33('0x1b')]);}return _0x388500[_0xcf33('0x4b')](_0x25a6fc);}})['then'](function(_0x57fd3b){if(_0x57fd3b){return _0x57fd3b?{'count':_0xe519bc,'rows':_0x57fd3b}:null;}})[_0xcf33('0x1f')](respondWithResult(_0x2422a9,null))[_0xcf33('0x41')](handleError(_0x2422a9,null));};exports[_0xcf33('0x4d')]=function(_0x5df4ca,_0x28222d,_0xc85169){if(_0x5df4ca[_0xcf33('0x40')]['id']){delete _0x5df4ca[_0xcf33('0x40')]['id'];}return db[_0xcf33('0x3a')][_0xcf33('0x44')]({'where':{'id':_0x5df4ca[_0xcf33('0x3e')]['id']}})[_0xcf33('0x1f')](handleEntityNotFound(_0x28222d,null))[_0xcf33('0x1f')](function(_0x51b60f){if(_0x51b60f){return _0x51b60f[_0xcf33('0x4d')](_0x5df4ca[_0xcf33('0x40')][_0xcf33('0x4e')]||[]);}return null;})[_0xcf33('0x1f')](respondWithResult(_0x28222d,null))[_0xcf33('0x41')](handleError(_0x28222d,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 0927f51..e8fe0e6 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 _0xf8b7=['../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x1496bc,_0x369cd5){var _0x4f8978=function(_0x32d2b7){while(--_0x32d2b7){_0x1496bc['push'](_0x1496bc['shift']());}};_0x4f8978(++_0x369cd5);}(_0xf8b7,0x1b5));var _0x7f8b=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0xf8b7[_0x2742db];return _0x18659e;};'use strict';var _=require(_0x7f8b('0x0'));var util=require(_0x7f8b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7f8b('0x2'));var BPromise=require(_0x7f8b('0x3'));var rp=require(_0x7f8b('0x4'));var fs=require('fs');var path=require(_0x7f8b('0x5'));var rimraf=require(_0x7f8b('0x6'));var config=require(_0x7f8b('0x7'));var attributes=require(_0x7f8b('0x8'));module[_0x7f8b('0x9')]=function(_0x10a516,_0xb4cd11){return _0x10a516['define'](_0x7f8b('0xa'),attributes,{'tableName':_0x7f8b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2675=['int_desk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration'];(function(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0x2675,0x143));var _0x5267=function(_0x17988b,_0x4d99e2){_0x17988b=_0x17988b-0x0;var _0x71054c=_0x2675[_0x17988b];return _0x71054c;};'use strict';var _=require(_0x5267('0x0'));var util=require(_0x5267('0x1'));var logger=require(_0x5267('0x2'))(_0x5267('0x3'));var moment=require('moment');var BPromise=require(_0x5267('0x4'));var rp=require(_0x5267('0x5'));var fs=require('fs');var path=require(_0x5267('0x6'));var rimraf=require(_0x5267('0x7'));var config=require(_0x5267('0x8'));var attributes=require(_0x5267('0x9'));module[_0x5267('0xa')]=function(_0x19581a,_0xf57ff0){return _0x19581a[_0x5267('0xb')](_0x5267('0xc'),attributes,{'tableName':_0x5267('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 5fd058a..7a45681 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 _0x2fc0=['code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x2fc0,0x192));var _0x02fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fc0[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x02fc('0x0'));var moment=require(_0x02fc('0x1'));var BPromise=require(_0x02fc('0x2'));var rs=require(_0x02fc('0x3'));var fs=require('fs');var Redis=require(_0x02fc('0x4'));var db=require(_0x02fc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x02fc('0x6'))(_0x02fc('0x7'));var config=require(_0x02fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x02fc('0x9')][_0x02fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a283b,_0x116104,_0x4ad1cd){return new BPromise(function(_0x6b7484,_0x3a154d){return client[_0x02fc('0xb')](_0x2a283b,_0x4ad1cd)[_0x02fc('0xc')](function(_0x57157c){logger[_0x02fc('0xd')](_0x02fc('0xe'),_0x116104,_0x02fc('0xf'));logger['debug'](_0x02fc('0x10'),_0x116104,_0x02fc('0xf'),JSON['stringify'](_0x57157c));if(_0x57157c[_0x02fc('0x11')]){if(_0x57157c[_0x02fc('0x11')][_0x02fc('0x12')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x116104,_0x57157c[_0x02fc('0x11')][_0x02fc('0x13')]);return _0x3a154d(_0x57157c[_0x02fc('0x11')][_0x02fc('0x13')]);}logger['error'](_0x02fc('0xe'),_0x116104,_0x57157c['error'][_0x02fc('0x13')]);return _0x6b7484(_0x57157c[_0x02fc('0x11')]['message']);}else{logger[_0x02fc('0xd')](_0x02fc('0xe'),_0x116104,_0x02fc('0xf'));_0x6b7484(_0x57157c[_0x02fc('0x14')]['message']);}})['catch'](function(_0x18f3c8){logger[_0x02fc('0x11')](_0x02fc('0xe'),_0x116104,_0x18f3c8);_0x3a154d(_0x18f3c8);});});} \ No newline at end of file +var _0xc1d3=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x46dea8,_0x5a1ff7){var _0x522092=function(_0x5ce7b0){while(--_0x5ce7b0){_0x46dea8['push'](_0x46dea8['shift']());}};_0x522092(++_0x5a1ff7);}(_0xc1d3,0x147));var _0x3c1d=function(_0x41e102,_0x5f1141){_0x41e102=_0x41e102-0x0;var _0x3bf523=_0xc1d3[_0x41e102];return _0x3bf523;};'use strict';var _=require(_0x3c1d('0x0'));var util=require(_0x3c1d('0x1'));var moment=require(_0x3c1d('0x2'));var BPromise=require(_0x3c1d('0x3'));var rs=require(_0x3c1d('0x4'));var fs=require('fs');var Redis=require(_0x3c1d('0x5'));var db=require(_0x3c1d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3c1d('0x7'));var config=require(_0x3c1d('0x8'));var jayson=require(_0x3c1d('0x9'));var client=jayson['client'][_0x3c1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36863b,_0x3bef1a,_0x28793c){return new BPromise(function(_0x1796a0,_0x58e08c){return client[_0x3c1d('0xb')](_0x36863b,_0x28793c)[_0x3c1d('0xc')](function(_0x33cb1b){logger[_0x3c1d('0xd')](_0x3c1d('0xe'),_0x3bef1a,_0x3c1d('0xf'));logger[_0x3c1d('0x10')](_0x3c1d('0x11'),_0x3bef1a,'request\x20sent',JSON[_0x3c1d('0x12')](_0x33cb1b));if(_0x33cb1b[_0x3c1d('0x13')]){if(_0x33cb1b[_0x3c1d('0x13')][_0x3c1d('0x14')]===0x1f4){logger[_0x3c1d('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x3bef1a,_0x33cb1b[_0x3c1d('0x13')][_0x3c1d('0x15')]);return _0x58e08c(_0x33cb1b['error'][_0x3c1d('0x15')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x3bef1a,_0x33cb1b['error'][_0x3c1d('0x15')]);return _0x1796a0(_0x33cb1b[_0x3c1d('0x13')][_0x3c1d('0x15')]);}else{logger[_0x3c1d('0xd')](_0x3c1d('0xe'),_0x3bef1a,_0x3c1d('0xf'));_0x1796a0(_0x33cb1b['result']['message']);}})[_0x3c1d('0x16')](function(_0x5ab3b0){logger[_0x3c1d('0x13')](_0x3c1d('0xe'),_0x3bef1a,_0x5ab3b0);_0x58e08c(_0x5ab3b0);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index f56a8f1..c3575a4 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 _0x024b=['delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x54aaba,_0x333651){var _0x3a2074=function(_0x1ef705){while(--_0x1ef705){_0x54aaba['push'](_0x54aaba['shift']());}};_0x3a2074(++_0x333651);}(_0x024b,0xac));var _0xb024=function(_0x4e78ec,_0x11f4f3){_0x4e78ec=_0x4e78ec-0x0;var _0x5a78cd=_0x024b[_0x4e78ec];return _0x5a78cd;};'use strict';var multer=require(_0xb024('0x0'));var util=require(_0xb024('0x1'));var path=require(_0xb024('0x2'));var timeout=require('connect-timeout');var express=require(_0xb024('0x3'));var router=express[_0xb024('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb024('0x5'));var interaction=require(_0xb024('0x6'));var config=require('../../config/environment');var controller=require(_0xb024('0x7'));router[_0xb024('0x8')]('/',auth[_0xb024('0x9')](),controller['index']);router['get'](_0xb024('0xa'),auth[_0xb024('0x9')](),controller[_0xb024('0xb')]);router[_0xb024('0xc')]('/',auth[_0xb024('0x9')](),controller[_0xb024('0xd')]);router['put'](_0xb024('0xa'),auth[_0xb024('0x9')](),controller[_0xb024('0xe')]);router[_0xb024('0xf')](_0xb024('0xa'),auth['isAuthenticated'](),controller[_0xb024('0x10')]);module['exports']=router; \ No newline at end of file +var _0xbed6=['destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','create','delete'];(function(_0x231e5a,_0x1718f8){var _0x216a7d=function(_0x212271){while(--_0x212271){_0x231e5a['push'](_0x231e5a['shift']());}};_0x216a7d(++_0x1718f8);}(_0xbed6,0x172));var _0x6bed=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xbed6[_0x2dea24];return _0x309d58;};'use strict';var multer=require('multer');var util=require(_0x6bed('0x0'));var path=require(_0x6bed('0x1'));var timeout=require(_0x6bed('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6bed('0x3'));var interaction=require(_0x6bed('0x4'));var config=require(_0x6bed('0x5'));var controller=require(_0x6bed('0x6'));router[_0x6bed('0x7')]('/',auth[_0x6bed('0x8')](),controller[_0x6bed('0x9')]);router['get'](_0x6bed('0xa'),auth[_0x6bed('0x8')](),controller[_0x6bed('0xb')]);router['post']('/',auth[_0x6bed('0x8')](),controller[_0x6bed('0xc')]);router['put']('/:id',auth[_0x6bed('0x8')](),controller['update']);router[_0x6bed('0xd')](_0x6bed('0xa'),auth[_0x6bed('0x8')](),controller[_0x6bed('0xe')]);module[_0x6bed('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index ef992b6..297cab5 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 _0xaa04=['BOOLEAN','sequelize','ENUM','keyValue','picklist','string','STRING','variable','customVariable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa04,0x6d));var _0x4aa0=function(_0x32b47c,_0x408bb5){_0x32b47c=_0x32b47c-0x0;var _0x4023aa=_0xaa04[_0x32b47c];return _0x4023aa;};'use strict';var Sequelize=require(_0x4aa0('0x0'));module['exports']={'type':{'type':Sequelize[_0x4aa0('0x1')]('string','variable','customVariable',_0x4aa0('0x2'),_0x4aa0('0x3')),'defaultValue':_0x4aa0('0x4')},'content':{'type':Sequelize[_0x4aa0('0x5')]},'key':{'type':Sequelize[_0x4aa0('0x5')]},'keyType':{'type':Sequelize[_0x4aa0('0x1')]('string',_0x4aa0('0x6'),_0x4aa0('0x7'))},'keyContent':{'type':Sequelize[_0x4aa0('0x5')]},'idField':{'type':Sequelize[_0x4aa0('0x5')]},'nameField':{'type':Sequelize[_0x4aa0('0x5')]},'customField':{'type':Sequelize[_0x4aa0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfe84=['string','customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x29a4db,_0x28bbc7){var _0x290c5a=function(_0x1910af){while(--_0x1910af){_0x29a4db['push'](_0x29a4db['shift']());}};_0x290c5a(++_0x28bbc7);}(_0xfe84,0x1a4));var _0x4fe8=function(_0x2c93a2,_0x1c1e3b){_0x2c93a2=_0x2c93a2-0x0;var _0x5bde6c=_0xfe84[_0x2c93a2];return _0x5bde6c;};'use strict';var Sequelize=require(_0x4fe8('0x0'));module[_0x4fe8('0x1')]={'type':{'type':Sequelize[_0x4fe8('0x2')](_0x4fe8('0x3'),'variable',_0x4fe8('0x4'),_0x4fe8('0x5'),'picklist'),'defaultValue':_0x4fe8('0x3')},'content':{'type':Sequelize[_0x4fe8('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4fe8('0x2')](_0x4fe8('0x3'),_0x4fe8('0x7'),_0x4fe8('0x4'))},'keyContent':{'type':Sequelize[_0x4fe8('0x6')]},'idField':{'type':Sequelize[_0x4fe8('0x6')]},'nameField':{'type':Sequelize[_0x4fe8('0x6')]},'customField':{'type':Sequelize[_0x4fe8('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4fe8('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 835dd74..e677356 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 _0xc891=['moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','name','send','DeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','params','create','body','find','catch','destroy','eml-format','fast-json-patch'];(function(_0x46848e,_0xe1b792){var _0x3fcfcb=function(_0x2777dd){while(--_0x2777dd){_0x46848e['push'](_0x46848e['shift']());}};_0x3fcfcb(++_0xe1b792);}(_0xc891,0x152));var _0x1c89=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc891[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x1c89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1c89('0x1'));var rp=require('request-promise');var moment=require(_0x1c89('0x2'));var BPromise=require(_0x1c89('0x3'));var Mustache=require(_0x1c89('0x4'));var util=require('util');var path=require(_0x1c89('0x5'));var sox=require(_0x1c89('0x6'));var csv=require(_0x1c89('0x7'));var ejs=require(_0x1c89('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c89('0x9'));var squel=require(_0x1c89('0xa'));var crypto=require('crypto');var jsforce=require(_0x1c89('0xb'));var deskjs=require(_0x1c89('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1c89('0xd'));var Papa=require('papaparse');var Redis=require(_0x1c89('0xe'));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(_0x1c89('0xf'))('api');var utils=require(_0x1c89('0x10'));var config=require(_0x1c89('0x11'));var licenseUtil=require(_0x1c89('0x12'));var db=require(_0x1c89('0x13'))['db'];function respondWithStatusCode(_0x7a4a2b,_0x27e7c0){_0x27e7c0=_0x27e7c0||0xcc;return function(_0x393b5f){if(_0x393b5f){return _0x7a4a2b[_0x1c89('0x14')](_0x27e7c0);}return _0x7a4a2b['status'](_0x27e7c0)[_0x1c89('0x15')]();};}function respondWithResult(_0x514e4d,_0x46be15){_0x46be15=_0x46be15||0xc8;return function(_0x424651){if(_0x424651){return _0x514e4d[_0x1c89('0x16')](_0x46be15)['json'](_0x424651);}};}function respondWithFilteredResult(_0x45354d,_0x29602e){return function(_0x2c9572){if(_0x2c9572){var _0x4af31b=typeof _0x29602e[_0x1c89('0x17')]===_0x1c89('0x18')&&typeof _0x29602e[_0x1c89('0x19')]===_0x1c89('0x18');var _0x33afcf=_0x2c9572[_0x1c89('0x1a')];var _0x2cb186=_0x4af31b?0x0:_0x29602e[_0x1c89('0x17')];var _0x166444=_0x4af31b?_0x2c9572[_0x1c89('0x1a')]:_0x29602e[_0x1c89('0x17')]+_0x29602e['limit'];var _0x18ce93;if(_0x166444>=_0x33afcf){_0x166444=_0x33afcf;_0x18ce93=0xc8;}else{_0x18ce93=0xce;}_0x45354d[_0x1c89('0x16')](_0x18ce93);return _0x45354d['set'](_0x1c89('0x1b'),_0x2cb186+'-'+_0x166444+'/'+_0x33afcf)[_0x1c89('0x1c')](_0x2c9572);}return null;};}function patchUpdates(_0x14121c){return function(_0x43a17a){try{jsonpatch['apply'](_0x43a17a,_0x14121c,!![]);}catch(_0x4ef155){return BPromise[_0x1c89('0x1d')](_0x4ef155);}return _0x43a17a[_0x1c89('0x1e')]();};}function saveUpdates(_0x253e07,_0x23def1){return function(_0x5b4fbc){if(_0x5b4fbc){return _0x5b4fbc[_0x1c89('0x1f')](_0x253e07)[_0x1c89('0x20')](function(_0x4fbd33){return _0x4fbd33;});}return null;};}function removeEntity(_0x45f604,_0x26a1cc){return function(_0x1ac0cc){if(_0x1ac0cc){return _0x1ac0cc['destroy']()[_0x1c89('0x20')](function(){_0x45f604[_0x1c89('0x16')](0xcc)[_0x1c89('0x15')]();});}};}function handleEntityNotFound(_0x59a87e,_0x22afe9){return function(_0x49f69b){if(!_0x49f69b){_0x59a87e['sendStatus'](0x194);}return _0x49f69b;};}function handleError(_0x35cc05,_0x352449){_0x352449=_0x352449||0x1f4;return function(_0x4c4694){logger['error'](_0x4c4694['stack']);if(_0x4c4694[_0x1c89('0x21')]){delete _0x4c4694['name'];}_0x35cc05['status'](_0x352449)[_0x1c89('0x22')](_0x4c4694);};}exports['index']=function(_0x193d8d,_0x51aa70){var _0x4dac46={},_0x25500d={},_0x10dc12={'count':0x0,'rows':[]};var _0x14f7cb=_['map'](db[_0x1c89('0x23')][_0x1c89('0x24')],function(_0x487916){return{'name':_0x487916[_0x1c89('0x25')],'type':_0x487916['type'][_0x1c89('0x26')]};});_0x25500d[_0x1c89('0x27')]=_[_0x1c89('0x28')](_0x14f7cb,_0x1c89('0x21'));_0x25500d[_0x1c89('0x29')]=_[_0x1c89('0x2a')](_0x193d8d[_0x1c89('0x29')]);_0x25500d[_0x1c89('0x2b')]=_[_0x1c89('0x2c')](_0x25500d[_0x1c89('0x27')],_0x25500d['query']);_0x4dac46[_0x1c89('0x2d')]=_['intersection'](_0x25500d['model'],qs[_0x1c89('0x2e')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x4dac46[_0x1c89('0x2d')]=_0x4dac46[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x4dac46[_0x1c89('0x2d')]:_0x25500d[_0x1c89('0x27')];if(!_0x193d8d[_0x1c89('0x29')][_0x1c89('0x30')](_0x1c89('0x31'))){_0x4dac46['limit']=qs['limit'](_0x193d8d[_0x1c89('0x29')]['limit']);_0x4dac46['offset']=qs[_0x1c89('0x17')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x17')]);}_0x4dac46[_0x1c89('0x32')]=qs[_0x1c89('0x33')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x33')]);_0x4dac46['where']=qs[_0x1c89('0x2b')](_[_0x1c89('0x34')](_0x193d8d['query'],_0x25500d[_0x1c89('0x2b')]),_0x14f7cb);if(_0x193d8d[_0x1c89('0x29')][_0x1c89('0x35')]){_0x4dac46[_0x1c89('0x36')]=_[_0x1c89('0x37')](_0x4dac46['where'],{'$or':_[_0x1c89('0x28')](_0x14f7cb,function(_0x2e6ebd){if(_0x2e6ebd[_0x1c89('0x38')]!=='VIRTUAL'){var _0xed5122={};_0xed5122[_0x2e6ebd['name']]={'$like':'%'+_0x193d8d[_0x1c89('0x29')]['filter']+'%'};return _0xed5122;}})});}_0x4dac46=_[_0x1c89('0x37')]({},_0x4dac46,_0x193d8d[_0x1c89('0x39')]);var _0x45152f={'where':_0x4dac46[_0x1c89('0x36')]};return db[_0x1c89('0x23')][_0x1c89('0x1a')](_0x45152f)[_0x1c89('0x20')](function(_0x1b8566){_0x10dc12[_0x1c89('0x1a')]=_0x1b8566;if(_0x193d8d['query'][_0x1c89('0x3a')]){_0x4dac46[_0x1c89('0x3b')]=[{'all':!![]}];}return db[_0x1c89('0x23')][_0x1c89('0x3c')](_0x4dac46);})['then'](function(_0x36e3a7){_0x10dc12[_0x1c89('0x3d')]=_0x36e3a7;return _0x10dc12;})[_0x1c89('0x20')](respondWithFilteredResult(_0x51aa70,_0x4dac46))['catch'](handleError(_0x51aa70,null));};exports['show']=function(_0xa1d4bb,_0x21fa5c){var _0x5f33c0={'raw':!![],'where':{'id':_0xa1d4bb[_0x1c89('0x3e')]['id']}},_0xebb4c3={};_0xebb4c3[_0x1c89('0x27')]=_[_0x1c89('0x2a')](db[_0x1c89('0x23')][_0x1c89('0x24')]);_0xebb4c3[_0x1c89('0x29')]=_['keys'](_0xa1d4bb[_0x1c89('0x29')]);_0xebb4c3['filters']=_['intersection'](_0xebb4c3[_0x1c89('0x27')],_0xebb4c3[_0x1c89('0x29')]);_0x5f33c0[_0x1c89('0x2d')]=_[_0x1c89('0x2c')](_0xebb4c3[_0x1c89('0x27')],qs[_0x1c89('0x2e')](_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x5f33c0[_0x1c89('0x2d')]=_0x5f33c0[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x5f33c0[_0x1c89('0x2d')]:_0xebb4c3[_0x1c89('0x27')];if(_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x3a')]){_0x5f33c0[_0x1c89('0x3b')]=[{'all':!![]}];}_0x5f33c0=_['merge']({},_0x5f33c0,_0xa1d4bb[_0x1c89('0x39')]);return db['DeskField']['find'](_0x5f33c0)[_0x1c89('0x20')](handleEntityNotFound(_0x21fa5c,null))['then'](respondWithResult(_0x21fa5c,null))['catch'](handleError(_0x21fa5c,null));};exports[_0x1c89('0x3f')]=function(_0x4b4d3f,_0x5f102d){return db['DeskField'][_0x1c89('0x3f')](_0x4b4d3f['body'],{})[_0x1c89('0x20')](respondWithResult(_0x5f102d,0xc9))['catch'](handleError(_0x5f102d,null));};exports[_0x1c89('0x1f')]=function(_0x5114bb,_0x36d5fc){if(_0x5114bb[_0x1c89('0x40')]['id']){delete _0x5114bb[_0x1c89('0x40')]['id'];}return db['DeskField'][_0x1c89('0x41')]({'where':{'id':_0x5114bb[_0x1c89('0x3e')]['id']}})['then'](handleEntityNotFound(_0x36d5fc,null))['then'](saveUpdates(_0x5114bb[_0x1c89('0x40')],null))[_0x1c89('0x20')](respondWithResult(_0x36d5fc,null))[_0x1c89('0x42')](handleError(_0x36d5fc,null));};exports[_0x1c89('0x43')]=function(_0x94f616,_0x392fdb){return db[_0x1c89('0x23')][_0x1c89('0x41')]({'where':{'id':_0x94f616[_0x1c89('0x3e')]['id']}})[_0x1c89('0x20')](handleEntityNotFound(_0x392fdb,null))[_0x1c89('0x20')](removeEntity(_0x392fdb,null))[_0x1c89('0x42')](handleError(_0x392fdb,null));}; \ No newline at end of file +var _0xcc05=['request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','reject','save','update','then','destroy','error','name','send','index','map','DeskField','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','fast-json-patch'];(function(_0x47ee75,_0x1f3af2){var _0x4490aa=function(_0x308443){while(--_0x308443){_0x47ee75['push'](_0x47ee75['shift']());}};_0x4490aa(++_0x1f3af2);}(_0xcc05,0x95));var _0x5cc0=function(_0x16d7ce,_0x2f5205){_0x16d7ce=_0x16d7ce-0x0;var _0xf47827=_0xcc05[_0x16d7ce];return _0xf47827;};'use strict';var emlformat=require(_0x5cc0('0x0'));var rimraf=require(_0x5cc0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5cc0('0x2'));var rp=require(_0x5cc0('0x3'));var moment=require(_0x5cc0('0x4'));var BPromise=require(_0x5cc0('0x5'));var Mustache=require(_0x5cc0('0x6'));var util=require(_0x5cc0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5cc0('0x8'));var ejs=require(_0x5cc0('0x9'));var fs=require('fs');var fs_extra=require(_0x5cc0('0xa'));var _=require('lodash');var squel=require(_0x5cc0('0xb'));var crypto=require(_0x5cc0('0xc'));var jsforce=require(_0x5cc0('0xd'));var deskjs=require(_0x5cc0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5cc0('0xf'));var Papa=require(_0x5cc0('0x10'));var Redis=require(_0x5cc0('0x11'));var authService=require(_0x5cc0('0x12'));var qs=require(_0x5cc0('0x13'));var as=require(_0x5cc0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5cc0('0x15'));var config=require(_0x5cc0('0x16'));var licenseUtil=require(_0x5cc0('0x17'));var db=require(_0x5cc0('0x18'))['db'];function respondWithStatusCode(_0x56f434,_0x16e2bd){_0x16e2bd=_0x16e2bd||0xcc;return function(_0x184b47){if(_0x184b47){return _0x56f434[_0x5cc0('0x19')](_0x16e2bd);}return _0x56f434[_0x5cc0('0x1a')](_0x16e2bd)[_0x5cc0('0x1b')]();};}function respondWithResult(_0x2a2d45,_0x447cfc){_0x447cfc=_0x447cfc||0xc8;return function(_0x44d17b){if(_0x44d17b){return _0x2a2d45['status'](_0x447cfc)[_0x5cc0('0x1c')](_0x44d17b);}};}function respondWithFilteredResult(_0x467956,_0x30ffb7){return function(_0x245173){if(_0x245173){var _0x3efaaa=typeof _0x30ffb7[_0x5cc0('0x1d')]===_0x5cc0('0x1e')&&typeof _0x30ffb7[_0x5cc0('0x1f')]==='undefined';var _0x21ab34=_0x245173['count'];var _0x340a3a=_0x3efaaa?0x0:_0x30ffb7[_0x5cc0('0x1d')];var _0x5227bb=_0x3efaaa?_0x245173['count']:_0x30ffb7[_0x5cc0('0x1d')]+_0x30ffb7['limit'];var _0x2d8980;if(_0x5227bb>=_0x21ab34){_0x5227bb=_0x21ab34;_0x2d8980=0xc8;}else{_0x2d8980=0xce;}_0x467956['status'](_0x2d8980);return _0x467956[_0x5cc0('0x20')]('Content-Range',_0x340a3a+'-'+_0x5227bb+'/'+_0x21ab34)[_0x5cc0('0x1c')](_0x245173);}return null;};}function patchUpdates(_0x322eaa){return function(_0x37d2d7){try{jsonpatch['apply'](_0x37d2d7,_0x322eaa,!![]);}catch(_0x44329f){return BPromise[_0x5cc0('0x21')](_0x44329f);}return _0x37d2d7[_0x5cc0('0x22')]();};}function saveUpdates(_0x23ac54,_0x51ab2f){return function(_0x1d9a3f){if(_0x1d9a3f){return _0x1d9a3f[_0x5cc0('0x23')](_0x23ac54)[_0x5cc0('0x24')](function(_0x15fa7f){return _0x15fa7f;});}return null;};}function removeEntity(_0x4df880,_0x1326bd){return function(_0x1520c5){if(_0x1520c5){return _0x1520c5[_0x5cc0('0x25')]()[_0x5cc0('0x24')](function(){_0x4df880[_0x5cc0('0x1a')](0xcc)[_0x5cc0('0x1b')]();});}};}function handleEntityNotFound(_0x4a2ae6,_0x41bca7){return function(_0x2b5583){if(!_0x2b5583){_0x4a2ae6[_0x5cc0('0x19')](0x194);}return _0x2b5583;};}function handleError(_0x1a8a1e,_0x47c2fa){_0x47c2fa=_0x47c2fa||0x1f4;return function(_0x5782d1){logger[_0x5cc0('0x26')](_0x5782d1['stack']);if(_0x5782d1[_0x5cc0('0x27')]){delete _0x5782d1['name'];}_0x1a8a1e['status'](_0x47c2fa)[_0x5cc0('0x28')](_0x5782d1);};}exports[_0x5cc0('0x29')]=function(_0xb7b984,_0x375bd7){var _0x43eb6e={},_0x1ea63b={},_0x2fb55d={'count':0x0,'rows':[]};var _0x2c32e9=_[_0x5cc0('0x2a')](db[_0x5cc0('0x2b')]['rawAttributes'],function(_0x5d21cc){return{'name':_0x5d21cc[_0x5cc0('0x2c')],'type':_0x5d21cc['type'][_0x5cc0('0x2d')]};});_0x1ea63b[_0x5cc0('0x2e')]=_[_0x5cc0('0x2a')](_0x2c32e9,_0x5cc0('0x27'));_0x1ea63b[_0x5cc0('0x2f')]=_[_0x5cc0('0x30')](_0xb7b984[_0x5cc0('0x2f')]);_0x1ea63b['filters']=_[_0x5cc0('0x31')](_0x1ea63b['model'],_0x1ea63b[_0x5cc0('0x2f')]);_0x43eb6e[_0x5cc0('0x32')]=_['intersection'](_0x1ea63b['model'],qs[_0x5cc0('0x33')](_0xb7b984[_0x5cc0('0x2f')][_0x5cc0('0x33')]));_0x43eb6e[_0x5cc0('0x32')]=_0x43eb6e[_0x5cc0('0x32')][_0x5cc0('0x34')]?_0x43eb6e[_0x5cc0('0x32')]:_0x1ea63b[_0x5cc0('0x2e')];if(!_0xb7b984[_0x5cc0('0x2f')][_0x5cc0('0x35')](_0x5cc0('0x36'))){_0x43eb6e['limit']=qs['limit'](_0xb7b984[_0x5cc0('0x2f')]['limit']);_0x43eb6e[_0x5cc0('0x1d')]=qs[_0x5cc0('0x1d')](_0xb7b984[_0x5cc0('0x2f')][_0x5cc0('0x1d')]);}_0x43eb6e[_0x5cc0('0x37')]=qs[_0x5cc0('0x38')](_0xb7b984[_0x5cc0('0x2f')][_0x5cc0('0x38')]);_0x43eb6e[_0x5cc0('0x39')]=qs[_0x5cc0('0x3a')](_[_0x5cc0('0x3b')](_0xb7b984['query'],_0x1ea63b['filters']),_0x2c32e9);if(_0xb7b984[_0x5cc0('0x2f')][_0x5cc0('0x3c')]){_0x43eb6e[_0x5cc0('0x39')]=_[_0x5cc0('0x3d')](_0x43eb6e[_0x5cc0('0x39')],{'$or':_[_0x5cc0('0x2a')](_0x2c32e9,function(_0x23ea76){if(_0x23ea76[_0x5cc0('0x3e')]!=='VIRTUAL'){var _0xe46171={};_0xe46171[_0x23ea76['name']]={'$like':'%'+_0xb7b984[_0x5cc0('0x2f')][_0x5cc0('0x3c')]+'%'};return _0xe46171;}})});}_0x43eb6e=_[_0x5cc0('0x3d')]({},_0x43eb6e,_0xb7b984[_0x5cc0('0x3f')]);var _0x5dbc0d={'where':_0x43eb6e[_0x5cc0('0x39')]};return db['DeskField']['count'](_0x5dbc0d)[_0x5cc0('0x24')](function(_0x59e0c5){_0x2fb55d[_0x5cc0('0x40')]=_0x59e0c5;if(_0xb7b984[_0x5cc0('0x2f')][_0x5cc0('0x41')]){_0x43eb6e[_0x5cc0('0x42')]=[{'all':!![]}];}return db[_0x5cc0('0x2b')][_0x5cc0('0x43')](_0x43eb6e);})[_0x5cc0('0x24')](function(_0x307036){_0x2fb55d[_0x5cc0('0x44')]=_0x307036;return _0x2fb55d;})[_0x5cc0('0x24')](respondWithFilteredResult(_0x375bd7,_0x43eb6e))['catch'](handleError(_0x375bd7,null));};exports[_0x5cc0('0x45')]=function(_0x3f3d57,_0x455c1f){var _0x2ce23d={'raw':!![],'where':{'id':_0x3f3d57[_0x5cc0('0x46')]['id']}},_0x22abc6={};_0x22abc6['model']=_['keys'](db[_0x5cc0('0x2b')][_0x5cc0('0x47')]);_0x22abc6[_0x5cc0('0x2f')]=_[_0x5cc0('0x30')](_0x3f3d57['query']);_0x22abc6[_0x5cc0('0x3a')]=_[_0x5cc0('0x31')](_0x22abc6[_0x5cc0('0x2e')],_0x22abc6[_0x5cc0('0x2f')]);_0x2ce23d[_0x5cc0('0x32')]=_[_0x5cc0('0x31')](_0x22abc6[_0x5cc0('0x2e')],qs['fields'](_0x3f3d57[_0x5cc0('0x2f')][_0x5cc0('0x33')]));_0x2ce23d[_0x5cc0('0x32')]=_0x2ce23d[_0x5cc0('0x32')][_0x5cc0('0x34')]?_0x2ce23d[_0x5cc0('0x32')]:_0x22abc6['model'];if(_0x3f3d57[_0x5cc0('0x2f')][_0x5cc0('0x41')]){_0x2ce23d[_0x5cc0('0x42')]=[{'all':!![]}];}_0x2ce23d=_[_0x5cc0('0x3d')]({},_0x2ce23d,_0x3f3d57[_0x5cc0('0x3f')]);return db[_0x5cc0('0x2b')][_0x5cc0('0x48')](_0x2ce23d)['then'](handleEntityNotFound(_0x455c1f,null))[_0x5cc0('0x24')](respondWithResult(_0x455c1f,null))[_0x5cc0('0x49')](handleError(_0x455c1f,null));};exports['create']=function(_0x353ed4,_0x369ae1){return db[_0x5cc0('0x2b')][_0x5cc0('0x4a')](_0x353ed4[_0x5cc0('0x4b')],{})[_0x5cc0('0x24')](respondWithResult(_0x369ae1,0xc9))[_0x5cc0('0x49')](handleError(_0x369ae1,null));};exports['update']=function(_0xa2007,_0x138495){if(_0xa2007[_0x5cc0('0x4b')]['id']){delete _0xa2007['body']['id'];}return db['DeskField'][_0x5cc0('0x48')]({'where':{'id':_0xa2007[_0x5cc0('0x46')]['id']}})[_0x5cc0('0x24')](handleEntityNotFound(_0x138495,null))[_0x5cc0('0x24')](saveUpdates(_0xa2007[_0x5cc0('0x4b')],null))[_0x5cc0('0x24')](respondWithResult(_0x138495,null))['catch'](handleError(_0x138495,null));};exports[_0x5cc0('0x25')]=function(_0x1ee931,_0x730dc9){return db[_0x5cc0('0x2b')][_0x5cc0('0x48')]({'where':{'id':_0x1ee931[_0x5cc0('0x46')]['id']}})[_0x5cc0('0x24')](handleEntityNotFound(_0x730dc9,null))[_0x5cc0('0x24')](removeEntity(_0x730dc9,null))[_0x5cc0('0x49')](handleError(_0x730dc9,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 08c8b4e..f600625 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 _0x92ba=['int_desk_fields','idField','FieldId','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','DeskField'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x92ba,0x6b));var _0xa92b=function(_0x5f5036,_0x23289b){_0x5f5036=_0x5f5036-0x0;var _0x2140f7=_0x92ba[_0x5f5036];return _0x2140f7;};'use strict';var _=require(_0xa92b('0x0'));var util=require('util');var logger=require(_0xa92b('0x1'))('api');var moment=require(_0xa92b('0x2'));var BPromise=require('bluebird');var rp=require(_0xa92b('0x3'));var fs=require('fs');var path=require(_0xa92b('0x4'));var rimraf=require(_0xa92b('0x5'));var config=require(_0xa92b('0x6'));var attributes=require('./intDeskField.attributes');module[_0xa92b('0x7')]=function(_0x49f103,_0x4870e1){return _0x49f103[_0xa92b('0x8')](_0xa92b('0x9'),attributes,{'tableName':_0xa92b('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xa92b('0xb'),_0xa92b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0973=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0973,0x157));var _0x3097=function(_0x21ac74,_0x2d2e10){_0x21ac74=_0x21ac74-0x0;var _0x2a039d=_0x0973[_0x21ac74];return _0x2a039d;};'use strict';var _=require(_0x3097('0x0'));var util=require(_0x3097('0x1'));var logger=require(_0x3097('0x2'))(_0x3097('0x3'));var moment=require(_0x3097('0x4'));var BPromise=require(_0x3097('0x5'));var rp=require(_0x3097('0x6'));var fs=require('fs');var path=require(_0x3097('0x7'));var rimraf=require(_0x3097('0x8'));var config=require(_0x3097('0x9'));var attributes=require(_0x3097('0xa'));module[_0x3097('0xb')]=function(_0x26bd7f,_0x37c7db){return _0x26bd7f[_0x3097('0xc')](_0x3097('0xd'),attributes,{'tableName':_0x3097('0xe'),'paranoid':![],'indexes':[{'name':_0x3097('0xf'),'fields':[_0x3097('0x10'),_0x3097('0x11')],'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 240c978..0752baa 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 _0xeb16=['../../config/environment','jayson/promise','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0xe1370a,_0x4a7df6){var _0x5e6a5a=function(_0x119fcb){while(--_0x119fcb){_0xe1370a['push'](_0xe1370a['shift']());}};_0x5e6a5a(++_0x4a7df6);}(_0xeb16,0xfe));var _0x6eb1=function(_0x1cb073,_0x4c8a52){_0x1cb073=_0x1cb073-0x0;var _0x1fd148=_0xeb16[_0x1cb073];return _0x1fd148;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6eb1('0x0'));var BPromise=require(_0x6eb1('0x1'));var rs=require(_0x6eb1('0x2'));var fs=require('fs');var Redis=require(_0x6eb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6eb1('0x4'));var logger=require('../../config/logger')(_0x6eb1('0x5'));var config=require(_0x6eb1('0x6'));var jayson=require(_0x6eb1('0x7'));var client=jayson[_0x6eb1('0x8')][_0x6eb1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32a742,_0x14979e,_0x46fe0b){return new BPromise(function(_0x16d235,_0x5e1970){return client[_0x6eb1('0xa')](_0x32a742,_0x46fe0b)[_0x6eb1('0xb')](function(_0xbe5c50){logger['info'](_0x6eb1('0xc'),_0x14979e,_0x6eb1('0xd'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x14979e,'request\x20sent',JSON[_0x6eb1('0xe')](_0xbe5c50));if(_0xbe5c50['error']){if(_0xbe5c50[_0x6eb1('0xf')][_0x6eb1('0x10')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x14979e,_0xbe5c50['error'][_0x6eb1('0x11')]);return _0x5e1970(_0xbe5c50[_0x6eb1('0xf')][_0x6eb1('0x11')]);}logger['error'](_0x6eb1('0xc'),_0x14979e,_0xbe5c50[_0x6eb1('0xf')][_0x6eb1('0x11')]);return _0x16d235(_0xbe5c50[_0x6eb1('0xf')][_0x6eb1('0x11')]);}else{logger['info'](_0x6eb1('0xc'),_0x14979e,_0x6eb1('0xd'));_0x16d235(_0xbe5c50[_0x6eb1('0x12')]['message']);}})[_0x6eb1('0x13')](function(_0x818a8a){logger[_0x6eb1('0xf')](_0x6eb1('0xc'),_0x14979e,_0x818a8a);_0x5e1970(_0x818a8a);});});} \ No newline at end of file +var _0x8995=['client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x8995,0x8a));var _0x5899=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x8995[_0x179e11];return _0x549f04;};'use strict';var _=require(_0x5899('0x0'));var util=require('util');var moment=require(_0x5899('0x1'));var BPromise=require('bluebird');var rs=require(_0x5899('0x2'));var fs=require('fs');var Redis=require(_0x5899('0x3'));var db=require(_0x5899('0x4'))['db'];var utils=require(_0x5899('0x5'));var logger=require(_0x5899('0x6'))(_0x5899('0x7'));var config=require('../../config/environment');var jayson=require(_0x5899('0x8'));var client=jayson[_0x5899('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x425ff5,_0x58922f,_0xede598){return new BPromise(function(_0x22d584,_0x237bdb){return client[_0x5899('0xa')](_0x425ff5,_0xede598)[_0x5899('0xb')](function(_0x30f952){logger[_0x5899('0xc')](_0x5899('0xd'),_0x58922f,_0x5899('0xe'));logger[_0x5899('0xf')](_0x5899('0x10'),_0x58922f,_0x5899('0xe'),JSON[_0x5899('0x11')](_0x30f952));if(_0x30f952[_0x5899('0x12')]){if(_0x30f952[_0x5899('0x12')][_0x5899('0x13')]===0x1f4){logger[_0x5899('0x12')](_0x5899('0xd'),_0x58922f,_0x30f952[_0x5899('0x12')][_0x5899('0x14')]);return _0x237bdb(_0x30f952[_0x5899('0x12')]['message']);}logger['error'](_0x5899('0xd'),_0x58922f,_0x30f952[_0x5899('0x12')][_0x5899('0x14')]);return _0x22d584(_0x30f952[_0x5899('0x12')][_0x5899('0x14')]);}else{logger[_0x5899('0xc')]('DeskField,\x20%s,\x20%s',_0x58922f,'request\x20sent');_0x22d584(_0x30f952['result'][_0x5899('0x14')]);}})['catch'](function(_0x52c45c){logger[_0x5899('0x12')]('DeskField,\x20%s,\x20%s',_0x58922f,_0x52c45c);_0x237bdb(_0x52c45c);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index ce27f09..e1fa0b9 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 _0xbfdd=['../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','put','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4489ce,_0x34237b){var _0x3a2d83=function(_0x132ebd){while(--_0x132ebd){_0x4489ce['push'](_0x4489ce['shift']());}};_0x3a2d83(++_0x34237b);}(_0xbfdd,0xfd));var _0xdbfd=function(_0x364e2b,_0x30b028){_0x364e2b=_0x364e2b-0x0;var _0x943fef=_0xbfdd[_0x364e2b];return _0x943fef;};'use strict';var multer=require(_0xdbfd('0x0'));var util=require('util');var path=require(_0xdbfd('0x1'));var timeout=require('connect-timeout');var express=require(_0xdbfd('0x2'));var router=express[_0xdbfd('0x3')]();var fs_extra=require(_0xdbfd('0x4'));var auth=require(_0xdbfd('0x5'));var interaction=require(_0xdbfd('0x6'));var config=require(_0xdbfd('0x7'));var controller=require(_0xdbfd('0x8'));router['get']('/',auth[_0xdbfd('0x9')](),controller[_0xdbfd('0xa')]);router[_0xdbfd('0xb')](_0xdbfd('0xc'),auth['isAuthenticated'](),controller[_0xdbfd('0xd')]);router['get'](_0xdbfd('0xe'),auth['isAuthenticated'](),controller[_0xdbfd('0xf')]);router['get'](_0xdbfd('0x10'),auth[_0xdbfd('0x9')](),controller['getFields']);router[_0xdbfd('0x11')]('/',auth[_0xdbfd('0x9')](),controller['create']);router[_0xdbfd('0x11')](_0xdbfd('0xe'),auth[_0xdbfd('0x9')](),controller['addConfiguration']);router[_0xdbfd('0x12')]('/:id',auth[_0xdbfd('0x9')](),controller['update']);router[_0xdbfd('0x13')](_0xdbfd('0xc'),auth[_0xdbfd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x20e4=['../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','Router'];(function(_0x5c72a5,_0x4e4214){var _0x3c2daf=function(_0x475ea6){while(--_0x475ea6){_0x5c72a5['push'](_0x5c72a5['shift']());}};_0x3c2daf(++_0x4e4214);}(_0x20e4,0xd9));var _0x420e=function(_0x51eb43,_0x9b9259){_0x51eb43=_0x51eb43-0x0;var _0x519690=_0x20e4[_0x51eb43];return _0x519690;};'use strict';var multer=require(_0x420e('0x0'));var util=require('util');var path=require(_0x420e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x420e('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x420e('0x3'));var config=require(_0x420e('0x4'));var controller=require(_0x420e('0x5'));router[_0x420e('0x6')]('/',auth[_0x420e('0x7')](),controller['index']);router[_0x420e('0x6')](_0x420e('0x8'),auth[_0x420e('0x7')](),controller['show']);router[_0x420e('0x6')](_0x420e('0x9'),auth[_0x420e('0x7')](),controller[_0x420e('0xa')]);router[_0x420e('0x6')]('/:id/fields',auth[_0x420e('0x7')](),controller[_0x420e('0xb')]);router[_0x420e('0xc')]('/',auth['isAuthenticated'](),controller[_0x420e('0xd')]);router[_0x420e('0xc')](_0x420e('0x9'),auth[_0x420e('0x7')](),controller[_0x420e('0xe')]);router[_0x420e('0xf')](_0x420e('0x8'),auth[_0x420e('0x7')](),controller[_0x420e('0x10')]);router[_0x420e('0x11')](_0x420e('0x8'),auth[_0x420e('0x7')](),controller[_0x420e('0x12')]);module[_0x420e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index e71c385..30783f6 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 _0xc21e=['STRING','BOOLEAN','exports'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0xc21e,0x1ca));var _0xec21=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc21e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xec21('0x0')]={'name':{'type':Sequelize[_0xec21('0x1')]},'username':{'type':Sequelize[_0xec21('0x1')]},'password':{'type':Sequelize[_0xec21('0x1')]},'remoteUri':{'type':Sequelize[_0xec21('0x1')]},'tenantId':{'type':Sequelize[_0xec21('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xec21('0x1')]},'serverUrl':{'type':Sequelize[_0xec21('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xec21('0x1')]},'modernAuthentication':{'type':Sequelize[_0xec21('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa93e=['BOOLEAN','STRING'];(function(_0x3ef895,_0x5202b7){var _0x3b5921=function(_0x2f9ff2){while(--_0x2f9ff2){_0x3ef895['push'](_0x3ef895['shift']());}};_0x3b5921(++_0x5202b7);}(_0xa93e,0x1df));var _0xea93=function(_0x4f8c73,_0x3bccb1){_0x4f8c73=_0x4f8c73-0x0;var _0x274e9f=_0xa93e[_0x4f8c73];return _0x274e9f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xea93('0x0')]},'username':{'type':Sequelize[_0xea93('0x0')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xea93('0x0')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xea93('0x0')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xea93('0x0')]},'modernAuthentication':{'type':Sequelize[_0xea93('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 509a74d..d36e891 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 _0xcbde=['phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','escalatedon','exchangerate','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','access_token','POST','https://login.microsoftonline.com/','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','remove','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','GET',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','Value','LogicalName','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','Content-Range','update','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes','type','model','map','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','Dynamics365Account','findAll','rows','catch','show','params','keys','options','find','create','body','getConfigurations','Dynamics365Configuration','hasOwnProperty','addConfiguration','findOne','Subjects','channel','Descriptions','Dynamics365Field','slice','substring','%s/api/data/v9.0/','ticketType','incident','Incident','title','description','customerid','ownerid','subject'];(function(_0x3e0024,_0x4f083f){var _0xdcd3f3=function(_0x913124){while(--_0x913124){_0x3e0024['push'](_0x3e0024['shift']());}};_0xdcd3f3(++_0x4f083f);}(_0xcbde,0x1df));var _0xecbd=function(_0x56b571,_0x445ae2){_0x56b571=_0x56b571-0x0;var _0x380b39=_0xcbde[_0x56b571];return _0x380b39;};'use strict';var rp=require('request-promise');var util=require(_0xecbd('0x0'));var _=require(_0xecbd('0x1'));var qs=require(_0xecbd('0x2'));var logger=require('../../config/logger')(_0xecbd('0x3'));var db=require(_0xecbd('0x4'))['db'];var integrations=require(_0xecbd('0x5'));function respondWithResult(_0x2454b9,_0x29a8ba){_0x29a8ba=_0x29a8ba||0xc8;return function(_0x43335f){if(_0x43335f){return _0x2454b9[_0xecbd('0x6')](_0x29a8ba)[_0xecbd('0x7')](_0x43335f);}};}function respondWithFilteredResult(_0x6b2490,_0x4b2af3){return function(_0x45cbb0){if(_0x45cbb0){var _0x5f3219=typeof _0x4b2af3[_0xecbd('0x8')]===_0xecbd('0x9')&&typeof _0x4b2af3[_0xecbd('0xa')]===_0xecbd('0x9');var _0x551ad5=_0x45cbb0[_0xecbd('0xb')];var _0x542750=_0x5f3219?0x0:_0x4b2af3[_0xecbd('0x8')];var _0x517e78=_0x5f3219?_0x45cbb0['count']:_0x4b2af3['offset']+_0x4b2af3[_0xecbd('0xa')];var _0x549fff;if(_0x517e78>=_0x551ad5){_0x517e78=_0x551ad5;_0x549fff=0xc8;}else{_0x549fff=0xce;}_0x6b2490[_0xecbd('0x6')](_0x549fff);return _0x6b2490['set'](_0xecbd('0xc'),_0x542750+'-'+_0x517e78+'/'+_0x551ad5)[_0xecbd('0x7')](_0x45cbb0);}return null;};}function saveUpdates(_0x3c7265){return function(_0x122d8d){if(_0x122d8d){return _0x122d8d[_0xecbd('0xd')](_0x3c7265)['then'](function(_0x1c5e46){return _0x1c5e46;});}return null;};}function removeEntity(_0x26d805){return function(_0x16589d){if(_0x16589d){return _0x16589d[_0xecbd('0xe')]()[_0xecbd('0xf')](function(){_0x26d805[_0xecbd('0x6')](0xcc)['end']();});}};}function handleEntityNotFound(_0x102b54){return function(_0x26e01a){if(!_0x26e01a){_0x102b54[_0xecbd('0x10')](0x194);}return _0x26e01a;};}function handleError(_0x4e54cc,_0x34b2f3){_0x34b2f3=_0x34b2f3||0x1f4;return function(_0x312d4c){logger[_0xecbd('0x11')](_0x312d4c[_0xecbd('0x12')]);if(_0x312d4c['name']){delete _0x312d4c[_0xecbd('0x13')];}_0x4e54cc[_0xecbd('0x6')](_0x34b2f3)[_0xecbd('0x14')](_0x312d4c);};}exports[_0xecbd('0x15')]=function(_0x26f403,_0x180eea){var _0x55df88={},_0x561b7b={},_0x75dc4b={'count':0x0,'rows':[]};var _0x506104=_['map'](db['Dynamics365Account'][_0xecbd('0x16')],function(_0x34a019){return{'name':_0x34a019['fieldName'],'type':_0x34a019[_0xecbd('0x17')]['key']};});_0x561b7b[_0xecbd('0x18')]=_[_0xecbd('0x19')](_0x506104,_0xecbd('0x13'));_0x561b7b[_0xecbd('0x1a')]=_['keys'](_0x26f403[_0xecbd('0x1a')]);_0x561b7b['filters']=_[_0xecbd('0x1b')](_0x561b7b[_0xecbd('0x18')],_0x561b7b[_0xecbd('0x1a')]);_0x55df88[_0xecbd('0x1c')]=_[_0xecbd('0x1b')](_0x561b7b[_0xecbd('0x18')],qs[_0xecbd('0x1d')](_0x26f403['query'][_0xecbd('0x1d')]));_0x55df88[_0xecbd('0x1c')]=_0x55df88[_0xecbd('0x1c')][_0xecbd('0x1e')]?_0x55df88[_0xecbd('0x1c')]:_0x561b7b[_0xecbd('0x18')];if(!_0x26f403[_0xecbd('0x1a')]['hasOwnProperty'](_0xecbd('0x1f'))){_0x55df88[_0xecbd('0xa')]=qs['limit'](_0x26f403[_0xecbd('0x1a')][_0xecbd('0xa')]);_0x55df88[_0xecbd('0x8')]=qs[_0xecbd('0x8')](_0x26f403[_0xecbd('0x1a')][_0xecbd('0x8')]);}_0x55df88[_0xecbd('0x20')]=qs[_0xecbd('0x21')](_0x26f403[_0xecbd('0x1a')][_0xecbd('0x21')]);_0x55df88[_0xecbd('0x22')]=qs[_0xecbd('0x23')](_[_0xecbd('0x24')](_0x26f403[_0xecbd('0x1a')],_0x561b7b[_0xecbd('0x23')]),_0x506104);if(_0x26f403[_0xecbd('0x1a')][_0xecbd('0x25')]){_0x55df88[_0xecbd('0x22')]=_[_0xecbd('0x26')](_0x55df88[_0xecbd('0x22')],{'$or':_[_0xecbd('0x19')](_0x506104,function(_0x441fd7){if(_0x441fd7[_0xecbd('0x17')]!==_0xecbd('0x27')){var _0xeb85ed={};_0xeb85ed[_0x441fd7['name']]={'$like':'%'+_0x26f403[_0xecbd('0x1a')][_0xecbd('0x25')]+'%'};return _0xeb85ed;}})});}_0x55df88=_[_0xecbd('0x26')]({},_0x55df88,_0x26f403['options']);var _0x16554c={'where':_0x55df88[_0xecbd('0x22')]};return db['Dynamics365Account']['count'](_0x16554c)['then'](function(_0x56d005){_0x75dc4b[_0xecbd('0xb')]=_0x56d005;if(_0x26f403[_0xecbd('0x1a')][_0xecbd('0x28')]){_0x55df88[_0xecbd('0x29')]=[{'all':!![]}];}return db[_0xecbd('0x2a')][_0xecbd('0x2b')](_0x55df88);})['then'](function(_0x329afd){_0x75dc4b[_0xecbd('0x2c')]=_0x329afd;return _0x75dc4b;})[_0xecbd('0xf')](respondWithFilteredResult(_0x180eea,_0x55df88))[_0xecbd('0x2d')](handleError(_0x180eea,null));};exports[_0xecbd('0x2e')]=function(_0x329581,_0x52f568){var _0x38b41d={'raw':![],'where':{'id':_0x329581[_0xecbd('0x2f')]['id']}},_0x314a46={};_0x314a46[_0xecbd('0x18')]=_['keys'](db[_0xecbd('0x2a')]['rawAttributes']);_0x314a46[_0xecbd('0x1a')]=_[_0xecbd('0x30')](_0x329581[_0xecbd('0x1a')]);_0x314a46[_0xecbd('0x23')]=_[_0xecbd('0x1b')](_0x314a46['model'],_0x314a46[_0xecbd('0x1a')]);_0x38b41d[_0xecbd('0x1c')]=_['intersection'](_0x314a46[_0xecbd('0x18')],qs['fields'](_0x329581[_0xecbd('0x1a')][_0xecbd('0x1d')]));_0x38b41d[_0xecbd('0x1c')]=_0x38b41d[_0xecbd('0x1c')][_0xecbd('0x1e')]?_0x38b41d[_0xecbd('0x1c')]:_0x314a46['model'];if(_0x329581[_0xecbd('0x1a')][_0xecbd('0x28')]){_0x38b41d['include']=[{'all':!![]}];}_0x38b41d=_[_0xecbd('0x26')]({},_0x38b41d,_0x329581[_0xecbd('0x31')]);return db[_0xecbd('0x2a')][_0xecbd('0x32')](_0x38b41d)[_0xecbd('0xf')](handleEntityNotFound(_0x52f568,null))['then'](respondWithResult(_0x52f568,null))[_0xecbd('0x2d')](handleError(_0x52f568,null));};exports[_0xecbd('0x33')]=function(_0x263b17,_0x810884){return db[_0xecbd('0x2a')][_0xecbd('0x33')](_0x263b17['body'],{})['then'](respondWithResult(_0x810884,0xc9))[_0xecbd('0x2d')](handleError(_0x810884,null));};exports[_0xecbd('0xd')]=function(_0x295134,_0x1e05dc){if(_0x295134[_0xecbd('0x34')]['id']){delete _0x295134['body']['id'];}return db[_0xecbd('0x2a')][_0xecbd('0x32')]({'where':{'id':_0x295134[_0xecbd('0x2f')]['id']}})[_0xecbd('0xf')](handleEntityNotFound(_0x1e05dc,null))[_0xecbd('0xf')](saveUpdates(_0x295134[_0xecbd('0x34')],null))[_0xecbd('0xf')](respondWithResult(_0x1e05dc,null))[_0xecbd('0x2d')](handleError(_0x1e05dc,null));};exports[_0xecbd('0xe')]=function(_0x56bd68,_0x2e0c4a){return db['Dynamics365Account'][_0xecbd('0x32')]({'where':{'id':_0x56bd68['params']['id']}})['then'](handleEntityNotFound(_0x2e0c4a,null))[_0xecbd('0xf')](removeEntity(_0x2e0c4a,null))[_0xecbd('0x2d')](handleError(_0x2e0c4a,null));};exports[_0xecbd('0x35')]=function(_0xe31671,_0x237f72){var _0x236c38={};var _0x39243b={};var _0x347275;var _0x5f2193;return db[_0xecbd('0x2a')]['findOne']({'where':{'id':_0xe31671[_0xecbd('0x2f')]['id']}})[_0xecbd('0xf')](handleEntityNotFound(_0x237f72,null))[_0xecbd('0xf')](function(_0x41c056){if(_0x41c056){_0x347275=_0x41c056;_0x39243b[_0xecbd('0x18')]=_['keys'](db[_0xecbd('0x36')][_0xecbd('0x16')]);_0x39243b[_0xecbd('0x1a')]=_[_0xecbd('0x30')](_0xe31671[_0xecbd('0x1a')]);_0x39243b['filters']=_[_0xecbd('0x1b')](_0x39243b[_0xecbd('0x18')],_0x39243b[_0xecbd('0x1a')]);_0x236c38[_0xecbd('0x1c')]=_['intersection'](_0x39243b[_0xecbd('0x18')],qs['fields'](_0xe31671[_0xecbd('0x1a')][_0xecbd('0x1d')]));_0x236c38[_0xecbd('0x1c')]=_0x236c38['attributes'][_0xecbd('0x1e')]?_0x236c38[_0xecbd('0x1c')]:_0x39243b['model'];_0x236c38[_0xecbd('0x20')]=qs[_0xecbd('0x21')](_0xe31671['query']['sort']);_0x236c38[_0xecbd('0x22')]=qs[_0xecbd('0x23')](_['pick'](_0xe31671[_0xecbd('0x1a')],_0x39243b[_0xecbd('0x23')]));if(_0xe31671[_0xecbd('0x1a')][_0xecbd('0x25')]){_0x236c38[_0xecbd('0x22')]=_[_0xecbd('0x26')](_0x236c38['where'],{'$or':_[_0xecbd('0x19')](_0x236c38[_0xecbd('0x1c')],function(_0x5be7a3){var _0x2c9012={};_0x2c9012[_0x5be7a3]={'$like':'%'+_0xe31671['query']['filter']+'%'};return _0x2c9012;})});}_0x236c38=_[_0xecbd('0x26')]({},_0x236c38,_0xe31671['options']);return _0x347275[_0xecbd('0x35')](_0x236c38);}})[_0xecbd('0xf')](function(_0x48cb44){if(_0x48cb44){_0x5f2193=_0x48cb44[_0xecbd('0x1e')];if(!_0xe31671['query'][_0xecbd('0x37')](_0xecbd('0x1f'))){_0x236c38[_0xecbd('0xa')]=qs[_0xecbd('0xa')](_0xe31671[_0xecbd('0x1a')][_0xecbd('0xa')]);_0x236c38[_0xecbd('0x8')]=qs['offset'](_0xe31671[_0xecbd('0x1a')]['offset']);}return _0x347275[_0xecbd('0x35')](_0x236c38);}})[_0xecbd('0xf')](function(_0x49529e){if(_0x49529e){return _0x49529e?{'count':_0x5f2193,'rows':_0x49529e}:null;}})[_0xecbd('0xf')](respondWithResult(_0x237f72,null))[_0xecbd('0x2d')](handleError(_0x237f72,null));};exports[_0xecbd('0x38')]=function(_0x37c4f5,_0x326fe2){if(_0x37c4f5[_0xecbd('0x34')]['id']){delete _0x37c4f5[_0xecbd('0x34')]['id'];}return db[_0xecbd('0x2a')][_0xecbd('0x39')]({'where':{'id':_0x37c4f5[_0xecbd('0x2f')]['id']}})[_0xecbd('0xf')](handleEntityNotFound(_0x326fe2,null))[_0xecbd('0xf')](function(_0x554b05){if(_0x554b05){_0x37c4f5['body']['AccountId']=_0x554b05['id'];_0x37c4f5[_0xecbd('0x34')][_0xecbd('0x3a')]=integrations['getSubjects'](_0x37c4f5[_0xecbd('0x34')][_0xecbd('0x3b')],_0x37c4f5['body'][_0xecbd('0x17')]);_0x37c4f5[_0xecbd('0x34')][_0xecbd('0x3c')]=integrations['getDescriptions'](_0x37c4f5['body']['channel'],_0x37c4f5[_0xecbd('0x34')][_0xecbd('0x17')]);return db[_0xecbd('0x36')][_0xecbd('0x33')](_0x37c4f5[_0xecbd('0x34')],{'include':[{'model':db[_0xecbd('0x3d')],'as':_0xecbd('0x3a')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0xecbd('0xf')](respondWithResult(_0x326fe2,null))[_0xecbd('0x2d')](handleError(_0x326fe2,null));};function sanitizeRemoteUri(_0x46d83f){var _0x1a0623=_0x46d83f[_0xecbd('0x3e')](-0x1);if(_0x1a0623==='/')return _0x46d83f[_0xecbd('0x3f')](0x0,_0x46d83f['lastIndexOf'](_0x1a0623));return _0x46d83f;}function getWebApiUrl(_0x7829d3){return util['format'](_0xecbd('0x40'),_0x7829d3);}exports['getFields']=function(_0x115bb3,_0x4fef03){var _0x3cc45c=_0x115bb3[_0xecbd('0x1a')][_0xecbd('0x41')];var _0x265c5d=_0x3cc45c===_0xecbd('0x42')?_0xecbd('0x43'):'PhoneCall';var _0x47b9a8='';var _0x32b2bd='';var _0x2f2359='';var _0xc0efea='';var _0x8501be='';var _0x4fc50d='';var _0x49d812='';var _0x530aa6='';var _0x17b35d=[_0xecbd('0x44'),_0xecbd('0x45'),_0xecbd('0x46'),_0xecbd('0x47'),'caseorigincode',_0xecbd('0x48'),_0xecbd('0x49'),_0xecbd('0x4a'),_0xecbd('0x4b'),_0xecbd('0x4c')];var _0x3362a6=[_0xecbd('0x4d'),_0xecbd('0x4e'),'actualserviceunits',_0xecbd('0x4f'),'contactidname',_0xecbd('0x50'),'contractdetailidname',_0xecbd('0x51'),'createdbyexternalpartyname',_0xecbd('0x52'),_0xecbd('0x53'),'createdbyyominame',_0xecbd('0x54'),_0xecbd('0x55'),_0xecbd('0x56'),_0xecbd('0x57'),_0xecbd('0x58'),_0xecbd('0x59'),_0xecbd('0x5a'),_0xecbd('0x5b'),'entityimage_timestamp','entityimage_url',_0xecbd('0x5c'),_0xecbd('0x5d'),'firstresponsebykpiidname','followupby',_0xecbd('0x5e'),'influencescore',_0xecbd('0x5f'),_0xecbd('0x60'),_0xecbd('0x61'),'modifiedbyexternalpartyname',_0xecbd('0x62'),_0xecbd('0x63'),_0xecbd('0x64'),_0xecbd('0x65'),_0xecbd('0x66'),_0xecbd('0x67'),_0xecbd('0x68'),'msdyn_iotalertname',_0xecbd('0x69'),_0xecbd('0x6a'),_0xecbd('0x6b'),'owneridname',_0xecbd('0x6c'),_0xecbd('0x6d'),_0xecbd('0x6e'),'primarycontactidname',_0xecbd('0x6f'),'prioritycodename',_0xecbd('0x70'),_0xecbd('0x71'),_0xecbd('0x72'),_0xecbd('0x73'),_0xecbd('0x74'),_0xecbd('0x75'),_0xecbd('0x76'),_0xecbd('0x77'),_0xecbd('0x78'),_0xecbd('0x79'),'socialprofileidname',_0xecbd('0x7a'),_0xecbd('0x7b'),_0xecbd('0x7c'),_0xecbd('0x7d'),_0xecbd('0x7e'),_0xecbd('0x7f'),'traversedpath','utcconversiontimezonecode',_0xecbd('0x80')];var _0x33bdf8=_0x17b35d[_0xecbd('0x81')](_0x3362a6);return db[_0xecbd('0x2a')][_0xecbd('0x39')]({'where':{'id':_0x115bb3['params']['id']},'attributes':['id',_0xecbd('0x82'),_0xecbd('0x83'),_0xecbd('0x84'),_0xecbd('0x85'),_0xecbd('0x86'),_0xecbd('0x87'),_0xecbd('0x88')],'include':[{'model':db[_0xecbd('0x89')],'as':'CloudProvider','attributes':['id',_0xecbd('0x8a'),'data7']}]})[_0xecbd('0xf')](handleEntityNotFound(_0x4fef03,null))[_0xecbd('0xf')](function(_0x2d4dbe){if(_0x2d4dbe){if(_0x2d4dbe[_0xecbd('0x88')]){_0x2d4dbe[_0xecbd('0x8b')]=_0x2d4dbe[_0xecbd('0x89')][_0xecbd('0x8a')];_0x530aa6=sanitizeRemoteUri(_0x2d4dbe['CloudProvider']['data7']);_0x49d812=getWebApiUrl(_0x530aa6);return _0x2d4dbe;}_0x530aa6=sanitizeRemoteUri(_0x2d4dbe[_0xecbd('0x84')]);_0x49d812=getWebApiUrl(_0x530aa6);var _0x3d80c4={'method':_0xecbd('0x8c'),'uri':_0xecbd('0x8d')+_0x2d4dbe['tenantId']+'/oauth2/token','form':{'client_id':_0x2d4dbe['clientId'],'resource':_0x530aa6,'username':_0x2d4dbe[_0xecbd('0x82')],'password':_0x2d4dbe['password'],'grant_type':'password','client_secret':_0x2d4dbe['clientSecret']},'json':!![]};return rp(_0x3d80c4);}})[_0xecbd('0xf')](function(_0x18f034){_0x4fc50d=_0x18f034[_0xecbd('0x8b')];var _0x8551f3={'method':'GET','uri':encodeURI(_0x49d812+_0xecbd('0x8e')+_0x265c5d+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x4fc50d,'If-None-Match':null,'OData-Version':_0xecbd('0x8f')},'json':!![]};return rp(_0x8551f3);})[_0xecbd('0xf')](function(_0x3738ae){var _0x2e39c2=_0x3738ae['value'][0x0];var _0x26a12c=_0x2e39c2[_0xecbd('0x90')];var _0x120b17={'method':'GET','uri':_0x49d812+_0xecbd('0x91')+_0x26a12c+_0xecbd('0x92'),'headers':{'Authorization':_0xecbd('0x93')+_0x4fc50d,'If-None-Match':null,'OData-Version':_0xecbd('0x8f')},'json':!![]};return rp(_0x120b17);})[_0xecbd('0xf')](function(_0x108558){_0x47b9a8=_0x108558;_0x32b2bd=_0x47b9a8['Attributes'];_0x32b2bd=_[_0xecbd('0x94')](_0x32b2bd,function(_0x4d9b85){return!_0x33bdf8['includes'](_0x4d9b85['LogicalName']);});var _0x43e909=[];var _0x337bf9=[];_0x32b2bd[_0xecbd('0x95')](function(_0x4d89bf){if(_0x4d89bf[_0xecbd('0x96')]){var _0x2c35a5=_0x4d89bf['@odata.type'][_0xecbd('0x3f')](_0x4d89bf[_0xecbd('0x96')][_0xecbd('0x97')]('.')+0x1);if(_0x2c35a5===_0xecbd('0x98')){_0x43e909[_0xecbd('0x99')](getSelectList(_0x49d812,_0x3cc45c,_0x337bf9,_0x47b9a8['MetadataId'],_0x4d89bf[_0xecbd('0x90')],_0x4fc50d));}}});return Promise[_0xecbd('0x9a')](_0x43e909);})[_0xecbd('0xf')](function(_0x3e3e22){_0x2f2359=_0x3e3e22[0x0];var _0x4992f5=[];var _0x13a239=[];_0x32b2bd['forEach'](function(_0x46b915){if(!_[_0xecbd('0x9b')](_0x46b915[_0xecbd('0x96')])){var _0x123979=_0x46b915[_0xecbd('0x96')][_0xecbd('0x3f')](_0x46b915['@odata.type'][_0xecbd('0x97')]('.')+0x1);if(_0x123979===_0xecbd('0x9c')){_0x4992f5[_0xecbd('0x99')](getBooleanList(_0x49d812,_0x3cc45c,_0x13a239,_0x47b9a8[_0xecbd('0x90')],_0x46b915[_0xecbd('0x90')],_0x4fc50d));}}});return Promise[_0xecbd('0x9a')](_0x4992f5);})[_0xecbd('0xf')](function(_0x511142){_0xc0efea=_0x511142[0x0];var _0x2640b9=[];var _0x4b1800=[];_0x32b2bd['forEach'](function(_0x446cbc){if(_0x446cbc[_0xecbd('0x96')]){var _0x233aba=_0x446cbc['@odata.type'][_0xecbd('0x3f')](_0x446cbc['@odata.type'][_0xecbd('0x97')]('.')+0x1);if(_0x233aba===_0xecbd('0x9d')||_0x233aba===_0xecbd('0x9e')||_0x233aba===_0xecbd('0x9f')||_0x233aba===_0xecbd('0xa0')||_0x233aba===_0xecbd('0xa1')||_0x233aba===_0xecbd('0xa2')||_0x233aba===_0xecbd('0xa3')||_0x233aba===_0xecbd('0xa4')||_0x233aba===_0xecbd('0xa5')||_0x233aba==='DecimalAttributeMetadata'){_0x2640b9['push'](getInputList(_0x49d812,_0x3cc45c,_0x233aba,_0x4b1800,_0x47b9a8[_0xecbd('0x90')],_0x446cbc[_0xecbd('0x90')],_0x4fc50d));}}});return Promise[_0xecbd('0x9a')](_0x2640b9);})[_0xecbd('0xf')](function(_0x2566f5){_0x8501be=_0x2566f5[0x0];var _0x3d8e99=_0x2f2359[_0xecbd('0x81')](_0xc0efea)[_0xecbd('0x81')](_0x8501be);var _0x1bbbab={'count':_0x3d8e99[_0xecbd('0x1e')],'rows':_0x3d8e99};return _0x1bbbab;})[_0xecbd('0xf')](respondWithResult(_0x4fef03,null))[_0xecbd('0x2d')](function(_0x2688b2){var _0x14ee42=_0x115bb3[_0xecbd('0x1a')][_0xecbd('0xa6')]?0x1f4:_0x2688b2[_0xecbd('0xa7')]||0x1f4;logger[_0xecbd('0x11')](_0x2688b2[_0xecbd('0x12')]);delete _0x2688b2[_0xecbd('0x13')];if(_0x14ee42===0x191){_0x14ee42=0x190;}_0x4fef03[_0xecbd('0x6')](_0x14ee42)[_0xecbd('0x14')](_0x115bb3[_0xecbd('0x1a')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x2688b2[_0xecbd('0xa7')]}:_0x2688b2);});};function getSelectList(_0x44f8cf,_0x2e601f,_0x1c98c4,_0x2ac16a,_0x3f6055,_0x1ff40a){var _0x422c02={'method':_0xecbd('0xa8'),'uri':_0x44f8cf+_0xecbd('0x91')+_0x2ac16a+_0xecbd('0xa9')+_0x3f6055+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xecbd('0xaa'),'headers':{'Authorization':_0xecbd('0x93')+_0x1ff40a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x422c02)[_0xecbd('0xf')](function(_0x2def77){var _0x5e877b=[];var _0x565aa4=_0x2def77[_0xecbd('0xab')]['Options'];_0x565aa4['forEach'](function(_0x28816f){_0x5e877b[_0xecbd('0x99')]({'name':_0x28816f[_0xecbd('0xac')]['UserLocalizedLabel'][_0xecbd('0xac')],'value':String(_0x28816f[_0xecbd('0xad')])});});var _0x4fae5a={'id':_0x2e601f+'_'+_0x2def77[_0xecbd('0xae')],'name':_0x2def77[_0xecbd('0xaf')][_0xecbd('0xb0')]['Label'],'custom':![],'options':_0x5e877b};_0x1c98c4[_0xecbd('0x99')](_0x4fae5a);return _0x1c98c4;});}function getBooleanList(_0xe5497c,_0x19342e,_0x23b655,_0x15d8f0,_0x35041f,_0xa50972){var _0x4913b5={'method':_0xecbd('0xa8'),'uri':_0xe5497c+_0xecbd('0x91')+_0x15d8f0+_0xecbd('0xa9')+_0x35041f+_0xecbd('0xb1'),'headers':{'Authorization':'Bearer\x20'+_0xa50972,'If-None-Match':null,'OData-Version':_0xecbd('0x8f')},'json':!![]};return rp(_0x4913b5)['then'](function(_0x4dd7ed){var _0x4186e9=[];_0x4186e9[_0xecbd('0x99')]({'name':_0x4dd7ed[_0xecbd('0xab')][_0xecbd('0xb2')][_0xecbd('0xac')][_0xecbd('0xb0')]['Label'],'value':_0xecbd('0xb3')},{'name':_0x4dd7ed['OptionSet'][_0xecbd('0xb4')][_0xecbd('0xac')][_0xecbd('0xb0')][_0xecbd('0xac')],'value':_0xecbd('0xb5')});var _0x11086f={'id':_0x19342e+'_'+_0x4dd7ed[_0xecbd('0xae')],'name':_0x4dd7ed[_0xecbd('0xaf')][_0xecbd('0xb0')][_0xecbd('0xac')],'custom':![],'options':_0x4186e9};_0x23b655[_0xecbd('0x99')](_0x11086f);return _0x23b655;});}function getInputList(_0x1bd821,_0x3ce66c,_0x908a77,_0x4db124,_0x4da906,_0x384fbe,_0xa077c8){var _0x5ba503={'method':_0xecbd('0xa8'),'uri':_0x1bd821+'EntityDefinitions('+_0x4da906+_0xecbd('0xa9')+_0x384fbe+_0xecbd('0xb6')+_0x908a77+_0xecbd('0xb7'),'headers':{'Authorization':_0xecbd('0x93')+_0xa077c8,'If-None-Match':null,'OData-Version':_0xecbd('0x8f')},'json':!![]};return rp(_0x5ba503)[_0xecbd('0xf')](function(_0x341c17){var _0x1e69ba={'id':_0x3ce66c+'_'+_0x341c17[_0xecbd('0xae')],'name':_0x341c17[_0xecbd('0xaf')]['UserLocalizedLabel']?_0x341c17[_0xecbd('0xaf')][_0xecbd('0xb0')][_0xecbd('0xac')]:_0x341c17[_0xecbd('0xae')],'custom':![],'options':[]};_0x4db124[_0xecbd('0x99')](_0x1e69ba);return _0x4db124;});} \ No newline at end of file +var _0xf1a7=['include','findAll','catch','show','params','create','body','update','find','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','description','ownerid','caseorigincode','subject','phonenumber','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolveby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','password','tenantId','clientId','modernAuthentication','CloudProvider','data5','data7','access_token','remoteUri','POST','/oauth2/token','username','clientSecret','GET','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','forEach','isNil','BooleanAttributeMetadata','push','all','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','test',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','DisplayName','EntityDefinitions(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll'];(function(_0x2377e3,_0x2c0352){var _0x2a6d1b=function(_0x536523){while(--_0x536523){_0x2377e3['push'](_0x2377e3['shift']());}};_0x2a6d1b(++_0x2c0352);}(_0xf1a7,0x8f));var _0x7f1a=function(_0x2603a2,_0x3bae71){_0x2603a2=_0x2603a2-0x0;var _0x434eba=_0xf1a7[_0x2603a2];return _0x434eba;};'use strict';var rp=require('request-promise');var util=require(_0x7f1a('0x0'));var _=require('lodash');var qs=require(_0x7f1a('0x1'));var logger=require(_0x7f1a('0x2'))(_0x7f1a('0x3'));var db=require(_0x7f1a('0x4'))['db'];var integrations=require(_0x7f1a('0x5'));function respondWithResult(_0x243652,_0x2eb5d7){_0x2eb5d7=_0x2eb5d7||0xc8;return function(_0x1be1da){if(_0x1be1da){return _0x243652[_0x7f1a('0x6')](_0x2eb5d7)[_0x7f1a('0x7')](_0x1be1da);}};}function respondWithFilteredResult(_0x1c3c87,_0x49cc7b){return function(_0x18177e){if(_0x18177e){var _0x184d29=typeof _0x49cc7b[_0x7f1a('0x8')]===_0x7f1a('0x9')&&typeof _0x49cc7b[_0x7f1a('0xa')]===_0x7f1a('0x9');var _0x470672=_0x18177e[_0x7f1a('0xb')];var _0x3639df=_0x184d29?0x0:_0x49cc7b[_0x7f1a('0x8')];var _0x3b3a3c=_0x184d29?_0x18177e[_0x7f1a('0xb')]:_0x49cc7b[_0x7f1a('0x8')]+_0x49cc7b[_0x7f1a('0xa')];var _0x5bc8a7;if(_0x3b3a3c>=_0x470672){_0x3b3a3c=_0x470672;_0x5bc8a7=0xc8;}else{_0x5bc8a7=0xce;}_0x1c3c87[_0x7f1a('0x6')](_0x5bc8a7);return _0x1c3c87[_0x7f1a('0xc')](_0x7f1a('0xd'),_0x3639df+'-'+_0x3b3a3c+'/'+_0x470672)[_0x7f1a('0x7')](_0x18177e);}return null;};}function saveUpdates(_0x10273b){return function(_0x558e2c){if(_0x558e2c){return _0x558e2c['update'](_0x10273b)['then'](function(_0x30414d){return _0x30414d;});}return null;};}function removeEntity(_0x4ab929){return function(_0x2be02b){if(_0x2be02b){return _0x2be02b[_0x7f1a('0xe')]()['then'](function(){_0x4ab929[_0x7f1a('0x6')](0xcc)[_0x7f1a('0xf')]();});}};}function handleEntityNotFound(_0x70f38b){return function(_0x22698d){if(!_0x22698d){_0x70f38b[_0x7f1a('0x10')](0x194);}return _0x22698d;};}function handleError(_0x261d8e,_0x16025f){_0x16025f=_0x16025f||0x1f4;return function(_0x124ba3){logger[_0x7f1a('0x11')](_0x124ba3[_0x7f1a('0x12')]);if(_0x124ba3[_0x7f1a('0x13')]){delete _0x124ba3['name'];}_0x261d8e['status'](_0x16025f)[_0x7f1a('0x14')](_0x124ba3);};}exports[_0x7f1a('0x15')]=function(_0x242c9b,_0x1f9444){var _0x4e4bd9={},_0x2c530c={},_0x5876e1={'count':0x0,'rows':[]};var _0x257547=_[_0x7f1a('0x16')](db[_0x7f1a('0x17')][_0x7f1a('0x18')],function(_0xf08777){return{'name':_0xf08777[_0x7f1a('0x19')],'type':_0xf08777[_0x7f1a('0x1a')]['key']};});_0x2c530c[_0x7f1a('0x1b')]=_[_0x7f1a('0x16')](_0x257547,_0x7f1a('0x13'));_0x2c530c[_0x7f1a('0x1c')]=_[_0x7f1a('0x1d')](_0x242c9b['query']);_0x2c530c[_0x7f1a('0x1e')]=_['intersection'](_0x2c530c['model'],_0x2c530c[_0x7f1a('0x1c')]);_0x4e4bd9[_0x7f1a('0x1f')]=_[_0x7f1a('0x20')](_0x2c530c[_0x7f1a('0x1b')],qs[_0x7f1a('0x21')](_0x242c9b['query'][_0x7f1a('0x21')]));_0x4e4bd9[_0x7f1a('0x1f')]=_0x4e4bd9[_0x7f1a('0x1f')][_0x7f1a('0x22')]?_0x4e4bd9['attributes']:_0x2c530c[_0x7f1a('0x1b')];if(!_0x242c9b[_0x7f1a('0x1c')][_0x7f1a('0x23')](_0x7f1a('0x24'))){_0x4e4bd9[_0x7f1a('0xa')]=qs[_0x7f1a('0xa')](_0x242c9b[_0x7f1a('0x1c')][_0x7f1a('0xa')]);_0x4e4bd9['offset']=qs[_0x7f1a('0x8')](_0x242c9b[_0x7f1a('0x1c')][_0x7f1a('0x8')]);}_0x4e4bd9[_0x7f1a('0x25')]=qs[_0x7f1a('0x26')](_0x242c9b[_0x7f1a('0x1c')]['sort']);_0x4e4bd9[_0x7f1a('0x27')]=qs[_0x7f1a('0x1e')](_[_0x7f1a('0x28')](_0x242c9b[_0x7f1a('0x1c')],_0x2c530c[_0x7f1a('0x1e')]),_0x257547);if(_0x242c9b['query'][_0x7f1a('0x29')]){_0x4e4bd9[_0x7f1a('0x27')]=_[_0x7f1a('0x2a')](_0x4e4bd9[_0x7f1a('0x27')],{'$or':_[_0x7f1a('0x16')](_0x257547,function(_0x130e40){if(_0x130e40[_0x7f1a('0x1a')]!==_0x7f1a('0x2b')){var _0x231a9b={};_0x231a9b[_0x130e40['name']]={'$like':'%'+_0x242c9b['query'][_0x7f1a('0x29')]+'%'};return _0x231a9b;}})});}_0x4e4bd9=_['merge']({},_0x4e4bd9,_0x242c9b[_0x7f1a('0x2c')]);var _0x5a0b44={'where':_0x4e4bd9[_0x7f1a('0x27')]};return db[_0x7f1a('0x17')]['count'](_0x5a0b44)[_0x7f1a('0x2d')](function(_0x40829b){_0x5876e1['count']=_0x40829b;if(_0x242c9b[_0x7f1a('0x1c')][_0x7f1a('0x2e')]){_0x4e4bd9[_0x7f1a('0x2f')]=[{'all':!![]}];}return db[_0x7f1a('0x17')][_0x7f1a('0x30')](_0x4e4bd9);})[_0x7f1a('0x2d')](function(_0x12c9e0){_0x5876e1['rows']=_0x12c9e0;return _0x5876e1;})[_0x7f1a('0x2d')](respondWithFilteredResult(_0x1f9444,_0x4e4bd9))[_0x7f1a('0x31')](handleError(_0x1f9444,null));};exports[_0x7f1a('0x32')]=function(_0xdabe6a,_0x3e2b23){var _0x130174={'raw':![],'where':{'id':_0xdabe6a[_0x7f1a('0x33')]['id']}},_0x16f36c={};_0x16f36c[_0x7f1a('0x1b')]=_['keys'](db[_0x7f1a('0x17')][_0x7f1a('0x18')]);_0x16f36c[_0x7f1a('0x1c')]=_[_0x7f1a('0x1d')](_0xdabe6a[_0x7f1a('0x1c')]);_0x16f36c[_0x7f1a('0x1e')]=_[_0x7f1a('0x20')](_0x16f36c[_0x7f1a('0x1b')],_0x16f36c[_0x7f1a('0x1c')]);_0x130174[_0x7f1a('0x1f')]=_[_0x7f1a('0x20')](_0x16f36c[_0x7f1a('0x1b')],qs[_0x7f1a('0x21')](_0xdabe6a[_0x7f1a('0x1c')]['fields']));_0x130174[_0x7f1a('0x1f')]=_0x130174[_0x7f1a('0x1f')][_0x7f1a('0x22')]?_0x130174[_0x7f1a('0x1f')]:_0x16f36c['model'];if(_0xdabe6a['query']['includeAll']){_0x130174['include']=[{'all':!![]}];}_0x130174=_[_0x7f1a('0x2a')]({},_0x130174,_0xdabe6a[_0x7f1a('0x2c')]);return db[_0x7f1a('0x17')]['find'](_0x130174)[_0x7f1a('0x2d')](handleEntityNotFound(_0x3e2b23,null))[_0x7f1a('0x2d')](respondWithResult(_0x3e2b23,null))[_0x7f1a('0x31')](handleError(_0x3e2b23,null));};exports[_0x7f1a('0x34')]=function(_0x37b97f,_0x418b31){return db[_0x7f1a('0x17')]['create'](_0x37b97f[_0x7f1a('0x35')],{})[_0x7f1a('0x2d')](respondWithResult(_0x418b31,0xc9))[_0x7f1a('0x31')](handleError(_0x418b31,null));};exports[_0x7f1a('0x36')]=function(_0x85737b,_0x5d0878){if(_0x85737b[_0x7f1a('0x35')]['id']){delete _0x85737b['body']['id'];}return db[_0x7f1a('0x17')][_0x7f1a('0x37')]({'where':{'id':_0x85737b[_0x7f1a('0x33')]['id']}})['then'](handleEntityNotFound(_0x5d0878,null))[_0x7f1a('0x2d')](saveUpdates(_0x85737b[_0x7f1a('0x35')],null))[_0x7f1a('0x2d')](respondWithResult(_0x5d0878,null))[_0x7f1a('0x31')](handleError(_0x5d0878,null));};exports[_0x7f1a('0xe')]=function(_0x5b1839,_0x39508f){return db[_0x7f1a('0x17')][_0x7f1a('0x37')]({'where':{'id':_0x5b1839['params']['id']}})['then'](handleEntityNotFound(_0x39508f,null))[_0x7f1a('0x2d')](removeEntity(_0x39508f,null))[_0x7f1a('0x31')](handleError(_0x39508f,null));};exports[_0x7f1a('0x38')]=function(_0x10c155,_0x4b5393){var _0x591a0d={};var _0x45a90f={};var _0x28af44;var _0x1e914c;return db[_0x7f1a('0x17')][_0x7f1a('0x39')]({'where':{'id':_0x10c155[_0x7f1a('0x33')]['id']}})[_0x7f1a('0x2d')](handleEntityNotFound(_0x4b5393,null))['then'](function(_0x384449){if(_0x384449){_0x28af44=_0x384449;_0x45a90f[_0x7f1a('0x1b')]=_[_0x7f1a('0x1d')](db[_0x7f1a('0x3a')][_0x7f1a('0x18')]);_0x45a90f[_0x7f1a('0x1c')]=_[_0x7f1a('0x1d')](_0x10c155['query']);_0x45a90f[_0x7f1a('0x1e')]=_[_0x7f1a('0x20')](_0x45a90f[_0x7f1a('0x1b')],_0x45a90f[_0x7f1a('0x1c')]);_0x591a0d[_0x7f1a('0x1f')]=_[_0x7f1a('0x20')](_0x45a90f[_0x7f1a('0x1b')],qs[_0x7f1a('0x21')](_0x10c155[_0x7f1a('0x1c')][_0x7f1a('0x21')]));_0x591a0d['attributes']=_0x591a0d[_0x7f1a('0x1f')][_0x7f1a('0x22')]?_0x591a0d[_0x7f1a('0x1f')]:_0x45a90f[_0x7f1a('0x1b')];_0x591a0d[_0x7f1a('0x25')]=qs[_0x7f1a('0x26')](_0x10c155[_0x7f1a('0x1c')][_0x7f1a('0x26')]);_0x591a0d[_0x7f1a('0x27')]=qs['filters'](_[_0x7f1a('0x28')](_0x10c155[_0x7f1a('0x1c')],_0x45a90f[_0x7f1a('0x1e')]));if(_0x10c155[_0x7f1a('0x1c')][_0x7f1a('0x29')]){_0x591a0d['where']=_[_0x7f1a('0x2a')](_0x591a0d[_0x7f1a('0x27')],{'$or':_[_0x7f1a('0x16')](_0x591a0d[_0x7f1a('0x1f')],function(_0x34ffbf){var _0x1d7223={};_0x1d7223[_0x34ffbf]={'$like':'%'+_0x10c155[_0x7f1a('0x1c')]['filter']+'%'};return _0x1d7223;})});}_0x591a0d=_[_0x7f1a('0x2a')]({},_0x591a0d,_0x10c155['options']);return _0x28af44[_0x7f1a('0x38')](_0x591a0d);}})[_0x7f1a('0x2d')](function(_0x1b1d8d){if(_0x1b1d8d){_0x1e914c=_0x1b1d8d['length'];if(!_0x10c155[_0x7f1a('0x1c')]['hasOwnProperty'](_0x7f1a('0x24'))){_0x591a0d[_0x7f1a('0xa')]=qs[_0x7f1a('0xa')](_0x10c155[_0x7f1a('0x1c')]['limit']);_0x591a0d[_0x7f1a('0x8')]=qs['offset'](_0x10c155['query']['offset']);}return _0x28af44[_0x7f1a('0x38')](_0x591a0d);}})[_0x7f1a('0x2d')](function(_0x4fab61){if(_0x4fab61){return _0x4fab61?{'count':_0x1e914c,'rows':_0x4fab61}:null;}})[_0x7f1a('0x2d')](respondWithResult(_0x4b5393,null))[_0x7f1a('0x31')](handleError(_0x4b5393,null));};exports[_0x7f1a('0x3b')]=function(_0x1fb0ea,_0x5e7224){if(_0x1fb0ea[_0x7f1a('0x35')]['id']){delete _0x1fb0ea['body']['id'];}return db[_0x7f1a('0x17')]['findOne']({'where':{'id':_0x1fb0ea[_0x7f1a('0x33')]['id']}})['then'](handleEntityNotFound(_0x5e7224,null))[_0x7f1a('0x2d')](function(_0x382196){if(_0x382196){_0x1fb0ea['body'][_0x7f1a('0x3c')]=_0x382196['id'];_0x1fb0ea[_0x7f1a('0x35')][_0x7f1a('0x3d')]=integrations[_0x7f1a('0x3e')](_0x1fb0ea[_0x7f1a('0x35')][_0x7f1a('0x3f')],_0x1fb0ea[_0x7f1a('0x35')][_0x7f1a('0x1a')]);_0x1fb0ea[_0x7f1a('0x35')][_0x7f1a('0x40')]=integrations[_0x7f1a('0x41')](_0x1fb0ea['body'][_0x7f1a('0x3f')],_0x1fb0ea[_0x7f1a('0x35')][_0x7f1a('0x1a')]);return db['Dynamics365Configuration'][_0x7f1a('0x34')](_0x1fb0ea[_0x7f1a('0x35')],{'include':[{'model':db[_0x7f1a('0x42')],'as':_0x7f1a('0x3d')},{'model':db[_0x7f1a('0x42')],'as':'Descriptions'}]});}return null;})[_0x7f1a('0x2d')](respondWithResult(_0x5e7224,null))[_0x7f1a('0x31')](handleError(_0x5e7224,null));};function sanitizeRemoteUri(_0x103bde){var _0xa0cc03=_0x103bde[_0x7f1a('0x43')](-0x1);if(_0xa0cc03==='/')return _0x103bde[_0x7f1a('0x44')](0x0,_0x103bde[_0x7f1a('0x45')](_0xa0cc03));return _0x103bde;}function getWebApiUrl(_0x18d4a1){return util[_0x7f1a('0x46')](_0x7f1a('0x47'),_0x18d4a1);}exports['getFields']=function(_0x54bb43,_0x2193cb){var _0x360eee=_0x54bb43['query'][_0x7f1a('0x48')];var _0x38dfe0=_0x360eee===_0x7f1a('0x49')?_0x7f1a('0x4a'):_0x7f1a('0x4b');var _0x598f7e='';var _0x5e8187='';var _0x36a540='';var _0xbdac1d='';var _0x458388='';var _0x1665af='';var _0x156823='';var _0x34e727='';var _0x2bead5=[_0x7f1a('0x4c'),_0x7f1a('0x4d'),'customerid',_0x7f1a('0x4e'),_0x7f1a('0x4f'),_0x7f1a('0x50'),_0x7f1a('0x51'),'regardingobjectid',_0x7f1a('0x52'),'phonecall_activity_parties'];var _0xd81ee3=[_0x7f1a('0x53'),_0x7f1a('0x54'),_0x7f1a('0x55'),_0x7f1a('0x56'),_0x7f1a('0x57'),'contactidyominame',_0x7f1a('0x58'),_0x7f1a('0x59'),_0x7f1a('0x5a'),_0x7f1a('0x5b'),_0x7f1a('0x5c'),_0x7f1a('0x5d'),_0x7f1a('0x5e'),_0x7f1a('0x5f'),_0x7f1a('0x60'),_0x7f1a('0x61'),'customeridtype',_0x7f1a('0x62'),_0x7f1a('0x63'),_0x7f1a('0x64'),_0x7f1a('0x65'),_0x7f1a('0x66'),_0x7f1a('0x67'),_0x7f1a('0x68'),'firstresponsebykpiidname',_0x7f1a('0x69'),_0x7f1a('0x6a'),_0x7f1a('0x6b'),_0x7f1a('0x6c'),'lastonholdtime',_0x7f1a('0x6d'),_0x7f1a('0x6e'),'modifiedbyexternalpartyyominame',_0x7f1a('0x6f'),_0x7f1a('0x70'),_0x7f1a('0x71'),_0x7f1a('0x72'),_0x7f1a('0x73'),_0x7f1a('0x74'),_0x7f1a('0x75'),'numberofchildincidents',_0x7f1a('0x76'),_0x7f1a('0x77'),'owneridname',_0x7f1a('0x78'),_0x7f1a('0x79'),_0x7f1a('0x7a'),_0x7f1a('0x7b'),'primarycontactidyominame','prioritycodename',_0x7f1a('0x7c'),_0x7f1a('0x7d'),_0x7f1a('0x7e'),'resolvebykpiidname','responseby',_0x7f1a('0x7f'),_0x7f1a('0x80'),_0x7f1a('0x81'),_0x7f1a('0x82'),_0x7f1a('0x83'),'socialprofileidname',_0x7f1a('0x84'),_0x7f1a('0x85'),'subjectidname',_0x7f1a('0x86'),_0x7f1a('0x87'),_0x7f1a('0x88'),_0x7f1a('0x89'),_0x7f1a('0x8a'),'versionnumber'];var _0x17ef17=_0x2bead5[_0x7f1a('0x8b')](_0xd81ee3);return db['Dynamics365Account'][_0x7f1a('0x39')]({'where':{'id':_0x54bb43[_0x7f1a('0x33')]['id']},'attributes':['id','username',_0x7f1a('0x8c'),'remoteUri',_0x7f1a('0x8d'),_0x7f1a('0x8e'),'clientSecret',_0x7f1a('0x8f')],'include':[{'model':db[_0x7f1a('0x90')],'as':_0x7f1a('0x90'),'attributes':['id',_0x7f1a('0x91'),_0x7f1a('0x92')]}]})[_0x7f1a('0x2d')](handleEntityNotFound(_0x2193cb,null))[_0x7f1a('0x2d')](function(_0x500d68){if(_0x500d68){if(_0x500d68[_0x7f1a('0x8f')]){_0x500d68[_0x7f1a('0x93')]=_0x500d68[_0x7f1a('0x90')][_0x7f1a('0x91')];_0x34e727=sanitizeRemoteUri(_0x500d68[_0x7f1a('0x90')]['data7']);_0x156823=getWebApiUrl(_0x34e727);return _0x500d68;}_0x34e727=sanitizeRemoteUri(_0x500d68[_0x7f1a('0x94')]);_0x156823=getWebApiUrl(_0x34e727);var _0x4bdfba={'method':_0x7f1a('0x95'),'uri':'https://login.microsoftonline.com/'+_0x500d68[_0x7f1a('0x8d')]+_0x7f1a('0x96'),'form':{'client_id':_0x500d68[_0x7f1a('0x8e')],'resource':_0x34e727,'username':_0x500d68[_0x7f1a('0x97')],'password':_0x500d68[_0x7f1a('0x8c')],'grant_type':_0x7f1a('0x8c'),'client_secret':_0x500d68[_0x7f1a('0x98')]},'json':!![]};return rp(_0x4bdfba);}})[_0x7f1a('0x2d')](function(_0x36d099){_0x1665af=_0x36d099[_0x7f1a('0x93')];var _0x54a831={'method':_0x7f1a('0x99'),'uri':encodeURI(_0x156823+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x38dfe0+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x1665af,'If-None-Match':null,'OData-Version':_0x7f1a('0x9a')},'json':!![]};return rp(_0x54a831);})['then'](function(_0xd3627f){var _0xb94a1b=_0xd3627f[_0x7f1a('0x9b')][0x0];var _0x1ee2b3=_0xb94a1b[_0x7f1a('0x9c')];var _0x53052f={'method':_0x7f1a('0x99'),'uri':_0x156823+'EntityDefinitions('+_0x1ee2b3+_0x7f1a('0x9d'),'headers':{'Authorization':_0x7f1a('0x9e')+_0x1665af,'If-None-Match':null,'OData-Version':_0x7f1a('0x9a')},'json':!![]};return rp(_0x53052f);})[_0x7f1a('0x2d')](function(_0x2777de){_0x598f7e=_0x2777de;_0x5e8187=_0x598f7e['Attributes'];_0x5e8187=_[_0x7f1a('0x9f')](_0x5e8187,function(_0x3fc2f4){return!_0x17ef17[_0x7f1a('0xa0')](_0x3fc2f4[_0x7f1a('0xa1')]);});var _0x52efcb=[];var _0x58e076=[];_0x5e8187['forEach'](function(_0x1dfd71){if(_0x1dfd71['@odata.type']){var _0x4c2f6e=_0x1dfd71['@odata.type'][_0x7f1a('0x44')](_0x1dfd71[_0x7f1a('0xa2')][_0x7f1a('0x45')]('.')+0x1);if(_0x4c2f6e===_0x7f1a('0xa3')){_0x52efcb['push'](getSelectList(_0x156823,_0x360eee,_0x58e076,_0x598f7e[_0x7f1a('0x9c')],_0x1dfd71['MetadataId'],_0x1665af));}}});return Promise['all'](_0x52efcb);})[_0x7f1a('0x2d')](function(_0x59e071){_0x36a540=_0x59e071[0x0];var _0x499fed=[];var _0x58f8a6=[];_0x5e8187[_0x7f1a('0xa4')](function(_0x2b532e){if(!_[_0x7f1a('0xa5')](_0x2b532e[_0x7f1a('0xa2')])){var _0x486792=_0x2b532e[_0x7f1a('0xa2')][_0x7f1a('0x44')](_0x2b532e[_0x7f1a('0xa2')][_0x7f1a('0x45')]('.')+0x1);if(_0x486792===_0x7f1a('0xa6')){_0x499fed[_0x7f1a('0xa7')](getBooleanList(_0x156823,_0x360eee,_0x58f8a6,_0x598f7e[_0x7f1a('0x9c')],_0x2b532e[_0x7f1a('0x9c')],_0x1665af));}}});return Promise[_0x7f1a('0xa8')](_0x499fed);})[_0x7f1a('0x2d')](function(_0x1cf7a0){_0xbdac1d=_0x1cf7a0[0x0];var _0x161320=[];var _0x5ad5e7=[];_0x5e8187[_0x7f1a('0xa4')](function(_0x40d43d){if(_0x40d43d['@odata.type']){var _0x3dae2=_0x40d43d['@odata.type'][_0x7f1a('0x44')](_0x40d43d['@odata.type'][_0x7f1a('0x45')]('.')+0x1);if(_0x3dae2===_0x7f1a('0xa9')||_0x3dae2==='DoubleAttributeMetadata'||_0x3dae2===_0x7f1a('0xaa')||_0x3dae2===_0x7f1a('0xab')||_0x3dae2===_0x7f1a('0xac')||_0x3dae2==='DateTimeAttributeMetadata'||_0x3dae2===_0x7f1a('0xad')||_0x3dae2==='EntityNameAttributeMetadata'||_0x3dae2===_0x7f1a('0xae')||_0x3dae2===_0x7f1a('0xaf')){_0x161320[_0x7f1a('0xa7')](getInputList(_0x156823,_0x360eee,_0x3dae2,_0x5ad5e7,_0x598f7e[_0x7f1a('0x9c')],_0x40d43d[_0x7f1a('0x9c')],_0x1665af));}}});return Promise[_0x7f1a('0xa8')](_0x161320);})[_0x7f1a('0x2d')](function(_0x4b94f9){_0x458388=_0x4b94f9[0x0];var _0x58d864=_0x36a540[_0x7f1a('0x8b')](_0xbdac1d)[_0x7f1a('0x8b')](_0x458388);var _0x2e9881={'count':_0x58d864['length'],'rows':_0x58d864};return _0x2e9881;})['then'](respondWithResult(_0x2193cb,null))[_0x7f1a('0x31')](function(_0x727545){var _0x48d797=_0x54bb43[_0x7f1a('0x1c')]['test']?0x1f4:_0x727545[_0x7f1a('0xb0')]||0x1f4;logger[_0x7f1a('0x11')](_0x727545['stack']);delete _0x727545[_0x7f1a('0x13')];if(_0x48d797===0x191){_0x48d797=0x190;}_0x2193cb[_0x7f1a('0x6')](_0x48d797)[_0x7f1a('0x14')](_0x54bb43[_0x7f1a('0x1c')][_0x7f1a('0xb1')]?{'message':'Wrong\x20credentials','statusCode':_0x727545[_0x7f1a('0xb0')]}:_0x727545);});};function getSelectList(_0x4a0370,_0x1a21c1,_0x440487,_0x18d222,_0x3ab02f,_0x441d05){var _0x26557f={'method':_0x7f1a('0x99'),'uri':_0x4a0370+'EntityDefinitions('+_0x18d222+_0x7f1a('0xb2')+_0x3ab02f+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x7f1a('0xb3'),'headers':{'Authorization':'Bearer\x20'+_0x441d05,'If-None-Match':null,'OData-Version':_0x7f1a('0x9a')},'json':!![]};return rp(_0x26557f)['then'](function(_0x491c7d){var _0x202aa6=[];var _0x303cca=_0x491c7d[_0x7f1a('0xb4')]['Options'];_0x303cca['forEach'](function(_0xc9e659){_0x202aa6[_0x7f1a('0xa7')]({'name':_0xc9e659[_0x7f1a('0xb5')][_0x7f1a('0xb6')]['Label'],'value':String(_0xc9e659[_0x7f1a('0xb7')])});});var _0x26ff5b={'id':_0x1a21c1+'_'+_0x491c7d[_0x7f1a('0xa1')],'name':_0x491c7d[_0x7f1a('0xb8')][_0x7f1a('0xb6')][_0x7f1a('0xb5')],'custom':![],'options':_0x202aa6};_0x440487[_0x7f1a('0xa7')](_0x26ff5b);return _0x440487;});}function getBooleanList(_0x236e37,_0x4bb2fe,_0x1672e9,_0x39078c,_0x4dc1fc,_0x4d22cd){var _0x1063ec={'method':_0x7f1a('0x99'),'uri':_0x236e37+_0x7f1a('0xb9')+_0x39078c+_0x7f1a('0xb2')+_0x4dc1fc+_0x7f1a('0xba'),'headers':{'Authorization':'Bearer\x20'+_0x4d22cd,'If-None-Match':null,'OData-Version':_0x7f1a('0x9a')},'json':!![]};return rp(_0x1063ec)['then'](function(_0x43242d){var _0x4369d9=[];_0x4369d9[_0x7f1a('0xa7')]({'name':_0x43242d['OptionSet'][_0x7f1a('0xbb')][_0x7f1a('0xb5')][_0x7f1a('0xb6')][_0x7f1a('0xb5')],'value':_0x7f1a('0xbc')},{'name':_0x43242d[_0x7f1a('0xb4')]['FalseOption'][_0x7f1a('0xb5')][_0x7f1a('0xb6')]['Label'],'value':_0x7f1a('0xbd')});var _0x2a40ee={'id':_0x4bb2fe+'_'+_0x43242d['LogicalName'],'name':_0x43242d['DisplayName']['UserLocalizedLabel'][_0x7f1a('0xb5')],'custom':![],'options':_0x4369d9};_0x1672e9[_0x7f1a('0xa7')](_0x2a40ee);return _0x1672e9;});}function getInputList(_0x3b443e,_0x2601ae,_0x589146,_0x29c9f2,_0x3bdfc9,_0x363b61,_0x2772c9){var _0x445667={'method':_0x7f1a('0x99'),'uri':_0x3b443e+_0x7f1a('0xb9')+_0x3bdfc9+_0x7f1a('0xb2')+_0x363b61+')/Microsoft.Dynamics.CRM.'+_0x589146+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x2772c9,'If-None-Match':null,'OData-Version':_0x7f1a('0x9a')},'json':!![]};return rp(_0x445667)[_0x7f1a('0x2d')](function(_0x2d3b7d){var _0xa34c62={'id':_0x2601ae+'_'+_0x2d3b7d['LogicalName'],'name':_0x2d3b7d[_0x7f1a('0xb8')][_0x7f1a('0xb6')]?_0x2d3b7d[_0x7f1a('0xb8')][_0x7f1a('0xb6')][_0x7f1a('0xb5')]:_0x2d3b7d[_0x7f1a('0xa1')],'custom':![],'options':[]};_0x29c9f2[_0x7f1a('0xa7')](_0xa34c62);return _0x29c9f2;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 34faf4c..3f5373c 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x3f25b2,_0x412bd4){var _0xd8caeb=function(_0x52d252){while(--_0x52d252){_0x3f25b2['push'](_0x3f25b2['shift']());}};_0xd8caeb(++_0x412bd4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x4fcca3,_0x2271e3){var _0x3e8bfc=function(_0x39c649){while(--_0x39c649){_0x4fcca3['push'](_0x4fcca3['shift']());}};_0x3e8bfc(++_0x2271e3);}(_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'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 9be4d59..731e49b 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 _0xbfe8=['message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','debug','find','ShowDynamics365Account','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xbfe8,0x100));var _0x8bfe=function(_0x1bc137,_0x448833){_0x1bc137=_0x1bc137-0x0;var _0x585001=_0xbfe8[_0x1bc137];return _0x585001;};'use strict';var _=require('lodash');var util=require(_0x8bfe('0x0'));var moment=require(_0x8bfe('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8bfe('0x2'));var db=require(_0x8bfe('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8bfe('0x4'))(_0x8bfe('0x5'));var config=require(_0x8bfe('0x6'));var jayson=require(_0x8bfe('0x7'));var client=jayson['client'][_0x8bfe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbaa93b,_0x58881a,_0x2b3dcb){return new BPromise(function(_0x2b5e42,_0x55abda){return client['request'](_0xbaa93b,_0x2b3dcb)[_0x8bfe('0x9')](function(_0x35c171){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x58881a,_0x8bfe('0xa'));logger['debug'](_0x8bfe('0xb'),_0x58881a,_0x8bfe('0xa'),JSON[_0x8bfe('0xc')](_0x35c171));if(_0x35c171[_0x8bfe('0xd')]){if(_0x35c171[_0x8bfe('0xd')][_0x8bfe('0xe')]===0x1f4){logger[_0x8bfe('0xd')](_0x8bfe('0xf'),_0x58881a,_0x35c171[_0x8bfe('0xd')][_0x8bfe('0x10')]);return _0x55abda(_0x35c171[_0x8bfe('0xd')][_0x8bfe('0x10')]);}logger[_0x8bfe('0xd')](_0x8bfe('0xf'),_0x58881a,_0x35c171[_0x8bfe('0xd')][_0x8bfe('0x10')]);return _0x2b5e42(_0x35c171['error'][_0x8bfe('0x10')]);}else{logger[_0x8bfe('0x11')](_0x8bfe('0xf'),_0x58881a,_0x8bfe('0xa'));_0x2b5e42(_0x35c171[_0x8bfe('0x12')][_0x8bfe('0x10')]);}})[_0x8bfe('0x13')](function(_0x41d0a4){logger[_0x8bfe('0xd')](_0x8bfe('0xf'),_0x58881a,_0x41d0a4);_0x55abda(_0x41d0a4);});});}exports[_0x8bfe('0x14')]=function(_0x3da47c){var _0x1abee3=this;return new Promise(function(_0x2a1a73,_0x36d00f){return db[_0x8bfe('0x15')][_0x8bfe('0x16')]({'raw':_0x3da47c[_0x8bfe('0x17')]?_0x3da47c[_0x8bfe('0x17')][_0x8bfe('0x18')]===undefined?!![]:![]:!![],'where':_0x3da47c[_0x8bfe('0x17')]?_0x3da47c[_0x8bfe('0x17')][_0x8bfe('0x19')]||null:null,'attributes':_0x3da47c[_0x8bfe('0x17')]?_0x3da47c[_0x8bfe('0x17')][_0x8bfe('0x1a')]||null:null,'limit':_0x3da47c[_0x8bfe('0x17')]?_0x3da47c[_0x8bfe('0x17')][_0x8bfe('0x1b')]||null:null,'include':_0x3da47c['options']?_0x3da47c[_0x8bfe('0x17')][_0x8bfe('0x1c')]?_[_0x8bfe('0x1d')](_0x3da47c[_0x8bfe('0x17')]['include'],function(_0x53eb2a){return{'model':db[_0x53eb2a[_0x8bfe('0x1e')]],'as':_0x53eb2a['as'],'attributes':_0x53eb2a['attributes'],'include':_0x53eb2a['include']?_[_0x8bfe('0x1d')](_0x53eb2a[_0x8bfe('0x1c')],function(_0x4c0bb5){return{'model':db[_0x4c0bb5[_0x8bfe('0x1e')]],'as':_0x4c0bb5['as'],'attributes':_0x4c0bb5['attributes'],'include':_0x4c0bb5[_0x8bfe('0x1c')]?_['map'](_0x4c0bb5[_0x8bfe('0x1c')],function(_0x17e031){return{'model':db[_0x17e031[_0x8bfe('0x1e')]],'as':_0x17e031['as'],'attributes':_0x17e031['attributes']};}):[]};}):[]};}):[]:[]})[_0x8bfe('0x9')](function(_0x35fcaa){logger[_0x8bfe('0x11')](_0x8bfe('0x14'),_0x3da47c);logger[_0x8bfe('0x1f')](_0x8bfe('0x14'),_0x3da47c,JSON[_0x8bfe('0xc')](_0x35fcaa));_0x2a1a73(_0x35fcaa);})[_0x8bfe('0x13')](function(_0x38dea0){logger[_0x8bfe('0xd')](_0x8bfe('0x14'),_0x38dea0[_0x8bfe('0x10')],_0x3da47c);_0x36d00f(_0x1abee3['error'](0x1f4,_0x38dea0[_0x8bfe('0x10')]));});});};exports['ShowDynamics365Account']=function(_0x2eb308){var _0x40110c=this;return new Promise(function(_0x3df752,_0x2fe160){return db[_0x8bfe('0x15')][_0x8bfe('0x20')]({'raw':_0x2eb308[_0x8bfe('0x17')]?_0x2eb308[_0x8bfe('0x17')][_0x8bfe('0x18')]===undefined?!![]:![]:!![],'where':_0x2eb308[_0x8bfe('0x17')]?_0x2eb308['options'][_0x8bfe('0x19')]||null:null,'attributes':_0x2eb308[_0x8bfe('0x17')]?_0x2eb308[_0x8bfe('0x17')]['attributes']||null:null,'include':_0x2eb308[_0x8bfe('0x17')]?_0x2eb308[_0x8bfe('0x17')]['include']?_['map'](_0x2eb308['options'][_0x8bfe('0x1c')],function(_0x2aa332){return{'model':db[_0x2aa332[_0x8bfe('0x1e')]],'as':_0x2aa332['as'],'attributes':_0x2aa332['attributes'],'include':_0x2aa332[_0x8bfe('0x1c')]?_['map'](_0x2aa332['include'],function(_0x1cf2fc){return{'model':db[_0x1cf2fc['model']],'as':_0x1cf2fc['as'],'attributes':_0x1cf2fc[_0x8bfe('0x1a')],'include':_0x1cf2fc['include']?_[_0x8bfe('0x1d')](_0x1cf2fc[_0x8bfe('0x1c')],function(_0x5c7fad){return{'model':db[_0x5c7fad[_0x8bfe('0x1e')]],'as':_0x5c7fad['as'],'attributes':_0x5c7fad[_0x8bfe('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8bfe('0x9')](function(_0x84f6ae){logger[_0x8bfe('0x11')](_0x8bfe('0x21'),_0x2eb308);logger[_0x8bfe('0x1f')]('ShowDynamics365Account',_0x2eb308,JSON[_0x8bfe('0xc')](_0x84f6ae));_0x3df752(_0x84f6ae);})[_0x8bfe('0x13')](function(_0x361ba1){logger[_0x8bfe('0xd')]('ShowDynamics365Account',_0x361ba1[_0x8bfe('0x10')],_0x2eb308);_0x2fe160(_0x40110c['error'](0x1f4,_0x361ba1[_0x8bfe('0x10')]));});});}; \ No newline at end of file +var _0x60e7=['message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','include','model','attributes','map','find','ShowDynamics365Account','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x13e54b,_0xd74568){var _0x855457=function(_0x33e1b8){while(--_0x33e1b8){_0x13e54b['push'](_0x13e54b['shift']());}};_0x855457(++_0xd74568);}(_0x60e7,0x1e3));var _0x760e=function(_0x2a3306,_0x27fd5b){_0x2a3306=_0x2a3306-0x0;var _0x3c3859=_0x60e7[_0x2a3306];return _0x3c3859;};'use strict';var _=require(_0x760e('0x0'));var util=require(_0x760e('0x1'));var moment=require(_0x760e('0x2'));var BPromise=require('bluebird');var rs=require(_0x760e('0x3'));var fs=require('fs');var Redis=require(_0x760e('0x4'));var db=require(_0x760e('0x5'))['db'];var utils=require(_0x760e('0x6'));var logger=require(_0x760e('0x7'))(_0x760e('0x8'));var config=require('../../config/environment');var jayson=require(_0x760e('0x9'));var client=jayson['client'][_0x760e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45baab,_0x5e867c,_0x2225d3){return new BPromise(function(_0x31c01f,_0x127887){return client[_0x760e('0xb')](_0x45baab,_0x2225d3)[_0x760e('0xc')](function(_0x28b4ab){logger[_0x760e('0xd')](_0x760e('0xe'),_0x5e867c,_0x760e('0xf'));logger[_0x760e('0x10')](_0x760e('0x11'),_0x5e867c,_0x760e('0xf'),JSON[_0x760e('0x12')](_0x28b4ab));if(_0x28b4ab['error']){if(_0x28b4ab[_0x760e('0x13')][_0x760e('0x14')]===0x1f4){logger[_0x760e('0x13')](_0x760e('0xe'),_0x5e867c,_0x28b4ab[_0x760e('0x13')][_0x760e('0x15')]);return _0x127887(_0x28b4ab[_0x760e('0x13')]['message']);}logger[_0x760e('0x13')](_0x760e('0xe'),_0x5e867c,_0x28b4ab[_0x760e('0x13')][_0x760e('0x15')]);return _0x31c01f(_0x28b4ab['error'][_0x760e('0x15')]);}else{logger[_0x760e('0xd')](_0x760e('0xe'),_0x5e867c,_0x760e('0xf'));_0x31c01f(_0x28b4ab[_0x760e('0x16')][_0x760e('0x15')]);}})[_0x760e('0x17')](function(_0x3c2374){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5e867c,_0x3c2374);_0x127887(_0x3c2374);});});}exports[_0x760e('0x18')]=function(_0x282120){var _0x4c613c=this;return new Promise(function(_0x23e16d,_0x5bc46f){return db[_0x760e('0x19')][_0x760e('0x1a')]({'raw':_0x282120[_0x760e('0x1b')]?_0x282120[_0x760e('0x1b')][_0x760e('0x1c')]===undefined?!![]:![]:!![],'where':_0x282120[_0x760e('0x1b')]?_0x282120[_0x760e('0x1b')][_0x760e('0x1d')]||null:null,'attributes':_0x282120['options']?_0x282120[_0x760e('0x1b')]['attributes']||null:null,'limit':_0x282120[_0x760e('0x1b')]?_0x282120['options']['limit']||null:null,'include':_0x282120['options']?_0x282120['options'][_0x760e('0x1e')]?_['map'](_0x282120[_0x760e('0x1b')][_0x760e('0x1e')],function(_0x48e472){return{'model':db[_0x48e472[_0x760e('0x1f')]],'as':_0x48e472['as'],'attributes':_0x48e472[_0x760e('0x20')],'include':_0x48e472['include']?_['map'](_0x48e472[_0x760e('0x1e')],function(_0x3332ab){return{'model':db[_0x3332ab[_0x760e('0x1f')]],'as':_0x3332ab['as'],'attributes':_0x3332ab[_0x760e('0x20')],'include':_0x3332ab[_0x760e('0x1e')]?_[_0x760e('0x21')](_0x3332ab[_0x760e('0x1e')],function(_0x3771bd){return{'model':db[_0x3771bd['model']],'as':_0x3771bd['as'],'attributes':_0x3771bd[_0x760e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d66fd){logger[_0x760e('0xd')](_0x760e('0x18'),_0x282120);logger[_0x760e('0x10')](_0x760e('0x18'),_0x282120,JSON['stringify'](_0x5d66fd));_0x23e16d(_0x5d66fd);})[_0x760e('0x17')](function(_0x36b5be){logger[_0x760e('0x13')](_0x760e('0x18'),_0x36b5be[_0x760e('0x15')],_0x282120);_0x5bc46f(_0x4c613c[_0x760e('0x13')](0x1f4,_0x36b5be['message']));});});};exports['ShowDynamics365Account']=function(_0x1b757e){var _0x126771=this;return new Promise(function(_0x386977,_0x950a42){return db[_0x760e('0x19')][_0x760e('0x22')]({'raw':_0x1b757e['options']?_0x1b757e[_0x760e('0x1b')][_0x760e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b757e[_0x760e('0x1b')]?_0x1b757e[_0x760e('0x1b')][_0x760e('0x1d')]||null:null,'attributes':_0x1b757e[_0x760e('0x1b')]?_0x1b757e[_0x760e('0x1b')][_0x760e('0x20')]||null:null,'include':_0x1b757e[_0x760e('0x1b')]?_0x1b757e[_0x760e('0x1b')][_0x760e('0x1e')]?_[_0x760e('0x21')](_0x1b757e['options']['include'],function(_0x3b6ccb){return{'model':db[_0x3b6ccb[_0x760e('0x1f')]],'as':_0x3b6ccb['as'],'attributes':_0x3b6ccb[_0x760e('0x20')],'include':_0x3b6ccb[_0x760e('0x1e')]?_[_0x760e('0x21')](_0x3b6ccb[_0x760e('0x1e')],function(_0x33905e){return{'model':db[_0x33905e[_0x760e('0x1f')]],'as':_0x33905e['as'],'attributes':_0x33905e[_0x760e('0x20')],'include':_0x33905e[_0x760e('0x1e')]?_[_0x760e('0x21')](_0x33905e[_0x760e('0x1e')],function(_0x4ed341){return{'model':db[_0x4ed341[_0x760e('0x1f')]],'as':_0x4ed341['as'],'attributes':_0x4ed341[_0x760e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x344f80){logger[_0x760e('0xd')]('ShowDynamics365Account',_0x1b757e);logger[_0x760e('0x10')](_0x760e('0x23'),_0x1b757e,JSON[_0x760e('0x12')](_0x344f80));_0x386977(_0x344f80);})[_0x760e('0x17')](function(_0x5ba9cb){logger[_0x760e('0x13')](_0x760e('0x23'),_0x5ba9cb[_0x760e('0x15')],_0x1b757e);_0x950a42(_0x126771[_0x760e('0x13')](0x1f4,_0x5ba9cb[_0x760e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 14d2693..d943750 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 _0x9101=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','/:id'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x9101,0x9c));var _0x1910=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x9101[_0x45783c];return _0x1161da;};'use strict';var multer=require(_0x1910('0x0'));var util=require(_0x1910('0x1'));var path=require('path');var timeout=require(_0x1910('0x2'));var express=require(_0x1910('0x3'));var router=express[_0x1910('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1910('0x5'));var config=require('../../config/environment');var controller=require(_0x1910('0x6'));router[_0x1910('0x7')]('/',auth[_0x1910('0x8')](),controller[_0x1910('0x9')]);router[_0x1910('0x7')]('/:id',auth[_0x1910('0x8')](),controller['show']);router[_0x1910('0x7')](_0x1910('0xa'),auth['isAuthenticated'](),controller[_0x1910('0xb')]);router[_0x1910('0x7')](_0x1910('0xc'),auth[_0x1910('0x8')](),controller[_0x1910('0xd')]);router[_0x1910('0x7')](_0x1910('0xe'),auth['isAuthenticated'](),controller[_0x1910('0xf')]);router[_0x1910('0x10')]('/',auth[_0x1910('0x8')](),controller[_0x1910('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1910('0x12')]);router['delete'](_0x1910('0x13'),auth[_0x1910('0x8')](),controller[_0x1910('0x14')]);module[_0x1910('0x15')]=router; \ No newline at end of file +var _0x6b20=['/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x419aa4,_0x5926a7){var _0x557d9b=function(_0x43c9ac){while(--_0x43c9ac){_0x419aa4['push'](_0x419aa4['shift']());}};_0x557d9b(++_0x5926a7);}(_0x6b20,0xd1));var _0x06b2=function(_0x20df33,_0x3f51f7){_0x20df33=_0x20df33-0x0;var _0x3b8c27=_0x6b20[_0x20df33];return _0x3b8c27;};'use strict';var multer=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var path=require('path');var timeout=require(_0x06b2('0x2'));var express=require('express');var router=express[_0x06b2('0x3')]();var fs_extra=require(_0x06b2('0x4'));var auth=require(_0x06b2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x06b2('0x6'));var controller=require(_0x06b2('0x7'));router[_0x06b2('0x8')]('/',auth[_0x06b2('0x9')](),controller[_0x06b2('0xa')]);router[_0x06b2('0x8')](_0x06b2('0xb'),auth['isAuthenticated'](),controller[_0x06b2('0xc')]);router[_0x06b2('0x8')](_0x06b2('0xd'),auth['isAuthenticated'](),controller[_0x06b2('0xe')]);router['get'](_0x06b2('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x06b2('0x8')](_0x06b2('0x10'),auth['isAuthenticated'](),controller[_0x06b2('0x11')]);router[_0x06b2('0x12')]('/',auth[_0x06b2('0x9')](),controller[_0x06b2('0x13')]);router[_0x06b2('0x14')](_0x06b2('0xb'),auth[_0x06b2('0x9')](),controller[_0x06b2('0x15')]);router[_0x06b2('0x16')](_0x06b2('0xb'),auth[_0x06b2('0x9')](),controller[_0x06b2('0x17')]);module[_0x06b2('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 033b237..56c560c 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 _0x480b=['exports','STRING','ENUM','incident','contact','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x480b,0x197));var _0xb480=function(_0x59829e,_0x5bf039){_0x59829e=_0x59829e-0x0;var _0x3bdb0e=_0x480b[_0x59829e];return _0x3bdb0e;};'use strict';var Sequelize=require(_0xb480('0x0'));module[_0xb480('0x1')]={'name':{'type':Sequelize[_0xb480('0x2')]},'description':{'type':Sequelize[_0xb480('0x2')]},'ticketType':{'type':Sequelize[_0xb480('0x3')](_0xb480('0x4'),'phonecall'),'defaultValue':_0xb480('0x4')},'moduleCreate':{'type':Sequelize[_0xb480('0x3')](_0xb480('0x5'),'nothing'),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file +var _0xa42d=['nothing','exports','STRING','ENUM','incident','phonecall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa42d,0x73));var _0xda42=function(_0xf09a0a,_0x433565){_0xf09a0a=_0xf09a0a-0x0;var _0x10e03f=_0xa42d[_0xf09a0a];return _0x10e03f;};'use strict';var Sequelize=require('sequelize');module[_0xda42('0x0')]={'name':{'type':Sequelize[_0xda42('0x1')]},'description':{'type':Sequelize[_0xda42('0x1')]},'ticketType':{'type':Sequelize[_0xda42('0x2')](_0xda42('0x3'),_0xda42('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0xda42('0x2')]('contact',_0xda42('0x5')),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index c280a6b..a1b4fa6 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 _0xd02c=['intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','where','VIRTUAL','merge','includeAll','findAll','catch','params','rawAttributes','include','options','find','create','body','findOne','Dynamics365Field','order','filter','getFields','getSubjects','getDescriptions','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','Dynamics365Configuration','type','key','keys','query'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xd02c,0x6c));var _0xcd02=function(_0x4b0ede,_0x1a337d){_0x4b0ede=_0x4b0ede-0x0;var _0x425a0f=_0xd02c[_0x4b0ede];return _0x425a0f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcd02('0x0'));var rp=require(_0xcd02('0x1'));var moment=require(_0xcd02('0x2'));var BPromise=require(_0xcd02('0x3'));var Mustache=require(_0xcd02('0x4'));var util=require('util');var path=require(_0xcd02('0x5'));var sox=require(_0xcd02('0x6'));var csv=require(_0xcd02('0x7'));var ejs=require(_0xcd02('0x8'));var fs=require('fs');var fs_extra=require(_0xcd02('0x9'));var _=require(_0xcd02('0xa'));var squel=require(_0xcd02('0xb'));var crypto=require('crypto');var jsforce=require(_0xcd02('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcd02('0x7'));var querystring=require(_0xcd02('0xd'));var Papa=require(_0xcd02('0xe'));var Redis=require(_0xcd02('0xf'));var authService=require(_0xcd02('0x10'));var qs=require(_0xcd02('0x11'));var as=require(_0xcd02('0x12'));var hardwareService=require(_0xcd02('0x13'));var logger=require(_0xcd02('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcd02('0x15'));var db=require(_0xcd02('0x16'))['db'];function respondWithStatusCode(_0xa5cd23,_0xded145){_0xded145=_0xded145||0xcc;return function(_0x27e677){if(_0x27e677){return _0xa5cd23[_0xcd02('0x17')](_0xded145);}return _0xa5cd23[_0xcd02('0x18')](_0xded145)[_0xcd02('0x19')]();};}function respondWithResult(_0x1a1a0b,_0x95839c){_0x95839c=_0x95839c||0xc8;return function(_0x449aad){if(_0x449aad){return _0x1a1a0b[_0xcd02('0x18')](_0x95839c)[_0xcd02('0x1a')](_0x449aad);}};}function respondWithFilteredResult(_0x58f341,_0xbfa870){return function(_0x11ec4){if(_0x11ec4){var _0x548787=typeof _0xbfa870['offset']===_0xcd02('0x1b')&&typeof _0xbfa870[_0xcd02('0x1c')]===_0xcd02('0x1b');var _0x3acceb=_0x11ec4['count'];var _0x2b6610=_0x548787?0x0:_0xbfa870[_0xcd02('0x1d')];var _0x37f770=_0x548787?_0x11ec4[_0xcd02('0x1e')]:_0xbfa870['offset']+_0xbfa870[_0xcd02('0x1c')];var _0x1a6dbc;if(_0x37f770>=_0x3acceb){_0x37f770=_0x3acceb;_0x1a6dbc=0xc8;}else{_0x1a6dbc=0xce;}_0x58f341[_0xcd02('0x18')](_0x1a6dbc);return _0x58f341[_0xcd02('0x1f')](_0xcd02('0x20'),_0x2b6610+'-'+_0x37f770+'/'+_0x3acceb)[_0xcd02('0x1a')](_0x11ec4);}return null;};}function patchUpdates(_0x44a6de){return function(_0x36599a){try{jsonpatch[_0xcd02('0x21')](_0x36599a,_0x44a6de,!![]);}catch(_0x4a9ff0){return BPromise[_0xcd02('0x22')](_0x4a9ff0);}return _0x36599a[_0xcd02('0x23')]();};}function saveUpdates(_0x4b843d,_0x14675c){return function(_0x13466c){if(_0x13466c){return _0x13466c[_0xcd02('0x24')](_0x4b843d)[_0xcd02('0x25')](function(_0x196e61){return _0x196e61;});}return null;};}function removeEntity(_0x5d1517,_0x5e0112){return function(_0xaaf162){if(_0xaaf162){return _0xaaf162['destroy']()[_0xcd02('0x25')](function(){_0x5d1517[_0xcd02('0x18')](0xcc)[_0xcd02('0x19')]();});}};}function handleEntityNotFound(_0xcfdee1,_0x48b44f){return function(_0xd99902){if(!_0xd99902){_0xcfdee1[_0xcd02('0x17')](0x194);}return _0xd99902;};}function handleError(_0x2fee89,_0x203a7c){_0x203a7c=_0x203a7c||0x1f4;return function(_0x1122ae){logger['error'](_0x1122ae[_0xcd02('0x26')]);if(_0x1122ae['name']){delete _0x1122ae[_0xcd02('0x27')];}_0x2fee89[_0xcd02('0x18')](_0x203a7c)[_0xcd02('0x28')](_0x1122ae);};}exports[_0xcd02('0x29')]=function(_0x429bbd,_0xe82616){var _0x12b8f0={},_0x4d792f={},_0x459408={'count':0x0,'rows':[]};var _0x38809=_[_0xcd02('0x2a')](db[_0xcd02('0x2b')]['rawAttributes'],function(_0x193a84){return{'name':_0x193a84['fieldName'],'type':_0x193a84[_0xcd02('0x2c')][_0xcd02('0x2d')]};});_0x4d792f['model']=_[_0xcd02('0x2a')](_0x38809,'name');_0x4d792f['query']=_[_0xcd02('0x2e')](_0x429bbd[_0xcd02('0x2f')]);_0x4d792f['filters']=_[_0xcd02('0x30')](_0x4d792f['model'],_0x4d792f[_0xcd02('0x2f')]);_0x12b8f0['attributes']=_[_0xcd02('0x30')](_0x4d792f[_0xcd02('0x31')],qs[_0xcd02('0x32')](_0x429bbd[_0xcd02('0x2f')][_0xcd02('0x32')]));_0x12b8f0[_0xcd02('0x33')]=_0x12b8f0[_0xcd02('0x33')][_0xcd02('0x34')]?_0x12b8f0[_0xcd02('0x33')]:_0x4d792f[_0xcd02('0x31')];if(!_0x429bbd['query'][_0xcd02('0x35')](_0xcd02('0x36'))){_0x12b8f0['limit']=qs[_0xcd02('0x1c')](_0x429bbd[_0xcd02('0x2f')][_0xcd02('0x1c')]);_0x12b8f0[_0xcd02('0x1d')]=qs[_0xcd02('0x1d')](_0x429bbd['query'][_0xcd02('0x1d')]);}_0x12b8f0['order']=qs['sort'](_0x429bbd['query'][_0xcd02('0x37')]);_0x12b8f0['where']=qs[_0xcd02('0x38')](_[_0xcd02('0x39')](_0x429bbd[_0xcd02('0x2f')],_0x4d792f['filters']),_0x38809);if(_0x429bbd['query']['filter']){_0x12b8f0[_0xcd02('0x3a')]=_['merge'](_0x12b8f0[_0xcd02('0x3a')],{'$or':_[_0xcd02('0x2a')](_0x38809,function(_0x3331a9){if(_0x3331a9[_0xcd02('0x2c')]!==_0xcd02('0x3b')){var _0x14f87f={};_0x14f87f[_0x3331a9[_0xcd02('0x27')]]={'$like':'%'+_0x429bbd['query']['filter']+'%'};return _0x14f87f;}})});}_0x12b8f0=_[_0xcd02('0x3c')]({},_0x12b8f0,_0x429bbd['options']);var _0x4fa11d={'where':_0x12b8f0[_0xcd02('0x3a')]};return db[_0xcd02('0x2b')]['count'](_0x4fa11d)[_0xcd02('0x25')](function(_0x575bc9){_0x459408[_0xcd02('0x1e')]=_0x575bc9;if(_0x429bbd[_0xcd02('0x2f')][_0xcd02('0x3d')]){_0x12b8f0['include']=[{'all':!![]}];}return db[_0xcd02('0x2b')][_0xcd02('0x3e')](_0x12b8f0);})[_0xcd02('0x25')](function(_0x2f1433){_0x459408['rows']=_0x2f1433;return _0x459408;})[_0xcd02('0x25')](respondWithFilteredResult(_0xe82616,_0x12b8f0))[_0xcd02('0x3f')](handleError(_0xe82616,null));};exports['show']=function(_0x270e27,_0x4dcf1c){var _0x44476e={'raw':![],'where':{'id':_0x270e27[_0xcd02('0x40')]['id']}},_0x3edd0c={};_0x3edd0c['model']=_[_0xcd02('0x2e')](db[_0xcd02('0x2b')][_0xcd02('0x41')]);_0x3edd0c[_0xcd02('0x2f')]=_[_0xcd02('0x2e')](_0x270e27['query']);_0x3edd0c[_0xcd02('0x38')]=_[_0xcd02('0x30')](_0x3edd0c[_0xcd02('0x31')],_0x3edd0c[_0xcd02('0x2f')]);_0x44476e['attributes']=_[_0xcd02('0x30')](_0x3edd0c['model'],qs[_0xcd02('0x32')](_0x270e27[_0xcd02('0x2f')][_0xcd02('0x32')]));_0x44476e[_0xcd02('0x33')]=_0x44476e[_0xcd02('0x33')][_0xcd02('0x34')]?_0x44476e[_0xcd02('0x33')]:_0x3edd0c[_0xcd02('0x31')];if(_0x270e27['query'][_0xcd02('0x3d')]){_0x44476e[_0xcd02('0x42')]=[{'all':!![]}];}_0x44476e=_[_0xcd02('0x3c')]({},_0x44476e,_0x270e27[_0xcd02('0x43')]);return db[_0xcd02('0x2b')][_0xcd02('0x44')](_0x44476e)[_0xcd02('0x25')](handleEntityNotFound(_0x4dcf1c,null))[_0xcd02('0x25')](respondWithResult(_0x4dcf1c,null))[_0xcd02('0x3f')](handleError(_0x4dcf1c,null));};exports[_0xcd02('0x45')]=function(_0x3c8886,_0x10cf11){return db[_0xcd02('0x2b')][_0xcd02('0x45')](_0x3c8886[_0xcd02('0x46')],{})[_0xcd02('0x25')](respondWithResult(_0x10cf11,0xc9))[_0xcd02('0x3f')](handleError(_0x10cf11,null));};exports[_0xcd02('0x24')]=function(_0x20c9fb,_0x141c7e){if(_0x20c9fb[_0xcd02('0x46')]['id']){delete _0x20c9fb[_0xcd02('0x46')]['id'];}return db[_0xcd02('0x2b')]['find']({'where':{'id':_0x20c9fb[_0xcd02('0x40')]['id']}})[_0xcd02('0x25')](handleEntityNotFound(_0x141c7e,null))[_0xcd02('0x25')](saveUpdates(_0x20c9fb[_0xcd02('0x46')],null))['then'](respondWithResult(_0x141c7e,null))['catch'](handleError(_0x141c7e,null));};exports['destroy']=function(_0x330159,_0x1b3def){return db[_0xcd02('0x2b')][_0xcd02('0x44')]({'where':{'id':_0x330159['params']['id']}})[_0xcd02('0x25')](handleEntityNotFound(_0x1b3def,null))['then'](removeEntity(_0x1b3def,null))[_0xcd02('0x3f')](handleError(_0x1b3def,null));};exports['getFields']=function(_0x3c49bd,_0x5e8213,_0x312e65){var _0x4ad22c={};var _0x367110={};var _0x52fe63;var _0x2b5d06;return db['Dynamics365Configuration'][_0xcd02('0x47')]({'where':{'id':_0x3c49bd[_0xcd02('0x40')]['id']}})[_0xcd02('0x25')](handleEntityNotFound(_0x5e8213,null))['then'](function(_0x146c0b){if(_0x146c0b){_0x52fe63=_0x146c0b;_0x367110[_0xcd02('0x31')]=_[_0xcd02('0x2e')](db[_0xcd02('0x48')][_0xcd02('0x41')]);_0x367110[_0xcd02('0x2f')]=_[_0xcd02('0x2e')](_0x3c49bd[_0xcd02('0x2f')]);_0x367110['filters']=_[_0xcd02('0x30')](_0x367110[_0xcd02('0x31')],_0x367110[_0xcd02('0x2f')]);_0x4ad22c[_0xcd02('0x33')]=_[_0xcd02('0x30')](_0x367110['model'],qs[_0xcd02('0x32')](_0x3c49bd['query'][_0xcd02('0x32')]));_0x4ad22c[_0xcd02('0x33')]=_0x4ad22c[_0xcd02('0x33')][_0xcd02('0x34')]?_0x4ad22c['attributes']:_0x367110[_0xcd02('0x31')];_0x4ad22c[_0xcd02('0x49')]=qs[_0xcd02('0x37')](_0x3c49bd[_0xcd02('0x2f')][_0xcd02('0x37')]);_0x4ad22c['where']=qs[_0xcd02('0x38')](_[_0xcd02('0x39')](_0x3c49bd[_0xcd02('0x2f')],_0x367110[_0xcd02('0x38')]));if(_0x3c49bd[_0xcd02('0x2f')]['filter']){_0x4ad22c[_0xcd02('0x3a')]=_[_0xcd02('0x3c')](_0x4ad22c[_0xcd02('0x3a')],{'$or':_[_0xcd02('0x2a')](_0x4ad22c[_0xcd02('0x33')],function(_0x4a504d){var _0x536bb0={};_0x536bb0[_0x4a504d]={'$like':'%'+_0x3c49bd['query'][_0xcd02('0x4a')]+'%'};return _0x536bb0;})});}_0x4ad22c=_['merge']({},_0x4ad22c,_0x3c49bd[_0xcd02('0x43')]);return _0x52fe63[_0xcd02('0x4b')](_0x4ad22c);}})[_0xcd02('0x25')](function(_0x2e7725){if(_0x2e7725){_0x2b5d06=_0x2e7725[_0xcd02('0x34')];if(!_0x3c49bd[_0xcd02('0x2f')]['hasOwnProperty']('nolimit')){_0x4ad22c[_0xcd02('0x1c')]=qs[_0xcd02('0x1c')](_0x3c49bd['query'][_0xcd02('0x1c')]);_0x4ad22c[_0xcd02('0x1d')]=qs[_0xcd02('0x1d')](_0x3c49bd[_0xcd02('0x2f')][_0xcd02('0x1d')]);}return _0x52fe63[_0xcd02('0x4b')](_0x4ad22c);}})[_0xcd02('0x25')](function(_0x4ec6e5){if(_0x4ec6e5){return _0x4ec6e5?{'count':_0x2b5d06,'rows':_0x4ec6e5}:null;}})[_0xcd02('0x25')](respondWithResult(_0x5e8213,null))[_0xcd02('0x3f')](handleError(_0x5e8213,null));};exports[_0xcd02('0x4c')]=function(_0x2e66e8,_0x2c05ee,_0x1bdbbb){var _0x51dbca={};var _0x4a713e={};var _0x234d4e;var _0x4ff03d;return db[_0xcd02('0x2b')][_0xcd02('0x47')]({'where':{'id':_0x2e66e8[_0xcd02('0x40')]['id']}})[_0xcd02('0x25')](handleEntityNotFound(_0x2c05ee,null))['then'](function(_0x1ac7de){if(_0x1ac7de){_0x234d4e=_0x1ac7de;_0x4a713e['model']=_[_0xcd02('0x2e')](db[_0xcd02('0x48')][_0xcd02('0x41')]);_0x4a713e[_0xcd02('0x2f')]=_['keys'](_0x2e66e8[_0xcd02('0x2f')]);_0x4a713e[_0xcd02('0x38')]=_[_0xcd02('0x30')](_0x4a713e[_0xcd02('0x31')],_0x4a713e[_0xcd02('0x2f')]);_0x51dbca[_0xcd02('0x33')]=_[_0xcd02('0x30')](_0x4a713e[_0xcd02('0x31')],qs['fields'](_0x2e66e8[_0xcd02('0x2f')][_0xcd02('0x32')]));_0x51dbca[_0xcd02('0x33')]=_0x51dbca[_0xcd02('0x33')]['length']?_0x51dbca[_0xcd02('0x33')]:_0x4a713e[_0xcd02('0x31')];_0x51dbca[_0xcd02('0x49')]=qs[_0xcd02('0x37')](_0x2e66e8[_0xcd02('0x2f')][_0xcd02('0x37')]);_0x51dbca['where']=qs[_0xcd02('0x38')](_[_0xcd02('0x39')](_0x2e66e8[_0xcd02('0x2f')],_0x4a713e[_0xcd02('0x38')]));if(_0x2e66e8[_0xcd02('0x2f')]['filter']){_0x51dbca[_0xcd02('0x3a')]=_['merge'](_0x51dbca['where'],{'$or':_[_0xcd02('0x2a')](_0x51dbca[_0xcd02('0x33')],function(_0x4d721b){var _0x11cec3={};_0x11cec3[_0x4d721b]={'$like':'%'+_0x2e66e8[_0xcd02('0x2f')][_0xcd02('0x4a')]+'%'};return _0x11cec3;})});}_0x51dbca=_[_0xcd02('0x3c')]({},_0x51dbca,_0x2e66e8['options']);return _0x234d4e[_0xcd02('0x4c')](_0x51dbca);}})[_0xcd02('0x25')](function(_0x2feb2f){if(_0x2feb2f){_0x4ff03d=_0x2feb2f['length'];if(!_0x2e66e8[_0xcd02('0x2f')][_0xcd02('0x35')]('nolimit')){_0x51dbca['limit']=qs['limit'](_0x2e66e8['query'][_0xcd02('0x1c')]);_0x51dbca[_0xcd02('0x1d')]=qs[_0xcd02('0x1d')](_0x2e66e8[_0xcd02('0x2f')][_0xcd02('0x1d')]);}return _0x234d4e[_0xcd02('0x4c')](_0x51dbca);}})[_0xcd02('0x25')](function(_0x38e7b0){if(_0x38e7b0){return _0x38e7b0?{'count':_0x4ff03d,'rows':_0x38e7b0}:null;}})[_0xcd02('0x25')](respondWithResult(_0x2c05ee,null))[_0xcd02('0x3f')](handleError(_0x2c05ee,null));};exports[_0xcd02('0x4d')]=function(_0x339155,_0x4852da,_0x136c34){var _0x44479e={};var _0x45c34f={};var _0x1ffa80;var _0x1afb01;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x339155[_0xcd02('0x40')]['id']}})[_0xcd02('0x25')](handleEntityNotFound(_0x4852da,null))[_0xcd02('0x25')](function(_0x431173){if(_0x431173){_0x1ffa80=_0x431173;_0x45c34f[_0xcd02('0x31')]=_[_0xcd02('0x2e')](db[_0xcd02('0x48')][_0xcd02('0x41')]);_0x45c34f[_0xcd02('0x2f')]=_[_0xcd02('0x2e')](_0x339155['query']);_0x45c34f[_0xcd02('0x38')]=_['intersection'](_0x45c34f[_0xcd02('0x31')],_0x45c34f[_0xcd02('0x2f')]);_0x44479e['attributes']=_[_0xcd02('0x30')](_0x45c34f[_0xcd02('0x31')],qs[_0xcd02('0x32')](_0x339155[_0xcd02('0x2f')][_0xcd02('0x32')]));_0x44479e[_0xcd02('0x33')]=_0x44479e[_0xcd02('0x33')]['length']?_0x44479e[_0xcd02('0x33')]:_0x45c34f[_0xcd02('0x31')];_0x44479e[_0xcd02('0x49')]=qs[_0xcd02('0x37')](_0x339155['query'][_0xcd02('0x37')]);_0x44479e[_0xcd02('0x3a')]=qs['filters'](_['pick'](_0x339155['query'],_0x45c34f[_0xcd02('0x38')]));if(_0x339155['query'][_0xcd02('0x4a')]){_0x44479e['where']=_['merge'](_0x44479e[_0xcd02('0x3a')],{'$or':_[_0xcd02('0x2a')](_0x44479e[_0xcd02('0x33')],function(_0x278ba1){var _0x1ceb50={};_0x1ceb50[_0x278ba1]={'$like':'%'+_0x339155['query'][_0xcd02('0x4a')]+'%'};return _0x1ceb50;})});}_0x44479e=_[_0xcd02('0x3c')]({},_0x44479e,_0x339155[_0xcd02('0x43')]);return _0x1ffa80[_0xcd02('0x4d')](_0x44479e);}})['then'](function(_0x3f313e){if(_0x3f313e){_0x1afb01=_0x3f313e[_0xcd02('0x34')];if(!_0x339155['query'][_0xcd02('0x35')](_0xcd02('0x36'))){_0x44479e['limit']=qs[_0xcd02('0x1c')](_0x339155[_0xcd02('0x2f')]['limit']);_0x44479e[_0xcd02('0x1d')]=qs[_0xcd02('0x1d')](_0x339155[_0xcd02('0x2f')][_0xcd02('0x1d')]);}return _0x1ffa80[_0xcd02('0x4d')](_0x44479e);}})[_0xcd02('0x25')](function(_0x41d684){if(_0x41d684){return _0x41d684?{'count':_0x1afb01,'rows':_0x41d684}:null;}})[_0xcd02('0x25')](respondWithResult(_0x4852da,null))[_0xcd02('0x3f')](handleError(_0x4852da,null));}; \ No newline at end of file +var _0xcf38=['getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','Dynamics365Configuration','rawAttributes','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','type','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','body','find','findOne','Dynamics365Field','order','getFields'];(function(_0x5e9976,_0xcd4751){var _0x1d3895=function(_0x5c2f0f){while(--_0x5c2f0f){_0x5e9976['push'](_0x5e9976['shift']());}};_0x1d3895(++_0xcd4751);}(_0xcf38,0xa4));var _0x8cf3=function(_0xf64789,_0x55bdfa){_0xf64789=_0xf64789-0x0;var _0x3622f1=_0xcf38[_0xf64789];return _0x3622f1;};'use strict';var emlformat=require(_0x8cf3('0x0'));var rimraf=require(_0x8cf3('0x1'));var zipdir=require(_0x8cf3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8cf3('0x3'));var moment=require('moment');var BPromise=require(_0x8cf3('0x4'));var Mustache=require(_0x8cf3('0x5'));var util=require('util');var path=require(_0x8cf3('0x6'));var sox=require(_0x8cf3('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8cf3('0x8'));var _=require(_0x8cf3('0x9'));var squel=require(_0x8cf3('0xa'));var crypto=require(_0x8cf3('0xb'));var jsforce=require(_0x8cf3('0xc'));var deskjs=require(_0x8cf3('0xd'));var toCsv=require(_0x8cf3('0xe'));var querystring=require(_0x8cf3('0xf'));var Papa=require(_0x8cf3('0x10'));var Redis=require(_0x8cf3('0x11'));var authService=require(_0x8cf3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8cf3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8cf3('0x14'));var utils=require(_0x8cf3('0x15'));var config=require(_0x8cf3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8cf3('0x17'))['db'];function respondWithStatusCode(_0x3a21cf,_0x4dbdb6){_0x4dbdb6=_0x4dbdb6||0xcc;return function(_0x4af875){if(_0x4af875){return _0x3a21cf[_0x8cf3('0x18')](_0x4dbdb6);}return _0x3a21cf[_0x8cf3('0x19')](_0x4dbdb6)[_0x8cf3('0x1a')]();};}function respondWithResult(_0x1927ec,_0x15706f){_0x15706f=_0x15706f||0xc8;return function(_0x2de2d8){if(_0x2de2d8){return _0x1927ec[_0x8cf3('0x19')](_0x15706f)['json'](_0x2de2d8);}};}function respondWithFilteredResult(_0xa19a33,_0x334205){return function(_0xccf16d){if(_0xccf16d){var _0x2df0e1=typeof _0x334205[_0x8cf3('0x1b')]===_0x8cf3('0x1c')&&typeof _0x334205[_0x8cf3('0x1d')]==='undefined';var _0x235db2=_0xccf16d[_0x8cf3('0x1e')];var _0x1a73ed=_0x2df0e1?0x0:_0x334205[_0x8cf3('0x1b')];var _0x48f61d=_0x2df0e1?_0xccf16d[_0x8cf3('0x1e')]:_0x334205['offset']+_0x334205[_0x8cf3('0x1d')];var _0x3bfd2c;if(_0x48f61d>=_0x235db2){_0x48f61d=_0x235db2;_0x3bfd2c=0xc8;}else{_0x3bfd2c=0xce;}_0xa19a33['status'](_0x3bfd2c);return _0xa19a33[_0x8cf3('0x1f')](_0x8cf3('0x20'),_0x1a73ed+'-'+_0x48f61d+'/'+_0x235db2)[_0x8cf3('0x21')](_0xccf16d);}return null;};}function patchUpdates(_0x4bbcd3){return function(_0x29cb4f){try{jsonpatch[_0x8cf3('0x22')](_0x29cb4f,_0x4bbcd3,!![]);}catch(_0x319b23){return BPromise[_0x8cf3('0x23')](_0x319b23);}return _0x29cb4f[_0x8cf3('0x24')]();};}function saveUpdates(_0x242414,_0x492c55){return function(_0x3c20bd){if(_0x3c20bd){return _0x3c20bd[_0x8cf3('0x25')](_0x242414)[_0x8cf3('0x26')](function(_0x35260e){return _0x35260e;});}return null;};}function removeEntity(_0x18d707,_0x351e77){return function(_0x466df3){if(_0x466df3){return _0x466df3[_0x8cf3('0x27')]()[_0x8cf3('0x26')](function(){_0x18d707[_0x8cf3('0x19')](0xcc)[_0x8cf3('0x1a')]();});}};}function handleEntityNotFound(_0x1df42e,_0x554d5a){return function(_0x1c1faa){if(!_0x1c1faa){_0x1df42e[_0x8cf3('0x18')](0x194);}return _0x1c1faa;};}function handleError(_0x51c31d,_0x71b80){_0x71b80=_0x71b80||0x1f4;return function(_0x1201d7){logger[_0x8cf3('0x28')](_0x1201d7[_0x8cf3('0x29')]);if(_0x1201d7[_0x8cf3('0x2a')]){delete _0x1201d7[_0x8cf3('0x2a')];}_0x51c31d[_0x8cf3('0x19')](_0x71b80)[_0x8cf3('0x2b')](_0x1201d7);};}exports[_0x8cf3('0x2c')]=function(_0x5aaa50,_0x2c4cd7){var _0xee02a0={},_0x408fa7={},_0x58195f={'count':0x0,'rows':[]};var _0x2cbefa=_['map'](db[_0x8cf3('0x2d')][_0x8cf3('0x2e')],function(_0x5626f1){return{'name':_0x5626f1['fieldName'],'type':_0x5626f1['type']['key']};});_0x408fa7[_0x8cf3('0x2f')]=_['map'](_0x2cbefa,'name');_0x408fa7[_0x8cf3('0x30')]=_['keys'](_0x5aaa50[_0x8cf3('0x30')]);_0x408fa7['filters']=_['intersection'](_0x408fa7[_0x8cf3('0x2f')],_0x408fa7['query']);_0xee02a0[_0x8cf3('0x31')]=_[_0x8cf3('0x32')](_0x408fa7[_0x8cf3('0x2f')],qs['fields'](_0x5aaa50[_0x8cf3('0x30')][_0x8cf3('0x33')]));_0xee02a0[_0x8cf3('0x31')]=_0xee02a0['attributes'][_0x8cf3('0x34')]?_0xee02a0['attributes']:_0x408fa7['model'];if(!_0x5aaa50['query'][_0x8cf3('0x35')](_0x8cf3('0x36'))){_0xee02a0[_0x8cf3('0x1d')]=qs[_0x8cf3('0x1d')](_0x5aaa50[_0x8cf3('0x30')]['limit']);_0xee02a0['offset']=qs['offset'](_0x5aaa50[_0x8cf3('0x30')][_0x8cf3('0x1b')]);}_0xee02a0['order']=qs[_0x8cf3('0x37')](_0x5aaa50[_0x8cf3('0x30')][_0x8cf3('0x37')]);_0xee02a0[_0x8cf3('0x38')]=qs[_0x8cf3('0x39')](_[_0x8cf3('0x3a')](_0x5aaa50[_0x8cf3('0x30')],_0x408fa7['filters']),_0x2cbefa);if(_0x5aaa50[_0x8cf3('0x30')][_0x8cf3('0x3b')]){_0xee02a0[_0x8cf3('0x38')]=_['merge'](_0xee02a0['where'],{'$or':_[_0x8cf3('0x3c')](_0x2cbefa,function(_0x364c89){if(_0x364c89[_0x8cf3('0x3d')]!==_0x8cf3('0x3e')){var _0x458bdb={};_0x458bdb[_0x364c89[_0x8cf3('0x2a')]]={'$like':'%'+_0x5aaa50[_0x8cf3('0x30')][_0x8cf3('0x3b')]+'%'};return _0x458bdb;}})});}_0xee02a0=_[_0x8cf3('0x3f')]({},_0xee02a0,_0x5aaa50['options']);var _0x27c43f={'where':_0xee02a0[_0x8cf3('0x38')]};return db[_0x8cf3('0x2d')][_0x8cf3('0x1e')](_0x27c43f)['then'](function(_0x5462c9){_0x58195f[_0x8cf3('0x1e')]=_0x5462c9;if(_0x5aaa50[_0x8cf3('0x30')]['includeAll']){_0xee02a0[_0x8cf3('0x40')]=[{'all':!![]}];}return db[_0x8cf3('0x2d')][_0x8cf3('0x41')](_0xee02a0);})[_0x8cf3('0x26')](function(_0x11c00c){_0x58195f[_0x8cf3('0x42')]=_0x11c00c;return _0x58195f;})[_0x8cf3('0x26')](respondWithFilteredResult(_0x2c4cd7,_0xee02a0))[_0x8cf3('0x43')](handleError(_0x2c4cd7,null));};exports[_0x8cf3('0x44')]=function(_0x435a56,_0x5d9966){var _0x19dc1f={'raw':![],'where':{'id':_0x435a56[_0x8cf3('0x45')]['id']}},_0x26329c={};_0x26329c[_0x8cf3('0x2f')]=_['keys'](db[_0x8cf3('0x2d')][_0x8cf3('0x2e')]);_0x26329c[_0x8cf3('0x30')]=_[_0x8cf3('0x46')](_0x435a56[_0x8cf3('0x30')]);_0x26329c[_0x8cf3('0x39')]=_['intersection'](_0x26329c[_0x8cf3('0x2f')],_0x26329c[_0x8cf3('0x30')]);_0x19dc1f[_0x8cf3('0x31')]=_[_0x8cf3('0x32')](_0x26329c[_0x8cf3('0x2f')],qs[_0x8cf3('0x33')](_0x435a56['query'][_0x8cf3('0x33')]));_0x19dc1f[_0x8cf3('0x31')]=_0x19dc1f[_0x8cf3('0x31')][_0x8cf3('0x34')]?_0x19dc1f['attributes']:_0x26329c['model'];if(_0x435a56[_0x8cf3('0x30')][_0x8cf3('0x47')]){_0x19dc1f[_0x8cf3('0x40')]=[{'all':!![]}];}_0x19dc1f=_['merge']({},_0x19dc1f,_0x435a56[_0x8cf3('0x48')]);return db['Dynamics365Configuration']['find'](_0x19dc1f)['then'](handleEntityNotFound(_0x5d9966,null))['then'](respondWithResult(_0x5d9966,null))[_0x8cf3('0x43')](handleError(_0x5d9966,null));};exports['create']=function(_0x137f08,_0xf39a41){return db[_0x8cf3('0x2d')]['create'](_0x137f08['body'],{})[_0x8cf3('0x26')](respondWithResult(_0xf39a41,0xc9))['catch'](handleError(_0xf39a41,null));};exports['update']=function(_0x46f510,_0x33eb5e){if(_0x46f510[_0x8cf3('0x49')]['id']){delete _0x46f510[_0x8cf3('0x49')]['id'];}return db[_0x8cf3('0x2d')]['find']({'where':{'id':_0x46f510[_0x8cf3('0x45')]['id']}})[_0x8cf3('0x26')](handleEntityNotFound(_0x33eb5e,null))[_0x8cf3('0x26')](saveUpdates(_0x46f510[_0x8cf3('0x49')],null))[_0x8cf3('0x26')](respondWithResult(_0x33eb5e,null))['catch'](handleError(_0x33eb5e,null));};exports[_0x8cf3('0x27')]=function(_0x1964ae,_0x527105){return db[_0x8cf3('0x2d')][_0x8cf3('0x4a')]({'where':{'id':_0x1964ae[_0x8cf3('0x45')]['id']}})[_0x8cf3('0x26')](handleEntityNotFound(_0x527105,null))['then'](removeEntity(_0x527105,null))[_0x8cf3('0x43')](handleError(_0x527105,null));};exports['getFields']=function(_0x24e18f,_0xdf60c1,_0x2dbba3){var _0x52068e={};var _0x10e358={};var _0x360d78;var _0x337b75;return db[_0x8cf3('0x2d')][_0x8cf3('0x4b')]({'where':{'id':_0x24e18f[_0x8cf3('0x45')]['id']}})[_0x8cf3('0x26')](handleEntityNotFound(_0xdf60c1,null))['then'](function(_0xbb202b){if(_0xbb202b){_0x360d78=_0xbb202b;_0x10e358[_0x8cf3('0x2f')]=_['keys'](db[_0x8cf3('0x4c')][_0x8cf3('0x2e')]);_0x10e358[_0x8cf3('0x30')]=_[_0x8cf3('0x46')](_0x24e18f[_0x8cf3('0x30')]);_0x10e358['filters']=_[_0x8cf3('0x32')](_0x10e358[_0x8cf3('0x2f')],_0x10e358[_0x8cf3('0x30')]);_0x52068e[_0x8cf3('0x31')]=_[_0x8cf3('0x32')](_0x10e358['model'],qs[_0x8cf3('0x33')](_0x24e18f[_0x8cf3('0x30')][_0x8cf3('0x33')]));_0x52068e[_0x8cf3('0x31')]=_0x52068e[_0x8cf3('0x31')]['length']?_0x52068e[_0x8cf3('0x31')]:_0x10e358[_0x8cf3('0x2f')];_0x52068e[_0x8cf3('0x4d')]=qs[_0x8cf3('0x37')](_0x24e18f[_0x8cf3('0x30')][_0x8cf3('0x37')]);_0x52068e[_0x8cf3('0x38')]=qs[_0x8cf3('0x39')](_[_0x8cf3('0x3a')](_0x24e18f[_0x8cf3('0x30')],_0x10e358[_0x8cf3('0x39')]));if(_0x24e18f['query'][_0x8cf3('0x3b')]){_0x52068e[_0x8cf3('0x38')]=_[_0x8cf3('0x3f')](_0x52068e[_0x8cf3('0x38')],{'$or':_[_0x8cf3('0x3c')](_0x52068e[_0x8cf3('0x31')],function(_0x2f1eb0){var _0x3eecb2={};_0x3eecb2[_0x2f1eb0]={'$like':'%'+_0x24e18f[_0x8cf3('0x30')][_0x8cf3('0x3b')]+'%'};return _0x3eecb2;})});}_0x52068e=_[_0x8cf3('0x3f')]({},_0x52068e,_0x24e18f[_0x8cf3('0x48')]);return _0x360d78[_0x8cf3('0x4e')](_0x52068e);}})[_0x8cf3('0x26')](function(_0x40cdc4){if(_0x40cdc4){_0x337b75=_0x40cdc4[_0x8cf3('0x34')];if(!_0x24e18f['query'][_0x8cf3('0x35')]('nolimit')){_0x52068e['limit']=qs[_0x8cf3('0x1d')](_0x24e18f['query'][_0x8cf3('0x1d')]);_0x52068e[_0x8cf3('0x1b')]=qs[_0x8cf3('0x1b')](_0x24e18f[_0x8cf3('0x30')][_0x8cf3('0x1b')]);}return _0x360d78[_0x8cf3('0x4e')](_0x52068e);}})['then'](function(_0xfc9d91){if(_0xfc9d91){return _0xfc9d91?{'count':_0x337b75,'rows':_0xfc9d91}:null;}})['then'](respondWithResult(_0xdf60c1,null))[_0x8cf3('0x43')](handleError(_0xdf60c1,null));};exports['getSubjects']=function(_0x4fb837,_0x1ef415,_0x4d5c6b){var _0x4d6293={};var _0x57862f={};var _0x4a2a73;var _0x344273;return db['Dynamics365Configuration'][_0x8cf3('0x4b')]({'where':{'id':_0x4fb837[_0x8cf3('0x45')]['id']}})[_0x8cf3('0x26')](handleEntityNotFound(_0x1ef415,null))['then'](function(_0x548136){if(_0x548136){_0x4a2a73=_0x548136;_0x57862f[_0x8cf3('0x2f')]=_[_0x8cf3('0x46')](db[_0x8cf3('0x4c')]['rawAttributes']);_0x57862f[_0x8cf3('0x30')]=_[_0x8cf3('0x46')](_0x4fb837[_0x8cf3('0x30')]);_0x57862f[_0x8cf3('0x39')]=_['intersection'](_0x57862f[_0x8cf3('0x2f')],_0x57862f[_0x8cf3('0x30')]);_0x4d6293[_0x8cf3('0x31')]=_[_0x8cf3('0x32')](_0x57862f['model'],qs[_0x8cf3('0x33')](_0x4fb837[_0x8cf3('0x30')][_0x8cf3('0x33')]));_0x4d6293[_0x8cf3('0x31')]=_0x4d6293['attributes'][_0x8cf3('0x34')]?_0x4d6293[_0x8cf3('0x31')]:_0x57862f[_0x8cf3('0x2f')];_0x4d6293[_0x8cf3('0x4d')]=qs[_0x8cf3('0x37')](_0x4fb837[_0x8cf3('0x30')][_0x8cf3('0x37')]);_0x4d6293[_0x8cf3('0x38')]=qs[_0x8cf3('0x39')](_[_0x8cf3('0x3a')](_0x4fb837['query'],_0x57862f[_0x8cf3('0x39')]));if(_0x4fb837[_0x8cf3('0x30')]['filter']){_0x4d6293[_0x8cf3('0x38')]=_[_0x8cf3('0x3f')](_0x4d6293[_0x8cf3('0x38')],{'$or':_[_0x8cf3('0x3c')](_0x4d6293[_0x8cf3('0x31')],function(_0x4393f4){var _0x451d12={};_0x451d12[_0x4393f4]={'$like':'%'+_0x4fb837[_0x8cf3('0x30')][_0x8cf3('0x3b')]+'%'};return _0x451d12;})});}_0x4d6293=_[_0x8cf3('0x3f')]({},_0x4d6293,_0x4fb837['options']);return _0x4a2a73[_0x8cf3('0x4f')](_0x4d6293);}})[_0x8cf3('0x26')](function(_0x29e7b3){if(_0x29e7b3){_0x344273=_0x29e7b3[_0x8cf3('0x34')];if(!_0x4fb837['query'][_0x8cf3('0x35')](_0x8cf3('0x36'))){_0x4d6293[_0x8cf3('0x1d')]=qs[_0x8cf3('0x1d')](_0x4fb837[_0x8cf3('0x30')][_0x8cf3('0x1d')]);_0x4d6293[_0x8cf3('0x1b')]=qs[_0x8cf3('0x1b')](_0x4fb837[_0x8cf3('0x30')]['offset']);}return _0x4a2a73[_0x8cf3('0x4f')](_0x4d6293);}})['then'](function(_0x7b177){if(_0x7b177){return _0x7b177?{'count':_0x344273,'rows':_0x7b177}:null;}})['then'](respondWithResult(_0x1ef415,null))[_0x8cf3('0x43')](handleError(_0x1ef415,null));};exports[_0x8cf3('0x50')]=function(_0x291a13,_0x3ef3a4,_0x180b83){var _0x5a4249={};var _0x3a6e40={};var _0x29a8e7;var _0x35487b;return db[_0x8cf3('0x2d')][_0x8cf3('0x4b')]({'where':{'id':_0x291a13['params']['id']}})[_0x8cf3('0x26')](handleEntityNotFound(_0x3ef3a4,null))[_0x8cf3('0x26')](function(_0x24682a){if(_0x24682a){_0x29a8e7=_0x24682a;_0x3a6e40['model']=_['keys'](db[_0x8cf3('0x4c')][_0x8cf3('0x2e')]);_0x3a6e40[_0x8cf3('0x30')]=_[_0x8cf3('0x46')](_0x291a13[_0x8cf3('0x30')]);_0x3a6e40[_0x8cf3('0x39')]=_[_0x8cf3('0x32')](_0x3a6e40['model'],_0x3a6e40[_0x8cf3('0x30')]);_0x5a4249[_0x8cf3('0x31')]=_[_0x8cf3('0x32')](_0x3a6e40['model'],qs[_0x8cf3('0x33')](_0x291a13[_0x8cf3('0x30')][_0x8cf3('0x33')]));_0x5a4249['attributes']=_0x5a4249[_0x8cf3('0x31')][_0x8cf3('0x34')]?_0x5a4249['attributes']:_0x3a6e40['model'];_0x5a4249[_0x8cf3('0x4d')]=qs[_0x8cf3('0x37')](_0x291a13['query'][_0x8cf3('0x37')]);_0x5a4249[_0x8cf3('0x38')]=qs[_0x8cf3('0x39')](_[_0x8cf3('0x3a')](_0x291a13['query'],_0x3a6e40[_0x8cf3('0x39')]));if(_0x291a13[_0x8cf3('0x30')][_0x8cf3('0x3b')]){_0x5a4249[_0x8cf3('0x38')]=_[_0x8cf3('0x3f')](_0x5a4249['where'],{'$or':_[_0x8cf3('0x3c')](_0x5a4249[_0x8cf3('0x31')],function(_0x4bd4c1){var _0x25013a={};_0x25013a[_0x4bd4c1]={'$like':'%'+_0x291a13['query'][_0x8cf3('0x3b')]+'%'};return _0x25013a;})});}_0x5a4249=_[_0x8cf3('0x3f')]({},_0x5a4249,_0x291a13[_0x8cf3('0x48')]);return _0x29a8e7[_0x8cf3('0x50')](_0x5a4249);}})[_0x8cf3('0x26')](function(_0x4ffc51){if(_0x4ffc51){_0x35487b=_0x4ffc51[_0x8cf3('0x34')];if(!_0x291a13[_0x8cf3('0x30')][_0x8cf3('0x35')]('nolimit')){_0x5a4249[_0x8cf3('0x1d')]=qs['limit'](_0x291a13[_0x8cf3('0x30')]['limit']);_0x5a4249[_0x8cf3('0x1b')]=qs[_0x8cf3('0x1b')](_0x291a13[_0x8cf3('0x30')][_0x8cf3('0x1b')]);}return _0x29a8e7[_0x8cf3('0x50')](_0x5a4249);}})[_0x8cf3('0x26')](function(_0x26947d){if(_0x26947d){return _0x26947d?{'count':_0x35487b,'rows':_0x26947d}:null;}})['then'](respondWithResult(_0x3ef3a4,null))[_0x8cf3('0x43')](handleError(_0x3ef3a4,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 64971fd..43119fc 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 _0xb4e6=['path','rimraf','./intDynamics365Configuration.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1ebdc3,_0x8bd510){var _0x383b9e=function(_0x51dbb4){while(--_0x51dbb4){_0x1ebdc3['push'](_0x1ebdc3['shift']());}};_0x383b9e(++_0x8bd510);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x1d426f,_0x37e919){_0x1d426f=_0x1d426f-0x0;var _0x17f71a=_0xb4e6[_0x1d426f];return _0x17f71a;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x51c87d,_0x1bba46){var _0x3f31d2=function(_0x59f2ea){while(--_0x59f2ea){_0x51c87d['push'](_0x51c87d['shift']());}};_0x3f31d2(++_0x1bba46);}(_0x5b02,0xe9));var _0x25b0=function(_0x41094e,_0x17a6f8){_0x41094e=_0x41094e-0x0;var _0x1dbb7f=_0x5b02[_0x41094e];return _0x1dbb7f;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'int_dynamics365_configurations','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 5c51831..86c95da 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 _0xc9d3=['request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x3e3d12,_0x5d8c29){var _0x2685a8=function(_0x10943b){while(--_0x10943b){_0x3e3d12['push'](_0x3e3d12['shift']());}};_0x2685a8(++_0x5d8c29);}(_0xc9d3,0xf7));var _0x3c9d=function(_0x295ccd,_0x365b70){_0x295ccd=_0x295ccd-0x0;var _0x59c4a5=_0xc9d3[_0x295ccd];return _0x59c4a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c9d('0x0'));var BPromise=require('bluebird');var rs=require(_0x3c9d('0x1'));var fs=require('fs');var Redis=require(_0x3c9d('0x2'));var db=require(_0x3c9d('0x3'))['db'];var utils=require(_0x3c9d('0x4'));var logger=require(_0x3c9d('0x5'))(_0x3c9d('0x6'));var config=require('../../config/environment');var jayson=require(_0x3c9d('0x7'));var client=jayson[_0x3c9d('0x8')][_0x3c9d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f8749,_0x854bd9,_0x16b87c){return new BPromise(function(_0x30f3e5,_0x343fd2){return client[_0x3c9d('0xa')](_0x2f8749,_0x16b87c)['then'](function(_0x4dd0b7){logger[_0x3c9d('0xb')](_0x3c9d('0xc'),_0x854bd9,_0x3c9d('0xd'));logger[_0x3c9d('0xe')](_0x3c9d('0xf'),_0x854bd9,'request\x20sent',JSON[_0x3c9d('0x10')](_0x4dd0b7));if(_0x4dd0b7['error']){if(_0x4dd0b7[_0x3c9d('0x11')]['code']===0x1f4){logger[_0x3c9d('0x11')](_0x3c9d('0xc'),_0x854bd9,_0x4dd0b7[_0x3c9d('0x11')][_0x3c9d('0x12')]);return _0x343fd2(_0x4dd0b7[_0x3c9d('0x11')][_0x3c9d('0x12')]);}logger[_0x3c9d('0x11')](_0x3c9d('0xc'),_0x854bd9,_0x4dd0b7['error']['message']);return _0x30f3e5(_0x4dd0b7[_0x3c9d('0x11')][_0x3c9d('0x12')]);}else{logger[_0x3c9d('0xb')](_0x3c9d('0xc'),_0x854bd9,_0x3c9d('0xd'));_0x30f3e5(_0x4dd0b7[_0x3c9d('0x13')][_0x3c9d('0x12')]);}})['catch'](function(_0x4ea4ef){logger['error'](_0x3c9d('0xc'),_0x854bd9,_0x4ea4ef);_0x343fd2(_0x4ea4ef);});});} \ No newline at end of file +var _0xf1fa=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x21184a,_0x349c1c){var _0x1bac3f=function(_0x2020d0){while(--_0x2020d0){_0x21184a['push'](_0x21184a['shift']());}};_0x1bac3f(++_0x349c1c);}(_0xf1fa,0x102));var _0xaf1f=function(_0x4782ee,_0x40291d){_0x4782ee=_0x4782ee-0x0;var _0x45a1f3=_0xf1fa[_0x4782ee];return _0x45a1f3;};'use strict';var _=require(_0xaf1f('0x0'));var util=require(_0xaf1f('0x1'));var moment=require(_0xaf1f('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf1f('0x3'));var fs=require('fs');var Redis=require(_0xaf1f('0x4'));var db=require(_0xaf1f('0x5'))['db'];var utils=require(_0xaf1f('0x6'));var logger=require(_0xaf1f('0x7'))(_0xaf1f('0x8'));var config=require(_0xaf1f('0x9'));var jayson=require(_0xaf1f('0xa'));var client=jayson['client'][_0xaf1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23512a,_0x506ca6,_0x2e3a0a){return new BPromise(function(_0x4938e6,_0xbeb859){return client[_0xaf1f('0xc')](_0x23512a,_0x2e3a0a)['then'](function(_0x1a0823){logger[_0xaf1f('0xd')](_0xaf1f('0xe'),_0x506ca6,_0xaf1f('0xf'));logger[_0xaf1f('0x10')](_0xaf1f('0x11'),_0x506ca6,'request\x20sent',JSON['stringify'](_0x1a0823));if(_0x1a0823[_0xaf1f('0x12')]){if(_0x1a0823['error'][_0xaf1f('0x13')]===0x1f4){logger[_0xaf1f('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x506ca6,_0x1a0823[_0xaf1f('0x12')][_0xaf1f('0x14')]);return _0xbeb859(_0x1a0823[_0xaf1f('0x12')][_0xaf1f('0x14')]);}logger['error'](_0xaf1f('0xe'),_0x506ca6,_0x1a0823['error']['message']);return _0x4938e6(_0x1a0823[_0xaf1f('0x12')]['message']);}else{logger[_0xaf1f('0xd')](_0xaf1f('0xe'),_0x506ca6,'request\x20sent');_0x4938e6(_0x1a0823[_0xaf1f('0x15')][_0xaf1f('0x14')]);}})['catch'](function(_0x448fda){logger[_0xaf1f('0x12')](_0xaf1f('0xe'),_0x506ca6,_0x448fda);_0xbeb859(_0x448fda);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 951912e..157e1a9 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 _0x19aa=['update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','put'];(function(_0x172328,_0xeb050b){var _0x30db98=function(_0x2b77be){while(--_0x2b77be){_0x172328['push'](_0x172328['shift']());}};_0x30db98(++_0xeb050b);}(_0x19aa,0xc4));var _0xa19a=function(_0x1f62a9,_0xdb6a99){_0x1f62a9=_0x1f62a9-0x0;var _0x3115a2=_0x19aa[_0x1f62a9];return _0x3115a2;};'use strict';var multer=require(_0xa19a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa19a('0x1'));var express=require(_0xa19a('0x2'));var router=express[_0xa19a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa19a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa19a('0x5'));var controller=require('./intDynamics365Field.controller');router[_0xa19a('0x6')]('/',auth[_0xa19a('0x7')](),controller[_0xa19a('0x8')]);router[_0xa19a('0x6')](_0xa19a('0x9'),auth[_0xa19a('0x7')](),controller[_0xa19a('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa19a('0xb')](_0xa19a('0x9'),auth[_0xa19a('0x7')](),controller[_0xa19a('0xc')]);router[_0xa19a('0xd')](_0xa19a('0x9'),auth['isAuthenticated'](),controller[_0xa19a('0xe')]);module[_0xa19a('0xf')]=router; \ No newline at end of file +var _0x2199=['./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5dc1e1,_0x3eace1){var _0x4398e8=function(_0x11d539){while(--_0x11d539){_0x5dc1e1['push'](_0x5dc1e1['shift']());}};_0x4398e8(++_0x3eace1);}(_0x2199,0x173));var _0x9219=function(_0x45870f,_0x369111){_0x45870f=_0x45870f-0x0;var _0x3ebc3c=_0x2199[_0x45870f];return _0x3ebc3c;};'use strict';var multer=require(_0x9219('0x0'));var util=require(_0x9219('0x1'));var path=require(_0x9219('0x2'));var timeout=require(_0x9219('0x3'));var express=require(_0x9219('0x4'));var router=express[_0x9219('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9219('0x6'));var interaction=require(_0x9219('0x7'));var config=require(_0x9219('0x8'));var controller=require(_0x9219('0x9'));router[_0x9219('0xa')]('/',auth[_0x9219('0xb')](),controller[_0x9219('0xc')]);router[_0x9219('0xa')](_0x9219('0xd'),auth[_0x9219('0xb')](),controller['show']);router[_0x9219('0xe')]('/',auth[_0x9219('0xb')](),controller[_0x9219('0xf')]);router[_0x9219('0x10')](_0x9219('0xd'),auth[_0x9219('0xb')](),controller['update']);router[_0x9219('0x11')](_0x9219('0xd'),auth[_0x9219('0xb')](),controller[_0x9219('0x12')]);module[_0x9219('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 6149dda..7688997 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 _0xa921=['sequelize','exports','string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN'];(function(_0x3604ce,_0x45d75a){var _0x2708ca=function(_0x372998){while(--_0x372998){_0x3604ce['push'](_0x3604ce['shift']());}};_0x2708ca(++_0x45d75a);}(_0xa921,0x1b9));var _0x1a92=function(_0x5c6ef5,_0xa49019){_0x5c6ef5=_0x5c6ef5-0x0;var _0x744d0f=_0xa921[_0x5c6ef5];return _0x744d0f;};'use strict';var Sequelize=require(_0x1a92('0x0'));module[_0x1a92('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1a92('0x2'),_0x1a92('0x3'),_0x1a92('0x4'),_0x1a92('0x5'),'picklist'),'defaultValue':_0x1a92('0x2')},'content':{'type':Sequelize[_0x1a92('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1a92('0x7')](_0x1a92('0x2'),_0x1a92('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x1a92('0x6')]},'idField':{'type':Sequelize[_0x1a92('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1a92('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a92('0x6')]}}; \ No newline at end of file +var _0x96be=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x2199f7,_0x4f6410){var _0x6efa6a=function(_0x1d2362){while(--_0x1d2362){_0x2199f7['push'](_0x2199f7['shift']());}};_0x6efa6a(++_0x4f6410);}(_0x96be,0x1bb));var _0xe96b=function(_0x4d191f,_0x50bc07){_0x4d191f=_0x4d191f-0x0;var _0x31180d=_0x96be[_0x4d191f];return _0x31180d;};'use strict';var Sequelize=require('sequelize');module[_0xe96b('0x0')]={'type':{'type':Sequelize[_0xe96b('0x1')](_0xe96b('0x2'),_0xe96b('0x3'),_0xe96b('0x4'),_0xe96b('0x5'),_0xe96b('0x6')),'defaultValue':_0xe96b('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe96b('0x7')]},'keyType':{'type':Sequelize[_0xe96b('0x1')](_0xe96b('0x2'),_0xe96b('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xe96b('0x7')]},'idField':{'type':Sequelize[_0xe96b('0x7')]},'nameField':{'type':Sequelize[_0xe96b('0x7')]},'customField':{'type':Sequelize[_0xe96b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe96b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index a1a6862..117b5de 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 _0xd556=['status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','Dynamics365Field','includeAll','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x16af86,_0x518e6e){var _0x28f370=function(_0x574295){while(--_0x574295){_0x16af86['push'](_0x16af86['shift']());}};_0x28f370(++_0x518e6e);}(_0xd556,0x102));var _0x6d55=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd556[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x6d55('0x0'));var rimraf=require(_0x6d55('0x1'));var zipdir=require(_0x6d55('0x2'));var jsonpatch=require(_0x6d55('0x3'));var rp=require('request-promise');var moment=require(_0x6d55('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6d55('0x5'));var util=require(_0x6d55('0x6'));var path=require('path');var sox=require(_0x6d55('0x7'));var csv=require('to-csv');var ejs=require(_0x6d55('0x8'));var fs=require('fs');var fs_extra=require(_0x6d55('0x9'));var _=require(_0x6d55('0xa'));var squel=require(_0x6d55('0xb'));var crypto=require(_0x6d55('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6d55('0xd'));var toCsv=require(_0x6d55('0xe'));var querystring=require('querystring');var Papa=require(_0x6d55('0xf'));var Redis=require('ioredis');var authService=require(_0x6d55('0x10'));var qs=require(_0x6d55('0x11'));var as=require(_0x6d55('0x12'));var hardwareService=require(_0x6d55('0x13'));var logger=require(_0x6d55('0x14'))(_0x6d55('0x15'));var utils=require('../../config/utils');var config=require(_0x6d55('0x16'));var licenseUtil=require(_0x6d55('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3de0a6,_0x4efdbd){_0x4efdbd=_0x4efdbd||0xcc;return function(_0x3a6fa2){if(_0x3a6fa2){return _0x3de0a6[_0x6d55('0x18')](_0x4efdbd);}return _0x3de0a6['status'](_0x4efdbd)[_0x6d55('0x19')]();};}function respondWithResult(_0x8ebf1d,_0x3e8837){_0x3e8837=_0x3e8837||0xc8;return function(_0x494540){if(_0x494540){return _0x8ebf1d[_0x6d55('0x1a')](_0x3e8837)['json'](_0x494540);}};}function respondWithFilteredResult(_0x327811,_0xe8de13){return function(_0x3d2ecd){if(_0x3d2ecd){var _0x52803e=typeof _0xe8de13[_0x6d55('0x1b')]===_0x6d55('0x1c')&&typeof _0xe8de13[_0x6d55('0x1d')]===_0x6d55('0x1c');var _0x3ffc0c=_0x3d2ecd[_0x6d55('0x1e')];var _0x5dfb88=_0x52803e?0x0:_0xe8de13['offset'];var _0x5b202d=_0x52803e?_0x3d2ecd[_0x6d55('0x1e')]:_0xe8de13[_0x6d55('0x1b')]+_0xe8de13[_0x6d55('0x1d')];var _0x1542c5;if(_0x5b202d>=_0x3ffc0c){_0x5b202d=_0x3ffc0c;_0x1542c5=0xc8;}else{_0x1542c5=0xce;}_0x327811['status'](_0x1542c5);return _0x327811[_0x6d55('0x1f')](_0x6d55('0x20'),_0x5dfb88+'-'+_0x5b202d+'/'+_0x3ffc0c)['json'](_0x3d2ecd);}return null;};}function patchUpdates(_0x296fd5){return function(_0xe579dd){try{jsonpatch[_0x6d55('0x21')](_0xe579dd,_0x296fd5,!![]);}catch(_0x297d0d){return BPromise[_0x6d55('0x22')](_0x297d0d);}return _0xe579dd[_0x6d55('0x23')]();};}function saveUpdates(_0x243de3,_0x3a4ca5){return function(_0x512690){if(_0x512690){return _0x512690[_0x6d55('0x24')](_0x243de3)[_0x6d55('0x25')](function(_0x497314){return _0x497314;});}return null;};}function removeEntity(_0x521ca8,_0x2657c7){return function(_0x267bca){if(_0x267bca){return _0x267bca[_0x6d55('0x26')]()['then'](function(){_0x521ca8['status'](0xcc)[_0x6d55('0x19')]();});}};}function handleEntityNotFound(_0x17f874,_0x268106){return function(_0x3d9681){if(!_0x3d9681){_0x17f874['sendStatus'](0x194);}return _0x3d9681;};}function handleError(_0x28d8b7,_0x1af13b){_0x1af13b=_0x1af13b||0x1f4;return function(_0x152ce7){logger['error'](_0x152ce7[_0x6d55('0x27')]);if(_0x152ce7[_0x6d55('0x28')]){delete _0x152ce7[_0x6d55('0x28')];}_0x28d8b7[_0x6d55('0x1a')](_0x1af13b)['send'](_0x152ce7);};}exports[_0x6d55('0x29')]=function(_0x2c030e,_0x27a572){var _0x477c67={},_0x5be203={},_0x8d4136={'count':0x0,'rows':[]};var _0x3cfee2=_[_0x6d55('0x2a')](db['Dynamics365Field'][_0x6d55('0x2b')],function(_0x4e7bb4){return{'name':_0x4e7bb4['fieldName'],'type':_0x4e7bb4[_0x6d55('0x2c')][_0x6d55('0x2d')]};});_0x5be203[_0x6d55('0x2e')]=_[_0x6d55('0x2a')](_0x3cfee2,_0x6d55('0x28'));_0x5be203[_0x6d55('0x2f')]=_[_0x6d55('0x30')](_0x2c030e['query']);_0x5be203['filters']=_[_0x6d55('0x31')](_0x5be203['model'],_0x5be203[_0x6d55('0x2f')]);_0x477c67[_0x6d55('0x32')]=_['intersection'](_0x5be203['model'],qs[_0x6d55('0x33')](_0x2c030e[_0x6d55('0x2f')]['fields']));_0x477c67[_0x6d55('0x32')]=_0x477c67[_0x6d55('0x32')][_0x6d55('0x34')]?_0x477c67[_0x6d55('0x32')]:_0x5be203[_0x6d55('0x2e')];if(!_0x2c030e['query'][_0x6d55('0x35')]('nolimit')){_0x477c67[_0x6d55('0x1d')]=qs[_0x6d55('0x1d')](_0x2c030e[_0x6d55('0x2f')]['limit']);_0x477c67['offset']=qs[_0x6d55('0x1b')](_0x2c030e[_0x6d55('0x2f')]['offset']);}_0x477c67[_0x6d55('0x36')]=qs[_0x6d55('0x37')](_0x2c030e[_0x6d55('0x2f')][_0x6d55('0x37')]);_0x477c67[_0x6d55('0x38')]=qs[_0x6d55('0x39')](_['pick'](_0x2c030e['query'],_0x5be203[_0x6d55('0x39')]),_0x3cfee2);if(_0x2c030e[_0x6d55('0x2f')][_0x6d55('0x3a')]){_0x477c67[_0x6d55('0x38')]=_['merge'](_0x477c67[_0x6d55('0x38')],{'$or':_[_0x6d55('0x2a')](_0x3cfee2,function(_0xa768a2){if(_0xa768a2[_0x6d55('0x2c')]!=='VIRTUAL'){var _0x577860={};_0x577860[_0xa768a2[_0x6d55('0x28')]]={'$like':'%'+_0x2c030e[_0x6d55('0x2f')]['filter']+'%'};return _0x577860;}})});}_0x477c67=_[_0x6d55('0x3b')]({},_0x477c67,_0x2c030e[_0x6d55('0x3c')]);var _0x6b5e87={'where':_0x477c67[_0x6d55('0x38')]};return db[_0x6d55('0x3d')]['count'](_0x6b5e87)[_0x6d55('0x25')](function(_0x58f61b){_0x8d4136[_0x6d55('0x1e')]=_0x58f61b;if(_0x2c030e[_0x6d55('0x2f')][_0x6d55('0x3e')]){_0x477c67['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0x6d55('0x3f')](_0x477c67);})[_0x6d55('0x25')](function(_0x159596){_0x8d4136[_0x6d55('0x40')]=_0x159596;return _0x8d4136;})[_0x6d55('0x25')](respondWithFilteredResult(_0x27a572,_0x477c67))[_0x6d55('0x41')](handleError(_0x27a572,null));};exports[_0x6d55('0x42')]=function(_0x13cf83,_0x2dba59){var _0x18b292={'raw':!![],'where':{'id':_0x13cf83[_0x6d55('0x43')]['id']}},_0x168c4c={};_0x168c4c[_0x6d55('0x2e')]=_['keys'](db[_0x6d55('0x3d')][_0x6d55('0x2b')]);_0x168c4c[_0x6d55('0x2f')]=_[_0x6d55('0x30')](_0x13cf83[_0x6d55('0x2f')]);_0x168c4c['filters']=_['intersection'](_0x168c4c['model'],_0x168c4c['query']);_0x18b292[_0x6d55('0x32')]=_[_0x6d55('0x31')](_0x168c4c['model'],qs['fields'](_0x13cf83['query'][_0x6d55('0x33')]));_0x18b292[_0x6d55('0x32')]=_0x18b292['attributes']['length']?_0x18b292[_0x6d55('0x32')]:_0x168c4c[_0x6d55('0x2e')];if(_0x13cf83[_0x6d55('0x2f')][_0x6d55('0x3e')]){_0x18b292['include']=[{'all':!![]}];}_0x18b292=_[_0x6d55('0x3b')]({},_0x18b292,_0x13cf83[_0x6d55('0x3c')]);return db[_0x6d55('0x3d')]['find'](_0x18b292)[_0x6d55('0x25')](handleEntityNotFound(_0x2dba59,null))[_0x6d55('0x25')](respondWithResult(_0x2dba59,null))[_0x6d55('0x41')](handleError(_0x2dba59,null));};exports[_0x6d55('0x44')]=function(_0x176571,_0x24b722){return db['Dynamics365Field'][_0x6d55('0x44')](_0x176571[_0x6d55('0x45')],{})[_0x6d55('0x25')](respondWithResult(_0x24b722,0xc9))[_0x6d55('0x41')](handleError(_0x24b722,null));};exports['update']=function(_0x21c26a,_0x4fb924){if(_0x21c26a[_0x6d55('0x45')]['id']){delete _0x21c26a[_0x6d55('0x45')]['id'];}return db['Dynamics365Field'][_0x6d55('0x46')]({'where':{'id':_0x21c26a['params']['id']}})[_0x6d55('0x25')](handleEntityNotFound(_0x4fb924,null))[_0x6d55('0x25')](saveUpdates(_0x21c26a[_0x6d55('0x45')],null))[_0x6d55('0x25')](respondWithResult(_0x4fb924,null))[_0x6d55('0x41')](handleError(_0x4fb924,null));};exports['destroy']=function(_0x698ee5,_0x2c2db2){return db[_0x6d55('0x3d')][_0x6d55('0x46')]({'where':{'id':_0x698ee5[_0x6d55('0x43')]['id']}})[_0x6d55('0x25')](handleEntityNotFound(_0x2c2db2,null))[_0x6d55('0x25')](removeEntity(_0x2c2db2,null))[_0x6d55('0x41')](handleError(_0x2c2db2,null));}; \ No newline at end of file +var _0x931a=['includeAll','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','sendStatus','error','stack','name','index','map','Dynamics365Field','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x24f86a,_0x531661){var _0x706262=function(_0x4c99d6){while(--_0x4c99d6){_0x24f86a['push'](_0x24f86a['shift']());}};_0x706262(++_0x531661);}(_0x931a,0xe5));var _0xa931=function(_0x1b792f,_0x28bc50){_0x1b792f=_0x1b792f-0x0;var _0xb7e658=_0x931a[_0x1b792f];return _0xb7e658;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa931('0x0'));var zipdir=require(_0xa931('0x1'));var jsonpatch=require(_0xa931('0x2'));var rp=require(_0xa931('0x3'));var moment=require(_0xa931('0x4'));var BPromise=require(_0xa931('0x5'));var Mustache=require(_0xa931('0x6'));var util=require(_0xa931('0x7'));var path=require(_0xa931('0x8'));var sox=require(_0xa931('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa931('0xa'));var _=require(_0xa931('0xb'));var squel=require(_0xa931('0xc'));var crypto=require(_0xa931('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa931('0xe'));var querystring=require(_0xa931('0xf'));var Papa=require('papaparse');var Redis=require(_0xa931('0x10'));var authService=require(_0xa931('0x11'));var qs=require(_0xa931('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa931('0x13'));var logger=require(_0xa931('0x14'))('api');var utils=require(_0xa931('0x15'));var config=require(_0xa931('0x16'));var licenseUtil=require(_0xa931('0x17'));var db=require(_0xa931('0x18'))['db'];function respondWithStatusCode(_0x3e4cd8,_0x2f157e){_0x2f157e=_0x2f157e||0xcc;return function(_0x3b6baf){if(_0x3b6baf){return _0x3e4cd8['sendStatus'](_0x2f157e);}return _0x3e4cd8[_0xa931('0x19')](_0x2f157e)['end']();};}function respondWithResult(_0x42d519,_0x1c217c){_0x1c217c=_0x1c217c||0xc8;return function(_0x3766c3){if(_0x3766c3){return _0x42d519['status'](_0x1c217c)[_0xa931('0x1a')](_0x3766c3);}};}function respondWithFilteredResult(_0x43fa12,_0x26efb4){return function(_0x5f3104){if(_0x5f3104){var _0x3e801c=typeof _0x26efb4[_0xa931('0x1b')]===_0xa931('0x1c')&&typeof _0x26efb4[_0xa931('0x1d')]===_0xa931('0x1c');var _0x1cec93=_0x5f3104[_0xa931('0x1e')];var _0x4c1b22=_0x3e801c?0x0:_0x26efb4[_0xa931('0x1b')];var _0x1773fc=_0x3e801c?_0x5f3104['count']:_0x26efb4['offset']+_0x26efb4[_0xa931('0x1d')];var _0x370656;if(_0x1773fc>=_0x1cec93){_0x1773fc=_0x1cec93;_0x370656=0xc8;}else{_0x370656=0xce;}_0x43fa12[_0xa931('0x19')](_0x370656);return _0x43fa12[_0xa931('0x1f')]('Content-Range',_0x4c1b22+'-'+_0x1773fc+'/'+_0x1cec93)['json'](_0x5f3104);}return null;};}function patchUpdates(_0xee2fd9){return function(_0xa68d11){try{jsonpatch[_0xa931('0x20')](_0xa68d11,_0xee2fd9,!![]);}catch(_0x86439b){return BPromise[_0xa931('0x21')](_0x86439b);}return _0xa68d11[_0xa931('0x22')]();};}function saveUpdates(_0x4d6fce,_0x476e0f){return function(_0xa8a225){if(_0xa8a225){return _0xa8a225[_0xa931('0x23')](_0x4d6fce)[_0xa931('0x24')](function(_0x40a035){return _0x40a035;});}return null;};}function removeEntity(_0x1d8dfd,_0x26837){return function(_0x5d9b41){if(_0x5d9b41){return _0x5d9b41['destroy']()[_0xa931('0x24')](function(){_0x1d8dfd[_0xa931('0x19')](0xcc)[_0xa931('0x25')]();});}};}function handleEntityNotFound(_0x3c2298,_0x480b0d){return function(_0x472de0){if(!_0x472de0){_0x3c2298[_0xa931('0x26')](0x194);}return _0x472de0;};}function handleError(_0x4401ea,_0x37b41a){_0x37b41a=_0x37b41a||0x1f4;return function(_0x18e888){logger[_0xa931('0x27')](_0x18e888[_0xa931('0x28')]);if(_0x18e888[_0xa931('0x29')]){delete _0x18e888['name'];}_0x4401ea['status'](_0x37b41a)['send'](_0x18e888);};}exports[_0xa931('0x2a')]=function(_0x339950,_0x4b01bd){var _0x4554f5={},_0x328eee={},_0x5c90d6={'count':0x0,'rows':[]};var _0x553a9e=_[_0xa931('0x2b')](db[_0xa931('0x2c')]['rawAttributes'],function(_0xaedf07){return{'name':_0xaedf07[_0xa931('0x2d')],'type':_0xaedf07[_0xa931('0x2e')][_0xa931('0x2f')]};});_0x328eee[_0xa931('0x30')]=_[_0xa931('0x2b')](_0x553a9e,_0xa931('0x29'));_0x328eee[_0xa931('0x31')]=_[_0xa931('0x32')](_0x339950[_0xa931('0x31')]);_0x328eee[_0xa931('0x33')]=_[_0xa931('0x34')](_0x328eee['model'],_0x328eee[_0xa931('0x31')]);_0x4554f5[_0xa931('0x35')]=_[_0xa931('0x34')](_0x328eee[_0xa931('0x30')],qs[_0xa931('0x36')](_0x339950[_0xa931('0x31')][_0xa931('0x36')]));_0x4554f5[_0xa931('0x35')]=_0x4554f5[_0xa931('0x35')][_0xa931('0x37')]?_0x4554f5[_0xa931('0x35')]:_0x328eee[_0xa931('0x30')];if(!_0x339950[_0xa931('0x31')][_0xa931('0x38')]('nolimit')){_0x4554f5[_0xa931('0x1d')]=qs[_0xa931('0x1d')](_0x339950[_0xa931('0x31')][_0xa931('0x1d')]);_0x4554f5[_0xa931('0x1b')]=qs['offset'](_0x339950[_0xa931('0x31')]['offset']);}_0x4554f5[_0xa931('0x39')]=qs[_0xa931('0x3a')](_0x339950[_0xa931('0x31')][_0xa931('0x3a')]);_0x4554f5[_0xa931('0x3b')]=qs[_0xa931('0x33')](_[_0xa931('0x3c')](_0x339950['query'],_0x328eee[_0xa931('0x33')]),_0x553a9e);if(_0x339950['query'][_0xa931('0x3d')]){_0x4554f5[_0xa931('0x3b')]=_[_0xa931('0x3e')](_0x4554f5[_0xa931('0x3b')],{'$or':_[_0xa931('0x2b')](_0x553a9e,function(_0x12633a){if(_0x12633a[_0xa931('0x2e')]!=='VIRTUAL'){var _0x23555f={};_0x23555f[_0x12633a[_0xa931('0x29')]]={'$like':'%'+_0x339950[_0xa931('0x31')]['filter']+'%'};return _0x23555f;}})});}_0x4554f5=_[_0xa931('0x3e')]({},_0x4554f5,_0x339950[_0xa931('0x3f')]);var _0x497bf4={'where':_0x4554f5[_0xa931('0x3b')]};return db[_0xa931('0x2c')]['count'](_0x497bf4)['then'](function(_0x8ce6a){_0x5c90d6[_0xa931('0x1e')]=_0x8ce6a;if(_0x339950[_0xa931('0x31')]['includeAll']){_0x4554f5[_0xa931('0x40')]=[{'all':!![]}];}return db[_0xa931('0x2c')][_0xa931('0x41')](_0x4554f5);})[_0xa931('0x24')](function(_0x4564ad){_0x5c90d6[_0xa931('0x42')]=_0x4564ad;return _0x5c90d6;})[_0xa931('0x24')](respondWithFilteredResult(_0x4b01bd,_0x4554f5))[_0xa931('0x43')](handleError(_0x4b01bd,null));};exports[_0xa931('0x44')]=function(_0x34f6d8,_0x460b00){var _0x4fa330={'raw':!![],'where':{'id':_0x34f6d8[_0xa931('0x45')]['id']}},_0x195af0={};_0x195af0[_0xa931('0x30')]=_[_0xa931('0x32')](db['Dynamics365Field'][_0xa931('0x46')]);_0x195af0[_0xa931('0x31')]=_[_0xa931('0x32')](_0x34f6d8[_0xa931('0x31')]);_0x195af0['filters']=_[_0xa931('0x34')](_0x195af0[_0xa931('0x30')],_0x195af0[_0xa931('0x31')]);_0x4fa330[_0xa931('0x35')]=_[_0xa931('0x34')](_0x195af0[_0xa931('0x30')],qs[_0xa931('0x36')](_0x34f6d8[_0xa931('0x31')][_0xa931('0x36')]));_0x4fa330[_0xa931('0x35')]=_0x4fa330[_0xa931('0x35')][_0xa931('0x37')]?_0x4fa330[_0xa931('0x35')]:_0x195af0[_0xa931('0x30')];if(_0x34f6d8['query'][_0xa931('0x47')]){_0x4fa330[_0xa931('0x40')]=[{'all':!![]}];}_0x4fa330=_['merge']({},_0x4fa330,_0x34f6d8[_0xa931('0x3f')]);return db[_0xa931('0x2c')]['find'](_0x4fa330)[_0xa931('0x24')](handleEntityNotFound(_0x460b00,null))['then'](respondWithResult(_0x460b00,null))[_0xa931('0x43')](handleError(_0x460b00,null));};exports[_0xa931('0x48')]=function(_0x36f521,_0x491a33){return db[_0xa931('0x2c')][_0xa931('0x48')](_0x36f521['body'],{})[_0xa931('0x24')](respondWithResult(_0x491a33,0xc9))['catch'](handleError(_0x491a33,null));};exports[_0xa931('0x23')]=function(_0x1b0460,_0x224434){if(_0x1b0460['body']['id']){delete _0x1b0460[_0xa931('0x49')]['id'];}return db[_0xa931('0x2c')][_0xa931('0x4a')]({'where':{'id':_0x1b0460[_0xa931('0x45')]['id']}})[_0xa931('0x24')](handleEntityNotFound(_0x224434,null))[_0xa931('0x24')](saveUpdates(_0x1b0460[_0xa931('0x49')],null))[_0xa931('0x24')](respondWithResult(_0x224434,null))[_0xa931('0x43')](handleError(_0x224434,null));};exports['destroy']=function(_0x254a42,_0x1df7af){return db[_0xa931('0x2c')][_0xa931('0x4a')]({'where':{'id':_0x254a42['params']['id']}})[_0xa931('0x24')](handleEntityNotFound(_0x1df7af,null))[_0xa931('0x24')](removeEntity(_0x1df7af,null))[_0xa931('0x43')](handleError(_0x1df7af,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index a292c66..52eeb14 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 _0x7d6d=['exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intDynamics365Field.attributes'];(function(_0x3bbcc5,_0x4c9605){var _0x41251e=function(_0x35003c){while(--_0x35003c){_0x3bbcc5['push'](_0x3bbcc5['shift']());}};_0x41251e(++_0x4c9605);}(_0x7d6d,0xc5));var _0xd7d6=function(_0x575c8f,_0x19703a){_0x575c8f=_0x575c8f-0x0;var _0x613953=_0x7d6d[_0x575c8f];return _0x613953;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd7d6('0x0'))(_0xd7d6('0x1'));var moment=require(_0xd7d6('0x2'));var BPromise=require(_0xd7d6('0x3'));var rp=require(_0xd7d6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7d6('0x5'));var config=require('../../config/environment');var attributes=require(_0xd7d6('0x6'));module[_0xd7d6('0x7')]=function(_0x4c5807,_0x5c375e){return _0x4c5807[_0xd7d6('0x8')]('Dynamics365Field',attributes,{'tableName':_0xd7d6('0x9'),'paranoid':![],'indexes':[{'name':_0xd7d6('0xa'),'fields':[_0xd7d6('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1eaa=['define','Dynamics365Field','dynamics365_unique_index','idField','lodash','bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes','exports'];(function(_0x174dca,_0x22eff9){var _0xb87dc6=function(_0xde8988){while(--_0xde8988){_0x174dca['push'](_0x174dca['shift']());}};_0xb87dc6(++_0x22eff9);}(_0x1eaa,0x190));var _0xa1ea=function(_0x1b73fb,_0xa408a2){_0x1b73fb=_0x1b73fb-0x0;var _0x1d6906=_0x1eaa[_0x1b73fb];return _0x1d6906;};'use strict';var _=require(_0xa1ea('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa1ea('0x1'));var rp=require(_0xa1ea('0x2'));var fs=require('fs');var path=require(_0xa1ea('0x3'));var rimraf=require(_0xa1ea('0x4'));var config=require('../../config/environment');var attributes=require(_0xa1ea('0x5'));module[_0xa1ea('0x6')]=function(_0x3f626b,_0xf49387){return _0x3f626b[_0xa1ea('0x7')](_0xa1ea('0x8'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xa1ea('0x9'),'fields':[_0xa1ea('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 7d38cec..5dcca26 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 _0xf967=['result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info'];(function(_0xb0ce8f,_0x170db6){var _0x1bbe9a=function(_0x231352){while(--_0x231352){_0xb0ce8f['push'](_0xb0ce8f['shift']());}};_0x1bbe9a(++_0x170db6);}(_0xf967,0x17b));var _0x7f96=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf967[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x7f96('0x0'));var util=require(_0x7f96('0x1'));var moment=require(_0x7f96('0x2'));var BPromise=require(_0x7f96('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f96('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f96('0x5'))(_0x7f96('0x6'));var config=require(_0x7f96('0x7'));var jayson=require(_0x7f96('0x8'));var client=jayson['client'][_0x7f96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56ca6c,_0x512600,_0x5dcdd9){return new BPromise(function(_0x16fb06,_0x8c09fb){return client[_0x7f96('0xa')](_0x56ca6c,_0x5dcdd9)[_0x7f96('0xb')](function(_0x1a02df){logger['info'](_0x7f96('0xc'),_0x512600,'request\x20sent');logger[_0x7f96('0xd')](_0x7f96('0xe'),_0x512600,_0x7f96('0xf'),JSON['stringify'](_0x1a02df));if(_0x1a02df[_0x7f96('0x10')]){if(_0x1a02df[_0x7f96('0x10')][_0x7f96('0x11')]===0x1f4){logger[_0x7f96('0x10')](_0x7f96('0xc'),_0x512600,_0x1a02df[_0x7f96('0x10')]['message']);return _0x8c09fb(_0x1a02df[_0x7f96('0x10')][_0x7f96('0x12')]);}logger[_0x7f96('0x10')](_0x7f96('0xc'),_0x512600,_0x1a02df[_0x7f96('0x10')][_0x7f96('0x12')]);return _0x16fb06(_0x1a02df[_0x7f96('0x10')][_0x7f96('0x12')]);}else{logger[_0x7f96('0x13')](_0x7f96('0xc'),_0x512600,_0x7f96('0xf'));_0x16fb06(_0x1a02df[_0x7f96('0x14')][_0x7f96('0x12')]);}})['catch'](function(_0xfc7c1a){logger['error'](_0x7f96('0xc'),_0x512600,_0xfc7c1a);_0x8c09fb(_0xfc7c1a);});});} \ No newline at end of file +var _0xcb51=['then','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Field,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x5993a2,_0x50192f){var _0x6b8267=function(_0x15d381){while(--_0x15d381){_0x5993a2['push'](_0x5993a2['shift']());}};_0x6b8267(++_0x50192f);}(_0xcb51,0xfd));var _0x1cb5=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xcb51[_0x2dadb9];return _0x2f0097;};'use strict';var _=require('lodash');var util=require(_0x1cb5('0x0'));var moment=require(_0x1cb5('0x1'));var BPromise=require(_0x1cb5('0x2'));var rs=require(_0x1cb5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cb5('0x4'))['db'];var utils=require(_0x1cb5('0x5'));var logger=require('../../config/logger')(_0x1cb5('0x6'));var config=require(_0x1cb5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1cb5('0x8')][_0x1cb5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x223d34,_0x59e9ea,_0xf10e44){return new BPromise(function(_0x1c7518,_0x153bd7){return client[_0x1cb5('0xa')](_0x223d34,_0xf10e44)[_0x1cb5('0xb')](function(_0x433f5a){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x59e9ea,_0x1cb5('0xc'));logger[_0x1cb5('0xd')](_0x1cb5('0xe'),_0x59e9ea,_0x1cb5('0xc'),JSON[_0x1cb5('0xf')](_0x433f5a));if(_0x433f5a[_0x1cb5('0x10')]){if(_0x433f5a[_0x1cb5('0x10')]['code']===0x1f4){logger[_0x1cb5('0x10')](_0x1cb5('0x11'),_0x59e9ea,_0x433f5a[_0x1cb5('0x10')][_0x1cb5('0x12')]);return _0x153bd7(_0x433f5a['error'][_0x1cb5('0x12')]);}logger['error'](_0x1cb5('0x11'),_0x59e9ea,_0x433f5a[_0x1cb5('0x10')][_0x1cb5('0x12')]);return _0x1c7518(_0x433f5a[_0x1cb5('0x10')][_0x1cb5('0x12')]);}else{logger[_0x1cb5('0x13')](_0x1cb5('0x11'),_0x59e9ea,_0x1cb5('0xc'));_0x1c7518(_0x433f5a[_0x1cb5('0x14')][_0x1cb5('0x12')]);}})[_0x1cb5('0x15')](function(_0x106ac1){logger['error'](_0x1cb5('0x11'),_0x59e9ea,_0x106ac1);_0x153bd7(_0x106ac1);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index b76d792..cf89b91 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 _0x8b3e=['destroy','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b3e,0x144));var _0xe8b3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8b3e[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe8b3('0x0'));var timeout=require(_0xe8b3('0x1'));var express=require(_0xe8b3('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe8b3('0x3'));var interaction=require(_0xe8b3('0x4'));var config=require(_0xe8b3('0x5'));var controller=require(_0xe8b3('0x6'));router[_0xe8b3('0x7')]('/',auth[_0xe8b3('0x8')](),controller[_0xe8b3('0x9')]);router[_0xe8b3('0x7')](_0xe8b3('0xa'),auth[_0xe8b3('0x8')](),controller[_0xe8b3('0xb')]);router[_0xe8b3('0x7')](_0xe8b3('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0xe8b3('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xe8b3('0xe')]('/',auth['isAuthenticated'](),controller[_0xe8b3('0xf')]);router[_0xe8b3('0xe')](_0xe8b3('0xc'),auth[_0xe8b3('0x8')](),controller[_0xe8b3('0x10')]);router['put'](_0xe8b3('0xa'),auth['isAuthenticated'](),controller[_0xe8b3('0x11')]);router['delete'](_0xe8b3('0xa'),auth['isAuthenticated'](),controller[_0xe8b3('0x12')]);module['exports']=router; \ No newline at end of file +var _0x80bc=['get','isAuthenticated','/:id','show','/:id/fields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x229be5,_0x9156f6){var _0x326189=function(_0x2cca17){while(--_0x2cca17){_0x229be5['push'](_0x229be5['shift']());}};_0x326189(++_0x9156f6);}(_0x80bc,0x1b1));var _0xc80b=function(_0x13b3b5,_0x52d8d8){_0x13b3b5=_0x13b3b5-0x0;var _0x337cd0=_0x80bc[_0x13b3b5];return _0x337cd0;};'use strict';var multer=require(_0xc80b('0x0'));var util=require(_0xc80b('0x1'));var path=require(_0xc80b('0x2'));var timeout=require(_0xc80b('0x3'));var express=require('express');var router=express[_0xc80b('0x4')]();var fs_extra=require(_0xc80b('0x5'));var auth=require(_0xc80b('0x6'));var interaction=require(_0xc80b('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0xc80b('0x8')]('/',auth[_0xc80b('0x9')](),controller['index']);router[_0xc80b('0x8')](_0xc80b('0xa'),auth['isAuthenticated'](),controller[_0xc80b('0xb')]);router[_0xc80b('0x8')]('/:id/configurations',auth[_0xc80b('0x9')](),controller['getConfigurations']);router['get'](_0xc80b('0xc'),auth[_0xc80b('0x9')](),controller['getFields']);router[_0xc80b('0xd')]('/',auth[_0xc80b('0x9')](),controller['create']);router[_0xc80b('0xd')](_0xc80b('0xe'),auth[_0xc80b('0x9')](),controller[_0xc80b('0xf')]);router[_0xc80b('0x10')](_0xc80b('0xa'),auth[_0xc80b('0x9')](),controller[_0xc80b('0x11')]);router[_0xc80b('0x12')](_0xc80b('0xa'),auth[_0xc80b('0x9')](),controller[_0xc80b('0x13')]);module[_0xc80b('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 2b885d7..750d3a0 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 _0x160f=['sequelize','exports','STRING','username','remoteUri'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf160('0x0'));module[_0xf160('0x1')]={'name':{'type':Sequelize[_0xf160('0x2')]},'description':{'type':Sequelize[_0xf160('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xf160('0x3')},'apiKey':{'type':Sequelize[_0xf160('0x2')]},'remoteUri':{'type':Sequelize[_0xf160('0x2')],'unique':_0xf160('0x4')},'serverUrl':{'type':Sequelize[_0xf160('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7096=['exports','STRING','username','remoteUri'];(function(_0x197f72,_0x1afd16){var _0x1e6845=function(_0x9d9601){while(--_0x9d9601){_0x197f72['push'](_0x197f72['shift']());}};_0x1e6845(++_0x1afd16);}(_0x7096,0x10c));var _0x6709=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7096[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6709('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6709('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6709('0x2')},'apiKey':{'type':Sequelize[_0x6709('0x1')]},'remoteUri':{'type':Sequelize[_0x6709('0x1')],'unique':_0x6709('0x3')},'serverUrl':{'type':Sequelize[_0x6709('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 6293c1c..f5bcd34 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 _0x2964=['AccountId','channel','Descriptions','getDescriptions','FreshdeskField','findOne','apiKey','substring','format','%s/%s','Basic\x20%s','%s:X','base64','requester','subject','description','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','FreshdeskAccount','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','create','body','FreshdeskConfiguration','order','getConfigurations','hasOwnProperty','nolimit'];(function(_0x181c61,_0x4b1602){var _0x5146f2=function(_0x5b3cc4){while(--_0x5b3cc4){_0x181c61['push'](_0x181c61['shift']());}};_0x5146f2(++_0x4b1602);}(_0x2964,0x108));var _0x4296=function(_0x384fd0,_0x3a7019){_0x384fd0=_0x384fd0-0x0;var _0xa834ab=_0x2964[_0x384fd0];return _0xa834ab;};'use strict';var emlformat=require(_0x4296('0x0'));var rimraf=require(_0x4296('0x1'));var zipdir=require(_0x4296('0x2'));var jsonpatch=require(_0x4296('0x3'));var rp=require(_0x4296('0x4'));var moment=require(_0x4296('0x5'));var BPromise=require(_0x4296('0x6'));var Mustache=require(_0x4296('0x7'));var util=require(_0x4296('0x8'));var path=require('path');var sox=require(_0x4296('0x9'));var csv=require(_0x4296('0xa'));var ejs=require(_0x4296('0xb'));var fs=require('fs');var fs_extra=require(_0x4296('0xc'));var _=require(_0x4296('0xd'));var squel=require(_0x4296('0xe'));var crypto=require('crypto');var jsforce=require(_0x4296('0xf'));var deskjs=require(_0x4296('0x10'));var toCsv=require(_0x4296('0xa'));var querystring=require(_0x4296('0x11'));var Papa=require(_0x4296('0x12'));var Redis=require(_0x4296('0x13'));var authService=require(_0x4296('0x14'));var qs=require(_0x4296('0x15'));var as=require(_0x4296('0x16'));var hardwareService=require(_0x4296('0x17'));var logger=require(_0x4296('0x18'))(_0x4296('0x19'));var utils=require('../../config/utils');var config=require(_0x4296('0x1a'));var licenseUtil=require(_0x4296('0x1b'));var db=require(_0x4296('0x1c'))['db'];var integrations=require(_0x4296('0x1d'));function respondWithStatusCode(_0x23ba5a,_0x676674){_0x676674=_0x676674||0xcc;return function(_0x3789a2){if(_0x3789a2){return _0x23ba5a['sendStatus'](_0x676674);}return _0x23ba5a[_0x4296('0x1e')](_0x676674)[_0x4296('0x1f')]();};}function respondWithResult(_0x3574da,_0x56b6d7){_0x56b6d7=_0x56b6d7||0xc8;return function(_0x1c192c){if(_0x1c192c){return _0x3574da[_0x4296('0x1e')](_0x56b6d7)[_0x4296('0x20')](_0x1c192c);}};}function respondWithFilteredResult(_0x53af4b,_0x182910){return function(_0x2e63c4){if(_0x2e63c4){var _0x1e7af8=typeof _0x182910['offset']===_0x4296('0x21')&&typeof _0x182910[_0x4296('0x22')]===_0x4296('0x21');var _0x1dcb36=_0x2e63c4[_0x4296('0x23')];var _0x540b0d=_0x1e7af8?0x0:_0x182910[_0x4296('0x24')];var _0x4ac668=_0x1e7af8?_0x2e63c4[_0x4296('0x23')]:_0x182910['offset']+_0x182910[_0x4296('0x22')];var _0x6c50b7;if(_0x4ac668>=_0x1dcb36){_0x4ac668=_0x1dcb36;_0x6c50b7=0xc8;}else{_0x6c50b7=0xce;}_0x53af4b[_0x4296('0x1e')](_0x6c50b7);return _0x53af4b[_0x4296('0x25')](_0x4296('0x26'),_0x540b0d+'-'+_0x4ac668+'/'+_0x1dcb36)[_0x4296('0x20')](_0x2e63c4);}return null;};}function patchUpdates(_0x4ca11f){return function(_0x33839e){try{jsonpatch[_0x4296('0x27')](_0x33839e,_0x4ca11f,!![]);}catch(_0x5456ca){return BPromise[_0x4296('0x28')](_0x5456ca);}return _0x33839e[_0x4296('0x29')]();};}function saveUpdates(_0x257f51,_0x3c899f){return function(_0x5d285d){if(_0x5d285d){return _0x5d285d['update'](_0x257f51)[_0x4296('0x2a')](function(_0x3902b5){return _0x3902b5;});}return null;};}function removeEntity(_0x4ce761,_0x179e5d){return function(_0x4c5aca){if(_0x4c5aca){return _0x4c5aca[_0x4296('0x2b')]()[_0x4296('0x2a')](function(){_0x4ce761[_0x4296('0x1e')](0xcc)[_0x4296('0x1f')]();});}};}function handleEntityNotFound(_0x5098c1,_0x3b8b48){return function(_0x4c56e5){if(!_0x4c56e5){_0x5098c1[_0x4296('0x2c')](0x194);}return _0x4c56e5;};}function handleError(_0x516365,_0x4f2d8e){_0x4f2d8e=_0x4f2d8e||0x1f4;return function(_0x853bf5){logger[_0x4296('0x2d')](_0x853bf5[_0x4296('0x2e')]);if(_0x853bf5['name']){delete _0x853bf5[_0x4296('0x2f')];}_0x516365[_0x4296('0x1e')](_0x4f2d8e)['send'](_0x853bf5);};}exports[_0x4296('0x30')]=function(_0x5cb6b7,_0x4f9a1a){var _0x14c84f={},_0x2f5a2e={},_0x37f4e5={'count':0x0,'rows':[]};var _0x1bf57b=_[_0x4296('0x31')](db[_0x4296('0x32')][_0x4296('0x33')],function(_0x9ac120){return{'name':_0x9ac120['fieldName'],'type':_0x9ac120[_0x4296('0x34')]['key']};});_0x2f5a2e[_0x4296('0x35')]=_['map'](_0x1bf57b,'name');_0x2f5a2e[_0x4296('0x36')]=_['keys'](_0x5cb6b7[_0x4296('0x36')]);_0x2f5a2e[_0x4296('0x37')]=_[_0x4296('0x38')](_0x2f5a2e[_0x4296('0x35')],_0x2f5a2e[_0x4296('0x36')]);_0x14c84f[_0x4296('0x39')]=_[_0x4296('0x38')](_0x2f5a2e[_0x4296('0x35')],qs[_0x4296('0x3a')](_0x5cb6b7[_0x4296('0x36')][_0x4296('0x3a')]));_0x14c84f['attributes']=_0x14c84f['attributes'][_0x4296('0x3b')]?_0x14c84f[_0x4296('0x39')]:_0x2f5a2e[_0x4296('0x35')];if(!_0x5cb6b7[_0x4296('0x36')]['hasOwnProperty']('nolimit')){_0x14c84f[_0x4296('0x22')]=qs[_0x4296('0x22')](_0x5cb6b7[_0x4296('0x36')][_0x4296('0x22')]);_0x14c84f['offset']=qs[_0x4296('0x24')](_0x5cb6b7[_0x4296('0x36')]['offset']);}_0x14c84f['order']=qs['sort'](_0x5cb6b7[_0x4296('0x36')][_0x4296('0x3c')]);_0x14c84f['where']=qs[_0x4296('0x37')](_[_0x4296('0x3d')](_0x5cb6b7[_0x4296('0x36')],_0x2f5a2e[_0x4296('0x37')]),_0x1bf57b);if(_0x5cb6b7[_0x4296('0x36')][_0x4296('0x3e')]){_0x14c84f[_0x4296('0x3f')]=_[_0x4296('0x40')](_0x14c84f[_0x4296('0x3f')],{'$or':_[_0x4296('0x31')](_0x1bf57b,function(_0x1e96ed){if(_0x1e96ed[_0x4296('0x34')]!==_0x4296('0x41')){var _0x542ef9={};_0x542ef9[_0x1e96ed[_0x4296('0x2f')]]={'$like':'%'+_0x5cb6b7[_0x4296('0x36')][_0x4296('0x3e')]+'%'};return _0x542ef9;}})});}_0x14c84f=_[_0x4296('0x40')]({},_0x14c84f,_0x5cb6b7[_0x4296('0x42')]);var _0x2fa9c0={'where':_0x14c84f['where']};return db[_0x4296('0x32')][_0x4296('0x23')](_0x2fa9c0)[_0x4296('0x2a')](function(_0x536531){_0x37f4e5[_0x4296('0x23')]=_0x536531;if(_0x5cb6b7['query'][_0x4296('0x43')]){_0x14c84f[_0x4296('0x44')]=[{'all':!![]}];}return db[_0x4296('0x32')][_0x4296('0x45')](_0x14c84f);})[_0x4296('0x2a')](function(_0x43e3b2){_0x37f4e5['rows']=_0x43e3b2;return _0x37f4e5;})[_0x4296('0x2a')](respondWithFilteredResult(_0x4f9a1a,_0x14c84f))[_0x4296('0x46')](handleError(_0x4f9a1a,null));};exports['show']=function(_0x47bd76,_0xa64359){var _0x3fffd3={'raw':![],'where':{'id':_0x47bd76[_0x4296('0x47')]['id']}},_0x2da579={};_0x2da579[_0x4296('0x35')]=_['keys'](db['FreshdeskAccount'][_0x4296('0x33')]);_0x2da579[_0x4296('0x36')]=_[_0x4296('0x48')](_0x47bd76[_0x4296('0x36')]);_0x2da579[_0x4296('0x37')]=_[_0x4296('0x38')](_0x2da579[_0x4296('0x35')],_0x2da579[_0x4296('0x36')]);_0x3fffd3[_0x4296('0x39')]=_['intersection'](_0x2da579[_0x4296('0x35')],qs[_0x4296('0x3a')](_0x47bd76[_0x4296('0x36')]['fields']));_0x3fffd3[_0x4296('0x39')]=_0x3fffd3[_0x4296('0x39')]['length']?_0x3fffd3['attributes']:_0x2da579[_0x4296('0x35')];if(_0x47bd76[_0x4296('0x36')][_0x4296('0x43')]){_0x3fffd3['include']=[{'all':!![]}];}_0x3fffd3=_['merge']({},_0x3fffd3,_0x47bd76['options']);return db[_0x4296('0x32')][_0x4296('0x49')](_0x3fffd3)[_0x4296('0x2a')](handleEntityNotFound(_0xa64359,null))['then'](respondWithResult(_0xa64359,null))['catch'](handleError(_0xa64359,null));};exports[_0x4296('0x4a')]=function(_0x1ddb06,_0x403e7d){return db[_0x4296('0x32')][_0x4296('0x4a')](_0x1ddb06[_0x4296('0x4b')],{})[_0x4296('0x2a')](respondWithResult(_0x403e7d,0xc9))[_0x4296('0x46')](handleError(_0x403e7d,null));};exports['update']=function(_0x419cab,_0x1f050b){if(_0x419cab[_0x4296('0x4b')]['id']){delete _0x419cab[_0x4296('0x4b')]['id'];}return db[_0x4296('0x32')][_0x4296('0x49')]({'where':{'id':_0x419cab['params']['id']}})['then'](handleEntityNotFound(_0x1f050b,null))['then'](saveUpdates(_0x419cab[_0x4296('0x4b')],null))[_0x4296('0x2a')](respondWithResult(_0x1f050b,null))[_0x4296('0x46')](handleError(_0x1f050b,null));};exports[_0x4296('0x2b')]=function(_0x4baee7,_0x2ac96d){return db[_0x4296('0x32')][_0x4296('0x49')]({'where':{'id':_0x4baee7[_0x4296('0x47')]['id']}})[_0x4296('0x2a')](handleEntityNotFound(_0x2ac96d,null))[_0x4296('0x2a')](removeEntity(_0x2ac96d,null))[_0x4296('0x46')](handleError(_0x2ac96d,null));};exports['getConfigurations']=function(_0x468453,_0x47f668,_0x52c28a){var _0x6379ec={};var _0x18080a={};var _0x4f306a;var _0x17e212;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x468453[_0x4296('0x47')]['id']}})[_0x4296('0x2a')](handleEntityNotFound(_0x47f668,null))['then'](function(_0x4faac4){if(_0x4faac4){_0x4f306a=_0x4faac4;_0x18080a[_0x4296('0x35')]=_[_0x4296('0x48')](db[_0x4296('0x4c')][_0x4296('0x33')]);_0x18080a[_0x4296('0x36')]=_['keys'](_0x468453[_0x4296('0x36')]);_0x18080a[_0x4296('0x37')]=_['intersection'](_0x18080a[_0x4296('0x35')],_0x18080a[_0x4296('0x36')]);_0x6379ec[_0x4296('0x39')]=_[_0x4296('0x38')](_0x18080a[_0x4296('0x35')],qs[_0x4296('0x3a')](_0x468453['query'][_0x4296('0x3a')]));_0x6379ec[_0x4296('0x39')]=_0x6379ec[_0x4296('0x39')][_0x4296('0x3b')]?_0x6379ec['attributes']:_0x18080a['model'];_0x6379ec[_0x4296('0x4d')]=qs[_0x4296('0x3c')](_0x468453['query'][_0x4296('0x3c')]);_0x6379ec[_0x4296('0x3f')]=qs[_0x4296('0x37')](_[_0x4296('0x3d')](_0x468453[_0x4296('0x36')],_0x18080a['filters']));if(_0x468453[_0x4296('0x36')]['filter']){_0x6379ec[_0x4296('0x3f')]=_['merge'](_0x6379ec[_0x4296('0x3f')],{'$or':_[_0x4296('0x31')](_0x6379ec[_0x4296('0x39')],function(_0x26a400){var _0x2e8b42={};_0x2e8b42[_0x26a400]={'$like':'%'+_0x468453[_0x4296('0x36')][_0x4296('0x3e')]+'%'};return _0x2e8b42;})});}_0x6379ec=_[_0x4296('0x40')]({},_0x6379ec,_0x468453['options']);return _0x4f306a[_0x4296('0x4e')](_0x6379ec);}})[_0x4296('0x2a')](function(_0x128f96){if(_0x128f96){_0x17e212=_0x128f96[_0x4296('0x3b')];if(!_0x468453['query'][_0x4296('0x4f')](_0x4296('0x50'))){_0x6379ec[_0x4296('0x22')]=qs[_0x4296('0x22')](_0x468453[_0x4296('0x36')][_0x4296('0x22')]);_0x6379ec[_0x4296('0x24')]=qs[_0x4296('0x24')](_0x468453[_0x4296('0x36')][_0x4296('0x24')]);}return _0x4f306a[_0x4296('0x4e')](_0x6379ec);}})[_0x4296('0x2a')](function(_0x3841c1){if(_0x3841c1){return _0x3841c1?{'count':_0x17e212,'rows':_0x3841c1}:null;}})[_0x4296('0x2a')](respondWithResult(_0x47f668,null))[_0x4296('0x46')](handleError(_0x47f668,null));};exports['addConfiguration']=function(_0x2c2823,_0x6360e7,_0xe4cf57){if(_0x2c2823[_0x4296('0x4b')]['id']){delete _0x2c2823[_0x4296('0x4b')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x2c2823[_0x4296('0x47')]['id']}})[_0x4296('0x2a')](handleEntityNotFound(_0x6360e7,null))[_0x4296('0x2a')](function(_0x24054b){if(_0x24054b){_0x2c2823[_0x4296('0x4b')][_0x4296('0x51')]=_0x24054b['id'];_0x2c2823[_0x4296('0x4b')]['Subjects']=integrations['getSubjects'](_0x2c2823['body'][_0x4296('0x52')],_0x2c2823[_0x4296('0x4b')][_0x4296('0x34')]);_0x2c2823['body'][_0x4296('0x53')]=integrations[_0x4296('0x54')](_0x2c2823[_0x4296('0x4b')][_0x4296('0x52')],_0x2c2823['body'][_0x4296('0x34')]);return db[_0x4296('0x4c')][_0x4296('0x4a')](_0x2c2823['body'],{'include':[{'model':db[_0x4296('0x55')],'as':'Subjects'},{'model':db[_0x4296('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x6360e7,null))[_0x4296('0x46')](handleError(_0x6360e7,null));};exports['getFields']=function(_0x171ffb,_0x22ab58,_0x309225){var _0x45c839='';return db[_0x4296('0x32')][_0x4296('0x56')]({'where':{'id':_0x171ffb[_0x4296('0x47')]['id']},'attributes':['id','remoteUri',_0x4296('0x57')]})['then'](handleEntityNotFound(_0x22ab58,null))[_0x4296('0x2a')](function(_0x5aa04d){if(_0x5aa04d){_0x45c839=_0x5aa04d['remoteUri'];var _0xea86ed=_0x45c839['slice'](-0x1);if(_0xea86ed==='/'){_0x45c839=_0x45c839[_0x4296('0x58')](0x0,_0x45c839['lastIndexOf'](_0xea86ed));}return rp({'method':'GET','uri':util[_0x4296('0x59')](_0x4296('0x5a'),_0x45c839,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x4296('0x59')](_0x4296('0x5b'),new Buffer(util['format'](_0x4296('0x5c'),_0x5aa04d[_0x4296('0x57')]))['toString'](_0x4296('0x5d')))},'json':!![]});}})[_0x4296('0x2a')](function(_0x54a6c){if(_0x54a6c){var _0x1ea1de=[_0x4296('0x5e'),_0x4296('0x5f'),'agent',_0x4296('0x60'),_0x4296('0x1e'),_0x4296('0x61'),_0x4296('0x62'),_0x4296('0x63'),_0x4296('0x64'),_0x4296('0x62'),'company'];_[_0x4296('0x65')](_0x54a6c,function(_0x12efc5){return _0x1ea1de[_0x4296('0x66')](_0x12efc5[_0x4296('0x2f')])||!_0x12efc5[_0x4296('0x67')]&&_0x12efc5[_0x4296('0x34')]!==_0x4296('0x68')&&_0x12efc5[_0x4296('0x34')]!==_0x4296('0x69');});return{'count':_0x54a6c[_0x4296('0x3b')],'rows':_[_0x4296('0x31')](_0x54a6c,function(_0x5599b8){return{'id':_0x5599b8[_0x4296('0x2f')],'name':_0x5599b8[_0x4296('0x6a')],'custom':!_0x5599b8[_0x4296('0x67')],'options':_0x5599b8[_0x4296('0x6b')]?_['map'](_0x5599b8[_0x4296('0x6b')],function(_0x5b3dce){return{'name':_[_0x4296('0x6c')](_0x5b3dce),'value':_0x5b3dce};}):[]};})};}})[_0x4296('0x2a')](respondWithResult(_0x22ab58,null))[_0x4296('0x46')](function(_0x57319b){var _0x4eeaa8=_0x171ffb[_0x4296('0x36')]['test']?0x1f4:_0x57319b['statusCode']||0x1f4;logger[_0x4296('0x2d')](_0x4296('0x6d'),_0x4296('0x6e'),_0x4eeaa8,JSON[_0x4296('0x6f')](_0x57319b));delete _0x57319b[_0x4296('0x2f')];if(_0x4eeaa8===0x191){_0x4eeaa8=0x190;}_0x22ab58[_0x4296('0x1e')](_0x4eeaa8)[_0x4296('0x70')](_0x171ffb['query']['test']?{'message':_0x4296('0x71'),'statusCode':_0x57319b[_0x4296('0x72')]}:_0x57319b);});}; \ No newline at end of file +var _0x3451=['filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','findOne','FreshdeskConfiguration','rawAttributes','order','getConfigurations','addConfiguration','AccountId','getSubjects','channel','getDescriptions','Subjects','FreshdeskField','Descriptions','getFields','remoteUri','slice','substring','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','apiKey','toString','base64','requester','subject','agent','description','priority','group','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','FreshdeskAccount','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL'];(function(_0x6494dc,_0x1ca181){var _0x42a167=function(_0x461013){while(--_0x461013){_0x6494dc['push'](_0x6494dc['shift']());}};_0x42a167(++_0x1ca181);}(_0x3451,0x19a));var _0x1345=function(_0x18628c,_0x144172){_0x18628c=_0x18628c-0x0;var _0x4ca3f8=_0x3451[_0x18628c];return _0x4ca3f8;};'use strict';var emlformat=require(_0x1345('0x0'));var rimraf=require(_0x1345('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1345('0x2'));var rp=require(_0x1345('0x3'));var moment=require(_0x1345('0x4'));var BPromise=require(_0x1345('0x5'));var Mustache=require(_0x1345('0x6'));var util=require(_0x1345('0x7'));var path=require(_0x1345('0x8'));var sox=require(_0x1345('0x9'));var csv=require(_0x1345('0xa'));var ejs=require(_0x1345('0xb'));var fs=require('fs');var fs_extra=require(_0x1345('0xc'));var _=require(_0x1345('0xd'));var squel=require('squel');var crypto=require(_0x1345('0xe'));var jsforce=require(_0x1345('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1345('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1345('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1345('0x11'));var as=require(_0x1345('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1345('0x13'));var utils=require('../../config/utils');var config=require(_0x1345('0x14'));var licenseUtil=require(_0x1345('0x15'));var db=require(_0x1345('0x16'))['db'];var integrations=require(_0x1345('0x17'));function respondWithStatusCode(_0x528692,_0x3fdff0){_0x3fdff0=_0x3fdff0||0xcc;return function(_0x2cf05d){if(_0x2cf05d){return _0x528692[_0x1345('0x18')](_0x3fdff0);}return _0x528692[_0x1345('0x19')](_0x3fdff0)['end']();};}function respondWithResult(_0x181a2b,_0x426e00){_0x426e00=_0x426e00||0xc8;return function(_0x51ad9f){if(_0x51ad9f){return _0x181a2b[_0x1345('0x19')](_0x426e00)[_0x1345('0x1a')](_0x51ad9f);}};}function respondWithFilteredResult(_0x959544,_0x3cd49e){return function(_0x520e6c){if(_0x520e6c){var _0x39e839=typeof _0x3cd49e[_0x1345('0x1b')]===_0x1345('0x1c')&&typeof _0x3cd49e['limit']==='undefined';var _0x1a889a=_0x520e6c[_0x1345('0x1d')];var _0x1862eb=_0x39e839?0x0:_0x3cd49e[_0x1345('0x1b')];var _0x55b95c=_0x39e839?_0x520e6c[_0x1345('0x1d')]:_0x3cd49e[_0x1345('0x1b')]+_0x3cd49e[_0x1345('0x1e')];var _0x5f0294;if(_0x55b95c>=_0x1a889a){_0x55b95c=_0x1a889a;_0x5f0294=0xc8;}else{_0x5f0294=0xce;}_0x959544[_0x1345('0x19')](_0x5f0294);return _0x959544[_0x1345('0x1f')](_0x1345('0x20'),_0x1862eb+'-'+_0x55b95c+'/'+_0x1a889a)[_0x1345('0x1a')](_0x520e6c);}return null;};}function patchUpdates(_0x3bc681){return function(_0x246079){try{jsonpatch[_0x1345('0x21')](_0x246079,_0x3bc681,!![]);}catch(_0x4f2314){return BPromise[_0x1345('0x22')](_0x4f2314);}return _0x246079[_0x1345('0x23')]();};}function saveUpdates(_0xaf6ecc,_0x217712){return function(_0x2ddf5c){if(_0x2ddf5c){return _0x2ddf5c[_0x1345('0x24')](_0xaf6ecc)[_0x1345('0x25')](function(_0x2fd7ca){return _0x2fd7ca;});}return null;};}function removeEntity(_0x26c2a6,_0x339ea9){return function(_0x2e7206){if(_0x2e7206){return _0x2e7206[_0x1345('0x26')]()[_0x1345('0x25')](function(){_0x26c2a6['status'](0xcc)[_0x1345('0x27')]();});}};}function handleEntityNotFound(_0x4a390c,_0xd08b03){return function(_0x1c80ff){if(!_0x1c80ff){_0x4a390c[_0x1345('0x18')](0x194);}return _0x1c80ff;};}function handleError(_0x32f9a3,_0x44aa74){_0x44aa74=_0x44aa74||0x1f4;return function(_0x1b4b4f){logger[_0x1345('0x28')](_0x1b4b4f[_0x1345('0x29')]);if(_0x1b4b4f[_0x1345('0x2a')]){delete _0x1b4b4f[_0x1345('0x2a')];}_0x32f9a3[_0x1345('0x19')](_0x44aa74)[_0x1345('0x2b')](_0x1b4b4f);};}exports['index']=function(_0x3ffbdc,_0x50533b){var _0x5ac56d={},_0x2b598a={},_0x2e2b94={'count':0x0,'rows':[]};var _0x28b5dc=_[_0x1345('0x2c')](db[_0x1345('0x2d')]['rawAttributes'],function(_0x389e94){return{'name':_0x389e94[_0x1345('0x2e')],'type':_0x389e94[_0x1345('0x2f')]['key']};});_0x2b598a[_0x1345('0x30')]=_['map'](_0x28b5dc,'name');_0x2b598a[_0x1345('0x31')]=_[_0x1345('0x32')](_0x3ffbdc[_0x1345('0x31')]);_0x2b598a[_0x1345('0x33')]=_['intersection'](_0x2b598a[_0x1345('0x30')],_0x2b598a[_0x1345('0x31')]);_0x5ac56d[_0x1345('0x34')]=_[_0x1345('0x35')](_0x2b598a[_0x1345('0x30')],qs[_0x1345('0x36')](_0x3ffbdc[_0x1345('0x31')][_0x1345('0x36')]));_0x5ac56d[_0x1345('0x34')]=_0x5ac56d[_0x1345('0x34')][_0x1345('0x37')]?_0x5ac56d['attributes']:_0x2b598a[_0x1345('0x30')];if(!_0x3ffbdc[_0x1345('0x31')][_0x1345('0x38')](_0x1345('0x39'))){_0x5ac56d[_0x1345('0x1e')]=qs['limit'](_0x3ffbdc[_0x1345('0x31')]['limit']);_0x5ac56d['offset']=qs[_0x1345('0x1b')](_0x3ffbdc[_0x1345('0x31')][_0x1345('0x1b')]);}_0x5ac56d['order']=qs[_0x1345('0x3a')](_0x3ffbdc[_0x1345('0x31')][_0x1345('0x3a')]);_0x5ac56d[_0x1345('0x3b')]=qs[_0x1345('0x33')](_[_0x1345('0x3c')](_0x3ffbdc[_0x1345('0x31')],_0x2b598a['filters']),_0x28b5dc);if(_0x3ffbdc['query']['filter']){_0x5ac56d['where']=_['merge'](_0x5ac56d[_0x1345('0x3b')],{'$or':_[_0x1345('0x2c')](_0x28b5dc,function(_0x383f95){if(_0x383f95[_0x1345('0x2f')]!==_0x1345('0x3d')){var _0x48bcc7={};_0x48bcc7[_0x383f95['name']]={'$like':'%'+_0x3ffbdc[_0x1345('0x31')][_0x1345('0x3e')]+'%'};return _0x48bcc7;}})});}_0x5ac56d=_[_0x1345('0x3f')]({},_0x5ac56d,_0x3ffbdc[_0x1345('0x40')]);var _0x3fd09f={'where':_0x5ac56d[_0x1345('0x3b')]};return db['FreshdeskAccount'][_0x1345('0x1d')](_0x3fd09f)[_0x1345('0x25')](function(_0x293774){_0x2e2b94[_0x1345('0x1d')]=_0x293774;if(_0x3ffbdc['query'][_0x1345('0x41')]){_0x5ac56d[_0x1345('0x42')]=[{'all':!![]}];}return db[_0x1345('0x2d')]['findAll'](_0x5ac56d);})[_0x1345('0x25')](function(_0x2e0b27){_0x2e2b94[_0x1345('0x43')]=_0x2e0b27;return _0x2e2b94;})['then'](respondWithFilteredResult(_0x50533b,_0x5ac56d))[_0x1345('0x44')](handleError(_0x50533b,null));};exports[_0x1345('0x45')]=function(_0x2a798a,_0x1210c2){var _0x3bbc86={'raw':![],'where':{'id':_0x2a798a[_0x1345('0x46')]['id']}},_0x4f1d80={};_0x4f1d80[_0x1345('0x30')]=_[_0x1345('0x32')](db[_0x1345('0x2d')]['rawAttributes']);_0x4f1d80[_0x1345('0x31')]=_[_0x1345('0x32')](_0x2a798a[_0x1345('0x31')]);_0x4f1d80[_0x1345('0x33')]=_[_0x1345('0x35')](_0x4f1d80[_0x1345('0x30')],_0x4f1d80[_0x1345('0x31')]);_0x3bbc86[_0x1345('0x34')]=_[_0x1345('0x35')](_0x4f1d80[_0x1345('0x30')],qs[_0x1345('0x36')](_0x2a798a[_0x1345('0x31')][_0x1345('0x36')]));_0x3bbc86[_0x1345('0x34')]=_0x3bbc86[_0x1345('0x34')][_0x1345('0x37')]?_0x3bbc86['attributes']:_0x4f1d80[_0x1345('0x30')];if(_0x2a798a[_0x1345('0x31')][_0x1345('0x41')]){_0x3bbc86[_0x1345('0x42')]=[{'all':!![]}];}_0x3bbc86=_[_0x1345('0x3f')]({},_0x3bbc86,_0x2a798a[_0x1345('0x40')]);return db[_0x1345('0x2d')][_0x1345('0x47')](_0x3bbc86)[_0x1345('0x25')](handleEntityNotFound(_0x1210c2,null))[_0x1345('0x25')](respondWithResult(_0x1210c2,null))[_0x1345('0x44')](handleError(_0x1210c2,null));};exports[_0x1345('0x48')]=function(_0x1753bc,_0x5e3059){return db[_0x1345('0x2d')]['create'](_0x1753bc[_0x1345('0x49')],{})[_0x1345('0x25')](respondWithResult(_0x5e3059,0xc9))['catch'](handleError(_0x5e3059,null));};exports[_0x1345('0x24')]=function(_0x27fc27,_0x455b03){if(_0x27fc27['body']['id']){delete _0x27fc27['body']['id'];}return db['FreshdeskAccount'][_0x1345('0x47')]({'where':{'id':_0x27fc27[_0x1345('0x46')]['id']}})['then'](handleEntityNotFound(_0x455b03,null))[_0x1345('0x25')](saveUpdates(_0x27fc27[_0x1345('0x49')],null))['then'](respondWithResult(_0x455b03,null))[_0x1345('0x44')](handleError(_0x455b03,null));};exports['destroy']=function(_0x34ea34,_0x5aab90){return db[_0x1345('0x2d')][_0x1345('0x47')]({'where':{'id':_0x34ea34['params']['id']}})[_0x1345('0x25')](handleEntityNotFound(_0x5aab90,null))[_0x1345('0x25')](removeEntity(_0x5aab90,null))['catch'](handleError(_0x5aab90,null));};exports['getConfigurations']=function(_0x30428e,_0x4cf3d0,_0x190066){var _0x1adba6={};var _0x114139={};var _0x53aa7f;var _0x5d6526;return db['FreshdeskAccount'][_0x1345('0x4a')]({'where':{'id':_0x30428e[_0x1345('0x46')]['id']}})[_0x1345('0x25')](handleEntityNotFound(_0x4cf3d0,null))[_0x1345('0x25')](function(_0x52db68){if(_0x52db68){_0x53aa7f=_0x52db68;_0x114139[_0x1345('0x30')]=_['keys'](db[_0x1345('0x4b')][_0x1345('0x4c')]);_0x114139[_0x1345('0x31')]=_[_0x1345('0x32')](_0x30428e[_0x1345('0x31')]);_0x114139[_0x1345('0x33')]=_[_0x1345('0x35')](_0x114139[_0x1345('0x30')],_0x114139[_0x1345('0x31')]);_0x1adba6[_0x1345('0x34')]=_['intersection'](_0x114139[_0x1345('0x30')],qs[_0x1345('0x36')](_0x30428e[_0x1345('0x31')][_0x1345('0x36')]));_0x1adba6[_0x1345('0x34')]=_0x1adba6[_0x1345('0x34')][_0x1345('0x37')]?_0x1adba6[_0x1345('0x34')]:_0x114139[_0x1345('0x30')];_0x1adba6[_0x1345('0x4d')]=qs[_0x1345('0x3a')](_0x30428e[_0x1345('0x31')][_0x1345('0x3a')]);_0x1adba6[_0x1345('0x3b')]=qs[_0x1345('0x33')](_[_0x1345('0x3c')](_0x30428e['query'],_0x114139[_0x1345('0x33')]));if(_0x30428e[_0x1345('0x31')]['filter']){_0x1adba6[_0x1345('0x3b')]=_[_0x1345('0x3f')](_0x1adba6[_0x1345('0x3b')],{'$or':_['map'](_0x1adba6[_0x1345('0x34')],function(_0x4316c6){var _0x38a83a={};_0x38a83a[_0x4316c6]={'$like':'%'+_0x30428e[_0x1345('0x31')][_0x1345('0x3e')]+'%'};return _0x38a83a;})});}_0x1adba6=_[_0x1345('0x3f')]({},_0x1adba6,_0x30428e[_0x1345('0x40')]);return _0x53aa7f[_0x1345('0x4e')](_0x1adba6);}})[_0x1345('0x25')](function(_0x3ca0ab){if(_0x3ca0ab){_0x5d6526=_0x3ca0ab[_0x1345('0x37')];if(!_0x30428e[_0x1345('0x31')][_0x1345('0x38')](_0x1345('0x39'))){_0x1adba6['limit']=qs['limit'](_0x30428e['query'][_0x1345('0x1e')]);_0x1adba6[_0x1345('0x1b')]=qs[_0x1345('0x1b')](_0x30428e[_0x1345('0x31')][_0x1345('0x1b')]);}return _0x53aa7f[_0x1345('0x4e')](_0x1adba6);}})[_0x1345('0x25')](function(_0x24ac0b){if(_0x24ac0b){return _0x24ac0b?{'count':_0x5d6526,'rows':_0x24ac0b}:null;}})[_0x1345('0x25')](respondWithResult(_0x4cf3d0,null))[_0x1345('0x44')](handleError(_0x4cf3d0,null));};exports[_0x1345('0x4f')]=function(_0x3fbb9e,_0x12124e,_0x4c0d2d){if(_0x3fbb9e['body']['id']){delete _0x3fbb9e[_0x1345('0x49')]['id'];}return db[_0x1345('0x2d')]['findOne']({'where':{'id':_0x3fbb9e[_0x1345('0x46')]['id']}})[_0x1345('0x25')](handleEntityNotFound(_0x12124e,null))['then'](function(_0x3c6c6a){if(_0x3c6c6a){_0x3fbb9e[_0x1345('0x49')][_0x1345('0x50')]=_0x3c6c6a['id'];_0x3fbb9e[_0x1345('0x49')]['Subjects']=integrations[_0x1345('0x51')](_0x3fbb9e[_0x1345('0x49')][_0x1345('0x52')],_0x3fbb9e[_0x1345('0x49')][_0x1345('0x2f')]);_0x3fbb9e['body']['Descriptions']=integrations[_0x1345('0x53')](_0x3fbb9e[_0x1345('0x49')][_0x1345('0x52')],_0x3fbb9e[_0x1345('0x49')]['type']);return db[_0x1345('0x4b')]['create'](_0x3fbb9e[_0x1345('0x49')],{'include':[{'model':db['FreshdeskField'],'as':_0x1345('0x54')},{'model':db[_0x1345('0x55')],'as':_0x1345('0x56')}]});}return null;})['then'](respondWithResult(_0x12124e,null))[_0x1345('0x44')](handleError(_0x12124e,null));};exports[_0x1345('0x57')]=function(_0x522f23,_0xf69b9c,_0x462dbe){var _0x174968='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x522f23[_0x1345('0x46')]['id']},'attributes':['id',_0x1345('0x58'),'apiKey']})[_0x1345('0x25')](handleEntityNotFound(_0xf69b9c,null))['then'](function(_0x1b513a){if(_0x1b513a){_0x174968=_0x1b513a[_0x1345('0x58')];var _0x72fd1e=_0x174968[_0x1345('0x59')](-0x1);if(_0x72fd1e==='/'){_0x174968=_0x174968[_0x1345('0x5a')](0x0,_0x174968[_0x1345('0x5b')](_0x72fd1e));}return rp({'method':_0x1345('0x5c'),'uri':util[_0x1345('0x5d')]('%s/%s',_0x174968,_0x1345('0x5e')),'headers':{'Authorization':util[_0x1345('0x5d')](_0x1345('0x5f'),new Buffer(util[_0x1345('0x5d')]('%s:X',_0x1b513a[_0x1345('0x60')]))[_0x1345('0x61')](_0x1345('0x62')))},'json':!![]});}})['then'](function(_0x2ad676){if(_0x2ad676){var _0x40836a=[_0x1345('0x63'),_0x1345('0x64'),_0x1345('0x65'),_0x1345('0x66'),'status',_0x1345('0x67'),_0x1345('0x68'),'source',_0x1345('0x69'),_0x1345('0x68'),'company'];_[_0x1345('0x6a')](_0x2ad676,function(_0xa21a2b){return _0x40836a[_0x1345('0x6b')](_0xa21a2b['name'])||!_0xa21a2b[_0x1345('0x6c')]&&_0xa21a2b[_0x1345('0x2f')]!==_0x1345('0x6d')&&_0xa21a2b[_0x1345('0x2f')]!==_0x1345('0x6e');});return{'count':_0x2ad676[_0x1345('0x37')],'rows':_[_0x1345('0x2c')](_0x2ad676,function(_0x4b9840){return{'id':_0x4b9840[_0x1345('0x2a')],'name':_0x4b9840[_0x1345('0x6f')],'custom':!_0x4b9840[_0x1345('0x6c')],'options':_0x4b9840[_0x1345('0x70')]?_[_0x1345('0x2c')](_0x4b9840['choices'],function(_0x59cc2e){return{'name':_['capitalize'](_0x59cc2e),'value':_0x59cc2e};}):[]};})};}})[_0x1345('0x25')](respondWithResult(_0xf69b9c,null))['catch'](function(_0x23452c){var _0x159bec=_0x522f23[_0x1345('0x31')][_0x1345('0x71')]?0x1f4:_0x23452c[_0x1345('0x72')]||0x1f4;logger[_0x1345('0x28')](_0x1345('0x73'),_0x1345('0x57'),_0x159bec,JSON[_0x1345('0x74')](_0x23452c));delete _0x23452c[_0x1345('0x2a')];if(_0x159bec===0x191){_0x159bec=0x190;}_0xf69b9c[_0x1345('0x19')](_0x159bec)[_0x1345('0x2b')](_0x522f23[_0x1345('0x31')][_0x1345('0x71')]?{'message':_0x1345('0x75'),'statusCode':_0x23452c[_0x1345('0x72')]}:_0x23452c);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index d07d7a0..1bd84f1 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 _0xdbd0=['../../config/logger','api','moment','bluebird','request-promise','path','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','util'];(function(_0x58490d,_0x45ba67){var _0x16c989=function(_0x666b87){while(--_0x666b87){_0x58490d['push'](_0x58490d['shift']());}};_0x16c989(++_0x45ba67);}(_0xdbd0,0x18b));var _0x0dbd=function(_0x3bb91c,_0x5cdd77){_0x3bb91c=_0x3bb91c-0x0;var _0x4f0e58=_0xdbd0[_0x3bb91c];return _0x4f0e58;};'use strict';var _=require('lodash');var util=require(_0x0dbd('0x0'));var logger=require(_0x0dbd('0x1'))(_0x0dbd('0x2'));var moment=require(_0x0dbd('0x3'));var BPromise=require(_0x0dbd('0x4'));var rp=require(_0x0dbd('0x5'));var fs=require('fs');var path=require(_0x0dbd('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0dbd('0x7'));var integrations=require(_0x0dbd('0x8'));module[_0x0dbd('0x9')]=function(_0x26c5ad,_0x21b945){return _0x26c5ad['define'](_0x0dbd('0xa'),attributes,{'tableName':_0x0dbd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed27=['int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xed27,0x1a1));var _0x7ed2=function(_0xaf52ca,_0x50286c){_0xaf52ca=_0xaf52ca-0x0;var _0x174e1d=_0xed27[_0xaf52ca];return _0x174e1d;};'use strict';var _=require(_0x7ed2('0x0'));var util=require(_0x7ed2('0x1'));var logger=require(_0x7ed2('0x2'))(_0x7ed2('0x3'));var moment=require(_0x7ed2('0x4'));var BPromise=require(_0x7ed2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7ed2('0x6'));var config=require(_0x7ed2('0x7'));var attributes=require(_0x7ed2('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x7ed2('0x9')]=function(_0x2b5377,_0x176fff){return _0x2b5377[_0x7ed2('0xa')](_0x7ed2('0xb'),attributes,{'tableName':_0x7ed2('0xc'),'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 4f642e2..3338890 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 _0xc995=['map','model','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','include'];(function(_0xc52bf0,_0xbc1799){var _0x46d34b=function(_0x4b83a2){while(--_0x4b83a2){_0xc52bf0['push'](_0xc52bf0['shift']());}};_0x46d34b(++_0xbc1799);}(_0xc995,0x8c));var _0x5c99=function(_0x3e6000,_0x1b3399){_0x3e6000=_0x3e6000-0x0;var _0x3d92e3=_0xc995[_0x3e6000];return _0x3d92e3;};'use strict';var _=require(_0x5c99('0x0'));var util=require(_0x5c99('0x1'));var moment=require(_0x5c99('0x2'));var BPromise=require(_0x5c99('0x3'));var rs=require(_0x5c99('0x4'));var fs=require('fs');var Redis=require(_0x5c99('0x5'));var db=require(_0x5c99('0x6'))['db'];var utils=require(_0x5c99('0x7'));var logger=require('../../config/logger')(_0x5c99('0x8'));var config=require('../../config/environment');var jayson=require(_0x5c99('0x9'));var client=jayson['client'][_0x5c99('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39f127,_0x10885a,_0x22416d){return new BPromise(function(_0x570e5c,_0x105056){return client[_0x5c99('0xb')](_0x39f127,_0x22416d)[_0x5c99('0xc')](function(_0xc185b5){logger[_0x5c99('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x10885a,_0x5c99('0xe'));logger[_0x5c99('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x10885a,_0x5c99('0xe'),JSON[_0x5c99('0x10')](_0xc185b5));if(_0xc185b5[_0x5c99('0x11')]){if(_0xc185b5[_0x5c99('0x11')][_0x5c99('0x12')]===0x1f4){logger[_0x5c99('0x11')](_0x5c99('0x13'),_0x10885a,_0xc185b5[_0x5c99('0x11')]['message']);return _0x105056(_0xc185b5[_0x5c99('0x11')][_0x5c99('0x14')]);}logger[_0x5c99('0x11')](_0x5c99('0x13'),_0x10885a,_0xc185b5[_0x5c99('0x11')][_0x5c99('0x14')]);return _0x570e5c(_0xc185b5['error'][_0x5c99('0x14')]);}else{logger['info'](_0x5c99('0x13'),_0x10885a,'request\x20sent');_0x570e5c(_0xc185b5['result'][_0x5c99('0x14')]);}})[_0x5c99('0x15')](function(_0x1bbee8){logger['error'](_0x5c99('0x13'),_0x10885a,_0x1bbee8);_0x105056(_0x1bbee8);});});}exports[_0x5c99('0x16')]=function(_0x178bb4){var _0x2b0e8e=this;return new Promise(function(_0x481f0b,_0x196285){return db[_0x5c99('0x17')][_0x5c99('0x18')]({'raw':_0x178bb4['options']?_0x178bb4[_0x5c99('0x19')][_0x5c99('0x1a')]===undefined?!![]:![]:!![],'where':_0x178bb4[_0x5c99('0x19')]?_0x178bb4['options'][_0x5c99('0x1b')]||null:null,'attributes':_0x178bb4[_0x5c99('0x19')]?_0x178bb4[_0x5c99('0x19')][_0x5c99('0x1c')]||null:null,'limit':_0x178bb4[_0x5c99('0x19')]?_0x178bb4[_0x5c99('0x19')]['limit']||null:null,'include':_0x178bb4[_0x5c99('0x19')]?_0x178bb4['options'][_0x5c99('0x1d')]?_[_0x5c99('0x1e')](_0x178bb4[_0x5c99('0x19')][_0x5c99('0x1d')],function(_0x2d7071){return{'model':db[_0x2d7071[_0x5c99('0x1f')]],'as':_0x2d7071['as'],'attributes':_0x2d7071['attributes'],'include':_0x2d7071['include']?_[_0x5c99('0x1e')](_0x2d7071[_0x5c99('0x1d')],function(_0x118ebd){return{'model':db[_0x118ebd[_0x5c99('0x1f')]],'as':_0x118ebd['as'],'attributes':_0x118ebd[_0x5c99('0x1c')],'include':_0x118ebd[_0x5c99('0x1d')]?_[_0x5c99('0x1e')](_0x118ebd[_0x5c99('0x1d')],function(_0x585ab5){return{'model':db[_0x585ab5['model']],'as':_0x585ab5['as'],'attributes':_0x585ab5['attributes']};}):[]};}):[]};}):[]:[]})[_0x5c99('0xc')](function(_0x5c4c4a){logger[_0x5c99('0xd')](_0x5c99('0x16'),_0x178bb4);logger['debug']('GetFreshdeskAccount',_0x178bb4,JSON[_0x5c99('0x10')](_0x5c4c4a));_0x481f0b(_0x5c4c4a);})['catch'](function(_0x12a220){logger[_0x5c99('0x11')](_0x5c99('0x16'),_0x12a220[_0x5c99('0x14')],_0x178bb4);_0x196285(_0x2b0e8e[_0x5c99('0x11')](0x1f4,_0x12a220[_0x5c99('0x14')]));});});};exports[_0x5c99('0x20')]=function(_0x40ccfb){var _0x4f99ac=this;return new Promise(function(_0x405056,_0x226a8a){return db[_0x5c99('0x17')][_0x5c99('0x21')]({'raw':_0x40ccfb[_0x5c99('0x19')]?_0x40ccfb[_0x5c99('0x19')][_0x5c99('0x1a')]===undefined?!![]:![]:!![],'where':_0x40ccfb[_0x5c99('0x19')]?_0x40ccfb['options']['where']||null:null,'attributes':_0x40ccfb[_0x5c99('0x19')]?_0x40ccfb[_0x5c99('0x19')][_0x5c99('0x1c')]||null:null,'include':_0x40ccfb[_0x5c99('0x19')]?_0x40ccfb[_0x5c99('0x19')][_0x5c99('0x1d')]?_[_0x5c99('0x1e')](_0x40ccfb[_0x5c99('0x19')]['include'],function(_0x36c802){return{'model':db[_0x36c802[_0x5c99('0x1f')]],'as':_0x36c802['as'],'attributes':_0x36c802['attributes'],'include':_0x36c802[_0x5c99('0x1d')]?_[_0x5c99('0x1e')](_0x36c802[_0x5c99('0x1d')],function(_0x447ad8){return{'model':db[_0x447ad8[_0x5c99('0x1f')]],'as':_0x447ad8['as'],'attributes':_0x447ad8[_0x5c99('0x1c')],'include':_0x447ad8[_0x5c99('0x1d')]?_[_0x5c99('0x1e')](_0x447ad8['include'],function(_0x5f1b57){return{'model':db[_0x5f1b57[_0x5c99('0x1f')]],'as':_0x5f1b57['as'],'attributes':_0x5f1b57[_0x5c99('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5c99('0xc')](function(_0x3a4cd8){logger['info'](_0x5c99('0x20'),_0x40ccfb);logger[_0x5c99('0xf')](_0x5c99('0x20'),_0x40ccfb,JSON[_0x5c99('0x10')](_0x3a4cd8));_0x405056(_0x3a4cd8);})[_0x5c99('0x15')](function(_0x30fabc){logger[_0x5c99('0x11')](_0x5c99('0x20'),_0x30fabc['message'],_0x40ccfb);_0x226a8a(_0x4f99ac['error'](0x1f4,_0x30fabc[_0x5c99('0x14')]));});});}; \ No newline at end of file +var _0xeee4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','info','result','catch','GetFreshdeskAccount','findAll','options','raw','where','attributes','include','map','model','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xab9ed6,_0x3786b4){var _0x2ed309=function(_0xe20d25){while(--_0xe20d25){_0xab9ed6['push'](_0xab9ed6['shift']());}};_0x2ed309(++_0x3786b4);}(_0xeee4,0xfb));var _0x4eee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeee4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4eee('0x0'));var util=require(_0x4eee('0x1'));var moment=require(_0x4eee('0x2'));var BPromise=require(_0x4eee('0x3'));var rs=require(_0x4eee('0x4'));var fs=require('fs');var Redis=require(_0x4eee('0x5'));var db=require(_0x4eee('0x6'))['db'];var utils=require(_0x4eee('0x7'));var logger=require(_0x4eee('0x8'))(_0x4eee('0x9'));var config=require(_0x4eee('0xa'));var jayson=require(_0x4eee('0xb'));var client=jayson[_0x4eee('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a2a86,_0xa874ef,_0x2eb33a){return new BPromise(function(_0x1429e6,_0x5daaf6){return client[_0x4eee('0xd')](_0x4a2a86,_0x2eb33a)[_0x4eee('0xe')](function(_0x3be091){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0xa874ef,_0x4eee('0xf'));logger[_0x4eee('0x10')](_0x4eee('0x11'),_0xa874ef,_0x4eee('0xf'),JSON[_0x4eee('0x12')](_0x3be091));if(_0x3be091[_0x4eee('0x13')]){if(_0x3be091[_0x4eee('0x13')][_0x4eee('0x14')]===0x1f4){logger['error'](_0x4eee('0x15'),_0xa874ef,_0x3be091[_0x4eee('0x13')]['message']);return _0x5daaf6(_0x3be091[_0x4eee('0x13')][_0x4eee('0x16')]);}logger['error'](_0x4eee('0x15'),_0xa874ef,_0x3be091['error'][_0x4eee('0x16')]);return _0x1429e6(_0x3be091[_0x4eee('0x13')]['message']);}else{logger[_0x4eee('0x17')]('FreshdeskAccount,\x20%s,\x20%s',_0xa874ef,_0x4eee('0xf'));_0x1429e6(_0x3be091[_0x4eee('0x18')]['message']);}})[_0x4eee('0x19')](function(_0x3dff47){logger[_0x4eee('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0xa874ef,_0x3dff47);_0x5daaf6(_0x3dff47);});});}exports[_0x4eee('0x1a')]=function(_0x30d3c8){var _0x1a4437=this;return new Promise(function(_0xf9d0dc,_0x246b0e){return db['FreshdeskAccount'][_0x4eee('0x1b')]({'raw':_0x30d3c8['options']?_0x30d3c8[_0x4eee('0x1c')][_0x4eee('0x1d')]===undefined?!![]:![]:!![],'where':_0x30d3c8[_0x4eee('0x1c')]?_0x30d3c8[_0x4eee('0x1c')][_0x4eee('0x1e')]||null:null,'attributes':_0x30d3c8[_0x4eee('0x1c')]?_0x30d3c8[_0x4eee('0x1c')][_0x4eee('0x1f')]||null:null,'limit':_0x30d3c8[_0x4eee('0x1c')]?_0x30d3c8[_0x4eee('0x1c')]['limit']||null:null,'include':_0x30d3c8[_0x4eee('0x1c')]?_0x30d3c8[_0x4eee('0x1c')][_0x4eee('0x20')]?_[_0x4eee('0x21')](_0x30d3c8[_0x4eee('0x1c')][_0x4eee('0x20')],function(_0x32a3ad){return{'model':db[_0x32a3ad[_0x4eee('0x22')]],'as':_0x32a3ad['as'],'attributes':_0x32a3ad[_0x4eee('0x1f')],'include':_0x32a3ad[_0x4eee('0x20')]?_[_0x4eee('0x21')](_0x32a3ad[_0x4eee('0x20')],function(_0x53ad22){return{'model':db[_0x53ad22[_0x4eee('0x22')]],'as':_0x53ad22['as'],'attributes':_0x53ad22[_0x4eee('0x1f')],'include':_0x53ad22[_0x4eee('0x20')]?_[_0x4eee('0x21')](_0x53ad22[_0x4eee('0x20')],function(_0x502adf){return{'model':db[_0x502adf[_0x4eee('0x22')]],'as':_0x502adf['as'],'attributes':_0x502adf[_0x4eee('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4eee('0xe')](function(_0x290a4a){logger[_0x4eee('0x17')](_0x4eee('0x1a'),_0x30d3c8);logger[_0x4eee('0x10')](_0x4eee('0x1a'),_0x30d3c8,JSON[_0x4eee('0x12')](_0x290a4a));_0xf9d0dc(_0x290a4a);})['catch'](function(_0x235317){logger[_0x4eee('0x13')](_0x4eee('0x1a'),_0x235317[_0x4eee('0x16')],_0x30d3c8);_0x246b0e(_0x1a4437[_0x4eee('0x13')](0x1f4,_0x235317[_0x4eee('0x16')]));});});};exports[_0x4eee('0x23')]=function(_0x115658){var _0x13a802=this;return new Promise(function(_0x5653db,_0x5bc620){return db['FreshdeskAccount'][_0x4eee('0x24')]({'raw':_0x115658[_0x4eee('0x1c')]?_0x115658['options']['raw']===undefined?!![]:![]:!![],'where':_0x115658[_0x4eee('0x1c')]?_0x115658[_0x4eee('0x1c')]['where']||null:null,'attributes':_0x115658[_0x4eee('0x1c')]?_0x115658[_0x4eee('0x1c')]['attributes']||null:null,'include':_0x115658[_0x4eee('0x1c')]?_0x115658[_0x4eee('0x1c')][_0x4eee('0x20')]?_[_0x4eee('0x21')](_0x115658[_0x4eee('0x1c')][_0x4eee('0x20')],function(_0x1f3c80){return{'model':db[_0x1f3c80[_0x4eee('0x22')]],'as':_0x1f3c80['as'],'attributes':_0x1f3c80[_0x4eee('0x1f')],'include':_0x1f3c80[_0x4eee('0x20')]?_[_0x4eee('0x21')](_0x1f3c80['include'],function(_0x5d7d9f){return{'model':db[_0x5d7d9f[_0x4eee('0x22')]],'as':_0x5d7d9f['as'],'attributes':_0x5d7d9f['attributes'],'include':_0x5d7d9f['include']?_[_0x4eee('0x21')](_0x5d7d9f[_0x4eee('0x20')],function(_0x13b33d){return{'model':db[_0x13b33d[_0x4eee('0x22')]],'as':_0x13b33d['as'],'attributes':_0x13b33d['attributes']};}):[]};}):[]};}):[]:[]})[_0x4eee('0xe')](function(_0x408447){logger['info'](_0x4eee('0x23'),_0x115658);logger[_0x4eee('0x10')]('ShowFreshdeskAccount',_0x115658,JSON[_0x4eee('0x12')](_0x408447));_0x5653db(_0x408447);})[_0x4eee('0x19')](function(_0x3f8b60){logger[_0x4eee('0x13')](_0x4eee('0x23'),_0x3f8b60[_0x4eee('0x16')],_0x115658);_0x5bc620(_0x13a802[_0x4eee('0x13')](0x1f4,_0x3f8b60[_0x4eee('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 6014928..7485647 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 _0x987e=['../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x987e,0x1bd));var _0xe987=function(_0x4b6651,_0x20ab3d){_0x4b6651=_0x4b6651-0x0;var _0x3c867c=_0x987e[_0x4b6651];return _0x3c867c;};'use strict';var multer=require(_0xe987('0x0'));var util=require('util');var path=require(_0xe987('0x1'));var timeout=require(_0xe987('0x2'));var express=require('express');var router=express[_0xe987('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe987('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe987('0x5'));var controller=require(_0xe987('0x6'));router[_0xe987('0x7')]('/',auth[_0xe987('0x8')](),controller[_0xe987('0x9')]);router[_0xe987('0x7')](_0xe987('0xa'),auth[_0xe987('0x8')](),controller[_0xe987('0xb')]);router[_0xe987('0x7')](_0xe987('0xc'),auth[_0xe987('0x8')](),controller['getFields']);router['get'](_0xe987('0xd'),auth[_0xe987('0x8')](),controller[_0xe987('0xe')]);router[_0xe987('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe987('0xf')]);router[_0xe987('0x7')](_0xe987('0x10'),auth[_0xe987('0x8')](),controller[_0xe987('0x11')]);router[_0xe987('0x12')]('/',auth[_0xe987('0x8')](),controller[_0xe987('0x13')]);router['post']('/:id/tags',auth[_0xe987('0x8')](),controller['setTags']);router[_0xe987('0x14')]('/:id',auth[_0xe987('0x8')](),controller[_0xe987('0x15')]);router[_0xe987('0x16')](_0xe987('0xa'),auth[_0xe987('0x8')](),controller[_0xe987('0x17')]);module[_0xe987('0x18')]=router; \ No newline at end of file +var _0x49a1=['create','post','setTags','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','getDescriptions','getTags'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x49a1,0x9e));var _0x149a=function(_0x10c829,_0x166810){_0x10c829=_0x10c829-0x0;var _0x1ffcda=_0x49a1[_0x10c829];return _0x1ffcda;};'use strict';var multer=require(_0x149a('0x0'));var util=require('util');var path=require(_0x149a('0x1'));var timeout=require(_0x149a('0x2'));var express=require(_0x149a('0x3'));var router=express['Router']();var fs_extra=require(_0x149a('0x4'));var auth=require(_0x149a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x149a('0x6'));router[_0x149a('0x7')]('/',auth['isAuthenticated'](),controller[_0x149a('0x8')]);router[_0x149a('0x7')](_0x149a('0x9'),auth[_0x149a('0xa')](),controller[_0x149a('0xb')]);router[_0x149a('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x149a('0xc')]);router[_0x149a('0x7')](_0x149a('0xd'),auth[_0x149a('0xa')](),controller[_0x149a('0xe')]);router[_0x149a('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x149a('0xf')]);router[_0x149a('0x7')]('/:id/tags',auth[_0x149a('0xa')](),controller[_0x149a('0x10')]);router['post']('/',auth[_0x149a('0xa')](),controller[_0x149a('0x11')]);router[_0x149a('0x12')]('/:id/tags',auth['isAuthenticated'](),controller[_0x149a('0x13')]);router[_0x149a('0x14')](_0x149a('0x9'),auth[_0x149a('0xa')](),controller[_0x149a('0x15')]);router[_0x149a('0x16')](_0x149a('0x9'),auth['isAuthenticated'](),controller[_0x149a('0x17')]);module[_0x149a('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 1a4acde..c5b745f 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 _0xaaab=['sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xaaab,0xbe));var _0xbaaa=function(_0x4caa3a,_0x22d330){_0x4caa3a=_0x4caa3a-0x0;var _0x1777e1=_0xaaab[_0x4caa3a];return _0x1777e1;};'use strict';var Sequelize=require(_0xbaaa('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1bb9=['exports','STRING'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x1bb9,0x102));var _0x91bb=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x1bb9[_0x374ccf];return _0x443cde;};'use strict';var Sequelize=require('sequelize');module[_0x91bb('0x0')]={'name':{'type':Sequelize[_0x91bb('0x1')]},'description':{'type':Sequelize[_0x91bb('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 24e415f..ad5ecb8 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 _0x0893=['catch','show','params','keys','create','body','find','getFields','FreshdeskField','order','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x198962,_0x247f6a){var _0x35d350=function(_0x22558e){while(--_0x22558e){_0x198962['push'](_0x198962['shift']());}};_0x35d350(++_0x247f6a);}(_0x0893,0x169));var _0x3089=function(_0x5ce5a5,_0x15941d){_0x5ce5a5=_0x5ce5a5-0x0;var _0x554836=_0x0893[_0x5ce5a5];return _0x554836;};'use strict';var emlformat=require(_0x3089('0x0'));var rimraf=require(_0x3089('0x1'));var zipdir=require(_0x3089('0x2'));var jsonpatch=require(_0x3089('0x3'));var rp=require(_0x3089('0x4'));var moment=require(_0x3089('0x5'));var BPromise=require(_0x3089('0x6'));var Mustache=require(_0x3089('0x7'));var util=require('util');var path=require(_0x3089('0x8'));var sox=require('sox');var csv=require(_0x3089('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3089('0xa'));var _=require('lodash');var squel=require(_0x3089('0xb'));var crypto=require(_0x3089('0xc'));var jsforce=require(_0x3089('0xd'));var deskjs=require(_0x3089('0xe'));var toCsv=require(_0x3089('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3089('0xf'));var authService=require(_0x3089('0x10'));var qs=require(_0x3089('0x11'));var as=require(_0x3089('0x12'));var hardwareService=require(_0x3089('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3089('0x14'));var config=require(_0x3089('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3089('0x16'))['db'];function respondWithStatusCode(_0x405b15,_0x5621a4){_0x5621a4=_0x5621a4||0xcc;return function(_0x31236d){if(_0x31236d){return _0x405b15[_0x3089('0x17')](_0x5621a4);}return _0x405b15[_0x3089('0x18')](_0x5621a4)[_0x3089('0x19')]();};}function respondWithResult(_0x51b3ba,_0x5603d9){_0x5603d9=_0x5603d9||0xc8;return function(_0x571e71){if(_0x571e71){return _0x51b3ba[_0x3089('0x18')](_0x5603d9)[_0x3089('0x1a')](_0x571e71);}};}function respondWithFilteredResult(_0x57b07,_0xabeacb){return function(_0x35cb8f){if(_0x35cb8f){var _0xfb51e0=typeof _0xabeacb[_0x3089('0x1b')]===_0x3089('0x1c')&&typeof _0xabeacb[_0x3089('0x1d')]===_0x3089('0x1c');var _0x4a4d7e=_0x35cb8f[_0x3089('0x1e')];var _0x683a4=_0xfb51e0?0x0:_0xabeacb[_0x3089('0x1b')];var _0x3f4de1=_0xfb51e0?_0x35cb8f[_0x3089('0x1e')]:_0xabeacb[_0x3089('0x1b')]+_0xabeacb[_0x3089('0x1d')];var _0x9d3a69;if(_0x3f4de1>=_0x4a4d7e){_0x3f4de1=_0x4a4d7e;_0x9d3a69=0xc8;}else{_0x9d3a69=0xce;}_0x57b07[_0x3089('0x18')](_0x9d3a69);return _0x57b07[_0x3089('0x1f')](_0x3089('0x20'),_0x683a4+'-'+_0x3f4de1+'/'+_0x4a4d7e)[_0x3089('0x1a')](_0x35cb8f);}return null;};}function patchUpdates(_0x37c6e7){return function(_0x586ccc){try{jsonpatch[_0x3089('0x21')](_0x586ccc,_0x37c6e7,!![]);}catch(_0x359600){return BPromise[_0x3089('0x22')](_0x359600);}return _0x586ccc[_0x3089('0x23')]();};}function saveUpdates(_0x1b41d1,_0x113c41){return function(_0x41e7ed){if(_0x41e7ed){return _0x41e7ed[_0x3089('0x24')](_0x1b41d1)[_0x3089('0x25')](function(_0x28d6ac){return _0x28d6ac;});}return null;};}function removeEntity(_0x5ad854,_0x1df664){return function(_0x11523e){if(_0x11523e){return _0x11523e[_0x3089('0x26')]()[_0x3089('0x25')](function(){_0x5ad854[_0x3089('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4281f6,_0x162eae){return function(_0x574eb6){if(!_0x574eb6){_0x4281f6[_0x3089('0x17')](0x194);}return _0x574eb6;};}function handleError(_0x4314ec,_0x32bba4){_0x32bba4=_0x32bba4||0x1f4;return function(_0x4c93e5){logger[_0x3089('0x27')](_0x4c93e5[_0x3089('0x28')]);if(_0x4c93e5[_0x3089('0x29')]){delete _0x4c93e5['name'];}_0x4314ec[_0x3089('0x18')](_0x32bba4)[_0x3089('0x2a')](_0x4c93e5);};}exports[_0x3089('0x2b')]=function(_0x109d48,_0x1531d8){var _0x35b4a1={},_0x24457c={},_0x389efe={'count':0x0,'rows':[]};var _0x4438ee=_[_0x3089('0x2c')](db[_0x3089('0x2d')][_0x3089('0x2e')],function(_0xeab931){return{'name':_0xeab931['fieldName'],'type':_0xeab931[_0x3089('0x2f')][_0x3089('0x30')]};});_0x24457c[_0x3089('0x31')]=_[_0x3089('0x2c')](_0x4438ee,_0x3089('0x29'));_0x24457c[_0x3089('0x32')]=_['keys'](_0x109d48[_0x3089('0x32')]);_0x24457c[_0x3089('0x33')]=_['intersection'](_0x24457c[_0x3089('0x31')],_0x24457c['query']);_0x35b4a1[_0x3089('0x34')]=_[_0x3089('0x35')](_0x24457c[_0x3089('0x31')],qs[_0x3089('0x36')](_0x109d48[_0x3089('0x32')][_0x3089('0x36')]));_0x35b4a1[_0x3089('0x34')]=_0x35b4a1[_0x3089('0x34')][_0x3089('0x37')]?_0x35b4a1[_0x3089('0x34')]:_0x24457c['model'];if(!_0x109d48[_0x3089('0x32')][_0x3089('0x38')](_0x3089('0x39'))){_0x35b4a1[_0x3089('0x1d')]=qs['limit'](_0x109d48[_0x3089('0x32')][_0x3089('0x1d')]);_0x35b4a1['offset']=qs[_0x3089('0x1b')](_0x109d48[_0x3089('0x32')][_0x3089('0x1b')]);}_0x35b4a1['order']=qs[_0x3089('0x3a')](_0x109d48[_0x3089('0x32')][_0x3089('0x3a')]);_0x35b4a1[_0x3089('0x3b')]=qs[_0x3089('0x33')](_[_0x3089('0x3c')](_0x109d48[_0x3089('0x32')],_0x24457c['filters']),_0x4438ee);if(_0x109d48[_0x3089('0x32')][_0x3089('0x3d')]){_0x35b4a1[_0x3089('0x3b')]=_[_0x3089('0x3e')](_0x35b4a1[_0x3089('0x3b')],{'$or':_[_0x3089('0x2c')](_0x4438ee,function(_0x3ce538){if(_0x3ce538[_0x3089('0x2f')]!==_0x3089('0x3f')){var _0x463f1a={};_0x463f1a[_0x3ce538[_0x3089('0x29')]]={'$like':'%'+_0x109d48[_0x3089('0x32')]['filter']+'%'};return _0x463f1a;}})});}_0x35b4a1=_[_0x3089('0x3e')]({},_0x35b4a1,_0x109d48[_0x3089('0x40')]);var _0x2dc3a0={'where':_0x35b4a1[_0x3089('0x3b')]};return db['FreshdeskConfiguration'][_0x3089('0x1e')](_0x2dc3a0)['then'](function(_0x13b207){_0x389efe[_0x3089('0x1e')]=_0x13b207;if(_0x109d48[_0x3089('0x32')][_0x3089('0x41')]){_0x35b4a1[_0x3089('0x42')]=[{'all':!![]}];}return db[_0x3089('0x2d')][_0x3089('0x43')](_0x35b4a1);})['then'](function(_0x4763a9){_0x389efe[_0x3089('0x44')]=_0x4763a9;return _0x389efe;})[_0x3089('0x25')](respondWithFilteredResult(_0x1531d8,_0x35b4a1))[_0x3089('0x45')](handleError(_0x1531d8,null));};exports[_0x3089('0x46')]=function(_0x406ef3,_0x15487c){var _0xa22f25={'raw':![],'where':{'id':_0x406ef3[_0x3089('0x47')]['id']}},_0x3d1316={};_0x3d1316[_0x3089('0x31')]=_[_0x3089('0x48')](db[_0x3089('0x2d')]['rawAttributes']);_0x3d1316[_0x3089('0x32')]=_[_0x3089('0x48')](_0x406ef3['query']);_0x3d1316['filters']=_[_0x3089('0x35')](_0x3d1316[_0x3089('0x31')],_0x3d1316['query']);_0xa22f25[_0x3089('0x34')]=_[_0x3089('0x35')](_0x3d1316[_0x3089('0x31')],qs[_0x3089('0x36')](_0x406ef3[_0x3089('0x32')]['fields']));_0xa22f25[_0x3089('0x34')]=_0xa22f25[_0x3089('0x34')]['length']?_0xa22f25[_0x3089('0x34')]:_0x3d1316['model'];if(_0x406ef3[_0x3089('0x32')][_0x3089('0x41')]){_0xa22f25[_0x3089('0x42')]=[{'all':!![]}];}_0xa22f25=_[_0x3089('0x3e')]({},_0xa22f25,_0x406ef3[_0x3089('0x40')]);return db[_0x3089('0x2d')]['find'](_0xa22f25)[_0x3089('0x25')](handleEntityNotFound(_0x15487c,null))[_0x3089('0x25')](respondWithResult(_0x15487c,null))[_0x3089('0x45')](handleError(_0x15487c,null));};exports[_0x3089('0x49')]=function(_0x5d0fc0,_0x4549a0){return db[_0x3089('0x2d')][_0x3089('0x49')](_0x5d0fc0[_0x3089('0x4a')],{})[_0x3089('0x25')](respondWithResult(_0x4549a0,0xc9))['catch'](handleError(_0x4549a0,null));};exports[_0x3089('0x24')]=function(_0x28319c,_0x405b4b){if(_0x28319c[_0x3089('0x4a')]['id']){delete _0x28319c['body']['id'];}return db[_0x3089('0x2d')][_0x3089('0x4b')]({'where':{'id':_0x28319c['params']['id']}})[_0x3089('0x25')](handleEntityNotFound(_0x405b4b,null))['then'](saveUpdates(_0x28319c[_0x3089('0x4a')],null))[_0x3089('0x25')](respondWithResult(_0x405b4b,null))[_0x3089('0x45')](handleError(_0x405b4b,null));};exports[_0x3089('0x26')]=function(_0x151f18,_0x470e53){return db[_0x3089('0x2d')]['find']({'where':{'id':_0x151f18[_0x3089('0x47')]['id']}})[_0x3089('0x25')](handleEntityNotFound(_0x470e53,null))[_0x3089('0x25')](removeEntity(_0x470e53,null))[_0x3089('0x45')](handleError(_0x470e53,null));};exports[_0x3089('0x4c')]=function(_0x461472,_0x33fc0a,_0x51f87c){var _0x4bc148={};var _0x3c7774={};var _0x86a2ce;var _0x48d073;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x461472['params']['id']}})[_0x3089('0x25')](handleEntityNotFound(_0x33fc0a,null))[_0x3089('0x25')](function(_0x1f9db7){if(_0x1f9db7){_0x86a2ce=_0x1f9db7;_0x3c7774['model']=_['keys'](db[_0x3089('0x4d')]['rawAttributes']);_0x3c7774[_0x3089('0x32')]=_[_0x3089('0x48')](_0x461472['query']);_0x3c7774['filters']=_[_0x3089('0x35')](_0x3c7774[_0x3089('0x31')],_0x3c7774[_0x3089('0x32')]);_0x4bc148[_0x3089('0x34')]=_[_0x3089('0x35')](_0x3c7774[_0x3089('0x31')],qs[_0x3089('0x36')](_0x461472['query'][_0x3089('0x36')]));_0x4bc148[_0x3089('0x34')]=_0x4bc148[_0x3089('0x34')][_0x3089('0x37')]?_0x4bc148[_0x3089('0x34')]:_0x3c7774[_0x3089('0x31')];_0x4bc148[_0x3089('0x4e')]=qs['sort'](_0x461472[_0x3089('0x32')][_0x3089('0x3a')]);_0x4bc148[_0x3089('0x3b')]=qs[_0x3089('0x33')](_[_0x3089('0x3c')](_0x461472[_0x3089('0x32')],_0x3c7774[_0x3089('0x33')]));if(_0x461472[_0x3089('0x32')][_0x3089('0x3d')]){_0x4bc148[_0x3089('0x3b')]=_['merge'](_0x4bc148[_0x3089('0x3b')],{'$or':_[_0x3089('0x2c')](_0x4bc148[_0x3089('0x34')],function(_0xe8e5d6){var _0x199644={};_0x199644[_0xe8e5d6]={'$like':'%'+_0x461472[_0x3089('0x32')][_0x3089('0x3d')]+'%'};return _0x199644;})});}_0x4bc148=_[_0x3089('0x3e')]({},_0x4bc148,_0x461472[_0x3089('0x40')]);return _0x86a2ce[_0x3089('0x4c')](_0x4bc148);}})['then'](function(_0x2fd97d){if(_0x2fd97d){_0x48d073=_0x2fd97d[_0x3089('0x37')];if(!_0x461472[_0x3089('0x32')]['hasOwnProperty'](_0x3089('0x39'))){_0x4bc148[_0x3089('0x1d')]=qs[_0x3089('0x1d')](_0x461472[_0x3089('0x32')]['limit']);_0x4bc148[_0x3089('0x1b')]=qs[_0x3089('0x1b')](_0x461472[_0x3089('0x32')][_0x3089('0x1b')]);}return _0x86a2ce[_0x3089('0x4c')](_0x4bc148);}})[_0x3089('0x25')](function(_0x1c6198){if(_0x1c6198){return _0x1c6198?{'count':_0x48d073,'rows':_0x1c6198}:null;}})[_0x3089('0x25')](respondWithResult(_0x33fc0a,null))[_0x3089('0x45')](handleError(_0x33fc0a,null));};exports['getSubjects']=function(_0x362fcb,_0x2cc7d6,_0x30f215){var _0x561e0d={};var _0x4d29b3={};var _0x54f062;var _0x29d88a;return db[_0x3089('0x2d')][_0x3089('0x4f')]({'where':{'id':_0x362fcb['params']['id']}})[_0x3089('0x25')](handleEntityNotFound(_0x2cc7d6,null))[_0x3089('0x25')](function(_0xe2978b){if(_0xe2978b){_0x54f062=_0xe2978b;_0x4d29b3['model']=_['keys'](db[_0x3089('0x4d')][_0x3089('0x2e')]);_0x4d29b3['query']=_[_0x3089('0x48')](_0x362fcb[_0x3089('0x32')]);_0x4d29b3['filters']=_[_0x3089('0x35')](_0x4d29b3[_0x3089('0x31')],_0x4d29b3['query']);_0x561e0d[_0x3089('0x34')]=_[_0x3089('0x35')](_0x4d29b3[_0x3089('0x31')],qs[_0x3089('0x36')](_0x362fcb[_0x3089('0x32')][_0x3089('0x36')]));_0x561e0d[_0x3089('0x34')]=_0x561e0d[_0x3089('0x34')]['length']?_0x561e0d[_0x3089('0x34')]:_0x4d29b3[_0x3089('0x31')];_0x561e0d[_0x3089('0x4e')]=qs[_0x3089('0x3a')](_0x362fcb['query'][_0x3089('0x3a')]);_0x561e0d[_0x3089('0x3b')]=qs[_0x3089('0x33')](_['pick'](_0x362fcb[_0x3089('0x32')],_0x4d29b3[_0x3089('0x33')]));if(_0x362fcb['query'][_0x3089('0x3d')]){_0x561e0d[_0x3089('0x3b')]=_[_0x3089('0x3e')](_0x561e0d[_0x3089('0x3b')],{'$or':_[_0x3089('0x2c')](_0x561e0d[_0x3089('0x34')],function(_0x19e3ac){var _0x424ffa={};_0x424ffa[_0x19e3ac]={'$like':'%'+_0x362fcb[_0x3089('0x32')][_0x3089('0x3d')]+'%'};return _0x424ffa;})});}_0x561e0d=_['merge']({},_0x561e0d,_0x362fcb[_0x3089('0x40')]);return _0x54f062[_0x3089('0x50')](_0x561e0d);}})[_0x3089('0x25')](function(_0x41895a){if(_0x41895a){_0x29d88a=_0x41895a[_0x3089('0x37')];if(!_0x362fcb[_0x3089('0x32')]['hasOwnProperty'](_0x3089('0x39'))){_0x561e0d[_0x3089('0x1d')]=qs['limit'](_0x362fcb[_0x3089('0x32')][_0x3089('0x1d')]);_0x561e0d[_0x3089('0x1b')]=qs[_0x3089('0x1b')](_0x362fcb['query'][_0x3089('0x1b')]);}return _0x54f062['getSubjects'](_0x561e0d);}})[_0x3089('0x25')](function(_0x5a7e61){if(_0x5a7e61){return _0x5a7e61?{'count':_0x29d88a,'rows':_0x5a7e61}:null;}})['then'](respondWithResult(_0x2cc7d6,null))[_0x3089('0x45')](handleError(_0x2cc7d6,null));};exports[_0x3089('0x51')]=function(_0x4edf9d,_0x2acb50,_0x247688){var _0x309ae2={};var _0x3bd501={};var _0x3faa71;var _0x19db61;return db[_0x3089('0x2d')]['findOne']({'where':{'id':_0x4edf9d['params']['id']}})['then'](handleEntityNotFound(_0x2acb50,null))[_0x3089('0x25')](function(_0x24dbd7){if(_0x24dbd7){_0x3faa71=_0x24dbd7;_0x3bd501[_0x3089('0x31')]=_[_0x3089('0x48')](db['FreshdeskField'][_0x3089('0x2e')]);_0x3bd501[_0x3089('0x32')]=_[_0x3089('0x48')](_0x4edf9d[_0x3089('0x32')]);_0x3bd501[_0x3089('0x33')]=_['intersection'](_0x3bd501[_0x3089('0x31')],_0x3bd501[_0x3089('0x32')]);_0x309ae2[_0x3089('0x34')]=_['intersection'](_0x3bd501['model'],qs[_0x3089('0x36')](_0x4edf9d[_0x3089('0x32')][_0x3089('0x36')]));_0x309ae2[_0x3089('0x34')]=_0x309ae2[_0x3089('0x34')][_0x3089('0x37')]?_0x309ae2[_0x3089('0x34')]:_0x3bd501[_0x3089('0x31')];_0x309ae2[_0x3089('0x4e')]=qs[_0x3089('0x3a')](_0x4edf9d[_0x3089('0x32')][_0x3089('0x3a')]);_0x309ae2['where']=qs[_0x3089('0x33')](_['pick'](_0x4edf9d[_0x3089('0x32')],_0x3bd501[_0x3089('0x33')]));if(_0x4edf9d[_0x3089('0x32')][_0x3089('0x3d')]){_0x309ae2['where']=_['merge'](_0x309ae2[_0x3089('0x3b')],{'$or':_[_0x3089('0x2c')](_0x309ae2[_0x3089('0x34')],function(_0x59278c){var _0x1be935={};_0x1be935[_0x59278c]={'$like':'%'+_0x4edf9d[_0x3089('0x32')][_0x3089('0x3d')]+'%'};return _0x1be935;})});}_0x309ae2=_[_0x3089('0x3e')]({},_0x309ae2,_0x4edf9d['options']);return _0x3faa71[_0x3089('0x51')](_0x309ae2);}})['then'](function(_0x213fce){if(_0x213fce){_0x19db61=_0x213fce[_0x3089('0x37')];if(!_0x4edf9d[_0x3089('0x32')]['hasOwnProperty'](_0x3089('0x39'))){_0x309ae2[_0x3089('0x1d')]=qs[_0x3089('0x1d')](_0x4edf9d[_0x3089('0x32')]['limit']);_0x309ae2[_0x3089('0x1b')]=qs[_0x3089('0x1b')](_0x4edf9d['query']['offset']);}return _0x3faa71[_0x3089('0x51')](_0x309ae2);}})[_0x3089('0x25')](function(_0x5d5716){if(_0x5d5716){return _0x5d5716?{'count':_0x19db61,'rows':_0x5d5716}:null;}})[_0x3089('0x25')](respondWithResult(_0x2acb50,null))[_0x3089('0x45')](handleError(_0x2acb50,null));};exports[_0x3089('0x52')]=function(_0x57ad7d,_0x1bae67,_0x1c7257){var _0x50aaa6={};var _0x20e337={};var _0x3d9a93;var _0x35d538;return db[_0x3089('0x2d')]['findOne']({'where':{'id':_0x57ad7d[_0x3089('0x47')]['id']}})[_0x3089('0x25')](handleEntityNotFound(_0x1bae67,null))[_0x3089('0x25')](function(_0x49de46){if(_0x49de46){_0x3d9a93=_0x49de46;_0x20e337['model']=_['keys'](db[_0x3089('0x53')][_0x3089('0x2e')]);_0x20e337[_0x3089('0x32')]=_[_0x3089('0x48')](_0x57ad7d[_0x3089('0x32')]);_0x20e337[_0x3089('0x33')]=_[_0x3089('0x35')](_0x20e337['model'],_0x20e337[_0x3089('0x32')]);_0x50aaa6[_0x3089('0x34')]=_[_0x3089('0x35')](_0x20e337['model'],qs[_0x3089('0x36')](_0x57ad7d['query'][_0x3089('0x36')]));_0x50aaa6[_0x3089('0x34')]=_0x50aaa6[_0x3089('0x34')]['length']?_0x50aaa6['attributes']:_0x20e337[_0x3089('0x31')];_0x50aaa6[_0x3089('0x4e')]=qs['sort'](_0x57ad7d[_0x3089('0x32')][_0x3089('0x3a')]);_0x50aaa6['where']=qs['filters'](_[_0x3089('0x3c')](_0x57ad7d[_0x3089('0x32')],_0x20e337[_0x3089('0x33')]));if(_0x57ad7d[_0x3089('0x32')][_0x3089('0x3d')]){_0x50aaa6[_0x3089('0x3b')]=_[_0x3089('0x3e')](_0x50aaa6['where'],{'$or':_[_0x3089('0x2c')](_0x50aaa6['attributes'],function(_0x34d9d6){var _0x456668={};_0x456668[_0x34d9d6]={'$like':'%'+_0x57ad7d[_0x3089('0x32')][_0x3089('0x3d')]+'%'};return _0x456668;})});}_0x50aaa6=_[_0x3089('0x3e')]({},_0x50aaa6,_0x57ad7d[_0x3089('0x40')]);return _0x3d9a93[_0x3089('0x52')](_0x50aaa6);}})[_0x3089('0x25')](function(_0x5ca6f6){if(_0x5ca6f6){_0x35d538=_0x5ca6f6['length'];if(!_0x57ad7d['query'][_0x3089('0x38')](_0x3089('0x39'))){_0x50aaa6['limit']=qs[_0x3089('0x1d')](_0x57ad7d[_0x3089('0x32')][_0x3089('0x1d')]);_0x50aaa6[_0x3089('0x1b')]=qs['offset'](_0x57ad7d[_0x3089('0x32')][_0x3089('0x1b')]);}return _0x3d9a93[_0x3089('0x52')](_0x50aaa6);}})['then'](function(_0x93b958){if(_0x93b958){return _0x93b958?{'count':_0x35d538,'rows':_0x93b958}:null;}})[_0x3089('0x25')](respondWithResult(_0x1bae67,null))[_0x3089('0x45')](handleError(_0x1bae67,null));};exports[_0x3089('0x54')]=function(_0x391513,_0x135206,_0x243016){if(_0x391513[_0x3089('0x4a')]['id']){delete _0x391513[_0x3089('0x4a')]['id'];}return db[_0x3089('0x2d')][_0x3089('0x4f')]({'where':{'id':_0x391513[_0x3089('0x47')]['id']}})[_0x3089('0x25')](handleEntityNotFound(_0x135206,null))[_0x3089('0x25')](function(_0x41242e){if(_0x41242e){return _0x41242e[_0x3089('0x54')](_0x391513[_0x3089('0x4a')][_0x3089('0x55')]||[]);}return null;})[_0x3089('0x25')](respondWithResult(_0x135206,null))[_0x3089('0x45')](handleError(_0x135206,null));}; \ No newline at end of file +var _0x6fc1=['getFields','findOne','FreshdeskField','pick','getSubjects','getDescriptions','Tag','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','name','send','map','FreshdeskConfiguration','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','options','rows','params','keys','includeAll','include','catch','create','body','find'];(function(_0x3b86bc,_0x155149){var _0x1fbe0c=function(_0x2d0944){while(--_0x2d0944){_0x3b86bc['push'](_0x3b86bc['shift']());}};_0x1fbe0c(++_0x155149);}(_0x6fc1,0x14a));var _0x16fc=function(_0x529195,_0x7fb896){_0x529195=_0x529195-0x0;var _0x36cc81=_0x6fc1[_0x529195];return _0x36cc81;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16fc('0x0'));var zipdir=require(_0x16fc('0x1'));var jsonpatch=require(_0x16fc('0x2'));var rp=require(_0x16fc('0x3'));var moment=require(_0x16fc('0x4'));var BPromise=require(_0x16fc('0x5'));var Mustache=require(_0x16fc('0x6'));var util=require('util');var path=require(_0x16fc('0x7'));var sox=require(_0x16fc('0x8'));var csv=require(_0x16fc('0x9'));var ejs=require(_0x16fc('0xa'));var fs=require('fs');var fs_extra=require(_0x16fc('0xb'));var _=require(_0x16fc('0xc'));var squel=require('squel');var crypto=require(_0x16fc('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x16fc('0x9'));var querystring=require('querystring');var Papa=require(_0x16fc('0xe'));var Redis=require(_0x16fc('0xf'));var authService=require(_0x16fc('0x10'));var qs=require(_0x16fc('0x11'));var as=require(_0x16fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x16fc('0x13'))('api');var utils=require(_0x16fc('0x14'));var config=require(_0x16fc('0x15'));var licenseUtil=require(_0x16fc('0x16'));var db=require(_0x16fc('0x17'))['db'];function respondWithStatusCode(_0x237d96,_0x505175){_0x505175=_0x505175||0xcc;return function(_0x57f5fd){if(_0x57f5fd){return _0x237d96[_0x16fc('0x18')](_0x505175);}return _0x237d96[_0x16fc('0x19')](_0x505175)[_0x16fc('0x1a')]();};}function respondWithResult(_0xbf122,_0x2256e6){_0x2256e6=_0x2256e6||0xc8;return function(_0x23d8c5){if(_0x23d8c5){return _0xbf122[_0x16fc('0x19')](_0x2256e6)[_0x16fc('0x1b')](_0x23d8c5);}};}function respondWithFilteredResult(_0x4463a8,_0xe29182){return function(_0x3f448c){if(_0x3f448c){var _0x3e03f4=typeof _0xe29182[_0x16fc('0x1c')]===_0x16fc('0x1d')&&typeof _0xe29182[_0x16fc('0x1e')]==='undefined';var _0x5c8514=_0x3f448c[_0x16fc('0x1f')];var _0x461d84=_0x3e03f4?0x0:_0xe29182[_0x16fc('0x1c')];var _0xe2b9e9=_0x3e03f4?_0x3f448c[_0x16fc('0x1f')]:_0xe29182['offset']+_0xe29182[_0x16fc('0x1e')];var _0x20b119;if(_0xe2b9e9>=_0x5c8514){_0xe2b9e9=_0x5c8514;_0x20b119=0xc8;}else{_0x20b119=0xce;}_0x4463a8[_0x16fc('0x19')](_0x20b119);return _0x4463a8['set'](_0x16fc('0x20'),_0x461d84+'-'+_0xe2b9e9+'/'+_0x5c8514)[_0x16fc('0x1b')](_0x3f448c);}return null;};}function patchUpdates(_0x200368){return function(_0x5db86e){try{jsonpatch['apply'](_0x5db86e,_0x200368,!![]);}catch(_0x5c8152){return BPromise[_0x16fc('0x21')](_0x5c8152);}return _0x5db86e[_0x16fc('0x22')]();};}function saveUpdates(_0x3087dc,_0x466380){return function(_0x108d06){if(_0x108d06){return _0x108d06[_0x16fc('0x23')](_0x3087dc)[_0x16fc('0x24')](function(_0x165224){return _0x165224;});}return null;};}function removeEntity(_0x36fe04,_0x14772a){return function(_0x53ba24){if(_0x53ba24){return _0x53ba24[_0x16fc('0x25')]()['then'](function(){_0x36fe04[_0x16fc('0x19')](0xcc)[_0x16fc('0x1a')]();});}};}function handleEntityNotFound(_0x511c9a,_0x4c23c0){return function(_0x2332a4){if(!_0x2332a4){_0x511c9a[_0x16fc('0x18')](0x194);}return _0x2332a4;};}function handleError(_0x183e4b,_0x1e6932){_0x1e6932=_0x1e6932||0x1f4;return function(_0x593cc0){logger[_0x16fc('0x26')](_0x593cc0['stack']);if(_0x593cc0[_0x16fc('0x27')]){delete _0x593cc0['name'];}_0x183e4b[_0x16fc('0x19')](_0x1e6932)[_0x16fc('0x28')](_0x593cc0);};}exports['index']=function(_0x2ff906,_0x372a86){var _0x2552fe={},_0x1a7eed={},_0x452630={'count':0x0,'rows':[]};var _0x348126=_[_0x16fc('0x29')](db[_0x16fc('0x2a')][_0x16fc('0x2b')],function(_0x2b63cf){return{'name':_0x2b63cf['fieldName'],'type':_0x2b63cf[_0x16fc('0x2c')]['key']};});_0x1a7eed[_0x16fc('0x2d')]=_['map'](_0x348126,_0x16fc('0x27'));_0x1a7eed['query']=_['keys'](_0x2ff906[_0x16fc('0x2e')]);_0x1a7eed[_0x16fc('0x2f')]=_[_0x16fc('0x30')](_0x1a7eed[_0x16fc('0x2d')],_0x1a7eed['query']);_0x2552fe[_0x16fc('0x31')]=_[_0x16fc('0x30')](_0x1a7eed[_0x16fc('0x2d')],qs[_0x16fc('0x32')](_0x2ff906[_0x16fc('0x2e')][_0x16fc('0x32')]));_0x2552fe[_0x16fc('0x31')]=_0x2552fe[_0x16fc('0x31')][_0x16fc('0x33')]?_0x2552fe[_0x16fc('0x31')]:_0x1a7eed[_0x16fc('0x2d')];if(!_0x2ff906[_0x16fc('0x2e')][_0x16fc('0x34')](_0x16fc('0x35'))){_0x2552fe[_0x16fc('0x1e')]=qs[_0x16fc('0x1e')](_0x2ff906['query'][_0x16fc('0x1e')]);_0x2552fe[_0x16fc('0x1c')]=qs[_0x16fc('0x1c')](_0x2ff906[_0x16fc('0x2e')]['offset']);}_0x2552fe[_0x16fc('0x36')]=qs[_0x16fc('0x37')](_0x2ff906[_0x16fc('0x2e')][_0x16fc('0x37')]);_0x2552fe['where']=qs[_0x16fc('0x2f')](_['pick'](_0x2ff906[_0x16fc('0x2e')],_0x1a7eed[_0x16fc('0x2f')]),_0x348126);if(_0x2ff906[_0x16fc('0x2e')]['filter']){_0x2552fe['where']=_[_0x16fc('0x38')](_0x2552fe[_0x16fc('0x39')],{'$or':_['map'](_0x348126,function(_0x4fc7d){if(_0x4fc7d[_0x16fc('0x2c')]!==_0x16fc('0x3a')){var _0xa1ed45={};_0xa1ed45[_0x4fc7d['name']]={'$like':'%'+_0x2ff906[_0x16fc('0x2e')][_0x16fc('0x3b')]+'%'};return _0xa1ed45;}})});}_0x2552fe=_['merge']({},_0x2552fe,_0x2ff906[_0x16fc('0x3c')]);var _0xc73200={'where':_0x2552fe[_0x16fc('0x39')]};return db[_0x16fc('0x2a')][_0x16fc('0x1f')](_0xc73200)[_0x16fc('0x24')](function(_0x5f0188){_0x452630[_0x16fc('0x1f')]=_0x5f0188;if(_0x2ff906[_0x16fc('0x2e')]['includeAll']){_0x2552fe['include']=[{'all':!![]}];}return db[_0x16fc('0x2a')]['findAll'](_0x2552fe);})[_0x16fc('0x24')](function(_0x58201c){_0x452630[_0x16fc('0x3d')]=_0x58201c;return _0x452630;})[_0x16fc('0x24')](respondWithFilteredResult(_0x372a86,_0x2552fe))['catch'](handleError(_0x372a86,null));};exports['show']=function(_0x378400,_0x50a9ec){var _0x118e84={'raw':![],'where':{'id':_0x378400[_0x16fc('0x3e')]['id']}},_0x34cb07={};_0x34cb07[_0x16fc('0x2d')]=_['keys'](db[_0x16fc('0x2a')][_0x16fc('0x2b')]);_0x34cb07[_0x16fc('0x2e')]=_[_0x16fc('0x3f')](_0x378400[_0x16fc('0x2e')]);_0x34cb07[_0x16fc('0x2f')]=_[_0x16fc('0x30')](_0x34cb07[_0x16fc('0x2d')],_0x34cb07[_0x16fc('0x2e')]);_0x118e84['attributes']=_[_0x16fc('0x30')](_0x34cb07[_0x16fc('0x2d')],qs['fields'](_0x378400['query'][_0x16fc('0x32')]));_0x118e84['attributes']=_0x118e84[_0x16fc('0x31')][_0x16fc('0x33')]?_0x118e84[_0x16fc('0x31')]:_0x34cb07[_0x16fc('0x2d')];if(_0x378400[_0x16fc('0x2e')][_0x16fc('0x40')]){_0x118e84[_0x16fc('0x41')]=[{'all':!![]}];}_0x118e84=_[_0x16fc('0x38')]({},_0x118e84,_0x378400[_0x16fc('0x3c')]);return db[_0x16fc('0x2a')]['find'](_0x118e84)[_0x16fc('0x24')](handleEntityNotFound(_0x50a9ec,null))['then'](respondWithResult(_0x50a9ec,null))[_0x16fc('0x42')](handleError(_0x50a9ec,null));};exports[_0x16fc('0x43')]=function(_0x4a2089,_0x587ca3){return db[_0x16fc('0x2a')]['create'](_0x4a2089[_0x16fc('0x44')],{})[_0x16fc('0x24')](respondWithResult(_0x587ca3,0xc9))[_0x16fc('0x42')](handleError(_0x587ca3,null));};exports[_0x16fc('0x23')]=function(_0x565d9c,_0x390e49){if(_0x565d9c[_0x16fc('0x44')]['id']){delete _0x565d9c[_0x16fc('0x44')]['id'];}return db[_0x16fc('0x2a')][_0x16fc('0x45')]({'where':{'id':_0x565d9c[_0x16fc('0x3e')]['id']}})['then'](handleEntityNotFound(_0x390e49,null))[_0x16fc('0x24')](saveUpdates(_0x565d9c[_0x16fc('0x44')],null))[_0x16fc('0x24')](respondWithResult(_0x390e49,null))['catch'](handleError(_0x390e49,null));};exports[_0x16fc('0x25')]=function(_0x2ea1b1,_0x1c9e13){return db[_0x16fc('0x2a')]['find']({'where':{'id':_0x2ea1b1[_0x16fc('0x3e')]['id']}})[_0x16fc('0x24')](handleEntityNotFound(_0x1c9e13,null))['then'](removeEntity(_0x1c9e13,null))[_0x16fc('0x42')](handleError(_0x1c9e13,null));};exports[_0x16fc('0x46')]=function(_0x305831,_0x33d234,_0x5db277){var _0x48aac8={};var _0x4e3ca={};var _0x7ff64d;var _0x554505;return db[_0x16fc('0x2a')][_0x16fc('0x47')]({'where':{'id':_0x305831['params']['id']}})['then'](handleEntityNotFound(_0x33d234,null))[_0x16fc('0x24')](function(_0x1bad81){if(_0x1bad81){_0x7ff64d=_0x1bad81;_0x4e3ca[_0x16fc('0x2d')]=_[_0x16fc('0x3f')](db[_0x16fc('0x48')][_0x16fc('0x2b')]);_0x4e3ca[_0x16fc('0x2e')]=_[_0x16fc('0x3f')](_0x305831[_0x16fc('0x2e')]);_0x4e3ca[_0x16fc('0x2f')]=_['intersection'](_0x4e3ca[_0x16fc('0x2d')],_0x4e3ca[_0x16fc('0x2e')]);_0x48aac8[_0x16fc('0x31')]=_[_0x16fc('0x30')](_0x4e3ca[_0x16fc('0x2d')],qs[_0x16fc('0x32')](_0x305831[_0x16fc('0x2e')][_0x16fc('0x32')]));_0x48aac8[_0x16fc('0x31')]=_0x48aac8['attributes']['length']?_0x48aac8[_0x16fc('0x31')]:_0x4e3ca['model'];_0x48aac8[_0x16fc('0x36')]=qs[_0x16fc('0x37')](_0x305831[_0x16fc('0x2e')][_0x16fc('0x37')]);_0x48aac8[_0x16fc('0x39')]=qs['filters'](_[_0x16fc('0x49')](_0x305831[_0x16fc('0x2e')],_0x4e3ca[_0x16fc('0x2f')]));if(_0x305831[_0x16fc('0x2e')][_0x16fc('0x3b')]){_0x48aac8['where']=_['merge'](_0x48aac8['where'],{'$or':_['map'](_0x48aac8[_0x16fc('0x31')],function(_0x22723a){var _0x59fd08={};_0x59fd08[_0x22723a]={'$like':'%'+_0x305831[_0x16fc('0x2e')]['filter']+'%'};return _0x59fd08;})});}_0x48aac8=_[_0x16fc('0x38')]({},_0x48aac8,_0x305831[_0x16fc('0x3c')]);return _0x7ff64d[_0x16fc('0x46')](_0x48aac8);}})[_0x16fc('0x24')](function(_0x5d939e){if(_0x5d939e){_0x554505=_0x5d939e[_0x16fc('0x33')];if(!_0x305831['query'][_0x16fc('0x34')](_0x16fc('0x35'))){_0x48aac8[_0x16fc('0x1e')]=qs[_0x16fc('0x1e')](_0x305831['query'][_0x16fc('0x1e')]);_0x48aac8[_0x16fc('0x1c')]=qs['offset'](_0x305831[_0x16fc('0x2e')][_0x16fc('0x1c')]);}return _0x7ff64d['getFields'](_0x48aac8);}})[_0x16fc('0x24')](function(_0x410ad6){if(_0x410ad6){return _0x410ad6?{'count':_0x554505,'rows':_0x410ad6}:null;}})[_0x16fc('0x24')](respondWithResult(_0x33d234,null))[_0x16fc('0x42')](handleError(_0x33d234,null));};exports[_0x16fc('0x4a')]=function(_0xd41c43,_0x2adacd,_0x3cd071){var _0x59f142={};var _0xbc9016={};var _0x4d3d07;var _0x582364;return db['FreshdeskConfiguration'][_0x16fc('0x47')]({'where':{'id':_0xd41c43[_0x16fc('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2adacd,null))[_0x16fc('0x24')](function(_0x1c453c){if(_0x1c453c){_0x4d3d07=_0x1c453c;_0xbc9016[_0x16fc('0x2d')]=_[_0x16fc('0x3f')](db[_0x16fc('0x48')][_0x16fc('0x2b')]);_0xbc9016['query']=_['keys'](_0xd41c43['query']);_0xbc9016[_0x16fc('0x2f')]=_['intersection'](_0xbc9016[_0x16fc('0x2d')],_0xbc9016[_0x16fc('0x2e')]);_0x59f142[_0x16fc('0x31')]=_[_0x16fc('0x30')](_0xbc9016['model'],qs[_0x16fc('0x32')](_0xd41c43[_0x16fc('0x2e')]['fields']));_0x59f142[_0x16fc('0x31')]=_0x59f142[_0x16fc('0x31')][_0x16fc('0x33')]?_0x59f142[_0x16fc('0x31')]:_0xbc9016[_0x16fc('0x2d')];_0x59f142[_0x16fc('0x36')]=qs['sort'](_0xd41c43[_0x16fc('0x2e')][_0x16fc('0x37')]);_0x59f142[_0x16fc('0x39')]=qs[_0x16fc('0x2f')](_['pick'](_0xd41c43['query'],_0xbc9016[_0x16fc('0x2f')]));if(_0xd41c43[_0x16fc('0x2e')][_0x16fc('0x3b')]){_0x59f142[_0x16fc('0x39')]=_[_0x16fc('0x38')](_0x59f142['where'],{'$or':_[_0x16fc('0x29')](_0x59f142[_0x16fc('0x31')],function(_0x3836e0){var _0x154b2c={};_0x154b2c[_0x3836e0]={'$like':'%'+_0xd41c43[_0x16fc('0x2e')]['filter']+'%'};return _0x154b2c;})});}_0x59f142=_[_0x16fc('0x38')]({},_0x59f142,_0xd41c43['options']);return _0x4d3d07['getSubjects'](_0x59f142);}})['then'](function(_0x554f94){if(_0x554f94){_0x582364=_0x554f94['length'];if(!_0xd41c43[_0x16fc('0x2e')][_0x16fc('0x34')](_0x16fc('0x35'))){_0x59f142[_0x16fc('0x1e')]=qs['limit'](_0xd41c43[_0x16fc('0x2e')][_0x16fc('0x1e')]);_0x59f142[_0x16fc('0x1c')]=qs[_0x16fc('0x1c')](_0xd41c43[_0x16fc('0x2e')][_0x16fc('0x1c')]);}return _0x4d3d07[_0x16fc('0x4a')](_0x59f142);}})[_0x16fc('0x24')](function(_0x6a948c){if(_0x6a948c){return _0x6a948c?{'count':_0x582364,'rows':_0x6a948c}:null;}})[_0x16fc('0x24')](respondWithResult(_0x2adacd,null))[_0x16fc('0x42')](handleError(_0x2adacd,null));};exports[_0x16fc('0x4b')]=function(_0x396259,_0x119230,_0x12d463){var _0x4a5889={};var _0x594bcf={};var _0x12d479;var _0x1341c2;return db['FreshdeskConfiguration'][_0x16fc('0x47')]({'where':{'id':_0x396259[_0x16fc('0x3e')]['id']}})[_0x16fc('0x24')](handleEntityNotFound(_0x119230,null))[_0x16fc('0x24')](function(_0x15de1c){if(_0x15de1c){_0x12d479=_0x15de1c;_0x594bcf[_0x16fc('0x2d')]=_[_0x16fc('0x3f')](db[_0x16fc('0x48')][_0x16fc('0x2b')]);_0x594bcf[_0x16fc('0x2e')]=_[_0x16fc('0x3f')](_0x396259[_0x16fc('0x2e')]);_0x594bcf[_0x16fc('0x2f')]=_['intersection'](_0x594bcf['model'],_0x594bcf[_0x16fc('0x2e')]);_0x4a5889[_0x16fc('0x31')]=_[_0x16fc('0x30')](_0x594bcf[_0x16fc('0x2d')],qs['fields'](_0x396259[_0x16fc('0x2e')]['fields']));_0x4a5889[_0x16fc('0x31')]=_0x4a5889[_0x16fc('0x31')]['length']?_0x4a5889[_0x16fc('0x31')]:_0x594bcf[_0x16fc('0x2d')];_0x4a5889[_0x16fc('0x36')]=qs[_0x16fc('0x37')](_0x396259[_0x16fc('0x2e')][_0x16fc('0x37')]);_0x4a5889[_0x16fc('0x39')]=qs['filters'](_[_0x16fc('0x49')](_0x396259[_0x16fc('0x2e')],_0x594bcf[_0x16fc('0x2f')]));if(_0x396259[_0x16fc('0x2e')][_0x16fc('0x3b')]){_0x4a5889[_0x16fc('0x39')]=_[_0x16fc('0x38')](_0x4a5889[_0x16fc('0x39')],{'$or':_['map'](_0x4a5889['attributes'],function(_0x3d329a){var _0x23d46d={};_0x23d46d[_0x3d329a]={'$like':'%'+_0x396259[_0x16fc('0x2e')][_0x16fc('0x3b')]+'%'};return _0x23d46d;})});}_0x4a5889=_['merge']({},_0x4a5889,_0x396259[_0x16fc('0x3c')]);return _0x12d479[_0x16fc('0x4b')](_0x4a5889);}})[_0x16fc('0x24')](function(_0xf08e9f){if(_0xf08e9f){_0x1341c2=_0xf08e9f[_0x16fc('0x33')];if(!_0x396259[_0x16fc('0x2e')][_0x16fc('0x34')](_0x16fc('0x35'))){_0x4a5889[_0x16fc('0x1e')]=qs[_0x16fc('0x1e')](_0x396259[_0x16fc('0x2e')][_0x16fc('0x1e')]);_0x4a5889[_0x16fc('0x1c')]=qs[_0x16fc('0x1c')](_0x396259['query'][_0x16fc('0x1c')]);}return _0x12d479[_0x16fc('0x4b')](_0x4a5889);}})[_0x16fc('0x24')](function(_0x5e60ba){if(_0x5e60ba){return _0x5e60ba?{'count':_0x1341c2,'rows':_0x5e60ba}:null;}})[_0x16fc('0x24')](respondWithResult(_0x119230,null))[_0x16fc('0x42')](handleError(_0x119230,null));};exports['getTags']=function(_0x2ae9f8,_0x49bafb,_0x4adbe6){var _0x2a5a6b={};var _0x23a8c7={};var _0x3f3c6a;var _0xb119cf;return db[_0x16fc('0x2a')][_0x16fc('0x47')]({'where':{'id':_0x2ae9f8['params']['id']}})[_0x16fc('0x24')](handleEntityNotFound(_0x49bafb,null))[_0x16fc('0x24')](function(_0x41661c){if(_0x41661c){_0x3f3c6a=_0x41661c;_0x23a8c7['model']=_['keys'](db[_0x16fc('0x4c')][_0x16fc('0x2b')]);_0x23a8c7['query']=_[_0x16fc('0x3f')](_0x2ae9f8['query']);_0x23a8c7['filters']=_['intersection'](_0x23a8c7['model'],_0x23a8c7[_0x16fc('0x2e')]);_0x2a5a6b['attributes']=_['intersection'](_0x23a8c7[_0x16fc('0x2d')],qs[_0x16fc('0x32')](_0x2ae9f8[_0x16fc('0x2e')][_0x16fc('0x32')]));_0x2a5a6b[_0x16fc('0x31')]=_0x2a5a6b[_0x16fc('0x31')][_0x16fc('0x33')]?_0x2a5a6b[_0x16fc('0x31')]:_0x23a8c7['model'];_0x2a5a6b[_0x16fc('0x36')]=qs[_0x16fc('0x37')](_0x2ae9f8[_0x16fc('0x2e')][_0x16fc('0x37')]);_0x2a5a6b['where']=qs['filters'](_[_0x16fc('0x49')](_0x2ae9f8[_0x16fc('0x2e')],_0x23a8c7['filters']));if(_0x2ae9f8[_0x16fc('0x2e')][_0x16fc('0x3b')]){_0x2a5a6b[_0x16fc('0x39')]=_[_0x16fc('0x38')](_0x2a5a6b[_0x16fc('0x39')],{'$or':_[_0x16fc('0x29')](_0x2a5a6b['attributes'],function(_0x5e8c03){var _0x1c9a6c={};_0x1c9a6c[_0x5e8c03]={'$like':'%'+_0x2ae9f8['query'][_0x16fc('0x3b')]+'%'};return _0x1c9a6c;})});}_0x2a5a6b=_['merge']({},_0x2a5a6b,_0x2ae9f8[_0x16fc('0x3c')]);return _0x3f3c6a['getTags'](_0x2a5a6b);}})[_0x16fc('0x24')](function(_0x552f4b){if(_0x552f4b){_0xb119cf=_0x552f4b[_0x16fc('0x33')];if(!_0x2ae9f8[_0x16fc('0x2e')]['hasOwnProperty']('nolimit')){_0x2a5a6b['limit']=qs[_0x16fc('0x1e')](_0x2ae9f8[_0x16fc('0x2e')][_0x16fc('0x1e')]);_0x2a5a6b['offset']=qs[_0x16fc('0x1c')](_0x2ae9f8['query'][_0x16fc('0x1c')]);}return _0x3f3c6a[_0x16fc('0x4d')](_0x2a5a6b);}})[_0x16fc('0x24')](function(_0x54336c){if(_0x54336c){return _0x54336c?{'count':_0xb119cf,'rows':_0x54336c}:null;}})[_0x16fc('0x24')](respondWithResult(_0x49bafb,null))[_0x16fc('0x42')](handleError(_0x49bafb,null));};exports[_0x16fc('0x4e')]=function(_0x388a9b,_0x1f2f8b,_0x1ac188){if(_0x388a9b[_0x16fc('0x44')]['id']){delete _0x388a9b[_0x16fc('0x44')]['id'];}return db['FreshdeskConfiguration'][_0x16fc('0x47')]({'where':{'id':_0x388a9b[_0x16fc('0x3e')]['id']}})[_0x16fc('0x24')](handleEntityNotFound(_0x1f2f8b,null))[_0x16fc('0x24')](function(_0x4c2abb){if(_0x4c2abb){return _0x4c2abb[_0x16fc('0x4e')](_0x388a9b['body'][_0x16fc('0x4f')]||[]);}return null;})[_0x16fc('0x24')](respondWithResult(_0x1f2f8b,null))[_0x16fc('0x42')](handleError(_0x1f2f8b,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index e0c5a11..811521a 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 _0x6ec0=['request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','moment'];(function(_0x4cfa2e,_0x5752b5){var _0x279b50=function(_0x3f817b){while(--_0x3f817b){_0x4cfa2e['push'](_0x4cfa2e['shift']());}};_0x279b50(++_0x5752b5);}(_0x6ec0,0x110));var _0x06ec=function(_0x3276ef,_0x552350){_0x3276ef=_0x3276ef-0x0;var _0x5940f5=_0x6ec0[_0x3276ef];return _0x5940f5;};'use strict';var _=require('lodash');var util=require(_0x06ec('0x0'));var logger=require(_0x06ec('0x1'))(_0x06ec('0x2'));var moment=require(_0x06ec('0x3'));var BPromise=require('bluebird');var rp=require(_0x06ec('0x4'));var fs=require('fs');var path=require(_0x06ec('0x5'));var rimraf=require('rimraf');var config=require(_0x06ec('0x6'));var attributes=require(_0x06ec('0x7'));module[_0x06ec('0x8')]=function(_0x4003c2,_0xbf2c24){return _0x4003c2[_0x06ec('0x9')](_0x06ec('0xa'),attributes,{'tableName':_0x06ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fb8=['FreshdeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define'];(function(_0x5ce62b,_0x1d0061){var _0x4c9575=function(_0x4c6c89){while(--_0x4c6c89){_0x5ce62b['push'](_0x5ce62b['shift']());}};_0x4c9575(++_0x1d0061);}(_0x5fb8,0x187));var _0x85fb=function(_0x28ac84,_0x340089){_0x28ac84=_0x28ac84-0x0;var _0x3749b5=_0x5fb8[_0x28ac84];return _0x3749b5;};'use strict';var _=require(_0x85fb('0x0'));var util=require(_0x85fb('0x1'));var logger=require(_0x85fb('0x2'))(_0x85fb('0x3'));var moment=require(_0x85fb('0x4'));var BPromise=require(_0x85fb('0x5'));var rp=require(_0x85fb('0x6'));var fs=require('fs');var path=require(_0x85fb('0x7'));var rimraf=require(_0x85fb('0x8'));var config=require('../../config/environment');var attributes=require(_0x85fb('0x9'));module[_0x85fb('0xa')]=function(_0x2ea148,_0x1dcb2c){return _0x2ea148[_0x85fb('0xb')](_0x85fb('0xc'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 66c7df2..f6cb46c 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 _0x5056=['randomstring','../../config/logger','rpc','../../config/environment','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment'];(function(_0x18f1eb,_0x16d38a){var _0x2cce34=function(_0x5984e3){while(--_0x5984e3){_0x18f1eb['push'](_0x18f1eb['shift']());}};_0x2cce34(++_0x16d38a);}(_0x5056,0x141));var _0x6505=function(_0x3d5667,_0x49505c){_0x3d5667=_0x3d5667-0x0;var _0xf8c59=_0x5056[_0x3d5667];return _0xf8c59;};'use strict';var _=require(_0x6505('0x0'));var util=require('util');var moment=require(_0x6505('0x1'));var BPromise=require('bluebird');var rs=require(_0x6505('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6505('0x3'))(_0x6505('0x4'));var config=require(_0x6505('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6505('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481b76,_0x2914f4,_0x151e82){return new BPromise(function(_0x5b80fe,_0x389429){return client[_0x6505('0x7')](_0x481b76,_0x151e82)[_0x6505('0x8')](function(_0x13aad5){logger[_0x6505('0x9')](_0x6505('0xa'),_0x2914f4,'request\x20sent');logger[_0x6505('0xb')](_0x6505('0xc'),_0x2914f4,_0x6505('0xd'),JSON['stringify'](_0x13aad5));if(_0x13aad5['error']){if(_0x13aad5[_0x6505('0xe')][_0x6505('0xf')]===0x1f4){logger[_0x6505('0xe')](_0x6505('0xa'),_0x2914f4,_0x13aad5[_0x6505('0xe')][_0x6505('0x10')]);return _0x389429(_0x13aad5[_0x6505('0xe')]['message']);}logger[_0x6505('0xe')](_0x6505('0xa'),_0x2914f4,_0x13aad5[_0x6505('0xe')][_0x6505('0x10')]);return _0x5b80fe(_0x13aad5['error'][_0x6505('0x10')]);}else{logger[_0x6505('0x9')](_0x6505('0xa'),_0x2914f4,_0x6505('0xd'));_0x5b80fe(_0x13aad5[_0x6505('0x11')][_0x6505('0x10')]);}})[_0x6505('0x12')](function(_0x2d7930){logger[_0x6505('0xe')](_0x6505('0xa'),_0x2914f4,_0x2d7930);_0x389429(_0x2d7930);});});} \ No newline at end of file +var _0x172d=['info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskConfiguration,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x4276b3,_0x140bea){var _0x5a5140=function(_0xf76646){while(--_0xf76646){_0x4276b3['push'](_0x4276b3['shift']());}};_0x5a5140(++_0x140bea);}(_0x172d,0xff));var _0xd172=function(_0x49a982,_0x129a07){_0x49a982=_0x49a982-0x0;var _0x2a0bc9=_0x172d[_0x49a982];return _0x2a0bc9;};'use strict';var _=require(_0xd172('0x0'));var util=require('util');var moment=require(_0xd172('0x1'));var BPromise=require(_0xd172('0x2'));var rs=require(_0xd172('0x3'));var fs=require('fs');var Redis=require(_0xd172('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd172('0x5'));var logger=require('../../config/logger')(_0xd172('0x6'));var config=require(_0xd172('0x7'));var jayson=require(_0xd172('0x8'));var client=jayson['client'][_0xd172('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4aadf2,_0x48fe14,_0x10849d){return new BPromise(function(_0x530d83,_0x550329){return client['request'](_0x4aadf2,_0x10849d)[_0xd172('0xa')](function(_0x21361a){logger[_0xd172('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x48fe14,_0xd172('0xc'));logger[_0xd172('0xd')](_0xd172('0xe'),_0x48fe14,'request\x20sent',JSON[_0xd172('0xf')](_0x21361a));if(_0x21361a['error']){if(_0x21361a[_0xd172('0x10')]['code']===0x1f4){logger[_0xd172('0x10')](_0xd172('0x11'),_0x48fe14,_0x21361a[_0xd172('0x10')]['message']);return _0x550329(_0x21361a['error'][_0xd172('0x12')]);}logger['error'](_0xd172('0x11'),_0x48fe14,_0x21361a[_0xd172('0x10')][_0xd172('0x12')]);return _0x530d83(_0x21361a['error']['message']);}else{logger[_0xd172('0xb')](_0xd172('0x11'),_0x48fe14,'request\x20sent');_0x530d83(_0x21361a['result'][_0xd172('0x12')]);}})['catch'](function(_0x44b1c8){logger['error'](_0xd172('0x11'),_0x48fe14,_0x44b1c8);_0x550329(_0x44b1c8);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 32a8034..8cc24b6 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 _0x8808=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','show','update','delete'];(function(_0x102ba4,_0x32460e){var _0x2dbea4=function(_0x48b006){while(--_0x48b006){_0x102ba4['push'](_0x102ba4['shift']());}};_0x2dbea4(++_0x32460e);}(_0x8808,0x1b5));var _0x8880=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x8808[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0x8880('0x0'));var util=require(_0x8880('0x1'));var path=require(_0x8880('0x2'));var timeout=require(_0x8880('0x3'));var express=require('express');var router=express[_0x8880('0x4')]();var fs_extra=require(_0x8880('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8880('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0x8880('0x7')]('/',auth[_0x8880('0x8')](),controller['index']);router[_0x8880('0x7')](_0x8880('0x9'),auth[_0x8880('0x8')](),controller[_0x8880('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8880('0x9'),auth['isAuthenticated'](),controller[_0x8880('0xb')]);router[_0x8880('0xc')](_0x8880('0x9'),auth[_0x8880('0x8')](),controller[_0x8880('0xd')]);module[_0x8880('0xe')]=router; \ No newline at end of file +var _0x1551=['./intFreshdeskField.controller','get','index','/:id','isAuthenticated','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5cd5b9,_0x5b6d91){var _0x2ff655=function(_0x394f84){while(--_0x394f84){_0x5cd5b9['push'](_0x5cd5b9['shift']());}};_0x2ff655(++_0x5b6d91);}(_0x1551,0x129));var _0x1155=function(_0x205e5a,_0x5c19fb){_0x205e5a=_0x205e5a-0x0;var _0x10da58=_0x1551[_0x205e5a];return _0x10da58;};'use strict';var multer=require('multer');var util=require(_0x1155('0x0'));var path=require(_0x1155('0x1'));var timeout=require(_0x1155('0x2'));var express=require('express');var router=express[_0x1155('0x3')]();var fs_extra=require(_0x1155('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1155('0x5'));var config=require(_0x1155('0x6'));var controller=require(_0x1155('0x7'));router[_0x1155('0x8')]('/',auth['isAuthenticated'](),controller[_0x1155('0x9')]);router[_0x1155('0x8')](_0x1155('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x1155('0xb')](),controller['create']);router['put'](_0x1155('0xa'),auth[_0x1155('0xb')](),controller[_0x1155('0xc')]);router[_0x1155('0xd')](_0x1155('0xa'),auth[_0x1155('0xb')](),controller[_0x1155('0xe')]);module[_0x1155('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 61dbaa6..eb3d3b3 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 _0x8769=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x30cd53,_0x5b5d2f){var _0x1d459f=function(_0x5ed200){while(--_0x5ed200){_0x30cd53['push'](_0x30cd53['shift']());}};_0x1d459f(++_0x5b5d2f);}(_0x8769,0x18f));var _0x9876=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x8769[_0x9c2427];return _0x51984f;};'use strict';var Sequelize=require(_0x9876('0x0'));module[_0x9876('0x1')]={'type':{'type':Sequelize[_0x9876('0x2')](_0x9876('0x3'),_0x9876('0x4'),_0x9876('0x5'),_0x9876('0x6'),_0x9876('0x7')),'defaultValue':_0x9876('0x3')},'content':{'type':Sequelize[_0x9876('0x8')]},'key':{'type':Sequelize[_0x9876('0x8')]},'keyType':{'type':Sequelize[_0x9876('0x2')](_0x9876('0x3'),_0x9876('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9876('0x8')]},'nameField':{'type':Sequelize[_0x9876('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9876('0x8')]}}; \ No newline at end of file +var _0x5209=['BOOLEAN','sequelize','exports','ENUM','keyValue','picklist','string','STRING','variable'];(function(_0x2a5577,_0x1471fe){var _0x1159f3=function(_0x1ae3dd){while(--_0x1ae3dd){_0x2a5577['push'](_0x2a5577['shift']());}};_0x1159f3(++_0x1471fe);}(_0x5209,0x9a));var _0x9520=function(_0x8f3f8e,_0x173886){_0x8f3f8e=_0x8f3f8e-0x0;var _0x283c58=_0x5209[_0x8f3f8e];return _0x283c58;};'use strict';var Sequelize=require(_0x9520('0x0'));module[_0x9520('0x1')]={'type':{'type':Sequelize[_0x9520('0x2')]('string','variable','customVariable',_0x9520('0x3'),_0x9520('0x4')),'defaultValue':_0x9520('0x5')},'content':{'type':Sequelize[_0x9520('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9520('0x2')]('string',_0x9520('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9520('0x6')]},'nameField':{'type':Sequelize[_0x9520('0x6')]},'customField':{'type':Sequelize[_0x9520('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index d6b2a84..5f50701 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 _0xac55=['keys','filters','attributes','intersection','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','fields','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','status','error','stack','name','send','index','FreshdeskField','fieldName','type','key','model','query'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xac55,0x1c8));var _0x5ac5=function(_0x11306e,_0x2334e4){_0x11306e=_0x11306e-0x0;var _0x3dfa78=_0xac55[_0x11306e];return _0x3dfa78;};'use strict';var emlformat=require(_0x5ac5('0x0'));var rimraf=require(_0x5ac5('0x1'));var zipdir=require(_0x5ac5('0x2'));var jsonpatch=require(_0x5ac5('0x3'));var rp=require('request-promise');var moment=require(_0x5ac5('0x4'));var BPromise=require(_0x5ac5('0x5'));var Mustache=require(_0x5ac5('0x6'));var util=require(_0x5ac5('0x7'));var path=require(_0x5ac5('0x8'));var sox=require(_0x5ac5('0x9'));var csv=require(_0x5ac5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ac5('0xb'));var squel=require(_0x5ac5('0xc'));var crypto=require(_0x5ac5('0xd'));var jsforce=require(_0x5ac5('0xe'));var deskjs=require(_0x5ac5('0xf'));var toCsv=require(_0x5ac5('0xa'));var querystring=require(_0x5ac5('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ac5('0x11'));var qs=require(_0x5ac5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ac5('0x13'));var logger=require(_0x5ac5('0x14'))('api');var utils=require(_0x5ac5('0x15'));var config=require(_0x5ac5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ac5('0x17'))['db'];function respondWithStatusCode(_0x1d2b5f,_0x7c4f62){_0x7c4f62=_0x7c4f62||0xcc;return function(_0x13fad8){if(_0x13fad8){return _0x1d2b5f[_0x5ac5('0x18')](_0x7c4f62);}return _0x1d2b5f['status'](_0x7c4f62)[_0x5ac5('0x19')]();};}function respondWithResult(_0x56db18,_0x1ce256){_0x1ce256=_0x1ce256||0xc8;return function(_0x40ee8a){if(_0x40ee8a){return _0x56db18['status'](_0x1ce256)[_0x5ac5('0x1a')](_0x40ee8a);}};}function respondWithFilteredResult(_0x57377b,_0x2a145d){return function(_0x340195){if(_0x340195){var _0x30244d=typeof _0x2a145d[_0x5ac5('0x1b')]===_0x5ac5('0x1c')&&typeof _0x2a145d[_0x5ac5('0x1d')]===_0x5ac5('0x1c');var _0x5510ef=_0x340195[_0x5ac5('0x1e')];var _0x5364a6=_0x30244d?0x0:_0x2a145d[_0x5ac5('0x1b')];var _0x14d164=_0x30244d?_0x340195['count']:_0x2a145d[_0x5ac5('0x1b')]+_0x2a145d['limit'];var _0x264422;if(_0x14d164>=_0x5510ef){_0x14d164=_0x5510ef;_0x264422=0xc8;}else{_0x264422=0xce;}_0x57377b['status'](_0x264422);return _0x57377b['set'](_0x5ac5('0x1f'),_0x5364a6+'-'+_0x14d164+'/'+_0x5510ef)['json'](_0x340195);}return null;};}function patchUpdates(_0x39f3cf){return function(_0x3cb669){try{jsonpatch['apply'](_0x3cb669,_0x39f3cf,!![]);}catch(_0x4066f5){return BPromise['reject'](_0x4066f5);}return _0x3cb669[_0x5ac5('0x20')]();};}function saveUpdates(_0x40bdbc,_0x47993e){return function(_0x47a898){if(_0x47a898){return _0x47a898[_0x5ac5('0x21')](_0x40bdbc)[_0x5ac5('0x22')](function(_0x400308){return _0x400308;});}return null;};}function removeEntity(_0x182683,_0xee1c62){return function(_0x4dec2f){if(_0x4dec2f){return _0x4dec2f[_0x5ac5('0x23')]()[_0x5ac5('0x22')](function(){_0x182683[_0x5ac5('0x24')](0xcc)[_0x5ac5('0x19')]();});}};}function handleEntityNotFound(_0x4b81e2,_0x22398f){return function(_0x4eda97){if(!_0x4eda97){_0x4b81e2[_0x5ac5('0x18')](0x194);}return _0x4eda97;};}function handleError(_0x74f32b,_0x1d78cf){_0x1d78cf=_0x1d78cf||0x1f4;return function(_0x2cb82f){logger[_0x5ac5('0x25')](_0x2cb82f[_0x5ac5('0x26')]);if(_0x2cb82f['name']){delete _0x2cb82f[_0x5ac5('0x27')];}_0x74f32b['status'](_0x1d78cf)[_0x5ac5('0x28')](_0x2cb82f);};}exports[_0x5ac5('0x29')]=function(_0x35535f,_0x509db7){var _0x283c41={},_0x229941={},_0x21df31={'count':0x0,'rows':[]};var _0x21307c=_['map'](db[_0x5ac5('0x2a')]['rawAttributes'],function(_0x3414ba){return{'name':_0x3414ba[_0x5ac5('0x2b')],'type':_0x3414ba[_0x5ac5('0x2c')][_0x5ac5('0x2d')]};});_0x229941[_0x5ac5('0x2e')]=_['map'](_0x21307c,_0x5ac5('0x27'));_0x229941[_0x5ac5('0x2f')]=_[_0x5ac5('0x30')](_0x35535f['query']);_0x229941[_0x5ac5('0x31')]=_['intersection'](_0x229941[_0x5ac5('0x2e')],_0x229941[_0x5ac5('0x2f')]);_0x283c41[_0x5ac5('0x32')]=_[_0x5ac5('0x33')](_0x229941[_0x5ac5('0x2e')],qs['fields'](_0x35535f[_0x5ac5('0x2f')]['fields']));_0x283c41[_0x5ac5('0x32')]=_0x283c41['attributes'][_0x5ac5('0x34')]?_0x283c41[_0x5ac5('0x32')]:_0x229941['model'];if(!_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x35')]('nolimit')){_0x283c41['limit']=qs[_0x5ac5('0x1d')](_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x1d')]);_0x283c41[_0x5ac5('0x1b')]=qs[_0x5ac5('0x1b')](_0x35535f[_0x5ac5('0x2f')]['offset']);}_0x283c41['order']=qs['sort'](_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x36')]);_0x283c41['where']=qs[_0x5ac5('0x31')](_[_0x5ac5('0x37')](_0x35535f[_0x5ac5('0x2f')],_0x229941[_0x5ac5('0x31')]),_0x21307c);if(_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x38')]){_0x283c41[_0x5ac5('0x39')]=_[_0x5ac5('0x3a')](_0x283c41[_0x5ac5('0x39')],{'$or':_['map'](_0x21307c,function(_0x1b991e){if(_0x1b991e['type']!==_0x5ac5('0x3b')){var _0x432740={};_0x432740[_0x1b991e[_0x5ac5('0x27')]]={'$like':'%'+_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x38')]+'%'};return _0x432740;}})});}_0x283c41=_[_0x5ac5('0x3a')]({},_0x283c41,_0x35535f[_0x5ac5('0x3c')]);var _0x37cfad={'where':_0x283c41[_0x5ac5('0x39')]};return db['FreshdeskField'][_0x5ac5('0x1e')](_0x37cfad)[_0x5ac5('0x22')](function(_0x4c245b){_0x21df31['count']=_0x4c245b;if(_0x35535f[_0x5ac5('0x2f')]['includeAll']){_0x283c41[_0x5ac5('0x3d')]=[{'all':!![]}];}return db[_0x5ac5('0x2a')]['findAll'](_0x283c41);})['then'](function(_0x1e261d){_0x21df31[_0x5ac5('0x3e')]=_0x1e261d;return _0x21df31;})[_0x5ac5('0x22')](respondWithFilteredResult(_0x509db7,_0x283c41))[_0x5ac5('0x3f')](handleError(_0x509db7,null));};exports[_0x5ac5('0x40')]=function(_0x34bd04,_0x151c5e){var _0x5a86a0={'raw':!![],'where':{'id':_0x34bd04[_0x5ac5('0x41')]['id']}},_0x1d4ef5={};_0x1d4ef5[_0x5ac5('0x2e')]=_[_0x5ac5('0x30')](db[_0x5ac5('0x2a')][_0x5ac5('0x42')]);_0x1d4ef5['query']=_[_0x5ac5('0x30')](_0x34bd04[_0x5ac5('0x2f')]);_0x1d4ef5[_0x5ac5('0x31')]=_[_0x5ac5('0x33')](_0x1d4ef5['model'],_0x1d4ef5[_0x5ac5('0x2f')]);_0x5a86a0[_0x5ac5('0x32')]=_[_0x5ac5('0x33')](_0x1d4ef5['model'],qs['fields'](_0x34bd04[_0x5ac5('0x2f')][_0x5ac5('0x43')]));_0x5a86a0[_0x5ac5('0x32')]=_0x5a86a0[_0x5ac5('0x32')]['length']?_0x5a86a0[_0x5ac5('0x32')]:_0x1d4ef5['model'];if(_0x34bd04[_0x5ac5('0x2f')][_0x5ac5('0x44')]){_0x5a86a0['include']=[{'all':!![]}];}_0x5a86a0=_[_0x5ac5('0x3a')]({},_0x5a86a0,_0x34bd04['options']);return db[_0x5ac5('0x2a')][_0x5ac5('0x45')](_0x5a86a0)[_0x5ac5('0x22')](handleEntityNotFound(_0x151c5e,null))['then'](respondWithResult(_0x151c5e,null))['catch'](handleError(_0x151c5e,null));};exports[_0x5ac5('0x46')]=function(_0x1229c3,_0xd6ae55){return db[_0x5ac5('0x2a')][_0x5ac5('0x46')](_0x1229c3[_0x5ac5('0x47')],{})[_0x5ac5('0x22')](respondWithResult(_0xd6ae55,0xc9))[_0x5ac5('0x3f')](handleError(_0xd6ae55,null));};exports[_0x5ac5('0x21')]=function(_0x536765,_0x2d6aa5){if(_0x536765[_0x5ac5('0x47')]['id']){delete _0x536765[_0x5ac5('0x47')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x536765[_0x5ac5('0x41')]['id']}})[_0x5ac5('0x22')](handleEntityNotFound(_0x2d6aa5,null))[_0x5ac5('0x22')](saveUpdates(_0x536765['body'],null))[_0x5ac5('0x22')](respondWithResult(_0x2d6aa5,null))[_0x5ac5('0x3f')](handleError(_0x2d6aa5,null));};exports[_0x5ac5('0x23')]=function(_0x2a3396,_0x326f60){return db[_0x5ac5('0x2a')][_0x5ac5('0x45')]({'where':{'id':_0x2a3396['params']['id']}})['then'](handleEntityNotFound(_0x326f60,null))['then'](removeEntity(_0x326f60,null))[_0x5ac5('0x3f')](handleError(_0x326f60,null));}; \ No newline at end of file +var _0xc901=['save','update','destroy','then','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','includeAll','find','catch','create','body','params','eml-format','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x2ebba4,_0x35a255){var _0x2fe084=function(_0x172b6c){while(--_0x172b6c){_0x2ebba4['push'](_0x2ebba4['shift']());}};_0x2fe084(++_0x35a255);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x1c90('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1c90('0x1'));var BPromise=require(_0x1c90('0x2'));var Mustache=require('mustache');var util=require(_0x1c90('0x3'));var path=require(_0x1c90('0x4'));var sox=require(_0x1c90('0x5'));var csv=require(_0x1c90('0x6'));var ejs=require(_0x1c90('0x7'));var fs=require('fs');var fs_extra=require(_0x1c90('0x8'));var _=require(_0x1c90('0x9'));var squel=require(_0x1c90('0xa'));var crypto=require(_0x1c90('0xb'));var jsforce=require(_0x1c90('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1c90('0x6'));var querystring=require(_0x1c90('0xd'));var Papa=require(_0x1c90('0xe'));var Redis=require(_0x1c90('0xf'));var authService=require(_0x1c90('0x10'));var qs=require(_0x1c90('0x11'));var as=require(_0x1c90('0x12'));var hardwareService=require(_0x1c90('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1c90('0x14'));var config=require(_0x1c90('0x15'));var licenseUtil=require(_0x1c90('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4da158,_0x3a38ed){_0x3a38ed=_0x3a38ed||0xcc;return function(_0x3353e3){if(_0x3353e3){return _0x4da158['sendStatus'](_0x3a38ed);}return _0x4da158[_0x1c90('0x17')](_0x3a38ed)[_0x1c90('0x18')]();};}function respondWithResult(_0xf72b98,_0x589c97){_0x589c97=_0x589c97||0xc8;return function(_0x42cb94){if(_0x42cb94){return _0xf72b98['status'](_0x589c97)[_0x1c90('0x19')](_0x42cb94);}};}function respondWithFilteredResult(_0x210ef4,_0x7a88dc){return function(_0x42d8a4){if(_0x42d8a4){var _0x48bd5e=typeof _0x7a88dc[_0x1c90('0x1a')]==='undefined'&&typeof _0x7a88dc[_0x1c90('0x1b')]===_0x1c90('0x1c');var _0x5f1025=_0x42d8a4[_0x1c90('0x1d')];var _0x4ec354=_0x48bd5e?0x0:_0x7a88dc['offset'];var _0x128bf0=_0x48bd5e?_0x42d8a4['count']:_0x7a88dc[_0x1c90('0x1a')]+_0x7a88dc[_0x1c90('0x1b')];var _0x2a5b73;if(_0x128bf0>=_0x5f1025){_0x128bf0=_0x5f1025;_0x2a5b73=0xc8;}else{_0x2a5b73=0xce;}_0x210ef4[_0x1c90('0x17')](_0x2a5b73);return _0x210ef4['set'](_0x1c90('0x1e'),_0x4ec354+'-'+_0x128bf0+'/'+_0x5f1025)['json'](_0x42d8a4);}return null;};}function patchUpdates(_0x525997){return function(_0x38f997){try{jsonpatch[_0x1c90('0x1f')](_0x38f997,_0x525997,!![]);}catch(_0x47fd11){return BPromise[_0x1c90('0x20')](_0x47fd11);}return _0x38f997[_0x1c90('0x21')]();};}function saveUpdates(_0x445664,_0x4074fd){return function(_0x13fc42){if(_0x13fc42){return _0x13fc42[_0x1c90('0x22')](_0x445664)['then'](function(_0x418f4c){return _0x418f4c;});}return null;};}function removeEntity(_0x46baa1,_0xab232a){return function(_0x33c88b){if(_0x33c88b){return _0x33c88b[_0x1c90('0x23')]()[_0x1c90('0x24')](function(){_0x46baa1[_0x1c90('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x64ca90,_0x435c3a){return function(_0x3923a9){if(!_0x3923a9){_0x64ca90['sendStatus'](0x194);}return _0x3923a9;};}function handleError(_0xb5666e,_0x44387f){_0x44387f=_0x44387f||0x1f4;return function(_0x4abffe){logger[_0x1c90('0x25')](_0x4abffe[_0x1c90('0x26')]);if(_0x4abffe['name']){delete _0x4abffe[_0x1c90('0x27')];}_0xb5666e[_0x1c90('0x17')](_0x44387f)[_0x1c90('0x28')](_0x4abffe);};}exports[_0x1c90('0x29')]=function(_0x395edb,_0x111e20){var _0xd0a607={},_0x35c843={},_0x52c308={'count':0x0,'rows':[]};var _0xc1a571=_[_0x1c90('0x2a')](db[_0x1c90('0x2b')][_0x1c90('0x2c')],function(_0x1979de){return{'name':_0x1979de[_0x1c90('0x2d')],'type':_0x1979de[_0x1c90('0x2e')][_0x1c90('0x2f')]};});_0x35c843[_0x1c90('0x30')]=_[_0x1c90('0x2a')](_0xc1a571,_0x1c90('0x27'));_0x35c843['query']=_[_0x1c90('0x31')](_0x395edb[_0x1c90('0x32')]);_0x35c843['filters']=_[_0x1c90('0x33')](_0x35c843['model'],_0x35c843[_0x1c90('0x32')]);_0xd0a607['attributes']=_[_0x1c90('0x33')](_0x35c843['model'],qs[_0x1c90('0x34')](_0x395edb[_0x1c90('0x32')]['fields']));_0xd0a607[_0x1c90('0x35')]=_0xd0a607[_0x1c90('0x35')]['length']?_0xd0a607[_0x1c90('0x35')]:_0x35c843[_0x1c90('0x30')];if(!_0x395edb[_0x1c90('0x32')][_0x1c90('0x36')](_0x1c90('0x37'))){_0xd0a607['limit']=qs['limit'](_0x395edb['query']['limit']);_0xd0a607['offset']=qs[_0x1c90('0x1a')](_0x395edb[_0x1c90('0x32')][_0x1c90('0x1a')]);}_0xd0a607['order']=qs[_0x1c90('0x38')](_0x395edb['query'][_0x1c90('0x38')]);_0xd0a607[_0x1c90('0x39')]=qs['filters'](_['pick'](_0x395edb[_0x1c90('0x32')],_0x35c843[_0x1c90('0x3a')]),_0xc1a571);if(_0x395edb[_0x1c90('0x32')][_0x1c90('0x3b')]){_0xd0a607[_0x1c90('0x39')]=_[_0x1c90('0x3c')](_0xd0a607[_0x1c90('0x39')],{'$or':_['map'](_0xc1a571,function(_0x508025){if(_0x508025[_0x1c90('0x2e')]!==_0x1c90('0x3d')){var _0x134501={};_0x134501[_0x508025[_0x1c90('0x27')]]={'$like':'%'+_0x395edb[_0x1c90('0x32')][_0x1c90('0x3b')]+'%'};return _0x134501;}})});}_0xd0a607=_[_0x1c90('0x3c')]({},_0xd0a607,_0x395edb[_0x1c90('0x3e')]);var _0x398ee9={'where':_0xd0a607[_0x1c90('0x39')]};return db['FreshdeskField'][_0x1c90('0x1d')](_0x398ee9)['then'](function(_0x5a8eea){_0x52c308[_0x1c90('0x1d')]=_0x5a8eea;if(_0x395edb['query']['includeAll']){_0xd0a607[_0x1c90('0x3f')]=[{'all':!![]}];}return db[_0x1c90('0x2b')]['findAll'](_0xd0a607);})[_0x1c90('0x24')](function(_0x3271ea){_0x52c308[_0x1c90('0x40')]=_0x3271ea;return _0x52c308;})[_0x1c90('0x24')](respondWithFilteredResult(_0x111e20,_0xd0a607))['catch'](handleError(_0x111e20,null));};exports['show']=function(_0x19e689,_0x171ca0){var _0x5680fe={'raw':!![],'where':{'id':_0x19e689['params']['id']}},_0x35952a={};_0x35952a[_0x1c90('0x30')]=_[_0x1c90('0x31')](db['FreshdeskField'][_0x1c90('0x2c')]);_0x35952a[_0x1c90('0x32')]=_[_0x1c90('0x31')](_0x19e689[_0x1c90('0x32')]);_0x35952a[_0x1c90('0x3a')]=_[_0x1c90('0x33')](_0x35952a[_0x1c90('0x30')],_0x35952a[_0x1c90('0x32')]);_0x5680fe[_0x1c90('0x35')]=_[_0x1c90('0x33')](_0x35952a[_0x1c90('0x30')],qs['fields'](_0x19e689[_0x1c90('0x32')]['fields']));_0x5680fe[_0x1c90('0x35')]=_0x5680fe['attributes']['length']?_0x5680fe[_0x1c90('0x35')]:_0x35952a[_0x1c90('0x30')];if(_0x19e689[_0x1c90('0x32')][_0x1c90('0x41')]){_0x5680fe[_0x1c90('0x3f')]=[{'all':!![]}];}_0x5680fe=_[_0x1c90('0x3c')]({},_0x5680fe,_0x19e689[_0x1c90('0x3e')]);return db[_0x1c90('0x2b')][_0x1c90('0x42')](_0x5680fe)['then'](handleEntityNotFound(_0x171ca0,null))['then'](respondWithResult(_0x171ca0,null))[_0x1c90('0x43')](handleError(_0x171ca0,null));};exports[_0x1c90('0x44')]=function(_0x68fac8,_0x2d30f5){return db[_0x1c90('0x2b')][_0x1c90('0x44')](_0x68fac8[_0x1c90('0x45')],{})[_0x1c90('0x24')](respondWithResult(_0x2d30f5,0xc9))['catch'](handleError(_0x2d30f5,null));};exports[_0x1c90('0x22')]=function(_0x24016a,_0x9524b6){if(_0x24016a['body']['id']){delete _0x24016a['body']['id'];}return db[_0x1c90('0x2b')]['find']({'where':{'id':_0x24016a[_0x1c90('0x46')]['id']}})['then'](handleEntityNotFound(_0x9524b6,null))['then'](saveUpdates(_0x24016a[_0x1c90('0x45')],null))[_0x1c90('0x24')](respondWithResult(_0x9524b6,null))['catch'](handleError(_0x9524b6,null));};exports['destroy']=function(_0x394177,_0x53f158){return db[_0x1c90('0x2b')][_0x1c90('0x42')]({'where':{'id':_0x394177[_0x1c90('0x46')]['id']}})[_0x1c90('0x24')](handleEntityNotFound(_0x53f158,null))['then'](removeEntity(_0x53f158,null))['catch'](handleError(_0x53f158,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 67681dc..017b9bb 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 _0x7568=['FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField'];(function(_0x19f670,_0x36d23f){var _0x3ffd49=function(_0x5d9e05){while(--_0x5d9e05){_0x19f670['push'](_0x19f670['shift']());}};_0x3ffd49(++_0x36d23f);}(_0x7568,0xd1));var _0x8756=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x7568[_0x5627e1];return _0x2f013f;};'use strict';var _=require(_0x8756('0x0'));var util=require(_0x8756('0x1'));var logger=require('../../config/logger')(_0x8756('0x2'));var moment=require(_0x8756('0x3'));var BPromise=require(_0x8756('0x4'));var rp=require(_0x8756('0x5'));var fs=require('fs');var path=require(_0x8756('0x6'));var rimraf=require(_0x8756('0x7'));var config=require(_0x8756('0x8'));var attributes=require(_0x8756('0x9'));module[_0x8756('0xa')]=function(_0x380c86,_0x59dfb2){return _0x380c86[_0x8756('0xb')](_0x8756('0xc'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x8756('0xd'),'fields':[_0x8756('0xe'),_0x8756('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9c1e=['freshdesk_unique_index','idField','FieldId','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields'];(function(_0x422d33,_0x2f0040){var _0x3604a2=function(_0x3b8887){while(--_0x3b8887){_0x422d33['push'](_0x422d33['shift']());}};_0x3604a2(++_0x2f0040);}(_0x9c1e,0xd3));var _0xe9c1=function(_0x296084,_0x4f3c97){_0x296084=_0x296084-0x0;var _0x3924f6=_0x9c1e[_0x296084];return _0x3924f6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe9c1('0x0'));var moment=require(_0xe9c1('0x1'));var BPromise=require(_0xe9c1('0x2'));var rp=require(_0xe9c1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9c1('0x4'));var config=require(_0xe9c1('0x5'));var attributes=require(_0xe9c1('0x6'));module['exports']=function(_0x385269,_0x45dc84){return _0x385269[_0xe9c1('0x7')](_0xe9c1('0x8'),attributes,{'tableName':_0xe9c1('0x9'),'paranoid':![],'indexes':[{'name':_0xe9c1('0xa'),'fields':[_0xe9c1('0xb'),_0xe9c1('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 9cb24e6..70451f0 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 _0xa053=['debug','stringify','error','code','message','FreshdeskField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent'];(function(_0x1013a8,_0x359e67){var _0x41dd8a=function(_0x4d59c0){while(--_0x4d59c0){_0x1013a8['push'](_0x1013a8['shift']());}};_0x41dd8a(++_0x359e67);}(_0xa053,0xee));var _0x3a05=function(_0x29aa6d,_0x5b138b){_0x29aa6d=_0x29aa6d-0x0;var _0x4e7e21=_0xa053[_0x29aa6d];return _0x4e7e21;};'use strict';var _=require(_0x3a05('0x0'));var util=require(_0x3a05('0x1'));var moment=require('moment');var BPromise=require(_0x3a05('0x2'));var rs=require(_0x3a05('0x3'));var fs=require('fs');var Redis=require(_0x3a05('0x4'));var db=require(_0x3a05('0x5'))['db'];var utils=require(_0x3a05('0x6'));var logger=require(_0x3a05('0x7'))(_0x3a05('0x8'));var config=require(_0x3a05('0x9'));var jayson=require(_0x3a05('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d653f,_0x244cc1,_0x5bcb2a){return new BPromise(function(_0xb07184,_0x1d724d){return client[_0x3a05('0xb')](_0x4d653f,_0x5bcb2a)[_0x3a05('0xc')](function(_0x4969f8){logger[_0x3a05('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x244cc1,_0x3a05('0xe'));logger[_0x3a05('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x244cc1,'request\x20sent',JSON[_0x3a05('0x10')](_0x4969f8));if(_0x4969f8[_0x3a05('0x11')]){if(_0x4969f8[_0x3a05('0x11')][_0x3a05('0x12')]===0x1f4){logger[_0x3a05('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x244cc1,_0x4969f8[_0x3a05('0x11')][_0x3a05('0x13')]);return _0x1d724d(_0x4969f8[_0x3a05('0x11')][_0x3a05('0x13')]);}logger[_0x3a05('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x244cc1,_0x4969f8[_0x3a05('0x11')][_0x3a05('0x13')]);return _0xb07184(_0x4969f8[_0x3a05('0x11')][_0x3a05('0x13')]);}else{logger[_0x3a05('0xd')](_0x3a05('0x14'),_0x244cc1,_0x3a05('0xe'));_0xb07184(_0x4969f8[_0x3a05('0x15')][_0x3a05('0x13')]);}})[_0x3a05('0x16')](function(_0x1af39e){logger['error'](_0x3a05('0x14'),_0x244cc1,_0x1af39e);_0x1d724d(_0x1af39e);});});} \ No newline at end of file +var _0x9ba3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../config/utils'];(function(_0x11d4d5,_0x56e0e3){var _0x2de761=function(_0x677f08){while(--_0x677f08){_0x11d4d5['push'](_0x11d4d5['shift']());}};_0x2de761(++_0x56e0e3);}(_0x9ba3,0x161));var _0x39ba=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9ba3[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x39ba('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x39ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x39ba('0x3'));var logger=require(_0x39ba('0x4'))(_0x39ba('0x5'));var config=require(_0x39ba('0x6'));var jayson=require(_0x39ba('0x7'));var client=jayson[_0x39ba('0x8')][_0x39ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x125c9c,_0x37ac7c,_0x453237){return new BPromise(function(_0x1e2973,_0x2e1c39){return client['request'](_0x125c9c,_0x453237)['then'](function(_0x50c1ad){logger[_0x39ba('0xa')](_0x39ba('0xb'),_0x37ac7c,'request\x20sent');logger[_0x39ba('0xc')](_0x39ba('0xd'),_0x37ac7c,_0x39ba('0xe'),JSON[_0x39ba('0xf')](_0x50c1ad));if(_0x50c1ad[_0x39ba('0x10')]){if(_0x50c1ad[_0x39ba('0x10')][_0x39ba('0x11')]===0x1f4){logger[_0x39ba('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x37ac7c,_0x50c1ad['error']['message']);return _0x2e1c39(_0x50c1ad[_0x39ba('0x10')][_0x39ba('0x12')]);}logger[_0x39ba('0x10')](_0x39ba('0xb'),_0x37ac7c,_0x50c1ad['error'][_0x39ba('0x12')]);return _0x1e2973(_0x50c1ad['error'][_0x39ba('0x12')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x37ac7c,'request\x20sent');_0x1e2973(_0x50c1ad[_0x39ba('0x13')][_0x39ba('0x12')]);}})[_0x39ba('0x14')](function(_0x28dc60){logger[_0x39ba('0x10')](_0x39ba('0xb'),_0x37ac7c,_0x28dc60);_0x2e1c39(_0x28dc60);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 0469779..6f3c16f 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 _0x16d2=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x16d2,0x123));var _0x216d=function(_0x28696d,_0xb860b0){_0x28696d=_0x28696d-0x0;var _0x446708=_0x16d2[_0x28696d];return _0x446708;};'use strict';var multer=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var path=require(_0x216d('0x2'));var timeout=require(_0x216d('0x3'));var express=require(_0x216d('0x4'));var router=express[_0x216d('0x5')]();var fs_extra=require(_0x216d('0x6'));var auth=require(_0x216d('0x7'));var interaction=require(_0x216d('0x8'));var config=require('../../config/environment');var controller=require(_0x216d('0x9'));router[_0x216d('0xa')]('/',auth[_0x216d('0xb')](),controller[_0x216d('0xc')]);router[_0x216d('0xa')](_0x216d('0xd'),auth[_0x216d('0xb')](),controller[_0x216d('0xe')]);router['get'](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x10')]);router[_0x216d('0xa')](_0x216d('0x11'),auth[_0x216d('0xb')](),controller['getFields']);router[_0x216d('0x12')]('/',auth['isAuthenticated'](),controller[_0x216d('0x13')]);router[_0x216d('0x12')](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x14')]);router[_0x216d('0x15')]('/:id',auth[_0x216d('0xb')](),controller['update']);router[_0x216d('0x16')](_0x216d('0xd'),auth['isAuthenticated'](),controller[_0x216d('0x17')]);module[_0x216d('0x18')]=router; \ No newline at end of file +var _0xb9be=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x4e0553,_0x5b9049){var _0x53b5a2=function(_0x3e8eaa){while(--_0x3e8eaa){_0x4e0553['push'](_0x4e0553['shift']());}};_0x53b5a2(++_0x5b9049);}(_0xb9be,0xc5));var _0xeb9b=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0xb9be[_0xbc4560];return _0x298cfb;};'use strict';var multer=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var path=require(_0xeb9b('0x2'));var timeout=require(_0xeb9b('0x3'));var express=require(_0xeb9b('0x4'));var router=express[_0xeb9b('0x5')]();var fs_extra=require(_0xeb9b('0x6'));var auth=require(_0xeb9b('0x7'));var interaction=require(_0xeb9b('0x8'));var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router[_0xeb9b('0x9')]('/',auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xb')]);router['get'](_0xeb9b('0xc'),auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xd')]);router[_0xeb9b('0x9')](_0xeb9b('0xe'),auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xf')]);router[_0xeb9b('0x9')](_0xeb9b('0x10'),auth['isAuthenticated'](),controller[_0xeb9b('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xeb9b('0x12')]);router[_0xeb9b('0x13')]('/:id/configurations',auth[_0xeb9b('0xa')](),controller[_0xeb9b('0x14')]);router[_0xeb9b('0x15')](_0xeb9b('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xeb9b('0xc'),auth[_0xeb9b('0xa')](),controller[_0xeb9b('0x16')]);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 8961ef1..450d117 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 _0xd4a2=['STRING','username','sequelize'];(function(_0x5f4a17,_0xb78130){var _0x1fc7d5=function(_0x5791ca){while(--_0x5791ca){_0x5f4a17['push'](_0x5f4a17['shift']());}};_0x1fc7d5(++_0xb78130);}(_0xd4a2,0x173));var _0x2d4a=function(_0x579263,_0x29626e){_0x579263=_0x579263-0x0;var _0x1585b9=_0xd4a2[_0x579263];return _0x1585b9;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2d4a('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x2d4a('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2d4a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2d4a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x7880=['exports','STRING','username','remoteUri'];(function(_0x42e6ce,_0x511000){var _0xbe41a7=function(_0xb233c0){while(--_0xb233c0){_0x42e6ce['push'](_0x42e6ce['shift']());}};_0xbe41a7(++_0x511000);}(_0x7880,0x1f4));var _0x0788=function(_0x178668,_0x1ec300){_0x178668=_0x178668-0x0;var _0x26107d=_0x7880[_0x178668];return _0x26107d;};'use strict';var Sequelize=require('sequelize');module[_0x0788('0x0')]={'name':{'type':Sequelize[_0x0788('0x1')]},'description':{'type':Sequelize[_0x0788('0x1')]},'username':{'type':Sequelize[_0x0788('0x1')],'unique':_0x0788('0x2')},'apiKey':{'type':Sequelize[_0x0788('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0788('0x3')},'serverUrl':{'type':Sequelize[_0x0788('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index beb36c5..5ebde2d 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 _0xd4a9=['FreshsalesField','getFields','username','remoteUri','slice','lastIndexOf','format','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','stringify','send','eml-format','rimraf','request-promise','moment','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','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','sendStatus','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','FreshsalesAccount','includeAll','include','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration'];(function(_0x2ad9ae,_0x29a5f0){var _0x36a84a=function(_0x23f86f){while(--_0x23f86f){_0x2ad9ae['push'](_0x2ad9ae['shift']());}};_0x36a84a(++_0x29a5f0);}(_0xd4a9,0x144));var _0x9d4a=function(_0x13ca63,_0x31882a){_0x13ca63=_0x13ca63-0x0;var _0xbf36a9=_0xd4a9[_0x13ca63];return _0xbf36a9;};'use strict';var emlformat=require(_0x9d4a('0x0'));var rimraf=require(_0x9d4a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d4a('0x2'));var moment=require(_0x9d4a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9d4a('0x4'));var util=require('util');var path=require(_0x9d4a('0x5'));var sox=require(_0x9d4a('0x6'));var csv=require(_0x9d4a('0x7'));var ejs=require(_0x9d4a('0x8'));var fs=require('fs');var fs_extra=require(_0x9d4a('0x9'));var _=require(_0x9d4a('0xa'));var squel=require('squel');var crypto=require(_0x9d4a('0xb'));var jsforce=require(_0x9d4a('0xc'));var deskjs=require(_0x9d4a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9d4a('0xe'));var Papa=require(_0x9d4a('0xf'));var Redis=require(_0x9d4a('0x10'));var authService=require(_0x9d4a('0x11'));var qs=require(_0x9d4a('0x12'));var as=require(_0x9d4a('0x13'));var hardwareService=require(_0x9d4a('0x14'));var logger=require(_0x9d4a('0x15'))(_0x9d4a('0x16'));var utils=require(_0x9d4a('0x17'));var config=require(_0x9d4a('0x18'));var licenseUtil=require(_0x9d4a('0x19'));var db=require(_0x9d4a('0x1a'))['db'];var integrations=require(_0x9d4a('0x1b'));function respondWithStatusCode(_0x1ba9a2,_0x3a7fef){_0x3a7fef=_0x3a7fef||0xcc;return function(_0x35e33d){if(_0x35e33d){return _0x1ba9a2['sendStatus'](_0x3a7fef);}return _0x1ba9a2['status'](_0x3a7fef)[_0x9d4a('0x1c')]();};}function respondWithResult(_0x233885,_0x4e2a62){_0x4e2a62=_0x4e2a62||0xc8;return function(_0x23d1a0){if(_0x23d1a0){return _0x233885[_0x9d4a('0x1d')](_0x4e2a62)[_0x9d4a('0x1e')](_0x23d1a0);}};}function respondWithFilteredResult(_0x4b0e4f,_0x3f0e93){return function(_0x223f8c){if(_0x223f8c){var _0x539cd2=typeof _0x3f0e93[_0x9d4a('0x1f')]===_0x9d4a('0x20')&&typeof _0x3f0e93[_0x9d4a('0x21')]===_0x9d4a('0x20');var _0x307db2=_0x223f8c['count'];var _0x37a399=_0x539cd2?0x0:_0x3f0e93[_0x9d4a('0x1f')];var _0x2c020e=_0x539cd2?_0x223f8c[_0x9d4a('0x22')]:_0x3f0e93[_0x9d4a('0x1f')]+_0x3f0e93[_0x9d4a('0x21')];var _0x228d9e;if(_0x2c020e>=_0x307db2){_0x2c020e=_0x307db2;_0x228d9e=0xc8;}else{_0x228d9e=0xce;}_0x4b0e4f[_0x9d4a('0x1d')](_0x228d9e);return _0x4b0e4f['set'](_0x9d4a('0x23'),_0x37a399+'-'+_0x2c020e+'/'+_0x307db2)['json'](_0x223f8c);}return null;};}function patchUpdates(_0x11f54c){return function(_0x5e0392){try{jsonpatch['apply'](_0x5e0392,_0x11f54c,!![]);}catch(_0x3ef3cd){return BPromise[_0x9d4a('0x24')](_0x3ef3cd);}return _0x5e0392['save']();};}function saveUpdates(_0x20f3ca,_0x28a233){return function(_0x318ce7){if(_0x318ce7){return _0x318ce7[_0x9d4a('0x25')](_0x20f3ca)[_0x9d4a('0x26')](function(_0x5ee8ad){return _0x5ee8ad;});}return null;};}function removeEntity(_0x43a3d0,_0x30ae80){return function(_0x596c8b){if(_0x596c8b){return _0x596c8b['destroy']()['then'](function(){_0x43a3d0[_0x9d4a('0x1d')](0xcc)[_0x9d4a('0x1c')]();});}};}function handleEntityNotFound(_0x321cf5,_0x112d4c){return function(_0x215295){if(!_0x215295){_0x321cf5[_0x9d4a('0x27')](0x194);}return _0x215295;};}function handleError(_0x14f9dc,_0x44933b){_0x44933b=_0x44933b||0x1f4;return function(_0x3f0057){logger['error'](_0x3f0057['stack']);if(_0x3f0057[_0x9d4a('0x28')]){delete _0x3f0057[_0x9d4a('0x28')];}_0x14f9dc[_0x9d4a('0x1d')](_0x44933b)['send'](_0x3f0057);};}exports[_0x9d4a('0x29')]=function(_0x3dd048,_0x508a6e){var _0x3aa60a={},_0x4b44c2={},_0x38e9b7={'count':0x0,'rows':[]};var _0x1e0524=_[_0x9d4a('0x2a')](db['FreshsalesAccount'][_0x9d4a('0x2b')],function(_0x14ee0f){return{'name':_0x14ee0f['fieldName'],'type':_0x14ee0f['type'][_0x9d4a('0x2c')]};});_0x4b44c2[_0x9d4a('0x2d')]=_['map'](_0x1e0524,'name');_0x4b44c2[_0x9d4a('0x2e')]=_[_0x9d4a('0x2f')](_0x3dd048[_0x9d4a('0x2e')]);_0x4b44c2[_0x9d4a('0x30')]=_[_0x9d4a('0x31')](_0x4b44c2[_0x9d4a('0x2d')],_0x4b44c2['query']);_0x3aa60a[_0x9d4a('0x32')]=_[_0x9d4a('0x31')](_0x4b44c2['model'],qs['fields'](_0x3dd048[_0x9d4a('0x2e')][_0x9d4a('0x33')]));_0x3aa60a[_0x9d4a('0x32')]=_0x3aa60a[_0x9d4a('0x32')]['length']?_0x3aa60a[_0x9d4a('0x32')]:_0x4b44c2[_0x9d4a('0x2d')];if(!_0x3dd048[_0x9d4a('0x2e')]['hasOwnProperty'](_0x9d4a('0x34'))){_0x3aa60a[_0x9d4a('0x21')]=qs[_0x9d4a('0x21')](_0x3dd048[_0x9d4a('0x2e')][_0x9d4a('0x21')]);_0x3aa60a[_0x9d4a('0x1f')]=qs['offset'](_0x3dd048[_0x9d4a('0x2e')][_0x9d4a('0x1f')]);}_0x3aa60a[_0x9d4a('0x35')]=qs['sort'](_0x3dd048[_0x9d4a('0x2e')][_0x9d4a('0x36')]);_0x3aa60a[_0x9d4a('0x37')]=qs[_0x9d4a('0x30')](_['pick'](_0x3dd048[_0x9d4a('0x2e')],_0x4b44c2[_0x9d4a('0x30')]),_0x1e0524);if(_0x3dd048[_0x9d4a('0x2e')][_0x9d4a('0x38')]){_0x3aa60a[_0x9d4a('0x37')]=_[_0x9d4a('0x39')](_0x3aa60a[_0x9d4a('0x37')],{'$or':_[_0x9d4a('0x2a')](_0x1e0524,function(_0x1b7d4a){if(_0x1b7d4a[_0x9d4a('0x3a')]!==_0x9d4a('0x3b')){var _0x7710a4={};_0x7710a4[_0x1b7d4a[_0x9d4a('0x28')]]={'$like':'%'+_0x3dd048['query']['filter']+'%'};return _0x7710a4;}})});}_0x3aa60a=_[_0x9d4a('0x39')]({},_0x3aa60a,_0x3dd048[_0x9d4a('0x3c')]);var _0x4d9848={'where':_0x3aa60a[_0x9d4a('0x37')]};return db[_0x9d4a('0x3d')][_0x9d4a('0x22')](_0x4d9848)['then'](function(_0x2247df){_0x38e9b7[_0x9d4a('0x22')]=_0x2247df;if(_0x3dd048['query'][_0x9d4a('0x3e')]){_0x3aa60a[_0x9d4a('0x3f')]=[{'all':!![]}];}return db[_0x9d4a('0x3d')]['findAll'](_0x3aa60a);})['then'](function(_0x3eb243){_0x38e9b7[_0x9d4a('0x40')]=_0x3eb243;return _0x38e9b7;})[_0x9d4a('0x26')](respondWithFilteredResult(_0x508a6e,_0x3aa60a))[_0x9d4a('0x41')](handleError(_0x508a6e,null));};exports[_0x9d4a('0x42')]=function(_0x1b1d96,_0x1023ad){var _0x453cfd={'raw':![],'where':{'id':_0x1b1d96[_0x9d4a('0x43')]['id']}},_0x451419={};_0x451419['model']=_[_0x9d4a('0x2f')](db[_0x9d4a('0x3d')][_0x9d4a('0x2b')]);_0x451419[_0x9d4a('0x2e')]=_[_0x9d4a('0x2f')](_0x1b1d96[_0x9d4a('0x2e')]);_0x451419[_0x9d4a('0x30')]=_[_0x9d4a('0x31')](_0x451419[_0x9d4a('0x2d')],_0x451419[_0x9d4a('0x2e')]);_0x453cfd[_0x9d4a('0x32')]=_[_0x9d4a('0x31')](_0x451419[_0x9d4a('0x2d')],qs[_0x9d4a('0x33')](_0x1b1d96[_0x9d4a('0x2e')][_0x9d4a('0x33')]));_0x453cfd['attributes']=_0x453cfd[_0x9d4a('0x32')][_0x9d4a('0x44')]?_0x453cfd[_0x9d4a('0x32')]:_0x451419[_0x9d4a('0x2d')];if(_0x1b1d96[_0x9d4a('0x2e')]['includeAll']){_0x453cfd['include']=[{'all':!![]}];}_0x453cfd=_[_0x9d4a('0x39')]({},_0x453cfd,_0x1b1d96[_0x9d4a('0x3c')]);return db[_0x9d4a('0x3d')][_0x9d4a('0x45')](_0x453cfd)[_0x9d4a('0x26')](handleEntityNotFound(_0x1023ad,null))[_0x9d4a('0x26')](respondWithResult(_0x1023ad,null))[_0x9d4a('0x41')](handleError(_0x1023ad,null));};exports[_0x9d4a('0x46')]=function(_0x17fc1,_0x2bf787){return db['FreshsalesAccount'][_0x9d4a('0x46')](_0x17fc1['body'],{})[_0x9d4a('0x26')](respondWithResult(_0x2bf787,0xc9))[_0x9d4a('0x41')](handleError(_0x2bf787,null));};exports[_0x9d4a('0x25')]=function(_0x5d66d3,_0x1fb3ce){if(_0x5d66d3[_0x9d4a('0x47')]['id']){delete _0x5d66d3['body']['id'];}return db['FreshsalesAccount'][_0x9d4a('0x45')]({'where':{'id':_0x5d66d3['params']['id']}})[_0x9d4a('0x26')](handleEntityNotFound(_0x1fb3ce,null))[_0x9d4a('0x26')](saveUpdates(_0x5d66d3[_0x9d4a('0x47')],null))[_0x9d4a('0x26')](respondWithResult(_0x1fb3ce,null))[_0x9d4a('0x41')](handleError(_0x1fb3ce,null));};exports['destroy']=function(_0x58288c,_0x5def99){return db[_0x9d4a('0x3d')][_0x9d4a('0x45')]({'where':{'id':_0x58288c[_0x9d4a('0x43')]['id']}})[_0x9d4a('0x26')](handleEntityNotFound(_0x5def99,null))['then'](removeEntity(_0x5def99,null))['catch'](handleError(_0x5def99,null));};exports[_0x9d4a('0x48')]=function(_0x36605a,_0x1ed146,_0x560ecb){var _0x4366c1={};var _0x255b37={};var _0x383194;var _0x386e44;return db[_0x9d4a('0x3d')][_0x9d4a('0x49')]({'where':{'id':_0x36605a[_0x9d4a('0x43')]['id']}})[_0x9d4a('0x26')](handleEntityNotFound(_0x1ed146,null))[_0x9d4a('0x26')](function(_0xf2fb82){if(_0xf2fb82){_0x383194=_0xf2fb82;_0x255b37[_0x9d4a('0x2d')]=_[_0x9d4a('0x2f')](db['FreshsalesConfiguration'][_0x9d4a('0x2b')]);_0x255b37[_0x9d4a('0x2e')]=_[_0x9d4a('0x2f')](_0x36605a[_0x9d4a('0x2e')]);_0x255b37[_0x9d4a('0x30')]=_[_0x9d4a('0x31')](_0x255b37[_0x9d4a('0x2d')],_0x255b37[_0x9d4a('0x2e')]);_0x4366c1['attributes']=_[_0x9d4a('0x31')](_0x255b37[_0x9d4a('0x2d')],qs[_0x9d4a('0x33')](_0x36605a[_0x9d4a('0x2e')][_0x9d4a('0x33')]));_0x4366c1[_0x9d4a('0x32')]=_0x4366c1['attributes'][_0x9d4a('0x44')]?_0x4366c1[_0x9d4a('0x32')]:_0x255b37['model'];_0x4366c1[_0x9d4a('0x35')]=qs['sort'](_0x36605a[_0x9d4a('0x2e')]['sort']);_0x4366c1['where']=qs[_0x9d4a('0x30')](_[_0x9d4a('0x4a')](_0x36605a[_0x9d4a('0x2e')],_0x255b37[_0x9d4a('0x30')]));if(_0x36605a['query']['filter']){_0x4366c1['where']=_[_0x9d4a('0x39')](_0x4366c1[_0x9d4a('0x37')],{'$or':_['map'](_0x4366c1[_0x9d4a('0x32')],function(_0x9d54da){var _0x2fcc91={};_0x2fcc91[_0x9d54da]={'$like':'%'+_0x36605a['query'][_0x9d4a('0x38')]+'%'};return _0x2fcc91;})});}_0x4366c1=_[_0x9d4a('0x39')]({},_0x4366c1,_0x36605a[_0x9d4a('0x3c')]);return _0x383194['getConfigurations'](_0x4366c1);}})[_0x9d4a('0x26')](function(_0x58fd05){if(_0x58fd05){_0x386e44=_0x58fd05[_0x9d4a('0x44')];if(!_0x36605a['query'][_0x9d4a('0x4b')](_0x9d4a('0x34'))){_0x4366c1['limit']=qs[_0x9d4a('0x21')](_0x36605a[_0x9d4a('0x2e')][_0x9d4a('0x21')]);_0x4366c1[_0x9d4a('0x1f')]=qs[_0x9d4a('0x1f')](_0x36605a[_0x9d4a('0x2e')][_0x9d4a('0x1f')]);}return _0x383194[_0x9d4a('0x48')](_0x4366c1);}})['then'](function(_0x49c8e0){if(_0x49c8e0){return _0x49c8e0?{'count':_0x386e44,'rows':_0x49c8e0}:null;}})['then'](respondWithResult(_0x1ed146,null))[_0x9d4a('0x41')](handleError(_0x1ed146,null));};exports[_0x9d4a('0x4c')]=function(_0xf3c2e9,_0x1d8fca,_0x31707f){if(_0xf3c2e9[_0x9d4a('0x47')]['id']){delete _0xf3c2e9[_0x9d4a('0x47')]['id'];}return db['FreshsalesAccount'][_0x9d4a('0x49')]({'where':{'id':_0xf3c2e9[_0x9d4a('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d8fca,null))[_0x9d4a('0x26')](function(_0x329044){if(_0x329044){_0xf3c2e9['body'][_0x9d4a('0x4d')]=_0x329044['id'];_0xf3c2e9[_0x9d4a('0x47')][_0x9d4a('0x4e')]=integrations[_0x9d4a('0x4f')](_0xf3c2e9[_0x9d4a('0x47')][_0x9d4a('0x50')],_0xf3c2e9[_0x9d4a('0x47')]['type']);_0xf3c2e9[_0x9d4a('0x47')][_0x9d4a('0x51')]=integrations[_0x9d4a('0x52')](_0xf3c2e9['body'][_0x9d4a('0x50')],_0xf3c2e9[_0x9d4a('0x47')][_0x9d4a('0x3a')]);return db[_0x9d4a('0x53')][_0x9d4a('0x46')](_0xf3c2e9['body'],{'include':[{'model':db[_0x9d4a('0x54')],'as':_0x9d4a('0x4e')},{'model':db['FreshsalesField'],'as':_0x9d4a('0x51')}]});}return null;})['then'](respondWithResult(_0x1d8fca,null))['catch'](handleError(_0x1d8fca,null));};exports[_0x9d4a('0x55')]=function(_0x586ed2,_0x1f4088,_0x3b2075){var _0x52f252='';var _0x33ee79='';return db[_0x9d4a('0x3d')][_0x9d4a('0x49')]({'where':{'id':_0x586ed2['params']['id']},'attributes':['id',_0x9d4a('0x56'),_0x9d4a('0x57'),'apiKey']})[_0x9d4a('0x26')](handleEntityNotFound(_0x1f4088,null))[_0x9d4a('0x26')](function(_0xb7224c){if(_0xb7224c){_0x33ee79=_0xb7224c[_0x9d4a('0x56')];_0x52f252=_0xb7224c[_0x9d4a('0x57')];var _0x533a29=_0xb7224c[_0x9d4a('0x57')][_0x9d4a('0x58')](-0x1);if(_0x533a29==='/'){_0x52f252=_0x52f252['substring'](0x0,_0x52f252[_0x9d4a('0x59')](_0x533a29));}return rp({'method':'GET','uri':util[_0x9d4a('0x5a')]('%s%s',_0x52f252,_0x9d4a('0x5b')),'headers':{'Authorization':_0x9d4a('0x5c')+_0xb7224c[_0x9d4a('0x5d')]},'json':!![]});}})[_0x9d4a('0x26')](function(_0x34899f){if(_0x34899f){var _0x12b7f8=_0x34899f[_0x9d4a('0x5e')];var _0x22942e=![];var _0x2da94b=null;for(_0x2da94b=0x0;_0x2da94b<_0x12b7f8['length'];_0x2da94b++){if(_0x12b7f8[_0x2da94b][_0x9d4a('0x5f')]===_0x33ee79){_0x22942e=!![];}}if(_0x22942e){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9d4a('0x60')});}}})[_0x9d4a('0x26')](respondWithResult(_0x1f4088,null))[_0x9d4a('0x41')](function(_0x26696e){var _0x9ad7c1=_0x586ed2[_0x9d4a('0x2e')][_0x9d4a('0x61')]?0x1f4:_0x26696e[_0x9d4a('0x62')]||0x1f4;logger[_0x9d4a('0x63')]('getFields,\x20%s,\x20%s,\x20%s',_0x9d4a('0x55'),_0x9ad7c1,JSON[_0x9d4a('0x64')](_0x26696e));delete _0x26696e[_0x9d4a('0x28')];if(_0x9ad7c1===0x191){_0x9ad7c1=0x190;}_0x1f4088[_0x9d4a('0x1d')](_0x9ad7c1)[_0x9d4a('0x65')](_0x586ed2[_0x9d4a('0x2e')][_0x9d4a('0x61')]?{'message':'Wrong\x20credentials','statusCode':_0x26696e[_0x9d4a('0x62')]}:_0x26696e);});}; \ No newline at end of file +var _0xbf6c=['hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','getConfigurations','findOne','keys','FreshsalesConfiguration','nolimit','Subjects','getSubjects','channel','type','Descriptions','FreshsalesField','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','send','index','map','FreshsalesAccount','fieldName','key','name','query','filters','intersection','attributes','model','fields'];(function(_0x50f6e8,_0x180468){var _0x2073b9=function(_0x12947d){while(--_0x12947d){_0x50f6e8['push'](_0x50f6e8['shift']());}};_0x2073b9(++_0x180468);}(_0xbf6c,0x174));var _0xcbf6=function(_0x28ddde,_0x17263e){_0x28ddde=_0x28ddde-0x0;var _0x3b5936=_0xbf6c[_0x28ddde];return _0x3b5936;};'use strict';var emlformat=require(_0xcbf6('0x0'));var rimraf=require(_0xcbf6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcbf6('0x2'));var rp=require(_0xcbf6('0x3'));var moment=require(_0xcbf6('0x4'));var BPromise=require(_0xcbf6('0x5'));var Mustache=require(_0xcbf6('0x6'));var util=require(_0xcbf6('0x7'));var path=require(_0xcbf6('0x8'));var sox=require(_0xcbf6('0x9'));var csv=require(_0xcbf6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcbf6('0xb'));var _=require('lodash');var squel=require(_0xcbf6('0xc'));var crypto=require(_0xcbf6('0xd'));var jsforce=require(_0xcbf6('0xe'));var deskjs=require(_0xcbf6('0xf'));var toCsv=require(_0xcbf6('0xa'));var querystring=require(_0xcbf6('0x10'));var Papa=require(_0xcbf6('0x11'));var Redis=require(_0xcbf6('0x12'));var authService=require(_0xcbf6('0x13'));var qs=require(_0xcbf6('0x14'));var as=require(_0xcbf6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbf6('0x16'))(_0xcbf6('0x17'));var utils=require(_0xcbf6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xcbf6('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xcbf6('0x1a'));function respondWithStatusCode(_0x1445d4,_0x39e39c){_0x39e39c=_0x39e39c||0xcc;return function(_0x2c0640){if(_0x2c0640){return _0x1445d4[_0xcbf6('0x1b')](_0x39e39c);}return _0x1445d4[_0xcbf6('0x1c')](_0x39e39c)[_0xcbf6('0x1d')]();};}function respondWithResult(_0x4e422f,_0x12f627){_0x12f627=_0x12f627||0xc8;return function(_0xc1f2b8){if(_0xc1f2b8){return _0x4e422f[_0xcbf6('0x1c')](_0x12f627)[_0xcbf6('0x1e')](_0xc1f2b8);}};}function respondWithFilteredResult(_0x9fa96e,_0x280327){return function(_0x12dcc5){if(_0x12dcc5){var _0x5b0a62=typeof _0x280327[_0xcbf6('0x1f')]===_0xcbf6('0x20')&&typeof _0x280327[_0xcbf6('0x21')]===_0xcbf6('0x20');var _0x3dc3eb=_0x12dcc5[_0xcbf6('0x22')];var _0x228da8=_0x5b0a62?0x0:_0x280327['offset'];var _0x500422=_0x5b0a62?_0x12dcc5['count']:_0x280327[_0xcbf6('0x1f')]+_0x280327[_0xcbf6('0x21')];var _0x30534c;if(_0x500422>=_0x3dc3eb){_0x500422=_0x3dc3eb;_0x30534c=0xc8;}else{_0x30534c=0xce;}_0x9fa96e[_0xcbf6('0x1c')](_0x30534c);return _0x9fa96e['set'](_0xcbf6('0x23'),_0x228da8+'-'+_0x500422+'/'+_0x3dc3eb)[_0xcbf6('0x1e')](_0x12dcc5);}return null;};}function patchUpdates(_0x59898c){return function(_0xe640e3){try{jsonpatch[_0xcbf6('0x24')](_0xe640e3,_0x59898c,!![]);}catch(_0x100ce2){return BPromise['reject'](_0x100ce2);}return _0xe640e3[_0xcbf6('0x25')]();};}function saveUpdates(_0x1f44ac,_0x55a4a2){return function(_0x46efee){if(_0x46efee){return _0x46efee[_0xcbf6('0x26')](_0x1f44ac)[_0xcbf6('0x27')](function(_0x39dd98){return _0x39dd98;});}return null;};}function removeEntity(_0x120855,_0x4243b2){return function(_0x195dda){if(_0x195dda){return _0x195dda[_0xcbf6('0x28')]()[_0xcbf6('0x27')](function(){_0x120855[_0xcbf6('0x1c')](0xcc)[_0xcbf6('0x1d')]();});}};}function handleEntityNotFound(_0x5e853e,_0x34fe5b){return function(_0xab471b){if(!_0xab471b){_0x5e853e[_0xcbf6('0x1b')](0x194);}return _0xab471b;};}function handleError(_0x2bf634,_0x161c48){_0x161c48=_0x161c48||0x1f4;return function(_0x2fd824){logger[_0xcbf6('0x29')](_0x2fd824[_0xcbf6('0x2a')]);if(_0x2fd824['name']){delete _0x2fd824['name'];}_0x2bf634['status'](_0x161c48)[_0xcbf6('0x2b')](_0x2fd824);};}exports[_0xcbf6('0x2c')]=function(_0x3a71bb,_0xac0db8){var _0x5328b3={},_0x369d3d={},_0x3d23f9={'count':0x0,'rows':[]};var _0x1ca950=_[_0xcbf6('0x2d')](db[_0xcbf6('0x2e')]['rawAttributes'],function(_0x1a64dd){return{'name':_0x1a64dd[_0xcbf6('0x2f')],'type':_0x1a64dd['type'][_0xcbf6('0x30')]};});_0x369d3d['model']=_[_0xcbf6('0x2d')](_0x1ca950,_0xcbf6('0x31'));_0x369d3d[_0xcbf6('0x32')]=_['keys'](_0x3a71bb[_0xcbf6('0x32')]);_0x369d3d[_0xcbf6('0x33')]=_[_0xcbf6('0x34')](_0x369d3d['model'],_0x369d3d[_0xcbf6('0x32')]);_0x5328b3[_0xcbf6('0x35')]=_[_0xcbf6('0x34')](_0x369d3d[_0xcbf6('0x36')],qs[_0xcbf6('0x37')](_0x3a71bb[_0xcbf6('0x32')]['fields']));_0x5328b3[_0xcbf6('0x35')]=_0x5328b3[_0xcbf6('0x35')]['length']?_0x5328b3[_0xcbf6('0x35')]:_0x369d3d[_0xcbf6('0x36')];if(!_0x3a71bb['query'][_0xcbf6('0x38')]('nolimit')){_0x5328b3[_0xcbf6('0x21')]=qs['limit'](_0x3a71bb[_0xcbf6('0x32')][_0xcbf6('0x21')]);_0x5328b3[_0xcbf6('0x1f')]=qs['offset'](_0x3a71bb[_0xcbf6('0x32')][_0xcbf6('0x1f')]);}_0x5328b3[_0xcbf6('0x39')]=qs[_0xcbf6('0x3a')](_0x3a71bb[_0xcbf6('0x32')][_0xcbf6('0x3a')]);_0x5328b3['where']=qs['filters'](_[_0xcbf6('0x3b')](_0x3a71bb['query'],_0x369d3d[_0xcbf6('0x33')]),_0x1ca950);if(_0x3a71bb[_0xcbf6('0x32')][_0xcbf6('0x3c')]){_0x5328b3[_0xcbf6('0x3d')]=_['merge'](_0x5328b3[_0xcbf6('0x3d')],{'$or':_[_0xcbf6('0x2d')](_0x1ca950,function(_0x2df9a2){if(_0x2df9a2['type']!==_0xcbf6('0x3e')){var _0x13ae03={};_0x13ae03[_0x2df9a2[_0xcbf6('0x31')]]={'$like':'%'+_0x3a71bb[_0xcbf6('0x32')][_0xcbf6('0x3c')]+'%'};return _0x13ae03;}})});}_0x5328b3=_[_0xcbf6('0x3f')]({},_0x5328b3,_0x3a71bb[_0xcbf6('0x40')]);var _0x4faacb={'where':_0x5328b3[_0xcbf6('0x3d')]};return db[_0xcbf6('0x2e')][_0xcbf6('0x22')](_0x4faacb)[_0xcbf6('0x27')](function(_0x46fe32){_0x3d23f9['count']=_0x46fe32;if(_0x3a71bb['query'][_0xcbf6('0x41')]){_0x5328b3[_0xcbf6('0x42')]=[{'all':!![]}];}return db[_0xcbf6('0x2e')][_0xcbf6('0x43')](_0x5328b3);})[_0xcbf6('0x27')](function(_0x7487){_0x3d23f9[_0xcbf6('0x44')]=_0x7487;return _0x3d23f9;})[_0xcbf6('0x27')](respondWithFilteredResult(_0xac0db8,_0x5328b3))[_0xcbf6('0x45')](handleError(_0xac0db8,null));};exports['show']=function(_0x293dd8,_0x42157a){var _0x3f859f={'raw':![],'where':{'id':_0x293dd8[_0xcbf6('0x46')]['id']}},_0x6ae9a3={};_0x6ae9a3[_0xcbf6('0x36')]=_['keys'](db['FreshsalesAccount'][_0xcbf6('0x47')]);_0x6ae9a3[_0xcbf6('0x32')]=_['keys'](_0x293dd8['query']);_0x6ae9a3[_0xcbf6('0x33')]=_[_0xcbf6('0x34')](_0x6ae9a3[_0xcbf6('0x36')],_0x6ae9a3[_0xcbf6('0x32')]);_0x3f859f['attributes']=_['intersection'](_0x6ae9a3[_0xcbf6('0x36')],qs[_0xcbf6('0x37')](_0x293dd8['query'][_0xcbf6('0x37')]));_0x3f859f[_0xcbf6('0x35')]=_0x3f859f[_0xcbf6('0x35')][_0xcbf6('0x48')]?_0x3f859f[_0xcbf6('0x35')]:_0x6ae9a3[_0xcbf6('0x36')];if(_0x293dd8[_0xcbf6('0x32')]['includeAll']){_0x3f859f['include']=[{'all':!![]}];}_0x3f859f=_['merge']({},_0x3f859f,_0x293dd8[_0xcbf6('0x40')]);return db['FreshsalesAccount'][_0xcbf6('0x49')](_0x3f859f)[_0xcbf6('0x27')](handleEntityNotFound(_0x42157a,null))[_0xcbf6('0x27')](respondWithResult(_0x42157a,null))[_0xcbf6('0x45')](handleError(_0x42157a,null));};exports[_0xcbf6('0x4a')]=function(_0x449ff4,_0xfe0c66){return db[_0xcbf6('0x2e')][_0xcbf6('0x4a')](_0x449ff4[_0xcbf6('0x4b')],{})['then'](respondWithResult(_0xfe0c66,0xc9))[_0xcbf6('0x45')](handleError(_0xfe0c66,null));};exports[_0xcbf6('0x26')]=function(_0x51a013,_0x30fe12){if(_0x51a013[_0xcbf6('0x4b')]['id']){delete _0x51a013[_0xcbf6('0x4b')]['id'];}return db[_0xcbf6('0x2e')][_0xcbf6('0x49')]({'where':{'id':_0x51a013['params']['id']}})[_0xcbf6('0x27')](handleEntityNotFound(_0x30fe12,null))[_0xcbf6('0x27')](saveUpdates(_0x51a013[_0xcbf6('0x4b')],null))[_0xcbf6('0x27')](respondWithResult(_0x30fe12,null))[_0xcbf6('0x45')](handleError(_0x30fe12,null));};exports[_0xcbf6('0x28')]=function(_0x93be01,_0x1fe3c5){return db[_0xcbf6('0x2e')][_0xcbf6('0x49')]({'where':{'id':_0x93be01[_0xcbf6('0x46')]['id']}})['then'](handleEntityNotFound(_0x1fe3c5,null))[_0xcbf6('0x27')](removeEntity(_0x1fe3c5,null))['catch'](handleError(_0x1fe3c5,null));};exports[_0xcbf6('0x4c')]=function(_0x21543f,_0x150214,_0x764f80){var _0x3add3b={};var _0x177b0a={};var _0x24011e;var _0x11344c;return db[_0xcbf6('0x2e')][_0xcbf6('0x4d')]({'where':{'id':_0x21543f['params']['id']}})[_0xcbf6('0x27')](handleEntityNotFound(_0x150214,null))[_0xcbf6('0x27')](function(_0x1454ea){if(_0x1454ea){_0x24011e=_0x1454ea;_0x177b0a[_0xcbf6('0x36')]=_[_0xcbf6('0x4e')](db[_0xcbf6('0x4f')][_0xcbf6('0x47')]);_0x177b0a['query']=_[_0xcbf6('0x4e')](_0x21543f[_0xcbf6('0x32')]);_0x177b0a[_0xcbf6('0x33')]=_[_0xcbf6('0x34')](_0x177b0a[_0xcbf6('0x36')],_0x177b0a[_0xcbf6('0x32')]);_0x3add3b[_0xcbf6('0x35')]=_['intersection'](_0x177b0a[_0xcbf6('0x36')],qs[_0xcbf6('0x37')](_0x21543f[_0xcbf6('0x32')]['fields']));_0x3add3b[_0xcbf6('0x35')]=_0x3add3b['attributes'][_0xcbf6('0x48')]?_0x3add3b[_0xcbf6('0x35')]:_0x177b0a[_0xcbf6('0x36')];_0x3add3b[_0xcbf6('0x39')]=qs[_0xcbf6('0x3a')](_0x21543f[_0xcbf6('0x32')][_0xcbf6('0x3a')]);_0x3add3b['where']=qs[_0xcbf6('0x33')](_[_0xcbf6('0x3b')](_0x21543f['query'],_0x177b0a[_0xcbf6('0x33')]));if(_0x21543f[_0xcbf6('0x32')]['filter']){_0x3add3b[_0xcbf6('0x3d')]=_['merge'](_0x3add3b[_0xcbf6('0x3d')],{'$or':_[_0xcbf6('0x2d')](_0x3add3b[_0xcbf6('0x35')],function(_0x32964d){var _0x48d7f6={};_0x48d7f6[_0x32964d]={'$like':'%'+_0x21543f['query'][_0xcbf6('0x3c')]+'%'};return _0x48d7f6;})});}_0x3add3b=_[_0xcbf6('0x3f')]({},_0x3add3b,_0x21543f['options']);return _0x24011e[_0xcbf6('0x4c')](_0x3add3b);}})[_0xcbf6('0x27')](function(_0x71d704){if(_0x71d704){_0x11344c=_0x71d704[_0xcbf6('0x48')];if(!_0x21543f[_0xcbf6('0x32')][_0xcbf6('0x38')](_0xcbf6('0x50'))){_0x3add3b[_0xcbf6('0x21')]=qs[_0xcbf6('0x21')](_0x21543f['query'][_0xcbf6('0x21')]);_0x3add3b[_0xcbf6('0x1f')]=qs[_0xcbf6('0x1f')](_0x21543f['query'][_0xcbf6('0x1f')]);}return _0x24011e['getConfigurations'](_0x3add3b);}})[_0xcbf6('0x27')](function(_0x1a0e86){if(_0x1a0e86){return _0x1a0e86?{'count':_0x11344c,'rows':_0x1a0e86}:null;}})[_0xcbf6('0x27')](respondWithResult(_0x150214,null))[_0xcbf6('0x45')](handleError(_0x150214,null));};exports['addConfiguration']=function(_0x4ca433,_0x3fe7ae,_0x5cfc85){if(_0x4ca433['body']['id']){delete _0x4ca433[_0xcbf6('0x4b')]['id'];}return db[_0xcbf6('0x2e')]['findOne']({'where':{'id':_0x4ca433['params']['id']}})[_0xcbf6('0x27')](handleEntityNotFound(_0x3fe7ae,null))[_0xcbf6('0x27')](function(_0x6b2e65){if(_0x6b2e65){_0x4ca433[_0xcbf6('0x4b')]['AccountId']=_0x6b2e65['id'];_0x4ca433[_0xcbf6('0x4b')][_0xcbf6('0x51')]=integrations[_0xcbf6('0x52')](_0x4ca433[_0xcbf6('0x4b')][_0xcbf6('0x53')],_0x4ca433[_0xcbf6('0x4b')][_0xcbf6('0x54')]);_0x4ca433[_0xcbf6('0x4b')][_0xcbf6('0x55')]=integrations['getDescriptions'](_0x4ca433['body'][_0xcbf6('0x53')],_0x4ca433[_0xcbf6('0x4b')][_0xcbf6('0x54')]);return db['FreshsalesConfiguration'][_0xcbf6('0x4a')](_0x4ca433[_0xcbf6('0x4b')],{'include':[{'model':db[_0xcbf6('0x56')],'as':_0xcbf6('0x51')},{'model':db[_0xcbf6('0x56')],'as':_0xcbf6('0x55')}]});}return null;})[_0xcbf6('0x27')](respondWithResult(_0x3fe7ae,null))[_0xcbf6('0x45')](handleError(_0x3fe7ae,null));};exports['getFields']=function(_0x15f8bb,_0x16abc6,_0x5e0db2){var _0xf10f56='';var _0x4aa866='';return db['FreshsalesAccount'][_0xcbf6('0x4d')]({'where':{'id':_0x15f8bb[_0xcbf6('0x46')]['id']},'attributes':['id',_0xcbf6('0x57'),'remoteUri',_0xcbf6('0x58')]})['then'](handleEntityNotFound(_0x16abc6,null))['then'](function(_0x28d40f){if(_0x28d40f){_0x4aa866=_0x28d40f[_0xcbf6('0x57')];_0xf10f56=_0x28d40f[_0xcbf6('0x59')];var _0x318297=_0x28d40f[_0xcbf6('0x59')][_0xcbf6('0x5a')](-0x1);if(_0x318297==='/'){_0xf10f56=_0xf10f56[_0xcbf6('0x5b')](0x0,_0xf10f56[_0xcbf6('0x5c')](_0x318297));}return rp({'method':_0xcbf6('0x5d'),'uri':util[_0xcbf6('0x5e')](_0xcbf6('0x5f'),_0xf10f56,_0xcbf6('0x60')),'headers':{'Authorization':_0xcbf6('0x61')+_0x28d40f[_0xcbf6('0x58')]},'json':!![]});}})[_0xcbf6('0x27')](function(_0x3a9723){if(_0x3a9723){var _0x1921f2=_0x3a9723[_0xcbf6('0x62')];var _0x297dc3=![];var _0x215e67=null;for(_0x215e67=0x0;_0x215e67<_0x1921f2[_0xcbf6('0x48')];_0x215e67++){if(_0x1921f2[_0x215e67][_0xcbf6('0x63')]===_0x4aa866){_0x297dc3=!![];}}if(_0x297dc3){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xcbf6('0x64')});}}})[_0xcbf6('0x27')](respondWithResult(_0x16abc6,null))[_0xcbf6('0x45')](function(_0x3bbeee){var _0x322333=_0x15f8bb[_0xcbf6('0x32')][_0xcbf6('0x65')]?0x1f4:_0x3bbeee[_0xcbf6('0x66')]||0x1f4;logger[_0xcbf6('0x29')](_0xcbf6('0x67'),_0xcbf6('0x68'),_0x322333,JSON[_0xcbf6('0x69')](_0x3bbeee));delete _0x3bbeee[_0xcbf6('0x31')];if(_0x322333===0x191){_0x322333=0x190;}_0x16abc6['status'](_0x322333)['send'](_0x15f8bb['query'][_0xcbf6('0x65')]?{'message':_0xcbf6('0x6a'),'statusCode':_0x3bbeee[_0xcbf6('0x66')]}:_0x3bbeee);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 3c06886..86c964c 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 _0x6a55=['define','FreshsalesAccount','int_freshsales_accounts','lodash','moment','path','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0x6a55,0xdb));var _0x56a5=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x6a55[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x56a5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x56a5('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x56a5('0x2'));var rimraf=require('rimraf');var config=require(_0x56a5('0x3'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x56a5('0x4'));module[_0x56a5('0x5')]=function(_0x42d164,_0x293ea1){return _0x42d164[_0x56a5('0x6')](_0x56a5('0x7'),attributes,{'tableName':_0x56a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2e3=['int_freshsales_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount'];(function(_0x34cb1d,_0x2c496e){var _0x554418=function(_0x5ca459){while(--_0x5ca459){_0x34cb1d['push'](_0x34cb1d['shift']());}};_0x554418(++_0x2c496e);}(_0xf2e3,0x9b));var _0x3f2e=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xf2e3[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0x3f2e('0x0'));var util=require('util');var logger=require(_0x3f2e('0x1'))(_0x3f2e('0x2'));var moment=require(_0x3f2e('0x3'));var BPromise=require(_0x3f2e('0x4'));var rp=require(_0x3f2e('0x5'));var fs=require('fs');var path=require(_0x3f2e('0x6'));var rimraf=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var attributes=require(_0x3f2e('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x3f2e('0xa')]=function(_0xdd6b3e,_0x3c0864){return _0xdd6b3e[_0x3f2e('0xb')](_0x3f2e('0xc'),attributes,{'tableName':_0x3f2e('0xd'),'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 691d35c..59c1017 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 _0x3a6d=['client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','model','map','debug','ShowFreshsalesAccount','find','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x20fbb0,_0x1df479){var _0x4180a1=function(_0x5c9d67){while(--_0x5c9d67){_0x20fbb0['push'](_0x20fbb0['shift']());}};_0x4180a1(++_0x1df479);}(_0x3a6d,0x143));var _0xd3a6=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x3a6d[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var utils=require(_0xd3a6('0x6'));var logger=require('../../config/logger')(_0xd3a6('0x7'));var config=require(_0xd3a6('0x8'));var jayson=require(_0xd3a6('0x9'));var client=jayson[_0xd3a6('0xa')][_0xd3a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282cb1,_0x58d83a,_0x121bd2){return new BPromise(function(_0x134dd3,_0x16858){return client[_0xd3a6('0xc')](_0x282cb1,_0x121bd2)[_0xd3a6('0xd')](function(_0xa67661){logger[_0xd3a6('0xe')](_0xd3a6('0xf'),_0x58d83a,_0xd3a6('0x10'));logger['debug'](_0xd3a6('0x11'),_0x58d83a,_0xd3a6('0x10'),JSON[_0xd3a6('0x12')](_0xa67661));if(_0xa67661[_0xd3a6('0x13')]){if(_0xa67661[_0xd3a6('0x13')]['code']===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);return _0x16858(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}logger[_0xd3a6('0x13')](_0xd3a6('0xf'),_0x58d83a,_0xa67661[_0xd3a6('0x13')]['message']);return _0x134dd3(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}else{logger[_0xd3a6('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xd3a6('0x10'));_0x134dd3(_0xa67661[_0xd3a6('0x15')][_0xd3a6('0x14')]);}})['catch'](function(_0x3498d5){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0x3498d5);_0x16858(_0x3498d5);});});}exports[_0xd3a6('0x16')]=function(_0x8d1286){var _0x32683f=this;return new Promise(function(_0xbe58b4,_0x22fb05){return db[_0xd3a6('0x17')][_0xd3a6('0x18')]({'raw':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1a')]||null:null,'attributes':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'limit':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1c')]||null:null,'include':_0x8d1286['options']?_0x8d1286['options']['include']?_['map'](_0x8d1286['options'][_0xd3a6('0x1d')],function(_0x400982){return{'model':db[_0x400982[_0xd3a6('0x1e')]],'as':_0x400982['as'],'attributes':_0x400982['attributes'],'include':_0x400982[_0xd3a6('0x1d')]?_['map'](_0x400982[_0xd3a6('0x1d')],function(_0x16afc8){return{'model':db[_0x16afc8[_0xd3a6('0x1e')]],'as':_0x16afc8['as'],'attributes':_0x16afc8['attributes'],'include':_0x16afc8[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x16afc8[_0xd3a6('0x1d')],function(_0x219e32){return{'model':db[_0x219e32[_0xd3a6('0x1e')]],'as':_0x219e32['as'],'attributes':_0x219e32[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30df90){logger[_0xd3a6('0xe')](_0xd3a6('0x16'),_0x8d1286);logger[_0xd3a6('0x20')](_0xd3a6('0x16'),_0x8d1286,JSON[_0xd3a6('0x12')](_0x30df90));_0xbe58b4(_0x30df90);})['catch'](function(_0x535bd4){logger[_0xd3a6('0x13')](_0xd3a6('0x16'),_0x535bd4[_0xd3a6('0x14')],_0x8d1286);_0x22fb05(_0x32683f[_0xd3a6('0x13')](0x1f4,_0x535bd4['message']));});});};exports[_0xd3a6('0x21')]=function(_0xa4efd){var _0x4d322a=this;return new Promise(function(_0x14381c,_0x5d9867){return db[_0xd3a6('0x17')][_0xd3a6('0x22')]({'raw':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x23')]===undefined?!![]:![]:!![],'where':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')]['where']||null:null,'attributes':_0xa4efd['options']?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'include':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd['options'][_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1d')],function(_0x3ebd0d){return{'model':db[_0x3ebd0d[_0xd3a6('0x1e')]],'as':_0x3ebd0d['as'],'attributes':_0x3ebd0d[_0xd3a6('0x1b')],'include':_0x3ebd0d[_0xd3a6('0x1d')]?_['map'](_0x3ebd0d[_0xd3a6('0x1d')],function(_0x41981c){return{'model':db[_0x41981c[_0xd3a6('0x1e')]],'as':_0x41981c['as'],'attributes':_0x41981c[_0xd3a6('0x1b')],'include':_0x41981c[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x41981c['include'],function(_0x16a30a){return{'model':db[_0x16a30a['model']],'as':_0x16a30a['as'],'attributes':_0x16a30a[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd3a6('0xd')](function(_0x180bb9){logger[_0xd3a6('0xe')]('ShowFreshsalesAccount',_0xa4efd);logger['debug'](_0xd3a6('0x21'),_0xa4efd,JSON[_0xd3a6('0x12')](_0x180bb9));_0x14381c(_0x180bb9);})[_0xd3a6('0x24')](function(_0x5188e1){logger[_0xd3a6('0x13')](_0xd3a6('0x21'),_0x5188e1['message'],_0xa4efd);_0x5d9867(_0x4d322a[_0xd3a6('0x13')](0x1f4,_0x5188e1['message']));});});}; \ No newline at end of file +var _0x0a6b=['find','map','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','then','debug','stringify','catch','ShowFreshsalesAccount'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x2bfb31,_0xdd9aae){_0x2bfb31=_0x2bfb31-0x0;var _0x2b00ce=_0x0a6b[_0x2bfb31];return _0x2b00ce;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb0a6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0a6('0x2'))['db'];var utils=require(_0xb0a6('0x3'));var logger=require(_0xb0a6('0x4'))('rpc');var config=require(_0xb0a6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb0a6('0x6')][_0xb0a6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e2d2d,_0x11cd5b,_0x24515c){return new BPromise(function(_0x2a8516,_0x530c05){return client['request'](_0x5e2d2d,_0x24515c)['then'](function(_0x2ded05){logger[_0xb0a6('0x8')](_0xb0a6('0x9'),_0x11cd5b,_0xb0a6('0xa'));logger['debug'](_0xb0a6('0xb'),_0x11cd5b,_0xb0a6('0xa'),JSON['stringify'](_0x2ded05));if(_0x2ded05[_0xb0a6('0xc')]){if(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xd')]===0x1f4){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);return _0x530c05(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);}logger[_0xb0a6('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0x2ded05[_0xb0a6('0xc')]['message']);return _0x2a8516(_0x2ded05[_0xb0a6('0xc')]['message']);}else{logger[_0xb0a6('0x8')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0xb0a6('0xa'));_0x2a8516(_0x2ded05[_0xb0a6('0xf')][_0xb0a6('0xe')]);}})['catch'](function(_0x56b594){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x56b594);_0x530c05(_0x56b594);});});}exports[_0xb0a6('0x10')]=function(_0x18f994){var _0x10f504=this;return new Promise(function(_0x13a1c8,_0x567dd5){return db[_0xb0a6('0x11')][_0xb0a6('0x12')]({'raw':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x15')]||null:null,'attributes':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'limit':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x17')]||null:null,'include':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x18')]?_['map'](_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4997df){return{'model':db[_0x4997df['model']],'as':_0x4997df['as'],'attributes':_0x4997df[_0xb0a6('0x16')],'include':_0x4997df[_0xb0a6('0x18')]?_['map'](_0x4997df[_0xb0a6('0x18')],function(_0x24574a){return{'model':db[_0x24574a[_0xb0a6('0x19')]],'as':_0x24574a['as'],'attributes':_0x24574a[_0xb0a6('0x16')],'include':_0x24574a['include']?_['map'](_0x24574a[_0xb0a6('0x18')],function(_0x1e9947){return{'model':db[_0x1e9947[_0xb0a6('0x19')]],'as':_0x1e9947['as'],'attributes':_0x1e9947['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x3347ac){logger[_0xb0a6('0x8')](_0xb0a6('0x10'),_0x18f994);logger[_0xb0a6('0x1b')](_0xb0a6('0x10'),_0x18f994,JSON[_0xb0a6('0x1c')](_0x3347ac));_0x13a1c8(_0x3347ac);})[_0xb0a6('0x1d')](function(_0x4255b9){logger['error'](_0xb0a6('0x10'),_0x4255b9[_0xb0a6('0xe')],_0x18f994);_0x567dd5(_0x10f504[_0xb0a6('0xc')](0x1f4,_0x4255b9['message']));});});};exports[_0xb0a6('0x1e')]=function(_0x582fc2){var _0x131e46=this;return new Promise(function(_0x309a91,_0x114f91){return db[_0xb0a6('0x11')][_0xb0a6('0x1f')]({'raw':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')]['where']||null:null,'attributes':_0x582fc2['options']?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'include':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4b0479){return{'model':db[_0x4b0479[_0xb0a6('0x19')]],'as':_0x4b0479['as'],'attributes':_0x4b0479[_0xb0a6('0x16')],'include':_0x4b0479['include']?_[_0xb0a6('0x20')](_0x4b0479[_0xb0a6('0x18')],function(_0x52e397){return{'model':db[_0x52e397['model']],'as':_0x52e397['as'],'attributes':_0x52e397[_0xb0a6('0x16')],'include':_0x52e397[_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x52e397[_0xb0a6('0x18')],function(_0x4310ae){return{'model':db[_0x4310ae[_0xb0a6('0x19')]],'as':_0x4310ae['as'],'attributes':_0x4310ae['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x5c280e){logger[_0xb0a6('0x8')](_0xb0a6('0x1e'),_0x582fc2);logger['debug']('ShowFreshsalesAccount',_0x582fc2,JSON['stringify'](_0x5c280e));_0x309a91(_0x5c280e);})[_0xb0a6('0x1d')](function(_0xd484f){logger[_0xb0a6('0xc')](_0xb0a6('0x1e'),_0xd484f[_0xb0a6('0xe')],_0x582fc2);_0x114f91(_0x131e46['error'](0x1f4,_0xd484f[_0xb0a6('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index f4e7b0e..3a6288e 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 _0xe68c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','post','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0xe68c,0x158));var _0xce68=function(_0x483134,_0x57de34){_0x483134=_0x483134-0x0;var _0x47518d=_0xe68c[_0x483134];return _0x47518d;};'use strict';var multer=require(_0xce68('0x0'));var util=require('util');var path=require(_0xce68('0x1'));var timeout=require(_0xce68('0x2'));var express=require(_0xce68('0x3'));var router=express[_0xce68('0x4')]();var fs_extra=require(_0xce68('0x5'));var auth=require(_0xce68('0x6'));var interaction=require(_0xce68('0x7'));var config=require(_0xce68('0x8'));var controller=require(_0xce68('0x9'));router[_0xce68('0xa')]('/',auth[_0xce68('0xb')](),controller[_0xce68('0xc')]);router[_0xce68('0xa')]('/:id',auth[_0xce68('0xb')](),controller[_0xce68('0xd')]);router[_0xce68('0xa')](_0xce68('0xe'),auth[_0xce68('0xb')](),controller[_0xce68('0xf')]);router[_0xce68('0xa')](_0xce68('0x10'),auth[_0xce68('0xb')](),controller['getDescriptions']);router[_0xce68('0xa')](_0xce68('0x11'),auth['isAuthenticated'](),controller['getFields']);router[_0xce68('0x12')]('/',auth[_0xce68('0xb')](),controller[_0xce68('0x13')]);router['put'](_0xce68('0x14'),auth[_0xce68('0xb')](),controller[_0xce68('0x15')]);router[_0xce68('0x16')](_0xce68('0x14'),auth['isAuthenticated'](),controller[_0xce68('0x17')]);module[_0xce68('0x18')]=router; \ No newline at end of file +var _0x1a12=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','delete','exports','multer','util'];(function(_0x125e8c,_0x4a152d){var _0x456a73=function(_0x27234c){while(--_0x27234c){_0x125e8c['push'](_0x125e8c['shift']());}};_0x456a73(++_0x4a152d);}(_0x1a12,0x82));var _0x21a1=function(_0x439c58,_0x40d582){_0x439c58=_0x439c58-0x0;var _0x14e5c5=_0x1a12[_0x439c58];return _0x14e5c5;};'use strict';var multer=require(_0x21a1('0x0'));var util=require(_0x21a1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x21a1('0x2'));var router=express[_0x21a1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x21a1('0x4'));var interaction=require(_0x21a1('0x5'));var config=require(_0x21a1('0x6'));var controller=require(_0x21a1('0x7'));router['get']('/',auth[_0x21a1('0x8')](),controller[_0x21a1('0x9')]);router[_0x21a1('0xa')](_0x21a1('0xb'),auth['isAuthenticated'](),controller[_0x21a1('0xc')]);router['get'](_0x21a1('0xd'),auth[_0x21a1('0x8')](),controller['getSubjects']);router['get'](_0x21a1('0xe'),auth[_0x21a1('0x8')](),controller[_0x21a1('0xf')]);router['get'](_0x21a1('0x10'),auth[_0x21a1('0x8')](),controller[_0x21a1('0x11')]);router['post']('/',auth[_0x21a1('0x8')](),controller[_0x21a1('0x12')]);router[_0x21a1('0x13')](_0x21a1('0xb'),auth[_0x21a1('0x8')](),controller['update']);router[_0x21a1('0x14')](_0x21a1('0xb'),auth[_0x21a1('0x8')](),controller['destroy']);module[_0x21a1('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 152c9b5..a3c42da 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 _0x4f44=['STRING','sequelize','exports'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x4f44,0x19f));var _0x44f4=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x4f44[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x44f4('0x0'));module[_0x44f4('0x1')]={'name':{'type':Sequelize[_0x44f4('0x2')]},'description':{'type':Sequelize[_0x44f4('0x2')]}}; \ No newline at end of file +var _0x84e2=['sequelize','exports','STRING'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x84e2,0x126));var _0x284e=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0x84e2[_0xcfc44];return _0x307a25;};'use strict';var Sequelize=require(_0x284e('0x0'));module[_0x284e('0x1')]={'name':{'type':Sequelize[_0x284e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 7ad13ed..f70a1e9 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 _0xa28a=['nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','getSubjects','getDescriptions','findOne','FreshsalesField','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','destroy','then','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x2aaf51,_0x2dbb49){var _0xbafd19=function(_0x158b2d){while(--_0x158b2d){_0x2aaf51['push'](_0x2aaf51['shift']());}};_0xbafd19(++_0x2dbb49);}(_0xa28a,0x1b2));var _0xaa28=function(_0x57fb08,_0x36b2bd){_0x57fb08=_0x57fb08-0x0;var _0x54b3b6=_0xa28a[_0x57fb08];return _0x54b3b6;};'use strict';var emlformat=require(_0xaa28('0x0'));var rimraf=require(_0xaa28('0x1'));var zipdir=require(_0xaa28('0x2'));var jsonpatch=require(_0xaa28('0x3'));var rp=require(_0xaa28('0x4'));var moment=require(_0xaa28('0x5'));var BPromise=require(_0xaa28('0x6'));var Mustache=require('mustache');var util=require(_0xaa28('0x7'));var path=require(_0xaa28('0x8'));var sox=require('sox');var csv=require(_0xaa28('0x9'));var ejs=require(_0xaa28('0xa'));var fs=require('fs');var fs_extra=require(_0xaa28('0xb'));var _=require('lodash');var squel=require(_0xaa28('0xc'));var crypto=require(_0xaa28('0xd'));var jsforce=require(_0xaa28('0xe'));var deskjs=require(_0xaa28('0xf'));var toCsv=require(_0xaa28('0x9'));var querystring=require(_0xaa28('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaa28('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaa28('0x12'));var hardwareService=require(_0xaa28('0x13'));var logger=require(_0xaa28('0x14'))(_0xaa28('0x15'));var utils=require(_0xaa28('0x16'));var config=require(_0xaa28('0x17'));var licenseUtil=require(_0xaa28('0x18'));var db=require(_0xaa28('0x19'))['db'];function respondWithStatusCode(_0xdba2f,_0x4e5d38){_0x4e5d38=_0x4e5d38||0xcc;return function(_0x5628ce){if(_0x5628ce){return _0xdba2f[_0xaa28('0x1a')](_0x4e5d38);}return _0xdba2f[_0xaa28('0x1b')](_0x4e5d38)[_0xaa28('0x1c')]();};}function respondWithResult(_0x1ae984,_0x5cd391){_0x5cd391=_0x5cd391||0xc8;return function(_0x4ff143){if(_0x4ff143){return _0x1ae984[_0xaa28('0x1b')](_0x5cd391)['json'](_0x4ff143);}};}function respondWithFilteredResult(_0x40b5f6,_0x835eca){return function(_0x3fb45b){if(_0x3fb45b){var _0x20deb9=typeof _0x835eca[_0xaa28('0x1d')]===_0xaa28('0x1e')&&typeof _0x835eca[_0xaa28('0x1f')]==='undefined';var _0x4a4a2c=_0x3fb45b[_0xaa28('0x20')];var _0x4a3989=_0x20deb9?0x0:_0x835eca[_0xaa28('0x1d')];var _0x282a78=_0x20deb9?_0x3fb45b['count']:_0x835eca['offset']+_0x835eca[_0xaa28('0x1f')];var _0xa450e2;if(_0x282a78>=_0x4a4a2c){_0x282a78=_0x4a4a2c;_0xa450e2=0xc8;}else{_0xa450e2=0xce;}_0x40b5f6[_0xaa28('0x1b')](_0xa450e2);return _0x40b5f6[_0xaa28('0x21')](_0xaa28('0x22'),_0x4a3989+'-'+_0x282a78+'/'+_0x4a4a2c)[_0xaa28('0x23')](_0x3fb45b);}return null;};}function patchUpdates(_0xf8e86b){return function(_0x3b4b96){try{jsonpatch[_0xaa28('0x24')](_0x3b4b96,_0xf8e86b,!![]);}catch(_0x33274a){return BPromise[_0xaa28('0x25')](_0x33274a);}return _0x3b4b96['save']();};}function saveUpdates(_0x210ae4,_0x1880ea){return function(_0x80bd32){if(_0x80bd32){return _0x80bd32['update'](_0x210ae4)['then'](function(_0x3e181c){return _0x3e181c;});}return null;};}function removeEntity(_0x294808,_0x7e9fc8){return function(_0x527121){if(_0x527121){return _0x527121[_0xaa28('0x26')]()[_0xaa28('0x27')](function(){_0x294808[_0xaa28('0x1b')](0xcc)[_0xaa28('0x1c')]();});}};}function handleEntityNotFound(_0x215f41,_0x516a40){return function(_0xf1716d){if(!_0xf1716d){_0x215f41[_0xaa28('0x1a')](0x194);}return _0xf1716d;};}function handleError(_0xf6e119,_0x227512){_0x227512=_0x227512||0x1f4;return function(_0x1c0624){logger[_0xaa28('0x28')](_0x1c0624[_0xaa28('0x29')]);if(_0x1c0624[_0xaa28('0x2a')]){delete _0x1c0624[_0xaa28('0x2a')];}_0xf6e119[_0xaa28('0x1b')](_0x227512)[_0xaa28('0x2b')](_0x1c0624);};}exports[_0xaa28('0x2c')]=function(_0x16a38c,_0x598a2e){var _0x59c383={},_0xd5b48e={},_0x3a3791={'count':0x0,'rows':[]};var _0x1033ce=_[_0xaa28('0x2d')](db[_0xaa28('0x2e')][_0xaa28('0x2f')],function(_0x596f06){return{'name':_0x596f06[_0xaa28('0x30')],'type':_0x596f06['type']['key']};});_0xd5b48e[_0xaa28('0x31')]=_[_0xaa28('0x2d')](_0x1033ce,_0xaa28('0x2a'));_0xd5b48e[_0xaa28('0x32')]=_[_0xaa28('0x33')](_0x16a38c[_0xaa28('0x32')]);_0xd5b48e[_0xaa28('0x34')]=_['intersection'](_0xd5b48e['model'],_0xd5b48e[_0xaa28('0x32')]);_0x59c383[_0xaa28('0x35')]=_[_0xaa28('0x36')](_0xd5b48e[_0xaa28('0x31')],qs['fields'](_0x16a38c[_0xaa28('0x32')][_0xaa28('0x37')]));_0x59c383[_0xaa28('0x35')]=_0x59c383[_0xaa28('0x35')][_0xaa28('0x38')]?_0x59c383[_0xaa28('0x35')]:_0xd5b48e[_0xaa28('0x31')];if(!_0x16a38c[_0xaa28('0x32')][_0xaa28('0x39')](_0xaa28('0x3a'))){_0x59c383[_0xaa28('0x1f')]=qs[_0xaa28('0x1f')](_0x16a38c[_0xaa28('0x32')]['limit']);_0x59c383['offset']=qs[_0xaa28('0x1d')](_0x16a38c[_0xaa28('0x32')][_0xaa28('0x1d')]);}_0x59c383[_0xaa28('0x3b')]=qs['sort'](_0x16a38c[_0xaa28('0x32')][_0xaa28('0x3c')]);_0x59c383[_0xaa28('0x3d')]=qs[_0xaa28('0x34')](_[_0xaa28('0x3e')](_0x16a38c[_0xaa28('0x32')],_0xd5b48e[_0xaa28('0x34')]),_0x1033ce);if(_0x16a38c['query']['filter']){_0x59c383[_0xaa28('0x3d')]=_[_0xaa28('0x3f')](_0x59c383[_0xaa28('0x3d')],{'$or':_[_0xaa28('0x2d')](_0x1033ce,function(_0xaa3017){if(_0xaa3017[_0xaa28('0x40')]!==_0xaa28('0x41')){var _0x5251c9={};_0x5251c9[_0xaa3017[_0xaa28('0x2a')]]={'$like':'%'+_0x16a38c[_0xaa28('0x32')][_0xaa28('0x42')]+'%'};return _0x5251c9;}})});}_0x59c383=_[_0xaa28('0x3f')]({},_0x59c383,_0x16a38c[_0xaa28('0x43')]);var _0x2ee1f7={'where':_0x59c383[_0xaa28('0x3d')]};return db[_0xaa28('0x2e')][_0xaa28('0x20')](_0x2ee1f7)[_0xaa28('0x27')](function(_0x75de3d){_0x3a3791['count']=_0x75de3d;if(_0x16a38c[_0xaa28('0x32')][_0xaa28('0x44')]){_0x59c383[_0xaa28('0x45')]=[{'all':!![]}];}return db[_0xaa28('0x2e')][_0xaa28('0x46')](_0x59c383);})[_0xaa28('0x27')](function(_0x426e85){_0x3a3791[_0xaa28('0x47')]=_0x426e85;return _0x3a3791;})[_0xaa28('0x27')](respondWithFilteredResult(_0x598a2e,_0x59c383))[_0xaa28('0x48')](handleError(_0x598a2e,null));};exports['show']=function(_0x1e6f38,_0x2481a6){var _0x3d96a0={'raw':![],'where':{'id':_0x1e6f38[_0xaa28('0x49')]['id']}},_0x3eb7ae={};_0x3eb7ae[_0xaa28('0x31')]=_['keys'](db['FreshsalesConfiguration'][_0xaa28('0x2f')]);_0x3eb7ae['query']=_[_0xaa28('0x33')](_0x1e6f38[_0xaa28('0x32')]);_0x3eb7ae[_0xaa28('0x34')]=_[_0xaa28('0x36')](_0x3eb7ae[_0xaa28('0x31')],_0x3eb7ae['query']);_0x3d96a0[_0xaa28('0x35')]=_[_0xaa28('0x36')](_0x3eb7ae[_0xaa28('0x31')],qs[_0xaa28('0x37')](_0x1e6f38['query'][_0xaa28('0x37')]));_0x3d96a0[_0xaa28('0x35')]=_0x3d96a0[_0xaa28('0x35')]['length']?_0x3d96a0[_0xaa28('0x35')]:_0x3eb7ae[_0xaa28('0x31')];if(_0x1e6f38[_0xaa28('0x32')][_0xaa28('0x44')]){_0x3d96a0[_0xaa28('0x45')]=[{'all':!![]}];}_0x3d96a0=_['merge']({},_0x3d96a0,_0x1e6f38['options']);return db['FreshsalesConfiguration'][_0xaa28('0x4a')](_0x3d96a0)[_0xaa28('0x27')](handleEntityNotFound(_0x2481a6,null))[_0xaa28('0x27')](respondWithResult(_0x2481a6,null))[_0xaa28('0x48')](handleError(_0x2481a6,null));};exports[_0xaa28('0x4b')]=function(_0x1b274c,_0x4338d2){return db[_0xaa28('0x2e')][_0xaa28('0x4b')](_0x1b274c[_0xaa28('0x4c')],{})[_0xaa28('0x27')](respondWithResult(_0x4338d2,0xc9))[_0xaa28('0x48')](handleError(_0x4338d2,null));};exports['update']=function(_0x55dc29,_0x3a82de){if(_0x55dc29[_0xaa28('0x4c')]['id']){delete _0x55dc29['body']['id'];}return db[_0xaa28('0x2e')]['find']({'where':{'id':_0x55dc29[_0xaa28('0x49')]['id']}})['then'](handleEntityNotFound(_0x3a82de,null))['then'](saveUpdates(_0x55dc29[_0xaa28('0x4c')],null))[_0xaa28('0x27')](respondWithResult(_0x3a82de,null))[_0xaa28('0x48')](handleError(_0x3a82de,null));};exports[_0xaa28('0x26')]=function(_0x256690,_0x1ef215){return db[_0xaa28('0x2e')][_0xaa28('0x4a')]({'where':{'id':_0x256690['params']['id']}})[_0xaa28('0x27')](handleEntityNotFound(_0x1ef215,null))[_0xaa28('0x27')](removeEntity(_0x1ef215,null))[_0xaa28('0x48')](handleError(_0x1ef215,null));};exports[_0xaa28('0x4d')]=function(_0x229eaa,_0x489f9b,_0x481c7f){var _0x1b71b5={};var _0x570618={};var _0x504f4e;var _0x23e580;return db[_0xaa28('0x2e')]['findOne']({'where':{'id':_0x229eaa['params']['id']}})['then'](handleEntityNotFound(_0x489f9b,null))[_0xaa28('0x27')](function(_0x12514a){if(_0x12514a){_0x504f4e=_0x12514a;_0x570618[_0xaa28('0x31')]=_[_0xaa28('0x33')](db['FreshsalesField'][_0xaa28('0x2f')]);_0x570618[_0xaa28('0x32')]=_[_0xaa28('0x33')](_0x229eaa[_0xaa28('0x32')]);_0x570618[_0xaa28('0x34')]=_[_0xaa28('0x36')](_0x570618[_0xaa28('0x31')],_0x570618[_0xaa28('0x32')]);_0x1b71b5[_0xaa28('0x35')]=_['intersection'](_0x570618['model'],qs[_0xaa28('0x37')](_0x229eaa['query'][_0xaa28('0x37')]));_0x1b71b5[_0xaa28('0x35')]=_0x1b71b5[_0xaa28('0x35')]['length']?_0x1b71b5[_0xaa28('0x35')]:_0x570618[_0xaa28('0x31')];_0x1b71b5[_0xaa28('0x3b')]=qs[_0xaa28('0x3c')](_0x229eaa['query'][_0xaa28('0x3c')]);_0x1b71b5[_0xaa28('0x3d')]=qs[_0xaa28('0x34')](_[_0xaa28('0x3e')](_0x229eaa['query'],_0x570618[_0xaa28('0x34')]));if(_0x229eaa[_0xaa28('0x32')][_0xaa28('0x42')]){_0x1b71b5[_0xaa28('0x3d')]=_[_0xaa28('0x3f')](_0x1b71b5[_0xaa28('0x3d')],{'$or':_[_0xaa28('0x2d')](_0x1b71b5[_0xaa28('0x35')],function(_0x3cfc03){var _0x4a7411={};_0x4a7411[_0x3cfc03]={'$like':'%'+_0x229eaa[_0xaa28('0x32')][_0xaa28('0x42')]+'%'};return _0x4a7411;})});}_0x1b71b5=_['merge']({},_0x1b71b5,_0x229eaa[_0xaa28('0x43')]);return _0x504f4e[_0xaa28('0x4d')](_0x1b71b5);}})[_0xaa28('0x27')](function(_0x440e75){if(_0x440e75){_0x23e580=_0x440e75[_0xaa28('0x38')];if(!_0x229eaa[_0xaa28('0x32')][_0xaa28('0x39')]('nolimit')){_0x1b71b5[_0xaa28('0x1f')]=qs[_0xaa28('0x1f')](_0x229eaa[_0xaa28('0x32')][_0xaa28('0x1f')]);_0x1b71b5[_0xaa28('0x1d')]=qs[_0xaa28('0x1d')](_0x229eaa[_0xaa28('0x32')][_0xaa28('0x1d')]);}return _0x504f4e[_0xaa28('0x4d')](_0x1b71b5);}})['then'](function(_0x4c4c4f){if(_0x4c4c4f){return _0x4c4c4f?{'count':_0x23e580,'rows':_0x4c4c4f}:null;}})[_0xaa28('0x27')](respondWithResult(_0x489f9b,null))[_0xaa28('0x48')](handleError(_0x489f9b,null));};exports[_0xaa28('0x4e')]=function(_0x4ee3dc,_0x10a951,_0x378c2e){var _0x3bda47={};var _0x50512e={};var _0x4bd90b;var _0x27dcb9;return db[_0xaa28('0x2e')][_0xaa28('0x4f')]({'where':{'id':_0x4ee3dc[_0xaa28('0x49')]['id']}})[_0xaa28('0x27')](handleEntityNotFound(_0x10a951,null))[_0xaa28('0x27')](function(_0x325580){if(_0x325580){_0x4bd90b=_0x325580;_0x50512e['model']=_[_0xaa28('0x33')](db[_0xaa28('0x50')][_0xaa28('0x2f')]);_0x50512e[_0xaa28('0x32')]=_[_0xaa28('0x33')](_0x4ee3dc['query']);_0x50512e[_0xaa28('0x34')]=_[_0xaa28('0x36')](_0x50512e[_0xaa28('0x31')],_0x50512e[_0xaa28('0x32')]);_0x3bda47['attributes']=_[_0xaa28('0x36')](_0x50512e[_0xaa28('0x31')],qs[_0xaa28('0x37')](_0x4ee3dc[_0xaa28('0x32')][_0xaa28('0x37')]));_0x3bda47[_0xaa28('0x35')]=_0x3bda47[_0xaa28('0x35')][_0xaa28('0x38')]?_0x3bda47['attributes']:_0x50512e[_0xaa28('0x31')];_0x3bda47['order']=qs[_0xaa28('0x3c')](_0x4ee3dc[_0xaa28('0x32')][_0xaa28('0x3c')]);_0x3bda47[_0xaa28('0x3d')]=qs[_0xaa28('0x34')](_[_0xaa28('0x3e')](_0x4ee3dc[_0xaa28('0x32')],_0x50512e['filters']));if(_0x4ee3dc[_0xaa28('0x32')][_0xaa28('0x42')]){_0x3bda47[_0xaa28('0x3d')]=_[_0xaa28('0x3f')](_0x3bda47['where'],{'$or':_[_0xaa28('0x2d')](_0x3bda47[_0xaa28('0x35')],function(_0x3638cd){var _0x79abf4={};_0x79abf4[_0x3638cd]={'$like':'%'+_0x4ee3dc['query']['filter']+'%'};return _0x79abf4;})});}_0x3bda47=_[_0xaa28('0x3f')]({},_0x3bda47,_0x4ee3dc[_0xaa28('0x43')]);return _0x4bd90b[_0xaa28('0x4e')](_0x3bda47);}})[_0xaa28('0x27')](function(_0x55530d){if(_0x55530d){_0x27dcb9=_0x55530d['length'];if(!_0x4ee3dc[_0xaa28('0x32')]['hasOwnProperty'](_0xaa28('0x3a'))){_0x3bda47[_0xaa28('0x1f')]=qs[_0xaa28('0x1f')](_0x4ee3dc[_0xaa28('0x32')]['limit']);_0x3bda47[_0xaa28('0x1d')]=qs['offset'](_0x4ee3dc['query'][_0xaa28('0x1d')]);}return _0x4bd90b[_0xaa28('0x4e')](_0x3bda47);}})['then'](function(_0x9297c0){if(_0x9297c0){return _0x9297c0?{'count':_0x27dcb9,'rows':_0x9297c0}:null;}})[_0xaa28('0x27')](respondWithResult(_0x10a951,null))[_0xaa28('0x48')](handleError(_0x10a951,null));};exports['getFields']=function(_0x4323a3,_0x5e5193,_0x38f140){var _0x1c82a2={};var _0x3c1148={};var _0x4bb599;var _0x38f857;return db[_0xaa28('0x2e')][_0xaa28('0x4f')]({'where':{'id':_0x4323a3[_0xaa28('0x49')]['id']}})[_0xaa28('0x27')](handleEntityNotFound(_0x5e5193,null))[_0xaa28('0x27')](function(_0x491d62){if(_0x491d62){_0x4bb599=_0x491d62;_0x3c1148[_0xaa28('0x31')]=_[_0xaa28('0x33')](db[_0xaa28('0x50')][_0xaa28('0x2f')]);_0x3c1148[_0xaa28('0x32')]=_['keys'](_0x4323a3[_0xaa28('0x32')]);_0x3c1148[_0xaa28('0x34')]=_[_0xaa28('0x36')](_0x3c1148[_0xaa28('0x31')],_0x3c1148[_0xaa28('0x32')]);_0x1c82a2['attributes']=_['intersection'](_0x3c1148['model'],qs[_0xaa28('0x37')](_0x4323a3[_0xaa28('0x32')][_0xaa28('0x37')]));_0x1c82a2['attributes']=_0x1c82a2[_0xaa28('0x35')][_0xaa28('0x38')]?_0x1c82a2[_0xaa28('0x35')]:_0x3c1148[_0xaa28('0x31')];_0x1c82a2[_0xaa28('0x3b')]=qs[_0xaa28('0x3c')](_0x4323a3[_0xaa28('0x32')][_0xaa28('0x3c')]);_0x1c82a2['where']=qs[_0xaa28('0x34')](_[_0xaa28('0x3e')](_0x4323a3[_0xaa28('0x32')],_0x3c1148[_0xaa28('0x34')]));if(_0x4323a3['query'][_0xaa28('0x42')]){_0x1c82a2[_0xaa28('0x3d')]=_[_0xaa28('0x3f')](_0x1c82a2[_0xaa28('0x3d')],{'$or':_[_0xaa28('0x2d')](_0x1c82a2['attributes'],function(_0x10a9bb){var _0x21cde9={};_0x21cde9[_0x10a9bb]={'$like':'%'+_0x4323a3[_0xaa28('0x32')][_0xaa28('0x42')]+'%'};return _0x21cde9;})});}_0x1c82a2=_['merge']({},_0x1c82a2,_0x4323a3[_0xaa28('0x43')]);return _0x4bb599[_0xaa28('0x51')](_0x1c82a2);}})['then'](function(_0x2d3282){if(_0x2d3282){_0x38f857=_0x2d3282[_0xaa28('0x38')];if(!_0x4323a3[_0xaa28('0x32')][_0xaa28('0x39')](_0xaa28('0x3a'))){_0x1c82a2[_0xaa28('0x1f')]=qs[_0xaa28('0x1f')](_0x4323a3[_0xaa28('0x32')][_0xaa28('0x1f')]);_0x1c82a2[_0xaa28('0x1d')]=qs[_0xaa28('0x1d')](_0x4323a3[_0xaa28('0x32')][_0xaa28('0x1d')]);}return _0x4bb599[_0xaa28('0x51')](_0x1c82a2);}})['then'](function(_0xad5f7d){if(_0xad5f7d){return _0xad5f7d?{'count':_0x38f857,'rows':_0xad5f7d}:null;}})[_0xaa28('0x27')](respondWithResult(_0x5e5193,null))['catch'](handleError(_0x5e5193,null));}; \ No newline at end of file +var _0x4be5=['then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','FreshsalesField','getSubjects','hasOwnProperty','getDescriptions','findOne','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update'];(function(_0x33a371,_0x2232ba){var _0x38876e=function(_0x5e7fbf){while(--_0x5e7fbf){_0x33a371['push'](_0x33a371['shift']());}};_0x38876e(++_0x2232ba);}(_0x4be5,0x131));var _0x54be=function(_0x1e6e4e,_0x2b1b09){_0x1e6e4e=_0x1e6e4e-0x0;var _0x3d746b=_0x4be5[_0x1e6e4e];return _0x3d746b;};'use strict';var emlformat=require(_0x54be('0x0'));var rimraf=require(_0x54be('0x1'));var zipdir=require(_0x54be('0x2'));var jsonpatch=require(_0x54be('0x3'));var rp=require(_0x54be('0x4'));var moment=require(_0x54be('0x5'));var BPromise=require(_0x54be('0x6'));var Mustache=require(_0x54be('0x7'));var util=require(_0x54be('0x8'));var path=require(_0x54be('0x9'));var sox=require(_0x54be('0xa'));var csv=require(_0x54be('0xb'));var ejs=require(_0x54be('0xc'));var fs=require('fs');var fs_extra=require(_0x54be('0xd'));var _=require(_0x54be('0xe'));var squel=require(_0x54be('0xf'));var crypto=require(_0x54be('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x54be('0x11'));var toCsv=require(_0x54be('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x54be('0x12'));var qs=require(_0x54be('0x13'));var as=require(_0x54be('0x14'));var hardwareService=require(_0x54be('0x15'));var logger=require(_0x54be('0x16'))(_0x54be('0x17'));var utils=require(_0x54be('0x18'));var config=require(_0x54be('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x54be('0x1a'))['db'];function respondWithStatusCode(_0x3e4db6,_0x4023fc){_0x4023fc=_0x4023fc||0xcc;return function(_0x4768f9){if(_0x4768f9){return _0x3e4db6[_0x54be('0x1b')](_0x4023fc);}return _0x3e4db6['status'](_0x4023fc)['end']();};}function respondWithResult(_0x2006e7,_0x34d0b3){_0x34d0b3=_0x34d0b3||0xc8;return function(_0x5841dc){if(_0x5841dc){return _0x2006e7[_0x54be('0x1c')](_0x34d0b3)[_0x54be('0x1d')](_0x5841dc);}};}function respondWithFilteredResult(_0x3473d9,_0x3d21ac){return function(_0x1f25bf){if(_0x1f25bf){var _0x2e27c0=typeof _0x3d21ac[_0x54be('0x1e')]===_0x54be('0x1f')&&typeof _0x3d21ac['limit']===_0x54be('0x1f');var _0x547cc1=_0x1f25bf[_0x54be('0x20')];var _0x13c5c4=_0x2e27c0?0x0:_0x3d21ac[_0x54be('0x1e')];var _0xfa72a2=_0x2e27c0?_0x1f25bf[_0x54be('0x20')]:_0x3d21ac[_0x54be('0x1e')]+_0x3d21ac['limit'];var _0x568b47;if(_0xfa72a2>=_0x547cc1){_0xfa72a2=_0x547cc1;_0x568b47=0xc8;}else{_0x568b47=0xce;}_0x3473d9[_0x54be('0x1c')](_0x568b47);return _0x3473d9[_0x54be('0x21')](_0x54be('0x22'),_0x13c5c4+'-'+_0xfa72a2+'/'+_0x547cc1)[_0x54be('0x1d')](_0x1f25bf);}return null;};}function patchUpdates(_0xbfe133){return function(_0x304046){try{jsonpatch[_0x54be('0x23')](_0x304046,_0xbfe133,!![]);}catch(_0x2b9248){return BPromise[_0x54be('0x24')](_0x2b9248);}return _0x304046[_0x54be('0x25')]();};}function saveUpdates(_0x5da316,_0x4888d5){return function(_0x10675c){if(_0x10675c){return _0x10675c[_0x54be('0x26')](_0x5da316)[_0x54be('0x27')](function(_0x4a76cc){return _0x4a76cc;});}return null;};}function removeEntity(_0x1885fb,_0x44798e){return function(_0x2d933f){if(_0x2d933f){return _0x2d933f[_0x54be('0x28')]()['then'](function(){_0x1885fb[_0x54be('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c9b14,_0x2680e2){return function(_0x20f652){if(!_0x20f652){_0x3c9b14[_0x54be('0x1b')](0x194);}return _0x20f652;};}function handleError(_0x1147ae,_0x4bfb4a){_0x4bfb4a=_0x4bfb4a||0x1f4;return function(_0x4e8dfa){logger[_0x54be('0x29')](_0x4e8dfa[_0x54be('0x2a')]);if(_0x4e8dfa[_0x54be('0x2b')]){delete _0x4e8dfa[_0x54be('0x2b')];}_0x1147ae[_0x54be('0x1c')](_0x4bfb4a)[_0x54be('0x2c')](_0x4e8dfa);};}exports[_0x54be('0x2d')]=function(_0x18487e,_0x49c217){var _0x2e71f7={},_0x3f3a16={},_0x561e35={'count':0x0,'rows':[]};var _0x5ce75d=_[_0x54be('0x2e')](db[_0x54be('0x2f')]['rawAttributes'],function(_0xc3b3bf){return{'name':_0xc3b3bf[_0x54be('0x30')],'type':_0xc3b3bf[_0x54be('0x31')][_0x54be('0x32')]};});_0x3f3a16[_0x54be('0x33')]=_['map'](_0x5ce75d,_0x54be('0x2b'));_0x3f3a16[_0x54be('0x34')]=_[_0x54be('0x35')](_0x18487e[_0x54be('0x34')]);_0x3f3a16['filters']=_[_0x54be('0x36')](_0x3f3a16[_0x54be('0x33')],_0x3f3a16['query']);_0x2e71f7[_0x54be('0x37')]=_['intersection'](_0x3f3a16[_0x54be('0x33')],qs[_0x54be('0x38')](_0x18487e[_0x54be('0x34')][_0x54be('0x38')]));_0x2e71f7[_0x54be('0x37')]=_0x2e71f7[_0x54be('0x37')][_0x54be('0x39')]?_0x2e71f7['attributes']:_0x3f3a16[_0x54be('0x33')];if(!_0x18487e[_0x54be('0x34')]['hasOwnProperty'](_0x54be('0x3a'))){_0x2e71f7['limit']=qs['limit'](_0x18487e[_0x54be('0x34')][_0x54be('0x3b')]);_0x2e71f7[_0x54be('0x1e')]=qs['offset'](_0x18487e[_0x54be('0x34')][_0x54be('0x1e')]);}_0x2e71f7[_0x54be('0x3c')]=qs[_0x54be('0x3d')](_0x18487e[_0x54be('0x34')][_0x54be('0x3d')]);_0x2e71f7[_0x54be('0x3e')]=qs[_0x54be('0x3f')](_[_0x54be('0x40')](_0x18487e[_0x54be('0x34')],_0x3f3a16[_0x54be('0x3f')]),_0x5ce75d);if(_0x18487e['query'][_0x54be('0x41')]){_0x2e71f7[_0x54be('0x3e')]=_[_0x54be('0x42')](_0x2e71f7[_0x54be('0x3e')],{'$or':_[_0x54be('0x2e')](_0x5ce75d,function(_0x448bc4){if(_0x448bc4[_0x54be('0x31')]!==_0x54be('0x43')){var _0x4d6453={};_0x4d6453[_0x448bc4[_0x54be('0x2b')]]={'$like':'%'+_0x18487e['query']['filter']+'%'};return _0x4d6453;}})});}_0x2e71f7=_[_0x54be('0x42')]({},_0x2e71f7,_0x18487e['options']);var _0x333e4c={'where':_0x2e71f7['where']};return db['FreshsalesConfiguration']['count'](_0x333e4c)[_0x54be('0x27')](function(_0x5f0844){_0x561e35[_0x54be('0x20')]=_0x5f0844;if(_0x18487e['query'][_0x54be('0x44')]){_0x2e71f7[_0x54be('0x45')]=[{'all':!![]}];}return db[_0x54be('0x2f')][_0x54be('0x46')](_0x2e71f7);})[_0x54be('0x27')](function(_0x38a9a0){_0x561e35[_0x54be('0x47')]=_0x38a9a0;return _0x561e35;})['then'](respondWithFilteredResult(_0x49c217,_0x2e71f7))[_0x54be('0x48')](handleError(_0x49c217,null));};exports[_0x54be('0x49')]=function(_0x22f034,_0x2d042b){var _0x256c2b={'raw':![],'where':{'id':_0x22f034[_0x54be('0x4a')]['id']}},_0x4277f8={};_0x4277f8[_0x54be('0x33')]=_[_0x54be('0x35')](db[_0x54be('0x2f')][_0x54be('0x4b')]);_0x4277f8[_0x54be('0x34')]=_[_0x54be('0x35')](_0x22f034['query']);_0x4277f8[_0x54be('0x3f')]=_[_0x54be('0x36')](_0x4277f8[_0x54be('0x33')],_0x4277f8[_0x54be('0x34')]);_0x256c2b[_0x54be('0x37')]=_[_0x54be('0x36')](_0x4277f8[_0x54be('0x33')],qs[_0x54be('0x38')](_0x22f034['query'][_0x54be('0x38')]));_0x256c2b[_0x54be('0x37')]=_0x256c2b[_0x54be('0x37')][_0x54be('0x39')]?_0x256c2b[_0x54be('0x37')]:_0x4277f8[_0x54be('0x33')];if(_0x22f034[_0x54be('0x34')][_0x54be('0x44')]){_0x256c2b[_0x54be('0x45')]=[{'all':!![]}];}_0x256c2b=_['merge']({},_0x256c2b,_0x22f034[_0x54be('0x4c')]);return db['FreshsalesConfiguration'][_0x54be('0x4d')](_0x256c2b)['then'](handleEntityNotFound(_0x2d042b,null))[_0x54be('0x27')](respondWithResult(_0x2d042b,null))['catch'](handleError(_0x2d042b,null));};exports[_0x54be('0x4e')]=function(_0x4e3fc9,_0x47d8b3){return db[_0x54be('0x2f')][_0x54be('0x4e')](_0x4e3fc9[_0x54be('0x4f')],{})['then'](respondWithResult(_0x47d8b3,0xc9))[_0x54be('0x48')](handleError(_0x47d8b3,null));};exports[_0x54be('0x26')]=function(_0x59086b,_0x20374b){if(_0x59086b[_0x54be('0x4f')]['id']){delete _0x59086b['body']['id'];}return db['FreshsalesConfiguration'][_0x54be('0x4d')]({'where':{'id':_0x59086b[_0x54be('0x4a')]['id']}})[_0x54be('0x27')](handleEntityNotFound(_0x20374b,null))[_0x54be('0x27')](saveUpdates(_0x59086b[_0x54be('0x4f')],null))[_0x54be('0x27')](respondWithResult(_0x20374b,null))[_0x54be('0x48')](handleError(_0x20374b,null));};exports['destroy']=function(_0x39d867,_0x1120d5){return db[_0x54be('0x2f')]['find']({'where':{'id':_0x39d867[_0x54be('0x4a')]['id']}})[_0x54be('0x27')](handleEntityNotFound(_0x1120d5,null))['then'](removeEntity(_0x1120d5,null))['catch'](handleError(_0x1120d5,null));};exports['getSubjects']=function(_0x3b5b76,_0x22b280,_0x3373d3){var _0x17e3e7={};var _0x329757={};var _0x409e99;var _0x511588;return db[_0x54be('0x2f')]['findOne']({'where':{'id':_0x3b5b76[_0x54be('0x4a')]['id']}})['then'](handleEntityNotFound(_0x22b280,null))[_0x54be('0x27')](function(_0x43426a){if(_0x43426a){_0x409e99=_0x43426a;_0x329757['model']=_[_0x54be('0x35')](db[_0x54be('0x50')][_0x54be('0x4b')]);_0x329757['query']=_[_0x54be('0x35')](_0x3b5b76[_0x54be('0x34')]);_0x329757[_0x54be('0x3f')]=_[_0x54be('0x36')](_0x329757[_0x54be('0x33')],_0x329757[_0x54be('0x34')]);_0x17e3e7[_0x54be('0x37')]=_[_0x54be('0x36')](_0x329757[_0x54be('0x33')],qs[_0x54be('0x38')](_0x3b5b76[_0x54be('0x34')][_0x54be('0x38')]));_0x17e3e7[_0x54be('0x37')]=_0x17e3e7['attributes'][_0x54be('0x39')]?_0x17e3e7['attributes']:_0x329757[_0x54be('0x33')];_0x17e3e7[_0x54be('0x3c')]=qs[_0x54be('0x3d')](_0x3b5b76[_0x54be('0x34')][_0x54be('0x3d')]);_0x17e3e7['where']=qs['filters'](_[_0x54be('0x40')](_0x3b5b76[_0x54be('0x34')],_0x329757[_0x54be('0x3f')]));if(_0x3b5b76[_0x54be('0x34')]['filter']){_0x17e3e7[_0x54be('0x3e')]=_[_0x54be('0x42')](_0x17e3e7[_0x54be('0x3e')],{'$or':_[_0x54be('0x2e')](_0x17e3e7['attributes'],function(_0x26b3b8){var _0x2036e1={};_0x2036e1[_0x26b3b8]={'$like':'%'+_0x3b5b76[_0x54be('0x34')]['filter']+'%'};return _0x2036e1;})});}_0x17e3e7=_['merge']({},_0x17e3e7,_0x3b5b76[_0x54be('0x4c')]);return _0x409e99[_0x54be('0x51')](_0x17e3e7);}})['then'](function(_0x5e9c0f){if(_0x5e9c0f){_0x511588=_0x5e9c0f[_0x54be('0x39')];if(!_0x3b5b76['query'][_0x54be('0x52')](_0x54be('0x3a'))){_0x17e3e7[_0x54be('0x3b')]=qs[_0x54be('0x3b')](_0x3b5b76[_0x54be('0x34')]['limit']);_0x17e3e7[_0x54be('0x1e')]=qs['offset'](_0x3b5b76[_0x54be('0x34')][_0x54be('0x1e')]);}return _0x409e99[_0x54be('0x51')](_0x17e3e7);}})[_0x54be('0x27')](function(_0x18134f){if(_0x18134f){return _0x18134f?{'count':_0x511588,'rows':_0x18134f}:null;}})[_0x54be('0x27')](respondWithResult(_0x22b280,null))[_0x54be('0x48')](handleError(_0x22b280,null));};exports[_0x54be('0x53')]=function(_0x2a823,_0x35272f,_0x449362){var _0x3b54af={};var _0x257648={};var _0x563dfc;var _0xa6bfe4;return db[_0x54be('0x2f')][_0x54be('0x54')]({'where':{'id':_0x2a823[_0x54be('0x4a')]['id']}})[_0x54be('0x27')](handleEntityNotFound(_0x35272f,null))[_0x54be('0x27')](function(_0x5a2ac6){if(_0x5a2ac6){_0x563dfc=_0x5a2ac6;_0x257648['model']=_[_0x54be('0x35')](db['FreshsalesField']['rawAttributes']);_0x257648[_0x54be('0x34')]=_['keys'](_0x2a823[_0x54be('0x34')]);_0x257648[_0x54be('0x3f')]=_[_0x54be('0x36')](_0x257648['model'],_0x257648[_0x54be('0x34')]);_0x3b54af[_0x54be('0x37')]=_[_0x54be('0x36')](_0x257648[_0x54be('0x33')],qs['fields'](_0x2a823[_0x54be('0x34')][_0x54be('0x38')]));_0x3b54af[_0x54be('0x37')]=_0x3b54af[_0x54be('0x37')]['length']?_0x3b54af[_0x54be('0x37')]:_0x257648['model'];_0x3b54af[_0x54be('0x3c')]=qs[_0x54be('0x3d')](_0x2a823[_0x54be('0x34')][_0x54be('0x3d')]);_0x3b54af[_0x54be('0x3e')]=qs[_0x54be('0x3f')](_[_0x54be('0x40')](_0x2a823['query'],_0x257648[_0x54be('0x3f')]));if(_0x2a823[_0x54be('0x34')][_0x54be('0x41')]){_0x3b54af[_0x54be('0x3e')]=_[_0x54be('0x42')](_0x3b54af[_0x54be('0x3e')],{'$or':_[_0x54be('0x2e')](_0x3b54af[_0x54be('0x37')],function(_0x471df9){var _0x30124a={};_0x30124a[_0x471df9]={'$like':'%'+_0x2a823[_0x54be('0x34')]['filter']+'%'};return _0x30124a;})});}_0x3b54af=_[_0x54be('0x42')]({},_0x3b54af,_0x2a823[_0x54be('0x4c')]);return _0x563dfc[_0x54be('0x53')](_0x3b54af);}})[_0x54be('0x27')](function(_0x226233){if(_0x226233){_0xa6bfe4=_0x226233['length'];if(!_0x2a823[_0x54be('0x34')]['hasOwnProperty'](_0x54be('0x3a'))){_0x3b54af[_0x54be('0x3b')]=qs[_0x54be('0x3b')](_0x2a823[_0x54be('0x34')]['limit']);_0x3b54af[_0x54be('0x1e')]=qs[_0x54be('0x1e')](_0x2a823[_0x54be('0x34')][_0x54be('0x1e')]);}return _0x563dfc[_0x54be('0x53')](_0x3b54af);}})[_0x54be('0x27')](function(_0x46a6d9){if(_0x46a6d9){return _0x46a6d9?{'count':_0xa6bfe4,'rows':_0x46a6d9}:null;}})['then'](respondWithResult(_0x35272f,null))[_0x54be('0x48')](handleError(_0x35272f,null));};exports['getFields']=function(_0x279610,_0x47a4cd,_0x429bf8){var _0x5b43d8={};var _0x11a08a={};var _0x1a3112;var _0xdc1844;return db[_0x54be('0x2f')]['findOne']({'where':{'id':_0x279610[_0x54be('0x4a')]['id']}})['then'](handleEntityNotFound(_0x47a4cd,null))['then'](function(_0x211e00){if(_0x211e00){_0x1a3112=_0x211e00;_0x11a08a[_0x54be('0x33')]=_['keys'](db['FreshsalesField'][_0x54be('0x4b')]);_0x11a08a[_0x54be('0x34')]=_[_0x54be('0x35')](_0x279610[_0x54be('0x34')]);_0x11a08a[_0x54be('0x3f')]=_[_0x54be('0x36')](_0x11a08a[_0x54be('0x33')],_0x11a08a[_0x54be('0x34')]);_0x5b43d8[_0x54be('0x37')]=_[_0x54be('0x36')](_0x11a08a[_0x54be('0x33')],qs[_0x54be('0x38')](_0x279610[_0x54be('0x34')][_0x54be('0x38')]));_0x5b43d8[_0x54be('0x37')]=_0x5b43d8[_0x54be('0x37')][_0x54be('0x39')]?_0x5b43d8['attributes']:_0x11a08a[_0x54be('0x33')];_0x5b43d8[_0x54be('0x3c')]=qs[_0x54be('0x3d')](_0x279610[_0x54be('0x34')][_0x54be('0x3d')]);_0x5b43d8[_0x54be('0x3e')]=qs[_0x54be('0x3f')](_[_0x54be('0x40')](_0x279610['query'],_0x11a08a[_0x54be('0x3f')]));if(_0x279610[_0x54be('0x34')][_0x54be('0x41')]){_0x5b43d8['where']=_['merge'](_0x5b43d8['where'],{'$or':_[_0x54be('0x2e')](_0x5b43d8[_0x54be('0x37')],function(_0x1b95dd){var _0x5695a9={};_0x5695a9[_0x1b95dd]={'$like':'%'+_0x279610['query']['filter']+'%'};return _0x5695a9;})});}_0x5b43d8=_[_0x54be('0x42')]({},_0x5b43d8,_0x279610['options']);return _0x1a3112[_0x54be('0x55')](_0x5b43d8);}})[_0x54be('0x27')](function(_0x2c217a){if(_0x2c217a){_0xdc1844=_0x2c217a['length'];if(!_0x279610[_0x54be('0x34')][_0x54be('0x52')](_0x54be('0x3a'))){_0x5b43d8[_0x54be('0x3b')]=qs[_0x54be('0x3b')](_0x279610[_0x54be('0x34')][_0x54be('0x3b')]);_0x5b43d8[_0x54be('0x1e')]=qs[_0x54be('0x1e')](_0x279610['query'][_0x54be('0x1e')]);}return _0x1a3112[_0x54be('0x55')](_0x5b43d8);}})[_0x54be('0x27')](function(_0x4166b2){if(_0x4166b2){return _0x4166b2?{'count':_0xdc1844,'rows':_0x4166b2}:null;}})[_0x54be('0x27')](respondWithResult(_0x47a4cd,null))[_0x54be('0x48')](handleError(_0x47a4cd,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index f39acd0..8375128 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 _0x237d=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','lodash','util','api','moment'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x237d,0x14c));var _0xd237=function(_0x30e96f,_0x12dd96){_0x30e96f=_0x30e96f-0x0;var _0x356214=_0x237d[_0x30e96f];return _0x356214;};'use strict';var _=require(_0xd237('0x0'));var util=require(_0xd237('0x1'));var logger=require('../../config/logger')(_0xd237('0x2'));var moment=require(_0xd237('0x3'));var BPromise=require(_0xd237('0x4'));var rp=require(_0xd237('0x5'));var fs=require('fs');var path=require(_0xd237('0x6'));var rimraf=require(_0xd237('0x7'));var config=require(_0xd237('0x8'));var attributes=require(_0xd237('0x9'));module[_0xd237('0xa')]=function(_0x274ad6,_0x4c52b0){return _0x274ad6[_0xd237('0xb')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcdd=['path','rimraf','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x50a3b4,_0x573eea){var _0x1370e9=function(_0x377092){while(--_0x377092){_0x50a3b4['push'](_0x50a3b4['shift']());}};_0x1370e9(++_0x573eea);}(_0xfcdd,0x1b3));var _0xdfcd=function(_0x1e28ef,_0x359f1b){_0x1e28ef=_0x1e28ef-0x0;var _0x2a197a=_0xfcdd[_0x1e28ef];return _0x2a197a;};'use strict';var _=require(_0xdfcd('0x0'));var util=require(_0xdfcd('0x1'));var logger=require(_0xdfcd('0x2'))(_0xdfcd('0x3'));var moment=require(_0xdfcd('0x4'));var BPromise=require(_0xdfcd('0x5'));var rp=require(_0xdfcd('0x6'));var fs=require('fs');var path=require(_0xdfcd('0x7'));var rimraf=require(_0xdfcd('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfcd('0x9'));module['exports']=function(_0x100b6a,_0x18de3e){return _0x100b6a[_0xdfcd('0xa')](_0xdfcd('0xb'),attributes,{'tableName':_0xdfcd('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 b87e262..30a83af 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 _0xfc6d=['FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x18ef41,_0xb6c5a){var _0x2868c2=function(_0x3a1135){while(--_0x3a1135){_0x18ef41['push'](_0x18ef41['shift']());}};_0x2868c2(++_0xb6c5a);}(_0xfc6d,0x84));var _0xdfc6=function(_0x5d4384,_0x17bebf){_0x5d4384=_0x5d4384-0x0;var _0x5eaadd=_0xfc6d[_0x5d4384];return _0x5eaadd;};'use strict';var _=require(_0xdfc6('0x0'));var util=require('util');var moment=require(_0xdfc6('0x1'));var BPromise=require(_0xdfc6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdfc6('0x3'))['db'];var utils=require(_0xdfc6('0x4'));var logger=require(_0xdfc6('0x5'))(_0xdfc6('0x6'));var config=require(_0xdfc6('0x7'));var jayson=require(_0xdfc6('0x8'));var client=jayson['client'][_0xdfc6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x313603,_0x5494fd,_0x5998e9){return new BPromise(function(_0x55d51e,_0x2ec0db){return client[_0xdfc6('0xa')](_0x313603,_0x5998e9)[_0xdfc6('0xb')](function(_0x48114e){logger['info'](_0xdfc6('0xc'),_0x5494fd,_0xdfc6('0xd'));logger[_0xdfc6('0xe')](_0xdfc6('0xf'),_0x5494fd,_0xdfc6('0xd'),JSON[_0xdfc6('0x10')](_0x48114e));if(_0x48114e['error']){if(_0x48114e[_0xdfc6('0x11')][_0xdfc6('0x12')]===0x1f4){logger[_0xdfc6('0x11')](_0xdfc6('0xc'),_0x5494fd,_0x48114e['error'][_0xdfc6('0x13')]);return _0x2ec0db(_0x48114e[_0xdfc6('0x11')][_0xdfc6('0x13')]);}logger[_0xdfc6('0x11')](_0xdfc6('0xc'),_0x5494fd,_0x48114e[_0xdfc6('0x11')][_0xdfc6('0x13')]);return _0x55d51e(_0x48114e[_0xdfc6('0x11')][_0xdfc6('0x13')]);}else{logger['info'](_0xdfc6('0xc'),_0x5494fd,_0xdfc6('0xd'));_0x55d51e(_0x48114e['result']['message']);}})[_0xdfc6('0x14')](function(_0x3d1f62){logger[_0xdfc6('0x11')](_0xdfc6('0xc'),_0x5494fd,_0x3d1f62);_0x2ec0db(_0x3d1f62);});});} \ No newline at end of file +var _0x97c3=['info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x51d436,_0x6854b8){var _0x4ade52=function(_0x2aa260){while(--_0x2aa260){_0x51d436['push'](_0x51d436['shift']());}};_0x4ade52(++_0x6854b8);}(_0x97c3,0x1c3));var _0x397c=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x97c3[_0x2b5513];return _0x578fd2;};'use strict';var _=require(_0x397c('0x0'));var util=require('util');var moment=require(_0x397c('0x1'));var BPromise=require(_0x397c('0x2'));var rs=require(_0x397c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x397c('0x4'))(_0x397c('0x5'));var config=require(_0x397c('0x6'));var jayson=require(_0x397c('0x7'));var client=jayson[_0x397c('0x8')][_0x397c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x231fb4,_0x3f91ce,_0xca967b){return new BPromise(function(_0x3d4964,_0x11df72){return client[_0x397c('0xa')](_0x231fb4,_0xca967b)['then'](function(_0x312a47){logger[_0x397c('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3f91ce,_0x397c('0xc'));logger[_0x397c('0xd')](_0x397c('0xe'),_0x3f91ce,_0x397c('0xc'),JSON[_0x397c('0xf')](_0x312a47));if(_0x312a47[_0x397c('0x10')]){if(_0x312a47[_0x397c('0x10')][_0x397c('0x11')]===0x1f4){logger[_0x397c('0x10')](_0x397c('0x12'),_0x3f91ce,_0x312a47[_0x397c('0x10')][_0x397c('0x13')]);return _0x11df72(_0x312a47[_0x397c('0x10')][_0x397c('0x13')]);}logger['error'](_0x397c('0x12'),_0x3f91ce,_0x312a47[_0x397c('0x10')][_0x397c('0x13')]);return _0x3d4964(_0x312a47[_0x397c('0x10')][_0x397c('0x13')]);}else{logger[_0x397c('0xb')](_0x397c('0x12'),_0x3f91ce,_0x397c('0xc'));_0x3d4964(_0x312a47[_0x397c('0x14')][_0x397c('0x13')]);}})[_0x397c('0x15')](function(_0x4608c4){logger[_0x397c('0x10')](_0x397c('0x12'),_0x3f91ce,_0x4608c4);_0x11df72(_0x4608c4);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 7d133ac..ae2e39c 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 _0xd1d4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra'];(function(_0x40c7d2,_0x2d7b08){var _0x3aeec6=function(_0x594bfe){while(--_0x594bfe){_0x40c7d2['push'](_0x40c7d2['shift']());}};_0x3aeec6(++_0x2d7b08);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xd1d4[_0x17928f];return _0x500b63;};'use strict';var multer=require(_0x4d1d('0x0'));var util=require(_0x4d1d('0x1'));var path=require('path');var timeout=require(_0x4d1d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4d1d('0x3'));var auth=require(_0x4d1d('0x4'));var interaction=require(_0x4d1d('0x5'));var config=require(_0x4d1d('0x6'));var controller=require(_0x4d1d('0x7'));router[_0x4d1d('0x8')]('/',auth[_0x4d1d('0x9')](),controller[_0x4d1d('0xa')]);router[_0x4d1d('0x8')](_0x4d1d('0xb'),auth[_0x4d1d('0x9')](),controller['show']);router['post']('/',auth[_0x4d1d('0x9')](),controller[_0x4d1d('0xc')]);router['put'](_0x4d1d('0xb'),auth[_0x4d1d('0x9')](),controller[_0x4d1d('0xd')]);router[_0x4d1d('0xe')](_0x4d1d('0xb'),auth[_0x4d1d('0x9')](),controller[_0x4d1d('0xf')]);module[_0x4d1d('0x10')]=router; \ No newline at end of file +var _0x59c3=['delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','show','post','put','update'];(function(_0x56975e,_0x587d46){var _0x16c8d2=function(_0x2b52e6){while(--_0x2b52e6){_0x56975e['push'](_0x56975e['shift']());}};_0x16c8d2(++_0x587d46);}(_0x59c3,0x133));var _0x359c=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x59c3[_0x2d8fc2];return _0x3a9e53;};'use strict';var multer=require(_0x359c('0x0'));var util=require(_0x359c('0x1'));var path=require(_0x359c('0x2'));var timeout=require(_0x359c('0x3'));var express=require(_0x359c('0x4'));var router=express[_0x359c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x359c('0x6'));var interaction=require(_0x359c('0x7'));var config=require(_0x359c('0x8'));var controller=require(_0x359c('0x9'));router[_0x359c('0xa')]('/',auth[_0x359c('0xb')](),controller['index']);router[_0x359c('0xa')]('/:id',auth[_0x359c('0xb')](),controller[_0x359c('0xc')]);router[_0x359c('0xd')]('/',auth[_0x359c('0xb')](),controller['create']);router[_0x359c('0xe')]('/:id',auth[_0x359c('0xb')](),controller[_0x359c('0xf')]);router[_0x359c('0x10')](_0x359c('0x11'),auth[_0x359c('0xb')](),controller[_0x359c('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index ecb43c2..c77b554 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 _0xc7d4=['STRING','variable','BOOLEAN','sequelize','ENUM','string','keyValue','picklist'];(function(_0x5516c7,_0x3d46e4){var _0x314076=function(_0x3e3b38){while(--_0x3e3b38){_0x5516c7['push'](_0x5516c7['shift']());}};_0x314076(++_0x3d46e4);}(_0xc7d4,0x1e3));var _0x4c7d=function(_0x762d44,_0x276b18){_0x762d44=_0x762d44-0x0;var _0x1308ae=_0xc7d4[_0x762d44];return _0x1308ae;};'use strict';var Sequelize=require(_0x4c7d('0x0'));module['exports']={'type':{'type':Sequelize[_0x4c7d('0x1')](_0x4c7d('0x2'),'variable','customVariable',_0x4c7d('0x3'),_0x4c7d('0x4')),'defaultValue':_0x4c7d('0x2')},'content':{'type':Sequelize[_0x4c7d('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4c7d('0x1')]('string',_0x4c7d('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x4c7d('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4c7d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4c7d('0x5')]}}; \ No newline at end of file +var _0xb552=['sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb552,0x1b0));var _0x2b55=function(_0xdffd10,_0x57bcc7){_0xdffd10=_0xdffd10-0x0;var _0x2cfda3=_0xb552[_0xdffd10];return _0x2cfda3;};'use strict';var Sequelize=require(_0x2b55('0x0'));module[_0x2b55('0x1')]={'type':{'type':Sequelize[_0x2b55('0x2')](_0x2b55('0x3'),'variable',_0x2b55('0x4'),_0x2b55('0x5'),_0x2b55('0x6')),'defaultValue':_0x2b55('0x3')},'content':{'type':Sequelize[_0x2b55('0x7')]},'key':{'type':Sequelize[_0x2b55('0x7')]},'keyType':{'type':Sequelize[_0x2b55('0x2')]('string','variable',_0x2b55('0x4'))},'keyContent':{'type':Sequelize[_0x2b55('0x7')]},'idField':{'type':Sequelize[_0x2b55('0x7')]},'nameField':{'type':Sequelize[_0x2b55('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2b55('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index acab7b6..910e555 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 _0x1e12=['catch','show','fields','includeAll','include','options','find','create','body','params','rimraf','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','index','map','FreshsalesField','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','findAll'];(function(_0x23b878,_0x41e5a0){var _0x3e4d14=function(_0x2b8651){while(--_0x2b8651){_0x23b878['push'](_0x23b878['shift']());}};_0x3e4d14(++_0x41e5a0);}(_0x1e12,0x172));var _0x21e1=function(_0x47f6ce,_0x1b7377){_0x47f6ce=_0x47f6ce-0x0;var _0x3b475f=_0x1e12[_0x47f6ce];return _0x3b475f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21e1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x21e1('0x1'));var moment=require('moment');var BPromise=require(_0x21e1('0x2'));var Mustache=require(_0x21e1('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x21e1('0x4'));var ejs=require(_0x21e1('0x5'));var fs=require('fs');var fs_extra=require(_0x21e1('0x6'));var _=require(_0x21e1('0x7'));var squel=require(_0x21e1('0x8'));var crypto=require(_0x21e1('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x21e1('0xa'));var toCsv=require('to-csv');var querystring=require(_0x21e1('0xb'));var Papa=require(_0x21e1('0xc'));var Redis=require('ioredis');var authService=require(_0x21e1('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x21e1('0xe'));var hardwareService=require(_0x21e1('0xf'));var logger=require(_0x21e1('0x10'))(_0x21e1('0x11'));var utils=require(_0x21e1('0x12'));var config=require(_0x21e1('0x13'));var licenseUtil=require(_0x21e1('0x14'));var db=require(_0x21e1('0x15'))['db'];function respondWithStatusCode(_0x267772,_0x38cef0){_0x38cef0=_0x38cef0||0xcc;return function(_0x2370af){if(_0x2370af){return _0x267772[_0x21e1('0x16')](_0x38cef0);}return _0x267772[_0x21e1('0x17')](_0x38cef0)['end']();};}function respondWithResult(_0x462950,_0x313bdc){_0x313bdc=_0x313bdc||0xc8;return function(_0x3a156f){if(_0x3a156f){return _0x462950[_0x21e1('0x17')](_0x313bdc)[_0x21e1('0x18')](_0x3a156f);}};}function respondWithFilteredResult(_0x18f33b,_0x396544){return function(_0x56ad17){if(_0x56ad17){var _0x409cbb=typeof _0x396544[_0x21e1('0x19')]===_0x21e1('0x1a')&&typeof _0x396544[_0x21e1('0x1b')]===_0x21e1('0x1a');var _0x2ca686=_0x56ad17[_0x21e1('0x1c')];var _0x376ff8=_0x409cbb?0x0:_0x396544[_0x21e1('0x19')];var _0x1e39c5=_0x409cbb?_0x56ad17[_0x21e1('0x1c')]:_0x396544['offset']+_0x396544[_0x21e1('0x1b')];var _0x23a581;if(_0x1e39c5>=_0x2ca686){_0x1e39c5=_0x2ca686;_0x23a581=0xc8;}else{_0x23a581=0xce;}_0x18f33b[_0x21e1('0x17')](_0x23a581);return _0x18f33b[_0x21e1('0x1d')](_0x21e1('0x1e'),_0x376ff8+'-'+_0x1e39c5+'/'+_0x2ca686)[_0x21e1('0x18')](_0x56ad17);}return null;};}function patchUpdates(_0x1b39d1){return function(_0x19cc8c){try{jsonpatch[_0x21e1('0x1f')](_0x19cc8c,_0x1b39d1,!![]);}catch(_0x4f428a){return BPromise[_0x21e1('0x20')](_0x4f428a);}return _0x19cc8c['save']();};}function saveUpdates(_0x2f2ab0,_0x62e1ca){return function(_0x394754){if(_0x394754){return _0x394754[_0x21e1('0x21')](_0x2f2ab0)[_0x21e1('0x22')](function(_0x40d2a5){return _0x40d2a5;});}return null;};}function removeEntity(_0x161a03,_0x2e0ff1){return function(_0x2cee24){if(_0x2cee24){return _0x2cee24[_0x21e1('0x23')]()[_0x21e1('0x22')](function(){_0x161a03['status'](0xcc)[_0x21e1('0x24')]();});}};}function handleEntityNotFound(_0x458226,_0x3772f3){return function(_0x2cfba1){if(!_0x2cfba1){_0x458226[_0x21e1('0x16')](0x194);}return _0x2cfba1;};}function handleError(_0x496b76,_0x105b89){_0x105b89=_0x105b89||0x1f4;return function(_0x419fd){logger[_0x21e1('0x25')](_0x419fd[_0x21e1('0x26')]);if(_0x419fd[_0x21e1('0x27')]){delete _0x419fd[_0x21e1('0x27')];}_0x496b76[_0x21e1('0x17')](_0x105b89)['send'](_0x419fd);};}exports[_0x21e1('0x28')]=function(_0x10778e,_0x3c15f8){var _0x24ca25={},_0x30c814={},_0x3cf24c={'count':0x0,'rows':[]};var _0x5f4d5b=_[_0x21e1('0x29')](db[_0x21e1('0x2a')][_0x21e1('0x2b')],function(_0x58685d){return{'name':_0x58685d['fieldName'],'type':_0x58685d[_0x21e1('0x2c')]['key']};});_0x30c814[_0x21e1('0x2d')]=_['map'](_0x5f4d5b,_0x21e1('0x27'));_0x30c814[_0x21e1('0x2e')]=_[_0x21e1('0x2f')](_0x10778e['query']);_0x30c814[_0x21e1('0x30')]=_[_0x21e1('0x31')](_0x30c814[_0x21e1('0x2d')],_0x30c814[_0x21e1('0x2e')]);_0x24ca25['attributes']=_[_0x21e1('0x31')](_0x30c814[_0x21e1('0x2d')],qs['fields'](_0x10778e[_0x21e1('0x2e')]['fields']));_0x24ca25[_0x21e1('0x32')]=_0x24ca25[_0x21e1('0x32')][_0x21e1('0x33')]?_0x24ca25['attributes']:_0x30c814['model'];if(!_0x10778e[_0x21e1('0x2e')][_0x21e1('0x34')](_0x21e1('0x35'))){_0x24ca25[_0x21e1('0x1b')]=qs[_0x21e1('0x1b')](_0x10778e['query'][_0x21e1('0x1b')]);_0x24ca25[_0x21e1('0x19')]=qs[_0x21e1('0x19')](_0x10778e[_0x21e1('0x2e')][_0x21e1('0x19')]);}_0x24ca25[_0x21e1('0x36')]=qs[_0x21e1('0x37')](_0x10778e[_0x21e1('0x2e')][_0x21e1('0x37')]);_0x24ca25[_0x21e1('0x38')]=qs[_0x21e1('0x30')](_[_0x21e1('0x39')](_0x10778e[_0x21e1('0x2e')],_0x30c814[_0x21e1('0x30')]),_0x5f4d5b);if(_0x10778e['query'][_0x21e1('0x3a')]){_0x24ca25['where']=_['merge'](_0x24ca25[_0x21e1('0x38')],{'$or':_['map'](_0x5f4d5b,function(_0x35c765){if(_0x35c765[_0x21e1('0x2c')]!==_0x21e1('0x3b')){var _0xde39e5={};_0xde39e5[_0x35c765['name']]={'$like':'%'+_0x10778e[_0x21e1('0x2e')][_0x21e1('0x3a')]+'%'};return _0xde39e5;}})});}_0x24ca25=_[_0x21e1('0x3c')]({},_0x24ca25,_0x10778e['options']);var _0x551eb7={'where':_0x24ca25['where']};return db[_0x21e1('0x2a')][_0x21e1('0x1c')](_0x551eb7)[_0x21e1('0x22')](function(_0x5ab7d6){_0x3cf24c[_0x21e1('0x1c')]=_0x5ab7d6;if(_0x10778e['query']['includeAll']){_0x24ca25['include']=[{'all':!![]}];}return db[_0x21e1('0x2a')][_0x21e1('0x3d')](_0x24ca25);})[_0x21e1('0x22')](function(_0x3b6bf0){_0x3cf24c['rows']=_0x3b6bf0;return _0x3cf24c;})[_0x21e1('0x22')](respondWithFilteredResult(_0x3c15f8,_0x24ca25))[_0x21e1('0x3e')](handleError(_0x3c15f8,null));};exports[_0x21e1('0x3f')]=function(_0x528391,_0x18d633){var _0x51e810={'raw':!![],'where':{'id':_0x528391['params']['id']}},_0x2b51dd={};_0x2b51dd[_0x21e1('0x2d')]=_[_0x21e1('0x2f')](db[_0x21e1('0x2a')][_0x21e1('0x2b')]);_0x2b51dd[_0x21e1('0x2e')]=_['keys'](_0x528391[_0x21e1('0x2e')]);_0x2b51dd[_0x21e1('0x30')]=_[_0x21e1('0x31')](_0x2b51dd[_0x21e1('0x2d')],_0x2b51dd[_0x21e1('0x2e')]);_0x51e810[_0x21e1('0x32')]=_[_0x21e1('0x31')](_0x2b51dd[_0x21e1('0x2d')],qs[_0x21e1('0x40')](_0x528391['query']['fields']));_0x51e810[_0x21e1('0x32')]=_0x51e810[_0x21e1('0x32')]['length']?_0x51e810[_0x21e1('0x32')]:_0x2b51dd[_0x21e1('0x2d')];if(_0x528391[_0x21e1('0x2e')][_0x21e1('0x41')]){_0x51e810[_0x21e1('0x42')]=[{'all':!![]}];}_0x51e810=_[_0x21e1('0x3c')]({},_0x51e810,_0x528391[_0x21e1('0x43')]);return db['FreshsalesField'][_0x21e1('0x44')](_0x51e810)[_0x21e1('0x22')](handleEntityNotFound(_0x18d633,null))[_0x21e1('0x22')](respondWithResult(_0x18d633,null))[_0x21e1('0x3e')](handleError(_0x18d633,null));};exports[_0x21e1('0x45')]=function(_0x571a92,_0x124521){return db[_0x21e1('0x2a')][_0x21e1('0x45')](_0x571a92[_0x21e1('0x46')],{})[_0x21e1('0x22')](respondWithResult(_0x124521,0xc9))[_0x21e1('0x3e')](handleError(_0x124521,null));};exports[_0x21e1('0x21')]=function(_0x8feb0b,_0x25b7e2){if(_0x8feb0b[_0x21e1('0x46')]['id']){delete _0x8feb0b['body']['id'];}return db[_0x21e1('0x2a')][_0x21e1('0x44')]({'where':{'id':_0x8feb0b[_0x21e1('0x47')]['id']}})[_0x21e1('0x22')](handleEntityNotFound(_0x25b7e2,null))[_0x21e1('0x22')](saveUpdates(_0x8feb0b[_0x21e1('0x46')],null))[_0x21e1('0x22')](respondWithResult(_0x25b7e2,null))['catch'](handleError(_0x25b7e2,null));};exports[_0x21e1('0x23')]=function(_0x481a9a,_0x5587ef){return db[_0x21e1('0x2a')][_0x21e1('0x44')]({'where':{'id':_0x481a9a[_0x21e1('0x47')]['id']}})[_0x21e1('0x22')](handleEntityNotFound(_0x5587ef,null))[_0x21e1('0x22')](removeEntity(_0x5587ef,null))[_0x21e1('0x3e')](handleError(_0x5587ef,null));}; \ No newline at end of file +var _0xc9ee=['filter','merge','type','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','index','FreshsalesField','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0xc9ee,0xa2));var _0xec9e=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0xc9ee[_0x36c6eb];return _0x30675b;};'use strict';var emlformat=require(_0xec9e('0x0'));var rimraf=require(_0xec9e('0x1'));var zipdir=require(_0xec9e('0x2'));var jsonpatch=require(_0xec9e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xec9e('0x4'));var Mustache=require(_0xec9e('0x5'));var util=require(_0xec9e('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec9e('0x7'));var squel=require(_0xec9e('0x8'));var crypto=require(_0xec9e('0x9'));var jsforce=require(_0xec9e('0xa'));var deskjs=require(_0xec9e('0xb'));var toCsv=require(_0xec9e('0xc'));var querystring=require(_0xec9e('0xd'));var Papa=require('papaparse');var Redis=require(_0xec9e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xec9e('0xf'));var hardwareService=require(_0xec9e('0x10'));var logger=require(_0xec9e('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xec9e('0x12'));var licenseUtil=require(_0xec9e('0x13'));var db=require(_0xec9e('0x14'))['db'];function respondWithStatusCode(_0x50189c,_0x56b140){_0x56b140=_0x56b140||0xcc;return function(_0x3ff98f){if(_0x3ff98f){return _0x50189c[_0xec9e('0x15')](_0x56b140);}return _0x50189c['status'](_0x56b140)['end']();};}function respondWithResult(_0x4ba64e,_0x34a2df){_0x34a2df=_0x34a2df||0xc8;return function(_0x222c8d){if(_0x222c8d){return _0x4ba64e[_0xec9e('0x16')](_0x34a2df)[_0xec9e('0x17')](_0x222c8d);}};}function respondWithFilteredResult(_0x3fd3b9,_0x37c365){return function(_0x5ae055){if(_0x5ae055){var _0x43819f=typeof _0x37c365['offset']===_0xec9e('0x18')&&typeof _0x37c365[_0xec9e('0x19')]===_0xec9e('0x18');var _0x5f04d8=_0x5ae055['count'];var _0xbd9a65=_0x43819f?0x0:_0x37c365['offset'];var _0x388101=_0x43819f?_0x5ae055['count']:_0x37c365[_0xec9e('0x1a')]+_0x37c365[_0xec9e('0x19')];var _0x43a1bb;if(_0x388101>=_0x5f04d8){_0x388101=_0x5f04d8;_0x43a1bb=0xc8;}else{_0x43a1bb=0xce;}_0x3fd3b9['status'](_0x43a1bb);return _0x3fd3b9[_0xec9e('0x1b')](_0xec9e('0x1c'),_0xbd9a65+'-'+_0x388101+'/'+_0x5f04d8)[_0xec9e('0x17')](_0x5ae055);}return null;};}function patchUpdates(_0x152db6){return function(_0x27795b){try{jsonpatch[_0xec9e('0x1d')](_0x27795b,_0x152db6,!![]);}catch(_0x245260){return BPromise[_0xec9e('0x1e')](_0x245260);}return _0x27795b[_0xec9e('0x1f')]();};}function saveUpdates(_0x113f3e,_0x22dc9b){return function(_0x22a0fa){if(_0x22a0fa){return _0x22a0fa[_0xec9e('0x20')](_0x113f3e)['then'](function(_0x3fc737){return _0x3fc737;});}return null;};}function removeEntity(_0xdf1e07,_0x4cb9f6){return function(_0x272792){if(_0x272792){return _0x272792[_0xec9e('0x21')]()[_0xec9e('0x22')](function(){_0xdf1e07['status'](0xcc)[_0xec9e('0x23')]();});}};}function handleEntityNotFound(_0x435cc1,_0x109608){return function(_0x412e0a){if(!_0x412e0a){_0x435cc1[_0xec9e('0x15')](0x194);}return _0x412e0a;};}function handleError(_0x356753,_0x53ac99){_0x53ac99=_0x53ac99||0x1f4;return function(_0xda80cb){logger['error'](_0xda80cb[_0xec9e('0x24')]);if(_0xda80cb[_0xec9e('0x25')]){delete _0xda80cb['name'];}_0x356753['status'](_0x53ac99)[_0xec9e('0x26')](_0xda80cb);};}exports[_0xec9e('0x27')]=function(_0x52f3e9,_0x5eb117){var _0x5d4098={},_0x2afedf={},_0x64e7e2={'count':0x0,'rows':[]};var _0x4f830d=_['map'](db[_0xec9e('0x28')]['rawAttributes'],function(_0x3b82cd){return{'name':_0x3b82cd[_0xec9e('0x29')],'type':_0x3b82cd['type'][_0xec9e('0x2a')]};});_0x2afedf[_0xec9e('0x2b')]=_[_0xec9e('0x2c')](_0x4f830d,_0xec9e('0x25'));_0x2afedf[_0xec9e('0x2d')]=_[_0xec9e('0x2e')](_0x52f3e9[_0xec9e('0x2d')]);_0x2afedf[_0xec9e('0x2f')]=_[_0xec9e('0x30')](_0x2afedf[_0xec9e('0x2b')],_0x2afedf[_0xec9e('0x2d')]);_0x5d4098[_0xec9e('0x31')]=_['intersection'](_0x2afedf[_0xec9e('0x2b')],qs[_0xec9e('0x32')](_0x52f3e9['query'][_0xec9e('0x32')]));_0x5d4098['attributes']=_0x5d4098['attributes'][_0xec9e('0x33')]?_0x5d4098[_0xec9e('0x31')]:_0x2afedf[_0xec9e('0x2b')];if(!_0x52f3e9['query'][_0xec9e('0x34')]('nolimit')){_0x5d4098['limit']=qs['limit'](_0x52f3e9[_0xec9e('0x2d')][_0xec9e('0x19')]);_0x5d4098['offset']=qs[_0xec9e('0x1a')](_0x52f3e9[_0xec9e('0x2d')]['offset']);}_0x5d4098[_0xec9e('0x35')]=qs['sort'](_0x52f3e9[_0xec9e('0x2d')][_0xec9e('0x36')]);_0x5d4098[_0xec9e('0x37')]=qs['filters'](_[_0xec9e('0x38')](_0x52f3e9['query'],_0x2afedf['filters']),_0x4f830d);if(_0x52f3e9[_0xec9e('0x2d')][_0xec9e('0x39')]){_0x5d4098['where']=_[_0xec9e('0x3a')](_0x5d4098[_0xec9e('0x37')],{'$or':_[_0xec9e('0x2c')](_0x4f830d,function(_0x927a30){if(_0x927a30[_0xec9e('0x3b')]!=='VIRTUAL'){var _0x225034={};_0x225034[_0x927a30['name']]={'$like':'%'+_0x52f3e9[_0xec9e('0x2d')][_0xec9e('0x39')]+'%'};return _0x225034;}})});}_0x5d4098=_[_0xec9e('0x3a')]({},_0x5d4098,_0x52f3e9[_0xec9e('0x3c')]);var _0x3e74be={'where':_0x5d4098[_0xec9e('0x37')]};return db['FreshsalesField'][_0xec9e('0x3d')](_0x3e74be)[_0xec9e('0x22')](function(_0x552542){_0x64e7e2[_0xec9e('0x3d')]=_0x552542;if(_0x52f3e9['query'][_0xec9e('0x3e')]){_0x5d4098['include']=[{'all':!![]}];}return db[_0xec9e('0x28')][_0xec9e('0x3f')](_0x5d4098);})[_0xec9e('0x22')](function(_0x348991){_0x64e7e2[_0xec9e('0x40')]=_0x348991;return _0x64e7e2;})[_0xec9e('0x22')](respondWithFilteredResult(_0x5eb117,_0x5d4098))[_0xec9e('0x41')](handleError(_0x5eb117,null));};exports[_0xec9e('0x42')]=function(_0xa9abfd,_0x1a1bc6){var _0x3ce63e={'raw':!![],'where':{'id':_0xa9abfd[_0xec9e('0x43')]['id']}},_0x5bc1bf={};_0x5bc1bf[_0xec9e('0x2b')]=_[_0xec9e('0x2e')](db[_0xec9e('0x28')][_0xec9e('0x44')]);_0x5bc1bf[_0xec9e('0x2d')]=_[_0xec9e('0x2e')](_0xa9abfd['query']);_0x5bc1bf[_0xec9e('0x2f')]=_[_0xec9e('0x30')](_0x5bc1bf[_0xec9e('0x2b')],_0x5bc1bf[_0xec9e('0x2d')]);_0x3ce63e[_0xec9e('0x31')]=_[_0xec9e('0x30')](_0x5bc1bf[_0xec9e('0x2b')],qs[_0xec9e('0x32')](_0xa9abfd['query'][_0xec9e('0x32')]));_0x3ce63e['attributes']=_0x3ce63e[_0xec9e('0x31')][_0xec9e('0x33')]?_0x3ce63e[_0xec9e('0x31')]:_0x5bc1bf[_0xec9e('0x2b')];if(_0xa9abfd[_0xec9e('0x2d')]['includeAll']){_0x3ce63e[_0xec9e('0x45')]=[{'all':!![]}];}_0x3ce63e=_[_0xec9e('0x3a')]({},_0x3ce63e,_0xa9abfd[_0xec9e('0x3c')]);return db[_0xec9e('0x28')][_0xec9e('0x46')](_0x3ce63e)[_0xec9e('0x22')](handleEntityNotFound(_0x1a1bc6,null))['then'](respondWithResult(_0x1a1bc6,null))[_0xec9e('0x41')](handleError(_0x1a1bc6,null));};exports['create']=function(_0x369a5,_0x50c676){return db[_0xec9e('0x28')][_0xec9e('0x47')](_0x369a5['body'],{})['then'](respondWithResult(_0x50c676,0xc9))[_0xec9e('0x41')](handleError(_0x50c676,null));};exports[_0xec9e('0x20')]=function(_0x11d26c,_0x43615f){if(_0x11d26c[_0xec9e('0x48')]['id']){delete _0x11d26c[_0xec9e('0x48')]['id'];}return db[_0xec9e('0x28')][_0xec9e('0x46')]({'where':{'id':_0x11d26c['params']['id']}})['then'](handleEntityNotFound(_0x43615f,null))[_0xec9e('0x22')](saveUpdates(_0x11d26c[_0xec9e('0x48')],null))[_0xec9e('0x22')](respondWithResult(_0x43615f,null))[_0xec9e('0x41')](handleError(_0x43615f,null));};exports[_0xec9e('0x21')]=function(_0x22641c,_0x814f95){return db[_0xec9e('0x28')]['find']({'where':{'id':_0x22641c[_0xec9e('0x43')]['id']}})['then'](handleEntityNotFound(_0x814f95,null))[_0xec9e('0x22')](removeEntity(_0x814f95,null))[_0xec9e('0x41')](handleError(_0x814f95,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 6644efa..9b02362 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 _0xa467=['path','rimraf','exports','define','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x53cc68,_0x3920c1){var _0x5d18c6=function(_0x5c8db9){while(--_0x5c8db9){_0x53cc68['push'](_0x53cc68['shift']());}};_0x5d18c6(++_0x3920c1);}(_0xa467,0x143));var _0x7a46=function(_0x222ef1,_0xad7df1){_0x222ef1=_0x222ef1-0x0;var _0x5177ca=_0xa467[_0x222ef1];return _0x5177ca;};'use strict';var _=require(_0x7a46('0x0'));var util=require(_0x7a46('0x1'));var logger=require(_0x7a46('0x2'))(_0x7a46('0x3'));var moment=require(_0x7a46('0x4'));var BPromise=require(_0x7a46('0x5'));var rp=require(_0x7a46('0x6'));var fs=require('fs');var path=require(_0x7a46('0x7'));var rimraf=require(_0x7a46('0x8'));var config=require('../../config/environment');var attributes=require('./intFreshsalesField.attributes');module[_0x7a46('0x9')]=function(_0x1940e6,_0x3bfa2c){return _0x1940e6[_0x7a46('0xa')](_0x7a46('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x7a46('0xc'),'fields':[_0x7a46('0xd'),_0x7a46('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x70e3=['idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports','define'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x70e3,0x9d));var _0x370e=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x70e3[_0x295314];return _0x584b0c;};'use strict';var _=require(_0x370e('0x0'));var util=require(_0x370e('0x1'));var logger=require(_0x370e('0x2'))(_0x370e('0x3'));var moment=require('moment');var BPromise=require(_0x370e('0x4'));var rp=require(_0x370e('0x5'));var fs=require('fs');var path=require(_0x370e('0x6'));var rimraf=require('rimraf');var config=require(_0x370e('0x7'));var attributes=require(_0x370e('0x8'));module[_0x370e('0x9')]=function(_0x2b99d1,_0x47c815){return _0x2b99d1[_0x370e('0xa')]('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x370e('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 5ef1d10..d98372a 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 _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1f4cf6,_0x2e8fc1){var _0x5871ca=function(_0x20ef1f){while(--_0x20ef1f){_0x1f4cf6['push'](_0x1f4cf6['shift']());}};_0x5871ca(++_0x2e8fc1);}(_0x1623,0xab));var _0x3162=function(_0x5bd982,_0x45f55d){_0x5bd982=_0x5bd982-0x0;var _0x5350ba=_0x1623[_0x5bd982];return _0x5350ba;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});} \ No newline at end of file +var _0xc1c6=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x4a9229,_0x161f53){var _0x344944=function(_0x4bbeb2){while(--_0x4bbeb2){_0x4a9229['push'](_0x4a9229['shift']());}};_0x344944(++_0x161f53);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x23e210,_0x443911){_0x23e210=_0x23e210-0x0;var _0x1ffd85=_0xc1c6[_0x23e210];return _0x1ffd85;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index b004114..7c7342c 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x8f87f8,_0x2070ab){var _0x5936c2=function(_0x1e315d){while(--_0x1e315d){_0x8f87f8['push'](_0x8f87f8['shift']());}};_0x5936c2(++_0x2070ab);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _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(_0x46c8d6,_0x16fa9b){var _0x2084ec=function(_0x27a089){while(--_0x27a089){_0x46c8d6['push'](_0x46c8d6['shift']());}};_0x2084ec(++_0x16fa9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 5ba9054..e15fe7d 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 _0x2e54=['integrationTab','STRING','username','ENUM'];(function(_0x4c977f,_0xfbbf23){var _0x3c39c1=function(_0x4593d6){while(--_0x4593d6){_0x4c977f['push'](_0x4c977f['shift']());}};_0x3c39c1(++_0xfbbf23);}(_0x2e54,0xc1));var _0x42e5=function(_0x346f13,_0x22d731){_0x346f13=_0x346f13-0x0;var _0x5efa37=_0x2e54[_0x346f13];return _0x5efa37;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x42e5('0x0')]},'description':{'type':Sequelize[_0x42e5('0x0')]},'username':{'type':Sequelize[_0x42e5('0x0')],'unique':_0x42e5('0x1')},'remoteUri':{'type':Sequelize[_0x42e5('0x0')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x42e5('0x0')]},'clientSecret':{'type':Sequelize[_0x42e5('0x0')]},'securityToken':{'type':Sequelize[_0x42e5('0x0')]},'serverUrl':{'type':Sequelize[_0x42e5('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x42e5('0x2')]('integrationTab','newTab'),'defaultValue':_0x42e5('0x3')}}; \ No newline at end of file +var _0xd824=['ENUM','integrationTab','sequelize','exports','STRING','username'];(function(_0x1d9fd5,_0x13f9bc){var _0x5ddcf8=function(_0x5b955c){while(--_0x5b955c){_0x1d9fd5['push'](_0x1d9fd5['shift']());}};_0x5ddcf8(++_0x13f9bc);}(_0xd824,0xc2));var _0x4d82=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd824[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x4d82('0x0'));module[_0x4d82('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x3')},'remoteUri':{'type':Sequelize[_0x4d82('0x2')]},'password':{'type':Sequelize[_0x4d82('0x2')]},'clientId':{'type':Sequelize[_0x4d82('0x2')]},'clientSecret':{'type':Sequelize[_0x4d82('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4d82('0x4')]('integrationTab','newTab'),'defaultValue':_0x4d82('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 0f41a93..7fa9ab6 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 _0x4aef=['textarea','phone','remove','includes','label','picklistValues','value','boolean','True','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','reject','save','update','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','SalesforceAccount','rows','catch','show','include','find','create','body','destroy','params','getConfigurations','SalesforceConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','Task','findOne','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','Connection','login','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','Subject','Description','int','picklist','email'];(function(_0x354959,_0x1cd7a7){var _0x34ce0e=function(_0x2d6a70){while(--_0x2d6a70){_0x354959['push'](_0x354959['shift']());}};_0x34ce0e(++_0x1cd7a7);}(_0x4aef,0x8c));var _0xf4ae=function(_0x2f7109,_0x44f210){_0x2f7109=_0x2f7109-0x0;var _0x34b004=_0x4aef[_0x2f7109];return _0x34b004;};'use strict';var emlformat=require(_0xf4ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf4ae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4ae('0x2'));var moment=require(_0xf4ae('0x3'));var BPromise=require(_0xf4ae('0x4'));var Mustache=require(_0xf4ae('0x5'));var util=require(_0xf4ae('0x6'));var path=require(_0xf4ae('0x7'));var sox=require(_0xf4ae('0x8'));var csv=require(_0xf4ae('0x9'));var ejs=require(_0xf4ae('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf4ae('0xb'));var crypto=require(_0xf4ae('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf4ae('0x9'));var querystring=require('querystring');var Papa=require(_0xf4ae('0xd'));var Redis=require(_0xf4ae('0xe'));var authService=require(_0xf4ae('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf4ae('0x10'));var hardwareService=require(_0xf4ae('0x11'));var logger=require(_0xf4ae('0x12'))(_0xf4ae('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf4ae('0x14'));var db=require(_0xf4ae('0x15'))['db'];var integrations=require(_0xf4ae('0x16'));function respondWithStatusCode(_0x1ab683,_0x4238fd){_0x4238fd=_0x4238fd||0xcc;return function(_0x304823){if(_0x304823){return _0x1ab683[_0xf4ae('0x17')](_0x4238fd);}return _0x1ab683[_0xf4ae('0x18')](_0x4238fd)['end']();};}function respondWithResult(_0x2ba4dd,_0x44a448){_0x44a448=_0x44a448||0xc8;return function(_0x581c4d){if(_0x581c4d){return _0x2ba4dd[_0xf4ae('0x18')](_0x44a448)['json'](_0x581c4d);}};}function respondWithFilteredResult(_0x29b79d,_0x136c7e){return function(_0x408283){if(_0x408283){var _0x3bc008=typeof _0x136c7e[_0xf4ae('0x19')]===_0xf4ae('0x1a')&&typeof _0x136c7e[_0xf4ae('0x1b')]===_0xf4ae('0x1a');var _0xb238bb=_0x408283['count'];var _0x49f036=_0x3bc008?0x0:_0x136c7e['offset'];var _0x2e1b11=_0x3bc008?_0x408283[_0xf4ae('0x1c')]:_0x136c7e['offset']+_0x136c7e[_0xf4ae('0x1b')];var _0x417857;if(_0x2e1b11>=_0xb238bb){_0x2e1b11=_0xb238bb;_0x417857=0xc8;}else{_0x417857=0xce;}_0x29b79d[_0xf4ae('0x18')](_0x417857);return _0x29b79d[_0xf4ae('0x1d')]('Content-Range',_0x49f036+'-'+_0x2e1b11+'/'+_0xb238bb)['json'](_0x408283);}return null;};}function patchUpdates(_0x330b58){return function(_0x44011d){try{jsonpatch['apply'](_0x44011d,_0x330b58,!![]);}catch(_0x4b4e20){return BPromise[_0xf4ae('0x1e')](_0x4b4e20);}return _0x44011d[_0xf4ae('0x1f')]();};}function saveUpdates(_0x16ba4c,_0x20e3cd){return function(_0x133d3e){if(_0x133d3e){return _0x133d3e[_0xf4ae('0x20')](_0x16ba4c)[_0xf4ae('0x21')](function(_0x57a09d){return _0x57a09d;});}return null;};}function removeEntity(_0x364753,_0x4eab32){return function(_0x283f9c){if(_0x283f9c){return _0x283f9c['destroy']()[_0xf4ae('0x21')](function(){_0x364753[_0xf4ae('0x18')](0xcc)[_0xf4ae('0x22')]();});}};}function handleEntityNotFound(_0x1e4ce8,_0x69ba7d){return function(_0x4064c0){if(!_0x4064c0){_0x1e4ce8[_0xf4ae('0x17')](0x194);}return _0x4064c0;};}function handleError(_0x55d9f3,_0x5133a6){_0x5133a6=_0x5133a6||0x1f4;return function(_0x352f1a){logger[_0xf4ae('0x23')](_0x352f1a[_0xf4ae('0x24')]);if(_0x352f1a[_0xf4ae('0x25')]){delete _0x352f1a[_0xf4ae('0x25')];}_0x55d9f3[_0xf4ae('0x18')](_0x5133a6)[_0xf4ae('0x26')](_0x352f1a);};}exports[_0xf4ae('0x27')]=function(_0x5b20b5,_0x557069){var _0x1771ae={},_0x59bde6={},_0x5ba241={'count':0x0,'rows':[]};var _0xa430c0=_[_0xf4ae('0x28')](db['SalesforceAccount'][_0xf4ae('0x29')],function(_0x2dc9bb){return{'name':_0x2dc9bb[_0xf4ae('0x2a')],'type':_0x2dc9bb[_0xf4ae('0x2b')][_0xf4ae('0x2c')]};});_0x59bde6[_0xf4ae('0x2d')]=_[_0xf4ae('0x28')](_0xa430c0,_0xf4ae('0x25'));_0x59bde6[_0xf4ae('0x2e')]=_[_0xf4ae('0x2f')](_0x5b20b5[_0xf4ae('0x2e')]);_0x59bde6[_0xf4ae('0x30')]=_[_0xf4ae('0x31')](_0x59bde6[_0xf4ae('0x2d')],_0x59bde6[_0xf4ae('0x2e')]);_0x1771ae[_0xf4ae('0x32')]=_['intersection'](_0x59bde6['model'],qs[_0xf4ae('0x33')](_0x5b20b5[_0xf4ae('0x2e')]['fields']));_0x1771ae[_0xf4ae('0x32')]=_0x1771ae[_0xf4ae('0x32')][_0xf4ae('0x34')]?_0x1771ae[_0xf4ae('0x32')]:_0x59bde6[_0xf4ae('0x2d')];if(!_0x5b20b5[_0xf4ae('0x2e')][_0xf4ae('0x35')]('nolimit')){_0x1771ae['limit']=qs[_0xf4ae('0x1b')](_0x5b20b5[_0xf4ae('0x2e')][_0xf4ae('0x1b')]);_0x1771ae[_0xf4ae('0x19')]=qs[_0xf4ae('0x19')](_0x5b20b5['query'][_0xf4ae('0x19')]);}_0x1771ae[_0xf4ae('0x36')]=qs[_0xf4ae('0x37')](_0x5b20b5[_0xf4ae('0x2e')]['sort']);_0x1771ae[_0xf4ae('0x38')]=qs[_0xf4ae('0x30')](_[_0xf4ae('0x39')](_0x5b20b5[_0xf4ae('0x2e')],_0x59bde6[_0xf4ae('0x30')]),_0xa430c0);if(_0x5b20b5[_0xf4ae('0x2e')]['filter']){_0x1771ae[_0xf4ae('0x38')]=_[_0xf4ae('0x3a')](_0x1771ae[_0xf4ae('0x38')],{'$or':_[_0xf4ae('0x28')](_0xa430c0,function(_0x1f0a37){if(_0x1f0a37[_0xf4ae('0x2b')]!==_0xf4ae('0x3b')){var _0x4ab771={};_0x4ab771[_0x1f0a37[_0xf4ae('0x25')]]={'$like':'%'+_0x5b20b5[_0xf4ae('0x2e')][_0xf4ae('0x3c')]+'%'};return _0x4ab771;}})});}_0x1771ae=_['merge']({},_0x1771ae,_0x5b20b5[_0xf4ae('0x3d')]);var _0x5a8624={'where':_0x1771ae[_0xf4ae('0x38')]};return db['SalesforceAccount'][_0xf4ae('0x1c')](_0x5a8624)['then'](function(_0x15f68a){_0x5ba241[_0xf4ae('0x1c')]=_0x15f68a;if(_0x5b20b5[_0xf4ae('0x2e')][_0xf4ae('0x3e')]){_0x1771ae['include']=[{'all':!![]}];}return db[_0xf4ae('0x3f')]['findAll'](_0x1771ae);})[_0xf4ae('0x21')](function(_0x21a7e5){_0x5ba241[_0xf4ae('0x40')]=_0x21a7e5;return _0x5ba241;})[_0xf4ae('0x21')](respondWithFilteredResult(_0x557069,_0x1771ae))[_0xf4ae('0x41')](handleError(_0x557069,null));};exports[_0xf4ae('0x42')]=function(_0x374fa5,_0x4ac5b1){var _0x441af8={'raw':![],'where':{'id':_0x374fa5['params']['id']}},_0x5a6770={};_0x5a6770[_0xf4ae('0x2d')]=_['keys'](db['SalesforceAccount'][_0xf4ae('0x29')]);_0x5a6770[_0xf4ae('0x2e')]=_[_0xf4ae('0x2f')](_0x374fa5[_0xf4ae('0x2e')]);_0x5a6770[_0xf4ae('0x30')]=_['intersection'](_0x5a6770[_0xf4ae('0x2d')],_0x5a6770[_0xf4ae('0x2e')]);_0x441af8['attributes']=_[_0xf4ae('0x31')](_0x5a6770[_0xf4ae('0x2d')],qs[_0xf4ae('0x33')](_0x374fa5[_0xf4ae('0x2e')]['fields']));_0x441af8[_0xf4ae('0x32')]=_0x441af8[_0xf4ae('0x32')][_0xf4ae('0x34')]?_0x441af8[_0xf4ae('0x32')]:_0x5a6770['model'];if(_0x374fa5[_0xf4ae('0x2e')]['includeAll']){_0x441af8[_0xf4ae('0x43')]=[{'all':!![]}];}_0x441af8=_[_0xf4ae('0x3a')]({},_0x441af8,_0x374fa5['options']);return db[_0xf4ae('0x3f')][_0xf4ae('0x44')](_0x441af8)['then'](handleEntityNotFound(_0x4ac5b1,null))['then'](respondWithResult(_0x4ac5b1,null))[_0xf4ae('0x41')](handleError(_0x4ac5b1,null));};exports[_0xf4ae('0x45')]=function(_0x2fd282,_0x36c6a3){return db[_0xf4ae('0x3f')][_0xf4ae('0x45')](_0x2fd282['body'],{})['then'](respondWithResult(_0x36c6a3,0xc9))[_0xf4ae('0x41')](handleError(_0x36c6a3,null));};exports['update']=function(_0x57afc0,_0x2cfde7){if(_0x57afc0[_0xf4ae('0x46')]['id']){delete _0x57afc0[_0xf4ae('0x46')]['id'];}return db['SalesforceAccount'][_0xf4ae('0x44')]({'where':{'id':_0x57afc0['params']['id']}})['then'](handleEntityNotFound(_0x2cfde7,null))[_0xf4ae('0x21')](saveUpdates(_0x57afc0[_0xf4ae('0x46')],null))['then'](respondWithResult(_0x2cfde7,null))[_0xf4ae('0x41')](handleError(_0x2cfde7,null));};exports[_0xf4ae('0x47')]=function(_0x3fa10c,_0x3ecb3b){return db[_0xf4ae('0x3f')][_0xf4ae('0x44')]({'where':{'id':_0x3fa10c[_0xf4ae('0x48')]['id']}})[_0xf4ae('0x21')](handleEntityNotFound(_0x3ecb3b,null))[_0xf4ae('0x21')](removeEntity(_0x3ecb3b,null))[_0xf4ae('0x41')](handleError(_0x3ecb3b,null));};exports[_0xf4ae('0x49')]=function(_0x35f71e,_0x82c295,_0x4c5d7c){var _0x2d16c6={};var _0xd2b14f={};var _0x1d2980;var _0x344196;return db[_0xf4ae('0x3f')]['findOne']({'where':{'id':_0x35f71e[_0xf4ae('0x48')]['id']}})['then'](handleEntityNotFound(_0x82c295,null))[_0xf4ae('0x21')](function(_0x3c08cf){if(_0x3c08cf){_0x1d2980=_0x3c08cf;_0xd2b14f[_0xf4ae('0x2d')]=_[_0xf4ae('0x2f')](db[_0xf4ae('0x4a')][_0xf4ae('0x29')]);_0xd2b14f[_0xf4ae('0x2e')]=_['keys'](_0x35f71e['query']);_0xd2b14f['filters']=_[_0xf4ae('0x31')](_0xd2b14f[_0xf4ae('0x2d')],_0xd2b14f[_0xf4ae('0x2e')]);_0x2d16c6[_0xf4ae('0x32')]=_[_0xf4ae('0x31')](_0xd2b14f[_0xf4ae('0x2d')],qs[_0xf4ae('0x33')](_0x35f71e['query'][_0xf4ae('0x33')]));_0x2d16c6['attributes']=_0x2d16c6[_0xf4ae('0x32')][_0xf4ae('0x34')]?_0x2d16c6[_0xf4ae('0x32')]:_0xd2b14f['model'];_0x2d16c6[_0xf4ae('0x36')]=qs[_0xf4ae('0x37')](_0x35f71e[_0xf4ae('0x2e')][_0xf4ae('0x37')]);_0x2d16c6[_0xf4ae('0x38')]=qs[_0xf4ae('0x30')](_['pick'](_0x35f71e['query'],_0xd2b14f['filters']));if(_0x35f71e[_0xf4ae('0x2e')][_0xf4ae('0x3c')]){_0x2d16c6[_0xf4ae('0x38')]=_[_0xf4ae('0x3a')](_0x2d16c6['where'],{'$or':_[_0xf4ae('0x28')](_0x2d16c6['attributes'],function(_0x280d5b){var _0x28598f={};_0x28598f[_0x280d5b]={'$like':'%'+_0x35f71e[_0xf4ae('0x2e')][_0xf4ae('0x3c')]+'%'};return _0x28598f;})});}_0x2d16c6=_[_0xf4ae('0x3a')]({},_0x2d16c6,_0x35f71e[_0xf4ae('0x3d')]);return _0x1d2980[_0xf4ae('0x49')](_0x2d16c6);}})[_0xf4ae('0x21')](function(_0x28ca54){if(_0x28ca54){_0x344196=_0x28ca54['length'];if(!_0x35f71e[_0xf4ae('0x2e')][_0xf4ae('0x35')](_0xf4ae('0x4b'))){_0x2d16c6['limit']=qs[_0xf4ae('0x1b')](_0x35f71e[_0xf4ae('0x2e')]['limit']);_0x2d16c6[_0xf4ae('0x19')]=qs[_0xf4ae('0x19')](_0x35f71e['query'][_0xf4ae('0x19')]);}return _0x1d2980['getConfigurations'](_0x2d16c6);}})[_0xf4ae('0x21')](function(_0x23e2c9){if(_0x23e2c9){return _0x23e2c9?{'count':_0x344196,'rows':_0x23e2c9}:null;}})[_0xf4ae('0x21')](respondWithResult(_0x82c295,null))['catch'](handleError(_0x82c295,null));};exports[_0xf4ae('0x4c')]=function(_0x40a4ab,_0x55193d,_0x288978){if(_0x40a4ab[_0xf4ae('0x46')]['id']){delete _0x40a4ab[_0xf4ae('0x46')]['id'];}return db[_0xf4ae('0x3f')]['findOne']({'where':{'id':_0x40a4ab[_0xf4ae('0x48')]['id']}})[_0xf4ae('0x21')](handleEntityNotFound(_0x55193d,null))[_0xf4ae('0x21')](function(_0x3f7b6b){if(_0x3f7b6b){_0x40a4ab[_0xf4ae('0x46')][_0xf4ae('0x4d')]=_0x3f7b6b['id'];_0x40a4ab[_0xf4ae('0x46')][_0xf4ae('0x4e')]=integrations[_0xf4ae('0x4f')](_0x40a4ab['body'][_0xf4ae('0x50')],_0x40a4ab[_0xf4ae('0x46')][_0xf4ae('0x2b')]);_0x40a4ab[_0xf4ae('0x46')][_0xf4ae('0x51')]=integrations['getDescriptions'](_0x40a4ab[_0xf4ae('0x46')][_0xf4ae('0x50')],_0x40a4ab['body']['type']);return db[_0xf4ae('0x4a')][_0xf4ae('0x45')](_0x40a4ab[_0xf4ae('0x46')],{'include':[{'model':db[_0xf4ae('0x52')],'as':_0xf4ae('0x4e')},{'model':db[_0xf4ae('0x52')],'as':_0xf4ae('0x51')}]});}return null;})[_0xf4ae('0x21')](respondWithResult(_0x55193d,null))[_0xf4ae('0x41')](handleError(_0x55193d,null));};exports[_0xf4ae('0x53')]=function(_0x46db53,_0x31c2ae,_0x3ccf19){var _0x9f11c;var _0x3f80e5='';var _0x166264=_0xf4ae('0x54');return db[_0xf4ae('0x3f')][_0xf4ae('0x55')]({'where':{'id':_0x46db53[_0xf4ae('0x48')]['id']},'attributes':['id',_0xf4ae('0x56'),_0xf4ae('0x57'),_0xf4ae('0x58'),_0xf4ae('0x59'),_0xf4ae('0x5a'),_0xf4ae('0x5b')]})[_0xf4ae('0x21')](handleEntityNotFound(_0x31c2ae,null))[_0xf4ae('0x21')](function(_0x2f4418){if(_0x2f4418){_0x3f80e5=_0x2f4418['remoteUri'];var _0x46584a=_0x3f80e5[_0xf4ae('0x5c')](-0x1);if(_0x46584a==='/'){_0x3f80e5=_0x3f80e5[_0xf4ae('0x5d')](0x0,_0x3f80e5['lastIndexOf'](_0x46584a));}_0x9f11c=new jsforce[(_0xf4ae('0x5e'))]({'oauth2':{'loginUrl':_0x3f80e5,'clientId':_0x2f4418['clientId'],'clientSecret':_0x2f4418[_0xf4ae('0x58')]}});return _0x9f11c[_0xf4ae('0x5f')](_0x2f4418['username'],_0x2f4418[_0xf4ae('0x5a')][_0xf4ae('0x60')](_0x2f4418[_0xf4ae('0x5b')]));}})[_0xf4ae('0x21')](function(_0x5d56b4){if(_0x5d56b4){if(!_[_0xf4ae('0x61')](_0x46db53[_0xf4ae('0x2e')][_0xf4ae('0x62')])){_0x166264=_0x46db53['query'][_0xf4ae('0x62')];}return _0x9f11c[_0xf4ae('0x63')](_0x166264)['describe']();}})[_0xf4ae('0x21')](function(_0xf3dc02){var _0x58afae=[_0xf4ae('0x64'),_0xf4ae('0x65'),_0xf4ae('0x66'),'IsRecurrence',_0xf4ae('0x67'),_0xf4ae('0x68')];var _0x53d0b7=['string',_0xf4ae('0x69'),_0xf4ae('0x6a'),'boolean',_0xf4ae('0x6b'),_0xf4ae('0x6c'),_0xf4ae('0x6d')];if(_0xf3dc02){_[_0xf4ae('0x6e')](_0xf3dc02[_0xf4ae('0x33')],function(_0x3f270e){return _0x58afae[_0xf4ae('0x6f')](_0x3f270e[_0xf4ae('0x25')])||!_0x53d0b7[_0xf4ae('0x6f')](_0x3f270e['type']);});return{'count':_0xf3dc02[_0xf4ae('0x33')][_0xf4ae('0x34')],'rows':_[_0xf4ae('0x28')](_0xf3dc02[_0xf4ae('0x33')],function(_0x583869){return{'id':_0x583869[_0xf4ae('0x25')],'name':_0x583869[_0xf4ae('0x70')],'custom':_0x583869['custom'],'options':_0x583869['picklistValues'][_0xf4ae('0x34')]>0x0?_['map'](_0x583869[_0xf4ae('0x71')],function(_0x399c68){return{'name':_0x399c68[_0xf4ae('0x70')],'value':_0x399c68[_0xf4ae('0x72')]};}):_0x583869[_0xf4ae('0x2b')]==_0xf4ae('0x73')?[{'name':_0xf4ae('0x74'),'value':'true'},{'name':_0xf4ae('0x75'),'value':_0xf4ae('0x76')}]:[]};})};}})[_0xf4ae('0x21')](respondWithResult(_0x31c2ae,null))[_0xf4ae('0x41')](function(_0x171ceb){var _0x1ebe0a=_0x46db53[_0xf4ae('0x2e')][_0xf4ae('0x77')]?0x1f4:_0x171ceb[_0xf4ae('0x78')]||0x1f4;logger[_0xf4ae('0x23')](_0xf4ae('0x79'),'getFields',_0x1ebe0a,JSON[_0xf4ae('0x7a')](_0x171ceb));delete _0x171ceb['name'];if(_0x1ebe0a===0x191){_0x1ebe0a=0x190;}_0x31c2ae['status'](_0x1ebe0a)[_0xf4ae('0x26')](_0x46db53[_0xf4ae('0x2e')][_0xf4ae('0x77')]?{'message':_0xf4ae('0x7b'),'statusCode':_0x171ceb[_0xf4ae('0x78')]}:_0x171ceb);});}; \ No newline at end of file +var _0x6f61=['squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','getConfigurations','SalesforceConfiguration','findOne','AccountId','Subjects','getSubjects','getDescriptions','channel','SalesforceField','Descriptions','getFields','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','concat','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','boolean','textarea','phone','remove','includes','label','picklistValues','value','False','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','ejs','lodash'];(function(_0x16ecf3,_0x3b2691){var _0x183edb=function(_0x51d6f8){while(--_0x51d6f8){_0x16ecf3['push'](_0x16ecf3['shift']());}};_0x183edb(++_0x3b2691);}(_0x6f61,0x156));var _0x16f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6f61[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x16f6('0x0'));var rimraf=require(_0x16f6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x16f6('0x2'));var rp=require(_0x16f6('0x3'));var moment=require('moment');var BPromise=require(_0x16f6('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x16f6('0x5'));var sox=require(_0x16f6('0x6'));var csv=require('to-csv');var ejs=require(_0x16f6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16f6('0x8'));var squel=require(_0x16f6('0x9'));var crypto=require(_0x16f6('0xa'));var jsforce=require(_0x16f6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x16f6('0xc'));var querystring=require(_0x16f6('0xd'));var Papa=require(_0x16f6('0xe'));var Redis=require(_0x16f6('0xf'));var authService=require(_0x16f6('0x10'));var qs=require(_0x16f6('0x11'));var as=require(_0x16f6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x16f6('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x16f6('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3becd9,_0x1a235e){_0x1a235e=_0x1a235e||0xcc;return function(_0x4b4ba5){if(_0x4b4ba5){return _0x3becd9[_0x16f6('0x15')](_0x1a235e);}return _0x3becd9[_0x16f6('0x16')](_0x1a235e)[_0x16f6('0x17')]();};}function respondWithResult(_0x21022b,_0xe7ab23){_0xe7ab23=_0xe7ab23||0xc8;return function(_0x403539){if(_0x403539){return _0x21022b[_0x16f6('0x16')](_0xe7ab23)[_0x16f6('0x18')](_0x403539);}};}function respondWithFilteredResult(_0xe3cd53,_0x4544b1){return function(_0x36d7a3){if(_0x36d7a3){var _0x5bdb10=typeof _0x4544b1[_0x16f6('0x19')]===_0x16f6('0x1a')&&typeof _0x4544b1[_0x16f6('0x1b')]===_0x16f6('0x1a');var _0x14e79a=_0x36d7a3[_0x16f6('0x1c')];var _0xf5946c=_0x5bdb10?0x0:_0x4544b1[_0x16f6('0x19')];var _0x4e8c9b=_0x5bdb10?_0x36d7a3[_0x16f6('0x1c')]:_0x4544b1[_0x16f6('0x19')]+_0x4544b1[_0x16f6('0x1b')];var _0x4c4a0e;if(_0x4e8c9b>=_0x14e79a){_0x4e8c9b=_0x14e79a;_0x4c4a0e=0xc8;}else{_0x4c4a0e=0xce;}_0xe3cd53[_0x16f6('0x16')](_0x4c4a0e);return _0xe3cd53['set'](_0x16f6('0x1d'),_0xf5946c+'-'+_0x4e8c9b+'/'+_0x14e79a)['json'](_0x36d7a3);}return null;};}function patchUpdates(_0x18e609){return function(_0x436a49){try{jsonpatch[_0x16f6('0x1e')](_0x436a49,_0x18e609,!![]);}catch(_0x3befc3){return BPromise['reject'](_0x3befc3);}return _0x436a49['save']();};}function saveUpdates(_0xfbdde3,_0xec556e){return function(_0x500f9d){if(_0x500f9d){return _0x500f9d[_0x16f6('0x1f')](_0xfbdde3)[_0x16f6('0x20')](function(_0x4c2752){return _0x4c2752;});}return null;};}function removeEntity(_0x26e884,_0x1b5686){return function(_0x22e6d6){if(_0x22e6d6){return _0x22e6d6[_0x16f6('0x21')]()[_0x16f6('0x20')](function(){_0x26e884[_0x16f6('0x16')](0xcc)[_0x16f6('0x17')]();});}};}function handleEntityNotFound(_0x29d670,_0x17684f){return function(_0x429ae2){if(!_0x429ae2){_0x29d670[_0x16f6('0x15')](0x194);}return _0x429ae2;};}function handleError(_0xda95f8,_0x54c00f){_0x54c00f=_0x54c00f||0x1f4;return function(_0x473ee0){logger['error'](_0x473ee0[_0x16f6('0x22')]);if(_0x473ee0[_0x16f6('0x23')]){delete _0x473ee0[_0x16f6('0x23')];}_0xda95f8[_0x16f6('0x16')](_0x54c00f)[_0x16f6('0x24')](_0x473ee0);};}exports[_0x16f6('0x25')]=function(_0x10e44b,_0x343dc1){var _0x555b0b={},_0x3a17f0={},_0x5467a1={'count':0x0,'rows':[]};var _0x2e8a43=_['map'](db[_0x16f6('0x26')][_0x16f6('0x27')],function(_0x30843f){return{'name':_0x30843f[_0x16f6('0x28')],'type':_0x30843f[_0x16f6('0x29')][_0x16f6('0x2a')]};});_0x3a17f0[_0x16f6('0x2b')]=_[_0x16f6('0x2c')](_0x2e8a43,_0x16f6('0x23'));_0x3a17f0[_0x16f6('0x2d')]=_[_0x16f6('0x2e')](_0x10e44b[_0x16f6('0x2d')]);_0x3a17f0[_0x16f6('0x2f')]=_[_0x16f6('0x30')](_0x3a17f0[_0x16f6('0x2b')],_0x3a17f0[_0x16f6('0x2d')]);_0x555b0b[_0x16f6('0x31')]=_[_0x16f6('0x30')](_0x3a17f0[_0x16f6('0x2b')],qs[_0x16f6('0x32')](_0x10e44b[_0x16f6('0x2d')][_0x16f6('0x32')]));_0x555b0b[_0x16f6('0x31')]=_0x555b0b['attributes'][_0x16f6('0x33')]?_0x555b0b[_0x16f6('0x31')]:_0x3a17f0[_0x16f6('0x2b')];if(!_0x10e44b[_0x16f6('0x2d')][_0x16f6('0x34')](_0x16f6('0x35'))){_0x555b0b[_0x16f6('0x1b')]=qs[_0x16f6('0x1b')](_0x10e44b[_0x16f6('0x2d')][_0x16f6('0x1b')]);_0x555b0b[_0x16f6('0x19')]=qs[_0x16f6('0x19')](_0x10e44b[_0x16f6('0x2d')][_0x16f6('0x19')]);}_0x555b0b[_0x16f6('0x36')]=qs['sort'](_0x10e44b[_0x16f6('0x2d')][_0x16f6('0x37')]);_0x555b0b[_0x16f6('0x38')]=qs[_0x16f6('0x2f')](_[_0x16f6('0x39')](_0x10e44b[_0x16f6('0x2d')],_0x3a17f0[_0x16f6('0x2f')]),_0x2e8a43);if(_0x10e44b[_0x16f6('0x2d')][_0x16f6('0x3a')]){_0x555b0b[_0x16f6('0x38')]=_[_0x16f6('0x3b')](_0x555b0b[_0x16f6('0x38')],{'$or':_['map'](_0x2e8a43,function(_0x1a8e22){if(_0x1a8e22['type']!==_0x16f6('0x3c')){var _0x4aa9eb={};_0x4aa9eb[_0x1a8e22['name']]={'$like':'%'+_0x10e44b['query'][_0x16f6('0x3a')]+'%'};return _0x4aa9eb;}})});}_0x555b0b=_[_0x16f6('0x3b')]({},_0x555b0b,_0x10e44b['options']);var _0x312763={'where':_0x555b0b[_0x16f6('0x38')]};return db[_0x16f6('0x26')][_0x16f6('0x1c')](_0x312763)[_0x16f6('0x20')](function(_0x32d86b){_0x5467a1['count']=_0x32d86b;if(_0x10e44b[_0x16f6('0x2d')][_0x16f6('0x3d')]){_0x555b0b[_0x16f6('0x3e')]=[{'all':!![]}];}return db[_0x16f6('0x26')][_0x16f6('0x3f')](_0x555b0b);})[_0x16f6('0x20')](function(_0x1f92c1){_0x5467a1[_0x16f6('0x40')]=_0x1f92c1;return _0x5467a1;})[_0x16f6('0x20')](respondWithFilteredResult(_0x343dc1,_0x555b0b))['catch'](handleError(_0x343dc1,null));};exports[_0x16f6('0x41')]=function(_0x203ec7,_0x4e6880){var _0x385ff8={'raw':![],'where':{'id':_0x203ec7[_0x16f6('0x42')]['id']}},_0x249c1a={};_0x249c1a['model']=_['keys'](db[_0x16f6('0x26')]['rawAttributes']);_0x249c1a[_0x16f6('0x2d')]=_[_0x16f6('0x2e')](_0x203ec7['query']);_0x249c1a[_0x16f6('0x2f')]=_[_0x16f6('0x30')](_0x249c1a[_0x16f6('0x2b')],_0x249c1a[_0x16f6('0x2d')]);_0x385ff8['attributes']=_[_0x16f6('0x30')](_0x249c1a['model'],qs[_0x16f6('0x32')](_0x203ec7[_0x16f6('0x2d')][_0x16f6('0x32')]));_0x385ff8[_0x16f6('0x31')]=_0x385ff8[_0x16f6('0x31')][_0x16f6('0x33')]?_0x385ff8[_0x16f6('0x31')]:_0x249c1a[_0x16f6('0x2b')];if(_0x203ec7[_0x16f6('0x2d')]['includeAll']){_0x385ff8[_0x16f6('0x3e')]=[{'all':!![]}];}_0x385ff8=_['merge']({},_0x385ff8,_0x203ec7[_0x16f6('0x43')]);return db[_0x16f6('0x26')][_0x16f6('0x44')](_0x385ff8)[_0x16f6('0x20')](handleEntityNotFound(_0x4e6880,null))[_0x16f6('0x20')](respondWithResult(_0x4e6880,null))[_0x16f6('0x45')](handleError(_0x4e6880,null));};exports[_0x16f6('0x46')]=function(_0x131b50,_0x183918){return db[_0x16f6('0x26')][_0x16f6('0x46')](_0x131b50[_0x16f6('0x47')],{})[_0x16f6('0x20')](respondWithResult(_0x183918,0xc9))[_0x16f6('0x45')](handleError(_0x183918,null));};exports[_0x16f6('0x1f')]=function(_0x424c55,_0x4accab){if(_0x424c55[_0x16f6('0x47')]['id']){delete _0x424c55[_0x16f6('0x47')]['id'];}return db[_0x16f6('0x26')]['find']({'where':{'id':_0x424c55['params']['id']}})['then'](handleEntityNotFound(_0x4accab,null))[_0x16f6('0x20')](saveUpdates(_0x424c55['body'],null))[_0x16f6('0x20')](respondWithResult(_0x4accab,null))[_0x16f6('0x45')](handleError(_0x4accab,null));};exports[_0x16f6('0x21')]=function(_0x3d5123,_0x158649){return db[_0x16f6('0x26')]['find']({'where':{'id':_0x3d5123['params']['id']}})[_0x16f6('0x20')](handleEntityNotFound(_0x158649,null))[_0x16f6('0x20')](removeEntity(_0x158649,null))['catch'](handleError(_0x158649,null));};exports[_0x16f6('0x48')]=function(_0x414378,_0x54e0f1,_0x4e2fd6){var _0x762bf={};var _0x48cdc5={};var _0x2a0ab3;var _0x486f54;return db[_0x16f6('0x26')]['findOne']({'where':{'id':_0x414378[_0x16f6('0x42')]['id']}})['then'](handleEntityNotFound(_0x54e0f1,null))[_0x16f6('0x20')](function(_0x1f0106){if(_0x1f0106){_0x2a0ab3=_0x1f0106;_0x48cdc5[_0x16f6('0x2b')]=_[_0x16f6('0x2e')](db[_0x16f6('0x49')][_0x16f6('0x27')]);_0x48cdc5['query']=_[_0x16f6('0x2e')](_0x414378[_0x16f6('0x2d')]);_0x48cdc5[_0x16f6('0x2f')]=_['intersection'](_0x48cdc5[_0x16f6('0x2b')],_0x48cdc5[_0x16f6('0x2d')]);_0x762bf['attributes']=_[_0x16f6('0x30')](_0x48cdc5[_0x16f6('0x2b')],qs[_0x16f6('0x32')](_0x414378['query'][_0x16f6('0x32')]));_0x762bf[_0x16f6('0x31')]=_0x762bf['attributes'][_0x16f6('0x33')]?_0x762bf['attributes']:_0x48cdc5[_0x16f6('0x2b')];_0x762bf[_0x16f6('0x36')]=qs[_0x16f6('0x37')](_0x414378['query'][_0x16f6('0x37')]);_0x762bf[_0x16f6('0x38')]=qs[_0x16f6('0x2f')](_[_0x16f6('0x39')](_0x414378[_0x16f6('0x2d')],_0x48cdc5[_0x16f6('0x2f')]));if(_0x414378[_0x16f6('0x2d')][_0x16f6('0x3a')]){_0x762bf[_0x16f6('0x38')]=_[_0x16f6('0x3b')](_0x762bf['where'],{'$or':_[_0x16f6('0x2c')](_0x762bf[_0x16f6('0x31')],function(_0x559dd2){var _0x1a03e2={};_0x1a03e2[_0x559dd2]={'$like':'%'+_0x414378[_0x16f6('0x2d')][_0x16f6('0x3a')]+'%'};return _0x1a03e2;})});}_0x762bf=_[_0x16f6('0x3b')]({},_0x762bf,_0x414378[_0x16f6('0x43')]);return _0x2a0ab3['getConfigurations'](_0x762bf);}})[_0x16f6('0x20')](function(_0x2c4001){if(_0x2c4001){_0x486f54=_0x2c4001['length'];if(!_0x414378['query']['hasOwnProperty'](_0x16f6('0x35'))){_0x762bf['limit']=qs['limit'](_0x414378['query']['limit']);_0x762bf[_0x16f6('0x19')]=qs[_0x16f6('0x19')](_0x414378['query']['offset']);}return _0x2a0ab3['getConfigurations'](_0x762bf);}})[_0x16f6('0x20')](function(_0x1967f9){if(_0x1967f9){return _0x1967f9?{'count':_0x486f54,'rows':_0x1967f9}:null;}})['then'](respondWithResult(_0x54e0f1,null))[_0x16f6('0x45')](handleError(_0x54e0f1,null));};exports['addConfiguration']=function(_0x269c6c,_0x3bc8ee,_0x34c828){if(_0x269c6c['body']['id']){delete _0x269c6c[_0x16f6('0x47')]['id'];}return db[_0x16f6('0x26')][_0x16f6('0x4a')]({'where':{'id':_0x269c6c[_0x16f6('0x42')]['id']}})[_0x16f6('0x20')](handleEntityNotFound(_0x3bc8ee,null))['then'](function(_0x3db2dc){if(_0x3db2dc){_0x269c6c[_0x16f6('0x47')][_0x16f6('0x4b')]=_0x3db2dc['id'];_0x269c6c['body'][_0x16f6('0x4c')]=integrations[_0x16f6('0x4d')](_0x269c6c[_0x16f6('0x47')]['channel'],_0x269c6c[_0x16f6('0x47')][_0x16f6('0x29')]);_0x269c6c['body']['Descriptions']=integrations[_0x16f6('0x4e')](_0x269c6c[_0x16f6('0x47')][_0x16f6('0x4f')],_0x269c6c[_0x16f6('0x47')]['type']);return db[_0x16f6('0x49')][_0x16f6('0x46')](_0x269c6c['body'],{'include':[{'model':db[_0x16f6('0x50')],'as':'Subjects'},{'model':db[_0x16f6('0x50')],'as':_0x16f6('0x51')}]});}return null;})[_0x16f6('0x20')](respondWithResult(_0x3bc8ee,null))[_0x16f6('0x45')](handleError(_0x3bc8ee,null));};exports[_0x16f6('0x52')]=function(_0x4860c0,_0x7ea0a6,_0x22c7f7){var _0x437f15;var _0x541946='';var _0x1a1dd5='Task';return db[_0x16f6('0x26')]['findOne']({'where':{'id':_0x4860c0[_0x16f6('0x42')]['id']},'attributes':['id','remoteUri','clientId',_0x16f6('0x53'),_0x16f6('0x54'),_0x16f6('0x55'),_0x16f6('0x56')]})[_0x16f6('0x20')](handleEntityNotFound(_0x7ea0a6,null))[_0x16f6('0x20')](function(_0x7e5b3f){if(_0x7e5b3f){_0x541946=_0x7e5b3f['remoteUri'];var _0x297f99=_0x541946[_0x16f6('0x57')](-0x1);if(_0x297f99==='/'){_0x541946=_0x541946[_0x16f6('0x58')](0x0,_0x541946[_0x16f6('0x59')](_0x297f99));}_0x437f15=new jsforce[(_0x16f6('0x5a'))]({'oauth2':{'loginUrl':_0x541946,'clientId':_0x7e5b3f['clientId'],'clientSecret':_0x7e5b3f['clientSecret']}});return _0x437f15[_0x16f6('0x5b')](_0x7e5b3f[_0x16f6('0x54')],_0x7e5b3f['password'][_0x16f6('0x5c')](_0x7e5b3f[_0x16f6('0x56')]));}})[_0x16f6('0x20')](function(_0x458749){if(_0x458749){if(!_['isNil'](_0x4860c0['query'][_0x16f6('0x5d')])){_0x1a1dd5=_0x4860c0[_0x16f6('0x2d')][_0x16f6('0x5d')];}return _0x437f15[_0x16f6('0x5e')](_0x1a1dd5)['describe']();}})[_0x16f6('0x20')](function(_0x420663){var _0x4daaa0=[_0x16f6('0x5f'),_0x16f6('0x60'),_0x16f6('0x61'),_0x16f6('0x62'),'Subject',_0x16f6('0x63')];var _0x58e25b=[_0x16f6('0x64'),_0x16f6('0x65'),'picklist',_0x16f6('0x66'),'email',_0x16f6('0x67'),_0x16f6('0x68')];if(_0x420663){_[_0x16f6('0x69')](_0x420663[_0x16f6('0x32')],function(_0x39f661){return _0x4daaa0[_0x16f6('0x6a')](_0x39f661[_0x16f6('0x23')])||!_0x58e25b['includes'](_0x39f661[_0x16f6('0x29')]);});return{'count':_0x420663[_0x16f6('0x32')][_0x16f6('0x33')],'rows':_[_0x16f6('0x2c')](_0x420663[_0x16f6('0x32')],function(_0x49aece){return{'id':_0x49aece[_0x16f6('0x23')],'name':_0x49aece[_0x16f6('0x6b')],'custom':_0x49aece['custom'],'options':_0x49aece[_0x16f6('0x6c')][_0x16f6('0x33')]>0x0?_['map'](_0x49aece[_0x16f6('0x6c')],function(_0x38411d){return{'name':_0x38411d[_0x16f6('0x6b')],'value':_0x38411d[_0x16f6('0x6d')]};}):_0x49aece[_0x16f6('0x29')]=='boolean'?[{'name':'True','value':'true'},{'name':_0x16f6('0x6e'),'value':_0x16f6('0x6f')}]:[]};})};}})[_0x16f6('0x20')](respondWithResult(_0x7ea0a6,null))[_0x16f6('0x45')](function(_0x5034d2){var _0x5aeaed=_0x4860c0[_0x16f6('0x2d')][_0x16f6('0x70')]?0x1f4:_0x5034d2[_0x16f6('0x71')]||0x1f4;logger[_0x16f6('0x72')](_0x16f6('0x73'),_0x16f6('0x52'),_0x5aeaed,JSON['stringify'](_0x5034d2));delete _0x5034d2['name'];if(_0x5aeaed===0x191){_0x5aeaed=0x190;}_0x7ea0a6[_0x16f6('0x16')](_0x5aeaed)[_0x16f6('0x24')](_0x4860c0[_0x16f6('0x2d')][_0x16f6('0x70')]?{'message':_0x16f6('0x74'),'statusCode':_0x5034d2['statusCode']}:_0x5034d2);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 4442486..58403c3 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 _0x6597=['moment','request-promise','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x6597,0x16e));var _0x7659=function(_0x108c22,_0xb983d5){_0x108c22=_0x108c22-0x0;var _0x5ee2f6=_0x6597[_0x108c22];return _0x5ee2f6;};'use strict';var _=require(_0x7659('0x0'));var util=require(_0x7659('0x1'));var logger=require(_0x7659('0x2'))('api');var moment=require(_0x7659('0x3'));var BPromise=require('bluebird');var rp=require(_0x7659('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7659('0x5'));var integrations=require(_0x7659('0x6'));module[_0x7659('0x7')]=function(_0xb90fa2,_0x11cb28){return _0xb90fa2['define']('SalesforceAccount',attributes,{'tableName':_0x7659('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf330=['rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','bluebird','request-promise'];(function(_0xee13c4,_0x5ba30d){var _0x5b2a97=function(_0x3a1b3d){while(--_0x3a1b3d){_0xee13c4['push'](_0xee13c4['shift']());}};_0x5b2a97(++_0x5ba30d);}(_0xf330,0x146));var _0x0f33=function(_0x29e6fb,_0x29dc7c){_0x29e6fb=_0x29e6fb-0x0;var _0x8e46c0=_0xf330[_0x29e6fb];return _0x8e46c0;};'use strict';var _=require(_0x0f33('0x0'));var util=require('util');var logger=require(_0x0f33('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0f33('0x2'));var rp=require(_0x0f33('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f33('0x4'));var config=require('../../config/environment');var attributes=require(_0x0f33('0x5'));var integrations=require(_0x0f33('0x6'));module['exports']=function(_0x4774af,_0x3d36f2){return _0x4774af[_0x0f33('0x7')](_0x0f33('0x8'),attributes,{'tableName':_0x0f33('0x9'),'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 5cfb181..430be4a 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 _0xf7f4=['raw','where','attributes','include','map','model','stringify','ShowSalesforceAccount','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7f4,0x68));var _0x4f7f=function(_0x36cab1,_0x20b215){_0x36cab1=_0x36cab1-0x0;var _0x3bb91=_0xf7f4[_0x36cab1];return _0x3bb91;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7f('0x0'));var rs=require(_0x4f7f('0x1'));var fs=require('fs');var Redis=require(_0x4f7f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f7f('0x3'));var logger=require('../../config/logger')(_0x4f7f('0x4'));var config=require(_0x4f7f('0x5'));var jayson=require(_0x4f7f('0x6'));var client=jayson[_0x4f7f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x459f3d,_0x3a3fd2,_0x58bc57){return new BPromise(function(_0x177923,_0x24ba8d){return client[_0x4f7f('0x8')](_0x459f3d,_0x58bc57)[_0x4f7f('0x9')](function(_0x452366){logger['info'](_0x4f7f('0xa'),_0x3a3fd2,_0x4f7f('0xb'));logger[_0x4f7f('0xc')](_0x4f7f('0xd'),_0x3a3fd2,_0x4f7f('0xb'),JSON['stringify'](_0x452366));if(_0x452366[_0x4f7f('0xe')]){if(_0x452366['error'][_0x4f7f('0xf')]===0x1f4){logger['error'](_0x4f7f('0xa'),_0x3a3fd2,_0x452366[_0x4f7f('0xe')][_0x4f7f('0x10')]);return _0x24ba8d(_0x452366[_0x4f7f('0xe')][_0x4f7f('0x10')]);}logger['error'](_0x4f7f('0xa'),_0x3a3fd2,_0x452366[_0x4f7f('0xe')]['message']);return _0x177923(_0x452366['error'][_0x4f7f('0x10')]);}else{logger[_0x4f7f('0x11')](_0x4f7f('0xa'),_0x3a3fd2,_0x4f7f('0xb'));_0x177923(_0x452366[_0x4f7f('0x12')][_0x4f7f('0x10')]);}})[_0x4f7f('0x13')](function(_0x1fa79f){logger['error'](_0x4f7f('0xa'),_0x3a3fd2,_0x1fa79f);_0x24ba8d(_0x1fa79f);});});}exports[_0x4f7f('0x14')]=function(_0x5646d5){var _0x31633d=this;return new Promise(function(_0x2c3049,_0x5cb9a7){return db[_0x4f7f('0x15')][_0x4f7f('0x16')]({'raw':_0x5646d5[_0x4f7f('0x17')]?_0x5646d5[_0x4f7f('0x17')][_0x4f7f('0x18')]===undefined?!![]:![]:!![],'where':_0x5646d5['options']?_0x5646d5[_0x4f7f('0x17')][_0x4f7f('0x19')]||null:null,'attributes':_0x5646d5[_0x4f7f('0x17')]?_0x5646d5[_0x4f7f('0x17')][_0x4f7f('0x1a')]||null:null,'limit':_0x5646d5[_0x4f7f('0x17')]?_0x5646d5[_0x4f7f('0x17')]['limit']||null:null,'include':_0x5646d5[_0x4f7f('0x17')]?_0x5646d5[_0x4f7f('0x17')][_0x4f7f('0x1b')]?_[_0x4f7f('0x1c')](_0x5646d5[_0x4f7f('0x17')][_0x4f7f('0x1b')],function(_0x567227){return{'model':db[_0x567227[_0x4f7f('0x1d')]],'as':_0x567227['as'],'attributes':_0x567227[_0x4f7f('0x1a')],'include':_0x567227[_0x4f7f('0x1b')]?_[_0x4f7f('0x1c')](_0x567227[_0x4f7f('0x1b')],function(_0x3b71c0){return{'model':db[_0x3b71c0[_0x4f7f('0x1d')]],'as':_0x3b71c0['as'],'attributes':_0x3b71c0[_0x4f7f('0x1a')],'include':_0x3b71c0[_0x4f7f('0x1b')]?_['map'](_0x3b71c0[_0x4f7f('0x1b')],function(_0x3d8d28){return{'model':db[_0x3d8d28[_0x4f7f('0x1d')]],'as':_0x3d8d28['as'],'attributes':_0x3d8d28[_0x4f7f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bef7b){logger['info'](_0x4f7f('0x14'),_0x5646d5);logger[_0x4f7f('0xc')](_0x4f7f('0x14'),_0x5646d5,JSON[_0x4f7f('0x1e')](_0x3bef7b));_0x2c3049(_0x3bef7b);})[_0x4f7f('0x13')](function(_0x5023b3){logger[_0x4f7f('0xe')]('GetSalesforceAccount',_0x5023b3['message'],_0x5646d5);_0x5cb9a7(_0x31633d['error'](0x1f4,_0x5023b3['message']));});});};exports['ShowSalesforceAccount']=function(_0x349d94){var _0x4bf258=this;return new Promise(function(_0xc0f392,_0xd22212){return db[_0x4f7f('0x15')]['find']({'raw':_0x349d94[_0x4f7f('0x17')]?_0x349d94[_0x4f7f('0x17')][_0x4f7f('0x18')]===undefined?!![]:![]:!![],'where':_0x349d94[_0x4f7f('0x17')]?_0x349d94[_0x4f7f('0x17')][_0x4f7f('0x19')]||null:null,'attributes':_0x349d94[_0x4f7f('0x17')]?_0x349d94[_0x4f7f('0x17')][_0x4f7f('0x1a')]||null:null,'include':_0x349d94[_0x4f7f('0x17')]?_0x349d94[_0x4f7f('0x17')][_0x4f7f('0x1b')]?_[_0x4f7f('0x1c')](_0x349d94[_0x4f7f('0x17')][_0x4f7f('0x1b')],function(_0xed900){return{'model':db[_0xed900[_0x4f7f('0x1d')]],'as':_0xed900['as'],'attributes':_0xed900['attributes'],'include':_0xed900[_0x4f7f('0x1b')]?_[_0x4f7f('0x1c')](_0xed900[_0x4f7f('0x1b')],function(_0x296124){return{'model':db[_0x296124['model']],'as':_0x296124['as'],'attributes':_0x296124[_0x4f7f('0x1a')],'include':_0x296124['include']?_[_0x4f7f('0x1c')](_0x296124['include'],function(_0x58d1e8){return{'model':db[_0x58d1e8[_0x4f7f('0x1d')]],'as':_0x58d1e8['as'],'attributes':_0x58d1e8[_0x4f7f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4f7f('0x9')](function(_0x4f7171){logger[_0x4f7f('0x11')](_0x4f7f('0x1f'),_0x349d94);logger[_0x4f7f('0xc')](_0x4f7f('0x1f'),_0x349d94,JSON[_0x4f7f('0x1e')](_0x4f7171));_0xc0f392(_0x4f7171);})[_0x4f7f('0x13')](function(_0x25698a){logger[_0x4f7f('0xe')](_0x4f7f('0x1f'),_0x25698a[_0x4f7f('0x10')],_0x349d94);_0xd22212(_0x4bf258[_0x4f7f('0xe')](0x1f4,_0x25698a[_0x4f7f('0x10')]));});});}; \ No newline at end of file +var _0x156d=['request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','limit','include','model','attributes','info','find','map','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x3aff34,_0x4ae9bc){var _0xebf521=function(_0x4e9a8a){while(--_0x4e9a8a){_0x3aff34['push'](_0x3aff34['shift']());}};_0xebf521(++_0x4ae9bc);}(_0x156d,0x162));var _0xd156=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x156d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd156('0x0'));var BPromise=require(_0xd156('0x1'));var rs=require(_0xd156('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd156('0x3'));var logger=require(_0xd156('0x4'))(_0xd156('0x5'));var config=require(_0xd156('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd156('0x7')][_0xd156('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x145bb1,_0x1a60e3,_0x2c1acf){return new BPromise(function(_0x57f77e,_0x273275){return client[_0xd156('0x9')](_0x145bb1,_0x2c1acf)[_0xd156('0xa')](function(_0x13418a){logger['info'](_0xd156('0xb'),_0x1a60e3,_0xd156('0xc'));logger[_0xd156('0xd')](_0xd156('0xe'),_0x1a60e3,_0xd156('0xc'),JSON[_0xd156('0xf')](_0x13418a));if(_0x13418a[_0xd156('0x10')]){if(_0x13418a['error'][_0xd156('0x11')]===0x1f4){logger['error'](_0xd156('0xb'),_0x1a60e3,_0x13418a[_0xd156('0x10')][_0xd156('0x12')]);return _0x273275(_0x13418a[_0xd156('0x10')][_0xd156('0x12')]);}logger[_0xd156('0x10')](_0xd156('0xb'),_0x1a60e3,_0x13418a[_0xd156('0x10')][_0xd156('0x12')]);return _0x57f77e(_0x13418a[_0xd156('0x10')][_0xd156('0x12')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x1a60e3,'request\x20sent');_0x57f77e(_0x13418a[_0xd156('0x13')][_0xd156('0x12')]);}})[_0xd156('0x14')](function(_0x2c2ef3){logger['error'](_0xd156('0xb'),_0x1a60e3,_0x2c2ef3);_0x273275(_0x2c2ef3);});});}exports[_0xd156('0x15')]=function(_0x265b5e){var _0x551352=this;return new Promise(function(_0x39008e,_0x2ae101){return db[_0xd156('0x16')][_0xd156('0x17')]({'raw':_0x265b5e[_0xd156('0x18')]?_0x265b5e[_0xd156('0x18')][_0xd156('0x19')]===undefined?!![]:![]:!![],'where':_0x265b5e[_0xd156('0x18')]?_0x265b5e[_0xd156('0x18')]['where']||null:null,'attributes':_0x265b5e[_0xd156('0x18')]?_0x265b5e['options']['attributes']||null:null,'limit':_0x265b5e[_0xd156('0x18')]?_0x265b5e[_0xd156('0x18')][_0xd156('0x1a')]||null:null,'include':_0x265b5e[_0xd156('0x18')]?_0x265b5e[_0xd156('0x18')][_0xd156('0x1b')]?_['map'](_0x265b5e[_0xd156('0x18')][_0xd156('0x1b')],function(_0x34042d){return{'model':db[_0x34042d['model']],'as':_0x34042d['as'],'attributes':_0x34042d['attributes'],'include':_0x34042d['include']?_['map'](_0x34042d[_0xd156('0x1b')],function(_0x1b4923){return{'model':db[_0x1b4923[_0xd156('0x1c')]],'as':_0x1b4923['as'],'attributes':_0x1b4923[_0xd156('0x1d')],'include':_0x1b4923[_0xd156('0x1b')]?_['map'](_0x1b4923[_0xd156('0x1b')],function(_0x491e21){return{'model':db[_0x491e21[_0xd156('0x1c')]],'as':_0x491e21['as'],'attributes':_0x491e21[_0xd156('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a8ec2){logger[_0xd156('0x1e')]('GetSalesforceAccount',_0x265b5e);logger['debug'](_0xd156('0x15'),_0x265b5e,JSON[_0xd156('0xf')](_0x4a8ec2));_0x39008e(_0x4a8ec2);})[_0xd156('0x14')](function(_0x3253b0){logger[_0xd156('0x10')]('GetSalesforceAccount',_0x3253b0[_0xd156('0x12')],_0x265b5e);_0x2ae101(_0x551352[_0xd156('0x10')](0x1f4,_0x3253b0[_0xd156('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0x164716){var _0x5c1715=this;return new Promise(function(_0x891eb9,_0x2c7604){return db[_0xd156('0x16')][_0xd156('0x1f')]({'raw':_0x164716[_0xd156('0x18')]?_0x164716[_0xd156('0x18')][_0xd156('0x19')]===undefined?!![]:![]:!![],'where':_0x164716[_0xd156('0x18')]?_0x164716[_0xd156('0x18')]['where']||null:null,'attributes':_0x164716[_0xd156('0x18')]?_0x164716[_0xd156('0x18')][_0xd156('0x1d')]||null:null,'include':_0x164716[_0xd156('0x18')]?_0x164716[_0xd156('0x18')][_0xd156('0x1b')]?_[_0xd156('0x20')](_0x164716['options'][_0xd156('0x1b')],function(_0x5f3046){return{'model':db[_0x5f3046[_0xd156('0x1c')]],'as':_0x5f3046['as'],'attributes':_0x5f3046[_0xd156('0x1d')],'include':_0x5f3046['include']?_[_0xd156('0x20')](_0x5f3046[_0xd156('0x1b')],function(_0x2471e4){return{'model':db[_0x2471e4[_0xd156('0x1c')]],'as':_0x2471e4['as'],'attributes':_0x2471e4[_0xd156('0x1d')],'include':_0x2471e4[_0xd156('0x1b')]?_[_0xd156('0x20')](_0x2471e4[_0xd156('0x1b')],function(_0x16fe53){return{'model':db[_0x16fe53[_0xd156('0x1c')]],'as':_0x16fe53['as'],'attributes':_0x16fe53['attributes']};}):[]};}):[]};}):[]:[]})[_0xd156('0xa')](function(_0x114dce){logger[_0xd156('0x1e')]('ShowSalesforceAccount',_0x164716);logger[_0xd156('0xd')]('ShowSalesforceAccount',_0x164716,JSON[_0xd156('0xf')](_0x114dce));_0x891eb9(_0x114dce);})[_0xd156('0x14')](function(_0x26b443){logger['error']('ShowSalesforceAccount',_0x26b443[_0xd156('0x12')],_0x164716);_0x2c7604(_0x5c1715[_0xd156('0x10')](0x1f4,_0x26b443[_0xd156('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 1bb4a12..df57903 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xdb28,0x106));var _0x8db2=function(_0x3df756,_0x1f14ac){_0x3df756=_0x3df756-0x0;var _0x324c3f=_0xdb28[_0x3df756];return _0x324c3f;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x40eee7,_0x3c566f){var _0x5e256a=function(_0x58ad57){while(--_0x58ad57){_0x40eee7['push'](_0x40eee7['shift']());}};_0x5e256a(++_0x3c566f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3fc376,_0x171c41){_0x3fc376=_0x3fc376-0x0;var _0x5c3f47=_0x5f2f[_0x3fc376];return _0x5c3f47;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 95af88f..fc11345 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 _0xd2f0=['exports','STRING','ENUM','Case','Task','contact','lead','account','contact_lead','nothing','sequelize'];(function(_0x1f2701,_0x49718b){var _0x27a2e4=function(_0x552da5){while(--_0x552da5){_0x1f2701['push'](_0x1f2701['shift']());}};_0x27a2e4(++_0x49718b);}(_0xd2f0,0x18b));var _0x0d2f=function(_0x4b936b,_0x1ae154){_0x4b936b=_0x4b936b-0x0;var _0x2d7fe2=_0xd2f0[_0x4b936b];return _0x2d7fe2;};'use strict';var Sequelize=require(_0x0d2f('0x0'));module[_0x0d2f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0d2f('0x2')]},'ticketType':{'type':Sequelize[_0x0d2f('0x3')]('Task',_0x0d2f('0x4')),'defaultValue':_0x0d2f('0x5')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x0d2f('0x6'),_0x0d2f('0x7'),'account_contact_lead',_0x0d2f('0x8')),'defaultValue':_0x0d2f('0x9')},'moduleCreate':{'type':Sequelize[_0x0d2f('0x3')](_0x0d2f('0xa'),_0x0d2f('0x6'),_0x0d2f('0x7'),_0x0d2f('0x8')),'defaultValue':_0x0d2f('0x7')},'leadId':{'type':Sequelize[_0x0d2f('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x0d2f('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x0d2f('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x0d2f('0x2')]}}; \ No newline at end of file +var _0x2100=['account','nothing','contact','STRING','ENUM','contact_lead','lead','account_contact_lead'];(function(_0x337a10,_0x5191c7){var _0x575f98=function(_0x3851cd){while(--_0x3851cd){_0x337a10['push'](_0x337a10['shift']());}};_0x575f98(++_0x5191c7);}(_0x2100,0x15b));var _0x0210=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0x2100[_0x3902c1];return _0x1266cc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0210('0x0')]},'ticketType':{'type':Sequelize[_0x0210('0x1')]('Task','Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x0210('0x1')](_0x0210('0x2'),'contact',_0x0210('0x3'),_0x0210('0x4'),_0x0210('0x5')),'defaultValue':_0x0210('0x2')},'moduleCreate':{'type':Sequelize['ENUM'](_0x0210('0x6'),_0x0210('0x7'),_0x0210('0x3'),_0x0210('0x5')),'defaultValue':_0x0210('0x3')},'leadId':{'type':Sequelize[_0x0210('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0x0210('0x0')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x0210('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 1ec6e07..5ba3b19 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 _0xe253=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','index','map','SalesforceConfiguration','fieldName','key','query','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','keys','catch','create','body','params','find','getFields','findOne','SalesforceField','length','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment'];(function(_0x59d9fc,_0x49d288){var _0x37dd9b=function(_0x236de1){while(--_0x236de1){_0x59d9fc['push'](_0x59d9fc['shift']());}};_0x37dd9b(++_0x49d288);}(_0xe253,0x134));var _0x3e25=function(_0x31586e,_0x182d65){_0x31586e=_0x31586e-0x0;var _0x427412=_0xe253[_0x31586e];return _0x427412;};'use strict';var emlformat=require(_0x3e25('0x0'));var rimraf=require(_0x3e25('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e25('0x2'));var rp=require(_0x3e25('0x3'));var moment=require(_0x3e25('0x4'));var BPromise=require(_0x3e25('0x5'));var Mustache=require(_0x3e25('0x6'));var util=require(_0x3e25('0x7'));var path=require(_0x3e25('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3e25('0x9'));var fs=require('fs');var fs_extra=require(_0x3e25('0xa'));var _=require(_0x3e25('0xb'));var squel=require(_0x3e25('0xc'));var crypto=require(_0x3e25('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3e25('0xe'));var toCsv=require(_0x3e25('0xf'));var querystring=require('querystring');var Papa=require(_0x3e25('0x10'));var Redis=require(_0x3e25('0x11'));var authService=require(_0x3e25('0x12'));var qs=require(_0x3e25('0x13'));var as=require(_0x3e25('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e25('0x15'))('api');var utils=require(_0x3e25('0x16'));var config=require(_0x3e25('0x17'));var licenseUtil=require(_0x3e25('0x18'));var db=require(_0x3e25('0x19'))['db'];function respondWithStatusCode(_0x45e66b,_0x20efc6){_0x20efc6=_0x20efc6||0xcc;return function(_0x2abbd3){if(_0x2abbd3){return _0x45e66b[_0x3e25('0x1a')](_0x20efc6);}return _0x45e66b[_0x3e25('0x1b')](_0x20efc6)[_0x3e25('0x1c')]();};}function respondWithResult(_0xe29a24,_0x439346){_0x439346=_0x439346||0xc8;return function(_0x1e2f68){if(_0x1e2f68){return _0xe29a24[_0x3e25('0x1b')](_0x439346)[_0x3e25('0x1d')](_0x1e2f68);}};}function respondWithFilteredResult(_0x279fe8,_0x4a0ef3){return function(_0x21443d){if(_0x21443d){var _0xc427fc=typeof _0x4a0ef3[_0x3e25('0x1e')]===_0x3e25('0x1f')&&typeof _0x4a0ef3[_0x3e25('0x20')]==='undefined';var _0x2d43e2=_0x21443d[_0x3e25('0x21')];var _0x3a41b2=_0xc427fc?0x0:_0x4a0ef3[_0x3e25('0x1e')];var _0xb27281=_0xc427fc?_0x21443d[_0x3e25('0x21')]:_0x4a0ef3[_0x3e25('0x1e')]+_0x4a0ef3[_0x3e25('0x20')];var _0x38c0df;if(_0xb27281>=_0x2d43e2){_0xb27281=_0x2d43e2;_0x38c0df=0xc8;}else{_0x38c0df=0xce;}_0x279fe8[_0x3e25('0x1b')](_0x38c0df);return _0x279fe8[_0x3e25('0x22')]('Content-Range',_0x3a41b2+'-'+_0xb27281+'/'+_0x2d43e2)[_0x3e25('0x1d')](_0x21443d);}return null;};}function patchUpdates(_0x26943f){return function(_0x49bbaf){try{jsonpatch[_0x3e25('0x23')](_0x49bbaf,_0x26943f,!![]);}catch(_0x539879){return BPromise[_0x3e25('0x24')](_0x539879);}return _0x49bbaf['save']();};}function saveUpdates(_0x223c6d,_0x591058){return function(_0x20a676){if(_0x20a676){return _0x20a676[_0x3e25('0x25')](_0x223c6d)[_0x3e25('0x26')](function(_0x491b71){return _0x491b71;});}return null;};}function removeEntity(_0x3e7a9e,_0x5800a6){return function(_0x31188d){if(_0x31188d){return _0x31188d[_0x3e25('0x27')]()['then'](function(){_0x3e7a9e[_0x3e25('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f8e4f,_0xe2c370){return function(_0x571522){if(!_0x571522){_0x1f8e4f[_0x3e25('0x1a')](0x194);}return _0x571522;};}function handleError(_0x33483e,_0x482dac){_0x482dac=_0x482dac||0x1f4;return function(_0x76b369){logger[_0x3e25('0x28')](_0x76b369[_0x3e25('0x29')]);if(_0x76b369[_0x3e25('0x2a')]){delete _0x76b369[_0x3e25('0x2a')];}_0x33483e[_0x3e25('0x1b')](_0x482dac)['send'](_0x76b369);};}exports[_0x3e25('0x2b')]=function(_0x246000,_0x234cd1){var _0x5bfa8e={},_0x21be44={},_0x3c6728={'count':0x0,'rows':[]};var _0x3a2456=_[_0x3e25('0x2c')](db[_0x3e25('0x2d')]['rawAttributes'],function(_0x626d67){return{'name':_0x626d67[_0x3e25('0x2e')],'type':_0x626d67['type'][_0x3e25('0x2f')]};});_0x21be44['model']=_[_0x3e25('0x2c')](_0x3a2456,'name');_0x21be44[_0x3e25('0x30')]=_['keys'](_0x246000[_0x3e25('0x30')]);_0x21be44['filters']=_['intersection'](_0x21be44['model'],_0x21be44[_0x3e25('0x30')]);_0x5bfa8e[_0x3e25('0x31')]=_[_0x3e25('0x32')](_0x21be44[_0x3e25('0x33')],qs[_0x3e25('0x34')](_0x246000['query'][_0x3e25('0x34')]));_0x5bfa8e['attributes']=_0x5bfa8e[_0x3e25('0x31')]['length']?_0x5bfa8e[_0x3e25('0x31')]:_0x21be44[_0x3e25('0x33')];if(!_0x246000[_0x3e25('0x30')][_0x3e25('0x35')](_0x3e25('0x36'))){_0x5bfa8e[_0x3e25('0x20')]=qs['limit'](_0x246000[_0x3e25('0x30')][_0x3e25('0x20')]);_0x5bfa8e[_0x3e25('0x1e')]=qs[_0x3e25('0x1e')](_0x246000[_0x3e25('0x30')][_0x3e25('0x1e')]);}_0x5bfa8e[_0x3e25('0x37')]=qs[_0x3e25('0x38')](_0x246000[_0x3e25('0x30')][_0x3e25('0x38')]);_0x5bfa8e[_0x3e25('0x39')]=qs[_0x3e25('0x3a')](_[_0x3e25('0x3b')](_0x246000['query'],_0x21be44[_0x3e25('0x3a')]),_0x3a2456);if(_0x246000[_0x3e25('0x30')][_0x3e25('0x3c')]){_0x5bfa8e['where']=_[_0x3e25('0x3d')](_0x5bfa8e[_0x3e25('0x39')],{'$or':_['map'](_0x3a2456,function(_0x25db18){if(_0x25db18[_0x3e25('0x3e')]!==_0x3e25('0x3f')){var _0x57b9e9={};_0x57b9e9[_0x25db18[_0x3e25('0x2a')]]={'$like':'%'+_0x246000['query'][_0x3e25('0x3c')]+'%'};return _0x57b9e9;}})});}_0x5bfa8e=_[_0x3e25('0x3d')]({},_0x5bfa8e,_0x246000[_0x3e25('0x40')]);var _0x4543e1={'where':_0x5bfa8e[_0x3e25('0x39')]};return db[_0x3e25('0x2d')]['count'](_0x4543e1)['then'](function(_0x568791){_0x3c6728[_0x3e25('0x21')]=_0x568791;if(_0x246000['query'][_0x3e25('0x41')]){_0x5bfa8e[_0x3e25('0x42')]=[{'all':!![]}];}return db[_0x3e25('0x2d')][_0x3e25('0x43')](_0x5bfa8e);})[_0x3e25('0x26')](function(_0x6d3a6b){_0x3c6728[_0x3e25('0x44')]=_0x6d3a6b;return _0x3c6728;})[_0x3e25('0x26')](respondWithFilteredResult(_0x234cd1,_0x5bfa8e))['catch'](handleError(_0x234cd1,null));};exports[_0x3e25('0x45')]=function(_0x576632,_0x5e9bd1){var _0x19c156={'raw':![],'where':{'id':_0x576632['params']['id']}},_0x42de6e={};_0x42de6e[_0x3e25('0x33')]=_['keys'](db['SalesforceConfiguration'][_0x3e25('0x46')]);_0x42de6e[_0x3e25('0x30')]=_[_0x3e25('0x47')](_0x576632[_0x3e25('0x30')]);_0x42de6e[_0x3e25('0x3a')]=_[_0x3e25('0x32')](_0x42de6e[_0x3e25('0x33')],_0x42de6e[_0x3e25('0x30')]);_0x19c156[_0x3e25('0x31')]=_[_0x3e25('0x32')](_0x42de6e[_0x3e25('0x33')],qs[_0x3e25('0x34')](_0x576632[_0x3e25('0x30')][_0x3e25('0x34')]));_0x19c156[_0x3e25('0x31')]=_0x19c156[_0x3e25('0x31')]['length']?_0x19c156[_0x3e25('0x31')]:_0x42de6e[_0x3e25('0x33')];if(_0x576632[_0x3e25('0x30')]['includeAll']){_0x19c156[_0x3e25('0x42')]=[{'all':!![]}];}_0x19c156=_['merge']({},_0x19c156,_0x576632['options']);return db[_0x3e25('0x2d')]['find'](_0x19c156)[_0x3e25('0x26')](handleEntityNotFound(_0x5e9bd1,null))['then'](respondWithResult(_0x5e9bd1,null))[_0x3e25('0x48')](handleError(_0x5e9bd1,null));};exports[_0x3e25('0x49')]=function(_0x24addb,_0x406484){return db['SalesforceConfiguration'][_0x3e25('0x49')](_0x24addb['body'],{})['then'](respondWithResult(_0x406484,0xc9))['catch'](handleError(_0x406484,null));};exports[_0x3e25('0x25')]=function(_0x5e2bf0,_0xe60c3d){if(_0x5e2bf0[_0x3e25('0x4a')]['id']){delete _0x5e2bf0[_0x3e25('0x4a')]['id'];}return db[_0x3e25('0x2d')]['find']({'where':{'id':_0x5e2bf0[_0x3e25('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe60c3d,null))[_0x3e25('0x26')](saveUpdates(_0x5e2bf0['body'],null))[_0x3e25('0x26')](respondWithResult(_0xe60c3d,null))[_0x3e25('0x48')](handleError(_0xe60c3d,null));};exports[_0x3e25('0x27')]=function(_0x1999e7,_0x51eff7){return db[_0x3e25('0x2d')][_0x3e25('0x4c')]({'where':{'id':_0x1999e7[_0x3e25('0x4b')]['id']}})[_0x3e25('0x26')](handleEntityNotFound(_0x51eff7,null))['then'](removeEntity(_0x51eff7,null))[_0x3e25('0x48')](handleError(_0x51eff7,null));};exports[_0x3e25('0x4d')]=function(_0x687d4c,_0x105ea3,_0x4e21c8){var _0x10bdb6={};var _0x406d5a={};var _0x5ab654;var _0x572a40;return db[_0x3e25('0x2d')][_0x3e25('0x4e')]({'where':{'id':_0x687d4c[_0x3e25('0x4b')]['id']}})[_0x3e25('0x26')](handleEntityNotFound(_0x105ea3,null))[_0x3e25('0x26')](function(_0x273cc3){if(_0x273cc3){_0x5ab654=_0x273cc3;_0x406d5a[_0x3e25('0x33')]=_[_0x3e25('0x47')](db[_0x3e25('0x4f')][_0x3e25('0x46')]);_0x406d5a[_0x3e25('0x30')]=_[_0x3e25('0x47')](_0x687d4c[_0x3e25('0x30')]);_0x406d5a['filters']=_[_0x3e25('0x32')](_0x406d5a[_0x3e25('0x33')],_0x406d5a[_0x3e25('0x30')]);_0x10bdb6[_0x3e25('0x31')]=_['intersection'](_0x406d5a[_0x3e25('0x33')],qs[_0x3e25('0x34')](_0x687d4c[_0x3e25('0x30')]['fields']));_0x10bdb6[_0x3e25('0x31')]=_0x10bdb6[_0x3e25('0x31')][_0x3e25('0x50')]?_0x10bdb6[_0x3e25('0x31')]:_0x406d5a[_0x3e25('0x33')];_0x10bdb6['order']=qs[_0x3e25('0x38')](_0x687d4c['query'][_0x3e25('0x38')]);_0x10bdb6[_0x3e25('0x39')]=qs['filters'](_['pick'](_0x687d4c[_0x3e25('0x30')],_0x406d5a[_0x3e25('0x3a')]));if(_0x687d4c[_0x3e25('0x30')]['filter']){_0x10bdb6[_0x3e25('0x39')]=_[_0x3e25('0x3d')](_0x10bdb6['where'],{'$or':_[_0x3e25('0x2c')](_0x10bdb6[_0x3e25('0x31')],function(_0xae0962){var _0x511168={};_0x511168[_0xae0962]={'$like':'%'+_0x687d4c['query'][_0x3e25('0x3c')]+'%'};return _0x511168;})});}_0x10bdb6=_[_0x3e25('0x3d')]({},_0x10bdb6,_0x687d4c['options']);return _0x5ab654[_0x3e25('0x4d')](_0x10bdb6);}})[_0x3e25('0x26')](function(_0x195e97){if(_0x195e97){_0x572a40=_0x195e97[_0x3e25('0x50')];if(!_0x687d4c['query'][_0x3e25('0x35')]('nolimit')){_0x10bdb6[_0x3e25('0x20')]=qs['limit'](_0x687d4c[_0x3e25('0x30')]['limit']);_0x10bdb6[_0x3e25('0x1e')]=qs['offset'](_0x687d4c[_0x3e25('0x30')][_0x3e25('0x1e')]);}return _0x5ab654[_0x3e25('0x4d')](_0x10bdb6);}})['then'](function(_0x545214){if(_0x545214){return _0x545214?{'count':_0x572a40,'rows':_0x545214}:null;}})[_0x3e25('0x26')](respondWithResult(_0x105ea3,null))[_0x3e25('0x48')](handleError(_0x105ea3,null));};exports[_0x3e25('0x51')]=function(_0x490fd7,_0x1de582,_0x327ace){var _0xf4ceb7={};var _0x2b69a2={};var _0x4b71d3;var _0x479e33;return db[_0x3e25('0x2d')][_0x3e25('0x4e')]({'where':{'id':_0x490fd7['params']['id']}})['then'](handleEntityNotFound(_0x1de582,null))[_0x3e25('0x26')](function(_0x9bbfba){if(_0x9bbfba){_0x4b71d3=_0x9bbfba;_0x2b69a2[_0x3e25('0x33')]=_[_0x3e25('0x47')](db['SalesforceField']['rawAttributes']);_0x2b69a2[_0x3e25('0x30')]=_[_0x3e25('0x47')](_0x490fd7[_0x3e25('0x30')]);_0x2b69a2[_0x3e25('0x3a')]=_[_0x3e25('0x32')](_0x2b69a2[_0x3e25('0x33')],_0x2b69a2['query']);_0xf4ceb7[_0x3e25('0x31')]=_[_0x3e25('0x32')](_0x2b69a2[_0x3e25('0x33')],qs[_0x3e25('0x34')](_0x490fd7['query'][_0x3e25('0x34')]));_0xf4ceb7['attributes']=_0xf4ceb7[_0x3e25('0x31')][_0x3e25('0x50')]?_0xf4ceb7[_0x3e25('0x31')]:_0x2b69a2[_0x3e25('0x33')];_0xf4ceb7[_0x3e25('0x37')]=qs[_0x3e25('0x38')](_0x490fd7['query']['sort']);_0xf4ceb7[_0x3e25('0x39')]=qs[_0x3e25('0x3a')](_['pick'](_0x490fd7['query'],_0x2b69a2[_0x3e25('0x3a')]));if(_0x490fd7['query'][_0x3e25('0x3c')]){_0xf4ceb7[_0x3e25('0x39')]=_[_0x3e25('0x3d')](_0xf4ceb7[_0x3e25('0x39')],{'$or':_[_0x3e25('0x2c')](_0xf4ceb7[_0x3e25('0x31')],function(_0x328424){var _0x8c3312={};_0x8c3312[_0x328424]={'$like':'%'+_0x490fd7[_0x3e25('0x30')][_0x3e25('0x3c')]+'%'};return _0x8c3312;})});}_0xf4ceb7=_[_0x3e25('0x3d')]({},_0xf4ceb7,_0x490fd7['options']);return _0x4b71d3[_0x3e25('0x51')](_0xf4ceb7);}})['then'](function(_0x5d6bbe){if(_0x5d6bbe){_0x479e33=_0x5d6bbe[_0x3e25('0x50')];if(!_0x490fd7[_0x3e25('0x30')]['hasOwnProperty'](_0x3e25('0x36'))){_0xf4ceb7['limit']=qs[_0x3e25('0x20')](_0x490fd7[_0x3e25('0x30')][_0x3e25('0x20')]);_0xf4ceb7[_0x3e25('0x1e')]=qs[_0x3e25('0x1e')](_0x490fd7[_0x3e25('0x30')]['offset']);}return _0x4b71d3['getSubjects'](_0xf4ceb7);}})['then'](function(_0x2e837e){if(_0x2e837e){return _0x2e837e?{'count':_0x479e33,'rows':_0x2e837e}:null;}})[_0x3e25('0x26')](respondWithResult(_0x1de582,null))[_0x3e25('0x48')](handleError(_0x1de582,null));};exports[_0x3e25('0x52')]=function(_0x25be7b,_0x4c1e8d,_0x5cae7b){var _0x3015e3={};var _0x38f9ab={};var _0x2332f2;var _0x2621ae;return db[_0x3e25('0x2d')]['findOne']({'where':{'id':_0x25be7b[_0x3e25('0x4b')]['id']}})[_0x3e25('0x26')](handleEntityNotFound(_0x4c1e8d,null))[_0x3e25('0x26')](function(_0x62dcd8){if(_0x62dcd8){_0x2332f2=_0x62dcd8;_0x38f9ab[_0x3e25('0x33')]=_[_0x3e25('0x47')](db[_0x3e25('0x4f')][_0x3e25('0x46')]);_0x38f9ab['query']=_['keys'](_0x25be7b[_0x3e25('0x30')]);_0x38f9ab[_0x3e25('0x3a')]=_[_0x3e25('0x32')](_0x38f9ab[_0x3e25('0x33')],_0x38f9ab['query']);_0x3015e3[_0x3e25('0x31')]=_['intersection'](_0x38f9ab[_0x3e25('0x33')],qs[_0x3e25('0x34')](_0x25be7b['query']['fields']));_0x3015e3[_0x3e25('0x31')]=_0x3015e3[_0x3e25('0x31')][_0x3e25('0x50')]?_0x3015e3[_0x3e25('0x31')]:_0x38f9ab['model'];_0x3015e3[_0x3e25('0x37')]=qs[_0x3e25('0x38')](_0x25be7b[_0x3e25('0x30')][_0x3e25('0x38')]);_0x3015e3['where']=qs[_0x3e25('0x3a')](_[_0x3e25('0x3b')](_0x25be7b[_0x3e25('0x30')],_0x38f9ab['filters']));if(_0x25be7b[_0x3e25('0x30')]['filter']){_0x3015e3[_0x3e25('0x39')]=_[_0x3e25('0x3d')](_0x3015e3[_0x3e25('0x39')],{'$or':_[_0x3e25('0x2c')](_0x3015e3[_0x3e25('0x31')],function(_0x707c99){var _0x18f18a={};_0x18f18a[_0x707c99]={'$like':'%'+_0x25be7b[_0x3e25('0x30')]['filter']+'%'};return _0x18f18a;})});}_0x3015e3=_['merge']({},_0x3015e3,_0x25be7b[_0x3e25('0x40')]);return _0x2332f2[_0x3e25('0x52')](_0x3015e3);}})['then'](function(_0x22ee12){if(_0x22ee12){_0x2621ae=_0x22ee12[_0x3e25('0x50')];if(!_0x25be7b[_0x3e25('0x30')][_0x3e25('0x35')](_0x3e25('0x36'))){_0x3015e3[_0x3e25('0x20')]=qs['limit'](_0x25be7b[_0x3e25('0x30')][_0x3e25('0x20')]);_0x3015e3[_0x3e25('0x1e')]=qs[_0x3e25('0x1e')](_0x25be7b[_0x3e25('0x30')][_0x3e25('0x1e')]);}return _0x2332f2[_0x3e25('0x52')](_0x3015e3);}})[_0x3e25('0x26')](function(_0x310fab){if(_0x310fab){return _0x310fab?{'count':_0x2621ae,'rows':_0x310fab}:null;}})[_0x3e25('0x26')](respondWithResult(_0x4c1e8d,null))['catch'](handleError(_0x4c1e8d,null));}; \ No newline at end of file +var _0x449f=['type','VIRTUAL','options','include','rows','catch','show','params','fields','includeAll','find','create','body','getFields','findOne','SalesforceField','nolimit','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','filter','where','merge'];(function(_0xfeabd0,_0x3e8158){var _0x389ad4=function(_0x2ae0d4){while(--_0x2ae0d4){_0xfeabd0['push'](_0xfeabd0['shift']());}};_0x389ad4(++_0x3e8158);}(_0x449f,0xb2));var _0xf449=function(_0x2984d0,_0x1a7211){_0x2984d0=_0x2984d0-0x0;var _0x2885f2=_0x449f[_0x2984d0];return _0x2885f2;};'use strict';var emlformat=require(_0xf449('0x0'));var rimraf=require(_0xf449('0x1'));var zipdir=require(_0xf449('0x2'));var jsonpatch=require(_0xf449('0x3'));var rp=require(_0xf449('0x4'));var moment=require(_0xf449('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf449('0x6'));var csv=require(_0xf449('0x7'));var ejs=require(_0xf449('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf449('0x9'));var squel=require(_0xf449('0xa'));var crypto=require(_0xf449('0xb'));var jsforce=require(_0xf449('0xc'));var deskjs=require(_0xf449('0xd'));var toCsv=require(_0xf449('0x7'));var querystring=require(_0xf449('0xe'));var Papa=require(_0xf449('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf449('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf449('0x11'));var logger=require(_0xf449('0x12'))(_0xf449('0x13'));var utils=require('../../config/utils');var config=require(_0xf449('0x14'));var licenseUtil=require(_0xf449('0x15'));var db=require(_0xf449('0x16'))['db'];function respondWithStatusCode(_0x2255d5,_0x239e75){_0x239e75=_0x239e75||0xcc;return function(_0x42d3f6){if(_0x42d3f6){return _0x2255d5[_0xf449('0x17')](_0x239e75);}return _0x2255d5[_0xf449('0x18')](_0x239e75)[_0xf449('0x19')]();};}function respondWithResult(_0x340747,_0x539d6f){_0x539d6f=_0x539d6f||0xc8;return function(_0x48fd98){if(_0x48fd98){return _0x340747[_0xf449('0x18')](_0x539d6f)['json'](_0x48fd98);}};}function respondWithFilteredResult(_0xc78fd5,_0x34413d){return function(_0x36d760){if(_0x36d760){var _0x288d80=typeof _0x34413d[_0xf449('0x1a')]===_0xf449('0x1b')&&typeof _0x34413d[_0xf449('0x1c')]===_0xf449('0x1b');var _0x5cfea3=_0x36d760[_0xf449('0x1d')];var _0x758ce7=_0x288d80?0x0:_0x34413d['offset'];var _0x45cc0f=_0x288d80?_0x36d760['count']:_0x34413d[_0xf449('0x1a')]+_0x34413d[_0xf449('0x1c')];var _0x4acc86;if(_0x45cc0f>=_0x5cfea3){_0x45cc0f=_0x5cfea3;_0x4acc86=0xc8;}else{_0x4acc86=0xce;}_0xc78fd5[_0xf449('0x18')](_0x4acc86);return _0xc78fd5[_0xf449('0x1e')](_0xf449('0x1f'),_0x758ce7+'-'+_0x45cc0f+'/'+_0x5cfea3)['json'](_0x36d760);}return null;};}function patchUpdates(_0xa79ded){return function(_0x649167){try{jsonpatch[_0xf449('0x20')](_0x649167,_0xa79ded,!![]);}catch(_0x4c7b8e){return BPromise[_0xf449('0x21')](_0x4c7b8e);}return _0x649167[_0xf449('0x22')]();};}function saveUpdates(_0x7e7cf3,_0x8857d2){return function(_0x3c2e45){if(_0x3c2e45){return _0x3c2e45['update'](_0x7e7cf3)[_0xf449('0x23')](function(_0x2d1af7){return _0x2d1af7;});}return null;};}function removeEntity(_0x594e42,_0x27286d){return function(_0x2f1f8a){if(_0x2f1f8a){return _0x2f1f8a[_0xf449('0x24')]()[_0xf449('0x23')](function(){_0x594e42[_0xf449('0x18')](0xcc)[_0xf449('0x19')]();});}};}function handleEntityNotFound(_0x5ad867,_0xfbb1b7){return function(_0x2cd92c){if(!_0x2cd92c){_0x5ad867['sendStatus'](0x194);}return _0x2cd92c;};}function handleError(_0x24936a,_0x4ae6cf){_0x4ae6cf=_0x4ae6cf||0x1f4;return function(_0x47cb95){logger[_0xf449('0x25')](_0x47cb95[_0xf449('0x26')]);if(_0x47cb95['name']){delete _0x47cb95[_0xf449('0x27')];}_0x24936a[_0xf449('0x18')](_0x4ae6cf)[_0xf449('0x28')](_0x47cb95);};}exports[_0xf449('0x29')]=function(_0x3466ad,_0x17ea9d){var _0x84a724={},_0x2b2a2e={},_0x6acde5={'count':0x0,'rows':[]};var _0x1d74e7=_[_0xf449('0x2a')](db[_0xf449('0x2b')][_0xf449('0x2c')],function(_0x398a87){return{'name':_0x398a87[_0xf449('0x2d')],'type':_0x398a87['type']['key']};});_0x2b2a2e['model']=_[_0xf449('0x2a')](_0x1d74e7,_0xf449('0x27'));_0x2b2a2e['query']=_[_0xf449('0x2e')](_0x3466ad[_0xf449('0x2f')]);_0x2b2a2e[_0xf449('0x30')]=_[_0xf449('0x31')](_0x2b2a2e[_0xf449('0x32')],_0x2b2a2e[_0xf449('0x2f')]);_0x84a724['attributes']=_[_0xf449('0x31')](_0x2b2a2e[_0xf449('0x32')],qs['fields'](_0x3466ad[_0xf449('0x2f')]['fields']));_0x84a724[_0xf449('0x33')]=_0x84a724[_0xf449('0x33')][_0xf449('0x34')]?_0x84a724['attributes']:_0x2b2a2e[_0xf449('0x32')];if(!_0x3466ad[_0xf449('0x2f')][_0xf449('0x35')]('nolimit')){_0x84a724['limit']=qs['limit'](_0x3466ad[_0xf449('0x2f')]['limit']);_0x84a724[_0xf449('0x1a')]=qs['offset'](_0x3466ad['query']['offset']);}_0x84a724[_0xf449('0x36')]=qs[_0xf449('0x37')](_0x3466ad['query'][_0xf449('0x37')]);_0x84a724['where']=qs['filters'](_['pick'](_0x3466ad[_0xf449('0x2f')],_0x2b2a2e[_0xf449('0x30')]),_0x1d74e7);if(_0x3466ad[_0xf449('0x2f')][_0xf449('0x38')]){_0x84a724[_0xf449('0x39')]=_[_0xf449('0x3a')](_0x84a724[_0xf449('0x39')],{'$or':_[_0xf449('0x2a')](_0x1d74e7,function(_0x5c0a96){if(_0x5c0a96[_0xf449('0x3b')]!==_0xf449('0x3c')){var _0x2c5c87={};_0x2c5c87[_0x5c0a96[_0xf449('0x27')]]={'$like':'%'+_0x3466ad[_0xf449('0x2f')]['filter']+'%'};return _0x2c5c87;}})});}_0x84a724=_['merge']({},_0x84a724,_0x3466ad[_0xf449('0x3d')]);var _0x4c1866={'where':_0x84a724[_0xf449('0x39')]};return db['SalesforceConfiguration'][_0xf449('0x1d')](_0x4c1866)[_0xf449('0x23')](function(_0x2f3f6d){_0x6acde5['count']=_0x2f3f6d;if(_0x3466ad[_0xf449('0x2f')]['includeAll']){_0x84a724[_0xf449('0x3e')]=[{'all':!![]}];}return db[_0xf449('0x2b')]['findAll'](_0x84a724);})['then'](function(_0x1dcc18){_0x6acde5[_0xf449('0x3f')]=_0x1dcc18;return _0x6acde5;})[_0xf449('0x23')](respondWithFilteredResult(_0x17ea9d,_0x84a724))[_0xf449('0x40')](handleError(_0x17ea9d,null));};exports[_0xf449('0x41')]=function(_0x5752ce,_0x2da78a){var _0x36e989={'raw':![],'where':{'id':_0x5752ce[_0xf449('0x42')]['id']}},_0x17a167={};_0x17a167[_0xf449('0x32')]=_['keys'](db[_0xf449('0x2b')][_0xf449('0x2c')]);_0x17a167[_0xf449('0x2f')]=_[_0xf449('0x2e')](_0x5752ce[_0xf449('0x2f')]);_0x17a167[_0xf449('0x30')]=_[_0xf449('0x31')](_0x17a167[_0xf449('0x32')],_0x17a167['query']);_0x36e989[_0xf449('0x33')]=_['intersection'](_0x17a167['model'],qs[_0xf449('0x43')](_0x5752ce[_0xf449('0x2f')][_0xf449('0x43')]));_0x36e989['attributes']=_0x36e989[_0xf449('0x33')][_0xf449('0x34')]?_0x36e989[_0xf449('0x33')]:_0x17a167[_0xf449('0x32')];if(_0x5752ce[_0xf449('0x2f')][_0xf449('0x44')]){_0x36e989[_0xf449('0x3e')]=[{'all':!![]}];}_0x36e989=_[_0xf449('0x3a')]({},_0x36e989,_0x5752ce[_0xf449('0x3d')]);return db[_0xf449('0x2b')][_0xf449('0x45')](_0x36e989)[_0xf449('0x23')](handleEntityNotFound(_0x2da78a,null))['then'](respondWithResult(_0x2da78a,null))[_0xf449('0x40')](handleError(_0x2da78a,null));};exports['create']=function(_0x3f9873,_0x2b8cd4){return db[_0xf449('0x2b')][_0xf449('0x46')](_0x3f9873['body'],{})[_0xf449('0x23')](respondWithResult(_0x2b8cd4,0xc9))[_0xf449('0x40')](handleError(_0x2b8cd4,null));};exports['update']=function(_0x5f4f30,_0x5bd5de){if(_0x5f4f30['body']['id']){delete _0x5f4f30[_0xf449('0x47')]['id'];}return db[_0xf449('0x2b')][_0xf449('0x45')]({'where':{'id':_0x5f4f30['params']['id']}})[_0xf449('0x23')](handleEntityNotFound(_0x5bd5de,null))[_0xf449('0x23')](saveUpdates(_0x5f4f30[_0xf449('0x47')],null))['then'](respondWithResult(_0x5bd5de,null))[_0xf449('0x40')](handleError(_0x5bd5de,null));};exports[_0xf449('0x24')]=function(_0xb1b020,_0x2cf0ce){return db['SalesforceConfiguration'][_0xf449('0x45')]({'where':{'id':_0xb1b020[_0xf449('0x42')]['id']}})['then'](handleEntityNotFound(_0x2cf0ce,null))[_0xf449('0x23')](removeEntity(_0x2cf0ce,null))[_0xf449('0x40')](handleError(_0x2cf0ce,null));};exports[_0xf449('0x48')]=function(_0x406e63,_0x14f073,_0x32ff72){var _0x4ec444={};var _0x4baa8c={};var _0x25a9bc;var _0x1e3ea8;return db[_0xf449('0x2b')][_0xf449('0x49')]({'where':{'id':_0x406e63[_0xf449('0x42')]['id']}})[_0xf449('0x23')](handleEntityNotFound(_0x14f073,null))[_0xf449('0x23')](function(_0xca5aaf){if(_0xca5aaf){_0x25a9bc=_0xca5aaf;_0x4baa8c[_0xf449('0x32')]=_[_0xf449('0x2e')](db[_0xf449('0x4a')]['rawAttributes']);_0x4baa8c[_0xf449('0x2f')]=_[_0xf449('0x2e')](_0x406e63['query']);_0x4baa8c[_0xf449('0x30')]=_[_0xf449('0x31')](_0x4baa8c['model'],_0x4baa8c['query']);_0x4ec444['attributes']=_[_0xf449('0x31')](_0x4baa8c[_0xf449('0x32')],qs[_0xf449('0x43')](_0x406e63[_0xf449('0x2f')][_0xf449('0x43')]));_0x4ec444[_0xf449('0x33')]=_0x4ec444[_0xf449('0x33')]['length']?_0x4ec444[_0xf449('0x33')]:_0x4baa8c[_0xf449('0x32')];_0x4ec444[_0xf449('0x36')]=qs[_0xf449('0x37')](_0x406e63[_0xf449('0x2f')][_0xf449('0x37')]);_0x4ec444[_0xf449('0x39')]=qs['filters'](_['pick'](_0x406e63[_0xf449('0x2f')],_0x4baa8c['filters']));if(_0x406e63[_0xf449('0x2f')]['filter']){_0x4ec444['where']=_[_0xf449('0x3a')](_0x4ec444[_0xf449('0x39')],{'$or':_[_0xf449('0x2a')](_0x4ec444[_0xf449('0x33')],function(_0x3e39a3){var _0x114da6={};_0x114da6[_0x3e39a3]={'$like':'%'+_0x406e63[_0xf449('0x2f')]['filter']+'%'};return _0x114da6;})});}_0x4ec444=_[_0xf449('0x3a')]({},_0x4ec444,_0x406e63[_0xf449('0x3d')]);return _0x25a9bc[_0xf449('0x48')](_0x4ec444);}})[_0xf449('0x23')](function(_0x1b44e3){if(_0x1b44e3){_0x1e3ea8=_0x1b44e3[_0xf449('0x34')];if(!_0x406e63[_0xf449('0x2f')][_0xf449('0x35')](_0xf449('0x4b'))){_0x4ec444[_0xf449('0x1c')]=qs[_0xf449('0x1c')](_0x406e63[_0xf449('0x2f')][_0xf449('0x1c')]);_0x4ec444[_0xf449('0x1a')]=qs['offset'](_0x406e63[_0xf449('0x2f')][_0xf449('0x1a')]);}return _0x25a9bc[_0xf449('0x48')](_0x4ec444);}})[_0xf449('0x23')](function(_0x2f53bb){if(_0x2f53bb){return _0x2f53bb?{'count':_0x1e3ea8,'rows':_0x2f53bb}:null;}})[_0xf449('0x23')](respondWithResult(_0x14f073,null))[_0xf449('0x40')](handleError(_0x14f073,null));};exports[_0xf449('0x4c')]=function(_0x3e862d,_0xf1bdf6,_0x3787ea){var _0x13c896={};var _0xb13437={};var _0x45d33f;var _0x2141b8;return db[_0xf449('0x2b')][_0xf449('0x49')]({'where':{'id':_0x3e862d[_0xf449('0x42')]['id']}})[_0xf449('0x23')](handleEntityNotFound(_0xf1bdf6,null))['then'](function(_0x24387e){if(_0x24387e){_0x45d33f=_0x24387e;_0xb13437[_0xf449('0x32')]=_[_0xf449('0x2e')](db[_0xf449('0x4a')]['rawAttributes']);_0xb13437['query']=_[_0xf449('0x2e')](_0x3e862d['query']);_0xb13437['filters']=_[_0xf449('0x31')](_0xb13437[_0xf449('0x32')],_0xb13437[_0xf449('0x2f')]);_0x13c896[_0xf449('0x33')]=_['intersection'](_0xb13437['model'],qs[_0xf449('0x43')](_0x3e862d['query'][_0xf449('0x43')]));_0x13c896[_0xf449('0x33')]=_0x13c896[_0xf449('0x33')][_0xf449('0x34')]?_0x13c896[_0xf449('0x33')]:_0xb13437['model'];_0x13c896[_0xf449('0x36')]=qs['sort'](_0x3e862d[_0xf449('0x2f')][_0xf449('0x37')]);_0x13c896[_0xf449('0x39')]=qs[_0xf449('0x30')](_[_0xf449('0x4d')](_0x3e862d[_0xf449('0x2f')],_0xb13437['filters']));if(_0x3e862d[_0xf449('0x2f')]['filter']){_0x13c896[_0xf449('0x39')]=_[_0xf449('0x3a')](_0x13c896['where'],{'$or':_[_0xf449('0x2a')](_0x13c896[_0xf449('0x33')],function(_0x39e53f){var _0x3cb31b={};_0x3cb31b[_0x39e53f]={'$like':'%'+_0x3e862d[_0xf449('0x2f')][_0xf449('0x38')]+'%'};return _0x3cb31b;})});}_0x13c896=_[_0xf449('0x3a')]({},_0x13c896,_0x3e862d[_0xf449('0x3d')]);return _0x45d33f[_0xf449('0x4c')](_0x13c896);}})[_0xf449('0x23')](function(_0x37a748){if(_0x37a748){_0x2141b8=_0x37a748[_0xf449('0x34')];if(!_0x3e862d[_0xf449('0x2f')][_0xf449('0x35')](_0xf449('0x4b'))){_0x13c896[_0xf449('0x1c')]=qs[_0xf449('0x1c')](_0x3e862d['query'][_0xf449('0x1c')]);_0x13c896['offset']=qs['offset'](_0x3e862d[_0xf449('0x2f')][_0xf449('0x1a')]);}return _0x45d33f['getSubjects'](_0x13c896);}})[_0xf449('0x23')](function(_0x282533){if(_0x282533){return _0x282533?{'count':_0x2141b8,'rows':_0x282533}:null;}})[_0xf449('0x23')](respondWithResult(_0xf1bdf6,null))[_0xf449('0x40')](handleError(_0xf1bdf6,null));};exports[_0xf449('0x4e')]=function(_0x1631f2,_0x509a25,_0x19c742){var _0x1b5bbf={};var _0x45eebc={};var _0x13f4d7;var _0xbd08e4;return db[_0xf449('0x2b')][_0xf449('0x49')]({'where':{'id':_0x1631f2['params']['id']}})[_0xf449('0x23')](handleEntityNotFound(_0x509a25,null))[_0xf449('0x23')](function(_0x554a1a){if(_0x554a1a){_0x13f4d7=_0x554a1a;_0x45eebc[_0xf449('0x32')]=_[_0xf449('0x2e')](db['SalesforceField']['rawAttributes']);_0x45eebc[_0xf449('0x2f')]=_[_0xf449('0x2e')](_0x1631f2[_0xf449('0x2f')]);_0x45eebc[_0xf449('0x30')]=_[_0xf449('0x31')](_0x45eebc['model'],_0x45eebc['query']);_0x1b5bbf[_0xf449('0x33')]=_[_0xf449('0x31')](_0x45eebc[_0xf449('0x32')],qs[_0xf449('0x43')](_0x1631f2[_0xf449('0x2f')][_0xf449('0x43')]));_0x1b5bbf[_0xf449('0x33')]=_0x1b5bbf[_0xf449('0x33')]['length']?_0x1b5bbf['attributes']:_0x45eebc['model'];_0x1b5bbf['order']=qs[_0xf449('0x37')](_0x1631f2[_0xf449('0x2f')][_0xf449('0x37')]);_0x1b5bbf[_0xf449('0x39')]=qs[_0xf449('0x30')](_[_0xf449('0x4d')](_0x1631f2[_0xf449('0x2f')],_0x45eebc['filters']));if(_0x1631f2[_0xf449('0x2f')]['filter']){_0x1b5bbf['where']=_[_0xf449('0x3a')](_0x1b5bbf[_0xf449('0x39')],{'$or':_[_0xf449('0x2a')](_0x1b5bbf[_0xf449('0x33')],function(_0x10b87d){var _0xe5b704={};_0xe5b704[_0x10b87d]={'$like':'%'+_0x1631f2[_0xf449('0x2f')][_0xf449('0x38')]+'%'};return _0xe5b704;})});}_0x1b5bbf=_[_0xf449('0x3a')]({},_0x1b5bbf,_0x1631f2['options']);return _0x13f4d7[_0xf449('0x4e')](_0x1b5bbf);}})[_0xf449('0x23')](function(_0x25b6b7){if(_0x25b6b7){_0xbd08e4=_0x25b6b7[_0xf449('0x34')];if(!_0x1631f2[_0xf449('0x2f')]['hasOwnProperty']('nolimit')){_0x1b5bbf[_0xf449('0x1c')]=qs['limit'](_0x1631f2[_0xf449('0x2f')][_0xf449('0x1c')]);_0x1b5bbf['offset']=qs[_0xf449('0x1a')](_0x1631f2[_0xf449('0x2f')]['offset']);}return _0x13f4d7['getDescriptions'](_0x1b5bbf);}})['then'](function(_0x3d3cf6){if(_0x3d3cf6){return _0x3d3cf6?{'count':_0xbd08e4,'rows':_0x3d3cf6}:null;}})['then'](respondWithResult(_0x509a25,null))[_0xf449('0x40')](handleError(_0x509a25,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index d1b8471..f1e92f7 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 _0xef50=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','SalesforceConfiguration','lodash','util'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0xef50,0x1a5));var _0x0ef5=function(_0x510675,_0xea9f5f){_0x510675=_0x510675-0x0;var _0x38cfd1=_0xef50[_0x510675];return _0x38cfd1;};'use strict';var _=require(_0x0ef5('0x0'));var util=require(_0x0ef5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0ef5('0x2'));var BPromise=require(_0x0ef5('0x3'));var rp=require(_0x0ef5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ef5('0x5'));var config=require(_0x0ef5('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x0ef5('0x7')]=function(_0x2a7574,_0x515559){return _0x2a7574['define'](_0x0ef5('0x8'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77ff=['api','moment','bluebird','request-promise','path','rimraf','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util'];(function(_0x37452f,_0x17a04c){var _0xd5b34f=function(_0x4a0f68){while(--_0x4a0f68){_0x37452f['push'](_0x37452f['shift']());}};_0xd5b34f(++_0x17a04c);}(_0x77ff,0xd6));var _0xf77f=function(_0x54b7e9,_0x18c9fe){_0x54b7e9=_0x54b7e9-0x0;var _0x1913ff=_0x77ff[_0x54b7e9];return _0x1913ff;};'use strict';var _=require(_0xf77f('0x0'));var util=require(_0xf77f('0x1'));var logger=require('../../config/logger')(_0xf77f('0x2'));var moment=require(_0xf77f('0x3'));var BPromise=require(_0xf77f('0x4'));var rp=require(_0xf77f('0x5'));var fs=require('fs');var path=require(_0xf77f('0x6'));var rimraf=require(_0xf77f('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0xf77f('0x8')]=function(_0xa28923,_0x493090){return _0xa28923[_0xf77f('0x9')](_0xf77f('0xa'),attributes,{'tableName':_0xf77f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 554222b..699cdcf 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 _0xc3c9=['then','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x43e0c5,_0x5aaf95){var _0x124601=function(_0x4b9e65){while(--_0x4b9e65){_0x43e0c5['push'](_0x43e0c5['shift']());}};_0x124601(++_0x5aaf95);}(_0xc3c9,0x8e));var _0x9c3c=function(_0x147e9f,_0x57b3cb){_0x147e9f=_0x147e9f-0x0;var _0x321585=_0xc3c9[_0x147e9f];return _0x321585;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9c3c('0x0'));var BPromise=require(_0x9c3c('0x1'));var rs=require(_0x9c3c('0x2'));var fs=require('fs');var Redis=require(_0x9c3c('0x3'));var db=require(_0x9c3c('0x4'))['db'];var utils=require(_0x9c3c('0x5'));var logger=require(_0x9c3c('0x6'))(_0x9c3c('0x7'));var config=require('../../config/environment');var jayson=require(_0x9c3c('0x8'));var client=jayson[_0x9c3c('0x9')][_0x9c3c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fdbcc,_0x469c6f,_0x21692e){return new BPromise(function(_0x18da8f,_0x374f0b){return client[_0x9c3c('0xb')](_0x1fdbcc,_0x21692e)[_0x9c3c('0xc')](function(_0x38fc6b){logger[_0x9c3c('0xd')](_0x9c3c('0xe'),_0x469c6f,'request\x20sent');logger['debug'](_0x9c3c('0xf'),_0x469c6f,'request\x20sent',JSON[_0x9c3c('0x10')](_0x38fc6b));if(_0x38fc6b[_0x9c3c('0x11')]){if(_0x38fc6b[_0x9c3c('0x11')][_0x9c3c('0x12')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x469c6f,_0x38fc6b['error'][_0x9c3c('0x13')]);return _0x374f0b(_0x38fc6b[_0x9c3c('0x11')][_0x9c3c('0x13')]);}logger['error'](_0x9c3c('0xe'),_0x469c6f,_0x38fc6b[_0x9c3c('0x11')][_0x9c3c('0x13')]);return _0x18da8f(_0x38fc6b['error'][_0x9c3c('0x13')]);}else{logger[_0x9c3c('0xd')](_0x9c3c('0xe'),_0x469c6f,_0x9c3c('0x14'));_0x18da8f(_0x38fc6b[_0x9c3c('0x15')]['message']);}})['catch'](function(_0x57033c){logger[_0x9c3c('0x11')](_0x9c3c('0xe'),_0x469c6f,_0x57033c);_0x374f0b(_0x57033c);});});} \ No newline at end of file +var _0x33d5=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x5865a6,_0x35e13b){var _0x4fcbc0=function(_0x5bc8e6){while(--_0x5bc8e6){_0x5865a6['push'](_0x5865a6['shift']());}};_0x4fcbc0(++_0x35e13b);}(_0x33d5,0xe1));var _0x533d=function(_0x149ad5,_0x12b417){_0x149ad5=_0x149ad5-0x0;var _0x2566b7=_0x33d5[_0x149ad5];return _0x2566b7;};'use strict';var _=require(_0x533d('0x0'));var util=require(_0x533d('0x1'));var moment=require(_0x533d('0x2'));var BPromise=require('bluebird');var rs=require(_0x533d('0x3'));var fs=require('fs');var Redis=require(_0x533d('0x4'));var db=require(_0x533d('0x5'))['db'];var utils=require(_0x533d('0x6'));var logger=require(_0x533d('0x7'))(_0x533d('0x8'));var config=require(_0x533d('0x9'));var jayson=require(_0x533d('0xa'));var client=jayson[_0x533d('0xb')][_0x533d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46f622,_0x530a6d,_0x45fd5e){return new BPromise(function(_0x2b94f8,_0x336fa7){return client[_0x533d('0xd')](_0x46f622,_0x45fd5e)[_0x533d('0xe')](function(_0x2545ad){logger['info'](_0x533d('0xf'),_0x530a6d,_0x533d('0x10'));logger[_0x533d('0x11')](_0x533d('0x12'),_0x530a6d,_0x533d('0x10'),JSON[_0x533d('0x13')](_0x2545ad));if(_0x2545ad['error']){if(_0x2545ad[_0x533d('0x14')][_0x533d('0x15')]===0x1f4){logger['error'](_0x533d('0xf'),_0x530a6d,_0x2545ad['error']['message']);return _0x336fa7(_0x2545ad[_0x533d('0x14')][_0x533d('0x16')]);}logger[_0x533d('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x530a6d,_0x2545ad[_0x533d('0x14')][_0x533d('0x16')]);return _0x2b94f8(_0x2545ad['error'][_0x533d('0x16')]);}else{logger[_0x533d('0x17')](_0x533d('0xf'),_0x530a6d,_0x533d('0x10'));_0x2b94f8(_0x2545ad[_0x533d('0x18')]['message']);}})['catch'](function(_0x5d6a4b){logger[_0x533d('0x14')](_0x533d('0xf'),_0x530a6d,_0x5d6a4b);_0x336fa7(_0x5d6a4b);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 5b43a36..f25ab19 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 _0xf766=['../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x59f081,_0x43fe79){var _0x483533=function(_0x5f281c){while(--_0x5f281c){_0x59f081['push'](_0x59f081['shift']());}};_0x483533(++_0x43fe79);}(_0xf766,0x77));var _0x6f76=function(_0x25fc41,_0x250864){_0x25fc41=_0x25fc41-0x0;var _0x1371d1=_0xf766[_0x25fc41];return _0x1371d1;};'use strict';var multer=require(_0x6f76('0x0'));var util=require(_0x6f76('0x1'));var path=require(_0x6f76('0x2'));var timeout=require(_0x6f76('0x3'));var express=require(_0x6f76('0x4'));var router=express[_0x6f76('0x5')]();var fs_extra=require(_0x6f76('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6f76('0x7'));var config=require(_0x6f76('0x8'));var controller=require(_0x6f76('0x9'));router[_0x6f76('0xa')]('/',auth[_0x6f76('0xb')](),controller[_0x6f76('0xc')]);router['get'](_0x6f76('0xd'),auth[_0x6f76('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6f76('0xe')](_0x6f76('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x6f76('0xf')](_0x6f76('0xd'),auth[_0x6f76('0xb')](),controller[_0x6f76('0x10')]);module[_0x6f76('0x11')]=router; \ No newline at end of file +var _0x8f3b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','show','post','put','/:id','delete','destroy','util'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x8f3b,0x131));var _0xb8f3=function(_0x1267cb,_0x2821ff){_0x1267cb=_0x1267cb-0x0;var _0xcaef47=_0x8f3b[_0x1267cb];return _0xcaef47;};'use strict';var multer=require('multer');var util=require(_0xb8f3('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb8f3('0x1'));var router=express[_0xb8f3('0x2')]();var fs_extra=require(_0xb8f3('0x3'));var auth=require(_0xb8f3('0x4'));var interaction=require(_0xb8f3('0x5'));var config=require(_0xb8f3('0x6'));var controller=require(_0xb8f3('0x7'));router['get']('/',auth[_0xb8f3('0x8')](),controller[_0xb8f3('0x9')]);router[_0xb8f3('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb8f3('0xb')]);router[_0xb8f3('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb8f3('0xd')](_0xb8f3('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xb8f3('0xf')](_0xb8f3('0xe'),auth[_0xb8f3('0x8')](),controller[_0xb8f3('0x10')]);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 df2cb09..43ce09a 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 _0x8133=['variable','customVariable','STRING','string','sequelize','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8133,0xcf));var _0x3813=function(_0x395778,_0x3bec90){_0x395778=_0x395778-0x0;var _0xfc32b3=_0x8133[_0x395778];return _0xfc32b3;};'use strict';var Sequelize=require(_0x3813('0x0'));module[_0x3813('0x1')]={'type':{'type':Sequelize[_0x3813('0x2')]('string',_0x3813('0x3'),_0x3813('0x4'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x3813('0x5')]},'key':{'type':Sequelize[_0x3813('0x5')]},'keyType':{'type':Sequelize[_0x3813('0x2')](_0x3813('0x6'),_0x3813('0x3'),_0x3813('0x4'))},'keyContent':{'type':Sequelize[_0x3813('0x5')]},'idField':{'type':Sequelize[_0x3813('0x5')]},'variableName':{'type':Sequelize[_0x3813('0x5')]}}; \ No newline at end of file +var _0xf7ab=['exports','variable','picklist','STRING','ENUM','string','customVariable','sequelize'];(function(_0x24a2fc,_0x1d39ec){var _0x5b1e4c=function(_0x176e46){while(--_0x176e46){_0x24a2fc['push'](_0x24a2fc['shift']());}};_0x5b1e4c(++_0x1d39ec);}(_0xf7ab,0x1d7));var _0xbf7a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf7ab[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xbf7a('0x0'));module[_0xbf7a('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xbf7a('0x2'),'customVariable','keyValue',_0xbf7a('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbf7a('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbf7a('0x5')](_0xbf7a('0x6'),_0xbf7a('0x2'),_0xbf7a('0x7'))},'keyContent':{'type':Sequelize[_0xbf7a('0x4')]},'idField':{'type':Sequelize[_0xbf7a('0x4')]},'variableName':{'type':Sequelize[_0xbf7a('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index dbbb867..b148488 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 _0x397a=['apply','save','update','destroy','sendStatus','error','stack','name','index','map','SalesforceField','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','then','findAll','rows','catch','show','params','keys','includeAll','include','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range'];(function(_0x4cdd58,_0x53cd73){var _0x1308c6=function(_0xfaba30){while(--_0xfaba30){_0x4cdd58['push'](_0x4cdd58['shift']());}};_0x1308c6(++_0x53cd73);}(_0x397a,0xb7));var _0xa397=function(_0x4e2461,_0x2061d1){_0x4e2461=_0x4e2461-0x0;var _0x4b93a8=_0x397a[_0x4e2461];return _0x4b93a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa397('0x0'));var zipdir=require(_0xa397('0x1'));var jsonpatch=require(_0xa397('0x2'));var rp=require(_0xa397('0x3'));var moment=require('moment');var BPromise=require(_0xa397('0x4'));var Mustache=require(_0xa397('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa397('0x6'));var csv=require('to-csv');var ejs=require(_0xa397('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa397('0x8'));var crypto=require('crypto');var jsforce=require(_0xa397('0x9'));var deskjs=require(_0xa397('0xa'));var toCsv=require(_0xa397('0xb'));var querystring=require(_0xa397('0xc'));var Papa=require(_0xa397('0xd'));var Redis=require(_0xa397('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa397('0xf'));var as=require(_0xa397('0x10'));var hardwareService=require(_0xa397('0x11'));var logger=require(_0xa397('0x12'))('api');var utils=require(_0xa397('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa397('0x14'));var db=require(_0xa397('0x15'))['db'];function respondWithStatusCode(_0x36ec28,_0x130b1f){_0x130b1f=_0x130b1f||0xcc;return function(_0x56e19e){if(_0x56e19e){return _0x36ec28['sendStatus'](_0x130b1f);}return _0x36ec28[_0xa397('0x16')](_0x130b1f)[_0xa397('0x17')]();};}function respondWithResult(_0x3e9db9,_0x42d51f){_0x42d51f=_0x42d51f||0xc8;return function(_0x2cc955){if(_0x2cc955){return _0x3e9db9['status'](_0x42d51f)[_0xa397('0x18')](_0x2cc955);}};}function respondWithFilteredResult(_0x42986c,_0x498420){return function(_0x319378){if(_0x319378){var _0x579a18=typeof _0x498420['offset']===_0xa397('0x19')&&typeof _0x498420[_0xa397('0x1a')]===_0xa397('0x19');var _0x15b915=_0x319378[_0xa397('0x1b')];var _0x23ffc2=_0x579a18?0x0:_0x498420['offset'];var _0x3a52e8=_0x579a18?_0x319378['count']:_0x498420[_0xa397('0x1c')]+_0x498420[_0xa397('0x1a')];var _0x122b24;if(_0x3a52e8>=_0x15b915){_0x3a52e8=_0x15b915;_0x122b24=0xc8;}else{_0x122b24=0xce;}_0x42986c[_0xa397('0x16')](_0x122b24);return _0x42986c['set'](_0xa397('0x1d'),_0x23ffc2+'-'+_0x3a52e8+'/'+_0x15b915)[_0xa397('0x18')](_0x319378);}return null;};}function patchUpdates(_0xb51b5c){return function(_0x552b32){try{jsonpatch[_0xa397('0x1e')](_0x552b32,_0xb51b5c,!![]);}catch(_0x385799){return BPromise['reject'](_0x385799);}return _0x552b32[_0xa397('0x1f')]();};}function saveUpdates(_0x319dca,_0xffcee8){return function(_0x4813c5){if(_0x4813c5){return _0x4813c5[_0xa397('0x20')](_0x319dca)['then'](function(_0xb36a82){return _0xb36a82;});}return null;};}function removeEntity(_0x12d8f2,_0x40e1b0){return function(_0x31eb6a){if(_0x31eb6a){return _0x31eb6a[_0xa397('0x21')]()['then'](function(){_0x12d8f2[_0xa397('0x16')](0xcc)[_0xa397('0x17')]();});}};}function handleEntityNotFound(_0x266a9a,_0x3db7ee){return function(_0x5d0638){if(!_0x5d0638){_0x266a9a[_0xa397('0x22')](0x194);}return _0x5d0638;};}function handleError(_0x385c5f,_0x5833b2){_0x5833b2=_0x5833b2||0x1f4;return function(_0x268a67){logger[_0xa397('0x23')](_0x268a67[_0xa397('0x24')]);if(_0x268a67[_0xa397('0x25')]){delete _0x268a67['name'];}_0x385c5f[_0xa397('0x16')](_0x5833b2)['send'](_0x268a67);};}exports[_0xa397('0x26')]=function(_0x3221a6,_0x24be71){var _0x27c725={},_0x43ffc5={},_0x46184f={'count':0x0,'rows':[]};var _0x4c1dfa=_[_0xa397('0x27')](db[_0xa397('0x28')]['rawAttributes'],function(_0x37f19f){return{'name':_0x37f19f[_0xa397('0x29')],'type':_0x37f19f[_0xa397('0x2a')]['key']};});_0x43ffc5[_0xa397('0x2b')]=_[_0xa397('0x27')](_0x4c1dfa,_0xa397('0x25'));_0x43ffc5[_0xa397('0x2c')]=_['keys'](_0x3221a6[_0xa397('0x2c')]);_0x43ffc5['filters']=_[_0xa397('0x2d')](_0x43ffc5[_0xa397('0x2b')],_0x43ffc5[_0xa397('0x2c')]);_0x27c725[_0xa397('0x2e')]=_[_0xa397('0x2d')](_0x43ffc5[_0xa397('0x2b')],qs[_0xa397('0x2f')](_0x3221a6['query'][_0xa397('0x2f')]));_0x27c725[_0xa397('0x2e')]=_0x27c725['attributes'][_0xa397('0x30')]?_0x27c725['attributes']:_0x43ffc5['model'];if(!_0x3221a6[_0xa397('0x2c')][_0xa397('0x31')]('nolimit')){_0x27c725[_0xa397('0x1a')]=qs['limit'](_0x3221a6[_0xa397('0x2c')][_0xa397('0x1a')]);_0x27c725['offset']=qs[_0xa397('0x1c')](_0x3221a6['query'][_0xa397('0x1c')]);}_0x27c725[_0xa397('0x32')]=qs['sort'](_0x3221a6[_0xa397('0x2c')][_0xa397('0x33')]);_0x27c725[_0xa397('0x34')]=qs['filters'](_[_0xa397('0x35')](_0x3221a6[_0xa397('0x2c')],_0x43ffc5[_0xa397('0x36')]),_0x4c1dfa);if(_0x3221a6[_0xa397('0x2c')][_0xa397('0x37')]){_0x27c725['where']=_[_0xa397('0x38')](_0x27c725['where'],{'$or':_[_0xa397('0x27')](_0x4c1dfa,function(_0x250862){if(_0x250862[_0xa397('0x2a')]!==_0xa397('0x39')){var _0x131584={};_0x131584[_0x250862['name']]={'$like':'%'+_0x3221a6['query'][_0xa397('0x37')]+'%'};return _0x131584;}})});}_0x27c725=_['merge']({},_0x27c725,_0x3221a6[_0xa397('0x3a')]);var _0x4b0d9b={'where':_0x27c725[_0xa397('0x34')]};return db['SalesforceField'][_0xa397('0x1b')](_0x4b0d9b)[_0xa397('0x3b')](function(_0x3669fd){_0x46184f['count']=_0x3669fd;if(_0x3221a6['query']['includeAll']){_0x27c725['include']=[{'all':!![]}];}return db[_0xa397('0x28')][_0xa397('0x3c')](_0x27c725);})[_0xa397('0x3b')](function(_0x589821){_0x46184f[_0xa397('0x3d')]=_0x589821;return _0x46184f;})[_0xa397('0x3b')](respondWithFilteredResult(_0x24be71,_0x27c725))[_0xa397('0x3e')](handleError(_0x24be71,null));};exports[_0xa397('0x3f')]=function(_0x4853b6,_0x5b5b8e){var _0x458dcc={'raw':!![],'where':{'id':_0x4853b6[_0xa397('0x40')]['id']}},_0x443b25={};_0x443b25['model']=_[_0xa397('0x41')](db['SalesforceField']['rawAttributes']);_0x443b25['query']=_['keys'](_0x4853b6[_0xa397('0x2c')]);_0x443b25[_0xa397('0x36')]=_[_0xa397('0x2d')](_0x443b25[_0xa397('0x2b')],_0x443b25[_0xa397('0x2c')]);_0x458dcc[_0xa397('0x2e')]=_[_0xa397('0x2d')](_0x443b25[_0xa397('0x2b')],qs['fields'](_0x4853b6[_0xa397('0x2c')][_0xa397('0x2f')]));_0x458dcc[_0xa397('0x2e')]=_0x458dcc[_0xa397('0x2e')][_0xa397('0x30')]?_0x458dcc[_0xa397('0x2e')]:_0x443b25[_0xa397('0x2b')];if(_0x4853b6[_0xa397('0x2c')][_0xa397('0x42')]){_0x458dcc[_0xa397('0x43')]=[{'all':!![]}];}_0x458dcc=_[_0xa397('0x38')]({},_0x458dcc,_0x4853b6[_0xa397('0x3a')]);return db[_0xa397('0x28')]['find'](_0x458dcc)['then'](handleEntityNotFound(_0x5b5b8e,null))[_0xa397('0x3b')](respondWithResult(_0x5b5b8e,null))['catch'](handleError(_0x5b5b8e,null));};exports[_0xa397('0x44')]=function(_0x42a6d5,_0x3efa38){return db['SalesforceField']['create'](_0x42a6d5['body'],{})[_0xa397('0x3b')](respondWithResult(_0x3efa38,0xc9))['catch'](handleError(_0x3efa38,null));};exports[_0xa397('0x20')]=function(_0x37c486,_0x25b721){if(_0x37c486[_0xa397('0x45')]['id']){delete _0x37c486[_0xa397('0x45')]['id'];}return db[_0xa397('0x28')][_0xa397('0x46')]({'where':{'id':_0x37c486[_0xa397('0x40')]['id']}})[_0xa397('0x3b')](handleEntityNotFound(_0x25b721,null))[_0xa397('0x3b')](saveUpdates(_0x37c486[_0xa397('0x45')],null))[_0xa397('0x3b')](respondWithResult(_0x25b721,null))['catch'](handleError(_0x25b721,null));};exports[_0xa397('0x21')]=function(_0x51b01f,_0x6cd05f){return db[_0xa397('0x28')][_0xa397('0x46')]({'where':{'id':_0x51b01f[_0xa397('0x40')]['id']}})[_0xa397('0x3b')](handleEntityNotFound(_0x6cd05f,null))['then'](removeEntity(_0x6cd05f,null))[_0xa397('0x3e')](handleError(_0x6cd05f,null));}; \ No newline at end of file +var _0x12a7=['catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','SalesforceField','rawAttributes','type','model','map','query','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find'];(function(_0x54381d,_0x247b2c){var _0x5308a7=function(_0x3ef056){while(--_0x3ef056){_0x54381d['push'](_0x54381d['shift']());}};_0x5308a7(++_0x247b2c);}(_0x12a7,0x123));var _0x712a=function(_0xf15a7c,_0x174aeb){_0xf15a7c=_0xf15a7c-0x0;var _0x11f7b1=_0x12a7[_0xf15a7c];return _0x11f7b1;};'use strict';var emlformat=require(_0x712a('0x0'));var rimraf=require(_0x712a('0x1'));var zipdir=require(_0x712a('0x2'));var jsonpatch=require(_0x712a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x712a('0x4'));var Mustache=require(_0x712a('0x5'));var util=require(_0x712a('0x6'));var path=require(_0x712a('0x7'));var sox=require(_0x712a('0x8'));var csv=require(_0x712a('0x9'));var ejs=require(_0x712a('0xa'));var fs=require('fs');var fs_extra=require(_0x712a('0xb'));var _=require(_0x712a('0xc'));var squel=require(_0x712a('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x712a('0xe'));var toCsv=require(_0x712a('0x9'));var querystring=require(_0x712a('0xf'));var Papa=require(_0x712a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x712a('0x11'));var hardwareService=require(_0x712a('0x12'));var logger=require(_0x712a('0x13'))(_0x712a('0x14'));var utils=require(_0x712a('0x15'));var config=require(_0x712a('0x16'));var licenseUtil=require(_0x712a('0x17'));var db=require(_0x712a('0x18'))['db'];function respondWithStatusCode(_0x421ef9,_0x1b2689){_0x1b2689=_0x1b2689||0xcc;return function(_0x19326f){if(_0x19326f){return _0x421ef9[_0x712a('0x19')](_0x1b2689);}return _0x421ef9['status'](_0x1b2689)[_0x712a('0x1a')]();};}function respondWithResult(_0x2e90bb,_0x472965){_0x472965=_0x472965||0xc8;return function(_0x597d2f){if(_0x597d2f){return _0x2e90bb[_0x712a('0x1b')](_0x472965)[_0x712a('0x1c')](_0x597d2f);}};}function respondWithFilteredResult(_0xd205e9,_0x30dca4){return function(_0x2745f6){if(_0x2745f6){var _0x1717e8=typeof _0x30dca4['offset']===_0x712a('0x1d')&&typeof _0x30dca4[_0x712a('0x1e')]===_0x712a('0x1d');var _0x32ca38=_0x2745f6[_0x712a('0x1f')];var _0x501838=_0x1717e8?0x0:_0x30dca4[_0x712a('0x20')];var _0x20dbca=_0x1717e8?_0x2745f6['count']:_0x30dca4['offset']+_0x30dca4[_0x712a('0x1e')];var _0x6214f1;if(_0x20dbca>=_0x32ca38){_0x20dbca=_0x32ca38;_0x6214f1=0xc8;}else{_0x6214f1=0xce;}_0xd205e9[_0x712a('0x1b')](_0x6214f1);return _0xd205e9[_0x712a('0x21')](_0x712a('0x22'),_0x501838+'-'+_0x20dbca+'/'+_0x32ca38)[_0x712a('0x1c')](_0x2745f6);}return null;};}function patchUpdates(_0x14a128){return function(_0x5a2b18){try{jsonpatch[_0x712a('0x23')](_0x5a2b18,_0x14a128,!![]);}catch(_0x4f86e9){return BPromise[_0x712a('0x24')](_0x4f86e9);}return _0x5a2b18['save']();};}function saveUpdates(_0x10cb08,_0x27f60a){return function(_0x27e14f){if(_0x27e14f){return _0x27e14f[_0x712a('0x25')](_0x10cb08)[_0x712a('0x26')](function(_0x2984b3){return _0x2984b3;});}return null;};}function removeEntity(_0x5c1c18,_0xbc6037){return function(_0x39e8aa){if(_0x39e8aa){return _0x39e8aa[_0x712a('0x27')]()[_0x712a('0x26')](function(){_0x5c1c18['status'](0xcc)[_0x712a('0x1a')]();});}};}function handleEntityNotFound(_0x2639d3,_0xc454ae){return function(_0x259a5a){if(!_0x259a5a){_0x2639d3['sendStatus'](0x194);}return _0x259a5a;};}function handleError(_0x55378f,_0x54f0ec){_0x54f0ec=_0x54f0ec||0x1f4;return function(_0x40b39b){logger['error'](_0x40b39b[_0x712a('0x28')]);if(_0x40b39b[_0x712a('0x29')]){delete _0x40b39b['name'];}_0x55378f[_0x712a('0x1b')](_0x54f0ec)[_0x712a('0x2a')](_0x40b39b);};}exports['index']=function(_0x47c04a,_0x413b38){var _0x3089fe={},_0x1cd3b5={},_0x24edeb={'count':0x0,'rows':[]};var _0x488b13=_['map'](db[_0x712a('0x2b')][_0x712a('0x2c')],function(_0x4547e6){return{'name':_0x4547e6['fieldName'],'type':_0x4547e6[_0x712a('0x2d')]['key']};});_0x1cd3b5[_0x712a('0x2e')]=_[_0x712a('0x2f')](_0x488b13,_0x712a('0x29'));_0x1cd3b5['query']=_['keys'](_0x47c04a[_0x712a('0x30')]);_0x1cd3b5[_0x712a('0x31')]=_['intersection'](_0x1cd3b5[_0x712a('0x2e')],_0x1cd3b5['query']);_0x3089fe[_0x712a('0x32')]=_[_0x712a('0x33')](_0x1cd3b5['model'],qs['fields'](_0x47c04a[_0x712a('0x30')][_0x712a('0x34')]));_0x3089fe[_0x712a('0x32')]=_0x3089fe[_0x712a('0x32')][_0x712a('0x35')]?_0x3089fe['attributes']:_0x1cd3b5[_0x712a('0x2e')];if(!_0x47c04a['query']['hasOwnProperty']('nolimit')){_0x3089fe[_0x712a('0x1e')]=qs[_0x712a('0x1e')](_0x47c04a[_0x712a('0x30')][_0x712a('0x1e')]);_0x3089fe[_0x712a('0x20')]=qs['offset'](_0x47c04a[_0x712a('0x30')][_0x712a('0x20')]);}_0x3089fe[_0x712a('0x36')]=qs[_0x712a('0x37')](_0x47c04a['query'][_0x712a('0x37')]);_0x3089fe[_0x712a('0x38')]=qs[_0x712a('0x31')](_['pick'](_0x47c04a[_0x712a('0x30')],_0x1cd3b5[_0x712a('0x31')]),_0x488b13);if(_0x47c04a['query'][_0x712a('0x39')]){_0x3089fe[_0x712a('0x38')]=_[_0x712a('0x3a')](_0x3089fe[_0x712a('0x38')],{'$or':_[_0x712a('0x2f')](_0x488b13,function(_0x2f9bb6){if(_0x2f9bb6[_0x712a('0x2d')]!==_0x712a('0x3b')){var _0x3ab399={};_0x3ab399[_0x2f9bb6[_0x712a('0x29')]]={'$like':'%'+_0x47c04a[_0x712a('0x30')]['filter']+'%'};return _0x3ab399;}})});}_0x3089fe=_[_0x712a('0x3a')]({},_0x3089fe,_0x47c04a[_0x712a('0x3c')]);var _0xdb433={'where':_0x3089fe[_0x712a('0x38')]};return db[_0x712a('0x2b')]['count'](_0xdb433)['then'](function(_0x4f059f){_0x24edeb[_0x712a('0x1f')]=_0x4f059f;if(_0x47c04a['query'][_0x712a('0x3d')]){_0x3089fe[_0x712a('0x3e')]=[{'all':!![]}];}return db[_0x712a('0x2b')][_0x712a('0x3f')](_0x3089fe);})[_0x712a('0x26')](function(_0x29dedd){_0x24edeb[_0x712a('0x40')]=_0x29dedd;return _0x24edeb;})[_0x712a('0x26')](respondWithFilteredResult(_0x413b38,_0x3089fe))['catch'](handleError(_0x413b38,null));};exports[_0x712a('0x41')]=function(_0x16e006,_0x2d5e59){var _0x5e2d5d={'raw':!![],'where':{'id':_0x16e006[_0x712a('0x42')]['id']}},_0x5b5f6d={};_0x5b5f6d[_0x712a('0x2e')]=_[_0x712a('0x43')](db[_0x712a('0x2b')][_0x712a('0x2c')]);_0x5b5f6d[_0x712a('0x30')]=_[_0x712a('0x43')](_0x16e006[_0x712a('0x30')]);_0x5b5f6d[_0x712a('0x31')]=_['intersection'](_0x5b5f6d['model'],_0x5b5f6d['query']);_0x5e2d5d['attributes']=_[_0x712a('0x33')](_0x5b5f6d[_0x712a('0x2e')],qs[_0x712a('0x34')](_0x16e006[_0x712a('0x30')][_0x712a('0x34')]));_0x5e2d5d['attributes']=_0x5e2d5d[_0x712a('0x32')]['length']?_0x5e2d5d['attributes']:_0x5b5f6d[_0x712a('0x2e')];if(_0x16e006['query'][_0x712a('0x3d')]){_0x5e2d5d[_0x712a('0x3e')]=[{'all':!![]}];}_0x5e2d5d=_['merge']({},_0x5e2d5d,_0x16e006[_0x712a('0x3c')]);return db['SalesforceField'][_0x712a('0x44')](_0x5e2d5d)['then'](handleEntityNotFound(_0x2d5e59,null))[_0x712a('0x26')](respondWithResult(_0x2d5e59,null))[_0x712a('0x45')](handleError(_0x2d5e59,null));};exports[_0x712a('0x46')]=function(_0x27104b,_0x5a7407){return db[_0x712a('0x2b')][_0x712a('0x46')](_0x27104b[_0x712a('0x47')],{})['then'](respondWithResult(_0x5a7407,0xc9))[_0x712a('0x45')](handleError(_0x5a7407,null));};exports[_0x712a('0x25')]=function(_0x426b7f,_0x26e0ef){if(_0x426b7f[_0x712a('0x47')]['id']){delete _0x426b7f['body']['id'];}return db[_0x712a('0x2b')]['find']({'where':{'id':_0x426b7f[_0x712a('0x42')]['id']}})['then'](handleEntityNotFound(_0x26e0ef,null))[_0x712a('0x26')](saveUpdates(_0x426b7f[_0x712a('0x47')],null))['then'](respondWithResult(_0x26e0ef,null))[_0x712a('0x45')](handleError(_0x26e0ef,null));};exports['destroy']=function(_0x49e568,_0x122ff1){return db[_0x712a('0x2b')][_0x712a('0x44')]({'where':{'id':_0x49e568[_0x712a('0x42')]['id']}})['then'](handleEntityNotFound(_0x122ff1,null))[_0x712a('0x26')](removeEntity(_0x122ff1,null))[_0x712a('0x45')](handleError(_0x122ff1,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 56a71b4..14f4684 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 _0x06b4=['exports','define','SalesforceField','FieldId','lodash','util','../../config/logger','bluebird','path','rimraf','./intSalesforceField.attributes'];(function(_0x17b4f1,_0x3e56bf){var _0x81bcac=function(_0x28262b){while(--_0x28262b){_0x17b4f1['push'](_0x17b4f1['shift']());}};_0x81bcac(++_0x3e56bf);}(_0x06b4,0x1d2));var _0x406b=function(_0x7dc2ba,_0x4cac84){_0x7dc2ba=_0x7dc2ba-0x0;var _0x2330ac=_0x06b4[_0x7dc2ba];return _0x2330ac;};'use strict';var _=require(_0x406b('0x0'));var util=require(_0x406b('0x1'));var logger=require(_0x406b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x406b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x406b('0x4'));var rimraf=require(_0x406b('0x5'));var config=require('../../config/environment');var attributes=require(_0x406b('0x6'));module[_0x406b('0x7')]=function(_0x51086c,_0x58e963){return _0x51086c[_0x406b('0x8')](_0x406b('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0x406b('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x306e=['request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird'];(function(_0x1338b8,_0x572167){var _0x451d09=function(_0x26c271){while(--_0x26c271){_0x1338b8['push'](_0x1338b8['shift']());}};_0x451d09(++_0x572167);}(_0x306e,0x87));var _0xe306=function(_0x35685e,_0x5ebbea){_0x35685e=_0x35685e-0x0;var _0x1cea2b=_0x306e[_0x35685e];return _0x1cea2b;};'use strict';var _=require(_0xe306('0x0'));var util=require(_0xe306('0x1'));var logger=require(_0xe306('0x2'))(_0xe306('0x3'));var moment=require('moment');var BPromise=require(_0xe306('0x4'));var rp=require(_0xe306('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe306('0x6'));var config=require(_0xe306('0x7'));var attributes=require(_0xe306('0x8'));module[_0xe306('0x9')]=function(_0x4dcc7e,_0x191241){return _0x4dcc7e['define'](_0xe306('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xe306('0xb'),'fields':[_0xe306('0xc'),_0xe306('0xd')],'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 e25d4a0..ba3d533 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 _0x1b07=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','debug','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','info','result','lodash','bluebird','randomstring','ioredis'];(function(_0x5c7b86,_0x361fde){var _0x189239=function(_0x36887c){while(--_0x36887c){_0x5c7b86['push'](_0x5c7b86['shift']());}};_0x189239(++_0x361fde);}(_0x1b07,0x13f));var _0x71b0=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x1b07[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0x71b0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x71b0('0x1'));var rs=require(_0x71b0('0x2'));var fs=require('fs');var Redis=require(_0x71b0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x71b0('0x4'));var logger=require(_0x71b0('0x5'))(_0x71b0('0x6'));var config=require('../../config/environment');var jayson=require(_0x71b0('0x7'));var client=jayson[_0x71b0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52e060,_0x6811f5,_0x39b25e){return new BPromise(function(_0x1d7a73,_0x2f25f2){return client[_0x71b0('0x9')](_0x52e060,_0x39b25e)['then'](function(_0x5d38e3){logger['info']('SalesforceField,\x20%s,\x20%s',_0x6811f5,_0x71b0('0xa'));logger[_0x71b0('0xb')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x6811f5,_0x71b0('0xa'),JSON[_0x71b0('0xc')](_0x5d38e3));if(_0x5d38e3[_0x71b0('0xd')]){if(_0x5d38e3[_0x71b0('0xd')][_0x71b0('0xe')]===0x1f4){logger['error'](_0x71b0('0xf'),_0x6811f5,_0x5d38e3[_0x71b0('0xd')][_0x71b0('0x10')]);return _0x2f25f2(_0x5d38e3[_0x71b0('0xd')][_0x71b0('0x10')]);}logger[_0x71b0('0xd')]('SalesforceField,\x20%s,\x20%s',_0x6811f5,_0x5d38e3[_0x71b0('0xd')][_0x71b0('0x10')]);return _0x1d7a73(_0x5d38e3[_0x71b0('0xd')]['message']);}else{logger[_0x71b0('0x11')](_0x71b0('0xf'),_0x6811f5,'request\x20sent');_0x1d7a73(_0x5d38e3[_0x71b0('0x12')][_0x71b0('0x10')]);}})['catch'](function(_0x35afa6){logger[_0x71b0('0xd')](_0x71b0('0xf'),_0x6811f5,_0x35afa6);_0x2f25f2(_0x35afa6);});});} \ No newline at end of file +var _0x3fee=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','stringify','error','code','SalesforceField,\x20%s,\x20%s'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x3fee,0xf5));var _0xe3fe=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x3fee[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xe3fe('0x0'));var util=require(_0xe3fe('0x1'));var moment=require(_0xe3fe('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3fe('0x3'));var fs=require('fs');var Redis=require(_0xe3fe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe3fe('0x5'));var logger=require(_0xe3fe('0x6'))(_0xe3fe('0x7'));var config=require(_0xe3fe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe3fe('0x9')][_0xe3fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fa7dd,_0x2fd341,_0x4a1297){return new BPromise(function(_0x26e6e0,_0xd31cef){return client[_0xe3fe('0xb')](_0x1fa7dd,_0x4a1297)['then'](function(_0x1d8e41){logger[_0xe3fe('0xc')]('SalesforceField,\x20%s,\x20%s',_0x2fd341,_0xe3fe('0xd'));logger[_0xe3fe('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x2fd341,'request\x20sent',JSON[_0xe3fe('0xf')](_0x1d8e41));if(_0x1d8e41[_0xe3fe('0x10')]){if(_0x1d8e41[_0xe3fe('0x10')][_0xe3fe('0x11')]===0x1f4){logger[_0xe3fe('0x10')](_0xe3fe('0x12'),_0x2fd341,_0x1d8e41[_0xe3fe('0x10')][_0xe3fe('0x13')]);return _0xd31cef(_0x1d8e41[_0xe3fe('0x10')][_0xe3fe('0x13')]);}logger[_0xe3fe('0x10')]('SalesforceField,\x20%s,\x20%s',_0x2fd341,_0x1d8e41[_0xe3fe('0x10')][_0xe3fe('0x13')]);return _0x26e6e0(_0x1d8e41[_0xe3fe('0x10')]['message']);}else{logger[_0xe3fe('0xc')](_0xe3fe('0x12'),_0x2fd341,'request\x20sent');_0x26e6e0(_0x1d8e41[_0xe3fe('0x14')][_0xe3fe('0x13')]);}})[_0xe3fe('0x15')](function(_0x57d837){logger[_0xe3fe('0x10')](_0xe3fe('0x12'),_0x2fd341,_0x57d837);_0xd31cef(_0x57d837);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index a336f99..4599d7b 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 _0x16d1=['post','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x3220c2,_0x33b43d){var _0x3fa9c7=function(_0x1b7529){while(--_0x1b7529){_0x3220c2['push'](_0x3220c2['shift']());}};_0x3fa9c7(++_0x33b43d);}(_0x16d1,0xf7));var _0x116d=function(_0x525494,_0x5183b3){_0x525494=_0x525494-0x0;var _0x5c936d=_0x16d1[_0x525494];return _0x5c936d;};'use strict';var multer=require(_0x116d('0x0'));var util=require(_0x116d('0x1'));var path=require(_0x116d('0x2'));var timeout=require(_0x116d('0x3'));var express=require(_0x116d('0x4'));var router=express['Router']();var fs_extra=require(_0x116d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x116d('0x6'));var config=require(_0x116d('0x7'));var controller=require(_0x116d('0x8'));router['get']('/',auth[_0x116d('0x9')](),controller[_0x116d('0xa')]);router[_0x116d('0xb')]('/:id',auth[_0x116d('0x9')](),controller[_0x116d('0xc')]);router[_0x116d('0xb')](_0x116d('0xd'),auth[_0x116d('0x9')](),controller[_0x116d('0xe')]);router[_0x116d('0xb')](_0x116d('0xf'),auth[_0x116d('0x9')](),controller[_0x116d('0x10')]);router[_0x116d('0x11')]('/',auth[_0x116d('0x9')](),controller[_0x116d('0x12')]);router[_0x116d('0x11')](_0x116d('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x116d('0x13')]('/:id',auth[_0x116d('0x9')](),controller['update']);router[_0x116d('0x14')](_0x116d('0x15'),auth[_0x116d('0x9')](),controller[_0x116d('0x16')]);module[_0x116d('0x17')]=router; \ No newline at end of file +var _0xbfa6=['delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update'];(function(_0x5618c4,_0x4e8f57){var _0xdf390f=function(_0x1406cb){while(--_0x1406cb){_0x5618c4['push'](_0x5618c4['shift']());}};_0xdf390f(++_0x4e8f57);}(_0xbfa6,0x1d0));var _0x6bfa=function(_0x56e32e,_0x9eb2f6){_0x56e32e=_0x56e32e-0x0;var _0x2a757b=_0xbfa6[_0x56e32e];return _0x2a757b;};'use strict';var multer=require(_0x6bfa('0x0'));var util=require(_0x6bfa('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6bfa('0x2')]();var fs_extra=require(_0x6bfa('0x3'));var auth=require(_0x6bfa('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6bfa('0x5'));var controller=require(_0x6bfa('0x6'));router[_0x6bfa('0x7')]('/',auth[_0x6bfa('0x8')](),controller[_0x6bfa('0x9')]);router[_0x6bfa('0x7')](_0x6bfa('0xa'),auth['isAuthenticated'](),controller[_0x6bfa('0xb')]);router['get'](_0x6bfa('0xc'),auth[_0x6bfa('0x8')](),controller[_0x6bfa('0xd')]);router[_0x6bfa('0x7')](_0x6bfa('0xe'),auth[_0x6bfa('0x8')](),controller[_0x6bfa('0xf')]);router[_0x6bfa('0x10')]('/',auth[_0x6bfa('0x8')](),controller[_0x6bfa('0x11')]);router['post'](_0x6bfa('0xc'),auth[_0x6bfa('0x8')](),controller[_0x6bfa('0x12')]);router['put'](_0x6bfa('0xa'),auth[_0x6bfa('0x8')](),controller[_0x6bfa('0x13')]);router[_0x6bfa('0x14')](_0x6bfa('0xa'),auth['isAuthenticated'](),controller[_0x6bfa('0x15')]);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 93f2688..ce4a942 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 _0x1a84=['exports','STRING'];(function(_0x48bdad,_0x3d86c0){var _0x5e6fb2=function(_0x5ac68d){while(--_0x5ac68d){_0x48bdad['push'](_0x48bdad['shift']());}};_0x5e6fb2(++_0x3d86c0);}(_0x1a84,0x19e));var _0x41a8=function(_0x181edb,_0x13e879){_0x181edb=_0x181edb-0x0;var _0x1680da=_0x1a84[_0x181edb];return _0x1680da;};'use strict';var Sequelize=require('sequelize');module[_0x41a8('0x0')]={'name':{'type':Sequelize[_0x41a8('0x1')]},'description':{'type':Sequelize[_0x41a8('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x41a8('0x1')]},'email':{'type':Sequelize[_0x41a8('0x1')]},'remoteUri':{'type':Sequelize[_0x41a8('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x41a8('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xeeb2=['STRING','username','remoteUri','sequelize'];(function(_0x5aa903,_0x9b5e8a){var _0x5459bc=function(_0x5d496f){while(--_0x5d496f){_0x5aa903['push'](_0x5aa903['shift']());}};_0x5459bc(++_0x9b5e8a);}(_0xeeb2,0xd3));var _0x2eeb=function(_0x272156,_0x5e4b0d){_0x272156=_0x272156-0x0;var _0x1071d0=_0xeeb2[_0x272156];return _0x1071d0;};'use strict';var Sequelize=require(_0x2eeb('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2eeb('0x1')]},'username':{'type':Sequelize[_0x2eeb('0x1')],'unique':_0x2eeb('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x2eeb('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2eeb('0x3')},'serverUrl':{'type':Sequelize[_0x2eeb('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 2d49f52..7e2c42a 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 _0xc86a=['priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','serverUrl','remoteUri','slice','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','True','true','False','false','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','error','stack','name','send','index','map','ServicenowAccount','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','destroy','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','sys_updated_by','opened_by','sys_created_on','state','knowledge','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list'];(function(_0xbf51ed,_0x79bfb2){var _0x5b0acb=function(_0x389c14){while(--_0x389c14){_0xbf51ed['push'](_0xbf51ed['shift']());}};_0x5b0acb(++_0x79bfb2);}(_0xc86a,0xff));var _0xac86=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0xc86a[_0xa60623];return _0x4a6487;};'use strict';var emlformat=require(_0xac86('0x0'));var rimraf=require(_0xac86('0x1'));var zipdir=require(_0xac86('0x2'));var jsonpatch=require(_0xac86('0x3'));var rp=require(_0xac86('0x4'));var moment=require(_0xac86('0x5'));var BPromise=require(_0xac86('0x6'));var Mustache=require('mustache');var util=require(_0xac86('0x7'));var path=require(_0xac86('0x8'));var sox=require(_0xac86('0x9'));var csv=require('to-csv');var ejs=require(_0xac86('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xac86('0xb'));var crypto=require(_0xac86('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xac86('0xd'));var toCsv=require(_0xac86('0xe'));var querystring=require(_0xac86('0xf'));var Papa=require('papaparse');var Redis=require(_0xac86('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xac86('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac86('0x12'));var logger=require(_0xac86('0x13'))(_0xac86('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xac86('0x15'));var db=require(_0xac86('0x16'))['db'];var integrations=require(_0xac86('0x17'));function respondWithStatusCode(_0x43caf8,_0x100818){_0x100818=_0x100818||0xcc;return function(_0x500271){if(_0x500271){return _0x43caf8[_0xac86('0x18')](_0x100818);}return _0x43caf8[_0xac86('0x19')](_0x100818)[_0xac86('0x1a')]();};}function respondWithResult(_0x298945,_0x3ad277){_0x3ad277=_0x3ad277||0xc8;return function(_0x5acbde){if(_0x5acbde){return _0x298945[_0xac86('0x19')](_0x3ad277)['json'](_0x5acbde);}};}function respondWithFilteredResult(_0x50da39,_0x3ae4d7){return function(_0x5c79b7){if(_0x5c79b7){var _0x15e05f=typeof _0x3ae4d7[_0xac86('0x1b')]===_0xac86('0x1c')&&typeof _0x3ae4d7[_0xac86('0x1d')]===_0xac86('0x1c');var _0x514d14=_0x5c79b7[_0xac86('0x1e')];var _0xa239be=_0x15e05f?0x0:_0x3ae4d7[_0xac86('0x1b')];var _0xe49cfc=_0x15e05f?_0x5c79b7['count']:_0x3ae4d7[_0xac86('0x1b')]+_0x3ae4d7[_0xac86('0x1d')];var _0x596139;if(_0xe49cfc>=_0x514d14){_0xe49cfc=_0x514d14;_0x596139=0xc8;}else{_0x596139=0xce;}_0x50da39[_0xac86('0x19')](_0x596139);return _0x50da39[_0xac86('0x1f')](_0xac86('0x20'),_0xa239be+'-'+_0xe49cfc+'/'+_0x514d14)[_0xac86('0x21')](_0x5c79b7);}return null;};}function patchUpdates(_0x4d6ddd){return function(_0x4d2a33){try{jsonpatch[_0xac86('0x22')](_0x4d2a33,_0x4d6ddd,!![]);}catch(_0x5901bd){return BPromise['reject'](_0x5901bd);}return _0x4d2a33[_0xac86('0x23')]();};}function saveUpdates(_0x6eb1cc,_0x4e5798){return function(_0x55757a){if(_0x55757a){return _0x55757a['update'](_0x6eb1cc)[_0xac86('0x24')](function(_0x174e1e){return _0x174e1e;});}return null;};}function removeEntity(_0x221472,_0x217fbf){return function(_0x4db78a){if(_0x4db78a){return _0x4db78a['destroy']()[_0xac86('0x24')](function(){_0x221472[_0xac86('0x19')](0xcc)[_0xac86('0x1a')]();});}};}function handleEntityNotFound(_0x334d20,_0x54ccf4){return function(_0x29d667){if(!_0x29d667){_0x334d20['sendStatus'](0x194);}return _0x29d667;};}function handleError(_0xf6b2eb,_0x18e8d6){_0x18e8d6=_0x18e8d6||0x1f4;return function(_0xf98163){logger[_0xac86('0x25')](_0xf98163[_0xac86('0x26')]);if(_0xf98163[_0xac86('0x27')]){delete _0xf98163[_0xac86('0x27')];}_0xf6b2eb[_0xac86('0x19')](_0x18e8d6)[_0xac86('0x28')](_0xf98163);};}exports[_0xac86('0x29')]=function(_0x1f7d73,_0x16801a){var _0x1bf7c9={},_0xe7edc0={},_0x367b92={'count':0x0,'rows':[]};var _0x895c56=_[_0xac86('0x2a')](db[_0xac86('0x2b')]['rawAttributes'],function(_0xd71c0){return{'name':_0xd71c0['fieldName'],'type':_0xd71c0[_0xac86('0x2c')][_0xac86('0x2d')]};});_0xe7edc0[_0xac86('0x2e')]=_[_0xac86('0x2a')](_0x895c56,'name');_0xe7edc0[_0xac86('0x2f')]=_[_0xac86('0x30')](_0x1f7d73[_0xac86('0x2f')]);_0xe7edc0[_0xac86('0x31')]=_['intersection'](_0xe7edc0[_0xac86('0x2e')],_0xe7edc0[_0xac86('0x2f')]);_0x1bf7c9[_0xac86('0x32')]=_[_0xac86('0x33')](_0xe7edc0[_0xac86('0x2e')],qs[_0xac86('0x34')](_0x1f7d73[_0xac86('0x2f')][_0xac86('0x34')]));_0x1bf7c9['attributes']=_0x1bf7c9[_0xac86('0x32')][_0xac86('0x35')]?_0x1bf7c9[_0xac86('0x32')]:_0xe7edc0[_0xac86('0x2e')];if(!_0x1f7d73[_0xac86('0x2f')][_0xac86('0x36')](_0xac86('0x37'))){_0x1bf7c9[_0xac86('0x1d')]=qs[_0xac86('0x1d')](_0x1f7d73[_0xac86('0x2f')][_0xac86('0x1d')]);_0x1bf7c9[_0xac86('0x1b')]=qs[_0xac86('0x1b')](_0x1f7d73[_0xac86('0x2f')]['offset']);}_0x1bf7c9[_0xac86('0x38')]=qs[_0xac86('0x39')](_0x1f7d73[_0xac86('0x2f')][_0xac86('0x39')]);_0x1bf7c9[_0xac86('0x3a')]=qs[_0xac86('0x31')](_[_0xac86('0x3b')](_0x1f7d73[_0xac86('0x2f')],_0xe7edc0[_0xac86('0x31')]),_0x895c56);if(_0x1f7d73['query'][_0xac86('0x3c')]){_0x1bf7c9[_0xac86('0x3a')]=_[_0xac86('0x3d')](_0x1bf7c9[_0xac86('0x3a')],{'$or':_[_0xac86('0x2a')](_0x895c56,function(_0x4c8284){if(_0x4c8284[_0xac86('0x2c')]!==_0xac86('0x3e')){var _0x2b6dff={};_0x2b6dff[_0x4c8284[_0xac86('0x27')]]={'$like':'%'+_0x1f7d73[_0xac86('0x2f')]['filter']+'%'};return _0x2b6dff;}})});}_0x1bf7c9=_[_0xac86('0x3d')]({},_0x1bf7c9,_0x1f7d73[_0xac86('0x3f')]);var _0x138eb1={'where':_0x1bf7c9['where']};return db[_0xac86('0x2b')][_0xac86('0x1e')](_0x138eb1)[_0xac86('0x24')](function(_0x67684d){_0x367b92[_0xac86('0x1e')]=_0x67684d;if(_0x1f7d73['query'][_0xac86('0x40')]){_0x1bf7c9['include']=[{'all':!![]}];}return db[_0xac86('0x2b')][_0xac86('0x41')](_0x1bf7c9);})[_0xac86('0x24')](function(_0x349e53){_0x367b92[_0xac86('0x42')]=_0x349e53;return _0x367b92;})[_0xac86('0x24')](respondWithFilteredResult(_0x16801a,_0x1bf7c9))[_0xac86('0x43')](handleError(_0x16801a,null));};exports[_0xac86('0x44')]=function(_0x1eb4e1,_0xca3c76){var _0x45e463={'raw':![],'where':{'id':_0x1eb4e1['params']['id']}},_0x1c07d3={};_0x1c07d3[_0xac86('0x2e')]=_[_0xac86('0x30')](db[_0xac86('0x2b')][_0xac86('0x45')]);_0x1c07d3[_0xac86('0x2f')]=_[_0xac86('0x30')](_0x1eb4e1['query']);_0x1c07d3['filters']=_[_0xac86('0x33')](_0x1c07d3[_0xac86('0x2e')],_0x1c07d3[_0xac86('0x2f')]);_0x45e463['attributes']=_[_0xac86('0x33')](_0x1c07d3[_0xac86('0x2e')],qs[_0xac86('0x34')](_0x1eb4e1['query'][_0xac86('0x34')]));_0x45e463[_0xac86('0x32')]=_0x45e463['attributes'][_0xac86('0x35')]?_0x45e463[_0xac86('0x32')]:_0x1c07d3[_0xac86('0x2e')];if(_0x1eb4e1[_0xac86('0x2f')][_0xac86('0x40')]){_0x45e463['include']=[{'all':!![]}];}_0x45e463=_[_0xac86('0x3d')]({},_0x45e463,_0x1eb4e1[_0xac86('0x3f')]);return db[_0xac86('0x2b')][_0xac86('0x46')](_0x45e463)[_0xac86('0x24')](handleEntityNotFound(_0xca3c76,null))[_0xac86('0x24')](respondWithResult(_0xca3c76,null))[_0xac86('0x43')](handleError(_0xca3c76,null));};exports[_0xac86('0x47')]=function(_0x469fd2,_0x3fbcf6){return db['ServicenowAccount']['create'](_0x469fd2[_0xac86('0x48')],{})['then'](respondWithResult(_0x3fbcf6,0xc9))[_0xac86('0x43')](handleError(_0x3fbcf6,null));};exports[_0xac86('0x49')]=function(_0x245227,_0x46751c){if(_0x245227[_0xac86('0x48')]['id']){delete _0x245227[_0xac86('0x48')]['id'];}return db[_0xac86('0x2b')][_0xac86('0x46')]({'where':{'id':_0x245227[_0xac86('0x4a')]['id']}})['then'](handleEntityNotFound(_0x46751c,null))[_0xac86('0x24')](saveUpdates(_0x245227[_0xac86('0x48')],null))[_0xac86('0x24')](respondWithResult(_0x46751c,null))[_0xac86('0x43')](handleError(_0x46751c,null));};exports[_0xac86('0x4b')]=function(_0x369c54,_0xb28e2){return db[_0xac86('0x2b')]['find']({'where':{'id':_0x369c54[_0xac86('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb28e2,null))[_0xac86('0x24')](removeEntity(_0xb28e2,null))[_0xac86('0x43')](handleError(_0xb28e2,null));};exports[_0xac86('0x4c')]=function(_0xbb1ffd,_0x5b9a5b,_0x47119e){var _0x1b77ee={};var _0x52dbe6={};var _0x41370b;var _0xb1dc3d;return db['ServicenowAccount'][_0xac86('0x4d')]({'where':{'id':_0xbb1ffd[_0xac86('0x4a')]['id']}})[_0xac86('0x24')](handleEntityNotFound(_0x5b9a5b,null))[_0xac86('0x24')](function(_0x1ef91a){if(_0x1ef91a){_0x41370b=_0x1ef91a;_0x52dbe6['model']=_['keys'](db[_0xac86('0x4e')]['rawAttributes']);_0x52dbe6[_0xac86('0x2f')]=_['keys'](_0xbb1ffd[_0xac86('0x2f')]);_0x52dbe6[_0xac86('0x31')]=_[_0xac86('0x33')](_0x52dbe6['model'],_0x52dbe6[_0xac86('0x2f')]);_0x1b77ee['attributes']=_[_0xac86('0x33')](_0x52dbe6[_0xac86('0x2e')],qs[_0xac86('0x34')](_0xbb1ffd['query'][_0xac86('0x34')]));_0x1b77ee[_0xac86('0x32')]=_0x1b77ee['attributes'][_0xac86('0x35')]?_0x1b77ee['attributes']:_0x52dbe6['model'];_0x1b77ee[_0xac86('0x38')]=qs[_0xac86('0x39')](_0xbb1ffd[_0xac86('0x2f')][_0xac86('0x39')]);_0x1b77ee[_0xac86('0x3a')]=qs['filters'](_['pick'](_0xbb1ffd['query'],_0x52dbe6[_0xac86('0x31')]));if(_0xbb1ffd[_0xac86('0x2f')][_0xac86('0x3c')]){_0x1b77ee[_0xac86('0x3a')]=_[_0xac86('0x3d')](_0x1b77ee[_0xac86('0x3a')],{'$or':_[_0xac86('0x2a')](_0x1b77ee['attributes'],function(_0x8c61b9){var _0x434a5d={};_0x434a5d[_0x8c61b9]={'$like':'%'+_0xbb1ffd[_0xac86('0x2f')][_0xac86('0x3c')]+'%'};return _0x434a5d;})});}_0x1b77ee=_['merge']({},_0x1b77ee,_0xbb1ffd[_0xac86('0x3f')]);return _0x41370b[_0xac86('0x4c')](_0x1b77ee);}})[_0xac86('0x24')](function(_0xa19d84){if(_0xa19d84){_0xb1dc3d=_0xa19d84['length'];if(!_0xbb1ffd[_0xac86('0x2f')][_0xac86('0x36')](_0xac86('0x37'))){_0x1b77ee[_0xac86('0x1d')]=qs[_0xac86('0x1d')](_0xbb1ffd[_0xac86('0x2f')][_0xac86('0x1d')]);_0x1b77ee[_0xac86('0x1b')]=qs[_0xac86('0x1b')](_0xbb1ffd['query'][_0xac86('0x1b')]);}return _0x41370b[_0xac86('0x4c')](_0x1b77ee);}})[_0xac86('0x24')](function(_0x4253c0){if(_0x4253c0){return _0x4253c0?{'count':_0xb1dc3d,'rows':_0x4253c0}:null;}})[_0xac86('0x24')](respondWithResult(_0x5b9a5b,null))[_0xac86('0x43')](handleError(_0x5b9a5b,null));};exports[_0xac86('0x4f')]=function(_0x3f4fb5,_0x5ae4f7,_0x287521){if(_0x3f4fb5[_0xac86('0x48')]['id']){delete _0x3f4fb5[_0xac86('0x48')]['id'];}return db[_0xac86('0x2b')][_0xac86('0x4d')]({'where':{'id':_0x3f4fb5[_0xac86('0x4a')]['id']}})[_0xac86('0x24')](handleEntityNotFound(_0x5ae4f7,null))[_0xac86('0x24')](function(_0x267ddc){if(_0x267ddc){_0x3f4fb5[_0xac86('0x48')][_0xac86('0x50')]=_0x267ddc['id'];_0x3f4fb5[_0xac86('0x48')]['Subjects']=integrations[_0xac86('0x51')](_0x3f4fb5['body'][_0xac86('0x52')],_0x3f4fb5['body'][_0xac86('0x2c')]);_0x3f4fb5[_0xac86('0x48')][_0xac86('0x53')]=integrations[_0xac86('0x54')](_0x3f4fb5['body']['channel'],_0x3f4fb5[_0xac86('0x48')][_0xac86('0x2c')]);return db[_0xac86('0x4e')][_0xac86('0x47')](_0x3f4fb5[_0xac86('0x48')],{'include':[{'model':db[_0xac86('0x55')],'as':'Subjects'},{'model':db[_0xac86('0x55')],'as':_0xac86('0x53')}]});}return null;})[_0xac86('0x24')](respondWithResult(_0x5ae4f7,null))['catch'](handleError(_0x5ae4f7,null));};exports[_0xac86('0x56')]=function(_0x33ddef,_0x3a7150,_0x462da4){var _0x5bcf43=[_0xac86('0x57'),_0xac86('0x58'),'knowledge',_0xac86('0x59'),_0xac86('0x5a'),_0xac86('0x5b'),_0xac86('0x5c'),_0xac86('0x5d'),_0xac86('0x5e')];var _0x532366=[_0xac86('0x5f'),_0xac86('0x57'),_0xac86('0x60'),_0xac86('0x61'),_0xac86('0x62'),_0xac86('0x63'),'child_incidents','hold_reason',_0xac86('0x64'),_0xac86('0x65'),'resolved_by',_0xac86('0x66'),_0xac86('0x67'),'user_input',_0xac86('0x68'),'sys_domain',_0xac86('0x69'),'sys_created_by',_0xac86('0x6a'),_0xac86('0x38'),'calendar_stc',_0xac86('0x6b'),_0xac86('0x6c'),_0xac86('0x6d'),_0xac86('0x6e'),_0xac86('0x6f'),_0xac86('0x70'),'business_service',_0xac86('0x71'),_0xac86('0x72'),_0xac86('0x73'),_0xac86('0x74'),_0xac86('0x75'),'opened_at',_0xac86('0x76'),_0xac86('0x77'),'work_end','reopened_time',_0xac86('0x78'),_0xac86('0x79'),_0xac86('0x7a'),'subcategory',_0xac86('0x7b'),_0xac86('0x7c'),'close_code',_0xac86('0x7d'),_0xac86('0x7e'),_0xac86('0x7f'),'assignment_group',_0xac86('0x80'),_0xac86('0x81'),'description',_0xac86('0x82'),_0xac86('0x5b'),'sys_class_name',_0xac86('0x83'),_0xac86('0x84'),_0xac86('0x85'),_0xac86('0x86'),_0xac86('0x87'),_0xac86('0x88'),'reopened_by','incident_state',_0xac86('0x89'),_0xac86('0x8a'),_0xac86('0x8b'),_0xac86('0x8c'),'activity_due',_0xac86('0x8d'),_0xac86('0x5d'),_0xac86('0x8e'),_0xac86('0x8f'),_0xac86('0x90'),_0xac86('0x91'),_0xac86('0x92'),'sys_mod_count',_0xac86('0x93'),_0xac86('0x94'),'escalation',_0xac86('0x95'),_0xac86('0x96'),_0xac86('0x97'),_0xac86('0x5e')];var _0xf3d633='';var _0x286e91='';var _0x579a6f=[];var _0x41ac2f='';var _0x22c857='';var _0x453cc6=[];var _0x4389e3='';var _0x4b2d2d='';var _0x38767e={};var _0x13c8d0='';return db[_0xac86('0x2b')][_0xac86('0x4d')]({'where':{'id':_0x33ddef['params']['id']},'attributes':['id',_0xac86('0x98'),_0xac86('0x99'),'email','remoteUri',_0xac86('0x9a')]})[_0xac86('0x24')](handleEntityNotFound(_0x3a7150,null))[_0xac86('0x24')](function(_0x1a39a1){if(_0x1a39a1){_0x13c8d0=_0x1a39a1[_0xac86('0x9b')];var _0x20058d=_0x13c8d0[_0xac86('0x9c')](-0x1);if(_0x20058d==='/'){_0x13c8d0=_0x13c8d0['substring'](0x0,_0x13c8d0[_0xac86('0x9d')](_0x20058d));}_0x4b2d2d=util['format']('%s/api/now/doc/table/schema/',_0x13c8d0);_0x4389e3=util[_0xac86('0x9e')](_0xac86('0x9f'),_0x13c8d0);_0x38767e={'user':_0x1a39a1[_0xac86('0x98')],'pass':_0x1a39a1['password']};var _0x2f4c4f={'method':_0xac86('0xa0'),'uri':_0x4b2d2d+_0xac86('0xa1'),'auth':_0x38767e,'json':!![]};return rp(_0x2f4c4f);}})['then'](function(_0x5d97ea){if(_0x5d97ea[_0xac86('0xa2')]['length']>0x0){_0xf3d633=_0x5d97ea[_0xac86('0xa2')];}console[_0xac86('0xa3')]('incident\x20table\x20objects',_0xf3d633);_0x453cc6=[];_0x286e91=Object[_0xac86('0xa4')]([],_0xf3d633);_[_0xac86('0xa5')](_0x286e91,function(_0x1eaecb){return!_0x5bcf43[_0xac86('0xa6')](_0x1eaecb[_0xac86('0x27')]);});_0x286e91[_0xac86('0xa7')](function(_0x44f062){var _0x337888=createFieldObject(_0x4389e3,_0x38767e,_0x44f062[_0xac86('0xa8')],_0x44f062['name'],_0x44f062[_0xac86('0xa9')],![]);_0x453cc6[_0xac86('0xaa')](_0x337888);});return Promise['all'](_0x453cc6);})['then'](function(_0x2212b6){_0x579a6f=_0x2212b6;_0x41ac2f=Object[_0xac86('0xa4')]([],_0xf3d633);console[_0xac86('0xa3')](_0xac86('0xab'),_0xf3d633);_[_0xac86('0xa5')](_0x41ac2f,function(_0x27050e){return _0x532366[_0xac86('0xa6')](_0x27050e[_0xac86('0x27')]);});console[_0xac86('0xa3')](_0xac86('0xac'),_0x41ac2f);_0x453cc6=[];_0x41ac2f['forEach'](function(_0x18fa3a){var _0x12e748=createFieldObject(_0x4389e3,_0x38767e,_0x18fa3a[_0xac86('0xa8')],_0x18fa3a[_0xac86('0x27')],_0x18fa3a['label'],!![]);_0x453cc6[_0xac86('0xaa')](_0x12e748);});return Promise[_0xac86('0xad')](_0x453cc6);})[_0xac86('0x24')](function(_0xa81d87){_0x22c857=_0xa81d87;var _0x4a5f14=_0x579a6f[_0xac86('0xae')](_0x22c857);return{'count':_0x4a5f14[_0xac86('0x35')],'rows':_0x4a5f14};})[_0xac86('0x24')](respondWithResult(_0x3a7150,null))[_0xac86('0x43')](function(_0x552246){console[_0xac86('0xa3')](_0xac86('0xaf')+_0x552246);var _0x31abcd=_0x33ddef[_0xac86('0x2f')]['test']?0x1f4:_0x552246[_0xac86('0xb0')]||0x1f4;logger[_0xac86('0x25')](_0x552246[_0xac86('0x26')]);delete _0x552246[_0xac86('0x27')];if(_0x31abcd===0x191){_0x31abcd=0x190;}_0x3a7150[_0xac86('0x19')](_0x31abcd)[_0xac86('0x28')](_0x33ddef[_0xac86('0x2f')]['test']?{'message':_0xac86('0xb1'),'statusCode':_0x552246[_0xac86('0xb0')]}:_0x552246);});};function createFieldObject(_0x3e8d62,_0x271ed8,_0x2eae0c,_0x5a5b23,_0x1c2c86,_0x15bda6){return new Promise(function(_0x482786,_0x2a7bbb){var _0x50fe02={'id':_0x5a5b23,'name':_0x1c2c86,'custom':_0x15bda6};if(_0x2eae0c==='boolean'){_0x50fe02[_0xac86('0x3f')]=[{'name':_0xac86('0xb2'),'value':_0xac86('0xb3')},{'name':_0xac86('0xb4'),'value':_0xac86('0xb5')}];_0x482786(_0x50fe02);}else{var _0xd48a2a={'method':_0xac86('0xa0'),'uri':_0x3e8d62+'sys_choice?sysparm_query=name=incident^element='+_0x5a5b23,'auth':_0x271ed8,'json':!![]};return rp(_0xd48a2a)[_0xac86('0x24')](function(_0x12e43f){var _0x4ba2ee=[];if(_0x12e43f[_0xac86('0xa2')][_0xac86('0x35')]>0x0){_0x12e43f[_0xac86('0xa2')][_0xac86('0xa7')](function(_0x5324b6){if(_0x5324b6[_0xac86('0xb6')]==='false'){var _0xc59dad={'name':_0x5324b6['label'],'value':_0x5324b6[_0xac86('0xb7')]};_0x4ba2ee[_0xac86('0xaa')](_0xc59dad);}});}_0x50fe02[_0xac86('0x3f')]=_0x4ba2ee;if(_0x50fe02[_0xac86('0x3f')][_0xac86('0x35')]>0x0){_0x482786(_0x50fe02);}else{if(_0x15bda6==![]){_0x482786();}else{_0x482786(_0x50fe02);}}});}});} \ No newline at end of file +var _0xa340=['category','parent','caused_by','upon_reject','sys_updated_on','hold_reason','approval_history','number','user_input','sys_domain','state','sys_created_by','calendar_stc','delivery_plan','impact','work_notes_list','business_service','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','caller_id','approval_set','short_description','work_start','assignment_group','business_stc','calendar_duration','close_notes','closed_by','sys_id','urgency','problem_id','company','reassignment_count','severity','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','label','push','all','TCL:\x20_object','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','update','then','destroy','error','name','send','index','ServicenowAccount','rawAttributes','type','key','query','keys','intersection','attributes','model','fields','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getConfigurations','findOne','ServicenowConfiguration','length','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','Subjects','ServicenowField','made_sla','knowledge','subcategory','close_code','notify','incident_state'];(function(_0x148fd1,_0x2d28a7){var _0x189256=function(_0x348d38){while(--_0x348d38){_0x148fd1['push'](_0x148fd1['shift']());}};_0x189256(++_0x2d28a7);}(_0xa340,0x1b0));var _0x0a34=function(_0x2f6d16,_0x516c0c){_0x2f6d16=_0x2f6d16-0x0;var _0xf706a=_0xa340[_0x2f6d16];return _0xf706a;};'use strict';var emlformat=require(_0x0a34('0x0'));var rimraf=require(_0x0a34('0x1'));var zipdir=require(_0x0a34('0x2'));var jsonpatch=require(_0x0a34('0x3'));var rp=require(_0x0a34('0x4'));var moment=require('moment');var BPromise=require(_0x0a34('0x5'));var Mustache=require(_0x0a34('0x6'));var util=require(_0x0a34('0x7'));var path=require('path');var sox=require(_0x0a34('0x8'));var csv=require(_0x0a34('0x9'));var ejs=require(_0x0a34('0xa'));var fs=require('fs');var fs_extra=require(_0x0a34('0xb'));var _=require(_0x0a34('0xc'));var squel=require(_0x0a34('0xd'));var crypto=require(_0x0a34('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0a34('0xf'));var toCsv=require(_0x0a34('0x9'));var querystring=require(_0x0a34('0x10'));var Papa=require('papaparse');var Redis=require(_0x0a34('0x11'));var authService=require(_0x0a34('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a34('0x13'));var logger=require(_0x0a34('0x14'))(_0x0a34('0x15'));var utils=require(_0x0a34('0x16'));var config=require(_0x0a34('0x17'));var licenseUtil=require(_0x0a34('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0a34('0x19'));function respondWithStatusCode(_0x464d3e,_0x2351bb){_0x2351bb=_0x2351bb||0xcc;return function(_0x24c28f){if(_0x24c28f){return _0x464d3e[_0x0a34('0x1a')](_0x2351bb);}return _0x464d3e[_0x0a34('0x1b')](_0x2351bb)[_0x0a34('0x1c')]();};}function respondWithResult(_0x3c134b,_0x45a825){_0x45a825=_0x45a825||0xc8;return function(_0xe9574){if(_0xe9574){return _0x3c134b[_0x0a34('0x1b')](_0x45a825)['json'](_0xe9574);}};}function respondWithFilteredResult(_0x3aa52a,_0x1df4f8){return function(_0x5e8808){if(_0x5e8808){var _0xa27d11=typeof _0x1df4f8[_0x0a34('0x1d')]===_0x0a34('0x1e')&&typeof _0x1df4f8['limit']==='undefined';var _0x25f87f=_0x5e8808['count'];var _0x5cc6c6=_0xa27d11?0x0:_0x1df4f8[_0x0a34('0x1d')];var _0x21d444=_0xa27d11?_0x5e8808[_0x0a34('0x1f')]:_0x1df4f8[_0x0a34('0x1d')]+_0x1df4f8[_0x0a34('0x20')];var _0x10f7e2;if(_0x21d444>=_0x25f87f){_0x21d444=_0x25f87f;_0x10f7e2=0xc8;}else{_0x10f7e2=0xce;}_0x3aa52a[_0x0a34('0x1b')](_0x10f7e2);return _0x3aa52a[_0x0a34('0x21')](_0x0a34('0x22'),_0x5cc6c6+'-'+_0x21d444+'/'+_0x25f87f)[_0x0a34('0x23')](_0x5e8808);}return null;};}function patchUpdates(_0x3765fa){return function(_0x4d8e38){try{jsonpatch['apply'](_0x4d8e38,_0x3765fa,!![]);}catch(_0x48c591){return BPromise[_0x0a34('0x24')](_0x48c591);}return _0x4d8e38['save']();};}function saveUpdates(_0x54f479,_0x2459bc){return function(_0x586ae8){if(_0x586ae8){return _0x586ae8[_0x0a34('0x25')](_0x54f479)[_0x0a34('0x26')](function(_0x568683){return _0x568683;});}return null;};}function removeEntity(_0x58a3ff,_0x3dbe85){return function(_0x40dd8b){if(_0x40dd8b){return _0x40dd8b[_0x0a34('0x27')]()['then'](function(){_0x58a3ff[_0x0a34('0x1b')](0xcc)[_0x0a34('0x1c')]();});}};}function handleEntityNotFound(_0x4002f7,_0x4baa93){return function(_0x4379fb){if(!_0x4379fb){_0x4002f7['sendStatus'](0x194);}return _0x4379fb;};}function handleError(_0x3dc050,_0x28b62c){_0x28b62c=_0x28b62c||0x1f4;return function(_0x57bc49){logger[_0x0a34('0x28')](_0x57bc49['stack']);if(_0x57bc49['name']){delete _0x57bc49[_0x0a34('0x29')];}_0x3dc050[_0x0a34('0x1b')](_0x28b62c)[_0x0a34('0x2a')](_0x57bc49);};}exports[_0x0a34('0x2b')]=function(_0x4b7dcc,_0x598f79){var _0x47c34a={},_0x343165={},_0x478f94={'count':0x0,'rows':[]};var _0x50c3bc=_['map'](db[_0x0a34('0x2c')][_0x0a34('0x2d')],function(_0x243287){return{'name':_0x243287['fieldName'],'type':_0x243287[_0x0a34('0x2e')][_0x0a34('0x2f')]};});_0x343165['model']=_['map'](_0x50c3bc,_0x0a34('0x29'));_0x343165[_0x0a34('0x30')]=_[_0x0a34('0x31')](_0x4b7dcc[_0x0a34('0x30')]);_0x343165['filters']=_[_0x0a34('0x32')](_0x343165['model'],_0x343165[_0x0a34('0x30')]);_0x47c34a[_0x0a34('0x33')]=_['intersection'](_0x343165[_0x0a34('0x34')],qs[_0x0a34('0x35')](_0x4b7dcc[_0x0a34('0x30')][_0x0a34('0x35')]));_0x47c34a[_0x0a34('0x33')]=_0x47c34a[_0x0a34('0x33')]['length']?_0x47c34a['attributes']:_0x343165[_0x0a34('0x34')];if(!_0x4b7dcc['query']['hasOwnProperty'](_0x0a34('0x36'))){_0x47c34a[_0x0a34('0x20')]=qs[_0x0a34('0x20')](_0x4b7dcc[_0x0a34('0x30')][_0x0a34('0x20')]);_0x47c34a[_0x0a34('0x1d')]=qs['offset'](_0x4b7dcc[_0x0a34('0x30')][_0x0a34('0x1d')]);}_0x47c34a[_0x0a34('0x37')]=qs[_0x0a34('0x38')](_0x4b7dcc[_0x0a34('0x30')][_0x0a34('0x38')]);_0x47c34a[_0x0a34('0x39')]=qs[_0x0a34('0x3a')](_[_0x0a34('0x3b')](_0x4b7dcc[_0x0a34('0x30')],_0x343165['filters']),_0x50c3bc);if(_0x4b7dcc[_0x0a34('0x30')][_0x0a34('0x3c')]){_0x47c34a[_0x0a34('0x39')]=_[_0x0a34('0x3d')](_0x47c34a['where'],{'$or':_[_0x0a34('0x3e')](_0x50c3bc,function(_0x5c0c4){if(_0x5c0c4[_0x0a34('0x2e')]!==_0x0a34('0x3f')){var _0x1ab5ef={};_0x1ab5ef[_0x5c0c4[_0x0a34('0x29')]]={'$like':'%'+_0x4b7dcc[_0x0a34('0x30')][_0x0a34('0x3c')]+'%'};return _0x1ab5ef;}})});}_0x47c34a=_[_0x0a34('0x3d')]({},_0x47c34a,_0x4b7dcc[_0x0a34('0x40')]);var _0x5bda4b={'where':_0x47c34a[_0x0a34('0x39')]};return db[_0x0a34('0x2c')][_0x0a34('0x1f')](_0x5bda4b)['then'](function(_0x51327e){_0x478f94[_0x0a34('0x1f')]=_0x51327e;if(_0x4b7dcc[_0x0a34('0x30')]['includeAll']){_0x47c34a[_0x0a34('0x41')]=[{'all':!![]}];}return db[_0x0a34('0x2c')][_0x0a34('0x42')](_0x47c34a);})[_0x0a34('0x26')](function(_0x3c9b9f){_0x478f94[_0x0a34('0x43')]=_0x3c9b9f;return _0x478f94;})['then'](respondWithFilteredResult(_0x598f79,_0x47c34a))[_0x0a34('0x44')](handleError(_0x598f79,null));};exports[_0x0a34('0x45')]=function(_0x33ba0f,_0x28bb8c){var _0x57dcba={'raw':![],'where':{'id':_0x33ba0f[_0x0a34('0x46')]['id']}},_0xb2a2ae={};_0xb2a2ae['model']=_[_0x0a34('0x31')](db[_0x0a34('0x2c')][_0x0a34('0x2d')]);_0xb2a2ae[_0x0a34('0x30')]=_[_0x0a34('0x31')](_0x33ba0f['query']);_0xb2a2ae[_0x0a34('0x3a')]=_[_0x0a34('0x32')](_0xb2a2ae[_0x0a34('0x34')],_0xb2a2ae['query']);_0x57dcba[_0x0a34('0x33')]=_['intersection'](_0xb2a2ae[_0x0a34('0x34')],qs[_0x0a34('0x35')](_0x33ba0f[_0x0a34('0x30')][_0x0a34('0x35')]));_0x57dcba[_0x0a34('0x33')]=_0x57dcba['attributes']['length']?_0x57dcba[_0x0a34('0x33')]:_0xb2a2ae[_0x0a34('0x34')];if(_0x33ba0f[_0x0a34('0x30')][_0x0a34('0x47')]){_0x57dcba['include']=[{'all':!![]}];}_0x57dcba=_[_0x0a34('0x3d')]({},_0x57dcba,_0x33ba0f[_0x0a34('0x40')]);return db[_0x0a34('0x2c')][_0x0a34('0x48')](_0x57dcba)['then'](handleEntityNotFound(_0x28bb8c,null))[_0x0a34('0x26')](respondWithResult(_0x28bb8c,null))['catch'](handleError(_0x28bb8c,null));};exports['create']=function(_0x1b57da,_0x36a224){return db[_0x0a34('0x2c')][_0x0a34('0x49')](_0x1b57da[_0x0a34('0x4a')],{})[_0x0a34('0x26')](respondWithResult(_0x36a224,0xc9))[_0x0a34('0x44')](handleError(_0x36a224,null));};exports[_0x0a34('0x25')]=function(_0x5b5b68,_0x49a8e3){if(_0x5b5b68['body']['id']){delete _0x5b5b68[_0x0a34('0x4a')]['id'];}return db['ServicenowAccount'][_0x0a34('0x48')]({'where':{'id':_0x5b5b68[_0x0a34('0x46')]['id']}})[_0x0a34('0x26')](handleEntityNotFound(_0x49a8e3,null))[_0x0a34('0x26')](saveUpdates(_0x5b5b68[_0x0a34('0x4a')],null))[_0x0a34('0x26')](respondWithResult(_0x49a8e3,null))['catch'](handleError(_0x49a8e3,null));};exports[_0x0a34('0x27')]=function(_0x139880,_0x494b4f){return db[_0x0a34('0x2c')][_0x0a34('0x48')]({'where':{'id':_0x139880[_0x0a34('0x46')]['id']}})[_0x0a34('0x26')](handleEntityNotFound(_0x494b4f,null))[_0x0a34('0x26')](removeEntity(_0x494b4f,null))[_0x0a34('0x44')](handleError(_0x494b4f,null));};exports[_0x0a34('0x4b')]=function(_0x3ceaef,_0x476b08,_0x5dea14){var _0x56d648={};var _0x4759ca={};var _0x1e3b4b;var _0x44c3e4;return db['ServicenowAccount'][_0x0a34('0x4c')]({'where':{'id':_0x3ceaef[_0x0a34('0x46')]['id']}})[_0x0a34('0x26')](handleEntityNotFound(_0x476b08,null))[_0x0a34('0x26')](function(_0x599fb3){if(_0x599fb3){_0x1e3b4b=_0x599fb3;_0x4759ca[_0x0a34('0x34')]=_[_0x0a34('0x31')](db[_0x0a34('0x4d')][_0x0a34('0x2d')]);_0x4759ca[_0x0a34('0x30')]=_[_0x0a34('0x31')](_0x3ceaef[_0x0a34('0x30')]);_0x4759ca['filters']=_[_0x0a34('0x32')](_0x4759ca['model'],_0x4759ca[_0x0a34('0x30')]);_0x56d648[_0x0a34('0x33')]=_['intersection'](_0x4759ca[_0x0a34('0x34')],qs[_0x0a34('0x35')](_0x3ceaef['query'][_0x0a34('0x35')]));_0x56d648[_0x0a34('0x33')]=_0x56d648[_0x0a34('0x33')][_0x0a34('0x4e')]?_0x56d648['attributes']:_0x4759ca['model'];_0x56d648[_0x0a34('0x37')]=qs['sort'](_0x3ceaef[_0x0a34('0x30')][_0x0a34('0x38')]);_0x56d648[_0x0a34('0x39')]=qs[_0x0a34('0x3a')](_[_0x0a34('0x3b')](_0x3ceaef['query'],_0x4759ca[_0x0a34('0x3a')]));if(_0x3ceaef[_0x0a34('0x30')][_0x0a34('0x3c')]){_0x56d648[_0x0a34('0x39')]=_[_0x0a34('0x3d')](_0x56d648['where'],{'$or':_[_0x0a34('0x3e')](_0x56d648[_0x0a34('0x33')],function(_0x4d12aa){var _0x5c4b53={};_0x5c4b53[_0x4d12aa]={'$like':'%'+_0x3ceaef[_0x0a34('0x30')][_0x0a34('0x3c')]+'%'};return _0x5c4b53;})});}_0x56d648=_[_0x0a34('0x3d')]({},_0x56d648,_0x3ceaef[_0x0a34('0x40')]);return _0x1e3b4b[_0x0a34('0x4b')](_0x56d648);}})[_0x0a34('0x26')](function(_0x4b50bc){if(_0x4b50bc){_0x44c3e4=_0x4b50bc[_0x0a34('0x4e')];if(!_0x3ceaef['query'][_0x0a34('0x4f')](_0x0a34('0x36'))){_0x56d648[_0x0a34('0x20')]=qs[_0x0a34('0x20')](_0x3ceaef['query'][_0x0a34('0x20')]);_0x56d648['offset']=qs[_0x0a34('0x1d')](_0x3ceaef['query'][_0x0a34('0x1d')]);}return _0x1e3b4b[_0x0a34('0x4b')](_0x56d648);}})[_0x0a34('0x26')](function(_0x4984d0){if(_0x4984d0){return _0x4984d0?{'count':_0x44c3e4,'rows':_0x4984d0}:null;}})[_0x0a34('0x26')](respondWithResult(_0x476b08,null))[_0x0a34('0x44')](handleError(_0x476b08,null));};exports[_0x0a34('0x50')]=function(_0x18a687,_0xfb1f,_0x501687){if(_0x18a687['body']['id']){delete _0x18a687[_0x0a34('0x4a')]['id'];}return db[_0x0a34('0x2c')][_0x0a34('0x4c')]({'where':{'id':_0x18a687[_0x0a34('0x46')]['id']}})[_0x0a34('0x26')](handleEntityNotFound(_0xfb1f,null))[_0x0a34('0x26')](function(_0x3a383d){if(_0x3a383d){_0x18a687['body'][_0x0a34('0x51')]=_0x3a383d['id'];_0x18a687[_0x0a34('0x4a')]['Subjects']=integrations[_0x0a34('0x52')](_0x18a687[_0x0a34('0x4a')][_0x0a34('0x53')],_0x18a687[_0x0a34('0x4a')][_0x0a34('0x2e')]);_0x18a687[_0x0a34('0x4a')][_0x0a34('0x54')]=integrations['getDescriptions'](_0x18a687[_0x0a34('0x4a')]['channel'],_0x18a687['body']['type']);return db[_0x0a34('0x4d')][_0x0a34('0x49')](_0x18a687[_0x0a34('0x4a')],{'include':[{'model':db['ServicenowField'],'as':_0x0a34('0x55')},{'model':db[_0x0a34('0x56')],'as':_0x0a34('0x54')}]});}return null;})[_0x0a34('0x26')](respondWithResult(_0xfb1f,null))[_0x0a34('0x44')](handleError(_0xfb1f,null));};exports['getFields']=function(_0x23b27c,_0x4b505a,_0x5bd45d){var _0x4bc475=[_0x0a34('0x57'),'hold_reason',_0x0a34('0x58'),_0x0a34('0x59'),_0x0a34('0x5a'),_0x0a34('0x5b'),_0x0a34('0x5c'),'severity',_0x0a34('0x5d')];var _0x454a4b=[_0x0a34('0x5e'),'made_sla',_0x0a34('0x5f'),'watch_list',_0x0a34('0x60'),_0x0a34('0x61'),'child_incidents',_0x0a34('0x62'),_0x0a34('0x63'),_0x0a34('0x64'),'resolved_by','sys_updated_by','opened_by',_0x0a34('0x65'),'sys_created_on',_0x0a34('0x66'),_0x0a34('0x67'),_0x0a34('0x68'),'knowledge',_0x0a34('0x37'),_0x0a34('0x69'),'closed_at','cmdb_ci',_0x0a34('0x6a'),_0x0a34('0x6b'),'active',_0x0a34('0x6c'),_0x0a34('0x6d'),'priority',_0x0a34('0x6e'),_0x0a34('0x6f'),_0x0a34('0x70'),'expected_start',_0x0a34('0x71'),_0x0a34('0x72'),_0x0a34('0x73'),'work_end','reopened_time','resolved_at',_0x0a34('0x74'),_0x0a34('0x75'),'subcategory','work_notes',_0x0a34('0x76'),_0x0a34('0x5a'),'correlation_display','delivery_task',_0x0a34('0x77'),_0x0a34('0x78'),_0x0a34('0x79'),'additional_assignee_list','description',_0x0a34('0x7a'),_0x0a34('0x5b'),'sys_class_name',_0x0a34('0x7b'),_0x0a34('0x7c'),'follow_up','parent_incident',_0x0a34('0x7d'),'contact_type','reopened_by',_0x0a34('0x5c'),_0x0a34('0x7e'),_0x0a34('0x7f'),_0x0a34('0x80'),_0x0a34('0x81'),'activity_due','assigned_to',_0x0a34('0x82'),_0x0a34('0x83'),_0x0a34('0x84'),_0x0a34('0x85'),'comments_and_work_notes',_0x0a34('0x86'),_0x0a34('0x87'),_0x0a34('0x88'),_0x0a34('0x89'),_0x0a34('0x8a'),'upon_approval',_0x0a34('0x8b'),_0x0a34('0x8c'),_0x0a34('0x5d')];var _0x4c102e='';var _0x2ca078='';var _0x40dc1a=[];var _0x4a171b='';var _0xbbd4af='';var _0x2d11ba=[];var _0x7c8c28='';var _0x292315='';var _0x31a6d5={};var _0x1fb062='';return db[_0x0a34('0x2c')][_0x0a34('0x4c')]({'where':{'id':_0x23b27c['params']['id']},'attributes':['id','username',_0x0a34('0x8d'),_0x0a34('0x8e'),_0x0a34('0x8f'),_0x0a34('0x90')]})[_0x0a34('0x26')](handleEntityNotFound(_0x4b505a,null))[_0x0a34('0x26')](function(_0x1e1867){if(_0x1e1867){_0x1fb062=_0x1e1867['remoteUri'];var _0x9a80=_0x1fb062[_0x0a34('0x91')](-0x1);if(_0x9a80==='/'){_0x1fb062=_0x1fb062[_0x0a34('0x92')](0x0,_0x1fb062[_0x0a34('0x93')](_0x9a80));}_0x292315=util[_0x0a34('0x94')](_0x0a34('0x95'),_0x1fb062);_0x7c8c28=util[_0x0a34('0x94')](_0x0a34('0x96'),_0x1fb062);_0x31a6d5={'user':_0x1e1867[_0x0a34('0x97')],'pass':_0x1e1867[_0x0a34('0x8d')]};var _0x87c2e2={'method':'GET','uri':_0x292315+_0x0a34('0x98'),'auth':_0x31a6d5,'json':!![]};return rp(_0x87c2e2);}})['then'](function(_0x582186){if(_0x582186[_0x0a34('0x99')][_0x0a34('0x4e')]>0x0){_0x4c102e=_0x582186[_0x0a34('0x99')];}console[_0x0a34('0x9a')](_0x0a34('0x9b'),_0x4c102e);_0x2d11ba=[];_0x2ca078=Object['assign']([],_0x4c102e);_[_0x0a34('0x9c')](_0x2ca078,function(_0x28c143){return!_0x4bc475[_0x0a34('0x9d')](_0x28c143[_0x0a34('0x29')]);});_0x2ca078['forEach'](function(_0x32faa5){var _0x45712a=createFieldObject(_0x7c8c28,_0x31a6d5,_0x32faa5['internalType'],_0x32faa5[_0x0a34('0x29')],_0x32faa5[_0x0a34('0x9e')],![]);_0x2d11ba[_0x0a34('0x9f')](_0x45712a);});return Promise[_0x0a34('0xa0')](_0x2d11ba);})['then'](function(_0x1bb0de){_0x40dc1a=_0x1bb0de;_0x4a171b=Object['assign']([],_0x4c102e);console[_0x0a34('0x9a')](_0x0a34('0xa1'),_0x4c102e);_['remove'](_0x4a171b,function(_0x1d9829){return _0x454a4b[_0x0a34('0x9d')](_0x1d9829[_0x0a34('0x29')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x4a171b);_0x2d11ba=[];_0x4a171b['forEach'](function(_0xef8533){var _0x27b281=createFieldObject(_0x7c8c28,_0x31a6d5,_0xef8533['internalType'],_0xef8533[_0x0a34('0x29')],_0xef8533[_0x0a34('0x9e')],!![]);_0x2d11ba[_0x0a34('0x9f')](_0x27b281);});return Promise[_0x0a34('0xa0')](_0x2d11ba);})[_0x0a34('0x26')](function(_0x356d4a){_0xbbd4af=_0x356d4a;var _0x53ba10=_0x40dc1a['concat'](_0xbbd4af);return{'count':_0x53ba10[_0x0a34('0x4e')],'rows':_0x53ba10};})['then'](respondWithResult(_0x4b505a,null))['catch'](function(_0x3a6057){console[_0x0a34('0x9a')](_0x0a34('0xa2')+_0x3a6057);var _0x561259=_0x23b27c['query'][_0x0a34('0xa3')]?0x1f4:_0x3a6057['statusCode']||0x1f4;logger[_0x0a34('0x28')](_0x3a6057['stack']);delete _0x3a6057[_0x0a34('0x29')];if(_0x561259===0x191){_0x561259=0x190;}_0x4b505a[_0x0a34('0x1b')](_0x561259)[_0x0a34('0x2a')](_0x23b27c[_0x0a34('0x30')]['test']?{'message':_0x0a34('0xa4'),'statusCode':_0x3a6057[_0x0a34('0xa5')]}:_0x3a6057);});};function createFieldObject(_0x40cfd3,_0x2bebdc,_0x4f989d,_0x5e18ee,_0x32612b,_0x1b85b1){return new Promise(function(_0x280984,_0x5d8dfa){var _0x452905={'id':_0x5e18ee,'name':_0x32612b,'custom':_0x1b85b1};if(_0x4f989d===_0x0a34('0xa6')){_0x452905[_0x0a34('0x40')]=[{'name':_0x0a34('0xa7'),'value':_0x0a34('0xa8')},{'name':_0x0a34('0xa9'),'value':_0x0a34('0xaa')}];_0x280984(_0x452905);}else{var _0x587393={'method':_0x0a34('0xab'),'uri':_0x40cfd3+_0x0a34('0xac')+_0x5e18ee,'auth':_0x2bebdc,'json':!![]};return rp(_0x587393)[_0x0a34('0x26')](function(_0x69fafe){var _0x51b7f0=[];if(_0x69fafe[_0x0a34('0x99')]['length']>0x0){_0x69fafe[_0x0a34('0x99')]['forEach'](function(_0x2dbf8c){if(_0x2dbf8c[_0x0a34('0xad')]==='false'){var _0x107ccf={'name':_0x2dbf8c['label'],'value':_0x2dbf8c[_0x0a34('0xae')]};_0x51b7f0[_0x0a34('0x9f')](_0x107ccf);}});}_0x452905['options']=_0x51b7f0;if(_0x452905[_0x0a34('0x40')][_0x0a34('0x4e')]>0x0){_0x280984(_0x452905);}else{if(_0x1b85b1==![]){_0x280984();}else{_0x280984(_0x452905);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 07b1e79..ee67ae2 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util'];(function(_0x10dfdf,_0x36b623){var _0x4d857d=function(_0x4683ee){while(--_0x4683ee){_0x10dfdf['push'](_0x10dfdf['shift']());}};_0x4d857d(++_0x36b623);}(_0x7a54,0x106));var _0x47a5=function(_0x582365,_0x38dd76){_0x582365=_0x582365-0x0;var _0x55c7e6=_0x7a54[_0x582365];return _0x55c7e6;};'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'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbf5=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount'];(function(_0x5a9a6c,_0x5934d9){var _0x452b4b=function(_0x37b5ee){while(--_0x37b5ee){_0x5a9a6c['push'](_0x5a9a6c['shift']());}};_0x452b4b(++_0x5934d9);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x3cab92,_0xd15ac1){_0x3cab92=_0x3cab92-0x0;var _0x311713=_0xdbf5[_0x3cab92];return _0x311713;};'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'));var integrations=require(_0x5dbf('0x8'));module[_0x5dbf('0x9')]=function(_0x3f8222,_0x209b7d){return _0x3f8222[_0x5dbf('0xa')](_0x5dbf('0xb'),attributes,{'tableName':'int_servicenow_accounts','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 5be0b30..c560a49 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 _0xfb5b=['model','catch','ShowServicenowAccount','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','include','map'];(function(_0x41835b,_0x28d560){var _0x470007=function(_0x2f6ed7){while(--_0x2f6ed7){_0x41835b['push'](_0x41835b['shift']());}};_0x470007(++_0x28d560);}(_0xfb5b,0x1f0));var _0xbfb5=function(_0x1fc3aa,_0x1b92fd){_0x1fc3aa=_0x1fc3aa-0x0;var _0x11dd40=_0xfb5b[_0x1fc3aa];return _0x11dd40;};'use strict';var _=require('lodash');var util=require(_0xbfb5('0x0'));var moment=require(_0xbfb5('0x1'));var BPromise=require(_0xbfb5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfb5('0x3'));var db=require(_0xbfb5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbfb5('0x5'));var config=require(_0xbfb5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xbfb5('0x7')][_0xbfb5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4573ef,_0x22ff34,_0x12c9a3){return new BPromise(function(_0x4c17d2,_0x47bfc4){return client[_0xbfb5('0x9')](_0x4573ef,_0x12c9a3)[_0xbfb5('0xa')](function(_0x52b3ca){logger[_0xbfb5('0xb')](_0xbfb5('0xc'),_0x22ff34,_0xbfb5('0xd'));logger[_0xbfb5('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x22ff34,_0xbfb5('0xd'),JSON[_0xbfb5('0xf')](_0x52b3ca));if(_0x52b3ca[_0xbfb5('0x10')]){if(_0x52b3ca['error']['code']===0x1f4){logger[_0xbfb5('0x10')](_0xbfb5('0xc'),_0x22ff34,_0x52b3ca[_0xbfb5('0x10')][_0xbfb5('0x11')]);return _0x47bfc4(_0x52b3ca[_0xbfb5('0x10')][_0xbfb5('0x11')]);}logger[_0xbfb5('0x10')](_0xbfb5('0xc'),_0x22ff34,_0x52b3ca['error'][_0xbfb5('0x11')]);return _0x4c17d2(_0x52b3ca['error'][_0xbfb5('0x11')]);}else{logger[_0xbfb5('0xb')](_0xbfb5('0xc'),_0x22ff34,_0xbfb5('0xd'));_0x4c17d2(_0x52b3ca['result'][_0xbfb5('0x11')]);}})['catch'](function(_0x123562){logger[_0xbfb5('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x22ff34,_0x123562);_0x47bfc4(_0x123562);});});}exports[_0xbfb5('0x12')]=function(_0x316bd0){var _0x39d542=this;return new Promise(function(_0x596e77,_0x1e6bbc){return db[_0xbfb5('0x13')]['findAll']({'raw':_0x316bd0[_0xbfb5('0x14')]?_0x316bd0[_0xbfb5('0x14')][_0xbfb5('0x15')]===undefined?!![]:![]:!![],'where':_0x316bd0[_0xbfb5('0x14')]?_0x316bd0[_0xbfb5('0x14')][_0xbfb5('0x16')]||null:null,'attributes':_0x316bd0[_0xbfb5('0x14')]?_0x316bd0[_0xbfb5('0x14')][_0xbfb5('0x17')]||null:null,'limit':_0x316bd0[_0xbfb5('0x14')]?_0x316bd0[_0xbfb5('0x14')]['limit']||null:null,'include':_0x316bd0['options']?_0x316bd0[_0xbfb5('0x14')][_0xbfb5('0x18')]?_['map'](_0x316bd0[_0xbfb5('0x14')][_0xbfb5('0x18')],function(_0x18bdad){return{'model':db[_0x18bdad['model']],'as':_0x18bdad['as'],'attributes':_0x18bdad[_0xbfb5('0x17')],'include':_0x18bdad[_0xbfb5('0x18')]?_[_0xbfb5('0x19')](_0x18bdad['include'],function(_0xf7f80e){return{'model':db[_0xf7f80e[_0xbfb5('0x1a')]],'as':_0xf7f80e['as'],'attributes':_0xf7f80e[_0xbfb5('0x17')],'include':_0xf7f80e['include']?_[_0xbfb5('0x19')](_0xf7f80e['include'],function(_0x56ed29){return{'model':db[_0x56ed29['model']],'as':_0x56ed29['as'],'attributes':_0x56ed29['attributes']};}):[]};}):[]};}):[]:[]})[_0xbfb5('0xa')](function(_0x108ea5){logger[_0xbfb5('0xb')](_0xbfb5('0x12'),_0x316bd0);logger[_0xbfb5('0xe')](_0xbfb5('0x12'),_0x316bd0,JSON[_0xbfb5('0xf')](_0x108ea5));_0x596e77(_0x108ea5);})[_0xbfb5('0x1b')](function(_0x5ce27e){logger[_0xbfb5('0x10')]('GetServicenowAccount',_0x5ce27e[_0xbfb5('0x11')],_0x316bd0);_0x1e6bbc(_0x39d542[_0xbfb5('0x10')](0x1f4,_0x5ce27e[_0xbfb5('0x11')]));});});};exports[_0xbfb5('0x1c')]=function(_0x322590){var _0x344416=this;return new Promise(function(_0x2eebfa,_0x19c194){return db[_0xbfb5('0x13')]['find']({'raw':_0x322590['options']?_0x322590['options'][_0xbfb5('0x15')]===undefined?!![]:![]:!![],'where':_0x322590['options']?_0x322590['options'][_0xbfb5('0x16')]||null:null,'attributes':_0x322590[_0xbfb5('0x14')]?_0x322590['options'][_0xbfb5('0x17')]||null:null,'include':_0x322590[_0xbfb5('0x14')]?_0x322590[_0xbfb5('0x14')][_0xbfb5('0x18')]?_[_0xbfb5('0x19')](_0x322590[_0xbfb5('0x14')]['include'],function(_0x219b61){return{'model':db[_0x219b61[_0xbfb5('0x1a')]],'as':_0x219b61['as'],'attributes':_0x219b61['attributes'],'include':_0x219b61[_0xbfb5('0x18')]?_[_0xbfb5('0x19')](_0x219b61[_0xbfb5('0x18')],function(_0x395e6a){return{'model':db[_0x395e6a[_0xbfb5('0x1a')]],'as':_0x395e6a['as'],'attributes':_0x395e6a[_0xbfb5('0x17')],'include':_0x395e6a['include']?_[_0xbfb5('0x19')](_0x395e6a['include'],function(_0x153480){return{'model':db[_0x153480['model']],'as':_0x153480['as'],'attributes':_0x153480[_0xbfb5('0x17')]};}):[]};}):[]};}):[]:[]})[_0xbfb5('0xa')](function(_0x793056){logger['info'](_0xbfb5('0x1c'),_0x322590);logger['debug'](_0xbfb5('0x1c'),_0x322590,JSON['stringify'](_0x793056));_0x2eebfa(_0x793056);})[_0xbfb5('0x1b')](function(_0x7667ab){logger['error'](_0xbfb5('0x1c'),_0x7667ab['message'],_0x322590);_0x19c194(_0x344416[_0xbfb5('0x10')](0x1f4,_0x7667ab[_0xbfb5('0x11')]));});});}; \ No newline at end of file +var _0xf8d1=['ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','ServicenowAccount,\x20%s,\x20%s','request\x20sent','result','catch','GetServicenowAccount','ServicenowAccount','findAll','raw','options','where','limit','include','map','model','attributes'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xf8d1,0x74));var _0x1f8d=function(_0x1bb1e9,_0x3367a4){_0x1bb1e9=_0x1bb1e9-0x0;var _0x449b3c=_0xf8d1[_0x1bb1e9];return _0x449b3c;};'use strict';var _=require(_0x1f8d('0x0'));var util=require(_0x1f8d('0x1'));var moment=require(_0x1f8d('0x2'));var BPromise=require(_0x1f8d('0x3'));var rs=require(_0x1f8d('0x4'));var fs=require('fs');var Redis=require(_0x1f8d('0x5'));var db=require(_0x1f8d('0x6'))['db'];var utils=require(_0x1f8d('0x7'));var logger=require(_0x1f8d('0x8'))(_0x1f8d('0x9'));var config=require(_0x1f8d('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1f8d('0xb')][_0x1f8d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39a7d4,_0x2b0b61,_0x2a9fcf){return new BPromise(function(_0x4413bf,_0x5f329b){return client[_0x1f8d('0xd')](_0x39a7d4,_0x2a9fcf)[_0x1f8d('0xe')](function(_0x392481){logger[_0x1f8d('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x2b0b61,'request\x20sent');logger[_0x1f8d('0x10')](_0x1f8d('0x11'),_0x2b0b61,'request\x20sent',JSON[_0x1f8d('0x12')](_0x392481));if(_0x392481[_0x1f8d('0x13')]){if(_0x392481[_0x1f8d('0x13')]['code']===0x1f4){logger[_0x1f8d('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x2b0b61,_0x392481['error'][_0x1f8d('0x14')]);return _0x5f329b(_0x392481[_0x1f8d('0x13')]['message']);}logger[_0x1f8d('0x13')](_0x1f8d('0x15'),_0x2b0b61,_0x392481[_0x1f8d('0x13')]['message']);return _0x4413bf(_0x392481[_0x1f8d('0x13')]['message']);}else{logger['info'](_0x1f8d('0x15'),_0x2b0b61,_0x1f8d('0x16'));_0x4413bf(_0x392481[_0x1f8d('0x17')]['message']);}})[_0x1f8d('0x18')](function(_0x31c6e8){logger[_0x1f8d('0x13')](_0x1f8d('0x15'),_0x2b0b61,_0x31c6e8);_0x5f329b(_0x31c6e8);});});}exports[_0x1f8d('0x19')]=function(_0x160dfb){var _0x29a58d=this;return new Promise(function(_0x5ac8bc,_0x54fd35){return db[_0x1f8d('0x1a')][_0x1f8d('0x1b')]({'raw':_0x160dfb['options']?_0x160dfb['options'][_0x1f8d('0x1c')]===undefined?!![]:![]:!![],'where':_0x160dfb[_0x1f8d('0x1d')]?_0x160dfb['options'][_0x1f8d('0x1e')]||null:null,'attributes':_0x160dfb[_0x1f8d('0x1d')]?_0x160dfb[_0x1f8d('0x1d')]['attributes']||null:null,'limit':_0x160dfb[_0x1f8d('0x1d')]?_0x160dfb['options'][_0x1f8d('0x1f')]||null:null,'include':_0x160dfb[_0x1f8d('0x1d')]?_0x160dfb['options'][_0x1f8d('0x20')]?_[_0x1f8d('0x21')](_0x160dfb[_0x1f8d('0x1d')][_0x1f8d('0x20')],function(_0x316b5d){return{'model':db[_0x316b5d[_0x1f8d('0x22')]],'as':_0x316b5d['as'],'attributes':_0x316b5d[_0x1f8d('0x23')],'include':_0x316b5d[_0x1f8d('0x20')]?_[_0x1f8d('0x21')](_0x316b5d[_0x1f8d('0x20')],function(_0x2d9ae1){return{'model':db[_0x2d9ae1['model']],'as':_0x2d9ae1['as'],'attributes':_0x2d9ae1[_0x1f8d('0x23')],'include':_0x2d9ae1[_0x1f8d('0x20')]?_[_0x1f8d('0x21')](_0x2d9ae1[_0x1f8d('0x20')],function(_0x57d041){return{'model':db[_0x57d041[_0x1f8d('0x22')]],'as':_0x57d041['as'],'attributes':_0x57d041['attributes']};}):[]};}):[]};}):[]:[]})[_0x1f8d('0xe')](function(_0x3bf0b0){logger[_0x1f8d('0xf')](_0x1f8d('0x19'),_0x160dfb);logger[_0x1f8d('0x10')](_0x1f8d('0x19'),_0x160dfb,JSON['stringify'](_0x3bf0b0));_0x5ac8bc(_0x3bf0b0);})[_0x1f8d('0x18')](function(_0x24a079){logger[_0x1f8d('0x13')](_0x1f8d('0x19'),_0x24a079['message'],_0x160dfb);_0x54fd35(_0x29a58d['error'](0x1f4,_0x24a079['message']));});});};exports[_0x1f8d('0x24')]=function(_0x3df23c){var _0x3d7200=this;return new Promise(function(_0x2a16ce,_0x454ddc){return db['ServicenowAccount'][_0x1f8d('0x25')]({'raw':_0x3df23c[_0x1f8d('0x1d')]?_0x3df23c[_0x1f8d('0x1d')][_0x1f8d('0x1c')]===undefined?!![]:![]:!![],'where':_0x3df23c[_0x1f8d('0x1d')]?_0x3df23c['options']['where']||null:null,'attributes':_0x3df23c[_0x1f8d('0x1d')]?_0x3df23c['options'][_0x1f8d('0x23')]||null:null,'include':_0x3df23c[_0x1f8d('0x1d')]?_0x3df23c['options'][_0x1f8d('0x20')]?_['map'](_0x3df23c[_0x1f8d('0x1d')][_0x1f8d('0x20')],function(_0x253bc4){return{'model':db[_0x253bc4[_0x1f8d('0x22')]],'as':_0x253bc4['as'],'attributes':_0x253bc4[_0x1f8d('0x23')],'include':_0x253bc4[_0x1f8d('0x20')]?_[_0x1f8d('0x21')](_0x253bc4['include'],function(_0x677c7f){return{'model':db[_0x677c7f[_0x1f8d('0x22')]],'as':_0x677c7f['as'],'attributes':_0x677c7f['attributes'],'include':_0x677c7f[_0x1f8d('0x20')]?_[_0x1f8d('0x21')](_0x677c7f['include'],function(_0x2d5f33){return{'model':db[_0x2d5f33[_0x1f8d('0x22')]],'as':_0x2d5f33['as'],'attributes':_0x2d5f33[_0x1f8d('0x23')]};}):[]};}):[]};}):[]:[]})[_0x1f8d('0xe')](function(_0x4f7f41){logger['info'](_0x1f8d('0x24'),_0x3df23c);logger[_0x1f8d('0x10')]('ShowServicenowAccount',_0x3df23c,JSON['stringify'](_0x4f7f41));_0x2a16ce(_0x4f7f41);})[_0x1f8d('0x18')](function(_0x3a652e){logger[_0x1f8d('0x13')](_0x1f8d('0x24'),_0x3a652e['message'],_0x3df23c);_0x454ddc(_0x3d7200[_0x1f8d('0x13')](0x1f4,_0x3a652e['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 1b3d6a3..76c565e 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 _0xa270=['show','/:id/subjects','getSubjects','/:id/descriptions','post','put','delete','destroy','exports','multer','util','express','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x2b973d,_0x5a8772){var _0x329d93=function(_0x4920e2){while(--_0x4920e2){_0x2b973d['push'](_0x2b973d['shift']());}};_0x329d93(++_0x5a8772);}(_0xa270,0x7b));var _0x0a27=function(_0x2bb384,_0x38dcf8){_0x2bb384=_0x2bb384-0x0;var _0x301615=_0xa270[_0x2bb384];return _0x301615;};'use strict';var multer=require(_0x0a27('0x0'));var util=require(_0x0a27('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a27('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0a27('0x3'));var config=require(_0x0a27('0x4'));var controller=require(_0x0a27('0x5'));router[_0x0a27('0x6')]('/',auth[_0x0a27('0x7')](),controller[_0x0a27('0x8')]);router[_0x0a27('0x6')](_0x0a27('0x9'),auth['isAuthenticated'](),controller[_0x0a27('0xa')]);router[_0x0a27('0x6')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x0a27('0x6')](_0x0a27('0xb'),auth['isAuthenticated'](),controller[_0x0a27('0xc')]);router[_0x0a27('0x6')](_0x0a27('0xd'),auth[_0x0a27('0x7')](),controller['getDescriptions']);router[_0x0a27('0xe')]('/',auth[_0x0a27('0x7')](),controller['create']);router[_0x0a27('0xf')](_0x0a27('0x9'),auth[_0x0a27('0x7')](),controller['update']);router[_0x0a27('0x10')](_0x0a27('0x9'),auth[_0x0a27('0x7')](),controller[_0x0a27('0x11')]);module[_0x0a27('0x12')]=router; \ No newline at end of file +var _0x2653=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','exports','multer'];(function(_0x15b699,_0x2b94ce){var _0x4c1bd1=function(_0x33bb1f){while(--_0x33bb1f){_0x15b699['push'](_0x15b699['shift']());}};_0x4c1bd1(++_0x2b94ce);}(_0x2653,0x1a1));var _0x3265=function(_0x1b761f,_0x22b4e8){_0x1b761f=_0x1b761f-0x0;var _0x249aa7=_0x2653[_0x1b761f];return _0x249aa7;};'use strict';var multer=require(_0x3265('0x0'));var util=require(_0x3265('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3265('0x2'));var router=express[_0x3265('0x3')]();var fs_extra=require(_0x3265('0x4'));var auth=require(_0x3265('0x5'));var interaction=require(_0x3265('0x6'));var config=require(_0x3265('0x7'));var controller=require(_0x3265('0x8'));router[_0x3265('0x9')]('/',auth[_0x3265('0xa')](),controller[_0x3265('0xb')]);router[_0x3265('0x9')](_0x3265('0xc'),auth[_0x3265('0xa')](),controller['show']);router['get'](_0x3265('0xd'),auth[_0x3265('0xa')](),controller[_0x3265('0xe')]);router[_0x3265('0x9')](_0x3265('0xf'),auth[_0x3265('0xa')](),controller['getSubjects']);router['get'](_0x3265('0x10'),auth[_0x3265('0xa')](),controller[_0x3265('0x11')]);router[_0x3265('0x12')]('/',auth['isAuthenticated'](),controller[_0x3265('0x13')]);router[_0x3265('0x14')](_0x3265('0xc'),auth[_0x3265('0xa')](),controller['update']);router['delete'](_0x3265('0xc'),auth[_0x3265('0xa')](),controller['destroy']);module[_0x3265('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index ce4a0eb..1a7bc6b 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 _0x5927=['sequelize','exports','STRING'];(function(_0x15ece6,_0x51a965){var _0x3dc05c=function(_0x43e0c1){while(--_0x43e0c1){_0x15ece6['push'](_0x15ece6['shift']());}};_0x3dc05c(++_0x51a965);}(_0x5927,0xc6));var _0x7592=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x5927[_0x374ccf];return _0x443cde;};'use strict';var Sequelize=require(_0x7592('0x0'));module[_0x7592('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7592('0x2')]}}; \ No newline at end of file +var _0xb569=['sequelize','exports'];(function(_0x299846,_0x354bcb){var _0x2178cd=function(_0x18f6d4){while(--_0x18f6d4){_0x299846['push'](_0x299846['shift']());}};_0x2178cd(++_0x354bcb);}(_0xb569,0x1c6));var _0x9b56=function(_0x257dd9,_0x1f54a8){_0x257dd9=_0x257dd9-0x0;var _0xb4ee3e=_0xb569[_0x257dd9];return _0xb4ee3e;};'use strict';var Sequelize=require(_0x9b56('0x0'));module[_0x9b56('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 0692980..f184dcf 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 _0x23b6=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','save','then','sendStatus','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','getFields','findOne','ServicenowField','order','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x23b6,0x8f));var _0x623b=function(_0x33e4a7,_0x2e80a2){_0x33e4a7=_0x33e4a7-0x0;var _0x598620=_0x23b6[_0x33e4a7];return _0x598620;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x623b('0x0'));var zipdir=require(_0x623b('0x1'));var jsonpatch=require(_0x623b('0x2'));var rp=require(_0x623b('0x3'));var moment=require(_0x623b('0x4'));var BPromise=require(_0x623b('0x5'));var Mustache=require('mustache');var util=require(_0x623b('0x6'));var path=require(_0x623b('0x7'));var sox=require('sox');var csv=require(_0x623b('0x8'));var ejs=require(_0x623b('0x9'));var fs=require('fs');var fs_extra=require(_0x623b('0xa'));var _=require(_0x623b('0xb'));var squel=require('squel');var crypto=require(_0x623b('0xc'));var jsforce=require(_0x623b('0xd'));var deskjs=require(_0x623b('0xe'));var toCsv=require(_0x623b('0x8'));var querystring=require(_0x623b('0xf'));var Papa=require(_0x623b('0x10'));var Redis=require('ioredis');var authService=require(_0x623b('0x11'));var qs=require(_0x623b('0x12'));var as=require(_0x623b('0x13'));var hardwareService=require(_0x623b('0x14'));var logger=require('../../config/logger')(_0x623b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x623b('0x16'));var db=require(_0x623b('0x17'))['db'];function respondWithStatusCode(_0x2454f8,_0x164eae){_0x164eae=_0x164eae||0xcc;return function(_0x4c03c0){if(_0x4c03c0){return _0x2454f8['sendStatus'](_0x164eae);}return _0x2454f8[_0x623b('0x18')](_0x164eae)[_0x623b('0x19')]();};}function respondWithResult(_0x53d158,_0xacec11){_0xacec11=_0xacec11||0xc8;return function(_0xc94385){if(_0xc94385){return _0x53d158[_0x623b('0x18')](_0xacec11)[_0x623b('0x1a')](_0xc94385);}};}function respondWithFilteredResult(_0x43cc01,_0x4de7f6){return function(_0x589105){if(_0x589105){var _0x1db0c1=typeof _0x4de7f6['offset']===_0x623b('0x1b')&&typeof _0x4de7f6[_0x623b('0x1c')]==='undefined';var _0x4c8ffe=_0x589105[_0x623b('0x1d')];var _0x36e82a=_0x1db0c1?0x0:_0x4de7f6[_0x623b('0x1e')];var _0x532109=_0x1db0c1?_0x589105['count']:_0x4de7f6[_0x623b('0x1e')]+_0x4de7f6['limit'];var _0x8419f3;if(_0x532109>=_0x4c8ffe){_0x532109=_0x4c8ffe;_0x8419f3=0xc8;}else{_0x8419f3=0xce;}_0x43cc01['status'](_0x8419f3);return _0x43cc01[_0x623b('0x1f')](_0x623b('0x20'),_0x36e82a+'-'+_0x532109+'/'+_0x4c8ffe)[_0x623b('0x1a')](_0x589105);}return null;};}function patchUpdates(_0xf7f030){return function(_0x8eae39){try{jsonpatch['apply'](_0x8eae39,_0xf7f030,!![]);}catch(_0xce08f9){return BPromise['reject'](_0xce08f9);}return _0x8eae39[_0x623b('0x21')]();};}function saveUpdates(_0x1a0c63,_0x13c50a){return function(_0x13128e){if(_0x13128e){return _0x13128e['update'](_0x1a0c63)[_0x623b('0x22')](function(_0x29b544){return _0x29b544;});}return null;};}function removeEntity(_0x4fac59,_0x556e4e){return function(_0x572c56){if(_0x572c56){return _0x572c56['destroy']()[_0x623b('0x22')](function(){_0x4fac59['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25dd02,_0x3dc4ee){return function(_0x120deb){if(!_0x120deb){_0x25dd02[_0x623b('0x23')](0x194);}return _0x120deb;};}function handleError(_0x2e1189,_0x10cec8){_0x10cec8=_0x10cec8||0x1f4;return function(_0x154f30){logger[_0x623b('0x24')](_0x154f30[_0x623b('0x25')]);if(_0x154f30[_0x623b('0x26')]){delete _0x154f30[_0x623b('0x26')];}_0x2e1189[_0x623b('0x18')](_0x10cec8)[_0x623b('0x27')](_0x154f30);};}exports[_0x623b('0x28')]=function(_0x266592,_0x33dcf9){var _0x4af84d={},_0x39a184={},_0x6499f6={'count':0x0,'rows':[]};var _0x587fca=_['map'](db[_0x623b('0x29')][_0x623b('0x2a')],function(_0x343ae2){return{'name':_0x343ae2[_0x623b('0x2b')],'type':_0x343ae2[_0x623b('0x2c')][_0x623b('0x2d')]};});_0x39a184['model']=_[_0x623b('0x2e')](_0x587fca,_0x623b('0x26'));_0x39a184[_0x623b('0x2f')]=_[_0x623b('0x30')](_0x266592['query']);_0x39a184[_0x623b('0x31')]=_['intersection'](_0x39a184[_0x623b('0x32')],_0x39a184['query']);_0x4af84d[_0x623b('0x33')]=_[_0x623b('0x34')](_0x39a184['model'],qs['fields'](_0x266592[_0x623b('0x2f')]['fields']));_0x4af84d[_0x623b('0x33')]=_0x4af84d[_0x623b('0x33')][_0x623b('0x35')]?_0x4af84d[_0x623b('0x33')]:_0x39a184[_0x623b('0x32')];if(!_0x266592[_0x623b('0x2f')][_0x623b('0x36')](_0x623b('0x37'))){_0x4af84d[_0x623b('0x1c')]=qs['limit'](_0x266592[_0x623b('0x2f')]['limit']);_0x4af84d[_0x623b('0x1e')]=qs[_0x623b('0x1e')](_0x266592[_0x623b('0x2f')]['offset']);}_0x4af84d['order']=qs['sort'](_0x266592[_0x623b('0x2f')][_0x623b('0x38')]);_0x4af84d[_0x623b('0x39')]=qs[_0x623b('0x31')](_[_0x623b('0x3a')](_0x266592[_0x623b('0x2f')],_0x39a184[_0x623b('0x31')]),_0x587fca);if(_0x266592[_0x623b('0x2f')]['filter']){_0x4af84d[_0x623b('0x39')]=_[_0x623b('0x3b')](_0x4af84d[_0x623b('0x39')],{'$or':_[_0x623b('0x2e')](_0x587fca,function(_0x479555){if(_0x479555[_0x623b('0x2c')]!==_0x623b('0x3c')){var _0xda5633={};_0xda5633[_0x479555['name']]={'$like':'%'+_0x266592[_0x623b('0x2f')][_0x623b('0x3d')]+'%'};return _0xda5633;}})});}_0x4af84d=_['merge']({},_0x4af84d,_0x266592[_0x623b('0x3e')]);var _0x592479={'where':_0x4af84d[_0x623b('0x39')]};return db[_0x623b('0x29')]['count'](_0x592479)[_0x623b('0x22')](function(_0x47b291){_0x6499f6['count']=_0x47b291;if(_0x266592[_0x623b('0x2f')][_0x623b('0x3f')]){_0x4af84d[_0x623b('0x40')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x623b('0x41')](_0x4af84d);})[_0x623b('0x22')](function(_0x5eceb9){_0x6499f6[_0x623b('0x42')]=_0x5eceb9;return _0x6499f6;})['then'](respondWithFilteredResult(_0x33dcf9,_0x4af84d))[_0x623b('0x43')](handleError(_0x33dcf9,null));};exports['show']=function(_0x921663,_0x4452db){var _0x1936eb={'raw':![],'where':{'id':_0x921663[_0x623b('0x44')]['id']}},_0x18de79={};_0x18de79['model']=_[_0x623b('0x30')](db[_0x623b('0x29')]['rawAttributes']);_0x18de79[_0x623b('0x2f')]=_[_0x623b('0x30')](_0x921663[_0x623b('0x2f')]);_0x18de79[_0x623b('0x31')]=_[_0x623b('0x34')](_0x18de79[_0x623b('0x32')],_0x18de79[_0x623b('0x2f')]);_0x1936eb[_0x623b('0x33')]=_[_0x623b('0x34')](_0x18de79[_0x623b('0x32')],qs[_0x623b('0x45')](_0x921663[_0x623b('0x2f')][_0x623b('0x45')]));_0x1936eb['attributes']=_0x1936eb[_0x623b('0x33')][_0x623b('0x35')]?_0x1936eb[_0x623b('0x33')]:_0x18de79[_0x623b('0x32')];if(_0x921663[_0x623b('0x2f')][_0x623b('0x3f')]){_0x1936eb[_0x623b('0x40')]=[{'all':!![]}];}_0x1936eb=_[_0x623b('0x3b')]({},_0x1936eb,_0x921663['options']);return db[_0x623b('0x29')][_0x623b('0x46')](_0x1936eb)[_0x623b('0x22')](handleEntityNotFound(_0x4452db,null))['then'](respondWithResult(_0x4452db,null))['catch'](handleError(_0x4452db,null));};exports[_0x623b('0x47')]=function(_0x16eaa9,_0x281aa1){return db[_0x623b('0x29')][_0x623b('0x47')](_0x16eaa9[_0x623b('0x48')],{})[_0x623b('0x22')](respondWithResult(_0x281aa1,0xc9))['catch'](handleError(_0x281aa1,null));};exports['update']=function(_0x28ba1e,_0x556344){if(_0x28ba1e[_0x623b('0x48')]['id']){delete _0x28ba1e[_0x623b('0x48')]['id'];}return db[_0x623b('0x29')]['find']({'where':{'id':_0x28ba1e[_0x623b('0x44')]['id']}})['then'](handleEntityNotFound(_0x556344,null))[_0x623b('0x22')](saveUpdates(_0x28ba1e['body'],null))['then'](respondWithResult(_0x556344,null))['catch'](handleError(_0x556344,null));};exports['destroy']=function(_0x115274,_0x290430){return db[_0x623b('0x29')]['find']({'where':{'id':_0x115274[_0x623b('0x44')]['id']}})[_0x623b('0x22')](handleEntityNotFound(_0x290430,null))[_0x623b('0x22')](removeEntity(_0x290430,null))[_0x623b('0x43')](handleError(_0x290430,null));};exports[_0x623b('0x49')]=function(_0x5d39a8,_0x53d877,_0x54f4a8){var _0x247579={};var _0x2e62b8={};var _0x193bd0;var _0x1b0b58;return db[_0x623b('0x29')][_0x623b('0x4a')]({'where':{'id':_0x5d39a8['params']['id']}})[_0x623b('0x22')](handleEntityNotFound(_0x53d877,null))[_0x623b('0x22')](function(_0x1bdadb){if(_0x1bdadb){_0x193bd0=_0x1bdadb;_0x2e62b8[_0x623b('0x32')]=_[_0x623b('0x30')](db[_0x623b('0x4b')][_0x623b('0x2a')]);_0x2e62b8['query']=_[_0x623b('0x30')](_0x5d39a8[_0x623b('0x2f')]);_0x2e62b8['filters']=_[_0x623b('0x34')](_0x2e62b8['model'],_0x2e62b8['query']);_0x247579[_0x623b('0x33')]=_[_0x623b('0x34')](_0x2e62b8['model'],qs[_0x623b('0x45')](_0x5d39a8[_0x623b('0x2f')][_0x623b('0x45')]));_0x247579['attributes']=_0x247579['attributes'][_0x623b('0x35')]?_0x247579[_0x623b('0x33')]:_0x2e62b8[_0x623b('0x32')];_0x247579[_0x623b('0x4c')]=qs['sort'](_0x5d39a8['query'][_0x623b('0x38')]);_0x247579['where']=qs[_0x623b('0x31')](_[_0x623b('0x3a')](_0x5d39a8[_0x623b('0x2f')],_0x2e62b8[_0x623b('0x31')]));if(_0x5d39a8[_0x623b('0x2f')][_0x623b('0x3d')]){_0x247579[_0x623b('0x39')]=_['merge'](_0x247579[_0x623b('0x39')],{'$or':_[_0x623b('0x2e')](_0x247579[_0x623b('0x33')],function(_0x45f0c6){var _0x289470={};_0x289470[_0x45f0c6]={'$like':'%'+_0x5d39a8[_0x623b('0x2f')][_0x623b('0x3d')]+'%'};return _0x289470;})});}_0x247579=_[_0x623b('0x3b')]({},_0x247579,_0x5d39a8[_0x623b('0x3e')]);return _0x193bd0['getFields'](_0x247579);}})[_0x623b('0x22')](function(_0x2091ab){if(_0x2091ab){_0x1b0b58=_0x2091ab['length'];if(!_0x5d39a8[_0x623b('0x2f')][_0x623b('0x36')](_0x623b('0x37'))){_0x247579['limit']=qs[_0x623b('0x1c')](_0x5d39a8[_0x623b('0x2f')]['limit']);_0x247579[_0x623b('0x1e')]=qs[_0x623b('0x1e')](_0x5d39a8[_0x623b('0x2f')][_0x623b('0x1e')]);}return _0x193bd0[_0x623b('0x49')](_0x247579);}})['then'](function(_0x164be3){if(_0x164be3){return _0x164be3?{'count':_0x1b0b58,'rows':_0x164be3}:null;}})[_0x623b('0x22')](respondWithResult(_0x53d877,null))['catch'](handleError(_0x53d877,null));};exports[_0x623b('0x4d')]=function(_0xe5d8c8,_0x589587,_0x337cc2){var _0xaf2c2a={};var _0x1bd71b={};var _0x7be295;var _0x3a3def;return db['ServicenowConfiguration'][_0x623b('0x4a')]({'where':{'id':_0xe5d8c8[_0x623b('0x44')]['id']}})['then'](handleEntityNotFound(_0x589587,null))[_0x623b('0x22')](function(_0x28ff3b){if(_0x28ff3b){_0x7be295=_0x28ff3b;_0x1bd71b[_0x623b('0x32')]=_[_0x623b('0x30')](db[_0x623b('0x4b')]['rawAttributes']);_0x1bd71b['query']=_['keys'](_0xe5d8c8[_0x623b('0x2f')]);_0x1bd71b[_0x623b('0x31')]=_['intersection'](_0x1bd71b[_0x623b('0x32')],_0x1bd71b[_0x623b('0x2f')]);_0xaf2c2a['attributes']=_[_0x623b('0x34')](_0x1bd71b[_0x623b('0x32')],qs[_0x623b('0x45')](_0xe5d8c8[_0x623b('0x2f')]['fields']));_0xaf2c2a['attributes']=_0xaf2c2a[_0x623b('0x33')]['length']?_0xaf2c2a[_0x623b('0x33')]:_0x1bd71b['model'];_0xaf2c2a[_0x623b('0x4c')]=qs[_0x623b('0x38')](_0xe5d8c8['query'][_0x623b('0x38')]);_0xaf2c2a[_0x623b('0x39')]=qs[_0x623b('0x31')](_[_0x623b('0x3a')](_0xe5d8c8[_0x623b('0x2f')],_0x1bd71b[_0x623b('0x31')]));if(_0xe5d8c8['query'][_0x623b('0x3d')]){_0xaf2c2a[_0x623b('0x39')]=_[_0x623b('0x3b')](_0xaf2c2a[_0x623b('0x39')],{'$or':_['map'](_0xaf2c2a[_0x623b('0x33')],function(_0x42e1ed){var _0x3eff8c={};_0x3eff8c[_0x42e1ed]={'$like':'%'+_0xe5d8c8[_0x623b('0x2f')]['filter']+'%'};return _0x3eff8c;})});}_0xaf2c2a=_[_0x623b('0x3b')]({},_0xaf2c2a,_0xe5d8c8[_0x623b('0x3e')]);return _0x7be295[_0x623b('0x4d')](_0xaf2c2a);}})[_0x623b('0x22')](function(_0x8a9063){if(_0x8a9063){_0x3a3def=_0x8a9063[_0x623b('0x35')];if(!_0xe5d8c8['query'][_0x623b('0x36')]('nolimit')){_0xaf2c2a['limit']=qs['limit'](_0xe5d8c8[_0x623b('0x2f')][_0x623b('0x1c')]);_0xaf2c2a[_0x623b('0x1e')]=qs['offset'](_0xe5d8c8[_0x623b('0x2f')][_0x623b('0x1e')]);}return _0x7be295['getSubjects'](_0xaf2c2a);}})[_0x623b('0x22')](function(_0x19a28f){if(_0x19a28f){return _0x19a28f?{'count':_0x3a3def,'rows':_0x19a28f}:null;}})['then'](respondWithResult(_0x589587,null))[_0x623b('0x43')](handleError(_0x589587,null));};exports[_0x623b('0x4e')]=function(_0x4a6fd9,_0x24605c,_0x23fe1d){var _0x50ce66={};var _0x3f64f5={};var _0x459d0a;var _0x4b764c;return db['ServicenowConfiguration'][_0x623b('0x4a')]({'where':{'id':_0x4a6fd9[_0x623b('0x44')]['id']}})['then'](handleEntityNotFound(_0x24605c,null))[_0x623b('0x22')](function(_0x31ab54){if(_0x31ab54){_0x459d0a=_0x31ab54;_0x3f64f5['model']=_[_0x623b('0x30')](db[_0x623b('0x4b')][_0x623b('0x2a')]);_0x3f64f5[_0x623b('0x2f')]=_['keys'](_0x4a6fd9[_0x623b('0x2f')]);_0x3f64f5[_0x623b('0x31')]=_[_0x623b('0x34')](_0x3f64f5['model'],_0x3f64f5[_0x623b('0x2f')]);_0x50ce66['attributes']=_[_0x623b('0x34')](_0x3f64f5[_0x623b('0x32')],qs['fields'](_0x4a6fd9[_0x623b('0x2f')]['fields']));_0x50ce66[_0x623b('0x33')]=_0x50ce66['attributes'][_0x623b('0x35')]?_0x50ce66[_0x623b('0x33')]:_0x3f64f5[_0x623b('0x32')];_0x50ce66[_0x623b('0x4c')]=qs[_0x623b('0x38')](_0x4a6fd9[_0x623b('0x2f')]['sort']);_0x50ce66[_0x623b('0x39')]=qs['filters'](_[_0x623b('0x3a')](_0x4a6fd9[_0x623b('0x2f')],_0x3f64f5[_0x623b('0x31')]));if(_0x4a6fd9['query'][_0x623b('0x3d')]){_0x50ce66[_0x623b('0x39')]=_['merge'](_0x50ce66[_0x623b('0x39')],{'$or':_['map'](_0x50ce66[_0x623b('0x33')],function(_0x3b1ab2){var _0x222fc3={};_0x222fc3[_0x3b1ab2]={'$like':'%'+_0x4a6fd9[_0x623b('0x2f')][_0x623b('0x3d')]+'%'};return _0x222fc3;})});}_0x50ce66=_['merge']({},_0x50ce66,_0x4a6fd9[_0x623b('0x3e')]);return _0x459d0a[_0x623b('0x4e')](_0x50ce66);}})[_0x623b('0x22')](function(_0x1cc319){if(_0x1cc319){_0x4b764c=_0x1cc319[_0x623b('0x35')];if(!_0x4a6fd9[_0x623b('0x2f')]['hasOwnProperty'](_0x623b('0x37'))){_0x50ce66['limit']=qs['limit'](_0x4a6fd9[_0x623b('0x2f')]['limit']);_0x50ce66['offset']=qs[_0x623b('0x1e')](_0x4a6fd9['query']['offset']);}return _0x459d0a[_0x623b('0x4e')](_0x50ce66);}})[_0x623b('0x22')](function(_0x58e68d){if(_0x58e68d){return _0x58e68d?{'count':_0x4b764c,'rows':_0x58e68d}:null;}})[_0x623b('0x22')](respondWithResult(_0x24605c,null))[_0x623b('0x43')](handleError(_0x24605c,null));}; \ No newline at end of file +var _0x1862=['include','catch','create','body','getFields','findOne','ServicenowField','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','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','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','rows','show','params','keys'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1862,0x195));var _0x2186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1862[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2186('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2186('0x1'));var jsonpatch=require(_0x2186('0x2'));var rp=require(_0x2186('0x3'));var moment=require(_0x2186('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2186('0x5'));var util=require('util');var path=require(_0x2186('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2186('0x7'));var fs=require('fs');var fs_extra=require(_0x2186('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2186('0x9'));var deskjs=require(_0x2186('0xa'));var toCsv=require(_0x2186('0xb'));var querystring=require(_0x2186('0xc'));var Papa=require(_0x2186('0xd'));var Redis=require(_0x2186('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2186('0xf'));var as=require(_0x2186('0x10'));var hardwareService=require(_0x2186('0x11'));var logger=require(_0x2186('0x12'))(_0x2186('0x13'));var utils=require(_0x2186('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2186('0x15'));var db=require(_0x2186('0x16'))['db'];function respondWithStatusCode(_0xb0f653,_0xbcd6d0){_0xbcd6d0=_0xbcd6d0||0xcc;return function(_0x7aaa44){if(_0x7aaa44){return _0xb0f653[_0x2186('0x17')](_0xbcd6d0);}return _0xb0f653['status'](_0xbcd6d0)[_0x2186('0x18')]();};}function respondWithResult(_0x371c79,_0x3c1c44){_0x3c1c44=_0x3c1c44||0xc8;return function(_0x58f22b){if(_0x58f22b){return _0x371c79[_0x2186('0x19')](_0x3c1c44)[_0x2186('0x1a')](_0x58f22b);}};}function respondWithFilteredResult(_0x3273e1,_0x21c818){return function(_0x1de000){if(_0x1de000){var _0x592fa0=typeof _0x21c818[_0x2186('0x1b')]===_0x2186('0x1c')&&typeof _0x21c818[_0x2186('0x1d')]===_0x2186('0x1c');var _0x493a2a=_0x1de000[_0x2186('0x1e')];var _0x5d5fae=_0x592fa0?0x0:_0x21c818[_0x2186('0x1b')];var _0x350148=_0x592fa0?_0x1de000[_0x2186('0x1e')]:_0x21c818['offset']+_0x21c818[_0x2186('0x1d')];var _0x7e6f79;if(_0x350148>=_0x493a2a){_0x350148=_0x493a2a;_0x7e6f79=0xc8;}else{_0x7e6f79=0xce;}_0x3273e1[_0x2186('0x19')](_0x7e6f79);return _0x3273e1[_0x2186('0x1f')](_0x2186('0x20'),_0x5d5fae+'-'+_0x350148+'/'+_0x493a2a)[_0x2186('0x1a')](_0x1de000);}return null;};}function patchUpdates(_0x57152e){return function(_0x4be5cb){try{jsonpatch[_0x2186('0x21')](_0x4be5cb,_0x57152e,!![]);}catch(_0x544b70){return BPromise[_0x2186('0x22')](_0x544b70);}return _0x4be5cb[_0x2186('0x23')]();};}function saveUpdates(_0x4d18bb,_0x3af838){return function(_0x21cca1){if(_0x21cca1){return _0x21cca1[_0x2186('0x24')](_0x4d18bb)[_0x2186('0x25')](function(_0x5e86a7){return _0x5e86a7;});}return null;};}function removeEntity(_0x210b56,_0x5c1601){return function(_0x2adbd7){if(_0x2adbd7){return _0x2adbd7[_0x2186('0x26')]()['then'](function(){_0x210b56[_0x2186('0x19')](0xcc)[_0x2186('0x18')]();});}};}function handleEntityNotFound(_0x25f703,_0x3e8507){return function(_0x46e478){if(!_0x46e478){_0x25f703['sendStatus'](0x194);}return _0x46e478;};}function handleError(_0x52df2a,_0xe83320){_0xe83320=_0xe83320||0x1f4;return function(_0x3307e2){logger[_0x2186('0x27')](_0x3307e2[_0x2186('0x28')]);if(_0x3307e2[_0x2186('0x29')]){delete _0x3307e2['name'];}_0x52df2a['status'](_0xe83320)[_0x2186('0x2a')](_0x3307e2);};}exports[_0x2186('0x2b')]=function(_0x3b45dd,_0xe9a174){var _0x234fbd={},_0x29813c={},_0x347f73={'count':0x0,'rows':[]};var _0x3eeb3b=_[_0x2186('0x2c')](db[_0x2186('0x2d')][_0x2186('0x2e')],function(_0x3e9d11){return{'name':_0x3e9d11[_0x2186('0x2f')],'type':_0x3e9d11[_0x2186('0x30')]['key']};});_0x29813c[_0x2186('0x31')]=_['map'](_0x3eeb3b,_0x2186('0x29'));_0x29813c['query']=_['keys'](_0x3b45dd[_0x2186('0x32')]);_0x29813c[_0x2186('0x33')]=_[_0x2186('0x34')](_0x29813c[_0x2186('0x31')],_0x29813c[_0x2186('0x32')]);_0x234fbd[_0x2186('0x35')]=_[_0x2186('0x34')](_0x29813c[_0x2186('0x31')],qs[_0x2186('0x36')](_0x3b45dd[_0x2186('0x32')][_0x2186('0x36')]));_0x234fbd['attributes']=_0x234fbd[_0x2186('0x35')][_0x2186('0x37')]?_0x234fbd['attributes']:_0x29813c[_0x2186('0x31')];if(!_0x3b45dd[_0x2186('0x32')][_0x2186('0x38')]('nolimit')){_0x234fbd[_0x2186('0x1d')]=qs['limit'](_0x3b45dd['query'][_0x2186('0x1d')]);_0x234fbd[_0x2186('0x1b')]=qs['offset'](_0x3b45dd[_0x2186('0x32')][_0x2186('0x1b')]);}_0x234fbd[_0x2186('0x39')]=qs[_0x2186('0x3a')](_0x3b45dd[_0x2186('0x32')][_0x2186('0x3a')]);_0x234fbd[_0x2186('0x3b')]=qs[_0x2186('0x33')](_[_0x2186('0x3c')](_0x3b45dd[_0x2186('0x32')],_0x29813c['filters']),_0x3eeb3b);if(_0x3b45dd[_0x2186('0x32')][_0x2186('0x3d')]){_0x234fbd[_0x2186('0x3b')]=_[_0x2186('0x3e')](_0x234fbd[_0x2186('0x3b')],{'$or':_[_0x2186('0x2c')](_0x3eeb3b,function(_0x8bde36){if(_0x8bde36[_0x2186('0x30')]!=='VIRTUAL'){var _0x777343={};_0x777343[_0x8bde36[_0x2186('0x29')]]={'$like':'%'+_0x3b45dd[_0x2186('0x32')][_0x2186('0x3d')]+'%'};return _0x777343;}})});}_0x234fbd=_[_0x2186('0x3e')]({},_0x234fbd,_0x3b45dd[_0x2186('0x3f')]);var _0x2528ce={'where':_0x234fbd[_0x2186('0x3b')]};return db['ServicenowConfiguration'][_0x2186('0x1e')](_0x2528ce)[_0x2186('0x25')](function(_0x5e485c){_0x347f73[_0x2186('0x1e')]=_0x5e485c;if(_0x3b45dd['query'][_0x2186('0x40')]){_0x234fbd['include']=[{'all':!![]}];}return db[_0x2186('0x2d')]['findAll'](_0x234fbd);})[_0x2186('0x25')](function(_0x5ae8eb){_0x347f73[_0x2186('0x41')]=_0x5ae8eb;return _0x347f73;})['then'](respondWithFilteredResult(_0xe9a174,_0x234fbd))['catch'](handleError(_0xe9a174,null));};exports[_0x2186('0x42')]=function(_0x128d5b,_0x501784){var _0x21e37b={'raw':![],'where':{'id':_0x128d5b[_0x2186('0x43')]['id']}},_0x4cf2ed={};_0x4cf2ed[_0x2186('0x31')]=_[_0x2186('0x44')](db[_0x2186('0x2d')]['rawAttributes']);_0x4cf2ed[_0x2186('0x32')]=_[_0x2186('0x44')](_0x128d5b[_0x2186('0x32')]);_0x4cf2ed[_0x2186('0x33')]=_['intersection'](_0x4cf2ed['model'],_0x4cf2ed[_0x2186('0x32')]);_0x21e37b[_0x2186('0x35')]=_[_0x2186('0x34')](_0x4cf2ed[_0x2186('0x31')],qs[_0x2186('0x36')](_0x128d5b[_0x2186('0x32')][_0x2186('0x36')]));_0x21e37b['attributes']=_0x21e37b['attributes']['length']?_0x21e37b[_0x2186('0x35')]:_0x4cf2ed[_0x2186('0x31')];if(_0x128d5b[_0x2186('0x32')][_0x2186('0x40')]){_0x21e37b[_0x2186('0x45')]=[{'all':!![]}];}_0x21e37b=_[_0x2186('0x3e')]({},_0x21e37b,_0x128d5b[_0x2186('0x3f')]);return db['ServicenowConfiguration']['find'](_0x21e37b)[_0x2186('0x25')](handleEntityNotFound(_0x501784,null))[_0x2186('0x25')](respondWithResult(_0x501784,null))[_0x2186('0x46')](handleError(_0x501784,null));};exports[_0x2186('0x47')]=function(_0x1850be,_0x59a063){return db[_0x2186('0x2d')][_0x2186('0x47')](_0x1850be[_0x2186('0x48')],{})['then'](respondWithResult(_0x59a063,0xc9))[_0x2186('0x46')](handleError(_0x59a063,null));};exports[_0x2186('0x24')]=function(_0x2cdcf1,_0x51ce27){if(_0x2cdcf1[_0x2186('0x48')]['id']){delete _0x2cdcf1[_0x2186('0x48')]['id'];}return db[_0x2186('0x2d')]['find']({'where':{'id':_0x2cdcf1[_0x2186('0x43')]['id']}})[_0x2186('0x25')](handleEntityNotFound(_0x51ce27,null))[_0x2186('0x25')](saveUpdates(_0x2cdcf1['body'],null))['then'](respondWithResult(_0x51ce27,null))['catch'](handleError(_0x51ce27,null));};exports[_0x2186('0x26')]=function(_0x536d1e,_0x30dc0c){return db[_0x2186('0x2d')]['find']({'where':{'id':_0x536d1e[_0x2186('0x43')]['id']}})['then'](handleEntityNotFound(_0x30dc0c,null))[_0x2186('0x25')](removeEntity(_0x30dc0c,null))['catch'](handleError(_0x30dc0c,null));};exports[_0x2186('0x49')]=function(_0x26262c,_0x589af1,_0x1090d6){var _0x269a00={};var _0x1256b8={};var _0x29ec31;var _0x1eb6d0;return db[_0x2186('0x2d')][_0x2186('0x4a')]({'where':{'id':_0x26262c[_0x2186('0x43')]['id']}})[_0x2186('0x25')](handleEntityNotFound(_0x589af1,null))['then'](function(_0x51d27b){if(_0x51d27b){_0x29ec31=_0x51d27b;_0x1256b8['model']=_[_0x2186('0x44')](db[_0x2186('0x4b')][_0x2186('0x2e')]);_0x1256b8[_0x2186('0x32')]=_[_0x2186('0x44')](_0x26262c[_0x2186('0x32')]);_0x1256b8['filters']=_[_0x2186('0x34')](_0x1256b8[_0x2186('0x31')],_0x1256b8['query']);_0x269a00[_0x2186('0x35')]=_[_0x2186('0x34')](_0x1256b8[_0x2186('0x31')],qs[_0x2186('0x36')](_0x26262c[_0x2186('0x32')][_0x2186('0x36')]));_0x269a00[_0x2186('0x35')]=_0x269a00[_0x2186('0x35')]['length']?_0x269a00[_0x2186('0x35')]:_0x1256b8[_0x2186('0x31')];_0x269a00[_0x2186('0x39')]=qs[_0x2186('0x3a')](_0x26262c[_0x2186('0x32')][_0x2186('0x3a')]);_0x269a00['where']=qs[_0x2186('0x33')](_[_0x2186('0x3c')](_0x26262c[_0x2186('0x32')],_0x1256b8[_0x2186('0x33')]));if(_0x26262c[_0x2186('0x32')][_0x2186('0x3d')]){_0x269a00['where']=_[_0x2186('0x3e')](_0x269a00[_0x2186('0x3b')],{'$or':_[_0x2186('0x2c')](_0x269a00[_0x2186('0x35')],function(_0x89daa7){var _0x1c5e35={};_0x1c5e35[_0x89daa7]={'$like':'%'+_0x26262c['query']['filter']+'%'};return _0x1c5e35;})});}_0x269a00=_[_0x2186('0x3e')]({},_0x269a00,_0x26262c[_0x2186('0x3f')]);return _0x29ec31[_0x2186('0x49')](_0x269a00);}})['then'](function(_0x2416c0){if(_0x2416c0){_0x1eb6d0=_0x2416c0[_0x2186('0x37')];if(!_0x26262c[_0x2186('0x32')][_0x2186('0x38')](_0x2186('0x4c'))){_0x269a00['limit']=qs['limit'](_0x26262c[_0x2186('0x32')][_0x2186('0x1d')]);_0x269a00[_0x2186('0x1b')]=qs[_0x2186('0x1b')](_0x26262c[_0x2186('0x32')][_0x2186('0x1b')]);}return _0x29ec31[_0x2186('0x49')](_0x269a00);}})[_0x2186('0x25')](function(_0x5116bf){if(_0x5116bf){return _0x5116bf?{'count':_0x1eb6d0,'rows':_0x5116bf}:null;}})['then'](respondWithResult(_0x589af1,null))['catch'](handleError(_0x589af1,null));};exports['getSubjects']=function(_0x59403e,_0x3d47a2,_0x18da61){var _0x46339b={};var _0x74e2f0={};var _0xe01e45;var _0x5039c8;return db[_0x2186('0x2d')][_0x2186('0x4a')]({'where':{'id':_0x59403e[_0x2186('0x43')]['id']}})[_0x2186('0x25')](handleEntityNotFound(_0x3d47a2,null))[_0x2186('0x25')](function(_0x14510f){if(_0x14510f){_0xe01e45=_0x14510f;_0x74e2f0['model']=_[_0x2186('0x44')](db[_0x2186('0x4b')][_0x2186('0x2e')]);_0x74e2f0[_0x2186('0x32')]=_[_0x2186('0x44')](_0x59403e[_0x2186('0x32')]);_0x74e2f0[_0x2186('0x33')]=_[_0x2186('0x34')](_0x74e2f0['model'],_0x74e2f0[_0x2186('0x32')]);_0x46339b['attributes']=_[_0x2186('0x34')](_0x74e2f0['model'],qs['fields'](_0x59403e[_0x2186('0x32')][_0x2186('0x36')]));_0x46339b['attributes']=_0x46339b[_0x2186('0x35')][_0x2186('0x37')]?_0x46339b[_0x2186('0x35')]:_0x74e2f0[_0x2186('0x31')];_0x46339b[_0x2186('0x39')]=qs[_0x2186('0x3a')](_0x59403e[_0x2186('0x32')]['sort']);_0x46339b['where']=qs['filters'](_[_0x2186('0x3c')](_0x59403e['query'],_0x74e2f0[_0x2186('0x33')]));if(_0x59403e[_0x2186('0x32')][_0x2186('0x3d')]){_0x46339b['where']=_[_0x2186('0x3e')](_0x46339b[_0x2186('0x3b')],{'$or':_['map'](_0x46339b[_0x2186('0x35')],function(_0x11c875){var _0x3ea02e={};_0x3ea02e[_0x11c875]={'$like':'%'+_0x59403e['query'][_0x2186('0x3d')]+'%'};return _0x3ea02e;})});}_0x46339b=_[_0x2186('0x3e')]({},_0x46339b,_0x59403e[_0x2186('0x3f')]);return _0xe01e45[_0x2186('0x4d')](_0x46339b);}})['then'](function(_0x4a4f26){if(_0x4a4f26){_0x5039c8=_0x4a4f26[_0x2186('0x37')];if(!_0x59403e['query'][_0x2186('0x38')](_0x2186('0x4c'))){_0x46339b[_0x2186('0x1d')]=qs[_0x2186('0x1d')](_0x59403e[_0x2186('0x32')][_0x2186('0x1d')]);_0x46339b[_0x2186('0x1b')]=qs[_0x2186('0x1b')](_0x59403e[_0x2186('0x32')][_0x2186('0x1b')]);}return _0xe01e45[_0x2186('0x4d')](_0x46339b);}})[_0x2186('0x25')](function(_0x5cd015){if(_0x5cd015){return _0x5cd015?{'count':_0x5039c8,'rows':_0x5cd015}:null;}})[_0x2186('0x25')](respondWithResult(_0x3d47a2,null))[_0x2186('0x46')](handleError(_0x3d47a2,null));};exports[_0x2186('0x4e')]=function(_0xb4d7d3,_0x521027,_0x36d295){var _0x25cf86={};var _0x347688={};var _0xa92909;var _0x30761f;return db['ServicenowConfiguration'][_0x2186('0x4a')]({'where':{'id':_0xb4d7d3['params']['id']}})[_0x2186('0x25')](handleEntityNotFound(_0x521027,null))[_0x2186('0x25')](function(_0x571684){if(_0x571684){_0xa92909=_0x571684;_0x347688[_0x2186('0x31')]=_[_0x2186('0x44')](db[_0x2186('0x4b')]['rawAttributes']);_0x347688[_0x2186('0x32')]=_[_0x2186('0x44')](_0xb4d7d3[_0x2186('0x32')]);_0x347688[_0x2186('0x33')]=_[_0x2186('0x34')](_0x347688[_0x2186('0x31')],_0x347688[_0x2186('0x32')]);_0x25cf86['attributes']=_[_0x2186('0x34')](_0x347688['model'],qs[_0x2186('0x36')](_0xb4d7d3[_0x2186('0x32')][_0x2186('0x36')]));_0x25cf86[_0x2186('0x35')]=_0x25cf86[_0x2186('0x35')][_0x2186('0x37')]?_0x25cf86[_0x2186('0x35')]:_0x347688[_0x2186('0x31')];_0x25cf86[_0x2186('0x39')]=qs[_0x2186('0x3a')](_0xb4d7d3[_0x2186('0x32')][_0x2186('0x3a')]);_0x25cf86[_0x2186('0x3b')]=qs['filters'](_[_0x2186('0x3c')](_0xb4d7d3[_0x2186('0x32')],_0x347688[_0x2186('0x33')]));if(_0xb4d7d3[_0x2186('0x32')][_0x2186('0x3d')]){_0x25cf86['where']=_['merge'](_0x25cf86['where'],{'$or':_[_0x2186('0x2c')](_0x25cf86['attributes'],function(_0x134f8c){var _0x2a49b6={};_0x2a49b6[_0x134f8c]={'$like':'%'+_0xb4d7d3[_0x2186('0x32')][_0x2186('0x3d')]+'%'};return _0x2a49b6;})});}_0x25cf86=_[_0x2186('0x3e')]({},_0x25cf86,_0xb4d7d3[_0x2186('0x3f')]);return _0xa92909[_0x2186('0x4e')](_0x25cf86);}})[_0x2186('0x25')](function(_0x371586){if(_0x371586){_0x30761f=_0x371586[_0x2186('0x37')];if(!_0xb4d7d3[_0x2186('0x32')][_0x2186('0x38')](_0x2186('0x4c'))){_0x25cf86[_0x2186('0x1d')]=qs['limit'](_0xb4d7d3[_0x2186('0x32')][_0x2186('0x1d')]);_0x25cf86['offset']=qs[_0x2186('0x1b')](_0xb4d7d3['query'][_0x2186('0x1b')]);}return _0xa92909[_0x2186('0x4e')](_0x25cf86);}})[_0x2186('0x25')](function(_0x5148ac){if(_0x5148ac){return _0x5148ac?{'count':_0x30761f,'rows':_0x5148ac}:null;}})['then'](respondWithResult(_0x521027,null))[_0x2186('0x46')](handleError(_0x521027,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index d73e5fc..d2772d7 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 _0x726f=['../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','api','request-promise','path','rimraf'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x726f,0xa2));var _0xf726=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x726f[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xf726('0x0'));var util=require(_0xf726('0x1'));var logger=require('../../config/logger')(_0xf726('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf726('0x3'));var fs=require('fs');var path=require(_0xf726('0x4'));var rimraf=require(_0xf726('0x5'));var config=require(_0xf726('0x6'));var attributes=require(_0xf726('0x7'));module[_0xf726('0x8')]=function(_0x26ba00,_0x1cae3f){return _0x26ba00[_0xf726('0x9')](_0xf726('0xa'),attributes,{'tableName':_0xf726('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c91=['int_servicenow_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','exports'];(function(_0x3c18c6,_0x12c258){var _0x37207e=function(_0x40b2f8){while(--_0x40b2f8){_0x3c18c6['push'](_0x3c18c6['shift']());}};_0x37207e(++_0x12c258);}(_0x3c91,0x1af));var _0x13c9=function(_0x3a8a34,_0x33825c){_0x3a8a34=_0x3a8a34-0x0;var _0x13791b=_0x3c91[_0x3a8a34];return _0x13791b;};'use strict';var _=require(_0x13c9('0x0'));var util=require(_0x13c9('0x1'));var logger=require(_0x13c9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x13c9('0x3'));var rp=require(_0x13c9('0x4'));var fs=require('fs');var path=require(_0x13c9('0x5'));var rimraf=require('rimraf');var config=require(_0x13c9('0x6'));var attributes=require(_0x13c9('0x7'));module[_0x13c9('0x8')]=function(_0x8eedb,_0x1c6771){return _0x8eedb['define']('ServicenowConfiguration',attributes,{'tableName':_0x13c9('0x9'),'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 18bd151..097ad0b 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 _0x4af8=['ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4af8,0x81));var _0x84af=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x4af8[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0x84af('0x0'));var util=require(_0x84af('0x1'));var moment=require(_0x84af('0x2'));var BPromise=require(_0x84af('0x3'));var rs=require(_0x84af('0x4'));var fs=require('fs');var Redis=require(_0x84af('0x5'));var db=require(_0x84af('0x6'))['db'];var utils=require(_0x84af('0x7'));var logger=require(_0x84af('0x8'))('rpc');var config=require(_0x84af('0x9'));var jayson=require(_0x84af('0xa'));var client=jayson[_0x84af('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51550b,_0x585e91,_0x53acf9){return new BPromise(function(_0x147524,_0x3676a0){return client[_0x84af('0xc')](_0x51550b,_0x53acf9)[_0x84af('0xd')](function(_0x5261c4){logger[_0x84af('0xe')](_0x84af('0xf'),_0x585e91,_0x84af('0x10'));logger[_0x84af('0x11')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x585e91,_0x84af('0x10'),JSON[_0x84af('0x12')](_0x5261c4));if(_0x5261c4[_0x84af('0x13')]){if(_0x5261c4[_0x84af('0x13')][_0x84af('0x14')]===0x1f4){logger['error'](_0x84af('0xf'),_0x585e91,_0x5261c4[_0x84af('0x13')][_0x84af('0x15')]);return _0x3676a0(_0x5261c4[_0x84af('0x13')][_0x84af('0x15')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x585e91,_0x5261c4[_0x84af('0x13')][_0x84af('0x15')]);return _0x147524(_0x5261c4[_0x84af('0x13')][_0x84af('0x15')]);}else{logger[_0x84af('0xe')](_0x84af('0xf'),_0x585e91,_0x84af('0x10'));_0x147524(_0x5261c4[_0x84af('0x16')][_0x84af('0x15')]);}})[_0x84af('0x17')](function(_0x566f36){logger['error'](_0x84af('0xf'),_0x585e91,_0x566f36);_0x3676a0(_0x566f36);});});} \ No newline at end of file +var _0xcaf2=['bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment'];(function(_0x3ec9d8,_0xbdfef8){var _0x3a25ae=function(_0x4eace0){while(--_0x4eace0){_0x3ec9d8['push'](_0x3ec9d8['shift']());}};_0x3a25ae(++_0xbdfef8);}(_0xcaf2,0x8a));var _0x2caf=function(_0x3d6d80,_0x1689b7){_0x3d6d80=_0x3d6d80-0x0;var _0x30712a=_0xcaf2[_0x3d6d80];return _0x30712a;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var moment=require(_0x2caf('0x1'));var BPromise=require(_0x2caf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2caf('0x3'));var db=require(_0x2caf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2caf('0x5'))('rpc');var config=require(_0x2caf('0x6'));var jayson=require(_0x2caf('0x7'));var client=jayson[_0x2caf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc44e4e,_0x314486,_0x4667c6){return new BPromise(function(_0x34e792,_0x5611aa){return client[_0x2caf('0x9')](_0xc44e4e,_0x4667c6)[_0x2caf('0xa')](function(_0x45e520){logger[_0x2caf('0xb')](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));logger[_0x2caf('0xe')](_0x2caf('0xf'),_0x314486,_0x2caf('0xd'),JSON['stringify'](_0x45e520));if(_0x45e520[_0x2caf('0x10')]){if(_0x45e520[_0x2caf('0x10')][_0x2caf('0x11')]===0x1f4){logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520[_0x2caf('0x10')][_0x2caf('0x12')]);return _0x5611aa(_0x45e520[_0x2caf('0x10')]['message']);}logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520['error']['message']);return _0x34e792(_0x45e520['error'][_0x2caf('0x12')]);}else{logger['info'](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));_0x34e792(_0x45e520[_0x2caf('0x13')][_0x2caf('0x12')]);}})['catch'](function(_0x184355){logger['error'](_0x2caf('0xc'),_0x314486,_0x184355);_0x5611aa(_0x184355);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 4f61616..66a7f2e 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 _0xbbee=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','show','create','put','/:id','update'];(function(_0x1b129f,_0x6d1483){var _0x117f95=function(_0x445ad7){while(--_0x445ad7){_0x1b129f['push'](_0x1b129f['shift']());}};_0x117f95(++_0x6d1483);}(_0xbbee,0xde));var _0xebbe=function(_0x162769,_0xafc66c){_0x162769=_0x162769-0x0;var _0xff2e8e=_0xbbee[_0x162769];return _0xff2e8e;};'use strict';var multer=require(_0xebbe('0x0'));var util=require(_0xebbe('0x1'));var path=require(_0xebbe('0x2'));var timeout=require(_0xebbe('0x3'));var express=require(_0xebbe('0x4'));var router=express['Router']();var fs_extra=require(_0xebbe('0x5'));var auth=require(_0xebbe('0x6'));var interaction=require(_0xebbe('0x7'));var config=require(_0xebbe('0x8'));var controller=require(_0xebbe('0x9'));router[_0xebbe('0xa')]('/',auth[_0xebbe('0xb')](),controller[_0xebbe('0xc')]);router[_0xebbe('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xebbe('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xebbe('0xe')]);router[_0xebbe('0xf')](_0xebbe('0x10'),auth[_0xebbe('0xb')](),controller[_0xebbe('0x11')]);router['delete'](_0xebbe('0x10'),auth[_0xebbe('0xb')](),controller[_0xebbe('0x12')]);module[_0xebbe('0x13')]=router; \ No newline at end of file +var _0x9258=['create','update','delete','/:id','exports','util','path','connect-timeout','express','../../components/auth/service','./intServicenowField.controller','get','isAuthenticated','index','show','post'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9258,0xe5));var _0x8925=function(_0x2a0938,_0x1c8ef6){_0x2a0938=_0x2a0938-0x0;var _0x426cc8=_0x9258[_0x2a0938];return _0x426cc8;};'use strict';var multer=require('multer');var util=require(_0x8925('0x0'));var path=require(_0x8925('0x1'));var timeout=require(_0x8925('0x2'));var express=require(_0x8925('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8925('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8925('0x5'));router[_0x8925('0x6')]('/',auth[_0x8925('0x7')](),controller[_0x8925('0x8')]);router[_0x8925('0x6')]('/:id',auth[_0x8925('0x7')](),controller[_0x8925('0x9')]);router[_0x8925('0xa')]('/',auth[_0x8925('0x7')](),controller[_0x8925('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8925('0xc')]);router[_0x8925('0xd')](_0x8925('0xe'),auth[_0x8925('0x7')](),controller['destroy']);module[_0x8925('0xf')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 1eb3eb9..2331018 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 _0x0e64=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x331ce0,_0xe335b9){var _0x31c3c7=function(_0x2bf43c){while(--_0x2bf43c){_0x331ce0['push'](_0x331ce0['shift']());}};_0x31c3c7(++_0xe335b9);}(_0x0e64,0x164));var _0x40e6=function(_0x549fd4,_0x56010b){_0x549fd4=_0x549fd4-0x0;var _0x47baf2=_0x0e64[_0x549fd4];return _0x47baf2;};'use strict';var Sequelize=require(_0x40e6('0x0'));module[_0x40e6('0x1')]={'type':{'type':Sequelize[_0x40e6('0x2')](_0x40e6('0x3'),_0x40e6('0x4'),_0x40e6('0x5'),_0x40e6('0x6'),'picklist'),'defaultValue':_0x40e6('0x3')},'content':{'type':Sequelize[_0x40e6('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x40e6('0x3'),_0x40e6('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x40e6('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x40e6('0x7')]},'customField':{'type':Sequelize[_0x40e6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdffc=['customVariable','picklist','string','STRING','sequelize','exports','ENUM','variable'];(function(_0x483c0a,_0xcc3bc1){var _0x312228=function(_0x7c6585){while(--_0x7c6585){_0x483c0a['push'](_0x483c0a['shift']());}};_0x312228(++_0xcc3bc1);}(_0xdffc,0x154));var _0xcdff=function(_0x5bd8c0,_0x30f63c){_0x5bd8c0=_0x5bd8c0-0x0;var _0x32a565=_0xdffc[_0x5bd8c0];return _0x32a565;};'use strict';var Sequelize=require(_0xcdff('0x0'));module[_0xcdff('0x1')]={'type':{'type':Sequelize[_0xcdff('0x2')]('string',_0xcdff('0x3'),_0xcdff('0x4'),'keyValue',_0xcdff('0x5')),'defaultValue':_0xcdff('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xcdff('0x2')](_0xcdff('0x6'),_0xcdff('0x3'),_0xcdff('0x4'))},'keyContent':{'type':Sequelize[_0xcdff('0x7')]},'idField':{'type':Sequelize[_0xcdff('0x7')]},'nameField':{'type':Sequelize[_0xcdff('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcdff('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 627695d..2735019 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 _0x6acb=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','options','includeAll','findAll','catch','show','create','body','find','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1c4cf0,_0x300eb8){var _0x2c7a39=function(_0x2fa3c0){while(--_0x2fa3c0){_0x1c4cf0['push'](_0x1c4cf0['shift']());}};_0x2c7a39(++_0x300eb8);}(_0x6acb,0x116));var _0xb6ac=function(_0x3e5bc8,_0x457d89){_0x3e5bc8=_0x3e5bc8-0x0;var _0xfd84bc=_0x6acb[_0x3e5bc8];return _0xfd84bc;};'use strict';var emlformat=require(_0xb6ac('0x0'));var rimraf=require(_0xb6ac('0x1'));var zipdir=require(_0xb6ac('0x2'));var jsonpatch=require(_0xb6ac('0x3'));var rp=require(_0xb6ac('0x4'));var moment=require(_0xb6ac('0x5'));var BPromise=require(_0xb6ac('0x6'));var Mustache=require(_0xb6ac('0x7'));var util=require(_0xb6ac('0x8'));var path=require(_0xb6ac('0x9'));var sox=require('sox');var csv=require(_0xb6ac('0xa'));var ejs=require(_0xb6ac('0xb'));var fs=require('fs');var fs_extra=require(_0xb6ac('0xc'));var _=require(_0xb6ac('0xd'));var squel=require(_0xb6ac('0xe'));var crypto=require(_0xb6ac('0xf'));var jsforce=require(_0xb6ac('0x10'));var deskjs=require(_0xb6ac('0x11'));var toCsv=require('to-csv');var querystring=require(_0xb6ac('0x12'));var Papa=require(_0xb6ac('0x13'));var Redis=require(_0xb6ac('0x14'));var authService=require(_0xb6ac('0x15'));var qs=require(_0xb6ac('0x16'));var as=require(_0xb6ac('0x17'));var hardwareService=require(_0xb6ac('0x18'));var logger=require('../../config/logger')(_0xb6ac('0x19'));var utils=require('../../config/utils');var config=require(_0xb6ac('0x1a'));var licenseUtil=require(_0xb6ac('0x1b'));var db=require(_0xb6ac('0x1c'))['db'];function respondWithStatusCode(_0x18c57a,_0x31cc76){_0x31cc76=_0x31cc76||0xcc;return function(_0x1a49e3){if(_0x1a49e3){return _0x18c57a['sendStatus'](_0x31cc76);}return _0x18c57a[_0xb6ac('0x1d')](_0x31cc76)[_0xb6ac('0x1e')]();};}function respondWithResult(_0x450eac,_0x27f349){_0x27f349=_0x27f349||0xc8;return function(_0x21984c){if(_0x21984c){return _0x450eac['status'](_0x27f349)[_0xb6ac('0x1f')](_0x21984c);}};}function respondWithFilteredResult(_0x2d162b,_0x5900f1){return function(_0x4b0187){if(_0x4b0187){var _0x3c077f=typeof _0x5900f1[_0xb6ac('0x20')]===_0xb6ac('0x21')&&typeof _0x5900f1['limit']===_0xb6ac('0x21');var _0x1bfe90=_0x4b0187[_0xb6ac('0x22')];var _0xf6a3bc=_0x3c077f?0x0:_0x5900f1[_0xb6ac('0x20')];var _0x28a699=_0x3c077f?_0x4b0187['count']:_0x5900f1['offset']+_0x5900f1[_0xb6ac('0x23')];var _0x3a280e;if(_0x28a699>=_0x1bfe90){_0x28a699=_0x1bfe90;_0x3a280e=0xc8;}else{_0x3a280e=0xce;}_0x2d162b[_0xb6ac('0x1d')](_0x3a280e);return _0x2d162b['set']('Content-Range',_0xf6a3bc+'-'+_0x28a699+'/'+_0x1bfe90)[_0xb6ac('0x1f')](_0x4b0187);}return null;};}function patchUpdates(_0x46f74b){return function(_0x15141c){try{jsonpatch[_0xb6ac('0x24')](_0x15141c,_0x46f74b,!![]);}catch(_0x5c4cf4){return BPromise[_0xb6ac('0x25')](_0x5c4cf4);}return _0x15141c[_0xb6ac('0x26')]();};}function saveUpdates(_0x110505,_0x5a1455){return function(_0x4cc97f){if(_0x4cc97f){return _0x4cc97f[_0xb6ac('0x27')](_0x110505)[_0xb6ac('0x28')](function(_0x11d0c2){return _0x11d0c2;});}return null;};}function removeEntity(_0x553825,_0x2f8782){return function(_0x117377){if(_0x117377){return _0x117377['destroy']()[_0xb6ac('0x28')](function(){_0x553825['status'](0xcc)[_0xb6ac('0x1e')]();});}};}function handleEntityNotFound(_0xfb57a0,_0x3699fb){return function(_0x2e160e){if(!_0x2e160e){_0xfb57a0['sendStatus'](0x194);}return _0x2e160e;};}function handleError(_0x269263,_0x454d79){_0x454d79=_0x454d79||0x1f4;return function(_0x384dfb){logger[_0xb6ac('0x29')](_0x384dfb['stack']);if(_0x384dfb[_0xb6ac('0x2a')]){delete _0x384dfb['name'];}_0x269263['status'](_0x454d79)[_0xb6ac('0x2b')](_0x384dfb);};}exports[_0xb6ac('0x2c')]=function(_0x6cd5d9,_0x5a0e22){var _0x1ded4a={},_0x13975b={},_0x5624dc={'count':0x0,'rows':[]};var _0x48b07c=_[_0xb6ac('0x2d')](db[_0xb6ac('0x2e')][_0xb6ac('0x2f')],function(_0x5b92f7){return{'name':_0x5b92f7[_0xb6ac('0x30')],'type':_0x5b92f7['type'][_0xb6ac('0x31')]};});_0x13975b[_0xb6ac('0x32')]=_[_0xb6ac('0x2d')](_0x48b07c,_0xb6ac('0x2a'));_0x13975b['query']=_[_0xb6ac('0x33')](_0x6cd5d9['query']);_0x13975b[_0xb6ac('0x34')]=_[_0xb6ac('0x35')](_0x13975b[_0xb6ac('0x32')],_0x13975b[_0xb6ac('0x36')]);_0x1ded4a[_0xb6ac('0x37')]=_['intersection'](_0x13975b[_0xb6ac('0x32')],qs[_0xb6ac('0x38')](_0x6cd5d9['query'][_0xb6ac('0x38')]));_0x1ded4a['attributes']=_0x1ded4a[_0xb6ac('0x37')][_0xb6ac('0x39')]?_0x1ded4a['attributes']:_0x13975b[_0xb6ac('0x32')];if(!_0x6cd5d9[_0xb6ac('0x36')]['hasOwnProperty'](_0xb6ac('0x3a'))){_0x1ded4a['limit']=qs[_0xb6ac('0x23')](_0x6cd5d9[_0xb6ac('0x36')]['limit']);_0x1ded4a['offset']=qs[_0xb6ac('0x20')](_0x6cd5d9['query'][_0xb6ac('0x20')]);}_0x1ded4a[_0xb6ac('0x3b')]=qs[_0xb6ac('0x3c')](_0x6cd5d9[_0xb6ac('0x36')]['sort']);_0x1ded4a[_0xb6ac('0x3d')]=qs[_0xb6ac('0x34')](_[_0xb6ac('0x3e')](_0x6cd5d9[_0xb6ac('0x36')],_0x13975b['filters']),_0x48b07c);if(_0x6cd5d9['query']['filter']){_0x1ded4a[_0xb6ac('0x3d')]=_[_0xb6ac('0x3f')](_0x1ded4a[_0xb6ac('0x3d')],{'$or':_[_0xb6ac('0x2d')](_0x48b07c,function(_0x265f34){if(_0x265f34[_0xb6ac('0x40')]!=='VIRTUAL'){var _0x1cb98b={};_0x1cb98b[_0x265f34[_0xb6ac('0x2a')]]={'$like':'%'+_0x6cd5d9[_0xb6ac('0x36')]['filter']+'%'};return _0x1cb98b;}})});}_0x1ded4a=_[_0xb6ac('0x3f')]({},_0x1ded4a,_0x6cd5d9[_0xb6ac('0x41')]);var _0x687634={'where':_0x1ded4a[_0xb6ac('0x3d')]};return db[_0xb6ac('0x2e')][_0xb6ac('0x22')](_0x687634)['then'](function(_0x28b90d){_0x5624dc[_0xb6ac('0x22')]=_0x28b90d;if(_0x6cd5d9[_0xb6ac('0x36')][_0xb6ac('0x42')]){_0x1ded4a['include']=[{'all':!![]}];}return db[_0xb6ac('0x2e')][_0xb6ac('0x43')](_0x1ded4a);})[_0xb6ac('0x28')](function(_0x4db176){_0x5624dc['rows']=_0x4db176;return _0x5624dc;})['then'](respondWithFilteredResult(_0x5a0e22,_0x1ded4a))[_0xb6ac('0x44')](handleError(_0x5a0e22,null));};exports[_0xb6ac('0x45')]=function(_0xde8cb9,_0xa41ed0){var _0x386950={'raw':!![],'where':{'id':_0xde8cb9['params']['id']}},_0x587412={};_0x587412[_0xb6ac('0x32')]=_['keys'](db['ServicenowField'][_0xb6ac('0x2f')]);_0x587412[_0xb6ac('0x36')]=_[_0xb6ac('0x33')](_0xde8cb9[_0xb6ac('0x36')]);_0x587412['filters']=_[_0xb6ac('0x35')](_0x587412[_0xb6ac('0x32')],_0x587412[_0xb6ac('0x36')]);_0x386950[_0xb6ac('0x37')]=_['intersection'](_0x587412[_0xb6ac('0x32')],qs[_0xb6ac('0x38')](_0xde8cb9[_0xb6ac('0x36')][_0xb6ac('0x38')]));_0x386950[_0xb6ac('0x37')]=_0x386950['attributes']['length']?_0x386950['attributes']:_0x587412[_0xb6ac('0x32')];if(_0xde8cb9[_0xb6ac('0x36')][_0xb6ac('0x42')]){_0x386950['include']=[{'all':!![]}];}_0x386950=_['merge']({},_0x386950,_0xde8cb9[_0xb6ac('0x41')]);return db['ServicenowField']['find'](_0x386950)['then'](handleEntityNotFound(_0xa41ed0,null))['then'](respondWithResult(_0xa41ed0,null))[_0xb6ac('0x44')](handleError(_0xa41ed0,null));};exports[_0xb6ac('0x46')]=function(_0x3876f0,_0x388bac){return db[_0xb6ac('0x2e')]['create'](_0x3876f0[_0xb6ac('0x47')],{})[_0xb6ac('0x28')](respondWithResult(_0x388bac,0xc9))[_0xb6ac('0x44')](handleError(_0x388bac,null));};exports[_0xb6ac('0x27')]=function(_0x3235eb,_0x503972){if(_0x3235eb[_0xb6ac('0x47')]['id']){delete _0x3235eb[_0xb6ac('0x47')]['id'];}return db[_0xb6ac('0x2e')][_0xb6ac('0x48')]({'where':{'id':_0x3235eb['params']['id']}})['then'](handleEntityNotFound(_0x503972,null))[_0xb6ac('0x28')](saveUpdates(_0x3235eb['body'],null))[_0xb6ac('0x28')](respondWithResult(_0x503972,null))['catch'](handleError(_0x503972,null));};exports[_0xb6ac('0x49')]=function(_0x3a6de0,_0x187db9){return db[_0xb6ac('0x2e')]['find']({'where':{'id':_0x3a6de0[_0xb6ac('0x4a')]['id']}})[_0xb6ac('0x28')](handleEntityNotFound(_0x187db9,null))['then'](removeEntity(_0x187db9,null))[_0xb6ac('0x44')](handleError(_0x187db9,null));}; \ No newline at end of file +var _0x065f=['end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','name','send','index','ServicenowField','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','fields','length','nolimit','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','show','intersection','find','create','body','params','catch','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x319cae,_0x23efa1){var _0x44c9d6=function(_0x2559b2){while(--_0x2559b2){_0x319cae['push'](_0x319cae['shift']());}};_0x44c9d6(++_0x23efa1);}(_0x065f,0x15a));var _0xf065=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x065f[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xf065('0x0'));var rimraf=require(_0xf065('0x1'));var zipdir=require(_0xf065('0x2'));var jsonpatch=require(_0xf065('0x3'));var rp=require(_0xf065('0x4'));var moment=require('moment');var BPromise=require(_0xf065('0x5'));var Mustache=require(_0xf065('0x6'));var util=require(_0xf065('0x7'));var path=require('path');var sox=require(_0xf065('0x8'));var csv=require(_0xf065('0x9'));var ejs=require(_0xf065('0xa'));var fs=require('fs');var fs_extra=require(_0xf065('0xb'));var _=require(_0xf065('0xc'));var squel=require(_0xf065('0xd'));var crypto=require(_0xf065('0xe'));var jsforce=require(_0xf065('0xf'));var deskjs=require(_0xf065('0x10'));var toCsv=require(_0xf065('0x9'));var querystring=require(_0xf065('0x11'));var Papa=require(_0xf065('0x12'));var Redis=require(_0xf065('0x13'));var authService=require(_0xf065('0x14'));var qs=require(_0xf065('0x15'));var as=require(_0xf065('0x16'));var hardwareService=require(_0xf065('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xf065('0x18'));var config=require(_0xf065('0x19'));var licenseUtil=require(_0xf065('0x1a'));var db=require(_0xf065('0x1b'))['db'];function respondWithStatusCode(_0x3988e3,_0x1c4e45){_0x1c4e45=_0x1c4e45||0xcc;return function(_0x4816c6){if(_0x4816c6){return _0x3988e3['sendStatus'](_0x1c4e45);}return _0x3988e3[_0xf065('0x1c')](_0x1c4e45)[_0xf065('0x1d')]();};}function respondWithResult(_0x5cab90,_0x11542f){_0x11542f=_0x11542f||0xc8;return function(_0x5e0d67){if(_0x5e0d67){return _0x5cab90[_0xf065('0x1c')](_0x11542f)[_0xf065('0x1e')](_0x5e0d67);}};}function respondWithFilteredResult(_0x505a26,_0x46bb2e){return function(_0x4e7d17){if(_0x4e7d17){var _0x10d634=typeof _0x46bb2e[_0xf065('0x1f')]===_0xf065('0x20')&&typeof _0x46bb2e[_0xf065('0x21')]===_0xf065('0x20');var _0x58ce4d=_0x4e7d17['count'];var _0xa63001=_0x10d634?0x0:_0x46bb2e[_0xf065('0x1f')];var _0x136ec5=_0x10d634?_0x4e7d17[_0xf065('0x22')]:_0x46bb2e['offset']+_0x46bb2e[_0xf065('0x21')];var _0x109a9e;if(_0x136ec5>=_0x58ce4d){_0x136ec5=_0x58ce4d;_0x109a9e=0xc8;}else{_0x109a9e=0xce;}_0x505a26[_0xf065('0x1c')](_0x109a9e);return _0x505a26['set']('Content-Range',_0xa63001+'-'+_0x136ec5+'/'+_0x58ce4d)[_0xf065('0x1e')](_0x4e7d17);}return null;};}function patchUpdates(_0x4c18d0){return function(_0x1faead){try{jsonpatch[_0xf065('0x23')](_0x1faead,_0x4c18d0,!![]);}catch(_0x1741e6){return BPromise[_0xf065('0x24')](_0x1741e6);}return _0x1faead[_0xf065('0x25')]();};}function saveUpdates(_0x14e79a,_0x4dd2fb){return function(_0x45ef48){if(_0x45ef48){return _0x45ef48[_0xf065('0x26')](_0x14e79a)[_0xf065('0x27')](function(_0x4a27c0){return _0x4a27c0;});}return null;};}function removeEntity(_0x16df9e,_0x48522f){return function(_0x24fd5d){if(_0x24fd5d){return _0x24fd5d['destroy']()[_0xf065('0x27')](function(){_0x16df9e['status'](0xcc)[_0xf065('0x1d')]();});}};}function handleEntityNotFound(_0x1a3e3,_0x2d4768){return function(_0x286144){if(!_0x286144){_0x1a3e3['sendStatus'](0x194);}return _0x286144;};}function handleError(_0xd365c9,_0x274561){_0x274561=_0x274561||0x1f4;return function(_0x572ea8){logger[_0xf065('0x28')](_0x572ea8['stack']);if(_0x572ea8[_0xf065('0x29')]){delete _0x572ea8[_0xf065('0x29')];}_0xd365c9['status'](_0x274561)[_0xf065('0x2a')](_0x572ea8);};}exports[_0xf065('0x2b')]=function(_0x47eb71,_0x4ce95e){var _0xdb5254={},_0x56bc9a={},_0x30be84={'count':0x0,'rows':[]};var _0xba0c1b=_['map'](db[_0xf065('0x2c')][_0xf065('0x2d')],function(_0x249ff4){return{'name':_0x249ff4[_0xf065('0x2e')],'type':_0x249ff4['type'][_0xf065('0x2f')]};});_0x56bc9a[_0xf065('0x30')]=_[_0xf065('0x31')](_0xba0c1b,_0xf065('0x29'));_0x56bc9a[_0xf065('0x32')]=_[_0xf065('0x33')](_0x47eb71[_0xf065('0x32')]);_0x56bc9a[_0xf065('0x34')]=_['intersection'](_0x56bc9a[_0xf065('0x30')],_0x56bc9a[_0xf065('0x32')]);_0xdb5254[_0xf065('0x35')]=_['intersection'](_0x56bc9a[_0xf065('0x30')],qs[_0xf065('0x36')](_0x47eb71[_0xf065('0x32')]['fields']));_0xdb5254['attributes']=_0xdb5254[_0xf065('0x35')][_0xf065('0x37')]?_0xdb5254['attributes']:_0x56bc9a[_0xf065('0x30')];if(!_0x47eb71[_0xf065('0x32')]['hasOwnProperty'](_0xf065('0x38'))){_0xdb5254[_0xf065('0x21')]=qs[_0xf065('0x21')](_0x47eb71['query']['limit']);_0xdb5254[_0xf065('0x1f')]=qs[_0xf065('0x1f')](_0x47eb71[_0xf065('0x32')][_0xf065('0x1f')]);}_0xdb5254['order']=qs['sort'](_0x47eb71[_0xf065('0x32')][_0xf065('0x39')]);_0xdb5254['where']=qs[_0xf065('0x34')](_[_0xf065('0x3a')](_0x47eb71[_0xf065('0x32')],_0x56bc9a['filters']),_0xba0c1b);if(_0x47eb71[_0xf065('0x32')]['filter']){_0xdb5254[_0xf065('0x3b')]=_[_0xf065('0x3c')](_0xdb5254[_0xf065('0x3b')],{'$or':_[_0xf065('0x31')](_0xba0c1b,function(_0x226979){if(_0x226979[_0xf065('0x3d')]!==_0xf065('0x3e')){var _0x29f4b9={};_0x29f4b9[_0x226979[_0xf065('0x29')]]={'$like':'%'+_0x47eb71[_0xf065('0x32')][_0xf065('0x3f')]+'%'};return _0x29f4b9;}})});}_0xdb5254=_[_0xf065('0x3c')]({},_0xdb5254,_0x47eb71[_0xf065('0x40')]);var _0x383a52={'where':_0xdb5254['where']};return db['ServicenowField'][_0xf065('0x22')](_0x383a52)[_0xf065('0x27')](function(_0x54d90e){_0x30be84['count']=_0x54d90e;if(_0x47eb71['query'][_0xf065('0x41')]){_0xdb5254[_0xf065('0x42')]=[{'all':!![]}];}return db[_0xf065('0x2c')]['findAll'](_0xdb5254);})[_0xf065('0x27')](function(_0x46b149){_0x30be84[_0xf065('0x43')]=_0x46b149;return _0x30be84;})[_0xf065('0x27')](respondWithFilteredResult(_0x4ce95e,_0xdb5254))['catch'](handleError(_0x4ce95e,null));};exports[_0xf065('0x44')]=function(_0x4d1a46,_0x2a3576){var _0x2a8a68={'raw':!![],'where':{'id':_0x4d1a46['params']['id']}},_0x89fcca={};_0x89fcca[_0xf065('0x30')]=_[_0xf065('0x33')](db['ServicenowField'][_0xf065('0x2d')]);_0x89fcca['query']=_[_0xf065('0x33')](_0x4d1a46['query']);_0x89fcca['filters']=_[_0xf065('0x45')](_0x89fcca[_0xf065('0x30')],_0x89fcca['query']);_0x2a8a68[_0xf065('0x35')]=_[_0xf065('0x45')](_0x89fcca['model'],qs['fields'](_0x4d1a46['query']['fields']));_0x2a8a68['attributes']=_0x2a8a68[_0xf065('0x35')][_0xf065('0x37')]?_0x2a8a68['attributes']:_0x89fcca['model'];if(_0x4d1a46['query'][_0xf065('0x41')]){_0x2a8a68['include']=[{'all':!![]}];}_0x2a8a68=_[_0xf065('0x3c')]({},_0x2a8a68,_0x4d1a46[_0xf065('0x40')]);return db[_0xf065('0x2c')][_0xf065('0x46')](_0x2a8a68)[_0xf065('0x27')](handleEntityNotFound(_0x2a3576,null))['then'](respondWithResult(_0x2a3576,null))['catch'](handleError(_0x2a3576,null));};exports[_0xf065('0x47')]=function(_0x5b7c0e,_0x13872e){return db[_0xf065('0x2c')][_0xf065('0x47')](_0x5b7c0e['body'],{})[_0xf065('0x27')](respondWithResult(_0x13872e,0xc9))['catch'](handleError(_0x13872e,null));};exports[_0xf065('0x26')]=function(_0x33d75f,_0x628f9a){if(_0x33d75f[_0xf065('0x48')]['id']){delete _0x33d75f[_0xf065('0x48')]['id'];}return db['ServicenowField'][_0xf065('0x46')]({'where':{'id':_0x33d75f[_0xf065('0x49')]['id']}})[_0xf065('0x27')](handleEntityNotFound(_0x628f9a,null))[_0xf065('0x27')](saveUpdates(_0x33d75f[_0xf065('0x48')],null))['then'](respondWithResult(_0x628f9a,null))[_0xf065('0x4a')](handleError(_0x628f9a,null));};exports['destroy']=function(_0x5a0063,_0x469efe){return db[_0xf065('0x2c')][_0xf065('0x46')]({'where':{'id':_0x5a0063[_0xf065('0x49')]['id']}})[_0xf065('0x27')](handleEntityNotFound(_0x469efe,null))[_0xf065('0x27')](removeEntity(_0x469efe,null))[_0xf065('0x4a')](handleError(_0x469efe,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index eda52f6..f204d19 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 _0x7348=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x325cc0,_0x4f6b66){var _0x4fab66=function(_0x168dd7){while(--_0x168dd7){_0x325cc0['push'](_0x325cc0['shift']());}};_0x4fab66(++_0x4f6b66);}(_0x7348,0xa8));var _0x8734=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7348[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8734('0x0'));var util=require(_0x8734('0x1'));var logger=require('../../config/logger')(_0x8734('0x2'));var moment=require(_0x8734('0x3'));var BPromise=require(_0x8734('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8734('0x5'));var rimraf=require(_0x8734('0x6'));var config=require(_0x8734('0x7'));var attributes=require('./intServicenowField.attributes');module[_0x8734('0x8')]=function(_0x21e3ab,_0x2dc9ac){return _0x21e3ab['define']('ServicenowField',attributes,{'tableName':_0x8734('0x9'),'paranoid':![],'indexes':[{'name':_0x8734('0xa'),'fields':[_0x8734('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc371=['rimraf','../../config/environment','./intServicenowField.attributes','int_servicenow_fields','servicenow_unique_index','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xc371,0x1b5));var _0x1c37=function(_0x135166,_0x4094d8){_0x135166=_0x135166-0x0;var _0x1b6677=_0xc371[_0x135166];return _0x1b6677;};'use strict';var _=require('lodash');var util=require(_0x1c37('0x0'));var logger=require(_0x1c37('0x1'))(_0x1c37('0x2'));var moment=require(_0x1c37('0x3'));var BPromise=require(_0x1c37('0x4'));var rp=require(_0x1c37('0x5'));var fs=require('fs');var path=require(_0x1c37('0x6'));var rimraf=require(_0x1c37('0x7'));var config=require(_0x1c37('0x8'));var attributes=require(_0x1c37('0x9'));module['exports']=function(_0x408f6d,_0x19be35){return _0x408f6d['define']('ServicenowField',attributes,{'tableName':_0x1c37('0xa'),'paranoid':![],'indexes':[{'name':_0x1c37('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 5ed2f46..62035a3 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(_0x1891b9,_0x2d2c08){var _0x57c5c2=function(_0xf142c1){while(--_0xf142c1){_0x1891b9['push'](_0x1891b9['shift']());}};_0x57c5c2(++_0x2d2c08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x478c70,_0x194544){var _0x1ba95a=function(_0x3d0e20){while(--_0x3d0e20){_0x478c70['push'](_0x478c70['shift']());}};_0x1ba95a(++_0x194544);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x58999b,_0xea4695){_0x58999b=_0x58999b-0x0;var _0x5efc3a=_0xcb91[_0x58999b];return _0x5efc3a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ServicenowField,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 4b8d81c..7f77f13 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(_0x1d1da2,_0x2d0234){var _0x1b6c79=function(_0x1add24){while(--_0x1add24){_0x1d1da2['push'](_0x1d1da2['shift']());}};_0x1b6c79(++_0x2d0234);}(_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 +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x31f027,_0x16e0ee){var _0x5b2e4b=function(_0xe3ec7e){while(--_0xe3ec7e){_0x31f027['push'](_0x31f027['shift']());}};_0x5b2e4b(++_0x16e0ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 6f5ee3e..51cfe33 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(_0x1275eb,_0xcb0044){var _0x54e646=function(_0x459425){while(--_0x459425){_0x1275eb['push'](_0x1275eb['shift']());}};_0x54e646(++_0xcb0044);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x2f29e9,_0x545de7){var _0x245d56=function(_0x29d294){while(--_0x29d294){_0x2f29e9['push'](_0x2f29e9['shift']());}};_0x245d56(++_0x545de7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 e057042..6e39df8 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 _0x9aae=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_id','parent_name','direction','username','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','Calls','values','module_fields','remove','includes','label','value','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9aae,0x163));var _0xe9aa=function(_0x37b3ed,_0x3eca89){_0x37b3ed=_0x37b3ed-0x0;var _0x3a2a2a=_0x9aae[_0x37b3ed];return _0x3a2a2a;};'use strict';var emlformat=require(_0xe9aa('0x0'));var rimraf=require(_0xe9aa('0x1'));var zipdir=require(_0xe9aa('0x2'));var jsonpatch=require(_0xe9aa('0x3'));var rp=require(_0xe9aa('0x4'));var moment=require(_0xe9aa('0x5'));var BPromise=require(_0xe9aa('0x6'));var Mustache=require('mustache');var util=require(_0xe9aa('0x7'));var path=require(_0xe9aa('0x8'));var sox=require(_0xe9aa('0x9'));var csv=require(_0xe9aa('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9aa('0xb'));var squel=require(_0xe9aa('0xc'));var crypto=require(_0xe9aa('0xd'));var jsforce=require(_0xe9aa('0xe'));var deskjs=require(_0xe9aa('0xf'));var toCsv=require(_0xe9aa('0xa'));var querystring=require('querystring');var Papa=require(_0xe9aa('0x10'));var Redis=require(_0xe9aa('0x11'));var authService=require(_0xe9aa('0x12'));var qs=require(_0xe9aa('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9aa('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xe9aa('0x15'));var config=require(_0xe9aa('0x16'));var licenseUtil=require(_0xe9aa('0x17'));var db=require(_0xe9aa('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5bed92,_0x487057){_0x487057=_0x487057||0xcc;return function(_0x23e617){if(_0x23e617){return _0x5bed92[_0xe9aa('0x19')](_0x487057);}return _0x5bed92['status'](_0x487057)[_0xe9aa('0x1a')]();};}function respondWithResult(_0x2d99cb,_0x33acbc){_0x33acbc=_0x33acbc||0xc8;return function(_0x138f30){if(_0x138f30){return _0x2d99cb[_0xe9aa('0x1b')](_0x33acbc)[_0xe9aa('0x1c')](_0x138f30);}};}function respondWithFilteredResult(_0x2bc04b,_0x22694f){return function(_0x3e818d){if(_0x3e818d){var _0x905e0b=typeof _0x22694f[_0xe9aa('0x1d')]===_0xe9aa('0x1e')&&typeof _0x22694f[_0xe9aa('0x1f')]===_0xe9aa('0x1e');var _0xe6741f=_0x3e818d[_0xe9aa('0x20')];var _0x7ecf1b=_0x905e0b?0x0:_0x22694f[_0xe9aa('0x1d')];var _0x4545f6=_0x905e0b?_0x3e818d[_0xe9aa('0x20')]:_0x22694f['offset']+_0x22694f['limit'];var _0x53962f;if(_0x4545f6>=_0xe6741f){_0x4545f6=_0xe6741f;_0x53962f=0xc8;}else{_0x53962f=0xce;}_0x2bc04b[_0xe9aa('0x1b')](_0x53962f);return _0x2bc04b['set'](_0xe9aa('0x21'),_0x7ecf1b+'-'+_0x4545f6+'/'+_0xe6741f)[_0xe9aa('0x1c')](_0x3e818d);}return null;};}function patchUpdates(_0x5743d7){return function(_0x253e1d){try{jsonpatch[_0xe9aa('0x22')](_0x253e1d,_0x5743d7,!![]);}catch(_0x3c3aa3){return BPromise[_0xe9aa('0x23')](_0x3c3aa3);}return _0x253e1d[_0xe9aa('0x24')]();};}function saveUpdates(_0x292ca3,_0x1ec15b){return function(_0x533e89){if(_0x533e89){return _0x533e89[_0xe9aa('0x25')](_0x292ca3)[_0xe9aa('0x26')](function(_0x19a2f4){return _0x19a2f4;});}return null;};}function removeEntity(_0x25520a,_0x4d711f){return function(_0x201661){if(_0x201661){return _0x201661[_0xe9aa('0x27')]()[_0xe9aa('0x26')](function(){_0x25520a[_0xe9aa('0x1b')](0xcc)[_0xe9aa('0x1a')]();});}};}function handleEntityNotFound(_0x540e33,_0x192dab){return function(_0x3140ff){if(!_0x3140ff){_0x540e33[_0xe9aa('0x19')](0x194);}return _0x3140ff;};}function handleError(_0x41f8e6,_0x43244e){_0x43244e=_0x43244e||0x1f4;return function(_0x428414){logger[_0xe9aa('0x28')](_0x428414[_0xe9aa('0x29')]);if(_0x428414[_0xe9aa('0x2a')]){delete _0x428414[_0xe9aa('0x2a')];}_0x41f8e6[_0xe9aa('0x1b')](_0x43244e)['send'](_0x428414);};}exports[_0xe9aa('0x2b')]=function(_0x2800ea,_0x2e7aaf){var _0xcce67e={},_0x19e611={},_0x53d3ed={'count':0x0,'rows':[]};var _0x4d80bd=_[_0xe9aa('0x2c')](db[_0xe9aa('0x2d')][_0xe9aa('0x2e')],function(_0x324aa3){return{'name':_0x324aa3[_0xe9aa('0x2f')],'type':_0x324aa3[_0xe9aa('0x30')][_0xe9aa('0x31')]};});_0x19e611[_0xe9aa('0x32')]=_['map'](_0x4d80bd,_0xe9aa('0x2a'));_0x19e611[_0xe9aa('0x33')]=_[_0xe9aa('0x34')](_0x2800ea[_0xe9aa('0x33')]);_0x19e611[_0xe9aa('0x35')]=_[_0xe9aa('0x36')](_0x19e611[_0xe9aa('0x32')],_0x19e611[_0xe9aa('0x33')]);_0xcce67e[_0xe9aa('0x37')]=_[_0xe9aa('0x36')](_0x19e611[_0xe9aa('0x32')],qs[_0xe9aa('0x38')](_0x2800ea[_0xe9aa('0x33')]['fields']));_0xcce67e[_0xe9aa('0x37')]=_0xcce67e[_0xe9aa('0x37')][_0xe9aa('0x39')]?_0xcce67e[_0xe9aa('0x37')]:_0x19e611[_0xe9aa('0x32')];if(!_0x2800ea[_0xe9aa('0x33')]['hasOwnProperty'](_0xe9aa('0x3a'))){_0xcce67e['limit']=qs[_0xe9aa('0x1f')](_0x2800ea[_0xe9aa('0x33')]['limit']);_0xcce67e[_0xe9aa('0x1d')]=qs[_0xe9aa('0x1d')](_0x2800ea[_0xe9aa('0x33')][_0xe9aa('0x1d')]);}_0xcce67e['order']=qs[_0xe9aa('0x3b')](_0x2800ea['query'][_0xe9aa('0x3b')]);_0xcce67e[_0xe9aa('0x3c')]=qs[_0xe9aa('0x35')](_[_0xe9aa('0x3d')](_0x2800ea[_0xe9aa('0x33')],_0x19e611[_0xe9aa('0x35')]),_0x4d80bd);if(_0x2800ea[_0xe9aa('0x33')][_0xe9aa('0x3e')]){_0xcce67e[_0xe9aa('0x3c')]=_[_0xe9aa('0x3f')](_0xcce67e[_0xe9aa('0x3c')],{'$or':_[_0xe9aa('0x2c')](_0x4d80bd,function(_0x327d8f){if(_0x327d8f['type']!==_0xe9aa('0x40')){var _0x8f2e08={};_0x8f2e08[_0x327d8f[_0xe9aa('0x2a')]]={'$like':'%'+_0x2800ea[_0xe9aa('0x33')][_0xe9aa('0x3e')]+'%'};return _0x8f2e08;}})});}_0xcce67e=_['merge']({},_0xcce67e,_0x2800ea[_0xe9aa('0x41')]);var _0x7ac76e={'where':_0xcce67e[_0xe9aa('0x3c')]};return db[_0xe9aa('0x2d')][_0xe9aa('0x20')](_0x7ac76e)[_0xe9aa('0x26')](function(_0x1aceff){_0x53d3ed[_0xe9aa('0x20')]=_0x1aceff;if(_0x2800ea[_0xe9aa('0x33')][_0xe9aa('0x42')]){_0xcce67e[_0xe9aa('0x43')]=[{'all':!![]}];}return db[_0xe9aa('0x2d')][_0xe9aa('0x44')](_0xcce67e);})[_0xe9aa('0x26')](function(_0x54dc82){_0x53d3ed[_0xe9aa('0x45')]=_0x54dc82;return _0x53d3ed;})[_0xe9aa('0x26')](respondWithFilteredResult(_0x2e7aaf,_0xcce67e))[_0xe9aa('0x46')](handleError(_0x2e7aaf,null));};exports[_0xe9aa('0x47')]=function(_0x16019f,_0x4ffaba){var _0x196d8f={'raw':![],'where':{'id':_0x16019f[_0xe9aa('0x48')]['id']}},_0x55645a={};_0x55645a[_0xe9aa('0x32')]=_[_0xe9aa('0x34')](db[_0xe9aa('0x2d')]['rawAttributes']);_0x55645a[_0xe9aa('0x33')]=_[_0xe9aa('0x34')](_0x16019f['query']);_0x55645a[_0xe9aa('0x35')]=_[_0xe9aa('0x36')](_0x55645a[_0xe9aa('0x32')],_0x55645a[_0xe9aa('0x33')]);_0x196d8f[_0xe9aa('0x37')]=_['intersection'](_0x55645a['model'],qs[_0xe9aa('0x38')](_0x16019f['query'][_0xe9aa('0x38')]));_0x196d8f[_0xe9aa('0x37')]=_0x196d8f[_0xe9aa('0x37')]['length']?_0x196d8f[_0xe9aa('0x37')]:_0x55645a[_0xe9aa('0x32')];if(_0x16019f['query'][_0xe9aa('0x42')]){_0x196d8f[_0xe9aa('0x43')]=[{'all':!![]}];}_0x196d8f=_[_0xe9aa('0x3f')]({},_0x196d8f,_0x16019f['options']);return db[_0xe9aa('0x2d')][_0xe9aa('0x49')](_0x196d8f)[_0xe9aa('0x26')](handleEntityNotFound(_0x4ffaba,null))[_0xe9aa('0x26')](respondWithResult(_0x4ffaba,null))['catch'](handleError(_0x4ffaba,null));};exports[_0xe9aa('0x4a')]=function(_0x1e46e3,_0x25a946){return db[_0xe9aa('0x2d')][_0xe9aa('0x4a')](_0x1e46e3[_0xe9aa('0x4b')],{})[_0xe9aa('0x26')](respondWithResult(_0x25a946,0xc9))[_0xe9aa('0x46')](handleError(_0x25a946,null));};exports['update']=function(_0x52a1ad,_0x8dfd32){if(_0x52a1ad['body']['id']){delete _0x52a1ad['body']['id'];}return db[_0xe9aa('0x2d')][_0xe9aa('0x49')]({'where':{'id':_0x52a1ad[_0xe9aa('0x48')]['id']}})[_0xe9aa('0x26')](handleEntityNotFound(_0x8dfd32,null))[_0xe9aa('0x26')](saveUpdates(_0x52a1ad[_0xe9aa('0x4b')],null))[_0xe9aa('0x26')](respondWithResult(_0x8dfd32,null))[_0xe9aa('0x46')](handleError(_0x8dfd32,null));};exports[_0xe9aa('0x27')]=function(_0x1ecc7f,_0x103732){return db[_0xe9aa('0x2d')][_0xe9aa('0x49')]({'where':{'id':_0x1ecc7f['params']['id']}})[_0xe9aa('0x26')](handleEntityNotFound(_0x103732,null))[_0xe9aa('0x26')](removeEntity(_0x103732,null))[_0xe9aa('0x46')](handleError(_0x103732,null));};exports[_0xe9aa('0x4c')]=function(_0x476604,_0x10edd6,_0x11952f){var _0x343144={};var _0x2b23e7={};var _0x564f32;var _0xca2365;return db[_0xe9aa('0x2d')][_0xe9aa('0x4d')]({'where':{'id':_0x476604[_0xe9aa('0x48')]['id']}})[_0xe9aa('0x26')](handleEntityNotFound(_0x10edd6,null))['then'](function(_0x277c08){if(_0x277c08){_0x564f32=_0x277c08;_0x2b23e7[_0xe9aa('0x32')]=_[_0xe9aa('0x34')](db[_0xe9aa('0x4e')][_0xe9aa('0x2e')]);_0x2b23e7[_0xe9aa('0x33')]=_[_0xe9aa('0x34')](_0x476604[_0xe9aa('0x33')]);_0x2b23e7['filters']=_[_0xe9aa('0x36')](_0x2b23e7[_0xe9aa('0x32')],_0x2b23e7[_0xe9aa('0x33')]);_0x343144[_0xe9aa('0x37')]=_[_0xe9aa('0x36')](_0x2b23e7[_0xe9aa('0x32')],qs[_0xe9aa('0x38')](_0x476604['query'][_0xe9aa('0x38')]));_0x343144[_0xe9aa('0x37')]=_0x343144[_0xe9aa('0x37')][_0xe9aa('0x39')]?_0x343144['attributes']:_0x2b23e7['model'];_0x343144[_0xe9aa('0x4f')]=qs[_0xe9aa('0x3b')](_0x476604['query'][_0xe9aa('0x3b')]);_0x343144[_0xe9aa('0x3c')]=qs[_0xe9aa('0x35')](_[_0xe9aa('0x3d')](_0x476604[_0xe9aa('0x33')],_0x2b23e7[_0xe9aa('0x35')]));if(_0x476604[_0xe9aa('0x33')][_0xe9aa('0x3e')]){_0x343144[_0xe9aa('0x3c')]=_[_0xe9aa('0x3f')](_0x343144[_0xe9aa('0x3c')],{'$or':_[_0xe9aa('0x2c')](_0x343144[_0xe9aa('0x37')],function(_0x26e7c2){var _0x3ccb62={};_0x3ccb62[_0x26e7c2]={'$like':'%'+_0x476604[_0xe9aa('0x33')]['filter']+'%'};return _0x3ccb62;})});}_0x343144=_['merge']({},_0x343144,_0x476604[_0xe9aa('0x41')]);return _0x564f32[_0xe9aa('0x4c')](_0x343144);}})[_0xe9aa('0x26')](function(_0x26cf3a){if(_0x26cf3a){_0xca2365=_0x26cf3a['length'];if(!_0x476604['query'][_0xe9aa('0x50')](_0xe9aa('0x3a'))){_0x343144[_0xe9aa('0x1f')]=qs['limit'](_0x476604[_0xe9aa('0x33')][_0xe9aa('0x1f')]);_0x343144[_0xe9aa('0x1d')]=qs[_0xe9aa('0x1d')](_0x476604['query'][_0xe9aa('0x1d')]);}return _0x564f32[_0xe9aa('0x4c')](_0x343144);}})[_0xe9aa('0x26')](function(_0x449377){if(_0x449377){return _0x449377?{'count':_0xca2365,'rows':_0x449377}:null;}})[_0xe9aa('0x26')](respondWithResult(_0x10edd6,null))[_0xe9aa('0x46')](handleError(_0x10edd6,null));};exports[_0xe9aa('0x51')]=function(_0x207ab7,_0xd9de3e,_0x1892c8){if(_0x207ab7['body']['id']){delete _0x207ab7[_0xe9aa('0x4b')]['id'];}return db[_0xe9aa('0x2d')][_0xe9aa('0x4d')]({'where':{'id':_0x207ab7['params']['id']}})[_0xe9aa('0x26')](handleEntityNotFound(_0xd9de3e,null))[_0xe9aa('0x26')](function(_0x20eaf8){if(_0x20eaf8){_0x207ab7[_0xe9aa('0x4b')]['AccountId']=_0x20eaf8['id'];_0x207ab7['body'][_0xe9aa('0x52')]=integrations[_0xe9aa('0x53')](_0x207ab7['body'][_0xe9aa('0x54')],_0x207ab7['body'][_0xe9aa('0x30')]);_0x207ab7[_0xe9aa('0x4b')]['Descriptions']=integrations['getDescriptions'](_0x207ab7[_0xe9aa('0x4b')][_0xe9aa('0x54')],_0x207ab7[_0xe9aa('0x4b')][_0xe9aa('0x30')]);return db[_0xe9aa('0x4e')][_0xe9aa('0x4a')](_0x207ab7[_0xe9aa('0x4b')],{'include':[{'model':db[_0xe9aa('0x55')],'as':_0xe9aa('0x52')},{'model':db[_0xe9aa('0x55')],'as':_0xe9aa('0x56')}]});}return null;})[_0xe9aa('0x26')](respondWithResult(_0xd9de3e,null))[_0xe9aa('0x46')](handleError(_0xd9de3e,null));};exports[_0xe9aa('0x57')]=function(_0xdba11,_0xe5c877,_0xc9105){var _0x1202f6='';var _0x29835b=['id',_0xe9aa('0x2a'),_0xe9aa('0x58'),_0xe9aa('0x59'),_0xe9aa('0x5a'),'date_start',_0xe9aa('0x5b'),_0xe9aa('0x5c'),_0xe9aa('0x5d'),'parent_type',_0xe9aa('0x5e'),_0xe9aa('0x5f')];return db[_0xe9aa('0x2d')][_0xe9aa('0x4d')]({'where':{'id':_0xdba11[_0xe9aa('0x48')]['id']},'attributes':['id',_0xe9aa('0x60'),'password','remoteUri']})[_0xe9aa('0x26')](handleEntityNotFound(_0xe5c877,null))[_0xe9aa('0x26')](function(_0x27de28){if(_0x27de28){_0x1202f6=_0x27de28[_0xe9aa('0x61')];var _0x2319cd=_0x1202f6[_0xe9aa('0x62')](-0x1);if(_0x2319cd==='/'){_0x1202f6=_0x1202f6[_0xe9aa('0x63')](0x0,_0x1202f6[_0xe9aa('0x64')](_0x2319cd));}return rp({'method':_0xe9aa('0x65'),'uri':util[_0xe9aa('0x66')](_0xe9aa('0x67'),_0x1202f6,_0xe9aa('0x68')),'json':!![],'form':{'method':_0xe9aa('0x69'),'input_type':_0xe9aa('0x6a'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x27de28[_0xe9aa('0x60')],'password':_0x27de28[_0xe9aa('0x6b')],'encryption':_0xe9aa('0x6c')},'application':_0xe9aa('0x6d')})}});}})[_0xe9aa('0x26')](function(_0x40205d){if(_0x40205d&&_0x40205d[_0xe9aa('0x2a')]!==_0xe9aa('0x6e')&&_0x40205d[_0xe9aa('0x2a')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0xe9aa('0x66')](_0xe9aa('0x67'),_0x1202f6,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xe9aa('0x6f'),'input_type':_0xe9aa('0x6a'),'response_type':_0xe9aa('0x6a'),'rest_data':JSON['stringify']({'session':_0x40205d['id'],'module_name':_0xe9aa('0x70')})}})['then'](function(_0x31b67b){if(_0x31b67b){var _0x1ae96e=_[_0xe9aa('0x71')](_0x31b67b[_0xe9aa('0x72')]);_[_0xe9aa('0x73')](_0x1ae96e,function(_0x5ea1a6){return _0x29835b[_0xe9aa('0x74')](_0x5ea1a6['name']);});return{'count':_0x1ae96e[_0xe9aa('0x39')],'rows':_[_0xe9aa('0x2c')](_0x1ae96e,function(_0x491bd4){return{'id':_0x491bd4['name'],'name':_0x491bd4[_0xe9aa('0x75')],'custom':_['endsWith'](_0x491bd4[_0xe9aa('0x2a')],'_c')?!![]:![],'options':_0x491bd4['options']?_['map'](_['values'](_0x491bd4[_0xe9aa('0x41')]),function(_0x14a5b8){return{'name':_0x14a5b8[_0xe9aa('0x76')],'value':_0x14a5b8[_0xe9aa('0x2a')]};}):[]};})};}})[_0xe9aa('0x26')](respondWithResult(_0xe5c877,null))[_0xe9aa('0x46')](function(_0x6551e0){var _0x6ea645=_0xdba11[_0xe9aa('0x33')]['test']?0x1f4:_0x6551e0['statusCode']||0x1f4;logger[_0xe9aa('0x28')](_0xe9aa('0x77'),_0xe9aa('0x57'),_0x6ea645,JSON[_0xe9aa('0x78')](_0x6551e0));delete _0x6551e0[_0xe9aa('0x2a')];if(_0x6ea645===0x191){_0x6ea645=0x190;}_0xe5c877[_0xe9aa('0x1b')](_0x6ea645)['send'](_0xdba11['query']['test']?{'message':_0xe9aa('0x79'),'statusCode':_0x6551e0[_0xe9aa('0x7a')]}:_0x6551e0);});}else{var _0x34287c=0x1f4;_0xe5c877['status'](_0x34287c)['send']({'message':_0xe9aa('0x79'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xba91=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','merge','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','update','SugarcrmConfiguration','sort','pick','getConfigurations','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_name','findOne','username','password','remoteUri','slice','POST','format','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','/service/v4_1/rest.php','Calls','values','module_fields','remove','includes','label','endsWith','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','SugarcrmAccount','fieldName','type','key','model','map'];(function(_0x49d280,_0x178f7f){var _0x5a5769=function(_0x2f152a){while(--_0x2f152a){_0x49d280['push'](_0x49d280['shift']());}};_0x5a5769(++_0x178f7f);}(_0xba91,0xc0));var _0x1ba9=function(_0x2520c5,_0x2d07fe){_0x2520c5=_0x2520c5-0x0;var _0x524230=_0xba91[_0x2520c5];return _0x524230;};'use strict';var emlformat=require(_0x1ba9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ba9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1ba9('0x2'));var BPromise=require(_0x1ba9('0x3'));var Mustache=require(_0x1ba9('0x4'));var util=require(_0x1ba9('0x5'));var path=require(_0x1ba9('0x6'));var sox=require('sox');var csv=require(_0x1ba9('0x7'));var ejs=require(_0x1ba9('0x8'));var fs=require('fs');var fs_extra=require(_0x1ba9('0x9'));var _=require(_0x1ba9('0xa'));var squel=require(_0x1ba9('0xb'));var crypto=require(_0x1ba9('0xc'));var jsforce=require(_0x1ba9('0xd'));var deskjs=require(_0x1ba9('0xe'));var toCsv=require(_0x1ba9('0x7'));var querystring=require(_0x1ba9('0xf'));var Papa=require(_0x1ba9('0x10'));var Redis=require(_0x1ba9('0x11'));var authService=require(_0x1ba9('0x12'));var qs=require(_0x1ba9('0x13'));var as=require(_0x1ba9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ba9('0x15'))(_0x1ba9('0x16'));var utils=require(_0x1ba9('0x17'));var config=require(_0x1ba9('0x18'));var licenseUtil=require(_0x1ba9('0x19'));var db=require(_0x1ba9('0x1a'))['db'];var integrations=require(_0x1ba9('0x1b'));function respondWithStatusCode(_0x5891b6,_0x225f49){_0x225f49=_0x225f49||0xcc;return function(_0x3fc4e5){if(_0x3fc4e5){return _0x5891b6[_0x1ba9('0x1c')](_0x225f49);}return _0x5891b6[_0x1ba9('0x1d')](_0x225f49)[_0x1ba9('0x1e')]();};}function respondWithResult(_0x3eec67,_0x34e0da){_0x34e0da=_0x34e0da||0xc8;return function(_0x1044b4){if(_0x1044b4){return _0x3eec67[_0x1ba9('0x1d')](_0x34e0da)[_0x1ba9('0x1f')](_0x1044b4);}};}function respondWithFilteredResult(_0x53639c,_0x12f140){return function(_0x494088){if(_0x494088){var _0x4bd494=typeof _0x12f140[_0x1ba9('0x20')]===_0x1ba9('0x21')&&typeof _0x12f140['limit']===_0x1ba9('0x21');var _0x35a3f6=_0x494088['count'];var _0xc640a1=_0x4bd494?0x0:_0x12f140['offset'];var _0x130607=_0x4bd494?_0x494088[_0x1ba9('0x22')]:_0x12f140[_0x1ba9('0x20')]+_0x12f140[_0x1ba9('0x23')];var _0x19fd50;if(_0x130607>=_0x35a3f6){_0x130607=_0x35a3f6;_0x19fd50=0xc8;}else{_0x19fd50=0xce;}_0x53639c[_0x1ba9('0x1d')](_0x19fd50);return _0x53639c[_0x1ba9('0x24')](_0x1ba9('0x25'),_0xc640a1+'-'+_0x130607+'/'+_0x35a3f6)[_0x1ba9('0x1f')](_0x494088);}return null;};}function patchUpdates(_0xd4fd1a){return function(_0x217c4e){try{jsonpatch[_0x1ba9('0x26')](_0x217c4e,_0xd4fd1a,!![]);}catch(_0x2e50b4){return BPromise[_0x1ba9('0x27')](_0x2e50b4);}return _0x217c4e[_0x1ba9('0x28')]();};}function saveUpdates(_0x463782,_0x209888){return function(_0x28ba8b){if(_0x28ba8b){return _0x28ba8b['update'](_0x463782)['then'](function(_0x286016){return _0x286016;});}return null;};}function removeEntity(_0x593b09,_0x1ad21b){return function(_0xd853d5){if(_0xd853d5){return _0xd853d5[_0x1ba9('0x29')]()[_0x1ba9('0x2a')](function(){_0x593b09['status'](0xcc)[_0x1ba9('0x1e')]();});}};}function handleEntityNotFound(_0xf1ecfc,_0x43e196){return function(_0x214549){if(!_0x214549){_0xf1ecfc[_0x1ba9('0x1c')](0x194);}return _0x214549;};}function handleError(_0x5a4e28,_0x6ab6cb){_0x6ab6cb=_0x6ab6cb||0x1f4;return function(_0x119bd1){logger[_0x1ba9('0x2b')](_0x119bd1[_0x1ba9('0x2c')]);if(_0x119bd1[_0x1ba9('0x2d')]){delete _0x119bd1[_0x1ba9('0x2d')];}_0x5a4e28[_0x1ba9('0x1d')](_0x6ab6cb)[_0x1ba9('0x2e')](_0x119bd1);};}exports[_0x1ba9('0x2f')]=function(_0x2f8c74,_0x187662){var _0x6d9f14={},_0x53dad1={},_0x310655={'count':0x0,'rows':[]};var _0x40a0e1=_['map'](db[_0x1ba9('0x30')]['rawAttributes'],function(_0x199825){return{'name':_0x199825[_0x1ba9('0x31')],'type':_0x199825[_0x1ba9('0x32')][_0x1ba9('0x33')]};});_0x53dad1[_0x1ba9('0x34')]=_[_0x1ba9('0x35')](_0x40a0e1,_0x1ba9('0x2d'));_0x53dad1[_0x1ba9('0x36')]=_[_0x1ba9('0x37')](_0x2f8c74['query']);_0x53dad1[_0x1ba9('0x38')]=_[_0x1ba9('0x39')](_0x53dad1[_0x1ba9('0x34')],_0x53dad1[_0x1ba9('0x36')]);_0x6d9f14[_0x1ba9('0x3a')]=_[_0x1ba9('0x39')](_0x53dad1['model'],qs[_0x1ba9('0x3b')](_0x2f8c74[_0x1ba9('0x36')][_0x1ba9('0x3b')]));_0x6d9f14[_0x1ba9('0x3a')]=_0x6d9f14[_0x1ba9('0x3a')][_0x1ba9('0x3c')]?_0x6d9f14[_0x1ba9('0x3a')]:_0x53dad1[_0x1ba9('0x34')];if(!_0x2f8c74['query']['hasOwnProperty'](_0x1ba9('0x3d'))){_0x6d9f14['limit']=qs['limit'](_0x2f8c74[_0x1ba9('0x36')][_0x1ba9('0x23')]);_0x6d9f14[_0x1ba9('0x20')]=qs['offset'](_0x2f8c74[_0x1ba9('0x36')]['offset']);}_0x6d9f14[_0x1ba9('0x3e')]=qs['sort'](_0x2f8c74[_0x1ba9('0x36')]['sort']);_0x6d9f14['where']=qs['filters'](_['pick'](_0x2f8c74['query'],_0x53dad1[_0x1ba9('0x38')]),_0x40a0e1);if(_0x2f8c74[_0x1ba9('0x36')]['filter']){_0x6d9f14[_0x1ba9('0x3f')]=_[_0x1ba9('0x40')](_0x6d9f14[_0x1ba9('0x3f')],{'$or':_['map'](_0x40a0e1,function(_0x327d97){if(_0x327d97[_0x1ba9('0x32')]!=='VIRTUAL'){var _0x556cd2={};_0x556cd2[_0x327d97[_0x1ba9('0x2d')]]={'$like':'%'+_0x2f8c74[_0x1ba9('0x36')][_0x1ba9('0x41')]+'%'};return _0x556cd2;}})});}_0x6d9f14=_[_0x1ba9('0x40')]({},_0x6d9f14,_0x2f8c74[_0x1ba9('0x42')]);var _0x2d2a51={'where':_0x6d9f14[_0x1ba9('0x3f')]};return db[_0x1ba9('0x30')][_0x1ba9('0x22')](_0x2d2a51)[_0x1ba9('0x2a')](function(_0x35c11d){_0x310655[_0x1ba9('0x22')]=_0x35c11d;if(_0x2f8c74[_0x1ba9('0x36')][_0x1ba9('0x43')]){_0x6d9f14[_0x1ba9('0x44')]=[{'all':!![]}];}return db[_0x1ba9('0x30')][_0x1ba9('0x45')](_0x6d9f14);})[_0x1ba9('0x2a')](function(_0x2d6380){_0x310655[_0x1ba9('0x46')]=_0x2d6380;return _0x310655;})[_0x1ba9('0x2a')](respondWithFilteredResult(_0x187662,_0x6d9f14))['catch'](handleError(_0x187662,null));};exports[_0x1ba9('0x47')]=function(_0xcdc8dd,_0x11f54c){var _0x398037={'raw':![],'where':{'id':_0xcdc8dd[_0x1ba9('0x48')]['id']}},_0x47a669={};_0x47a669['model']=_[_0x1ba9('0x37')](db[_0x1ba9('0x30')][_0x1ba9('0x49')]);_0x47a669[_0x1ba9('0x36')]=_['keys'](_0xcdc8dd[_0x1ba9('0x36')]);_0x47a669[_0x1ba9('0x38')]=_[_0x1ba9('0x39')](_0x47a669['model'],_0x47a669[_0x1ba9('0x36')]);_0x398037[_0x1ba9('0x3a')]=_[_0x1ba9('0x39')](_0x47a669[_0x1ba9('0x34')],qs['fields'](_0xcdc8dd[_0x1ba9('0x36')][_0x1ba9('0x3b')]));_0x398037[_0x1ba9('0x3a')]=_0x398037[_0x1ba9('0x3a')][_0x1ba9('0x3c')]?_0x398037[_0x1ba9('0x3a')]:_0x47a669['model'];if(_0xcdc8dd[_0x1ba9('0x36')]['includeAll']){_0x398037[_0x1ba9('0x44')]=[{'all':!![]}];}_0x398037=_[_0x1ba9('0x40')]({},_0x398037,_0xcdc8dd[_0x1ba9('0x42')]);return db[_0x1ba9('0x30')][_0x1ba9('0x4a')](_0x398037)[_0x1ba9('0x2a')](handleEntityNotFound(_0x11f54c,null))[_0x1ba9('0x2a')](respondWithResult(_0x11f54c,null))[_0x1ba9('0x4b')](handleError(_0x11f54c,null));};exports[_0x1ba9('0x4c')]=function(_0x3fdab4,_0x284ce3){return db['SugarcrmAccount'][_0x1ba9('0x4c')](_0x3fdab4[_0x1ba9('0x4d')],{})[_0x1ba9('0x2a')](respondWithResult(_0x284ce3,0xc9))[_0x1ba9('0x4b')](handleError(_0x284ce3,null));};exports[_0x1ba9('0x4e')]=function(_0x5aeb14,_0x21ac3c){if(_0x5aeb14[_0x1ba9('0x4d')]['id']){delete _0x5aeb14['body']['id'];}return db[_0x1ba9('0x30')][_0x1ba9('0x4a')]({'where':{'id':_0x5aeb14[_0x1ba9('0x48')]['id']}})[_0x1ba9('0x2a')](handleEntityNotFound(_0x21ac3c,null))[_0x1ba9('0x2a')](saveUpdates(_0x5aeb14['body'],null))[_0x1ba9('0x2a')](respondWithResult(_0x21ac3c,null))[_0x1ba9('0x4b')](handleError(_0x21ac3c,null));};exports[_0x1ba9('0x29')]=function(_0x1f9324,_0x50a3ff){return db[_0x1ba9('0x30')][_0x1ba9('0x4a')]({'where':{'id':_0x1f9324[_0x1ba9('0x48')]['id']}})[_0x1ba9('0x2a')](handleEntityNotFound(_0x50a3ff,null))[_0x1ba9('0x2a')](removeEntity(_0x50a3ff,null))[_0x1ba9('0x4b')](handleError(_0x50a3ff,null));};exports['getConfigurations']=function(_0x4d379d,_0x49a0e2,_0x37cbcf){var _0xa7c702={};var _0x138f9d={};var _0x2dfd0f;var _0x6bbb9c;return db[_0x1ba9('0x30')]['findOne']({'where':{'id':_0x4d379d[_0x1ba9('0x48')]['id']}})['then'](handleEntityNotFound(_0x49a0e2,null))[_0x1ba9('0x2a')](function(_0x464470){if(_0x464470){_0x2dfd0f=_0x464470;_0x138f9d['model']=_['keys'](db[_0x1ba9('0x4f')][_0x1ba9('0x49')]);_0x138f9d['query']=_['keys'](_0x4d379d[_0x1ba9('0x36')]);_0x138f9d[_0x1ba9('0x38')]=_['intersection'](_0x138f9d[_0x1ba9('0x34')],_0x138f9d[_0x1ba9('0x36')]);_0xa7c702['attributes']=_[_0x1ba9('0x39')](_0x138f9d['model'],qs[_0x1ba9('0x3b')](_0x4d379d['query'][_0x1ba9('0x3b')]));_0xa7c702[_0x1ba9('0x3a')]=_0xa7c702['attributes'][_0x1ba9('0x3c')]?_0xa7c702['attributes']:_0x138f9d[_0x1ba9('0x34')];_0xa7c702[_0x1ba9('0x3e')]=qs[_0x1ba9('0x50')](_0x4d379d[_0x1ba9('0x36')]['sort']);_0xa7c702[_0x1ba9('0x3f')]=qs[_0x1ba9('0x38')](_[_0x1ba9('0x51')](_0x4d379d[_0x1ba9('0x36')],_0x138f9d[_0x1ba9('0x38')]));if(_0x4d379d['query'][_0x1ba9('0x41')]){_0xa7c702[_0x1ba9('0x3f')]=_[_0x1ba9('0x40')](_0xa7c702[_0x1ba9('0x3f')],{'$or':_[_0x1ba9('0x35')](_0xa7c702[_0x1ba9('0x3a')],function(_0x11382b){var _0x39fb94={};_0x39fb94[_0x11382b]={'$like':'%'+_0x4d379d[_0x1ba9('0x36')][_0x1ba9('0x41')]+'%'};return _0x39fb94;})});}_0xa7c702=_[_0x1ba9('0x40')]({},_0xa7c702,_0x4d379d['options']);return _0x2dfd0f[_0x1ba9('0x52')](_0xa7c702);}})['then'](function(_0x2cd9f7){if(_0x2cd9f7){_0x6bbb9c=_0x2cd9f7['length'];if(!_0x4d379d[_0x1ba9('0x36')][_0x1ba9('0x53')]('nolimit')){_0xa7c702[_0x1ba9('0x23')]=qs[_0x1ba9('0x23')](_0x4d379d[_0x1ba9('0x36')]['limit']);_0xa7c702[_0x1ba9('0x20')]=qs[_0x1ba9('0x20')](_0x4d379d[_0x1ba9('0x36')][_0x1ba9('0x20')]);}return _0x2dfd0f[_0x1ba9('0x52')](_0xa7c702);}})[_0x1ba9('0x2a')](function(_0x2c0c50){if(_0x2c0c50){return _0x2c0c50?{'count':_0x6bbb9c,'rows':_0x2c0c50}:null;}})[_0x1ba9('0x2a')](respondWithResult(_0x49a0e2,null))[_0x1ba9('0x4b')](handleError(_0x49a0e2,null));};exports[_0x1ba9('0x54')]=function(_0x13304d,_0x31de9b,_0x5d51d6){if(_0x13304d[_0x1ba9('0x4d')]['id']){delete _0x13304d['body']['id'];}return db[_0x1ba9('0x30')]['findOne']({'where':{'id':_0x13304d[_0x1ba9('0x48')]['id']}})[_0x1ba9('0x2a')](handleEntityNotFound(_0x31de9b,null))[_0x1ba9('0x2a')](function(_0x48ca1c){if(_0x48ca1c){_0x13304d[_0x1ba9('0x4d')]['AccountId']=_0x48ca1c['id'];_0x13304d['body'][_0x1ba9('0x55')]=integrations[_0x1ba9('0x56')](_0x13304d[_0x1ba9('0x4d')][_0x1ba9('0x57')],_0x13304d[_0x1ba9('0x4d')][_0x1ba9('0x32')]);_0x13304d[_0x1ba9('0x4d')][_0x1ba9('0x58')]=integrations['getDescriptions'](_0x13304d[_0x1ba9('0x4d')]['channel'],_0x13304d['body'][_0x1ba9('0x32')]);return db[_0x1ba9('0x4f')][_0x1ba9('0x4c')](_0x13304d['body'],{'include':[{'model':db[_0x1ba9('0x59')],'as':_0x1ba9('0x55')},{'model':db[_0x1ba9('0x59')],'as':_0x1ba9('0x58')}]});}return null;})['then'](respondWithResult(_0x31de9b,null))[_0x1ba9('0x4b')](handleError(_0x31de9b,null));};exports[_0x1ba9('0x5a')]=function(_0x3902fa,_0x3774b4,_0x47a97d){var _0x222ec7='';var _0x3bf604=['id',_0x1ba9('0x2d'),_0x1ba9('0x5b'),_0x1ba9('0x5c'),'description',_0x1ba9('0x5d'),_0x1ba9('0x5e'),_0x1ba9('0x5f'),_0x1ba9('0x60'),'parent_type',_0x1ba9('0x61'),'direction'];return db[_0x1ba9('0x30')][_0x1ba9('0x62')]({'where':{'id':_0x3902fa['params']['id']},'attributes':['id',_0x1ba9('0x63'),_0x1ba9('0x64'),'remoteUri']})['then'](handleEntityNotFound(_0x3774b4,null))['then'](function(_0xc70273){if(_0xc70273){_0x222ec7=_0xc70273[_0x1ba9('0x65')];var _0x5e2195=_0x222ec7[_0x1ba9('0x66')](-0x1);if(_0x5e2195==='/'){_0x222ec7=_0x222ec7['substring'](0x0,_0x222ec7['lastIndexOf'](_0x5e2195));}return rp({'method':_0x1ba9('0x67'),'uri':util[_0x1ba9('0x68')](_0x1ba9('0x69'),_0x222ec7,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x1ba9('0x6a'),'input_type':_0x1ba9('0x6b'),'response_type':_0x1ba9('0x6b'),'rest_data':JSON[_0x1ba9('0x6c')]({'user_auth':{'user_name':_0xc70273[_0x1ba9('0x63')],'password':_0xc70273[_0x1ba9('0x64')],'encryption':_0x1ba9('0x6d')},'application':_0x1ba9('0x6e')})}});}})['then'](function(_0x1cc7aa){if(_0x1cc7aa&&_0x1cc7aa[_0x1ba9('0x2d')]!==_0x1ba9('0x6f')&&_0x1cc7aa[_0x1ba9('0x2d')]!=='Password\x20Expired'){return rp({'method':_0x1ba9('0x67'),'uri':util[_0x1ba9('0x68')](_0x1ba9('0x69'),_0x222ec7,_0x1ba9('0x70')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x1ba9('0x6b'),'response_type':_0x1ba9('0x6b'),'rest_data':JSON[_0x1ba9('0x6c')]({'session':_0x1cc7aa['id'],'module_name':_0x1ba9('0x71')})}})[_0x1ba9('0x2a')](function(_0x360447){if(_0x360447){var _0x550665=_[_0x1ba9('0x72')](_0x360447[_0x1ba9('0x73')]);_[_0x1ba9('0x74')](_0x550665,function(_0x71c093){return _0x3bf604[_0x1ba9('0x75')](_0x71c093[_0x1ba9('0x2d')]);});return{'count':_0x550665[_0x1ba9('0x3c')],'rows':_[_0x1ba9('0x35')](_0x550665,function(_0x484931){return{'id':_0x484931['name'],'name':_0x484931[_0x1ba9('0x76')],'custom':_[_0x1ba9('0x77')](_0x484931[_0x1ba9('0x2d')],'_c')?!![]:![],'options':_0x484931[_0x1ba9('0x42')]?_['map'](_[_0x1ba9('0x72')](_0x484931[_0x1ba9('0x42')]),function(_0x365be8){return{'name':_0x365be8['value'],'value':_0x365be8['name']};}):[]};})};}})[_0x1ba9('0x2a')](respondWithResult(_0x3774b4,null))[_0x1ba9('0x4b')](function(_0x265020){var _0xad1974=_0x3902fa[_0x1ba9('0x36')][_0x1ba9('0x78')]?0x1f4:_0x265020[_0x1ba9('0x79')]||0x1f4;logger[_0x1ba9('0x2b')]('getFields,\x20%s,\x20%s,\x20%s',_0x1ba9('0x5a'),_0xad1974,JSON[_0x1ba9('0x6c')](_0x265020));delete _0x265020['name'];if(_0xad1974===0x191){_0xad1974=0x190;}_0x3774b4[_0x1ba9('0x1d')](_0xad1974)[_0x1ba9('0x2e')](_0x3902fa['query']['test']?{'message':_0x1ba9('0x7a'),'statusCode':_0x265020[_0x1ba9('0x79')]}:_0x265020);});}else{var _0x11aaa0=0x1f4;_0x3774b4[_0x1ba9('0x1d')](_0x11aaa0)[_0x1ba9('0x2e')]({'message':'Wrong\x20credentials','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 0f8827b..07fcee3 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 _0x211e=['int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define'];(function(_0x899c29,_0x56fdb2){var _0xc25ad0=function(_0x3b19bd){while(--_0x3b19bd){_0x899c29['push'](_0x899c29['shift']());}};_0xc25ad0(++_0x56fdb2);}(_0x211e,0x1b1));var _0xe211=function(_0x17edab,_0x46d00a){_0x17edab=_0x17edab-0x0;var _0x5eef3e=_0x211e[_0x17edab];return _0x5eef3e;};'use strict';var _=require(_0xe211('0x0'));var util=require(_0xe211('0x1'));var logger=require(_0xe211('0x2'))(_0xe211('0x3'));var moment=require(_0xe211('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe211('0x5'));var rimraf=require(_0xe211('0x6'));var config=require(_0xe211('0x7'));var attributes=require(_0xe211('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xe211('0x9')]=function(_0x4d7863,_0x305b39){return _0x4d7863[_0xe211('0xa')]('SugarcrmAccount',attributes,{'tableName':_0xe211('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b88=['rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','int_sugarcrm_accounts','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x11a831,_0x423368){var _0x4c52e1=function(_0x1a56da){while(--_0x1a56da){_0x11a831['push'](_0x11a831['shift']());}};_0x4c52e1(++_0x423368);}(_0x7b88,0xe1));var _0x87b8=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x7b88[_0x5a9c0c];return _0x53c77d;};'use strict';var _=require(_0x87b8('0x0'));var util=require('util');var logger=require(_0x87b8('0x1'))(_0x87b8('0x2'));var moment=require(_0x87b8('0x3'));var BPromise=require('bluebird');var rp=require(_0x87b8('0x4'));var fs=require('fs');var path=require(_0x87b8('0x5'));var rimraf=require(_0x87b8('0x6'));var config=require('../../config/environment');var attributes=require(_0x87b8('0x7'));var integrations=require(_0x87b8('0x8'));module['exports']=function(_0x3bd5e3,_0x2837bd){return _0x3bd5e3[_0x87b8('0x9')]('SugarcrmAccount',attributes,{'tableName':_0x87b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 1b234ec..2d67791 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 _0xcc3a=['SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','include','map','model','attributes','info','ShowSugarcrmAccount','find','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','SugarcrmAccount,\x20%s,\x20%s','debug'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0xcc3a,0xfc));var _0xacc3=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xcc3a[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0xacc3('0x0'));var util=require(_0xacc3('0x1'));var moment=require('moment');var BPromise=require(_0xacc3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacc3('0x3'));var db=require(_0xacc3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xacc3('0x5'));var jayson=require(_0xacc3('0x6'));var client=jayson[_0xacc3('0x7')][_0xacc3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x271058,_0x98376a,_0x38395a){return new BPromise(function(_0x3d45c0,_0x1d39d6){return client[_0xacc3('0x9')](_0x271058,_0x38395a)['then'](function(_0x56a764){logger['info'](_0xacc3('0xa'),_0x98376a,'request\x20sent');logger[_0xacc3('0xb')](_0xacc3('0xc'),_0x98376a,_0xacc3('0xd'),JSON[_0xacc3('0xe')](_0x56a764));if(_0x56a764['error']){if(_0x56a764[_0xacc3('0xf')][_0xacc3('0x10')]===0x1f4){logger[_0xacc3('0xf')](_0xacc3('0xa'),_0x98376a,_0x56a764[_0xacc3('0xf')]['message']);return _0x1d39d6(_0x56a764['error']['message']);}logger[_0xacc3('0xf')](_0xacc3('0xa'),_0x98376a,_0x56a764[_0xacc3('0xf')]['message']);return _0x3d45c0(_0x56a764[_0xacc3('0xf')][_0xacc3('0x11')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x98376a,_0xacc3('0xd'));_0x3d45c0(_0x56a764[_0xacc3('0x12')][_0xacc3('0x11')]);}})[_0xacc3('0x13')](function(_0x15fd33){logger[_0xacc3('0xf')](_0xacc3('0xa'),_0x98376a,_0x15fd33);_0x1d39d6(_0x15fd33);});});}exports[_0xacc3('0x14')]=function(_0xac36b5){var _0x41c048=this;return new Promise(function(_0x3d9dc7,_0x9b9039){return db[_0xacc3('0x15')][_0xacc3('0x16')]({'raw':_0xac36b5['options']?_0xac36b5[_0xacc3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xac36b5[_0xacc3('0x17')]?_0xac36b5[_0xacc3('0x17')][_0xacc3('0x18')]||null:null,'attributes':_0xac36b5[_0xacc3('0x17')]?_0xac36b5[_0xacc3('0x17')]['attributes']||null:null,'limit':_0xac36b5[_0xacc3('0x17')]?_0xac36b5[_0xacc3('0x17')]['limit']||null:null,'include':_0xac36b5[_0xacc3('0x17')]?_0xac36b5['options'][_0xacc3('0x19')]?_[_0xacc3('0x1a')](_0xac36b5[_0xacc3('0x17')][_0xacc3('0x19')],function(_0x10427a){return{'model':db[_0x10427a[_0xacc3('0x1b')]],'as':_0x10427a['as'],'attributes':_0x10427a[_0xacc3('0x1c')],'include':_0x10427a[_0xacc3('0x19')]?_[_0xacc3('0x1a')](_0x10427a[_0xacc3('0x19')],function(_0x217ccb){return{'model':db[_0x217ccb[_0xacc3('0x1b')]],'as':_0x217ccb['as'],'attributes':_0x217ccb['attributes'],'include':_0x217ccb[_0xacc3('0x19')]?_[_0xacc3('0x1a')](_0x217ccb['include'],function(_0x3bca6c){return{'model':db[_0x3bca6c[_0xacc3('0x1b')]],'as':_0x3bca6c['as'],'attributes':_0x3bca6c[_0xacc3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a9e7a){logger[_0xacc3('0x1d')](_0xacc3('0x14'),_0xac36b5);logger[_0xacc3('0xb')](_0xacc3('0x14'),_0xac36b5,JSON[_0xacc3('0xe')](_0x3a9e7a));_0x3d9dc7(_0x3a9e7a);})[_0xacc3('0x13')](function(_0x27ac4f){logger[_0xacc3('0xf')](_0xacc3('0x14'),_0x27ac4f['message'],_0xac36b5);_0x9b9039(_0x41c048[_0xacc3('0xf')](0x1f4,_0x27ac4f[_0xacc3('0x11')]));});});};exports[_0xacc3('0x1e')]=function(_0x3b8aec){var _0x21919e=this;return new Promise(function(_0x30619c,_0x3deb49){return db[_0xacc3('0x15')][_0xacc3('0x1f')]({'raw':_0x3b8aec[_0xacc3('0x17')]?_0x3b8aec[_0xacc3('0x17')][_0xacc3('0x20')]===undefined?!![]:![]:!![],'where':_0x3b8aec[_0xacc3('0x17')]?_0x3b8aec[_0xacc3('0x17')][_0xacc3('0x18')]||null:null,'attributes':_0x3b8aec[_0xacc3('0x17')]?_0x3b8aec[_0xacc3('0x17')][_0xacc3('0x1c')]||null:null,'include':_0x3b8aec[_0xacc3('0x17')]?_0x3b8aec[_0xacc3('0x17')]['include']?_['map'](_0x3b8aec[_0xacc3('0x17')][_0xacc3('0x19')],function(_0x14339f){return{'model':db[_0x14339f[_0xacc3('0x1b')]],'as':_0x14339f['as'],'attributes':_0x14339f[_0xacc3('0x1c')],'include':_0x14339f[_0xacc3('0x19')]?_[_0xacc3('0x1a')](_0x14339f['include'],function(_0x2ee0ce){return{'model':db[_0x2ee0ce[_0xacc3('0x1b')]],'as':_0x2ee0ce['as'],'attributes':_0x2ee0ce[_0xacc3('0x1c')],'include':_0x2ee0ce['include']?_[_0xacc3('0x1a')](_0x2ee0ce[_0xacc3('0x19')],function(_0x4732f9){return{'model':db[_0x4732f9['model']],'as':_0x4732f9['as'],'attributes':_0x4732f9[_0xacc3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1be63d){logger[_0xacc3('0x1d')](_0xacc3('0x1e'),_0x3b8aec);logger[_0xacc3('0xb')]('ShowSugarcrmAccount',_0x3b8aec,JSON[_0xacc3('0xe')](_0x1be63d));_0x30619c(_0x1be63d);})['catch'](function(_0x543da4){logger['error'](_0xacc3('0x1e'),_0x543da4[_0xacc3('0x11')],_0x3b8aec);_0x3deb49(_0x21919e[_0xacc3('0xf')](0x1f4,_0x543da4[_0xacc3('0x11')]));});});}; \ No newline at end of file +var _0x26fb=['info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowSugarcrmAccount','stringify','lodash','moment','../../config/utils','../../config/logger','jayson/promise','http','request','then'];(function(_0x348d83,_0x1e627e){var _0x405138=function(_0x91b8bf){while(--_0x91b8bf){_0x348d83['push'](_0x348d83['shift']());}};_0x405138(++_0x1e627e);}(_0x26fb,0xac));var _0xb26f=function(_0x3a6039,_0x45173b){_0x3a6039=_0x3a6039-0x0;var _0x3fc6ed=_0x26fb[_0x3a6039];return _0x3fc6ed;};'use strict';var _=require(_0xb26f('0x0'));var util=require('util');var moment=require(_0xb26f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb26f('0x2'));var logger=require(_0xb26f('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb26f('0x4'));var client=jayson['client'][_0xb26f('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x3a40dd,_0x4a5654,_0x7b5660){return new BPromise(function(_0x1b8486,_0xa94529){return client[_0xb26f('0x6')](_0x3a40dd,_0x7b5660)[_0xb26f('0x7')](function(_0x12d53e){logger[_0xb26f('0x8')](_0xb26f('0x9'),_0x4a5654,_0xb26f('0xa'));logger[_0xb26f('0xb')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x4a5654,_0xb26f('0xa'),JSON['stringify'](_0x12d53e));if(_0x12d53e[_0xb26f('0xc')]){if(_0x12d53e['error']['code']===0x1f4){logger[_0xb26f('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x4a5654,_0x12d53e[_0xb26f('0xc')][_0xb26f('0xd')]);return _0xa94529(_0x12d53e[_0xb26f('0xc')][_0xb26f('0xd')]);}logger[_0xb26f('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x4a5654,_0x12d53e[_0xb26f('0xc')]['message']);return _0x1b8486(_0x12d53e['error'][_0xb26f('0xd')]);}else{logger[_0xb26f('0x8')](_0xb26f('0x9'),_0x4a5654,_0xb26f('0xa'));_0x1b8486(_0x12d53e[_0xb26f('0xe')][_0xb26f('0xd')]);}})[_0xb26f('0xf')](function(_0x5371be){logger[_0xb26f('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x4a5654,_0x5371be);_0xa94529(_0x5371be);});});}exports[_0xb26f('0x10')]=function(_0x214efc){var _0x40e141=this;return new Promise(function(_0x4a80cc,_0x428b3c){return db[_0xb26f('0x11')][_0xb26f('0x12')]({'raw':_0x214efc[_0xb26f('0x13')]?_0x214efc[_0xb26f('0x13')][_0xb26f('0x14')]===undefined?!![]:![]:!![],'where':_0x214efc[_0xb26f('0x13')]?_0x214efc[_0xb26f('0x13')][_0xb26f('0x15')]||null:null,'attributes':_0x214efc['options']?_0x214efc[_0xb26f('0x13')][_0xb26f('0x16')]||null:null,'limit':_0x214efc[_0xb26f('0x13')]?_0x214efc[_0xb26f('0x13')][_0xb26f('0x17')]||null:null,'include':_0x214efc[_0xb26f('0x13')]?_0x214efc[_0xb26f('0x13')][_0xb26f('0x18')]?_[_0xb26f('0x19')](_0x214efc[_0xb26f('0x13')]['include'],function(_0xc04cdd){return{'model':db[_0xc04cdd[_0xb26f('0x1a')]],'as':_0xc04cdd['as'],'attributes':_0xc04cdd['attributes'],'include':_0xc04cdd[_0xb26f('0x18')]?_[_0xb26f('0x19')](_0xc04cdd['include'],function(_0x59b64f){return{'model':db[_0x59b64f[_0xb26f('0x1a')]],'as':_0x59b64f['as'],'attributes':_0x59b64f[_0xb26f('0x16')],'include':_0x59b64f[_0xb26f('0x18')]?_[_0xb26f('0x19')](_0x59b64f[_0xb26f('0x18')],function(_0x2a3d59){return{'model':db[_0x2a3d59[_0xb26f('0x1a')]],'as':_0x2a3d59['as'],'attributes':_0x2a3d59['attributes']};}):[]};}):[]};}):[]:[]})[_0xb26f('0x7')](function(_0x5fcdd5){logger[_0xb26f('0x8')]('GetSugarcrmAccount',_0x214efc);logger[_0xb26f('0xb')](_0xb26f('0x10'),_0x214efc,JSON['stringify'](_0x5fcdd5));_0x4a80cc(_0x5fcdd5);})[_0xb26f('0xf')](function(_0x22a033){logger['error'](_0xb26f('0x10'),_0x22a033['message'],_0x214efc);_0x428b3c(_0x40e141[_0xb26f('0xc')](0x1f4,_0x22a033[_0xb26f('0xd')]));});});};exports['ShowSugarcrmAccount']=function(_0x24f9bb){var _0x22e3d8=this;return new Promise(function(_0x5684dd,_0x360be7){return db[_0xb26f('0x11')][_0xb26f('0x1b')]({'raw':_0x24f9bb[_0xb26f('0x13')]?_0x24f9bb[_0xb26f('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x24f9bb['options']?_0x24f9bb[_0xb26f('0x13')][_0xb26f('0x15')]||null:null,'attributes':_0x24f9bb[_0xb26f('0x13')]?_0x24f9bb[_0xb26f('0x13')][_0xb26f('0x16')]||null:null,'include':_0x24f9bb['options']?_0x24f9bb[_0xb26f('0x13')][_0xb26f('0x18')]?_[_0xb26f('0x19')](_0x24f9bb[_0xb26f('0x13')][_0xb26f('0x18')],function(_0xebf0e2){return{'model':db[_0xebf0e2[_0xb26f('0x1a')]],'as':_0xebf0e2['as'],'attributes':_0xebf0e2[_0xb26f('0x16')],'include':_0xebf0e2[_0xb26f('0x18')]?_[_0xb26f('0x19')](_0xebf0e2['include'],function(_0x52b3b1){return{'model':db[_0x52b3b1[_0xb26f('0x1a')]],'as':_0x52b3b1['as'],'attributes':_0x52b3b1[_0xb26f('0x16')],'include':_0x52b3b1[_0xb26f('0x18')]?_[_0xb26f('0x19')](_0x52b3b1[_0xb26f('0x18')],function(_0x4d30d5){return{'model':db[_0x4d30d5[_0xb26f('0x1a')]],'as':_0x4d30d5['as'],'attributes':_0x4d30d5[_0xb26f('0x16')]};}):[]};}):[]};}):[]:[]})[_0xb26f('0x7')](function(_0x3e658c){logger[_0xb26f('0x8')](_0xb26f('0x1c'),_0x24f9bb);logger[_0xb26f('0xb')](_0xb26f('0x1c'),_0x24f9bb,JSON[_0xb26f('0x1d')](_0x3e658c));_0x5684dd(_0x3e658c);})['catch'](function(_0x1ac753){logger[_0xb26f('0xc')]('ShowSugarcrmAccount',_0x1ac753[_0xb26f('0xd')],_0x24f9bb);_0x360be7(_0x22e3d8[_0xb26f('0xc')](0x1f4,_0x1ac753[_0xb26f('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index cdb035f..e836c5f 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 _0xd085=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','post','create','put','update','destroy','multer','path','connect-timeout'];(function(_0x8b3a7d,_0x3aec35){var _0x1d03df=function(_0x4bcfc4){while(--_0x4bcfc4){_0x8b3a7d['push'](_0x8b3a7d['shift']());}};_0x1d03df(++_0x3aec35);}(_0xd085,0x1b5));var _0x5d08=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0xd085[_0x1db251];return _0x56685a;};'use strict';var multer=require(_0x5d08('0x0'));var util=require('util');var path=require(_0x5d08('0x1'));var timeout=require(_0x5d08('0x2'));var express=require(_0x5d08('0x3'));var router=express[_0x5d08('0x4')]();var fs_extra=require(_0x5d08('0x5'));var auth=require(_0x5d08('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5d08('0x7'));var controller=require(_0x5d08('0x8'));router[_0x5d08('0x9')]('/',auth[_0x5d08('0xa')](),controller[_0x5d08('0xb')]);router[_0x5d08('0x9')](_0x5d08('0xc'),auth[_0x5d08('0xa')](),controller[_0x5d08('0xd')]);router[_0x5d08('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x5d08('0xe')]);router[_0x5d08('0x9')](_0x5d08('0xf'),auth[_0x5d08('0xa')](),controller['getSubjects']);router['get'](_0x5d08('0x10'),auth[_0x5d08('0xa')](),controller['getDescriptions']);router[_0x5d08('0x11')]('/',auth['isAuthenticated'](),controller[_0x5d08('0x12')]);router[_0x5d08('0x13')](_0x5d08('0xc'),auth[_0x5d08('0xa')](),controller[_0x5d08('0x14')]);router['delete'](_0x5d08('0xc'),auth[_0x5d08('0xa')](),controller[_0x5d08('0x15')]);module['exports']=router; \ No newline at end of file +var _0xdea7=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id'];(function(_0x3433b0,_0x40274b){var _0x4bfb12=function(_0x275601){while(--_0x275601){_0x3433b0['push'](_0x3433b0['shift']());}};_0x4bfb12(++_0x40274b);}(_0xdea7,0x1ac));var _0x7dea=function(_0x5f3d01,_0x251514){_0x5f3d01=_0x5f3d01-0x0;var _0x26183d=_0xdea7[_0x5f3d01];return _0x26183d;};'use strict';var multer=require(_0x7dea('0x0'));var util=require(_0x7dea('0x1'));var path=require(_0x7dea('0x2'));var timeout=require(_0x7dea('0x3'));var express=require(_0x7dea('0x4'));var router=express[_0x7dea('0x5')]();var fs_extra=require(_0x7dea('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7dea('0x7'));var controller=require(_0x7dea('0x8'));router[_0x7dea('0x9')]('/',auth[_0x7dea('0xa')](),controller[_0x7dea('0xb')]);router[_0x7dea('0x9')]('/:id',auth[_0x7dea('0xa')](),controller[_0x7dea('0xc')]);router[_0x7dea('0x9')](_0x7dea('0xd'),auth['isAuthenticated'](),controller[_0x7dea('0xe')]);router[_0x7dea('0x9')]('/:id/subjects',auth[_0x7dea('0xa')](),controller[_0x7dea('0xf')]);router[_0x7dea('0x9')](_0x7dea('0x10'),auth[_0x7dea('0xa')](),controller[_0x7dea('0x11')]);router[_0x7dea('0x12')]('/',auth['isAuthenticated'](),controller[_0x7dea('0x13')]);router[_0x7dea('0x14')](_0x7dea('0x15'),auth[_0x7dea('0xa')](),controller['update']);router[_0x7dea('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7dea('0x17')]);module[_0x7dea('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index f49d251..ed64bc1 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 _0x3d79=['exports','STRING'];(function(_0x142a07,_0x251e3c){var _0x101b6d=function(_0xcc9433){while(--_0xcc9433){_0x142a07['push'](_0x142a07['shift']());}};_0x101b6d(++_0x251e3c);}(_0x3d79,0x1e0));var _0x93d7=function(_0x4073bf,_0x1a966f){_0x4073bf=_0x4073bf-0x0;var _0x8c085a=_0x3d79[_0x4073bf];return _0x8c085a;};'use strict';var Sequelize=require('sequelize');module[_0x93d7('0x0')]={'name':{'type':Sequelize[_0x93d7('0x1')]},'description':{'type':Sequelize[_0x93d7('0x1')]}}; \ No newline at end of file +var _0x15bd=['STRING'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0x15bd,0x1b8));var _0xd15b=function(_0xdd1f52,_0x227e9e){_0xdd1f52=_0xdd1f52-0x0;var _0x368782=_0x15bd[_0xdd1f52];return _0x368782;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd15b('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 98f05c6..ce4d772 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 _0xdb8e=['status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','stack','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','getFields','SugarcrmField','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xdb8e,0x87));var _0xedb8=function(_0x54a28a,_0x1ba1fe){_0x54a28a=_0x54a28a-0x0;var _0x3da1f1=_0xdb8e[_0x54a28a];return _0x3da1f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedb8('0x0'));var zipdir=require(_0xedb8('0x1'));var jsonpatch=require(_0xedb8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xedb8('0x3'));var Mustache=require(_0xedb8('0x4'));var util=require(_0xedb8('0x5'));var path=require(_0xedb8('0x6'));var sox=require(_0xedb8('0x7'));var csv=require(_0xedb8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedb8('0x9'));var _=require(_0xedb8('0xa'));var squel=require(_0xedb8('0xb'));var crypto=require(_0xedb8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xedb8('0x8'));var querystring=require(_0xedb8('0xd'));var Papa=require(_0xedb8('0xe'));var Redis=require(_0xedb8('0xf'));var authService=require(_0xedb8('0x10'));var qs=require(_0xedb8('0x11'));var as=require(_0xedb8('0x12'));var hardwareService=require(_0xedb8('0x13'));var logger=require('../../config/logger')(_0xedb8('0x14'));var utils=require(_0xedb8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xedb8('0x16'));var db=require(_0xedb8('0x17'))['db'];function respondWithStatusCode(_0x55e17e,_0x4890d1){_0x4890d1=_0x4890d1||0xcc;return function(_0xcec05d){if(_0xcec05d){return _0x55e17e[_0xedb8('0x18')](_0x4890d1);}return _0x55e17e[_0xedb8('0x19')](_0x4890d1)[_0xedb8('0x1a')]();};}function respondWithResult(_0x2c466d,_0x5c6427){_0x5c6427=_0x5c6427||0xc8;return function(_0x46a6dd){if(_0x46a6dd){return _0x2c466d[_0xedb8('0x19')](_0x5c6427)['json'](_0x46a6dd);}};}function respondWithFilteredResult(_0x487634,_0x7458b){return function(_0x28e944){if(_0x28e944){var _0x36ac77=typeof _0x7458b[_0xedb8('0x1b')]===_0xedb8('0x1c')&&typeof _0x7458b['limit']===_0xedb8('0x1c');var _0x202d48=_0x28e944[_0xedb8('0x1d')];var _0x23f008=_0x36ac77?0x0:_0x7458b['offset'];var _0x2a63b1=_0x36ac77?_0x28e944[_0xedb8('0x1d')]:_0x7458b[_0xedb8('0x1b')]+_0x7458b[_0xedb8('0x1e')];var _0x39f242;if(_0x2a63b1>=_0x202d48){_0x2a63b1=_0x202d48;_0x39f242=0xc8;}else{_0x39f242=0xce;}_0x487634[_0xedb8('0x19')](_0x39f242);return _0x487634[_0xedb8('0x1f')](_0xedb8('0x20'),_0x23f008+'-'+_0x2a63b1+'/'+_0x202d48)[_0xedb8('0x21')](_0x28e944);}return null;};}function patchUpdates(_0x23e864){return function(_0x1254fc){try{jsonpatch[_0xedb8('0x22')](_0x1254fc,_0x23e864,!![]);}catch(_0x113860){return BPromise[_0xedb8('0x23')](_0x113860);}return _0x1254fc['save']();};}function saveUpdates(_0x17b72d,_0x488748){return function(_0x5a8e01){if(_0x5a8e01){return _0x5a8e01[_0xedb8('0x24')](_0x17b72d)[_0xedb8('0x25')](function(_0x432841){return _0x432841;});}return null;};}function removeEntity(_0x5767b3,_0x557545){return function(_0x4f7d53){if(_0x4f7d53){return _0x4f7d53['destroy']()[_0xedb8('0x25')](function(){_0x5767b3['status'](0xcc)[_0xedb8('0x1a')]();});}};}function handleEntityNotFound(_0x33f61a,_0x49a174){return function(_0x41802e){if(!_0x41802e){_0x33f61a[_0xedb8('0x18')](0x194);}return _0x41802e;};}function handleError(_0x3163a6,_0x5e3030){_0x5e3030=_0x5e3030||0x1f4;return function(_0x1dbb4f){logger['error'](_0x1dbb4f[_0xedb8('0x26')]);if(_0x1dbb4f['name']){delete _0x1dbb4f['name'];}_0x3163a6['status'](_0x5e3030)['send'](_0x1dbb4f);};}exports[_0xedb8('0x27')]=function(_0x1cc78f,_0x4f66e7){var _0x15602d={},_0x1f7425={},_0x19b7a5={'count':0x0,'rows':[]};var _0x4aa5aa=_[_0xedb8('0x28')](db[_0xedb8('0x29')][_0xedb8('0x2a')],function(_0x3e1d40){return{'name':_0x3e1d40[_0xedb8('0x2b')],'type':_0x3e1d40[_0xedb8('0x2c')][_0xedb8('0x2d')]};});_0x1f7425[_0xedb8('0x2e')]=_['map'](_0x4aa5aa,'name');_0x1f7425[_0xedb8('0x2f')]=_[_0xedb8('0x30')](_0x1cc78f[_0xedb8('0x2f')]);_0x1f7425['filters']=_['intersection'](_0x1f7425[_0xedb8('0x2e')],_0x1f7425['query']);_0x15602d[_0xedb8('0x31')]=_[_0xedb8('0x32')](_0x1f7425[_0xedb8('0x2e')],qs[_0xedb8('0x33')](_0x1cc78f[_0xedb8('0x2f')][_0xedb8('0x33')]));_0x15602d[_0xedb8('0x31')]=_0x15602d[_0xedb8('0x31')][_0xedb8('0x34')]?_0x15602d['attributes']:_0x1f7425[_0xedb8('0x2e')];if(!_0x1cc78f['query'][_0xedb8('0x35')](_0xedb8('0x36'))){_0x15602d[_0xedb8('0x1e')]=qs['limit'](_0x1cc78f[_0xedb8('0x2f')][_0xedb8('0x1e')]);_0x15602d[_0xedb8('0x1b')]=qs[_0xedb8('0x1b')](_0x1cc78f[_0xedb8('0x2f')][_0xedb8('0x1b')]);}_0x15602d[_0xedb8('0x37')]=qs[_0xedb8('0x38')](_0x1cc78f['query']['sort']);_0x15602d['where']=qs['filters'](_[_0xedb8('0x39')](_0x1cc78f[_0xedb8('0x2f')],_0x1f7425[_0xedb8('0x3a')]),_0x4aa5aa);if(_0x1cc78f['query'][_0xedb8('0x3b')]){_0x15602d['where']=_[_0xedb8('0x3c')](_0x15602d['where'],{'$or':_['map'](_0x4aa5aa,function(_0x12a054){if(_0x12a054[_0xedb8('0x2c')]!==_0xedb8('0x3d')){var _0x5cca3c={};_0x5cca3c[_0x12a054['name']]={'$like':'%'+_0x1cc78f['query'][_0xedb8('0x3b')]+'%'};return _0x5cca3c;}})});}_0x15602d=_['merge']({},_0x15602d,_0x1cc78f[_0xedb8('0x3e')]);var _0x52a53a={'where':_0x15602d[_0xedb8('0x3f')]};return db[_0xedb8('0x29')]['count'](_0x52a53a)[_0xedb8('0x25')](function(_0x3d4e36){_0x19b7a5[_0xedb8('0x1d')]=_0x3d4e36;if(_0x1cc78f[_0xedb8('0x2f')][_0xedb8('0x40')]){_0x15602d[_0xedb8('0x41')]=[{'all':!![]}];}return db[_0xedb8('0x29')][_0xedb8('0x42')](_0x15602d);})[_0xedb8('0x25')](function(_0x303959){_0x19b7a5[_0xedb8('0x43')]=_0x303959;return _0x19b7a5;})['then'](respondWithFilteredResult(_0x4f66e7,_0x15602d))[_0xedb8('0x44')](handleError(_0x4f66e7,null));};exports[_0xedb8('0x45')]=function(_0x24db9e,_0x2a3dbb){var _0x11f222={'raw':![],'where':{'id':_0x24db9e[_0xedb8('0x46')]['id']}},_0x5a38dd={};_0x5a38dd[_0xedb8('0x2e')]=_[_0xedb8('0x30')](db['SugarcrmConfiguration'][_0xedb8('0x2a')]);_0x5a38dd[_0xedb8('0x2f')]=_[_0xedb8('0x30')](_0x24db9e['query']);_0x5a38dd[_0xedb8('0x3a')]=_[_0xedb8('0x32')](_0x5a38dd[_0xedb8('0x2e')],_0x5a38dd['query']);_0x11f222[_0xedb8('0x31')]=_['intersection'](_0x5a38dd[_0xedb8('0x2e')],qs['fields'](_0x24db9e['query'][_0xedb8('0x33')]));_0x11f222[_0xedb8('0x31')]=_0x11f222[_0xedb8('0x31')][_0xedb8('0x34')]?_0x11f222[_0xedb8('0x31')]:_0x5a38dd[_0xedb8('0x2e')];if(_0x24db9e[_0xedb8('0x2f')][_0xedb8('0x40')]){_0x11f222['include']=[{'all':!![]}];}_0x11f222=_[_0xedb8('0x3c')]({},_0x11f222,_0x24db9e[_0xedb8('0x3e')]);return db[_0xedb8('0x29')]['find'](_0x11f222)[_0xedb8('0x25')](handleEntityNotFound(_0x2a3dbb,null))[_0xedb8('0x25')](respondWithResult(_0x2a3dbb,null))[_0xedb8('0x44')](handleError(_0x2a3dbb,null));};exports[_0xedb8('0x47')]=function(_0x15d43d,_0x1245f6){return db[_0xedb8('0x29')]['create'](_0x15d43d[_0xedb8('0x48')],{})['then'](respondWithResult(_0x1245f6,0xc9))['catch'](handleError(_0x1245f6,null));};exports['update']=function(_0x4f4fc0,_0x4accc5){if(_0x4f4fc0['body']['id']){delete _0x4f4fc0['body']['id'];}return db[_0xedb8('0x29')][_0xedb8('0x49')]({'where':{'id':_0x4f4fc0[_0xedb8('0x46')]['id']}})['then'](handleEntityNotFound(_0x4accc5,null))[_0xedb8('0x25')](saveUpdates(_0x4f4fc0[_0xedb8('0x48')],null))['then'](respondWithResult(_0x4accc5,null))[_0xedb8('0x44')](handleError(_0x4accc5,null));};exports[_0xedb8('0x4a')]=function(_0x35c87a,_0x22f38c){return db[_0xedb8('0x29')][_0xedb8('0x49')]({'where':{'id':_0x35c87a['params']['id']}})[_0xedb8('0x25')](handleEntityNotFound(_0x22f38c,null))[_0xedb8('0x25')](removeEntity(_0x22f38c,null))['catch'](handleError(_0x22f38c,null));};exports[_0xedb8('0x4b')]=function(_0x4d68d3,_0x260e92,_0x13c385){var _0x1e34c8={};var _0x3adf6e={};var _0xd1b4bf;var _0x3c5eaa;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x4d68d3[_0xedb8('0x46')]['id']}})[_0xedb8('0x25')](handleEntityNotFound(_0x260e92,null))[_0xedb8('0x25')](function(_0x31e057){if(_0x31e057){_0xd1b4bf=_0x31e057;_0x3adf6e[_0xedb8('0x2e')]=_[_0xedb8('0x30')](db[_0xedb8('0x4c')]['rawAttributes']);_0x3adf6e[_0xedb8('0x2f')]=_[_0xedb8('0x30')](_0x4d68d3[_0xedb8('0x2f')]);_0x3adf6e[_0xedb8('0x3a')]=_[_0xedb8('0x32')](_0x3adf6e[_0xedb8('0x2e')],_0x3adf6e[_0xedb8('0x2f')]);_0x1e34c8[_0xedb8('0x31')]=_['intersection'](_0x3adf6e[_0xedb8('0x2e')],qs[_0xedb8('0x33')](_0x4d68d3['query'][_0xedb8('0x33')]));_0x1e34c8[_0xedb8('0x31')]=_0x1e34c8[_0xedb8('0x31')][_0xedb8('0x34')]?_0x1e34c8[_0xedb8('0x31')]:_0x3adf6e['model'];_0x1e34c8[_0xedb8('0x37')]=qs[_0xedb8('0x38')](_0x4d68d3[_0xedb8('0x2f')][_0xedb8('0x38')]);_0x1e34c8[_0xedb8('0x3f')]=qs[_0xedb8('0x3a')](_['pick'](_0x4d68d3[_0xedb8('0x2f')],_0x3adf6e['filters']));if(_0x4d68d3[_0xedb8('0x2f')][_0xedb8('0x3b')]){_0x1e34c8[_0xedb8('0x3f')]=_[_0xedb8('0x3c')](_0x1e34c8[_0xedb8('0x3f')],{'$or':_[_0xedb8('0x28')](_0x1e34c8[_0xedb8('0x31')],function(_0x42d966){var _0x339668={};_0x339668[_0x42d966]={'$like':'%'+_0x4d68d3[_0xedb8('0x2f')][_0xedb8('0x3b')]+'%'};return _0x339668;})});}_0x1e34c8=_[_0xedb8('0x3c')]({},_0x1e34c8,_0x4d68d3[_0xedb8('0x3e')]);return _0xd1b4bf[_0xedb8('0x4b')](_0x1e34c8);}})['then'](function(_0x4d2ff1){if(_0x4d2ff1){_0x3c5eaa=_0x4d2ff1[_0xedb8('0x34')];if(!_0x4d68d3[_0xedb8('0x2f')][_0xedb8('0x35')](_0xedb8('0x36'))){_0x1e34c8[_0xedb8('0x1e')]=qs[_0xedb8('0x1e')](_0x4d68d3[_0xedb8('0x2f')][_0xedb8('0x1e')]);_0x1e34c8['offset']=qs[_0xedb8('0x1b')](_0x4d68d3[_0xedb8('0x2f')][_0xedb8('0x1b')]);}return _0xd1b4bf[_0xedb8('0x4b')](_0x1e34c8);}})[_0xedb8('0x25')](function(_0xfd1b64){if(_0xfd1b64){return _0xfd1b64?{'count':_0x3c5eaa,'rows':_0xfd1b64}:null;}})[_0xedb8('0x25')](respondWithResult(_0x260e92,null))[_0xedb8('0x44')](handleError(_0x260e92,null));};exports[_0xedb8('0x4d')]=function(_0x9c0d66,_0x408dad,_0x44c077){var _0x162b0d={};var _0x5a45f6={};var _0x2b039c;var _0x424977;return db[_0xedb8('0x29')][_0xedb8('0x4e')]({'where':{'id':_0x9c0d66[_0xedb8('0x46')]['id']}})['then'](handleEntityNotFound(_0x408dad,null))[_0xedb8('0x25')](function(_0x3efa2d){if(_0x3efa2d){_0x2b039c=_0x3efa2d;_0x5a45f6[_0xedb8('0x2e')]=_[_0xedb8('0x30')](db[_0xedb8('0x4c')]['rawAttributes']);_0x5a45f6[_0xedb8('0x2f')]=_['keys'](_0x9c0d66[_0xedb8('0x2f')]);_0x5a45f6[_0xedb8('0x3a')]=_[_0xedb8('0x32')](_0x5a45f6[_0xedb8('0x2e')],_0x5a45f6[_0xedb8('0x2f')]);_0x162b0d[_0xedb8('0x31')]=_[_0xedb8('0x32')](_0x5a45f6[_0xedb8('0x2e')],qs[_0xedb8('0x33')](_0x9c0d66['query']['fields']));_0x162b0d['attributes']=_0x162b0d[_0xedb8('0x31')][_0xedb8('0x34')]?_0x162b0d['attributes']:_0x5a45f6[_0xedb8('0x2e')];_0x162b0d[_0xedb8('0x37')]=qs[_0xedb8('0x38')](_0x9c0d66['query'][_0xedb8('0x38')]);_0x162b0d['where']=qs[_0xedb8('0x3a')](_['pick'](_0x9c0d66[_0xedb8('0x2f')],_0x5a45f6[_0xedb8('0x3a')]));if(_0x9c0d66[_0xedb8('0x2f')][_0xedb8('0x3b')]){_0x162b0d[_0xedb8('0x3f')]=_['merge'](_0x162b0d[_0xedb8('0x3f')],{'$or':_[_0xedb8('0x28')](_0x162b0d[_0xedb8('0x31')],function(_0xb854ab){var _0x271f72={};_0x271f72[_0xb854ab]={'$like':'%'+_0x9c0d66[_0xedb8('0x2f')][_0xedb8('0x3b')]+'%'};return _0x271f72;})});}_0x162b0d=_['merge']({},_0x162b0d,_0x9c0d66[_0xedb8('0x3e')]);return _0x2b039c[_0xedb8('0x4d')](_0x162b0d);}})[_0xedb8('0x25')](function(_0x2f5b8e){if(_0x2f5b8e){_0x424977=_0x2f5b8e['length'];if(!_0x9c0d66[_0xedb8('0x2f')][_0xedb8('0x35')]('nolimit')){_0x162b0d['limit']=qs[_0xedb8('0x1e')](_0x9c0d66[_0xedb8('0x2f')][_0xedb8('0x1e')]);_0x162b0d[_0xedb8('0x1b')]=qs['offset'](_0x9c0d66[_0xedb8('0x2f')][_0xedb8('0x1b')]);}return _0x2b039c[_0xedb8('0x4d')](_0x162b0d);}})['then'](function(_0x201ff1){if(_0x201ff1){return _0x201ff1?{'count':_0x424977,'rows':_0x201ff1}:null;}})[_0xedb8('0x25')](respondWithResult(_0x408dad,null))[_0xedb8('0x44')](handleError(_0x408dad,null));};exports[_0xedb8('0x4f')]=function(_0x4c5bfa,_0x38d3b,_0x2780a8){var _0x1e0dfe={};var _0x317a82={};var _0x7c6307;var _0xe448b;return db['SugarcrmConfiguration'][_0xedb8('0x4e')]({'where':{'id':_0x4c5bfa[_0xedb8('0x46')]['id']}})[_0xedb8('0x25')](handleEntityNotFound(_0x38d3b,null))[_0xedb8('0x25')](function(_0x51d666){if(_0x51d666){_0x7c6307=_0x51d666;_0x317a82[_0xedb8('0x2e')]=_[_0xedb8('0x30')](db[_0xedb8('0x4c')][_0xedb8('0x2a')]);_0x317a82['query']=_[_0xedb8('0x30')](_0x4c5bfa[_0xedb8('0x2f')]);_0x317a82[_0xedb8('0x3a')]=_[_0xedb8('0x32')](_0x317a82['model'],_0x317a82['query']);_0x1e0dfe[_0xedb8('0x31')]=_[_0xedb8('0x32')](_0x317a82[_0xedb8('0x2e')],qs['fields'](_0x4c5bfa[_0xedb8('0x2f')][_0xedb8('0x33')]));_0x1e0dfe[_0xedb8('0x31')]=_0x1e0dfe[_0xedb8('0x31')][_0xedb8('0x34')]?_0x1e0dfe[_0xedb8('0x31')]:_0x317a82[_0xedb8('0x2e')];_0x1e0dfe['order']=qs[_0xedb8('0x38')](_0x4c5bfa[_0xedb8('0x2f')]['sort']);_0x1e0dfe['where']=qs[_0xedb8('0x3a')](_[_0xedb8('0x39')](_0x4c5bfa[_0xedb8('0x2f')],_0x317a82['filters']));if(_0x4c5bfa['query'][_0xedb8('0x3b')]){_0x1e0dfe[_0xedb8('0x3f')]=_[_0xedb8('0x3c')](_0x1e0dfe[_0xedb8('0x3f')],{'$or':_[_0xedb8('0x28')](_0x1e0dfe[_0xedb8('0x31')],function(_0x46fb50){var _0x315762={};_0x315762[_0x46fb50]={'$like':'%'+_0x4c5bfa[_0xedb8('0x2f')][_0xedb8('0x3b')]+'%'};return _0x315762;})});}_0x1e0dfe=_[_0xedb8('0x3c')]({},_0x1e0dfe,_0x4c5bfa[_0xedb8('0x3e')]);return _0x7c6307[_0xedb8('0x4f')](_0x1e0dfe);}})[_0xedb8('0x25')](function(_0x53d896){if(_0x53d896){_0xe448b=_0x53d896[_0xedb8('0x34')];if(!_0x4c5bfa[_0xedb8('0x2f')][_0xedb8('0x35')]('nolimit')){_0x1e0dfe['limit']=qs[_0xedb8('0x1e')](_0x4c5bfa[_0xedb8('0x2f')]['limit']);_0x1e0dfe[_0xedb8('0x1b')]=qs['offset'](_0x4c5bfa[_0xedb8('0x2f')][_0xedb8('0x1b')]);}return _0x7c6307[_0xedb8('0x4f')](_0x1e0dfe);}})['then'](function(_0x49dd71){if(_0x49dd71){return _0x49dd71?{'count':_0xe448b,'rows':_0x49dd71}:null;}})['then'](respondWithResult(_0x38d3b,null))[_0xedb8('0x44')](handleError(_0x38d3b,null));}; \ No newline at end of file +var _0x9e8e=['squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','apply','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','findAll','rows','show','params','catch','create','body','find','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash'];(function(_0x550040,_0x47a2f5){var _0x3667cb=function(_0x22b083){while(--_0x22b083){_0x550040['push'](_0x550040['shift']());}};_0x3667cb(++_0x47a2f5);}(_0x9e8e,0xdf));var _0xe9e8=function(_0x349e1a,_0x42ea9b){_0x349e1a=_0x349e1a-0x0;var _0x544440=_0x9e8e[_0x349e1a];return _0x544440;};'use strict';var emlformat=require(_0xe9e8('0x0'));var rimraf=require(_0xe9e8('0x1'));var zipdir=require(_0xe9e8('0x2'));var jsonpatch=require(_0xe9e8('0x3'));var rp=require(_0xe9e8('0x4'));var moment=require(_0xe9e8('0x5'));var BPromise=require(_0xe9e8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xe9e8('0x7'));var csv=require('to-csv');var ejs=require(_0xe9e8('0x8'));var fs=require('fs');var fs_extra=require(_0xe9e8('0x9'));var _=require(_0xe9e8('0xa'));var squel=require(_0xe9e8('0xb'));var crypto=require(_0xe9e8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe9e8('0xd'));var querystring=require(_0xe9e8('0xe'));var Papa=require(_0xe9e8('0xf'));var Redis=require(_0xe9e8('0x10'));var authService=require(_0xe9e8('0x11'));var qs=require(_0xe9e8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9e8('0x13'));var logger=require(_0xe9e8('0x14'))('api');var utils=require(_0xe9e8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe9e8('0x16'));var db=require(_0xe9e8('0x17'))['db'];function respondWithStatusCode(_0x336754,_0x9207d8){_0x9207d8=_0x9207d8||0xcc;return function(_0x13091f){if(_0x13091f){return _0x336754[_0xe9e8('0x18')](_0x9207d8);}return _0x336754['status'](_0x9207d8)[_0xe9e8('0x19')]();};}function respondWithResult(_0x4cacb9,_0x501cd7){_0x501cd7=_0x501cd7||0xc8;return function(_0x1fbbe3){if(_0x1fbbe3){return _0x4cacb9['status'](_0x501cd7)[_0xe9e8('0x1a')](_0x1fbbe3);}};}function respondWithFilteredResult(_0x35cd6b,_0x5682c5){return function(_0x47d20b){if(_0x47d20b){var _0x22fb9a=typeof _0x5682c5[_0xe9e8('0x1b')]===_0xe9e8('0x1c')&&typeof _0x5682c5[_0xe9e8('0x1d')]==='undefined';var _0x570f5e=_0x47d20b[_0xe9e8('0x1e')];var _0x36b1a7=_0x22fb9a?0x0:_0x5682c5[_0xe9e8('0x1b')];var _0x2ed6a3=_0x22fb9a?_0x47d20b[_0xe9e8('0x1e')]:_0x5682c5['offset']+_0x5682c5['limit'];var _0x17411f;if(_0x2ed6a3>=_0x570f5e){_0x2ed6a3=_0x570f5e;_0x17411f=0xc8;}else{_0x17411f=0xce;}_0x35cd6b[_0xe9e8('0x1f')](_0x17411f);return _0x35cd6b['set']('Content-Range',_0x36b1a7+'-'+_0x2ed6a3+'/'+_0x570f5e)['json'](_0x47d20b);}return null;};}function patchUpdates(_0xb59411){return function(_0x3448c8){try{jsonpatch[_0xe9e8('0x20')](_0x3448c8,_0xb59411,!![]);}catch(_0x55d2c3){return BPromise['reject'](_0x55d2c3);}return _0x3448c8[_0xe9e8('0x21')]();};}function saveUpdates(_0x4a7f91,_0x556f22){return function(_0xdbb082){if(_0xdbb082){return _0xdbb082[_0xe9e8('0x22')](_0x4a7f91)[_0xe9e8('0x23')](function(_0x1eedc7){return _0x1eedc7;});}return null;};}function removeEntity(_0x5f21c2,_0x17380d){return function(_0xc377e7){if(_0xc377e7){return _0xc377e7[_0xe9e8('0x24')]()[_0xe9e8('0x23')](function(){_0x5f21c2[_0xe9e8('0x1f')](0xcc)[_0xe9e8('0x19')]();});}};}function handleEntityNotFound(_0x52fcb4,_0x3b9871){return function(_0xd6f019){if(!_0xd6f019){_0x52fcb4[_0xe9e8('0x18')](0x194);}return _0xd6f019;};}function handleError(_0x41e516,_0x2e3d2d){_0x2e3d2d=_0x2e3d2d||0x1f4;return function(_0x1b1edc){logger['error'](_0x1b1edc[_0xe9e8('0x25')]);if(_0x1b1edc[_0xe9e8('0x26')]){delete _0x1b1edc[_0xe9e8('0x26')];}_0x41e516['status'](_0x2e3d2d)[_0xe9e8('0x27')](_0x1b1edc);};}exports['index']=function(_0x586963,_0xf466c2){var _0x50c9e3={},_0x69a094={},_0x1394a6={'count':0x0,'rows':[]};var _0x4e58d0=_[_0xe9e8('0x28')](db['SugarcrmConfiguration'][_0xe9e8('0x29')],function(_0x347e8d){return{'name':_0x347e8d[_0xe9e8('0x2a')],'type':_0x347e8d['type'][_0xe9e8('0x2b')]};});_0x69a094[_0xe9e8('0x2c')]=_[_0xe9e8('0x28')](_0x4e58d0,'name');_0x69a094[_0xe9e8('0x2d')]=_[_0xe9e8('0x2e')](_0x586963[_0xe9e8('0x2d')]);_0x69a094[_0xe9e8('0x2f')]=_[_0xe9e8('0x30')](_0x69a094[_0xe9e8('0x2c')],_0x69a094['query']);_0x50c9e3['attributes']=_['intersection'](_0x69a094['model'],qs[_0xe9e8('0x31')](_0x586963[_0xe9e8('0x2d')][_0xe9e8('0x31')]));_0x50c9e3['attributes']=_0x50c9e3[_0xe9e8('0x32')][_0xe9e8('0x33')]?_0x50c9e3[_0xe9e8('0x32')]:_0x69a094[_0xe9e8('0x2c')];if(!_0x586963[_0xe9e8('0x2d')][_0xe9e8('0x34')](_0xe9e8('0x35'))){_0x50c9e3[_0xe9e8('0x1d')]=qs['limit'](_0x586963[_0xe9e8('0x2d')][_0xe9e8('0x1d')]);_0x50c9e3[_0xe9e8('0x1b')]=qs[_0xe9e8('0x1b')](_0x586963['query'][_0xe9e8('0x1b')]);}_0x50c9e3[_0xe9e8('0x36')]=qs[_0xe9e8('0x37')](_0x586963['query'][_0xe9e8('0x37')]);_0x50c9e3[_0xe9e8('0x38')]=qs[_0xe9e8('0x2f')](_[_0xe9e8('0x39')](_0x586963['query'],_0x69a094['filters']),_0x4e58d0);if(_0x586963[_0xe9e8('0x2d')][_0xe9e8('0x3a')]){_0x50c9e3['where']=_[_0xe9e8('0x3b')](_0x50c9e3[_0xe9e8('0x38')],{'$or':_[_0xe9e8('0x28')](_0x4e58d0,function(_0x2f9519){if(_0x2f9519['type']!==_0xe9e8('0x3c')){var _0x2c4f22={};_0x2c4f22[_0x2f9519[_0xe9e8('0x26')]]={'$like':'%'+_0x586963[_0xe9e8('0x2d')][_0xe9e8('0x3a')]+'%'};return _0x2c4f22;}})});}_0x50c9e3=_[_0xe9e8('0x3b')]({},_0x50c9e3,_0x586963[_0xe9e8('0x3d')]);var _0x4bbb3c={'where':_0x50c9e3['where']};return db[_0xe9e8('0x3e')][_0xe9e8('0x1e')](_0x4bbb3c)['then'](function(_0x577b0a){_0x1394a6[_0xe9e8('0x1e')]=_0x577b0a;if(_0x586963[_0xe9e8('0x2d')][_0xe9e8('0x3f')]){_0x50c9e3[_0xe9e8('0x40')]=[{'all':!![]}];}return db[_0xe9e8('0x3e')][_0xe9e8('0x41')](_0x50c9e3);})[_0xe9e8('0x23')](function(_0xa4a874){_0x1394a6[_0xe9e8('0x42')]=_0xa4a874;return _0x1394a6;})[_0xe9e8('0x23')](respondWithFilteredResult(_0xf466c2,_0x50c9e3))['catch'](handleError(_0xf466c2,null));};exports[_0xe9e8('0x43')]=function(_0x49a3a8,_0x595f37){var _0x4143db={'raw':![],'where':{'id':_0x49a3a8[_0xe9e8('0x44')]['id']}},_0x16f2f5={};_0x16f2f5[_0xe9e8('0x2c')]=_[_0xe9e8('0x2e')](db[_0xe9e8('0x3e')]['rawAttributes']);_0x16f2f5[_0xe9e8('0x2d')]=_[_0xe9e8('0x2e')](_0x49a3a8[_0xe9e8('0x2d')]);_0x16f2f5[_0xe9e8('0x2f')]=_[_0xe9e8('0x30')](_0x16f2f5['model'],_0x16f2f5['query']);_0x4143db[_0xe9e8('0x32')]=_[_0xe9e8('0x30')](_0x16f2f5['model'],qs[_0xe9e8('0x31')](_0x49a3a8[_0xe9e8('0x2d')][_0xe9e8('0x31')]));_0x4143db[_0xe9e8('0x32')]=_0x4143db['attributes'][_0xe9e8('0x33')]?_0x4143db[_0xe9e8('0x32')]:_0x16f2f5['model'];if(_0x49a3a8['query'][_0xe9e8('0x3f')]){_0x4143db[_0xe9e8('0x40')]=[{'all':!![]}];}_0x4143db=_['merge']({},_0x4143db,_0x49a3a8['options']);return db['SugarcrmConfiguration']['find'](_0x4143db)['then'](handleEntityNotFound(_0x595f37,null))[_0xe9e8('0x23')](respondWithResult(_0x595f37,null))[_0xe9e8('0x45')](handleError(_0x595f37,null));};exports[_0xe9e8('0x46')]=function(_0x495e27,_0x2860fb){return db[_0xe9e8('0x3e')][_0xe9e8('0x46')](_0x495e27[_0xe9e8('0x47')],{})['then'](respondWithResult(_0x2860fb,0xc9))['catch'](handleError(_0x2860fb,null));};exports[_0xe9e8('0x22')]=function(_0x2aefd6,_0x1ca49b){if(_0x2aefd6[_0xe9e8('0x47')]['id']){delete _0x2aefd6[_0xe9e8('0x47')]['id'];}return db[_0xe9e8('0x3e')]['find']({'where':{'id':_0x2aefd6['params']['id']}})[_0xe9e8('0x23')](handleEntityNotFound(_0x1ca49b,null))[_0xe9e8('0x23')](saveUpdates(_0x2aefd6[_0xe9e8('0x47')],null))[_0xe9e8('0x23')](respondWithResult(_0x1ca49b,null))['catch'](handleError(_0x1ca49b,null));};exports[_0xe9e8('0x24')]=function(_0x50e3a1,_0x2a2afe){return db[_0xe9e8('0x3e')][_0xe9e8('0x48')]({'where':{'id':_0x50e3a1[_0xe9e8('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a2afe,null))['then'](removeEntity(_0x2a2afe,null))[_0xe9e8('0x45')](handleError(_0x2a2afe,null));};exports[_0xe9e8('0x49')]=function(_0x1be32f,_0x4c139d,_0x46ad6c){var _0x26eadf={};var _0x4cd37a={};var _0x1813c5;var _0x3177b6;return db[_0xe9e8('0x3e')][_0xe9e8('0x4a')]({'where':{'id':_0x1be32f[_0xe9e8('0x44')]['id']}})['then'](handleEntityNotFound(_0x4c139d,null))['then'](function(_0x48fe11){if(_0x48fe11){_0x1813c5=_0x48fe11;_0x4cd37a[_0xe9e8('0x2c')]=_[_0xe9e8('0x2e')](db[_0xe9e8('0x4b')][_0xe9e8('0x29')]);_0x4cd37a[_0xe9e8('0x2d')]=_[_0xe9e8('0x2e')](_0x1be32f[_0xe9e8('0x2d')]);_0x4cd37a[_0xe9e8('0x2f')]=_['intersection'](_0x4cd37a[_0xe9e8('0x2c')],_0x4cd37a[_0xe9e8('0x2d')]);_0x26eadf[_0xe9e8('0x32')]=_[_0xe9e8('0x30')](_0x4cd37a['model'],qs[_0xe9e8('0x31')](_0x1be32f['query'][_0xe9e8('0x31')]));_0x26eadf['attributes']=_0x26eadf[_0xe9e8('0x32')][_0xe9e8('0x33')]?_0x26eadf[_0xe9e8('0x32')]:_0x4cd37a['model'];_0x26eadf[_0xe9e8('0x36')]=qs[_0xe9e8('0x37')](_0x1be32f['query'][_0xe9e8('0x37')]);_0x26eadf[_0xe9e8('0x38')]=qs[_0xe9e8('0x2f')](_[_0xe9e8('0x39')](_0x1be32f['query'],_0x4cd37a[_0xe9e8('0x2f')]));if(_0x1be32f[_0xe9e8('0x2d')][_0xe9e8('0x3a')]){_0x26eadf[_0xe9e8('0x38')]=_[_0xe9e8('0x3b')](_0x26eadf[_0xe9e8('0x38')],{'$or':_[_0xe9e8('0x28')](_0x26eadf['attributes'],function(_0x5f1774){var _0x37fbb0={};_0x37fbb0[_0x5f1774]={'$like':'%'+_0x1be32f[_0xe9e8('0x2d')][_0xe9e8('0x3a')]+'%'};return _0x37fbb0;})});}_0x26eadf=_[_0xe9e8('0x3b')]({},_0x26eadf,_0x1be32f[_0xe9e8('0x3d')]);return _0x1813c5[_0xe9e8('0x49')](_0x26eadf);}})[_0xe9e8('0x23')](function(_0x123fe9){if(_0x123fe9){_0x3177b6=_0x123fe9[_0xe9e8('0x33')];if(!_0x1be32f[_0xe9e8('0x2d')][_0xe9e8('0x34')](_0xe9e8('0x35'))){_0x26eadf[_0xe9e8('0x1d')]=qs[_0xe9e8('0x1d')](_0x1be32f[_0xe9e8('0x2d')][_0xe9e8('0x1d')]);_0x26eadf[_0xe9e8('0x1b')]=qs[_0xe9e8('0x1b')](_0x1be32f['query'][_0xe9e8('0x1b')]);}return _0x1813c5['getFields'](_0x26eadf);}})[_0xe9e8('0x23')](function(_0x21f249){if(_0x21f249){return _0x21f249?{'count':_0x3177b6,'rows':_0x21f249}:null;}})[_0xe9e8('0x23')](respondWithResult(_0x4c139d,null))['catch'](handleError(_0x4c139d,null));};exports[_0xe9e8('0x4c')]=function(_0x56165c,_0x3ba455,_0x693498){var _0x50cc0f={};var _0x32c3e4={};var _0x421acb;var _0xebbb1f;return db[_0xe9e8('0x3e')][_0xe9e8('0x4a')]({'where':{'id':_0x56165c[_0xe9e8('0x44')]['id']}})[_0xe9e8('0x23')](handleEntityNotFound(_0x3ba455,null))[_0xe9e8('0x23')](function(_0x2e9935){if(_0x2e9935){_0x421acb=_0x2e9935;_0x32c3e4[_0xe9e8('0x2c')]=_[_0xe9e8('0x2e')](db[_0xe9e8('0x4b')][_0xe9e8('0x29')]);_0x32c3e4['query']=_[_0xe9e8('0x2e')](_0x56165c[_0xe9e8('0x2d')]);_0x32c3e4[_0xe9e8('0x2f')]=_[_0xe9e8('0x30')](_0x32c3e4[_0xe9e8('0x2c')],_0x32c3e4[_0xe9e8('0x2d')]);_0x50cc0f[_0xe9e8('0x32')]=_[_0xe9e8('0x30')](_0x32c3e4['model'],qs[_0xe9e8('0x31')](_0x56165c[_0xe9e8('0x2d')]['fields']));_0x50cc0f[_0xe9e8('0x32')]=_0x50cc0f[_0xe9e8('0x32')][_0xe9e8('0x33')]?_0x50cc0f[_0xe9e8('0x32')]:_0x32c3e4[_0xe9e8('0x2c')];_0x50cc0f[_0xe9e8('0x36')]=qs[_0xe9e8('0x37')](_0x56165c[_0xe9e8('0x2d')]['sort']);_0x50cc0f[_0xe9e8('0x38')]=qs[_0xe9e8('0x2f')](_[_0xe9e8('0x39')](_0x56165c[_0xe9e8('0x2d')],_0x32c3e4['filters']));if(_0x56165c['query'][_0xe9e8('0x3a')]){_0x50cc0f[_0xe9e8('0x38')]=_[_0xe9e8('0x3b')](_0x50cc0f[_0xe9e8('0x38')],{'$or':_[_0xe9e8('0x28')](_0x50cc0f[_0xe9e8('0x32')],function(_0x542427){var _0x416b4a={};_0x416b4a[_0x542427]={'$like':'%'+_0x56165c[_0xe9e8('0x2d')]['filter']+'%'};return _0x416b4a;})});}_0x50cc0f=_['merge']({},_0x50cc0f,_0x56165c['options']);return _0x421acb[_0xe9e8('0x4c')](_0x50cc0f);}})[_0xe9e8('0x23')](function(_0x1bb0fb){if(_0x1bb0fb){_0xebbb1f=_0x1bb0fb[_0xe9e8('0x33')];if(!_0x56165c[_0xe9e8('0x2d')][_0xe9e8('0x34')](_0xe9e8('0x35'))){_0x50cc0f['limit']=qs[_0xe9e8('0x1d')](_0x56165c[_0xe9e8('0x2d')][_0xe9e8('0x1d')]);_0x50cc0f[_0xe9e8('0x1b')]=qs['offset'](_0x56165c[_0xe9e8('0x2d')]['offset']);}return _0x421acb['getSubjects'](_0x50cc0f);}})['then'](function(_0x2f21ea){if(_0x2f21ea){return _0x2f21ea?{'count':_0xebbb1f,'rows':_0x2f21ea}:null;}})['then'](respondWithResult(_0x3ba455,null))[_0xe9e8('0x45')](handleError(_0x3ba455,null));};exports[_0xe9e8('0x4d')]=function(_0x34d9c5,_0x12ff6e,_0x27422a){var _0x4e3858={};var _0x4d03e2={};var _0x471730;var _0x18628c;return db[_0xe9e8('0x3e')][_0xe9e8('0x4a')]({'where':{'id':_0x34d9c5['params']['id']}})[_0xe9e8('0x23')](handleEntityNotFound(_0x12ff6e,null))['then'](function(_0x3133ec){if(_0x3133ec){_0x471730=_0x3133ec;_0x4d03e2[_0xe9e8('0x2c')]=_[_0xe9e8('0x2e')](db[_0xe9e8('0x4b')][_0xe9e8('0x29')]);_0x4d03e2[_0xe9e8('0x2d')]=_[_0xe9e8('0x2e')](_0x34d9c5['query']);_0x4d03e2['filters']=_[_0xe9e8('0x30')](_0x4d03e2[_0xe9e8('0x2c')],_0x4d03e2[_0xe9e8('0x2d')]);_0x4e3858[_0xe9e8('0x32')]=_[_0xe9e8('0x30')](_0x4d03e2[_0xe9e8('0x2c')],qs['fields'](_0x34d9c5['query']['fields']));_0x4e3858[_0xe9e8('0x32')]=_0x4e3858['attributes'][_0xe9e8('0x33')]?_0x4e3858['attributes']:_0x4d03e2[_0xe9e8('0x2c')];_0x4e3858[_0xe9e8('0x36')]=qs['sort'](_0x34d9c5[_0xe9e8('0x2d')][_0xe9e8('0x37')]);_0x4e3858[_0xe9e8('0x38')]=qs[_0xe9e8('0x2f')](_[_0xe9e8('0x39')](_0x34d9c5[_0xe9e8('0x2d')],_0x4d03e2[_0xe9e8('0x2f')]));if(_0x34d9c5[_0xe9e8('0x2d')][_0xe9e8('0x3a')]){_0x4e3858['where']=_[_0xe9e8('0x3b')](_0x4e3858['where'],{'$or':_[_0xe9e8('0x28')](_0x4e3858[_0xe9e8('0x32')],function(_0x49eeef){var _0x91f19e={};_0x91f19e[_0x49eeef]={'$like':'%'+_0x34d9c5[_0xe9e8('0x2d')][_0xe9e8('0x3a')]+'%'};return _0x91f19e;})});}_0x4e3858=_[_0xe9e8('0x3b')]({},_0x4e3858,_0x34d9c5['options']);return _0x471730[_0xe9e8('0x4d')](_0x4e3858);}})['then'](function(_0x54c24d){if(_0x54c24d){_0x18628c=_0x54c24d[_0xe9e8('0x33')];if(!_0x34d9c5[_0xe9e8('0x2d')][_0xe9e8('0x34')](_0xe9e8('0x35'))){_0x4e3858[_0xe9e8('0x1d')]=qs['limit'](_0x34d9c5['query'][_0xe9e8('0x1d')]);_0x4e3858['offset']=qs['offset'](_0x34d9c5[_0xe9e8('0x2d')][_0xe9e8('0x1b')]);}return _0x471730['getDescriptions'](_0x4e3858);}})[_0xe9e8('0x23')](function(_0x36c890){if(_0x36c890){return _0x36c890?{'count':_0x18628c,'rows':_0x36c890}:null;}})['then'](respondWithResult(_0x12ff6e,null))['catch'](handleError(_0x12ff6e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 5288ab4..44286da 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 _0x9cb1=['util','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash'];(function(_0x5b4502,_0x53147b){var _0x16e888=function(_0x26e708){while(--_0x26e708){_0x5b4502['push'](_0x5b4502['shift']());}};_0x16e888(++_0x53147b);}(_0x9cb1,0x149));var _0x19cb=function(_0x3d900c,_0x3b2152){_0x3d900c=_0x3d900c-0x0;var _0x3c0860=_0x9cb1[_0x3d900c];return _0x3c0860;};'use strict';var _=require(_0x19cb('0x0'));var util=require(_0x19cb('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x19cb('0x2'));var rp=require(_0x19cb('0x3'));var fs=require('fs');var path=require(_0x19cb('0x4'));var rimraf=require(_0x19cb('0x5'));var config=require(_0x19cb('0x6'));var attributes=require(_0x19cb('0x7'));module['exports']=function(_0x50bee2,_0x1b7449){return _0x50bee2[_0x19cb('0x8')](_0x19cb('0x9'),attributes,{'tableName':_0x19cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b98=['int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration'];(function(_0x133b6c,_0x250d2d){var _0x4e7ba9=function(_0x1b1301){while(--_0x1b1301){_0x133b6c['push'](_0x133b6c['shift']());}};_0x4e7ba9(++_0x250d2d);}(_0x1b98,0xef));var _0x81b9=function(_0x2acef1,_0x19ec87){_0x2acef1=_0x2acef1-0x0;var _0x5d9e3a=_0x1b98[_0x2acef1];return _0x5d9e3a;};'use strict';var _=require(_0x81b9('0x0'));var util=require(_0x81b9('0x1'));var logger=require(_0x81b9('0x2'))(_0x81b9('0x3'));var moment=require(_0x81b9('0x4'));var BPromise=require(_0x81b9('0x5'));var rp=require(_0x81b9('0x6'));var fs=require('fs');var path=require(_0x81b9('0x7'));var rimraf=require(_0x81b9('0x8'));var config=require(_0x81b9('0x9'));var attributes=require(_0x81b9('0xa'));module['exports']=function(_0xc5b728,_0x498201){return _0xc5b728[_0x81b9('0xb')](_0x81b9('0xc'),attributes,{'tableName':_0x81b9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 0df4ecc..2b350de 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 _0x0978=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x57b432,_0x1589a0){var _0x2edf2a=function(_0x20edfc){while(--_0x20edfc){_0x57b432['push'](_0x57b432['shift']());}};_0x2edf2a(++_0x1589a0);}(_0x0978,0x176));var _0x8097=function(_0x17f6c3,_0xa83c68){_0x17f6c3=_0x17f6c3-0x0;var _0x31d6da=_0x0978[_0x17f6c3];return _0x31d6da;};'use strict';var _=require(_0x8097('0x0'));var util=require('util');var moment=require(_0x8097('0x1'));var BPromise=require(_0x8097('0x2'));var rs=require(_0x8097('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8097('0x4'))['db'];var utils=require(_0x8097('0x5'));var logger=require(_0x8097('0x6'))('rpc');var config=require(_0x8097('0x7'));var jayson=require(_0x8097('0x8'));var client=jayson[_0x8097('0x9')][_0x8097('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14d749,_0x39301d,_0x597d1c){return new BPromise(function(_0x23701c,_0x56170f){return client['request'](_0x14d749,_0x597d1c)[_0x8097('0xb')](function(_0x1421ba){logger[_0x8097('0xc')](_0x8097('0xd'),_0x39301d,'request\x20sent');logger[_0x8097('0xe')](_0x8097('0xf'),_0x39301d,_0x8097('0x10'),JSON[_0x8097('0x11')](_0x1421ba));if(_0x1421ba[_0x8097('0x12')]){if(_0x1421ba[_0x8097('0x12')]['code']===0x1f4){logger[_0x8097('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x39301d,_0x1421ba[_0x8097('0x12')]['message']);return _0x56170f(_0x1421ba[_0x8097('0x12')][_0x8097('0x13')]);}logger[_0x8097('0x12')](_0x8097('0xd'),_0x39301d,_0x1421ba[_0x8097('0x12')]['message']);return _0x23701c(_0x1421ba['error'][_0x8097('0x13')]);}else{logger[_0x8097('0xc')](_0x8097('0xd'),_0x39301d,_0x8097('0x10'));_0x23701c(_0x1421ba[_0x8097('0x14')][_0x8097('0x13')]);}})[_0x8097('0x15')](function(_0x1f2d22){logger[_0x8097('0x12')](_0x8097('0xd'),_0x39301d,_0x1f2d22);_0x56170f(_0x1f2d22);});});} \ No newline at end of file +var _0xaacc=['then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0xaacc,0x19b));var _0xcaac=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xaacc[_0x59d89e];return _0x554e93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcaac('0x0'));var BPromise=require(_0xcaac('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcaac('0x2'));var logger=require('../../config/logger')(_0xcaac('0x3'));var config=require(_0xcaac('0x4'));var jayson=require(_0xcaac('0x5'));var client=jayson[_0xcaac('0x6')][_0xcaac('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x167b9e,_0x454d92,_0x11ab77){return new BPromise(function(_0x5852f6,_0x2db2c8){return client[_0xcaac('0x8')](_0x167b9e,_0x11ab77)[_0xcaac('0x9')](function(_0x2c357b){logger[_0xcaac('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x454d92,'request\x20sent');logger[_0xcaac('0xb')](_0xcaac('0xc'),_0x454d92,_0xcaac('0xd'),JSON[_0xcaac('0xe')](_0x2c357b));if(_0x2c357b[_0xcaac('0xf')]){if(_0x2c357b[_0xcaac('0xf')][_0xcaac('0x10')]===0x1f4){logger['error'](_0xcaac('0x11'),_0x454d92,_0x2c357b[_0xcaac('0xf')][_0xcaac('0x12')]);return _0x2db2c8(_0x2c357b[_0xcaac('0xf')][_0xcaac('0x12')]);}logger[_0xcaac('0xf')](_0xcaac('0x11'),_0x454d92,_0x2c357b[_0xcaac('0xf')][_0xcaac('0x12')]);return _0x5852f6(_0x2c357b[_0xcaac('0xf')][_0xcaac('0x12')]);}else{logger['info'](_0xcaac('0x11'),_0x454d92,_0xcaac('0xd'));_0x5852f6(_0x2c357b[_0xcaac('0x13')]['message']);}})[_0xcaac('0x14')](function(_0x43c8f){logger[_0xcaac('0xf')](_0xcaac('0x11'),_0x454d92,_0x43c8f);_0x2db2c8(_0x43c8f);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index b0651bf..b1153e2 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 _0xef4e=['./intSugarcrmField.controller','get','isAuthenticated','/:id','post','create','put','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5d9f5c,_0x1ac192){var _0x560394=function(_0x575efc){while(--_0x575efc){_0x5d9f5c['push'](_0x5d9f5c['shift']());}};_0x560394(++_0x1ac192);}(_0xef4e,0xb9));var _0xeef4=function(_0x4fc435,_0x45eddf){_0x4fc435=_0x4fc435-0x0;var _0x3c5db1=_0xef4e[_0x4fc435];return _0x3c5db1;};'use strict';var multer=require(_0xeef4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xeef4('0x1'));var express=require(_0xeef4('0x2'));var router=express[_0xeef4('0x3')]();var fs_extra=require(_0xeef4('0x4'));var auth=require(_0xeef4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeef4('0x6'));var controller=require(_0xeef4('0x7'));router[_0xeef4('0x8')]('/',auth[_0xeef4('0x9')](),controller['index']);router[_0xeef4('0x8')](_0xeef4('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xeef4('0xb')]('/',auth[_0xeef4('0x9')](),controller[_0xeef4('0xc')]);router[_0xeef4('0xd')](_0xeef4('0xa'),auth[_0xeef4('0x9')](),controller['update']);router[_0xeef4('0xe')]('/:id',auth[_0xeef4('0x9')](),controller[_0xeef4('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9b77=['/:id','show','post','create','put','delete','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index'];(function(_0x35da13,_0x5be649){var _0x3541fe=function(_0x3ebcb5){while(--_0x3ebcb5){_0x35da13['push'](_0x35da13['shift']());}};_0x3541fe(++_0x5be649);}(_0x9b77,0xe8));var _0x79b7=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x9b77[_0x134c2e];return _0x2825db;};'use strict';var multer=require('multer');var util=require(_0x79b7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x79b7('0x1')]();var fs_extra=require(_0x79b7('0x2'));var auth=require(_0x79b7('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x79b7('0x4'));var controller=require(_0x79b7('0x5'));router['get']('/',auth[_0x79b7('0x6')](),controller[_0x79b7('0x7')]);router['get'](_0x79b7('0x8'),auth[_0x79b7('0x6')](),controller[_0x79b7('0x9')]);router[_0x79b7('0xa')]('/',auth[_0x79b7('0x6')](),controller[_0x79b7('0xb')]);router[_0x79b7('0xc')]('/:id',auth[_0x79b7('0x6')](),controller['update']);router[_0x79b7('0xd')](_0x79b7('0x8'),auth['isAuthenticated'](),controller[_0x79b7('0xe')]);module[_0x79b7('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index dad46a9..0f23f52 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 _0x9931=['variable','customVariable','keyValue','STRING','string','BOOLEAN','sequelize','ENUM'];(function(_0xdb7850,_0x22216e){var _0x973ff0=function(_0x16e0d3){while(--_0x16e0d3){_0xdb7850['push'](_0xdb7850['shift']());}};_0x973ff0(++_0x22216e);}(_0x9931,0x12e));var _0x1993=function(_0x1e3c76,_0x31ca93){_0x1e3c76=_0x1e3c76-0x0;var _0x276f45=_0x9931[_0x1e3c76];return _0x276f45;};'use strict';var Sequelize=require(_0x1993('0x0'));module['exports']={'type':{'type':Sequelize[_0x1993('0x1')]('string',_0x1993('0x2'),_0x1993('0x3'),_0x1993('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x1993('0x5')]},'key':{'type':Sequelize[_0x1993('0x5')]},'keyType':{'type':Sequelize[_0x1993('0x1')](_0x1993('0x6'),'variable',_0x1993('0x3'))},'keyContent':{'type':Sequelize[_0x1993('0x5')]},'idField':{'type':Sequelize[_0x1993('0x5')]},'nameField':{'type':Sequelize[_0x1993('0x5')]},'customField':{'type':Sequelize[_0x1993('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0ec5=['variable','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x575350,_0x36ca76){var _0x4c6961=function(_0x483431){while(--_0x483431){_0x575350['push'](_0x575350['shift']());}};_0x4c6961(++_0x36ca76);}(_0x0ec5,0x1bc));var _0x50ec=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x0ec5[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0x50ec('0x0'));module[_0x50ec('0x1')]={'type':{'type':Sequelize[_0x50ec('0x2')](_0x50ec('0x3'),_0x50ec('0x4'),'customVariable','keyValue',_0x50ec('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x50ec('0x6')]},'key':{'type':Sequelize[_0x50ec('0x6')]},'keyType':{'type':Sequelize[_0x50ec('0x2')](_0x50ec('0x3'),_0x50ec('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x50ec('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x50ec('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x50ec('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index e0c3ece..c5a35dc 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 _0x70cd=['error','stack','name','index','map','SugarcrmField','rawAttributes','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','update','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then'];(function(_0x125274,_0x3dde11){var _0x24e4ff=function(_0x3116f5){while(--_0x3116f5){_0x125274['push'](_0x125274['shift']());}};_0x24e4ff(++_0x3dde11);}(_0x70cd,0x149));var _0xd70c=function(_0x4aac5a,_0x15b04c){_0x4aac5a=_0x4aac5a-0x0;var _0x42e7bc=_0x70cd[_0x4aac5a];return _0x42e7bc;};'use strict';var emlformat=require(_0xd70c('0x0'));var rimraf=require(_0xd70c('0x1'));var zipdir=require(_0xd70c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd70c('0x3'));var moment=require('moment');var BPromise=require(_0xd70c('0x4'));var Mustache=require(_0xd70c('0x5'));var util=require(_0xd70c('0x6'));var path=require('path');var sox=require(_0xd70c('0x7'));var csv=require('to-csv');var ejs=require(_0xd70c('0x8'));var fs=require('fs');var fs_extra=require(_0xd70c('0x9'));var _=require(_0xd70c('0xa'));var squel=require(_0xd70c('0xb'));var crypto=require(_0xd70c('0xc'));var jsforce=require(_0xd70c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd70c('0xe'));var querystring=require(_0xd70c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd70c('0x10'));var qs=require(_0xd70c('0x11'));var as=require(_0xd70c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd70c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd70c('0x14'));var licenseUtil=require(_0xd70c('0x15'));var db=require(_0xd70c('0x16'))['db'];function respondWithStatusCode(_0x2002f2,_0x75026a){_0x75026a=_0x75026a||0xcc;return function(_0x1aa8c8){if(_0x1aa8c8){return _0x2002f2[_0xd70c('0x17')](_0x75026a);}return _0x2002f2[_0xd70c('0x18')](_0x75026a)[_0xd70c('0x19')]();};}function respondWithResult(_0x18a002,_0x3d3811){_0x3d3811=_0x3d3811||0xc8;return function(_0x5a0abc){if(_0x5a0abc){return _0x18a002[_0xd70c('0x18')](_0x3d3811)[_0xd70c('0x1a')](_0x5a0abc);}};}function respondWithFilteredResult(_0x3a8c00,_0x58e173){return function(_0x349024){if(_0x349024){var _0x328672=typeof _0x58e173['offset']===_0xd70c('0x1b')&&typeof _0x58e173[_0xd70c('0x1c')]==='undefined';var _0x4d653c=_0x349024[_0xd70c('0x1d')];var _0x36ea44=_0x328672?0x0:_0x58e173[_0xd70c('0x1e')];var _0x943abe=_0x328672?_0x349024[_0xd70c('0x1d')]:_0x58e173[_0xd70c('0x1e')]+_0x58e173[_0xd70c('0x1c')];var _0x2b0530;if(_0x943abe>=_0x4d653c){_0x943abe=_0x4d653c;_0x2b0530=0xc8;}else{_0x2b0530=0xce;}_0x3a8c00[_0xd70c('0x18')](_0x2b0530);return _0x3a8c00[_0xd70c('0x1f')](_0xd70c('0x20'),_0x36ea44+'-'+_0x943abe+'/'+_0x4d653c)[_0xd70c('0x1a')](_0x349024);}return null;};}function patchUpdates(_0x3d48af){return function(_0x1a208b){try{jsonpatch[_0xd70c('0x21')](_0x1a208b,_0x3d48af,!![]);}catch(_0x2a264c){return BPromise[_0xd70c('0x22')](_0x2a264c);}return _0x1a208b['save']();};}function saveUpdates(_0x20c304,_0x1bd502){return function(_0x2348d8){if(_0x2348d8){return _0x2348d8['update'](_0x20c304)[_0xd70c('0x23')](function(_0x4f4a5f){return _0x4f4a5f;});}return null;};}function removeEntity(_0x80495e,_0x3ff5dd){return function(_0x3a83a2){if(_0x3a83a2){return _0x3a83a2['destroy']()['then'](function(){_0x80495e[_0xd70c('0x18')](0xcc)[_0xd70c('0x19')]();});}};}function handleEntityNotFound(_0x33d226,_0x555e6c){return function(_0x280118){if(!_0x280118){_0x33d226[_0xd70c('0x17')](0x194);}return _0x280118;};}function handleError(_0x597382,_0x59646f){_0x59646f=_0x59646f||0x1f4;return function(_0x31efd8){logger[_0xd70c('0x24')](_0x31efd8[_0xd70c('0x25')]);if(_0x31efd8[_0xd70c('0x26')]){delete _0x31efd8[_0xd70c('0x26')];}_0x597382[_0xd70c('0x18')](_0x59646f)['send'](_0x31efd8);};}exports[_0xd70c('0x27')]=function(_0x1eba51,_0x137240){var _0x48350b={},_0x4c3a38={},_0x3ef74d={'count':0x0,'rows':[]};var _0x31fb51=_[_0xd70c('0x28')](db[_0xd70c('0x29')][_0xd70c('0x2a')],function(_0x197386){return{'name':_0x197386['fieldName'],'type':_0x197386['type'][_0xd70c('0x2b')]};});_0x4c3a38[_0xd70c('0x2c')]=_[_0xd70c('0x28')](_0x31fb51,'name');_0x4c3a38[_0xd70c('0x2d')]=_['keys'](_0x1eba51[_0xd70c('0x2d')]);_0x4c3a38[_0xd70c('0x2e')]=_[_0xd70c('0x2f')](_0x4c3a38[_0xd70c('0x2c')],_0x4c3a38[_0xd70c('0x2d')]);_0x48350b[_0xd70c('0x30')]=_[_0xd70c('0x2f')](_0x4c3a38[_0xd70c('0x2c')],qs['fields'](_0x1eba51[_0xd70c('0x2d')]['fields']));_0x48350b['attributes']=_0x48350b[_0xd70c('0x30')][_0xd70c('0x31')]?_0x48350b[_0xd70c('0x30')]:_0x4c3a38[_0xd70c('0x2c')];if(!_0x1eba51[_0xd70c('0x2d')][_0xd70c('0x32')](_0xd70c('0x33'))){_0x48350b[_0xd70c('0x1c')]=qs['limit'](_0x1eba51['query'][_0xd70c('0x1c')]);_0x48350b[_0xd70c('0x1e')]=qs['offset'](_0x1eba51['query'][_0xd70c('0x1e')]);}_0x48350b[_0xd70c('0x34')]=qs['sort'](_0x1eba51[_0xd70c('0x2d')][_0xd70c('0x35')]);_0x48350b['where']=qs[_0xd70c('0x2e')](_['pick'](_0x1eba51[_0xd70c('0x2d')],_0x4c3a38[_0xd70c('0x2e')]),_0x31fb51);if(_0x1eba51[_0xd70c('0x2d')]['filter']){_0x48350b['where']=_[_0xd70c('0x36')](_0x48350b['where'],{'$or':_['map'](_0x31fb51,function(_0x39ed0f){if(_0x39ed0f[_0xd70c('0x37')]!==_0xd70c('0x38')){var _0x562347={};_0x562347[_0x39ed0f[_0xd70c('0x26')]]={'$like':'%'+_0x1eba51[_0xd70c('0x2d')][_0xd70c('0x39')]+'%'};return _0x562347;}})});}_0x48350b=_[_0xd70c('0x36')]({},_0x48350b,_0x1eba51[_0xd70c('0x3a')]);var _0x28870f={'where':_0x48350b['where']};return db[_0xd70c('0x29')][_0xd70c('0x1d')](_0x28870f)[_0xd70c('0x23')](function(_0x1bb2f1){_0x3ef74d['count']=_0x1bb2f1;if(_0x1eba51[_0xd70c('0x2d')][_0xd70c('0x3b')]){_0x48350b[_0xd70c('0x3c')]=[{'all':!![]}];}return db['SugarcrmField'][_0xd70c('0x3d')](_0x48350b);})[_0xd70c('0x23')](function(_0x1ca8db){_0x3ef74d[_0xd70c('0x3e')]=_0x1ca8db;return _0x3ef74d;})['then'](respondWithFilteredResult(_0x137240,_0x48350b))[_0xd70c('0x3f')](handleError(_0x137240,null));};exports[_0xd70c('0x40')]=function(_0x2c9f1f,_0x82fbc1){var _0x57c301={'raw':!![],'where':{'id':_0x2c9f1f[_0xd70c('0x41')]['id']}},_0x1129bc={};_0x1129bc[_0xd70c('0x2c')]=_['keys'](db[_0xd70c('0x29')][_0xd70c('0x2a')]);_0x1129bc[_0xd70c('0x2d')]=_[_0xd70c('0x42')](_0x2c9f1f['query']);_0x1129bc[_0xd70c('0x2e')]=_['intersection'](_0x1129bc[_0xd70c('0x2c')],_0x1129bc[_0xd70c('0x2d')]);_0x57c301[_0xd70c('0x30')]=_[_0xd70c('0x2f')](_0x1129bc['model'],qs[_0xd70c('0x43')](_0x2c9f1f[_0xd70c('0x2d')][_0xd70c('0x43')]));_0x57c301[_0xd70c('0x30')]=_0x57c301['attributes'][_0xd70c('0x31')]?_0x57c301[_0xd70c('0x30')]:_0x1129bc['model'];if(_0x2c9f1f[_0xd70c('0x2d')][_0xd70c('0x3b')]){_0x57c301[_0xd70c('0x3c')]=[{'all':!![]}];}_0x57c301=_[_0xd70c('0x36')]({},_0x57c301,_0x2c9f1f[_0xd70c('0x3a')]);return db[_0xd70c('0x29')][_0xd70c('0x44')](_0x57c301)['then'](handleEntityNotFound(_0x82fbc1,null))[_0xd70c('0x23')](respondWithResult(_0x82fbc1,null))[_0xd70c('0x3f')](handleError(_0x82fbc1,null));};exports['create']=function(_0x56ed5a,_0x3bacef){return db[_0xd70c('0x29')][_0xd70c('0x45')](_0x56ed5a[_0xd70c('0x46')],{})['then'](respondWithResult(_0x3bacef,0xc9))[_0xd70c('0x3f')](handleError(_0x3bacef,null));};exports[_0xd70c('0x47')]=function(_0x1a7c1a,_0x5b5242){if(_0x1a7c1a[_0xd70c('0x46')]['id']){delete _0x1a7c1a['body']['id'];}return db[_0xd70c('0x29')][_0xd70c('0x44')]({'where':{'id':_0x1a7c1a['params']['id']}})['then'](handleEntityNotFound(_0x5b5242,null))[_0xd70c('0x23')](saveUpdates(_0x1a7c1a[_0xd70c('0x46')],null))['then'](respondWithResult(_0x5b5242,null))[_0xd70c('0x3f')](handleError(_0x5b5242,null));};exports[_0xd70c('0x48')]=function(_0x4f54bd,_0x14ba57){return db[_0xd70c('0x29')]['find']({'where':{'id':_0x4f54bd[_0xd70c('0x41')]['id']}})['then'](handleEntityNotFound(_0x14ba57,null))['then'](removeEntity(_0x14ba57,null))[_0xd70c('0x3f')](handleError(_0x14ba57,null));}; \ No newline at end of file +var _0x38e7=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','end','stack','name','send','map','SugarcrmField','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','rawAttributes','include','catch','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x53a8fd,_0x129dd9){var _0x279505=function(_0x436f82){while(--_0x436f82){_0x53a8fd['push'](_0x53a8fd['shift']());}};_0x279505(++_0x129dd9);}(_0x38e7,0x173));var _0x738e=function(_0x4cb272,_0x52c0e9){_0x4cb272=_0x4cb272-0x0;var _0x57b4aa=_0x38e7[_0x4cb272];return _0x57b4aa;};'use strict';var emlformat=require(_0x738e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x738e('0x1'));var jsonpatch=require(_0x738e('0x2'));var rp=require('request-promise');var moment=require(_0x738e('0x3'));var BPromise=require(_0x738e('0x4'));var Mustache=require(_0x738e('0x5'));var util=require(_0x738e('0x6'));var path=require(_0x738e('0x7'));var sox=require(_0x738e('0x8'));var csv=require('to-csv');var ejs=require(_0x738e('0x9'));var fs=require('fs');var fs_extra=require(_0x738e('0xa'));var _=require(_0x738e('0xb'));var squel=require(_0x738e('0xc'));var crypto=require(_0x738e('0xd'));var jsforce=require(_0x738e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x738e('0xf'));var querystring=require('querystring');var Papa=require(_0x738e('0x10'));var Redis=require(_0x738e('0x11'));var authService=require(_0x738e('0x12'));var qs=require(_0x738e('0x13'));var as=require(_0x738e('0x14'));var hardwareService=require(_0x738e('0x15'));var logger=require(_0x738e('0x16'))(_0x738e('0x17'));var utils=require(_0x738e('0x18'));var config=require(_0x738e('0x19'));var licenseUtil=require(_0x738e('0x1a'));var db=require(_0x738e('0x1b'))['db'];function respondWithStatusCode(_0x31bc9a,_0x417de2){_0x417de2=_0x417de2||0xcc;return function(_0xe8e8c6){if(_0xe8e8c6){return _0x31bc9a[_0x738e('0x1c')](_0x417de2);}return _0x31bc9a[_0x738e('0x1d')](_0x417de2)['end']();};}function respondWithResult(_0x58988f,_0x52203b){_0x52203b=_0x52203b||0xc8;return function(_0x382dce){if(_0x382dce){return _0x58988f['status'](_0x52203b)[_0x738e('0x1e')](_0x382dce);}};}function respondWithFilteredResult(_0x3edf6a,_0x485f42){return function(_0x5c4c7b){if(_0x5c4c7b){var _0x50d6f5=typeof _0x485f42[_0x738e('0x1f')]==='undefined'&&typeof _0x485f42[_0x738e('0x20')]===_0x738e('0x21');var _0x26349f=_0x5c4c7b[_0x738e('0x22')];var _0x1e34c9=_0x50d6f5?0x0:_0x485f42[_0x738e('0x1f')];var _0x33589c=_0x50d6f5?_0x5c4c7b[_0x738e('0x22')]:_0x485f42[_0x738e('0x1f')]+_0x485f42[_0x738e('0x20')];var _0x319583;if(_0x33589c>=_0x26349f){_0x33589c=_0x26349f;_0x319583=0xc8;}else{_0x319583=0xce;}_0x3edf6a[_0x738e('0x1d')](_0x319583);return _0x3edf6a[_0x738e('0x23')]('Content-Range',_0x1e34c9+'-'+_0x33589c+'/'+_0x26349f)[_0x738e('0x1e')](_0x5c4c7b);}return null;};}function patchUpdates(_0x26b7f0){return function(_0x59826b){try{jsonpatch[_0x738e('0x24')](_0x59826b,_0x26b7f0,!![]);}catch(_0x284702){return BPromise['reject'](_0x284702);}return _0x59826b[_0x738e('0x25')]();};}function saveUpdates(_0x13ea50,_0x5a1ced){return function(_0x15e6a7){if(_0x15e6a7){return _0x15e6a7[_0x738e('0x26')](_0x13ea50)[_0x738e('0x27')](function(_0x25845a){return _0x25845a;});}return null;};}function removeEntity(_0x39f539,_0x4c0054){return function(_0x3799e1){if(_0x3799e1){return _0x3799e1[_0x738e('0x28')]()[_0x738e('0x27')](function(){_0x39f539[_0x738e('0x1d')](0xcc)[_0x738e('0x29')]();});}};}function handleEntityNotFound(_0x49d297,_0x1eb60b){return function(_0x59a6b0){if(!_0x59a6b0){_0x49d297[_0x738e('0x1c')](0x194);}return _0x59a6b0;};}function handleError(_0x113976,_0xfe964c){_0xfe964c=_0xfe964c||0x1f4;return function(_0x3fd204){logger['error'](_0x3fd204[_0x738e('0x2a')]);if(_0x3fd204[_0x738e('0x2b')]){delete _0x3fd204[_0x738e('0x2b')];}_0x113976[_0x738e('0x1d')](_0xfe964c)[_0x738e('0x2c')](_0x3fd204);};}exports['index']=function(_0x348d20,_0x32e007){var _0x569a95={},_0x662d9c={},_0x43d683={'count':0x0,'rows':[]};var _0x7e96bd=_[_0x738e('0x2d')](db[_0x738e('0x2e')]['rawAttributes'],function(_0x2d456e){return{'name':_0x2d456e[_0x738e('0x2f')],'type':_0x2d456e[_0x738e('0x30')][_0x738e('0x31')]};});_0x662d9c[_0x738e('0x32')]=_[_0x738e('0x2d')](_0x7e96bd,'name');_0x662d9c['query']=_[_0x738e('0x33')](_0x348d20['query']);_0x662d9c['filters']=_[_0x738e('0x34')](_0x662d9c['model'],_0x662d9c[_0x738e('0x35')]);_0x569a95['attributes']=_['intersection'](_0x662d9c[_0x738e('0x32')],qs[_0x738e('0x36')](_0x348d20[_0x738e('0x35')][_0x738e('0x36')]));_0x569a95[_0x738e('0x37')]=_0x569a95[_0x738e('0x37')][_0x738e('0x38')]?_0x569a95[_0x738e('0x37')]:_0x662d9c[_0x738e('0x32')];if(!_0x348d20[_0x738e('0x35')][_0x738e('0x39')](_0x738e('0x3a'))){_0x569a95['limit']=qs[_0x738e('0x20')](_0x348d20[_0x738e('0x35')][_0x738e('0x20')]);_0x569a95[_0x738e('0x1f')]=qs[_0x738e('0x1f')](_0x348d20[_0x738e('0x35')][_0x738e('0x1f')]);}_0x569a95[_0x738e('0x3b')]=qs[_0x738e('0x3c')](_0x348d20[_0x738e('0x35')][_0x738e('0x3c')]);_0x569a95[_0x738e('0x3d')]=qs['filters'](_[_0x738e('0x3e')](_0x348d20[_0x738e('0x35')],_0x662d9c[_0x738e('0x3f')]),_0x7e96bd);if(_0x348d20[_0x738e('0x35')]['filter']){_0x569a95[_0x738e('0x3d')]=_[_0x738e('0x40')](_0x569a95[_0x738e('0x3d')],{'$or':_[_0x738e('0x2d')](_0x7e96bd,function(_0x1446e2){if(_0x1446e2[_0x738e('0x30')]!==_0x738e('0x41')){var _0x864479={};_0x864479[_0x1446e2[_0x738e('0x2b')]]={'$like':'%'+_0x348d20['query'][_0x738e('0x42')]+'%'};return _0x864479;}})});}_0x569a95=_[_0x738e('0x40')]({},_0x569a95,_0x348d20[_0x738e('0x43')]);var _0x4931b6={'where':_0x569a95[_0x738e('0x3d')]};return db[_0x738e('0x2e')]['count'](_0x4931b6)[_0x738e('0x27')](function(_0x1cbb83){_0x43d683[_0x738e('0x22')]=_0x1cbb83;if(_0x348d20[_0x738e('0x35')][_0x738e('0x44')]){_0x569a95['include']=[{'all':!![]}];}return db[_0x738e('0x2e')][_0x738e('0x45')](_0x569a95);})[_0x738e('0x27')](function(_0x7fd7c6){_0x43d683[_0x738e('0x46')]=_0x7fd7c6;return _0x43d683;})[_0x738e('0x27')](respondWithFilteredResult(_0x32e007,_0x569a95))['catch'](handleError(_0x32e007,null));};exports[_0x738e('0x47')]=function(_0x340105,_0x4c357b){var _0x376507={'raw':!![],'where':{'id':_0x340105[_0x738e('0x48')]['id']}},_0x2baf6={};_0x2baf6['model']=_[_0x738e('0x33')](db[_0x738e('0x2e')][_0x738e('0x49')]);_0x2baf6[_0x738e('0x35')]=_[_0x738e('0x33')](_0x340105[_0x738e('0x35')]);_0x2baf6[_0x738e('0x3f')]=_[_0x738e('0x34')](_0x2baf6[_0x738e('0x32')],_0x2baf6[_0x738e('0x35')]);_0x376507[_0x738e('0x37')]=_['intersection'](_0x2baf6[_0x738e('0x32')],qs[_0x738e('0x36')](_0x340105['query']['fields']));_0x376507[_0x738e('0x37')]=_0x376507[_0x738e('0x37')][_0x738e('0x38')]?_0x376507[_0x738e('0x37')]:_0x2baf6[_0x738e('0x32')];if(_0x340105['query'][_0x738e('0x44')]){_0x376507[_0x738e('0x4a')]=[{'all':!![]}];}_0x376507=_[_0x738e('0x40')]({},_0x376507,_0x340105['options']);return db[_0x738e('0x2e')]['find'](_0x376507)[_0x738e('0x27')](handleEntityNotFound(_0x4c357b,null))['then'](respondWithResult(_0x4c357b,null))[_0x738e('0x4b')](handleError(_0x4c357b,null));};exports[_0x738e('0x4c')]=function(_0x312c6f,_0x47fd56){return db[_0x738e('0x2e')]['create'](_0x312c6f['body'],{})[_0x738e('0x27')](respondWithResult(_0x47fd56,0xc9))[_0x738e('0x4b')](handleError(_0x47fd56,null));};exports['update']=function(_0x4de316,_0x52836d){if(_0x4de316[_0x738e('0x4d')]['id']){delete _0x4de316[_0x738e('0x4d')]['id'];}return db['SugarcrmField'][_0x738e('0x4e')]({'where':{'id':_0x4de316[_0x738e('0x48')]['id']}})[_0x738e('0x27')](handleEntityNotFound(_0x52836d,null))[_0x738e('0x27')](saveUpdates(_0x4de316[_0x738e('0x4d')],null))[_0x738e('0x27')](respondWithResult(_0x52836d,null))[_0x738e('0x4b')](handleError(_0x52836d,null));};exports[_0x738e('0x28')]=function(_0x45c860,_0x36cd84){return db[_0x738e('0x2e')]['find']({'where':{'id':_0x45c860[_0x738e('0x48')]['id']}})[_0x738e('0x27')](handleEntityNotFound(_0x36cd84,null))[_0x738e('0x27')](removeEntity(_0x36cd84,null))['catch'](handleError(_0x36cd84,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 699d966..a199488 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 _0x28f3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util'];(function(_0x560fdb,_0xe678c1){var _0x18ef38=function(_0x1c7361){while(--_0x1c7361){_0x560fdb['push'](_0x560fdb['shift']());}};_0x18ef38(++_0xe678c1);}(_0x28f3,0x8b));var _0x328f=function(_0x518155,_0x231e0d){_0x518155=_0x518155-0x0;var _0x2d9e37=_0x28f3[_0x518155];return _0x2d9e37;};'use strict';var _=require('lodash');var util=require(_0x328f('0x0'));var logger=require('../../config/logger')(_0x328f('0x1'));var moment=require(_0x328f('0x2'));var BPromise=require(_0x328f('0x3'));var rp=require(_0x328f('0x4'));var fs=require('fs');var path=require(_0x328f('0x5'));var rimraf=require(_0x328f('0x6'));var config=require(_0x328f('0x7'));var attributes=require(_0x328f('0x8'));module['exports']=function(_0x2790a8,_0x383280){return _0x2790a8['define'](_0x328f('0x9'),attributes,{'tableName':_0x328f('0xa'),'paranoid':![],'indexes':[{'name':_0x328f('0xb'),'fields':[_0x328f('0xc'),_0x328f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x070f=['int_sugarcrm_fields','idField','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define'];(function(_0x5e9f4d,_0x355b9){var _0x45d8cf=function(_0x1d58ae){while(--_0x1d58ae){_0x5e9f4d['push'](_0x5e9f4d['shift']());}};_0x45d8cf(++_0x355b9);}(_0x070f,0x1ee));var _0xf070=function(_0x47d575,_0x28e251){_0x47d575=_0x47d575-0x0;var _0x22e2bf=_0x070f[_0x47d575];return _0x22e2bf;};'use strict';var _=require(_0xf070('0x0'));var util=require(_0xf070('0x1'));var logger=require(_0xf070('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf070('0x3'));var fs=require('fs');var path=require(_0xf070('0x4'));var rimraf=require(_0xf070('0x5'));var config=require(_0xf070('0x6'));var attributes=require(_0xf070('0x7'));module[_0xf070('0x8')]=function(_0xeee735,_0x50ee79){return _0xeee735[_0xf070('0x9')]('SugarcrmField',attributes,{'tableName':_0xf070('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xf070('0xb'),'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 c5c6811..8b22f53 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 _0xdd67=['jayson/promise','client','request','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x620961,_0x35e790){var _0x3c1aff=function(_0x190fa1){while(--_0x190fa1){_0x620961['push'](_0x620961['shift']());}};_0x3c1aff(++_0x35e790);}(_0xdd67,0x1d5));var _0x7dd6=function(_0x500ae1,_0x42a82e){_0x500ae1=_0x500ae1-0x0;var _0x59e1fb=_0xdd67[_0x500ae1];return _0x59e1fb;};'use strict';var _=require(_0x7dd6('0x0'));var util=require(_0x7dd6('0x1'));var moment=require(_0x7dd6('0x2'));var BPromise=require(_0x7dd6('0x3'));var rs=require(_0x7dd6('0x4'));var fs=require('fs');var Redis=require(_0x7dd6('0x5'));var db=require(_0x7dd6('0x6'))['db'];var utils=require(_0x7dd6('0x7'));var logger=require(_0x7dd6('0x8'))(_0x7dd6('0x9'));var config=require(_0x7dd6('0xa'));var jayson=require(_0x7dd6('0xb'));var client=jayson[_0x7dd6('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa1bb69,_0x26fc20,_0x59879e){return new BPromise(function(_0x5c51e8,_0x5af42d){return client[_0x7dd6('0xd')](_0xa1bb69,_0x59879e)[_0x7dd6('0xe')](function(_0x255209){logger[_0x7dd6('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x26fc20,_0x7dd6('0x10'));logger[_0x7dd6('0x11')](_0x7dd6('0x12'),_0x26fc20,'request\x20sent',JSON['stringify'](_0x255209));if(_0x255209['error']){if(_0x255209['error']['code']===0x1f4){logger[_0x7dd6('0x13')](_0x7dd6('0x14'),_0x26fc20,_0x255209[_0x7dd6('0x13')][_0x7dd6('0x15')]);return _0x5af42d(_0x255209['error'][_0x7dd6('0x15')]);}logger[_0x7dd6('0x13')](_0x7dd6('0x14'),_0x26fc20,_0x255209[_0x7dd6('0x13')]['message']);return _0x5c51e8(_0x255209['error'][_0x7dd6('0x15')]);}else{logger[_0x7dd6('0xf')](_0x7dd6('0x14'),_0x26fc20,_0x7dd6('0x10'));_0x5c51e8(_0x255209[_0x7dd6('0x16')]['message']);}})[_0x7dd6('0x17')](function(_0x42d0bb){logger[_0x7dd6('0x13')](_0x7dd6('0x14'),_0x26fc20,_0x42d0bb);_0x5af42d(_0x42d0bb);});});} \ No newline at end of file +var _0xa474=['http','request','then','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x3069eb,_0x282ee2){var _0x4980d9=function(_0x2cb6d4){while(--_0x2cb6d4){_0x3069eb['push'](_0x3069eb['shift']());}};_0x4980d9(++_0x282ee2);}(_0xa474,0x7b));var _0x4a47=function(_0x55f8b1,_0x1eb58a){_0x55f8b1=_0x55f8b1-0x0;var _0x57f365=_0xa474[_0x55f8b1];return _0x57f365;};'use strict';var _=require(_0x4a47('0x0'));var util=require(_0x4a47('0x1'));var moment=require(_0x4a47('0x2'));var BPromise=require(_0x4a47('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a47('0x4'))['db'];var utils=require(_0x4a47('0x5'));var logger=require(_0x4a47('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4a47('0x7'));var client=jayson[_0x4a47('0x8')][_0x4a47('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a1112,_0x27ab24,_0x1b0d9d){return new BPromise(function(_0x14be8a,_0x2414d4){return client[_0x4a47('0xa')](_0x4a1112,_0x1b0d9d)[_0x4a47('0xb')](function(_0x289d37){logger['info'](_0x4a47('0xc'),_0x27ab24,'request\x20sent');logger['debug'](_0x4a47('0xd'),_0x27ab24,_0x4a47('0xe'),JSON[_0x4a47('0xf')](_0x289d37));if(_0x289d37[_0x4a47('0x10')]){if(_0x289d37[_0x4a47('0x10')][_0x4a47('0x11')]===0x1f4){logger[_0x4a47('0x10')](_0x4a47('0xc'),_0x27ab24,_0x289d37[_0x4a47('0x10')][_0x4a47('0x12')]);return _0x2414d4(_0x289d37[_0x4a47('0x10')]['message']);}logger[_0x4a47('0x10')](_0x4a47('0xc'),_0x27ab24,_0x289d37[_0x4a47('0x10')][_0x4a47('0x12')]);return _0x14be8a(_0x289d37[_0x4a47('0x10')][_0x4a47('0x12')]);}else{logger[_0x4a47('0x13')](_0x4a47('0xc'),_0x27ab24,_0x4a47('0xe'));_0x14be8a(_0x289d37[_0x4a47('0x14')]['message']);}})[_0x4a47('0x15')](function(_0x4a8678){logger[_0x4a47('0x10')](_0x4a47('0xc'),_0x27ab24,_0x4a8678);_0x2414d4(_0x4a8678);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index e184b49..b9c09c3 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 _0xb73c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getFields','post','create','addConfiguration','put','update','delete','destroy','multer'];(function(_0x2d9aa7,_0x366461){var _0x33e153=function(_0x2cdac6){while(--_0x2cdac6){_0x2d9aa7['push'](_0x2d9aa7['shift']());}};_0x33e153(++_0x366461);}(_0xb73c,0x1cd));var _0xcb73=function(_0xadf2fe,_0x36b03a){_0xadf2fe=_0xadf2fe-0x0;var _0x5754cf=_0xb73c[_0xadf2fe];return _0x5754cf;};'use strict';var multer=require(_0xcb73('0x0'));var util=require('util');var path=require(_0xcb73('0x1'));var timeout=require(_0xcb73('0x2'));var express=require(_0xcb73('0x3'));var router=express[_0xcb73('0x4')]();var fs_extra=require(_0xcb73('0x5'));var auth=require(_0xcb73('0x6'));var interaction=require(_0xcb73('0x7'));var config=require('../../config/environment');var controller=require(_0xcb73('0x8'));router[_0xcb73('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xcb73('0xa'),auth[_0xcb73('0xb')](),controller[_0xcb73('0xc')]);router[_0xcb73('0x9')](_0xcb73('0xd'),auth[_0xcb73('0xb')](),controller['getConfigurations']);router[_0xcb73('0x9')]('/:id/fields',auth[_0xcb73('0xb')](),controller[_0xcb73('0xe')]);router[_0xcb73('0xf')]('/',auth[_0xcb73('0xb')](),controller[_0xcb73('0x10')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xcb73('0x11')]);router[_0xcb73('0x12')]('/:id',auth[_0xcb73('0xb')](),controller[_0xcb73('0x13')]);router[_0xcb73('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xcb73('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9589=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index'];(function(_0x51cac9,_0x22d722){var _0x3ad793=function(_0x26148b){while(--_0x26148b){_0x51cac9['push'](_0x51cac9['shift']());}};_0x3ad793(++_0x22d722);}(_0x9589,0xbc));var _0x9958=function(_0x4f13c2,_0x103e01){_0x4f13c2=_0x4f13c2-0x0;var _0x42b803=_0x9589[_0x4f13c2];return _0x42b803;};'use strict';var multer=require(_0x9958('0x0'));var util=require(_0x9958('0x1'));var path=require(_0x9958('0x2'));var timeout=require(_0x9958('0x3'));var express=require(_0x9958('0x4'));var router=express['Router']();var fs_extra=require(_0x9958('0x5'));var auth=require(_0x9958('0x6'));var interaction=require(_0x9958('0x7'));var config=require('../../config/environment');var controller=require(_0x9958('0x8'));router[_0x9958('0x9')]('/',auth[_0x9958('0xa')](),controller[_0x9958('0xb')]);router[_0x9958('0x9')](_0x9958('0xc'),auth['isAuthenticated'](),controller[_0x9958('0xd')]);router[_0x9958('0x9')](_0x9958('0xe'),auth[_0x9958('0xa')](),controller[_0x9958('0xf')]);router[_0x9958('0x9')](_0x9958('0x10'),auth[_0x9958('0xa')](),controller[_0x9958('0x11')]);router[_0x9958('0x12')]('/',auth[_0x9958('0xa')](),controller[_0x9958('0x13')]);router[_0x9958('0x12')](_0x9958('0xe'),auth[_0x9958('0xa')](),controller[_0x9958('0x14')]);router[_0x9958('0x15')](_0x9958('0xc'),auth['isAuthenticated'](),controller[_0x9958('0x16')]);router['delete'](_0x9958('0xc'),auth['isAuthenticated'](),controller[_0x9958('0x17')]);module[_0x9958('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index f28a272..3c24d42 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 _0x44c3=['STRING','HelpDesk','sequelize'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x44c3,0x134));var _0x344c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x44c3[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x344c('0x0'));module['exports']={'name':{'type':Sequelize[_0x344c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x344c('0x1')]},'username':{'type':Sequelize[_0x344c('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x344c('0x1')],'allowNull':![],'defaultValue':_0x344c('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x344c('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x4476=['STRING','HelpDesk','exports'];(function(_0x17688e,_0x291e01){var _0x2d7b22=function(_0x33ae8d){while(--_0x33ae8d){_0x17688e['push'](_0x17688e['shift']());}};_0x2d7b22(++_0x291e01);}(_0x4476,0x1c7));var _0x6447=function(_0x4a010b,_0x3523b3){_0x4a010b=_0x4a010b-0x0;var _0xe0b19b=_0x4476[_0x4a010b];return _0xe0b19b;};'use strict';var Sequelize=require('sequelize');module[_0x6447('0x0')]={'name':{'type':Sequelize[_0x6447('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6447('0x1')]},'username':{'type':Sequelize[_0x6447('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6447('0x1')],'allowNull':![],'defaultValue':_0x6447('0x2')},'remoteUri':{'type':Sequelize[_0x6447('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6447('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x6447('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 2ab75ab..b9028cf 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 _0x5099=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','name','send','index','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','VtigerAccount','includeAll','catch','show','params','include','create','body','update','find','getConfigurations','findOne','VtigerConfiguration','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','result','describe','autogenerated','reference','remove','includes','editable','false','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x139f40,_0x37040e){var _0x5c3a9e=function(_0x44a1b6){while(--_0x44a1b6){_0x139f40['push'](_0x139f40['shift']());}};_0x5c3a9e(++_0x37040e);}(_0x5099,0x154));var _0x9509=function(_0xf845cc,_0x7bce78){_0xf845cc=_0xf845cc-0x0;var _0x24da94=_0x5099[_0xf845cc];return _0x24da94;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9509('0x0'));var zipdir=require(_0x9509('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9509('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9509('0x3'));var util=require(_0x9509('0x4'));var path=require(_0x9509('0x5'));var sox=require(_0x9509('0x6'));var csv=require(_0x9509('0x7'));var ejs=require(_0x9509('0x8'));var fs=require('fs');var fs_extra=require(_0x9509('0x9'));var _=require(_0x9509('0xa'));var squel=require(_0x9509('0xb'));var crypto=require('crypto');var jsforce=require(_0x9509('0xc'));var deskjs=require(_0x9509('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9509('0xe'));var Papa=require(_0x9509('0xf'));var Redis=require(_0x9509('0x10'));var authService=require(_0x9509('0x11'));var qs=require(_0x9509('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9509('0x13'));var logger=require(_0x9509('0x14'))(_0x9509('0x15'));var utils=require(_0x9509('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9509('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x997bbc,_0xa0cacb){_0xa0cacb=_0xa0cacb||0xcc;return function(_0x332a22){if(_0x332a22){return _0x997bbc[_0x9509('0x18')](_0xa0cacb);}return _0x997bbc[_0x9509('0x19')](_0xa0cacb)[_0x9509('0x1a')]();};}function respondWithResult(_0x5831c9,_0x223e97){_0x223e97=_0x223e97||0xc8;return function(_0x2c0afc){if(_0x2c0afc){return _0x5831c9['status'](_0x223e97)[_0x9509('0x1b')](_0x2c0afc);}};}function respondWithFilteredResult(_0x2cd218,_0x45017a){return function(_0x107b63){if(_0x107b63){var _0x11785c=typeof _0x45017a[_0x9509('0x1c')]===_0x9509('0x1d')&&typeof _0x45017a[_0x9509('0x1e')]===_0x9509('0x1d');var _0x4b0d54=_0x107b63[_0x9509('0x1f')];var _0x133017=_0x11785c?0x0:_0x45017a[_0x9509('0x1c')];var _0x1bfb7c=_0x11785c?_0x107b63['count']:_0x45017a[_0x9509('0x1c')]+_0x45017a[_0x9509('0x1e')];var _0x4f0ab0;if(_0x1bfb7c>=_0x4b0d54){_0x1bfb7c=_0x4b0d54;_0x4f0ab0=0xc8;}else{_0x4f0ab0=0xce;}_0x2cd218[_0x9509('0x19')](_0x4f0ab0);return _0x2cd218[_0x9509('0x20')]('Content-Range',_0x133017+'-'+_0x1bfb7c+'/'+_0x4b0d54)['json'](_0x107b63);}return null;};}function patchUpdates(_0x367a29){return function(_0x3a7757){try{jsonpatch[_0x9509('0x21')](_0x3a7757,_0x367a29,!![]);}catch(_0x44d868){return BPromise[_0x9509('0x22')](_0x44d868);}return _0x3a7757[_0x9509('0x23')]();};}function saveUpdates(_0x4bd4ef,_0x1fe5aa){return function(_0x4cbb9d){if(_0x4cbb9d){return _0x4cbb9d['update'](_0x4bd4ef)[_0x9509('0x24')](function(_0x3254db){return _0x3254db;});}return null;};}function removeEntity(_0x4f46c6,_0x3dd39c){return function(_0x22f3f6){if(_0x22f3f6){return _0x22f3f6[_0x9509('0x25')]()['then'](function(){_0x4f46c6[_0x9509('0x19')](0xcc)[_0x9509('0x1a')]();});}};}function handleEntityNotFound(_0x718c24,_0xccbcd7){return function(_0x38b343){if(!_0x38b343){_0x718c24['sendStatus'](0x194);}return _0x38b343;};}function handleError(_0x32f11d,_0x1bec9c){_0x1bec9c=_0x1bec9c||0x1f4;return function(_0x36d0bf){logger['error'](_0x36d0bf['stack']);if(_0x36d0bf[_0x9509('0x26')]){delete _0x36d0bf[_0x9509('0x26')];}_0x32f11d[_0x9509('0x19')](_0x1bec9c)[_0x9509('0x27')](_0x36d0bf);};}exports[_0x9509('0x28')]=function(_0x3137e1,_0x7a74b5){var _0x10e902={},_0x4696c1={},_0x4ae1b4={'count':0x0,'rows':[]};var _0x4a5f88=_['map'](db['VtigerAccount'][_0x9509('0x29')],function(_0x1686b3){return{'name':_0x1686b3[_0x9509('0x2a')],'type':_0x1686b3['type'][_0x9509('0x2b')]};});_0x4696c1[_0x9509('0x2c')]=_[_0x9509('0x2d')](_0x4a5f88,_0x9509('0x26'));_0x4696c1['query']=_[_0x9509('0x2e')](_0x3137e1[_0x9509('0x2f')]);_0x4696c1['filters']=_[_0x9509('0x30')](_0x4696c1[_0x9509('0x2c')],_0x4696c1[_0x9509('0x2f')]);_0x10e902[_0x9509('0x31')]=_[_0x9509('0x30')](_0x4696c1['model'],qs['fields'](_0x3137e1['query'][_0x9509('0x32')]));_0x10e902[_0x9509('0x31')]=_0x10e902[_0x9509('0x31')][_0x9509('0x33')]?_0x10e902['attributes']:_0x4696c1[_0x9509('0x2c')];if(!_0x3137e1[_0x9509('0x2f')][_0x9509('0x34')]('nolimit')){_0x10e902[_0x9509('0x1e')]=qs[_0x9509('0x1e')](_0x3137e1['query'][_0x9509('0x1e')]);_0x10e902[_0x9509('0x1c')]=qs[_0x9509('0x1c')](_0x3137e1['query'][_0x9509('0x1c')]);}_0x10e902[_0x9509('0x35')]=qs[_0x9509('0x36')](_0x3137e1['query'][_0x9509('0x36')]);_0x10e902[_0x9509('0x37')]=qs['filters'](_[_0x9509('0x38')](_0x3137e1[_0x9509('0x2f')],_0x4696c1[_0x9509('0x39')]),_0x4a5f88);if(_0x3137e1[_0x9509('0x2f')][_0x9509('0x3a')]){_0x10e902[_0x9509('0x37')]=_[_0x9509('0x3b')](_0x10e902['where'],{'$or':_['map'](_0x4a5f88,function(_0x5af9c0){if(_0x5af9c0[_0x9509('0x3c')]!==_0x9509('0x3d')){var _0x50cd08={};_0x50cd08[_0x5af9c0[_0x9509('0x26')]]={'$like':'%'+_0x3137e1[_0x9509('0x2f')][_0x9509('0x3a')]+'%'};return _0x50cd08;}})});}_0x10e902=_[_0x9509('0x3b')]({},_0x10e902,_0x3137e1[_0x9509('0x3e')]);var _0x330d8a={'where':_0x10e902['where']};return db[_0x9509('0x3f')][_0x9509('0x1f')](_0x330d8a)[_0x9509('0x24')](function(_0x131039){_0x4ae1b4[_0x9509('0x1f')]=_0x131039;if(_0x3137e1[_0x9509('0x2f')][_0x9509('0x40')]){_0x10e902['include']=[{'all':!![]}];}return db[_0x9509('0x3f')]['findAll'](_0x10e902);})[_0x9509('0x24')](function(_0x239e5e){_0x4ae1b4['rows']=_0x239e5e;return _0x4ae1b4;})[_0x9509('0x24')](respondWithFilteredResult(_0x7a74b5,_0x10e902))[_0x9509('0x41')](handleError(_0x7a74b5,null));};exports[_0x9509('0x42')]=function(_0x3dc4bf,_0x233fa9){var _0x290d2c={'raw':![],'where':{'id':_0x3dc4bf[_0x9509('0x43')]['id']}},_0x9d31bc={};_0x9d31bc[_0x9509('0x2c')]=_[_0x9509('0x2e')](db[_0x9509('0x3f')]['rawAttributes']);_0x9d31bc[_0x9509('0x2f')]=_[_0x9509('0x2e')](_0x3dc4bf[_0x9509('0x2f')]);_0x9d31bc[_0x9509('0x39')]=_[_0x9509('0x30')](_0x9d31bc['model'],_0x9d31bc[_0x9509('0x2f')]);_0x290d2c[_0x9509('0x31')]=_[_0x9509('0x30')](_0x9d31bc[_0x9509('0x2c')],qs[_0x9509('0x32')](_0x3dc4bf[_0x9509('0x2f')][_0x9509('0x32')]));_0x290d2c[_0x9509('0x31')]=_0x290d2c[_0x9509('0x31')][_0x9509('0x33')]?_0x290d2c[_0x9509('0x31')]:_0x9d31bc[_0x9509('0x2c')];if(_0x3dc4bf[_0x9509('0x2f')]['includeAll']){_0x290d2c[_0x9509('0x44')]=[{'all':!![]}];}_0x290d2c=_[_0x9509('0x3b')]({},_0x290d2c,_0x3dc4bf[_0x9509('0x3e')]);return db[_0x9509('0x3f')]['find'](_0x290d2c)[_0x9509('0x24')](handleEntityNotFound(_0x233fa9,null))[_0x9509('0x24')](respondWithResult(_0x233fa9,null))['catch'](handleError(_0x233fa9,null));};exports[_0x9509('0x45')]=function(_0x5af292,_0x5dacc7){return db['VtigerAccount'][_0x9509('0x45')](_0x5af292[_0x9509('0x46')],{})[_0x9509('0x24')](respondWithResult(_0x5dacc7,0xc9))[_0x9509('0x41')](handleError(_0x5dacc7,null));};exports[_0x9509('0x47')]=function(_0x15a6d7,_0x526162){if(_0x15a6d7[_0x9509('0x46')]['id']){delete _0x15a6d7[_0x9509('0x46')]['id'];}return db['VtigerAccount'][_0x9509('0x48')]({'where':{'id':_0x15a6d7[_0x9509('0x43')]['id']}})['then'](handleEntityNotFound(_0x526162,null))[_0x9509('0x24')](saveUpdates(_0x15a6d7[_0x9509('0x46')],null))[_0x9509('0x24')](respondWithResult(_0x526162,null))[_0x9509('0x41')](handleError(_0x526162,null));};exports['destroy']=function(_0x2379bc,_0x5b6c95){return db[_0x9509('0x3f')][_0x9509('0x48')]({'where':{'id':_0x2379bc[_0x9509('0x43')]['id']}})['then'](handleEntityNotFound(_0x5b6c95,null))[_0x9509('0x24')](removeEntity(_0x5b6c95,null))[_0x9509('0x41')](handleError(_0x5b6c95,null));};exports[_0x9509('0x49')]=function(_0x1784ef,_0x4c3d86,_0x39039d){var _0x2df9bb={};var _0x223cea={};var _0x23af59;var _0x3ee825;return db[_0x9509('0x3f')][_0x9509('0x4a')]({'where':{'id':_0x1784ef[_0x9509('0x43')]['id']}})[_0x9509('0x24')](handleEntityNotFound(_0x4c3d86,null))[_0x9509('0x24')](function(_0x3cb99a){if(_0x3cb99a){_0x23af59=_0x3cb99a;_0x223cea[_0x9509('0x2c')]=_[_0x9509('0x2e')](db[_0x9509('0x4b')][_0x9509('0x29')]);_0x223cea[_0x9509('0x2f')]=_[_0x9509('0x2e')](_0x1784ef[_0x9509('0x2f')]);_0x223cea[_0x9509('0x39')]=_[_0x9509('0x30')](_0x223cea[_0x9509('0x2c')],_0x223cea[_0x9509('0x2f')]);_0x2df9bb['attributes']=_[_0x9509('0x30')](_0x223cea[_0x9509('0x2c')],qs['fields'](_0x1784ef[_0x9509('0x2f')][_0x9509('0x32')]));_0x2df9bb[_0x9509('0x31')]=_0x2df9bb[_0x9509('0x31')][_0x9509('0x33')]?_0x2df9bb[_0x9509('0x31')]:_0x223cea[_0x9509('0x2c')];_0x2df9bb[_0x9509('0x35')]=qs[_0x9509('0x36')](_0x1784ef[_0x9509('0x2f')][_0x9509('0x36')]);_0x2df9bb[_0x9509('0x37')]=qs['filters'](_[_0x9509('0x38')](_0x1784ef[_0x9509('0x2f')],_0x223cea[_0x9509('0x39')]));if(_0x1784ef[_0x9509('0x2f')][_0x9509('0x3a')]){_0x2df9bb['where']=_['merge'](_0x2df9bb[_0x9509('0x37')],{'$or':_[_0x9509('0x2d')](_0x2df9bb[_0x9509('0x31')],function(_0x33e014){var _0x695933={};_0x695933[_0x33e014]={'$like':'%'+_0x1784ef[_0x9509('0x2f')][_0x9509('0x3a')]+'%'};return _0x695933;})});}_0x2df9bb=_[_0x9509('0x3b')]({},_0x2df9bb,_0x1784ef[_0x9509('0x3e')]);return _0x23af59[_0x9509('0x49')](_0x2df9bb);}})[_0x9509('0x24')](function(_0xeff1a6){if(_0xeff1a6){_0x3ee825=_0xeff1a6[_0x9509('0x33')];if(!_0x1784ef[_0x9509('0x2f')][_0x9509('0x34')](_0x9509('0x4c'))){_0x2df9bb[_0x9509('0x1e')]=qs[_0x9509('0x1e')](_0x1784ef[_0x9509('0x2f')][_0x9509('0x1e')]);_0x2df9bb[_0x9509('0x1c')]=qs[_0x9509('0x1c')](_0x1784ef[_0x9509('0x2f')]['offset']);}return _0x23af59[_0x9509('0x49')](_0x2df9bb);}})[_0x9509('0x24')](function(_0x4647b8){if(_0x4647b8){return _0x4647b8?{'count':_0x3ee825,'rows':_0x4647b8}:null;}})[_0x9509('0x24')](respondWithResult(_0x4c3d86,null))[_0x9509('0x41')](handleError(_0x4c3d86,null));};exports['addConfiguration']=function(_0x23bde4,_0x2c0ad2,_0x1f6a8b){if(_0x23bde4[_0x9509('0x46')]['id']){delete _0x23bde4['body']['id'];}return db[_0x9509('0x3f')][_0x9509('0x4a')]({'where':{'id':_0x23bde4['params']['id']}})[_0x9509('0x24')](handleEntityNotFound(_0x2c0ad2,null))[_0x9509('0x24')](function(_0x53af2d){if(_0x53af2d){_0x23bde4[_0x9509('0x46')][_0x9509('0x4d')]=_0x53af2d['id'];_0x23bde4[_0x9509('0x46')][_0x9509('0x4e')]=integrations[_0x9509('0x4f')](_0x23bde4[_0x9509('0x46')][_0x9509('0x50')],_0x23bde4['body']['type']);_0x23bde4[_0x9509('0x46')][_0x9509('0x51')]=integrations[_0x9509('0x52')](_0x23bde4[_0x9509('0x46')][_0x9509('0x50')],_0x23bde4[_0x9509('0x46')][_0x9509('0x3c')]);return db[_0x9509('0x4b')]['create'](_0x23bde4[_0x9509('0x46')],{'include':[{'model':db[_0x9509('0x53')],'as':_0x9509('0x4e')},{'model':db[_0x9509('0x53')],'as':_0x9509('0x51')}]});}return null;})[_0x9509('0x24')](respondWithResult(_0x2c0ad2,null))['catch'](handleError(_0x2c0ad2,null));};var md5=require('md5');exports[_0x9509('0x54')]=function(_0xd16ae7,_0x30542e,_0x3997d3){var _0x36732d=null;var _0x3c9452=null;var _0x3f61b9=null;var _0x3094b4=null;var _0x58d125='';return db[_0x9509('0x3f')][_0x9509('0x4a')]({'where':{'id':_0xd16ae7['params']['id']},'attributes':['id',_0x9509('0x26'),_0x9509('0x55'),_0x9509('0x56'),_0x9509('0x57'),_0x9509('0x58'),_0x9509('0x59'),_0x9509('0x5a')]})[_0x9509('0x24')](handleEntityNotFound(_0x30542e,null))['then'](function(_0x590210){if(_0x590210){_0x36732d=_0x590210[_0x9509('0x55')];_0x3c9452=_0x590210['accessKey'];_0x3f61b9=_0x590210[_0x9509('0x57')];_0x58d125=_0x590210[_0x9509('0x58')];var _0x2904ba=_0x58d125[_0x9509('0x5b')](-0x1);if(_0x2904ba==='/'){_0x58d125=_0x58d125['substring'](0x0,_0x58d125[_0x9509('0x5c')](_0x2904ba));}_0x3094b4=util[_0x9509('0x5d')](_0x9509('0x5e'),_0x58d125);var _0x25d815={'method':_0x9509('0x5f'),'uri':_0x3094b4,'qs':{'operation':'getchallenge','username':_0x590210[_0x9509('0x55')]},'json':!![]};return rp(_0x25d815);}})[_0x9509('0x24')](function(_0x512d0f){if(_0x512d0f[_0x9509('0x60')]){var _0x526328={'method':_0x9509('0x61'),'uri':_0x3094b4,'form':{'operation':_0x9509('0x62'),'username':_0x36732d,'accessKey':md5(_0x512d0f[_0x9509('0x63')]['token']+_0x3c9452)},'json':!![]};return rp(_0x526328);}})['then'](function(_0x448359){if(_0x448359['success']){var _0x221595={'method':_0x9509('0x5f'),'uri':_0x3094b4,'qs':{'operation':_0x9509('0x64'),'username':_0x36732d,'sessionName':_0x448359['result']['sessionName'],'elementType':_0x3f61b9},'json':!![]};return rp(_0x221595);}})[_0x9509('0x24')](function(_0x325e89){if(_0x325e89[_0x9509('0x60')]){var _0x3498e9=[_0x9509('0x65'),_0x9509('0x66'),'owner'];_[_0x9509('0x67')](_0x325e89[_0x9509('0x63')][_0x9509('0x32')],function(_0x24c9c1){return _0x3498e9[_0x9509('0x68')](_0x24c9c1[_0x9509('0x3c')][_0x9509('0x26')]);});_[_0x9509('0x67')](_0x325e89['result'][_0x9509('0x32')],function(_0x267251){return _0x267251[_0x9509('0x69')]===_0x9509('0x6a');});return{'count':_0x325e89[_0x9509('0x63')]['fields'][_0x9509('0x33')],'rows':_[_0x9509('0x2d')](_0x325e89[_0x9509('0x63')]['fields'],function(_0x1045f2){return{'id':_0x1045f2[_0x9509('0x26')],'name':_0x1045f2[_0x9509('0x6b')],'custom':_[_0x9509('0x6c')](_0x1045f2[_0x9509('0x26')],_0x9509('0x6d'))?!![]:![],'options':_0x1045f2[_0x9509('0x3c')][_0x9509('0x26')]==='picklist'&&_0x1045f2['type'][_0x9509('0x6e')][_0x9509('0x33')]>0x0?_[_0x9509('0x2d')](_0x1045f2[_0x9509('0x3c')][_0x9509('0x6e')],function(_0x4255eb){return{'name':_0x4255eb[_0x9509('0x6b')],'value':_0x4255eb[_0x9509('0x6f')]};}):[]};})};}})[_0x9509('0x24')](respondWithResult(_0x30542e,null))['catch'](function(_0x4dfba1){console[_0x9509('0x70')](_0x9509('0x71')+_0x4dfba1);var _0x5a5753=_0xd16ae7[_0x9509('0x2f')][_0x9509('0x72')]?0x1f4:_0x4dfba1[_0x9509('0x73')]||0x1f4;logger[_0x9509('0x74')](_0x9509('0x75'),'getFields',_0x5a5753,JSON[_0x9509('0x76')](_0x4dfba1));delete _0x4dfba1['name'];if(_0x5a5753===0x191){_0x5a5753=0x190;}_0x30542e[_0x9509('0x19')](_0x5a5753)[_0x9509('0x27')](_0xd16ae7[_0x9509('0x2f')][_0x9509('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x4dfba1[_0x9509('0x73')]}:_0x4dfba1);});}; \ No newline at end of file +var _0x6ddf=['zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','limit','undefined','count','Content-Range','json','apply','save','then','destroy','sendStatus','stack','name','send','index','map','VtigerAccount','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','keys','rawAttributes','find','catch','create','body','update','params','getConfigurations','findOne','VtigerConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','description','serverUrl','accessKey','username','moduleName','remoteUri','slice','substring','lastIndexOf','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','owner','remove','includes','false','startsWith','picklist','picklistValues','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf'];(function(_0x25e32a,_0x738d03){var _0x5723b3=function(_0x77b23f){while(--_0x77b23f){_0x25e32a['push'](_0x25e32a['shift']());}};_0x5723b3(++_0x738d03);}(_0x6ddf,0x1c7));var _0xf6dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ddf[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6dd('0x0'));var zipdir=require(_0xf6dd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf6dd('0x2'));var BPromise=require(_0xf6dd('0x3'));var Mustache=require(_0xf6dd('0x4'));var util=require(_0xf6dd('0x5'));var path=require(_0xf6dd('0x6'));var sox=require(_0xf6dd('0x7'));var csv=require(_0xf6dd('0x8'));var ejs=require(_0xf6dd('0x9'));var fs=require('fs');var fs_extra=require(_0xf6dd('0xa'));var _=require(_0xf6dd('0xb'));var squel=require('squel');var crypto=require(_0xf6dd('0xc'));var jsforce=require(_0xf6dd('0xd'));var deskjs=require(_0xf6dd('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf6dd('0xf'));var Redis=require(_0xf6dd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf6dd('0x11'));var as=require(_0xf6dd('0x12'));var hardwareService=require(_0xf6dd('0x13'));var logger=require(_0xf6dd('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf6dd('0x15'));var db=require(_0xf6dd('0x16'))['db'];var integrations=require(_0xf6dd('0x17'));function respondWithStatusCode(_0x1b570b,_0x3538f1){_0x3538f1=_0x3538f1||0xcc;return function(_0x36ca80){if(_0x36ca80){return _0x1b570b['sendStatus'](_0x3538f1);}return _0x1b570b[_0xf6dd('0x18')](_0x3538f1)[_0xf6dd('0x19')]();};}function respondWithResult(_0x55edde,_0x335ccd){_0x335ccd=_0x335ccd||0xc8;return function(_0x16d318){if(_0x16d318){return _0x55edde[_0xf6dd('0x18')](_0x335ccd)['json'](_0x16d318);}};}function respondWithFilteredResult(_0x2cff44,_0x1dea1c){return function(_0x2451b9){if(_0x2451b9){var _0x23ecd=typeof _0x1dea1c[_0xf6dd('0x1a')]==='undefined'&&typeof _0x1dea1c[_0xf6dd('0x1b')]===_0xf6dd('0x1c');var _0x16afb0=_0x2451b9[_0xf6dd('0x1d')];var _0x55822d=_0x23ecd?0x0:_0x1dea1c[_0xf6dd('0x1a')];var _0x4ab5a8=_0x23ecd?_0x2451b9['count']:_0x1dea1c[_0xf6dd('0x1a')]+_0x1dea1c[_0xf6dd('0x1b')];var _0x20f397;if(_0x4ab5a8>=_0x16afb0){_0x4ab5a8=_0x16afb0;_0x20f397=0xc8;}else{_0x20f397=0xce;}_0x2cff44[_0xf6dd('0x18')](_0x20f397);return _0x2cff44['set'](_0xf6dd('0x1e'),_0x55822d+'-'+_0x4ab5a8+'/'+_0x16afb0)[_0xf6dd('0x1f')](_0x2451b9);}return null;};}function patchUpdates(_0xb982e8){return function(_0x3f678f){try{jsonpatch[_0xf6dd('0x20')](_0x3f678f,_0xb982e8,!![]);}catch(_0x14f6c3){return BPromise['reject'](_0x14f6c3);}return _0x3f678f[_0xf6dd('0x21')]();};}function saveUpdates(_0x5688d7,_0x17ee35){return function(_0x3fdad6){if(_0x3fdad6){return _0x3fdad6['update'](_0x5688d7)[_0xf6dd('0x22')](function(_0x17d5fc){return _0x17d5fc;});}return null;};}function removeEntity(_0xb2b56e,_0x140bfb){return function(_0x1214e9){if(_0x1214e9){return _0x1214e9[_0xf6dd('0x23')]()['then'](function(){_0xb2b56e['status'](0xcc)[_0xf6dd('0x19')]();});}};}function handleEntityNotFound(_0x3ccc06,_0x503bd4){return function(_0x321fdd){if(!_0x321fdd){_0x3ccc06[_0xf6dd('0x24')](0x194);}return _0x321fdd;};}function handleError(_0x25759f,_0x5a9b5b){_0x5a9b5b=_0x5a9b5b||0x1f4;return function(_0x287010){logger['error'](_0x287010[_0xf6dd('0x25')]);if(_0x287010[_0xf6dd('0x26')]){delete _0x287010[_0xf6dd('0x26')];}_0x25759f[_0xf6dd('0x18')](_0x5a9b5b)[_0xf6dd('0x27')](_0x287010);};}exports[_0xf6dd('0x28')]=function(_0x4fdfc7,_0x42ac44){var _0x567516={},_0x1e61d6={},_0x817cb2={'count':0x0,'rows':[]};var _0x52f21a=_[_0xf6dd('0x29')](db[_0xf6dd('0x2a')]['rawAttributes'],function(_0xd1c86c){return{'name':_0xd1c86c['fieldName'],'type':_0xd1c86c[_0xf6dd('0x2b')][_0xf6dd('0x2c')]};});_0x1e61d6[_0xf6dd('0x2d')]=_[_0xf6dd('0x29')](_0x52f21a,_0xf6dd('0x26'));_0x1e61d6[_0xf6dd('0x2e')]=_['keys'](_0x4fdfc7[_0xf6dd('0x2e')]);_0x1e61d6[_0xf6dd('0x2f')]=_[_0xf6dd('0x30')](_0x1e61d6[_0xf6dd('0x2d')],_0x1e61d6[_0xf6dd('0x2e')]);_0x567516['attributes']=_[_0xf6dd('0x30')](_0x1e61d6['model'],qs[_0xf6dd('0x31')](_0x4fdfc7[_0xf6dd('0x2e')][_0xf6dd('0x31')]));_0x567516[_0xf6dd('0x32')]=_0x567516[_0xf6dd('0x32')][_0xf6dd('0x33')]?_0x567516['attributes']:_0x1e61d6[_0xf6dd('0x2d')];if(!_0x4fdfc7[_0xf6dd('0x2e')][_0xf6dd('0x34')](_0xf6dd('0x35'))){_0x567516['limit']=qs['limit'](_0x4fdfc7[_0xf6dd('0x2e')]['limit']);_0x567516['offset']=qs['offset'](_0x4fdfc7[_0xf6dd('0x2e')]['offset']);}_0x567516[_0xf6dd('0x36')]=qs[_0xf6dd('0x37')](_0x4fdfc7[_0xf6dd('0x2e')][_0xf6dd('0x37')]);_0x567516[_0xf6dd('0x38')]=qs['filters'](_[_0xf6dd('0x39')](_0x4fdfc7[_0xf6dd('0x2e')],_0x1e61d6[_0xf6dd('0x2f')]),_0x52f21a);if(_0x4fdfc7[_0xf6dd('0x2e')][_0xf6dd('0x3a')]){_0x567516['where']=_[_0xf6dd('0x3b')](_0x567516[_0xf6dd('0x38')],{'$or':_[_0xf6dd('0x29')](_0x52f21a,function(_0x2c9b7e){if(_0x2c9b7e['type']!==_0xf6dd('0x3c')){var _0xdd6c12={};_0xdd6c12[_0x2c9b7e[_0xf6dd('0x26')]]={'$like':'%'+_0x4fdfc7[_0xf6dd('0x2e')][_0xf6dd('0x3a')]+'%'};return _0xdd6c12;}})});}_0x567516=_[_0xf6dd('0x3b')]({},_0x567516,_0x4fdfc7[_0xf6dd('0x3d')]);var _0x2ef6d4={'where':_0x567516[_0xf6dd('0x38')]};return db[_0xf6dd('0x2a')][_0xf6dd('0x1d')](_0x2ef6d4)[_0xf6dd('0x22')](function(_0x327064){_0x817cb2[_0xf6dd('0x1d')]=_0x327064;if(_0x4fdfc7[_0xf6dd('0x2e')]['includeAll']){_0x567516[_0xf6dd('0x3e')]=[{'all':!![]}];}return db[_0xf6dd('0x2a')][_0xf6dd('0x3f')](_0x567516);})['then'](function(_0x4c6122){_0x817cb2['rows']=_0x4c6122;return _0x817cb2;})['then'](respondWithFilteredResult(_0x42ac44,_0x567516))['catch'](handleError(_0x42ac44,null));};exports[_0xf6dd('0x40')]=function(_0x1dc69d,_0xc2ccf6){var _0x335733={'raw':![],'where':{'id':_0x1dc69d['params']['id']}},_0x92c903={};_0x92c903['model']=_[_0xf6dd('0x41')](db[_0xf6dd('0x2a')][_0xf6dd('0x42')]);_0x92c903[_0xf6dd('0x2e')]=_[_0xf6dd('0x41')](_0x1dc69d[_0xf6dd('0x2e')]);_0x92c903[_0xf6dd('0x2f')]=_['intersection'](_0x92c903['model'],_0x92c903[_0xf6dd('0x2e')]);_0x335733['attributes']=_[_0xf6dd('0x30')](_0x92c903[_0xf6dd('0x2d')],qs['fields'](_0x1dc69d[_0xf6dd('0x2e')][_0xf6dd('0x31')]));_0x335733[_0xf6dd('0x32')]=_0x335733[_0xf6dd('0x32')][_0xf6dd('0x33')]?_0x335733[_0xf6dd('0x32')]:_0x92c903[_0xf6dd('0x2d')];if(_0x1dc69d[_0xf6dd('0x2e')]['includeAll']){_0x335733[_0xf6dd('0x3e')]=[{'all':!![]}];}_0x335733=_[_0xf6dd('0x3b')]({},_0x335733,_0x1dc69d[_0xf6dd('0x3d')]);return db[_0xf6dd('0x2a')][_0xf6dd('0x43')](_0x335733)[_0xf6dd('0x22')](handleEntityNotFound(_0xc2ccf6,null))[_0xf6dd('0x22')](respondWithResult(_0xc2ccf6,null))[_0xf6dd('0x44')](handleError(_0xc2ccf6,null));};exports['create']=function(_0x595e98,_0x4da93c){return db[_0xf6dd('0x2a')][_0xf6dd('0x45')](_0x595e98[_0xf6dd('0x46')],{})['then'](respondWithResult(_0x4da93c,0xc9))[_0xf6dd('0x44')](handleError(_0x4da93c,null));};exports[_0xf6dd('0x47')]=function(_0x179e21,_0x30cb03){if(_0x179e21[_0xf6dd('0x46')]['id']){delete _0x179e21[_0xf6dd('0x46')]['id'];}return db[_0xf6dd('0x2a')][_0xf6dd('0x43')]({'where':{'id':_0x179e21[_0xf6dd('0x48')]['id']}})['then'](handleEntityNotFound(_0x30cb03,null))[_0xf6dd('0x22')](saveUpdates(_0x179e21['body'],null))['then'](respondWithResult(_0x30cb03,null))[_0xf6dd('0x44')](handleError(_0x30cb03,null));};exports['destroy']=function(_0x4c96e4,_0x44a9ef){return db[_0xf6dd('0x2a')][_0xf6dd('0x43')]({'where':{'id':_0x4c96e4['params']['id']}})['then'](handleEntityNotFound(_0x44a9ef,null))[_0xf6dd('0x22')](removeEntity(_0x44a9ef,null))[_0xf6dd('0x44')](handleError(_0x44a9ef,null));};exports[_0xf6dd('0x49')]=function(_0x1cf376,_0x125985,_0x4e5e5b){var _0x53bc55={};var _0x4def1d={};var _0x269598;var _0x14b8fe;return db[_0xf6dd('0x2a')][_0xf6dd('0x4a')]({'where':{'id':_0x1cf376[_0xf6dd('0x48')]['id']}})['then'](handleEntityNotFound(_0x125985,null))[_0xf6dd('0x22')](function(_0x121b81){if(_0x121b81){_0x269598=_0x121b81;_0x4def1d[_0xf6dd('0x2d')]=_[_0xf6dd('0x41')](db[_0xf6dd('0x4b')][_0xf6dd('0x42')]);_0x4def1d[_0xf6dd('0x2e')]=_[_0xf6dd('0x41')](_0x1cf376[_0xf6dd('0x2e')]);_0x4def1d[_0xf6dd('0x2f')]=_[_0xf6dd('0x30')](_0x4def1d[_0xf6dd('0x2d')],_0x4def1d[_0xf6dd('0x2e')]);_0x53bc55['attributes']=_[_0xf6dd('0x30')](_0x4def1d['model'],qs[_0xf6dd('0x31')](_0x1cf376[_0xf6dd('0x2e')]['fields']));_0x53bc55[_0xf6dd('0x32')]=_0x53bc55['attributes'][_0xf6dd('0x33')]?_0x53bc55[_0xf6dd('0x32')]:_0x4def1d[_0xf6dd('0x2d')];_0x53bc55[_0xf6dd('0x36')]=qs[_0xf6dd('0x37')](_0x1cf376[_0xf6dd('0x2e')]['sort']);_0x53bc55[_0xf6dd('0x38')]=qs[_0xf6dd('0x2f')](_[_0xf6dd('0x39')](_0x1cf376[_0xf6dd('0x2e')],_0x4def1d[_0xf6dd('0x2f')]));if(_0x1cf376['query'][_0xf6dd('0x3a')]){_0x53bc55[_0xf6dd('0x38')]=_[_0xf6dd('0x3b')](_0x53bc55[_0xf6dd('0x38')],{'$or':_[_0xf6dd('0x29')](_0x53bc55[_0xf6dd('0x32')],function(_0x4e9a96){var _0xdb9282={};_0xdb9282[_0x4e9a96]={'$like':'%'+_0x1cf376['query'][_0xf6dd('0x3a')]+'%'};return _0xdb9282;})});}_0x53bc55=_[_0xf6dd('0x3b')]({},_0x53bc55,_0x1cf376[_0xf6dd('0x3d')]);return _0x269598[_0xf6dd('0x49')](_0x53bc55);}})[_0xf6dd('0x22')](function(_0x1bec27){if(_0x1bec27){_0x14b8fe=_0x1bec27[_0xf6dd('0x33')];if(!_0x1cf376[_0xf6dd('0x2e')]['hasOwnProperty'](_0xf6dd('0x35'))){_0x53bc55[_0xf6dd('0x1b')]=qs['limit'](_0x1cf376[_0xf6dd('0x2e')][_0xf6dd('0x1b')]);_0x53bc55[_0xf6dd('0x1a')]=qs[_0xf6dd('0x1a')](_0x1cf376[_0xf6dd('0x2e')][_0xf6dd('0x1a')]);}return _0x269598['getConfigurations'](_0x53bc55);}})[_0xf6dd('0x22')](function(_0x3cc592){if(_0x3cc592){return _0x3cc592?{'count':_0x14b8fe,'rows':_0x3cc592}:null;}})[_0xf6dd('0x22')](respondWithResult(_0x125985,null))['catch'](handleError(_0x125985,null));};exports['addConfiguration']=function(_0xf05c28,_0x20e8d4,_0x1a1ef5){if(_0xf05c28[_0xf6dd('0x46')]['id']){delete _0xf05c28[_0xf6dd('0x46')]['id'];}return db[_0xf6dd('0x2a')][_0xf6dd('0x4a')]({'where':{'id':_0xf05c28[_0xf6dd('0x48')]['id']}})[_0xf6dd('0x22')](handleEntityNotFound(_0x20e8d4,null))['then'](function(_0x32fc70){if(_0x32fc70){_0xf05c28[_0xf6dd('0x46')][_0xf6dd('0x4c')]=_0x32fc70['id'];_0xf05c28[_0xf6dd('0x46')][_0xf6dd('0x4d')]=integrations['getSubjects'](_0xf05c28['body']['channel'],_0xf05c28[_0xf6dd('0x46')][_0xf6dd('0x2b')]);_0xf05c28['body'][_0xf6dd('0x4e')]=integrations[_0xf6dd('0x4f')](_0xf05c28[_0xf6dd('0x46')][_0xf6dd('0x50')],_0xf05c28['body'][_0xf6dd('0x2b')]);return db['VtigerConfiguration'][_0xf6dd('0x45')](_0xf05c28['body'],{'include':[{'model':db[_0xf6dd('0x51')],'as':'Subjects'},{'model':db[_0xf6dd('0x51')],'as':_0xf6dd('0x4e')}]});}return null;})[_0xf6dd('0x22')](respondWithResult(_0x20e8d4,null))[_0xf6dd('0x44')](handleError(_0x20e8d4,null));};var md5=require(_0xf6dd('0x52'));exports[_0xf6dd('0x53')]=function(_0x5a6747,_0x38b608,_0x54c498){var _0x3e9ca8=null;var _0x5cb26d=null;var _0x27a519=null;var _0x54ddea=null;var _0x1b038f='';return db[_0xf6dd('0x2a')][_0xf6dd('0x4a')]({'where':{'id':_0x5a6747[_0xf6dd('0x48')]['id']},'attributes':['id',_0xf6dd('0x26'),'username',_0xf6dd('0x54'),'moduleName','remoteUri',_0xf6dd('0x55'),_0xf6dd('0x56')]})[_0xf6dd('0x22')](handleEntityNotFound(_0x38b608,null))[_0xf6dd('0x22')](function(_0x41456a){if(_0x41456a){_0x3e9ca8=_0x41456a[_0xf6dd('0x57')];_0x5cb26d=_0x41456a[_0xf6dd('0x56')];_0x27a519=_0x41456a[_0xf6dd('0x58')];_0x1b038f=_0x41456a[_0xf6dd('0x59')];var _0x366911=_0x1b038f[_0xf6dd('0x5a')](-0x1);if(_0x366911==='/'){_0x1b038f=_0x1b038f[_0xf6dd('0x5b')](0x0,_0x1b038f[_0xf6dd('0x5c')](_0x366911));}_0x54ddea=util['format']('%s/webservice.php',_0x1b038f);var _0x2a4a0f={'method':_0xf6dd('0x5d'),'uri':_0x54ddea,'qs':{'operation':_0xf6dd('0x5e'),'username':_0x41456a['username']},'json':!![]};return rp(_0x2a4a0f);}})[_0xf6dd('0x22')](function(_0x35fe59){if(_0x35fe59[_0xf6dd('0x5f')]){var _0x13c81d={'method':_0xf6dd('0x60'),'uri':_0x54ddea,'form':{'operation':_0xf6dd('0x61'),'username':_0x3e9ca8,'accessKey':md5(_0x35fe59[_0xf6dd('0x62')][_0xf6dd('0x63')]+_0x5cb26d)},'json':!![]};return rp(_0x13c81d);}})['then'](function(_0x23add2){if(_0x23add2[_0xf6dd('0x5f')]){var _0x5a1a31={'method':_0xf6dd('0x5d'),'uri':_0x54ddea,'qs':{'operation':_0xf6dd('0x64'),'username':_0x3e9ca8,'sessionName':_0x23add2['result'][_0xf6dd('0x65')],'elementType':_0x27a519},'json':!![]};return rp(_0x5a1a31);}})['then'](function(_0x2ae670){if(_0x2ae670[_0xf6dd('0x5f')]){var _0x5a2e0d=[_0xf6dd('0x66'),'reference',_0xf6dd('0x67')];_[_0xf6dd('0x68')](_0x2ae670[_0xf6dd('0x62')]['fields'],function(_0x26d641){return _0x5a2e0d[_0xf6dd('0x69')](_0x26d641[_0xf6dd('0x2b')]['name']);});_['remove'](_0x2ae670[_0xf6dd('0x62')]['fields'],function(_0x53b14f){return _0x53b14f['editable']===_0xf6dd('0x6a');});return{'count':_0x2ae670[_0xf6dd('0x62')][_0xf6dd('0x31')]['length'],'rows':_['map'](_0x2ae670[_0xf6dd('0x62')][_0xf6dd('0x31')],function(_0x58d431){return{'id':_0x58d431['name'],'name':_0x58d431['label'],'custom':_[_0xf6dd('0x6b')](_0x58d431[_0xf6dd('0x26')],'cf_')?!![]:![],'options':_0x58d431[_0xf6dd('0x2b')][_0xf6dd('0x26')]===_0xf6dd('0x6c')&&_0x58d431[_0xf6dd('0x2b')]['picklistValues'][_0xf6dd('0x33')]>0x0?_[_0xf6dd('0x29')](_0x58d431[_0xf6dd('0x2b')][_0xf6dd('0x6d')],function(_0x44a661){return{'name':_0x44a661['label'],'value':_0x44a661['value']};}):[]};})};}})[_0xf6dd('0x22')](respondWithResult(_0x38b608,null))[_0xf6dd('0x44')](function(_0x1301bf){console['log']('vTiger\x20error:\x20'+_0x1301bf);var _0x388e52=_0x5a6747[_0xf6dd('0x2e')][_0xf6dd('0x6e')]?0x1f4:_0x1301bf[_0xf6dd('0x6f')]||0x1f4;logger['error'](_0xf6dd('0x70'),_0xf6dd('0x53'),_0x388e52,JSON[_0xf6dd('0x71')](_0x1301bf));delete _0x1301bf['name'];if(_0x388e52===0x191){_0x388e52=0x190;}_0x38b608[_0xf6dd('0x18')](_0x388e52)['send'](_0x5a6747[_0xf6dd('0x2e')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1301bf['statusCode']}:_0x1301bf);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 802ee02..cdd411a 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 _0x8c61=['rimraf','../../config/environment','./intVtigerAccount.attributes','exports','define','int_vtiger_accounts','api','moment','request-promise'];(function(_0x11b1b3,_0xf3cc69){var _0x437029=function(_0x40499a){while(--_0x40499a){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x437029(++_0xf3cc69);}(_0x8c61,0x9f));var _0x18c6=function(_0x3c0346,_0x45278e){_0x3c0346=_0x3c0346-0x0;var _0x426afc=_0x8c61[_0x3c0346];return _0x426afc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x18c6('0x0'));var moment=require(_0x18c6('0x1'));var BPromise=require('bluebird');var rp=require(_0x18c6('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18c6('0x3'));var config=require(_0x18c6('0x4'));var attributes=require(_0x18c6('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x18c6('0x6')]=function(_0x2ec26d,_0xb8b561){return _0x2ec26d[_0x18c6('0x7')]('VtigerAccount',attributes,{'tableName':_0x18c6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7228=['request-promise','../../config/environment','./intVtigerAccount.attributes','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','api','moment','bluebird'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7228,0x187));var _0x8722=function(_0x248020,_0x225812){_0x248020=_0x248020-0x0;var _0x4a25c4=_0x7228[_0x248020];return _0x4a25c4;};'use strict';var _=require(_0x8722('0x0'));var util=require(_0x8722('0x1'));var logger=require('../../config/logger')(_0x8722('0x2'));var moment=require(_0x8722('0x3'));var BPromise=require(_0x8722('0x4'));var rp=require(_0x8722('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8722('0x6'));var attributes=require(_0x8722('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x8722('0x8')]=function(_0x13ce8b,_0x9b2af){return _0x13ce8b[_0x8722('0x9')](_0x8722('0xa'),attributes,{'tableName':_0x8722('0xb'),'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 43de9e4..c075928 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 _0xed3c=['catch','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xed3c,0x1a6));var _0xced3=function(_0x5159fd,_0x4b760b){_0x5159fd=_0x5159fd-0x0;var _0x409bae=_0xed3c[_0x5159fd];return _0x409bae;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4795cd,_0x510164,_0x5ca701){return new BPromise(function(_0x851bd3,_0x5f2f90){return client['request'](_0x4795cd,_0x5ca701)['then'](function(_0x19a727){logger[_0xced3('0xb')](_0xced3('0xc'),_0x510164,_0xced3('0xd'));logger[_0xced3('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x510164,_0xced3('0xd'),JSON[_0xced3('0xf')](_0x19a727));if(_0x19a727[_0xced3('0x10')]){if(_0x19a727['error'][_0xced3('0x11')]===0x1f4){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);return _0x5f2f90(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}logger['error'](_0xced3('0xc'),_0x510164,_0x19a727['error'][_0xced3('0x12')]);return _0x851bd3(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}else{logger[_0xced3('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x510164,_0xced3('0xd'));_0x851bd3(_0x19a727[_0xced3('0x13')]['message']);}})[_0xced3('0x14')](function(_0x37e2d5){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x37e2d5);_0x5f2f90(_0x37e2d5);});});}exports['GetVtigerAccount']=function(_0x4569af){var _0x4a3afe=this;return new Promise(function(_0x353580,_0x4480a6){return db[_0xced3('0x15')][_0xced3('0x16')]({'raw':_0x4569af[_0xced3('0x17')]?_0x4569af[_0xced3('0x17')][_0xced3('0x18')]===undefined?!![]:![]:!![],'where':_0x4569af[_0xced3('0x17')]?_0x4569af[_0xced3('0x17')][_0xced3('0x19')]||null:null,'attributes':_0x4569af[_0xced3('0x17')]?_0x4569af['options']['attributes']||null:null,'limit':_0x4569af['options']?_0x4569af[_0xced3('0x17')][_0xced3('0x1a')]||null:null,'include':_0x4569af[_0xced3('0x17')]?_0x4569af['options'][_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x4569af['options']['include'],function(_0x3adf14){return{'model':db[_0x3adf14[_0xced3('0x1d')]],'as':_0x3adf14['as'],'attributes':_0x3adf14[_0xced3('0x1e')],'include':_0x3adf14[_0xced3('0x1b')]?_['map'](_0x3adf14[_0xced3('0x1b')],function(_0x23f92b){return{'model':db[_0x23f92b['model']],'as':_0x23f92b['as'],'attributes':_0x23f92b[_0xced3('0x1e')],'include':_0x23f92b['include']?_[_0xced3('0x1c')](_0x23f92b[_0xced3('0x1b')],function(_0x3b728d){return{'model':db[_0x3b728d[_0xced3('0x1d')]],'as':_0x3b728d['as'],'attributes':_0x3b728d[_0xced3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5454c0){logger[_0xced3('0xb')]('GetVtigerAccount',_0x4569af);logger[_0xced3('0xe')](_0xced3('0x1f'),_0x4569af,JSON['stringify'](_0x5454c0));_0x353580(_0x5454c0);})[_0xced3('0x14')](function(_0x4024fa){logger[_0xced3('0x10')](_0xced3('0x1f'),_0x4024fa[_0xced3('0x12')],_0x4569af);_0x4480a6(_0x4a3afe[_0xced3('0x10')](0x1f4,_0x4024fa[_0xced3('0x12')]));});});};exports[_0xced3('0x20')]=function(_0x116cc7){var _0x559b8e=this;return new Promise(function(_0xa78899,_0x1b8baa){return db[_0xced3('0x15')][_0xced3('0x21')]({'raw':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x18')]===undefined?!![]:![]:!![],'where':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x19')]||null:null,'attributes':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x1e')]||null:null,'include':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x116cc7[_0xced3('0x17')][_0xced3('0x1b')],function(_0xcd0fe3){return{'model':db[_0xcd0fe3[_0xced3('0x1d')]],'as':_0xcd0fe3['as'],'attributes':_0xcd0fe3['attributes'],'include':_0xcd0fe3[_0xced3('0x1b')]?_['map'](_0xcd0fe3[_0xced3('0x1b')],function(_0x28f674){return{'model':db[_0x28f674[_0xced3('0x1d')]],'as':_0x28f674['as'],'attributes':_0x28f674[_0xced3('0x1e')],'include':_0x28f674[_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x28f674[_0xced3('0x1b')],function(_0x340be1){return{'model':db[_0x340be1[_0xced3('0x1d')]],'as':_0x340be1['as'],'attributes':_0x340be1[_0xced3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x342c11){logger[_0xced3('0xb')]('ShowVtigerAccount',_0x116cc7);logger[_0xced3('0xe')](_0xced3('0x20'),_0x116cc7,JSON[_0xced3('0xf')](_0x342c11));_0xa78899(_0x342c11);})['catch'](function(_0x59c3aa){logger[_0xced3('0x10')]('ShowVtigerAccount',_0x59c3aa[_0xced3('0x12')],_0x116cc7);_0x1b8baa(_0x559b8e[_0xced3('0x10')](0x1f4,_0x59c3aa['message']));});});}; \ No newline at end of file +var _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','include','map','model','then','ShowVtigerAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0xcb91[_0x35007a];return _0x574f68;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetVtigerAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['VtigerAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowVtigerAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index e51bd79..29c6b50 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 _0x9479=['../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','show','get','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x23ef4b,_0x8808f6){var _0x55f394=function(_0xba9cfe){while(--_0xba9cfe){_0x23ef4b['push'](_0x23ef4b['shift']());}};_0x55f394(++_0x8808f6);}(_0x9479,0x165));var _0x9947=function(_0x18eee3,_0x2a9d6e){_0x18eee3=_0x18eee3-0x0;var _0xfdbb31=_0x9479[_0x18eee3];return _0xfdbb31;};'use strict';var multer=require(_0x9947('0x0'));var util=require(_0x9947('0x1'));var path=require(_0x9947('0x2'));var timeout=require('connect-timeout');var express=require(_0x9947('0x3'));var router=express[_0x9947('0x4')]();var fs_extra=require(_0x9947('0x5'));var auth=require(_0x9947('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9947('0x7'));var controller=require(_0x9947('0x8'));router['get']('/',auth[_0x9947('0x9')](),controller[_0x9947('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9947('0xb')]);router[_0x9947('0xc')](_0x9947('0xd'),auth[_0x9947('0x9')](),controller[_0x9947('0xe')]);router[_0x9947('0xc')]('/:id/subjects',auth[_0x9947('0x9')](),controller[_0x9947('0xf')]);router[_0x9947('0xc')](_0x9947('0x10'),auth[_0x9947('0x9')](),controller[_0x9947('0x11')]);router[_0x9947('0x12')]('/',auth[_0x9947('0x9')](),controller[_0x9947('0x13')]);router[_0x9947('0x14')](_0x9947('0x15'),auth[_0x9947('0x9')](),controller[_0x9947('0x16')]);router[_0x9947('0x17')]('/:id',auth[_0x9947('0x9')](),controller[_0x9947('0x18')]);module[_0x9947('0x19')]=router; \ No newline at end of file +var _0xc0f6=['../../config/environment','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x299f9f,_0x522d28){var _0x4cad12=function(_0x24f4ae){while(--_0x24f4ae){_0x299f9f['push'](_0x299f9f['shift']());}};_0x4cad12(++_0x522d28);}(_0xc0f6,0x99));var _0x6c0f=function(_0x397bfb,_0x589665){_0x397bfb=_0x397bfb-0x0;var _0x16c9b9=_0xc0f6[_0x397bfb];return _0x16c9b9;};'use strict';var multer=require(_0x6c0f('0x0'));var util=require(_0x6c0f('0x1'));var path=require(_0x6c0f('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c0f('0x3'));var router=express[_0x6c0f('0x4')]();var fs_extra=require(_0x6c0f('0x5'));var auth=require(_0x6c0f('0x6'));var interaction=require(_0x6c0f('0x7'));var config=require(_0x6c0f('0x8'));var controller=require(_0x6c0f('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6c0f('0xa')](_0x6c0f('0xb'),auth[_0x6c0f('0xc')](),controller[_0x6c0f('0xd')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x6c0f('0xe')]);router[_0x6c0f('0xa')](_0x6c0f('0xf'),auth[_0x6c0f('0xc')](),controller[_0x6c0f('0x10')]);router[_0x6c0f('0xa')]('/:id/descriptions',auth[_0x6c0f('0xc')](),controller[_0x6c0f('0x11')]);router['post']('/',auth[_0x6c0f('0xc')](),controller[_0x6c0f('0x12')]);router[_0x6c0f('0x13')](_0x6c0f('0xb'),auth['isAuthenticated'](),controller[_0x6c0f('0x14')]);router[_0x6c0f('0x15')]('/:id',auth[_0x6c0f('0xc')](),controller['destroy']);module[_0x6c0f('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 49e6ec4..a03b902 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 _0xca3c=['STRING','sequelize'];(function(_0x56e8ed,_0x55fb0e){var _0x32a0ad=function(_0x3c9550){while(--_0x3c9550){_0x56e8ed['push'](_0x56e8ed['shift']());}};_0x32a0ad(++_0x55fb0e);}(_0xca3c,0x7f));var _0xcca3=function(_0x515ef0,_0x428924){_0x515ef0=_0x515ef0-0x0;var _0x23666b=_0xca3c[_0x515ef0];return _0x23666b;};'use strict';var Sequelize=require(_0xcca3('0x0'));module['exports']={'name':{'type':Sequelize[_0xcca3('0x1')]},'description':{'type':Sequelize[_0xcca3('0x1')]}}; \ No newline at end of file +var _0x63fb=['STRING','exports'];(function(_0x17fd8a,_0x588449){var _0x2bad8e=function(_0x1bda10){while(--_0x1bda10){_0x17fd8a['push'](_0x17fd8a['shift']());}};_0x2bad8e(++_0x588449);}(_0x63fb,0x177));var _0xb63f=function(_0x9a85cd,_0x51e751){_0x9a85cd=_0x9a85cd-0x0;var _0x15b2f8=_0x63fb[_0x9a85cd];return _0x15b2f8;};'use strict';var Sequelize=require('sequelize');module[_0xb63f('0x0')]={'name':{'type':Sequelize[_0xb63f('0x1')]},'description':{'type':Sequelize[_0xb63f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 5919cbb..ee54a4c 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 _0xb549=['pick','filter','where','merge','options','includeAll','include','findAll','catch','show','keys','rawAttributes','create','body','find','params','getFields','findOne','VtigerField','order','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','VtigerConfiguration','fieldName','type','query','intersection','model','attributes','fields','length','sort','filters'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xb549,0x164));var _0x9b54=function(_0x23c09e,_0x3f5baf){_0x23c09e=_0x23c09e-0x0;var _0x170472=_0xb549[_0x23c09e];return _0x170472;};'use strict';var emlformat=require(_0x9b54('0x0'));var rimraf=require(_0x9b54('0x1'));var zipdir=require(_0x9b54('0x2'));var jsonpatch=require(_0x9b54('0x3'));var rp=require(_0x9b54('0x4'));var moment=require(_0x9b54('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9b54('0x6'));var util=require(_0x9b54('0x7'));var path=require(_0x9b54('0x8'));var sox=require(_0x9b54('0x9'));var csv=require(_0x9b54('0xa'));var ejs=require(_0x9b54('0xb'));var fs=require('fs');var fs_extra=require(_0x9b54('0xc'));var _=require(_0x9b54('0xd'));var squel=require(_0x9b54('0xe'));var crypto=require(_0x9b54('0xf'));var jsforce=require(_0x9b54('0x10'));var deskjs=require(_0x9b54('0x11'));var toCsv=require(_0x9b54('0xa'));var querystring=require(_0x9b54('0x12'));var Papa=require(_0x9b54('0x13'));var Redis=require(_0x9b54('0x14'));var authService=require(_0x9b54('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x9b54('0x16'));var hardwareService=require(_0x9b54('0x17'));var logger=require(_0x9b54('0x18'))(_0x9b54('0x19'));var utils=require(_0x9b54('0x1a'));var config=require(_0x9b54('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x296945,_0x125e16){_0x125e16=_0x125e16||0xcc;return function(_0x2315d1){if(_0x2315d1){return _0x296945[_0x9b54('0x1c')](_0x125e16);}return _0x296945['status'](_0x125e16)[_0x9b54('0x1d')]();};}function respondWithResult(_0x530333,_0x545296){_0x545296=_0x545296||0xc8;return function(_0xacda27){if(_0xacda27){return _0x530333['status'](_0x545296)[_0x9b54('0x1e')](_0xacda27);}};}function respondWithFilteredResult(_0x2e8072,_0x1458aa){return function(_0x1173ae){if(_0x1173ae){var _0x70729b=typeof _0x1458aa[_0x9b54('0x1f')]===_0x9b54('0x20')&&typeof _0x1458aa[_0x9b54('0x21')]===_0x9b54('0x20');var _0x57d093=_0x1173ae[_0x9b54('0x22')];var _0x4751dd=_0x70729b?0x0:_0x1458aa[_0x9b54('0x1f')];var _0x2fcdd4=_0x70729b?_0x1173ae[_0x9b54('0x22')]:_0x1458aa['offset']+_0x1458aa[_0x9b54('0x21')];var _0x8cc81e;if(_0x2fcdd4>=_0x57d093){_0x2fcdd4=_0x57d093;_0x8cc81e=0xc8;}else{_0x8cc81e=0xce;}_0x2e8072[_0x9b54('0x23')](_0x8cc81e);return _0x2e8072[_0x9b54('0x24')]('Content-Range',_0x4751dd+'-'+_0x2fcdd4+'/'+_0x57d093)[_0x9b54('0x1e')](_0x1173ae);}return null;};}function patchUpdates(_0x93c7d2){return function(_0x1416fa){try{jsonpatch[_0x9b54('0x25')](_0x1416fa,_0x93c7d2,!![]);}catch(_0x5225f6){return BPromise[_0x9b54('0x26')](_0x5225f6);}return _0x1416fa[_0x9b54('0x27')]();};}function saveUpdates(_0x4fa934,_0x815b86){return function(_0x2efe8b){if(_0x2efe8b){return _0x2efe8b[_0x9b54('0x28')](_0x4fa934)[_0x9b54('0x29')](function(_0x294b4b){return _0x294b4b;});}return null;};}function removeEntity(_0x581a7b,_0x385ae8){return function(_0x512291){if(_0x512291){return _0x512291[_0x9b54('0x2a')]()[_0x9b54('0x29')](function(){_0x581a7b['status'](0xcc)[_0x9b54('0x1d')]();});}};}function handleEntityNotFound(_0x3bb32d,_0x26e3ad){return function(_0x1a1dd3){if(!_0x1a1dd3){_0x3bb32d[_0x9b54('0x1c')](0x194);}return _0x1a1dd3;};}function handleError(_0x16439a,_0x2c57cf){_0x2c57cf=_0x2c57cf||0x1f4;return function(_0xa01ee3){logger['error'](_0xa01ee3[_0x9b54('0x2b')]);if(_0xa01ee3[_0x9b54('0x2c')]){delete _0xa01ee3['name'];}_0x16439a[_0x9b54('0x23')](_0x2c57cf)[_0x9b54('0x2d')](_0xa01ee3);};}exports[_0x9b54('0x2e')]=function(_0x4fa54b,_0x2404ab){var _0x1090b3={},_0x5cbfe9={},_0x2cb3ea={'count':0x0,'rows':[]};var _0x3c9491=_[_0x9b54('0x2f')](db[_0x9b54('0x30')]['rawAttributes'],function(_0x3e1a2d){return{'name':_0x3e1a2d[_0x9b54('0x31')],'type':_0x3e1a2d[_0x9b54('0x32')]['key']};});_0x5cbfe9['model']=_[_0x9b54('0x2f')](_0x3c9491,_0x9b54('0x2c'));_0x5cbfe9[_0x9b54('0x33')]=_['keys'](_0x4fa54b[_0x9b54('0x33')]);_0x5cbfe9['filters']=_[_0x9b54('0x34')](_0x5cbfe9[_0x9b54('0x35')],_0x5cbfe9['query']);_0x1090b3[_0x9b54('0x36')]=_['intersection'](_0x5cbfe9[_0x9b54('0x35')],qs[_0x9b54('0x37')](_0x4fa54b['query'][_0x9b54('0x37')]));_0x1090b3[_0x9b54('0x36')]=_0x1090b3[_0x9b54('0x36')][_0x9b54('0x38')]?_0x1090b3[_0x9b54('0x36')]:_0x5cbfe9[_0x9b54('0x35')];if(!_0x4fa54b[_0x9b54('0x33')]['hasOwnProperty']('nolimit')){_0x1090b3[_0x9b54('0x21')]=qs[_0x9b54('0x21')](_0x4fa54b[_0x9b54('0x33')][_0x9b54('0x21')]);_0x1090b3['offset']=qs[_0x9b54('0x1f')](_0x4fa54b[_0x9b54('0x33')][_0x9b54('0x1f')]);}_0x1090b3['order']=qs['sort'](_0x4fa54b['query'][_0x9b54('0x39')]);_0x1090b3['where']=qs[_0x9b54('0x3a')](_[_0x9b54('0x3b')](_0x4fa54b[_0x9b54('0x33')],_0x5cbfe9['filters']),_0x3c9491);if(_0x4fa54b[_0x9b54('0x33')][_0x9b54('0x3c')]){_0x1090b3[_0x9b54('0x3d')]=_[_0x9b54('0x3e')](_0x1090b3[_0x9b54('0x3d')],{'$or':_[_0x9b54('0x2f')](_0x3c9491,function(_0x3fc3cd){if(_0x3fc3cd[_0x9b54('0x32')]!=='VIRTUAL'){var _0x351f7b={};_0x351f7b[_0x3fc3cd[_0x9b54('0x2c')]]={'$like':'%'+_0x4fa54b['query'][_0x9b54('0x3c')]+'%'};return _0x351f7b;}})});}_0x1090b3=_[_0x9b54('0x3e')]({},_0x1090b3,_0x4fa54b[_0x9b54('0x3f')]);var _0x321f18={'where':_0x1090b3[_0x9b54('0x3d')]};return db[_0x9b54('0x30')][_0x9b54('0x22')](_0x321f18)[_0x9b54('0x29')](function(_0x409388){_0x2cb3ea[_0x9b54('0x22')]=_0x409388;if(_0x4fa54b[_0x9b54('0x33')][_0x9b54('0x40')]){_0x1090b3[_0x9b54('0x41')]=[{'all':!![]}];}return db[_0x9b54('0x30')][_0x9b54('0x42')](_0x1090b3);})[_0x9b54('0x29')](function(_0x137dfc){_0x2cb3ea['rows']=_0x137dfc;return _0x2cb3ea;})[_0x9b54('0x29')](respondWithFilteredResult(_0x2404ab,_0x1090b3))[_0x9b54('0x43')](handleError(_0x2404ab,null));};exports[_0x9b54('0x44')]=function(_0xd56d6e,_0x575dfd){var _0x26dd53={'raw':![],'where':{'id':_0xd56d6e['params']['id']}},_0x3525d={};_0x3525d['model']=_[_0x9b54('0x45')](db[_0x9b54('0x30')][_0x9b54('0x46')]);_0x3525d[_0x9b54('0x33')]=_[_0x9b54('0x45')](_0xd56d6e[_0x9b54('0x33')]);_0x3525d[_0x9b54('0x3a')]=_[_0x9b54('0x34')](_0x3525d[_0x9b54('0x35')],_0x3525d[_0x9b54('0x33')]);_0x26dd53[_0x9b54('0x36')]=_[_0x9b54('0x34')](_0x3525d[_0x9b54('0x35')],qs[_0x9b54('0x37')](_0xd56d6e[_0x9b54('0x33')][_0x9b54('0x37')]));_0x26dd53[_0x9b54('0x36')]=_0x26dd53[_0x9b54('0x36')][_0x9b54('0x38')]?_0x26dd53[_0x9b54('0x36')]:_0x3525d['model'];if(_0xd56d6e[_0x9b54('0x33')]['includeAll']){_0x26dd53[_0x9b54('0x41')]=[{'all':!![]}];}_0x26dd53=_[_0x9b54('0x3e')]({},_0x26dd53,_0xd56d6e[_0x9b54('0x3f')]);return db[_0x9b54('0x30')]['find'](_0x26dd53)[_0x9b54('0x29')](handleEntityNotFound(_0x575dfd,null))[_0x9b54('0x29')](respondWithResult(_0x575dfd,null))[_0x9b54('0x43')](handleError(_0x575dfd,null));};exports[_0x9b54('0x47')]=function(_0x5b8992,_0xdbc9d4){return db[_0x9b54('0x30')][_0x9b54('0x47')](_0x5b8992[_0x9b54('0x48')],{})[_0x9b54('0x29')](respondWithResult(_0xdbc9d4,0xc9))[_0x9b54('0x43')](handleError(_0xdbc9d4,null));};exports['update']=function(_0x212af6,_0x192d37){if(_0x212af6[_0x9b54('0x48')]['id']){delete _0x212af6[_0x9b54('0x48')]['id'];}return db[_0x9b54('0x30')]['find']({'where':{'id':_0x212af6['params']['id']}})['then'](handleEntityNotFound(_0x192d37,null))['then'](saveUpdates(_0x212af6[_0x9b54('0x48')],null))[_0x9b54('0x29')](respondWithResult(_0x192d37,null))['catch'](handleError(_0x192d37,null));};exports[_0x9b54('0x2a')]=function(_0x4fc7bc,_0xa6b9e9){return db[_0x9b54('0x30')][_0x9b54('0x49')]({'where':{'id':_0x4fc7bc[_0x9b54('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa6b9e9,null))['then'](removeEntity(_0xa6b9e9,null))[_0x9b54('0x43')](handleError(_0xa6b9e9,null));};exports[_0x9b54('0x4b')]=function(_0x647242,_0x420e83,_0x5df240){var _0x2e45f1={};var _0x41d259={};var _0x247b52;var _0x368b30;return db['VtigerConfiguration'][_0x9b54('0x4c')]({'where':{'id':_0x647242[_0x9b54('0x4a')]['id']}})[_0x9b54('0x29')](handleEntityNotFound(_0x420e83,null))[_0x9b54('0x29')](function(_0x4558db){if(_0x4558db){_0x247b52=_0x4558db;_0x41d259[_0x9b54('0x35')]=_[_0x9b54('0x45')](db[_0x9b54('0x4d')][_0x9b54('0x46')]);_0x41d259[_0x9b54('0x33')]=_[_0x9b54('0x45')](_0x647242[_0x9b54('0x33')]);_0x41d259[_0x9b54('0x3a')]=_[_0x9b54('0x34')](_0x41d259[_0x9b54('0x35')],_0x41d259[_0x9b54('0x33')]);_0x2e45f1['attributes']=_[_0x9b54('0x34')](_0x41d259[_0x9b54('0x35')],qs[_0x9b54('0x37')](_0x647242[_0x9b54('0x33')]['fields']));_0x2e45f1['attributes']=_0x2e45f1[_0x9b54('0x36')]['length']?_0x2e45f1[_0x9b54('0x36')]:_0x41d259['model'];_0x2e45f1[_0x9b54('0x4e')]=qs[_0x9b54('0x39')](_0x647242[_0x9b54('0x33')]['sort']);_0x2e45f1[_0x9b54('0x3d')]=qs['filters'](_[_0x9b54('0x3b')](_0x647242[_0x9b54('0x33')],_0x41d259[_0x9b54('0x3a')]));if(_0x647242['query'][_0x9b54('0x3c')]){_0x2e45f1['where']=_[_0x9b54('0x3e')](_0x2e45f1[_0x9b54('0x3d')],{'$or':_[_0x9b54('0x2f')](_0x2e45f1['attributes'],function(_0x585ea4){var _0x4b4c33={};_0x4b4c33[_0x585ea4]={'$like':'%'+_0x647242[_0x9b54('0x33')]['filter']+'%'};return _0x4b4c33;})});}_0x2e45f1=_[_0x9b54('0x3e')]({},_0x2e45f1,_0x647242[_0x9b54('0x3f')]);return _0x247b52[_0x9b54('0x4b')](_0x2e45f1);}})[_0x9b54('0x29')](function(_0x67aded){if(_0x67aded){_0x368b30=_0x67aded[_0x9b54('0x38')];if(!_0x647242[_0x9b54('0x33')][_0x9b54('0x4f')](_0x9b54('0x50'))){_0x2e45f1[_0x9b54('0x21')]=qs[_0x9b54('0x21')](_0x647242[_0x9b54('0x33')][_0x9b54('0x21')]);_0x2e45f1[_0x9b54('0x1f')]=qs[_0x9b54('0x1f')](_0x647242['query'][_0x9b54('0x1f')]);}return _0x247b52[_0x9b54('0x4b')](_0x2e45f1);}})[_0x9b54('0x29')](function(_0xdbdde7){if(_0xdbdde7){return _0xdbdde7?{'count':_0x368b30,'rows':_0xdbdde7}:null;}})[_0x9b54('0x29')](respondWithResult(_0x420e83,null))[_0x9b54('0x43')](handleError(_0x420e83,null));};exports[_0x9b54('0x51')]=function(_0x5f178e,_0xce9125,_0x43526a){var _0x120ea3={};var _0x2aa357={};var _0x53dcd7;var _0x443496;return db['VtigerConfiguration'][_0x9b54('0x4c')]({'where':{'id':_0x5f178e['params']['id']}})[_0x9b54('0x29')](handleEntityNotFound(_0xce9125,null))['then'](function(_0x49ac9c){if(_0x49ac9c){_0x53dcd7=_0x49ac9c;_0x2aa357['model']=_['keys'](db[_0x9b54('0x4d')]['rawAttributes']);_0x2aa357[_0x9b54('0x33')]=_[_0x9b54('0x45')](_0x5f178e[_0x9b54('0x33')]);_0x2aa357[_0x9b54('0x3a')]=_[_0x9b54('0x34')](_0x2aa357[_0x9b54('0x35')],_0x2aa357[_0x9b54('0x33')]);_0x120ea3['attributes']=_[_0x9b54('0x34')](_0x2aa357['model'],qs[_0x9b54('0x37')](_0x5f178e[_0x9b54('0x33')][_0x9b54('0x37')]));_0x120ea3['attributes']=_0x120ea3[_0x9b54('0x36')][_0x9b54('0x38')]?_0x120ea3[_0x9b54('0x36')]:_0x2aa357[_0x9b54('0x35')];_0x120ea3[_0x9b54('0x4e')]=qs[_0x9b54('0x39')](_0x5f178e[_0x9b54('0x33')][_0x9b54('0x39')]);_0x120ea3[_0x9b54('0x3d')]=qs['filters'](_[_0x9b54('0x3b')](_0x5f178e[_0x9b54('0x33')],_0x2aa357[_0x9b54('0x3a')]));if(_0x5f178e[_0x9b54('0x33')][_0x9b54('0x3c')]){_0x120ea3[_0x9b54('0x3d')]=_[_0x9b54('0x3e')](_0x120ea3[_0x9b54('0x3d')],{'$or':_[_0x9b54('0x2f')](_0x120ea3['attributes'],function(_0xbd76b9){var _0x201ecd={};_0x201ecd[_0xbd76b9]={'$like':'%'+_0x5f178e[_0x9b54('0x33')][_0x9b54('0x3c')]+'%'};return _0x201ecd;})});}_0x120ea3=_[_0x9b54('0x3e')]({},_0x120ea3,_0x5f178e[_0x9b54('0x3f')]);return _0x53dcd7[_0x9b54('0x51')](_0x120ea3);}})[_0x9b54('0x29')](function(_0x375e86){if(_0x375e86){_0x443496=_0x375e86[_0x9b54('0x38')];if(!_0x5f178e[_0x9b54('0x33')]['hasOwnProperty']('nolimit')){_0x120ea3[_0x9b54('0x21')]=qs['limit'](_0x5f178e[_0x9b54('0x33')]['limit']);_0x120ea3[_0x9b54('0x1f')]=qs[_0x9b54('0x1f')](_0x5f178e[_0x9b54('0x33')][_0x9b54('0x1f')]);}return _0x53dcd7[_0x9b54('0x51')](_0x120ea3);}})[_0x9b54('0x29')](function(_0x5358b7){if(_0x5358b7){return _0x5358b7?{'count':_0x443496,'rows':_0x5358b7}:null;}})[_0x9b54('0x29')](respondWithResult(_0xce9125,null))[_0x9b54('0x43')](handleError(_0xce9125,null));};exports[_0x9b54('0x52')]=function(_0x5c4110,_0xa7aaae,_0x1b6384){var _0x49b2e={};var _0x36335b={};var _0x4b5151;var _0x4cfcb1;return db[_0x9b54('0x30')][_0x9b54('0x4c')]({'where':{'id':_0x5c4110[_0x9b54('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa7aaae,null))['then'](function(_0x9d7d2e){if(_0x9d7d2e){_0x4b5151=_0x9d7d2e;_0x36335b['model']=_[_0x9b54('0x45')](db['VtigerField']['rawAttributes']);_0x36335b[_0x9b54('0x33')]=_['keys'](_0x5c4110[_0x9b54('0x33')]);_0x36335b[_0x9b54('0x3a')]=_[_0x9b54('0x34')](_0x36335b[_0x9b54('0x35')],_0x36335b[_0x9b54('0x33')]);_0x49b2e[_0x9b54('0x36')]=_['intersection'](_0x36335b[_0x9b54('0x35')],qs[_0x9b54('0x37')](_0x5c4110[_0x9b54('0x33')][_0x9b54('0x37')]));_0x49b2e[_0x9b54('0x36')]=_0x49b2e[_0x9b54('0x36')]['length']?_0x49b2e[_0x9b54('0x36')]:_0x36335b[_0x9b54('0x35')];_0x49b2e[_0x9b54('0x4e')]=qs['sort'](_0x5c4110[_0x9b54('0x33')]['sort']);_0x49b2e[_0x9b54('0x3d')]=qs[_0x9b54('0x3a')](_['pick'](_0x5c4110[_0x9b54('0x33')],_0x36335b[_0x9b54('0x3a')]));if(_0x5c4110[_0x9b54('0x33')]['filter']){_0x49b2e[_0x9b54('0x3d')]=_['merge'](_0x49b2e[_0x9b54('0x3d')],{'$or':_[_0x9b54('0x2f')](_0x49b2e[_0x9b54('0x36')],function(_0x285291){var _0x109f7e={};_0x109f7e[_0x285291]={'$like':'%'+_0x5c4110[_0x9b54('0x33')][_0x9b54('0x3c')]+'%'};return _0x109f7e;})});}_0x49b2e=_[_0x9b54('0x3e')]({},_0x49b2e,_0x5c4110['options']);return _0x4b5151[_0x9b54('0x52')](_0x49b2e);}})[_0x9b54('0x29')](function(_0x5cc267){if(_0x5cc267){_0x4cfcb1=_0x5cc267['length'];if(!_0x5c4110[_0x9b54('0x33')]['hasOwnProperty'](_0x9b54('0x50'))){_0x49b2e[_0x9b54('0x21')]=qs[_0x9b54('0x21')](_0x5c4110[_0x9b54('0x33')][_0x9b54('0x21')]);_0x49b2e[_0x9b54('0x1f')]=qs['offset'](_0x5c4110['query']['offset']);}return _0x4b5151['getDescriptions'](_0x49b2e);}})[_0x9b54('0x29')](function(_0x5cae60){if(_0x5cae60){return _0x5cae60?{'count':_0x4cfcb1,'rows':_0x5cae60}:null;}})[_0x9b54('0x29')](respondWithResult(_0xa7aaae,null))[_0x9b54('0x43')](handleError(_0xa7aaae,null));}; \ No newline at end of file +var _0x8171=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getFields','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','index','map','rawAttributes','type','key'];(function(_0x45dd86,_0x5439ed){var _0x2d4d2d=function(_0x202433){while(--_0x202433){_0x45dd86['push'](_0x45dd86['shift']());}};_0x2d4d2d(++_0x5439ed);}(_0x8171,0x1ad));var _0x1817=function(_0x553cac,_0x4dae87){_0x553cac=_0x553cac-0x0;var _0x4a9949=_0x8171[_0x553cac];return _0x4a9949;};'use strict';var emlformat=require(_0x1817('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1817('0x1'));var jsonpatch=require(_0x1817('0x2'));var rp=require(_0x1817('0x3'));var moment=require(_0x1817('0x4'));var BPromise=require(_0x1817('0x5'));var Mustache=require('mustache');var util=require(_0x1817('0x6'));var path=require(_0x1817('0x7'));var sox=require(_0x1817('0x8'));var csv=require('to-csv');var ejs=require(_0x1817('0x9'));var fs=require('fs');var fs_extra=require(_0x1817('0xa'));var _=require(_0x1817('0xb'));var squel=require(_0x1817('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1817('0xd'));var toCsv=require(_0x1817('0xe'));var querystring=require(_0x1817('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1817('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1817('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1817('0x12'))(_0x1817('0x13'));var utils=require('../../config/utils');var config=require(_0x1817('0x14'));var licenseUtil=require(_0x1817('0x15'));var db=require(_0x1817('0x16'))['db'];function respondWithStatusCode(_0x2ef4ba,_0x474d10){_0x474d10=_0x474d10||0xcc;return function(_0x56234e){if(_0x56234e){return _0x2ef4ba[_0x1817('0x17')](_0x474d10);}return _0x2ef4ba[_0x1817('0x18')](_0x474d10)[_0x1817('0x19')]();};}function respondWithResult(_0x2c0413,_0x1ccf37){_0x1ccf37=_0x1ccf37||0xc8;return function(_0xb53a54){if(_0xb53a54){return _0x2c0413[_0x1817('0x18')](_0x1ccf37)[_0x1817('0x1a')](_0xb53a54);}};}function respondWithFilteredResult(_0x504f76,_0x285137){return function(_0x42b471){if(_0x42b471){var _0x424d55=typeof _0x285137[_0x1817('0x1b')]==='undefined'&&typeof _0x285137['limit']===_0x1817('0x1c');var _0x184c37=_0x42b471[_0x1817('0x1d')];var _0xba9518=_0x424d55?0x0:_0x285137[_0x1817('0x1b')];var _0x5db7f5=_0x424d55?_0x42b471[_0x1817('0x1d')]:_0x285137[_0x1817('0x1b')]+_0x285137[_0x1817('0x1e')];var _0x5f25c5;if(_0x5db7f5>=_0x184c37){_0x5db7f5=_0x184c37;_0x5f25c5=0xc8;}else{_0x5f25c5=0xce;}_0x504f76['status'](_0x5f25c5);return _0x504f76[_0x1817('0x1f')](_0x1817('0x20'),_0xba9518+'-'+_0x5db7f5+'/'+_0x184c37)[_0x1817('0x1a')](_0x42b471);}return null;};}function patchUpdates(_0x52b253){return function(_0x53058a){try{jsonpatch[_0x1817('0x21')](_0x53058a,_0x52b253,!![]);}catch(_0x1be7c5){return BPromise['reject'](_0x1be7c5);}return _0x53058a[_0x1817('0x22')]();};}function saveUpdates(_0x558cd3,_0x1b91aa){return function(_0x2ba9d1){if(_0x2ba9d1){return _0x2ba9d1[_0x1817('0x23')](_0x558cd3)['then'](function(_0x462e34){return _0x462e34;});}return null;};}function removeEntity(_0x449b09,_0x453135){return function(_0x3a7173){if(_0x3a7173){return _0x3a7173['destroy']()[_0x1817('0x24')](function(){_0x449b09[_0x1817('0x18')](0xcc)[_0x1817('0x19')]();});}};}function handleEntityNotFound(_0x2e84dc,_0xb6a4f9){return function(_0x27ce1e){if(!_0x27ce1e){_0x2e84dc[_0x1817('0x17')](0x194);}return _0x27ce1e;};}function handleError(_0x5ac974,_0x288e01){_0x288e01=_0x288e01||0x1f4;return function(_0x5345f2){logger[_0x1817('0x25')](_0x5345f2[_0x1817('0x26')]);if(_0x5345f2[_0x1817('0x27')]){delete _0x5345f2[_0x1817('0x27')];}_0x5ac974[_0x1817('0x18')](_0x288e01)['send'](_0x5345f2);};}exports[_0x1817('0x28')]=function(_0xda17da,_0x257ff6){var _0x2775f5={},_0x3a4a60={},_0x2faace={'count':0x0,'rows':[]};var _0x89d688=_[_0x1817('0x29')](db['VtigerConfiguration'][_0x1817('0x2a')],function(_0x5a7385){return{'name':_0x5a7385['fieldName'],'type':_0x5a7385[_0x1817('0x2b')][_0x1817('0x2c')]};});_0x3a4a60[_0x1817('0x2d')]=_[_0x1817('0x29')](_0x89d688,_0x1817('0x27'));_0x3a4a60[_0x1817('0x2e')]=_[_0x1817('0x2f')](_0xda17da[_0x1817('0x2e')]);_0x3a4a60[_0x1817('0x30')]=_[_0x1817('0x31')](_0x3a4a60[_0x1817('0x2d')],_0x3a4a60[_0x1817('0x2e')]);_0x2775f5['attributes']=_['intersection'](_0x3a4a60['model'],qs[_0x1817('0x32')](_0xda17da[_0x1817('0x2e')]['fields']));_0x2775f5[_0x1817('0x33')]=_0x2775f5['attributes'][_0x1817('0x34')]?_0x2775f5[_0x1817('0x33')]:_0x3a4a60[_0x1817('0x2d')];if(!_0xda17da['query'][_0x1817('0x35')](_0x1817('0x36'))){_0x2775f5[_0x1817('0x1e')]=qs['limit'](_0xda17da[_0x1817('0x2e')][_0x1817('0x1e')]);_0x2775f5[_0x1817('0x1b')]=qs[_0x1817('0x1b')](_0xda17da['query']['offset']);}_0x2775f5[_0x1817('0x37')]=qs[_0x1817('0x38')](_0xda17da[_0x1817('0x2e')][_0x1817('0x38')]);_0x2775f5[_0x1817('0x39')]=qs[_0x1817('0x30')](_[_0x1817('0x3a')](_0xda17da[_0x1817('0x2e')],_0x3a4a60[_0x1817('0x30')]),_0x89d688);if(_0xda17da['query'][_0x1817('0x3b')]){_0x2775f5[_0x1817('0x39')]=_[_0x1817('0x3c')](_0x2775f5[_0x1817('0x39')],{'$or':_[_0x1817('0x29')](_0x89d688,function(_0x5cf4e6){if(_0x5cf4e6[_0x1817('0x2b')]!==_0x1817('0x3d')){var _0x408df8={};_0x408df8[_0x5cf4e6['name']]={'$like':'%'+_0xda17da[_0x1817('0x2e')][_0x1817('0x3b')]+'%'};return _0x408df8;}})});}_0x2775f5=_[_0x1817('0x3c')]({},_0x2775f5,_0xda17da[_0x1817('0x3e')]);var _0x204a04={'where':_0x2775f5[_0x1817('0x39')]};return db[_0x1817('0x3f')][_0x1817('0x1d')](_0x204a04)[_0x1817('0x24')](function(_0x4fd2be){_0x2faace['count']=_0x4fd2be;if(_0xda17da['query'][_0x1817('0x40')]){_0x2775f5[_0x1817('0x41')]=[{'all':!![]}];}return db[_0x1817('0x3f')][_0x1817('0x42')](_0x2775f5);})[_0x1817('0x24')](function(_0x536d4c){_0x2faace[_0x1817('0x43')]=_0x536d4c;return _0x2faace;})['then'](respondWithFilteredResult(_0x257ff6,_0x2775f5))[_0x1817('0x44')](handleError(_0x257ff6,null));};exports[_0x1817('0x45')]=function(_0xa164b9,_0x4f6043){var _0x62d74c={'raw':![],'where':{'id':_0xa164b9[_0x1817('0x46')]['id']}},_0x333f69={};_0x333f69[_0x1817('0x2d')]=_['keys'](db[_0x1817('0x3f')][_0x1817('0x2a')]);_0x333f69['query']=_['keys'](_0xa164b9['query']);_0x333f69[_0x1817('0x30')]=_['intersection'](_0x333f69[_0x1817('0x2d')],_0x333f69['query']);_0x62d74c[_0x1817('0x33')]=_[_0x1817('0x31')](_0x333f69[_0x1817('0x2d')],qs['fields'](_0xa164b9['query'][_0x1817('0x32')]));_0x62d74c[_0x1817('0x33')]=_0x62d74c['attributes']['length']?_0x62d74c[_0x1817('0x33')]:_0x333f69[_0x1817('0x2d')];if(_0xa164b9[_0x1817('0x2e')][_0x1817('0x40')]){_0x62d74c[_0x1817('0x41')]=[{'all':!![]}];}_0x62d74c=_[_0x1817('0x3c')]({},_0x62d74c,_0xa164b9['options']);return db['VtigerConfiguration'][_0x1817('0x47')](_0x62d74c)[_0x1817('0x24')](handleEntityNotFound(_0x4f6043,null))[_0x1817('0x24')](respondWithResult(_0x4f6043,null))[_0x1817('0x44')](handleError(_0x4f6043,null));};exports[_0x1817('0x48')]=function(_0x3cb274,_0x191e10){return db[_0x1817('0x3f')]['create'](_0x3cb274[_0x1817('0x49')],{})[_0x1817('0x24')](respondWithResult(_0x191e10,0xc9))[_0x1817('0x44')](handleError(_0x191e10,null));};exports[_0x1817('0x23')]=function(_0x4375af,_0x18ca84){if(_0x4375af[_0x1817('0x49')]['id']){delete _0x4375af['body']['id'];}return db[_0x1817('0x3f')][_0x1817('0x47')]({'where':{'id':_0x4375af[_0x1817('0x46')]['id']}})[_0x1817('0x24')](handleEntityNotFound(_0x18ca84,null))['then'](saveUpdates(_0x4375af['body'],null))[_0x1817('0x24')](respondWithResult(_0x18ca84,null))[_0x1817('0x44')](handleError(_0x18ca84,null));};exports[_0x1817('0x4a')]=function(_0x49de32,_0x2a6b51){return db[_0x1817('0x3f')][_0x1817('0x47')]({'where':{'id':_0x49de32[_0x1817('0x46')]['id']}})[_0x1817('0x24')](handleEntityNotFound(_0x2a6b51,null))[_0x1817('0x24')](removeEntity(_0x2a6b51,null))[_0x1817('0x44')](handleError(_0x2a6b51,null));};exports[_0x1817('0x4b')]=function(_0x3f204c,_0x27f728,_0x3cc2b2){var _0x24c9c8={};var _0x2fae3a={};var _0xdfe7bf;var _0x3f22b9;return db[_0x1817('0x3f')]['findOne']({'where':{'id':_0x3f204c['params']['id']}})[_0x1817('0x24')](handleEntityNotFound(_0x27f728,null))['then'](function(_0x2601f4){if(_0x2601f4){_0xdfe7bf=_0x2601f4;_0x2fae3a['model']=_['keys'](db['VtigerField']['rawAttributes']);_0x2fae3a[_0x1817('0x2e')]=_[_0x1817('0x2f')](_0x3f204c['query']);_0x2fae3a[_0x1817('0x30')]=_['intersection'](_0x2fae3a['model'],_0x2fae3a[_0x1817('0x2e')]);_0x24c9c8[_0x1817('0x33')]=_[_0x1817('0x31')](_0x2fae3a[_0x1817('0x2d')],qs[_0x1817('0x32')](_0x3f204c[_0x1817('0x2e')]['fields']));_0x24c9c8[_0x1817('0x33')]=_0x24c9c8[_0x1817('0x33')][_0x1817('0x34')]?_0x24c9c8[_0x1817('0x33')]:_0x2fae3a[_0x1817('0x2d')];_0x24c9c8[_0x1817('0x37')]=qs['sort'](_0x3f204c[_0x1817('0x2e')][_0x1817('0x38')]);_0x24c9c8[_0x1817('0x39')]=qs[_0x1817('0x30')](_[_0x1817('0x3a')](_0x3f204c[_0x1817('0x2e')],_0x2fae3a[_0x1817('0x30')]));if(_0x3f204c[_0x1817('0x2e')][_0x1817('0x3b')]){_0x24c9c8[_0x1817('0x39')]=_[_0x1817('0x3c')](_0x24c9c8[_0x1817('0x39')],{'$or':_[_0x1817('0x29')](_0x24c9c8[_0x1817('0x33')],function(_0x4af219){var _0x425634={};_0x425634[_0x4af219]={'$like':'%'+_0x3f204c['query'][_0x1817('0x3b')]+'%'};return _0x425634;})});}_0x24c9c8=_['merge']({},_0x24c9c8,_0x3f204c[_0x1817('0x3e')]);return _0xdfe7bf[_0x1817('0x4b')](_0x24c9c8);}})[_0x1817('0x24')](function(_0x274ab3){if(_0x274ab3){_0x3f22b9=_0x274ab3[_0x1817('0x34')];if(!_0x3f204c[_0x1817('0x2e')][_0x1817('0x35')](_0x1817('0x36'))){_0x24c9c8[_0x1817('0x1e')]=qs[_0x1817('0x1e')](_0x3f204c[_0x1817('0x2e')][_0x1817('0x1e')]);_0x24c9c8[_0x1817('0x1b')]=qs[_0x1817('0x1b')](_0x3f204c[_0x1817('0x2e')][_0x1817('0x1b')]);}return _0xdfe7bf[_0x1817('0x4b')](_0x24c9c8);}})[_0x1817('0x24')](function(_0x36f352){if(_0x36f352){return _0x36f352?{'count':_0x3f22b9,'rows':_0x36f352}:null;}})['then'](respondWithResult(_0x27f728,null))[_0x1817('0x44')](handleError(_0x27f728,null));};exports[_0x1817('0x4c')]=function(_0x2cfb77,_0x4e8b74,_0x2fe889){var _0x1c6a74={};var _0x1b4195={};var _0x489eef;var _0x24da3d;return db[_0x1817('0x3f')][_0x1817('0x4d')]({'where':{'id':_0x2cfb77[_0x1817('0x46')]['id']}})[_0x1817('0x24')](handleEntityNotFound(_0x4e8b74,null))[_0x1817('0x24')](function(_0x468897){if(_0x468897){_0x489eef=_0x468897;_0x1b4195[_0x1817('0x2d')]=_[_0x1817('0x2f')](db['VtigerField'][_0x1817('0x2a')]);_0x1b4195[_0x1817('0x2e')]=_[_0x1817('0x2f')](_0x2cfb77[_0x1817('0x2e')]);_0x1b4195['filters']=_[_0x1817('0x31')](_0x1b4195[_0x1817('0x2d')],_0x1b4195['query']);_0x1c6a74[_0x1817('0x33')]=_[_0x1817('0x31')](_0x1b4195[_0x1817('0x2d')],qs['fields'](_0x2cfb77['query'][_0x1817('0x32')]));_0x1c6a74['attributes']=_0x1c6a74[_0x1817('0x33')][_0x1817('0x34')]?_0x1c6a74['attributes']:_0x1b4195['model'];_0x1c6a74[_0x1817('0x37')]=qs[_0x1817('0x38')](_0x2cfb77[_0x1817('0x2e')]['sort']);_0x1c6a74[_0x1817('0x39')]=qs[_0x1817('0x30')](_['pick'](_0x2cfb77[_0x1817('0x2e')],_0x1b4195['filters']));if(_0x2cfb77['query'][_0x1817('0x3b')]){_0x1c6a74['where']=_[_0x1817('0x3c')](_0x1c6a74['where'],{'$or':_['map'](_0x1c6a74[_0x1817('0x33')],function(_0x21bcea){var _0x2b8392={};_0x2b8392[_0x21bcea]={'$like':'%'+_0x2cfb77[_0x1817('0x2e')][_0x1817('0x3b')]+'%'};return _0x2b8392;})});}_0x1c6a74=_[_0x1817('0x3c')]({},_0x1c6a74,_0x2cfb77[_0x1817('0x3e')]);return _0x489eef[_0x1817('0x4c')](_0x1c6a74);}})['then'](function(_0x3608b5){if(_0x3608b5){_0x24da3d=_0x3608b5[_0x1817('0x34')];if(!_0x2cfb77[_0x1817('0x2e')][_0x1817('0x35')]('nolimit')){_0x1c6a74[_0x1817('0x1e')]=qs[_0x1817('0x1e')](_0x2cfb77['query']['limit']);_0x1c6a74[_0x1817('0x1b')]=qs[_0x1817('0x1b')](_0x2cfb77[_0x1817('0x2e')]['offset']);}return _0x489eef[_0x1817('0x4c')](_0x1c6a74);}})[_0x1817('0x24')](function(_0x47607b){if(_0x47607b){return _0x47607b?{'count':_0x24da3d,'rows':_0x47607b}:null;}})['then'](respondWithResult(_0x4e8b74,null))[_0x1817('0x44')](handleError(_0x4e8b74,null));};exports['getDescriptions']=function(_0x5e500c,_0x371e2f,_0x5ec2a2){var _0x2a0f7a={};var _0x181962={};var _0x32b317;var _0x465207;return db[_0x1817('0x3f')][_0x1817('0x4d')]({'where':{'id':_0x5e500c[_0x1817('0x46')]['id']}})[_0x1817('0x24')](handleEntityNotFound(_0x371e2f,null))[_0x1817('0x24')](function(_0x4fb0ce){if(_0x4fb0ce){_0x32b317=_0x4fb0ce;_0x181962['model']=_['keys'](db['VtigerField'][_0x1817('0x2a')]);_0x181962['query']=_[_0x1817('0x2f')](_0x5e500c[_0x1817('0x2e')]);_0x181962[_0x1817('0x30')]=_[_0x1817('0x31')](_0x181962[_0x1817('0x2d')],_0x181962[_0x1817('0x2e')]);_0x2a0f7a['attributes']=_[_0x1817('0x31')](_0x181962[_0x1817('0x2d')],qs[_0x1817('0x32')](_0x5e500c[_0x1817('0x2e')][_0x1817('0x32')]));_0x2a0f7a[_0x1817('0x33')]=_0x2a0f7a[_0x1817('0x33')][_0x1817('0x34')]?_0x2a0f7a['attributes']:_0x181962[_0x1817('0x2d')];_0x2a0f7a[_0x1817('0x37')]=qs[_0x1817('0x38')](_0x5e500c[_0x1817('0x2e')][_0x1817('0x38')]);_0x2a0f7a[_0x1817('0x39')]=qs[_0x1817('0x30')](_[_0x1817('0x3a')](_0x5e500c[_0x1817('0x2e')],_0x181962[_0x1817('0x30')]));if(_0x5e500c[_0x1817('0x2e')][_0x1817('0x3b')]){_0x2a0f7a[_0x1817('0x39')]=_[_0x1817('0x3c')](_0x2a0f7a[_0x1817('0x39')],{'$or':_['map'](_0x2a0f7a[_0x1817('0x33')],function(_0x399885){var _0x5ca7bf={};_0x5ca7bf[_0x399885]={'$like':'%'+_0x5e500c[_0x1817('0x2e')]['filter']+'%'};return _0x5ca7bf;})});}_0x2a0f7a=_['merge']({},_0x2a0f7a,_0x5e500c[_0x1817('0x3e')]);return _0x32b317[_0x1817('0x4e')](_0x2a0f7a);}})[_0x1817('0x24')](function(_0x3743a1){if(_0x3743a1){_0x465207=_0x3743a1[_0x1817('0x34')];if(!_0x5e500c[_0x1817('0x2e')][_0x1817('0x35')](_0x1817('0x36'))){_0x2a0f7a['limit']=qs[_0x1817('0x1e')](_0x5e500c[_0x1817('0x2e')][_0x1817('0x1e')]);_0x2a0f7a[_0x1817('0x1b')]=qs[_0x1817('0x1b')](_0x5e500c['query']['offset']);}return _0x32b317[_0x1817('0x4e')](_0x2a0f7a);}})['then'](function(_0x10a606){if(_0x10a606){return _0x10a606?{'count':_0x465207,'rows':_0x10a606}:null;}})[_0x1817('0x24')](respondWithResult(_0x371e2f,null))['catch'](handleError(_0x371e2f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 95c875e..238e5bb 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 _0xa666=['request-promise','path','../../config/environment','define','util','../../config/logger','api','moment','bluebird'];(function(_0x5925c3,_0x5d37ca){var _0x2fc403=function(_0x41be22){while(--_0x41be22){_0x5925c3['push'](_0x5925c3['shift']());}};_0x2fc403(++_0x5d37ca);}(_0xa666,0x148));var _0x6a66=function(_0x405ee8,_0x3122c8){_0x405ee8=_0x405ee8-0x0;var _0x3fbe8b=_0xa666[_0x405ee8];return _0x3fbe8b;};'use strict';var _=require('lodash');var util=require(_0x6a66('0x0'));var logger=require(_0x6a66('0x1'))(_0x6a66('0x2'));var moment=require(_0x6a66('0x3'));var BPromise=require(_0x6a66('0x4'));var rp=require(_0x6a66('0x5'));var fs=require('fs');var path=require(_0x6a66('0x6'));var rimraf=require('rimraf');var config=require(_0x6a66('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x1da352,_0xbba66b){return _0x1da352[_0x6a66('0x8')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5714=['path','../../config/environment','exports','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5714,0x127));var _0x4571=function(_0x3154d4,_0x5e1792){_0x3154d4=_0x3154d4-0x0;var _0x2762eb=_0x5714[_0x3154d4];return _0x2762eb;};'use strict';var _=require(_0x4571('0x0'));var util=require('util');var logger=require(_0x4571('0x1'))(_0x4571('0x2'));var moment=require(_0x4571('0x3'));var BPromise=require(_0x4571('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4571('0x5'));var rimraf=require('rimraf');var config=require(_0x4571('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x4571('0x7')]=function(_0x279c8,_0x56f60c){return _0x279c8['define'](_0x4571('0x8'),attributes,{'tableName':_0x4571('0x9'),'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 0629c0d..06fc0b7 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 _0xc369=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x53afa6,_0x59e786){var _0x51f86a=function(_0x368385){while(--_0x368385){_0x53afa6['push'](_0x53afa6['shift']());}};_0x51f86a(++_0x59e786);}(_0xc369,0x1e7));var _0x9c36=function(_0x263abf,_0x3d1481){_0x263abf=_0x263abf-0x0;var _0x24dff2=_0xc369[_0x263abf];return _0x24dff2;};'use strict';var _=require(_0x9c36('0x0'));var util=require(_0x9c36('0x1'));var moment=require(_0x9c36('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c36('0x3'));var fs=require('fs');var Redis=require(_0x9c36('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c36('0x5'));var logger=require('../../config/logger')(_0x9c36('0x6'));var config=require(_0x9c36('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9c36('0x8')][_0x9c36('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3310bb,_0xc04b1e,_0x323f0c){return new BPromise(function(_0x2704c2,_0x4160a4){return client[_0x9c36('0xa')](_0x3310bb,_0x323f0c)[_0x9c36('0xb')](function(_0xe4383d){logger['info'](_0x9c36('0xc'),_0xc04b1e,_0x9c36('0xd'));logger[_0x9c36('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0xc04b1e,_0x9c36('0xd'),JSON[_0x9c36('0xf')](_0xe4383d));if(_0xe4383d[_0x9c36('0x10')]){if(_0xe4383d[_0x9c36('0x10')][_0x9c36('0x11')]===0x1f4){logger[_0x9c36('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0xc04b1e,_0xe4383d[_0x9c36('0x10')][_0x9c36('0x12')]);return _0x4160a4(_0xe4383d['error'][_0x9c36('0x12')]);}logger[_0x9c36('0x10')](_0x9c36('0xc'),_0xc04b1e,_0xe4383d[_0x9c36('0x10')][_0x9c36('0x12')]);return _0x2704c2(_0xe4383d[_0x9c36('0x10')][_0x9c36('0x12')]);}else{logger[_0x9c36('0x13')](_0x9c36('0xc'),_0xc04b1e,'request\x20sent');_0x2704c2(_0xe4383d[_0x9c36('0x14')][_0x9c36('0x12')]);}})[_0x9c36('0x15')](function(_0x42d7b0){logger[_0x9c36('0x10')](_0x9c36('0xc'),_0xc04b1e,_0x42d7b0);_0x4160a4(_0x42d7b0);});});} \ No newline at end of file +var _0x2a45=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','VtigerConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','code','message','error','catch','util'];(function(_0x273a4a,_0xa9fc7c){var _0x3744ee=function(_0x32bb94){while(--_0x32bb94){_0x273a4a['push'](_0x273a4a['shift']());}};_0x3744ee(++_0xa9fc7c);}(_0x2a45,0x11f));var _0x52a4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x2a45[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require(_0x52a4('0x0'));var moment=require('moment');var BPromise=require(_0x52a4('0x1'));var rs=require(_0x52a4('0x2'));var fs=require('fs');var Redis=require(_0x52a4('0x3'));var db=require(_0x52a4('0x4'))['db'];var utils=require(_0x52a4('0x5'));var logger=require(_0x52a4('0x6'))(_0x52a4('0x7'));var config=require('../../config/environment');var jayson=require(_0x52a4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xae1117,_0x16298e,_0x3d09ae){return new BPromise(function(_0x4ca77f,_0x2c8fc9){return client['request'](_0xae1117,_0x3d09ae)['then'](function(_0x1e18c4){logger[_0x52a4('0x9')](_0x52a4('0xa'),_0x16298e,'request\x20sent');logger[_0x52a4('0xb')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x16298e,_0x52a4('0xc'),JSON[_0x52a4('0xd')](_0x1e18c4));if(_0x1e18c4['error']){if(_0x1e18c4['error'][_0x52a4('0xe')]===0x1f4){logger['error'](_0x52a4('0xa'),_0x16298e,_0x1e18c4['error'][_0x52a4('0xf')]);return _0x2c8fc9(_0x1e18c4[_0x52a4('0x10')]['message']);}logger[_0x52a4('0x10')](_0x52a4('0xa'),_0x16298e,_0x1e18c4['error'][_0x52a4('0xf')]);return _0x4ca77f(_0x1e18c4[_0x52a4('0x10')][_0x52a4('0xf')]);}else{logger[_0x52a4('0x9')](_0x52a4('0xa'),_0x16298e,_0x52a4('0xc'));_0x4ca77f(_0x1e18c4['result'][_0x52a4('0xf')]);}})[_0x52a4('0x11')](function(_0x47e289){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x16298e,_0x47e289);_0x2c8fc9(_0x47e289);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 1373772..c41378e 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 _0x18ae=['isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','get'];(function(_0x46a8e2,_0x67340a){var _0x15555d=function(_0x42a331){while(--_0x42a331){_0x46a8e2['push'](_0x46a8e2['shift']());}};_0x15555d(++_0x67340a);}(_0x18ae,0x1a1));var _0xe18a=function(_0x4147ff,_0x154530){_0x4147ff=_0x4147ff-0x0;var _0x1e71e6=_0x18ae[_0x4147ff];return _0x1e71e6;};'use strict';var multer=require(_0xe18a('0x0'));var util=require(_0xe18a('0x1'));var path=require(_0xe18a('0x2'));var timeout=require('connect-timeout');var express=require(_0xe18a('0x3'));var router=express[_0xe18a('0x4')]();var fs_extra=require(_0xe18a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe18a('0x6'));var controller=require('./intVtigerField.controller');router[_0xe18a('0x7')]('/',auth[_0xe18a('0x8')](),controller[_0xe18a('0x9')]);router[_0xe18a('0x7')](_0xe18a('0xa'),auth[_0xe18a('0x8')](),controller[_0xe18a('0xb')]);router[_0xe18a('0xc')]('/',auth[_0xe18a('0x8')](),controller['create']);router[_0xe18a('0xd')](_0xe18a('0xa'),auth[_0xe18a('0x8')](),controller[_0xe18a('0xe')]);router['delete'](_0xe18a('0xa'),auth['isAuthenticated'](),controller[_0xe18a('0xf')]);module[_0xe18a('0x10')]=router; \ No newline at end of file +var _0x68f0=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','create','put','/:id','update','exports','multer','util','path','connect-timeout','express'];(function(_0x3df1c2,_0x1d32db){var _0x70d3e8=function(_0x314e20){while(--_0x314e20){_0x3df1c2['push'](_0x3df1c2['shift']());}};_0x70d3e8(++_0x1d32db);}(_0x68f0,0x1ab));var _0x068f=function(_0x4b6d57,_0xbb1dfe){_0x4b6d57=_0x4b6d57-0x0;var _0x7ddd94=_0x68f0[_0x4b6d57];return _0x7ddd94;};'use strict';var multer=require(_0x068f('0x0'));var util=require(_0x068f('0x1'));var path=require(_0x068f('0x2'));var timeout=require(_0x068f('0x3'));var express=require(_0x068f('0x4'));var router=express['Router']();var fs_extra=require(_0x068f('0x5'));var auth=require(_0x068f('0x6'));var interaction=require(_0x068f('0x7'));var config=require(_0x068f('0x8'));var controller=require(_0x068f('0x9'));router['get']('/',auth[_0x068f('0xa')](),controller[_0x068f('0xb')]);router[_0x068f('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x068f('0xa')](),controller[_0x068f('0xd')]);router[_0x068f('0xe')](_0x068f('0xf'),auth[_0x068f('0xa')](),controller[_0x068f('0x10')]);router['delete'](_0x068f('0xf'),auth[_0x068f('0xa')](),controller['destroy']);module[_0x068f('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 848a55d..2c172a0 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 _0xc4b4=['exports','string','customVariable','keyValue','picklist','STRING','variable','sequelize'];(function(_0x15e955,_0x1a54b2){var _0x1bf344=function(_0x2e0996){while(--_0x2e0996){_0x15e955['push'](_0x15e955['shift']());}};_0x1bf344(++_0x1a54b2);}(_0xc4b4,0xd7));var _0x4c4b=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xc4b4[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x4c4b('0x0'));module[_0x4c4b('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4c4b('0x2'),'variable',_0x4c4b('0x3'),_0x4c4b('0x4'),_0x4c4b('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4c4b('0x6')]},'key':{'type':Sequelize[_0x4c4b('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x4c4b('0x2'),_0x4c4b('0x7'),_0x4c4b('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4c4b('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe246=['variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xe246,0xb0));var _0x6e24=function(_0x20c1a4,_0x4435a3){_0x20c1a4=_0x20c1a4-0x0;var _0x45bfb6=_0xe246[_0x20c1a4];return _0x45bfb6;};'use strict';var Sequelize=require(_0x6e24('0x0'));module[_0x6e24('0x1')]={'type':{'type':Sequelize[_0x6e24('0x2')](_0x6e24('0x3'),_0x6e24('0x4'),_0x6e24('0x5'),'keyValue',_0x6e24('0x6')),'defaultValue':_0x6e24('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6e24('0x2')](_0x6e24('0x3'),_0x6e24('0x4'),_0x6e24('0x5'))},'keyContent':{'type':Sequelize[_0x6e24('0x7')]},'idField':{'type':Sequelize[_0x6e24('0x7')]},'nameField':{'type':Sequelize[_0x6e24('0x7')]},'customField':{'type':Sequelize[_0x6e24('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 486c200..40a25a5 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 _0xfed2=['name','index','VtigerField','rawAttributes','fieldName','key','map','query','keys','filters','model','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','intersection','create','body','update','find','params','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack'];(function(_0x3c7eef,_0x589a1d){var _0x132e8e=function(_0xb52bb){while(--_0xb52bb){_0x3c7eef['push'](_0x3c7eef['shift']());}};_0x132e8e(++_0x589a1d);}(_0xfed2,0x141));var _0x2fed=function(_0x1be1ac,_0x378236){_0x1be1ac=_0x1be1ac-0x0;var _0x379698=_0xfed2[_0x1be1ac];return _0x379698;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2fed('0x0'));var zipdir=require(_0x2fed('0x1'));var jsonpatch=require(_0x2fed('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2fed('0x3'));var util=require(_0x2fed('0x4'));var path=require(_0x2fed('0x5'));var sox=require(_0x2fed('0x6'));var csv=require(_0x2fed('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2fed('0x8'));var _=require(_0x2fed('0x9'));var squel=require(_0x2fed('0xa'));var crypto=require('crypto');var jsforce=require(_0x2fed('0xb'));var deskjs=require(_0x2fed('0xc'));var toCsv=require(_0x2fed('0x7'));var querystring=require(_0x2fed('0xd'));var Papa=require(_0x2fed('0xe'));var Redis=require(_0x2fed('0xf'));var authService=require(_0x2fed('0x10'));var qs=require(_0x2fed('0x11'));var as=require(_0x2fed('0x12'));var hardwareService=require(_0x2fed('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2fed('0x14'));var licenseUtil=require(_0x2fed('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x415d51,_0x15d123){_0x15d123=_0x15d123||0xcc;return function(_0x19bf43){if(_0x19bf43){return _0x415d51[_0x2fed('0x16')](_0x15d123);}return _0x415d51[_0x2fed('0x17')](_0x15d123)[_0x2fed('0x18')]();};}function respondWithResult(_0x503791,_0x1fba26){_0x1fba26=_0x1fba26||0xc8;return function(_0x3865e1){if(_0x3865e1){return _0x503791['status'](_0x1fba26)[_0x2fed('0x19')](_0x3865e1);}};}function respondWithFilteredResult(_0x30472a,_0x5e2c19){return function(_0x11c958){if(_0x11c958){var _0x435daf=typeof _0x5e2c19['offset']===_0x2fed('0x1a')&&typeof _0x5e2c19['limit']===_0x2fed('0x1a');var _0x442073=_0x11c958[_0x2fed('0x1b')];var _0xa3dfe2=_0x435daf?0x0:_0x5e2c19['offset'];var _0x324505=_0x435daf?_0x11c958['count']:_0x5e2c19[_0x2fed('0x1c')]+_0x5e2c19[_0x2fed('0x1d')];var _0x1b0b60;if(_0x324505>=_0x442073){_0x324505=_0x442073;_0x1b0b60=0xc8;}else{_0x1b0b60=0xce;}_0x30472a[_0x2fed('0x17')](_0x1b0b60);return _0x30472a[_0x2fed('0x1e')](_0x2fed('0x1f'),_0xa3dfe2+'-'+_0x324505+'/'+_0x442073)[_0x2fed('0x19')](_0x11c958);}return null;};}function patchUpdates(_0xdb584c){return function(_0x238f9a){try{jsonpatch[_0x2fed('0x20')](_0x238f9a,_0xdb584c,!![]);}catch(_0x344b83){return BPromise[_0x2fed('0x21')](_0x344b83);}return _0x238f9a[_0x2fed('0x22')]();};}function saveUpdates(_0x123a20,_0x21ae46){return function(_0x2ddc76){if(_0x2ddc76){return _0x2ddc76['update'](_0x123a20)[_0x2fed('0x23')](function(_0x34729b){return _0x34729b;});}return null;};}function removeEntity(_0x59ab2f,_0x59c526){return function(_0x47d559){if(_0x47d559){return _0x47d559[_0x2fed('0x24')]()[_0x2fed('0x23')](function(){_0x59ab2f[_0x2fed('0x17')](0xcc)[_0x2fed('0x18')]();});}};}function handleEntityNotFound(_0x42267f,_0x7a6512){return function(_0x546c80){if(!_0x546c80){_0x42267f['sendStatus'](0x194);}return _0x546c80;};}function handleError(_0x2fe215,_0x31793b){_0x31793b=_0x31793b||0x1f4;return function(_0x34c52c){logger[_0x2fed('0x25')](_0x34c52c[_0x2fed('0x26')]);if(_0x34c52c[_0x2fed('0x27')]){delete _0x34c52c['name'];}_0x2fe215[_0x2fed('0x17')](_0x31793b)['send'](_0x34c52c);};}exports[_0x2fed('0x28')]=function(_0x10d1d7,_0x36d0f8){var _0x478d5f={},_0x161f94={},_0x556e63={'count':0x0,'rows':[]};var _0xed13a2=_['map'](db[_0x2fed('0x29')][_0x2fed('0x2a')],function(_0x200f52){return{'name':_0x200f52[_0x2fed('0x2b')],'type':_0x200f52['type'][_0x2fed('0x2c')]};});_0x161f94['model']=_[_0x2fed('0x2d')](_0xed13a2,_0x2fed('0x27'));_0x161f94[_0x2fed('0x2e')]=_[_0x2fed('0x2f')](_0x10d1d7['query']);_0x161f94[_0x2fed('0x30')]=_['intersection'](_0x161f94[_0x2fed('0x31')],_0x161f94[_0x2fed('0x2e')]);_0x478d5f[_0x2fed('0x32')]=_['intersection'](_0x161f94[_0x2fed('0x31')],qs[_0x2fed('0x33')](_0x10d1d7[_0x2fed('0x2e')][_0x2fed('0x33')]));_0x478d5f[_0x2fed('0x32')]=_0x478d5f[_0x2fed('0x32')][_0x2fed('0x34')]?_0x478d5f[_0x2fed('0x32')]:_0x161f94[_0x2fed('0x31')];if(!_0x10d1d7['query']['hasOwnProperty']('nolimit')){_0x478d5f[_0x2fed('0x1d')]=qs[_0x2fed('0x1d')](_0x10d1d7[_0x2fed('0x2e')][_0x2fed('0x1d')]);_0x478d5f['offset']=qs[_0x2fed('0x1c')](_0x10d1d7[_0x2fed('0x2e')]['offset']);}_0x478d5f[_0x2fed('0x35')]=qs[_0x2fed('0x36')](_0x10d1d7['query'][_0x2fed('0x36')]);_0x478d5f[_0x2fed('0x37')]=qs[_0x2fed('0x30')](_[_0x2fed('0x38')](_0x10d1d7[_0x2fed('0x2e')],_0x161f94[_0x2fed('0x30')]),_0xed13a2);if(_0x10d1d7['query'][_0x2fed('0x39')]){_0x478d5f[_0x2fed('0x37')]=_['merge'](_0x478d5f[_0x2fed('0x37')],{'$or':_['map'](_0xed13a2,function(_0x16e75f){if(_0x16e75f['type']!==_0x2fed('0x3a')){var _0x49a586={};_0x49a586[_0x16e75f[_0x2fed('0x27')]]={'$like':'%'+_0x10d1d7[_0x2fed('0x2e')][_0x2fed('0x39')]+'%'};return _0x49a586;}})});}_0x478d5f=_[_0x2fed('0x3b')]({},_0x478d5f,_0x10d1d7[_0x2fed('0x3c')]);var _0x22ad63={'where':_0x478d5f[_0x2fed('0x37')]};return db['VtigerField'][_0x2fed('0x1b')](_0x22ad63)[_0x2fed('0x23')](function(_0x5c31bf){_0x556e63[_0x2fed('0x1b')]=_0x5c31bf;if(_0x10d1d7[_0x2fed('0x2e')][_0x2fed('0x3d')]){_0x478d5f[_0x2fed('0x3e')]=[{'all':!![]}];}return db[_0x2fed('0x29')][_0x2fed('0x3f')](_0x478d5f);})[_0x2fed('0x23')](function(_0x307866){_0x556e63['rows']=_0x307866;return _0x556e63;})[_0x2fed('0x23')](respondWithFilteredResult(_0x36d0f8,_0x478d5f))[_0x2fed('0x40')](handleError(_0x36d0f8,null));};exports[_0x2fed('0x41')]=function(_0x33476e,_0x5b0c65){var _0xbd3196={'raw':!![],'where':{'id':_0x33476e['params']['id']}},_0x6f6646={};_0x6f6646[_0x2fed('0x31')]=_['keys'](db[_0x2fed('0x29')][_0x2fed('0x2a')]);_0x6f6646['query']=_['keys'](_0x33476e[_0x2fed('0x2e')]);_0x6f6646[_0x2fed('0x30')]=_[_0x2fed('0x42')](_0x6f6646['model'],_0x6f6646[_0x2fed('0x2e')]);_0xbd3196[_0x2fed('0x32')]=_[_0x2fed('0x42')](_0x6f6646['model'],qs[_0x2fed('0x33')](_0x33476e[_0x2fed('0x2e')][_0x2fed('0x33')]));_0xbd3196['attributes']=_0xbd3196[_0x2fed('0x32')]['length']?_0xbd3196[_0x2fed('0x32')]:_0x6f6646[_0x2fed('0x31')];if(_0x33476e['query'][_0x2fed('0x3d')]){_0xbd3196[_0x2fed('0x3e')]=[{'all':!![]}];}_0xbd3196=_[_0x2fed('0x3b')]({},_0xbd3196,_0x33476e['options']);return db['VtigerField']['find'](_0xbd3196)[_0x2fed('0x23')](handleEntityNotFound(_0x5b0c65,null))['then'](respondWithResult(_0x5b0c65,null))['catch'](handleError(_0x5b0c65,null));};exports[_0x2fed('0x43')]=function(_0x1539b2,_0x254adb){return db['VtigerField']['create'](_0x1539b2[_0x2fed('0x44')],{})[_0x2fed('0x23')](respondWithResult(_0x254adb,0xc9))[_0x2fed('0x40')](handleError(_0x254adb,null));};exports[_0x2fed('0x45')]=function(_0x15f251,_0xf88fe){if(_0x15f251[_0x2fed('0x44')]['id']){delete _0x15f251[_0x2fed('0x44')]['id'];}return db['VtigerField'][_0x2fed('0x46')]({'where':{'id':_0x15f251[_0x2fed('0x47')]['id']}})[_0x2fed('0x23')](handleEntityNotFound(_0xf88fe,null))[_0x2fed('0x23')](saveUpdates(_0x15f251['body'],null))['then'](respondWithResult(_0xf88fe,null))['catch'](handleError(_0xf88fe,null));};exports[_0x2fed('0x24')]=function(_0x152013,_0x5477df){return db[_0x2fed('0x29')][_0x2fed('0x46')]({'where':{'id':_0x152013[_0x2fed('0x47')]['id']}})['then'](handleEntityNotFound(_0x5477df,null))['then'](removeEntity(_0x5477df,null))[_0x2fed('0x40')](handleError(_0x5477df,null));}; \ No newline at end of file +var _0x867f=['then','includeAll','include','rows','catch','params','rawAttributes','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','end','sendStatus','error','stack','name','send','index','map','VtigerField','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options'];(function(_0x4a97a9,_0x52552b){var _0x43fb99=function(_0x5e775f){while(--_0x5e775f){_0x4a97a9['push'](_0x4a97a9['shift']());}};_0x43fb99(++_0x52552b);}(_0x867f,0xe6));var _0xf867=function(_0x3ce221,_0x22d678){_0x3ce221=_0x3ce221-0x0;var _0x3995b8=_0x867f[_0x3ce221];return _0x3995b8;};'use strict';var emlformat=require(_0xf867('0x0'));var rimraf=require(_0xf867('0x1'));var zipdir=require(_0xf867('0x2'));var jsonpatch=require(_0xf867('0x3'));var rp=require(_0xf867('0x4'));var moment=require(_0xf867('0x5'));var BPromise=require(_0xf867('0x6'));var Mustache=require(_0xf867('0x7'));var util=require(_0xf867('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf867('0x9'));var ejs=require(_0xf867('0xa'));var fs=require('fs');var fs_extra=require(_0xf867('0xb'));var _=require(_0xf867('0xc'));var squel=require(_0xf867('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf867('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf867('0xf'));var Papa=require(_0xf867('0x10'));var Redis=require(_0xf867('0x11'));var authService=require(_0xf867('0x12'));var qs=require(_0xf867('0x13'));var as=require(_0xf867('0x14'));var hardwareService=require(_0xf867('0x15'));var logger=require(_0xf867('0x16'))('api');var utils=require(_0xf867('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf867('0x18'))['db'];function respondWithStatusCode(_0x1792ae,_0x20fe34){_0x20fe34=_0x20fe34||0xcc;return function(_0x56740c){if(_0x56740c){return _0x1792ae['sendStatus'](_0x20fe34);}return _0x1792ae[_0xf867('0x19')](_0x20fe34)['end']();};}function respondWithResult(_0x352f0b,_0x49ff40){_0x49ff40=_0x49ff40||0xc8;return function(_0x48ff28){if(_0x48ff28){return _0x352f0b[_0xf867('0x19')](_0x49ff40)[_0xf867('0x1a')](_0x48ff28);}};}function respondWithFilteredResult(_0x7a143e,_0x13973b){return function(_0x38fed9){if(_0x38fed9){var _0x1e5161=typeof _0x13973b[_0xf867('0x1b')]===_0xf867('0x1c')&&typeof _0x13973b[_0xf867('0x1d')]==='undefined';var _0x44f6f1=_0x38fed9['count'];var _0x39f9e8=_0x1e5161?0x0:_0x13973b['offset'];var _0x51bdb3=_0x1e5161?_0x38fed9[_0xf867('0x1e')]:_0x13973b['offset']+_0x13973b['limit'];var _0x2092af;if(_0x51bdb3>=_0x44f6f1){_0x51bdb3=_0x44f6f1;_0x2092af=0xc8;}else{_0x2092af=0xce;}_0x7a143e[_0xf867('0x19')](_0x2092af);return _0x7a143e['set']('Content-Range',_0x39f9e8+'-'+_0x51bdb3+'/'+_0x44f6f1)[_0xf867('0x1a')](_0x38fed9);}return null;};}function patchUpdates(_0x23e7dd){return function(_0x1456ce){try{jsonpatch[_0xf867('0x1f')](_0x1456ce,_0x23e7dd,!![]);}catch(_0x419f75){return BPromise[_0xf867('0x20')](_0x419f75);}return _0x1456ce[_0xf867('0x21')]();};}function saveUpdates(_0x34db74,_0x586a25){return function(_0x568aba){if(_0x568aba){return _0x568aba[_0xf867('0x22')](_0x34db74)['then'](function(_0x3072b7){return _0x3072b7;});}return null;};}function removeEntity(_0x3fc971,_0x4da34b){return function(_0x419b6f){if(_0x419b6f){return _0x419b6f[_0xf867('0x23')]()['then'](function(){_0x3fc971[_0xf867('0x19')](0xcc)[_0xf867('0x24')]();});}};}function handleEntityNotFound(_0x167e70,_0x1bc6ca){return function(_0x58bded){if(!_0x58bded){_0x167e70[_0xf867('0x25')](0x194);}return _0x58bded;};}function handleError(_0x67e3a,_0x2efca3){_0x2efca3=_0x2efca3||0x1f4;return function(_0xd765c){logger[_0xf867('0x26')](_0xd765c[_0xf867('0x27')]);if(_0xd765c[_0xf867('0x28')]){delete _0xd765c[_0xf867('0x28')];}_0x67e3a[_0xf867('0x19')](_0x2efca3)[_0xf867('0x29')](_0xd765c);};}exports[_0xf867('0x2a')]=function(_0x57bf28,_0xb6d069){var _0x3981d0={},_0x39218a={},_0xb0dcdd={'count':0x0,'rows':[]};var _0x350d6d=_[_0xf867('0x2b')](db[_0xf867('0x2c')]['rawAttributes'],function(_0x44ddd4){return{'name':_0x44ddd4[_0xf867('0x2d')],'type':_0x44ddd4[_0xf867('0x2e')][_0xf867('0x2f')]};});_0x39218a[_0xf867('0x30')]=_[_0xf867('0x2b')](_0x350d6d,_0xf867('0x28'));_0x39218a[_0xf867('0x31')]=_['keys'](_0x57bf28[_0xf867('0x31')]);_0x39218a['filters']=_[_0xf867('0x32')](_0x39218a['model'],_0x39218a[_0xf867('0x31')]);_0x3981d0[_0xf867('0x33')]=_[_0xf867('0x32')](_0x39218a['model'],qs[_0xf867('0x34')](_0x57bf28[_0xf867('0x31')]['fields']));_0x3981d0['attributes']=_0x3981d0[_0xf867('0x33')]['length']?_0x3981d0[_0xf867('0x33')]:_0x39218a[_0xf867('0x30')];if(!_0x57bf28[_0xf867('0x31')][_0xf867('0x35')]('nolimit')){_0x3981d0['limit']=qs[_0xf867('0x1d')](_0x57bf28[_0xf867('0x31')][_0xf867('0x1d')]);_0x3981d0['offset']=qs[_0xf867('0x1b')](_0x57bf28[_0xf867('0x31')]['offset']);}_0x3981d0[_0xf867('0x36')]=qs['sort'](_0x57bf28[_0xf867('0x31')][_0xf867('0x37')]);_0x3981d0[_0xf867('0x38')]=qs['filters'](_[_0xf867('0x39')](_0x57bf28['query'],_0x39218a[_0xf867('0x3a')]),_0x350d6d);if(_0x57bf28[_0xf867('0x31')][_0xf867('0x3b')]){_0x3981d0[_0xf867('0x38')]=_[_0xf867('0x3c')](_0x3981d0[_0xf867('0x38')],{'$or':_[_0xf867('0x2b')](_0x350d6d,function(_0x2a2e81){if(_0x2a2e81['type']!=='VIRTUAL'){var _0x4a877={};_0x4a877[_0x2a2e81[_0xf867('0x28')]]={'$like':'%'+_0x57bf28[_0xf867('0x31')][_0xf867('0x3b')]+'%'};return _0x4a877;}})});}_0x3981d0=_[_0xf867('0x3c')]({},_0x3981d0,_0x57bf28[_0xf867('0x3d')]);var _0x36ccbe={'where':_0x3981d0['where']};return db[_0xf867('0x2c')][_0xf867('0x1e')](_0x36ccbe)[_0xf867('0x3e')](function(_0x352f8e){_0xb0dcdd[_0xf867('0x1e')]=_0x352f8e;if(_0x57bf28[_0xf867('0x31')][_0xf867('0x3f')]){_0x3981d0[_0xf867('0x40')]=[{'all':!![]}];}return db[_0xf867('0x2c')]['findAll'](_0x3981d0);})[_0xf867('0x3e')](function(_0x4e31d8){_0xb0dcdd[_0xf867('0x41')]=_0x4e31d8;return _0xb0dcdd;})[_0xf867('0x3e')](respondWithFilteredResult(_0xb6d069,_0x3981d0))[_0xf867('0x42')](handleError(_0xb6d069,null));};exports['show']=function(_0x16dfd3,_0x86d79c){var _0x27421a={'raw':!![],'where':{'id':_0x16dfd3[_0xf867('0x43')]['id']}},_0xed868d={};_0xed868d[_0xf867('0x30')]=_['keys'](db[_0xf867('0x2c')][_0xf867('0x44')]);_0xed868d[_0xf867('0x31')]=_[_0xf867('0x45')](_0x16dfd3[_0xf867('0x31')]);_0xed868d['filters']=_[_0xf867('0x32')](_0xed868d['model'],_0xed868d[_0xf867('0x31')]);_0x27421a[_0xf867('0x33')]=_['intersection'](_0xed868d[_0xf867('0x30')],qs[_0xf867('0x34')](_0x16dfd3[_0xf867('0x31')][_0xf867('0x34')]));_0x27421a[_0xf867('0x33')]=_0x27421a[_0xf867('0x33')]['length']?_0x27421a[_0xf867('0x33')]:_0xed868d['model'];if(_0x16dfd3[_0xf867('0x31')][_0xf867('0x3f')]){_0x27421a[_0xf867('0x40')]=[{'all':!![]}];}_0x27421a=_[_0xf867('0x3c')]({},_0x27421a,_0x16dfd3[_0xf867('0x3d')]);return db[_0xf867('0x2c')][_0xf867('0x46')](_0x27421a)['then'](handleEntityNotFound(_0x86d79c,null))['then'](respondWithResult(_0x86d79c,null))[_0xf867('0x42')](handleError(_0x86d79c,null));};exports[_0xf867('0x47')]=function(_0x38fd9b,_0x5ca8a7){return db[_0xf867('0x2c')][_0xf867('0x47')](_0x38fd9b[_0xf867('0x48')],{})['then'](respondWithResult(_0x5ca8a7,0xc9))[_0xf867('0x42')](handleError(_0x5ca8a7,null));};exports['update']=function(_0xc01c03,_0x2d56c0){if(_0xc01c03[_0xf867('0x48')]['id']){delete _0xc01c03[_0xf867('0x48')]['id'];}return db[_0xf867('0x2c')][_0xf867('0x46')]({'where':{'id':_0xc01c03[_0xf867('0x43')]['id']}})[_0xf867('0x3e')](handleEntityNotFound(_0x2d56c0,null))['then'](saveUpdates(_0xc01c03['body'],null))[_0xf867('0x3e')](respondWithResult(_0x2d56c0,null))[_0xf867('0x42')](handleError(_0x2d56c0,null));};exports[_0xf867('0x23')]=function(_0x199ce0,_0x2e9093){return db[_0xf867('0x2c')][_0xf867('0x46')]({'where':{'id':_0x199ce0['params']['id']}})[_0xf867('0x3e')](handleEntityNotFound(_0x2e9093,null))[_0xf867('0x3e')](removeEntity(_0x2e9093,null))[_0xf867('0x42')](handleError(_0x2e9093,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index ed43cfe..cc3bbba 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 _0xe5c0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','idField','lodash','../../config/logger','api'];(function(_0x11fd18,_0x4ce1a0){var _0x57fea3=function(_0x177faf){while(--_0x177faf){_0x11fd18['push'](_0x11fd18['shift']());}};_0x57fea3(++_0x4ce1a0);}(_0xe5c0,0x174));var _0x0e5c=function(_0x3bb63a,_0x15af8f){_0x3bb63a=_0x3bb63a-0x0;var _0x3b822a=_0xe5c0[_0x3bb63a];return _0x3b822a;};'use strict';var _=require(_0x0e5c('0x0'));var util=require('util');var logger=require(_0x0e5c('0x1'))(_0x0e5c('0x2'));var moment=require(_0x0e5c('0x3'));var BPromise=require(_0x0e5c('0x4'));var rp=require(_0x0e5c('0x5'));var fs=require('fs');var path=require(_0x0e5c('0x6'));var rimraf=require(_0x0e5c('0x7'));var config=require(_0x0e5c('0x8'));var attributes=require(_0x0e5c('0x9'));module[_0x0e5c('0xa')]=function(_0x571cae,_0x228310){return _0x571cae[_0x0e5c('0xb')](_0x0e5c('0xc'),attributes,{'tableName':_0x0e5c('0xd'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x0e5c('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xed3c=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index'];(function(_0xe5efcb,_0x473f01){var _0x782d72=function(_0x44bf97){while(--_0x44bf97){_0xe5efcb['push'](_0xe5efcb['shift']());}};_0x782d72(++_0x473f01);}(_0xed3c,0xfd));var _0xced3=function(_0x2c85c0,_0x1dac4f){_0x2c85c0=_0x2c85c0-0x0;var _0xf4d4c9=_0xed3c[_0x2c85c0];return _0xf4d4c9;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var logger=require(_0xced3('0x2'))(_0xced3('0x3'));var moment=require(_0xced3('0x4'));var BPromise=require(_0xced3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xced3('0x6'));var config=require('../../config/environment');var attributes=require(_0xced3('0x7'));module[_0xced3('0x8')]=function(_0x11d01d,_0x25f9f5){return _0x11d01d[_0xced3('0x9')](_0xced3('0xa'),attributes,{'tableName':_0xced3('0xb'),'paranoid':![],'indexes':[{'name':_0xced3('0xc'),'fields':['idField',_0xced3('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index faffe80..49e62ac 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 _0xf04c=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf04c,0x16f));var _0xcf04=function(_0x5cd85e,_0x2c35fb){_0x5cd85e=_0x5cd85e-0x0;var _0x379b79=_0xf04c[_0x5cd85e];return _0x379b79;};'use strict';var _=require(_0xcf04('0x0'));var util=require(_0xcf04('0x1'));var moment=require(_0xcf04('0x2'));var BPromise=require(_0xcf04('0x3'));var rs=require(_0xcf04('0x4'));var fs=require('fs');var Redis=require(_0xcf04('0x5'));var db=require(_0xcf04('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf04('0x7'))(_0xcf04('0x8'));var config=require(_0xcf04('0x9'));var jayson=require(_0xcf04('0xa'));var client=jayson['client'][_0xcf04('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a0ee6,_0x4a0a9d,_0xe3c15e){return new BPromise(function(_0xd2be30,_0xb2e70e){return client[_0xcf04('0xc')](_0x4a0ee6,_0xe3c15e)[_0xcf04('0xd')](function(_0x2a8837){logger['info'](_0xcf04('0xe'),_0x4a0a9d,_0xcf04('0xf'));logger['debug'](_0xcf04('0x10'),_0x4a0a9d,_0xcf04('0xf'),JSON[_0xcf04('0x11')](_0x2a8837));if(_0x2a8837[_0xcf04('0x12')]){if(_0x2a8837[_0xcf04('0x12')][_0xcf04('0x13')]===0x1f4){logger[_0xcf04('0x12')](_0xcf04('0xe'),_0x4a0a9d,_0x2a8837[_0xcf04('0x12')][_0xcf04('0x14')]);return _0xb2e70e(_0x2a8837[_0xcf04('0x12')][_0xcf04('0x14')]);}logger['error'](_0xcf04('0xe'),_0x4a0a9d,_0x2a8837['error'][_0xcf04('0x14')]);return _0xd2be30(_0x2a8837[_0xcf04('0x12')][_0xcf04('0x14')]);}else{logger[_0xcf04('0x15')](_0xcf04('0xe'),_0x4a0a9d,_0xcf04('0xf'));_0xd2be30(_0x2a8837[_0xcf04('0x16')][_0xcf04('0x14')]);}})[_0xcf04('0x17')](function(_0x4247db){logger[_0xcf04('0x12')]('VtigerField,\x20%s,\x20%s',_0x4a0a9d,_0x4247db);_0xb2e70e(_0x4247db);});});} \ No newline at end of file +var _0xbddf=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x34eb8b,_0x10d2ed){var _0x13395a=function(_0x398b52){while(--_0x398b52){_0x34eb8b['push'](_0x34eb8b['shift']());}};_0x13395a(++_0x10d2ed);}(_0xbddf,0x6d));var _0xfbdd=function(_0xf216b7,_0x5653d8){_0xf216b7=_0xf216b7-0x0;var _0x580566=_0xbddf[_0xf216b7];return _0x580566;};'use strict';var _=require(_0xfbdd('0x0'));var util=require('util');var moment=require(_0xfbdd('0x1'));var BPromise=require(_0xfbdd('0x2'));var rs=require(_0xfbdd('0x3'));var fs=require('fs');var Redis=require(_0xfbdd('0x4'));var db=require(_0xfbdd('0x5'))['db'];var utils=require(_0xfbdd('0x6'));var logger=require(_0xfbdd('0x7'))(_0xfbdd('0x8'));var config=require(_0xfbdd('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfbdd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26436d,_0x35a3aa,_0xd4cf8a){return new BPromise(function(_0x59fb7c,_0x4281ca){return client[_0xfbdd('0xb')](_0x26436d,_0xd4cf8a)[_0xfbdd('0xc')](function(_0x38891e){logger[_0xfbdd('0xd')](_0xfbdd('0xe'),_0x35a3aa,_0xfbdd('0xf'));logger[_0xfbdd('0x10')](_0xfbdd('0x11'),_0x35a3aa,_0xfbdd('0xf'),JSON[_0xfbdd('0x12')](_0x38891e));if(_0x38891e[_0xfbdd('0x13')]){if(_0x38891e[_0xfbdd('0x13')]['code']===0x1f4){logger[_0xfbdd('0x13')](_0xfbdd('0xe'),_0x35a3aa,_0x38891e[_0xfbdd('0x13')][_0xfbdd('0x14')]);return _0x4281ca(_0x38891e[_0xfbdd('0x13')][_0xfbdd('0x14')]);}logger[_0xfbdd('0x13')](_0xfbdd('0xe'),_0x35a3aa,_0x38891e[_0xfbdd('0x13')][_0xfbdd('0x14')]);return _0x59fb7c(_0x38891e[_0xfbdd('0x13')][_0xfbdd('0x14')]);}else{logger[_0xfbdd('0xd')](_0xfbdd('0xe'),_0x35a3aa,_0xfbdd('0xf'));_0x59fb7c(_0x38891e[_0xfbdd('0x15')][_0xfbdd('0x14')]);}})[_0xfbdd('0x16')](function(_0x46f13d){logger[_0xfbdd('0x13')](_0xfbdd('0xe'),_0x35a3aa,_0x46f13d);_0x4281ca(_0x46f13d);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index f84dedc..1befefc 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 _0xe933=['show','isAuthenticated','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','update','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get'];(function(_0x5b5842,_0x2f2eff){var _0x3f9ddc=function(_0x3a8005){while(--_0x3a8005){_0x5b5842['push'](_0x5b5842['shift']());}};_0x3f9ddc(++_0x2f2eff);}(_0xe933,0x9f));var _0x3e93=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xe933[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x3e93('0x0'));var util=require('util');var path=require(_0x3e93('0x1'));var timeout=require(_0x3e93('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3e93('0x3'));var auth=require(_0x3e93('0x4'));var interaction=require(_0x3e93('0x5'));var config=require(_0x3e93('0x6'));var controller=require(_0x3e93('0x7'));router[_0x3e93('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3e93('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3e93('0x9')]);router[_0x3e93('0x8')]('/:id/configurations',auth[_0x3e93('0xa')](),controller[_0x3e93('0xb')]);router['get'](_0x3e93('0xc'),auth['isAuthenticated'](),controller[_0x3e93('0xd')]);router['post']('/',auth[_0x3e93('0xa')](),controller[_0x3e93('0xe')]);router[_0x3e93('0xf')](_0x3e93('0x10'),auth[_0x3e93('0xa')](),controller[_0x3e93('0x11')]);router[_0x3e93('0x12')]('/:id',auth[_0x3e93('0xa')](),controller[_0x3e93('0x13')]);router['delete']('/:id',auth[_0x3e93('0xa')](),controller['destroy']);module[_0x3e93('0x14')]=router; \ No newline at end of file +var _0x28b5=['/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./intZendeskAccount.controller','isAuthenticated','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x258970,_0x128c11){var _0x430c6b=function(_0x1760b0){while(--_0x1760b0){_0x258970['push'](_0x258970['shift']());}};_0x430c6b(++_0x128c11);}(_0x28b5,0xad));var _0x528b=function(_0xa1cf31,_0x33373a){_0xa1cf31=_0xa1cf31-0x0;var _0x5cd5ff=_0x28b5[_0xa1cf31];return _0x5cd5ff;};'use strict';var multer=require(_0x528b('0x0'));var util=require(_0x528b('0x1'));var path=require(_0x528b('0x2'));var timeout=require('connect-timeout');var express=require(_0x528b('0x3'));var router=express[_0x528b('0x4')]();var fs_extra=require(_0x528b('0x5'));var auth=require(_0x528b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x528b('0x7'));router['get']('/',auth[_0x528b('0x8')](),controller['index']);router[_0x528b('0x9')]('/:id',auth[_0x528b('0x8')](),controller[_0x528b('0xa')]);router[_0x528b('0x9')](_0x528b('0xb'),auth[_0x528b('0x8')](),controller[_0x528b('0xc')]);router[_0x528b('0x9')](_0x528b('0xd'),auth[_0x528b('0x8')](),controller[_0x528b('0xe')]);router[_0x528b('0xf')]('/',auth[_0x528b('0x8')](),controller[_0x528b('0x10')]);router[_0x528b('0xf')](_0x528b('0xb'),auth[_0x528b('0x8')](),controller[_0x528b('0x11')]);router[_0x528b('0x12')](_0x528b('0x13'),auth['isAuthenticated'](),controller[_0x528b('0x14')]);router[_0x528b('0x15')](_0x528b('0x13'),auth[_0x528b('0x8')](),controller[_0x528b('0x16')]);module[_0x528b('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index f215bc1..32b3669 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 _0x82d8=['password','token','integrationTab','sequelize','STRING','username','ENUM'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0x82d8,0xff));var _0x882d=function(_0x2d135e,_0x195eee){_0x2d135e=_0x2d135e-0x0;var _0x3a805b=_0x82d8[_0x2d135e];return _0x3a805b;};'use strict';var Sequelize=require(_0x882d('0x0'));module['exports']={'name':{'type':Sequelize[_0x882d('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x882d('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x882d('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x882d('0x3')](_0x882d('0x4'),_0x882d('0x5')),'defaultValue':_0x882d('0x4')},'serverUrl':{'type':Sequelize[_0x882d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x882d('0x3')](_0x882d('0x6'),'newTab'),'defaultValue':_0x882d('0x6')}}; \ No newline at end of file +var _0xd991=['remoteUri','ENUM','password','integrationTab','newTab','sequelize','exports','STRING'];(function(_0xe9b2b4,_0x465716){var _0xe5212e=function(_0x4045ac){while(--_0x4045ac){_0xe9b2b4['push'](_0xe9b2b4['shift']());}};_0xe5212e(++_0x465716);}(_0xd991,0x115));var _0x1d99=function(_0x212f9f,_0x48c9e2){_0x212f9f=_0x212f9f-0x0;var _0xc630f8=_0xd991[_0x212f9f];return _0xc630f8;};'use strict';var Sequelize=require(_0x1d99('0x0'));module[_0x1d99('0x1')]={'name':{'type':Sequelize[_0x1d99('0x2')]},'description':{'type':Sequelize[_0x1d99('0x2')]},'username':{'type':Sequelize[_0x1d99('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x1d99('0x2')]},'token':{'type':Sequelize[_0x1d99('0x2')]},'remoteUri':{'type':Sequelize[_0x1d99('0x2')],'unique':_0x1d99('0x3')},'authType':{'type':Sequelize[_0x1d99('0x4')](_0x1d99('0x5'),'token'),'defaultValue':_0x1d99('0x5')},'serverUrl':{'type':Sequelize[_0x1d99('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1d99('0x6'),_0x1d99('0x7')),'defaultValue':_0x1d99('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 5f3d924..3b1ea52 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 _0x750a=['crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','destroy','then','error','name','index','map','ZendeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','merge','options','includeAll','include','rows','catch','show','params','find','create','body','ZendeskConfiguration','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','authType','remoteUri','slice','substring','lastIndexOf','GET','ticket_fields','password','headers','format','Basic\x20%s','%s:%s','token','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','includes','title','position','system_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x750a,0x140));var _0xa750=function(_0x50eba8,_0x175ae4){_0x50eba8=_0x50eba8-0x0;var _0x52615b=_0x750a[_0x50eba8];return _0x52615b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa750('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var BPromise=require(_0xa750('0x3'));var Mustache=require(_0xa750('0x4'));var util=require(_0xa750('0x5'));var path=require(_0xa750('0x6'));var sox=require(_0xa750('0x7'));var csv=require(_0xa750('0x8'));var ejs=require(_0xa750('0x9'));var fs=require('fs');var fs_extra=require(_0xa750('0xa'));var _=require(_0xa750('0xb'));var squel=require(_0xa750('0xc'));var crypto=require(_0xa750('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa750('0x8'));var querystring=require('querystring');var Papa=require(_0xa750('0xe'));var Redis=require(_0xa750('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa750('0x10'));var as=require(_0xa750('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa750('0x12'));var utils=require('../../config/utils');var config=require(_0xa750('0x13'));var licenseUtil=require(_0xa750('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa750('0x15'));function respondWithStatusCode(_0x1c5657,_0x344c67){_0x344c67=_0x344c67||0xcc;return function(_0x567c51){if(_0x567c51){return _0x1c5657[_0xa750('0x16')](_0x344c67);}return _0x1c5657[_0xa750('0x17')](_0x344c67)[_0xa750('0x18')]();};}function respondWithResult(_0x24e48a,_0xa66181){_0xa66181=_0xa66181||0xc8;return function(_0x339329){if(_0x339329){return _0x24e48a['status'](_0xa66181)[_0xa750('0x19')](_0x339329);}};}function respondWithFilteredResult(_0x8488ea,_0x290d46){return function(_0x49fe3b){if(_0x49fe3b){var _0x337095=typeof _0x290d46[_0xa750('0x1a')]==='undefined'&&typeof _0x290d46['limit']===_0xa750('0x1b');var _0x5b1e6b=_0x49fe3b[_0xa750('0x1c')];var _0x1bde87=_0x337095?0x0:_0x290d46['offset'];var _0x36dcca=_0x337095?_0x49fe3b['count']:_0x290d46['offset']+_0x290d46[_0xa750('0x1d')];var _0x5d0935;if(_0x36dcca>=_0x5b1e6b){_0x36dcca=_0x5b1e6b;_0x5d0935=0xc8;}else{_0x5d0935=0xce;}_0x8488ea[_0xa750('0x17')](_0x5d0935);return _0x8488ea['set'](_0xa750('0x1e'),_0x1bde87+'-'+_0x36dcca+'/'+_0x5b1e6b)['json'](_0x49fe3b);}return null;};}function patchUpdates(_0x3dc7f1){return function(_0x500922){try{jsonpatch[_0xa750('0x1f')](_0x500922,_0x3dc7f1,!![]);}catch(_0x4d1939){return BPromise['reject'](_0x4d1939);}return _0x500922[_0xa750('0x20')]();};}function saveUpdates(_0x52da84,_0x216fbf){return function(_0x5a9d96){if(_0x5a9d96){return _0x5a9d96['update'](_0x52da84)['then'](function(_0x5d758e){return _0x5d758e;});}return null;};}function removeEntity(_0x15d72f,_0x2ec6c4){return function(_0x2c43ef){if(_0x2c43ef){return _0x2c43ef[_0xa750('0x21')]()[_0xa750('0x22')](function(){_0x15d72f[_0xa750('0x17')](0xcc)[_0xa750('0x18')]();});}};}function handleEntityNotFound(_0x7e22ad,_0x3d52b3){return function(_0x94697a){if(!_0x94697a){_0x7e22ad[_0xa750('0x16')](0x194);}return _0x94697a;};}function handleError(_0x27a5eb,_0x31ea63){_0x31ea63=_0x31ea63||0x1f4;return function(_0x3f7d6d){logger[_0xa750('0x23')](_0x3f7d6d['stack']);if(_0x3f7d6d[_0xa750('0x24')]){delete _0x3f7d6d[_0xa750('0x24')];}_0x27a5eb[_0xa750('0x17')](_0x31ea63)['send'](_0x3f7d6d);};}exports[_0xa750('0x25')]=function(_0x6ade2b,_0x3270e3){var _0x1223d2={},_0x579f1c={},_0x297eef={'count':0x0,'rows':[]};var _0x34d5e9=_[_0xa750('0x26')](db[_0xa750('0x27')][_0xa750('0x28')],function(_0x59ab33){return{'name':_0x59ab33[_0xa750('0x29')],'type':_0x59ab33['type'][_0xa750('0x2a')]};});_0x579f1c[_0xa750('0x2b')]=_['map'](_0x34d5e9,_0xa750('0x24'));_0x579f1c[_0xa750('0x2c')]=_[_0xa750('0x2d')](_0x6ade2b[_0xa750('0x2c')]);_0x579f1c[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x579f1c[_0xa750('0x2b')],_0x579f1c[_0xa750('0x2c')]);_0x1223d2['attributes']=_[_0xa750('0x2f')](_0x579f1c['model'],qs[_0xa750('0x30')](_0x6ade2b[_0xa750('0x2c')][_0xa750('0x30')]));_0x1223d2[_0xa750('0x31')]=_0x1223d2['attributes'][_0xa750('0x32')]?_0x1223d2[_0xa750('0x31')]:_0x579f1c['model'];if(!_0x6ade2b[_0xa750('0x2c')][_0xa750('0x33')](_0xa750('0x34'))){_0x1223d2[_0xa750('0x1d')]=qs['limit'](_0x6ade2b[_0xa750('0x2c')]['limit']);_0x1223d2['offset']=qs[_0xa750('0x1a')](_0x6ade2b[_0xa750('0x2c')][_0xa750('0x1a')]);}_0x1223d2['order']=qs[_0xa750('0x35')](_0x6ade2b[_0xa750('0x2c')][_0xa750('0x35')]);_0x1223d2['where']=qs[_0xa750('0x2e')](_[_0xa750('0x36')](_0x6ade2b[_0xa750('0x2c')],_0x579f1c['filters']),_0x34d5e9);if(_0x6ade2b[_0xa750('0x2c')][_0xa750('0x37')]){_0x1223d2[_0xa750('0x38')]=_['merge'](_0x1223d2[_0xa750('0x38')],{'$or':_[_0xa750('0x26')](_0x34d5e9,function(_0x1e579b){if(_0x1e579b[_0xa750('0x39')]!=='VIRTUAL'){var _0x4dc0b8={};_0x4dc0b8[_0x1e579b[_0xa750('0x24')]]={'$like':'%'+_0x6ade2b[_0xa750('0x2c')]['filter']+'%'};return _0x4dc0b8;}})});}_0x1223d2=_[_0xa750('0x3a')]({},_0x1223d2,_0x6ade2b[_0xa750('0x3b')]);var _0x15d35a={'where':_0x1223d2[_0xa750('0x38')]};return db[_0xa750('0x27')]['count'](_0x15d35a)[_0xa750('0x22')](function(_0x2b33e0){_0x297eef[_0xa750('0x1c')]=_0x2b33e0;if(_0x6ade2b[_0xa750('0x2c')][_0xa750('0x3c')]){_0x1223d2[_0xa750('0x3d')]=[{'all':!![]}];}return db[_0xa750('0x27')]['findAll'](_0x1223d2);})[_0xa750('0x22')](function(_0x5e9ffb){_0x297eef[_0xa750('0x3e')]=_0x5e9ffb;return _0x297eef;})['then'](respondWithFilteredResult(_0x3270e3,_0x1223d2))[_0xa750('0x3f')](handleError(_0x3270e3,null));};exports[_0xa750('0x40')]=function(_0xf9fd5f,_0x1be24e){var _0x430d60={'raw':![],'where':{'id':_0xf9fd5f[_0xa750('0x41')]['id']}},_0xe27272={};_0xe27272[_0xa750('0x2b')]=_[_0xa750('0x2d')](db[_0xa750('0x27')][_0xa750('0x28')]);_0xe27272[_0xa750('0x2c')]=_[_0xa750('0x2d')](_0xf9fd5f[_0xa750('0x2c')]);_0xe27272[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0xe27272[_0xa750('0x2b')],_0xe27272[_0xa750('0x2c')]);_0x430d60[_0xa750('0x31')]=_[_0xa750('0x2f')](_0xe27272['model'],qs[_0xa750('0x30')](_0xf9fd5f[_0xa750('0x2c')][_0xa750('0x30')]));_0x430d60[_0xa750('0x31')]=_0x430d60[_0xa750('0x31')][_0xa750('0x32')]?_0x430d60[_0xa750('0x31')]:_0xe27272[_0xa750('0x2b')];if(_0xf9fd5f[_0xa750('0x2c')]['includeAll']){_0x430d60[_0xa750('0x3d')]=[{'all':!![]}];}_0x430d60=_[_0xa750('0x3a')]({},_0x430d60,_0xf9fd5f['options']);return db[_0xa750('0x27')][_0xa750('0x42')](_0x430d60)[_0xa750('0x22')](handleEntityNotFound(_0x1be24e,null))[_0xa750('0x22')](respondWithResult(_0x1be24e,null))[_0xa750('0x3f')](handleError(_0x1be24e,null));};exports[_0xa750('0x43')]=function(_0x5e7a95,_0x278c22){return db[_0xa750('0x27')][_0xa750('0x43')](_0x5e7a95['body'],{})[_0xa750('0x22')](respondWithResult(_0x278c22,0xc9))[_0xa750('0x3f')](handleError(_0x278c22,null));};exports['update']=function(_0x93e49f,_0x2397e1){if(_0x93e49f[_0xa750('0x44')]['id']){delete _0x93e49f['body']['id'];}return db[_0xa750('0x27')][_0xa750('0x42')]({'where':{'id':_0x93e49f[_0xa750('0x41')]['id']}})[_0xa750('0x22')](handleEntityNotFound(_0x2397e1,null))['then'](saveUpdates(_0x93e49f[_0xa750('0x44')],null))[_0xa750('0x22')](respondWithResult(_0x2397e1,null))[_0xa750('0x3f')](handleError(_0x2397e1,null));};exports[_0xa750('0x21')]=function(_0x4ce363,_0x203f2a){return db[_0xa750('0x27')]['find']({'where':{'id':_0x4ce363[_0xa750('0x41')]['id']}})['then'](handleEntityNotFound(_0x203f2a,null))[_0xa750('0x22')](removeEntity(_0x203f2a,null))[_0xa750('0x3f')](handleError(_0x203f2a,null));};exports['getConfigurations']=function(_0x47e93c,_0x58eba1,_0x232da4){var _0x401125={};var _0x4ea12b={};var _0xe88dc;var _0x1a79a9;return db[_0xa750('0x27')]['findOne']({'where':{'id':_0x47e93c['params']['id']}})['then'](handleEntityNotFound(_0x58eba1,null))['then'](function(_0x3c34d4){if(_0x3c34d4){_0xe88dc=_0x3c34d4;_0x4ea12b['model']=_[_0xa750('0x2d')](db[_0xa750('0x45')]['rawAttributes']);_0x4ea12b[_0xa750('0x2c')]=_['keys'](_0x47e93c[_0xa750('0x2c')]);_0x4ea12b['filters']=_['intersection'](_0x4ea12b['model'],_0x4ea12b['query']);_0x401125[_0xa750('0x31')]=_[_0xa750('0x2f')](_0x4ea12b['model'],qs['fields'](_0x47e93c['query'][_0xa750('0x30')]));_0x401125[_0xa750('0x31')]=_0x401125[_0xa750('0x31')][_0xa750('0x32')]?_0x401125[_0xa750('0x31')]:_0x4ea12b[_0xa750('0x2b')];_0x401125['order']=qs['sort'](_0x47e93c[_0xa750('0x2c')][_0xa750('0x35')]);_0x401125[_0xa750('0x38')]=qs[_0xa750('0x2e')](_[_0xa750('0x36')](_0x47e93c['query'],_0x4ea12b[_0xa750('0x2e')]));if(_0x47e93c[_0xa750('0x2c')][_0xa750('0x37')]){_0x401125[_0xa750('0x38')]=_[_0xa750('0x3a')](_0x401125[_0xa750('0x38')],{'$or':_[_0xa750('0x26')](_0x401125[_0xa750('0x31')],function(_0x5e78f1){var _0x2aa1d6={};_0x2aa1d6[_0x5e78f1]={'$like':'%'+_0x47e93c[_0xa750('0x2c')][_0xa750('0x37')]+'%'};return _0x2aa1d6;})});}_0x401125=_[_0xa750('0x3a')]({},_0x401125,_0x47e93c[_0xa750('0x3b')]);return _0xe88dc['getConfigurations'](_0x401125);}})[_0xa750('0x22')](function(_0x25248f){if(_0x25248f){_0x1a79a9=_0x25248f[_0xa750('0x32')];if(!_0x47e93c[_0xa750('0x2c')][_0xa750('0x33')](_0xa750('0x34'))){_0x401125[_0xa750('0x1d')]=qs[_0xa750('0x1d')](_0x47e93c[_0xa750('0x2c')][_0xa750('0x1d')]);_0x401125[_0xa750('0x1a')]=qs[_0xa750('0x1a')](_0x47e93c[_0xa750('0x2c')][_0xa750('0x1a')]);}return _0xe88dc[_0xa750('0x46')](_0x401125);}})[_0xa750('0x22')](function(_0x49e132){if(_0x49e132){return _0x49e132?{'count':_0x1a79a9,'rows':_0x49e132}:null;}})[_0xa750('0x22')](respondWithResult(_0x58eba1,null))['catch'](handleError(_0x58eba1,null));};exports[_0xa750('0x47')]=function(_0x2d488d,_0xbe7451,_0x5845c5){if(_0x2d488d[_0xa750('0x44')]['id']){delete _0x2d488d[_0xa750('0x44')]['id'];}return db[_0xa750('0x27')][_0xa750('0x48')]({'where':{'id':_0x2d488d[_0xa750('0x41')]['id']}})[_0xa750('0x22')](handleEntityNotFound(_0xbe7451,null))['then'](function(_0x3001d7){if(_0x3001d7){_0x2d488d[_0xa750('0x44')]['AccountId']=_0x3001d7['id'];_0x2d488d[_0xa750('0x44')][_0xa750('0x49')]=integrations[_0xa750('0x4a')](_0x2d488d[_0xa750('0x44')][_0xa750('0x4b')],_0x2d488d[_0xa750('0x44')][_0xa750('0x39')]);_0x2d488d[_0xa750('0x44')][_0xa750('0x4c')]=integrations[_0xa750('0x4d')](_0x2d488d[_0xa750('0x44')]['channel'],_0x2d488d['body'][_0xa750('0x39')]);return db[_0xa750('0x45')][_0xa750('0x43')](_0x2d488d[_0xa750('0x44')],{'include':[{'model':db['ZendeskField'],'as':_0xa750('0x49')},{'model':db[_0xa750('0x4e')],'as':_0xa750('0x4c')}]});}return null;})[_0xa750('0x22')](respondWithResult(_0xbe7451,null))[_0xa750('0x3f')](handleError(_0xbe7451,null));};exports[_0xa750('0x4f')]=function(_0x17b25e,_0x5d883d,_0x1dcc15){var _0x2783b9='';return db[_0xa750('0x27')]['findOne']({'where':{'id':_0x17b25e['params']['id']},'attributes':['id',_0xa750('0x50'),'password','token',_0xa750('0x51'),_0xa750('0x52')]})[_0xa750('0x22')](handleEntityNotFound(_0x5d883d,null))[_0xa750('0x22')](function(_0x292dab){if(_0x292dab){_0x2783b9=_0x292dab['remoteUri'];var _0x3ac9a2=_0x2783b9[_0xa750('0x53')](-0x1);if(_0x3ac9a2==='/'){_0x2783b9=_0x2783b9[_0xa750('0x54')](0x0,_0x2783b9[_0xa750('0x55')](_0x3ac9a2));}var _0x439dce={'method':_0xa750('0x56'),'uri':util['format']('%s/%s',_0x2783b9,_0xa750('0x57')),'json':!![]};switch(_0x292dab[_0xa750('0x51')]){case _0xa750('0x58'):_0x439dce[_0xa750('0x59')]={'Authorization':util[_0xa750('0x5a')](_0xa750('0x5b'),new Buffer(util[_0xa750('0x5a')](_0xa750('0x5c'),_0x292dab['username'],_0x292dab[_0xa750('0x58')]))['toString']('base64'))};break;case _0xa750('0x5d'):_0x439dce[_0xa750('0x59')]={'Authorization':util[_0xa750('0x5a')](_0xa750('0x5b'),new Buffer(util['format'](_0xa750('0x5e'),_0x292dab[_0xa750('0x50')],_0x292dab[_0xa750('0x5d')]))[_0xa750('0x5f')]('base64'))};break;default:throw new db[(_0xa750('0x60'))][(_0xa750('0x61'))](_0xa750('0x62'));}return rp(_0x439dce);}})[_0xa750('0x22')](function(_0x332862){if(_0x332862){var _0x14de1b=[_0xa750('0x63'),_0xa750('0x64'),'group','assignee'];_[_0xa750('0x65')](_0x332862['ticket_fields'],function(_0x2c4114){return _0x14de1b[_0xa750('0x66')](_0x2c4114['type']);});return{'count':_0x332862[_0xa750('0x57')]['length'],'rows':_[_0xa750('0x26')](_0x332862[_0xa750('0x57')],function(_0x77110){return{'id':_0x77110['id'],'name':_0x77110['position']>0x7?_0x77110[_0xa750('0x67')]:_0x77110[_0xa750('0x39')],'custom':_0x77110[_0xa750('0x68')]>0x7?!![]:![],'options':_0x77110[_0xa750('0x69')]?_0x77110['system_field_options']:_0x77110['custom_field_options']?_0x77110['custom_field_options']:[]};})};}})[_0xa750('0x22')](respondWithResult(_0x5d883d,null))[_0xa750('0x3f')](function(_0x5387dc){var _0x12cae9=_0x17b25e[_0xa750('0x2c')][_0xa750('0x6a')]?0x1f4:_0x5387dc[_0xa750('0x6b')]||0x1f4;logger[_0xa750('0x23')](_0xa750('0x6c'),'getFields',_0x12cae9,JSON[_0xa750('0x6d')](_0x5387dc));delete _0x5387dc[_0xa750('0x24')];if(_0x12cae9===0x191){_0x12cae9=0x190;}_0x5d883d[_0xa750('0x17')](_0x12cae9)['send'](_0x17b25e[_0xa750('0x2c')][_0xa750('0x6a')]?{'message':_0xa750('0x6e'),'statusCode':_0x5387dc[_0xa750('0x6b')]}:_0x5387dc);});}; \ No newline at end of file +var _0xc900=['query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','intersection','includeAll','find','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','password','token','authType','remoteUri','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','username','toString','base64','ValidationError','Unknown\x20authentication\x20type','subject','group','remove','includes','title','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ZendeskAccount','fieldName','type','model'];(function(_0x4b8fc4,_0x213d45){var _0x35fbef=function(_0x4ab1bb){while(--_0x4ab1bb){_0x4b8fc4['push'](_0x4b8fc4['shift']());}};_0x35fbef(++_0x213d45);}(_0xc900,0xb3));var _0x0c90=function(_0x20542b,_0x134597){_0x20542b=_0x20542b-0x0;var _0x1890f6=_0xc900[_0x20542b];return _0x1890f6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c90('0x0'));var jsonpatch=require(_0x0c90('0x1'));var rp=require(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var Mustache=require(_0x0c90('0x4'));var util=require('util');var path=require(_0x0c90('0x5'));var sox=require(_0x0c90('0x6'));var csv=require(_0x0c90('0x7'));var ejs=require(_0x0c90('0x8'));var fs=require('fs');var fs_extra=require(_0x0c90('0x9'));var _=require(_0x0c90('0xa'));var squel=require('squel');var crypto=require(_0x0c90('0xb'));var jsforce=require(_0x0c90('0xc'));var deskjs=require(_0x0c90('0xd'));var toCsv=require(_0x0c90('0x7'));var querystring=require(_0x0c90('0xe'));var Papa=require(_0x0c90('0xf'));var Redis=require(_0x0c90('0x10'));var authService=require(_0x0c90('0x11'));var qs=require(_0x0c90('0x12'));var as=require(_0x0c90('0x13'));var hardwareService=require(_0x0c90('0x14'));var logger=require(_0x0c90('0x15'))(_0x0c90('0x16'));var utils=require('../../config/utils');var config=require(_0x0c90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c90('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x459cdb,_0x26fc46){_0x26fc46=_0x26fc46||0xcc;return function(_0x4535a2){if(_0x4535a2){return _0x459cdb[_0x0c90('0x19')](_0x26fc46);}return _0x459cdb[_0x0c90('0x1a')](_0x26fc46)['end']();};}function respondWithResult(_0x467b32,_0x4451e0){_0x4451e0=_0x4451e0||0xc8;return function(_0x4f35f4){if(_0x4f35f4){return _0x467b32[_0x0c90('0x1a')](_0x4451e0)[_0x0c90('0x1b')](_0x4f35f4);}};}function respondWithFilteredResult(_0x3bd5e8,_0x5bef7d){return function(_0x5daeb7){if(_0x5daeb7){var _0x412635=typeof _0x5bef7d[_0x0c90('0x1c')]===_0x0c90('0x1d')&&typeof _0x5bef7d[_0x0c90('0x1e')]===_0x0c90('0x1d');var _0x2cab22=_0x5daeb7[_0x0c90('0x1f')];var _0x57b9a6=_0x412635?0x0:_0x5bef7d[_0x0c90('0x1c')];var _0x38becc=_0x412635?_0x5daeb7[_0x0c90('0x1f')]:_0x5bef7d[_0x0c90('0x1c')]+_0x5bef7d['limit'];var _0x10a775;if(_0x38becc>=_0x2cab22){_0x38becc=_0x2cab22;_0x10a775=0xc8;}else{_0x10a775=0xce;}_0x3bd5e8[_0x0c90('0x1a')](_0x10a775);return _0x3bd5e8[_0x0c90('0x20')](_0x0c90('0x21'),_0x57b9a6+'-'+_0x38becc+'/'+_0x2cab22)[_0x0c90('0x1b')](_0x5daeb7);}return null;};}function patchUpdates(_0xc08f54){return function(_0x4cc940){try{jsonpatch[_0x0c90('0x22')](_0x4cc940,_0xc08f54,!![]);}catch(_0x4d629f){return BPromise[_0x0c90('0x23')](_0x4d629f);}return _0x4cc940[_0x0c90('0x24')]();};}function saveUpdates(_0x47b13c,_0x2a053a){return function(_0x43ddc3){if(_0x43ddc3){return _0x43ddc3[_0x0c90('0x25')](_0x47b13c)[_0x0c90('0x26')](function(_0x212164){return _0x212164;});}return null;};}function removeEntity(_0x3b287c,_0x4dfbc3){return function(_0x26f0a3){if(_0x26f0a3){return _0x26f0a3[_0x0c90('0x27')]()['then'](function(){_0x3b287c['status'](0xcc)[_0x0c90('0x28')]();});}};}function handleEntityNotFound(_0x3ea861,_0x35c243){return function(_0x109a5f){if(!_0x109a5f){_0x3ea861['sendStatus'](0x194);}return _0x109a5f;};}function handleError(_0x2dfa14,_0x438652){_0x438652=_0x438652||0x1f4;return function(_0xeb7f58){logger[_0x0c90('0x29')](_0xeb7f58[_0x0c90('0x2a')]);if(_0xeb7f58[_0x0c90('0x2b')]){delete _0xeb7f58['name'];}_0x2dfa14[_0x0c90('0x1a')](_0x438652)[_0x0c90('0x2c')](_0xeb7f58);};}exports[_0x0c90('0x2d')]=function(_0x13b377,_0x52d28d){var _0x4c8603={},_0x1f27f1={},_0x25da6e={'count':0x0,'rows':[]};var _0x3bff04=_[_0x0c90('0x2e')](db[_0x0c90('0x2f')]['rawAttributes'],function(_0x120136){return{'name':_0x120136[_0x0c90('0x30')],'type':_0x120136[_0x0c90('0x31')]['key']};});_0x1f27f1[_0x0c90('0x32')]=_['map'](_0x3bff04,'name');_0x1f27f1[_0x0c90('0x33')]=_[_0x0c90('0x34')](_0x13b377[_0x0c90('0x33')]);_0x1f27f1[_0x0c90('0x35')]=_['intersection'](_0x1f27f1[_0x0c90('0x32')],_0x1f27f1['query']);_0x4c8603[_0x0c90('0x36')]=_['intersection'](_0x1f27f1[_0x0c90('0x32')],qs[_0x0c90('0x37')](_0x13b377['query'][_0x0c90('0x37')]));_0x4c8603[_0x0c90('0x36')]=_0x4c8603[_0x0c90('0x36')][_0x0c90('0x38')]?_0x4c8603[_0x0c90('0x36')]:_0x1f27f1[_0x0c90('0x32')];if(!_0x13b377[_0x0c90('0x33')][_0x0c90('0x39')]('nolimit')){_0x4c8603[_0x0c90('0x1e')]=qs[_0x0c90('0x1e')](_0x13b377[_0x0c90('0x33')][_0x0c90('0x1e')]);_0x4c8603['offset']=qs[_0x0c90('0x1c')](_0x13b377[_0x0c90('0x33')][_0x0c90('0x1c')]);}_0x4c8603[_0x0c90('0x3a')]=qs[_0x0c90('0x3b')](_0x13b377[_0x0c90('0x33')][_0x0c90('0x3b')]);_0x4c8603[_0x0c90('0x3c')]=qs['filters'](_[_0x0c90('0x3d')](_0x13b377[_0x0c90('0x33')],_0x1f27f1['filters']),_0x3bff04);if(_0x13b377[_0x0c90('0x33')][_0x0c90('0x3e')]){_0x4c8603[_0x0c90('0x3c')]=_[_0x0c90('0x3f')](_0x4c8603[_0x0c90('0x3c')],{'$or':_['map'](_0x3bff04,function(_0x2f1d95){if(_0x2f1d95[_0x0c90('0x31')]!==_0x0c90('0x40')){var _0x2bca69={};_0x2bca69[_0x2f1d95[_0x0c90('0x2b')]]={'$like':'%'+_0x13b377[_0x0c90('0x33')][_0x0c90('0x3e')]+'%'};return _0x2bca69;}})});}_0x4c8603=_[_0x0c90('0x3f')]({},_0x4c8603,_0x13b377[_0x0c90('0x41')]);var _0x4f0227={'where':_0x4c8603[_0x0c90('0x3c')]};return db['ZendeskAccount'][_0x0c90('0x1f')](_0x4f0227)['then'](function(_0xb126ef){_0x25da6e[_0x0c90('0x1f')]=_0xb126ef;if(_0x13b377['query']['includeAll']){_0x4c8603[_0x0c90('0x42')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x0c90('0x43')](_0x4c8603);})[_0x0c90('0x26')](function(_0x373f9f){_0x25da6e['rows']=_0x373f9f;return _0x25da6e;})[_0x0c90('0x26')](respondWithFilteredResult(_0x52d28d,_0x4c8603))[_0x0c90('0x44')](handleError(_0x52d28d,null));};exports[_0x0c90('0x45')]=function(_0x3e5137,_0x2139c3){var _0x1184c4={'raw':![],'where':{'id':_0x3e5137[_0x0c90('0x46')]['id']}},_0x565b10={};_0x565b10[_0x0c90('0x32')]=_[_0x0c90('0x34')](db[_0x0c90('0x2f')][_0x0c90('0x47')]);_0x565b10[_0x0c90('0x33')]=_[_0x0c90('0x34')](_0x3e5137['query']);_0x565b10[_0x0c90('0x35')]=_['intersection'](_0x565b10[_0x0c90('0x32')],_0x565b10[_0x0c90('0x33')]);_0x1184c4[_0x0c90('0x36')]=_[_0x0c90('0x48')](_0x565b10[_0x0c90('0x32')],qs[_0x0c90('0x37')](_0x3e5137[_0x0c90('0x33')][_0x0c90('0x37')]));_0x1184c4[_0x0c90('0x36')]=_0x1184c4[_0x0c90('0x36')][_0x0c90('0x38')]?_0x1184c4[_0x0c90('0x36')]:_0x565b10[_0x0c90('0x32')];if(_0x3e5137[_0x0c90('0x33')][_0x0c90('0x49')]){_0x1184c4['include']=[{'all':!![]}];}_0x1184c4=_[_0x0c90('0x3f')]({},_0x1184c4,_0x3e5137[_0x0c90('0x41')]);return db[_0x0c90('0x2f')][_0x0c90('0x4a')](_0x1184c4)[_0x0c90('0x26')](handleEntityNotFound(_0x2139c3,null))[_0x0c90('0x26')](respondWithResult(_0x2139c3,null))[_0x0c90('0x44')](handleError(_0x2139c3,null));};exports[_0x0c90('0x4b')]=function(_0x3bb138,_0x3af64f){return db[_0x0c90('0x2f')][_0x0c90('0x4b')](_0x3bb138[_0x0c90('0x4c')],{})[_0x0c90('0x26')](respondWithResult(_0x3af64f,0xc9))['catch'](handleError(_0x3af64f,null));};exports[_0x0c90('0x25')]=function(_0x38f492,_0x553fea){if(_0x38f492['body']['id']){delete _0x38f492['body']['id'];}return db[_0x0c90('0x2f')][_0x0c90('0x4a')]({'where':{'id':_0x38f492[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0x553fea,null))[_0x0c90('0x26')](saveUpdates(_0x38f492['body'],null))[_0x0c90('0x26')](respondWithResult(_0x553fea,null))[_0x0c90('0x44')](handleError(_0x553fea,null));};exports[_0x0c90('0x27')]=function(_0x549c78,_0x119776){return db[_0x0c90('0x2f')][_0x0c90('0x4a')]({'where':{'id':_0x549c78[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0x119776,null))[_0x0c90('0x26')](removeEntity(_0x119776,null))[_0x0c90('0x44')](handleError(_0x119776,null));};exports[_0x0c90('0x4d')]=function(_0x1daeed,_0xeeee3b,_0x5e288e){var _0xac80b2={};var _0x4ba9e7={};var _0xda4331;var _0x67539d;return db[_0x0c90('0x2f')][_0x0c90('0x4e')]({'where':{'id':_0x1daeed[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0xeeee3b,null))['then'](function(_0x4930fc){if(_0x4930fc){_0xda4331=_0x4930fc;_0x4ba9e7['model']=_['keys'](db[_0x0c90('0x4f')][_0x0c90('0x47')]);_0x4ba9e7[_0x0c90('0x33')]=_['keys'](_0x1daeed[_0x0c90('0x33')]);_0x4ba9e7[_0x0c90('0x35')]=_['intersection'](_0x4ba9e7[_0x0c90('0x32')],_0x4ba9e7['query']);_0xac80b2[_0x0c90('0x36')]=_[_0x0c90('0x48')](_0x4ba9e7[_0x0c90('0x32')],qs[_0x0c90('0x37')](_0x1daeed['query'][_0x0c90('0x37')]));_0xac80b2['attributes']=_0xac80b2[_0x0c90('0x36')][_0x0c90('0x38')]?_0xac80b2['attributes']:_0x4ba9e7['model'];_0xac80b2['order']=qs[_0x0c90('0x3b')](_0x1daeed[_0x0c90('0x33')][_0x0c90('0x3b')]);_0xac80b2[_0x0c90('0x3c')]=qs[_0x0c90('0x35')](_['pick'](_0x1daeed[_0x0c90('0x33')],_0x4ba9e7[_0x0c90('0x35')]));if(_0x1daeed['query'][_0x0c90('0x3e')]){_0xac80b2['where']=_[_0x0c90('0x3f')](_0xac80b2[_0x0c90('0x3c')],{'$or':_['map'](_0xac80b2[_0x0c90('0x36')],function(_0x5baf85){var _0x4de11a={};_0x4de11a[_0x5baf85]={'$like':'%'+_0x1daeed['query'][_0x0c90('0x3e')]+'%'};return _0x4de11a;})});}_0xac80b2=_[_0x0c90('0x3f')]({},_0xac80b2,_0x1daeed[_0x0c90('0x41')]);return _0xda4331[_0x0c90('0x4d')](_0xac80b2);}})['then'](function(_0x5b385b){if(_0x5b385b){_0x67539d=_0x5b385b[_0x0c90('0x38')];if(!_0x1daeed[_0x0c90('0x33')][_0x0c90('0x39')]('nolimit')){_0xac80b2[_0x0c90('0x1e')]=qs[_0x0c90('0x1e')](_0x1daeed[_0x0c90('0x33')]['limit']);_0xac80b2[_0x0c90('0x1c')]=qs[_0x0c90('0x1c')](_0x1daeed[_0x0c90('0x33')]['offset']);}return _0xda4331[_0x0c90('0x4d')](_0xac80b2);}})[_0x0c90('0x26')](function(_0x1a198b){if(_0x1a198b){return _0x1a198b?{'count':_0x67539d,'rows':_0x1a198b}:null;}})[_0x0c90('0x26')](respondWithResult(_0xeeee3b,null))[_0x0c90('0x44')](handleError(_0xeeee3b,null));};exports[_0x0c90('0x50')]=function(_0x19f4ac,_0x143e0d,_0x181fe3){if(_0x19f4ac['body']['id']){delete _0x19f4ac['body']['id'];}return db[_0x0c90('0x2f')][_0x0c90('0x4e')]({'where':{'id':_0x19f4ac[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0x143e0d,null))[_0x0c90('0x26')](function(_0x2dad30){if(_0x2dad30){_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x51')]=_0x2dad30['id'];_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x52')]=integrations[_0x0c90('0x53')](_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x54')],_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x31')]);_0x19f4ac['body'][_0x0c90('0x55')]=integrations[_0x0c90('0x56')](_0x19f4ac[_0x0c90('0x4c')]['channel'],_0x19f4ac['body'][_0x0c90('0x31')]);return db['ZendeskConfiguration'][_0x0c90('0x4b')](_0x19f4ac[_0x0c90('0x4c')],{'include':[{'model':db['ZendeskField'],'as':_0x0c90('0x52')},{'model':db[_0x0c90('0x57')],'as':_0x0c90('0x55')}]});}return null;})[_0x0c90('0x26')](respondWithResult(_0x143e0d,null))['catch'](handleError(_0x143e0d,null));};exports['getFields']=function(_0x5f32d6,_0x16b38a,_0x2d3287){var _0x3bc90d='';return db[_0x0c90('0x2f')]['findOne']({'where':{'id':_0x5f32d6[_0x0c90('0x46')]['id']},'attributes':['id','username',_0x0c90('0x58'),_0x0c90('0x59'),_0x0c90('0x5a'),'remoteUri']})[_0x0c90('0x26')](handleEntityNotFound(_0x16b38a,null))[_0x0c90('0x26')](function(_0x2da9f9){if(_0x2da9f9){_0x3bc90d=_0x2da9f9[_0x0c90('0x5b')];var _0x57c3b3=_0x3bc90d['slice'](-0x1);if(_0x57c3b3==='/'){_0x3bc90d=_0x3bc90d[_0x0c90('0x5c')](0x0,_0x3bc90d['lastIndexOf'](_0x57c3b3));}var _0x3254c0={'method':_0x0c90('0x5d'),'uri':util[_0x0c90('0x5e')](_0x0c90('0x5f'),_0x3bc90d,_0x0c90('0x60')),'json':!![]};switch(_0x2da9f9[_0x0c90('0x5a')]){case _0x0c90('0x58'):_0x3254c0[_0x0c90('0x61')]={'Authorization':util[_0x0c90('0x5e')](_0x0c90('0x62'),new Buffer(util['format'](_0x0c90('0x63'),_0x2da9f9[_0x0c90('0x64')],_0x2da9f9[_0x0c90('0x58')]))[_0x0c90('0x65')](_0x0c90('0x66')))};break;case _0x0c90('0x59'):_0x3254c0[_0x0c90('0x61')]={'Authorization':util[_0x0c90('0x5e')](_0x0c90('0x62'),new Buffer(util[_0x0c90('0x5e')]('%s/token:%s',_0x2da9f9[_0x0c90('0x64')],_0x2da9f9[_0x0c90('0x59')]))[_0x0c90('0x65')](_0x0c90('0x66')))};break;default:throw new db['Sequelize'][(_0x0c90('0x67'))](_0x0c90('0x68'));}return rp(_0x3254c0);}})[_0x0c90('0x26')](function(_0x48a32f){if(_0x48a32f){var _0x40866c=[_0x0c90('0x69'),'description',_0x0c90('0x6a'),'assignee'];_[_0x0c90('0x6b')](_0x48a32f['ticket_fields'],function(_0x5633a4){return _0x40866c[_0x0c90('0x6c')](_0x5633a4[_0x0c90('0x31')]);});return{'count':_0x48a32f['ticket_fields']['length'],'rows':_[_0x0c90('0x2e')](_0x48a32f[_0x0c90('0x60')],function(_0x5d80b9){return{'id':_0x5d80b9['id'],'name':_0x5d80b9['position']>0x7?_0x5d80b9[_0x0c90('0x6d')]:_0x5d80b9['type'],'custom':_0x5d80b9[_0x0c90('0x6e')]>0x7?!![]:![],'options':_0x5d80b9[_0x0c90('0x6f')]?_0x5d80b9[_0x0c90('0x6f')]:_0x5d80b9[_0x0c90('0x70')]?_0x5d80b9[_0x0c90('0x70')]:[]};})};}})['then'](respondWithResult(_0x16b38a,null))[_0x0c90('0x44')](function(_0x142268){var _0x3aed3c=_0x5f32d6['query']['test']?0x1f4:_0x142268[_0x0c90('0x71')]||0x1f4;logger[_0x0c90('0x29')](_0x0c90('0x72'),'getFields',_0x3aed3c,JSON['stringify'](_0x142268));delete _0x142268['name'];if(_0x3aed3c===0x191){_0x3aed3c=0x190;}_0x16b38a[_0x0c90('0x1a')](_0x3aed3c)['send'](_0x5f32d6['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x142268[_0x0c90('0x71')]}:_0x142268);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 489abc0..49062b9 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 _0x4870=['define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','./intZendeskAccount.attributes'];(function(_0x5e518a,_0x1fafaf){var _0x1cea1a=function(_0x258ca8){while(--_0x258ca8){_0x5e518a['push'](_0x5e518a['shift']());}};_0x1cea1a(++_0x1fafaf);}(_0x4870,0x8f));var _0x0487=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x4870[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x0487('0x0'));var util=require(_0x0487('0x1'));var logger=require(_0x0487('0x2'))(_0x0487('0x3'));var moment=require(_0x0487('0x4'));var BPromise=require('bluebird');var rp=require(_0x0487('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0487('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2a34d3,_0x2aaf49){return _0x2a34d3[_0x0487('0x7')](_0x0487('0x8'),attributes,{'tableName':_0x0487('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ae1=['int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount'];(function(_0x1ab751,_0x2e3233){var _0x42fe67=function(_0x199491){while(--_0x199491){_0x1ab751['push'](_0x1ab751['shift']());}};_0x42fe67(++_0x2e3233);}(_0x4ae1,0x12c));var _0x14ae=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0x4ae1[_0x1d1d09];return _0x8827e;};'use strict';var _=require(_0x14ae('0x0'));var util=require(_0x14ae('0x1'));var logger=require(_0x14ae('0x2'))(_0x14ae('0x3'));var moment=require(_0x14ae('0x4'));var BPromise=require(_0x14ae('0x5'));var rp=require(_0x14ae('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x14ae('0x7'));var config=require('../../config/environment');var attributes=require(_0x14ae('0x8'));var integrations=require(_0x14ae('0x9'));module[_0x14ae('0xa')]=function(_0x1c5a6d,_0x42e444){return _0x1c5a6d['define'](_0x14ae('0xb'),attributes,{'tableName':_0x14ae('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 7dac07e..46b3543 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 _0xe590=['../../config/environment','jayson/promise','client','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','attributes','include','map','model','then','debug','ShowZendeskAccount','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x25981c,_0x5598e0){var _0x3741c3=function(_0x1587ce){while(--_0x1587ce){_0x25981c['push'](_0x25981c['shift']());}};_0x3741c3(++_0x5598e0);}(_0xe590,0x198));var _0x0e59=function(_0x387060,_0x488694){_0x387060=_0x387060-0x0;var _0x45db0b=_0xe590[_0x387060];return _0x45db0b;};'use strict';var _=require(_0x0e59('0x0'));var util=require(_0x0e59('0x1'));var moment=require(_0x0e59('0x2'));var BPromise=require(_0x0e59('0x3'));var rs=require(_0x0e59('0x4'));var fs=require('fs');var Redis=require(_0x0e59('0x5'));var db=require(_0x0e59('0x6'))['db'];var utils=require(_0x0e59('0x7'));var logger=require(_0x0e59('0x8'))(_0x0e59('0x9'));var config=require(_0x0e59('0xa'));var jayson=require(_0x0e59('0xb'));var client=jayson[_0x0e59('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe20d45,_0x3da0ff,_0x592ae3){return new BPromise(function(_0xc234b4,_0x25c75e){return client[_0x0e59('0xd')](_0xe20d45,_0x592ae3)['then'](function(_0x4c9bce){logger[_0x0e59('0xe')](_0x0e59('0xf'),_0x3da0ff,_0x0e59('0x10'));logger['debug'](_0x0e59('0x11'),_0x3da0ff,_0x0e59('0x10'),JSON[_0x0e59('0x12')](_0x4c9bce));if(_0x4c9bce[_0x0e59('0x13')]){if(_0x4c9bce[_0x0e59('0x13')][_0x0e59('0x14')]===0x1f4){logger[_0x0e59('0x13')](_0x0e59('0xf'),_0x3da0ff,_0x4c9bce[_0x0e59('0x13')]['message']);return _0x25c75e(_0x4c9bce[_0x0e59('0x13')][_0x0e59('0x15')]);}logger[_0x0e59('0x13')](_0x0e59('0xf'),_0x3da0ff,_0x4c9bce[_0x0e59('0x13')]['message']);return _0xc234b4(_0x4c9bce[_0x0e59('0x13')][_0x0e59('0x15')]);}else{logger[_0x0e59('0xe')](_0x0e59('0xf'),_0x3da0ff,_0x0e59('0x10'));_0xc234b4(_0x4c9bce[_0x0e59('0x16')][_0x0e59('0x15')]);}})[_0x0e59('0x17')](function(_0x13aa73){logger['error'](_0x0e59('0xf'),_0x3da0ff,_0x13aa73);_0x25c75e(_0x13aa73);});});}exports[_0x0e59('0x18')]=function(_0x59d5c8){var _0x652e99=this;return new Promise(function(_0x3d6d7e,_0x2ecb98){return db[_0x0e59('0x19')][_0x0e59('0x1a')]({'raw':_0x59d5c8[_0x0e59('0x1b')]?_0x59d5c8[_0x0e59('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x59d5c8[_0x0e59('0x1b')]?_0x59d5c8[_0x0e59('0x1b')]['where']||null:null,'attributes':_0x59d5c8[_0x0e59('0x1b')]?_0x59d5c8[_0x0e59('0x1b')][_0x0e59('0x1c')]||null:null,'limit':_0x59d5c8[_0x0e59('0x1b')]?_0x59d5c8[_0x0e59('0x1b')]['limit']||null:null,'include':_0x59d5c8[_0x0e59('0x1b')]?_0x59d5c8[_0x0e59('0x1b')][_0x0e59('0x1d')]?_[_0x0e59('0x1e')](_0x59d5c8[_0x0e59('0x1b')][_0x0e59('0x1d')],function(_0x293794){return{'model':db[_0x293794[_0x0e59('0x1f')]],'as':_0x293794['as'],'attributes':_0x293794['attributes'],'include':_0x293794['include']?_[_0x0e59('0x1e')](_0x293794[_0x0e59('0x1d')],function(_0x56e714){return{'model':db[_0x56e714['model']],'as':_0x56e714['as'],'attributes':_0x56e714[_0x0e59('0x1c')],'include':_0x56e714['include']?_[_0x0e59('0x1e')](_0x56e714[_0x0e59('0x1d')],function(_0x509cf8){return{'model':db[_0x509cf8[_0x0e59('0x1f')]],'as':_0x509cf8['as'],'attributes':_0x509cf8[_0x0e59('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0e59('0x20')](function(_0x1cac32){logger[_0x0e59('0xe')]('GetZendeskAccount',_0x59d5c8);logger[_0x0e59('0x21')](_0x0e59('0x18'),_0x59d5c8,JSON[_0x0e59('0x12')](_0x1cac32));_0x3d6d7e(_0x1cac32);})[_0x0e59('0x17')](function(_0x309dc3){logger[_0x0e59('0x13')](_0x0e59('0x18'),_0x309dc3[_0x0e59('0x15')],_0x59d5c8);_0x2ecb98(_0x652e99[_0x0e59('0x13')](0x1f4,_0x309dc3[_0x0e59('0x15')]));});});};exports[_0x0e59('0x22')]=function(_0x365b85){var _0x4cbb73=this;return new Promise(function(_0x32a1e1,_0x4d7da2){return db[_0x0e59('0x19')][_0x0e59('0x23')]({'raw':_0x365b85[_0x0e59('0x1b')]?_0x365b85['options'][_0x0e59('0x24')]===undefined?!![]:![]:!![],'where':_0x365b85[_0x0e59('0x1b')]?_0x365b85[_0x0e59('0x1b')][_0x0e59('0x25')]||null:null,'attributes':_0x365b85[_0x0e59('0x1b')]?_0x365b85['options']['attributes']||null:null,'include':_0x365b85[_0x0e59('0x1b')]?_0x365b85[_0x0e59('0x1b')][_0x0e59('0x1d')]?_[_0x0e59('0x1e')](_0x365b85['options'][_0x0e59('0x1d')],function(_0x570adf){return{'model':db[_0x570adf[_0x0e59('0x1f')]],'as':_0x570adf['as'],'attributes':_0x570adf[_0x0e59('0x1c')],'include':_0x570adf[_0x0e59('0x1d')]?_[_0x0e59('0x1e')](_0x570adf['include'],function(_0x51da15){return{'model':db[_0x51da15[_0x0e59('0x1f')]],'as':_0x51da15['as'],'attributes':_0x51da15[_0x0e59('0x1c')],'include':_0x51da15['include']?_[_0x0e59('0x1e')](_0x51da15[_0x0e59('0x1d')],function(_0x410bd5){return{'model':db[_0x410bd5['model']],'as':_0x410bd5['as'],'attributes':_0x410bd5['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e59('0x20')](function(_0x395d9e){logger[_0x0e59('0xe')](_0x0e59('0x22'),_0x365b85);logger[_0x0e59('0x21')](_0x0e59('0x22'),_0x365b85,JSON[_0x0e59('0x12')](_0x395d9e));_0x32a1e1(_0x395d9e);})[_0x0e59('0x17')](function(_0x4466f9){logger[_0x0e59('0x13')](_0x0e59('0x22'),_0x4466f9[_0x0e59('0x15')],_0x365b85);_0x4d7da2(_0x4cbb73[_0x0e59('0x13')](0x1f4,_0x4466f9[_0x0e59('0x15')]));});});}; \ No newline at end of file +var _0xffc9=['client','http','request','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskAccount,\x20%s,\x20%s','message','info','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit','map','include','model','then','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise'];(function(_0x4c6cf0,_0x826f70){var _0x108145=function(_0x299f69){while(--_0x299f69){_0x4c6cf0['push'](_0x4c6cf0['shift']());}};_0x108145(++_0x826f70);}(_0xffc9,0xa6));var _0x9ffc=function(_0x5149c7,_0xfd2f67){_0x5149c7=_0x5149c7-0x0;var _0x5010b0=_0xffc9[_0x5149c7];return _0x5010b0;};'use strict';var _=require(_0x9ffc('0x0'));var util=require(_0x9ffc('0x1'));var moment=require(_0x9ffc('0x2'));var BPromise=require(_0x9ffc('0x3'));var rs=require(_0x9ffc('0x4'));var fs=require('fs');var Redis=require(_0x9ffc('0x5'));var db=require(_0x9ffc('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9ffc('0x7'));var config=require('../../config/environment');var jayson=require(_0x9ffc('0x8'));var client=jayson[_0x9ffc('0x9')][_0x9ffc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42ad09,_0x398c5c,_0x598d6e){return new BPromise(function(_0x34e88d,_0xc00f68){return client[_0x9ffc('0xb')](_0x42ad09,_0x598d6e)['then'](function(_0x3e26b1){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x398c5c,_0x9ffc('0xc'));logger[_0x9ffc('0xd')](_0x9ffc('0xe'),_0x398c5c,_0x9ffc('0xc'),JSON[_0x9ffc('0xf')](_0x3e26b1));if(_0x3e26b1['error']){if(_0x3e26b1[_0x9ffc('0x10')]['code']===0x1f4){logger[_0x9ffc('0x10')](_0x9ffc('0x11'),_0x398c5c,_0x3e26b1[_0x9ffc('0x10')]['message']);return _0xc00f68(_0x3e26b1['error'][_0x9ffc('0x12')]);}logger[_0x9ffc('0x10')](_0x9ffc('0x11'),_0x398c5c,_0x3e26b1['error'][_0x9ffc('0x12')]);return _0x34e88d(_0x3e26b1[_0x9ffc('0x10')]['message']);}else{logger[_0x9ffc('0x13')](_0x9ffc('0x11'),_0x398c5c,_0x9ffc('0xc'));_0x34e88d(_0x3e26b1[_0x9ffc('0x14')][_0x9ffc('0x12')]);}})[_0x9ffc('0x15')](function(_0x95cbfc){logger[_0x9ffc('0x10')](_0x9ffc('0x11'),_0x398c5c,_0x95cbfc);_0xc00f68(_0x95cbfc);});});}exports[_0x9ffc('0x16')]=function(_0x5b9d64){var _0x5d33e1=this;return new Promise(function(_0x2955ed,_0x16d0a6){return db[_0x9ffc('0x17')][_0x9ffc('0x18')]({'raw':_0x5b9d64[_0x9ffc('0x19')]?_0x5b9d64[_0x9ffc('0x19')][_0x9ffc('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b9d64[_0x9ffc('0x19')]?_0x5b9d64[_0x9ffc('0x19')]['where']||null:null,'attributes':_0x5b9d64[_0x9ffc('0x19')]?_0x5b9d64[_0x9ffc('0x19')][_0x9ffc('0x1b')]||null:null,'limit':_0x5b9d64[_0x9ffc('0x19')]?_0x5b9d64[_0x9ffc('0x19')][_0x9ffc('0x1c')]||null:null,'include':_0x5b9d64[_0x9ffc('0x19')]?_0x5b9d64[_0x9ffc('0x19')]['include']?_[_0x9ffc('0x1d')](_0x5b9d64[_0x9ffc('0x19')][_0x9ffc('0x1e')],function(_0x2c82a2){return{'model':db[_0x2c82a2[_0x9ffc('0x1f')]],'as':_0x2c82a2['as'],'attributes':_0x2c82a2[_0x9ffc('0x1b')],'include':_0x2c82a2[_0x9ffc('0x1e')]?_[_0x9ffc('0x1d')](_0x2c82a2[_0x9ffc('0x1e')],function(_0x3b49f9){return{'model':db[_0x3b49f9[_0x9ffc('0x1f')]],'as':_0x3b49f9['as'],'attributes':_0x3b49f9['attributes'],'include':_0x3b49f9[_0x9ffc('0x1e')]?_[_0x9ffc('0x1d')](_0x3b49f9['include'],function(_0x17d14a){return{'model':db[_0x17d14a[_0x9ffc('0x1f')]],'as':_0x17d14a['as'],'attributes':_0x17d14a[_0x9ffc('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9ffc('0x20')](function(_0x1c1ec3){logger[_0x9ffc('0x13')](_0x9ffc('0x16'),_0x5b9d64);logger['debug'](_0x9ffc('0x16'),_0x5b9d64,JSON[_0x9ffc('0xf')](_0x1c1ec3));_0x2955ed(_0x1c1ec3);})[_0x9ffc('0x15')](function(_0x3f9593){logger['error'](_0x9ffc('0x16'),_0x3f9593[_0x9ffc('0x12')],_0x5b9d64);_0x16d0a6(_0x5d33e1[_0x9ffc('0x10')](0x1f4,_0x3f9593[_0x9ffc('0x12')]));});});};exports[_0x9ffc('0x21')]=function(_0x402593){var _0x5ed001=this;return new Promise(function(_0x1d640d,_0x1bde5e){return db[_0x9ffc('0x17')][_0x9ffc('0x22')]({'raw':_0x402593[_0x9ffc('0x19')]?_0x402593[_0x9ffc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x402593[_0x9ffc('0x19')]?_0x402593['options']['where']||null:null,'attributes':_0x402593['options']?_0x402593['options'][_0x9ffc('0x1b')]||null:null,'include':_0x402593['options']?_0x402593[_0x9ffc('0x19')][_0x9ffc('0x1e')]?_[_0x9ffc('0x1d')](_0x402593[_0x9ffc('0x19')][_0x9ffc('0x1e')],function(_0x44930f){return{'model':db[_0x44930f[_0x9ffc('0x1f')]],'as':_0x44930f['as'],'attributes':_0x44930f[_0x9ffc('0x1b')],'include':_0x44930f[_0x9ffc('0x1e')]?_[_0x9ffc('0x1d')](_0x44930f['include'],function(_0x4c9fc7){return{'model':db[_0x4c9fc7[_0x9ffc('0x1f')]],'as':_0x4c9fc7['as'],'attributes':_0x4c9fc7[_0x9ffc('0x1b')],'include':_0x4c9fc7[_0x9ffc('0x1e')]?_['map'](_0x4c9fc7[_0x9ffc('0x1e')],function(_0x2eb429){return{'model':db[_0x2eb429[_0x9ffc('0x1f')]],'as':_0x2eb429['as'],'attributes':_0x2eb429[_0x9ffc('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9ffc('0x20')](function(_0x36f250){logger['info'](_0x9ffc('0x21'),_0x402593);logger[_0x9ffc('0xd')](_0x9ffc('0x21'),_0x402593,JSON[_0x9ffc('0xf')](_0x36f250));_0x1d640d(_0x36f250);})[_0x9ffc('0x15')](function(_0x502fbd){logger[_0x9ffc('0x10')](_0x9ffc('0x21'),_0x502fbd[_0x9ffc('0x12')],_0x402593);_0x1bde5e(_0x5ed001[_0x9ffc('0x10')](0x1f4,_0x502fbd[_0x9ffc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 7db8b7e..f966de6 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 _0x750a=['getTags','post','setTags','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/tags'];(function(_0x5a6dbd,_0x41d8b8){var _0xe6b141=function(_0x434afd){while(--_0x434afd){_0x5a6dbd['push'](_0x5a6dbd['shift']());}};_0xe6b141(++_0x41d8b8);}(_0x750a,0x140));var _0xa750=function(_0x5169a6,_0x207871){_0x5169a6=_0x5169a6-0x0;var _0x569b9c=_0x750a[_0x5169a6];return _0x569b9c;};'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/subjects',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['get']('/:id/descriptions',auth[_0xa750('0x9')](),controller['getDescriptions']);router[_0xa750('0x8')](_0xa750('0xf'),auth['isAuthenticated'](),controller[_0xa750('0x10')]);router[_0xa750('0x11')]('/',auth[_0xa750('0x9')](),controller['create']);router[_0xa750('0x11')](_0xa750('0xf'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);router[_0xa750('0x13')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x14')]);router[_0xa750('0x15')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x16')]);module[_0xa750('0x17')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x3d3b05,_0x334c57){var _0x2c6ca3=function(_0x3fd1cc){while(--_0x3fd1cc){_0x3d3b05['push'](_0x3d3b05['shift']());}};_0x2c6ca3(++_0x334c57);}(_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('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 46fb007..b944319 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 _0x12cf=['exports','STRING','sequelize'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0x12cf,0x170));var _0xf12c=function(_0x1ae474,_0x30163d){_0x1ae474=_0x1ae474-0x0;var _0x50d1ff=_0x12cf[_0x1ae474];return _0x50d1ff;};'use strict';var Sequelize=require(_0xf12c('0x0'));module[_0xf12c('0x1')]={'name':{'type':Sequelize[_0xf12c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1c3b=['STRING','sequelize'];(function(_0x5a51b5,_0x1fca2e){var _0x565b31=function(_0x1fd013){while(--_0x1fd013){_0x5a51b5['push'](_0x5a51b5['shift']());}};_0x565b31(++_0x1fca2e);}(_0x1c3b,0x155));var _0xb1c3=function(_0x21a3c5,_0x37666e){_0x21a3c5=_0x21a3c5-0x0;var _0x3eecfd=_0x1c3b[_0x21a3c5];return _0x3eecfd;};'use strict';var Sequelize=require(_0xb1c3('0x0'));module['exports']={'name':{'type':Sequelize[_0xb1c3('0x1')]},'description':{'type':Sequelize[_0xb1c3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index e4451f7..c6ec18f 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 _0x2eb1=['sendStatus','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','index','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options','ZendeskConfiguration','includeAll','include','catch','show','params','length','find','create','body','getFields','ZendeskField','order','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb'];(function(_0x42211c,_0x47fd90){var _0x36809e=function(_0x46255d){while(--_0x46255d){_0x42211c['push'](_0x42211c['shift']());}};_0x36809e(++_0x47fd90);}(_0x2eb1,0xd0));var _0x12eb=function(_0x66cf2c,_0x5b406e){_0x66cf2c=_0x66cf2c-0x0;var _0x2c2760=_0x2eb1[_0x66cf2c];return _0x2c2760;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x12eb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12eb('0x1'));var rp=require(_0x12eb('0x2'));var moment=require(_0x12eb('0x3'));var BPromise=require(_0x12eb('0x4'));var Mustache=require(_0x12eb('0x5'));var util=require(_0x12eb('0x6'));var path=require(_0x12eb('0x7'));var sox=require(_0x12eb('0x8'));var csv=require(_0x12eb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x12eb('0xa'));var _=require('lodash');var squel=require(_0x12eb('0xb'));var crypto=require('crypto');var jsforce=require(_0x12eb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x12eb('0x9'));var querystring=require('querystring');var Papa=require(_0x12eb('0xd'));var Redis=require(_0x12eb('0xe'));var authService=require(_0x12eb('0xf'));var qs=require(_0x12eb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12eb('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x12eb('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x12eb('0x13'))['db'];function respondWithStatusCode(_0xcf6c37,_0x5f3f92){_0x5f3f92=_0x5f3f92||0xcc;return function(_0x5e2d52){if(_0x5e2d52){return _0xcf6c37[_0x12eb('0x14')](_0x5f3f92);}return _0xcf6c37['status'](_0x5f3f92)['end']();};}function respondWithResult(_0x10e732,_0x2bc2dd){_0x2bc2dd=_0x2bc2dd||0xc8;return function(_0x4ce879){if(_0x4ce879){return _0x10e732[_0x12eb('0x15')](_0x2bc2dd)[_0x12eb('0x16')](_0x4ce879);}};}function respondWithFilteredResult(_0xfc063d,_0x2a453a){return function(_0x5b3592){if(_0x5b3592){var _0x170176=typeof _0x2a453a[_0x12eb('0x17')]==='undefined'&&typeof _0x2a453a[_0x12eb('0x18')]==='undefined';var _0x47bb03=_0x5b3592['count'];var _0x18abb2=_0x170176?0x0:_0x2a453a[_0x12eb('0x17')];var _0x44043f=_0x170176?_0x5b3592[_0x12eb('0x19')]:_0x2a453a[_0x12eb('0x17')]+_0x2a453a['limit'];var _0x38cde1;if(_0x44043f>=_0x47bb03){_0x44043f=_0x47bb03;_0x38cde1=0xc8;}else{_0x38cde1=0xce;}_0xfc063d[_0x12eb('0x15')](_0x38cde1);return _0xfc063d[_0x12eb('0x1a')](_0x12eb('0x1b'),_0x18abb2+'-'+_0x44043f+'/'+_0x47bb03)[_0x12eb('0x16')](_0x5b3592);}return null;};}function patchUpdates(_0x44b520){return function(_0x252173){try{jsonpatch['apply'](_0x252173,_0x44b520,!![]);}catch(_0x6a5e0d){return BPromise[_0x12eb('0x1c')](_0x6a5e0d);}return _0x252173[_0x12eb('0x1d')]();};}function saveUpdates(_0x24ed4d,_0x12226a){return function(_0x2b55ac){if(_0x2b55ac){return _0x2b55ac[_0x12eb('0x1e')](_0x24ed4d)[_0x12eb('0x1f')](function(_0x3de940){return _0x3de940;});}return null;};}function removeEntity(_0x4c0b4b,_0x452fd8){return function(_0x46b357){if(_0x46b357){return _0x46b357[_0x12eb('0x20')]()[_0x12eb('0x1f')](function(){_0x4c0b4b[_0x12eb('0x15')](0xcc)[_0x12eb('0x21')]();});}};}function handleEntityNotFound(_0x438d10,_0x3f1acb){return function(_0x285e63){if(!_0x285e63){_0x438d10[_0x12eb('0x14')](0x194);}return _0x285e63;};}function handleError(_0x40d1ef,_0x268a51){_0x268a51=_0x268a51||0x1f4;return function(_0x4a8185){logger[_0x12eb('0x22')](_0x4a8185['stack']);if(_0x4a8185[_0x12eb('0x23')]){delete _0x4a8185[_0x12eb('0x23')];}_0x40d1ef[_0x12eb('0x15')](_0x268a51)['send'](_0x4a8185);};}exports[_0x12eb('0x24')]=function(_0x184173,_0x40273f){var _0x216d1b={},_0x2f2134={},_0xa1bc02={'count':0x0,'rows':[]};var _0x27962e=_['map'](db['ZendeskConfiguration'][_0x12eb('0x25')],function(_0x516b14){return{'name':_0x516b14['fieldName'],'type':_0x516b14[_0x12eb('0x26')][_0x12eb('0x27')]};});_0x2f2134[_0x12eb('0x28')]=_['map'](_0x27962e,_0x12eb('0x23'));_0x2f2134['query']=_[_0x12eb('0x29')](_0x184173[_0x12eb('0x2a')]);_0x2f2134[_0x12eb('0x2b')]=_['intersection'](_0x2f2134['model'],_0x2f2134[_0x12eb('0x2a')]);_0x216d1b[_0x12eb('0x2c')]=_[_0x12eb('0x2d')](_0x2f2134[_0x12eb('0x28')],qs[_0x12eb('0x2e')](_0x184173[_0x12eb('0x2a')][_0x12eb('0x2e')]));_0x216d1b[_0x12eb('0x2c')]=_0x216d1b['attributes']['length']?_0x216d1b[_0x12eb('0x2c')]:_0x2f2134[_0x12eb('0x28')];if(!_0x184173[_0x12eb('0x2a')][_0x12eb('0x2f')](_0x12eb('0x30'))){_0x216d1b[_0x12eb('0x18')]=qs[_0x12eb('0x18')](_0x184173[_0x12eb('0x2a')][_0x12eb('0x18')]);_0x216d1b[_0x12eb('0x17')]=qs[_0x12eb('0x17')](_0x184173[_0x12eb('0x2a')][_0x12eb('0x17')]);}_0x216d1b['order']=qs[_0x12eb('0x31')](_0x184173[_0x12eb('0x2a')][_0x12eb('0x31')]);_0x216d1b[_0x12eb('0x32')]=qs[_0x12eb('0x2b')](_[_0x12eb('0x33')](_0x184173['query'],_0x2f2134['filters']),_0x27962e);if(_0x184173[_0x12eb('0x2a')][_0x12eb('0x34')]){_0x216d1b[_0x12eb('0x32')]=_[_0x12eb('0x35')](_0x216d1b[_0x12eb('0x32')],{'$or':_[_0x12eb('0x36')](_0x27962e,function(_0x158d41){if(_0x158d41['type']!=='VIRTUAL'){var _0x48eea4={};_0x48eea4[_0x158d41[_0x12eb('0x23')]]={'$like':'%'+_0x184173[_0x12eb('0x2a')]['filter']+'%'};return _0x48eea4;}})});}_0x216d1b=_[_0x12eb('0x35')]({},_0x216d1b,_0x184173[_0x12eb('0x37')]);var _0x30f626={'where':_0x216d1b[_0x12eb('0x32')]};return db[_0x12eb('0x38')][_0x12eb('0x19')](_0x30f626)['then'](function(_0x2bf1bc){_0xa1bc02[_0x12eb('0x19')]=_0x2bf1bc;if(_0x184173[_0x12eb('0x2a')][_0x12eb('0x39')]){_0x216d1b[_0x12eb('0x3a')]=[{'all':!![]}];}return db[_0x12eb('0x38')]['findAll'](_0x216d1b);})[_0x12eb('0x1f')](function(_0x411f0e){_0xa1bc02['rows']=_0x411f0e;return _0xa1bc02;})['then'](respondWithFilteredResult(_0x40273f,_0x216d1b))[_0x12eb('0x3b')](handleError(_0x40273f,null));};exports[_0x12eb('0x3c')]=function(_0x350b9f,_0x3ab394){var _0x5bbeb5={'raw':![],'where':{'id':_0x350b9f[_0x12eb('0x3d')]['id']}},_0x43df80={};_0x43df80['model']=_[_0x12eb('0x29')](db['ZendeskConfiguration'][_0x12eb('0x25')]);_0x43df80['query']=_[_0x12eb('0x29')](_0x350b9f[_0x12eb('0x2a')]);_0x43df80[_0x12eb('0x2b')]=_[_0x12eb('0x2d')](_0x43df80[_0x12eb('0x28')],_0x43df80[_0x12eb('0x2a')]);_0x5bbeb5[_0x12eb('0x2c')]=_[_0x12eb('0x2d')](_0x43df80['model'],qs[_0x12eb('0x2e')](_0x350b9f[_0x12eb('0x2a')][_0x12eb('0x2e')]));_0x5bbeb5[_0x12eb('0x2c')]=_0x5bbeb5[_0x12eb('0x2c')][_0x12eb('0x3e')]?_0x5bbeb5[_0x12eb('0x2c')]:_0x43df80[_0x12eb('0x28')];if(_0x350b9f[_0x12eb('0x2a')]['includeAll']){_0x5bbeb5[_0x12eb('0x3a')]=[{'all':!![]}];}_0x5bbeb5=_[_0x12eb('0x35')]({},_0x5bbeb5,_0x350b9f[_0x12eb('0x37')]);return db['ZendeskConfiguration'][_0x12eb('0x3f')](_0x5bbeb5)[_0x12eb('0x1f')](handleEntityNotFound(_0x3ab394,null))[_0x12eb('0x1f')](respondWithResult(_0x3ab394,null))[_0x12eb('0x3b')](handleError(_0x3ab394,null));};exports['create']=function(_0x3ea2a7,_0x4554e3){return db[_0x12eb('0x38')][_0x12eb('0x40')](_0x3ea2a7['body'],{})[_0x12eb('0x1f')](respondWithResult(_0x4554e3,0xc9))[_0x12eb('0x3b')](handleError(_0x4554e3,null));};exports[_0x12eb('0x1e')]=function(_0x61a791,_0x30e0bd){if(_0x61a791[_0x12eb('0x41')]['id']){delete _0x61a791['body']['id'];}return db[_0x12eb('0x38')]['find']({'where':{'id':_0x61a791['params']['id']}})[_0x12eb('0x1f')](handleEntityNotFound(_0x30e0bd,null))['then'](saveUpdates(_0x61a791[_0x12eb('0x41')],null))[_0x12eb('0x1f')](respondWithResult(_0x30e0bd,null))['catch'](handleError(_0x30e0bd,null));};exports[_0x12eb('0x20')]=function(_0x5109ba,_0x1d06c0){return db['ZendeskConfiguration'][_0x12eb('0x3f')]({'where':{'id':_0x5109ba[_0x12eb('0x3d')]['id']}})[_0x12eb('0x1f')](handleEntityNotFound(_0x1d06c0,null))[_0x12eb('0x1f')](removeEntity(_0x1d06c0,null))['catch'](handleError(_0x1d06c0,null));};exports[_0x12eb('0x42')]=function(_0x3770c2,_0x59a2bf,_0x48850b){var _0x2998d5={};var _0x1694d1={};var _0x4b4a4e;var _0x4620c7;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3770c2['params']['id']}})[_0x12eb('0x1f')](handleEntityNotFound(_0x59a2bf,null))[_0x12eb('0x1f')](function(_0x51ef9f){if(_0x51ef9f){_0x4b4a4e=_0x51ef9f;_0x1694d1['model']=_[_0x12eb('0x29')](db[_0x12eb('0x43')][_0x12eb('0x25')]);_0x1694d1[_0x12eb('0x2a')]=_[_0x12eb('0x29')](_0x3770c2['query']);_0x1694d1[_0x12eb('0x2b')]=_['intersection'](_0x1694d1[_0x12eb('0x28')],_0x1694d1['query']);_0x2998d5['attributes']=_[_0x12eb('0x2d')](_0x1694d1[_0x12eb('0x28')],qs[_0x12eb('0x2e')](_0x3770c2['query'][_0x12eb('0x2e')]));_0x2998d5[_0x12eb('0x2c')]=_0x2998d5['attributes'][_0x12eb('0x3e')]?_0x2998d5[_0x12eb('0x2c')]:_0x1694d1['model'];_0x2998d5[_0x12eb('0x44')]=qs[_0x12eb('0x31')](_0x3770c2['query'][_0x12eb('0x31')]);_0x2998d5[_0x12eb('0x32')]=qs['filters'](_[_0x12eb('0x33')](_0x3770c2['query'],_0x1694d1['filters']));if(_0x3770c2[_0x12eb('0x2a')][_0x12eb('0x34')]){_0x2998d5[_0x12eb('0x32')]=_[_0x12eb('0x35')](_0x2998d5[_0x12eb('0x32')],{'$or':_['map'](_0x2998d5[_0x12eb('0x2c')],function(_0x6f1809){var _0x47a41e={};_0x47a41e[_0x6f1809]={'$like':'%'+_0x3770c2[_0x12eb('0x2a')][_0x12eb('0x34')]+'%'};return _0x47a41e;})});}_0x2998d5=_[_0x12eb('0x35')]({},_0x2998d5,_0x3770c2['options']);return _0x4b4a4e[_0x12eb('0x42')](_0x2998d5);}})[_0x12eb('0x1f')](function(_0x4d1a62){if(_0x4d1a62){_0x4620c7=_0x4d1a62[_0x12eb('0x3e')];if(!_0x3770c2[_0x12eb('0x2a')][_0x12eb('0x2f')](_0x12eb('0x30'))){_0x2998d5[_0x12eb('0x18')]=qs[_0x12eb('0x18')](_0x3770c2[_0x12eb('0x2a')][_0x12eb('0x18')]);_0x2998d5[_0x12eb('0x17')]=qs['offset'](_0x3770c2['query'][_0x12eb('0x17')]);}return _0x4b4a4e[_0x12eb('0x42')](_0x2998d5);}})[_0x12eb('0x1f')](function(_0x2d2096){if(_0x2d2096){return _0x2d2096?{'count':_0x4620c7,'rows':_0x2d2096}:null;}})[_0x12eb('0x1f')](respondWithResult(_0x59a2bf,null))['catch'](handleError(_0x59a2bf,null));};exports[_0x12eb('0x45')]=function(_0x52f7dd,_0x54fd2a,_0x58eedf){var _0x4ae9db={};var _0x897916={};var _0x4623d0;var _0x225d81;return db[_0x12eb('0x38')][_0x12eb('0x46')]({'where':{'id':_0x52f7dd[_0x12eb('0x3d')]['id']}})[_0x12eb('0x1f')](handleEntityNotFound(_0x54fd2a,null))[_0x12eb('0x1f')](function(_0x2e51b3){if(_0x2e51b3){_0x4623d0=_0x2e51b3;_0x897916[_0x12eb('0x28')]=_[_0x12eb('0x29')](db[_0x12eb('0x43')][_0x12eb('0x25')]);_0x897916[_0x12eb('0x2a')]=_[_0x12eb('0x29')](_0x52f7dd[_0x12eb('0x2a')]);_0x897916[_0x12eb('0x2b')]=_[_0x12eb('0x2d')](_0x897916[_0x12eb('0x28')],_0x897916[_0x12eb('0x2a')]);_0x4ae9db['attributes']=_[_0x12eb('0x2d')](_0x897916['model'],qs['fields'](_0x52f7dd['query']['fields']));_0x4ae9db['attributes']=_0x4ae9db['attributes'][_0x12eb('0x3e')]?_0x4ae9db['attributes']:_0x897916[_0x12eb('0x28')];_0x4ae9db[_0x12eb('0x44')]=qs['sort'](_0x52f7dd[_0x12eb('0x2a')][_0x12eb('0x31')]);_0x4ae9db[_0x12eb('0x32')]=qs[_0x12eb('0x2b')](_[_0x12eb('0x33')](_0x52f7dd[_0x12eb('0x2a')],_0x897916[_0x12eb('0x2b')]));if(_0x52f7dd[_0x12eb('0x2a')][_0x12eb('0x34')]){_0x4ae9db[_0x12eb('0x32')]=_[_0x12eb('0x35')](_0x4ae9db['where'],{'$or':_['map'](_0x4ae9db[_0x12eb('0x2c')],function(_0x81131b){var _0x5b2308={};_0x5b2308[_0x81131b]={'$like':'%'+_0x52f7dd[_0x12eb('0x2a')]['filter']+'%'};return _0x5b2308;})});}_0x4ae9db=_[_0x12eb('0x35')]({},_0x4ae9db,_0x52f7dd[_0x12eb('0x37')]);return _0x4623d0[_0x12eb('0x45')](_0x4ae9db);}})['then'](function(_0x438d97){if(_0x438d97){_0x225d81=_0x438d97[_0x12eb('0x3e')];if(!_0x52f7dd[_0x12eb('0x2a')]['hasOwnProperty']('nolimit')){_0x4ae9db[_0x12eb('0x18')]=qs['limit'](_0x52f7dd[_0x12eb('0x2a')][_0x12eb('0x18')]);_0x4ae9db[_0x12eb('0x17')]=qs[_0x12eb('0x17')](_0x52f7dd[_0x12eb('0x2a')]['offset']);}return _0x4623d0[_0x12eb('0x45')](_0x4ae9db);}})[_0x12eb('0x1f')](function(_0x325d5f){if(_0x325d5f){return _0x325d5f?{'count':_0x225d81,'rows':_0x325d5f}:null;}})[_0x12eb('0x1f')](respondWithResult(_0x54fd2a,null))[_0x12eb('0x3b')](handleError(_0x54fd2a,null));};exports[_0x12eb('0x47')]=function(_0x4ee9a7,_0x23d459,_0x555342){var _0x48836c={};var _0x5e085b={};var _0x1db961;var _0x5d0053;return db['ZendeskConfiguration'][_0x12eb('0x46')]({'where':{'id':_0x4ee9a7['params']['id']}})['then'](handleEntityNotFound(_0x23d459,null))['then'](function(_0x3625ea){if(_0x3625ea){_0x1db961=_0x3625ea;_0x5e085b[_0x12eb('0x28')]=_[_0x12eb('0x29')](db[_0x12eb('0x43')][_0x12eb('0x25')]);_0x5e085b[_0x12eb('0x2a')]=_[_0x12eb('0x29')](_0x4ee9a7[_0x12eb('0x2a')]);_0x5e085b['filters']=_[_0x12eb('0x2d')](_0x5e085b['model'],_0x5e085b[_0x12eb('0x2a')]);_0x48836c['attributes']=_[_0x12eb('0x2d')](_0x5e085b[_0x12eb('0x28')],qs[_0x12eb('0x2e')](_0x4ee9a7[_0x12eb('0x2a')][_0x12eb('0x2e')]));_0x48836c['attributes']=_0x48836c[_0x12eb('0x2c')][_0x12eb('0x3e')]?_0x48836c[_0x12eb('0x2c')]:_0x5e085b[_0x12eb('0x28')];_0x48836c[_0x12eb('0x44')]=qs[_0x12eb('0x31')](_0x4ee9a7[_0x12eb('0x2a')]['sort']);_0x48836c['where']=qs['filters'](_[_0x12eb('0x33')](_0x4ee9a7[_0x12eb('0x2a')],_0x5e085b[_0x12eb('0x2b')]));if(_0x4ee9a7[_0x12eb('0x2a')][_0x12eb('0x34')]){_0x48836c[_0x12eb('0x32')]=_['merge'](_0x48836c[_0x12eb('0x32')],{'$or':_[_0x12eb('0x36')](_0x48836c['attributes'],function(_0x43d02c){var _0x4b3c55={};_0x4b3c55[_0x43d02c]={'$like':'%'+_0x4ee9a7[_0x12eb('0x2a')][_0x12eb('0x34')]+'%'};return _0x4b3c55;})});}_0x48836c=_['merge']({},_0x48836c,_0x4ee9a7[_0x12eb('0x37')]);return _0x1db961['getDescriptions'](_0x48836c);}})[_0x12eb('0x1f')](function(_0x307bda){if(_0x307bda){_0x5d0053=_0x307bda[_0x12eb('0x3e')];if(!_0x4ee9a7['query'][_0x12eb('0x2f')]('nolimit')){_0x48836c[_0x12eb('0x18')]=qs[_0x12eb('0x18')](_0x4ee9a7[_0x12eb('0x2a')][_0x12eb('0x18')]);_0x48836c[_0x12eb('0x17')]=qs['offset'](_0x4ee9a7[_0x12eb('0x2a')]['offset']);}return _0x1db961[_0x12eb('0x47')](_0x48836c);}})[_0x12eb('0x1f')](function(_0xc5e20){if(_0xc5e20){return _0xc5e20?{'count':_0x5d0053,'rows':_0xc5e20}:null;}})[_0x12eb('0x1f')](respondWithResult(_0x23d459,null))['catch'](handleError(_0x23d459,null));};exports[_0x12eb('0x48')]=function(_0x5206c7,_0x25dce8,_0x2b414c){var _0x159be1={};var _0x1b4fe1={};var _0x19a8ce;var _0x4e5914;return db[_0x12eb('0x38')][_0x12eb('0x46')]({'where':{'id':_0x5206c7[_0x12eb('0x3d')]['id']}})[_0x12eb('0x1f')](handleEntityNotFound(_0x25dce8,null))[_0x12eb('0x1f')](function(_0x1ba475){if(_0x1ba475){_0x19a8ce=_0x1ba475;_0x1b4fe1['model']=_['keys'](db[_0x12eb('0x49')][_0x12eb('0x25')]);_0x1b4fe1['query']=_[_0x12eb('0x29')](_0x5206c7[_0x12eb('0x2a')]);_0x1b4fe1[_0x12eb('0x2b')]=_[_0x12eb('0x2d')](_0x1b4fe1[_0x12eb('0x28')],_0x1b4fe1[_0x12eb('0x2a')]);_0x159be1[_0x12eb('0x2c')]=_[_0x12eb('0x2d')](_0x1b4fe1[_0x12eb('0x28')],qs[_0x12eb('0x2e')](_0x5206c7['query'][_0x12eb('0x2e')]));_0x159be1[_0x12eb('0x2c')]=_0x159be1[_0x12eb('0x2c')][_0x12eb('0x3e')]?_0x159be1[_0x12eb('0x2c')]:_0x1b4fe1[_0x12eb('0x28')];_0x159be1['order']=qs[_0x12eb('0x31')](_0x5206c7[_0x12eb('0x2a')][_0x12eb('0x31')]);_0x159be1[_0x12eb('0x32')]=qs[_0x12eb('0x2b')](_[_0x12eb('0x33')](_0x5206c7['query'],_0x1b4fe1[_0x12eb('0x2b')]));if(_0x5206c7[_0x12eb('0x2a')]['filter']){_0x159be1[_0x12eb('0x32')]=_['merge'](_0x159be1['where'],{'$or':_[_0x12eb('0x36')](_0x159be1['attributes'],function(_0x5ec619){var _0x31b92b={};_0x31b92b[_0x5ec619]={'$like':'%'+_0x5206c7[_0x12eb('0x2a')]['filter']+'%'};return _0x31b92b;})});}_0x159be1=_[_0x12eb('0x35')]({},_0x159be1,_0x5206c7[_0x12eb('0x37')]);return _0x19a8ce['getTags'](_0x159be1);}})[_0x12eb('0x1f')](function(_0x214b3a){if(_0x214b3a){_0x4e5914=_0x214b3a[_0x12eb('0x3e')];if(!_0x5206c7[_0x12eb('0x2a')]['hasOwnProperty']('nolimit')){_0x159be1[_0x12eb('0x18')]=qs[_0x12eb('0x18')](_0x5206c7['query'][_0x12eb('0x18')]);_0x159be1[_0x12eb('0x17')]=qs[_0x12eb('0x17')](_0x5206c7['query'][_0x12eb('0x17')]);}return _0x19a8ce[_0x12eb('0x48')](_0x159be1);}})[_0x12eb('0x1f')](function(_0x569fff){if(_0x569fff){return _0x569fff?{'count':_0x4e5914,'rows':_0x569fff}:null;}})[_0x12eb('0x1f')](respondWithResult(_0x25dce8,null))['catch'](handleError(_0x25dce8,null));};exports['setTags']=function(_0x9dd522,_0xa4a9ef,_0x50d3df){if(_0x9dd522[_0x12eb('0x41')]['id']){delete _0x9dd522['body']['id'];}return db[_0x12eb('0x38')][_0x12eb('0x46')]({'where':{'id':_0x9dd522[_0x12eb('0x3d')]['id']}})[_0x12eb('0x1f')](handleEntityNotFound(_0xa4a9ef,null))['then'](function(_0x356feb){if(_0x356feb){return _0x356feb[_0x12eb('0x4a')](_0x9dd522[_0x12eb('0x41')][_0x12eb('0x4b')]||[]);}return null;})[_0x12eb('0x1f')](respondWithResult(_0xa4a9ef,null))[_0x12eb('0x3b')](handleError(_0xa4a9ef,null));}; \ No newline at end of file +var _0x4eab=['pick','VIRTUAL','filter','merge','options','includeAll','include','ZendeskConfiguration','findAll','rows','catch','show','params','fields','create','body','find','getFields','findOne','order','hasOwnProperty','ZendeskField','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','sort','where'];(function(_0x39a387,_0x496459){var _0x4d9420=function(_0x2b9cda){while(--_0x2b9cda){_0x39a387['push'](_0x39a387['shift']());}};_0x4d9420(++_0x496459);}(_0x4eab,0x160));var _0xb4ea=function(_0x381584,_0x34b687){_0x381584=_0x381584-0x0;var _0x12c5fb=_0x4eab[_0x381584];return _0x12c5fb;};'use strict';var emlformat=require(_0xb4ea('0x0'));var rimraf=require(_0xb4ea('0x1'));var zipdir=require(_0xb4ea('0x2'));var jsonpatch=require(_0xb4ea('0x3'));var rp=require(_0xb4ea('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb4ea('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb4ea('0x6'));var csv=require(_0xb4ea('0x7'));var ejs=require(_0xb4ea('0x8'));var fs=require('fs');var fs_extra=require(_0xb4ea('0x9'));var _=require('lodash');var squel=require(_0xb4ea('0xa'));var crypto=require(_0xb4ea('0xb'));var jsforce=require(_0xb4ea('0xc'));var deskjs=require(_0xb4ea('0xd'));var toCsv=require(_0xb4ea('0x7'));var querystring=require(_0xb4ea('0xe'));var Papa=require(_0xb4ea('0xf'));var Redis=require('ioredis');var authService=require(_0xb4ea('0x10'));var qs=require(_0xb4ea('0x11'));var as=require(_0xb4ea('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb4ea('0x13'))('api');var utils=require(_0xb4ea('0x14'));var config=require(_0xb4ea('0x15'));var licenseUtil=require(_0xb4ea('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30408c,_0x39f4a6){_0x39f4a6=_0x39f4a6||0xcc;return function(_0x2c12bc){if(_0x2c12bc){return _0x30408c[_0xb4ea('0x17')](_0x39f4a6);}return _0x30408c[_0xb4ea('0x18')](_0x39f4a6)['end']();};}function respondWithResult(_0x224477,_0x18c78d){_0x18c78d=_0x18c78d||0xc8;return function(_0x591dbd){if(_0x591dbd){return _0x224477[_0xb4ea('0x18')](_0x18c78d)['json'](_0x591dbd);}};}function respondWithFilteredResult(_0x1c50bb,_0x1fc806){return function(_0x5cc940){if(_0x5cc940){var _0x588676=typeof _0x1fc806[_0xb4ea('0x19')]===_0xb4ea('0x1a')&&typeof _0x1fc806[_0xb4ea('0x1b')]==='undefined';var _0x53425e=_0x5cc940[_0xb4ea('0x1c')];var _0x3dcdf1=_0x588676?0x0:_0x1fc806['offset'];var _0x4cd231=_0x588676?_0x5cc940[_0xb4ea('0x1c')]:_0x1fc806[_0xb4ea('0x19')]+_0x1fc806['limit'];var _0x152852;if(_0x4cd231>=_0x53425e){_0x4cd231=_0x53425e;_0x152852=0xc8;}else{_0x152852=0xce;}_0x1c50bb[_0xb4ea('0x18')](_0x152852);return _0x1c50bb[_0xb4ea('0x1d')](_0xb4ea('0x1e'),_0x3dcdf1+'-'+_0x4cd231+'/'+_0x53425e)['json'](_0x5cc940);}return null;};}function patchUpdates(_0x456d2e){return function(_0x36f9e7){try{jsonpatch['apply'](_0x36f9e7,_0x456d2e,!![]);}catch(_0x3d7b82){return BPromise[_0xb4ea('0x1f')](_0x3d7b82);}return _0x36f9e7['save']();};}function saveUpdates(_0xaa5978,_0x5eddeb){return function(_0x54382e){if(_0x54382e){return _0x54382e[_0xb4ea('0x20')](_0xaa5978)[_0xb4ea('0x21')](function(_0x382715){return _0x382715;});}return null;};}function removeEntity(_0x1a126b,_0x4e6ad7){return function(_0x1e850d){if(_0x1e850d){return _0x1e850d[_0xb4ea('0x22')]()[_0xb4ea('0x21')](function(){_0x1a126b[_0xb4ea('0x18')](0xcc)[_0xb4ea('0x23')]();});}};}function handleEntityNotFound(_0x1bca60,_0x7a227f){return function(_0xd4bc33){if(!_0xd4bc33){_0x1bca60[_0xb4ea('0x17')](0x194);}return _0xd4bc33;};}function handleError(_0x4a1284,_0x2e07a0){_0x2e07a0=_0x2e07a0||0x1f4;return function(_0x2f2518){logger['error'](_0x2f2518['stack']);if(_0x2f2518['name']){delete _0x2f2518[_0xb4ea('0x24')];}_0x4a1284[_0xb4ea('0x18')](_0x2e07a0)[_0xb4ea('0x25')](_0x2f2518);};}exports[_0xb4ea('0x26')]=function(_0x2ca9d9,_0x53a1b6){var _0xe2a207={},_0xd8dd3c={},_0x4c0434={'count':0x0,'rows':[]};var _0x3205ac=_[_0xb4ea('0x27')](db['ZendeskConfiguration'][_0xb4ea('0x28')],function(_0xd44945){return{'name':_0xd44945['fieldName'],'type':_0xd44945[_0xb4ea('0x29')][_0xb4ea('0x2a')]};});_0xd8dd3c[_0xb4ea('0x2b')]=_[_0xb4ea('0x27')](_0x3205ac,_0xb4ea('0x24'));_0xd8dd3c[_0xb4ea('0x2c')]=_[_0xb4ea('0x2d')](_0x2ca9d9[_0xb4ea('0x2c')]);_0xd8dd3c[_0xb4ea('0x2e')]=_[_0xb4ea('0x2f')](_0xd8dd3c[_0xb4ea('0x2b')],_0xd8dd3c['query']);_0xe2a207[_0xb4ea('0x30')]=_[_0xb4ea('0x2f')](_0xd8dd3c[_0xb4ea('0x2b')],qs['fields'](_0x2ca9d9[_0xb4ea('0x2c')]['fields']));_0xe2a207[_0xb4ea('0x30')]=_0xe2a207[_0xb4ea('0x30')][_0xb4ea('0x31')]?_0xe2a207['attributes']:_0xd8dd3c[_0xb4ea('0x2b')];if(!_0x2ca9d9[_0xb4ea('0x2c')]['hasOwnProperty'](_0xb4ea('0x32'))){_0xe2a207[_0xb4ea('0x1b')]=qs['limit'](_0x2ca9d9[_0xb4ea('0x2c')][_0xb4ea('0x1b')]);_0xe2a207[_0xb4ea('0x19')]=qs[_0xb4ea('0x19')](_0x2ca9d9[_0xb4ea('0x2c')][_0xb4ea('0x19')]);}_0xe2a207['order']=qs[_0xb4ea('0x33')](_0x2ca9d9[_0xb4ea('0x2c')][_0xb4ea('0x33')]);_0xe2a207[_0xb4ea('0x34')]=qs[_0xb4ea('0x2e')](_[_0xb4ea('0x35')](_0x2ca9d9[_0xb4ea('0x2c')],_0xd8dd3c[_0xb4ea('0x2e')]),_0x3205ac);if(_0x2ca9d9['query']['filter']){_0xe2a207[_0xb4ea('0x34')]=_['merge'](_0xe2a207[_0xb4ea('0x34')],{'$or':_['map'](_0x3205ac,function(_0x4dd4b4){if(_0x4dd4b4[_0xb4ea('0x29')]!==_0xb4ea('0x36')){var _0x135d1e={};_0x135d1e[_0x4dd4b4[_0xb4ea('0x24')]]={'$like':'%'+_0x2ca9d9[_0xb4ea('0x2c')][_0xb4ea('0x37')]+'%'};return _0x135d1e;}})});}_0xe2a207=_[_0xb4ea('0x38')]({},_0xe2a207,_0x2ca9d9[_0xb4ea('0x39')]);var _0x3244ef={'where':_0xe2a207['where']};return db['ZendeskConfiguration'][_0xb4ea('0x1c')](_0x3244ef)[_0xb4ea('0x21')](function(_0x119cec){_0x4c0434[_0xb4ea('0x1c')]=_0x119cec;if(_0x2ca9d9['query'][_0xb4ea('0x3a')]){_0xe2a207[_0xb4ea('0x3b')]=[{'all':!![]}];}return db[_0xb4ea('0x3c')][_0xb4ea('0x3d')](_0xe2a207);})['then'](function(_0x1831a7){_0x4c0434[_0xb4ea('0x3e')]=_0x1831a7;return _0x4c0434;})[_0xb4ea('0x21')](respondWithFilteredResult(_0x53a1b6,_0xe2a207))[_0xb4ea('0x3f')](handleError(_0x53a1b6,null));};exports[_0xb4ea('0x40')]=function(_0x21a3ef,_0x50f411){var _0x14ffb5={'raw':![],'where':{'id':_0x21a3ef[_0xb4ea('0x41')]['id']}},_0x606a5={};_0x606a5[_0xb4ea('0x2b')]=_[_0xb4ea('0x2d')](db[_0xb4ea('0x3c')]['rawAttributes']);_0x606a5[_0xb4ea('0x2c')]=_[_0xb4ea('0x2d')](_0x21a3ef[_0xb4ea('0x2c')]);_0x606a5['filters']=_['intersection'](_0x606a5[_0xb4ea('0x2b')],_0x606a5[_0xb4ea('0x2c')]);_0x14ffb5[_0xb4ea('0x30')]=_[_0xb4ea('0x2f')](_0x606a5[_0xb4ea('0x2b')],qs[_0xb4ea('0x42')](_0x21a3ef['query'][_0xb4ea('0x42')]));_0x14ffb5[_0xb4ea('0x30')]=_0x14ffb5[_0xb4ea('0x30')][_0xb4ea('0x31')]?_0x14ffb5[_0xb4ea('0x30')]:_0x606a5[_0xb4ea('0x2b')];if(_0x21a3ef['query'][_0xb4ea('0x3a')]){_0x14ffb5[_0xb4ea('0x3b')]=[{'all':!![]}];}_0x14ffb5=_[_0xb4ea('0x38')]({},_0x14ffb5,_0x21a3ef[_0xb4ea('0x39')]);return db[_0xb4ea('0x3c')]['find'](_0x14ffb5)['then'](handleEntityNotFound(_0x50f411,null))[_0xb4ea('0x21')](respondWithResult(_0x50f411,null))['catch'](handleError(_0x50f411,null));};exports['create']=function(_0x1725c2,_0x4e9104){return db[_0xb4ea('0x3c')][_0xb4ea('0x43')](_0x1725c2[_0xb4ea('0x44')],{})[_0xb4ea('0x21')](respondWithResult(_0x4e9104,0xc9))[_0xb4ea('0x3f')](handleError(_0x4e9104,null));};exports[_0xb4ea('0x20')]=function(_0x242ff8,_0xd8823){if(_0x242ff8['body']['id']){delete _0x242ff8[_0xb4ea('0x44')]['id'];}return db['ZendeskConfiguration'][_0xb4ea('0x45')]({'where':{'id':_0x242ff8['params']['id']}})[_0xb4ea('0x21')](handleEntityNotFound(_0xd8823,null))[_0xb4ea('0x21')](saveUpdates(_0x242ff8[_0xb4ea('0x44')],null))[_0xb4ea('0x21')](respondWithResult(_0xd8823,null))[_0xb4ea('0x3f')](handleError(_0xd8823,null));};exports[_0xb4ea('0x22')]=function(_0x122f0f,_0x28c17c){return db[_0xb4ea('0x3c')][_0xb4ea('0x45')]({'where':{'id':_0x122f0f[_0xb4ea('0x41')]['id']}})[_0xb4ea('0x21')](handleEntityNotFound(_0x28c17c,null))[_0xb4ea('0x21')](removeEntity(_0x28c17c,null))[_0xb4ea('0x3f')](handleError(_0x28c17c,null));};exports[_0xb4ea('0x46')]=function(_0x4114f0,_0x1a97e3,_0x1bca30){var _0x442502={};var _0x558000={};var _0xa4ef91;var _0x290468;return db['ZendeskConfiguration'][_0xb4ea('0x47')]({'where':{'id':_0x4114f0[_0xb4ea('0x41')]['id']}})[_0xb4ea('0x21')](handleEntityNotFound(_0x1a97e3,null))['then'](function(_0x2e014e){if(_0x2e014e){_0xa4ef91=_0x2e014e;_0x558000[_0xb4ea('0x2b')]=_[_0xb4ea('0x2d')](db['ZendeskField'][_0xb4ea('0x28')]);_0x558000[_0xb4ea('0x2c')]=_[_0xb4ea('0x2d')](_0x4114f0[_0xb4ea('0x2c')]);_0x558000[_0xb4ea('0x2e')]=_['intersection'](_0x558000['model'],_0x558000[_0xb4ea('0x2c')]);_0x442502[_0xb4ea('0x30')]=_[_0xb4ea('0x2f')](_0x558000['model'],qs['fields'](_0x4114f0[_0xb4ea('0x2c')][_0xb4ea('0x42')]));_0x442502[_0xb4ea('0x30')]=_0x442502['attributes']['length']?_0x442502[_0xb4ea('0x30')]:_0x558000[_0xb4ea('0x2b')];_0x442502[_0xb4ea('0x48')]=qs[_0xb4ea('0x33')](_0x4114f0['query'][_0xb4ea('0x33')]);_0x442502[_0xb4ea('0x34')]=qs['filters'](_['pick'](_0x4114f0[_0xb4ea('0x2c')],_0x558000[_0xb4ea('0x2e')]));if(_0x4114f0['query'][_0xb4ea('0x37')]){_0x442502[_0xb4ea('0x34')]=_[_0xb4ea('0x38')](_0x442502['where'],{'$or':_['map'](_0x442502[_0xb4ea('0x30')],function(_0x30d06c){var _0x2eb561={};_0x2eb561[_0x30d06c]={'$like':'%'+_0x4114f0[_0xb4ea('0x2c')][_0xb4ea('0x37')]+'%'};return _0x2eb561;})});}_0x442502=_[_0xb4ea('0x38')]({},_0x442502,_0x4114f0[_0xb4ea('0x39')]);return _0xa4ef91['getFields'](_0x442502);}})[_0xb4ea('0x21')](function(_0x51165a){if(_0x51165a){_0x290468=_0x51165a[_0xb4ea('0x31')];if(!_0x4114f0[_0xb4ea('0x2c')][_0xb4ea('0x49')](_0xb4ea('0x32'))){_0x442502[_0xb4ea('0x1b')]=qs[_0xb4ea('0x1b')](_0x4114f0[_0xb4ea('0x2c')]['limit']);_0x442502[_0xb4ea('0x19')]=qs[_0xb4ea('0x19')](_0x4114f0[_0xb4ea('0x2c')][_0xb4ea('0x19')]);}return _0xa4ef91[_0xb4ea('0x46')](_0x442502);}})[_0xb4ea('0x21')](function(_0xf7512d){if(_0xf7512d){return _0xf7512d?{'count':_0x290468,'rows':_0xf7512d}:null;}})['then'](respondWithResult(_0x1a97e3,null))[_0xb4ea('0x3f')](handleError(_0x1a97e3,null));};exports['getSubjects']=function(_0xf02d29,_0x12829b,_0x54d796){var _0x26df65={};var _0x43bf75={};var _0x328115;var _0x19b192;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0xf02d29[_0xb4ea('0x41')]['id']}})[_0xb4ea('0x21')](handleEntityNotFound(_0x12829b,null))[_0xb4ea('0x21')](function(_0x1b060e){if(_0x1b060e){_0x328115=_0x1b060e;_0x43bf75[_0xb4ea('0x2b')]=_[_0xb4ea('0x2d')](db[_0xb4ea('0x4a')][_0xb4ea('0x28')]);_0x43bf75[_0xb4ea('0x2c')]=_[_0xb4ea('0x2d')](_0xf02d29[_0xb4ea('0x2c')]);_0x43bf75[_0xb4ea('0x2e')]=_[_0xb4ea('0x2f')](_0x43bf75[_0xb4ea('0x2b')],_0x43bf75[_0xb4ea('0x2c')]);_0x26df65['attributes']=_[_0xb4ea('0x2f')](_0x43bf75[_0xb4ea('0x2b')],qs['fields'](_0xf02d29[_0xb4ea('0x2c')]['fields']));_0x26df65[_0xb4ea('0x30')]=_0x26df65[_0xb4ea('0x30')][_0xb4ea('0x31')]?_0x26df65[_0xb4ea('0x30')]:_0x43bf75[_0xb4ea('0x2b')];_0x26df65['order']=qs['sort'](_0xf02d29[_0xb4ea('0x2c')]['sort']);_0x26df65[_0xb4ea('0x34')]=qs[_0xb4ea('0x2e')](_[_0xb4ea('0x35')](_0xf02d29[_0xb4ea('0x2c')],_0x43bf75[_0xb4ea('0x2e')]));if(_0xf02d29['query'][_0xb4ea('0x37')]){_0x26df65['where']=_[_0xb4ea('0x38')](_0x26df65[_0xb4ea('0x34')],{'$or':_['map'](_0x26df65[_0xb4ea('0x30')],function(_0x57b6d2){var _0x9026a5={};_0x9026a5[_0x57b6d2]={'$like':'%'+_0xf02d29[_0xb4ea('0x2c')][_0xb4ea('0x37')]+'%'};return _0x9026a5;})});}_0x26df65=_['merge']({},_0x26df65,_0xf02d29[_0xb4ea('0x39')]);return _0x328115[_0xb4ea('0x4b')](_0x26df65);}})[_0xb4ea('0x21')](function(_0x3e6f22){if(_0x3e6f22){_0x19b192=_0x3e6f22[_0xb4ea('0x31')];if(!_0xf02d29[_0xb4ea('0x2c')][_0xb4ea('0x49')](_0xb4ea('0x32'))){_0x26df65[_0xb4ea('0x1b')]=qs['limit'](_0xf02d29['query'][_0xb4ea('0x1b')]);_0x26df65[_0xb4ea('0x19')]=qs[_0xb4ea('0x19')](_0xf02d29[_0xb4ea('0x2c')][_0xb4ea('0x19')]);}return _0x328115[_0xb4ea('0x4b')](_0x26df65);}})['then'](function(_0x1c3b7e){if(_0x1c3b7e){return _0x1c3b7e?{'count':_0x19b192,'rows':_0x1c3b7e}:null;}})[_0xb4ea('0x21')](respondWithResult(_0x12829b,null))[_0xb4ea('0x3f')](handleError(_0x12829b,null));};exports['getDescriptions']=function(_0x45331e,_0x5e1a2e,_0xbf630c){var _0x3ee249={};var _0x1df638={};var _0x329557;var _0x53a5c7;return db[_0xb4ea('0x3c')][_0xb4ea('0x47')]({'where':{'id':_0x45331e[_0xb4ea('0x41')]['id']}})[_0xb4ea('0x21')](handleEntityNotFound(_0x5e1a2e,null))[_0xb4ea('0x21')](function(_0xb06bc1){if(_0xb06bc1){_0x329557=_0xb06bc1;_0x1df638[_0xb4ea('0x2b')]=_[_0xb4ea('0x2d')](db[_0xb4ea('0x4a')][_0xb4ea('0x28')]);_0x1df638[_0xb4ea('0x2c')]=_[_0xb4ea('0x2d')](_0x45331e[_0xb4ea('0x2c')]);_0x1df638[_0xb4ea('0x2e')]=_['intersection'](_0x1df638[_0xb4ea('0x2b')],_0x1df638[_0xb4ea('0x2c')]);_0x3ee249['attributes']=_[_0xb4ea('0x2f')](_0x1df638[_0xb4ea('0x2b')],qs[_0xb4ea('0x42')](_0x45331e['query'][_0xb4ea('0x42')]));_0x3ee249[_0xb4ea('0x30')]=_0x3ee249[_0xb4ea('0x30')][_0xb4ea('0x31')]?_0x3ee249[_0xb4ea('0x30')]:_0x1df638[_0xb4ea('0x2b')];_0x3ee249['order']=qs[_0xb4ea('0x33')](_0x45331e[_0xb4ea('0x2c')]['sort']);_0x3ee249[_0xb4ea('0x34')]=qs['filters'](_[_0xb4ea('0x35')](_0x45331e[_0xb4ea('0x2c')],_0x1df638[_0xb4ea('0x2e')]));if(_0x45331e[_0xb4ea('0x2c')][_0xb4ea('0x37')]){_0x3ee249['where']=_[_0xb4ea('0x38')](_0x3ee249[_0xb4ea('0x34')],{'$or':_[_0xb4ea('0x27')](_0x3ee249[_0xb4ea('0x30')],function(_0x95b705){var _0x1ade37={};_0x1ade37[_0x95b705]={'$like':'%'+_0x45331e[_0xb4ea('0x2c')][_0xb4ea('0x37')]+'%'};return _0x1ade37;})});}_0x3ee249=_[_0xb4ea('0x38')]({},_0x3ee249,_0x45331e['options']);return _0x329557[_0xb4ea('0x4c')](_0x3ee249);}})[_0xb4ea('0x21')](function(_0x1f3d26){if(_0x1f3d26){_0x53a5c7=_0x1f3d26[_0xb4ea('0x31')];if(!_0x45331e[_0xb4ea('0x2c')][_0xb4ea('0x49')](_0xb4ea('0x32'))){_0x3ee249['limit']=qs[_0xb4ea('0x1b')](_0x45331e[_0xb4ea('0x2c')]['limit']);_0x3ee249[_0xb4ea('0x19')]=qs[_0xb4ea('0x19')](_0x45331e[_0xb4ea('0x2c')][_0xb4ea('0x19')]);}return _0x329557['getDescriptions'](_0x3ee249);}})['then'](function(_0xca996e){if(_0xca996e){return _0xca996e?{'count':_0x53a5c7,'rows':_0xca996e}:null;}})[_0xb4ea('0x21')](respondWithResult(_0x5e1a2e,null))[_0xb4ea('0x3f')](handleError(_0x5e1a2e,null));};exports['getTags']=function(_0x5e5e1b,_0x42b901,_0x501daa){var _0x3be597={};var _0x196b85={};var _0x47d9fd;var _0x12d8c8;return db[_0xb4ea('0x3c')][_0xb4ea('0x47')]({'where':{'id':_0x5e5e1b['params']['id']}})[_0xb4ea('0x21')](handleEntityNotFound(_0x42b901,null))[_0xb4ea('0x21')](function(_0x4c5b14){if(_0x4c5b14){_0x47d9fd=_0x4c5b14;_0x196b85[_0xb4ea('0x2b')]=_['keys'](db[_0xb4ea('0x4d')]['rawAttributes']);_0x196b85[_0xb4ea('0x2c')]=_['keys'](_0x5e5e1b['query']);_0x196b85['filters']=_[_0xb4ea('0x2f')](_0x196b85[_0xb4ea('0x2b')],_0x196b85['query']);_0x3be597[_0xb4ea('0x30')]=_[_0xb4ea('0x2f')](_0x196b85[_0xb4ea('0x2b')],qs[_0xb4ea('0x42')](_0x5e5e1b[_0xb4ea('0x2c')]['fields']));_0x3be597[_0xb4ea('0x30')]=_0x3be597[_0xb4ea('0x30')][_0xb4ea('0x31')]?_0x3be597[_0xb4ea('0x30')]:_0x196b85[_0xb4ea('0x2b')];_0x3be597[_0xb4ea('0x48')]=qs[_0xb4ea('0x33')](_0x5e5e1b[_0xb4ea('0x2c')][_0xb4ea('0x33')]);_0x3be597[_0xb4ea('0x34')]=qs['filters'](_['pick'](_0x5e5e1b[_0xb4ea('0x2c')],_0x196b85[_0xb4ea('0x2e')]));if(_0x5e5e1b['query'][_0xb4ea('0x37')]){_0x3be597[_0xb4ea('0x34')]=_[_0xb4ea('0x38')](_0x3be597[_0xb4ea('0x34')],{'$or':_[_0xb4ea('0x27')](_0x3be597[_0xb4ea('0x30')],function(_0xef4830){var _0x327816={};_0x327816[_0xef4830]={'$like':'%'+_0x5e5e1b['query'][_0xb4ea('0x37')]+'%'};return _0x327816;})});}_0x3be597=_['merge']({},_0x3be597,_0x5e5e1b['options']);return _0x47d9fd[_0xb4ea('0x4e')](_0x3be597);}})[_0xb4ea('0x21')](function(_0x5d6c26){if(_0x5d6c26){_0x12d8c8=_0x5d6c26[_0xb4ea('0x31')];if(!_0x5e5e1b[_0xb4ea('0x2c')][_0xb4ea('0x49')](_0xb4ea('0x32'))){_0x3be597['limit']=qs[_0xb4ea('0x1b')](_0x5e5e1b[_0xb4ea('0x2c')][_0xb4ea('0x1b')]);_0x3be597['offset']=qs[_0xb4ea('0x19')](_0x5e5e1b[_0xb4ea('0x2c')][_0xb4ea('0x19')]);}return _0x47d9fd['getTags'](_0x3be597);}})[_0xb4ea('0x21')](function(_0x170e8f){if(_0x170e8f){return _0x170e8f?{'count':_0x12d8c8,'rows':_0x170e8f}:null;}})[_0xb4ea('0x21')](respondWithResult(_0x42b901,null))['catch'](handleError(_0x42b901,null));};exports[_0xb4ea('0x4f')]=function(_0x4db901,_0x39dd13,_0x25cbc6){if(_0x4db901[_0xb4ea('0x44')]['id']){delete _0x4db901['body']['id'];}return db[_0xb4ea('0x3c')][_0xb4ea('0x47')]({'where':{'id':_0x4db901[_0xb4ea('0x41')]['id']}})[_0xb4ea('0x21')](handleEntityNotFound(_0x39dd13,null))[_0xb4ea('0x21')](function(_0x3da476){if(_0x3da476){return _0x3da476[_0xb4ea('0x4f')](_0x4db901[_0xb4ea('0x44')][_0xb4ea('0x50')]||[]);}return null;})[_0xb4ea('0x21')](respondWithResult(_0x39dd13,null))[_0xb4ea('0x3f')](handleError(_0x39dd13,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 85d7e23..8c74cee 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 _0x7708=['../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','rimraf'];(function(_0x507d01,_0x58626d){var _0x308468=function(_0xe27311){while(--_0xe27311){_0x507d01['push'](_0x507d01['shift']());}};_0x308468(++_0x58626d);}(_0x7708,0x188));var _0x8770=function(_0x45fe9c,_0x55e0d7){_0x45fe9c=_0x45fe9c-0x0;var _0x233d48=_0x7708[_0x45fe9c];return _0x233d48;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var logger=require('../../config/logger')(_0x8770('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x8770('0x5')]=function(_0x50bab7,_0x31390d){return _0x50bab7[_0x8770('0x6')](_0x8770('0x7'),attributes,{'tableName':_0x8770('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab40=['rimraf','../../config/environment','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','bluebird','request-promise','path'];(function(_0x34f545,_0x2bd2ee){var _0x1ff6b8=function(_0x582e3b){while(--_0x582e3b){_0x34f545['push'](_0x34f545['shift']());}};_0x1ff6b8(++_0x2bd2ee);}(_0xab40,0xcd));var _0x0ab4=function(_0x85a8dc,_0x284d37){_0x85a8dc=_0x85a8dc-0x0;var _0x5197a1=_0xab40[_0x85a8dc];return _0x5197a1;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0ab4('0x2'));var rp=require(_0x0ab4('0x3'));var fs=require('fs');var path=require(_0x0ab4('0x4'));var rimraf=require(_0x0ab4('0x5'));var config=require(_0x0ab4('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x28b17a,_0x4ba9d2){return _0x28b17a[_0x0ab4('0x7')](_0x0ab4('0x8'),attributes,{'tableName':_0x0ab4('0x9'),'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 a94f9f3..79eb6eb 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 _0x8c67=['bluebird','ioredis','../../mysqldb','rpc','client','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment'];(function(_0x2bbe8d,_0x5156c2){var _0x539e7a=function(_0x518447){while(--_0x518447){_0x2bbe8d['push'](_0x2bbe8d['shift']());}};_0x539e7a(++_0x5156c2);}(_0x8c67,0x98));var _0x78c6=function(_0x217c54,_0x3ed4ec){_0x217c54=_0x217c54-0x0;var _0x3869d6=_0x8c67[_0x217c54];return _0x3869d6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x78c6('0x0'));var BPromise=require(_0x78c6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78c6('0x2'));var db=require(_0x78c6('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x78c6('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x78c6('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x587312,_0x368c1b,_0x1b5e2b){return new BPromise(function(_0x5a1dd5,_0x23a881){return client['request'](_0x587312,_0x1b5e2b)[_0x78c6('0x6')](function(_0x443a89){logger[_0x78c6('0x7')](_0x78c6('0x8'),_0x368c1b,_0x78c6('0x9'));logger[_0x78c6('0xa')](_0x78c6('0xb'),_0x368c1b,_0x78c6('0x9'),JSON['stringify'](_0x443a89));if(_0x443a89[_0x78c6('0xc')]){if(_0x443a89[_0x78c6('0xc')][_0x78c6('0xd')]===0x1f4){logger['error'](_0x78c6('0x8'),_0x368c1b,_0x443a89[_0x78c6('0xc')][_0x78c6('0xe')]);return _0x23a881(_0x443a89[_0x78c6('0xc')][_0x78c6('0xe')]);}logger['error'](_0x78c6('0x8'),_0x368c1b,_0x443a89[_0x78c6('0xc')][_0x78c6('0xe')]);return _0x5a1dd5(_0x443a89['error'][_0x78c6('0xe')]);}else{logger[_0x78c6('0x7')](_0x78c6('0x8'),_0x368c1b,_0x78c6('0x9'));_0x5a1dd5(_0x443a89[_0x78c6('0xf')][_0x78c6('0xe')]);}})[_0x78c6('0x10')](function(_0x3dff06){logger[_0x78c6('0xc')](_0x78c6('0x8'),_0x368c1b,_0x3dff06);_0x23a881(_0x3dff06);});});} \ No newline at end of file +var _0x50ce=['jayson/promise','client','http','request','then','info','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x718f1f,_0x2e2338){var _0x48b289=function(_0x524e31){while(--_0x524e31){_0x718f1f['push'](_0x718f1f['shift']());}};_0x48b289(++_0x2e2338);}(_0x50ce,0x6c));var _0xe50c=function(_0x533843,_0x3d5ec0){_0x533843=_0x533843-0x0;var _0x55a5f4=_0x50ce[_0x533843];return _0x55a5f4;};'use strict';var _=require(_0xe50c('0x0'));var util=require(_0xe50c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe50c('0x2'));var db=require(_0xe50c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe50c('0x4'))(_0xe50c('0x5'));var config=require(_0xe50c('0x6'));var jayson=require(_0xe50c('0x7'));var client=jayson[_0xe50c('0x8')][_0xe50c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c1242,_0x467dba,_0x54b7f4){return new BPromise(function(_0x439b0c,_0x36841e){return client[_0xe50c('0xa')](_0x3c1242,_0x54b7f4)[_0xe50c('0xb')](function(_0x39b60d){logger[_0xe50c('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x467dba,'request\x20sent');logger[_0xe50c('0xd')](_0xe50c('0xe'),_0x467dba,_0xe50c('0xf'),JSON[_0xe50c('0x10')](_0x39b60d));if(_0x39b60d[_0xe50c('0x11')]){if(_0x39b60d[_0xe50c('0x11')][_0xe50c('0x12')]===0x1f4){logger['error'](_0xe50c('0x13'),_0x467dba,_0x39b60d[_0xe50c('0x11')]['message']);return _0x36841e(_0x39b60d[_0xe50c('0x11')]['message']);}logger['error'](_0xe50c('0x13'),_0x467dba,_0x39b60d['error'][_0xe50c('0x14')]);return _0x439b0c(_0x39b60d[_0xe50c('0x11')][_0xe50c('0x14')]);}else{logger[_0xe50c('0xc')](_0xe50c('0x13'),_0x467dba,_0xe50c('0xf'));_0x439b0c(_0x39b60d[_0xe50c('0x15')][_0xe50c('0x14')]);}})[_0xe50c('0x16')](function(_0xef5311){logger[_0xe50c('0x11')](_0xe50c('0x13'),_0x467dba,_0xef5311);_0x36841e(_0xef5311);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index fb30bda..8b6dbbc 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 _0x3af2=['isAuthenticated','index','/:id','show','post','create','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get'];(function(_0x42c019,_0xd80ed3){var _0x1387f8=function(_0x452ecb){while(--_0x452ecb){_0x42c019['push'](_0x42c019['shift']());}};_0x1387f8(++_0xd80ed3);}(_0x3af2,0x67));var _0x23af=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x3af2[_0x274dd7];return _0x148829;};'use strict';var multer=require('multer');var util=require(_0x23af('0x0'));var path=require(_0x23af('0x1'));var timeout=require(_0x23af('0x2'));var express=require(_0x23af('0x3'));var router=express[_0x23af('0x4')]();var fs_extra=require(_0x23af('0x5'));var auth=require(_0x23af('0x6'));var interaction=require(_0x23af('0x7'));var config=require(_0x23af('0x8'));var controller=require(_0x23af('0x9'));router[_0x23af('0xa')]('/',auth[_0x23af('0xb')](),controller[_0x23af('0xc')]);router[_0x23af('0xa')](_0x23af('0xd'),auth['isAuthenticated'](),controller[_0x23af('0xe')]);router[_0x23af('0xf')]('/',auth[_0x23af('0xb')](),controller[_0x23af('0x10')]);router['put'](_0x23af('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x23af('0x11')](_0x23af('0xd'),auth[_0x23af('0xb')](),controller['destroy']);module[_0x23af('0x12')]=router; \ No newline at end of file +var _0x0e16=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x394041,_0xff3594){var _0x50fe0d=function(_0x17ddc9){while(--_0x17ddc9){_0x394041['push'](_0x394041['shift']());}};_0x50fe0d(++_0xff3594);}(_0x0e16,0x75));var _0x60e1=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x0e16[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0x60e1('0x0'));var util=require(_0x60e1('0x1'));var path=require(_0x60e1('0x2'));var timeout=require(_0x60e1('0x3'));var express=require(_0x60e1('0x4'));var router=express[_0x60e1('0x5')]();var fs_extra=require(_0x60e1('0x6'));var auth=require(_0x60e1('0x7'));var interaction=require(_0x60e1('0x8'));var config=require(_0x60e1('0x9'));var controller=require(_0x60e1('0xa'));router[_0x60e1('0xb')]('/',auth[_0x60e1('0xc')](),controller[_0x60e1('0xd')]);router[_0x60e1('0xb')](_0x60e1('0xe'),auth[_0x60e1('0xc')](),controller[_0x60e1('0xf')]);router[_0x60e1('0x10')]('/',auth[_0x60e1('0xc')](),controller[_0x60e1('0x11')]);router[_0x60e1('0x12')](_0x60e1('0xe'),auth['isAuthenticated'](),controller[_0x60e1('0x13')]);router[_0x60e1('0x14')](_0x60e1('0xe'),auth[_0x60e1('0xc')](),controller[_0x60e1('0x15')]);module[_0x60e1('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 0046b10..2d9f2ff 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 _0x12d4=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x12d4,0x195));var _0x412d=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x12d4[_0x243b2f];return _0xcb3c2d;};'use strict';var Sequelize=require(_0x412d('0x0'));module[_0x412d('0x1')]={'type':{'type':Sequelize[_0x412d('0x2')](_0x412d('0x3'),_0x412d('0x4'),_0x412d('0x5'),_0x412d('0x6'),_0x412d('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x412d('0x8')]},'key':{'type':Sequelize[_0x412d('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0x412d('0x4'),_0x412d('0x5'))},'keyContent':{'type':Sequelize[_0x412d('0x8')]},'idField':{'type':Sequelize[_0x412d('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x412d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x412d('0x8')]}}; \ No newline at end of file +var _0x6613=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x294ff6,_0x515af0){var _0x4028a8=function(_0x33912f){while(--_0x33912f){_0x294ff6['push'](_0x294ff6['shift']());}};_0x4028a8(++_0x515af0);}(_0x6613,0x102));var _0x3661=function(_0x4db6d3,_0x29a03b){_0x4db6d3=_0x4db6d3-0x0;var _0x226111=_0x6613[_0x4db6d3];return _0x226111;};'use strict';var Sequelize=require(_0x3661('0x0'));module[_0x3661('0x1')]={'type':{'type':Sequelize[_0x3661('0x2')](_0x3661('0x3'),_0x3661('0x4'),_0x3661('0x5'),_0x3661('0x6'),_0x3661('0x7')),'defaultValue':_0x3661('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3661('0x8')]},'keyType':{'type':Sequelize[_0x3661('0x2')](_0x3661('0x3'),_0x3661('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x3661('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3661('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index c4fd8c2..9ec6680 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 _0x7747=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','ZendeskField','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x4b9464,_0xc0b9cc){var _0x29dfdf=function(_0x705cce){while(--_0x705cce){_0x4b9464['push'](_0x4b9464['shift']());}};_0x29dfdf(++_0xc0b9cc);}(_0x7747,0xc5));var _0x7774=function(_0x3970d9,_0x43e60d){_0x3970d9=_0x3970d9-0x0;var _0x42ff83=_0x7747[_0x3970d9];return _0x42ff83;};'use strict';var emlformat=require(_0x7774('0x0'));var rimraf=require(_0x7774('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7774('0x2'));var rp=require('request-promise');var moment=require(_0x7774('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7774('0x4'));var util=require(_0x7774('0x5'));var path=require('path');var sox=require(_0x7774('0x6'));var csv=require('to-csv');var ejs=require(_0x7774('0x7'));var fs=require('fs');var fs_extra=require(_0x7774('0x8'));var _=require('lodash');var squel=require(_0x7774('0x9'));var crypto=require('crypto');var jsforce=require(_0x7774('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7774('0xb'));var querystring=require(_0x7774('0xc'));var Papa=require('papaparse');var Redis=require(_0x7774('0xd'));var authService=require(_0x7774('0xe'));var qs=require(_0x7774('0xf'));var as=require(_0x7774('0x10'));var hardwareService=require(_0x7774('0x11'));var logger=require(_0x7774('0x12'))(_0x7774('0x13'));var utils=require(_0x7774('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7774('0x15'));var db=require(_0x7774('0x16'))['db'];function respondWithStatusCode(_0x4be5a8,_0x37d23e){_0x37d23e=_0x37d23e||0xcc;return function(_0x21b2cf){if(_0x21b2cf){return _0x4be5a8[_0x7774('0x17')](_0x37d23e);}return _0x4be5a8[_0x7774('0x18')](_0x37d23e)['end']();};}function respondWithResult(_0x289a25,_0x5ee298){_0x5ee298=_0x5ee298||0xc8;return function(_0x2ed894){if(_0x2ed894){return _0x289a25['status'](_0x5ee298)[_0x7774('0x19')](_0x2ed894);}};}function respondWithFilteredResult(_0x4e1971,_0x116cad){return function(_0x1e4c9f){if(_0x1e4c9f){var _0x2c9dea=typeof _0x116cad[_0x7774('0x1a')]===_0x7774('0x1b')&&typeof _0x116cad[_0x7774('0x1c')]==='undefined';var _0x5e1791=_0x1e4c9f['count'];var _0x1938c1=_0x2c9dea?0x0:_0x116cad[_0x7774('0x1a')];var _0xba08c5=_0x2c9dea?_0x1e4c9f[_0x7774('0x1d')]:_0x116cad[_0x7774('0x1a')]+_0x116cad['limit'];var _0xce7d51;if(_0xba08c5>=_0x5e1791){_0xba08c5=_0x5e1791;_0xce7d51=0xc8;}else{_0xce7d51=0xce;}_0x4e1971[_0x7774('0x18')](_0xce7d51);return _0x4e1971[_0x7774('0x1e')](_0x7774('0x1f'),_0x1938c1+'-'+_0xba08c5+'/'+_0x5e1791)[_0x7774('0x19')](_0x1e4c9f);}return null;};}function patchUpdates(_0x13c50f){return function(_0xad20fe){try{jsonpatch['apply'](_0xad20fe,_0x13c50f,!![]);}catch(_0x4a4700){return BPromise['reject'](_0x4a4700);}return _0xad20fe[_0x7774('0x20')]();};}function saveUpdates(_0xa80a4a,_0x2f0b92){return function(_0x1c96fc){if(_0x1c96fc){return _0x1c96fc['update'](_0xa80a4a)[_0x7774('0x21')](function(_0x146371){return _0x146371;});}return null;};}function removeEntity(_0x256d07,_0x27de44){return function(_0xe88d7){if(_0xe88d7){return _0xe88d7[_0x7774('0x22')]()[_0x7774('0x21')](function(){_0x256d07[_0x7774('0x18')](0xcc)[_0x7774('0x23')]();});}};}function handleEntityNotFound(_0x37f912,_0x53da3f){return function(_0x5a1b06){if(!_0x5a1b06){_0x37f912[_0x7774('0x17')](0x194);}return _0x5a1b06;};}function handleError(_0x56710a,_0x48fbe5){_0x48fbe5=_0x48fbe5||0x1f4;return function(_0x176f51){logger[_0x7774('0x24')](_0x176f51[_0x7774('0x25')]);if(_0x176f51[_0x7774('0x26')]){delete _0x176f51[_0x7774('0x26')];}_0x56710a['status'](_0x48fbe5)['send'](_0x176f51);};}exports[_0x7774('0x27')]=function(_0x3e0aeb,_0x185abf){var _0x379d69={},_0x42acc2={},_0x36f078={'count':0x0,'rows':[]};var _0x5a8af2=_[_0x7774('0x28')](db['ZendeskField'][_0x7774('0x29')],function(_0x22c99a){return{'name':_0x22c99a[_0x7774('0x2a')],'type':_0x22c99a[_0x7774('0x2b')][_0x7774('0x2c')]};});_0x42acc2[_0x7774('0x2d')]=_['map'](_0x5a8af2,_0x7774('0x26'));_0x42acc2['query']=_[_0x7774('0x2e')](_0x3e0aeb['query']);_0x42acc2[_0x7774('0x2f')]=_[_0x7774('0x30')](_0x42acc2[_0x7774('0x2d')],_0x42acc2['query']);_0x379d69[_0x7774('0x31')]=_['intersection'](_0x42acc2[_0x7774('0x2d')],qs[_0x7774('0x32')](_0x3e0aeb[_0x7774('0x33')][_0x7774('0x32')]));_0x379d69[_0x7774('0x31')]=_0x379d69['attributes'][_0x7774('0x34')]?_0x379d69[_0x7774('0x31')]:_0x42acc2[_0x7774('0x2d')];if(!_0x3e0aeb['query'][_0x7774('0x35')](_0x7774('0x36'))){_0x379d69[_0x7774('0x1c')]=qs['limit'](_0x3e0aeb[_0x7774('0x33')][_0x7774('0x1c')]);_0x379d69[_0x7774('0x1a')]=qs[_0x7774('0x1a')](_0x3e0aeb[_0x7774('0x33')][_0x7774('0x1a')]);}_0x379d69['order']=qs[_0x7774('0x37')](_0x3e0aeb[_0x7774('0x33')][_0x7774('0x37')]);_0x379d69[_0x7774('0x38')]=qs[_0x7774('0x2f')](_[_0x7774('0x39')](_0x3e0aeb[_0x7774('0x33')],_0x42acc2['filters']),_0x5a8af2);if(_0x3e0aeb['query'][_0x7774('0x3a')]){_0x379d69[_0x7774('0x38')]=_['merge'](_0x379d69[_0x7774('0x38')],{'$or':_[_0x7774('0x28')](_0x5a8af2,function(_0x2b0ab0){if(_0x2b0ab0[_0x7774('0x2b')]!=='VIRTUAL'){var _0x1e82cb={};_0x1e82cb[_0x2b0ab0['name']]={'$like':'%'+_0x3e0aeb[_0x7774('0x33')][_0x7774('0x3a')]+'%'};return _0x1e82cb;}})});}_0x379d69=_[_0x7774('0x3b')]({},_0x379d69,_0x3e0aeb['options']);var _0x297c6b={'where':_0x379d69['where']};return db[_0x7774('0x3c')][_0x7774('0x1d')](_0x297c6b)['then'](function(_0x2785ff){_0x36f078[_0x7774('0x1d')]=_0x2785ff;if(_0x3e0aeb[_0x7774('0x33')][_0x7774('0x3d')]){_0x379d69[_0x7774('0x3e')]=[{'all':!![]}];}return db[_0x7774('0x3c')][_0x7774('0x3f')](_0x379d69);})['then'](function(_0x5e0f95){_0x36f078[_0x7774('0x40')]=_0x5e0f95;return _0x36f078;})['then'](respondWithFilteredResult(_0x185abf,_0x379d69))[_0x7774('0x41')](handleError(_0x185abf,null));};exports[_0x7774('0x42')]=function(_0x1f6edd,_0x5a1632){var _0x1b9fec={'raw':!![],'where':{'id':_0x1f6edd[_0x7774('0x43')]['id']}},_0x7b6333={};_0x7b6333['model']=_[_0x7774('0x2e')](db[_0x7774('0x3c')][_0x7774('0x29')]);_0x7b6333['query']=_[_0x7774('0x2e')](_0x1f6edd[_0x7774('0x33')]);_0x7b6333['filters']=_[_0x7774('0x30')](_0x7b6333['model'],_0x7b6333[_0x7774('0x33')]);_0x1b9fec[_0x7774('0x31')]=_[_0x7774('0x30')](_0x7b6333[_0x7774('0x2d')],qs[_0x7774('0x32')](_0x1f6edd[_0x7774('0x33')][_0x7774('0x32')]));_0x1b9fec['attributes']=_0x1b9fec[_0x7774('0x31')]['length']?_0x1b9fec[_0x7774('0x31')]:_0x7b6333[_0x7774('0x2d')];if(_0x1f6edd[_0x7774('0x33')][_0x7774('0x3d')]){_0x1b9fec[_0x7774('0x3e')]=[{'all':!![]}];}_0x1b9fec=_[_0x7774('0x3b')]({},_0x1b9fec,_0x1f6edd[_0x7774('0x44')]);return db[_0x7774('0x3c')][_0x7774('0x45')](_0x1b9fec)[_0x7774('0x21')](handleEntityNotFound(_0x5a1632,null))[_0x7774('0x21')](respondWithResult(_0x5a1632,null))[_0x7774('0x41')](handleError(_0x5a1632,null));};exports[_0x7774('0x46')]=function(_0x3d432d,_0xf44eb3){return db[_0x7774('0x3c')][_0x7774('0x46')](_0x3d432d[_0x7774('0x47')],{})['then'](respondWithResult(_0xf44eb3,0xc9))[_0x7774('0x41')](handleError(_0xf44eb3,null));};exports[_0x7774('0x48')]=function(_0x257159,_0x51640b){if(_0x257159[_0x7774('0x47')]['id']){delete _0x257159[_0x7774('0x47')]['id'];}return db[_0x7774('0x3c')][_0x7774('0x45')]({'where':{'id':_0x257159['params']['id']}})[_0x7774('0x21')](handleEntityNotFound(_0x51640b,null))[_0x7774('0x21')](saveUpdates(_0x257159[_0x7774('0x47')],null))[_0x7774('0x21')](respondWithResult(_0x51640b,null))[_0x7774('0x41')](handleError(_0x51640b,null));};exports[_0x7774('0x22')]=function(_0xc2743,_0x5005b5){return db[_0x7774('0x3c')][_0x7774('0x45')]({'where':{'id':_0xc2743[_0x7774('0x43')]['id']}})['then'](handleEntityNotFound(_0x5005b5,null))['then'](removeEntity(_0x5005b5,null))['catch'](handleError(_0x5005b5,null));}; \ No newline at end of file +var _0xbeb4=['includeAll','include','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','save','update','then','destroy','end','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xbeb4,0x96));var _0x4beb=function(_0x295007,_0x10094c){_0x295007=_0x295007-0x0;var _0x546464=_0xbeb4[_0x295007];return _0x546464;};'use strict';var emlformat=require(_0x4beb('0x0'));var rimraf=require(_0x4beb('0x1'));var zipdir=require(_0x4beb('0x2'));var jsonpatch=require(_0x4beb('0x3'));var rp=require('request-promise');var moment=require(_0x4beb('0x4'));var BPromise=require(_0x4beb('0x5'));var Mustache=require(_0x4beb('0x6'));var util=require('util');var path=require(_0x4beb('0x7'));var sox=require(_0x4beb('0x8'));var csv=require('to-csv');var ejs=require(_0x4beb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4beb('0xa'));var squel=require(_0x4beb('0xb'));var crypto=require('crypto');var jsforce=require(_0x4beb('0xc'));var deskjs=require(_0x4beb('0xd'));var toCsv=require(_0x4beb('0xe'));var querystring=require(_0x4beb('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4beb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4beb('0x11'));var hardwareService=require(_0x4beb('0x12'));var logger=require(_0x4beb('0x13'))('api');var utils=require(_0x4beb('0x14'));var config=require(_0x4beb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4beb('0x16'))['db'];function respondWithStatusCode(_0x461972,_0x3c7104){_0x3c7104=_0x3c7104||0xcc;return function(_0x2488cd){if(_0x2488cd){return _0x461972[_0x4beb('0x17')](_0x3c7104);}return _0x461972[_0x4beb('0x18')](_0x3c7104)['end']();};}function respondWithResult(_0x43de11,_0x463811){_0x463811=_0x463811||0xc8;return function(_0x1c47b1){if(_0x1c47b1){return _0x43de11[_0x4beb('0x18')](_0x463811)[_0x4beb('0x19')](_0x1c47b1);}};}function respondWithFilteredResult(_0x2fd606,_0x500572){return function(_0x74752){if(_0x74752){var _0x3be089=typeof _0x500572[_0x4beb('0x1a')]===_0x4beb('0x1b')&&typeof _0x500572[_0x4beb('0x1c')]==='undefined';var _0x64f873=_0x74752[_0x4beb('0x1d')];var _0x3ad43d=_0x3be089?0x0:_0x500572[_0x4beb('0x1a')];var _0x399f7c=_0x3be089?_0x74752[_0x4beb('0x1d')]:_0x500572[_0x4beb('0x1a')]+_0x500572[_0x4beb('0x1c')];var _0x138bea;if(_0x399f7c>=_0x64f873){_0x399f7c=_0x64f873;_0x138bea=0xc8;}else{_0x138bea=0xce;}_0x2fd606[_0x4beb('0x18')](_0x138bea);return _0x2fd606[_0x4beb('0x1e')]('Content-Range',_0x3ad43d+'-'+_0x399f7c+'/'+_0x64f873)[_0x4beb('0x19')](_0x74752);}return null;};}function patchUpdates(_0x115e4c){return function(_0x4f6699){try{jsonpatch['apply'](_0x4f6699,_0x115e4c,!![]);}catch(_0x2aeec6){return BPromise['reject'](_0x2aeec6);}return _0x4f6699[_0x4beb('0x1f')]();};}function saveUpdates(_0xa3e70c,_0x29d47e){return function(_0x32da4a){if(_0x32da4a){return _0x32da4a[_0x4beb('0x20')](_0xa3e70c)[_0x4beb('0x21')](function(_0x290d8e){return _0x290d8e;});}return null;};}function removeEntity(_0x5e30d5,_0x41593d){return function(_0x57f87f){if(_0x57f87f){return _0x57f87f[_0x4beb('0x22')]()[_0x4beb('0x21')](function(){_0x5e30d5[_0x4beb('0x18')](0xcc)[_0x4beb('0x23')]();});}};}function handleEntityNotFound(_0x395a40,_0x5d6437){return function(_0x5ab30b){if(!_0x5ab30b){_0x395a40[_0x4beb('0x17')](0x194);}return _0x5ab30b;};}function handleError(_0x1b90f3,_0x2f91c8){_0x2f91c8=_0x2f91c8||0x1f4;return function(_0x5e2079){logger[_0x4beb('0x24')](_0x5e2079[_0x4beb('0x25')]);if(_0x5e2079['name']){delete _0x5e2079[_0x4beb('0x26')];}_0x1b90f3['status'](_0x2f91c8)[_0x4beb('0x27')](_0x5e2079);};}exports[_0x4beb('0x28')]=function(_0x452b97,_0x5a8599){var _0x37d550={},_0x3505e4={},_0x120ee6={'count':0x0,'rows':[]};var _0x16521d=_[_0x4beb('0x29')](db[_0x4beb('0x2a')][_0x4beb('0x2b')],function(_0x3ce24d){return{'name':_0x3ce24d[_0x4beb('0x2c')],'type':_0x3ce24d[_0x4beb('0x2d')][_0x4beb('0x2e')]};});_0x3505e4[_0x4beb('0x2f')]=_[_0x4beb('0x29')](_0x16521d,_0x4beb('0x26'));_0x3505e4[_0x4beb('0x30')]=_[_0x4beb('0x31')](_0x452b97[_0x4beb('0x30')]);_0x3505e4[_0x4beb('0x32')]=_[_0x4beb('0x33')](_0x3505e4['model'],_0x3505e4[_0x4beb('0x30')]);_0x37d550[_0x4beb('0x34')]=_[_0x4beb('0x33')](_0x3505e4[_0x4beb('0x2f')],qs[_0x4beb('0x35')](_0x452b97[_0x4beb('0x30')][_0x4beb('0x35')]));_0x37d550[_0x4beb('0x34')]=_0x37d550[_0x4beb('0x34')][_0x4beb('0x36')]?_0x37d550['attributes']:_0x3505e4['model'];if(!_0x452b97[_0x4beb('0x30')][_0x4beb('0x37')](_0x4beb('0x38'))){_0x37d550[_0x4beb('0x1c')]=qs[_0x4beb('0x1c')](_0x452b97['query'][_0x4beb('0x1c')]);_0x37d550[_0x4beb('0x1a')]=qs['offset'](_0x452b97['query'][_0x4beb('0x1a')]);}_0x37d550[_0x4beb('0x39')]=qs[_0x4beb('0x3a')](_0x452b97['query'][_0x4beb('0x3a')]);_0x37d550[_0x4beb('0x3b')]=qs[_0x4beb('0x32')](_[_0x4beb('0x3c')](_0x452b97[_0x4beb('0x30')],_0x3505e4[_0x4beb('0x32')]),_0x16521d);if(_0x452b97['query'][_0x4beb('0x3d')]){_0x37d550['where']=_['merge'](_0x37d550[_0x4beb('0x3b')],{'$or':_[_0x4beb('0x29')](_0x16521d,function(_0x3e6d2a){if(_0x3e6d2a[_0x4beb('0x2d')]!=='VIRTUAL'){var _0x54661c={};_0x54661c[_0x3e6d2a[_0x4beb('0x26')]]={'$like':'%'+_0x452b97[_0x4beb('0x30')][_0x4beb('0x3d')]+'%'};return _0x54661c;}})});}_0x37d550=_['merge']({},_0x37d550,_0x452b97[_0x4beb('0x3e')]);var _0x11780d={'where':_0x37d550[_0x4beb('0x3b')]};return db['ZendeskField'][_0x4beb('0x1d')](_0x11780d)[_0x4beb('0x21')](function(_0x9c1c00){_0x120ee6['count']=_0x9c1c00;if(_0x452b97[_0x4beb('0x30')][_0x4beb('0x3f')]){_0x37d550[_0x4beb('0x40')]=[{'all':!![]}];}return db[_0x4beb('0x2a')]['findAll'](_0x37d550);})[_0x4beb('0x21')](function(_0x384425){_0x120ee6[_0x4beb('0x41')]=_0x384425;return _0x120ee6;})[_0x4beb('0x21')](respondWithFilteredResult(_0x5a8599,_0x37d550))[_0x4beb('0x42')](handleError(_0x5a8599,null));};exports['show']=function(_0x4a9327,_0x3c3cc4){var _0x514a0c={'raw':!![],'where':{'id':_0x4a9327[_0x4beb('0x43')]['id']}},_0x4ac95e={};_0x4ac95e[_0x4beb('0x2f')]=_['keys'](db[_0x4beb('0x2a')][_0x4beb('0x2b')]);_0x4ac95e[_0x4beb('0x30')]=_['keys'](_0x4a9327['query']);_0x4ac95e[_0x4beb('0x32')]=_[_0x4beb('0x33')](_0x4ac95e[_0x4beb('0x2f')],_0x4ac95e['query']);_0x514a0c['attributes']=_[_0x4beb('0x33')](_0x4ac95e[_0x4beb('0x2f')],qs[_0x4beb('0x35')](_0x4a9327[_0x4beb('0x30')][_0x4beb('0x35')]));_0x514a0c['attributes']=_0x514a0c[_0x4beb('0x34')]['length']?_0x514a0c[_0x4beb('0x34')]:_0x4ac95e[_0x4beb('0x2f')];if(_0x4a9327[_0x4beb('0x30')][_0x4beb('0x3f')]){_0x514a0c[_0x4beb('0x40')]=[{'all':!![]}];}_0x514a0c=_['merge']({},_0x514a0c,_0x4a9327[_0x4beb('0x3e')]);return db['ZendeskField'][_0x4beb('0x44')](_0x514a0c)[_0x4beb('0x21')](handleEntityNotFound(_0x3c3cc4,null))[_0x4beb('0x21')](respondWithResult(_0x3c3cc4,null))[_0x4beb('0x42')](handleError(_0x3c3cc4,null));};exports[_0x4beb('0x45')]=function(_0x22bec1,_0x1191e3){return db[_0x4beb('0x2a')][_0x4beb('0x45')](_0x22bec1[_0x4beb('0x46')],{})[_0x4beb('0x21')](respondWithResult(_0x1191e3,0xc9))[_0x4beb('0x42')](handleError(_0x1191e3,null));};exports[_0x4beb('0x20')]=function(_0x1619a7,_0x3a3f27){if(_0x1619a7[_0x4beb('0x46')]['id']){delete _0x1619a7[_0x4beb('0x46')]['id'];}return db[_0x4beb('0x2a')][_0x4beb('0x44')]({'where':{'id':_0x1619a7[_0x4beb('0x43')]['id']}})[_0x4beb('0x21')](handleEntityNotFound(_0x3a3f27,null))[_0x4beb('0x21')](saveUpdates(_0x1619a7[_0x4beb('0x46')],null))[_0x4beb('0x21')](respondWithResult(_0x3a3f27,null))['catch'](handleError(_0x3a3f27,null));};exports[_0x4beb('0x22')]=function(_0x2d33c5,_0x324f3f){return db[_0x4beb('0x2a')][_0x4beb('0x44')]({'where':{'id':_0x2d33c5[_0x4beb('0x43')]['id']}})[_0x4beb('0x21')](handleEntityNotFound(_0x324f3f,null))[_0x4beb('0x21')](removeEntity(_0x324f3f,null))['catch'](handleError(_0x324f3f,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 83a7654..4516286 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 _0x7df3=['exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZendeskField.attributes'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7df3,0x1c8));var _0x37df=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7df3[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x37df('0x0'));var util=require(_0x37df('0x1'));var logger=require(_0x37df('0x2'))(_0x37df('0x3'));var moment=require(_0x37df('0x4'));var BPromise=require(_0x37df('0x5'));var rp=require(_0x37df('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37df('0x7'));var config=require('../../config/environment');var attributes=require(_0x37df('0x8'));module[_0x37df('0x9')]=function(_0x2418e8,_0x4cc7aa){return _0x2418e8[_0x37df('0xa')](_0x37df('0xb'),attributes,{'tableName':_0x37df('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x37df('0xd'),_0x37df('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x86e5=['util','api','bluebird','request-promise','path','exports','define','ZendeskField','int_zendesk_fields','lodash'];(function(_0x1c9f4c,_0x22ba1d){var _0x26053e=function(_0x2b70f6){while(--_0x2b70f6){_0x1c9f4c['push'](_0x1c9f4c['shift']());}};_0x26053e(++_0x22ba1d);}(_0x86e5,0x121));var _0x586e=function(_0x382fcc,_0x33cd54){_0x382fcc=_0x382fcc-0x0;var _0x1e6b14=_0x86e5[_0x382fcc];return _0x1e6b14;};'use strict';var _=require(_0x586e('0x0'));var util=require(_0x586e('0x1'));var logger=require('../../config/logger')(_0x586e('0x2'));var moment=require('moment');var BPromise=require(_0x586e('0x3'));var rp=require(_0x586e('0x4'));var fs=require('fs');var path=require(_0x586e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module[_0x586e('0x6')]=function(_0x3652c1,_0x35114f){return _0x3652c1[_0x586e('0x7')](_0x586e('0x8'),attributes,{'tableName':_0x586e('0x9'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField','FieldId'],'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 2300f5d..d90092c 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 _0xd576=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4245ad,_0x109fa6){var _0x37100c=function(_0x83a41f){while(--_0x83a41f){_0x4245ad['push'](_0x4245ad['shift']());}};_0x37100c(++_0x109fa6);}(_0xd576,0xd2));var _0x6d57=function(_0x7677eb,_0x59ba67){_0x7677eb=_0x7677eb-0x0;var _0x523039=_0xd576[_0x7677eb];return _0x523039;};'use strict';var _=require('lodash');var util=require(_0x6d57('0x0'));var moment=require(_0x6d57('0x1'));var BPromise=require(_0x6d57('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d57('0x3'));var db=require(_0x6d57('0x4'))['db'];var utils=require(_0x6d57('0x5'));var logger=require(_0x6d57('0x6'))(_0x6d57('0x7'));var config=require(_0x6d57('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6d57('0x9')][_0x6d57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32380c,_0x29f977,_0x47db63){return new BPromise(function(_0x327f9c,_0x4ba792){return client[_0x6d57('0xb')](_0x32380c,_0x47db63)[_0x6d57('0xc')](function(_0x59267f){logger[_0x6d57('0xd')](_0x6d57('0xe'),_0x29f977,_0x6d57('0xf'));logger[_0x6d57('0x10')](_0x6d57('0x11'),_0x29f977,_0x6d57('0xf'),JSON[_0x6d57('0x12')](_0x59267f));if(_0x59267f[_0x6d57('0x13')]){if(_0x59267f[_0x6d57('0x13')][_0x6d57('0x14')]===0x1f4){logger[_0x6d57('0x13')](_0x6d57('0xe'),_0x29f977,_0x59267f[_0x6d57('0x13')]['message']);return _0x4ba792(_0x59267f[_0x6d57('0x13')][_0x6d57('0x15')]);}logger['error'](_0x6d57('0xe'),_0x29f977,_0x59267f[_0x6d57('0x13')][_0x6d57('0x15')]);return _0x327f9c(_0x59267f[_0x6d57('0x13')][_0x6d57('0x15')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x29f977,_0x6d57('0xf'));_0x327f9c(_0x59267f[_0x6d57('0x16')][_0x6d57('0x15')]);}})[_0x6d57('0x17')](function(_0x3cb6d6){logger[_0x6d57('0x13')](_0x6d57('0xe'),_0x29f977,_0x3cb6d6);_0x4ba792(_0x3cb6d6);});});} \ No newline at end of file +var _0x67f7=['error','code','message','ZendeskField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3b72af,_0x1ecf7d){var _0xddf166=function(_0x4f5e44){while(--_0x4f5e44){_0x3b72af['push'](_0x3b72af['shift']());}};_0xddf166(++_0x1ecf7d);}(_0x67f7,0xe2));var _0x767f=function(_0x43e3fa,_0xe93171){_0x43e3fa=_0x43e3fa-0x0;var _0xb66811=_0x67f7[_0x43e3fa];return _0xb66811;};'use strict';var _=require(_0x767f('0x0'));var util=require(_0x767f('0x1'));var moment=require(_0x767f('0x2'));var BPromise=require(_0x767f('0x3'));var rs=require(_0x767f('0x4'));var fs=require('fs');var Redis=require(_0x767f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x767f('0x6'));var logger=require('../../config/logger')(_0x767f('0x7'));var config=require(_0x767f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x767f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x76506d,_0x411b06,_0x1dd82c){return new BPromise(function(_0x5267de,_0x2a5848){return client[_0x767f('0xa')](_0x76506d,_0x1dd82c)[_0x767f('0xb')](function(_0x5380f8){logger[_0x767f('0xc')]('ZendeskField,\x20%s,\x20%s',_0x411b06,_0x767f('0xd'));logger['debug'](_0x767f('0xe'),_0x411b06,_0x767f('0xd'),JSON[_0x767f('0xf')](_0x5380f8));if(_0x5380f8[_0x767f('0x10')]){if(_0x5380f8[_0x767f('0x10')][_0x767f('0x11')]===0x1f4){logger[_0x767f('0x10')]('ZendeskField,\x20%s,\x20%s',_0x411b06,_0x5380f8['error'][_0x767f('0x12')]);return _0x2a5848(_0x5380f8[_0x767f('0x10')]['message']);}logger[_0x767f('0x10')](_0x767f('0x13'),_0x411b06,_0x5380f8[_0x767f('0x10')]['message']);return _0x5267de(_0x5380f8[_0x767f('0x10')][_0x767f('0x12')]);}else{logger['info'](_0x767f('0x13'),_0x411b06,_0x767f('0xd'));_0x5267de(_0x5380f8[_0x767f('0x14')][_0x767f('0x12')]);}})[_0x767f('0x15')](function(_0x2a2143){logger[_0x767f('0x10')](_0x767f('0x13'),_0x411b06,_0x2a2143);_0x2a5848(_0x2a2143);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 8c2e4e8..c08b404 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 _0xbbb1=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','/:id','update','delete','destroy'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0xbbb1,0x11e));var _0x1bbb=function(_0x1f3408,_0x42ebc6){_0x1f3408=_0x1f3408-0x0;var _0x2e897e=_0xbbb1[_0x1f3408];return _0x2e897e;};'use strict';var multer=require('multer');var util=require(_0x1bbb('0x0'));var path=require(_0x1bbb('0x1'));var timeout=require(_0x1bbb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1bbb('0x3'));var auth=require(_0x1bbb('0x4'));var interaction=require(_0x1bbb('0x5'));var config=require(_0x1bbb('0x6'));var controller=require(_0x1bbb('0x7'));router[_0x1bbb('0x8')]('/',auth[_0x1bbb('0x9')](),controller[_0x1bbb('0xa')]);router[_0x1bbb('0x8')]('/:id',auth[_0x1bbb('0x9')](),controller[_0x1bbb('0xb')]);router['get'](_0x1bbb('0xc'),auth[_0x1bbb('0x9')](),controller[_0x1bbb('0xd')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x1bbb('0xe')]('/',auth['isAuthenticated'](),controller[_0x1bbb('0xf')]);router['post'](_0x1bbb('0xc'),auth[_0x1bbb('0x9')](),controller[_0x1bbb('0x10')]);router[_0x1bbb('0x11')](_0x1bbb('0x12'),auth[_0x1bbb('0x9')](),controller[_0x1bbb('0x13')]);router[_0x1bbb('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x1bbb('0x15')]);module['exports']=router; \ No newline at end of file +var _0xa2f4=['./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3927a9,_0x253765){var _0xa3231a=function(_0x454f44){while(--_0x454f44){_0x3927a9['push'](_0x3927a9['shift']());}};_0xa3231a(++_0x253765);}(_0xa2f4,0x93));var _0x4a2f=function(_0x20714a,_0x7de591){_0x20714a=_0x20714a-0x0;var _0x15e877=_0xa2f4[_0x20714a];return _0x15e877;};'use strict';var multer=require(_0x4a2f('0x0'));var util=require(_0x4a2f('0x1'));var path=require(_0x4a2f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4a2f('0x3'));var auth=require(_0x4a2f('0x4'));var interaction=require(_0x4a2f('0x5'));var config=require(_0x4a2f('0x6'));var controller=require(_0x4a2f('0x7'));router[_0x4a2f('0x8')]('/',auth[_0x4a2f('0x9')](),controller[_0x4a2f('0xa')]);router[_0x4a2f('0x8')](_0x4a2f('0xb'),auth['isAuthenticated'](),controller[_0x4a2f('0xc')]);router[_0x4a2f('0x8')](_0x4a2f('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x4a2f('0xe'),auth['isAuthenticated'](),controller[_0x4a2f('0xf')]);router[_0x4a2f('0x10')]('/',auth[_0x4a2f('0x9')](),controller[_0x4a2f('0x11')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0x4a2f('0x9')](),controller[_0x4a2f('0x12')]);router[_0x4a2f('0x13')](_0x4a2f('0xb'),auth[_0x4a2f('0x9')](),controller[_0x4a2f('0x14')]);module[_0x4a2f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index d11921d..7332a5a 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 _0x00bb=['STRING','sequelize','exports'];(function(_0x2d29bd,_0x287528){var _0x567045=function(_0x35edf6){while(--_0x35edf6){_0x2d29bd['push'](_0x2d29bd['shift']());}};_0x567045(++_0x287528);}(_0x00bb,0x1d8));var _0xb00b=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x00bb[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'name':{'type':Sequelize[_0xb00b('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb00b('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb00b('0x2')]},'clientSecret':{'type':Sequelize[_0xb00b('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0xb00b('0x2')]},'refreshToken':{'type':Sequelize[_0xb00b('0x2')]}}; \ No newline at end of file +var _0x6f0d=['exports','STRING'];(function(_0x594bcd,_0xf9d156){var _0x295d59=function(_0x3058e0){while(--_0x3058e0){_0x594bcd['push'](_0x594bcd['shift']());}};_0x295d59(++_0xf9d156);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x480afe,_0x175253){_0x480afe=_0x480afe-0x0;var _0x19e5f9=_0x6f0d[_0x480afe];return _0x19e5f9;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'name':{'type':Sequelize[_0xd6f0('0x1')]},'description':{'type':Sequelize[_0xd6f0('0x1')]},'host':{'type':Sequelize[_0xd6f0('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd6f0('0x1')]},'clientSecret':{'type':Sequelize[_0xd6f0('0x1')]},'serverUrl':{'type':Sequelize[_0xd6f0('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xd6f0('0x1')]},'refreshToken':{'type':Sequelize[_0xd6f0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index a8eed2e..a753ea1 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 _0xfe73=['Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','data_type','picklist','pick_list_values','statusCode','send','test','Wrong\x20credentials','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','status','undefined','limit','count','offset','set','json','apply','reject','then','destroy','error','stack','name','index','ZohoAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','pick','addConfiguration','findOne','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoConfiguration','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','refreshToken','com','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject'];(function(_0x5213b3,_0x147fe3){var _0x4eeceb=function(_0x45642d){while(--_0x45642d){_0x5213b3['push'](_0x5213b3['shift']());}};_0x4eeceb(++_0x147fe3);}(_0xfe73,0x8a));var _0x3fe7=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xfe73[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3fe7('0x0'));var zipdir=require(_0x3fe7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fe7('0x2'));var moment=require('moment');var BPromise=require(_0x3fe7('0x3'));var Mustache=require('mustache');var util=require(_0x3fe7('0x4'));var path=require(_0x3fe7('0x5'));var sox=require(_0x3fe7('0x6'));var csv=require(_0x3fe7('0x7'));var ejs=require(_0x3fe7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3fe7('0x9'));var squel=require(_0x3fe7('0xa'));var crypto=require(_0x3fe7('0xb'));var jsforce=require(_0x3fe7('0xc'));var deskjs=require(_0x3fe7('0xd'));var toCsv=require(_0x3fe7('0x7'));var querystring=require(_0x3fe7('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3fe7('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3fe7('0x10'));var logger=require(_0x3fe7('0x11'))(_0x3fe7('0x12'));var utils=require(_0x3fe7('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3fe7('0x14'))['db'];var integrations=require(_0x3fe7('0x15'));function respondWithStatusCode(_0x44bb8e,_0x4a1322){_0x4a1322=_0x4a1322||0xcc;return function(_0x3f1194){if(_0x3f1194){return _0x44bb8e['sendStatus'](_0x4a1322);}return _0x44bb8e['status'](_0x4a1322)['end']();};}function respondWithResult(_0x5742eb,_0xe2c7f0){_0xe2c7f0=_0xe2c7f0||0xc8;return function(_0x5d4157){if(_0x5d4157){return _0x5742eb[_0x3fe7('0x16')](_0xe2c7f0)['json'](_0x5d4157);}};}function respondWithFilteredResult(_0x65898d,_0x4ec8a7){return function(_0x2805ce){if(_0x2805ce){var _0x4ba6a6=typeof _0x4ec8a7['offset']===_0x3fe7('0x17')&&typeof _0x4ec8a7[_0x3fe7('0x18')]===_0x3fe7('0x17');var _0x539517=_0x2805ce[_0x3fe7('0x19')];var _0x46ce34=_0x4ba6a6?0x0:_0x4ec8a7[_0x3fe7('0x1a')];var _0x322fd4=_0x4ba6a6?_0x2805ce[_0x3fe7('0x19')]:_0x4ec8a7[_0x3fe7('0x1a')]+_0x4ec8a7[_0x3fe7('0x18')];var _0x10fa94;if(_0x322fd4>=_0x539517){_0x322fd4=_0x539517;_0x10fa94=0xc8;}else{_0x10fa94=0xce;}_0x65898d[_0x3fe7('0x16')](_0x10fa94);return _0x65898d[_0x3fe7('0x1b')]('Content-Range',_0x46ce34+'-'+_0x322fd4+'/'+_0x539517)[_0x3fe7('0x1c')](_0x2805ce);}return null;};}function patchUpdates(_0x300b35){return function(_0x300681){try{jsonpatch[_0x3fe7('0x1d')](_0x300681,_0x300b35,!![]);}catch(_0x5ab3ed){return BPromise[_0x3fe7('0x1e')](_0x5ab3ed);}return _0x300681['save']();};}function saveUpdates(_0x3a347e,_0x285284){return function(_0x28a461){if(_0x28a461){return _0x28a461['update'](_0x3a347e)[_0x3fe7('0x1f')](function(_0x26dc1d){return _0x26dc1d;});}return null;};}function removeEntity(_0xf6ba75,_0x5dcbca){return function(_0x4ee970){if(_0x4ee970){return _0x4ee970[_0x3fe7('0x20')]()['then'](function(){_0xf6ba75[_0x3fe7('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42f27c,_0x51112b){return function(_0x31c351){if(!_0x31c351){_0x42f27c['sendStatus'](0x194);}return _0x31c351;};}function handleError(_0x178a72,_0x377204){_0x377204=_0x377204||0x1f4;return function(_0x33c8d7){logger[_0x3fe7('0x21')](_0x33c8d7[_0x3fe7('0x22')]);if(_0x33c8d7[_0x3fe7('0x23')]){delete _0x33c8d7['name'];}_0x178a72['status'](_0x377204)['send'](_0x33c8d7);};}exports[_0x3fe7('0x24')]=function(_0x43cfaa,_0x5ddeff){var _0x385401={},_0x278625={},_0x144adb={'count':0x0,'rows':[]};var _0x356d94=_['map'](db[_0x3fe7('0x25')]['rawAttributes'],function(_0x4d8018){return{'name':_0x4d8018[_0x3fe7('0x26')],'type':_0x4d8018[_0x3fe7('0x27')][_0x3fe7('0x28')]};});_0x278625[_0x3fe7('0x29')]=_[_0x3fe7('0x2a')](_0x356d94,_0x3fe7('0x23'));_0x278625[_0x3fe7('0x2b')]=_[_0x3fe7('0x2c')](_0x43cfaa[_0x3fe7('0x2b')]);_0x278625[_0x3fe7('0x2d')]=_[_0x3fe7('0x2e')](_0x278625[_0x3fe7('0x29')],_0x278625[_0x3fe7('0x2b')]);_0x385401[_0x3fe7('0x2f')]=_[_0x3fe7('0x2e')](_0x278625['model'],qs[_0x3fe7('0x30')](_0x43cfaa['query']['fields']));_0x385401['attributes']=_0x385401[_0x3fe7('0x2f')][_0x3fe7('0x31')]?_0x385401[_0x3fe7('0x2f')]:_0x278625['model'];if(!_0x43cfaa[_0x3fe7('0x2b')]['hasOwnProperty'](_0x3fe7('0x32'))){_0x385401[_0x3fe7('0x18')]=qs[_0x3fe7('0x18')](_0x43cfaa[_0x3fe7('0x2b')]['limit']);_0x385401[_0x3fe7('0x1a')]=qs[_0x3fe7('0x1a')](_0x43cfaa[_0x3fe7('0x2b')][_0x3fe7('0x1a')]);}_0x385401[_0x3fe7('0x33')]=qs[_0x3fe7('0x34')](_0x43cfaa[_0x3fe7('0x2b')][_0x3fe7('0x34')]);_0x385401[_0x3fe7('0x35')]=qs[_0x3fe7('0x2d')](_['pick'](_0x43cfaa[_0x3fe7('0x2b')],_0x278625[_0x3fe7('0x2d')]),_0x356d94);if(_0x43cfaa[_0x3fe7('0x2b')]['filter']){_0x385401[_0x3fe7('0x35')]=_['merge'](_0x385401['where'],{'$or':_['map'](_0x356d94,function(_0x3e06a3){if(_0x3e06a3[_0x3fe7('0x27')]!==_0x3fe7('0x36')){var _0x1990d9={};_0x1990d9[_0x3e06a3[_0x3fe7('0x23')]]={'$like':'%'+_0x43cfaa['query'][_0x3fe7('0x37')]+'%'};return _0x1990d9;}})});}_0x385401=_[_0x3fe7('0x38')]({},_0x385401,_0x43cfaa[_0x3fe7('0x39')]);var _0x3333f8={'where':_0x385401['where']};return db[_0x3fe7('0x25')]['count'](_0x3333f8)[_0x3fe7('0x1f')](function(_0x378b69){_0x144adb['count']=_0x378b69;if(_0x43cfaa[_0x3fe7('0x2b')][_0x3fe7('0x3a')]){_0x385401[_0x3fe7('0x3b')]=[{'all':!![]}];}return db[_0x3fe7('0x25')][_0x3fe7('0x3c')](_0x385401);})[_0x3fe7('0x1f')](function(_0x88612b){_0x144adb[_0x3fe7('0x3d')]=_0x88612b;return _0x144adb;})[_0x3fe7('0x1f')](respondWithFilteredResult(_0x5ddeff,_0x385401))[_0x3fe7('0x3e')](handleError(_0x5ddeff,null));};exports[_0x3fe7('0x3f')]=function(_0x213235,_0x58f0c7){var _0x1be9b9={'raw':![],'where':{'id':_0x213235[_0x3fe7('0x40')]['id']}},_0x52b426={};_0x52b426['model']=_[_0x3fe7('0x2c')](db[_0x3fe7('0x25')][_0x3fe7('0x41')]);_0x52b426[_0x3fe7('0x2b')]=_['keys'](_0x213235[_0x3fe7('0x2b')]);_0x52b426[_0x3fe7('0x2d')]=_[_0x3fe7('0x2e')](_0x52b426[_0x3fe7('0x29')],_0x52b426['query']);_0x1be9b9['attributes']=_['intersection'](_0x52b426['model'],qs[_0x3fe7('0x30')](_0x213235['query'][_0x3fe7('0x30')]));_0x1be9b9[_0x3fe7('0x2f')]=_0x1be9b9['attributes'][_0x3fe7('0x31')]?_0x1be9b9[_0x3fe7('0x2f')]:_0x52b426[_0x3fe7('0x29')];if(_0x213235[_0x3fe7('0x2b')][_0x3fe7('0x3a')]){_0x1be9b9[_0x3fe7('0x3b')]=[{'all':!![]}];}_0x1be9b9=_['merge']({},_0x1be9b9,_0x213235[_0x3fe7('0x39')]);return db[_0x3fe7('0x25')][_0x3fe7('0x42')](_0x1be9b9)[_0x3fe7('0x1f')](handleEntityNotFound(_0x58f0c7,null))[_0x3fe7('0x1f')](respondWithResult(_0x58f0c7,null))['catch'](handleError(_0x58f0c7,null));};exports[_0x3fe7('0x43')]=function(_0x2b627e,_0x1163f1){return db[_0x3fe7('0x25')]['create'](_0x2b627e['body'],{})[_0x3fe7('0x1f')](respondWithResult(_0x1163f1,0xc9))[_0x3fe7('0x3e')](handleError(_0x1163f1,null));};exports['update']=function(_0x3bf3ea,_0x2d2fe4){if(_0x3bf3ea[_0x3fe7('0x44')]['id']){delete _0x3bf3ea[_0x3fe7('0x44')]['id'];}return db[_0x3fe7('0x25')][_0x3fe7('0x42')]({'where':{'id':_0x3bf3ea[_0x3fe7('0x40')]['id']}})[_0x3fe7('0x1f')](handleEntityNotFound(_0x2d2fe4,null))[_0x3fe7('0x1f')](saveUpdates(_0x3bf3ea['body'],null))['then'](respondWithResult(_0x2d2fe4,null))[_0x3fe7('0x3e')](handleError(_0x2d2fe4,null));};exports[_0x3fe7('0x20')]=function(_0x11adba,_0x131e88){return db['ZohoAccount']['find']({'where':{'id':_0x11adba[_0x3fe7('0x40')]['id']}})['then'](handleEntityNotFound(_0x131e88,null))[_0x3fe7('0x1f')](removeEntity(_0x131e88,null))[_0x3fe7('0x3e')](handleError(_0x131e88,null));};exports[_0x3fe7('0x45')]=function(_0x2a097d,_0x467b33,_0xc09ac7){var _0x5dd060={};var _0x2eba2b={};var _0x380245;var _0x54a538;return db[_0x3fe7('0x25')]['findOne']({'where':{'id':_0x2a097d[_0x3fe7('0x40')]['id']}})[_0x3fe7('0x1f')](handleEntityNotFound(_0x467b33,null))['then'](function(_0x2bab9a){if(_0x2bab9a){_0x380245=_0x2bab9a;_0x2eba2b[_0x3fe7('0x29')]=_[_0x3fe7('0x2c')](db['ZohoConfiguration'][_0x3fe7('0x41')]);_0x2eba2b[_0x3fe7('0x2b')]=_['keys'](_0x2a097d[_0x3fe7('0x2b')]);_0x2eba2b['filters']=_[_0x3fe7('0x2e')](_0x2eba2b[_0x3fe7('0x29')],_0x2eba2b[_0x3fe7('0x2b')]);_0x5dd060['attributes']=_[_0x3fe7('0x2e')](_0x2eba2b[_0x3fe7('0x29')],qs[_0x3fe7('0x30')](_0x2a097d[_0x3fe7('0x2b')]['fields']));_0x5dd060['attributes']=_0x5dd060['attributes']['length']?_0x5dd060[_0x3fe7('0x2f')]:_0x2eba2b['model'];_0x5dd060['order']=qs[_0x3fe7('0x34')](_0x2a097d[_0x3fe7('0x2b')]['sort']);_0x5dd060[_0x3fe7('0x35')]=qs[_0x3fe7('0x2d')](_[_0x3fe7('0x46')](_0x2a097d[_0x3fe7('0x2b')],_0x2eba2b[_0x3fe7('0x2d')]));if(_0x2a097d[_0x3fe7('0x2b')][_0x3fe7('0x37')]){_0x5dd060[_0x3fe7('0x35')]=_[_0x3fe7('0x38')](_0x5dd060[_0x3fe7('0x35')],{'$or':_[_0x3fe7('0x2a')](_0x5dd060['attributes'],function(_0x37a267){var _0x2bd48b={};_0x2bd48b[_0x37a267]={'$like':'%'+_0x2a097d[_0x3fe7('0x2b')][_0x3fe7('0x37')]+'%'};return _0x2bd48b;})});}_0x5dd060=_[_0x3fe7('0x38')]({},_0x5dd060,_0x2a097d['options']);return _0x380245['getConfigurations'](_0x5dd060);}})[_0x3fe7('0x1f')](function(_0x5e4ccd){if(_0x5e4ccd){_0x54a538=_0x5e4ccd['length'];if(!_0x2a097d[_0x3fe7('0x2b')]['hasOwnProperty']('nolimit')){_0x5dd060[_0x3fe7('0x18')]=qs['limit'](_0x2a097d[_0x3fe7('0x2b')][_0x3fe7('0x18')]);_0x5dd060[_0x3fe7('0x1a')]=qs[_0x3fe7('0x1a')](_0x2a097d[_0x3fe7('0x2b')]['offset']);}return _0x380245[_0x3fe7('0x45')](_0x5dd060);}})[_0x3fe7('0x1f')](function(_0x26929c){if(_0x26929c){return _0x26929c?{'count':_0x54a538,'rows':_0x26929c}:null;}})[_0x3fe7('0x1f')](respondWithResult(_0x467b33,null))[_0x3fe7('0x3e')](handleError(_0x467b33,null));};exports[_0x3fe7('0x47')]=function(_0x4415b4,_0x13ecc4,_0xcba321){if(_0x4415b4[_0x3fe7('0x44')]['id']){delete _0x4415b4[_0x3fe7('0x44')]['id'];}return db[_0x3fe7('0x25')][_0x3fe7('0x48')]({'where':{'id':_0x4415b4[_0x3fe7('0x40')]['id']}})['then'](handleEntityNotFound(_0x13ecc4,null))[_0x3fe7('0x1f')](function(_0x43ceb6){if(_0x43ceb6){_0x4415b4[_0x3fe7('0x44')]['AccountId']=_0x43ceb6['id'];_0x4415b4[_0x3fe7('0x44')][_0x3fe7('0x49')]=integrations[_0x3fe7('0x4a')](_0x4415b4[_0x3fe7('0x44')]['channel'],_0x4415b4[_0x3fe7('0x44')][_0x3fe7('0x27')]);_0x4415b4[_0x3fe7('0x44')][_0x3fe7('0x4b')]=integrations[_0x3fe7('0x4c')](_0x4415b4[_0x3fe7('0x44')][_0x3fe7('0x4d')],_0x4415b4[_0x3fe7('0x44')]['type']);return db[_0x3fe7('0x4e')][_0x3fe7('0x43')](_0x4415b4[_0x3fe7('0x44')],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db['ZohoField'],'as':_0x3fe7('0x4b')}]});}return null;})[_0x3fe7('0x1f')](respondWithResult(_0x13ecc4,null))['catch'](handleError(_0x13ecc4,null));};function getAccessToken(_0x592c67){return new Promise(function(_0x46c4e0,_0x223953){var _0x1194a5;switch(_0x592c67[_0x3fe7('0x4f')]){case'US':_0x1194a5=_0x3fe7('0x50');break;case'AU':_0x1194a5=_0x3fe7('0x51');break;case'EU':_0x1194a5=_0x3fe7('0x52');break;case'IN':_0x1194a5=_0x3fe7('0x53');break;case'CN':_0x1194a5='https://accounts.zoho.com.cn';break;default:_0x1194a5=_0x3fe7('0x52');break;}var _0x935bcd={'method':_0x3fe7('0x54'),'uri':_0x1194a5+_0x3fe7('0x55'),'qs':{'refresh_token':_0x592c67['refreshToken'],'client_id':_0x592c67[_0x3fe7('0x56')],'client_secret':_0x592c67[_0x3fe7('0x57')],'grant_type':_0x3fe7('0x58')},'json':!![]};return rp(_0x935bcd)[_0x3fe7('0x1f')](function(_0x5aae3c){if(_0x5aae3c[_0x3fe7('0x59')]){_0x46c4e0(_0x5aae3c[_0x3fe7('0x59')]);}else{_0x223953(_0x3fe7('0x5a'));}})['catch'](function(_0x216eb4){_0x223953(_0x216eb4);});});}exports[_0x3fe7('0x5b')]=function(_0x5e0a62,_0xf7bbb5,_0x2202b5){var _0x4bb0b4,_0x5251ba,_0x424475,_0x1e4a5a,_0x3ca45c;return db[_0x3fe7('0x25')]['findOne']({'where':{'id':_0x5e0a62[_0x3fe7('0x40')]['id']},'attributes':['id',_0x3fe7('0x5c'),'zone','clientId',_0x3fe7('0x57'),_0x3fe7('0x5d'),_0x3fe7('0x5e'),_0x3fe7('0x5f')]})['then'](handleEntityNotFound(_0xf7bbb5,null))[_0x3fe7('0x1f')](function(_0x47209b){_0x3ca45c=_0x47209b;_0x4bb0b4=_0x3ca45c[_0x3fe7('0x5c')];_0x5251ba=_0x4bb0b4==='zoho.eu'?'eu':_0x3fe7('0x60');_0x424475=_0x3ca45c[_0x3fe7('0x5d')];var _0x5d6d1e=_0x424475['slice'](-0x1);if(_0x5d6d1e==='/'||_0x5d6d1e==='\x5c'||_0x5d6d1e===':'){_0x424475=_0x424475['substring'](0x0,_0x424475[_0x3fe7('0x61')](_0x5d6d1e));}if(!_0x3ca45c[_0x3fe7('0x5f')]){throw new Error(_0x3fe7('0x62'));}return getAccessToken(_0x3ca45c);})[_0x3fe7('0x1f')](function(_0x4f4a65){if(_0x4f4a65){return rp({'method':_0x3fe7('0x63'),'uri':util['format'](_0x3fe7('0x64'),_0x5251ba),'qs':{'module':_0x3fe7('0x65')},'headers':{'Authorization':_0x3fe7('0x66')+_0x4f4a65},'json':!![]});}})['then'](function(_0x4869d0){if(_0x4869d0){if(_0x4869d0[_0x3fe7('0x67')]&&_0x4869d0[_0x3fe7('0x67')][_0x3fe7('0x21')]){throw new Error(_0x4869d0[_0x3fe7('0x67')][_0x3fe7('0x21')]['message']);}var _0x495753=[];var _0x1b36d7=[];var _0x256c80=[_0x3fe7('0x68'),_0x3fe7('0x69'),_0x3fe7('0x6a'),_0x3fe7('0x6b'),'Call_Duration',_0x3fe7('0x6c'),_0x3fe7('0x6d'),_0x3fe7('0x6e')];_0x1b36d7=_[_0x3fe7('0x6f')](_0x4869d0['fields'],function(_0x2987ba){return _0x256c80[_0x3fe7('0x70')](_0x2987ba['api_name']);});for(var _0x35161b=0x0;_0x35161b<_0x1b36d7[_0x3fe7('0x31')];_0x35161b++){if(_0x1b36d7[_0x35161b][_0x3fe7('0x71')]===![]){_0x495753[_0x3fe7('0x72')]({'id':_0x1b36d7[_0x35161b]['id'],'name':_0x1b36d7[_0x35161b]['display_label'],'custom':_0x1b36d7[_0x35161b]['custom_field'],'options':_0x1b36d7[_0x35161b][_0x3fe7('0x73')]===_0x3fe7('0x74')&&_0x1b36d7[_0x35161b][_0x3fe7('0x75')]['length']>-0x1?_[_0x3fe7('0x2a')](_0x1b36d7[_0x35161b][_0x3fe7('0x75')],function(_0x596d60){return{'name':_0x596d60,'value':_0x596d60};}):[]});}}return{'count':_0x495753[_0x3fe7('0x31')],'rows':_0x495753};}else{return{'count':0x0,'rows':[]};}})[_0x3fe7('0x1f')](respondWithResult(_0xf7bbb5,null))[_0x3fe7('0x3e')](function(_0x3596e7){var _0x3d8338=_0x5e0a62[_0x3fe7('0x2b')]['test']?0x1f4:_0x3596e7[_0x3fe7('0x76')]||0x1f4;logger[_0x3fe7('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0x3fe7('0x5b'),_0x3d8338,JSON['stringify'](_0x3596e7));delete _0x3596e7[_0x3fe7('0x23')];if(_0x3d8338===0x191){_0x3d8338=0x190;}_0xf7bbb5[_0x3fe7('0x16')](_0x3d8338)[_0x3fe7('0x77')](_0x5e0a62[_0x3fe7('0x2b')][_0x3fe7('0x78')]?{'message':_0x3fe7('0x79'),'statusCode':_0x3596e7[_0x3fe7('0x76')]}:_0x3596e7);});}; \ No newline at end of file +var _0xb55c=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','map','ZohoAccount','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','includeAll','include','findAll','rows','catch','show','params','options','create','find','body','getConfigurations','findOne','filter','AccountId','getSubjects','channel','ZohoConfiguration','Subjects','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','zoho.eu','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x3df9e8,_0xe49b96){var _0x5a2f41=function(_0x229b09){while(--_0x229b09){_0x3df9e8['push'](_0x3df9e8['shift']());}};_0x5a2f41(++_0xe49b96);}(_0xb55c,0x187));var _0xcb55=function(_0x249565,_0x2a026a){_0x249565=_0x249565-0x0;var _0x43dee8=_0xb55c[_0x249565];return _0x43dee8;};'use strict';var emlformat=require(_0xcb55('0x0'));var rimraf=require(_0xcb55('0x1'));var zipdir=require(_0xcb55('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcb55('0x3'));var BPromise=require(_0xcb55('0x4'));var Mustache=require(_0xcb55('0x5'));var util=require(_0xcb55('0x6'));var path=require(_0xcb55('0x7'));var sox=require(_0xcb55('0x8'));var csv=require(_0xcb55('0x9'));var ejs=require(_0xcb55('0xa'));var fs=require('fs');var fs_extra=require(_0xcb55('0xb'));var _=require(_0xcb55('0xc'));var squel=require('squel');var crypto=require(_0xcb55('0xd'));var jsforce=require(_0xcb55('0xe'));var deskjs=require(_0xcb55('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcb55('0x10'));var Papa=require(_0xcb55('0x11'));var Redis=require(_0xcb55('0x12'));var authService=require(_0xcb55('0x13'));var qs=require(_0xcb55('0x14'));var as=require(_0xcb55('0x15'));var hardwareService=require(_0xcb55('0x16'));var logger=require(_0xcb55('0x17'))(_0xcb55('0x18'));var utils=require(_0xcb55('0x19'));var config=require(_0xcb55('0x1a'));var licenseUtil=require(_0xcb55('0x1b'));var db=require(_0xcb55('0x1c'))['db'];var integrations=require(_0xcb55('0x1d'));function respondWithStatusCode(_0x107ca1,_0x7e2cfc){_0x7e2cfc=_0x7e2cfc||0xcc;return function(_0x3806e6){if(_0x3806e6){return _0x107ca1[_0xcb55('0x1e')](_0x7e2cfc);}return _0x107ca1['status'](_0x7e2cfc)[_0xcb55('0x1f')]();};}function respondWithResult(_0x43c6fe,_0x74c02a){_0x74c02a=_0x74c02a||0xc8;return function(_0x4a5b2f){if(_0x4a5b2f){return _0x43c6fe[_0xcb55('0x20')](_0x74c02a)[_0xcb55('0x21')](_0x4a5b2f);}};}function respondWithFilteredResult(_0x391a96,_0x38d896){return function(_0x4975bb){if(_0x4975bb){var _0x9e7d7c=typeof _0x38d896[_0xcb55('0x22')]==='undefined'&&typeof _0x38d896['limit']===_0xcb55('0x23');var _0x1cb18f=_0x4975bb[_0xcb55('0x24')];var _0x2933b4=_0x9e7d7c?0x0:_0x38d896[_0xcb55('0x22')];var _0x4f16d9=_0x9e7d7c?_0x4975bb[_0xcb55('0x24')]:_0x38d896[_0xcb55('0x22')]+_0x38d896['limit'];var _0x4b054b;if(_0x4f16d9>=_0x1cb18f){_0x4f16d9=_0x1cb18f;_0x4b054b=0xc8;}else{_0x4b054b=0xce;}_0x391a96['status'](_0x4b054b);return _0x391a96[_0xcb55('0x25')](_0xcb55('0x26'),_0x2933b4+'-'+_0x4f16d9+'/'+_0x1cb18f)[_0xcb55('0x21')](_0x4975bb);}return null;};}function patchUpdates(_0x3990e4){return function(_0x58acdf){try{jsonpatch[_0xcb55('0x27')](_0x58acdf,_0x3990e4,!![]);}catch(_0x578e38){return BPromise['reject'](_0x578e38);}return _0x58acdf[_0xcb55('0x28')]();};}function saveUpdates(_0x1345b7,_0xa5600b){return function(_0x28fd65){if(_0x28fd65){return _0x28fd65[_0xcb55('0x29')](_0x1345b7)[_0xcb55('0x2a')](function(_0x403b0e){return _0x403b0e;});}return null;};}function removeEntity(_0x133de9,_0xa25b34){return function(_0x277519){if(_0x277519){return _0x277519[_0xcb55('0x2b')]()[_0xcb55('0x2a')](function(){_0x133de9[_0xcb55('0x20')](0xcc)[_0xcb55('0x1f')]();});}};}function handleEntityNotFound(_0x394b00,_0x43aec9){return function(_0x2c856e){if(!_0x2c856e){_0x394b00['sendStatus'](0x194);}return _0x2c856e;};}function handleError(_0x399262,_0x112943){_0x112943=_0x112943||0x1f4;return function(_0x2e3062){logger['error'](_0x2e3062[_0xcb55('0x2c')]);if(_0x2e3062['name']){delete _0x2e3062[_0xcb55('0x2d')];}_0x399262[_0xcb55('0x20')](_0x112943)[_0xcb55('0x2e')](_0x2e3062);};}exports['index']=function(_0x2e61ae,_0x4be5eb){var _0x1ae063={},_0x47e874={},_0x561696={'count':0x0,'rows':[]};var _0x2c2540=_[_0xcb55('0x2f')](db[_0xcb55('0x30')][_0xcb55('0x31')],function(_0x52d9ff){return{'name':_0x52d9ff['fieldName'],'type':_0x52d9ff[_0xcb55('0x32')]['key']};});_0x47e874[_0xcb55('0x33')]=_[_0xcb55('0x2f')](_0x2c2540,'name');_0x47e874[_0xcb55('0x34')]=_[_0xcb55('0x35')](_0x2e61ae['query']);_0x47e874[_0xcb55('0x36')]=_[_0xcb55('0x37')](_0x47e874[_0xcb55('0x33')],_0x47e874[_0xcb55('0x34')]);_0x1ae063['attributes']=_['intersection'](_0x47e874[_0xcb55('0x33')],qs[_0xcb55('0x38')](_0x2e61ae[_0xcb55('0x34')]['fields']));_0x1ae063[_0xcb55('0x39')]=_0x1ae063[_0xcb55('0x39')][_0xcb55('0x3a')]?_0x1ae063[_0xcb55('0x39')]:_0x47e874[_0xcb55('0x33')];if(!_0x2e61ae[_0xcb55('0x34')][_0xcb55('0x3b')](_0xcb55('0x3c'))){_0x1ae063[_0xcb55('0x3d')]=qs[_0xcb55('0x3d')](_0x2e61ae[_0xcb55('0x34')]['limit']);_0x1ae063[_0xcb55('0x22')]=qs[_0xcb55('0x22')](_0x2e61ae[_0xcb55('0x34')][_0xcb55('0x22')]);}_0x1ae063[_0xcb55('0x3e')]=qs['sort'](_0x2e61ae[_0xcb55('0x34')][_0xcb55('0x3f')]);_0x1ae063[_0xcb55('0x40')]=qs['filters'](_[_0xcb55('0x41')](_0x2e61ae[_0xcb55('0x34')],_0x47e874[_0xcb55('0x36')]),_0x2c2540);if(_0x2e61ae['query']['filter']){_0x1ae063[_0xcb55('0x40')]=_['merge'](_0x1ae063[_0xcb55('0x40')],{'$or':_[_0xcb55('0x2f')](_0x2c2540,function(_0x795931){if(_0x795931['type']!=='VIRTUAL'){var _0x3cc4df={};_0x3cc4df[_0x795931[_0xcb55('0x2d')]]={'$like':'%'+_0x2e61ae['query']['filter']+'%'};return _0x3cc4df;}})});}_0x1ae063=_[_0xcb55('0x42')]({},_0x1ae063,_0x2e61ae['options']);var _0x46c1b4={'where':_0x1ae063[_0xcb55('0x40')]};return db[_0xcb55('0x30')][_0xcb55('0x24')](_0x46c1b4)['then'](function(_0x37dc77){_0x561696[_0xcb55('0x24')]=_0x37dc77;if(_0x2e61ae[_0xcb55('0x34')][_0xcb55('0x43')]){_0x1ae063[_0xcb55('0x44')]=[{'all':!![]}];}return db[_0xcb55('0x30')][_0xcb55('0x45')](_0x1ae063);})[_0xcb55('0x2a')](function(_0x77b57b){_0x561696[_0xcb55('0x46')]=_0x77b57b;return _0x561696;})[_0xcb55('0x2a')](respondWithFilteredResult(_0x4be5eb,_0x1ae063))[_0xcb55('0x47')](handleError(_0x4be5eb,null));};exports[_0xcb55('0x48')]=function(_0x508d37,_0x22b588){var _0x25f3a1={'raw':![],'where':{'id':_0x508d37[_0xcb55('0x49')]['id']}},_0x2afee1={};_0x2afee1[_0xcb55('0x33')]=_[_0xcb55('0x35')](db[_0xcb55('0x30')][_0xcb55('0x31')]);_0x2afee1[_0xcb55('0x34')]=_['keys'](_0x508d37[_0xcb55('0x34')]);_0x2afee1[_0xcb55('0x36')]=_[_0xcb55('0x37')](_0x2afee1[_0xcb55('0x33')],_0x2afee1[_0xcb55('0x34')]);_0x25f3a1[_0xcb55('0x39')]=_[_0xcb55('0x37')](_0x2afee1['model'],qs[_0xcb55('0x38')](_0x508d37[_0xcb55('0x34')][_0xcb55('0x38')]));_0x25f3a1[_0xcb55('0x39')]=_0x25f3a1[_0xcb55('0x39')][_0xcb55('0x3a')]?_0x25f3a1[_0xcb55('0x39')]:_0x2afee1[_0xcb55('0x33')];if(_0x508d37[_0xcb55('0x34')][_0xcb55('0x43')]){_0x25f3a1[_0xcb55('0x44')]=[{'all':!![]}];}_0x25f3a1=_[_0xcb55('0x42')]({},_0x25f3a1,_0x508d37[_0xcb55('0x4a')]);return db[_0xcb55('0x30')]['find'](_0x25f3a1)['then'](handleEntityNotFound(_0x22b588,null))[_0xcb55('0x2a')](respondWithResult(_0x22b588,null))[_0xcb55('0x47')](handleError(_0x22b588,null));};exports[_0xcb55('0x4b')]=function(_0x3bbd30,_0x4d530d){return db[_0xcb55('0x30')][_0xcb55('0x4b')](_0x3bbd30['body'],{})[_0xcb55('0x2a')](respondWithResult(_0x4d530d,0xc9))['catch'](handleError(_0x4d530d,null));};exports[_0xcb55('0x29')]=function(_0x2d2774,_0x31c4f0){if(_0x2d2774['body']['id']){delete _0x2d2774['body']['id'];}return db[_0xcb55('0x30')][_0xcb55('0x4c')]({'where':{'id':_0x2d2774[_0xcb55('0x49')]['id']}})[_0xcb55('0x2a')](handleEntityNotFound(_0x31c4f0,null))[_0xcb55('0x2a')](saveUpdates(_0x2d2774[_0xcb55('0x4d')],null))[_0xcb55('0x2a')](respondWithResult(_0x31c4f0,null))[_0xcb55('0x47')](handleError(_0x31c4f0,null));};exports[_0xcb55('0x2b')]=function(_0x937912,_0x42e3ce){return db[_0xcb55('0x30')][_0xcb55('0x4c')]({'where':{'id':_0x937912[_0xcb55('0x49')]['id']}})[_0xcb55('0x2a')](handleEntityNotFound(_0x42e3ce,null))[_0xcb55('0x2a')](removeEntity(_0x42e3ce,null))[_0xcb55('0x47')](handleError(_0x42e3ce,null));};exports[_0xcb55('0x4e')]=function(_0x560aa4,_0x7f16fa,_0x5e2754){var _0x352a1a={};var _0x4f9104={};var _0x52880d;var _0x828e0f;return db['ZohoAccount'][_0xcb55('0x4f')]({'where':{'id':_0x560aa4[_0xcb55('0x49')]['id']}})[_0xcb55('0x2a')](handleEntityNotFound(_0x7f16fa,null))[_0xcb55('0x2a')](function(_0x1dd050){if(_0x1dd050){_0x52880d=_0x1dd050;_0x4f9104[_0xcb55('0x33')]=_['keys'](db['ZohoConfiguration'][_0xcb55('0x31')]);_0x4f9104[_0xcb55('0x34')]=_['keys'](_0x560aa4['query']);_0x4f9104[_0xcb55('0x36')]=_[_0xcb55('0x37')](_0x4f9104['model'],_0x4f9104[_0xcb55('0x34')]);_0x352a1a['attributes']=_[_0xcb55('0x37')](_0x4f9104['model'],qs[_0xcb55('0x38')](_0x560aa4['query'][_0xcb55('0x38')]));_0x352a1a[_0xcb55('0x39')]=_0x352a1a[_0xcb55('0x39')][_0xcb55('0x3a')]?_0x352a1a[_0xcb55('0x39')]:_0x4f9104[_0xcb55('0x33')];_0x352a1a[_0xcb55('0x3e')]=qs[_0xcb55('0x3f')](_0x560aa4[_0xcb55('0x34')][_0xcb55('0x3f')]);_0x352a1a[_0xcb55('0x40')]=qs[_0xcb55('0x36')](_[_0xcb55('0x41')](_0x560aa4[_0xcb55('0x34')],_0x4f9104[_0xcb55('0x36')]));if(_0x560aa4['query'][_0xcb55('0x50')]){_0x352a1a[_0xcb55('0x40')]=_['merge'](_0x352a1a[_0xcb55('0x40')],{'$or':_[_0xcb55('0x2f')](_0x352a1a[_0xcb55('0x39')],function(_0x522049){var _0x1aa5d3={};_0x1aa5d3[_0x522049]={'$like':'%'+_0x560aa4[_0xcb55('0x34')][_0xcb55('0x50')]+'%'};return _0x1aa5d3;})});}_0x352a1a=_[_0xcb55('0x42')]({},_0x352a1a,_0x560aa4[_0xcb55('0x4a')]);return _0x52880d[_0xcb55('0x4e')](_0x352a1a);}})[_0xcb55('0x2a')](function(_0x5c7242){if(_0x5c7242){_0x828e0f=_0x5c7242[_0xcb55('0x3a')];if(!_0x560aa4[_0xcb55('0x34')]['hasOwnProperty'](_0xcb55('0x3c'))){_0x352a1a[_0xcb55('0x3d')]=qs[_0xcb55('0x3d')](_0x560aa4['query']['limit']);_0x352a1a[_0xcb55('0x22')]=qs[_0xcb55('0x22')](_0x560aa4[_0xcb55('0x34')][_0xcb55('0x22')]);}return _0x52880d[_0xcb55('0x4e')](_0x352a1a);}})[_0xcb55('0x2a')](function(_0x18585f){if(_0x18585f){return _0x18585f?{'count':_0x828e0f,'rows':_0x18585f}:null;}})[_0xcb55('0x2a')](respondWithResult(_0x7f16fa,null))['catch'](handleError(_0x7f16fa,null));};exports['addConfiguration']=function(_0x528f4b,_0x172e3b,_0xd2d125){if(_0x528f4b[_0xcb55('0x4d')]['id']){delete _0x528f4b[_0xcb55('0x4d')]['id'];}return db[_0xcb55('0x30')]['findOne']({'where':{'id':_0x528f4b[_0xcb55('0x49')]['id']}})['then'](handleEntityNotFound(_0x172e3b,null))[_0xcb55('0x2a')](function(_0x3d305b){if(_0x3d305b){_0x528f4b[_0xcb55('0x4d')][_0xcb55('0x51')]=_0x3d305b['id'];_0x528f4b[_0xcb55('0x4d')]['Subjects']=integrations[_0xcb55('0x52')](_0x528f4b['body'][_0xcb55('0x53')],_0x528f4b['body'][_0xcb55('0x32')]);_0x528f4b[_0xcb55('0x4d')]['Descriptions']=integrations['getDescriptions'](_0x528f4b[_0xcb55('0x4d')][_0xcb55('0x53')],_0x528f4b[_0xcb55('0x4d')][_0xcb55('0x32')]);return db[_0xcb55('0x54')][_0xcb55('0x4b')](_0x528f4b[_0xcb55('0x4d')],{'include':[{'model':db['ZohoField'],'as':_0xcb55('0x55')},{'model':db[_0xcb55('0x56')],'as':_0xcb55('0x57')}]});}return null;})['then'](respondWithResult(_0x172e3b,null))[_0xcb55('0x47')](handleError(_0x172e3b,null));};function getAccessToken(_0x53a0a2){return new Promise(function(_0x79aae7,_0x1e99dd){var _0x29e56b;switch(_0x53a0a2[_0xcb55('0x58')]){case'US':_0x29e56b=_0xcb55('0x59');break;case'AU':_0x29e56b='https://accounts.zoho.com.au';break;case'EU':_0x29e56b=_0xcb55('0x5a');break;case'IN':_0x29e56b='https://accounts.zoho.in';break;case'CN':_0x29e56b=_0xcb55('0x5b');break;default:_0x29e56b=_0xcb55('0x5a');break;}var _0x3aa796={'method':_0xcb55('0x5c'),'uri':_0x29e56b+'/oauth/v2/token','qs':{'refresh_token':_0x53a0a2[_0xcb55('0x5d')],'client_id':_0x53a0a2[_0xcb55('0x5e')],'client_secret':_0x53a0a2[_0xcb55('0x5f')],'grant_type':_0xcb55('0x60')},'json':!![]};return rp(_0x3aa796)['then'](function(_0x2c1025){if(_0x2c1025[_0xcb55('0x61')]){_0x79aae7(_0x2c1025[_0xcb55('0x61')]);}else{_0x1e99dd(_0xcb55('0x62'));}})['catch'](function(_0x24f3b4){_0x1e99dd(_0x24f3b4);});});}exports['getFields']=function(_0x521ec6,_0x349096,_0x3b4d08){var _0x219137,_0x383eb0,_0x518915,_0x24a63a,_0x5821e9;return db[_0xcb55('0x30')][_0xcb55('0x4f')]({'where':{'id':_0x521ec6[_0xcb55('0x49')]['id']},'attributes':['id',_0xcb55('0x63'),_0xcb55('0x58'),'clientId',_0xcb55('0x5f'),_0xcb55('0x64'),'code','refreshToken']})[_0xcb55('0x2a')](handleEntityNotFound(_0x349096,null))[_0xcb55('0x2a')](function(_0x10d050){_0x5821e9=_0x10d050;_0x219137=_0x5821e9['host'];_0x383eb0=_0x219137===_0xcb55('0x65')?'eu':_0xcb55('0x66');_0x518915=_0x5821e9['serverUrl'];var _0x3287cf=_0x518915[_0xcb55('0x67')](-0x1);if(_0x3287cf==='/'||_0x3287cf==='\x5c'||_0x3287cf===':'){_0x518915=_0x518915[_0xcb55('0x68')](0x0,_0x518915['lastIndexOf'](_0x3287cf));}if(!_0x5821e9[_0xcb55('0x5d')]){throw new Error(_0xcb55('0x69'));}return getAccessToken(_0x5821e9);})[_0xcb55('0x2a')](function(_0x344ec9){if(_0x344ec9){return rp({'method':_0xcb55('0x6a'),'uri':util[_0xcb55('0x6b')](_0xcb55('0x6c'),_0x383eb0),'qs':{'module':_0xcb55('0x6d')},'headers':{'Authorization':_0xcb55('0x6e')+_0x344ec9},'json':!![]});}})['then'](function(_0x5ab070){if(_0x5ab070){if(_0x5ab070[_0xcb55('0x6f')]&&_0x5ab070[_0xcb55('0x6f')][_0xcb55('0x70')]){throw new Error(_0x5ab070[_0xcb55('0x6f')][_0xcb55('0x70')][_0xcb55('0x71')]);}var _0x54ba75=[];var _0x4c9494=[];var _0x1f8e91=[_0xcb55('0x72'),_0xcb55('0x73'),_0xcb55('0x74'),'WhoId',_0xcb55('0x75'),_0xcb55('0x76'),_0xcb55('0x77'),_0xcb55('0x78')];_0x4c9494=_[_0xcb55('0x79')](_0x5ab070[_0xcb55('0x38')],function(_0x522114){return _0x1f8e91[_0xcb55('0x7a')](_0x522114[_0xcb55('0x7b')]);});for(var _0x117251=0x0;_0x117251<_0x4c9494[_0xcb55('0x3a')];_0x117251++){if(_0x4c9494[_0x117251][_0xcb55('0x7c')]===![]){_0x54ba75[_0xcb55('0x7d')]({'id':_0x4c9494[_0x117251]['id'],'name':_0x4c9494[_0x117251][_0xcb55('0x7e')],'custom':_0x4c9494[_0x117251]['custom_field'],'options':_0x4c9494[_0x117251][_0xcb55('0x7f')]===_0xcb55('0x80')&&_0x4c9494[_0x117251][_0xcb55('0x81')]['length']>-0x1?_[_0xcb55('0x2f')](_0x4c9494[_0x117251][_0xcb55('0x81')],function(_0x4a509c){return{'name':_0x4a509c,'value':_0x4a509c};}):[]});}}return{'count':_0x54ba75[_0xcb55('0x3a')],'rows':_0x54ba75};}else{return{'count':0x0,'rows':[]};}})[_0xcb55('0x2a')](respondWithResult(_0x349096,null))[_0xcb55('0x47')](function(_0x18c74e){var _0x40b692=_0x521ec6[_0xcb55('0x34')][_0xcb55('0x82')]?0x1f4:_0x18c74e[_0xcb55('0x83')]||0x1f4;logger[_0xcb55('0x70')](_0xcb55('0x84'),_0xcb55('0x85'),_0x40b692,JSON[_0xcb55('0x86')](_0x18c74e));delete _0x18c74e[_0xcb55('0x2d')];if(_0x40b692===0x191){_0x40b692=0x190;}_0x349096[_0xcb55('0x20')](_0x40b692)[_0xcb55('0x2e')](_0x521ec6[_0xcb55('0x34')][_0xcb55('0x82')]?{'message':'Wrong\x20credentials','statusCode':_0x18c74e[_0xcb55('0x83')]}:_0x18c74e);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 5082e4b..b2e563e 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 _0x8452=['ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','code','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','application/x-www-form-urlencoded','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x4d3543,_0x32d008){var _0x3d4d5b=function(_0x22dc2d){while(--_0x22dc2d){_0x4d3543['push'](_0x4d3543['shift']());}};_0x3d4d5b(++_0x32d008);}(_0x8452,0x123));var _0x2845=function(_0x3a04c6,_0x12a482){_0x3a04c6=_0x3a04c6-0x0;var _0xf4131a=_0x8452[_0x3a04c6];return _0xf4131a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2845('0x0'))(_0x2845('0x1'));var moment=require(_0x2845('0x2'));var BPromise=require(_0x2845('0x3'));var rp=require(_0x2845('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2845('0x5'));var config=require(_0x2845('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x2845('0x7'));module[_0x2845('0x8')]=function(_0x22f5b9,_0x306c70){return _0x22f5b9[_0x2845('0x9')](_0x2845('0xa'),attributes,{'tableName':_0x2845('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2db6fa,_0x2b1ba8,_0x14f356){if(_0x2db6fa[_0x2845('0xc')](_0x2845('0xd'))||_0x2db6fa['changed'](_0x2845('0xe'))||_0x2db6fa['changed'](_0x2845('0xf'))||_0x2db6fa['changed']('clientSecret')||_0x2db6fa[_0x2845('0xc')](_0x2845('0x10'))||_0x2db6fa[_0x2845('0xc')]('host')){var _0x2ae25a,_0x2af7c7;_0x2ae25a=_0x2db6fa[_0x2845('0xe')];var _0x2ce3cd=_0x2ae25a[_0x2845('0x11')](-0x1);if(_0x2ce3cd==='/'||_0x2ce3cd==='\x5c'||_0x2ce3cd===':'){_0x2ae25a=_0x2ae25a[_0x2845('0x12')](0x0,_0x2ae25a[_0x2845('0x13')](_0x2ce3cd));}switch(_0x2db6fa[_0x2845('0xd')]){case'US':_0x2af7c7=_0x2845('0x14');break;case'AU':_0x2af7c7=_0x2845('0x15');break;case'IN':_0x2af7c7=_0x2845('0x16');break;case'CN':_0x2af7c7=_0x2845('0x17');break;default:_0x2af7c7=_0x2845('0x18');break;}var _0x49df0f={'method':_0x2845('0x19'),'uri':_0x2af7c7+_0x2845('0x1a'),'form':{'grant_type':_0x2845('0x1b'),'client_id':_0x2db6fa[_0x2845('0xf')],'client_secret':_0x2db6fa[_0x2845('0x1c')],'redirect_uri':_0x2db6fa['serverUrl'],'code':_0x2db6fa[_0x2845('0x10')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x49df0f)[_0x2845('0x1d')](function(_0x5dddf5){var _0x4a14ed=JSON[_0x2845('0x1e')](_0x5dddf5);if(_0x4a14ed[_0x2845('0x1f')]){_0x2db6fa[_0x2845('0x20')]=_0x4a14ed[_0x2845('0x1f')];logger[_0x2845('0x21')](util[_0x2845('0x22')](_0x2845('0x23'),_0x2db6fa[_0x2845('0x24')],_0x2db6fa['id']));}else{logger[_0x2845('0x25')](util[_0x2845('0x22')](_0x2845('0x26'),_0x2db6fa['name'],_0x2db6fa['id']),util[_0x2845('0x27')](_0x4a14ed,{'showHidden':![],'depth':null}));}return _0x14f356(null,_0x2b1ba8);})[_0x2845('0x28')](function(_0x597520){logger[_0x2845('0x25')](util[_0x2845('0x22')](_0x2845('0x26'),_0x2db6fa[_0x2845('0x24')],_0x2db6fa['id']),util[_0x2845('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x14f356(_0x597520);});}else{return _0x14f356(null,_0x2b1ba8);}},'beforeUpdate':function(_0xe0944c,_0x5edff6,_0x1ddf4b){if(_0xe0944c['changed']('zone')||_0xe0944c['changed']('serverUrl')||_0xe0944c[_0x2845('0xc')](_0x2845('0xf'))||_0xe0944c[_0x2845('0xc')]('clientSecret')||_0xe0944c[_0x2845('0xc')](_0x2845('0x10'))||_0xe0944c['changed'](_0x2845('0x29'))){var _0x2acfb6,_0x14bd19;_0x2acfb6=_0xe0944c[_0x2845('0xe')];var _0x339a29=_0x2acfb6[_0x2845('0x11')](-0x1);if(_0x339a29==='/'||_0x339a29==='\x5c'||_0x339a29===':'){_0x2acfb6=_0x2acfb6['substring'](0x0,_0x2acfb6['lastIndexOf'](_0x339a29));}switch(_0xe0944c[_0x2845('0xd')]){case'US':_0x14bd19=_0x2845('0x14');break;case'AU':_0x14bd19=_0x2845('0x15');break;case'IN':_0x14bd19=_0x2845('0x16');break;case'CN':_0x14bd19=_0x2845('0x17');break;default:_0x14bd19='https://accounts.zoho.eu';break;}var _0x5cd68d={'method':_0x2845('0x19'),'uri':_0x14bd19+_0x2845('0x1a'),'form':{'grant_type':_0x2845('0x1b'),'client_id':_0xe0944c[_0x2845('0xf')],'client_secret':_0xe0944c[_0x2845('0x1c')],'redirect_uri':_0xe0944c['serverUrl'],'code':_0xe0944c[_0x2845('0x10')]},'headers':{'Content-Type':_0x2845('0x2a')}};return rp(_0x5cd68d)['then'](function(_0x422626){var _0x51e8bb=JSON[_0x2845('0x1e')](_0x422626);if(_0x51e8bb['refresh_token']){_0xe0944c[_0x2845('0x20')]=_0x51e8bb[_0x2845('0x1f')];logger[_0x2845('0x21')](util[_0x2845('0x22')](_0x2845('0x23'),_0xe0944c['name'],_0xe0944c['id']));}else{logger[_0x2845('0x25')](util['format'](_0x2845('0x26'),_0xe0944c['name'],_0xe0944c['id']),util[_0x2845('0x27')](_0x51e8bb,{'showHidden':![],'depth':null}));}return _0x1ddf4b(null,_0x5edff6);})[_0x2845('0x28')](function(_0x3167f5){logger[_0x2845('0x25')](util['format'](_0x2845('0x26'),_0xe0944c[_0x2845('0x24')],_0xe0944c['id']),util[_0x2845('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x1ddf4b(_0x3167f5);});}else{return _0x1ddf4b(null,_0x5edff6);}}}});}; \ No newline at end of file +var _0xac19=['refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','substring','lastIndexOf','https://accounts.zoho.com.cn','/oauth/v2/token','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','define','int_zoho_accounts','changed','zone','serverUrl','clientId','code','host','slice','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse'];(function(_0x41b4d2,_0x3fd3f1){var _0x19fc8b=function(_0x4e0134){while(--_0x4e0134){_0x41b4d2['push'](_0x41b4d2['shift']());}};_0x19fc8b(++_0x3fd3f1);}(_0xac19,0x191));var _0x9ac1=function(_0x58d379,_0x4d6fa5){_0x58d379=_0x58d379-0x0;var _0x4c322b=_0xac19[_0x58d379];return _0x4c322b;};'use strict';var _=require(_0x9ac1('0x0'));var util=require(_0x9ac1('0x1'));var logger=require(_0x9ac1('0x2'))(_0x9ac1('0x3'));var moment=require(_0x9ac1('0x4'));var BPromise=require(_0x9ac1('0x5'));var rp=require(_0x9ac1('0x6'));var fs=require('fs');var path=require(_0x9ac1('0x7'));var rimraf=require(_0x9ac1('0x8'));var config=require('../../config/environment');var attributes=require(_0x9ac1('0x9'));var integrations=require(_0x9ac1('0xa'));module['exports']=function(_0x2d1a51,_0x38843f){return _0x2d1a51[_0x9ac1('0xb')]('ZohoAccount',attributes,{'tableName':_0x9ac1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x69f406,_0x1022ef,_0x3a3950){if(_0x69f406[_0x9ac1('0xd')](_0x9ac1('0xe'))||_0x69f406[_0x9ac1('0xd')](_0x9ac1('0xf'))||_0x69f406['changed'](_0x9ac1('0x10'))||_0x69f406[_0x9ac1('0xd')]('clientSecret')||_0x69f406[_0x9ac1('0xd')](_0x9ac1('0x11'))||_0x69f406[_0x9ac1('0xd')](_0x9ac1('0x12'))){var _0x2a0b56,_0x4a2e60;_0x2a0b56=_0x69f406['serverUrl'];var _0x1692b3=_0x2a0b56[_0x9ac1('0x13')](-0x1);if(_0x1692b3==='/'||_0x1692b3==='\x5c'||_0x1692b3===':'){_0x2a0b56=_0x2a0b56['substring'](0x0,_0x2a0b56['lastIndexOf'](_0x1692b3));}switch(_0x69f406[_0x9ac1('0xe')]){case'US':_0x4a2e60=_0x9ac1('0x14');break;case'AU':_0x4a2e60='https://accounts.zoho.com.au';break;case'IN':_0x4a2e60=_0x9ac1('0x15');break;case'CN':_0x4a2e60='https://accounts.zoho.com.cn';break;default:_0x4a2e60=_0x9ac1('0x16');break;}var _0x2c832a={'method':_0x9ac1('0x17'),'uri':_0x4a2e60+'/oauth/v2/token','form':{'grant_type':_0x9ac1('0x18'),'client_id':_0x69f406[_0x9ac1('0x10')],'client_secret':_0x69f406[_0x9ac1('0x19')],'redirect_uri':_0x69f406['serverUrl'],'code':_0x69f406['code']},'headers':{'Content-Type':_0x9ac1('0x1a')}};return rp(_0x2c832a)[_0x9ac1('0x1b')](function(_0x75ba1c){var _0x1a3eec=JSON[_0x9ac1('0x1c')](_0x75ba1c);if(_0x1a3eec[_0x9ac1('0x1d')]){_0x69f406[_0x9ac1('0x1e')]=_0x1a3eec['refresh_token'];logger[_0x9ac1('0x1f')](util['format'](_0x9ac1('0x20'),_0x69f406['name'],_0x69f406['id']));}else{logger[_0x9ac1('0x21')](util[_0x9ac1('0x22')](_0x9ac1('0x23'),_0x69f406[_0x9ac1('0x24')],_0x69f406['id']),util[_0x9ac1('0x25')](_0x1a3eec,{'showHidden':![],'depth':null}));}return _0x3a3950(null,_0x1022ef);})['catch'](function(_0x3a6cfb){logger['error'](util[_0x9ac1('0x22')](_0x9ac1('0x23'),_0x69f406[_0x9ac1('0x24')],_0x69f406['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x3a3950(_0x3a6cfb);});}else{return _0x3a3950(null,_0x1022ef);}},'beforeUpdate':function(_0x35ddeb,_0x5d6fa4,_0x3492d8){if(_0x35ddeb[_0x9ac1('0xd')]('zone')||_0x35ddeb[_0x9ac1('0xd')]('serverUrl')||_0x35ddeb[_0x9ac1('0xd')](_0x9ac1('0x10'))||_0x35ddeb['changed'](_0x9ac1('0x19'))||_0x35ddeb[_0x9ac1('0xd')](_0x9ac1('0x11'))||_0x35ddeb[_0x9ac1('0xd')]('host')){var _0x5ad825,_0x29cab1;_0x5ad825=_0x35ddeb[_0x9ac1('0xf')];var _0x19867c=_0x5ad825[_0x9ac1('0x13')](-0x1);if(_0x19867c==='/'||_0x19867c==='\x5c'||_0x19867c===':'){_0x5ad825=_0x5ad825[_0x9ac1('0x26')](0x0,_0x5ad825[_0x9ac1('0x27')](_0x19867c));}switch(_0x35ddeb[_0x9ac1('0xe')]){case'US':_0x29cab1=_0x9ac1('0x14');break;case'AU':_0x29cab1='https://accounts.zoho.com.au';break;case'IN':_0x29cab1=_0x9ac1('0x15');break;case'CN':_0x29cab1=_0x9ac1('0x28');break;default:_0x29cab1=_0x9ac1('0x16');break;}var _0x4659b5={'method':_0x9ac1('0x17'),'uri':_0x29cab1+_0x9ac1('0x29'),'form':{'grant_type':_0x9ac1('0x18'),'client_id':_0x35ddeb[_0x9ac1('0x10')],'client_secret':_0x35ddeb[_0x9ac1('0x19')],'redirect_uri':_0x35ddeb[_0x9ac1('0xf')],'code':_0x35ddeb[_0x9ac1('0x11')]},'headers':{'Content-Type':_0x9ac1('0x1a')}};return rp(_0x4659b5)['then'](function(_0x55f406){var _0x473abd=JSON['parse'](_0x55f406);if(_0x473abd[_0x9ac1('0x1d')]){_0x35ddeb[_0x9ac1('0x1e')]=_0x473abd[_0x9ac1('0x1d')];logger['info'](util[_0x9ac1('0x22')](_0x9ac1('0x20'),_0x35ddeb[_0x9ac1('0x24')],_0x35ddeb['id']));}else{logger[_0x9ac1('0x21')](util[_0x9ac1('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x35ddeb[_0x9ac1('0x24')],_0x35ddeb['id']),util[_0x9ac1('0x25')](_0x473abd,{'showHidden':![],'depth':null}));}return _0x3492d8(null,_0x5d6fa4);})[_0x9ac1('0x2a')](function(_0x5076ee){logger[_0x9ac1('0x21')](util[_0x9ac1('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x35ddeb[_0x9ac1('0x24')],_0x35ddeb['id']),util[_0x9ac1('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x3492d8(_0x5076ee);});}else{return _0x3492d8(null,_0x5d6fa4);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 97a1d69..f69e3bc 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 _0x9123=['info','request\x20sent','debug','stringify','error','code','message','ZohoAccount,\x20%s,\x20%s','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','find','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x4d54ae,_0x3b4a42){var _0x4e1508=function(_0xc88bc3){while(--_0xc88bc3){_0x4d54ae['push'](_0x4d54ae['shift']());}};_0x4e1508(++_0x3b4a42);}(_0x9123,0x140));var _0x3912=function(_0x4cb30c,_0x290d5c){_0x4cb30c=_0x4cb30c-0x0;var _0x2c7bf2=_0x9123[_0x4cb30c];return _0x2c7bf2;};'use strict';var _=require(_0x3912('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3912('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3912('0x2'))['db'];var utils=require(_0x3912('0x3'));var logger=require(_0x3912('0x4'))(_0x3912('0x5'));var config=require('../../config/environment');var jayson=require(_0x3912('0x6'));var client=jayson[_0x3912('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ea5cf,_0x2b3ac0,_0x2d75b6){return new BPromise(function(_0x2325d0,_0x51fb5b){return client[_0x3912('0x8')](_0x4ea5cf,_0x2d75b6)[_0x3912('0x9')](function(_0x2f5910){logger[_0x3912('0xa')]('ZohoAccount,\x20%s,\x20%s',_0x2b3ac0,_0x3912('0xb'));logger[_0x3912('0xc')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2b3ac0,_0x3912('0xb'),JSON[_0x3912('0xd')](_0x2f5910));if(_0x2f5910[_0x3912('0xe')]){if(_0x2f5910[_0x3912('0xe')][_0x3912('0xf')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x2b3ac0,_0x2f5910[_0x3912('0xe')][_0x3912('0x10')]);return _0x51fb5b(_0x2f5910[_0x3912('0xe')]['message']);}logger[_0x3912('0xe')](_0x3912('0x11'),_0x2b3ac0,_0x2f5910['error'][_0x3912('0x10')]);return _0x2325d0(_0x2f5910[_0x3912('0xe')][_0x3912('0x10')]);}else{logger[_0x3912('0xa')]('ZohoAccount,\x20%s,\x20%s',_0x2b3ac0,_0x3912('0xb'));_0x2325d0(_0x2f5910[_0x3912('0x12')][_0x3912('0x10')]);}})[_0x3912('0x13')](function(_0x4658b6){logger['error'](_0x3912('0x11'),_0x2b3ac0,_0x4658b6);_0x51fb5b(_0x4658b6);});});}exports[_0x3912('0x14')]=function(_0x2e4649){var _0x8a1a68=this;return new Promise(function(_0x2b48b1,_0x59e28a){return db[_0x3912('0x15')][_0x3912('0x16')]({'raw':_0x2e4649[_0x3912('0x17')]?_0x2e4649['options'][_0x3912('0x18')]===undefined?!![]:![]:!![],'where':_0x2e4649[_0x3912('0x17')]?_0x2e4649[_0x3912('0x17')][_0x3912('0x19')]||null:null,'attributes':_0x2e4649[_0x3912('0x17')]?_0x2e4649[_0x3912('0x17')][_0x3912('0x1a')]||null:null,'limit':_0x2e4649['options']?_0x2e4649['options'][_0x3912('0x1b')]||null:null,'include':_0x2e4649[_0x3912('0x17')]?_0x2e4649[_0x3912('0x17')][_0x3912('0x1c')]?_[_0x3912('0x1d')](_0x2e4649[_0x3912('0x17')][_0x3912('0x1c')],function(_0x40f601){return{'model':db[_0x40f601[_0x3912('0x1e')]],'as':_0x40f601['as'],'attributes':_0x40f601['attributes'],'include':_0x40f601[_0x3912('0x1c')]?_[_0x3912('0x1d')](_0x40f601['include'],function(_0x2af8cf){return{'model':db[_0x2af8cf[_0x3912('0x1e')]],'as':_0x2af8cf['as'],'attributes':_0x2af8cf[_0x3912('0x1a')],'include':_0x2af8cf[_0x3912('0x1c')]?_['map'](_0x2af8cf['include'],function(_0x426907){return{'model':db[_0x426907[_0x3912('0x1e')]],'as':_0x426907['as'],'attributes':_0x426907[_0x3912('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3912('0x9')](function(_0x43f9de){logger[_0x3912('0xa')](_0x3912('0x14'),_0x2e4649);logger[_0x3912('0xc')](_0x3912('0x14'),_0x2e4649,JSON[_0x3912('0xd')](_0x43f9de));_0x2b48b1(_0x43f9de);})['catch'](function(_0x5b0729){logger[_0x3912('0xe')](_0x3912('0x14'),_0x5b0729['message'],_0x2e4649);_0x59e28a(_0x8a1a68['error'](0x1f4,_0x5b0729[_0x3912('0x10')]));});});};exports[_0x3912('0x1f')]=function(_0x26c49c){var _0x596d45=this;return new Promise(function(_0x3da782,_0x38fd42){return db[_0x3912('0x15')][_0x3912('0x20')]({'raw':_0x26c49c[_0x3912('0x17')]?_0x26c49c[_0x3912('0x17')][_0x3912('0x18')]===undefined?!![]:![]:!![],'where':_0x26c49c[_0x3912('0x17')]?_0x26c49c['options'][_0x3912('0x19')]||null:null,'attributes':_0x26c49c[_0x3912('0x17')]?_0x26c49c['options'][_0x3912('0x1a')]||null:null,'include':_0x26c49c['options']?_0x26c49c[_0x3912('0x17')]['include']?_['map'](_0x26c49c[_0x3912('0x17')]['include'],function(_0x35d644){return{'model':db[_0x35d644['model']],'as':_0x35d644['as'],'attributes':_0x35d644[_0x3912('0x1a')],'include':_0x35d644[_0x3912('0x1c')]?_['map'](_0x35d644[_0x3912('0x1c')],function(_0x444122){return{'model':db[_0x444122[_0x3912('0x1e')]],'as':_0x444122['as'],'attributes':_0x444122['attributes'],'include':_0x444122[_0x3912('0x1c')]?_['map'](_0x444122[_0x3912('0x1c')],function(_0x551bd1){return{'model':db[_0x551bd1[_0x3912('0x1e')]],'as':_0x551bd1['as'],'attributes':_0x551bd1[_0x3912('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3912('0x9')](function(_0x246479){logger[_0x3912('0xa')](_0x3912('0x1f'),_0x26c49c);logger[_0x3912('0xc')]('ShowZohoAccount',_0x26c49c,JSON['stringify'](_0x246479));_0x3da782(_0x246479);})['catch'](function(_0x2f2807){logger[_0x3912('0xe')](_0x3912('0x1f'),_0x2f2807[_0x3912('0x10')],_0x26c49c);_0x38fd42(_0x596d45[_0x3912('0xe')](0x1f4,_0x2f2807[_0x3912('0x10')]));});});}; \ No newline at end of file +var _0xb422=['code','message','info','result','catch','GetZohoAccount','ZohoAccount','options','where','limit','map','model','attributes','include','then','find','ShowZohoAccount','bluebird','../../mysqldb','../../config/logger','../../config/environment','client','http','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5f339c,_0xf5fb4f){var _0x4b6584=function(_0x527c1c){while(--_0x527c1c){_0x5f339c['push'](_0x5f339c['shift']());}};_0x4b6584(++_0xf5fb4f);}(_0xb422,0x85));var _0x2b42=function(_0x5cb7a8,_0x269783){_0x5cb7a8=_0x5cb7a8-0x0;var _0x2a26df=_0xb422[_0x5cb7a8];return _0x2a26df;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2b42('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b42('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b42('0x2'))('rpc');var config=require(_0x2b42('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x2b42('0x4')][_0x2b42('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x750c2,_0x51b3bd,_0xde9c67){return new BPromise(function(_0x1b64f7,_0x12b303){return client['request'](_0x750c2,_0xde9c67)['then'](function(_0x4174e8){logger['info'](_0x2b42('0x6'),_0x51b3bd,_0x2b42('0x7'));logger[_0x2b42('0x8')](_0x2b42('0x9'),_0x51b3bd,'request\x20sent',JSON[_0x2b42('0xa')](_0x4174e8));if(_0x4174e8[_0x2b42('0xb')]){if(_0x4174e8['error'][_0x2b42('0xc')]===0x1f4){logger[_0x2b42('0xb')](_0x2b42('0x6'),_0x51b3bd,_0x4174e8[_0x2b42('0xb')]['message']);return _0x12b303(_0x4174e8['error'][_0x2b42('0xd')]);}logger[_0x2b42('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x51b3bd,_0x4174e8[_0x2b42('0xb')][_0x2b42('0xd')]);return _0x1b64f7(_0x4174e8[_0x2b42('0xb')][_0x2b42('0xd')]);}else{logger[_0x2b42('0xe')](_0x2b42('0x6'),_0x51b3bd,_0x2b42('0x7'));_0x1b64f7(_0x4174e8[_0x2b42('0xf')][_0x2b42('0xd')]);}})[_0x2b42('0x10')](function(_0x4897d8){logger[_0x2b42('0xb')](_0x2b42('0x6'),_0x51b3bd,_0x4897d8);_0x12b303(_0x4897d8);});});}exports[_0x2b42('0x11')]=function(_0x3e3426){var _0x27419d=this;return new Promise(function(_0x3ab83c,_0xa28ba4){return db[_0x2b42('0x12')]['findAll']({'raw':_0x3e3426[_0x2b42('0x13')]?_0x3e3426[_0x2b42('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x3e3426[_0x2b42('0x13')]?_0x3e3426['options'][_0x2b42('0x14')]||null:null,'attributes':_0x3e3426[_0x2b42('0x13')]?_0x3e3426[_0x2b42('0x13')]['attributes']||null:null,'limit':_0x3e3426['options']?_0x3e3426[_0x2b42('0x13')][_0x2b42('0x15')]||null:null,'include':_0x3e3426[_0x2b42('0x13')]?_0x3e3426[_0x2b42('0x13')]['include']?_[_0x2b42('0x16')](_0x3e3426[_0x2b42('0x13')]['include'],function(_0x2b9531){return{'model':db[_0x2b9531[_0x2b42('0x17')]],'as':_0x2b9531['as'],'attributes':_0x2b9531[_0x2b42('0x18')],'include':_0x2b9531[_0x2b42('0x19')]?_[_0x2b42('0x16')](_0x2b9531[_0x2b42('0x19')],function(_0x5367f0){return{'model':db[_0x5367f0[_0x2b42('0x17')]],'as':_0x5367f0['as'],'attributes':_0x5367f0[_0x2b42('0x18')],'include':_0x5367f0[_0x2b42('0x19')]?_[_0x2b42('0x16')](_0x5367f0[_0x2b42('0x19')],function(_0x807625){return{'model':db[_0x807625[_0x2b42('0x17')]],'as':_0x807625['as'],'attributes':_0x807625[_0x2b42('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2b42('0x1a')](function(_0xe32cdc){logger[_0x2b42('0xe')]('GetZohoAccount',_0x3e3426);logger['debug'](_0x2b42('0x11'),_0x3e3426,JSON[_0x2b42('0xa')](_0xe32cdc));_0x3ab83c(_0xe32cdc);})[_0x2b42('0x10')](function(_0x352ef7){logger['error'](_0x2b42('0x11'),_0x352ef7[_0x2b42('0xd')],_0x3e3426);_0xa28ba4(_0x27419d[_0x2b42('0xb')](0x1f4,_0x352ef7['message']));});});};exports['ShowZohoAccount']=function(_0x39e32e){var _0x15298d=this;return new Promise(function(_0x41d4ef,_0x17d28a){return db['ZohoAccount'][_0x2b42('0x1b')]({'raw':_0x39e32e[_0x2b42('0x13')]?_0x39e32e[_0x2b42('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x39e32e[_0x2b42('0x13')]?_0x39e32e[_0x2b42('0x13')][_0x2b42('0x14')]||null:null,'attributes':_0x39e32e[_0x2b42('0x13')]?_0x39e32e[_0x2b42('0x13')][_0x2b42('0x18')]||null:null,'include':_0x39e32e[_0x2b42('0x13')]?_0x39e32e[_0x2b42('0x13')][_0x2b42('0x19')]?_[_0x2b42('0x16')](_0x39e32e[_0x2b42('0x13')]['include'],function(_0x2b5d28){return{'model':db[_0x2b5d28['model']],'as':_0x2b5d28['as'],'attributes':_0x2b5d28['attributes'],'include':_0x2b5d28[_0x2b42('0x19')]?_[_0x2b42('0x16')](_0x2b5d28['include'],function(_0x480315){return{'model':db[_0x480315['model']],'as':_0x480315['as'],'attributes':_0x480315[_0x2b42('0x18')],'include':_0x480315[_0x2b42('0x19')]?_[_0x2b42('0x16')](_0x480315['include'],function(_0x45f8d5){return{'model':db[_0x45f8d5[_0x2b42('0x17')]],'as':_0x45f8d5['as'],'attributes':_0x45f8d5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2603f7){logger[_0x2b42('0xe')](_0x2b42('0x1c'),_0x39e32e);logger['debug'](_0x2b42('0x1c'),_0x39e32e,JSON[_0x2b42('0xa')](_0x2603f7));_0x41d4ef(_0x2603f7);})[_0x2b42('0x10')](function(_0x45d4ab){logger[_0x2b42('0xb')]('ShowZohoAccount',_0x45d4ab[_0x2b42('0xd')],_0x39e32e);_0x17d28a(_0x15298d[_0x2b42('0xb')](0x1f4,_0x45d4ab[_0x2b42('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index f482f9d..56288a6 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 _0x70d9=['exports','multer','path','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','update','destroy'];(function(_0x598b6f,_0x55690f){var _0x40959f=function(_0x5b23af){while(--_0x5b23af){_0x598b6f['push'](_0x598b6f['shift']());}};_0x40959f(++_0x55690f);}(_0x70d9,0x119));var _0x970d=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x70d9[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x970d('0x0'));var util=require('util');var path=require(_0x970d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x970d('0x2'));var auth=require(_0x970d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x970d('0x4'));var controller=require(_0x970d('0x5'));router[_0x970d('0x6')]('/',auth['isAuthenticated'](),controller[_0x970d('0x7')]);router[_0x970d('0x6')](_0x970d('0x8'),auth[_0x970d('0x9')](),controller[_0x970d('0xa')]);router[_0x970d('0x6')](_0x970d('0xb'),auth[_0x970d('0x9')](),controller['getFields']);router['get'](_0x970d('0xc'),auth[_0x970d('0x9')](),controller[_0x970d('0xd')]);router[_0x970d('0x6')](_0x970d('0xe'),auth[_0x970d('0x9')](),controller[_0x970d('0xf')]);router['post']('/',auth[_0x970d('0x9')](),controller[_0x970d('0x10')]);router['put'](_0x970d('0x8'),auth[_0x970d('0x9')](),controller[_0x970d('0x11')]);router['delete'](_0x970d('0x8'),auth[_0x970d('0x9')](),controller[_0x970d('0x12')]);module[_0x970d('0x13')]=router; \ No newline at end of file +var _0xbc68=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbc68,0x1e8));var _0x8bc6=function(_0x16bf67,_0x477394){_0x16bf67=_0x16bf67-0x0;var _0xac79dd=_0xbc68[_0x16bf67];return _0xac79dd;};'use strict';var multer=require('multer');var util=require(_0x8bc6('0x0'));var path=require(_0x8bc6('0x1'));var timeout=require(_0x8bc6('0x2'));var express=require(_0x8bc6('0x3'));var router=express[_0x8bc6('0x4')]();var fs_extra=require(_0x8bc6('0x5'));var auth=require(_0x8bc6('0x6'));var interaction=require(_0x8bc6('0x7'));var config=require('../../config/environment');var controller=require(_0x8bc6('0x8'));router[_0x8bc6('0x9')]('/',auth[_0x8bc6('0xa')](),controller['index']);router[_0x8bc6('0x9')](_0x8bc6('0xb'),auth['isAuthenticated'](),controller[_0x8bc6('0xc')]);router['get'](_0x8bc6('0xd'),auth[_0x8bc6('0xa')](),controller[_0x8bc6('0xe')]);router[_0x8bc6('0x9')]('/:id/subjects',auth[_0x8bc6('0xa')](),controller[_0x8bc6('0xf')]);router[_0x8bc6('0x9')](_0x8bc6('0x10'),auth['isAuthenticated'](),controller[_0x8bc6('0x11')]);router[_0x8bc6('0x12')]('/',auth[_0x8bc6('0xa')](),controller[_0x8bc6('0x13')]);router[_0x8bc6('0x14')]('/:id',auth[_0x8bc6('0xa')](),controller[_0x8bc6('0x15')]);router[_0x8bc6('0x16')](_0x8bc6('0xb'),auth['isAuthenticated'](),controller[_0x8bc6('0x17')]);module[_0x8bc6('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 84c72c8..1eff9a3 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 _0x8a06=['STRING','contact','nothing','lead','ENUM','contact_lead','sequelize','exports'];(function(_0x426070,_0x23f111){var _0x3e449c=function(_0x35c9f9){while(--_0x35c9f9){_0x426070['push'](_0x426070['shift']());}};_0x3e449c(++_0x23f111);}(_0x8a06,0x1c6));var _0x68a0=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0x8a06[_0x210718];return _0x541bfc;};'use strict';var Sequelize=require(_0x68a0('0x0'));module[_0x68a0('0x1')]={'name':{'type':Sequelize[_0x68a0('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x68a0('0x3'),_0x68a0('0x4')),'defaultValue':_0x68a0('0x5')},'moduleSearch':{'type':Sequelize[_0x68a0('0x6')](_0x68a0('0x7'),_0x68a0('0x3'),'lead'),'defaultValue':_0x68a0('0x7')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6e34=['lead','sequelize','exports','STRING','ENUM','contact','nothing','contact_lead'];(function(_0x19d350,_0x3c843f){var _0x3bfc8d=function(_0xd89003){while(--_0xd89003){_0x19d350['push'](_0x19d350['shift']());}};_0x3bfc8d(++_0x3c843f);}(_0x6e34,0x159));var _0x46e3=function(_0x33b414,_0x36ebcf){_0x33b414=_0x33b414-0x0;var _0x3e67a2=_0x6e34[_0x33b414];return _0x3e67a2;};'use strict';var Sequelize=require(_0x46e3('0x0'));module[_0x46e3('0x1')]={'name':{'type':Sequelize[_0x46e3('0x2')]},'moduleCreate':{'type':Sequelize[_0x46e3('0x3')]('lead',_0x46e3('0x4'),_0x46e3('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0x46e3('0x6'),'contact',_0x46e3('0x7')),'defaultValue':_0x46e3('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index dd5feae..5d16217 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 _0x2588=['path','sox','to-csv','ejs','fs-extra','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getFields','getSubjects','ZohoField','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x123c45,_0xdfb640){var _0x1fa37d=function(_0x12cce2){while(--_0x12cce2){_0x123c45['push'](_0x123c45['shift']());}};_0x1fa37d(++_0xdfb640);}(_0x2588,0x139));var _0x8258=function(_0xda2972,_0x55d9c1){_0xda2972=_0xda2972-0x0;var _0x803ee1=_0x2588[_0xda2972];return _0x803ee1;};'use strict';var emlformat=require(_0x8258('0x0'));var rimraf=require(_0x8258('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8258('0x2'));var rp=require(_0x8258('0x3'));var moment=require(_0x8258('0x4'));var BPromise=require(_0x8258('0x5'));var Mustache=require('mustache');var util=require(_0x8258('0x6'));var path=require(_0x8258('0x7'));var sox=require(_0x8258('0x8'));var csv=require(_0x8258('0x9'));var ejs=require(_0x8258('0xa'));var fs=require('fs');var fs_extra=require(_0x8258('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8258('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8258('0x9'));var querystring=require(_0x8258('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8258('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8258('0xf'));var hardwareService=require(_0x8258('0x10'));var logger=require(_0x8258('0x11'))(_0x8258('0x12'));var utils=require(_0x8258('0x13'));var config=require(_0x8258('0x14'));var licenseUtil=require(_0x8258('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13dede,_0x2926a6){_0x2926a6=_0x2926a6||0xcc;return function(_0x2530dd){if(_0x2530dd){return _0x13dede[_0x8258('0x16')](_0x2926a6);}return _0x13dede[_0x8258('0x17')](_0x2926a6)['end']();};}function respondWithResult(_0x1607b9,_0x3444eb){_0x3444eb=_0x3444eb||0xc8;return function(_0x2d11c8){if(_0x2d11c8){return _0x1607b9[_0x8258('0x17')](_0x3444eb)[_0x8258('0x18')](_0x2d11c8);}};}function respondWithFilteredResult(_0x43465e,_0xc1988){return function(_0x58dfb6){if(_0x58dfb6){var _0xd32382=typeof _0xc1988['offset']===_0x8258('0x19')&&typeof _0xc1988[_0x8258('0x1a')]==='undefined';var _0x2f56c9=_0x58dfb6[_0x8258('0x1b')];var _0x36c7a9=_0xd32382?0x0:_0xc1988[_0x8258('0x1c')];var _0x317d91=_0xd32382?_0x58dfb6[_0x8258('0x1b')]:_0xc1988[_0x8258('0x1c')]+_0xc1988['limit'];var _0x5d9b07;if(_0x317d91>=_0x2f56c9){_0x317d91=_0x2f56c9;_0x5d9b07=0xc8;}else{_0x5d9b07=0xce;}_0x43465e[_0x8258('0x17')](_0x5d9b07);return _0x43465e[_0x8258('0x1d')](_0x8258('0x1e'),_0x36c7a9+'-'+_0x317d91+'/'+_0x2f56c9)[_0x8258('0x18')](_0x58dfb6);}return null;};}function patchUpdates(_0xd3790a){return function(_0xaf0463){try{jsonpatch[_0x8258('0x1f')](_0xaf0463,_0xd3790a,!![]);}catch(_0x1d822c){return BPromise[_0x8258('0x20')](_0x1d822c);}return _0xaf0463[_0x8258('0x21')]();};}function saveUpdates(_0x1dc41f,_0x5bdbf4){return function(_0x517d1e){if(_0x517d1e){return _0x517d1e[_0x8258('0x22')](_0x1dc41f)['then'](function(_0x2a2c0d){return _0x2a2c0d;});}return null;};}function removeEntity(_0x163510,_0x210568){return function(_0x57a13a){if(_0x57a13a){return _0x57a13a[_0x8258('0x23')]()[_0x8258('0x24')](function(){_0x163510['status'](0xcc)[_0x8258('0x25')]();});}};}function handleEntityNotFound(_0x213c68,_0x5ce406){return function(_0x4969c8){if(!_0x4969c8){_0x213c68[_0x8258('0x16')](0x194);}return _0x4969c8;};}function handleError(_0x409704,_0x34322f){_0x34322f=_0x34322f||0x1f4;return function(_0x22699a){logger[_0x8258('0x26')](_0x22699a['stack']);if(_0x22699a[_0x8258('0x27')]){delete _0x22699a['name'];}_0x409704['status'](_0x34322f)[_0x8258('0x28')](_0x22699a);};}exports[_0x8258('0x29')]=function(_0x253c5f,_0x49da04){var _0x31cc07={},_0xa4eb2a={},_0x491d06={'count':0x0,'rows':[]};var _0x100f15=_[_0x8258('0x2a')](db[_0x8258('0x2b')][_0x8258('0x2c')],function(_0x1184a9){return{'name':_0x1184a9[_0x8258('0x2d')],'type':_0x1184a9[_0x8258('0x2e')][_0x8258('0x2f')]};});_0xa4eb2a[_0x8258('0x30')]=_[_0x8258('0x2a')](_0x100f15,_0x8258('0x27'));_0xa4eb2a[_0x8258('0x31')]=_[_0x8258('0x32')](_0x253c5f[_0x8258('0x31')]);_0xa4eb2a[_0x8258('0x33')]=_[_0x8258('0x34')](_0xa4eb2a[_0x8258('0x30')],_0xa4eb2a['query']);_0x31cc07[_0x8258('0x35')]=_[_0x8258('0x34')](_0xa4eb2a[_0x8258('0x30')],qs[_0x8258('0x36')](_0x253c5f['query']['fields']));_0x31cc07[_0x8258('0x35')]=_0x31cc07[_0x8258('0x35')]['length']?_0x31cc07[_0x8258('0x35')]:_0xa4eb2a['model'];if(!_0x253c5f[_0x8258('0x31')][_0x8258('0x37')](_0x8258('0x38'))){_0x31cc07[_0x8258('0x1a')]=qs[_0x8258('0x1a')](_0x253c5f[_0x8258('0x31')][_0x8258('0x1a')]);_0x31cc07[_0x8258('0x1c')]=qs['offset'](_0x253c5f[_0x8258('0x31')][_0x8258('0x1c')]);}_0x31cc07[_0x8258('0x39')]=qs[_0x8258('0x3a')](_0x253c5f[_0x8258('0x31')][_0x8258('0x3a')]);_0x31cc07['where']=qs['filters'](_[_0x8258('0x3b')](_0x253c5f['query'],_0xa4eb2a['filters']),_0x100f15);if(_0x253c5f[_0x8258('0x31')][_0x8258('0x3c')]){_0x31cc07[_0x8258('0x3d')]=_[_0x8258('0x3e')](_0x31cc07[_0x8258('0x3d')],{'$or':_[_0x8258('0x2a')](_0x100f15,function(_0x26849d){if(_0x26849d[_0x8258('0x2e')]!=='VIRTUAL'){var _0x221492={};_0x221492[_0x26849d[_0x8258('0x27')]]={'$like':'%'+_0x253c5f[_0x8258('0x31')]['filter']+'%'};return _0x221492;}})});}_0x31cc07=_[_0x8258('0x3e')]({},_0x31cc07,_0x253c5f[_0x8258('0x3f')]);var _0x21ea80={'where':_0x31cc07[_0x8258('0x3d')]};return db[_0x8258('0x2b')][_0x8258('0x1b')](_0x21ea80)['then'](function(_0x103544){_0x491d06[_0x8258('0x1b')]=_0x103544;if(_0x253c5f['query'][_0x8258('0x40')]){_0x31cc07[_0x8258('0x41')]=[{'all':!![]}];}return db[_0x8258('0x2b')][_0x8258('0x42')](_0x31cc07);})[_0x8258('0x24')](function(_0x2181ea){_0x491d06[_0x8258('0x43')]=_0x2181ea;return _0x491d06;})[_0x8258('0x24')](respondWithFilteredResult(_0x49da04,_0x31cc07))[_0x8258('0x44')](handleError(_0x49da04,null));};exports[_0x8258('0x45')]=function(_0xd89ac0,_0x4917a2){var _0x31256e={'raw':![],'where':{'id':_0xd89ac0[_0x8258('0x46')]['id']}},_0x4dcf78={};_0x4dcf78[_0x8258('0x30')]=_[_0x8258('0x32')](db[_0x8258('0x2b')][_0x8258('0x2c')]);_0x4dcf78[_0x8258('0x31')]=_[_0x8258('0x32')](_0xd89ac0['query']);_0x4dcf78[_0x8258('0x33')]=_[_0x8258('0x34')](_0x4dcf78['model'],_0x4dcf78[_0x8258('0x31')]);_0x31256e[_0x8258('0x35')]=_['intersection'](_0x4dcf78['model'],qs[_0x8258('0x36')](_0xd89ac0[_0x8258('0x31')][_0x8258('0x36')]));_0x31256e['attributes']=_0x31256e['attributes'][_0x8258('0x47')]?_0x31256e[_0x8258('0x35')]:_0x4dcf78[_0x8258('0x30')];if(_0xd89ac0[_0x8258('0x31')][_0x8258('0x40')]){_0x31256e[_0x8258('0x41')]=[{'all':!![]}];}_0x31256e=_['merge']({},_0x31256e,_0xd89ac0[_0x8258('0x3f')]);return db[_0x8258('0x2b')][_0x8258('0x48')](_0x31256e)['then'](handleEntityNotFound(_0x4917a2,null))['then'](respondWithResult(_0x4917a2,null))[_0x8258('0x44')](handleError(_0x4917a2,null));};exports[_0x8258('0x49')]=function(_0x36e7f3,_0x55da5f){return db[_0x8258('0x2b')][_0x8258('0x49')](_0x36e7f3[_0x8258('0x4a')],{})[_0x8258('0x24')](respondWithResult(_0x55da5f,0xc9))['catch'](handleError(_0x55da5f,null));};exports[_0x8258('0x22')]=function(_0x23ec75,_0x1781fe){if(_0x23ec75[_0x8258('0x4a')]['id']){delete _0x23ec75[_0x8258('0x4a')]['id'];}return db[_0x8258('0x2b')]['find']({'where':{'id':_0x23ec75[_0x8258('0x46')]['id']}})['then'](handleEntityNotFound(_0x1781fe,null))[_0x8258('0x24')](saveUpdates(_0x23ec75['body'],null))[_0x8258('0x24')](respondWithResult(_0x1781fe,null))[_0x8258('0x44')](handleError(_0x1781fe,null));};exports[_0x8258('0x23')]=function(_0x447bf0,_0x1e88d9){return db[_0x8258('0x2b')][_0x8258('0x48')]({'where':{'id':_0x447bf0['params']['id']}})[_0x8258('0x24')](handleEntityNotFound(_0x1e88d9,null))[_0x8258('0x24')](removeEntity(_0x1e88d9,null))[_0x8258('0x44')](handleError(_0x1e88d9,null));};exports[_0x8258('0x4b')]=function(_0x321929,_0x306607,_0x528503){var _0x391c4f={};var _0x36fa14={};var _0x48c9e3;var _0x1dfa93;return db[_0x8258('0x2b')]['findOne']({'where':{'id':_0x321929[_0x8258('0x46')]['id']}})[_0x8258('0x24')](handleEntityNotFound(_0x306607,null))[_0x8258('0x24')](function(_0x1c6c49){if(_0x1c6c49){_0x48c9e3=_0x1c6c49;_0x36fa14[_0x8258('0x30')]=_[_0x8258('0x32')](db['ZohoField'][_0x8258('0x2c')]);_0x36fa14[_0x8258('0x31')]=_[_0x8258('0x32')](_0x321929['query']);_0x36fa14[_0x8258('0x33')]=_['intersection'](_0x36fa14[_0x8258('0x30')],_0x36fa14[_0x8258('0x31')]);_0x391c4f['attributes']=_['intersection'](_0x36fa14[_0x8258('0x30')],qs[_0x8258('0x36')](_0x321929[_0x8258('0x31')]['fields']));_0x391c4f[_0x8258('0x35')]=_0x391c4f[_0x8258('0x35')][_0x8258('0x47')]?_0x391c4f[_0x8258('0x35')]:_0x36fa14[_0x8258('0x30')];_0x391c4f[_0x8258('0x39')]=qs['sort'](_0x321929[_0x8258('0x31')][_0x8258('0x3a')]);_0x391c4f[_0x8258('0x3d')]=qs[_0x8258('0x33')](_[_0x8258('0x3b')](_0x321929[_0x8258('0x31')],_0x36fa14[_0x8258('0x33')]));if(_0x321929[_0x8258('0x31')][_0x8258('0x3c')]){_0x391c4f[_0x8258('0x3d')]=_[_0x8258('0x3e')](_0x391c4f[_0x8258('0x3d')],{'$or':_[_0x8258('0x2a')](_0x391c4f[_0x8258('0x35')],function(_0x4e7e38){var _0x50b732={};_0x50b732[_0x4e7e38]={'$like':'%'+_0x321929[_0x8258('0x31')]['filter']+'%'};return _0x50b732;})});}_0x391c4f=_[_0x8258('0x3e')]({},_0x391c4f,_0x321929['options']);return _0x48c9e3['getFields'](_0x391c4f);}})[_0x8258('0x24')](function(_0x1ebb12){if(_0x1ebb12){_0x1dfa93=_0x1ebb12[_0x8258('0x47')];if(!_0x321929['query'][_0x8258('0x37')](_0x8258('0x38'))){_0x391c4f[_0x8258('0x1a')]=qs[_0x8258('0x1a')](_0x321929['query']['limit']);_0x391c4f['offset']=qs[_0x8258('0x1c')](_0x321929[_0x8258('0x31')][_0x8258('0x1c')]);}return _0x48c9e3['getFields'](_0x391c4f);}})[_0x8258('0x24')](function(_0x490347){if(_0x490347){return _0x490347?{'count':_0x1dfa93,'rows':_0x490347}:null;}})[_0x8258('0x24')](respondWithResult(_0x306607,null))[_0x8258('0x44')](handleError(_0x306607,null));};exports[_0x8258('0x4c')]=function(_0x45be75,_0xe2a091,_0x163596){var _0x591e02={};var _0xfd3583={};var _0x3a10bf;var _0x1601f8;return db[_0x8258('0x2b')]['findOne']({'where':{'id':_0x45be75[_0x8258('0x46')]['id']}})[_0x8258('0x24')](handleEntityNotFound(_0xe2a091,null))[_0x8258('0x24')](function(_0x59a050){if(_0x59a050){_0x3a10bf=_0x59a050;_0xfd3583[_0x8258('0x30')]=_['keys'](db[_0x8258('0x4d')][_0x8258('0x2c')]);_0xfd3583[_0x8258('0x31')]=_[_0x8258('0x32')](_0x45be75['query']);_0xfd3583[_0x8258('0x33')]=_[_0x8258('0x34')](_0xfd3583[_0x8258('0x30')],_0xfd3583['query']);_0x591e02[_0x8258('0x35')]=_[_0x8258('0x34')](_0xfd3583[_0x8258('0x30')],qs['fields'](_0x45be75[_0x8258('0x31')][_0x8258('0x36')]));_0x591e02['attributes']=_0x591e02[_0x8258('0x35')]['length']?_0x591e02[_0x8258('0x35')]:_0xfd3583[_0x8258('0x30')];_0x591e02[_0x8258('0x39')]=qs[_0x8258('0x3a')](_0x45be75[_0x8258('0x31')][_0x8258('0x3a')]);_0x591e02['where']=qs['filters'](_[_0x8258('0x3b')](_0x45be75[_0x8258('0x31')],_0xfd3583[_0x8258('0x33')]));if(_0x45be75[_0x8258('0x31')]['filter']){_0x591e02['where']=_['merge'](_0x591e02[_0x8258('0x3d')],{'$or':_[_0x8258('0x2a')](_0x591e02[_0x8258('0x35')],function(_0x20f9d7){var _0x235033={};_0x235033[_0x20f9d7]={'$like':'%'+_0x45be75[_0x8258('0x31')][_0x8258('0x3c')]+'%'};return _0x235033;})});}_0x591e02=_[_0x8258('0x3e')]({},_0x591e02,_0x45be75['options']);return _0x3a10bf['getSubjects'](_0x591e02);}})[_0x8258('0x24')](function(_0x54b2ac){if(_0x54b2ac){_0x1601f8=_0x54b2ac[_0x8258('0x47')];if(!_0x45be75['query']['hasOwnProperty'](_0x8258('0x38'))){_0x591e02['limit']=qs['limit'](_0x45be75[_0x8258('0x31')][_0x8258('0x1a')]);_0x591e02[_0x8258('0x1c')]=qs[_0x8258('0x1c')](_0x45be75[_0x8258('0x31')][_0x8258('0x1c')]);}return _0x3a10bf['getSubjects'](_0x591e02);}})[_0x8258('0x24')](function(_0x4184ed){if(_0x4184ed){return _0x4184ed?{'count':_0x1601f8,'rows':_0x4184ed}:null;}})[_0x8258('0x24')](respondWithResult(_0xe2a091,null))[_0x8258('0x44')](handleError(_0xe2a091,null));};exports['getDescriptions']=function(_0x25fb32,_0x14bc4d,_0x1987a9){var _0x3b9fb1={};var _0x592588={};var _0xca55f2;var _0x30f0b4;return db[_0x8258('0x2b')][_0x8258('0x4e')]({'where':{'id':_0x25fb32[_0x8258('0x46')]['id']}})[_0x8258('0x24')](handleEntityNotFound(_0x14bc4d,null))['then'](function(_0x3e7a17){if(_0x3e7a17){_0xca55f2=_0x3e7a17;_0x592588[_0x8258('0x30')]=_[_0x8258('0x32')](db[_0x8258('0x4d')][_0x8258('0x2c')]);_0x592588[_0x8258('0x31')]=_[_0x8258('0x32')](_0x25fb32[_0x8258('0x31')]);_0x592588[_0x8258('0x33')]=_['intersection'](_0x592588[_0x8258('0x30')],_0x592588[_0x8258('0x31')]);_0x3b9fb1[_0x8258('0x35')]=_[_0x8258('0x34')](_0x592588['model'],qs['fields'](_0x25fb32[_0x8258('0x31')]['fields']));_0x3b9fb1['attributes']=_0x3b9fb1['attributes']['length']?_0x3b9fb1[_0x8258('0x35')]:_0x592588[_0x8258('0x30')];_0x3b9fb1[_0x8258('0x39')]=qs[_0x8258('0x3a')](_0x25fb32[_0x8258('0x31')]['sort']);_0x3b9fb1['where']=qs[_0x8258('0x33')](_[_0x8258('0x3b')](_0x25fb32['query'],_0x592588[_0x8258('0x33')]));if(_0x25fb32[_0x8258('0x31')][_0x8258('0x3c')]){_0x3b9fb1['where']=_[_0x8258('0x3e')](_0x3b9fb1[_0x8258('0x3d')],{'$or':_['map'](_0x3b9fb1[_0x8258('0x35')],function(_0x3561a2){var _0x543d1f={};_0x543d1f[_0x3561a2]={'$like':'%'+_0x25fb32[_0x8258('0x31')][_0x8258('0x3c')]+'%'};return _0x543d1f;})});}_0x3b9fb1=_[_0x8258('0x3e')]({},_0x3b9fb1,_0x25fb32[_0x8258('0x3f')]);return _0xca55f2[_0x8258('0x4f')](_0x3b9fb1);}})['then'](function(_0x2489b5){if(_0x2489b5){_0x30f0b4=_0x2489b5[_0x8258('0x47')];if(!_0x25fb32[_0x8258('0x31')][_0x8258('0x37')](_0x8258('0x38'))){_0x3b9fb1[_0x8258('0x1a')]=qs[_0x8258('0x1a')](_0x25fb32['query'][_0x8258('0x1a')]);_0x3b9fb1[_0x8258('0x1c')]=qs[_0x8258('0x1c')](_0x25fb32[_0x8258('0x31')][_0x8258('0x1c')]);}return _0xca55f2['getDescriptions'](_0x3b9fb1);}})[_0x8258('0x24')](function(_0x15b928){if(_0x15b928){return _0x15b928?{'count':_0x30f0b4,'rows':_0x15b928}:null;}})[_0x8258('0x24')](respondWithResult(_0x14bc4d,null))[_0x8258('0x44')](handleError(_0x14bc4d,null));}; \ No newline at end of file +var _0xaed6=['include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','destroy','getFields','hasOwnProperty','getSubjects','findOne','ZohoField','getDescriptions','eml-format','rimraf','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoConfiguration','includeAll'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xaed6,0x114));var _0x6aed=function(_0x306dc2,_0x25ebaa){_0x306dc2=_0x306dc2-0x0;var _0x38f5b8=_0xaed6[_0x306dc2];return _0x38f5b8;};'use strict';var emlformat=require(_0x6aed('0x0'));var rimraf=require(_0x6aed('0x1'));var zipdir=require(_0x6aed('0x2'));var jsonpatch=require(_0x6aed('0x3'));var rp=require(_0x6aed('0x4'));var moment=require(_0x6aed('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6aed('0x6'));var util=require(_0x6aed('0x7'));var path=require('path');var sox=require(_0x6aed('0x8'));var csv=require(_0x6aed('0x9'));var ejs=require(_0x6aed('0xa'));var fs=require('fs');var fs_extra=require(_0x6aed('0xb'));var _=require(_0x6aed('0xc'));var squel=require(_0x6aed('0xd'));var crypto=require(_0x6aed('0xe'));var jsforce=require(_0x6aed('0xf'));var deskjs=require(_0x6aed('0x10'));var toCsv=require(_0x6aed('0x9'));var querystring=require(_0x6aed('0x11'));var Papa=require('papaparse');var Redis=require(_0x6aed('0x12'));var authService=require(_0x6aed('0x13'));var qs=require(_0x6aed('0x14'));var as=require(_0x6aed('0x15'));var hardwareService=require(_0x6aed('0x16'));var logger=require(_0x6aed('0x17'))(_0x6aed('0x18'));var utils=require('../../config/utils');var config=require(_0x6aed('0x19'));var licenseUtil=require(_0x6aed('0x1a'));var db=require(_0x6aed('0x1b'))['db'];function respondWithStatusCode(_0x2486ef,_0x325273){_0x325273=_0x325273||0xcc;return function(_0x268d4a){if(_0x268d4a){return _0x2486ef[_0x6aed('0x1c')](_0x325273);}return _0x2486ef[_0x6aed('0x1d')](_0x325273)[_0x6aed('0x1e')]();};}function respondWithResult(_0x3fef83,_0x121e84){_0x121e84=_0x121e84||0xc8;return function(_0x3fbae7){if(_0x3fbae7){return _0x3fef83[_0x6aed('0x1d')](_0x121e84)[_0x6aed('0x1f')](_0x3fbae7);}};}function respondWithFilteredResult(_0x29faa9,_0x466a22){return function(_0xe9dbf4){if(_0xe9dbf4){var _0x3bdfd4=typeof _0x466a22[_0x6aed('0x20')]===_0x6aed('0x21')&&typeof _0x466a22[_0x6aed('0x22')]==='undefined';var _0x1e35b2=_0xe9dbf4['count'];var _0x19bcdb=_0x3bdfd4?0x0:_0x466a22['offset'];var _0xbb2e76=_0x3bdfd4?_0xe9dbf4[_0x6aed('0x23')]:_0x466a22['offset']+_0x466a22['limit'];var _0x4cd872;if(_0xbb2e76>=_0x1e35b2){_0xbb2e76=_0x1e35b2;_0x4cd872=0xc8;}else{_0x4cd872=0xce;}_0x29faa9[_0x6aed('0x1d')](_0x4cd872);return _0x29faa9[_0x6aed('0x24')](_0x6aed('0x25'),_0x19bcdb+'-'+_0xbb2e76+'/'+_0x1e35b2)[_0x6aed('0x1f')](_0xe9dbf4);}return null;};}function patchUpdates(_0x2643f5){return function(_0x1722b6){try{jsonpatch[_0x6aed('0x26')](_0x1722b6,_0x2643f5,!![]);}catch(_0x198586){return BPromise[_0x6aed('0x27')](_0x198586);}return _0x1722b6[_0x6aed('0x28')]();};}function saveUpdates(_0x1f37f1,_0x2c0145){return function(_0x41dfd8){if(_0x41dfd8){return _0x41dfd8[_0x6aed('0x29')](_0x1f37f1)[_0x6aed('0x2a')](function(_0x71225d){return _0x71225d;});}return null;};}function removeEntity(_0x37cfa4,_0x32fb02){return function(_0x2c7b22){if(_0x2c7b22){return _0x2c7b22['destroy']()[_0x6aed('0x2a')](function(){_0x37cfa4['status'](0xcc)[_0x6aed('0x1e')]();});}};}function handleEntityNotFound(_0x7c6eb,_0x85f362){return function(_0x418dd6){if(!_0x418dd6){_0x7c6eb[_0x6aed('0x1c')](0x194);}return _0x418dd6;};}function handleError(_0x2e3531,_0x5ee835){_0x5ee835=_0x5ee835||0x1f4;return function(_0x3655a4){logger['error'](_0x3655a4[_0x6aed('0x2b')]);if(_0x3655a4[_0x6aed('0x2c')]){delete _0x3655a4['name'];}_0x2e3531[_0x6aed('0x1d')](_0x5ee835)[_0x6aed('0x2d')](_0x3655a4);};}exports[_0x6aed('0x2e')]=function(_0x483e6e,_0x2ff3ab){var _0x4e438a={},_0x2774f1={},_0x3054f6={'count':0x0,'rows':[]};var _0x4309e9=_['map'](db['ZohoConfiguration']['rawAttributes'],function(_0x3983be){return{'name':_0x3983be['fieldName'],'type':_0x3983be[_0x6aed('0x2f')][_0x6aed('0x30')]};});_0x2774f1[_0x6aed('0x31')]=_[_0x6aed('0x32')](_0x4309e9,_0x6aed('0x2c'));_0x2774f1[_0x6aed('0x33')]=_[_0x6aed('0x34')](_0x483e6e[_0x6aed('0x33')]);_0x2774f1[_0x6aed('0x35')]=_[_0x6aed('0x36')](_0x2774f1[_0x6aed('0x31')],_0x2774f1['query']);_0x4e438a[_0x6aed('0x37')]=_[_0x6aed('0x36')](_0x2774f1[_0x6aed('0x31')],qs[_0x6aed('0x38')](_0x483e6e[_0x6aed('0x33')][_0x6aed('0x38')]));_0x4e438a[_0x6aed('0x37')]=_0x4e438a[_0x6aed('0x37')]['length']?_0x4e438a[_0x6aed('0x37')]:_0x2774f1['model'];if(!_0x483e6e['query']['hasOwnProperty'](_0x6aed('0x39'))){_0x4e438a[_0x6aed('0x22')]=qs['limit'](_0x483e6e[_0x6aed('0x33')][_0x6aed('0x22')]);_0x4e438a[_0x6aed('0x20')]=qs['offset'](_0x483e6e['query']['offset']);}_0x4e438a[_0x6aed('0x3a')]=qs[_0x6aed('0x3b')](_0x483e6e[_0x6aed('0x33')][_0x6aed('0x3b')]);_0x4e438a[_0x6aed('0x3c')]=qs[_0x6aed('0x35')](_[_0x6aed('0x3d')](_0x483e6e[_0x6aed('0x33')],_0x2774f1[_0x6aed('0x35')]),_0x4309e9);if(_0x483e6e['query'][_0x6aed('0x3e')]){_0x4e438a[_0x6aed('0x3c')]=_[_0x6aed('0x3f')](_0x4e438a[_0x6aed('0x3c')],{'$or':_[_0x6aed('0x32')](_0x4309e9,function(_0x45b241){if(_0x45b241[_0x6aed('0x2f')]!==_0x6aed('0x40')){var _0x34a272={};_0x34a272[_0x45b241[_0x6aed('0x2c')]]={'$like':'%'+_0x483e6e['query']['filter']+'%'};return _0x34a272;}})});}_0x4e438a=_[_0x6aed('0x3f')]({},_0x4e438a,_0x483e6e[_0x6aed('0x41')]);var _0x473035={'where':_0x4e438a[_0x6aed('0x3c')]};return db[_0x6aed('0x42')]['count'](_0x473035)[_0x6aed('0x2a')](function(_0xf19c49){_0x3054f6['count']=_0xf19c49;if(_0x483e6e[_0x6aed('0x33')][_0x6aed('0x43')]){_0x4e438a[_0x6aed('0x44')]=[{'all':!![]}];}return db[_0x6aed('0x42')][_0x6aed('0x45')](_0x4e438a);})[_0x6aed('0x2a')](function(_0xf00707){_0x3054f6[_0x6aed('0x46')]=_0xf00707;return _0x3054f6;})[_0x6aed('0x2a')](respondWithFilteredResult(_0x2ff3ab,_0x4e438a))[_0x6aed('0x47')](handleError(_0x2ff3ab,null));};exports[_0x6aed('0x48')]=function(_0x447b82,_0x198dfd){var _0x5cf7f0={'raw':![],'where':{'id':_0x447b82[_0x6aed('0x49')]['id']}},_0x3bbe52={};_0x3bbe52['model']=_['keys'](db[_0x6aed('0x42')][_0x6aed('0x4a')]);_0x3bbe52['query']=_[_0x6aed('0x34')](_0x447b82[_0x6aed('0x33')]);_0x3bbe52[_0x6aed('0x35')]=_[_0x6aed('0x36')](_0x3bbe52[_0x6aed('0x31')],_0x3bbe52[_0x6aed('0x33')]);_0x5cf7f0[_0x6aed('0x37')]=_[_0x6aed('0x36')](_0x3bbe52[_0x6aed('0x31')],qs[_0x6aed('0x38')](_0x447b82[_0x6aed('0x33')]['fields']));_0x5cf7f0[_0x6aed('0x37')]=_0x5cf7f0[_0x6aed('0x37')][_0x6aed('0x4b')]?_0x5cf7f0['attributes']:_0x3bbe52[_0x6aed('0x31')];if(_0x447b82[_0x6aed('0x33')][_0x6aed('0x43')]){_0x5cf7f0[_0x6aed('0x44')]=[{'all':!![]}];}_0x5cf7f0=_[_0x6aed('0x3f')]({},_0x5cf7f0,_0x447b82['options']);return db[_0x6aed('0x42')][_0x6aed('0x4c')](_0x5cf7f0)[_0x6aed('0x2a')](handleEntityNotFound(_0x198dfd,null))[_0x6aed('0x2a')](respondWithResult(_0x198dfd,null))['catch'](handleError(_0x198dfd,null));};exports[_0x6aed('0x4d')]=function(_0x246293,_0x31f374){return db[_0x6aed('0x42')][_0x6aed('0x4d')](_0x246293['body'],{})[_0x6aed('0x2a')](respondWithResult(_0x31f374,0xc9))[_0x6aed('0x47')](handleError(_0x31f374,null));};exports[_0x6aed('0x29')]=function(_0x1b7aad,_0x29ef17){if(_0x1b7aad[_0x6aed('0x4e')]['id']){delete _0x1b7aad[_0x6aed('0x4e')]['id'];}return db[_0x6aed('0x42')]['find']({'where':{'id':_0x1b7aad['params']['id']}})[_0x6aed('0x2a')](handleEntityNotFound(_0x29ef17,null))[_0x6aed('0x2a')](saveUpdates(_0x1b7aad[_0x6aed('0x4e')],null))[_0x6aed('0x2a')](respondWithResult(_0x29ef17,null))[_0x6aed('0x47')](handleError(_0x29ef17,null));};exports[_0x6aed('0x4f')]=function(_0x48ea46,_0x374eaa){return db['ZohoConfiguration'][_0x6aed('0x4c')]({'where':{'id':_0x48ea46['params']['id']}})[_0x6aed('0x2a')](handleEntityNotFound(_0x374eaa,null))[_0x6aed('0x2a')](removeEntity(_0x374eaa,null))[_0x6aed('0x47')](handleError(_0x374eaa,null));};exports[_0x6aed('0x50')]=function(_0x3fe72c,_0x33aa29,_0x432cc1){var _0x16140d={};var _0x11d36b={};var _0x2127df;var _0xb85500;return db[_0x6aed('0x42')]['findOne']({'where':{'id':_0x3fe72c[_0x6aed('0x49')]['id']}})[_0x6aed('0x2a')](handleEntityNotFound(_0x33aa29,null))[_0x6aed('0x2a')](function(_0x3e5a64){if(_0x3e5a64){_0x2127df=_0x3e5a64;_0x11d36b[_0x6aed('0x31')]=_[_0x6aed('0x34')](db['ZohoField']['rawAttributes']);_0x11d36b[_0x6aed('0x33')]=_[_0x6aed('0x34')](_0x3fe72c['query']);_0x11d36b[_0x6aed('0x35')]=_[_0x6aed('0x36')](_0x11d36b['model'],_0x11d36b[_0x6aed('0x33')]);_0x16140d[_0x6aed('0x37')]=_[_0x6aed('0x36')](_0x11d36b[_0x6aed('0x31')],qs[_0x6aed('0x38')](_0x3fe72c[_0x6aed('0x33')][_0x6aed('0x38')]));_0x16140d['attributes']=_0x16140d[_0x6aed('0x37')]['length']?_0x16140d[_0x6aed('0x37')]:_0x11d36b[_0x6aed('0x31')];_0x16140d[_0x6aed('0x3a')]=qs[_0x6aed('0x3b')](_0x3fe72c[_0x6aed('0x33')][_0x6aed('0x3b')]);_0x16140d['where']=qs[_0x6aed('0x35')](_['pick'](_0x3fe72c['query'],_0x11d36b['filters']));if(_0x3fe72c[_0x6aed('0x33')][_0x6aed('0x3e')]){_0x16140d[_0x6aed('0x3c')]=_[_0x6aed('0x3f')](_0x16140d[_0x6aed('0x3c')],{'$or':_[_0x6aed('0x32')](_0x16140d[_0x6aed('0x37')],function(_0x63d0f4){var _0x1b0f64={};_0x1b0f64[_0x63d0f4]={'$like':'%'+_0x3fe72c[_0x6aed('0x33')][_0x6aed('0x3e')]+'%'};return _0x1b0f64;})});}_0x16140d=_[_0x6aed('0x3f')]({},_0x16140d,_0x3fe72c['options']);return _0x2127df[_0x6aed('0x50')](_0x16140d);}})[_0x6aed('0x2a')](function(_0x468555){if(_0x468555){_0xb85500=_0x468555[_0x6aed('0x4b')];if(!_0x3fe72c[_0x6aed('0x33')][_0x6aed('0x51')](_0x6aed('0x39'))){_0x16140d[_0x6aed('0x22')]=qs['limit'](_0x3fe72c[_0x6aed('0x33')][_0x6aed('0x22')]);_0x16140d['offset']=qs['offset'](_0x3fe72c['query'][_0x6aed('0x20')]);}return _0x2127df['getFields'](_0x16140d);}})[_0x6aed('0x2a')](function(_0x1f67d8){if(_0x1f67d8){return _0x1f67d8?{'count':_0xb85500,'rows':_0x1f67d8}:null;}})['then'](respondWithResult(_0x33aa29,null))[_0x6aed('0x47')](handleError(_0x33aa29,null));};exports[_0x6aed('0x52')]=function(_0x31accc,_0x4c6abf,_0x3d7b2e){var _0x3965e1={};var _0x3972eb={};var _0x4ab4b9;var _0x352187;return db['ZohoConfiguration'][_0x6aed('0x53')]({'where':{'id':_0x31accc[_0x6aed('0x49')]['id']}})[_0x6aed('0x2a')](handleEntityNotFound(_0x4c6abf,null))[_0x6aed('0x2a')](function(_0x506b23){if(_0x506b23){_0x4ab4b9=_0x506b23;_0x3972eb[_0x6aed('0x31')]=_[_0x6aed('0x34')](db[_0x6aed('0x54')][_0x6aed('0x4a')]);_0x3972eb['query']=_[_0x6aed('0x34')](_0x31accc[_0x6aed('0x33')]);_0x3972eb[_0x6aed('0x35')]=_[_0x6aed('0x36')](_0x3972eb[_0x6aed('0x31')],_0x3972eb['query']);_0x3965e1['attributes']=_[_0x6aed('0x36')](_0x3972eb['model'],qs['fields'](_0x31accc[_0x6aed('0x33')][_0x6aed('0x38')]));_0x3965e1[_0x6aed('0x37')]=_0x3965e1[_0x6aed('0x37')][_0x6aed('0x4b')]?_0x3965e1[_0x6aed('0x37')]:_0x3972eb['model'];_0x3965e1['order']=qs['sort'](_0x31accc[_0x6aed('0x33')][_0x6aed('0x3b')]);_0x3965e1[_0x6aed('0x3c')]=qs[_0x6aed('0x35')](_[_0x6aed('0x3d')](_0x31accc['query'],_0x3972eb[_0x6aed('0x35')]));if(_0x31accc[_0x6aed('0x33')][_0x6aed('0x3e')]){_0x3965e1['where']=_[_0x6aed('0x3f')](_0x3965e1[_0x6aed('0x3c')],{'$or':_[_0x6aed('0x32')](_0x3965e1['attributes'],function(_0x26fcd0){var _0x24cb4e={};_0x24cb4e[_0x26fcd0]={'$like':'%'+_0x31accc['query'][_0x6aed('0x3e')]+'%'};return _0x24cb4e;})});}_0x3965e1=_['merge']({},_0x3965e1,_0x31accc[_0x6aed('0x41')]);return _0x4ab4b9[_0x6aed('0x52')](_0x3965e1);}})[_0x6aed('0x2a')](function(_0x1fc70a){if(_0x1fc70a){_0x352187=_0x1fc70a[_0x6aed('0x4b')];if(!_0x31accc[_0x6aed('0x33')][_0x6aed('0x51')](_0x6aed('0x39'))){_0x3965e1[_0x6aed('0x22')]=qs[_0x6aed('0x22')](_0x31accc['query'][_0x6aed('0x22')]);_0x3965e1[_0x6aed('0x20')]=qs[_0x6aed('0x20')](_0x31accc['query'][_0x6aed('0x20')]);}return _0x4ab4b9[_0x6aed('0x52')](_0x3965e1);}})[_0x6aed('0x2a')](function(_0x5a9ffd){if(_0x5a9ffd){return _0x5a9ffd?{'count':_0x352187,'rows':_0x5a9ffd}:null;}})['then'](respondWithResult(_0x4c6abf,null))['catch'](handleError(_0x4c6abf,null));};exports[_0x6aed('0x55')]=function(_0x3e8f48,_0x354aa9,_0x12b18a){var _0x475f77={};var _0x5d25e6={};var _0x2e8b77;var _0x48e376;return db[_0x6aed('0x42')][_0x6aed('0x53')]({'where':{'id':_0x3e8f48[_0x6aed('0x49')]['id']}})[_0x6aed('0x2a')](handleEntityNotFound(_0x354aa9,null))['then'](function(_0x11f1b2){if(_0x11f1b2){_0x2e8b77=_0x11f1b2;_0x5d25e6[_0x6aed('0x31')]=_[_0x6aed('0x34')](db[_0x6aed('0x54')][_0x6aed('0x4a')]);_0x5d25e6[_0x6aed('0x33')]=_[_0x6aed('0x34')](_0x3e8f48[_0x6aed('0x33')]);_0x5d25e6['filters']=_[_0x6aed('0x36')](_0x5d25e6[_0x6aed('0x31')],_0x5d25e6['query']);_0x475f77['attributes']=_[_0x6aed('0x36')](_0x5d25e6[_0x6aed('0x31')],qs[_0x6aed('0x38')](_0x3e8f48[_0x6aed('0x33')][_0x6aed('0x38')]));_0x475f77['attributes']=_0x475f77[_0x6aed('0x37')][_0x6aed('0x4b')]?_0x475f77[_0x6aed('0x37')]:_0x5d25e6[_0x6aed('0x31')];_0x475f77['order']=qs[_0x6aed('0x3b')](_0x3e8f48[_0x6aed('0x33')][_0x6aed('0x3b')]);_0x475f77['where']=qs[_0x6aed('0x35')](_['pick'](_0x3e8f48[_0x6aed('0x33')],_0x5d25e6['filters']));if(_0x3e8f48[_0x6aed('0x33')][_0x6aed('0x3e')]){_0x475f77[_0x6aed('0x3c')]=_[_0x6aed('0x3f')](_0x475f77[_0x6aed('0x3c')],{'$or':_[_0x6aed('0x32')](_0x475f77[_0x6aed('0x37')],function(_0x292b2a){var _0x27e0ff={};_0x27e0ff[_0x292b2a]={'$like':'%'+_0x3e8f48[_0x6aed('0x33')][_0x6aed('0x3e')]+'%'};return _0x27e0ff;})});}_0x475f77=_[_0x6aed('0x3f')]({},_0x475f77,_0x3e8f48[_0x6aed('0x41')]);return _0x2e8b77[_0x6aed('0x55')](_0x475f77);}})[_0x6aed('0x2a')](function(_0xa6e11d){if(_0xa6e11d){_0x48e376=_0xa6e11d[_0x6aed('0x4b')];if(!_0x3e8f48[_0x6aed('0x33')][_0x6aed('0x51')](_0x6aed('0x39'))){_0x475f77[_0x6aed('0x22')]=qs['limit'](_0x3e8f48['query'][_0x6aed('0x22')]);_0x475f77[_0x6aed('0x20')]=qs[_0x6aed('0x20')](_0x3e8f48[_0x6aed('0x33')][_0x6aed('0x20')]);}return _0x2e8b77[_0x6aed('0x55')](_0x475f77);}})['then'](function(_0x3bb922){if(_0x3bb922){return _0x3bb922?{'count':_0x48e376,'rows':_0x3bb922}:null;}})[_0x6aed('0x2a')](respondWithResult(_0x354aa9,null))[_0x6aed('0x47')](handleError(_0x354aa9,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index aba4606..41f8fb7 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 _0x6c37=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x31ed98,_0xe63469){var _0x5e4ef1=function(_0x101f0f){while(--_0x101f0f){_0x31ed98['push'](_0x31ed98['shift']());}};_0x5e4ef1(++_0xe63469);}(_0x6c37,0x180));var _0x76c3=function(_0x5dda79,_0x5b35f1){_0x5dda79=_0x5dda79-0x0;var _0x1c1707=_0x6c37[_0x5dda79];return _0x1c1707;};'use strict';var _=require(_0x76c3('0x0'));var util=require(_0x76c3('0x1'));var logger=require(_0x76c3('0x2'))(_0x76c3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x76c3('0x4'));var fs=require('fs');var path=require(_0x76c3('0x5'));var rimraf=require(_0x76c3('0x6'));var config=require(_0x76c3('0x7'));var attributes=require(_0x76c3('0x8'));module['exports']=function(_0x1adca1,_0x4f0be9){return _0x1adca1['define'](_0x76c3('0x9'),attributes,{'tableName':_0x76c3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x433a=['exports','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment','path','./intZohoConfiguration.attributes'];(function(_0x377c40,_0x31bd35){var _0x10ad53=function(_0x3d9f3e){while(--_0x3d9f3e){_0x377c40['push'](_0x377c40['shift']());}};_0x10ad53(++_0x31bd35);}(_0x433a,0x162));var _0xa433=function(_0x25ff7e,_0x130821){_0x25ff7e=_0x25ff7e-0x0;var _0x4883e9=_0x433a[_0x25ff7e];return _0x4883e9;};'use strict';var _=require(_0xa433('0x0'));var util=require('util');var logger=require(_0xa433('0x1'))(_0xa433('0x2'));var moment=require(_0xa433('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa433('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa433('0x5'));module[_0xa433('0x6')]=function(_0x169c00,_0x4c3bf6){return _0x169c00[_0xa433('0x7')](_0xa433('0x8'),attributes,{'tableName':_0xa433('0x9'),'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 7b1eaef..01214fb 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 _0x6b6c=['stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x6b6c,0x1c7));var _0xc6b6=function(_0x2fbbff,_0x51d40a){_0x2fbbff=_0x2fbbff-0x0;var _0x426f85=_0x6b6c[_0x2fbbff];return _0x426f85;};'use strict';var _=require(_0xc6b6('0x0'));var util=require(_0xc6b6('0x1'));var moment=require('moment');var BPromise=require(_0xc6b6('0x2'));var rs=require(_0xc6b6('0x3'));var fs=require('fs');var Redis=require(_0xc6b6('0x4'));var db=require(_0xc6b6('0x5'))['db'];var utils=require(_0xc6b6('0x6'));var logger=require(_0xc6b6('0x7'))(_0xc6b6('0x8'));var config=require(_0xc6b6('0x9'));var jayson=require(_0xc6b6('0xa'));var client=jayson[_0xc6b6('0xb')][_0xc6b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x241701,_0x59bc5d,_0x2eeee9){return new BPromise(function(_0x245e19,_0x6ab564){return client[_0xc6b6('0xd')](_0x241701,_0x2eeee9)[_0xc6b6('0xe')](function(_0x16e489){logger[_0xc6b6('0xf')](_0xc6b6('0x10'),_0x59bc5d,_0xc6b6('0x11'));logger[_0xc6b6('0x12')](_0xc6b6('0x13'),_0x59bc5d,_0xc6b6('0x11'),JSON[_0xc6b6('0x14')](_0x16e489));if(_0x16e489[_0xc6b6('0x15')]){if(_0x16e489['error'][_0xc6b6('0x16')]===0x1f4){logger[_0xc6b6('0x15')]('ZohoConfiguration,\x20%s,\x20%s',_0x59bc5d,_0x16e489[_0xc6b6('0x15')][_0xc6b6('0x17')]);return _0x6ab564(_0x16e489['error'][_0xc6b6('0x17')]);}logger[_0xc6b6('0x15')](_0xc6b6('0x10'),_0x59bc5d,_0x16e489['error'][_0xc6b6('0x17')]);return _0x245e19(_0x16e489[_0xc6b6('0x15')][_0xc6b6('0x17')]);}else{logger[_0xc6b6('0xf')](_0xc6b6('0x10'),_0x59bc5d,'request\x20sent');_0x245e19(_0x16e489[_0xc6b6('0x18')][_0xc6b6('0x17')]);}})['catch'](function(_0x4f427f){logger[_0xc6b6('0x15')](_0xc6b6('0x10'),_0x59bc5d,_0x4f427f);_0x6ab564(_0x4f427f);});});} \ No newline at end of file +var _0xdfbb=['error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1b6158,_0x1b7c2f){var _0x5c6338=function(_0x3672bb){while(--_0x3672bb){_0x1b6158['push'](_0x1b6158['shift']());}};_0x5c6338(++_0x1b7c2f);}(_0xdfbb,0x138));var _0xbdfb=function(_0xc41335,_0x4cc8e1){_0xc41335=_0xc41335-0x0;var _0xb7ae06=_0xdfbb[_0xc41335];return _0xb7ae06;};'use strict';var _=require(_0xbdfb('0x0'));var util=require('util');var moment=require(_0xbdfb('0x1'));var BPromise=require(_0xbdfb('0x2'));var rs=require(_0xbdfb('0x3'));var fs=require('fs');var Redis=require(_0xbdfb('0x4'));var db=require(_0xbdfb('0x5'))['db'];var utils=require(_0xbdfb('0x6'));var logger=require(_0xbdfb('0x7'))(_0xbdfb('0x8'));var config=require(_0xbdfb('0x9'));var jayson=require(_0xbdfb('0xa'));var client=jayson[_0xbdfb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c876b,_0x10b3db,_0x3b42cc){return new BPromise(function(_0x321bb5,_0x3c76f2){return client['request'](_0x5c876b,_0x3b42cc)[_0xbdfb('0xc')](function(_0x5c40db){logger[_0xbdfb('0xd')](_0xbdfb('0xe'),_0x10b3db,_0xbdfb('0xf'));logger[_0xbdfb('0x10')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x10b3db,_0xbdfb('0xf'),JSON[_0xbdfb('0x11')](_0x5c40db));if(_0x5c40db[_0xbdfb('0x12')]){if(_0x5c40db[_0xbdfb('0x12')][_0xbdfb('0x13')]===0x1f4){logger['error'](_0xbdfb('0xe'),_0x10b3db,_0x5c40db[_0xbdfb('0x12')][_0xbdfb('0x14')]);return _0x3c76f2(_0x5c40db[_0xbdfb('0x12')]['message']);}logger['error'](_0xbdfb('0xe'),_0x10b3db,_0x5c40db[_0xbdfb('0x12')][_0xbdfb('0x14')]);return _0x321bb5(_0x5c40db[_0xbdfb('0x12')][_0xbdfb('0x14')]);}else{logger[_0xbdfb('0xd')](_0xbdfb('0xe'),_0x10b3db,'request\x20sent');_0x321bb5(_0x5c40db[_0xbdfb('0x15')]['message']);}})['catch'](function(_0x3e41fd){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x10b3db,_0x3e41fd);_0x3c76f2(_0x3e41fd);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 7df6fef..eb30f72 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 _0x22d1=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','exports','util'];(function(_0x455c95,_0x15407c){var _0x2ba1a6=function(_0x17eb1f){while(--_0x17eb1f){_0x455c95['push'](_0x455c95['shift']());}};_0x2ba1a6(++_0x15407c);}(_0x22d1,0xf6));var _0x122d=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x22d1[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x122d('0x0'));var path=require(_0x122d('0x1'));var timeout=require('connect-timeout');var express=require(_0x122d('0x2'));var router=express[_0x122d('0x3')]();var fs_extra=require(_0x122d('0x4'));var auth=require(_0x122d('0x5'));var interaction=require(_0x122d('0x6'));var config=require(_0x122d('0x7'));var controller=require(_0x122d('0x8'));router[_0x122d('0x9')]('/',auth['isAuthenticated'](),controller[_0x122d('0xa')]);router[_0x122d('0x9')](_0x122d('0xb'),auth[_0x122d('0xc')](),controller[_0x122d('0xd')]);router[_0x122d('0xe')]('/',auth['isAuthenticated'](),controller[_0x122d('0xf')]);router[_0x122d('0x10')](_0x122d('0xb'),auth['isAuthenticated'](),controller[_0x122d('0x11')]);router['delete'](_0x122d('0xb'),auth[_0x122d('0xc')](),controller['destroy']);module[_0x122d('0x12')]=router; \ No newline at end of file +var _0x0eec=['../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x47faad,_0x230b04){var _0x4c449a=function(_0x426c7e){while(--_0x426c7e){_0x47faad['push'](_0x47faad['shift']());}};_0x4c449a(++_0x230b04);}(_0x0eec,0x175));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xc0ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc0ee('0x1'));var express=require(_0xc0ee('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc0ee('0x3'));var interaction=require(_0xc0ee('0x4'));var config=require(_0xc0ee('0x5'));var controller=require(_0xc0ee('0x6'));router[_0xc0ee('0x7')]('/',auth[_0xc0ee('0x8')](),controller[_0xc0ee('0x9')]);router[_0xc0ee('0x7')](_0xc0ee('0xa'),auth[_0xc0ee('0x8')](),controller[_0xc0ee('0xb')]);router[_0xc0ee('0xc')]('/',auth['isAuthenticated'](),controller[_0xc0ee('0xd')]);router[_0xc0ee('0xe')](_0xc0ee('0xa'),auth[_0xc0ee('0x8')](),controller[_0xc0ee('0xf')]);router[_0xc0ee('0x10')](_0xc0ee('0xa'),auth[_0xc0ee('0x8')](),controller[_0xc0ee('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 368ec91..e31fda6 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 _0xe165=['picklist','STRING','ENUM','BOOLEAN','sequelize','string','variable','customVariable','keyValue'];(function(_0x46a8a3,_0x30bdc5){var _0x26f42e=function(_0x770c5a){while(--_0x770c5a){_0x46a8a3['push'](_0x46a8a3['shift']());}};_0x26f42e(++_0x30bdc5);}(_0xe165,0x163));var _0x5e16=function(_0x13b8b5,_0x297054){_0x13b8b5=_0x13b8b5-0x0;var _0x3f4873=_0xe165[_0x13b8b5];return _0x3f4873;};'use strict';var Sequelize=require(_0x5e16('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x5e16('0x1'),_0x5e16('0x2'),_0x5e16('0x3'),_0x5e16('0x4'),_0x5e16('0x5')),'defaultValue':_0x5e16('0x1')},'content':{'type':Sequelize[_0x5e16('0x6')]},'key':{'type':Sequelize[_0x5e16('0x6')]},'keyType':{'type':Sequelize[_0x5e16('0x7')](_0x5e16('0x1'),_0x5e16('0x2'),_0x5e16('0x3'))},'keyContent':{'type':Sequelize[_0x5e16('0x6')]},'idField':{'type':Sequelize[_0x5e16('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5e16('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7479=['exports','string','customVariable','keyValue','picklist','STRING','ENUM','variable','sequelize'];(function(_0x10f1dc,_0x2522bc){var _0x34834f=function(_0x3bee10){while(--_0x3bee10){_0x10f1dc['push'](_0x10f1dc['shift']());}};_0x34834f(++_0x2522bc);}(_0x7479,0x116));var _0x9747=function(_0x314f19,_0x24686e){_0x314f19=_0x314f19-0x0;var _0x2930ce=_0x7479[_0x314f19];return _0x2930ce;};'use strict';var Sequelize=require(_0x9747('0x0'));module[_0x9747('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9747('0x2'),'variable',_0x9747('0x3'),_0x9747('0x4'),_0x9747('0x5')),'defaultValue':_0x9747('0x2')},'content':{'type':Sequelize[_0x9747('0x6')]},'key':{'type':Sequelize[_0x9747('0x6')]},'keyType':{'type':Sequelize[_0x9747('0x7')]('string',_0x9747('0x8'),_0x9747('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9747('0x6')]},'nameField':{'type':Sequelize[_0x9747('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9747('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index cea7bf2..db6552c 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 _0x8c3c=['sort','pick','filter','where','VIRTUAL','merge','options','ZohoField','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','order'];(function(_0x2474ff,_0x5e1bca){var _0x415465=function(_0x55bf19){while(--_0x55bf19){_0x2474ff['push'](_0x2474ff['shift']());}};_0x415465(++_0x5e1bca);}(_0x8c3c,0x142));var _0xc8c3=function(_0x4b4d75,_0x20f3f7){_0x4b4d75=_0x4b4d75-0x0;var _0x3f2827=_0x8c3c[_0x4b4d75];return _0x3f2827;};'use strict';var emlformat=require(_0xc8c3('0x0'));var rimraf=require(_0xc8c3('0x1'));var zipdir=require(_0xc8c3('0x2'));var jsonpatch=require(_0xc8c3('0x3'));var rp=require('request-promise');var moment=require(_0xc8c3('0x4'));var BPromise=require(_0xc8c3('0x5'));var Mustache=require('mustache');var util=require(_0xc8c3('0x6'));var path=require(_0xc8c3('0x7'));var sox=require(_0xc8c3('0x8'));var csv=require('to-csv');var ejs=require(_0xc8c3('0x9'));var fs=require('fs');var fs_extra=require(_0xc8c3('0xa'));var _=require('lodash');var squel=require(_0xc8c3('0xb'));var crypto=require(_0xc8c3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc8c3('0xd'));var toCsv=require(_0xc8c3('0xe'));var querystring=require(_0xc8c3('0xf'));var Papa=require(_0xc8c3('0x10'));var Redis=require(_0xc8c3('0x11'));var authService=require(_0xc8c3('0x12'));var qs=require(_0xc8c3('0x13'));var as=require(_0xc8c3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8c3('0x15'))(_0xc8c3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc8c3('0x17'));var db=require(_0xc8c3('0x18'))['db'];function respondWithStatusCode(_0x29a2ba,_0x4f3757){_0x4f3757=_0x4f3757||0xcc;return function(_0x3497fd){if(_0x3497fd){return _0x29a2ba[_0xc8c3('0x19')](_0x4f3757);}return _0x29a2ba[_0xc8c3('0x1a')](_0x4f3757)[_0xc8c3('0x1b')]();};}function respondWithResult(_0x1a151e,_0x43b56f){_0x43b56f=_0x43b56f||0xc8;return function(_0xac8670){if(_0xac8670){return _0x1a151e['status'](_0x43b56f)[_0xc8c3('0x1c')](_0xac8670);}};}function respondWithFilteredResult(_0xeaeb71,_0x4c0b74){return function(_0x42b703){if(_0x42b703){var _0x1e8b47=typeof _0x4c0b74[_0xc8c3('0x1d')]===_0xc8c3('0x1e')&&typeof _0x4c0b74[_0xc8c3('0x1f')]===_0xc8c3('0x1e');var _0xbc7df9=_0x42b703[_0xc8c3('0x20')];var _0x1bfec0=_0x1e8b47?0x0:_0x4c0b74[_0xc8c3('0x1d')];var _0x4bf669=_0x1e8b47?_0x42b703['count']:_0x4c0b74[_0xc8c3('0x1d')]+_0x4c0b74[_0xc8c3('0x1f')];var _0x31f2a5;if(_0x4bf669>=_0xbc7df9){_0x4bf669=_0xbc7df9;_0x31f2a5=0xc8;}else{_0x31f2a5=0xce;}_0xeaeb71['status'](_0x31f2a5);return _0xeaeb71[_0xc8c3('0x21')](_0xc8c3('0x22'),_0x1bfec0+'-'+_0x4bf669+'/'+_0xbc7df9)[_0xc8c3('0x1c')](_0x42b703);}return null;};}function patchUpdates(_0xfcf8ea){return function(_0x5a984e){try{jsonpatch[_0xc8c3('0x23')](_0x5a984e,_0xfcf8ea,!![]);}catch(_0x1925b8){return BPromise[_0xc8c3('0x24')](_0x1925b8);}return _0x5a984e[_0xc8c3('0x25')]();};}function saveUpdates(_0x1dea53,_0x4d4d50){return function(_0x55ed4b){if(_0x55ed4b){return _0x55ed4b['update'](_0x1dea53)[_0xc8c3('0x26')](function(_0x542bc8){return _0x542bc8;});}return null;};}function removeEntity(_0x23bc30,_0x2da6f7){return function(_0x26ba44){if(_0x26ba44){return _0x26ba44[_0xc8c3('0x27')]()['then'](function(){_0x23bc30['status'](0xcc)[_0xc8c3('0x1b')]();});}};}function handleEntityNotFound(_0x384630,_0x55b825){return function(_0x45d53c){if(!_0x45d53c){_0x384630[_0xc8c3('0x19')](0x194);}return _0x45d53c;};}function handleError(_0x3037ad,_0x1512b4){_0x1512b4=_0x1512b4||0x1f4;return function(_0xfeea42){logger[_0xc8c3('0x28')](_0xfeea42[_0xc8c3('0x29')]);if(_0xfeea42[_0xc8c3('0x2a')]){delete _0xfeea42[_0xc8c3('0x2a')];}_0x3037ad[_0xc8c3('0x1a')](_0x1512b4)[_0xc8c3('0x2b')](_0xfeea42);};}exports[_0xc8c3('0x2c')]=function(_0x51f156,_0x1b7ccb){var _0x790073={},_0x452f55={},_0x1f7c2b={'count':0x0,'rows':[]};var _0x306c0d=_['map'](db['ZohoField']['rawAttributes'],function(_0x180ff3){return{'name':_0x180ff3[_0xc8c3('0x2d')],'type':_0x180ff3[_0xc8c3('0x2e')][_0xc8c3('0x2f')]};});_0x452f55[_0xc8c3('0x30')]=_[_0xc8c3('0x31')](_0x306c0d,_0xc8c3('0x2a'));_0x452f55[_0xc8c3('0x32')]=_[_0xc8c3('0x33')](_0x51f156['query']);_0x452f55[_0xc8c3('0x34')]=_[_0xc8c3('0x35')](_0x452f55[_0xc8c3('0x30')],_0x452f55[_0xc8c3('0x32')]);_0x790073['attributes']=_[_0xc8c3('0x35')](_0x452f55[_0xc8c3('0x30')],qs[_0xc8c3('0x36')](_0x51f156[_0xc8c3('0x32')][_0xc8c3('0x36')]));_0x790073['attributes']=_0x790073['attributes'][_0xc8c3('0x37')]?_0x790073[_0xc8c3('0x38')]:_0x452f55[_0xc8c3('0x30')];if(!_0x51f156[_0xc8c3('0x32')]['hasOwnProperty']('nolimit')){_0x790073['limit']=qs[_0xc8c3('0x1f')](_0x51f156[_0xc8c3('0x32')][_0xc8c3('0x1f')]);_0x790073[_0xc8c3('0x1d')]=qs[_0xc8c3('0x1d')](_0x51f156[_0xc8c3('0x32')][_0xc8c3('0x1d')]);}_0x790073[_0xc8c3('0x39')]=qs['sort'](_0x51f156[_0xc8c3('0x32')][_0xc8c3('0x3a')]);_0x790073['where']=qs[_0xc8c3('0x34')](_[_0xc8c3('0x3b')](_0x51f156[_0xc8c3('0x32')],_0x452f55[_0xc8c3('0x34')]),_0x306c0d);if(_0x51f156[_0xc8c3('0x32')][_0xc8c3('0x3c')]){_0x790073[_0xc8c3('0x3d')]=_['merge'](_0x790073['where'],{'$or':_[_0xc8c3('0x31')](_0x306c0d,function(_0x5647c6){if(_0x5647c6[_0xc8c3('0x2e')]!==_0xc8c3('0x3e')){var _0x28ea9c={};_0x28ea9c[_0x5647c6[_0xc8c3('0x2a')]]={'$like':'%'+_0x51f156[_0xc8c3('0x32')][_0xc8c3('0x3c')]+'%'};return _0x28ea9c;}})});}_0x790073=_[_0xc8c3('0x3f')]({},_0x790073,_0x51f156[_0xc8c3('0x40')]);var _0x2f1456={'where':_0x790073[_0xc8c3('0x3d')]};return db[_0xc8c3('0x41')]['count'](_0x2f1456)[_0xc8c3('0x26')](function(_0x3e022c){_0x1f7c2b[_0xc8c3('0x20')]=_0x3e022c;if(_0x51f156[_0xc8c3('0x32')][_0xc8c3('0x42')]){_0x790073[_0xc8c3('0x43')]=[{'all':!![]}];}return db[_0xc8c3('0x41')][_0xc8c3('0x44')](_0x790073);})[_0xc8c3('0x26')](function(_0x222014){_0x1f7c2b['rows']=_0x222014;return _0x1f7c2b;})[_0xc8c3('0x26')](respondWithFilteredResult(_0x1b7ccb,_0x790073))[_0xc8c3('0x45')](handleError(_0x1b7ccb,null));};exports[_0xc8c3('0x46')]=function(_0x124b38,_0x35c92d){var _0x1d6a7c={'raw':!![],'where':{'id':_0x124b38[_0xc8c3('0x47')]['id']}},_0x5f31a9={};_0x5f31a9[_0xc8c3('0x30')]=_['keys'](db[_0xc8c3('0x41')][_0xc8c3('0x48')]);_0x5f31a9[_0xc8c3('0x32')]=_['keys'](_0x124b38[_0xc8c3('0x32')]);_0x5f31a9[_0xc8c3('0x34')]=_['intersection'](_0x5f31a9[_0xc8c3('0x30')],_0x5f31a9[_0xc8c3('0x32')]);_0x1d6a7c[_0xc8c3('0x38')]=_[_0xc8c3('0x35')](_0x5f31a9[_0xc8c3('0x30')],qs[_0xc8c3('0x36')](_0x124b38['query'][_0xc8c3('0x36')]));_0x1d6a7c[_0xc8c3('0x38')]=_0x1d6a7c[_0xc8c3('0x38')][_0xc8c3('0x37')]?_0x1d6a7c['attributes']:_0x5f31a9[_0xc8c3('0x30')];if(_0x124b38['query'][_0xc8c3('0x42')]){_0x1d6a7c['include']=[{'all':!![]}];}_0x1d6a7c=_[_0xc8c3('0x3f')]({},_0x1d6a7c,_0x124b38[_0xc8c3('0x40')]);return db[_0xc8c3('0x41')]['find'](_0x1d6a7c)[_0xc8c3('0x26')](handleEntityNotFound(_0x35c92d,null))[_0xc8c3('0x26')](respondWithResult(_0x35c92d,null))[_0xc8c3('0x45')](handleError(_0x35c92d,null));};exports[_0xc8c3('0x49')]=function(_0x243d8f,_0x13a11d){return db[_0xc8c3('0x41')][_0xc8c3('0x49')](_0x243d8f[_0xc8c3('0x4a')],{})[_0xc8c3('0x26')](respondWithResult(_0x13a11d,0xc9))[_0xc8c3('0x45')](handleError(_0x13a11d,null));};exports['update']=function(_0x35f9d1,_0x1e46aa){if(_0x35f9d1[_0xc8c3('0x4a')]['id']){delete _0x35f9d1[_0xc8c3('0x4a')]['id'];}return db[_0xc8c3('0x41')][_0xc8c3('0x4b')]({'where':{'id':_0x35f9d1['params']['id']}})['then'](handleEntityNotFound(_0x1e46aa,null))['then'](saveUpdates(_0x35f9d1[_0xc8c3('0x4a')],null))[_0xc8c3('0x26')](respondWithResult(_0x1e46aa,null))['catch'](handleError(_0x1e46aa,null));};exports[_0xc8c3('0x27')]=function(_0x24c36d,_0x384407){return db[_0xc8c3('0x41')][_0xc8c3('0x4b')]({'where':{'id':_0x24c36d[_0xc8c3('0x47')]['id']}})[_0xc8c3('0x26')](handleEntityNotFound(_0x384407,null))[_0xc8c3('0x26')](removeEntity(_0x384407,null))[_0xc8c3('0x45')](handleError(_0x384407,null));}; \ No newline at end of file +var _0x63db=['Content-Range','apply','reject','save','then','sendStatus','stack','name','send','index','map','ZohoField','rawAttributes','type','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','find','create','update','body','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set'];(function(_0x138d37,_0x514419){var _0x48a759=function(_0xe19161){while(--_0xe19161){_0x138d37['push'](_0x138d37['shift']());}};_0x48a759(++_0x514419);}(_0x63db,0x117));var _0xb63d=function(_0x299f1b,_0x3e1066){_0x299f1b=_0x299f1b-0x0;var _0x28b99b=_0x63db[_0x299f1b];return _0x28b99b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb63d('0x0'));var zipdir=require(_0xb63d('0x1'));var jsonpatch=require(_0xb63d('0x2'));var rp=require(_0xb63d('0x3'));var moment=require(_0xb63d('0x4'));var BPromise=require(_0xb63d('0x5'));var Mustache=require(_0xb63d('0x6'));var util=require(_0xb63d('0x7'));var path=require(_0xb63d('0x8'));var sox=require(_0xb63d('0x9'));var csv=require(_0xb63d('0xa'));var ejs=require(_0xb63d('0xb'));var fs=require('fs');var fs_extra=require(_0xb63d('0xc'));var _=require(_0xb63d('0xd'));var squel=require(_0xb63d('0xe'));var crypto=require(_0xb63d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xb63d('0x10'));var toCsv=require(_0xb63d('0xa'));var querystring=require(_0xb63d('0x11'));var Papa=require(_0xb63d('0x12'));var Redis=require(_0xb63d('0x13'));var authService=require(_0xb63d('0x14'));var qs=require(_0xb63d('0x15'));var as=require(_0xb63d('0x16'));var hardwareService=require(_0xb63d('0x17'));var logger=require(_0xb63d('0x18'))(_0xb63d('0x19'));var utils=require(_0xb63d('0x1a'));var config=require(_0xb63d('0x1b'));var licenseUtil=require(_0xb63d('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ef7b0,_0x409fb0){_0x409fb0=_0x409fb0||0xcc;return function(_0x1f990e){if(_0x1f990e){return _0x4ef7b0['sendStatus'](_0x409fb0);}return _0x4ef7b0[_0xb63d('0x1d')](_0x409fb0)[_0xb63d('0x1e')]();};}function respondWithResult(_0x57758f,_0x522102){_0x522102=_0x522102||0xc8;return function(_0x27d8df){if(_0x27d8df){return _0x57758f[_0xb63d('0x1d')](_0x522102)[_0xb63d('0x1f')](_0x27d8df);}};}function respondWithFilteredResult(_0x88cc71,_0x4402a4){return function(_0x4a7b32){if(_0x4a7b32){var _0x30bd42=typeof _0x4402a4[_0xb63d('0x20')]===_0xb63d('0x21')&&typeof _0x4402a4['limit']===_0xb63d('0x21');var _0x4347af=_0x4a7b32[_0xb63d('0x22')];var _0x5685f4=_0x30bd42?0x0:_0x4402a4['offset'];var _0x22fdbf=_0x30bd42?_0x4a7b32[_0xb63d('0x22')]:_0x4402a4[_0xb63d('0x20')]+_0x4402a4[_0xb63d('0x23')];var _0x2df156;if(_0x22fdbf>=_0x4347af){_0x22fdbf=_0x4347af;_0x2df156=0xc8;}else{_0x2df156=0xce;}_0x88cc71[_0xb63d('0x1d')](_0x2df156);return _0x88cc71[_0xb63d('0x24')](_0xb63d('0x25'),_0x5685f4+'-'+_0x22fdbf+'/'+_0x4347af)[_0xb63d('0x1f')](_0x4a7b32);}return null;};}function patchUpdates(_0x40740a){return function(_0x1e0651){try{jsonpatch[_0xb63d('0x26')](_0x1e0651,_0x40740a,!![]);}catch(_0x2bd7be){return BPromise[_0xb63d('0x27')](_0x2bd7be);}return _0x1e0651[_0xb63d('0x28')]();};}function saveUpdates(_0x328b96,_0x226f04){return function(_0x52eec3){if(_0x52eec3){return _0x52eec3['update'](_0x328b96)['then'](function(_0x5b854e){return _0x5b854e;});}return null;};}function removeEntity(_0x432c2c,_0x29f7e8){return function(_0x1a8d6e){if(_0x1a8d6e){return _0x1a8d6e['destroy']()[_0xb63d('0x29')](function(){_0x432c2c[_0xb63d('0x1d')](0xcc)[_0xb63d('0x1e')]();});}};}function handleEntityNotFound(_0x2180de,_0x5c687d){return function(_0x1783bd){if(!_0x1783bd){_0x2180de[_0xb63d('0x2a')](0x194);}return _0x1783bd;};}function handleError(_0x14b8c1,_0x26138c){_0x26138c=_0x26138c||0x1f4;return function(_0x3dcc71){logger['error'](_0x3dcc71[_0xb63d('0x2b')]);if(_0x3dcc71[_0xb63d('0x2c')]){delete _0x3dcc71[_0xb63d('0x2c')];}_0x14b8c1[_0xb63d('0x1d')](_0x26138c)[_0xb63d('0x2d')](_0x3dcc71);};}exports[_0xb63d('0x2e')]=function(_0xe47680,_0x234941){var _0x24db5d={},_0x49c939={},_0x4f2631={'count':0x0,'rows':[]};var _0x238585=_[_0xb63d('0x2f')](db[_0xb63d('0x30')][_0xb63d('0x31')],function(_0x5647cd){return{'name':_0x5647cd['fieldName'],'type':_0x5647cd[_0xb63d('0x32')]['key']};});_0x49c939['model']=_['map'](_0x238585,_0xb63d('0x2c'));_0x49c939[_0xb63d('0x33')]=_[_0xb63d('0x34')](_0xe47680[_0xb63d('0x33')]);_0x49c939['filters']=_[_0xb63d('0x35')](_0x49c939[_0xb63d('0x36')],_0x49c939['query']);_0x24db5d['attributes']=_[_0xb63d('0x35')](_0x49c939[_0xb63d('0x36')],qs[_0xb63d('0x37')](_0xe47680[_0xb63d('0x33')][_0xb63d('0x37')]));_0x24db5d['attributes']=_0x24db5d[_0xb63d('0x38')][_0xb63d('0x39')]?_0x24db5d[_0xb63d('0x38')]:_0x49c939['model'];if(!_0xe47680['query']['hasOwnProperty'](_0xb63d('0x3a'))){_0x24db5d[_0xb63d('0x23')]=qs[_0xb63d('0x23')](_0xe47680[_0xb63d('0x33')][_0xb63d('0x23')]);_0x24db5d[_0xb63d('0x20')]=qs[_0xb63d('0x20')](_0xe47680[_0xb63d('0x33')]['offset']);}_0x24db5d[_0xb63d('0x3b')]=qs['sort'](_0xe47680['query'][_0xb63d('0x3c')]);_0x24db5d[_0xb63d('0x3d')]=qs['filters'](_[_0xb63d('0x3e')](_0xe47680[_0xb63d('0x33')],_0x49c939[_0xb63d('0x3f')]),_0x238585);if(_0xe47680['query']['filter']){_0x24db5d[_0xb63d('0x3d')]=_[_0xb63d('0x40')](_0x24db5d['where'],{'$or':_[_0xb63d('0x2f')](_0x238585,function(_0x5025a4){if(_0x5025a4[_0xb63d('0x32')]!==_0xb63d('0x41')){var _0x468989={};_0x468989[_0x5025a4[_0xb63d('0x2c')]]={'$like':'%'+_0xe47680[_0xb63d('0x33')][_0xb63d('0x42')]+'%'};return _0x468989;}})});}_0x24db5d=_['merge']({},_0x24db5d,_0xe47680[_0xb63d('0x43')]);var _0x518ace={'where':_0x24db5d[_0xb63d('0x3d')]};return db['ZohoField'][_0xb63d('0x22')](_0x518ace)[_0xb63d('0x29')](function(_0xc439de){_0x4f2631[_0xb63d('0x22')]=_0xc439de;if(_0xe47680[_0xb63d('0x33')][_0xb63d('0x44')]){_0x24db5d[_0xb63d('0x45')]=[{'all':!![]}];}return db['ZohoField'][_0xb63d('0x46')](_0x24db5d);})[_0xb63d('0x29')](function(_0x31bf42){_0x4f2631['rows']=_0x31bf42;return _0x4f2631;})['then'](respondWithFilteredResult(_0x234941,_0x24db5d))[_0xb63d('0x47')](handleError(_0x234941,null));};exports[_0xb63d('0x48')]=function(_0x2e6f55,_0x261bbc){var _0x1efefe={'raw':!![],'where':{'id':_0x2e6f55['params']['id']}},_0x335bf0={};_0x335bf0[_0xb63d('0x36')]=_['keys'](db['ZohoField'][_0xb63d('0x31')]);_0x335bf0[_0xb63d('0x33')]=_[_0xb63d('0x34')](_0x2e6f55['query']);_0x335bf0[_0xb63d('0x3f')]=_[_0xb63d('0x35')](_0x335bf0[_0xb63d('0x36')],_0x335bf0[_0xb63d('0x33')]);_0x1efefe[_0xb63d('0x38')]=_[_0xb63d('0x35')](_0x335bf0[_0xb63d('0x36')],qs[_0xb63d('0x37')](_0x2e6f55[_0xb63d('0x33')][_0xb63d('0x37')]));_0x1efefe[_0xb63d('0x38')]=_0x1efefe['attributes'][_0xb63d('0x39')]?_0x1efefe[_0xb63d('0x38')]:_0x335bf0['model'];if(_0x2e6f55['query'][_0xb63d('0x44')]){_0x1efefe['include']=[{'all':!![]}];}_0x1efefe=_[_0xb63d('0x40')]({},_0x1efefe,_0x2e6f55[_0xb63d('0x43')]);return db[_0xb63d('0x30')][_0xb63d('0x49')](_0x1efefe)[_0xb63d('0x29')](handleEntityNotFound(_0x261bbc,null))[_0xb63d('0x29')](respondWithResult(_0x261bbc,null))[_0xb63d('0x47')](handleError(_0x261bbc,null));};exports[_0xb63d('0x4a')]=function(_0x3683a5,_0x28a50e){return db['ZohoField'][_0xb63d('0x4a')](_0x3683a5['body'],{})[_0xb63d('0x29')](respondWithResult(_0x28a50e,0xc9))[_0xb63d('0x47')](handleError(_0x28a50e,null));};exports[_0xb63d('0x4b')]=function(_0x35eea6,_0x2bed97){if(_0x35eea6[_0xb63d('0x4c')]['id']){delete _0x35eea6['body']['id'];}return db[_0xb63d('0x30')][_0xb63d('0x49')]({'where':{'id':_0x35eea6[_0xb63d('0x4d')]['id']}})[_0xb63d('0x29')](handleEntityNotFound(_0x2bed97,null))['then'](saveUpdates(_0x35eea6[_0xb63d('0x4c')],null))['then'](respondWithResult(_0x2bed97,null))[_0xb63d('0x47')](handleError(_0x2bed97,null));};exports[_0xb63d('0x4e')]=function(_0x3b03ef,_0x3c67ea){return db[_0xb63d('0x30')][_0xb63d('0x49')]({'where':{'id':_0x3b03ef[_0xb63d('0x4d')]['id']}})[_0xb63d('0x29')](handleEntityNotFound(_0x3c67ea,null))[_0xb63d('0x29')](removeEntity(_0x3c67ea,null))[_0xb63d('0x47')](handleError(_0x3c67ea,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index a9b9422..57aaccc 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 _0x2a07=['api','moment','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x1cfe2e,_0x1ebbcd){var _0x39233f=function(_0x48831a){while(--_0x48831a){_0x1cfe2e['push'](_0x1cfe2e['shift']());}};_0x39233f(++_0x1ebbcd);}(_0x2a07,0x74));var _0x72a0=function(_0x4186fa,_0x26a01c){_0x4186fa=_0x4186fa-0x0;var _0x136990=_0x2a07[_0x4186fa];return _0x136990;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xf'),_0x72a0('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x82c4=['moment','bluebird','request-promise','rimraf','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x262cc7,_0x30086b){var _0xa7faba=function(_0x2670bf){while(--_0x2670bf){_0x262cc7['push'](_0x262cc7['shift']());}};_0xa7faba(++_0x30086b);}(_0x82c4,0x1ca));var _0x482c=function(_0x37bbfc,_0x4ce4a4){_0x37bbfc=_0x37bbfc-0x0;var _0x2a127c=_0x82c4[_0x37bbfc];return _0x2a127c;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));module['exports']=function(_0x477cf4,_0x5d7c76){return _0x477cf4[_0x482c('0x9')](_0x482c('0xa'),attributes,{'tableName':_0x482c('0xb'),'paranoid':![],'indexes':[{'name':_0x482c('0xc'),'fields':[_0x482c('0xd'),'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 804c1d9..dd08ed7 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 _0x5a25=['ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x4100c0,_0x5289f2){var _0x4df2bc=function(_0x1aaf2d){while(--_0x1aaf2d){_0x4100c0['push'](_0x4100c0['shift']());}};_0x4df2bc(++_0x5289f2);}(_0x5a25,0x159));var _0x55a2=function(_0x55738f,_0x595b6f){_0x55738f=_0x55738f-0x0;var _0x5f40b8=_0x5a25[_0x55738f];return _0x5f40b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x55a2('0x0'));var rs=require(_0x55a2('0x1'));var fs=require('fs');var Redis=require(_0x55a2('0x2'));var db=require(_0x55a2('0x3'))['db'];var utils=require(_0x55a2('0x4'));var logger=require(_0x55a2('0x5'))('rpc');var config=require(_0x55a2('0x6'));var jayson=require(_0x55a2('0x7'));var client=jayson[_0x55a2('0x8')][_0x55a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c5b74,_0x315d67,_0x4de682){return new BPromise(function(_0x158911,_0x13871c){return client['request'](_0x4c5b74,_0x4de682)[_0x55a2('0xa')](function(_0x5333f1){logger[_0x55a2('0xb')](_0x55a2('0xc'),_0x315d67,_0x55a2('0xd'));logger[_0x55a2('0xe')](_0x55a2('0xf'),_0x315d67,_0x55a2('0xd'),JSON[_0x55a2('0x10')](_0x5333f1));if(_0x5333f1['error']){if(_0x5333f1['error'][_0x55a2('0x11')]===0x1f4){logger[_0x55a2('0x12')](_0x55a2('0xc'),_0x315d67,_0x5333f1[_0x55a2('0x12')][_0x55a2('0x13')]);return _0x13871c(_0x5333f1['error'][_0x55a2('0x13')]);}logger[_0x55a2('0x12')](_0x55a2('0xc'),_0x315d67,_0x5333f1['error']['message']);return _0x158911(_0x5333f1['error'][_0x55a2('0x13')]);}else{logger['info'](_0x55a2('0xc'),_0x315d67,_0x55a2('0xd'));_0x158911(_0x5333f1[_0x55a2('0x14')][_0x55a2('0x13')]);}})['catch'](function(_0x5ce8ca){logger[_0x55a2('0x12')](_0x55a2('0xc'),_0x315d67,_0x5ce8ca);_0x13871c(_0x5ce8ca);});});} \ No newline at end of file +var _0x45af=['request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','ZohoField,\x20%s,\x20%s'];(function(_0x133f76,_0x4f860a){var _0x492764=function(_0x56f989){while(--_0x56f989){_0x133f76['push'](_0x133f76['shift']());}};_0x492764(++_0x4f860a);}(_0x45af,0x81));var _0xf45a=function(_0x14cc74,_0x599f57){_0x14cc74=_0x14cc74-0x0;var _0x534e2a=_0x45af[_0x14cc74];return _0x534e2a;};'use strict';var _=require(_0xf45a('0x0'));var util=require(_0xf45a('0x1'));var moment=require(_0xf45a('0x2'));var BPromise=require(_0xf45a('0x3'));var rs=require(_0xf45a('0x4'));var fs=require('fs');var Redis=require(_0xf45a('0x5'));var db=require(_0xf45a('0x6'))['db'];var utils=require(_0xf45a('0x7'));var logger=require('../../config/logger')(_0xf45a('0x8'));var config=require(_0xf45a('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf45a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b2538,_0x4b4265,_0xe5cfb1){return new BPromise(function(_0x38f17f,_0x600fcd){return client[_0xf45a('0xb')](_0x3b2538,_0xe5cfb1)[_0xf45a('0xc')](function(_0x42a670){logger[_0xf45a('0xd')](_0xf45a('0xe'),_0x4b4265,_0xf45a('0xf'));logger[_0xf45a('0x10')](_0xf45a('0x11'),_0x4b4265,'request\x20sent',JSON[_0xf45a('0x12')](_0x42a670));if(_0x42a670[_0xf45a('0x13')]){if(_0x42a670[_0xf45a('0x13')][_0xf45a('0x14')]===0x1f4){logger[_0xf45a('0x13')](_0xf45a('0xe'),_0x4b4265,_0x42a670[_0xf45a('0x13')][_0xf45a('0x15')]);return _0x600fcd(_0x42a670['error'][_0xf45a('0x15')]);}logger['error']('ZohoField,\x20%s,\x20%s',_0x4b4265,_0x42a670[_0xf45a('0x13')][_0xf45a('0x15')]);return _0x38f17f(_0x42a670[_0xf45a('0x13')][_0xf45a('0x15')]);}else{logger[_0xf45a('0xd')](_0xf45a('0xe'),_0x4b4265,'request\x20sent');_0x38f17f(_0x42a670[_0xf45a('0x16')][_0xf45a('0x15')]);}})[_0xf45a('0x17')](function(_0x4f5798){logger[_0xf45a('0x13')]('ZohoField,\x20%s,\x20%s',_0x4b4265,_0x4f5798);_0x600fcd(_0x4f5798);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 7e4bfd5..53ca5df 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(_0xe93671,_0x4f4700){var _0x1af5f9=function(_0x360249){while(--_0x360249){_0xe93671['push'](_0xe93671['shift']());}};_0x1af5f9(++_0x4f4700);}(_0xedd9,0xfc));var _0x9edd=function(_0x11f12c,_0x1a2d09){_0x11f12c=_0x11f12c-0x0;var _0x1400eb=_0xedd9[_0x11f12c];return _0x1400eb;};'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(_0x261bb5,_0x10ff69){var _0x120c3b=function(_0x44a2ab){while(--_0x44a2ab){_0x261bb5['push'](_0x261bb5['shift']());}};_0x120c3b(++_0x10ff69);}(_0xe706,0xa3));var _0x6e70=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0xe706[_0x14a0a0];return _0x56b651;};'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 f07e83a..3e133c3 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 _0xea75=['state','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x43d42a,_0x18a244){var _0x690e67=function(_0x58045c){while(--_0x58045c){_0x43d42a['push'](_0x43d42a['shift']());}};_0x690e67(++_0x18a244);}(_0xea75,0xe5));var _0x5ea7=function(_0x946a14,_0x3e466f){_0x946a14=_0x946a14-0x0;var _0x5d02d7=_0xea75[_0x946a14];return _0x5d02d7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5ea7('0x0')],'allowNull':![],'unique':_0x5ea7('0x1')},'version':{'type':Sequelize[_0x5ea7('0x0')],'allowNull':![],'unique':_0x5ea7('0x1')},'main':{'type':Sequelize[_0x5ea7('0x0')],'defaultValue':_0x5ea7('0x2')},'filename':{'type':Sequelize[_0x5ea7('0x0')]},'path':{'type':Sequelize[_0x5ea7('0x0')]},'type':{'type':Sequelize[_0x5ea7('0x0')]},'size':{'type':Sequelize[_0x5ea7('0x3')]},'active':{'type':Sequelize[_0x5ea7('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x5ea7('0x0')]},'logo':{'type':Sequelize[_0x5ea7('0x0')]},'state':{'type':Sequelize[_0x5ea7('0x0')],'unique':_0x5ea7('0x5')},'description':{'type':Sequelize[_0x5ea7('0x0')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5ea7('0x0')]},'link':{'type':Sequelize[_0x5ea7('0x0')],'defaultValue':'#'}}; \ No newline at end of file +var _0xcb06=['INTEGER','BOOLEAN','state','sequelize','unique_name_and_version','STRING','app.js'];(function(_0x2008bd,_0x252aa3){var _0x2f6329=function(_0x4be024){while(--_0x4be024){_0x2008bd['push'](_0x2008bd['shift']());}};_0x2f6329(++_0x252aa3);}(_0xcb06,0x145));var _0x6cb0=function(_0x4fe993,_0x3c4b7b){_0x4fe993=_0x4fe993-0x0;var _0x3d5be6=_0xcb06[_0x4fe993];return _0x3d5be6;};'use strict';var Sequelize=require(_0x6cb0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6cb0('0x1')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6cb0('0x1')},'main':{'type':Sequelize[_0x6cb0('0x2')],'defaultValue':_0x6cb0('0x3')},'filename':{'type':Sequelize[_0x6cb0('0x2')]},'path':{'type':Sequelize[_0x6cb0('0x2')]},'type':{'type':Sequelize[_0x6cb0('0x2')]},'size':{'type':Sequelize[_0x6cb0('0x4')]},'active':{'type':Sequelize[_0x6cb0('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x6cb0('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x6cb0('0x2')],'unique':_0x6cb0('0x6')},'description':{'type':Sequelize[_0x6cb0('0x2')]},'title':{'type':Sequelize[_0x6cb0('0x2')]},'remoteUri':{'type':Sequelize[_0x6cb0('0x2')]},'link':{'type':Sequelize[_0x6cb0('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 7e5b160..c010629 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 _0x5496=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../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','Integration','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','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x5496,0x175));var _0x6549=function(_0x4f5ad7,_0x55f019){_0x4f5ad7=_0x4f5ad7-0x0;var _0x365c5b=_0x5496[_0x4f5ad7];return _0x365c5b;};'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['Integration'][_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));}; \ No newline at end of file +var _0x4819=['bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','Integration','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','catch','show','keys','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4819,0xcd));var _0x9481=function(_0x40edbb,_0x4b8e85){_0x40edbb=_0x40edbb-0x0;var _0x1c34e1=_0x4819[_0x40edbb];return _0x1c34e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];function respondWithStatusCode(_0xed8e9,_0x499b87){_0x499b87=_0x499b87||0xcc;return function(_0x5aac02){if(_0x5aac02){return _0xed8e9[_0x9481('0x1a')](_0x499b87);}return _0xed8e9[_0x9481('0x1b')](_0x499b87)[_0x9481('0x1c')]();};}function respondWithResult(_0x28fcb6,_0x3d23c2){_0x3d23c2=_0x3d23c2||0xc8;return function(_0xc7a0b5){if(_0xc7a0b5){return _0x28fcb6[_0x9481('0x1b')](_0x3d23c2)['json'](_0xc7a0b5);}};}function respondWithFilteredResult(_0x4220f1,_0x7a7ee){return function(_0x5b1fe6){if(_0x5b1fe6){var _0x2266d5=typeof _0x7a7ee['offset']===_0x9481('0x1d')&&typeof _0x7a7ee[_0x9481('0x1e')]===_0x9481('0x1d');var _0x2bb2a4=_0x5b1fe6['count'];var _0x5eda66=_0x2266d5?0x0:_0x7a7ee[_0x9481('0x1f')];var _0x50a559=_0x2266d5?_0x5b1fe6['count']:_0x7a7ee[_0x9481('0x1f')]+_0x7a7ee[_0x9481('0x1e')];var _0x18c6f5;if(_0x50a559>=_0x2bb2a4){_0x50a559=_0x2bb2a4;_0x18c6f5=0xc8;}else{_0x18c6f5=0xce;}_0x4220f1[_0x9481('0x1b')](_0x18c6f5);return _0x4220f1[_0x9481('0x20')](_0x9481('0x21'),_0x5eda66+'-'+_0x50a559+'/'+_0x2bb2a4)['json'](_0x5b1fe6);}return null;};}function patchUpdates(_0x2cf1aa){return function(_0x272a84){try{jsonpatch[_0x9481('0x22')](_0x272a84,_0x2cf1aa,!![]);}catch(_0x615e02){return BPromise[_0x9481('0x23')](_0x615e02);}return _0x272a84['save']();};}function saveUpdates(_0x215dd7,_0x294908){return function(_0x572599){if(_0x572599){return _0x572599[_0x9481('0x24')](_0x215dd7)[_0x9481('0x25')](function(_0x352b3a){return _0x352b3a;});}return null;};}function removeEntity(_0x1809d2,_0x2dc02e){return function(_0x49ecfa){if(_0x49ecfa){return _0x49ecfa[_0x9481('0x26')]()[_0x9481('0x25')](function(){_0x1809d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b0c3,_0x299e28){return function(_0x550fce){if(!_0x550fce){_0x12b0c3[_0x9481('0x1a')](0x194);}return _0x550fce;};}function handleError(_0x20ff9a,_0xeff0a5){_0xeff0a5=_0xeff0a5||0x1f4;return function(_0x28ae1b){logger['error'](_0x28ae1b[_0x9481('0x27')]);if(_0x28ae1b[_0x9481('0x28')]){delete _0x28ae1b[_0x9481('0x28')];}_0x20ff9a['status'](_0xeff0a5)[_0x9481('0x29')](_0x28ae1b);};}exports['index']=function(_0x2e1eff,_0xe153ab){var _0x22ab26={},_0x13ef93={},_0x2e5e63={'count':0x0,'rows':[]};var _0x53560d=_[_0x9481('0x2a')](db[_0x9481('0x2b')][_0x9481('0x2c')],function(_0x4895a0){return{'name':_0x4895a0['fieldName'],'type':_0x4895a0[_0x9481('0x2d')][_0x9481('0x2e')]};});_0x13ef93[_0x9481('0x2f')]=_[_0x9481('0x2a')](_0x53560d,'name');_0x13ef93['query']=_['keys'](_0x2e1eff[_0x9481('0x30')]);_0x13ef93['filters']=_[_0x9481('0x31')](_0x13ef93['model'],_0x13ef93[_0x9481('0x30')]);_0x22ab26[_0x9481('0x32')]=_[_0x9481('0x31')](_0x13ef93[_0x9481('0x2f')],qs[_0x9481('0x33')](_0x2e1eff['query'][_0x9481('0x33')]));_0x22ab26[_0x9481('0x32')]=_0x22ab26[_0x9481('0x32')]['length']?_0x22ab26[_0x9481('0x32')]:_0x13ef93[_0x9481('0x2f')];if(!_0x2e1eff[_0x9481('0x30')][_0x9481('0x34')](_0x9481('0x35'))){_0x22ab26[_0x9481('0x1e')]=qs['limit'](_0x2e1eff[_0x9481('0x30')]['limit']);_0x22ab26[_0x9481('0x1f')]=qs[_0x9481('0x1f')](_0x2e1eff[_0x9481('0x30')][_0x9481('0x1f')]);}_0x22ab26[_0x9481('0x36')]=qs[_0x9481('0x37')](_0x2e1eff['query'][_0x9481('0x37')]);_0x22ab26[_0x9481('0x38')]=qs['filters'](_['pick'](_0x2e1eff[_0x9481('0x30')],_0x13ef93['filters']),_0x53560d);if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]){_0x22ab26[_0x9481('0x38')]=_[_0x9481('0x3a')](_0x22ab26['where'],{'$or':_[_0x9481('0x2a')](_0x53560d,function(_0x590d50){if(_0x590d50[_0x9481('0x2d')]!=='VIRTUAL'){var _0x2ce972={};_0x2ce972[_0x590d50['name']]={'$like':'%'+_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]+'%'};return _0x2ce972;}})});}_0x22ab26=_[_0x9481('0x3a')]({},_0x22ab26,_0x2e1eff[_0x9481('0x3b')]);var _0x97dc3e={'where':_0x22ab26[_0x9481('0x38')]};return db[_0x9481('0x2b')]['count'](_0x97dc3e)[_0x9481('0x25')](function(_0x3857e8){_0x2e5e63[_0x9481('0x3c')]=_0x3857e8;if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x3d')]){_0x22ab26[_0x9481('0x3e')]=[{'all':!![]}];}return db[_0x9481('0x2b')]['findAll'](_0x22ab26);})[_0x9481('0x25')](function(_0x1872ff){_0x2e5e63['rows']=_0x1872ff;return _0x2e5e63;})[_0x9481('0x25')](respondWithFilteredResult(_0xe153ab,_0x22ab26))[_0x9481('0x3f')](handleError(_0xe153ab,null));};exports[_0x9481('0x40')]=function(_0x3eb9ee,_0x29a8e9){var _0x5a8ffd={'raw':![],'where':{'id':_0x3eb9ee['params']['id']}},_0x304791={};_0x304791[_0x9481('0x2f')]=_[_0x9481('0x41')](db['Integration']['rawAttributes']);_0x304791[_0x9481('0x30')]=_[_0x9481('0x41')](_0x3eb9ee[_0x9481('0x30')]);_0x304791['filters']=_[_0x9481('0x31')](_0x304791[_0x9481('0x2f')],_0x304791['query']);_0x5a8ffd['attributes']=_[_0x9481('0x31')](_0x304791['model'],qs[_0x9481('0x33')](_0x3eb9ee[_0x9481('0x30')][_0x9481('0x33')]));_0x5a8ffd[_0x9481('0x32')]=_0x5a8ffd[_0x9481('0x32')]['length']?_0x5a8ffd[_0x9481('0x32')]:_0x304791[_0x9481('0x2f')];if(_0x3eb9ee['query'][_0x9481('0x3d')]){_0x5a8ffd[_0x9481('0x3e')]=[{'all':!![]}];}_0x5a8ffd=_[_0x9481('0x3a')]({},_0x5a8ffd,_0x3eb9ee[_0x9481('0x3b')]);return db[_0x9481('0x2b')][_0x9481('0x42')](_0x5a8ffd)[_0x9481('0x25')](handleEntityNotFound(_0x29a8e9,null))[_0x9481('0x25')](respondWithResult(_0x29a8e9,null))[_0x9481('0x3f')](handleError(_0x29a8e9,null));};exports['create']=function(_0xd36133,_0x5d3a06){return db['Integration'][_0x9481('0x43')](_0xd36133['body'],{})[_0x9481('0x25')](respondWithResult(_0x5d3a06,0xc9))[_0x9481('0x3f')](handleError(_0x5d3a06,null));};exports['update']=function(_0x277e2a,_0x1044a2){if(_0x277e2a[_0x9481('0x44')]['id']){delete _0x277e2a[_0x9481('0x44')]['id'];}return db[_0x9481('0x2b')][_0x9481('0x42')]({'where':{'id':_0x277e2a['params']['id']}})['then'](handleEntityNotFound(_0x1044a2,null))[_0x9481('0x25')](saveUpdates(_0x277e2a[_0x9481('0x44')],null))[_0x9481('0x25')](respondWithResult(_0x1044a2,null))[_0x9481('0x3f')](handleError(_0x1044a2,null));};exports[_0x9481('0x26')]=function(_0x353aab,_0x1c070c){return db[_0x9481('0x2b')]['find']({'where':{'id':_0x353aab[_0x9481('0x45')]['id']}})[_0x9481('0x25')](handleEntityNotFound(_0x1c070c,null))[_0x9481('0x25')](removeEntity(_0x1c070c,null))[_0x9481('0x3f')](handleError(_0x1c070c,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 5715bd2..16d454e 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 _0x4e8d=['./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5e82a2,_0x46a18f){var _0x41eb55=function(_0x421558){while(--_0x421558){_0x5e82a2['push'](_0x5e82a2['shift']());}};_0x41eb55(++_0x46a18f);}(_0x4e8d,0x10f));var _0xd4e8=function(_0x494217,_0x499db3){_0x494217=_0x494217-0x0;var _0x2980b4=_0x4e8d[_0x494217];return _0x2980b4;};'use strict';var _=require(_0xd4e8('0x0'));var util=require(_0xd4e8('0x1'));var logger=require(_0xd4e8('0x2'))(_0xd4e8('0x3'));var moment=require(_0xd4e8('0x4'));var BPromise=require(_0xd4e8('0x5'));var rp=require(_0xd4e8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd4e8('0x7'));var config=require(_0xd4e8('0x8'));var attributes=require(_0xd4e8('0x9'));module[_0xd4e8('0xa')]=function(_0x4f85c0,_0x4be705){return _0x4f85c0[_0xd4e8('0xb')](_0xd4e8('0xc'),attributes,{'tableName':_0xd4e8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93b0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Integration','lodash','util','api'];(function(_0x3f65d3,_0x496f9f){var _0x7fbd5b=function(_0xe4d856){while(--_0xe4d856){_0x3f65d3['push'](_0x3f65d3['shift']());}};_0x7fbd5b(++_0x496f9f);}(_0x93b0,0x189));var _0x093b=function(_0x343172,_0xc0c2a1){_0x343172=_0x343172-0x0;var _0x501642=_0x93b0[_0x343172];return _0x501642;};'use strict';var _=require(_0x093b('0x0'));var util=require(_0x093b('0x1'));var logger=require('../../config/logger')(_0x093b('0x2'));var moment=require(_0x093b('0x3'));var BPromise=require(_0x093b('0x4'));var rp=require(_0x093b('0x5'));var fs=require('fs');var path=require(_0x093b('0x6'));var rimraf=require(_0x093b('0x7'));var config=require(_0x093b('0x8'));var attributes=require('./integration.attributes');module[_0x093b('0x9')]=function(_0x16fb5b,_0x1160ee){return _0x16fb5b[_0x093b('0xa')](_0x093b('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index f1c448c..c5ad1c7 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 _0xe2fe=['then','info','Integration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x310d08,_0x52b280){var _0x305029=function(_0x3d9729){while(--_0x3d9729){_0x310d08['push'](_0x310d08['shift']());}};_0x305029(++_0x52b280);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0xd943=['info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x36e2db,_0x7c037c){var _0x312ae1=function(_0x27a100){while(--_0x27a100){_0x36e2db['push'](_0x36e2db['shift']());}};_0x312ae1(++_0x7c037c);}(_0xd943,0x15d));var _0x3d94=function(_0x2adf94,_0x276583){_0x2adf94=_0x2adf94-0x0;var _0x3bcd18=_0xd943[_0x2adf94];return _0x3bcd18;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('Integration,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index d5a44d5..a1f7bd4 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 _0x524e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0x4f6344,_0xfcf32b){var _0x3a7cb3=function(_0x4c76f1){while(--_0x4c76f1){_0x4f6344['push'](_0x4f6344['shift']());}};_0x3a7cb3(++_0xfcf32b);}(_0x524e,0x15e));var _0xe524=function(_0xd4a7ce,_0x249b0d){_0xd4a7ce=_0xd4a7ce-0x0;var _0x1ed22c=_0x524e[_0xd4a7ce];return _0x1ed22c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x10')]('/',auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x12')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x14')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1f0ee7,_0x1fc026){_0x1f0ee7=_0x1f0ee7-0x0;var _0x38766e=_0x5f2f[_0x1f0ee7];return _0x38766e;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index ee5d8e3..ed83154 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 _0x01c9=['TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x181d19,_0x46822d){var _0x227c31=function(_0x6cf3fa){while(--_0x6cf3fa){_0x181d19['push'](_0x181d19['shift']());}};_0x227c31(++_0x46822d);}(_0x01c9,0x170));var _0x901c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x01c9[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x901c('0x0'));module[_0x901c('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x901c('0x2')]},'exitStatus':{'type':Sequelize[_0x901c('0x2')]},'ticketId':{'type':Sequelize[_0x901c('0x2')]},'integrationId':{'type':Sequelize[_0x901c('0x3')]},'contacts':{'type':Sequelize[_0x901c('0x2')]},'uniqueid':{'type':Sequelize[_0x901c('0x2')]},'calleridnum':{'type':Sequelize[_0x901c('0x2')]},'calleridname':{'type':Sequelize[_0x901c('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x901c('0x2')]},'agentcalledAt':{'type':Sequelize[_0x901c('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x901c('0x3')]},'agentcomplete':{'type':Sequelize[_0x901c('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x901c('0x3')]},'agentacw':{'type':Sequelize[_0x901c('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x901c('0x3')]},'reason':{'type':Sequelize[_0x901c('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x901c('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x901c('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x901c('0x4')]},'lastevent':{'type':Sequelize[_0x901c('0x2')]},'channel':{'type':Sequelize[_0x901c('0x2')]},'channelstate':{'type':Sequelize[_0x901c('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x901c('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x901c('0x2')]},'accountcode':{'type':Sequelize[_0x901c('0x2')]},'context':{'type':Sequelize[_0x901c('0x2')]},'exten':{'type':Sequelize[_0x901c('0x2')]},'priority':{'type':Sequelize[_0x901c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x901c('0x2')]},'destcalleridnum':{'type':Sequelize[_0x901c('0x2')]},'destcalleridname':{'type':Sequelize[_0x901c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x901c('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x901c('0x2')]},'destlanguage':{'type':Sequelize[_0x901c('0x2')]},'destaccountcode':{'type':Sequelize[_0x901c('0x2')]},'destcontext':{'type':Sequelize[_0x901c('0x2')]},'destexten':{'type':Sequelize[_0x901c('0x2')]},'destpriority':{'type':Sequelize[_0x901c('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x901c('0x2')]},'inReplyTo':{'type':Sequelize[_0x901c('0x2')]},'subject':{'type':Sequelize[_0x901c('0x2')]},'from':{'type':Sequelize[_0x901c('0x2')]},'to':{'type':Sequelize[_0x901c('0x2')]},'cc':{'type':Sequelize[_0x901c('0x2')]},'attachment':{'type':Sequelize[_0x901c('0x6')]},'html':{'type':Sequelize[_0x901c('0x6')]},'text':{'type':Sequelize[_0x901c('0x6')]},'status':{'type':Sequelize['ENUM'](_0x901c('0x7'),_0x901c('0x8'),_0x901c('0x9'),_0x901c('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x901c('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x2c46=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0x2c46,0xdd));var _0x62c4=function(_0x5cb99c,_0x517687){_0x5cb99c=_0x5cb99c-0x0;var _0x24c9e6=_0x2c46[_0x5cb99c];return _0x24c9e6;};'use strict';var Sequelize=require(_0x62c4('0x0'));module[_0x62c4('0x1')]={'integration':{'type':Sequelize[_0x62c4('0x2')]},'eventChannel':{'type':Sequelize[_0x62c4('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x62c4('0x2')]},'integrationId':{'type':Sequelize[_0x62c4('0x3')]},'contacts':{'type':Sequelize[_0x62c4('0x2')]},'uniqueid':{'type':Sequelize[_0x62c4('0x2')]},'calleridnum':{'type':Sequelize[_0x62c4('0x2')]},'calleridname':{'type':Sequelize[_0x62c4('0x2')]},'queue':{'type':Sequelize[_0x62c4('0x2')]},'interface':{'type':Sequelize[_0x62c4('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x62c4('0x4')]},'agentconnectAt':{'type':Sequelize[_0x62c4('0x4')]},'holdtime':{'type':Sequelize[_0x62c4('0x3')]},'agentcomplete':{'type':Sequelize[_0x62c4('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x62c4('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x62c4('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x62c4('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x62c4('0x4')]},'agentdump':{'type':Sequelize[_0x62c4('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x62c4('0x2')]},'channel':{'type':Sequelize[_0x62c4('0x2')]},'channelstate':{'type':Sequelize[_0x62c4('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x62c4('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x62c4('0x2')]},'accountcode':{'type':Sequelize[_0x62c4('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x62c4('0x2')]},'destchannel':{'type':Sequelize[_0x62c4('0x2')]},'destchannelstate':{'type':Sequelize[_0x62c4('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x62c4('0x2')]},'destcalleridnum':{'type':Sequelize[_0x62c4('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x62c4('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x62c4('0x2')]},'destlanguage':{'type':Sequelize[_0x62c4('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x62c4('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x62c4('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x62c4('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x62c4('0x2')]},'from':{'type':Sequelize[_0x62c4('0x2')]},'to':{'type':Sequelize[_0x62c4('0x2')]},'cc':{'type':Sequelize[_0x62c4('0x2')]},'attachment':{'type':Sequelize[_0x62c4('0x6')]},'html':{'type':Sequelize[_0x62c4('0x6')]},'text':{'type':Sequelize[_0x62c4('0x6')]},'status':{'type':Sequelize[_0x62c4('0x7')](_0x62c4('0x8'),_0x62c4('0x9'),'RECEIVED',_0x62c4('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x62c4('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 0d6b753..7f6b108 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 _0xb5da=['crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','then','destroy','error','stack','name','send','index','IntegrationReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','describe','eml-format','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','squel'];(function(_0x4601a7,_0x5edef5){var _0x87d4fc=function(_0x469dc2){while(--_0x469dc2){_0x4601a7['push'](_0x4601a7['shift']());}};_0x87d4fc(++_0x5edef5);}(_0xb5da,0x1ef));var _0xab5d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xb5da[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xab5d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xab5d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xab5d('0x2'));var Mustache=require(_0xab5d('0x3'));var util=require(_0xab5d('0x4'));var path=require('path');var sox=require(_0xab5d('0x5'));var csv=require(_0xab5d('0x6'));var ejs=require(_0xab5d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xab5d('0x8'));var crypto=require(_0xab5d('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xab5d('0x6'));var querystring=require(_0xab5d('0xa'));var Papa=require(_0xab5d('0xb'));var Redis=require(_0xab5d('0xc'));var authService=require(_0xab5d('0xd'));var qs=require(_0xab5d('0xe'));var as=require(_0xab5d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab5d('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xab5d('0x11'));var licenseUtil=require(_0xab5d('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c29a1,_0x40157f){_0x40157f=_0x40157f||0xcc;return function(_0xa44708){if(_0xa44708){return _0x3c29a1[_0xab5d('0x13')](_0x40157f);}return _0x3c29a1[_0xab5d('0x14')](_0x40157f)[_0xab5d('0x15')]();};}function respondWithResult(_0x21069f,_0x53356c){_0x53356c=_0x53356c||0xc8;return function(_0x1bfcd5){if(_0x1bfcd5){return _0x21069f['status'](_0x53356c)['json'](_0x1bfcd5);}};}function respondWithFilteredResult(_0x1490cd,_0x5aa747){return function(_0x67f49a){if(_0x67f49a){var _0x58dc16=typeof _0x5aa747[_0xab5d('0x16')]===_0xab5d('0x17')&&typeof _0x5aa747[_0xab5d('0x18')]===_0xab5d('0x17');var _0x1c74b9=_0x67f49a[_0xab5d('0x19')];var _0x582901=_0x58dc16?0x0:_0x5aa747[_0xab5d('0x16')];var _0x32e5f7=_0x58dc16?_0x67f49a[_0xab5d('0x19')]:_0x5aa747[_0xab5d('0x16')]+_0x5aa747[_0xab5d('0x18')];var _0x48a28e;if(_0x32e5f7>=_0x1c74b9){_0x32e5f7=_0x1c74b9;_0x48a28e=0xc8;}else{_0x48a28e=0xce;}_0x1490cd[_0xab5d('0x14')](_0x48a28e);return _0x1490cd[_0xab5d('0x1a')](_0xab5d('0x1b'),_0x582901+'-'+_0x32e5f7+'/'+_0x1c74b9)[_0xab5d('0x1c')](_0x67f49a);}return null;};}function patchUpdates(_0x155023){return function(_0x58b291){try{jsonpatch['apply'](_0x58b291,_0x155023,!![]);}catch(_0x562167){return BPromise['reject'](_0x562167);}return _0x58b291[_0xab5d('0x1d')]();};}function saveUpdates(_0x2ee38a,_0x11bc54){return function(_0x162c3c){if(_0x162c3c){return _0x162c3c['update'](_0x2ee38a)[_0xab5d('0x1e')](function(_0x251173){return _0x251173;});}return null;};}function removeEntity(_0x550c9a,_0x69e688){return function(_0x21e719){if(_0x21e719){return _0x21e719[_0xab5d('0x1f')]()[_0xab5d('0x1e')](function(){_0x550c9a[_0xab5d('0x14')](0xcc)[_0xab5d('0x15')]();});}};}function handleEntityNotFound(_0x931824,_0x3d9b5e){return function(_0x8e60ac){if(!_0x8e60ac){_0x931824['sendStatus'](0x194);}return _0x8e60ac;};}function handleError(_0x4cc479,_0x3ddc12){_0x3ddc12=_0x3ddc12||0x1f4;return function(_0x2d3525){logger[_0xab5d('0x20')](_0x2d3525[_0xab5d('0x21')]);if(_0x2d3525[_0xab5d('0x22')]){delete _0x2d3525[_0xab5d('0x22')];}_0x4cc479['status'](_0x3ddc12)[_0xab5d('0x23')](_0x2d3525);};}exports[_0xab5d('0x24')]=function(_0x4c3095,_0x57cacf){var _0x55f1f4={},_0x482e71={},_0x38b02b={'count':0x0,'rows':[]};var _0x2b89ec=_['map'](db[_0xab5d('0x25')][_0xab5d('0x26')],function(_0x598fdb){return{'name':_0x598fdb[_0xab5d('0x27')],'type':_0x598fdb[_0xab5d('0x28')][_0xab5d('0x29')]};});_0x482e71[_0xab5d('0x2a')]=_[_0xab5d('0x2b')](_0x2b89ec,_0xab5d('0x22'));_0x482e71[_0xab5d('0x2c')]=_[_0xab5d('0x2d')](_0x4c3095[_0xab5d('0x2c')]);_0x482e71[_0xab5d('0x2e')]=_[_0xab5d('0x2f')](_0x482e71[_0xab5d('0x2a')],_0x482e71['query']);_0x55f1f4[_0xab5d('0x30')]=_[_0xab5d('0x2f')](_0x482e71[_0xab5d('0x2a')],qs[_0xab5d('0x31')](_0x4c3095[_0xab5d('0x2c')][_0xab5d('0x31')]));_0x55f1f4[_0xab5d('0x30')]=_0x55f1f4[_0xab5d('0x30')][_0xab5d('0x32')]?_0x55f1f4[_0xab5d('0x30')]:_0x482e71['model'];if(!_0x4c3095[_0xab5d('0x2c')][_0xab5d('0x33')](_0xab5d('0x34'))){_0x55f1f4['limit']=qs['limit'](_0x4c3095[_0xab5d('0x2c')][_0xab5d('0x18')]);_0x55f1f4[_0xab5d('0x16')]=qs[_0xab5d('0x16')](_0x4c3095[_0xab5d('0x2c')]['offset']);}_0x55f1f4['order']=qs[_0xab5d('0x35')](_0x4c3095[_0xab5d('0x2c')][_0xab5d('0x35')]);_0x55f1f4[_0xab5d('0x36')]=qs[_0xab5d('0x2e')](_[_0xab5d('0x37')](_0x4c3095[_0xab5d('0x2c')],_0x482e71[_0xab5d('0x2e')]),_0x2b89ec);if(_0x4c3095[_0xab5d('0x2c')][_0xab5d('0x38')]){_0x55f1f4[_0xab5d('0x36')]=_['merge'](_0x55f1f4['where'],{'$or':_['map'](_0x2b89ec,function(_0x1fa60e){if(_0x1fa60e[_0xab5d('0x28')]!==_0xab5d('0x39')){var _0x871a8d={};_0x871a8d[_0x1fa60e[_0xab5d('0x22')]]={'$like':'%'+_0x4c3095[_0xab5d('0x2c')][_0xab5d('0x38')]+'%'};return _0x871a8d;}})});}_0x55f1f4=_[_0xab5d('0x3a')]({},_0x55f1f4,_0x4c3095[_0xab5d('0x3b')]);var _0x530b71={'where':_0x55f1f4[_0xab5d('0x36')]};return db[_0xab5d('0x25')][_0xab5d('0x19')](_0x530b71)[_0xab5d('0x1e')](function(_0x48cede){_0x38b02b[_0xab5d('0x19')]=_0x48cede;if(_0x4c3095[_0xab5d('0x2c')][_0xab5d('0x3c')]){_0x55f1f4[_0xab5d('0x3d')]=[{'all':!![]}];}return db['IntegrationReport'][_0xab5d('0x3e')](_0x55f1f4);})['then'](function(_0x4e2490){_0x38b02b[_0xab5d('0x3f')]=_0x4e2490;return _0x38b02b;})[_0xab5d('0x1e')](respondWithFilteredResult(_0x57cacf,_0x55f1f4))['catch'](handleError(_0x57cacf,null));};exports[_0xab5d('0x40')]=function(_0x342592,_0x2f9332){var _0x2552a8={'raw':![],'where':{'id':_0x342592[_0xab5d('0x41')]['id']}},_0x4a348c={};_0x4a348c['model']=_[_0xab5d('0x2d')](db[_0xab5d('0x25')][_0xab5d('0x26')]);_0x4a348c[_0xab5d('0x2c')]=_[_0xab5d('0x2d')](_0x342592['query']);_0x4a348c[_0xab5d('0x2e')]=_[_0xab5d('0x2f')](_0x4a348c['model'],_0x4a348c[_0xab5d('0x2c')]);_0x2552a8[_0xab5d('0x30')]=_[_0xab5d('0x2f')](_0x4a348c[_0xab5d('0x2a')],qs[_0xab5d('0x31')](_0x342592[_0xab5d('0x2c')][_0xab5d('0x31')]));_0x2552a8['attributes']=_0x2552a8[_0xab5d('0x30')][_0xab5d('0x32')]?_0x2552a8[_0xab5d('0x30')]:_0x4a348c[_0xab5d('0x2a')];if(_0x342592[_0xab5d('0x2c')]['includeAll']){_0x2552a8[_0xab5d('0x3d')]=[{'all':!![]}];}_0x2552a8=_[_0xab5d('0x3a')]({},_0x2552a8,_0x342592[_0xab5d('0x3b')]);return db[_0xab5d('0x25')][_0xab5d('0x42')](_0x2552a8)[_0xab5d('0x1e')](handleEntityNotFound(_0x2f9332,null))[_0xab5d('0x1e')](respondWithResult(_0x2f9332,null))[_0xab5d('0x43')](handleError(_0x2f9332,null));};exports['create']=function(_0x80bcbd,_0x16a680){return db[_0xab5d('0x25')][_0xab5d('0x44')](_0x80bcbd[_0xab5d('0x45')],{})[_0xab5d('0x1e')](respondWithResult(_0x16a680,0xc9))[_0xab5d('0x43')](handleError(_0x16a680,null));};exports[_0xab5d('0x46')]=function(_0x2d57ca,_0x49ec48){if(_0x2d57ca[_0xab5d('0x45')]['id']){delete _0x2d57ca[_0xab5d('0x45')]['id'];}return db[_0xab5d('0x25')][_0xab5d('0x42')]({'where':{'id':_0x2d57ca['params']['id']}})[_0xab5d('0x1e')](handleEntityNotFound(_0x49ec48,null))[_0xab5d('0x1e')](saveUpdates(_0x2d57ca[_0xab5d('0x45')],null))['then'](respondWithResult(_0x49ec48,null))['catch'](handleError(_0x49ec48,null));};exports[_0xab5d('0x1f')]=function(_0x16f484,_0x73549a){return db[_0xab5d('0x25')]['find']({'where':{'id':_0x16f484[_0xab5d('0x41')]['id']}})[_0xab5d('0x1e')](handleEntityNotFound(_0x73549a,null))[_0xab5d('0x1e')](removeEntity(_0x73549a,null))['catch'](handleError(_0x73549a,null));};exports[_0xab5d('0x47')]=function(_0x148cf3,_0x592d52){return db[_0xab5d('0x25')][_0xab5d('0x47')]()[_0xab5d('0x1e')](respondWithResult(_0x592d52,null))['catch'](handleError(_0x592d52,null));}; \ No newline at end of file +var _0xdcc9=['status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','end','error','stack','name','map','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','IntegrationReport','include','catch','show','rawAttributes','length','includeAll','find','create','body','update','params','describe','rimraf','request-promise','moment','bluebird','mustache','path','fs-extra','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5882ca,_0x3be437){var _0x1b0cd2=function(_0x36d2ab){while(--_0x36d2ab){_0x5882ca['push'](_0x5882ca['shift']());}};_0x1b0cd2(++_0x3be437);}(_0xdcc9,0x78));var _0x9dcc=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0xdcc9[_0xdeefbd];return _0x4ff63f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9dcc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9dcc('0x1'));var moment=require(_0x9dcc('0x2'));var BPromise=require(_0x9dcc('0x3'));var Mustache=require(_0x9dcc('0x4'));var util=require('util');var path=require(_0x9dcc('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9dcc('0x6'));var _=require('lodash');var squel=require(_0x9dcc('0x7'));var crypto=require(_0x9dcc('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9dcc('0x9'));var querystring=require(_0x9dcc('0xa'));var Papa=require('papaparse');var Redis=require(_0x9dcc('0xb'));var authService=require(_0x9dcc('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x9dcc('0xd'));var hardwareService=require(_0x9dcc('0xe'));var logger=require(_0x9dcc('0xf'))(_0x9dcc('0x10'));var utils=require(_0x9dcc('0x11'));var config=require(_0x9dcc('0x12'));var licenseUtil=require(_0x9dcc('0x13'));var db=require(_0x9dcc('0x14'))['db'];function respondWithStatusCode(_0x9efb14,_0x47555b){_0x47555b=_0x47555b||0xcc;return function(_0x3c201a){if(_0x3c201a){return _0x9efb14[_0x9dcc('0x15')](_0x47555b);}return _0x9efb14['status'](_0x47555b)['end']();};}function respondWithResult(_0x4facaa,_0x443b17){_0x443b17=_0x443b17||0xc8;return function(_0x2f857f){if(_0x2f857f){return _0x4facaa[_0x9dcc('0x16')](_0x443b17)[_0x9dcc('0x17')](_0x2f857f);}};}function respondWithFilteredResult(_0x585bbf,_0x56c2aa){return function(_0xe15eb0){if(_0xe15eb0){var _0x291520=typeof _0x56c2aa['offset']===_0x9dcc('0x18')&&typeof _0x56c2aa[_0x9dcc('0x19')]===_0x9dcc('0x18');var _0x36353b=_0xe15eb0[_0x9dcc('0x1a')];var _0x226cb5=_0x291520?0x0:_0x56c2aa[_0x9dcc('0x1b')];var _0x5a6315=_0x291520?_0xe15eb0[_0x9dcc('0x1a')]:_0x56c2aa[_0x9dcc('0x1b')]+_0x56c2aa[_0x9dcc('0x19')];var _0xf83dc1;if(_0x5a6315>=_0x36353b){_0x5a6315=_0x36353b;_0xf83dc1=0xc8;}else{_0xf83dc1=0xce;}_0x585bbf[_0x9dcc('0x16')](_0xf83dc1);return _0x585bbf[_0x9dcc('0x1c')](_0x9dcc('0x1d'),_0x226cb5+'-'+_0x5a6315+'/'+_0x36353b)['json'](_0xe15eb0);}return null;};}function patchUpdates(_0x19765a){return function(_0x4e6e8a){try{jsonpatch['apply'](_0x4e6e8a,_0x19765a,!![]);}catch(_0x91e8ec){return BPromise[_0x9dcc('0x1e')](_0x91e8ec);}return _0x4e6e8a[_0x9dcc('0x1f')]();};}function saveUpdates(_0x4f538c,_0x4f4916){return function(_0x3ea9aa){if(_0x3ea9aa){return _0x3ea9aa['update'](_0x4f538c)[_0x9dcc('0x20')](function(_0x5d678c){return _0x5d678c;});}return null;};}function removeEntity(_0x2c03c0,_0x51df0f){return function(_0x404827){if(_0x404827){return _0x404827[_0x9dcc('0x21')]()['then'](function(){_0x2c03c0[_0x9dcc('0x16')](0xcc)[_0x9dcc('0x22')]();});}};}function handleEntityNotFound(_0x5277cd,_0x8dff3d){return function(_0x10fefe){if(!_0x10fefe){_0x5277cd[_0x9dcc('0x15')](0x194);}return _0x10fefe;};}function handleError(_0x3f3106,_0x555cb6){_0x555cb6=_0x555cb6||0x1f4;return function(_0x2d12ae){logger[_0x9dcc('0x23')](_0x2d12ae[_0x9dcc('0x24')]);if(_0x2d12ae[_0x9dcc('0x25')]){delete _0x2d12ae['name'];}_0x3f3106['status'](_0x555cb6)['send'](_0x2d12ae);};}exports['index']=function(_0x35df4f,_0x50703d){var _0x3dc8d0={},_0x436a4a={},_0x51f9f6={'count':0x0,'rows':[]};var _0x41a919=_[_0x9dcc('0x26')](db['IntegrationReport']['rawAttributes'],function(_0x405f05){return{'name':_0x405f05[_0x9dcc('0x27')],'type':_0x405f05['type']['key']};});_0x436a4a[_0x9dcc('0x28')]=_[_0x9dcc('0x26')](_0x41a919,_0x9dcc('0x25'));_0x436a4a[_0x9dcc('0x29')]=_[_0x9dcc('0x2a')](_0x35df4f[_0x9dcc('0x29')]);_0x436a4a[_0x9dcc('0x2b')]=_[_0x9dcc('0x2c')](_0x436a4a[_0x9dcc('0x28')],_0x436a4a[_0x9dcc('0x29')]);_0x3dc8d0[_0x9dcc('0x2d')]=_['intersection'](_0x436a4a[_0x9dcc('0x28')],qs[_0x9dcc('0x2e')](_0x35df4f[_0x9dcc('0x29')][_0x9dcc('0x2e')]));_0x3dc8d0['attributes']=_0x3dc8d0[_0x9dcc('0x2d')]['length']?_0x3dc8d0[_0x9dcc('0x2d')]:_0x436a4a[_0x9dcc('0x28')];if(!_0x35df4f['query'][_0x9dcc('0x2f')](_0x9dcc('0x30'))){_0x3dc8d0['limit']=qs[_0x9dcc('0x19')](_0x35df4f[_0x9dcc('0x29')][_0x9dcc('0x19')]);_0x3dc8d0['offset']=qs[_0x9dcc('0x1b')](_0x35df4f['query']['offset']);}_0x3dc8d0[_0x9dcc('0x31')]=qs[_0x9dcc('0x32')](_0x35df4f[_0x9dcc('0x29')][_0x9dcc('0x32')]);_0x3dc8d0[_0x9dcc('0x33')]=qs['filters'](_[_0x9dcc('0x34')](_0x35df4f['query'],_0x436a4a['filters']),_0x41a919);if(_0x35df4f[_0x9dcc('0x29')]['filter']){_0x3dc8d0[_0x9dcc('0x33')]=_['merge'](_0x3dc8d0['where'],{'$or':_[_0x9dcc('0x26')](_0x41a919,function(_0x4730d1){if(_0x4730d1[_0x9dcc('0x35')]!==_0x9dcc('0x36')){var _0x3a5e9e={};_0x3a5e9e[_0x4730d1[_0x9dcc('0x25')]]={'$like':'%'+_0x35df4f[_0x9dcc('0x29')][_0x9dcc('0x37')]+'%'};return _0x3a5e9e;}})});}_0x3dc8d0=_[_0x9dcc('0x38')]({},_0x3dc8d0,_0x35df4f[_0x9dcc('0x39')]);var _0x95c8b4={'where':_0x3dc8d0[_0x9dcc('0x33')]};return db[_0x9dcc('0x3a')][_0x9dcc('0x1a')](_0x95c8b4)[_0x9dcc('0x20')](function(_0x233477){_0x51f9f6['count']=_0x233477;if(_0x35df4f[_0x9dcc('0x29')]['includeAll']){_0x3dc8d0[_0x9dcc('0x3b')]=[{'all':!![]}];}return db[_0x9dcc('0x3a')]['findAll'](_0x3dc8d0);})['then'](function(_0x1eecd9){_0x51f9f6['rows']=_0x1eecd9;return _0x51f9f6;})[_0x9dcc('0x20')](respondWithFilteredResult(_0x50703d,_0x3dc8d0))[_0x9dcc('0x3c')](handleError(_0x50703d,null));};exports[_0x9dcc('0x3d')]=function(_0x36484e,_0x3e4793){var _0x1a3b7a={'raw':![],'where':{'id':_0x36484e['params']['id']}},_0x388fe3={};_0x388fe3[_0x9dcc('0x28')]=_[_0x9dcc('0x2a')](db[_0x9dcc('0x3a')][_0x9dcc('0x3e')]);_0x388fe3[_0x9dcc('0x29')]=_[_0x9dcc('0x2a')](_0x36484e[_0x9dcc('0x29')]);_0x388fe3[_0x9dcc('0x2b')]=_[_0x9dcc('0x2c')](_0x388fe3[_0x9dcc('0x28')],_0x388fe3['query']);_0x1a3b7a[_0x9dcc('0x2d')]=_[_0x9dcc('0x2c')](_0x388fe3['model'],qs['fields'](_0x36484e[_0x9dcc('0x29')][_0x9dcc('0x2e')]));_0x1a3b7a[_0x9dcc('0x2d')]=_0x1a3b7a['attributes'][_0x9dcc('0x3f')]?_0x1a3b7a[_0x9dcc('0x2d')]:_0x388fe3[_0x9dcc('0x28')];if(_0x36484e[_0x9dcc('0x29')][_0x9dcc('0x40')]){_0x1a3b7a['include']=[{'all':!![]}];}_0x1a3b7a=_[_0x9dcc('0x38')]({},_0x1a3b7a,_0x36484e['options']);return db[_0x9dcc('0x3a')][_0x9dcc('0x41')](_0x1a3b7a)['then'](handleEntityNotFound(_0x3e4793,null))[_0x9dcc('0x20')](respondWithResult(_0x3e4793,null))['catch'](handleError(_0x3e4793,null));};exports[_0x9dcc('0x42')]=function(_0x2854cf,_0x43c9af){return db['IntegrationReport'][_0x9dcc('0x42')](_0x2854cf[_0x9dcc('0x43')],{})[_0x9dcc('0x20')](respondWithResult(_0x43c9af,0xc9))[_0x9dcc('0x3c')](handleError(_0x43c9af,null));};exports[_0x9dcc('0x44')]=function(_0x3fb1d4,_0x3400a8){if(_0x3fb1d4[_0x9dcc('0x43')]['id']){delete _0x3fb1d4[_0x9dcc('0x43')]['id'];}return db[_0x9dcc('0x3a')]['find']({'where':{'id':_0x3fb1d4[_0x9dcc('0x45')]['id']}})['then'](handleEntityNotFound(_0x3400a8,null))[_0x9dcc('0x20')](saveUpdates(_0x3fb1d4['body'],null))['then'](respondWithResult(_0x3400a8,null))[_0x9dcc('0x3c')](handleError(_0x3400a8,null));};exports[_0x9dcc('0x21')]=function(_0x3a98ce,_0x595773){return db['IntegrationReport'][_0x9dcc('0x41')]({'where':{'id':_0x3a98ce[_0x9dcc('0x45')]['id']}})[_0x9dcc('0x20')](handleEntityNotFound(_0x595773,null))[_0x9dcc('0x20')](removeEntity(_0x595773,null))[_0x9dcc('0x3c')](handleError(_0x595773,null));};exports[_0x9dcc('0x46')]=function(_0x840bcf,_0x4b650e){return db[_0x9dcc('0x3a')][_0x9dcc('0x46')]()['then'](respondWithResult(_0x4b650e,null))[_0x9dcc('0x3c')](handleError(_0x4b650e,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 37a0bea..be77901 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 _0xe1dd=['request-promise','path','../../config/environment','./integrationReport.attributes','define','lodash','util','../../config/logger','api','moment'];(function(_0x1880e7,_0x266ea3){var _0x5d40b4=function(_0x56912a){while(--_0x56912a){_0x1880e7['push'](_0x1880e7['shift']());}};_0x5d40b4(++_0x266ea3);}(_0xe1dd,0xaf));var _0xde1d=function(_0x26a295,_0x66183a){_0x26a295=_0x26a295-0x0;var _0x2d5436=_0xe1dd[_0x26a295];return _0x2d5436;};'use strict';var _=require(_0xde1d('0x0'));var util=require(_0xde1d('0x1'));var logger=require(_0xde1d('0x2'))(_0xde1d('0x3'));var moment=require(_0xde1d('0x4'));var BPromise=require('bluebird');var rp=require(_0xde1d('0x5'));var fs=require('fs');var path=require(_0xde1d('0x6'));var rimraf=require('rimraf');var config=require(_0xde1d('0x7'));var attributes=require(_0xde1d('0x8'));module['exports']=function(_0x576732,_0x4b88b8){return _0x576732[_0xde1d('0x9')]('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4098=['exports','define','IntegrationReport','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x4b8e26,_0xabb329){var _0x168757=function(_0x357da0){while(--_0x357da0){_0x4b8e26['push'](_0x4b8e26['shift']());}};_0x168757(++_0xabb329);}(_0x4098,0x9d));var _0x8409=function(_0x580133,_0x35e293){_0x580133=_0x580133-0x0;var _0x99055a=_0x4098[_0x580133];return _0x99055a;};'use strict';var _=require('lodash');var util=require(_0x8409('0x0'));var logger=require('../../config/logger')(_0x8409('0x1'));var moment=require(_0x8409('0x2'));var BPromise=require(_0x8409('0x3'));var rp=require(_0x8409('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8409('0x5'));var config=require(_0x8409('0x6'));var attributes=require(_0x8409('0x7'));module[_0x8409('0x8')]=function(_0x55dfaf,_0x49315a){return _0x55dfaf[_0x8409('0x9')](_0x8409('0xa'),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 517c280..132d1c8 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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0xf494,0x1c6));var _0x4f49=function(_0x1ec737,_0x4a36f0){_0x1ec737=_0x1ec737-0x0;var _0x2cf24a=_0xf494[_0x1ec737];return _0x2cf24a;};'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);});});} \ No newline at end of file +var _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2ae78f,_0x599052){var _0x28674c=function(_0x42d5b4){while(--_0x42d5b4){_0x2ae78f['push'](_0x2ae78f['shift']());}};_0x28674c(++_0x599052);}(_0xda19,0xd5));var _0x9da1=function(_0x2e4e80,_0xdd09e3){_0x2e4e80=_0x2e4e80-0x0;var _0x4e021f=_0xda19[_0x2e4e80];return _0x4e021f;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index faffc0c..05fc990 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 _0xd8a5=['./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x400672,_0x243a7e){var _0x27ed65=function(_0x350ca9){while(--_0x350ca9){_0x400672['push'](_0x400672['shift']());}};_0x27ed65(++_0x243a7e);}(_0xd8a5,0x160));var _0x5d8a=function(_0x54b50d,_0x75ea63){_0x54b50d=_0x54b50d-0x0;var _0x178021=_0xd8a5[_0x54b50d];return _0x178021;};'use strict';var multer=require(_0x5d8a('0x0'));var util=require('util');var path=require(_0x5d8a('0x1'));var timeout=require(_0x5d8a('0x2'));var express=require('express');var router=express[_0x5d8a('0x3')]();var fs_extra=require(_0x5d8a('0x4'));var auth=require(_0x5d8a('0x5'));var interaction=require(_0x5d8a('0x6'));var config=require(_0x5d8a('0x7'));var controller=require(_0x5d8a('0x8'));router[_0x5d8a('0x9')]('/',auth[_0x5d8a('0xa')](),controller[_0x5d8a('0xb')]);router[_0x5d8a('0x9')](_0x5d8a('0xc'),auth[_0x5d8a('0xa')](),controller[_0x5d8a('0xd')]);router['get'](_0x5d8a('0xe'),auth[_0x5d8a('0xa')](),controller[_0x5d8a('0xf')]);router[_0x5d8a('0x10')]('/',auth[_0x5d8a('0xa')](),controller['create']);router[_0x5d8a('0x10')](_0x5d8a('0xe'),auth[_0x5d8a('0xa')](),controller[_0x5d8a('0x11')]);router['post'](_0x5d8a('0x12'),auth[_0x5d8a('0xa')](),controller['addIntervals']);router[_0x5d8a('0x13')](_0x5d8a('0xc'),auth[_0x5d8a('0xa')](),controller[_0x5d8a('0x14')]);router[_0x5d8a('0x15')](_0x5d8a('0xc'),auth[_0x5d8a('0xa')](),controller[_0x5d8a('0x16')]);module[_0x5d8a('0x17')]=router; \ No newline at end of file +var _0xcedf=['path','connect-timeout','Router','fs-extra','../../config/environment','get','index','/:id','/:id/sub_intervals','isAuthenticated','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','put','update','delete','destroy','exports','multer','util'];(function(_0x561f37,_0x5a0b20){var _0x3f8c64=function(_0x4dd56e){while(--_0x4dd56e){_0x561f37['push'](_0x561f37['shift']());}};_0x3f8c64(++_0x5a0b20);}(_0xcedf,0x1b6));var _0xfced=function(_0x4dca6d,_0x60af89){_0x4dca6d=_0x4dca6d-0x0;var _0x7be786=_0xcedf[_0x4dca6d];return _0x7be786;};'use strict';var multer=require(_0xfced('0x0'));var util=require(_0xfced('0x1'));var path=require(_0xfced('0x2'));var timeout=require(_0xfced('0x3'));var express=require('express');var router=express[_0xfced('0x4')]();var fs_extra=require(_0xfced('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfced('0x6'));var controller=require('./interval.controller');router[_0xfced('0x7')]('/',auth['isAuthenticated'](),controller[_0xfced('0x8')]);router['get'](_0xfced('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xfced('0x7')](_0xfced('0xa'),auth[_0xfced('0xb')](),controller[_0xfced('0xc')]);router['post']('/',auth[_0xfced('0xb')](),controller[_0xfced('0xd')]);router[_0xfced('0xe')](_0xfced('0xa'),auth[_0xfced('0xb')](),controller[_0xfced('0xf')]);router[_0xfced('0xe')](_0xfced('0x10'),auth[_0xfced('0xb')](),controller['addIntervals']);router[_0xfced('0x11')]('/:id',auth[_0xfced('0xb')](),controller[_0xfced('0x12')]);router[_0xfced('0x13')](_0xfced('0x9'),auth['isAuthenticated'](),controller[_0xfced('0x14')]);module[_0xfced('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index ad122e2..91b778a 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 _0x9721=['STRING','sequelize','exports'];(function(_0x5229bb,_0x4b17f5){var _0x15db9b=function(_0x2fb343){while(--_0x2fb343){_0x5229bb['push'](_0x5229bb['shift']());}};_0x15db9b(++_0x4b17f5);}(_0x9721,0x85));var _0x1972=function(_0x2cb5e0,_0x1d1f21){_0x2cb5e0=_0x2cb5e0-0x0;var _0x10e931=_0x9721[_0x2cb5e0];return _0x10e931;};'use strict';var Sequelize=require(_0x1972('0x0'));module[_0x1972('0x1')]={'name':{'type':Sequelize[_0x1972('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1972('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x7686=['STRING'];(function(_0x2e2bc6,_0x20aaa3){var _0x25667f=function(_0x128d5a){while(--_0x128d5a){_0x2e2bc6['push'](_0x2e2bc6['shift']());}};_0x25667f(++_0x20aaa3);}(_0x7686,0x88));var _0x6768=function(_0x37f135,_0x309f9a){_0x37f135=_0x37f135-0x0;var _0x1a4b21=_0x7686[_0x37f135];return _0x1a4b21;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6768('0x0')]},'description':{'type':Sequelize[_0x6768('0x0')]},'interval':{'type':Sequelize[_0x6768('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 6d6ce3f..1ff8ccc 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 _0x9f24=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','addInterval','getIntervals','nolimit','findOne','sequelize','transaction','IntervalId','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','Intervals','UserProfileResource','name','send','index','map','Interval','rawAttributes','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','create'];(function(_0x2ca2d0,_0x3ea8e4){var _0x521c23=function(_0x5b0731){while(--_0x5b0731){_0x2ca2d0['push'](_0x2ca2d0['shift']());}};_0x521c23(++_0x3ea8e4);}(_0x9f24,0x6b));var _0x49f2=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x9f24[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0x49f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x49f2('0x1'));var jsonpatch=require(_0x49f2('0x2'));var rp=require(_0x49f2('0x3'));var moment=require(_0x49f2('0x4'));var BPromise=require(_0x49f2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49f2('0x6'));var sox=require(_0x49f2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x49f2('0x8'));var _=require(_0x49f2('0x9'));var squel=require(_0x49f2('0xa'));var crypto=require(_0x49f2('0xb'));var jsforce=require(_0x49f2('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x49f2('0xd'));var Papa=require(_0x49f2('0xe'));var Redis=require(_0x49f2('0xf'));var authService=require(_0x49f2('0x10'));var qs=require(_0x49f2('0x11'));var as=require(_0x49f2('0x12'));var hardwareService=require(_0x49f2('0x13'));var logger=require(_0x49f2('0x14'))(_0x49f2('0x15'));var utils=require('../../config/utils');var config=require(_0x49f2('0x16'));var licenseUtil=require(_0x49f2('0x17'));var db=require(_0x49f2('0x18'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x5c22b0,_0x20496f){_0x20496f=_0x20496f||0xcc;return function(_0x2885ce){if(_0x2885ce){return _0x5c22b0[_0x49f2('0x19')](_0x20496f);}return _0x5c22b0[_0x49f2('0x1a')](_0x20496f)[_0x49f2('0x1b')]();};}function respondWithResult(_0x1b9ed5,_0x1d6ac2){_0x1d6ac2=_0x1d6ac2||0xc8;return function(_0x250ab8){if(_0x250ab8){return _0x1b9ed5[_0x49f2('0x1a')](_0x1d6ac2)[_0x49f2('0x1c')](_0x250ab8);}};}function respondWithFilteredResult(_0xb7fc11,_0x5860db){return function(_0x93ab11){if(_0x93ab11){var _0x196f05=typeof _0x5860db[_0x49f2('0x1d')]===_0x49f2('0x1e')&&typeof _0x5860db['limit']===_0x49f2('0x1e');var _0x163f8c=_0x93ab11[_0x49f2('0x1f')];var _0x2fc476=_0x196f05?0x0:_0x5860db[_0x49f2('0x1d')];var _0x13be90=_0x196f05?_0x93ab11[_0x49f2('0x1f')]:_0x5860db[_0x49f2('0x1d')]+_0x5860db[_0x49f2('0x20')];var _0x274ff7;if(_0x13be90>=_0x163f8c){_0x13be90=_0x163f8c;_0x274ff7=0xc8;}else{_0x274ff7=0xce;}_0xb7fc11[_0x49f2('0x1a')](_0x274ff7);return _0xb7fc11[_0x49f2('0x21')](_0x49f2('0x22'),_0x2fc476+'-'+_0x13be90+'/'+_0x163f8c)['json'](_0x93ab11);}return null;};}function patchUpdates(_0x232a90){return function(_0x2cdc49){try{jsonpatch[_0x49f2('0x23')](_0x2cdc49,_0x232a90,!![]);}catch(_0x4a0b31){return BPromise[_0x49f2('0x24')](_0x4a0b31);}return _0x2cdc49[_0x49f2('0x25')]();};}function saveUpdates(_0x4c9d3c,_0x357ac7){return function(_0x444937){if(_0x444937){return _0x444937[_0x49f2('0x26')](_0x4c9d3c)[_0x49f2('0x27')](function(_0x2d5b93){return _0x2d5b93;});}return null;};}function removeEntity(_0x4265b9,_0x3b538c){return function(_0x3a74ab){if(_0x3a74ab){return _0x3a74ab['destroy']()[_0x49f2('0x27')](function(){var _0x17065d=_0x3a74ab[_0x49f2('0x28')]({'plain':!![]});var _0x18d83f=_0x49f2('0x29');return db[_0x49f2('0x2a')]['destroy']({'where':{'type':_0x18d83f,'resourceId':_0x17065d['id']}})['then'](function(){return _0x3a74ab;});})['then'](function(){_0x4265b9[_0x49f2('0x1a')](0xcc)[_0x49f2('0x1b')]();});}};}function handleEntityNotFound(_0x8c9f8c,_0x2aaeff){return function(_0x19bf38){if(!_0x19bf38){_0x8c9f8c[_0x49f2('0x19')](0x194);}return _0x19bf38;};}function handleError(_0x42b274,_0x40bb53){_0x40bb53=_0x40bb53||0x1f4;return function(_0xa7c3e3){logger['error'](_0xa7c3e3['stack']);if(_0xa7c3e3[_0x49f2('0x2b')]){delete _0xa7c3e3[_0x49f2('0x2b')];}_0x42b274[_0x49f2('0x1a')](_0x40bb53)[_0x49f2('0x2c')](_0xa7c3e3);};}exports[_0x49f2('0x2d')]=function(_0x568d36,_0x393df8){var _0x50a077={},_0x1a85e7={},_0x1991dc={'count':0x0,'rows':[]};var _0x4a71c5=_[_0x49f2('0x2e')](db[_0x49f2('0x2f')][_0x49f2('0x30')],function(_0x191874){return{'name':_0x191874['fieldName'],'type':_0x191874[_0x49f2('0x31')][_0x49f2('0x32')]};});_0x1a85e7[_0x49f2('0x33')]=_[_0x49f2('0x2e')](_0x4a71c5,_0x49f2('0x2b'));_0x1a85e7[_0x49f2('0x34')]=_[_0x49f2('0x35')](_0x568d36[_0x49f2('0x34')]);_0x1a85e7[_0x49f2('0x36')]=_['intersection'](_0x1a85e7[_0x49f2('0x33')],_0x1a85e7[_0x49f2('0x34')]);_0x50a077['attributes']=_['intersection'](_0x1a85e7[_0x49f2('0x33')],qs['fields'](_0x568d36[_0x49f2('0x34')][_0x49f2('0x37')]));_0x50a077[_0x49f2('0x38')]=_0x50a077[_0x49f2('0x38')][_0x49f2('0x39')]?_0x50a077[_0x49f2('0x38')]:_0x1a85e7[_0x49f2('0x33')];if(!_0x568d36[_0x49f2('0x34')][_0x49f2('0x3a')]('nolimit')){_0x50a077[_0x49f2('0x20')]=qs['limit'](_0x568d36['query'][_0x49f2('0x20')]);_0x50a077['offset']=qs[_0x49f2('0x1d')](_0x568d36[_0x49f2('0x34')][_0x49f2('0x1d')]);}_0x50a077[_0x49f2('0x3b')]=qs[_0x49f2('0x3c')](_0x568d36[_0x49f2('0x34')][_0x49f2('0x3c')]);_0x50a077[_0x49f2('0x3d')]=qs[_0x49f2('0x36')](_[_0x49f2('0x3e')](_0x568d36[_0x49f2('0x34')],_0x1a85e7[_0x49f2('0x36')]),_0x4a71c5);if(_0x568d36[_0x49f2('0x34')][_0x49f2('0x3f')]){_0x50a077['where']=_[_0x49f2('0x40')](_0x50a077[_0x49f2('0x3d')],{'$or':_[_0x49f2('0x2e')](_0x4a71c5,function(_0x3d1229){if(_0x3d1229['type']!==_0x49f2('0x41')){var _0xe1c6f6={};_0xe1c6f6[_0x3d1229[_0x49f2('0x2b')]]={'$like':'%'+_0x568d36['query'][_0x49f2('0x3f')]+'%'};return _0xe1c6f6;}})});}_0x50a077=_[_0x49f2('0x40')]({},_0x50a077,_0x568d36[_0x49f2('0x42')]);var _0x4a4b9e={'where':_0x50a077['where']};return db[_0x49f2('0x2f')][_0x49f2('0x1f')](_0x4a4b9e)[_0x49f2('0x27')](function(_0x4d63db){_0x1991dc['count']=_0x4d63db;if(_0x568d36[_0x49f2('0x34')][_0x49f2('0x43')]){_0x50a077[_0x49f2('0x44')]=[{'all':!![]}];}return db[_0x49f2('0x2f')][_0x49f2('0x45')](_0x50a077);})[_0x49f2('0x27')](function(_0x20a9a5){_0x1991dc['rows']=_0x20a9a5;return _0x1991dc;})[_0x49f2('0x27')](respondWithFilteredResult(_0x393df8,_0x50a077))[_0x49f2('0x46')](handleError(_0x393df8,null));};exports[_0x49f2('0x47')]=function(_0x3c0771,_0x2f58ff){var _0x25e176={'raw':!![],'where':{'id':_0x3c0771[_0x49f2('0x48')]['id']}},_0x309d21={};_0x309d21[_0x49f2('0x33')]=_[_0x49f2('0x35')](db['Interval'][_0x49f2('0x30')]);_0x309d21[_0x49f2('0x34')]=_[_0x49f2('0x35')](_0x3c0771[_0x49f2('0x34')]);_0x309d21[_0x49f2('0x36')]=_[_0x49f2('0x49')](_0x309d21[_0x49f2('0x33')],_0x309d21[_0x49f2('0x34')]);_0x25e176['attributes']=_[_0x49f2('0x49')](_0x309d21['model'],qs['fields'](_0x3c0771[_0x49f2('0x34')]['fields']));_0x25e176[_0x49f2('0x38')]=_0x25e176[_0x49f2('0x38')]['length']?_0x25e176[_0x49f2('0x38')]:_0x309d21[_0x49f2('0x33')];if(_0x3c0771[_0x49f2('0x34')][_0x49f2('0x43')]){_0x25e176[_0x49f2('0x44')]=[{'all':!![]}];}_0x25e176=_[_0x49f2('0x40')]({},_0x25e176,_0x3c0771[_0x49f2('0x42')]);return db['Interval']['find'](_0x25e176)[_0x49f2('0x27')](handleEntityNotFound(_0x2f58ff,null))['then'](respondWithResult(_0x2f58ff,null))[_0x49f2('0x46')](handleError(_0x2f58ff,null));};exports[_0x49f2('0x4a')]=function(_0x2f3bce,_0x3f8996){return db['Interval'][_0x49f2('0x4a')](_0x2f3bce['body'],{})['then'](function(_0x14507f){var _0x2a91c7=_0x2f3bce['user'][_0x49f2('0x28')]({'plain':!![]});if(!_0x2a91c7)throw new Error(_0x49f2('0x4b'));if(_0x2a91c7['role']==='user'){var _0x153262=_0x14507f[_0x49f2('0x28')]({'plain':!![]});var _0x21ec4c='Intervals';return db[_0x49f2('0x4c')][_0x49f2('0x4d')]({'where':{'name':_0x21ec4c,'userProfileId':_0x2a91c7['userProfileId']},'raw':!![]})[_0x49f2('0x27')](function(_0x317c12){if(_0x317c12&&_0x317c12[_0x49f2('0x4e')]===0x0){return db[_0x49f2('0x2a')][_0x49f2('0x4a')]({'name':_0x153262[_0x49f2('0x2b')],'resourceId':_0x153262['id'],'type':_0x317c12[_0x49f2('0x2b')],'sectionId':_0x317c12['id']},{})[_0x49f2('0x27')](function(){return _0x14507f;});}else{return _0x14507f;}})['catch'](function(_0x8c1e86){logger[_0x49f2('0x4f')](_0x49f2('0x50'),_0x8c1e86);throw _0x8c1e86;});}return _0x14507f;})[_0x49f2('0x27')](respondWithResult(_0x3f8996,0xc9))[_0x49f2('0x46')](handleError(_0x3f8996,null));};exports['update']=function(_0xf4e61e,_0x30014a){if(_0xf4e61e[_0x49f2('0x51')]['id']){delete _0xf4e61e[_0x49f2('0x51')]['id'];}return db[_0x49f2('0x2f')][_0x49f2('0x4d')]({'where':{'id':_0xf4e61e[_0x49f2('0x48')]['id']}})['then'](handleEntityNotFound(_0x30014a,null))['then'](saveUpdates(_0xf4e61e[_0x49f2('0x51')],null))[_0x49f2('0x27')](respondWithResult(_0x30014a,null))[_0x49f2('0x46')](handleError(_0x30014a,null));};exports[_0x49f2('0x52')]=function(_0x1e5e58,_0x20e765){return db[_0x49f2('0x2f')]['find']({'where':{'id':_0x1e5e58[_0x49f2('0x48')]['id']}})[_0x49f2('0x27')](handleEntityNotFound(_0x20e765,null))[_0x49f2('0x27')](removeEntity(_0x20e765,null))[_0x49f2('0x46')](handleError(_0x20e765,null));};exports[_0x49f2('0x53')]=function(_0x166261,_0x128682,_0x41a5b9){if(_0x166261[_0x49f2('0x51')]['id']){delete _0x166261[_0x49f2('0x51')]['id'];}return db[_0x49f2('0x2f')][_0x49f2('0x4d')]({'where':{'id':_0x166261[_0x49f2('0x48')]['id']}})['then'](handleEntityNotFound(_0x128682,null))[_0x49f2('0x27')](function(_0x10331c){if(_0x10331c){_0x166261['body']['IntervalId']=_0x10331c['id'];return db['Interval']['create'](_0x166261[_0x49f2('0x51')]);}})['then'](respondWithResult(_0x128682,null))[_0x49f2('0x46')](handleError(_0x128682,null));};exports[_0x49f2('0x54')]=function(_0x3d8bc4,_0x1d33f8,_0x16eb42){var _0x93a257={};var _0x58d67c={};var _0x3e1f20;var _0x474577;return db[_0x49f2('0x2f')]['findOne']({'where':{'id':_0x3d8bc4[_0x49f2('0x48')]['id']}})[_0x49f2('0x27')](handleEntityNotFound(_0x1d33f8,null))[_0x49f2('0x27')](function(_0x546147){if(_0x546147){_0x3e1f20=_0x546147;_0x58d67c[_0x49f2('0x33')]=_['keys'](db[_0x49f2('0x2f')][_0x49f2('0x30')]);_0x58d67c[_0x49f2('0x34')]=_['keys'](_0x3d8bc4[_0x49f2('0x34')]);_0x58d67c['filters']=_['intersection'](_0x58d67c['model'],_0x58d67c['query']);_0x93a257[_0x49f2('0x38')]=_[_0x49f2('0x49')](_0x58d67c[_0x49f2('0x33')],qs[_0x49f2('0x37')](_0x3d8bc4[_0x49f2('0x34')]['fields']));_0x93a257[_0x49f2('0x38')]=_0x93a257[_0x49f2('0x38')][_0x49f2('0x39')]?_0x93a257[_0x49f2('0x38')]:_0x58d67c[_0x49f2('0x33')];_0x93a257[_0x49f2('0x3b')]=qs[_0x49f2('0x3c')](_0x3d8bc4[_0x49f2('0x34')][_0x49f2('0x3c')]);_0x93a257[_0x49f2('0x3d')]=qs[_0x49f2('0x36')](_['pick'](_0x3d8bc4[_0x49f2('0x34')],_0x58d67c[_0x49f2('0x36')]));if(_0x3d8bc4[_0x49f2('0x34')][_0x49f2('0x3f')]){_0x93a257['where']=_['merge'](_0x93a257['where'],{'$or':_[_0x49f2('0x2e')](_0x93a257[_0x49f2('0x38')],function(_0x7f1d80){var _0xc281c4={};_0xc281c4[_0x7f1d80]={'$like':'%'+_0x3d8bc4[_0x49f2('0x34')][_0x49f2('0x3f')]+'%'};return _0xc281c4;})});}_0x93a257=_['merge']({},_0x93a257,_0x3d8bc4[_0x49f2('0x42')]);return _0x3e1f20[_0x49f2('0x54')](_0x93a257);}})[_0x49f2('0x27')](function(_0x5052a2){if(_0x5052a2){_0x474577=_0x5052a2[_0x49f2('0x39')];if(!_0x3d8bc4[_0x49f2('0x34')]['hasOwnProperty'](_0x49f2('0x55'))){_0x93a257['limit']=qs['limit'](_0x3d8bc4['query'][_0x49f2('0x20')]);_0x93a257[_0x49f2('0x1d')]=qs['offset'](_0x3d8bc4[_0x49f2('0x34')][_0x49f2('0x1d')]);}return _0x3e1f20['getIntervals'](_0x93a257);}})['then'](function(_0x23d54e){if(_0x23d54e){return _0x23d54e?{'count':_0x474577,'rows':_0x23d54e}:null;}})['then'](respondWithResult(_0x1d33f8,null))[_0x49f2('0x46')](handleError(_0x1d33f8,null));};exports['addIntervals']=function(_0x143edf,_0x42815c,_0x2e9a10){return db[_0x49f2('0x2f')][_0x49f2('0x56')]({'where':{'id':_0x143edf['params']['id']}})[_0x49f2('0x27')](handleEntityNotFound(_0x42815c,null))[_0x49f2('0x27')](function(_0x145218){if(_0x145218){return db[_0x49f2('0x57')][_0x49f2('0x58')](function(_0x53335e){return db['Interval'][_0x49f2('0x52')]({'where':{'IntervalId':_0x143edf[_0x49f2('0x48')]['id']},'transaction':_0x53335e})[_0x49f2('0x27')](function(_0x251ca1){var _0x38d001=_[_0x49f2('0x2e')](_0x143edf['body'],function(_0x591ad5){delete _0x591ad5['id'];_0x591ad5[_0x49f2('0x59')]=_0x143edf[_0x49f2('0x48')]['id'];return _0x591ad5;});return db[_0x49f2('0x2f')][_0x49f2('0x5a')](_0x38d001,{'transaction':_0x53335e});});})[_0x49f2('0x27')](function(){return db[_0x49f2('0x2f')][_0x49f2('0x45')]({'where':{'IntervalId':_0x143edf[_0x49f2('0x48')]['id']}});});}})[_0x49f2('0x27')](respondWithResult(_0x42815c,null))[_0x49f2('0x46')](handleError(_0x42815c,null));}; \ No newline at end of file +var _0x3fab=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','addInterval','IntervalId','findOne','order','getIntervals','sequelize','transaction','bulkCreate','findAll','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','Intervals','UserProfileResource','stack','name','send','map','Interval','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','rows','catch','params','rawAttributes','includeAll','find','create','body'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x3fab,0x1e8));var _0xb3fa=function(_0xec95a,_0x1b72a8){_0xec95a=_0xec95a-0x0;var _0x792fa2=_0x3fab[_0xec95a];return _0x792fa2;};'use strict';var emlformat=require(_0xb3fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb3fa('0x1'));var jsonpatch=require(_0xb3fa('0x2'));var rp=require(_0xb3fa('0x3'));var moment=require('moment');var BPromise=require(_0xb3fa('0x4'));var Mustache=require(_0xb3fa('0x5'));var util=require(_0xb3fa('0x6'));var path=require(_0xb3fa('0x7'));var sox=require(_0xb3fa('0x8'));var csv=require(_0xb3fa('0x9'));var ejs=require(_0xb3fa('0xa'));var fs=require('fs');var fs_extra=require(_0xb3fa('0xb'));var _=require(_0xb3fa('0xc'));var squel=require('squel');var crypto=require(_0xb3fa('0xd'));var jsforce=require(_0xb3fa('0xe'));var deskjs=require(_0xb3fa('0xf'));var toCsv=require(_0xb3fa('0x9'));var querystring=require(_0xb3fa('0x10'));var Papa=require(_0xb3fa('0x11'));var Redis=require(_0xb3fa('0x12'));var authService=require(_0xb3fa('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb3fa('0x14'));var hardwareService=require(_0xb3fa('0x15'));var logger=require(_0xb3fa('0x16'))(_0xb3fa('0x17'));var utils=require(_0xb3fa('0x18'));var config=require(_0xb3fa('0x19'));var licenseUtil=require(_0xb3fa('0x1a'));var db=require(_0xb3fa('0x1b'))['db'];var extensions=require(_0xb3fa('0x1c'));function respondWithStatusCode(_0xbbb99a,_0x55038e){_0x55038e=_0x55038e||0xcc;return function(_0xb2646b){if(_0xb2646b){return _0xbbb99a[_0xb3fa('0x1d')](_0x55038e);}return _0xbbb99a[_0xb3fa('0x1e')](_0x55038e)['end']();};}function respondWithResult(_0x46f1ef,_0x3e2c9b){_0x3e2c9b=_0x3e2c9b||0xc8;return function(_0x2eebe1){if(_0x2eebe1){return _0x46f1ef[_0xb3fa('0x1e')](_0x3e2c9b)['json'](_0x2eebe1);}};}function respondWithFilteredResult(_0x16ef49,_0x13fc13){return function(_0x39d0fb){if(_0x39d0fb){var _0x3fe0e4=typeof _0x13fc13[_0xb3fa('0x1f')]===_0xb3fa('0x20')&&typeof _0x13fc13[_0xb3fa('0x21')]===_0xb3fa('0x20');var _0x36b06e=_0x39d0fb[_0xb3fa('0x22')];var _0x17f035=_0x3fe0e4?0x0:_0x13fc13[_0xb3fa('0x1f')];var _0x38237b=_0x3fe0e4?_0x39d0fb[_0xb3fa('0x22')]:_0x13fc13['offset']+_0x13fc13[_0xb3fa('0x21')];var _0x17801e;if(_0x38237b>=_0x36b06e){_0x38237b=_0x36b06e;_0x17801e=0xc8;}else{_0x17801e=0xce;}_0x16ef49[_0xb3fa('0x1e')](_0x17801e);return _0x16ef49[_0xb3fa('0x23')](_0xb3fa('0x24'),_0x17f035+'-'+_0x38237b+'/'+_0x36b06e)['json'](_0x39d0fb);}return null;};}function patchUpdates(_0x45f75e){return function(_0x341417){try{jsonpatch[_0xb3fa('0x25')](_0x341417,_0x45f75e,!![]);}catch(_0x25d4d0){return BPromise[_0xb3fa('0x26')](_0x25d4d0);}return _0x341417['save']();};}function saveUpdates(_0x3571b4,_0x34a0a7){return function(_0x29465f){if(_0x29465f){return _0x29465f['update'](_0x3571b4)[_0xb3fa('0x27')](function(_0x1f8739){return _0x1f8739;});}return null;};}function removeEntity(_0x10a902,_0x35810b){return function(_0xaf4635){if(_0xaf4635){return _0xaf4635['destroy']()[_0xb3fa('0x27')](function(){var _0x5d7e94=_0xaf4635[_0xb3fa('0x28')]({'plain':!![]});var _0x4e87cf=_0xb3fa('0x29');return db[_0xb3fa('0x2a')]['destroy']({'where':{'type':_0x4e87cf,'resourceId':_0x5d7e94['id']}})['then'](function(){return _0xaf4635;});})[_0xb3fa('0x27')](function(){_0x10a902[_0xb3fa('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b56d7,_0x130be3){return function(_0x48add3){if(!_0x48add3){_0x3b56d7['sendStatus'](0x194);}return _0x48add3;};}function handleError(_0x306081,_0x5d9e3b){_0x5d9e3b=_0x5d9e3b||0x1f4;return function(_0x1271f5){logger['error'](_0x1271f5[_0xb3fa('0x2b')]);if(_0x1271f5[_0xb3fa('0x2c')]){delete _0x1271f5[_0xb3fa('0x2c')];}_0x306081[_0xb3fa('0x1e')](_0x5d9e3b)[_0xb3fa('0x2d')](_0x1271f5);};}exports['index']=function(_0x1aa948,_0x55794e){var _0x54a8dc={},_0x5a951d={},_0x1bdd06={'count':0x0,'rows':[]};var _0x2303b5=_[_0xb3fa('0x2e')](db[_0xb3fa('0x2f')]['rawAttributes'],function(_0x1c6750){return{'name':_0x1c6750[_0xb3fa('0x30')],'type':_0x1c6750[_0xb3fa('0x31')][_0xb3fa('0x32')]};});_0x5a951d['model']=_[_0xb3fa('0x2e')](_0x2303b5,_0xb3fa('0x2c'));_0x5a951d[_0xb3fa('0x33')]=_[_0xb3fa('0x34')](_0x1aa948[_0xb3fa('0x33')]);_0x5a951d[_0xb3fa('0x35')]=_[_0xb3fa('0x36')](_0x5a951d[_0xb3fa('0x37')],_0x5a951d[_0xb3fa('0x33')]);_0x54a8dc[_0xb3fa('0x38')]=_[_0xb3fa('0x36')](_0x5a951d['model'],qs[_0xb3fa('0x39')](_0x1aa948[_0xb3fa('0x33')]['fields']));_0x54a8dc[_0xb3fa('0x38')]=_0x54a8dc[_0xb3fa('0x38')][_0xb3fa('0x3a')]?_0x54a8dc[_0xb3fa('0x38')]:_0x5a951d[_0xb3fa('0x37')];if(!_0x1aa948[_0xb3fa('0x33')][_0xb3fa('0x3b')](_0xb3fa('0x3c'))){_0x54a8dc[_0xb3fa('0x21')]=qs[_0xb3fa('0x21')](_0x1aa948[_0xb3fa('0x33')][_0xb3fa('0x21')]);_0x54a8dc[_0xb3fa('0x1f')]=qs[_0xb3fa('0x1f')](_0x1aa948[_0xb3fa('0x33')][_0xb3fa('0x1f')]);}_0x54a8dc['order']=qs[_0xb3fa('0x3d')](_0x1aa948[_0xb3fa('0x33')][_0xb3fa('0x3d')]);_0x54a8dc[_0xb3fa('0x3e')]=qs[_0xb3fa('0x35')](_[_0xb3fa('0x3f')](_0x1aa948[_0xb3fa('0x33')],_0x5a951d['filters']),_0x2303b5);if(_0x1aa948[_0xb3fa('0x33')]['filter']){_0x54a8dc[_0xb3fa('0x3e')]=_['merge'](_0x54a8dc[_0xb3fa('0x3e')],{'$or':_[_0xb3fa('0x2e')](_0x2303b5,function(_0x324b2f){if(_0x324b2f['type']!=='VIRTUAL'){var _0x263353={};_0x263353[_0x324b2f[_0xb3fa('0x2c')]]={'$like':'%'+_0x1aa948[_0xb3fa('0x33')][_0xb3fa('0x40')]+'%'};return _0x263353;}})});}_0x54a8dc=_[_0xb3fa('0x41')]({},_0x54a8dc,_0x1aa948[_0xb3fa('0x42')]);var _0x39ead9={'where':_0x54a8dc[_0xb3fa('0x3e')]};return db[_0xb3fa('0x2f')][_0xb3fa('0x22')](_0x39ead9)[_0xb3fa('0x27')](function(_0x1bd7b9){_0x1bdd06[_0xb3fa('0x22')]=_0x1bd7b9;if(_0x1aa948[_0xb3fa('0x33')]['includeAll']){_0x54a8dc[_0xb3fa('0x43')]=[{'all':!![]}];}return db[_0xb3fa('0x2f')]['findAll'](_0x54a8dc);})[_0xb3fa('0x27')](function(_0x25a854){_0x1bdd06[_0xb3fa('0x44')]=_0x25a854;return _0x1bdd06;})['then'](respondWithFilteredResult(_0x55794e,_0x54a8dc))[_0xb3fa('0x45')](handleError(_0x55794e,null));};exports['show']=function(_0x4537e9,_0x5e71dc){var _0x77ab5a={'raw':!![],'where':{'id':_0x4537e9[_0xb3fa('0x46')]['id']}},_0x403850={};_0x403850[_0xb3fa('0x37')]=_['keys'](db[_0xb3fa('0x2f')][_0xb3fa('0x47')]);_0x403850[_0xb3fa('0x33')]=_[_0xb3fa('0x34')](_0x4537e9[_0xb3fa('0x33')]);_0x403850[_0xb3fa('0x35')]=_['intersection'](_0x403850[_0xb3fa('0x37')],_0x403850[_0xb3fa('0x33')]);_0x77ab5a[_0xb3fa('0x38')]=_[_0xb3fa('0x36')](_0x403850[_0xb3fa('0x37')],qs[_0xb3fa('0x39')](_0x4537e9[_0xb3fa('0x33')][_0xb3fa('0x39')]));_0x77ab5a[_0xb3fa('0x38')]=_0x77ab5a[_0xb3fa('0x38')][_0xb3fa('0x3a')]?_0x77ab5a[_0xb3fa('0x38')]:_0x403850[_0xb3fa('0x37')];if(_0x4537e9['query'][_0xb3fa('0x48')]){_0x77ab5a[_0xb3fa('0x43')]=[{'all':!![]}];}_0x77ab5a=_['merge']({},_0x77ab5a,_0x4537e9[_0xb3fa('0x42')]);return db[_0xb3fa('0x2f')][_0xb3fa('0x49')](_0x77ab5a)[_0xb3fa('0x27')](handleEntityNotFound(_0x5e71dc,null))[_0xb3fa('0x27')](respondWithResult(_0x5e71dc,null))[_0xb3fa('0x45')](handleError(_0x5e71dc,null));};exports[_0xb3fa('0x4a')]=function(_0x7d1ee1,_0x53aaeb){return db[_0xb3fa('0x2f')][_0xb3fa('0x4a')](_0x7d1ee1[_0xb3fa('0x4b')],{})[_0xb3fa('0x27')](function(_0x150a7b){var _0x7f275f=_0x7d1ee1['user'][_0xb3fa('0x28')]({'plain':!![]});if(!_0x7f275f)throw new Error(_0xb3fa('0x4c'));if(_0x7f275f[_0xb3fa('0x4d')]===_0xb3fa('0x4e')){var _0x28c4ff=_0x150a7b['get']({'plain':!![]});var _0x5a3f36=_0xb3fa('0x29');return db[_0xb3fa('0x4f')][_0xb3fa('0x49')]({'where':{'name':_0x5a3f36,'userProfileId':_0x7f275f[_0xb3fa('0x50')]},'raw':!![]})[_0xb3fa('0x27')](function(_0x44c22f){if(_0x44c22f&&_0x44c22f[_0xb3fa('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x28c4ff[_0xb3fa('0x2c')],'resourceId':_0x28c4ff['id'],'type':_0x44c22f[_0xb3fa('0x2c')],'sectionId':_0x44c22f['id']},{})[_0xb3fa('0x27')](function(){return _0x150a7b;});}else{return _0x150a7b;}})[_0xb3fa('0x45')](function(_0xa173fb){logger['error'](_0xb3fa('0x52'),_0xa173fb);throw _0xa173fb;});}return _0x150a7b;})[_0xb3fa('0x27')](respondWithResult(_0x53aaeb,0xc9))['catch'](handleError(_0x53aaeb,null));};exports[_0xb3fa('0x53')]=function(_0x59aaf4,_0x3331cc){if(_0x59aaf4[_0xb3fa('0x4b')]['id']){delete _0x59aaf4['body']['id'];}return db['Interval']['find']({'where':{'id':_0x59aaf4[_0xb3fa('0x46')]['id']}})[_0xb3fa('0x27')](handleEntityNotFound(_0x3331cc,null))['then'](saveUpdates(_0x59aaf4[_0xb3fa('0x4b')],null))[_0xb3fa('0x27')](respondWithResult(_0x3331cc,null))[_0xb3fa('0x45')](handleError(_0x3331cc,null));};exports[_0xb3fa('0x54')]=function(_0x44a0f4,_0x2eaf03){return db[_0xb3fa('0x2f')]['find']({'where':{'id':_0x44a0f4[_0xb3fa('0x46')]['id']}})[_0xb3fa('0x27')](handleEntityNotFound(_0x2eaf03,null))[_0xb3fa('0x27')](removeEntity(_0x2eaf03,null))['catch'](handleError(_0x2eaf03,null));};exports[_0xb3fa('0x55')]=function(_0xb901d7,_0x2ac23e,_0x5b202b){if(_0xb901d7['body']['id']){delete _0xb901d7[_0xb3fa('0x4b')]['id'];}return db['Interval'][_0xb3fa('0x49')]({'where':{'id':_0xb901d7[_0xb3fa('0x46')]['id']}})[_0xb3fa('0x27')](handleEntityNotFound(_0x2ac23e,null))[_0xb3fa('0x27')](function(_0x165f9f){if(_0x165f9f){_0xb901d7[_0xb3fa('0x4b')][_0xb3fa('0x56')]=_0x165f9f['id'];return db[_0xb3fa('0x2f')][_0xb3fa('0x4a')](_0xb901d7[_0xb3fa('0x4b')]);}})[_0xb3fa('0x27')](respondWithResult(_0x2ac23e,null))[_0xb3fa('0x45')](handleError(_0x2ac23e,null));};exports['getIntervals']=function(_0x56b800,_0x334f90,_0x3ee071){var _0x27028b={};var _0x4dc834={};var _0x349446;var _0x13f136;return db[_0xb3fa('0x2f')][_0xb3fa('0x57')]({'where':{'id':_0x56b800['params']['id']}})[_0xb3fa('0x27')](handleEntityNotFound(_0x334f90,null))[_0xb3fa('0x27')](function(_0x480e77){if(_0x480e77){_0x349446=_0x480e77;_0x4dc834[_0xb3fa('0x37')]=_[_0xb3fa('0x34')](db[_0xb3fa('0x2f')][_0xb3fa('0x47')]);_0x4dc834['query']=_[_0xb3fa('0x34')](_0x56b800[_0xb3fa('0x33')]);_0x4dc834[_0xb3fa('0x35')]=_[_0xb3fa('0x36')](_0x4dc834[_0xb3fa('0x37')],_0x4dc834[_0xb3fa('0x33')]);_0x27028b['attributes']=_[_0xb3fa('0x36')](_0x4dc834[_0xb3fa('0x37')],qs[_0xb3fa('0x39')](_0x56b800['query']['fields']));_0x27028b['attributes']=_0x27028b[_0xb3fa('0x38')][_0xb3fa('0x3a')]?_0x27028b['attributes']:_0x4dc834[_0xb3fa('0x37')];_0x27028b[_0xb3fa('0x58')]=qs[_0xb3fa('0x3d')](_0x56b800[_0xb3fa('0x33')][_0xb3fa('0x3d')]);_0x27028b[_0xb3fa('0x3e')]=qs[_0xb3fa('0x35')](_[_0xb3fa('0x3f')](_0x56b800[_0xb3fa('0x33')],_0x4dc834[_0xb3fa('0x35')]));if(_0x56b800[_0xb3fa('0x33')]['filter']){_0x27028b[_0xb3fa('0x3e')]=_[_0xb3fa('0x41')](_0x27028b[_0xb3fa('0x3e')],{'$or':_['map'](_0x27028b[_0xb3fa('0x38')],function(_0x3666f1){var _0x3361fa={};_0x3361fa[_0x3666f1]={'$like':'%'+_0x56b800[_0xb3fa('0x33')]['filter']+'%'};return _0x3361fa;})});}_0x27028b=_[_0xb3fa('0x41')]({},_0x27028b,_0x56b800[_0xb3fa('0x42')]);return _0x349446['getIntervals'](_0x27028b);}})[_0xb3fa('0x27')](function(_0x1ec8de){if(_0x1ec8de){_0x13f136=_0x1ec8de['length'];if(!_0x56b800['query']['hasOwnProperty']('nolimit')){_0x27028b[_0xb3fa('0x21')]=qs[_0xb3fa('0x21')](_0x56b800[_0xb3fa('0x33')]['limit']);_0x27028b[_0xb3fa('0x1f')]=qs[_0xb3fa('0x1f')](_0x56b800['query'][_0xb3fa('0x1f')]);}return _0x349446[_0xb3fa('0x59')](_0x27028b);}})[_0xb3fa('0x27')](function(_0x18bfe){if(_0x18bfe){return _0x18bfe?{'count':_0x13f136,'rows':_0x18bfe}:null;}})[_0xb3fa('0x27')](respondWithResult(_0x334f90,null))[_0xb3fa('0x45')](handleError(_0x334f90,null));};exports['addIntervals']=function(_0x8ff09e,_0x4a4b4c,_0x23f634){return db[_0xb3fa('0x2f')]['findOne']({'where':{'id':_0x8ff09e[_0xb3fa('0x46')]['id']}})[_0xb3fa('0x27')](handleEntityNotFound(_0x4a4b4c,null))['then'](function(_0x4e3b99){if(_0x4e3b99){return db[_0xb3fa('0x5a')][_0xb3fa('0x5b')](function(_0x1a665e){return db['Interval'][_0xb3fa('0x54')]({'where':{'IntervalId':_0x8ff09e['params']['id']},'transaction':_0x1a665e})[_0xb3fa('0x27')](function(_0x25694e){var _0x36c41d=_[_0xb3fa('0x2e')](_0x8ff09e[_0xb3fa('0x4b')],function(_0x1fb191){delete _0x1fb191['id'];_0x1fb191[_0xb3fa('0x56')]=_0x8ff09e['params']['id'];return _0x1fb191;});return db['Interval'][_0xb3fa('0x5c')](_0x36c41d,{'transaction':_0x1a665e});});})['then'](function(){return db['Interval'][_0xb3fa('0x5d')]({'where':{'IntervalId':_0x8ff09e['params']['id']}});});}})['then'](respondWithResult(_0x4a4b4c,null))[_0xb3fa('0x45')](handleError(_0x4a4b4c,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 5d0224d..c9b5746 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 _0x9b96=['exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9b96,0x9e));var _0x69b9=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x9b96[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x69b9('0x0'));var util=require(_0x69b9('0x1'));var logger=require(_0x69b9('0x2'))(_0x69b9('0x3'));var moment=require(_0x69b9('0x4'));var BPromise=require(_0x69b9('0x5'));var rp=require(_0x69b9('0x6'));var fs=require('fs');var path=require(_0x69b9('0x7'));var rimraf=require(_0x69b9('0x8'));var config=require(_0x69b9('0x9'));var attributes=require(_0x69b9('0xa'));var extensions=require(_0x69b9('0xb'));module[_0x69b9('0xc')]=function(_0x158bdb,_0x2f5f3d){return _0x158bdb[_0x69b9('0xd')](_0x69b9('0xe'),attributes,{'tableName':_0x69b9('0xf'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x43fe8c,_0x58cae3){extensions[_0x69b9('0x10')](_0x158bdb,_0x43fe8c);},'afterBulkCreate':function(_0x1f889f,_0x159248,_0x55517c){_0x55517c();extensions['rewrite'](_0x158bdb,_0x1f889f[0x0]);},'afterUpdate':function(_0x215db2,_0x1dc74e){extensions[_0x69b9('0x10')](_0x158bdb,_0x215db2);},'afterDestroy':function(_0x5c0c9d,_0x2ea769){extensions['rewrite'](_0x158bdb,_0x5c0c9d);}}});}; \ No newline at end of file +var _0xa244=['request-promise','path','rimraf','./interval.attributes','../../components/extensions/rewrite','exports','define','rewrite','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2534a0,_0xda89db){var _0x3209c0=function(_0x1342c3){while(--_0x1342c3){_0x2534a0['push'](_0x2534a0['shift']());}};_0x3209c0(++_0xda89db);}(_0xa244,0xa4));var _0x4a24=function(_0x3b13e2,_0x3cd43d){_0x3b13e2=_0x3b13e2-0x0;var _0x29dd1f=_0xa244[_0x3b13e2];return _0x29dd1f;};'use strict';var _=require(_0x4a24('0x0'));var util=require(_0x4a24('0x1'));var logger=require(_0x4a24('0x2'))('api');var moment=require(_0x4a24('0x3'));var BPromise=require(_0x4a24('0x4'));var rp=require(_0x4a24('0x5'));var fs=require('fs');var path=require(_0x4a24('0x6'));var rimraf=require(_0x4a24('0x7'));var config=require('../../config/environment');var attributes=require(_0x4a24('0x8'));var extensions=require(_0x4a24('0x9'));module[_0x4a24('0xa')]=function(_0x40d666,_0x1c7fb3){return _0x40d666[_0x4a24('0xb')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x31dce3,_0x548c12){extensions['rewrite'](_0x40d666,_0x31dce3);},'afterBulkCreate':function(_0x4f3c71,_0x2d7c89,_0x40bb6e){_0x40bb6e();extensions[_0x4a24('0xc')](_0x40d666,_0x4f3c71[0x0]);},'afterUpdate':function(_0x5dc7af,_0x5590e2){extensions[_0x4a24('0xc')](_0x40d666,_0x5dc7af);},'afterDestroy':function(_0x1118c7,_0x2342ad){extensions['rewrite'](_0x40d666,_0x1118c7);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 06a4b74..e9b9da9 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(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x1c6089,_0x3816e2){var _0x4d97c1=function(_0x3e631b){while(--_0x3e631b){_0x1c6089['push'](_0x1c6089['shift']());}};_0x4d97c1(++_0x3816e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 b29a358..b81812d 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 _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x4a6a17,_0x4b90ab){var _0x26d460=function(_0x3a0100){while(--_0x3a0100){_0x4a6a17['push'](_0x4a6a17['shift']());}};_0x26d460(++_0x4b90ab);}(_0xadb5,0xad));var _0x5adb=function(_0x38591e,_0x3126fb){_0x38591e=_0x38591e-0x0;var _0x8742b2=_0xadb5[_0x38591e];return _0x8742b2;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x2f770c,_0x63f9a5){var _0x24de27=function(_0x54027b){while(--_0x54027b){_0x2f770c['push'](_0x2f770c['shift']());}};_0x24de27(++_0x63f9a5);}(_0x2032,0xd9));var _0x2203=function(_0x5a5c8d,_0x527974){_0x5a5c8d=_0x5a5c8d-0x0;var _0x510092=_0x2032[_0x5a5c8d];return _0x510092;};'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 efbf64e..b05bb4a 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 _0xfcbe=['api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','fields','email','customfield_11501','customfield_11502','newToken','name','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64','request','setEncoding','data','end','status','statusCode','json','parse'];(function(_0x3f6565,_0x12a8bb){var _0x4abd23=function(_0x56dce7){while(--_0x56dce7){_0x3f6565['push'](_0x3f6565['shift']());}};_0x4abd23(++_0x12a8bb);}(_0xfcbe,0xbe));var _0xefcb=function(_0x3cc70c,_0x2ffae7){_0x3cc70c=_0x3cc70c-0x0;var _0x32a978=_0xfcbe[_0x3cc70c];return _0x32a978;};'use strict';var BPromise=require(_0xefcb('0x0'));var https=require(_0xefcb('0x1'));var logger=require(_0xefcb('0x2'))(_0xefcb('0x3'));var USERNAME=_0xefcb('0x4');var PASSWORD=_0xefcb('0x5');function openIssue(_0x2b1a70,_0x4411dd){var _0x468b3f={'fields':{'project':{'key':_0x2b1a70[_0xefcb('0x6')]||_0xefcb('0x7')},'summary':(_0x2b1a70[_0xefcb('0x8')]||_0xefcb('0x9'))+_0xefcb('0xa')+_0x2b1a70['ip'],'description':_0x2b1a70[_0xefcb('0xb')]||JSON[_0xefcb('0xc')](_0x2b1a70),'issuetype':{'name':_0x2b1a70['issuetype']||_0xefcb('0xd')}}};_0x468b3f[_0xefcb('0xe')]['customfield_11500']=_0x2b1a70[_0xefcb('0xf')];_0x468b3f[_0xefcb('0xe')][_0xefcb('0x10')]=_0x2b1a70['oldToken'];_0x468b3f[_0xefcb('0xe')][_0xefcb('0x11')]=_0x2b1a70[_0xefcb('0x12')];_0x468b3f[_0xefcb('0xe')]['customfield_11503']=_0x2b1a70[_0xefcb('0x13')];_0x468b3f[_0xefcb('0xe')]['customfield_11504']=_0x2b1a70[_0xefcb('0x14')];_0x468b3f['fields']['customfield_10102']=_0x2b1a70['ip'];var _0x48b946={'host':_0xefcb('0x15'),'port':0x1bb,'path':_0xefcb('0x16'),'method':_0xefcb('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0xefcb('0x18'),'Authorization':_0xefcb('0x19')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xefcb('0x1a'))}};var _0x16bb81=JSON['stringify'](_0x468b3f);var _0xdc60e4=https[_0xefcb('0x1b')](_0x48b946,function(_0x1637b7){_0x1637b7[_0xefcb('0x1c')]('utf8');var _0x303a97='';_0x1637b7['on'](_0xefcb('0x1d'),function(_0x40dcf7){_0x303a97+=_0x40dcf7;});_0x1637b7['on'](_0xefcb('0x1e'),function(){if(_0x4411dd){return _0x4411dd[_0xefcb('0x1f')](_0x1637b7[_0xefcb('0x20')])[_0xefcb('0x21')](JSON[_0xefcb('0x22')](_0x303a97));}});});_0xdc60e4['on']('error',function(_0x2dbf59){if(_0x4411dd){return _0x4411dd['status'](0x1f4)[_0xefcb('0x21')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xefcb('0x23')}]});}});_0xdc60e4[_0xefcb('0x24')](_0x16bb81);_0xdc60e4[_0xefcb('0x1e')]();}exports[_0xefcb('0x25')]=openIssue;exports[_0xefcb('0x26')]=function(_0x1d4057,_0x28fbc5){_0x1d4057[_0xefcb('0x27')]['ip']=_0x1d4057[_0xefcb('0x28')][_0xefcb('0x29')]||_0x1d4057[_0xefcb('0x2a')][_0xefcb('0x2b')]||_0x1d4057[_0xefcb('0x2c')][_0xefcb('0x2b')]||_0x1d4057[_0xefcb('0x2a')]['socket'][_0xefcb('0x2b')];return openIssue(_0x1d4057['body'],_0x28fbc5);}; \ No newline at end of file +var _0x2b86=['Report','\x20from\x20','description','issuetype','customfield_11500','email','fields','customfield_11501','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString','stringify','setEncoding','utf8','data','end','status','statusCode','json','parse','error','api.jira','openIssue','send','body','headers','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI'];(function(_0x4b4d43,_0x1590f7){var _0x5706ba=function(_0x11d99b){while(--_0x11d99b){_0x4b4d43['push'](_0x4b4d43['shift']());}};_0x5706ba(++_0x1590f7);}(_0x2b86,0xd9));var _0x62b8=function(_0x446c14,_0x1b3ae7){_0x446c14=_0x446c14-0x0;var _0x334e96=_0x2b86[_0x446c14];return _0x334e96;};'use strict';var BPromise=require(_0x62b8('0x0'));var https=require(_0x62b8('0x1'));var logger=require(_0x62b8('0x2'))(_0x62b8('0x3'));var USERNAME=_0x62b8('0x4');var PASSWORD=_0x62b8('0x5');function openIssue(_0x1ae6e8,_0x1d5a61){var _0x90a996={'fields':{'project':{'key':_0x1ae6e8[_0x62b8('0x6')]||_0x62b8('0x7')},'summary':(_0x1ae6e8['summary']||_0x62b8('0x8'))+_0x62b8('0x9')+_0x1ae6e8['ip'],'description':_0x1ae6e8[_0x62b8('0xa')]||JSON['stringify'](_0x1ae6e8),'issuetype':{'name':_0x1ae6e8[_0x62b8('0xb')]||'Bug'}}};_0x90a996['fields'][_0x62b8('0xc')]=_0x1ae6e8[_0x62b8('0xd')];_0x90a996[_0x62b8('0xe')][_0x62b8('0xf')]=_0x1ae6e8['oldToken'];_0x90a996[_0x62b8('0xe')][_0x62b8('0x10')]=_0x1ae6e8[_0x62b8('0x11')];_0x90a996[_0x62b8('0xe')]['customfield_11503']=_0x1ae6e8[_0x62b8('0x12')];_0x90a996[_0x62b8('0xe')][_0x62b8('0x13')]=_0x1ae6e8[_0x62b8('0x14')];_0x90a996[_0x62b8('0xe')][_0x62b8('0x15')]=_0x1ae6e8['ip'];var _0x59bf32={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x62b8('0x16'),'method':_0x62b8('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x62b8('0x18'),'Authorization':_0x62b8('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x62b8('0x1a')]('base64')}};var _0x3312bf=JSON[_0x62b8('0x1b')](_0x90a996);var _0x24db66=https['request'](_0x59bf32,function(_0x19450d){_0x19450d[_0x62b8('0x1c')](_0x62b8('0x1d'));var _0x9845b9='';_0x19450d['on'](_0x62b8('0x1e'),function(_0x524682){_0x9845b9+=_0x524682;});_0x19450d['on'](_0x62b8('0x1f'),function(){if(_0x1d5a61){return _0x1d5a61[_0x62b8('0x20')](_0x19450d[_0x62b8('0x21')])[_0x62b8('0x22')](JSON[_0x62b8('0x23')](_0x9845b9));}});});_0x24db66['on'](_0x62b8('0x24'),function(_0x9b475a){if(_0x1d5a61){return _0x1d5a61[_0x62b8('0x20')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x62b8('0x25')}]});}});_0x24db66['write'](_0x3312bf);_0x24db66['end']();}exports[_0x62b8('0x26')]=openIssue;exports[_0x62b8('0x27')]=function(_0x2ecd50,_0x83eed6){_0x2ecd50[_0x62b8('0x28')]['ip']=_0x2ecd50[_0x62b8('0x29')]['x-forwarded-for']||_0x2ecd50[_0x62b8('0x2a')][_0x62b8('0x2b')]||_0x2ecd50[_0x62b8('0x2c')][_0x62b8('0x2b')]||_0x2ecd50[_0x62b8('0x2a')][_0x62b8('0x2c')][_0x62b8('0x2b')];return openIssue(_0x2ecd50[_0x62b8('0x28')],_0x83eed6);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 6630dc5..73d786d 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 _0xb903=['../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','isAuthenticated','describe','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0xc3cfc8,_0x44b3ad){var _0x2725cd=function(_0x562497){while(--_0x562497){_0xc3cfc8['push'](_0xc3cfc8['shift']());}};_0x2725cd(++_0x44b3ad);}(_0xb903,0x185));var _0x3b90=function(_0x12c69c,_0x3e51a7){_0x12c69c=_0x12c69c-0x0;var _0x50417e=_0xb903[_0x12c69c];return _0x50417e;};'use strict';var multer=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var path=require(_0x3b90('0x2'));var timeout=require(_0x3b90('0x3'));var express=require('express');var router=express[_0x3b90('0x4')]();var fs_extra=require(_0x3b90('0x5'));var auth=require(_0x3b90('0x6'));var interaction=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var controller=require(_0x3b90('0x9'));router[_0x3b90('0xa')]('/',auth['isAuthenticated'](),controller[_0x3b90('0xb')]);router['get']('/describe',auth[_0x3b90('0xc')](),controller[_0x3b90('0xd')]);router[_0x3b90('0xa')](_0x3b90('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x3b90('0xe'),auth[_0x3b90('0xc')](),controller['update']);router[_0x3b90('0xf')](_0x3b90('0xe'),auth['isAuthenticated'](),controller[_0x3b90('0x10')]);module[_0x3b90('0x11')]=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(_0x5ef994,_0x3cdd3f){var _0xcf1480=function(_0x373d5d){while(--_0x373d5d){_0x5ef994['push'](_0x5ef994['shift']());}};_0xcf1480(++_0x3cdd3f);}(_0xb821,0xa7));var _0x1b82=function(_0x2aff54,_0x1c707f){_0x2aff54=_0x2aff54-0x0;var _0x526098=_0xb821[_0x2aff54];return _0x526098;};'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 dc52e92..e2211ff 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x7a54,0x106));var _0x47a5=function(_0x2b3f11,_0x288d3a){_0x2b3f11=_0x2b3f11-0x0;var _0x3494cc=_0x7a54[_0x2b3f11];return _0x3494cc;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7a54,0x106));var _0x47a5=function(_0x414739,_0x850533){_0x414739=_0x414739-0x0;var _0x85d3af=_0x7a54[_0x414739];return _0x85d3af;};'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 ec5fc9d..cc167ce 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 _0x1696=['count','limit','Content-Range','apply','reject','save','update','then','end','error','send','map','JscriptyAnswerReport','fieldName','type','model','keys','attributes','intersection','fields','hasOwnProperty','nolimit','query','order','sort','where','filters','pick','filter','merge','VIRTUAL','name','options','include','rows','show','length','includeAll','find','catch','create','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset'];(function(_0x51380e,_0x55b897){var _0x2ed390=function(_0x217cfe){while(--_0x217cfe){_0x51380e['push'](_0x51380e['shift']());}};_0x2ed390(++_0x55b897);}(_0x1696,0x79));var _0x6169=function(_0xb1b8a3,_0x3b5516){_0xb1b8a3=_0xb1b8a3-0x0;var _0xa48935=_0x1696[_0xb1b8a3];return _0xa48935;};'use strict';var emlformat=require(_0x6169('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6169('0x1'));var jsonpatch=require(_0x6169('0x2'));var rp=require(_0x6169('0x3'));var moment=require(_0x6169('0x4'));var BPromise=require(_0x6169('0x5'));var Mustache=require(_0x6169('0x6'));var util=require(_0x6169('0x7'));var path=require(_0x6169('0x8'));var sox=require(_0x6169('0x9'));var csv=require('to-csv');var ejs=require(_0x6169('0xa'));var fs=require('fs');var fs_extra=require(_0x6169('0xb'));var _=require(_0x6169('0xc'));var squel=require(_0x6169('0xd'));var crypto=require(_0x6169('0xe'));var jsforce=require(_0x6169('0xf'));var deskjs=require(_0x6169('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6169('0x11'));var Papa=require('papaparse');var Redis=require(_0x6169('0x12'));var authService=require(_0x6169('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6169('0x14'));var hardwareService=require(_0x6169('0x15'));var logger=require(_0x6169('0x16'))(_0x6169('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6169('0x18'));var db=require(_0x6169('0x19'))['db'];function respondWithStatusCode(_0x5f342e,_0x9288c4){_0x9288c4=_0x9288c4||0xcc;return function(_0x2d6570){if(_0x2d6570){return _0x5f342e[_0x6169('0x1a')](_0x9288c4);}return _0x5f342e['status'](_0x9288c4)['end']();};}function respondWithResult(_0x4ba7bf,_0x2829cf){_0x2829cf=_0x2829cf||0xc8;return function(_0x2171d1){if(_0x2171d1){return _0x4ba7bf[_0x6169('0x1b')](_0x2829cf)[_0x6169('0x1c')](_0x2171d1);}};}function respondWithFilteredResult(_0x3ffa76,_0x5837d8){return function(_0x461294){if(_0x461294){var _0x3e2eb4=typeof _0x5837d8['offset']===_0x6169('0x1d')&&typeof _0x5837d8['limit']===_0x6169('0x1d');var _0x1e3b4e=_0x461294['count'];var _0xdfe11e=_0x3e2eb4?0x0:_0x5837d8[_0x6169('0x1e')];var _0xd47fea=_0x3e2eb4?_0x461294[_0x6169('0x1f')]:_0x5837d8[_0x6169('0x1e')]+_0x5837d8[_0x6169('0x20')];var _0x2b2e20;if(_0xd47fea>=_0x1e3b4e){_0xd47fea=_0x1e3b4e;_0x2b2e20=0xc8;}else{_0x2b2e20=0xce;}_0x3ffa76['status'](_0x2b2e20);return _0x3ffa76['set'](_0x6169('0x21'),_0xdfe11e+'-'+_0xd47fea+'/'+_0x1e3b4e)[_0x6169('0x1c')](_0x461294);}return null;};}function patchUpdates(_0x486186){return function(_0x34675a){try{jsonpatch[_0x6169('0x22')](_0x34675a,_0x486186,!![]);}catch(_0x2f3ef3){return BPromise[_0x6169('0x23')](_0x2f3ef3);}return _0x34675a[_0x6169('0x24')]();};}function saveUpdates(_0x51598d,_0x2506bb){return function(_0x5579b9){if(_0x5579b9){return _0x5579b9[_0x6169('0x25')](_0x51598d)[_0x6169('0x26')](function(_0x13e390){return _0x13e390;});}return null;};}function removeEntity(_0x4b35ca,_0x3b0e8a){return function(_0x1f90aa){if(_0x1f90aa){return _0x1f90aa['destroy']()['then'](function(){_0x4b35ca[_0x6169('0x1b')](0xcc)[_0x6169('0x27')]();});}};}function handleEntityNotFound(_0x3e706c,_0x20b40c){return function(_0x1b207e){if(!_0x1b207e){_0x3e706c[_0x6169('0x1a')](0x194);}return _0x1b207e;};}function handleError(_0x647f57,_0x3010f7){_0x3010f7=_0x3010f7||0x1f4;return function(_0x5f2e3b){logger[_0x6169('0x28')](_0x5f2e3b['stack']);if(_0x5f2e3b['name']){delete _0x5f2e3b['name'];}_0x647f57['status'](_0x3010f7)[_0x6169('0x29')](_0x5f2e3b);};}exports['index']=function(_0x4466f3,_0x136d11){var _0x15bef9={},_0x512977={},_0x51e2ea={'count':0x0,'rows':[]};var _0x544dcc=_[_0x6169('0x2a')](db[_0x6169('0x2b')]['rawAttributes'],function(_0x4c6036){return{'name':_0x4c6036[_0x6169('0x2c')],'type':_0x4c6036[_0x6169('0x2d')]['key']};});_0x512977[_0x6169('0x2e')]=_[_0x6169('0x2a')](_0x544dcc,'name');_0x512977['query']=_[_0x6169('0x2f')](_0x4466f3['query']);_0x512977['filters']=_['intersection'](_0x512977[_0x6169('0x2e')],_0x512977['query']);_0x15bef9[_0x6169('0x30')]=_[_0x6169('0x31')](_0x512977['model'],qs[_0x6169('0x32')](_0x4466f3['query'][_0x6169('0x32')]));_0x15bef9[_0x6169('0x30')]=_0x15bef9[_0x6169('0x30')]['length']?_0x15bef9['attributes']:_0x512977['model'];if(!_0x4466f3['query'][_0x6169('0x33')](_0x6169('0x34'))){_0x15bef9['limit']=qs[_0x6169('0x20')](_0x4466f3[_0x6169('0x35')][_0x6169('0x20')]);_0x15bef9['offset']=qs[_0x6169('0x1e')](_0x4466f3[_0x6169('0x35')][_0x6169('0x1e')]);}_0x15bef9[_0x6169('0x36')]=qs[_0x6169('0x37')](_0x4466f3[_0x6169('0x35')][_0x6169('0x37')]);_0x15bef9[_0x6169('0x38')]=qs[_0x6169('0x39')](_[_0x6169('0x3a')](_0x4466f3[_0x6169('0x35')],_0x512977['filters']),_0x544dcc);if(_0x4466f3[_0x6169('0x35')][_0x6169('0x3b')]){_0x15bef9['where']=_[_0x6169('0x3c')](_0x15bef9[_0x6169('0x38')],{'$or':_[_0x6169('0x2a')](_0x544dcc,function(_0xdfce5f){if(_0xdfce5f[_0x6169('0x2d')]!==_0x6169('0x3d')){var _0x388ca5={};_0x388ca5[_0xdfce5f[_0x6169('0x3e')]]={'$like':'%'+_0x4466f3[_0x6169('0x35')]['filter']+'%'};return _0x388ca5;}})});}_0x15bef9=_[_0x6169('0x3c')]({},_0x15bef9,_0x4466f3[_0x6169('0x3f')]);var _0x273730={'where':_0x15bef9['where']};return db[_0x6169('0x2b')][_0x6169('0x1f')](_0x273730)['then'](function(_0x3026d7){_0x51e2ea['count']=_0x3026d7;if(_0x4466f3[_0x6169('0x35')]['includeAll']){_0x15bef9[_0x6169('0x40')]=[{'all':!![]}];}return db[_0x6169('0x2b')]['findAll'](_0x15bef9);})[_0x6169('0x26')](function(_0x4969e3){_0x51e2ea[_0x6169('0x41')]=_0x4969e3;return _0x51e2ea;})[_0x6169('0x26')](respondWithFilteredResult(_0x136d11,_0x15bef9))['catch'](handleError(_0x136d11,null));};exports[_0x6169('0x42')]=function(_0x4b07e8,_0x34ad06){var _0x545863={'raw':!![],'where':{'id':_0x4b07e8['params']['id']}},_0x1a7849={};_0x1a7849['model']=_[_0x6169('0x2f')](db[_0x6169('0x2b')]['rawAttributes']);_0x1a7849[_0x6169('0x35')]=_['keys'](_0x4b07e8[_0x6169('0x35')]);_0x1a7849[_0x6169('0x39')]=_['intersection'](_0x1a7849[_0x6169('0x2e')],_0x1a7849['query']);_0x545863['attributes']=_[_0x6169('0x31')](_0x1a7849[_0x6169('0x2e')],qs['fields'](_0x4b07e8[_0x6169('0x35')]['fields']));_0x545863[_0x6169('0x30')]=_0x545863[_0x6169('0x30')][_0x6169('0x43')]?_0x545863['attributes']:_0x1a7849[_0x6169('0x2e')];if(_0x4b07e8[_0x6169('0x35')][_0x6169('0x44')]){_0x545863[_0x6169('0x40')]=[{'all':!![]}];}_0x545863=_[_0x6169('0x3c')]({},_0x545863,_0x4b07e8[_0x6169('0x3f')]);return db['JscriptyAnswerReport'][_0x6169('0x45')](_0x545863)[_0x6169('0x26')](handleEntityNotFound(_0x34ad06,null))[_0x6169('0x26')](respondWithResult(_0x34ad06,null))[_0x6169('0x46')](handleError(_0x34ad06,null));};exports[_0x6169('0x47')]=function(_0x4d004e,_0x4ab194){return db[_0x6169('0x2b')][_0x6169('0x47')](_0x4d004e[_0x6169('0x48')],{})[_0x6169('0x26')](respondWithResult(_0x4ab194,0xc9))[_0x6169('0x46')](handleError(_0x4ab194,null));};exports[_0x6169('0x25')]=function(_0x11bc4b,_0xcffe00){if(_0x11bc4b[_0x6169('0x48')]['id']){delete _0x11bc4b[_0x6169('0x48')]['id'];}return db[_0x6169('0x2b')]['find']({'where':{'id':_0x11bc4b[_0x6169('0x49')]['id']}})['then'](handleEntityNotFound(_0xcffe00,null))[_0x6169('0x26')](saveUpdates(_0x11bc4b[_0x6169('0x48')],null))['then'](respondWithResult(_0xcffe00,null))[_0x6169('0x46')](handleError(_0xcffe00,null));};exports[_0x6169('0x4a')]=function(_0x291a5b,_0x1dd004){return db['JscriptyAnswerReport'][_0x6169('0x45')]({'where':{'id':_0x291a5b['params']['id']}})[_0x6169('0x26')](handleEntityNotFound(_0x1dd004,null))[_0x6169('0x26')](removeEntity(_0x1dd004,null))[_0x6169('0x46')](handleError(_0x1dd004,null));};exports[_0x6169('0x4b')]=function(_0x38c8cd,_0x559522){return db[_0x6169('0x2b')]['describe']()[_0x6169('0x26')](respondWithResult(_0x559522,null))[_0x6169('0x46')](handleError(_0x559522,null));}; \ No newline at end of file +var _0x16a6=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x30638e,_0x4e6897){var _0x221639=function(_0x56fc0a){while(--_0x56fc0a){_0x30638e['push'](_0x30638e['shift']());}};_0x221639(++_0x4e6897);}(_0x16a6,0x15c));var _0x616a=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x16a6[_0x489b87];return _0x1823b6;};'use strict';var emlformat=require(_0x616a('0x0'));var rimraf=require(_0x616a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x616a('0x2'));var rp=require(_0x616a('0x3'));var moment=require(_0x616a('0x4'));var BPromise=require(_0x616a('0x5'));var Mustache=require(_0x616a('0x6'));var util=require(_0x616a('0x7'));var path=require('path');var sox=require(_0x616a('0x8'));var csv=require(_0x616a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x616a('0xa'));var squel=require(_0x616a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x616a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x616a('0xd'));var Papa=require('papaparse');var Redis=require(_0x616a('0xe'));var authService=require(_0x616a('0xf'));var qs=require(_0x616a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x616a('0x11'));var logger=require(_0x616a('0x12'))(_0x616a('0x13'));var utils=require(_0x616a('0x14'));var config=require(_0x616a('0x15'));var licenseUtil=require(_0x616a('0x16'));var db=require(_0x616a('0x17'))['db'];function respondWithStatusCode(_0x4122b7,_0x5755c7){_0x5755c7=_0x5755c7||0xcc;return function(_0x318dfe){if(_0x318dfe){return _0x4122b7[_0x616a('0x18')](_0x5755c7);}return _0x4122b7[_0x616a('0x19')](_0x5755c7)[_0x616a('0x1a')]();};}function respondWithResult(_0x295fc2,_0x4a33d5){_0x4a33d5=_0x4a33d5||0xc8;return function(_0x1399c1){if(_0x1399c1){return _0x295fc2[_0x616a('0x19')](_0x4a33d5)[_0x616a('0x1b')](_0x1399c1);}};}function respondWithFilteredResult(_0x18b6dc,_0x3bcf20){return function(_0x53f228){if(_0x53f228){var _0x204e68=typeof _0x3bcf20[_0x616a('0x1c')]==='undefined'&&typeof _0x3bcf20['limit']===_0x616a('0x1d');var _0x4768b2=_0x53f228[_0x616a('0x1e')];var _0x4d59e7=_0x204e68?0x0:_0x3bcf20[_0x616a('0x1c')];var _0x1f3241=_0x204e68?_0x53f228['count']:_0x3bcf20['offset']+_0x3bcf20[_0x616a('0x1f')];var _0x27e95c;if(_0x1f3241>=_0x4768b2){_0x1f3241=_0x4768b2;_0x27e95c=0xc8;}else{_0x27e95c=0xce;}_0x18b6dc[_0x616a('0x19')](_0x27e95c);return _0x18b6dc[_0x616a('0x20')]('Content-Range',_0x4d59e7+'-'+_0x1f3241+'/'+_0x4768b2)['json'](_0x53f228);}return null;};}function patchUpdates(_0x5568fd){return function(_0x5f2e80){try{jsonpatch['apply'](_0x5f2e80,_0x5568fd,!![]);}catch(_0x5ee3f2){return BPromise[_0x616a('0x21')](_0x5ee3f2);}return _0x5f2e80['save']();};}function saveUpdates(_0xb8ceeb,_0x137974){return function(_0x4f5594){if(_0x4f5594){return _0x4f5594[_0x616a('0x22')](_0xb8ceeb)[_0x616a('0x23')](function(_0x3d484b){return _0x3d484b;});}return null;};}function removeEntity(_0x100c98,_0x500c22){return function(_0x2db2bb){if(_0x2db2bb){return _0x2db2bb[_0x616a('0x24')]()[_0x616a('0x23')](function(){_0x100c98[_0x616a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e11f2,_0x4be8a8){return function(_0x30c1a){if(!_0x30c1a){_0x3e11f2[_0x616a('0x18')](0x194);}return _0x30c1a;};}function handleError(_0x5f1e6a,_0x55abc8){_0x55abc8=_0x55abc8||0x1f4;return function(_0x50c6b8){logger[_0x616a('0x25')](_0x50c6b8[_0x616a('0x26')]);if(_0x50c6b8[_0x616a('0x27')]){delete _0x50c6b8[_0x616a('0x27')];}_0x5f1e6a['status'](_0x55abc8)[_0x616a('0x28')](_0x50c6b8);};}exports[_0x616a('0x29')]=function(_0x195b73,_0x163fd0){var _0x28ca50={},_0x87db00={},_0x41a22d={'count':0x0,'rows':[]};var _0x5f3a59=_[_0x616a('0x2a')](db[_0x616a('0x2b')]['rawAttributes'],function(_0x41f722){return{'name':_0x41f722['fieldName'],'type':_0x41f722['type'][_0x616a('0x2c')]};});_0x87db00[_0x616a('0x2d')]=_[_0x616a('0x2a')](_0x5f3a59,'name');_0x87db00[_0x616a('0x2e')]=_[_0x616a('0x2f')](_0x195b73[_0x616a('0x2e')]);_0x87db00[_0x616a('0x30')]=_[_0x616a('0x31')](_0x87db00[_0x616a('0x2d')],_0x87db00['query']);_0x28ca50[_0x616a('0x32')]=_['intersection'](_0x87db00[_0x616a('0x2d')],qs[_0x616a('0x33')](_0x195b73[_0x616a('0x2e')]['fields']));_0x28ca50[_0x616a('0x32')]=_0x28ca50[_0x616a('0x32')]['length']?_0x28ca50['attributes']:_0x87db00[_0x616a('0x2d')];if(!_0x195b73[_0x616a('0x2e')][_0x616a('0x34')](_0x616a('0x35'))){_0x28ca50['limit']=qs['limit'](_0x195b73['query'][_0x616a('0x1f')]);_0x28ca50[_0x616a('0x1c')]=qs[_0x616a('0x1c')](_0x195b73[_0x616a('0x2e')][_0x616a('0x1c')]);}_0x28ca50[_0x616a('0x36')]=qs[_0x616a('0x37')](_0x195b73[_0x616a('0x2e')][_0x616a('0x37')]);_0x28ca50[_0x616a('0x38')]=qs['filters'](_[_0x616a('0x39')](_0x195b73['query'],_0x87db00[_0x616a('0x30')]),_0x5f3a59);if(_0x195b73[_0x616a('0x2e')][_0x616a('0x3a')]){_0x28ca50[_0x616a('0x38')]=_[_0x616a('0x3b')](_0x28ca50[_0x616a('0x38')],{'$or':_[_0x616a('0x2a')](_0x5f3a59,function(_0x220c32){if(_0x220c32[_0x616a('0x3c')]!=='VIRTUAL'){var _0x304e27={};_0x304e27[_0x220c32[_0x616a('0x27')]]={'$like':'%'+_0x195b73[_0x616a('0x2e')][_0x616a('0x3a')]+'%'};return _0x304e27;}})});}_0x28ca50=_['merge']({},_0x28ca50,_0x195b73[_0x616a('0x3d')]);var _0x4c6a76={'where':_0x28ca50[_0x616a('0x38')]};return db['JscriptyAnswerReport'][_0x616a('0x1e')](_0x4c6a76)[_0x616a('0x23')](function(_0x598085){_0x41a22d[_0x616a('0x1e')]=_0x598085;if(_0x195b73['query'][_0x616a('0x3e')]){_0x28ca50[_0x616a('0x3f')]=[{'all':!![]}];}return db[_0x616a('0x2b')][_0x616a('0x40')](_0x28ca50);})[_0x616a('0x23')](function(_0x21fd2b){_0x41a22d[_0x616a('0x41')]=_0x21fd2b;return _0x41a22d;})['then'](respondWithFilteredResult(_0x163fd0,_0x28ca50))[_0x616a('0x42')](handleError(_0x163fd0,null));};exports['show']=function(_0x409689,_0x35e3e3){var _0x199140={'raw':!![],'where':{'id':_0x409689[_0x616a('0x43')]['id']}},_0x4dbb8b={};_0x4dbb8b[_0x616a('0x2d')]=_[_0x616a('0x2f')](db[_0x616a('0x2b')][_0x616a('0x44')]);_0x4dbb8b['query']=_[_0x616a('0x2f')](_0x409689[_0x616a('0x2e')]);_0x4dbb8b[_0x616a('0x30')]=_['intersection'](_0x4dbb8b[_0x616a('0x2d')],_0x4dbb8b[_0x616a('0x2e')]);_0x199140[_0x616a('0x32')]=_[_0x616a('0x31')](_0x4dbb8b[_0x616a('0x2d')],qs[_0x616a('0x33')](_0x409689[_0x616a('0x2e')]['fields']));_0x199140[_0x616a('0x32')]=_0x199140[_0x616a('0x32')]['length']?_0x199140['attributes']:_0x4dbb8b[_0x616a('0x2d')];if(_0x409689[_0x616a('0x2e')][_0x616a('0x3e')]){_0x199140[_0x616a('0x3f')]=[{'all':!![]}];}_0x199140=_[_0x616a('0x3b')]({},_0x199140,_0x409689[_0x616a('0x3d')]);return db['JscriptyAnswerReport'][_0x616a('0x45')](_0x199140)[_0x616a('0x23')](handleEntityNotFound(_0x35e3e3,null))[_0x616a('0x23')](respondWithResult(_0x35e3e3,null))['catch'](handleError(_0x35e3e3,null));};exports[_0x616a('0x46')]=function(_0x507efa,_0x52d38){return db[_0x616a('0x2b')][_0x616a('0x46')](_0x507efa[_0x616a('0x47')],{})['then'](respondWithResult(_0x52d38,0xc9))[_0x616a('0x42')](handleError(_0x52d38,null));};exports[_0x616a('0x22')]=function(_0x3bea90,_0x3d42fc){if(_0x3bea90[_0x616a('0x47')]['id']){delete _0x3bea90['body']['id'];}return db[_0x616a('0x2b')][_0x616a('0x45')]({'where':{'id':_0x3bea90[_0x616a('0x43')]['id']}})[_0x616a('0x23')](handleEntityNotFound(_0x3d42fc,null))[_0x616a('0x23')](saveUpdates(_0x3bea90[_0x616a('0x47')],null))['then'](respondWithResult(_0x3d42fc,null))[_0x616a('0x42')](handleError(_0x3d42fc,null));};exports[_0x616a('0x24')]=function(_0x349cd0,_0x16e6c2){return db['JscriptyAnswerReport'][_0x616a('0x45')]({'where':{'id':_0x349cd0['params']['id']}})[_0x616a('0x23')](handleEntityNotFound(_0x16e6c2,null))[_0x616a('0x23')](removeEntity(_0x16e6c2,null))['catch'](handleError(_0x16e6c2,null));};exports[_0x616a('0x48')]=function(_0x1ea086,_0x30a48e){return db['JscriptyAnswerReport'][_0x616a('0x48')]()[_0x616a('0x23')](respondWithResult(_0x30a48e,null))[_0x616a('0x42')](handleError(_0x30a48e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 8403eb5..904bd00 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 _0x7a7e=['request-promise','path','rimraf','../../config/environment','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','moment','bluebird'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0x7a7e,0x74));var _0xe7a7=function(_0x236deb,_0x2f4aef){_0x236deb=_0x236deb-0x0;var _0xa7d4e2=_0x7a7e[_0x236deb];return _0xa7d4e2;};'use strict';var _=require(_0xe7a7('0x0'));var util=require(_0xe7a7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe7a7('0x2'));var BPromise=require(_0xe7a7('0x3'));var rp=require(_0xe7a7('0x4'));var fs=require('fs');var path=require(_0xe7a7('0x5'));var rimraf=require(_0xe7a7('0x6'));var config=require(_0xe7a7('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xe7a7('0x8')]=function(_0x479774,_0x4087f5){return _0x479774[_0xe7a7('0x9')](_0xe7a7('0xa'),attributes,{'tableName':_0xe7a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae59=['exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes'];(function(_0x2d3f8a,_0x4f0d06){var _0x52343d=function(_0x597c2a){while(--_0x597c2a){_0x2d3f8a['push'](_0x2d3f8a['shift']());}};_0x52343d(++_0x4f0d06);}(_0xae59,0x1cb));var _0x9ae5=function(_0x1e7b27,_0x3cae98){_0x1e7b27=_0x1e7b27-0x0;var _0x44e87c=_0xae59[_0x1e7b27];return _0x44e87c;};'use strict';var _=require(_0x9ae5('0x0'));var util=require('util');var logger=require(_0x9ae5('0x1'))(_0x9ae5('0x2'));var moment=require(_0x9ae5('0x3'));var BPromise=require(_0x9ae5('0x4'));var rp=require(_0x9ae5('0x5'));var fs=require('fs');var path=require(_0x9ae5('0x6'));var rimraf=require(_0x9ae5('0x7'));var config=require('../../config/environment');var attributes=require(_0x9ae5('0x8'));module[_0x9ae5('0x9')]=function(_0x5729b0,_0x2da7db){return _0x5729b0[_0x9ae5('0xa')](_0x9ae5('0xb'),attributes,{'tableName':_0x9ae5('0xc'),'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 3bace2f..c2a75ab 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 _0x131d=['code','message','error','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x44e75a,_0x1a0a06){var _0x261782=function(_0x3686b5){while(--_0x3686b5){_0x44e75a['push'](_0x44e75a['shift']());}};_0x261782(++_0x1a0a06);}(_0x131d,0x1bb));var _0xd131=function(_0x57ff6e,_0x5135ac){_0x57ff6e=_0x57ff6e-0x0;var _0x18420d=_0x131d[_0x57ff6e];return _0x18420d;};'use strict';var _=require(_0xd131('0x0'));var util=require(_0xd131('0x1'));var moment=require(_0xd131('0x2'));var BPromise=require('bluebird');var rs=require(_0xd131('0x3'));var fs=require('fs');var Redis=require(_0xd131('0x4'));var db=require(_0xd131('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd131('0x6'))(_0xd131('0x7'));var config=require(_0xd131('0x8'));var jayson=require(_0xd131('0x9'));var client=jayson['client'][_0xd131('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b0441,_0x3c6614,_0x2d7f5a){return new BPromise(function(_0x50d61b,_0x3035da){return client['request'](_0x4b0441,_0x2d7f5a)[_0xd131('0xb')](function(_0x2b61e3){logger[_0xd131('0xc')](_0xd131('0xd'),_0x3c6614,'request\x20sent');logger[_0xd131('0xe')](_0xd131('0xf'),_0x3c6614,'request\x20sent',JSON[_0xd131('0x10')](_0x2b61e3));if(_0x2b61e3['error']){if(_0x2b61e3['error'][_0xd131('0x11')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3c6614,_0x2b61e3['error'][_0xd131('0x12')]);return _0x3035da(_0x2b61e3[_0xd131('0x13')][_0xd131('0x12')]);}logger[_0xd131('0x13')](_0xd131('0xd'),_0x3c6614,_0x2b61e3[_0xd131('0x13')][_0xd131('0x12')]);return _0x50d61b(_0x2b61e3[_0xd131('0x13')][_0xd131('0x12')]);}else{logger[_0xd131('0xc')](_0xd131('0xd'),_0x3c6614,'request\x20sent');_0x50d61b(_0x2b61e3['result'][_0xd131('0x12')]);}})['catch'](function(_0x35151c){logger['error'](_0xd131('0xd'),_0x3c6614,_0x35151c);_0x3035da(_0x35151c);});});} \ No newline at end of file +var _0xb7fe=['util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash'];(function(_0x4c7b20,_0x361515){var _0x4872bd=function(_0x358e19){while(--_0x358e19){_0x4c7b20['push'](_0x4c7b20['shift']());}};_0x4872bd(++_0x361515);}(_0xb7fe,0x168));var _0xeb7f=function(_0x8c7ccf,_0xe3f870){_0x8c7ccf=_0x8c7ccf-0x0;var _0x54f922=_0xb7fe[_0x8c7ccf];return _0x54f922;};'use strict';var _=require(_0xeb7f('0x0'));var util=require(_0xeb7f('0x1'));var moment=require(_0xeb7f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb7f('0x3'));var db=require(_0xeb7f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xeb7f('0x5'));var config=require(_0xeb7f('0x6'));var jayson=require(_0xeb7f('0x7'));var client=jayson[_0xeb7f('0x8')][_0xeb7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13f4d0,_0x3c0b16,_0x3a0ccd){return new BPromise(function(_0x21c47a,_0x1a24fe){return client[_0xeb7f('0xa')](_0x13f4d0,_0x3a0ccd)['then'](function(_0x25c4ee){logger[_0xeb7f('0xb')](_0xeb7f('0xc'),_0x3c0b16,_0xeb7f('0xd'));logger[_0xeb7f('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3c0b16,_0xeb7f('0xd'),JSON['stringify'](_0x25c4ee));if(_0x25c4ee[_0xeb7f('0xf')]){if(_0x25c4ee['error'][_0xeb7f('0x10')]===0x1f4){logger[_0xeb7f('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3c0b16,_0x25c4ee['error'][_0xeb7f('0x11')]);return _0x1a24fe(_0x25c4ee[_0xeb7f('0xf')]['message']);}logger[_0xeb7f('0xf')](_0xeb7f('0xc'),_0x3c0b16,_0x25c4ee['error']['message']);return _0x21c47a(_0x25c4ee[_0xeb7f('0xf')][_0xeb7f('0x11')]);}else{logger[_0xeb7f('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3c0b16,'request\x20sent');_0x21c47a(_0x25c4ee[_0xeb7f('0x12')][_0xeb7f('0x11')]);}})['catch'](function(_0x4a25c6){logger[_0xeb7f('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3c0b16,_0x4a25c6);_0x1a24fe(_0x4a25c6);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 571a323..0ee48f4 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 _0x0b71=['isAuthenticated','get','/:id/sessions','/:id/answers','/:id/summary','30s','getSummary','post','clone','put','update','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','index','/:id'];(function(_0x4c8c40,_0x24cf22){var _0x1732e0=function(_0x29545a){while(--_0x29545a){_0x4c8c40['push'](_0x4c8c40['shift']());}};_0x1732e0(++_0x24cf22);}(_0x0b71,0xd2));var _0x10b7=function(_0x51e77b,_0x4d4926){_0x51e77b=_0x51e77b-0x0;var _0x1dfcf9=_0x0b71[_0x51e77b];return _0x1dfcf9;};'use strict';var multer=require(_0x10b7('0x0'));var util=require(_0x10b7('0x1'));var path=require(_0x10b7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x10b7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x10b7('0x4'));var interaction=require(_0x10b7('0x5'));var config=require(_0x10b7('0x6'));var controller=require(_0x10b7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x10b7('0x8')]);router['get'](_0x10b7('0x9'),auth[_0x10b7('0xa')](),controller['show']);router[_0x10b7('0xb')](_0x10b7('0xc'),auth[_0x10b7('0xa')](),controller['getSessions']);router[_0x10b7('0xb')](_0x10b7('0xd'),auth[_0x10b7('0xa')](),controller['getAnswers']);router['get'](_0x10b7('0xe'),auth[_0x10b7('0xa')](),timeout(_0x10b7('0xf')),controller[_0x10b7('0x10')]);router[_0x10b7('0x11')]('/',auth[_0x10b7('0xa')](),controller['create']);router[_0x10b7('0x11')]('/:id/clone',auth['isAuthenticated'](),controller[_0x10b7('0x12')]);router[_0x10b7('0x13')]('/:id',auth[_0x10b7('0xa')](),controller[_0x10b7('0x14')]);router['delete'](_0x10b7('0x9'),auth['isAuthenticated'](),controller[_0x10b7('0x15')]);module['exports']=router; \ No newline at end of file +var _0xc87c=['../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','/:id/clone','clone','put','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0xc87c,0x92));var _0xcc87=function(_0x2d6c64,_0x8348a5){_0x2d6c64=_0x2d6c64-0x0;var _0x28c971=_0xc87c[_0x2d6c64];return _0x28c971;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xcc87('0x0'));var express=require(_0xcc87('0x1'));var router=express[_0xcc87('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xcc87('0x3'));var interaction=require(_0xcc87('0x4'));var config=require(_0xcc87('0x5'));var controller=require(_0xcc87('0x6'));router[_0xcc87('0x7')]('/',auth[_0xcc87('0x8')](),controller[_0xcc87('0x9')]);router[_0xcc87('0x7')](_0xcc87('0xa'),auth[_0xcc87('0x8')](),controller[_0xcc87('0xb')]);router[_0xcc87('0x7')]('/:id/sessions',auth['isAuthenticated'](),controller[_0xcc87('0xc')]);router[_0xcc87('0x7')](_0xcc87('0xd'),auth[_0xcc87('0x8')](),controller[_0xcc87('0xe')]);router[_0xcc87('0x7')](_0xcc87('0xf'),auth[_0xcc87('0x8')](),timeout('30s'),controller[_0xcc87('0x10')]);router[_0xcc87('0x11')]('/',auth[_0xcc87('0x8')](),controller['create']);router[_0xcc87('0x11')](_0xcc87('0x12'),auth[_0xcc87('0x8')](),controller[_0xcc87('0x13')]);router[_0xcc87('0x14')](_0xcc87('0xa'),auth[_0xcc87('0x8')](),controller[_0xcc87('0x15')]);router[_0xcc87('0x16')](_0xcc87('0xa'),auth[_0xcc87('0x8')](),controller[_0xcc87('0x17')]);module[_0xcc87('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 344765d..622c4ca 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 _0xeb59=['setDataValue','formData','format','getDataValue','BOOLEAN','lodash','util','exports','name','TEXT','long','isObjectLike','stringify','isString'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xeb59,0x1e1));var _0x9eb5=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0xeb59[_0x26b5ff];return _0x58603e;};'use strict';var Sequelize=require('sequelize');var _=require(_0x9eb5('0x0'));var util=require(_0x9eb5('0x1'));module[_0x9eb5('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x9eb5('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x9eb5('0x4')](_0x9eb5('0x5')),'set':function(_0x197c3f){if(_[_0x9eb5('0x6')](_0x197c3f)){this['setDataValue']('formData',JSON[_0x9eb5('0x7')](_0x197c3f));}else if(_[_0x9eb5('0x8')](_0x197c3f)){this[_0x9eb5('0x9')](_0x9eb5('0xa'),_0x197c3f);}else{this[_0x9eb5('0x9')](_0x9eb5('0xa'),util[_0x9eb5('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0x9eb5('0x3'))||'',this[_0x9eb5('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9eb5('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x9eb5('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x1235=['description','BOOLEAN','lodash','util','name','STRING','TEXT','long','isObjectLike','setDataValue','formData','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1235,0x15b));var _0x5123=function(_0x58bec0,_0x55a389){_0x58bec0=_0x58bec0-0x0;var _0x2ade3c=_0x1235[_0x58bec0];return _0x2ade3c;};'use strict';var Sequelize=require('sequelize');var _=require(_0x5123('0x0'));var util=require(_0x5123('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5123('0x2')},'description':{'type':Sequelize[_0x5123('0x3')]},'formData':{'type':Sequelize[_0x5123('0x4')](_0x5123('0x5')),'set':function(_0x325a3e){if(_[_0x5123('0x6')](_0x325a3e)){this[_0x5123('0x7')](_0x5123('0x8'),JSON['stringify'](_0x325a3e));}else if(_[_0x5123('0x9')](_0x325a3e)){this[_0x5123('0x7')](_0x5123('0x8'),_0x325a3e);}else{this[_0x5123('0x7')](_0x5123('0x8'),util[_0x5123('0xa')](_0x5123('0xb'),this[_0x5123('0xc')](_0x5123('0x2'))||'',this['getDataValue'](_0x5123('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x5123('0xe')],'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 a156514..21f4dfe 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 _0x04fa=['map','JscriptyProject','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','clone','find','omit','updatedAt','body','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','sort','ProjectId','JscriptySessionReport','findAll','getAnswers','pick','fromCharCode','toString','indexOf','replace','getSummary','parse','startTime','-createdAt','questionId','question','format','SessionId','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','Projects','UserProfileResource','sendStatus','error','stack','name','send'];(function(_0x26e89e,_0xacad9){var _0x5bf1d3=function(_0x53cbf8){while(--_0x53cbf8){_0x26e89e['push'](_0x26e89e['shift']());}};_0x5bf1d3(++_0xacad9);}(_0x04fa,0x119));var _0xa04f=function(_0x54ed19,_0x5b07a4){_0x54ed19=_0x54ed19-0x0;var _0x5bdb82=_0x04fa[_0x54ed19];return _0x5bdb82;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa04f('0x0'));var zipdir=require(_0xa04f('0x1'));var jsonpatch=require(_0xa04f('0x2'));var rp=require(_0xa04f('0x3'));var moment=require(_0xa04f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa04f('0x5'));var util=require('util');var path=require(_0xa04f('0x6'));var sox=require(_0xa04f('0x7'));var csv=require(_0xa04f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa04f('0x9'));var _=require(_0xa04f('0xa'));var squel=require(_0xa04f('0xb'));var crypto=require('crypto');var jsforce=require(_0xa04f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa04f('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa04f('0xe'));var hardwareService=require(_0xa04f('0xf'));var logger=require('../../config/logger')(_0xa04f('0x10'));var utils=require('../../config/utils');var config=require(_0xa04f('0x11'));var licenseUtil=require(_0xa04f('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x155b4f,_0x46687a){_0x46687a=_0x46687a||0xcc;return function(_0x5671c2){if(_0x5671c2){return _0x155b4f['sendStatus'](_0x46687a);}return _0x155b4f['status'](_0x46687a)[_0xa04f('0x13')]();};}function respondWithResult(_0x3254ea,_0x3d57cb){_0x3d57cb=_0x3d57cb||0xc8;return function(_0xb396b){if(_0xb396b){return _0x3254ea[_0xa04f('0x14')](_0x3d57cb)[_0xa04f('0x15')](_0xb396b);}};}function respondWithFilteredResult(_0x5b4afd,_0xf25bd){return function(_0x2737f2){if(_0x2737f2){var _0x509830=typeof _0xf25bd[_0xa04f('0x16')]===_0xa04f('0x17')&&typeof _0xf25bd[_0xa04f('0x18')]===_0xa04f('0x17');var _0x4e5908=_0x2737f2[_0xa04f('0x19')];var _0x5d59d5=_0x509830?0x0:_0xf25bd[_0xa04f('0x16')];var _0x25bb59=_0x509830?_0x2737f2['count']:_0xf25bd[_0xa04f('0x16')]+_0xf25bd[_0xa04f('0x18')];var _0x31e707;if(_0x25bb59>=_0x4e5908){_0x25bb59=_0x4e5908;_0x31e707=0xc8;}else{_0x31e707=0xce;}_0x5b4afd['status'](_0x31e707);return _0x5b4afd['set'](_0xa04f('0x1a'),_0x5d59d5+'-'+_0x25bb59+'/'+_0x4e5908)['json'](_0x2737f2);}return null;};}function patchUpdates(_0x5d68f4){return function(_0x141fc8){try{jsonpatch[_0xa04f('0x1b')](_0x141fc8,_0x5d68f4,!![]);}catch(_0x48f760){return BPromise['reject'](_0x48f760);}return _0x141fc8[_0xa04f('0x1c')]();};}function saveUpdates(_0x13fdb1,_0x17d471){return function(_0x3f7268){if(_0x3f7268){return _0x3f7268[_0xa04f('0x1d')](_0x13fdb1)[_0xa04f('0x1e')](function(_0x600bfa){return _0x600bfa;});}return null;};}function removeEntity(_0x40bc69,_0x28dc9b){return function(_0x3ee16d){if(_0x3ee16d){return _0x3ee16d[_0xa04f('0x1f')]()[_0xa04f('0x1e')](function(){var _0x10ae93=_0x3ee16d[_0xa04f('0x20')]({'plain':!![]});var _0x5123db=_0xa04f('0x21');return db[_0xa04f('0x22')][_0xa04f('0x1f')]({'where':{'type':_0x5123db,'resourceId':_0x10ae93['id']}})['then'](function(){return _0x3ee16d;});})['then'](function(){_0x40bc69[_0xa04f('0x14')](0xcc)[_0xa04f('0x13')]();});}};}function handleEntityNotFound(_0x12fac3,_0x5250b6){return function(_0x1a8aa1){if(!_0x1a8aa1){_0x12fac3[_0xa04f('0x23')](0x194);}return _0x1a8aa1;};}function handleError(_0x3d50c9,_0x5c27cc){_0x5c27cc=_0x5c27cc||0x1f4;return function(_0x3c6ccd){logger[_0xa04f('0x24')](_0x3c6ccd[_0xa04f('0x25')]);if(_0x3c6ccd[_0xa04f('0x26')]){delete _0x3c6ccd[_0xa04f('0x26')];}_0x3d50c9[_0xa04f('0x14')](_0x5c27cc)[_0xa04f('0x27')](_0x3c6ccd);};}exports['index']=function(_0x406131,_0x3e3395){var _0x5f4202={},_0x5577b4={},_0x27f968={'count':0x0,'rows':[]};var _0x37869f=_[_0xa04f('0x28')](db[_0xa04f('0x29')][_0xa04f('0x2a')],function(_0x1647ae){return{'name':_0x1647ae['fieldName'],'type':_0x1647ae[_0xa04f('0x2b')][_0xa04f('0x2c')]};});_0x5577b4[_0xa04f('0x2d')]=_['map'](_0x37869f,'name');_0x5577b4['query']=_[_0xa04f('0x2e')](_0x406131[_0xa04f('0x2f')]);_0x5577b4[_0xa04f('0x30')]=_['intersection'](_0x5577b4['model'],_0x5577b4[_0xa04f('0x2f')]);_0x5f4202[_0xa04f('0x31')]=_[_0xa04f('0x32')](_0x5577b4[_0xa04f('0x2d')],qs[_0xa04f('0x33')](_0x406131[_0xa04f('0x2f')]['fields']));_0x5f4202[_0xa04f('0x31')]=_0x5f4202[_0xa04f('0x31')][_0xa04f('0x34')]?_0x5f4202['attributes']:_0x5577b4[_0xa04f('0x2d')];if(!_0x406131[_0xa04f('0x2f')][_0xa04f('0x35')](_0xa04f('0x36'))){_0x5f4202['limit']=qs['limit'](_0x406131['query'][_0xa04f('0x18')]);_0x5f4202[_0xa04f('0x16')]=qs[_0xa04f('0x16')](_0x406131[_0xa04f('0x2f')][_0xa04f('0x16')]);}_0x5f4202[_0xa04f('0x37')]=qs['sort'](_0x406131['query']['sort']);_0x5f4202[_0xa04f('0x38')]=qs[_0xa04f('0x30')](_['pick'](_0x406131[_0xa04f('0x2f')],_0x5577b4[_0xa04f('0x30')]),_0x37869f);if(_0x406131['query']['filter']){_0x5f4202[_0xa04f('0x38')]=_[_0xa04f('0x39')](_0x5f4202[_0xa04f('0x38')],{'$or':_[_0xa04f('0x28')](_0x37869f,function(_0x123ff0){if(_0x123ff0[_0xa04f('0x2b')]!==_0xa04f('0x3a')){var _0x503567={};_0x503567[_0x123ff0[_0xa04f('0x26')]]={'$like':'%'+_0x406131['query'][_0xa04f('0x3b')]+'%'};return _0x503567;}})});}_0x5f4202=_['merge']({},_0x5f4202,_0x406131[_0xa04f('0x3c')]);var _0x456d5b={'where':_0x5f4202[_0xa04f('0x38')]};return db[_0xa04f('0x29')]['count'](_0x456d5b)[_0xa04f('0x1e')](function(_0x5aecf2){_0x27f968[_0xa04f('0x19')]=_0x5aecf2;if(_0x406131[_0xa04f('0x2f')][_0xa04f('0x3d')]){_0x5f4202['include']=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x5f4202);})[_0xa04f('0x1e')](function(_0x34a56b){_0x27f968[_0xa04f('0x3e')]=_0x34a56b;return _0x27f968;})['then'](respondWithFilteredResult(_0x3e3395,_0x5f4202))[_0xa04f('0x3f')](handleError(_0x3e3395,null));};exports[_0xa04f('0x40')]=function(_0x5bd8f1,_0x55ed99){var _0xdbd441={'raw':![],'where':{'id':_0x5bd8f1[_0xa04f('0x41')]['id']}},_0x42dd4c={};_0x42dd4c[_0xa04f('0x2d')]=_[_0xa04f('0x2e')](db[_0xa04f('0x29')][_0xa04f('0x2a')]);_0x42dd4c[_0xa04f('0x2f')]=_[_0xa04f('0x2e')](_0x5bd8f1[_0xa04f('0x2f')]);_0x42dd4c[_0xa04f('0x30')]=_['intersection'](_0x42dd4c['model'],_0x42dd4c[_0xa04f('0x2f')]);_0xdbd441[_0xa04f('0x31')]=_[_0xa04f('0x32')](_0x42dd4c['model'],qs[_0xa04f('0x33')](_0x5bd8f1[_0xa04f('0x2f')][_0xa04f('0x33')]));_0xdbd441[_0xa04f('0x31')]=_0xdbd441['attributes'][_0xa04f('0x34')]?_0xdbd441[_0xa04f('0x31')]:_0x42dd4c[_0xa04f('0x2d')];if(_0x5bd8f1[_0xa04f('0x2f')][_0xa04f('0x3d')]){_0xdbd441[_0xa04f('0x42')]=[{'all':!![]}];}_0xdbd441=_[_0xa04f('0x39')]({},_0xdbd441,_0x5bd8f1[_0xa04f('0x3c')]);return db[_0xa04f('0x29')]['find'](_0xdbd441)[_0xa04f('0x1e')](handleEntityNotFound(_0x55ed99,null))['then'](respondWithResult(_0x55ed99,null))[_0xa04f('0x3f')](handleError(_0x55ed99,null));};exports[_0xa04f('0x43')]=function(_0x246d5e,_0x18c591){return db[_0xa04f('0x29')]['create'](_0x246d5e['body'],{})[_0xa04f('0x1e')](function(_0x1abc55){var _0x1aa1e5=_0x246d5e['user'][_0xa04f('0x20')]({'plain':!![]});if(!_0x1aa1e5)throw new Error(_0xa04f('0x44'));if(_0x1aa1e5['role']===_0xa04f('0x45')){var _0x518bf4=_0x1abc55[_0xa04f('0x20')]({'plain':!![]});var _0x4b09f0=_0xa04f('0x21');return db[_0xa04f('0x46')]['find']({'where':{'name':_0x4b09f0,'userProfileId':_0x1aa1e5[_0xa04f('0x47')]},'raw':!![]})['then'](function(_0xf348d5){if(_0xf348d5&&_0xf348d5[_0xa04f('0x48')]===0x0){return db['UserProfileResource'][_0xa04f('0x43')]({'name':_0x518bf4['name'],'resourceId':_0x518bf4['id'],'type':_0xf348d5[_0xa04f('0x26')],'sectionId':_0xf348d5['id']},{})['then'](function(){return _0x1abc55;});}else{return _0x1abc55;}})['catch'](function(_0x28b5ab){logger[_0xa04f('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28b5ab);throw _0x28b5ab;});}return _0x1abc55;})[_0xa04f('0x1e')](respondWithResult(_0x18c591,0xc9))[_0xa04f('0x3f')](handleError(_0x18c591,null));};exports[_0xa04f('0x49')]=function(_0x4fa70f,_0x577aa1){var _0x56d7d5={'where':{'id':_0x4fa70f[_0xa04f('0x41')]['id']}},_0x461818={};_0x461818[_0xa04f('0x2d')]=_[_0xa04f('0x2e')](db[_0xa04f('0x29')]['rawAttributes']);_0x56d7d5[_0xa04f('0x31')]=_['intersection'](_0x461818[_0xa04f('0x2d')],qs[_0xa04f('0x33')](_0x4fa70f['query']['fields']));_0x56d7d5[_0xa04f('0x31')]=_0x56d7d5[_0xa04f('0x31')][_0xa04f('0x34')]?_0x56d7d5[_0xa04f('0x31')]:_0x461818['model'];if(_0x4fa70f[_0xa04f('0x2f')]['includeAll']){_0x56d7d5['include']=[{'all':!![]}];}_0x56d7d5=_[_0xa04f('0x39')]({},_0x56d7d5,_0x4fa70f[_0xa04f('0x3c')]);return db[_0xa04f('0x29')][_0xa04f('0x4a')](_0x56d7d5)[_0xa04f('0x1e')](handleEntityNotFound(_0x577aa1,null))[_0xa04f('0x1e')](function(_0x5429fe){if(_0x5429fe){var _0x2b6051=_0x5429fe[_0xa04f('0x20')]({'plain':!![]});_0x2b6051=qs[_0xa04f('0x4b')](_0x2b6051,['id','createdAt',_0xa04f('0x4c')]);_0x4fa70f['body']=_[_0xa04f('0x4b')](_0x4fa70f[_0xa04f('0x4d')],['id',_0xa04f('0x4e'),_0xa04f('0x4c')]);return db['JscriptyProject'][_0xa04f('0x43')](_[_0xa04f('0x39')](_0x2b6051,_0x4fa70f[_0xa04f('0x4d')]),{'include':_0x4fa70f['query'][_0xa04f('0x3d')]?[{'all':!![]}]:undefined})[_0xa04f('0x1e')](function(_0x484659){var _0x2f3cab=_0x4fa70f['user'][_0xa04f('0x20')]({'plain':!![]});if(!_0x2f3cab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f3cab['role']===_0xa04f('0x45')){var _0x5552e8=_0x484659[_0xa04f('0x20')]({'plain':!![]});var _0x594ff2=_0xa04f('0x21');return db['UserProfileSection']['find']({'where':{'name':_0x594ff2,'userProfileId':_0x2f3cab[_0xa04f('0x47')]},'raw':!![]})[_0xa04f('0x1e')](function(_0x485cdd){if(_0x485cdd&&_0x485cdd['autoAssociation']===0x0){return db[_0xa04f('0x22')][_0xa04f('0x43')]({'name':_0x5552e8[_0xa04f('0x26')],'resourceId':_0x5552e8['id'],'type':_0x485cdd[_0xa04f('0x26')],'sectionId':_0x485cdd['id']},{})[_0xa04f('0x1e')](function(){return _0x484659;});}else{return _0x484659;}})[_0xa04f('0x3f')](function(_0x58ac72){logger['error'](_0xa04f('0x4f'),_0x58ac72);throw _0x58ac72;});}return _0x484659;});}})[_0xa04f('0x1e')](respondWithResult(_0x577aa1,0xc9))[_0xa04f('0x3f')](handleError(_0x577aa1,null));};exports[_0xa04f('0x1d')]=function(_0x889e61,_0x47467f){if(_0x889e61[_0xa04f('0x4d')]['id']){delete _0x889e61[_0xa04f('0x4d')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x889e61[_0xa04f('0x41')]['id']}})[_0xa04f('0x1e')](handleEntityNotFound(_0x47467f,null))[_0xa04f('0x1e')](saveUpdates(_0x889e61['body'],null))['then'](respondWithResult(_0x47467f,null))[_0xa04f('0x3f')](handleError(_0x47467f,null));};exports[_0xa04f('0x1f')]=function(_0x2db58d,_0x46f15e){return db['JscriptyProject'][_0xa04f('0x4a')]({'where':{'id':_0x2db58d[_0xa04f('0x41')]['id']}})[_0xa04f('0x1e')](handleEntityNotFound(_0x46f15e,null))[_0xa04f('0x1e')](removeEntity(_0x46f15e,null))[_0xa04f('0x3f')](handleError(_0x46f15e,null));};exports[_0xa04f('0x50')]=function(_0x15f3f9,_0x37ffa9,_0x8e1e8e){var _0xadb3fa={'raw':!![],'where':{}};var _0x2b56b2={};var _0x31189e={'count':0x0,'rows':[]};return db[_0xa04f('0x29')][_0xa04f('0x51')]({'where':{'id':_0x15f3f9[_0xa04f('0x41')]['id']}})[_0xa04f('0x1e')](handleEntityNotFound(_0x37ffa9,null))[_0xa04f('0x1e')](function(_0x4d6001){if(_0x4d6001){_0x2b56b2[_0xa04f('0x2d')]=_[_0xa04f('0x2e')](db['JscriptySessionReport'][_0xa04f('0x2a')]);_0x2b56b2[_0xa04f('0x2f')]=_['keys'](_0x15f3f9['query']);_0x2b56b2[_0xa04f('0x30')]=_[_0xa04f('0x32')](_0x2b56b2[_0xa04f('0x2d')],_0x2b56b2[_0xa04f('0x2f')]);_0xadb3fa[_0xa04f('0x31')]=_['intersection'](_0x2b56b2[_0xa04f('0x2d')],qs[_0xa04f('0x33')](_0x15f3f9[_0xa04f('0x2f')][_0xa04f('0x33')]));_0xadb3fa[_0xa04f('0x31')]=_0xadb3fa[_0xa04f('0x31')][_0xa04f('0x34')]?_0xadb3fa['attributes']:_0x2b56b2[_0xa04f('0x2d')];if(!_0x15f3f9[_0xa04f('0x2f')]['hasOwnProperty'](_0xa04f('0x36'))){_0xadb3fa[_0xa04f('0x18')]=qs[_0xa04f('0x18')](_0x15f3f9[_0xa04f('0x2f')]['limit']);_0xadb3fa['offset']=qs[_0xa04f('0x16')](_0x15f3f9['query'][_0xa04f('0x16')]);}_0xadb3fa['order']=qs[_0xa04f('0x52')](_0x15f3f9['query'][_0xa04f('0x52')]);_0xadb3fa[_0xa04f('0x38')]=qs[_0xa04f('0x30')](_['pick'](_0x15f3f9[_0xa04f('0x2f')],_0x2b56b2[_0xa04f('0x30')]));_0xadb3fa[_0xa04f('0x38')][_0xa04f('0x53')]=_0x4d6001['id'];if(_0x15f3f9[_0xa04f('0x2f')]['filter']){_0xadb3fa[_0xa04f('0x38')]=_[_0xa04f('0x39')](_0xadb3fa[_0xa04f('0x38')],{'$or':_['map'](_0xadb3fa[_0xa04f('0x31')],function(_0x4966c8){var _0x1a7ba6={};_0x1a7ba6[_0x4966c8]={'$like':'%'+_0x15f3f9[_0xa04f('0x2f')][_0xa04f('0x3b')]+'%'};return _0x1a7ba6;})});}_0xadb3fa=_['merge']({},_0xadb3fa,_0x15f3f9['options']);return db['JscriptySessionReport'][_0xa04f('0x19')]({'where':_0xadb3fa['where']})['then'](function(_0x3d2398){_0x31189e[_0xa04f('0x19')]=_0x3d2398;if(_0x15f3f9['query'][_0xa04f('0x3d')]){_0xadb3fa[_0xa04f('0x42')]=[{'all':!![]}];}return db[_0xa04f('0x54')][_0xa04f('0x55')](_0xadb3fa);})[_0xa04f('0x1e')](function(_0x4a480e){_0x31189e[_0xa04f('0x3e')]=_0x4a480e;return _0x31189e;});}})['then'](respondWithFilteredResult(_0x37ffa9,_0xadb3fa))[_0xa04f('0x3f')](handleError(_0x37ffa9,null));};exports[_0xa04f('0x56')]=function(_0x3a609f,_0x3bf0e2,_0x1e9fb7){var _0x5c4284={'raw':!![],'where':{}};var _0x2c8e2e={};var _0x226d38={'count':0x0,'rows':[]};return db[_0xa04f('0x29')][_0xa04f('0x51')]({'where':{'id':_0x3a609f[_0xa04f('0x41')]['id']}})[_0xa04f('0x1e')](handleEntityNotFound(_0x3bf0e2,null))['then'](function(_0x2f6435){if(_0x2f6435){_0x2c8e2e[_0xa04f('0x2d')]=_[_0xa04f('0x2e')](db['JscriptyAnswerReport'][_0xa04f('0x2a')]);_0x2c8e2e[_0xa04f('0x2f')]=_['keys'](_0x3a609f['query']);_0x2c8e2e[_0xa04f('0x30')]=_[_0xa04f('0x32')](_0x2c8e2e[_0xa04f('0x2d')],_0x2c8e2e[_0xa04f('0x2f')]);_0x5c4284[_0xa04f('0x31')]=_[_0xa04f('0x32')](_0x2c8e2e[_0xa04f('0x2d')],qs['fields'](_0x3a609f[_0xa04f('0x2f')][_0xa04f('0x33')]));_0x5c4284['attributes']=_0x5c4284['attributes'][_0xa04f('0x34')]?_0x5c4284[_0xa04f('0x31')]:_0x2c8e2e[_0xa04f('0x2d')];if(!_0x3a609f[_0xa04f('0x2f')][_0xa04f('0x35')](_0xa04f('0x36'))){_0x5c4284[_0xa04f('0x18')]=qs['limit'](_0x3a609f[_0xa04f('0x2f')]['limit']);_0x5c4284[_0xa04f('0x16')]=qs[_0xa04f('0x16')](_0x3a609f['query'][_0xa04f('0x16')]);}_0x5c4284['order']=qs['sort'](_0x3a609f[_0xa04f('0x2f')][_0xa04f('0x52')]);_0x5c4284[_0xa04f('0x38')]=qs[_0xa04f('0x30')](_[_0xa04f('0x57')](_0x3a609f[_0xa04f('0x2f')],_0x2c8e2e[_0xa04f('0x30')]));_0x5c4284[_0xa04f('0x38')][_0xa04f('0x53')]=_0x2f6435['id'];if(_0x3a609f[_0xa04f('0x2f')][_0xa04f('0x3b')]){_0x5c4284[_0xa04f('0x38')]=_['merge'](_0x5c4284[_0xa04f('0x38')],{'$or':_['map'](_0x5c4284['attributes'],function(_0x1fcd64){var _0x2daae5={};_0x2daae5[_0x1fcd64]={'$like':'%'+_0x3a609f[_0xa04f('0x2f')][_0xa04f('0x3b')]+'%'};return _0x2daae5;})});}_0x5c4284=_[_0xa04f('0x39')]({},_0x5c4284,_0x3a609f[_0xa04f('0x3c')]);return db['JscriptyAnswerReport'][_0xa04f('0x19')]({'where':_0x5c4284[_0xa04f('0x38')]})[_0xa04f('0x1e')](function(_0x3291a7){_0x226d38['count']=_0x3291a7;if(_0x3a609f['query'][_0xa04f('0x3d')]){_0x5c4284[_0xa04f('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xa04f('0x55')](_0x5c4284);})[_0xa04f('0x1e')](function(_0x45c717){_0x226d38[_0xa04f('0x3e')]=_0x45c717;return _0x226d38;});}})[_0xa04f('0x1e')](respondWithFilteredResult(_0x3bf0e2,_0x5c4284))[_0xa04f('0x3f')](handleError(_0x3bf0e2,null));};function char(_0x36d1e8){return'number'===typeof _0x36d1e8?String[_0xa04f('0x58')][_0xa04f('0x1b')](null,arguments):_0x36d1e8;}function needsEncapsulation(_0x5872d4){return!!_0x5872d4&&(_0x5872d4[_0xa04f('0x59')]()[_0xa04f('0x5a')](char(0xd))>=0x0||_0x5872d4['toString']()[_0xa04f('0x5a')](char(0xa))>=0x0||_0x5872d4[_0xa04f('0x59')]()[_0xa04f('0x5a')](char(0x2c))>=0x0||_0x5872d4[_0xa04f('0x59')]()[_0xa04f('0x5a')](char(0x22))>=0x0);}function encapsulate(_0xc2361e){var _0x3820e8=char(0x22),_0x671bb7='\x5c'+char(0x22),_0x230e2b=_0xc2361e['toString']()[_0xa04f('0x5b')](new RegExp(_0x3820e8,'g'),_0x671bb7);return _0x3820e8+_0x230e2b+_0x3820e8;}exports[_0xa04f('0x5c')]=function(_0x9fdd95,_0x229357,_0x589754){var _0x1aa2fc,_0x50ef68;var _0x3d2494={'where':{'ProjectId':_0x9fdd95[_0xa04f('0x41')]['id']}};if(_0x9fdd95[_0xa04f('0x2f')]['startTime']){_0x3d2494[_0xa04f('0x38')]['starttime']=JSON[_0xa04f('0x5d')](_0x9fdd95[_0xa04f('0x2f')][_0xa04f('0x5e')]);}return db[_0xa04f('0x54')][_0xa04f('0x55')](_0x3d2494)[_0xa04f('0x1e')](handleEntityNotFound(_0x229357,null))[_0xa04f('0x1e')](function(_0x20ad83){if(_0x20ad83){_0x1aa2fc=_0x20ad83;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0xa04f('0x28')](_0x1aa2fc,'id')},'ProjectId':_0x9fdd95[_0xa04f('0x41')]['id']},'order':_0xa04f('0x5f')});}})[_0xa04f('0x1e')](handleEntityNotFound(_0x229357,null))[_0xa04f('0x1e')](function(_0x403538){if(_0x403538){_0x50ef68=_0x403538;var _0x2e52a1={};for(var _0x192fec=0x0,_0xb8ea7=_0x50ef68[_0xa04f('0x34')];_0x192fec<_0xb8ea7;_0x192fec++){if(!_0x2e52a1[_0xa04f('0x35')](_0x50ef68[_0x192fec]['questionId'])){_0x2e52a1[_0x50ef68[_0x192fec][_0xa04f('0x60')]]=needsEncapsulation(_0x50ef68[_0x192fec][_0xa04f('0x61')])?encapsulate(_0x50ef68[_0x192fec][_0xa04f('0x61')]):_0x50ef68[_0x192fec][_0xa04f('0x61')];}}var _0x2f0ddd=[],_0x562708={};for(var _0x16d996=0x0,_0x4fe7a8=_0x1aa2fc['length'];_0x16d996<_0x4fe7a8;_0x16d996++){_0x562708={'ProjectId':_0x9fdd95[_0xa04f('0x41')]['id'],'SessionId':_0x1aa2fc[_0x16d996]['id'],'StartTime':moment(_0x1aa2fc[_0x16d996]['starttime'])[_0xa04f('0x62')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x2b2136=0x0,_0x2be26a=_0x50ef68[_0xa04f('0x34')];_0x2b2136<_0x2be26a;_0x2b2136++){if(_0x50ef68[_0x2b2136][_0xa04f('0x63')]==_0x1aa2fc[_0x16d996]['id']&&_0x2e52a1[_0xa04f('0x35')](_0x50ef68[_0x2b2136]['questionId'])){_0x562708[_0x2e52a1[_0x50ef68[_0x2b2136]['questionId']]]=_0x50ef68[_0x2b2136]['answer'];}}for(var _0x1c867b in _0x2e52a1){if(!_0x562708[_0xa04f('0x35')](_0x2e52a1[_0x1c867b])){_0x562708[_0x2e52a1[_0x1c867b]]=null;}}_0x2f0ddd[_0xa04f('0x64')](_0x562708);}return _0x2f0ddd;}})[_0xa04f('0x1e')](function(_0x481cdc){if(!_[_0xa04f('0x65')](_0x481cdc)){var _0x5c2a7a=toCsv(_0x481cdc);var _0x1e026b=Date[_0xa04f('0x66')]();fs['writeFileSync'](util[_0xa04f('0x62')](_0xa04f('0x67'),_0x9fdd95['params']['id'],_0x1e026b),_0x5c2a7a);_0x229357[_0xa04f('0x68')](_0xa04f('0x69'),_0xa04f('0x6a')+util[_0xa04f('0x62')]('Jscripty_Project_%d_Summary_%s.csv',_0x9fdd95[_0xa04f('0x41')]['id'],_0x1e026b));_0x229357['setHeader']('Content-type','text/csv');return _0x229357['download'](util[_0xa04f('0x62')](_0xa04f('0x67'),_0x9fdd95[_0xa04f('0x41')]['id'],_0x1e026b));}else{return _0x229357[_0xa04f('0x23')](0xcc);}})[_0xa04f('0x3f')](handleError(_0x229357,null));}; \ No newline at end of file +var _0x500c=['getSessions','findOne','JscriptySessionReport','sort','findAll','getAnswers','JscriptyAnswerReport','number','apply','toString','indexOf','replace','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','destroy','then','get','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','clone','length','omit','updatedAt','body','createdAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x500c,0x188));var _0xc500=function(_0x38e680,_0xab1366){_0x38e680=_0x38e680-0x0;var _0x4822be=_0x500c[_0x38e680];return _0x4822be;};'use strict';var emlformat=require(_0xc500('0x0'));var rimraf=require(_0xc500('0x1'));var zipdir=require(_0xc500('0x2'));var jsonpatch=require(_0xc500('0x3'));var rp=require(_0xc500('0x4'));var moment=require(_0xc500('0x5'));var BPromise=require(_0xc500('0x6'));var Mustache=require(_0xc500('0x7'));var util=require(_0xc500('0x8'));var path=require(_0xc500('0x9'));var sox=require(_0xc500('0xa'));var csv=require(_0xc500('0xb'));var ejs=require(_0xc500('0xc'));var fs=require('fs');var fs_extra=require(_0xc500('0xd'));var _=require(_0xc500('0xe'));var squel=require('squel');var crypto=require(_0xc500('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xc500('0x10'));var toCsv=require(_0xc500('0xb'));var querystring=require(_0xc500('0x11'));var Papa=require(_0xc500('0x12'));var Redis=require(_0xc500('0x13'));var authService=require(_0xc500('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc500('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc500('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc500('0x17'));var licenseUtil=require(_0xc500('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45331c,_0x3274ba){_0x3274ba=_0x3274ba||0xcc;return function(_0x3221b7){if(_0x3221b7){return _0x45331c[_0xc500('0x19')](_0x3274ba);}return _0x45331c[_0xc500('0x1a')](_0x3274ba)[_0xc500('0x1b')]();};}function respondWithResult(_0x45688,_0x33b0ad){_0x33b0ad=_0x33b0ad||0xc8;return function(_0x4f4b07){if(_0x4f4b07){return _0x45688[_0xc500('0x1a')](_0x33b0ad)[_0xc500('0x1c')](_0x4f4b07);}};}function respondWithFilteredResult(_0x51b6c8,_0x295900){return function(_0x291767){if(_0x291767){var _0x387d54=typeof _0x295900[_0xc500('0x1d')]===_0xc500('0x1e')&&typeof _0x295900[_0xc500('0x1f')]===_0xc500('0x1e');var _0x4c1aed=_0x291767[_0xc500('0x20')];var _0x23236e=_0x387d54?0x0:_0x295900[_0xc500('0x1d')];var _0x2494c6=_0x387d54?_0x291767[_0xc500('0x20')]:_0x295900[_0xc500('0x1d')]+_0x295900[_0xc500('0x1f')];var _0x4aaa01;if(_0x2494c6>=_0x4c1aed){_0x2494c6=_0x4c1aed;_0x4aaa01=0xc8;}else{_0x4aaa01=0xce;}_0x51b6c8['status'](_0x4aaa01);return _0x51b6c8['set'](_0xc500('0x21'),_0x23236e+'-'+_0x2494c6+'/'+_0x4c1aed)['json'](_0x291767);}return null;};}function patchUpdates(_0x13cf80){return function(_0x205d10){try{jsonpatch['apply'](_0x205d10,_0x13cf80,!![]);}catch(_0x38c8c8){return BPromise['reject'](_0x38c8c8);}return _0x205d10['save']();};}function saveUpdates(_0x1b5a19,_0x536426){return function(_0x60d74b){if(_0x60d74b){return _0x60d74b['update'](_0x1b5a19)['then'](function(_0x42c8f4){return _0x42c8f4;});}return null;};}function removeEntity(_0x42d54c,_0x174aca){return function(_0x82658){if(_0x82658){return _0x82658[_0xc500('0x22')]()[_0xc500('0x23')](function(){var _0x15540a=_0x82658[_0xc500('0x24')]({'plain':!![]});var _0x24a3db=_0xc500('0x25');return db[_0xc500('0x26')][_0xc500('0x22')]({'where':{'type':_0x24a3db,'resourceId':_0x15540a['id']}})[_0xc500('0x23')](function(){return _0x82658;});})['then'](function(){_0x42d54c[_0xc500('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x237fbb,_0xf77f5){return function(_0x859b8e){if(!_0x859b8e){_0x237fbb[_0xc500('0x19')](0x194);}return _0x859b8e;};}function handleError(_0x23599b,_0x37048c){_0x37048c=_0x37048c||0x1f4;return function(_0x5a8314){logger[_0xc500('0x27')](_0x5a8314[_0xc500('0x28')]);if(_0x5a8314[_0xc500('0x29')]){delete _0x5a8314[_0xc500('0x29')];}_0x23599b['status'](_0x37048c)[_0xc500('0x2a')](_0x5a8314);};}exports[_0xc500('0x2b')]=function(_0x153250,_0x12c7bd){var _0x3abc00={},_0xa2d4cb={},_0x42f7de={'count':0x0,'rows':[]};var _0x7c2de4=_[_0xc500('0x2c')](db[_0xc500('0x2d')][_0xc500('0x2e')],function(_0x15845e){return{'name':_0x15845e[_0xc500('0x2f')],'type':_0x15845e[_0xc500('0x30')][_0xc500('0x31')]};});_0xa2d4cb[_0xc500('0x32')]=_[_0xc500('0x2c')](_0x7c2de4,_0xc500('0x29'));_0xa2d4cb[_0xc500('0x33')]=_['keys'](_0x153250[_0xc500('0x33')]);_0xa2d4cb[_0xc500('0x34')]=_[_0xc500('0x35')](_0xa2d4cb[_0xc500('0x32')],_0xa2d4cb['query']);_0x3abc00[_0xc500('0x36')]=_['intersection'](_0xa2d4cb[_0xc500('0x32')],qs[_0xc500('0x37')](_0x153250[_0xc500('0x33')][_0xc500('0x37')]));_0x3abc00['attributes']=_0x3abc00[_0xc500('0x36')]['length']?_0x3abc00[_0xc500('0x36')]:_0xa2d4cb[_0xc500('0x32')];if(!_0x153250['query'][_0xc500('0x38')](_0xc500('0x39'))){_0x3abc00['limit']=qs[_0xc500('0x1f')](_0x153250[_0xc500('0x33')]['limit']);_0x3abc00[_0xc500('0x1d')]=qs[_0xc500('0x1d')](_0x153250['query'][_0xc500('0x1d')]);}_0x3abc00[_0xc500('0x3a')]=qs['sort'](_0x153250[_0xc500('0x33')]['sort']);_0x3abc00[_0xc500('0x3b')]=qs[_0xc500('0x34')](_[_0xc500('0x3c')](_0x153250[_0xc500('0x33')],_0xa2d4cb[_0xc500('0x34')]),_0x7c2de4);if(_0x153250[_0xc500('0x33')][_0xc500('0x3d')]){_0x3abc00[_0xc500('0x3b')]=_['merge'](_0x3abc00[_0xc500('0x3b')],{'$or':_['map'](_0x7c2de4,function(_0x5f334f){if(_0x5f334f[_0xc500('0x30')]!==_0xc500('0x3e')){var _0x484676={};_0x484676[_0x5f334f['name']]={'$like':'%'+_0x153250[_0xc500('0x33')][_0xc500('0x3d')]+'%'};return _0x484676;}})});}_0x3abc00=_[_0xc500('0x3f')]({},_0x3abc00,_0x153250[_0xc500('0x40')]);var _0x1cf63a={'where':_0x3abc00[_0xc500('0x3b')]};return db[_0xc500('0x2d')][_0xc500('0x20')](_0x1cf63a)[_0xc500('0x23')](function(_0x37c481){_0x42f7de[_0xc500('0x20')]=_0x37c481;if(_0x153250[_0xc500('0x33')][_0xc500('0x41')]){_0x3abc00[_0xc500('0x42')]=[{'all':!![]}];}return db[_0xc500('0x2d')]['findAll'](_0x3abc00);})['then'](function(_0x47ed54){_0x42f7de[_0xc500('0x43')]=_0x47ed54;return _0x42f7de;})[_0xc500('0x23')](respondWithFilteredResult(_0x12c7bd,_0x3abc00))[_0xc500('0x44')](handleError(_0x12c7bd,null));};exports[_0xc500('0x45')]=function(_0x2f05e8,_0x1a92e1){var _0xd94989={'raw':![],'where':{'id':_0x2f05e8[_0xc500('0x46')]['id']}},_0x39bdfa={};_0x39bdfa['model']=_[_0xc500('0x47')](db[_0xc500('0x2d')][_0xc500('0x2e')]);_0x39bdfa['query']=_['keys'](_0x2f05e8[_0xc500('0x33')]);_0x39bdfa[_0xc500('0x34')]=_['intersection'](_0x39bdfa[_0xc500('0x32')],_0x39bdfa[_0xc500('0x33')]);_0xd94989[_0xc500('0x36')]=_['intersection'](_0x39bdfa['model'],qs[_0xc500('0x37')](_0x2f05e8[_0xc500('0x33')][_0xc500('0x37')]));_0xd94989[_0xc500('0x36')]=_0xd94989[_0xc500('0x36')]['length']?_0xd94989[_0xc500('0x36')]:_0x39bdfa['model'];if(_0x2f05e8[_0xc500('0x33')]['includeAll']){_0xd94989[_0xc500('0x42')]=[{'all':!![]}];}_0xd94989=_[_0xc500('0x3f')]({},_0xd94989,_0x2f05e8[_0xc500('0x40')]);return db[_0xc500('0x2d')][_0xc500('0x48')](_0xd94989)[_0xc500('0x23')](handleEntityNotFound(_0x1a92e1,null))[_0xc500('0x23')](respondWithResult(_0x1a92e1,null))[_0xc500('0x44')](handleError(_0x1a92e1,null));};exports[_0xc500('0x49')]=function(_0x39f065,_0x58943b){return db[_0xc500('0x2d')][_0xc500('0x49')](_0x39f065['body'],{})[_0xc500('0x23')](function(_0x55460d){var _0x495963=_0x39f065[_0xc500('0x4a')][_0xc500('0x24')]({'plain':!![]});if(!_0x495963)throw new Error(_0xc500('0x4b'));if(_0x495963['role']===_0xc500('0x4a')){var _0x1a7df9=_0x55460d[_0xc500('0x24')]({'plain':!![]});var _0x4c09fe='Projects';return db[_0xc500('0x4c')][_0xc500('0x48')]({'where':{'name':_0x4c09fe,'userProfileId':_0x495963[_0xc500('0x4d')]},'raw':!![]})[_0xc500('0x23')](function(_0x584e8c){if(_0x584e8c&&_0x584e8c[_0xc500('0x4e')]===0x0){return db[_0xc500('0x26')][_0xc500('0x49')]({'name':_0x1a7df9[_0xc500('0x29')],'resourceId':_0x1a7df9['id'],'type':_0x584e8c['name'],'sectionId':_0x584e8c['id']},{})[_0xc500('0x23')](function(){return _0x55460d;});}else{return _0x55460d;}})[_0xc500('0x44')](function(_0x33f746){logger[_0xc500('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33f746);throw _0x33f746;});}return _0x55460d;})[_0xc500('0x23')](respondWithResult(_0x58943b,0xc9))[_0xc500('0x44')](handleError(_0x58943b,null));};exports[_0xc500('0x4f')]=function(_0x4a4054,_0x303b35){var _0xaf18c5={'where':{'id':_0x4a4054[_0xc500('0x46')]['id']}},_0x9fb2e0={};_0x9fb2e0[_0xc500('0x32')]=_[_0xc500('0x47')](db['JscriptyProject'][_0xc500('0x2e')]);_0xaf18c5[_0xc500('0x36')]=_[_0xc500('0x35')](_0x9fb2e0[_0xc500('0x32')],qs['fields'](_0x4a4054['query'][_0xc500('0x37')]));_0xaf18c5['attributes']=_0xaf18c5[_0xc500('0x36')][_0xc500('0x50')]?_0xaf18c5[_0xc500('0x36')]:_0x9fb2e0[_0xc500('0x32')];if(_0x4a4054[_0xc500('0x33')][_0xc500('0x41')]){_0xaf18c5[_0xc500('0x42')]=[{'all':!![]}];}_0xaf18c5=_['merge']({},_0xaf18c5,_0x4a4054[_0xc500('0x40')]);return db['JscriptyProject'][_0xc500('0x48')](_0xaf18c5)[_0xc500('0x23')](handleEntityNotFound(_0x303b35,null))['then'](function(_0x1808f0){if(_0x1808f0){var _0x171504=_0x1808f0[_0xc500('0x24')]({'plain':!![]});_0x171504=qs[_0xc500('0x51')](_0x171504,['id','createdAt',_0xc500('0x52')]);_0x4a4054[_0xc500('0x53')]=_[_0xc500('0x51')](_0x4a4054[_0xc500('0x53')],['id',_0xc500('0x54'),'updatedAt']);return db[_0xc500('0x2d')][_0xc500('0x49')](_[_0xc500('0x3f')](_0x171504,_0x4a4054[_0xc500('0x53')]),{'include':_0x4a4054['query'][_0xc500('0x41')]?[{'all':!![]}]:undefined})[_0xc500('0x23')](function(_0x398064){var _0x17b583=_0x4a4054[_0xc500('0x4a')][_0xc500('0x24')]({'plain':!![]});if(!_0x17b583)throw new Error(_0xc500('0x4b'));if(_0x17b583[_0xc500('0x55')]==='user'){var _0xf1c096=_0x398064['get']({'plain':!![]});var _0x42e9b6=_0xc500('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x42e9b6,'userProfileId':_0x17b583['userProfileId']},'raw':!![]})[_0xc500('0x23')](function(_0x1c51c6){if(_0x1c51c6&&_0x1c51c6[_0xc500('0x4e')]===0x0){return db[_0xc500('0x26')][_0xc500('0x49')]({'name':_0xf1c096[_0xc500('0x29')],'resourceId':_0xf1c096['id'],'type':_0x1c51c6['name'],'sectionId':_0x1c51c6['id']},{})['then'](function(){return _0x398064;});}else{return _0x398064;}})[_0xc500('0x44')](function(_0x1ba7ef){logger[_0xc500('0x27')](_0xc500('0x56'),_0x1ba7ef);throw _0x1ba7ef;});}return _0x398064;});}})['then'](respondWithResult(_0x303b35,0xc9))['catch'](handleError(_0x303b35,null));};exports[_0xc500('0x57')]=function(_0xf651f2,_0x59ab79){if(_0xf651f2['body']['id']){delete _0xf651f2['body']['id'];}return db[_0xc500('0x2d')]['find']({'where':{'id':_0xf651f2[_0xc500('0x46')]['id']}})['then'](handleEntityNotFound(_0x59ab79,null))[_0xc500('0x23')](saveUpdates(_0xf651f2[_0xc500('0x53')],null))[_0xc500('0x23')](respondWithResult(_0x59ab79,null))[_0xc500('0x44')](handleError(_0x59ab79,null));};exports['destroy']=function(_0x1aa2f7,_0x41a1cf){return db[_0xc500('0x2d')][_0xc500('0x48')]({'where':{'id':_0x1aa2f7['params']['id']}})[_0xc500('0x23')](handleEntityNotFound(_0x41a1cf,null))[_0xc500('0x23')](removeEntity(_0x41a1cf,null))[_0xc500('0x44')](handleError(_0x41a1cf,null));};exports[_0xc500('0x58')]=function(_0x5d0e42,_0xa1e74b,_0x3ce333){var _0x443ae0={'raw':!![],'where':{}};var _0x3b5227={};var _0x1529e8={'count':0x0,'rows':[]};return db[_0xc500('0x2d')][_0xc500('0x59')]({'where':{'id':_0x5d0e42[_0xc500('0x46')]['id']}})[_0xc500('0x23')](handleEntityNotFound(_0xa1e74b,null))['then'](function(_0x40f068){if(_0x40f068){_0x3b5227[_0xc500('0x32')]=_['keys'](db[_0xc500('0x5a')][_0xc500('0x2e')]);_0x3b5227[_0xc500('0x33')]=_[_0xc500('0x47')](_0x5d0e42[_0xc500('0x33')]);_0x3b5227[_0xc500('0x34')]=_[_0xc500('0x35')](_0x3b5227[_0xc500('0x32')],_0x3b5227[_0xc500('0x33')]);_0x443ae0['attributes']=_[_0xc500('0x35')](_0x3b5227[_0xc500('0x32')],qs[_0xc500('0x37')](_0x5d0e42[_0xc500('0x33')][_0xc500('0x37')]));_0x443ae0[_0xc500('0x36')]=_0x443ae0[_0xc500('0x36')][_0xc500('0x50')]?_0x443ae0[_0xc500('0x36')]:_0x3b5227[_0xc500('0x32')];if(!_0x5d0e42[_0xc500('0x33')][_0xc500('0x38')](_0xc500('0x39'))){_0x443ae0[_0xc500('0x1f')]=qs['limit'](_0x5d0e42[_0xc500('0x33')][_0xc500('0x1f')]);_0x443ae0['offset']=qs[_0xc500('0x1d')](_0x5d0e42[_0xc500('0x33')][_0xc500('0x1d')]);}_0x443ae0['order']=qs[_0xc500('0x5b')](_0x5d0e42[_0xc500('0x33')][_0xc500('0x5b')]);_0x443ae0[_0xc500('0x3b')]=qs['filters'](_[_0xc500('0x3c')](_0x5d0e42[_0xc500('0x33')],_0x3b5227[_0xc500('0x34')]));_0x443ae0[_0xc500('0x3b')]['ProjectId']=_0x40f068['id'];if(_0x5d0e42[_0xc500('0x33')][_0xc500('0x3d')]){_0x443ae0[_0xc500('0x3b')]=_[_0xc500('0x3f')](_0x443ae0['where'],{'$or':_[_0xc500('0x2c')](_0x443ae0['attributes'],function(_0x38ab47){var _0x127861={};_0x127861[_0x38ab47]={'$like':'%'+_0x5d0e42[_0xc500('0x33')][_0xc500('0x3d')]+'%'};return _0x127861;})});}_0x443ae0=_[_0xc500('0x3f')]({},_0x443ae0,_0x5d0e42['options']);return db[_0xc500('0x5a')][_0xc500('0x20')]({'where':_0x443ae0[_0xc500('0x3b')]})[_0xc500('0x23')](function(_0x32a91b){_0x1529e8[_0xc500('0x20')]=_0x32a91b;if(_0x5d0e42['query'][_0xc500('0x41')]){_0x443ae0[_0xc500('0x42')]=[{'all':!![]}];}return db[_0xc500('0x5a')][_0xc500('0x5c')](_0x443ae0);})['then'](function(_0x3fb1d8){_0x1529e8[_0xc500('0x43')]=_0x3fb1d8;return _0x1529e8;});}})[_0xc500('0x23')](respondWithFilteredResult(_0xa1e74b,_0x443ae0))[_0xc500('0x44')](handleError(_0xa1e74b,null));};exports[_0xc500('0x5d')]=function(_0x25a973,_0x20885d,_0x3c95c7){var _0x298905={'raw':!![],'where':{}};var _0x163a11={};var _0x2d7eac={'count':0x0,'rows':[]};return db[_0xc500('0x2d')]['findOne']({'where':{'id':_0x25a973[_0xc500('0x46')]['id']}})[_0xc500('0x23')](handleEntityNotFound(_0x20885d,null))['then'](function(_0x2e2dd2){if(_0x2e2dd2){_0x163a11['model']=_[_0xc500('0x47')](db['JscriptyAnswerReport']['rawAttributes']);_0x163a11['query']=_[_0xc500('0x47')](_0x25a973['query']);_0x163a11[_0xc500('0x34')]=_[_0xc500('0x35')](_0x163a11[_0xc500('0x32')],_0x163a11[_0xc500('0x33')]);_0x298905[_0xc500('0x36')]=_[_0xc500('0x35')](_0x163a11[_0xc500('0x32')],qs[_0xc500('0x37')](_0x25a973[_0xc500('0x33')]['fields']));_0x298905[_0xc500('0x36')]=_0x298905['attributes'][_0xc500('0x50')]?_0x298905[_0xc500('0x36')]:_0x163a11['model'];if(!_0x25a973[_0xc500('0x33')][_0xc500('0x38')](_0xc500('0x39'))){_0x298905[_0xc500('0x1f')]=qs['limit'](_0x25a973[_0xc500('0x33')][_0xc500('0x1f')]);_0x298905['offset']=qs[_0xc500('0x1d')](_0x25a973['query'][_0xc500('0x1d')]);}_0x298905['order']=qs[_0xc500('0x5b')](_0x25a973[_0xc500('0x33')]['sort']);_0x298905[_0xc500('0x3b')]=qs['filters'](_[_0xc500('0x3c')](_0x25a973[_0xc500('0x33')],_0x163a11[_0xc500('0x34')]));_0x298905[_0xc500('0x3b')]['ProjectId']=_0x2e2dd2['id'];if(_0x25a973[_0xc500('0x33')]['filter']){_0x298905[_0xc500('0x3b')]=_[_0xc500('0x3f')](_0x298905[_0xc500('0x3b')],{'$or':_[_0xc500('0x2c')](_0x298905[_0xc500('0x36')],function(_0x235ff0){var _0x167013={};_0x167013[_0x235ff0]={'$like':'%'+_0x25a973[_0xc500('0x33')][_0xc500('0x3d')]+'%'};return _0x167013;})});}_0x298905=_[_0xc500('0x3f')]({},_0x298905,_0x25a973[_0xc500('0x40')]);return db[_0xc500('0x5e')][_0xc500('0x20')]({'where':_0x298905[_0xc500('0x3b')]})[_0xc500('0x23')](function(_0x19eb01){_0x2d7eac['count']=_0x19eb01;if(_0x25a973['query'][_0xc500('0x41')]){_0x298905[_0xc500('0x42')]=[{'all':!![]}];}return db[_0xc500('0x5e')][_0xc500('0x5c')](_0x298905);})[_0xc500('0x23')](function(_0x27cc4d){_0x2d7eac['rows']=_0x27cc4d;return _0x2d7eac;});}})[_0xc500('0x23')](respondWithFilteredResult(_0x20885d,_0x298905))['catch'](handleError(_0x20885d,null));};function char(_0x5a2835){return _0xc500('0x5f')===typeof _0x5a2835?String['fromCharCode'][_0xc500('0x60')](null,arguments):_0x5a2835;}function needsEncapsulation(_0x2ba11c){return!!_0x2ba11c&&(_0x2ba11c[_0xc500('0x61')]()[_0xc500('0x62')](char(0xd))>=0x0||_0x2ba11c[_0xc500('0x61')]()[_0xc500('0x62')](char(0xa))>=0x0||_0x2ba11c[_0xc500('0x61')]()[_0xc500('0x62')](char(0x2c))>=0x0||_0x2ba11c[_0xc500('0x61')]()[_0xc500('0x62')](char(0x22))>=0x0);}function encapsulate(_0x522adb){var _0x57d119=char(0x22),_0x4f0d41='\x5c'+char(0x22),_0x133da2=_0x522adb[_0xc500('0x61')]()[_0xc500('0x63')](new RegExp(_0x57d119,'g'),_0x4f0d41);return _0x57d119+_0x133da2+_0x57d119;}exports['getSummary']=function(_0x1f750a,_0x4d9138,_0x27dd6f){var _0x28a465,_0x39a027;var _0x515ee5={'where':{'ProjectId':_0x1f750a[_0xc500('0x46')]['id']}};if(_0x1f750a[_0xc500('0x33')]['startTime']){_0x515ee5[_0xc500('0x3b')][_0xc500('0x64')]=JSON[_0xc500('0x65')](_0x1f750a[_0xc500('0x33')][_0xc500('0x66')]);}return db[_0xc500('0x5a')]['findAll'](_0x515ee5)['then'](handleEntityNotFound(_0x4d9138,null))['then'](function(_0x27aa4d){if(_0x27aa4d){_0x28a465=_0x27aa4d;return db[_0xc500('0x67')][_0xc500('0x5c')]({'where':{'SessionId':{'$in':_[_0xc500('0x2c')](_0x28a465,'id')},'ProjectId':_0x1f750a['params']['id']},'order':_0xc500('0x68')});}})[_0xc500('0x23')](handleEntityNotFound(_0x4d9138,null))[_0xc500('0x23')](function(_0x444f90){if(_0x444f90){_0x39a027=_0x444f90;var _0x3c18c5={};for(var _0x238cac=0x0,_0x449fde=_0x39a027['length'];_0x238cac<_0x449fde;_0x238cac++){if(!_0x3c18c5[_0xc500('0x38')](_0x39a027[_0x238cac][_0xc500('0x69')])){_0x3c18c5[_0x39a027[_0x238cac][_0xc500('0x69')]]=needsEncapsulation(_0x39a027[_0x238cac][_0xc500('0x6a')])?encapsulate(_0x39a027[_0x238cac]['question']):_0x39a027[_0x238cac][_0xc500('0x6a')];}}var _0x9d87da=[],_0x3911eb={};for(var _0xd11de8=0x0,_0x226b05=_0x28a465[_0xc500('0x50')];_0xd11de8<_0x226b05;_0xd11de8++){_0x3911eb={'ProjectId':_0x1f750a[_0xc500('0x46')]['id'],'SessionId':_0x28a465[_0xd11de8]['id'],'StartTime':moment(_0x28a465[_0xd11de8][_0xc500('0x64')])[_0xc500('0x6b')](_0xc500('0x6c'))};for(var _0xe804c9=0x0,_0x97c07c=_0x39a027[_0xc500('0x50')];_0xe804c9<_0x97c07c;_0xe804c9++){if(_0x39a027[_0xe804c9][_0xc500('0x6d')]==_0x28a465[_0xd11de8]['id']&&_0x3c18c5[_0xc500('0x38')](_0x39a027[_0xe804c9][_0xc500('0x69')])){_0x3911eb[_0x3c18c5[_0x39a027[_0xe804c9][_0xc500('0x69')]]]=_0x39a027[_0xe804c9][_0xc500('0x6e')];}}for(var _0x58d2f9 in _0x3c18c5){if(!_0x3911eb['hasOwnProperty'](_0x3c18c5[_0x58d2f9])){_0x3911eb[_0x3c18c5[_0x58d2f9]]=null;}}_0x9d87da[_0xc500('0x6f')](_0x3911eb);}return _0x9d87da;}})[_0xc500('0x23')](function(_0x1161bf){if(!_['isEmpty'](_0x1161bf)){var _0x2a37d9=toCsv(_0x1161bf);var _0x5340c4=Date[_0xc500('0x70')]();fs[_0xc500('0x71')](util[_0xc500('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1f750a[_0xc500('0x46')]['id'],_0x5340c4),_0x2a37d9);_0x4d9138[_0xc500('0x72')]('Content-disposition',_0xc500('0x73')+util[_0xc500('0x6b')](_0xc500('0x74'),_0x1f750a[_0xc500('0x46')]['id'],_0x5340c4));_0x4d9138[_0xc500('0x72')](_0xc500('0x75'),_0xc500('0x76'));return _0x4d9138[_0xc500('0x77')](util[_0xc500('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1f750a['params']['id'],_0x5340c4));}else{return _0x4d9138[_0xc500('0x19')](0xcc);}})[_0xc500('0x44')](handleError(_0x4d9138,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 9bb5ae9..cd2ef6e 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 _0x2f74=['define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2afc53,_0x566681){var _0x341f7c=function(_0x21dfc5){while(--_0x21dfc5){_0x2afc53['push'](_0x2afc53['shift']());}};_0x341f7c(++_0x566681);}(_0x2f74,0x7b));var _0x42f7=function(_0x4c3f1c,_0x30d1a5){_0x4c3f1c=_0x4c3f1c-0x0;var _0x2119b4=_0x2f74[_0x4c3f1c];return _0x2119b4;};'use strict';var _=require(_0x42f7('0x0'));var util=require('util');var logger=require(_0x42f7('0x1'))(_0x42f7('0x2'));var moment=require(_0x42f7('0x3'));var BPromise=require(_0x42f7('0x4'));var rp=require(_0x42f7('0x5'));var fs=require('fs');var path=require(_0x42f7('0x6'));var rimraf=require(_0x42f7('0x7'));var config=require(_0x42f7('0x8'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x540e53,_0x250aa9){return _0x540e53[_0x42f7('0x9')](_0x42f7('0xa'),attributes,{'tableName':_0x42f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf50b=['bluebird','request-promise','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util','api','moment'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0xf50b,0xc8));var _0xbf50=function(_0x5aa4cd,_0x32bcbd){_0x5aa4cd=_0x5aa4cd-0x0;var _0x17a794=_0xf50b[_0x5aa4cd];return _0x17a794;};'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 diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 31afe68..d3bd88a 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x41fb7b,_0x33f17a){var _0x568372=function(_0x4f2031){while(--_0x4f2031){_0x41fb7b['push'](_0x41fb7b['shift']());}};_0x568372(++_0x33f17a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x298335,_0x129982){_0x298335=_0x298335-0x0;var _0x510624=_0xb43b[_0x298335];return _0x510624;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xac4a,0x13f));var _0xaac4=function(_0x21b53c,_0x59cffc){_0x21b53c=_0x21b53c-0x0;var _0x1e7280=_0xac4a[_0x21b53c];return _0x1e7280;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 773a79a..624f6de 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 _0x7e45=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','destroy','multer','path'];(function(_0xdc4d0f,_0x388dea){var _0x11a7dd=function(_0x330e55){while(--_0x330e55){_0xdc4d0f['push'](_0xdc4d0f['shift']());}};_0x11a7dd(++_0x388dea);}(_0x7e45,0x1b6));var _0x57e4=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x7e45[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0x57e4('0x0'));var util=require('util');var path=require(_0x57e4('0x1'));var timeout=require(_0x57e4('0x2'));var express=require(_0x57e4('0x3'));var router=express[_0x57e4('0x4')]();var fs_extra=require(_0x57e4('0x5'));var auth=require(_0x57e4('0x6'));var interaction=require(_0x57e4('0x7'));var config=require(_0x57e4('0x8'));var controller=require(_0x57e4('0x9'));router[_0x57e4('0xa')]('/',auth[_0x57e4('0xb')](),controller[_0x57e4('0xc')]);router[_0x57e4('0xa')](_0x57e4('0xd'),auth[_0x57e4('0xb')](),controller[_0x57e4('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x57e4('0xf')]);router[_0x57e4('0x10')]('/',auth[_0x57e4('0xb')](),controller[_0x57e4('0x11')]);router[_0x57e4('0x12')](_0x57e4('0x13'),auth[_0x57e4('0xb')](),controller['update']);router[_0x57e4('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x57e4('0x15')]);module['exports']=router; \ No newline at end of file +var _0xa448=['get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x54300a,_0x6bb424){var _0xd63f15=function(_0x51830c){while(--_0x51830c){_0x54300a['push'](_0x54300a['shift']());}};_0xd63f15(++_0x6bb424);}(_0xa448,0x14c));var _0x8a44=function(_0x3b48ab,_0x17b7f7){_0x3b48ab=_0x3b48ab-0x0;var _0x2f20f8=_0xa448[_0x3b48ab];return _0x2f20f8;};'use strict';var multer=require(_0x8a44('0x0'));var util=require(_0x8a44('0x1'));var path=require(_0x8a44('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8a44('0x3')]();var fs_extra=require(_0x8a44('0x4'));var auth=require(_0x8a44('0x5'));var interaction=require(_0x8a44('0x6'));var config=require(_0x8a44('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0x8a44('0x8')]('/',auth[_0x8a44('0x9')](),controller[_0x8a44('0xa')]);router[_0x8a44('0x8')](_0x8a44('0xb'),auth[_0x8a44('0x9')](),controller[_0x8a44('0xc')]);router[_0x8a44('0x8')](_0x8a44('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x8a44('0xe')]('/',auth[_0x8a44('0x9')](),controller[_0x8a44('0xf')]);router[_0x8a44('0x10')](_0x8a44('0xd'),auth[_0x8a44('0x9')](),controller[_0x8a44('0x11')]);router['delete']('/:id',auth[_0x8a44('0x9')](),controller[_0x8a44('0x12')]);module[_0x8a44('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 80a6204..a80e1b7 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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7a54,0x106));var _0x47a5=function(_0x1d9a54,_0x362320){_0x1d9a54=_0x1d9a54-0x0;var _0x4fd5c7=_0x7a54[_0x1d9a54];return _0x4fd5c7;};'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(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x7a54,0x106));var _0x47a5=function(_0x4f103f,_0x1f3bbd){_0x4f103f=_0x4f103f-0x0;var _0x576e8e=_0x7a54[_0x4f103f];return _0x576e8e;};'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 d0cc282..c2adc7e 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 _0x2616=['index','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','error','stack','name','send'];(function(_0x106d61,_0x507af3){var _0x590936=function(_0x5a360d){while(--_0x5a360d){_0x106d61['push'](_0x106d61['shift']());}};_0x590936(++_0x507af3);}(_0x2616,0xb6));var _0x6261=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x2616[_0x4da356];return _0x321b07;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6261('0x0'));var zipdir=require(_0x6261('0x1'));var jsonpatch=require(_0x6261('0x2'));var rp=require(_0x6261('0x3'));var moment=require(_0x6261('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6261('0x5'));var util=require('util');var path=require(_0x6261('0x6'));var sox=require('sox');var csv=require(_0x6261('0x7'));var ejs=require(_0x6261('0x8'));var fs=require('fs');var fs_extra=require(_0x6261('0x9'));var _=require('lodash');var squel=require(_0x6261('0xa'));var crypto=require('crypto');var jsforce=require(_0x6261('0xb'));var deskjs=require(_0x6261('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6261('0xd'));var Papa=require(_0x6261('0xe'));var Redis=require(_0x6261('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6261('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6261('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6261('0x12'));var config=require(_0x6261('0x13'));var licenseUtil=require(_0x6261('0x14'));var db=require(_0x6261('0x15'))['db'];function respondWithStatusCode(_0x3e1cf4,_0x4c36ab){_0x4c36ab=_0x4c36ab||0xcc;return function(_0x219f9a){if(_0x219f9a){return _0x3e1cf4[_0x6261('0x16')](_0x4c36ab);}return _0x3e1cf4['status'](_0x4c36ab)[_0x6261('0x17')]();};}function respondWithResult(_0x450ac1,_0x56e39c){_0x56e39c=_0x56e39c||0xc8;return function(_0xb539d0){if(_0xb539d0){return _0x450ac1[_0x6261('0x18')](_0x56e39c)[_0x6261('0x19')](_0xb539d0);}};}function respondWithFilteredResult(_0x4d3364,_0x1443b9){return function(_0x57129d){if(_0x57129d){var _0x31f524=typeof _0x1443b9[_0x6261('0x1a')]===_0x6261('0x1b')&&typeof _0x1443b9['limit']===_0x6261('0x1b');var _0x1c065b=_0x57129d[_0x6261('0x1c')];var _0x1dc94c=_0x31f524?0x0:_0x1443b9[_0x6261('0x1a')];var _0x2913c6=_0x31f524?_0x57129d[_0x6261('0x1c')]:_0x1443b9['offset']+_0x1443b9[_0x6261('0x1d')];var _0x3ef53a;if(_0x2913c6>=_0x1c065b){_0x2913c6=_0x1c065b;_0x3ef53a=0xc8;}else{_0x3ef53a=0xce;}_0x4d3364[_0x6261('0x18')](_0x3ef53a);return _0x4d3364[_0x6261('0x1e')]('Content-Range',_0x1dc94c+'-'+_0x2913c6+'/'+_0x1c065b)[_0x6261('0x19')](_0x57129d);}return null;};}function patchUpdates(_0x422d71){return function(_0x1ed562){try{jsonpatch[_0x6261('0x1f')](_0x1ed562,_0x422d71,!![]);}catch(_0x42a6ba){return BPromise[_0x6261('0x20')](_0x42a6ba);}return _0x1ed562[_0x6261('0x21')]();};}function saveUpdates(_0x44611f,_0x2e11de){return function(_0x47616c){if(_0x47616c){return _0x47616c['update'](_0x44611f)[_0x6261('0x22')](function(_0x2ec4d1){return _0x2ec4d1;});}return null;};}function removeEntity(_0x21722d,_0x294556){return function(_0x1d3886){if(_0x1d3886){return _0x1d3886[_0x6261('0x23')]()[_0x6261('0x22')](function(){_0x21722d[_0x6261('0x18')](0xcc)[_0x6261('0x17')]();});}};}function handleEntityNotFound(_0x522b27,_0x14d149){return function(_0x35ff94){if(!_0x35ff94){_0x522b27[_0x6261('0x16')](0x194);}return _0x35ff94;};}function handleError(_0x274ccf,_0x31d8c3){_0x31d8c3=_0x31d8c3||0x1f4;return function(_0x51b9f9){logger[_0x6261('0x24')](_0x51b9f9[_0x6261('0x25')]);if(_0x51b9f9['name']){delete _0x51b9f9[_0x6261('0x26')];}_0x274ccf[_0x6261('0x18')](_0x31d8c3)[_0x6261('0x27')](_0x51b9f9);};}exports[_0x6261('0x28')]=function(_0x464670,_0x42e162){var _0x54cc09={},_0xae1b74={},_0x20aa0a={'count':0x0,'rows':[]};var _0x366b3f=_[_0x6261('0x29')](db['JscriptyQuestionReport'][_0x6261('0x2a')],function(_0x3c3ee8){return{'name':_0x3c3ee8[_0x6261('0x2b')],'type':_0x3c3ee8[_0x6261('0x2c')][_0x6261('0x2d')]};});_0xae1b74[_0x6261('0x2e')]=_[_0x6261('0x29')](_0x366b3f,'name');_0xae1b74[_0x6261('0x2f')]=_['keys'](_0x464670[_0x6261('0x2f')]);_0xae1b74['filters']=_['intersection'](_0xae1b74[_0x6261('0x2e')],_0xae1b74[_0x6261('0x2f')]);_0x54cc09[_0x6261('0x30')]=_[_0x6261('0x31')](_0xae1b74[_0x6261('0x2e')],qs[_0x6261('0x32')](_0x464670[_0x6261('0x2f')][_0x6261('0x32')]));_0x54cc09[_0x6261('0x30')]=_0x54cc09[_0x6261('0x30')][_0x6261('0x33')]?_0x54cc09[_0x6261('0x30')]:_0xae1b74['model'];if(!_0x464670['query'][_0x6261('0x34')]('nolimit')){_0x54cc09[_0x6261('0x1d')]=qs[_0x6261('0x1d')](_0x464670[_0x6261('0x2f')][_0x6261('0x1d')]);_0x54cc09[_0x6261('0x1a')]=qs['offset'](_0x464670[_0x6261('0x2f')][_0x6261('0x1a')]);}_0x54cc09[_0x6261('0x35')]=qs[_0x6261('0x36')](_0x464670[_0x6261('0x2f')]['sort']);_0x54cc09[_0x6261('0x37')]=qs[_0x6261('0x38')](_[_0x6261('0x39')](_0x464670['query'],_0xae1b74[_0x6261('0x38')]),_0x366b3f);if(_0x464670[_0x6261('0x2f')][_0x6261('0x3a')]){_0x54cc09[_0x6261('0x37')]=_[_0x6261('0x3b')](_0x54cc09[_0x6261('0x37')],{'$or':_[_0x6261('0x29')](_0x366b3f,function(_0x284424){if(_0x284424['type']!=='VIRTUAL'){var _0x3bd3bf={};_0x3bd3bf[_0x284424['name']]={'$like':'%'+_0x464670[_0x6261('0x2f')][_0x6261('0x3a')]+'%'};return _0x3bd3bf;}})});}_0x54cc09=_[_0x6261('0x3b')]({},_0x54cc09,_0x464670[_0x6261('0x3c')]);var _0x771d6f={'where':_0x54cc09[_0x6261('0x37')]};return db[_0x6261('0x3d')][_0x6261('0x1c')](_0x771d6f)[_0x6261('0x22')](function(_0x4a4324){_0x20aa0a[_0x6261('0x1c')]=_0x4a4324;if(_0x464670[_0x6261('0x2f')][_0x6261('0x3e')]){_0x54cc09[_0x6261('0x3f')]=[{'all':!![]}];}return db[_0x6261('0x3d')][_0x6261('0x40')](_0x54cc09);})[_0x6261('0x22')](function(_0x55d562){_0x20aa0a[_0x6261('0x41')]=_0x55d562;return _0x20aa0a;})[_0x6261('0x22')](respondWithFilteredResult(_0x42e162,_0x54cc09))[_0x6261('0x42')](handleError(_0x42e162,null));};exports[_0x6261('0x43')]=function(_0x7e6e7d,_0x73a47f){var _0x325a45={'raw':!![],'where':{'id':_0x7e6e7d[_0x6261('0x44')]['id']}},_0x3ee675={};_0x3ee675[_0x6261('0x2e')]=_['keys'](db[_0x6261('0x3d')][_0x6261('0x2a')]);_0x3ee675[_0x6261('0x2f')]=_['keys'](_0x7e6e7d[_0x6261('0x2f')]);_0x3ee675[_0x6261('0x38')]=_['intersection'](_0x3ee675[_0x6261('0x2e')],_0x3ee675['query']);_0x325a45[_0x6261('0x30')]=_[_0x6261('0x31')](_0x3ee675[_0x6261('0x2e')],qs['fields'](_0x7e6e7d[_0x6261('0x2f')]['fields']));_0x325a45[_0x6261('0x30')]=_0x325a45[_0x6261('0x30')][_0x6261('0x33')]?_0x325a45[_0x6261('0x30')]:_0x3ee675['model'];if(_0x7e6e7d[_0x6261('0x2f')][_0x6261('0x3e')]){_0x325a45[_0x6261('0x3f')]=[{'all':!![]}];}_0x325a45=_[_0x6261('0x3b')]({},_0x325a45,_0x7e6e7d[_0x6261('0x3c')]);return db['JscriptyQuestionReport'][_0x6261('0x45')](_0x325a45)['then'](handleEntityNotFound(_0x73a47f,null))[_0x6261('0x22')](respondWithResult(_0x73a47f,null))['catch'](handleError(_0x73a47f,null));};exports['create']=function(_0x4e21a7,_0x222d4c){return db[_0x6261('0x3d')][_0x6261('0x46')](_0x4e21a7['body'],{})[_0x6261('0x22')](respondWithResult(_0x222d4c,0xc9))['catch'](handleError(_0x222d4c,null));};exports[_0x6261('0x47')]=function(_0x3e7c78,_0x1f8aba){if(_0x3e7c78[_0x6261('0x48')]['id']){delete _0x3e7c78[_0x6261('0x48')]['id'];}return db['JscriptyQuestionReport'][_0x6261('0x45')]({'where':{'id':_0x3e7c78[_0x6261('0x44')]['id']}})[_0x6261('0x22')](handleEntityNotFound(_0x1f8aba,null))[_0x6261('0x22')](saveUpdates(_0x3e7c78[_0x6261('0x48')],null))['then'](respondWithResult(_0x1f8aba,null))[_0x6261('0x42')](handleError(_0x1f8aba,null));};exports[_0x6261('0x23')]=function(_0x1eb256,_0x10e380){return db[_0x6261('0x3d')][_0x6261('0x45')]({'where':{'id':_0x1eb256[_0x6261('0x44')]['id']}})[_0x6261('0x22')](handleEntityNotFound(_0x10e380,null))[_0x6261('0x22')](removeEntity(_0x10e380,null))[_0x6261('0x42')](handleError(_0x10e380,null));};exports['describe']=function(_0x5a368a,_0x41ef6d){return db[_0x6261('0x3d')][_0x6261('0x49')]()[_0x6261('0x22')](respondWithResult(_0x41ef6d,null))[_0x6261('0x42')](handleError(_0x41ef6d,null));}; \ No newline at end of file +var _0x3f1e=['pick','filter','merge','type','options','JscriptyQuestionReport','findAll','catch','show','fields','includeAll','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../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','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','attributes','length','order','sort','where','filters'];(function(_0x3d03cf,_0x4b8f22){var _0x31ca3a=function(_0x3866e4){while(--_0x3866e4){_0x3d03cf['push'](_0x3d03cf['shift']());}};_0x31ca3a(++_0x4b8f22);}(_0x3f1e,0x174));var _0xe3f1=function(_0x3dd266,_0x4d919f){_0x3dd266=_0x3dd266-0x0;var _0x320665=_0x3f1e[_0x3dd266];return _0x320665;};'use strict';var emlformat=require(_0xe3f1('0x0'));var rimraf=require(_0xe3f1('0x1'));var zipdir=require(_0xe3f1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe3f1('0x3'));var moment=require(_0xe3f1('0x4'));var BPromise=require(_0xe3f1('0x5'));var Mustache=require(_0xe3f1('0x6'));var util=require('util');var path=require(_0xe3f1('0x7'));var sox=require(_0xe3f1('0x8'));var csv=require(_0xe3f1('0x9'));var ejs=require(_0xe3f1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe3f1('0xb'));var crypto=require(_0xe3f1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe3f1('0xd'));var toCsv=require(_0xe3f1('0x9'));var querystring=require('querystring');var Papa=require(_0xe3f1('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe3f1('0xf'));var as=require(_0xe3f1('0x10'));var hardwareService=require(_0xe3f1('0x11'));var logger=require('../../config/logger')(_0xe3f1('0x12'));var utils=require(_0xe3f1('0x13'));var config=require(_0xe3f1('0x14'));var licenseUtil=require(_0xe3f1('0x15'));var db=require(_0xe3f1('0x16'))['db'];function respondWithStatusCode(_0xe7575c,_0x3a301f){_0x3a301f=_0x3a301f||0xcc;return function(_0x54bcb0){if(_0x54bcb0){return _0xe7575c['sendStatus'](_0x3a301f);}return _0xe7575c[_0xe3f1('0x17')](_0x3a301f)[_0xe3f1('0x18')]();};}function respondWithResult(_0x44fc36,_0x3da4cb){_0x3da4cb=_0x3da4cb||0xc8;return function(_0x3f9a48){if(_0x3f9a48){return _0x44fc36[_0xe3f1('0x17')](_0x3da4cb)[_0xe3f1('0x19')](_0x3f9a48);}};}function respondWithFilteredResult(_0x57a354,_0x599355){return function(_0x2f9140){if(_0x2f9140){var _0x40d2f5=typeof _0x599355[_0xe3f1('0x1a')]===_0xe3f1('0x1b')&&typeof _0x599355[_0xe3f1('0x1c')]===_0xe3f1('0x1b');var _0x8e26c=_0x2f9140[_0xe3f1('0x1d')];var _0x4be200=_0x40d2f5?0x0:_0x599355[_0xe3f1('0x1a')];var _0x18847f=_0x40d2f5?_0x2f9140[_0xe3f1('0x1d')]:_0x599355[_0xe3f1('0x1a')]+_0x599355[_0xe3f1('0x1c')];var _0x4b6c8d;if(_0x18847f>=_0x8e26c){_0x18847f=_0x8e26c;_0x4b6c8d=0xc8;}else{_0x4b6c8d=0xce;}_0x57a354['status'](_0x4b6c8d);return _0x57a354['set'](_0xe3f1('0x1e'),_0x4be200+'-'+_0x18847f+'/'+_0x8e26c)[_0xe3f1('0x19')](_0x2f9140);}return null;};}function patchUpdates(_0x70d497){return function(_0x14a04f){try{jsonpatch['apply'](_0x14a04f,_0x70d497,!![]);}catch(_0x1c9ca2){return BPromise[_0xe3f1('0x1f')](_0x1c9ca2);}return _0x14a04f[_0xe3f1('0x20')]();};}function saveUpdates(_0x215c8a,_0x5a21e1){return function(_0xd615a3){if(_0xd615a3){return _0xd615a3[_0xe3f1('0x21')](_0x215c8a)[_0xe3f1('0x22')](function(_0x109f2e){return _0x109f2e;});}return null;};}function removeEntity(_0x474b8e,_0x31d6f9){return function(_0x214282){if(_0x214282){return _0x214282[_0xe3f1('0x23')]()[_0xe3f1('0x22')](function(){_0x474b8e['status'](0xcc)[_0xe3f1('0x18')]();});}};}function handleEntityNotFound(_0x3032a9,_0x359ead){return function(_0x3ad2c3){if(!_0x3ad2c3){_0x3032a9[_0xe3f1('0x24')](0x194);}return _0x3ad2c3;};}function handleError(_0x2bb6cf,_0x18a22a){_0x18a22a=_0x18a22a||0x1f4;return function(_0x5dbf69){logger[_0xe3f1('0x25')](_0x5dbf69[_0xe3f1('0x26')]);if(_0x5dbf69[_0xe3f1('0x27')]){delete _0x5dbf69['name'];}_0x2bb6cf[_0xe3f1('0x17')](_0x18a22a)[_0xe3f1('0x28')](_0x5dbf69);};}exports[_0xe3f1('0x29')]=function(_0x7cd449,_0x4c6e73){var _0x564ca6={},_0x19c0ab={},_0xfc8a24={'count':0x0,'rows':[]};var _0xd7715f=_[_0xe3f1('0x2a')](db['JscriptyQuestionReport'][_0xe3f1('0x2b')],function(_0x36a251){return{'name':_0x36a251[_0xe3f1('0x2c')],'type':_0x36a251['type']['key']};});_0x19c0ab[_0xe3f1('0x2d')]=_['map'](_0xd7715f,_0xe3f1('0x27'));_0x19c0ab[_0xe3f1('0x2e')]=_[_0xe3f1('0x2f')](_0x7cd449[_0xe3f1('0x2e')]);_0x19c0ab['filters']=_['intersection'](_0x19c0ab['model'],_0x19c0ab['query']);_0x564ca6[_0xe3f1('0x30')]=_['intersection'](_0x19c0ab[_0xe3f1('0x2d')],qs['fields'](_0x7cd449[_0xe3f1('0x2e')]['fields']));_0x564ca6[_0xe3f1('0x30')]=_0x564ca6[_0xe3f1('0x30')][_0xe3f1('0x31')]?_0x564ca6[_0xe3f1('0x30')]:_0x19c0ab[_0xe3f1('0x2d')];if(!_0x7cd449[_0xe3f1('0x2e')]['hasOwnProperty']('nolimit')){_0x564ca6[_0xe3f1('0x1c')]=qs[_0xe3f1('0x1c')](_0x7cd449[_0xe3f1('0x2e')]['limit']);_0x564ca6[_0xe3f1('0x1a')]=qs[_0xe3f1('0x1a')](_0x7cd449[_0xe3f1('0x2e')]['offset']);}_0x564ca6[_0xe3f1('0x32')]=qs[_0xe3f1('0x33')](_0x7cd449[_0xe3f1('0x2e')][_0xe3f1('0x33')]);_0x564ca6[_0xe3f1('0x34')]=qs[_0xe3f1('0x35')](_[_0xe3f1('0x36')](_0x7cd449[_0xe3f1('0x2e')],_0x19c0ab[_0xe3f1('0x35')]),_0xd7715f);if(_0x7cd449[_0xe3f1('0x2e')][_0xe3f1('0x37')]){_0x564ca6[_0xe3f1('0x34')]=_[_0xe3f1('0x38')](_0x564ca6[_0xe3f1('0x34')],{'$or':_[_0xe3f1('0x2a')](_0xd7715f,function(_0x2891c2){if(_0x2891c2[_0xe3f1('0x39')]!=='VIRTUAL'){var _0x464e68={};_0x464e68[_0x2891c2[_0xe3f1('0x27')]]={'$like':'%'+_0x7cd449[_0xe3f1('0x2e')][_0xe3f1('0x37')]+'%'};return _0x464e68;}})});}_0x564ca6=_[_0xe3f1('0x38')]({},_0x564ca6,_0x7cd449[_0xe3f1('0x3a')]);var _0x12bc55={'where':_0x564ca6[_0xe3f1('0x34')]};return db[_0xe3f1('0x3b')]['count'](_0x12bc55)[_0xe3f1('0x22')](function(_0x12ae43){_0xfc8a24[_0xe3f1('0x1d')]=_0x12ae43;if(_0x7cd449[_0xe3f1('0x2e')]['includeAll']){_0x564ca6['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xe3f1('0x3c')](_0x564ca6);})[_0xe3f1('0x22')](function(_0x221b75){_0xfc8a24['rows']=_0x221b75;return _0xfc8a24;})['then'](respondWithFilteredResult(_0x4c6e73,_0x564ca6))[_0xe3f1('0x3d')](handleError(_0x4c6e73,null));};exports[_0xe3f1('0x3e')]=function(_0x220dd6,_0xd2ccde){var _0x5afe5f={'raw':!![],'where':{'id':_0x220dd6['params']['id']}},_0x142932={};_0x142932[_0xe3f1('0x2d')]=_[_0xe3f1('0x2f')](db[_0xe3f1('0x3b')][_0xe3f1('0x2b')]);_0x142932[_0xe3f1('0x2e')]=_[_0xe3f1('0x2f')](_0x220dd6['query']);_0x142932[_0xe3f1('0x35')]=_['intersection'](_0x142932[_0xe3f1('0x2d')],_0x142932[_0xe3f1('0x2e')]);_0x5afe5f[_0xe3f1('0x30')]=_['intersection'](_0x142932[_0xe3f1('0x2d')],qs[_0xe3f1('0x3f')](_0x220dd6[_0xe3f1('0x2e')][_0xe3f1('0x3f')]));_0x5afe5f[_0xe3f1('0x30')]=_0x5afe5f['attributes'][_0xe3f1('0x31')]?_0x5afe5f[_0xe3f1('0x30')]:_0x142932[_0xe3f1('0x2d')];if(_0x220dd6[_0xe3f1('0x2e')][_0xe3f1('0x40')]){_0x5afe5f[_0xe3f1('0x41')]=[{'all':!![]}];}_0x5afe5f=_[_0xe3f1('0x38')]({},_0x5afe5f,_0x220dd6[_0xe3f1('0x3a')]);return db[_0xe3f1('0x3b')][_0xe3f1('0x42')](_0x5afe5f)[_0xe3f1('0x22')](handleEntityNotFound(_0xd2ccde,null))[_0xe3f1('0x22')](respondWithResult(_0xd2ccde,null))[_0xe3f1('0x3d')](handleError(_0xd2ccde,null));};exports[_0xe3f1('0x43')]=function(_0x524103,_0x1b1b1d){return db['JscriptyQuestionReport'][_0xe3f1('0x43')](_0x524103[_0xe3f1('0x44')],{})['then'](respondWithResult(_0x1b1b1d,0xc9))['catch'](handleError(_0x1b1b1d,null));};exports[_0xe3f1('0x21')]=function(_0x5e12c9,_0x5d4f01){if(_0x5e12c9[_0xe3f1('0x44')]['id']){delete _0x5e12c9[_0xe3f1('0x44')]['id'];}return db[_0xe3f1('0x3b')][_0xe3f1('0x42')]({'where':{'id':_0x5e12c9[_0xe3f1('0x45')]['id']}})[_0xe3f1('0x22')](handleEntityNotFound(_0x5d4f01,null))[_0xe3f1('0x22')](saveUpdates(_0x5e12c9[_0xe3f1('0x44')],null))[_0xe3f1('0x22')](respondWithResult(_0x5d4f01,null))[_0xe3f1('0x3d')](handleError(_0x5d4f01,null));};exports['destroy']=function(_0x5b59be,_0x3dcdf8){return db[_0xe3f1('0x3b')][_0xe3f1('0x42')]({'where':{'id':_0x5b59be[_0xe3f1('0x45')]['id']}})[_0xe3f1('0x22')](handleEntityNotFound(_0x3dcdf8,null))[_0xe3f1('0x22')](removeEntity(_0x3dcdf8,null))['catch'](handleError(_0x3dcdf8,null));};exports[_0xe3f1('0x46')]=function(_0xdb31e2,_0x365b06){return db[_0xe3f1('0x3b')][_0xe3f1('0x46')]()[_0xe3f1('0x22')](respondWithResult(_0x365b06,null))[_0xe3f1('0x3d')](handleError(_0x365b06,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 3549ab2..ec11586 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 _0xe10b=['JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xe10b,0xc0));var _0xbe10=function(_0x44ecad,_0x5b9c23){_0x44ecad=_0x44ecad-0x0;var _0x3a8f31=_0xe10b[_0x44ecad];return _0x3a8f31;};'use strict';var _=require(_0xbe10('0x0'));var util=require('util');var logger=require(_0xbe10('0x1'))('api');var moment=require(_0xbe10('0x2'));var BPromise=require('bluebird');var rp=require(_0xbe10('0x3'));var fs=require('fs');var path=require(_0xbe10('0x4'));var rimraf=require(_0xbe10('0x5'));var config=require(_0xbe10('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x2be7fe,_0x28a34f){return _0x2be7fe[_0xbe10('0x7')](_0xbe10('0x8'),attributes,{'tableName':_0xbe10('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb20a=['api','moment','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','util','../../config/logger'];(function(_0x523f96,_0x3dc237){var _0x460397=function(_0x116378){while(--_0x116378){_0x523f96['push'](_0x523f96['shift']());}};_0x460397(++_0x3dc237);}(_0xb20a,0x141));var _0xab20=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xb20a[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0xab20('0x0'));var util=require(_0xab20('0x1'));var logger=require(_0xab20('0x2'))(_0xab20('0x3'));var moment=require(_0xab20('0x4'));var BPromise=require('bluebird');var rp=require(_0xab20('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab20('0x6'));var config=require(_0xab20('0x7'));var attributes=require(_0xab20('0x8'));module[_0xab20('0x9')]=function(_0x3fd3b0,_0x1c99c5){return _0x3fd3b0[_0xab20('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0xab20('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 2d1e3db..4e43a04 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 _0xa313=['http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x409b5a,_0x2199be){var _0x30a369=function(_0x57e9b0){while(--_0x57e9b0){_0x409b5a['push'](_0x409b5a['shift']());}};_0x30a369(++_0x2199be);}(_0xa313,0x1aa));var _0x3a31=function(_0x1dc01f,_0x157a75){_0x1dc01f=_0x1dc01f-0x0;var _0x298041=_0xa313[_0x1dc01f];return _0x298041;};'use strict';var _=require(_0x3a31('0x0'));var util=require(_0x3a31('0x1'));var moment=require(_0x3a31('0x2'));var BPromise=require(_0x3a31('0x3'));var rs=require(_0x3a31('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a31('0x5'))['db'];var utils=require(_0x3a31('0x6'));var logger=require('../../config/logger')(_0x3a31('0x7'));var config=require(_0x3a31('0x8'));var jayson=require(_0x3a31('0x9'));var client=jayson[_0x3a31('0xa')][_0x3a31('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16bc30,_0x96efc6,_0x327202){return new BPromise(function(_0x4c6a97,_0x312860){return client[_0x3a31('0xc')](_0x16bc30,_0x327202)[_0x3a31('0xd')](function(_0x2548f4){logger[_0x3a31('0xe')](_0x3a31('0xf'),_0x96efc6,'request\x20sent');logger[_0x3a31('0x10')](_0x3a31('0x11'),_0x96efc6,_0x3a31('0x12'),JSON[_0x3a31('0x13')](_0x2548f4));if(_0x2548f4['error']){if(_0x2548f4[_0x3a31('0x14')]['code']===0x1f4){logger[_0x3a31('0x14')](_0x3a31('0xf'),_0x96efc6,_0x2548f4[_0x3a31('0x14')]['message']);return _0x312860(_0x2548f4[_0x3a31('0x14')][_0x3a31('0x15')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x96efc6,_0x2548f4[_0x3a31('0x14')][_0x3a31('0x15')]);return _0x4c6a97(_0x2548f4['error'][_0x3a31('0x15')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x96efc6,'request\x20sent');_0x4c6a97(_0x2548f4[_0x3a31('0x16')][_0x3a31('0x15')]);}})['catch'](function(_0x8aaa65){logger[_0x3a31('0x14')](_0x3a31('0xf'),_0x96efc6,_0x8aaa65);_0x312860(_0x8aaa65);});});} \ No newline at end of file +var _0xcfc2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x120478,_0xba2a22){var _0x16014e=function(_0x48111d){while(--_0x48111d){_0x120478['push'](_0x120478['shift']());}};_0x16014e(++_0xba2a22);}(_0xcfc2,0x107));var _0x2cfc=function(_0x4ff232,_0x5dfc30){_0x4ff232=_0x4ff232-0x0;var _0x5b4ce0=_0xcfc2[_0x4ff232];return _0x5b4ce0;};'use strict';var _=require(_0x2cfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2cfc('0x1'));var rs=require(_0x2cfc('0x2'));var fs=require('fs');var Redis=require(_0x2cfc('0x3'));var db=require(_0x2cfc('0x4'))['db'];var utils=require(_0x2cfc('0x5'));var logger=require(_0x2cfc('0x6'))(_0x2cfc('0x7'));var config=require(_0x2cfc('0x8'));var jayson=require(_0x2cfc('0x9'));var client=jayson[_0x2cfc('0xa')][_0x2cfc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b9200,_0x1a0892,_0x938f61){return new BPromise(function(_0x1ecd8a,_0x4f3c4b){return client['request'](_0x5b9200,_0x938f61)[_0x2cfc('0xc')](function(_0x3bc678){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1a0892,'request\x20sent');logger[_0x2cfc('0xd')](_0x2cfc('0xe'),_0x1a0892,_0x2cfc('0xf'),JSON[_0x2cfc('0x10')](_0x3bc678));if(_0x3bc678[_0x2cfc('0x11')]){if(_0x3bc678['error'][_0x2cfc('0x12')]===0x1f4){logger[_0x2cfc('0x11')](_0x2cfc('0x13'),_0x1a0892,_0x3bc678['error'][_0x2cfc('0x14')]);return _0x4f3c4b(_0x3bc678[_0x2cfc('0x11')][_0x2cfc('0x14')]);}logger[_0x2cfc('0x11')](_0x2cfc('0x13'),_0x1a0892,_0x3bc678[_0x2cfc('0x11')][_0x2cfc('0x14')]);return _0x1ecd8a(_0x3bc678[_0x2cfc('0x11')][_0x2cfc('0x14')]);}else{logger[_0x2cfc('0x15')](_0x2cfc('0x13'),_0x1a0892,'request\x20sent');_0x1ecd8a(_0x3bc678[_0x2cfc('0x16')][_0x2cfc('0x14')]);}})[_0x2cfc('0x17')](function(_0x36ee61){logger[_0x2cfc('0x11')](_0x2cfc('0x13'),_0x1a0892,_0x36ee61);_0x4f3c4b(_0x36ee61);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 08dc19f..097d6e6 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 _0x220a=['/:id/questions','getQuestions','post','create','put','/:id','multer','util','path','express','Router','../../components/auth/service','./jscriptySessionReport.controller','get','isAuthenticated','describe','show'];(function(_0x50fc19,_0x2685e7){var _0x30c392=function(_0x5763f6){while(--_0x5763f6){_0x50fc19['push'](_0x50fc19['shift']());}};_0x30c392(++_0x2685e7);}(_0x220a,0x1c0));var _0xa220=function(_0xa77b93,_0x44f9b8){_0xa77b93=_0xa77b93-0x0;var _0x30244f=_0x220a[_0xa77b93];return _0x30244f;};'use strict';var multer=require(_0xa220('0x0'));var util=require(_0xa220('0x1'));var path=require(_0xa220('0x2'));var timeout=require('connect-timeout');var express=require(_0xa220('0x3'));var router=express[_0xa220('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa220('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa220('0x6'));router[_0xa220('0x7')]('/',auth[_0xa220('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa220('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa220('0xa')]);router[_0xa220('0x7')](_0xa220('0xb'),auth[_0xa220('0x8')](),controller[_0xa220('0xc')]);router[_0xa220('0xd')]('/',auth[_0xa220('0x8')](),controller[_0xa220('0xe')]);router[_0xa220('0xf')]('/:id',auth[_0xa220('0x8')](),controller['update']);router['delete'](_0xa220('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7ffb=['../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','show','/:id/questions','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x21c49f,_0x43a21e){var _0x19094a=function(_0x3d6c61){while(--_0x3d6c61){_0x21c49f['push'](_0x21c49f['shift']());}};_0x19094a(++_0x43a21e);}(_0x7ffb,0x1c8));var _0xb7ff=function(_0x3b5bca,_0x326805){_0x3b5bca=_0x3b5bca-0x0;var _0x39833=_0x7ffb[_0x3b5bca];return _0x39833;};'use strict';var multer=require(_0xb7ff('0x0'));var util=require(_0xb7ff('0x1'));var path=require(_0xb7ff('0x2'));var timeout=require(_0xb7ff('0x3'));var express=require('express');var router=express[_0xb7ff('0x4')]();var fs_extra=require(_0xb7ff('0x5'));var auth=require(_0xb7ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb7ff('0x7'));var controller=require(_0xb7ff('0x8'));router[_0xb7ff('0x9')]('/',auth[_0xb7ff('0xa')](),controller['index']);router['get'](_0xb7ff('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xb7ff('0x9')]('/:id',auth[_0xb7ff('0xa')](),controller[_0xb7ff('0xc')]);router[_0xb7ff('0x9')](_0xb7ff('0xd'),auth[_0xb7ff('0xa')](),controller['getQuestions']);router[_0xb7ff('0xe')]('/',auth[_0xb7ff('0xa')](),controller['create']);router[_0xb7ff('0xf')](_0xb7ff('0x10'),auth[_0xb7ff('0xa')](),controller[_0xb7ff('0x11')]);router[_0xb7ff('0x12')](_0xb7ff('0x10'),auth[_0xb7ff('0xa')](),controller[_0xb7ff('0x13')]);module[_0xb7ff('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 4776ad3..040c947 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 _0xb8e3=['exports','DATE','setDataValue','starttime','endtime','format','STRING','BOOLEAN','moment','sequelize'];(function(_0x1cec0d,_0x2afa5a){var _0x4f8a55=function(_0x383b97){while(--_0x383b97){_0x1cec0d['push'](_0x1cec0d['shift']());}};_0x4f8a55(++_0x2afa5a);}(_0xb8e3,0x102));var _0x3b8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb8e3[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x3b8e('0x0'));var Sequelize=require(_0x3b8e('0x1'));module[_0x3b8e('0x2')]={'starttime':{'type':Sequelize[_0x3b8e('0x3')],'set':function(_0x3dd1bc){this[_0x3b8e('0x4')](_0x3b8e('0x5'),_0x3dd1bc);this[_0x3b8e('0x4')](_0x3b8e('0x6'),moment()[_0x3b8e('0x7')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x3b8e('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x3b8e('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3b8e('0x8')]},'calleridname':{'type':Sequelize[_0x3b8e('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x3b8e('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xfe8f=['setDataValue','starttime','endtime','STRING','DATE'];(function(_0x891b37,_0x433605){var _0x402957=function(_0x26c530){while(--_0x26c530){_0x891b37['push'](_0x891b37['shift']());}};_0x402957(++_0x433605);}(_0xfe8f,0xdb));var _0xffe8=function(_0x4c5c83,_0x368d36){_0x4c5c83=_0x4c5c83-0x0;var _0x3bd82f=_0xfe8f[_0x4c5c83];return _0x3bd82f;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0xffe8('0x0')],'set':function(_0x1ca81){this[_0xffe8('0x1')](_0xffe8('0x2'),_0x1ca81);this[_0xffe8('0x1')](_0xffe8('0x3'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xffe8('0x0')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xffe8('0x4')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xffe8('0x4')]},'calleridname':{'type':Sequelize[_0xffe8('0x4')]},'calleridnum':{'type':Sequelize[_0xffe8('0x4')]},'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 9457605..de5c71f 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 _0x191c=['JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','body','describe','getQuestions','findOne','nolimit','SessionId'];(function(_0x320b8e,_0x1da3fe){var _0x55a10a=function(_0x148a56){while(--_0x148a56){_0x320b8e['push'](_0x320b8e['shift']());}};_0x55a10a(++_0x1da3fe);}(_0x191c,0xe8));var _0xc191=function(_0x428edb,_0x3f0f0d){_0x428edb=_0x428edb-0x0;var _0x12f21a=_0x191c[_0x428edb];return _0x12f21a;};'use strict';var emlformat=require(_0xc191('0x0'));var rimraf=require(_0xc191('0x1'));var zipdir=require(_0xc191('0x2'));var jsonpatch=require(_0xc191('0x3'));var rp=require(_0xc191('0x4'));var moment=require(_0xc191('0x5'));var BPromise=require(_0xc191('0x6'));var Mustache=require(_0xc191('0x7'));var util=require(_0xc191('0x8'));var path=require('path');var sox=require(_0xc191('0x9'));var csv=require(_0xc191('0xa'));var ejs=require(_0xc191('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc191('0xc'));var squel=require('squel');var crypto=require(_0xc191('0xd'));var jsforce=require(_0xc191('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc191('0xa'));var querystring=require(_0xc191('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc191('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc191('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc191('0x12'));var db=require(_0xc191('0x13'))['db'];function respondWithStatusCode(_0x15befe,_0x31ad10){_0x31ad10=_0x31ad10||0xcc;return function(_0x5e6fe9){if(_0x5e6fe9){return _0x15befe['sendStatus'](_0x31ad10);}return _0x15befe[_0xc191('0x14')](_0x31ad10)[_0xc191('0x15')]();};}function respondWithResult(_0x5f575e,_0x2f2aa4){_0x2f2aa4=_0x2f2aa4||0xc8;return function(_0x58657b){if(_0x58657b){return _0x5f575e['status'](_0x2f2aa4)[_0xc191('0x16')](_0x58657b);}};}function respondWithFilteredResult(_0x4d6abb,_0x1e66ae){return function(_0x6d9a7e){if(_0x6d9a7e){var _0x347094=typeof _0x1e66ae['offset']===_0xc191('0x17')&&typeof _0x1e66ae[_0xc191('0x18')]===_0xc191('0x17');var _0x375f9b=_0x6d9a7e['count'];var _0x112f16=_0x347094?0x0:_0x1e66ae[_0xc191('0x19')];var _0x362c4f=_0x347094?_0x6d9a7e[_0xc191('0x1a')]:_0x1e66ae[_0xc191('0x19')]+_0x1e66ae['limit'];var _0x5c2bcb;if(_0x362c4f>=_0x375f9b){_0x362c4f=_0x375f9b;_0x5c2bcb=0xc8;}else{_0x5c2bcb=0xce;}_0x4d6abb[_0xc191('0x14')](_0x5c2bcb);return _0x4d6abb[_0xc191('0x1b')](_0xc191('0x1c'),_0x112f16+'-'+_0x362c4f+'/'+_0x375f9b)[_0xc191('0x16')](_0x6d9a7e);}return null;};}function patchUpdates(_0x40bfd2){return function(_0x32ffab){try{jsonpatch[_0xc191('0x1d')](_0x32ffab,_0x40bfd2,!![]);}catch(_0x3758d6){return BPromise[_0xc191('0x1e')](_0x3758d6);}return _0x32ffab[_0xc191('0x1f')]();};}function saveUpdates(_0x380f51,_0x4bfb5c){return function(_0x279af0){if(_0x279af0){return _0x279af0[_0xc191('0x20')](_0x380f51)[_0xc191('0x21')](function(_0xe34d4d){return _0xe34d4d;});}return null;};}function removeEntity(_0x1e6ce2,_0x36fcf5){return function(_0x5ca9eb){if(_0x5ca9eb){return _0x5ca9eb[_0xc191('0x22')]()[_0xc191('0x21')](function(){_0x1e6ce2['status'](0xcc)[_0xc191('0x15')]();});}};}function handleEntityNotFound(_0x4ff3c4,_0x1762d1){return function(_0x556e52){if(!_0x556e52){_0x4ff3c4[_0xc191('0x23')](0x194);}return _0x556e52;};}function handleError(_0x455b62,_0x2e04f4){_0x2e04f4=_0x2e04f4||0x1f4;return function(_0x58272e){logger[_0xc191('0x24')](_0x58272e['stack']);if(_0x58272e[_0xc191('0x25')]){delete _0x58272e[_0xc191('0x25')];}_0x455b62[_0xc191('0x14')](_0x2e04f4)[_0xc191('0x26')](_0x58272e);};}exports['index']=function(_0x2a000f,_0x3d4c55){var _0x2c096b={},_0x3d272b={},_0x29c9e2={'count':0x0,'rows':[]};var _0x373380=_[_0xc191('0x27')](db[_0xc191('0x28')][_0xc191('0x29')],function(_0x523f89){return{'name':_0x523f89[_0xc191('0x2a')],'type':_0x523f89[_0xc191('0x2b')]['key']};});_0x3d272b['model']=_[_0xc191('0x27')](_0x373380,'name');_0x3d272b[_0xc191('0x2c')]=_['keys'](_0x2a000f[_0xc191('0x2c')]);_0x3d272b[_0xc191('0x2d')]=_[_0xc191('0x2e')](_0x3d272b[_0xc191('0x2f')],_0x3d272b['query']);_0x2c096b[_0xc191('0x30')]=_[_0xc191('0x2e')](_0x3d272b[_0xc191('0x2f')],qs[_0xc191('0x31')](_0x2a000f[_0xc191('0x2c')][_0xc191('0x31')]));_0x2c096b[_0xc191('0x30')]=_0x2c096b['attributes'][_0xc191('0x32')]?_0x2c096b[_0xc191('0x30')]:_0x3d272b['model'];if(!_0x2a000f[_0xc191('0x2c')][_0xc191('0x33')]('nolimit')){_0x2c096b[_0xc191('0x18')]=qs['limit'](_0x2a000f[_0xc191('0x2c')][_0xc191('0x18')]);_0x2c096b[_0xc191('0x19')]=qs[_0xc191('0x19')](_0x2a000f[_0xc191('0x2c')][_0xc191('0x19')]);}_0x2c096b[_0xc191('0x34')]=qs[_0xc191('0x35')](_0x2a000f[_0xc191('0x2c')][_0xc191('0x35')]);_0x2c096b[_0xc191('0x36')]=qs[_0xc191('0x2d')](_[_0xc191('0x37')](_0x2a000f['query'],_0x3d272b[_0xc191('0x2d')]),_0x373380);if(_0x2a000f[_0xc191('0x2c')][_0xc191('0x38')]){_0x2c096b[_0xc191('0x36')]=_[_0xc191('0x39')](_0x2c096b['where'],{'$or':_[_0xc191('0x27')](_0x373380,function(_0x23d46a){if(_0x23d46a[_0xc191('0x2b')]!==_0xc191('0x3a')){var _0x13e2eb={};_0x13e2eb[_0x23d46a[_0xc191('0x25')]]={'$like':'%'+_0x2a000f[_0xc191('0x2c')][_0xc191('0x38')]+'%'};return _0x13e2eb;}})});}_0x2c096b=_[_0xc191('0x39')]({},_0x2c096b,_0x2a000f['options']);var _0x48d423={'where':_0x2c096b[_0xc191('0x36')]};return db[_0xc191('0x28')][_0xc191('0x1a')](_0x48d423)[_0xc191('0x21')](function(_0xaf1455){_0x29c9e2['count']=_0xaf1455;if(_0x2a000f[_0xc191('0x2c')][_0xc191('0x3b')]){_0x2c096b['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xc191('0x3c')](_0x2c096b);})['then'](function(_0x5b7d3c){_0x29c9e2[_0xc191('0x3d')]=_0x5b7d3c;return _0x29c9e2;})[_0xc191('0x21')](respondWithFilteredResult(_0x3d4c55,_0x2c096b))[_0xc191('0x3e')](handleError(_0x3d4c55,null));};exports[_0xc191('0x3f')]=function(_0x3dce48,_0x46f130){var _0x2d8765={'raw':!![],'where':{'id':_0x3dce48[_0xc191('0x40')]['id']}},_0x37f51e={};_0x37f51e[_0xc191('0x2f')]=_[_0xc191('0x41')](db[_0xc191('0x28')]['rawAttributes']);_0x37f51e[_0xc191('0x2c')]=_[_0xc191('0x41')](_0x3dce48['query']);_0x37f51e[_0xc191('0x2d')]=_['intersection'](_0x37f51e[_0xc191('0x2f')],_0x37f51e[_0xc191('0x2c')]);_0x2d8765[_0xc191('0x30')]=_[_0xc191('0x2e')](_0x37f51e[_0xc191('0x2f')],qs[_0xc191('0x31')](_0x3dce48[_0xc191('0x2c')][_0xc191('0x31')]));_0x2d8765[_0xc191('0x30')]=_0x2d8765[_0xc191('0x30')]['length']?_0x2d8765[_0xc191('0x30')]:_0x37f51e[_0xc191('0x2f')];if(_0x3dce48['query'][_0xc191('0x3b')]){_0x2d8765[_0xc191('0x42')]=[{'all':!![]}];}_0x2d8765=_[_0xc191('0x39')]({},_0x2d8765,_0x3dce48[_0xc191('0x43')]);return db[_0xc191('0x28')][_0xc191('0x44')](_0x2d8765)[_0xc191('0x21')](handleEntityNotFound(_0x46f130,null))['then'](respondWithResult(_0x46f130,null))[_0xc191('0x3e')](handleError(_0x46f130,null));};exports[_0xc191('0x45')]=function(_0x1076e1,_0x41b650){return db[_0xc191('0x28')][_0xc191('0x45')](_0x1076e1[_0xc191('0x46')],{})['then'](respondWithResult(_0x41b650,0xc9))['catch'](handleError(_0x41b650,null));};exports[_0xc191('0x20')]=function(_0x42f5a3,_0x2cbd38){if(_0x42f5a3[_0xc191('0x46')]['id']){delete _0x42f5a3['body']['id'];}return db['JscriptySessionReport'][_0xc191('0x44')]({'where':{'id':_0x42f5a3['params']['id']}})[_0xc191('0x21')](handleEntityNotFound(_0x2cbd38,null))[_0xc191('0x21')](saveUpdates(_0x42f5a3[_0xc191('0x46')],null))['then'](respondWithResult(_0x2cbd38,null))[_0xc191('0x3e')](handleError(_0x2cbd38,null));};exports['destroy']=function(_0x597644,_0x1952fb){return db['JscriptySessionReport'][_0xc191('0x44')]({'where':{'id':_0x597644[_0xc191('0x40')]['id']}})['then'](handleEntityNotFound(_0x1952fb,null))[_0xc191('0x21')](removeEntity(_0x1952fb,null))[_0xc191('0x3e')](handleError(_0x1952fb,null));};exports[_0xc191('0x47')]=function(_0xe779c5,_0x3dff46){return db[_0xc191('0x28')]['describe']()[_0xc191('0x21')](respondWithResult(_0x3dff46,null))[_0xc191('0x3e')](handleError(_0x3dff46,null));};exports[_0xc191('0x48')]=function(_0x248b47,_0x463277,_0x24777c){var _0x1cddb2={'raw':!![],'where':{}};var _0x10742d={};var _0x53b3dc={'count':0x0,'rows':[]};return db[_0xc191('0x28')][_0xc191('0x49')]({'where':{'id':_0x248b47[_0xc191('0x40')]['id']}})[_0xc191('0x21')](handleEntityNotFound(_0x463277,null))[_0xc191('0x21')](function(_0x52c85c){if(_0x52c85c){_0x10742d[_0xc191('0x2f')]=_[_0xc191('0x41')](db['JscriptyQuestionReport'][_0xc191('0x29')]);_0x10742d['query']=_[_0xc191('0x41')](_0x248b47[_0xc191('0x2c')]);_0x10742d[_0xc191('0x2d')]=_[_0xc191('0x2e')](_0x10742d[_0xc191('0x2f')],_0x10742d['query']);_0x1cddb2[_0xc191('0x30')]=_[_0xc191('0x2e')](_0x10742d['model'],qs[_0xc191('0x31')](_0x248b47['query']['fields']));_0x1cddb2[_0xc191('0x30')]=_0x1cddb2['attributes'][_0xc191('0x32')]?_0x1cddb2[_0xc191('0x30')]:_0x10742d[_0xc191('0x2f')];if(!_0x248b47[_0xc191('0x2c')][_0xc191('0x33')](_0xc191('0x4a'))){_0x1cddb2[_0xc191('0x18')]=qs[_0xc191('0x18')](_0x248b47[_0xc191('0x2c')]['limit']);_0x1cddb2[_0xc191('0x19')]=qs[_0xc191('0x19')](_0x248b47[_0xc191('0x2c')][_0xc191('0x19')]);}_0x1cddb2[_0xc191('0x34')]=qs[_0xc191('0x35')](_0x248b47[_0xc191('0x2c')][_0xc191('0x35')]);_0x1cddb2['where']=qs[_0xc191('0x2d')](_['pick'](_0x248b47['query'],_0x10742d['filters']));_0x1cddb2[_0xc191('0x36')][_0xc191('0x4b')]=_0x52c85c['id'];if(_0x248b47[_0xc191('0x2c')][_0xc191('0x38')]){_0x1cddb2[_0xc191('0x36')]=_[_0xc191('0x39')](_0x1cddb2[_0xc191('0x36')],{'$or':_[_0xc191('0x27')](_0x1cddb2[_0xc191('0x30')],function(_0x112b0f){var _0x320b01={};_0x320b01[_0x112b0f]={'$like':'%'+_0x248b47[_0xc191('0x2c')][_0xc191('0x38')]+'%'};return _0x320b01;})});}_0x1cddb2=_[_0xc191('0x39')]({},_0x1cddb2,_0x248b47[_0xc191('0x43')]);return db[_0xc191('0x4c')][_0xc191('0x1a')]({'where':_0x1cddb2['where']})['then'](function(_0x44567e){_0x53b3dc[_0xc191('0x1a')]=_0x44567e;if(_0x248b47[_0xc191('0x2c')]['includeAll']){_0x1cddb2[_0xc191('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xc191('0x3c')](_0x1cddb2);})[_0xc191('0x21')](function(_0x8ec503){_0x53b3dc[_0xc191('0x3d')]=_0x8ec503;return _0x53b3dc;});}})['then'](respondWithFilteredResult(_0x463277,_0x1cddb2))[_0xc191('0x3e')](handleError(_0x463277,null));}; \ No newline at end of file +var _0x42ad=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','json','apply','reject','save','destroy','then','error','stack','name','send','index','map','JscriptySessionReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','update','find','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','nolimit','SessionId','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x267221,_0xd0b18f){var _0x1d5fa0=function(_0x2a5307){while(--_0x2a5307){_0x267221['push'](_0x267221['shift']());}};_0x1d5fa0(++_0xd0b18f);}(_0x42ad,0x137));var _0xd42a=function(_0x4e57dc,_0x8dad01){_0x4e57dc=_0x4e57dc-0x0;var _0x36594a=_0x42ad[_0x4e57dc];return _0x36594a;};'use strict';var emlformat=require(_0xd42a('0x0'));var rimraf=require(_0xd42a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd42a('0x2'));var rp=require(_0xd42a('0x3'));var moment=require('moment');var BPromise=require(_0xd42a('0x4'));var Mustache=require(_0xd42a('0x5'));var util=require(_0xd42a('0x6'));var path=require(_0xd42a('0x7'));var sox=require(_0xd42a('0x8'));var csv=require(_0xd42a('0x9'));var ejs=require(_0xd42a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd42a('0xb'));var crypto=require('crypto');var jsforce=require(_0xd42a('0xc'));var deskjs=require(_0xd42a('0xd'));var toCsv=require(_0xd42a('0x9'));var querystring=require(_0xd42a('0xe'));var Papa=require(_0xd42a('0xf'));var Redis=require(_0xd42a('0x10'));var authService=require(_0xd42a('0x11'));var qs=require(_0xd42a('0x12'));var as=require(_0xd42a('0x13'));var hardwareService=require(_0xd42a('0x14'));var logger=require(_0xd42a('0x15'))(_0xd42a('0x16'));var utils=require(_0xd42a('0x17'));var config=require(_0xd42a('0x18'));var licenseUtil=require(_0xd42a('0x19'));var db=require(_0xd42a('0x1a'))['db'];function respondWithStatusCode(_0x2847de,_0x494a95){_0x494a95=_0x494a95||0xcc;return function(_0x4251b1){if(_0x4251b1){return _0x2847de[_0xd42a('0x1b')](_0x494a95);}return _0x2847de['status'](_0x494a95)[_0xd42a('0x1c')]();};}function respondWithResult(_0x12f782,_0x5b8776){_0x5b8776=_0x5b8776||0xc8;return function(_0x5651f8){if(_0x5651f8){return _0x12f782[_0xd42a('0x1d')](_0x5b8776)['json'](_0x5651f8);}};}function respondWithFilteredResult(_0x5347a7,_0x34fe7b){return function(_0x120e26){if(_0x120e26){var _0x13cb2a=typeof _0x34fe7b['offset']===_0xd42a('0x1e')&&typeof _0x34fe7b['limit']==='undefined';var _0x301072=_0x120e26[_0xd42a('0x1f')];var _0x1b28c3=_0x13cb2a?0x0:_0x34fe7b[_0xd42a('0x20')];var _0x11722a=_0x13cb2a?_0x120e26[_0xd42a('0x1f')]:_0x34fe7b[_0xd42a('0x20')]+_0x34fe7b['limit'];var _0x384017;if(_0x11722a>=_0x301072){_0x11722a=_0x301072;_0x384017=0xc8;}else{_0x384017=0xce;}_0x5347a7[_0xd42a('0x1d')](_0x384017);return _0x5347a7['set']('Content-Range',_0x1b28c3+'-'+_0x11722a+'/'+_0x301072)[_0xd42a('0x21')](_0x120e26);}return null;};}function patchUpdates(_0x4634f5){return function(_0x230bb5){try{jsonpatch[_0xd42a('0x22')](_0x230bb5,_0x4634f5,!![]);}catch(_0x43ef03){return BPromise[_0xd42a('0x23')](_0x43ef03);}return _0x230bb5[_0xd42a('0x24')]();};}function saveUpdates(_0x5aa6fe,_0x265634){return function(_0x155043){if(_0x155043){return _0x155043['update'](_0x5aa6fe)['then'](function(_0x32dfc5){return _0x32dfc5;});}return null;};}function removeEntity(_0x2e4305,_0x3a52f1){return function(_0x4bf8d7){if(_0x4bf8d7){return _0x4bf8d7[_0xd42a('0x25')]()[_0xd42a('0x26')](function(){_0x2e4305['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xddd3bd,_0x307204){return function(_0x30f121){if(!_0x30f121){_0xddd3bd[_0xd42a('0x1b')](0x194);}return _0x30f121;};}function handleError(_0x47a5f4,_0x12c054){_0x12c054=_0x12c054||0x1f4;return function(_0x8db3b4){logger[_0xd42a('0x27')](_0x8db3b4[_0xd42a('0x28')]);if(_0x8db3b4[_0xd42a('0x29')]){delete _0x8db3b4[_0xd42a('0x29')];}_0x47a5f4['status'](_0x12c054)[_0xd42a('0x2a')](_0x8db3b4);};}exports[_0xd42a('0x2b')]=function(_0x4df4eb,_0x5976c3){var _0x3ecd98={},_0x2da7d2={},_0x1799c7={'count':0x0,'rows':[]};var _0x266ad6=_[_0xd42a('0x2c')](db[_0xd42a('0x2d')]['rawAttributes'],function(_0x18c1fc){return{'name':_0x18c1fc[_0xd42a('0x2e')],'type':_0x18c1fc[_0xd42a('0x2f')]['key']};});_0x2da7d2[_0xd42a('0x30')]=_[_0xd42a('0x2c')](_0x266ad6,_0xd42a('0x29'));_0x2da7d2[_0xd42a('0x31')]=_[_0xd42a('0x32')](_0x4df4eb['query']);_0x2da7d2[_0xd42a('0x33')]=_[_0xd42a('0x34')](_0x2da7d2[_0xd42a('0x30')],_0x2da7d2[_0xd42a('0x31')]);_0x3ecd98[_0xd42a('0x35')]=_['intersection'](_0x2da7d2[_0xd42a('0x30')],qs[_0xd42a('0x36')](_0x4df4eb['query'][_0xd42a('0x36')]));_0x3ecd98[_0xd42a('0x35')]=_0x3ecd98[_0xd42a('0x35')][_0xd42a('0x37')]?_0x3ecd98['attributes']:_0x2da7d2[_0xd42a('0x30')];if(!_0x4df4eb[_0xd42a('0x31')]['hasOwnProperty']('nolimit')){_0x3ecd98['limit']=qs[_0xd42a('0x38')](_0x4df4eb['query']['limit']);_0x3ecd98[_0xd42a('0x20')]=qs[_0xd42a('0x20')](_0x4df4eb[_0xd42a('0x31')][_0xd42a('0x20')]);}_0x3ecd98[_0xd42a('0x39')]=qs[_0xd42a('0x3a')](_0x4df4eb[_0xd42a('0x31')]['sort']);_0x3ecd98[_0xd42a('0x3b')]=qs[_0xd42a('0x33')](_[_0xd42a('0x3c')](_0x4df4eb[_0xd42a('0x31')],_0x2da7d2[_0xd42a('0x33')]),_0x266ad6);if(_0x4df4eb[_0xd42a('0x31')]['filter']){_0x3ecd98[_0xd42a('0x3b')]=_[_0xd42a('0x3d')](_0x3ecd98['where'],{'$or':_[_0xd42a('0x2c')](_0x266ad6,function(_0x43f41c){if(_0x43f41c['type']!=='VIRTUAL'){var _0x534b29={};_0x534b29[_0x43f41c['name']]={'$like':'%'+_0x4df4eb[_0xd42a('0x31')][_0xd42a('0x3e')]+'%'};return _0x534b29;}})});}_0x3ecd98=_[_0xd42a('0x3d')]({},_0x3ecd98,_0x4df4eb[_0xd42a('0x3f')]);var _0x3500d3={'where':_0x3ecd98[_0xd42a('0x3b')]};return db['JscriptySessionReport'][_0xd42a('0x1f')](_0x3500d3)['then'](function(_0x4e1b08){_0x1799c7[_0xd42a('0x1f')]=_0x4e1b08;if(_0x4df4eb['query']['includeAll']){_0x3ecd98[_0xd42a('0x40')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xd42a('0x41')](_0x3ecd98);})[_0xd42a('0x26')](function(_0x4acf30){_0x1799c7[_0xd42a('0x42')]=_0x4acf30;return _0x1799c7;})[_0xd42a('0x26')](respondWithFilteredResult(_0x5976c3,_0x3ecd98))[_0xd42a('0x43')](handleError(_0x5976c3,null));};exports[_0xd42a('0x44')]=function(_0x2e814d,_0x2922d7){var _0xc515e4={'raw':!![],'where':{'id':_0x2e814d[_0xd42a('0x45')]['id']}},_0x5625f5={};_0x5625f5[_0xd42a('0x30')]=_[_0xd42a('0x32')](db[_0xd42a('0x2d')][_0xd42a('0x46')]);_0x5625f5['query']=_[_0xd42a('0x32')](_0x2e814d[_0xd42a('0x31')]);_0x5625f5[_0xd42a('0x33')]=_['intersection'](_0x5625f5[_0xd42a('0x30')],_0x5625f5[_0xd42a('0x31')]);_0xc515e4['attributes']=_[_0xd42a('0x34')](_0x5625f5[_0xd42a('0x30')],qs['fields'](_0x2e814d['query'][_0xd42a('0x36')]));_0xc515e4['attributes']=_0xc515e4['attributes'][_0xd42a('0x37')]?_0xc515e4[_0xd42a('0x35')]:_0x5625f5[_0xd42a('0x30')];if(_0x2e814d[_0xd42a('0x31')][_0xd42a('0x47')]){_0xc515e4[_0xd42a('0x40')]=[{'all':!![]}];}_0xc515e4=_[_0xd42a('0x3d')]({},_0xc515e4,_0x2e814d[_0xd42a('0x3f')]);return db[_0xd42a('0x2d')]['find'](_0xc515e4)['then'](handleEntityNotFound(_0x2922d7,null))[_0xd42a('0x26')](respondWithResult(_0x2922d7,null))[_0xd42a('0x43')](handleError(_0x2922d7,null));};exports[_0xd42a('0x48')]=function(_0x499fec,_0x14dfb6){return db['JscriptySessionReport'][_0xd42a('0x48')](_0x499fec[_0xd42a('0x49')],{})[_0xd42a('0x26')](respondWithResult(_0x14dfb6,0xc9))[_0xd42a('0x43')](handleError(_0x14dfb6,null));};exports[_0xd42a('0x4a')]=function(_0x22db2f,_0x207d43){if(_0x22db2f[_0xd42a('0x49')]['id']){delete _0x22db2f['body']['id'];}return db[_0xd42a('0x2d')][_0xd42a('0x4b')]({'where':{'id':_0x22db2f[_0xd42a('0x45')]['id']}})[_0xd42a('0x26')](handleEntityNotFound(_0x207d43,null))['then'](saveUpdates(_0x22db2f[_0xd42a('0x49')],null))[_0xd42a('0x26')](respondWithResult(_0x207d43,null))['catch'](handleError(_0x207d43,null));};exports[_0xd42a('0x25')]=function(_0x52ce06,_0x2310e4){return db[_0xd42a('0x2d')]['find']({'where':{'id':_0x52ce06[_0xd42a('0x45')]['id']}})['then'](handleEntityNotFound(_0x2310e4,null))['then'](removeEntity(_0x2310e4,null))[_0xd42a('0x43')](handleError(_0x2310e4,null));};exports['describe']=function(_0x1df6cb,_0x526141){return db[_0xd42a('0x2d')][_0xd42a('0x4c')]()[_0xd42a('0x26')](respondWithResult(_0x526141,null))[_0xd42a('0x43')](handleError(_0x526141,null));};exports[_0xd42a('0x4d')]=function(_0x2efa03,_0xccac65,_0x308ea){var _0x243a02={'raw':!![],'where':{}};var _0x477172={};var _0x4fabfe={'count':0x0,'rows':[]};return db[_0xd42a('0x2d')][_0xd42a('0x4e')]({'where':{'id':_0x2efa03['params']['id']}})[_0xd42a('0x26')](handleEntityNotFound(_0xccac65,null))[_0xd42a('0x26')](function(_0x38be4b){if(_0x38be4b){_0x477172[_0xd42a('0x30')]=_[_0xd42a('0x32')](db[_0xd42a('0x4f')][_0xd42a('0x46')]);_0x477172['query']=_[_0xd42a('0x32')](_0x2efa03[_0xd42a('0x31')]);_0x477172[_0xd42a('0x33')]=_['intersection'](_0x477172[_0xd42a('0x30')],_0x477172[_0xd42a('0x31')]);_0x243a02[_0xd42a('0x35')]=_[_0xd42a('0x34')](_0x477172['model'],qs[_0xd42a('0x36')](_0x2efa03['query'][_0xd42a('0x36')]));_0x243a02[_0xd42a('0x35')]=_0x243a02[_0xd42a('0x35')]['length']?_0x243a02[_0xd42a('0x35')]:_0x477172[_0xd42a('0x30')];if(!_0x2efa03[_0xd42a('0x31')][_0xd42a('0x50')](_0xd42a('0x51'))){_0x243a02[_0xd42a('0x38')]=qs['limit'](_0x2efa03[_0xd42a('0x31')][_0xd42a('0x38')]);_0x243a02[_0xd42a('0x20')]=qs[_0xd42a('0x20')](_0x2efa03[_0xd42a('0x31')]['offset']);}_0x243a02[_0xd42a('0x39')]=qs[_0xd42a('0x3a')](_0x2efa03['query'][_0xd42a('0x3a')]);_0x243a02[_0xd42a('0x3b')]=qs[_0xd42a('0x33')](_[_0xd42a('0x3c')](_0x2efa03[_0xd42a('0x31')],_0x477172[_0xd42a('0x33')]));_0x243a02[_0xd42a('0x3b')][_0xd42a('0x52')]=_0x38be4b['id'];if(_0x2efa03['query'][_0xd42a('0x3e')]){_0x243a02[_0xd42a('0x3b')]=_[_0xd42a('0x3d')](_0x243a02[_0xd42a('0x3b')],{'$or':_['map'](_0x243a02['attributes'],function(_0xa4e357){var _0x5d4848={};_0x5d4848[_0xa4e357]={'$like':'%'+_0x2efa03[_0xd42a('0x31')][_0xd42a('0x3e')]+'%'};return _0x5d4848;})});}_0x243a02=_[_0xd42a('0x3d')]({},_0x243a02,_0x2efa03['options']);return db[_0xd42a('0x4f')][_0xd42a('0x1f')]({'where':_0x243a02[_0xd42a('0x3b')]})['then'](function(_0x8e508e){_0x4fabfe[_0xd42a('0x1f')]=_0x8e508e;if(_0x2efa03['query'][_0xd42a('0x47')]){_0x243a02[_0xd42a('0x40')]=[{'all':!![]}];}return db[_0xd42a('0x4f')]['findAll'](_0x243a02);})[_0xd42a('0x26')](function(_0x50482b){_0x4fabfe[_0xd42a('0x42')]=_0x50482b;return _0x4fabfe;});}})[_0xd42a('0x26')](respondWithFilteredResult(_0xccac65,_0x243a02))['catch'](handleError(_0xccac65,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 9e3f138..434b2d1 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 _0x3831=['define','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptySessionReport.attributes'];(function(_0x3c629a,_0x5e26b7){var _0x27f951=function(_0x1a57f8){while(--_0x1a57f8){_0x3c629a['push'](_0x3c629a['shift']());}};_0x27f951(++_0x5e26b7);}(_0x3831,0x14c));var _0x1383=function(_0x5621e8,_0x257e0d){_0x5621e8=_0x5621e8-0x0;var _0x20d8a7=_0x3831[_0x5621e8];return _0x20d8a7;};'use strict';var _=require(_0x1383('0x0'));var util=require('util');var logger=require(_0x1383('0x1'))(_0x1383('0x2'));var moment=require(_0x1383('0x3'));var BPromise=require(_0x1383('0x4'));var rp=require(_0x1383('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1383('0x6'));var config=require('../../config/environment');var attributes=require(_0x1383('0x7'));module['exports']=function(_0x5b64b1,_0x5eb4d8){return _0x5b64b1[_0x1383('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x1383('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x4339df,_0x568b7d){var _0x38c44c=function(_0x41983d){while(--_0x41983d){_0x4339df['push'](_0x4339df['shift']());}};_0x38c44c(++_0x568b7d);}(_0x7a54,0x106));var _0x47a5=function(_0x44279f,_0x5db944){_0x44279f=_0x44279f-0x0;var _0x223a1f=_0x7a54[_0x44279f];return _0x223a1f;};'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/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 5156bcf..99d59c1 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 _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x4137,0xf8));var _0x7413=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4137[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file +var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x173461,_0x243d0f){var _0x427550=function(_0xb00c53){while(--_0xb00c53){_0x173461['push'](_0x173461['shift']());}};_0x427550(++_0x243d0f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'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')]('JscriptySessionReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index d79f0c4..cc1d39c 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 _0x9fee=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file'];(function(_0x559216,_0xa7d2e9){var _0x552169=function(_0x2ceecb){while(--_0x2ceecb){_0x559216['push'](_0x559216['shift']());}};_0x552169(++_0xa7d2e9);}(_0x9fee,0x1d0));var _0xe9fe=function(_0xfbc692,_0x52f83a){_0xfbc692=_0xfbc692-0x0;var _0x3f2f75=_0x9fee[_0xfbc692];return _0x3f2f75;};'use strict';var multer=require(_0xe9fe('0x0'));var util=require(_0xe9fe('0x1'));var path=require(_0xe9fe('0x2'));var timeout=require(_0xe9fe('0x3'));var express=require('express');var router=express[_0xe9fe('0x4')]();var fs_extra=require(_0xe9fe('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe9fe('0x6'));var config=require(_0xe9fe('0x7'));var controller=require(_0xe9fe('0x8'));router[_0xe9fe('0x9')]('/',controller[_0xe9fe('0xa')]);router[_0xe9fe('0xb')](_0xe9fe('0xc'),auth[_0xe9fe('0xd')](),controller[_0xe9fe('0xe')]);router[_0xe9fe('0x9')](_0xe9fe('0xf'),auth[_0xe9fe('0xd')](),controller['downloadLogFile']);module['exports']=router; \ No newline at end of file +var _0x02cd=['express','Router','fs-extra','../../components/auth/service','./license.controller','put','/:id','isAuthenticated','update','get','/download_log_file','multer','connect-timeout'];(function(_0x4b9bbe,_0x9022de){var _0x591e2a=function(_0x1dc548){while(--_0x1dc548){_0x4b9bbe['push'](_0x4b9bbe['shift']());}};_0x591e2a(++_0x9022de);}(_0x02cd,0x143));var _0xd02c=function(_0x2474ac,_0x335d3a){_0x2474ac=_0x2474ac-0x0;var _0x384a8f=_0x02cd[_0x2474ac];return _0x384a8f;};'use strict';var multer=require(_0xd02c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd02c('0x1'));var express=require(_0xd02c('0x2'));var router=express[_0xd02c('0x3')]();var fs_extra=require(_0xd02c('0x4'));var auth=require(_0xd02c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd02c('0x6'));router['get']('/',controller['index']);router[_0xd02c('0x7')](_0xd02c('0x8'),auth[_0xd02c('0x9')](),controller[_0xd02c('0xa')]);router[_0xd02c('0xb')](_0xd02c('0xc'),auth[_0xd02c('0x9')](),controller['downloadLogFile']);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 9762caf..b4a0f2b 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 _0x7ff0=['INTEGER','exports','TEXT','STRING'];(function(_0x577d42,_0x3b3069){var _0x3ade05=function(_0x16518e){while(--_0x16518e){_0x577d42['push'](_0x577d42['shift']());}};_0x3ade05(++_0x3b3069);}(_0x7ff0,0x1c1));var _0x07ff=function(_0x2b1551,_0x1776fe){_0x2b1551=_0x2b1551-0x0;var _0x2fc2a1=_0x7ff0[_0x2b1551];return _0x2fc2a1;};'use strict';var Sequelize=require('sequelize');module[_0x07ff('0x0')]={'license':{'type':Sequelize[_0x07ff('0x1')]},'data1':{'type':Sequelize[_0x07ff('0x2')]},'data2':{'type':Sequelize[_0x07ff('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x07ff('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x36db=['sequelize','STRING','INTEGER'];(function(_0xbc5d75,_0x3cbaf2){var _0x499e46=function(_0x394439){while(--_0x394439){_0xbc5d75['push'](_0xbc5d75['shift']());}};_0x499e46(++_0x3cbaf2);}(_0x36db,0x16b));var _0xb36d=function(_0x136290,_0x3e6b8f){_0x136290=_0x136290-0x0;var _0x290e92=_0x36db[_0x136290];return _0x290e92;};'use strict';var Sequelize=require(_0xb36d('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xb36d('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xb36d('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index acdeace..2fac626 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 _0xcec8=['demo','join','/var','log','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','save','update','then','sendStatus','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','catch','body','find','params','get','checkLicense'];(function(_0x1ed579,_0x206ebc){var _0x793273=function(_0x56c373){while(--_0x56c373){_0x1ed579['push'](_0x1ed579['shift']());}};_0x793273(++_0x206ebc);}(_0xcec8,0xd5));var _0x8cec=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0xcec8[_0x56fe98];return _0x212f4f;};'use strict';var emlformat=require(_0x8cec('0x0'));var rimraf=require(_0x8cec('0x1'));var zipdir=require(_0x8cec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8cec('0x3'));var moment=require('moment');var BPromise=require(_0x8cec('0x4'));var Mustache=require(_0x8cec('0x5'));var util=require('util');var path=require(_0x8cec('0x6'));var sox=require(_0x8cec('0x7'));var csv=require(_0x8cec('0x8'));var ejs=require(_0x8cec('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8cec('0xa'));var squel=require(_0x8cec('0xb'));var crypto=require('crypto');var jsforce=require(_0x8cec('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8cec('0x8'));var querystring=require(_0x8cec('0xd'));var Papa=require(_0x8cec('0xe'));var Redis=require('ioredis');var authService=require(_0x8cec('0xf'));var qs=require(_0x8cec('0x10'));var as=require(_0x8cec('0x11'));var hardwareService=require(_0x8cec('0x12'));var logger=require(_0x8cec('0x13'))(_0x8cec('0x14'));var utils=require('../../config/utils');var config=require(_0x8cec('0x15'));var licenseUtil=require(_0x8cec('0x16'));var db=require(_0x8cec('0x17'))['db'];function respondWithStatusCode(_0x55635d,_0xf20452){_0xf20452=_0xf20452||0xcc;return function(_0x55608d){if(_0x55608d){return _0x55635d['sendStatus'](_0xf20452);}return _0x55635d['status'](_0xf20452)['end']();};}function respondWithResult(_0xcef99c,_0x24044a){_0x24044a=_0x24044a||0xc8;return function(_0xc2bcfa){if(_0xc2bcfa){return _0xcef99c[_0x8cec('0x18')](_0x24044a)['json'](_0xc2bcfa);}};}function respondWithFilteredResult(_0x1c45a5,_0x423696){return function(_0x9b5985){if(_0x9b5985){var _0xda9c5b=typeof _0x423696[_0x8cec('0x19')]===_0x8cec('0x1a')&&typeof _0x423696[_0x8cec('0x1b')]===_0x8cec('0x1a');var _0x58f0b3=_0x9b5985[_0x8cec('0x1c')];var _0x47d190=_0xda9c5b?0x0:_0x423696[_0x8cec('0x19')];var _0x1ce55c=_0xda9c5b?_0x9b5985[_0x8cec('0x1c')]:_0x423696[_0x8cec('0x19')]+_0x423696[_0x8cec('0x1b')];var _0x263b48;if(_0x1ce55c>=_0x58f0b3){_0x1ce55c=_0x58f0b3;_0x263b48=0xc8;}else{_0x263b48=0xce;}_0x1c45a5[_0x8cec('0x18')](_0x263b48);return _0x1c45a5[_0x8cec('0x1d')](_0x8cec('0x1e'),_0x47d190+'-'+_0x1ce55c+'/'+_0x58f0b3)[_0x8cec('0x1f')](_0x9b5985);}return null;};}function patchUpdates(_0x48bd2e){return function(_0x2d056c){try{jsonpatch['apply'](_0x2d056c,_0x48bd2e,!![]);}catch(_0x35ecf4){return BPromise['reject'](_0x35ecf4);}return _0x2d056c[_0x8cec('0x20')]();};}function saveUpdates(_0x6968ff,_0xfeb663){return function(_0x4af58e){if(_0x4af58e){return _0x4af58e[_0x8cec('0x21')](_0x6968ff)[_0x8cec('0x22')](function(_0x5eec72){return _0x5eec72;});}return null;};}function removeEntity(_0x5c4e0f,_0x15d6de){return function(_0xf728c5){if(_0xf728c5){return _0xf728c5['destroy']()['then'](function(){_0x5c4e0f[_0x8cec('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x358333,_0x41c6d0){return function(_0x55e9b8){if(!_0x55e9b8){_0x358333[_0x8cec('0x23')](0x194);}return _0x55e9b8;};}function handleError(_0x4da4b3,_0x8edf68){_0x8edf68=_0x8edf68||0x1f4;return function(_0x3f1dd8){logger[_0x8cec('0x24')](_0x3f1dd8[_0x8cec('0x25')]);if(_0x3f1dd8[_0x8cec('0x26')]){delete _0x3f1dd8[_0x8cec('0x26')];}_0x4da4b3[_0x8cec('0x18')](_0x8edf68)[_0x8cec('0x27')](_0x3f1dd8);};}var utilLicense=require(_0x8cec('0x16'));exports[_0x8cec('0x28')]=function(_0x119d70,_0x1e6c4c){var _0x11139a={'raw':!![],'where':{'id':0x1}},_0x524ecf={};_0x524ecf[_0x8cec('0x29')]=_[_0x8cec('0x2a')](db[_0x8cec('0x2b')][_0x8cec('0x2c')]);_0x524ecf[_0x8cec('0x2d')]=_['keys'](_0x119d70['query']);_0x524ecf[_0x8cec('0x2e')]=_[_0x8cec('0x2f')](_0x524ecf['model'],_0x524ecf['query']);_0x11139a[_0x8cec('0x30')]=_[_0x8cec('0x2f')](_0x524ecf[_0x8cec('0x29')],qs[_0x8cec('0x31')](_0x119d70[_0x8cec('0x2d')][_0x8cec('0x31')]));_0x11139a[_0x8cec('0x30')]=_0x11139a[_0x8cec('0x30')][_0x8cec('0x32')]?_0x11139a[_0x8cec('0x30')]:_0x524ecf[_0x8cec('0x29')];_0x11139a=_[_0x8cec('0x33')]({},_0x11139a,_0x119d70[_0x8cec('0x34')]);return utilLicense['getLicense'](_0x11139a)['then'](respondWithResult(_0x1e6c4c,null))[_0x8cec('0x35')](handleError(_0x1e6c4c,null));};exports[_0x8cec('0x21')]=function(_0x25ff5d,_0x1e5faa){if(_0x25ff5d[_0x8cec('0x36')]['id']){delete _0x25ff5d['body']['id'];}return db[_0x8cec('0x2b')][_0x8cec('0x37')]({'where':{'id':_0x25ff5d[_0x8cec('0x38')]['id']}})[_0x8cec('0x22')](handleEntityNotFound(_0x1e5faa,null))[_0x8cec('0x22')](function(_0x5dc270){var _0x4e0e47=_0x5dc270[_0x8cec('0x39')]({'plain':!![]});return utilLicense[_0x8cec('0x3a')](_0x4e0e47,_0x25ff5d['body']['key']);})[_0x8cec('0x22')](function(_0x1ed4d5){if(!_0x1ed4d5[_0x8cec('0x3b')]){return saveUpdates(_0x25ff5d[_0x8cec('0x36')],null);}return _0x1ed4d5;})[_0x8cec('0x22')](respondWithResult(_0x1e5faa,null))['catch'](handleError(_0x1e5faa,null));};exports['downloadLogFile']=function(_0x4e8d9d,_0x495aa1){var _0x596e1f='license-info.log';var _0x5dd927=path[_0x8cec('0x3c')](_0x8cec('0x3d'),_0x8cec('0x3e'),'xcally',_0x596e1f);_0x495aa1[_0x8cec('0x3f')](_0x8cec('0x40'),_0x8cec('0x41')+_0x596e1f);_0x495aa1[_0x8cec('0x1d')]('Content-Type',_0x8cec('0x42'));_0x495aa1[_0x8cec('0x43')](_0x5dd927);}; \ No newline at end of file +var _0x533b=['getLicense','catch','update','body','find','params','checkLicense','key','demo','downloadLogFile','license-info.log','/var','log','xcally','setHeader','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x533b,0xdc));var _0xb533=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x533b[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xb533('0x0'));var rimraf=require(_0xb533('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb533('0x2'));var rp=require(_0xb533('0x3'));var moment=require(_0xb533('0x4'));var BPromise=require(_0xb533('0x5'));var Mustache=require(_0xb533('0x6'));var util=require(_0xb533('0x7'));var path=require(_0xb533('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb533('0x9'));var _=require('lodash');var squel=require(_0xb533('0xa'));var crypto=require(_0xb533('0xb'));var jsforce=require(_0xb533('0xc'));var deskjs=require(_0xb533('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb533('0xe'));var authService=require(_0xb533('0xf'));var qs=require(_0xb533('0x10'));var as=require(_0xb533('0x11'));var hardwareService=require(_0xb533('0x12'));var logger=require(_0xb533('0x13'))(_0xb533('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb533('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a1327,_0x563997){_0x563997=_0x563997||0xcc;return function(_0x23ca03){if(_0x23ca03){return _0x4a1327['sendStatus'](_0x563997);}return _0x4a1327['status'](_0x563997)['end']();};}function respondWithResult(_0x3a7283,_0xadcc82){_0xadcc82=_0xadcc82||0xc8;return function(_0x2648a6){if(_0x2648a6){return _0x3a7283[_0xb533('0x16')](_0xadcc82)[_0xb533('0x17')](_0x2648a6);}};}function respondWithFilteredResult(_0x2949b8,_0xa98c9c){return function(_0x4be2fb){if(_0x4be2fb){var _0x15eb33=typeof _0xa98c9c[_0xb533('0x18')]===_0xb533('0x19')&&typeof _0xa98c9c[_0xb533('0x1a')]===_0xb533('0x19');var _0x4cfed9=_0x4be2fb[_0xb533('0x1b')];var _0x4dff0f=_0x15eb33?0x0:_0xa98c9c[_0xb533('0x18')];var _0x4919da=_0x15eb33?_0x4be2fb['count']:_0xa98c9c['offset']+_0xa98c9c['limit'];var _0x486198;if(_0x4919da>=_0x4cfed9){_0x4919da=_0x4cfed9;_0x486198=0xc8;}else{_0x486198=0xce;}_0x2949b8['status'](_0x486198);return _0x2949b8[_0xb533('0x1c')](_0xb533('0x1d'),_0x4dff0f+'-'+_0x4919da+'/'+_0x4cfed9)[_0xb533('0x17')](_0x4be2fb);}return null;};}function patchUpdates(_0x568448){return function(_0x1947c6){try{jsonpatch[_0xb533('0x1e')](_0x1947c6,_0x568448,!![]);}catch(_0x3e75b4){return BPromise[_0xb533('0x1f')](_0x3e75b4);}return _0x1947c6[_0xb533('0x20')]();};}function saveUpdates(_0x28ef06,_0x1a5b9d){return function(_0x1f13f7){if(_0x1f13f7){return _0x1f13f7['update'](_0x28ef06)['then'](function(_0x459589){return _0x459589;});}return null;};}function removeEntity(_0x42d7b0,_0x4b7789){return function(_0x2b8781){if(_0x2b8781){return _0x2b8781[_0xb533('0x21')]()[_0xb533('0x22')](function(){_0x42d7b0[_0xb533('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe26d3c,_0x1b1161){return function(_0xa528ca){if(!_0xa528ca){_0xe26d3c['sendStatus'](0x194);}return _0xa528ca;};}function handleError(_0x21949c,_0x237fc5){_0x237fc5=_0x237fc5||0x1f4;return function(_0x1fd2e9){logger[_0xb533('0x23')](_0x1fd2e9[_0xb533('0x24')]);if(_0x1fd2e9[_0xb533('0x25')]){delete _0x1fd2e9[_0xb533('0x25')];}_0x21949c[_0xb533('0x16')](_0x237fc5)[_0xb533('0x26')](_0x1fd2e9);};}var utilLicense=require(_0xb533('0x15'));exports[_0xb533('0x27')]=function(_0x9ef48,_0x3461cb){var _0x169a37={'raw':!![],'where':{'id':0x1}},_0x5bd4a3={};_0x5bd4a3[_0xb533('0x28')]=_[_0xb533('0x29')](db[_0xb533('0x2a')][_0xb533('0x2b')]);_0x5bd4a3[_0xb533('0x2c')]=_[_0xb533('0x29')](_0x9ef48[_0xb533('0x2c')]);_0x5bd4a3[_0xb533('0x2d')]=_[_0xb533('0x2e')](_0x5bd4a3[_0xb533('0x28')],_0x5bd4a3['query']);_0x169a37['attributes']=_[_0xb533('0x2e')](_0x5bd4a3[_0xb533('0x28')],qs['fields'](_0x9ef48[_0xb533('0x2c')][_0xb533('0x2f')]));_0x169a37[_0xb533('0x30')]=_0x169a37['attributes'][_0xb533('0x31')]?_0x169a37[_0xb533('0x30')]:_0x5bd4a3[_0xb533('0x28')];_0x169a37=_[_0xb533('0x32')]({},_0x169a37,_0x9ef48[_0xb533('0x33')]);return utilLicense[_0xb533('0x34')](_0x169a37)[_0xb533('0x22')](respondWithResult(_0x3461cb,null))[_0xb533('0x35')](handleError(_0x3461cb,null));};exports[_0xb533('0x36')]=function(_0x23be64,_0xd298e8){if(_0x23be64[_0xb533('0x37')]['id']){delete _0x23be64[_0xb533('0x37')]['id'];}return db['License'][_0xb533('0x38')]({'where':{'id':_0x23be64[_0xb533('0x39')]['id']}})[_0xb533('0x22')](handleEntityNotFound(_0xd298e8,null))[_0xb533('0x22')](function(_0x481e29){var _0xccef4a=_0x481e29['get']({'plain':!![]});return utilLicense[_0xb533('0x3a')](_0xccef4a,_0x23be64[_0xb533('0x37')][_0xb533('0x3b')]);})['then'](function(_0x4c1c85){if(!_0x4c1c85[_0xb533('0x3c')]){return saveUpdates(_0x23be64['body'],null);}return _0x4c1c85;})[_0xb533('0x22')](respondWithResult(_0xd298e8,null))['catch'](handleError(_0xd298e8,null));};exports[_0xb533('0x3d')]=function(_0x1d73b9,_0x3e2218){var _0x3660a3=_0xb533('0x3e');var _0x5a2a41=path['join'](_0xb533('0x3f'),_0xb533('0x40'),_0xb533('0x41'),_0x3660a3);_0x3e2218[_0xb533('0x42')]('Content-disposition','attachment;\x20filename='+_0x3660a3);_0x3e2218['set']('Content-Type','text/plain');_0x3e2218[_0xb533('0x43')](_0x5a2a41);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index c12698c..8277429 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 _0xfda3=['path','rimraf','../../config/environment','exports','define','License','license','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5cdcd0,_0x2721ec){var _0x4864c1=function(_0x503a3b){while(--_0x503a3b){_0x5cdcd0['push'](_0x5cdcd0['shift']());}};_0x4864c1(++_0x2721ec);}(_0xfda3,0x125));var _0x3fda=function(_0x2171d4,_0x3d54d9){_0x2171d4=_0x2171d4-0x0;var _0x100800=_0xfda3[_0x2171d4];return _0x100800;};'use strict';var _=require('lodash');var util=require(_0x3fda('0x0'));var logger=require(_0x3fda('0x1'))(_0x3fda('0x2'));var moment=require(_0x3fda('0x3'));var BPromise=require(_0x3fda('0x4'));var rp=require(_0x3fda('0x5'));var fs=require('fs');var path=require(_0x3fda('0x6'));var rimraf=require(_0x3fda('0x7'));var config=require(_0x3fda('0x8'));var attributes=require('./license.attributes');module[_0x3fda('0x9')]=function(_0x71156f,_0x7dc1c9){return _0x71156f[_0x3fda('0xa')](_0x3fda('0xb'),attributes,{'tableName':_0x3fda('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ac0=['exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5a6de2,_0x5c8b10){var _0x2c0525=function(_0x59d072){while(--_0x59d072){_0x5a6de2['push'](_0x5a6de2['shift']());}};_0x2c0525(++_0x5c8b10);}(_0x7ac0,0x1da));var _0x07ac=function(_0x1b651b,_0x1d50f9){_0x1b651b=_0x1b651b-0x0;var _0x17f20a=_0x7ac0[_0x1b651b];return _0x17f20a;};'use strict';var _=require(_0x07ac('0x0'));var util=require(_0x07ac('0x1'));var logger=require(_0x07ac('0x2'))(_0x07ac('0x3'));var moment=require(_0x07ac('0x4'));var BPromise=require(_0x07ac('0x5'));var rp=require(_0x07ac('0x6'));var fs=require('fs');var path=require(_0x07ac('0x7'));var rimraf=require(_0x07ac('0x8'));var config=require(_0x07ac('0x9'));var attributes=require('./license.attributes');module[_0x07ac('0xa')]=function(_0x38243b,_0x8b2ff2){return _0x38243b['define']('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index ff4a3c1..b06b91a 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 _0xf2bf=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x49f03f,_0x280f41){var _0x2794c4=function(_0x43df64){while(--_0x43df64){_0x49f03f['push'](_0x49f03f['shift']());}};_0x2794c4(++_0x280f41);}(_0xf2bf,0x17b));var _0xff2b=function(_0x292bab,_0x4eb300){_0x292bab=_0x292bab-0x0;var _0x18b22a=_0xf2bf[_0x292bab];return _0x18b22a;};'use strict';var _=require(_0xff2b('0x0'));var util=require(_0xff2b('0x1'));var moment=require(_0xff2b('0x2'));var BPromise=require(_0xff2b('0x3'));var rs=require(_0xff2b('0x4'));var fs=require('fs');var Redis=require(_0xff2b('0x5'));var db=require(_0xff2b('0x6'))['db'];var utils=require(_0xff2b('0x7'));var logger=require(_0xff2b('0x8'))(_0xff2b('0x9'));var config=require(_0xff2b('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xff2b('0xb')][_0xff2b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1856cf,_0x824740,_0x276677){return new BPromise(function(_0x55cd67,_0x4234fc){return client[_0xff2b('0xd')](_0x1856cf,_0x276677)[_0xff2b('0xe')](function(_0x362125){logger['info'](_0xff2b('0xf'),_0x824740,_0xff2b('0x10'));logger[_0xff2b('0x11')](_0xff2b('0x12'),_0x824740,_0xff2b('0x10'),JSON['stringify'](_0x362125));if(_0x362125[_0xff2b('0x13')]){if(_0x362125['error'][_0xff2b('0x14')]===0x1f4){logger[_0xff2b('0x13')]('License,\x20%s,\x20%s',_0x824740,_0x362125[_0xff2b('0x13')][_0xff2b('0x15')]);return _0x4234fc(_0x362125['error'][_0xff2b('0x15')]);}logger[_0xff2b('0x13')](_0xff2b('0xf'),_0x824740,_0x362125['error']['message']);return _0x55cd67(_0x362125['error'][_0xff2b('0x15')]);}else{logger[_0xff2b('0x16')](_0xff2b('0xf'),_0x824740,_0xff2b('0x10'));_0x55cd67(_0x362125[_0xff2b('0x17')]['message']);}})[_0xff2b('0x18')](function(_0x11998f){logger[_0xff2b('0x13')]('License,\x20%s,\x20%s',_0x824740,_0x11998f);_0x4234fc(_0x11998f);});});} \ No newline at end of file +var _0xd064=['../../config/environment','jayson/promise','http','request','info','License,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4badac,_0x1810e6){var _0x610e01=function(_0x939ed8){while(--_0x939ed8){_0x4badac['push'](_0x4badac['shift']());}};_0x610e01(++_0x1810e6);}(_0xd064,0xd3));var _0x4d06=function(_0x191dff,_0xb60d16){_0x191dff=_0x191dff-0x0;var _0x410a43=_0xd064[_0x191dff];return _0x410a43;};'use strict';var _=require(_0x4d06('0x0'));var util=require(_0x4d06('0x1'));var moment=require(_0x4d06('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d06('0x3'));var fs=require('fs');var Redis=require(_0x4d06('0x4'));var db=require(_0x4d06('0x5'))['db'];var utils=require(_0x4d06('0x6'));var logger=require(_0x4d06('0x7'))(_0x4d06('0x8'));var config=require(_0x4d06('0x9'));var jayson=require(_0x4d06('0xa'));var client=jayson['client'][_0x4d06('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x594e2d,_0x48f7b5,_0x1c99da){return new BPromise(function(_0x88a57c,_0x16c559){return client[_0x4d06('0xc')](_0x594e2d,_0x1c99da)['then'](function(_0x3263a6){logger[_0x4d06('0xd')](_0x4d06('0xe'),_0x48f7b5,'request\x20sent');logger[_0x4d06('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x48f7b5,_0x4d06('0x10'),JSON['stringify'](_0x3263a6));if(_0x3263a6[_0x4d06('0x11')]){if(_0x3263a6['error'][_0x4d06('0x12')]===0x1f4){logger[_0x4d06('0x11')]('License,\x20%s,\x20%s',_0x48f7b5,_0x3263a6[_0x4d06('0x11')][_0x4d06('0x13')]);return _0x16c559(_0x3263a6[_0x4d06('0x11')][_0x4d06('0x13')]);}logger[_0x4d06('0x11')](_0x4d06('0xe'),_0x48f7b5,_0x3263a6[_0x4d06('0x11')][_0x4d06('0x13')]);return _0x88a57c(_0x3263a6['error'][_0x4d06('0x13')]);}else{logger[_0x4d06('0xd')](_0x4d06('0xe'),_0x48f7b5,_0x4d06('0x10'));_0x88a57c(_0x3263a6[_0x4d06('0x14')][_0x4d06('0x13')]);}})[_0x4d06('0x15')](function(_0x493a71){logger[_0x4d06('0x11')](_0x4d06('0xe'),_0x48f7b5,_0x493a71);_0x16c559(_0x493a71);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 1f8eee1..474bc57 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 _0xe95b=['/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','addImap','addInteraction','/:id/send','send','addAgents','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','exports','multer','path','express','Router','../../components/interaction/service','./mailAccount.controller','get','/describe','describe','/:id','isAuthenticated','/:id/dispositions','getDispositions','getAnswers'];(function(_0x2875ee,_0x4d2063){var _0x4c747d=function(_0x47cb50){while(--_0x47cb50){_0x2875ee['push'](_0x2875ee['shift']());}};_0x4c747d(++_0x4d2063);}(_0xe95b,0xee));var _0xbe95=function(_0xc4c26,_0x2aee86){_0xc4c26=_0xc4c26-0x0;var _0x5ba09a=_0xe95b[_0xc4c26];return _0x5ba09a;};'use strict';var multer=require(_0xbe95('0x0'));var util=require('util');var path=require(_0xbe95('0x1'));var timeout=require('connect-timeout');var express=require(_0xbe95('0x2'));var router=express[_0xbe95('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbe95('0x4'));var config=require('../../config/environment');var controller=require(_0xbe95('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xbe95('0x6')](_0xbe95('0x7'),auth['isAuthenticated'](),controller[_0xbe95('0x8')]);router[_0xbe95('0x6')](_0xbe95('0x9'),auth[_0xbe95('0xa')](),controller['show']);router[_0xbe95('0x6')](_0xbe95('0xb'),auth['isAuthenticated'](),controller[_0xbe95('0xc')]);router[_0xbe95('0x6')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xbe95('0xd')]);router[_0xbe95('0x6')](_0xbe95('0xe'),auth[_0xbe95('0xa')](),controller[_0xbe95('0xf')]);router[_0xbe95('0x6')](_0xbe95('0x10'),auth[_0xbe95('0xa')](),controller[_0xbe95('0x11')]);router[_0xbe95('0x6')](_0xbe95('0x12'),auth[_0xbe95('0xa')](),controller[_0xbe95('0x13')]);router[_0xbe95('0x6')](_0xbe95('0x14'),auth[_0xbe95('0xa')](),controller[_0xbe95('0x15')]);router[_0xbe95('0x6')](_0xbe95('0x16'),auth[_0xbe95('0xa')](),controller['getMessages']);router[_0xbe95('0x6')]('/:id/verify',auth[_0xbe95('0xa')](),controller[_0xbe95('0x17')]);router[_0xbe95('0x6')](_0xbe95('0x18'),auth[_0xbe95('0xa')](),controller[_0xbe95('0x19')]);router[_0xbe95('0x1a')](_0xbe95('0xb'),auth['isAuthenticated'](),controller[_0xbe95('0x1b')]);router[_0xbe95('0x1a')]('/:id/canned_answers',auth[_0xbe95('0xa')](),controller[_0xbe95('0x1c')]);router[_0xbe95('0x1a')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbe95('0x1a')](_0xbe95('0xe'),auth[_0xbe95('0xa')](),controller[_0xbe95('0x1d')]);router[_0xbe95('0x1a')](_0xbe95('0x10'),auth[_0xbe95('0xa')](),controller['addSmtp']);router[_0xbe95('0x1a')](_0xbe95('0x12'),auth['isAuthenticated'](),controller[_0xbe95('0x1e')]);router[_0xbe95('0x1a')](_0xbe95('0x14'),auth[_0xbe95('0xa')](),controller['addApplications']);router[_0xbe95('0x1a')](_0xbe95('0x1f'),auth[_0xbe95('0xa')](),controller[_0xbe95('0x20')]);router[_0xbe95('0x1a')](_0xbe95('0x18'),auth[_0xbe95('0xa')](),controller[_0xbe95('0x21')]);router['put']('/:id',auth[_0xbe95('0xa')](),controller[_0xbe95('0x22')]);router[_0xbe95('0x23')](_0xbe95('0xb'),auth[_0xbe95('0xa')](),controller[_0xbe95('0x24')]);router['delete']('/:id/canned_answers',auth[_0xbe95('0xa')](),controller[_0xbe95('0x25')]);router['delete'](_0xbe95('0xe'),auth[_0xbe95('0xa')](),controller[_0xbe95('0x26')]);router[_0xbe95('0x23')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0xbe95('0x27')]);router[_0xbe95('0x23')](_0xbe95('0x9'),auth['isAuthenticated'](),controller[_0xbe95('0x28')]);router['delete'](_0xbe95('0x18'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xbe95('0x29')]=router; \ No newline at end of file +var _0x4b19=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','/:id/send','send','/:id/users','put','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path'];(function(_0x486793,_0x39c63b){var _0x2d613d=function(_0xb793c){while(--_0xb793c){_0x486793['push'](_0x486793['shift']());}};_0x2d613d(++_0x39c63b);}(_0x4b19,0x16d));var _0x94b1=function(_0x4f601d,_0x160486){_0x4f601d=_0x4f601d-0x0;var _0x1655ac=_0x4b19[_0x4f601d];return _0x1655ac;};'use strict';var multer=require(_0x94b1('0x0'));var util=require(_0x94b1('0x1'));var path=require(_0x94b1('0x2'));var timeout=require(_0x94b1('0x3'));var express=require('express');var router=express[_0x94b1('0x4')]();var fs_extra=require(_0x94b1('0x5'));var auth=require(_0x94b1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x94b1('0x7'));var controller=require('./mailAccount.controller');router[_0x94b1('0x8')]('/',auth[_0x94b1('0x9')](),controller[_0x94b1('0xa')]);router['get'](_0x94b1('0xb'),auth['isAuthenticated'](),controller[_0x94b1('0xc')]);router['get'](_0x94b1('0xd'),auth[_0x94b1('0x9')](),controller['show']);router['get'](_0x94b1('0xe'),auth[_0x94b1('0x9')](),controller[_0x94b1('0xf')]);router[_0x94b1('0x8')](_0x94b1('0x10'),auth[_0x94b1('0x9')](),controller[_0x94b1('0x11')]);router[_0x94b1('0x8')](_0x94b1('0x12'),auth['isAuthenticated'](),controller[_0x94b1('0x13')]);router[_0x94b1('0x8')](_0x94b1('0x14'),auth[_0x94b1('0x9')](),controller['getSmtp']);router['get'](_0x94b1('0x15'),auth['isAuthenticated'](),controller[_0x94b1('0x16')]);router[_0x94b1('0x8')](_0x94b1('0x17'),auth[_0x94b1('0x9')](),controller['getApplications']);router[_0x94b1('0x8')](_0x94b1('0x18'),auth[_0x94b1('0x9')](),controller[_0x94b1('0x19')]);router[_0x94b1('0x8')](_0x94b1('0x1a'),auth[_0x94b1('0x9')](),controller['verifySmtp']);router[_0x94b1('0x8')]('/:id/users',auth[_0x94b1('0x9')](),controller[_0x94b1('0x1b')]);router[_0x94b1('0x1c')](_0x94b1('0xe'),auth[_0x94b1('0x9')](),controller[_0x94b1('0x1d')]);router[_0x94b1('0x1c')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x94b1('0x1e')]);router[_0x94b1('0x1c')]('/',auth['isAuthenticated'](),controller[_0x94b1('0x1f')]);router[_0x94b1('0x1c')](_0x94b1('0x12'),auth['isAuthenticated'](),controller[_0x94b1('0x20')]);router[_0x94b1('0x1c')](_0x94b1('0x14'),auth[_0x94b1('0x9')](),controller[_0x94b1('0x21')]);router[_0x94b1('0x1c')](_0x94b1('0x15'),auth['isAuthenticated'](),controller[_0x94b1('0x22')]);router[_0x94b1('0x1c')](_0x94b1('0x17'),auth['isAuthenticated'](),controller['addApplications']);router[_0x94b1('0x1c')](_0x94b1('0x23'),auth['isAuthenticated'](),controller[_0x94b1('0x24')]);router[_0x94b1('0x1c')](_0x94b1('0x25'),auth[_0x94b1('0x9')](),controller['addAgents']);router[_0x94b1('0x26')](_0x94b1('0xd'),auth[_0x94b1('0x9')](),controller['update']);router[_0x94b1('0x27')](_0x94b1('0xe'),auth[_0x94b1('0x9')](),controller[_0x94b1('0x28')]);router[_0x94b1('0x27')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x94b1('0x27')](_0x94b1('0x12'),auth[_0x94b1('0x9')](),controller[_0x94b1('0x29')]);router['delete'](_0x94b1('0x14'),auth[_0x94b1('0x9')](),controller[_0x94b1('0x2a')]);router['delete'](_0x94b1('0xd'),auth[_0x94b1('0x9')](),controller[_0x94b1('0x2b')]);router[_0x94b1('0x27')]('/:id/users',auth['isAuthenticated'](),controller[_0x94b1('0x2c')]);module[_0x94b1('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index fa8fe78..bf1335f 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 _0xfd22=['TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN'];(function(_0x38dd20,_0x5de06d){var _0x3d4ec8=function(_0x14964c){while(--_0x14964c){_0x38dd20['push'](_0x38dd20['shift']());}};_0x3d4ec8(++_0x5de06d);}(_0xfd22,0xac));var _0x2fd2=function(_0x1d8e9a,_0x28692d){_0x1d8e9a=_0x1d8e9a-0x0;var _0x3af33f=_0xfd22[_0x1d8e9a];return _0x3af33f;};'use strict';var Sequelize=require(_0x2fd2('0x0'));module[_0x2fd2('0x1')]={'description':{'type':Sequelize[_0x2fd2('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x2fd2('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x2fd2('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x2fd2('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x2fd2('0x2')],'allowNull':![],'defaultValue':_0x2fd2('0x5')},'fontSize':{'type':Sequelize[_0x2fd2('0x6')](0x2)[_0x2fd2('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x2fd2('0x8');}},'notificationSound':{'type':Sequelize[_0x2fd2('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2fd2('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2fd2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2fd2('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2fd2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x2fd2('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x2fd2('0x3')],'defaultValue':![],'comment':_0x2fd2('0xa'),'set':function(_0x40ad22){if(!_0x40ad22)this[_0x2fd2('0xb')](_0x2fd2('0xc'),null);this['setDataValue'](_0x2fd2('0xd'),_0x40ad22);}},'provider':{'type':Sequelize[_0x2fd2('0xe')](_0x2fd2('0xf'),_0x2fd2('0x10'),_0x2fd2('0x11'),_0x2fd2('0x12')),'defaultValue':null,'get':function(){if(!this[_0x2fd2('0x13')]('provider'))return _0x2fd2('0x14');return this['getDataValue'](_0x2fd2('0x15'));},'set':function(_0x15891b){if(_0x15891b===_0x2fd2('0x14'))_0x15891b=null;return this[_0x2fd2('0xb')](_0x2fd2('0x15'),_0x15891b);}}}; \ No newline at end of file +var _0xe413=['Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','ENUM','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT'];(function(_0x5ee24b,_0x1b3a98){var _0x1823c5=function(_0x5aac9f){while(--_0x5aac9f){_0x5ee24b['push'](_0x5ee24b['shift']());}};_0x1823c5(++_0x1b3a98);}(_0xe413,0x67));var _0x3e41=function(_0xef11e2,_0x2b0d0a){_0xef11e2=_0xef11e2-0x0;var _0x337584=_0xe413[_0xef11e2];return _0x337584;};'use strict';var Sequelize=require(_0x3e41('0x0'));module[_0x3e41('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x3e41('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x3e41('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x3e41('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x3e41('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x3e41('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x3e41('0x4')]},'markAsUnread':{'type':Sequelize[_0x3e41('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3e41('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x3e41('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3e41('0x4')],'defaultValue':function(){return _0x3e41('0x7');}},'notificationSound':{'type':Sequelize[_0x3e41('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3e41('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3e41('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3e41('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3e41('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3e41('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x3e41('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x3e41('0x3')],'defaultValue':![],'comment':_0x3e41('0xa'),'set':function(_0x50ad21){if(!_0x50ad21)this[_0x3e41('0xb')](_0x3e41('0xc'),null);this[_0x3e41('0xb')]('mandatoryDisposition',_0x50ad21);}},'provider':{'type':Sequelize[_0x3e41('0xd')]('gmail','hotmail','yahoo',_0x3e41('0xe')),'defaultValue':null,'get':function(){if(!this[_0x3e41('0xf')](_0x3e41('0x10')))return _0x3e41('0x11');return this[_0x3e41('0xf')](_0x3e41('0x10'));},'set':function(_0x32c372){if(_0x32c372===_0x3e41('0x11'))_0x32c372=null;return this[_0x3e41('0xb')](_0x3e41('0x10'),_0x32c372);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 8f08eaa..ffba46f 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 _0x9c3e=['rawAttributes','include','body','custom','find','MailServerOut','mandatoryDispositionPause','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','create','findOne','length','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','provider','email','ListId','isNil','active','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','internal','Tag','tag','sequelize','transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','priority','finally','send','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','List','Contacts','updatedAt','DESC','CloudProvider','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','getSmtpOptions','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','path','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','stack','name','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','gmail','smtp.mail.yahoo.com','outlook365','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','secure','service','authentication','Imap','port','Smtp','MailServerIn','Pause','map','MailAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','findAll','rows','show','params'];(function(_0x2ecb2f,_0x92006b){var _0x4921a1=function(_0x591741){while(--_0x591741){_0x2ecb2f['push'](_0x2ecb2f['shift']());}};_0x4921a1(++_0x92006b);}(_0x9c3e,0x1d4));var _0xe9c3=function(_0x35ef88,_0x2c2091){_0x35ef88=_0x35ef88-0x0;var _0x41e044=_0x9c3e[_0x35ef88];return _0x41e044;};'use strict';var moment=require(_0xe9c3('0x0'));var BPromise=require(_0xe9c3('0x1'));var util=require(_0xe9c3('0x2'));var path=require(_0xe9c3('0x3'));var _=require('lodash');var juice=require('juice');var Redis=require(_0xe9c3('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0xe9c3('0x5'))(_0xe9c3('0x6'));var config=require(_0xe9c3('0x7'));var db=require(_0xe9c3('0x8'))['db'];config[_0xe9c3('0x9')]=_[_0xe9c3('0xa')](config[_0xe9c3('0x9')],{'host':_0xe9c3('0xb'),'port':0x18eb});var socket=require(_0xe9c3('0xc'))(new Redis(config[_0xe9c3('0x9')]));require(_0xe9c3('0xd'))[_0xe9c3('0xe')](socket);var jayson=require(_0xe9c3('0xf'));var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x6482a3,_0x4d63c2,_0x43c4ce,_0x5883e3){return new BPromise(function(_0x42ae1f,_0x55ccab){var _0x137668=_0x5883e3||client;return _0x137668[_0xe9c3('0x10')](_0x6482a3,_0x43c4ce)[_0xe9c3('0x11')](function(_0x4b1d38){logger[_0xe9c3('0x12')](_0xe9c3('0x13'),_0x4d63c2,'request\x20sent');logger[_0xe9c3('0x14')](_0xe9c3('0x15'),_0x4d63c2,_0xe9c3('0x16'),JSON['stringify'](_0x4b1d38));if(_0x4b1d38[_0xe9c3('0x17')]){if(_0x4b1d38[_0xe9c3('0x17')][_0xe9c3('0x18')]===0x1f4){logger[_0xe9c3('0x17')](_0xe9c3('0x13'),_0x4d63c2,_0x4b1d38[_0xe9c3('0x17')][_0xe9c3('0x19')]);return _0x55ccab(_0x4b1d38[_0xe9c3('0x17')][_0xe9c3('0x19')]);}logger[_0xe9c3('0x17')]('MailAccount,\x20%s,\x20%s',_0x4d63c2,_0x4b1d38[_0xe9c3('0x17')][_0xe9c3('0x19')]);return _0x42ae1f(_0x4b1d38[_0xe9c3('0x17')][_0xe9c3('0x19')]);}else{logger[_0xe9c3('0x12')]('MailAccount,\x20%s,\x20%s',_0x4d63c2,_0xe9c3('0x16'));_0x42ae1f(_0x4b1d38[_0xe9c3('0x1a')][_0xe9c3('0x19')]);}})[_0xe9c3('0x1b')](function(_0x3db5d2){logger[_0xe9c3('0x17')](_0xe9c3('0x13'),_0x4d63c2,_0x3db5d2);_0x55ccab(_0x3db5d2);});});}function respondWithStatusCode(_0x3f8200,_0x4f4b0d){_0x4f4b0d=_0x4f4b0d||0xcc;return function(_0x492263){if(_0x492263){return _0x3f8200[_0xe9c3('0x1c')](_0x4f4b0d);}return _0x3f8200[_0xe9c3('0x1d')](_0x4f4b0d)[_0xe9c3('0x1e')]();};}function respondWithResult(_0x213481,_0x588f58){_0x588f58=_0x588f58||0xc8;return function(_0x370df6){if(_0x370df6){return _0x213481[_0xe9c3('0x1d')](_0x588f58)[_0xe9c3('0x1f')](_0x370df6);}};}function respondWithFilteredResult(_0x7522f9,_0x45cbc8){return function(_0x21815b){if(_0x21815b){var _0x3071c1=typeof _0x45cbc8[_0xe9c3('0x20')]===_0xe9c3('0x21')&&typeof _0x45cbc8[_0xe9c3('0x22')]===_0xe9c3('0x21');var _0x7b803=_0x21815b[_0xe9c3('0x23')];var _0x48ff36=_0x3071c1?0x0:_0x45cbc8[_0xe9c3('0x20')];var _0x51dd07=_0x3071c1?_0x21815b['count']:_0x45cbc8[_0xe9c3('0x20')]+_0x45cbc8[_0xe9c3('0x22')];var _0x31ff03;if(_0x51dd07>=_0x7b803){_0x51dd07=_0x7b803;_0x31ff03=0xc8;}else{_0x31ff03=0xce;}_0x7522f9[_0xe9c3('0x1d')](_0x31ff03);return _0x7522f9[_0xe9c3('0x24')](_0xe9c3('0x25'),_0x48ff36+'-'+_0x51dd07+'/'+_0x7b803)[_0xe9c3('0x1f')](_0x21815b);}return null;};}function saveUpdates(_0x2b070d){return function(_0x1a1d9d){if(_0x1a1d9d){return _0x1a1d9d[_0xe9c3('0x26')](_0x2b070d)['then'](function(_0x244159){return _0x244159;});}return null;};}function removeEntity(_0x426464){return function(_0x49b840){if(_0x49b840){return _0x49b840[_0xe9c3('0x27')]()[_0xe9c3('0x11')](function(){var _0x143b33=_0x49b840[_0xe9c3('0x28')]({'plain':!![]});var _0x35ca97=_0xe9c3('0x29');return db[_0xe9c3('0x2a')][_0xe9c3('0x27')]({'where':{'type':_0x35ca97,'resourceId':_0x143b33['id']}})[_0xe9c3('0x11')](function(){return _0x49b840;});})[_0xe9c3('0x11')](function(){_0x426464[_0xe9c3('0x1d')](0xcc)[_0xe9c3('0x1e')]();});}};}function handleEntityNotFound(_0x3e42da){return function(_0x1f115a){if(!_0x1f115a){_0x3e42da['sendStatus'](0x194);}return _0x1f115a;};}function handleError(_0x58c234,_0x460a3d){_0x460a3d=_0x460a3d||0x1f4;return function(_0x56dc03){logger[_0xe9c3('0x17')](_0x56dc03[_0xe9c3('0x2b')]);if(_0x56dc03[_0xe9c3('0x2c')]){delete _0x56dc03[_0xe9c3('0x2c')];}_0x58c234['status'](_0x460a3d)['send'](_0x56dc03);};}function getImapHost(_0x102b11){switch(_0x102b11){case'gmail':return _0xe9c3('0x2d');case _0xe9c3('0x2e'):return _0xe9c3('0x2f');case _0xe9c3('0x30'):return _0xe9c3('0x31');case'outlook365':return _0xe9c3('0x32');}throw new Error('Unknown\x20email\x20service\x20provider',_0x102b11);}function getSmtpHost(_0x5f13a2){switch(_0x5f13a2){case _0xe9c3('0x33'):return'smtp.gmail.com';case _0xe9c3('0x2e'):return _0xe9c3('0x34');case _0xe9c3('0x30'):return'smtp-mail.outlook.com';case _0xe9c3('0x35'):return _0xe9c3('0x36');}throw new Error('Unknown\x20email\x20service\x20provider',_0x5f13a2);}function getAuthenticationOptions(_0x3ce2cc,_0x1936a1){var _0x5ec26a={};var _0x27de6a={};if(_0x3ce2cc){_0x5ec26a[_0xe9c3('0x37')]=_0x27de6a['user']=_0x1936a1[_0xe9c3('0x38')];_0x5ec26a[_0xe9c3('0x39')]=_0x27de6a[_0xe9c3('0x3a')]=_0x1936a1['password'];if(_0x1936a1[_0xe9c3('0x3b')]){_0x5ec26a[_0xe9c3('0x3b')]=_0x27de6a[_0xe9c3('0x3b')]=!![];_0x5ec26a[_0xe9c3('0x3c')]=_0x27de6a[_0xe9c3('0x3c')]=_0x1936a1[_0xe9c3('0x3c')];_0x5ec26a[_0xe9c3('0x39')]=_0x27de6a['pass']=null;}else{_0x5ec26a[_0xe9c3('0x3c')]=_0x27de6a[_0xe9c3('0x3c')]=null;}_0x5ec26a[_0xe9c3('0x3d')]=getImapHost(_0x3ce2cc);_0x5ec26a['port']=0x3e1;_0x27de6a[_0xe9c3('0x3d')]=getSmtpHost(_0x3ce2cc);_0x27de6a['port']=0x24b;_0x27de6a[_0xe9c3('0x3e')]=![];_0x5ec26a['service']=_0x27de6a[_0xe9c3('0x3f')]=null;}else{if(_0x1936a1[_0xe9c3('0x40')]){_0x5ec26a['user']=_0x27de6a[_0xe9c3('0x37')]=_0x1936a1['username'];_0x5ec26a[_0xe9c3('0x39')]=_0x27de6a['pass']=_0x1936a1[_0xe9c3('0x39')];}else{_0x5ec26a[_0xe9c3('0x40')]=_0x27de6a[_0xe9c3('0x40')]=![];_0x5ec26a[_0xe9c3('0x37')]=_0x27de6a['user']=null;_0x5ec26a['password']=_0x27de6a['pass']=null;}_0x5ec26a['host']=_0x1936a1[_0xe9c3('0x41')][_0xe9c3('0x3d')];_0x5ec26a[_0xe9c3('0x42')]=_0x1936a1['Imap'][_0xe9c3('0x42')];_0x27de6a[_0xe9c3('0x3d')]=_0x1936a1[_0xe9c3('0x43')][_0xe9c3('0x3d')];_0x27de6a[_0xe9c3('0x42')]=_0x1936a1[_0xe9c3('0x43')][_0xe9c3('0x42')];}return{'Imap':_0x5ec26a,'Smtp':_0x27de6a};}exports['index']=function(_0x409600,_0x208346){var _0x126cf8={'include':[{'model':db[_0xe9c3('0x44')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xe9c3('0x45')],'as':'mandatoryDispositionPause'}]},_0x29ba7e={},_0x2fb223={'count':0x0,'rows':[]};var _0x5f3127=_[_0xe9c3('0x46')](db[_0xe9c3('0x47')]['rawAttributes'],function(_0x195702){return{'name':_0x195702[_0xe9c3('0x48')],'type':_0x195702[_0xe9c3('0x49')][_0xe9c3('0x4a')]};});_0x29ba7e[_0xe9c3('0x4b')]=_['map'](_0x5f3127,_0xe9c3('0x2c'));_0x29ba7e['query']=_[_0xe9c3('0x4c')](_0x409600[_0xe9c3('0x4d')]);_0x29ba7e[_0xe9c3('0x4e')]=_[_0xe9c3('0x4f')](_0x29ba7e['model'],_0x29ba7e['query']);_0x126cf8[_0xe9c3('0x50')]=_[_0xe9c3('0x4f')](_0x29ba7e[_0xe9c3('0x4b')],qs[_0xe9c3('0x51')](_0x409600['query'][_0xe9c3('0x51')]));_0x126cf8['attributes']=_0x126cf8[_0xe9c3('0x50')]['length']?_0x126cf8['attributes']:_0x29ba7e[_0xe9c3('0x4b')];if(!_0x409600[_0xe9c3('0x4d')][_0xe9c3('0x52')](_0xe9c3('0x53'))){_0x126cf8[_0xe9c3('0x22')]=qs['limit'](_0x409600[_0xe9c3('0x4d')]['limit']);_0x126cf8[_0xe9c3('0x20')]=qs[_0xe9c3('0x20')](_0x409600[_0xe9c3('0x4d')][_0xe9c3('0x20')]);}_0x126cf8[_0xe9c3('0x54')]=qs[_0xe9c3('0x55')](_0x409600['query']['sort']);_0x126cf8['where']=qs['filters'](_[_0xe9c3('0x56')](_0x409600['query'],_0x29ba7e['filters']),_0x5f3127);if(_0x409600['query'][_0xe9c3('0x57')]){_0x126cf8['where']=_[_0xe9c3('0x58')](_0x126cf8[_0xe9c3('0x59')],{'$or':_[_0xe9c3('0x46')](_0x5f3127,function(_0x10d858){if(_0x10d858[_0xe9c3('0x49')]!=='VIRTUAL'){var _0x30504a={};_0x30504a[_0x10d858[_0xe9c3('0x2c')]]={'$like':'%'+_0x409600[_0xe9c3('0x4d')]['filter']+'%'};return _0x30504a;}})});}_0x126cf8=_[_0xe9c3('0x58')]({},_0x126cf8,_0x409600[_0xe9c3('0x5a')]);var _0x1805dc={'where':_0x126cf8['where']};return db[_0xe9c3('0x47')][_0xe9c3('0x23')](_0x1805dc)[_0xe9c3('0x11')](function(_0x18f621){_0x2fb223[_0xe9c3('0x23')]=_0x18f621;if(_0x409600[_0xe9c3('0x4d')][_0xe9c3('0x5b')]){_0x126cf8['include']=[{'all':!![]}];}return db['MailAccount'][_0xe9c3('0x5c')](_0x126cf8);})['then'](function(_0x2ed989){_0x2fb223[_0xe9c3('0x5d')]=_0x2ed989;return _0x2fb223;})[_0xe9c3('0x11')](respondWithFilteredResult(_0x208346,_0x126cf8))[_0xe9c3('0x1b')](handleError(_0x208346,null));};exports[_0xe9c3('0x5e')]=function(_0x4a52ab,_0x2deefd){var _0x8e8e13={'raw':![],'where':{'id':_0x4a52ab[_0xe9c3('0x5f')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xe9c3('0x41')},{'model':db['MailServerOut'],'as':_0xe9c3('0x43')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x55b54d={};_0x55b54d[_0xe9c3('0x4b')]=_['keys'](db[_0xe9c3('0x47')][_0xe9c3('0x60')]);_0x55b54d[_0xe9c3('0x4d')]=_[_0xe9c3('0x4c')](_0x4a52ab['query']);_0x55b54d['filters']=_[_0xe9c3('0x4f')](_0x55b54d[_0xe9c3('0x4b')],_0x55b54d['query']);_0x8e8e13['attributes']=_[_0xe9c3('0x4f')](_0x55b54d[_0xe9c3('0x4b')],qs['fields'](_0x4a52ab['query'][_0xe9c3('0x51')]));_0x8e8e13[_0xe9c3('0x50')]=_0x8e8e13['attributes']['length']?_0x8e8e13[_0xe9c3('0x50')]:_0x55b54d[_0xe9c3('0x4b')];if(_0x4a52ab[_0xe9c3('0x4d')][_0xe9c3('0x5b')]){_0x8e8e13[_0xe9c3('0x61')]=[{'all':!![]}];}_0x8e8e13=_[_0xe9c3('0x58')]({},_0x8e8e13,_0x4a52ab[_0xe9c3('0x5a')]);return db['MailAccount']['find'](_0x8e8e13)[_0xe9c3('0x11')](handleEntityNotFound(_0x2deefd,null))['then'](respondWithResult(_0x2deefd,null))[_0xe9c3('0x1b')](handleError(_0x2deefd,null));};exports[_0xe9c3('0x26')]=function(_0x21b987,_0x3b6c3c){if(_0x21b987[_0xe9c3('0x62')]['id']){delete _0x21b987['body']['id'];}var _0x521f27=_0x21b987[_0xe9c3('0x62')]['provider']===_0xe9c3('0x63')?null:_0x21b987[_0xe9c3('0x62')]['provider'];var _0x5a9ae7=_0x21b987['body'][_0xe9c3('0x41')]||{};var _0x5941ec=_0x21b987['body'][_0xe9c3('0x43')]||{};if(_0x521f27){_0x5a9ae7[_0xe9c3('0x3d')]=getImapHost(_0x521f27);_0x5a9ae7[_0xe9c3('0x42')]=0x3e1;_0x5941ec[_0xe9c3('0x3d')]=getSmtpHost(_0x521f27);_0x5941ec[_0xe9c3('0x42')]=0x24b;_0x5941ec['secure']=![];}if(_0x5941ec[_0xe9c3('0x3b')]){_0x5941ec['secure']=![];}else{_0x5941ec[_0xe9c3('0x3c')]=null;}if(!_0x5a9ae7[_0xe9c3('0x3b')])_0x5a9ae7[_0xe9c3('0x3c')]=null;_0x21b987[_0xe9c3('0x62')][_0xe9c3('0x41')]=_0x5a9ae7;_0x21b987['body'][_0xe9c3('0x43')]=_0x5941ec;return db['MailAccount'][_0xe9c3('0x64')]({'where':{'id':_0x21b987[_0xe9c3('0x5f')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xe9c3('0x65')],'as':_0xe9c3('0x43')},{'model':db['Pause'],'as':_0xe9c3('0x66')}]})[_0xe9c3('0x11')](handleEntityNotFound(_0x3b6c3c,null))[_0xe9c3('0x11')](function(_0x177e23){if(!_0x177e23)throw new Error(_0xe9c3('0x67'));if(_0x177e23[_0xe9c3('0x3f')])delete _0x21b987[_0xe9c3('0x62')][_0xe9c3('0x41')];return _0x177e23;})['then'](saveUpdates(_0x21b987['body'],null))[_0xe9c3('0x11')](function(_0x5622e6){if(!_0x21b987[_0xe9c3('0x62')][_0xe9c3('0x41')])return _0x5622e6;return db[_0xe9c3('0x44')][_0xe9c3('0x26')](_0x21b987[_0xe9c3('0x62')][_0xe9c3('0x41')],{'where':{'MailAccountId':_0x5622e6['id']}})['then'](function(){return _0x5622e6;});})['then'](function(_0x34645d){if(!_0x21b987[_0xe9c3('0x62')][_0xe9c3('0x43')])return _0x34645d;return db['MailServerOut'][_0xe9c3('0x26')](_0x21b987[_0xe9c3('0x62')]['Smtp'],{'where':{'MailAccountId':_0x34645d['id']}})['then'](function(){return _0x34645d;});})[_0xe9c3('0x11')](respondWithResult(_0x3b6c3c,null))['catch'](handleError(_0x3b6c3c,null));};exports[_0xe9c3('0x68')]=function(_0x34d936,_0x49e4cf){return db['MailAccount'][_0xe9c3('0x68')]()[_0xe9c3('0x11')](respondWithResult(_0x49e4cf,null))[_0xe9c3('0x1b')](handleError(_0x49e4cf,null));};exports['addDisposition']=function(_0xf14a19,_0x5833fc){if(_0xf14a19[_0xe9c3('0x62')]['id']){delete _0xf14a19[_0xe9c3('0x62')]['id'];}return db[_0xe9c3('0x47')][_0xe9c3('0x64')]({'where':{'id':_0xf14a19[_0xe9c3('0x5f')]['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x5833fc,null))[_0xe9c3('0x11')](function(_0x25d6fd){if(_0x25d6fd){_0xf14a19[_0xe9c3('0x62')][_0xe9c3('0x69')]=_0x25d6fd['id'];return db[_0xe9c3('0x6a')][_0xe9c3('0x6b')](_0xf14a19['body']);}})['then'](respondWithResult(_0x5833fc,null))[_0xe9c3('0x1b')](handleError(_0x5833fc,null));};exports['getDispositions']=function(_0x5c6ec2,_0x58b380){var _0x5984d1={'raw':![],'where':{}};var _0x3a7db2={};var _0x48ab25={'count':0x0,'rows':[]};return db[_0xe9c3('0x47')][_0xe9c3('0x6c')]({'where':{'id':_0x5c6ec2[_0xe9c3('0x5f')]['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x58b380,null))[_0xe9c3('0x11')](function(_0x5e0029){if(_0x5e0029){_0x3a7db2[_0xe9c3('0x4b')]=_[_0xe9c3('0x4c')](db[_0xe9c3('0x6a')][_0xe9c3('0x60')]);_0x3a7db2['query']=_[_0xe9c3('0x4c')](_0x5c6ec2[_0xe9c3('0x4d')]);_0x3a7db2[_0xe9c3('0x4e')]=_['intersection'](_0x3a7db2[_0xe9c3('0x4b')],_0x3a7db2[_0xe9c3('0x4d')]);_0x5984d1['attributes']=_['intersection'](_0x3a7db2['model'],qs[_0xe9c3('0x51')](_0x5c6ec2[_0xe9c3('0x4d')][_0xe9c3('0x51')]));_0x5984d1['attributes']=_0x5984d1[_0xe9c3('0x50')][_0xe9c3('0x6d')]?_0x5984d1[_0xe9c3('0x50')]:_0x3a7db2['model'];if(!_0x5c6ec2[_0xe9c3('0x4d')][_0xe9c3('0x52')]('nolimit')){_0x5984d1[_0xe9c3('0x22')]=qs[_0xe9c3('0x22')](_0x5c6ec2[_0xe9c3('0x4d')][_0xe9c3('0x22')]);_0x5984d1[_0xe9c3('0x20')]=qs[_0xe9c3('0x20')](_0x5c6ec2[_0xe9c3('0x4d')]['offset']);}_0x5984d1[_0xe9c3('0x54')]=qs[_0xe9c3('0x55')](_0x5c6ec2[_0xe9c3('0x4d')][_0xe9c3('0x55')]);_0x5984d1[_0xe9c3('0x59')]=qs[_0xe9c3('0x4e')](_[_0xe9c3('0x56')](_0x5c6ec2[_0xe9c3('0x4d')],_0x3a7db2[_0xe9c3('0x4e')]));_0x5984d1[_0xe9c3('0x59')]['MailAccountId']=_0x5e0029['id'];if(_0x5c6ec2[_0xe9c3('0x4d')][_0xe9c3('0x57')]){_0x5984d1['where']=_[_0xe9c3('0x58')](_0x5984d1['where'],{'$or':_[_0xe9c3('0x46')](_0x5984d1[_0xe9c3('0x50')],function(_0x281879){var _0x212469={};_0x212469[_0x281879]={'$like':'%'+_0x5c6ec2[_0xe9c3('0x4d')][_0xe9c3('0x57')]+'%'};return _0x212469;})});}_0x5984d1=_['merge']({},_0x5984d1,_0x5c6ec2['options']);return db[_0xe9c3('0x6a')][_0xe9c3('0x23')]({'where':_0x5984d1[_0xe9c3('0x59')]})[_0xe9c3('0x11')](function(_0x3851b6){_0x48ab25['count']=_0x3851b6;if(_0x5c6ec2[_0xe9c3('0x4d')]['includeAll']){_0x5984d1[_0xe9c3('0x61')]=[{'all':!![]}];}return db[_0xe9c3('0x6a')][_0xe9c3('0x5c')](_0x5984d1);})[_0xe9c3('0x11')](function(_0x1e215e){_0x48ab25[_0xe9c3('0x5d')]=_0x1e215e;return _0x48ab25;});}})[_0xe9c3('0x11')](respondWithFilteredResult(_0x58b380,_0x5984d1))[_0xe9c3('0x1b')](handleError(_0x58b380,null));};exports[_0xe9c3('0x6e')]=function(_0xfc8319,_0x1dd9fd){return db[_0xe9c3('0x47')][_0xe9c3('0x64')]({'where':{'id':_0xfc8319['params']['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x1dd9fd,null))[_0xe9c3('0x11')](function(_0x43c6f8){if(_0x43c6f8){return _0x43c6f8[_0xe9c3('0x6e')](_0xfc8319[_0xe9c3('0x4d')][_0xe9c3('0x6f')]);}})[_0xe9c3('0x11')](respondWithStatusCode(_0x1dd9fd,null))[_0xe9c3('0x1b')](handleError(_0x1dd9fd,null));};exports[_0xe9c3('0x70')]=function(_0x569aa8,_0x1863f1){if(_0x569aa8[_0xe9c3('0x62')]['id']){delete _0x569aa8['body']['id'];}return db[_0xe9c3('0x47')]['find']({'where':{'id':_0x569aa8[_0xe9c3('0x5f')]['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x1863f1,null))[_0xe9c3('0x11')](function(_0x3f6aaf){if(_0x3f6aaf){_0x569aa8[_0xe9c3('0x62')][_0xe9c3('0x69')]=_0x3f6aaf['id'];return db[_0xe9c3('0x71')][_0xe9c3('0x6b')](_0x569aa8[_0xe9c3('0x62')]);}})['then'](respondWithResult(_0x1863f1,null))[_0xe9c3('0x1b')](handleError(_0x1863f1,null));};exports[_0xe9c3('0x72')]=function(_0x41426a,_0x202959){var _0x2d5e2e={'raw':![],'where':{}};var _0x1267da={};var _0x482c76={'count':0x0,'rows':[]};return db[_0xe9c3('0x47')]['findOne']({'where':{'id':_0x41426a[_0xe9c3('0x5f')]['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x202959,null))[_0xe9c3('0x11')](function(_0x5ea684){if(_0x5ea684){_0x1267da[_0xe9c3('0x4b')]=_[_0xe9c3('0x4c')](db[_0xe9c3('0x71')][_0xe9c3('0x60')]);_0x1267da[_0xe9c3('0x4d')]=_[_0xe9c3('0x4c')](_0x41426a[_0xe9c3('0x4d')]);_0x1267da['filters']=_[_0xe9c3('0x4f')](_0x1267da['model'],_0x1267da['query']);_0x2d5e2e[_0xe9c3('0x50')]=_['intersection'](_0x1267da['model'],qs[_0xe9c3('0x51')](_0x41426a[_0xe9c3('0x4d')][_0xe9c3('0x51')]));_0x2d5e2e['attributes']=_0x2d5e2e['attributes'][_0xe9c3('0x6d')]?_0x2d5e2e[_0xe9c3('0x50')]:_0x1267da[_0xe9c3('0x4b')];if(!_0x41426a[_0xe9c3('0x4d')][_0xe9c3('0x52')](_0xe9c3('0x53'))){_0x2d5e2e['limit']=qs['limit'](_0x41426a['query'][_0xe9c3('0x22')]);_0x2d5e2e[_0xe9c3('0x20')]=qs[_0xe9c3('0x20')](_0x41426a[_0xe9c3('0x4d')][_0xe9c3('0x20')]);}_0x2d5e2e['order']=qs['sort'](_0x41426a[_0xe9c3('0x4d')][_0xe9c3('0x55')]);_0x2d5e2e[_0xe9c3('0x59')]=qs['filters'](_[_0xe9c3('0x56')](_0x41426a['query'],_0x1267da['filters']));_0x2d5e2e[_0xe9c3('0x59')][_0xe9c3('0x69')]=_0x5ea684['id'];if(_0x41426a[_0xe9c3('0x4d')][_0xe9c3('0x57')]){_0x2d5e2e[_0xe9c3('0x59')]=_[_0xe9c3('0x58')](_0x2d5e2e[_0xe9c3('0x59')],{'$or':_[_0xe9c3('0x46')](_0x2d5e2e[_0xe9c3('0x50')],function(_0x5ab075){var _0x53c969={};_0x53c969[_0x5ab075]={'$like':'%'+_0x41426a[_0xe9c3('0x4d')][_0xe9c3('0x57')]+'%'};return _0x53c969;})});}_0x2d5e2e=_[_0xe9c3('0x58')]({},_0x2d5e2e,_0x41426a[_0xe9c3('0x5a')]);return db['CannedAnswer']['count']({'where':_0x2d5e2e[_0xe9c3('0x59')]})['then'](function(_0x4e83fa){_0x482c76[_0xe9c3('0x23')]=_0x4e83fa;if(_0x41426a[_0xe9c3('0x4d')][_0xe9c3('0x5b')]){_0x2d5e2e['include']=[{'all':!![]}];}return db[_0xe9c3('0x71')][_0xe9c3('0x5c')](_0x2d5e2e);})[_0xe9c3('0x11')](function(_0x361869){_0x482c76[_0xe9c3('0x5d')]=_0x361869;return _0x482c76;});}})['then'](respondWithFilteredResult(_0x202959,_0x2d5e2e))[_0xe9c3('0x1b')](handleError(_0x202959,null));};exports['removeAnswers']=function(_0xb29aed,_0x27d3a6){return db[_0xe9c3('0x47')]['find']({'where':{'id':_0xb29aed[_0xe9c3('0x5f')]['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x27d3a6,null))[_0xe9c3('0x11')](function(_0x242f2e){if(_0x242f2e){return _0x242f2e[_0xe9c3('0x73')](_0xb29aed[_0xe9c3('0x4d')][_0xe9c3('0x6f')]);}})['then'](respondWithStatusCode(_0x27d3a6,null))[_0xe9c3('0x1b')](handleError(_0x27d3a6,null));};exports['create']=function(_0xbec310,_0x54ca96){var _0x1667c5={'name':_0xbec310[_0xe9c3('0x62')]['name'],'key':_0xbec310['body'][_0xe9c3('0x4a')],'provider':_0xbec310[_0xe9c3('0x62')][_0xe9c3('0x74')]===_0xe9c3('0x63')?null:_0xbec310[_0xe9c3('0x62')][_0xe9c3('0x74')],'email':_0xbec310['body'][_0xe9c3('0x75')],'ListId':_0xbec310[_0xe9c3('0x62')][_0xe9c3('0x76')],'active':!_[_0xe9c3('0x77')](_0xbec310[_0xe9c3('0x62')][_0xe9c3('0x78')])?_0xbec310['body'][_0xe9c3('0x78')]:!![],'description':_0xbec310['body']['description']||null};var _0x51a676=getAuthenticationOptions(_0x1667c5[_0xe9c3('0x74')],_0xbec310['body']);_0x1667c5[_0xe9c3('0x41')]=_0x51a676['Imap'];_0x1667c5[_0xe9c3('0x43')]=_0x51a676[_0xe9c3('0x43')];return db[_0xe9c3('0x47')][_0xe9c3('0x6b')](_0x1667c5,{'include':[{'model':db['MailServerOut'],'as':_0xe9c3('0x43')},{'model':db[_0xe9c3('0x44')],'as':_0xe9c3('0x41')}]})[_0xe9c3('0x11')](function(_0x3a0d36){var _0x491851=_0xbec310['user'][_0xe9c3('0x28')]({'plain':!![]});if(!_0x491851)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x491851[_0xe9c3('0x79')]===_0xe9c3('0x37')){var _0x39938a=_0x3a0d36[_0xe9c3('0x28')]({'plain':!![]});return db[_0xe9c3('0x7a')][_0xe9c3('0x64')]({'where':{'name':_0xe9c3('0x29'),'userProfileId':_0x491851[_0xe9c3('0x7b')]},'raw':!![]})['then'](function(_0x1c8fcf){if(_0x1c8fcf&&_0x1c8fcf['autoAssociation']===0x0){return db['UserProfileResource'][_0xe9c3('0x6b')]({'name':_0x39938a[_0xe9c3('0x2c')],'resourceId':_0x39938a['id'],'type':_0x1c8fcf[_0xe9c3('0x2c')],'sectionId':_0x1c8fcf['id']},{})['then'](function(){return _0x3a0d36;});}else{return _0x3a0d36;}})[_0xe9c3('0x1b')](function(_0x58edb4){logger[_0xe9c3('0x17')](_0xe9c3('0x7c'),_0x58edb4);throw _0x58edb4;});}return _0x3a0d36;})[_0xe9c3('0x11')](respondWithResult(_0x54ca96,0xc9))[_0xe9c3('0x1b')](handleError(_0x54ca96,null));};exports[_0xe9c3('0x7d')]=function(_0x16a987,_0x857aea){return db[_0xe9c3('0x47')][_0xe9c3('0x6c')]({'where':{'id':_0x16a987[_0xe9c3('0x5f')]['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x857aea,null))['then'](function(_0x2007f7){if(_0x2007f7){return _0x2007f7[_0xe9c3('0x7d')]();}return null;})['then'](respondWithResult(_0x857aea,null))[_0xe9c3('0x1b')](handleError(_0x857aea,null));};exports[_0xe9c3('0x7e')]=function(_0x2dc795,_0x423a2e){if(_0x2dc795[_0xe9c3('0x62')]['id']){delete _0x2dc795[_0xe9c3('0x62')]['id'];}return db[_0xe9c3('0x47')]['find']({'where':{'id':_0x2dc795['params']['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x423a2e,null))[_0xe9c3('0x11')](function(_0x3bb8cc){if(_0x3bb8cc){_0x2dc795['body'][_0xe9c3('0x69')]=_0x3bb8cc['id'];return db[_0xe9c3('0x44')]['create'](_0x2dc795[_0xe9c3('0x62')]);}})[_0xe9c3('0x11')](respondWithResult(_0x423a2e,null))['catch'](handleError(_0x423a2e,null));};exports[_0xe9c3('0x7f')]=function(_0x18c283,_0x590061){return db['MailAccount'][_0xe9c3('0x6c')]({'where':{'id':_0x18c283[_0xe9c3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x590061,null))[_0xe9c3('0x11')](function(_0x8c9ef0){if(_0x8c9ef0){return _0x8c9ef0[_0xe9c3('0x80')](null);}return null;})[_0xe9c3('0x11')](respondWithStatusCode(_0x590061,null))[_0xe9c3('0x1b')](handleError(_0x590061,null));};exports[_0xe9c3('0x81')]=function(_0x2330b4,_0x653c7c){return db['MailAccount']['findOne']({'where':{'id':_0x2330b4['params']['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x653c7c,null))[_0xe9c3('0x11')](function(_0x4b8841){if(_0x4b8841){return _0x4b8841[_0xe9c3('0x81')]();}return null;})[_0xe9c3('0x11')](respondWithResult(_0x653c7c,null))[_0xe9c3('0x1b')](handleError(_0x653c7c,null));};exports[_0xe9c3('0x82')]=function(_0x3b38a3,_0x3427c5){if(_0x3b38a3['body']['id']){delete _0x3b38a3[_0xe9c3('0x62')]['id'];}return db['MailAccount'][_0xe9c3('0x64')]({'where':{'id':_0x3b38a3['params']['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x3427c5,null))[_0xe9c3('0x11')](function(_0x12be3e){if(_0x12be3e){_0x3b38a3[_0xe9c3('0x62')][_0xe9c3('0x69')]=_0x12be3e['id'];return db[_0xe9c3('0x65')][_0xe9c3('0x6b')](_0x3b38a3[_0xe9c3('0x62')]);}})[_0xe9c3('0x11')](respondWithResult(_0x3427c5,null))[_0xe9c3('0x1b')](handleError(_0x3427c5,null));};exports[_0xe9c3('0x83')]=function(_0x1f6789,_0x3b1d72){return db[_0xe9c3('0x47')][_0xe9c3('0x6c')]({'where':{'id':_0x1f6789[_0xe9c3('0x5f')]['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x3b1d72,null))[_0xe9c3('0x11')](function(_0x2d9521){if(_0x2d9521){return _0x2d9521[_0xe9c3('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x3b1d72,null))[_0xe9c3('0x1b')](handleError(_0x3b1d72,null));};exports['addInteraction']=function(_0x3565dd,_0x1be2bc){return db['MailInteraction'][_0xe9c3('0x64')]({'where':{'id':_0x3565dd['params']['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x1be2bc,null))['then'](function(_0x25fc74){if(_0x25fc74){return _0x25fc74[_0xe9c3('0x85')](_0x3565dd[_0xe9c3('0x62')]['ids'],_[_0xe9c3('0x86')](_0x3565dd[_0xe9c3('0x62')],[_0xe9c3('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x1be2bc,null))['catch'](handleError(_0x1be2bc,null));};exports[_0xe9c3('0x87')]=function(_0x10ecbd,_0x347318){var _0x3bb7d6={'raw':![],'where':{}};var _0x541f5f={};var _0x31d9c2={'count':0x0,'rows':[]};return db[_0xe9c3('0x47')][_0xe9c3('0x6c')]({'where':{'id':_0x10ecbd[_0xe9c3('0x5f')]['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x347318,null))[_0xe9c3('0x11')](function(_0xf14ded){if(_0xf14ded){_0x541f5f[_0xe9c3('0x4b')]=_[_0xe9c3('0x4c')](db[_0xe9c3('0x88')][_0xe9c3('0x60')]);_0x541f5f[_0xe9c3('0x4d')]=_[_0xe9c3('0x4c')](_0x10ecbd['query']);_0x541f5f[_0xe9c3('0x4e')]=_[_0xe9c3('0x4f')](_0x541f5f['model'],_0x541f5f[_0xe9c3('0x4d')]);_0x3bb7d6[_0xe9c3('0x50')]=_[_0xe9c3('0x4f')](_0x541f5f[_0xe9c3('0x4b')],qs[_0xe9c3('0x51')](_0x10ecbd['query'][_0xe9c3('0x51')]));_0x3bb7d6[_0xe9c3('0x50')]=_0x3bb7d6[_0xe9c3('0x50')]['length']?_0x3bb7d6['attributes']:_0x541f5f[_0xe9c3('0x4b')];if(!_0x10ecbd[_0xe9c3('0x4d')][_0xe9c3('0x52')](_0xe9c3('0x53'))){_0x3bb7d6[_0xe9c3('0x22')]=qs[_0xe9c3('0x22')](_0x10ecbd['query'][_0xe9c3('0x22')]);_0x3bb7d6['offset']=qs['offset'](_0x10ecbd[_0xe9c3('0x4d')][_0xe9c3('0x20')]);}_0x3bb7d6[_0xe9c3('0x54')]=qs[_0xe9c3('0x55')](_0x10ecbd['query']['sort']);_0x3bb7d6[_0xe9c3('0x59')]=qs[_0xe9c3('0x4e')](_[_0xe9c3('0x56')](_0x10ecbd[_0xe9c3('0x4d')],_0x541f5f[_0xe9c3('0x4e')]));_0x3bb7d6[_0xe9c3('0x59')][_0xe9c3('0x69')]=_0xf14ded['id'];if(_0x10ecbd[_0xe9c3('0x4d')]['filter']){_0x3bb7d6[_0xe9c3('0x59')]=_[_0xe9c3('0x58')](_0x3bb7d6[_0xe9c3('0x59')],{'$or':_[_0xe9c3('0x46')](_0x3bb7d6['attributes'],function(_0x1261a2){var _0x215813={};_0x215813[_0x1261a2]={'$like':'%'+_0x10ecbd[_0xe9c3('0x4d')][_0xe9c3('0x57')]+'%'};return _0x215813;})});}_0x3bb7d6=_['merge']({},_0x3bb7d6,_0x10ecbd['options']);return db['MailInteraction'][_0xe9c3('0x23')]({'where':_0x3bb7d6[_0xe9c3('0x59')]})[_0xe9c3('0x11')](function(_0x241cd8){_0x31d9c2[_0xe9c3('0x23')]=_0x241cd8;if(_0x10ecbd['query'][_0xe9c3('0x5b')]){_0x3bb7d6['include']=[{'model':db[_0xe9c3('0x89')],'as':_0xe9c3('0x8a'),'required':![]},{'model':db[_0xe9c3('0x8b')],'as':_0xe9c3('0x8c'),'attributes':[_0xe9c3('0x2c'),'fullname',_0xe9c3('0x8d')],'required':![]},{'model':db[_0xe9c3('0x8e')],'as':'Tags','attributes':['id','name','color'],'where':_0x10ecbd['query'][_0xe9c3('0x8f')]?{'id':_0x10ecbd[_0xe9c3('0x4d')][_0xe9c3('0x8f')]}:undefined,'required':_0x10ecbd[_0xe9c3('0x4d')][_0xe9c3('0x8f')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x3bb7d6);})['then'](function(_0x422e82){_0x31d9c2[_0xe9c3('0x5d')]=_0x422e82;return _0x31d9c2;});}})[_0xe9c3('0x11')](respondWithFilteredResult(_0x347318,_0x3bb7d6))[_0xe9c3('0x1b')](handleError(_0x347318,null));};exports['addApplications']=function addApplications(_0x35b92e,_0x3f3ac5){var _0xa8ec3d=_0x35b92e[_0xe9c3('0x5f')]['id'];var _0x5e9d20=_0x35b92e['body'];var _0x14781f=0xc8;var _0x3e5eba=null;return db[_0xe9c3('0x90')][_0xe9c3('0x91')]({'isolationLevel':db[_0xe9c3('0x90')]['Transaction'][_0xe9c3('0x92')]['READ_COMMITTED']},function(_0x5df63b){return db['MailAccount'][_0xe9c3('0x6c')]({'where':{'id':_0xa8ec3d},'transaction':_0x5df63b})[_0xe9c3('0x11')](function(_0x48bc37){if(_0x48bc37){return db[_0xe9c3('0x93')]['destroy']({'where':{'MailAccountId':_0xa8ec3d},'transaction':_0x5df63b})[_0xe9c3('0x11')](function(){var _0x1454ed=_['map'](_0x5e9d20,function(_0x25d6a4){_0x25d6a4[_0xe9c3('0x69')]=_0xa8ec3d;return _0x25d6a4;});return db[_0xe9c3('0x93')][_0xe9c3('0x94')](_0x1454ed,{'transaction':_0x5df63b});});}else{_0x14781f=0x194;_0x3e5eba=[];}});})['then'](function(){if(_0x14781f!==0x194){return db[_0xe9c3('0x93')]['findAndCountAll']({'where':{'MailAccountId':_0xa8ec3d},'order':_0xe9c3('0x95')})[_0xe9c3('0x11')](function(_0x1fe0c3){_0x3e5eba=_0x1fe0c3;});}})[_0xe9c3('0x1b')](function(_0x49cbd6){_0x14781f=0x1f4;logger[_0xe9c3('0x17')](_0x49cbd6[_0xe9c3('0x2b')]);if(_0x49cbd6[_0xe9c3('0x2c')]){delete _0x49cbd6[_0xe9c3('0x2c')];}_0x3e5eba=_0x49cbd6;})[_0xe9c3('0x96')](function(){if(_0x3e5eba===null){_0x3f3ac5[_0xe9c3('0x1c')](_0x14781f);}else{if(_0x14781f===0x1f4){_0x3f3ac5[_0xe9c3('0x1d')](_0x14781f)[_0xe9c3('0x97')](_0x3e5eba);}else{_0x3f3ac5[_0xe9c3('0x1d')](_0x14781f)[_0xe9c3('0x1f')](_0x3e5eba);}}});};exports[_0xe9c3('0x98')]=function(_0x20b6e6,_0x5f1c46){var _0x5eb2f1={};var _0x2994e0={};var _0x56bd3f;var _0x43bd9d;return db[_0xe9c3('0x47')][_0xe9c3('0x6c')]({'where':{'id':_0x20b6e6[_0xe9c3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5f1c46,null))[_0xe9c3('0x11')](function(_0x307356){if(_0x307356){_0x56bd3f=_0x307356;_0x2994e0[_0xe9c3('0x4b')]=_[_0xe9c3('0x4c')](db[_0xe9c3('0x93')][_0xe9c3('0x60')]);_0x2994e0['query']=_[_0xe9c3('0x4c')](_0x20b6e6[_0xe9c3('0x4d')]);_0x2994e0['filters']=_[_0xe9c3('0x4f')](_0x2994e0[_0xe9c3('0x4b')],_0x2994e0[_0xe9c3('0x4d')]);_0x5eb2f1[_0xe9c3('0x50')]=_[_0xe9c3('0x4f')](_0x2994e0[_0xe9c3('0x4b')],qs[_0xe9c3('0x51')](_0x20b6e6[_0xe9c3('0x4d')][_0xe9c3('0x51')]));_0x5eb2f1[_0xe9c3('0x50')]=_0x5eb2f1[_0xe9c3('0x50')][_0xe9c3('0x6d')]?_0x5eb2f1[_0xe9c3('0x50')]:_0x2994e0[_0xe9c3('0x4b')];_0x5eb2f1[_0xe9c3('0x54')]=qs[_0xe9c3('0x55')](_0x20b6e6[_0xe9c3('0x4d')][_0xe9c3('0x55')]);_0x5eb2f1[_0xe9c3('0x59')]=qs['filters'](_['pick'](_0x20b6e6[_0xe9c3('0x4d')],_0x2994e0['filters']));if(_0x20b6e6[_0xe9c3('0x4d')][_0xe9c3('0x57')]){_0x5eb2f1[_0xe9c3('0x59')]=_[_0xe9c3('0x58')](_0x5eb2f1['where'],{'$or':_[_0xe9c3('0x46')](_0x5eb2f1[_0xe9c3('0x50')],function(_0x2ef3d5){var _0x142940={};_0x142940[_0x2ef3d5]={'$like':'%'+_0x20b6e6[_0xe9c3('0x4d')][_0xe9c3('0x57')]+'%'};return _0x142940;})});}_0x5eb2f1=_['merge']({},_0x5eb2f1,_0x20b6e6['options']);return _0x56bd3f[_0xe9c3('0x98')](_0x5eb2f1);}})[_0xe9c3('0x11')](function(_0x389f9d){if(_0x389f9d){_0x43bd9d=_0x389f9d['length'];if(!_0x20b6e6[_0xe9c3('0x4d')][_0xe9c3('0x52')]('nolimit')){_0x5eb2f1[_0xe9c3('0x22')]=qs[_0xe9c3('0x22')](_0x20b6e6[_0xe9c3('0x4d')]['limit']);_0x5eb2f1[_0xe9c3('0x20')]=qs[_0xe9c3('0x20')](_0x20b6e6[_0xe9c3('0x4d')][_0xe9c3('0x20')]);}return _0x56bd3f[_0xe9c3('0x98')](_0x5eb2f1);}})[_0xe9c3('0x11')](function(_0x23c47e){if(_0x23c47e){return _0x23c47e?{'count':_0x43bd9d,'rows':_0x23c47e}:null;}})[_0xe9c3('0x11')](respondWithResult(_0x5f1c46,null))[_0xe9c3('0x1b')](handleError(_0x5f1c46,null));};exports[_0xe9c3('0x99')]=function(_0x133842,_0x133e93){var _0x2c0011={'raw':!![],'where':{}};var _0x1613d6={};var _0x34b122={'count':0x0,'rows':[]};return db[_0xe9c3('0x47')][_0xe9c3('0x6c')]({'where':{'id':_0x133842[_0xe9c3('0x5f')]['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x133e93,null))[_0xe9c3('0x11')](function(_0x5abe65){if(_0x5abe65){_0x1613d6[_0xe9c3('0x4b')]=_[_0xe9c3('0x4c')](db[_0xe9c3('0x9a')][_0xe9c3('0x60')]);_0x1613d6['query']=_[_0xe9c3('0x4c')](_0x133842[_0xe9c3('0x4d')]);_0x1613d6[_0xe9c3('0x4e')]=_[_0xe9c3('0x4f')](_0x1613d6[_0xe9c3('0x4b')],_0x1613d6[_0xe9c3('0x4d')]);_0x2c0011[_0xe9c3('0x50')]=_[_0xe9c3('0x4f')](_0x1613d6[_0xe9c3('0x4b')],qs['fields'](_0x133842[_0xe9c3('0x4d')][_0xe9c3('0x51')]));_0x2c0011['attributes']=_0x2c0011[_0xe9c3('0x50')][_0xe9c3('0x6d')]?_0x2c0011['attributes']:_0x1613d6[_0xe9c3('0x4b')];if(!_0x133842[_0xe9c3('0x4d')][_0xe9c3('0x52')](_0xe9c3('0x53'))){_0x2c0011[_0xe9c3('0x22')]=qs[_0xe9c3('0x22')](_0x133842['query'][_0xe9c3('0x22')]);_0x2c0011[_0xe9c3('0x20')]=qs[_0xe9c3('0x20')](_0x133842[_0xe9c3('0x4d')]['offset']);}_0x2c0011['order']=qs[_0xe9c3('0x55')](_0x133842['query'][_0xe9c3('0x55')]);_0x2c0011[_0xe9c3('0x59')]=qs[_0xe9c3('0x4e')](_['pick'](_0x133842['query'],_0x1613d6['filters']));_0x2c0011[_0xe9c3('0x59')]['MailAccountId']=_0x5abe65['id'];if(_0x133842['query'][_0xe9c3('0x57')]){_0x2c0011[_0xe9c3('0x59')]=_[_0xe9c3('0x58')](_0x2c0011[_0xe9c3('0x59')],{'$or':_[_0xe9c3('0x46')](_0x2c0011['attributes'],function(_0x2c0406){var _0x839d12={};_0x839d12[_0x2c0406]={'$like':'%'+_0x133842[_0xe9c3('0x4d')]['filter']+'%'};return _0x839d12;})});}if(_0x133842[_0xe9c3('0x4d')]['$gte']){var _0x184f2e=_0x133842[_0xe9c3('0x4d')][_0xe9c3('0x9b')]['split'](',');var _0x42f714={};_0x42f714[_0x184f2e[0x0]]={'$gte':moment(_0x184f2e[0x1])[_0xe9c3('0x9c')](_0xe9c3('0x9d'))};_0x2c0011[_0xe9c3('0x59')]=_[_0xe9c3('0x58')](_0x2c0011[_0xe9c3('0x59')],_0x42f714);}_0x2c0011=_[_0xe9c3('0x58')]({},_0x2c0011,_0x133842[_0xe9c3('0x5a')]);return db[_0xe9c3('0x9a')][_0xe9c3('0x23')]({'where':_0x2c0011[_0xe9c3('0x59')]})[_0xe9c3('0x11')](function(_0x402a4d){_0x34b122['count']=_0x402a4d;if(_0x133842['query']['includeAll']){_0x2c0011[_0xe9c3('0x61')]=[{'all':!![]}];}return db['MailMessage'][_0xe9c3('0x5c')](_0x2c0011);})[_0xe9c3('0x11')](function(_0x5ca4f3){if(_0x133842[_0xe9c3('0x4d')][_0xe9c3('0x9e')]==='true'){for(var _0x30bfa6=0x0;_0x30bfa6<_0x5ca4f3['length'];_0x30bfa6++){_0x5ca4f3[_0x30bfa6][_0xe9c3('0x62')]=juice(_0x5ca4f3[_0x30bfa6][_0xe9c3('0x62')]);}}_0x34b122[_0xe9c3('0x5d')]=_0x5ca4f3;return _0x34b122;});}})[_0xe9c3('0x11')](respondWithFilteredResult(_0x133e93,_0x2c0011))['catch'](handleError(_0x133e93,null));};exports[_0xe9c3('0x97')]=function(_0x4ece5a,_0x2397ee){var _0x42587d,_0x505b34={},_0x1cdadb;if(_0x4ece5a['body']['to']){_0x1cdadb=_0x4ece5a[_0xe9c3('0x62')]['to']['split'](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x4ece5a['params']['id']},'include':[{'model':db['CmList'],'as':_0xe9c3('0x9f'),'include':[{'model':db[_0xe9c3('0x89')],'as':_0xe9c3('0xa0'),'where':{'email':_0x1cdadb},'limit':0x1,'order':[[_0xe9c3('0xa1'),_0xe9c3('0xa2')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xe9c3('0xa3')],'as':_0xe9c3('0xa3'),'raw':!![]}]}]})[_0xe9c3('0x11')](handleEntityNotFound(_0x2397ee,null))[_0xe9c3('0x11')](function(_0x30842f){if(!_0x30842f)return;_0x42587d=_0x30842f;if(!_0x30842f['Smtp'])throw new Error('Smtp\x20configuration\x20not\x20found');if(_['isNil'](_0x4ece5a[_0xe9c3('0x62')]['from'])){_0x4ece5a['body'][_0xe9c3('0xa4')]=util[_0xe9c3('0x9c')](_0xe9c3('0xa5'),_0x30842f['name'],_0x30842f[_0xe9c3('0x75')]||_0x30842f[_0xe9c3('0x43')][_0xe9c3('0x37')]);}if(_0x4ece5a[_0xe9c3('0x62')][_0xe9c3('0xa6')]&&_0x4ece5a[_0xe9c3('0x62')][_0xe9c3('0xa6')]['length']){for(var _0x151ffa=0x0;_0x151ffa<_0x4ece5a['body'][_0xe9c3('0xa6')][_0xe9c3('0x6d')];_0x151ffa+=0x1){_0x4ece5a[_0xe9c3('0x62')][_0xe9c3('0xa6')][_0x151ffa]={'filename':_0x4ece5a['body'][_0xe9c3('0xa6')][_0x151ffa][_0xe9c3('0x2c')],'path':path[_0xe9c3('0xa7')](config['root'],_0xe9c3('0xa8'),_0x4ece5a[_0xe9c3('0x62')][_0xe9c3('0xa6')][_0x151ffa][_0xe9c3('0xa9')])};}}var _0x14db76=_0x30842f[_0xe9c3('0xaa')]();return respondWithRpcPromise('SendMail',_0xe9c3('0xab'),{'account':_0x14db76,'message':_0x4ece5a[_0xe9c3('0x62')]});})['then'](function(_0x299e8b){if(!_0x299e8b)return;_0x505b34=_0x299e8b;if(!_0x42587d[_0xe9c3('0x9f')])throw new Error(_0xe9c3('0xac'));if(_0x42587d[_0xe9c3('0x9f')][_0xe9c3('0xa0')]['length'])return _0x42587d[_0xe9c3('0x9f')][_0xe9c3('0xa0')][0x0];return db[_0xe9c3('0x89')][_0xe9c3('0x6b')](_['defaults'](_0x4ece5a[_0xe9c3('0x62')],{'firstName':_0x4ece5a['body']['to'],'email':_0x4ece5a[_0xe9c3('0x62')]['to'],'phone':_0x4ece5a[_0xe9c3('0x62')]['to'],'ListId':_0x42587d[_0xe9c3('0x76')]}));})['then'](function(_0x31382a){if(!_0x31382a)return;var _0x31ec6b={'UserId':_0x4ece5a['user']['id'],'ContactId':_0x31382a['id'],'MailAccountId':_0x42587d['id'],'inReplyTo':_0x505b34[_0xe9c3('0xad')],'to':_0x4ece5a[_0xe9c3('0x62')]['from'],'cc':_0x4ece5a[_0xe9c3('0x62')]['cc'],'subject':_0x4ece5a[_0xe9c3('0x62')][_0xe9c3('0xae')],'attach':_0x4ece5a[_0xe9c3('0x62')][_0xe9c3('0xaf')],'firstMsgDirection':_0xe9c3('0xb0'),'lastMsgAt':moment()[_0xe9c3('0x9c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xe9c3('0xb0'),'Messages':[_[_0xe9c3('0x58')](_0x4ece5a[_0xe9c3('0x62')],{'messageId':_0x505b34[_0xe9c3('0xad')],'sentAt':moment()[_0xe9c3('0x9c')](_0xe9c3('0x9d')),'read':!![],'MailAccountId':_0x42587d['id'],'UserId':_0x4ece5a[_0xe9c3('0x37')]['id'],'ContactId':_0x31382a['id']})]};if(_0x4ece5a['body'][_0xe9c3('0xb1')]){_0x31ec6b=_[_0xe9c3('0x58')](_0x31ec6b,_0x4ece5a['body'][_0xe9c3('0xb1')]);}return db[_0xe9c3('0x88')][_0xe9c3('0x6b')](_0x31ec6b,{'include':[{'model':db['MailMessage'],'as':_0xe9c3('0xb2')}]});})[_0xe9c3('0x11')](respondWithResult(_0x2397ee,null))[_0xe9c3('0x1b')](handleError(_0x2397ee,null));};exports[_0xe9c3('0xb3')]=function(_0x46b0d2,_0x419400){return db[_0xe9c3('0x47')]['find']({'where':{'id':_0x46b0d2[_0xe9c3('0x5f')]['id']},'include':[{'model':db[_0xe9c3('0x65')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xe9c3('0xa3')],'as':_0xe9c3('0xa3'),'raw':!![]}]}]})[_0xe9c3('0x11')](handleEntityNotFound(_0x419400,null))[_0xe9c3('0x11')](function(_0x2930cd){if(!_0x2930cd[_0xe9c3('0x43')])return;var _0x15d4d1=_0x2930cd[_0xe9c3('0xaa')]();return respondWithRpcPromise('VerifySmtp',_0xe9c3('0xb3'),{'account':_0x15d4d1});})[_0xe9c3('0x11')](respondWithResult(_0x419400,null))[_0xe9c3('0x1b')](handleError(_0x419400,null));};exports[_0xe9c3('0x27')]=function(_0x3484e7,_0x38d496){return db['MailAccount'][_0xe9c3('0x64')]({'where':{'id':_0x3484e7[_0xe9c3('0x5f')]['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x38d496,null))[_0xe9c3('0x11')](function(_0x545e5b){if(_0x545e5b&&_0x545e5b[_0xe9c3('0x3f')]){throw new db[(_0xe9c3('0xb4'))]['ValidationError'](_0xe9c3('0xb5'));}return _0x545e5b;})[_0xe9c3('0x11')](removeEntity(_0x38d496,null))['catch'](handleError(_0x38d496,null));};exports[_0xe9c3('0xb6')]=function(_0x1b3208,_0x2d4a09){return db[_0xe9c3('0x47')]['find']({'where':{'id':_0x1b3208['params']['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x2d4a09,null))[_0xe9c3('0x11')](function(_0x2ee655){if(_0x2ee655){return _0x2ee655['addAgents'](_0x1b3208[_0xe9c3('0x62')][_0xe9c3('0x6f')],_['omit'](_0x1b3208[_0xe9c3('0x62')],[_0xe9c3('0x6f'),'id'])||{})[_0xe9c3('0xb7')](function(_0x12ec9b){for(var _0x22e7fe=0x0;_0x22e7fe<_0x1b3208[_0xe9c3('0x62')]['ids']['length'];_0x22e7fe+=0x1){socket[_0xe9c3('0xb8')]('userMailAccount:save',{'UserId':Number(_0x1b3208[_0xe9c3('0x62')]['ids'][_0x22e7fe]),'MailAccountId':Number(_0x1b3208[_0xe9c3('0x5f')]['id'])});}return _0x12ec9b;});}})['then'](respondWithResult(_0x2d4a09,null))[_0xe9c3('0x1b')](handleError(_0x2d4a09,null));};exports[_0xe9c3('0xb9')]=function(_0x17338a,_0x296053){return db[_0xe9c3('0x47')][_0xe9c3('0x64')]({'where':{'id':_0x17338a[_0xe9c3('0x5f')]['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x296053,null))[_0xe9c3('0x11')](function(_0x3a73c4){if(_0x3a73c4){return _0x3a73c4[_0xe9c3('0xb9')](_0x17338a[_0xe9c3('0x4d')][_0xe9c3('0x6f')])[_0xe9c3('0x11')](function(){if(_['isArray'](_0x17338a[_0xe9c3('0x4d')]['ids'])){for(var _0x18120e=0x0;_0x18120e<_0x17338a[_0xe9c3('0x4d')][_0xe9c3('0x6f')][_0xe9c3('0x6d')];_0x18120e+=0x1){socket['emit'](_0xe9c3('0xba'),{'UserId':Number(_0x17338a['query'][_0xe9c3('0x6f')][_0x18120e]),'MailAccountId':Number(_0x17338a[_0xe9c3('0x5f')]['id'])});}}else{socket[_0xe9c3('0xb8')](_0xe9c3('0xba'),{'UserId':Number(_0x17338a['query'][_0xe9c3('0x6f')]),'MailAccountId':Number(_0x17338a[_0xe9c3('0x5f')]['id'])});}});}})[_0xe9c3('0x11')](respondWithStatusCode(_0x296053,null))[_0xe9c3('0x1b')](handleError(_0x296053,null));};exports[_0xe9c3('0xbb')]=function(_0x569914,_0x11167c){var _0x539849={};var _0x48473a={};var _0x13953c;var _0x168f32;return db[_0xe9c3('0x47')][_0xe9c3('0x6c')]({'where':{'id':_0x569914['params']['id']}})[_0xe9c3('0x11')](handleEntityNotFound(_0x11167c,null))['then'](function(_0x5540cf){if(_0x5540cf){_0x13953c=_0x5540cf;_0x48473a['model']=_[_0xe9c3('0x4c')](db[_0xe9c3('0x8b')][_0xe9c3('0x60')]);_0x48473a['query']=_[_0xe9c3('0x4c')](_0x569914[_0xe9c3('0x4d')]);_0x48473a[_0xe9c3('0x4e')]=_['intersection'](_0x48473a['model'],_0x48473a[_0xe9c3('0x4d')]);_0x539849[_0xe9c3('0x50')]=_['intersection'](_0x48473a[_0xe9c3('0x4b')],qs[_0xe9c3('0x51')](_0x569914[_0xe9c3('0x4d')][_0xe9c3('0x51')]));_0x539849[_0xe9c3('0x50')]=_0x539849[_0xe9c3('0x50')]['length']?_0x539849[_0xe9c3('0x50')]:_0x48473a[_0xe9c3('0x4b')];_0x539849[_0xe9c3('0x54')]=qs[_0xe9c3('0x55')](_0x569914[_0xe9c3('0x4d')][_0xe9c3('0x55')]);_0x539849[_0xe9c3('0x59')]=qs[_0xe9c3('0x4e')](_[_0xe9c3('0x56')](_0x569914[_0xe9c3('0x4d')],_0x48473a[_0xe9c3('0x4e')]));if(_0x569914[_0xe9c3('0x4d')][_0xe9c3('0x57')]){_0x539849[_0xe9c3('0x59')]=_[_0xe9c3('0x58')](_0x539849[_0xe9c3('0x59')],{'$or':_[_0xe9c3('0x46')](_0x539849['attributes'],function(_0x183c08){var _0x114a44={};_0x114a44[_0x183c08]={'$like':'%'+_0x569914[_0xe9c3('0x4d')]['filter']+'%'};return _0x114a44;})});}_0x539849=_[_0xe9c3('0x58')]({},_0x539849,_0x569914[_0xe9c3('0x5a')]);return _0x13953c['getAgents'](_0x539849);}})[_0xe9c3('0x11')](function(_0x38ebe2){if(_0x38ebe2){_0x168f32=_0x38ebe2[_0xe9c3('0x6d')];if(!_0x569914[_0xe9c3('0x4d')][_0xe9c3('0x52')]('nolimit')){_0x539849[_0xe9c3('0x22')]=qs[_0xe9c3('0x22')](_0x569914[_0xe9c3('0x4d')]['limit']);_0x539849['offset']=qs[_0xe9c3('0x20')](_0x569914[_0xe9c3('0x4d')]['offset']);}return _0x13953c[_0xe9c3('0xbb')](_0x539849);}})['then'](function(_0x49d997){if(_0x49d997){return _0x49d997?{'count':_0x168f32,'rows':_0x49d997}:null;}})[_0xe9c3('0x11')](respondWithResult(_0x11167c,null))[_0xe9c3('0x1b')](handleError(_0x11167c,null));}; \ No newline at end of file +var _0xf1f4=['bluebird','lodash','juice','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','get','MailAccounts','UserProfileResource','destroy','stack','name','send','gmail','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','smtp.office365.com','user','username','pass','password','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','query','intersection','model','fields','length','attributes','nolimit','order','sort','where','filters','pick','filter','includeAll','include','findAll','rows','show','keys','options','find','body','provider','custom','params','Mail\x20Account\x20not\x20found','describe','MailAccountId','getDispositions','findOne','hasOwnProperty','merge','Disposition','removeDispositions','ids','addAnswer','create','CannedAnswer','removeAnswers','key','email','active','description','role','UserProfileSection','userProfileId','autoAssociation','getImap','removeImap','getSmtp','addSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','attachments','join','root','server/files/attachments','getSmtpOptions','List\x20not\x20found','CmContact','ListId','messageId','subject','attach','out','Messages','VerifySmtp','verifySmtp','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment'];(function(_0x2a4a84,_0x3e04f0){var _0x3fe657=function(_0x344457){while(--_0x344457){_0x2a4a84['push'](_0x2a4a84['shift']());}};_0x3fe657(++_0x3e04f0);}(_0xf1f4,0x17f));var _0x4f1f=function(_0x2f8f9c,_0x2d6090){_0x2f8f9c=_0x2f8f9c-0x0;var _0x39d3e8=_0xf1f4[_0x2f8f9c];return _0x39d3e8;};'use strict';var moment=require(_0x4f1f('0x0'));var BPromise=require(_0x4f1f('0x1'));var util=require('util');var path=require('path');var _=require(_0x4f1f('0x2'));var juice=require(_0x4f1f('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x4f1f('0x4'))(_0x4f1f('0x5'));var config=require(_0x4f1f('0x6'));var db=require(_0x4f1f('0x7'))['db'];config['redis']=_[_0x4f1f('0x8')](config[_0x4f1f('0x9')],{'host':_0x4f1f('0xa'),'port':0x18eb});var socket=require(_0x4f1f('0xb'))(new Redis(config[_0x4f1f('0x9')]));require(_0x4f1f('0xc'))[_0x4f1f('0xd')](socket);var jayson=require(_0x4f1f('0xe'));var client=jayson[_0x4f1f('0xf')][_0x4f1f('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x391762,_0x2dd8a9,_0x25f674,_0x2ad1dd){return new BPromise(function(_0xc338e8,_0x130818){var _0x363f9b=_0x2ad1dd||client;return _0x363f9b[_0x4f1f('0x11')](_0x391762,_0x25f674)['then'](function(_0x5f2953){logger['info'](_0x4f1f('0x12'),_0x2dd8a9,_0x4f1f('0x13'));logger[_0x4f1f('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2dd8a9,'request\x20sent',JSON[_0x4f1f('0x15')](_0x5f2953));if(_0x5f2953['error']){if(_0x5f2953['error']['code']===0x1f4){logger[_0x4f1f('0x16')](_0x4f1f('0x12'),_0x2dd8a9,_0x5f2953[_0x4f1f('0x16')][_0x4f1f('0x17')]);return _0x130818(_0x5f2953[_0x4f1f('0x16')][_0x4f1f('0x17')]);}logger['error'](_0x4f1f('0x12'),_0x2dd8a9,_0x5f2953[_0x4f1f('0x16')]['message']);return _0xc338e8(_0x5f2953[_0x4f1f('0x16')]['message']);}else{logger[_0x4f1f('0x18')]('MailAccount,\x20%s,\x20%s',_0x2dd8a9,'request\x20sent');_0xc338e8(_0x5f2953[_0x4f1f('0x19')]['message']);}})[_0x4f1f('0x1a')](function(_0x4afcef){logger[_0x4f1f('0x16')](_0x4f1f('0x12'),_0x2dd8a9,_0x4afcef);_0x130818(_0x4afcef);});});}function respondWithStatusCode(_0x4420a4,_0x49b698){_0x49b698=_0x49b698||0xcc;return function(_0x59399b){if(_0x59399b){return _0x4420a4[_0x4f1f('0x1b')](_0x49b698);}return _0x4420a4[_0x4f1f('0x1c')](_0x49b698)[_0x4f1f('0x1d')]();};}function respondWithResult(_0x36deeb,_0x2822a3){_0x2822a3=_0x2822a3||0xc8;return function(_0x4059d2){if(_0x4059d2){return _0x36deeb[_0x4f1f('0x1c')](_0x2822a3)[_0x4f1f('0x1e')](_0x4059d2);}};}function respondWithFilteredResult(_0x16dc70,_0x4bf8ad){return function(_0x2bd3f6){if(_0x2bd3f6){var _0x4dfcc1=typeof _0x4bf8ad[_0x4f1f('0x1f')]==='undefined'&&typeof _0x4bf8ad[_0x4f1f('0x20')]===_0x4f1f('0x21');var _0x2497b0=_0x2bd3f6[_0x4f1f('0x22')];var _0x2fbc0a=_0x4dfcc1?0x0:_0x4bf8ad[_0x4f1f('0x1f')];var _0x8425d4=_0x4dfcc1?_0x2bd3f6[_0x4f1f('0x22')]:_0x4bf8ad[_0x4f1f('0x1f')]+_0x4bf8ad[_0x4f1f('0x20')];var _0x55df31;if(_0x8425d4>=_0x2497b0){_0x8425d4=_0x2497b0;_0x55df31=0xc8;}else{_0x55df31=0xce;}_0x16dc70['status'](_0x55df31);return _0x16dc70[_0x4f1f('0x23')](_0x4f1f('0x24'),_0x2fbc0a+'-'+_0x8425d4+'/'+_0x2497b0)[_0x4f1f('0x1e')](_0x2bd3f6);}return null;};}function saveUpdates(_0x1187f8){return function(_0x4fb8b2){if(_0x4fb8b2){return _0x4fb8b2[_0x4f1f('0x25')](_0x1187f8)[_0x4f1f('0x26')](function(_0x46ed7e){return _0x46ed7e;});}return null;};}function removeEntity(_0x92aeef){return function(_0x1cc06e){if(_0x1cc06e){return _0x1cc06e['destroy']()[_0x4f1f('0x26')](function(){var _0x49a19c=_0x1cc06e[_0x4f1f('0x27')]({'plain':!![]});var _0x77d770=_0x4f1f('0x28');return db[_0x4f1f('0x29')][_0x4f1f('0x2a')]({'where':{'type':_0x77d770,'resourceId':_0x49a19c['id']}})['then'](function(){return _0x1cc06e;});})[_0x4f1f('0x26')](function(){_0x92aeef[_0x4f1f('0x1c')](0xcc)[_0x4f1f('0x1d')]();});}};}function handleEntityNotFound(_0x152317){return function(_0xaf4af){if(!_0xaf4af){_0x152317[_0x4f1f('0x1b')](0x194);}return _0xaf4af;};}function handleError(_0x407d2d,_0x187d35){_0x187d35=_0x187d35||0x1f4;return function(_0x4ff701){logger[_0x4f1f('0x16')](_0x4ff701[_0x4f1f('0x2b')]);if(_0x4ff701['name']){delete _0x4ff701[_0x4f1f('0x2c')];}_0x407d2d[_0x4f1f('0x1c')](_0x187d35)[_0x4f1f('0x2d')](_0x4ff701);};}function getImapHost(_0x3074c){switch(_0x3074c){case _0x4f1f('0x2e'):return'imap.gmail.com';case _0x4f1f('0x2f'):return _0x4f1f('0x30');case'hotmail':return _0x4f1f('0x31');case _0x4f1f('0x32'):return _0x4f1f('0x33');}throw new Error(_0x4f1f('0x34'),_0x3074c);}function getSmtpHost(_0x33d434){switch(_0x33d434){case _0x4f1f('0x2e'):return _0x4f1f('0x35');case _0x4f1f('0x2f'):return _0x4f1f('0x36');case _0x4f1f('0x37'):return _0x4f1f('0x38');case _0x4f1f('0x32'):return _0x4f1f('0x39');}throw new Error(_0x4f1f('0x34'),_0x33d434);}function getAuthenticationOptions(_0x217076,_0x3f79d7){var _0xb82c2d={};var _0x391374={};if(_0x217076){_0xb82c2d['user']=_0x391374[_0x4f1f('0x3a')]=_0x3f79d7[_0x4f1f('0x3b')];_0xb82c2d['password']=_0x391374[_0x4f1f('0x3c')]=_0x3f79d7[_0x4f1f('0x3d')];if(_0x3f79d7[_0x4f1f('0x3e')]){_0xb82c2d['modernAuthentication']=_0x391374[_0x4f1f('0x3e')]=!![];_0xb82c2d['CloudProviderId']=_0x391374[_0x4f1f('0x3f')]=_0x3f79d7[_0x4f1f('0x3f')];_0xb82c2d[_0x4f1f('0x3d')]=_0x391374[_0x4f1f('0x3c')]=null;}else{_0xb82c2d[_0x4f1f('0x3f')]=_0x391374[_0x4f1f('0x3f')]=null;}_0xb82c2d[_0x4f1f('0x40')]=getImapHost(_0x217076);_0xb82c2d[_0x4f1f('0x41')]=0x3e1;_0x391374[_0x4f1f('0x40')]=getSmtpHost(_0x217076);_0x391374[_0x4f1f('0x41')]=0x24b;_0x391374[_0x4f1f('0x42')]=![];_0xb82c2d[_0x4f1f('0x43')]=_0x391374[_0x4f1f('0x43')]=null;}else{if(_0x3f79d7[_0x4f1f('0x44')]){_0xb82c2d['user']=_0x391374[_0x4f1f('0x3a')]=_0x3f79d7['username'];_0xb82c2d[_0x4f1f('0x3d')]=_0x391374[_0x4f1f('0x3c')]=_0x3f79d7[_0x4f1f('0x3d')];}else{_0xb82c2d[_0x4f1f('0x44')]=_0x391374[_0x4f1f('0x44')]=![];_0xb82c2d[_0x4f1f('0x3a')]=_0x391374['user']=null;_0xb82c2d[_0x4f1f('0x3d')]=_0x391374['pass']=null;}_0xb82c2d[_0x4f1f('0x40')]=_0x3f79d7[_0x4f1f('0x45')]['host'];_0xb82c2d['port']=_0x3f79d7['Imap']['port'];_0x391374[_0x4f1f('0x40')]=_0x3f79d7[_0x4f1f('0x46')][_0x4f1f('0x40')];_0x391374[_0x4f1f('0x41')]=_0x3f79d7[_0x4f1f('0x46')]['port'];}return{'Imap':_0xb82c2d,'Smtp':_0x391374};}exports[_0x4f1f('0x47')]=function(_0x166ffb,_0x33831d){var _0x569d71={'include':[{'model':db[_0x4f1f('0x48')],'as':_0x4f1f('0x45')},{'model':db[_0x4f1f('0x49')],'as':'Smtp'},{'model':db[_0x4f1f('0x4a')],'as':_0x4f1f('0x4b')}]},_0x16efc3={},_0x4233ce={'count':0x0,'rows':[]};var _0x15b585=_[_0x4f1f('0x4c')](db[_0x4f1f('0x4d')][_0x4f1f('0x4e')],function(_0x5bf727){return{'name':_0x5bf727[_0x4f1f('0x4f')],'type':_0x5bf727[_0x4f1f('0x50')]['key']};});_0x16efc3['model']=_[_0x4f1f('0x4c')](_0x15b585,_0x4f1f('0x2c'));_0x16efc3[_0x4f1f('0x51')]=_['keys'](_0x166ffb[_0x4f1f('0x51')]);_0x16efc3['filters']=_[_0x4f1f('0x52')](_0x16efc3[_0x4f1f('0x53')],_0x16efc3['query']);_0x569d71['attributes']=_['intersection'](_0x16efc3[_0x4f1f('0x53')],qs[_0x4f1f('0x54')](_0x166ffb[_0x4f1f('0x51')][_0x4f1f('0x54')]));_0x569d71['attributes']=_0x569d71['attributes'][_0x4f1f('0x55')]?_0x569d71[_0x4f1f('0x56')]:_0x16efc3['model'];if(!_0x166ffb['query']['hasOwnProperty'](_0x4f1f('0x57'))){_0x569d71[_0x4f1f('0x20')]=qs[_0x4f1f('0x20')](_0x166ffb[_0x4f1f('0x51')]['limit']);_0x569d71['offset']=qs[_0x4f1f('0x1f')](_0x166ffb[_0x4f1f('0x51')][_0x4f1f('0x1f')]);}_0x569d71[_0x4f1f('0x58')]=qs[_0x4f1f('0x59')](_0x166ffb[_0x4f1f('0x51')]['sort']);_0x569d71[_0x4f1f('0x5a')]=qs[_0x4f1f('0x5b')](_[_0x4f1f('0x5c')](_0x166ffb[_0x4f1f('0x51')],_0x16efc3[_0x4f1f('0x5b')]),_0x15b585);if(_0x166ffb[_0x4f1f('0x51')][_0x4f1f('0x5d')]){_0x569d71[_0x4f1f('0x5a')]=_['merge'](_0x569d71[_0x4f1f('0x5a')],{'$or':_[_0x4f1f('0x4c')](_0x15b585,function(_0xe6506){if(_0xe6506['type']!=='VIRTUAL'){var _0x10f34e={};_0x10f34e[_0xe6506[_0x4f1f('0x2c')]]={'$like':'%'+_0x166ffb[_0x4f1f('0x51')][_0x4f1f('0x5d')]+'%'};return _0x10f34e;}})});}_0x569d71=_['merge']({},_0x569d71,_0x166ffb['options']);var _0x289ebf={'where':_0x569d71[_0x4f1f('0x5a')]};return db['MailAccount'][_0x4f1f('0x22')](_0x289ebf)[_0x4f1f('0x26')](function(_0x4fdff2){_0x4233ce[_0x4f1f('0x22')]=_0x4fdff2;if(_0x166ffb[_0x4f1f('0x51')][_0x4f1f('0x5e')]){_0x569d71[_0x4f1f('0x5f')]=[{'all':!![]}];}return db[_0x4f1f('0x4d')][_0x4f1f('0x60')](_0x569d71);})['then'](function(_0x38edb5){_0x4233ce[_0x4f1f('0x61')]=_0x38edb5;return _0x4233ce;})['then'](respondWithFilteredResult(_0x33831d,_0x569d71))[_0x4f1f('0x1a')](handleError(_0x33831d,null));};exports[_0x4f1f('0x62')]=function(_0x53f4a4,_0x486942){var _0x243d67={'raw':![],'where':{'id':_0x53f4a4['params']['id']},'include':[{'model':db[_0x4f1f('0x48')],'as':_0x4f1f('0x45')},{'model':db[_0x4f1f('0x49')],'as':_0x4f1f('0x46')},{'model':db[_0x4f1f('0x4a')],'as':_0x4f1f('0x4b')}]},_0x1d4d78={};_0x1d4d78[_0x4f1f('0x53')]=_['keys'](db['MailAccount']['rawAttributes']);_0x1d4d78[_0x4f1f('0x51')]=_[_0x4f1f('0x63')](_0x53f4a4['query']);_0x1d4d78[_0x4f1f('0x5b')]=_[_0x4f1f('0x52')](_0x1d4d78['model'],_0x1d4d78[_0x4f1f('0x51')]);_0x243d67[_0x4f1f('0x56')]=_[_0x4f1f('0x52')](_0x1d4d78[_0x4f1f('0x53')],qs[_0x4f1f('0x54')](_0x53f4a4[_0x4f1f('0x51')]['fields']));_0x243d67['attributes']=_0x243d67['attributes'][_0x4f1f('0x55')]?_0x243d67[_0x4f1f('0x56')]:_0x1d4d78[_0x4f1f('0x53')];if(_0x53f4a4[_0x4f1f('0x51')][_0x4f1f('0x5e')]){_0x243d67['include']=[{'all':!![]}];}_0x243d67=_['merge']({},_0x243d67,_0x53f4a4[_0x4f1f('0x64')]);return db['MailAccount'][_0x4f1f('0x65')](_0x243d67)[_0x4f1f('0x26')](handleEntityNotFound(_0x486942,null))[_0x4f1f('0x26')](respondWithResult(_0x486942,null))['catch'](handleError(_0x486942,null));};exports['update']=function(_0x36b48a,_0x542f3c){if(_0x36b48a[_0x4f1f('0x66')]['id']){delete _0x36b48a[_0x4f1f('0x66')]['id'];}var _0x5e1d67=_0x36b48a[_0x4f1f('0x66')][_0x4f1f('0x67')]===_0x4f1f('0x68')?null:_0x36b48a[_0x4f1f('0x66')][_0x4f1f('0x67')];var _0x1bbac6=_0x36b48a['body'][_0x4f1f('0x45')]||{};var _0x5bdb89=_0x36b48a[_0x4f1f('0x66')][_0x4f1f('0x46')]||{};if(_0x5e1d67){_0x1bbac6[_0x4f1f('0x40')]=getImapHost(_0x5e1d67);_0x1bbac6[_0x4f1f('0x41')]=0x3e1;_0x5bdb89[_0x4f1f('0x40')]=getSmtpHost(_0x5e1d67);_0x5bdb89['port']=0x24b;_0x5bdb89[_0x4f1f('0x42')]=![];}if(_0x5bdb89[_0x4f1f('0x3e')]){_0x5bdb89[_0x4f1f('0x42')]=![];}else{_0x5bdb89[_0x4f1f('0x3f')]=null;}if(!_0x1bbac6[_0x4f1f('0x3e')])_0x1bbac6[_0x4f1f('0x3f')]=null;_0x36b48a[_0x4f1f('0x66')][_0x4f1f('0x45')]=_0x1bbac6;_0x36b48a[_0x4f1f('0x66')][_0x4f1f('0x46')]=_0x5bdb89;return db[_0x4f1f('0x4d')][_0x4f1f('0x65')]({'where':{'id':_0x36b48a[_0x4f1f('0x69')]['id']},'include':[{'model':db[_0x4f1f('0x48')],'as':_0x4f1f('0x45')},{'model':db[_0x4f1f('0x49')],'as':_0x4f1f('0x46')},{'model':db[_0x4f1f('0x4a')],'as':_0x4f1f('0x4b')}]})[_0x4f1f('0x26')](handleEntityNotFound(_0x542f3c,null))[_0x4f1f('0x26')](function(_0x177c29){if(!_0x177c29)throw new Error(_0x4f1f('0x6a'));if(_0x177c29[_0x4f1f('0x43')])delete _0x36b48a['body'][_0x4f1f('0x45')];return _0x177c29;})[_0x4f1f('0x26')](saveUpdates(_0x36b48a[_0x4f1f('0x66')],null))[_0x4f1f('0x26')](function(_0x1bdaa8){if(!_0x36b48a[_0x4f1f('0x66')]['Imap'])return _0x1bdaa8;return db[_0x4f1f('0x48')][_0x4f1f('0x25')](_0x36b48a[_0x4f1f('0x66')][_0x4f1f('0x45')],{'where':{'MailAccountId':_0x1bdaa8['id']}})[_0x4f1f('0x26')](function(){return _0x1bdaa8;});})['then'](function(_0x4f2a98){if(!_0x36b48a[_0x4f1f('0x66')][_0x4f1f('0x46')])return _0x4f2a98;return db[_0x4f1f('0x49')][_0x4f1f('0x25')](_0x36b48a[_0x4f1f('0x66')][_0x4f1f('0x46')],{'where':{'MailAccountId':_0x4f2a98['id']}})[_0x4f1f('0x26')](function(){return _0x4f2a98;});})[_0x4f1f('0x26')](respondWithResult(_0x542f3c,null))[_0x4f1f('0x1a')](handleError(_0x542f3c,null));};exports[_0x4f1f('0x6b')]=function(_0x240b52,_0x599f21){return db['MailAccount']['describe']()['then'](respondWithResult(_0x599f21,null))[_0x4f1f('0x1a')](handleError(_0x599f21,null));};exports['addDisposition']=function(_0x4728b0,_0x2d39d0){if(_0x4728b0[_0x4f1f('0x66')]['id']){delete _0x4728b0['body']['id'];}return db[_0x4f1f('0x4d')][_0x4f1f('0x65')]({'where':{'id':_0x4728b0['params']['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0x2d39d0,null))['then'](function(_0x45bb59){if(_0x45bb59){_0x4728b0['body'][_0x4f1f('0x6c')]=_0x45bb59['id'];return db['Disposition']['create'](_0x4728b0[_0x4f1f('0x66')]);}})[_0x4f1f('0x26')](respondWithResult(_0x2d39d0,null))[_0x4f1f('0x1a')](handleError(_0x2d39d0,null));};exports[_0x4f1f('0x6d')]=function(_0x22399c,_0x1686c4){var _0x218b25={'raw':![],'where':{}};var _0x7fcbb2={};var _0x357e9a={'count':0x0,'rows':[]};return db[_0x4f1f('0x4d')][_0x4f1f('0x6e')]({'where':{'id':_0x22399c[_0x4f1f('0x69')]['id']}})['then'](handleEntityNotFound(_0x1686c4,null))['then'](function(_0x2db8ec){if(_0x2db8ec){_0x7fcbb2[_0x4f1f('0x53')]=_[_0x4f1f('0x63')](db['Disposition'][_0x4f1f('0x4e')]);_0x7fcbb2[_0x4f1f('0x51')]=_[_0x4f1f('0x63')](_0x22399c[_0x4f1f('0x51')]);_0x7fcbb2[_0x4f1f('0x5b')]=_['intersection'](_0x7fcbb2[_0x4f1f('0x53')],_0x7fcbb2[_0x4f1f('0x51')]);_0x218b25[_0x4f1f('0x56')]=_[_0x4f1f('0x52')](_0x7fcbb2[_0x4f1f('0x53')],qs['fields'](_0x22399c['query'][_0x4f1f('0x54')]));_0x218b25[_0x4f1f('0x56')]=_0x218b25[_0x4f1f('0x56')][_0x4f1f('0x55')]?_0x218b25[_0x4f1f('0x56')]:_0x7fcbb2[_0x4f1f('0x53')];if(!_0x22399c['query'][_0x4f1f('0x6f')](_0x4f1f('0x57'))){_0x218b25['limit']=qs[_0x4f1f('0x20')](_0x22399c['query'][_0x4f1f('0x20')]);_0x218b25[_0x4f1f('0x1f')]=qs[_0x4f1f('0x1f')](_0x22399c[_0x4f1f('0x51')][_0x4f1f('0x1f')]);}_0x218b25[_0x4f1f('0x58')]=qs['sort'](_0x22399c[_0x4f1f('0x51')][_0x4f1f('0x59')]);_0x218b25[_0x4f1f('0x5a')]=qs[_0x4f1f('0x5b')](_[_0x4f1f('0x5c')](_0x22399c[_0x4f1f('0x51')],_0x7fcbb2[_0x4f1f('0x5b')]));_0x218b25[_0x4f1f('0x5a')][_0x4f1f('0x6c')]=_0x2db8ec['id'];if(_0x22399c[_0x4f1f('0x51')][_0x4f1f('0x5d')]){_0x218b25['where']=_[_0x4f1f('0x70')](_0x218b25[_0x4f1f('0x5a')],{'$or':_[_0x4f1f('0x4c')](_0x218b25['attributes'],function(_0x2b088c){var _0x4b9d99={};_0x4b9d99[_0x2b088c]={'$like':'%'+_0x22399c[_0x4f1f('0x51')][_0x4f1f('0x5d')]+'%'};return _0x4b9d99;})});}_0x218b25=_['merge']({},_0x218b25,_0x22399c[_0x4f1f('0x64')]);return db[_0x4f1f('0x71')][_0x4f1f('0x22')]({'where':_0x218b25[_0x4f1f('0x5a')]})['then'](function(_0x12a650){_0x357e9a[_0x4f1f('0x22')]=_0x12a650;if(_0x22399c[_0x4f1f('0x51')]['includeAll']){_0x218b25[_0x4f1f('0x5f')]=[{'all':!![]}];}return db[_0x4f1f('0x71')]['findAll'](_0x218b25);})[_0x4f1f('0x26')](function(_0x13f405){_0x357e9a[_0x4f1f('0x61')]=_0x13f405;return _0x357e9a;});}})[_0x4f1f('0x26')](respondWithFilteredResult(_0x1686c4,_0x218b25))[_0x4f1f('0x1a')](handleError(_0x1686c4,null));};exports[_0x4f1f('0x72')]=function(_0x4dfc04,_0xa49652){return db[_0x4f1f('0x4d')][_0x4f1f('0x65')]({'where':{'id':_0x4dfc04[_0x4f1f('0x69')]['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0xa49652,null))[_0x4f1f('0x26')](function(_0x942963){if(_0x942963){return _0x942963['removeDispositions'](_0x4dfc04[_0x4f1f('0x51')][_0x4f1f('0x73')]);}})[_0x4f1f('0x26')](respondWithStatusCode(_0xa49652,null))[_0x4f1f('0x1a')](handleError(_0xa49652,null));};exports[_0x4f1f('0x74')]=function(_0x30619d,_0x46cf08){if(_0x30619d[_0x4f1f('0x66')]['id']){delete _0x30619d['body']['id'];}return db[_0x4f1f('0x4d')][_0x4f1f('0x65')]({'where':{'id':_0x30619d['params']['id']}})['then'](handleEntityNotFound(_0x46cf08,null))[_0x4f1f('0x26')](function(_0x409b77){if(_0x409b77){_0x30619d[_0x4f1f('0x66')][_0x4f1f('0x6c')]=_0x409b77['id'];return db['CannedAnswer'][_0x4f1f('0x75')](_0x30619d[_0x4f1f('0x66')]);}})['then'](respondWithResult(_0x46cf08,null))['catch'](handleError(_0x46cf08,null));};exports['getAnswers']=function(_0x3b3d01,_0x104d01){var _0x1a04fb={'raw':![],'where':{}};var _0x52ee48={};var _0x332bbb={'count':0x0,'rows':[]};return db['MailAccount'][_0x4f1f('0x6e')]({'where':{'id':_0x3b3d01[_0x4f1f('0x69')]['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0x104d01,null))[_0x4f1f('0x26')](function(_0x4c99c3){if(_0x4c99c3){_0x52ee48['model']=_[_0x4f1f('0x63')](db[_0x4f1f('0x76')][_0x4f1f('0x4e')]);_0x52ee48[_0x4f1f('0x51')]=_[_0x4f1f('0x63')](_0x3b3d01['query']);_0x52ee48[_0x4f1f('0x5b')]=_[_0x4f1f('0x52')](_0x52ee48['model'],_0x52ee48[_0x4f1f('0x51')]);_0x1a04fb[_0x4f1f('0x56')]=_[_0x4f1f('0x52')](_0x52ee48['model'],qs[_0x4f1f('0x54')](_0x3b3d01[_0x4f1f('0x51')]['fields']));_0x1a04fb[_0x4f1f('0x56')]=_0x1a04fb[_0x4f1f('0x56')]['length']?_0x1a04fb[_0x4f1f('0x56')]:_0x52ee48[_0x4f1f('0x53')];if(!_0x3b3d01['query'][_0x4f1f('0x6f')](_0x4f1f('0x57'))){_0x1a04fb[_0x4f1f('0x20')]=qs['limit'](_0x3b3d01[_0x4f1f('0x51')][_0x4f1f('0x20')]);_0x1a04fb['offset']=qs['offset'](_0x3b3d01[_0x4f1f('0x51')][_0x4f1f('0x1f')]);}_0x1a04fb[_0x4f1f('0x58')]=qs[_0x4f1f('0x59')](_0x3b3d01[_0x4f1f('0x51')]['sort']);_0x1a04fb[_0x4f1f('0x5a')]=qs[_0x4f1f('0x5b')](_['pick'](_0x3b3d01['query'],_0x52ee48[_0x4f1f('0x5b')]));_0x1a04fb[_0x4f1f('0x5a')]['MailAccountId']=_0x4c99c3['id'];if(_0x3b3d01[_0x4f1f('0x51')][_0x4f1f('0x5d')]){_0x1a04fb[_0x4f1f('0x5a')]=_['merge'](_0x1a04fb['where'],{'$or':_[_0x4f1f('0x4c')](_0x1a04fb['attributes'],function(_0x430da1){var _0x1c3919={};_0x1c3919[_0x430da1]={'$like':'%'+_0x3b3d01['query']['filter']+'%'};return _0x1c3919;})});}_0x1a04fb=_['merge']({},_0x1a04fb,_0x3b3d01['options']);return db['CannedAnswer']['count']({'where':_0x1a04fb[_0x4f1f('0x5a')]})[_0x4f1f('0x26')](function(_0x3e135c){_0x332bbb[_0x4f1f('0x22')]=_0x3e135c;if(_0x3b3d01[_0x4f1f('0x51')][_0x4f1f('0x5e')]){_0x1a04fb[_0x4f1f('0x5f')]=[{'all':!![]}];}return db[_0x4f1f('0x76')]['findAll'](_0x1a04fb);})[_0x4f1f('0x26')](function(_0x300ef6){_0x332bbb[_0x4f1f('0x61')]=_0x300ef6;return _0x332bbb;});}})['then'](respondWithFilteredResult(_0x104d01,_0x1a04fb))['catch'](handleError(_0x104d01,null));};exports[_0x4f1f('0x77')]=function(_0x18a431,_0x1d46fc){return db[_0x4f1f('0x4d')][_0x4f1f('0x65')]({'where':{'id':_0x18a431[_0x4f1f('0x69')]['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0x1d46fc,null))[_0x4f1f('0x26')](function(_0x2de500){if(_0x2de500){return _0x2de500[_0x4f1f('0x77')](_0x18a431[_0x4f1f('0x51')][_0x4f1f('0x73')]);}})[_0x4f1f('0x26')](respondWithStatusCode(_0x1d46fc,null))[_0x4f1f('0x1a')](handleError(_0x1d46fc,null));};exports[_0x4f1f('0x75')]=function(_0x414840,_0x31ffb0){var _0x1aea5d={'name':_0x414840[_0x4f1f('0x66')][_0x4f1f('0x2c')],'key':_0x414840[_0x4f1f('0x66')][_0x4f1f('0x78')],'provider':_0x414840[_0x4f1f('0x66')]['provider']===_0x4f1f('0x68')?null:_0x414840['body'][_0x4f1f('0x67')],'email':_0x414840[_0x4f1f('0x66')][_0x4f1f('0x79')],'ListId':_0x414840['body']['ListId'],'active':!_['isNil'](_0x414840[_0x4f1f('0x66')][_0x4f1f('0x7a')])?_0x414840[_0x4f1f('0x66')][_0x4f1f('0x7a')]:!![],'description':_0x414840[_0x4f1f('0x66')][_0x4f1f('0x7b')]||null};var _0x5d8a75=getAuthenticationOptions(_0x1aea5d[_0x4f1f('0x67')],_0x414840[_0x4f1f('0x66')]);_0x1aea5d[_0x4f1f('0x45')]=_0x5d8a75[_0x4f1f('0x45')];_0x1aea5d[_0x4f1f('0x46')]=_0x5d8a75[_0x4f1f('0x46')];return db[_0x4f1f('0x4d')][_0x4f1f('0x75')](_0x1aea5d,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x4f1f('0x45')}]})[_0x4f1f('0x26')](function(_0xbfda7f){var _0x378c28=_0x414840[_0x4f1f('0x3a')][_0x4f1f('0x27')]({'plain':!![]});if(!_0x378c28)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x378c28[_0x4f1f('0x7c')]===_0x4f1f('0x3a')){var _0x1821a5=_0xbfda7f['get']({'plain':!![]});return db[_0x4f1f('0x7d')][_0x4f1f('0x65')]({'where':{'name':_0x4f1f('0x28'),'userProfileId':_0x378c28[_0x4f1f('0x7e')]},'raw':!![]})['then'](function(_0x274e2b){if(_0x274e2b&&_0x274e2b[_0x4f1f('0x7f')]===0x0){return db[_0x4f1f('0x29')]['create']({'name':_0x1821a5[_0x4f1f('0x2c')],'resourceId':_0x1821a5['id'],'type':_0x274e2b[_0x4f1f('0x2c')],'sectionId':_0x274e2b['id']},{})[_0x4f1f('0x26')](function(){return _0xbfda7f;});}else{return _0xbfda7f;}})[_0x4f1f('0x1a')](function(_0x34bf54){logger[_0x4f1f('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34bf54);throw _0x34bf54;});}return _0xbfda7f;})[_0x4f1f('0x26')](respondWithResult(_0x31ffb0,0xc9))[_0x4f1f('0x1a')](handleError(_0x31ffb0,null));};exports['getImap']=function(_0x3ece29,_0xeb1fb7){return db[_0x4f1f('0x4d')][_0x4f1f('0x6e')]({'where':{'id':_0x3ece29[_0x4f1f('0x69')]['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0xeb1fb7,null))[_0x4f1f('0x26')](function(_0x203e90){if(_0x203e90){return _0x203e90[_0x4f1f('0x80')]();}return null;})['then'](respondWithResult(_0xeb1fb7,null))['catch'](handleError(_0xeb1fb7,null));};exports['addImap']=function(_0x2b11be,_0x4ca8ff){if(_0x2b11be[_0x4f1f('0x66')]['id']){delete _0x2b11be[_0x4f1f('0x66')]['id'];}return db[_0x4f1f('0x4d')][_0x4f1f('0x65')]({'where':{'id':_0x2b11be[_0x4f1f('0x69')]['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0x4ca8ff,null))['then'](function(_0x3a3691){if(_0x3a3691){_0x2b11be['body'][_0x4f1f('0x6c')]=_0x3a3691['id'];return db[_0x4f1f('0x48')]['create'](_0x2b11be[_0x4f1f('0x66')]);}})['then'](respondWithResult(_0x4ca8ff,null))[_0x4f1f('0x1a')](handleError(_0x4ca8ff,null));};exports[_0x4f1f('0x81')]=function(_0x29911f,_0x40b383){return db[_0x4f1f('0x4d')]['findOne']({'where':{'id':_0x29911f['params']['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0x40b383,null))[_0x4f1f('0x26')](function(_0x21a1f2){if(_0x21a1f2){return _0x21a1f2['setImap'](null);}return null;})[_0x4f1f('0x26')](respondWithStatusCode(_0x40b383,null))[_0x4f1f('0x1a')](handleError(_0x40b383,null));};exports[_0x4f1f('0x82')]=function(_0x44569a,_0x3cd2c9){return db[_0x4f1f('0x4d')]['findOne']({'where':{'id':_0x44569a[_0x4f1f('0x69')]['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0x3cd2c9,null))[_0x4f1f('0x26')](function(_0x2ad18c){if(_0x2ad18c){return _0x2ad18c[_0x4f1f('0x82')]();}return null;})[_0x4f1f('0x26')](respondWithResult(_0x3cd2c9,null))[_0x4f1f('0x1a')](handleError(_0x3cd2c9,null));};exports[_0x4f1f('0x83')]=function(_0x2426ff,_0xee250d){if(_0x2426ff[_0x4f1f('0x66')]['id']){delete _0x2426ff[_0x4f1f('0x66')]['id'];}return db[_0x4f1f('0x4d')][_0x4f1f('0x65')]({'where':{'id':_0x2426ff[_0x4f1f('0x69')]['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0xee250d,null))['then'](function(_0x19407a){if(_0x19407a){_0x2426ff[_0x4f1f('0x66')]['MailAccountId']=_0x19407a['id'];return db['MailServerOut'][_0x4f1f('0x75')](_0x2426ff[_0x4f1f('0x66')]);}})[_0x4f1f('0x26')](respondWithResult(_0xee250d,null))[_0x4f1f('0x1a')](handleError(_0xee250d,null));};exports['removeSmtp']=function(_0x269d07,_0x2b49cf){return db[_0x4f1f('0x4d')][_0x4f1f('0x6e')]({'where':{'id':_0x269d07[_0x4f1f('0x69')]['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0x2b49cf,null))['then'](function(_0x8a2bb5){if(_0x8a2bb5){return _0x8a2bb5['setSmtp'](null);}return null;})[_0x4f1f('0x26')](respondWithStatusCode(_0x2b49cf,null))['catch'](handleError(_0x2b49cf,null));};exports[_0x4f1f('0x84')]=function(_0x41dabe,_0x4db383){return db[_0x4f1f('0x85')][_0x4f1f('0x65')]({'where':{'id':_0x41dabe['params']['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0x4db383,null))[_0x4f1f('0x26')](function(_0x5d7a63){if(_0x5d7a63){return _0x5d7a63['addInteraction'](_0x41dabe[_0x4f1f('0x66')][_0x4f1f('0x73')],_[_0x4f1f('0x86')](_0x41dabe['body'],[_0x4f1f('0x73'),'id'])||{});}})['then'](respondWithResult(_0x4db383,null))['catch'](handleError(_0x4db383,null));};exports[_0x4f1f('0x87')]=function(_0x222801,_0x5a9fdb){var _0x1dd8f6={'raw':![],'where':{}};var _0x40f805={};var _0x445605={'count':0x0,'rows':[]};return db[_0x4f1f('0x4d')][_0x4f1f('0x6e')]({'where':{'id':_0x222801[_0x4f1f('0x69')]['id']}})['then'](handleEntityNotFound(_0x5a9fdb,null))[_0x4f1f('0x26')](function(_0x46f3d3){if(_0x46f3d3){_0x40f805[_0x4f1f('0x53')]=_[_0x4f1f('0x63')](db[_0x4f1f('0x85')][_0x4f1f('0x4e')]);_0x40f805[_0x4f1f('0x51')]=_[_0x4f1f('0x63')](_0x222801[_0x4f1f('0x51')]);_0x40f805[_0x4f1f('0x5b')]=_[_0x4f1f('0x52')](_0x40f805[_0x4f1f('0x53')],_0x40f805['query']);_0x1dd8f6[_0x4f1f('0x56')]=_['intersection'](_0x40f805['model'],qs['fields'](_0x222801[_0x4f1f('0x51')][_0x4f1f('0x54')]));_0x1dd8f6['attributes']=_0x1dd8f6[_0x4f1f('0x56')][_0x4f1f('0x55')]?_0x1dd8f6['attributes']:_0x40f805['model'];if(!_0x222801[_0x4f1f('0x51')]['hasOwnProperty'](_0x4f1f('0x57'))){_0x1dd8f6[_0x4f1f('0x20')]=qs['limit'](_0x222801[_0x4f1f('0x51')][_0x4f1f('0x20')]);_0x1dd8f6[_0x4f1f('0x1f')]=qs[_0x4f1f('0x1f')](_0x222801['query'][_0x4f1f('0x1f')]);}_0x1dd8f6[_0x4f1f('0x58')]=qs['sort'](_0x222801[_0x4f1f('0x51')][_0x4f1f('0x59')]);_0x1dd8f6[_0x4f1f('0x5a')]=qs[_0x4f1f('0x5b')](_[_0x4f1f('0x5c')](_0x222801[_0x4f1f('0x51')],_0x40f805[_0x4f1f('0x5b')]));_0x1dd8f6[_0x4f1f('0x5a')][_0x4f1f('0x6c')]=_0x46f3d3['id'];if(_0x222801['query'][_0x4f1f('0x5d')]){_0x1dd8f6['where']=_[_0x4f1f('0x70')](_0x1dd8f6[_0x4f1f('0x5a')],{'$or':_[_0x4f1f('0x4c')](_0x1dd8f6[_0x4f1f('0x56')],function(_0x351210){var _0x3addeb={};_0x3addeb[_0x351210]={'$like':'%'+_0x222801['query'][_0x4f1f('0x5d')]+'%'};return _0x3addeb;})});}_0x1dd8f6=_[_0x4f1f('0x70')]({},_0x1dd8f6,_0x222801[_0x4f1f('0x64')]);return db['MailInteraction'][_0x4f1f('0x22')]({'where':_0x1dd8f6[_0x4f1f('0x5a')]})['then'](function(_0x58e78c){_0x445605[_0x4f1f('0x22')]=_0x58e78c;if(_0x222801[_0x4f1f('0x51')][_0x4f1f('0x5e')]){_0x1dd8f6[_0x4f1f('0x5f')]=[{'model':db['CmContact'],'as':_0x4f1f('0x88'),'required':![]},{'model':db[_0x4f1f('0x89')],'as':_0x4f1f('0x8a'),'attributes':[_0x4f1f('0x2c'),_0x4f1f('0x8b'),_0x4f1f('0x8c')],'required':![]},{'model':db[_0x4f1f('0x8d')],'as':'Tags','attributes':['id','name','color'],'where':_0x222801['query']['tag']?{'id':_0x222801[_0x4f1f('0x51')][_0x4f1f('0x8e')]}:undefined,'required':_0x222801[_0x4f1f('0x51')][_0x4f1f('0x8e')]?!![]:![]}];}return db[_0x4f1f('0x85')][_0x4f1f('0x60')](_0x1dd8f6);})[_0x4f1f('0x26')](function(_0x4f0e13){_0x445605[_0x4f1f('0x61')]=_0x4f0e13;return _0x445605;});}})[_0x4f1f('0x26')](respondWithFilteredResult(_0x5a9fdb,_0x1dd8f6))[_0x4f1f('0x1a')](handleError(_0x5a9fdb,null));};exports[_0x4f1f('0x8f')]=function addApplications(_0x1bcdc5,_0x353401){var _0x9296be=_0x1bcdc5[_0x4f1f('0x69')]['id'];var _0x4c8f14=_0x1bcdc5[_0x4f1f('0x66')];var _0x13afe1=0xc8;var _0x7676ee=null;return db['sequelize'][_0x4f1f('0x90')]({'isolationLevel':db[_0x4f1f('0x91')][_0x4f1f('0x92')]['ISOLATION_LEVELS'][_0x4f1f('0x93')]},function(_0x1e1ef6){return db[_0x4f1f('0x4d')][_0x4f1f('0x6e')]({'where':{'id':_0x9296be},'transaction':_0x1e1ef6})[_0x4f1f('0x26')](function(_0x2276d8){if(_0x2276d8){return db[_0x4f1f('0x94')]['destroy']({'where':{'MailAccountId':_0x9296be},'transaction':_0x1e1ef6})[_0x4f1f('0x26')](function(){var _0xdb9e1a=_[_0x4f1f('0x4c')](_0x4c8f14,function(_0x31bc80){_0x31bc80[_0x4f1f('0x6c')]=_0x9296be;return _0x31bc80;});return db[_0x4f1f('0x94')][_0x4f1f('0x95')](_0xdb9e1a,{'transaction':_0x1e1ef6});});}else{_0x13afe1=0x194;_0x7676ee=[];}});})['then'](function(){if(_0x13afe1!==0x194){return db['MailApplication'][_0x4f1f('0x96')]({'where':{'MailAccountId':_0x9296be},'order':_0x4f1f('0x97')})[_0x4f1f('0x26')](function(_0x4ae9f1){_0x7676ee=_0x4ae9f1;});}})[_0x4f1f('0x1a')](function(_0x1e447c){_0x13afe1=0x1f4;logger[_0x4f1f('0x16')](_0x1e447c['stack']);if(_0x1e447c[_0x4f1f('0x2c')]){delete _0x1e447c[_0x4f1f('0x2c')];}_0x7676ee=_0x1e447c;})[_0x4f1f('0x98')](function(){if(_0x7676ee===null){_0x353401[_0x4f1f('0x1b')](_0x13afe1);}else{if(_0x13afe1===0x1f4){_0x353401[_0x4f1f('0x1c')](_0x13afe1)[_0x4f1f('0x2d')](_0x7676ee);}else{_0x353401[_0x4f1f('0x1c')](_0x13afe1)[_0x4f1f('0x1e')](_0x7676ee);}}});};exports[_0x4f1f('0x99')]=function(_0xc80613,_0x42d803){var _0x201d21={};var _0x5d44d9={};var _0x587ee2;var _0x21d1ad;return db[_0x4f1f('0x4d')][_0x4f1f('0x6e')]({'where':{'id':_0xc80613[_0x4f1f('0x69')]['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0x42d803,null))[_0x4f1f('0x26')](function(_0x27bdc8){if(_0x27bdc8){_0x587ee2=_0x27bdc8;_0x5d44d9['model']=_[_0x4f1f('0x63')](db['MailApplication'][_0x4f1f('0x4e')]);_0x5d44d9[_0x4f1f('0x51')]=_[_0x4f1f('0x63')](_0xc80613['query']);_0x5d44d9[_0x4f1f('0x5b')]=_['intersection'](_0x5d44d9[_0x4f1f('0x53')],_0x5d44d9[_0x4f1f('0x51')]);_0x201d21['attributes']=_[_0x4f1f('0x52')](_0x5d44d9[_0x4f1f('0x53')],qs[_0x4f1f('0x54')](_0xc80613['query'][_0x4f1f('0x54')]));_0x201d21[_0x4f1f('0x56')]=_0x201d21[_0x4f1f('0x56')][_0x4f1f('0x55')]?_0x201d21['attributes']:_0x5d44d9[_0x4f1f('0x53')];_0x201d21[_0x4f1f('0x58')]=qs['sort'](_0xc80613[_0x4f1f('0x51')][_0x4f1f('0x59')]);_0x201d21[_0x4f1f('0x5a')]=qs[_0x4f1f('0x5b')](_['pick'](_0xc80613[_0x4f1f('0x51')],_0x5d44d9['filters']));if(_0xc80613[_0x4f1f('0x51')][_0x4f1f('0x5d')]){_0x201d21[_0x4f1f('0x5a')]=_[_0x4f1f('0x70')](_0x201d21[_0x4f1f('0x5a')],{'$or':_[_0x4f1f('0x4c')](_0x201d21[_0x4f1f('0x56')],function(_0x39ab0a){var _0x501f2e={};_0x501f2e[_0x39ab0a]={'$like':'%'+_0xc80613[_0x4f1f('0x51')][_0x4f1f('0x5d')]+'%'};return _0x501f2e;})});}_0x201d21=_[_0x4f1f('0x70')]({},_0x201d21,_0xc80613[_0x4f1f('0x64')]);return _0x587ee2[_0x4f1f('0x99')](_0x201d21);}})[_0x4f1f('0x26')](function(_0x4abef1){if(_0x4abef1){_0x21d1ad=_0x4abef1[_0x4f1f('0x55')];if(!_0xc80613['query'][_0x4f1f('0x6f')](_0x4f1f('0x57'))){_0x201d21['limit']=qs['limit'](_0xc80613[_0x4f1f('0x51')][_0x4f1f('0x20')]);_0x201d21['offset']=qs[_0x4f1f('0x1f')](_0xc80613[_0x4f1f('0x51')][_0x4f1f('0x1f')]);}return _0x587ee2[_0x4f1f('0x99')](_0x201d21);}})[_0x4f1f('0x26')](function(_0x46c3d1){if(_0x46c3d1){return _0x46c3d1?{'count':_0x21d1ad,'rows':_0x46c3d1}:null;}})[_0x4f1f('0x26')](respondWithResult(_0x42d803,null))[_0x4f1f('0x1a')](handleError(_0x42d803,null));};exports[_0x4f1f('0x9a')]=function(_0x8a6d66,_0x2c77a7){var _0xbe4cfe={'raw':!![],'where':{}};var _0x2431c3={};var _0xd7b708={'count':0x0,'rows':[]};return db['MailAccount'][_0x4f1f('0x6e')]({'where':{'id':_0x8a6d66[_0x4f1f('0x69')]['id']}})['then'](handleEntityNotFound(_0x2c77a7,null))[_0x4f1f('0x26')](function(_0x43ea9e){if(_0x43ea9e){_0x2431c3[_0x4f1f('0x53')]=_[_0x4f1f('0x63')](db[_0x4f1f('0x9b')]['rawAttributes']);_0x2431c3['query']=_[_0x4f1f('0x63')](_0x8a6d66[_0x4f1f('0x51')]);_0x2431c3['filters']=_[_0x4f1f('0x52')](_0x2431c3[_0x4f1f('0x53')],_0x2431c3[_0x4f1f('0x51')]);_0xbe4cfe[_0x4f1f('0x56')]=_[_0x4f1f('0x52')](_0x2431c3['model'],qs[_0x4f1f('0x54')](_0x8a6d66['query'][_0x4f1f('0x54')]));_0xbe4cfe[_0x4f1f('0x56')]=_0xbe4cfe[_0x4f1f('0x56')][_0x4f1f('0x55')]?_0xbe4cfe[_0x4f1f('0x56')]:_0x2431c3[_0x4f1f('0x53')];if(!_0x8a6d66[_0x4f1f('0x51')]['hasOwnProperty']('nolimit')){_0xbe4cfe[_0x4f1f('0x20')]=qs[_0x4f1f('0x20')](_0x8a6d66[_0x4f1f('0x51')]['limit']);_0xbe4cfe[_0x4f1f('0x1f')]=qs[_0x4f1f('0x1f')](_0x8a6d66[_0x4f1f('0x51')][_0x4f1f('0x1f')]);}_0xbe4cfe['order']=qs[_0x4f1f('0x59')](_0x8a6d66[_0x4f1f('0x51')][_0x4f1f('0x59')]);_0xbe4cfe['where']=qs['filters'](_[_0x4f1f('0x5c')](_0x8a6d66['query'],_0x2431c3['filters']));_0xbe4cfe['where'][_0x4f1f('0x6c')]=_0x43ea9e['id'];if(_0x8a6d66[_0x4f1f('0x51')][_0x4f1f('0x5d')]){_0xbe4cfe[_0x4f1f('0x5a')]=_[_0x4f1f('0x70')](_0xbe4cfe[_0x4f1f('0x5a')],{'$or':_[_0x4f1f('0x4c')](_0xbe4cfe['attributes'],function(_0x30b80f){var _0x1c963b={};_0x1c963b[_0x30b80f]={'$like':'%'+_0x8a6d66[_0x4f1f('0x51')][_0x4f1f('0x5d')]+'%'};return _0x1c963b;})});}if(_0x8a6d66[_0x4f1f('0x51')][_0x4f1f('0x9c')]){var _0x2dba36=_0x8a6d66[_0x4f1f('0x51')][_0x4f1f('0x9c')][_0x4f1f('0x9d')](',');var _0x20dbe8={};_0x20dbe8[_0x2dba36[0x0]]={'$gte':moment(_0x2dba36[0x1])[_0x4f1f('0x9e')](_0x4f1f('0x9f'))};_0xbe4cfe[_0x4f1f('0x5a')]=_[_0x4f1f('0x70')](_0xbe4cfe['where'],_0x20dbe8);}_0xbe4cfe=_[_0x4f1f('0x70')]({},_0xbe4cfe,_0x8a6d66[_0x4f1f('0x64')]);return db[_0x4f1f('0x9b')][_0x4f1f('0x22')]({'where':_0xbe4cfe[_0x4f1f('0x5a')]})[_0x4f1f('0x26')](function(_0x1adec6){_0xd7b708[_0x4f1f('0x22')]=_0x1adec6;if(_0x8a6d66[_0x4f1f('0x51')]['includeAll']){_0xbe4cfe['include']=[{'all':!![]}];}return db['MailMessage']['findAll'](_0xbe4cfe);})[_0x4f1f('0x26')](function(_0x3cb912){if(_0x8a6d66['query']['inlineCss']===_0x4f1f('0xa0')){for(var _0x178cfc=0x0;_0x178cfc<_0x3cb912[_0x4f1f('0x55')];_0x178cfc++){_0x3cb912[_0x178cfc][_0x4f1f('0x66')]=juice(_0x3cb912[_0x178cfc][_0x4f1f('0x66')]);}}_0xd7b708['rows']=_0x3cb912;return _0xd7b708;});}})[_0x4f1f('0x26')](respondWithFilteredResult(_0x2c77a7,_0xbe4cfe))[_0x4f1f('0x1a')](handleError(_0x2c77a7,null));};exports[_0x4f1f('0x2d')]=function(_0x20683d,_0x4543a9){var _0x543b1a,_0x57cf67={},_0x44c0cc;if(_0x20683d[_0x4f1f('0x66')]['to']){_0x44c0cc=_0x20683d[_0x4f1f('0x66')]['to'][_0x4f1f('0x9d')](',')[0x0];}return db[_0x4f1f('0x4d')][_0x4f1f('0x65')]({'where':{'id':_0x20683d[_0x4f1f('0x69')]['id']},'include':[{'model':db[_0x4f1f('0xa1')],'as':_0x4f1f('0xa2'),'include':[{'model':db['CmContact'],'as':_0x4f1f('0xa3'),'where':{'email':_0x44c0cc},'limit':0x1,'order':[[_0x4f1f('0xa4'),_0x4f1f('0xa5')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4f1f('0xa6')],'as':_0x4f1f('0xa6'),'raw':!![]}]}]})[_0x4f1f('0x26')](handleEntityNotFound(_0x4543a9,null))[_0x4f1f('0x26')](function(_0x55a056){if(!_0x55a056)return;_0x543b1a=_0x55a056;if(!_0x55a056['Smtp'])throw new Error(_0x4f1f('0xa7'));if(_['isNil'](_0x20683d['body'][_0x4f1f('0xa8')])){_0x20683d[_0x4f1f('0x66')][_0x4f1f('0xa8')]=util['format']('%s\x20<%s>',_0x55a056[_0x4f1f('0x2c')],_0x55a056[_0x4f1f('0x79')]||_0x55a056[_0x4f1f('0x46')][_0x4f1f('0x3a')]);}if(_0x20683d[_0x4f1f('0x66')]['attachments']&&_0x20683d[_0x4f1f('0x66')][_0x4f1f('0xa9')][_0x4f1f('0x55')]){for(var _0x4e6c05=0x0;_0x4e6c05<_0x20683d['body'][_0x4f1f('0xa9')]['length'];_0x4e6c05+=0x1){_0x20683d['body'][_0x4f1f('0xa9')][_0x4e6c05]={'filename':_0x20683d[_0x4f1f('0x66')][_0x4f1f('0xa9')][_0x4e6c05][_0x4f1f('0x2c')],'path':path[_0x4f1f('0xaa')](config[_0x4f1f('0xab')],_0x4f1f('0xac'),_0x20683d[_0x4f1f('0x66')][_0x4f1f('0xa9')][_0x4e6c05]['basename'])};}}var _0x2a55c5=_0x55a056[_0x4f1f('0xad')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x2a55c5,'message':_0x20683d['body']});})[_0x4f1f('0x26')](function(_0x415a1b){if(!_0x415a1b)return;_0x57cf67=_0x415a1b;if(!_0x543b1a[_0x4f1f('0xa2')])throw new Error(_0x4f1f('0xae'));if(_0x543b1a[_0x4f1f('0xa2')]['Contacts'][_0x4f1f('0x55')])return _0x543b1a[_0x4f1f('0xa2')]['Contacts'][0x0];return db[_0x4f1f('0xaf')]['create'](_['defaults'](_0x20683d[_0x4f1f('0x66')],{'firstName':_0x20683d[_0x4f1f('0x66')]['to'],'email':_0x20683d[_0x4f1f('0x66')]['to'],'phone':_0x20683d[_0x4f1f('0x66')]['to'],'ListId':_0x543b1a[_0x4f1f('0xb0')]}));})[_0x4f1f('0x26')](function(_0xcfdf4b){if(!_0xcfdf4b)return;var _0x47214e={'UserId':_0x20683d[_0x4f1f('0x3a')]['id'],'ContactId':_0xcfdf4b['id'],'MailAccountId':_0x543b1a['id'],'inReplyTo':_0x57cf67[_0x4f1f('0xb1')],'to':_0x20683d['body'][_0x4f1f('0xa8')],'cc':_0x20683d['body']['cc'],'subject':_0x20683d[_0x4f1f('0x66')][_0x4f1f('0xb2')],'attach':_0x20683d['body'][_0x4f1f('0xb3')],'firstMsgDirection':_0x4f1f('0xb4'),'lastMsgAt':moment()['format'](_0x4f1f('0x9f')),'lastMsgDirection':_0x4f1f('0xb4'),'Messages':[_[_0x4f1f('0x70')](_0x20683d[_0x4f1f('0x66')],{'messageId':_0x57cf67[_0x4f1f('0xb1')],'sentAt':moment()['format'](_0x4f1f('0x9f')),'read':!![],'MailAccountId':_0x543b1a['id'],'UserId':_0x20683d[_0x4f1f('0x3a')]['id'],'ContactId':_0xcfdf4b['id']})]};if(_0x20683d[_0x4f1f('0x66')]['Interaction']){_0x47214e=_[_0x4f1f('0x70')](_0x47214e,_0x20683d['body']['Interaction']);}return db[_0x4f1f('0x85')][_0x4f1f('0x75')](_0x47214e,{'include':[{'model':db['MailMessage'],'as':_0x4f1f('0xb5')}]});})['then'](respondWithResult(_0x4543a9,null))[_0x4f1f('0x1a')](handleError(_0x4543a9,null));};exports['verifySmtp']=function(_0x5a0bf1,_0x2c96ab){return db[_0x4f1f('0x4d')][_0x4f1f('0x65')]({'where':{'id':_0x5a0bf1['params']['id']},'include':[{'model':db[_0x4f1f('0x49')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4f1f('0xa6')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x2c96ab,null))['then'](function(_0x538409){if(!_0x538409[_0x4f1f('0x46')])return;var _0x1a1033=_0x538409[_0x4f1f('0xad')]();return respondWithRpcPromise(_0x4f1f('0xb6'),_0x4f1f('0xb7'),{'account':_0x1a1033});})[_0x4f1f('0x26')](respondWithResult(_0x2c96ab,null))[_0x4f1f('0x1a')](handleError(_0x2c96ab,null));};exports['destroy']=function(_0x223e28,_0x286552){return db[_0x4f1f('0x4d')][_0x4f1f('0x65')]({'where':{'id':_0x223e28['params']['id']}})['then'](handleEntityNotFound(_0x286552,null))[_0x4f1f('0x26')](function(_0x3ca9a6){if(_0x3ca9a6&&_0x3ca9a6['service']){throw new db['Sequelize']['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x3ca9a6;})[_0x4f1f('0x26')](removeEntity(_0x286552,null))[_0x4f1f('0x1a')](handleError(_0x286552,null));};exports[_0x4f1f('0xb8')]=function(_0x8011ed,_0x345a5e){return db[_0x4f1f('0x4d')][_0x4f1f('0x65')]({'where':{'id':_0x8011ed[_0x4f1f('0x69')]['id']}})['then'](handleEntityNotFound(_0x345a5e,null))[_0x4f1f('0x26')](function(_0x2205f0){if(_0x2205f0){return _0x2205f0[_0x4f1f('0xb8')](_0x8011ed[_0x4f1f('0x66')][_0x4f1f('0x73')],_[_0x4f1f('0x86')](_0x8011ed[_0x4f1f('0x66')],[_0x4f1f('0x73'),'id'])||{})[_0x4f1f('0xb9')](function(_0x42651b){for(var _0x4c6b75=0x0;_0x4c6b75<_0x8011ed[_0x4f1f('0x66')][_0x4f1f('0x73')][_0x4f1f('0x55')];_0x4c6b75+=0x1){socket['emit'](_0x4f1f('0xba'),{'UserId':Number(_0x8011ed[_0x4f1f('0x66')][_0x4f1f('0x73')][_0x4c6b75]),'MailAccountId':Number(_0x8011ed[_0x4f1f('0x69')]['id'])});}return _0x42651b;});}})[_0x4f1f('0x26')](respondWithResult(_0x345a5e,null))['catch'](handleError(_0x345a5e,null));};exports[_0x4f1f('0xbb')]=function(_0x4d1545,_0x52e72c){return db['MailAccount'][_0x4f1f('0x65')]({'where':{'id':_0x4d1545['params']['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0x52e72c,null))[_0x4f1f('0x26')](function(_0x398239){if(_0x398239){return _0x398239[_0x4f1f('0xbb')](_0x4d1545['query']['ids'])[_0x4f1f('0x26')](function(){if(_[_0x4f1f('0xbc')](_0x4d1545[_0x4f1f('0x51')][_0x4f1f('0x73')])){for(var _0x3e8876=0x0;_0x3e8876<_0x4d1545[_0x4f1f('0x51')][_0x4f1f('0x73')][_0x4f1f('0x55')];_0x3e8876+=0x1){socket[_0x4f1f('0xbd')](_0x4f1f('0xbe'),{'UserId':Number(_0x4d1545['query'][_0x4f1f('0x73')][_0x3e8876]),'MailAccountId':Number(_0x4d1545[_0x4f1f('0x69')]['id'])});}}else{socket[_0x4f1f('0xbd')](_0x4f1f('0xbe'),{'UserId':Number(_0x4d1545[_0x4f1f('0x51')]['ids']),'MailAccountId':Number(_0x4d1545[_0x4f1f('0x69')]['id'])});}});}})[_0x4f1f('0x26')](respondWithStatusCode(_0x52e72c,null))['catch'](handleError(_0x52e72c,null));};exports['getAgents']=function(_0x31b7ca,_0x768dc7){var _0xc6e4e7={};var _0x26c8f9={};var _0x1d0a35;var _0x1fda30;return db[_0x4f1f('0x4d')][_0x4f1f('0x6e')]({'where':{'id':_0x31b7ca[_0x4f1f('0x69')]['id']}})[_0x4f1f('0x26')](handleEntityNotFound(_0x768dc7,null))[_0x4f1f('0x26')](function(_0xd12c22){if(_0xd12c22){_0x1d0a35=_0xd12c22;_0x26c8f9[_0x4f1f('0x53')]=_[_0x4f1f('0x63')](db[_0x4f1f('0x89')][_0x4f1f('0x4e')]);_0x26c8f9[_0x4f1f('0x51')]=_['keys'](_0x31b7ca['query']);_0x26c8f9[_0x4f1f('0x5b')]=_['intersection'](_0x26c8f9['model'],_0x26c8f9[_0x4f1f('0x51')]);_0xc6e4e7['attributes']=_[_0x4f1f('0x52')](_0x26c8f9[_0x4f1f('0x53')],qs[_0x4f1f('0x54')](_0x31b7ca[_0x4f1f('0x51')]['fields']));_0xc6e4e7[_0x4f1f('0x56')]=_0xc6e4e7[_0x4f1f('0x56')][_0x4f1f('0x55')]?_0xc6e4e7[_0x4f1f('0x56')]:_0x26c8f9['model'];_0xc6e4e7[_0x4f1f('0x58')]=qs[_0x4f1f('0x59')](_0x31b7ca[_0x4f1f('0x51')]['sort']);_0xc6e4e7['where']=qs[_0x4f1f('0x5b')](_['pick'](_0x31b7ca['query'],_0x26c8f9[_0x4f1f('0x5b')]));if(_0x31b7ca[_0x4f1f('0x51')]['filter']){_0xc6e4e7[_0x4f1f('0x5a')]=_[_0x4f1f('0x70')](_0xc6e4e7['where'],{'$or':_[_0x4f1f('0x4c')](_0xc6e4e7[_0x4f1f('0x56')],function(_0x37621f){var _0x2dc6ef={};_0x2dc6ef[_0x37621f]={'$like':'%'+_0x31b7ca['query'][_0x4f1f('0x5d')]+'%'};return _0x2dc6ef;})});}_0xc6e4e7=_['merge']({},_0xc6e4e7,_0x31b7ca[_0x4f1f('0x64')]);return _0x1d0a35[_0x4f1f('0xbf')](_0xc6e4e7);}})[_0x4f1f('0x26')](function(_0x13ee1a){if(_0x13ee1a){_0x1fda30=_0x13ee1a[_0x4f1f('0x55')];if(!_0x31b7ca[_0x4f1f('0x51')][_0x4f1f('0x6f')]('nolimit')){_0xc6e4e7['limit']=qs['limit'](_0x31b7ca['query'][_0x4f1f('0x20')]);_0xc6e4e7[_0x4f1f('0x1f')]=qs[_0x4f1f('0x1f')](_0x31b7ca['query'][_0x4f1f('0x1f')]);}return _0x1d0a35[_0x4f1f('0xbf')](_0xc6e4e7);}})[_0x4f1f('0x26')](function(_0x51e210){if(_0x51e210){return _0x51e210?{'count':_0x1fda30,'rows':_0x51e210}:null;}})[_0x4f1f('0x26')](respondWithResult(_0x768dc7,null))['catch'](handleError(_0x768dc7,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index fa9d5f7..64eae68 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 _0x544f=['../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x6bf553,_0x59e37d){var _0x1e25e4=function(_0x326b61){while(--_0x326b61){_0x6bf553['push'](_0x6bf553['shift']());}};_0x1e25e4(++_0x59e37d);}(_0x544f,0x104));var _0xf544=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0x544f[_0xa60623];return _0x4a6487;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xf544('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xf544('0x1')](0x0);var events={'afterCreate':_0xf544('0x2'),'afterUpdate':_0xf544('0x3'),'afterDestroy':'remove'};function emitEvent(_0x21cfa3){return function(_0x8f64a3,_0x3f3361,_0x4d56cd){MailAccountEvents[_0xf544('0x4')](_0x21cfa3+':'+_0x8f64a3['id'],_0x8f64a3);MailAccountEvents[_0xf544('0x4')](_0x21cfa3,_0x8f64a3);_0x4d56cd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x8561=['emit','hook','../../mysqldb','MailAccount','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8561,0x1b2));var _0x1856=function(_0x41a93b,_0x2fc19d){_0x41a93b=_0x41a93b-0x0;var _0x220a7e=_0x8561[_0x41a93b];return _0x220a7e;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x1856('0x0'))['db'][_0x1856('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1856('0x2'),'afterUpdate':'update','afterDestroy':_0x1856('0x3')};function emitEvent(_0x4feb76){return function(_0x4346ea,_0x505bad,_0xe1a049){MailAccountEvents[_0x1856('0x4')](_0x4feb76+':'+_0x4346ea['id'],_0x4346ea);MailAccountEvents['emit'](_0x4feb76,_0x4346ea);_0xe1a049(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x1856('0x5')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 29c3061..c7cb782 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 _0xbfc7=['mail_accounts','custom','service','Smtp','host','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','./mailAccount.attributes','exports','MailAccount'];(function(_0x1ade09,_0x136009){var _0x536936=function(_0x1c003c){while(--_0x1c003c){_0x1ade09['push'](_0x1ade09['shift']());}};_0x536936(++_0x136009);}(_0xbfc7,0x19b));var _0x7bfc=function(_0x44de0f,_0x5bc8ed){_0x44de0f=_0x44de0f-0x0;var _0x56092d=_0xbfc7[_0x44de0f];return _0x56092d;};'use strict';var attributes=require(_0x7bfc('0x0'));module[_0x7bfc('0x1')]=function(_0x1bb1fc){return _0x1bb1fc['define'](_0x7bfc('0x2'),attributes,{'tableName':_0x7bfc('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x31a967=this;var _0x4ff317={'id':_0x31a967['id'],'tls':{'rejectUnauthorized':![]}};if(_0x31a967['provider']!==_0x7bfc('0x4')){_0x4ff317[_0x7bfc('0x5')]=_0x31a967['provider'];}else{_0x4ff317['host']=_0x31a967[_0x7bfc('0x6')][_0x7bfc('0x7')];_0x4ff317['port']=_0x31a967['Smtp']['port'];_0x4ff317['secure']=_0x31a967[_0x7bfc('0x6')][_0x7bfc('0x8')];}if(_0x31a967[_0x7bfc('0x6')][_0x7bfc('0x9')]){if(_0x31a967[_0x7bfc('0x6')][_0x7bfc('0xa')]){if(!_0x31a967['Smtp'][_0x7bfc('0xb')])throw new Error(_0x7bfc('0xc'));_0x4ff317[_0x7bfc('0xd')]={'type':_0x7bfc('0xe'),'user':_0x31a967[_0x7bfc('0x6')][_0x7bfc('0xf')],'accessToken':_0x31a967[_0x7bfc('0x6')][_0x7bfc('0xb')][_0x7bfc('0x10')]};}else{_0x4ff317[_0x7bfc('0xd')]={'user':_0x31a967[_0x7bfc('0x6')]['user'],'pass':_0x31a967[_0x7bfc('0x6')][_0x7bfc('0x11')]};}}return _0x4ff317;}}});}; \ No newline at end of file +var _0xf320=['OAuth2','user','auth','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found'];(function(_0x2845d7,_0xd09cb1){var _0x147181=function(_0x5c3b4a){while(--_0x5c3b4a){_0x2845d7['push'](_0x2845d7['shift']());}};_0x147181(++_0xd09cb1);}(_0xf320,0xcc));var _0x0f32=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xf320[_0x29b609];return _0x54c952;};'use strict';var attributes=require(_0x0f32('0x0'));module[_0x0f32('0x1')]=function(_0x5a0a8e){return _0x5a0a8e[_0x0f32('0x2')](_0x0f32('0x3'),attributes,{'tableName':_0x0f32('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2a9cde=this;var _0x566d7f={'id':_0x2a9cde['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2a9cde[_0x0f32('0x5')]!==_0x0f32('0x6')){_0x566d7f[_0x0f32('0x7')]=_0x2a9cde[_0x0f32('0x5')];}else{_0x566d7f[_0x0f32('0x8')]=_0x2a9cde[_0x0f32('0x9')][_0x0f32('0x8')];_0x566d7f[_0x0f32('0xa')]=_0x2a9cde[_0x0f32('0x9')][_0x0f32('0xa')];_0x566d7f[_0x0f32('0xb')]=_0x2a9cde[_0x0f32('0x9')][_0x0f32('0xb')];}if(_0x2a9cde['Smtp'][_0x0f32('0xc')]){if(_0x2a9cde[_0x0f32('0x9')][_0x0f32('0xd')]){if(!_0x2a9cde[_0x0f32('0x9')][_0x0f32('0xe')])throw new Error(_0x0f32('0xf'));_0x566d7f['auth']={'type':_0x0f32('0x10'),'user':_0x2a9cde[_0x0f32('0x9')][_0x0f32('0x11')],'accessToken':_0x2a9cde[_0x0f32('0x9')][_0x0f32('0xe')]['data5']};}else{_0x566d7f[_0x0f32('0x12')]={'user':_0x2a9cde['Smtp'][_0x0f32('0x11')],'pass':_0x2a9cde[_0x0f32('0x9')][_0x0f32('0x13')]};}}return _0x566d7f;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 20eaffb..246916d 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 _0x524e=['ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','model','map','catch','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','stringify','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','account','CmList','List','Contacts','DESC','MailApplication','MailServerOut','CloudProvider','get','Applications','applications','orderBy','priority','asc','autoclose','push','length','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','interaction','created','MailMessage','attachments','originTo','originCc','bcc'];(function(_0x540c49,_0x3e88d9){var _0x390f69=function(_0x4cdf60){while(--_0x4cdf60){_0x540c49['push'](_0x540c49['shift']());}};_0x390f69(++_0x3e88d9);}(_0x524e,0x15e));var _0xe524=function(_0x58770c,_0x10cec1){_0x58770c=_0x58770c-0x0;var _0x2dc542=_0x524e[_0x58770c];return _0x2dc542;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xe524('0x0'));var rs=require(_0xe524('0x1'));var Redis=require(_0xe524('0x2'));var db=require(_0xe524('0x3'))['db'];var logger=require(_0xe524('0x4'))(_0xe524('0x5'));var config=require(_0xe524('0x6'));var jayson=require(_0xe524('0x7'));var client=jayson[_0xe524('0x8')][_0xe524('0x9')]({'port':0x232c});config['redis']=_[_0xe524('0xa')](config[_0xe524('0xb')],{'host':_0xe524('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe524('0xb')]));require(_0xe524('0xd'))[_0xe524('0xe')](socket);function respondWithRpcPromise(_0x1f36e5,_0x991924,_0x4082b1){return new BPromise(function(_0x1a08e2,_0xb3eb9f){return client[_0xe524('0xf')](_0x1f36e5,_0x4082b1)[_0xe524('0x10')](function(_0x1e4459){logger[_0xe524('0x11')](_0xe524('0x12'),_0x991924,_0xe524('0x13'));logger[_0xe524('0x14')](_0xe524('0x15'),_0x991924,'request\x20sent',JSON['stringify'](_0x1e4459));if(_0x1e4459[_0xe524('0x16')]){if(_0x1e4459[_0xe524('0x16')][_0xe524('0x17')]===0x1f4){logger[_0xe524('0x16')](_0xe524('0x12'),_0x991924,_0x1e4459['error'][_0xe524('0x18')]);return _0xb3eb9f(_0x1e4459['error'][_0xe524('0x18')]);}logger[_0xe524('0x16')]('MailAccount,\x20%s,\x20%s',_0x991924,_0x1e4459[_0xe524('0x16')]['message']);return _0x1a08e2(_0x1e4459[_0xe524('0x16')]['message']);}else{logger[_0xe524('0x11')]('MailAccount,\x20%s,\x20%s',_0x991924,'request\x20sent');_0x1a08e2(_0x1e4459['result'][_0xe524('0x18')]);}})['catch'](function(_0x11b2a1){logger[_0xe524('0x16')](_0xe524('0x12'),_0x991924,_0x11b2a1);_0xb3eb9f(_0x11b2a1);});});}exports[_0xe524('0x19')]=function(_0x5d7b17){var _0x1fd93a=this;return new Promise(function(_0x3ccb3f,_0x49d104){return db[_0xe524('0x1a')][_0xe524('0x1b')]({'raw':_0x5d7b17[_0xe524('0x1c')]?_0x5d7b17[_0xe524('0x1c')][_0xe524('0x1d')]===undefined?!![]:![]:!![],'where':_0x5d7b17[_0xe524('0x1c')]?_0x5d7b17[_0xe524('0x1c')][_0xe524('0x1e')]||null:null,'attributes':_0x5d7b17[_0xe524('0x1c')]?_0x5d7b17['options'][_0xe524('0x1f')]||null:null,'limit':_0x5d7b17['options']?_0x5d7b17['options'][_0xe524('0x20')]||null:null,'include':_0x5d7b17[_0xe524('0x1c')]?_0x5d7b17[_0xe524('0x1c')][_0xe524('0x21')]?_['map'](_0x5d7b17[_0xe524('0x1c')]['include'],function(_0x17e245){return{'model':db[_0x17e245[_0xe524('0x22')]],'as':_0x17e245['as'],'attributes':_0x17e245[_0xe524('0x1f')],'include':_0x17e245[_0xe524('0x21')]?_[_0xe524('0x23')](_0x17e245[_0xe524('0x21')],function(_0x2141db){return{'model':db[_0x2141db['model']],'as':_0x2141db['as'],'attributes':_0x2141db['attributes'],'include':_0x2141db[_0xe524('0x21')]?_[_0xe524('0x23')](_0x2141db[_0xe524('0x21')],function(_0x109a96){return{'model':db[_0x109a96[_0xe524('0x22')]],'as':_0x109a96['as'],'attributes':_0x109a96['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b1ff){logger[_0xe524('0x11')](_0xe524('0x19'),_0x5d7b17);logger[_0xe524('0x14')](_0xe524('0x19'),_0x5d7b17,JSON['stringify'](_0x4b1ff));_0x3ccb3f(_0x4b1ff);})[_0xe524('0x24')](function(_0x9a7e98){logger['error']('GetMailAccount',_0x9a7e98[_0xe524('0x18')],_0x5d7b17);_0x49d104(_0x1fd93a[_0xe524('0x16')](0x1f4,_0x9a7e98['message']));});});};exports[_0xe524('0x25')]=function(_0x535354){var _0x3fec06=this;return new Promise(function(_0x54af2a,_0x315e56){return db[_0xe524('0x1a')][_0xe524('0x26')]({'raw':_0x535354['options']?_0x535354[_0xe524('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x535354[_0xe524('0x1c')]?_0x535354[_0xe524('0x1c')][_0xe524('0x1e')]||null:null,'attributes':_0x535354['options']?_0x535354[_0xe524('0x1c')][_0xe524('0x1f')]||null:null,'include':_0x535354['options']?_0x535354[_0xe524('0x1c')][_0xe524('0x21')]?_[_0xe524('0x23')](_0x535354[_0xe524('0x1c')]['include'],function(_0x415450){return{'model':db[_0x415450[_0xe524('0x22')]],'as':_0x415450['as'],'attributes':_0x415450[_0xe524('0x1f')],'include':_0x415450[_0xe524('0x21')]?_[_0xe524('0x23')](_0x415450[_0xe524('0x21')],function(_0x2741e8){return{'model':db[_0x2741e8[_0xe524('0x22')]],'as':_0x2741e8['as'],'attributes':_0x2741e8['attributes'],'include':_0x2741e8[_0xe524('0x21')]?_['map'](_0x2741e8[_0xe524('0x21')],function(_0x53eeee){return{'model':db[_0x53eeee['model']],'as':_0x53eeee['as'],'attributes':_0x53eeee[_0xe524('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c3aae){if(_0x535354[_0xe524('0x1c')][_0xe524('0x27')]===!![])_0x1c3aae[_0xe524('0x28')](_0xe524('0x29'),_0x1c3aae[_0xe524('0x2a')]());logger[_0xe524('0x11')](_0xe524('0x25'),_0x535354);logger['debug'](_0xe524('0x25'),_0x535354,JSON[_0xe524('0x2b')](_0x1c3aae));_0x54af2a(_0x1c3aae);})[_0xe524('0x24')](function(_0x3fd023){logger[_0xe524('0x16')](_0xe524('0x25'),_0x3fd023[_0xe524('0x18')],_0x535354);_0x315e56(_0x3fec06[_0xe524('0x16')](0x1f4,_0x3fd023['message']));});});};exports[_0xe524('0x2c')]=function(_0x849307){var _0x2e4a13=this;return new Promise(function(_0x59781b,_0x238673){var _0x5213ed={'body':_0x849307[_0xe524('0x2d')],'channel':_0xe524('0x2e')};var _0x43c314=_[_0xe524('0x2f')](_[_0xe524('0x30')](db[_0xe524('0x31')][_0xe524('0x32')]),['createdAt',_0xe524('0x33'),_0xe524('0x34'),_0xe524('0x35')]);var _0x376505=![];if(_0x849307[_0xe524('0x2d')]['id']){delete _0x849307[_0xe524('0x2d')]['id'];}if(_['isNil'](_0x849307[_0xe524('0x2d')][_0xe524('0x36')])){return _0x238673(_0x2e4a13[_0xe524('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xe524('0x37')](_0x849307['body']['body'])||_0x849307[_0xe524('0x2d')][_0xe524('0x2d')]===''){return _0x238673(_0x2e4a13['error'](0x1f4,_0xe524('0x38')));}if(_[_0xe524('0x37')](_0x849307[_0xe524('0x2d')][_0xe524('0x39')])){return _0x238673(_0x2e4a13['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43c314));}if(!_[_0xe524('0x3a')](_0x43c314,_0x849307[_0xe524('0x2d')]['mapKey'])){return _0x238673(_0x2e4a13[_0xe524('0x16')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43c314));}var _0x472519={};_0x472519[_0x849307[_0xe524('0x2d')][_0xe524('0x39')]]=_0x849307[_0xe524('0x2d')][_0xe524('0x36')];return db[_0xe524('0x1a')][_0xe524('0x26')]({'where':{'id':_0x849307[_0xe524('0x3b')]['id']},'include':[{'model':db[_0xe524('0x3c')],'as':_0xe524('0x3d'),'include':[{'model':db[_0xe524('0x31')],'as':_0xe524('0x3e'),'where':_0x472519,'limit':0x1,'order':[[_0xe524('0x33'),_0xe524('0x3f')]]}]},{'model':db[_0xe524('0x40')],'as':'Applications'},{'model':db[_0xe524('0x41')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xe524('0x42')}]}]})['then'](function(_0x232cf0){if(_0x232cf0&&_0x232cf0[_0xe524('0x3d')]){var _0x561107=_0x232cf0[_0xe524('0x43')]({'plain':!![]});_0x5213ed['account']=_['omit'](_0x561107,[_0xe524('0x44'),_0xe524('0x3d')]);_0x5213ed[_0xe524('0x3b')]['smtpOptions']=_0x232cf0['getSmtpOptions']();_0x5213ed['applications']=_0x561107['Applications'];_0x5213ed['list']=_0x561107['List'];_0x5213ed[_0xe524('0x45')]=_[_0xe524('0x46')](_0x5213ed['applications'],[_0xe524('0x47')],[_0xe524('0x48')]);if(_0x5213ed[_0xe524('0x3b')]&&_0x5213ed[_0xe524('0x3b')][_0xe524('0x49')]){_0x5213ed['applications'][_0xe524('0x4a')]({'id':0x0,'priority':_0x5213ed[_0xe524('0x45')][_0xe524('0x4b')]+0x1,'app':'close','appdata':_0xe524('0x49'),'interval':'*,*,*,*'});}if(_0x5213ed[_0xe524('0x3b')][_0xe524('0x44')]){delete _0x5213ed[_0xe524('0x3b')][_0xe524('0x44')];}if(_0x5213ed[_0xe524('0x3b')][_0xe524('0x3d')]){delete _0x5213ed[_0xe524('0x3b')][_0xe524('0x3d')];}if(_0x561107[_0xe524('0x3d')][_0xe524('0x3e')][_0xe524('0x4b')]){return _0x561107[_0xe524('0x3d')]['Contacts'][0x0];}var _0x4dac0f=_['defaults'](_0x849307[_0xe524('0x2d')],{'firstName':_0x849307[_0xe524('0x2d')][_0xe524('0x36')],'ListId':_0x561107[_0xe524('0x35')]});_0x4dac0f[_0x849307[_0xe524('0x2d')][_0xe524('0x39')]]=_0x849307[_0xe524('0x2d')][_0xe524('0x36')];return db[_0xe524('0x31')][_0xe524('0x4c')](_0x4dac0f);}else{throw new Error(_0xe524('0x4d'));}})['then'](function(_0x5012fc){_0x5213ed[_0xe524('0x4e')]=_0x5012fc;if(_0x5012fc){if(!_0x849307['body']['message']['messageId']){_0x849307['body'][_0xe524('0x18')][_0xe524('0x4f')]=rs[_0xe524('0x50')]()+'\x20'+_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x36')];}var _0x244f08={'ContactId':_0x5012fc['id'],'MailAccountId':_0x849307[_0xe524('0x3b')]['id'],'inReplyTo':_0x849307[_0xe524('0x2d')]['message']['messageId'],'to':_0x849307['body'][_0xe524('0x18')]['from'],'cc':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['cc'],'subject':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x51')],'attach':_0x849307['body']['message'][_0xe524('0x52')],'lastMsgAt':moment()[_0xe524('0x53')](_0xe524('0x54')),'lastMsgDirection':'in'};return db[_0xe524('0x55')][_0xe524('0x26')]({'where':{'closed':![],'MailAccountId':_0x849307[_0xe524('0x3b')]['id']},'include':[{'model':db['MailMessage'],'as':_0xe524('0x56'),'attributes':[_0xe524('0x4f')],'where':{'messageId':_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x57')]}}]})[_0xe524('0x10')](function(_0x3bd9f9){if(_0x3bd9f9){return[_0x3bd9f9,![]];}return db['MailInteraction']['create'](_0x244f08)[_0xe524('0x10')](function(_0x35cbe9){return[_0x35cbe9,!![]];});});}else{throw new Error(_0xe524('0x58'));}})[_0xe524('0x59')](function(_0x139a0a,_0x4c6869){if(_0x139a0a){_0x376505=_0x4c6869;if(!_0x4c6869){return _0x139a0a[_0xe524('0x5a')]({'inReplyTo':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x4f')],'to':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x36')],'cc':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['cc'],'subject':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['subject'],'attach':_0x139a0a[_0xe524('0x52')]?_0x139a0a[_0xe524('0x52')]:_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x52')],'substatus':null,'substatusAt':moment()['format'](_0xe524('0x54')),'lastMsgAt':moment()[_0xe524('0x53')](_0xe524('0x54')),'lastMsgDirection':'in'});}else{return _0x139a0a;}}})[_0xe524('0x10')](function(_0x387c4b){_0x5213ed[_0xe524('0x5b')]=_0x387c4b[_0xe524('0x43')]({'plain':!![]});_0x5213ed['interaction'][_0xe524('0x5c')]=_0x376505;return db[_0xe524('0x5d')][_0xe524('0x4c')]({'body':_0x849307[_0xe524('0x2d')]['body'],'MailAccountId':_0x849307[_0xe524('0x3b')]['id'],'MailInteractionId':_0x387c4b['id'],'direction':'in','ContactId':_0x5213ed['contact']['id'],'messageId':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x4f')],'from':_0x849307['body'][_0xe524('0x18')][_0xe524('0x36')],'to':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['to'],'cc':_0x849307[_0xe524('0x2d')]['message']['cc'],'subject':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x51')],'attach':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['attach'],'Attachments':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x5e')],'originTo':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x5f')],'originCc':_0x849307['body'][_0xe524('0x18')][_0xe524('0x60')],'bcc':_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x61')],'ChatWebsiteId':_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x62')]||null,'originChannel':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x63')]||_0xe524('0x64'),'ChatOfflineMessageId':_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x65')]||null},{'include':[{'model':db[_0xe524('0x66')],'as':_0xe524('0x67')}]});})[_0xe524('0x10')](function(_0x19b28a){_0x5213ed[_0xe524('0x18')]=_0x19b28a;if(_0x5213ed[_0xe524('0x5b')][_0xe524('0x68')]){return db[_0xe524('0x69')][_0xe524('0x26')]({'attributes':['id',_0xe524('0x6a')],'where':{'id':_0x5213ed[_0xe524('0x5b')][_0xe524('0x68')]}})[_0xe524('0x10')](function(_0x23425c){if(_0x23425c){_0x5213ed['applications'][_0xe524('0x6b')]({'id':0x0,'priority':0x0,'app':_0xe524('0x6c'),'appdata':_0x23425c[_0xe524('0x6a')]+','+(_0x5213ed['account'][_0xe524('0x6d')]||0xa),'interval':_0xe524('0x6e')});}return respondWithRpcPromise('Start','startRouting',_0x5213ed);});}return respondWithRpcPromise(_0xe524('0x6f'),'startRouting',_0x5213ed);})[_0xe524('0x10')](function(_0x5a6a07){_0x59781b(_0x5a6a07);})[_0xe524('0x24')](function(_0x1ed60b){_0x238673(_0x2e4a13[_0xe524('0x16')](0x1f4,_0x1ed60b[_0xe524('0x18')]));});});}; \ No newline at end of file +var _0xc2c7=['defaults','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','findAll','raw','options','where','attributes','include','map','model','ShowMailAccount','MailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','updatedAt','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','account','CmList','List','DESC','MailApplication','Smtp','CloudProvider','get','omit','Applications','applications','orderBy','asc','autoclose','push','close','Contacts','length','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','create','Contact\x20not\x20found','spread','update','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','Attachment','Attachments','User','name','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x32201f,_0x2126dc){var _0x20a1ce=function(_0x24b950){while(--_0x24b950){_0x32201f['push'](_0x32201f['shift']());}};_0x20a1ce(++_0x2126dc);}(_0xc2c7,0x134));var _0x7c2c=function(_0x2495b1,_0x111958){_0x2495b1=_0x2495b1-0x0;var _0x442222=_0xc2c7[_0x2495b1];return _0x442222;};'use strict';var _=require('lodash');var moment=require(_0x7c2c('0x0'));var BPromise=require(_0x7c2c('0x1'));var rs=require(_0x7c2c('0x2'));var Redis=require(_0x7c2c('0x3'));var db=require(_0x7c2c('0x4'))['db'];var logger=require(_0x7c2c('0x5'))(_0x7c2c('0x6'));var config=require(_0x7c2c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c2c('0x8')]({'port':0x232c});config[_0x7c2c('0x9')]=_[_0x7c2c('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c2c('0x9')]));require(_0x7c2c('0xb'))[_0x7c2c('0xc')](socket);function respondWithRpcPromise(_0x3b780b,_0x279cff,_0x57b107){return new BPromise(function(_0x3093d2,_0x307bec){return client[_0x7c2c('0xd')](_0x3b780b,_0x57b107)[_0x7c2c('0xe')](function(_0x2587ec){logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x279cff,_0x7c2c('0x11'));logger[_0x7c2c('0x12')](_0x7c2c('0x13'),_0x279cff,_0x7c2c('0x11'),JSON[_0x7c2c('0x14')](_0x2587ec));if(_0x2587ec[_0x7c2c('0x15')]){if(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x16')]===0x1f4){logger[_0x7c2c('0x15')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x2587ec['error'][_0x7c2c('0x17')]);return _0x307bec(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x17')]);}logger['error'](_0x7c2c('0x10'),_0x279cff,_0x2587ec[_0x7c2c('0x15')]['message']);return _0x3093d2(_0x2587ec[_0x7c2c('0x15')]['message']);}else{logger[_0x7c2c('0xf')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x7c2c('0x11'));_0x3093d2(_0x2587ec[_0x7c2c('0x18')][_0x7c2c('0x17')]);}})[_0x7c2c('0x19')](function(_0x17df4a){logger[_0x7c2c('0x15')](_0x7c2c('0x10'),_0x279cff,_0x17df4a);_0x307bec(_0x17df4a);});});}exports[_0x7c2c('0x1a')]=function(_0x2d356e){var _0x39c5f3=this;return new Promise(function(_0x40eaef,_0x2381b4){return db['MailAccount'][_0x7c2c('0x1b')]({'raw':_0x2d356e['options']?_0x2d356e['options'][_0x7c2c('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1e')]||null:null,'attributes':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'limit':_0x2d356e['options']?_0x2d356e[_0x7c2c('0x1d')]['limit']||null:null,'include':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x2d356e[_0x7c2c('0x1d')]['include'],function(_0x4d6ec7){return{'model':db[_0x4d6ec7[_0x7c2c('0x22')]],'as':_0x4d6ec7['as'],'attributes':_0x4d6ec7[_0x7c2c('0x1f')],'include':_0x4d6ec7[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x4d6ec7[_0x7c2c('0x20')],function(_0xa8e145){return{'model':db[_0xa8e145[_0x7c2c('0x22')]],'as':_0xa8e145['as'],'attributes':_0xa8e145['attributes'],'include':_0xa8e145[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0xa8e145[_0x7c2c('0x20')],function(_0x22d03f){return{'model':db[_0x22d03f[_0x7c2c('0x22')]],'as':_0x22d03f['as'],'attributes':_0x22d03f[_0x7c2c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0x26f472){logger[_0x7c2c('0xf')]('GetMailAccount',_0x2d356e);logger[_0x7c2c('0x12')](_0x7c2c('0x1a'),_0x2d356e,JSON[_0x7c2c('0x14')](_0x26f472));_0x40eaef(_0x26f472);})[_0x7c2c('0x19')](function(_0x53ad23){logger[_0x7c2c('0x15')](_0x7c2c('0x1a'),_0x53ad23[_0x7c2c('0x17')],_0x2d356e);_0x2381b4(_0x39c5f3[_0x7c2c('0x15')](0x1f4,_0x53ad23[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x23')]=function(_0x463ef7){var _0x57af44=this;return new Promise(function(_0x1969f4,_0x1acf75){return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'raw':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['raw']===undefined?!![]:![]:!![],'where':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['where']||null:null,'attributes':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'include':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x20')],function(_0x204968){return{'model':db[_0x204968[_0x7c2c('0x22')]],'as':_0x204968['as'],'attributes':_0x204968[_0x7c2c('0x1f')],'include':_0x204968[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x204968[_0x7c2c('0x20')],function(_0x3230a1){return{'model':db[_0x3230a1[_0x7c2c('0x22')]],'as':_0x3230a1['as'],'attributes':_0x3230a1[_0x7c2c('0x1f')],'include':_0x3230a1['include']?_['map'](_0x3230a1[_0x7c2c('0x20')],function(_0x4acc5d){return{'model':db[_0x4acc5d['model']],'as':_0x4acc5d['as'],'attributes':_0x4acc5d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0xc77f11){if(_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x26')]===!![])_0xc77f11[_0x7c2c('0x27')](_0x7c2c('0x28'),_0xc77f11[_0x7c2c('0x29')]());logger[_0x7c2c('0xf')](_0x7c2c('0x23'),_0x463ef7);logger[_0x7c2c('0x12')](_0x7c2c('0x23'),_0x463ef7,JSON['stringify'](_0xc77f11));_0x1969f4(_0xc77f11);})['catch'](function(_0x3920b6){logger[_0x7c2c('0x15')](_0x7c2c('0x23'),_0x3920b6[_0x7c2c('0x17')],_0x463ef7);_0x1acf75(_0x57af44['error'](0x1f4,_0x3920b6[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x2a')]=function(_0x93e2a8){var _0x45fddf=this;return new Promise(function(_0x18e288,_0x8b0dc9){var _0x12c9cd={'body':_0x93e2a8[_0x7c2c('0x2b')],'channel':_0x7c2c('0x2c')};var _0x4e1f79=_[_0x7c2c('0x2d')](_['keys'](db[_0x7c2c('0x2e')][_0x7c2c('0x2f')]),['createdAt',_0x7c2c('0x30'),'CompanyId',_0x7c2c('0x31')]);var _0x33b2be=![];if(_0x93e2a8[_0x7c2c('0x2b')]['id']){delete _0x93e2a8[_0x7c2c('0x2b')]['id'];}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')]['from'])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x32')));}if(_[_0x7c2c('0x33')](_0x93e2a8[_0x7c2c('0x2b')]['body'])||_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x2b')]===''){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x34')));}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}if(!_[_0x7c2c('0x36')](_0x4e1f79,_0x93e2a8[_0x7c2c('0x2b')]['mapKey'])){return _0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}var _0x51e3b7={};_0x51e3b7[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'where':{'id':_0x93e2a8[_0x7c2c('0x38')]['id']},'include':[{'model':db[_0x7c2c('0x39')],'as':_0x7c2c('0x3a'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x51e3b7,'limit':0x1,'order':[[_0x7c2c('0x30'),_0x7c2c('0x3b')]]}]},{'model':db[_0x7c2c('0x3c')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x7c2c('0x3d'),'include':[{'model':db[_0x7c2c('0x3e')],'as':_0x7c2c('0x3e')}]}]})[_0x7c2c('0xe')](function(_0x5f3de8){if(_0x5f3de8&&_0x5f3de8['List']){var _0x587667=_0x5f3de8[_0x7c2c('0x3f')]({'plain':!![]});_0x12c9cd[_0x7c2c('0x38')]=_[_0x7c2c('0x40')](_0x587667,[_0x7c2c('0x41'),_0x7c2c('0x3a')]);_0x12c9cd['account'][_0x7c2c('0x28')]=_0x5f3de8[_0x7c2c('0x29')]();_0x12c9cd['applications']=_0x587667[_0x7c2c('0x41')];_0x12c9cd['list']=_0x587667[_0x7c2c('0x3a')];_0x12c9cd[_0x7c2c('0x42')]=_[_0x7c2c('0x43')](_0x12c9cd['applications'],['priority'],[_0x7c2c('0x44')]);if(_0x12c9cd['account']&&_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x45')]){_0x12c9cd['applications'][_0x7c2c('0x46')]({'id':0x0,'priority':_0x12c9cd[_0x7c2c('0x42')]['length']+0x1,'app':_0x7c2c('0x47'),'appdata':_0x7c2c('0x45'),'interval':'*,*,*,*'});}if(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x41')]){delete _0x12c9cd[_0x7c2c('0x38')]['Applications'];}if(_0x12c9cd[_0x7c2c('0x38')]['List']){delete _0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x3a')];}if(_0x587667['List'][_0x7c2c('0x48')][_0x7c2c('0x49')]){return _0x587667[_0x7c2c('0x3a')][_0x7c2c('0x48')][0x0];}var _0x481b9e=_[_0x7c2c('0xa')](_0x93e2a8[_0x7c2c('0x2b')],{'firstName':_0x93e2a8['body'][_0x7c2c('0x37')],'ListId':_0x587667['ListId']});_0x481b9e[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x2e')]['create'](_0x481b9e);}else{throw new Error(_0x7c2c('0x4a'));}})[_0x7c2c('0xe')](function(_0x4c4661){_0x12c9cd['contact']=_0x4c4661;if(_0x4c4661){if(!_0x93e2a8['body'][_0x7c2c('0x17')]['messageId']){_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x4b')]=rs[_0x7c2c('0x4c')]()+'\x20'+_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x37')];}var _0x1ee34d={'ContactId':_0x4c4661['id'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'inReplyTo':_0x93e2a8[_0x7c2c('0x2b')]['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8[_0x7c2c('0x2b')]['message']['attach'],'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x7c2c('0x25')]({'where':{'closed':![],'MailAccountId':_0x93e2a8['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x7c2c('0x50'),'attributes':[_0x7c2c('0x4b')],'where':{'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x51')]}}]})[_0x7c2c('0xe')](function(_0x2d4459){if(_0x2d4459){return[_0x2d4459,![]];}return db[_0x7c2c('0x52')][_0x7c2c('0x53')](_0x1ee34d)[_0x7c2c('0xe')](function(_0xd01d59){return[_0xd01d59,!![]];});});}else{throw new Error(_0x7c2c('0x54'));}})[_0x7c2c('0x55')](function(_0x3d44f8,_0x559005){if(_0x3d44f8){_0x33b2be=_0x559005;if(!_0x559005){return _0x3d44f8[_0x7c2c('0x56')]({'inReplyTo':_0x93e2a8['body']['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['subject'],'attach':_0x3d44f8[_0x7c2c('0x57')]?_0x3d44f8[_0x7c2c('0x57')]:_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x57')],'substatus':null,'substatusAt':moment()[_0x7c2c('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'});}else{return _0x3d44f8;}}})['then'](function(_0x39d319){_0x12c9cd[_0x7c2c('0x58')]=_0x39d319['get']({'plain':!![]});_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x59')]=_0x33b2be;return db['MailMessage']['create']({'body':_0x93e2a8[_0x7c2c('0x2b')]['body'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'MailInteractionId':_0x39d319['id'],'direction':'in','ContactId':_0x12c9cd['contact']['id'],'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['messageId'],'from':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x37')],'to':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['to'],'cc':_0x93e2a8['body'][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x57')],'Attachments':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5a')],'originTo':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5b')],'originCc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5c')],'bcc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5d')],'ChatWebsiteId':_0x93e2a8['body']['message'][_0x7c2c('0x5e')]||null,'originChannel':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['originChannel']||_0x7c2c('0x5f'),'ChatOfflineMessageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x7c2c('0x60')],'as':_0x7c2c('0x61')}]});})[_0x7c2c('0xe')](function(_0x8f8b42){_0x12c9cd['message']=_0x8f8b42;if(_0x12c9cd[_0x7c2c('0x58')]['UserId']){return db[_0x7c2c('0x62')]['find']({'attributes':['id',_0x7c2c('0x63')],'where':{'id':_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x64')]}})[_0x7c2c('0xe')](function(_0x43eb9d){if(_0x43eb9d){_0x12c9cd[_0x7c2c('0x42')][_0x7c2c('0x65')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x43eb9d[_0x7c2c('0x63')]+','+(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x66')]||0xa),'interval':_0x7c2c('0x67')});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);})['then'](function(_0x2d75b8){_0x18e288(_0x2d75b8);})[_0x7c2c('0x19')](function(_0x2391a7){_0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,_0x2391a7[_0x7c2c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 3decb80..ef7950f 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 _0x3a31=['register','length','mailAccount:','./mailAccount.events','remove','emit','removeListener'];(function(_0x581aae,_0x2b18ee){var _0x539df2=function(_0xbbcb64){while(--_0xbbcb64){_0x581aae['push'](_0x581aae['shift']());}};_0x539df2(++_0x2b18ee);}(_0x3a31,0x7a));var _0x13a3=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3a31[_0x2dafbe];return _0x58a45a;};'use strict';var MailAccountEvents=require(_0x13a3('0x0'));var events=['save',_0x13a3('0x1'),'update'];function createListener(_0x1c2dcb,_0x2bf69b){return function(_0x1d6dc2){_0x2bf69b[_0x13a3('0x2')](_0x1c2dcb,_0x1d6dc2);};}function removeListener(_0x1e110c,_0x5dc9de){return function(){MailAccountEvents[_0x13a3('0x3')](_0x1e110c,_0x5dc9de);};}exports[_0x13a3('0x4')]=function(_0x4216d8){for(var _0x301b54=0x0,_0x4a73db=events[_0x13a3('0x5')];_0x301b54<_0x4a73db;_0x301b54++){var _0x2ef007=events[_0x301b54];var _0x2e91da=createListener(_0x13a3('0x6')+_0x2ef007,_0x4216d8);MailAccountEvents['on'](_0x2ef007,_0x2e91da);}}; \ No newline at end of file +var _0x5546=['removeListener','register','length','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x5546,0x79));var _0x6554=function(_0x1f583a,_0x51ad58){_0x1f583a=_0x1f583a-0x0;var _0x2ca038=_0x5546[_0x1f583a];return _0x2ca038;};'use strict';var MailAccountEvents=require(_0x6554('0x0'));var events=[_0x6554('0x1'),_0x6554('0x2'),_0x6554('0x3')];function createListener(_0x383bfb,_0x37fa03){return function(_0x302d34){_0x37fa03[_0x6554('0x4')](_0x383bfb,_0x302d34);};}function removeListener(_0x2de412,_0x56fab9){return function(){MailAccountEvents[_0x6554('0x5')](_0x2de412,_0x56fab9);};}exports[_0x6554('0x6')]=function(_0x31de7c){for(var _0x30e52a=0x0,_0x25060d=events[_0x6554('0x7')];_0x30e52a<_0x25060d;_0x30e52a++){var _0x2df25c=events[_0x30e52a];var _0x5efad8=createListener(_0x6554('0x8')+_0x2df25c,_0x31de7c);MailAccountEvents['on'](_0x2df25c,_0x5efad8);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index a3d0524..3b0108c 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 _0x7af3=['update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id'];(function(_0x483c16,_0x5509f6){var _0x848da3=function(_0x1dd808){while(--_0x1dd808){_0x483c16['push'](_0x483c16['shift']());}};_0x848da3(++_0x5509f6);}(_0x7af3,0xd4));var _0x37af=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7af3[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require(_0x37af('0x0'));var path=require(_0x37af('0x1'));var timeout=require(_0x37af('0x2'));var express=require(_0x37af('0x3'));var router=express[_0x37af('0x4')]();var fs_extra=require(_0x37af('0x5'));var auth=require(_0x37af('0x6'));var interaction=require(_0x37af('0x7'));var config=require(_0x37af('0x8'));var controller=require('./mailApplication.controller');router[_0x37af('0x9')]('/:id',auth[_0x37af('0xa')](),controller[_0x37af('0xb')]);router['put'](_0x37af('0xc'),auth['isAuthenticated'](),controller[_0x37af('0xd')]);router['delete'](_0x37af('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x37af('0xe')]=router; \ No newline at end of file +var _0x8b9d=['update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put'];(function(_0x49ee56,_0x48dab5){var _0x10ff20=function(_0x2c175b){while(--_0x2c175b){_0x49ee56['push'](_0x49ee56['shift']());}};_0x10ff20(++_0x48dab5);}(_0x8b9d,0x111));var _0xd8b9=function(_0x7f1644,_0x268f86){_0x7f1644=_0x7f1644-0x0;var _0x5518b0=_0x8b9d[_0x7f1644];return _0x5518b0;};'use strict';var multer=require(_0xd8b9('0x0'));var util=require('util');var path=require(_0xd8b9('0x1'));var timeout=require(_0xd8b9('0x2'));var express=require(_0xd8b9('0x3'));var router=express['Router']();var fs_extra=require(_0xd8b9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd8b9('0x5'));var config=require(_0xd8b9('0x6'));var controller=require(_0xd8b9('0x7'));router['get'](_0xd8b9('0x8'),auth[_0xd8b9('0x9')](),controller[_0xd8b9('0xa')]);router[_0xd8b9('0xb')](_0xd8b9('0x8'),auth[_0xd8b9('0x9')](),controller[_0xd8b9('0xc')]);router['delete'](_0xd8b9('0x8'),auth[_0xd8b9('0x9')](),controller[_0xd8b9('0xd')]);module[_0xd8b9('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 4e7d823..a20cdf5 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 _0x462a=['sequelize','INTEGER','STRING','noop','*,*,*,*'];(function(_0x201796,_0x21e5fc){var _0x2c781a=function(_0x54f9d3){while(--_0x54f9d3){_0x201796['push'](_0x201796['shift']());}};_0x2c781a(++_0x21e5fc);}(_0x462a,0x91));var _0xa462=function(_0x565292,_0x57eb92){_0x565292=_0x565292-0x0;var _0x521b61=_0x462a[_0x565292];return _0x521b61;};'use strict';var Sequelize=require(_0xa462('0x0'));module['exports']={'priority':{'type':Sequelize[_0xa462('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa462('0x2')],'allowNull':![],'defaultValue':_0xa462('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa462('0x2')]},'interval':{'type':Sequelize[_0xa462('0x2')],'defaultValue':_0xa462('0x4')}}; \ No newline at end of file +var _0xaae6=['TEXT','*,*,*,*','sequelize','STRING'];(function(_0x2f1e0b,_0x54a624){var _0x25285d=function(_0xed7677){while(--_0xed7677){_0x2f1e0b['push'](_0x2f1e0b['shift']());}};_0x25285d(++_0x54a624);}(_0xaae6,0x17a));var _0x6aae=function(_0x42960d,_0x3a7cc8){_0x42960d=_0x42960d-0x0;var _0x14efd0=_0xaae6[_0x42960d];return _0x14efd0;};'use strict';var Sequelize=require(_0x6aae('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6aae('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6aae('0x2')]()},'description':{'type':Sequelize[_0x6aae('0x1')]},'interval':{'type':Sequelize[_0x6aae('0x1')],'defaultValue':_0x6aae('0x3')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 3ad6473..ebca7c1 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 _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x565a37,_0x3e26b7){var _0x2a60e2=function(_0x3b4c77){while(--_0x3b4c77){_0x565a37['push'](_0x565a37['shift']());}};_0x2a60e2(++_0x3e26b7);}(_0x54ef,0x112));var _0xf54e=function(_0x1dc124,_0x32cef6){_0x1dc124=_0x1dc124-0x0;var _0x29740d=_0x54ef[_0x1dc124];return _0x29740d;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file +var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x2b36f5,_0x5732dc){var _0x5f06b6=function(_0x5def4f){while(--_0x5def4f){_0x2b36f5['push'](_0x2b36f5['shift']());}};_0x5f06b6(++_0x5732dc);}(_0xe706,0xa3));var _0x6e70=function(_0x590a3a,_0xd9db9){_0x590a3a=_0x590a3a-0x0;var _0x49017f=_0xe706[_0x590a3a];return _0x49017f;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 4fd6732..afc1ab8 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 _0x058b=['../../config/environment','./mailApplication.attributes','define','mail_applications','lodash','api','moment','bluebird','request-promise','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x058b,0x11c));var _0xb058=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0x058b[_0x236c89];return _0x3b2a15;};'use strict';var _=require(_0xb058('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb058('0x1'));var moment=require(_0xb058('0x2'));var BPromise=require(_0xb058('0x3'));var rp=require(_0xb058('0x4'));var fs=require('fs');var path=require(_0xb058('0x5'));var rimraf=require('rimraf');var config=require(_0xb058('0x6'));var attributes=require(_0xb058('0x7'));module['exports']=function(_0x41966e,_0x29a3f8){return _0x41966e[_0xb058('0x8')]('MailApplication',attributes,{'tableName':_0xb058('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa696=['lodash','../../config/logger','api','moment','bluebird','./mailApplication.attributes','define','MailApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x29215d,_0x39143f){var _0x265037=function(_0x3e07ff){while(--_0x3e07ff){_0x29215d['push'](_0x29215d['shift']());}};_0x265037(++_0x39143f);}(_0xa696,0x1e0));var _0x6a69=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0xa696[_0x576d8a];return _0x3dc3ef;};'use strict';var _=require(_0x6a69('0x0'));var util=require('util');var logger=require(_0x6a69('0x1'))(_0x6a69('0x2'));var moment=require(_0x6a69('0x3'));var BPromise=require(_0x6a69('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(_0x6a69('0x5'));module['exports']=function(_0x124566,_0x5be5ac){return _0x124566[_0x6a69('0x6')](_0x6a69('0x7'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6a69('0x8'),'collate':_0x6a69('0x9')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 230a75d..cf199fc 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 _0xdf47=['attributes','UpdateMailApplication','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','update','body','options','raw','where'];(function(_0x2086bb,_0x27d943){var _0x569238=function(_0x42a1ad){while(--_0x42a1ad){_0x2086bb['push'](_0x2086bb['shift']());}};_0x569238(++_0x27d943);}(_0xdf47,0x77));var _0x7df4=function(_0x2b78e0,_0xaf5738){_0x2b78e0=_0x2b78e0-0x0;var _0x22815e=_0xdf47[_0x2b78e0];return _0x22815e;};'use strict';var _=require('lodash');var util=require(_0x7df4('0x0'));var moment=require(_0x7df4('0x1'));var BPromise=require(_0x7df4('0x2'));var rs=require(_0x7df4('0x3'));var fs=require('fs');var Redis=require(_0x7df4('0x4'));var db=require(_0x7df4('0x5'))['db'];var utils=require(_0x7df4('0x6'));var logger=require(_0x7df4('0x7'))(_0x7df4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7df4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5164a9,_0x2505c3,_0x2c1828){return new BPromise(function(_0xb37242,_0x12c24e){return client[_0x7df4('0xa')](_0x5164a9,_0x2c1828)[_0x7df4('0xb')](function(_0x553f2b){logger[_0x7df4('0xc')](_0x7df4('0xd'),_0x2505c3,'request\x20sent');logger[_0x7df4('0xe')](_0x7df4('0xf'),_0x2505c3,_0x7df4('0x10'),JSON['stringify'](_0x553f2b));if(_0x553f2b[_0x7df4('0x11')]){if(_0x553f2b[_0x7df4('0x11')][_0x7df4('0x12')]===0x1f4){logger[_0x7df4('0x11')](_0x7df4('0xd'),_0x2505c3,_0x553f2b[_0x7df4('0x11')][_0x7df4('0x13')]);return _0x12c24e(_0x553f2b[_0x7df4('0x11')]['message']);}logger[_0x7df4('0x11')]('MailApplication,\x20%s,\x20%s',_0x2505c3,_0x553f2b['error'][_0x7df4('0x13')]);return _0xb37242(_0x553f2b[_0x7df4('0x11')][_0x7df4('0x13')]);}else{logger[_0x7df4('0xc')](_0x7df4('0xd'),_0x2505c3,'request\x20sent');_0xb37242(_0x553f2b['result'][_0x7df4('0x13')]);}})[_0x7df4('0x14')](function(_0x164428){logger['error']('MailApplication,\x20%s,\x20%s',_0x2505c3,_0x164428);_0x12c24e(_0x164428);});});}exports['UpdateMailApplication']=function(_0xffb5f3){var _0x3b8c5b=this;return new Promise(function(_0x21a9b9,_0x43da1a){return db['MailApplication'][_0x7df4('0x15')](_0xffb5f3[_0x7df4('0x16')],{'raw':_0xffb5f3[_0x7df4('0x17')]?_0xffb5f3['options'][_0x7df4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xffb5f3[_0x7df4('0x17')]?_0xffb5f3[_0x7df4('0x17')][_0x7df4('0x19')]||null:null,'attributes':_0xffb5f3[_0x7df4('0x17')]?_0xffb5f3[_0x7df4('0x17')][_0x7df4('0x1a')]||null:null,'limit':_0xffb5f3['options']?_0xffb5f3[_0x7df4('0x17')]['limit']||null:null})[_0x7df4('0xb')](function(_0x22d1e4){logger['info'](_0x7df4('0x1b'),_0xffb5f3);logger[_0x7df4('0xe')](_0x7df4('0x1b'),_0xffb5f3,JSON[_0x7df4('0x1c')](_0x22d1e4));_0x21a9b9(_0x22d1e4);})[_0x7df4('0x14')](function(_0x2ec920){logger[_0x7df4('0x11')](_0x7df4('0x1b'),_0x2ec920['message'],_0xffb5f3);_0x43da1a(_0x3b8c5b[_0x7df4('0x11')](0x1f4,_0x2ec920[_0x7df4('0x13')]));});});}; \ No newline at end of file +var _0x9ff3=['jayson/promise','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateMailApplication','MailApplication','update','body','options','raw','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x15fc3a,_0x5d83f4){var _0x34f2b4=function(_0x20cef2){while(--_0x20cef2){_0x15fc3a['push'](_0x15fc3a['shift']());}};_0x34f2b4(++_0x5d83f4);}(_0x9ff3,0x104));var _0x39ff=function(_0x4b23fa,_0x2a4ed2){_0x4b23fa=_0x4b23fa-0x0;var _0x928ba0=_0x9ff3[_0x4b23fa];return _0x928ba0;};'use strict';var _=require(_0x39ff('0x0'));var util=require(_0x39ff('0x1'));var moment=require(_0x39ff('0x2'));var BPromise=require('bluebird');var rs=require(_0x39ff('0x3'));var fs=require('fs');var Redis=require(_0x39ff('0x4'));var db=require(_0x39ff('0x5'))['db'];var utils=require(_0x39ff('0x6'));var logger=require(_0x39ff('0x7'))(_0x39ff('0x8'));var config=require(_0x39ff('0x9'));var jayson=require(_0x39ff('0xa'));var client=jayson['client'][_0x39ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5261ee,_0x169b62,_0x22eeb0){return new BPromise(function(_0xe8bdff,_0x5d2cab){return client[_0x39ff('0xc')](_0x5261ee,_0x22eeb0)[_0x39ff('0xd')](function(_0x19b86c){logger[_0x39ff('0xe')](_0x39ff('0xf'),_0x169b62,_0x39ff('0x10'));logger[_0x39ff('0x11')](_0x39ff('0x12'),_0x169b62,_0x39ff('0x10'),JSON[_0x39ff('0x13')](_0x19b86c));if(_0x19b86c['error']){if(_0x19b86c[_0x39ff('0x14')]['code']===0x1f4){logger['error'](_0x39ff('0xf'),_0x169b62,_0x19b86c[_0x39ff('0x14')][_0x39ff('0x15')]);return _0x5d2cab(_0x19b86c[_0x39ff('0x14')]['message']);}logger['error'](_0x39ff('0xf'),_0x169b62,_0x19b86c[_0x39ff('0x14')][_0x39ff('0x15')]);return _0xe8bdff(_0x19b86c['error'][_0x39ff('0x15')]);}else{logger[_0x39ff('0xe')](_0x39ff('0xf'),_0x169b62,'request\x20sent');_0xe8bdff(_0x19b86c['result'][_0x39ff('0x15')]);}})[_0x39ff('0x16')](function(_0x375ada){logger[_0x39ff('0x14')](_0x39ff('0xf'),_0x169b62,_0x375ada);_0x5d2cab(_0x375ada);});});}exports[_0x39ff('0x17')]=function(_0x51a775){var _0x1df667=this;return new Promise(function(_0x1b0f3f,_0x3dbbb5){return db[_0x39ff('0x18')][_0x39ff('0x19')](_0x51a775[_0x39ff('0x1a')],{'raw':_0x51a775[_0x39ff('0x1b')]?_0x51a775[_0x39ff('0x1b')][_0x39ff('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51a775[_0x39ff('0x1b')]?_0x51a775[_0x39ff('0x1b')]['where']||null:null,'attributes':_0x51a775[_0x39ff('0x1b')]?_0x51a775[_0x39ff('0x1b')]['attributes']||null:null,'limit':_0x51a775[_0x39ff('0x1b')]?_0x51a775[_0x39ff('0x1b')][_0x39ff('0x1d')]||null:null})[_0x39ff('0xd')](function(_0x296eda){logger[_0x39ff('0xe')](_0x39ff('0x17'),_0x51a775);logger[_0x39ff('0x11')](_0x39ff('0x17'),_0x51a775,JSON[_0x39ff('0x13')](_0x296eda));_0x1b0f3f(_0x296eda);})[_0x39ff('0x16')](function(_0x13eb0b){logger['error'](_0x39ff('0x17'),_0x13eb0b[_0x39ff('0x15')],_0x51a775);_0x3dbbb5(_0x1df667[_0x39ff('0x14')](0x1f4,_0x13eb0b[_0x39ff('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 41672cd..0d46ef6 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 _0x832a=['removeTags','exports','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','index','isAuthenticated','/:id','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','update','destroy','delete'];(function(_0x23678d,_0x2da727){var _0x5e743b=function(_0x170f41){while(--_0x170f41){_0x23678d['push'](_0x23678d['shift']());}};_0x5e743b(++_0x2da727);}(_0x832a,0x115));var _0xa832=function(_0xd6f6f5,_0x1b2345){_0xd6f6f5=_0xd6f6f5-0x0;var _0xe61908=_0x832a[_0xd6f6f5];return _0xe61908;};'use strict';var express=require(_0xa832('0x0'));var router=express['Router']();var auth=require(_0xa832('0x1'));var interaction=require(_0xa832('0x2'));var controller=require(_0xa832('0x3'));router[_0xa832('0x4')]('/',auth['isAuthenticated'](),controller[_0xa832('0x5')]);router[_0xa832('0x4')]('/describe',auth[_0xa832('0x6')](),controller['describe']);router[_0xa832('0x4')](_0xa832('0x7'),auth['isAuthenticated'](),controller['show']);router['get'](_0xa832('0x8'),auth['isAuthenticated'](),controller[_0xa832('0x9')]);router['get'](_0xa832('0xa'),auth[_0xa832('0x6')](),controller['download']);router[_0xa832('0xb')]('/',auth[_0xa832('0x6')](),controller[_0xa832('0xc')]);router[_0xa832('0xb')]('/:id/messages',auth[_0xa832('0x6')](),controller[_0xa832('0xd')]);router[_0xa832('0xb')](_0xa832('0xe'),auth[_0xa832('0x6')](),interaction[_0xa832('0xf')](_0xa832('0x10'),_0xa832('0x11')),controller['addTags']);router[_0xa832('0x12')](_0xa832('0x7'),auth[_0xa832('0x6')](),interaction['tracked'](_0xa832('0x10'),_0xa832('0x13')),controller[_0xa832('0x14')]);router['delete'](_0xa832('0x7'),auth['isAuthenticated'](),interaction[_0xa832('0xf')]('mail','mailinteraction:destroy'),controller[_0xa832('0x15')]);router[_0xa832('0x16')](_0xa832('0xe'),auth[_0xa832('0x6')](),controller[_0xa832('0x17')]);module[_0xa832('0x18')]=router; \ No newline at end of file +var _0x6e67=['../../components/interaction/service','./mailInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','mailinteraction:addtags','addTags','put','/:id','tracked','mail','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service'];(function(_0x3d78f4,_0x2a3a86){var _0x6b37a4=function(_0x469ef0){while(--_0x469ef0){_0x3d78f4['push'](_0x3d78f4['shift']());}};_0x6b37a4(++_0x2a3a86);}(_0x6e67,0x114));var _0x76e6=function(_0x3ba813,_0x4acfd9){_0x3ba813=_0x3ba813-0x0;var _0x499b77=_0x6e67[_0x3ba813];return _0x499b77;};'use strict';var express=require(_0x76e6('0x0'));var router=express[_0x76e6('0x1')]();var auth=require(_0x76e6('0x2'));var interaction=require(_0x76e6('0x3'));var controller=require(_0x76e6('0x4'));router[_0x76e6('0x5')]('/',auth['isAuthenticated'](),controller[_0x76e6('0x6')]);router[_0x76e6('0x5')](_0x76e6('0x7'),auth[_0x76e6('0x8')](),controller[_0x76e6('0x9')]);router[_0x76e6('0x5')]('/:id',auth[_0x76e6('0x8')](),controller['show']);router['get'](_0x76e6('0xa'),auth[_0x76e6('0x8')](),controller[_0x76e6('0xb')]);router[_0x76e6('0x5')](_0x76e6('0xc'),auth[_0x76e6('0x8')](),controller[_0x76e6('0xd')]);router['post']('/',auth[_0x76e6('0x8')](),controller[_0x76e6('0xe')]);router[_0x76e6('0xf')](_0x76e6('0xa'),auth[_0x76e6('0x8')](),controller[_0x76e6('0x10')]);router['post'](_0x76e6('0x11'),auth[_0x76e6('0x8')](),interaction['tracked']('mail',_0x76e6('0x12')),controller[_0x76e6('0x13')]);router[_0x76e6('0x14')](_0x76e6('0x15'),auth[_0x76e6('0x8')](),interaction[_0x76e6('0x16')](_0x76e6('0x17'),_0x76e6('0x18')),controller[_0x76e6('0x19')]);router[_0x76e6('0x1a')](_0x76e6('0x15'),auth[_0x76e6('0x8')](),interaction[_0x76e6('0x16')](_0x76e6('0x17'),_0x76e6('0x1b')),controller[_0x76e6('0x1c')]);router['delete']('/:id/tags',auth[_0x76e6('0x8')](),controller[_0x76e6('0x1d')]);module[_0x76e6('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index f797c3f..8d6a975 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 _0xce29=['STRING','TEXT','long','out','ENUM','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0x203387,_0x25ee77){var _0x358e6b=function(_0xf5b2ff){while(--_0xf5b2ff){_0x203387['push'](_0x203387['shift']());}};_0x358e6b(++_0x25ee77);}(_0xce29,0x159));var _0x9ce2=function(_0x211116,_0x2c5740){_0x211116=_0x211116-0x0;var _0x5ccc07=_0xce29[_0x211116];return _0x5ccc07;};'use strict';var Sequelize=require(_0x9ce2('0x0'));var iconv=require(_0x9ce2('0x1'));module[_0x9ce2('0x2')]={'closed':{'type':Sequelize[_0x9ce2('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9ce2('0x4')]},'disposition':{'type':Sequelize[_0x9ce2('0x5')]},'secondDisposition':{'type':Sequelize[_0x9ce2('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x9ce2('0x5')](0x1fe)},'to':{'type':Sequelize[_0x9ce2('0x5')]},'cc':{'type':Sequelize[_0x9ce2('0x6')](_0x9ce2('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x9ce2('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x9ce2('0x4')]},'substatus':{'type':Sequelize[_0x9ce2('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x9ce2('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x9ce2('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9ce2('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x9ce2('0x9')]('in',_0x9ce2('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x376c=['sequelize','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0x376c,0xc0));var _0xc376=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x376c[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc376('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0xc376('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc376('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc376('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc376('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xc376('0x3')]},'cc':{'type':Sequelize[_0xc376('0x4')](_0xc376('0x5'))},'subject':{'type':Sequelize[_0xc376('0x4')]()},'attach':{'type':Sequelize[_0xc376('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xc376('0x2')]},'substatus':{'type':Sequelize[_0xc376('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xc376('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xc376('0x6')]('in',_0xc376('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc376('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xc376('0x6')]('in',_0xc376('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 a7abeba..4534ce5 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 _0x8c46=['ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','keys','some','compact','isEmpty','MailAccountId','concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.disposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','rows','show','params','rawAttributes','includeAll','create','body','describe','addMessage','ids','omit','$gte','YYYY-MM-DD\x20HH:mm:ss','options','include','inlineCss','true','setTags','spread','emit','removeTags','unix','root','server','files','tmp','join','attachments','format','Attachment','Attachments','bcc','createdAt','Messages','get','mkdirSync','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','download','unlinkSync','eml-format','moment','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','html-entities','redis','defaults','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','sendStatus','stack','name','send','map','fullname','TagIds','Tags','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','talking','answered','total','closed','UserId','unmanaged','index','MailInteraction','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','unreadMessages','having','Contact','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c46,0x171));var _0x68c4=function(_0x2e5e9f,_0x56933f){_0x2e5e9f=_0x2e5e9f-0x0;var _0x45036b=_0x8c46[_0x2e5e9f];return _0x45036b;};'use strict';var emlformat=require(_0x68c4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x68c4('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x68c4('0x2'));var fs=require('fs');var _=require(_0x68c4('0x3'));var squel=require(_0x68c4('0x4'));var juice=require(_0x68c4('0x5'));var Redis=require(_0x68c4('0x6'));var qs=require(_0x68c4('0x7'));var as=require(_0x68c4('0x8'));var logger=require(_0x68c4('0x9'))(_0x68c4('0xa'));var config=require(_0x68c4('0xb'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x68c4('0xc'));config[_0x68c4('0xd')]=_[_0x68c4('0xe')](config['redis'],{'host':_0x68c4('0xf'),'port':0x18eb});var socket=require(_0x68c4('0x10'))(new Redis(config[_0x68c4('0xd')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x3f44f0,_0x2a8c08){_0x2a8c08=_0x2a8c08||0xcc;return function(_0x50b161){if(_0x50b161){return _0x3f44f0['sendStatus'](_0x2a8c08);}return _0x3f44f0[_0x68c4('0x11')](_0x2a8c08)[_0x68c4('0x12')]();};}function respondWithResult(_0x2796c8,_0x48783b){_0x48783b=_0x48783b||0xc8;return function(_0x3a432a){if(_0x3a432a){return _0x2796c8[_0x68c4('0x11')](_0x48783b)[_0x68c4('0x13')](_0x3a432a);}};}function respondWithFilteredResult(_0x56e361,_0x11eb66){return function(_0x14919c){if(_0x14919c){var _0x5e1341=typeof _0x11eb66['offset']===_0x68c4('0x14')&&typeof _0x11eb66[_0x68c4('0x15')]==='undefined';var _0xc25f7b=_0x14919c['count'];var _0x1a7045=_0x5e1341?0x0:_0x11eb66['offset'];var _0x5497bf=_0x5e1341?_0x14919c[_0x68c4('0x16')]:_0x11eb66[_0x68c4('0x17')]+_0x11eb66['limit'];var _0x2d6c1b;if(_0x5497bf>=_0xc25f7b){_0x5497bf=_0xc25f7b;_0x2d6c1b=0xc8;}else{_0x2d6c1b=0xce;}_0x56e361[_0x68c4('0x11')](_0x2d6c1b);return _0x56e361[_0x68c4('0x18')](_0x68c4('0x19'),_0x1a7045+'-'+_0x5497bf+'/'+_0xc25f7b)[_0x68c4('0x13')](_0x14919c);}return null;};}function saveUpdates(_0x10f0a7){return function(_0x334e40){if(_0x334e40){return _0x334e40[_0x68c4('0x1a')](_0x10f0a7)[_0x68c4('0x1b')](function(_0x3befda){return _0x3befda;});}return null;};}function removeEntity(_0x29cb55){return function(_0x58f87d){if(_0x58f87d){return _0x58f87d[_0x68c4('0x1c')]()['then'](function(){_0x29cb55['status'](0xcc)[_0x68c4('0x12')]();});}};}function handleEntityNotFound(_0x1355f1){return function(_0x154897){if(!_0x154897){_0x1355f1[_0x68c4('0x1d')](0x194);}return _0x154897;};}function handleError(_0x5b8135,_0x35e865){_0x35e865=_0x35e865||0x1f4;return function(_0x310bc6){logger['error'](_0x310bc6[_0x68c4('0x1e')]);if(_0x310bc6[_0x68c4('0x1f')]){delete _0x310bc6[_0x68c4('0x1f')];}_0x5b8135[_0x68c4('0x11')](_0x35e865)[_0x68c4('0x20')](_0x310bc6);};}function getInteractionUsers(_0x20e78b,_0x37e9a9){return new BPromise(function(_0x505db4,_0x2ff4a5){try{if(_0x37e9a9[_0x20e78b['id']]){_0x20e78b['Users']=_[_0x68c4('0x21')](_0x37e9a9[_0x20e78b['id']],function(_0x10c67e){return{'id':_0x10c67e['id'],'fullname':_0x10c67e[_0x68c4('0x22')]};});}}catch(_0x4f9d32){_0x2ff4a5(_0x4f9d32);}_0x505db4(_0x20e78b);});}function getInteractionTags(_0x1e14db,_0x126064){return new BPromise(function(_0x496f4d,_0x31e177){try{if(_0x1e14db[_0x68c4('0x23')]){_0x1e14db[_0x68c4('0x24')]=[];_0x1e14db[_0x68c4('0x23')]['split'](',')[_0x68c4('0x25')](function(_0x4b4634){_0x1e14db[_0x68c4('0x24')][_0x68c4('0x26')](_0x126064[_0x4b4634]);});}delete _0x1e14db['TagIds'];}catch(_0x2847d1){_0x31e177(_0x2847d1);}_0x496f4d(_0x1e14db);});}function getLastMessageText(_0x3a5627){return new BPromise(function(_0x48e4bd,_0x29ef9d){return db[_0x68c4('0x27')][_0x68c4('0x28')]({'where':{'$and':[{'MailInteractionId':_0x3a5627['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x68c4('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x68c4('0x2a')],'order':_0x68c4('0x2b'),'raw':!![]})[_0x68c4('0x1b')](function(_0x319de8){if(_0x319de8&&_0x319de8[_0x68c4('0x2a')]){_0x3a5627[_0x68c4('0x2c')]=_[_0x68c4('0x2d')](_0x319de8[_0x68c4('0x2a')]);}_0x48e4bd(_0x3a5627);})[_0x68c4('0x2e')](function(_0x1ad882){_0x29ef9d(_0x1ad882);});});}function updateMailInteraction(_0x3ce082,_0x3a3a75,_0x33fcc7,_0x106d6e){return new BPromise(function(_0x4837b4,_0x1299fc){return getInteractionUsers(_0x3ce082,_0x33fcc7)[_0x68c4('0x1b')](function(_0x25eeea){return getInteractionTags(_0x25eeea,_0x3a3a75);})[_0x68c4('0x1b')](function(_0x352db9){return getStateInteraction(_0x352db9);})['then'](function(_0x32fef0){if(_0x106d6e){_0x4837b4(getLastMessageText(_0x32fef0));}else{_0x4837b4(_0x32fef0);}})['catch'](function(_0x586e9c){_0x1299fc(_0x586e9c);});});}function getStateInteraction(_0x4dcd5b){return new BPromise(function(_0xb86553){_0x4dcd5b[_0x68c4('0x2f')]=0x0;_0x4dcd5b[_0x68c4('0x30')]=0x0;_0x4dcd5b[_0x68c4('0x31')]=0x0;_0x4dcd5b['unmanaged']=0x0;_0x4dcd5b[_0x68c4('0x32')]=0x0;if(!_0x4dcd5b[_0x68c4('0x33')]&&!_0x4dcd5b[_0x68c4('0x34')]){_0x4dcd5b['waiting']+=0x1;}if(!_0x4dcd5b[_0x68c4('0x33')]&&_0x4dcd5b[_0x68c4('0x34')]){_0x4dcd5b[_0x68c4('0x30')]+=0x1;if(_0x4dcd5b[_0x68c4('0x2f')]){_0x4dcd5b[_0x68c4('0x2f')]-=0x1;}}if(_0x4dcd5b[_0x68c4('0x33')]&&_0x4dcd5b[_0x68c4('0x34')]){_0x4dcd5b[_0x68c4('0x31')]+=0x1;if(_0x4dcd5b[_0x68c4('0x30')]){_0x4dcd5b[_0x68c4('0x30')]-=0x1;}}if(_0x4dcd5b['closed']&&!_0x4dcd5b['UserId']){_0x4dcd5b[_0x68c4('0x35')]+=0x1;if(_0x4dcd5b[_0x68c4('0x2f')]){_0x4dcd5b[_0x68c4('0x2f')]-=0x1;}}_0x4dcd5b[_0x68c4('0x32')]+=0x1;_0xb86553(_0x4dcd5b);});}exports[_0x68c4('0x36')]=function(_0x13386d,_0x49cc23){var _0x199645={},_0x2cd597={},_0x3f6d18={'count':0x0,'rows':[]};var _0xe8cc5b=_[_0x68c4('0x21')](db[_0x68c4('0x37')]['rawAttributes'],function(_0x5c78fb){return{'name':_0x5c78fb[_0x68c4('0x38')],'type':_0x5c78fb[_0x68c4('0x39')][_0x68c4('0x3a')]};});_0x2cd597[_0x68c4('0x3b')]=_['map'](_0xe8cc5b,_0x68c4('0x1f'));_0x2cd597[_0x68c4('0x3c')]=_['keys'](_0x13386d['query']);_0x2cd597['filters']=_[_0x68c4('0x3d')](_0x2cd597['model'],_0x2cd597[_0x68c4('0x3c')]);_0x199645['attributes']=_[_0x68c4('0x3d')](_0x2cd597[_0x68c4('0x3b')],qs[_0x68c4('0x3e')](_0x13386d[_0x68c4('0x3c')]['fields']));_0x199645[_0x68c4('0x3f')]=_0x199645[_0x68c4('0x3f')][_0x68c4('0x40')]?_0x199645[_0x68c4('0x3f')]:_0x2cd597['model'];if(!_0x13386d[_0x68c4('0x3c')][_0x68c4('0x41')](_0x68c4('0x42'))){_0x199645[_0x68c4('0x15')]=qs[_0x68c4('0x15')](_0x13386d['query']['limit']);_0x199645['offset']=qs[_0x68c4('0x17')](_0x13386d[_0x68c4('0x3c')][_0x68c4('0x17')]);}_0x199645[_0x68c4('0x43')]=qs['sort'](_0x13386d[_0x68c4('0x3c')][_0x68c4('0x44')]);_0x199645[_0x68c4('0x45')]=qs[_0x68c4('0x46')](_[_0x68c4('0x47')](_0x13386d[_0x68c4('0x3c')],_0x2cd597[_0x68c4('0x46')]),_0xe8cc5b);var _0x5b8209=[];var _0x469f99=squel[_0x68c4('0x48')]()[_0x68c4('0x49')]('id')['field'](_0x68c4('0x1f'))['field'](_0x68c4('0x4a'))[_0x68c4('0x4b')](_0x68c4('0x4c'));var _0x984082=squel['select']()[_0x68c4('0x49')]('u.id')[_0x68c4('0x49')](_0x68c4('0x4d'))['field'](_0x68c4('0x4e'))[_0x68c4('0x4b')](_0x68c4('0x4f'),'ui')[_0x68c4('0x50')](_0x68c4('0x51'),'u',_0x68c4('0x52'));var _0x519ddb=squel[_0x68c4('0x48')]()[_0x68c4('0x4b')](_0x68c4('0x53'),'i')[_0x68c4('0x50')]('cm_contacts','c',_0x68c4('0x54'))[_0x68c4('0x50')](_0x68c4('0x51'),'o',_0x68c4('0x55'))[_0x68c4('0x50')](_0x68c4('0x56'),'a','a.id\x20=\x20i.MailAccountId')[_0x68c4('0x50')](_0x68c4('0x57'),'me',_0x68c4('0x58'))['left_join'](_0x68c4('0x59'),'it',_0x68c4('0x5a'))['left_join']('tools_tags','t',_0x68c4('0x5b'));var _0x1e412f=squel[_0x68c4('0x5c')]();var _0x31eda2=[];var _0x395f29=squel[_0x68c4('0x5c')]();var _0x2b5615;if(_0x13386d[_0x68c4('0x3c')]['search']){_0x2b5615=as[_0x68c4('0x5d')](_0x13386d['query']['search']);var _0x4e1352=_0x2b5615[_0x68c4('0x5e')];for(var _0x117408=0x0;_0x117408<_0x2b5615[_0x68c4('0x5f')]['length'];_0x117408++){var _0x39b3c2=_0x2b5615[_0x68c4('0x5f')][_0x117408];var _0x55466b='i';var _0x35faf1=_['find'](_0xe8cc5b,[_0x68c4('0x1f'),_0x39b3c2['field']]);if(!_0x35faf1){switch(_0x39b3c2[_0x68c4('0x49')]){case _0x68c4('0x60'):if(_0x39b3c2['value']==0x1){_0x519ddb[_0x68c4('0x61')]('`'+_0x39b3c2[_0x68c4('0x49')]+'`\x20=\x200');}else{_0x519ddb[_0x68c4('0x61')]('`'+_0x39b3c2[_0x68c4('0x49')]+'`\x20>\x200');}break;case _0x68c4('0x62'):if(_0x39b3c2[_0x68c4('0x63')]===_0x68c4('0x64')){if(_0x39b3c2[_0x68c4('0x65')][_0x68c4('0x66')]('\x20')[_0x68c4('0x40')]>0x1){_0x1e412f[_0x4e1352](_0x68c4('0x67'),qs[_0x68c4('0x68')](_0x39b3c2[_0x68c4('0x65')]),null);}else{var _0x52aa52='%'+_0x39b3c2[_0x68c4('0x65')]+'%';_0x1e412f[_0x4e1352](_0x68c4('0x69'),_0x52aa52,_0x52aa52,_0x52aa52);}}else{_0x35faf1=_[_0x68c4('0x6a')](_0xe8cc5b,[_0x68c4('0x1f'),_0x68c4('0x6b')]);_0x39b3c2[_0x68c4('0x49')]=_0x68c4('0x6b');_0x490bed=as['buildExpression'](_0x55466b,_0x35faf1['type'],_0x39b3c2);_0x1e412f[_0x4e1352](_0x490bed[_0x68c4('0x6c')],_0x490bed[_0x68c4('0x65')]['start'],_0x490bed[_0x68c4('0x65')][_0x68c4('0x12')]);}break;case _0x68c4('0x6d'):var _0x1bde7a=_0x39b3c2[_0x68c4('0x65')][_0x68c4('0x66')](',')['map'](function(_0x452b25){return Number(_0x452b25);});_0x1bde7a[_0x68c4('0x25')](function(_0xce205c){_0x395f29['or'](_0x68c4('0x6e'),'%,'+_0xce205c+',%');});_0x31eda2=_[_0x68c4('0x6f')](_0x31eda2,_0x1bde7a);break;case'User':if(_0x39b3c2['operator']===_0x68c4('0x64')){_0x1e412f[_0x4e1352](_0x68c4('0x70'),'%'+_0x39b3c2[_0x68c4('0x65')]+'%',null);}else{_0x35faf1=_[_0x68c4('0x6a')](_0xe8cc5b,[_0x68c4('0x1f'),'UserId']);_0x39b3c2[_0x68c4('0x49')]=_0x68c4('0x34');_0x490bed=as[_0x68c4('0x71')](_0x55466b,_0x35faf1[_0x68c4('0x39')],_0x39b3c2);_0x1e412f[_0x4e1352](_0x490bed[_0x68c4('0x6c')],_0x490bed[_0x68c4('0x65')][_0x68c4('0x72')],_0x490bed[_0x68c4('0x65')][_0x68c4('0x12')]);}break;case _0x68c4('0x2a'):_0x490bed=as['buildExpression']('me',null,_0x39b3c2);_0x1e412f[_0x4e1352](_0x490bed[_0x68c4('0x6c')],_0x490bed['value'][_0x68c4('0x72')],_0x490bed[_0x68c4('0x65')][_0x68c4('0x12')]);break;}}else{var _0x490bed=as[_0x68c4('0x71')](_0x55466b,_0x35faf1['type'],_0x39b3c2);_0x1e412f[_0x4e1352](_0x490bed[_0x68c4('0x6c')],_0x490bed[_0x68c4('0x65')][_0x68c4('0x72')],_0x490bed[_0x68c4('0x65')][_0x68c4('0x12')]);}}}else{var _0x4a3d74=_(_0x13386d[_0x68c4('0x3c')])[_0x68c4('0x73')]()[_0x68c4('0x21')](function(_0x8e291){return _[_0x68c4('0x74')](_0xe8cc5b,['name',_0x8e291])?_0x8e291:undefined;})[_0x68c4('0x75')]()[_0x68c4('0x65')]();if(!_[_0x68c4('0x76')](_0x4a3d74)){_0x4a3d74['forEach'](function(_0x46f828){if(_0x46f828===_0x68c4('0x77')){_0x519ddb[_0x68c4('0x45')]('i.MailAccountId\x20IN\x20?',[][_0x68c4('0x78')](_0x13386d['query'][_0x46f828]));}else if(_0x46f828==='createdAt'){var _0x43af21=JSON[_0x68c4('0x79')](_0x13386d[_0x68c4('0x3c')][_0x46f828])['$gte'];var _0x5b5353=JSON[_0x68c4('0x79')](_0x13386d[_0x68c4('0x3c')][_0x46f828])['$lte'];_0x519ddb[_0x68c4('0x45')](_0x68c4('0x7a'),_0x43af21,_0x5b5353);}else{if(_0x13386d['query'][_0x46f828]==='null'){_0x519ddb[_0x68c4('0x45')]('i.'+_0x46f828+_0x68c4('0x7b'));}else{_0x519ddb[_0x68c4('0x45')]('i.'+_0x46f828+_0x68c4('0x7c'),_0x13386d['query'][_0x46f828]);}}});}if(_0x13386d[_0x68c4('0x3c')]['read']){if(_0x13386d[_0x68c4('0x3c')][_0x68c4('0x7d')]==0x1){_0x519ddb[_0x68c4('0x61')](_0x68c4('0x7e'));}else{_0x519ddb[_0x68c4('0x61')](_0x68c4('0x7f'));}}if(_0x13386d[_0x68c4('0x3c')][_0x68c4('0x80')]){_0x31eda2=_['isArray'](_0x13386d[_0x68c4('0x3c')]['tag'])?_0x13386d[_0x68c4('0x3c')][_0x68c4('0x80')]:new Array(_0x13386d[_0x68c4('0x3c')][_0x68c4('0x80')]);_0x31eda2[_0x68c4('0x25')](function(_0x39c3e8){_0x395f29['or'](_0x68c4('0x6e'),'%,'+_0x39c3e8+',%');});}if(_0x13386d[_0x68c4('0x3c')][_0x68c4('0x81')]){var _0x227358=_0x13386d[_0x68c4('0x3c')][_0x68c4('0x81')][_0x68c4('0x82')]('\x5c','\x5c\x5c')[_0x68c4('0x82')](/'/g,'\x27\x27');if(qs[_0x68c4('0x83')](_0x227358)){_0x1e412f['or'](_0x68c4('0x84'),_0x227358+'%');}else if(qs[_0x68c4('0x85')](_0x227358)){_0x1e412f['or'](_0x68c4('0x86'),_0x227358+'%');}else{_0x1e412f['or'](_0x68c4('0x87'),qs[_0x68c4('0x68')](_0x227358))['or'](_0x68c4('0x88'),qs[_0x68c4('0x68')](_0x227358));}}}_0x519ddb[_0x68c4('0x45')](_0x1e412f);_0x519ddb[_0x68c4('0x89')](_0x68c4('0x8a'));var _0x5c75cd={'type':db[_0x68c4('0x8b')][_0x68c4('0x8c')]['SELECT'],'raw':!![]};var _0x28b130=_0x519ddb[_0x68c4('0x8d')]();_0x28b130['field'](_0x68c4('0x8a'));_0x28b130[_0x68c4('0x49')](_0x68c4('0x8e'),_0x68c4('0x60'));if(_0x199645[_0x68c4('0x43')]){_0x199645[_0x68c4('0x43')][_0x68c4('0x25')](function(_0x497956){var _0x15e681=_0x497956[0x0]===_0x68c4('0x8f')?_0x497956[0x0]:'i.'+_0x497956[0x0];_0x519ddb[_0x68c4('0x43')](_0x15e681,_0x497956[0x1]===_0x68c4('0x90')?![]:!![]);});}if(!_[_0x68c4('0x76')](_0x31eda2)){_0x519ddb['having'](_0x395f29);_0x28b130['where'](_0x68c4('0x91'),_0x31eda2);}BPromise[_0x68c4('0x92')]()[_0x68c4('0x1b')](function(){if(!_0x2b5615){if(_0x13386d[_0x68c4('0x3c')][_0x68c4('0x77')])return;_0x28b130[_0x68c4('0x45')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x519ddb[_0x68c4('0x45')](_0x68c4('0x93'));return;}if(_0x13386d['user'][_0x68c4('0x94')]!==_0x68c4('0x95'))return;return _0x13386d[_0x68c4('0x96')][_0x68c4('0x97')]({'attributes':['id'],'raw':!![]})[_0x68c4('0x1b')](function(_0x3aebef){if(_[_0x68c4('0x76')](_0x3aebef)){_0x28b130[_0x68c4('0x45')](_0x68c4('0x98'));_0x519ddb[_0x68c4('0x45')](_0x68c4('0x98'));}else{_0x28b130[_0x68c4('0x45')](_0x68c4('0x99'),_[_0x68c4('0x21')](_0x3aebef,'id'));_0x519ddb[_0x68c4('0x45')]('i.MailAccountId\x20IN\x20?',_[_0x68c4('0x21')](_0x3aebef,'id'));}});})[_0x68c4('0x1b')](function(){if(_0x13386d[_0x68c4('0x96')]['role']==='agent'&&!_0x2b5615&&!_0x13386d[_0x68c4('0x3c')][_0x68c4('0x77')])return[];return db['sequelize'][_0x68c4('0x3c')](_0x28b130[_0x68c4('0x9a')](),_0x5c75cd);})[_0x68c4('0x1b')](function(_0x141acd){_0x3f6d18['count']=_0x141acd[_0x68c4('0x40')];if(_0x3f6d18[_0x68c4('0x16')]===0x0)return[];return db[_0x68c4('0x9b')][_0x68c4('0x3c')](_0x469f99['toString'](),_0x5c75cd)[_0x68c4('0x1b')](function(_0x1c7475){_0x5b8209=_[_0x68c4('0x9c')](_0x1c7475,'id');_0x5c75cd=_[_0x68c4('0x9d')](_0x5c75cd,{'model':db[_0x68c4('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x13386d[_0x68c4('0x3c')][_0x68c4('0x3e')]){_0x199645[_0x68c4('0x3f')]['forEach'](function(_0x5cbe63){_0x519ddb[_0x68c4('0x49')]('i.'+_0x5cbe63);});}else{_0x519ddb[_0x68c4('0x49')](_0x68c4('0x8e'),_0x68c4('0x60'));_0x519ddb[_0x68c4('0x49')](_0x68c4('0x9e'),_0x68c4('0x9f'));_0x519ddb[_0x68c4('0x49')](_0x68c4('0xa0'),_0x68c4('0xa1'));_0x519ddb['field'](_0x68c4('0xa2'),_0x68c4('0x8f'));_0x519ddb['field'](_0x68c4('0x8a'));_0x519ddb[_0x68c4('0x49')](_0x68c4('0xa3'));_0x519ddb['field'](_0x68c4('0xa4'));_0x519ddb[_0x68c4('0x49')]('i.closed');_0x519ddb[_0x68c4('0x49')](_0x68c4('0xa5'));_0x519ddb[_0x68c4('0x49')](_0x68c4('0xa6'));_0x519ddb[_0x68c4('0x49')](_0x68c4('0xa7'));_0x519ddb[_0x68c4('0x49')]('i.lastMsgDirection');_0x519ddb[_0x68c4('0x49')]('i.subject');_0x519ddb[_0x68c4('0x49')](_0x68c4('0xa8'));_0x519ddb[_0x68c4('0x49')]('i.secondDisposition');_0x519ddb[_0x68c4('0x49')](_0x68c4('0xa9'));_0x519ddb['field'](_0x68c4('0xaa'));_0x519ddb[_0x68c4('0x49')](_0x68c4('0xab'));_0x519ddb[_0x68c4('0x49')](_0x68c4('0xac'));_0x519ddb['field'](_0x68c4('0xad'));_0x519ddb[_0x68c4('0x49')]('i.UserId');_0x519ddb[_0x68c4('0x49')](_0x68c4('0xae'),_0x68c4('0xaf'));_0x519ddb[_0x68c4('0x49')](_0x68c4('0xb0'),'Contact.lastName');_0x519ddb[_0x68c4('0x49')](_0x68c4('0xb1'),_0x68c4('0xb2'));_0x519ddb[_0x68c4('0x49')](_0x68c4('0xb3'),'Contact.phone');_0x519ddb['field'](_0x68c4('0xb4'),'Contact.mobile');_0x519ddb[_0x68c4('0x49')](_0x68c4('0xb5'),_0x68c4('0xb6'));_0x519ddb[_0x68c4('0x49')](_0x68c4('0xb7'),_0x68c4('0xb8'));_0x519ddb[_0x68c4('0x49')](_0x68c4('0xb9'),_0x68c4('0xba'));_0x519ddb['field'](_0x68c4('0xbb'),_0x68c4('0x23'));}if(_0x199645[_0x68c4('0x15')])_0x519ddb[_0x68c4('0x15')](_0x199645[_0x68c4('0x15')]);if(_0x199645['offset'])_0x519ddb['offset'](_0x199645[_0x68c4('0x17')]);return db[_0x68c4('0x9b')][_0x68c4('0x3c')](_0x519ddb[_0x68c4('0x9a')](),_0x5c75cd);})[_0x68c4('0x1b')](function(_0xdca4c0){if(_0xdca4c0[_0x68c4('0x40')]>0x0)_0x984082[_0x68c4('0x45')](_0x68c4('0xbc'),_['map'](_0xdca4c0,'id'));return db[_0x68c4('0x9b')][_0x68c4('0x3c')](_0x984082[_0x68c4('0x9a')](),_0x5c75cd)[_0x68c4('0x1b')](function(_0xe647ec){var _0x1aea35=_['groupBy'](_0xe647ec,_0x68c4('0xbd'));var _0xa63e5b=[];return db[_0x68c4('0xbe')][_0x68c4('0x28')]({'attributes':[_0x68c4('0xbf')],'raw':!![]})[_0x68c4('0x1b')](function(_0x2798a8){var _0x3d3d64=_0x2798a8[_0x68c4('0xbf')];_0xdca4c0[_0x68c4('0x25')](function(_0x1af896){_0xa63e5b[_0x68c4('0x26')](updateMailInteraction(_0x1af896,_0x5b8209,_0x1aea35,_0x3d3d64));});return BPromise['all'](_0xa63e5b);});});});})[_0x68c4('0x1b')](function(_0x20ff8a){_0x3f6d18[_0x68c4('0xc0')]=_0x20ff8a;return _0x3f6d18;})[_0x68c4('0x1b')](respondWithFilteredResult(_0x49cc23,_0x199645))[_0x68c4('0x2e')](handleError(_0x49cc23,null));};exports[_0x68c4('0xc1')]=function(_0x42c4f1,_0x340b8a){var _0x24072f={'raw':![],'where':{'id':_0x42c4f1[_0x68c4('0xc2')]['id']}},_0x453de3={};_0x453de3[_0x68c4('0x3b')]=_[_0x68c4('0x73')](db['MailInteraction'][_0x68c4('0xc3')]);_0x453de3[_0x68c4('0x3c')]=_['keys'](_0x42c4f1[_0x68c4('0x3c')]);_0x453de3[_0x68c4('0x46')]=_[_0x68c4('0x3d')](_0x453de3[_0x68c4('0x3b')],_0x453de3[_0x68c4('0x3c')]);_0x24072f[_0x68c4('0x3f')]=_[_0x68c4('0x3d')](_0x453de3[_0x68c4('0x3b')],qs['fields'](_0x42c4f1[_0x68c4('0x3c')]['fields']));_0x24072f[_0x68c4('0x3f')]=_0x24072f[_0x68c4('0x3f')][_0x68c4('0x40')]?_0x24072f['attributes']:_0x453de3[_0x68c4('0x3b')];if(_0x42c4f1[_0x68c4('0x3c')][_0x68c4('0xc4')]){_0x24072f['include']=[{'all':!![]}];}_0x24072f=_[_0x68c4('0x9d')]({},_0x24072f,_0x42c4f1['options']);return db[_0x68c4('0x37')][_0x68c4('0x6a')](_0x24072f)[_0x68c4('0x1b')](handleEntityNotFound(_0x340b8a,null))['then'](respondWithResult(_0x340b8a,null))[_0x68c4('0x2e')](handleError(_0x340b8a,null));};exports[_0x68c4('0xc5')]=function(_0x45adf4,_0x39a536){return db[_0x68c4('0x37')][_0x68c4('0xc5')](_0x45adf4['body'],{})[_0x68c4('0x1b')](respondWithResult(_0x39a536,0xc9))['catch'](handleError(_0x39a536,null));};exports[_0x68c4('0x1a')]=function(_0x509843,_0x2e005d){if(_0x509843['body']['id']){delete _0x509843[_0x68c4('0xc6')]['id'];}return db['MailInteraction'][_0x68c4('0x6a')]({'where':{'id':_0x509843[_0x68c4('0xc2')]['id']}})[_0x68c4('0x1b')](handleEntityNotFound(_0x2e005d,null))['then'](saveUpdates(_0x509843[_0x68c4('0xc6')],null))[_0x68c4('0x1b')](respondWithResult(_0x2e005d,null))[_0x68c4('0x2e')](handleError(_0x2e005d,null));};exports[_0x68c4('0x1c')]=function(_0x5be719,_0xb9a133){return db[_0x68c4('0x37')][_0x68c4('0x6a')]({'where':{'id':_0x5be719[_0x68c4('0xc2')]['id']}})[_0x68c4('0x1b')](handleEntityNotFound(_0xb9a133,null))[_0x68c4('0x1b')](removeEntity(_0xb9a133,null))[_0x68c4('0x2e')](handleError(_0xb9a133,null));};exports['describe']=function(_0x20bcf5,_0x4b0d49){return db[_0x68c4('0x37')][_0x68c4('0xc7')]()['then'](respondWithResult(_0x4b0d49,null))[_0x68c4('0x2e')](handleError(_0x4b0d49,null));};exports[_0x68c4('0xc8')]=function(_0x16809d,_0x245e3e){return db[_0x68c4('0x27')][_0x68c4('0x6a')]({'where':{'id':_0x16809d['params']['id']}})[_0x68c4('0x1b')](handleEntityNotFound(_0x245e3e,null))['then'](function(_0x1f90a6){if(_0x1f90a6){return _0x1f90a6[_0x68c4('0xc8')](_0x16809d['body'][_0x68c4('0xc9')],_[_0x68c4('0xca')](_0x16809d[_0x68c4('0xc6')],[_0x68c4('0xc9'),'id'])||{});}})[_0x68c4('0x1b')](respondWithResult(_0x245e3e,null))[_0x68c4('0x2e')](handleError(_0x245e3e,null));};exports['getMessages']=function(_0xa1d682,_0x1970cb){var _0x464aab={'raw':![],'where':{}};var _0x132b7d={};var _0xd4c206={'count':0x0,'rows':[]};return db[_0x68c4('0x37')][_0x68c4('0x28')]({'where':{'id':_0xa1d682['params']['id']}})[_0x68c4('0x1b')](handleEntityNotFound(_0x1970cb,null))[_0x68c4('0x1b')](function(_0x2a01ad){if(_0x2a01ad){_0x132b7d[_0x68c4('0x3b')]=_[_0x68c4('0x73')](db[_0x68c4('0x27')][_0x68c4('0xc3')]);_0x132b7d[_0x68c4('0x3c')]=_[_0x68c4('0x73')](_0xa1d682[_0x68c4('0x3c')]);_0x132b7d[_0x68c4('0x46')]=_[_0x68c4('0x3d')](_0x132b7d[_0x68c4('0x3b')],_0x132b7d[_0x68c4('0x3c')]);_0x464aab[_0x68c4('0x3f')]=_[_0x68c4('0x3d')](_0x132b7d[_0x68c4('0x3b')],qs[_0x68c4('0x3e')](_0xa1d682[_0x68c4('0x3c')][_0x68c4('0x3e')]));_0x464aab[_0x68c4('0x3f')]=_0x464aab[_0x68c4('0x3f')][_0x68c4('0x40')]?_0x464aab[_0x68c4('0x3f')]:_0x132b7d['model'];if(!_0xa1d682[_0x68c4('0x3c')][_0x68c4('0x41')]('nolimit')){_0x464aab[_0x68c4('0x15')]=qs[_0x68c4('0x15')](_0xa1d682['query'][_0x68c4('0x15')]);_0x464aab['offset']=qs[_0x68c4('0x17')](_0xa1d682[_0x68c4('0x3c')][_0x68c4('0x17')]);}_0x464aab['order']=qs['sort'](_0xa1d682[_0x68c4('0x3c')][_0x68c4('0x44')]);_0x464aab['where']=qs['filters'](_[_0x68c4('0x47')](_0xa1d682[_0x68c4('0x3c')],_0x132b7d['filters']));_0x464aab[_0x68c4('0x45')][_0x68c4('0xbd')]=_0x2a01ad['id'];if(_0xa1d682[_0x68c4('0x3c')][_0x68c4('0x81')]){_0x464aab[_0x68c4('0x45')]=_[_0x68c4('0x9d')](_0x464aab[_0x68c4('0x45')],{'$or':_['map'](_0x464aab['attributes'],function(_0x541297){var _0x49e06b={};_0x49e06b[_0x541297]={'$like':'%'+_0xa1d682[_0x68c4('0x3c')][_0x68c4('0x81')]+'%'};return _0x49e06b;})});}if(_0xa1d682[_0x68c4('0x3c')][_0x68c4('0xcb')]){var _0x2d2c04=_0xa1d682[_0x68c4('0x3c')][_0x68c4('0xcb')][_0x68c4('0x66')](',');var _0x207bae={};_0x207bae[_0x2d2c04[0x0]]={'$gte':moment(_0x2d2c04[0x1])['format'](_0x68c4('0xcc'))};_0x464aab['where']=_[_0x68c4('0x9d')](_0x464aab[_0x68c4('0x45')],_0x207bae);}_0x464aab=_[_0x68c4('0x9d')]({},_0x464aab,_0xa1d682[_0x68c4('0xcd')]);return db[_0x68c4('0x27')]['count']({'where':_0x464aab[_0x68c4('0x45')]})['then'](function(_0x441037){_0xd4c206['count']=_0x441037;if(_0xa1d682[_0x68c4('0x3c')][_0x68c4('0xc4')]){_0x464aab[_0x68c4('0xce')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x464aab);})['then'](function(_0x2d58a9){if(_0xa1d682['query'][_0x68c4('0xcf')]===_0x68c4('0xd0')){for(var _0x1a1c13=0x0;_0x1a1c13<_0x2d58a9[_0x68c4('0x40')];_0x1a1c13++){_0x2d58a9[_0x1a1c13][_0x68c4('0xc6')]=juice(_0x2d58a9[_0x1a1c13][_0x68c4('0xc6')]);}}_0xd4c206[_0x68c4('0xc0')]=_0x2d58a9;return _0xd4c206;});}})[_0x68c4('0x1b')](respondWithFilteredResult(_0x1970cb,_0x464aab))[_0x68c4('0x2e')](handleError(_0x1970cb,null));};exports['addTags']=function(_0x94d8b2,_0x4087ad){return db[_0x68c4('0x37')]['find']({'where':{'id':_0x94d8b2['params']['id']}})[_0x68c4('0x1b')](handleEntityNotFound(_0x4087ad,null))[_0x68c4('0x1b')](function(_0x4854e1){if(_0x4854e1){return _0x4854e1[_0x68c4('0xd1')](_0x94d8b2[_0x68c4('0xc6')]['ids'],_[_0x68c4('0xca')](_0x94d8b2['body'],[_0x68c4('0xc9'),'id'])||{})[_0x68c4('0xd2')](function(){return db[_0x68c4('0x6d')]['findAll']({'attributes':['id',_0x68c4('0x1f'),_0x68c4('0x4a')],'where':{'id':_0x94d8b2[_0x68c4('0xc6')][_0x68c4('0xc9')]}});})[_0x68c4('0x1b')](function(_0x550791){socket[_0x68c4('0xd3')]('mailInteractionTags:save',{'id':Number(_0x94d8b2[_0x68c4('0xc2')]['id']),'tags':_0x550791||[]});return{'id':Number(_0x94d8b2[_0x68c4('0xc2')]['id']),'tags':_0x550791||[]};});}})[_0x68c4('0x1b')](respondWithResult(_0x4087ad,null))[_0x68c4('0x2e')](handleError(_0x4087ad,null));};exports[_0x68c4('0xd4')]=function(_0x5b4ada,_0x585214){return db[_0x68c4('0x37')][_0x68c4('0x6a')]({'where':{'id':_0x5b4ada[_0x68c4('0xc2')]['id']}})[_0x68c4('0x1b')](handleEntityNotFound(_0x585214,null))[_0x68c4('0x1b')](function(_0x5024d1){if(_0x5024d1){return _0x5024d1['removeTags'](_0x5b4ada[_0x68c4('0x3c')]['ids']);}})['then'](respondWithStatusCode(_0x585214,null))[_0x68c4('0x2e')](handleError(_0x585214,null));};exports['download']=function(_0x3bb370,_0xdd470){var _0x572772=moment()[_0x68c4('0xd5')]()[_0x68c4('0x9a')]();var _0x13cf3a=path['join'](config[_0x68c4('0xd6')],_0x68c4('0xd7'),_0x68c4('0xd8'),_0x68c4('0xd9'));var _0x169611=path[_0x68c4('0xda')](config['root'],_0x68c4('0xd7'),_0x68c4('0xd8'),_0x68c4('0xdb'));var _0x3c28de=path[_0x68c4('0xda')](_0x13cf3a,_0x572772);var _0x11db0e=util[_0x68c4('0xdc')]('transcript-%d-%s.zip',_0x3bb370[_0x68c4('0xc2')]['id'],_0x572772);var _0x3877d4=path[_0x68c4('0xda')](_0x13cf3a,_0x11db0e);var _0x155503=[];if(_0x3bb370[_0x68c4('0x3c')][_0x68c4('0xdb')]){_0x155503[_0x68c4('0x26')]({'model':db[_0x68c4('0xdd')],'as':_0x68c4('0xde'),'raw':!![]});}var _0x38699e=[{'model':db[_0x68c4('0x27')],'as':'Messages','attributes':['id',_0x68c4('0xc6'),_0x68c4('0x4b'),'to','cc',_0x68c4('0xdf'),'subject',_0x68c4('0xe0')],'where':{'secret':![]},'order':qs[_0x68c4('0x44')]('id'),'include':_0x155503}];return db['MailInteraction'][_0x68c4('0x6a')]({'where':{'id':_0x3bb370[_0x68c4('0xc2')]['id']},'include':_0x38699e})[_0x68c4('0x1b')](handleEntityNotFound(_0xdd470,null))[_0x68c4('0x1b')](function(_0x4642cc){if(_0x4642cc&&_0x4642cc[_0x68c4('0xe1')]){var _0x584fbf=_0x4642cc[_0x68c4('0xe2')]({'plain':!![]});fs[_0x68c4('0xe3')](_0x3c28de);return BPromise['each'](_0x584fbf['Messages'],function(_0x28dcc4,_0xffc880){var _0x80a240={'from':_0x28dcc4[_0x68c4('0x4b')],'to':_0x28dcc4['to'],'subject':_0x28dcc4['subject'],'html':htmlEntities['decode'](_0x28dcc4['body']),'headers':{'Date':moment(_0x28dcc4[_0x68c4('0xe0')])['format'](_0x68c4('0xe4'))},'attachments':[]};if(_0x28dcc4['cc']){_0x80a240[_0x68c4('0xe5')]['Cc']=_0x28dcc4['cc'];}if(_0x28dcc4[_0x68c4('0xdf')]){_0x80a240[_0x68c4('0xe5')][_0x68c4('0xe6')]=_0x28dcc4['bcc'];}return new BPromise(function(_0xfe4060,_0x44b21c){if(_0x28dcc4[_0x68c4('0xde')]){for(var _0x5b49bf=0x0;_0x5b49bf<_0x28dcc4[_0x68c4('0xde')][_0x68c4('0x40')];_0x5b49bf++){var _0x32e3ab=_0x28dcc4[_0x68c4('0xde')][_0x5b49bf];var _0x433d01=path[_0x68c4('0xda')](_0x169611,_0x32e3ab[_0x68c4('0xe7')]);if(fs[_0x68c4('0xe8')](_0x433d01)){_0x80a240[_0x68c4('0xdb')][_0x68c4('0x26')]({'name':_0x32e3ab['name'],'contentType':_0x32e3ab[_0x68c4('0x39')],'data':fs[_0x68c4('0xe9')](_0x433d01)});}}}emlformat['build'](_0x80a240,function(_0x55e5c4,_0x29ad0e){if(_0x55e5c4)return _0x44b21c(_0x55e5c4);fs[_0x68c4('0xea')](path['join'](_0x3c28de,util[_0x68c4('0xdc')](_0x68c4('0xeb'),_0xffc880)),_0x29ad0e);return _0xfe4060(_0x29ad0e);});});})['then'](function(){return new BPromise(function(_0x3457bb,_0x1f00c5){zipdir(_0x3c28de,{'saveTo':_0x3877d4},function(_0x2616c3,_0x2501eb){if(_0x2616c3)return _0x1f00c5(_0x2616c3);return _0x3457bb(_0x2501eb);});})['then'](function(){return new BPromise(function(_0x55ea79,_0x5ce1aa){rimraf(_0x3c28de,function(_0x52a09c){if(_0x52a09c)_0x5ce1aa(_0x52a09c);return _0x55ea79();});});})[_0x68c4('0x1b')](function(){return _0xdd470[_0x68c4('0xec')](_0x3877d4,_0x11db0e,function(_0x405f02){if(!_0x405f02)fs[_0x68c4('0xed')](_0x3877d4);});});});}else{return _0xdd470[_0x68c4('0x1d')](0xc8);}})[_0x68c4('0x2e')](handleError(_0xdd470,null));}; \ No newline at end of file +var _0x8daf=['null','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','user','agent','getMailAccounts','isEmpty','i.MailAccountId\x20IS\x20NULL','role','toString','sequelize','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.UserId','c.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','push','all','rows','show','includeAll','options','create','body','params','describe','addMessage','omit','getMessages','hasOwnProperty','MailInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','true','addTags','ids','emit','mailInteractionTags:save','download','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','Attachment','Attachments','bcc','subject','Messages','get','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','bluebird','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','html-entities','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','status','error','stack','name','Users','fullname','TagIds','Tags','split','forEach','MailMessage','findOne','out','-id','plainBody','catch','waiting','answered','unmanaged','total','closed','UserId','talking','index','map','MailInteraction','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','nolimit','order','sort','filters','pick','field','color','from','tools_tags','select','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','expr','search','parseSearch','conditions','length','find','unreadMessages','value','`\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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','text','some','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?'];(function(_0x257e65,_0x3f4a68){var _0x3eef2f=function(_0x1c61e2){while(--_0x1c61e2){_0x257e65['push'](_0x257e65['shift']());}};_0x3eef2f(++_0x3f4a68);}(_0x8daf,0x15c));var _0xf8da=function(_0x4394f7,_0x43ee7b){_0x4394f7=_0x4394f7-0x0;var _0x340a66=_0x8daf[_0x4394f7];return _0x340a66;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0xf8da('0x0'));var util=require(_0xf8da('0x1'));var path=require('path');var fs=require('fs');var _=require(_0xf8da('0x2'));var squel=require(_0xf8da('0x3'));var juice=require(_0xf8da('0x4'));var Redis=require(_0xf8da('0x5'));var qs=require(_0xf8da('0x6'));var as=require(_0xf8da('0x7'));var logger=require(_0xf8da('0x8'))(_0xf8da('0x9'));var config=require(_0xf8da('0xa'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xf8da('0xb'));config['redis']=_[_0xf8da('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf8da('0xd'))(new Redis(config[_0xf8da('0xe')]));require(_0xf8da('0xf'))[_0xf8da('0x10')](socket);function respondWithStatusCode(_0x4463eb,_0x398410){_0x398410=_0x398410||0xcc;return function(_0xdcb4dd){if(_0xdcb4dd){return _0x4463eb[_0xf8da('0x11')](_0x398410);}return _0x4463eb['status'](_0x398410)[_0xf8da('0x12')]();};}function respondWithResult(_0x381b27,_0x3a436d){_0x3a436d=_0x3a436d||0xc8;return function(_0x1cfce2){if(_0x1cfce2){return _0x381b27['status'](_0x3a436d)[_0xf8da('0x13')](_0x1cfce2);}};}function respondWithFilteredResult(_0x4e838e,_0xed96b0){return function(_0x1a93ab){if(_0x1a93ab){var _0x259b96=typeof _0xed96b0[_0xf8da('0x14')]===_0xf8da('0x15')&&typeof _0xed96b0['limit']===_0xf8da('0x15');var _0x4296ff=_0x1a93ab[_0xf8da('0x16')];var _0x3fa368=_0x259b96?0x0:_0xed96b0[_0xf8da('0x14')];var _0x41257e=_0x259b96?_0x1a93ab[_0xf8da('0x16')]:_0xed96b0['offset']+_0xed96b0[_0xf8da('0x17')];var _0x4c1ff1;if(_0x41257e>=_0x4296ff){_0x41257e=_0x4296ff;_0x4c1ff1=0xc8;}else{_0x4c1ff1=0xce;}_0x4e838e['status'](_0x4c1ff1);return _0x4e838e[_0xf8da('0x18')](_0xf8da('0x19'),_0x3fa368+'-'+_0x41257e+'/'+_0x4296ff)['json'](_0x1a93ab);}return null;};}function saveUpdates(_0x3e427){return function(_0x32b378){if(_0x32b378){return _0x32b378[_0xf8da('0x1a')](_0x3e427)[_0xf8da('0x1b')](function(_0x22ac84){return _0x22ac84;});}return null;};}function removeEntity(_0x2ac916){return function(_0x7159cf){if(_0x7159cf){return _0x7159cf[_0xf8da('0x1c')]()['then'](function(){_0x2ac916[_0xf8da('0x1d')](0xcc)[_0xf8da('0x12')]();});}};}function handleEntityNotFound(_0x53ad22){return function(_0x2f9ecc){if(!_0x2f9ecc){_0x53ad22[_0xf8da('0x11')](0x194);}return _0x2f9ecc;};}function handleError(_0x4ca909,_0x5a295f){_0x5a295f=_0x5a295f||0x1f4;return function(_0x351640){logger[_0xf8da('0x1e')](_0x351640[_0xf8da('0x1f')]);if(_0x351640[_0xf8da('0x20')]){delete _0x351640['name'];}_0x4ca909['status'](_0x5a295f)['send'](_0x351640);};}function getInteractionUsers(_0x573429,_0x2d6dc2){return new BPromise(function(_0x2b513e,_0x43934c){try{if(_0x2d6dc2[_0x573429['id']]){_0x573429[_0xf8da('0x21')]=_['map'](_0x2d6dc2[_0x573429['id']],function(_0x1270d2){return{'id':_0x1270d2['id'],'fullname':_0x1270d2[_0xf8da('0x22')]};});}}catch(_0x4326b1){_0x43934c(_0x4326b1);}_0x2b513e(_0x573429);});}function getInteractionTags(_0x550590,_0x252cda){return new BPromise(function(_0x5577f0,_0x2c0866){try{if(_0x550590[_0xf8da('0x23')]){_0x550590[_0xf8da('0x24')]=[];_0x550590[_0xf8da('0x23')][_0xf8da('0x25')](',')[_0xf8da('0x26')](function(_0x35544b){_0x550590[_0xf8da('0x24')]['push'](_0x252cda[_0x35544b]);});}delete _0x550590[_0xf8da('0x23')];}catch(_0x552ed3){_0x2c0866(_0x552ed3);}_0x5577f0(_0x550590);});}function getLastMessageText(_0x5b3cdc){return new BPromise(function(_0x1e82ef,_0x1aa03a){return db[_0xf8da('0x27')][_0xf8da('0x28')]({'where':{'$and':[{'MailInteractionId':_0x5b3cdc['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xf8da('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xf8da('0x2a'),'raw':!![]})['then'](function(_0x56ea88){if(_0x56ea88&&_0x56ea88['plainBody']){_0x5b3cdc['lastMsgText']=_['trimStart'](_0x56ea88[_0xf8da('0x2b')]);}_0x1e82ef(_0x5b3cdc);})['catch'](function(_0x3a8917){_0x1aa03a(_0x3a8917);});});}function updateMailInteraction(_0x109741,_0x27552f,_0x5abd5e,_0x506aab){return new BPromise(function(_0x1ac07d,_0x44a22d){return getInteractionUsers(_0x109741,_0x5abd5e)[_0xf8da('0x1b')](function(_0x150e83){return getInteractionTags(_0x150e83,_0x27552f);})[_0xf8da('0x1b')](function(_0x3d8fce){return getStateInteraction(_0x3d8fce);})['then'](function(_0x112788){if(_0x506aab){_0x1ac07d(getLastMessageText(_0x112788));}else{_0x1ac07d(_0x112788);}})[_0xf8da('0x2c')](function(_0x12d192){_0x44a22d(_0x12d192);});});}function getStateInteraction(_0x410904){return new BPromise(function(_0x8036b3){_0x410904[_0xf8da('0x2d')]=0x0;_0x410904['talking']=0x0;_0x410904[_0xf8da('0x2e')]=0x0;_0x410904[_0xf8da('0x2f')]=0x0;_0x410904[_0xf8da('0x30')]=0x0;if(!_0x410904[_0xf8da('0x31')]&&!_0x410904['UserId']){_0x410904[_0xf8da('0x2d')]+=0x1;}if(!_0x410904['closed']&&_0x410904[_0xf8da('0x32')]){_0x410904['talking']+=0x1;if(_0x410904[_0xf8da('0x2d')]){_0x410904['waiting']-=0x1;}}if(_0x410904[_0xf8da('0x31')]&&_0x410904[_0xf8da('0x32')]){_0x410904[_0xf8da('0x2e')]+=0x1;if(_0x410904[_0xf8da('0x33')]){_0x410904[_0xf8da('0x33')]-=0x1;}}if(_0x410904[_0xf8da('0x31')]&&!_0x410904['UserId']){_0x410904[_0xf8da('0x2f')]+=0x1;if(_0x410904[_0xf8da('0x2d')]){_0x410904[_0xf8da('0x2d')]-=0x1;}}_0x410904['total']+=0x1;_0x8036b3(_0x410904);});}exports[_0xf8da('0x34')]=function(_0x3eb5b1,_0x9b370e){var _0x4a8c7e={},_0x278d44={},_0x3b52a5={'count':0x0,'rows':[]};var _0x5cb4a1=_[_0xf8da('0x35')](db[_0xf8da('0x36')][_0xf8da('0x37')],function(_0x5edf40){return{'name':_0x5edf40[_0xf8da('0x38')],'type':_0x5edf40[_0xf8da('0x39')][_0xf8da('0x3a')]};});_0x278d44[_0xf8da('0x3b')]=_[_0xf8da('0x35')](_0x5cb4a1,_0xf8da('0x20'));_0x278d44['query']=_[_0xf8da('0x3c')](_0x3eb5b1[_0xf8da('0x3d')]);_0x278d44['filters']=_['intersection'](_0x278d44[_0xf8da('0x3b')],_0x278d44[_0xf8da('0x3d')]);_0x4a8c7e[_0xf8da('0x3e')]=_[_0xf8da('0x3f')](_0x278d44['model'],qs[_0xf8da('0x40')](_0x3eb5b1[_0xf8da('0x3d')][_0xf8da('0x40')]));_0x4a8c7e[_0xf8da('0x3e')]=_0x4a8c7e['attributes']['length']?_0x4a8c7e[_0xf8da('0x3e')]:_0x278d44['model'];if(!_0x3eb5b1[_0xf8da('0x3d')]['hasOwnProperty'](_0xf8da('0x41'))){_0x4a8c7e[_0xf8da('0x17')]=qs[_0xf8da('0x17')](_0x3eb5b1[_0xf8da('0x3d')][_0xf8da('0x17')]);_0x4a8c7e[_0xf8da('0x14')]=qs[_0xf8da('0x14')](_0x3eb5b1['query'][_0xf8da('0x14')]);}_0x4a8c7e[_0xf8da('0x42')]=qs['sort'](_0x3eb5b1[_0xf8da('0x3d')][_0xf8da('0x43')]);_0x4a8c7e['where']=qs[_0xf8da('0x44')](_[_0xf8da('0x45')](_0x3eb5b1[_0xf8da('0x3d')],_0x278d44[_0xf8da('0x44')]),_0x5cb4a1);var _0xe58b07=[];var _0x4c7066=squel['select']()[_0xf8da('0x46')]('id')['field'](_0xf8da('0x20'))['field'](_0xf8da('0x47'))[_0xf8da('0x48')](_0xf8da('0x49'));var _0x41d271=squel[_0xf8da('0x4a')]()[_0xf8da('0x46')](_0xf8da('0x4b'))[_0xf8da('0x46')]('u.fullname')[_0xf8da('0x46')](_0xf8da('0x4c'))['from'](_0xf8da('0x4d'),'ui')[_0xf8da('0x4e')](_0xf8da('0x4f'),'u',_0xf8da('0x50'));var _0x2d0976=squel['select']()['from']('mail_interactions','i')['left_join'](_0xf8da('0x51'),'c',_0xf8da('0x52'))['left_join']('users','o',_0xf8da('0x53'))[_0xf8da('0x4e')](_0xf8da('0x54'),'a',_0xf8da('0x55'))[_0xf8da('0x4e')](_0xf8da('0x56'),'me',_0xf8da('0x57'))[_0xf8da('0x4e')](_0xf8da('0x58'),'it','it.MailInteractionId\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x1dd1a6=squel[_0xf8da('0x59')]();var _0x3acf19=[];var _0x3c4cb2=squel[_0xf8da('0x59')]();var _0x57d47f;if(_0x3eb5b1['query'][_0xf8da('0x5a')]){_0x57d47f=as[_0xf8da('0x5b')](_0x3eb5b1[_0xf8da('0x3d')][_0xf8da('0x5a')]);var _0xdcab35=_0x57d47f['sqlOperator'];for(var _0x3e153d=0x0;_0x3e153d<_0x57d47f[_0xf8da('0x5c')][_0xf8da('0x5d')];_0x3e153d++){var _0xff9a10=_0x57d47f[_0xf8da('0x5c')][_0x3e153d];var _0x10b788='i';var _0x43f5c7=_[_0xf8da('0x5e')](_0x5cb4a1,[_0xf8da('0x20'),_0xff9a10[_0xf8da('0x46')]]);if(!_0x43f5c7){switch(_0xff9a10['field']){case _0xf8da('0x5f'):if(_0xff9a10[_0xf8da('0x60')]==0x1){_0x2d0976['having']('`'+_0xff9a10['field']+_0xf8da('0x61'));}else{_0x2d0976['having']('`'+_0xff9a10['field']+_0xf8da('0x62'));}break;case _0xf8da('0x63'):if(_0xff9a10[_0xf8da('0x64')]===_0xf8da('0x65')){if(_0xff9a10[_0xf8da('0x60')]['split']('\x20')[_0xf8da('0x5d')]>0x1){_0x1dd1a6[_0xdcab35](_0xf8da('0x66'),qs['getFullTextValue'](_0xff9a10['value']),null);}else{var _0x3bf346='%'+_0xff9a10[_0xf8da('0x60')]+'%';_0x1dd1a6[_0xdcab35](_0xf8da('0x67'),_0x3bf346,_0x3bf346,_0x3bf346);}}else{_0x43f5c7=_[_0xf8da('0x5e')](_0x5cb4a1,[_0xf8da('0x20'),_0xf8da('0x68')]);_0xff9a10['field']=_0xf8da('0x68');_0x1b945b=as['buildExpression'](_0x10b788,_0x43f5c7['type'],_0xff9a10);_0x1dd1a6[_0xdcab35](_0x1b945b['text'],_0x1b945b[_0xf8da('0x60')][_0xf8da('0x69')],_0x1b945b[_0xf8da('0x60')][_0xf8da('0x12')]);}break;case _0xf8da('0x6a'):var _0x1a58b3=_0xff9a10[_0xf8da('0x60')]['split'](',')[_0xf8da('0x35')](function(_0x40d9f0){return Number(_0x40d9f0);});_0x1a58b3['forEach'](function(_0x56a12f){_0x3c4cb2['or'](_0xf8da('0x6b'),'%,'+_0x56a12f+',%');});_0x3acf19=_[_0xf8da('0x6c')](_0x3acf19,_0x1a58b3);break;case _0xf8da('0x6d'):if(_0xff9a10[_0xf8da('0x64')]===_0xf8da('0x65')){_0x1dd1a6[_0xdcab35](_0xf8da('0x6e'),'%'+_0xff9a10['value']+'%',null);}else{_0x43f5c7=_[_0xf8da('0x5e')](_0x5cb4a1,['name',_0xf8da('0x32')]);_0xff9a10[_0xf8da('0x46')]=_0xf8da('0x32');_0x1b945b=as[_0xf8da('0x6f')](_0x10b788,_0x43f5c7[_0xf8da('0x39')],_0xff9a10);_0x1dd1a6[_0xdcab35](_0x1b945b[_0xf8da('0x70')],_0x1b945b[_0xf8da('0x60')]['start'],_0x1b945b['value'][_0xf8da('0x12')]);}break;case _0xf8da('0x2b'):_0x1b945b=as[_0xf8da('0x6f')]('me',null,_0xff9a10);_0x1dd1a6[_0xdcab35](_0x1b945b[_0xf8da('0x70')],_0x1b945b[_0xf8da('0x60')][_0xf8da('0x69')],_0x1b945b[_0xf8da('0x60')][_0xf8da('0x12')]);break;}}else{var _0x1b945b=as[_0xf8da('0x6f')](_0x10b788,_0x43f5c7[_0xf8da('0x39')],_0xff9a10);_0x1dd1a6[_0xdcab35](_0x1b945b['text'],_0x1b945b[_0xf8da('0x60')][_0xf8da('0x69')],_0x1b945b['value']['end']);}}}else{var _0x1c3558=_(_0x3eb5b1[_0xf8da('0x3d')])[_0xf8da('0x3c')]()['map'](function(_0x5239b7){return _[_0xf8da('0x71')](_0x5cb4a1,[_0xf8da('0x20'),_0x5239b7])?_0x5239b7:undefined;})['compact']()[_0xf8da('0x60')]();if(!_['isEmpty'](_0x1c3558)){_0x1c3558[_0xf8da('0x26')](function(_0x4d0cfe){if(_0x4d0cfe===_0xf8da('0x72')){_0x2d0976['where'](_0xf8da('0x73'),[][_0xf8da('0x74')](_0x3eb5b1[_0xf8da('0x3d')][_0x4d0cfe]));}else if(_0x4d0cfe===_0xf8da('0x75')){var _0x11fdb3=JSON[_0xf8da('0x76')](_0x3eb5b1[_0xf8da('0x3d')][_0x4d0cfe])['$gte'];var _0x7ba011=JSON[_0xf8da('0x76')](_0x3eb5b1[_0xf8da('0x3d')][_0x4d0cfe])[_0xf8da('0x77')];_0x2d0976[_0xf8da('0x78')](_0xf8da('0x79'),_0x11fdb3,_0x7ba011);}else{if(_0x3eb5b1[_0xf8da('0x3d')][_0x4d0cfe]===_0xf8da('0x7a')){_0x2d0976['where']('i.'+_0x4d0cfe+'\x20IS\x20NULL');}else{_0x2d0976['where']('i.'+_0x4d0cfe+'\x20=\x20?',_0x3eb5b1[_0xf8da('0x3d')][_0x4d0cfe]);}}});}if(_0x3eb5b1['query'][_0xf8da('0x7b')]){if(_0x3eb5b1['query'][_0xf8da('0x7b')]==0x1){_0x2d0976[_0xf8da('0x7c')](_0xf8da('0x7d'));}else{_0x2d0976[_0xf8da('0x7c')](_0xf8da('0x7e'));}}if(_0x3eb5b1[_0xf8da('0x3d')][_0xf8da('0x7f')]){_0x3acf19=_[_0xf8da('0x80')](_0x3eb5b1['query'][_0xf8da('0x7f')])?_0x3eb5b1[_0xf8da('0x3d')]['tag']:new Array(_0x3eb5b1[_0xf8da('0x3d')]['tag']);_0x3acf19['forEach'](function(_0x5a83bf){_0x3c4cb2['or'](_0xf8da('0x6b'),'%,'+_0x5a83bf+',%');});}if(_0x3eb5b1[_0xf8da('0x3d')]['filter']){var _0x18db75=_0x3eb5b1[_0xf8da('0x3d')][_0xf8da('0x81')][_0xf8da('0x82')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x18db75)){_0x1dd1a6['or'](_0xf8da('0x83'),_0x18db75+'%');}else if(qs['isEmail'](_0x18db75)){_0x1dd1a6['or'](_0xf8da('0x84'),_0x18db75+'%');}else{_0x1dd1a6['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x18db75))['or'](_0xf8da('0x85'),qs['getFullTextValue'](_0x18db75));}}}_0x2d0976[_0xf8da('0x78')](_0x1dd1a6);_0x2d0976[_0xf8da('0x86')](_0xf8da('0x87'));var _0x335e14={'type':db[_0xf8da('0x88')]['QueryTypes']['SELECT'],'raw':!![]};var _0x5d36b7=_0x2d0976[_0xf8da('0x89')]();_0x5d36b7[_0xf8da('0x46')](_0xf8da('0x87'));_0x5d36b7[_0xf8da('0x46')](_0xf8da('0x8a'),_0xf8da('0x5f'));if(_0x4a8c7e[_0xf8da('0x42')]){_0x4a8c7e[_0xf8da('0x42')]['forEach'](function(_0x484bff){var _0x8996a5=_0x484bff[0x0]===_0xf8da('0x8b')?_0x484bff[0x0]:'i.'+_0x484bff[0x0];_0x2d0976[_0xf8da('0x42')](_0x8996a5,_0x484bff[0x1]===_0xf8da('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x3acf19)){_0x2d0976['having'](_0x3c4cb2);_0x5d36b7['where'](_0xf8da('0x8d'),_0x3acf19);}BPromise['resolve']()[_0xf8da('0x1b')](function(){if(!_0x57d47f){if(_0x3eb5b1['query'][_0xf8da('0x72')])return;_0x5d36b7['where'](_0xf8da('0x8e'));_0x2d0976[_0xf8da('0x78')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3eb5b1[_0xf8da('0x8f')]['role']!==_0xf8da('0x90'))return;return _0x3eb5b1['user'][_0xf8da('0x91')]({'attributes':['id'],'raw':!![]})[_0xf8da('0x1b')](function(_0x572c6a){if(_[_0xf8da('0x92')](_0x572c6a)){_0x5d36b7[_0xf8da('0x78')](_0xf8da('0x93'));_0x2d0976['where']('i.MailAccountId\x20IS\x20NULL');}else{_0x5d36b7[_0xf8da('0x78')](_0xf8da('0x73'),_[_0xf8da('0x35')](_0x572c6a,'id'));_0x2d0976[_0xf8da('0x78')]('i.MailAccountId\x20IN\x20?',_['map'](_0x572c6a,'id'));}});})[_0xf8da('0x1b')](function(){if(_0x3eb5b1[_0xf8da('0x8f')][_0xf8da('0x94')]===_0xf8da('0x90')&&!_0x57d47f&&!_0x3eb5b1['query'][_0xf8da('0x72')])return[];return db['sequelize'][_0xf8da('0x3d')](_0x5d36b7[_0xf8da('0x95')](),_0x335e14);})[_0xf8da('0x1b')](function(_0x5b7440){_0x3b52a5[_0xf8da('0x16')]=_0x5b7440['length'];if(_0x3b52a5[_0xf8da('0x16')]===0x0)return[];return db[_0xf8da('0x96')][_0xf8da('0x3d')](_0x4c7066[_0xf8da('0x95')](),_0x335e14)[_0xf8da('0x1b')](function(_0x37b2bd){_0xe58b07=_['keyBy'](_0x37b2bd,'id');_0x335e14=_[_0xf8da('0x97')](_0x335e14,{'model':db[_0xf8da('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3eb5b1[_0xf8da('0x3d')][_0xf8da('0x40')]){_0x4a8c7e[_0xf8da('0x3e')][_0xf8da('0x26')](function(_0x4f4e9a){_0x2d0976[_0xf8da('0x46')]('i.'+_0x4f4e9a);});}else{_0x2d0976[_0xf8da('0x46')](_0xf8da('0x8a'),_0xf8da('0x5f'));_0x2d0976[_0xf8da('0x46')]('a.key',_0xf8da('0x98'));_0x2d0976[_0xf8da('0x46')](_0xf8da('0x99'),_0xf8da('0x9a'));_0x2d0976[_0xf8da('0x46')]('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',_0xf8da('0x8b'));_0x2d0976[_0xf8da('0x46')](_0xf8da('0x87'));_0x2d0976[_0xf8da('0x46')](_0xf8da('0x9b'));_0x2d0976[_0xf8da('0x46')](_0xf8da('0x9c'));_0x2d0976[_0xf8da('0x46')](_0xf8da('0x9d'));_0x2d0976['field'](_0xf8da('0x9e'));_0x2d0976[_0xf8da('0x46')](_0xf8da('0x9f'));_0x2d0976['field'](_0xf8da('0xa0'));_0x2d0976[_0xf8da('0x46')]('i.lastMsgDirection');_0x2d0976['field'](_0xf8da('0xa1'));_0x2d0976['field'](_0xf8da('0xa2'));_0x2d0976[_0xf8da('0x46')](_0xf8da('0xa3'));_0x2d0976[_0xf8da('0x46')](_0xf8da('0xa4'));_0x2d0976['field'](_0xf8da('0xa5'));_0x2d0976[_0xf8da('0x46')](_0xf8da('0xa6'));_0x2d0976['field'](_0xf8da('0xa7'));_0x2d0976[_0xf8da('0x46')]('i.MailAccountId');_0x2d0976[_0xf8da('0x46')](_0xf8da('0xa8'));_0x2d0976[_0xf8da('0x46')](_0xf8da('0xa9'),'Contact.firstName');_0x2d0976[_0xf8da('0x46')]('c.lastName',_0xf8da('0xaa'));_0x2d0976['field'](_0xf8da('0xab'),'Contact.email');_0x2d0976[_0xf8da('0x46')](_0xf8da('0xac'),_0xf8da('0xad'));_0x2d0976['field'](_0xf8da('0xae'),_0xf8da('0xaf'));_0x2d0976[_0xf8da('0x46')](_0xf8da('0xb0'),_0xf8da('0xb1'));_0x2d0976['field']('o.fullname',_0xf8da('0xb2'));_0x2d0976[_0xf8da('0x46')](_0xf8da('0xb3'),_0xf8da('0xb4'));_0x2d0976[_0xf8da('0x46')](_0xf8da('0xb5'),'TagIds');}if(_0x4a8c7e[_0xf8da('0x17')])_0x2d0976[_0xf8da('0x17')](_0x4a8c7e[_0xf8da('0x17')]);if(_0x4a8c7e[_0xf8da('0x14')])_0x2d0976['offset'](_0x4a8c7e[_0xf8da('0x14')]);return db[_0xf8da('0x96')][_0xf8da('0x3d')](_0x2d0976['toString'](),_0x335e14);})[_0xf8da('0x1b')](function(_0x4f7fd3){if(_0x4f7fd3['length']>0x0)_0x41d271[_0xf8da('0x78')]('ui.MailInteractionId\x20IN\x20?',_[_0xf8da('0x35')](_0x4f7fd3,'id'));return db[_0xf8da('0x96')]['query'](_0x41d271[_0xf8da('0x95')](),_0x335e14)[_0xf8da('0x1b')](function(_0x27e85f){var _0x441f0a=_[_0xf8da('0xb6')](_0x27e85f,'MailInteractionId');var _0x50ab96=[];return db[_0xf8da('0xb7')][_0xf8da('0x28')]({'attributes':[_0xf8da('0xb8')],'raw':!![]})[_0xf8da('0x1b')](function(_0x58395b){var _0x236b01=_0x58395b[_0xf8da('0xb8')];_0x4f7fd3[_0xf8da('0x26')](function(_0x2e7df3){_0x50ab96[_0xf8da('0xb9')](updateMailInteraction(_0x2e7df3,_0xe58b07,_0x441f0a,_0x236b01));});return BPromise[_0xf8da('0xba')](_0x50ab96);});});});})[_0xf8da('0x1b')](function(_0xcc542e){_0x3b52a5[_0xf8da('0xbb')]=_0xcc542e;return _0x3b52a5;})['then'](respondWithFilteredResult(_0x9b370e,_0x4a8c7e))[_0xf8da('0x2c')](handleError(_0x9b370e,null));};exports[_0xf8da('0xbc')]=function(_0x343eed,_0x2e8922){var _0x3e0eed={'raw':![],'where':{'id':_0x343eed['params']['id']}},_0x4a1b7c={};_0x4a1b7c['model']=_[_0xf8da('0x3c')](db[_0xf8da('0x36')][_0xf8da('0x37')]);_0x4a1b7c['query']=_[_0xf8da('0x3c')](_0x343eed['query']);_0x4a1b7c['filters']=_['intersection'](_0x4a1b7c[_0xf8da('0x3b')],_0x4a1b7c['query']);_0x3e0eed[_0xf8da('0x3e')]=_[_0xf8da('0x3f')](_0x4a1b7c[_0xf8da('0x3b')],qs['fields'](_0x343eed[_0xf8da('0x3d')][_0xf8da('0x40')]));_0x3e0eed[_0xf8da('0x3e')]=_0x3e0eed[_0xf8da('0x3e')][_0xf8da('0x5d')]?_0x3e0eed['attributes']:_0x4a1b7c[_0xf8da('0x3b')];if(_0x343eed[_0xf8da('0x3d')][_0xf8da('0xbd')]){_0x3e0eed['include']=[{'all':!![]}];}_0x3e0eed=_['merge']({},_0x3e0eed,_0x343eed[_0xf8da('0xbe')]);return db[_0xf8da('0x36')][_0xf8da('0x5e')](_0x3e0eed)[_0xf8da('0x1b')](handleEntityNotFound(_0x2e8922,null))[_0xf8da('0x1b')](respondWithResult(_0x2e8922,null))[_0xf8da('0x2c')](handleError(_0x2e8922,null));};exports[_0xf8da('0xbf')]=function(_0x116c43,_0x36987f){return db[_0xf8da('0x36')][_0xf8da('0xbf')](_0x116c43[_0xf8da('0xc0')],{})[_0xf8da('0x1b')](respondWithResult(_0x36987f,0xc9))[_0xf8da('0x2c')](handleError(_0x36987f,null));};exports[_0xf8da('0x1a')]=function(_0x1f5976,_0x5dbfe6){if(_0x1f5976['body']['id']){delete _0x1f5976[_0xf8da('0xc0')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x1f5976[_0xf8da('0xc1')]['id']}})[_0xf8da('0x1b')](handleEntityNotFound(_0x5dbfe6,null))[_0xf8da('0x1b')](saveUpdates(_0x1f5976[_0xf8da('0xc0')],null))['then'](respondWithResult(_0x5dbfe6,null))[_0xf8da('0x2c')](handleError(_0x5dbfe6,null));};exports[_0xf8da('0x1c')]=function(_0x12efe9,_0x2b6435){return db[_0xf8da('0x36')][_0xf8da('0x5e')]({'where':{'id':_0x12efe9[_0xf8da('0xc1')]['id']}})[_0xf8da('0x1b')](handleEntityNotFound(_0x2b6435,null))['then'](removeEntity(_0x2b6435,null))['catch'](handleError(_0x2b6435,null));};exports[_0xf8da('0xc2')]=function(_0x2d58bd,_0x4edc97){return db['MailInteraction'][_0xf8da('0xc2')]()['then'](respondWithResult(_0x4edc97,null))[_0xf8da('0x2c')](handleError(_0x4edc97,null));};exports['addMessage']=function(_0x5de64e,_0x492f23){return db[_0xf8da('0x27')]['find']({'where':{'id':_0x5de64e[_0xf8da('0xc1')]['id']}})['then'](handleEntityNotFound(_0x492f23,null))['then'](function(_0xc9ea96){if(_0xc9ea96){return _0xc9ea96[_0xf8da('0xc3')](_0x5de64e['body']['ids'],_[_0xf8da('0xc4')](_0x5de64e[_0xf8da('0xc0')],['ids','id'])||{});}})[_0xf8da('0x1b')](respondWithResult(_0x492f23,null))[_0xf8da('0x2c')](handleError(_0x492f23,null));};exports[_0xf8da('0xc5')]=function(_0x2c1337,_0x27b09a){var _0x1fda2c={'raw':![],'where':{}};var _0x4d7ef3={};var _0x1a7f6b={'count':0x0,'rows':[]};return db[_0xf8da('0x36')][_0xf8da('0x28')]({'where':{'id':_0x2c1337['params']['id']}})[_0xf8da('0x1b')](handleEntityNotFound(_0x27b09a,null))[_0xf8da('0x1b')](function(_0x167192){if(_0x167192){_0x4d7ef3[_0xf8da('0x3b')]=_[_0xf8da('0x3c')](db[_0xf8da('0x27')][_0xf8da('0x37')]);_0x4d7ef3['query']=_['keys'](_0x2c1337[_0xf8da('0x3d')]);_0x4d7ef3[_0xf8da('0x44')]=_[_0xf8da('0x3f')](_0x4d7ef3[_0xf8da('0x3b')],_0x4d7ef3[_0xf8da('0x3d')]);_0x1fda2c[_0xf8da('0x3e')]=_['intersection'](_0x4d7ef3[_0xf8da('0x3b')],qs[_0xf8da('0x40')](_0x2c1337[_0xf8da('0x3d')][_0xf8da('0x40')]));_0x1fda2c[_0xf8da('0x3e')]=_0x1fda2c[_0xf8da('0x3e')][_0xf8da('0x5d')]?_0x1fda2c[_0xf8da('0x3e')]:_0x4d7ef3[_0xf8da('0x3b')];if(!_0x2c1337[_0xf8da('0x3d')][_0xf8da('0xc6')]('nolimit')){_0x1fda2c[_0xf8da('0x17')]=qs['limit'](_0x2c1337['query'][_0xf8da('0x17')]);_0x1fda2c['offset']=qs[_0xf8da('0x14')](_0x2c1337[_0xf8da('0x3d')][_0xf8da('0x14')]);}_0x1fda2c[_0xf8da('0x42')]=qs['sort'](_0x2c1337[_0xf8da('0x3d')]['sort']);_0x1fda2c[_0xf8da('0x78')]=qs[_0xf8da('0x44')](_[_0xf8da('0x45')](_0x2c1337[_0xf8da('0x3d')],_0x4d7ef3[_0xf8da('0x44')]));_0x1fda2c[_0xf8da('0x78')][_0xf8da('0xc7')]=_0x167192['id'];if(_0x2c1337['query'][_0xf8da('0x81')]){_0x1fda2c[_0xf8da('0x78')]=_[_0xf8da('0x97')](_0x1fda2c[_0xf8da('0x78')],{'$or':_[_0xf8da('0x35')](_0x1fda2c[_0xf8da('0x3e')],function(_0x90f0c5){var _0x15fc33={};_0x15fc33[_0x90f0c5]={'$like':'%'+_0x2c1337['query'][_0xf8da('0x81')]+'%'};return _0x15fc33;})});}if(_0x2c1337[_0xf8da('0x3d')][_0xf8da('0xc8')]){var _0x53c43a=_0x2c1337[_0xf8da('0x3d')][_0xf8da('0xc8')]['split'](',');var _0x553b8e={};_0x553b8e[_0x53c43a[0x0]]={'$gte':moment(_0x53c43a[0x1])[_0xf8da('0xc9')](_0xf8da('0xca'))};_0x1fda2c[_0xf8da('0x78')]=_[_0xf8da('0x97')](_0x1fda2c[_0xf8da('0x78')],_0x553b8e);}_0x1fda2c=_[_0xf8da('0x97')]({},_0x1fda2c,_0x2c1337[_0xf8da('0xbe')]);return db[_0xf8da('0x27')][_0xf8da('0x16')]({'where':_0x1fda2c[_0xf8da('0x78')]})[_0xf8da('0x1b')](function(_0x1c7584){_0x1a7f6b[_0xf8da('0x16')]=_0x1c7584;if(_0x2c1337['query'][_0xf8da('0xbd')]){_0x1fda2c[_0xf8da('0xcb')]=[{'all':!![]}];}return db['MailMessage'][_0xf8da('0xcc')](_0x1fda2c);})['then'](function(_0x50bb87){if(_0x2c1337[_0xf8da('0x3d')]['inlineCss']===_0xf8da('0xcd')){for(var _0x493821=0x0;_0x493821<_0x50bb87[_0xf8da('0x5d')];_0x493821++){_0x50bb87[_0x493821][_0xf8da('0xc0')]=juice(_0x50bb87[_0x493821]['body']);}}_0x1a7f6b['rows']=_0x50bb87;return _0x1a7f6b;});}})[_0xf8da('0x1b')](respondWithFilteredResult(_0x27b09a,_0x1fda2c))[_0xf8da('0x2c')](handleError(_0x27b09a,null));};exports[_0xf8da('0xce')]=function(_0x2748d,_0xae1cd7){return db['MailInteraction'][_0xf8da('0x5e')]({'where':{'id':_0x2748d[_0xf8da('0xc1')]['id']}})['then'](handleEntityNotFound(_0xae1cd7,null))[_0xf8da('0x1b')](function(_0x1ef47e){if(_0x1ef47e){return _0x1ef47e['setTags'](_0x2748d['body'][_0xf8da('0xcf')],_[_0xf8da('0xc4')](_0x2748d[_0xf8da('0xc0')],[_0xf8da('0xcf'),'id'])||{})['spread'](function(){return db[_0xf8da('0x6a')][_0xf8da('0xcc')]({'attributes':['id','name',_0xf8da('0x47')],'where':{'id':_0x2748d[_0xf8da('0xc0')][_0xf8da('0xcf')]}});})[_0xf8da('0x1b')](function(_0x4aa4a6){socket[_0xf8da('0xd0')](_0xf8da('0xd1'),{'id':Number(_0x2748d[_0xf8da('0xc1')]['id']),'tags':_0x4aa4a6||[]});return{'id':Number(_0x2748d[_0xf8da('0xc1')]['id']),'tags':_0x4aa4a6||[]};});}})[_0xf8da('0x1b')](respondWithResult(_0xae1cd7,null))[_0xf8da('0x2c')](handleError(_0xae1cd7,null));};exports['removeTags']=function(_0x2442a6,_0x951f3a){return db['MailInteraction']['find']({'where':{'id':_0x2442a6[_0xf8da('0xc1')]['id']}})[_0xf8da('0x1b')](handleEntityNotFound(_0x951f3a,null))[_0xf8da('0x1b')](function(_0x275b1c){if(_0x275b1c){return _0x275b1c['removeTags'](_0x2442a6[_0xf8da('0x3d')][_0xf8da('0xcf')]);}})['then'](respondWithStatusCode(_0x951f3a,null))[_0xf8da('0x2c')](handleError(_0x951f3a,null));};exports[_0xf8da('0xd2')]=function(_0x28b58e,_0x48386d){var _0x3a3ee2=moment()['unix']()['toString']();var _0x156745=path['join'](config[_0xf8da('0xd3')],_0xf8da('0xd4'),_0xf8da('0xd5'),_0xf8da('0xd6'));var _0x142167=path[_0xf8da('0xd7')](config['root'],_0xf8da('0xd4'),_0xf8da('0xd5'),_0xf8da('0xd8'));var _0x39d377=path[_0xf8da('0xd7')](_0x156745,_0x3a3ee2);var _0x431f87=util[_0xf8da('0xc9')](_0xf8da('0xd9'),_0x28b58e[_0xf8da('0xc1')]['id'],_0x3a3ee2);var _0x47e3e5=path[_0xf8da('0xd7')](_0x156745,_0x431f87);var _0x44f63e=[];if(_0x28b58e[_0xf8da('0x3d')][_0xf8da('0xd8')]){_0x44f63e['push']({'model':db[_0xf8da('0xda')],'as':_0xf8da('0xdb'),'raw':!![]});}var _0x42382d=[{'model':db['MailMessage'],'as':'Messages','attributes':['id',_0xf8da('0xc0'),_0xf8da('0x48'),'to','cc',_0xf8da('0xdc'),_0xf8da('0xdd'),'createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x44f63e}];return db['MailInteraction']['find']({'where':{'id':_0x28b58e[_0xf8da('0xc1')]['id']},'include':_0x42382d})[_0xf8da('0x1b')](handleEntityNotFound(_0x48386d,null))[_0xf8da('0x1b')](function(_0x340e5b){if(_0x340e5b&&_0x340e5b[_0xf8da('0xde')]){var _0x4cfd07=_0x340e5b[_0xf8da('0xdf')]({'plain':!![]});fs['mkdirSync'](_0x39d377);return BPromise[_0xf8da('0xe0')](_0x4cfd07[_0xf8da('0xde')],function(_0x270a08,_0x4e4f2d){var _0x3c43e5={'from':_0x270a08[_0xf8da('0x48')],'to':_0x270a08['to'],'subject':_0x270a08[_0xf8da('0xdd')],'html':htmlEntities[_0xf8da('0xe1')](_0x270a08[_0xf8da('0xc0')]),'headers':{'Date':moment(_0x270a08['createdAt'])['format'](_0xf8da('0xe2'))},'attachments':[]};if(_0x270a08['cc']){_0x3c43e5['headers']['Cc']=_0x270a08['cc'];}if(_0x270a08[_0xf8da('0xdc')]){_0x3c43e5[_0xf8da('0xe3')][_0xf8da('0xe4')]=_0x270a08[_0xf8da('0xdc')];}return new BPromise(function(_0x4e5cbf,_0x3552ce){if(_0x270a08['Attachments']){for(var _0x5e08c4=0x0;_0x5e08c4<_0x270a08[_0xf8da('0xdb')][_0xf8da('0x5d')];_0x5e08c4++){var _0xfc86c6=_0x270a08[_0xf8da('0xdb')][_0x5e08c4];var _0x4da93e=path[_0xf8da('0xd7')](_0x142167,_0xfc86c6[_0xf8da('0xe5')]);if(fs[_0xf8da('0xe6')](_0x4da93e)){_0x3c43e5[_0xf8da('0xd8')][_0xf8da('0xb9')]({'name':_0xfc86c6[_0xf8da('0x20')],'contentType':_0xfc86c6[_0xf8da('0x39')],'data':fs['readFileSync'](_0x4da93e)});}}}emlformat[_0xf8da('0xe7')](_0x3c43e5,function(_0x2b13c9,_0xf5a2df){if(_0x2b13c9)return _0x3552ce(_0x2b13c9);fs[_0xf8da('0xe8')](path[_0xf8da('0xd7')](_0x39d377,util[_0xf8da('0xc9')](_0xf8da('0xe9'),_0x4e4f2d)),_0xf5a2df);return _0x4e5cbf(_0xf5a2df);});});})[_0xf8da('0x1b')](function(){return new BPromise(function(_0x1a17d4,_0x205f68){zipdir(_0x39d377,{'saveTo':_0x47e3e5},function(_0x51d436,_0x2382e8){if(_0x51d436)return _0x205f68(_0x51d436);return _0x1a17d4(_0x2382e8);});})['then'](function(){return new BPromise(function(_0x49ed09,_0x2638a5){rimraf(_0x39d377,function(_0xe63203){if(_0xe63203)_0x2638a5(_0xe63203);return _0x49ed09();});});})[_0xf8da('0x1b')](function(){return _0x48386d['download'](_0x47e3e5,_0x431f87,function(_0x5e0b03){if(!_0x5e0b03)fs[_0xf8da('0xea')](_0x47e3e5);});});});}else{return _0x48386d[_0xf8da('0x11')](0xc8);}})['catch'](handleError(_0x48386d,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 77e7039..6126f35 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 _0x51a6=['setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','save','remove','getUsers'];(function(_0x1912cf,_0x40c457){var _0x40ecad=function(_0xcb4086){while(--_0xcb4086){_0x1912cf['push'](_0x1912cf['shift']());}};_0x40ecad(++_0x40c457);}(_0x51a6,0x1e6));var _0x651a=function(_0x5869f5,_0x176fd5){_0x5869f5=_0x5869f5-0x0;var _0x6beba1=_0x51a6[_0x5869f5];return _0x6beba1;};'use strict';var EventEmitter=require(_0x651a('0x0'));var MailInteraction=require(_0x651a('0x1'))['db'][_0x651a('0x2')];var MailMessage=require(_0x651a('0x1'))['db'][_0x651a('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x651a('0x4'),'afterUpdate':'update','afterDestroy':_0x651a('0x5')};function emitEvent(_0x4c9ac5){return function(_0x4c0ab2,_0xaeb9ff,_0x1e2fb8){_0x4c0ab2[_0x651a('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2c1ded){_0x4c0ab2[_0x651a('0x7')](_0x651a('0x8'),_0x2c1ded[_0x651a('0x9')](function(_0x2c0cb1){return{'id':_0x2c0cb1['id']};}));return MailMessage[_0x651a('0xa')]({'where':{'MailInteractionId':_0x4c0ab2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x47f043){_0x4c0ab2[_0x651a('0x7')](_0x651a('0xb'),_0x47f043[_0x651a('0xc')]);MailInteractionEvents[_0x651a('0xd')](_0x4c9ac5+':'+_0x4c0ab2['id'],_0x4c0ab2);MailInteractionEvents[_0x651a('0xd')](_0x4c9ac5,_0x4c0ab2);_0x1e2fb8(null);})['catch'](_0x1e2fb8(null));};}for(var e in events){if(events[_0x651a('0xe')](e)){var event=events[e];MailInteraction[_0x651a('0xf')](e,emitEvent(event));}}module[_0x651a('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0xd40f=['save','update','getUsers','setDataValue','Users','then','length','emit','catch','hasOwnProperty','hook','exports','MailMessage','setMaxListeners'];(function(_0x5823a0,_0x4221ec){var _0x2cdfd8=function(_0x4c3f30){while(--_0x4c3f30){_0x5823a0['push'](_0x5823a0['shift']());}};_0x2cdfd8(++_0x4221ec);}(_0xd40f,0x15c));var _0xfd40=function(_0x425541,_0x5dec0e){_0x425541=_0x425541-0x0;var _0x455616=_0xd40f[_0x425541];return _0x455616;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0xfd40('0x0')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xfd40('0x1')](0x0);var events={'afterCreate':_0xfd40('0x2'),'afterUpdate':_0xfd40('0x3'),'afterDestroy':'remove'};function emitEvent(_0x43faf0){return function(_0x26fe0d,_0x3592fe,_0x523dc8){_0x26fe0d[_0xfd40('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5609cc){_0x26fe0d[_0xfd40('0x5')](_0xfd40('0x6'),_0x5609cc['map'](function(_0x291b8f){return{'id':_0x291b8f['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x26fe0d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfd40('0x7')](function(_0x306fde){_0x26fe0d['setDataValue']('unreadMessages',_0x306fde[_0xfd40('0x8')]);MailInteractionEvents[_0xfd40('0x9')](_0x43faf0+':'+_0x26fe0d['id'],_0x26fe0d);MailInteractionEvents[_0xfd40('0x9')](_0x43faf0,_0x26fe0d);_0x523dc8(null);})[_0xfd40('0xa')](_0x523dc8(null));};}for(var e in events){if(events[_0xfd40('0xb')](e)){var event=events[e];MailInteraction[_0xfd40('0xc')](e,emitEvent(event));}}module[_0xfd40('0xd')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 0825daf..244a5da 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 _0x881d=['define','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','closed','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','models','update','then','catch','utf8mb4_unicode_ci','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports'];(function(_0x582c98,_0x53b3a0){var _0x593449=function(_0x39834c){while(--_0x39834c){_0x582c98['push'](_0x582c98['shift']());}};_0x593449(++_0x53b3a0);}(_0x881d,0x1c0));var _0xd881=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x881d[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0xd881('0x0'));var util=require('util');var logger=require(_0xd881('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd881('0x2'));var fs=require('fs');var path=require(_0xd881('0x3'));var rimraf=require(_0xd881('0x4'));var config=require(_0xd881('0x5'));var attributes=require(_0xd881('0x6'));module[_0xd881('0x7')]=function(_0x4eadbc,_0x2f5491){return _0x4eadbc[_0xd881('0x8')]('MailInteraction',attributes,{'tableName':_0xd881('0x9'),'paranoid':![],'indexes':[{'name':_0xd881('0xa'),'fields':['subject','to'],'type':_0xd881('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xe03fd3,_0x2a8fc6,_0x2a688c){if(_0xe03fd3[_0xd881('0xc')]){_0xe03fd3[_0xd881('0xd')]=moment()[_0xd881('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xe03fd3[_0xd881('0xf')]){_0xe03fd3['closedAt']=moment()[_0xd881('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2a688c(null,_0x2a8fc6);},'beforeUpdate':function(_0x324db8,_0x1e89c7,_0x2d3104){if(_0x324db8['changed'](_0xd881('0xc'))){_0x324db8[_0xd881('0xd')]=_0x324db8[_0xd881('0xc')]?moment()[_0xd881('0xe')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x324db8[_0xd881('0x10')](_0xd881('0xf'))){_0x324db8[_0xd881('0x11')]=moment()['format'](_0xd881('0x12'));_0x324db8[_0xd881('0xc')]=null;_0x324db8[_0xd881('0xd')]=null;}_0x2d3104(null,_0x324db8);},'afterUpdate':function(_0x5ef04e,_0x4047db,_0x1235f4){var _0x2da3e0=_0x4eadbc[_0xd881('0x13')];var _0x9ccaa6=_0x5ef04e['get']({'plain':!![]});if(_0x9ccaa6[_0xd881('0xf')]){return _0x2da3e0['MailMessage'][_0xd881('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x9ccaa6['id']}})[_0xd881('0x15')](function(){_0x1235f4();})[_0xd881('0x16')](function(_0x344cef){_0x1235f4(_0x344cef);});}else{_0x1235f4();}}},'charset':'utf8mb4','collate':_0xd881('0x17')});}; \ No newline at end of file +var _0x8f22=['MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','substatus','closedAt','models','get'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8f22,0x1e5));var _0x28f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f22[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x28f2('0x0'));var util=require(_0x28f2('0x1'));var logger=require(_0x28f2('0x2'))(_0x28f2('0x3'));var moment=require(_0x28f2('0x4'));var BPromise=require(_0x28f2('0x5'));var rp=require(_0x28f2('0x6'));var fs=require('fs');var path=require(_0x28f2('0x7'));var rimraf=require('rimraf');var config=require(_0x28f2('0x8'));var attributes=require(_0x28f2('0x9'));module[_0x28f2('0xa')]=function(_0x4cea32,_0x313a36){return _0x4cea32[_0x28f2('0xb')](_0x28f2('0xc'),attributes,{'tableName':_0x28f2('0xd'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x28f2('0xe'),'to'],'type':_0x28f2('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x103255,_0xd0116a,_0xf7f79d){if(_0x103255['substatus']){_0x103255[_0x28f2('0x10')]=moment()[_0x28f2('0x11')](_0x28f2('0x12'));}if(_0x103255[_0x28f2('0x13')]){_0x103255['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0xf7f79d(null,_0xd0116a);},'beforeUpdate':function(_0x55a252,_0x5cd8d7,_0x4c48c1){if(_0x55a252[_0x28f2('0x14')](_0x28f2('0x15'))){_0x55a252[_0x28f2('0x10')]=_0x55a252[_0x28f2('0x15')]?moment()[_0x28f2('0x11')](_0x28f2('0x12')):null;}if(_0x55a252[_0x28f2('0x14')](_0x28f2('0x13'))){_0x55a252[_0x28f2('0x16')]=moment()[_0x28f2('0x11')](_0x28f2('0x12'));_0x55a252[_0x28f2('0x15')]=null;_0x55a252[_0x28f2('0x10')]=null;}_0x4c48c1(null,_0x55a252);},'afterUpdate':function(_0x337402,_0x4c9e8c,_0x4da873){var _0x529c87=_0x4cea32[_0x28f2('0x17')];var _0x3fee25=_0x337402[_0x28f2('0x18')]({'plain':!![]});if(_0x3fee25['closed']){return _0x529c87[_0x28f2('0x19')][_0x28f2('0x1a')]({'read':!![]},{'where':{'MailInteractionId':_0x3fee25['id']}})[_0x28f2('0x1b')](function(){_0x4da873();})[_0x28f2('0x1c')](function(_0x129863){_0x4da873(_0x129863);});}else{_0x4da873();}}},'charset':'utf8mb4','collate':_0x28f2('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index a3a6173..198218e 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 _0xb366=['stringify','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','redis','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb366,0xa4));var _0x6b36=function(_0x4d282a,_0x3204e4){_0x4d282a=_0x4d282a-0x0;var _0x4fce00=_0xb366[_0x4d282a];return _0x4fce00;};'use strict';var _=require(_0x6b36('0x0'));var util=require('util');var moment=require(_0x6b36('0x1'));var BPromise=require(_0x6b36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b36('0x3'));var db=require(_0x6b36('0x4'))['db'];var utils=require(_0x6b36('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6b36('0x6'));var client=jayson[_0x6b36('0x7')]['http']({'port':0x232a});config[_0x6b36('0x8')]=_['defaults'](config['redis'],{'host':_0x6b36('0x9'),'port':0x18eb});var socket=require(_0x6b36('0xa'))(new Redis(config[_0x6b36('0x8')]));require(_0x6b36('0xb'))['register'](socket);function respondWithRpcPromise(_0x171558,_0x22804e,_0x4d1437){return new BPromise(function(_0x32bbb5,_0x567985){return client[_0x6b36('0xc')](_0x171558,_0x4d1437)[_0x6b36('0xd')](function(_0x46eaa8){logger[_0x6b36('0xe')](_0x6b36('0xf'),_0x22804e,_0x6b36('0x10'));logger['debug'](_0x6b36('0x11'),_0x22804e,_0x6b36('0x10'),JSON['stringify'](_0x46eaa8));if(_0x46eaa8[_0x6b36('0x12')]){if(_0x46eaa8['error'][_0x6b36('0x13')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x22804e,_0x46eaa8['error'][_0x6b36('0x14')]);return _0x567985(_0x46eaa8[_0x6b36('0x12')][_0x6b36('0x14')]);}logger['error'](_0x6b36('0xf'),_0x22804e,_0x46eaa8['error'][_0x6b36('0x14')]);return _0x32bbb5(_0x46eaa8[_0x6b36('0x12')][_0x6b36('0x14')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x22804e,_0x6b36('0x10'));_0x32bbb5(_0x46eaa8['result'][_0x6b36('0x14')]);}})[_0x6b36('0x15')](function(_0x5ad465){logger[_0x6b36('0x12')]('MailInteraction,\x20%s,\x20%s',_0x22804e,_0x5ad465);_0x567985(_0x5ad465);});});}exports[_0x6b36('0x16')]=function(_0x489a1a){var _0x317ab3=this;return new Promise(function(_0x2e2f3e,_0xda25fd){return db[_0x6b36('0x17')][_0x6b36('0x18')](_0x489a1a[_0x6b36('0x19')],{'raw':_0x489a1a[_0x6b36('0x1a')]?_0x489a1a[_0x6b36('0x1a')][_0x6b36('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x489a1a[_0x6b36('0x1a')]?_0x489a1a[_0x6b36('0x1a')][_0x6b36('0x1c')]||null:null,'attributes':_0x489a1a['options']?_0x489a1a[_0x6b36('0x1a')][_0x6b36('0x1d')]||null:null,'limit':_0x489a1a['options']?_0x489a1a[_0x6b36('0x1a')]['limit']||null:null})[_0x6b36('0xd')](function(_0x5b0490){logger['info']('UpdateMailInteraction',_0x489a1a);logger[_0x6b36('0x1e')](_0x6b36('0x16'),_0x489a1a,JSON[_0x6b36('0x1f')](_0x5b0490));_0x2e2f3e(_0x5b0490);})[_0x6b36('0x15')](function(_0x2d1af7){logger[_0x6b36('0x12')](_0x6b36('0x16'),_0x2d1af7[_0x6b36('0x14')],_0x489a1a);_0xda25fd(_0x317ab3['error'](0x1f4,_0x2d1af7[_0x6b36('0x14')]));});});};exports[_0x6b36('0x20')]=function(_0x5975f9){return new Promise(function(_0x10b97b,_0x432637){return db['MailInteraction'][_0x6b36('0x21')]({'where':_0x5975f9[_0x6b36('0x1a')]?_0x5975f9[_0x6b36('0x1a')][_0x6b36('0x1c')]||null:null})[_0x6b36('0xd')](function(_0x44d4d7){if(_0x44d4d7){return _0x44d4d7[_0x6b36('0x22')](_0x5975f9[_0x6b36('0x19')][_0x6b36('0x23')],_[_0x6b36('0x24')](_0x5975f9['body'],[_0x6b36('0x23'),'id'])||{});}})[_0x6b36('0x25')](function(_0x18f1c9){logger[_0x6b36('0xe')]('AddTags',_0x5975f9);logger['debug'](_0x6b36('0x26'),_0x5975f9,JSON['stringify'](_0x18f1c9));_0x10b97b(_0x18f1c9);})[_0x6b36('0x15')](function(_0x1dc1d7){logger[_0x6b36('0x12')](_0x6b36('0x26'),_0x1dc1d7[_0x6b36('0x14')],_0x5975f9);_0x432637(_this[_0x6b36('0x12')](0x1f4,_0x1dc1d7[_0x6b36('0x14')]));});});}; \ No newline at end of file +var _0x2292=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateMailInteraction','MailInteraction','update','body','options','where','attributes','limit','then','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x30fe16,_0x325e58){var _0x21f7f8=function(_0x41aaab){while(--_0x41aaab){_0x30fe16['push'](_0x30fe16['shift']());}};_0x21f7f8(++_0x325e58);}(_0x2292,0xa1));var _0x2229=function(_0x52d74f,_0x4b101e){_0x52d74f=_0x52d74f-0x0;var _0x5a59f3=_0x2292[_0x52d74f];return _0x5a59f3;};'use strict';var _=require(_0x2229('0x0'));var util=require(_0x2229('0x1'));var moment=require(_0x2229('0x2'));var BPromise=require('bluebird');var rs=require(_0x2229('0x3'));var fs=require('fs');var Redis=require(_0x2229('0x4'));var db=require(_0x2229('0x5'))['db'];var utils=require(_0x2229('0x6'));var logger=require('../../config/logger')(_0x2229('0x7'));var config=require(_0x2229('0x8'));var jayson=require(_0x2229('0x9'));var client=jayson[_0x2229('0xa')]['http']({'port':0x232a});config[_0x2229('0xb')]=_[_0x2229('0xc')](config['redis'],{'host':_0x2229('0xd'),'port':0x18eb});var socket=require(_0x2229('0xe'))(new Redis(config[_0x2229('0xb')]));require('./mailInteraction.socket')[_0x2229('0xf')](socket);function respondWithRpcPromise(_0x2d53e7,_0x3317c0,_0x272fee){return new BPromise(function(_0x44074e,_0x19bffb){return client[_0x2229('0x10')](_0x2d53e7,_0x272fee)['then'](function(_0x13969b){logger['info'](_0x2229('0x11'),_0x3317c0,_0x2229('0x12'));logger[_0x2229('0x13')](_0x2229('0x14'),_0x3317c0,_0x2229('0x12'),JSON[_0x2229('0x15')](_0x13969b));if(_0x13969b[_0x2229('0x16')]){if(_0x13969b[_0x2229('0x16')][_0x2229('0x17')]===0x1f4){logger[_0x2229('0x16')](_0x2229('0x11'),_0x3317c0,_0x13969b['error']['message']);return _0x19bffb(_0x13969b[_0x2229('0x16')][_0x2229('0x18')]);}logger[_0x2229('0x16')](_0x2229('0x11'),_0x3317c0,_0x13969b[_0x2229('0x16')][_0x2229('0x18')]);return _0x44074e(_0x13969b[_0x2229('0x16')]['message']);}else{logger[_0x2229('0x19')](_0x2229('0x11'),_0x3317c0,_0x2229('0x12'));_0x44074e(_0x13969b['result']['message']);}})[_0x2229('0x1a')](function(_0x35ebe3){logger['error'](_0x2229('0x11'),_0x3317c0,_0x35ebe3);_0x19bffb(_0x35ebe3);});});}exports[_0x2229('0x1b')]=function(_0x265d11){var _0x719091=this;return new Promise(function(_0x16ee0d,_0x31e7d0){return db[_0x2229('0x1c')][_0x2229('0x1d')](_0x265d11[_0x2229('0x1e')],{'raw':_0x265d11['options']?_0x265d11[_0x2229('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x265d11[_0x2229('0x1f')]?_0x265d11[_0x2229('0x1f')][_0x2229('0x20')]||null:null,'attributes':_0x265d11['options']?_0x265d11[_0x2229('0x1f')][_0x2229('0x21')]||null:null,'limit':_0x265d11[_0x2229('0x1f')]?_0x265d11[_0x2229('0x1f')][_0x2229('0x22')]||null:null})[_0x2229('0x23')](function(_0x56c372){logger['info'](_0x2229('0x1b'),_0x265d11);logger[_0x2229('0x13')](_0x2229('0x1b'),_0x265d11,JSON[_0x2229('0x15')](_0x56c372));_0x16ee0d(_0x56c372);})['catch'](function(_0x75fbbd){logger[_0x2229('0x16')]('UpdateMailInteraction',_0x75fbbd[_0x2229('0x18')],_0x265d11);_0x31e7d0(_0x719091['error'](0x1f4,_0x75fbbd[_0x2229('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x3bcbfd){return new Promise(function(_0x41537f,_0x3323c3){return db[_0x2229('0x1c')][_0x2229('0x24')]({'where':_0x3bcbfd[_0x2229('0x1f')]?_0x3bcbfd[_0x2229('0x1f')]['where']||null:null})[_0x2229('0x23')](function(_0x3ea789){if(_0x3ea789){return _0x3ea789[_0x2229('0x25')](_0x3bcbfd[_0x2229('0x1e')][_0x2229('0x26')],_[_0x2229('0x27')](_0x3bcbfd['body'],[_0x2229('0x26'),'id'])||{});}})[_0x2229('0x28')](function(_0x2f89d2){logger[_0x2229('0x19')]('AddTags',_0x3bcbfd);logger[_0x2229('0x13')](_0x2229('0x29'),_0x3bcbfd,JSON[_0x2229('0x15')](_0x2f89d2));_0x41537f(_0x2f89d2);})['catch'](function(_0x38a254){logger[_0x2229('0x16')](_0x2229('0x29'),_0x38a254[_0x2229('0x18')],_0x3bcbfd);_0x3323c3(_this[_0x2229('0x16')](0x1f4,_0x38a254[_0x2229('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index b770a50..f92c760 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 _0x7d1b=['length','./mailInteraction.events','save','removeListener','register'];(function(_0x3c7c4b,_0x394429){var _0x2875a0=function(_0x54330f){while(--_0x54330f){_0x3c7c4b['push'](_0x3c7c4b['shift']());}};_0x2875a0(++_0x394429);}(_0x7d1b,0x1cd));var _0xb7d1=function(_0x419a45,_0x34b2b1){_0x419a45=_0x419a45-0x0;var _0x13d057=_0x7d1b[_0x419a45];return _0x13d057;};'use strict';var MailInteractionEvents=require(_0xb7d1('0x0'));var events=[_0xb7d1('0x1'),'remove','update'];function createListener(_0x193d22,_0x25de61){return function(_0x5a014c){_0x25de61['emit'](_0x193d22,_0x5a014c);};}function removeListener(_0x5f246b,_0x1ba390){return function(){MailInteractionEvents[_0xb7d1('0x2')](_0x5f246b,_0x1ba390);};}exports[_0xb7d1('0x3')]=function(_0x311139){for(var _0x47f6eb=0x0,_0x5b057c=events[_0xb7d1('0x4')];_0x47f6eb<_0x5b057c;_0x47f6eb++){var _0x49b2ac=events[_0x47f6eb];var _0x4046a5=createListener('mailInteraction:'+_0x49b2ac,_0x311139);MailInteractionEvents['on'](_0x49b2ac,_0x4046a5);}}; \ No newline at end of file +var _0xd2c9=['update','removeListener','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x2c71bc,_0x1f6d05){var _0x591c0d=function(_0x4b24d4){while(--_0x4b24d4){_0x2c71bc['push'](_0x2c71bc['shift']());}};_0x591c0d(++_0x1f6d05);}(_0xd2c9,0x154));var _0x9d2c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2c9[_0x3dd15e];return _0x231fd0;};'use strict';var MailInteractionEvents=require(_0x9d2c('0x0'));var events=[_0x9d2c('0x1'),_0x9d2c('0x2'),_0x9d2c('0x3')];function createListener(_0xe2eb22,_0x3d8aca){return function(_0x3c9b01){_0x3d8aca['emit'](_0xe2eb22,_0x3c9b01);};}function removeListener(_0x16789a,_0x5a1f8f){return function(){MailInteractionEvents[_0x9d2c('0x4')](_0x16789a,_0x5a1f8f);};}exports['register']=function(_0x372b62){for(var _0xd0ef44=0x0,_0x3d719f=events[_0x9d2c('0x5')];_0xd0ef44<_0x3d719f;_0xd0ef44++){var _0x416932=events[_0xd0ef44];var _0x591df7=createListener(_0x9d2c('0x6')+_0x416932,_0x372b62);MailInteractionEvents['on'](_0x416932,_0x591df7);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index a098ae4..9790e6b 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 _0xd110=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','/describe','/:id','isAuthenticated','post','tracked','mail','create','put','update','accept','/:id/reject','reject','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0xc2be36,_0x5a47fc){var _0x4c177d=function(_0x164ff){while(--_0x164ff){_0xc2be36['push'](_0xc2be36['shift']());}};_0x4c177d(++_0x5a47fc);}(_0xd110,0x1e8));var _0x0d11=function(_0x27d4f2,_0x580c67){_0x27d4f2=_0x27d4f2-0x0;var _0x2e6529=_0xd110[_0x27d4f2];return _0x2e6529;};'use strict';var multer=require(_0x0d11('0x0'));var util=require(_0x0d11('0x1'));var path=require(_0x0d11('0x2'));var timeout=require('connect-timeout');var express=require(_0x0d11('0x3'));var router=express[_0x0d11('0x4')]();var fs_extra=require(_0x0d11('0x5'));var auth=require(_0x0d11('0x6'));var interaction=require(_0x0d11('0x7'));var config=require(_0x0d11('0x8'));var controller=require(_0x0d11('0x9'));router[_0x0d11('0xa')]('/',auth['isAuthenticated'](),controller[_0x0d11('0xb')]);router['get'](_0x0d11('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x0d11('0xa')](_0x0d11('0xd'),auth[_0x0d11('0xe')](),controller['show']);router[_0x0d11('0xa')]('/:id/download',auth[_0x0d11('0xe')](),controller['download']);router[_0x0d11('0xf')]('/',auth[_0x0d11('0xe')](),interaction[_0x0d11('0x10')](_0x0d11('0x11'),'mailmessage:create'),controller[_0x0d11('0x12')]);router[_0x0d11('0x13')]('/:id',auth[_0x0d11('0xe')](),controller[_0x0d11('0x14')]);router[_0x0d11('0x13')]('/:id/accept',auth[_0x0d11('0xe')](),controller[_0x0d11('0x15')]);router['put'](_0x0d11('0x16'),auth[_0x0d11('0xe')](),controller[_0x0d11('0x17')]);router[_0x0d11('0x18')](_0x0d11('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x0d11('0x19')]=router; \ No newline at end of file +var _0x1239=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','tracked','mail','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy'];(function(_0x28c939,_0x110e29){var _0x527fe9=function(_0x1df2a6){while(--_0x1df2a6){_0x28c939['push'](_0x28c939['shift']());}};_0x527fe9(++_0x110e29);}(_0x1239,0xd3));var _0x9123=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1239[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9123('0x0'));var util=require(_0x9123('0x1'));var path=require(_0x9123('0x2'));var timeout=require(_0x9123('0x3'));var express=require(_0x9123('0x4'));var router=express[_0x9123('0x5')]();var fs_extra=require(_0x9123('0x6'));var auth=require(_0x9123('0x7'));var interaction=require(_0x9123('0x8'));var config=require(_0x9123('0x9'));var controller=require('./mailMessage.controller');router['get']('/',auth[_0x9123('0xa')](),controller[_0x9123('0xb')]);router[_0x9123('0xc')](_0x9123('0xd'),auth[_0x9123('0xa')](),controller[_0x9123('0xe')]);router[_0x9123('0xc')](_0x9123('0xf'),auth[_0x9123('0xa')](),controller[_0x9123('0x10')]);router['get'](_0x9123('0x11'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x9123('0xa')](),interaction[_0x9123('0x12')](_0x9123('0x13'),_0x9123('0x14')),controller['create']);router[_0x9123('0x15')](_0x9123('0xf'),auth[_0x9123('0xa')](),controller[_0x9123('0x16')]);router[_0x9123('0x15')](_0x9123('0x17'),auth[_0x9123('0xa')](),controller[_0x9123('0x18')]);router[_0x9123('0x15')](_0x9123('0x19'),auth[_0x9123('0xa')](),controller[_0x9123('0x1a')]);router[_0x9123('0x1b')]('/:id',auth[_0x9123('0xa')](),controller[_0x9123('0x1c')]);module[_0x9123('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 6a070e6..c5c474c 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 _0xe721=['long','DATE','INTEGER','BOOLEAN','ENUM','Email','Chat','sequelize','lodash','exports','TEXT','medium','out','STRING'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xe721,0x1f1));var _0x1e72=function(_0x56dc20,_0x3651dc){_0x56dc20=_0x56dc20-0x0;var _0x7be234=_0xe721[_0x56dc20];return _0x7be234;};'use strict';var Sequelize=require(_0x1e72('0x0'));var _=require(_0x1e72('0x1'));module[_0x1e72('0x2')]={'body':{'type':Sequelize[_0x1e72('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x1e72('0x3')](_0x1e72('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1e72('0x5')),'defaultValue':_0x1e72('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1e72('0x6')](0x1fe)},'from':{'type':Sequelize[_0x1e72('0x6')]},'to':{'type':Sequelize['TEXT'](_0x1e72('0x7'))},'cc':{'type':Sequelize['TEXT'](_0x1e72('0x7'))},'bcc':{'type':Sequelize[_0x1e72('0x3')](_0x1e72('0x7'))},'subject':{'type':Sequelize[_0x1e72('0x3')]},'sentAt':{'type':Sequelize[_0x1e72('0x8')]},'attach':{'type':Sequelize[_0x1e72('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x1e72('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x1e72('0x8')]},'originTo':{'type':Sequelize[_0x1e72('0x3')](_0x1e72('0x7'))},'originCc':{'type':Sequelize[_0x1e72('0x3')](_0x1e72('0x7'))},'originChannel':{'type':Sequelize[_0x1e72('0xb')](_0x1e72('0xc'),_0x1e72('0xd')),'defaultValue':_0x1e72('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0x2d0b=['TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','Chat','Email','lodash','exports'];(function(_0x464719,_0x5080b4){var _0x41bfce=function(_0x53524a){while(--_0x53524a){_0x464719['push'](_0x464719['shift']());}};_0x41bfce(++_0x5080b4);}(_0x2d0b,0x102));var _0xb2d0=function(_0xdddf7e,_0x4ccc42){_0xdddf7e=_0xdddf7e-0x0;var _0x3e0c10=_0x2d0b[_0xdddf7e];return _0x3e0c10;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb2d0('0x0'));module[_0xb2d0('0x1')]={'body':{'type':Sequelize[_0xb2d0('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb2d0('0x2')](_0xb2d0('0x3'))},'read':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb2d0('0x5')]('in','out'),'defaultValue':_0xb2d0('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xb2d0('0x7')]},'to':{'type':Sequelize[_0xb2d0('0x2')](_0xb2d0('0x8'))},'cc':{'type':Sequelize[_0xb2d0('0x2')](_0xb2d0('0x8'))},'bcc':{'type':Sequelize[_0xb2d0('0x2')](_0xb2d0('0x8'))},'subject':{'type':Sequelize[_0xb2d0('0x2')]},'sentAt':{'type':Sequelize[_0xb2d0('0x9')]},'attach':{'type':Sequelize[_0xb2d0('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0xb2d0('0x2')]('long')},'originChannel':{'type':Sequelize['ENUM']('Email',_0xb2d0('0xb')),'defaultValue':_0xb2d0('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index dd87792..fdb8fd3 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 _0xd647=['motionChannel','event','accept','fromString','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','Sequelize','User','rejectmessage','download','unix','toString','root','server','files','tmp','message-%s.eml','subject','createdAt','Attachment','Attachments','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','existsSync','push','readFileSync','build','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','offset','limit','undefined','count','set','json','end','sendStatus','stack','name','send','map','MailMessage','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','options','include','findAll','show','params','includeAll','merge','find','update','destroy','describe','body','direction','secret','MailAccount','findOne','CmList','List','CmContact','Contacts','updatedAt','MailServerOut','CloudProvider','getSmtpOptions','attachments','join','basename','create','ListId','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','read','readAt','UserId','user','agent','MailInteraction','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel'];(function(_0x4972ba,_0x3c1e52){var _0x295476=function(_0x535a9e){while(--_0x535a9e){_0x4972ba['push'](_0x4972ba['shift']());}};_0x295476(++_0x3c1e52);}(_0xd647,0xb8));var _0x7d64=function(_0x4d7241,_0x32aa1f){_0x4d7241=_0x4d7241-0x0;var _0x59d9e2=_0xd647[_0x4d7241];return _0x59d9e2;};'use strict';var emlformat=require(_0x7d64('0x0'));var moment=require(_0x7d64('0x1'));var BPromise=require(_0x7d64('0x2'));var util=require('util');var path=require(_0x7d64('0x3'));var fs=require('fs');var _=require(_0x7d64('0x4'));var Redis=require(_0x7d64('0x5'));var htmlToText=require(_0x7d64('0x6'));var qs=require(_0x7d64('0x7'));var logger=require(_0x7d64('0x8'))(_0x7d64('0x9'));var interaction_log=require(_0x7d64('0x8'))('mail-interactions');var config=require('../../config/environment');var db=require(_0x7d64('0xa'))['db'];config[_0x7d64('0xb')]=_['defaults'](config[_0x7d64('0xb')],{'host':_0x7d64('0xc'),'port':0x18eb});var socket=require(_0x7d64('0xd'))(new Redis(config['redis']));var htmlEntities=require(_0x7d64('0xe'));require(_0x7d64('0xf'))[_0x7d64('0x10')](socket);var jayson=require(_0x7d64('0x11'));var client=jayson[_0x7d64('0x12')][_0x7d64('0x13')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0x7d64('0x12')][_0x7d64('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x3db734,_0x34b917,_0x2ed0aa,_0x32c2c2){return new BPromise(function(_0x250f04,_0x10c586){var _0x1be0fb=_0x32c2c2||client;return _0x1be0fb[_0x7d64('0x14')](_0x3db734,_0x2ed0aa)[_0x7d64('0x15')](function(_0x5cd18e){logger[_0x7d64('0x16')](_0x7d64('0x17'),_0x34b917,'request\x20sent');logger['debug'](_0x7d64('0x18'),_0x34b917,_0x7d64('0x19'),JSON[_0x7d64('0x1a')](_0x5cd18e));if(_0x5cd18e[_0x7d64('0x1b')]){if(_0x5cd18e[_0x7d64('0x1b')]['code']===0x1f4){logger[_0x7d64('0x1b')](_0x7d64('0x17'),_0x34b917,_0x5cd18e['error'][_0x7d64('0x1c')]);return _0x10c586(_0x5cd18e[_0x7d64('0x1b')][_0x7d64('0x1c')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x34b917,_0x5cd18e[_0x7d64('0x1b')][_0x7d64('0x1c')]);return _0x250f04(_0x5cd18e['error'][_0x7d64('0x1c')]);}else{logger[_0x7d64('0x16')](_0x7d64('0x17'),_0x34b917,_0x7d64('0x19'));_0x250f04(_0x5cd18e['result'][_0x7d64('0x1c')]);}})[_0x7d64('0x1d')](function(_0x2db5df){logger['error'](_0x7d64('0x17'),_0x34b917,_0x2db5df);_0x10c586(_0x2db5df);});});}function respondWithResult(_0x2cbf33,_0x293098){_0x293098=_0x293098||0xc8;return function(_0x1027c2){if(_0x1027c2){return _0x2cbf33[_0x7d64('0x1e')](_0x293098)['json'](_0x1027c2);}};}function respondWithFilteredResult(_0x37f69c,_0x119397){return function(_0x2e7b1d){if(_0x2e7b1d){var _0x8c877=typeof _0x119397[_0x7d64('0x1f')]==='undefined'&&typeof _0x119397[_0x7d64('0x20')]===_0x7d64('0x21');var _0x3bb94d=_0x2e7b1d[_0x7d64('0x22')];var _0x3f81cb=_0x8c877?0x0:_0x119397[_0x7d64('0x1f')];var _0x3929d0=_0x8c877?_0x2e7b1d['count']:_0x119397['offset']+_0x119397[_0x7d64('0x20')];var _0x1705b4;if(_0x3929d0>=_0x3bb94d){_0x3929d0=_0x3bb94d;_0x1705b4=0xc8;}else{_0x1705b4=0xce;}_0x37f69c[_0x7d64('0x1e')](_0x1705b4);return _0x37f69c[_0x7d64('0x23')]('Content-Range',_0x3f81cb+'-'+_0x3929d0+'/'+_0x3bb94d)[_0x7d64('0x24')](_0x2e7b1d);}return null;};}function saveUpdates(_0x52f6de){return function(_0x41542b){if(_0x41542b){return _0x41542b['update'](_0x52f6de)[_0x7d64('0x15')](function(_0x4d106f){return _0x4d106f;});}return null;};}function removeEntity(_0x3c459f){return function(_0x1597fa){if(_0x1597fa){return _0x1597fa['destroy']()[_0x7d64('0x15')](function(){_0x3c459f[_0x7d64('0x1e')](0xcc)[_0x7d64('0x25')]();});}};}function handleEntityNotFound(_0x21c8f6){return function(_0x3c3979){if(!_0x3c3979){_0x21c8f6[_0x7d64('0x26')](0x194);}return _0x3c3979;};}function handleError(_0x59296f,_0x368d93){_0x368d93=_0x368d93||0x1f4;return function(_0x3512fc){logger[_0x7d64('0x1b')](_0x3512fc[_0x7d64('0x27')]);if(_0x3512fc[_0x7d64('0x28')]){delete _0x3512fc['name'];}_0x59296f[_0x7d64('0x1e')](_0x368d93)[_0x7d64('0x29')](_0x3512fc);};}exports['index']=function(_0x9df5f7,_0x49d16c){var _0x186722={},_0x1c65cf={},_0x336b2d={'count':0x0,'rows':[]};var _0x25107f=_[_0x7d64('0x2a')](db[_0x7d64('0x2b')][_0x7d64('0x2c')],function(_0x5c7405){return{'name':_0x5c7405['fieldName'],'type':_0x5c7405['type'][_0x7d64('0x2d')]};});_0x1c65cf[_0x7d64('0x2e')]=_[_0x7d64('0x2a')](_0x25107f,_0x7d64('0x28'));_0x1c65cf['query']=_[_0x7d64('0x2f')](_0x9df5f7[_0x7d64('0x30')]);_0x1c65cf[_0x7d64('0x31')]=_[_0x7d64('0x32')](_0x1c65cf['model'],_0x1c65cf[_0x7d64('0x30')]);_0x186722['attributes']=_['intersection'](_0x1c65cf[_0x7d64('0x2e')],qs[_0x7d64('0x33')](_0x9df5f7[_0x7d64('0x30')][_0x7d64('0x33')]));_0x186722[_0x7d64('0x34')]=_0x186722[_0x7d64('0x34')][_0x7d64('0x35')]?_0x186722[_0x7d64('0x34')]:_0x1c65cf[_0x7d64('0x2e')];if(!_0x9df5f7[_0x7d64('0x30')][_0x7d64('0x36')]('nolimit')){_0x186722[_0x7d64('0x20')]=qs['limit'](_0x9df5f7['query'][_0x7d64('0x20')]);_0x186722['offset']=qs[_0x7d64('0x1f')](_0x9df5f7[_0x7d64('0x30')]['offset']);}_0x186722[_0x7d64('0x37')]=qs[_0x7d64('0x38')](_0x9df5f7['query'][_0x7d64('0x38')]);_0x186722[_0x7d64('0x39')]=qs[_0x7d64('0x31')](_[_0x7d64('0x3a')](_0x9df5f7[_0x7d64('0x30')],_0x1c65cf[_0x7d64('0x31')]),_0x25107f);if(_0x9df5f7['query'][_0x7d64('0x3b')]){_0x186722['where']=_['merge'](_0x186722[_0x7d64('0x39')],{'$or':_['map'](_0x25107f,function(_0x250531){if(_0x250531[_0x7d64('0x3c')]!==_0x7d64('0x3d')){var _0x135151={};_0x135151[_0x250531[_0x7d64('0x28')]]={'$like':'%'+_0x9df5f7['query'][_0x7d64('0x3b')]+'%'};return _0x135151;}})});}_0x186722=_['merge']({},_0x186722,_0x9df5f7[_0x7d64('0x3e')]);var _0x4af5a4={'where':_0x186722['where']};return db[_0x7d64('0x2b')]['count'](_0x4af5a4)[_0x7d64('0x15')](function(_0x3c5508){_0x336b2d[_0x7d64('0x22')]=_0x3c5508;if(_0x9df5f7['query']['includeAll']){_0x186722[_0x7d64('0x3f')]=[{'all':!![]}];}return db[_0x7d64('0x2b')][_0x7d64('0x40')](_0x186722);})['then'](function(_0x10e317){_0x336b2d['rows']=_0x10e317;return _0x336b2d;})['then'](respondWithFilteredResult(_0x49d16c,_0x186722))[_0x7d64('0x1d')](handleError(_0x49d16c,null));};exports[_0x7d64('0x41')]=function(_0x143cc5,_0x8f506c){var _0x2fb4ee={'raw':!![],'where':{'id':_0x143cc5[_0x7d64('0x42')]['id']}},_0x46c151={};_0x46c151[_0x7d64('0x2e')]=_[_0x7d64('0x2f')](db['MailMessage']['rawAttributes']);_0x46c151[_0x7d64('0x30')]=_[_0x7d64('0x2f')](_0x143cc5['query']);_0x46c151[_0x7d64('0x31')]=_[_0x7d64('0x32')](_0x46c151[_0x7d64('0x2e')],_0x46c151[_0x7d64('0x30')]);_0x2fb4ee[_0x7d64('0x34')]=_[_0x7d64('0x32')](_0x46c151[_0x7d64('0x2e')],qs[_0x7d64('0x33')](_0x143cc5[_0x7d64('0x30')]['fields']));_0x2fb4ee[_0x7d64('0x34')]=_0x2fb4ee[_0x7d64('0x34')]['length']?_0x2fb4ee[_0x7d64('0x34')]:_0x46c151[_0x7d64('0x2e')];if(_0x143cc5[_0x7d64('0x30')][_0x7d64('0x43')]){_0x2fb4ee[_0x7d64('0x3f')]=[{'all':!![]}];}_0x2fb4ee=_[_0x7d64('0x44')]({},_0x2fb4ee,_0x143cc5[_0x7d64('0x3e')]);return db[_0x7d64('0x2b')][_0x7d64('0x45')](_0x2fb4ee)[_0x7d64('0x15')](handleEntityNotFound(_0x8f506c,null))[_0x7d64('0x15')](respondWithResult(_0x8f506c,null))[_0x7d64('0x1d')](handleError(_0x8f506c,null));};exports[_0x7d64('0x46')]=function(_0x55df46,_0x348481){if(_0x55df46['body']['id']){delete _0x55df46['body']['id'];}return db[_0x7d64('0x2b')]['find']({'where':{'id':_0x55df46['params']['id']}})['then'](handleEntityNotFound(_0x348481,null))['then'](saveUpdates(_0x55df46['body'],null))['then'](respondWithResult(_0x348481,null))['catch'](handleError(_0x348481,null));};exports[_0x7d64('0x47')]=function(_0x2ed4cd,_0x34b031){return db['MailMessage'][_0x7d64('0x45')]({'where':{'id':_0x2ed4cd[_0x7d64('0x42')]['id']}})['then'](handleEntityNotFound(_0x34b031,null))[_0x7d64('0x15')](removeEntity(_0x34b031,null))[_0x7d64('0x1d')](handleError(_0x34b031,null));};exports[_0x7d64('0x48')]=function(_0xdfd3de,_0x2549fd){return db[_0x7d64('0x2b')][_0x7d64('0x48')]()['then'](respondWithResult(_0x2549fd,null))[_0x7d64('0x1d')](handleError(_0x2549fd,null));};exports['create']=function(_0x372b1a,_0x12bbaf){return db['MailMessage']['create'](_0x372b1a[_0x7d64('0x49')])[_0x7d64('0x15')](function(_0x3a0d6b){if(_0x3a0d6b){if(_0x3a0d6b[_0x7d64('0x4a')]==='out'&&!_0x3a0d6b[_0x7d64('0x4b')]){var _0x455b8e,_0x197812,_0x5754fc;if(_0x372b1a['body']['to']){_0x197812=_0x372b1a[_0x7d64('0x49')]['to']['split'](',')[0x0];}return db[_0x7d64('0x4c')][_0x7d64('0x4d')]({'where':{'id':_0x3a0d6b['MailAccountId']},'include':[{'model':db[_0x7d64('0x4e')],'as':_0x7d64('0x4f'),'include':[{'model':db[_0x7d64('0x50')],'as':_0x7d64('0x51'),'where':{'email':_0x197812},'limit':0x1,'order':[[_0x7d64('0x52'),'DESC']]}]},{'model':db[_0x7d64('0x53')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x7d64('0x54')],'as':_0x7d64('0x54'),'raw':!![]}]}]})[_0x7d64('0x15')](function(_0x354d58){_0x455b8e=_0x354d58;if(!_0x455b8e||!_0x455b8e['Smtp'])return;var _0x49cdae=_0x455b8e[_0x7d64('0x55')]();if(_0x372b1a[_0x7d64('0x49')][_0x7d64('0x56')]&&_0x372b1a[_0x7d64('0x49')][_0x7d64('0x56')][_0x7d64('0x35')]){for(var _0x57e970=0x0;_0x57e970<_0x372b1a[_0x7d64('0x49')][_0x7d64('0x56')][_0x7d64('0x35')];_0x57e970+=0x1){_0x372b1a['body'][_0x7d64('0x56')][_0x57e970]={'filename':_0x372b1a[_0x7d64('0x49')][_0x7d64('0x56')][_0x57e970][_0x7d64('0x28')],'path':path[_0x7d64('0x57')](config['root'],'server/files/attachments',_0x372b1a['body'][_0x7d64('0x56')][_0x57e970][_0x7d64('0x58')])};}}_0x5754fc={'account':_0x49cdae,'message':_0x372b1a['body']};return;})[_0x7d64('0x15')](function(){if(_0x455b8e[_0x7d64('0x4f')]){if(_0x455b8e[_0x7d64('0x4f')][_0x7d64('0x51')][_0x7d64('0x35')]){return _0x455b8e['List'][_0x7d64('0x51')][0x0];}else{return db[_0x7d64('0x50')][_0x7d64('0x59')](_['defaults'](_0x372b1a['body'],{'firstName':_0x372b1a[_0x7d64('0x49')]['to'],'email':_0x372b1a[_0x7d64('0x49')]['to'],'phone':_0x372b1a['body']['to'],'ListId':_0x455b8e[_0x7d64('0x5a')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x7d64('0x15')](function(){if(_0x5754fc){return respondWithRpcPromise('SendMail',_0x7d64('0x5b'),_0x5754fc,client9003)[_0x7d64('0x15')](function(_0x4c497b){return _0x3a0d6b[_0x7d64('0x46')]({'read':!![],'messageId':_0x4c497b[_0x7d64('0x5c')],'sentAt':moment()[_0x7d64('0x5d')](_0x7d64('0x5e'))});})['catch'](function(_0x2baf02){logger[_0x7d64('0x1b')]('%s',JSON[_0x7d64('0x1a')](_0x2baf02));return _0x3a0d6b;});}return _0x3a0d6b;});}return _0x3a0d6b;}})[_0x7d64('0x15')](respondWithResult(_0x12bbaf,0xc9))[_0x7d64('0x1d')](handleError(_0x12bbaf,null));};exports['accept']=function(_0x285526,_0x834ddb){var _0x23a92a={'agent':{},'channel':'mail'};if(_0x285526['body']['id']){delete _0x285526[_0x7d64('0x49')]['id'];}_0x285526[_0x7d64('0x49')][_0x7d64('0x5f')]=!![];_0x285526['body'][_0x7d64('0x60')]=moment()['format'](_0x7d64('0x5e'));_0x285526[_0x7d64('0x49')][_0x7d64('0x61')]=_0x285526[_0x7d64('0x49')][_0x7d64('0x61')]||_0x285526[_0x7d64('0x62')]['id'];_0x23a92a[_0x7d64('0x63')]['id']=_0x285526[_0x7d64('0x49')][_0x7d64('0x61')];return db['MailMessage']['find']({'where':{'id':_0x285526['params']['id'],'UserId':null}})[_0x7d64('0x15')](handleEntityNotFound(_0x834ddb,null))['then'](saveUpdates(_0x285526[_0x7d64('0x49')],null))[_0x7d64('0x15')](function(_0x556f99){if(_0x556f99){_0x23a92a[_0x7d64('0x1c')]=_0x556f99['get']({'plain':!![]});return db[_0x7d64('0x64')]['find']({'where':{'id':_0x556f99['MailInteractionId']}});}return null;})[_0x7d64('0x15')](handleEntityNotFound(_0x834ddb,null))[_0x7d64('0x15')](function(_0x4e5489){if(_0x4e5489){return _0x4e5489[_0x7d64('0x46')]({'UserId':_0x285526['body']['UserId'],'read1stAt':_['isNil'](_0x4e5489[_0x7d64('0x65')])?moment()[_0x7d64('0x5d')](_0x7d64('0x5e')):undefined});}return null;})['then'](function(_0x182d2d){if(_0x182d2d){_0x23a92a[_0x7d64('0x66')]=_0x182d2d[_0x7d64('0x67')]({'plain':!![]});interaction_log[_0x7d64('0x16')](_0x7d64('0x68'),_0x285526[_0x7d64('0x62')]['id'],_0x285526[_0x7d64('0x62')][_0x7d64('0x28')],_0x285526[_0x7d64('0x62')][_0x7d64('0x69')],_0x23a92a['interaction']['id'],_0x285526[_0x7d64('0x49')]?JSON[_0x7d64('0x1a')](_0x285526['body']):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x23a92a);}return null;})[_0x7d64('0x15')](function(_0x84e1b8){var _0x4d0f27=_0x7d64('0x6a')+_0x84e1b8['message'][_0x7d64('0x6b')];return db[_0x7d64('0x6c')][_0x7d64('0x30')](_0x4d0f27,{'type':db['Sequelize'][_0x7d64('0x6d')][_0x7d64('0x6e')],'raw':!![]})['then'](function(_0x6c95ca){return _0x6c95ca;});})['then'](function(_0x2cc92c){if(_0x2cc92c){_0x23a92a[_0x7d64('0x1c')][_0x7d64('0x6f')]=_0x2cc92c[0x0];if(!_0x285526[_0x7d64('0x49')]['UserId'])return;return db['User']['find']({'where':{'id':_0x285526[_0x7d64('0x49')][_0x7d64('0x61')],'role':_0x7d64('0x63')},'attributes':['id',_0x7d64('0x28'),_0x7d64('0x70'),_0x7d64('0x71'),_0x7d64('0x72')],'raw':!![]});}return null;})[_0x7d64('0x15')](function(_0x156b38){if(!_0x156b38)return null;_0x23a92a[_0x7d64('0x1c')]['agent']=_0x156b38;return _0x23a92a;})[_0x7d64('0x15')](function(_0x27eb8a){if(_0x27eb8a){if(_0x285526[_0x7d64('0x49')]['manual']){_0x23a92a[_0x7d64('0x1c')][_0x7d64('0x73')]=util[_0x7d64('0x5d')](_0x7d64('0x74'),_0x285526[_0x7d64('0x62')][_0x7d64('0x28')]);_0x23a92a[_0x7d64('0x1c')]['channel']=_0x23a92a[_0x7d64('0x75')];_0x23a92a[_0x7d64('0x1c')][_0x7d64('0x76')]=_0x23a92a[_0x7d64('0x75')];_0x23a92a['message'][_0x7d64('0x77')]=_0x7d64('0x78');_0x23a92a[_0x7d64('0x1c')][_0x7d64('0x49')]=htmlToText[_0x7d64('0x79')](_0x23a92a['message'][_0x7d64('0x49')]);return respondWithRpcPromise(_0x7d64('0x7a'),_0x7d64('0x7a'),{'event':'acceptmessage','message':_0x23a92a[_0x7d64('0x1c')]},client9002)[_0x7d64('0x15')](function(){return _0x23a92a;});}return _0x23a92a;}return null;})[_0x7d64('0x15')](respondWithResult(_0x834ddb,null))['catch'](handleError(_0x834ddb,null));};exports[_0x7d64('0x7b')]=function(_0x1a308e,_0x2d138c){var _0x152bc9={'agent':{},'channel':'mail'};if(_0x1a308e[_0x7d64('0x49')]['id']){delete _0x1a308e['body']['id'];}_0x1a308e[_0x7d64('0x49')]['UserId']=_0x1a308e[_0x7d64('0x49')][_0x7d64('0x61')]||_0x1a308e[_0x7d64('0x62')]['id'];_0x152bc9[_0x7d64('0x63')]['id']=_0x1a308e[_0x7d64('0x49')][_0x7d64('0x61')];return db['MailMessage']['find']({'where':{'id':_0x1a308e[_0x7d64('0x42')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2d138c,null))['then'](function(_0x29ee99){if(_0x29ee99){_0x152bc9[_0x7d64('0x1c')]=_0x29ee99[_0x7d64('0x67')]({'plain':!![]});return db[_0x7d64('0x64')]['find']({'where':{'id':_0x29ee99['MailInteractionId']}});}return null;})[_0x7d64('0x15')](handleEntityNotFound(_0x2d138c,null))[_0x7d64('0x15')](function(_0x2cb594){if(_0x2cb594){_0x152bc9[_0x7d64('0x66')]=_0x2cb594[_0x7d64('0x67')]({'plain':!![]});interaction_log[_0x7d64('0x16')](_0x7d64('0x7c'),_0x1a308e[_0x7d64('0x62')]['id'],_0x1a308e['user'][_0x7d64('0x28')],_0x1a308e[_0x7d64('0x62')]['role'],_0x152bc9[_0x7d64('0x66')]['id'],_0x1a308e[_0x7d64('0x49')]?JSON[_0x7d64('0x1a')](_0x1a308e[_0x7d64('0x49')]):_0x7d64('0x7d'));return respondWithRpcPromise('RejectMessage',_0x7d64('0x7e'),_0x152bc9);}return null;})[_0x7d64('0x15')](function(_0x47ccb1){var _0x575ccb=_0x7d64('0x6a')+_0x47ccb1[_0x7d64('0x1c')]['ContactId'];return db[_0x7d64('0x6c')][_0x7d64('0x30')](_0x575ccb,{'type':db[_0x7d64('0x7f')]['QueryTypes'][_0x7d64('0x6e')],'raw':!![]})[_0x7d64('0x15')](function(_0x1bd28a){return _0x1bd28a;});})[_0x7d64('0x15')](function(_0x312b76){if(_0x312b76){_0x152bc9['message'][_0x7d64('0x6f')]=_0x312b76[0x0];if(!_0x1a308e['body'][_0x7d64('0x61')])return;return db[_0x7d64('0x80')]['find']({'where':{'id':_0x1a308e[_0x7d64('0x49')][_0x7d64('0x61')],'role':_0x7d64('0x63')},'attributes':['id',_0x7d64('0x28'),_0x7d64('0x70'),_0x7d64('0x71'),_0x7d64('0x72')],'raw':!![]});}return null;})[_0x7d64('0x15')](function(_0x910eb9){if(!_0x910eb9)return null;_0x152bc9[_0x7d64('0x1c')]['agent']=_0x910eb9;return _0x152bc9;})[_0x7d64('0x15')](function(_0x42a742){if(_0x42a742){_0x42a742['message'][_0x7d64('0x73')]=util[_0x7d64('0x5d')](_0x7d64('0x74'),_0x1a308e[_0x7d64('0x62')][_0x7d64('0x28')]);_0x42a742[_0x7d64('0x1c')][_0x7d64('0x75')]=_0x152bc9[_0x7d64('0x75')];_0x42a742['message'][_0x7d64('0x76')]=_0x152bc9['channel'];_0x42a742[_0x7d64('0x1c')][_0x7d64('0x77')]=_0x7d64('0x7b');_0x42a742[_0x7d64('0x1c')][_0x7d64('0x49')]=htmlToText['fromString'](_0x152bc9[_0x7d64('0x1c')]['body']);respondWithRpcPromise(_0x7d64('0x7a'),_0x7d64('0x7a'),{'event':_0x7d64('0x81'),'message':_0x42a742[_0x7d64('0x1c')]},client9002);return _0x152bc9;}return null;})[_0x7d64('0x15')](respondWithResult(_0x2d138c,null))['catch'](handleError(_0x2d138c,null));};exports[_0x7d64('0x82')]=function(_0x25d68a,_0x5778b4){var _0x14ba04=moment()[_0x7d64('0x83')]()[_0x7d64('0x84')]();var _0x4b40d6=path[_0x7d64('0x57')](config[_0x7d64('0x85')],_0x7d64('0x86'),_0x7d64('0x87'),_0x7d64('0x88'));var _0x406940=path[_0x7d64('0x57')](config['root'],_0x7d64('0x86'),_0x7d64('0x87'),'attachments');var _0x3ffb7f=util[_0x7d64('0x5d')](_0x7d64('0x89'),_0x14ba04);return db['MailMessage'][_0x7d64('0x45')]({'where':{'id':_0x25d68a[_0x7d64('0x42')]['id']},'attributes':['id',_0x7d64('0x49'),'from','to','cc','bcc',_0x7d64('0x8a'),_0x7d64('0x8b')],'include':_0x25d68a[_0x7d64('0x30')]['attachments']?[{'model':db[_0x7d64('0x8c')],'as':_0x7d64('0x8d')}]:undefined})[_0x7d64('0x15')](handleEntityNotFound(_0x5778b4,null))[_0x7d64('0x15')](function(_0x462216){if(_0x462216){var _0x56c201=_0x462216;var _0x493fd5={'from':_0x56c201[_0x7d64('0x8e')],'to':_0x56c201['to'],'subject':_0x56c201['subject'],'html':htmlEntities[_0x7d64('0x8f')](_0x56c201[_0x7d64('0x49')]),'headers':{'Date':moment(_0x56c201[_0x7d64('0x8b')])[_0x7d64('0x5d')](_0x7d64('0x90'))},'attachments':[]};if(_0x462216['cc']){_0x493fd5['headers']['Cc']=_0x462216['cc'];}if(_0x462216['bcc']){_0x493fd5['headers'][_0x7d64('0x91')]=_0x462216['bcc'];}return new BPromise(function(_0x4f8112,_0x760114){if(_0x462216[_0x7d64('0x8d')]){for(var _0x2b7d70=0x0;_0x2b7d70<_0x462216[_0x7d64('0x8d')]['length'];_0x2b7d70++){var _0x1716f4=_0x462216['Attachments'][_0x2b7d70];var _0x440b67=path[_0x7d64('0x57')](_0x406940,_0x1716f4[_0x7d64('0x58')]);if(fs[_0x7d64('0x92')](_0x440b67)){_0x493fd5[_0x7d64('0x56')][_0x7d64('0x93')]({'name':_0x1716f4['name'],'contentType':_0x1716f4[_0x7d64('0x3c')],'data':fs[_0x7d64('0x94')](_0x440b67)});}}}emlformat[_0x7d64('0x95')](_0x493fd5,function(_0x1c9d52,_0x5827e9){if(_0x1c9d52)return _0x760114(_0x1c9d52);fs['writeFileSync'](path['join'](_0x4b40d6,_0x3ffb7f),_0x5827e9);return _0x4f8112(_0x5827e9);});});}})[_0x7d64('0x15')](function(_0x4f5600){if(_0x4f5600){return _0x5778b4[_0x7d64('0x82')](path[_0x7d64('0x57')](_0x4b40d6,_0x3ffb7f),_0x3ffb7f,function(_0x1dc869){if(!_0x1dc869)fs[_0x7d64('0x96')](path[_0x7d64('0x57')](_0x4b40d6,_0x3ffb7f));});}})[_0x7d64('0x1d')](handleError(_0x5778b4,null));}; \ No newline at end of file +var _0x7594=['read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','contact','fullname','reject','rejectmessage','download','unix','toString','files','tmp','server','from','bcc','createdAt','Attachments','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','json','offset','undefined','limit','Content-Range','update','destroy','status','end','stack','name','send','MailMessage','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','filters','length','find','body','create','direction','secret','split','MailAccount','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','getSmtpOptions','attachments','join','root','basename','List','ListId','List\x20not\x20found','SendMail','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail'];(function(_0x50926f,_0x81cb99){var _0x32e5b6=function(_0x58deae){while(--_0x58deae){_0x50926f['push'](_0x50926f['shift']());}};_0x32e5b6(++_0x81cb99);}(_0x7594,0x17e));var _0x4759=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x7594[_0xc77819];return _0x1c9434;};'use strict';var emlformat=require(_0x4759('0x0'));var moment=require(_0x4759('0x1'));var BPromise=require(_0x4759('0x2'));var util=require(_0x4759('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x4759('0x4'));var Redis=require('ioredis');var htmlToText=require(_0x4759('0x5'));var qs=require(_0x4759('0x6'));var logger=require(_0x4759('0x7'))(_0x4759('0x8'));var interaction_log=require('../../config/logger')(_0x4759('0x9'));var config=require(_0x4759('0xa'));var db=require(_0x4759('0xb'))['db'];config[_0x4759('0xc')]=_[_0x4759('0xd')](config[_0x4759('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4759('0xe'))(new Redis(config['redis']));var htmlEntities=require(_0x4759('0xf'));require('./mailMessage.socket')['register'](socket);var jayson=require(_0x4759('0x10'));var client=jayson[_0x4759('0x11')][_0x4759('0x12')]({'port':0x232c});var client9003=jayson[_0x4759('0x11')][_0x4759('0x12')]({'port':0x232b});var client9002=jayson[_0x4759('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x141e02,_0xbb8a94,_0x3312d3,_0x5e189c){return new BPromise(function(_0x4d2b45,_0x2e1597){var _0x2327c1=_0x5e189c||client;return _0x2327c1['request'](_0x141e02,_0x3312d3)[_0x4759('0x13')](function(_0x293195){logger[_0x4759('0x14')](_0x4759('0x15'),_0xbb8a94,_0x4759('0x16'));logger[_0x4759('0x17')]('MailMessage,\x20%s,\x20%s,\x20%s',_0xbb8a94,'request\x20sent',JSON['stringify'](_0x293195));if(_0x293195['error']){if(_0x293195[_0x4759('0x18')][_0x4759('0x19')]===0x1f4){logger[_0x4759('0x18')](_0x4759('0x15'),_0xbb8a94,_0x293195[_0x4759('0x18')]['message']);return _0x2e1597(_0x293195[_0x4759('0x18')][_0x4759('0x1a')]);}logger[_0x4759('0x18')](_0x4759('0x15'),_0xbb8a94,_0x293195[_0x4759('0x18')][_0x4759('0x1a')]);return _0x4d2b45(_0x293195[_0x4759('0x18')]['message']);}else{logger[_0x4759('0x14')](_0x4759('0x15'),_0xbb8a94,_0x4759('0x16'));_0x4d2b45(_0x293195[_0x4759('0x1b')]['message']);}})['catch'](function(_0x2bfe48){logger[_0x4759('0x18')](_0x4759('0x15'),_0xbb8a94,_0x2bfe48);_0x2e1597(_0x2bfe48);});});}function respondWithResult(_0x46d463,_0x3ae6f4){_0x3ae6f4=_0x3ae6f4||0xc8;return function(_0x3a0f8e){if(_0x3a0f8e){return _0x46d463['status'](_0x3ae6f4)[_0x4759('0x1c')](_0x3a0f8e);}};}function respondWithFilteredResult(_0x333c8f,_0x4128cc){return function(_0x2bd0a5){if(_0x2bd0a5){var _0x2fc3df=typeof _0x4128cc[_0x4759('0x1d')]==='undefined'&&typeof _0x4128cc['limit']===_0x4759('0x1e');var _0xff234d=_0x2bd0a5['count'];var _0x3943cc=_0x2fc3df?0x0:_0x4128cc['offset'];var _0x392201=_0x2fc3df?_0x2bd0a5['count']:_0x4128cc['offset']+_0x4128cc[_0x4759('0x1f')];var _0x5f0a7d;if(_0x392201>=_0xff234d){_0x392201=_0xff234d;_0x5f0a7d=0xc8;}else{_0x5f0a7d=0xce;}_0x333c8f['status'](_0x5f0a7d);return _0x333c8f['set'](_0x4759('0x20'),_0x3943cc+'-'+_0x392201+'/'+_0xff234d)['json'](_0x2bd0a5);}return null;};}function saveUpdates(_0x1d9497){return function(_0x80e919){if(_0x80e919){return _0x80e919[_0x4759('0x21')](_0x1d9497)['then'](function(_0x2c4daa){return _0x2c4daa;});}return null;};}function removeEntity(_0x217320){return function(_0x517830){if(_0x517830){return _0x517830[_0x4759('0x22')]()['then'](function(){_0x217320[_0x4759('0x23')](0xcc)[_0x4759('0x24')]();});}};}function handleEntityNotFound(_0xae0bc3){return function(_0xd08c77){if(!_0xd08c77){_0xae0bc3['sendStatus'](0x194);}return _0xd08c77;};}function handleError(_0x3a7435,_0x218b08){_0x218b08=_0x218b08||0x1f4;return function(_0x15da7b){logger[_0x4759('0x18')](_0x15da7b[_0x4759('0x25')]);if(_0x15da7b['name']){delete _0x15da7b[_0x4759('0x26')];}_0x3a7435[_0x4759('0x23')](_0x218b08)[_0x4759('0x27')](_0x15da7b);};}exports['index']=function(_0x4bb5ba,_0x2b9486){var _0x4cc560={},_0x59eb1c={},_0x13fd75={'count':0x0,'rows':[]};var _0x11beb6=_['map'](db[_0x4759('0x28')][_0x4759('0x29')],function(_0x35b4f0){return{'name':_0x35b4f0['fieldName'],'type':_0x35b4f0[_0x4759('0x2a')][_0x4759('0x2b')]};});_0x59eb1c[_0x4759('0x2c')]=_['map'](_0x11beb6,_0x4759('0x26'));_0x59eb1c[_0x4759('0x2d')]=_[_0x4759('0x2e')](_0x4bb5ba['query']);_0x59eb1c['filters']=_['intersection'](_0x59eb1c[_0x4759('0x2c')],_0x59eb1c[_0x4759('0x2d')]);_0x4cc560[_0x4759('0x2f')]=_[_0x4759('0x30')](_0x59eb1c['model'],qs[_0x4759('0x31')](_0x4bb5ba[_0x4759('0x2d')][_0x4759('0x31')]));_0x4cc560[_0x4759('0x2f')]=_0x4cc560[_0x4759('0x2f')]['length']?_0x4cc560['attributes']:_0x59eb1c['model'];if(!_0x4bb5ba['query'][_0x4759('0x32')](_0x4759('0x33'))){_0x4cc560[_0x4759('0x1f')]=qs['limit'](_0x4bb5ba[_0x4759('0x2d')]['limit']);_0x4cc560[_0x4759('0x1d')]=qs['offset'](_0x4bb5ba[_0x4759('0x2d')][_0x4759('0x1d')]);}_0x4cc560[_0x4759('0x34')]=qs[_0x4759('0x35')](_0x4bb5ba[_0x4759('0x2d')][_0x4759('0x35')]);_0x4cc560[_0x4759('0x36')]=qs['filters'](_[_0x4759('0x37')](_0x4bb5ba[_0x4759('0x2d')],_0x59eb1c['filters']),_0x11beb6);if(_0x4bb5ba['query']['filter']){_0x4cc560[_0x4759('0x36')]=_[_0x4759('0x38')](_0x4cc560['where'],{'$or':_[_0x4759('0x39')](_0x11beb6,function(_0x193e97){if(_0x193e97[_0x4759('0x2a')]!==_0x4759('0x3a')){var _0x3d40cb={};_0x3d40cb[_0x193e97['name']]={'$like':'%'+_0x4bb5ba[_0x4759('0x2d')][_0x4759('0x3b')]+'%'};return _0x3d40cb;}})});}_0x4cc560=_[_0x4759('0x38')]({},_0x4cc560,_0x4bb5ba[_0x4759('0x3c')]);var _0x507c8b={'where':_0x4cc560['where']};return db[_0x4759('0x28')]['count'](_0x507c8b)['then'](function(_0x5bfe74){_0x13fd75[_0x4759('0x3d')]=_0x5bfe74;if(_0x4bb5ba[_0x4759('0x2d')][_0x4759('0x3e')]){_0x4cc560[_0x4759('0x3f')]=[{'all':!![]}];}return db['MailMessage'][_0x4759('0x40')](_0x4cc560);})[_0x4759('0x13')](function(_0x3719a8){_0x13fd75[_0x4759('0x41')]=_0x3719a8;return _0x13fd75;})['then'](respondWithFilteredResult(_0x2b9486,_0x4cc560))[_0x4759('0x42')](handleError(_0x2b9486,null));};exports[_0x4759('0x43')]=function(_0x256a91,_0x40cc9b){var _0x31881a={'raw':!![],'where':{'id':_0x256a91[_0x4759('0x44')]['id']}},_0x5745e3={};_0x5745e3[_0x4759('0x2c')]=_['keys'](db['MailMessage'][_0x4759('0x29')]);_0x5745e3['query']=_[_0x4759('0x2e')](_0x256a91[_0x4759('0x2d')]);_0x5745e3[_0x4759('0x45')]=_[_0x4759('0x30')](_0x5745e3['model'],_0x5745e3[_0x4759('0x2d')]);_0x31881a[_0x4759('0x2f')]=_[_0x4759('0x30')](_0x5745e3[_0x4759('0x2c')],qs[_0x4759('0x31')](_0x256a91[_0x4759('0x2d')][_0x4759('0x31')]));_0x31881a['attributes']=_0x31881a[_0x4759('0x2f')][_0x4759('0x46')]?_0x31881a[_0x4759('0x2f')]:_0x5745e3[_0x4759('0x2c')];if(_0x256a91[_0x4759('0x2d')][_0x4759('0x3e')]){_0x31881a[_0x4759('0x3f')]=[{'all':!![]}];}_0x31881a=_[_0x4759('0x38')]({},_0x31881a,_0x256a91['options']);return db['MailMessage'][_0x4759('0x47')](_0x31881a)['then'](handleEntityNotFound(_0x40cc9b,null))['then'](respondWithResult(_0x40cc9b,null))[_0x4759('0x42')](handleError(_0x40cc9b,null));};exports[_0x4759('0x21')]=function(_0x38f399,_0x40c250){if(_0x38f399['body']['id']){delete _0x38f399[_0x4759('0x48')]['id'];}return db[_0x4759('0x28')]['find']({'where':{'id':_0x38f399[_0x4759('0x44')]['id']}})[_0x4759('0x13')](handleEntityNotFound(_0x40c250,null))[_0x4759('0x13')](saveUpdates(_0x38f399['body'],null))['then'](respondWithResult(_0x40c250,null))['catch'](handleError(_0x40c250,null));};exports[_0x4759('0x22')]=function(_0x1455e4,_0x2723a1){return db[_0x4759('0x28')][_0x4759('0x47')]({'where':{'id':_0x1455e4[_0x4759('0x44')]['id']}})[_0x4759('0x13')](handleEntityNotFound(_0x2723a1,null))[_0x4759('0x13')](removeEntity(_0x2723a1,null))[_0x4759('0x42')](handleError(_0x2723a1,null));};exports['describe']=function(_0x4d783d,_0x59e00a){return db[_0x4759('0x28')]['describe']()['then'](respondWithResult(_0x59e00a,null))[_0x4759('0x42')](handleError(_0x59e00a,null));};exports[_0x4759('0x49')]=function(_0x1f1c5c,_0x1a1cb6){return db['MailMessage']['create'](_0x1f1c5c[_0x4759('0x48')])['then'](function(_0x5de6b2){if(_0x5de6b2){if(_0x5de6b2[_0x4759('0x4a')]==='out'&&!_0x5de6b2[_0x4759('0x4b')]){var _0x1dcce9,_0x66dc5d,_0x4fe0e8;if(_0x1f1c5c[_0x4759('0x48')]['to']){_0x66dc5d=_0x1f1c5c[_0x4759('0x48')]['to'][_0x4759('0x4c')](',')[0x0];}return db[_0x4759('0x4d')][_0x4759('0x4e')]({'where':{'id':_0x5de6b2[_0x4759('0x4f')]},'include':[{'model':db[_0x4759('0x50')],'as':'List','include':[{'model':db[_0x4759('0x51')],'as':_0x4759('0x52'),'where':{'email':_0x66dc5d},'limit':0x1,'order':[[_0x4759('0x53'),_0x4759('0x54')]]}]},{'model':db[_0x4759('0x55')],'as':_0x4759('0x56'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x4759('0x13')](function(_0x6c603a){_0x1dcce9=_0x6c603a;if(!_0x1dcce9||!_0x1dcce9[_0x4759('0x56')])return;var _0x3c8f8b=_0x1dcce9[_0x4759('0x57')]();if(_0x1f1c5c[_0x4759('0x48')][_0x4759('0x58')]&&_0x1f1c5c[_0x4759('0x48')]['attachments'][_0x4759('0x46')]){for(var _0x1fea1c=0x0;_0x1fea1c<_0x1f1c5c[_0x4759('0x48')][_0x4759('0x58')][_0x4759('0x46')];_0x1fea1c+=0x1){_0x1f1c5c[_0x4759('0x48')][_0x4759('0x58')][_0x1fea1c]={'filename':_0x1f1c5c[_0x4759('0x48')][_0x4759('0x58')][_0x1fea1c]['name'],'path':path[_0x4759('0x59')](config[_0x4759('0x5a')],'server/files/attachments',_0x1f1c5c['body'][_0x4759('0x58')][_0x1fea1c][_0x4759('0x5b')])};}}_0x4fe0e8={'account':_0x3c8f8b,'message':_0x1f1c5c[_0x4759('0x48')]};return;})['then'](function(){if(_0x1dcce9[_0x4759('0x5c')]){if(_0x1dcce9[_0x4759('0x5c')][_0x4759('0x52')][_0x4759('0x46')]){return _0x1dcce9[_0x4759('0x5c')]['Contacts'][0x0];}else{return db['CmContact'][_0x4759('0x49')](_[_0x4759('0xd')](_0x1f1c5c[_0x4759('0x48')],{'firstName':_0x1f1c5c[_0x4759('0x48')]['to'],'email':_0x1f1c5c[_0x4759('0x48')]['to'],'phone':_0x1f1c5c['body']['to'],'ListId':_0x1dcce9[_0x4759('0x5d')]}));}}else{throw new Error(_0x4759('0x5e'));}})['then'](function(){if(_0x4fe0e8){return respondWithRpcPromise(_0x4759('0x5f'),'sendMail',_0x4fe0e8,client9003)['then'](function(_0x475c27){return _0x5de6b2[_0x4759('0x21')]({'read':!![],'messageId':_0x475c27['messageId'],'sentAt':moment()[_0x4759('0x60')](_0x4759('0x61'))});})['catch'](function(_0x562f2b){logger['error']('%s',JSON[_0x4759('0x62')](_0x562f2b));return _0x5de6b2;});}return _0x5de6b2;});}return _0x5de6b2;}})[_0x4759('0x13')](respondWithResult(_0x1a1cb6,0xc9))[_0x4759('0x42')](handleError(_0x1a1cb6,null));};exports[_0x4759('0x63')]=function(_0x4bfb74,_0x4cfa35){var _0x44de24={'agent':{},'channel':_0x4759('0x64')};if(_0x4bfb74[_0x4759('0x48')]['id']){delete _0x4bfb74['body']['id'];}_0x4bfb74[_0x4759('0x48')][_0x4759('0x65')]=!![];_0x4bfb74[_0x4759('0x48')][_0x4759('0x66')]=moment()[_0x4759('0x60')](_0x4759('0x61'));_0x4bfb74[_0x4759('0x48')]['UserId']=_0x4bfb74[_0x4759('0x48')][_0x4759('0x67')]||_0x4bfb74['user']['id'];_0x44de24[_0x4759('0x68')]['id']=_0x4bfb74['body'][_0x4759('0x67')];return db[_0x4759('0x28')][_0x4759('0x47')]({'where':{'id':_0x4bfb74[_0x4759('0x44')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4cfa35,null))[_0x4759('0x13')](saveUpdates(_0x4bfb74[_0x4759('0x48')],null))[_0x4759('0x13')](function(_0x13cb26){if(_0x13cb26){_0x44de24[_0x4759('0x1a')]=_0x13cb26[_0x4759('0x69')]({'plain':!![]});return db[_0x4759('0x6a')][_0x4759('0x47')]({'where':{'id':_0x13cb26[_0x4759('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x4cfa35,null))['then'](function(_0x58aebc){if(_0x58aebc){return _0x58aebc[_0x4759('0x21')]({'UserId':_0x4bfb74[_0x4759('0x48')][_0x4759('0x67')],'read1stAt':_[_0x4759('0x6c')](_0x58aebc[_0x4759('0x6d')])?moment()[_0x4759('0x60')](_0x4759('0x61')):undefined});}return null;})[_0x4759('0x13')](function(_0x1836d5){if(_0x1836d5){_0x44de24[_0x4759('0x6e')]=_0x1836d5['get']({'plain':!![]});interaction_log[_0x4759('0x14')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4bfb74[_0x4759('0x6f')]['id'],_0x4bfb74['user'][_0x4759('0x26')],_0x4bfb74[_0x4759('0x6f')][_0x4759('0x70')],_0x44de24[_0x4759('0x6e')]['id'],_0x4bfb74['body']?JSON['stringify'](_0x4bfb74[_0x4759('0x48')]):_0x4759('0x71'));return respondWithRpcPromise(_0x4759('0x72'),_0x4759('0x73'),_0x44de24);}return null;})[_0x4759('0x13')](function(_0x1a7497){var _0x4e8425=_0x4759('0x74')+_0x1a7497[_0x4759('0x1a')][_0x4759('0x75')];return db[_0x4759('0x76')][_0x4759('0x2d')](_0x4e8425,{'type':db['Sequelize'][_0x4759('0x77')]['SELECT'],'raw':!![]})[_0x4759('0x13')](function(_0x5c3a1c){return _0x5c3a1c;});})[_0x4759('0x13')](function(_0x7cd8f3){if(_0x7cd8f3){_0x44de24[_0x4759('0x1a')]['contact']=_0x7cd8f3[0x0];if(!_0x4bfb74['body'][_0x4759('0x67')])return;return db[_0x4759('0x78')][_0x4759('0x47')]({'where':{'id':_0x4bfb74[_0x4759('0x48')][_0x4759('0x67')],'role':_0x4759('0x68')},'attributes':['id',_0x4759('0x26'),'fullname',_0x4759('0x79'),_0x4759('0x7a')],'raw':!![]});}return null;})['then'](function(_0x493ed0){if(!_0x493ed0)return null;_0x44de24[_0x4759('0x1a')][_0x4759('0x68')]=_0x493ed0;return _0x44de24;})[_0x4759('0x13')](function(_0xb5c45f){if(_0xb5c45f){if(_0x4bfb74['body'][_0x4759('0x7b')]){_0x44de24['message'][_0x4759('0x7c')]=util[_0x4759('0x60')](_0x4759('0x7d'),_0x4bfb74[_0x4759('0x6f')][_0x4759('0x26')]);_0x44de24['message']['channel']=_0x44de24[_0x4759('0x7e')];_0x44de24[_0x4759('0x1a')][_0x4759('0x7f')]=_0x44de24[_0x4759('0x7e')];_0x44de24['message'][_0x4759('0x80')]=_0x4759('0x63');_0x44de24['message'][_0x4759('0x48')]=htmlToText[_0x4759('0x81')](_0x44de24[_0x4759('0x1a')][_0x4759('0x48')]);return respondWithRpcPromise(_0x4759('0x82'),_0x4759('0x82'),{'event':_0x4759('0x83'),'message':_0x44de24[_0x4759('0x1a')]},client9002)[_0x4759('0x13')](function(){return _0x44de24;});}return _0x44de24;}return null;})['then'](respondWithResult(_0x4cfa35,null))[_0x4759('0x42')](handleError(_0x4cfa35,null));};exports['reject']=function(_0x11604b,_0x3feeda){var _0x10946f={'agent':{},'channel':'mail'};if(_0x11604b[_0x4759('0x48')]['id']){delete _0x11604b['body']['id'];}_0x11604b['body'][_0x4759('0x67')]=_0x11604b[_0x4759('0x48')][_0x4759('0x67')]||_0x11604b[_0x4759('0x6f')]['id'];_0x10946f[_0x4759('0x68')]['id']=_0x11604b[_0x4759('0x48')][_0x4759('0x67')];return db[_0x4759('0x28')][_0x4759('0x47')]({'where':{'id':_0x11604b[_0x4759('0x44')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3feeda,null))[_0x4759('0x13')](function(_0x47cedf){if(_0x47cedf){_0x10946f[_0x4759('0x1a')]=_0x47cedf[_0x4759('0x69')]({'plain':!![]});return db[_0x4759('0x6a')][_0x4759('0x47')]({'where':{'id':_0x47cedf[_0x4759('0x6b')]}});}return null;})[_0x4759('0x13')](handleEntityNotFound(_0x3feeda,null))[_0x4759('0x13')](function(_0x30f471){if(_0x30f471){_0x10946f[_0x4759('0x6e')]=_0x30f471['get']({'plain':!![]});interaction_log[_0x4759('0x14')](_0x4759('0x84'),_0x11604b['user']['id'],_0x11604b[_0x4759('0x6f')]['name'],_0x11604b[_0x4759('0x6f')][_0x4759('0x70')],_0x10946f[_0x4759('0x6e')]['id'],_0x11604b[_0x4759('0x48')]?JSON['stringify'](_0x11604b[_0x4759('0x48')]):_0x4759('0x71'));return respondWithRpcPromise(_0x4759('0x85'),_0x4759('0x86'),_0x10946f);}return null;})['then'](function(_0x197d1e){var _0x7e4df3=_0x4759('0x74')+_0x197d1e[_0x4759('0x1a')][_0x4759('0x75')];return db[_0x4759('0x76')][_0x4759('0x2d')](_0x7e4df3,{'type':db[_0x4759('0x87')][_0x4759('0x77')][_0x4759('0x88')],'raw':!![]})['then'](function(_0x105749){return _0x105749;});})[_0x4759('0x13')](function(_0x31e0f5){if(_0x31e0f5){_0x10946f[_0x4759('0x1a')][_0x4759('0x89')]=_0x31e0f5[0x0];if(!_0x11604b[_0x4759('0x48')][_0x4759('0x67')])return;return db[_0x4759('0x78')][_0x4759('0x47')]({'where':{'id':_0x11604b[_0x4759('0x48')]['UserId'],'role':_0x4759('0x68')},'attributes':['id','name',_0x4759('0x8a'),'email','internal'],'raw':!![]});}return null;})[_0x4759('0x13')](function(_0x12021f){if(!_0x12021f)return null;_0x10946f[_0x4759('0x1a')][_0x4759('0x68')]=_0x12021f;return _0x10946f;})[_0x4759('0x13')](function(_0x2db66d){if(_0x2db66d){_0x2db66d[_0x4759('0x1a')][_0x4759('0x7c')]=util['format'](_0x4759('0x7d'),_0x11604b['user'][_0x4759('0x26')]);_0x2db66d[_0x4759('0x1a')][_0x4759('0x7e')]=_0x10946f[_0x4759('0x7e')];_0x2db66d[_0x4759('0x1a')][_0x4759('0x7f')]=_0x10946f['channel'];_0x2db66d['message'][_0x4759('0x80')]=_0x4759('0x8b');_0x2db66d[_0x4759('0x1a')][_0x4759('0x48')]=htmlToText[_0x4759('0x81')](_0x10946f['message'][_0x4759('0x48')]);respondWithRpcPromise('EventManager',_0x4759('0x82'),{'event':_0x4759('0x8c'),'message':_0x2db66d[_0x4759('0x1a')]},client9002);return _0x10946f;}return null;})[_0x4759('0x13')](respondWithResult(_0x3feeda,null))[_0x4759('0x42')](handleError(_0x3feeda,null));};exports[_0x4759('0x8d')]=function(_0x37ae32,_0x177247){var _0x24cc7a=moment()[_0x4759('0x8e')]()[_0x4759('0x8f')]();var _0x169669=path[_0x4759('0x59')](config['root'],'server',_0x4759('0x90'),_0x4759('0x91'));var _0x3205a1=path['join'](config[_0x4759('0x5a')],_0x4759('0x92'),_0x4759('0x90'),_0x4759('0x58'));var _0x2745ad=util[_0x4759('0x60')]('message-%s.eml',_0x24cc7a);return db['MailMessage']['find']({'where':{'id':_0x37ae32[_0x4759('0x44')]['id']},'attributes':['id',_0x4759('0x48'),_0x4759('0x93'),'to','cc',_0x4759('0x94'),'subject',_0x4759('0x95')],'include':_0x37ae32['query']['attachments']?[{'model':db['Attachment'],'as':_0x4759('0x96')}]:undefined})['then'](handleEntityNotFound(_0x177247,null))[_0x4759('0x13')](function(_0x17913f){if(_0x17913f){var _0x4aad6c=_0x17913f;var _0x574ba3={'from':_0x4aad6c[_0x4759('0x93')],'to':_0x4aad6c['to'],'subject':_0x4aad6c[_0x4759('0x97')],'html':htmlEntities[_0x4759('0x98')](_0x4aad6c['body']),'headers':{'Date':moment(_0x4aad6c['createdAt'])['format'](_0x4759('0x99'))},'attachments':[]};if(_0x17913f['cc']){_0x574ba3[_0x4759('0x9a')]['Cc']=_0x17913f['cc'];}if(_0x17913f[_0x4759('0x94')]){_0x574ba3[_0x4759('0x9a')][_0x4759('0x9b')]=_0x17913f[_0x4759('0x94')];}return new BPromise(function(_0xea188e,_0x1ac711){if(_0x17913f[_0x4759('0x96')]){for(var _0x460f61=0x0;_0x460f61<_0x17913f[_0x4759('0x96')][_0x4759('0x46')];_0x460f61++){var _0x44c86b=_0x17913f['Attachments'][_0x460f61];var _0x512f71=path[_0x4759('0x59')](_0x3205a1,_0x44c86b[_0x4759('0x5b')]);if(fs[_0x4759('0x9c')](_0x512f71)){_0x574ba3[_0x4759('0x58')][_0x4759('0x9d')]({'name':_0x44c86b[_0x4759('0x26')],'contentType':_0x44c86b[_0x4759('0x2a')],'data':fs[_0x4759('0x9e')](_0x512f71)});}}}emlformat['build'](_0x574ba3,function(_0x3ce727,_0x218731){if(_0x3ce727)return _0x1ac711(_0x3ce727);fs[_0x4759('0x9f')](path[_0x4759('0x59')](_0x169669,_0x2745ad),_0x218731);return _0xea188e(_0x218731);});});}})[_0x4759('0x13')](function(_0x5532b4){if(_0x5532b4){return _0x177247[_0x4759('0x8d')](path[_0x4759('0x59')](_0x169669,_0x2745ad),_0x2745ad,function(_0xb364f){if(!_0xb364f)fs[_0x4759('0xa0')](path['join'](_0x169669,_0x2745ad));});}})[_0x4759('0x42')](handleError(_0x177247,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index d1ac2af..26a3855 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 _0xa094=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x17c1cb,_0x5abf00){var _0x586e4c=function(_0x409e7c){while(--_0x409e7c){_0x17c1cb['push'](_0x17c1cb['shift']());}};_0x586e4c(++_0x5abf00);}(_0xa094,0xaf));var _0x4a09=function(_0x127a1a,_0x484489){_0x127a1a=_0x127a1a-0x0;var _0x2d9daa=_0xa094[_0x127a1a];return _0x2d9daa;};'use strict';var EventEmitter=require(_0x4a09('0x0'));var MailMessage=require(_0x4a09('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x4a09('0x2')](0x0);var events={'afterCreate':_0x4a09('0x3'),'afterUpdate':_0x4a09('0x4'),'afterDestroy':'remove'};function emitEvent(_0xf9b264){return function(_0x5a41c6,_0x2fcc90,_0x2f2e7c){MailMessageEvents[_0x4a09('0x5')](_0xf9b264+':'+_0x5a41c6['id'],_0x5a41c6);MailMessageEvents[_0x4a09('0x5')](_0xf9b264,_0x5a41c6);_0x2f2e7c(null);};}for(var e in events){if(events[_0x4a09('0x6')](e)){var event=events[e];MailMessage[_0x4a09('0x7')](e,emitEvent(event));}}module[_0x4a09('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x89c0=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x326720,_0x3b25db){var _0x4f6879=function(_0x3bf261){while(--_0x3bf261){_0x326720['push'](_0x326720['shift']());}};_0x4f6879(++_0x3b25db);}(_0x89c0,0x1b4));var _0x089c=function(_0x16881f,_0x181219){_0x16881f=_0x16881f-0x0;var _0x5ce5fb=_0x89c0[_0x16881f];return _0x5ce5fb;};'use strict';var EventEmitter=require(_0x089c('0x0'));var MailMessage=require(_0x089c('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x089c('0x2')](0x0);var events={'afterCreate':_0x089c('0x3'),'afterUpdate':_0x089c('0x4'),'afterDestroy':_0x089c('0x5')};function emitEvent(_0x2ebed4){return function(_0xc861eb,_0x5c79dd,_0x309ef0){MailMessageEvents[_0x089c('0x6')](_0x2ebed4+':'+_0xc861eb['id'],_0xc861eb);MailMessageEvents['emit'](_0x2ebed4,_0xc861eb);_0x309ef0(null);};}for(var e in events){if(events[_0x089c('0x7')](e)){var event=events[e];MailMessage[_0x089c('0x8')](e,emitEvent(event));}}module[_0x089c('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 09c1a31..44f956b 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 _0x542f=['messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','api','request-promise','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x542f,0x75));var _0xf542=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0x542f[_0x2ca9d4];return _0x258956;};'use strict';var _=require(_0xf542('0x0'));var util=require(_0xf542('0x1'));var logger=require('../../config/logger')(_0xf542('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf542('0x3'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0xf542('0x4'));var config=require(_0xf542('0x5'));var attributes=require(_0xf542('0x6'));module[_0xf542('0x7')]=function(_0x5855bd,_0x8211c9){return _0x5855bd[_0xf542('0x8')](_0xf542('0x9'),attributes,{'tableName':_0xf542('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xf542('0xb')]},{'name':_0xf542('0xc'),'fields':[_0xf542('0xd'),'subject'],'type':_0xf542('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x503e47,_0x5bef32,_0x1e9fc5){if(_0x503e47[_0xf542('0xf')]){_0x503e47['plainBody']=htmlToText[_0xf542('0x10')](_0x503e47['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1e9fc5(null,_0x5bef32);},'afterCreate':function(_0x23b1be,_0x2da553,_0x30ce7e){var _0x5d7165=_0x5855bd[_0xf542('0x11')];var _0x18168c=_0x23b1be[_0xf542('0x12')]({'plain':!![]});if(_0x18168c[_0xf542('0x13')]['toLowerCase']()==='in'||_0x18168c[_0xf542('0x13')][_0xf542('0x14')]()===_0xf542('0x15')&&!_0x18168c[_0xf542('0x16')]&&!_[_0xf542('0x17')](_0x18168c[_0xf542('0x18')])){_0x5d7165['MailInteraction'][_0xf542('0x19')]({'where':{'id':_0x18168c['MailInteractionId']}})[_0xf542('0x1a')](function(_0x5ad288){if(_0x5ad288){_0x5ad288[_0xf542('0x1b')]({'lastMsgAt':_0x18168c[_0xf542('0x1c')],'lastMsgDirection':_0x18168c['direction'][_0xf542('0x14')]()});}})[_0xf542('0x1d')](function(_0x24bf26){console[_0xf542('0x1e')](_0x24bf26);});}_0x30ce7e();}},'charset':'utf8mb4','collate':_0xf542('0x1f')});}; \ No newline at end of file +var _0x7b57=['isNil','UserId','MailInteraction','findOne','MailInteractionId','then','createdAt','catch','error','lodash','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','body','models','get','direction','toLowerCase','secret'];(function(_0x3806dc,_0x2791f8){var _0x5d5e89=function(_0x15e018){while(--_0x15e018){_0x3806dc['push'](_0x3806dc['shift']());}};_0x5d5e89(++_0x2791f8);}(_0x7b57,0xe9));var _0x77b5=function(_0x484e38,_0x476fc7){_0x484e38=_0x484e38-0x0;var _0x14249a=_0x7b57[_0x484e38];return _0x14249a;};'use strict';var _=require(_0x77b5('0x0'));var util=require(_0x77b5('0x1'));var logger=require(_0x77b5('0x2'))(_0x77b5('0x3'));var moment=require('moment');var BPromise=require(_0x77b5('0x4'));var rp=require(_0x77b5('0x5'));var htmlToText=require(_0x77b5('0x6'));var fs=require('fs');var path=require(_0x77b5('0x7'));var rimraf=require(_0x77b5('0x8'));var config=require(_0x77b5('0x9'));var attributes=require('./mailMessage.attributes');module[_0x77b5('0xa')]=function(_0x13050b,_0x302243){return _0x13050b[_0x77b5('0xb')](_0x77b5('0xc'),attributes,{'tableName':_0x77b5('0xd'),'paranoid':![],'indexes':[{'name':_0x77b5('0xe'),'fields':['messageId']},{'name':_0x77b5('0xf'),'fields':[_0x77b5('0x10'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x230e13,_0x5ac44e,_0x8db2d8){if(_0x230e13[_0x77b5('0x11')]){_0x230e13[_0x77b5('0x10')]=htmlToText['fromString'](_0x230e13[_0x77b5('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x8db2d8(null,_0x5ac44e);},'afterCreate':function(_0x2f7780,_0x318dee,_0x459e92){var _0x52dbec=_0x13050b[_0x77b5('0x12')];var _0x27caaa=_0x2f7780[_0x77b5('0x13')]({'plain':!![]});if(_0x27caaa[_0x77b5('0x14')][_0x77b5('0x15')]()==='in'||_0x27caaa[_0x77b5('0x14')][_0x77b5('0x15')]()==='out'&&!_0x27caaa[_0x77b5('0x16')]&&!_[_0x77b5('0x17')](_0x27caaa[_0x77b5('0x18')])){_0x52dbec[_0x77b5('0x19')][_0x77b5('0x1a')]({'where':{'id':_0x27caaa[_0x77b5('0x1b')]}})[_0x77b5('0x1c')](function(_0x56ee48){if(_0x56ee48){_0x56ee48['update']({'lastMsgAt':_0x27caaa[_0x77b5('0x1d')],'lastMsgDirection':_0x27caaa[_0x77b5('0x14')][_0x77b5('0x15')]()});}})[_0x77b5('0x1e')](function(_0x4d7b5f){console[_0x77b5('0x1f')](_0x4d7b5f);});}_0x459e92();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 74ec6fb..3774d15 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 _0xd4f4=['CreateMailMessage','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1082ab,_0x38b2ff){var _0x3d261c=function(_0x270a2a){while(--_0x270a2a){_0x1082ab['push'](_0x1082ab['shift']());}};_0x3d261c(++_0x38b2ff);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x452883,_0x2eec1a){_0x452883=_0x452883-0x0;var _0x5a67a1=_0xd4f4[_0x452883];return _0x5a67a1;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var moment=require(_0x4d4f('0x2'));var BPromise=require(_0x4d4f('0x3'));var rs=require(_0x4d4f('0x4'));var fs=require('fs');var Redis=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var utils=require(_0x4d4f('0x7'));var logger=require(_0x4d4f('0x8'))(_0x4d4f('0x9'));var config=require(_0x4d4f('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x4d4f('0xb')]=_[_0x4d4f('0xc')](config[_0x4d4f('0xb')],{'host':_0x4d4f('0xd'),'port':0x18eb});var socket=require(_0x4d4f('0xe'))(new Redis(config[_0x4d4f('0xb')]));require(_0x4d4f('0xf'))[_0x4d4f('0x10')](socket);function respondWithRpcPromise(_0x385597,_0xba5200,_0x20db50){return new BPromise(function(_0x88b592,_0x128d39){return client[_0x4d4f('0x11')](_0x385597,_0x20db50)[_0x4d4f('0x12')](function(_0x28fb3e){logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0xba5200,_0x4d4f('0x15'),JSON[_0x4d4f('0x16')](_0x28fb3e));if(_0x28fb3e['error']){if(_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x18')]===0x1f4){logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x128d39(_0x28fb3e[_0x4d4f('0x17')]['message']);}logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x88b592(_0x28fb3e[_0x4d4f('0x17')]['message']);}else{logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');_0x88b592(_0x28fb3e['result']['message']);}})['catch'](function(_0x5eebec){logger[_0x4d4f('0x17')](_0x4d4f('0x14'),_0xba5200,_0x5eebec);_0x128d39(_0x5eebec);});});}exports[_0x4d4f('0x1a')]=function(_0x3566a5){var _0x5d7b1f=this;return new Promise(function(_0x5b2863,_0x1e1ae2){return db['MailMessage'][_0x4d4f('0x1b')](_0x3566a5[_0x4d4f('0x1c')],{'raw':_0x3566a5[_0x4d4f('0x1d')]?_0x3566a5[_0x4d4f('0x1d')][_0x4d4f('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x570520){logger[_0x4d4f('0x13')]('CreateMailMessage',_0x3566a5);logger[_0x4d4f('0x1f')](_0x4d4f('0x1a'),_0x3566a5,JSON[_0x4d4f('0x16')](_0x570520));_0x5b2863(_0x570520);})[_0x4d4f('0x20')](function(_0xf3f7a4){logger['error'](_0x4d4f('0x1a'),_0xf3f7a4[_0x4d4f('0x19')],_0x3566a5);_0x1e1ae2(_0x5d7b1f[_0x4d4f('0x17')](0x1f4,_0xf3f7a4[_0x4d4f('0x19')]));});});}; \ No newline at end of file +var _0xa30a=['then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','MailMessage','create','body','options','raw','CreateMailMessage','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./mailMessage.socket','register'];(function(_0x1678c8,_0x1c32f4){var _0x387aa9=function(_0x2803bd){while(--_0x2803bd){_0x1678c8['push'](_0x1678c8['shift']());}};_0x387aa9(++_0x1c32f4);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});config[_0xaa30('0xb')]=_[_0xaa30('0xc')](config[_0xaa30('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa30('0xd'))(new Redis(config[_0xaa30('0xb')]));require(_0xaa30('0xe'))[_0xaa30('0xf')](socket);function respondWithRpcPromise(_0x14a6a6,_0x45419f,_0x56f686){return new BPromise(function(_0x5afbf5,_0x12a8ce){return client['request'](_0x14a6a6,_0x56f686)[_0xaa30('0x10')](function(_0x1a5681){logger[_0xaa30('0x11')](_0xaa30('0x12'),_0x45419f,'request\x20sent');logger[_0xaa30('0x13')](_0xaa30('0x14'),_0x45419f,_0xaa30('0x15'),JSON['stringify'](_0x1a5681));if(_0x1a5681[_0xaa30('0x16')]){if(_0x1a5681[_0xaa30('0x16')][_0xaa30('0x17')]===0x1f4){logger[_0xaa30('0x16')](_0xaa30('0x12'),_0x45419f,_0x1a5681[_0xaa30('0x16')][_0xaa30('0x18')]);return _0x12a8ce(_0x1a5681[_0xaa30('0x16')][_0xaa30('0x18')]);}logger[_0xaa30('0x16')]('MailMessage,\x20%s,\x20%s',_0x45419f,_0x1a5681[_0xaa30('0x16')]['message']);return _0x5afbf5(_0x1a5681['error'][_0xaa30('0x18')]);}else{logger[_0xaa30('0x11')](_0xaa30('0x12'),_0x45419f,'request\x20sent');_0x5afbf5(_0x1a5681['result']['message']);}})[_0xaa30('0x19')](function(_0x4acdfa){logger[_0xaa30('0x16')](_0xaa30('0x12'),_0x45419f,_0x4acdfa);_0x12a8ce(_0x4acdfa);});});}exports['CreateMailMessage']=function(_0x4e29f9){var _0x520abb=this;return new Promise(function(_0x3cbf92,_0x3e4f1d){return db[_0xaa30('0x1a')][_0xaa30('0x1b')](_0x4e29f9[_0xaa30('0x1c')],{'raw':_0x4e29f9['options']?_0x4e29f9[_0xaa30('0x1d')][_0xaa30('0x1e')]===undefined?!![]:![]:!![]})[_0xaa30('0x10')](function(_0x2d9e35){logger[_0xaa30('0x11')]('CreateMailMessage',_0x4e29f9);logger[_0xaa30('0x13')](_0xaa30('0x1f'),_0x4e29f9,JSON[_0xaa30('0x20')](_0x2d9e35));_0x3cbf92(_0x2d9e35);})[_0xaa30('0x19')](function(_0x57d1ca){logger[_0xaa30('0x16')](_0xaa30('0x1f'),_0x57d1ca[_0xaa30('0x18')],_0x4e29f9);_0x3e4f1d(_0x520abb[_0xaa30('0x16')](0x1f4,_0x57d1ca[_0xaa30('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 498155f..d625705 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 _0x4764=['save','remove','update','removeListener','register','length','mailMessage:','./mailMessage.events'];(function(_0x3ff007,_0x23a436){var _0x5ae853=function(_0x1233a3){while(--_0x1233a3){_0x3ff007['push'](_0x3ff007['shift']());}};_0x5ae853(++_0x23a436);}(_0x4764,0x14f));var _0x4476=function(_0xe1ff3,_0x1f3531){_0xe1ff3=_0xe1ff3-0x0;var _0x2e1625=_0x4764[_0xe1ff3];return _0x2e1625;};'use strict';var MailMessageEvents=require(_0x4476('0x0'));var events=[_0x4476('0x1'),_0x4476('0x2'),_0x4476('0x3')];function createListener(_0x4b7ab3,_0x2f80ec){return function(_0x2b8d78){_0x2f80ec['emit'](_0x4b7ab3,_0x2b8d78);};}function removeListener(_0x216810,_0x1bf5ad){return function(){MailMessageEvents[_0x4476('0x4')](_0x216810,_0x1bf5ad);};}exports[_0x4476('0x5')]=function(_0x329b0e){for(var _0x202d48=0x0,_0x52c0cb=events[_0x4476('0x6')];_0x202d48<_0x52c0cb;_0x202d48++){var _0x8a5130=events[_0x202d48];var _0x5c0002=createListener(_0x4476('0x7')+_0x8a5130,_0x329b0e);MailMessageEvents['on'](_0x8a5130,_0x5c0002);}}; \ No newline at end of file +var _0xd0ba=['register','length','save','remove','update','emit'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xd0ba,0x17c));var _0xad0b=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xd0ba[_0x279d37];return _0x530173;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xad0b('0x0'),_0xad0b('0x1'),_0xad0b('0x2')];function createListener(_0x5f3a88,_0x1789a4){return function(_0xfa7868){_0x1789a4[_0xad0b('0x3')](_0x5f3a88,_0xfa7868);};}function removeListener(_0x1b02e2,_0x2ebbaa){return function(){MailMessageEvents['removeListener'](_0x1b02e2,_0x2ebbaa);};}exports[_0xad0b('0x4')]=function(_0xb826aa){for(var _0x3acad3=0x0,_0x482525=events[_0xad0b('0x5')];_0x3acad3<_0x482525;_0x3acad3++){var _0x10cf14=events[_0x3acad3];var _0x529785=createListener('mailMessage:'+_0x10cf14,_0xb826aa);MailMessageEvents['on'](_0x10cf14,_0x529785);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index d376991..d4251d6 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 _0x4379=['Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','path'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x4379,0x15d));var _0x9437=function(_0x8626f,_0x58901f){_0x8626f=_0x8626f-0x0;var _0x557402=_0x4379[_0x8626f];return _0x557402;};'use strict';var multer=require(_0x9437('0x0'));var util=require('util');var path=require(_0x9437('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9437('0x2')]();var fs_extra=require(_0x9437('0x3'));var auth=require(_0x9437('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0x9437('0x5')]('/',auth[_0x9437('0x6')](),controller[_0x9437('0x7')]);router[_0x9437('0x5')](_0x9437('0x8'),auth[_0x9437('0x6')](),controller[_0x9437('0x9')]);router['get'](_0x9437('0xa'),auth[_0x9437('0x6')](),controller[_0x9437('0xb')]);router[_0x9437('0x5')](_0x9437('0xc'),auth[_0x9437('0x6')](),controller[_0x9437('0xd')]);router['get'](_0x9437('0xe'),auth[_0x9437('0x6')](),controller[_0x9437('0xf')]);router['get'](_0x9437('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x9437('0x11')]('/',auth[_0x9437('0x6')](),controller[_0x9437('0x12')]);router[_0x9437('0x11')]('/:id/teams',auth[_0x9437('0x6')](),controller[_0x9437('0x13')]);router[_0x9437('0x11')](_0x9437('0x10'),auth[_0x9437('0x6')](),controller[_0x9437('0x14')]);router[_0x9437('0x15')](_0x9437('0xa'),auth[_0x9437('0x6')](),controller['update']);router[_0x9437('0x16')](_0x9437('0xa'),auth['isAuthenticated'](),controller[_0x9437('0x17')]);router[_0x9437('0x16')]('/:id/teams',auth[_0x9437('0x6')](),controller[_0x9437('0x18')]);router[_0x9437('0x16')](_0x9437('0x10'),auth[_0x9437('0x6')](),controller[_0x9437('0x19')]);module[_0x9437('0x1a')]=router; \ No newline at end of file +var _0xe27c=['express','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer'];(function(_0x38f3dd,_0x3330b1){var _0x862c9e=function(_0x35d670){while(--_0x35d670){_0x38f3dd['push'](_0x38f3dd['shift']());}};_0x862c9e(++_0x3330b1);}(_0xe27c,0x143));var _0xce27=function(_0x3d8fac,_0x269cb1){_0x3d8fac=_0x3d8fac-0x0;var _0x3a1482=_0xe27c[_0x3d8fac];return _0x3a1482;};'use strict';var multer=require(_0xce27('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xce27('0x1'));var router=express['Router']();var fs_extra=require(_0xce27('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xce27('0x3'));var config=require(_0xce27('0x4'));var controller=require(_0xce27('0x5'));router[_0xce27('0x6')]('/',auth[_0xce27('0x7')](),controller['index']);router[_0xce27('0x6')](_0xce27('0x8'),auth[_0xce27('0x7')](),controller[_0xce27('0x9')]);router['get'](_0xce27('0xa'),auth['isAuthenticated'](),controller[_0xce27('0xb')]);router[_0xce27('0x6')]('/:id/members',auth[_0xce27('0x7')](),controller[_0xce27('0xc')]);router[_0xce27('0x6')](_0xce27('0xd'),auth[_0xce27('0x7')](),controller[_0xce27('0xe')]);router[_0xce27('0x6')](_0xce27('0xf'),auth[_0xce27('0x7')](),controller[_0xce27('0x10')]);router[_0xce27('0x11')]('/',auth[_0xce27('0x7')](),controller['create']);router['post'](_0xce27('0xd'),auth['isAuthenticated'](),controller[_0xce27('0x12')]);router[_0xce27('0x11')](_0xce27('0xf'),auth[_0xce27('0x7')](),controller[_0xce27('0x13')]);router[_0xce27('0x14')](_0xce27('0xa'),auth[_0xce27('0x7')](),controller[_0xce27('0x15')]);router[_0xce27('0x16')](_0xce27('0xa'),auth[_0xce27('0x7')](),controller[_0xce27('0x17')]);router[_0xce27('0x16')](_0xce27('0xd'),auth[_0xce27('0x7')](),controller[_0xce27('0x18')]);router[_0xce27('0x16')](_0xce27('0xf'),auth[_0xce27('0x7')](),controller[_0xce27('0x19')]);module[_0xce27('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 8c5f32c..cf943ca 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 _0x31a7=['STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x300b26,_0x3a9b67){var _0x5cb1ae=function(_0x2b8e7f){while(--_0x2b8e7f){_0x300b26['push'](_0x300b26['shift']());}};_0x5cb1ae(++_0x3a9b67);}(_0x31a7,0x122));var _0x731a=function(_0x1db7a9,_0x4c4fc7){_0x1db7a9=_0x1db7a9-0x0;var _0x496ca1=_0x31a7[_0x1db7a9];return _0x496ca1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x731a('0x0')],'unique':_0x731a('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x731a('0x0')]},'timeout':{'type':Sequelize[_0x731a('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x731a('0x3')](_0x731a('0x4'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x59a5=['sequelize','exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x59a5,0x1b0));var _0x559a=function(_0x3d041e,_0x1d5b99){_0x3d041e=_0x3d041e-0x0;var _0x2127e7=_0x59a5[_0x3d041e];return _0x2127e7;};'use strict';var Sequelize=require(_0x559a('0x0'));module[_0x559a('0x1')]={'name':{'type':Sequelize[_0x559a('0x2')],'unique':_0x559a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x559a('0x2')]},'timeout':{'type':Sequelize[_0x559a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x559a('0x5'),_0x559a('0x6'),_0x559a('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 962b5fb..19fe257 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 _0xa1bb=['ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','all','union','compact','transaction','removeAgents','userMailQueue:remove','addAgents','spread','isArray','User','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','desk.js','to-csv','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','./mailQueue.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','fieldName','type','key','model','filters','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MailQueue','includeAll','include','findAll','catch','show','rawAttributes','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserMailQueue','order','pick','MailQueueId','findAndCountAll','mailPause','updatedAt','rows','SIP','getTeams','Team','ids','Agents','voicePause','interface','sequelize','addTeams','each','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xa1bb,0x9b));var _0xba1b=function(_0x175cd1,_0x5dd9f8){_0x175cd1=_0x175cd1-0x0;var _0x3ff513=_0xa1bb[_0x175cd1];return _0x3ff513;};'use strict';var emlformat=require(_0xba1b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xba1b('0x1'));var rp=require(_0xba1b('0x2'));var moment=require(_0xba1b('0x3'));var BPromise=require(_0xba1b('0x4'));var Mustache=require(_0xba1b('0x5'));var util=require(_0xba1b('0x6'));var path=require(_0xba1b('0x7'));var sox=require(_0xba1b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba1b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xba1b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xba1b('0xb'));var toCsv=require(_0xba1b('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xba1b('0xd'));var authService=require(_0xba1b('0xe'));var qs=require(_0xba1b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba1b('0x10'));var logger=require(_0xba1b('0x11'))(_0xba1b('0x12'));var utils=require(_0xba1b('0x13'));var config=require(_0xba1b('0x14'));var licenseUtil=require(_0xba1b('0x15'));var db=require(_0xba1b('0x16'))['db'];config[_0xba1b('0x17')]=_['defaults'](config[_0xba1b('0x17')],{'host':_0xba1b('0x18'),'port':0x18eb});var socket=require(_0xba1b('0x19'))(new Redis(config[_0xba1b('0x17')]));require(_0xba1b('0x1a'))[_0xba1b('0x1b')](socket);function respondWithStatusCode(_0x417274,_0xb11313){_0xb11313=_0xb11313||0xcc;return function(_0x4ee2a3){if(_0x4ee2a3){return _0x417274[_0xba1b('0x1c')](_0xb11313);}return _0x417274['status'](_0xb11313)[_0xba1b('0x1d')]();};}function respondWithResult(_0x24397f,_0x17da05){_0x17da05=_0x17da05||0xc8;return function(_0x1dbde1){if(_0x1dbde1){return _0x24397f[_0xba1b('0x1e')](_0x17da05)[_0xba1b('0x1f')](_0x1dbde1);}};}function respondWithFilteredResult(_0x487867,_0x29f578){return function(_0x3d2cf6){if(_0x3d2cf6){var _0x50f421=typeof _0x29f578['offset']===_0xba1b('0x20')&&typeof _0x29f578[_0xba1b('0x21')]===_0xba1b('0x20');var _0x4c9b1f=_0x3d2cf6['count'];var _0x252bf0=_0x50f421?0x0:_0x29f578['offset'];var _0xab1997=_0x50f421?_0x3d2cf6[_0xba1b('0x22')]:_0x29f578[_0xba1b('0x23')]+_0x29f578['limit'];var _0x545a9d;if(_0xab1997>=_0x4c9b1f){_0xab1997=_0x4c9b1f;_0x545a9d=0xc8;}else{_0x545a9d=0xce;}_0x487867[_0xba1b('0x1e')](_0x545a9d);return _0x487867[_0xba1b('0x24')](_0xba1b('0x25'),_0x252bf0+'-'+_0xab1997+'/'+_0x4c9b1f)[_0xba1b('0x1f')](_0x3d2cf6);}return null;};}function patchUpdates(_0x452883){return function(_0x5cdaea){try{jsonpatch[_0xba1b('0x26')](_0x5cdaea,_0x452883,!![]);}catch(_0x2241af){return BPromise['reject'](_0x2241af);}return _0x5cdaea[_0xba1b('0x27')]();};}function saveUpdates(_0x1799f9,_0x2e44bd){return function(_0x504748){if(_0x504748){return _0x504748[_0xba1b('0x28')](_0x1799f9)[_0xba1b('0x29')](function(_0x7a7bb0){return _0x7a7bb0;});}return null;};}function removeEntity(_0x4cd385,_0x5ec0f4){return function(_0x4a0dd8){if(_0x4a0dd8){return _0x4a0dd8[_0xba1b('0x2a')]()['then'](function(){var _0x5c7363=_0x4a0dd8[_0xba1b('0x2b')]({'plain':!![]});var _0x5c2781='MailQueues';return db[_0xba1b('0x2c')][_0xba1b('0x2a')]({'where':{'type':_0x5c2781,'resourceId':_0x5c7363['id']}})[_0xba1b('0x29')](function(){return _0x4a0dd8;});})[_0xba1b('0x29')](function(){_0x4cd385['status'](0xcc)[_0xba1b('0x1d')]();});}};}function handleEntityNotFound(_0x3b113a,_0x3f3b79){return function(_0x3f45f5){if(!_0x3f45f5){_0x3b113a['sendStatus'](0x194);}return _0x3f45f5;};}function handleError(_0x1a5450,_0x2b789b){_0x2b789b=_0x2b789b||0x1f4;return function(_0x398981){logger[_0xba1b('0x2d')](_0x398981[_0xba1b('0x2e')]);if(_0x398981[_0xba1b('0x2f')]){delete _0x398981[_0xba1b('0x2f')];}_0x1a5450[_0xba1b('0x1e')](_0x2b789b)[_0xba1b('0x30')](_0x398981);};}exports['index']=function(_0x1d20e0,_0x48797a){var _0x2dd260={},_0x19361d={},_0x3b86be={'count':0x0,'rows':[]};var _0x18b024=_[_0xba1b('0x31')](db['MailQueue']['rawAttributes'],function(_0x3f77fc){return{'name':_0x3f77fc[_0xba1b('0x32')],'type':_0x3f77fc[_0xba1b('0x33')][_0xba1b('0x34')]};});_0x19361d[_0xba1b('0x35')]=_['map'](_0x18b024,_0xba1b('0x2f'));_0x19361d['query']=_['keys'](_0x1d20e0['query']);_0x19361d[_0xba1b('0x36')]=_['intersection'](_0x19361d[_0xba1b('0x35')],_0x19361d['query']);_0x2dd260[_0xba1b('0x37')]=_[_0xba1b('0x38')](_0x19361d['model'],qs[_0xba1b('0x39')](_0x1d20e0[_0xba1b('0x3a')]['fields']));_0x2dd260['attributes']=_0x2dd260[_0xba1b('0x37')][_0xba1b('0x3b')]?_0x2dd260[_0xba1b('0x37')]:_0x19361d[_0xba1b('0x35')];if(!_0x1d20e0[_0xba1b('0x3a')][_0xba1b('0x3c')](_0xba1b('0x3d'))){_0x2dd260[_0xba1b('0x21')]=qs['limit'](_0x1d20e0[_0xba1b('0x3a')][_0xba1b('0x21')]);_0x2dd260[_0xba1b('0x23')]=qs[_0xba1b('0x23')](_0x1d20e0[_0xba1b('0x3a')][_0xba1b('0x23')]);}_0x2dd260['order']=qs[_0xba1b('0x3e')](_0x1d20e0[_0xba1b('0x3a')][_0xba1b('0x3e')]);_0x2dd260[_0xba1b('0x3f')]=qs['filters'](_['pick'](_0x1d20e0[_0xba1b('0x3a')],_0x19361d[_0xba1b('0x36')]),_0x18b024);if(_0x1d20e0[_0xba1b('0x3a')][_0xba1b('0x40')]){_0x2dd260[_0xba1b('0x3f')]=_[_0xba1b('0x41')](_0x2dd260['where'],{'$or':_[_0xba1b('0x31')](_0x18b024,function(_0x3288da){if(_0x3288da[_0xba1b('0x33')]!==_0xba1b('0x42')){var _0x4b6d83={};_0x4b6d83[_0x3288da['name']]={'$like':'%'+_0x1d20e0['query'][_0xba1b('0x40')]+'%'};return _0x4b6d83;}})});}_0x2dd260=_['merge']({},_0x2dd260,_0x1d20e0[_0xba1b('0x43')]);var _0x4ea9af={'where':_0x2dd260[_0xba1b('0x3f')]};return db[_0xba1b('0x44')][_0xba1b('0x22')](_0x4ea9af)[_0xba1b('0x29')](function(_0x29892b){_0x3b86be[_0xba1b('0x22')]=_0x29892b;if(_0x1d20e0['query'][_0xba1b('0x45')]){_0x2dd260[_0xba1b('0x46')]=[{'all':!![]}];}return db[_0xba1b('0x44')][_0xba1b('0x47')](_0x2dd260);})[_0xba1b('0x29')](function(_0x34326b){_0x3b86be['rows']=_0x34326b;return _0x3b86be;})['then'](respondWithFilteredResult(_0x48797a,_0x2dd260))[_0xba1b('0x48')](handleError(_0x48797a,null));};exports[_0xba1b('0x49')]=function(_0x291ceb,_0x3a13ad){var _0x2bcc6e={'raw':!![],'where':{'id':_0x291ceb['params']['id']}},_0x50061a={};_0x50061a[_0xba1b('0x35')]=_['keys'](db[_0xba1b('0x44')][_0xba1b('0x4a')]);_0x50061a['query']=_[_0xba1b('0x4b')](_0x291ceb[_0xba1b('0x3a')]);_0x50061a[_0xba1b('0x36')]=_[_0xba1b('0x38')](_0x50061a[_0xba1b('0x35')],_0x50061a[_0xba1b('0x3a')]);_0x2bcc6e[_0xba1b('0x37')]=_['intersection'](_0x50061a[_0xba1b('0x35')],qs[_0xba1b('0x39')](_0x291ceb[_0xba1b('0x3a')][_0xba1b('0x39')]));_0x2bcc6e[_0xba1b('0x37')]=_0x2bcc6e['attributes'][_0xba1b('0x3b')]?_0x2bcc6e['attributes']:_0x50061a['model'];if(_0x291ceb[_0xba1b('0x3a')]['includeAll']){_0x2bcc6e[_0xba1b('0x46')]=[{'all':!![]}];}_0x2bcc6e=_[_0xba1b('0x41')]({},_0x2bcc6e,_0x291ceb[_0xba1b('0x43')]);return db['MailQueue']['find'](_0x2bcc6e)[_0xba1b('0x29')](handleEntityNotFound(_0x3a13ad,null))[_0xba1b('0x29')](respondWithResult(_0x3a13ad,null))[_0xba1b('0x48')](handleError(_0x3a13ad,null));};exports[_0xba1b('0x4c')]=function(_0x1f2e41,_0x3cacfe){return db[_0xba1b('0x44')][_0xba1b('0x4c')](_0x1f2e41[_0xba1b('0x4d')],{})[_0xba1b('0x29')](function(_0x380d19){var _0x16895b=_0x1f2e41['user'][_0xba1b('0x2b')]({'plain':!![]});if(!_0x16895b)throw new Error(_0xba1b('0x4e'));if(_0x16895b[_0xba1b('0x4f')]===_0xba1b('0x50')){var _0x3a3711=_0x380d19[_0xba1b('0x2b')]({'plain':!![]});var _0x363d50=_0xba1b('0x51');return db[_0xba1b('0x52')][_0xba1b('0x53')]({'where':{'name':_0x363d50,'userProfileId':_0x16895b[_0xba1b('0x54')]},'raw':!![]})[_0xba1b('0x29')](function(_0x412e7b){if(_0x412e7b&&_0x412e7b[_0xba1b('0x55')]===0x0){return db[_0xba1b('0x2c')][_0xba1b('0x4c')]({'name':_0x3a3711['name'],'resourceId':_0x3a3711['id'],'type':_0x412e7b[_0xba1b('0x2f')],'sectionId':_0x412e7b['id']},{})['then'](function(){return _0x380d19;});}else{return _0x380d19;}})[_0xba1b('0x48')](function(_0x3bf2fa){logger[_0xba1b('0x2d')](_0xba1b('0x56'),_0x3bf2fa);throw _0x3bf2fa;});}return _0x380d19;})['then'](respondWithResult(_0x3cacfe,0xc9))[_0xba1b('0x48')](handleError(_0x3cacfe,null));};exports[_0xba1b('0x28')]=function(_0x4bd209,_0x3c8245){if(_0x4bd209[_0xba1b('0x4d')]['id']){delete _0x4bd209[_0xba1b('0x4d')]['id'];}return db[_0xba1b('0x44')][_0xba1b('0x53')]({'where':{'id':_0x4bd209[_0xba1b('0x57')]['id']}})[_0xba1b('0x29')](handleEntityNotFound(_0x3c8245,null))[_0xba1b('0x29')](saveUpdates(_0x4bd209[_0xba1b('0x4d')],null))[_0xba1b('0x29')](respondWithResult(_0x3c8245,null))[_0xba1b('0x48')](handleError(_0x3c8245,null));};exports['destroy']=function(_0x129227,_0x10c26a){return db[_0xba1b('0x44')]['find']({'where':{'id':_0x129227[_0xba1b('0x57')]['id']}})['then'](handleEntityNotFound(_0x10c26a,null))[_0xba1b('0x29')](removeEntity(_0x10c26a,null))[_0xba1b('0x48')](handleError(_0x10c26a,null));};exports[_0xba1b('0x58')]=function(_0x14f9f4,_0x3e1027){return db[_0xba1b('0x44')]['describe']()[_0xba1b('0x29')](respondWithResult(_0x3e1027,null))[_0xba1b('0x48')](handleError(_0x3e1027,null));};exports['getMembers']=function(_0x8d67a,_0xbc1a20,_0x2ad151){var _0x76bcc7={'raw':!![],'where':{}},_0x453527={},_0x52ed35;return db[_0xba1b('0x44')][_0xba1b('0x59')]({'where':{'id':_0x8d67a[_0xba1b('0x57')]['id']}})[_0xba1b('0x29')](handleEntityNotFound(_0xbc1a20,null))[_0xba1b('0x29')](function(_0x514db4){if(_0x514db4){_0x52ed35=_0x514db4[_0xba1b('0x2b')]({'plain':!![]});_0x453527[_0xba1b('0x35')]=_[_0xba1b('0x4b')](db[_0xba1b('0x5a')]['rawAttributes']);_0x453527[_0xba1b('0x3a')]=_[_0xba1b('0x4b')](_0x8d67a[_0xba1b('0x3a')]);_0x453527[_0xba1b('0x36')]=_[_0xba1b('0x38')](_0x453527[_0xba1b('0x35')],_0x453527[_0xba1b('0x3a')]);_0x76bcc7[_0xba1b('0x37')]=_['intersection'](_0x453527[_0xba1b('0x35')],qs[_0xba1b('0x39')](_0x8d67a[_0xba1b('0x3a')][_0xba1b('0x39')]));_0x76bcc7[_0xba1b('0x37')]=_0x76bcc7[_0xba1b('0x37')][_0xba1b('0x3b')]?_0x76bcc7[_0xba1b('0x37')]:_0x453527['model'];if(!_0x8d67a['query'][_0xba1b('0x3c')](_0xba1b('0x3d'))){_0x76bcc7[_0xba1b('0x21')]=qs[_0xba1b('0x21')](_0x8d67a[_0xba1b('0x3a')][_0xba1b('0x21')]);_0x76bcc7[_0xba1b('0x23')]=qs['offset'](_0x8d67a['query'][_0xba1b('0x23')]);}_0x76bcc7[_0xba1b('0x5b')]=qs[_0xba1b('0x3e')](_0x8d67a[_0xba1b('0x3a')][_0xba1b('0x3e')]);_0x76bcc7[_0xba1b('0x3f')]=qs[_0xba1b('0x36')](_[_0xba1b('0x5c')](_0x8d67a[_0xba1b('0x3a')],_0x453527[_0xba1b('0x36')]));_0x76bcc7['where'][_0xba1b('0x5d')]=_0x514db4['id'];if(_0x8d67a[_0xba1b('0x3a')][_0xba1b('0x40')]){_0x76bcc7['where']=_[_0xba1b('0x41')](_0x76bcc7[_0xba1b('0x3f')],{'$or':_[_0xba1b('0x31')](_0x76bcc7[_0xba1b('0x37')],function(_0x15f3e9){var _0x406d6c={};_0x406d6c[_0x15f3e9]={'$like':'%'+_0x8d67a[_0xba1b('0x3a')][_0xba1b('0x40')]+'%'};return _0x406d6c;})});}_0x76bcc7=_['merge']({},_0x76bcc7,_0x8d67a[_0xba1b('0x43')]);return db[_0xba1b('0x5a')][_0xba1b('0x47')](_0x76bcc7);}})['then'](function(_0x4b7b4e){if(_0x4b7b4e){return db['User'][_0xba1b('0x5e')]({'where':{'id':_[_0xba1b('0x31')](_0x4b7b4e,'UserId'),'role':'agent'},'attributes':['id',_0xba1b('0x2f'),_0xba1b('0x5f'),_0xba1b('0x60'),'createdAt']});}})['then'](function(_0x214177){if(_0x214177){return{'count':_0x214177[_0xba1b('0x22')],'rows':_[_0xba1b('0x31')](_0x214177[_0xba1b('0x61')],function(_0x40b544){return{'membername':_0x40b544['name'],'UserId':_0x40b544['id'],'queue_name':_0x52ed35[_0xba1b('0x2f')],'MailQueueId':_0x52ed35['id'],'interface':util['format']('%s/%s',_0xba1b('0x62'),_0x40b544[_0xba1b('0x2f')]),'penalty':0x0,'paused':_0x40b544['mailPause'],'createdAt':_0x40b544['createdAt'],'updatedAt':_0x40b544['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xba1b('0x29')](respondWithFilteredResult(_0xbc1a20,_0x76bcc7))[_0xba1b('0x48')](handleError(_0xbc1a20,null));};exports[_0xba1b('0x63')]=function(_0x3dd10d,_0x5515c4,_0x318fcf){var _0x49e3de={};var _0x174171={};var _0x252f13;var _0x49229f;return db[_0xba1b('0x44')][_0xba1b('0x59')]({'where':{'id':_0x3dd10d[_0xba1b('0x57')]['id']}})[_0xba1b('0x29')](handleEntityNotFound(_0x5515c4,null))[_0xba1b('0x29')](function(_0x337b34){if(_0x337b34){_0x252f13=_0x337b34;_0x174171[_0xba1b('0x35')]=_['keys'](db[_0xba1b('0x64')][_0xba1b('0x4a')]);_0x174171[_0xba1b('0x3a')]=_['keys'](_0x3dd10d[_0xba1b('0x3a')]);_0x174171[_0xba1b('0x36')]=_[_0xba1b('0x38')](_0x174171[_0xba1b('0x35')],_0x174171[_0xba1b('0x3a')]);_0x49e3de[_0xba1b('0x37')]=_[_0xba1b('0x38')](_0x174171[_0xba1b('0x35')],qs[_0xba1b('0x39')](_0x3dd10d[_0xba1b('0x3a')]['fields']));_0x49e3de['attributes']=_0x49e3de[_0xba1b('0x37')][_0xba1b('0x3b')]?_0x49e3de[_0xba1b('0x37')]:_0x174171[_0xba1b('0x35')];_0x49e3de['order']=qs['sort'](_0x3dd10d[_0xba1b('0x3a')]['sort']);_0x49e3de['where']=qs['filters'](_[_0xba1b('0x5c')](_0x3dd10d[_0xba1b('0x3a')],_0x174171[_0xba1b('0x36')]));if(_0x3dd10d['query'][_0xba1b('0x40')]){_0x49e3de[_0xba1b('0x3f')]=_[_0xba1b('0x41')](_0x49e3de[_0xba1b('0x3f')],{'$or':_[_0xba1b('0x31')](_0x49e3de['attributes'],function(_0x6ea82a){var _0xea54ad={};_0xea54ad[_0x6ea82a]={'$like':'%'+_0x3dd10d[_0xba1b('0x3a')][_0xba1b('0x40')]+'%'};return _0xea54ad;})});}_0x49e3de=_[_0xba1b('0x41')]({},_0x49e3de,_0x3dd10d[_0xba1b('0x43')]);return _0x252f13[_0xba1b('0x63')](_0x49e3de);}})['then'](function(_0x1bcc8e){if(_0x1bcc8e){_0x49229f=_0x1bcc8e[_0xba1b('0x3b')];if(!_0x3dd10d[_0xba1b('0x3a')][_0xba1b('0x3c')](_0xba1b('0x3d'))){_0x49e3de['limit']=qs[_0xba1b('0x21')](_0x3dd10d['query'][_0xba1b('0x21')]);_0x49e3de[_0xba1b('0x23')]=qs['offset'](_0x3dd10d[_0xba1b('0x3a')][_0xba1b('0x23')]);}return _0x252f13[_0xba1b('0x63')](_0x49e3de);}})[_0xba1b('0x29')](function(_0x25c822){if(_0x25c822){return _0x25c822?{'count':_0x49229f,'rows':_0x25c822}:null;}})[_0xba1b('0x29')](respondWithResult(_0x5515c4,null))[_0xba1b('0x48')](handleError(_0x5515c4,null));};exports['addTeams']=function(_0x3c7328,_0x527973,_0x266491){var _0x524019=_0x3c7328[_0xba1b('0x4d')][_0xba1b('0x65')];return db[_0xba1b('0x64')][_0xba1b('0x47')]({'where':{'id':_0x524019},'attributes':['id'],'include':[{'model':db['User'],'as':_0xba1b('0x66'),'attributes':['id',_0xba1b('0x2f'),'online',_0xba1b('0x67'),_0xba1b('0x68')],'raw':!![]}]})[_0xba1b('0x29')](function(_0x26072c){if(_0x26072c){var _0x57a6ee=_['flatMap'](_0x26072c,function(_0x4dd59f){var _0x3320a2=_0x4dd59f[_0xba1b('0x2b')]({'plain':!![]});return _0x3320a2[_0xba1b('0x66')];});return db[_0xba1b('0x44')][_0xba1b('0x53')]({'where':{'id':_0x3c7328['params']['id']}})[_0xba1b('0x29')](function(_0x7ba601){return db[_0xba1b('0x69')]['transaction'](function(_0x19100a){return _0x7ba601[_0xba1b('0x6a')](_0x524019,{'transaction':_0x19100a})['then'](function(){return BPromise[_0xba1b('0x6b')](_0x57a6ee,function(_0x3b58e0){return db[_0xba1b('0x5a')]['findOrCreate']({'where':{'UserId':_0x3b58e0['id'],'MailQueueId':_0x3c7328[_0xba1b('0x57')]['id']},'transaction':_0x19100a});});})[_0xba1b('0x29')](function(){_0x57a6ee[_0xba1b('0x6c')](function(_0x4b2fa3){socket[_0xba1b('0x6d')](_0xba1b('0x6e'),{'UserId':_0x4b2fa3['id'],'MailQueueId':_0x7ba601['id']});});});});});}})[_0xba1b('0x29')](respondWithStatusCode(_0x527973,null))['catch'](handleError(_0x527973,null));};exports[_0xba1b('0x6f')]=function(_0x324ffa,_0x4b7a01,_0x5f0a49){return db['Team'][_0xba1b('0x47')]({'where':{'id':_0x324ffa[_0xba1b('0x3a')][_0xba1b('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xba1b('0x29')](handleEntityNotFound(_0x4b7a01,null))[_0xba1b('0x29')](function(_0x19dad9){var _0x1db6e5=_['map'](_0x19dad9,'id');var _0x297c65=[];var _0x299e43=[];var _0x537106=squel[_0xba1b('0x70')]();_0x537106[_0xba1b('0x71')](_0xba1b('0x72'))['from']('team_has_mail_queues','tq')['join']('user_has_teams','ut',_0xba1b('0x73'))['where'](_0xba1b('0x74'),_0x324ffa['params']['id']);for(var _0x5800a4=0x0;_0x5800a4<_0x19dad9['length'];_0x5800a4+=0x1){let _0x4c824c=_0x19dad9[_0x5800a4];for(var _0x55f38d=0x0;_0x55f38d<_0x4c824c['Agents'][_0xba1b('0x3b')];_0x55f38d+=0x1){let _0x4b344d=_0x4c824c[_0xba1b('0x66')][_0x55f38d];var _0x1a2a02=_0x537106[_0xba1b('0x75')]();_0x1a2a02[_0xba1b('0x3f')](_0xba1b('0x76'),_0x4b344d['id']);_0x299e43[_0xba1b('0x77')](db[_0xba1b('0x69')][_0xba1b('0x3a')](_0x1a2a02['toString'](),{'type':db[_0xba1b('0x69')]['QueryTypes'][_0xba1b('0x78')]})['then'](function(_0x3cfba9){if(_0x3cfba9[_0xba1b('0x3b')]===0x1){return _0x4b344d['id'];}else{var _0x1a6fe3=_[_0xba1b('0x79')](_[_0xba1b('0x31')](_0x3cfba9,_0xba1b('0x7a')),function(_0x43fdd0){return _[_0xba1b('0x7b')](_0x1db6e5,_0x43fdd0);});if(_0x1a6fe3){return _0x4b344d['id'];}}}));}}return BPromise[_0xba1b('0x7c')](_0x299e43)['then'](function(_0x95977){_0x297c65=_(_0x297c65)[_0xba1b('0x7d')](_0x95977)[_0xba1b('0x7e')]()['value']();return db[_0xba1b('0x44')][_0xba1b('0x53')]({'where':{'id':_0x324ffa['params']['id']}})[_0xba1b('0x29')](function(_0x2f3f7e){return db[_0xba1b('0x69')][_0xba1b('0x7f')](function(_0x215c63){return _0x2f3f7e[_0xba1b('0x6f')](_0x324ffa[_0xba1b('0x3a')][_0xba1b('0x65')],{'transaction':_0x215c63})['then'](function(){if(!_['isEmpty'](_0x297c65)){return _0x2f3f7e[_0xba1b('0x80')](_0x297c65,{'transaction':_0x215c63});}})['then'](function(){_0x297c65[_0xba1b('0x6c')](function(_0xf6cdda){socket[_0xba1b('0x6d')](_0xba1b('0x81'),{'UserId':_0xf6cdda,'MailQueueId':_0x2f3f7e['id']});});});});});});})['then'](respondWithStatusCode(_0x4b7a01,null))[_0xba1b('0x48')](handleError(_0x4b7a01,null));};exports[_0xba1b('0x82')]=function(_0x84d0b2,_0x11717f,_0x203877){return db[_0xba1b('0x44')][_0xba1b('0x53')]({'where':{'id':_0x84d0b2[_0xba1b('0x57')]['id']}})[_0xba1b('0x29')](handleEntityNotFound(_0x11717f,null))[_0xba1b('0x29')](function(_0x49ace2){if(_0x49ace2){return _0x49ace2[_0xba1b('0x82')](_0x84d0b2[_0xba1b('0x4d')][_0xba1b('0x65')],_['omit'](_0x84d0b2[_0xba1b('0x4d')],[_0xba1b('0x65'),'id'])||{})[_0xba1b('0x83')](function(_0x5df8bb){for(var _0xa89f3e=0x0;_0xa89f3e<_0x84d0b2[_0xba1b('0x4d')]['ids'][_0xba1b('0x3b')];_0xa89f3e+=0x1){socket[_0xba1b('0x6d')](_0xba1b('0x6e'),{'UserId':Number(_0x84d0b2[_0xba1b('0x4d')][_0xba1b('0x65')][_0xa89f3e]),'MailQueueId':Number(_0x84d0b2[_0xba1b('0x57')]['id'])});}return _0x5df8bb;});}})[_0xba1b('0x29')](respondWithResult(_0x11717f,null))[_0xba1b('0x48')](handleError(_0x11717f,null));};exports[_0xba1b('0x80')]=function(_0x2f172d,_0x333300,_0x1b5261){return db[_0xba1b('0x44')][_0xba1b('0x53')]({'where':{'id':_0x2f172d[_0xba1b('0x57')]['id']}})['then'](handleEntityNotFound(_0x333300,null))[_0xba1b('0x29')](function(_0x5d8464){if(_0x5d8464){return _0x5d8464[_0xba1b('0x80')](_0x2f172d[_0xba1b('0x3a')][_0xba1b('0x65')])[_0xba1b('0x29')](function(){if(_[_0xba1b('0x84')](_0x2f172d[_0xba1b('0x3a')][_0xba1b('0x65')])){for(var _0x245fcc=0x0;_0x245fcc<_0x2f172d[_0xba1b('0x3a')][_0xba1b('0x65')][_0xba1b('0x3b')];_0x245fcc+=0x1){socket[_0xba1b('0x6d')](_0xba1b('0x81'),{'UserId':Number(_0x2f172d[_0xba1b('0x3a')][_0xba1b('0x65')][_0x245fcc]),'MailQueueId':Number(_0x2f172d[_0xba1b('0x57')]['id'])});}}else{socket[_0xba1b('0x6d')]('userMailQueue:remove',{'UserId':Number(_0x2f172d['query']['ids']),'MailQueueId':Number(_0x2f172d['params']['id'])});}});}})['then'](respondWithStatusCode(_0x333300,null))[_0xba1b('0x48')](handleError(_0x333300,null));};exports['getAgents']=function(_0x4803b1,_0xdf0602,_0x2a3a03){var _0x1447b1={};var _0x1b8f87={};var _0x5634ec;var _0x30793e;return db[_0xba1b('0x44')]['findOne']({'where':{'id':_0x4803b1[_0xba1b('0x57')]['id']}})[_0xba1b('0x29')](handleEntityNotFound(_0xdf0602,null))[_0xba1b('0x29')](function(_0x490562){if(_0x490562){_0x5634ec=_0x490562;_0x1b8f87[_0xba1b('0x35')]=_[_0xba1b('0x4b')](db[_0xba1b('0x85')][_0xba1b('0x4a')]);_0x1b8f87[_0xba1b('0x3a')]=_[_0xba1b('0x4b')](_0x4803b1[_0xba1b('0x3a')]);_0x1b8f87[_0xba1b('0x36')]=_[_0xba1b('0x38')](_0x1b8f87[_0xba1b('0x35')],_0x1b8f87[_0xba1b('0x3a')]);_0x1447b1[_0xba1b('0x37')]=_['intersection'](_0x1b8f87[_0xba1b('0x35')],qs[_0xba1b('0x39')](_0x4803b1[_0xba1b('0x3a')]['fields']));_0x1447b1[_0xba1b('0x37')]=_0x1447b1[_0xba1b('0x37')][_0xba1b('0x3b')]?_0x1447b1[_0xba1b('0x37')]:_0x1b8f87[_0xba1b('0x35')];_0x1447b1[_0xba1b('0x5b')]=qs[_0xba1b('0x3e')](_0x4803b1[_0xba1b('0x3a')][_0xba1b('0x3e')]);_0x1447b1[_0xba1b('0x3f')]=qs[_0xba1b('0x36')](_[_0xba1b('0x5c')](_0x4803b1[_0xba1b('0x3a')],_0x1b8f87[_0xba1b('0x36')]));if(_0x4803b1[_0xba1b('0x3a')][_0xba1b('0x40')]){_0x1447b1['where']=_['merge'](_0x1447b1['where'],{'$or':_[_0xba1b('0x31')](_0x1447b1['attributes'],function(_0xef3234){var _0x1ef1be={};_0x1ef1be[_0xef3234]={'$like':'%'+_0x4803b1[_0xba1b('0x3a')][_0xba1b('0x40')]+'%'};return _0x1ef1be;})});}_0x1447b1=_[_0xba1b('0x41')]({},_0x1447b1,_0x4803b1[_0xba1b('0x43')]);return _0x5634ec[_0xba1b('0x86')](_0x1447b1);}})[_0xba1b('0x29')](function(_0x2df394){if(_0x2df394){_0x30793e=_0x2df394[_0xba1b('0x3b')];if(!_0x4803b1[_0xba1b('0x3a')][_0xba1b('0x3c')](_0xba1b('0x3d'))){_0x1447b1[_0xba1b('0x21')]=qs['limit'](_0x4803b1[_0xba1b('0x3a')][_0xba1b('0x21')]);_0x1447b1[_0xba1b('0x23')]=qs[_0xba1b('0x23')](_0x4803b1['query'][_0xba1b('0x23')]);}return _0x5634ec[_0xba1b('0x86')](_0x1447b1);}})[_0xba1b('0x29')](function(_0xeb1deb){if(_0xeb1deb){return _0xeb1deb?{'count':_0x30793e,'rows':_0xeb1deb}:null;}})[_0xba1b('0x29')](respondWithResult(_0xdf0602,null))[_0xba1b('0x48')](handleError(_0xdf0602,null));}; \ No newline at end of file +var _0x8bdf=['isArray','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','UserProfileResource','destroy','name','send','index','map','MailQueue','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','UserMailQueue','nolimit','pick','MailQueueId','User','UserId','agent','mailPause','updatedAt','createdAt','SIP','Team','getTeams','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','compact','value','isEmpty','removeAgents','forEach','emit','userMailQueue:remove','addAgents','omit','userMailQueue:save'];(function(_0x3883ed,_0x5ca0a0){var _0x35730b=function(_0x5d96bc){while(--_0x5d96bc){_0x3883ed['push'](_0x3883ed['shift']());}};_0x35730b(++_0x5ca0a0);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x8bdf[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0xf8bd('0x0'));var rimraf=require(_0xf8bd('0x1'));var zipdir=require(_0xf8bd('0x2'));var jsonpatch=require(_0xf8bd('0x3'));var rp=require(_0xf8bd('0x4'));var moment=require('moment');var BPromise=require(_0xf8bd('0x5'));var Mustache=require(_0xf8bd('0x6'));var util=require(_0xf8bd('0x7'));var path=require(_0xf8bd('0x8'));var sox=require(_0xf8bd('0x9'));var csv=require(_0xf8bd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf8bd('0xb'));var crypto=require(_0xf8bd('0xc'));var jsforce=require(_0xf8bd('0xd'));var deskjs=require(_0xf8bd('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf8bd('0xf'));var Papa=require(_0xf8bd('0x10'));var Redis=require('ioredis');var authService=require(_0xf8bd('0x11'));var qs=require(_0xf8bd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8bd('0x13'));var logger=require(_0xf8bd('0x14'))(_0xf8bd('0x15'));var utils=require(_0xf8bd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf8bd('0x17'));var db=require(_0xf8bd('0x18'))['db'];config['redis']=_[_0xf8bd('0x19')](config['redis'],{'host':_0xf8bd('0x1a'),'port':0x18eb});var socket=require(_0xf8bd('0x1b'))(new Redis(config[_0xf8bd('0x1c')]));require(_0xf8bd('0x1d'))[_0xf8bd('0x1e')](socket);function respondWithStatusCode(_0xa0ee74,_0x56146e){_0x56146e=_0x56146e||0xcc;return function(_0x5d8694){if(_0x5d8694){return _0xa0ee74['sendStatus'](_0x56146e);}return _0xa0ee74[_0xf8bd('0x1f')](_0x56146e)[_0xf8bd('0x20')]();};}function respondWithResult(_0x54dc30,_0x277123){_0x277123=_0x277123||0xc8;return function(_0x9d454){if(_0x9d454){return _0x54dc30[_0xf8bd('0x1f')](_0x277123)[_0xf8bd('0x21')](_0x9d454);}};}function respondWithFilteredResult(_0x54cf43,_0x2b9fff){return function(_0x3e69be){if(_0x3e69be){var _0x53c547=typeof _0x2b9fff[_0xf8bd('0x22')]===_0xf8bd('0x23')&&typeof _0x2b9fff[_0xf8bd('0x24')]===_0xf8bd('0x23');var _0xf06524=_0x3e69be[_0xf8bd('0x25')];var _0x540bd8=_0x53c547?0x0:_0x2b9fff[_0xf8bd('0x22')];var _0xe20d3c=_0x53c547?_0x3e69be['count']:_0x2b9fff[_0xf8bd('0x22')]+_0x2b9fff['limit'];var _0x30d533;if(_0xe20d3c>=_0xf06524){_0xe20d3c=_0xf06524;_0x30d533=0xc8;}else{_0x30d533=0xce;}_0x54cf43[_0xf8bd('0x1f')](_0x30d533);return _0x54cf43['set'](_0xf8bd('0x26'),_0x540bd8+'-'+_0xe20d3c+'/'+_0xf06524)[_0xf8bd('0x21')](_0x3e69be);}return null;};}function patchUpdates(_0x4c575f){return function(_0x4ea6fe){try{jsonpatch[_0xf8bd('0x27')](_0x4ea6fe,_0x4c575f,!![]);}catch(_0x4c6ff){return BPromise['reject'](_0x4c6ff);}return _0x4ea6fe[_0xf8bd('0x28')]();};}function saveUpdates(_0x59d0b9,_0x36abba){return function(_0x2be9c2){if(_0x2be9c2){return _0x2be9c2['update'](_0x59d0b9)[_0xf8bd('0x29')](function(_0x4de830){return _0x4de830;});}return null;};}function removeEntity(_0x1dd9bd,_0x5b85f5){return function(_0x261e8f){if(_0x261e8f){return _0x261e8f['destroy']()[_0xf8bd('0x29')](function(){var _0x4fe184=_0x261e8f['get']({'plain':!![]});var _0x329a09='MailQueues';return db[_0xf8bd('0x2a')][_0xf8bd('0x2b')]({'where':{'type':_0x329a09,'resourceId':_0x4fe184['id']}})[_0xf8bd('0x29')](function(){return _0x261e8f;});})['then'](function(){_0x1dd9bd[_0xf8bd('0x1f')](0xcc)[_0xf8bd('0x20')]();});}};}function handleEntityNotFound(_0xa3ff13,_0x3aa54a){return function(_0x4fc088){if(!_0x4fc088){_0xa3ff13['sendStatus'](0x194);}return _0x4fc088;};}function handleError(_0x36a606,_0x594bd1){_0x594bd1=_0x594bd1||0x1f4;return function(_0x4c386a){logger['error'](_0x4c386a['stack']);if(_0x4c386a[_0xf8bd('0x2c')]){delete _0x4c386a[_0xf8bd('0x2c')];}_0x36a606['status'](_0x594bd1)[_0xf8bd('0x2d')](_0x4c386a);};}exports[_0xf8bd('0x2e')]=function(_0x4f19f0,_0x588b4c){var _0xa1e73c={},_0x4a7d4e={},_0x257377={'count':0x0,'rows':[]};var _0x3bc9ed=_[_0xf8bd('0x2f')](db[_0xf8bd('0x30')][_0xf8bd('0x31')],function(_0x121b23){return{'name':_0x121b23['fieldName'],'type':_0x121b23[_0xf8bd('0x32')][_0xf8bd('0x33')]};});_0x4a7d4e['model']=_['map'](_0x3bc9ed,_0xf8bd('0x2c'));_0x4a7d4e[_0xf8bd('0x34')]=_['keys'](_0x4f19f0[_0xf8bd('0x34')]);_0x4a7d4e[_0xf8bd('0x35')]=_[_0xf8bd('0x36')](_0x4a7d4e[_0xf8bd('0x37')],_0x4a7d4e[_0xf8bd('0x34')]);_0xa1e73c[_0xf8bd('0x38')]=_[_0xf8bd('0x36')](_0x4a7d4e['model'],qs[_0xf8bd('0x39')](_0x4f19f0[_0xf8bd('0x34')][_0xf8bd('0x39')]));_0xa1e73c[_0xf8bd('0x38')]=_0xa1e73c[_0xf8bd('0x38')][_0xf8bd('0x3a')]?_0xa1e73c[_0xf8bd('0x38')]:_0x4a7d4e['model'];if(!_0x4f19f0['query'][_0xf8bd('0x3b')]('nolimit')){_0xa1e73c['limit']=qs[_0xf8bd('0x24')](_0x4f19f0[_0xf8bd('0x34')][_0xf8bd('0x24')]);_0xa1e73c[_0xf8bd('0x22')]=qs[_0xf8bd('0x22')](_0x4f19f0['query'][_0xf8bd('0x22')]);}_0xa1e73c[_0xf8bd('0x3c')]=qs[_0xf8bd('0x3d')](_0x4f19f0['query']['sort']);_0xa1e73c[_0xf8bd('0x3e')]=qs['filters'](_['pick'](_0x4f19f0[_0xf8bd('0x34')],_0x4a7d4e['filters']),_0x3bc9ed);if(_0x4f19f0[_0xf8bd('0x34')][_0xf8bd('0x3f')]){_0xa1e73c[_0xf8bd('0x3e')]=_[_0xf8bd('0x40')](_0xa1e73c[_0xf8bd('0x3e')],{'$or':_[_0xf8bd('0x2f')](_0x3bc9ed,function(_0xcdd13f){if(_0xcdd13f[_0xf8bd('0x32')]!==_0xf8bd('0x41')){var _0x41fed8={};_0x41fed8[_0xcdd13f['name']]={'$like':'%'+_0x4f19f0[_0xf8bd('0x34')][_0xf8bd('0x3f')]+'%'};return _0x41fed8;}})});}_0xa1e73c=_[_0xf8bd('0x40')]({},_0xa1e73c,_0x4f19f0[_0xf8bd('0x42')]);var _0x48b6da={'where':_0xa1e73c[_0xf8bd('0x3e')]};return db[_0xf8bd('0x30')][_0xf8bd('0x25')](_0x48b6da)[_0xf8bd('0x29')](function(_0x504366){_0x257377['count']=_0x504366;if(_0x4f19f0['query']['includeAll']){_0xa1e73c['include']=[{'all':!![]}];}return db[_0xf8bd('0x30')][_0xf8bd('0x43')](_0xa1e73c);})[_0xf8bd('0x29')](function(_0x5b9901){_0x257377[_0xf8bd('0x44')]=_0x5b9901;return _0x257377;})[_0xf8bd('0x29')](respondWithFilteredResult(_0x588b4c,_0xa1e73c))[_0xf8bd('0x45')](handleError(_0x588b4c,null));};exports[_0xf8bd('0x46')]=function(_0x491782,_0x1a1df6){var _0x3cd170={'raw':!![],'where':{'id':_0x491782[_0xf8bd('0x47')]['id']}},_0x44bee4={};_0x44bee4[_0xf8bd('0x37')]=_[_0xf8bd('0x48')](db[_0xf8bd('0x30')][_0xf8bd('0x31')]);_0x44bee4[_0xf8bd('0x34')]=_['keys'](_0x491782[_0xf8bd('0x34')]);_0x44bee4[_0xf8bd('0x35')]=_[_0xf8bd('0x36')](_0x44bee4[_0xf8bd('0x37')],_0x44bee4[_0xf8bd('0x34')]);_0x3cd170[_0xf8bd('0x38')]=_[_0xf8bd('0x36')](_0x44bee4['model'],qs[_0xf8bd('0x39')](_0x491782[_0xf8bd('0x34')][_0xf8bd('0x39')]));_0x3cd170['attributes']=_0x3cd170[_0xf8bd('0x38')]['length']?_0x3cd170[_0xf8bd('0x38')]:_0x44bee4[_0xf8bd('0x37')];if(_0x491782[_0xf8bd('0x34')]['includeAll']){_0x3cd170[_0xf8bd('0x49')]=[{'all':!![]}];}_0x3cd170=_[_0xf8bd('0x40')]({},_0x3cd170,_0x491782[_0xf8bd('0x42')]);return db[_0xf8bd('0x30')][_0xf8bd('0x4a')](_0x3cd170)[_0xf8bd('0x29')](handleEntityNotFound(_0x1a1df6,null))[_0xf8bd('0x29')](respondWithResult(_0x1a1df6,null))[_0xf8bd('0x45')](handleError(_0x1a1df6,null));};exports[_0xf8bd('0x4b')]=function(_0xe2931a,_0x3ab3f0){return db[_0xf8bd('0x30')][_0xf8bd('0x4b')](_0xe2931a[_0xf8bd('0x4c')],{})[_0xf8bd('0x29')](function(_0x2b0cb9){var _0x2b5975=_0xe2931a['user'][_0xf8bd('0x4d')]({'plain':!![]});if(!_0x2b5975)throw new Error(_0xf8bd('0x4e'));if(_0x2b5975[_0xf8bd('0x4f')]===_0xf8bd('0x50')){var _0x405b84=_0x2b0cb9[_0xf8bd('0x4d')]({'plain':!![]});var _0x283dfe=_0xf8bd('0x51');return db[_0xf8bd('0x52')]['find']({'where':{'name':_0x283dfe,'userProfileId':_0x2b5975[_0xf8bd('0x53')]},'raw':!![]})[_0xf8bd('0x29')](function(_0x4023a8){if(_0x4023a8&&_0x4023a8[_0xf8bd('0x54')]===0x0){return db[_0xf8bd('0x2a')]['create']({'name':_0x405b84[_0xf8bd('0x2c')],'resourceId':_0x405b84['id'],'type':_0x4023a8[_0xf8bd('0x2c')],'sectionId':_0x4023a8['id']},{})[_0xf8bd('0x29')](function(){return _0x2b0cb9;});}else{return _0x2b0cb9;}})[_0xf8bd('0x45')](function(_0x170c78){logger['error'](_0xf8bd('0x55'),_0x170c78);throw _0x170c78;});}return _0x2b0cb9;})[_0xf8bd('0x29')](respondWithResult(_0x3ab3f0,0xc9))[_0xf8bd('0x45')](handleError(_0x3ab3f0,null));};exports[_0xf8bd('0x56')]=function(_0xd5006a,_0x5ec466){if(_0xd5006a[_0xf8bd('0x4c')]['id']){delete _0xd5006a['body']['id'];}return db[_0xf8bd('0x30')][_0xf8bd('0x4a')]({'where':{'id':_0xd5006a['params']['id']}})['then'](handleEntityNotFound(_0x5ec466,null))['then'](saveUpdates(_0xd5006a['body'],null))[_0xf8bd('0x29')](respondWithResult(_0x5ec466,null))['catch'](handleError(_0x5ec466,null));};exports[_0xf8bd('0x2b')]=function(_0x1da62a,_0x5b8adc){return db['MailQueue'][_0xf8bd('0x4a')]({'where':{'id':_0x1da62a[_0xf8bd('0x47')]['id']}})[_0xf8bd('0x29')](handleEntityNotFound(_0x5b8adc,null))[_0xf8bd('0x29')](removeEntity(_0x5b8adc,null))['catch'](handleError(_0x5b8adc,null));};exports['describe']=function(_0x483b88,_0x16aa74){return db[_0xf8bd('0x30')][_0xf8bd('0x57')]()[_0xf8bd('0x29')](respondWithResult(_0x16aa74,null))[_0xf8bd('0x45')](handleError(_0x16aa74,null));};exports['getMembers']=function(_0x255637,_0x457f19,_0x5427d1){var _0x24339b={'raw':!![],'where':{}},_0x5962c9={},_0x330778;return db[_0xf8bd('0x30')]['findOne']({'where':{'id':_0x255637[_0xf8bd('0x47')]['id']}})[_0xf8bd('0x29')](handleEntityNotFound(_0x457f19,null))[_0xf8bd('0x29')](function(_0x14dd54){if(_0x14dd54){_0x330778=_0x14dd54[_0xf8bd('0x4d')]({'plain':!![]});_0x5962c9['model']=_[_0xf8bd('0x48')](db[_0xf8bd('0x58')][_0xf8bd('0x31')]);_0x5962c9['query']=_['keys'](_0x255637['query']);_0x5962c9[_0xf8bd('0x35')]=_['intersection'](_0x5962c9['model'],_0x5962c9[_0xf8bd('0x34')]);_0x24339b[_0xf8bd('0x38')]=_[_0xf8bd('0x36')](_0x5962c9[_0xf8bd('0x37')],qs[_0xf8bd('0x39')](_0x255637[_0xf8bd('0x34')][_0xf8bd('0x39')]));_0x24339b[_0xf8bd('0x38')]=_0x24339b['attributes'][_0xf8bd('0x3a')]?_0x24339b[_0xf8bd('0x38')]:_0x5962c9[_0xf8bd('0x37')];if(!_0x255637[_0xf8bd('0x34')]['hasOwnProperty'](_0xf8bd('0x59'))){_0x24339b[_0xf8bd('0x24')]=qs[_0xf8bd('0x24')](_0x255637[_0xf8bd('0x34')][_0xf8bd('0x24')]);_0x24339b['offset']=qs[_0xf8bd('0x22')](_0x255637[_0xf8bd('0x34')][_0xf8bd('0x22')]);}_0x24339b[_0xf8bd('0x3c')]=qs[_0xf8bd('0x3d')](_0x255637[_0xf8bd('0x34')][_0xf8bd('0x3d')]);_0x24339b[_0xf8bd('0x3e')]=qs[_0xf8bd('0x35')](_[_0xf8bd('0x5a')](_0x255637[_0xf8bd('0x34')],_0x5962c9[_0xf8bd('0x35')]));_0x24339b[_0xf8bd('0x3e')][_0xf8bd('0x5b')]=_0x14dd54['id'];if(_0x255637[_0xf8bd('0x34')]['filter']){_0x24339b[_0xf8bd('0x3e')]=_[_0xf8bd('0x40')](_0x24339b['where'],{'$or':_[_0xf8bd('0x2f')](_0x24339b[_0xf8bd('0x38')],function(_0x109bb0){var _0xee65c={};_0xee65c[_0x109bb0]={'$like':'%'+_0x255637['query']['filter']+'%'};return _0xee65c;})});}_0x24339b=_[_0xf8bd('0x40')]({},_0x24339b,_0x255637[_0xf8bd('0x42')]);return db[_0xf8bd('0x58')][_0xf8bd('0x43')](_0x24339b);}})['then'](function(_0x38bd91){if(_0x38bd91){return db[_0xf8bd('0x5c')]['findAndCountAll']({'where':{'id':_[_0xf8bd('0x2f')](_0x38bd91,_0xf8bd('0x5d')),'role':_0xf8bd('0x5e')},'attributes':['id',_0xf8bd('0x2c'),_0xf8bd('0x5f'),_0xf8bd('0x60'),_0xf8bd('0x61')]});}})['then'](function(_0x24d098){if(_0x24d098){return{'count':_0x24d098['count'],'rows':_[_0xf8bd('0x2f')](_0x24d098[_0xf8bd('0x44')],function(_0x19bd0f){return{'membername':_0x19bd0f['name'],'UserId':_0x19bd0f['id'],'queue_name':_0x330778['name'],'MailQueueId':_0x330778['id'],'interface':util['format']('%s/%s',_0xf8bd('0x62'),_0x19bd0f[_0xf8bd('0x2c')]),'penalty':0x0,'paused':_0x19bd0f[_0xf8bd('0x5f')],'createdAt':_0x19bd0f['createdAt'],'updatedAt':_0x19bd0f[_0xf8bd('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf8bd('0x29')](respondWithFilteredResult(_0x457f19,_0x24339b))['catch'](handleError(_0x457f19,null));};exports['getTeams']=function(_0x4e5d1e,_0xda6b60,_0x53ff29){var _0x54510a={};var _0xd1ccbf={};var _0xb6c48f;var _0xbbb2a5;return db[_0xf8bd('0x30')]['findOne']({'where':{'id':_0x4e5d1e['params']['id']}})[_0xf8bd('0x29')](handleEntityNotFound(_0xda6b60,null))[_0xf8bd('0x29')](function(_0x264da6){if(_0x264da6){_0xb6c48f=_0x264da6;_0xd1ccbf[_0xf8bd('0x37')]=_[_0xf8bd('0x48')](db[_0xf8bd('0x63')][_0xf8bd('0x31')]);_0xd1ccbf[_0xf8bd('0x34')]=_['keys'](_0x4e5d1e[_0xf8bd('0x34')]);_0xd1ccbf['filters']=_[_0xf8bd('0x36')](_0xd1ccbf[_0xf8bd('0x37')],_0xd1ccbf[_0xf8bd('0x34')]);_0x54510a[_0xf8bd('0x38')]=_['intersection'](_0xd1ccbf[_0xf8bd('0x37')],qs[_0xf8bd('0x39')](_0x4e5d1e[_0xf8bd('0x34')][_0xf8bd('0x39')]));_0x54510a[_0xf8bd('0x38')]=_0x54510a[_0xf8bd('0x38')]['length']?_0x54510a[_0xf8bd('0x38')]:_0xd1ccbf[_0xf8bd('0x37')];_0x54510a[_0xf8bd('0x3c')]=qs['sort'](_0x4e5d1e[_0xf8bd('0x34')][_0xf8bd('0x3d')]);_0x54510a['where']=qs[_0xf8bd('0x35')](_[_0xf8bd('0x5a')](_0x4e5d1e['query'],_0xd1ccbf[_0xf8bd('0x35')]));if(_0x4e5d1e[_0xf8bd('0x34')][_0xf8bd('0x3f')]){_0x54510a[_0xf8bd('0x3e')]=_[_0xf8bd('0x40')](_0x54510a['where'],{'$or':_['map'](_0x54510a[_0xf8bd('0x38')],function(_0xbc6ea0){var _0x5228e2={};_0x5228e2[_0xbc6ea0]={'$like':'%'+_0x4e5d1e[_0xf8bd('0x34')][_0xf8bd('0x3f')]+'%'};return _0x5228e2;})});}_0x54510a=_['merge']({},_0x54510a,_0x4e5d1e[_0xf8bd('0x42')]);return _0xb6c48f[_0xf8bd('0x64')](_0x54510a);}})['then'](function(_0x1a3414){if(_0x1a3414){_0xbbb2a5=_0x1a3414[_0xf8bd('0x3a')];if(!_0x4e5d1e[_0xf8bd('0x34')]['hasOwnProperty'](_0xf8bd('0x59'))){_0x54510a['limit']=qs['limit'](_0x4e5d1e[_0xf8bd('0x34')]['limit']);_0x54510a[_0xf8bd('0x22')]=qs['offset'](_0x4e5d1e['query'][_0xf8bd('0x22')]);}return _0xb6c48f[_0xf8bd('0x64')](_0x54510a);}})[_0xf8bd('0x29')](function(_0x37b30d){if(_0x37b30d){return _0x37b30d?{'count':_0xbbb2a5,'rows':_0x37b30d}:null;}})[_0xf8bd('0x29')](respondWithResult(_0xda6b60,null))[_0xf8bd('0x45')](handleError(_0xda6b60,null));};exports[_0xf8bd('0x65')]=function(_0x5d4fc1,_0x5a2414,_0x415eca){var _0x1f47bf=_0x5d4fc1[_0xf8bd('0x4c')][_0xf8bd('0x66')];return db[_0xf8bd('0x63')][_0xf8bd('0x43')]({'where':{'id':_0x1f47bf},'attributes':['id'],'include':[{'model':db[_0xf8bd('0x5c')],'as':'Agents','attributes':['id',_0xf8bd('0x2c'),_0xf8bd('0x67'),_0xf8bd('0x68'),_0xf8bd('0x69')],'raw':!![]}]})[_0xf8bd('0x29')](function(_0x34b720){if(_0x34b720){var _0xd5e6d3=_[_0xf8bd('0x6a')](_0x34b720,function(_0x339c9f){var _0x3ca358=_0x339c9f[_0xf8bd('0x4d')]({'plain':!![]});return _0x3ca358[_0xf8bd('0x6b')];});return db[_0xf8bd('0x30')][_0xf8bd('0x4a')]({'where':{'id':_0x5d4fc1[_0xf8bd('0x47')]['id']}})[_0xf8bd('0x29')](function(_0x14c838){return db[_0xf8bd('0x6c')][_0xf8bd('0x6d')](function(_0x24669d){return _0x14c838['addTeams'](_0x1f47bf,{'transaction':_0x24669d})[_0xf8bd('0x29')](function(){return BPromise[_0xf8bd('0x6e')](_0xd5e6d3,function(_0x4279a7){return db[_0xf8bd('0x58')][_0xf8bd('0x6f')]({'where':{'UserId':_0x4279a7['id'],'MailQueueId':_0x5d4fc1['params']['id']},'transaction':_0x24669d});});})[_0xf8bd('0x29')](function(){_0xd5e6d3['forEach'](function(_0x792e90){socket['emit']('userMailQueue:save',{'UserId':_0x792e90['id'],'MailQueueId':_0x14c838['id']});});});});});}})[_0xf8bd('0x29')](respondWithStatusCode(_0x5a2414,null))[_0xf8bd('0x45')](handleError(_0x5a2414,null));};exports[_0xf8bd('0x70')]=function(_0x4eda50,_0x1b9425,_0xc76cd3){return db[_0xf8bd('0x63')]['findAll']({'where':{'id':_0x4eda50[_0xf8bd('0x34')][_0xf8bd('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf8bd('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xf8bd('0x29')](handleEntityNotFound(_0x1b9425,null))[_0xf8bd('0x29')](function(_0x379e2c){var _0x420c19=_[_0xf8bd('0x2f')](_0x379e2c,'id');var _0x8b80b9=[];var _0x5a88c6=[];var _0x44a6cd=squel[_0xf8bd('0x71')]();_0x44a6cd[_0xf8bd('0x72')](_0xf8bd('0x73'))['from'](_0xf8bd('0x74'),'tq')[_0xf8bd('0x75')](_0xf8bd('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf8bd('0x3e')](_0xf8bd('0x77'),_0x4eda50[_0xf8bd('0x47')]['id']);for(var _0x357ab4=0x0;_0x357ab4<_0x379e2c['length'];_0x357ab4+=0x1){let _0x1bcb6e=_0x379e2c[_0x357ab4];for(var _0x3e79ea=0x0;_0x3e79ea<_0x1bcb6e[_0xf8bd('0x6b')][_0xf8bd('0x3a')];_0x3e79ea+=0x1){let _0x30a0fe=_0x1bcb6e[_0xf8bd('0x6b')][_0x3e79ea];var _0x4bc26c=_0x44a6cd['clone']();_0x4bc26c[_0xf8bd('0x3e')](_0xf8bd('0x78'),_0x30a0fe['id']);_0x5a88c6[_0xf8bd('0x79')](db[_0xf8bd('0x6c')][_0xf8bd('0x34')](_0x4bc26c[_0xf8bd('0x7a')](),{'type':db[_0xf8bd('0x6c')][_0xf8bd('0x7b')]['SELECT']})[_0xf8bd('0x29')](function(_0x26f0ac){if(_0x26f0ac[_0xf8bd('0x3a')]===0x1){return _0x30a0fe['id'];}else{var _0x170b4c=_[_0xf8bd('0x7c')](_[_0xf8bd('0x2f')](_0x26f0ac,_0xf8bd('0x7d')),function(_0x523aa9){return _[_0xf8bd('0x7e')](_0x420c19,_0x523aa9);});if(_0x170b4c){return _0x30a0fe['id'];}}}));}}return BPromise['all'](_0x5a88c6)[_0xf8bd('0x29')](function(_0x5b514f){_0x8b80b9=_(_0x8b80b9)['union'](_0x5b514f)[_0xf8bd('0x7f')]()[_0xf8bd('0x80')]();return db[_0xf8bd('0x30')][_0xf8bd('0x4a')]({'where':{'id':_0x4eda50[_0xf8bd('0x47')]['id']}})[_0xf8bd('0x29')](function(_0x5b087c){return db[_0xf8bd('0x6c')]['transaction'](function(_0x24d99d){return _0x5b087c[_0xf8bd('0x70')](_0x4eda50[_0xf8bd('0x34')]['ids'],{'transaction':_0x24d99d})[_0xf8bd('0x29')](function(){if(!_[_0xf8bd('0x81')](_0x8b80b9)){return _0x5b087c[_0xf8bd('0x82')](_0x8b80b9,{'transaction':_0x24d99d});}})[_0xf8bd('0x29')](function(){_0x8b80b9[_0xf8bd('0x83')](function(_0x3e14ba){socket[_0xf8bd('0x84')](_0xf8bd('0x85'),{'UserId':_0x3e14ba,'MailQueueId':_0x5b087c['id']});});});});});});})[_0xf8bd('0x29')](respondWithStatusCode(_0x1b9425,null))['catch'](handleError(_0x1b9425,null));};exports['addAgents']=function(_0x45309f,_0xb16b0d,_0x2b6468){return db[_0xf8bd('0x30')]['find']({'where':{'id':_0x45309f[_0xf8bd('0x47')]['id']}})[_0xf8bd('0x29')](handleEntityNotFound(_0xb16b0d,null))[_0xf8bd('0x29')](function(_0x26e1f6){if(_0x26e1f6){return _0x26e1f6[_0xf8bd('0x86')](_0x45309f[_0xf8bd('0x4c')][_0xf8bd('0x66')],_[_0xf8bd('0x87')](_0x45309f['body'],[_0xf8bd('0x66'),'id'])||{})['spread'](function(_0x1a07b4){for(var _0x3ec937=0x0;_0x3ec937<_0x45309f['body'][_0xf8bd('0x66')][_0xf8bd('0x3a')];_0x3ec937+=0x1){socket['emit'](_0xf8bd('0x88'),{'UserId':Number(_0x45309f[_0xf8bd('0x4c')]['ids'][_0x3ec937]),'MailQueueId':Number(_0x45309f[_0xf8bd('0x47')]['id'])});}return _0x1a07b4;});}})[_0xf8bd('0x29')](respondWithResult(_0xb16b0d,null))[_0xf8bd('0x45')](handleError(_0xb16b0d,null));};exports[_0xf8bd('0x82')]=function(_0x1757da,_0x37e782,_0x133390){return db[_0xf8bd('0x30')][_0xf8bd('0x4a')]({'where':{'id':_0x1757da[_0xf8bd('0x47')]['id']}})['then'](handleEntityNotFound(_0x37e782,null))['then'](function(_0x18eee6){if(_0x18eee6){return _0x18eee6['removeAgents'](_0x1757da['query'][_0xf8bd('0x66')])[_0xf8bd('0x29')](function(){if(_[_0xf8bd('0x89')](_0x1757da['query'][_0xf8bd('0x66')])){for(var _0x3b0598=0x0;_0x3b0598<_0x1757da[_0xf8bd('0x34')][_0xf8bd('0x66')][_0xf8bd('0x3a')];_0x3b0598+=0x1){socket[_0xf8bd('0x84')](_0xf8bd('0x85'),{'UserId':Number(_0x1757da['query'][_0xf8bd('0x66')][_0x3b0598]),'MailQueueId':Number(_0x1757da[_0xf8bd('0x47')]['id'])});}}else{socket[_0xf8bd('0x84')]('userMailQueue:remove',{'UserId':Number(_0x1757da[_0xf8bd('0x34')][_0xf8bd('0x66')]),'MailQueueId':Number(_0x1757da[_0xf8bd('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x37e782,null))[_0xf8bd('0x45')](handleError(_0x37e782,null));};exports[_0xf8bd('0x8a')]=function(_0x376da0,_0x3fbb6a,_0xedc27f){var _0x36980a={};var _0x4482a9={};var _0x4d22c2;var _0x55597f;return db[_0xf8bd('0x30')][_0xf8bd('0x8b')]({'where':{'id':_0x376da0['params']['id']}})[_0xf8bd('0x29')](handleEntityNotFound(_0x3fbb6a,null))['then'](function(_0x4eb171){if(_0x4eb171){_0x4d22c2=_0x4eb171;_0x4482a9[_0xf8bd('0x37')]=_[_0xf8bd('0x48')](db[_0xf8bd('0x5c')][_0xf8bd('0x31')]);_0x4482a9[_0xf8bd('0x34')]=_[_0xf8bd('0x48')](_0x376da0['query']);_0x4482a9[_0xf8bd('0x35')]=_[_0xf8bd('0x36')](_0x4482a9[_0xf8bd('0x37')],_0x4482a9[_0xf8bd('0x34')]);_0x36980a[_0xf8bd('0x38')]=_['intersection'](_0x4482a9[_0xf8bd('0x37')],qs[_0xf8bd('0x39')](_0x376da0[_0xf8bd('0x34')][_0xf8bd('0x39')]));_0x36980a[_0xf8bd('0x38')]=_0x36980a[_0xf8bd('0x38')][_0xf8bd('0x3a')]?_0x36980a[_0xf8bd('0x38')]:_0x4482a9[_0xf8bd('0x37')];_0x36980a[_0xf8bd('0x3c')]=qs['sort'](_0x376da0[_0xf8bd('0x34')]['sort']);_0x36980a[_0xf8bd('0x3e')]=qs[_0xf8bd('0x35')](_[_0xf8bd('0x5a')](_0x376da0['query'],_0x4482a9['filters']));if(_0x376da0['query'][_0xf8bd('0x3f')]){_0x36980a[_0xf8bd('0x3e')]=_[_0xf8bd('0x40')](_0x36980a[_0xf8bd('0x3e')],{'$or':_['map'](_0x36980a[_0xf8bd('0x38')],function(_0x3315a5){var _0x454ab8={};_0x454ab8[_0x3315a5]={'$like':'%'+_0x376da0[_0xf8bd('0x34')][_0xf8bd('0x3f')]+'%'};return _0x454ab8;})});}_0x36980a=_[_0xf8bd('0x40')]({},_0x36980a,_0x376da0['options']);return _0x4d22c2[_0xf8bd('0x8a')](_0x36980a);}})[_0xf8bd('0x29')](function(_0x10c349){if(_0x10c349){_0x55597f=_0x10c349[_0xf8bd('0x3a')];if(!_0x376da0[_0xf8bd('0x34')]['hasOwnProperty'](_0xf8bd('0x59'))){_0x36980a[_0xf8bd('0x24')]=qs['limit'](_0x376da0[_0xf8bd('0x34')]['limit']);_0x36980a['offset']=qs['offset'](_0x376da0[_0xf8bd('0x34')][_0xf8bd('0x22')]);}return _0x4d22c2[_0xf8bd('0x8a')](_0x36980a);}})[_0xf8bd('0x29')](function(_0x5add47){if(_0x5add47){return _0x5add47?{'count':_0x55597f,'rows':_0x5add47}:null;}})[_0xf8bd('0x29')](respondWithResult(_0x3fbb6a,null))[_0xf8bd('0x45')](handleError(_0x3fbb6a,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index be6f131..ef126fe 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 _0x6cda=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x2326ae,_0x30cafb){var _0x26af09=function(_0x4683f5){while(--_0x4683f5){_0x2326ae['push'](_0x2326ae['shift']());}};_0x26af09(++_0x30cafb);}(_0x6cda,0x74));var _0xa6cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6cda[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xa6cd('0x0'));var MailQueue=require(_0xa6cd('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa6cd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa6cd('0x3'),'afterDestroy':_0xa6cd('0x4')};function emitEvent(_0x563b54){return function(_0x18c23f,_0x260fcf,_0x5d2c92){MailQueueEvents[_0xa6cd('0x5')](_0x563b54+':'+_0x18c23f['id'],_0x18c23f);MailQueueEvents['emit'](_0x563b54,_0x18c23f);_0x5d2c92(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xa6cd('0x6')](e,emitEvent(event));}}module[_0xa6cd('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x643c=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue','setMaxListeners','update'];(function(_0x4d808c,_0x2984af){var _0x328430=function(_0x2dc28a){while(--_0x2dc28a){_0x4d808c['push'](_0x4d808c['shift']());}};_0x328430(++_0x2984af);}(_0x643c,0x15b));var _0xc643=function(_0x5a94af,_0x548782){_0x5a94af=_0x5a94af-0x0;var _0x31ee8a=_0x643c[_0x5a94af];return _0x31ee8a;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xc643('0x0'))['db'][_0xc643('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xc643('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc643('0x3'),'afterDestroy':_0xc643('0x4')};function emitEvent(_0x3385c3){return function(_0x77c46c,_0x5c260c,_0x2be2b7){MailQueueEvents[_0xc643('0x5')](_0x3385c3+':'+_0x77c46c['id'],_0x77c46c);MailQueueEvents[_0xc643('0x5')](_0x3385c3,_0x77c46c);_0x2be2b7(null);};}for(var e in events){if(events[_0xc643('0x6')](e)){var event=events[e];MailQueue[_0xc643('0x7')](e,emitEvent(event));}}module[_0xc643('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 b467133..ab76830 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 _0x85d5=['request-promise','path','rimraf','exports','define','MailQueue','lodash','util','../../config/logger'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x85d5,0xa8));var _0x585d=function(_0x411d5f,_0x29ac7a){_0x411d5f=_0x411d5f-0x0;var _0x57f439=_0x85d5[_0x411d5f];return _0x57f439;};'use strict';var _=require(_0x585d('0x0'));var util=require(_0x585d('0x1'));var logger=require(_0x585d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x585d('0x3'));var fs=require('fs');var path=require(_0x585d('0x4'));var rimraf=require(_0x585d('0x5'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x585d('0x6')]=function(_0x32b5fe,_0x30172a){return _0x32b5fe[_0x585d('0x7')](_0x585d('0x8'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5296=['lodash','api','moment','bluebird','rimraf','./mailQueue.attributes','MailQueue'];(function(_0x49036e,_0x1eed49){var _0xb21daf=function(_0x17b545){while(--_0x17b545){_0x49036e['push'](_0x49036e['shift']());}};_0xb21daf(++_0x1eed49);}(_0x5296,0x69));var _0x6529=function(_0xc0adb1,_0x3f581f){_0xc0adb1=_0xc0adb1-0x0;var _0x208169=_0x5296[_0xc0adb1];return _0x208169;};'use strict';var _=require(_0x6529('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6529('0x1'));var moment=require(_0x6529('0x2'));var BPromise=require(_0x6529('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6529('0x4'));var config=require('../../config/environment');var attributes=require(_0x6529('0x5'));module['exports']=function(_0x4b212e,_0x1f2ea9){return _0x4b212e['define'](_0x6529('0x6'),attributes,{'tableName':'mail_queues','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 cbf379f..6ae5970 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 _0xecee=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailQueue','findAll','options','where','attributes','limit','include','map','model','GetMailQueue','debug','ShowMailQueue','find','raw','lodash','util','moment','bluebird','../../config/utils','rpc'];(function(_0x1c7edb,_0x31abc8){var _0x2d96b1=function(_0x487734){while(--_0x487734){_0x1c7edb['push'](_0x1c7edb['shift']());}};_0x2d96b1(++_0x31abc8);}(_0xecee,0x1a7));var _0xeece=function(_0x1b8b85,_0x385eed){_0x1b8b85=_0x1b8b85-0x0;var _0xc6c7ae=_0xecee[_0x1b8b85];return _0xc6c7ae;};'use strict';var _=require(_0xeece('0x0'));var util=require(_0xeece('0x1'));var moment=require(_0xeece('0x2'));var BPromise=require(_0xeece('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeece('0x4'));var logger=require('../../config/logger')(_0xeece('0x5'));var config=require('../../config/environment');var jayson=require(_0xeece('0x6'));var client=jayson[_0xeece('0x7')]['http']({'port':0x232a});config[_0xeece('0x8')]=_[_0xeece('0x9')](config['redis'],{'host':_0xeece('0xa'),'port':0x18eb});var socket=require(_0xeece('0xb'))(new Redis(config[_0xeece('0x8')]));require(_0xeece('0xc'))[_0xeece('0xd')](socket);function respondWithRpcPromise(_0x2f449f,_0x3ffe77,_0x58e670){return new BPromise(function(_0x54e734,_0x328b8a){return client[_0xeece('0xe')](_0x2f449f,_0x58e670)[_0xeece('0xf')](function(_0x5a5633){logger[_0xeece('0x10')](_0xeece('0x11'),_0x3ffe77,_0xeece('0x12'));logger['debug'](_0xeece('0x13'),_0x3ffe77,'request\x20sent',JSON[_0xeece('0x14')](_0x5a5633));if(_0x5a5633[_0xeece('0x15')]){if(_0x5a5633[_0xeece('0x15')]['code']===0x1f4){logger[_0xeece('0x15')](_0xeece('0x11'),_0x3ffe77,_0x5a5633[_0xeece('0x15')][_0xeece('0x16')]);return _0x328b8a(_0x5a5633[_0xeece('0x15')]['message']);}logger[_0xeece('0x15')]('MailQueue,\x20%s,\x20%s',_0x3ffe77,_0x5a5633['error'][_0xeece('0x16')]);return _0x54e734(_0x5a5633[_0xeece('0x15')][_0xeece('0x16')]);}else{logger[_0xeece('0x10')](_0xeece('0x11'),_0x3ffe77,_0xeece('0x12'));_0x54e734(_0x5a5633[_0xeece('0x17')][_0xeece('0x16')]);}})[_0xeece('0x18')](function(_0x2883db){logger[_0xeece('0x15')](_0xeece('0x11'),_0x3ffe77,_0x2883db);_0x328b8a(_0x2883db);});});}exports['GetMailQueue']=function(_0x35cd4b){var _0xff34f8=this;return new Promise(function(_0x12c643,_0x4387b2){return db[_0xeece('0x19')][_0xeece('0x1a')]({'raw':_0x35cd4b[_0xeece('0x1b')]?_0x35cd4b[_0xeece('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x35cd4b[_0xeece('0x1b')]?_0x35cd4b[_0xeece('0x1b')][_0xeece('0x1c')]||null:null,'attributes':_0x35cd4b[_0xeece('0x1b')]?_0x35cd4b[_0xeece('0x1b')][_0xeece('0x1d')]||null:null,'limit':_0x35cd4b[_0xeece('0x1b')]?_0x35cd4b[_0xeece('0x1b')][_0xeece('0x1e')]||null:null,'include':_0x35cd4b[_0xeece('0x1b')]?_0x35cd4b[_0xeece('0x1b')][_0xeece('0x1f')]?_[_0xeece('0x20')](_0x35cd4b[_0xeece('0x1b')][_0xeece('0x1f')],function(_0x4db8e6){return{'model':db[_0x4db8e6[_0xeece('0x21')]],'as':_0x4db8e6['as'],'attributes':_0x4db8e6[_0xeece('0x1d')],'include':_0x4db8e6['include']?_[_0xeece('0x20')](_0x4db8e6[_0xeece('0x1f')],function(_0x5afc9a){return{'model':db[_0x5afc9a['model']],'as':_0x5afc9a['as'],'attributes':_0x5afc9a[_0xeece('0x1d')],'include':_0x5afc9a[_0xeece('0x1f')]?_[_0xeece('0x20')](_0x5afc9a[_0xeece('0x1f')],function(_0x29fd26){return{'model':db[_0x29fd26[_0xeece('0x21')]],'as':_0x29fd26['as'],'attributes':_0x29fd26[_0xeece('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ac0ef){logger[_0xeece('0x10')](_0xeece('0x22'),_0x35cd4b);logger[_0xeece('0x23')](_0xeece('0x22'),_0x35cd4b,JSON[_0xeece('0x14')](_0x1ac0ef));_0x12c643(_0x1ac0ef);})['catch'](function(_0x365336){logger[_0xeece('0x15')](_0xeece('0x22'),_0x365336[_0xeece('0x16')],_0x35cd4b);_0x4387b2(_0xff34f8[_0xeece('0x15')](0x1f4,_0x365336[_0xeece('0x16')]));});});};exports[_0xeece('0x24')]=function(_0x4e353a){var _0x3e61fe=this;return new Promise(function(_0x20b8a5,_0x34b149){return db['MailQueue'][_0xeece('0x25')]({'raw':_0x4e353a[_0xeece('0x1b')]?_0x4e353a[_0xeece('0x1b')][_0xeece('0x26')]===undefined?!![]:![]:!![],'where':_0x4e353a[_0xeece('0x1b')]?_0x4e353a[_0xeece('0x1b')][_0xeece('0x1c')]||null:null,'attributes':_0x4e353a['options']?_0x4e353a['options'][_0xeece('0x1d')]||null:null,'include':_0x4e353a[_0xeece('0x1b')]?_0x4e353a['options'][_0xeece('0x1f')]?_[_0xeece('0x20')](_0x4e353a[_0xeece('0x1b')][_0xeece('0x1f')],function(_0x368409){return{'model':db[_0x368409[_0xeece('0x21')]],'as':_0x368409['as'],'attributes':_0x368409[_0xeece('0x1d')],'include':_0x368409[_0xeece('0x1f')]?_['map'](_0x368409['include'],function(_0x278cba){return{'model':db[_0x278cba['model']],'as':_0x278cba['as'],'attributes':_0x278cba[_0xeece('0x1d')],'include':_0x278cba['include']?_[_0xeece('0x20')](_0x278cba['include'],function(_0x3d2242){return{'model':db[_0x3d2242['model']],'as':_0x3d2242['as'],'attributes':_0x3d2242[_0xeece('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4100a0){logger[_0xeece('0x10')](_0xeece('0x24'),_0x4e353a);logger['debug'](_0xeece('0x24'),_0x4e353a,JSON[_0xeece('0x14')](_0x4100a0));_0x20b8a5(_0x4100a0);})[_0xeece('0x18')](function(_0x548c7a){logger[_0xeece('0x15')](_0xeece('0x24'),_0x548c7a['message'],_0x4e353a);_0x34b149(_0x3e61fe[_0xeece('0x15')](0x1f4,_0x548c7a[_0xeece('0x16')]));});});}; \ No newline at end of file +var _0xb968=['stringify','catch','find','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','redis','defaults','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','options','raw','where','attributes','limit','include','map','model','then','GetMailQueue','debug'];(function(_0x23aba5,_0x26ea20){var _0x113061=function(_0x137f09){while(--_0x137f09){_0x23aba5['push'](_0x23aba5['shift']());}};_0x113061(++_0x26ea20);}(_0xb968,0x1b4));var _0x8b96=function(_0x209cf0,_0x2c1f2){_0x209cf0=_0x209cf0-0x0;var _0x25fc23=_0xb968[_0x209cf0];return _0x25fc23;};'use strict';var _=require(_0x8b96('0x0'));var util=require(_0x8b96('0x1'));var moment=require(_0x8b96('0x2'));var BPromise=require(_0x8b96('0x3'));var rs=require(_0x8b96('0x4'));var fs=require('fs');var Redis=require(_0x8b96('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b96('0x6'));var logger=require('../../config/logger')(_0x8b96('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8b96('0x8')][_0x8b96('0x9')]({'port':0x232a});config[_0x8b96('0xa')]=_[_0x8b96('0xb')](config[_0x8b96('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b96('0xa')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x20ec53,_0x222a56,_0x2f45c2){return new BPromise(function(_0x5cb634,_0x1b6052){return client[_0x8b96('0xc')](_0x20ec53,_0x2f45c2)['then'](function(_0x5a5e7b){logger[_0x8b96('0xd')](_0x8b96('0xe'),_0x222a56,_0x8b96('0xf'));logger['debug'](_0x8b96('0x10'),_0x222a56,'request\x20sent',JSON['stringify'](_0x5a5e7b));if(_0x5a5e7b['error']){if(_0x5a5e7b[_0x8b96('0x11')][_0x8b96('0x12')]===0x1f4){logger[_0x8b96('0x11')](_0x8b96('0xe'),_0x222a56,_0x5a5e7b[_0x8b96('0x11')]['message']);return _0x1b6052(_0x5a5e7b[_0x8b96('0x11')][_0x8b96('0x13')]);}logger['error'](_0x8b96('0xe'),_0x222a56,_0x5a5e7b[_0x8b96('0x11')][_0x8b96('0x13')]);return _0x5cb634(_0x5a5e7b[_0x8b96('0x11')][_0x8b96('0x13')]);}else{logger[_0x8b96('0xd')](_0x8b96('0xe'),_0x222a56,_0x8b96('0xf'));_0x5cb634(_0x5a5e7b[_0x8b96('0x14')][_0x8b96('0x13')]);}})['catch'](function(_0x23e1f2){logger[_0x8b96('0x11')](_0x8b96('0xe'),_0x222a56,_0x23e1f2);_0x1b6052(_0x23e1f2);});});}exports['GetMailQueue']=function(_0x27cd9c){var _0x3ff748=this;return new Promise(function(_0x1f1759,_0x3773a4){return db['MailQueue']['findAll']({'raw':_0x27cd9c[_0x8b96('0x15')]?_0x27cd9c[_0x8b96('0x15')][_0x8b96('0x16')]===undefined?!![]:![]:!![],'where':_0x27cd9c[_0x8b96('0x15')]?_0x27cd9c['options'][_0x8b96('0x17')]||null:null,'attributes':_0x27cd9c['options']?_0x27cd9c[_0x8b96('0x15')][_0x8b96('0x18')]||null:null,'limit':_0x27cd9c[_0x8b96('0x15')]?_0x27cd9c['options'][_0x8b96('0x19')]||null:null,'include':_0x27cd9c[_0x8b96('0x15')]?_0x27cd9c[_0x8b96('0x15')][_0x8b96('0x1a')]?_[_0x8b96('0x1b')](_0x27cd9c[_0x8b96('0x15')][_0x8b96('0x1a')],function(_0xdedbd9){return{'model':db[_0xdedbd9[_0x8b96('0x1c')]],'as':_0xdedbd9['as'],'attributes':_0xdedbd9[_0x8b96('0x18')],'include':_0xdedbd9[_0x8b96('0x1a')]?_['map'](_0xdedbd9[_0x8b96('0x1a')],function(_0x30afcd){return{'model':db[_0x30afcd[_0x8b96('0x1c')]],'as':_0x30afcd['as'],'attributes':_0x30afcd['attributes'],'include':_0x30afcd[_0x8b96('0x1a')]?_['map'](_0x30afcd[_0x8b96('0x1a')],function(_0x19664c){return{'model':db[_0x19664c['model']],'as':_0x19664c['as'],'attributes':_0x19664c['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b96('0x1d')](function(_0x232344){logger[_0x8b96('0xd')](_0x8b96('0x1e'),_0x27cd9c);logger[_0x8b96('0x1f')]('GetMailQueue',_0x27cd9c,JSON[_0x8b96('0x20')](_0x232344));_0x1f1759(_0x232344);})[_0x8b96('0x21')](function(_0x13433f){logger['error'](_0x8b96('0x1e'),_0x13433f[_0x8b96('0x13')],_0x27cd9c);_0x3773a4(_0x3ff748['error'](0x1f4,_0x13433f[_0x8b96('0x13')]));});});};exports['ShowMailQueue']=function(_0x17d280){var _0x31add3=this;return new Promise(function(_0x3c6fc6,_0x211a5f){return db['MailQueue'][_0x8b96('0x22')]({'raw':_0x17d280[_0x8b96('0x15')]?_0x17d280[_0x8b96('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x17d280[_0x8b96('0x15')]?_0x17d280['options'][_0x8b96('0x17')]||null:null,'attributes':_0x17d280[_0x8b96('0x15')]?_0x17d280[_0x8b96('0x15')][_0x8b96('0x18')]||null:null,'include':_0x17d280[_0x8b96('0x15')]?_0x17d280[_0x8b96('0x15')][_0x8b96('0x1a')]?_['map'](_0x17d280['options']['include'],function(_0x1c4985){return{'model':db[_0x1c4985[_0x8b96('0x1c')]],'as':_0x1c4985['as'],'attributes':_0x1c4985[_0x8b96('0x18')],'include':_0x1c4985[_0x8b96('0x1a')]?_[_0x8b96('0x1b')](_0x1c4985['include'],function(_0x50e355){return{'model':db[_0x50e355[_0x8b96('0x1c')]],'as':_0x50e355['as'],'attributes':_0x50e355['attributes'],'include':_0x50e355[_0x8b96('0x1a')]?_['map'](_0x50e355[_0x8b96('0x1a')],function(_0x165697){return{'model':db[_0x165697[_0x8b96('0x1c')]],'as':_0x165697['as'],'attributes':_0x165697['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x46bf58){logger[_0x8b96('0xd')](_0x8b96('0x23'),_0x17d280);logger['debug'](_0x8b96('0x23'),_0x17d280,JSON['stringify'](_0x46bf58));_0x3c6fc6(_0x46bf58);})[_0x8b96('0x21')](function(_0x3f3c08){logger[_0x8b96('0x11')]('ShowMailQueue',_0x3f3c08[_0x8b96('0x13')],_0x17d280);_0x211a5f(_0x31add3[_0x8b96('0x11')](0x1f4,_0x3f3c08[_0x8b96('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 1086716..6858c61 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 _0xebb1=['save','remove','update','emit','removeListener','register','mailQueue:'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xebb1,0x1e3));var _0x1ebb=function(_0x56f5f2,_0x448e74){_0x56f5f2=_0x56f5f2-0x0;var _0x21da01=_0xebb1[_0x56f5f2];return _0x21da01;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x1ebb('0x0'),_0x1ebb('0x1'),_0x1ebb('0x2')];function createListener(_0x2db068,_0x3f5e50){return function(_0x19735f){_0x3f5e50[_0x1ebb('0x3')](_0x2db068,_0x19735f);};}function removeListener(_0x10a84c,_0x146501){return function(){MailQueueEvents[_0x1ebb('0x4')](_0x10a84c,_0x146501);};}exports[_0x1ebb('0x5')]=function(_0x58d76b){for(var _0x3628f2=0x0,_0x2d3115=events['length'];_0x3628f2<_0x2d3115;_0x3628f2++){var _0x5f4f64=events[_0x3628f2];var _0x5da402=createListener(_0x1ebb('0x6')+_0x5f4f64,_0x58d76b);MailQueueEvents['on'](_0x5f4f64,_0x5da402);}}; \ No newline at end of file +var _0xcf01=['save','update','emit','removeListener','register','mailQueue:','./mailQueue.events'];(function(_0x3d9de8,_0x26defd){var _0x2746f1=function(_0x54c93e){while(--_0x54c93e){_0x3d9de8['push'](_0x3d9de8['shift']());}};_0x2746f1(++_0x26defd);}(_0xcf01,0x16b));var _0x1cf0=function(_0x519378,_0x6bec08){_0x519378=_0x519378-0x0;var _0x278456=_0xcf01[_0x519378];return _0x278456;};'use strict';var MailQueueEvents=require(_0x1cf0('0x0'));var events=[_0x1cf0('0x1'),'remove',_0x1cf0('0x2')];function createListener(_0x228f83,_0x1f99d3){return function(_0x500402){_0x1f99d3[_0x1cf0('0x3')](_0x228f83,_0x500402);};}function removeListener(_0xfd5c99,_0x5582b9){return function(){MailQueueEvents[_0x1cf0('0x4')](_0xfd5c99,_0x5582b9);};}exports[_0x1cf0('0x5')]=function(_0x33605e){for(var _0x343741=0x0,_0x536d4a=events['length'];_0x343741<_0x536d4a;_0x343741++){var _0x27f064=events[_0x343741];var _0x939a73=createListener(_0x1cf0('0x6')+_0x27f064,_0x33605e);MailQueueEvents['on'](_0x27f064,_0x939a73);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index bf7d0f0..1c56011 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 _0x2837=['multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports'];(function(_0x6cbff6,_0x3b59f8){var _0x390e52=function(_0xff24a){while(--_0xff24a){_0x6cbff6['push'](_0x6cbff6['shift']());}};_0x390e52(++_0x3b59f8);}(_0x2837,0x1a4));var _0x7283=function(_0x313c8c,_0x5d70ad){_0x313c8c=_0x313c8c-0x0;var _0x4c0249=_0x2837[_0x313c8c];return _0x4c0249;};'use strict';var multer=require(_0x7283('0x0'));var util=require('util');var path=require(_0x7283('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7283('0x2')]();var fs_extra=require(_0x7283('0x3'));var auth=require(_0x7283('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7283('0x5'));var controller=require(_0x7283('0x6'));router[_0x7283('0x7')]('/',auth['isAuthenticated'](),controller[_0x7283('0x8')]);router['get'](_0x7283('0x9'),auth['isAuthenticated'](),controller[_0x7283('0xa')]);router['get'](_0x7283('0xb'),auth[_0x7283('0xc')](),controller['show']);router[_0x7283('0xd')]('/',auth['isAuthenticated'](),controller[_0x7283('0xe')]);router[_0x7283('0xf')](_0x7283('0xb'),auth['isAuthenticated'](),controller[_0x7283('0x10')]);router[_0x7283('0x11')](_0x7283('0xb'),auth[_0x7283('0xc')](),controller[_0x7283('0x12')]);module[_0x7283('0x13')]=router; \ No newline at end of file +var _0x785f=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id','show','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x785f,0x123));var _0xf785=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x785f[_0x1b4b23];return _0x2a325b;};'use strict';var multer=require(_0xf785('0x0'));var util=require(_0xf785('0x1'));var path=require('path');var timeout=require(_0xf785('0x2'));var express=require(_0xf785('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf785('0x4'));var interaction=require(_0xf785('0x5'));var config=require(_0xf785('0x6'));var controller=require('./mailQueueReport.controller');router[_0xf785('0x7')]('/',auth['isAuthenticated'](),controller[_0xf785('0x8')]);router[_0xf785('0x7')]('/describe',auth[_0xf785('0x9')](),controller['describe']);router[_0xf785('0x7')](_0xf785('0xa'),auth[_0xf785('0x9')](),controller[_0xf785('0xb')]);router[_0xf785('0xc')]('/',auth[_0xf785('0x9')](),controller[_0xf785('0xd')]);router[_0xf785('0xe')](_0xf785('0xa'),auth[_0xf785('0x9')](),controller['update']);router[_0xf785('0xf')](_0xf785('0xa'),auth[_0xf785('0x9')](),controller[_0xf785('0x10')]);module[_0xf785('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 13aadd5..958e6bf 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 _0xd994=['moment','sequelize','exports','STRING','DATE'];(function(_0x2f8530,_0x5cbd67){var _0x5e814e=function(_0x490b29){while(--_0x490b29){_0x2f8530['push'](_0x2f8530['shift']());}};_0x5e814e(++_0x5cbd67);}(_0xd994,0x17c));var _0x4d99=function(_0x1a6153,_0x1ea84c){_0x1a6153=_0x1a6153-0x0;var _0x203afb=_0xd994[_0x1a6153];return _0x203afb;};'use strict';var moment=require(_0x4d99('0x0'));var Sequelize=require(_0x4d99('0x1'));module[_0x4d99('0x2')]={'uniqueid':{'type':Sequelize[_0x4d99('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4d99('0x3')]},'joinAt':{'type':Sequelize[_0x4d99('0x4')]},'leaveAt':{'type':Sequelize[_0x4d99('0x4')]},'acceptAt':{'type':Sequelize[_0x4d99('0x4')]},'exitAt':{'type':Sequelize[_0x4d99('0x4')]},'reason':{'type':Sequelize[_0x4d99('0x3')]}}; \ No newline at end of file +var _0x58d0=['moment','sequelize','exports','DATE','STRING'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x58d0,0x1a4));var _0x058d=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x58d0[_0xbeb808];return _0x5d6909;};'use strict';var moment=require(_0x058d('0x0'));var Sequelize=require(_0x058d('0x1'));module[_0x058d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x058d('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x058d('0x3')]},'reason':{'type':Sequelize[_0x058d('0x4')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index f8bd8dd..48a4b47 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 _0x1a85=['describe','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','fields','includeAll','find','create','body','params','destroy'];(function(_0x20a88d,_0x3b09f2){var _0x328f33=function(_0x40e18f){while(--_0x40e18f){_0x20a88d['push'](_0x20a88d['shift']());}};_0x328f33(++_0x3b09f2);}(_0x1a85,0x178));var _0x51a8=function(_0x124d12,_0x2351a1){_0x124d12=_0x124d12-0x0;var _0x54180f=_0x1a85[_0x124d12];return _0x54180f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x24')]();});}};}function handleEntityNotFound(_0x18e2f3,_0x157554){return function(_0x2f2f05){if(!_0x2f2f05){_0x18e2f3[_0x51a8('0x17')](0x194);}return _0x2f2f05;};}function handleError(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0x1f4;return function(_0x273ce2){logger[_0x51a8('0x25')](_0x273ce2[_0x51a8('0x26')]);if(_0x273ce2[_0x51a8('0x27')]){delete _0x273ce2[_0x51a8('0x27')];}_0x1326a2[_0x51a8('0x18')](_0x5b3f49)[_0x51a8('0x28')](_0x273ce2);};}exports[_0x51a8('0x29')]=function(_0xec08ae,_0x4b5cda){var _0x20c6b5={},_0x347a02={},_0x4a1548={'count':0x0,'rows':[]};var _0x2f9d53=_['map'](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x143f46){return{'name':_0x143f46[_0x51a8('0x2c')],'type':_0x143f46[_0x51a8('0x2d')]['key']};});_0x347a02[_0x51a8('0x2e')]=_['map'](_0x2f9d53,_0x51a8('0x27'));_0x347a02[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0xec08ae['query']);_0x347a02[_0x51a8('0x31')]=_['intersection'](_0x347a02[_0x51a8('0x2e')],_0x347a02[_0x51a8('0x2f')]);_0x20c6b5[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x347a02[_0x51a8('0x2e')],qs['fields'](_0xec08ae[_0x51a8('0x2f')]['fields']));_0x20c6b5[_0x51a8('0x32')]=_0x20c6b5[_0x51a8('0x32')][_0x51a8('0x34')]?_0x20c6b5['attributes']:_0x347a02[_0x51a8('0x2e')];if(!_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x35')](_0x51a8('0x36'))){_0x20c6b5[_0x51a8('0x1c')]=qs['limit'](_0xec08ae['query']['limit']);_0x20c6b5[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0xec08ae['query'][_0x51a8('0x1a')]);}_0x20c6b5['order']=qs[_0x51a8('0x37')](_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x37')]);_0x20c6b5[_0x51a8('0x38')]=qs[_0x51a8('0x31')](_[_0x51a8('0x39')](_0xec08ae['query'],_0x347a02['filters']),_0x2f9d53);if(_0xec08ae[_0x51a8('0x2f')]['filter']){_0x20c6b5['where']=_['merge'](_0x20c6b5[_0x51a8('0x38')],{'$or':_[_0x51a8('0x3a')](_0x2f9d53,function(_0x3cbf97){if(_0x3cbf97['type']!==_0x51a8('0x3b')){var _0x25d772={};_0x25d772[_0x3cbf97[_0x51a8('0x27')]]={'$like':'%'+_0xec08ae[_0x51a8('0x2f')]['filter']+'%'};return _0x25d772;}})});}_0x20c6b5=_[_0x51a8('0x3c')]({},_0x20c6b5,_0xec08ae[_0x51a8('0x3d')]);var _0x1b0333={'where':_0x20c6b5['where']};return db[_0x51a8('0x2a')]['count'](_0x1b0333)[_0x51a8('0x23')](function(_0x1e637a){_0x4a1548[_0x51a8('0x1d')]=_0x1e637a;if(_0xec08ae[_0x51a8('0x2f')]['includeAll']){_0x20c6b5[_0x51a8('0x3e')]=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3f')](_0x20c6b5);})[_0x51a8('0x23')](function(_0xa33fc){_0x4a1548[_0x51a8('0x40')]=_0xa33fc;return _0x4a1548;})[_0x51a8('0x23')](respondWithFilteredResult(_0x4b5cda,_0x20c6b5))[_0x51a8('0x41')](handleError(_0x4b5cda,null));};exports[_0x51a8('0x42')]=function(_0x4b8467,_0x22e6e6){var _0x2afb74={'raw':!![],'where':{'id':_0x4b8467['params']['id']}},_0x4c7c67={};_0x4c7c67[_0x51a8('0x2e')]=_[_0x51a8('0x30')](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x4c7c67[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0x4b8467[_0x51a8('0x2f')]);_0x4c7c67[_0x51a8('0x31')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],_0x4c7c67['query']);_0x2afb74[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],qs[_0x51a8('0x43')](_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x43')]));_0x2afb74['attributes']=_0x2afb74[_0x51a8('0x32')]['length']?_0x2afb74[_0x51a8('0x32')]:_0x4c7c67[_0x51a8('0x2e')];if(_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x44')]){_0x2afb74[_0x51a8('0x3e')]=[{'all':!![]}];}_0x2afb74=_['merge']({},_0x2afb74,_0x4b8467['options']);return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x2afb74)[_0x51a8('0x23')](handleEntityNotFound(_0x22e6e6,null))[_0x51a8('0x23')](respondWithResult(_0x22e6e6,null))[_0x51a8('0x41')](handleError(_0x22e6e6,null));};exports['create']=function(_0x504a43,_0xcbd998){return db[_0x51a8('0x2a')][_0x51a8('0x46')](_0x504a43[_0x51a8('0x47')],{})[_0x51a8('0x23')](respondWithResult(_0xcbd998,0xc9))[_0x51a8('0x41')](handleError(_0xcbd998,null));};exports[_0x51a8('0x22')]=function(_0x1103a3,_0x301578){if(_0x1103a3['body']['id']){delete _0x1103a3['body']['id'];}return db['MailQueueReport'][_0x51a8('0x45')]({'where':{'id':_0x1103a3[_0x51a8('0x48')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x301578,null))['then'](saveUpdates(_0x1103a3[_0x51a8('0x47')],null))[_0x51a8('0x23')](respondWithResult(_0x301578,null))['catch'](handleError(_0x301578,null));};exports[_0x51a8('0x49')]=function(_0x4fb93c,_0x50a2f8){return db[_0x51a8('0x2a')][_0x51a8('0x45')]({'where':{'id':_0x4fb93c[_0x51a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x50a2f8,null))['then'](removeEntity(_0x50a2f8,null))[_0x51a8('0x41')](handleError(_0x50a2f8,null));};exports['describe']=function(_0x21c4da,_0xc89617){return db[_0x51a8('0x2a')][_0x51a8('0x4a')]()[_0x51a8('0x23')](respondWithResult(_0xc89617,null))[_0x51a8('0x41')](handleError(_0xc89617,null));}; \ No newline at end of file +var _0x5464=['undefined','limit','count','set','Content-Range','json','reject','update','then','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','MailQueueReport','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset'];(function(_0x1a1968,_0xe3397){var _0x409e1a=function(_0x2b8c53){while(--_0x2b8c53){_0x1a1968['push'](_0x1a1968['shift']());}};_0x409e1a(++_0xe3397);}(_0x5464,0x15d));var _0x4546=function(_0x5a4e6e,_0x13b7c9){_0x5a4e6e=_0x5a4e6e-0x0;var _0x3e0ce0=_0x5464[_0x5a4e6e];return _0x3e0ce0;};'use strict';var emlformat=require(_0x4546('0x0'));var rimraf=require(_0x4546('0x1'));var zipdir=require(_0x4546('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4546('0x3'));var moment=require('moment');var BPromise=require(_0x4546('0x4'));var Mustache=require('mustache');var util=require(_0x4546('0x5'));var path=require(_0x4546('0x6'));var sox=require(_0x4546('0x7'));var csv=require(_0x4546('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4546('0x9'));var crypto=require(_0x4546('0xa'));var jsforce=require(_0x4546('0xb'));var deskjs=require(_0x4546('0xc'));var toCsv=require(_0x4546('0x8'));var querystring=require(_0x4546('0xd'));var Papa=require(_0x4546('0xe'));var Redis=require(_0x4546('0xf'));var authService=require(_0x4546('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4546('0x11'));var hardwareService=require(_0x4546('0x12'));var logger=require(_0x4546('0x13'))('api');var utils=require(_0x4546('0x14'));var config=require(_0x4546('0x15'));var licenseUtil=require(_0x4546('0x16'));var db=require(_0x4546('0x17'))['db'];function respondWithStatusCode(_0x4d31a7,_0x4f2641){_0x4f2641=_0x4f2641||0xcc;return function(_0x3e6622){if(_0x3e6622){return _0x4d31a7['sendStatus'](_0x4f2641);}return _0x4d31a7['status'](_0x4f2641)['end']();};}function respondWithResult(_0x5b64b7,_0x598516){_0x598516=_0x598516||0xc8;return function(_0x4f5571){if(_0x4f5571){return _0x5b64b7[_0x4546('0x18')](_0x598516)['json'](_0x4f5571);}};}function respondWithFilteredResult(_0x363a17,_0x54581c){return function(_0x26fc0e){if(_0x26fc0e){var _0x564f3e=typeof _0x54581c[_0x4546('0x19')]===_0x4546('0x1a')&&typeof _0x54581c[_0x4546('0x1b')]===_0x4546('0x1a');var _0x2a294b=_0x26fc0e[_0x4546('0x1c')];var _0x57d8de=_0x564f3e?0x0:_0x54581c['offset'];var _0x5780a7=_0x564f3e?_0x26fc0e[_0x4546('0x1c')]:_0x54581c[_0x4546('0x19')]+_0x54581c[_0x4546('0x1b')];var _0x3d95c2;if(_0x5780a7>=_0x2a294b){_0x5780a7=_0x2a294b;_0x3d95c2=0xc8;}else{_0x3d95c2=0xce;}_0x363a17[_0x4546('0x18')](_0x3d95c2);return _0x363a17[_0x4546('0x1d')](_0x4546('0x1e'),_0x57d8de+'-'+_0x5780a7+'/'+_0x2a294b)[_0x4546('0x1f')](_0x26fc0e);}return null;};}function patchUpdates(_0x4034a5){return function(_0xceb1d6){try{jsonpatch['apply'](_0xceb1d6,_0x4034a5,!![]);}catch(_0x2d689f){return BPromise[_0x4546('0x20')](_0x2d689f);}return _0xceb1d6['save']();};}function saveUpdates(_0x3067ab,_0x437f55){return function(_0x1a1984){if(_0x1a1984){return _0x1a1984[_0x4546('0x21')](_0x3067ab)[_0x4546('0x22')](function(_0x15b013){return _0x15b013;});}return null;};}function removeEntity(_0x53e402,_0x3dab5c){return function(_0x2cca8b){if(_0x2cca8b){return _0x2cca8b['destroy']()[_0x4546('0x22')](function(){_0x53e402[_0x4546('0x18')](0xcc)[_0x4546('0x23')]();});}};}function handleEntityNotFound(_0x4467ee,_0x23084b){return function(_0x53ae5e){if(!_0x53ae5e){_0x4467ee[_0x4546('0x24')](0x194);}return _0x53ae5e;};}function handleError(_0x3796fe,_0x831fa5){_0x831fa5=_0x831fa5||0x1f4;return function(_0x48fc36){logger['error'](_0x48fc36[_0x4546('0x25')]);if(_0x48fc36[_0x4546('0x26')]){delete _0x48fc36[_0x4546('0x26')];}_0x3796fe[_0x4546('0x18')](_0x831fa5)[_0x4546('0x27')](_0x48fc36);};}exports[_0x4546('0x28')]=function(_0xcea7da,_0x586ff1){var _0x367b23={},_0x52c546={},_0x3a2d12={'count':0x0,'rows':[]};var _0x161815=_['map'](db['MailQueueReport'][_0x4546('0x29')],function(_0x5af997){return{'name':_0x5af997[_0x4546('0x2a')],'type':_0x5af997[_0x4546('0x2b')]['key']};});_0x52c546['model']=_[_0x4546('0x2c')](_0x161815,_0x4546('0x26'));_0x52c546[_0x4546('0x2d')]=_['keys'](_0xcea7da[_0x4546('0x2d')]);_0x52c546[_0x4546('0x2e')]=_['intersection'](_0x52c546[_0x4546('0x2f')],_0x52c546['query']);_0x367b23[_0x4546('0x30')]=_[_0x4546('0x31')](_0x52c546[_0x4546('0x2f')],qs[_0x4546('0x32')](_0xcea7da['query'][_0x4546('0x32')]));_0x367b23[_0x4546('0x30')]=_0x367b23[_0x4546('0x30')][_0x4546('0x33')]?_0x367b23[_0x4546('0x30')]:_0x52c546[_0x4546('0x2f')];if(!_0xcea7da['query'][_0x4546('0x34')](_0x4546('0x35'))){_0x367b23['limit']=qs['limit'](_0xcea7da[_0x4546('0x2d')][_0x4546('0x1b')]);_0x367b23['offset']=qs[_0x4546('0x19')](_0xcea7da[_0x4546('0x2d')]['offset']);}_0x367b23['order']=qs[_0x4546('0x36')](_0xcea7da[_0x4546('0x2d')][_0x4546('0x36')]);_0x367b23[_0x4546('0x37')]=qs[_0x4546('0x2e')](_[_0x4546('0x38')](_0xcea7da['query'],_0x52c546[_0x4546('0x2e')]),_0x161815);if(_0xcea7da[_0x4546('0x2d')]['filter']){_0x367b23[_0x4546('0x37')]=_['merge'](_0x367b23[_0x4546('0x37')],{'$or':_[_0x4546('0x2c')](_0x161815,function(_0x53683e){if(_0x53683e['type']!==_0x4546('0x39')){var _0x453593={};_0x453593[_0x53683e[_0x4546('0x26')]]={'$like':'%'+_0xcea7da['query'][_0x4546('0x3a')]+'%'};return _0x453593;}})});}_0x367b23=_[_0x4546('0x3b')]({},_0x367b23,_0xcea7da[_0x4546('0x3c')]);var _0x1f815e={'where':_0x367b23[_0x4546('0x37')]};return db[_0x4546('0x3d')][_0x4546('0x1c')](_0x1f815e)[_0x4546('0x22')](function(_0x4b67d4){_0x3a2d12[_0x4546('0x1c')]=_0x4b67d4;if(_0xcea7da[_0x4546('0x2d')]['includeAll']){_0x367b23['include']=[{'all':!![]}];}return db[_0x4546('0x3d')][_0x4546('0x3e')](_0x367b23);})[_0x4546('0x22')](function(_0x1ea5c4){_0x3a2d12[_0x4546('0x3f')]=_0x1ea5c4;return _0x3a2d12;})['then'](respondWithFilteredResult(_0x586ff1,_0x367b23))[_0x4546('0x40')](handleError(_0x586ff1,null));};exports[_0x4546('0x41')]=function(_0x1060d1,_0x185b76){var _0x236fc0={'raw':!![],'where':{'id':_0x1060d1[_0x4546('0x42')]['id']}},_0x3fabf0={};_0x3fabf0[_0x4546('0x2f')]=_[_0x4546('0x43')](db['MailQueueReport'][_0x4546('0x29')]);_0x3fabf0[_0x4546('0x2d')]=_[_0x4546('0x43')](_0x1060d1[_0x4546('0x2d')]);_0x3fabf0[_0x4546('0x2e')]=_[_0x4546('0x31')](_0x3fabf0[_0x4546('0x2f')],_0x3fabf0[_0x4546('0x2d')]);_0x236fc0[_0x4546('0x30')]=_[_0x4546('0x31')](_0x3fabf0[_0x4546('0x2f')],qs['fields'](_0x1060d1[_0x4546('0x2d')][_0x4546('0x32')]));_0x236fc0['attributes']=_0x236fc0[_0x4546('0x30')][_0x4546('0x33')]?_0x236fc0[_0x4546('0x30')]:_0x3fabf0['model'];if(_0x1060d1[_0x4546('0x2d')][_0x4546('0x44')]){_0x236fc0[_0x4546('0x45')]=[{'all':!![]}];}_0x236fc0=_[_0x4546('0x3b')]({},_0x236fc0,_0x1060d1[_0x4546('0x3c')]);return db[_0x4546('0x3d')][_0x4546('0x46')](_0x236fc0)[_0x4546('0x22')](handleEntityNotFound(_0x185b76,null))[_0x4546('0x22')](respondWithResult(_0x185b76,null))[_0x4546('0x40')](handleError(_0x185b76,null));};exports['create']=function(_0x395c43,_0x24a637){return db['MailQueueReport'][_0x4546('0x47')](_0x395c43[_0x4546('0x48')],{})[_0x4546('0x22')](respondWithResult(_0x24a637,0xc9))[_0x4546('0x40')](handleError(_0x24a637,null));};exports['update']=function(_0x329566,_0x57bb39){if(_0x329566[_0x4546('0x48')]['id']){delete _0x329566[_0x4546('0x48')]['id'];}return db[_0x4546('0x3d')]['find']({'where':{'id':_0x329566[_0x4546('0x42')]['id']}})[_0x4546('0x22')](handleEntityNotFound(_0x57bb39,null))[_0x4546('0x22')](saveUpdates(_0x329566[_0x4546('0x48')],null))[_0x4546('0x22')](respondWithResult(_0x57bb39,null))[_0x4546('0x40')](handleError(_0x57bb39,null));};exports[_0x4546('0x49')]=function(_0x325181,_0x43f630){return db[_0x4546('0x3d')][_0x4546('0x46')]({'where':{'id':_0x325181['params']['id']}})[_0x4546('0x22')](handleEntityNotFound(_0x43f630,null))[_0x4546('0x22')](removeEntity(_0x43f630,null))['catch'](handleError(_0x43f630,null));};exports[_0x4546('0x4a')]=function(_0xe9e3c1,_0xca0f44){return db['MailQueueReport'][_0x4546('0x4a')]()[_0x4546('0x22')](respondWithResult(_0xca0f44,null))[_0x4546('0x40')](handleError(_0xca0f44,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 76de58c..16782d4 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 _0x8572=['MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger','api','request-promise','../../config/environment','./mailQueueReport.attributes','define'];(function(_0x43c0fe,_0x352be1){var _0x50a5c2=function(_0x51fd2e){while(--_0x51fd2e){_0x43c0fe['push'](_0x43c0fe['shift']());}};_0x50a5c2(++_0x352be1);}(_0x8572,0xdf));var _0x2857=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x8572[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x2857('0x0'));var util=require('util');var logger=require(_0x2857('0x1'))(_0x2857('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2857('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2857('0x4'));var attributes=require(_0x2857('0x5'));module['exports']=function(_0xf69327,_0x1506f7){return _0xf69327[_0x2857('0x6')](_0x2857('0x7'),attributes,{'tableName':_0x2857('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2857('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x418f=['../../config/logger','api','moment','bluebird','path','../../config/environment','./mailQueueReport.attributes','report_mail_queue','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x418f,0x116));var _0xf418=function(_0x45228a,_0x4acbf3){_0x45228a=_0x45228a-0x0;var _0x4fbf5e=_0x418f[_0x45228a];return _0x4fbf5e;};'use strict';var _=require(_0xf418('0x0'));var util=require(_0xf418('0x1'));var logger=require(_0xf418('0x2'))(_0xf418('0x3'));var moment=require(_0xf418('0x4'));var BPromise=require(_0xf418('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf418('0x6'));var rimraf=require('rimraf');var config=require(_0xf418('0x7'));var attributes=require(_0xf418('0x8'));module['exports']=function(_0x22fa0b,_0xe32f2d){return _0x22fa0b['define']('MailQueueReport',attributes,{'tableName':_0xf418('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 2f2883f..72a6f06 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(_0x193330,_0x113b84){var _0x3306f6=function(_0x20bc11){while(--_0x20bc11){_0x193330['push'](_0x193330['shift']());}};_0x3306f6(++_0x113b84);}(_0x5f2f,0x73));var _0xf5f2=function(_0x433ca9,_0x3f9cf7){_0x433ca9=_0x433ca9-0x0;var _0x5afb21=_0x5f2f[_0x433ca9];return _0x5afb21;};'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(_0x2121b5,_0xd67444){var _0x28d8af=function(_0x4726e1){while(--_0x4726e1){_0x2121b5['push'](_0x2121b5['shift']());}};_0x28d8af(++_0xd67444);}(_0x1261,0x144));var _0x1126=function(_0x4b7d87,_0x238711){_0x4b7d87=_0x4b7d87-0x0;var _0x3b9f82=_0x1261[_0x4b7d87];return _0x3b9f82;};'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 cebce14..ad94c97 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(_0xef1e04,_0x342678){var _0x22adc2=function(_0x72cc69){while(--_0x72cc69){_0xef1e04['push'](_0xef1e04['shift']());}};_0x22adc2(++_0x342678);}(_0x70e0,0x17b));var _0x070e=function(_0x26e7a6,_0x1171d6){_0x26e7a6=_0x26e7a6-0x0;var _0x57e73c=_0x70e0[_0x26e7a6];return _0x57e73c;};'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(_0x16dfa1,_0x3f9429){var _0x5c9ad5=function(_0x1cba05){while(--_0x1cba05){_0x16dfa1['push'](_0x16dfa1['shift']());}};_0x5c9ad5(++_0x3f9429);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 2942852..561d329 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 _0x3167=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x1b8a6c,_0x4c2a5f){var _0x13ec3b=function(_0x53e579){while(--_0x53e579){_0x1b8a6c['push'](_0x1b8a6c['shift']());}};_0x13ec3b(++_0x4c2a5f);}(_0x3167,0x1ca));var _0x7316=function(_0x121f0a,_0x38d0a6){_0x121f0a=_0x121f0a-0x0;var _0x47afc8=_0x3167[_0x121f0a];return _0x47afc8;};'use strict';var Sequelize=require(_0x7316('0x0'));module['exports']={'description':{'type':Sequelize[_0x7316('0x1')]},'host':{'type':Sequelize[_0x7316('0x1')]},'authentication':{'type':Sequelize[_0x7316('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x7316('0x1')]},'password':{'type':Sequelize[_0x7316('0x1')]},'port':{'type':Sequelize[_0x7316('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7316('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x7316('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x7316('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6d55=['STRING','BOOLEAN','INTEGER'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0x6d55,0xae));var _0x56d5=function(_0x1ea053,_0x22aecc){_0x1ea053=_0x1ea053-0x0;var _0x444b08=_0x6d55[_0x1ea053];return _0x444b08;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x56d5('0x0')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x56d5('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x56d5('0x0')]},'password':{'type':Sequelize[_0x56d5('0x0')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x56d5('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x56d5('0x0')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x56d5('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x56d5('0x0')]},'modernAuthentication':{'type':Sequelize[_0x56d5('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 8370f50..cdca9a3 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 _0xbbb1=['lodash','util','moment','bluebird','request-promise','path','rimraf','./mailServerIn.attributes','define','mail_servers_in'];(function(_0x47ba8e,_0x3438eb){var _0x121ff4=function(_0xd46bcb){while(--_0xd46bcb){_0x47ba8e['push'](_0x47ba8e['shift']());}};_0x121ff4(++_0x3438eb);}(_0xbbb1,0x122));var _0x1bbb=function(_0x2ec316,_0x19f5a3){_0x2ec316=_0x2ec316-0x0;var _0x27378b=_0xbbb1[_0x2ec316];return _0x27378b;};'use strict';var _=require(_0x1bbb('0x0'));var util=require(_0x1bbb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1bbb('0x2'));var BPromise=require(_0x1bbb('0x3'));var rp=require(_0x1bbb('0x4'));var fs=require('fs');var path=require(_0x1bbb('0x5'));var rimraf=require(_0x1bbb('0x6'));var config=require('../../config/environment');var attributes=require(_0x1bbb('0x7'));module['exports']=function(_0x5ca90e,_0x35c843){return _0x5ca90e[_0x1bbb('0x8')]('MailServerIn',attributes,{'tableName':_0x1bbb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7072=['bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','define','lodash','util','../../config/logger','moment'];(function(_0x994064,_0x34b726){var _0xbc150a=function(_0x370103){while(--_0x370103){_0x994064['push'](_0x994064['shift']());}};_0xbc150a(++_0x34b726);}(_0x7072,0xc4));var _0x2707=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x7072[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x2707('0x0'));var util=require(_0x2707('0x1'));var logger=require(_0x2707('0x2'))('api');var moment=require(_0x2707('0x3'));var BPromise=require(_0x2707('0x4'));var rp=require(_0x2707('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2707('0x6'));var config=require(_0x2707('0x7'));var attributes=require(_0x2707('0x8'));module['exports']=function(_0x3c59e7,_0x25b2ac){return _0x3c59e7[_0x2707('0x9')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 73886a2..4b34500 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 _0x10a7=['map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','include'];(function(_0x2ac9ab,_0x21d504){var _0x4df924=function(_0x294b4c){while(--_0x294b4c){_0x2ac9ab['push'](_0x2ac9ab['shift']());}};_0x4df924(++_0x21d504);}(_0x10a7,0xd4));var _0x710a=function(_0x266e66,_0x54dc8c){_0x266e66=_0x266e66-0x0;var _0x9da6f=_0x10a7[_0x266e66];return _0x9da6f;};'use strict';var _=require(_0x710a('0x0'));var util=require(_0x710a('0x1'));var moment=require(_0x710a('0x2'));var BPromise=require(_0x710a('0x3'));var rs=require(_0x710a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x710a('0x5'))['db'];var utils=require(_0x710a('0x6'));var logger=require(_0x710a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x710a('0x8')][_0x710a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5da46a,_0x12c446,_0x485920){return new BPromise(function(_0x3a700f,_0x4dedb7){return client[_0x710a('0xa')](_0x5da46a,_0x485920)[_0x710a('0xb')](function(_0x3841e6){logger[_0x710a('0xc')](_0x710a('0xd'),_0x12c446,_0x710a('0xe'));logger[_0x710a('0xf')](_0x710a('0x10'),_0x12c446,_0x710a('0xe'),JSON[_0x710a('0x11')](_0x3841e6));if(_0x3841e6['error']){if(_0x3841e6[_0x710a('0x12')]['code']===0x1f4){logger[_0x710a('0x12')](_0x710a('0xd'),_0x12c446,_0x3841e6[_0x710a('0x12')]['message']);return _0x4dedb7(_0x3841e6[_0x710a('0x12')][_0x710a('0x13')]);}logger[_0x710a('0x12')](_0x710a('0xd'),_0x12c446,_0x3841e6[_0x710a('0x12')]['message']);return _0x3a700f(_0x3841e6[_0x710a('0x12')][_0x710a('0x13')]);}else{logger[_0x710a('0xc')]('MailServerIn,\x20%s,\x20%s',_0x12c446,'request\x20sent');_0x3a700f(_0x3841e6['result'][_0x710a('0x13')]);}})[_0x710a('0x14')](function(_0x50ddc1){logger[_0x710a('0x12')](_0x710a('0xd'),_0x12c446,_0x50ddc1);_0x4dedb7(_0x50ddc1);});});}exports[_0x710a('0x15')]=function(_0x3ae303){var _0x41459b=this;return new Promise(function(_0x44dc80,_0x512980){return db[_0x710a('0x16')][_0x710a('0x17')]({'raw':_0x3ae303[_0x710a('0x18')]?_0x3ae303[_0x710a('0x18')][_0x710a('0x19')]===undefined?!![]:![]:!![],'where':_0x3ae303[_0x710a('0x18')]?_0x3ae303['options']['where']||null:null,'attributes':_0x3ae303[_0x710a('0x18')]?_0x3ae303[_0x710a('0x18')][_0x710a('0x1a')]||null:null,'limit':_0x3ae303['options']?_0x3ae303[_0x710a('0x18')]['limit']||null:null,'include':_0x3ae303[_0x710a('0x18')]?_0x3ae303[_0x710a('0x18')][_0x710a('0x1b')]?_[_0x710a('0x1c')](_0x3ae303[_0x710a('0x18')][_0x710a('0x1b')],function(_0x1bd059){return{'model':db[_0x1bd059[_0x710a('0x1d')]],'as':_0x1bd059['as'],'attributes':_0x1bd059[_0x710a('0x1a')],'include':_0x1bd059[_0x710a('0x1b')]?_[_0x710a('0x1c')](_0x1bd059[_0x710a('0x1b')],function(_0xe038ec){return{'model':db[_0xe038ec[_0x710a('0x1d')]],'as':_0xe038ec['as'],'attributes':_0xe038ec[_0x710a('0x1a')],'include':_0xe038ec[_0x710a('0x1b')]?_[_0x710a('0x1c')](_0xe038ec[_0x710a('0x1b')],function(_0xcd7a98){return{'model':db[_0xcd7a98[_0x710a('0x1d')]],'as':_0xcd7a98['as'],'attributes':_0xcd7a98[_0x710a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x710a('0xb')](function(_0x249386){logger[_0x710a('0xc')]('GetMailServerIn',_0x3ae303);logger[_0x710a('0xf')]('GetMailServerIn',_0x3ae303,JSON[_0x710a('0x11')](_0x249386));_0x44dc80(_0x249386);})[_0x710a('0x14')](function(_0xf014f9){logger['error'](_0x710a('0x15'),_0xf014f9[_0x710a('0x13')],_0x3ae303);_0x512980(_0x41459b[_0x710a('0x12')](0x1f4,_0xf014f9[_0x710a('0x13')]));});});}; \ No newline at end of file +var _0x23c5=['request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailServerIn','MailServerIn','options','raw','attributes','limit','include','map','model','then','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailServerIn,\x20%s,\x20%s'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x23c5,0x128));var _0x523c=function(_0x288bb8,_0x179b90){_0x288bb8=_0x288bb8-0x0;var _0x4cf10b=_0x23c5[_0x288bb8];return _0x4cf10b;};'use strict';var _=require(_0x523c('0x0'));var util=require(_0x523c('0x1'));var moment=require(_0x523c('0x2'));var BPromise=require('bluebird');var rs=require(_0x523c('0x3'));var fs=require('fs');var Redis=require(_0x523c('0x4'));var db=require(_0x523c('0x5'))['db'];var utils=require(_0x523c('0x6'));var logger=require(_0x523c('0x7'))(_0x523c('0x8'));var config=require(_0x523c('0x9'));var jayson=require(_0x523c('0xa'));var client=jayson['client'][_0x523c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3088a5,_0x17d841,_0x2d02ae){return new BPromise(function(_0x10f5cf,_0xfc6e68){return client['request'](_0x3088a5,_0x2d02ae)['then'](function(_0x11d20c){logger[_0x523c('0xc')](_0x523c('0xd'),_0x17d841,_0x523c('0xe'));logger['debug'](_0x523c('0xf'),_0x17d841,_0x523c('0xe'),JSON['stringify'](_0x11d20c));if(_0x11d20c[_0x523c('0x10')]){if(_0x11d20c[_0x523c('0x10')][_0x523c('0x11')]===0x1f4){logger[_0x523c('0x10')](_0x523c('0xd'),_0x17d841,_0x11d20c[_0x523c('0x10')][_0x523c('0x12')]);return _0xfc6e68(_0x11d20c[_0x523c('0x10')][_0x523c('0x12')]);}logger[_0x523c('0x10')](_0x523c('0xd'),_0x17d841,_0x11d20c[_0x523c('0x10')]['message']);return _0x10f5cf(_0x11d20c[_0x523c('0x10')][_0x523c('0x12')]);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x17d841,_0x523c('0xe'));_0x10f5cf(_0x11d20c['result'][_0x523c('0x12')]);}})[_0x523c('0x13')](function(_0x233a08){logger[_0x523c('0x10')](_0x523c('0xd'),_0x17d841,_0x233a08);_0xfc6e68(_0x233a08);});});}exports[_0x523c('0x14')]=function(_0xcb395a){var _0x101eff=this;return new Promise(function(_0x41458d,_0x294209){return db[_0x523c('0x15')]['findAll']({'raw':_0xcb395a[_0x523c('0x16')]?_0xcb395a[_0x523c('0x16')][_0x523c('0x17')]===undefined?!![]:![]:!![],'where':_0xcb395a[_0x523c('0x16')]?_0xcb395a[_0x523c('0x16')]['where']||null:null,'attributes':_0xcb395a[_0x523c('0x16')]?_0xcb395a[_0x523c('0x16')][_0x523c('0x18')]||null:null,'limit':_0xcb395a[_0x523c('0x16')]?_0xcb395a[_0x523c('0x16')][_0x523c('0x19')]||null:null,'include':_0xcb395a[_0x523c('0x16')]?_0xcb395a[_0x523c('0x16')][_0x523c('0x1a')]?_[_0x523c('0x1b')](_0xcb395a[_0x523c('0x16')][_0x523c('0x1a')],function(_0x339a12){return{'model':db[_0x339a12['model']],'as':_0x339a12['as'],'attributes':_0x339a12['attributes'],'include':_0x339a12[_0x523c('0x1a')]?_[_0x523c('0x1b')](_0x339a12[_0x523c('0x1a')],function(_0x410d29){return{'model':db[_0x410d29[_0x523c('0x1c')]],'as':_0x410d29['as'],'attributes':_0x410d29[_0x523c('0x18')],'include':_0x410d29['include']?_[_0x523c('0x1b')](_0x410d29[_0x523c('0x1a')],function(_0x347066){return{'model':db[_0x347066['model']],'as':_0x347066['as'],'attributes':_0x347066[_0x523c('0x18')]};}):[]};}):[]};}):[]:[]})[_0x523c('0x1d')](function(_0x56625d){logger[_0x523c('0xc')](_0x523c('0x14'),_0xcb395a);logger[_0x523c('0x1e')](_0x523c('0x14'),_0xcb395a,JSON['stringify'](_0x56625d));_0x41458d(_0x56625d);})[_0x523c('0x13')](function(_0x34e724){logger[_0x523c('0x10')]('GetMailServerIn',_0x34e724[_0x523c('0x12')],_0xcb395a);_0x294209(_0x101eff[_0x523c('0x10')](0x1f4,_0x34e724[_0x523c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 25aab97..62baee6 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(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7a54,0x106));var _0x47a5=function(_0x2c6010,_0xe74e61){_0x2c6010=_0x2c6010-0x0;var _0x37dfc2=_0x7a54[_0x2c6010];return _0x37dfc2;};'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(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_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 21d1c73..411a29a 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 _0x80ed=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x2deac4,_0xc27a2b){var _0x1c0bda=function(_0x1deceb){while(--_0x1deceb){_0x2deac4['push'](_0x2deac4['shift']());}};_0x1c0bda(++_0xc27a2b);}(_0x80ed,0x11c));var _0xd80e=function(_0x515b67,_0x97e062){_0x515b67=_0x515b67-0x0;var _0x5ac13a=_0x80ed[_0x515b67];return _0x5ac13a;};'use strict';var Sequelize=require(_0xd80e('0x0'));module['exports']={'description':{'type':Sequelize[_0xd80e('0x1')]},'host':{'type':Sequelize[_0xd80e('0x1')]},'user':{'type':Sequelize[_0xd80e('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd80e('0x2')]},'secure':{'type':Sequelize[_0xd80e('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xd80e('0x1')]},'authentication':{'type':Sequelize[_0xd80e('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x84a0=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x84a0,0x66));var _0x084a=function(_0x263f81,_0x490cad){_0x263f81=_0x263f81-0x0;var _0xf2563=_0x84a0[_0x263f81];return _0xf2563;};'use strict';var Sequelize=require(_0x084a('0x0'));module[_0x084a('0x1')]={'description':{'type':Sequelize[_0x084a('0x2')]},'host':{'type':Sequelize[_0x084a('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x084a('0x2')]},'port':{'type':Sequelize[_0x084a('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x084a('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x084a('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 8eed4eb..7e882cf 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 _0x2e75=['to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','map','MailServerOut','fieldName','type','model','keys','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','create','body','find','eml-format','rimraf','fast-json-patch','path','sox'];(function(_0x4dbe6b,_0x24b7cf){var _0x235c96=function(_0x1953ab){while(--_0x1953ab){_0x4dbe6b['push'](_0x4dbe6b['shift']());}};_0x235c96(++_0x24b7cf);}(_0x2e75,0x117));var _0x52e7=function(_0x57b34e,_0x3b6f34){_0x57b34e=_0x57b34e-0x0;var _0x3ce527=_0x2e75[_0x57b34e];return _0x3ce527;};'use strict';var emlformat=require(_0x52e7('0x0'));var rimraf=require(_0x52e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x52e7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x52e7('0x3'));var sox=require(_0x52e7('0x4'));var csv=require(_0x52e7('0x5'));var ejs=require(_0x52e7('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x52e7('0x7'));var squel=require(_0x52e7('0x8'));var crypto=require(_0x52e7('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x52e7('0x5'));var querystring=require(_0x52e7('0xa'));var Papa=require('papaparse');var Redis=require(_0x52e7('0xb'));var authService=require(_0x52e7('0xc'));var qs=require(_0x52e7('0xd'));var as=require(_0x52e7('0xe'));var hardwareService=require(_0x52e7('0xf'));var logger=require(_0x52e7('0x10'))(_0x52e7('0x11'));var utils=require(_0x52e7('0x12'));var config=require(_0x52e7('0x13'));var licenseUtil=require(_0x52e7('0x14'));var db=require(_0x52e7('0x15'))['db'];function respondWithStatusCode(_0x5cd61d,_0x414b7f){_0x414b7f=_0x414b7f||0xcc;return function(_0x532edc){if(_0x532edc){return _0x5cd61d[_0x52e7('0x16')](_0x414b7f);}return _0x5cd61d[_0x52e7('0x17')](_0x414b7f)['end']();};}function respondWithResult(_0x112e36,_0x48dcf1){_0x48dcf1=_0x48dcf1||0xc8;return function(_0x6dabfb){if(_0x6dabfb){return _0x112e36[_0x52e7('0x17')](_0x48dcf1)[_0x52e7('0x18')](_0x6dabfb);}};}function respondWithFilteredResult(_0x256e39,_0x28452e){return function(_0x5b4642){if(_0x5b4642){var _0x1806d8=typeof _0x28452e[_0x52e7('0x19')]==='undefined'&&typeof _0x28452e[_0x52e7('0x1a')]===_0x52e7('0x1b');var _0x3c30aa=_0x5b4642[_0x52e7('0x1c')];var _0x251bcd=_0x1806d8?0x0:_0x28452e[_0x52e7('0x19')];var _0x1353a9=_0x1806d8?_0x5b4642[_0x52e7('0x1c')]:_0x28452e['offset']+_0x28452e[_0x52e7('0x1a')];var _0x5b8d9c;if(_0x1353a9>=_0x3c30aa){_0x1353a9=_0x3c30aa;_0x5b8d9c=0xc8;}else{_0x5b8d9c=0xce;}_0x256e39[_0x52e7('0x17')](_0x5b8d9c);return _0x256e39[_0x52e7('0x1d')](_0x52e7('0x1e'),_0x251bcd+'-'+_0x1353a9+'/'+_0x3c30aa)[_0x52e7('0x18')](_0x5b4642);}return null;};}function patchUpdates(_0x54130a){return function(_0x30f956){try{jsonpatch[_0x52e7('0x1f')](_0x30f956,_0x54130a,!![]);}catch(_0xd035d8){return BPromise[_0x52e7('0x20')](_0xd035d8);}return _0x30f956['save']();};}function saveUpdates(_0x39d8bf,_0x5ccb5b){return function(_0x3fb2d8){if(_0x3fb2d8){return _0x3fb2d8['update'](_0x39d8bf)[_0x52e7('0x21')](function(_0x5a7cc9){return _0x5a7cc9;});}return null;};}function removeEntity(_0x31d598,_0x151bb1){return function(_0x5e2765){if(_0x5e2765){return _0x5e2765[_0x52e7('0x22')]()[_0x52e7('0x21')](function(){_0x31d598['status'](0xcc)[_0x52e7('0x23')]();});}};}function handleEntityNotFound(_0x793c40,_0x1930fc){return function(_0x32e9e1){if(!_0x32e9e1){_0x793c40[_0x52e7('0x16')](0x194);}return _0x32e9e1;};}function handleError(_0x5e9871,_0x209cb2){_0x209cb2=_0x209cb2||0x1f4;return function(_0x560976){logger[_0x52e7('0x24')](_0x560976[_0x52e7('0x25')]);if(_0x560976[_0x52e7('0x26')]){delete _0x560976[_0x52e7('0x26')];}_0x5e9871[_0x52e7('0x17')](_0x209cb2)[_0x52e7('0x27')](_0x560976);};}exports[_0x52e7('0x28')]=function(_0xfa80ab,_0x1cd280){var _0x166c79={},_0x5bfbdc={},_0x49703a={'count':0x0,'rows':[]};var _0x2eb040=_[_0x52e7('0x29')](db[_0x52e7('0x2a')]['rawAttributes'],function(_0x108254){return{'name':_0x108254[_0x52e7('0x2b')],'type':_0x108254[_0x52e7('0x2c')]['key']};});_0x5bfbdc[_0x52e7('0x2d')]=_['map'](_0x2eb040,_0x52e7('0x26'));_0x5bfbdc['query']=_[_0x52e7('0x2e')](_0xfa80ab[_0x52e7('0x2f')]);_0x5bfbdc['filters']=_['intersection'](_0x5bfbdc[_0x52e7('0x2d')],_0x5bfbdc[_0x52e7('0x2f')]);_0x166c79[_0x52e7('0x30')]=_[_0x52e7('0x31')](_0x5bfbdc[_0x52e7('0x2d')],qs[_0x52e7('0x32')](_0xfa80ab[_0x52e7('0x2f')][_0x52e7('0x32')]));_0x166c79['attributes']=_0x166c79['attributes']['length']?_0x166c79[_0x52e7('0x30')]:_0x5bfbdc[_0x52e7('0x2d')];if(!_0xfa80ab[_0x52e7('0x2f')][_0x52e7('0x33')]('nolimit')){_0x166c79[_0x52e7('0x1a')]=qs[_0x52e7('0x1a')](_0xfa80ab[_0x52e7('0x2f')][_0x52e7('0x1a')]);_0x166c79[_0x52e7('0x19')]=qs[_0x52e7('0x19')](_0xfa80ab[_0x52e7('0x2f')][_0x52e7('0x19')]);}_0x166c79[_0x52e7('0x34')]=qs[_0x52e7('0x35')](_0xfa80ab[_0x52e7('0x2f')][_0x52e7('0x35')]);_0x166c79[_0x52e7('0x36')]=qs[_0x52e7('0x37')](_['pick'](_0xfa80ab[_0x52e7('0x2f')],_0x5bfbdc['filters']),_0x2eb040);if(_0xfa80ab['query']['filter']){_0x166c79[_0x52e7('0x36')]=_[_0x52e7('0x38')](_0x166c79[_0x52e7('0x36')],{'$or':_[_0x52e7('0x29')](_0x2eb040,function(_0x2fd4bf){if(_0x2fd4bf['type']!==_0x52e7('0x39')){var _0x15c030={};_0x15c030[_0x2fd4bf[_0x52e7('0x26')]]={'$like':'%'+_0xfa80ab[_0x52e7('0x2f')][_0x52e7('0x3a')]+'%'};return _0x15c030;}})});}_0x166c79=_[_0x52e7('0x38')]({},_0x166c79,_0xfa80ab[_0x52e7('0x3b')]);var _0x594fa8={'where':_0x166c79[_0x52e7('0x36')]};return db[_0x52e7('0x2a')][_0x52e7('0x1c')](_0x594fa8)['then'](function(_0x5a9a4d){_0x49703a[_0x52e7('0x1c')]=_0x5a9a4d;if(_0xfa80ab['query'][_0x52e7('0x3c')]){_0x166c79[_0x52e7('0x3d')]=[{'all':!![]}];}return db[_0x52e7('0x2a')][_0x52e7('0x3e')](_0x166c79);})['then'](function(_0x37712c){_0x49703a[_0x52e7('0x3f')]=_0x37712c;return _0x49703a;})[_0x52e7('0x21')](respondWithFilteredResult(_0x1cd280,_0x166c79))[_0x52e7('0x40')](handleError(_0x1cd280,null));};exports['show']=function(_0x567c7f,_0x333d23){var _0x50f430={'raw':!![],'where':{'id':_0x567c7f[_0x52e7('0x41')]['id']}},_0x974412={};_0x974412[_0x52e7('0x2d')]=_[_0x52e7('0x2e')](db[_0x52e7('0x2a')][_0x52e7('0x42')]);_0x974412[_0x52e7('0x2f')]=_[_0x52e7('0x2e')](_0x567c7f['query']);_0x974412[_0x52e7('0x37')]=_[_0x52e7('0x31')](_0x974412[_0x52e7('0x2d')],_0x974412[_0x52e7('0x2f')]);_0x50f430[_0x52e7('0x30')]=_[_0x52e7('0x31')](_0x974412[_0x52e7('0x2d')],qs[_0x52e7('0x32')](_0x567c7f['query'][_0x52e7('0x32')]));_0x50f430[_0x52e7('0x30')]=_0x50f430['attributes'][_0x52e7('0x43')]?_0x50f430[_0x52e7('0x30')]:_0x974412[_0x52e7('0x2d')];if(_0x567c7f[_0x52e7('0x2f')]['includeAll']){_0x50f430[_0x52e7('0x3d')]=[{'all':!![]}];}_0x50f430=_['merge']({},_0x50f430,_0x567c7f[_0x52e7('0x3b')]);return db[_0x52e7('0x2a')]['find'](_0x50f430)[_0x52e7('0x21')](handleEntityNotFound(_0x333d23,null))[_0x52e7('0x21')](respondWithResult(_0x333d23,null))[_0x52e7('0x40')](handleError(_0x333d23,null));};exports[_0x52e7('0x44')]=function(_0x15ee76,_0x25ee95){return db[_0x52e7('0x2a')][_0x52e7('0x44')](_0x15ee76[_0x52e7('0x45')],{})[_0x52e7('0x21')](respondWithResult(_0x25ee95,0xc9))[_0x52e7('0x40')](handleError(_0x25ee95,null));};exports['update']=function(_0x13c3b4,_0x38dd71){if(_0x13c3b4[_0x52e7('0x45')]['id']){delete _0x13c3b4[_0x52e7('0x45')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x13c3b4[_0x52e7('0x41')]['id']}})[_0x52e7('0x21')](handleEntityNotFound(_0x38dd71,null))[_0x52e7('0x21')](saveUpdates(_0x13c3b4[_0x52e7('0x45')],null))[_0x52e7('0x21')](respondWithResult(_0x38dd71,null))[_0x52e7('0x40')](handleError(_0x38dd71,null));};exports[_0x52e7('0x22')]=function(_0x558cf7,_0xb604e3){return db[_0x52e7('0x2a')][_0x52e7('0x46')]({'where':{'id':_0x558cf7[_0x52e7('0x41')]['id']}})[_0x52e7('0x21')](handleEntityNotFound(_0xb604e3,null))[_0x52e7('0x21')](removeEntity(_0xb604e3,null))[_0x52e7('0x40')](handleError(_0xb604e3,null));}; \ No newline at end of file +var _0xf84d=['nolimit','limit','order','sort','filters','pick','filter','merge','where','options','include','findAll','rows','catch','show','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','MailServerOut','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x39db05,_0x3868d0){var _0x3f0e22=function(_0x532c4f){while(--_0x532c4f){_0x39db05['push'](_0x39db05['shift']());}};_0x3f0e22(++_0x3868d0);}(_0xf84d,0xad));var _0xdf84=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0xf84d[_0xc77819];return _0x1c9434;};'use strict';var emlformat=require(_0xdf84('0x0'));var rimraf=require(_0xdf84('0x1'));var zipdir=require(_0xdf84('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf84('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdf84('0x4'));var util=require(_0xdf84('0x5'));var path=require(_0xdf84('0x6'));var sox=require(_0xdf84('0x7'));var csv=require(_0xdf84('0x8'));var ejs=require(_0xdf84('0x9'));var fs=require('fs');var fs_extra=require(_0xdf84('0xa'));var _=require('lodash');var squel=require(_0xdf84('0xb'));var crypto=require(_0xdf84('0xc'));var jsforce=require(_0xdf84('0xd'));var deskjs=require(_0xdf84('0xe'));var toCsv=require(_0xdf84('0x8'));var querystring=require(_0xdf84('0xf'));var Papa=require(_0xdf84('0x10'));var Redis=require(_0xdf84('0x11'));var authService=require(_0xdf84('0x12'));var qs=require(_0xdf84('0x13'));var as=require(_0xdf84('0x14'));var hardwareService=require(_0xdf84('0x15'));var logger=require(_0xdf84('0x16'))(_0xdf84('0x17'));var utils=require(_0xdf84('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xdf84('0x19'));var db=require(_0xdf84('0x1a'))['db'];function respondWithStatusCode(_0x57a711,_0x4d60df){_0x4d60df=_0x4d60df||0xcc;return function(_0x26975b){if(_0x26975b){return _0x57a711[_0xdf84('0x1b')](_0x4d60df);}return _0x57a711[_0xdf84('0x1c')](_0x4d60df)[_0xdf84('0x1d')]();};}function respondWithResult(_0x3d21d0,_0x240fe7){_0x240fe7=_0x240fe7||0xc8;return function(_0x5d6525){if(_0x5d6525){return _0x3d21d0['status'](_0x240fe7)[_0xdf84('0x1e')](_0x5d6525);}};}function respondWithFilteredResult(_0x23156f,_0x2aab6f){return function(_0x153d66){if(_0x153d66){var _0xcc5370=typeof _0x2aab6f['offset']===_0xdf84('0x1f')&&typeof _0x2aab6f['limit']===_0xdf84('0x1f');var _0xee4d62=_0x153d66['count'];var _0x10c5d0=_0xcc5370?0x0:_0x2aab6f[_0xdf84('0x20')];var _0x33afff=_0xcc5370?_0x153d66[_0xdf84('0x21')]:_0x2aab6f['offset']+_0x2aab6f['limit'];var _0x2588ff;if(_0x33afff>=_0xee4d62){_0x33afff=_0xee4d62;_0x2588ff=0xc8;}else{_0x2588ff=0xce;}_0x23156f[_0xdf84('0x1c')](_0x2588ff);return _0x23156f[_0xdf84('0x22')](_0xdf84('0x23'),_0x10c5d0+'-'+_0x33afff+'/'+_0xee4d62)[_0xdf84('0x1e')](_0x153d66);}return null;};}function patchUpdates(_0x56a5b0){return function(_0x13a12d){try{jsonpatch[_0xdf84('0x24')](_0x13a12d,_0x56a5b0,!![]);}catch(_0x2b1360){return BPromise['reject'](_0x2b1360);}return _0x13a12d[_0xdf84('0x25')]();};}function saveUpdates(_0x41f85f,_0x5a377c){return function(_0x22735d){if(_0x22735d){return _0x22735d[_0xdf84('0x26')](_0x41f85f)['then'](function(_0x3b5476){return _0x3b5476;});}return null;};}function removeEntity(_0x3bfd33,_0x44a3b7){return function(_0x300bf6){if(_0x300bf6){return _0x300bf6[_0xdf84('0x27')]()[_0xdf84('0x28')](function(){_0x3bfd33[_0xdf84('0x1c')](0xcc)[_0xdf84('0x1d')]();});}};}function handleEntityNotFound(_0x274442,_0x430caf){return function(_0xab5293){if(!_0xab5293){_0x274442[_0xdf84('0x1b')](0x194);}return _0xab5293;};}function handleError(_0x49b967,_0x50a45d){_0x50a45d=_0x50a45d||0x1f4;return function(_0x3827d5){logger[_0xdf84('0x29')](_0x3827d5[_0xdf84('0x2a')]);if(_0x3827d5[_0xdf84('0x2b')]){delete _0x3827d5[_0xdf84('0x2b')];}_0x49b967[_0xdf84('0x1c')](_0x50a45d)[_0xdf84('0x2c')](_0x3827d5);};}exports[_0xdf84('0x2d')]=function(_0x2ae09b,_0x39877c){var _0x5161c5={},_0x42c53e={},_0x4242f4={'count':0x0,'rows':[]};var _0x5e83d9=_['map'](db[_0xdf84('0x2e')]['rawAttributes'],function(_0x47cdb9){return{'name':_0x47cdb9['fieldName'],'type':_0x47cdb9[_0xdf84('0x2f')][_0xdf84('0x30')]};});_0x42c53e[_0xdf84('0x31')]=_[_0xdf84('0x32')](_0x5e83d9,_0xdf84('0x2b'));_0x42c53e[_0xdf84('0x33')]=_[_0xdf84('0x34')](_0x2ae09b[_0xdf84('0x33')]);_0x42c53e['filters']=_[_0xdf84('0x35')](_0x42c53e[_0xdf84('0x31')],_0x42c53e[_0xdf84('0x33')]);_0x5161c5['attributes']=_[_0xdf84('0x35')](_0x42c53e[_0xdf84('0x31')],qs[_0xdf84('0x36')](_0x2ae09b['query'][_0xdf84('0x36')]));_0x5161c5[_0xdf84('0x37')]=_0x5161c5[_0xdf84('0x37')][_0xdf84('0x38')]?_0x5161c5[_0xdf84('0x37')]:_0x42c53e[_0xdf84('0x31')];if(!_0x2ae09b[_0xdf84('0x33')][_0xdf84('0x39')](_0xdf84('0x3a'))){_0x5161c5[_0xdf84('0x3b')]=qs[_0xdf84('0x3b')](_0x2ae09b[_0xdf84('0x33')][_0xdf84('0x3b')]);_0x5161c5[_0xdf84('0x20')]=qs[_0xdf84('0x20')](_0x2ae09b[_0xdf84('0x33')][_0xdf84('0x20')]);}_0x5161c5[_0xdf84('0x3c')]=qs[_0xdf84('0x3d')](_0x2ae09b[_0xdf84('0x33')]['sort']);_0x5161c5['where']=qs[_0xdf84('0x3e')](_[_0xdf84('0x3f')](_0x2ae09b[_0xdf84('0x33')],_0x42c53e[_0xdf84('0x3e')]),_0x5e83d9);if(_0x2ae09b[_0xdf84('0x33')][_0xdf84('0x40')]){_0x5161c5['where']=_[_0xdf84('0x41')](_0x5161c5[_0xdf84('0x42')],{'$or':_[_0xdf84('0x32')](_0x5e83d9,function(_0xe051ae){if(_0xe051ae[_0xdf84('0x2f')]!=='VIRTUAL'){var _0x5260e3={};_0x5260e3[_0xe051ae[_0xdf84('0x2b')]]={'$like':'%'+_0x2ae09b[_0xdf84('0x33')][_0xdf84('0x40')]+'%'};return _0x5260e3;}})});}_0x5161c5=_[_0xdf84('0x41')]({},_0x5161c5,_0x2ae09b[_0xdf84('0x43')]);var _0x2a9fcd={'where':_0x5161c5[_0xdf84('0x42')]};return db['MailServerOut'][_0xdf84('0x21')](_0x2a9fcd)[_0xdf84('0x28')](function(_0x483c9b){_0x4242f4[_0xdf84('0x21')]=_0x483c9b;if(_0x2ae09b['query']['includeAll']){_0x5161c5[_0xdf84('0x44')]=[{'all':!![]}];}return db['MailServerOut'][_0xdf84('0x45')](_0x5161c5);})[_0xdf84('0x28')](function(_0x4b7418){_0x4242f4[_0xdf84('0x46')]=_0x4b7418;return _0x4242f4;})[_0xdf84('0x28')](respondWithFilteredResult(_0x39877c,_0x5161c5))[_0xdf84('0x47')](handleError(_0x39877c,null));};exports[_0xdf84('0x48')]=function(_0x3df6b8,_0xa9fbd1){var _0x5b1131={'raw':!![],'where':{'id':_0x3df6b8['params']['id']}},_0x35b491={};_0x35b491[_0xdf84('0x31')]=_['keys'](db['MailServerOut'][_0xdf84('0x49')]);_0x35b491[_0xdf84('0x33')]=_[_0xdf84('0x34')](_0x3df6b8[_0xdf84('0x33')]);_0x35b491[_0xdf84('0x3e')]=_[_0xdf84('0x35')](_0x35b491['model'],_0x35b491['query']);_0x5b1131[_0xdf84('0x37')]=_[_0xdf84('0x35')](_0x35b491[_0xdf84('0x31')],qs[_0xdf84('0x36')](_0x3df6b8[_0xdf84('0x33')]['fields']));_0x5b1131[_0xdf84('0x37')]=_0x5b1131['attributes']['length']?_0x5b1131[_0xdf84('0x37')]:_0x35b491[_0xdf84('0x31')];if(_0x3df6b8[_0xdf84('0x33')]['includeAll']){_0x5b1131[_0xdf84('0x44')]=[{'all':!![]}];}_0x5b1131=_[_0xdf84('0x41')]({},_0x5b1131,_0x3df6b8[_0xdf84('0x43')]);return db['MailServerOut'][_0xdf84('0x4a')](_0x5b1131)['then'](handleEntityNotFound(_0xa9fbd1,null))['then'](respondWithResult(_0xa9fbd1,null))[_0xdf84('0x47')](handleError(_0xa9fbd1,null));};exports[_0xdf84('0x4b')]=function(_0x35a34f,_0x10697e){return db['MailServerOut'][_0xdf84('0x4b')](_0x35a34f[_0xdf84('0x4c')],{})[_0xdf84('0x28')](respondWithResult(_0x10697e,0xc9))[_0xdf84('0x47')](handleError(_0x10697e,null));};exports['update']=function(_0x25b5e9,_0xe5d34b){if(_0x25b5e9[_0xdf84('0x4c')]['id']){delete _0x25b5e9[_0xdf84('0x4c')]['id'];}return db[_0xdf84('0x2e')][_0xdf84('0x4a')]({'where':{'id':_0x25b5e9['params']['id']}})[_0xdf84('0x28')](handleEntityNotFound(_0xe5d34b,null))[_0xdf84('0x28')](saveUpdates(_0x25b5e9['body'],null))[_0xdf84('0x28')](respondWithResult(_0xe5d34b,null))[_0xdf84('0x47')](handleError(_0xe5d34b,null));};exports[_0xdf84('0x27')]=function(_0x35d422,_0x35dfd0){return db[_0xdf84('0x2e')][_0xdf84('0x4a')]({'where':{'id':_0x35d422['params']['id']}})['then'](handleEntityNotFound(_0x35dfd0,null))['then'](removeEntity(_0x35dfd0,null))[_0xdf84('0x47')](handleError(_0x35dfd0,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 54eb8f4..bc58d64 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 _0xed83=['exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','path','../../config/environment','./mailServerOut.attributes'];(function(_0x1d3275,_0x402bbf){var _0x356dca=function(_0x3bed08){while(--_0x3bed08){_0x1d3275['push'](_0x1d3275['shift']());}};_0x356dca(++_0x402bbf);}(_0xed83,0x9e));var _0x3ed8=function(_0x113de8,_0x12aa03){_0x113de8=_0x113de8-0x0;var _0xd3c67a=_0xed83[_0x113de8];return _0xd3c67a;};'use strict';var _=require(_0x3ed8('0x0'));var util=require(_0x3ed8('0x1'));var logger=require(_0x3ed8('0x2'))(_0x3ed8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ed8('0x4'));var rimraf=require('rimraf');var config=require(_0x3ed8('0x5'));var attributes=require(_0x3ed8('0x6'));module[_0x3ed8('0x7')]=function(_0x49c961,_0x5e4ac6){return _0x49c961[_0x3ed8('0x8')](_0x3ed8('0x9'),attributes,{'tableName':_0x3ed8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe693=['mail_servers_out','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut'];(function(_0x5b9b24,_0x23f5f3){var _0x22d294=function(_0x4728ec){while(--_0x4728ec){_0x5b9b24['push'](_0x5b9b24['shift']());}};_0x22d294(++_0x23f5f3);}(_0xe693,0x1e5));var _0x3e69=function(_0x409682,_0x370090){_0x409682=_0x409682-0x0;var _0x1ee901=_0xe693[_0x409682];return _0x1ee901;};'use strict';var _=require(_0x3e69('0x0'));var util=require('util');var logger=require(_0x3e69('0x1'))(_0x3e69('0x2'));var moment=require('moment');var BPromise=require(_0x3e69('0x3'));var rp=require(_0x3e69('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e69('0x5'));var config=require(_0x3e69('0x6'));var attributes=require(_0x3e69('0x7'));module['exports']=function(_0x5acae8,_0x5c2b5c){return _0x5acae8[_0x3e69('0x8')](_0x3e69('0x9'),attributes,{'tableName':_0x3e69('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 234ab37..4c29932 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 _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x188390,_0x3744e0){var _0x5b7dfd=function(_0x13516b){while(--_0x13516b){_0x188390['push'](_0x188390['shift']());}};_0x5b7dfd(++_0x3744e0);}(_0x1261,0x144));var _0x1126=function(_0x26a74d,_0x37ecfc){_0x26a74d=_0x26a74d-0x0;var _0xcbb1a3=_0x1261[_0x26a74d];return _0xcbb1a3;};'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')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x70bda9,_0x284338){var _0x4bc496=function(_0x44fdec){while(--_0x44fdec){_0x70bda9['push'](_0x70bda9['shift']());}};_0x4bc496(++_0x284338);}(_0x5f2f,0x73));var _0xf5f2=function(_0x408da3,_0xeb3267){_0x408da3=_0x408da3-0x0;var _0x562178=_0x5f2f[_0x408da3];return _0x562178;};'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')]('MailServerOut,\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/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 02bc299..5df16d5 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 _0xbca9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0xbca9,0x16c));var _0x9bca=function(_0x4a3f10,_0x3373f1){_0x4a3f10=_0x4a3f10-0x0;var _0x1bcf08=_0xbca9[_0x4a3f10];return _0x1bcf08;};'use strict';var multer=require(_0x9bca('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9bca('0x1'));var express=require(_0x9bca('0x2'));var router=express[_0x9bca('0x3')]();var fs_extra=require(_0x9bca('0x4'));var auth=require(_0x9bca('0x5'));var interaction=require(_0x9bca('0x6'));var config=require(_0x9bca('0x7'));var controller=require(_0x9bca('0x8'));router[_0x9bca('0x9')]('/',auth[_0x9bca('0xa')](),controller[_0x9bca('0xb')]);router[_0x9bca('0x9')](_0x9bca('0xc'),auth[_0x9bca('0xa')](),controller[_0x9bca('0xd')]);router['get'](_0x9bca('0xe'),auth['isAuthenticated'](),controller[_0x9bca('0xf')]);router[_0x9bca('0x10')]('/',auth[_0x9bca('0xa')](),controller[_0x9bca('0x11')]);router[_0x9bca('0x12')](_0x9bca('0xe'),auth['isAuthenticated'](),controller[_0x9bca('0x13')]);router[_0x9bca('0x14')]('/:id',auth[_0x9bca('0xa')](),controller[_0x9bca('0x15')]);module[_0x9bca('0x16')]=router; \ No newline at end of file +var _0xdecf=['../../config/environment','./mailSubstatus.controller','get','/describe','describe','isAuthenticated','show','post','put','update','delete','/:id','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xdecf,0x14d));var _0xfdec=function(_0x45d0ca,_0x12fb74){_0x45d0ca=_0x45d0ca-0x0;var _0x5c68bb=_0xdecf[_0x45d0ca];return _0x5c68bb;};'use strict';var multer=require('multer');var util=require(_0xfdec('0x0'));var path=require(_0xfdec('0x1'));var timeout=require(_0xfdec('0x2'));var express=require(_0xfdec('0x3'));var router=express[_0xfdec('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfdec('0x5'));var interaction=require(_0xfdec('0x6'));var config=require(_0xfdec('0x7'));var controller=require(_0xfdec('0x8'));router[_0xfdec('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfdec('0x9')](_0xfdec('0xa'),auth['isAuthenticated'](),controller[_0xfdec('0xb')]);router[_0xfdec('0x9')]('/:id',auth[_0xfdec('0xc')](),controller[_0xfdec('0xd')]);router[_0xfdec('0xe')]('/',auth[_0xfdec('0xc')](),controller['create']);router[_0xfdec('0xf')]('/:id',auth[_0xfdec('0xc')](),controller[_0xfdec('0x10')]);router[_0xfdec('0x11')](_0xfdec('0x12'),auth[_0xfdec('0xc')](),controller['destroy']);module[_0xfdec('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index bf111f1..2f0aec2 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 _0xafdd=['STRING','name','sequelize','exports'];(function(_0x24223e,_0xe58089){var _0x3554e5=function(_0x1fb3ef){while(--_0x1fb3ef){_0x24223e['push'](_0x24223e['shift']());}};_0x3554e5(++_0xe58089);}(_0xafdd,0x19a));var _0xdafd=function(_0x129c5c,_0x411fd8){_0x129c5c=_0x129c5c-0x0;var _0x55b625=_0xafdd[_0x129c5c];return _0x55b625;};'use strict';var Sequelize=require(_0xdafd('0x0'));module[_0xdafd('0x1')]={'name':{'type':Sequelize[_0xdafd('0x2')],'unique':_0xdafd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdafd('0x2')]}}; \ No newline at end of file +var _0x444e=['sequelize','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x444e,0xe8));var _0xe444=function(_0x291893,_0x3cab37){_0x291893=_0x291893-0x0;var _0x290d4d=_0x444e[_0x291893];return _0x290d4d;};'use strict';var Sequelize=require(_0xe444('0x0'));module['exports']={'name':{'type':Sequelize[_0xe444('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe444('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index a0b7726..b5c62ef 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 _0x219b=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','name','index','map','MailSubstatus','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x55e1e2,_0x3a35fc){var _0x5d51c8=function(_0x1e46b3){while(--_0x1e46b3){_0x55e1e2['push'](_0x55e1e2['shift']());}};_0x5d51c8(++_0x3a35fc);}(_0x219b,0x15c));var _0xb219=function(_0x20f09a,_0x1761f3){_0x20f09a=_0x20f09a-0x0;var _0x51bc17=_0x219b[_0x20f09a];return _0x51bc17;};'use strict';var emlformat=require(_0xb219('0x0'));var rimraf=require(_0xb219('0x1'));var zipdir=require(_0xb219('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb219('0x3'));var moment=require(_0xb219('0x4'));var BPromise=require(_0xb219('0x5'));var Mustache=require('mustache');var util=require(_0xb219('0x6'));var path=require(_0xb219('0x7'));var sox=require(_0xb219('0x8'));var csv=require(_0xb219('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb219('0xa'));var _=require(_0xb219('0xb'));var squel=require('squel');var crypto=require(_0xb219('0xc'));var jsforce=require(_0xb219('0xd'));var deskjs=require(_0xb219('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb219('0xf'));var Papa=require('papaparse');var Redis=require(_0xb219('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb219('0x11'));var as=require(_0xb219('0x12'));var hardwareService=require(_0xb219('0x13'));var logger=require('../../config/logger')(_0xb219('0x14'));var utils=require(_0xb219('0x15'));var config=require(_0xb219('0x16'));var licenseUtil=require(_0xb219('0x17'));var db=require(_0xb219('0x18'))['db'];function respondWithStatusCode(_0x367836,_0x2bdcc3){_0x2bdcc3=_0x2bdcc3||0xcc;return function(_0x4a188e){if(_0x4a188e){return _0x367836[_0xb219('0x19')](_0x2bdcc3);}return _0x367836[_0xb219('0x1a')](_0x2bdcc3)[_0xb219('0x1b')]();};}function respondWithResult(_0x1885d8,_0x5f180f){_0x5f180f=_0x5f180f||0xc8;return function(_0x59011b){if(_0x59011b){return _0x1885d8[_0xb219('0x1a')](_0x5f180f)[_0xb219('0x1c')](_0x59011b);}};}function respondWithFilteredResult(_0x5dcc43,_0x10daa3){return function(_0x31870c){if(_0x31870c){var _0x42fc5c=typeof _0x10daa3[_0xb219('0x1d')]===_0xb219('0x1e')&&typeof _0x10daa3[_0xb219('0x1f')]===_0xb219('0x1e');var _0x5c4237=_0x31870c[_0xb219('0x20')];var _0x1b9f5d=_0x42fc5c?0x0:_0x10daa3[_0xb219('0x1d')];var _0x222181=_0x42fc5c?_0x31870c[_0xb219('0x20')]:_0x10daa3[_0xb219('0x1d')]+_0x10daa3[_0xb219('0x1f')];var _0x143018;if(_0x222181>=_0x5c4237){_0x222181=_0x5c4237;_0x143018=0xc8;}else{_0x143018=0xce;}_0x5dcc43[_0xb219('0x1a')](_0x143018);return _0x5dcc43['set'](_0xb219('0x21'),_0x1b9f5d+'-'+_0x222181+'/'+_0x5c4237)[_0xb219('0x1c')](_0x31870c);}return null;};}function patchUpdates(_0x3003cb){return function(_0x5a302f){try{jsonpatch['apply'](_0x5a302f,_0x3003cb,!![]);}catch(_0x5de67e){return BPromise[_0xb219('0x22')](_0x5de67e);}return _0x5a302f[_0xb219('0x23')]();};}function saveUpdates(_0x40f6e2,_0x2addc1){return function(_0x148ade){if(_0x148ade){return _0x148ade[_0xb219('0x24')](_0x40f6e2)[_0xb219('0x25')](function(_0x42b744){return _0x42b744;});}return null;};}function removeEntity(_0x25d1ef,_0x157294){return function(_0x110875){if(_0x110875){return _0x110875[_0xb219('0x26')]()[_0xb219('0x25')](function(){_0x25d1ef[_0xb219('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a420b,_0x44c652){return function(_0x1ae215){if(!_0x1ae215){_0x4a420b[_0xb219('0x19')](0x194);}return _0x1ae215;};}function handleError(_0x47d05c,_0x48c1d6){_0x48c1d6=_0x48c1d6||0x1f4;return function(_0x2d2832){logger[_0xb219('0x27')](_0x2d2832['stack']);if(_0x2d2832[_0xb219('0x28')]){delete _0x2d2832['name'];}_0x47d05c['status'](_0x48c1d6)['send'](_0x2d2832);};}exports[_0xb219('0x29')]=function(_0x1d2b2c,_0x560c38){var _0x56b720={},_0x5889a7={},_0x1fb5af={'count':0x0,'rows':[]};var _0x42b06d=_[_0xb219('0x2a')](db[_0xb219('0x2b')][_0xb219('0x2c')],function(_0xb0a6a0){return{'name':_0xb0a6a0['fieldName'],'type':_0xb0a6a0[_0xb219('0x2d')][_0xb219('0x2e')]};});_0x5889a7[_0xb219('0x2f')]=_[_0xb219('0x2a')](_0x42b06d,_0xb219('0x28'));_0x5889a7['query']=_[_0xb219('0x30')](_0x1d2b2c[_0xb219('0x31')]);_0x5889a7[_0xb219('0x32')]=_[_0xb219('0x33')](_0x5889a7[_0xb219('0x2f')],_0x5889a7[_0xb219('0x31')]);_0x56b720[_0xb219('0x34')]=_['intersection'](_0x5889a7[_0xb219('0x2f')],qs[_0xb219('0x35')](_0x1d2b2c[_0xb219('0x31')]['fields']));_0x56b720[_0xb219('0x34')]=_0x56b720[_0xb219('0x34')]['length']?_0x56b720[_0xb219('0x34')]:_0x5889a7[_0xb219('0x2f')];if(!_0x1d2b2c[_0xb219('0x31')][_0xb219('0x36')]('nolimit')){_0x56b720[_0xb219('0x1f')]=qs[_0xb219('0x1f')](_0x1d2b2c[_0xb219('0x31')]['limit']);_0x56b720[_0xb219('0x1d')]=qs[_0xb219('0x1d')](_0x1d2b2c[_0xb219('0x31')][_0xb219('0x1d')]);}_0x56b720[_0xb219('0x37')]=qs[_0xb219('0x38')](_0x1d2b2c[_0xb219('0x31')][_0xb219('0x38')]);_0x56b720[_0xb219('0x39')]=qs[_0xb219('0x32')](_[_0xb219('0x3a')](_0x1d2b2c['query'],_0x5889a7[_0xb219('0x32')]),_0x42b06d);if(_0x1d2b2c[_0xb219('0x31')][_0xb219('0x3b')]){_0x56b720[_0xb219('0x39')]=_[_0xb219('0x3c')](_0x56b720['where'],{'$or':_['map'](_0x42b06d,function(_0x44691d){if(_0x44691d[_0xb219('0x2d')]!=='VIRTUAL'){var _0x19ea86={};_0x19ea86[_0x44691d[_0xb219('0x28')]]={'$like':'%'+_0x1d2b2c[_0xb219('0x31')]['filter']+'%'};return _0x19ea86;}})});}_0x56b720=_['merge']({},_0x56b720,_0x1d2b2c[_0xb219('0x3d')]);var _0x153f6e={'where':_0x56b720['where']};return db[_0xb219('0x2b')][_0xb219('0x20')](_0x153f6e)['then'](function(_0x3a7084){_0x1fb5af[_0xb219('0x20')]=_0x3a7084;if(_0x1d2b2c[_0xb219('0x31')][_0xb219('0x3e')]){_0x56b720[_0xb219('0x3f')]=[{'all':!![]}];}return db[_0xb219('0x2b')][_0xb219('0x40')](_0x56b720);})['then'](function(_0x578fba){_0x1fb5af[_0xb219('0x41')]=_0x578fba;return _0x1fb5af;})[_0xb219('0x25')](respondWithFilteredResult(_0x560c38,_0x56b720))[_0xb219('0x42')](handleError(_0x560c38,null));};exports[_0xb219('0x43')]=function(_0x8d1a98,_0x3edd09){var _0x398ad0={'raw':!![],'where':{'id':_0x8d1a98[_0xb219('0x44')]['id']}},_0x3cecef={};_0x3cecef['model']=_['keys'](db['MailSubstatus'][_0xb219('0x2c')]);_0x3cecef['query']=_[_0xb219('0x30')](_0x8d1a98[_0xb219('0x31')]);_0x3cecef['filters']=_['intersection'](_0x3cecef[_0xb219('0x2f')],_0x3cecef[_0xb219('0x31')]);_0x398ad0[_0xb219('0x34')]=_[_0xb219('0x33')](_0x3cecef['model'],qs[_0xb219('0x35')](_0x8d1a98[_0xb219('0x31')][_0xb219('0x35')]));_0x398ad0[_0xb219('0x34')]=_0x398ad0[_0xb219('0x34')]['length']?_0x398ad0['attributes']:_0x3cecef[_0xb219('0x2f')];if(_0x8d1a98[_0xb219('0x31')][_0xb219('0x3e')]){_0x398ad0[_0xb219('0x3f')]=[{'all':!![]}];}_0x398ad0=_[_0xb219('0x3c')]({},_0x398ad0,_0x8d1a98[_0xb219('0x3d')]);return db[_0xb219('0x2b')][_0xb219('0x45')](_0x398ad0)[_0xb219('0x25')](handleEntityNotFound(_0x3edd09,null))[_0xb219('0x25')](respondWithResult(_0x3edd09,null))[_0xb219('0x42')](handleError(_0x3edd09,null));};exports[_0xb219('0x46')]=function(_0x4ba87b,_0x102743){return db[_0xb219('0x2b')][_0xb219('0x46')](_0x4ba87b[_0xb219('0x47')],{})[_0xb219('0x25')](respondWithResult(_0x102743,0xc9))[_0xb219('0x42')](handleError(_0x102743,null));};exports['update']=function(_0x443d1a,_0x2e0fbc){if(_0x443d1a[_0xb219('0x47')]['id']){delete _0x443d1a[_0xb219('0x47')]['id'];}return db['MailSubstatus'][_0xb219('0x45')]({'where':{'id':_0x443d1a['params']['id']}})[_0xb219('0x25')](handleEntityNotFound(_0x2e0fbc,null))[_0xb219('0x25')](saveUpdates(_0x443d1a['body'],null))[_0xb219('0x25')](respondWithResult(_0x2e0fbc,null))[_0xb219('0x42')](handleError(_0x2e0fbc,null));};exports['destroy']=function(_0x3f58d2,_0x30feb0){return db['MailSubstatus'][_0xb219('0x45')]({'where':{'id':_0x3f58d2[_0xb219('0x44')]['id']}})[_0xb219('0x25')](handleEntityNotFound(_0x30feb0,null))[_0xb219('0x25')](removeEntity(_0x30feb0,null))[_0xb219('0x42')](handleError(_0x30feb0,null));};exports[_0xb219('0x48')]=function(_0x4f84d0,_0x217010){return db[_0xb219('0x2b')][_0xb219('0x48')]()['then'](respondWithResult(_0x217010,null))[_0xb219('0x42')](handleError(_0x217010,null));}; \ No newline at end of file +var _0xc404=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','end','stack','send','MailSubstatus','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','length','nolimit','sort','filters','filter','where','VIRTUAL','name','merge','options','includeAll','include','findAll','rows','catch','params','fields','find','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0xc404,0xdb));var _0x4c40=function(_0x94b425,_0x27854c){_0x94b425=_0x94b425-0x0;var _0x365a2d=_0xc404[_0x94b425];return _0x365a2d;};'use strict';var emlformat=require(_0x4c40('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c40('0x1'));var jsonpatch=require(_0x4c40('0x2'));var rp=require(_0x4c40('0x3'));var moment=require(_0x4c40('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4c40('0x5'));var util=require('util');var path=require(_0x4c40('0x6'));var sox=require(_0x4c40('0x7'));var csv=require(_0x4c40('0x8'));var ejs=require(_0x4c40('0x9'));var fs=require('fs');var fs_extra=require(_0x4c40('0xa'));var _=require(_0x4c40('0xb'));var squel=require(_0x4c40('0xc'));var crypto=require(_0x4c40('0xd'));var jsforce=require(_0x4c40('0xe'));var deskjs=require(_0x4c40('0xf'));var toCsv=require(_0x4c40('0x8'));var querystring=require('querystring');var Papa=require(_0x4c40('0x10'));var Redis=require('ioredis');var authService=require(_0x4c40('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4c40('0x12'));var hardwareService=require(_0x4c40('0x13'));var logger=require(_0x4c40('0x14'))(_0x4c40('0x15'));var utils=require(_0x4c40('0x16'));var config=require(_0x4c40('0x17'));var licenseUtil=require(_0x4c40('0x18'));var db=require(_0x4c40('0x19'))['db'];function respondWithStatusCode(_0x2c616c,_0x32b072){_0x32b072=_0x32b072||0xcc;return function(_0x3bb4b4){if(_0x3bb4b4){return _0x2c616c[_0x4c40('0x1a')](_0x32b072);}return _0x2c616c[_0x4c40('0x1b')](_0x32b072)['end']();};}function respondWithResult(_0x52541a,_0x7e9ee3){_0x7e9ee3=_0x7e9ee3||0xc8;return function(_0x91b608){if(_0x91b608){return _0x52541a[_0x4c40('0x1b')](_0x7e9ee3)[_0x4c40('0x1c')](_0x91b608);}};}function respondWithFilteredResult(_0x377cad,_0xc3e00a){return function(_0xe706fd){if(_0xe706fd){var _0x2b2d77=typeof _0xc3e00a[_0x4c40('0x1d')]==='undefined'&&typeof _0xc3e00a['limit']===_0x4c40('0x1e');var _0x4489e4=_0xe706fd[_0x4c40('0x1f')];var _0x46a0bc=_0x2b2d77?0x0:_0xc3e00a['offset'];var _0x5db96f=_0x2b2d77?_0xe706fd[_0x4c40('0x1f')]:_0xc3e00a[_0x4c40('0x1d')]+_0xc3e00a[_0x4c40('0x20')];var _0x785d54;if(_0x5db96f>=_0x4489e4){_0x5db96f=_0x4489e4;_0x785d54=0xc8;}else{_0x785d54=0xce;}_0x377cad[_0x4c40('0x1b')](_0x785d54);return _0x377cad[_0x4c40('0x21')](_0x4c40('0x22'),_0x46a0bc+'-'+_0x5db96f+'/'+_0x4489e4)[_0x4c40('0x1c')](_0xe706fd);}return null;};}function patchUpdates(_0x4f4a76){return function(_0x14dc02){try{jsonpatch['apply'](_0x14dc02,_0x4f4a76,!![]);}catch(_0x368f66){return BPromise[_0x4c40('0x23')](_0x368f66);}return _0x14dc02[_0x4c40('0x24')]();};}function saveUpdates(_0x25ab0d,_0x383638){return function(_0x36ed58){if(_0x36ed58){return _0x36ed58['update'](_0x25ab0d)[_0x4c40('0x25')](function(_0x16cf3d){return _0x16cf3d;});}return null;};}function removeEntity(_0x559322,_0x3fb525){return function(_0x7eb729){if(_0x7eb729){return _0x7eb729[_0x4c40('0x26')]()[_0x4c40('0x25')](function(){_0x559322[_0x4c40('0x1b')](0xcc)[_0x4c40('0x27')]();});}};}function handleEntityNotFound(_0x54113b,_0x25dcc1){return function(_0x5463fc){if(!_0x5463fc){_0x54113b[_0x4c40('0x1a')](0x194);}return _0x5463fc;};}function handleError(_0x561a70,_0x1be75b){_0x1be75b=_0x1be75b||0x1f4;return function(_0x28b1ff){logger['error'](_0x28b1ff[_0x4c40('0x28')]);if(_0x28b1ff['name']){delete _0x28b1ff['name'];}_0x561a70[_0x4c40('0x1b')](_0x1be75b)[_0x4c40('0x29')](_0x28b1ff);};}exports['index']=function(_0x2f10b7,_0x5a3e59){var _0x52654b={},_0x262d9a={},_0x344883={'count':0x0,'rows':[]};var _0x12330f=_['map'](db[_0x4c40('0x2a')][_0x4c40('0x2b')],function(_0xa82fa3){return{'name':_0xa82fa3[_0x4c40('0x2c')],'type':_0xa82fa3[_0x4c40('0x2d')][_0x4c40('0x2e')]};});_0x262d9a[_0x4c40('0x2f')]=_[_0x4c40('0x30')](_0x12330f,'name');_0x262d9a[_0x4c40('0x31')]=_[_0x4c40('0x32')](_0x2f10b7['query']);_0x262d9a['filters']=_[_0x4c40('0x33')](_0x262d9a[_0x4c40('0x2f')],_0x262d9a[_0x4c40('0x31')]);_0x52654b['attributes']=_[_0x4c40('0x33')](_0x262d9a[_0x4c40('0x2f')],qs['fields'](_0x2f10b7[_0x4c40('0x31')]['fields']));_0x52654b[_0x4c40('0x34')]=_0x52654b[_0x4c40('0x34')][_0x4c40('0x35')]?_0x52654b[_0x4c40('0x34')]:_0x262d9a[_0x4c40('0x2f')];if(!_0x2f10b7[_0x4c40('0x31')]['hasOwnProperty'](_0x4c40('0x36'))){_0x52654b['limit']=qs['limit'](_0x2f10b7['query'][_0x4c40('0x20')]);_0x52654b[_0x4c40('0x1d')]=qs[_0x4c40('0x1d')](_0x2f10b7[_0x4c40('0x31')][_0x4c40('0x1d')]);}_0x52654b['order']=qs[_0x4c40('0x37')](_0x2f10b7[_0x4c40('0x31')][_0x4c40('0x37')]);_0x52654b['where']=qs[_0x4c40('0x38')](_['pick'](_0x2f10b7['query'],_0x262d9a[_0x4c40('0x38')]),_0x12330f);if(_0x2f10b7['query'][_0x4c40('0x39')]){_0x52654b['where']=_['merge'](_0x52654b[_0x4c40('0x3a')],{'$or':_[_0x4c40('0x30')](_0x12330f,function(_0x1a7286){if(_0x1a7286[_0x4c40('0x2d')]!==_0x4c40('0x3b')){var _0x444289={};_0x444289[_0x1a7286[_0x4c40('0x3c')]]={'$like':'%'+_0x2f10b7[_0x4c40('0x31')][_0x4c40('0x39')]+'%'};return _0x444289;}})});}_0x52654b=_[_0x4c40('0x3d')]({},_0x52654b,_0x2f10b7[_0x4c40('0x3e')]);var _0xc6558b={'where':_0x52654b['where']};return db['MailSubstatus'][_0x4c40('0x1f')](_0xc6558b)[_0x4c40('0x25')](function(_0x2eae58){_0x344883[_0x4c40('0x1f')]=_0x2eae58;if(_0x2f10b7['query'][_0x4c40('0x3f')]){_0x52654b[_0x4c40('0x40')]=[{'all':!![]}];}return db[_0x4c40('0x2a')][_0x4c40('0x41')](_0x52654b);})[_0x4c40('0x25')](function(_0x43e693){_0x344883[_0x4c40('0x42')]=_0x43e693;return _0x344883;})[_0x4c40('0x25')](respondWithFilteredResult(_0x5a3e59,_0x52654b))[_0x4c40('0x43')](handleError(_0x5a3e59,null));};exports['show']=function(_0x5ca9ea,_0x41f6ff){var _0x510438={'raw':!![],'where':{'id':_0x5ca9ea[_0x4c40('0x44')]['id']}},_0x466784={};_0x466784[_0x4c40('0x2f')]=_[_0x4c40('0x32')](db[_0x4c40('0x2a')][_0x4c40('0x2b')]);_0x466784['query']=_[_0x4c40('0x32')](_0x5ca9ea[_0x4c40('0x31')]);_0x466784['filters']=_[_0x4c40('0x33')](_0x466784[_0x4c40('0x2f')],_0x466784[_0x4c40('0x31')]);_0x510438['attributes']=_[_0x4c40('0x33')](_0x466784[_0x4c40('0x2f')],qs[_0x4c40('0x45')](_0x5ca9ea[_0x4c40('0x31')][_0x4c40('0x45')]));_0x510438['attributes']=_0x510438[_0x4c40('0x34')][_0x4c40('0x35')]?_0x510438[_0x4c40('0x34')]:_0x466784[_0x4c40('0x2f')];if(_0x5ca9ea['query'][_0x4c40('0x3f')]){_0x510438[_0x4c40('0x40')]=[{'all':!![]}];}_0x510438=_['merge']({},_0x510438,_0x5ca9ea['options']);return db[_0x4c40('0x2a')][_0x4c40('0x46')](_0x510438)[_0x4c40('0x25')](handleEntityNotFound(_0x41f6ff,null))[_0x4c40('0x25')](respondWithResult(_0x41f6ff,null))[_0x4c40('0x43')](handleError(_0x41f6ff,null));};exports['create']=function(_0x2fd2c1,_0x26b3e2){return db[_0x4c40('0x2a')][_0x4c40('0x47')](_0x2fd2c1['body'],{})[_0x4c40('0x25')](respondWithResult(_0x26b3e2,0xc9))[_0x4c40('0x43')](handleError(_0x26b3e2,null));};exports[_0x4c40('0x48')]=function(_0x973f08,_0x5cd708){if(_0x973f08[_0x4c40('0x49')]['id']){delete _0x973f08[_0x4c40('0x49')]['id'];}return db[_0x4c40('0x2a')][_0x4c40('0x46')]({'where':{'id':_0x973f08['params']['id']}})[_0x4c40('0x25')](handleEntityNotFound(_0x5cd708,null))[_0x4c40('0x25')](saveUpdates(_0x973f08[_0x4c40('0x49')],null))[_0x4c40('0x25')](respondWithResult(_0x5cd708,null))[_0x4c40('0x43')](handleError(_0x5cd708,null));};exports[_0x4c40('0x26')]=function(_0x229376,_0x206caa){return db['MailSubstatus'][_0x4c40('0x46')]({'where':{'id':_0x229376[_0x4c40('0x44')]['id']}})[_0x4c40('0x25')](handleEntityNotFound(_0x206caa,null))[_0x4c40('0x25')](removeEntity(_0x206caa,null))[_0x4c40('0x43')](handleError(_0x206caa,null));};exports[_0x4c40('0x4a')]=function(_0x432e34,_0x218b32){return db[_0x4c40('0x2a')][_0x4c40('0x4a')]()[_0x4c40('0x25')](respondWithResult(_0x218b32,null))[_0x4c40('0x43')](handleError(_0x218b32,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 928aef1..d4b61ec 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 _0x6224=['MailSubstatus','update','emit','../../mysqldb'];(function(_0x345e4c,_0x3e73ba){var _0x40c41c=function(_0x23dfe0){while(--_0x23dfe0){_0x345e4c['push'](_0x345e4c['shift']());}};_0x40c41c(++_0x3e73ba);}(_0x6224,0x1a3));var _0x4622=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x6224[_0x1b349a];return _0x5d1f7c;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x4622('0x0'))['db'][_0x4622('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x4622('0x2')};function emitEvent(_0x1566f0){return function(_0x4b0788,_0x1b4db9,_0x2cf5af){MailSubstatusEvents[_0x4622('0x3')](_0x1566f0+':'+_0x4b0788['id'],_0x4b0788);MailSubstatusEvents['emit'](_0x1566f0,_0x4b0788);_0x2cf5af(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x8583=['update','emit','hasOwnProperty','hook','exports','MailSubstatus','setMaxListeners'];(function(_0x4e2d7c,_0x3a1f0b){var _0x557208=function(_0x1f5e0f){while(--_0x1f5e0f){_0x4e2d7c['push'](_0x4e2d7c['shift']());}};_0x557208(++_0x3a1f0b);}(_0x8583,0x101));var _0x3858=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8583[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db'][_0x3858('0x0')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x3858('0x1')](0x0);var events={'afterUpdate':_0x3858('0x2')};function emitEvent(_0x7aec72){return function(_0x563e02,_0x4f49ea,_0x42865f){MailSubstatusEvents[_0x3858('0x3')](_0x7aec72+':'+_0x563e02['id'],_0x563e02);MailSubstatusEvents[_0x3858('0x3')](_0x7aec72,_0x563e02);_0x42865f(null);};}for(var e in events){if(events[_0x3858('0x4')](e)){var event=events[e];MailSubstatus[_0x3858('0x5')](e,emitEvent(event));}}module[_0x3858('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index be5b588..0f90e5e 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 _0xf6ef=['./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','then'];(function(_0x10e2f8,_0x352c2c){var _0x1796ff=function(_0x39b339){while(--_0x39b339){_0x10e2f8['push'](_0x10e2f8['shift']());}};_0x1796ff(++_0x352c2c);}(_0xf6ef,0x18c));var _0xff6e=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0xf6ef[_0x10291b];return _0x1d5fbe;};'use strict';var attributes=require(_0xff6e('0x0'));module[_0xff6e('0x1')]=function(_0x16c17c){var _0x3d9ffa=_0x16c17c[_0xff6e('0x2')];return _0x16c17c[_0xff6e('0x3')](_0xff6e('0x4'),attributes,{'tableName':_0xff6e('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4bea2d,_0x2eb985,_0x3d7a72){return _0x3d9ffa[_0xff6e('0x6')][_0xff6e('0x7')]({'value':_0x4bea2d[_0xff6e('0x8')]},{'where':{'field':_0xff6e('0x9'),'value':_0x4bea2d['_previousDataValues'][_0xff6e('0x8')]}})[_0xff6e('0xa')](function(){_0x3d7a72();})['catch'](function(_0x143224){_0x3d7a72(_0x143224);});}}});}; \ No newline at end of file +var _0x2afa=['update','name','_previousDataValues','catch','./mailSubstatus.attributes','models','MailSubstatus','Condition'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2afa,0x104));var _0xa2af=function(_0x1ba28b,_0x26ce6e){_0x1ba28b=_0x1ba28b-0x0;var _0x37b883=_0x2afa[_0x1ba28b];return _0x37b883;};'use strict';var attributes=require(_0xa2af('0x0'));module['exports']=function(_0x49d9e2){var _0x221491=_0x49d9e2[_0xa2af('0x1')];return _0x49d9e2['define'](_0xa2af('0x2'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1868c5,_0x305409,_0x52f53b){return _0x221491[_0xa2af('0x3')][_0xa2af('0x4')]({'value':_0x1868c5[_0xa2af('0x5')]},{'where':{'field':'mailSubstatus','value':_0x1868c5[_0xa2af('0x6')][_0xa2af('0x5')]}})['then'](function(){_0x52f53b();})[_0xa2af('0x7')](function(_0x51a981){_0x52f53b(_0x51a981);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 3f83632..63c01db 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 _0x8033=['error','code','message','result','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2a52fe,_0x23949e){var _0x241d1c=function(_0x91043a){while(--_0x91043a){_0x2a52fe['push'](_0x2a52fe['shift']());}};_0x241d1c(++_0x23949e);}(_0x8033,0x1d1));var _0x3803=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x8033[_0x11155f];return _0xd07e48;};'use strict';var _=require('lodash');var util=require(_0x3803('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3803('0x1'));var fs=require('fs');var Redis=require(_0x3803('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3803('0x3'));var logger=require(_0x3803('0x4'))(_0x3803('0x5'));var config=require(_0x3803('0x6'));var jayson=require(_0x3803('0x7'));var client=jayson[_0x3803('0x8')][_0x3803('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2146d7,_0x4ff328,_0x24a802){return new BPromise(function(_0x39f43a,_0x4d49c8){return client[_0x3803('0xa')](_0x2146d7,_0x24a802)[_0x3803('0xb')](function(_0x938029){logger[_0x3803('0xc')](_0x3803('0xd'),_0x4ff328,'request\x20sent');logger[_0x3803('0xe')](_0x3803('0xf'),_0x4ff328,_0x3803('0x10'),JSON[_0x3803('0x11')](_0x938029));if(_0x938029[_0x3803('0x12')]){if(_0x938029['error'][_0x3803('0x13')]===0x1f4){logger[_0x3803('0x12')](_0x3803('0xd'),_0x4ff328,_0x938029[_0x3803('0x12')][_0x3803('0x14')]);return _0x4d49c8(_0x938029[_0x3803('0x12')]['message']);}logger[_0x3803('0x12')](_0x3803('0xd'),_0x4ff328,_0x938029[_0x3803('0x12')]['message']);return _0x39f43a(_0x938029[_0x3803('0x12')][_0x3803('0x14')]);}else{logger[_0x3803('0xc')](_0x3803('0xd'),_0x4ff328,_0x3803('0x10'));_0x39f43a(_0x938029[_0x3803('0x15')][_0x3803('0x14')]);}})[_0x3803('0x16')](function(_0x50098a){logger[_0x3803('0x12')](_0x3803('0xd'),_0x4ff328,_0x50098a);_0x4d49c8(_0x50098a);});});} \ No newline at end of file +var _0x56f9=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','MailSubstatus,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x56f9,0x10d));var _0x956f=function(_0x12f39a,_0x505ab7){_0x12f39a=_0x12f39a-0x0;var _0x4b1e88=_0x56f9[_0x12f39a];return _0x4b1e88;};'use strict';var _=require(_0x956f('0x0'));var util=require(_0x956f('0x1'));var moment=require(_0x956f('0x2'));var BPromise=require(_0x956f('0x3'));var rs=require(_0x956f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x956f('0x5'))['db'];var utils=require(_0x956f('0x6'));var logger=require('../../config/logger')(_0x956f('0x7'));var config=require(_0x956f('0x8'));var jayson=require(_0x956f('0x9'));var client=jayson[_0x956f('0xa')][_0x956f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e7896,_0x4abac8,_0x4e0f01){return new BPromise(function(_0x27d203,_0x3c40fd){return client[_0x956f('0xc')](_0x5e7896,_0x4e0f01)[_0x956f('0xd')](function(_0x5d29c1){logger[_0x956f('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x4abac8,_0x956f('0xf'));logger[_0x956f('0x10')](_0x956f('0x11'),_0x4abac8,'request\x20sent',JSON[_0x956f('0x12')](_0x5d29c1));if(_0x5d29c1[_0x956f('0x13')]){if(_0x5d29c1['error']['code']===0x1f4){logger[_0x956f('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x4abac8,_0x5d29c1['error'][_0x956f('0x14')]);return _0x3c40fd(_0x5d29c1[_0x956f('0x13')][_0x956f('0x14')]);}logger[_0x956f('0x13')](_0x956f('0x15'),_0x4abac8,_0x5d29c1['error']['message']);return _0x27d203(_0x5d29c1[_0x956f('0x13')][_0x956f('0x14')]);}else{logger[_0x956f('0xe')](_0x956f('0x15'),_0x4abac8,_0x956f('0xf'));_0x27d203(_0x5d29c1['result'][_0x956f('0x14')]);}})[_0x956f('0x16')](function(_0x4a029e){logger[_0x956f('0x13')](_0x956f('0x15'),_0x4abac8,_0x4a029e);_0x3c40fd(_0x4a029e);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index b0264df..01c979a 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 _0xec50=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x28b07e,_0x4f0c22){var _0x4af7f5=function(_0x4112b7){while(--_0x4112b7){_0x28b07e['push'](_0x28b07e['shift']());}};_0x4af7f5(++_0x4f0c22);}(_0xec50,0x12b));var _0x0ec5=function(_0x164c6e,_0x25abdb){_0x164c6e=_0x164c6e-0x0;var _0xe3731a=_0xec50[_0x164c6e];return _0xe3731a;};'use strict';var multer=require('multer');var util=require(_0x0ec5('0x0'));var path=require(_0x0ec5('0x1'));var timeout=require(_0x0ec5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0ec5('0x3'));var interaction=require(_0x0ec5('0x4'));var config=require('../../config/environment');var controller=require(_0x0ec5('0x5'));router[_0x0ec5('0x6')]('/',auth[_0x0ec5('0x7')](),controller[_0x0ec5('0x8')]);router['get'](_0x0ec5('0x9'),auth['isAuthenticated'](),controller[_0x0ec5('0xa')]);router[_0x0ec5('0x6')](_0x0ec5('0xb'),auth[_0x0ec5('0x7')](),controller[_0x0ec5('0xc')]);router[_0x0ec5('0xd')]('/',auth[_0x0ec5('0x7')](),controller[_0x0ec5('0xe')]);router[_0x0ec5('0xf')]('/:id',auth[_0x0ec5('0x7')](),controller[_0x0ec5('0x10')]);router[_0x0ec5('0x11')](_0x0ec5('0xb'),auth[_0x0ec5('0x7')](),controller[_0x0ec5('0x12')]);module[_0x0ec5('0x13')]=router; \ No newline at end of file +var _0x71ec=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','describe','show','put','/:id','delete'];(function(_0x194a21,_0x276c1e){var _0x56a8ef=function(_0x42dba4){while(--_0x42dba4){_0x194a21['push'](_0x194a21['shift']());}};_0x56a8ef(++_0x276c1e);}(_0x71ec,0xa4));var _0xc71e=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0x71ec[_0x231b2e];return _0x3feb2a;};'use strict';var multer=require(_0xc71e('0x0'));var util=require(_0xc71e('0x1'));var path=require(_0xc71e('0x2'));var timeout=require(_0xc71e('0x3'));var express=require(_0xc71e('0x4'));var router=express[_0xc71e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc71e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc71e('0x7'));var controller=require(_0xc71e('0x8'));router[_0xc71e('0x9')]('/',auth[_0xc71e('0xa')](),controller['index']);router[_0xc71e('0x9')]('/describe',auth[_0xc71e('0xa')](),controller[_0xc71e('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc71e('0xc')]);router['post']('/',auth[_0xc71e('0xa')](),controller['create']);router[_0xc71e('0xd')](_0xc71e('0xe'),auth[_0xc71e('0xa')](),controller['update']);router[_0xc71e('0xf')](_0xc71e('0xe'),auth[_0xc71e('0xa')](),controller[_0xc71e('0x10')]);module[_0xc71e('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 9cf7a46..d4f441e 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x46b275,_0x5caabd){var _0x162fe4=function(_0x3f9c05){while(--_0x3f9c05){_0x46b275['push'](_0x46b275['shift']());}};_0x162fe4(++_0x5caabd);}(_0xf4eb,0xec));var _0xbf4e=function(_0x45d3b6,_0x3312c8){_0x45d3b6=_0x45d3b6-0x0;var _0x1f3b3c=_0xf4eb[_0x45d3b6];return _0x1f3b3c;};'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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x40ef91,_0x1fe64e){var _0x240dd=function(_0x1008db){while(--_0x1008db){_0x40ef91['push'](_0x40ef91['shift']());}};_0x240dd(++_0x1fe64e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 2d9c2c2..2e9865e 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 _0xf226=['json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','name','send','index','map','MailTransferReport','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','catch','show','rawAttributes','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','status'];(function(_0x10b60a,_0x134ed1){var _0x400090=function(_0x4c682e){while(--_0x4c682e){_0x10b60a['push'](_0x10b60a['shift']());}};_0x400090(++_0x134ed1);}(_0xf226,0x7a));var _0x6f22=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf226[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x6f22('0x0'));var rimraf=require(_0x6f22('0x1'));var zipdir=require(_0x6f22('0x2'));var jsonpatch=require(_0x6f22('0x3'));var rp=require(_0x6f22('0x4'));var moment=require(_0x6f22('0x5'));var BPromise=require(_0x6f22('0x6'));var Mustache=require('mustache');var util=require(_0x6f22('0x7'));var path=require(_0x6f22('0x8'));var sox=require('sox');var csv=require(_0x6f22('0x9'));var ejs=require(_0x6f22('0xa'));var fs=require('fs');var fs_extra=require(_0x6f22('0xb'));var _=require(_0x6f22('0xc'));var squel=require(_0x6f22('0xd'));var crypto=require(_0x6f22('0xe'));var jsforce=require(_0x6f22('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6f22('0x9'));var querystring=require(_0x6f22('0x10'));var Papa=require(_0x6f22('0x11'));var Redis=require(_0x6f22('0x12'));var authService=require(_0x6f22('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6f22('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f22('0x15'))(_0x6f22('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6f22('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x400da9,_0x761f5c){_0x761f5c=_0x761f5c||0xcc;return function(_0x40f207){if(_0x40f207){return _0x400da9[_0x6f22('0x18')](_0x761f5c);}return _0x400da9[_0x6f22('0x19')](_0x761f5c)['end']();};}function respondWithResult(_0x2c50fa,_0x1d1735){_0x1d1735=_0x1d1735||0xc8;return function(_0x368628){if(_0x368628){return _0x2c50fa[_0x6f22('0x19')](_0x1d1735)[_0x6f22('0x1a')](_0x368628);}};}function respondWithFilteredResult(_0x3a1e16,_0x301011){return function(_0x1b92dd){if(_0x1b92dd){var _0x108018=typeof _0x301011[_0x6f22('0x1b')]===_0x6f22('0x1c')&&typeof _0x301011[_0x6f22('0x1d')]===_0x6f22('0x1c');var _0x941df0=_0x1b92dd[_0x6f22('0x1e')];var _0x3a2c2f=_0x108018?0x0:_0x301011[_0x6f22('0x1b')];var _0x566e94=_0x108018?_0x1b92dd['count']:_0x301011[_0x6f22('0x1b')]+_0x301011[_0x6f22('0x1d')];var _0x391301;if(_0x566e94>=_0x941df0){_0x566e94=_0x941df0;_0x391301=0xc8;}else{_0x391301=0xce;}_0x3a1e16['status'](_0x391301);return _0x3a1e16[_0x6f22('0x1f')]('Content-Range',_0x3a2c2f+'-'+_0x566e94+'/'+_0x941df0)[_0x6f22('0x1a')](_0x1b92dd);}return null;};}function patchUpdates(_0x322a6c){return function(_0x422d99){try{jsonpatch[_0x6f22('0x20')](_0x422d99,_0x322a6c,!![]);}catch(_0x38bf73){return BPromise[_0x6f22('0x21')](_0x38bf73);}return _0x422d99[_0x6f22('0x22')]();};}function saveUpdates(_0x3a653a,_0x3fde6a){return function(_0x22856e){if(_0x22856e){return _0x22856e[_0x6f22('0x23')](_0x3a653a)[_0x6f22('0x24')](function(_0x17042d){return _0x17042d;});}return null;};}function removeEntity(_0x206715,_0x12dd7f){return function(_0x2e212d){if(_0x2e212d){return _0x2e212d[_0x6f22('0x25')]()[_0x6f22('0x24')](function(){_0x206715[_0x6f22('0x19')](0xcc)[_0x6f22('0x26')]();});}};}function handleEntityNotFound(_0x15b3a9,_0x1de5da){return function(_0x3cfc87){if(!_0x3cfc87){_0x15b3a9['sendStatus'](0x194);}return _0x3cfc87;};}function handleError(_0xd8c0c2,_0x30aff6){_0x30aff6=_0x30aff6||0x1f4;return function(_0x2ba584){logger[_0x6f22('0x27')](_0x2ba584['stack']);if(_0x2ba584[_0x6f22('0x28')]){delete _0x2ba584[_0x6f22('0x28')];}_0xd8c0c2[_0x6f22('0x19')](_0x30aff6)[_0x6f22('0x29')](_0x2ba584);};}exports[_0x6f22('0x2a')]=function(_0xb39054,_0x5667ae){var _0x332a54={},_0x553865={},_0x107b67={'count':0x0,'rows':[]};var _0x28bc89=_[_0x6f22('0x2b')](db[_0x6f22('0x2c')]['rawAttributes'],function(_0x2772b3){return{'name':_0x2772b3['fieldName'],'type':_0x2772b3[_0x6f22('0x2d')][_0x6f22('0x2e')]};});_0x553865[_0x6f22('0x2f')]=_[_0x6f22('0x2b')](_0x28bc89,_0x6f22('0x28'));_0x553865[_0x6f22('0x30')]=_[_0x6f22('0x31')](_0xb39054[_0x6f22('0x30')]);_0x553865[_0x6f22('0x32')]=_['intersection'](_0x553865['model'],_0x553865[_0x6f22('0x30')]);_0x332a54[_0x6f22('0x33')]=_[_0x6f22('0x34')](_0x553865[_0x6f22('0x2f')],qs[_0x6f22('0x35')](_0xb39054[_0x6f22('0x30')][_0x6f22('0x35')]));_0x332a54['attributes']=_0x332a54['attributes']['length']?_0x332a54['attributes']:_0x553865[_0x6f22('0x2f')];if(!_0xb39054['query'][_0x6f22('0x36')](_0x6f22('0x37'))){_0x332a54[_0x6f22('0x1d')]=qs['limit'](_0xb39054[_0x6f22('0x30')]['limit']);_0x332a54[_0x6f22('0x1b')]=qs[_0x6f22('0x1b')](_0xb39054[_0x6f22('0x30')][_0x6f22('0x1b')]);}_0x332a54[_0x6f22('0x38')]=qs['sort'](_0xb39054[_0x6f22('0x30')][_0x6f22('0x39')]);_0x332a54[_0x6f22('0x3a')]=qs['filters'](_['pick'](_0xb39054['query'],_0x553865['filters']),_0x28bc89);if(_0xb39054['query']['filter']){_0x332a54[_0x6f22('0x3a')]=_[_0x6f22('0x3b')](_0x332a54[_0x6f22('0x3a')],{'$or':_[_0x6f22('0x2b')](_0x28bc89,function(_0x5969e0){if(_0x5969e0[_0x6f22('0x2d')]!==_0x6f22('0x3c')){var _0x63469c={};_0x63469c[_0x5969e0[_0x6f22('0x28')]]={'$like':'%'+_0xb39054['query'][_0x6f22('0x3d')]+'%'};return _0x63469c;}})});}_0x332a54=_[_0x6f22('0x3b')]({},_0x332a54,_0xb39054[_0x6f22('0x3e')]);var _0x443873={'where':_0x332a54['where']};return db[_0x6f22('0x2c')]['count'](_0x443873)[_0x6f22('0x24')](function(_0x4aa49c){_0x107b67['count']=_0x4aa49c;if(_0xb39054[_0x6f22('0x30')][_0x6f22('0x3f')]){_0x332a54[_0x6f22('0x40')]=[{'all':!![]}];}return db[_0x6f22('0x2c')]['findAll'](_0x332a54);})['then'](function(_0x251461){_0x107b67['rows']=_0x251461;return _0x107b67;})['then'](respondWithFilteredResult(_0x5667ae,_0x332a54))[_0x6f22('0x41')](handleError(_0x5667ae,null));};exports[_0x6f22('0x42')]=function(_0x3f93bb,_0x291363){var _0x52e0ef={'raw':!![],'where':{'id':_0x3f93bb['params']['id']}},_0x2a1937={};_0x2a1937['model']=_[_0x6f22('0x31')](db[_0x6f22('0x2c')][_0x6f22('0x43')]);_0x2a1937['query']=_[_0x6f22('0x31')](_0x3f93bb[_0x6f22('0x30')]);_0x2a1937['filters']=_[_0x6f22('0x34')](_0x2a1937['model'],_0x2a1937[_0x6f22('0x30')]);_0x52e0ef[_0x6f22('0x33')]=_[_0x6f22('0x34')](_0x2a1937[_0x6f22('0x2f')],qs[_0x6f22('0x35')](_0x3f93bb['query'][_0x6f22('0x35')]));_0x52e0ef[_0x6f22('0x33')]=_0x52e0ef[_0x6f22('0x33')][_0x6f22('0x44')]?_0x52e0ef['attributes']:_0x2a1937[_0x6f22('0x2f')];if(_0x3f93bb[_0x6f22('0x30')][_0x6f22('0x3f')]){_0x52e0ef['include']=[{'all':!![]}];}_0x52e0ef=_[_0x6f22('0x3b')]({},_0x52e0ef,_0x3f93bb[_0x6f22('0x3e')]);return db[_0x6f22('0x2c')][_0x6f22('0x45')](_0x52e0ef)['then'](handleEntityNotFound(_0x291363,null))[_0x6f22('0x24')](respondWithResult(_0x291363,null))[_0x6f22('0x41')](handleError(_0x291363,null));};exports[_0x6f22('0x46')]=function(_0x38895a,_0x21e157){return db[_0x6f22('0x2c')][_0x6f22('0x46')](_0x38895a[_0x6f22('0x47')],{})[_0x6f22('0x24')](respondWithResult(_0x21e157,0xc9))[_0x6f22('0x41')](handleError(_0x21e157,null));};exports[_0x6f22('0x23')]=function(_0x12e8cf,_0xcace6d){if(_0x12e8cf['body']['id']){delete _0x12e8cf[_0x6f22('0x47')]['id'];}return db[_0x6f22('0x2c')]['find']({'where':{'id':_0x12e8cf[_0x6f22('0x48')]['id']}})['then'](handleEntityNotFound(_0xcace6d,null))[_0x6f22('0x24')](saveUpdates(_0x12e8cf[_0x6f22('0x47')],null))[_0x6f22('0x24')](respondWithResult(_0xcace6d,null))[_0x6f22('0x41')](handleError(_0xcace6d,null));};exports[_0x6f22('0x25')]=function(_0x245e82,_0xdf8c1f){return db['MailTransferReport'][_0x6f22('0x45')]({'where':{'id':_0x245e82['params']['id']}})[_0x6f22('0x24')](handleEntityNotFound(_0xdf8c1f,null))[_0x6f22('0x24')](removeEntity(_0xdf8c1f,null))[_0x6f22('0x41')](handleError(_0xdf8c1f,null));};exports[_0x6f22('0x49')]=function(_0x308f2e,_0x1d8b48){return db[_0x6f22('0x2c')][_0x6f22('0x49')]()[_0x6f22('0x24')](respondWithResult(_0x1d8b48,null))[_0x6f22('0x41')](handleError(_0x1d8b48,null));}; \ No newline at end of file +var _0xbe41=['filter','merge','options','includeAll','include','findAll','catch','show','length','create','body','find','destroy','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','MailTransferReport','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x4fb797,_0x200ee6){var _0x34e096=function(_0x2c0f40){while(--_0x2c0f40){_0x4fb797['push'](_0x4fb797['shift']());}};_0x34e096(++_0x200ee6);}(_0xbe41,0x13b));var _0x1be4=function(_0xe17d1d,_0xb7ba7a){_0xe17d1d=_0xe17d1d-0x0;var _0x4dcd72=_0xbe41[_0xe17d1d];return _0x4dcd72;};'use strict';var emlformat=require(_0x1be4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1be4('0x1'));var rp=require('request-promise');var moment=require(_0x1be4('0x2'));var BPromise=require(_0x1be4('0x3'));var Mustache=require(_0x1be4('0x4'));var util=require(_0x1be4('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1be4('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1be4('0x7'));var squel=require(_0x1be4('0x8'));var crypto=require(_0x1be4('0x9'));var jsforce=require(_0x1be4('0xa'));var deskjs=require(_0x1be4('0xb'));var toCsv=require(_0x1be4('0xc'));var querystring=require(_0x1be4('0xd'));var Papa=require('papaparse');var Redis=require(_0x1be4('0xe'));var authService=require(_0x1be4('0xf'));var qs=require(_0x1be4('0x10'));var as=require(_0x1be4('0x11'));var hardwareService=require(_0x1be4('0x12'));var logger=require(_0x1be4('0x13'))(_0x1be4('0x14'));var utils=require('../../config/utils');var config=require(_0x1be4('0x15'));var licenseUtil=require(_0x1be4('0x16'));var db=require(_0x1be4('0x17'))['db'];function respondWithStatusCode(_0xca94af,_0x5c101d){_0x5c101d=_0x5c101d||0xcc;return function(_0x35ceaf){if(_0x35ceaf){return _0xca94af[_0x1be4('0x18')](_0x5c101d);}return _0xca94af[_0x1be4('0x19')](_0x5c101d)[_0x1be4('0x1a')]();};}function respondWithResult(_0x2df7bf,_0x51c7d1){_0x51c7d1=_0x51c7d1||0xc8;return function(_0x42eaf5){if(_0x42eaf5){return _0x2df7bf[_0x1be4('0x19')](_0x51c7d1)[_0x1be4('0x1b')](_0x42eaf5);}};}function respondWithFilteredResult(_0x32873a,_0x2c64de){return function(_0x396e29){if(_0x396e29){var _0x2caf9a=typeof _0x2c64de[_0x1be4('0x1c')]===_0x1be4('0x1d')&&typeof _0x2c64de['limit']==='undefined';var _0x438005=_0x396e29[_0x1be4('0x1e')];var _0x440944=_0x2caf9a?0x0:_0x2c64de[_0x1be4('0x1c')];var _0x5c9306=_0x2caf9a?_0x396e29[_0x1be4('0x1e')]:_0x2c64de[_0x1be4('0x1c')]+_0x2c64de[_0x1be4('0x1f')];var _0x4513c9;if(_0x5c9306>=_0x438005){_0x5c9306=_0x438005;_0x4513c9=0xc8;}else{_0x4513c9=0xce;}_0x32873a['status'](_0x4513c9);return _0x32873a[_0x1be4('0x20')](_0x1be4('0x21'),_0x440944+'-'+_0x5c9306+'/'+_0x438005)[_0x1be4('0x1b')](_0x396e29);}return null;};}function patchUpdates(_0x4032c5){return function(_0x4428ed){try{jsonpatch[_0x1be4('0x22')](_0x4428ed,_0x4032c5,!![]);}catch(_0x47c172){return BPromise[_0x1be4('0x23')](_0x47c172);}return _0x4428ed[_0x1be4('0x24')]();};}function saveUpdates(_0x5bff6d,_0x2cc45a){return function(_0x173a3e){if(_0x173a3e){return _0x173a3e[_0x1be4('0x25')](_0x5bff6d)['then'](function(_0x553e07){return _0x553e07;});}return null;};}function removeEntity(_0x1c0b35,_0x1b8a5a){return function(_0x8670ac){if(_0x8670ac){return _0x8670ac['destroy']()[_0x1be4('0x26')](function(){_0x1c0b35[_0x1be4('0x19')](0xcc)[_0x1be4('0x1a')]();});}};}function handleEntityNotFound(_0x2a6399,_0x3facd5){return function(_0x166b45){if(!_0x166b45){_0x2a6399['sendStatus'](0x194);}return _0x166b45;};}function handleError(_0x51f4e6,_0x5e61c3){_0x5e61c3=_0x5e61c3||0x1f4;return function(_0x1222b1){logger[_0x1be4('0x27')](_0x1222b1['stack']);if(_0x1222b1['name']){delete _0x1222b1[_0x1be4('0x28')];}_0x51f4e6[_0x1be4('0x19')](_0x5e61c3)[_0x1be4('0x29')](_0x1222b1);};}exports[_0x1be4('0x2a')]=function(_0x60b84d,_0x17228b){var _0x2511e1={},_0x3ddf9a={},_0x4bbe6c={'count':0x0,'rows':[]};var _0x388065=_['map'](db[_0x1be4('0x2b')][_0x1be4('0x2c')],function(_0x88e921){return{'name':_0x88e921[_0x1be4('0x2d')],'type':_0x88e921[_0x1be4('0x2e')]['key']};});_0x3ddf9a[_0x1be4('0x2f')]=_[_0x1be4('0x30')](_0x388065,_0x1be4('0x28'));_0x3ddf9a['query']=_[_0x1be4('0x31')](_0x60b84d[_0x1be4('0x32')]);_0x3ddf9a[_0x1be4('0x33')]=_[_0x1be4('0x34')](_0x3ddf9a[_0x1be4('0x2f')],_0x3ddf9a['query']);_0x2511e1[_0x1be4('0x35')]=_[_0x1be4('0x34')](_0x3ddf9a[_0x1be4('0x2f')],qs[_0x1be4('0x36')](_0x60b84d[_0x1be4('0x32')][_0x1be4('0x36')]));_0x2511e1['attributes']=_0x2511e1[_0x1be4('0x35')]['length']?_0x2511e1['attributes']:_0x3ddf9a[_0x1be4('0x2f')];if(!_0x60b84d['query'][_0x1be4('0x37')](_0x1be4('0x38'))){_0x2511e1[_0x1be4('0x1f')]=qs[_0x1be4('0x1f')](_0x60b84d[_0x1be4('0x32')]['limit']);_0x2511e1['offset']=qs[_0x1be4('0x1c')](_0x60b84d[_0x1be4('0x32')][_0x1be4('0x1c')]);}_0x2511e1['order']=qs[_0x1be4('0x39')](_0x60b84d[_0x1be4('0x32')][_0x1be4('0x39')]);_0x2511e1[_0x1be4('0x3a')]=qs[_0x1be4('0x33')](_[_0x1be4('0x3b')](_0x60b84d['query'],_0x3ddf9a[_0x1be4('0x33')]),_0x388065);if(_0x60b84d[_0x1be4('0x32')][_0x1be4('0x3c')]){_0x2511e1[_0x1be4('0x3a')]=_['merge'](_0x2511e1[_0x1be4('0x3a')],{'$or':_[_0x1be4('0x30')](_0x388065,function(_0x291854){if(_0x291854[_0x1be4('0x2e')]!=='VIRTUAL'){var _0x3078b9={};_0x3078b9[_0x291854[_0x1be4('0x28')]]={'$like':'%'+_0x60b84d['query']['filter']+'%'};return _0x3078b9;}})});}_0x2511e1=_[_0x1be4('0x3d')]({},_0x2511e1,_0x60b84d[_0x1be4('0x3e')]);var _0x2a4490={'where':_0x2511e1[_0x1be4('0x3a')]};return db[_0x1be4('0x2b')][_0x1be4('0x1e')](_0x2a4490)[_0x1be4('0x26')](function(_0x79a099){_0x4bbe6c[_0x1be4('0x1e')]=_0x79a099;if(_0x60b84d['query'][_0x1be4('0x3f')]){_0x2511e1[_0x1be4('0x40')]=[{'all':!![]}];}return db['MailTransferReport'][_0x1be4('0x41')](_0x2511e1);})[_0x1be4('0x26')](function(_0x4bded0){_0x4bbe6c['rows']=_0x4bded0;return _0x4bbe6c;})[_0x1be4('0x26')](respondWithFilteredResult(_0x17228b,_0x2511e1))[_0x1be4('0x42')](handleError(_0x17228b,null));};exports[_0x1be4('0x43')]=function(_0x3756f3,_0x4bd764){var _0x17d6b3={'raw':!![],'where':{'id':_0x3756f3['params']['id']}},_0x5eb17c={};_0x5eb17c[_0x1be4('0x2f')]=_['keys'](db['MailTransferReport'][_0x1be4('0x2c')]);_0x5eb17c[_0x1be4('0x32')]=_['keys'](_0x3756f3[_0x1be4('0x32')]);_0x5eb17c[_0x1be4('0x33')]=_[_0x1be4('0x34')](_0x5eb17c[_0x1be4('0x2f')],_0x5eb17c[_0x1be4('0x32')]);_0x17d6b3['attributes']=_[_0x1be4('0x34')](_0x5eb17c[_0x1be4('0x2f')],qs[_0x1be4('0x36')](_0x3756f3['query'][_0x1be4('0x36')]));_0x17d6b3[_0x1be4('0x35')]=_0x17d6b3['attributes'][_0x1be4('0x44')]?_0x17d6b3[_0x1be4('0x35')]:_0x5eb17c[_0x1be4('0x2f')];if(_0x3756f3['query'][_0x1be4('0x3f')]){_0x17d6b3[_0x1be4('0x40')]=[{'all':!![]}];}_0x17d6b3=_['merge']({},_0x17d6b3,_0x3756f3[_0x1be4('0x3e')]);return db[_0x1be4('0x2b')]['find'](_0x17d6b3)['then'](handleEntityNotFound(_0x4bd764,null))[_0x1be4('0x26')](respondWithResult(_0x4bd764,null))['catch'](handleError(_0x4bd764,null));};exports[_0x1be4('0x45')]=function(_0x29e2e4,_0x116edf){return db[_0x1be4('0x2b')][_0x1be4('0x45')](_0x29e2e4[_0x1be4('0x46')],{})['then'](respondWithResult(_0x116edf,0xc9))[_0x1be4('0x42')](handleError(_0x116edf,null));};exports['update']=function(_0x39ff62,_0x234a67){if(_0x39ff62['body']['id']){delete _0x39ff62[_0x1be4('0x46')]['id'];}return db[_0x1be4('0x2b')][_0x1be4('0x47')]({'where':{'id':_0x39ff62['params']['id']}})['then'](handleEntityNotFound(_0x234a67,null))['then'](saveUpdates(_0x39ff62[_0x1be4('0x46')],null))[_0x1be4('0x26')](respondWithResult(_0x234a67,null))[_0x1be4('0x42')](handleError(_0x234a67,null));};exports[_0x1be4('0x48')]=function(_0x2948c1,_0x308665){return db[_0x1be4('0x2b')][_0x1be4('0x47')]({'where':{'id':_0x2948c1[_0x1be4('0x49')]['id']}})[_0x1be4('0x26')](handleEntityNotFound(_0x308665,null))[_0x1be4('0x26')](removeEntity(_0x308665,null))[_0x1be4('0x42')](handleError(_0x308665,null));};exports[_0x1be4('0x4a')]=function(_0xd45624,_0x156acc){return db['MailTransferReport'][_0x1be4('0x4a')]()['then'](respondWithResult(_0x156acc,null))['catch'](handleError(_0x156acc,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index e543e18..a198cb2 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 _0xbecd=['rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3cc7db,_0x36b9a5){var _0x3a9d0d=function(_0xbe0ce6){while(--_0xbe0ce6){_0x3cc7db['push'](_0x3cc7db['shift']());}};_0x3a9d0d(++_0x36b9a5);}(_0xbecd,0x6a));var _0xdbec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbecd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xdbec('0x0'));var util=require('util');var logger=require(_0xdbec('0x1'))(_0xdbec('0x2'));var moment=require('moment');var BPromise=require(_0xdbec('0x3'));var rp=require(_0xdbec('0x4'));var fs=require('fs');var path=require(_0xdbec('0x5'));var rimraf=require(_0xdbec('0x6'));var config=require(_0xdbec('0x7'));var attributes=require(_0xdbec('0x8'));module[_0xdbec('0x9')]=function(_0x411618,_0x578a3b){return _0x411618[_0xdbec('0xa')](_0xdbec('0xb'),attributes,{'tableName':_0xdbec('0xc'),'paranoid':![],'indexes':[{'name':_0xdbec('0xd'),'fields':[_0xdbec('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdcf0=['./mailTransferReport.attributes','exports','MailTransferReport','uniqueid','lodash','util','api','moment','request-promise','../../config/environment'];(function(_0x5f41d3,_0x342c6a){var _0xf4dad9=function(_0x2376ac){while(--_0x2376ac){_0x5f41d3['push'](_0x5f41d3['shift']());}};_0xf4dad9(++_0x342c6a);}(_0xdcf0,0xb8));var _0x0dcf=function(_0x2654b3,_0x4d0ce7){_0x2654b3=_0x2654b3-0x0;var _0xaea42f=_0xdcf0[_0x2654b3];return _0xaea42f;};'use strict';var _=require(_0x0dcf('0x0'));var util=require(_0x0dcf('0x1'));var logger=require('../../config/logger')(_0x0dcf('0x2'));var moment=require(_0x0dcf('0x3'));var BPromise=require('bluebird');var rp=require(_0x0dcf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0dcf('0x5'));var attributes=require(_0x0dcf('0x6'));module[_0x0dcf('0x7')]=function(_0x2586c8,_0x1367df){return _0x2586c8['define'](_0x0dcf('0x8'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x0dcf('0x9'),'fields':[_0x0dcf('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 7322eb6..919523f 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 _0x5321=['info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x5321,0xc8));var _0x1532=function(_0x5190c2,_0x14a577){_0x5190c2=_0x5190c2-0x0;var _0x2c0281=_0x5321[_0x5190c2];return _0x2c0281;};'use strict';var _=require('lodash');var util=require(_0x1532('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1532('0x1'));var fs=require('fs');var Redis=require(_0x1532('0x2'));var db=require(_0x1532('0x3'))['db'];var utils=require(_0x1532('0x4'));var logger=require('../../config/logger')(_0x1532('0x5'));var config=require(_0x1532('0x6'));var jayson=require(_0x1532('0x7'));var client=jayson[_0x1532('0x8')][_0x1532('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d51b9,_0x1d9ef0,_0x4670e6){return new BPromise(function(_0x5b1c21,_0x5c7743){return client['request'](_0x5d51b9,_0x4670e6)['then'](function(_0x321fee){logger[_0x1532('0xa')](_0x1532('0xb'),_0x1d9ef0,'request\x20sent');logger[_0x1532('0xc')](_0x1532('0xd'),_0x1d9ef0,_0x1532('0xe'),JSON[_0x1532('0xf')](_0x321fee));if(_0x321fee[_0x1532('0x10')]){if(_0x321fee[_0x1532('0x10')][_0x1532('0x11')]===0x1f4){logger[_0x1532('0x10')](_0x1532('0xb'),_0x1d9ef0,_0x321fee[_0x1532('0x10')][_0x1532('0x12')]);return _0x5c7743(_0x321fee['error'][_0x1532('0x12')]);}logger[_0x1532('0x10')](_0x1532('0xb'),_0x1d9ef0,_0x321fee[_0x1532('0x10')]['message']);return _0x5b1c21(_0x321fee[_0x1532('0x10')][_0x1532('0x12')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x1d9ef0,_0x1532('0xe'));_0x5b1c21(_0x321fee[_0x1532('0x13')]['message']);}})[_0x1532('0x14')](function(_0x45ca98){logger[_0x1532('0x10')](_0x1532('0xb'),_0x1d9ef0,_0x45ca98);_0x5c7743(_0x45ca98);});});} \ No newline at end of file +var _0x1f35=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','debug','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x1f35,0xaa));var _0x51f3=function(_0x4d24a6,_0x54ffe3){_0x4d24a6=_0x4d24a6-0x0;var _0x3aea1e=_0x1f35[_0x4d24a6];return _0x3aea1e;};'use strict';var _=require(_0x51f3('0x0'));var util=require(_0x51f3('0x1'));var moment=require(_0x51f3('0x2'));var BPromise=require(_0x51f3('0x3'));var rs=require(_0x51f3('0x4'));var fs=require('fs');var Redis=require(_0x51f3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x51f3('0x6'));var logger=require(_0x51f3('0x7'))(_0x51f3('0x8'));var config=require('../../config/environment');var jayson=require(_0x51f3('0x9'));var client=jayson[_0x51f3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f9b5c,_0x3107d4,_0x4f5968){return new BPromise(function(_0x52288d,_0x22e6b1){return client[_0x51f3('0xb')](_0x5f9b5c,_0x4f5968)['then'](function(_0x28aea5){logger[_0x51f3('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x3107d4,'request\x20sent');logger[_0x51f3('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x3107d4,_0x51f3('0xe'),JSON[_0x51f3('0xf')](_0x28aea5));if(_0x28aea5['error']){if(_0x28aea5[_0x51f3('0x10')][_0x51f3('0x11')]===0x1f4){logger['error'](_0x51f3('0x12'),_0x3107d4,_0x28aea5[_0x51f3('0x10')]['message']);return _0x22e6b1(_0x28aea5[_0x51f3('0x10')]['message']);}logger['error'](_0x51f3('0x12'),_0x3107d4,_0x28aea5[_0x51f3('0x10')][_0x51f3('0x13')]);return _0x52288d(_0x28aea5[_0x51f3('0x10')][_0x51f3('0x13')]);}else{logger[_0x51f3('0xc')](_0x51f3('0x12'),_0x3107d4,_0x51f3('0xe'));_0x52288d(_0x28aea5[_0x51f3('0x14')]['message']);}})[_0x51f3('0x15')](function(_0x3857d4){logger[_0x51f3('0x10')](_0x51f3('0x12'),_0x3107d4,_0x3857d4);_0x22e6b1(_0x3857d4);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 3f82c65..8692c7e 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 _0xba7f=['fs-extra','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x2e2889,_0x434047){var _0x570d4d=function(_0xc3a84d){while(--_0xc3a84d){_0x2e2889['push'](_0x2e2889['shift']());}};_0x570d4d(++_0x434047);}(_0xba7f,0x1f3));var _0xfba7=function(_0x523d9d,_0x3f800f){_0x523d9d=_0x523d9d-0x0;var _0x52dafd=_0xba7f[_0x523d9d];return _0x52dafd;};'use strict';var multer=require(_0xfba7('0x0'));var util=require(_0xfba7('0x1'));var path=require('path');var timeout=require(_0xfba7('0x2'));var express=require(_0xfba7('0x3'));var router=express[_0xfba7('0x4')]();var fs_extra=require(_0xfba7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfba7('0x6'));var config=require(_0xfba7('0x7'));var controller=require(_0xfba7('0x8'));router[_0xfba7('0x9')]('/',auth[_0xfba7('0xa')](),controller[_0xfba7('0xb')]);router[_0xfba7('0x9')]('/describe',auth[_0xfba7('0xa')](),controller[_0xfba7('0xc')]);router['get'](_0xfba7('0xd'),auth['isAuthenticated'](),controller[_0xfba7('0xe')]);router[_0xfba7('0xf')]('/',auth[_0xfba7('0xa')](),controller['create']);router[_0xfba7('0x10')](_0xfba7('0xd'),auth[_0xfba7('0xa')](),controller[_0xfba7('0x11')]);router[_0xfba7('0x12')](_0xfba7('0xd'),auth[_0xfba7('0xa')](),controller[_0xfba7('0x13')]);module[_0xfba7('0x14')]=router; \ No newline at end of file +var _0xa4ab=['update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put'];(function(_0x4771d2,_0x221026){var _0x5be0f3=function(_0x13f369){while(--_0x13f369){_0x4771d2['push'](_0x4771d2['shift']());}};_0x5be0f3(++_0x221026);}(_0xa4ab,0x1bc));var _0xba4a=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0xa4ab[_0x128450];return _0x4d80ed;};'use strict';var multer=require(_0xba4a('0x0'));var util=require('util');var path=require(_0xba4a('0x1'));var timeout=require(_0xba4a('0x2'));var express=require('express');var router=express[_0xba4a('0x3')]();var fs_extra=require(_0xba4a('0x4'));var auth=require(_0xba4a('0x5'));var interaction=require(_0xba4a('0x6'));var config=require(_0xba4a('0x7'));var controller=require(_0xba4a('0x8'));router[_0xba4a('0x9')]('/',auth[_0xba4a('0xa')](),controller['index']);router[_0xba4a('0x9')](_0xba4a('0xb'),auth[_0xba4a('0xa')](),controller[_0xba4a('0xc')]);router[_0xba4a('0x9')](_0xba4a('0xd'),auth['isAuthenticated'](),controller[_0xba4a('0xe')]);router[_0xba4a('0xf')]('/',auth[_0xba4a('0xa')](),controller[_0xba4a('0x10')]);router[_0xba4a('0x11')]('/:id',auth[_0xba4a('0xa')](),controller[_0xba4a('0x12')]);router[_0xba4a('0x13')]('/:id',auth[_0xba4a('0xa')](),controller['destroy']);module[_0xba4a('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 394decd..9e7dce5 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 _0x23eb=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','STRING','DEFAULT\x20PAUSE'];(function(_0x3be2e2,_0x5c166d){var _0x53b9c5=function(_0x248aa7){while(--_0x248aa7){_0x3be2e2['push'](_0x3be2e2['shift']());}};_0x53b9c5(++_0x5c166d);}(_0x23eb,0x75));var _0xb23e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x23eb[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xb23e('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0xb23e('0x1')]},'membername':{'type':Sequelize[_0xb23e('0x1')]},'interface':{'type':Sequelize[_0xb23e('0x1')]},'type':{'type':Sequelize[_0xb23e('0x1')],'defaultValue':_0xb23e('0x2'),'comment':_0xb23e('0x3')},'duration':{'type':Sequelize[_0xb23e('0x4')]},'enterAt':{'type':Sequelize[_0xb23e('0x5')]},'exitAt':{'type':Sequelize[_0xb23e('0x5')],'set':function(_0x367451){var _0x1b5084=moment(_0x367451);var _0x13b58a=moment(this['getDataValue'](_0xb23e('0x6')));var _0x445261=_0x1b5084[_0xb23e('0x7')](_0x13b58a,_0xb23e('0x8'));this['setDataValue'](_0xb23e('0x9'),_0x367451);this['setDataValue'](_0xb23e('0xa'),_0x445261>=0x0?_0x445261:null);}},'data1':{'type':Sequelize[_0xb23e('0x1')],'comment':_0xb23e('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0xb23e('0xc')},'data3':{'type':Sequelize[_0xb23e('0x1')],'comment':_0xb23e('0xd')},'data4':{'type':Sequelize[_0xb23e('0x1')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xb23e('0x1')],'comment':_0xb23e('0xe')},'role':{'type':Sequelize[_0xb23e('0x1')]},'internal':{'type':Sequelize[_0xb23e('0x4')]},'uniqueid':{'type':Sequelize[_0xb23e('0x1')]}}; \ No newline at end of file +var _0xd239=['INTEGER','DATE','getDataValue','enterAt','diff','exitAt','duration','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x5e8549,_0x371820){var _0x374b82=function(_0x205219){while(--_0x205219){_0x5e8549['push'](_0x5e8549['shift']());}};_0x374b82(++_0x371820);}(_0xd239,0x153));var _0x9d23=function(_0x357f44,_0x4c0d19){_0x357f44=_0x357f44-0x0;var _0x5d4680=_0xd239[_0x357f44];return _0x5d4680;};'use strict';var Sequelize=require(_0x9d23('0x0'));var moment=require(_0x9d23('0x1'));module[_0x9d23('0x2')]={'channel':{'type':Sequelize[_0x9d23('0x3')]},'membername':{'type':Sequelize[_0x9d23('0x3')]},'interface':{'type':Sequelize[_0x9d23('0x3')]},'type':{'type':Sequelize[_0x9d23('0x3')],'defaultValue':_0x9d23('0x4'),'comment':_0x9d23('0x5')},'duration':{'type':Sequelize[_0x9d23('0x6')]},'enterAt':{'type':Sequelize[_0x9d23('0x7')]},'exitAt':{'type':Sequelize[_0x9d23('0x7')],'set':function(_0x28be98){var _0x3b7d3d=moment(_0x28be98);var _0x59b547=moment(this[_0x9d23('0x8')](_0x9d23('0x9')));var _0x104e25=_0x3b7d3d[_0x9d23('0xa')](_0x59b547,'seconds');this['setDataValue'](_0x9d23('0xb'),_0x28be98);this['setDataValue'](_0x9d23('0xc'),_0x104e25>=0x0?_0x104e25:null);}},'data1':{'type':Sequelize[_0x9d23('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x9d23('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x9d23('0xd')},'data5':{'type':Sequelize[_0x9d23('0x3')],'comment':_0x9d23('0xe')},'role':{'type':Sequelize[_0x9d23('0x3')]},'internal':{'type':Sequelize[_0x9d23('0x6')]},'uniqueid':{'type':Sequelize[_0x9d23('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index a35953b..6e9e8a4 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x55ca,0x126));var _0xa55c=function(_0x21b762,_0xc8ef11){_0x21b762=_0x21b762-0x0;var _0x2ea6d4=_0x55ca[_0x21b762];return _0x2ea6d4;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x39a390,_0x4792e0){var _0x203729=function(_0x14c945){while(--_0x14c945){_0x39a390['push'](_0x39a390['shift']());}};_0x203729(++_0x4792e0);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 65d6fe4..ccf8fac 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 _0xf740=['./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2ae998,_0x3bb2a6){var _0x500cab=function(_0x51e3d6){while(--_0x51e3d6){_0x2ae998['push'](_0x2ae998['shift']());}};_0x500cab(++_0x3bb2a6);}(_0xf740,0xab));var _0x0f74=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0xf740[_0x4f2c3a];return _0x17d91c;};'use strict';var _=require(_0x0f74('0x0'));var util=require(_0x0f74('0x1'));var logger=require(_0x0f74('0x2'))(_0x0f74('0x3'));var moment=require('moment');var BPromise=require(_0x0f74('0x4'));var rp=require(_0x0f74('0x5'));var fs=require('fs');var path=require(_0x0f74('0x6'));var rimraf=require(_0x0f74('0x7'));var config=require(_0x0f74('0x8'));var attributes=require(_0x0f74('0x9'));module[_0x0f74('0xa')]=function(_0x161372,_0x52b253){return _0x161372['define'](_0x0f74('0xb'),attributes,{'tableName':_0x0f74('0xc'),'paranoid':![],'indexes':[{'name':_0x0f74('0xd'),'fields':[_0x0f74('0xe'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4540=['./memberReport.attributes','exports','define','report_member','membername','lodash','util','bluebird','path','rimraf','../../config/environment'];(function(_0x48cfc7,_0x155179){var _0x85edd1=function(_0x2e1f45){while(--_0x2e1f45){_0x48cfc7['push'](_0x48cfc7['shift']());}};_0x85edd1(++_0x155179);}(_0x4540,0x17b));var _0x0454=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4540[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0454('0x0'));var util=require(_0x0454('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0454('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0454('0x3'));var rimraf=require(_0x0454('0x4'));var config=require(_0x0454('0x5'));var attributes=require(_0x0454('0x6'));module[_0x0454('0x7')]=function(_0x1c5860,_0x55283d){return _0x1c5860[_0x0454('0x8')]('MemberReport',attributes,{'tableName':_0x0454('0x9'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x0454('0xa'),'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 e981520..11ab2b6 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 _0x4da5=['debug','MemberReport','create','body','CreateMemberReport','UpdateMemberReport','update','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','options','raw','where','attributes','limit','include','model','map'];(function(_0x361bd3,_0x6dd8fa){var _0x344bee=function(_0x14bb22){while(--_0x14bb22){_0x361bd3['push'](_0x361bd3['shift']());}};_0x344bee(++_0x6dd8fa);}(_0x4da5,0x1b7));var _0x54da=function(_0x1dc64c,_0x412b97){_0x1dc64c=_0x1dc64c-0x0;var _0x11f7b1=_0x4da5[_0x1dc64c];return _0x11f7b1;};'use strict';var _=require('lodash');var util=require(_0x54da('0x0'));var moment=require(_0x54da('0x1'));var BPromise=require(_0x54da('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x54da('0x4'));var logger=require(_0x54da('0x5'))(_0x54da('0x6'));var config=require(_0x54da('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x54da('0x8')][_0x54da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x259062,_0x1b2b5c,_0x2fe7cc){return new BPromise(function(_0x30c17d,_0x1e2c78){return client['request'](_0x259062,_0x2fe7cc)[_0x54da('0xa')](function(_0x3c4e06){logger[_0x54da('0xb')]('MemberReport,\x20%s,\x20%s',_0x1b2b5c,_0x54da('0xc'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x1b2b5c,_0x54da('0xc'),JSON[_0x54da('0xd')](_0x3c4e06));if(_0x3c4e06[_0x54da('0xe')]){if(_0x3c4e06[_0x54da('0xe')][_0x54da('0xf')]===0x1f4){logger[_0x54da('0xe')](_0x54da('0x10'),_0x1b2b5c,_0x3c4e06[_0x54da('0xe')][_0x54da('0x11')]);return _0x1e2c78(_0x3c4e06[_0x54da('0xe')][_0x54da('0x11')]);}logger[_0x54da('0xe')](_0x54da('0x10'),_0x1b2b5c,_0x3c4e06['error'][_0x54da('0x11')]);return _0x30c17d(_0x3c4e06[_0x54da('0xe')][_0x54da('0x11')]);}else{logger[_0x54da('0xb')]('MemberReport,\x20%s,\x20%s',_0x1b2b5c,_0x54da('0xc'));_0x30c17d(_0x3c4e06[_0x54da('0x12')][_0x54da('0x11')]);}})[_0x54da('0x13')](function(_0x20ff93){logger[_0x54da('0xe')]('MemberReport,\x20%s,\x20%s',_0x1b2b5c,_0x20ff93);_0x1e2c78(_0x20ff93);});});}exports[_0x54da('0x14')]=function(_0x14aa08){var _0x5d242e=this;return new Promise(function(_0x2cad22,_0x3a463c){return db['MemberReport']['findAll']({'raw':_0x14aa08[_0x54da('0x15')]?_0x14aa08['options'][_0x54da('0x16')]===undefined?!![]:![]:!![],'where':_0x14aa08[_0x54da('0x15')]?_0x14aa08['options'][_0x54da('0x17')]||null:null,'attributes':_0x14aa08[_0x54da('0x15')]?_0x14aa08[_0x54da('0x15')][_0x54da('0x18')]||null:null,'limit':_0x14aa08[_0x54da('0x15')]?_0x14aa08[_0x54da('0x15')][_0x54da('0x19')]||null:null,'include':_0x14aa08[_0x54da('0x15')]?_0x14aa08[_0x54da('0x15')][_0x54da('0x1a')]?_['map'](_0x14aa08[_0x54da('0x15')][_0x54da('0x1a')],function(_0x16b09a){return{'model':db[_0x16b09a[_0x54da('0x1b')]],'as':_0x16b09a['as'],'attributes':_0x16b09a[_0x54da('0x18')],'include':_0x16b09a[_0x54da('0x1a')]?_['map'](_0x16b09a[_0x54da('0x1a')],function(_0xef179d){return{'model':db[_0xef179d[_0x54da('0x1b')]],'as':_0xef179d['as'],'attributes':_0xef179d[_0x54da('0x18')],'include':_0xef179d[_0x54da('0x1a')]?_[_0x54da('0x1c')](_0xef179d['include'],function(_0x9ea13f){return{'model':db[_0x9ea13f['model']],'as':_0x9ea13f['as'],'attributes':_0x9ea13f[_0x54da('0x18')]};}):[]};}):[]};}):[]:[]})[_0x54da('0xa')](function(_0x77024e){logger['info']('GetMemberReport',_0x14aa08);logger[_0x54da('0x1d')](_0x54da('0x14'),_0x14aa08,JSON[_0x54da('0xd')](_0x77024e));_0x2cad22(_0x77024e);})['catch'](function(_0x1f69e6){logger[_0x54da('0xe')]('GetMemberReport',_0x1f69e6[_0x54da('0x11')],_0x14aa08);_0x3a463c(_0x5d242e[_0x54da('0xe')](0x1f4,_0x1f69e6[_0x54da('0x11')]));});});};exports['CreateMemberReport']=function(_0x4d142e){var _0x21784e=this;return new Promise(function(_0x54b666,_0x20a0c6){return db[_0x54da('0x1e')][_0x54da('0x1f')](_0x4d142e[_0x54da('0x20')],{'raw':_0x4d142e[_0x54da('0x15')]?_0x4d142e[_0x54da('0x15')][_0x54da('0x16')]===undefined?!![]:![]:!![]})[_0x54da('0xa')](function(_0x56d4fc){logger[_0x54da('0xb')](_0x54da('0x21'),_0x4d142e);logger['debug']('CreateMemberReport',_0x4d142e,JSON[_0x54da('0xd')](_0x56d4fc));_0x54b666(_0x56d4fc);})[_0x54da('0x13')](function(_0x3f3847){logger[_0x54da('0xe')](_0x54da('0x21'),_0x3f3847[_0x54da('0x11')],_0x4d142e);_0x20a0c6(_0x21784e[_0x54da('0xe')](0x1f4,_0x3f3847[_0x54da('0x11')]));});});};exports[_0x54da('0x22')]=function(_0xe2afc4){var _0x10f188=this;return new Promise(function(_0x361c6f,_0x5e58d3){return db[_0x54da('0x1e')][_0x54da('0x23')](_0xe2afc4['body'],{'raw':_0xe2afc4[_0x54da('0x15')]?_0xe2afc4[_0x54da('0x15')][_0x54da('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe2afc4[_0x54da('0x15')]?_0xe2afc4[_0x54da('0x15')]['where']||null:null,'attributes':_0xe2afc4['options']?_0xe2afc4[_0x54da('0x15')]['attributes']||null:null,'limit':_0xe2afc4['options']?_0xe2afc4['options'][_0x54da('0x19')]||null:null})[_0x54da('0xa')](function(_0x19cbb4){logger[_0x54da('0xb')](_0x54da('0x22'),_0xe2afc4);logger[_0x54da('0x1d')](_0x54da('0x22'),_0xe2afc4,JSON[_0x54da('0xd')](_0x19cbb4));_0x361c6f(_0x19cbb4);})[_0x54da('0x13')](function(_0x3885aa){logger[_0x54da('0xe')](_0x54da('0x22'),_0x3885aa[_0x54da('0x11')],_0xe2afc4);_0x5e58d3(_0x10f188[_0x54da('0xe')](0x1f4,_0x3885aa[_0x54da('0x11')]));});});}; \ No newline at end of file +var _0x21cd=['MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetMemberReport','findAll','options','raw','where','include','map','model','attributes','CreateMemberReport','MemberReport','body','update','limit','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x3a29e7,_0x2e00ba){var _0x41a36f=function(_0x16d9d8){while(--_0x16d9d8){_0x3a29e7['push'](_0x3a29e7['shift']());}};_0x41a36f(++_0x2e00ba);}(_0x21cd,0x6a));var _0xd21c=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x21cd[_0x5cb1af];return _0x8d7940;};'use strict';var _=require(_0xd21c('0x0'));var util=require(_0xd21c('0x1'));var moment=require(_0xd21c('0x2'));var BPromise=require(_0xd21c('0x3'));var rs=require(_0xd21c('0x4'));var fs=require('fs');var Redis=require(_0xd21c('0x5'));var db=require(_0xd21c('0x6'))['db'];var utils=require(_0xd21c('0x7'));var logger=require(_0xd21c('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd21c('0x9'));var client=jayson[_0xd21c('0xa')][_0xd21c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1831ae,_0x19f375,_0x5a39f2){return new BPromise(function(_0x2d8bed,_0x18ffe7){return client[_0xd21c('0xc')](_0x1831ae,_0x5a39f2)[_0xd21c('0xd')](function(_0x1d8a25){logger['info'](_0xd21c('0xe'),_0x19f375,'request\x20sent');logger[_0xd21c('0xf')](_0xd21c('0x10'),_0x19f375,_0xd21c('0x11'),JSON[_0xd21c('0x12')](_0x1d8a25));if(_0x1d8a25[_0xd21c('0x13')]){if(_0x1d8a25[_0xd21c('0x13')][_0xd21c('0x14')]===0x1f4){logger['error'](_0xd21c('0xe'),_0x19f375,_0x1d8a25[_0xd21c('0x13')][_0xd21c('0x15')]);return _0x18ffe7(_0x1d8a25[_0xd21c('0x13')][_0xd21c('0x15')]);}logger[_0xd21c('0x13')](_0xd21c('0xe'),_0x19f375,_0x1d8a25[_0xd21c('0x13')][_0xd21c('0x15')]);return _0x2d8bed(_0x1d8a25[_0xd21c('0x13')][_0xd21c('0x15')]);}else{logger[_0xd21c('0x16')]('MemberReport,\x20%s,\x20%s',_0x19f375,_0xd21c('0x11'));_0x2d8bed(_0x1d8a25[_0xd21c('0x17')][_0xd21c('0x15')]);}})[_0xd21c('0x18')](function(_0x141da1){logger['error'](_0xd21c('0xe'),_0x19f375,_0x141da1);_0x18ffe7(_0x141da1);});});}exports[_0xd21c('0x19')]=function(_0x1f60d1){var _0x54b2aa=this;return new Promise(function(_0x9c294c,_0x354a18){return db['MemberReport'][_0xd21c('0x1a')]({'raw':_0x1f60d1[_0xd21c('0x1b')]?_0x1f60d1['options'][_0xd21c('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f60d1['options']?_0x1f60d1[_0xd21c('0x1b')][_0xd21c('0x1d')]||null:null,'attributes':_0x1f60d1[_0xd21c('0x1b')]?_0x1f60d1[_0xd21c('0x1b')]['attributes']||null:null,'limit':_0x1f60d1[_0xd21c('0x1b')]?_0x1f60d1['options']['limit']||null:null,'include':_0x1f60d1[_0xd21c('0x1b')]?_0x1f60d1[_0xd21c('0x1b')][_0xd21c('0x1e')]?_[_0xd21c('0x1f')](_0x1f60d1[_0xd21c('0x1b')][_0xd21c('0x1e')],function(_0xa04dd3){return{'model':db[_0xa04dd3[_0xd21c('0x20')]],'as':_0xa04dd3['as'],'attributes':_0xa04dd3[_0xd21c('0x21')],'include':_0xa04dd3[_0xd21c('0x1e')]?_[_0xd21c('0x1f')](_0xa04dd3[_0xd21c('0x1e')],function(_0x537ca9){return{'model':db[_0x537ca9[_0xd21c('0x20')]],'as':_0x537ca9['as'],'attributes':_0x537ca9['attributes'],'include':_0x537ca9[_0xd21c('0x1e')]?_['map'](_0x537ca9[_0xd21c('0x1e')],function(_0x37d2ad){return{'model':db[_0x37d2ad[_0xd21c('0x20')]],'as':_0x37d2ad['as'],'attributes':_0x37d2ad[_0xd21c('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd21c('0xd')](function(_0x3fd1da){logger[_0xd21c('0x16')](_0xd21c('0x19'),_0x1f60d1);logger[_0xd21c('0xf')](_0xd21c('0x19'),_0x1f60d1,JSON['stringify'](_0x3fd1da));_0x9c294c(_0x3fd1da);})[_0xd21c('0x18')](function(_0x2c09b3){logger['error'](_0xd21c('0x19'),_0x2c09b3['message'],_0x1f60d1);_0x354a18(_0x54b2aa['error'](0x1f4,_0x2c09b3['message']));});});};exports[_0xd21c('0x22')]=function(_0xfad381){var _0x3b7f6e=this;return new Promise(function(_0x2ee6f4,_0x2f7f41){return db[_0xd21c('0x23')]['create'](_0xfad381[_0xd21c('0x24')],{'raw':_0xfad381[_0xd21c('0x1b')]?_0xfad381[_0xd21c('0x1b')][_0xd21c('0x1c')]===undefined?!![]:![]:!![]})[_0xd21c('0xd')](function(_0x59c91d){logger[_0xd21c('0x16')](_0xd21c('0x22'),_0xfad381);logger['debug']('CreateMemberReport',_0xfad381,JSON[_0xd21c('0x12')](_0x59c91d));_0x2ee6f4(_0x59c91d);})['catch'](function(_0xd0fcbe){logger[_0xd21c('0x13')]('CreateMemberReport',_0xd0fcbe[_0xd21c('0x15')],_0xfad381);_0x2f7f41(_0x3b7f6e['error'](0x1f4,_0xd0fcbe[_0xd21c('0x15')]));});});};exports['UpdateMemberReport']=function(_0x1576cc){var _0x563bf6=this;return new Promise(function(_0x866d6,_0x1fbd38){return db[_0xd21c('0x23')][_0xd21c('0x25')](_0x1576cc[_0xd21c('0x24')],{'raw':_0x1576cc[_0xd21c('0x1b')]?_0x1576cc[_0xd21c('0x1b')][_0xd21c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1576cc[_0xd21c('0x1b')]?_0x1576cc['options'][_0xd21c('0x1d')]||null:null,'attributes':_0x1576cc[_0xd21c('0x1b')]?_0x1576cc[_0xd21c('0x1b')][_0xd21c('0x21')]||null:null,'limit':_0x1576cc[_0xd21c('0x1b')]?_0x1576cc[_0xd21c('0x1b')][_0xd21c('0x26')]||null:null})[_0xd21c('0xd')](function(_0x415126){logger[_0xd21c('0x16')]('UpdateMemberReport',_0x1576cc);logger[_0xd21c('0xf')](_0xd21c('0x27'),_0x1576cc,JSON[_0xd21c('0x12')](_0x415126));_0x866d6(_0x415126);})[_0xd21c('0x18')](function(_0x2a09db){logger['error'](_0xd21c('0x27'),_0x2a09db[_0xd21c('0x15')],_0x1576cc);_0x1fbd38(_0x563bf6['error'](0x1f4,_0x2a09db[_0xd21c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index dab63f5..1a75674 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 _0x5294=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','exports','multer','util','path'];(function(_0xb30c05,_0x11bfab){var _0x567ad5=function(_0x560948){while(--_0x560948){_0xb30c05['push'](_0xb30c05['shift']());}};_0x567ad5(++_0x11bfab);}(_0x5294,0x111));var _0x4529=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x5294[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x4529('0x0'));var util=require(_0x4529('0x1'));var path=require(_0x4529('0x2'));var timeout=require(_0x4529('0x3'));var express=require(_0x4529('0x4'));var router=express[_0x4529('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4529('0x6'));var interaction=require(_0x4529('0x7'));var config=require(_0x4529('0x8'));var controller=require('./migration.controller');router[_0x4529('0x9')]('/',controller[_0x4529('0xa')]);module[_0x4529('0xb')]=router; \ No newline at end of file +var _0x9ea2=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','multer'];(function(_0x4de4b0,_0x52bbd0){var _0x4101f7=function(_0x318492){while(--_0x318492){_0x4de4b0['push'](_0x4de4b0['shift']());}};_0x4101f7(++_0x52bbd0);}(_0x9ea2,0x147));var _0x29ea=function(_0x577628,_0x2d0809){_0x577628=_0x577628-0x0;var _0x37a0dd=_0x9ea2[_0x577628];return _0x37a0dd;};'use strict';var multer=require(_0x29ea('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x29ea('0x1'));var express=require('express');var router=express[_0x29ea('0x2')]();var fs_extra=require(_0x29ea('0x3'));var auth=require(_0x29ea('0x4'));var interaction=require(_0x29ea('0x5'));var config=require(_0x29ea('0x6'));var controller=require(_0x29ea('0x7'));router['get']('/',controller['index']);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 65d3968..88868dc 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 _0xd592=['version','exports','STRING'];(function(_0x3ef74d,_0x354f00){var _0x32ce0d=function(_0x291edb){while(--_0x291edb){_0x3ef74d['push'](_0x3ef74d['shift']());}};_0x32ce0d(++_0x354f00);}(_0xd592,0x187));var _0x2d59=function(_0x51a4a6,_0x1e67a8){_0x51a4a6=_0x51a4a6-0x0;var _0x2720c8=_0xd592[_0x51a4a6];return _0x2720c8;};'use strict';var Sequelize=require('sequelize');module[_0x2d59('0x0')]={'version':{'type':Sequelize[_0x2d59('0x1')],'unique':_0x2d59('0x2')}}; \ No newline at end of file +var _0xcc7d=['version','sequelize'];(function(_0x529abc,_0x17b97e){var _0x453afa=function(_0x536263){while(--_0x536263){_0x529abc['push'](_0x529abc['shift']());}};_0x453afa(++_0x17b97e);}(_0xcc7d,0x143));var _0xdcc7=function(_0x1df6b3,_0x3ac66a){_0x1df6b3=_0x1df6b3-0x0;var _0x350b7d=_0xcc7d[_0x1df6b3];return _0x350b7d;};'use strict';var Sequelize=require(_0xdcc7('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0xdcc7('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 2b8812b..7332522 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 _0x9fa3=['findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','Migration'];(function(_0x14c1f4,_0x2b30f3){var _0x5393a0=function(_0x23d668){while(--_0x23d668){_0x14c1f4['push'](_0x14c1f4['shift']());}};_0x5393a0(++_0x2b30f3);}(_0x9fa3,0x112));var _0x39fa=function(_0x463baf,_0x32d055){_0x463baf=_0x463baf-0x0;var _0x797a21=_0x9fa3[_0x463baf];return _0x797a21;};'use strict';var emlformat=require(_0x39fa('0x0'));var rimraf=require(_0x39fa('0x1'));var zipdir=require(_0x39fa('0x2'));var jsonpatch=require(_0x39fa('0x3'));var rp=require(_0x39fa('0x4'));var moment=require(_0x39fa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x39fa('0x6'));var util=require(_0x39fa('0x7'));var path=require(_0x39fa('0x8'));var sox=require(_0x39fa('0x9'));var csv=require('to-csv');var ejs=require(_0x39fa('0xa'));var fs=require('fs');var fs_extra=require(_0x39fa('0xb'));var _=require(_0x39fa('0xc'));var squel=require(_0x39fa('0xd'));var crypto=require('crypto');var jsforce=require(_0x39fa('0xe'));var deskjs=require(_0x39fa('0xf'));var toCsv=require(_0x39fa('0x10'));var querystring=require(_0x39fa('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x39fa('0x12'));var hardwareService=require(_0x39fa('0x13'));var logger=require(_0x39fa('0x14'))(_0x39fa('0x15'));var utils=require(_0x39fa('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c1374,_0x13ace8){_0x13ace8=_0x13ace8||0xcc;return function(_0x2ff369){if(_0x2ff369){return _0x4c1374[_0x39fa('0x17')](_0x13ace8);}return _0x4c1374['status'](_0x13ace8)[_0x39fa('0x18')]();};}function respondWithResult(_0x5c9bc6,_0x59b9db){_0x59b9db=_0x59b9db||0xc8;return function(_0x143877){if(_0x143877){return _0x5c9bc6[_0x39fa('0x19')](_0x59b9db)[_0x39fa('0x1a')](_0x143877);}};}function respondWithFilteredResult(_0x59bfb1,_0x2799ce){return function(_0x4a9e41){if(_0x4a9e41){var _0xe986d6=typeof _0x2799ce[_0x39fa('0x1b')]===_0x39fa('0x1c')&&typeof _0x2799ce[_0x39fa('0x1d')]==='undefined';var _0x5ba834=_0x4a9e41[_0x39fa('0x1e')];var _0x27ca8e=_0xe986d6?0x0:_0x2799ce[_0x39fa('0x1b')];var _0x19ba34=_0xe986d6?_0x4a9e41[_0x39fa('0x1e')]:_0x2799ce[_0x39fa('0x1b')]+_0x2799ce[_0x39fa('0x1d')];var _0x19fddb;if(_0x19ba34>=_0x5ba834){_0x19ba34=_0x5ba834;_0x19fddb=0xc8;}else{_0x19fddb=0xce;}_0x59bfb1[_0x39fa('0x19')](_0x19fddb);return _0x59bfb1['set'](_0x39fa('0x1f'),_0x27ca8e+'-'+_0x19ba34+'/'+_0x5ba834)['json'](_0x4a9e41);}return null;};}function patchUpdates(_0x16ed98){return function(_0x416bf8){try{jsonpatch[_0x39fa('0x20')](_0x416bf8,_0x16ed98,!![]);}catch(_0x32ad41){return BPromise[_0x39fa('0x21')](_0x32ad41);}return _0x416bf8[_0x39fa('0x22')]();};}function saveUpdates(_0x22b388,_0x213d6e){return function(_0x2fdef4){if(_0x2fdef4){return _0x2fdef4[_0x39fa('0x23')](_0x22b388)[_0x39fa('0x24')](function(_0x331e0b){return _0x331e0b;});}return null;};}function removeEntity(_0x24adc3,_0x3a5534){return function(_0x1a4141){if(_0x1a4141){return _0x1a4141['destroy']()[_0x39fa('0x24')](function(){_0x24adc3[_0x39fa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ea098,_0x12c70d){return function(_0xf1a95d){if(!_0xf1a95d){_0x1ea098[_0x39fa('0x17')](0x194);}return _0xf1a95d;};}function handleError(_0xe8caaa,_0x1157df){_0x1157df=_0x1157df||0x1f4;return function(_0x1cc904){logger[_0x39fa('0x25')](_0x1cc904[_0x39fa('0x26')]);if(_0x1cc904[_0x39fa('0x27')]){delete _0x1cc904[_0x39fa('0x27')];}_0xe8caaa[_0x39fa('0x19')](_0x1157df)[_0x39fa('0x28')](_0x1cc904);};}exports[_0x39fa('0x29')]=function(_0xa947d0,_0x5d5d54){var _0x30f4ac={},_0x54e053={},_0x99e030={'count':0x0,'rows':[]};var _0x297d69=_[_0x39fa('0x2a')](db['Migration'][_0x39fa('0x2b')],function(_0x534f38){return{'name':_0x534f38[_0x39fa('0x2c')],'type':_0x534f38['type'][_0x39fa('0x2d')]};});_0x54e053[_0x39fa('0x2e')]=_[_0x39fa('0x2a')](_0x297d69,_0x39fa('0x27'));_0x54e053[_0x39fa('0x2f')]=_[_0x39fa('0x30')](_0xa947d0[_0x39fa('0x2f')]);_0x54e053['filters']=_['intersection'](_0x54e053[_0x39fa('0x2e')],_0x54e053[_0x39fa('0x2f')]);_0x30f4ac[_0x39fa('0x31')]=_[_0x39fa('0x32')](_0x54e053[_0x39fa('0x2e')],qs['fields'](_0xa947d0[_0x39fa('0x2f')][_0x39fa('0x33')]));_0x30f4ac['attributes']=_0x30f4ac['attributes'][_0x39fa('0x34')]?_0x30f4ac[_0x39fa('0x31')]:_0x54e053[_0x39fa('0x2e')];if(!_0xa947d0[_0x39fa('0x2f')][_0x39fa('0x35')](_0x39fa('0x36'))){_0x30f4ac[_0x39fa('0x1d')]=qs['limit'](_0xa947d0[_0x39fa('0x2f')][_0x39fa('0x1d')]);_0x30f4ac[_0x39fa('0x1b')]=qs[_0x39fa('0x1b')](_0xa947d0[_0x39fa('0x2f')][_0x39fa('0x1b')]);}_0x30f4ac['order']=qs[_0x39fa('0x37')](_0xa947d0[_0x39fa('0x2f')][_0x39fa('0x37')]);_0x30f4ac[_0x39fa('0x38')]=qs[_0x39fa('0x39')](_[_0x39fa('0x3a')](_0xa947d0['query'],_0x54e053[_0x39fa('0x39')]),_0x297d69);if(_0xa947d0[_0x39fa('0x2f')][_0x39fa('0x3b')]){_0x30f4ac['where']=_[_0x39fa('0x3c')](_0x30f4ac[_0x39fa('0x38')],{'$or':_[_0x39fa('0x2a')](_0x297d69,function(_0x15fef6){if(_0x15fef6[_0x39fa('0x3d')]!==_0x39fa('0x3e')){var _0x47315a={};_0x47315a[_0x15fef6[_0x39fa('0x27')]]={'$like':'%'+_0xa947d0[_0x39fa('0x2f')]['filter']+'%'};return _0x47315a;}})});}_0x30f4ac=_[_0x39fa('0x3c')]({},_0x30f4ac,_0xa947d0[_0x39fa('0x3f')]);var _0x501109={'where':_0x30f4ac['where']};return db['Migration']['count'](_0x501109)['then'](function(_0x323b01){_0x99e030[_0x39fa('0x1e')]=_0x323b01;if(_0xa947d0['query']['includeAll']){_0x30f4ac[_0x39fa('0x40')]=[{'all':!![]}];}return db[_0x39fa('0x41')][_0x39fa('0x42')](_0x30f4ac);})[_0x39fa('0x24')](function(_0x4c34e7){_0x99e030[_0x39fa('0x43')]=_0x4c34e7;return _0x99e030;})['then'](respondWithFilteredResult(_0x5d5d54,_0x30f4ac))['catch'](handleError(_0x5d5d54,null));}; \ No newline at end of file +var _0xb1ce=['then','destroy','error','name','send','index','map','Migration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xb1ce,0x12c));var _0xeb1c=function(_0x4ab2b4,_0x15de5f){_0x4ab2b4=_0x4ab2b4-0x0;var _0x1f8db8=_0xb1ce[_0x4ab2b4];return _0x1f8db8;};'use strict';var emlformat=require(_0xeb1c('0x0'));var rimraf=require(_0xeb1c('0x1'));var zipdir=require(_0xeb1c('0x2'));var jsonpatch=require(_0xeb1c('0x3'));var rp=require(_0xeb1c('0x4'));var moment=require(_0xeb1c('0x5'));var BPromise=require(_0xeb1c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xeb1c('0x7'));var sox=require(_0xeb1c('0x8'));var csv=require(_0xeb1c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xeb1c('0xa'));var jsforce=require(_0xeb1c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xeb1c('0x9'));var querystring=require('querystring');var Papa=require(_0xeb1c('0xc'));var Redis=require(_0xeb1c('0xd'));var authService=require(_0xeb1c('0xe'));var qs=require(_0xeb1c('0xf'));var as=require(_0xeb1c('0x10'));var hardwareService=require(_0xeb1c('0x11'));var logger=require(_0xeb1c('0x12'))(_0xeb1c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xeb1c('0x14'));var db=require(_0xeb1c('0x15'))['db'];function respondWithStatusCode(_0x16186b,_0x598631){_0x598631=_0x598631||0xcc;return function(_0x38a7ed){if(_0x38a7ed){return _0x16186b[_0xeb1c('0x16')](_0x598631);}return _0x16186b[_0xeb1c('0x17')](_0x598631)[_0xeb1c('0x18')]();};}function respondWithResult(_0x33da1f,_0x5c8897){_0x5c8897=_0x5c8897||0xc8;return function(_0x18e522){if(_0x18e522){return _0x33da1f[_0xeb1c('0x17')](_0x5c8897)[_0xeb1c('0x19')](_0x18e522);}};}function respondWithFilteredResult(_0x1bee73,_0x586757){return function(_0x575188){if(_0x575188){var _0x156f79=typeof _0x586757[_0xeb1c('0x1a')]===_0xeb1c('0x1b')&&typeof _0x586757[_0xeb1c('0x1c')]===_0xeb1c('0x1b');var _0x1e40f4=_0x575188[_0xeb1c('0x1d')];var _0x484898=_0x156f79?0x0:_0x586757[_0xeb1c('0x1a')];var _0x568580=_0x156f79?_0x575188['count']:_0x586757[_0xeb1c('0x1a')]+_0x586757['limit'];var _0xcfa25d;if(_0x568580>=_0x1e40f4){_0x568580=_0x1e40f4;_0xcfa25d=0xc8;}else{_0xcfa25d=0xce;}_0x1bee73[_0xeb1c('0x17')](_0xcfa25d);return _0x1bee73[_0xeb1c('0x1e')](_0xeb1c('0x1f'),_0x484898+'-'+_0x568580+'/'+_0x1e40f4)['json'](_0x575188);}return null;};}function patchUpdates(_0xd62540){return function(_0x56d7b8){try{jsonpatch[_0xeb1c('0x20')](_0x56d7b8,_0xd62540,!![]);}catch(_0x11d96c){return BPromise[_0xeb1c('0x21')](_0x11d96c);}return _0x56d7b8['save']();};}function saveUpdates(_0x6145cc,_0x54cf7d){return function(_0x33ecf6){if(_0x33ecf6){return _0x33ecf6[_0xeb1c('0x22')](_0x6145cc)[_0xeb1c('0x23')](function(_0x3d69f7){return _0x3d69f7;});}return null;};}function removeEntity(_0x14a78f,_0x172129){return function(_0x46e1ab){if(_0x46e1ab){return _0x46e1ab[_0xeb1c('0x24')]()[_0xeb1c('0x23')](function(){_0x14a78f[_0xeb1c('0x17')](0xcc)[_0xeb1c('0x18')]();});}};}function handleEntityNotFound(_0x14200e,_0x3959ab){return function(_0x3b46d0){if(!_0x3b46d0){_0x14200e[_0xeb1c('0x16')](0x194);}return _0x3b46d0;};}function handleError(_0x4d27ae,_0x41d862){_0x41d862=_0x41d862||0x1f4;return function(_0x507a0c){logger[_0xeb1c('0x25')](_0x507a0c['stack']);if(_0x507a0c['name']){delete _0x507a0c[_0xeb1c('0x26')];}_0x4d27ae[_0xeb1c('0x17')](_0x41d862)[_0xeb1c('0x27')](_0x507a0c);};}exports[_0xeb1c('0x28')]=function(_0x3a92df,_0x414b86){var _0x1679f0={},_0x38d87a={},_0x337a99={'count':0x0,'rows':[]};var _0x16114f=_[_0xeb1c('0x29')](db[_0xeb1c('0x2a')][_0xeb1c('0x2b')],function(_0x50c4ec){return{'name':_0x50c4ec[_0xeb1c('0x2c')],'type':_0x50c4ec['type'][_0xeb1c('0x2d')]};});_0x38d87a[_0xeb1c('0x2e')]=_['map'](_0x16114f,'name');_0x38d87a[_0xeb1c('0x2f')]=_[_0xeb1c('0x30')](_0x3a92df['query']);_0x38d87a[_0xeb1c('0x31')]=_[_0xeb1c('0x32')](_0x38d87a['model'],_0x38d87a[_0xeb1c('0x2f')]);_0x1679f0[_0xeb1c('0x33')]=_['intersection'](_0x38d87a['model'],qs[_0xeb1c('0x34')](_0x3a92df[_0xeb1c('0x2f')][_0xeb1c('0x34')]));_0x1679f0[_0xeb1c('0x33')]=_0x1679f0['attributes'][_0xeb1c('0x35')]?_0x1679f0[_0xeb1c('0x33')]:_0x38d87a[_0xeb1c('0x2e')];if(!_0x3a92df[_0xeb1c('0x2f')]['hasOwnProperty'](_0xeb1c('0x36'))){_0x1679f0[_0xeb1c('0x1c')]=qs['limit'](_0x3a92df[_0xeb1c('0x2f')][_0xeb1c('0x1c')]);_0x1679f0[_0xeb1c('0x1a')]=qs['offset'](_0x3a92df['query']['offset']);}_0x1679f0[_0xeb1c('0x37')]=qs[_0xeb1c('0x38')](_0x3a92df['query'][_0xeb1c('0x38')]);_0x1679f0[_0xeb1c('0x39')]=qs['filters'](_[_0xeb1c('0x3a')](_0x3a92df[_0xeb1c('0x2f')],_0x38d87a[_0xeb1c('0x31')]),_0x16114f);if(_0x3a92df[_0xeb1c('0x2f')][_0xeb1c('0x3b')]){_0x1679f0[_0xeb1c('0x39')]=_[_0xeb1c('0x3c')](_0x1679f0[_0xeb1c('0x39')],{'$or':_[_0xeb1c('0x29')](_0x16114f,function(_0x34b7da){if(_0x34b7da['type']!==_0xeb1c('0x3d')){var _0x28704e={};_0x28704e[_0x34b7da['name']]={'$like':'%'+_0x3a92df[_0xeb1c('0x2f')]['filter']+'%'};return _0x28704e;}})});}_0x1679f0=_[_0xeb1c('0x3c')]({},_0x1679f0,_0x3a92df[_0xeb1c('0x3e')]);var _0xe36661={'where':_0x1679f0[_0xeb1c('0x39')]};return db[_0xeb1c('0x2a')][_0xeb1c('0x1d')](_0xe36661)['then'](function(_0x33e3e8){_0x337a99[_0xeb1c('0x1d')]=_0x33e3e8;if(_0x3a92df[_0xeb1c('0x2f')][_0xeb1c('0x3f')]){_0x1679f0[_0xeb1c('0x40')]=[{'all':!![]}];}return db[_0xeb1c('0x2a')]['findAll'](_0x1679f0);})['then'](function(_0x31c33e){_0x337a99[_0xeb1c('0x41')]=_0x31c33e;return _0x337a99;})[_0xeb1c('0x23')](respondWithFilteredResult(_0x414b86,_0x1679f0))[_0xeb1c('0x42')](handleError(_0x414b86,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index fc72a87..a5358ab 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 _0x0e1a=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./migration.attributes','exports','Migration','migrations','util'];(function(_0x44cd28,_0x1502d9){var _0x39356e=function(_0x4dfe82){while(--_0x4dfe82){_0x44cd28['push'](_0x44cd28['shift']());}};_0x39356e(++_0x1502d9);}(_0x0e1a,0x18b));var _0xa0e1=function(_0x557e4b,_0x37d49d){_0x557e4b=_0x557e4b-0x0;var _0x4d66ef=_0x0e1a[_0x557e4b];return _0x4d66ef;};'use strict';var _=require('lodash');var util=require(_0xa0e1('0x0'));var logger=require(_0xa0e1('0x1'))(_0xa0e1('0x2'));var moment=require(_0xa0e1('0x3'));var BPromise=require(_0xa0e1('0x4'));var rp=require(_0xa0e1('0x5'));var fs=require('fs');var path=require(_0xa0e1('0x6'));var rimraf=require('rimraf');var config=require(_0xa0e1('0x7'));var attributes=require(_0xa0e1('0x8'));module[_0xa0e1('0x9')]=function(_0x4e818,_0xd834da){return _0x4e818['define'](_0xa0e1('0xa'),attributes,{'tableName':_0xa0e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7bf=['moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','util','../../config/logger','api'];(function(_0x40be86,_0x68fe5d){var _0xda3c3b=function(_0x39deab){while(--_0x39deab){_0x40be86['push'](_0x40be86['shift']());}};_0xda3c3b(++_0x68fe5d);}(_0xd7bf,0x14f));var _0xfd7b=function(_0x222b6d,_0x10de75){_0x222b6d=_0x222b6d-0x0;var _0x1436f7=_0xd7bf[_0x222b6d];return _0x1436f7;};'use strict';var _=require('lodash');var util=require(_0xfd7b('0x0'));var logger=require(_0xfd7b('0x1'))(_0xfd7b('0x2'));var moment=require(_0xfd7b('0x3'));var BPromise=require(_0xfd7b('0x4'));var rp=require(_0xfd7b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfd7b('0x6'));var config=require(_0xfd7b('0x7'));var attributes=require(_0xfd7b('0x8'));module[_0xfd7b('0x9')]=function(_0x510f1e,_0x14baca){return _0x510f1e[_0xfd7b('0xa')](_0xfd7b('0xb'),attributes,{'tableName':_0xfd7b('0xc'),'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 3e4c0a3..95c2468 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 _0x63bb=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x29f757,_0x4fb6c1){var _0x1c530d=function(_0x373b7a){while(--_0x373b7a){_0x29f757['push'](_0x29f757['shift']());}};_0x1c530d(++_0x4fb6c1);}(_0x63bb,0xf8));var _0xb63b=function(_0x52de48,_0x5bc748){_0x52de48=_0x52de48-0x0;var _0x18f4c0=_0x63bb[_0x52de48];return _0x18f4c0;};'use strict';var _=require(_0xb63b('0x0'));var util=require(_0xb63b('0x1'));var moment=require(_0xb63b('0x2'));var BPromise=require(_0xb63b('0x3'));var rs=require(_0xb63b('0x4'));var fs=require('fs');var Redis=require(_0xb63b('0x5'));var db=require(_0xb63b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb63b('0x7'));var config=require(_0xb63b('0x8'));var jayson=require(_0xb63b('0x9'));var client=jayson[_0xb63b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eb1be,_0x2a27f9,_0x2aa873){return new BPromise(function(_0x544988,_0x366bda){return client[_0xb63b('0xb')](_0x3eb1be,_0x2aa873)['then'](function(_0x2d5002){logger[_0xb63b('0xc')](_0xb63b('0xd'),_0x2a27f9,_0xb63b('0xe'));logger[_0xb63b('0xf')]('Migration,\x20%s,\x20%s,\x20%s',_0x2a27f9,_0xb63b('0xe'),JSON[_0xb63b('0x10')](_0x2d5002));if(_0x2d5002[_0xb63b('0x11')]){if(_0x2d5002['error']['code']===0x1f4){logger[_0xb63b('0x11')](_0xb63b('0xd'),_0x2a27f9,_0x2d5002[_0xb63b('0x11')][_0xb63b('0x12')]);return _0x366bda(_0x2d5002['error'][_0xb63b('0x12')]);}logger[_0xb63b('0x11')](_0xb63b('0xd'),_0x2a27f9,_0x2d5002[_0xb63b('0x11')][_0xb63b('0x12')]);return _0x544988(_0x2d5002[_0xb63b('0x11')][_0xb63b('0x12')]);}else{logger['info'](_0xb63b('0xd'),_0x2a27f9,'request\x20sent');_0x544988(_0x2d5002[_0xb63b('0x13')][_0xb63b('0x12')]);}})[_0xb63b('0x14')](function(_0x41bfc4){logger[_0xb63b('0x11')]('Migration,\x20%s,\x20%s',_0x2a27f9,_0x41bfc4);_0x366bda(_0x41bfc4);});});} \ No newline at end of file +var _0xcb18=['code','message','result','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5c3ea5,_0xa9ed0c){var _0x102b61=function(_0xafb4a3){while(--_0xafb4a3){_0x5c3ea5['push'](_0x5c3ea5['shift']());}};_0x102b61(++_0xa9ed0c);}(_0xcb18,0x159));var _0x8cb1=function(_0x3968cb,_0x1f8f0e){_0x3968cb=_0x3968cb-0x0;var _0xacd547=_0xcb18[_0x3968cb];return _0xacd547;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8cb1('0x0'));var BPromise=require('bluebird');var rs=require(_0x8cb1('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cb1('0x2'))['db'];var utils=require(_0x8cb1('0x3'));var logger=require(_0x8cb1('0x4'))(_0x8cb1('0x5'));var config=require(_0x8cb1('0x6'));var jayson=require(_0x8cb1('0x7'));var client=jayson['client'][_0x8cb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x335e41,_0x55ca24,_0x186f71){return new BPromise(function(_0x510e92,_0x34dbbb){return client[_0x8cb1('0x9')](_0x335e41,_0x186f71)['then'](function(_0xc6491b){logger[_0x8cb1('0xa')](_0x8cb1('0xb'),_0x55ca24,_0x8cb1('0xc'));logger[_0x8cb1('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x55ca24,_0x8cb1('0xc'),JSON[_0x8cb1('0xe')](_0xc6491b));if(_0xc6491b[_0x8cb1('0xf')]){if(_0xc6491b['error'][_0x8cb1('0x10')]===0x1f4){logger[_0x8cb1('0xf')](_0x8cb1('0xb'),_0x55ca24,_0xc6491b[_0x8cb1('0xf')][_0x8cb1('0x11')]);return _0x34dbbb(_0xc6491b[_0x8cb1('0xf')]['message']);}logger[_0x8cb1('0xf')]('Migration,\x20%s,\x20%s',_0x55ca24,_0xc6491b[_0x8cb1('0xf')][_0x8cb1('0x11')]);return _0x510e92(_0xc6491b[_0x8cb1('0xf')][_0x8cb1('0x11')]);}else{logger[_0x8cb1('0xa')](_0x8cb1('0xb'),_0x55ca24,'request\x20sent');_0x510e92(_0xc6491b[_0x8cb1('0x12')]['message']);}})['catch'](function(_0x557fb5){logger[_0x8cb1('0xf')](_0x8cb1('0xb'),_0x55ca24,_0x557fb5);_0x34dbbb(_0x557fb5);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 7be01d8..8d660d4 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 _0x3b90=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','isAuthenticated','index','get','/:id','show','post','update','delete','destroy','exports'];(function(_0x1fa381,_0x758c2a){var _0x47eefe=function(_0x127f8c){while(--_0x127f8c){_0x1fa381['push'](_0x1fa381['shift']());}};_0x47eefe(++_0x758c2a);}(_0x3b90,0x143));var _0x03b9=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x3b90[_0x2a67fe];return _0x57e726;};'use strict';var multer=require('multer');var util=require(_0x03b9('0x0'));var path=require(_0x03b9('0x1'));var timeout=require(_0x03b9('0x2'));var express=require(_0x03b9('0x3'));var router=express[_0x03b9('0x4')]();var fs_extra=require(_0x03b9('0x5'));var auth=require(_0x03b9('0x6'));var interaction=require(_0x03b9('0x7'));var config=require('../../config/environment');var controller=require(_0x03b9('0x8'));router['get']('/',auth[_0x03b9('0x9')](),controller[_0x03b9('0xa')]);router[_0x03b9('0xb')](_0x03b9('0xc'),auth[_0x03b9('0x9')](),controller[_0x03b9('0xd')]);router[_0x03b9('0xe')]('/',auth[_0x03b9('0x9')](),controller['create']);router['put']('/:id',auth[_0x03b9('0x9')](),controller[_0x03b9('0xf')]);router[_0x03b9('0x10')](_0x03b9('0xc'),auth['isAuthenticated'](),controller[_0x03b9('0x11')]);module[_0x03b9('0x12')]=router; \ No newline at end of file +var _0x3c36=['../../components/auth/service','../../components/interaction/service','./network.controller','get','/:id','show','isAuthenticated','create','put','update','destroy','exports','path','connect-timeout','express','fs-extra'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3c36,0x10c));var _0x63c3=function(_0x2fcee9,_0x391bfc){_0x2fcee9=_0x2fcee9-0x0;var _0x4591dd=_0x3c36[_0x2fcee9];return _0x4591dd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x63c3('0x0'));var timeout=require(_0x63c3('0x1'));var express=require(_0x63c3('0x2'));var router=express['Router']();var fs_extra=require(_0x63c3('0x3'));var auth=require(_0x63c3('0x4'));var interaction=require(_0x63c3('0x5'));var config=require('../../config/environment');var controller=require(_0x63c3('0x6'));router[_0x63c3('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x63c3('0x8'),auth['isAuthenticated'](),controller[_0x63c3('0x9')]);router['post']('/',auth[_0x63c3('0xa')](),controller[_0x63c3('0xb')]);router[_0x63c3('0xc')](_0x63c3('0x8'),auth['isAuthenticated'](),controller[_0x63c3('0xd')]);router['delete']('/:id',auth[_0x63c3('0xa')](),controller[_0x63c3('0xe')]);module[_0x63c3('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 5086456..1b2fd87 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 _0x4131=['externip','stun','STRING','sequelize','exports','ENUM'];(function(_0x33d80d,_0x1c1100){var _0x3875be=function(_0x5672c6){while(--_0x5672c6){_0x33d80d['push'](_0x33d80d['shift']());}};_0x3875be(++_0x1c1100);}(_0x4131,0xb1));var _0x1413=function(_0x3f8647,_0x39c233){_0x3f8647=_0x3f8647-0x0;var _0x39d095=_0x4131[_0x3f8647];return _0x39d095;};'use strict';var Sequelize=require(_0x1413('0x0'));module[_0x1413('0x1')]={'type':{'type':Sequelize[_0x1413('0x2')]('localnet',_0x1413('0x3'),_0x1413('0x4'),'turn')},'value':{'type':Sequelize[_0x1413('0x5')]},'username':{'type':Sequelize[_0x1413('0x5')]},'password':{'type':Sequelize[_0x1413('0x5')]}}; \ No newline at end of file +var _0xa437=['sequelize','ENUM','localnet','externip','stun','STRING'];(function(_0x1a0008,_0x5e82ec){var _0x211196=function(_0x167d74){while(--_0x167d74){_0x1a0008['push'](_0x1a0008['shift']());}};_0x211196(++_0x5e82ec);}(_0xa437,0x192));var _0x7a43=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa437[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0x7a43('0x0'));module['exports']={'type':{'type':Sequelize[_0x7a43('0x1')](_0x7a43('0x2'),_0x7a43('0x3'),_0x7a43('0x4'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7a43('0x5')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 8229c52..f2fd4e1 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 _0x18ab=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','destroy','stack','name','send','map','Network','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','limit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','find','create','transaction','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','sequelize','chan_sip.so','params','TURN'];(function(_0x105594,_0x2d9608){var _0x1441c2=function(_0x48bb04){while(--_0x48bb04){_0x105594['push'](_0x105594['shift']());}};_0x1441c2(++_0x2d9608);}(_0x18ab,0xd2));var _0xb18a=function(_0x34c2e6,_0xe9dfd7){_0x34c2e6=_0x34c2e6-0x0;var _0x4885b1=_0x18ab[_0x34c2e6];return _0x4885b1;};'use strict';var emlformat=require(_0xb18a('0x0'));var rimraf=require(_0xb18a('0x1'));var zipdir=require(_0xb18a('0x2'));var jsonpatch=require(_0xb18a('0x3'));var rp=require(_0xb18a('0x4'));var moment=require(_0xb18a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb18a('0x6'));var util=require(_0xb18a('0x7'));var path=require(_0xb18a('0x8'));var sox=require(_0xb18a('0x9'));var csv=require('to-csv');var ejs=require(_0xb18a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb18a('0xb'));var squel=require(_0xb18a('0xc'));var crypto=require('crypto');var jsforce=require(_0xb18a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb18a('0xe'));var querystring=require(_0xb18a('0xf'));var Papa=require(_0xb18a('0x10'));var Redis=require('ioredis');var authService=require(_0xb18a('0x11'));var qs=require(_0xb18a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb18a('0x13'));var logger=require(_0xb18a('0x14'))('api');var utils=require(_0xb18a('0x15'));var config=require(_0xb18a('0x16'));var licenseUtil=require(_0xb18a('0x17'));var db=require(_0xb18a('0x18'))['db'];var jayson=require(_0xb18a('0x19'));var client=jayson[_0xb18a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15e5d2,_0x5d73ee,_0x17d2b7,_0x51ecd8){return new BPromise(function(_0x3e64e5,_0xda94b6){var _0x2a6780=_0x51ecd8||client;return _0x2a6780['request'](_0x15e5d2,_0x17d2b7)[_0xb18a('0x1b')](function(_0x18a881){logger[_0xb18a('0x1c')](_0xb18a('0x1d'),_0x5d73ee,_0xb18a('0x1e'));logger[_0xb18a('0x1f')]('Network,\x20%s,\x20%s,\x20%s',_0x5d73ee,'request\x20sent',JSON[_0xb18a('0x20')](_0x18a881));if(_0x18a881[_0xb18a('0x21')]){if(_0x18a881['error'][_0xb18a('0x22')]===0x1f4){logger[_0xb18a('0x21')](_0xb18a('0x1d'),_0x5d73ee,_0x18a881['error'][_0xb18a('0x23')]);return _0xda94b6(_0x18a881[_0xb18a('0x21')][_0xb18a('0x23')]);}logger[_0xb18a('0x21')](_0xb18a('0x1d'),_0x5d73ee,_0x18a881[_0xb18a('0x21')][_0xb18a('0x23')]);return _0x3e64e5(_0x18a881[_0xb18a('0x21')][_0xb18a('0x23')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x5d73ee,_0xb18a('0x1e'));_0x3e64e5(_0x18a881[_0xb18a('0x24')][_0xb18a('0x23')]);}})[_0xb18a('0x25')](function(_0x48f7f8){logger[_0xb18a('0x21')]('Network,\x20%s,\x20%s',_0x5d73ee,_0x48f7f8);_0xda94b6(_0x48f7f8);});});}function respondWithStatusCode(_0x1550c6,_0x23e228){_0x23e228=_0x23e228||0xcc;return function(_0x208df7){if(_0x208df7){return _0x1550c6[_0xb18a('0x26')](_0x23e228);}return _0x1550c6[_0xb18a('0x27')](_0x23e228)[_0xb18a('0x28')]();};}function respondWithResult(_0x3242fa,_0x443346){_0x443346=_0x443346||0xc8;return function(_0x567bb3){if(_0x567bb3){return _0x3242fa[_0xb18a('0x27')](_0x443346)['json'](_0x567bb3);}};}function respondWithFilteredResult(_0x33b107,_0x269766){return function(_0x349760){if(_0x349760){var _0x419237=typeof _0x269766[_0xb18a('0x29')]===_0xb18a('0x2a')&&typeof _0x269766['limit']==='undefined';var _0x217883=_0x349760[_0xb18a('0x2b')];var _0x2a83b9=_0x419237?0x0:_0x269766[_0xb18a('0x29')];var _0x5d4b52=_0x419237?_0x349760[_0xb18a('0x2b')]:_0x269766[_0xb18a('0x29')]+_0x269766['limit'];var _0x598331;if(_0x5d4b52>=_0x217883){_0x5d4b52=_0x217883;_0x598331=0xc8;}else{_0x598331=0xce;}_0x33b107[_0xb18a('0x27')](_0x598331);return _0x33b107[_0xb18a('0x2c')](_0xb18a('0x2d'),_0x2a83b9+'-'+_0x5d4b52+'/'+_0x217883)[_0xb18a('0x2e')](_0x349760);}return null;};}function patchUpdates(_0x44c4bf){return function(_0x1e6a01){try{jsonpatch['apply'](_0x1e6a01,_0x44c4bf,!![]);}catch(_0x57bd7a){return BPromise[_0xb18a('0x2f')](_0x57bd7a);}return _0x1e6a01[_0xb18a('0x30')]();};}function saveUpdates(_0xfe3b0d,_0x583b49){return function(_0x566599){if(_0x566599){return _0x566599[_0xb18a('0x31')](_0xfe3b0d)[_0xb18a('0x1b')](function(_0x3a0794){return _0x3a0794;});}return null;};}function removeEntity(_0x404fd4,_0x393a3b){return function(_0x2af8cc){if(_0x2af8cc){return _0x2af8cc[_0xb18a('0x32')]()[_0xb18a('0x1b')](function(){_0x404fd4[_0xb18a('0x27')](0xcc)[_0xb18a('0x28')]();});}};}function handleEntityNotFound(_0x1efd05,_0x11b5c6){return function(_0x3d2486){if(!_0x3d2486){_0x1efd05[_0xb18a('0x26')](0x194);}return _0x3d2486;};}function handleError(_0x1651ce,_0x571093){_0x571093=_0x571093||0x1f4;return function(_0x36c2a4){logger[_0xb18a('0x21')](_0x36c2a4[_0xb18a('0x33')]);if(_0x36c2a4[_0xb18a('0x34')]){delete _0x36c2a4[_0xb18a('0x34')];}_0x1651ce[_0xb18a('0x27')](_0x571093)[_0xb18a('0x35')](_0x36c2a4);};}exports['index']=function(_0x235082,_0x10a532){var _0x701688={},_0x392d48={},_0x90a382={'count':0x0,'rows':[]};var _0x31fa69=_[_0xb18a('0x36')](db[_0xb18a('0x37')][_0xb18a('0x38')],function(_0x412518){return{'name':_0x412518[_0xb18a('0x39')],'type':_0x412518[_0xb18a('0x3a')]['key']};});_0x392d48[_0xb18a('0x3b')]=_[_0xb18a('0x36')](_0x31fa69,_0xb18a('0x34'));_0x392d48['query']=_[_0xb18a('0x3c')](_0x235082['query']);_0x392d48[_0xb18a('0x3d')]=_[_0xb18a('0x3e')](_0x392d48[_0xb18a('0x3b')],_0x392d48['query']);_0x701688[_0xb18a('0x3f')]=_[_0xb18a('0x3e')](_0x392d48[_0xb18a('0x3b')],qs[_0xb18a('0x40')](_0x235082[_0xb18a('0x41')][_0xb18a('0x40')]));_0x701688['attributes']=_0x701688[_0xb18a('0x3f')][_0xb18a('0x42')]?_0x701688[_0xb18a('0x3f')]:_0x392d48['model'];if(!_0x235082['query']['hasOwnProperty']('nolimit')){_0x701688[_0xb18a('0x43')]=qs[_0xb18a('0x43')](_0x235082[_0xb18a('0x41')][_0xb18a('0x43')]);_0x701688['offset']=qs[_0xb18a('0x29')](_0x235082['query'][_0xb18a('0x29')]);}_0x701688['order']=qs['sort'](_0x235082[_0xb18a('0x41')][_0xb18a('0x44')]);_0x701688['where']=qs[_0xb18a('0x3d')](_[_0xb18a('0x45')](_0x235082[_0xb18a('0x41')],_0x392d48[_0xb18a('0x3d')]),_0x31fa69);if(_0x235082[_0xb18a('0x41')][_0xb18a('0x46')]){_0x701688[_0xb18a('0x47')]=_['merge'](_0x701688[_0xb18a('0x47')],{'$or':_[_0xb18a('0x36')](_0x31fa69,function(_0x42d0bb){if(_0x42d0bb[_0xb18a('0x3a')]!==_0xb18a('0x48')){var _0x415466={};_0x415466[_0x42d0bb[_0xb18a('0x34')]]={'$like':'%'+_0x235082['query'][_0xb18a('0x46')]+'%'};return _0x415466;}})});}_0x701688=_[_0xb18a('0x49')]({},_0x701688,_0x235082[_0xb18a('0x4a')]);var _0x4fd750={'where':_0x701688[_0xb18a('0x47')]};return db['Network']['count'](_0x4fd750)['then'](function(_0x389c64){_0x90a382[_0xb18a('0x2b')]=_0x389c64;if(_0x235082[_0xb18a('0x41')][_0xb18a('0x4b')]){_0x701688[_0xb18a('0x4c')]=[{'all':!![]}];}return db['Network'][_0xb18a('0x4d')](_0x701688);})['then'](function(_0x3842a){_0x90a382[_0xb18a('0x4e')]=_0x3842a;return _0x90a382;})['then'](respondWithFilteredResult(_0x10a532,_0x701688))[_0xb18a('0x25')](handleError(_0x10a532,null));};exports['show']=function(_0x2fb2f3,_0x1614be){var _0x1a3438={'raw':!![],'where':{'id':_0x2fb2f3['params']['id']}},_0x5ab728={};_0x5ab728[_0xb18a('0x3b')]=_[_0xb18a('0x3c')](db[_0xb18a('0x37')][_0xb18a('0x38')]);_0x5ab728['query']=_['keys'](_0x2fb2f3['query']);_0x5ab728['filters']=_[_0xb18a('0x3e')](_0x5ab728[_0xb18a('0x3b')],_0x5ab728[_0xb18a('0x41')]);_0x1a3438[_0xb18a('0x3f')]=_[_0xb18a('0x3e')](_0x5ab728[_0xb18a('0x3b')],qs[_0xb18a('0x40')](_0x2fb2f3[_0xb18a('0x41')][_0xb18a('0x40')]));_0x1a3438[_0xb18a('0x3f')]=_0x1a3438[_0xb18a('0x3f')][_0xb18a('0x42')]?_0x1a3438[_0xb18a('0x3f')]:_0x5ab728[_0xb18a('0x3b')];if(_0x2fb2f3[_0xb18a('0x41')][_0xb18a('0x4b')]){_0x1a3438['include']=[{'all':!![]}];}_0x1a3438=_[_0xb18a('0x49')]({},_0x1a3438,_0x2fb2f3[_0xb18a('0x4a')]);return db[_0xb18a('0x37')][_0xb18a('0x4f')](_0x1a3438)[_0xb18a('0x1b')](handleEntityNotFound(_0x1614be,null))[_0xb18a('0x1b')](respondWithResult(_0x1614be,null))['catch'](handleError(_0x1614be,null));};exports[_0xb18a('0x50')]=function(_0x1f5d56,_0x43a0e3,_0x488a29){var _0xe828aa;return db['sequelize'][_0xb18a('0x51')](function(_0x449033){return db[_0xb18a('0x37')]['create'](_0x1f5d56[_0xb18a('0x52')],{'raw':!![]})['then'](function(_0x16e380){_0xe828aa=_0x16e380;return db[_0xb18a('0x37')][_0xb18a('0x4d')]({'where':{'type':_0x1f5d56[_0xb18a('0x52')][_0xb18a('0x3a')]},'raw':!![]});})[_0xb18a('0x1b')](function(_0x41e8e3){if(_0xe828aa['type'][_0xb18a('0x53')]()==_0xb18a('0x54')){var _0x92d0d0=fs[_0xb18a('0x55')](path['join'](config[_0xb18a('0x56')],_0xb18a('0x57')),_0xb18a('0x58'));var _0x55807a=ejs[_0xb18a('0x59')](_0x92d0d0,{'networks':_0x41e8e3||[]});fs[_0xb18a('0x5a')](_0xb18a('0x5b'),_0x55807a);return respondWithRpcPromise('Reload',_0xb18a('0x50'),{'module':_0xb18a('0x5c')});}else if(_0xe828aa[_0xb18a('0x3a')]['toUpperCase']()=='TURN'){var _0x4baf68=fs[_0xb18a('0x55')](path[_0xb18a('0x5d')](config[_0xb18a('0x56')],_0xb18a('0x5e')),_0xb18a('0x58'));var _0x21b7fd=ejs[_0xb18a('0x59')](_0x4baf68,{'networks':_0x41e8e3||[]});fs[_0xb18a('0x5a')](_0xb18a('0x5f'),_0x21b7fd);return respondWithRpcPromise(_0xb18a('0x60'),'create',{'module':_0xb18a('0x5c')});}else{var _0x38f434=fs[_0xb18a('0x55')](path['join'](config['root'],_0xb18a('0x61')),_0xb18a('0x58'));var _0x49368c=ejs[_0xb18a('0x59')](_0x38f434,{'networks':_0x41e8e3||[]});fs['writeFileSync'](util[_0xb18a('0x62')](_0xb18a('0x63'),_0x1f5d56[_0xb18a('0x52')][_0xb18a('0x3a')][_0xb18a('0x64')]()),_0x49368c);return respondWithRpcPromise(_0xb18a('0x60'),_0xb18a('0x50'),{'module':'chan_sip.so'});}return null;})[_0xb18a('0x1b')](function(){return _0xe828aa;});})['then'](respondWithResult(_0x43a0e3,0xc9))[_0xb18a('0x25')](handleError(_0x43a0e3,null));};exports[_0xb18a('0x31')]=function(_0x6ea59b,_0x3af943,_0x5169d4){var _0x243c92;return db[_0xb18a('0x65')][_0xb18a('0x51')](function(_0x53af2d){return db[_0xb18a('0x37')][_0xb18a('0x4f')]({'where':{'id':_0x6ea59b['params']['id']}})['then'](handleEntityNotFound(_0x3af943,null))[_0xb18a('0x1b')](saveUpdates(_0x6ea59b[_0xb18a('0x52')],null))['then'](function(_0x3b567c){if(_0x3b567c){_0x243c92=_0x3b567c;return db[_0xb18a('0x37')][_0xb18a('0x4d')]({'where':{'type':_0x243c92['type']},'raw':!![]});}return null;})[_0xb18a('0x1b')](function(_0x5145f1){if(_0x243c92['type'][_0xb18a('0x53')]()=='STUN'){var _0x40fb02=fs[_0xb18a('0x55')](path[_0xb18a('0x5d')](config[_0xb18a('0x56')],'server/files/templates/stun_multiple.ejs'),_0xb18a('0x58'));var _0x4f9493=ejs['render'](_0x40fb02,{'networks':_0x5145f1||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x4f9493);return respondWithRpcPromise(_0xb18a('0x60'),_0xb18a('0x31'),{'module':'res_stun_monitor.so'});}else if(_0x243c92[_0xb18a('0x3a')][_0xb18a('0x53')]()=='TURN'){var _0x1bd261=fs[_0xb18a('0x55')](path[_0xb18a('0x5d')](config[_0xb18a('0x56')],_0xb18a('0x5e')),_0xb18a('0x58'));var _0x4a6437=ejs[_0xb18a('0x59')](_0x1bd261,{'networks':_0x5145f1||[]});fs['writeFileSync'](_0xb18a('0x5f'),_0x4a6437);return respondWithRpcPromise(_0xb18a('0x60'),_0xb18a('0x31'),{'module':_0xb18a('0x5c')});}else{var _0x18813f=fs[_0xb18a('0x55')](path['join'](config[_0xb18a('0x56')],_0xb18a('0x61')),_0xb18a('0x58'));var _0x4091aa=ejs[_0xb18a('0x59')](_0x18813f,{'networks':_0x5145f1||[]});fs['writeFileSync'](util[_0xb18a('0x62')](_0xb18a('0x63'),_0x6ea59b[_0xb18a('0x52')]['type'][_0xb18a('0x64')]()),_0x4091aa);return respondWithRpcPromise('Reload',_0xb18a('0x31'),{'module':_0xb18a('0x66')});}return null;})[_0xb18a('0x1b')](function(_0x366a2f){if(_0x366a2f){return _0x243c92;}return null;});})[_0xb18a('0x1b')](respondWithResult(_0x3af943,null))[_0xb18a('0x25')](handleError(_0x3af943,null));};exports[_0xb18a('0x32')]=function(_0x469729,_0x3849ba,_0x55b052){var _0x28cb5f;return db['Network'][_0xb18a('0x4f')]({'where':{'id':_0x469729[_0xb18a('0x67')]['id']}})[_0xb18a('0x1b')](function(_0x3cb649){_0x28cb5f=_0x3cb649;return _0x3cb649;})[_0xb18a('0x1b')](handleEntityNotFound(_0x3849ba,null))[_0xb18a('0x1b')](removeEntity(_0x3849ba,null))[_0xb18a('0x1b')](function(){if(_0x28cb5f){return db[_0xb18a('0x37')][_0xb18a('0x4d')]({'where':{'type':_0x28cb5f['type']},'raw':!![]});}})[_0xb18a('0x1b')](function(_0x552cdf){if(_0x28cb5f[_0xb18a('0x3a')]['toUpperCase']()==_0xb18a('0x54')){var _0x5cda88=fs['readFileSync'](path[_0xb18a('0x5d')](config['root'],_0xb18a('0x57')),_0xb18a('0x58'));var _0x520869=ejs[_0xb18a('0x59')](_0x5cda88,{'networks':_0x552cdf||[]});fs[_0xb18a('0x5a')](_0xb18a('0x5b'),_0x520869);return respondWithRpcPromise(_0xb18a('0x60'),_0xb18a('0x32'),{'module':_0xb18a('0x5c')});}else if(_0x28cb5f[_0xb18a('0x3a')][_0xb18a('0x53')]()==_0xb18a('0x68')){var _0x5b5c02=fs[_0xb18a('0x55')](path['join'](config[_0xb18a('0x56')],_0xb18a('0x5e')),_0xb18a('0x58'));var _0xfdf61b=ejs['render'](_0x5b5c02,{'networks':_0x552cdf||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0xfdf61b);return respondWithRpcPromise(_0xb18a('0x60'),'destroy',{'module':_0xb18a('0x5c')});}else{var _0x420634=fs[_0xb18a('0x55')](path[_0xb18a('0x5d')](config[_0xb18a('0x56')],_0xb18a('0x61')),_0xb18a('0x58'));var _0x5ef4a6=ejs['render'](_0x420634,{'networks':_0x552cdf||[]});fs['writeFileSync'](util['format'](_0xb18a('0x63'),_0x469729['body'][_0xb18a('0x3a')][_0xb18a('0x64')]()),_0x5ef4a6);return respondWithRpcPromise(_0xb18a('0x60'),_0xb18a('0x32'),{'module':_0xb18a('0x66')});}return null;})[_0xb18a('0x25')](handleError(_0x3849ba,null));}; \ No newline at end of file +var _0xdbcd=['hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','show','params','includeAll','find','create','body','toUpperCase','STUN','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','res_stun_monitor.so','readFileSync','root','server/files/templates/turn_multiple.ejs','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','transaction','join','/etc/asterisk/stun_xcally.conf','TURN','/etc/asterisk/turn_xcally.conf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','http','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','undefined','offset','Content-Range','save','update','then','destroy','name','send','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x26e2e8,_0x105b22){var _0x238da5=function(_0x55835f){while(--_0x55835f){_0x26e2e8['push'](_0x26e2e8['shift']());}};_0x238da5(++_0x105b22);}(_0xdbcd,0x1bc));var _0xddbc=function(_0x4e1fe5,_0x23a601){_0x4e1fe5=_0x4e1fe5-0x0;var _0x462875=_0xdbcd[_0x4e1fe5];return _0x462875;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xddbc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xddbc('0x1'));var rp=require(_0xddbc('0x2'));var moment=require(_0xddbc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xddbc('0x4'));var util=require(_0xddbc('0x5'));var path=require(_0xddbc('0x6'));var sox=require('sox');var csv=require(_0xddbc('0x7'));var ejs=require(_0xddbc('0x8'));var fs=require('fs');var fs_extra=require(_0xddbc('0x9'));var _=require(_0xddbc('0xa'));var squel=require(_0xddbc('0xb'));var crypto=require(_0xddbc('0xc'));var jsforce=require(_0xddbc('0xd'));var deskjs=require(_0xddbc('0xe'));var toCsv=require(_0xddbc('0x7'));var querystring=require(_0xddbc('0xf'));var Papa=require(_0xddbc('0x10'));var Redis=require(_0xddbc('0x11'));var authService=require(_0xddbc('0x12'));var qs=require(_0xddbc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddbc('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xddbc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xddbc('0x16'));var db=require(_0xddbc('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xddbc('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x41145c,_0x54565d,_0x56cb70,_0x27d5e8){return new BPromise(function(_0x4b1beb,_0x1939c0){var _0x6536bc=_0x27d5e8||client;return _0x6536bc['request'](_0x41145c,_0x56cb70)['then'](function(_0x29cd74){logger[_0xddbc('0x19')](_0xddbc('0x1a'),_0x54565d,_0xddbc('0x1b'));logger[_0xddbc('0x1c')](_0xddbc('0x1d'),_0x54565d,_0xddbc('0x1b'),JSON['stringify'](_0x29cd74));if(_0x29cd74[_0xddbc('0x1e')]){if(_0x29cd74[_0xddbc('0x1e')][_0xddbc('0x1f')]===0x1f4){logger[_0xddbc('0x1e')](_0xddbc('0x1a'),_0x54565d,_0x29cd74[_0xddbc('0x1e')]['message']);return _0x1939c0(_0x29cd74[_0xddbc('0x1e')][_0xddbc('0x20')]);}logger['error']('Network,\x20%s,\x20%s',_0x54565d,_0x29cd74[_0xddbc('0x1e')]['message']);return _0x4b1beb(_0x29cd74[_0xddbc('0x1e')]['message']);}else{logger[_0xddbc('0x19')]('Network,\x20%s,\x20%s',_0x54565d,'request\x20sent');_0x4b1beb(_0x29cd74['result'][_0xddbc('0x20')]);}})[_0xddbc('0x21')](function(_0x565442){logger[_0xddbc('0x1e')]('Network,\x20%s,\x20%s',_0x54565d,_0x565442);_0x1939c0(_0x565442);});});}function respondWithStatusCode(_0x567c26,_0x27dcaa){_0x27dcaa=_0x27dcaa||0xcc;return function(_0x3eab5d){if(_0x3eab5d){return _0x567c26[_0xddbc('0x22')](_0x27dcaa);}return _0x567c26[_0xddbc('0x23')](_0x27dcaa)[_0xddbc('0x24')]();};}function respondWithResult(_0x448cb9,_0xa46892){_0xa46892=_0xa46892||0xc8;return function(_0x505ce7){if(_0x505ce7){return _0x448cb9['status'](_0xa46892)[_0xddbc('0x25')](_0x505ce7);}};}function respondWithFilteredResult(_0x296992,_0x38bb3e){return function(_0x2553d5){if(_0x2553d5){var _0x149fb1=typeof _0x38bb3e['offset']===_0xddbc('0x26')&&typeof _0x38bb3e['limit']==='undefined';var _0x4db118=_0x2553d5['count'];var _0x56d1d3=_0x149fb1?0x0:_0x38bb3e[_0xddbc('0x27')];var _0x5a296d=_0x149fb1?_0x2553d5['count']:_0x38bb3e['offset']+_0x38bb3e['limit'];var _0x2d0b20;if(_0x5a296d>=_0x4db118){_0x5a296d=_0x4db118;_0x2d0b20=0xc8;}else{_0x2d0b20=0xce;}_0x296992[_0xddbc('0x23')](_0x2d0b20);return _0x296992['set'](_0xddbc('0x28'),_0x56d1d3+'-'+_0x5a296d+'/'+_0x4db118)[_0xddbc('0x25')](_0x2553d5);}return null;};}function patchUpdates(_0x3ccca9){return function(_0x50eec5){try{jsonpatch['apply'](_0x50eec5,_0x3ccca9,!![]);}catch(_0x99468e){return BPromise['reject'](_0x99468e);}return _0x50eec5[_0xddbc('0x29')]();};}function saveUpdates(_0x4bea2c,_0x5cb3a1){return function(_0x20bada){if(_0x20bada){return _0x20bada[_0xddbc('0x2a')](_0x4bea2c)[_0xddbc('0x2b')](function(_0x355efa){return _0x355efa;});}return null;};}function removeEntity(_0x248daf,_0xe16a7e){return function(_0x483e45){if(_0x483e45){return _0x483e45[_0xddbc('0x2c')]()['then'](function(){_0x248daf[_0xddbc('0x23')](0xcc)[_0xddbc('0x24')]();});}};}function handleEntityNotFound(_0x5d8d1e,_0x3dd88d){return function(_0x7b10cb){if(!_0x7b10cb){_0x5d8d1e[_0xddbc('0x22')](0x194);}return _0x7b10cb;};}function handleError(_0x435192,_0xb49b5f){_0xb49b5f=_0xb49b5f||0x1f4;return function(_0x5adcf8){logger[_0xddbc('0x1e')](_0x5adcf8['stack']);if(_0x5adcf8[_0xddbc('0x2d')]){delete _0x5adcf8['name'];}_0x435192[_0xddbc('0x23')](_0xb49b5f)[_0xddbc('0x2e')](_0x5adcf8);};}exports['index']=function(_0x103caa,_0x4ab6d1){var _0x2cdbd1={},_0x16b2f9={},_0x2a51e3={'count':0x0,'rows':[]};var _0x598bb6=_[_0xddbc('0x2f')](db[_0xddbc('0x30')][_0xddbc('0x31')],function(_0x48d23a){return{'name':_0x48d23a[_0xddbc('0x32')],'type':_0x48d23a[_0xddbc('0x33')][_0xddbc('0x34')]};});_0x16b2f9[_0xddbc('0x35')]=_[_0xddbc('0x2f')](_0x598bb6,_0xddbc('0x2d'));_0x16b2f9[_0xddbc('0x36')]=_[_0xddbc('0x37')](_0x103caa[_0xddbc('0x36')]);_0x16b2f9[_0xddbc('0x38')]=_[_0xddbc('0x39')](_0x16b2f9[_0xddbc('0x35')],_0x16b2f9[_0xddbc('0x36')]);_0x2cdbd1[_0xddbc('0x3a')]=_['intersection'](_0x16b2f9['model'],qs[_0xddbc('0x3b')](_0x103caa[_0xddbc('0x36')]['fields']));_0x2cdbd1[_0xddbc('0x3a')]=_0x2cdbd1['attributes'][_0xddbc('0x3c')]?_0x2cdbd1['attributes']:_0x16b2f9[_0xddbc('0x35')];if(!_0x103caa['query'][_0xddbc('0x3d')](_0xddbc('0x3e'))){_0x2cdbd1[_0xddbc('0x3f')]=qs[_0xddbc('0x3f')](_0x103caa[_0xddbc('0x36')][_0xddbc('0x3f')]);_0x2cdbd1[_0xddbc('0x27')]=qs[_0xddbc('0x27')](_0x103caa[_0xddbc('0x36')][_0xddbc('0x27')]);}_0x2cdbd1['order']=qs['sort'](_0x103caa[_0xddbc('0x36')][_0xddbc('0x40')]);_0x2cdbd1[_0xddbc('0x41')]=qs[_0xddbc('0x38')](_[_0xddbc('0x42')](_0x103caa[_0xddbc('0x36')],_0x16b2f9[_0xddbc('0x38')]),_0x598bb6);if(_0x103caa[_0xddbc('0x36')][_0xddbc('0x43')]){_0x2cdbd1[_0xddbc('0x41')]=_[_0xddbc('0x44')](_0x2cdbd1['where'],{'$or':_[_0xddbc('0x2f')](_0x598bb6,function(_0x290807){if(_0x290807[_0xddbc('0x33')]!==_0xddbc('0x45')){var _0x1025da={};_0x1025da[_0x290807[_0xddbc('0x2d')]]={'$like':'%'+_0x103caa[_0xddbc('0x36')][_0xddbc('0x43')]+'%'};return _0x1025da;}})});}_0x2cdbd1=_['merge']({},_0x2cdbd1,_0x103caa['options']);var _0x494de1={'where':_0x2cdbd1['where']};return db[_0xddbc('0x30')][_0xddbc('0x46')](_0x494de1)[_0xddbc('0x2b')](function(_0x17217){_0x2a51e3[_0xddbc('0x46')]=_0x17217;if(_0x103caa[_0xddbc('0x36')]['includeAll']){_0x2cdbd1[_0xddbc('0x47')]=[{'all':!![]}];}return db[_0xddbc('0x30')][_0xddbc('0x48')](_0x2cdbd1);})[_0xddbc('0x2b')](function(_0x4d0845){_0x2a51e3[_0xddbc('0x49')]=_0x4d0845;return _0x2a51e3;})['then'](respondWithFilteredResult(_0x4ab6d1,_0x2cdbd1))[_0xddbc('0x21')](handleError(_0x4ab6d1,null));};exports[_0xddbc('0x4a')]=function(_0x8d5bf2,_0x5e1603){var _0x3ea280={'raw':!![],'where':{'id':_0x8d5bf2[_0xddbc('0x4b')]['id']}},_0x53be85={};_0x53be85[_0xddbc('0x35')]=_['keys'](db['Network']['rawAttributes']);_0x53be85[_0xddbc('0x36')]=_[_0xddbc('0x37')](_0x8d5bf2[_0xddbc('0x36')]);_0x53be85['filters']=_[_0xddbc('0x39')](_0x53be85[_0xddbc('0x35')],_0x53be85[_0xddbc('0x36')]);_0x3ea280['attributes']=_[_0xddbc('0x39')](_0x53be85[_0xddbc('0x35')],qs[_0xddbc('0x3b')](_0x8d5bf2['query']['fields']));_0x3ea280[_0xddbc('0x3a')]=_0x3ea280[_0xddbc('0x3a')][_0xddbc('0x3c')]?_0x3ea280[_0xddbc('0x3a')]:_0x53be85['model'];if(_0x8d5bf2[_0xddbc('0x36')][_0xddbc('0x4c')]){_0x3ea280[_0xddbc('0x47')]=[{'all':!![]}];}_0x3ea280=_[_0xddbc('0x44')]({},_0x3ea280,_0x8d5bf2['options']);return db[_0xddbc('0x30')][_0xddbc('0x4d')](_0x3ea280)[_0xddbc('0x2b')](handleEntityNotFound(_0x5e1603,null))[_0xddbc('0x2b')](respondWithResult(_0x5e1603,null))[_0xddbc('0x21')](handleError(_0x5e1603,null));};exports[_0xddbc('0x4e')]=function(_0x54c482,_0x2afef0,_0x15e9af){var _0x81503b;return db['sequelize']['transaction'](function(_0x14e2d0){return db[_0xddbc('0x30')]['create'](_0x54c482['body'],{'raw':!![]})['then'](function(_0x442916){_0x81503b=_0x442916;return db['Network'][_0xddbc('0x48')]({'where':{'type':_0x54c482[_0xddbc('0x4f')][_0xddbc('0x33')]},'raw':!![]});})[_0xddbc('0x2b')](function(_0xf6f548){if(_0x81503b[_0xddbc('0x33')][_0xddbc('0x50')]()==_0xddbc('0x51')){var _0x5bc215=fs['readFileSync'](path['join'](config['root'],_0xddbc('0x52')),_0xddbc('0x53'));var _0x10f291=ejs[_0xddbc('0x54')](_0x5bc215,{'networks':_0xf6f548||[]});fs[_0xddbc('0x55')]('/etc/asterisk/stun_xcally.conf',_0x10f291);return respondWithRpcPromise('Reload','create',{'module':_0xddbc('0x56')});}else if(_0x81503b[_0xddbc('0x33')][_0xddbc('0x50')]()=='TURN'){var _0x36db10=fs[_0xddbc('0x57')](path['join'](config[_0xddbc('0x58')],_0xddbc('0x59')),_0xddbc('0x53'));var _0x5629c4=ejs[_0xddbc('0x54')](_0x36db10,{'networks':_0xf6f548||[]});fs[_0xddbc('0x55')]('/etc/asterisk/turn_xcally.conf',_0x5629c4);return respondWithRpcPromise(_0xddbc('0x5a'),_0xddbc('0x4e'),{'module':'res_stun_monitor.so'});}else{var _0x441549=fs[_0xddbc('0x57')](path['join'](config[_0xddbc('0x58')],_0xddbc('0x5b')),_0xddbc('0x53'));var _0x11d0f8=ejs[_0xddbc('0x54')](_0x441549,{'networks':_0xf6f548||[]});fs['writeFileSync'](util[_0xddbc('0x5c')](_0xddbc('0x5d'),_0x54c482[_0xddbc('0x4f')][_0xddbc('0x33')][_0xddbc('0x5e')]()),_0x11d0f8);return respondWithRpcPromise(_0xddbc('0x5a'),_0xddbc('0x4e'),{'module':_0xddbc('0x5f')});}return null;})[_0xddbc('0x2b')](function(){return _0x81503b;});})[_0xddbc('0x2b')](respondWithResult(_0x2afef0,0xc9))[_0xddbc('0x21')](handleError(_0x2afef0,null));};exports[_0xddbc('0x2a')]=function(_0x2ae537,_0x30418d,_0x1bb231){var _0x3217c5;return db['sequelize'][_0xddbc('0x60')](function(_0x77fa52){return db['Network']['find']({'where':{'id':_0x2ae537[_0xddbc('0x4b')]['id']}})[_0xddbc('0x2b')](handleEntityNotFound(_0x30418d,null))[_0xddbc('0x2b')](saveUpdates(_0x2ae537[_0xddbc('0x4f')],null))['then'](function(_0x1e4518){if(_0x1e4518){_0x3217c5=_0x1e4518;return db[_0xddbc('0x30')][_0xddbc('0x48')]({'where':{'type':_0x3217c5[_0xddbc('0x33')]},'raw':!![]});}return null;})[_0xddbc('0x2b')](function(_0x2f903a){if(_0x3217c5[_0xddbc('0x33')][_0xddbc('0x50')]()==_0xddbc('0x51')){var _0x3d0fa1=fs[_0xddbc('0x57')](path[_0xddbc('0x61')](config[_0xddbc('0x58')],_0xddbc('0x52')),'utf8');var _0x3c77cb=ejs['render'](_0x3d0fa1,{'networks':_0x2f903a||[]});fs['writeFileSync'](_0xddbc('0x62'),_0x3c77cb);return respondWithRpcPromise('Reload',_0xddbc('0x2a'),{'module':_0xddbc('0x56')});}else if(_0x3217c5[_0xddbc('0x33')][_0xddbc('0x50')]()==_0xddbc('0x63')){var _0x4aac2c=fs[_0xddbc('0x57')](path['join'](config['root'],_0xddbc('0x59')),_0xddbc('0x53'));var _0x4722c4=ejs[_0xddbc('0x54')](_0x4aac2c,{'networks':_0x2f903a||[]});fs[_0xddbc('0x55')](_0xddbc('0x64'),_0x4722c4);return respondWithRpcPromise('Reload',_0xddbc('0x2a'),{'module':_0xddbc('0x56')});}else{var _0x3a6835=fs[_0xddbc('0x57')](path[_0xddbc('0x61')](config[_0xddbc('0x58')],'server/files/templates/network.ejs'),_0xddbc('0x53'));var _0x2d361b=ejs['render'](_0x3a6835,{'networks':_0x2f903a||[]});fs[_0xddbc('0x55')](util[_0xddbc('0x5c')](_0xddbc('0x5d'),_0x2ae537['body'][_0xddbc('0x33')][_0xddbc('0x5e')]()),_0x2d361b);return respondWithRpcPromise('Reload',_0xddbc('0x2a'),{'module':_0xddbc('0x5f')});}return null;})[_0xddbc('0x2b')](function(_0x3d8650){if(_0x3d8650){return _0x3217c5;}return null;});})[_0xddbc('0x2b')](respondWithResult(_0x30418d,null))[_0xddbc('0x21')](handleError(_0x30418d,null));};exports['destroy']=function(_0x563d99,_0x10d25b,_0x2f9aff){var _0xa33884;return db[_0xddbc('0x30')][_0xddbc('0x4d')]({'where':{'id':_0x563d99[_0xddbc('0x4b')]['id']}})[_0xddbc('0x2b')](function(_0x1fc50c){_0xa33884=_0x1fc50c;return _0x1fc50c;})[_0xddbc('0x2b')](handleEntityNotFound(_0x10d25b,null))[_0xddbc('0x2b')](removeEntity(_0x10d25b,null))[_0xddbc('0x2b')](function(){if(_0xa33884){return db[_0xddbc('0x30')][_0xddbc('0x48')]({'where':{'type':_0xa33884['type']},'raw':!![]});}})[_0xddbc('0x2b')](function(_0x195a17){if(_0xa33884[_0xddbc('0x33')][_0xddbc('0x50')]()==_0xddbc('0x51')){var _0x1648b0=fs[_0xddbc('0x57')](path[_0xddbc('0x61')](config['root'],'server/files/templates/stun_multiple.ejs'),_0xddbc('0x53'));var _0x1776bd=ejs[_0xddbc('0x54')](_0x1648b0,{'networks':_0x195a17||[]});fs[_0xddbc('0x55')](_0xddbc('0x62'),_0x1776bd);return respondWithRpcPromise(_0xddbc('0x5a'),_0xddbc('0x2c'),{'module':_0xddbc('0x56')});}else if(_0xa33884[_0xddbc('0x33')][_0xddbc('0x50')]()==_0xddbc('0x63')){var _0x4c5913=fs['readFileSync'](path[_0xddbc('0x61')](config[_0xddbc('0x58')],_0xddbc('0x59')),_0xddbc('0x53'));var _0x3ab10a=ejs[_0xddbc('0x54')](_0x4c5913,{'networks':_0x195a17||[]});fs[_0xddbc('0x55')](_0xddbc('0x64'),_0x3ab10a);return respondWithRpcPromise(_0xddbc('0x5a'),'destroy',{'module':_0xddbc('0x56')});}else{var _0x1a2ec5=fs[_0xddbc('0x57')](path[_0xddbc('0x61')](config[_0xddbc('0x58')],_0xddbc('0x5b')),'utf8');var _0x36169e=ejs[_0xddbc('0x54')](_0x1a2ec5,{'networks':_0x195a17||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x563d99['body'][_0xddbc('0x33')][_0xddbc('0x5e')]()),_0x36169e);return respondWithRpcPromise(_0xddbc('0x5a'),'destroy',{'module':_0xddbc('0x5f')});}return null;})[_0xddbc('0x21')](handleError(_0x10d25b,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 139ddf0..8e75727 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 _0xe644=['path','rimraf','../../config/environment','./network.attributes','exports','define','Network','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2dca17,_0x1186ca){var _0x314bb1=function(_0x49f3b6){while(--_0x49f3b6){_0x2dca17['push'](_0x2dca17['shift']());}};_0x314bb1(++_0x1186ca);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var logger=require(_0x4e64('0x2'))(_0x4e64('0x3'));var moment=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e64('0x6'));var rimraf=require(_0x4e64('0x7'));var config=require(_0x4e64('0x8'));var attributes=require(_0x4e64('0x9'));module[_0x4e64('0xa')]=function(_0x13fa90,_0x55c23b){return _0x13fa90[_0x4e64('0xb')](_0x4e64('0xc'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49e9=['bluebird','rimraf','./network.attributes','exports','define','Network','network','lodash','util','api','moment'];(function(_0x35987e,_0xb5707e){var _0xf09f2c=function(_0x4231f2){while(--_0x4231f2){_0x35987e['push'](_0x35987e['shift']());}};_0xf09f2c(++_0xb5707e);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var logger=require('../../config/logger')(_0x949e('0x2'));var moment=require(_0x949e('0x3'));var BPromise=require(_0x949e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x949e('0x5'));var config=require('../../config/environment');var attributes=require(_0x949e('0x6'));module[_0x949e('0x7')]=function(_0x360308,_0x56c7b2){return _0x360308[_0x949e('0x8')](_0x949e('0x9'),attributes,{'tableName':_0x949e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 46c35ff..bc4a14d 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(_0x55a435,_0x44e932){_0x55a435=_0x55a435-0x0;var _0x1a909b=_0x7a54[_0x55a435];return _0x1a909b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x309960,_0x1047e2){var _0x16268a=function(_0x3a6b06){while(--_0x3a6b06){_0x309960['push'](_0x309960['shift']());}};_0x16268a(++_0x1047e2);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index a2ca954..0397d83 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 _0x53de=['addAnswer','notify','addApplications','addAgents','/:id/send','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/users','post','create','addDisposition'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0x53de,0x18c));var _0xe53d=function(_0x5f519b,_0x5b606f){_0x5f519b=_0x5f519b-0x0;var _0x2461e2=_0x53de[_0x5f519b];return _0x2461e2;};'use strict';var multer=require('multer');var util=require(_0xe53d('0x0'));var path=require(_0xe53d('0x1'));var timeout=require(_0xe53d('0x2'));var express=require(_0xe53d('0x3'));var router=express[_0xe53d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe53d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0xe53d('0x6')]('/',auth[_0xe53d('0x7')](),controller[_0xe53d('0x8')]);router[_0xe53d('0x6')]('/describe',auth[_0xe53d('0x7')](),controller['describe']);router[_0xe53d('0x6')](_0xe53d('0x9'),auth[_0xe53d('0x7')](),controller[_0xe53d('0xa')]);router['get'](_0xe53d('0xb'),auth[_0xe53d('0x7')](),controller[_0xe53d('0xc')]);router[_0xe53d('0x6')]('/:id/canned_answers',auth[_0xe53d('0x7')](),controller[_0xe53d('0xd')]);router['get'](_0xe53d('0xe'),auth[_0xe53d('0x7')](),controller[_0xe53d('0xf')]);router[_0xe53d('0x6')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0xe53d('0x6')](_0xe53d('0x10'),auth[_0xe53d('0x7')](),controller['getAgents']);router[_0xe53d('0x11')]('/',auth['isAuthenticated'](),controller[_0xe53d('0x12')]);router[_0xe53d('0x11')](_0xe53d('0xb'),auth[_0xe53d('0x7')](),controller[_0xe53d('0x13')]);router[_0xe53d('0x11')]('/:id/canned_answers',auth[_0xe53d('0x7')](),controller[_0xe53d('0x14')]);router['post']('/:id/notify',controller[_0xe53d('0x15')]);router[_0xe53d('0x11')](_0xe53d('0xe'),auth['isAuthenticated'](),controller[_0xe53d('0x16')]);router[_0xe53d('0x11')](_0xe53d('0x10'),auth['isAuthenticated'](),controller[_0xe53d('0x17')]);router[_0xe53d('0x11')](_0xe53d('0x18'),auth[_0xe53d('0x7')](),controller['send']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe53d('0x19')]('/:id',auth[_0xe53d('0x7')](),controller[_0xe53d('0x1a')]);router[_0xe53d('0x19')](_0xe53d('0xb'),auth[_0xe53d('0x7')](),controller[_0xe53d('0x1b')]);router[_0xe53d('0x19')](_0xe53d('0x1c'),auth['isAuthenticated'](),controller[_0xe53d('0x1d')]);router[_0xe53d('0x19')](_0xe53d('0x10'),auth[_0xe53d('0x7')](),controller[_0xe53d('0x1e')]);module[_0xe53d('0x1f')]=router; \ No newline at end of file +var _0xe363=['get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','delete','removeDispositions','removeAnswers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller'];(function(_0x410d04,_0x433249){var _0x4b8601=function(_0x2d68f5){while(--_0x2d68f5){_0x410d04['push'](_0x410d04['shift']());}};_0x4b8601(++_0x433249);}(_0xe363,0x1f2));var _0x3e36=function(_0x1b06f0,_0x544155){_0x1b06f0=_0x1b06f0-0x0;var _0x5a0960=_0xe363[_0x1b06f0];return _0x5a0960;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3e36('0x0'));var timeout=require(_0x3e36('0x1'));var express=require(_0x3e36('0x2'));var router=express[_0x3e36('0x3')]();var fs_extra=require(_0x3e36('0x4'));var auth=require(_0x3e36('0x5'));var interaction=require(_0x3e36('0x6'));var config=require(_0x3e36('0x7'));var controller=require(_0x3e36('0x8'));router[_0x3e36('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3e36('0x9')](_0x3e36('0xa'),auth[_0x3e36('0xb')](),controller[_0x3e36('0xc')]);router[_0x3e36('0x9')](_0x3e36('0xd'),auth['isAuthenticated'](),controller[_0x3e36('0xe')]);router['get'](_0x3e36('0xf'),auth['isAuthenticated'](),controller[_0x3e36('0x10')]);router[_0x3e36('0x9')](_0x3e36('0x11'),auth[_0x3e36('0xb')](),controller[_0x3e36('0x12')]);router[_0x3e36('0x9')](_0x3e36('0x13'),auth['isAuthenticated'](),controller[_0x3e36('0x14')]);router[_0x3e36('0x9')](_0x3e36('0x15'),auth['isAuthenticated'](),controller['getInteractions']);router['get']('/:id/users',auth[_0x3e36('0xb')](),controller[_0x3e36('0x16')]);router[_0x3e36('0x17')]('/',auth['isAuthenticated'](),controller[_0x3e36('0x18')]);router[_0x3e36('0x17')](_0x3e36('0xf'),auth[_0x3e36('0xb')](),controller[_0x3e36('0x19')]);router[_0x3e36('0x17')](_0x3e36('0x11'),auth[_0x3e36('0xb')](),controller[_0x3e36('0x1a')]);router[_0x3e36('0x17')](_0x3e36('0x1b'),controller[_0x3e36('0x1c')]);router[_0x3e36('0x17')](_0x3e36('0x13'),auth[_0x3e36('0xb')](),controller[_0x3e36('0x1d')]);router[_0x3e36('0x17')](_0x3e36('0x1e'),auth[_0x3e36('0xb')](),controller[_0x3e36('0x1f')]);router['post'](_0x3e36('0x20'),auth['isAuthenticated'](),controller[_0x3e36('0x21')]);router[_0x3e36('0x22')](_0x3e36('0xd'),auth[_0x3e36('0xb')](),controller['update']);router[_0x3e36('0x23')](_0x3e36('0xd'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x3e36('0xb')](),controller[_0x3e36('0x24')]);router[_0x3e36('0x23')](_0x3e36('0x11'),auth[_0x3e36('0xb')](),controller[_0x3e36('0x25')]);router[_0x3e36('0x23')](_0x3e36('0x1e'),auth[_0x3e36('0xb')](),controller['removeAgents']);module[_0x3e36('0x26')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 0a85c69..d1a5d85 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 _0xdd81=['STRING','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0xdd81,0x116));var _0x1dd8=function(_0x1502ca,_0x29ac7e){_0x1502ca=_0x1502ca-0x0;var _0x367563=_0xdd81[_0x1502ca];return _0x367563;};'use strict';var Sequelize=require(_0x1dd8('0x0'));var rs=require('randomstring');module[_0x1dd8('0x1')]={'name':{'type':Sequelize[_0x1dd8('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x1dd8('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x1dd8('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1dd8('0x3');}},'notificationSound':{'type':Sequelize[_0x1dd8('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1dd8('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1dd8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x1dd8('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1dd8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1dd8('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1dd8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1dd8('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x1dd8('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x1dd8('0x4')],'defaultValue':![],'comment':_0x1dd8('0x7'),'set':function(_0x3cc02a){if(!_0x3cc02a)this[_0x1dd8('0x8')](_0x1dd8('0x9'),null);this['setDataValue']('mandatoryDisposition',_0x3cc02a);}}}; \ No newline at end of file +var _0xdfd0=['randomstring','STRING','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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0xcbf915,_0x44fb87){var _0x57ef1d=function(_0x517ee8){while(--_0x517ee8){_0xcbf915['push'](_0xcbf915['shift']());}};_0x57ef1d(++_0x44fb87);}(_0xdfd0,0x154));var _0x0dfd=function(_0x545602,_0x16466f){_0x545602=_0x545602-0x0;var _0xb7fe90=_0xdfd0[_0x545602];return _0xb7fe90;};'use strict';var Sequelize=require(_0x0dfd('0x0'));var rs=require(_0x0dfd('0x1'));module['exports']={'name':{'type':Sequelize[_0x0dfd('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0dfd('0x2')]},'token':{'type':Sequelize[_0x0dfd('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x0dfd('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x0dfd('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0dfd('0x3')],'defaultValue':function(){return _0x0dfd('0x4');}},'notificationSound':{'type':Sequelize[_0x0dfd('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0dfd('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0dfd('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x0dfd('0x2')]},'queueTransfer':{'type':Sequelize[_0x0dfd('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0dfd('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0dfd('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x0dfd('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x204249){if(!_0x204249)this[_0x0dfd('0x8')](_0x0dfd('0x9'),null);this[_0x0dfd('0x8')](_0x0dfd('0xa'),_0x204249);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index e1e23b9..2549161 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 _0x2af7=['addAgents','omit','spread','userOpenchannelAccount:save','removeAgents','emit','userOpenchannelAccount:remove','getAgents','send','out','dataValues','Messages','eml-format','rimraf','zip-dir','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','destroy','get','OpenchannelAccounts','UserProfileResource','name','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','Pause','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','update','describe','addDisposition','Disposition','getDispositions','findOne','order','pick','removeDispositions','ids','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','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','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','asc','ListId','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','contact','lastName','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','User','UserId','agent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','fullname','internal','Tag','Tags','tag'];(function(_0x3127f9,_0x2a6c79){var _0x16bdd1=function(_0x95a4da){while(--_0x95a4da){_0x3127f9['push'](_0x3127f9['shift']());}};_0x16bdd1(++_0x2a6c79);}(_0x2af7,0xc5));var _0x72af=function(_0x3505d5,_0x2a8605){_0x3505d5=_0x3505d5-0x0;var _0x55fc9c=_0x2af7[_0x3505d5];return _0x55fc9c;};'use strict';var emlformat=require(_0x72af('0x0'));var rimraf=require(_0x72af('0x1'));var zipdir=require(_0x72af('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x72af('0x3'));var path=require(_0x72af('0x4'));var sox=require(_0x72af('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72af('0x6'));var _=require(_0x72af('0x7'));var squel=require(_0x72af('0x8'));var crypto=require(_0x72af('0x9'));var jsforce=require(_0x72af('0xa'));var deskjs=require(_0x72af('0xb'));var toCsv=require(_0x72af('0xc'));var querystring=require(_0x72af('0xd'));var Papa=require(_0x72af('0xe'));var Redis=require(_0x72af('0xf'));var authService=require(_0x72af('0x10'));var qs=require(_0x72af('0x11'));var as=require(_0x72af('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x72af('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x72af('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x72af('0x15')]=_[_0x72af('0x16')](config[_0x72af('0x15')],{'host':_0x72af('0x17'),'port':0x18eb});var socket=require(_0x72af('0x18'))(new Redis(config[_0x72af('0x15')]));require(_0x72af('0x19'))[_0x72af('0x1a')](socket);var jayson=require(_0x72af('0x1b'));var client=jayson[_0x72af('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0x72af('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x712fee,_0xc9a94b,_0x3f2475,_0x24bad7){return new BPromise(function(_0x15b84f,_0x163bbe){var _0xac2a47=_0x24bad7||client;return _0xac2a47['request'](_0x712fee,_0x3f2475)[_0x72af('0x1e')](function(_0xdc288){logger[_0x72af('0x1f')](_0x72af('0x20'),_0xc9a94b,'request\x20sent');logger[_0x72af('0x21')](_0x72af('0x22'),_0xc9a94b,_0x72af('0x23'),JSON['stringify'](_0xdc288));if(_0xdc288['error']){if(_0xdc288['error'][_0x72af('0x24')]===0x1f4){logger[_0x72af('0x25')](_0x72af('0x20'),_0xc9a94b,_0xdc288['error'][_0x72af('0x26')]);return _0x163bbe(_0xdc288[_0x72af('0x25')]['message']);}logger[_0x72af('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0xc9a94b,_0xdc288[_0x72af('0x25')][_0x72af('0x26')]);return _0x15b84f(_0xdc288[_0x72af('0x25')][_0x72af('0x26')]);}else{logger[_0x72af('0x1f')](_0x72af('0x20'),_0xc9a94b,_0x72af('0x23'));_0x15b84f(_0xdc288[_0x72af('0x27')][_0x72af('0x26')]);}})[_0x72af('0x28')](function(_0xe0f36c){logger[_0x72af('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0xc9a94b,_0xe0f36c);_0x163bbe(_0xe0f36c);});});}function respondWithStatusCode(_0x10a43e,_0x4b0f3a){_0x4b0f3a=_0x4b0f3a||0xcc;return function(_0x5badb9){if(_0x5badb9){return _0x10a43e[_0x72af('0x29')](_0x4b0f3a);}return _0x10a43e['status'](_0x4b0f3a)['end']();};}function respondWithResult(_0x1f24a3,_0x47a2ad){_0x47a2ad=_0x47a2ad||0xc8;return function(_0x1df4c0){if(_0x1df4c0){return _0x1f24a3[_0x72af('0x2a')](_0x47a2ad)[_0x72af('0x2b')](_0x1df4c0);}};}function respondWithFilteredResult(_0x2817da,_0x3835ab){return function(_0x91e7e){if(_0x91e7e){var _0x3a07ed=typeof _0x3835ab[_0x72af('0x2c')]===_0x72af('0x2d')&&typeof _0x3835ab[_0x72af('0x2e')]===_0x72af('0x2d');var _0x132c0c=_0x91e7e['count'];var _0x4861c9=_0x3a07ed?0x0:_0x3835ab[_0x72af('0x2c')];var _0x230651=_0x3a07ed?_0x91e7e[_0x72af('0x2f')]:_0x3835ab[_0x72af('0x2c')]+_0x3835ab[_0x72af('0x2e')];var _0xce1081;if(_0x230651>=_0x132c0c){_0x230651=_0x132c0c;_0xce1081=0xc8;}else{_0xce1081=0xce;}_0x2817da[_0x72af('0x2a')](_0xce1081);return _0x2817da[_0x72af('0x30')](_0x72af('0x31'),_0x4861c9+'-'+_0x230651+'/'+_0x132c0c)['json'](_0x91e7e);}return null;};}function patchUpdates(_0x410bf4){return function(_0x5d14bb){try{jsonpatch['apply'](_0x5d14bb,_0x410bf4,!![]);}catch(_0x7f0688){return BPromise['reject'](_0x7f0688);}return _0x5d14bb[_0x72af('0x32')]();};}function saveUpdates(_0x3edf9c,_0x15b4b1){return function(_0x572e19){if(_0x572e19){return _0x572e19['update'](_0x3edf9c)[_0x72af('0x1e')](function(_0x5a02c1){return _0x5a02c1;});}return null;};}function removeEntity(_0xd41627,_0x4cedde){return function(_0x29a846){if(_0x29a846){return _0x29a846[_0x72af('0x33')]()['then'](function(){var _0x36d994=_0x29a846[_0x72af('0x34')]({'plain':!![]});var _0x4595cd=_0x72af('0x35');return db[_0x72af('0x36')][_0x72af('0x33')]({'where':{'type':_0x4595cd,'resourceId':_0x36d994['id']}})[_0x72af('0x1e')](function(){return _0x29a846;});})[_0x72af('0x1e')](function(){_0xd41627[_0x72af('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ef575,_0x37fda4){return function(_0x59f1ce){if(!_0x59f1ce){_0x3ef575[_0x72af('0x29')](0x194);}return _0x59f1ce;};}function handleError(_0x1b4112,_0x565a12){_0x565a12=_0x565a12||0x1f4;return function(_0x3f7089){logger[_0x72af('0x25')](_0x3f7089['stack']);if(_0x3f7089[_0x72af('0x37')]){delete _0x3f7089[_0x72af('0x37')];}_0x1b4112[_0x72af('0x2a')](_0x565a12)['send'](_0x3f7089);};}exports['index']=function(_0x5264e4,_0x23bb73){var _0x145ac8={'include':[{'model':db['Pause'],'as':_0x72af('0x38')}]},_0x26aa70={},_0x5b2ca5={'count':0x0,'rows':[]};var _0x67ac33=_[_0x72af('0x39')](db[_0x72af('0x3a')][_0x72af('0x3b')],function(_0x265369){return{'name':_0x265369[_0x72af('0x3c')],'type':_0x265369['type'][_0x72af('0x3d')]};});_0x26aa70['model']=_[_0x72af('0x39')](_0x67ac33,_0x72af('0x37'));_0x26aa70[_0x72af('0x3e')]=_[_0x72af('0x3f')](_0x5264e4[_0x72af('0x3e')]);_0x26aa70[_0x72af('0x40')]=_['intersection'](_0x26aa70[_0x72af('0x41')],_0x26aa70['query']);_0x145ac8[_0x72af('0x42')]=_[_0x72af('0x43')](_0x26aa70[_0x72af('0x41')],qs[_0x72af('0x44')](_0x5264e4[_0x72af('0x3e')]['fields']));_0x145ac8[_0x72af('0x42')]=_0x145ac8[_0x72af('0x42')][_0x72af('0x45')]?_0x145ac8[_0x72af('0x42')]:_0x26aa70[_0x72af('0x41')];if(!_0x5264e4[_0x72af('0x3e')][_0x72af('0x46')](_0x72af('0x47'))){_0x145ac8[_0x72af('0x2e')]=qs[_0x72af('0x2e')](_0x5264e4[_0x72af('0x3e')][_0x72af('0x2e')]);_0x145ac8['offset']=qs[_0x72af('0x2c')](_0x5264e4['query'][_0x72af('0x2c')]);}_0x145ac8['order']=qs[_0x72af('0x48')](_0x5264e4['query']['sort']);_0x145ac8[_0x72af('0x49')]=qs[_0x72af('0x40')](_['pick'](_0x5264e4[_0x72af('0x3e')],_0x26aa70['filters']),_0x67ac33);if(_0x5264e4[_0x72af('0x3e')][_0x72af('0x4a')]){_0x145ac8[_0x72af('0x49')]=_['merge'](_0x145ac8[_0x72af('0x49')],{'$or':_[_0x72af('0x39')](_0x67ac33,function(_0xbeb662){if(_0xbeb662[_0x72af('0x4b')]!==_0x72af('0x4c')){var _0x33f944={};_0x33f944[_0xbeb662[_0x72af('0x37')]]={'$like':'%'+_0x5264e4['query']['filter']+'%'};return _0x33f944;}})});}_0x145ac8=_[_0x72af('0x4d')]({},_0x145ac8,_0x5264e4[_0x72af('0x4e')]);var _0x5585ca={'where':_0x145ac8['where']};return db['OpenchannelAccount'][_0x72af('0x2f')](_0x5585ca)[_0x72af('0x1e')](function(_0x407d19){_0x5b2ca5[_0x72af('0x2f')]=_0x407d19;if(_0x5264e4[_0x72af('0x3e')][_0x72af('0x4f')]){_0x145ac8[_0x72af('0x50')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x72af('0x51')](_0x145ac8);})['then'](function(_0x5de3b1){_0x5b2ca5[_0x72af('0x52')]=_0x5de3b1;return _0x5b2ca5;})[_0x72af('0x1e')](respondWithFilteredResult(_0x23bb73,_0x145ac8))[_0x72af('0x28')](handleError(_0x23bb73,null));};exports[_0x72af('0x53')]=function(_0x1835ee,_0x11eb4e){var _0x51412b={'raw':![],'where':{'id':_0x1835ee[_0x72af('0x54')]['id']},'include':[{'model':db[_0x72af('0x55')],'as':_0x72af('0x38')}]},_0x45d4b1={};_0x45d4b1[_0x72af('0x41')]=_[_0x72af('0x3f')](db[_0x72af('0x3a')][_0x72af('0x3b')]);_0x45d4b1[_0x72af('0x3e')]=_[_0x72af('0x3f')](_0x1835ee['query']);_0x45d4b1['filters']=_[_0x72af('0x43')](_0x45d4b1[_0x72af('0x41')],_0x45d4b1[_0x72af('0x3e')]);_0x51412b['attributes']=_[_0x72af('0x43')](_0x45d4b1[_0x72af('0x41')],qs[_0x72af('0x44')](_0x1835ee[_0x72af('0x3e')][_0x72af('0x44')]));_0x51412b[_0x72af('0x42')]=_0x51412b['attributes']['length']?_0x51412b['attributes']:_0x45d4b1['model'];if(_0x1835ee[_0x72af('0x3e')][_0x72af('0x4f')]){_0x51412b['include']=[{'all':!![]}];}_0x51412b=_[_0x72af('0x4d')]({},_0x51412b,_0x1835ee[_0x72af('0x4e')]);return db[_0x72af('0x3a')]['find'](_0x51412b)[_0x72af('0x1e')](handleEntityNotFound(_0x11eb4e,null))[_0x72af('0x1e')](respondWithResult(_0x11eb4e,null))[_0x72af('0x28')](handleError(_0x11eb4e,null));};exports[_0x72af('0x56')]=function(_0x5cf3e7,_0x186df0){return db[_0x72af('0x3a')][_0x72af('0x56')](_0x5cf3e7[_0x72af('0x57')],{})['then'](function(_0xa146da){var _0x2ebd5d=_0x5cf3e7[_0x72af('0x58')]['get']({'plain':!![]});if(!_0x2ebd5d)throw new Error(_0x72af('0x59'));if(_0x2ebd5d['role']===_0x72af('0x58')){var _0x1158d5=_0xa146da['get']({'plain':!![]});var _0x262b80=_0x72af('0x35');return db['UserProfileSection'][_0x72af('0x5a')]({'where':{'name':_0x262b80,'userProfileId':_0x2ebd5d[_0x72af('0x5b')]},'raw':!![]})['then'](function(_0xebfcd6){if(_0xebfcd6&&_0xebfcd6[_0x72af('0x5c')]===0x0){return db[_0x72af('0x36')]['create']({'name':_0x1158d5[_0x72af('0x37')],'resourceId':_0x1158d5['id'],'type':_0xebfcd6[_0x72af('0x37')],'sectionId':_0xebfcd6['id']},{})[_0x72af('0x1e')](function(){return _0xa146da;});}else{return _0xa146da;}})[_0x72af('0x28')](function(_0x5de1f2){logger[_0x72af('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5de1f2);throw _0x5de1f2;});}return _0xa146da;})['then'](respondWithResult(_0x186df0,0xc9))[_0x72af('0x28')](handleError(_0x186df0,null));};exports[_0x72af('0x5d')]=function(_0x26794e,_0xe20a3a){if(_0x26794e[_0x72af('0x57')]['id']){delete _0x26794e[_0x72af('0x57')]['id'];}return db[_0x72af('0x3a')][_0x72af('0x5a')]({'where':{'id':_0x26794e['params']['id']},'include':[{'model':db[_0x72af('0x55')],'as':_0x72af('0x38')}]})[_0x72af('0x1e')](handleEntityNotFound(_0xe20a3a,null))[_0x72af('0x1e')](saveUpdates(_0x26794e['body'],null))['then'](respondWithResult(_0xe20a3a,null))['catch'](handleError(_0xe20a3a,null));};exports[_0x72af('0x33')]=function(_0x507bbe,_0x1655fd){return db['OpenchannelAccount'][_0x72af('0x5a')]({'where':{'id':_0x507bbe[_0x72af('0x54')]['id']}})[_0x72af('0x1e')](handleEntityNotFound(_0x1655fd,null))[_0x72af('0x1e')](removeEntity(_0x1655fd,null))['catch'](handleError(_0x1655fd,null));};exports[_0x72af('0x5e')]=function(_0x430127,_0x52c84a){return db['OpenchannelAccount']['describe']()[_0x72af('0x1e')](respondWithResult(_0x52c84a,null))[_0x72af('0x28')](handleError(_0x52c84a,null));};exports[_0x72af('0x5f')]=function(_0x3da987,_0x3e0b2e,_0x40be3c){if(_0x3da987['body']['id']){delete _0x3da987[_0x72af('0x57')]['id'];}return db[_0x72af('0x3a')][_0x72af('0x5a')]({'where':{'id':_0x3da987[_0x72af('0x54')]['id']}})['then'](handleEntityNotFound(_0x3e0b2e,null))[_0x72af('0x1e')](function(_0x41011f){if(_0x41011f){_0x3da987[_0x72af('0x57')]['OpenchannelAccountId']=_0x41011f['id'];return db[_0x72af('0x60')][_0x72af('0x56')](_0x3da987[_0x72af('0x57')]);}})[_0x72af('0x1e')](respondWithResult(_0x3e0b2e,null))[_0x72af('0x28')](handleError(_0x3e0b2e,null));};exports[_0x72af('0x61')]=function(_0x295be0,_0x3074ba,_0x147943){var _0x822a32={'raw':![],'where':{}};var _0x1b9046={};var _0x44a4a2={'count':0x0,'rows':[]};return db[_0x72af('0x3a')][_0x72af('0x62')]({'where':{'id':_0x295be0['params']['id']}})[_0x72af('0x1e')](handleEntityNotFound(_0x3074ba,null))[_0x72af('0x1e')](function(_0x5ae8c7){if(_0x5ae8c7){_0x1b9046[_0x72af('0x41')]=_[_0x72af('0x3f')](db['Disposition'][_0x72af('0x3b')]);_0x1b9046['query']=_['keys'](_0x295be0[_0x72af('0x3e')]);_0x1b9046[_0x72af('0x40')]=_[_0x72af('0x43')](_0x1b9046['model'],_0x1b9046[_0x72af('0x3e')]);_0x822a32['attributes']=_[_0x72af('0x43')](_0x1b9046[_0x72af('0x41')],qs[_0x72af('0x44')](_0x295be0[_0x72af('0x3e')][_0x72af('0x44')]));_0x822a32[_0x72af('0x42')]=_0x822a32[_0x72af('0x42')][_0x72af('0x45')]?_0x822a32[_0x72af('0x42')]:_0x1b9046[_0x72af('0x41')];if(!_0x295be0[_0x72af('0x3e')][_0x72af('0x46')]('nolimit')){_0x822a32[_0x72af('0x2e')]=qs['limit'](_0x295be0[_0x72af('0x3e')][_0x72af('0x2e')]);_0x822a32[_0x72af('0x2c')]=qs[_0x72af('0x2c')](_0x295be0[_0x72af('0x3e')][_0x72af('0x2c')]);}_0x822a32[_0x72af('0x63')]=qs[_0x72af('0x48')](_0x295be0[_0x72af('0x3e')][_0x72af('0x48')]);_0x822a32['where']=qs[_0x72af('0x40')](_[_0x72af('0x64')](_0x295be0[_0x72af('0x3e')],_0x1b9046['filters']));_0x822a32[_0x72af('0x49')]['OpenchannelAccountId']=_0x5ae8c7['id'];if(_0x295be0[_0x72af('0x3e')]['filter']){_0x822a32['where']=_['merge'](_0x822a32[_0x72af('0x49')],{'$or':_[_0x72af('0x39')](_0x822a32[_0x72af('0x42')],function(_0x58453d){var _0x4dbb74={};_0x4dbb74[_0x58453d]={'$like':'%'+_0x295be0[_0x72af('0x3e')][_0x72af('0x4a')]+'%'};return _0x4dbb74;})});}_0x822a32=_[_0x72af('0x4d')]({},_0x822a32,_0x295be0[_0x72af('0x4e')]);return db[_0x72af('0x60')][_0x72af('0x2f')]({'where':_0x822a32['where']})[_0x72af('0x1e')](function(_0x53831c){_0x44a4a2[_0x72af('0x2f')]=_0x53831c;if(_0x295be0[_0x72af('0x3e')]['includeAll']){_0x822a32['include']=[{'all':!![]}];}return db[_0x72af('0x60')][_0x72af('0x51')](_0x822a32);})[_0x72af('0x1e')](function(_0x441e29){_0x44a4a2[_0x72af('0x52')]=_0x441e29;return _0x44a4a2;});}})[_0x72af('0x1e')](respondWithFilteredResult(_0x3074ba,_0x822a32))['catch'](handleError(_0x3074ba,null));};exports[_0x72af('0x65')]=function(_0x1fbe79,_0x1725ae,_0xb1453e){return db[_0x72af('0x3a')][_0x72af('0x5a')]({'where':{'id':_0x1fbe79[_0x72af('0x54')]['id']}})[_0x72af('0x1e')](handleEntityNotFound(_0x1725ae,null))['then'](function(_0x4db802){if(_0x4db802){return _0x4db802[_0x72af('0x65')](_0x1fbe79[_0x72af('0x3e')][_0x72af('0x66')]);}})[_0x72af('0x1e')](respondWithStatusCode(_0x1725ae,null))[_0x72af('0x28')](handleError(_0x1725ae,null));};exports[_0x72af('0x67')]=function(_0xc4b913,_0x1fa79c,_0x21182f){if(_0xc4b913['body']['id']){delete _0xc4b913[_0x72af('0x57')]['id'];}return db[_0x72af('0x3a')]['find']({'where':{'id':_0xc4b913[_0x72af('0x54')]['id']}})[_0x72af('0x1e')](handleEntityNotFound(_0x1fa79c,null))[_0x72af('0x1e')](function(_0x24a8f2){if(_0x24a8f2){_0xc4b913[_0x72af('0x57')][_0x72af('0x68')]=_0x24a8f2['id'];return db[_0x72af('0x69')][_0x72af('0x56')](_0xc4b913[_0x72af('0x57')]);}})[_0x72af('0x1e')](respondWithResult(_0x1fa79c,null))['catch'](handleError(_0x1fa79c,null));};exports[_0x72af('0x6a')]=function(_0x3d552e,_0x56f47c,_0x153846){var _0x1e0f2c={'raw':![],'where':{}};var _0x799c73={};var _0x361d88={'count':0x0,'rows':[]};return db[_0x72af('0x3a')][_0x72af('0x62')]({'where':{'id':_0x3d552e['params']['id']}})['then'](handleEntityNotFound(_0x56f47c,null))[_0x72af('0x1e')](function(_0x2138bc){if(_0x2138bc){_0x799c73['model']=_[_0x72af('0x3f')](db[_0x72af('0x69')][_0x72af('0x3b')]);_0x799c73[_0x72af('0x3e')]=_[_0x72af('0x3f')](_0x3d552e['query']);_0x799c73[_0x72af('0x40')]=_[_0x72af('0x43')](_0x799c73[_0x72af('0x41')],_0x799c73['query']);_0x1e0f2c[_0x72af('0x42')]=_['intersection'](_0x799c73['model'],qs[_0x72af('0x44')](_0x3d552e[_0x72af('0x3e')]['fields']));_0x1e0f2c['attributes']=_0x1e0f2c[_0x72af('0x42')]['length']?_0x1e0f2c['attributes']:_0x799c73['model'];if(!_0x3d552e['query'][_0x72af('0x46')](_0x72af('0x47'))){_0x1e0f2c[_0x72af('0x2e')]=qs[_0x72af('0x2e')](_0x3d552e['query'][_0x72af('0x2e')]);_0x1e0f2c[_0x72af('0x2c')]=qs[_0x72af('0x2c')](_0x3d552e['query'][_0x72af('0x2c')]);}_0x1e0f2c[_0x72af('0x63')]=qs[_0x72af('0x48')](_0x3d552e['query'][_0x72af('0x48')]);_0x1e0f2c[_0x72af('0x49')]=qs['filters'](_['pick'](_0x3d552e['query'],_0x799c73['filters']));_0x1e0f2c[_0x72af('0x49')][_0x72af('0x68')]=_0x2138bc['id'];if(_0x3d552e['query']['filter']){_0x1e0f2c[_0x72af('0x49')]=_['merge'](_0x1e0f2c[_0x72af('0x49')],{'$or':_[_0x72af('0x39')](_0x1e0f2c[_0x72af('0x42')],function(_0x5bf10c){var _0x3f75e9={};_0x3f75e9[_0x5bf10c]={'$like':'%'+_0x3d552e[_0x72af('0x3e')]['filter']+'%'};return _0x3f75e9;})});}_0x1e0f2c=_[_0x72af('0x4d')]({},_0x1e0f2c,_0x3d552e[_0x72af('0x4e')]);return db[_0x72af('0x69')][_0x72af('0x2f')]({'where':_0x1e0f2c[_0x72af('0x49')]})[_0x72af('0x1e')](function(_0x4399bd){_0x361d88['count']=_0x4399bd;if(_0x3d552e['query'][_0x72af('0x4f')]){_0x1e0f2c[_0x72af('0x50')]=[{'all':!![]}];}return db[_0x72af('0x69')][_0x72af('0x51')](_0x1e0f2c);})[_0x72af('0x1e')](function(_0x3ce07a){_0x361d88[_0x72af('0x52')]=_0x3ce07a;return _0x361d88;});}})[_0x72af('0x1e')](respondWithFilteredResult(_0x56f47c,_0x1e0f2c))[_0x72af('0x28')](handleError(_0x56f47c,null));};exports[_0x72af('0x6b')]=function(_0x215bad,_0x2391fe,_0x29cba9){return db['OpenchannelAccount'][_0x72af('0x5a')]({'where':{'id':_0x215bad[_0x72af('0x54')]['id']}})[_0x72af('0x1e')](handleEntityNotFound(_0x2391fe,null))[_0x72af('0x1e')](function(_0x4c9bc7){if(_0x4c9bc7){return _0x4c9bc7[_0x72af('0x6b')](_0x215bad[_0x72af('0x3e')][_0x72af('0x66')]);}})[_0x72af('0x1e')](respondWithStatusCode(_0x2391fe,null))[_0x72af('0x28')](handleError(_0x2391fe,null));};exports[_0x72af('0x6c')]=function(_0x1e1a06,_0x5105f1,_0x2f7f91){var _0x84d79d={'body':_0x1e1a06['body'],'channel':_0x72af('0x6d')};var _0x8a95f4=[];var _0x439190=[];var _0x30dcb0={};var _0x21807b=![];return db[_0x72af('0x6e')][_0x72af('0x5e')]()[_0x72af('0x1e')](function(_0x460757){if(!_0x460757){throw new db[(_0x72af('0x6f'))][(_0x72af('0x70'))](_0x72af('0x71'));}_0x8a95f4=_['difference'](_[_0x72af('0x3f')](_0x460757),[_0x72af('0x72'),'updatedAt']);_0x439190=_['difference'](_['keys'](_0x460757),[_0x72af('0x72'),_0x72af('0x73'),_0x72af('0x74'),'ListId']);if(_0x1e1a06[_0x72af('0x57')]['id']){delete _0x1e1a06[_0x72af('0x57')]['id'];}if(_[_0x72af('0x75')](_0x1e1a06[_0x72af('0x57')][_0x72af('0x76')])){throw new db[(_0x72af('0x6f'))][(_0x72af('0x70'))](_0x72af('0x77'));}if(_[_0x72af('0x75')](_0x1e1a06[_0x72af('0x57')][_0x72af('0x57')])||_0x1e1a06['body']['body']===''){throw new db['Sequelize'][(_0x72af('0x70'))](_0x72af('0x78'));}if(_[_0x72af('0x75')](_0x1e1a06['body'][_0x72af('0x79')])){throw new db[(_0x72af('0x6f'))]['ValidationError'](_0x72af('0x7a')+_0x439190);}if(!_['includes'](_0x439190,_0x1e1a06[_0x72af('0x57')][_0x72af('0x79')])){throw new db[(_0x72af('0x6f'))]['ValidationError'](_0x72af('0x7b')+_0x439190);}_0x30dcb0[_0x1e1a06[_0x72af('0x57')][_0x72af('0x79')]]=_0x1e1a06[_0x72af('0x57')][_0x72af('0x76')];})[_0x72af('0x1e')](function(){return db[_0x72af('0x3a')][_0x72af('0x5a')]({'where':{'id':_0x1e1a06[_0x72af('0x54')]['id']},'include':[{'model':db[_0x72af('0x7c')],'as':_0x72af('0x7d'),'include':[{'model':db[_0x72af('0x6e')],'as':_0x72af('0x7e'),'where':_0x30dcb0,'limit':0x1,'order':[[_0x72af('0x73'),_0x72af('0x7f')]]}]},{'model':db[_0x72af('0x80')],'as':'Applications'}]});})[_0x72af('0x1e')](handleEntityNotFound(_0x5105f1,null))['then'](function(_0x1d8302){if(_0x1d8302&&_0x1d8302['List']){_0x84d79d[_0x72af('0x81')]=_0x1d8302;_0x84d79d[_0x72af('0x82')]=_0x1d8302[_0x72af('0x83')];_0x84d79d[_0x72af('0x84')]=_0x1d8302['List'];_0x84d79d[_0x72af('0x82')]=_[_0x72af('0x85')](_0x84d79d[_0x72af('0x82')],[_0x72af('0x86')],[_0x72af('0x87')]);if(_0x84d79d['account'][_0x72af('0x83')]){delete _0x84d79d[_0x72af('0x81')][_0x72af('0x83')];}if(_0x84d79d[_0x72af('0x81')][_0x72af('0x7d')]&&_0x84d79d[_0x72af('0x81')][_0x72af('0x7d')]['Contacts']['length']){return _0x84d79d[_0x72af('0x81')][_0x72af('0x7d')][_0x72af('0x7e')][0x0];}var _0x47f77b=_[_0x72af('0x16')](_0x1e1a06[_0x72af('0x57')],{'firstName':_0x1e1a06[_0x72af('0x57')][_0x72af('0x76')],'ListId':_0x1d8302[_0x72af('0x88')]});_0x47f77b[_0x1e1a06[_0x72af('0x57')][_0x72af('0x79')]]=_0x1e1a06[_0x72af('0x57')][_0x72af('0x76')];return db[_0x72af('0x6e')]['create'](_0x47f77b,{'fields':_0x8a95f4,'raw':!![]});}})[_0x72af('0x1e')](handleEntityNotFound(_0x5105f1,null))[_0x72af('0x1e')](function(_0xc6b05b){_0x84d79d['contact']=_0xc6b05b;if(_0xc6b05b){var _0x3099ca={'ContactId':_0xc6b05b['id'],'OpenchannelAccountId':_0x1e1a06[_0x72af('0x54')]['id'],'from':(_0xc6b05b[_0x72af('0x89')]||'')+'\x20'+(_0xc6b05b['lastName']||'')};var _0x4b0ff6={'OpenchannelAccountId':_0x1e1a06[_0x72af('0x54')]['id'],'closed':![]};if(_0x1e1a06['body']['threadId']){_0x4b0ff6[_0x72af('0x8a')]=_0x1e1a06['body'][_0x72af('0x8a')];return db[_0x72af('0x8b')][_0x72af('0x5a')]({'where':_0x4b0ff6})[_0x72af('0x1e')](function(_0x459b1c){if(_0x459b1c){return[_0x459b1c,![]];}_0x3099ca['threadId']=_0x1e1a06['body']['threadId'];_0x3099ca[_0x72af('0x8c')]=_0x1e1a06['body'][_0x72af('0x8c')];return db[_0x72af('0x8b')][_0x72af('0x56')](_0x3099ca)[_0x72af('0x1e')](function(_0x3dc5a9){return[_0x3dc5a9,!![]];});});}else{_0x4b0ff6[_0x72af('0x8a')]=null;}_0x4b0ff6[_0x72af('0x8d')]=_0xc6b05b['id'];return db[_0x72af('0x8b')][_0x72af('0x5a')]({'where':_0x4b0ff6})[_0x72af('0x1e')](function(_0x183fec){if(_0x183fec){return[_0x183fec,![]];}return db[_0x72af('0x8b')][_0x72af('0x56')](_0x3099ca)['then'](function(_0x50d5ae){return[_0x50d5ae,!![]];});});}})['spread'](function(_0x4d525,_0x2dd85f){if(_0x4d525){_0x21807b=_0x2dd85f;if(!_0x2dd85f){var _0x1d5251={'from':(_0x84d79d['contact'][_0x72af('0x89')]||'')+'\x20'+(_0x84d79d[_0x72af('0x8e')][_0x72af('0x8f')]||'')};if(_0x1e1a06[_0x72af('0x57')][_0x72af('0x8a')]&&_0x1e1a06[_0x72af('0x57')][_0x72af('0x90')]&&_0x1e1a06['body'][_0x72af('0x8a')]!=_0x1e1a06[_0x72af('0x57')][_0x72af('0x90')]){_0x1d5251[_0x72af('0x8a')]=_0x1e1a06[_0x72af('0x57')][_0x72af('0x90')];}return _0x4d525[_0x72af('0x5d')](_0x1d5251);}else{return _0x4d525;}}})[_0x72af('0x1e')](function(_0x46933b){_0x84d79d[_0x72af('0x91')]=_0x46933b[_0x72af('0x34')]({'plain':!![]});_0x84d79d['interaction']['created']=_0x21807b;if(_0x84d79d[_0x72af('0x91')][_0x72af('0x92')]){if(_0x84d79d['account']['autoclose']){_0x84d79d[_0x72af('0x82')][_0x72af('0x93')]({'id':0x0,'priority':_0x84d79d['applications'][_0x72af('0x45')]+0x1,'app':_0x72af('0x94'),'appdata':_0x72af('0x95'),'interval':_0x72af('0x96')});}}return db[_0x72af('0x97')][_0x72af('0x56')]({'body':_0x1e1a06['body'][_0x72af('0x57')],'OpenchannelAccountId':_0x1e1a06[_0x72af('0x54')]['id'],'OpenchannelInteractionId':_0x46933b['id'],'direction':'in','ContactId':_0x84d79d[_0x72af('0x8e')]['id'],'AttachmentId':_0x1e1a06[_0x72af('0x57')]['AttachmentId']});})[_0x72af('0x1e')](function(_0xa54f90){_0x84d79d[_0x72af('0x26')]=_0xa54f90;if(_0x84d79d[_0x72af('0x91')]['UserId']){return db[_0x72af('0x98')][_0x72af('0x5a')]({'attributes':['id','name'],'where':{'id':_0x84d79d['interaction'][_0x72af('0x99')]}})['then'](function(_0x58f9a8){if(_0x58f9a8){_0x84d79d[_0x72af('0x82')]['unshift']({'id':0x0,'priority':0x0,'app':_0x72af('0x9a'),'appdata':_0x58f9a8[_0x72af('0x37')]+','+(_0x84d79d[_0x72af('0x81')]['waitForTheAssignedAgent']||0xa),'interval':_0x72af('0x96')});_0x84d79d[_0x72af('0x9b')]=![];}return respondWithRpcPromise(_0x72af('0x9c'),_0x72af('0x9d'),_0x84d79d);});}return respondWithRpcPromise(_0x72af('0x9c'),_0x72af('0x9d'),_0x84d79d);})[_0x72af('0x1e')](function(_0x5be022){respondWithRpcPromise(_0x72af('0x9e'),_0x72af('0x9e'),{'event':_0x72af('0x6c'),'message':_0x5be022},client9002);return _0x5be022;})[_0x72af('0x1e')](respondWithResult(_0x5105f1,null))[_0x72af('0x28')](handleError(_0x5105f1,null));};exports[_0x72af('0x9f')]=function(_0x4e58dd,_0x145a5e){var _0x1695fd=_0x4e58dd[_0x72af('0x54')]['id'];var _0x340490=_0x4e58dd['body'];var _0x3b70b0=0xc8;var _0x4fa13c=null;return db[_0x72af('0xa0')][_0x72af('0xa1')]({'isolationLevel':db[_0x72af('0xa0')]['Transaction'][_0x72af('0xa2')][_0x72af('0xa3')]},function(_0x5d6db6){return db[_0x72af('0x3a')]['findOne']({'where':{'id':_0x1695fd},'transaction':_0x5d6db6})[_0x72af('0x1e')](function(_0x4a4588){if(_0x4a4588){return db[_0x72af('0x80')][_0x72af('0x33')]({'where':{'OpenchannelAccountId':_0x1695fd},'transaction':_0x5d6db6})[_0x72af('0x1e')](function(){var _0x57ce22=_[_0x72af('0x39')](_0x340490,function(_0x5a63d1){_0x5a63d1[_0x72af('0x68')]=_0x1695fd;return _0x5a63d1;});return db[_0x72af('0x80')]['bulkCreate'](_0x57ce22,{'transaction':_0x5d6db6});});}else{_0x3b70b0=0x194;_0x4fa13c=[];}});})[_0x72af('0x1e')](function(){if(_0x3b70b0!==0x194){return db[_0x72af('0x80')][_0x72af('0xa4')]({'where':{'OpenchannelAccountId':_0x1695fd},'order':_0x72af('0x86')})[_0x72af('0x1e')](function(_0x13e325){_0x4fa13c=_0x13e325;});}})[_0x72af('0x28')](function(_0x59c113){_0x3b70b0=0x1f4;logger['error'](_0x59c113[_0x72af('0xa5')]);if(_0x59c113['name']){delete _0x59c113[_0x72af('0x37')];}_0x4fa13c=_0x59c113;})[_0x72af('0xa6')](function(){if(_0x4fa13c===null){_0x145a5e[_0x72af('0x29')](_0x3b70b0);}else{if(_0x3b70b0===0x1f4){_0x145a5e[_0x72af('0x2a')](_0x3b70b0)['send'](_0x4fa13c);}else{_0x145a5e['status'](_0x3b70b0)[_0x72af('0x2b')](_0x4fa13c);}}});};exports['getApplications']=function(_0x6b78fd,_0x3da2d8,_0x45de1f){var _0x2a60b6={};var _0xd8603e={};var _0x3b1de2;var _0x40ead5;return db['OpenchannelAccount'][_0x72af('0x62')]({'where':{'id':_0x6b78fd['params']['id']}})[_0x72af('0x1e')](handleEntityNotFound(_0x3da2d8,null))[_0x72af('0x1e')](function(_0x13fe41){if(_0x13fe41){_0x3b1de2=_0x13fe41;_0xd8603e[_0x72af('0x41')]=_['keys'](db['OpenchannelApplication'][_0x72af('0x3b')]);_0xd8603e[_0x72af('0x3e')]=_[_0x72af('0x3f')](_0x6b78fd[_0x72af('0x3e')]);_0xd8603e[_0x72af('0x40')]=_[_0x72af('0x43')](_0xd8603e[_0x72af('0x41')],_0xd8603e[_0x72af('0x3e')]);_0x2a60b6[_0x72af('0x42')]=_[_0x72af('0x43')](_0xd8603e['model'],qs[_0x72af('0x44')](_0x6b78fd['query'][_0x72af('0x44')]));_0x2a60b6[_0x72af('0x42')]=_0x2a60b6[_0x72af('0x42')]['length']?_0x2a60b6[_0x72af('0x42')]:_0xd8603e[_0x72af('0x41')];_0x2a60b6[_0x72af('0x63')]=qs[_0x72af('0x48')](_0x6b78fd[_0x72af('0x3e')]['sort']);_0x2a60b6[_0x72af('0x49')]=qs['filters'](_[_0x72af('0x64')](_0x6b78fd['query'],_0xd8603e[_0x72af('0x40')]));if(_0x6b78fd[_0x72af('0x3e')]['filter']){_0x2a60b6[_0x72af('0x49')]=_[_0x72af('0x4d')](_0x2a60b6[_0x72af('0x49')],{'$or':_[_0x72af('0x39')](_0x2a60b6['attributes'],function(_0x2e5a81){var _0x50b544={};_0x50b544[_0x2e5a81]={'$like':'%'+_0x6b78fd[_0x72af('0x3e')]['filter']+'%'};return _0x50b544;})});}_0x2a60b6=_[_0x72af('0x4d')]({},_0x2a60b6,_0x6b78fd[_0x72af('0x4e')]);return _0x3b1de2[_0x72af('0xa7')](_0x2a60b6);}})[_0x72af('0x1e')](function(_0x3ff7b7){if(_0x3ff7b7){_0x40ead5=_0x3ff7b7[_0x72af('0x45')];if(!_0x6b78fd[_0x72af('0x3e')][_0x72af('0x46')](_0x72af('0x47'))){_0x2a60b6[_0x72af('0x2e')]=qs['limit'](_0x6b78fd[_0x72af('0x3e')]['limit']);_0x2a60b6['offset']=qs[_0x72af('0x2c')](_0x6b78fd[_0x72af('0x3e')]['offset']);}return _0x3b1de2[_0x72af('0xa7')](_0x2a60b6);}})['then'](function(_0x194e43){if(_0x194e43){return _0x194e43?{'count':_0x40ead5,'rows':_0x194e43}:null;}})['then'](respondWithResult(_0x3da2d8,null))[_0x72af('0x28')](handleError(_0x3da2d8,null));};exports['getInteractions']=function(_0x4fa5f7,_0x13a8c5,_0x47c2af){var _0x41fb86={'raw':![],'where':{}};var _0x1809b5={};var _0x1baa21={'count':0x0,'rows':[]};return db[_0x72af('0x3a')]['findOne']({'where':{'id':_0x4fa5f7[_0x72af('0x54')]['id']}})[_0x72af('0x1e')](handleEntityNotFound(_0x13a8c5,null))[_0x72af('0x1e')](function(_0x144d2c){if(_0x144d2c){_0x1809b5[_0x72af('0x41')]=_['keys'](db[_0x72af('0x8b')][_0x72af('0x3b')]);_0x1809b5[_0x72af('0x3e')]=_[_0x72af('0x3f')](_0x4fa5f7[_0x72af('0x3e')]);_0x1809b5[_0x72af('0x40')]=_[_0x72af('0x43')](_0x1809b5['model'],_0x1809b5[_0x72af('0x3e')]);_0x41fb86['attributes']=_[_0x72af('0x43')](_0x1809b5[_0x72af('0x41')],qs[_0x72af('0x44')](_0x4fa5f7[_0x72af('0x3e')]['fields']));_0x41fb86[_0x72af('0x42')]=_0x41fb86[_0x72af('0x42')]['length']?_0x41fb86[_0x72af('0x42')]:_0x1809b5[_0x72af('0x41')];if(!_0x4fa5f7[_0x72af('0x3e')]['hasOwnProperty']('nolimit')){_0x41fb86[_0x72af('0x2e')]=qs[_0x72af('0x2e')](_0x4fa5f7[_0x72af('0x3e')][_0x72af('0x2e')]);_0x41fb86['offset']=qs[_0x72af('0x2c')](_0x4fa5f7[_0x72af('0x3e')]['offset']);}_0x41fb86['order']=qs[_0x72af('0x48')](_0x4fa5f7['query'][_0x72af('0x48')]);_0x41fb86[_0x72af('0x49')]=qs['filters'](_['pick'](_0x4fa5f7['query'],_0x1809b5['filters']));_0x41fb86[_0x72af('0x49')][_0x72af('0x68')]=_0x144d2c['id'];if(_0x4fa5f7[_0x72af('0x3e')][_0x72af('0x4a')]){_0x41fb86[_0x72af('0x49')]=_[_0x72af('0x4d')](_0x41fb86[_0x72af('0x49')],{'$or':_['map'](_0x41fb86['attributes'],function(_0xcf751d){var _0x465c81={};_0x465c81[_0xcf751d]={'$like':'%'+_0x4fa5f7['query'][_0x72af('0x4a')]+'%'};return _0x465c81;})});}_0x41fb86=_[_0x72af('0x4d')]({},_0x41fb86,_0x4fa5f7['options']);return db['OpenchannelInteraction'][_0x72af('0x2f')]({'where':_0x41fb86['where']})[_0x72af('0x1e')](function(_0x3d66f9){_0x1baa21[_0x72af('0x2f')]=_0x3d66f9;if(_0x4fa5f7[_0x72af('0x3e')][_0x72af('0x4f')]){_0x41fb86[_0x72af('0x50')]=[{'model':db[_0x72af('0x6e')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x72af('0x37'),_0x72af('0xa8'),_0x72af('0xa9')],'required':![]},{'model':db[_0x72af('0xaa')],'as':_0x72af('0xab'),'attributes':['id','name','color'],'where':_0x4fa5f7[_0x72af('0x3e')][_0x72af('0xac')]?{'id':_0x4fa5f7[_0x72af('0x3e')][_0x72af('0xac')]}:undefined,'required':_0x4fa5f7[_0x72af('0x3e')][_0x72af('0xac')]?!![]:![]}];}return db[_0x72af('0x8b')][_0x72af('0x51')](_0x41fb86);})[_0x72af('0x1e')](function(_0x1f8c33){_0x1baa21[_0x72af('0x52')]=_0x1f8c33;return _0x1baa21;});}})[_0x72af('0x1e')](respondWithFilteredResult(_0x13a8c5,_0x41fb86))[_0x72af('0x28')](handleError(_0x13a8c5,null));};exports[_0x72af('0xad')]=function(_0x8188ec,_0x32e38b,_0x204952){return db['OpenchannelAccount'][_0x72af('0x5a')]({'where':{'id':_0x8188ec[_0x72af('0x54')]['id']}})[_0x72af('0x1e')](handleEntityNotFound(_0x32e38b,null))[_0x72af('0x1e')](function(_0x5dd93c){if(_0x5dd93c){return _0x5dd93c[_0x72af('0xad')](_0x8188ec[_0x72af('0x57')]['ids'],_[_0x72af('0xae')](_0x8188ec['body'],['ids','id'])||{})[_0x72af('0xaf')](function(_0xc4491d){for(var _0x1ffa6e=0x0;_0x1ffa6e<_0x8188ec['body'][_0x72af('0x66')][_0x72af('0x45')];_0x1ffa6e+=0x1){socket['emit'](_0x72af('0xb0'),{'UserId':Number(_0x8188ec[_0x72af('0x57')][_0x72af('0x66')][_0x1ffa6e]),'OpenchannelAccountId':Number(_0x8188ec['params']['id'])});}return _0xc4491d;});}})['then'](respondWithResult(_0x32e38b,null))[_0x72af('0x28')](handleError(_0x32e38b,null));};exports[_0x72af('0xb1')]=function(_0xc78485,_0x589c11,_0x54f74c){return db[_0x72af('0x3a')][_0x72af('0x5a')]({'where':{'id':_0xc78485[_0x72af('0x54')]['id']}})[_0x72af('0x1e')](handleEntityNotFound(_0x589c11,null))[_0x72af('0x1e')](function(_0x23621b){if(_0x23621b){return _0x23621b['removeAgents'](_0xc78485[_0x72af('0x3e')][_0x72af('0x66')])[_0x72af('0x1e')](function(){if(_['isArray'](_0xc78485['query'][_0x72af('0x66')])){for(var _0x570ada=0x0;_0x570ada<_0xc78485['query'][_0x72af('0x66')][_0x72af('0x45')];_0x570ada+=0x1){socket[_0x72af('0xb2')](_0x72af('0xb3'),{'UserId':Number(_0xc78485[_0x72af('0x3e')][_0x72af('0x66')][_0x570ada]),'OpenchannelAccountId':Number(_0xc78485[_0x72af('0x54')]['id'])});}}else{socket[_0x72af('0xb2')](_0x72af('0xb3'),{'UserId':Number(_0xc78485['query'][_0x72af('0x66')]),'OpenchannelAccountId':Number(_0xc78485[_0x72af('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x589c11,null))[_0x72af('0x28')](handleError(_0x589c11,null));};exports[_0x72af('0xb4')]=function(_0x3fb43f,_0x28cead,_0x3e58a9){var _0x36a57b={};var _0x36d30d={};var _0x3d2e91;var _0x2f0e3f;return db['OpenchannelAccount'][_0x72af('0x62')]({'where':{'id':_0x3fb43f['params']['id']}})[_0x72af('0x1e')](handleEntityNotFound(_0x28cead,null))[_0x72af('0x1e')](function(_0x4f0026){if(_0x4f0026){_0x3d2e91=_0x4f0026;_0x36d30d[_0x72af('0x41')]=_[_0x72af('0x3f')](db[_0x72af('0x98')][_0x72af('0x3b')]);_0x36d30d[_0x72af('0x3e')]=_[_0x72af('0x3f')](_0x3fb43f['query']);_0x36d30d[_0x72af('0x40')]=_[_0x72af('0x43')](_0x36d30d[_0x72af('0x41')],_0x36d30d['query']);_0x36a57b[_0x72af('0x42')]=_['intersection'](_0x36d30d[_0x72af('0x41')],qs['fields'](_0x3fb43f[_0x72af('0x3e')][_0x72af('0x44')]));_0x36a57b[_0x72af('0x42')]=_0x36a57b[_0x72af('0x42')][_0x72af('0x45')]?_0x36a57b[_0x72af('0x42')]:_0x36d30d['model'];_0x36a57b['order']=qs[_0x72af('0x48')](_0x3fb43f[_0x72af('0x3e')]['sort']);_0x36a57b[_0x72af('0x49')]=qs['filters'](_[_0x72af('0x64')](_0x3fb43f[_0x72af('0x3e')],_0x36d30d[_0x72af('0x40')]));if(_0x3fb43f[_0x72af('0x3e')][_0x72af('0x4a')]){_0x36a57b[_0x72af('0x49')]=_[_0x72af('0x4d')](_0x36a57b['where'],{'$or':_[_0x72af('0x39')](_0x36a57b[_0x72af('0x42')],function(_0x567a6f){var _0x4822de={};_0x4822de[_0x567a6f]={'$like':'%'+_0x3fb43f['query']['filter']+'%'};return _0x4822de;})});}_0x36a57b=_[_0x72af('0x4d')]({},_0x36a57b,_0x3fb43f['options']);return _0x3d2e91[_0x72af('0xb4')](_0x36a57b);}})[_0x72af('0x1e')](function(_0x59517b){if(_0x59517b){_0x2f0e3f=_0x59517b[_0x72af('0x45')];if(!_0x3fb43f['query'][_0x72af('0x46')](_0x72af('0x47'))){_0x36a57b[_0x72af('0x2e')]=qs[_0x72af('0x2e')](_0x3fb43f[_0x72af('0x3e')][_0x72af('0x2e')]);_0x36a57b[_0x72af('0x2c')]=qs[_0x72af('0x2c')](_0x3fb43f[_0x72af('0x3e')]['offset']);}return _0x3d2e91[_0x72af('0xb4')](_0x36a57b);}})[_0x72af('0x1e')](function(_0x22ef6e){if(_0x22ef6e){return _0x22ef6e?{'count':_0x2f0e3f,'rows':_0x22ef6e}:null;}})[_0x72af('0x1e')](respondWithResult(_0x28cead,null))[_0x72af('0x28')](handleError(_0x28cead,null));};exports[_0x72af('0xb5')]=function(_0x304b43,_0x236b87,_0x429d93){var _0xd259d4,_0x459fca,_0x36bd88;if(_[_0x72af('0x75')](_0x304b43[_0x72af('0x57')]['body'])||_0x304b43['body'][_0x72af('0x57')]===''){throw new db[(_0x72af('0x6f'))][(_0x72af('0x70'))](_0x72af('0x78'));}if(_[_0x72af('0x75')](_0x304b43['body']['to'])){}_0xd259d4=_0x304b43[_0x72af('0x57')]['to'];return db[_0x72af('0x3a')][_0x72af('0x62')]({'where':{'id':_0x304b43['params']['id']}})[_0x72af('0x1e')](handleEntityNotFound(_0x236b87,null))[_0x72af('0x1e')](function(_0x44fe19){if(_0x44fe19){return db[_0x72af('0x3a')][_0x72af('0x5a')]({'where':{'id':_0x44fe19['id']},'include':[{'model':db[_0x72af('0x7c')],'as':'List','include':[{'model':db[_0x72af('0x6e')],'as':'Contacts','where':{[_0x44fe19['mapKey']]:_0xd259d4},'limit':0x1,'order':[[_0x72af('0x73'),_0x72af('0x7f')]]}]}]})[_0x72af('0x1e')](handleEntityNotFound(_0x236b87,null))['then'](function(_0x5a5a56){if(_0x5a5a56&&_0x5a5a56['List']){_0x459fca=_0x5a5a56[_0x72af('0x34')]({'plain':!![]});if(_0x459fca[_0x72af('0x7d')]&&_0x459fca['List'][_0x72af('0x7e')]['length']){return _0x459fca['List'][_0x72af('0x7e')][0x0];}return db[_0x72af('0x6e')][_0x72af('0x56')](_[_0x72af('0x16')](_0x304b43[_0x72af('0x57')],{'firstName':_0xd259d4,[_0x5a5a56[_0x72af('0x79')]]:_0xd259d4,'phone':_0xd259d4,'ListId':_0x459fca[_0x72af('0x88')]}));}})[_0x72af('0x1e')](handleEntityNotFound(_0x236b87,null))[_0x72af('0x1e')](function(_0x4ace39){if(_0x4ace39){_0x36bd88=_0x4ace39;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x36bd88['id'],'closed':![],'OpenchannelAccountId':_0x459fca['id']}})[_0x72af('0x1e')](function(_0x3725e5){if(_0x3725e5){return[_0x3725e5,![]];}return db[_0x72af('0x8b')][_0x72af('0x56')]({'UserId':_0x304b43['user']['id'],'ContactId':_0x36bd88['id'],'OpenchannelAccountId':_0x459fca['id'],'lastMsgDirection':_0x72af('0xb6'),'Messages':[_[_0x72af('0x4d')](_0x304b43['body'],{'read':![],'body':_0x304b43['body'][_0x72af('0x57')],'OpenchannelAccountId':_0x459fca['id'],'UserId':_0x304b43[_0x72af('0x58')]['id'],'ContactId':_0x36bd88['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})['then'](function(_0x345649){return[_0x345649,!![]];});});}})[_0x72af('0xaf')](function(_0x28bbee,_0x54c4c1){if(_0x54c4c1){return _0x28bbee;}return db['OpenchannelMessage'][_0x72af('0x56')](_[_0x72af('0x4d')](_0x304b43[_0x72af('0x57')],{'read':![],'body':_0x304b43[_0x72af('0x57')][_0x72af('0x57')],'OpenchannelAccountId':_0x459fca['id'],'OpenchannelInteractionId':_0x28bbee['id'],'UserId':_0x304b43['user']['id'],'ContactId':_0x36bd88['id']}))[_0x72af('0x1e')](function(_0x5ec223){_0x28bbee[_0x72af('0xb7')][_0x72af('0xb8')]=[];_0x28bbee[_0x72af('0xb7')]['Messages'][_0x72af('0x93')](_0x5ec223[_0x72af('0xb7')]);return _0x28bbee;});});}})[_0x72af('0x1e')](respondWithResult(_0x236b87,null))[_0x72af('0x28')](handleError(_0x236b87,null));}; \ No newline at end of file +var _0x30fb=['stack','name','send','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','isNil','from','Sequelize','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','CmList','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','orderBy','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','push','close','unmanaged','*,*,*,*','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','bulkCreate','finally','getApplications','getInteractions','User','Owner','fullname','Tag','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','get','OpenchannelAccounts','UserProfileResource','destroy','sendStatus'];(function(_0x347f4e,_0x51235d){var _0x32164d=function(_0x2d5248){while(--_0x2d5248){_0x347f4e['push'](_0x347f4e['shift']());}};_0x32164d(++_0x51235d);}(_0x30fb,0x85));var _0xb30f=function(_0x66e0a8,_0x5bc22a){_0x66e0a8=_0x66e0a8-0x0;var _0x125c46=_0x30fb[_0x66e0a8];return _0x125c46;};'use strict';var emlformat=require(_0xb30f('0x0'));var rimraf=require(_0xb30f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb30f('0x2'));var rp=require('request-promise');var moment=require(_0xb30f('0x3'));var BPromise=require(_0xb30f('0x4'));var Mustache=require('mustache');var util=require(_0xb30f('0x5'));var path=require(_0xb30f('0x6'));var sox=require(_0xb30f('0x7'));var csv=require(_0xb30f('0x8'));var ejs=require(_0xb30f('0x9'));var fs=require('fs');var fs_extra=require(_0xb30f('0xa'));var _=require(_0xb30f('0xb'));var squel=require(_0xb30f('0xc'));var crypto=require(_0xb30f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb30f('0xe'));var toCsv=require(_0xb30f('0x8'));var querystring=require(_0xb30f('0xf'));var Papa=require('papaparse');var Redis=require(_0xb30f('0x10'));var authService=require(_0xb30f('0x11'));var qs=require(_0xb30f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb30f('0x13'));var logger=require(_0xb30f('0x14'))('api');var utils=require(_0xb30f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb30f('0x16'));var db=require(_0xb30f('0x17'))['db'];config['redis']=_[_0xb30f('0x18')](config['redis'],{'host':_0xb30f('0x19'),'port':0x18eb});var socket=require(_0xb30f('0x1a'))(new Redis(config[_0xb30f('0x1b')]));require(_0xb30f('0x1c'))[_0xb30f('0x1d')](socket);var jayson=require(_0xb30f('0x1e'));var client=jayson[_0xb30f('0x1f')][_0xb30f('0x20')]({'port':0x232c});var client9002=jayson[_0xb30f('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x193d6c,_0x1c81e4,_0x927e12,_0x4bc3e8){return new BPromise(function(_0x5a3e8d,_0x569fda){var _0x18086c=_0x4bc3e8||client;return _0x18086c[_0xb30f('0x21')](_0x193d6c,_0x927e12)[_0xb30f('0x22')](function(_0x5e083f){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x1c81e4,_0xb30f('0x23'));logger['debug'](_0xb30f('0x24'),_0x1c81e4,_0xb30f('0x23'),JSON['stringify'](_0x5e083f));if(_0x5e083f[_0xb30f('0x25')]){if(_0x5e083f[_0xb30f('0x25')][_0xb30f('0x26')]===0x1f4){logger[_0xb30f('0x25')](_0xb30f('0x27'),_0x1c81e4,_0x5e083f[_0xb30f('0x25')][_0xb30f('0x28')]);return _0x569fda(_0x5e083f[_0xb30f('0x25')][_0xb30f('0x28')]);}logger[_0xb30f('0x25')](_0xb30f('0x27'),_0x1c81e4,_0x5e083f[_0xb30f('0x25')][_0xb30f('0x28')]);return _0x5a3e8d(_0x5e083f[_0xb30f('0x25')][_0xb30f('0x28')]);}else{logger[_0xb30f('0x29')](_0xb30f('0x27'),_0x1c81e4,'request\x20sent');_0x5a3e8d(_0x5e083f['result'][_0xb30f('0x28')]);}})['catch'](function(_0x11405f){logger[_0xb30f('0x25')](_0xb30f('0x27'),_0x1c81e4,_0x11405f);_0x569fda(_0x11405f);});});}function respondWithStatusCode(_0x2c218e,_0x371b3e){_0x371b3e=_0x371b3e||0xcc;return function(_0x56429d){if(_0x56429d){return _0x2c218e['sendStatus'](_0x371b3e);}return _0x2c218e[_0xb30f('0x2a')](_0x371b3e)[_0xb30f('0x2b')]();};}function respondWithResult(_0x2c12b5,_0x51dc0a){_0x51dc0a=_0x51dc0a||0xc8;return function(_0x36232c){if(_0x36232c){return _0x2c12b5[_0xb30f('0x2a')](_0x51dc0a)[_0xb30f('0x2c')](_0x36232c);}};}function respondWithFilteredResult(_0x1424fe,_0x59e320){return function(_0x481072){if(_0x481072){var _0x1eede7=typeof _0x59e320['offset']===_0xb30f('0x2d')&&typeof _0x59e320[_0xb30f('0x2e')]===_0xb30f('0x2d');var _0x4bb588=_0x481072[_0xb30f('0x2f')];var _0x1a4660=_0x1eede7?0x0:_0x59e320['offset'];var _0x416617=_0x1eede7?_0x481072[_0xb30f('0x2f')]:_0x59e320[_0xb30f('0x30')]+_0x59e320[_0xb30f('0x2e')];var _0xc5b659;if(_0x416617>=_0x4bb588){_0x416617=_0x4bb588;_0xc5b659=0xc8;}else{_0xc5b659=0xce;}_0x1424fe[_0xb30f('0x2a')](_0xc5b659);return _0x1424fe[_0xb30f('0x31')](_0xb30f('0x32'),_0x1a4660+'-'+_0x416617+'/'+_0x4bb588)[_0xb30f('0x2c')](_0x481072);}return null;};}function patchUpdates(_0x24c00f){return function(_0x21b7ea){try{jsonpatch[_0xb30f('0x33')](_0x21b7ea,_0x24c00f,!![]);}catch(_0x54a4d6){return BPromise[_0xb30f('0x34')](_0x54a4d6);}return _0x21b7ea[_0xb30f('0x35')]();};}function saveUpdates(_0x9ea529,_0x34078e){return function(_0x2fbe74){if(_0x2fbe74){return _0x2fbe74['update'](_0x9ea529)[_0xb30f('0x22')](function(_0x10bc99){return _0x10bc99;});}return null;};}function removeEntity(_0x54defd,_0x59042c){return function(_0x321f83){if(_0x321f83){return _0x321f83['destroy']()[_0xb30f('0x22')](function(){var _0x413bc4=_0x321f83[_0xb30f('0x36')]({'plain':!![]});var _0xd029db=_0xb30f('0x37');return db[_0xb30f('0x38')][_0xb30f('0x39')]({'where':{'type':_0xd029db,'resourceId':_0x413bc4['id']}})[_0xb30f('0x22')](function(){return _0x321f83;});})[_0xb30f('0x22')](function(){_0x54defd[_0xb30f('0x2a')](0xcc)[_0xb30f('0x2b')]();});}};}function handleEntityNotFound(_0x41546f,_0xa3048f){return function(_0x46f96f){if(!_0x46f96f){_0x41546f[_0xb30f('0x3a')](0x194);}return _0x46f96f;};}function handleError(_0x1a361a,_0x280eab){_0x280eab=_0x280eab||0x1f4;return function(_0x4e5dd0){logger['error'](_0x4e5dd0[_0xb30f('0x3b')]);if(_0x4e5dd0[_0xb30f('0x3c')]){delete _0x4e5dd0[_0xb30f('0x3c')];}_0x1a361a['status'](_0x280eab)[_0xb30f('0x3d')](_0x4e5dd0);};}exports['index']=function(_0x38f801,_0x117fe5){var _0x51fc2b={'include':[{'model':db[_0xb30f('0x3e')],'as':_0xb30f('0x3f')}]},_0x4823d5={},_0x2dcec1={'count':0x0,'rows':[]};var _0x11e2f4=_[_0xb30f('0x40')](db[_0xb30f('0x41')][_0xb30f('0x42')],function(_0x47228a){return{'name':_0x47228a[_0xb30f('0x43')],'type':_0x47228a['type']['key']};});_0x4823d5['model']=_[_0xb30f('0x40')](_0x11e2f4,'name');_0x4823d5['query']=_[_0xb30f('0x44')](_0x38f801[_0xb30f('0x45')]);_0x4823d5[_0xb30f('0x46')]=_[_0xb30f('0x47')](_0x4823d5[_0xb30f('0x48')],_0x4823d5[_0xb30f('0x45')]);_0x51fc2b[_0xb30f('0x49')]=_[_0xb30f('0x47')](_0x4823d5[_0xb30f('0x48')],qs[_0xb30f('0x4a')](_0x38f801[_0xb30f('0x45')][_0xb30f('0x4a')]));_0x51fc2b[_0xb30f('0x49')]=_0x51fc2b[_0xb30f('0x49')][_0xb30f('0x4b')]?_0x51fc2b[_0xb30f('0x49')]:_0x4823d5[_0xb30f('0x48')];if(!_0x38f801['query'][_0xb30f('0x4c')](_0xb30f('0x4d'))){_0x51fc2b[_0xb30f('0x2e')]=qs[_0xb30f('0x2e')](_0x38f801[_0xb30f('0x45')][_0xb30f('0x2e')]);_0x51fc2b['offset']=qs[_0xb30f('0x30')](_0x38f801[_0xb30f('0x45')][_0xb30f('0x30')]);}_0x51fc2b['order']=qs['sort'](_0x38f801[_0xb30f('0x45')][_0xb30f('0x4e')]);_0x51fc2b['where']=qs[_0xb30f('0x46')](_[_0xb30f('0x4f')](_0x38f801[_0xb30f('0x45')],_0x4823d5[_0xb30f('0x46')]),_0x11e2f4);if(_0x38f801[_0xb30f('0x45')][_0xb30f('0x50')]){_0x51fc2b[_0xb30f('0x51')]=_[_0xb30f('0x52')](_0x51fc2b[_0xb30f('0x51')],{'$or':_[_0xb30f('0x40')](_0x11e2f4,function(_0x9a4372){if(_0x9a4372[_0xb30f('0x53')]!==_0xb30f('0x54')){var _0x1277de={};_0x1277de[_0x9a4372[_0xb30f('0x3c')]]={'$like':'%'+_0x38f801[_0xb30f('0x45')][_0xb30f('0x50')]+'%'};return _0x1277de;}})});}_0x51fc2b=_[_0xb30f('0x52')]({},_0x51fc2b,_0x38f801[_0xb30f('0x55')]);var _0x53c323={'where':_0x51fc2b[_0xb30f('0x51')]};return db['OpenchannelAccount']['count'](_0x53c323)[_0xb30f('0x22')](function(_0x4509c3){_0x2dcec1[_0xb30f('0x2f')]=_0x4509c3;if(_0x38f801['query'][_0xb30f('0x56')]){_0x51fc2b['include']=[{'all':!![]}];}return db[_0xb30f('0x41')][_0xb30f('0x57')](_0x51fc2b);})['then'](function(_0x35c07c){_0x2dcec1[_0xb30f('0x58')]=_0x35c07c;return _0x2dcec1;})[_0xb30f('0x22')](respondWithFilteredResult(_0x117fe5,_0x51fc2b))[_0xb30f('0x59')](handleError(_0x117fe5,null));};exports[_0xb30f('0x5a')]=function(_0x272f90,_0x436f77){var _0xb4a6ce={'raw':![],'where':{'id':_0x272f90[_0xb30f('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0xb30f('0x3f')}]},_0x397178={};_0x397178[_0xb30f('0x48')]=_['keys'](db['OpenchannelAccount']['rawAttributes']);_0x397178[_0xb30f('0x45')]=_[_0xb30f('0x44')](_0x272f90[_0xb30f('0x45')]);_0x397178[_0xb30f('0x46')]=_[_0xb30f('0x47')](_0x397178[_0xb30f('0x48')],_0x397178[_0xb30f('0x45')]);_0xb4a6ce['attributes']=_[_0xb30f('0x47')](_0x397178['model'],qs[_0xb30f('0x4a')](_0x272f90[_0xb30f('0x45')][_0xb30f('0x4a')]));_0xb4a6ce[_0xb30f('0x49')]=_0xb4a6ce['attributes'][_0xb30f('0x4b')]?_0xb4a6ce[_0xb30f('0x49')]:_0x397178[_0xb30f('0x48')];if(_0x272f90[_0xb30f('0x45')][_0xb30f('0x56')]){_0xb4a6ce[_0xb30f('0x5c')]=[{'all':!![]}];}_0xb4a6ce=_['merge']({},_0xb4a6ce,_0x272f90[_0xb30f('0x55')]);return db[_0xb30f('0x41')][_0xb30f('0x5d')](_0xb4a6ce)['then'](handleEntityNotFound(_0x436f77,null))['then'](respondWithResult(_0x436f77,null))['catch'](handleError(_0x436f77,null));};exports[_0xb30f('0x5e')]=function(_0x402b60,_0x4319c1){return db[_0xb30f('0x41')][_0xb30f('0x5e')](_0x402b60[_0xb30f('0x5f')],{})['then'](function(_0x537448){var _0x1afbeb=_0x402b60[_0xb30f('0x60')][_0xb30f('0x36')]({'plain':!![]});if(!_0x1afbeb)throw new Error(_0xb30f('0x61'));if(_0x1afbeb[_0xb30f('0x62')]===_0xb30f('0x60')){var _0xfd702a=_0x537448[_0xb30f('0x36')]({'plain':!![]});var _0x3d8587=_0xb30f('0x37');return db[_0xb30f('0x63')][_0xb30f('0x5d')]({'where':{'name':_0x3d8587,'userProfileId':_0x1afbeb[_0xb30f('0x64')]},'raw':!![]})['then'](function(_0x2b6db5){if(_0x2b6db5&&_0x2b6db5[_0xb30f('0x65')]===0x0){return db[_0xb30f('0x38')][_0xb30f('0x5e')]({'name':_0xfd702a[_0xb30f('0x3c')],'resourceId':_0xfd702a['id'],'type':_0x2b6db5[_0xb30f('0x3c')],'sectionId':_0x2b6db5['id']},{})[_0xb30f('0x22')](function(){return _0x537448;});}else{return _0x537448;}})[_0xb30f('0x59')](function(_0x3297e1){logger[_0xb30f('0x25')](_0xb30f('0x66'),_0x3297e1);throw _0x3297e1;});}return _0x537448;})[_0xb30f('0x22')](respondWithResult(_0x4319c1,0xc9))[_0xb30f('0x59')](handleError(_0x4319c1,null));};exports[_0xb30f('0x67')]=function(_0x38bf6d,_0x17e26d){if(_0x38bf6d[_0xb30f('0x5f')]['id']){delete _0x38bf6d[_0xb30f('0x5f')]['id'];}return db[_0xb30f('0x41')][_0xb30f('0x5d')]({'where':{'id':_0x38bf6d[_0xb30f('0x5b')]['id']},'include':[{'model':db[_0xb30f('0x3e')],'as':_0xb30f('0x3f')}]})[_0xb30f('0x22')](handleEntityNotFound(_0x17e26d,null))[_0xb30f('0x22')](saveUpdates(_0x38bf6d['body'],null))[_0xb30f('0x22')](respondWithResult(_0x17e26d,null))[_0xb30f('0x59')](handleError(_0x17e26d,null));};exports[_0xb30f('0x39')]=function(_0x1053c7,_0xf593e){return db[_0xb30f('0x41')]['find']({'where':{'id':_0x1053c7[_0xb30f('0x5b')]['id']}})[_0xb30f('0x22')](handleEntityNotFound(_0xf593e,null))[_0xb30f('0x22')](removeEntity(_0xf593e,null))['catch'](handleError(_0xf593e,null));};exports[_0xb30f('0x68')]=function(_0x385e85,_0x2133ea){return db[_0xb30f('0x41')][_0xb30f('0x68')]()[_0xb30f('0x22')](respondWithResult(_0x2133ea,null))[_0xb30f('0x59')](handleError(_0x2133ea,null));};exports[_0xb30f('0x69')]=function(_0xa30b5e,_0x142d89,_0x41f2f4){if(_0xa30b5e[_0xb30f('0x5f')]['id']){delete _0xa30b5e[_0xb30f('0x5f')]['id'];}return db['OpenchannelAccount'][_0xb30f('0x5d')]({'where':{'id':_0xa30b5e[_0xb30f('0x5b')]['id']}})[_0xb30f('0x22')](handleEntityNotFound(_0x142d89,null))['then'](function(_0x39ceb8){if(_0x39ceb8){_0xa30b5e[_0xb30f('0x5f')][_0xb30f('0x6a')]=_0x39ceb8['id'];return db[_0xb30f('0x6b')][_0xb30f('0x5e')](_0xa30b5e[_0xb30f('0x5f')]);}})[_0xb30f('0x22')](respondWithResult(_0x142d89,null))[_0xb30f('0x59')](handleError(_0x142d89,null));};exports['getDispositions']=function(_0x4044ed,_0xc5262,_0x279a23){var _0x1ec1c7={'raw':![],'where':{}};var _0x1f42dd={};var _0x4c7de4={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xb30f('0x6c')]({'where':{'id':_0x4044ed['params']['id']}})[_0xb30f('0x22')](handleEntityNotFound(_0xc5262,null))[_0xb30f('0x22')](function(_0x4a3e6c){if(_0x4a3e6c){_0x1f42dd[_0xb30f('0x48')]=_[_0xb30f('0x44')](db[_0xb30f('0x6b')][_0xb30f('0x42')]);_0x1f42dd['query']=_[_0xb30f('0x44')](_0x4044ed[_0xb30f('0x45')]);_0x1f42dd['filters']=_[_0xb30f('0x47')](_0x1f42dd[_0xb30f('0x48')],_0x1f42dd[_0xb30f('0x45')]);_0x1ec1c7[_0xb30f('0x49')]=_[_0xb30f('0x47')](_0x1f42dd[_0xb30f('0x48')],qs[_0xb30f('0x4a')](_0x4044ed['query']['fields']));_0x1ec1c7[_0xb30f('0x49')]=_0x1ec1c7[_0xb30f('0x49')]['length']?_0x1ec1c7[_0xb30f('0x49')]:_0x1f42dd[_0xb30f('0x48')];if(!_0x4044ed[_0xb30f('0x45')][_0xb30f('0x4c')](_0xb30f('0x4d'))){_0x1ec1c7[_0xb30f('0x2e')]=qs[_0xb30f('0x2e')](_0x4044ed[_0xb30f('0x45')]['limit']);_0x1ec1c7[_0xb30f('0x30')]=qs[_0xb30f('0x30')](_0x4044ed['query'][_0xb30f('0x30')]);}_0x1ec1c7[_0xb30f('0x6d')]=qs[_0xb30f('0x4e')](_0x4044ed[_0xb30f('0x45')]['sort']);_0x1ec1c7['where']=qs[_0xb30f('0x46')](_[_0xb30f('0x4f')](_0x4044ed[_0xb30f('0x45')],_0x1f42dd[_0xb30f('0x46')]));_0x1ec1c7['where']['OpenchannelAccountId']=_0x4a3e6c['id'];if(_0x4044ed['query'][_0xb30f('0x50')]){_0x1ec1c7[_0xb30f('0x51')]=_['merge'](_0x1ec1c7[_0xb30f('0x51')],{'$or':_[_0xb30f('0x40')](_0x1ec1c7['attributes'],function(_0x1fc3d8){var _0x3f9064={};_0x3f9064[_0x1fc3d8]={'$like':'%'+_0x4044ed[_0xb30f('0x45')]['filter']+'%'};return _0x3f9064;})});}_0x1ec1c7=_[_0xb30f('0x52')]({},_0x1ec1c7,_0x4044ed[_0xb30f('0x55')]);return db['Disposition'][_0xb30f('0x2f')]({'where':_0x1ec1c7[_0xb30f('0x51')]})['then'](function(_0x3ed3c9){_0x4c7de4['count']=_0x3ed3c9;if(_0x4044ed[_0xb30f('0x45')][_0xb30f('0x56')]){_0x1ec1c7[_0xb30f('0x5c')]=[{'all':!![]}];}return db[_0xb30f('0x6b')]['findAll'](_0x1ec1c7);})['then'](function(_0x312f28){_0x4c7de4[_0xb30f('0x58')]=_0x312f28;return _0x4c7de4;});}})['then'](respondWithFilteredResult(_0xc5262,_0x1ec1c7))['catch'](handleError(_0xc5262,null));};exports[_0xb30f('0x6e')]=function(_0xc63b14,_0x48021a,_0x2f33a7){return db[_0xb30f('0x41')][_0xb30f('0x5d')]({'where':{'id':_0xc63b14[_0xb30f('0x5b')]['id']}})[_0xb30f('0x22')](handleEntityNotFound(_0x48021a,null))[_0xb30f('0x22')](function(_0x533b2e){if(_0x533b2e){return _0x533b2e[_0xb30f('0x6e')](_0xc63b14['query']['ids']);}})[_0xb30f('0x22')](respondWithStatusCode(_0x48021a,null))[_0xb30f('0x59')](handleError(_0x48021a,null));};exports[_0xb30f('0x6f')]=function(_0x1808e4,_0xeb2955,_0x5ea6dd){if(_0x1808e4[_0xb30f('0x5f')]['id']){delete _0x1808e4['body']['id'];}return db[_0xb30f('0x41')]['find']({'where':{'id':_0x1808e4[_0xb30f('0x5b')]['id']}})[_0xb30f('0x22')](handleEntityNotFound(_0xeb2955,null))[_0xb30f('0x22')](function(_0x3cd504){if(_0x3cd504){_0x1808e4[_0xb30f('0x5f')][_0xb30f('0x6a')]=_0x3cd504['id'];return db[_0xb30f('0x70')]['create'](_0x1808e4[_0xb30f('0x5f')]);}})[_0xb30f('0x22')](respondWithResult(_0xeb2955,null))[_0xb30f('0x59')](handleError(_0xeb2955,null));};exports[_0xb30f('0x71')]=function(_0x38bbf0,_0x8be41d,_0x5d4c85){var _0x15125e={'raw':![],'where':{}};var _0x174e32={};var _0x54f431={'count':0x0,'rows':[]};return db[_0xb30f('0x41')][_0xb30f('0x6c')]({'where':{'id':_0x38bbf0[_0xb30f('0x5b')]['id']}})[_0xb30f('0x22')](handleEntityNotFound(_0x8be41d,null))[_0xb30f('0x22')](function(_0x59850d){if(_0x59850d){_0x174e32['model']=_[_0xb30f('0x44')](db[_0xb30f('0x70')][_0xb30f('0x42')]);_0x174e32[_0xb30f('0x45')]=_['keys'](_0x38bbf0['query']);_0x174e32['filters']=_[_0xb30f('0x47')](_0x174e32[_0xb30f('0x48')],_0x174e32[_0xb30f('0x45')]);_0x15125e['attributes']=_[_0xb30f('0x47')](_0x174e32[_0xb30f('0x48')],qs[_0xb30f('0x4a')](_0x38bbf0[_0xb30f('0x45')][_0xb30f('0x4a')]));_0x15125e[_0xb30f('0x49')]=_0x15125e[_0xb30f('0x49')][_0xb30f('0x4b')]?_0x15125e['attributes']:_0x174e32[_0xb30f('0x48')];if(!_0x38bbf0[_0xb30f('0x45')][_0xb30f('0x4c')](_0xb30f('0x4d'))){_0x15125e[_0xb30f('0x2e')]=qs[_0xb30f('0x2e')](_0x38bbf0[_0xb30f('0x45')]['limit']);_0x15125e[_0xb30f('0x30')]=qs['offset'](_0x38bbf0[_0xb30f('0x45')][_0xb30f('0x30')]);}_0x15125e['order']=qs[_0xb30f('0x4e')](_0x38bbf0['query'][_0xb30f('0x4e')]);_0x15125e['where']=qs[_0xb30f('0x46')](_['pick'](_0x38bbf0[_0xb30f('0x45')],_0x174e32[_0xb30f('0x46')]));_0x15125e[_0xb30f('0x51')][_0xb30f('0x6a')]=_0x59850d['id'];if(_0x38bbf0[_0xb30f('0x45')]['filter']){_0x15125e[_0xb30f('0x51')]=_[_0xb30f('0x52')](_0x15125e[_0xb30f('0x51')],{'$or':_[_0xb30f('0x40')](_0x15125e['attributes'],function(_0x22cce8){var _0x167a57={};_0x167a57[_0x22cce8]={'$like':'%'+_0x38bbf0[_0xb30f('0x45')]['filter']+'%'};return _0x167a57;})});}_0x15125e=_[_0xb30f('0x52')]({},_0x15125e,_0x38bbf0['options']);return db['CannedAnswer'][_0xb30f('0x2f')]({'where':_0x15125e[_0xb30f('0x51')]})[_0xb30f('0x22')](function(_0x1df357){_0x54f431[_0xb30f('0x2f')]=_0x1df357;if(_0x38bbf0[_0xb30f('0x45')][_0xb30f('0x56')]){_0x15125e[_0xb30f('0x5c')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x15125e);})[_0xb30f('0x22')](function(_0x127a52){_0x54f431[_0xb30f('0x58')]=_0x127a52;return _0x54f431;});}})['then'](respondWithFilteredResult(_0x8be41d,_0x15125e))[_0xb30f('0x59')](handleError(_0x8be41d,null));};exports[_0xb30f('0x72')]=function(_0x2ac358,_0x263b26,_0x4c6d59){return db[_0xb30f('0x41')][_0xb30f('0x5d')]({'where':{'id':_0x2ac358[_0xb30f('0x5b')]['id']}})[_0xb30f('0x22')](handleEntityNotFound(_0x263b26,null))[_0xb30f('0x22')](function(_0xeae2b6){if(_0xeae2b6){return _0xeae2b6[_0xb30f('0x72')](_0x2ac358[_0xb30f('0x45')][_0xb30f('0x73')]);}})[_0xb30f('0x22')](respondWithStatusCode(_0x263b26,null))[_0xb30f('0x59')](handleError(_0x263b26,null));};exports[_0xb30f('0x74')]=function(_0x28c38a,_0x44c6fd,_0x21bb9e){var _0x3d4133={'body':_0x28c38a[_0xb30f('0x5f')],'channel':_0xb30f('0x75')};var _0x335d60=[];var _0x4820bf=[];var _0x554ddb={};var _0x179778=![];return db[_0xb30f('0x76')][_0xb30f('0x68')]()['then'](function(_0x9d73ab){if(!_0x9d73ab){throw new db['Sequelize'][(_0xb30f('0x77'))](_0xb30f('0x78'));}_0x335d60=_['difference'](_['keys'](_0x9d73ab),['createdAt',_0xb30f('0x79')]);_0x4820bf=_[_0xb30f('0x7a')](_[_0xb30f('0x44')](_0x9d73ab),[_0xb30f('0x7b'),_0xb30f('0x79'),_0xb30f('0x7c'),_0xb30f('0x7d')]);if(_0x28c38a[_0xb30f('0x5f')]['id']){delete _0x28c38a[_0xb30f('0x5f')]['id'];}if(_[_0xb30f('0x7e')](_0x28c38a[_0xb30f('0x5f')][_0xb30f('0x7f')])){throw new db[(_0xb30f('0x80'))][(_0xb30f('0x77'))](_0xb30f('0x81'));}if(_[_0xb30f('0x7e')](_0x28c38a[_0xb30f('0x5f')]['body'])||_0x28c38a['body'][_0xb30f('0x5f')]===''){throw new db[(_0xb30f('0x80'))]['ValidationError'](_0xb30f('0x82'));}if(_['isNil'](_0x28c38a['body'][_0xb30f('0x83')])){throw new db[(_0xb30f('0x80'))]['ValidationError'](_0xb30f('0x84')+_0x4820bf);}if(!_['includes'](_0x4820bf,_0x28c38a['body'][_0xb30f('0x83')])){throw new db[(_0xb30f('0x80'))][(_0xb30f('0x77'))](_0xb30f('0x85')+_0x4820bf);}_0x554ddb[_0x28c38a[_0xb30f('0x5f')][_0xb30f('0x83')]]=_0x28c38a[_0xb30f('0x5f')][_0xb30f('0x7f')];})[_0xb30f('0x22')](function(){return db['OpenchannelAccount'][_0xb30f('0x5d')]({'where':{'id':_0x28c38a[_0xb30f('0x5b')]['id']},'include':[{'model':db[_0xb30f('0x86')],'as':'List','include':[{'model':db[_0xb30f('0x76')],'as':_0xb30f('0x87'),'where':_0x554ddb,'limit':0x1,'order':[[_0xb30f('0x79'),_0xb30f('0x88')]]}]},{'model':db[_0xb30f('0x89')],'as':_0xb30f('0x8a')}]});})[_0xb30f('0x22')](handleEntityNotFound(_0x44c6fd,null))[_0xb30f('0x22')](function(_0x4e750c){if(_0x4e750c&&_0x4e750c[_0xb30f('0x8b')]){_0x3d4133[_0xb30f('0x8c')]=_0x4e750c;_0x3d4133[_0xb30f('0x8d')]=_0x4e750c['Applications'];_0x3d4133[_0xb30f('0x8e')]=_0x4e750c[_0xb30f('0x8b')];_0x3d4133[_0xb30f('0x8d')]=_[_0xb30f('0x8f')](_0x3d4133[_0xb30f('0x8d')],['priority'],[_0xb30f('0x90')]);if(_0x3d4133[_0xb30f('0x8c')][_0xb30f('0x8a')]){delete _0x3d4133['account'][_0xb30f('0x8a')];}if(_0x3d4133[_0xb30f('0x8c')]['List']&&_0x3d4133[_0xb30f('0x8c')]['List'][_0xb30f('0x87')][_0xb30f('0x4b')]){return _0x3d4133[_0xb30f('0x8c')]['List'][_0xb30f('0x87')][0x0];}var _0x3674bc=_[_0xb30f('0x18')](_0x28c38a[_0xb30f('0x5f')],{'firstName':_0x28c38a[_0xb30f('0x5f')][_0xb30f('0x7f')],'ListId':_0x4e750c['ListId']});_0x3674bc[_0x28c38a['body'][_0xb30f('0x83')]]=_0x28c38a[_0xb30f('0x5f')]['from'];return db[_0xb30f('0x76')]['create'](_0x3674bc,{'fields':_0x335d60,'raw':!![]});}})[_0xb30f('0x22')](handleEntityNotFound(_0x44c6fd,null))['then'](function(_0x2e869e){_0x3d4133[_0xb30f('0x91')]=_0x2e869e;if(_0x2e869e){var _0x265247={'ContactId':_0x2e869e['id'],'OpenchannelAccountId':_0x28c38a['params']['id'],'from':(_0x2e869e[_0xb30f('0x92')]||'')+'\x20'+(_0x2e869e[_0xb30f('0x93')]||'')};var _0x578d0a={'OpenchannelAccountId':_0x28c38a[_0xb30f('0x5b')]['id'],'closed':![]};if(_0x28c38a['body'][_0xb30f('0x94')]){_0x578d0a[_0xb30f('0x94')]=_0x28c38a['body']['threadId'];return db[_0xb30f('0x95')]['find']({'where':_0x578d0a})[_0xb30f('0x22')](function(_0x3e9ce5){if(_0x3e9ce5){return[_0x3e9ce5,![]];}_0x265247['threadId']=_0x28c38a[_0xb30f('0x5f')][_0xb30f('0x94')];_0x265247[_0xb30f('0x96')]=_0x28c38a['body']['externalUrl'];return db[_0xb30f('0x95')][_0xb30f('0x5e')](_0x265247)['then'](function(_0x40adf3){return[_0x40adf3,!![]];});});}else{_0x578d0a[_0xb30f('0x94')]=null;}_0x578d0a[_0xb30f('0x97')]=_0x2e869e['id'];return db[_0xb30f('0x95')][_0xb30f('0x5d')]({'where':_0x578d0a})[_0xb30f('0x22')](function(_0x57794f){if(_0x57794f){return[_0x57794f,![]];}return db[_0xb30f('0x95')][_0xb30f('0x5e')](_0x265247)['then'](function(_0x47d112){return[_0x47d112,!![]];});});}})[_0xb30f('0x98')](function(_0x463f0b,_0x39584d){if(_0x463f0b){_0x179778=_0x39584d;if(!_0x39584d){var _0x3ef0a1={'from':(_0x3d4133[_0xb30f('0x91')][_0xb30f('0x92')]||'')+'\x20'+(_0x3d4133[_0xb30f('0x91')]['lastName']||'')};if(_0x28c38a['body'][_0xb30f('0x94')]&&_0x28c38a['body'][_0xb30f('0x99')]&&_0x28c38a[_0xb30f('0x5f')][_0xb30f('0x94')]!=_0x28c38a[_0xb30f('0x5f')][_0xb30f('0x99')]){_0x3ef0a1['threadId']=_0x28c38a['body']['messageId'];}return _0x463f0b[_0xb30f('0x67')](_0x3ef0a1);}else{return _0x463f0b;}}})[_0xb30f('0x22')](function(_0x588c52){_0x3d4133[_0xb30f('0x9a')]=_0x588c52[_0xb30f('0x36')]({'plain':!![]});_0x3d4133[_0xb30f('0x9a')]['created']=_0x179778;if(_0x3d4133[_0xb30f('0x9a')][_0xb30f('0x9b')]){if(_0x3d4133[_0xb30f('0x8c')]['autoclose']){_0x3d4133[_0xb30f('0x8d')][_0xb30f('0x9c')]({'id':0x0,'priority':_0x3d4133[_0xb30f('0x8d')]['length']+0x1,'app':_0xb30f('0x9d'),'appdata':_0xb30f('0x9e'),'interval':_0xb30f('0x9f')});}}return db['OpenchannelMessage'][_0xb30f('0x5e')]({'body':_0x28c38a['body'][_0xb30f('0x5f')],'OpenchannelAccountId':_0x28c38a[_0xb30f('0x5b')]['id'],'OpenchannelInteractionId':_0x588c52['id'],'direction':'in','ContactId':_0x3d4133[_0xb30f('0x91')]['id'],'AttachmentId':_0x28c38a['body']['AttachmentId']});})[_0xb30f('0x22')](function(_0x52d7cf){_0x3d4133[_0xb30f('0x28')]=_0x52d7cf;if(_0x3d4133[_0xb30f('0x9a')]['UserId']){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x3d4133[_0xb30f('0x9a')][_0xb30f('0xa0')]}})[_0xb30f('0x22')](function(_0x69c717){if(_0x69c717){_0x3d4133['applications'][_0xb30f('0xa1')]({'id':0x0,'priority':0x0,'app':_0xb30f('0xa2'),'appdata':_0x69c717['name']+','+(_0x3d4133[_0xb30f('0x8c')][_0xb30f('0xa3')]||0xa),'interval':_0xb30f('0x9f')});_0x3d4133['forcedOwnership']=![];}return respondWithRpcPromise(_0xb30f('0xa4'),_0xb30f('0xa5'),_0x3d4133);});}return respondWithRpcPromise(_0xb30f('0xa4'),'startRouting',_0x3d4133);})[_0xb30f('0x22')](function(_0x54a833){respondWithRpcPromise(_0xb30f('0xa6'),_0xb30f('0xa6'),{'event':_0xb30f('0x74'),'message':_0x54a833},client9002);return _0x54a833;})[_0xb30f('0x22')](respondWithResult(_0x44c6fd,null))[_0xb30f('0x59')](handleError(_0x44c6fd,null));};exports[_0xb30f('0xa7')]=function(_0x20ff86,_0x3ed9d2){var _0x3ba200=_0x20ff86[_0xb30f('0x5b')]['id'];var _0x6434fa=_0x20ff86[_0xb30f('0x5f')];var _0x5c07b6=0xc8;var _0x37fb02=null;return db[_0xb30f('0xa8')][_0xb30f('0xa9')]({'isolationLevel':db[_0xb30f('0xa8')]['Transaction'][_0xb30f('0xaa')]['READ_COMMITTED']},function(_0x21e648){return db[_0xb30f('0x41')][_0xb30f('0x6c')]({'where':{'id':_0x3ba200},'transaction':_0x21e648})[_0xb30f('0x22')](function(_0x30d8c2){if(_0x30d8c2){return db[_0xb30f('0x89')][_0xb30f('0x39')]({'where':{'OpenchannelAccountId':_0x3ba200},'transaction':_0x21e648})[_0xb30f('0x22')](function(){var _0x23e32e=_['map'](_0x6434fa,function(_0x4d5dec){_0x4d5dec[_0xb30f('0x6a')]=_0x3ba200;return _0x4d5dec;});return db['OpenchannelApplication'][_0xb30f('0xab')](_0x23e32e,{'transaction':_0x21e648});});}else{_0x5c07b6=0x194;_0x37fb02=[];}});})[_0xb30f('0x22')](function(){if(_0x5c07b6!==0x194){return db[_0xb30f('0x89')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x3ba200},'order':'priority'})[_0xb30f('0x22')](function(_0x323fec){_0x37fb02=_0x323fec;});}})['catch'](function(_0x52cddc){_0x5c07b6=0x1f4;logger[_0xb30f('0x25')](_0x52cddc['stack']);if(_0x52cddc['name']){delete _0x52cddc[_0xb30f('0x3c')];}_0x37fb02=_0x52cddc;})[_0xb30f('0xac')](function(){if(_0x37fb02===null){_0x3ed9d2[_0xb30f('0x3a')](_0x5c07b6);}else{if(_0x5c07b6===0x1f4){_0x3ed9d2[_0xb30f('0x2a')](_0x5c07b6)['send'](_0x37fb02);}else{_0x3ed9d2[_0xb30f('0x2a')](_0x5c07b6)[_0xb30f('0x2c')](_0x37fb02);}}});};exports[_0xb30f('0xad')]=function(_0x5b685c,_0x148ab9,_0xe4363c){var _0xe0b68f={};var _0x21d107={};var _0x4417b3;var _0x520db7;return db[_0xb30f('0x41')][_0xb30f('0x6c')]({'where':{'id':_0x5b685c[_0xb30f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x148ab9,null))['then'](function(_0x2527a7){if(_0x2527a7){_0x4417b3=_0x2527a7;_0x21d107[_0xb30f('0x48')]=_[_0xb30f('0x44')](db[_0xb30f('0x89')]['rawAttributes']);_0x21d107[_0xb30f('0x45')]=_['keys'](_0x5b685c['query']);_0x21d107[_0xb30f('0x46')]=_[_0xb30f('0x47')](_0x21d107[_0xb30f('0x48')],_0x21d107[_0xb30f('0x45')]);_0xe0b68f[_0xb30f('0x49')]=_[_0xb30f('0x47')](_0x21d107['model'],qs[_0xb30f('0x4a')](_0x5b685c[_0xb30f('0x45')][_0xb30f('0x4a')]));_0xe0b68f[_0xb30f('0x49')]=_0xe0b68f[_0xb30f('0x49')][_0xb30f('0x4b')]?_0xe0b68f[_0xb30f('0x49')]:_0x21d107['model'];_0xe0b68f[_0xb30f('0x6d')]=qs[_0xb30f('0x4e')](_0x5b685c[_0xb30f('0x45')][_0xb30f('0x4e')]);_0xe0b68f[_0xb30f('0x51')]=qs[_0xb30f('0x46')](_['pick'](_0x5b685c['query'],_0x21d107[_0xb30f('0x46')]));if(_0x5b685c[_0xb30f('0x45')]['filter']){_0xe0b68f[_0xb30f('0x51')]=_[_0xb30f('0x52')](_0xe0b68f[_0xb30f('0x51')],{'$or':_[_0xb30f('0x40')](_0xe0b68f[_0xb30f('0x49')],function(_0x2c8696){var _0x5a87ae={};_0x5a87ae[_0x2c8696]={'$like':'%'+_0x5b685c[_0xb30f('0x45')]['filter']+'%'};return _0x5a87ae;})});}_0xe0b68f=_[_0xb30f('0x52')]({},_0xe0b68f,_0x5b685c['options']);return _0x4417b3['getApplications'](_0xe0b68f);}})[_0xb30f('0x22')](function(_0x13d07e){if(_0x13d07e){_0x520db7=_0x13d07e[_0xb30f('0x4b')];if(!_0x5b685c[_0xb30f('0x45')]['hasOwnProperty'](_0xb30f('0x4d'))){_0xe0b68f[_0xb30f('0x2e')]=qs[_0xb30f('0x2e')](_0x5b685c['query'][_0xb30f('0x2e')]);_0xe0b68f[_0xb30f('0x30')]=qs[_0xb30f('0x30')](_0x5b685c['query'][_0xb30f('0x30')]);}return _0x4417b3[_0xb30f('0xad')](_0xe0b68f);}})[_0xb30f('0x22')](function(_0x51c884){if(_0x51c884){return _0x51c884?{'count':_0x520db7,'rows':_0x51c884}:null;}})['then'](respondWithResult(_0x148ab9,null))[_0xb30f('0x59')](handleError(_0x148ab9,null));};exports[_0xb30f('0xae')]=function(_0x5cef0c,_0x4895fa,_0x5084e7){var _0x4f4e45={'raw':![],'where':{}};var _0x10ff36={};var _0x1aa1e0={'count':0x0,'rows':[]};return db[_0xb30f('0x41')][_0xb30f('0x6c')]({'where':{'id':_0x5cef0c[_0xb30f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4895fa,null))['then'](function(_0x593879){if(_0x593879){_0x10ff36[_0xb30f('0x48')]=_[_0xb30f('0x44')](db[_0xb30f('0x95')][_0xb30f('0x42')]);_0x10ff36[_0xb30f('0x45')]=_[_0xb30f('0x44')](_0x5cef0c[_0xb30f('0x45')]);_0x10ff36[_0xb30f('0x46')]=_['intersection'](_0x10ff36['model'],_0x10ff36[_0xb30f('0x45')]);_0x4f4e45['attributes']=_[_0xb30f('0x47')](_0x10ff36[_0xb30f('0x48')],qs[_0xb30f('0x4a')](_0x5cef0c[_0xb30f('0x45')][_0xb30f('0x4a')]));_0x4f4e45[_0xb30f('0x49')]=_0x4f4e45[_0xb30f('0x49')][_0xb30f('0x4b')]?_0x4f4e45['attributes']:_0x10ff36[_0xb30f('0x48')];if(!_0x5cef0c[_0xb30f('0x45')][_0xb30f('0x4c')](_0xb30f('0x4d'))){_0x4f4e45[_0xb30f('0x2e')]=qs[_0xb30f('0x2e')](_0x5cef0c[_0xb30f('0x45')]['limit']);_0x4f4e45['offset']=qs[_0xb30f('0x30')](_0x5cef0c[_0xb30f('0x45')][_0xb30f('0x30')]);}_0x4f4e45['order']=qs['sort'](_0x5cef0c[_0xb30f('0x45')][_0xb30f('0x4e')]);_0x4f4e45[_0xb30f('0x51')]=qs[_0xb30f('0x46')](_[_0xb30f('0x4f')](_0x5cef0c[_0xb30f('0x45')],_0x10ff36['filters']));_0x4f4e45[_0xb30f('0x51')][_0xb30f('0x6a')]=_0x593879['id'];if(_0x5cef0c['query'][_0xb30f('0x50')]){_0x4f4e45[_0xb30f('0x51')]=_[_0xb30f('0x52')](_0x4f4e45[_0xb30f('0x51')],{'$or':_[_0xb30f('0x40')](_0x4f4e45[_0xb30f('0x49')],function(_0x4a8349){var _0x34ac94={};_0x34ac94[_0x4a8349]={'$like':'%'+_0x5cef0c[_0xb30f('0x45')]['filter']+'%'};return _0x34ac94;})});}_0x4f4e45=_[_0xb30f('0x52')]({},_0x4f4e45,_0x5cef0c[_0xb30f('0x55')]);return db[_0xb30f('0x95')][_0xb30f('0x2f')]({'where':_0x4f4e45[_0xb30f('0x51')]})[_0xb30f('0x22')](function(_0x5af8ba){_0x1aa1e0[_0xb30f('0x2f')]=_0x5af8ba;if(_0x5cef0c[_0xb30f('0x45')]['includeAll']){_0x4f4e45[_0xb30f('0x5c')]=[{'model':db[_0xb30f('0x76')],'as':'Contact','required':![]},{'model':db[_0xb30f('0xaf')],'as':_0xb30f('0xb0'),'attributes':[_0xb30f('0x3c'),_0xb30f('0xb1'),'internal'],'required':![]},{'model':db[_0xb30f('0xb2')],'as':'Tags','attributes':['id',_0xb30f('0x3c'),_0xb30f('0xb3')],'where':_0x5cef0c[_0xb30f('0x45')][_0xb30f('0xb4')]?{'id':_0x5cef0c['query'][_0xb30f('0xb4')]}:undefined,'required':_0x5cef0c[_0xb30f('0x45')][_0xb30f('0xb4')]?!![]:![]}];}return db[_0xb30f('0x95')][_0xb30f('0x57')](_0x4f4e45);})[_0xb30f('0x22')](function(_0x2c2cb6){_0x1aa1e0[_0xb30f('0x58')]=_0x2c2cb6;return _0x1aa1e0;});}})[_0xb30f('0x22')](respondWithFilteredResult(_0x4895fa,_0x4f4e45))[_0xb30f('0x59')](handleError(_0x4895fa,null));};exports[_0xb30f('0xb5')]=function(_0xe1dc0c,_0x16d737,_0x15c4e5){return db[_0xb30f('0x41')]['find']({'where':{'id':_0xe1dc0c['params']['id']}})['then'](handleEntityNotFound(_0x16d737,null))[_0xb30f('0x22')](function(_0x32d2a9){if(_0x32d2a9){return _0x32d2a9[_0xb30f('0xb5')](_0xe1dc0c[_0xb30f('0x5f')][_0xb30f('0x73')],_['omit'](_0xe1dc0c[_0xb30f('0x5f')],[_0xb30f('0x73'),'id'])||{})[_0xb30f('0x98')](function(_0x518194){for(var _0x54d1ae=0x0;_0x54d1ae<_0xe1dc0c[_0xb30f('0x5f')]['ids'][_0xb30f('0x4b')];_0x54d1ae+=0x1){socket[_0xb30f('0xb6')](_0xb30f('0xb7'),{'UserId':Number(_0xe1dc0c['body'][_0xb30f('0x73')][_0x54d1ae]),'OpenchannelAccountId':Number(_0xe1dc0c[_0xb30f('0x5b')]['id'])});}return _0x518194;});}})[_0xb30f('0x22')](respondWithResult(_0x16d737,null))[_0xb30f('0x59')](handleError(_0x16d737,null));};exports[_0xb30f('0xb8')]=function(_0x45152a,_0x374b95,_0x14761a){return db[_0xb30f('0x41')][_0xb30f('0x5d')]({'where':{'id':_0x45152a[_0xb30f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x374b95,null))[_0xb30f('0x22')](function(_0x20f551){if(_0x20f551){return _0x20f551[_0xb30f('0xb8')](_0x45152a[_0xb30f('0x45')][_0xb30f('0x73')])[_0xb30f('0x22')](function(){if(_[_0xb30f('0xb9')](_0x45152a[_0xb30f('0x45')][_0xb30f('0x73')])){for(var _0x4e129a=0x0;_0x4e129a<_0x45152a[_0xb30f('0x45')][_0xb30f('0x73')][_0xb30f('0x4b')];_0x4e129a+=0x1){socket[_0xb30f('0xb6')](_0xb30f('0xba'),{'UserId':Number(_0x45152a['query'][_0xb30f('0x73')][_0x4e129a]),'OpenchannelAccountId':Number(_0x45152a[_0xb30f('0x5b')]['id'])});}}else{socket[_0xb30f('0xb6')](_0xb30f('0xba'),{'UserId':Number(_0x45152a[_0xb30f('0x45')][_0xb30f('0x73')]),'OpenchannelAccountId':Number(_0x45152a[_0xb30f('0x5b')]['id'])});}});}})[_0xb30f('0x22')](respondWithStatusCode(_0x374b95,null))[_0xb30f('0x59')](handleError(_0x374b95,null));};exports[_0xb30f('0xbb')]=function(_0xcb20,_0x29f76d,_0x2da449){var _0x2d60a5={};var _0x1f5fc9={};var _0x3a321;var _0x1cde02;return db[_0xb30f('0x41')]['findOne']({'where':{'id':_0xcb20[_0xb30f('0x5b')]['id']}})[_0xb30f('0x22')](handleEntityNotFound(_0x29f76d,null))[_0xb30f('0x22')](function(_0x506ad7){if(_0x506ad7){_0x3a321=_0x506ad7;_0x1f5fc9[_0xb30f('0x48')]=_[_0xb30f('0x44')](db[_0xb30f('0xaf')][_0xb30f('0x42')]);_0x1f5fc9[_0xb30f('0x45')]=_[_0xb30f('0x44')](_0xcb20[_0xb30f('0x45')]);_0x1f5fc9[_0xb30f('0x46')]=_[_0xb30f('0x47')](_0x1f5fc9[_0xb30f('0x48')],_0x1f5fc9['query']);_0x2d60a5[_0xb30f('0x49')]=_['intersection'](_0x1f5fc9[_0xb30f('0x48')],qs[_0xb30f('0x4a')](_0xcb20[_0xb30f('0x45')][_0xb30f('0x4a')]));_0x2d60a5[_0xb30f('0x49')]=_0x2d60a5['attributes'][_0xb30f('0x4b')]?_0x2d60a5[_0xb30f('0x49')]:_0x1f5fc9[_0xb30f('0x48')];_0x2d60a5[_0xb30f('0x6d')]=qs['sort'](_0xcb20[_0xb30f('0x45')][_0xb30f('0x4e')]);_0x2d60a5['where']=qs[_0xb30f('0x46')](_['pick'](_0xcb20[_0xb30f('0x45')],_0x1f5fc9[_0xb30f('0x46')]));if(_0xcb20[_0xb30f('0x45')][_0xb30f('0x50')]){_0x2d60a5[_0xb30f('0x51')]=_['merge'](_0x2d60a5[_0xb30f('0x51')],{'$or':_[_0xb30f('0x40')](_0x2d60a5[_0xb30f('0x49')],function(_0x51a580){var _0x27deda={};_0x27deda[_0x51a580]={'$like':'%'+_0xcb20[_0xb30f('0x45')]['filter']+'%'};return _0x27deda;})});}_0x2d60a5=_['merge']({},_0x2d60a5,_0xcb20[_0xb30f('0x55')]);return _0x3a321['getAgents'](_0x2d60a5);}})[_0xb30f('0x22')](function(_0x256dfc){if(_0x256dfc){_0x1cde02=_0x256dfc[_0xb30f('0x4b')];if(!_0xcb20[_0xb30f('0x45')]['hasOwnProperty'](_0xb30f('0x4d'))){_0x2d60a5[_0xb30f('0x2e')]=qs['limit'](_0xcb20[_0xb30f('0x45')][_0xb30f('0x2e')]);_0x2d60a5[_0xb30f('0x30')]=qs[_0xb30f('0x30')](_0xcb20['query'][_0xb30f('0x30')]);}return _0x3a321[_0xb30f('0xbb')](_0x2d60a5);}})[_0xb30f('0x22')](function(_0x1231c7){if(_0x1231c7){return _0x1231c7?{'count':_0x1cde02,'rows':_0x1231c7}:null;}})[_0xb30f('0x22')](respondWithResult(_0x29f76d,null))['catch'](handleError(_0x29f76d,null));};exports[_0xb30f('0x3d')]=function(_0x49f22a,_0x4f048d,_0x233cf4){var _0x39d9d8,_0x3b73b0,_0x297de9;if(_[_0xb30f('0x7e')](_0x49f22a[_0xb30f('0x5f')][_0xb30f('0x5f')])||_0x49f22a['body'][_0xb30f('0x5f')]===''){throw new db['Sequelize'][(_0xb30f('0x77'))](_0xb30f('0x82'));}if(_[_0xb30f('0x7e')](_0x49f22a[_0xb30f('0x5f')]['to'])){}_0x39d9d8=_0x49f22a[_0xb30f('0x5f')]['to'];return db[_0xb30f('0x41')][_0xb30f('0x6c')]({'where':{'id':_0x49f22a[_0xb30f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4f048d,null))[_0xb30f('0x22')](function(_0x1f38e6){if(_0x1f38e6){return db[_0xb30f('0x41')]['find']({'where':{'id':_0x1f38e6['id']},'include':[{'model':db[_0xb30f('0x86')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x1f38e6[_0xb30f('0x83')]]:_0x39d9d8},'limit':0x1,'order':[[_0xb30f('0x79'),_0xb30f('0x88')]]}]}]})[_0xb30f('0x22')](handleEntityNotFound(_0x4f048d,null))[_0xb30f('0x22')](function(_0x2c6310){if(_0x2c6310&&_0x2c6310['List']){_0x3b73b0=_0x2c6310[_0xb30f('0x36')]({'plain':!![]});if(_0x3b73b0[_0xb30f('0x8b')]&&_0x3b73b0[_0xb30f('0x8b')]['Contacts'][_0xb30f('0x4b')]){return _0x3b73b0[_0xb30f('0x8b')][_0xb30f('0x87')][0x0];}return db[_0xb30f('0x76')][_0xb30f('0x5e')](_['defaults'](_0x49f22a['body'],{'firstName':_0x39d9d8,[_0x2c6310[_0xb30f('0x83')]]:_0x39d9d8,'phone':_0x39d9d8,'ListId':_0x3b73b0[_0xb30f('0x7d')]}));}})[_0xb30f('0x22')](handleEntityNotFound(_0x4f048d,null))[_0xb30f('0x22')](function(_0x5d3b19){if(_0x5d3b19){_0x297de9=_0x5d3b19;return db['OpenchannelInteraction'][_0xb30f('0x5d')]({'where':{'ContactId':_0x297de9['id'],'closed':![],'OpenchannelAccountId':_0x3b73b0['id']}})['then'](function(_0x1096ea){if(_0x1096ea){return[_0x1096ea,![]];}return db[_0xb30f('0x95')][_0xb30f('0x5e')]({'UserId':_0x49f22a[_0xb30f('0x60')]['id'],'ContactId':_0x297de9['id'],'OpenchannelAccountId':_0x3b73b0['id'],'lastMsgDirection':_0xb30f('0xbc'),'Messages':[_[_0xb30f('0x52')](_0x49f22a[_0xb30f('0x5f')],{'read':![],'body':_0x49f22a['body'][_0xb30f('0x5f')],'OpenchannelAccountId':_0x3b73b0['id'],'UserId':_0x49f22a[_0xb30f('0x60')]['id'],'ContactId':_0x297de9['id']})]},{'include':[{'model':db[_0xb30f('0xbd')],'as':_0xb30f('0xbe')}]})[_0xb30f('0x22')](function(_0x542e65){return[_0x542e65,!![]];});});}})[_0xb30f('0x98')](function(_0x39436a,_0x17c801){if(_0x17c801){return _0x39436a;}return db[_0xb30f('0xbd')]['create'](_['merge'](_0x49f22a[_0xb30f('0x5f')],{'read':![],'body':_0x49f22a[_0xb30f('0x5f')]['body'],'OpenchannelAccountId':_0x3b73b0['id'],'OpenchannelInteractionId':_0x39436a['id'],'UserId':_0x49f22a['user']['id'],'ContactId':_0x297de9['id']}))[_0xb30f('0x22')](function(_0x5659f6){_0x39436a[_0xb30f('0xbf')][_0xb30f('0xbe')]=[];_0x39436a[_0xb30f('0xbf')][_0xb30f('0xbe')]['push'](_0x5659f6['dataValues']);return _0x39436a;});});}})[_0xb30f('0x22')](respondWithResult(_0x4f048d,null))[_0xb30f('0x59')](handleError(_0x4f048d,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 8fe0ae6..ad67a70 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 _0x4522=['OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4dba4d,_0x17d11f){var _0x2c11a6=function(_0x1b6d9c){while(--_0x1b6d9c){_0x4dba4d['push'](_0x4dba4d['shift']());}};_0x2c11a6(++_0x17d11f);}(_0x4522,0x1a0));var _0x2452=function(_0xf6998f,_0x5438d3){_0xf6998f=_0xf6998f-0x0;var _0x47ffd9=_0x4522[_0xf6998f];return _0x47ffd9;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x2452('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x2452('0x1')](0x0);var events={'afterCreate':_0x2452('0x2'),'afterUpdate':'update','afterDestroy':_0x2452('0x3')};function emitEvent(_0x1fdf5b){return function(_0x35e30a,_0x2f21dc,_0x34ff44){OpenchannelAccountEvents[_0x2452('0x4')](_0x1fdf5b+':'+_0x35e30a['id'],_0x35e30a);OpenchannelAccountEvents[_0x2452('0x4')](_0x1fdf5b,_0x35e30a);_0x34ff44(null);};}for(var e in events){if(events[_0x2452('0x5')](e)){var event=events[e];OpenchannelAccount[_0x2452('0x6')](e,emitEvent(event));}}module[_0x2452('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xf109=['OpenchannelAccount','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xbeab9,_0x37ec4a){var _0x27650c=function(_0x4042db){while(--_0x4042db){_0xbeab9['push'](_0xbeab9['shift']());}};_0x27650c(++_0x37ec4a);}(_0xf109,0xce));var _0x9f10=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xf109[_0x12fc8d];return _0x3f9d04;};'use strict';var EventEmitter=require(_0x9f10('0x0'));var OpenchannelAccount=require(_0x9f10('0x1'))['db'][_0x9f10('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9f10('0x3')};function emitEvent(_0x74f517){return function(_0x74d0ee,_0x26f01c,_0x4027f4){OpenchannelAccountEvents[_0x9f10('0x4')](_0x74f517+':'+_0x74d0ee['id'],_0x74d0ee);OpenchannelAccountEvents[_0x9f10('0x4')](_0x74f517,_0x74d0ee);_0x4027f4(null);};}for(var e in events){if(events[_0x9f10('0x5')](e)){var event=events[e];OpenchannelAccount[_0x9f10('0x6')](e,emitEvent(event));}}module[_0x9f10('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index bf4671f..a238a1f 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(_0x271679,_0x8dd572){var _0x3773c1=function(_0x3fd309){while(--_0x3fd309){_0x271679['push'](_0x271679['shift']());}};_0x3773c1(++_0x8dd572);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(_0x494668,_0x58d274){var _0x3c0b07=function(_0x1807ba){while(--_0x1807ba){_0x494668['push'](_0x494668['shift']());}};_0x3c0b07(++_0x58d274);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 7f0419e..1ec2629 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 _0xc36d=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2c2c63,_0x4239f9){var _0x55cefe=function(_0x45799c){while(--_0x45799c){_0x2c2c63['push'](_0x2c2c63['shift']());}};_0x55cefe(++_0x4239f9);}(_0xc36d,0x7d));var _0xdc36=function(_0x570496,_0x26a150){_0x570496=_0x570496-0x0;var _0x1d4204=_0xc36d[_0x570496];return _0x1d4204;};'use strict';var _=require(_0xdc36('0x0'));var util=require(_0xdc36('0x1'));var moment=require(_0xdc36('0x2'));var BPromise=require(_0xdc36('0x3'));var rs=require(_0xdc36('0x4'));var fs=require('fs');var Redis=require(_0xdc36('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc36('0x6'));var logger=require(_0xdc36('0x7'))('rpc');var config=require(_0xdc36('0x8'));var jayson=require(_0xdc36('0x9'));var client=jayson[_0xdc36('0xa')][_0xdc36('0xb')]({'port':0x232a});config[_0xdc36('0xc')]=_['defaults'](config[_0xdc36('0xc')],{'host':_0xdc36('0xd'),'port':0x18eb});var socket=require(_0xdc36('0xe'))(new Redis(config[_0xdc36('0xc')]));require('./openchannelAccount.socket')[_0xdc36('0xf')](socket);function respondWithRpcPromise(_0x23956b,_0x573f8e,_0x1d0035){return new BPromise(function(_0x1cb73d,_0x2483bd){return client['request'](_0x23956b,_0x1d0035)[_0xdc36('0x10')](function(_0x18707d){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x573f8e,_0xdc36('0x11'));logger[_0xdc36('0x12')](_0xdc36('0x13'),_0x573f8e,_0xdc36('0x11'),JSON['stringify'](_0x18707d));if(_0x18707d[_0xdc36('0x14')]){if(_0x18707d[_0xdc36('0x14')][_0xdc36('0x15')]===0x1f4){logger[_0xdc36('0x14')](_0xdc36('0x16'),_0x573f8e,_0x18707d[_0xdc36('0x14')][_0xdc36('0x17')]);return _0x2483bd(_0x18707d[_0xdc36('0x14')]['message']);}logger[_0xdc36('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x573f8e,_0x18707d['error']['message']);return _0x1cb73d(_0x18707d[_0xdc36('0x14')][_0xdc36('0x17')]);}else{logger['info'](_0xdc36('0x16'),_0x573f8e,_0xdc36('0x11'));_0x1cb73d(_0x18707d[_0xdc36('0x18')][_0xdc36('0x17')]);}})[_0xdc36('0x19')](function(_0x46783d){logger['error'](_0xdc36('0x16'),_0x573f8e,_0x46783d);_0x2483bd(_0x46783d);});});} \ No newline at end of file +var _0xae60=['client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x29ec9c,_0x3e0081){var _0x55b155=function(_0x3e9bae){while(--_0x3e9bae){_0x29ec9c['push'](_0x29ec9c['shift']());}};_0x55b155(++_0x3e0081);}(_0xae60,0x1c7));var _0x0ae6=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xae60[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var moment=require(_0x0ae6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae6('0x3'));var fs=require('fs');var Redis=require(_0x0ae6('0x4'));var db=require(_0x0ae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ae6('0x6'))(_0x0ae6('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ae6('0x8'));var client=jayson[_0x0ae6('0x9')][_0x0ae6('0xa')]({'port':0x232a});config[_0x0ae6('0xb')]=_[_0x0ae6('0xc')](config[_0x0ae6('0xb')],{'host':_0x0ae6('0xd'),'port':0x18eb});var socket=require(_0x0ae6('0xe'))(new Redis(config['redis']));require(_0x0ae6('0xf'))[_0x0ae6('0x10')](socket);function respondWithRpcPromise(_0x3a8b0e,_0x39787a,_0x4c2698){return new BPromise(function(_0x24e211,_0x1def8c){return client[_0x0ae6('0x11')](_0x3a8b0e,_0x4c2698)[_0x0ae6('0x12')](function(_0x3ae7fa){logger[_0x0ae6('0x13')](_0x0ae6('0x14'),_0x39787a,_0x0ae6('0x15'));logger[_0x0ae6('0x16')](_0x0ae6('0x17'),_0x39787a,_0x0ae6('0x15'),JSON[_0x0ae6('0x18')](_0x3ae7fa));if(_0x3ae7fa[_0x0ae6('0x19')]){if(_0x3ae7fa[_0x0ae6('0x19')]['code']===0x1f4){logger[_0x0ae6('0x19')](_0x0ae6('0x14'),_0x39787a,_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);return _0x1def8c(_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);}logger[_0x0ae6('0x19')](_0x0ae6('0x14'),_0x39787a,_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);return _0x24e211(_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);}else{logger[_0x0ae6('0x13')](_0x0ae6('0x14'),_0x39787a,_0x0ae6('0x15'));_0x24e211(_0x3ae7fa[_0x0ae6('0x1b')][_0x0ae6('0x1a')]);}})[_0x0ae6('0x1c')](function(_0x2ca2a3){logger[_0x0ae6('0x19')](_0x0ae6('0x14'),_0x39787a,_0x2ca2a3);_0x1def8c(_0x2ca2a3);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 12964a8..bd773c0 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 _0xc041=['./openchannelAccount.events','save','update','emit','removeListener','length','openchannelAccount:'];(function(_0x2edc14,_0x250107){var _0x34a92e=function(_0x1e74c8){while(--_0x1e74c8){_0x2edc14['push'](_0x2edc14['shift']());}};_0x34a92e(++_0x250107);}(_0xc041,0x1ea));var _0x1c04=function(_0x3366c5,_0x597f9a){_0x3366c5=_0x3366c5-0x0;var _0x18500d=_0xc041[_0x3366c5];return _0x18500d;};'use strict';var OpenchannelAccountEvents=require(_0x1c04('0x0'));var events=[_0x1c04('0x1'),'remove',_0x1c04('0x2')];function createListener(_0x5076ff,_0x11a024){return function(_0x15245e){_0x11a024[_0x1c04('0x3')](_0x5076ff,_0x15245e);};}function removeListener(_0x34577d,_0x1312d0){return function(){OpenchannelAccountEvents[_0x1c04('0x4')](_0x34577d,_0x1312d0);};}exports['register']=function(_0x2a7bb2){for(var _0x5acee0=0x0,_0x524f85=events[_0x1c04('0x5')];_0x5acee0<_0x524f85;_0x5acee0++){var _0x3613fe=events[_0x5acee0];var _0x41a0d3=createListener(_0x1c04('0x6')+_0x3613fe,_0x2a7bb2);OpenchannelAccountEvents['on'](_0x3613fe,_0x41a0d3);}}; \ No newline at end of file +var _0xd547=['openchannelAccount:','remove','update','removeListener'];(function(_0x425716,_0x3e9d1c){var _0x2d39af=function(_0x1febc1){while(--_0x1febc1){_0x425716['push'](_0x425716['shift']());}};_0x2d39af(++_0x3e9d1c);}(_0xd547,0x1c1));var _0x7d54=function(_0x140010,_0x4d7233){_0x140010=_0x140010-0x0;var _0x373bb8=_0xd547[_0x140010];return _0x373bb8;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x7d54('0x0'),_0x7d54('0x1')];function createListener(_0x15a0c7,_0x1611f6){return function(_0x54ffc5){_0x1611f6['emit'](_0x15a0c7,_0x54ffc5);};}function removeListener(_0x21c23f,_0x5d21c1){return function(){OpenchannelAccountEvents[_0x7d54('0x2')](_0x21c23f,_0x5d21c1);};}exports['register']=function(_0x296dd6){for(var _0x37defc=0x0,_0x1b7fc1=events['length'];_0x37defc<_0x1b7fc1;_0x37defc++){var _0x5b0b16=events[_0x37defc];var _0x478f9b=createListener(_0x7d54('0x3')+_0x5b0b16,_0x296dd6);OpenchannelAccountEvents['on'](_0x5b0b16,_0x478f9b);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 09c5a87..ebd34b3 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 _0x3d3e=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x3d3e,0x141));var _0xe3d3=function(_0x40d49d,_0x59bcf6){_0x40d49d=_0x40d49d-0x0;var _0x49cb8e=_0x3d3e[_0x40d49d];return _0x49cb8e;};'use strict';var multer=require(_0xe3d3('0x0'));var util=require(_0xe3d3('0x1'));var path=require(_0xe3d3('0x2'));var timeout=require(_0xe3d3('0x3'));var express=require(_0xe3d3('0x4'));var router=express[_0xe3d3('0x5')]();var fs_extra=require(_0xe3d3('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe3d3('0x7'));var controller=require(_0xe3d3('0x8'));router[_0xe3d3('0x9')]('/',auth[_0xe3d3('0xa')](),controller[_0xe3d3('0xb')]);router[_0xe3d3('0x9')]('/:id',auth[_0xe3d3('0xa')](),controller[_0xe3d3('0xc')]);router[_0xe3d3('0xd')]('/',auth[_0xe3d3('0xa')](),controller[_0xe3d3('0xe')]);router[_0xe3d3('0xf')](_0xe3d3('0x10'),auth[_0xe3d3('0xa')](),controller[_0xe3d3('0x11')]);router[_0xe3d3('0x12')]('/:id',auth[_0xe3d3('0xa')](),controller['destroy']);module[_0xe3d3('0x13')]=router; \ No newline at end of file +var _0xc3df=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3df,0x94));var _0xfc3d=function(_0x547e1a,_0x495ca8){_0x547e1a=_0x547e1a-0x0;var _0x3b9833=_0xc3df[_0x547e1a];return _0x3b9833;};'use strict';var multer=require(_0xfc3d('0x0'));var util=require(_0xfc3d('0x1'));var path=require(_0xfc3d('0x2'));var timeout=require(_0xfc3d('0x3'));var express=require(_0xfc3d('0x4'));var router=express[_0xfc3d('0x5')]();var fs_extra=require(_0xfc3d('0x6'));var auth=require(_0xfc3d('0x7'));var interaction=require(_0xfc3d('0x8'));var config=require(_0xfc3d('0x9'));var controller=require(_0xfc3d('0xa'));router[_0xfc3d('0xb')]('/',auth[_0xfc3d('0xc')](),controller[_0xfc3d('0xd')]);router['get'](_0xfc3d('0xe'),auth[_0xfc3d('0xc')](),controller['show']);router[_0xfc3d('0xf')]('/',auth[_0xfc3d('0xc')](),controller['create']);router[_0xfc3d('0x10')]('/:id',auth[_0xfc3d('0xc')](),controller[_0xfc3d('0x11')]);router[_0xfc3d('0x12')](_0xfc3d('0xe'),auth['isAuthenticated'](),controller[_0xfc3d('0x13')]);module[_0xfc3d('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index bf32e4a..3849328 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 _0x30af=['noop','TEXT','STRING','sequelize','exports','INTEGER'];(function(_0x252911,_0x3a0aa7){var _0x4c6932=function(_0x340f79){while(--_0x340f79){_0x252911['push'](_0x252911['shift']());}};_0x4c6932(++_0x3a0aa7);}(_0x30af,0xdb));var _0xf30a=function(_0x1b68ff,_0x5e68a2){_0x1b68ff=_0x1b68ff-0x0;var _0x4b3b07=_0x30af[_0x1b68ff];return _0x4b3b07;};'use strict';var Sequelize=require(_0xf30a('0x0'));module[_0xf30a('0x1')]={'priority':{'type':Sequelize[_0xf30a('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf30a('0x3')},'appdata':{'type':Sequelize[_0xf30a('0x4')]()},'description':{'type':Sequelize[_0xf30a('0x5')]},'interval':{'type':Sequelize[_0xf30a('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x0fb1=['*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x530496,_0xcc3971){var _0x49a73e=function(_0x2b2560){while(--_0x2b2560){_0x530496['push'](_0x530496['shift']());}};_0x49a73e(++_0xcc3971);}(_0x0fb1,0x1be));var _0x10fb=function(_0x3d5980,_0x58848c){_0x3d5980=_0x3d5980-0x0;var _0xdb43a8=_0x0fb1[_0x3d5980];return _0xdb43a8;};'use strict';var Sequelize=require(_0x10fb('0x0'));module[_0x10fb('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x10fb('0x2')],'allowNull':![],'defaultValue':_0x10fb('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x10fb('0x2')],'defaultValue':_0x10fb('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index a48db08..fc46440 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 _0x0fb7=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','save','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','OpenchannelApplication','rows','catch','show','params','length','include','create','body','find','eml-format','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x136cbb,_0x2a97f9){var _0x333a69=function(_0x5dc5bb){while(--_0x5dc5bb){_0x136cbb['push'](_0x136cbb['shift']());}};_0x333a69(++_0x2a97f9);}(_0x0fb7,0x111));var _0x70fb=function(_0xcd2faa,_0x3ff70d){_0xcd2faa=_0xcd2faa-0x0;var _0x3b6e2d=_0x0fb7[_0xcd2faa];return _0x3b6e2d;};'use strict';var emlformat=require(_0x70fb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x70fb('0x1'));var rp=require('request-promise');var moment=require(_0x70fb('0x2'));var BPromise=require(_0x70fb('0x3'));var Mustache=require(_0x70fb('0x4'));var util=require(_0x70fb('0x5'));var path=require(_0x70fb('0x6'));var sox=require(_0x70fb('0x7'));var csv=require(_0x70fb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x70fb('0x9'));var _=require(_0x70fb('0xa'));var squel=require(_0x70fb('0xb'));var crypto=require(_0x70fb('0xc'));var jsforce=require(_0x70fb('0xd'));var deskjs=require(_0x70fb('0xe'));var toCsv=require(_0x70fb('0x8'));var querystring=require(_0x70fb('0xf'));var Papa=require('papaparse');var Redis=require(_0x70fb('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x70fb('0x11'));var hardwareService=require(_0x70fb('0x12'));var logger=require('../../config/logger')(_0x70fb('0x13'));var utils=require(_0x70fb('0x14'));var config=require(_0x70fb('0x15'));var licenseUtil=require(_0x70fb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bdb7e,_0x36aa1e){_0x36aa1e=_0x36aa1e||0xcc;return function(_0x54384c){if(_0x54384c){return _0x4bdb7e[_0x70fb('0x17')](_0x36aa1e);}return _0x4bdb7e['status'](_0x36aa1e)[_0x70fb('0x18')]();};}function respondWithResult(_0x576391,_0x3c8d6f){_0x3c8d6f=_0x3c8d6f||0xc8;return function(_0x492897){if(_0x492897){return _0x576391[_0x70fb('0x19')](_0x3c8d6f)['json'](_0x492897);}};}function respondWithFilteredResult(_0x116796,_0x2bb214){return function(_0x20057b){if(_0x20057b){var _0x93644=typeof _0x2bb214['offset']==='undefined'&&typeof _0x2bb214[_0x70fb('0x1a')]===_0x70fb('0x1b');var _0x93812a=_0x20057b[_0x70fb('0x1c')];var _0x40953d=_0x93644?0x0:_0x2bb214[_0x70fb('0x1d')];var _0x57b7f8=_0x93644?_0x20057b[_0x70fb('0x1c')]:_0x2bb214[_0x70fb('0x1d')]+_0x2bb214['limit'];var _0x3829f4;if(_0x57b7f8>=_0x93812a){_0x57b7f8=_0x93812a;_0x3829f4=0xc8;}else{_0x3829f4=0xce;}_0x116796[_0x70fb('0x19')](_0x3829f4);return _0x116796[_0x70fb('0x1e')](_0x70fb('0x1f'),_0x40953d+'-'+_0x57b7f8+'/'+_0x93812a)[_0x70fb('0x20')](_0x20057b);}return null;};}function patchUpdates(_0x220e47){return function(_0x35369c){try{jsonpatch['apply'](_0x35369c,_0x220e47,!![]);}catch(_0x40130b){return BPromise['reject'](_0x40130b);}return _0x35369c[_0x70fb('0x21')]();};}function saveUpdates(_0x135d28,_0xca60a6){return function(_0xd691cb){if(_0xd691cb){return _0xd691cb[_0x70fb('0x22')](_0x135d28)['then'](function(_0x3b8bc7){return _0x3b8bc7;});}return null;};}function removeEntity(_0x31a8de,_0x5cd3b0){return function(_0x4cb952){if(_0x4cb952){return _0x4cb952[_0x70fb('0x23')]()[_0x70fb('0x24')](function(){_0x31a8de[_0x70fb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9c55c9,_0xcd2398){return function(_0x12f160){if(!_0x12f160){_0x9c55c9['sendStatus'](0x194);}return _0x12f160;};}function handleError(_0x5b70b4,_0x1e1abe){_0x1e1abe=_0x1e1abe||0x1f4;return function(_0x88f071){logger['error'](_0x88f071[_0x70fb('0x25')]);if(_0x88f071[_0x70fb('0x26')]){delete _0x88f071[_0x70fb('0x26')];}_0x5b70b4[_0x70fb('0x19')](_0x1e1abe)[_0x70fb('0x27')](_0x88f071);};}exports[_0x70fb('0x28')]=function(_0x275efe,_0x3ece9d){var _0x4f157a={},_0x42b33d={},_0x165660={'count':0x0,'rows':[]};var _0x25afc6=_['map'](db['OpenchannelApplication'][_0x70fb('0x29')],function(_0x322a54){return{'name':_0x322a54[_0x70fb('0x2a')],'type':_0x322a54['type']['key']};});_0x42b33d[_0x70fb('0x2b')]=_[_0x70fb('0x2c')](_0x25afc6,'name');_0x42b33d[_0x70fb('0x2d')]=_['keys'](_0x275efe[_0x70fb('0x2d')]);_0x42b33d[_0x70fb('0x2e')]=_[_0x70fb('0x2f')](_0x42b33d[_0x70fb('0x2b')],_0x42b33d['query']);_0x4f157a[_0x70fb('0x30')]=_['intersection'](_0x42b33d[_0x70fb('0x2b')],qs[_0x70fb('0x31')](_0x275efe[_0x70fb('0x2d')][_0x70fb('0x31')]));_0x4f157a[_0x70fb('0x30')]=_0x4f157a[_0x70fb('0x30')]['length']?_0x4f157a['attributes']:_0x42b33d[_0x70fb('0x2b')];if(!_0x275efe[_0x70fb('0x2d')][_0x70fb('0x32')](_0x70fb('0x33'))){_0x4f157a[_0x70fb('0x1a')]=qs['limit'](_0x275efe[_0x70fb('0x2d')][_0x70fb('0x1a')]);_0x4f157a['offset']=qs[_0x70fb('0x1d')](_0x275efe['query'][_0x70fb('0x1d')]);}_0x4f157a['order']=qs[_0x70fb('0x34')](_0x275efe[_0x70fb('0x2d')][_0x70fb('0x34')]);_0x4f157a[_0x70fb('0x35')]=qs['filters'](_[_0x70fb('0x36')](_0x275efe[_0x70fb('0x2d')],_0x42b33d['filters']),_0x25afc6);if(_0x275efe[_0x70fb('0x2d')][_0x70fb('0x37')]){_0x4f157a['where']=_[_0x70fb('0x38')](_0x4f157a[_0x70fb('0x35')],{'$or':_['map'](_0x25afc6,function(_0x52e2af){if(_0x52e2af[_0x70fb('0x39')]!==_0x70fb('0x3a')){var _0x546504={};_0x546504[_0x52e2af[_0x70fb('0x26')]]={'$like':'%'+_0x275efe[_0x70fb('0x2d')][_0x70fb('0x37')]+'%'};return _0x546504;}})});}_0x4f157a=_['merge']({},_0x4f157a,_0x275efe[_0x70fb('0x3b')]);var _0x2b5322={'where':_0x4f157a[_0x70fb('0x35')]};return db[_0x70fb('0x3c')][_0x70fb('0x1c')](_0x2b5322)[_0x70fb('0x24')](function(_0x1b70d6){_0x165660[_0x70fb('0x1c')]=_0x1b70d6;if(_0x275efe['query']['includeAll']){_0x4f157a['include']=[{'all':!![]}];}return db[_0x70fb('0x3c')]['findAll'](_0x4f157a);})['then'](function(_0x21d7dd){_0x165660[_0x70fb('0x3d')]=_0x21d7dd;return _0x165660;})['then'](respondWithFilteredResult(_0x3ece9d,_0x4f157a))[_0x70fb('0x3e')](handleError(_0x3ece9d,null));};exports[_0x70fb('0x3f')]=function(_0x5393e2,_0x141458){var _0x22da36={'raw':!![],'where':{'id':_0x5393e2[_0x70fb('0x40')]['id']}},_0x47541b={};_0x47541b[_0x70fb('0x2b')]=_['keys'](db[_0x70fb('0x3c')][_0x70fb('0x29')]);_0x47541b[_0x70fb('0x2d')]=_['keys'](_0x5393e2[_0x70fb('0x2d')]);_0x47541b[_0x70fb('0x2e')]=_[_0x70fb('0x2f')](_0x47541b[_0x70fb('0x2b')],_0x47541b[_0x70fb('0x2d')]);_0x22da36[_0x70fb('0x30')]=_[_0x70fb('0x2f')](_0x47541b[_0x70fb('0x2b')],qs['fields'](_0x5393e2[_0x70fb('0x2d')][_0x70fb('0x31')]));_0x22da36[_0x70fb('0x30')]=_0x22da36['attributes'][_0x70fb('0x41')]?_0x22da36[_0x70fb('0x30')]:_0x47541b['model'];if(_0x5393e2[_0x70fb('0x2d')]['includeAll']){_0x22da36[_0x70fb('0x42')]=[{'all':!![]}];}_0x22da36=_[_0x70fb('0x38')]({},_0x22da36,_0x5393e2[_0x70fb('0x3b')]);return db[_0x70fb('0x3c')]['find'](_0x22da36)[_0x70fb('0x24')](handleEntityNotFound(_0x141458,null))[_0x70fb('0x24')](respondWithResult(_0x141458,null))[_0x70fb('0x3e')](handleError(_0x141458,null));};exports[_0x70fb('0x43')]=function(_0x48db22,_0x2dab19){return db['OpenchannelApplication']['create'](_0x48db22[_0x70fb('0x44')],{})[_0x70fb('0x24')](respondWithResult(_0x2dab19,0xc9))[_0x70fb('0x3e')](handleError(_0x2dab19,null));};exports[_0x70fb('0x22')]=function(_0x58c976,_0x17b45c){if(_0x58c976[_0x70fb('0x44')]['id']){delete _0x58c976[_0x70fb('0x44')]['id'];}return db['OpenchannelApplication'][_0x70fb('0x45')]({'where':{'id':_0x58c976[_0x70fb('0x40')]['id']}})[_0x70fb('0x24')](handleEntityNotFound(_0x17b45c,null))['then'](saveUpdates(_0x58c976[_0x70fb('0x44')],null))['then'](respondWithResult(_0x17b45c,null))[_0x70fb('0x3e')](handleError(_0x17b45c,null));};exports[_0x70fb('0x23')]=function(_0x3c153e,_0x4fa973){return db[_0x70fb('0x3c')][_0x70fb('0x45')]({'where':{'id':_0x3c153e[_0x70fb('0x40')]['id']}})[_0x70fb('0x24')](handleEntityNotFound(_0x4fa973,null))[_0x70fb('0x24')](removeEntity(_0x4fa973,null))[_0x70fb('0x3e')](handleError(_0x4fa973,null));}; \ No newline at end of file +var _0x6bcb=['save','update','then','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','where','merge','VIRTUAL','name','filter','options','OpenchannelApplication','includeAll','include','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject'];(function(_0x46a82b,_0x372b54){var _0x68abdb=function(_0x2b2177){while(--_0x2b2177){_0x46a82b['push'](_0x46a82b['shift']());}};_0x68abdb(++_0x372b54);}(_0x6bcb,0xc3));var _0xb6bc=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0x6bcb[_0x231b2e];return _0x3feb2a;};'use strict';var emlformat=require(_0xb6bc('0x0'));var rimraf=require(_0xb6bc('0x1'));var zipdir=require(_0xb6bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6bc('0x3'));var moment=require(_0xb6bc('0x4'));var BPromise=require(_0xb6bc('0x5'));var Mustache=require('mustache');var util=require(_0xb6bc('0x6'));var path=require(_0xb6bc('0x7'));var sox=require(_0xb6bc('0x8'));var csv=require('to-csv');var ejs=require(_0xb6bc('0x9'));var fs=require('fs');var fs_extra=require(_0xb6bc('0xa'));var _=require(_0xb6bc('0xb'));var squel=require('squel');var crypto=require(_0xb6bc('0xc'));var jsforce=require(_0xb6bc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb6bc('0xe'));var querystring=require('querystring');var Papa=require(_0xb6bc('0xf'));var Redis=require(_0xb6bc('0x10'));var authService=require(_0xb6bc('0x11'));var qs=require(_0xb6bc('0x12'));var as=require(_0xb6bc('0x13'));var hardwareService=require(_0xb6bc('0x14'));var logger=require(_0xb6bc('0x15'))(_0xb6bc('0x16'));var utils=require(_0xb6bc('0x17'));var config=require(_0xb6bc('0x18'));var licenseUtil=require(_0xb6bc('0x19'));var db=require(_0xb6bc('0x1a'))['db'];function respondWithStatusCode(_0xc3f8f3,_0x245aa0){_0x245aa0=_0x245aa0||0xcc;return function(_0x4c7cf7){if(_0x4c7cf7){return _0xc3f8f3['sendStatus'](_0x245aa0);}return _0xc3f8f3[_0xb6bc('0x1b')](_0x245aa0)[_0xb6bc('0x1c')]();};}function respondWithResult(_0xa42124,_0x192e1b){_0x192e1b=_0x192e1b||0xc8;return function(_0x158632){if(_0x158632){return _0xa42124[_0xb6bc('0x1b')](_0x192e1b)[_0xb6bc('0x1d')](_0x158632);}};}function respondWithFilteredResult(_0x1f04b4,_0xcbc258){return function(_0x45c9f3){if(_0x45c9f3){var _0x4720ad=typeof _0xcbc258[_0xb6bc('0x1e')]===_0xb6bc('0x1f')&&typeof _0xcbc258[_0xb6bc('0x20')]===_0xb6bc('0x1f');var _0x446b97=_0x45c9f3[_0xb6bc('0x21')];var _0xcf37fe=_0x4720ad?0x0:_0xcbc258[_0xb6bc('0x1e')];var _0x2f3c93=_0x4720ad?_0x45c9f3[_0xb6bc('0x21')]:_0xcbc258[_0xb6bc('0x1e')]+_0xcbc258[_0xb6bc('0x20')];var _0x5b0588;if(_0x2f3c93>=_0x446b97){_0x2f3c93=_0x446b97;_0x5b0588=0xc8;}else{_0x5b0588=0xce;}_0x1f04b4[_0xb6bc('0x1b')](_0x5b0588);return _0x1f04b4['set']('Content-Range',_0xcf37fe+'-'+_0x2f3c93+'/'+_0x446b97)[_0xb6bc('0x1d')](_0x45c9f3);}return null;};}function patchUpdates(_0x3104cd){return function(_0x4b45b7){try{jsonpatch[_0xb6bc('0x22')](_0x4b45b7,_0x3104cd,!![]);}catch(_0x2cb2d){return BPromise[_0xb6bc('0x23')](_0x2cb2d);}return _0x4b45b7[_0xb6bc('0x24')]();};}function saveUpdates(_0x250cb9,_0x44708e){return function(_0x59682c){if(_0x59682c){return _0x59682c[_0xb6bc('0x25')](_0x250cb9)[_0xb6bc('0x26')](function(_0x90572){return _0x90572;});}return null;};}function removeEntity(_0x1e8cee,_0x5537be){return function(_0x15b675){if(_0x15b675){return _0x15b675['destroy']()['then'](function(){_0x1e8cee[_0xb6bc('0x1b')](0xcc)[_0xb6bc('0x1c')]();});}};}function handleEntityNotFound(_0x1022bd,_0x58225b){return function(_0x593ad3){if(!_0x593ad3){_0x1022bd[_0xb6bc('0x27')](0x194);}return _0x593ad3;};}function handleError(_0x4e28bf,_0x39f5dd){_0x39f5dd=_0x39f5dd||0x1f4;return function(_0x1c3450){logger[_0xb6bc('0x28')](_0x1c3450[_0xb6bc('0x29')]);if(_0x1c3450['name']){delete _0x1c3450['name'];}_0x4e28bf[_0xb6bc('0x1b')](_0x39f5dd)[_0xb6bc('0x2a')](_0x1c3450);};}exports[_0xb6bc('0x2b')]=function(_0x46a6d4,_0x220e5c){var _0x136093={},_0x16cc62={},_0x17dc38={'count':0x0,'rows':[]};var _0x589059=_[_0xb6bc('0x2c')](db['OpenchannelApplication'][_0xb6bc('0x2d')],function(_0x3cc4d4){return{'name':_0x3cc4d4[_0xb6bc('0x2e')],'type':_0x3cc4d4[_0xb6bc('0x2f')][_0xb6bc('0x30')]};});_0x16cc62['model']=_['map'](_0x589059,'name');_0x16cc62[_0xb6bc('0x31')]=_[_0xb6bc('0x32')](_0x46a6d4[_0xb6bc('0x31')]);_0x16cc62['filters']=_[_0xb6bc('0x33')](_0x16cc62[_0xb6bc('0x34')],_0x16cc62[_0xb6bc('0x31')]);_0x136093[_0xb6bc('0x35')]=_[_0xb6bc('0x33')](_0x16cc62[_0xb6bc('0x34')],qs[_0xb6bc('0x36')](_0x46a6d4[_0xb6bc('0x31')][_0xb6bc('0x36')]));_0x136093[_0xb6bc('0x35')]=_0x136093[_0xb6bc('0x35')][_0xb6bc('0x37')]?_0x136093[_0xb6bc('0x35')]:_0x16cc62['model'];if(!_0x46a6d4[_0xb6bc('0x31')][_0xb6bc('0x38')](_0xb6bc('0x39'))){_0x136093['limit']=qs[_0xb6bc('0x20')](_0x46a6d4[_0xb6bc('0x31')]['limit']);_0x136093[_0xb6bc('0x1e')]=qs[_0xb6bc('0x1e')](_0x46a6d4[_0xb6bc('0x31')]['offset']);}_0x136093['order']=qs[_0xb6bc('0x3a')](_0x46a6d4[_0xb6bc('0x31')][_0xb6bc('0x3a')]);_0x136093['where']=qs[_0xb6bc('0x3b')](_['pick'](_0x46a6d4[_0xb6bc('0x31')],_0x16cc62[_0xb6bc('0x3b')]),_0x589059);if(_0x46a6d4[_0xb6bc('0x31')]['filter']){_0x136093[_0xb6bc('0x3c')]=_[_0xb6bc('0x3d')](_0x136093[_0xb6bc('0x3c')],{'$or':_[_0xb6bc('0x2c')](_0x589059,function(_0x2cde24){if(_0x2cde24[_0xb6bc('0x2f')]!==_0xb6bc('0x3e')){var _0x48a3fc={};_0x48a3fc[_0x2cde24[_0xb6bc('0x3f')]]={'$like':'%'+_0x46a6d4[_0xb6bc('0x31')][_0xb6bc('0x40')]+'%'};return _0x48a3fc;}})});}_0x136093=_[_0xb6bc('0x3d')]({},_0x136093,_0x46a6d4[_0xb6bc('0x41')]);var _0x20cdf5={'where':_0x136093[_0xb6bc('0x3c')]};return db[_0xb6bc('0x42')][_0xb6bc('0x21')](_0x20cdf5)[_0xb6bc('0x26')](function(_0xc8b9f3){_0x17dc38[_0xb6bc('0x21')]=_0xc8b9f3;if(_0x46a6d4[_0xb6bc('0x31')][_0xb6bc('0x43')]){_0x136093[_0xb6bc('0x44')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x136093);})[_0xb6bc('0x26')](function(_0x4e4998){_0x17dc38[_0xb6bc('0x45')]=_0x4e4998;return _0x17dc38;})[_0xb6bc('0x26')](respondWithFilteredResult(_0x220e5c,_0x136093))[_0xb6bc('0x46')](handleError(_0x220e5c,null));};exports[_0xb6bc('0x47')]=function(_0x377bd2,_0x1f3d69){var _0x412c0f={'raw':!![],'where':{'id':_0x377bd2[_0xb6bc('0x48')]['id']}},_0x2751f9={};_0x2751f9['model']=_['keys'](db[_0xb6bc('0x42')][_0xb6bc('0x2d')]);_0x2751f9['query']=_['keys'](_0x377bd2[_0xb6bc('0x31')]);_0x2751f9[_0xb6bc('0x3b')]=_[_0xb6bc('0x33')](_0x2751f9['model'],_0x2751f9[_0xb6bc('0x31')]);_0x412c0f[_0xb6bc('0x35')]=_[_0xb6bc('0x33')](_0x2751f9['model'],qs[_0xb6bc('0x36')](_0x377bd2[_0xb6bc('0x31')][_0xb6bc('0x36')]));_0x412c0f[_0xb6bc('0x35')]=_0x412c0f[_0xb6bc('0x35')][_0xb6bc('0x37')]?_0x412c0f[_0xb6bc('0x35')]:_0x2751f9[_0xb6bc('0x34')];if(_0x377bd2[_0xb6bc('0x31')]['includeAll']){_0x412c0f[_0xb6bc('0x44')]=[{'all':!![]}];}_0x412c0f=_['merge']({},_0x412c0f,_0x377bd2[_0xb6bc('0x41')]);return db[_0xb6bc('0x42')][_0xb6bc('0x49')](_0x412c0f)[_0xb6bc('0x26')](handleEntityNotFound(_0x1f3d69,null))[_0xb6bc('0x26')](respondWithResult(_0x1f3d69,null))[_0xb6bc('0x46')](handleError(_0x1f3d69,null));};exports[_0xb6bc('0x4a')]=function(_0x53544d,_0x2e89b1){return db[_0xb6bc('0x42')]['create'](_0x53544d[_0xb6bc('0x4b')],{})[_0xb6bc('0x26')](respondWithResult(_0x2e89b1,0xc9))[_0xb6bc('0x46')](handleError(_0x2e89b1,null));};exports[_0xb6bc('0x25')]=function(_0x282839,_0x366f9a){if(_0x282839[_0xb6bc('0x4b')]['id']){delete _0x282839[_0xb6bc('0x4b')]['id'];}return db['OpenchannelApplication'][_0xb6bc('0x49')]({'where':{'id':_0x282839['params']['id']}})[_0xb6bc('0x26')](handleEntityNotFound(_0x366f9a,null))['then'](saveUpdates(_0x282839[_0xb6bc('0x4b')],null))[_0xb6bc('0x26')](respondWithResult(_0x366f9a,null))[_0xb6bc('0x46')](handleError(_0x366f9a,null));};exports[_0xb6bc('0x4c')]=function(_0xf2c2bb,_0x3ade0d){return db[_0xb6bc('0x42')][_0xb6bc('0x49')]({'where':{'id':_0xf2c2bb[_0xb6bc('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ade0d,null))[_0xb6bc('0x26')](removeEntity(_0x3ade0d,null))[_0xb6bc('0x46')](handleError(_0x3ade0d,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 2879ca2..aa9b8f6 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 _0xffaa=['utf8mb4_unicode_ci','lodash','util','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x532d5b,_0x4b6047){var _0x523f05=function(_0x130c20){while(--_0x130c20){_0x532d5b['push'](_0x532d5b['shift']());}};_0x523f05(++_0x4b6047);}(_0xffaa,0x1c9));var _0xaffa=function(_0x4915fe,_0x3f2d70){_0x4915fe=_0x4915fe-0x0;var _0x4e78e0=_0xffaa[_0x4915fe];return _0x4e78e0;};'use strict';var _=require(_0xaffa('0x0'));var util=require(_0xaffa('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaffa('0x2'));var rimraf=require(_0xaffa('0x3'));var config=require(_0xaffa('0x4'));var attributes=require(_0xaffa('0x5'));module[_0xaffa('0x6')]=function(_0x23cf37,_0x3edf7a){return _0x23cf37[_0xaffa('0x7')](_0xaffa('0x8'),attributes,{'tableName':_0xaffa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaffa('0xa'),'collate':_0xaffa('0xb')});}; \ No newline at end of file +var _0x594e=['api','moment','bluebird','rimraf','../../config/environment','exports','define','OpenchannelApplication','utf8mb4','lodash','../../config/logger'];(function(_0x2e68ef,_0x448e75){var _0x407792=function(_0x22920d){while(--_0x22920d){_0x2e68ef['push'](_0x2e68ef['shift']());}};_0x407792(++_0x448e75);}(_0x594e,0xb9));var _0xe594=function(_0x2e4e55,_0x307cce){_0x2e4e55=_0x2e4e55-0x0;var _0x4412d5=_0x594e[_0x2e4e55];return _0x4412d5;};'use strict';var _=require(_0xe594('0x0'));var util=require('util');var logger=require(_0xe594('0x1'))(_0xe594('0x2'));var moment=require(_0xe594('0x3'));var BPromise=require(_0xe594('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe594('0x5'));var config=require(_0xe594('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0xe594('0x7')]=function(_0x5be5ba,_0x4c1aec){return _0x5be5ba[_0xe594('0x8')](_0xe594('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe594('0xa'),'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 ae6bd3d..3546927 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 _0x9d82=['catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','attributes','limit','then','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','error','message','result'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x9d82,0x15b));var _0x29d8=function(_0x2e986a,_0x4e0078){_0x2e986a=_0x2e986a-0x0;var _0x54f21a=_0x9d82[_0x2e986a];return _0x54f21a;};'use strict';var _=require(_0x29d8('0x0'));var util=require('util');var moment=require(_0x29d8('0x1'));var BPromise=require(_0x29d8('0x2'));var rs=require(_0x29d8('0x3'));var fs=require('fs');var Redis=require(_0x29d8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29d8('0x5'))(_0x29d8('0x6'));var config=require(_0x29d8('0x7'));var jayson=require(_0x29d8('0x8'));var client=jayson['client'][_0x29d8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d5097,_0x2f3a5c,_0x1b2d6d){return new BPromise(function(_0x5f4cc1,_0x5c6fb6){return client['request'](_0x5d5097,_0x1b2d6d)['then'](function(_0x132be8){logger[_0x29d8('0xa')](_0x29d8('0xb'),_0x2f3a5c,_0x29d8('0xc'));logger[_0x29d8('0xd')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x2f3a5c,_0x29d8('0xc'),JSON['stringify'](_0x132be8));if(_0x132be8[_0x29d8('0xe')]){if(_0x132be8[_0x29d8('0xe')]['code']===0x1f4){logger['error'](_0x29d8('0xb'),_0x2f3a5c,_0x132be8['error']['message']);return _0x5c6fb6(_0x132be8[_0x29d8('0xe')]['message']);}logger[_0x29d8('0xe')](_0x29d8('0xb'),_0x2f3a5c,_0x132be8['error']['message']);return _0x5f4cc1(_0x132be8[_0x29d8('0xe')][_0x29d8('0xf')]);}else{logger['info'](_0x29d8('0xb'),_0x2f3a5c,_0x29d8('0xc'));_0x5f4cc1(_0x132be8[_0x29d8('0x10')][_0x29d8('0xf')]);}})[_0x29d8('0x11')](function(_0x332271){logger[_0x29d8('0xe')](_0x29d8('0xb'),_0x2f3a5c,_0x332271);_0x5c6fb6(_0x332271);});});}exports[_0x29d8('0x12')]=function(_0x58773f){var _0xbff06f=this;return new Promise(function(_0x3653b8,_0x2eaed8){return db[_0x29d8('0x13')][_0x29d8('0x14')](_0x58773f[_0x29d8('0x15')],{'raw':_0x58773f['options']?_0x58773f[_0x29d8('0x16')][_0x29d8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58773f[_0x29d8('0x16')]?_0x58773f['options']['where']||null:null,'attributes':_0x58773f[_0x29d8('0x16')]?_0x58773f[_0x29d8('0x16')][_0x29d8('0x18')]||null:null,'limit':_0x58773f[_0x29d8('0x16')]?_0x58773f['options'][_0x29d8('0x19')]||null:null})[_0x29d8('0x1a')](function(_0x1fd30e){logger[_0x29d8('0xa')](_0x29d8('0x12'),_0x58773f);logger[_0x29d8('0xd')]('UpdateOpenchannelApplication',_0x58773f,JSON[_0x29d8('0x1b')](_0x1fd30e));_0x3653b8(_0x1fd30e);})[_0x29d8('0x11')](function(_0x4db7ba){logger[_0x29d8('0xe')](_0x29d8('0x12'),_0x4db7ba[_0x29d8('0xf')],_0x58773f);_0x2eaed8(_0xbff06f['error'](0x1f4,_0x4db7ba[_0x29d8('0xf')]));});});}; \ No newline at end of file +var _0xb037=['moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','stringify','util'];(function(_0x21a0c5,_0x586032){var _0x13d439=function(_0x461e24){while(--_0x461e24){_0x21a0c5['push'](_0x21a0c5['shift']());}};_0x13d439(++_0x586032);}(_0xb037,0x128));var _0x7b03=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xb037[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require(_0x7b03('0x0'));var moment=require(_0x7b03('0x1'));var BPromise=require(_0x7b03('0x2'));var rs=require(_0x7b03('0x3'));var fs=require('fs');var Redis=require(_0x7b03('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7b03('0x5'));var config=require('../../config/environment');var jayson=require(_0x7b03('0x6'));var client=jayson[_0x7b03('0x7')][_0x7b03('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2005ad,_0x522f1a,_0x1dbe14){return new BPromise(function(_0xb43d79,_0x5569e2){return client[_0x7b03('0x9')](_0x2005ad,_0x1dbe14)['then'](function(_0x2967a0){logger[_0x7b03('0xa')](_0x7b03('0xb'),_0x522f1a,_0x7b03('0xc'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x522f1a,'request\x20sent',JSON['stringify'](_0x2967a0));if(_0x2967a0['error']){if(_0x2967a0[_0x7b03('0xd')][_0x7b03('0xe')]===0x1f4){logger[_0x7b03('0xd')](_0x7b03('0xb'),_0x522f1a,_0x2967a0[_0x7b03('0xd')][_0x7b03('0xf')]);return _0x5569e2(_0x2967a0[_0x7b03('0xd')][_0x7b03('0xf')]);}logger['error'](_0x7b03('0xb'),_0x522f1a,_0x2967a0[_0x7b03('0xd')][_0x7b03('0xf')]);return _0xb43d79(_0x2967a0[_0x7b03('0xd')][_0x7b03('0xf')]);}else{logger[_0x7b03('0xa')](_0x7b03('0xb'),_0x522f1a,'request\x20sent');_0xb43d79(_0x2967a0[_0x7b03('0x10')][_0x7b03('0xf')]);}})[_0x7b03('0x11')](function(_0xc7dbbe){logger[_0x7b03('0xd')](_0x7b03('0xb'),_0x522f1a,_0xc7dbbe);_0x5569e2(_0xc7dbbe);});});}exports[_0x7b03('0x12')]=function(_0x59f51b){var _0x23fdd2=this;return new Promise(function(_0x962c67,_0x2cd92a){return db[_0x7b03('0x13')][_0x7b03('0x14')](_0x59f51b['body'],{'raw':_0x59f51b[_0x7b03('0x15')]?_0x59f51b[_0x7b03('0x15')][_0x7b03('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59f51b[_0x7b03('0x15')]?_0x59f51b[_0x7b03('0x15')][_0x7b03('0x17')]||null:null,'attributes':_0x59f51b['options']?_0x59f51b['options'][_0x7b03('0x18')]||null:null,'limit':_0x59f51b[_0x7b03('0x15')]?_0x59f51b['options'][_0x7b03('0x19')]||null:null})['then'](function(_0xe6992d){logger[_0x7b03('0xa')](_0x7b03('0x12'),_0x59f51b);logger['debug'](_0x7b03('0x12'),_0x59f51b,JSON[_0x7b03('0x1a')](_0xe6992d));_0x962c67(_0xe6992d);})['catch'](function(_0x4ad32d){logger['error'](_0x7b03('0x12'),_0x4ad32d[_0x7b03('0xf')],_0x59f51b);_0x2cd92a(_0x23fdd2[_0x7b03('0xd')](0x1f4,_0x4ad32d[_0x7b03('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 943c8c9..9071e91 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 _0x17ea=['/:id','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','tracked','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe'];(function(_0x62e05f,_0x2f5db4){var _0x44d8f0=function(_0x50b7ff){while(--_0x50b7ff){_0x62e05f['push'](_0x62e05f['shift']());}};_0x44d8f0(++_0x2f5db4);}(_0x17ea,0x73));var _0xa17e=function(_0x240560,_0x19b5da){_0x240560=_0x240560-0x0;var _0x1ffa4f=_0x17ea[_0x240560];return _0x1ffa4f;};'use strict';var multer=require('multer');var util=require(_0xa17e('0x0'));var path=require(_0xa17e('0x1'));var timeout=require(_0xa17e('0x2'));var express=require(_0xa17e('0x3'));var router=express[_0xa17e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa17e('0x5'));var interaction=require(_0xa17e('0x6'));var config=require(_0xa17e('0x7'));var controller=require(_0xa17e('0x8'));router[_0xa17e('0x9')]('/',auth[_0xa17e('0xa')](),controller[_0xa17e('0xb')]);router['get'](_0xa17e('0xc'),auth[_0xa17e('0xa')](),controller['describe']);router['get'](_0xa17e('0xd'),auth[_0xa17e('0xa')](),controller[_0xa17e('0xe')]);router['get'](_0xa17e('0xf'),auth[_0xa17e('0xa')](),controller[_0xa17e('0x10')]);router[_0xa17e('0x9')](_0xa17e('0x11'),auth[_0xa17e('0xa')](),controller[_0xa17e('0x12')]);router[_0xa17e('0x13')]('/',auth[_0xa17e('0xa')](),controller['create']);router[_0xa17e('0x13')]('/:id/messages',auth[_0xa17e('0xa')](),controller['addMessage']);router[_0xa17e('0x13')](_0xa17e('0x14'),auth[_0xa17e('0xa')](),interaction['tracked'](_0xa17e('0x15'),_0xa17e('0x16')),controller[_0xa17e('0x17')]);router[_0xa17e('0x18')](_0xa17e('0xd'),auth[_0xa17e('0xa')](),interaction[_0xa17e('0x19')](_0xa17e('0x15'),'openchannelinteraction:update'),controller[_0xa17e('0x1a')]);router[_0xa17e('0x1b')]('/:id',auth[_0xa17e('0xa')](),interaction[_0xa17e('0x19')](_0xa17e('0x15'),_0xa17e('0x1c')),controller[_0xa17e('0x1d')]);router[_0xa17e('0x1b')](_0xa17e('0x14'),auth['isAuthenticated'](),controller[_0xa17e('0x1e')]);module[_0xa17e('0x1f')]=router; \ No newline at end of file +var _0xe1da=['/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages'];(function(_0xded2fe,_0xc88fc7){var _0x5c37b0=function(_0x45218b){while(--_0x45218b){_0xded2fe['push'](_0xded2fe['shift']());}};_0x5c37b0(++_0xc88fc7);}(_0xe1da,0x1f2));var _0xae1d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe1da[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xae1d('0x0'));var util=require(_0xae1d('0x1'));var path=require(_0xae1d('0x2'));var timeout=require(_0xae1d('0x3'));var express=require(_0xae1d('0x4'));var router=express[_0xae1d('0x5')]();var fs_extra=require(_0xae1d('0x6'));var auth=require(_0xae1d('0x7'));var interaction=require(_0xae1d('0x8'));var config=require(_0xae1d('0x9'));var controller=require(_0xae1d('0xa'));router['get']('/',auth[_0xae1d('0xb')](),controller[_0xae1d('0xc')]);router[_0xae1d('0xd')](_0xae1d('0xe'),auth[_0xae1d('0xb')](),controller[_0xae1d('0xf')]);router[_0xae1d('0xd')](_0xae1d('0x10'),auth['isAuthenticated'](),controller[_0xae1d('0x11')]);router[_0xae1d('0xd')](_0xae1d('0x12'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x13')]);router['get'](_0xae1d('0x14'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x15')]);router[_0xae1d('0x16')]('/',auth[_0xae1d('0xb')](),controller[_0xae1d('0x17')]);router[_0xae1d('0x16')](_0xae1d('0x12'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x18')]);router['post'](_0xae1d('0x19'),auth[_0xae1d('0xb')](),interaction[_0xae1d('0x1a')](_0xae1d('0x1b'),_0xae1d('0x1c')),controller[_0xae1d('0x1d')]);router[_0xae1d('0x1e')](_0xae1d('0x10'),auth['isAuthenticated'](),interaction[_0xae1d('0x1a')](_0xae1d('0x1b'),_0xae1d('0x1f')),controller[_0xae1d('0x20')]);router[_0xae1d('0x21')](_0xae1d('0x10'),auth[_0xae1d('0xb')](),interaction[_0xae1d('0x1a')](_0xae1d('0x1b'),_0xae1d('0x22')),controller['destroy']);router[_0xae1d('0x21')](_0xae1d('0x19'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x23')]);module[_0xae1d('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 65ff584..b1fa68d 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 _0x9dc3=['STRING','DATE','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x44ea1b,_0x36bbd3){var _0x239690=function(_0x3ec34b){while(--_0x3ec34b){_0x44ea1b['push'](_0x44ea1b['shift']());}};_0x239690(++_0x36bbd3);}(_0x9dc3,0xa5));var _0x39dc=function(_0x32dcbd,_0x522a54){_0x32dcbd=_0x32dcbd-0x0;var _0x4d2e4d=_0x9dc3[_0x32dcbd];return _0x4d2e4d;};'use strict';var Sequelize=require(_0x39dc('0x0'));module[_0x39dc('0x1')]={'closed':{'type':Sequelize[_0x39dc('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x39dc('0x3')]},'thirdDisposition':{'type':Sequelize[_0x39dc('0x3')]},'note':{'type':Sequelize[_0x39dc('0x3')]},'read1stAt':{'type':Sequelize[_0x39dc('0x4')]},'threadId':{'type':Sequelize[_0x39dc('0x3')]},'externalUrl':{'type':Sequelize[_0x39dc('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x39dc('0x5')]('in',_0x39dc('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x39dc('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x39dc('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5bb7=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0x5bb7,0x1ee));var _0x75bb=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x5bb7[_0x5c9307];return _0x373e29;};'use strict';var Sequelize=require(_0x75bb('0x0'));module[_0x75bb('0x1')]={'closed':{'type':Sequelize[_0x75bb('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x75bb('0x3')]},'disposition':{'type':Sequelize[_0x75bb('0x4')]},'secondDisposition':{'type':Sequelize[_0x75bb('0x4')]},'thirdDisposition':{'type':Sequelize[_0x75bb('0x4')]},'note':{'type':Sequelize[_0x75bb('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x75bb('0x4')]},'externalUrl':{'type':Sequelize[_0x75bb('0x4')]},'lastMsgAt':{'type':Sequelize[_0x75bb('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x75bb('0x5')]('in',_0x75bb('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index a571c12..620dbc4 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 _0xb498=['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','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','rows','params','rawAttributes','intersection','includeAll','include','options','update','destroy','describe','OpenchannelMessage','omit','ids','filters','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','Tag','findAll','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','createdAt','secret','Account','Owner','get','mkdirSync','Openchannel','N.A.','closedAt','disposition','Public','Private','basename','existsSync','createReadStream','createWriteStream','direction','out','renderFile','views','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../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','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','then','end','error','stack','name','fullname','TagIds','Tags','forEach','push','catch','waiting','talking','answered','total','closed','UserId','index','map','OpenchannelInteraction','type','key','query','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','sqlOperator','length','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','split','ContactId','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','buildExpression','start','keys','some','compact','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','$gte','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','Sequelize'];(function(_0x13486c,_0x139348){var _0x135738=function(_0x3e494a){while(--_0x3e494a){_0x13486c['push'](_0x13486c['shift']());}};_0x135738(++_0x139348);}(_0xb498,0x153));var _0x8b49=function(_0x3e5fd9,_0x36dbf3){_0x3e5fd9=_0x3e5fd9-0x0;var _0x371334=_0xb498[_0x3e5fd9];return _0x371334;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b49('0x0'));var zipdir=require(_0x8b49('0x1'));var jsonpatch=require(_0x8b49('0x2'));var rp=require(_0x8b49('0x3'));var moment=require(_0x8b49('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8b49('0x5'));var util=require(_0x8b49('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8b49('0x7'));var fs=require('fs');var fs_extra=require(_0x8b49('0x8'));var _=require(_0x8b49('0x9'));var squel=require(_0x8b49('0xa'));var crypto=require(_0x8b49('0xb'));var jsforce=require(_0x8b49('0xc'));var deskjs=require(_0x8b49('0xd'));var toCsv=require(_0x8b49('0xe'));var querystring=require(_0x8b49('0xf'));var Papa=require(_0x8b49('0x10'));var Redis=require(_0x8b49('0x11'));var authService=require(_0x8b49('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x8b49('0x13'));var hardwareService=require(_0x8b49('0x14'));var logger=require(_0x8b49('0x15'))(_0x8b49('0x16'));var utils=require(_0x8b49('0x17'));var config=require(_0x8b49('0x18'));var licenseUtil=require(_0x8b49('0x19'));var db=require(_0x8b49('0x1a'))['db'];config[_0x8b49('0x1b')]=_[_0x8b49('0x1c')](config['redis'],{'host':_0x8b49('0x1d'),'port':0x18eb});var socket=require(_0x8b49('0x1e'))(new Redis(config[_0x8b49('0x1b')]));require(_0x8b49('0x1f'))[_0x8b49('0x20')](socket);function respondWithStatusCode(_0x3004af,_0xd3231c){_0xd3231c=_0xd3231c||0xcc;return function(_0xce1b5c){if(_0xce1b5c){return _0x3004af[_0x8b49('0x21')](_0xd3231c);}return _0x3004af[_0x8b49('0x22')](_0xd3231c)['end']();};}function respondWithResult(_0xfde7a7,_0x2027f3){_0x2027f3=_0x2027f3||0xc8;return function(_0x5af696){if(_0x5af696){return _0xfde7a7[_0x8b49('0x22')](_0x2027f3)[_0x8b49('0x23')](_0x5af696);}};}function respondWithFilteredResult(_0x3196b0,_0x5c44de){return function(_0x264552){if(_0x264552){var _0x19fd74=typeof _0x5c44de['offset']===_0x8b49('0x24')&&typeof _0x5c44de[_0x8b49('0x25')]===_0x8b49('0x24');var _0x32c00a=_0x264552[_0x8b49('0x26')];var _0x3dd9b3=_0x19fd74?0x0:_0x5c44de[_0x8b49('0x27')];var _0x3ae661=_0x19fd74?_0x264552['count']:_0x5c44de[_0x8b49('0x27')]+_0x5c44de[_0x8b49('0x25')];var _0x3be0af;if(_0x3ae661>=_0x32c00a){_0x3ae661=_0x32c00a;_0x3be0af=0xc8;}else{_0x3be0af=0xce;}_0x3196b0['status'](_0x3be0af);return _0x3196b0[_0x8b49('0x28')](_0x8b49('0x29'),_0x3dd9b3+'-'+_0x3ae661+'/'+_0x32c00a)[_0x8b49('0x23')](_0x264552);}return null;};}function patchUpdates(_0x371d53){return function(_0x578d75){try{jsonpatch['apply'](_0x578d75,_0x371d53,!![]);}catch(_0x2cfd6d){return BPromise[_0x8b49('0x2a')](_0x2cfd6d);}return _0x578d75['save']();};}function saveUpdates(_0x23d8c4,_0x345db7){return function(_0x12b206){if(_0x12b206){return _0x12b206['update'](_0x23d8c4)[_0x8b49('0x2b')](function(_0x3413f2){return _0x3413f2;});}return null;};}function removeEntity(_0x579eb9,_0x162a84){return function(_0xf9f795){if(_0xf9f795){return _0xf9f795['destroy']()['then'](function(){_0x579eb9[_0x8b49('0x22')](0xcc)[_0x8b49('0x2c')]();});}};}function handleEntityNotFound(_0x401a87,_0x725f89){return function(_0x1fd692){if(!_0x1fd692){_0x401a87[_0x8b49('0x21')](0x194);}return _0x1fd692;};}function handleError(_0x4bccc0,_0x3fe087){_0x3fe087=_0x3fe087||0x1f4;return function(_0x4fa205){logger[_0x8b49('0x2d')](_0x4fa205[_0x8b49('0x2e')]);if(_0x4fa205[_0x8b49('0x2f')]){delete _0x4fa205[_0x8b49('0x2f')];}_0x4bccc0[_0x8b49('0x22')](_0x3fe087)['send'](_0x4fa205);};}function getInteractionUsers(_0x2b3871,_0x5afd20){return new BPromise(function(_0x5d4fc2,_0x2ee33b){try{if(_0x5afd20[_0x2b3871['id']]){_0x2b3871['Users']=_['map'](_0x5afd20[_0x2b3871['id']],function(_0x93a8fa){return{'id':_0x93a8fa['id'],'fullname':_0x93a8fa[_0x8b49('0x30')]};});}}catch(_0xc98973){_0x2ee33b(_0xc98973);}_0x5d4fc2(_0x2b3871);});}function getInteractionTags(_0xf45f67,_0x1906b6){return new BPromise(function(_0x3a222c,_0x53bc36){try{if(_0xf45f67[_0x8b49('0x31')]){_0xf45f67[_0x8b49('0x32')]=[];_0xf45f67[_0x8b49('0x31')]['split'](',')[_0x8b49('0x33')](function(_0x533066){_0xf45f67[_0x8b49('0x32')][_0x8b49('0x34')](_0x1906b6[_0x533066]);});}delete _0xf45f67[_0x8b49('0x31')];}catch(_0x144aaa){_0x53bc36(_0x144aaa);}_0x3a222c(_0xf45f67);});}function updateOpenchannelInteraction(_0x10b753,_0x237b68,_0x3fed93){return new BPromise(function(_0x228d4a,_0x222c3c){return getInteractionUsers(_0x10b753,_0x3fed93)[_0x8b49('0x2b')](function(_0x38f33c){return getInteractionTags(_0x38f33c,_0x237b68);})[_0x8b49('0x2b')](function(_0x3db1f5){return getStateInteraction(_0x3db1f5);})[_0x8b49('0x2b')](function(_0x521e9c){_0x228d4a(_0x521e9c);})[_0x8b49('0x35')](function(_0x9871e7){_0x222c3c(_0x9871e7);});});}function getStateInteraction(_0x525092){return new BPromise(function(_0x29045d){_0x525092[_0x8b49('0x36')]=0x0;_0x525092[_0x8b49('0x37')]=0x0;_0x525092[_0x8b49('0x38')]=0x0;_0x525092['unmanaged']=0x0;_0x525092[_0x8b49('0x39')]=0x0;if(!_0x525092[_0x8b49('0x3a')]&&!_0x525092['UserId']){_0x525092['waiting']+=0x1;}if(!_0x525092[_0x8b49('0x3a')]&&_0x525092[_0x8b49('0x3b')]){_0x525092[_0x8b49('0x37')]+=0x1;if(_0x525092[_0x8b49('0x36')]){_0x525092[_0x8b49('0x36')]-=0x1;}}if(_0x525092[_0x8b49('0x3a')]&&_0x525092[_0x8b49('0x3b')]){_0x525092[_0x8b49('0x38')]+=0x1;if(_0x525092[_0x8b49('0x37')]){_0x525092[_0x8b49('0x37')]-=0x1;}}if(_0x525092[_0x8b49('0x3a')]&&!_0x525092['UserId']){_0x525092['unmanaged']+=0x1;if(_0x525092[_0x8b49('0x36')]){_0x525092['waiting']-=0x1;}}_0x525092[_0x8b49('0x39')]+=0x1;_0x29045d(_0x525092);});}exports[_0x8b49('0x3c')]=function(_0x17b4e8,_0x2afeed){var _0x2b5764={},_0x1c3c24={},_0x2d3361={'count':0x0,'rows':[]};var _0x7d9dd4=_[_0x8b49('0x3d')](db[_0x8b49('0x3e')]['rawAttributes'],function(_0x4fda71){return{'name':_0x4fda71['fieldName'],'type':_0x4fda71[_0x8b49('0x3f')][_0x8b49('0x40')]};});_0x1c3c24['model']=_[_0x8b49('0x3d')](_0x7d9dd4,_0x8b49('0x2f'));_0x1c3c24[_0x8b49('0x41')]=_['keys'](_0x17b4e8[_0x8b49('0x41')]);_0x1c3c24['filters']=_['intersection'](_0x1c3c24[_0x8b49('0x42')],_0x1c3c24[_0x8b49('0x41')]);_0x2b5764['attributes']=_['intersection'](_0x1c3c24[_0x8b49('0x42')],qs[_0x8b49('0x43')](_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x43')]));_0x2b5764[_0x8b49('0x44')]=_0x2b5764[_0x8b49('0x44')]['length']?_0x2b5764[_0x8b49('0x44')]:_0x1c3c24[_0x8b49('0x42')];if(!_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x45')](_0x8b49('0x46'))){_0x2b5764['limit']=qs[_0x8b49('0x25')](_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x25')]);_0x2b5764['offset']=qs['offset'](_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x27')]);}_0x2b5764[_0x8b49('0x47')]=qs[_0x8b49('0x48')](_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x48')]);_0x2b5764['where']=qs['filters'](_[_0x8b49('0x49')](_0x17b4e8[_0x8b49('0x41')],_0x1c3c24['filters']),_0x7d9dd4);var _0x273f91=[];var _0x58c477=squel[_0x8b49('0x4a')]()['field']('id')[_0x8b49('0x4b')](_0x8b49('0x2f'))['field'](_0x8b49('0x4c'))[_0x8b49('0x4d')](_0x8b49('0x4e'));var _0x4eee27=squel[_0x8b49('0x4a')]()[_0x8b49('0x4b')]('u.id')['field'](_0x8b49('0x4f'))[_0x8b49('0x4b')](_0x8b49('0x50'))[_0x8b49('0x4d')](_0x8b49('0x51'),'ui')[_0x8b49('0x52')](_0x8b49('0x53'),'u',_0x8b49('0x54'));var _0x3ac50c=squel['select']()[_0x8b49('0x4d')](_0x8b49('0x55'),'i')['left_join'](_0x8b49('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o','o.id\x20=\x20i.UserId')[_0x8b49('0x52')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0x8b49('0x52')](_0x8b49('0x57'),'me',_0x8b49('0x58'))[_0x8b49('0x52')](_0x8b49('0x59'),'it',_0x8b49('0x5a'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x1aebbe=squel[_0x8b49('0x5b')]();var _0x3a36ee=[];var _0x2605a5=squel['expr']();var _0x46bfb2;if(_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x5c')]){_0x46bfb2=as['parseSearch'](_0x17b4e8['query'][_0x8b49('0x5c')]);var _0x4f29b0=_0x46bfb2[_0x8b49('0x5d')];for(var _0x2b8134=0x0;_0x2b8134<_0x46bfb2['conditions'][_0x8b49('0x5e')];_0x2b8134++){var _0x31b205=_0x46bfb2[_0x8b49('0x5f')][_0x2b8134];var _0x1ee4f0='i';var _0x17310c=_[_0x8b49('0x60')](_0x7d9dd4,[_0x8b49('0x2f'),_0x31b205[_0x8b49('0x4b')]]);if(!_0x17310c){switch(_0x31b205[_0x8b49('0x4b')]){case _0x8b49('0x61'):if(_0x31b205[_0x8b49('0x62')]==0x1){_0x3ac50c[_0x8b49('0x63')]('`'+_0x31b205[_0x8b49('0x4b')]+_0x8b49('0x64'));}else{_0x3ac50c[_0x8b49('0x63')]('`'+_0x31b205[_0x8b49('0x4b')]+_0x8b49('0x65'));}break;case _0x8b49('0x66'):if(_0x31b205[_0x8b49('0x67')]==='$substring'){if(_0x31b205['value'][_0x8b49('0x68')]('\x20')[_0x8b49('0x5e')]>0x1){_0x1aebbe[_0x4f29b0]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x31b205[_0x8b49('0x62')]),null);}else{var _0x2749cd='%'+_0x31b205[_0x8b49('0x62')]+'%';_0x1aebbe[_0x4f29b0]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2749cd,_0x2749cd,_0x2749cd);}}else{_0x17310c=_[_0x8b49('0x60')](_0x7d9dd4,[_0x8b49('0x2f'),_0x8b49('0x69')]);_0x31b205['field']='ContactId';_0xc93b1e=as['buildExpression'](_0x1ee4f0,_0x17310c['type'],_0x31b205);_0x1aebbe[_0x4f29b0](_0xc93b1e[_0x8b49('0x6a')],_0xc93b1e[_0x8b49('0x62')]['start'],_0xc93b1e[_0x8b49('0x62')]['end']);}break;case'Tag':var _0x449926=_0x31b205['value'][_0x8b49('0x68')](',')[_0x8b49('0x3d')](function(_0x56b2f4){return Number(_0x56b2f4);});_0x449926[_0x8b49('0x33')](function(_0x2beaa0){_0x2605a5['or'](_0x8b49('0x6b'),'%,'+_0x2beaa0+',%');});_0x3a36ee=_[_0x8b49('0x6c')](_0x3a36ee,_0x449926);break;case _0x8b49('0x6d'):if(_0x31b205['operator']===_0x8b49('0x6e')){_0x1aebbe[_0x4f29b0](_0x8b49('0x6f'),'%'+_0x31b205[_0x8b49('0x62')]+'%',null);}else{_0x17310c=_['find'](_0x7d9dd4,[_0x8b49('0x2f'),_0x8b49('0x3b')]);_0x31b205[_0x8b49('0x4b')]=_0x8b49('0x3b');_0xc93b1e=as['buildExpression'](_0x1ee4f0,_0x17310c[_0x8b49('0x3f')],_0x31b205);_0x1aebbe[_0x4f29b0](_0xc93b1e[_0x8b49('0x6a')],_0xc93b1e[_0x8b49('0x62')]['start'],_0xc93b1e[_0x8b49('0x62')][_0x8b49('0x2c')]);}break;case _0x8b49('0x70'):_0xc93b1e=as[_0x8b49('0x71')]('me',null,_0x31b205);_0x1aebbe[_0x4f29b0](_0xc93b1e[_0x8b49('0x6a')],_0xc93b1e['value']['start'],_0xc93b1e[_0x8b49('0x62')][_0x8b49('0x2c')]);break;}}else{var _0xc93b1e=as[_0x8b49('0x71')](_0x1ee4f0,_0x17310c[_0x8b49('0x3f')],_0x31b205);_0x1aebbe[_0x4f29b0](_0xc93b1e[_0x8b49('0x6a')],_0xc93b1e[_0x8b49('0x62')][_0x8b49('0x72')],_0xc93b1e[_0x8b49('0x62')][_0x8b49('0x2c')]);}}}else{var _0xf0c531=_(_0x17b4e8['query'])[_0x8b49('0x73')]()[_0x8b49('0x3d')](function(_0x512434){return _[_0x8b49('0x74')](_0x7d9dd4,['name',_0x512434])?_0x512434:undefined;})[_0x8b49('0x75')]()[_0x8b49('0x62')]();if(!_[_0x8b49('0x76')](_0xf0c531)){_0xf0c531[_0x8b49('0x33')](function(_0x33e2a9){if(_0x33e2a9===_0x8b49('0x77')){_0x3ac50c[_0x8b49('0x78')](_0x8b49('0x79'),[]['concat'](_0x17b4e8[_0x8b49('0x41')][_0x33e2a9]));}else if(_0x33e2a9==='createdAt'){var _0x203dc4=JSON['parse'](_0x17b4e8[_0x8b49('0x41')][_0x33e2a9])[_0x8b49('0x7a')];var _0x4b9ad9=JSON['parse'](_0x17b4e8[_0x8b49('0x41')][_0x33e2a9])['$lte'];_0x3ac50c[_0x8b49('0x78')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x203dc4,_0x4b9ad9);}else{if(_0x17b4e8['query'][_0x33e2a9]==='null'){_0x3ac50c['where']('i.'+_0x33e2a9+_0x8b49('0x7b'));}else{_0x3ac50c[_0x8b49('0x78')]('i.'+_0x33e2a9+'\x20=\x20?',_0x17b4e8[_0x8b49('0x41')][_0x33e2a9]);}}});}if(_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x7c')]){if(_0x17b4e8['query']['read']==0x1){_0x3ac50c['having'](_0x8b49('0x7d'));}else{_0x3ac50c[_0x8b49('0x63')](_0x8b49('0x7e'));}}if(_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x7f')]){_0x3a36ee=_[_0x8b49('0x80')](_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x7f')])?_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x7f')]:new Array(_0x17b4e8[_0x8b49('0x41')]['tag']);_0x3a36ee['forEach'](function(_0xdb5d04){_0x2605a5['or'](_0x8b49('0x6b'),'%,'+_0xdb5d04+',%');});}if(_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x81')]){var _0x5ee535=_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x81')][_0x8b49('0x82')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8b49('0x83')](_0x5ee535)){_0x1aebbe['or']('i.id\x20LIKE\x20?',_0x5ee535+'%');}else{_0x1aebbe['or'](_0x8b49('0x84'),qs[_0x8b49('0x85')](_0x5ee535))['or']('i.from\x20LIKE\x20?',_0x5ee535+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5ee535+'%');}}}_0x3ac50c[_0x8b49('0x78')](_0x1aebbe);_0x3ac50c[_0x8b49('0x86')](_0x8b49('0x87'));var _0x4a7027={'type':db[_0x8b49('0x88')]['QueryTypes']['SELECT'],'raw':!![]};var _0x561edb=_0x3ac50c[_0x8b49('0x89')]();_0x561edb[_0x8b49('0x4b')](_0x8b49('0x87'));_0x561edb[_0x8b49('0x4b')](_0x8b49('0x8a'),'unreadMessages');if(_0x2b5764[_0x8b49('0x47')]){_0x2b5764[_0x8b49('0x47')]['forEach'](function(_0x3b8f3d){var _0x184f0c=_0x3b8f3d[0x0]===_0x8b49('0x8b')?_0x3b8f3d[0x0]:'i.'+_0x3b8f3d[0x0];_0x3ac50c[_0x8b49('0x47')](_0x184f0c,_0x3b8f3d[0x1]===_0x8b49('0x8c')?![]:!![]);});}if(!_[_0x8b49('0x76')](_0x3a36ee)){_0x3ac50c[_0x8b49('0x63')](_0x2605a5);_0x561edb[_0x8b49('0x78')](_0x8b49('0x8d'),_0x3a36ee);}BPromise[_0x8b49('0x8e')]()[_0x8b49('0x2b')](function(){if(!_0x46bfb2){if(_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x77')])return;_0x561edb['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x3ac50c['where'](_0x8b49('0x8f'));return;}if(_0x17b4e8[_0x8b49('0x90')][_0x8b49('0x91')]!==_0x8b49('0x92'))return;return _0x17b4e8['user'][_0x8b49('0x93')]({'attributes':['id'],'raw':!![]})[_0x8b49('0x2b')](function(_0x4965b9){if(_[_0x8b49('0x76')](_0x4965b9)){_0x561edb[_0x8b49('0x78')](_0x8b49('0x94'));_0x3ac50c[_0x8b49('0x78')](_0x8b49('0x94'));}else{_0x561edb[_0x8b49('0x78')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x8b49('0x3d')](_0x4965b9,'id'));_0x3ac50c[_0x8b49('0x78')](_0x8b49('0x79'),_[_0x8b49('0x3d')](_0x4965b9,'id'));}});})[_0x8b49('0x2b')](function(){if(_0x17b4e8[_0x8b49('0x90')]['role']===_0x8b49('0x92')&&!_0x46bfb2&&!_0x17b4e8[_0x8b49('0x41')]['OpenchannelAccountId'])return[];return db[_0x8b49('0x95')][_0x8b49('0x41')](_0x561edb[_0x8b49('0x96')](),_0x4a7027);})[_0x8b49('0x2b')](function(_0x480b04){_0x2d3361['count']=_0x480b04[_0x8b49('0x5e')];if(_0x2d3361[_0x8b49('0x26')]===0x0)return[];return db[_0x8b49('0x95')][_0x8b49('0x41')](_0x58c477[_0x8b49('0x96')](),_0x4a7027)[_0x8b49('0x2b')](function(_0x13b9de){_0x273f91=_[_0x8b49('0x97')](_0x13b9de,'id');_0x4a7027=_[_0x8b49('0x98')](_0x4a7027,{'model':db[_0x8b49('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x17b4e8[_0x8b49('0x41')][_0x8b49('0x43')]){_0x2b5764[_0x8b49('0x44')][_0x8b49('0x33')](function(_0x2446ff){_0x3ac50c[_0x8b49('0x4b')]('i.'+_0x2446ff);});}else{_0x3ac50c[_0x8b49('0x4b')](_0x8b49('0x8a'),_0x8b49('0x61'));_0x3ac50c[_0x8b49('0x4b')](_0x8b49('0x99'),_0x8b49('0x9a'));_0x3ac50c['field'](_0x8b49('0x9b'),_0x8b49('0x9c'));_0x3ac50c[_0x8b49('0x4b')](_0x8b49('0x9d'),'contactName');_0x3ac50c[_0x8b49('0x4b')](_0x8b49('0x9e'));_0x3ac50c['field'](_0x8b49('0x9f'),_0x8b49('0xa0'));_0x3ac50c['field'](_0x8b49('0xa1'),_0x8b49('0xa2'));_0x3ac50c[_0x8b49('0x4b')](_0x8b49('0xa3'),_0x8b49('0xa4'));_0x3ac50c[_0x8b49('0x4b')](_0x8b49('0xa5'),_0x8b49('0xa6'));_0x3ac50c[_0x8b49('0x4b')](_0x8b49('0xa7'),_0x8b49('0xa8'));_0x3ac50c[_0x8b49('0x4b')](_0x8b49('0xa9'),_0x8b49('0xaa'));_0x3ac50c[_0x8b49('0x4b')](_0x8b49('0xab'),'Owner.fullname');_0x3ac50c[_0x8b49('0x4b')]('o.internal',_0x8b49('0xac'));_0x3ac50c[_0x8b49('0x4b')](_0x8b49('0xad'),'TagIds');}if(_0x2b5764[_0x8b49('0x25')])_0x3ac50c[_0x8b49('0x25')](_0x2b5764['limit']);if(_0x2b5764[_0x8b49('0x27')])_0x3ac50c[_0x8b49('0x27')](_0x2b5764[_0x8b49('0x27')]);return db['sequelize']['query'](_0x3ac50c['toString'](),_0x4a7027);})['then'](function(_0x231109){if(_0x231109[_0x8b49('0x5e')]>0x0)_0x4eee27['where'](_0x8b49('0xae'),_[_0x8b49('0x3d')](_0x231109,'id'));return db['sequelize'][_0x8b49('0x41')](_0x4eee27[_0x8b49('0x96')](),_0x4a7027)[_0x8b49('0x2b')](function(_0x535762){var _0x511940=_[_0x8b49('0xaf')](_0x535762,'OpenchannelInteractionId');var _0x59c83d=[];_0x231109[_0x8b49('0x33')](function(_0x1cb7f5){_0x59c83d['push'](updateOpenchannelInteraction(_0x1cb7f5,_0x273f91,_0x511940));});return BPromise['all'](_0x59c83d);});});})[_0x8b49('0x2b')](function(_0x5c7eab){_0x2d3361[_0x8b49('0xb0')]=_0x5c7eab;return _0x2d3361;})[_0x8b49('0x2b')](respondWithFilteredResult(_0x2afeed,_0x2b5764))['catch'](handleError(_0x2afeed,null));};exports['show']=function(_0x3e2d0d,_0xd8f2f0){var _0x4e9aeb={};if(_0x3e2d0d[_0x8b49('0x41')][_0x8b49('0x3f')]&&_0x3e2d0d['query']['type']===_0x8b49('0x4d')){_0x4e9aeb[_0x8b49('0x4d')]=_0x3e2d0d['params']['id'];}else{_0x4e9aeb['id']=_0x3e2d0d[_0x8b49('0xb1')]['id'];}var _0xce187e={'raw':![],'where':_0x4e9aeb},_0x96f75c={};_0x96f75c['model']=_[_0x8b49('0x73')](db['OpenchannelInteraction'][_0x8b49('0xb2')]);_0x96f75c[_0x8b49('0x41')]=_[_0x8b49('0x73')](_0x3e2d0d[_0x8b49('0x41')]);_0x96f75c['filters']=_['intersection'](_0x96f75c[_0x8b49('0x42')],_0x96f75c[_0x8b49('0x41')]);_0xce187e['attributes']=_[_0x8b49('0xb3')](_0x96f75c[_0x8b49('0x42')],qs[_0x8b49('0x43')](_0x3e2d0d['query'][_0x8b49('0x43')]));_0xce187e[_0x8b49('0x44')]=_0xce187e[_0x8b49('0x44')][_0x8b49('0x5e')]?_0xce187e[_0x8b49('0x44')]:_0x96f75c['model'];if(_0x3e2d0d[_0x8b49('0x41')][_0x8b49('0xb4')]){_0xce187e[_0x8b49('0xb5')]=[{'all':!![]}];}_0xce187e=_[_0x8b49('0x98')]({},_0xce187e,_0x3e2d0d[_0x8b49('0xb6')]);return db[_0x8b49('0x3e')][_0x8b49('0x60')](_0xce187e)[_0x8b49('0x2b')](handleEntityNotFound(_0xd8f2f0,null))[_0x8b49('0x2b')](respondWithResult(_0xd8f2f0,null))[_0x8b49('0x35')](handleError(_0xd8f2f0,null));};exports['create']=function(_0x5f07e1,_0x2af908){return db[_0x8b49('0x3e')]['create'](_0x5f07e1[_0x8b49('0x70')],{})[_0x8b49('0x2b')](respondWithResult(_0x2af908,0xc9))[_0x8b49('0x35')](handleError(_0x2af908,null));};exports[_0x8b49('0xb7')]=function(_0x3121a8,_0x252876){if(_0x3121a8['body']['id']){delete _0x3121a8['body']['id'];}return db['OpenchannelInteraction'][_0x8b49('0x60')]({'where':{'id':_0x3121a8[_0x8b49('0xb1')]['id']}})[_0x8b49('0x2b')](handleEntityNotFound(_0x252876,null))[_0x8b49('0x2b')](saveUpdates(_0x3121a8['body'],null))['then'](respondWithResult(_0x252876,null))['catch'](handleError(_0x252876,null));};exports[_0x8b49('0xb8')]=function(_0x2d62e8,_0xe9659a){return db[_0x8b49('0x3e')][_0x8b49('0x60')]({'where':{'id':_0x2d62e8[_0x8b49('0xb1')]['id']}})[_0x8b49('0x2b')](handleEntityNotFound(_0xe9659a,null))[_0x8b49('0x2b')](removeEntity(_0xe9659a,null))[_0x8b49('0x35')](handleError(_0xe9659a,null));};exports[_0x8b49('0xb9')]=function(_0x2ddf6e,_0x2705b4){return db[_0x8b49('0x3e')][_0x8b49('0xb9')]()['then'](respondWithResult(_0x2705b4,null))[_0x8b49('0x35')](handleError(_0x2705b4,null));};exports['addMessage']=function(_0x3f2c84,_0x407bca,_0x2848a3){return db[_0x8b49('0xba')][_0x8b49('0x60')]({'where':{'id':_0x3f2c84[_0x8b49('0xb1')]['id']}})[_0x8b49('0x2b')](handleEntityNotFound(_0x407bca,null))[_0x8b49('0x2b')](function(_0x2b2e07){if(_0x2b2e07){return _0x2b2e07['addMessage'](_0x3f2c84['body']['ids'],_[_0x8b49('0xbb')](_0x3f2c84[_0x8b49('0x70')],[_0x8b49('0xbc'),'id'])||{});}})['then'](respondWithResult(_0x407bca,null))[_0x8b49('0x35')](handleError(_0x407bca,null));};exports['getMessages']=function(_0x9a77ff,_0x337ff0,_0x197ea0){var _0x55811c={'raw':![],'where':{}};var _0xe94631={};var _0x22ec0c={'count':0x0,'rows':[]};return db[_0x8b49('0x3e')]['findOne']({'where':{'id':_0x9a77ff['params']['id']}})[_0x8b49('0x2b')](handleEntityNotFound(_0x337ff0,null))['then'](function(_0x4abe52){if(_0x4abe52){_0xe94631['model']=_[_0x8b49('0x73')](db[_0x8b49('0xba')][_0x8b49('0xb2')]);_0xe94631[_0x8b49('0x41')]=_[_0x8b49('0x73')](_0x9a77ff[_0x8b49('0x41')]);_0xe94631[_0x8b49('0xbd')]=_[_0x8b49('0xb3')](_0xe94631[_0x8b49('0x42')],_0xe94631[_0x8b49('0x41')]);_0x55811c[_0x8b49('0x44')]=_[_0x8b49('0xb3')](_0xe94631['model'],qs['fields'](_0x9a77ff[_0x8b49('0x41')][_0x8b49('0x43')]));_0x55811c[_0x8b49('0x44')]=_0x55811c['attributes']['length']?_0x55811c[_0x8b49('0x44')]:_0xe94631[_0x8b49('0x42')];if(!_0x9a77ff[_0x8b49('0x41')][_0x8b49('0x45')](_0x8b49('0x46'))){_0x55811c[_0x8b49('0x25')]=qs[_0x8b49('0x25')](_0x9a77ff[_0x8b49('0x41')][_0x8b49('0x25')]);_0x55811c[_0x8b49('0x27')]=qs['offset'](_0x9a77ff[_0x8b49('0x41')][_0x8b49('0x27')]);}_0x55811c[_0x8b49('0x47')]=qs['sort'](_0x9a77ff[_0x8b49('0x41')][_0x8b49('0x48')]);_0x55811c[_0x8b49('0x78')]=qs[_0x8b49('0xbd')](_[_0x8b49('0x49')](_0x9a77ff[_0x8b49('0x41')],_0xe94631[_0x8b49('0xbd')]));_0x55811c['where'][_0x8b49('0xbe')]=_0x4abe52['id'];if(_0x9a77ff[_0x8b49('0x41')][_0x8b49('0x81')]){_0x55811c[_0x8b49('0x78')]=_[_0x8b49('0x98')](_0x55811c[_0x8b49('0x78')],{'$or':_[_0x8b49('0x3d')](_0x55811c[_0x8b49('0x44')],function(_0x260c9c){var _0x56ef45={};_0x56ef45[_0x260c9c]={'$like':'%'+_0x9a77ff[_0x8b49('0x41')][_0x8b49('0x81')]+'%'};return _0x56ef45;})});}if(_0x9a77ff[_0x8b49('0x41')][_0x8b49('0x7a')]){var _0x458c11=_0x9a77ff[_0x8b49('0x41')]['$gte'][_0x8b49('0x68')](',');var _0x46001c={};_0x46001c[_0x458c11[0x0]]={'$gte':moment(_0x458c11[0x1])[_0x8b49('0xbf')](_0x8b49('0xc0'))};_0x55811c[_0x8b49('0x78')]=_['merge'](_0x55811c['where'],_0x46001c);}_0x55811c=_[_0x8b49('0x98')]({},_0x55811c,_0x9a77ff[_0x8b49('0xb6')]);return db['OpenchannelMessage'][_0x8b49('0x26')]({'where':_0x55811c[_0x8b49('0x78')]})['then'](function(_0x3b1162){_0x22ec0c[_0x8b49('0x26')]=_0x3b1162;if(_0x9a77ff[_0x8b49('0x41')][_0x8b49('0xb4')]){_0x55811c[_0x8b49('0xb5')]=[{'all':!![]}];}return db[_0x8b49('0xba')]['findAll'](_0x55811c);})[_0x8b49('0x2b')](function(_0x3af95d){_0x22ec0c[_0x8b49('0xb0')]=_0x3af95d;return _0x22ec0c;});}})[_0x8b49('0x2b')](respondWithFilteredResult(_0x337ff0,_0x55811c))[_0x8b49('0x35')](handleError(_0x337ff0,null));};exports[_0x8b49('0xc1')]=function(_0x5a85f4,_0x358d2a,_0x3433cd){return db[_0x8b49('0x3e')]['find']({'where':{'id':_0x5a85f4[_0x8b49('0xb1')]['id']}})[_0x8b49('0x2b')](handleEntityNotFound(_0x358d2a,null))['then'](function(_0x260c8f){if(_0x260c8f){return _0x260c8f['setTags'](_0x5a85f4[_0x8b49('0x70')][_0x8b49('0xbc')],_[_0x8b49('0xbb')](_0x5a85f4[_0x8b49('0x70')],[_0x8b49('0xbc'),'id'])||{})[_0x8b49('0xc2')](function(){return db[_0x8b49('0xc3')][_0x8b49('0xc4')]({'attributes':['id',_0x8b49('0x2f'),_0x8b49('0x4c')],'where':{'id':_0x5a85f4[_0x8b49('0x70')]['ids']}});})[_0x8b49('0x2b')](function(_0x12f323){socket[_0x8b49('0xc5')](_0x8b49('0xc6'),{'id':Number(_0x5a85f4[_0x8b49('0xb1')]['id']),'tags':_0x12f323||[]});return{'id':Number(_0x5a85f4['params']['id']),'tags':_0x12f323||[]};});}})[_0x8b49('0x2b')](respondWithResult(_0x358d2a,null))[_0x8b49('0x35')](handleError(_0x358d2a,null));};exports[_0x8b49('0xc7')]=function(_0x223ca7,_0x484ef2,_0x4abf7d){return db[_0x8b49('0x3e')][_0x8b49('0x60')]({'where':{'id':_0x223ca7['params']['id']}})['then'](handleEntityNotFound(_0x484ef2,null))[_0x8b49('0x2b')](function(_0x536b5c){if(_0x536b5c){return _0x536b5c[_0x8b49('0xc7')](_0x223ca7[_0x8b49('0x41')][_0x8b49('0xbc')]);}})[_0x8b49('0x2b')](respondWithStatusCode(_0x484ef2,null))[_0x8b49('0x35')](handleError(_0x484ef2,null));};exports[_0x8b49('0xc8')]=function(_0xda3e00,_0x19e2cf){var _0x4e24f1=moment()[_0x8b49('0xc9')]()[_0x8b49('0x96')]();var _0x4f5fa4=path[_0x8b49('0xca')](config[_0x8b49('0xcb')],_0x8b49('0xcc'),_0x8b49('0xcd'),_0x8b49('0xce'));var _0x13c70c=path['join'](config[_0x8b49('0xcb')],_0x8b49('0xcc'),'files',_0x8b49('0xcf'));var _0x2a543b=path['join'](_0x4f5fa4,_0x4e24f1);var _0x55f456=util[_0x8b49('0xbf')](_0x8b49('0xd0'),_0xda3e00[_0x8b49('0xb1')]['id'],_0x4e24f1);var _0x7a79c7=path[_0x8b49('0xca')](_0x4f5fa4,_0x55f456);var _0x4499fd=[];_0x4499fd[_0x8b49('0x34')]({'model':db[_0x8b49('0x6d')],'as':_0x8b49('0x6d'),'attributes':['id',_0x8b49('0x30')],'raw':!![]});_0x4499fd[_0x8b49('0x34')]({'model':db[_0x8b49('0xd1')],'as':'Contact','attributes':['id',_0x8b49('0xd2'),_0x8b49('0xd3')],'raw':!![]});if(_0xda3e00[_0x8b49('0x41')][_0x8b49('0xcf')]){_0x4499fd[_0x8b49('0x34')]({'model':db[_0x8b49('0xd4')],'as':_0x8b49('0xd4'),'raw':!![]});}var _0x3e4ff5=[{'model':db[_0x8b49('0xba')],'as':_0x8b49('0xd5'),'attributes':['id',_0x8b49('0x70'),_0x8b49('0xd6'),'direction',_0x8b49('0xd7'),'read'],'include':_0x4499fd}];_0x3e4ff5['push']({'model':db['OpenchannelAccount'],'as':_0x8b49('0xd8'),'attributes':['id',_0x8b49('0x2f')]});_0x3e4ff5[_0x8b49('0x34')]({'model':db[_0x8b49('0x6d')],'as':_0x8b49('0xd9'),'attributes':['id',_0x8b49('0x30')]});return db['OpenchannelInteraction'][_0x8b49('0x60')]({'where':{'id':_0xda3e00['params']['id']},'include':_0x3e4ff5})['then'](handleEntityNotFound(_0x19e2cf,null))[_0x8b49('0x2b')](function(_0x448bc6){if(_0x448bc6){var _0x42804a=_0x448bc6[_0x8b49('0xda')]({'plain':!![]});fs[_0x8b49('0xdb')](_0x2a543b);var _0x1f3245={'channel':_0x8b49('0xdc'),'account':_0x42804a['Account'][_0x8b49('0x2f')],'agent':_0x42804a[_0x8b49('0xd9')]?_0x42804a[_0x8b49('0xd9')][_0x8b49('0x30')]:_0x8b49('0xdd'),'createdAt':moment(_0x42804a['createdAt'])[_0x8b49('0xbf')](_0x8b49('0xc0'))[_0x8b49('0x96')](),'closedAt':_0x42804a[_0x8b49('0x3a')]?moment(_0x42804a[_0x8b49('0xde')])[_0x8b49('0xbf')](_0x8b49('0xc0'))[_0x8b49('0x96')]():'','disposition':_0x42804a[_0x8b49('0xdf')],'visibility':_0x42804a['threadId']?_0x8b49('0xe0'):_0x8b49('0xe1'),'messages':_(_0x42804a[_0x8b49('0xd5')])[_0x8b49('0x81')]({'secret':![]})[_0x8b49('0x3d')](function(_0x424097){if(_0x424097['Attachment']){var _0x1e1ce6=path[_0x8b49('0xca')](_0x13c70c,_0x424097['Attachment'][_0x8b49('0xe2')]);if(fs[_0x8b49('0xe3')](_0x1e1ce6)){fs[_0x8b49('0xe4')](_0x1e1ce6)['pipe'](fs[_0x8b49('0xe5')](path['join'](_0x2a543b,_0x424097[_0x8b49('0xd4')][_0x8b49('0xe2')])));}}return{'date':moment(_0x424097[_0x8b49('0xd6')])[_0x8b49('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8b49('0x96')](),'sender':_0x424097[_0x8b49('0xe6')]==='out'?_0x424097[_0x8b49('0x6d')]?_0x424097[_0x8b49('0x6d')][_0x8b49('0x30')]:'System':_0x424097[_0x8b49('0x66')][_0x8b49('0xd2')]+(_0x424097['Contact'][_0x8b49('0xd3')]?'\x20'+_0x424097[_0x8b49('0x66')][_0x8b49('0xd3')]:''),'body':_0x424097[_0x8b49('0xd4')]?_0x424097[_0x8b49('0xd4')]['basename']:_0x424097[_0x8b49('0x70')],'direction':_0x424097['direction']===_0x8b49('0xe7')?'A':'C','secret':_0x424097['secret'],'read':_0x424097[_0x8b49('0x7c')],'attachment':_0x424097[_0x8b49('0xd4')]};})[_0x8b49('0x62')]()};return ejs[_0x8b49('0xe8')](path[_0x8b49('0xca')](config[_0x8b49('0xcb')],_0x8b49('0xcc'),_0x8b49('0xe9'),'downloadInteraction.ejs'),{'interaction':_0x1f3245})[_0x8b49('0x2b')](function(_0xac5839){var _0x5535b0=path[_0x8b49('0xca')](_0x2a543b,'transcript-'+_0x42804a['id']+'-'+_0x4e24f1+_0x8b49('0xea'));var _0x1de3ac={'path':_0x5535b0,'channel':_0x8b49('0xdc'),'interactionId':_0x42804a['id']};return pdf[_0x8b49('0xeb')](_0xac5839,_0x1de3ac);})[_0x8b49('0x2b')](function(){return new BPromise(function(_0x152d89,_0x29304c){zipdir(_0x2a543b,{'saveTo':_0x7a79c7},function(_0x5dc021,_0x406be1){if(_0x5dc021)return _0x29304c(_0x5dc021);return _0x152d89(_0x406be1);});})['then'](function(){return new BPromise(function(_0x3bd4c5,_0x290947){rimraf(_0x2a543b,function(_0x2ce80e){if(_0x2ce80e)_0x290947(_0x2ce80e);return _0x3bd4c5();});});})[_0x8b49('0x2b')](function(){return _0x19e2cf[_0x8b49('0xc8')](_0x7a79c7,_0x55f456,function(_0x39400a){if(_0x39400a){console['log'](_0x8b49('0xec'),_0x39400a);}else{fs[_0x8b49('0xed')](_0x7a79c7);}});});});}else{return _0x19e2cf['sendStatus'](0xc8);}})['catch'](handleError(_0x19e2cf,null));}; \ No newline at end of file +var _0xf34c=['socket.io-emitter','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','UserId','closed','unmanaged','total','index','OpenchannelInteraction','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','field','from','tools_tags','select','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','show','type','params','include','options','create','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','nolimit','pick','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','color','openchannelInteractionTags:save','removeTags','download','unix','join','files','tmp','server','attachments','User','CmContact','firstName','lastName','Messages','secret','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','closedAt','disposition','threadId','Public','Private','Attachment','basename','createReadStream','pipe','createWriteStream','direction','System','out','renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xf34c,0x1d6));var _0xcf34=function(_0x36a89b,_0x7c603d){_0x36a89b=_0x36a89b-0x0;var _0x338795=_0xf34c[_0x36a89b];return _0x338795;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcf34('0x0'));var jsonpatch=require(_0xcf34('0x1'));var rp=require(_0xcf34('0x2'));var moment=require(_0xcf34('0x3'));var BPromise=require(_0xcf34('0x4'));var Mustache=require(_0xcf34('0x5'));var util=require('util');var path=require(_0xcf34('0x6'));var sox=require(_0xcf34('0x7'));var csv=require('to-csv');var ejs=require(_0xcf34('0x8'));var fs=require('fs');var fs_extra=require(_0xcf34('0x9'));var _=require(_0xcf34('0xa'));var squel=require('squel');var crypto=require(_0xcf34('0xb'));var jsforce=require(_0xcf34('0xc'));var deskjs=require(_0xcf34('0xd'));var toCsv=require(_0xcf34('0xe'));var querystring=require('querystring');var Papa=require(_0xcf34('0xf'));var Redis=require(_0xcf34('0x10'));var authService=require(_0xcf34('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xcf34('0x12'));var logger=require(_0xcf34('0x13'))(_0xcf34('0x14'));var utils=require(_0xcf34('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcf34('0x16'));var db=require(_0xcf34('0x17'))['db'];config['redis']=_[_0xcf34('0x18')](config[_0xcf34('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xcf34('0x1a'))(new Redis(config['redis']));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x465d2e,_0x458d94){_0x458d94=_0x458d94||0xcc;return function(_0x2c2a2e){if(_0x2c2a2e){return _0x465d2e[_0xcf34('0x1b')](_0x458d94);}return _0x465d2e['status'](_0x458d94)[_0xcf34('0x1c')]();};}function respondWithResult(_0x56954d,_0x51cca1){_0x51cca1=_0x51cca1||0xc8;return function(_0x5da6c7){if(_0x5da6c7){return _0x56954d[_0xcf34('0x1d')](_0x51cca1)[_0xcf34('0x1e')](_0x5da6c7);}};}function respondWithFilteredResult(_0x45d989,_0x4b9133){return function(_0x32bf5f){if(_0x32bf5f){var _0x2aeb7d=typeof _0x4b9133[_0xcf34('0x1f')]===_0xcf34('0x20')&&typeof _0x4b9133['limit']===_0xcf34('0x20');var _0x173253=_0x32bf5f[_0xcf34('0x21')];var _0x4ca241=_0x2aeb7d?0x0:_0x4b9133[_0xcf34('0x1f')];var _0x4b7ed9=_0x2aeb7d?_0x32bf5f[_0xcf34('0x21')]:_0x4b9133[_0xcf34('0x1f')]+_0x4b9133[_0xcf34('0x22')];var _0x882439;if(_0x4b7ed9>=_0x173253){_0x4b7ed9=_0x173253;_0x882439=0xc8;}else{_0x882439=0xce;}_0x45d989[_0xcf34('0x1d')](_0x882439);return _0x45d989[_0xcf34('0x23')](_0xcf34('0x24'),_0x4ca241+'-'+_0x4b7ed9+'/'+_0x173253)[_0xcf34('0x1e')](_0x32bf5f);}return null;};}function patchUpdates(_0x2215a0){return function(_0x13e15f){try{jsonpatch[_0xcf34('0x25')](_0x13e15f,_0x2215a0,!![]);}catch(_0x3ff1b9){return BPromise[_0xcf34('0x26')](_0x3ff1b9);}return _0x13e15f['save']();};}function saveUpdates(_0x32d2da,_0x2ca25b){return function(_0x3aa12f){if(_0x3aa12f){return _0x3aa12f[_0xcf34('0x27')](_0x32d2da)[_0xcf34('0x28')](function(_0xdd402b){return _0xdd402b;});}return null;};}function removeEntity(_0x30660c,_0x3a0323){return function(_0x2c0584){if(_0x2c0584){return _0x2c0584[_0xcf34('0x29')]()[_0xcf34('0x28')](function(){_0x30660c[_0xcf34('0x1d')](0xcc)[_0xcf34('0x1c')]();});}};}function handleEntityNotFound(_0x1577b2,_0x5e289b){return function(_0x2f997d){if(!_0x2f997d){_0x1577b2['sendStatus'](0x194);}return _0x2f997d;};}function handleError(_0x13f1f4,_0x2c39b9){_0x2c39b9=_0x2c39b9||0x1f4;return function(_0x476f60){logger[_0xcf34('0x2a')](_0x476f60[_0xcf34('0x2b')]);if(_0x476f60[_0xcf34('0x2c')]){delete _0x476f60['name'];}_0x13f1f4['status'](_0x2c39b9)['send'](_0x476f60);};}function getInteractionUsers(_0x9578fd,_0x31014d){return new BPromise(function(_0x1f8300,_0x50d9b7){try{if(_0x31014d[_0x9578fd['id']]){_0x9578fd['Users']=_[_0xcf34('0x2d')](_0x31014d[_0x9578fd['id']],function(_0x10392f){return{'id':_0x10392f['id'],'fullname':_0x10392f[_0xcf34('0x2e')]};});}}catch(_0x485792){_0x50d9b7(_0x485792);}_0x1f8300(_0x9578fd);});}function getInteractionTags(_0x263563,_0x2b8d83){return new BPromise(function(_0x4b5031,_0x3ded95){try{if(_0x263563[_0xcf34('0x2f')]){_0x263563[_0xcf34('0x30')]=[];_0x263563['TagIds'][_0xcf34('0x31')](',')[_0xcf34('0x32')](function(_0x68f810){_0x263563[_0xcf34('0x30')][_0xcf34('0x33')](_0x2b8d83[_0x68f810]);});}delete _0x263563[_0xcf34('0x2f')];}catch(_0x13b441){_0x3ded95(_0x13b441);}_0x4b5031(_0x263563);});}function updateOpenchannelInteraction(_0x555dab,_0xe0a90b,_0x11bccf){return new BPromise(function(_0xb67edc,_0x3ffbda){return getInteractionUsers(_0x555dab,_0x11bccf)[_0xcf34('0x28')](function(_0x2c1b6c){return getInteractionTags(_0x2c1b6c,_0xe0a90b);})[_0xcf34('0x28')](function(_0x2a0494){return getStateInteraction(_0x2a0494);})[_0xcf34('0x28')](function(_0x4784d1){_0xb67edc(_0x4784d1);})[_0xcf34('0x34')](function(_0x3af96b){_0x3ffbda(_0x3af96b);});});}function getStateInteraction(_0xfe7968){return new BPromise(function(_0x907c94){_0xfe7968[_0xcf34('0x35')]=0x0;_0xfe7968[_0xcf34('0x36')]=0x0;_0xfe7968[_0xcf34('0x37')]=0x0;_0xfe7968['unmanaged']=0x0;_0xfe7968['total']=0x0;if(!_0xfe7968['closed']&&!_0xfe7968[_0xcf34('0x38')]){_0xfe7968['waiting']+=0x1;}if(!_0xfe7968[_0xcf34('0x39')]&&_0xfe7968['UserId']){_0xfe7968[_0xcf34('0x36')]+=0x1;if(_0xfe7968[_0xcf34('0x35')]){_0xfe7968[_0xcf34('0x35')]-=0x1;}}if(_0xfe7968['closed']&&_0xfe7968[_0xcf34('0x38')]){_0xfe7968[_0xcf34('0x37')]+=0x1;if(_0xfe7968['talking']){_0xfe7968['talking']-=0x1;}}if(_0xfe7968[_0xcf34('0x39')]&&!_0xfe7968['UserId']){_0xfe7968[_0xcf34('0x3a')]+=0x1;if(_0xfe7968[_0xcf34('0x35')]){_0xfe7968[_0xcf34('0x35')]-=0x1;}}_0xfe7968[_0xcf34('0x3b')]+=0x1;_0x907c94(_0xfe7968);});}exports[_0xcf34('0x3c')]=function(_0x138fce,_0x1677f2){var _0x31c073={},_0x150074={},_0x31720a={'count':0x0,'rows':[]};var _0x536a44=_[_0xcf34('0x2d')](db[_0xcf34('0x3d')][_0xcf34('0x3e')],function(_0x3279a4){return{'name':_0x3279a4[_0xcf34('0x3f')],'type':_0x3279a4['type'][_0xcf34('0x40')]};});_0x150074[_0xcf34('0x41')]=_['map'](_0x536a44,_0xcf34('0x2c'));_0x150074['query']=_[_0xcf34('0x42')](_0x138fce[_0xcf34('0x43')]);_0x150074[_0xcf34('0x44')]=_[_0xcf34('0x45')](_0x150074['model'],_0x150074[_0xcf34('0x43')]);_0x31c073[_0xcf34('0x46')]=_[_0xcf34('0x45')](_0x150074[_0xcf34('0x41')],qs[_0xcf34('0x47')](_0x138fce[_0xcf34('0x43')][_0xcf34('0x47')]));_0x31c073['attributes']=_0x31c073[_0xcf34('0x46')][_0xcf34('0x48')]?_0x31c073[_0xcf34('0x46')]:_0x150074[_0xcf34('0x41')];if(!_0x138fce[_0xcf34('0x43')][_0xcf34('0x49')]('nolimit')){_0x31c073[_0xcf34('0x22')]=qs[_0xcf34('0x22')](_0x138fce[_0xcf34('0x43')]['limit']);_0x31c073[_0xcf34('0x1f')]=qs['offset'](_0x138fce[_0xcf34('0x43')][_0xcf34('0x1f')]);}_0x31c073[_0xcf34('0x4a')]=qs[_0xcf34('0x4b')](_0x138fce[_0xcf34('0x43')][_0xcf34('0x4b')]);_0x31c073[_0xcf34('0x4c')]=qs[_0xcf34('0x44')](_['pick'](_0x138fce['query'],_0x150074[_0xcf34('0x44')]),_0x536a44);var _0x4aca10=[];var _0x5840db=squel['select']()[_0xcf34('0x4d')]('id')[_0xcf34('0x4d')]('name')['field']('color')[_0xcf34('0x4e')](_0xcf34('0x4f'));var _0x2469df=squel[_0xcf34('0x50')]()[_0xcf34('0x4d')]('u.id')['field'](_0xcf34('0x51'))[_0xcf34('0x4d')](_0xcf34('0x52'))[_0xcf34('0x4e')](_0xcf34('0x53'),'ui')[_0xcf34('0x54')]('users','u',_0xcf34('0x55'));var _0x304c35=squel[_0xcf34('0x50')]()['from'](_0xcf34('0x56'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xcf34('0x54')](_0xcf34('0x57'),'o',_0xcf34('0x58'))[_0xcf34('0x54')](_0xcf34('0x59'),'a',_0xcf34('0x5a'))[_0xcf34('0x54')](_0xcf34('0x5b'),'me',_0xcf34('0x5c'))[_0xcf34('0x54')](_0xcf34('0x5d'),'it',_0xcf34('0x5e'))[_0xcf34('0x54')](_0xcf34('0x4f'),'t',_0xcf34('0x5f'));var _0x4c50e8=squel[_0xcf34('0x60')]();var _0x27d4fc=[];var _0x2718dd=squel[_0xcf34('0x60')]();var _0x4364bb;if(_0x138fce[_0xcf34('0x43')][_0xcf34('0x61')]){_0x4364bb=as[_0xcf34('0x62')](_0x138fce['query'][_0xcf34('0x61')]);var _0x17951b=_0x4364bb['sqlOperator'];for(var _0x2e5833=0x0;_0x2e5833<_0x4364bb['conditions'][_0xcf34('0x48')];_0x2e5833++){var _0x21c23d=_0x4364bb[_0xcf34('0x63')][_0x2e5833];var _0x5c6447='i';var _0x1d3619=_[_0xcf34('0x64')](_0x536a44,[_0xcf34('0x2c'),_0x21c23d[_0xcf34('0x4d')]]);if(!_0x1d3619){switch(_0x21c23d[_0xcf34('0x4d')]){case _0xcf34('0x65'):if(_0x21c23d[_0xcf34('0x66')]==0x1){_0x304c35[_0xcf34('0x67')]('`'+_0x21c23d[_0xcf34('0x4d')]+_0xcf34('0x68'));}else{_0x304c35[_0xcf34('0x67')]('`'+_0x21c23d['field']+_0xcf34('0x69'));}break;case _0xcf34('0x6a'):if(_0x21c23d[_0xcf34('0x6b')]===_0xcf34('0x6c')){if(_0x21c23d['value'][_0xcf34('0x31')]('\x20')[_0xcf34('0x48')]>0x1){_0x4c50e8[_0x17951b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xcf34('0x6d')](_0x21c23d[_0xcf34('0x66')]),null);}else{var _0x1a0044='%'+_0x21c23d[_0xcf34('0x66')]+'%';_0x4c50e8[_0x17951b](_0xcf34('0x6e'),_0x1a0044,_0x1a0044,_0x1a0044);}}else{_0x1d3619=_['find'](_0x536a44,[_0xcf34('0x2c'),_0xcf34('0x6f')]);_0x21c23d[_0xcf34('0x4d')]='ContactId';_0x3d4318=as[_0xcf34('0x70')](_0x5c6447,_0x1d3619['type'],_0x21c23d);_0x4c50e8[_0x17951b](_0x3d4318[_0xcf34('0x71')],_0x3d4318[_0xcf34('0x66')][_0xcf34('0x72')],_0x3d4318[_0xcf34('0x66')][_0xcf34('0x1c')]);}break;case _0xcf34('0x73'):var _0x9d4373=_0x21c23d[_0xcf34('0x66')]['split'](',')[_0xcf34('0x2d')](function(_0x2c0834){return Number(_0x2c0834);});_0x9d4373[_0xcf34('0x32')](function(_0x298e36){_0x2718dd['or'](_0xcf34('0x74'),'%,'+_0x298e36+',%');});_0x27d4fc=_[_0xcf34('0x75')](_0x27d4fc,_0x9d4373);break;case'User':if(_0x21c23d['operator']===_0xcf34('0x6c')){_0x4c50e8[_0x17951b](_0xcf34('0x76'),'%'+_0x21c23d['value']+'%',null);}else{_0x1d3619=_['find'](_0x536a44,['name','UserId']);_0x21c23d['field']=_0xcf34('0x38');_0x3d4318=as['buildExpression'](_0x5c6447,_0x1d3619['type'],_0x21c23d);_0x4c50e8[_0x17951b](_0x3d4318[_0xcf34('0x71')],_0x3d4318[_0xcf34('0x66')][_0xcf34('0x72')],_0x3d4318[_0xcf34('0x66')][_0xcf34('0x1c')]);}break;case _0xcf34('0x77'):_0x3d4318=as[_0xcf34('0x70')]('me',null,_0x21c23d);_0x4c50e8[_0x17951b](_0x3d4318['text'],_0x3d4318[_0xcf34('0x66')]['start'],_0x3d4318[_0xcf34('0x66')]['end']);break;}}else{var _0x3d4318=as[_0xcf34('0x70')](_0x5c6447,_0x1d3619['type'],_0x21c23d);_0x4c50e8[_0x17951b](_0x3d4318[_0xcf34('0x71')],_0x3d4318[_0xcf34('0x66')][_0xcf34('0x72')],_0x3d4318[_0xcf34('0x66')][_0xcf34('0x1c')]);}}}else{var _0x414991=_(_0x138fce['query'])[_0xcf34('0x42')]()[_0xcf34('0x2d')](function(_0x34a276){return _['some'](_0x536a44,[_0xcf34('0x2c'),_0x34a276])?_0x34a276:undefined;})[_0xcf34('0x78')]()[_0xcf34('0x66')]();if(!_['isEmpty'](_0x414991)){_0x414991[_0xcf34('0x32')](function(_0x22a8e1){if(_0x22a8e1===_0xcf34('0x79')){_0x304c35[_0xcf34('0x4c')](_0xcf34('0x7a'),[][_0xcf34('0x7b')](_0x138fce['query'][_0x22a8e1]));}else if(_0x22a8e1===_0xcf34('0x7c')){var _0x88f57b=JSON['parse'](_0x138fce[_0xcf34('0x43')][_0x22a8e1])[_0xcf34('0x7d')];var _0x4d8ccb=JSON[_0xcf34('0x7e')](_0x138fce[_0xcf34('0x43')][_0x22a8e1])['$lte'];_0x304c35[_0xcf34('0x4c')](_0xcf34('0x7f'),_0x88f57b,_0x4d8ccb);}else{if(_0x138fce['query'][_0x22a8e1]===_0xcf34('0x80')){_0x304c35['where']('i.'+_0x22a8e1+_0xcf34('0x81'));}else{_0x304c35['where']('i.'+_0x22a8e1+_0xcf34('0x82'),_0x138fce['query'][_0x22a8e1]);}}});}if(_0x138fce[_0xcf34('0x43')][_0xcf34('0x83')]){if(_0x138fce[_0xcf34('0x43')][_0xcf34('0x83')]==0x1){_0x304c35[_0xcf34('0x67')](_0xcf34('0x84'));}else{_0x304c35['having']('`unreadMessages`\x20>\x200');}}if(_0x138fce[_0xcf34('0x43')][_0xcf34('0x85')]){_0x27d4fc=_[_0xcf34('0x86')](_0x138fce[_0xcf34('0x43')]['tag'])?_0x138fce[_0xcf34('0x43')][_0xcf34('0x85')]:new Array(_0x138fce[_0xcf34('0x43')][_0xcf34('0x85')]);_0x27d4fc[_0xcf34('0x32')](function(_0x3e320a){_0x2718dd['or'](_0xcf34('0x74'),'%,'+_0x3e320a+',%');});}if(_0x138fce[_0xcf34('0x43')]['filter']){var _0x40532e=_0x138fce['query'][_0xcf34('0x87')]['replace']('\x5c','\x5c\x5c')[_0xcf34('0x88')](/'/g,'\x27\x27');if(qs[_0xcf34('0x89')](_0x40532e)){_0x4c50e8['or'](_0xcf34('0x8a'),_0x40532e+'%');}else{_0x4c50e8['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xcf34('0x6d')](_0x40532e))['or']('i.from\x20LIKE\x20?',_0x40532e+'%')['or'](_0xcf34('0x8b'),_0x40532e+'%');}}}_0x304c35['where'](_0x4c50e8);_0x304c35[_0xcf34('0x8c')](_0xcf34('0x8d'));var _0x241c33={'type':db[_0xcf34('0x8e')][_0xcf34('0x8f')]['SELECT'],'raw':!![]};var _0x3386c4=_0x304c35['clone']();_0x3386c4[_0xcf34('0x4d')](_0xcf34('0x8d'));_0x3386c4[_0xcf34('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xcf34('0x65'));if(_0x31c073[_0xcf34('0x4a')]){_0x31c073[_0xcf34('0x4a')][_0xcf34('0x32')](function(_0x3cbeb6){var _0x433913=_0x3cbeb6[0x0]===_0xcf34('0x90')?_0x3cbeb6[0x0]:'i.'+_0x3cbeb6[0x0];_0x304c35[_0xcf34('0x4a')](_0x433913,_0x3cbeb6[0x1]===_0xcf34('0x91')?![]:!![]);});}if(!_[_0xcf34('0x92')](_0x27d4fc)){_0x304c35[_0xcf34('0x67')](_0x2718dd);_0x3386c4[_0xcf34('0x4c')](_0xcf34('0x93'),_0x27d4fc);}BPromise['resolve']()[_0xcf34('0x28')](function(){if(!_0x4364bb){if(_0x138fce[_0xcf34('0x43')][_0xcf34('0x79')])return;_0x3386c4[_0xcf34('0x4c')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x304c35[_0xcf34('0x4c')](_0xcf34('0x94'));return;}if(_0x138fce[_0xcf34('0x95')][_0xcf34('0x96')]!=='agent')return;return _0x138fce['user']['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xcf34('0x28')](function(_0x565856){if(_[_0xcf34('0x92')](_0x565856)){_0x3386c4[_0xcf34('0x4c')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x304c35[_0xcf34('0x4c')](_0xcf34('0x97'));}else{_0x3386c4[_0xcf34('0x4c')](_0xcf34('0x7a'),_[_0xcf34('0x2d')](_0x565856,'id'));_0x304c35[_0xcf34('0x4c')](_0xcf34('0x7a'),_['map'](_0x565856,'id'));}});})[_0xcf34('0x28')](function(){if(_0x138fce['user'][_0xcf34('0x96')]==='agent'&&!_0x4364bb&&!_0x138fce['query'][_0xcf34('0x79')])return[];return db[_0xcf34('0x98')][_0xcf34('0x43')](_0x3386c4[_0xcf34('0x99')](),_0x241c33);})[_0xcf34('0x28')](function(_0x1903d5){_0x31720a['count']=_0x1903d5['length'];if(_0x31720a['count']===0x0)return[];return db['sequelize'][_0xcf34('0x43')](_0x5840db[_0xcf34('0x99')](),_0x241c33)[_0xcf34('0x28')](function(_0x204736){_0x4aca10=_[_0xcf34('0x9a')](_0x204736,'id');_0x241c33=_[_0xcf34('0x9b')](_0x241c33,{'model':db[_0xcf34('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x138fce[_0xcf34('0x43')][_0xcf34('0x47')]){_0x31c073[_0xcf34('0x46')][_0xcf34('0x32')](function(_0x34c554){_0x304c35[_0xcf34('0x4d')]('i.'+_0x34c554);});}else{_0x304c35[_0xcf34('0x4d')](_0xcf34('0x9c'),_0xcf34('0x65'));_0x304c35[_0xcf34('0x4d')]('a.key',_0xcf34('0x9d'));_0x304c35[_0xcf34('0x4d')]('a.mandatoryDisposition',_0xcf34('0x9e'));_0x304c35['field'](_0xcf34('0x9f'),_0xcf34('0x90'));_0x304c35[_0xcf34('0x4d')](_0xcf34('0xa0'));_0x304c35[_0xcf34('0x4d')](_0xcf34('0xa1'),_0xcf34('0xa2'));_0x304c35[_0xcf34('0x4d')](_0xcf34('0xa3'),_0xcf34('0xa4'));_0x304c35[_0xcf34('0x4d')](_0xcf34('0xa5'),_0xcf34('0xa6'));_0x304c35[_0xcf34('0x4d')](_0xcf34('0xa7'),_0xcf34('0xa8'));_0x304c35[_0xcf34('0x4d')](_0xcf34('0xa9'),_0xcf34('0xaa'));_0x304c35[_0xcf34('0x4d')](_0xcf34('0xab'),_0xcf34('0xac'));_0x304c35[_0xcf34('0x4d')](_0xcf34('0xad'),_0xcf34('0xae'));_0x304c35[_0xcf34('0x4d')](_0xcf34('0xaf'),_0xcf34('0xb0'));_0x304c35[_0xcf34('0x4d')](_0xcf34('0xb1'),_0xcf34('0x2f'));}if(_0x31c073[_0xcf34('0x22')])_0x304c35[_0xcf34('0x22')](_0x31c073[_0xcf34('0x22')]);if(_0x31c073[_0xcf34('0x1f')])_0x304c35[_0xcf34('0x1f')](_0x31c073[_0xcf34('0x1f')]);return db[_0xcf34('0x98')][_0xcf34('0x43')](_0x304c35[_0xcf34('0x99')](),_0x241c33);})[_0xcf34('0x28')](function(_0x51470d){if(_0x51470d[_0xcf34('0x48')]>0x0)_0x2469df['where'](_0xcf34('0xb2'),_[_0xcf34('0x2d')](_0x51470d,'id'));return db['sequelize']['query'](_0x2469df[_0xcf34('0x99')](),_0x241c33)['then'](function(_0x33dd60){var _0x5249a7=_[_0xcf34('0xb3')](_0x33dd60,'OpenchannelInteractionId');var _0x833364=[];_0x51470d['forEach'](function(_0x28c1c8){_0x833364[_0xcf34('0x33')](updateOpenchannelInteraction(_0x28c1c8,_0x4aca10,_0x5249a7));});return BPromise[_0xcf34('0xb4')](_0x833364);});});})['then'](function(_0x484a42){_0x31720a['rows']=_0x484a42;return _0x31720a;})[_0xcf34('0x28')](respondWithFilteredResult(_0x1677f2,_0x31c073))['catch'](handleError(_0x1677f2,null));};exports[_0xcf34('0xb5')]=function(_0x38fc4a,_0x3c1d03){var _0x281ad7={};if(_0x38fc4a[_0xcf34('0x43')][_0xcf34('0xb6')]&&_0x38fc4a[_0xcf34('0x43')][_0xcf34('0xb6')]==='from'){_0x281ad7[_0xcf34('0x4e')]=_0x38fc4a[_0xcf34('0xb7')]['id'];}else{_0x281ad7['id']=_0x38fc4a[_0xcf34('0xb7')]['id'];}var _0x4b4749={'raw':![],'where':_0x281ad7},_0x57168a={};_0x57168a[_0xcf34('0x41')]=_['keys'](db[_0xcf34('0x3d')][_0xcf34('0x3e')]);_0x57168a[_0xcf34('0x43')]=_['keys'](_0x38fc4a[_0xcf34('0x43')]);_0x57168a[_0xcf34('0x44')]=_[_0xcf34('0x45')](_0x57168a[_0xcf34('0x41')],_0x57168a['query']);_0x4b4749[_0xcf34('0x46')]=_[_0xcf34('0x45')](_0x57168a[_0xcf34('0x41')],qs[_0xcf34('0x47')](_0x38fc4a[_0xcf34('0x43')][_0xcf34('0x47')]));_0x4b4749[_0xcf34('0x46')]=_0x4b4749[_0xcf34('0x46')][_0xcf34('0x48')]?_0x4b4749[_0xcf34('0x46')]:_0x57168a[_0xcf34('0x41')];if(_0x38fc4a['query']['includeAll']){_0x4b4749[_0xcf34('0xb8')]=[{'all':!![]}];}_0x4b4749=_[_0xcf34('0x9b')]({},_0x4b4749,_0x38fc4a[_0xcf34('0xb9')]);return db[_0xcf34('0x3d')][_0xcf34('0x64')](_0x4b4749)[_0xcf34('0x28')](handleEntityNotFound(_0x3c1d03,null))['then'](respondWithResult(_0x3c1d03,null))[_0xcf34('0x34')](handleError(_0x3c1d03,null));};exports[_0xcf34('0xba')]=function(_0x4b4a07,_0x126744){return db[_0xcf34('0x3d')]['create'](_0x4b4a07[_0xcf34('0x77')],{})[_0xcf34('0x28')](respondWithResult(_0x126744,0xc9))[_0xcf34('0x34')](handleError(_0x126744,null));};exports[_0xcf34('0x27')]=function(_0x5630fd,_0x47d76b){if(_0x5630fd[_0xcf34('0x77')]['id']){delete _0x5630fd['body']['id'];}return db['OpenchannelInteraction'][_0xcf34('0x64')]({'where':{'id':_0x5630fd['params']['id']}})[_0xcf34('0x28')](handleEntityNotFound(_0x47d76b,null))[_0xcf34('0x28')](saveUpdates(_0x5630fd[_0xcf34('0x77')],null))[_0xcf34('0x28')](respondWithResult(_0x47d76b,null))['catch'](handleError(_0x47d76b,null));};exports['destroy']=function(_0x51259f,_0x4a7904){return db[_0xcf34('0x3d')][_0xcf34('0x64')]({'where':{'id':_0x51259f[_0xcf34('0xb7')]['id']}})['then'](handleEntityNotFound(_0x4a7904,null))[_0xcf34('0x28')](removeEntity(_0x4a7904,null))[_0xcf34('0x34')](handleError(_0x4a7904,null));};exports[_0xcf34('0xbb')]=function(_0x3e5bdc,_0x4bcc52){return db['OpenchannelInteraction'][_0xcf34('0xbb')]()['then'](respondWithResult(_0x4bcc52,null))['catch'](handleError(_0x4bcc52,null));};exports[_0xcf34('0xbc')]=function(_0x4c36a4,_0x59c709,_0x4010a3){return db[_0xcf34('0xbd')][_0xcf34('0x64')]({'where':{'id':_0x4c36a4[_0xcf34('0xb7')]['id']}})[_0xcf34('0x28')](handleEntityNotFound(_0x59c709,null))[_0xcf34('0x28')](function(_0x219255){if(_0x219255){return _0x219255[_0xcf34('0xbc')](_0x4c36a4[_0xcf34('0x77')]['ids'],_[_0xcf34('0xbe')](_0x4c36a4[_0xcf34('0x77')],[_0xcf34('0xbf'),'id'])||{});}})[_0xcf34('0x28')](respondWithResult(_0x59c709,null))[_0xcf34('0x34')](handleError(_0x59c709,null));};exports[_0xcf34('0xc0')]=function(_0x5aa507,_0x1a6a24,_0x249a3f){var _0x3fb318={'raw':![],'where':{}};var _0x3d4c2b={};var _0x1e8db3={'count':0x0,'rows':[]};return db[_0xcf34('0x3d')][_0xcf34('0xc1')]({'where':{'id':_0x5aa507[_0xcf34('0xb7')]['id']}})[_0xcf34('0x28')](handleEntityNotFound(_0x1a6a24,null))[_0xcf34('0x28')](function(_0x2db952){if(_0x2db952){_0x3d4c2b[_0xcf34('0x41')]=_[_0xcf34('0x42')](db[_0xcf34('0xbd')][_0xcf34('0x3e')]);_0x3d4c2b[_0xcf34('0x43')]=_[_0xcf34('0x42')](_0x5aa507[_0xcf34('0x43')]);_0x3d4c2b[_0xcf34('0x44')]=_[_0xcf34('0x45')](_0x3d4c2b['model'],_0x3d4c2b[_0xcf34('0x43')]);_0x3fb318[_0xcf34('0x46')]=_[_0xcf34('0x45')](_0x3d4c2b[_0xcf34('0x41')],qs[_0xcf34('0x47')](_0x5aa507['query']['fields']));_0x3fb318[_0xcf34('0x46')]=_0x3fb318[_0xcf34('0x46')]['length']?_0x3fb318[_0xcf34('0x46')]:_0x3d4c2b[_0xcf34('0x41')];if(!_0x5aa507['query'][_0xcf34('0x49')](_0xcf34('0xc2'))){_0x3fb318[_0xcf34('0x22')]=qs[_0xcf34('0x22')](_0x5aa507[_0xcf34('0x43')][_0xcf34('0x22')]);_0x3fb318[_0xcf34('0x1f')]=qs[_0xcf34('0x1f')](_0x5aa507['query'][_0xcf34('0x1f')]);}_0x3fb318[_0xcf34('0x4a')]=qs[_0xcf34('0x4b')](_0x5aa507[_0xcf34('0x43')][_0xcf34('0x4b')]);_0x3fb318['where']=qs[_0xcf34('0x44')](_[_0xcf34('0xc3')](_0x5aa507[_0xcf34('0x43')],_0x3d4c2b[_0xcf34('0x44')]));_0x3fb318[_0xcf34('0x4c')][_0xcf34('0xc4')]=_0x2db952['id'];if(_0x5aa507[_0xcf34('0x43')][_0xcf34('0x87')]){_0x3fb318[_0xcf34('0x4c')]=_[_0xcf34('0x9b')](_0x3fb318[_0xcf34('0x4c')],{'$or':_[_0xcf34('0x2d')](_0x3fb318[_0xcf34('0x46')],function(_0x3d45d5){var _0x478123={};_0x478123[_0x3d45d5]={'$like':'%'+_0x5aa507['query'][_0xcf34('0x87')]+'%'};return _0x478123;})});}if(_0x5aa507[_0xcf34('0x43')]['$gte']){var _0x568c60=_0x5aa507[_0xcf34('0x43')][_0xcf34('0x7d')][_0xcf34('0x31')](',');var _0x51feaa={};_0x51feaa[_0x568c60[0x0]]={'$gte':moment(_0x568c60[0x1])[_0xcf34('0xc5')](_0xcf34('0xc6'))};_0x3fb318[_0xcf34('0x4c')]=_[_0xcf34('0x9b')](_0x3fb318['where'],_0x51feaa);}_0x3fb318=_[_0xcf34('0x9b')]({},_0x3fb318,_0x5aa507[_0xcf34('0xb9')]);return db[_0xcf34('0xbd')][_0xcf34('0x21')]({'where':_0x3fb318[_0xcf34('0x4c')]})['then'](function(_0x765272){_0x1e8db3[_0xcf34('0x21')]=_0x765272;if(_0x5aa507[_0xcf34('0x43')]['includeAll']){_0x3fb318[_0xcf34('0xb8')]=[{'all':!![]}];}return db[_0xcf34('0xbd')][_0xcf34('0xc7')](_0x3fb318);})['then'](function(_0x5d4e86){_0x1e8db3[_0xcf34('0xc8')]=_0x5d4e86;return _0x1e8db3;});}})[_0xcf34('0x28')](respondWithFilteredResult(_0x1a6a24,_0x3fb318))[_0xcf34('0x34')](handleError(_0x1a6a24,null));};exports[_0xcf34('0xc9')]=function(_0x49a463,_0x5200ee,_0x49c0e4){return db[_0xcf34('0x3d')][_0xcf34('0x64')]({'where':{'id':_0x49a463[_0xcf34('0xb7')]['id']}})[_0xcf34('0x28')](handleEntityNotFound(_0x5200ee,null))[_0xcf34('0x28')](function(_0x1e4045){if(_0x1e4045){return _0x1e4045[_0xcf34('0xca')](_0x49a463[_0xcf34('0x77')]['ids'],_[_0xcf34('0xbe')](_0x49a463[_0xcf34('0x77')],[_0xcf34('0xbf'),'id'])||{})[_0xcf34('0xcb')](function(){return db[_0xcf34('0x73')]['findAll']({'attributes':['id',_0xcf34('0x2c'),_0xcf34('0xcc')],'where':{'id':_0x49a463[_0xcf34('0x77')][_0xcf34('0xbf')]}});})['then'](function(_0x8ae958){socket['emit'](_0xcf34('0xcd'),{'id':Number(_0x49a463[_0xcf34('0xb7')]['id']),'tags':_0x8ae958||[]});return{'id':Number(_0x49a463[_0xcf34('0xb7')]['id']),'tags':_0x8ae958||[]};});}})[_0xcf34('0x28')](respondWithResult(_0x5200ee,null))[_0xcf34('0x34')](handleError(_0x5200ee,null));};exports[_0xcf34('0xce')]=function(_0x3c30e8,_0x4932f3,_0x5bbf00){return db['OpenchannelInteraction'][_0xcf34('0x64')]({'where':{'id':_0x3c30e8['params']['id']}})[_0xcf34('0x28')](handleEntityNotFound(_0x4932f3,null))[_0xcf34('0x28')](function(_0x32307d){if(_0x32307d){return _0x32307d[_0xcf34('0xce')](_0x3c30e8[_0xcf34('0x43')][_0xcf34('0xbf')]);}})['then'](respondWithStatusCode(_0x4932f3,null))[_0xcf34('0x34')](handleError(_0x4932f3,null));};exports[_0xcf34('0xcf')]=function(_0x522f4d,_0x5c97ad){var _0x23ed1b=moment()[_0xcf34('0xd0')]()[_0xcf34('0x99')]();var _0x290d61=path[_0xcf34('0xd1')](config['root'],'server',_0xcf34('0xd2'),_0xcf34('0xd3'));var _0x5d335a=path['join'](config['root'],_0xcf34('0xd4'),'files',_0xcf34('0xd5'));var _0x22050a=path[_0xcf34('0xd1')](_0x290d61,_0x23ed1b);var _0x4defc2=util[_0xcf34('0xc5')]('transcript-%d-%s.zip',_0x522f4d[_0xcf34('0xb7')]['id'],_0x23ed1b);var _0x49ab04=path[_0xcf34('0xd1')](_0x290d61,_0x4defc2);var _0x2056f0=[];_0x2056f0['push']({'model':db['User'],'as':_0xcf34('0xd6'),'attributes':['id',_0xcf34('0x2e')],'raw':!![]});_0x2056f0['push']({'model':db[_0xcf34('0xd7')],'as':'Contact','attributes':['id',_0xcf34('0xd8'),_0xcf34('0xd9')],'raw':!![]});if(_0x522f4d[_0xcf34('0x43')][_0xcf34('0xd5')]){_0x2056f0[_0xcf34('0x33')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x59d7a4=[{'model':db['OpenchannelMessage'],'as':_0xcf34('0xda'),'attributes':['id',_0xcf34('0x77'),_0xcf34('0x7c'),'direction',_0xcf34('0xdb'),_0xcf34('0x83')],'include':_0x2056f0}];_0x59d7a4[_0xcf34('0x33')]({'model':db[_0xcf34('0xdc')],'as':_0xcf34('0xdd'),'attributes':['id',_0xcf34('0x2c')]});_0x59d7a4['push']({'model':db[_0xcf34('0xd6')],'as':'Owner','attributes':['id',_0xcf34('0x2e')]});return db[_0xcf34('0x3d')][_0xcf34('0x64')]({'where':{'id':_0x522f4d[_0xcf34('0xb7')]['id']},'include':_0x59d7a4})['then'](handleEntityNotFound(_0x5c97ad,null))['then'](function(_0x247e00){if(_0x247e00){var _0x51b0e5=_0x247e00[_0xcf34('0xde')]({'plain':!![]});fs[_0xcf34('0xdf')](_0x22050a);var _0x5bfa89={'channel':_0xcf34('0xe0'),'account':_0x51b0e5[_0xcf34('0xdd')][_0xcf34('0x2c')],'agent':_0x51b0e5['Owner']?_0x51b0e5[_0xcf34('0xe1')][_0xcf34('0x2e')]:'N.A.','createdAt':moment(_0x51b0e5[_0xcf34('0x7c')])[_0xcf34('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')[_0xcf34('0x99')](),'closedAt':_0x51b0e5[_0xcf34('0x39')]?moment(_0x51b0e5[_0xcf34('0xe2')])['format'](_0xcf34('0xc6'))[_0xcf34('0x99')]():'','disposition':_0x51b0e5[_0xcf34('0xe3')],'visibility':_0x51b0e5[_0xcf34('0xe4')]?_0xcf34('0xe5'):_0xcf34('0xe6'),'messages':_(_0x51b0e5[_0xcf34('0xda')])[_0xcf34('0x87')]({'secret':![]})[_0xcf34('0x2d')](function(_0x2b38d0){if(_0x2b38d0[_0xcf34('0xe7')]){var _0x2e1648=path[_0xcf34('0xd1')](_0x5d335a,_0x2b38d0[_0xcf34('0xe7')][_0xcf34('0xe8')]);if(fs['existsSync'](_0x2e1648)){fs[_0xcf34('0xe9')](_0x2e1648)[_0xcf34('0xea')](fs[_0xcf34('0xeb')](path['join'](_0x22050a,_0x2b38d0[_0xcf34('0xe7')][_0xcf34('0xe8')])));}}return{'date':moment(_0x2b38d0[_0xcf34('0x7c')])[_0xcf34('0xc5')](_0xcf34('0xc6'))[_0xcf34('0x99')](),'sender':_0x2b38d0[_0xcf34('0xec')]==='out'?_0x2b38d0['User']?_0x2b38d0[_0xcf34('0xd6')][_0xcf34('0x2e')]:_0xcf34('0xed'):_0x2b38d0[_0xcf34('0x6a')][_0xcf34('0xd8')]+(_0x2b38d0[_0xcf34('0x6a')][_0xcf34('0xd9')]?'\x20'+_0x2b38d0[_0xcf34('0x6a')][_0xcf34('0xd9')]:''),'body':_0x2b38d0[_0xcf34('0xe7')]?_0x2b38d0[_0xcf34('0xe7')][_0xcf34('0xe8')]:_0x2b38d0[_0xcf34('0x77')],'direction':_0x2b38d0[_0xcf34('0xec')]===_0xcf34('0xee')?'A':'C','secret':_0x2b38d0[_0xcf34('0xdb')],'read':_0x2b38d0[_0xcf34('0x83')],'attachment':_0x2b38d0[_0xcf34('0xe7')]};})[_0xcf34('0x66')]()};return ejs[_0xcf34('0xef')](path[_0xcf34('0xd1')](config[_0xcf34('0xf0')],_0xcf34('0xd4'),_0xcf34('0xf1'),_0xcf34('0xf2')),{'interaction':_0x5bfa89})['then'](function(_0x350434){var _0x23b801=path[_0xcf34('0xd1')](_0x22050a,_0xcf34('0xf3')+_0x51b0e5['id']+'-'+_0x23ed1b+_0xcf34('0xf4'));var _0x43da82={'path':_0x23b801,'channel':_0xcf34('0xe0'),'interactionId':_0x51b0e5['id']};return pdf[_0xcf34('0xf5')](_0x350434,_0x43da82);})[_0xcf34('0x28')](function(){return new BPromise(function(_0xf1a7d4,_0x264b3c){zipdir(_0x22050a,{'saveTo':_0x49ab04},function(_0x26d2a5,_0x3a69c9){if(_0x26d2a5)return _0x264b3c(_0x26d2a5);return _0xf1a7d4(_0x3a69c9);});})['then'](function(){return new BPromise(function(_0xbfec5c,_0xeeaf60){rimraf(_0x22050a,function(_0x590f90){if(_0x590f90)_0xeeaf60(_0x590f90);return _0xbfec5c();});});})[_0xcf34('0x28')](function(){return _0x5c97ad[_0xcf34('0xcf')](_0x49ab04,_0x4defc2,function(_0x255c9c){if(_0x255c9c){console[_0xcf34('0xf6')](_0xcf34('0xf7'),_0x255c9c);}else{fs['unlinkSync'](_0x49ab04);}});});});}else{return _0x5c97ad[_0xcf34('0x1b')](0xc8);}})['catch'](handleError(_0x5c97ad,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 94ba578..f1e49d4 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 _0xb173=['exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0xb173,0x1e4));var _0x3b17=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xb173[_0x1fc122];return _0xa2cb13;};'use strict';var EventEmitter=require(_0x3b17('0x0'));var OpenchannelInteraction=require(_0x3b17('0x1'))['db'][_0x3b17('0x2')];var OpenchannelMessage=require(_0x3b17('0x1'))['db'][_0x3b17('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3b17('0x4')](0x0);var events={'afterCreate':_0x3b17('0x5'),'afterUpdate':_0x3b17('0x6'),'afterDestroy':_0x3b17('0x7')};function emitEvent(_0x5f0e84){return function(_0x5b5041,_0x4db9fd,_0x593343){_0x5b5041[_0x3b17('0x8')]({'attributes':['id'],'raw':!![]})[_0x3b17('0x9')](function(_0x4a462a){_0x5b5041[_0x3b17('0xa')](_0x3b17('0xb'),_0x4a462a[_0x3b17('0xc')](function(_0x5a27c3){return{'id':_0x5a27c3['id']};}));return OpenchannelMessage[_0x3b17('0xd')]({'where':{'OpenchannelInteractionId':_0x5b5041['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xe9d4b0){_0x5b5041[_0x3b17('0xa')](_0x3b17('0xe'),_0xe9d4b0[_0x3b17('0xf')]);OpenchannelInteractionEvents[_0x3b17('0x10')](_0x5f0e84+':'+_0x5b5041['id'],_0x5b5041);OpenchannelInteractionEvents[_0x3b17('0x10')](_0x5f0e84,_0x5b5041);_0x593343(null);})[_0x3b17('0x11')](_0x593343(null));};}for(var e in events){if(events[_0x3b17('0x12')](e)){var event=events[e];OpenchannelInteraction[_0x3b17('0x13')](e,emitEvent(event));}}module[_0x3b17('0x14')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x6c54=['../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','then','unreadMessages','emit','catch','hook','exports','events'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x6c54,0x98));var _0x46c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6c54[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x46c5('0x0'));var OpenchannelInteraction=require(_0x46c5('0x1'))['db'][_0x46c5('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x46c5('0x3')](0x0);var events={'afterCreate':_0x46c5('0x4'),'afterUpdate':_0x46c5('0x5'),'afterDestroy':_0x46c5('0x6')};function emitEvent(_0x5ac272){return function(_0x40a716,_0x345649,_0x54712e){_0x40a716[_0x46c5('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x59d5dc){_0x40a716[_0x46c5('0x8')](_0x46c5('0x9'),_0x59d5dc[_0x46c5('0xa')](function(_0x2beef){return{'id':_0x2beef['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x40a716['id'],'direction':'in','read':![]},'raw':!![]});})[_0x46c5('0xb')](function(_0x343df8){_0x40a716[_0x46c5('0x8')](_0x46c5('0xc'),_0x343df8['length']);OpenchannelInteractionEvents[_0x46c5('0xd')](_0x5ac272+':'+_0x40a716['id'],_0x40a716);OpenchannelInteractionEvents[_0x46c5('0xd')](_0x5ac272,_0x40a716);_0x54712e(null);})[_0x46c5('0xe')](_0x54712e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x46c5('0xf')](e,emitEvent(event));}}module[_0x46c5('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 9eb22d1..5220fc4 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 _0xe5e3=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','bluebird','path','rimraf','./openchannelInteraction.attributes','exports','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed'];(function(_0x40632e,_0x1f7f8f){var _0x3708c4=function(_0x3fd2d1){while(--_0x3fd2d1){_0x40632e['push'](_0x40632e['shift']());}};_0x3708c4(++_0x1f7f8f);}(_0xe5e3,0x17a));var _0x3e5e=function(_0x27ad47,_0x3a1853){_0x27ad47=_0x27ad47-0x0;var _0x11767d=_0xe5e3[_0x27ad47];return _0x11767d;};'use strict';var _=require('lodash');var util=require(_0x3e5e('0x0'));var logger=require(_0x3e5e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3e5e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e5e('0x3'));var rimraf=require(_0x3e5e('0x4'));var config=require('../../config/environment');var attributes=require(_0x3e5e('0x5'));module[_0x3e5e('0x6')]=function(_0x528e5e,_0x3d3ad3){return _0x528e5e['define'](_0x3e5e('0x7'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3e5e('0x8'),'collate':_0x3e5e('0x9'),'hooks':{'beforeUpdate':function(_0xffeba4,_0x460337,_0x2d6513){if(_0xffeba4[_0x3e5e('0xa')](_0x3e5e('0xb'))){_0xffeba4[_0x3e5e('0xc')]=moment()[_0x3e5e('0xd')](_0x3e5e('0xe'));}_0x2d6513(null,_0xffeba4);}}});}; \ No newline at end of file +var _0x1806=['utf8mb4_unicode_ci','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','request-promise','rimraf','./openchannelInteraction.attributes','exports','define','utf8mb4'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0x1806,0x162));var _0x6180=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x1806[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x6180('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6180('0x1'));var moment=require(_0x6180('0x2'));var BPromise=require(_0x6180('0x3'));var rp=require(_0x6180('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6180('0x5'));var config=require('../../config/environment');var attributes=require(_0x6180('0x6'));module[_0x6180('0x7')]=function(_0x3fde2a,_0x58f8b3){return _0x3fde2a[_0x6180('0x8')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6180('0x9'),'collate':_0x6180('0xa'),'hooks':{'beforeUpdate':function(_0x474cb7,_0xd9af20,_0xc6c6d5){if(_0x474cb7['changed'](_0x6180('0xb'))){_0x474cb7['closedAt']=moment()[_0x6180('0xc')](_0x6180('0xd'));}_0xc6c6d5(null,_0x474cb7);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 5dc564c..e805aa6 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 _0x262b=['message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','where','attributes','catch','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','body','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x297aa6,_0x2f8f03){var _0x45f0ba=function(_0x239fc3){while(--_0x239fc3){_0x297aa6['push'](_0x297aa6['shift']());}};_0x45f0ba(++_0x2f8f03);}(_0x262b,0x1c8));var _0xb262=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x262b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb262('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb262('0x1'));var rs=require(_0xb262('0x2'));var fs=require('fs');var Redis=require(_0xb262('0x3'));var db=require(_0xb262('0x4'))['db'];var utils=require(_0xb262('0x5'));var logger=require(_0xb262('0x6'))('rpc');var config=require(_0xb262('0x7'));var jayson=require(_0xb262('0x8'));var client=jayson[_0xb262('0x9')][_0xb262('0xa')]({'port':0x232a});config[_0xb262('0xb')]=_['defaults'](config[_0xb262('0xb')],{'host':_0xb262('0xc'),'port':0x18eb});var socket=require(_0xb262('0xd'))(new Redis(config[_0xb262('0xb')]));require(_0xb262('0xe'))['register'](socket);function respondWithRpcPromise(_0x2610e3,_0x23effd,_0x574d4a){return new BPromise(function(_0x34a6d2,_0x17e291){return client['request'](_0x2610e3,_0x574d4a)[_0xb262('0xf')](function(_0x1e7181){logger[_0xb262('0x10')](_0xb262('0x11'),_0x23effd,_0xb262('0x12'));logger[_0xb262('0x13')](_0xb262('0x14'),_0x23effd,'request\x20sent',JSON[_0xb262('0x15')](_0x1e7181));if(_0x1e7181[_0xb262('0x16')]){if(_0x1e7181['error'][_0xb262('0x17')]===0x1f4){logger[_0xb262('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x23effd,_0x1e7181[_0xb262('0x16')][_0xb262('0x18')]);return _0x17e291(_0x1e7181[_0xb262('0x16')][_0xb262('0x18')]);}logger['error'](_0xb262('0x11'),_0x23effd,_0x1e7181[_0xb262('0x16')][_0xb262('0x18')]);return _0x34a6d2(_0x1e7181['error']['message']);}else{logger[_0xb262('0x10')](_0xb262('0x11'),_0x23effd,_0xb262('0x12'));_0x34a6d2(_0x1e7181[_0xb262('0x19')][_0xb262('0x18')]);}})['catch'](function(_0x25906e){logger['error'](_0xb262('0x11'),_0x23effd,_0x25906e);_0x17e291(_0x25906e);});});}exports[_0xb262('0x1a')]=function(_0xc6e4d2){var _0x2260be=this;return new Promise(function(_0x4d6af8,_0x15c516){return db[_0xb262('0x1b')][_0xb262('0x1c')](_0xc6e4d2['body'],{'raw':_0xc6e4d2[_0xb262('0x1d')]?_0xc6e4d2[_0xb262('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc6e4d2[_0xb262('0x1d')]?_0xc6e4d2[_0xb262('0x1d')][_0xb262('0x1e')]||null:null,'attributes':_0xc6e4d2[_0xb262('0x1d')]?_0xc6e4d2['options'][_0xb262('0x1f')]||null:null,'limit':_0xc6e4d2[_0xb262('0x1d')]?_0xc6e4d2[_0xb262('0x1d')]['limit']||null:null})[_0xb262('0xf')](function(_0x495044){logger['info'](_0xb262('0x1a'),_0xc6e4d2);logger[_0xb262('0x13')](_0xb262('0x1a'),_0xc6e4d2,JSON[_0xb262('0x15')](_0x495044));_0x4d6af8(_0x495044);})[_0xb262('0x20')](function(_0x1d08c8){logger['error'](_0xb262('0x1a'),_0x1d08c8[_0xb262('0x18')],_0xc6e4d2);_0x15c516(_0x2260be[_0xb262('0x16')](0x1f4,_0x1d08c8[_0xb262('0x18')]));});});};exports[_0xb262('0x21')]=function(_0x39aee2){return new Promise(function(_0x252797,_0x1ecc41){return db[_0xb262('0x1b')][_0xb262('0x22')]({'where':_0x39aee2[_0xb262('0x1d')]?_0x39aee2[_0xb262('0x1d')][_0xb262('0x1e')]||null:null})[_0xb262('0xf')](function(_0x5a4a4b){if(_0x5a4a4b){return _0x5a4a4b[_0xb262('0x23')](_0x39aee2['body'][_0xb262('0x24')],_[_0xb262('0x25')](_0x39aee2[_0xb262('0x26')],[_0xb262('0x24'),'id'])||{});}})['spread'](function(_0x526e48){logger['info'](_0xb262('0x27'),_0x39aee2);logger[_0xb262('0x13')](_0xb262('0x27'),_0x39aee2,JSON['stringify'](_0x526e48));_0x252797(_0x526e48);})[_0xb262('0x20')](function(_0x475ed6){logger[_0xb262('0x16')](_0xb262('0x27'),_0x475ed6[_0xb262('0x18')],_0x39aee2);_0x1ecc41(_this['error'](0x1f4,_0x475ed6['message']));});});}; \ No newline at end of file +var _0xf2b3=['request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','OpenchannelInteraction','update','body','options','raw','where','limit','UpdateOpenchannelInteraction','stringify','catch','find','addTags','ids','spread','AddTags','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','OpenchannelInteraction,\x20%s,\x20%s'];(function(_0x4c71c5,_0x59ece5){var _0x2eecc4=function(_0x2e915d){while(--_0x2e915d){_0x4c71c5['push'](_0x4c71c5['shift']());}};_0x2eecc4(++_0x59ece5);}(_0xf2b3,0x67));var _0x3f2b=function(_0x5a0788,_0x3d5046){_0x5a0788=_0x5a0788-0x0;var _0x51f502=_0xf2b3[_0x5a0788];return _0x51f502;};'use strict';var _=require(_0x3f2b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3f2b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f2b('0x2'))['db'];var utils=require(_0x3f2b('0x3'));var logger=require(_0x3f2b('0x4'))(_0x3f2b('0x5'));var config=require(_0x3f2b('0x6'));var jayson=require(_0x3f2b('0x7'));var client=jayson[_0x3f2b('0x8')][_0x3f2b('0x9')]({'port':0x232a});config[_0x3f2b('0xa')]=_['defaults'](config[_0x3f2b('0xa')],{'host':_0x3f2b('0xb'),'port':0x18eb});var socket=require(_0x3f2b('0xc'))(new Redis(config[_0x3f2b('0xa')]));require(_0x3f2b('0xd'))[_0x3f2b('0xe')](socket);function respondWithRpcPromise(_0x155958,_0x438090,_0x550020){return new BPromise(function(_0x101a31,_0x33ebc1){return client['request'](_0x155958,_0x550020)[_0x3f2b('0xf')](function(_0x201864){logger['info'](_0x3f2b('0x10'),_0x438090,_0x3f2b('0x11'));logger[_0x3f2b('0x12')](_0x3f2b('0x13'),_0x438090,'request\x20sent',JSON['stringify'](_0x201864));if(_0x201864[_0x3f2b('0x14')]){if(_0x201864[_0x3f2b('0x14')][_0x3f2b('0x15')]===0x1f4){logger[_0x3f2b('0x14')](_0x3f2b('0x10'),_0x438090,_0x201864[_0x3f2b('0x14')][_0x3f2b('0x16')]);return _0x33ebc1(_0x201864[_0x3f2b('0x14')][_0x3f2b('0x16')]);}logger[_0x3f2b('0x14')](_0x3f2b('0x10'),_0x438090,_0x201864[_0x3f2b('0x14')][_0x3f2b('0x16')]);return _0x101a31(_0x201864[_0x3f2b('0x14')]['message']);}else{logger[_0x3f2b('0x17')](_0x3f2b('0x10'),_0x438090,_0x3f2b('0x11'));_0x101a31(_0x201864[_0x3f2b('0x18')][_0x3f2b('0x16')]);}})['catch'](function(_0x122afb){logger['error'](_0x3f2b('0x10'),_0x438090,_0x122afb);_0x33ebc1(_0x122afb);});});}exports['UpdateOpenchannelInteraction']=function(_0x459268){var _0x547c89=this;return new Promise(function(_0x112f2a,_0x4fa397){return db[_0x3f2b('0x19')][_0x3f2b('0x1a')](_0x459268[_0x3f2b('0x1b')],{'raw':_0x459268[_0x3f2b('0x1c')]?_0x459268['options'][_0x3f2b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459268['options']?_0x459268[_0x3f2b('0x1c')][_0x3f2b('0x1e')]||null:null,'attributes':_0x459268[_0x3f2b('0x1c')]?_0x459268['options']['attributes']||null:null,'limit':_0x459268[_0x3f2b('0x1c')]?_0x459268[_0x3f2b('0x1c')][_0x3f2b('0x1f')]||null:null})[_0x3f2b('0xf')](function(_0x514d73){logger[_0x3f2b('0x17')](_0x3f2b('0x20'),_0x459268);logger[_0x3f2b('0x12')]('UpdateOpenchannelInteraction',_0x459268,JSON[_0x3f2b('0x21')](_0x514d73));_0x112f2a(_0x514d73);})[_0x3f2b('0x22')](function(_0x5cdace){logger[_0x3f2b('0x14')]('UpdateOpenchannelInteraction',_0x5cdace[_0x3f2b('0x16')],_0x459268);_0x4fa397(_0x547c89[_0x3f2b('0x14')](0x1f4,_0x5cdace[_0x3f2b('0x16')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x564932){return new Promise(function(_0x1fef00,_0x3230e8){return db[_0x3f2b('0x19')][_0x3f2b('0x23')]({'where':_0x564932[_0x3f2b('0x1c')]?_0x564932[_0x3f2b('0x1c')][_0x3f2b('0x1e')]||null:null})[_0x3f2b('0xf')](function(_0x3c502f){if(_0x3c502f){return _0x3c502f[_0x3f2b('0x24')](_0x564932[_0x3f2b('0x1b')][_0x3f2b('0x25')],_['omit'](_0x564932[_0x3f2b('0x1b')],[_0x3f2b('0x25'),'id'])||{});}})[_0x3f2b('0x26')](function(_0x348182){logger['info'](_0x3f2b('0x27'),_0x564932);logger[_0x3f2b('0x12')](_0x3f2b('0x27'),_0x564932,JSON[_0x3f2b('0x21')](_0x348182));_0x1fef00(_0x348182);})[_0x3f2b('0x22')](function(_0x86dcbb){logger[_0x3f2b('0x14')](_0x3f2b('0x27'),_0x86dcbb[_0x3f2b('0x16')],_0x564932);_0x3230e8(_this['error'](0x1f4,_0x86dcbb['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index ffef509..70e3089 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 _0x56cb=['register','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x56cb,0x85));var _0xb56c=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0x56cb[_0x280ae7];return _0x418b9e;};'use strict';var OpenchannelInteractionEvents=require(_0xb56c('0x0'));var events=[_0xb56c('0x1'),_0xb56c('0x2'),_0xb56c('0x3')];function createListener(_0x36e6cc,_0x5cfa72){return function(_0x1c35aa){_0x5cfa72[_0xb56c('0x4')](_0x36e6cc,_0x1c35aa);};}function removeListener(_0x146360,_0x59d1be){return function(){OpenchannelInteractionEvents['removeListener'](_0x146360,_0x59d1be);};}exports[_0xb56c('0x5')]=function(_0x1a3e46){for(var _0xd02f6=0x0,_0xbb01a2=events['length'];_0xd02f6<_0xbb01a2;_0xd02f6++){var _0x5477e4=events[_0xd02f6];var _0x155bcc=createListener('openchannelInteraction:'+_0x5477e4,_0x1a3e46);OpenchannelInteractionEvents['on'](_0x5477e4,_0x155bcc);}}; \ No newline at end of file +var _0x606d=['./openchannelInteraction.events','save','remove','emit','removeListener','length'];(function(_0xba6447,_0x458f89){var _0x11e3ba=function(_0x4fe040){while(--_0x4fe040){_0xba6447['push'](_0xba6447['shift']());}};_0x11e3ba(++_0x458f89);}(_0x606d,0x198));var _0xd606=function(_0x2e44e2,_0x5b3373){_0x2e44e2=_0x2e44e2-0x0;var _0x3f82d4=_0x606d[_0x2e44e2];return _0x3f82d4;};'use strict';var OpenchannelInteractionEvents=require(_0xd606('0x0'));var events=[_0xd606('0x1'),_0xd606('0x2'),'update'];function createListener(_0x1edcad,_0x4b74c0){return function(_0x3b160c){_0x4b74c0[_0xd606('0x3')](_0x1edcad,_0x3b160c);};}function removeListener(_0x4f53ff,_0x41d51a){return function(){OpenchannelInteractionEvents[_0xd606('0x4')](_0x4f53ff,_0x41d51a);};}exports['register']=function(_0x504443){for(var _0x582600=0x0,_0x350001=events[_0xd606('0x5')];_0x582600<_0x350001;_0x582600++){var _0x3dbc16=events[_0x582600];var _0x566ff7=createListener('openchannelInteraction:'+_0x3dbc16,_0x504443);OpenchannelInteractionEvents['on'](_0x3dbc16,_0x566ff7);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index ef32f3b..c94e664 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x439953,_0x35b1a9){_0x439953=_0x439953-0x0;var _0x43c9e8=_0x70e0[_0x439953];return _0x43c9e8;};'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');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index a72295a..fd7ff2d 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 _0xefe2=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0xefe2,0xd9));var _0x2efe=function(_0x431e26,_0x24b8d1){_0x431e26=_0x431e26-0x0;var _0x543da0=_0xefe2[_0x431e26];return _0x543da0;};'use strict';var Sequelize=require(_0x2efe('0x0'));module[_0x2efe('0x1')]={'body':{'type':Sequelize['TEXT'](_0x2efe('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2efe('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2efe('0x4')]('in','out'),'defaultValue':_0x2efe('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2efe('0x6')]},'providerName':{'type':Sequelize[_0x2efe('0x7')]},'providerResponse':{'type':Sequelize[_0x2efe('0x8')]}}; \ No newline at end of file +var _0xbe9d=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x27d7e8,_0x297a26){var _0x3433c3=function(_0x58f51d){while(--_0x58f51d){_0x27d7e8['push'](_0x27d7e8['shift']());}};_0x3433c3(++_0x297a26);}(_0xbe9d,0x99));var _0xdbe9=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xbe9d[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0xdbe9('0x0'));module[_0xdbe9('0x1')]={'body':{'type':Sequelize[_0xdbe9('0x2')](_0xdbe9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdbe9('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xdbe9('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdbe9('0x5')]('in',_0xdbe9('0x6')),'defaultValue':_0xdbe9('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xdbe9('0x7')]},'providerName':{'type':Sequelize[_0xdbe9('0x8')]},'providerResponse':{'type':Sequelize[_0xdbe9('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index c4c7bd9..443f384 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 _0x27fa=['model','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','include','show','params','length','includeAll','find','create','update','body','destroy','describe','openchannel-interactions','accept','openchannel','read','format','UserId','agent','get','OpenchannelInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteractionId','role','null','rejectMessage','sequelize','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','request','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelMessage,\x20%s,\x20%s','info','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','end','stack','name','send','index','map','OpenchannelMessage','rawAttributes','key','query','keys','attributes','intersection'];(function(_0x137d5a,_0x2f4c51){var _0x1287a7=function(_0x4dda16){while(--_0x4dda16){_0x137d5a['push'](_0x137d5a['shift']());}};_0x1287a7(++_0x2f4c51);}(_0x27fa,0x1c3));var _0xa27f=function(_0x1e979b,_0x258668){_0x1e979b=_0x1e979b-0x0;var _0x5d4ad6=_0x27fa[_0x1e979b];return _0x5d4ad6;};'use strict';var emlformat=require(_0xa27f('0x0'));var rimraf=require(_0xa27f('0x1'));var zipdir=require(_0xa27f('0x2'));var jsonpatch=require(_0xa27f('0x3'));var rp=require(_0xa27f('0x4'));var moment=require(_0xa27f('0x5'));var BPromise=require(_0xa27f('0x6'));var Mustache=require('mustache');var util=require(_0xa27f('0x7'));var path=require(_0xa27f('0x8'));var sox=require(_0xa27f('0x9'));var csv=require(_0xa27f('0xa'));var ejs=require(_0xa27f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa27f('0xc'));var squel=require(_0xa27f('0xd'));var crypto=require(_0xa27f('0xe'));var jsforce=require(_0xa27f('0xf'));var deskjs=require(_0xa27f('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa27f('0x11'));var Papa=require(_0xa27f('0x12'));var Redis=require(_0xa27f('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa27f('0x14'));var as=require(_0xa27f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa27f('0x16'))('api');var utils=require(_0xa27f('0x17'));var config=require(_0xa27f('0x18'));var licenseUtil=require(_0xa27f('0x19'));var db=require('../../mysqldb')['db'];config[_0xa27f('0x1a')]=_[_0xa27f('0x1b')](config[_0xa27f('0x1a')],{'host':_0xa27f('0x1c'),'port':0x18eb});var socket=require(_0xa27f('0x1d'))(new Redis(config[_0xa27f('0x1a')]));require('./openchannelMessage.socket')[_0xa27f('0x1e')](socket);var jayson=require(_0xa27f('0x1f'));var client=jayson[_0xa27f('0x20')]['http']({'port':0x232c});var client9002=jayson[_0xa27f('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56df4c,_0x201310,_0x4603eb,_0x543e6e){return new BPromise(function(_0x4bdc77,_0x1d096b){var _0x35e129=_0x543e6e||client;return _0x35e129[_0xa27f('0x21')](_0x56df4c,_0x4603eb)['then'](function(_0x9d1751){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x201310,'request\x20sent');logger['debug'](_0xa27f('0x22'),_0x201310,_0xa27f('0x23'),JSON[_0xa27f('0x24')](_0x9d1751));if(_0x9d1751[_0xa27f('0x25')]){if(_0x9d1751[_0xa27f('0x25')][_0xa27f('0x26')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x201310,_0x9d1751[_0xa27f('0x25')][_0xa27f('0x27')]);return _0x1d096b(_0x9d1751[_0xa27f('0x25')][_0xa27f('0x27')]);}logger[_0xa27f('0x25')](_0xa27f('0x28'),_0x201310,_0x9d1751[_0xa27f('0x25')][_0xa27f('0x27')]);return _0x4bdc77(_0x9d1751[_0xa27f('0x25')][_0xa27f('0x27')]);}else{logger[_0xa27f('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x201310,_0xa27f('0x23'));_0x4bdc77(_0x9d1751[_0xa27f('0x2a')][_0xa27f('0x27')]);}})[_0xa27f('0x2b')](function(_0x24537c){logger['error'](_0xa27f('0x28'),_0x201310,_0x24537c);_0x1d096b(_0x24537c);});});}function respondWithStatusCode(_0x484c1d,_0x45f4d8){_0x45f4d8=_0x45f4d8||0xcc;return function(_0x8e8ae8){if(_0x8e8ae8){return _0x484c1d[_0xa27f('0x2c')](_0x45f4d8);}return _0x484c1d[_0xa27f('0x2d')](_0x45f4d8)['end']();};}function respondWithResult(_0x556acd,_0x21536a){_0x21536a=_0x21536a||0xc8;return function(_0x124828){if(_0x124828){return _0x556acd[_0xa27f('0x2d')](_0x21536a)[_0xa27f('0x2e')](_0x124828);}};}function respondWithFilteredResult(_0x4e4464,_0x41d28a){return function(_0x4e513e){if(_0x4e513e){var _0x532360=typeof _0x41d28a['offset']===_0xa27f('0x2f')&&typeof _0x41d28a[_0xa27f('0x30')]==='undefined';var _0x4d4f0d=_0x4e513e[_0xa27f('0x31')];var _0x3be2b4=_0x532360?0x0:_0x41d28a['offset'];var _0x57507f=_0x532360?_0x4e513e[_0xa27f('0x31')]:_0x41d28a[_0xa27f('0x32')]+_0x41d28a[_0xa27f('0x30')];var _0x5d3f86;if(_0x57507f>=_0x4d4f0d){_0x57507f=_0x4d4f0d;_0x5d3f86=0xc8;}else{_0x5d3f86=0xce;}_0x4e4464[_0xa27f('0x2d')](_0x5d3f86);return _0x4e4464[_0xa27f('0x33')](_0xa27f('0x34'),_0x3be2b4+'-'+_0x57507f+'/'+_0x4d4f0d)[_0xa27f('0x2e')](_0x4e513e);}return null;};}function patchUpdates(_0x6028fc){return function(_0x15682b){try{jsonpatch['apply'](_0x15682b,_0x6028fc,!![]);}catch(_0x1f22d5){return BPromise[_0xa27f('0x35')](_0x1f22d5);}return _0x15682b[_0xa27f('0x36')]();};}function saveUpdates(_0x16a6b5,_0xa07513){return function(_0x105bf6){if(_0x105bf6){return _0x105bf6['update'](_0x16a6b5)['then'](function(_0x101fa4){return _0x101fa4;});}return null;};}function removeEntity(_0xbb415,_0x2fc287){return function(_0x2525cc){if(_0x2525cc){return _0x2525cc['destroy']()[_0xa27f('0x37')](function(){_0xbb415[_0xa27f('0x2d')](0xcc)[_0xa27f('0x38')]();});}};}function handleEntityNotFound(_0x48e1cf,_0x50434c){return function(_0x5ec435){if(!_0x5ec435){_0x48e1cf['sendStatus'](0x194);}return _0x5ec435;};}function handleError(_0x15289b,_0x5b5054){_0x5b5054=_0x5b5054||0x1f4;return function(_0x1ee0fc){logger['error'](_0x1ee0fc[_0xa27f('0x39')]);if(_0x1ee0fc[_0xa27f('0x3a')]){delete _0x1ee0fc[_0xa27f('0x3a')];}_0x15289b[_0xa27f('0x2d')](_0x5b5054)[_0xa27f('0x3b')](_0x1ee0fc);};}exports[_0xa27f('0x3c')]=function(_0x176aec,_0x16e8cb){var _0x4ce2c7={},_0x313eeb={},_0xf2794b={'count':0x0,'rows':[]};var _0x3099e6=_[_0xa27f('0x3d')](db[_0xa27f('0x3e')][_0xa27f('0x3f')],function(_0x27a152){return{'name':_0x27a152['fieldName'],'type':_0x27a152['type'][_0xa27f('0x40')]};});_0x313eeb['model']=_[_0xa27f('0x3d')](_0x3099e6,_0xa27f('0x3a'));_0x313eeb[_0xa27f('0x41')]=_[_0xa27f('0x42')](_0x176aec[_0xa27f('0x41')]);_0x313eeb['filters']=_['intersection'](_0x313eeb['model'],_0x313eeb[_0xa27f('0x41')]);_0x4ce2c7[_0xa27f('0x43')]=_[_0xa27f('0x44')](_0x313eeb[_0xa27f('0x45')],qs[_0xa27f('0x46')](_0x176aec[_0xa27f('0x41')][_0xa27f('0x46')]));_0x4ce2c7[_0xa27f('0x43')]=_0x4ce2c7['attributes']['length']?_0x4ce2c7[_0xa27f('0x43')]:_0x313eeb[_0xa27f('0x45')];if(!_0x176aec['query'][_0xa27f('0x47')](_0xa27f('0x48'))){_0x4ce2c7[_0xa27f('0x30')]=qs['limit'](_0x176aec[_0xa27f('0x41')][_0xa27f('0x30')]);_0x4ce2c7['offset']=qs[_0xa27f('0x32')](_0x176aec[_0xa27f('0x41')][_0xa27f('0x32')]);}_0x4ce2c7[_0xa27f('0x49')]=qs['sort'](_0x176aec[_0xa27f('0x41')][_0xa27f('0x4a')]);_0x4ce2c7[_0xa27f('0x4b')]=qs['filters'](_['pick'](_0x176aec[_0xa27f('0x41')],_0x313eeb[_0xa27f('0x4c')]),_0x3099e6);if(_0x176aec[_0xa27f('0x41')][_0xa27f('0x4d')]){_0x4ce2c7[_0xa27f('0x4b')]=_['merge'](_0x4ce2c7[_0xa27f('0x4b')],{'$or':_[_0xa27f('0x3d')](_0x3099e6,function(_0x3b5617){if(_0x3b5617['type']!=='VIRTUAL'){var _0x300773={};_0x300773[_0x3b5617[_0xa27f('0x3a')]]={'$like':'%'+_0x176aec['query'][_0xa27f('0x4d')]+'%'};return _0x300773;}})});}_0x4ce2c7=_[_0xa27f('0x4e')]({},_0x4ce2c7,_0x176aec[_0xa27f('0x4f')]);var _0x3394bb={'where':_0x4ce2c7[_0xa27f('0x4b')]};return db[_0xa27f('0x3e')][_0xa27f('0x31')](_0x3394bb)[_0xa27f('0x37')](function(_0x34a676){_0xf2794b[_0xa27f('0x31')]=_0x34a676;if(_0x176aec[_0xa27f('0x41')]['includeAll']){_0x4ce2c7[_0xa27f('0x50')]=[{'all':!![]}];}return db[_0xa27f('0x3e')]['findAll'](_0x4ce2c7);})[_0xa27f('0x37')](function(_0x3f9b2b){_0xf2794b['rows']=_0x3f9b2b;return _0xf2794b;})[_0xa27f('0x37')](respondWithFilteredResult(_0x16e8cb,_0x4ce2c7))[_0xa27f('0x2b')](handleError(_0x16e8cb,null));};exports[_0xa27f('0x51')]=function(_0x5ac2de,_0x341d92){var _0x4ea6cf={'raw':!![],'where':{'id':_0x5ac2de[_0xa27f('0x52')]['id']}},_0x5a9274={};_0x5a9274['model']=_[_0xa27f('0x42')](db[_0xa27f('0x3e')][_0xa27f('0x3f')]);_0x5a9274[_0xa27f('0x41')]=_[_0xa27f('0x42')](_0x5ac2de[_0xa27f('0x41')]);_0x5a9274[_0xa27f('0x4c')]=_[_0xa27f('0x44')](_0x5a9274[_0xa27f('0x45')],_0x5a9274[_0xa27f('0x41')]);_0x4ea6cf[_0xa27f('0x43')]=_['intersection'](_0x5a9274[_0xa27f('0x45')],qs[_0xa27f('0x46')](_0x5ac2de[_0xa27f('0x41')][_0xa27f('0x46')]));_0x4ea6cf[_0xa27f('0x43')]=_0x4ea6cf[_0xa27f('0x43')][_0xa27f('0x53')]?_0x4ea6cf[_0xa27f('0x43')]:_0x5a9274[_0xa27f('0x45')];if(_0x5ac2de[_0xa27f('0x41')][_0xa27f('0x54')]){_0x4ea6cf[_0xa27f('0x50')]=[{'all':!![]}];}_0x4ea6cf=_[_0xa27f('0x4e')]({},_0x4ea6cf,_0x5ac2de[_0xa27f('0x4f')]);return db[_0xa27f('0x3e')][_0xa27f('0x55')](_0x4ea6cf)['then'](handleEntityNotFound(_0x341d92,null))['then'](respondWithResult(_0x341d92,null))[_0xa27f('0x2b')](handleError(_0x341d92,null));};exports[_0xa27f('0x56')]=function(_0x4e1e45,_0x3c4ee3){return db['OpenchannelMessage'][_0xa27f('0x56')](_0x4e1e45['body'],{})['then'](respondWithResult(_0x3c4ee3,0xc9))[_0xa27f('0x2b')](handleError(_0x3c4ee3,null));};exports[_0xa27f('0x57')]=function(_0x18596a,_0x23fb7e){if(_0x18596a[_0xa27f('0x58')]['id']){delete _0x18596a['body']['id'];}return db[_0xa27f('0x3e')]['find']({'where':{'id':_0x18596a[_0xa27f('0x52')]['id']}})[_0xa27f('0x37')](handleEntityNotFound(_0x23fb7e,null))[_0xa27f('0x37')](saveUpdates(_0x18596a[_0xa27f('0x58')],null))[_0xa27f('0x37')](respondWithResult(_0x23fb7e,null))[_0xa27f('0x2b')](handleError(_0x23fb7e,null));};exports[_0xa27f('0x59')]=function(_0x5a4512,_0x319b80){return db[_0xa27f('0x3e')][_0xa27f('0x55')]({'where':{'id':_0x5a4512[_0xa27f('0x52')]['id']}})[_0xa27f('0x37')](handleEntityNotFound(_0x319b80,null))[_0xa27f('0x37')](removeEntity(_0x319b80,null))[_0xa27f('0x2b')](handleError(_0x319b80,null));};exports[_0xa27f('0x5a')]=function(_0x41bebe,_0x554b59){return db[_0xa27f('0x3e')][_0xa27f('0x5a')]()['then'](respondWithResult(_0x554b59,null))['catch'](handleError(_0x554b59,null));};var interaction_log=require(_0xa27f('0x16'))(_0xa27f('0x5b'));exports[_0xa27f('0x5c')]=function(_0x178e23,_0x171187,_0x512153){var _0x196d67={'agent':{},'channel':_0xa27f('0x5d')};if(_0x178e23['body']['id']){delete _0x178e23[_0xa27f('0x58')]['id'];}_0x178e23[_0xa27f('0x58')][_0xa27f('0x5e')]=!![];_0x178e23['body']['readAt']=moment()[_0xa27f('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x178e23[_0xa27f('0x58')][_0xa27f('0x60')]=_0x178e23[_0xa27f('0x58')][_0xa27f('0x60')]||_0x178e23['user']['id'];_0x196d67[_0xa27f('0x61')]['id']=_0x178e23[_0xa27f('0x58')]['UserId'];return db[_0xa27f('0x3e')]['find']({'where':{'id':_0x178e23[_0xa27f('0x52')]['id'],'UserId':null}})[_0xa27f('0x37')](handleEntityNotFound(_0x171187,null))[_0xa27f('0x37')](saveUpdates(_0x178e23['body'],null))[_0xa27f('0x37')](function(_0x31a165){if(_0x31a165){_0x196d67[_0xa27f('0x27')]=_0x31a165[_0xa27f('0x62')]({'plain':!![]});return db[_0xa27f('0x63')][_0xa27f('0x55')]({'where':{'id':_0x31a165['OpenchannelInteractionId']}});}return null;})[_0xa27f('0x37')](handleEntityNotFound(_0x171187,null))['then'](function(_0x5bd33b){if(_0x5bd33b){return _0x5bd33b[_0xa27f('0x57')]({'UserId':_0x178e23[_0xa27f('0x58')][_0xa27f('0x60')],'read1stAt':_[_0xa27f('0x64')](_0x5bd33b[_0xa27f('0x65')])?moment()['format'](_0xa27f('0x66')):undefined});}return null;})[_0xa27f('0x37')](function(_0x48eef2){if(_0x48eef2){_0x196d67['interaction']=_0x48eef2[_0xa27f('0x62')]({'plain':!![]});interaction_log['info'](_0xa27f('0x67'),_0x178e23[_0xa27f('0x68')]['id'],_0x178e23[_0xa27f('0x68')][_0xa27f('0x3a')],_0x178e23[_0xa27f('0x68')]['role'],_0x196d67[_0xa27f('0x69')]['id'],_0x178e23[_0xa27f('0x58')]?JSON[_0xa27f('0x24')](_0x178e23[_0xa27f('0x58')]):'null');return respondWithRpcPromise(_0xa27f('0x6a'),'acceptMessage',_0x196d67);}return null;})[_0xa27f('0x37')](function(_0x4db2c7){var _0x204e2c=_0xa27f('0x6b')+_0x4db2c7[_0xa27f('0x27')][_0xa27f('0x6c')];return db['sequelize'][_0xa27f('0x41')](_0x204e2c,{'type':db[_0xa27f('0x6d')]['QueryTypes'][_0xa27f('0x6e')],'raw':!![]})[_0xa27f('0x37')](function(_0x4f3539){return _0x4f3539;});})['then'](function(_0x557221){if(_0x557221){_0x196d67[_0xa27f('0x27')][_0xa27f('0x6f')]=_0x557221[0x0];if(!_0x178e23['body'][_0xa27f('0x60')])return;return db[_0xa27f('0x70')][_0xa27f('0x55')]({'where':{'id':_0x178e23[_0xa27f('0x58')][_0xa27f('0x60')],'role':_0xa27f('0x61')},'attributes':['id','name',_0xa27f('0x71'),_0xa27f('0x72'),_0xa27f('0x73')],'raw':!![]});}return null;})[_0xa27f('0x37')](function(_0x28c4bc){if(!_0x28c4bc)return null;_0x196d67[_0xa27f('0x27')][_0xa27f('0x61')]=_0x28c4bc;return _0x196d67;})[_0xa27f('0x37')](function(_0x2a974f){if(_0x2a974f){if(_0x178e23[_0xa27f('0x58')][_0xa27f('0x74')]){_0x196d67[_0xa27f('0x27')][_0xa27f('0x75')]=util[_0xa27f('0x5f')](_0xa27f('0x76'),_0x178e23[_0xa27f('0x68')][_0xa27f('0x3a')]);_0x196d67[_0xa27f('0x27')][_0xa27f('0x77')]=_0x196d67[_0xa27f('0x77')];_0x196d67[_0xa27f('0x27')][_0xa27f('0x78')]=_0x196d67[_0xa27f('0x77')];_0x196d67[_0xa27f('0x27')][_0xa27f('0x79')]=_0xa27f('0x5c');return respondWithRpcPromise('EventManager',_0xa27f('0x7a'),{'event':_0xa27f('0x7b'),'message':_0x196d67['message']},client9002)[_0xa27f('0x37')](function(){return _0x196d67;});}return _0x196d67;}return null;})['then'](respondWithResult(_0x171187,null))[_0xa27f('0x2b')](handleError(_0x171187,null));};var interaction_log=require(_0xa27f('0x16'))(_0xa27f('0x5b'));exports[_0xa27f('0x35')]=function(_0x2daafb,_0x49a84e,_0x52bbe5){var _0x1c12f4={'agent':{},'channel':_0xa27f('0x5d')};if(_0x2daafb['body']['id']){delete _0x2daafb['body']['id'];}_0x2daafb['body'][_0xa27f('0x60')]=_0x2daafb[_0xa27f('0x58')][_0xa27f('0x60')]||_0x2daafb[_0xa27f('0x68')]['id'];_0x1c12f4[_0xa27f('0x61')]['id']=_0x2daafb[_0xa27f('0x58')][_0xa27f('0x60')];return db['OpenchannelMessage'][_0xa27f('0x55')]({'where':{'id':_0x2daafb[_0xa27f('0x52')]['id'],'UserId':null}})[_0xa27f('0x37')](handleEntityNotFound(_0x49a84e,null))[_0xa27f('0x37')](function(_0x41fb0d){if(_0x41fb0d){_0x1c12f4[_0xa27f('0x27')]=_0x41fb0d[_0xa27f('0x62')]({'plain':!![]});return db[_0xa27f('0x63')][_0xa27f('0x55')]({'where':{'id':_0x41fb0d[_0xa27f('0x7c')]}});}return null;})[_0xa27f('0x37')](handleEntityNotFound(_0x49a84e,null))['then'](function(_0x537787){if(_0x537787){_0x1c12f4[_0xa27f('0x69')]=_0x537787[_0xa27f('0x62')]({'plain':!![]});interaction_log[_0xa27f('0x29')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2daafb[_0xa27f('0x68')]['id'],_0x2daafb[_0xa27f('0x68')]['name'],_0x2daafb[_0xa27f('0x68')][_0xa27f('0x7d')],_0x1c12f4['interaction']['id'],_0x2daafb[_0xa27f('0x58')]?JSON[_0xa27f('0x24')](_0x2daafb[_0xa27f('0x58')]):_0xa27f('0x7e'));return respondWithRpcPromise('RejectMessage',_0xa27f('0x7f'),_0x1c12f4);}return null;})[_0xa27f('0x37')](function(_0xd6e96e){var _0xfd80a8=_0xa27f('0x6b')+_0xd6e96e[_0xa27f('0x27')][_0xa27f('0x6c')];return db[_0xa27f('0x80')][_0xa27f('0x41')](_0xfd80a8,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x3b1249){return _0x3b1249;});})[_0xa27f('0x37')](function(_0x372219){if(_0x372219){_0x1c12f4[_0xa27f('0x27')]['contact']=_0x372219[0x0];if(!_0x2daafb['body'][_0xa27f('0x60')])return;return db[_0xa27f('0x70')][_0xa27f('0x55')]({'where':{'id':_0x2daafb[_0xa27f('0x58')]['UserId'],'role':_0xa27f('0x61')},'attributes':['id','name','fullname',_0xa27f('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x197cad){if(!_0x197cad)return null;_0x1c12f4[_0xa27f('0x27')]['agent']=_0x197cad;return _0x1c12f4;})[_0xa27f('0x37')](function(_0x4c8ae2){if(_0x4c8ae2){_0x4c8ae2[_0xa27f('0x27')][_0xa27f('0x75')]=util[_0xa27f('0x5f')](_0xa27f('0x76'),_0x2daafb['user'][_0xa27f('0x3a')]);_0x4c8ae2[_0xa27f('0x27')][_0xa27f('0x77')]=_0x1c12f4[_0xa27f('0x77')];_0x4c8ae2[_0xa27f('0x27')]['motionChannel']=_0x1c12f4[_0xa27f('0x77')];_0x4c8ae2[_0xa27f('0x27')][_0xa27f('0x79')]=_0xa27f('0x35');respondWithRpcPromise(_0xa27f('0x7a'),_0xa27f('0x7a'),{'event':_0xa27f('0x81'),'message':_0x4c8ae2[_0xa27f('0x27')]},client9002);return _0x1c12f4;}return null;})[_0xa27f('0x37')](respondWithResult(_0x49a84e,null))[_0xa27f('0x2b')](handleError(_0x49a84e,null));}; \ No newline at end of file +var _0xcca3=['length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','params','keys','find','create','body','update','describe','openchannel-interactions','accept','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','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','OpenchannelInteraction','RejectMessage','rejectMessage','sequelize','QueryTypes','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields'];(function(_0x53fb2b,_0x292146){var _0x399b24=function(_0x2b9dc6){while(--_0x2b9dc6){_0x53fb2b['push'](_0x53fb2b['shift']());}};_0x399b24(++_0x292146);}(_0xcca3,0xbe));var _0x3cca=function(_0xab9630,_0xe19d9c){_0xab9630=_0xab9630-0x0;var _0x1567a3=_0xcca3[_0xab9630];return _0x1567a3;};'use strict';var emlformat=require(_0x3cca('0x0'));var rimraf=require(_0x3cca('0x1'));var zipdir=require(_0x3cca('0x2'));var jsonpatch=require(_0x3cca('0x3'));var rp=require(_0x3cca('0x4'));var moment=require(_0x3cca('0x5'));var BPromise=require(_0x3cca('0x6'));var Mustache=require(_0x3cca('0x7'));var util=require(_0x3cca('0x8'));var path=require(_0x3cca('0x9'));var sox=require(_0x3cca('0xa'));var csv=require(_0x3cca('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3cca('0xc'));var _=require(_0x3cca('0xd'));var squel=require('squel');var crypto=require(_0x3cca('0xe'));var jsforce=require(_0x3cca('0xf'));var deskjs=require(_0x3cca('0x10'));var toCsv=require(_0x3cca('0xb'));var querystring=require('querystring');var Papa=require(_0x3cca('0x11'));var Redis=require(_0x3cca('0x12'));var authService=require(_0x3cca('0x13'));var qs=require(_0x3cca('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3cca('0x15'))(_0x3cca('0x16'));var utils=require(_0x3cca('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3cca('0x18'));var db=require(_0x3cca('0x19'))['db'];config['redis']=_[_0x3cca('0x1a')](config[_0x3cca('0x1b')],{'host':_0x3cca('0x1c'),'port':0x18eb});var socket=require(_0x3cca('0x1d'))(new Redis(config['redis']));require(_0x3cca('0x1e'))[_0x3cca('0x1f')](socket);var jayson=require(_0x3cca('0x20'));var client=jayson[_0x3cca('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x3cca('0x21')][_0x3cca('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x10531,_0x185013,_0x423c85,_0x2240f4){return new BPromise(function(_0x28c589,_0x384ea0){var _0x3a3f94=_0x2240f4||client;return _0x3a3f94[_0x3cca('0x23')](_0x10531,_0x423c85)[_0x3cca('0x24')](function(_0x39ff50){logger['info'](_0x3cca('0x25'),_0x185013,_0x3cca('0x26'));logger[_0x3cca('0x27')](_0x3cca('0x28'),_0x185013,_0x3cca('0x26'),JSON['stringify'](_0x39ff50));if(_0x39ff50['error']){if(_0x39ff50[_0x3cca('0x29')][_0x3cca('0x2a')]===0x1f4){logger['error'](_0x3cca('0x25'),_0x185013,_0x39ff50[_0x3cca('0x29')][_0x3cca('0x2b')]);return _0x384ea0(_0x39ff50[_0x3cca('0x29')][_0x3cca('0x2b')]);}logger['error'](_0x3cca('0x25'),_0x185013,_0x39ff50[_0x3cca('0x29')]['message']);return _0x28c589(_0x39ff50['error'][_0x3cca('0x2b')]);}else{logger[_0x3cca('0x2c')](_0x3cca('0x25'),_0x185013,_0x3cca('0x26'));_0x28c589(_0x39ff50[_0x3cca('0x2d')][_0x3cca('0x2b')]);}})[_0x3cca('0x2e')](function(_0x3b7462){logger[_0x3cca('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x185013,_0x3b7462);_0x384ea0(_0x3b7462);});});}function respondWithStatusCode(_0x348a39,_0x255eca){_0x255eca=_0x255eca||0xcc;return function(_0x50ed5f){if(_0x50ed5f){return _0x348a39[_0x3cca('0x2f')](_0x255eca);}return _0x348a39[_0x3cca('0x30')](_0x255eca)[_0x3cca('0x31')]();};}function respondWithResult(_0x52f96e,_0x4bf514){_0x4bf514=_0x4bf514||0xc8;return function(_0x471fc9){if(_0x471fc9){return _0x52f96e[_0x3cca('0x30')](_0x4bf514)[_0x3cca('0x32')](_0x471fc9);}};}function respondWithFilteredResult(_0xcc2dfc,_0x15068e){return function(_0x3f8f07){if(_0x3f8f07){var _0x2e6aa5=typeof _0x15068e[_0x3cca('0x33')]===_0x3cca('0x34')&&typeof _0x15068e['limit']==='undefined';var _0xb0c78d=_0x3f8f07[_0x3cca('0x35')];var _0x51881f=_0x2e6aa5?0x0:_0x15068e['offset'];var _0x49292b=_0x2e6aa5?_0x3f8f07['count']:_0x15068e[_0x3cca('0x33')]+_0x15068e[_0x3cca('0x36')];var _0x327fba;if(_0x49292b>=_0xb0c78d){_0x49292b=_0xb0c78d;_0x327fba=0xc8;}else{_0x327fba=0xce;}_0xcc2dfc[_0x3cca('0x30')](_0x327fba);return _0xcc2dfc['set'](_0x3cca('0x37'),_0x51881f+'-'+_0x49292b+'/'+_0xb0c78d)[_0x3cca('0x32')](_0x3f8f07);}return null;};}function patchUpdates(_0x720004){return function(_0x130ee7){try{jsonpatch['apply'](_0x130ee7,_0x720004,!![]);}catch(_0x510f22){return BPromise[_0x3cca('0x38')](_0x510f22);}return _0x130ee7[_0x3cca('0x39')]();};}function saveUpdates(_0x27a660,_0x39bbc4){return function(_0x493512){if(_0x493512){return _0x493512['update'](_0x27a660)[_0x3cca('0x24')](function(_0x4cc7fb){return _0x4cc7fb;});}return null;};}function removeEntity(_0x27d4dc,_0x249f24){return function(_0x4dbbd4){if(_0x4dbbd4){return _0x4dbbd4[_0x3cca('0x3a')]()[_0x3cca('0x24')](function(){_0x27d4dc[_0x3cca('0x30')](0xcc)[_0x3cca('0x31')]();});}};}function handleEntityNotFound(_0x1d7f3a,_0x3864eb){return function(_0x527b08){if(!_0x527b08){_0x1d7f3a[_0x3cca('0x2f')](0x194);}return _0x527b08;};}function handleError(_0x57190d,_0x4538b4){_0x4538b4=_0x4538b4||0x1f4;return function(_0x320b50){logger[_0x3cca('0x29')](_0x320b50[_0x3cca('0x3b')]);if(_0x320b50[_0x3cca('0x3c')]){delete _0x320b50[_0x3cca('0x3c')];}_0x57190d[_0x3cca('0x30')](_0x4538b4)[_0x3cca('0x3d')](_0x320b50);};}exports[_0x3cca('0x3e')]=function(_0x4a0994,_0x5bfaf0){var _0x113680={},_0x261d44={},_0x2a2141={'count':0x0,'rows':[]};var _0x56109e=_[_0x3cca('0x3f')](db[_0x3cca('0x40')][_0x3cca('0x41')],function(_0x24b8a7){return{'name':_0x24b8a7[_0x3cca('0x42')],'type':_0x24b8a7['type'][_0x3cca('0x43')]};});_0x261d44['model']=_[_0x3cca('0x3f')](_0x56109e,_0x3cca('0x3c'));_0x261d44[_0x3cca('0x44')]=_['keys'](_0x4a0994[_0x3cca('0x44')]);_0x261d44[_0x3cca('0x45')]=_['intersection'](_0x261d44[_0x3cca('0x46')],_0x261d44[_0x3cca('0x44')]);_0x113680[_0x3cca('0x47')]=_[_0x3cca('0x48')](_0x261d44[_0x3cca('0x46')],qs[_0x3cca('0x49')](_0x4a0994[_0x3cca('0x44')][_0x3cca('0x49')]));_0x113680['attributes']=_0x113680[_0x3cca('0x47')][_0x3cca('0x4a')]?_0x113680[_0x3cca('0x47')]:_0x261d44[_0x3cca('0x46')];if(!_0x4a0994[_0x3cca('0x44')][_0x3cca('0x4b')](_0x3cca('0x4c'))){_0x113680[_0x3cca('0x36')]=qs[_0x3cca('0x36')](_0x4a0994[_0x3cca('0x44')]['limit']);_0x113680[_0x3cca('0x33')]=qs[_0x3cca('0x33')](_0x4a0994['query']['offset']);}_0x113680[_0x3cca('0x4d')]=qs[_0x3cca('0x4e')](_0x4a0994[_0x3cca('0x44')][_0x3cca('0x4e')]);_0x113680[_0x3cca('0x4f')]=qs['filters'](_[_0x3cca('0x50')](_0x4a0994[_0x3cca('0x44')],_0x261d44[_0x3cca('0x45')]),_0x56109e);if(_0x4a0994[_0x3cca('0x44')]['filter']){_0x113680[_0x3cca('0x4f')]=_[_0x3cca('0x51')](_0x113680[_0x3cca('0x4f')],{'$or':_[_0x3cca('0x3f')](_0x56109e,function(_0x1a7b7d){if(_0x1a7b7d[_0x3cca('0x52')]!==_0x3cca('0x53')){var _0x33342a={};_0x33342a[_0x1a7b7d[_0x3cca('0x3c')]]={'$like':'%'+_0x4a0994[_0x3cca('0x44')][_0x3cca('0x54')]+'%'};return _0x33342a;}})});}_0x113680=_[_0x3cca('0x51')]({},_0x113680,_0x4a0994[_0x3cca('0x55')]);var _0x4eb059={'where':_0x113680[_0x3cca('0x4f')]};return db['OpenchannelMessage'][_0x3cca('0x35')](_0x4eb059)[_0x3cca('0x24')](function(_0x34379e){_0x2a2141[_0x3cca('0x35')]=_0x34379e;if(_0x4a0994[_0x3cca('0x44')][_0x3cca('0x56')]){_0x113680[_0x3cca('0x57')]=[{'all':!![]}];}return db[_0x3cca('0x40')]['findAll'](_0x113680);})['then'](function(_0x352448){_0x2a2141[_0x3cca('0x58')]=_0x352448;return _0x2a2141;})[_0x3cca('0x24')](respondWithFilteredResult(_0x5bfaf0,_0x113680))['catch'](handleError(_0x5bfaf0,null));};exports['show']=function(_0x32a281,_0x142b9d){var _0x22b1e2={'raw':!![],'where':{'id':_0x32a281[_0x3cca('0x59')]['id']}},_0x15dabe={};_0x15dabe[_0x3cca('0x46')]=_[_0x3cca('0x5a')](db[_0x3cca('0x40')]['rawAttributes']);_0x15dabe[_0x3cca('0x44')]=_[_0x3cca('0x5a')](_0x32a281[_0x3cca('0x44')]);_0x15dabe['filters']=_[_0x3cca('0x48')](_0x15dabe[_0x3cca('0x46')],_0x15dabe[_0x3cca('0x44')]);_0x22b1e2[_0x3cca('0x47')]=_['intersection'](_0x15dabe[_0x3cca('0x46')],qs[_0x3cca('0x49')](_0x32a281[_0x3cca('0x44')]['fields']));_0x22b1e2['attributes']=_0x22b1e2[_0x3cca('0x47')][_0x3cca('0x4a')]?_0x22b1e2[_0x3cca('0x47')]:_0x15dabe['model'];if(_0x32a281[_0x3cca('0x44')][_0x3cca('0x56')]){_0x22b1e2['include']=[{'all':!![]}];}_0x22b1e2=_[_0x3cca('0x51')]({},_0x22b1e2,_0x32a281['options']);return db['OpenchannelMessage'][_0x3cca('0x5b')](_0x22b1e2)['then'](handleEntityNotFound(_0x142b9d,null))[_0x3cca('0x24')](respondWithResult(_0x142b9d,null))[_0x3cca('0x2e')](handleError(_0x142b9d,null));};exports['create']=function(_0x49fefb,_0x392ba8){return db[_0x3cca('0x40')][_0x3cca('0x5c')](_0x49fefb[_0x3cca('0x5d')],{})['then'](respondWithResult(_0x392ba8,0xc9))[_0x3cca('0x2e')](handleError(_0x392ba8,null));};exports[_0x3cca('0x5e')]=function(_0x519950,_0x56d379){if(_0x519950[_0x3cca('0x5d')]['id']){delete _0x519950[_0x3cca('0x5d')]['id'];}return db['OpenchannelMessage'][_0x3cca('0x5b')]({'where':{'id':_0x519950[_0x3cca('0x59')]['id']}})[_0x3cca('0x24')](handleEntityNotFound(_0x56d379,null))[_0x3cca('0x24')](saveUpdates(_0x519950['body'],null))[_0x3cca('0x24')](respondWithResult(_0x56d379,null))[_0x3cca('0x2e')](handleError(_0x56d379,null));};exports[_0x3cca('0x3a')]=function(_0x52fedf,_0x433796){return db[_0x3cca('0x40')]['find']({'where':{'id':_0x52fedf[_0x3cca('0x59')]['id']}})[_0x3cca('0x24')](handleEntityNotFound(_0x433796,null))[_0x3cca('0x24')](removeEntity(_0x433796,null))[_0x3cca('0x2e')](handleError(_0x433796,null));};exports[_0x3cca('0x5f')]=function(_0xe39878,_0xf14d6d){return db[_0x3cca('0x40')][_0x3cca('0x5f')]()[_0x3cca('0x24')](respondWithResult(_0xf14d6d,null))[_0x3cca('0x2e')](handleError(_0xf14d6d,null));};var interaction_log=require(_0x3cca('0x15'))(_0x3cca('0x60'));exports[_0x3cca('0x61')]=function(_0x4cf899,_0x507ff4,_0x22ca9a){var _0xf08320={'agent':{},'channel':_0x3cca('0x62')};if(_0x4cf899[_0x3cca('0x5d')]['id']){delete _0x4cf899['body']['id'];}_0x4cf899[_0x3cca('0x5d')][_0x3cca('0x63')]=!![];_0x4cf899[_0x3cca('0x5d')][_0x3cca('0x64')]=moment()[_0x3cca('0x65')](_0x3cca('0x66'));_0x4cf899[_0x3cca('0x5d')][_0x3cca('0x67')]=_0x4cf899[_0x3cca('0x5d')][_0x3cca('0x67')]||_0x4cf899[_0x3cca('0x68')]['id'];_0xf08320[_0x3cca('0x69')]['id']=_0x4cf899[_0x3cca('0x5d')][_0x3cca('0x67')];return db['OpenchannelMessage'][_0x3cca('0x5b')]({'where':{'id':_0x4cf899['params']['id'],'UserId':null}})[_0x3cca('0x24')](handleEntityNotFound(_0x507ff4,null))[_0x3cca('0x24')](saveUpdates(_0x4cf899[_0x3cca('0x5d')],null))[_0x3cca('0x24')](function(_0x21aef9){if(_0x21aef9){_0xf08320[_0x3cca('0x2b')]=_0x21aef9[_0x3cca('0x6a')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x21aef9[_0x3cca('0x6b')]}});}return null;})[_0x3cca('0x24')](handleEntityNotFound(_0x507ff4,null))[_0x3cca('0x24')](function(_0x3734c6){if(_0x3734c6){return _0x3734c6[_0x3cca('0x5e')]({'UserId':_0x4cf899[_0x3cca('0x5d')][_0x3cca('0x67')],'read1stAt':_[_0x3cca('0x6c')](_0x3734c6[_0x3cca('0x6d')])?moment()[_0x3cca('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3cca('0x24')](function(_0x5e67fe){if(_0x5e67fe){_0xf08320[_0x3cca('0x6e')]=_0x5e67fe['get']({'plain':!![]});interaction_log[_0x3cca('0x2c')](_0x3cca('0x6f'),_0x4cf899[_0x3cca('0x68')]['id'],_0x4cf899[_0x3cca('0x68')]['name'],_0x4cf899[_0x3cca('0x68')]['role'],_0xf08320[_0x3cca('0x6e')]['id'],_0x4cf899[_0x3cca('0x5d')]?JSON['stringify'](_0x4cf899['body']):_0x3cca('0x70'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0xf08320);}return null;})[_0x3cca('0x24')](function(_0xa4025c){var _0x29c52e=_0x3cca('0x71')+_0xa4025c['message'][_0x3cca('0x72')];return db['sequelize'][_0x3cca('0x44')](_0x29c52e,{'type':db[_0x3cca('0x73')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0xdd3c31){return _0xdd3c31;});})[_0x3cca('0x24')](function(_0x313d10){if(_0x313d10){_0xf08320[_0x3cca('0x2b')][_0x3cca('0x74')]=_0x313d10[0x0];if(!_0x4cf899[_0x3cca('0x5d')][_0x3cca('0x67')])return;return db['User']['find']({'where':{'id':_0x4cf899[_0x3cca('0x5d')][_0x3cca('0x67')],'role':_0x3cca('0x69')},'attributes':['id',_0x3cca('0x3c'),_0x3cca('0x75'),_0x3cca('0x76'),_0x3cca('0x77')],'raw':!![]});}return null;})[_0x3cca('0x24')](function(_0x1e6976){if(!_0x1e6976)return null;_0xf08320[_0x3cca('0x2b')][_0x3cca('0x69')]=_0x1e6976;return _0xf08320;})[_0x3cca('0x24')](function(_0x2db73e){if(_0x2db73e){if(_0x4cf899['body']['manual']){_0xf08320[_0x3cca('0x2b')][_0x3cca('0x78')]=util['format'](_0x3cca('0x79'),_0x4cf899[_0x3cca('0x68')][_0x3cca('0x3c')]);_0xf08320[_0x3cca('0x2b')][_0x3cca('0x7a')]=_0xf08320[_0x3cca('0x7a')];_0xf08320[_0x3cca('0x2b')][_0x3cca('0x7b')]=_0xf08320[_0x3cca('0x7a')];_0xf08320['message'][_0x3cca('0x7c')]=_0x3cca('0x61');return respondWithRpcPromise(_0x3cca('0x7d'),'EventManager',{'event':'acceptmessage','message':_0xf08320['message']},client9002)[_0x3cca('0x24')](function(){return _0xf08320;});}return _0xf08320;}return null;})['then'](respondWithResult(_0x507ff4,null))[_0x3cca('0x2e')](handleError(_0x507ff4,null));};var interaction_log=require(_0x3cca('0x15'))(_0x3cca('0x60'));exports['reject']=function(_0x365afb,_0x1ffab9,_0xa89306){var _0x293f6d={'agent':{},'channel':_0x3cca('0x62')};if(_0x365afb['body']['id']){delete _0x365afb[_0x3cca('0x5d')]['id'];}_0x365afb[_0x3cca('0x5d')][_0x3cca('0x67')]=_0x365afb[_0x3cca('0x5d')][_0x3cca('0x67')]||_0x365afb[_0x3cca('0x68')]['id'];_0x293f6d[_0x3cca('0x69')]['id']=_0x365afb[_0x3cca('0x5d')][_0x3cca('0x67')];return db[_0x3cca('0x40')][_0x3cca('0x5b')]({'where':{'id':_0x365afb[_0x3cca('0x59')]['id'],'UserId':null}})[_0x3cca('0x24')](handleEntityNotFound(_0x1ffab9,null))[_0x3cca('0x24')](function(_0x50a441){if(_0x50a441){_0x293f6d[_0x3cca('0x2b')]=_0x50a441['get']({'plain':!![]});return db[_0x3cca('0x7e')]['find']({'where':{'id':_0x50a441[_0x3cca('0x6b')]}});}return null;})[_0x3cca('0x24')](handleEntityNotFound(_0x1ffab9,null))['then'](function(_0x32f99c){if(_0x32f99c){_0x293f6d[_0x3cca('0x6e')]=_0x32f99c[_0x3cca('0x6a')]({'plain':!![]});interaction_log[_0x3cca('0x2c')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x365afb[_0x3cca('0x68')]['id'],_0x365afb['user'][_0x3cca('0x3c')],_0x365afb[_0x3cca('0x68')]['role'],_0x293f6d[_0x3cca('0x6e')]['id'],_0x365afb[_0x3cca('0x5d')]?JSON['stringify'](_0x365afb[_0x3cca('0x5d')]):_0x3cca('0x70'));return respondWithRpcPromise(_0x3cca('0x7f'),_0x3cca('0x80'),_0x293f6d);}return null;})[_0x3cca('0x24')](function(_0x1a6e27){var _0x4599fa=_0x3cca('0x71')+_0x1a6e27[_0x3cca('0x2b')][_0x3cca('0x72')];return db[_0x3cca('0x81')][_0x3cca('0x44')](_0x4599fa,{'type':db[_0x3cca('0x73')][_0x3cca('0x82')]['SELECT'],'raw':!![]})['then'](function(_0x191674){return _0x191674;});})[_0x3cca('0x24')](function(_0x1c809b){if(_0x1c809b){_0x293f6d[_0x3cca('0x2b')]['contact']=_0x1c809b[0x0];if(!_0x365afb['body']['UserId'])return;return db[_0x3cca('0x83')]['find']({'where':{'id':_0x365afb['body'][_0x3cca('0x67')],'role':'agent'},'attributes':['id',_0x3cca('0x3c'),_0x3cca('0x75'),_0x3cca('0x76'),_0x3cca('0x77')],'raw':!![]});}return null;})[_0x3cca('0x24')](function(_0x3ea5d7){if(!_0x3ea5d7)return null;_0x293f6d[_0x3cca('0x2b')][_0x3cca('0x69')]=_0x3ea5d7;return _0x293f6d;})[_0x3cca('0x24')](function(_0xa6e5d6){if(_0xa6e5d6){_0xa6e5d6['message'][_0x3cca('0x78')]=util[_0x3cca('0x65')](_0x3cca('0x79'),_0x365afb[_0x3cca('0x68')][_0x3cca('0x3c')]);_0xa6e5d6[_0x3cca('0x2b')][_0x3cca('0x7a')]=_0x293f6d[_0x3cca('0x7a')];_0xa6e5d6['message'][_0x3cca('0x7b')]=_0x293f6d['channel'];_0xa6e5d6['message'][_0x3cca('0x7c')]=_0x3cca('0x38');respondWithRpcPromise(_0x3cca('0x7d'),_0x3cca('0x7d'),{'event':'rejectmessage','message':_0xa6e5d6[_0x3cca('0x2b')]},client9002);return _0x293f6d;}return null;})['then'](respondWithResult(_0x1ffab9,null))[_0x3cca('0x2e')](handleError(_0x1ffab9,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 20fb387..dacf848 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 _0xd294=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','OpenchannelMessage'];(function(_0x5fae11,_0x812d2a){var _0x22695b=function(_0xae0edd){while(--_0xae0edd){_0x5fae11['push'](_0x5fae11['shift']());}};_0x22695b(++_0x812d2a);}(_0xd294,0x1c9));var _0x4d29=function(_0x31eb56,_0x1b0fc0){_0x31eb56=_0x31eb56-0x0;var _0x55b754=_0xd294[_0x31eb56];return _0x55b754;};'use strict';var EventEmitter=require(_0x4d29('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x4d29('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x4d29('0x2')](0x0);var events={'afterCreate':_0x4d29('0x3'),'afterUpdate':_0x4d29('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3a86ab){return function(_0x2df998,_0x4b842d,_0x54ac51){OpenchannelMessageEvents['emit'](_0x3a86ab+':'+_0x2df998['id'],_0x2df998);OpenchannelMessageEvents[_0x4d29('0x5')](_0x3a86ab,_0x2df998);_0x54ac51(null);};}for(var e in events){if(events[_0x4d29('0x6')](e)){var event=events[e];OpenchannelMessage[_0x4d29('0x7')](e,emitEvent(event));}}module[_0x4d29('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x781a=['update','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelMessage','setMaxListeners'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x781a,0x15c));var _0xa781=function(_0x1fae05,_0x1503b5){_0x1fae05=_0x1fae05-0x0;var _0x41bf22=_0x781a[_0x1fae05];return _0x41bf22;};'use strict';var EventEmitter=require(_0xa781('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0xa781('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xa781('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa781('0x3'),'afterDestroy':_0xa781('0x4')};function emitEvent(_0x13ff19){return function(_0x34d5e9,_0x2a9182,_0x4a3f17){OpenchannelMessageEvents[_0xa781('0x5')](_0x13ff19+':'+_0x34d5e9['id'],_0x34d5e9);OpenchannelMessageEvents[_0xa781('0x5')](_0x13ff19,_0x34d5e9);_0x4a3f17(null);};}for(var e in events){if(events[_0xa781('0x6')](e)){var event=events[e];OpenchannelMessage[_0xa781('0x7')](e,emitEvent(event));}}module[_0xa781('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 893cb64..ca34e70 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 _0x757a=['find','OpenchannelAccountId','OpenchannelInteraction','Interactions','keys','replyUri','info','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','POST','method','OpenchannelMessage,\x20%s,\x20%s','threadId','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','UserId','OpenchannelInteractionId','update','createdAt','catch','error','out','secret','CmContact','describe','then'];(function(_0x38606d,_0x2e525f){var _0x15aea2=function(_0x12a5a8){while(--_0x12a5a8){_0x38606d['push'](_0x38606d['shift']());}};_0x15aea2(++_0x2e525f);}(_0x757a,0xde));var _0xa757=function(_0x1aa133,_0x516f76){_0x1aa133=_0x1aa133-0x0;var _0x1a5984=_0x757a[_0x1aa133];return _0x1a5984;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('OpenchannelMessage',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xb')],'type':_0xa757('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a3db6,_0x5aef8a,_0x89c630){var _0x2ca96f=_0x5edca8[_0xa757('0xd')];var _0x3e2c9a=_0x3a3db6[_0xa757('0xe')]({'plain':!![]});if(_0x3e2c9a[_0xa757('0xf')][_0xa757('0x10')]()==='in'||_0x3e2c9a['direction']['toLowerCase']()==='out'&&!_0x3e2c9a['secret']&&!_['isNil'](_0x3e2c9a[_0xa757('0x11')])){_0x2ca96f['OpenchannelInteraction']['findOne']({'where':{'id':_0x3e2c9a[_0xa757('0x12')]}})['then'](function(_0x481508){if(_0x481508){_0x481508[_0xa757('0x13')]({'lastMsgAt':_0x3e2c9a[_0xa757('0x14')],'lastMsgDirection':_0x3e2c9a[_0xa757('0xf')][_0xa757('0x10')]()});}})[_0xa757('0x15')](function(_0x31cfd2){console[_0xa757('0x16')](_0x31cfd2);});}if(_0x3e2c9a[_0xa757('0xf')]===_0xa757('0x17')&&!_0x3e2c9a[_0xa757('0x18')]){var _0x50aac1;_0x2ca96f[_0xa757('0x19')][_0xa757('0x1a')]()[_0xa757('0x1b')](function(_0x4d9f58){return _0x2ca96f['OpenchannelAccount'][_0xa757('0x1c')]({'where':{'id':_0x3e2c9a[_0xa757('0x1d')]},'include':[{'model':_0x2ca96f[_0xa757('0x1e')],'as':_0xa757('0x1f'),'where':{'id':_0x3e2c9a[_0xa757('0x12')]},'limit':0x1,'include':[{'model':_0x2ca96f[_0xa757('0x19')],'as':'Contact','attributes':_[_0xa757('0x20')](_0x4d9f58)}]}]});})['then'](function(_0x32c2a1){_0x50aac1=_0x32c2a1[_0xa757('0xe')]({'plain':!![]});if(_0x50aac1&&_0x50aac1[_0xa757('0x21')]){logger[_0xa757('0x22')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xa757('0x23')](_0xa757('0x24'),_0x3e2c9a['id'],_0x50aac1[_0xa757('0x21')]));if(_0x50aac1[_0xa757('0x1f')]&&_0x50aac1[_0xa757('0x1f')][_0xa757('0x25')]){_0x3e2c9a[_0xa757('0x26')]=_[_0xa757('0x27')](_0x50aac1[_0xa757('0x1f')][0x0],'Contact');_0x3e2c9a[_0xa757('0x28')]=_0x50aac1['Interactions'][0x0][_0xa757('0x28')];}var _0x5aef8a={'method':_0xa757('0x29'),'uri':encodeURI(_0x50aac1[_0xa757('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5aef8a[_0xa757('0x2a')]){case'GET':_0x5aef8a['qs']=_0x3e2c9a;break;case _0xa757('0x29'):_0x5aef8a[_0xa757('0xb')]=_0x3e2c9a;break;}return rp(_0x5aef8a)[_0xa757('0x1b')](function(_0x3bf7f3){logger['info'](_0xa757('0x2b'),'afterCreate',util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x3e2c9a['id'],_0x50aac1['replyUri']));if(_0x3bf7f3[_0xa757('0xb')]['threadId']&&_0x3bf7f3[_0xa757('0xb')][_0xa757('0x2c')]!=_0x3e2c9a['Interaction'][_0xa757('0x2c')]){return _0x2ca96f['OpenchannelInteraction'][_0xa757('0x13')]({'threadId':_0x3bf7f3[_0xa757('0xb')]['threadId']},{'logging':!![],'where':{'id':_0x3e2c9a[_0xa757('0x26')]['id']}});}else{return;}})['then'](function(){return _0x3a3db6[_0xa757('0x13')]({'read':!![]});})[_0xa757('0x15')](function(_0x458974){logger[_0xa757('0x16')](_0xa757('0x2b'),_0xa757('0x2d'),util[_0xa757('0x2e')](_0x458974,{'showHidden':![],'depth':null}));_0x89c630();});}else{_0x89c630();}})[_0xa757('0x2f')](function(){_0x89c630();});}else{_0x89c630();}}},'charset':_0xa757('0x30'),'collate':_0xa757('0x31')});}; \ No newline at end of file +var _0x93e9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','out','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','GET','info','afterCreate','threadId','finally','utf8mb4','utf8mb4_unicode_ci'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0x93e9,0xcc));var _0x993e=function(_0x45a313,_0x37a410){_0x45a313=_0x45a313-0x0;var _0x53c9e8=_0x93e9[_0x45a313];return _0x53c9e8;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var logger=require(_0x993e('0x2'))(_0x993e('0x3'));var moment=require(_0x993e('0x4'));var BPromise=require(_0x993e('0x5'));var rp=require(_0x993e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x993e('0x7'));var attributes=require(_0x993e('0x8'));module[_0x993e('0x9')]=function(_0x45f52e,_0x1da414){return _0x45f52e[_0x993e('0xa')](_0x993e('0xb'),attributes,{'tableName':_0x993e('0xc'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x993e('0xd')],'type':_0x993e('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x15d774,_0x280291,_0x2cd389){var _0x27a28f=_0x45f52e[_0x993e('0xf')];var _0x48291a=_0x15d774[_0x993e('0x10')]({'plain':!![]});if(_0x48291a[_0x993e('0x11')]['toLowerCase']()==='in'||_0x48291a['direction'][_0x993e('0x12')]()==='out'&&!_0x48291a[_0x993e('0x13')]&&!_['isNil'](_0x48291a['UserId'])){_0x27a28f[_0x993e('0x14')][_0x993e('0x15')]({'where':{'id':_0x48291a[_0x993e('0x16')]}})[_0x993e('0x17')](function(_0x3e082b){if(_0x3e082b){_0x3e082b[_0x993e('0x18')]({'lastMsgAt':_0x48291a[_0x993e('0x19')],'lastMsgDirection':_0x48291a[_0x993e('0x11')][_0x993e('0x12')]()});}})[_0x993e('0x1a')](function(_0x1a7726){console[_0x993e('0x1b')](_0x1a7726);});}if(_0x48291a[_0x993e('0x11')]===_0x993e('0x1c')&&!_0x48291a[_0x993e('0x13')]){var _0x454475;_0x27a28f[_0x993e('0x1d')]['describe']()[_0x993e('0x17')](function(_0x1acd21){return _0x27a28f[_0x993e('0x1e')][_0x993e('0x1f')]({'where':{'id':_0x48291a[_0x993e('0x20')]},'include':[{'model':_0x27a28f[_0x993e('0x14')],'as':'Interactions','where':{'id':_0x48291a[_0x993e('0x16')]},'limit':0x1,'include':[{'model':_0x27a28f[_0x993e('0x1d')],'as':_0x993e('0x21'),'attributes':_[_0x993e('0x22')](_0x1acd21)}]}]});})[_0x993e('0x17')](function(_0x425ab4){_0x454475=_0x425ab4[_0x993e('0x10')]({'plain':!![]});if(_0x454475&&_0x454475[_0x993e('0x23')]){logger['info'](_0x993e('0x24'),'afterCreate',util[_0x993e('0x25')](_0x993e('0x26'),_0x48291a['id'],_0x454475[_0x993e('0x23')]));if(_0x454475['Interactions']&&_0x454475[_0x993e('0x27')][_0x993e('0x28')]){_0x48291a[_0x993e('0x29')]=_[_0x993e('0x2a')](_0x454475[_0x993e('0x27')][0x0],_0x993e('0x21'));_0x48291a[_0x993e('0x21')]=_0x454475[_0x993e('0x27')][0x0][_0x993e('0x21')];}var _0x280291={'method':_0x993e('0x2b'),'uri':encodeURI(_0x454475[_0x993e('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x280291['method']){case _0x993e('0x2c'):_0x280291['qs']=_0x48291a;break;case _0x993e('0x2b'):_0x280291['body']=_0x48291a;break;}return rp(_0x280291)[_0x993e('0x17')](function(_0x4f5cc1){logger[_0x993e('0x2d')](_0x993e('0x24'),_0x993e('0x2e'),util[_0x993e('0x25')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x48291a['id'],_0x454475['replyUri']));if(_0x4f5cc1[_0x993e('0xd')][_0x993e('0x2f')]&&_0x4f5cc1['body'][_0x993e('0x2f')]!=_0x48291a[_0x993e('0x29')][_0x993e('0x2f')]){return _0x27a28f['OpenchannelInteraction'][_0x993e('0x18')]({'threadId':_0x4f5cc1[_0x993e('0xd')][_0x993e('0x2f')]},{'logging':!![],'where':{'id':_0x48291a[_0x993e('0x29')]['id']}});}else{return;}})[_0x993e('0x17')](function(){return _0x15d774['update']({'read':!![]});})[_0x993e('0x1a')](function(_0x4d1379){logger[_0x993e('0x1b')]('OpenchannelMessage,\x20%s,\x20%s',_0x993e('0x2e'),util['inspect'](_0x4d1379,{'showHidden':![],'depth':null}));_0x2cd389();});}else{_0x2cd389();}})[_0x993e('0x30')](function(){_0x2cd389();});}else{_0x2cd389();}}},'charset':_0x993e('0x31'),'collate':_0x993e('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 0f1e7af..b506c55 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x4dfddc,_0x159aa2){var _0x45dcea=function(_0x181a3){while(--_0x181a3){_0x4dfddc['push'](_0x4dfddc['shift']());}};_0x45dcea(++_0x159aa2);}(_0x2ef3,0xba));var _0x32ef=function(_0x23fcb1,_0x36fd58){_0x23fcb1=_0x23fcb1-0x0;var _0x1b21e8=_0x2ef3[_0x23fcb1];return _0x1b21e8;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _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(_0x216ffc,_0x52d07f){var _0x93b5ee=function(_0x4f86c0){while(--_0x4f86c0){_0x216ffc['push'](_0x216ffc['shift']());}};_0x93b5ee(++_0x52d07f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x0b0e[_0x3b0731];return _0x4204d7;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 4dd8d84..334be33 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 _0xff36=['remove','emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save'];(function(_0x299c1c,_0x17fbeb){var _0x3a854f=function(_0x387667){while(--_0x387667){_0x299c1c['push'](_0x299c1c['shift']());}};_0x3a854f(++_0x17fbeb);}(_0xff36,0x1de));var _0x6ff3=function(_0x3471c4,_0x37039f){_0x3471c4=_0x3471c4-0x0;var _0x3a8de0=_0xff36[_0x3471c4];return _0x3a8de0;};'use strict';var OpenchannelMessageEvents=require(_0x6ff3('0x0'));var events=[_0x6ff3('0x1'),_0x6ff3('0x2'),'update'];function createListener(_0x4fd3f2,_0x5181e6){return function(_0x44b7a6){_0x5181e6[_0x6ff3('0x3')](_0x4fd3f2,_0x44b7a6);};}function removeListener(_0x462896,_0x597443){return function(){OpenchannelMessageEvents[_0x6ff3('0x4')](_0x462896,_0x597443);};}exports[_0x6ff3('0x5')]=function(_0x2e4525){for(var _0x3da5e8=0x0,_0x3ffd69=events[_0x6ff3('0x6')];_0x3da5e8<_0x3ffd69;_0x3da5e8++){var _0x272015=events[_0x3da5e8];var _0x3ae44b=createListener(_0x6ff3('0x7')+_0x272015,_0x2e4525);OpenchannelMessageEvents['on'](_0x272015,_0x3ae44b);}}; \ No newline at end of file +var _0xa7be=['update','emit','register','length','openchannelMessage:','./openchannelMessage.events','save','remove'];(function(_0x131303,_0x587b1b){var _0x3f0046=function(_0x4a8878){while(--_0x4a8878){_0x131303['push'](_0x131303['shift']());}};_0x3f0046(++_0x587b1b);}(_0xa7be,0xfd));var _0xea7b=function(_0x447c80,_0x2e425b){_0x447c80=_0x447c80-0x0;var _0x47c666=_0xa7be[_0x447c80];return _0x47c666;};'use strict';var OpenchannelMessageEvents=require(_0xea7b('0x0'));var events=[_0xea7b('0x1'),_0xea7b('0x2'),_0xea7b('0x3')];function createListener(_0x200bf3,_0x56bfb4){return function(_0x49ed41){_0x56bfb4[_0xea7b('0x4')](_0x200bf3,_0x49ed41);};}function removeListener(_0x98ad19,_0x3a1456){return function(){OpenchannelMessageEvents['removeListener'](_0x98ad19,_0x3a1456);};}exports[_0xea7b('0x5')]=function(_0x1bf6cb){for(var _0x3078c9=0x0,_0x211831=events[_0xea7b('0x6')];_0x3078c9<_0x211831;_0x3078c9++){var _0x3601b3=events[_0x3078c9];var _0x1c789e=createListener(_0xea7b('0x7')+_0x3601b3,_0x1bf6cb);OpenchannelMessageEvents['on'](_0x3601b3,_0x1c789e);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 2ab3f3a..71450e8 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 _0xacba=['/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','/:id/users','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0xbdc17,_0x44ed9f){var _0x881b46=function(_0x1161ce){while(--_0x1161ce){_0xbdc17['push'](_0xbdc17['shift']());}};_0x881b46(++_0x44ed9f);}(_0xacba,0xec));var _0xaacb=function(_0x2d50e4,_0x5079cf){_0x2d50e4=_0x2d50e4-0x0;var _0x5afbf9=_0xacba[_0x2d50e4];return _0x5afbf9;};'use strict';var multer=require(_0xaacb('0x0'));var util=require(_0xaacb('0x1'));var path=require(_0xaacb('0x2'));var timeout=require(_0xaacb('0x3'));var express=require(_0xaacb('0x4'));var router=express[_0xaacb('0x5')]();var fs_extra=require(_0xaacb('0x6'));var auth=require(_0xaacb('0x7'));var interaction=require(_0xaacb('0x8'));var config=require(_0xaacb('0x9'));var controller=require('./openchannelQueue.controller');router[_0xaacb('0xa')]('/',auth['isAuthenticated'](),controller[_0xaacb('0xb')]);router[_0xaacb('0xa')](_0xaacb('0xc'),auth[_0xaacb('0xd')](),controller[_0xaacb('0xe')]);router[_0xaacb('0xa')](_0xaacb('0xf'),auth[_0xaacb('0xd')](),controller[_0xaacb('0x10')]);router[_0xaacb('0xa')](_0xaacb('0x11'),auth['isAuthenticated'](),controller[_0xaacb('0x12')]);router['get'](_0xaacb('0x13'),auth['isAuthenticated'](),controller['getTeams']);router['get']('/:id/users',auth[_0xaacb('0xd')](),controller[_0xaacb('0x14')]);router[_0xaacb('0x15')]('/',auth[_0xaacb('0xd')](),controller[_0xaacb('0x16')]);router[_0xaacb('0x15')]('/:id/teams',auth[_0xaacb('0xd')](),controller['addTeams']);router[_0xaacb('0x15')](_0xaacb('0x17'),auth[_0xaacb('0xd')](),controller[_0xaacb('0x18')]);router[_0xaacb('0x19')]('/:id',auth[_0xaacb('0xd')](),controller[_0xaacb('0x1a')]);router[_0xaacb('0x1b')]('/:id',auth[_0xaacb('0xd')](),controller[_0xaacb('0x1c')]);router['delete'](_0xaacb('0x13'),auth[_0xaacb('0xd')](),controller[_0xaacb('0x1d')]);router[_0xaacb('0x1b')]('/:id/users',auth[_0xaacb('0xd')](),controller['removeAgents']);module[_0xaacb('0x1e')]=router; \ No newline at end of file +var _0xd7bb=['removeTeams','removeAgents','connect-timeout','express','Router','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','delete','destroy'];(function(_0x5bb14d,_0x3119f0){var _0x36f1b0=function(_0x1db27e){while(--_0x1db27e){_0x5bb14d['push'](_0x5bb14d['shift']());}};_0x36f1b0(++_0x3119f0);}(_0xd7bb,0xda));var _0xbd7b=function(_0x2b9a49,_0x387ee2){_0x2b9a49=_0x2b9a49-0x0;var _0x1ff07b=_0xd7bb[_0x2b9a49];return _0x1ff07b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xbd7b('0x0'));var express=require(_0xbd7b('0x1'));var router=express[_0xbd7b('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbd7b('0x3'));var config=require('../../config/environment');var controller=require(_0xbd7b('0x4'));router[_0xbd7b('0x5')]('/',auth[_0xbd7b('0x6')](),controller[_0xbd7b('0x7')]);router[_0xbd7b('0x5')](_0xbd7b('0x8'),auth[_0xbd7b('0x6')](),controller['describe']);router[_0xbd7b('0x5')](_0xbd7b('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xbd7b('0x5')](_0xbd7b('0xa'),auth[_0xbd7b('0x6')](),controller[_0xbd7b('0xb')]);router[_0xbd7b('0x5')](_0xbd7b('0xc'),auth[_0xbd7b('0x6')](),controller[_0xbd7b('0xd')]);router[_0xbd7b('0x5')](_0xbd7b('0xe'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xbd7b('0x6')](),controller[_0xbd7b('0xf')]);router[_0xbd7b('0x10')](_0xbd7b('0xc'),auth[_0xbd7b('0x6')](),controller[_0xbd7b('0x11')]);router[_0xbd7b('0x10')]('/:id/users',auth[_0xbd7b('0x6')](),controller[_0xbd7b('0x12')]);router[_0xbd7b('0x13')](_0xbd7b('0x9'),auth[_0xbd7b('0x6')](),controller['update']);router[_0xbd7b('0x14')]('/:id',auth[_0xbd7b('0x6')](),controller[_0xbd7b('0x15')]);router['delete'](_0xbd7b('0xc'),auth[_0xbd7b('0x6')](),controller[_0xbd7b('0x16')]);router[_0xbd7b('0x14')](_0xbd7b('0xe'),auth[_0xbd7b('0x6')](),controller[_0xbd7b('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index a9ce625..53a301a 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 _0x46f7=['beepall','STRING','name','INTEGER','ENUM'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x46f7,0x7e));var _0x746f=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x46f7[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x746f('0x0')],'unique':_0x746f('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x746f('0x0')]},'timeout':{'type':Sequelize[_0x746f('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x746f('0x3')]('rrmemory',_0x746f('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x4a01=['rrmemory','beepall','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x8ba5d2,_0x22debd){var _0x5d53c1=function(_0x39b33c){while(--_0x39b33c){_0x8ba5d2['push'](_0x8ba5d2['shift']());}};_0x5d53c1(++_0x22debd);}(_0x4a01,0x1f3));var _0x14a0=function(_0x5c3699,_0xc605ee){_0x5c3699=_0x5c3699-0x0;var _0xc323bc=_0x4a01[_0x5c3699];return _0xc323bc;};'use strict';var Sequelize=require(_0x14a0('0x0'));module[_0x14a0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x14a0('0x2')]},'timeout':{'type':Sequelize[_0x14a0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x14a0('0x4')](_0x14a0('0x5'),_0x14a0('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 15ea732..d7fe3db 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 _0x6d68=['omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','OpenchannelQueue','include','findAll','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','options','User','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','Agents','online','voicePause','flatMap','sequelize','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','includes','all','union','compact','value','ids','isEmpty','removeAgents','userOpenchannelQueue:remove'];(function(_0x2e1907,_0x229a70){var _0x401555=function(_0x487ac2){while(--_0x487ac2){_0x2e1907['push'](_0x2e1907['shift']());}};_0x401555(++_0x229a70);}(_0x6d68,0x93));var _0x86d6=function(_0x19b834,_0x48689b){_0x19b834=_0x19b834-0x0;var _0x14f5d8=_0x6d68[_0x19b834];return _0x14f5d8;};'use strict';var emlformat=require(_0x86d6('0x0'));var rimraf=require(_0x86d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x86d6('0x2'));var rp=require('request-promise');var moment=require(_0x86d6('0x3'));var BPromise=require(_0x86d6('0x4'));var Mustache=require(_0x86d6('0x5'));var util=require(_0x86d6('0x6'));var path=require(_0x86d6('0x7'));var sox=require(_0x86d6('0x8'));var csv=require(_0x86d6('0x9'));var ejs=require(_0x86d6('0xa'));var fs=require('fs');var fs_extra=require(_0x86d6('0xb'));var _=require(_0x86d6('0xc'));var squel=require(_0x86d6('0xd'));var crypto=require(_0x86d6('0xe'));var jsforce=require(_0x86d6('0xf'));var deskjs=require(_0x86d6('0x10'));var toCsv=require(_0x86d6('0x9'));var querystring=require(_0x86d6('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d6('0x12'));var qs=require(_0x86d6('0x13'));var as=require(_0x86d6('0x14'));var hardwareService=require(_0x86d6('0x15'));var logger=require(_0x86d6('0x16'))(_0x86d6('0x17'));var utils=require('../../config/utils');var config=require(_0x86d6('0x18'));var licenseUtil=require(_0x86d6('0x19'));var db=require(_0x86d6('0x1a'))['db'];config['redis']=_[_0x86d6('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x86d6('0x1c')](socket);function respondWithStatusCode(_0x2907f4,_0x1a8fb6){_0x1a8fb6=_0x1a8fb6||0xcc;return function(_0x1d8389){if(_0x1d8389){return _0x2907f4[_0x86d6('0x1d')](_0x1a8fb6);}return _0x2907f4[_0x86d6('0x1e')](_0x1a8fb6)[_0x86d6('0x1f')]();};}function respondWithResult(_0x270175,_0x41a601){_0x41a601=_0x41a601||0xc8;return function(_0x57beb8){if(_0x57beb8){return _0x270175['status'](_0x41a601)[_0x86d6('0x20')](_0x57beb8);}};}function respondWithFilteredResult(_0x521e5a,_0x2d9af2){return function(_0x4a139b){if(_0x4a139b){var _0x4f3a7d=typeof _0x2d9af2[_0x86d6('0x21')]===_0x86d6('0x22')&&typeof _0x2d9af2[_0x86d6('0x23')]===_0x86d6('0x22');var _0x1d44b1=_0x4a139b[_0x86d6('0x24')];var _0x450896=_0x4f3a7d?0x0:_0x2d9af2[_0x86d6('0x21')];var _0x424613=_0x4f3a7d?_0x4a139b[_0x86d6('0x24')]:_0x2d9af2['offset']+_0x2d9af2[_0x86d6('0x23')];var _0x2dc4a9;if(_0x424613>=_0x1d44b1){_0x424613=_0x1d44b1;_0x2dc4a9=0xc8;}else{_0x2dc4a9=0xce;}_0x521e5a[_0x86d6('0x1e')](_0x2dc4a9);return _0x521e5a[_0x86d6('0x25')](_0x86d6('0x26'),_0x450896+'-'+_0x424613+'/'+_0x1d44b1)[_0x86d6('0x20')](_0x4a139b);}return null;};}function patchUpdates(_0x47a47f){return function(_0x8e1056){try{jsonpatch[_0x86d6('0x27')](_0x8e1056,_0x47a47f,!![]);}catch(_0x252ce4){return BPromise[_0x86d6('0x28')](_0x252ce4);}return _0x8e1056[_0x86d6('0x29')]();};}function saveUpdates(_0x202bcc,_0x5e14d6){return function(_0x447bb5){if(_0x447bb5){return _0x447bb5[_0x86d6('0x2a')](_0x202bcc)[_0x86d6('0x2b')](function(_0x546010){return _0x546010;});}return null;};}function removeEntity(_0x567863,_0x1bf830){return function(_0x25bb28){if(_0x25bb28){return _0x25bb28[_0x86d6('0x2c')]()[_0x86d6('0x2b')](function(){var _0x1a0fd6=_0x25bb28[_0x86d6('0x2d')]({'plain':!![]});var _0x5b5b00=_0x86d6('0x2e');return db[_0x86d6('0x2f')][_0x86d6('0x2c')]({'where':{'type':_0x5b5b00,'resourceId':_0x1a0fd6['id']}})['then'](function(){return _0x25bb28;});})[_0x86d6('0x2b')](function(){_0x567863[_0x86d6('0x1e')](0xcc)[_0x86d6('0x1f')]();});}};}function handleEntityNotFound(_0x44502d,_0x363750){return function(_0x26095c){if(!_0x26095c){_0x44502d[_0x86d6('0x1d')](0x194);}return _0x26095c;};}function handleError(_0x1c8313,_0xc45a29){_0xc45a29=_0xc45a29||0x1f4;return function(_0x45e370){logger[_0x86d6('0x30')](_0x45e370[_0x86d6('0x31')]);if(_0x45e370['name']){delete _0x45e370[_0x86d6('0x32')];}_0x1c8313[_0x86d6('0x1e')](_0xc45a29)[_0x86d6('0x33')](_0x45e370);};}exports[_0x86d6('0x34')]=function(_0x3af869,_0x4756ad){var _0x5f51ed={},_0x678209={},_0x229a7b={'count':0x0,'rows':[]};var _0x1cf1f5=_[_0x86d6('0x35')](db['OpenchannelQueue'][_0x86d6('0x36')],function(_0x7f7dcf){return{'name':_0x7f7dcf['fieldName'],'type':_0x7f7dcf['type'][_0x86d6('0x37')]};});_0x678209[_0x86d6('0x38')]=_['map'](_0x1cf1f5,_0x86d6('0x32'));_0x678209[_0x86d6('0x39')]=_[_0x86d6('0x3a')](_0x3af869['query']);_0x678209[_0x86d6('0x3b')]=_['intersection'](_0x678209[_0x86d6('0x38')],_0x678209[_0x86d6('0x39')]);_0x5f51ed['attributes']=_[_0x86d6('0x3c')](_0x678209[_0x86d6('0x38')],qs[_0x86d6('0x3d')](_0x3af869['query'][_0x86d6('0x3d')]));_0x5f51ed[_0x86d6('0x3e')]=_0x5f51ed[_0x86d6('0x3e')][_0x86d6('0x3f')]?_0x5f51ed['attributes']:_0x678209[_0x86d6('0x38')];if(!_0x3af869[_0x86d6('0x39')]['hasOwnProperty'](_0x86d6('0x40'))){_0x5f51ed['limit']=qs[_0x86d6('0x23')](_0x3af869[_0x86d6('0x39')][_0x86d6('0x23')]);_0x5f51ed['offset']=qs[_0x86d6('0x21')](_0x3af869[_0x86d6('0x39')]['offset']);}_0x5f51ed[_0x86d6('0x41')]=qs[_0x86d6('0x42')](_0x3af869[_0x86d6('0x39')][_0x86d6('0x42')]);_0x5f51ed[_0x86d6('0x43')]=qs[_0x86d6('0x3b')](_[_0x86d6('0x44')](_0x3af869[_0x86d6('0x39')],_0x678209[_0x86d6('0x3b')]),_0x1cf1f5);if(_0x3af869[_0x86d6('0x39')][_0x86d6('0x45')]){_0x5f51ed[_0x86d6('0x43')]=_[_0x86d6('0x46')](_0x5f51ed[_0x86d6('0x43')],{'$or':_[_0x86d6('0x35')](_0x1cf1f5,function(_0xff33b){if(_0xff33b[_0x86d6('0x47')]!==_0x86d6('0x48')){var _0x5625da={};_0x5625da[_0xff33b[_0x86d6('0x32')]]={'$like':'%'+_0x3af869[_0x86d6('0x39')][_0x86d6('0x45')]+'%'};return _0x5625da;}})});}_0x5f51ed=_['merge']({},_0x5f51ed,_0x3af869['options']);var _0x45afb1={'where':_0x5f51ed[_0x86d6('0x43')]};return db[_0x86d6('0x49')][_0x86d6('0x24')](_0x45afb1)[_0x86d6('0x2b')](function(_0x27cb58){_0x229a7b[_0x86d6('0x24')]=_0x27cb58;if(_0x3af869[_0x86d6('0x39')]['includeAll']){_0x5f51ed[_0x86d6('0x4a')]=[{'all':!![]}];}return db[_0x86d6('0x49')][_0x86d6('0x4b')](_0x5f51ed);})['then'](function(_0x5b7e08){_0x229a7b[_0x86d6('0x4c')]=_0x5b7e08;return _0x229a7b;})[_0x86d6('0x2b')](respondWithFilteredResult(_0x4756ad,_0x5f51ed))[_0x86d6('0x4d')](handleError(_0x4756ad,null));};exports[_0x86d6('0x4e')]=function(_0x5defe1,_0x5c2224){var _0x181ec2={'raw':!![],'where':{'id':_0x5defe1[_0x86d6('0x4f')]['id']}},_0x588212={};_0x588212[_0x86d6('0x38')]=_['keys'](db['OpenchannelQueue']['rawAttributes']);_0x588212['query']=_[_0x86d6('0x3a')](_0x5defe1[_0x86d6('0x39')]);_0x588212[_0x86d6('0x3b')]=_[_0x86d6('0x3c')](_0x588212[_0x86d6('0x38')],_0x588212[_0x86d6('0x39')]);_0x181ec2[_0x86d6('0x3e')]=_[_0x86d6('0x3c')](_0x588212[_0x86d6('0x38')],qs[_0x86d6('0x3d')](_0x5defe1[_0x86d6('0x39')]['fields']));_0x181ec2[_0x86d6('0x3e')]=_0x181ec2[_0x86d6('0x3e')][_0x86d6('0x3f')]?_0x181ec2[_0x86d6('0x3e')]:_0x588212[_0x86d6('0x38')];if(_0x5defe1[_0x86d6('0x39')][_0x86d6('0x50')]){_0x181ec2[_0x86d6('0x4a')]=[{'all':!![]}];}_0x181ec2=_[_0x86d6('0x46')]({},_0x181ec2,_0x5defe1['options']);return db[_0x86d6('0x49')][_0x86d6('0x51')](_0x181ec2)[_0x86d6('0x2b')](handleEntityNotFound(_0x5c2224,null))['then'](respondWithResult(_0x5c2224,null))[_0x86d6('0x4d')](handleError(_0x5c2224,null));};exports[_0x86d6('0x52')]=function(_0x4c8902,_0x1964fa){return db[_0x86d6('0x49')][_0x86d6('0x52')](_0x4c8902[_0x86d6('0x53')],{})[_0x86d6('0x2b')](function(_0x186496){var _0x5cbd47=_0x4c8902['user'][_0x86d6('0x2d')]({'plain':!![]});if(!_0x5cbd47)throw new Error(_0x86d6('0x54'));if(_0x5cbd47[_0x86d6('0x55')]==='user'){var _0x35118b=_0x186496[_0x86d6('0x2d')]({'plain':!![]});var _0x532015=_0x86d6('0x2e');return db[_0x86d6('0x56')][_0x86d6('0x51')]({'where':{'name':_0x532015,'userProfileId':_0x5cbd47[_0x86d6('0x57')]},'raw':!![]})[_0x86d6('0x2b')](function(_0x5b28e4){if(_0x5b28e4&&_0x5b28e4[_0x86d6('0x58')]===0x0){return db[_0x86d6('0x2f')]['create']({'name':_0x35118b[_0x86d6('0x32')],'resourceId':_0x35118b['id'],'type':_0x5b28e4[_0x86d6('0x32')],'sectionId':_0x5b28e4['id']},{})[_0x86d6('0x2b')](function(){return _0x186496;});}else{return _0x186496;}})[_0x86d6('0x4d')](function(_0x3eb62d){logger[_0x86d6('0x30')](_0x86d6('0x59'),_0x3eb62d);throw _0x3eb62d;});}return _0x186496;})[_0x86d6('0x2b')](respondWithResult(_0x1964fa,0xc9))[_0x86d6('0x4d')](handleError(_0x1964fa,null));};exports['update']=function(_0x32fbf6,_0x3ca27e){if(_0x32fbf6[_0x86d6('0x53')]['id']){delete _0x32fbf6[_0x86d6('0x53')]['id'];}return db[_0x86d6('0x49')][_0x86d6('0x51')]({'where':{'id':_0x32fbf6[_0x86d6('0x4f')]['id']}})[_0x86d6('0x2b')](handleEntityNotFound(_0x3ca27e,null))[_0x86d6('0x2b')](saveUpdates(_0x32fbf6[_0x86d6('0x53')],null))[_0x86d6('0x2b')](respondWithResult(_0x3ca27e,null))[_0x86d6('0x4d')](handleError(_0x3ca27e,null));};exports[_0x86d6('0x2c')]=function(_0x28c7a1,_0x298f4d){return db[_0x86d6('0x49')][_0x86d6('0x51')]({'where':{'id':_0x28c7a1[_0x86d6('0x4f')]['id']}})[_0x86d6('0x2b')](handleEntityNotFound(_0x298f4d,null))['then'](removeEntity(_0x298f4d,null))['catch'](handleError(_0x298f4d,null));};exports['describe']=function(_0x5591cd,_0x2d5de5){return db[_0x86d6('0x49')][_0x86d6('0x5a')]()[_0x86d6('0x2b')](respondWithResult(_0x2d5de5,null))[_0x86d6('0x4d')](handleError(_0x2d5de5,null));};exports['getMembers']=function(_0x1f39f6,_0x123ab3,_0x5d67e4){var _0x57e9e0={'raw':!![],'where':{}},_0x56cc69={},_0x34a037;return db['OpenchannelQueue'][_0x86d6('0x5b')]({'where':{'id':_0x1f39f6[_0x86d6('0x4f')]['id']}})[_0x86d6('0x2b')](handleEntityNotFound(_0x123ab3,null))[_0x86d6('0x2b')](function(_0x4f1d24){if(_0x4f1d24){_0x34a037=_0x4f1d24[_0x86d6('0x2d')]({'plain':!![]});_0x56cc69['model']=_['keys'](db[_0x86d6('0x5c')][_0x86d6('0x36')]);_0x56cc69[_0x86d6('0x39')]=_[_0x86d6('0x3a')](_0x1f39f6[_0x86d6('0x39')]);_0x56cc69[_0x86d6('0x3b')]=_['intersection'](_0x56cc69['model'],_0x56cc69['query']);_0x57e9e0[_0x86d6('0x3e')]=_[_0x86d6('0x3c')](_0x56cc69['model'],qs[_0x86d6('0x3d')](_0x1f39f6[_0x86d6('0x39')][_0x86d6('0x3d')]));_0x57e9e0[_0x86d6('0x3e')]=_0x57e9e0['attributes'][_0x86d6('0x3f')]?_0x57e9e0['attributes']:_0x56cc69['model'];if(!_0x1f39f6[_0x86d6('0x39')][_0x86d6('0x5d')](_0x86d6('0x40'))){_0x57e9e0[_0x86d6('0x23')]=qs[_0x86d6('0x23')](_0x1f39f6[_0x86d6('0x39')][_0x86d6('0x23')]);_0x57e9e0[_0x86d6('0x21')]=qs[_0x86d6('0x21')](_0x1f39f6[_0x86d6('0x39')][_0x86d6('0x21')]);}_0x57e9e0['order']=qs[_0x86d6('0x42')](_0x1f39f6[_0x86d6('0x39')][_0x86d6('0x42')]);_0x57e9e0['where']=qs[_0x86d6('0x3b')](_[_0x86d6('0x44')](_0x1f39f6[_0x86d6('0x39')],_0x56cc69[_0x86d6('0x3b')]));_0x57e9e0[_0x86d6('0x43')][_0x86d6('0x5e')]=_0x4f1d24['id'];if(_0x1f39f6[_0x86d6('0x39')][_0x86d6('0x45')]){_0x57e9e0[_0x86d6('0x43')]=_[_0x86d6('0x46')](_0x57e9e0['where'],{'$or':_[_0x86d6('0x35')](_0x57e9e0[_0x86d6('0x3e')],function(_0x20c095){var _0x3ba303={};_0x3ba303[_0x20c095]={'$like':'%'+_0x1f39f6['query']['filter']+'%'};return _0x3ba303;})});}_0x57e9e0=_['merge']({},_0x57e9e0,_0x1f39f6[_0x86d6('0x5f')]);return db[_0x86d6('0x5c')][_0x86d6('0x4b')](_0x57e9e0);}})['then'](function(_0x34f92e){if(_0x34f92e){return db[_0x86d6('0x60')]['findAndCountAll']({'where':{'id':_[_0x86d6('0x35')](_0x34f92e,'UserId'),'role':_0x86d6('0x61')},'attributes':['id',_0x86d6('0x32'),_0x86d6('0x62'),_0x86d6('0x63'),_0x86d6('0x64')]});}})[_0x86d6('0x2b')](function(_0xfa840a){if(_0xfa840a){return{'count':_0xfa840a[_0x86d6('0x24')],'rows':_[_0x86d6('0x35')](_0xfa840a[_0x86d6('0x4c')],function(_0x3fb14b){return{'membername':_0x3fb14b['name'],'UserId':_0x3fb14b['id'],'queue_name':_0x34a037['name'],'OpenchannelQueueId':_0x34a037['id'],'interface':util[_0x86d6('0x65')](_0x86d6('0x66'),_0x86d6('0x67'),_0x3fb14b[_0x86d6('0x32')]),'penalty':0x0,'paused':_0x3fb14b[_0x86d6('0x62')],'createdAt':_0x3fb14b['createdAt'],'updatedAt':_0x3fb14b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x86d6('0x2b')](respondWithFilteredResult(_0x123ab3,_0x57e9e0))[_0x86d6('0x4d')](handleError(_0x123ab3,null));};exports[_0x86d6('0x68')]=function(_0x186b8a,_0x4e6bae,_0x3138de){var _0x8b3edc={};var _0x5e7636={};var _0x4e071e;var _0x23c584;return db[_0x86d6('0x49')][_0x86d6('0x5b')]({'where':{'id':_0x186b8a[_0x86d6('0x4f')]['id']}})[_0x86d6('0x2b')](handleEntityNotFound(_0x4e6bae,null))[_0x86d6('0x2b')](function(_0x26ea24){if(_0x26ea24){_0x4e071e=_0x26ea24;_0x5e7636[_0x86d6('0x38')]=_[_0x86d6('0x3a')](db[_0x86d6('0x69')][_0x86d6('0x36')]);_0x5e7636[_0x86d6('0x39')]=_[_0x86d6('0x3a')](_0x186b8a['query']);_0x5e7636[_0x86d6('0x3b')]=_[_0x86d6('0x3c')](_0x5e7636['model'],_0x5e7636[_0x86d6('0x39')]);_0x8b3edc['attributes']=_[_0x86d6('0x3c')](_0x5e7636[_0x86d6('0x38')],qs['fields'](_0x186b8a[_0x86d6('0x39')][_0x86d6('0x3d')]));_0x8b3edc['attributes']=_0x8b3edc['attributes'][_0x86d6('0x3f')]?_0x8b3edc[_0x86d6('0x3e')]:_0x5e7636['model'];_0x8b3edc[_0x86d6('0x41')]=qs[_0x86d6('0x42')](_0x186b8a['query'][_0x86d6('0x42')]);_0x8b3edc[_0x86d6('0x43')]=qs[_0x86d6('0x3b')](_['pick'](_0x186b8a['query'],_0x5e7636['filters']));if(_0x186b8a['query']['filter']){_0x8b3edc[_0x86d6('0x43')]=_[_0x86d6('0x46')](_0x8b3edc['where'],{'$or':_['map'](_0x8b3edc[_0x86d6('0x3e')],function(_0x430a26){var _0x139b18={};_0x139b18[_0x430a26]={'$like':'%'+_0x186b8a[_0x86d6('0x39')][_0x86d6('0x45')]+'%'};return _0x139b18;})});}_0x8b3edc=_[_0x86d6('0x46')]({},_0x8b3edc,_0x186b8a[_0x86d6('0x5f')]);return _0x4e071e[_0x86d6('0x68')](_0x8b3edc);}})[_0x86d6('0x2b')](function(_0x55d3c0){if(_0x55d3c0){_0x23c584=_0x55d3c0[_0x86d6('0x3f')];if(!_0x186b8a[_0x86d6('0x39')]['hasOwnProperty'](_0x86d6('0x40'))){_0x8b3edc[_0x86d6('0x23')]=qs[_0x86d6('0x23')](_0x186b8a[_0x86d6('0x39')][_0x86d6('0x23')]);_0x8b3edc[_0x86d6('0x21')]=qs[_0x86d6('0x21')](_0x186b8a['query'][_0x86d6('0x21')]);}return _0x4e071e[_0x86d6('0x68')](_0x8b3edc);}})[_0x86d6('0x2b')](function(_0x489406){if(_0x489406){return _0x489406?{'count':_0x23c584,'rows':_0x489406}:null;}})[_0x86d6('0x2b')](respondWithResult(_0x4e6bae,null))[_0x86d6('0x4d')](handleError(_0x4e6bae,null));};exports['addTeams']=function(_0x41e0cc,_0x4298d8,_0x35e494){var _0x4a522f=_0x41e0cc[_0x86d6('0x53')]['ids'];return db['Team']['findAll']({'where':{'id':_0x4a522f},'attributes':['id'],'include':[{'model':db[_0x86d6('0x60')],'as':_0x86d6('0x6a'),'attributes':['id',_0x86d6('0x32'),_0x86d6('0x6b'),_0x86d6('0x6c'),'interface'],'raw':!![]}]})[_0x86d6('0x2b')](function(_0x9b11a7){if(_0x9b11a7){var _0x41454f=_[_0x86d6('0x6d')](_0x9b11a7,function(_0x9e98d9){var _0x95d969=_0x9e98d9[_0x86d6('0x2d')]({'plain':!![]});return _0x95d969[_0x86d6('0x6a')];});return db[_0x86d6('0x49')][_0x86d6('0x51')]({'where':{'id':_0x41e0cc[_0x86d6('0x4f')]['id']}})[_0x86d6('0x2b')](function(_0x57ae59){return db[_0x86d6('0x6e')][_0x86d6('0x6f')](function(_0x29912d){return _0x57ae59['addTeams'](_0x4a522f,{'transaction':_0x29912d})[_0x86d6('0x2b')](function(){return BPromise[_0x86d6('0x70')](_0x41454f,function(_0xc57590){return db[_0x86d6('0x5c')]['findOrCreate']({'where':{'UserId':_0xc57590['id'],'OpenchannelQueueId':_0x41e0cc['params']['id']},'transaction':_0x29912d});});})[_0x86d6('0x2b')](function(){_0x41454f[_0x86d6('0x71')](function(_0x14455c){socket[_0x86d6('0x72')](_0x86d6('0x73'),{'UserId':_0x14455c['id'],'OpenchannelQueueId':_0x57ae59['id']});});});});});}})[_0x86d6('0x2b')](respondWithStatusCode(_0x4298d8,null))[_0x86d6('0x4d')](handleError(_0x4298d8,null));};exports[_0x86d6('0x74')]=function(_0x2c34e3,_0x58a936,_0x4dc8b0){return db['Team'][_0x86d6('0x4b')]({'where':{'id':_0x2c34e3[_0x86d6('0x39')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x86d6('0x2b')](handleEntityNotFound(_0x58a936,null))[_0x86d6('0x2b')](function(_0x2ed663){var _0x59d78c=_[_0x86d6('0x35')](_0x2ed663,'id');var _0x575b7f=[];var _0x3fd55e=[];var _0x3527d6=squel[_0x86d6('0x75')]();_0x3527d6[_0x86d6('0x76')](_0x86d6('0x77'))[_0x86d6('0x78')]('team_has_openchannel_queues','tq')[_0x86d6('0x79')](_0x86d6('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x86d6('0x43')](_0x86d6('0x7b'),_0x2c34e3[_0x86d6('0x4f')]['id']);for(var _0x527c8c=0x0;_0x527c8c<_0x2ed663[_0x86d6('0x3f')];_0x527c8c+=0x1){let _0x28d549=_0x2ed663[_0x527c8c];for(var _0x59565b=0x0;_0x59565b<_0x28d549['Agents'][_0x86d6('0x3f')];_0x59565b+=0x1){let _0x8b1c97=_0x28d549[_0x86d6('0x6a')][_0x59565b];var _0x2d9023=_0x3527d6[_0x86d6('0x7c')]();_0x2d9023[_0x86d6('0x43')](_0x86d6('0x7d'),_0x8b1c97['id']);_0x3fd55e[_0x86d6('0x7e')](db[_0x86d6('0x6e')][_0x86d6('0x39')](_0x2d9023[_0x86d6('0x7f')](),{'type':db['sequelize']['QueryTypes'][_0x86d6('0x80')]})['then'](function(_0x44496d){if(_0x44496d[_0x86d6('0x3f')]===0x1){return _0x8b1c97['id'];}else{var _0x1b6e74=_[_0x86d6('0x81')](_[_0x86d6('0x35')](_0x44496d,'TeamId'),function(_0x38e83b){return _[_0x86d6('0x82')](_0x59d78c,_0x38e83b);});if(_0x1b6e74){return _0x8b1c97['id'];}}}));}}return BPromise[_0x86d6('0x83')](_0x3fd55e)[_0x86d6('0x2b')](function(_0x4d87d2){_0x575b7f=_(_0x575b7f)[_0x86d6('0x84')](_0x4d87d2)[_0x86d6('0x85')]()[_0x86d6('0x86')]();return db[_0x86d6('0x49')][_0x86d6('0x51')]({'where':{'id':_0x2c34e3[_0x86d6('0x4f')]['id']}})['then'](function(_0x37a84c){return db[_0x86d6('0x6e')][_0x86d6('0x6f')](function(_0x1e08a0){return _0x37a84c[_0x86d6('0x74')](_0x2c34e3['query'][_0x86d6('0x87')],{'transaction':_0x1e08a0})[_0x86d6('0x2b')](function(){if(!_[_0x86d6('0x88')](_0x575b7f)){return _0x37a84c[_0x86d6('0x89')](_0x575b7f,{'transaction':_0x1e08a0});}})[_0x86d6('0x2b')](function(){_0x575b7f[_0x86d6('0x71')](function(_0x3e50ae){socket[_0x86d6('0x72')](_0x86d6('0x8a'),{'UserId':_0x3e50ae,'OpenchannelQueueId':_0x37a84c['id']});});});});});});})[_0x86d6('0x2b')](respondWithStatusCode(_0x58a936,null))[_0x86d6('0x4d')](handleError(_0x58a936,null));};exports['addAgents']=function(_0x2f8be3,_0x3082e2,_0x4094e9){return db['OpenchannelQueue']['find']({'where':{'id':_0x2f8be3['params']['id']}})[_0x86d6('0x2b')](handleEntityNotFound(_0x3082e2,null))['then'](function(_0x18965f){if(_0x18965f){return _0x18965f['addAgents'](_0x2f8be3['body'][_0x86d6('0x87')],_[_0x86d6('0x8b')](_0x2f8be3[_0x86d6('0x53')],[_0x86d6('0x87'),'id'])||{})[_0x86d6('0x8c')](function(_0x1cc816){for(var _0x3efea2=0x0;_0x3efea2<_0x2f8be3['body']['ids'][_0x86d6('0x3f')];_0x3efea2+=0x1){socket[_0x86d6('0x72')](_0x86d6('0x73'),{'UserId':Number(_0x2f8be3[_0x86d6('0x53')][_0x86d6('0x87')][_0x3efea2]),'OpenchannelQueueId':Number(_0x2f8be3[_0x86d6('0x4f')]['id'])});}return _0x1cc816;});}})[_0x86d6('0x2b')](respondWithResult(_0x3082e2,null))[_0x86d6('0x4d')](handleError(_0x3082e2,null));};exports[_0x86d6('0x89')]=function(_0x22348a,_0x1a42fe,_0x4e9770){return db[_0x86d6('0x49')][_0x86d6('0x51')]({'where':{'id':_0x22348a[_0x86d6('0x4f')]['id']}})[_0x86d6('0x2b')](handleEntityNotFound(_0x1a42fe,null))[_0x86d6('0x2b')](function(_0x835b3e){if(_0x835b3e){return _0x835b3e['removeAgents'](_0x22348a['query'][_0x86d6('0x87')])['then'](function(){if(_[_0x86d6('0x8d')](_0x22348a[_0x86d6('0x39')][_0x86d6('0x87')])){for(var _0x1efaee=0x0;_0x1efaee<_0x22348a[_0x86d6('0x39')]['ids']['length'];_0x1efaee+=0x1){socket[_0x86d6('0x72')](_0x86d6('0x8a'),{'UserId':Number(_0x22348a['query'][_0x86d6('0x87')][_0x1efaee]),'OpenchannelQueueId':Number(_0x22348a[_0x86d6('0x4f')]['id'])});}}else{socket[_0x86d6('0x72')](_0x86d6('0x8a'),{'UserId':Number(_0x22348a[_0x86d6('0x39')][_0x86d6('0x87')]),'OpenchannelQueueId':Number(_0x22348a['params']['id'])});}});}})[_0x86d6('0x2b')](respondWithStatusCode(_0x1a42fe,null))[_0x86d6('0x4d')](handleError(_0x1a42fe,null));};exports[_0x86d6('0x8e')]=function(_0x8a8367,_0x69b2ff,_0x4bd02b){var _0x9017a4={};var _0xbf63ee={};var _0x2cf82c;var _0x26842d;return db[_0x86d6('0x49')][_0x86d6('0x5b')]({'where':{'id':_0x8a8367[_0x86d6('0x4f')]['id']}})[_0x86d6('0x2b')](handleEntityNotFound(_0x69b2ff,null))[_0x86d6('0x2b')](function(_0x59b430){if(_0x59b430){_0x2cf82c=_0x59b430;_0xbf63ee[_0x86d6('0x38')]=_[_0x86d6('0x3a')](db[_0x86d6('0x60')][_0x86d6('0x36')]);_0xbf63ee[_0x86d6('0x39')]=_['keys'](_0x8a8367[_0x86d6('0x39')]);_0xbf63ee[_0x86d6('0x3b')]=_[_0x86d6('0x3c')](_0xbf63ee[_0x86d6('0x38')],_0xbf63ee[_0x86d6('0x39')]);_0x9017a4[_0x86d6('0x3e')]=_[_0x86d6('0x3c')](_0xbf63ee[_0x86d6('0x38')],qs[_0x86d6('0x3d')](_0x8a8367[_0x86d6('0x39')][_0x86d6('0x3d')]));_0x9017a4[_0x86d6('0x3e')]=_0x9017a4[_0x86d6('0x3e')]['length']?_0x9017a4[_0x86d6('0x3e')]:_0xbf63ee[_0x86d6('0x38')];_0x9017a4['order']=qs[_0x86d6('0x42')](_0x8a8367[_0x86d6('0x39')][_0x86d6('0x42')]);_0x9017a4[_0x86d6('0x43')]=qs['filters'](_['pick'](_0x8a8367[_0x86d6('0x39')],_0xbf63ee[_0x86d6('0x3b')]));if(_0x8a8367[_0x86d6('0x39')][_0x86d6('0x45')]){_0x9017a4[_0x86d6('0x43')]=_['merge'](_0x9017a4[_0x86d6('0x43')],{'$or':_[_0x86d6('0x35')](_0x9017a4['attributes'],function(_0x15f4d3){var _0x2f93dd={};_0x2f93dd[_0x15f4d3]={'$like':'%'+_0x8a8367['query'][_0x86d6('0x45')]+'%'};return _0x2f93dd;})});}_0x9017a4=_[_0x86d6('0x46')]({},_0x9017a4,_0x8a8367[_0x86d6('0x5f')]);return _0x2cf82c[_0x86d6('0x8e')](_0x9017a4);}})[_0x86d6('0x2b')](function(_0x5ce0ee){if(_0x5ce0ee){_0x26842d=_0x5ce0ee['length'];if(!_0x8a8367[_0x86d6('0x39')]['hasOwnProperty']('nolimit')){_0x9017a4[_0x86d6('0x23')]=qs[_0x86d6('0x23')](_0x8a8367[_0x86d6('0x39')]['limit']);_0x9017a4[_0x86d6('0x21')]=qs[_0x86d6('0x21')](_0x8a8367[_0x86d6('0x39')][_0x86d6('0x21')]);}return _0x2cf82c['getAgents'](_0x9017a4);}})[_0x86d6('0x2b')](function(_0x5b8a54){if(_0x5b8a54){return _0x5b8a54?{'count':_0x26842d,'rows':_0x5b8a54}:null;}})['then'](respondWithResult(_0x69b2ff,null))[_0x86d6('0x4d')](handleError(_0x69b2ff,null));}; \ No newline at end of file +var _0x4146=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','UserProfileResource','error','name','index','map','OpenchannelQueue','rawAttributes','fieldName','key','query','intersection','attributes','model','fields','length','hasOwnProperty','sort','filters','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','show','params','keys','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','order','pick','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format','SIP','Team','nolimit','getTeams','addTeams','voicePause','interface','flatMap','Agents','sequelize','each','forEach','emit','removeTeams','ids','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','transaction','removeAgents','addAgents','omit','spread','userOpenchannelQueue:save','isArray','userOpenchannelQueue:remove','getAgents','eml-format'];(function(_0x39b6ca,_0x31568e){var _0xc9c561=function(_0x4261af){while(--_0x4261af){_0x39b6ca['push'](_0x39b6ca['shift']());}};_0xc9c561(++_0x31568e);}(_0x4146,0x1a0));var _0x6414=function(_0x54c1c8,_0xecaab2){_0x54c1c8=_0x54c1c8-0x0;var _0x360b21=_0x4146[_0x54c1c8];return _0x360b21;};'use strict';var emlformat=require(_0x6414('0x0'));var rimraf=require(_0x6414('0x1'));var zipdir=require(_0x6414('0x2'));var jsonpatch=require(_0x6414('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6414('0x4'));var Mustache=require(_0x6414('0x5'));var util=require('util');var path=require(_0x6414('0x6'));var sox=require(_0x6414('0x7'));var csv=require(_0x6414('0x8'));var ejs=require(_0x6414('0x9'));var fs=require('fs');var fs_extra=require(_0x6414('0xa'));var _=require(_0x6414('0xb'));var squel=require('squel');var crypto=require(_0x6414('0xc'));var jsforce=require(_0x6414('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6414('0xe'));var Redis=require('ioredis');var authService=require(_0x6414('0xf'));var qs=require(_0x6414('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6414('0x11'));var logger=require(_0x6414('0x12'))(_0x6414('0x13'));var utils=require('../../config/utils');var config=require(_0x6414('0x14'));var licenseUtil=require(_0x6414('0x15'));var db=require(_0x6414('0x16'))['db'];config[_0x6414('0x17')]=_[_0x6414('0x18')](config[_0x6414('0x17')],{'host':_0x6414('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6414('0x17')]));require('./openchannelQueue.socket')[_0x6414('0x1a')](socket);function respondWithStatusCode(_0x36dc50,_0x23a97b){_0x23a97b=_0x23a97b||0xcc;return function(_0xbdd1f2){if(_0xbdd1f2){return _0x36dc50[_0x6414('0x1b')](_0x23a97b);}return _0x36dc50['status'](_0x23a97b)[_0x6414('0x1c')]();};}function respondWithResult(_0x533b4c,_0x212d47){_0x212d47=_0x212d47||0xc8;return function(_0x519c04){if(_0x519c04){return _0x533b4c[_0x6414('0x1d')](_0x212d47)[_0x6414('0x1e')](_0x519c04);}};}function respondWithFilteredResult(_0x546039,_0x42c5e8){return function(_0x2d7591){if(_0x2d7591){var _0x10db64=typeof _0x42c5e8[_0x6414('0x1f')]===_0x6414('0x20')&&typeof _0x42c5e8[_0x6414('0x21')]===_0x6414('0x20');var _0x36b4ac=_0x2d7591[_0x6414('0x22')];var _0x3a363f=_0x10db64?0x0:_0x42c5e8[_0x6414('0x1f')];var _0x273fe8=_0x10db64?_0x2d7591[_0x6414('0x22')]:_0x42c5e8['offset']+_0x42c5e8[_0x6414('0x21')];var _0x58f11a;if(_0x273fe8>=_0x36b4ac){_0x273fe8=_0x36b4ac;_0x58f11a=0xc8;}else{_0x58f11a=0xce;}_0x546039[_0x6414('0x1d')](_0x58f11a);return _0x546039[_0x6414('0x23')]('Content-Range',_0x3a363f+'-'+_0x273fe8+'/'+_0x36b4ac)[_0x6414('0x1e')](_0x2d7591);}return null;};}function patchUpdates(_0x309238){return function(_0x501914){try{jsonpatch[_0x6414('0x24')](_0x501914,_0x309238,!![]);}catch(_0x142684){return BPromise[_0x6414('0x25')](_0x142684);}return _0x501914['save']();};}function saveUpdates(_0x2fdfa7,_0x406831){return function(_0x14fdd6){if(_0x14fdd6){return _0x14fdd6[_0x6414('0x26')](_0x2fdfa7)['then'](function(_0x518a59){return _0x518a59;});}return null;};}function removeEntity(_0x123657,_0x549a10){return function(_0x21ed06){if(_0x21ed06){return _0x21ed06[_0x6414('0x27')]()[_0x6414('0x28')](function(){var _0x204fa9=_0x21ed06['get']({'plain':!![]});var _0x568f96='OpenchannelQueues';return db[_0x6414('0x29')]['destroy']({'where':{'type':_0x568f96,'resourceId':_0x204fa9['id']}})['then'](function(){return _0x21ed06;});})[_0x6414('0x28')](function(){_0x123657[_0x6414('0x1d')](0xcc)[_0x6414('0x1c')]();});}};}function handleEntityNotFound(_0x4813ee,_0x44349a){return function(_0x386150){if(!_0x386150){_0x4813ee[_0x6414('0x1b')](0x194);}return _0x386150;};}function handleError(_0x230138,_0x5eeeba){_0x5eeeba=_0x5eeeba||0x1f4;return function(_0x3fbc85){logger[_0x6414('0x2a')](_0x3fbc85['stack']);if(_0x3fbc85[_0x6414('0x2b')]){delete _0x3fbc85[_0x6414('0x2b')];}_0x230138[_0x6414('0x1d')](_0x5eeeba)['send'](_0x3fbc85);};}exports[_0x6414('0x2c')]=function(_0x5555c0,_0x251ac2){var _0x48b0a6={},_0x116652={},_0x548354={'count':0x0,'rows':[]};var _0x5e36fc=_[_0x6414('0x2d')](db[_0x6414('0x2e')][_0x6414('0x2f')],function(_0x1c0153){return{'name':_0x1c0153[_0x6414('0x30')],'type':_0x1c0153['type'][_0x6414('0x31')]};});_0x116652['model']=_[_0x6414('0x2d')](_0x5e36fc,_0x6414('0x2b'));_0x116652['query']=_['keys'](_0x5555c0[_0x6414('0x32')]);_0x116652['filters']=_[_0x6414('0x33')](_0x116652['model'],_0x116652['query']);_0x48b0a6[_0x6414('0x34')]=_['intersection'](_0x116652[_0x6414('0x35')],qs[_0x6414('0x36')](_0x5555c0['query'][_0x6414('0x36')]));_0x48b0a6[_0x6414('0x34')]=_0x48b0a6[_0x6414('0x34')][_0x6414('0x37')]?_0x48b0a6['attributes']:_0x116652['model'];if(!_0x5555c0[_0x6414('0x32')][_0x6414('0x38')]('nolimit')){_0x48b0a6[_0x6414('0x21')]=qs[_0x6414('0x21')](_0x5555c0[_0x6414('0x32')][_0x6414('0x21')]);_0x48b0a6[_0x6414('0x1f')]=qs['offset'](_0x5555c0['query'][_0x6414('0x1f')]);}_0x48b0a6['order']=qs[_0x6414('0x39')](_0x5555c0[_0x6414('0x32')][_0x6414('0x39')]);_0x48b0a6['where']=qs[_0x6414('0x3a')](_['pick'](_0x5555c0['query'],_0x116652['filters']),_0x5e36fc);if(_0x5555c0['query'][_0x6414('0x3b')]){_0x48b0a6[_0x6414('0x3c')]=_[_0x6414('0x3d')](_0x48b0a6['where'],{'$or':_[_0x6414('0x2d')](_0x5e36fc,function(_0x4e47dd){if(_0x4e47dd[_0x6414('0x3e')]!==_0x6414('0x3f')){var _0x501588={};_0x501588[_0x4e47dd[_0x6414('0x2b')]]={'$like':'%'+_0x5555c0[_0x6414('0x32')][_0x6414('0x3b')]+'%'};return _0x501588;}})});}_0x48b0a6=_[_0x6414('0x3d')]({},_0x48b0a6,_0x5555c0[_0x6414('0x40')]);var _0x5003df={'where':_0x48b0a6['where']};return db[_0x6414('0x2e')][_0x6414('0x22')](_0x5003df)[_0x6414('0x28')](function(_0x1d645a){_0x548354['count']=_0x1d645a;if(_0x5555c0[_0x6414('0x32')]['includeAll']){_0x48b0a6[_0x6414('0x41')]=[{'all':!![]}];}return db[_0x6414('0x2e')][_0x6414('0x42')](_0x48b0a6);})['then'](function(_0x172925){_0x548354[_0x6414('0x43')]=_0x172925;return _0x548354;})[_0x6414('0x28')](respondWithFilteredResult(_0x251ac2,_0x48b0a6))['catch'](handleError(_0x251ac2,null));};exports[_0x6414('0x44')]=function(_0x90efb5,_0x2e82ba){var _0x2da323={'raw':!![],'where':{'id':_0x90efb5[_0x6414('0x45')]['id']}},_0x421d86={};_0x421d86[_0x6414('0x35')]=_[_0x6414('0x46')](db['OpenchannelQueue'][_0x6414('0x2f')]);_0x421d86[_0x6414('0x32')]=_[_0x6414('0x46')](_0x90efb5['query']);_0x421d86[_0x6414('0x3a')]=_[_0x6414('0x33')](_0x421d86[_0x6414('0x35')],_0x421d86[_0x6414('0x32')]);_0x2da323[_0x6414('0x34')]=_[_0x6414('0x33')](_0x421d86[_0x6414('0x35')],qs[_0x6414('0x36')](_0x90efb5[_0x6414('0x32')]['fields']));_0x2da323[_0x6414('0x34')]=_0x2da323[_0x6414('0x34')][_0x6414('0x37')]?_0x2da323[_0x6414('0x34')]:_0x421d86['model'];if(_0x90efb5[_0x6414('0x32')]['includeAll']){_0x2da323[_0x6414('0x41')]=[{'all':!![]}];}_0x2da323=_[_0x6414('0x3d')]({},_0x2da323,_0x90efb5[_0x6414('0x40')]);return db[_0x6414('0x2e')][_0x6414('0x47')](_0x2da323)['then'](handleEntityNotFound(_0x2e82ba,null))[_0x6414('0x28')](respondWithResult(_0x2e82ba,null))[_0x6414('0x48')](handleError(_0x2e82ba,null));};exports['create']=function(_0x514649,_0x37488e){return db[_0x6414('0x2e')][_0x6414('0x49')](_0x514649[_0x6414('0x4a')],{})[_0x6414('0x28')](function(_0x2cc336){var _0x254e0d=_0x514649[_0x6414('0x4b')][_0x6414('0x4c')]({'plain':!![]});if(!_0x254e0d)throw new Error(_0x6414('0x4d'));if(_0x254e0d[_0x6414('0x4e')]===_0x6414('0x4b')){var _0x2bd607=_0x2cc336[_0x6414('0x4c')]({'plain':!![]});var _0x201f9a='OpenchannelQueues';return db[_0x6414('0x4f')][_0x6414('0x47')]({'where':{'name':_0x201f9a,'userProfileId':_0x254e0d[_0x6414('0x50')]},'raw':!![]})[_0x6414('0x28')](function(_0x2974d1){if(_0x2974d1&&_0x2974d1[_0x6414('0x51')]===0x0){return db[_0x6414('0x29')][_0x6414('0x49')]({'name':_0x2bd607['name'],'resourceId':_0x2bd607['id'],'type':_0x2974d1['name'],'sectionId':_0x2974d1['id']},{})['then'](function(){return _0x2cc336;});}else{return _0x2cc336;}})['catch'](function(_0x162170){logger[_0x6414('0x2a')](_0x6414('0x52'),_0x162170);throw _0x162170;});}return _0x2cc336;})[_0x6414('0x28')](respondWithResult(_0x37488e,0xc9))['catch'](handleError(_0x37488e,null));};exports[_0x6414('0x26')]=function(_0x5c604f,_0x2f9208){if(_0x5c604f['body']['id']){delete _0x5c604f['body']['id'];}return db[_0x6414('0x2e')]['find']({'where':{'id':_0x5c604f[_0x6414('0x45')]['id']}})[_0x6414('0x28')](handleEntityNotFound(_0x2f9208,null))[_0x6414('0x28')](saveUpdates(_0x5c604f['body'],null))[_0x6414('0x28')](respondWithResult(_0x2f9208,null))['catch'](handleError(_0x2f9208,null));};exports[_0x6414('0x27')]=function(_0x190af2,_0x39ae35){return db[_0x6414('0x2e')]['find']({'where':{'id':_0x190af2[_0x6414('0x45')]['id']}})[_0x6414('0x28')](handleEntityNotFound(_0x39ae35,null))[_0x6414('0x28')](removeEntity(_0x39ae35,null))[_0x6414('0x48')](handleError(_0x39ae35,null));};exports[_0x6414('0x53')]=function(_0x4890f4,_0x88c0ae){return db[_0x6414('0x2e')][_0x6414('0x53')]()[_0x6414('0x28')](respondWithResult(_0x88c0ae,null))[_0x6414('0x48')](handleError(_0x88c0ae,null));};exports[_0x6414('0x54')]=function(_0xe0aa48,_0x25453c,_0x42ebb4){var _0x546d4d={'raw':!![],'where':{}},_0x1263f3={},_0x381d90;return db[_0x6414('0x2e')][_0x6414('0x55')]({'where':{'id':_0xe0aa48[_0x6414('0x45')]['id']}})['then'](handleEntityNotFound(_0x25453c,null))['then'](function(_0x2d3035){if(_0x2d3035){_0x381d90=_0x2d3035[_0x6414('0x4c')]({'plain':!![]});_0x1263f3['model']=_['keys'](db[_0x6414('0x56')][_0x6414('0x2f')]);_0x1263f3[_0x6414('0x32')]=_[_0x6414('0x46')](_0xe0aa48['query']);_0x1263f3[_0x6414('0x3a')]=_['intersection'](_0x1263f3['model'],_0x1263f3[_0x6414('0x32')]);_0x546d4d[_0x6414('0x34')]=_[_0x6414('0x33')](_0x1263f3['model'],qs[_0x6414('0x36')](_0xe0aa48[_0x6414('0x32')]['fields']));_0x546d4d[_0x6414('0x34')]=_0x546d4d[_0x6414('0x34')][_0x6414('0x37')]?_0x546d4d[_0x6414('0x34')]:_0x1263f3[_0x6414('0x35')];if(!_0xe0aa48[_0x6414('0x32')][_0x6414('0x38')]('nolimit')){_0x546d4d[_0x6414('0x21')]=qs['limit'](_0xe0aa48[_0x6414('0x32')]['limit']);_0x546d4d[_0x6414('0x1f')]=qs[_0x6414('0x1f')](_0xe0aa48[_0x6414('0x32')]['offset']);}_0x546d4d[_0x6414('0x57')]=qs[_0x6414('0x39')](_0xe0aa48[_0x6414('0x32')][_0x6414('0x39')]);_0x546d4d[_0x6414('0x3c')]=qs[_0x6414('0x3a')](_[_0x6414('0x58')](_0xe0aa48[_0x6414('0x32')],_0x1263f3['filters']));_0x546d4d[_0x6414('0x3c')][_0x6414('0x59')]=_0x2d3035['id'];if(_0xe0aa48[_0x6414('0x32')][_0x6414('0x3b')]){_0x546d4d[_0x6414('0x3c')]=_[_0x6414('0x3d')](_0x546d4d[_0x6414('0x3c')],{'$or':_['map'](_0x546d4d[_0x6414('0x34')],function(_0x571f32){var _0x6dfacf={};_0x6dfacf[_0x571f32]={'$like':'%'+_0xe0aa48[_0x6414('0x32')][_0x6414('0x3b')]+'%'};return _0x6dfacf;})});}_0x546d4d=_['merge']({},_0x546d4d,_0xe0aa48['options']);return db[_0x6414('0x56')]['findAll'](_0x546d4d);}})['then'](function(_0x18fd1b){if(_0x18fd1b){return db[_0x6414('0x5a')][_0x6414('0x5b')]({'where':{'id':_[_0x6414('0x2d')](_0x18fd1b,_0x6414('0x5c')),'role':'agent'},'attributes':['id',_0x6414('0x2b'),_0x6414('0x5d'),_0x6414('0x5e'),_0x6414('0x5f')]});}})['then'](function(_0x46ff52){if(_0x46ff52){return{'count':_0x46ff52[_0x6414('0x22')],'rows':_['map'](_0x46ff52[_0x6414('0x43')],function(_0x2e2a91){return{'membername':_0x2e2a91[_0x6414('0x2b')],'UserId':_0x2e2a91['id'],'queue_name':_0x381d90[_0x6414('0x2b')],'OpenchannelQueueId':_0x381d90['id'],'interface':util[_0x6414('0x60')]('%s/%s',_0x6414('0x61'),_0x2e2a91[_0x6414('0x2b')]),'penalty':0x0,'paused':_0x2e2a91[_0x6414('0x5d')],'createdAt':_0x2e2a91[_0x6414('0x5f')],'updatedAt':_0x2e2a91[_0x6414('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6414('0x28')](respondWithFilteredResult(_0x25453c,_0x546d4d))[_0x6414('0x48')](handleError(_0x25453c,null));};exports['getTeams']=function(_0x1f14f9,_0x3da011,_0x215881){var _0x351a27={};var _0x850c4b={};var _0x52b9b1;var _0x1c3c9b;return db[_0x6414('0x2e')]['findOne']({'where':{'id':_0x1f14f9[_0x6414('0x45')]['id']}})[_0x6414('0x28')](handleEntityNotFound(_0x3da011,null))[_0x6414('0x28')](function(_0x2da05f){if(_0x2da05f){_0x52b9b1=_0x2da05f;_0x850c4b[_0x6414('0x35')]=_['keys'](db[_0x6414('0x62')][_0x6414('0x2f')]);_0x850c4b[_0x6414('0x32')]=_[_0x6414('0x46')](_0x1f14f9[_0x6414('0x32')]);_0x850c4b[_0x6414('0x3a')]=_[_0x6414('0x33')](_0x850c4b['model'],_0x850c4b[_0x6414('0x32')]);_0x351a27[_0x6414('0x34')]=_['intersection'](_0x850c4b[_0x6414('0x35')],qs[_0x6414('0x36')](_0x1f14f9[_0x6414('0x32')][_0x6414('0x36')]));_0x351a27[_0x6414('0x34')]=_0x351a27[_0x6414('0x34')][_0x6414('0x37')]?_0x351a27[_0x6414('0x34')]:_0x850c4b[_0x6414('0x35')];_0x351a27[_0x6414('0x57')]=qs[_0x6414('0x39')](_0x1f14f9['query'][_0x6414('0x39')]);_0x351a27[_0x6414('0x3c')]=qs[_0x6414('0x3a')](_[_0x6414('0x58')](_0x1f14f9[_0x6414('0x32')],_0x850c4b[_0x6414('0x3a')]));if(_0x1f14f9[_0x6414('0x32')][_0x6414('0x3b')]){_0x351a27[_0x6414('0x3c')]=_[_0x6414('0x3d')](_0x351a27[_0x6414('0x3c')],{'$or':_[_0x6414('0x2d')](_0x351a27['attributes'],function(_0x23422d){var _0x2fd932={};_0x2fd932[_0x23422d]={'$like':'%'+_0x1f14f9[_0x6414('0x32')][_0x6414('0x3b')]+'%'};return _0x2fd932;})});}_0x351a27=_[_0x6414('0x3d')]({},_0x351a27,_0x1f14f9[_0x6414('0x40')]);return _0x52b9b1['getTeams'](_0x351a27);}})[_0x6414('0x28')](function(_0x505400){if(_0x505400){_0x1c3c9b=_0x505400[_0x6414('0x37')];if(!_0x1f14f9[_0x6414('0x32')]['hasOwnProperty'](_0x6414('0x63'))){_0x351a27[_0x6414('0x21')]=qs[_0x6414('0x21')](_0x1f14f9[_0x6414('0x32')][_0x6414('0x21')]);_0x351a27['offset']=qs[_0x6414('0x1f')](_0x1f14f9[_0x6414('0x32')][_0x6414('0x1f')]);}return _0x52b9b1[_0x6414('0x64')](_0x351a27);}})['then'](function(_0x2e73a4){if(_0x2e73a4){return _0x2e73a4?{'count':_0x1c3c9b,'rows':_0x2e73a4}:null;}})[_0x6414('0x28')](respondWithResult(_0x3da011,null))[_0x6414('0x48')](handleError(_0x3da011,null));};exports[_0x6414('0x65')]=function(_0x3aca42,_0xd3ff9e,_0xa1b4c8){var _0x1ffc50=_0x3aca42[_0x6414('0x4a')]['ids'];return db[_0x6414('0x62')][_0x6414('0x42')]({'where':{'id':_0x1ffc50},'attributes':['id'],'include':[{'model':db[_0x6414('0x5a')],'as':'Agents','attributes':['id',_0x6414('0x2b'),'online',_0x6414('0x66'),_0x6414('0x67')],'raw':!![]}]})[_0x6414('0x28')](function(_0x24904f){if(_0x24904f){var _0x2c5617=_[_0x6414('0x68')](_0x24904f,function(_0x4f4bd7){var _0x52c653=_0x4f4bd7[_0x6414('0x4c')]({'plain':!![]});return _0x52c653[_0x6414('0x69')];});return db[_0x6414('0x2e')]['find']({'where':{'id':_0x3aca42['params']['id']}})['then'](function(_0x31f785){return db[_0x6414('0x6a')]['transaction'](function(_0x14e2f3){return _0x31f785['addTeams'](_0x1ffc50,{'transaction':_0x14e2f3})[_0x6414('0x28')](function(){return BPromise[_0x6414('0x6b')](_0x2c5617,function(_0xee32a9){return db[_0x6414('0x56')]['findOrCreate']({'where':{'UserId':_0xee32a9['id'],'OpenchannelQueueId':_0x3aca42[_0x6414('0x45')]['id']},'transaction':_0x14e2f3});});})[_0x6414('0x28')](function(){_0x2c5617[_0x6414('0x6c')](function(_0x16ee38){socket[_0x6414('0x6d')]('userOpenchannelQueue:save',{'UserId':_0x16ee38['id'],'OpenchannelQueueId':_0x31f785['id']});});});});});}})[_0x6414('0x28')](respondWithStatusCode(_0xd3ff9e,null))['catch'](handleError(_0xd3ff9e,null));};exports[_0x6414('0x6e')]=function(_0x4136e8,_0xe98809,_0x188d90){return db[_0x6414('0x62')][_0x6414('0x42')]({'where':{'id':_0x4136e8['query'][_0x6414('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x6414('0x5a')],'as':_0x6414('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xe98809,null))['then'](function(_0x31a63d){var _0x145a5f=_['map'](_0x31a63d,'id');var _0x5869d1=[];var _0x4351cc=[];var _0x179f0c=squel[_0x6414('0x70')]();_0x179f0c[_0x6414('0x71')]('tq.TeamId')[_0x6414('0x72')](_0x6414('0x73'),'tq')[_0x6414('0x74')](_0x6414('0x75'),'ut',_0x6414('0x76'))['where']('OpenchannelQueueId\x20=\x20?',_0x4136e8[_0x6414('0x45')]['id']);for(var _0x3012c4=0x0;_0x3012c4<_0x31a63d[_0x6414('0x37')];_0x3012c4+=0x1){let _0x338e2d=_0x31a63d[_0x3012c4];for(var _0x3f0511=0x0;_0x3f0511<_0x338e2d['Agents']['length'];_0x3f0511+=0x1){let _0x2deff5=_0x338e2d['Agents'][_0x3f0511];var _0x5771ac=_0x179f0c[_0x6414('0x77')]();_0x5771ac[_0x6414('0x3c')](_0x6414('0x78'),_0x2deff5['id']);_0x4351cc[_0x6414('0x79')](db['sequelize'][_0x6414('0x32')](_0x5771ac['toString'](),{'type':db[_0x6414('0x6a')][_0x6414('0x7a')][_0x6414('0x7b')]})[_0x6414('0x28')](function(_0x44f9e5){if(_0x44f9e5[_0x6414('0x37')]===0x1){return _0x2deff5['id'];}else{var _0x1e76d2=_['every'](_[_0x6414('0x2d')](_0x44f9e5,_0x6414('0x7c')),function(_0x6e71aa){return _[_0x6414('0x7d')](_0x145a5f,_0x6e71aa);});if(_0x1e76d2){return _0x2deff5['id'];}}}));}}return BPromise[_0x6414('0x7e')](_0x4351cc)[_0x6414('0x28')](function(_0x575b29){_0x5869d1=_(_0x5869d1)[_0x6414('0x7f')](_0x575b29)[_0x6414('0x80')]()[_0x6414('0x81')]();return db['OpenchannelQueue'][_0x6414('0x47')]({'where':{'id':_0x4136e8['params']['id']}})[_0x6414('0x28')](function(_0x31aaeb){return db[_0x6414('0x6a')][_0x6414('0x82')](function(_0x14bc16){return _0x31aaeb[_0x6414('0x6e')](_0x4136e8['query'][_0x6414('0x6f')],{'transaction':_0x14bc16})[_0x6414('0x28')](function(){if(!_['isEmpty'](_0x5869d1)){return _0x31aaeb[_0x6414('0x83')](_0x5869d1,{'transaction':_0x14bc16});}})[_0x6414('0x28')](function(){_0x5869d1[_0x6414('0x6c')](function(_0x53db7a){socket[_0x6414('0x6d')]('userOpenchannelQueue:remove',{'UserId':_0x53db7a,'OpenchannelQueueId':_0x31aaeb['id']});});});});});});})[_0x6414('0x28')](respondWithStatusCode(_0xe98809,null))[_0x6414('0x48')](handleError(_0xe98809,null));};exports[_0x6414('0x84')]=function(_0x1924c0,_0x2c9e3a,_0x32d425){return db[_0x6414('0x2e')][_0x6414('0x47')]({'where':{'id':_0x1924c0[_0x6414('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c9e3a,null))['then'](function(_0x321438){if(_0x321438){return _0x321438['addAgents'](_0x1924c0['body'][_0x6414('0x6f')],_[_0x6414('0x85')](_0x1924c0[_0x6414('0x4a')],['ids','id'])||{})[_0x6414('0x86')](function(_0x3655bf){for(var _0x2f5254=0x0;_0x2f5254<_0x1924c0[_0x6414('0x4a')][_0x6414('0x6f')]['length'];_0x2f5254+=0x1){socket['emit'](_0x6414('0x87'),{'UserId':Number(_0x1924c0[_0x6414('0x4a')]['ids'][_0x2f5254]),'OpenchannelQueueId':Number(_0x1924c0[_0x6414('0x45')]['id'])});}return _0x3655bf;});}})[_0x6414('0x28')](respondWithResult(_0x2c9e3a,null))[_0x6414('0x48')](handleError(_0x2c9e3a,null));};exports[_0x6414('0x83')]=function(_0x3e5e80,_0x29463e,_0x3e902d){return db[_0x6414('0x2e')][_0x6414('0x47')]({'where':{'id':_0x3e5e80['params']['id']}})[_0x6414('0x28')](handleEntityNotFound(_0x29463e,null))['then'](function(_0x20d6fd){if(_0x20d6fd){return _0x20d6fd[_0x6414('0x83')](_0x3e5e80['query'][_0x6414('0x6f')])['then'](function(){if(_[_0x6414('0x88')](_0x3e5e80['query']['ids'])){for(var _0x575d2f=0x0;_0x575d2f<_0x3e5e80[_0x6414('0x32')][_0x6414('0x6f')][_0x6414('0x37')];_0x575d2f+=0x1){socket[_0x6414('0x6d')]('userOpenchannelQueue:remove',{'UserId':Number(_0x3e5e80[_0x6414('0x32')][_0x6414('0x6f')][_0x575d2f]),'OpenchannelQueueId':Number(_0x3e5e80[_0x6414('0x45')]['id'])});}}else{socket[_0x6414('0x6d')](_0x6414('0x89'),{'UserId':Number(_0x3e5e80[_0x6414('0x32')][_0x6414('0x6f')]),'OpenchannelQueueId':Number(_0x3e5e80[_0x6414('0x45')]['id'])});}});}})[_0x6414('0x28')](respondWithStatusCode(_0x29463e,null))[_0x6414('0x48')](handleError(_0x29463e,null));};exports['getAgents']=function(_0x49a55d,_0x105752,_0x24e6a3){var _0x22f32b={};var _0x4f20dd={};var _0x57c8a8;var _0x38e96c;return db['OpenchannelQueue'][_0x6414('0x55')]({'where':{'id':_0x49a55d['params']['id']}})['then'](handleEntityNotFound(_0x105752,null))[_0x6414('0x28')](function(_0x18fde5){if(_0x18fde5){_0x57c8a8=_0x18fde5;_0x4f20dd[_0x6414('0x35')]=_[_0x6414('0x46')](db[_0x6414('0x5a')][_0x6414('0x2f')]);_0x4f20dd[_0x6414('0x32')]=_['keys'](_0x49a55d[_0x6414('0x32')]);_0x4f20dd[_0x6414('0x3a')]=_[_0x6414('0x33')](_0x4f20dd[_0x6414('0x35')],_0x4f20dd[_0x6414('0x32')]);_0x22f32b[_0x6414('0x34')]=_['intersection'](_0x4f20dd[_0x6414('0x35')],qs['fields'](_0x49a55d[_0x6414('0x32')]['fields']));_0x22f32b[_0x6414('0x34')]=_0x22f32b[_0x6414('0x34')][_0x6414('0x37')]?_0x22f32b['attributes']:_0x4f20dd[_0x6414('0x35')];_0x22f32b[_0x6414('0x57')]=qs[_0x6414('0x39')](_0x49a55d['query'][_0x6414('0x39')]);_0x22f32b[_0x6414('0x3c')]=qs[_0x6414('0x3a')](_['pick'](_0x49a55d[_0x6414('0x32')],_0x4f20dd[_0x6414('0x3a')]));if(_0x49a55d['query']['filter']){_0x22f32b[_0x6414('0x3c')]=_[_0x6414('0x3d')](_0x22f32b[_0x6414('0x3c')],{'$or':_['map'](_0x22f32b['attributes'],function(_0x36d946){var _0x37256e={};_0x37256e[_0x36d946]={'$like':'%'+_0x49a55d[_0x6414('0x32')][_0x6414('0x3b')]+'%'};return _0x37256e;})});}_0x22f32b=_[_0x6414('0x3d')]({},_0x22f32b,_0x49a55d[_0x6414('0x40')]);return _0x57c8a8[_0x6414('0x8a')](_0x22f32b);}})['then'](function(_0x227976){if(_0x227976){_0x38e96c=_0x227976[_0x6414('0x37')];if(!_0x49a55d[_0x6414('0x32')][_0x6414('0x38')](_0x6414('0x63'))){_0x22f32b['limit']=qs['limit'](_0x49a55d[_0x6414('0x32')][_0x6414('0x21')]);_0x22f32b[_0x6414('0x1f')]=qs[_0x6414('0x1f')](_0x49a55d[_0x6414('0x32')][_0x6414('0x1f')]);}return _0x57c8a8[_0x6414('0x8a')](_0x22f32b);}})['then'](function(_0x1d5526){if(_0x1d5526){return _0x1d5526?{'count':_0x38e96c,'rows':_0x1d5526}:null;}})[_0x6414('0x28')](respondWithResult(_0x105752,null))[_0x6414('0x48')](handleError(_0x105752,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 98d1714..9da1841 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 _0x6865=['save','update','emit','hook','exports','events','OpenchannelQueue','setMaxListeners'];(function(_0x3f7598,_0x212e37){var _0x51fb16=function(_0x4a5c0b){while(--_0x4a5c0b){_0x3f7598['push'](_0x3f7598['shift']());}};_0x51fb16(++_0x212e37);}(_0x6865,0x12d));var _0x5686=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6865[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x5686('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x5686('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x5686('0x2')](0x0);var events={'afterCreate':_0x5686('0x3'),'afterUpdate':_0x5686('0x4'),'afterDestroy':'remove'};function emitEvent(_0x43174c){return function(_0x137763,_0x384e42,_0x55732a){OpenchannelQueueEvents[_0x5686('0x5')](_0x43174c+':'+_0x137763['id'],_0x137763);OpenchannelQueueEvents['emit'](_0x43174c,_0x137763);_0x55732a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x5686('0x6')](e,emitEvent(event));}}module[_0x5686('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x471f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove'];(function(_0xe8f68f,_0x32e7c3){var _0x15a1d9=function(_0x972d0e){while(--_0x972d0e){_0xe8f68f['push'](_0xe8f68f['shift']());}};_0x15a1d9(++_0x32e7c3);}(_0x471f,0x1bc));var _0xf471=function(_0x3bb7b7,_0x5236ae){_0x3bb7b7=_0x3bb7b7-0x0;var _0x925e91=_0x471f[_0x3bb7b7];return _0x925e91;};'use strict';var EventEmitter=require(_0xf471('0x0'));var OpenchannelQueue=require(_0xf471('0x1'))['db'][_0xf471('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xf471('0x3')](0x0);var events={'afterCreate':_0xf471('0x4'),'afterUpdate':_0xf471('0x5'),'afterDestroy':_0xf471('0x6')};function emitEvent(_0x29fcb2){return function(_0x35750f,_0x3a6c47,_0x3d667d){OpenchannelQueueEvents['emit'](_0x29fcb2+':'+_0x35750f['id'],_0x35750f);OpenchannelQueueEvents[_0xf471('0x7')](_0x29fcb2,_0x35750f);_0x3d667d(null);};}for(var e in events){if(events[_0xf471('0x8')](e)){var event=events[e];OpenchannelQueue[_0xf471('0x9')](e,emitEvent(event));}}module[_0xf471('0xa')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 7b6d59d..56a6be2 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 _0x96fc=['moment','bluebird','request-promise','path','rimraf','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x18a596,_0x328cda){var _0x4aae62=function(_0x46682b){while(--_0x46682b){_0x18a596['push'](_0x18a596['shift']());}};_0x4aae62(++_0x328cda);}(_0x96fc,0xe6));var _0xc96f=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x96fc[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xc96f('0x0'));var util=require(_0xc96f('0x1'));var logger=require(_0xc96f('0x2'))(_0xc96f('0x3'));var moment=require(_0xc96f('0x4'));var BPromise=require(_0xc96f('0x5'));var rp=require(_0xc96f('0x6'));var fs=require('fs');var path=require(_0xc96f('0x7'));var rimraf=require(_0xc96f('0x8'));var config=require('../../config/environment');var attributes=require(_0xc96f('0x9'));module['exports']=function(_0x474ab6,_0x535e4f){return _0x474ab6[_0xc96f('0xa')](_0xc96f('0xb'),attributes,{'tableName':_0xc96f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbb2=['define','OpenchannelQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xbbb2,0x136));var _0x2bbb=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xbbb2[_0x56916d];return _0x2b7f1f;};'use strict';var _=require(_0x2bbb('0x0'));var util=require('util');var logger=require(_0x2bbb('0x1'))(_0x2bbb('0x2'));var moment=require(_0x2bbb('0x3'));var BPromise=require(_0x2bbb('0x4'));var rp=require(_0x2bbb('0x5'));var fs=require('fs');var path=require(_0x2bbb('0x6'));var rimraf=require(_0x2bbb('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module[_0x2bbb('0x8')]=function(_0x166b51,_0x1a9679){return _0x166b51[_0x2bbb('0x9')](_0x2bbb('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 f16956e..e362994 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 _0x48b4=['request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','limit','include','map','model','attributes','stringify','find','ShowOpenchannelQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','then','info','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x2cef32,_0x430908){var _0x1cfbc5=function(_0x351a94){while(--_0x351a94){_0x2cef32['push'](_0x2cef32['shift']());}};_0x1cfbc5(++_0x430908);}(_0x48b4,0x104));var _0x448b=function(_0x32cf98,_0x26791e){_0x32cf98=_0x32cf98-0x0;var _0x361540=_0x48b4[_0x32cf98];return _0x361540;};'use strict';var _=require(_0x448b('0x0'));var util=require('util');var moment=require(_0x448b('0x1'));var BPromise=require(_0x448b('0x2'));var rs=require(_0x448b('0x3'));var fs=require('fs');var Redis=require(_0x448b('0x4'));var db=require(_0x448b('0x5'))['db'];var utils=require(_0x448b('0x6'));var logger=require(_0x448b('0x7'))(_0x448b('0x8'));var config=require(_0x448b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x448b('0xa')][_0x448b('0xb')]({'port':0x232a});config[_0x448b('0xc')]=_[_0x448b('0xd')](config[_0x448b('0xc')],{'host':_0x448b('0xe'),'port':0x18eb});var socket=require(_0x448b('0xf'))(new Redis(config[_0x448b('0xc')]));require(_0x448b('0x10'))['register'](socket);function respondWithRpcPromise(_0x127ddd,_0x4908e4,_0x3b0291){return new BPromise(function(_0x1f14f7,_0x8140a){return client['request'](_0x127ddd,_0x3b0291)[_0x448b('0x11')](function(_0x42e8c5){logger[_0x448b('0x12')](_0x448b('0x13'),_0x4908e4,_0x448b('0x14'));logger[_0x448b('0x15')](_0x448b('0x16'),_0x4908e4,_0x448b('0x14'),JSON['stringify'](_0x42e8c5));if(_0x42e8c5['error']){if(_0x42e8c5[_0x448b('0x17')][_0x448b('0x18')]===0x1f4){logger[_0x448b('0x17')](_0x448b('0x13'),_0x4908e4,_0x42e8c5[_0x448b('0x17')][_0x448b('0x19')]);return _0x8140a(_0x42e8c5[_0x448b('0x17')][_0x448b('0x19')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x4908e4,_0x42e8c5[_0x448b('0x17')][_0x448b('0x19')]);return _0x1f14f7(_0x42e8c5[_0x448b('0x17')]['message']);}else{logger[_0x448b('0x12')](_0x448b('0x13'),_0x4908e4,_0x448b('0x14'));_0x1f14f7(_0x42e8c5[_0x448b('0x1a')][_0x448b('0x19')]);}})['catch'](function(_0x20910e){logger[_0x448b('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x4908e4,_0x20910e);_0x8140a(_0x20910e);});});}exports[_0x448b('0x1b')]=function(_0x14d72e){var _0x269d0c=this;return new Promise(function(_0x327f71,_0x1db0a7){return db[_0x448b('0x1c')]['findAll']({'raw':_0x14d72e[_0x448b('0x1d')]?_0x14d72e[_0x448b('0x1d')][_0x448b('0x1e')]===undefined?!![]:![]:!![],'where':_0x14d72e[_0x448b('0x1d')]?_0x14d72e[_0x448b('0x1d')][_0x448b('0x1f')]||null:null,'attributes':_0x14d72e[_0x448b('0x1d')]?_0x14d72e[_0x448b('0x1d')]['attributes']||null:null,'limit':_0x14d72e[_0x448b('0x1d')]?_0x14d72e[_0x448b('0x1d')][_0x448b('0x20')]||null:null,'include':_0x14d72e[_0x448b('0x1d')]?_0x14d72e['options'][_0x448b('0x21')]?_[_0x448b('0x22')](_0x14d72e[_0x448b('0x1d')]['include'],function(_0x465606){return{'model':db[_0x465606[_0x448b('0x23')]],'as':_0x465606['as'],'attributes':_0x465606[_0x448b('0x24')],'include':_0x465606['include']?_[_0x448b('0x22')](_0x465606[_0x448b('0x21')],function(_0x2059dd){return{'model':db[_0x2059dd[_0x448b('0x23')]],'as':_0x2059dd['as'],'attributes':_0x2059dd[_0x448b('0x24')],'include':_0x2059dd[_0x448b('0x21')]?_[_0x448b('0x22')](_0x2059dd[_0x448b('0x21')],function(_0x128e3f){return{'model':db[_0x128e3f[_0x448b('0x23')]],'as':_0x128e3f['as'],'attributes':_0x128e3f[_0x448b('0x24')]};}):[]};}):[]};}):[]:[]})[_0x448b('0x11')](function(_0x3000b5){logger[_0x448b('0x12')](_0x448b('0x1b'),_0x14d72e);logger[_0x448b('0x15')](_0x448b('0x1b'),_0x14d72e,JSON[_0x448b('0x25')](_0x3000b5));_0x327f71(_0x3000b5);})['catch'](function(_0xbf3229){logger[_0x448b('0x17')](_0x448b('0x1b'),_0xbf3229['message'],_0x14d72e);_0x1db0a7(_0x269d0c[_0x448b('0x17')](0x1f4,_0xbf3229[_0x448b('0x19')]));});});};exports['ShowOpenchannelQueue']=function(_0x43a67d){var _0x3677ca=this;return new Promise(function(_0x427fb9,_0x460ad0){return db[_0x448b('0x1c')][_0x448b('0x26')]({'raw':_0x43a67d[_0x448b('0x1d')]?_0x43a67d[_0x448b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x43a67d[_0x448b('0x1d')]?_0x43a67d['options'][_0x448b('0x1f')]||null:null,'attributes':_0x43a67d['options']?_0x43a67d[_0x448b('0x1d')][_0x448b('0x24')]||null:null,'include':_0x43a67d['options']?_0x43a67d[_0x448b('0x1d')][_0x448b('0x21')]?_[_0x448b('0x22')](_0x43a67d[_0x448b('0x1d')]['include'],function(_0x251845){return{'model':db[_0x251845[_0x448b('0x23')]],'as':_0x251845['as'],'attributes':_0x251845[_0x448b('0x24')],'include':_0x251845['include']?_['map'](_0x251845[_0x448b('0x21')],function(_0x29c16d){return{'model':db[_0x29c16d[_0x448b('0x23')]],'as':_0x29c16d['as'],'attributes':_0x29c16d[_0x448b('0x24')],'include':_0x29c16d[_0x448b('0x21')]?_[_0x448b('0x22')](_0x29c16d['include'],function(_0x2610d7){return{'model':db[_0x2610d7['model']],'as':_0x2610d7['as'],'attributes':_0x2610d7[_0x448b('0x24')]};}):[]};}):[]};}):[]:[]})[_0x448b('0x11')](function(_0x464388){logger[_0x448b('0x12')]('ShowOpenchannelQueue',_0x43a67d);logger[_0x448b('0x15')]('ShowOpenchannelQueue',_0x43a67d,JSON['stringify'](_0x464388));_0x427fb9(_0x464388);})['catch'](function(_0x2ecd44){logger['error'](_0x448b('0x27'),_0x2ecd44[_0x448b('0x19')],_0x43a67d);_0x460ad0(_0x3677ca[_0x448b('0x17')](0x1f4,_0x2ecd44[_0x448b('0x19')]));});});}; \ No newline at end of file +var _0x626b=['socket.io-emitter','./openchannelQueue.socket','register','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelQueue','findAll','options','raw','where','attributes','include','model','map','GetOpenchannelQueue','ShowOpenchannelQueue','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x1c0c58,_0x528345){var _0x1cc26c=function(_0xe56bb4){while(--_0xe56bb4){_0x1c0c58['push'](_0x1c0c58['shift']());}};_0x1cc26c(++_0x528345);}(_0x626b,0x1b5));var _0xb626=function(_0x51494d,_0x1aec6f){_0x51494d=_0x51494d-0x0;var _0x5eb8e8=_0x626b[_0x51494d];return _0x5eb8e8;};'use strict';var _=require(_0xb626('0x0'));var util=require(_0xb626('0x1'));var moment=require('moment');var BPromise=require(_0xb626('0x2'));var rs=require(_0xb626('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb626('0x4'))['db'];var utils=require(_0xb626('0x5'));var logger=require(_0xb626('0x6'))('rpc');var config=require(_0xb626('0x7'));var jayson=require(_0xb626('0x8'));var client=jayson[_0xb626('0x9')][_0xb626('0xa')]({'port':0x232a});config[_0xb626('0xb')]=_[_0xb626('0xc')](config['redis'],{'host':_0xb626('0xd'),'port':0x18eb});var socket=require(_0xb626('0xe'))(new Redis(config[_0xb626('0xb')]));require(_0xb626('0xf'))[_0xb626('0x10')](socket);function respondWithRpcPromise(_0x4c0089,_0x4cd6b6,_0x30f55e){return new BPromise(function(_0x308395,_0x513ca9){return client['request'](_0x4c0089,_0x30f55e)[_0xb626('0x11')](function(_0x2f491d){logger['info'](_0xb626('0x12'),_0x4cd6b6,_0xb626('0x13'));logger[_0xb626('0x14')](_0xb626('0x15'),_0x4cd6b6,_0xb626('0x13'),JSON[_0xb626('0x16')](_0x2f491d));if(_0x2f491d[_0xb626('0x17')]){if(_0x2f491d[_0xb626('0x17')][_0xb626('0x18')]===0x1f4){logger['error'](_0xb626('0x12'),_0x4cd6b6,_0x2f491d[_0xb626('0x17')][_0xb626('0x19')]);return _0x513ca9(_0x2f491d[_0xb626('0x17')][_0xb626('0x19')]);}logger[_0xb626('0x17')](_0xb626('0x12'),_0x4cd6b6,_0x2f491d['error'][_0xb626('0x19')]);return _0x308395(_0x2f491d[_0xb626('0x17')][_0xb626('0x19')]);}else{logger[_0xb626('0x1a')](_0xb626('0x12'),_0x4cd6b6,'request\x20sent');_0x308395(_0x2f491d[_0xb626('0x1b')]['message']);}})[_0xb626('0x1c')](function(_0x17823c){logger[_0xb626('0x17')](_0xb626('0x12'),_0x4cd6b6,_0x17823c);_0x513ca9(_0x17823c);});});}exports['GetOpenchannelQueue']=function(_0x5dd62b){var _0x53686b=this;return new Promise(function(_0x5b0365,_0x5d24b0){return db[_0xb626('0x1d')][_0xb626('0x1e')]({'raw':_0x5dd62b[_0xb626('0x1f')]?_0x5dd62b[_0xb626('0x1f')][_0xb626('0x20')]===undefined?!![]:![]:!![],'where':_0x5dd62b[_0xb626('0x1f')]?_0x5dd62b[_0xb626('0x1f')][_0xb626('0x21')]||null:null,'attributes':_0x5dd62b[_0xb626('0x1f')]?_0x5dd62b['options'][_0xb626('0x22')]||null:null,'limit':_0x5dd62b[_0xb626('0x1f')]?_0x5dd62b[_0xb626('0x1f')]['limit']||null:null,'include':_0x5dd62b[_0xb626('0x1f')]?_0x5dd62b[_0xb626('0x1f')][_0xb626('0x23')]?_['map'](_0x5dd62b['options'][_0xb626('0x23')],function(_0xca5aa8){return{'model':db[_0xca5aa8[_0xb626('0x24')]],'as':_0xca5aa8['as'],'attributes':_0xca5aa8[_0xb626('0x22')],'include':_0xca5aa8['include']?_[_0xb626('0x25')](_0xca5aa8[_0xb626('0x23')],function(_0x3b5cb3){return{'model':db[_0x3b5cb3[_0xb626('0x24')]],'as':_0x3b5cb3['as'],'attributes':_0x3b5cb3['attributes'],'include':_0x3b5cb3[_0xb626('0x23')]?_[_0xb626('0x25')](_0x3b5cb3['include'],function(_0x15350a){return{'model':db[_0x15350a[_0xb626('0x24')]],'as':_0x15350a['as'],'attributes':_0x15350a['attributes']};}):[]};}):[]};}):[]:[]})[_0xb626('0x11')](function(_0x4a3297){logger[_0xb626('0x1a')](_0xb626('0x26'),_0x5dd62b);logger['debug'](_0xb626('0x26'),_0x5dd62b,JSON[_0xb626('0x16')](_0x4a3297));_0x5b0365(_0x4a3297);})[_0xb626('0x1c')](function(_0x320e9c){logger[_0xb626('0x17')](_0xb626('0x26'),_0x320e9c['message'],_0x5dd62b);_0x5d24b0(_0x53686b[_0xb626('0x17')](0x1f4,_0x320e9c[_0xb626('0x19')]));});});};exports[_0xb626('0x27')]=function(_0x45516a){var _0x2e72f7=this;return new Promise(function(_0x4d6ed2,_0x521a1d){return db[_0xb626('0x1d')][_0xb626('0x28')]({'raw':_0x45516a[_0xb626('0x1f')]?_0x45516a[_0xb626('0x1f')][_0xb626('0x20')]===undefined?!![]:![]:!![],'where':_0x45516a['options']?_0x45516a[_0xb626('0x1f')][_0xb626('0x21')]||null:null,'attributes':_0x45516a[_0xb626('0x1f')]?_0x45516a['options'][_0xb626('0x22')]||null:null,'include':_0x45516a[_0xb626('0x1f')]?_0x45516a['options'][_0xb626('0x23')]?_[_0xb626('0x25')](_0x45516a[_0xb626('0x1f')]['include'],function(_0x414b3b){return{'model':db[_0x414b3b[_0xb626('0x24')]],'as':_0x414b3b['as'],'attributes':_0x414b3b[_0xb626('0x22')],'include':_0x414b3b[_0xb626('0x23')]?_[_0xb626('0x25')](_0x414b3b[_0xb626('0x23')],function(_0x35ef2c){return{'model':db[_0x35ef2c[_0xb626('0x24')]],'as':_0x35ef2c['as'],'attributes':_0x35ef2c[_0xb626('0x22')],'include':_0x35ef2c[_0xb626('0x23')]?_['map'](_0x35ef2c[_0xb626('0x23')],function(_0x586f64){return{'model':db[_0x586f64[_0xb626('0x24')]],'as':_0x586f64['as'],'attributes':_0x586f64['attributes']};}):[]};}):[]};}):[]:[]})[_0xb626('0x11')](function(_0x2703c4){logger[_0xb626('0x1a')](_0xb626('0x27'),_0x45516a);logger[_0xb626('0x14')](_0xb626('0x27'),_0x45516a,JSON[_0xb626('0x16')](_0x2703c4));_0x4d6ed2(_0x2703c4);})[_0xb626('0x1c')](function(_0x1c9f27){logger[_0xb626('0x17')](_0xb626('0x27'),_0x1c9f27[_0xb626('0x19')],_0x45516a);_0x521a1d(_0x2e72f7[_0xb626('0x17')](0x1f4,_0x1c9f27[_0xb626('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 25d4588..c3e2659 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 _0xddb4=['update','removeListener','length','openchannelQueue:','./openchannelQueue.events','save','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xddb4,0x162));var _0x4ddb=function(_0x3cec8c,_0x3f6c1d){_0x3cec8c=_0x3cec8c-0x0;var _0x38032e=_0xddb4[_0x3cec8c];return _0x38032e;};'use strict';var OpenchannelQueueEvents=require(_0x4ddb('0x0'));var events=[_0x4ddb('0x1'),_0x4ddb('0x2'),_0x4ddb('0x3')];function createListener(_0x12177c,_0x15a2cc){return function(_0x31487f){_0x15a2cc['emit'](_0x12177c,_0x31487f);};}function removeListener(_0x4ee0fd,_0x36b7c3){return function(){OpenchannelQueueEvents[_0x4ddb('0x4')](_0x4ee0fd,_0x36b7c3);};}exports['register']=function(_0x53a1db){for(var _0x4b47f1=0x0,_0x320e9e=events[_0x4ddb('0x5')];_0x4b47f1<_0x320e9e;_0x4b47f1++){var _0x33ffa5=events[_0x4b47f1];var _0x4b756e=createListener(_0x4ddb('0x6')+_0x33ffa5,_0x53a1db);OpenchannelQueueEvents['on'](_0x33ffa5,_0x4b756e);}}; \ No newline at end of file +var _0x3b57=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x3b57,0xc9));var _0x73b5=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0x3b57[_0x4d674b];return _0x535a1f;};'use strict';var OpenchannelQueueEvents=require(_0x73b5('0x0'));var events=[_0x73b5('0x1'),_0x73b5('0x2'),_0x73b5('0x3')];function createListener(_0x52e8ef,_0x57c2f5){return function(_0x4e4193){_0x57c2f5[_0x73b5('0x4')](_0x52e8ef,_0x4e4193);};}function removeListener(_0x18fbdd,_0x1e8d91){return function(){OpenchannelQueueEvents[_0x73b5('0x5')](_0x18fbdd,_0x1e8d91);};}exports[_0x73b5('0x6')]=function(_0x34c98f){for(var _0x2146d4=0x0,_0x285a01=events[_0x73b5('0x7')];_0x2146d4<_0x285a01;_0x2146d4++){var _0x41fa16=events[_0x2146d4];var _0x241f04=createListener(_0x73b5('0x8')+_0x41fa16,_0x34c98f);OpenchannelQueueEvents['on'](_0x41fa16,_0x241f04);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 43c2806..3e40bf6 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 _0xfe28=['./openchannelQueueReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','update','delete','util','express','fs-extra','../../config/environment'];(function(_0x4c73ac,_0x46b73c){var _0x9839ee=function(_0x2076fb){while(--_0x2076fb){_0x4c73ac['push'](_0x4c73ac['shift']());}};_0x9839ee(++_0x46b73c);}(_0xfe28,0x176));var _0x8fe2=function(_0x2b9e27,_0xfaa871){_0x2b9e27=_0x2b9e27-0x0;var _0x3f6ba1=_0xfe28[_0x2b9e27];return _0x3f6ba1;};'use strict';var multer=require('multer');var util=require(_0x8fe2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8fe2('0x1'));var router=express['Router']();var fs_extra=require(_0x8fe2('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8fe2('0x3'));var controller=require(_0x8fe2('0x4'));router[_0x8fe2('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8fe2('0x5')](_0x8fe2('0x6'),auth[_0x8fe2('0x7')](),controller['describe']);router['get'](_0x8fe2('0x8'),auth[_0x8fe2('0x7')](),controller[_0x8fe2('0x9')]);router[_0x8fe2('0xa')]('/',auth[_0x8fe2('0x7')](),controller[_0x8fe2('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8fe2('0xc')]);router[_0x8fe2('0xd')](_0x8fe2('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf689=['fs-extra','../../components/interaction/service','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x1d949d,_0x46c3c2){var _0x5b5014=function(_0x5e2c49){while(--_0x5e2c49){_0x1d949d['push'](_0x1d949d['shift']());}};_0x5b5014(++_0x46c3c2);}(_0xf689,0xe4));var _0x9f68=function(_0x3cbf45,_0x21e385){_0x3cbf45=_0x3cbf45-0x0;var _0x570f28=_0xf689[_0x3cbf45];return _0x570f28;};'use strict';var multer=require(_0x9f68('0x0'));var util=require(_0x9f68('0x1'));var path=require(_0x9f68('0x2'));var timeout=require(_0x9f68('0x3'));var express=require(_0x9f68('0x4'));var router=express[_0x9f68('0x5')]();var fs_extra=require(_0x9f68('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9f68('0x7'));var config=require('../../config/environment');var controller=require(_0x9f68('0x8'));router['get']('/',auth[_0x9f68('0x9')](),controller[_0x9f68('0xa')]);router[_0x9f68('0xb')](_0x9f68('0xc'),auth[_0x9f68('0x9')](),controller['describe']);router['get'](_0x9f68('0xd'),auth[_0x9f68('0x9')](),controller[_0x9f68('0xe')]);router[_0x9f68('0xf')]('/',auth[_0x9f68('0x9')](),controller['create']);router['put'](_0x9f68('0xd'),auth[_0x9f68('0x9')](),controller['update']);router[_0x9f68('0x10')](_0x9f68('0xd'),auth['isAuthenticated'](),controller[_0x9f68('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 04b0ff9..6101919 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 _0xb65d=['STRING','DATE','sequelize','exports'];(function(_0x2c3ea8,_0x4854a9){var _0xbb8cc2=function(_0x3d5f31){while(--_0x3d5f31){_0x2c3ea8['push'](_0x2c3ea8['shift']());}};_0xbb8cc2(++_0x4854a9);}(_0xb65d,0x7e));var _0xdb65=function(_0x47daf5,_0x2131c6){_0x47daf5=_0x47daf5-0x0;var _0x8cf4bb=_0xb65d[_0x47daf5];return _0x8cf4bb;};'use strict';var moment=require('moment');var Sequelize=require(_0xdb65('0x0'));module[_0xdb65('0x1')]={'uniqueid':{'type':Sequelize[_0xdb65('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdb65('0x2')]},'joinAt':{'type':Sequelize[_0xdb65('0x3')]},'leaveAt':{'type':Sequelize[_0xdb65('0x3')]},'acceptAt':{'type':Sequelize[_0xdb65('0x3')]},'exitAt':{'type':Sequelize[_0xdb65('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5e63=['exports','STRING','DATE','moment','sequelize'];(function(_0x2da8b7,_0x50941a){var _0xd33d7a=function(_0x2ba2ad){while(--_0x2ba2ad){_0x2da8b7['push'](_0x2da8b7['shift']());}};_0xd33d7a(++_0x50941a);}(_0x5e63,0x17a));var _0x35e6=function(_0x4c7f18,_0x1dbbeb){_0x4c7f18=_0x4c7f18-0x0;var _0x1aab1f=_0x5e63[_0x4c7f18];return _0x1aab1f;};'use strict';var moment=require(_0x35e6('0x0'));var Sequelize=require(_0x35e6('0x1'));module[_0x35e6('0x2')]={'uniqueid':{'type':Sequelize[_0x35e6('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x35e6('0x3')]},'joinAt':{'type':Sequelize[_0x35e6('0x4')]},'leaveAt':{'type':Sequelize[_0x35e6('0x4')]},'acceptAt':{'type':Sequelize[_0x35e6('0x4')]},'exitAt':{'type':Sequelize[_0x35e6('0x4')]},'reason':{'type':Sequelize[_0x35e6('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 10c29ac..9adfaa5 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 _0x30da=['pick','filter','merge','VIRTUAL','options','include','findAll','show','params','includeAll','catch','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x8dd419,_0x58acff){var _0x4fadf8=function(_0x47a697){while(--_0x47a697){_0x8dd419['push'](_0x8dd419['shift']());}};_0x4fadf8(++_0x58acff);}(_0x30da,0x191));var _0xa30d=function(_0xbe049f,_0x1e6870){_0xbe049f=_0xbe049f-0x0;var _0x561514=_0x30da[_0xbe049f];return _0x561514;};'use strict';var emlformat=require(_0xa30d('0x0'));var rimraf=require(_0xa30d('0x1'));var zipdir=require(_0xa30d('0x2'));var jsonpatch=require(_0xa30d('0x3'));var rp=require(_0xa30d('0x4'));var moment=require(_0xa30d('0x5'));var BPromise=require(_0xa30d('0x6'));var Mustache=require('mustache');var util=require(_0xa30d('0x7'));var path=require(_0xa30d('0x8'));var sox=require(_0xa30d('0x9'));var csv=require(_0xa30d('0xa'));var ejs=require(_0xa30d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa30d('0xc'));var squel=require(_0xa30d('0xd'));var crypto=require(_0xa30d('0xe'));var jsforce=require(_0xa30d('0xf'));var deskjs=require(_0xa30d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa30d('0x11'));var Papa=require(_0xa30d('0x12'));var Redis=require(_0xa30d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa30d('0x14'));var as=require(_0xa30d('0x15'));var hardwareService=require(_0xa30d('0x16'));var logger=require(_0xa30d('0x17'))(_0xa30d('0x18'));var utils=require(_0xa30d('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xa30d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f061d,_0x3b49c2){_0x3b49c2=_0x3b49c2||0xcc;return function(_0x3bac9f){if(_0x3bac9f){return _0x1f061d[_0xa30d('0x1b')](_0x3b49c2);}return _0x1f061d[_0xa30d('0x1c')](_0x3b49c2)['end']();};}function respondWithResult(_0x320be1,_0x40c4ae){_0x40c4ae=_0x40c4ae||0xc8;return function(_0x5bac0f){if(_0x5bac0f){return _0x320be1[_0xa30d('0x1c')](_0x40c4ae)[_0xa30d('0x1d')](_0x5bac0f);}};}function respondWithFilteredResult(_0x1d719e,_0x449e79){return function(_0x409068){if(_0x409068){var _0x4c349a=typeof _0x449e79[_0xa30d('0x1e')]==='undefined'&&typeof _0x449e79['limit']===_0xa30d('0x1f');var _0x91b773=_0x409068[_0xa30d('0x20')];var _0x11b058=_0x4c349a?0x0:_0x449e79[_0xa30d('0x1e')];var _0x3b7611=_0x4c349a?_0x409068[_0xa30d('0x20')]:_0x449e79['offset']+_0x449e79[_0xa30d('0x21')];var _0x10aa75;if(_0x3b7611>=_0x91b773){_0x3b7611=_0x91b773;_0x10aa75=0xc8;}else{_0x10aa75=0xce;}_0x1d719e['status'](_0x10aa75);return _0x1d719e[_0xa30d('0x22')](_0xa30d('0x23'),_0x11b058+'-'+_0x3b7611+'/'+_0x91b773)[_0xa30d('0x1d')](_0x409068);}return null;};}function patchUpdates(_0x44b905){return function(_0x4fca48){try{jsonpatch['apply'](_0x4fca48,_0x44b905,!![]);}catch(_0x3fd4ca){return BPromise[_0xa30d('0x24')](_0x3fd4ca);}return _0x4fca48[_0xa30d('0x25')]();};}function saveUpdates(_0x24f887,_0x13f623){return function(_0x5f2972){if(_0x5f2972){return _0x5f2972['update'](_0x24f887)[_0xa30d('0x26')](function(_0x1b0dbc){return _0x1b0dbc;});}return null;};}function removeEntity(_0x27a2dd,_0x1761dc){return function(_0x21ed21){if(_0x21ed21){return _0x21ed21[_0xa30d('0x27')]()[_0xa30d('0x26')](function(){_0x27a2dd[_0xa30d('0x1c')](0xcc)[_0xa30d('0x28')]();});}};}function handleEntityNotFound(_0x139c2d,_0x55a174){return function(_0x4ef71c){if(!_0x4ef71c){_0x139c2d[_0xa30d('0x1b')](0x194);}return _0x4ef71c;};}function handleError(_0x33541b,_0x44e6e3){_0x44e6e3=_0x44e6e3||0x1f4;return function(_0x5021be){logger[_0xa30d('0x29')](_0x5021be[_0xa30d('0x2a')]);if(_0x5021be[_0xa30d('0x2b')]){delete _0x5021be['name'];}_0x33541b[_0xa30d('0x1c')](_0x44e6e3)[_0xa30d('0x2c')](_0x5021be);};}exports[_0xa30d('0x2d')]=function(_0x997980,_0x14a921){var _0x41575e={},_0x22f986={},_0x1a5a4a={'count':0x0,'rows':[]};var _0x24680e=_[_0xa30d('0x2e')](db[_0xa30d('0x2f')][_0xa30d('0x30')],function(_0xfb715e){return{'name':_0xfb715e['fieldName'],'type':_0xfb715e['type']['key']};});_0x22f986[_0xa30d('0x31')]=_[_0xa30d('0x2e')](_0x24680e,'name');_0x22f986[_0xa30d('0x32')]=_[_0xa30d('0x33')](_0x997980[_0xa30d('0x32')]);_0x22f986[_0xa30d('0x34')]=_[_0xa30d('0x35')](_0x22f986[_0xa30d('0x31')],_0x22f986[_0xa30d('0x32')]);_0x41575e[_0xa30d('0x36')]=_['intersection'](_0x22f986['model'],qs[_0xa30d('0x37')](_0x997980['query'][_0xa30d('0x37')]));_0x41575e[_0xa30d('0x36')]=_0x41575e[_0xa30d('0x36')]['length']?_0x41575e[_0xa30d('0x36')]:_0x22f986[_0xa30d('0x31')];if(!_0x997980[_0xa30d('0x32')][_0xa30d('0x38')](_0xa30d('0x39'))){_0x41575e[_0xa30d('0x21')]=qs[_0xa30d('0x21')](_0x997980[_0xa30d('0x32')][_0xa30d('0x21')]);_0x41575e[_0xa30d('0x1e')]=qs[_0xa30d('0x1e')](_0x997980[_0xa30d('0x32')][_0xa30d('0x1e')]);}_0x41575e[_0xa30d('0x3a')]=qs['sort'](_0x997980[_0xa30d('0x32')][_0xa30d('0x3b')]);_0x41575e[_0xa30d('0x3c')]=qs[_0xa30d('0x34')](_[_0xa30d('0x3d')](_0x997980[_0xa30d('0x32')],_0x22f986[_0xa30d('0x34')]),_0x24680e);if(_0x997980[_0xa30d('0x32')][_0xa30d('0x3e')]){_0x41575e[_0xa30d('0x3c')]=_[_0xa30d('0x3f')](_0x41575e['where'],{'$or':_[_0xa30d('0x2e')](_0x24680e,function(_0x5ca62d){if(_0x5ca62d['type']!==_0xa30d('0x40')){var _0x5346a1={};_0x5346a1[_0x5ca62d[_0xa30d('0x2b')]]={'$like':'%'+_0x997980[_0xa30d('0x32')][_0xa30d('0x3e')]+'%'};return _0x5346a1;}})});}_0x41575e=_[_0xa30d('0x3f')]({},_0x41575e,_0x997980[_0xa30d('0x41')]);var _0x3618a5={'where':_0x41575e[_0xa30d('0x3c')]};return db[_0xa30d('0x2f')]['count'](_0x3618a5)[_0xa30d('0x26')](function(_0x5bcf94){_0x1a5a4a['count']=_0x5bcf94;if(_0x997980[_0xa30d('0x32')]['includeAll']){_0x41575e[_0xa30d('0x42')]=[{'all':!![]}];}return db[_0xa30d('0x2f')][_0xa30d('0x43')](_0x41575e);})[_0xa30d('0x26')](function(_0x37782b){_0x1a5a4a['rows']=_0x37782b;return _0x1a5a4a;})[_0xa30d('0x26')](respondWithFilteredResult(_0x14a921,_0x41575e))['catch'](handleError(_0x14a921,null));};exports[_0xa30d('0x44')]=function(_0x2b6b91,_0x5cddff){var _0x58e950={'raw':!![],'where':{'id':_0x2b6b91[_0xa30d('0x45')]['id']}},_0x2ef332={};_0x2ef332[_0xa30d('0x31')]=_[_0xa30d('0x33')](db[_0xa30d('0x2f')][_0xa30d('0x30')]);_0x2ef332['query']=_[_0xa30d('0x33')](_0x2b6b91[_0xa30d('0x32')]);_0x2ef332[_0xa30d('0x34')]=_[_0xa30d('0x35')](_0x2ef332[_0xa30d('0x31')],_0x2ef332['query']);_0x58e950[_0xa30d('0x36')]=_[_0xa30d('0x35')](_0x2ef332[_0xa30d('0x31')],qs[_0xa30d('0x37')](_0x2b6b91[_0xa30d('0x32')][_0xa30d('0x37')]));_0x58e950['attributes']=_0x58e950[_0xa30d('0x36')]['length']?_0x58e950[_0xa30d('0x36')]:_0x2ef332[_0xa30d('0x31')];if(_0x2b6b91['query'][_0xa30d('0x46')]){_0x58e950[_0xa30d('0x42')]=[{'all':!![]}];}_0x58e950=_[_0xa30d('0x3f')]({},_0x58e950,_0x2b6b91[_0xa30d('0x41')]);return db[_0xa30d('0x2f')]['find'](_0x58e950)[_0xa30d('0x26')](handleEntityNotFound(_0x5cddff,null))['then'](respondWithResult(_0x5cddff,null))[_0xa30d('0x47')](handleError(_0x5cddff,null));};exports[_0xa30d('0x48')]=function(_0x2ae175,_0xd0b3c9){return db['OpenchannelQueueReport'][_0xa30d('0x48')](_0x2ae175[_0xa30d('0x49')],{})[_0xa30d('0x26')](respondWithResult(_0xd0b3c9,0xc9))['catch'](handleError(_0xd0b3c9,null));};exports[_0xa30d('0x4a')]=function(_0x424634,_0x14f8f1){if(_0x424634[_0xa30d('0x49')]['id']){delete _0x424634[_0xa30d('0x49')]['id'];}return db[_0xa30d('0x2f')][_0xa30d('0x4b')]({'where':{'id':_0x424634[_0xa30d('0x45')]['id']}})[_0xa30d('0x26')](handleEntityNotFound(_0x14f8f1,null))[_0xa30d('0x26')](saveUpdates(_0x424634[_0xa30d('0x49')],null))[_0xa30d('0x26')](respondWithResult(_0x14f8f1,null))['catch'](handleError(_0x14f8f1,null));};exports[_0xa30d('0x27')]=function(_0x497f9d,_0x50817c){return db[_0xa30d('0x2f')]['find']({'where':{'id':_0x497f9d['params']['id']}})['then'](handleEntityNotFound(_0x50817c,null))[_0xa30d('0x26')](removeEntity(_0x50817c,null))['catch'](handleError(_0x50817c,null));};exports[_0xa30d('0x4c')]=function(_0x431368,_0x26984e){return db[_0xa30d('0x2f')]['describe']()[_0xa30d('0x26')](respondWithResult(_0x26984e,null))[_0xa30d('0x47')](handleError(_0x26984e,null));}; \ No newline at end of file +var _0xba8f=['util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','OpenchannelQueueReport','rawAttributes','fieldName','type','model','map','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','query','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','filters','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xba8f,0x93));var _0xfba8=function(_0x41232a,_0x20440d){_0x41232a=_0x41232a-0x0;var _0x1ab731=_0xba8f[_0x41232a];return _0x1ab731;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfba8('0x0'));var zipdir=require(_0xfba8('0x1'));var jsonpatch=require(_0xfba8('0x2'));var rp=require(_0xfba8('0x3'));var moment=require(_0xfba8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfba8('0x5'));var path=require(_0xfba8('0x6'));var sox=require(_0xfba8('0x7'));var csv=require(_0xfba8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfba8('0x9'));var squel=require(_0xfba8('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfba8('0xb'));var toCsv=require(_0xfba8('0x8'));var querystring=require(_0xfba8('0xc'));var Papa=require(_0xfba8('0xd'));var Redis=require(_0xfba8('0xe'));var authService=require(_0xfba8('0xf'));var qs=require(_0xfba8('0x10'));var as=require(_0xfba8('0x11'));var hardwareService=require(_0xfba8('0x12'));var logger=require(_0xfba8('0x13'))(_0xfba8('0x14'));var utils=require(_0xfba8('0x15'));var config=require(_0xfba8('0x16'));var licenseUtil=require(_0xfba8('0x17'));var db=require(_0xfba8('0x18'))['db'];function respondWithStatusCode(_0x1946e4,_0x1f7d61){_0x1f7d61=_0x1f7d61||0xcc;return function(_0x4361f0){if(_0x4361f0){return _0x1946e4[_0xfba8('0x19')](_0x1f7d61);}return _0x1946e4[_0xfba8('0x1a')](_0x1f7d61)[_0xfba8('0x1b')]();};}function respondWithResult(_0x3c07a7,_0x360b4d){_0x360b4d=_0x360b4d||0xc8;return function(_0xa7a08b){if(_0xa7a08b){return _0x3c07a7['status'](_0x360b4d)[_0xfba8('0x1c')](_0xa7a08b);}};}function respondWithFilteredResult(_0x5e6780,_0xff1bcc){return function(_0x1b8af8){if(_0x1b8af8){var _0x5147cd=typeof _0xff1bcc[_0xfba8('0x1d')]===_0xfba8('0x1e')&&typeof _0xff1bcc[_0xfba8('0x1f')]===_0xfba8('0x1e');var _0x4164d0=_0x1b8af8[_0xfba8('0x20')];var _0x453c80=_0x5147cd?0x0:_0xff1bcc['offset'];var _0x3ff19e=_0x5147cd?_0x1b8af8[_0xfba8('0x20')]:_0xff1bcc['offset']+_0xff1bcc['limit'];var _0x28c26d;if(_0x3ff19e>=_0x4164d0){_0x3ff19e=_0x4164d0;_0x28c26d=0xc8;}else{_0x28c26d=0xce;}_0x5e6780[_0xfba8('0x1a')](_0x28c26d);return _0x5e6780[_0xfba8('0x21')](_0xfba8('0x22'),_0x453c80+'-'+_0x3ff19e+'/'+_0x4164d0)[_0xfba8('0x1c')](_0x1b8af8);}return null;};}function patchUpdates(_0x361456){return function(_0x1f90c5){try{jsonpatch[_0xfba8('0x23')](_0x1f90c5,_0x361456,!![]);}catch(_0x188479){return BPromise[_0xfba8('0x24')](_0x188479);}return _0x1f90c5[_0xfba8('0x25')]();};}function saveUpdates(_0x4c7644,_0x5a553e){return function(_0x61c82b){if(_0x61c82b){return _0x61c82b['update'](_0x4c7644)['then'](function(_0x26a678){return _0x26a678;});}return null;};}function removeEntity(_0x115c93,_0x5afd95){return function(_0xb35244){if(_0xb35244){return _0xb35244['destroy']()[_0xfba8('0x26')](function(){_0x115c93[_0xfba8('0x1a')](0xcc)[_0xfba8('0x1b')]();});}};}function handleEntityNotFound(_0x4701f5,_0x1b061a){return function(_0x26966e){if(!_0x26966e){_0x4701f5[_0xfba8('0x19')](0x194);}return _0x26966e;};}function handleError(_0x226587,_0x213170){_0x213170=_0x213170||0x1f4;return function(_0x3cd01f){logger['error'](_0x3cd01f[_0xfba8('0x27')]);if(_0x3cd01f[_0xfba8('0x28')]){delete _0x3cd01f['name'];}_0x226587[_0xfba8('0x1a')](_0x213170)[_0xfba8('0x29')](_0x3cd01f);};}exports['index']=function(_0x5e7f42,_0x34ec0e){var _0x2d2504={},_0x2cada8={},_0xa3ef98={'count':0x0,'rows':[]};var _0x23d976=_['map'](db[_0xfba8('0x2a')][_0xfba8('0x2b')],function(_0x27887f){return{'name':_0x27887f[_0xfba8('0x2c')],'type':_0x27887f[_0xfba8('0x2d')]['key']};});_0x2cada8[_0xfba8('0x2e')]=_[_0xfba8('0x2f')](_0x23d976,_0xfba8('0x28'));_0x2cada8['query']=_[_0xfba8('0x30')](_0x5e7f42['query']);_0x2cada8['filters']=_['intersection'](_0x2cada8[_0xfba8('0x2e')],_0x2cada8['query']);_0x2d2504[_0xfba8('0x31')]=_[_0xfba8('0x32')](_0x2cada8[_0xfba8('0x2e')],qs[_0xfba8('0x33')](_0x5e7f42['query'][_0xfba8('0x33')]));_0x2d2504[_0xfba8('0x31')]=_0x2d2504['attributes'][_0xfba8('0x34')]?_0x2d2504[_0xfba8('0x31')]:_0x2cada8[_0xfba8('0x2e')];if(!_0x5e7f42['query'][_0xfba8('0x35')]('nolimit')){_0x2d2504[_0xfba8('0x1f')]=qs[_0xfba8('0x1f')](_0x5e7f42['query'][_0xfba8('0x1f')]);_0x2d2504[_0xfba8('0x1d')]=qs[_0xfba8('0x1d')](_0x5e7f42['query'][_0xfba8('0x1d')]);}_0x2d2504[_0xfba8('0x36')]=qs[_0xfba8('0x37')](_0x5e7f42[_0xfba8('0x38')][_0xfba8('0x37')]);_0x2d2504[_0xfba8('0x39')]=qs['filters'](_[_0xfba8('0x3a')](_0x5e7f42[_0xfba8('0x38')],_0x2cada8['filters']),_0x23d976);if(_0x5e7f42[_0xfba8('0x38')][_0xfba8('0x3b')]){_0x2d2504[_0xfba8('0x39')]=_['merge'](_0x2d2504[_0xfba8('0x39')],{'$or':_[_0xfba8('0x2f')](_0x23d976,function(_0x5cfa3e){if(_0x5cfa3e[_0xfba8('0x2d')]!==_0xfba8('0x3c')){var _0x33bc01={};_0x33bc01[_0x5cfa3e[_0xfba8('0x28')]]={'$like':'%'+_0x5e7f42['query'][_0xfba8('0x3b')]+'%'};return _0x33bc01;}})});}_0x2d2504=_[_0xfba8('0x3d')]({},_0x2d2504,_0x5e7f42[_0xfba8('0x3e')]);var _0x4165f4={'where':_0x2d2504['where']};return db[_0xfba8('0x2a')][_0xfba8('0x20')](_0x4165f4)[_0xfba8('0x26')](function(_0x391a46){_0xa3ef98['count']=_0x391a46;if(_0x5e7f42['query'][_0xfba8('0x3f')]){_0x2d2504[_0xfba8('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xfba8('0x41')](_0x2d2504);})[_0xfba8('0x26')](function(_0x36ea72){_0xa3ef98[_0xfba8('0x42')]=_0x36ea72;return _0xa3ef98;})['then'](respondWithFilteredResult(_0x34ec0e,_0x2d2504))[_0xfba8('0x43')](handleError(_0x34ec0e,null));};exports[_0xfba8('0x44')]=function(_0x39a93b,_0x53436e){var _0x5860a9={'raw':!![],'where':{'id':_0x39a93b[_0xfba8('0x45')]['id']}},_0x32338f={};_0x32338f[_0xfba8('0x2e')]=_[_0xfba8('0x30')](db[_0xfba8('0x2a')][_0xfba8('0x2b')]);_0x32338f[_0xfba8('0x38')]=_[_0xfba8('0x30')](_0x39a93b[_0xfba8('0x38')]);_0x32338f[_0xfba8('0x46')]=_[_0xfba8('0x32')](_0x32338f[_0xfba8('0x2e')],_0x32338f[_0xfba8('0x38')]);_0x5860a9[_0xfba8('0x31')]=_['intersection'](_0x32338f['model'],qs[_0xfba8('0x33')](_0x39a93b[_0xfba8('0x38')][_0xfba8('0x33')]));_0x5860a9['attributes']=_0x5860a9[_0xfba8('0x31')][_0xfba8('0x34')]?_0x5860a9[_0xfba8('0x31')]:_0x32338f[_0xfba8('0x2e')];if(_0x39a93b[_0xfba8('0x38')][_0xfba8('0x3f')]){_0x5860a9[_0xfba8('0x40')]=[{'all':!![]}];}_0x5860a9=_[_0xfba8('0x3d')]({},_0x5860a9,_0x39a93b[_0xfba8('0x3e')]);return db['OpenchannelQueueReport'][_0xfba8('0x47')](_0x5860a9)[_0xfba8('0x26')](handleEntityNotFound(_0x53436e,null))[_0xfba8('0x26')](respondWithResult(_0x53436e,null))[_0xfba8('0x43')](handleError(_0x53436e,null));};exports[_0xfba8('0x48')]=function(_0x44d60c,_0x55b1ca){return db[_0xfba8('0x2a')][_0xfba8('0x48')](_0x44d60c[_0xfba8('0x49')],{})[_0xfba8('0x26')](respondWithResult(_0x55b1ca,0xc9))[_0xfba8('0x43')](handleError(_0x55b1ca,null));};exports[_0xfba8('0x4a')]=function(_0xefc56c,_0xf1d7e5){if(_0xefc56c[_0xfba8('0x49')]['id']){delete _0xefc56c[_0xfba8('0x49')]['id'];}return db[_0xfba8('0x2a')][_0xfba8('0x47')]({'where':{'id':_0xefc56c[_0xfba8('0x45')]['id']}})[_0xfba8('0x26')](handleEntityNotFound(_0xf1d7e5,null))[_0xfba8('0x26')](saveUpdates(_0xefc56c[_0xfba8('0x49')],null))[_0xfba8('0x26')](respondWithResult(_0xf1d7e5,null))[_0xfba8('0x43')](handleError(_0xf1d7e5,null));};exports[_0xfba8('0x4b')]=function(_0x51bd7f,_0x599cc3){return db[_0xfba8('0x2a')][_0xfba8('0x47')]({'where':{'id':_0x51bd7f[_0xfba8('0x45')]['id']}})['then'](handleEntityNotFound(_0x599cc3,null))[_0xfba8('0x26')](removeEntity(_0x599cc3,null))[_0xfba8('0x43')](handleError(_0x599cc3,null));};exports['describe']=function(_0x5d5bab,_0x5706c7){return db[_0xfba8('0x2a')]['describe']()[_0xfba8('0x26')](respondWithResult(_0x5706c7,null))[_0xfba8('0x43')](handleError(_0x5706c7,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index f3c051e..0e853c4 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x814b,0x1a2));var _0xb814=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x814b[_0x119280];return _0x481797;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x4eca0f,_0x4f4f86){var _0x514c2c=function(_0x310616){while(--_0x310616){_0x4eca0f['push'](_0x4eca0f['shift']());}};_0x514c2c(++_0x4f4f86);}(_0x326f,0xd1));var _0xf326=function(_0x2225e8,_0x14eb63){_0x2225e8=_0x2225e8-0x0;var _0x52d934=_0x326f[_0x2225e8];return _0x52d934;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 893bc3f..6a69a61 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 _0x14a0=['stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','UpdateOpenchannelQueueReport','update','raw','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent'];(function(_0x59342a,_0x16827b){var _0x17abc9=function(_0x2f7bfc){while(--_0x2f7bfc){_0x59342a['push'](_0x59342a['shift']());}};_0x17abc9(++_0x16827b);}(_0x14a0,0x8e));var _0x014a=function(_0x4b565e,_0x3ae39a){_0x4b565e=_0x4b565e-0x0;var _0x260fd2=_0x14a0[_0x4b565e];return _0x260fd2;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});}exports[_0x014a('0x15')]=function(_0x12d339){var _0x61ec9f=this;return new Promise(function(_0x263b07,_0x16490a){return db[_0x014a('0x16')][_0x014a('0x17')](_0x12d339[_0x014a('0x18')],{'raw':_0x12d339[_0x014a('0x19')]?_0x12d339[_0x014a('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x014a('0xa')](function(_0x109a9c){logger[_0x014a('0x12')](_0x014a('0x15'),_0x12d339);logger[_0x014a('0xb')](_0x014a('0x15'),_0x12d339,JSON[_0x014a('0xd')](_0x109a9c));_0x263b07(_0x109a9c);})[_0x014a('0x14')](function(_0x290b86){logger['error'](_0x014a('0x15'),_0x290b86['message'],_0x12d339);_0x16490a(_0x61ec9f[_0x014a('0xe')](0x1f4,_0x290b86[_0x014a('0x11')]));});});};exports[_0x014a('0x1a')]=function(_0x36d52b){var _0x2b3c10=this;return new Promise(function(_0x113b12,_0x3fec9f){return db[_0x014a('0x16')][_0x014a('0x1b')](_0x36d52b['body'],{'raw':_0x36d52b[_0x014a('0x19')]?_0x36d52b['options'][_0x014a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36d52b[_0x014a('0x19')]?_0x36d52b['options']['where']||null:null,'attributes':_0x36d52b[_0x014a('0x19')]?_0x36d52b[_0x014a('0x19')][_0x014a('0x1d')]||null:null,'limit':_0x36d52b['options']?_0x36d52b[_0x014a('0x19')][_0x014a('0x1e')]||null:null})['then'](function(_0x31dc95){logger[_0x014a('0x12')]('UpdateOpenchannelQueueReport',_0x36d52b);logger['debug'](_0x014a('0x1a'),_0x36d52b,JSON[_0x014a('0xd')](_0x31dc95));_0x113b12(_0x31dc95);})[_0x014a('0x14')](function(_0x29fce5){logger['error'](_0x014a('0x1a'),_0x29fce5[_0x014a('0x11')],_0x36d52b);_0x3fec9f(_0x2b3c10[_0x014a('0xe')](0x1f4,_0x29fce5[_0x014a('0x11')]));});});}; \ No newline at end of file +var _0x4213=['request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelQueueReport,\x20%s,\x20%s','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','then','debug','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x536227,_0x50d8d3){var _0x8622a6=function(_0x544552){while(--_0x544552){_0x536227['push'](_0x536227['shift']());}};_0x8622a6(++_0x50d8d3);}(_0x4213,0x77));var _0x3421=function(_0xc05bd3,_0x193c13){_0xc05bd3=_0xc05bd3-0x0;var _0x1afc55=_0x4213[_0xc05bd3];return _0x1afc55;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var moment=require(_0x3421('0x2'));var BPromise=require(_0x3421('0x3'));var rs=require(_0x3421('0x4'));var fs=require('fs');var Redis=require(_0x3421('0x5'));var db=require(_0x3421('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3421('0x7'))('rpc');var config=require(_0x3421('0x8'));var jayson=require(_0x3421('0x9'));var client=jayson[_0x3421('0xa')][_0x3421('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5469d8,_0x50e464,_0x1b152f){return new BPromise(function(_0x130625,_0x1cf6a0){return client[_0x3421('0xc')](_0x5469d8,_0x1b152f)['then'](function(_0x1f20cf){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x50e464,_0x3421('0xd'));logger['debug'](_0x3421('0xe'),_0x50e464,_0x3421('0xd'),JSON[_0x3421('0xf')](_0x1f20cf));if(_0x1f20cf[_0x3421('0x10')]){if(_0x1f20cf[_0x3421('0x10')][_0x3421('0x11')]===0x1f4){logger[_0x3421('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x50e464,_0x1f20cf[_0x3421('0x10')][_0x3421('0x12')]);return _0x1cf6a0(_0x1f20cf[_0x3421('0x10')][_0x3421('0x12')]);}logger[_0x3421('0x10')](_0x3421('0x13'),_0x50e464,_0x1f20cf[_0x3421('0x10')]['message']);return _0x130625(_0x1f20cf[_0x3421('0x10')]['message']);}else{logger[_0x3421('0x14')](_0x3421('0x13'),_0x50e464,'request\x20sent');_0x130625(_0x1f20cf[_0x3421('0x15')]['message']);}})[_0x3421('0x16')](function(_0x23694b){logger['error'](_0x3421('0x13'),_0x50e464,_0x23694b);_0x1cf6a0(_0x23694b);});});}exports[_0x3421('0x17')]=function(_0x130d3c){var _0x104cc5=this;return new Promise(function(_0x18acc1,_0x200fdd){return db[_0x3421('0x18')][_0x3421('0x19')](_0x130d3c[_0x3421('0x1a')],{'raw':_0x130d3c[_0x3421('0x1b')]?_0x130d3c[_0x3421('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x3421('0x1c')](function(_0x4b59a5){logger['info']('CreateOpenchannelQueueReport',_0x130d3c);logger[_0x3421('0x1d')](_0x3421('0x17'),_0x130d3c,JSON[_0x3421('0xf')](_0x4b59a5));_0x18acc1(_0x4b59a5);})[_0x3421('0x16')](function(_0x132e8e){logger[_0x3421('0x10')](_0x3421('0x17'),_0x132e8e[_0x3421('0x12')],_0x130d3c);_0x200fdd(_0x104cc5[_0x3421('0x10')](0x1f4,_0x132e8e[_0x3421('0x12')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x57a4af){var _0x494423=this;return new Promise(function(_0x3fef90,_0x958899){return db[_0x3421('0x18')]['update'](_0x57a4af['body'],{'raw':_0x57a4af[_0x3421('0x1b')]?_0x57a4af['options'][_0x3421('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57a4af['options']?_0x57a4af[_0x3421('0x1b')][_0x3421('0x1f')]||null:null,'attributes':_0x57a4af[_0x3421('0x1b')]?_0x57a4af[_0x3421('0x1b')][_0x3421('0x20')]||null:null,'limit':_0x57a4af['options']?_0x57a4af[_0x3421('0x1b')]['limit']||null:null})['then'](function(_0x17f501){logger['info']('UpdateOpenchannelQueueReport',_0x57a4af);logger[_0x3421('0x1d')]('UpdateOpenchannelQueueReport',_0x57a4af,JSON[_0x3421('0xf')](_0x17f501));_0x3fef90(_0x17f501);})['catch'](function(_0xc7f9fb){logger[_0x3421('0x10')]('UpdateOpenchannelQueueReport',_0xc7f9fb[_0x3421('0x12')],_0x57a4af);_0x958899(_0x494423[_0x3421('0x10')](0x1f4,_0xc7f9fb[_0x3421('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 1b24685..c7e2be3 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 _0x32af=['show','post','create','put','update','delete','destroy','exports','multer','path','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0x32af,0x80));var _0xf32a=function(_0x2eca02,_0x5eac2d){_0x2eca02=_0x2eca02-0x0;var _0x4bc60a=_0x32af[_0x2eca02];return _0x4bc60a;};'use strict';var multer=require(_0xf32a('0x0'));var util=require('util');var path=require(_0xf32a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf32a('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xf32a('0x3'));var config=require(_0xf32a('0x4'));var controller=require(_0xf32a('0x5'));router[_0xf32a('0x6')]('/',auth[_0xf32a('0x7')](),controller[_0xf32a('0x8')]);router['get'](_0xf32a('0x9'),auth['isAuthenticated'](),controller[_0xf32a('0xa')]);router[_0xf32a('0x6')](_0xf32a('0xb'),auth[_0xf32a('0x7')](),controller[_0xf32a('0xc')]);router[_0xf32a('0xd')]('/',auth[_0xf32a('0x7')](),controller[_0xf32a('0xe')]);router[_0xf32a('0xf')](_0xf32a('0xb'),auth[_0xf32a('0x7')](),controller[_0xf32a('0x10')]);router[_0xf32a('0x11')](_0xf32a('0xb'),auth[_0xf32a('0x7')](),controller[_0xf32a('0x12')]);module[_0xf32a('0x13')]=router; \ No newline at end of file +var _0xfbd2=['express','fs-extra','../../components/interaction/service','../../config/environment','get','index','describe','isAuthenticated','show','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x5021cd,_0x26b3bb){var _0x33a315=function(_0x287fca){while(--_0x287fca){_0x5021cd['push'](_0x5021cd['shift']());}};_0x33a315(++_0x26b3bb);}(_0xfbd2,0x1bf));var _0x2fbd=function(_0x232e12,_0x15b8dc){_0x232e12=_0x232e12-0x0;var _0x212284=_0xfbd2[_0x232e12];return _0x212284;};'use strict';var multer=require(_0x2fbd('0x0'));var util=require(_0x2fbd('0x1'));var path=require(_0x2fbd('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fbd('0x3'));var router=express['Router']();var fs_extra=require(_0x2fbd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2fbd('0x5'));var config=require(_0x2fbd('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0x2fbd('0x7')]('/',auth['isAuthenticated'](),controller[_0x2fbd('0x8')]);router[_0x2fbd('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x2fbd('0x9')]);router[_0x2fbd('0x7')]('/:id',auth[_0x2fbd('0xa')](),controller[_0x2fbd('0xb')]);router['post']('/',auth[_0x2fbd('0xa')](),controller[_0x2fbd('0xc')]);router[_0x2fbd('0xd')](_0x2fbd('0xe'),auth[_0x2fbd('0xa')](),controller[_0x2fbd('0xf')]);router[_0x2fbd('0x10')](_0x2fbd('0xe'),auth[_0x2fbd('0xa')](),controller[_0x2fbd('0x11')]);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 fb1fe57..4f1fc9e 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x5b3883,_0x2c118b){var _0x22ec8e=function(_0x41ca55){while(--_0x41ca55){_0x5b3883['push'](_0x5b3883['shift']());}};_0x22ec8e(++_0x2c118b);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x5a7d41,_0x4447e2){var _0x98d8fa=function(_0x2ce1cf){while(--_0x2ce1cf){_0x5a7d41['push'](_0x5a7d41['shift']());}};_0x98d8fa(++_0x4447e2);}(_0x9bde,0xe1));var _0xe9bd=function(_0x38c50a,_0x29bdbc){_0x38c50a=_0x38c50a-0x0;var _0x50b70c=_0x9bde[_0x38c50a];return _0x50b70c;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index ba6d01e..44cfcfa 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 _0x920e=['papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','key','map','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','keys','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring'];(function(_0x35e06d,_0xad434c){var _0x1b7a39=function(_0x40efcb){while(--_0x40efcb){_0x35e06d['push'](_0x35e06d['shift']());}};_0x1b7a39(++_0xad434c);}(_0x920e,0x120));var _0xe920=function(_0x15cff3,_0x3658f8){_0x15cff3=_0x15cff3-0x0;var _0x4e321c=_0x920e[_0x15cff3];return _0x4e321c;};'use strict';var emlformat=require(_0xe920('0x0'));var rimraf=require(_0xe920('0x1'));var zipdir=require(_0xe920('0x2'));var jsonpatch=require(_0xe920('0x3'));var rp=require(_0xe920('0x4'));var moment=require('moment');var BPromise=require(_0xe920('0x5'));var Mustache=require(_0xe920('0x6'));var util=require(_0xe920('0x7'));var path=require(_0xe920('0x8'));var sox=require(_0xe920('0x9'));var csv=require(_0xe920('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe920('0xb'));var _=require(_0xe920('0xc'));var squel=require(_0xe920('0xd'));var crypto=require(_0xe920('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe920('0xa'));var querystring=require(_0xe920('0xf'));var Papa=require(_0xe920('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe920('0x11'));var hardwareService=require(_0xe920('0x12'));var logger=require(_0xe920('0x13'))(_0xe920('0x14'));var utils=require('../../config/utils');var config=require(_0xe920('0x15'));var licenseUtil=require(_0xe920('0x16'));var db=require(_0xe920('0x17'))['db'];function respondWithStatusCode(_0x578d84,_0x1be0bc){_0x1be0bc=_0x1be0bc||0xcc;return function(_0x2b3bd0){if(_0x2b3bd0){return _0x578d84[_0xe920('0x18')](_0x1be0bc);}return _0x578d84[_0xe920('0x19')](_0x1be0bc)['end']();};}function respondWithResult(_0x2c3add,_0x162a5e){_0x162a5e=_0x162a5e||0xc8;return function(_0x545fa0){if(_0x545fa0){return _0x2c3add[_0xe920('0x19')](_0x162a5e)[_0xe920('0x1a')](_0x545fa0);}};}function respondWithFilteredResult(_0x3a0094,_0x353a31){return function(_0x3cce7f){if(_0x3cce7f){var _0x58f3fc=typeof _0x353a31[_0xe920('0x1b')]===_0xe920('0x1c')&&typeof _0x353a31['limit']===_0xe920('0x1c');var _0x3e86ca=_0x3cce7f[_0xe920('0x1d')];var _0x4b0c8e=_0x58f3fc?0x0:_0x353a31['offset'];var _0x1f28ba=_0x58f3fc?_0x3cce7f[_0xe920('0x1d')]:_0x353a31[_0xe920('0x1b')]+_0x353a31[_0xe920('0x1e')];var _0x723eac;if(_0x1f28ba>=_0x3e86ca){_0x1f28ba=_0x3e86ca;_0x723eac=0xc8;}else{_0x723eac=0xce;}_0x3a0094['status'](_0x723eac);return _0x3a0094[_0xe920('0x1f')](_0xe920('0x20'),_0x4b0c8e+'-'+_0x1f28ba+'/'+_0x3e86ca)[_0xe920('0x1a')](_0x3cce7f);}return null;};}function patchUpdates(_0x150891){return function(_0x3ce6e5){try{jsonpatch['apply'](_0x3ce6e5,_0x150891,!![]);}catch(_0x210bcb){return BPromise[_0xe920('0x21')](_0x210bcb);}return _0x3ce6e5[_0xe920('0x22')]();};}function saveUpdates(_0x1ceaff,_0x173655){return function(_0x8a69cc){if(_0x8a69cc){return _0x8a69cc[_0xe920('0x23')](_0x1ceaff)[_0xe920('0x24')](function(_0x5988c){return _0x5988c;});}return null;};}function removeEntity(_0x29e0e9,_0x186468){return function(_0x2ebc2e){if(_0x2ebc2e){return _0x2ebc2e[_0xe920('0x25')]()[_0xe920('0x24')](function(){_0x29e0e9[_0xe920('0x19')](0xcc)[_0xe920('0x26')]();});}};}function handleEntityNotFound(_0x23c874,_0x32b46e){return function(_0x352689){if(!_0x352689){_0x23c874[_0xe920('0x18')](0x194);}return _0x352689;};}function handleError(_0x4cd5da,_0xe09caa){_0xe09caa=_0xe09caa||0x1f4;return function(_0x562757){logger[_0xe920('0x27')](_0x562757[_0xe920('0x28')]);if(_0x562757[_0xe920('0x29')]){delete _0x562757[_0xe920('0x29')];}_0x4cd5da[_0xe920('0x19')](_0xe09caa)[_0xe920('0x2a')](_0x562757);};}exports[_0xe920('0x2b')]=function(_0xb9bae,_0x21b922){var _0x16c85f={},_0x69cf7={},_0x74a38c={'count':0x0,'rows':[]};var _0x367970=_['map'](db[_0xe920('0x2c')][_0xe920('0x2d')],function(_0x27b54b){return{'name':_0x27b54b[_0xe920('0x2e')],'type':_0x27b54b['type'][_0xe920('0x2f')]};});_0x69cf7['model']=_[_0xe920('0x30')](_0x367970,'name');_0x69cf7[_0xe920('0x31')]=_['keys'](_0xb9bae['query']);_0x69cf7['filters']=_[_0xe920('0x32')](_0x69cf7['model'],_0x69cf7[_0xe920('0x31')]);_0x16c85f[_0xe920('0x33')]=_[_0xe920('0x32')](_0x69cf7[_0xe920('0x34')],qs['fields'](_0xb9bae['query'][_0xe920('0x35')]));_0x16c85f[_0xe920('0x33')]=_0x16c85f['attributes'][_0xe920('0x36')]?_0x16c85f[_0xe920('0x33')]:_0x69cf7[_0xe920('0x34')];if(!_0xb9bae[_0xe920('0x31')][_0xe920('0x37')](_0xe920('0x38'))){_0x16c85f[_0xe920('0x1e')]=qs[_0xe920('0x1e')](_0xb9bae[_0xe920('0x31')][_0xe920('0x1e')]);_0x16c85f[_0xe920('0x1b')]=qs[_0xe920('0x1b')](_0xb9bae[_0xe920('0x31')][_0xe920('0x1b')]);}_0x16c85f[_0xe920('0x39')]=qs[_0xe920('0x3a')](_0xb9bae[_0xe920('0x31')]['sort']);_0x16c85f[_0xe920('0x3b')]=qs['filters'](_[_0xe920('0x3c')](_0xb9bae['query'],_0x69cf7[_0xe920('0x3d')]),_0x367970);if(_0xb9bae[_0xe920('0x31')][_0xe920('0x3e')]){_0x16c85f[_0xe920('0x3b')]=_[_0xe920('0x3f')](_0x16c85f[_0xe920('0x3b')],{'$or':_[_0xe920('0x30')](_0x367970,function(_0x38a830){if(_0x38a830[_0xe920('0x40')]!==_0xe920('0x41')){var _0x2d7536={};_0x2d7536[_0x38a830[_0xe920('0x29')]]={'$like':'%'+_0xb9bae['query']['filter']+'%'};return _0x2d7536;}})});}_0x16c85f=_['merge']({},_0x16c85f,_0xb9bae['options']);var _0x6fd843={'where':_0x16c85f[_0xe920('0x3b')]};return db[_0xe920('0x2c')][_0xe920('0x1d')](_0x6fd843)[_0xe920('0x24')](function(_0x1849c9){_0x74a38c[_0xe920('0x1d')]=_0x1849c9;if(_0xb9bae[_0xe920('0x31')][_0xe920('0x42')]){_0x16c85f[_0xe920('0x43')]=[{'all':!![]}];}return db[_0xe920('0x2c')][_0xe920('0x44')](_0x16c85f);})[_0xe920('0x24')](function(_0x2f2786){_0x74a38c['rows']=_0x2f2786;return _0x74a38c;})[_0xe920('0x24')](respondWithFilteredResult(_0x21b922,_0x16c85f))[_0xe920('0x45')](handleError(_0x21b922,null));};exports['show']=function(_0xb99960,_0x523980){var _0x456bb8={'raw':!![],'where':{'id':_0xb99960['params']['id']}},_0x3f0eee={};_0x3f0eee[_0xe920('0x34')]=_[_0xe920('0x46')](db[_0xe920('0x2c')][_0xe920('0x2d')]);_0x3f0eee[_0xe920('0x31')]=_[_0xe920('0x46')](_0xb99960[_0xe920('0x31')]);_0x3f0eee['filters']=_[_0xe920('0x32')](_0x3f0eee[_0xe920('0x34')],_0x3f0eee[_0xe920('0x31')]);_0x456bb8[_0xe920('0x33')]=_['intersection'](_0x3f0eee[_0xe920('0x34')],qs['fields'](_0xb99960['query'][_0xe920('0x35')]));_0x456bb8[_0xe920('0x33')]=_0x456bb8['attributes'][_0xe920('0x36')]?_0x456bb8[_0xe920('0x33')]:_0x3f0eee[_0xe920('0x34')];if(_0xb99960[_0xe920('0x31')][_0xe920('0x42')]){_0x456bb8[_0xe920('0x43')]=[{'all':!![]}];}_0x456bb8=_[_0xe920('0x3f')]({},_0x456bb8,_0xb99960['options']);return db['OpenchannelTransferReport'][_0xe920('0x47')](_0x456bb8)[_0xe920('0x24')](handleEntityNotFound(_0x523980,null))[_0xe920('0x24')](respondWithResult(_0x523980,null))[_0xe920('0x45')](handleError(_0x523980,null));};exports[_0xe920('0x48')]=function(_0x578920,_0x245da2){return db[_0xe920('0x2c')][_0xe920('0x48')](_0x578920[_0xe920('0x49')],{})[_0xe920('0x24')](respondWithResult(_0x245da2,0xc9))['catch'](handleError(_0x245da2,null));};exports['update']=function(_0x2d1414,_0x252a87){if(_0x2d1414['body']['id']){delete _0x2d1414[_0xe920('0x49')]['id'];}return db['OpenchannelTransferReport'][_0xe920('0x47')]({'where':{'id':_0x2d1414[_0xe920('0x4a')]['id']}})[_0xe920('0x24')](handleEntityNotFound(_0x252a87,null))[_0xe920('0x24')](saveUpdates(_0x2d1414[_0xe920('0x49')],null))[_0xe920('0x24')](respondWithResult(_0x252a87,null))[_0xe920('0x45')](handleError(_0x252a87,null));};exports['destroy']=function(_0x30b997,_0x311c21){return db[_0xe920('0x2c')][_0xe920('0x47')]({'where':{'id':_0x30b997[_0xe920('0x4a')]['id']}})['then'](handleEntityNotFound(_0x311c21,null))[_0xe920('0x24')](removeEntity(_0x311c21,null))[_0xe920('0x45')](handleError(_0x311c21,null));};exports[_0xe920('0x4b')]=function(_0x5dce4f,_0x10f7d7){return db['OpenchannelTransferReport'][_0xe920('0x4b')]()[_0xe920('0x24')](respondWithResult(_0x10f7d7,null))[_0xe920('0x45')](handleError(_0x10f7d7,null));}; \ No newline at end of file +var _0xb5a7=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model'];(function(_0x47a459,_0x104bfc){var _0x2c6d92=function(_0x34b771){while(--_0x34b771){_0x47a459['push'](_0x47a459['shift']());}};_0x2c6d92(++_0x104bfc);}(_0xb5a7,0x146));var _0x7b5a=function(_0x298662,_0x4c89d0){_0x298662=_0x298662-0x0;var _0x36d173=_0xb5a7[_0x298662];return _0x36d173;};'use strict';var emlformat=require(_0x7b5a('0x0'));var rimraf=require(_0x7b5a('0x1'));var zipdir=require(_0x7b5a('0x2'));var jsonpatch=require(_0x7b5a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7b5a('0x4'));var Mustache=require(_0x7b5a('0x5'));var util=require(_0x7b5a('0x6'));var path=require(_0x7b5a('0x7'));var sox=require(_0x7b5a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b5a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7b5a('0xa'));var deskjs=require(_0x7b5a('0xb'));var toCsv=require(_0x7b5a('0xc'));var querystring=require(_0x7b5a('0xd'));var Papa=require(_0x7b5a('0xe'));var Redis=require(_0x7b5a('0xf'));var authService=require(_0x7b5a('0x10'));var qs=require(_0x7b5a('0x11'));var as=require(_0x7b5a('0x12'));var hardwareService=require(_0x7b5a('0x13'));var logger=require(_0x7b5a('0x14'))(_0x7b5a('0x15'));var utils=require(_0x7b5a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7b5a('0x17'));var db=require(_0x7b5a('0x18'))['db'];function respondWithStatusCode(_0x396a83,_0x4c6baa){_0x4c6baa=_0x4c6baa||0xcc;return function(_0x4f672c){if(_0x4f672c){return _0x396a83[_0x7b5a('0x19')](_0x4c6baa);}return _0x396a83[_0x7b5a('0x1a')](_0x4c6baa)[_0x7b5a('0x1b')]();};}function respondWithResult(_0x2d9fb0,_0x1b5669){_0x1b5669=_0x1b5669||0xc8;return function(_0x30e9e6){if(_0x30e9e6){return _0x2d9fb0[_0x7b5a('0x1a')](_0x1b5669)[_0x7b5a('0x1c')](_0x30e9e6);}};}function respondWithFilteredResult(_0x55404f,_0x697da1){return function(_0x266b15){if(_0x266b15){var _0x59d5d0=typeof _0x697da1[_0x7b5a('0x1d')]===_0x7b5a('0x1e')&&typeof _0x697da1[_0x7b5a('0x1f')]===_0x7b5a('0x1e');var _0x52c387=_0x266b15['count'];var _0x3b0780=_0x59d5d0?0x0:_0x697da1[_0x7b5a('0x1d')];var _0x5ae184=_0x59d5d0?_0x266b15[_0x7b5a('0x20')]:_0x697da1[_0x7b5a('0x1d')]+_0x697da1[_0x7b5a('0x1f')];var _0x3b0dac;if(_0x5ae184>=_0x52c387){_0x5ae184=_0x52c387;_0x3b0dac=0xc8;}else{_0x3b0dac=0xce;}_0x55404f[_0x7b5a('0x1a')](_0x3b0dac);return _0x55404f[_0x7b5a('0x21')](_0x7b5a('0x22'),_0x3b0780+'-'+_0x5ae184+'/'+_0x52c387)['json'](_0x266b15);}return null;};}function patchUpdates(_0x3982fc){return function(_0x4fc782){try{jsonpatch[_0x7b5a('0x23')](_0x4fc782,_0x3982fc,!![]);}catch(_0xe9c3db){return BPromise['reject'](_0xe9c3db);}return _0x4fc782[_0x7b5a('0x24')]();};}function saveUpdates(_0x57acd5,_0x31ae1c){return function(_0x31e8c0){if(_0x31e8c0){return _0x31e8c0[_0x7b5a('0x25')](_0x57acd5)[_0x7b5a('0x26')](function(_0x4c7055){return _0x4c7055;});}return null;};}function removeEntity(_0x7cd8a1,_0xf8719c){return function(_0x48a398){if(_0x48a398){return _0x48a398[_0x7b5a('0x27')]()[_0x7b5a('0x26')](function(){_0x7cd8a1[_0x7b5a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1394da,_0x343ed4){return function(_0x19d4b0){if(!_0x19d4b0){_0x1394da[_0x7b5a('0x19')](0x194);}return _0x19d4b0;};}function handleError(_0x4d5dcc,_0x1d2410){_0x1d2410=_0x1d2410||0x1f4;return function(_0x2dec0c){logger['error'](_0x2dec0c[_0x7b5a('0x28')]);if(_0x2dec0c[_0x7b5a('0x29')]){delete _0x2dec0c[_0x7b5a('0x29')];}_0x4d5dcc[_0x7b5a('0x1a')](_0x1d2410)[_0x7b5a('0x2a')](_0x2dec0c);};}exports['index']=function(_0x2b5bc6,_0x64abb4){var _0x5badf5={},_0x6c8f15={},_0x40d08a={'count':0x0,'rows':[]};var _0xf576bc=_[_0x7b5a('0x2b')](db[_0x7b5a('0x2c')][_0x7b5a('0x2d')],function(_0xa2de85){return{'name':_0xa2de85[_0x7b5a('0x2e')],'type':_0xa2de85[_0x7b5a('0x2f')]['key']};});_0x6c8f15[_0x7b5a('0x30')]=_[_0x7b5a('0x2b')](_0xf576bc,_0x7b5a('0x29'));_0x6c8f15[_0x7b5a('0x31')]=_[_0x7b5a('0x32')](_0x2b5bc6[_0x7b5a('0x31')]);_0x6c8f15[_0x7b5a('0x33')]=_[_0x7b5a('0x34')](_0x6c8f15[_0x7b5a('0x30')],_0x6c8f15[_0x7b5a('0x31')]);_0x5badf5[_0x7b5a('0x35')]=_[_0x7b5a('0x34')](_0x6c8f15[_0x7b5a('0x30')],qs[_0x7b5a('0x36')](_0x2b5bc6['query']['fields']));_0x5badf5[_0x7b5a('0x35')]=_0x5badf5[_0x7b5a('0x35')][_0x7b5a('0x37')]?_0x5badf5[_0x7b5a('0x35')]:_0x6c8f15[_0x7b5a('0x30')];if(!_0x2b5bc6[_0x7b5a('0x31')]['hasOwnProperty'](_0x7b5a('0x38'))){_0x5badf5['limit']=qs[_0x7b5a('0x1f')](_0x2b5bc6[_0x7b5a('0x31')][_0x7b5a('0x1f')]);_0x5badf5['offset']=qs[_0x7b5a('0x1d')](_0x2b5bc6['query'][_0x7b5a('0x1d')]);}_0x5badf5[_0x7b5a('0x39')]=qs[_0x7b5a('0x3a')](_0x2b5bc6['query']['sort']);_0x5badf5[_0x7b5a('0x3b')]=qs[_0x7b5a('0x33')](_[_0x7b5a('0x3c')](_0x2b5bc6['query'],_0x6c8f15['filters']),_0xf576bc);if(_0x2b5bc6[_0x7b5a('0x31')][_0x7b5a('0x3d')]){_0x5badf5['where']=_[_0x7b5a('0x3e')](_0x5badf5[_0x7b5a('0x3b')],{'$or':_[_0x7b5a('0x2b')](_0xf576bc,function(_0x3275ac){if(_0x3275ac[_0x7b5a('0x2f')]!==_0x7b5a('0x3f')){var _0x295389={};_0x295389[_0x3275ac[_0x7b5a('0x29')]]={'$like':'%'+_0x2b5bc6[_0x7b5a('0x31')][_0x7b5a('0x3d')]+'%'};return _0x295389;}})});}_0x5badf5=_[_0x7b5a('0x3e')]({},_0x5badf5,_0x2b5bc6[_0x7b5a('0x40')]);var _0x4290e7={'where':_0x5badf5[_0x7b5a('0x3b')]};return db[_0x7b5a('0x2c')][_0x7b5a('0x20')](_0x4290e7)[_0x7b5a('0x26')](function(_0x2fad51){_0x40d08a['count']=_0x2fad51;if(_0x2b5bc6[_0x7b5a('0x31')][_0x7b5a('0x41')]){_0x5badf5[_0x7b5a('0x42')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x7b5a('0x43')](_0x5badf5);})[_0x7b5a('0x26')](function(_0x3bfa78){_0x40d08a['rows']=_0x3bfa78;return _0x40d08a;})['then'](respondWithFilteredResult(_0x64abb4,_0x5badf5))['catch'](handleError(_0x64abb4,null));};exports[_0x7b5a('0x44')]=function(_0x1d9fde,_0x1effe9){var _0x51fe50={'raw':!![],'where':{'id':_0x1d9fde[_0x7b5a('0x45')]['id']}},_0x319573={};_0x319573[_0x7b5a('0x30')]=_[_0x7b5a('0x32')](db[_0x7b5a('0x2c')][_0x7b5a('0x2d')]);_0x319573[_0x7b5a('0x31')]=_[_0x7b5a('0x32')](_0x1d9fde[_0x7b5a('0x31')]);_0x319573['filters']=_['intersection'](_0x319573[_0x7b5a('0x30')],_0x319573['query']);_0x51fe50[_0x7b5a('0x35')]=_['intersection'](_0x319573['model'],qs[_0x7b5a('0x36')](_0x1d9fde['query'][_0x7b5a('0x36')]));_0x51fe50[_0x7b5a('0x35')]=_0x51fe50[_0x7b5a('0x35')][_0x7b5a('0x37')]?_0x51fe50[_0x7b5a('0x35')]:_0x319573['model'];if(_0x1d9fde[_0x7b5a('0x31')]['includeAll']){_0x51fe50[_0x7b5a('0x42')]=[{'all':!![]}];}_0x51fe50=_[_0x7b5a('0x3e')]({},_0x51fe50,_0x1d9fde[_0x7b5a('0x40')]);return db['OpenchannelTransferReport'][_0x7b5a('0x46')](_0x51fe50)[_0x7b5a('0x26')](handleEntityNotFound(_0x1effe9,null))[_0x7b5a('0x26')](respondWithResult(_0x1effe9,null))[_0x7b5a('0x47')](handleError(_0x1effe9,null));};exports[_0x7b5a('0x48')]=function(_0x246fa9,_0x5b6a88){return db['OpenchannelTransferReport'][_0x7b5a('0x48')](_0x246fa9['body'],{})[_0x7b5a('0x26')](respondWithResult(_0x5b6a88,0xc9))['catch'](handleError(_0x5b6a88,null));};exports[_0x7b5a('0x25')]=function(_0xf8aac6,_0xcdafed){if(_0xf8aac6['body']['id']){delete _0xf8aac6[_0x7b5a('0x49')]['id'];}return db[_0x7b5a('0x2c')][_0x7b5a('0x46')]({'where':{'id':_0xf8aac6['params']['id']}})[_0x7b5a('0x26')](handleEntityNotFound(_0xcdafed,null))[_0x7b5a('0x26')](saveUpdates(_0xf8aac6[_0x7b5a('0x49')],null))[_0x7b5a('0x26')](respondWithResult(_0xcdafed,null))[_0x7b5a('0x47')](handleError(_0xcdafed,null));};exports[_0x7b5a('0x27')]=function(_0x33e3e9,_0x137aa9){return db['OpenchannelTransferReport'][_0x7b5a('0x46')]({'where':{'id':_0x33e3e9[_0x7b5a('0x45')]['id']}})[_0x7b5a('0x26')](handleEntityNotFound(_0x137aa9,null))[_0x7b5a('0x26')](removeEntity(_0x137aa9,null))['catch'](handleError(_0x137aa9,null));};exports[_0x7b5a('0x4a')]=function(_0x22b7b4,_0x2829fe){return db['OpenchannelTransferReport'][_0x7b5a('0x4a')]()[_0x7b5a('0x26')](respondWithResult(_0x2829fe,null))[_0x7b5a('0x47')](handleError(_0x2829fe,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index fe95017..8a27003 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 _0x3b67=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','moment','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports'];(function(_0x40a8a1,_0x5835e0){var _0x1393e9=function(_0x1b0a47){while(--_0x1b0a47){_0x40a8a1['push'](_0x40a8a1['shift']());}};_0x1393e9(++_0x5835e0);}(_0x3b67,0x116));var _0x73b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3b67[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x73b6('0x0'));var util=require(_0x73b6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x73b6('0x2'));var BPromise=require('bluebird');var rp=require(_0x73b6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73b6('0x4'));var config=require(_0x73b6('0x5'));var attributes=require(_0x73b6('0x6'));module[_0x73b6('0x7')]=function(_0x2f0f06,_0x59ea11){return _0x2f0f06['define'](_0x73b6('0x8'),attributes,{'tableName':_0x73b6('0x9'),'paranoid':![],'indexes':[{'name':_0x73b6('0xa'),'fields':[_0x73b6('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd2e7=['bluebird','path','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','api','moment'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0xd2e7,0x171));var _0x7d2e=function(_0xa0982d,_0x43f6fa){_0xa0982d=_0xa0982d-0x0;var _0x59c7d4=_0xd2e7[_0xa0982d];return _0x59c7d4;};'use strict';var _=require('lodash');var util=require(_0x7d2e('0x0'));var logger=require('../../config/logger')(_0x7d2e('0x1'));var moment=require(_0x7d2e('0x2'));var BPromise=require(_0x7d2e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d2e('0x4'));var rimraf=require(_0x7d2e('0x5'));var config=require(_0x7d2e('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0x7d2e('0x7')]=function(_0x455371,_0x4db06e){return _0x455371[_0x7d2e('0x8')](_0x7d2e('0x9'),attributes,{'tableName':_0x7d2e('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7d2e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 37f679b..7276cbc 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 _0x3baf=['http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3be20a,_0x223336){var _0x7382f6=function(_0x41c98f){while(--_0x41c98f){_0x3be20a['push'](_0x3be20a['shift']());}};_0x7382f6(++_0x223336);}(_0x3baf,0xf7));var _0xf3ba=function(_0x9b01d9,_0x4802b0){_0x9b01d9=_0x9b01d9-0x0;var _0x401588=_0x3baf[_0x9b01d9];return _0x401588;};'use strict';var _=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var moment=require(_0xf3ba('0x2'));var BPromise=require(_0xf3ba('0x3'));var rs=require(_0xf3ba('0x4'));var fs=require('fs');var Redis=require(_0xf3ba('0x5'));var db=require(_0xf3ba('0x6'))['db'];var utils=require(_0xf3ba('0x7'));var logger=require(_0xf3ba('0x8'))(_0xf3ba('0x9'));var config=require(_0xf3ba('0xa'));var jayson=require(_0xf3ba('0xb'));var client=jayson[_0xf3ba('0xc')][_0xf3ba('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1284b7,_0x4de144,_0x579135){return new BPromise(function(_0x5ab058,_0x32f810){return client['request'](_0x1284b7,_0x579135)[_0xf3ba('0xe')](function(_0x1a2166){logger[_0xf3ba('0xf')](_0xf3ba('0x10'),_0x4de144,_0xf3ba('0x11'));logger[_0xf3ba('0x12')](_0xf3ba('0x13'),_0x4de144,_0xf3ba('0x11'),JSON[_0xf3ba('0x14')](_0x1a2166));if(_0x1a2166[_0xf3ba('0x15')]){if(_0x1a2166[_0xf3ba('0x15')][_0xf3ba('0x16')]===0x1f4){logger[_0xf3ba('0x15')](_0xf3ba('0x10'),_0x4de144,_0x1a2166[_0xf3ba('0x15')][_0xf3ba('0x17')]);return _0x32f810(_0x1a2166[_0xf3ba('0x15')][_0xf3ba('0x17')]);}logger['error'](_0xf3ba('0x10'),_0x4de144,_0x1a2166['error'][_0xf3ba('0x17')]);return _0x5ab058(_0x1a2166[_0xf3ba('0x15')][_0xf3ba('0x17')]);}else{logger[_0xf3ba('0xf')](_0xf3ba('0x10'),_0x4de144,'request\x20sent');_0x5ab058(_0x1a2166[_0xf3ba('0x18')][_0xf3ba('0x17')]);}})[_0xf3ba('0x19')](function(_0x550dd3){logger[_0xf3ba('0x15')](_0xf3ba('0x10'),_0x4de144,_0x550dd3);_0x32f810(_0x550dd3);});});} \ No newline at end of file +var _0x2494=['../../config/utils','../../config/environment','client','http','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5242d4,_0x26630e){var _0x299c33=function(_0x43be20){while(--_0x43be20){_0x5242d4['push'](_0x5242d4['shift']());}};_0x299c33(++_0x26630e);}(_0x2494,0x82));var _0x4249=function(_0x107fd8,_0x2d2f18){_0x107fd8=_0x107fd8-0x0;var _0x8b1bfb=_0x2494[_0x107fd8];return _0x8b1bfb;};'use strict';var _=require(_0x4249('0x0'));var util=require('util');var moment=require(_0x4249('0x1'));var BPromise=require(_0x4249('0x2'));var rs=require(_0x4249('0x3'));var fs=require('fs');var Redis=require(_0x4249('0x4'));var db=require(_0x4249('0x5'))['db'];var utils=require(_0x4249('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4249('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4249('0x8')][_0x4249('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xed716a,_0x5b1b17,_0x326336){return new BPromise(function(_0x2b7934,_0x21060d){return client['request'](_0xed716a,_0x326336)['then'](function(_0x3efaa6){logger[_0x4249('0xa')](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));logger[_0x4249('0xd')](_0x4249('0xe'),_0x5b1b17,_0x4249('0xc'),JSON['stringify'](_0x3efaa6));if(_0x3efaa6['error']){if(_0x3efaa6[_0x4249('0xf')]['code']===0x1f4){logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6['error'][_0x4249('0x10')]);return _0x21060d(_0x3efaa6[_0x4249('0xf')]['message']);}logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);return _0x2b7934(_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);}else{logger['info'](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));_0x2b7934(_0x3efaa6['result'][_0x4249('0x10')]);}})['catch'](function(_0x501e9c){logger['error'](_0x4249('0xb'),_0x5b1b17,_0x501e9c);_0x21060d(_0x501e9c);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index d207dc1..19555ee 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 _0x1d0d=['delete','destroy','exports','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','show','post','update'];(function(_0x38f8fd,_0x2630c9){var _0x440f0a=function(_0x5ca5d3){while(--_0x5ca5d3){_0x38f8fd['push'](_0x38f8fd['shift']());}};_0x440f0a(++_0x2630c9);}(_0x1d0d,0x183));var _0xd1d0=function(_0x30b01a,_0x1970b1){_0x30b01a=_0x30b01a-0x0;var _0x4b6104=_0x1d0d[_0x30b01a];return _0x4b6104;};'use strict';var multer=require('multer');var util=require(_0xd1d0('0x0'));var path=require(_0xd1d0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd1d0('0x2'));var interaction=require(_0xd1d0('0x3'));var config=require(_0xd1d0('0x4'));var controller=require(_0xd1d0('0x5'));router['get']('/',auth[_0xd1d0('0x6')](),controller[_0xd1d0('0x7')]);router[_0xd1d0('0x8')](_0xd1d0('0x9'),auth[_0xd1d0('0x6')](),controller[_0xd1d0('0xa')]);router[_0xd1d0('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd1d0('0x9'),auth['isAuthenticated'](),controller[_0xd1d0('0xc')]);router[_0xd1d0('0xd')](_0xd1d0('0x9'),auth[_0xd1d0('0x6')](),controller[_0xd1d0('0xe')]);module[_0xd1d0('0xf')]=router; \ No newline at end of file +var _0xfd5b=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','index','/:id','show','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x38278,_0x393966){var _0x198370=function(_0x104610){while(--_0x104610){_0x38278['push'](_0x38278['shift']());}};_0x198370(++_0x393966);}(_0xfd5b,0x89));var _0xbfd5=function(_0x2ff683,_0xae5aaa){_0x2ff683=_0x2ff683-0x0;var _0x23f0e2=_0xfd5b[_0x2ff683];return _0x23f0e2;};'use strict';var multer=require(_0xbfd5('0x0'));var util=require(_0xbfd5('0x1'));var path=require('path');var timeout=require(_0xbfd5('0x2'));var express=require(_0xbfd5('0x3'));var router=express[_0xbfd5('0x4')]();var fs_extra=require(_0xbfd5('0x5'));var auth=require(_0xbfd5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbfd5('0x7'));var controller=require(_0xbfd5('0x8'));router[_0xbfd5('0x9')]('/',auth['isAuthenticated'](),controller[_0xbfd5('0xa')]);router['get'](_0xbfd5('0xb'),auth['isAuthenticated'](),controller[_0xbfd5('0xc')]);router['post']('/',auth[_0xbfd5('0xd')](),controller[_0xbfd5('0xe')]);router[_0xbfd5('0xf')](_0xbfd5('0xb'),auth[_0xbfd5('0xd')](),controller[_0xbfd5('0x10')]);router[_0xbfd5('0x11')](_0xbfd5('0xb'),auth[_0xbfd5('0xd')](),controller[_0xbfd5('0x12')]);module[_0xbfd5('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 124f7c9..026a63a 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 _0x9f26=['sequelize','exports','STRING','name'];(function(_0x5051fc,_0x32fec2){var _0x5aee49=function(_0x1c05f8){while(--_0x1c05f8){_0x5051fc['push'](_0x5051fc['shift']());}};_0x5aee49(++_0x32fec2);}(_0x9f26,0x198));var _0x69f2=function(_0x184920,_0x154b2c){_0x184920=_0x184920-0x0;var _0x22f406=_0x9f26[_0x184920];return _0x22f406;};'use strict';var Sequelize=require(_0x69f2('0x0'));module[_0x69f2('0x1')]={'name':{'type':Sequelize[_0x69f2('0x2')],'unique':_0x69f2('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x69f2('0x2')]}}; \ No newline at end of file +var _0xd077=['sequelize','exports','STRING'];(function(_0x437725,_0x5b0e1f){var _0x30b510=function(_0x1172fa){while(--_0x1172fa){_0x437725['push'](_0x437725['shift']());}};_0x30b510(++_0x5b0e1f);}(_0xd077,0x1e3));var _0x7d07=function(_0x2c45a5,_0x5ef843){_0x2c45a5=_0x2c45a5-0x0;var _0x291748=_0xd077[_0x2c45a5];return _0x291748;};'use strict';var Sequelize=require(_0x7d07('0x0'));module[_0x7d07('0x1')]={'name':{'type':Sequelize[_0x7d07('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x7d07('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index ba9d57d..3f7e822 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 _0x3b19=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','role','UserProfileSection','autoAssociation','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','update','then','get','Pauses','UserProfileResource','destroy','error','stack','name','index','Pause','rawAttributes','model','map'];(function(_0x1e4050,_0x414f48){var _0x33890c=function(_0x4ea3e4){while(--_0x4ea3e4){_0x1e4050['push'](_0x1e4050['shift']());}};_0x33890c(++_0x414f48);}(_0x3b19,0x1e3));var _0x93b1=function(_0xaeaaff,_0x57c226){_0xaeaaff=_0xaeaaff-0x0;var _0x12168f=_0x3b19[_0xaeaaff];return _0x12168f;};'use strict';var emlformat=require(_0x93b1('0x0'));var rimraf=require(_0x93b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x93b1('0x2'));var moment=require(_0x93b1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x93b1('0x4'));var util=require(_0x93b1('0x5'));var path=require(_0x93b1('0x6'));var sox=require(_0x93b1('0x7'));var csv=require(_0x93b1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93b1('0x9'));var _=require(_0x93b1('0xa'));var squel=require(_0x93b1('0xb'));var crypto=require(_0x93b1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x93b1('0xd'));var toCsv=require(_0x93b1('0x8'));var querystring=require(_0x93b1('0xe'));var Papa=require(_0x93b1('0xf'));var Redis=require(_0x93b1('0x10'));var authService=require(_0x93b1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x93b1('0x12'));var hardwareService=require(_0x93b1('0x13'));var logger=require(_0x93b1('0x14'))(_0x93b1('0x15'));var utils=require('../../config/utils');var config=require(_0x93b1('0x16'));var licenseUtil=require(_0x93b1('0x17'));var db=require(_0x93b1('0x18'))['db'];function respondWithStatusCode(_0x2b4ca0,_0x3dc7be){_0x3dc7be=_0x3dc7be||0xcc;return function(_0x595218){if(_0x595218){return _0x2b4ca0[_0x93b1('0x19')](_0x3dc7be);}return _0x2b4ca0[_0x93b1('0x1a')](_0x3dc7be)[_0x93b1('0x1b')]();};}function respondWithResult(_0x165e56,_0x1a806e){_0x1a806e=_0x1a806e||0xc8;return function(_0x358869){if(_0x358869){return _0x165e56[_0x93b1('0x1a')](_0x1a806e)[_0x93b1('0x1c')](_0x358869);}};}function respondWithFilteredResult(_0xbca1e4,_0x363869){return function(_0x3d57d9){if(_0x3d57d9){var _0x4f235d=typeof _0x363869[_0x93b1('0x1d')]==='undefined'&&typeof _0x363869[_0x93b1('0x1e')]===_0x93b1('0x1f');var _0x1a988c=_0x3d57d9['count'];var _0x45a18e=_0x4f235d?0x0:_0x363869[_0x93b1('0x1d')];var _0x2e0c68=_0x4f235d?_0x3d57d9[_0x93b1('0x20')]:_0x363869[_0x93b1('0x1d')]+_0x363869['limit'];var _0x3c0c74;if(_0x2e0c68>=_0x1a988c){_0x2e0c68=_0x1a988c;_0x3c0c74=0xc8;}else{_0x3c0c74=0xce;}_0xbca1e4[_0x93b1('0x1a')](_0x3c0c74);return _0xbca1e4['set'](_0x93b1('0x21'),_0x45a18e+'-'+_0x2e0c68+'/'+_0x1a988c)['json'](_0x3d57d9);}return null;};}function patchUpdates(_0x2a7acb){return function(_0xd69887){try{jsonpatch[_0x93b1('0x22')](_0xd69887,_0x2a7acb,!![]);}catch(_0x5a53ae){return BPromise['reject'](_0x5a53ae);}return _0xd69887['save']();};}function saveUpdates(_0x54efe8,_0xba41b1){return function(_0x419505){if(_0x419505){return _0x419505[_0x93b1('0x23')](_0x54efe8)[_0x93b1('0x24')](function(_0x3ef5b8){return _0x3ef5b8;});}return null;};}function removeEntity(_0x24b101,_0x234d1d){return function(_0x559270){if(_0x559270){return _0x559270['destroy']()[_0x93b1('0x24')](function(){var _0x55c7f7=_0x559270[_0x93b1('0x25')]({'plain':!![]});var _0x4f2b15=_0x93b1('0x26');return db[_0x93b1('0x27')][_0x93b1('0x28')]({'where':{'type':_0x4f2b15,'resourceId':_0x55c7f7['id']}})[_0x93b1('0x24')](function(){return _0x559270;});})['then'](function(){_0x24b101['status'](0xcc)[_0x93b1('0x1b')]();});}};}function handleEntityNotFound(_0x5c7f61,_0x283204){return function(_0xc2fbbc){if(!_0xc2fbbc){_0x5c7f61[_0x93b1('0x19')](0x194);}return _0xc2fbbc;};}function handleError(_0x46639f,_0x109e36){_0x109e36=_0x109e36||0x1f4;return function(_0x4991c5){logger[_0x93b1('0x29')](_0x4991c5[_0x93b1('0x2a')]);if(_0x4991c5[_0x93b1('0x2b')]){delete _0x4991c5[_0x93b1('0x2b')];}_0x46639f[_0x93b1('0x1a')](_0x109e36)['send'](_0x4991c5);};}exports[_0x93b1('0x2c')]=function(_0x408025,_0x1eb44d){var _0x3942a0={},_0x58b245={},_0x320d68={'count':0x0,'rows':[]};var _0x2fd103=_['map'](db[_0x93b1('0x2d')][_0x93b1('0x2e')],function(_0x5a08d4){return{'name':_0x5a08d4['fieldName'],'type':_0x5a08d4['type']['key']};});_0x58b245[_0x93b1('0x2f')]=_[_0x93b1('0x30')](_0x2fd103,_0x93b1('0x2b'));_0x58b245[_0x93b1('0x31')]=_['keys'](_0x408025[_0x93b1('0x31')]);_0x58b245[_0x93b1('0x32')]=_[_0x93b1('0x33')](_0x58b245[_0x93b1('0x2f')],_0x58b245[_0x93b1('0x31')]);_0x3942a0['attributes']=_[_0x93b1('0x33')](_0x58b245[_0x93b1('0x2f')],qs[_0x93b1('0x34')](_0x408025[_0x93b1('0x31')]['fields']));_0x3942a0[_0x93b1('0x35')]=_0x3942a0[_0x93b1('0x35')][_0x93b1('0x36')]?_0x3942a0[_0x93b1('0x35')]:_0x58b245[_0x93b1('0x2f')];if(!_0x408025[_0x93b1('0x31')][_0x93b1('0x37')](_0x93b1('0x38'))){_0x3942a0[_0x93b1('0x1e')]=qs[_0x93b1('0x1e')](_0x408025[_0x93b1('0x31')][_0x93b1('0x1e')]);_0x3942a0['offset']=qs[_0x93b1('0x1d')](_0x408025['query'][_0x93b1('0x1d')]);}_0x3942a0['order']=qs[_0x93b1('0x39')](_0x408025[_0x93b1('0x31')][_0x93b1('0x39')]);_0x3942a0[_0x93b1('0x3a')]=qs[_0x93b1('0x32')](_['pick'](_0x408025[_0x93b1('0x31')],_0x58b245['filters']),_0x2fd103);if(_0x408025['query']['filter']){_0x3942a0[_0x93b1('0x3a')]=_['merge'](_0x3942a0[_0x93b1('0x3a')],{'$or':_[_0x93b1('0x30')](_0x2fd103,function(_0x2e1f22){if(_0x2e1f22['type']!=='VIRTUAL'){var _0x1be2f4={};_0x1be2f4[_0x2e1f22[_0x93b1('0x2b')]]={'$like':'%'+_0x408025[_0x93b1('0x31')][_0x93b1('0x3b')]+'%'};return _0x1be2f4;}})});}_0x3942a0=_['merge']({},_0x3942a0,_0x408025[_0x93b1('0x3c')]);var _0x5d0168={'where':_0x3942a0['where']};return db[_0x93b1('0x2d')][_0x93b1('0x20')](_0x5d0168)['then'](function(_0x2c8718){_0x320d68[_0x93b1('0x20')]=_0x2c8718;if(_0x408025[_0x93b1('0x31')][_0x93b1('0x3d')]){_0x3942a0[_0x93b1('0x3e')]=[{'all':!![]}];}return db[_0x93b1('0x2d')][_0x93b1('0x3f')](_0x3942a0);})['then'](function(_0x3bcddf){_0x320d68[_0x93b1('0x40')]=_0x3bcddf;return _0x320d68;})[_0x93b1('0x24')](respondWithFilteredResult(_0x1eb44d,_0x3942a0))[_0x93b1('0x41')](handleError(_0x1eb44d,null));};exports[_0x93b1('0x42')]=function(_0x5be942,_0x3c65a5){var _0xd9981a={'raw':!![],'where':{'id':_0x5be942[_0x93b1('0x43')]['id']}},_0x462bc6={};_0x462bc6['model']=_[_0x93b1('0x44')](db[_0x93b1('0x2d')][_0x93b1('0x2e')]);_0x462bc6[_0x93b1('0x31')]=_[_0x93b1('0x44')](_0x5be942[_0x93b1('0x31')]);_0x462bc6[_0x93b1('0x32')]=_[_0x93b1('0x33')](_0x462bc6[_0x93b1('0x2f')],_0x462bc6['query']);_0xd9981a[_0x93b1('0x35')]=_[_0x93b1('0x33')](_0x462bc6[_0x93b1('0x2f')],qs[_0x93b1('0x34')](_0x5be942[_0x93b1('0x31')][_0x93b1('0x34')]));_0xd9981a[_0x93b1('0x35')]=_0xd9981a[_0x93b1('0x35')][_0x93b1('0x36')]?_0xd9981a[_0x93b1('0x35')]:_0x462bc6[_0x93b1('0x2f')];if(_0x5be942[_0x93b1('0x31')]['includeAll']){_0xd9981a[_0x93b1('0x3e')]=[{'all':!![]}];}_0xd9981a=_['merge']({},_0xd9981a,_0x5be942[_0x93b1('0x3c')]);return db[_0x93b1('0x2d')][_0x93b1('0x45')](_0xd9981a)[_0x93b1('0x24')](handleEntityNotFound(_0x3c65a5,null))['then'](respondWithResult(_0x3c65a5,null))[_0x93b1('0x41')](handleError(_0x3c65a5,null));};exports[_0x93b1('0x46')]=function(_0x50ca85,_0x106fe2){return db['Pause'][_0x93b1('0x46')](_0x50ca85[_0x93b1('0x47')],{})[_0x93b1('0x24')](function(_0x677a6e){var _0x452cb7=_0x50ca85[_0x93b1('0x48')][_0x93b1('0x25')]({'plain':!![]});if(!_0x452cb7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x452cb7[_0x93b1('0x49')]==='user'){var _0x52cc33=_0x677a6e[_0x93b1('0x25')]({'plain':!![]});var _0x2943cf=_0x93b1('0x26');return db[_0x93b1('0x4a')][_0x93b1('0x45')]({'where':{'name':_0x2943cf,'userProfileId':_0x452cb7['userProfileId']},'raw':!![]})[_0x93b1('0x24')](function(_0x1d952c){if(_0x1d952c&&_0x1d952c[_0x93b1('0x4b')]===0x0){return db['UserProfileResource'][_0x93b1('0x46')]({'name':_0x52cc33[_0x93b1('0x2b')],'resourceId':_0x52cc33['id'],'type':_0x1d952c[_0x93b1('0x2b')],'sectionId':_0x1d952c['id']},{})[_0x93b1('0x24')](function(){return _0x677a6e;});}else{return _0x677a6e;}})['catch'](function(_0x36ede6){logger[_0x93b1('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36ede6);throw _0x36ede6;});}return _0x677a6e;})[_0x93b1('0x24')](respondWithResult(_0x106fe2,0xc9))[_0x93b1('0x41')](handleError(_0x106fe2,null));};exports[_0x93b1('0x23')]=function(_0x4c3e48,_0x4f7af4){if(_0x4c3e48[_0x93b1('0x47')]['id']){delete _0x4c3e48['body']['id'];}return db[_0x93b1('0x2d')][_0x93b1('0x45')]({'where':{'id':_0x4c3e48[_0x93b1('0x43')]['id']}})[_0x93b1('0x24')](handleEntityNotFound(_0x4f7af4,null))['then'](saveUpdates(_0x4c3e48['body'],null))[_0x93b1('0x24')](respondWithResult(_0x4f7af4,null))[_0x93b1('0x41')](handleError(_0x4f7af4,null));};exports[_0x93b1('0x28')]=function(_0x221a0b,_0x221e86){return db[_0x93b1('0x2d')][_0x93b1('0x45')]({'where':{'id':_0x221a0b[_0x93b1('0x43')]['id']}})[_0x93b1('0x24')](handleEntityNotFound(_0x221e86,null))[_0x93b1('0x24')](removeEntity(_0x221e86,null))['catch'](handleError(_0x221e86,null));}; \ No newline at end of file +var _0xafd7=['name','map','Pause','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','find','create','body','user','role','Pauses','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','set','Content-Range','apply','save','update','destroy','then','get','UserProfileResource','sendStatus','stack'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xafd7,0xc7));var _0x7afd=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xafd7[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7afd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7afd('0x1'));var rp=require(_0x7afd('0x2'));var moment=require(_0x7afd('0x3'));var BPromise=require(_0x7afd('0x4'));var Mustache=require(_0x7afd('0x5'));var util=require(_0x7afd('0x6'));var path=require(_0x7afd('0x7'));var sox=require(_0x7afd('0x8'));var csv=require(_0x7afd('0x9'));var ejs=require(_0x7afd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7afd('0xb'));var squel=require('squel');var crypto=require(_0x7afd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7afd('0xd'));var toCsv=require(_0x7afd('0x9'));var querystring=require(_0x7afd('0xe'));var Papa=require('papaparse');var Redis=require(_0x7afd('0xf'));var authService=require(_0x7afd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7afd('0x11'));var hardwareService=require(_0x7afd('0x12'));var logger=require(_0x7afd('0x13'))(_0x7afd('0x14'));var utils=require('../../config/utils');var config=require(_0x7afd('0x15'));var licenseUtil=require(_0x7afd('0x16'));var db=require(_0x7afd('0x17'))['db'];function respondWithStatusCode(_0x212a62,_0x4c2ddc){_0x4c2ddc=_0x4c2ddc||0xcc;return function(_0x2089b9){if(_0x2089b9){return _0x212a62['sendStatus'](_0x4c2ddc);}return _0x212a62[_0x7afd('0x18')](_0x4c2ddc)[_0x7afd('0x19')]();};}function respondWithResult(_0x240e40,_0x51a51a){_0x51a51a=_0x51a51a||0xc8;return function(_0x425f5a){if(_0x425f5a){return _0x240e40['status'](_0x51a51a)[_0x7afd('0x1a')](_0x425f5a);}};}function respondWithFilteredResult(_0x15f57f,_0x333231){return function(_0x24f505){if(_0x24f505){var _0x5e83d3=typeof _0x333231[_0x7afd('0x1b')]==='undefined'&&typeof _0x333231[_0x7afd('0x1c')]===_0x7afd('0x1d');var _0x196976=_0x24f505['count'];var _0x182dff=_0x5e83d3?0x0:_0x333231[_0x7afd('0x1b')];var _0x385a6f=_0x5e83d3?_0x24f505['count']:_0x333231['offset']+_0x333231[_0x7afd('0x1c')];var _0xe376e4;if(_0x385a6f>=_0x196976){_0x385a6f=_0x196976;_0xe376e4=0xc8;}else{_0xe376e4=0xce;}_0x15f57f[_0x7afd('0x18')](_0xe376e4);return _0x15f57f[_0x7afd('0x1e')](_0x7afd('0x1f'),_0x182dff+'-'+_0x385a6f+'/'+_0x196976)[_0x7afd('0x1a')](_0x24f505);}return null;};}function patchUpdates(_0x453450){return function(_0x430ff3){try{jsonpatch[_0x7afd('0x20')](_0x430ff3,_0x453450,!![]);}catch(_0x24848e){return BPromise['reject'](_0x24848e);}return _0x430ff3[_0x7afd('0x21')]();};}function saveUpdates(_0x380f02,_0x43c225){return function(_0x117384){if(_0x117384){return _0x117384[_0x7afd('0x22')](_0x380f02)['then'](function(_0xaf4109){return _0xaf4109;});}return null;};}function removeEntity(_0x49f380,_0x4d4fa1){return function(_0xa6c900){if(_0xa6c900){return _0xa6c900[_0x7afd('0x23')]()[_0x7afd('0x24')](function(){var _0x208b6c=_0xa6c900[_0x7afd('0x25')]({'plain':!![]});var _0x4e6ffe='Pauses';return db[_0x7afd('0x26')]['destroy']({'where':{'type':_0x4e6ffe,'resourceId':_0x208b6c['id']}})[_0x7afd('0x24')](function(){return _0xa6c900;});})[_0x7afd('0x24')](function(){_0x49f380[_0x7afd('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x132da4,_0x55b58e){return function(_0x362ae6){if(!_0x362ae6){_0x132da4[_0x7afd('0x27')](0x194);}return _0x362ae6;};}function handleError(_0x4bfe33,_0x4948da){_0x4948da=_0x4948da||0x1f4;return function(_0x4e0a86){logger['error'](_0x4e0a86[_0x7afd('0x28')]);if(_0x4e0a86[_0x7afd('0x29')]){delete _0x4e0a86[_0x7afd('0x29')];}_0x4bfe33[_0x7afd('0x18')](_0x4948da)['send'](_0x4e0a86);};}exports['index']=function(_0x4cd851,_0xea1f20){var _0x5bc658={},_0xbe6b05={},_0x5a3fce={'count':0x0,'rows':[]};var _0x403035=_[_0x7afd('0x2a')](db[_0x7afd('0x2b')]['rawAttributes'],function(_0xe6490e){return{'name':_0xe6490e['fieldName'],'type':_0xe6490e[_0x7afd('0x2c')][_0x7afd('0x2d')]};});_0xbe6b05[_0x7afd('0x2e')]=_[_0x7afd('0x2a')](_0x403035,_0x7afd('0x29'));_0xbe6b05[_0x7afd('0x2f')]=_['keys'](_0x4cd851[_0x7afd('0x2f')]);_0xbe6b05[_0x7afd('0x30')]=_[_0x7afd('0x31')](_0xbe6b05['model'],_0xbe6b05[_0x7afd('0x2f')]);_0x5bc658[_0x7afd('0x32')]=_[_0x7afd('0x31')](_0xbe6b05[_0x7afd('0x2e')],qs[_0x7afd('0x33')](_0x4cd851[_0x7afd('0x2f')][_0x7afd('0x33')]));_0x5bc658['attributes']=_0x5bc658[_0x7afd('0x32')]['length']?_0x5bc658[_0x7afd('0x32')]:_0xbe6b05[_0x7afd('0x2e')];if(!_0x4cd851[_0x7afd('0x2f')][_0x7afd('0x34')]('nolimit')){_0x5bc658[_0x7afd('0x1c')]=qs[_0x7afd('0x1c')](_0x4cd851[_0x7afd('0x2f')][_0x7afd('0x1c')]);_0x5bc658[_0x7afd('0x1b')]=qs[_0x7afd('0x1b')](_0x4cd851[_0x7afd('0x2f')]['offset']);}_0x5bc658[_0x7afd('0x35')]=qs[_0x7afd('0x36')](_0x4cd851[_0x7afd('0x2f')][_0x7afd('0x36')]);_0x5bc658['where']=qs[_0x7afd('0x30')](_[_0x7afd('0x37')](_0x4cd851[_0x7afd('0x2f')],_0xbe6b05[_0x7afd('0x30')]),_0x403035);if(_0x4cd851[_0x7afd('0x2f')][_0x7afd('0x38')]){_0x5bc658[_0x7afd('0x39')]=_['merge'](_0x5bc658[_0x7afd('0x39')],{'$or':_[_0x7afd('0x2a')](_0x403035,function(_0x313e99){if(_0x313e99[_0x7afd('0x2c')]!==_0x7afd('0x3a')){var _0x3857fa={};_0x3857fa[_0x313e99[_0x7afd('0x29')]]={'$like':'%'+_0x4cd851[_0x7afd('0x2f')][_0x7afd('0x38')]+'%'};return _0x3857fa;}})});}_0x5bc658=_[_0x7afd('0x3b')]({},_0x5bc658,_0x4cd851[_0x7afd('0x3c')]);var _0x40e06f={'where':_0x5bc658[_0x7afd('0x39')]};return db['Pause'][_0x7afd('0x3d')](_0x40e06f)[_0x7afd('0x24')](function(_0x221a3f){_0x5a3fce[_0x7afd('0x3d')]=_0x221a3f;if(_0x4cd851['query'][_0x7afd('0x3e')]){_0x5bc658[_0x7afd('0x3f')]=[{'all':!![]}];}return db[_0x7afd('0x2b')][_0x7afd('0x40')](_0x5bc658);})[_0x7afd('0x24')](function(_0x1daca8){_0x5a3fce[_0x7afd('0x41')]=_0x1daca8;return _0x5a3fce;})['then'](respondWithFilteredResult(_0xea1f20,_0x5bc658))[_0x7afd('0x42')](handleError(_0xea1f20,null));};exports['show']=function(_0x3ad9e6,_0x347fce){var _0x591227={'raw':!![],'where':{'id':_0x3ad9e6[_0x7afd('0x43')]['id']}},_0x31e8e1={};_0x31e8e1[_0x7afd('0x2e')]=_[_0x7afd('0x44')](db['Pause'][_0x7afd('0x45')]);_0x31e8e1[_0x7afd('0x2f')]=_[_0x7afd('0x44')](_0x3ad9e6[_0x7afd('0x2f')]);_0x31e8e1[_0x7afd('0x30')]=_[_0x7afd('0x31')](_0x31e8e1['model'],_0x31e8e1[_0x7afd('0x2f')]);_0x591227['attributes']=_[_0x7afd('0x31')](_0x31e8e1[_0x7afd('0x2e')],qs[_0x7afd('0x33')](_0x3ad9e6[_0x7afd('0x2f')]['fields']));_0x591227[_0x7afd('0x32')]=_0x591227[_0x7afd('0x32')][_0x7afd('0x46')]?_0x591227['attributes']:_0x31e8e1[_0x7afd('0x2e')];if(_0x3ad9e6[_0x7afd('0x2f')][_0x7afd('0x3e')]){_0x591227[_0x7afd('0x3f')]=[{'all':!![]}];}_0x591227=_['merge']({},_0x591227,_0x3ad9e6[_0x7afd('0x3c')]);return db[_0x7afd('0x2b')][_0x7afd('0x47')](_0x591227)[_0x7afd('0x24')](handleEntityNotFound(_0x347fce,null))['then'](respondWithResult(_0x347fce,null))[_0x7afd('0x42')](handleError(_0x347fce,null));};exports[_0x7afd('0x48')]=function(_0x51acbf,_0x4141b2){return db[_0x7afd('0x2b')][_0x7afd('0x48')](_0x51acbf[_0x7afd('0x49')],{})[_0x7afd('0x24')](function(_0x451edf){var _0x30c163=_0x51acbf[_0x7afd('0x4a')]['get']({'plain':!![]});if(!_0x30c163)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30c163[_0x7afd('0x4b')]===_0x7afd('0x4a')){var _0x2f87e7=_0x451edf[_0x7afd('0x25')]({'plain':!![]});var _0x12d9d7=_0x7afd('0x4c');return db['UserProfileSection'][_0x7afd('0x47')]({'where':{'name':_0x12d9d7,'userProfileId':_0x30c163['userProfileId']},'raw':!![]})[_0x7afd('0x24')](function(_0x16778e){if(_0x16778e&&_0x16778e[_0x7afd('0x4d')]===0x0){return db['UserProfileResource'][_0x7afd('0x48')]({'name':_0x2f87e7[_0x7afd('0x29')],'resourceId':_0x2f87e7['id'],'type':_0x16778e['name'],'sectionId':_0x16778e['id']},{})[_0x7afd('0x24')](function(){return _0x451edf;});}else{return _0x451edf;}})[_0x7afd('0x42')](function(_0x5d26e4){logger[_0x7afd('0x4e')](_0x7afd('0x4f'),_0x5d26e4);throw _0x5d26e4;});}return _0x451edf;})[_0x7afd('0x24')](respondWithResult(_0x4141b2,0xc9))['catch'](handleError(_0x4141b2,null));};exports[_0x7afd('0x22')]=function(_0x33e0c1,_0xbc65a){if(_0x33e0c1[_0x7afd('0x49')]['id']){delete _0x33e0c1[_0x7afd('0x49')]['id'];}return db[_0x7afd('0x2b')][_0x7afd('0x47')]({'where':{'id':_0x33e0c1[_0x7afd('0x43')]['id']}})[_0x7afd('0x24')](handleEntityNotFound(_0xbc65a,null))[_0x7afd('0x24')](saveUpdates(_0x33e0c1[_0x7afd('0x49')],null))[_0x7afd('0x24')](respondWithResult(_0xbc65a,null))[_0x7afd('0x42')](handleError(_0xbc65a,null));};exports[_0x7afd('0x23')]=function(_0x9da2e7,_0x317976){return db[_0x7afd('0x2b')][_0x7afd('0x47')]({'where':{'id':_0x9da2e7['params']['id']}})['then'](handleEntityNotFound(_0x317976,null))[_0x7afd('0x24')](removeEntity(_0x317976,null))[_0x7afd('0x42')](handleError(_0x317976,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 0d4533b..da27786 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 _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x56e93e,_0x4178e9){var _0x38b08d=function(_0x3de465){while(--_0x3de465){_0x56e93e['push'](_0x56e93e['shift']());}};_0x38b08d(++_0x4178e9);}(_0x8ef6,0xf2));var _0x68ef=function(_0x16d5df,_0x288395){_0x16d5df=_0x16d5df-0x0;var _0x49f27a=_0x8ef6[_0x16d5df];return _0x49f27a;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0xbc10bd,_0x191169){var _0x38d750=function(_0xf37dd8){while(--_0xf37dd8){_0xbc10bd['push'](_0xbc10bd['shift']());}};_0x38d750(++_0x191169);}(_0x1cb9,0x14e));var _0x91cb=function(_0x34e05a,_0x16100f){_0x34e05a=_0x34e05a-0x0;var _0x2fa781=_0x1cb9[_0x34e05a];return _0x2fa781;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 2faffad..4d56b17 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(_0x1807ac,_0x5c6804){var _0xb7562b=function(_0x1727c9){while(--_0x1727c9){_0x1807ac['push'](_0x1807ac['shift']());}};_0xb7562b(++_0x5c6804);}(_0x7a54,0x106));var _0x47a5=function(_0x1b700b,_0x490c45){_0x1b700b=_0x1b700b-0x0;var _0x126890=_0x7a54[_0x1b700b];return _0x126890;};'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(_0x51c6b0,_0x1ae766){var _0x56bc12=function(_0x3e0699){while(--_0x3e0699){_0x51c6b0['push'](_0x51c6b0['shift']());}};_0x56bc12(++_0x1ae766);}(_0x7a54,0x106));var _0x47a5=function(_0xb1faf4,_0x1306b5){_0xb1faf4=_0xb1faf4-0x0;var _0x1a9d01=_0x7a54[_0xb1faf4];return _0x1a9d01;};'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 671740c..9bd5e95 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 _0x3e74=['originalname','format','%s-%s%s','basename','now','extname','file','upload','post','put','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','download','diskStorage','join','root'];(function(_0x1d0dac,_0x3f4a61){var _0xfa0cbc=function(_0x3a457b){while(--_0x3a457b){_0x1d0dac['push'](_0x1d0dac['shift']());}};_0xfa0cbc(++_0x3f4a61);}(_0x3e74,0x175));var _0x43e7=function(_0x58419a,_0x3c8d86){_0x58419a=_0x58419a-0x0;var _0x3dc5a1=_0x3e74[_0x58419a];return _0x3dc5a1;};'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'),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['show']);router[_0x43e7('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x43e7('0xd')]);var upload=multer({'storage':multer[_0x43e7('0xe')]({'destination':function(_0x5c34f4,_0x2803d9,_0x513707){_0x513707(null,path[_0x43e7('0xf')](config[_0x43e7('0x10')],'server/files/plugins'));},'filename':function(_0x3eb206,_0xc960ea,_0x2718d3){_0xc960ea[_0x43e7('0x11')]=_0xc960ea['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2718d3(null,util[_0x43e7('0x12')](_0x43e7('0x13'),path[_0x43e7('0x14')](_0xc960ea['originalname'],path['extname'](_0xc960ea[_0x43e7('0x11')])),Date[_0x43e7('0x15')](),path[_0x43e7('0x16')](_0xc960ea[_0x43e7('0x11')])));}})});router['post']('/',upload['single'](_0x43e7('0x17')),controller[_0x43e7('0x18')]);router[_0x43e7('0x19')]('/webhook',controller['webhookPost']);router[_0x43e7('0x1a')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x1b')]);router[_0x43e7('0x1c')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x1c')]);module[_0x43e7('0x1d')]=router; \ No newline at end of file +var _0xca66=['file','upload','put','/:id','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','post','single'];(function(_0x37c3ba,_0x118866){var _0x3a5317=function(_0x27b3d5){while(--_0x27b3d5){_0x37c3ba['push'](_0x37c3ba['shift']());}};_0x3a5317(++_0x118866);}(_0xca66,0x8b));var _0x6ca6=function(_0x3248c7,_0x5331e2){_0x3248c7=_0x3248c7-0x0;var _0x30c306=_0xca66[_0x3248c7];return _0x30c306;};'use strict';var multer=require(_0x6ca6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ca6('0x1'));var express=require(_0x6ca6('0x2'));var router=express[_0x6ca6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ca6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ca6('0x5'));var controller=require('./plugin.controller');router[_0x6ca6('0x6')]('/',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x8')]);router[_0x6ca6('0x6')](_0x6ca6('0x9'),controller[_0x6ca6('0xa')]);router[_0x6ca6('0x6')]('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xb')]);router[_0x6ca6('0x6')](_0x6ca6('0xc'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xd')]);var upload=multer({'storage':multer[_0x6ca6('0xe')]({'destination':function(_0x55a626,_0x38678e,_0xe39235){_0xe39235(null,path[_0x6ca6('0xf')](config[_0x6ca6('0x10')],_0x6ca6('0x11')));},'filename':function(_0x41e903,_0x4c05e9,_0x152e63){_0x4c05e9[_0x6ca6('0x12')]=_0x4c05e9['originalname'][_0x6ca6('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x152e63(null,util[_0x6ca6('0x14')](_0x6ca6('0x15'),path[_0x6ca6('0x16')](_0x4c05e9[_0x6ca6('0x12')],path[_0x6ca6('0x17')](_0x4c05e9['originalname'])),Date['now'](),path['extname'](_0x4c05e9[_0x6ca6('0x12')])));}})});router[_0x6ca6('0x18')]('/',upload[_0x6ca6('0x19')](_0x6ca6('0x1a')),controller[_0x6ca6('0x1b')]);router[_0x6ca6('0x18')](_0x6ca6('0x9'),controller['webhookPost']);router[_0x6ca6('0x1c')](_0x6ca6('0x1d'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x1e')]);router[_0x6ca6('0x1f')](_0x6ca6('0x1d'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x1f')]);module[_0x6ca6('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 af52de0..148aa2e 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 _0x70b6=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x70b6,0x1a7));var _0x670b=function(_0x57d0ac,_0xf5f513){_0x57d0ac=_0x57d0ac-0x0;var _0x3adbb4=_0x70b6[_0x57d0ac];return _0x3adbb4;};'use strict';var Sequelize=require(_0x670b('0x0'));module['exports']={'name':{'type':Sequelize[_0x670b('0x1')]},'type':{'type':Sequelize['ENUM']('html',_0x670b('0x2'))},'description':{'type':Sequelize[_0x670b('0x3')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x670b('0x1')],'comment':_0x670b('0x4')},'active':{'type':Sequelize[_0x670b('0x5')],'defaultValue':0x0,'comment':_0x670b('0x6')},'sidebar':{'type':Sequelize[_0x670b('0x7')](_0x670b('0x8'),_0x670b('0x9'),_0x670b('0xa'),_0x670b('0xb')),'defaultValue':_0x670b('0xa'),'comment':_0x670b('0xc')},'icon':{'type':Sequelize[_0x670b('0x1')]},'adminUrl':{'type':Sequelize[_0x670b('0x1')]},'agentUrl':{'type':Sequelize[_0x670b('0x1')]},'scriptName':{'type':Sequelize[_0x670b('0x1')]},'scriptPath':{'type':Sequelize[_0x670b('0x1')]}}; \ No newline at end of file +var _0xa2cd=['exports','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','ENUM','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa2cd,0x1e4));var _0xda2c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa2cd[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0xda2c('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('html',_0xda2c('0x1'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xda2c('0x2')]},'path':{'type':Sequelize['STRING'],'comment':_0xda2c('0x3')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xda2c('0x4')](_0xda2c('0x5'),_0xda2c('0x6'),_0xda2c('0x7'),_0xda2c('0x8')),'defaultValue':_0xda2c('0x7'),'comment':_0xda2c('0x9')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xda2c('0xa')]},'agentUrl':{'type':Sequelize[_0xda2c('0xa')]},'scriptName':{'type':Sequelize[_0xda2c('0xa')]},'scriptPath':{'type':Sequelize[_0xda2c('0xa')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 49c923b..aa85eca 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 _0x2c60=['Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','desk.js','to-csv','querystring','papaparse','archiver','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','save','then','get','Plugins','UserProfileResource','destroy','error','stack','name','index','Plugin','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','download','path','join','root','format','%s.zip','basename','createWriteStream','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','server/files/plugins','dirname','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','parameters','Invalid\x20manifest:\x20views\x20missing','views','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','version','html','plugins','agent','test','Warning:\x20agent\x20view\x20not\x20specified','admin','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2c60,0x15a));var _0x02c6=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x2c60[_0x2064e5];return _0x21a233;};'use strict';var emlformat=require(_0x02c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x02c6('0x1'));var jsonpatch=require(_0x02c6('0x2'));var rp=require(_0x02c6('0x3'));var moment=require(_0x02c6('0x4'));var BPromise=require(_0x02c6('0x5'));var Mustache=require(_0x02c6('0x6'));var util=require(_0x02c6('0x7'));var path=require('path');var sox=require(_0x02c6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02c6('0x9'));var squel=require('squel');var crypto=require(_0x02c6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x02c6('0xb'));var toCsv=require(_0x02c6('0xc'));var querystring=require(_0x02c6('0xd'));var Papa=require(_0x02c6('0xe'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0x02c6('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02c6('0x10'));var logger=require(_0x02c6('0x11'))(_0x02c6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x02c6('0x13'))['db'];config[_0x02c6('0x14')]=_['defaults'](config[_0x02c6('0x14')],{'host':_0x02c6('0x15'),'port':0x18eb});var socket=require(_0x02c6('0x16'))(new Redis(config[_0x02c6('0x14')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x2c702b,_0x519698){_0x519698=_0x519698||0xcc;return function(_0x8e79cf){if(_0x8e79cf){return _0x2c702b[_0x02c6('0x17')](_0x519698);}return _0x2c702b[_0x02c6('0x18')](_0x519698)[_0x02c6('0x19')]();};}function respondWithResult(_0x4a4e4f,_0x5ad9ff){_0x5ad9ff=_0x5ad9ff||0xc8;return function(_0x1498f1){if(_0x1498f1){return _0x4a4e4f[_0x02c6('0x18')](_0x5ad9ff)['json'](_0x1498f1);}};}function respondWithFilteredResult(_0x126023,_0x43be00){return function(_0x41e53e){if(_0x41e53e){var _0x1649b1=typeof _0x43be00[_0x02c6('0x1a')]===_0x02c6('0x1b')&&typeof _0x43be00['limit']===_0x02c6('0x1b');var _0x276846=_0x41e53e[_0x02c6('0x1c')];var _0xa72ae5=_0x1649b1?0x0:_0x43be00[_0x02c6('0x1a')];var _0x3691e4=_0x1649b1?_0x41e53e[_0x02c6('0x1c')]:_0x43be00['offset']+_0x43be00['limit'];var _0x546bdc;if(_0x3691e4>=_0x276846){_0x3691e4=_0x276846;_0x546bdc=0xc8;}else{_0x546bdc=0xce;}_0x126023[_0x02c6('0x18')](_0x546bdc);return _0x126023[_0x02c6('0x1d')](_0x02c6('0x1e'),_0xa72ae5+'-'+_0x3691e4+'/'+_0x276846)[_0x02c6('0x1f')](_0x41e53e);}return null;};}function patchUpdates(_0x58524f){return function(_0x4ecd13){try{jsonpatch[_0x02c6('0x20')](_0x4ecd13,_0x58524f,!![]);}catch(_0x341f63){return BPromise['reject'](_0x341f63);}return _0x4ecd13[_0x02c6('0x21')]();};}function saveUpdates(_0x566167,_0x5c48e9){return function(_0x58e7d3){if(_0x58e7d3){return _0x58e7d3['update'](_0x566167)[_0x02c6('0x22')](function(_0x3a1d70){return _0x3a1d70;});}return null;};}function removeEntity(_0x259e53,_0xcd6e79){return function(_0x31f0eb){if(_0x31f0eb){return _0x31f0eb['destroy']()[_0x02c6('0x22')](function(){var _0x408e44=_0x31f0eb[_0x02c6('0x23')]({'plain':!![]});var _0x557b09=_0x02c6('0x24');return db[_0x02c6('0x25')][_0x02c6('0x26')]({'where':{'type':_0x557b09,'resourceId':_0x408e44['id']}})[_0x02c6('0x22')](function(){return _0x31f0eb;});})['then'](function(){_0x259e53[_0x02c6('0x18')](0xcc)[_0x02c6('0x19')]();});}};}function handleEntityNotFound(_0x50fbd2,_0x3a1066){return function(_0x58fabd){if(!_0x58fabd){_0x50fbd2[_0x02c6('0x17')](0x194);}return _0x58fabd;};}function handleError(_0x32deda,_0x38917b){_0x38917b=_0x38917b||0x1f4;return function(_0x14abc0){logger[_0x02c6('0x27')](_0x14abc0[_0x02c6('0x28')]);if(_0x14abc0[_0x02c6('0x29')]){delete _0x14abc0['name'];}_0x32deda['status'](_0x38917b)['send'](_0x14abc0);};}exports[_0x02c6('0x2a')]=function(_0x5d5128,_0x10cd62){var _0x4245ba={},_0x14c3ad={},_0x272212={'count':0x0,'rows':[]};var _0x11fba1=_['map'](db[_0x02c6('0x2b')][_0x02c6('0x2c')],function(_0x4dbf43){return{'name':_0x4dbf43[_0x02c6('0x2d')],'type':_0x4dbf43[_0x02c6('0x2e')][_0x02c6('0x2f')]};});_0x14c3ad[_0x02c6('0x30')]=_[_0x02c6('0x31')](_0x11fba1,_0x02c6('0x29'));_0x14c3ad[_0x02c6('0x32')]=_[_0x02c6('0x33')](_0x5d5128['query']);_0x14c3ad['filters']=_[_0x02c6('0x34')](_0x14c3ad['model'],_0x14c3ad[_0x02c6('0x32')]);_0x4245ba[_0x02c6('0x35')]=_['intersection'](_0x14c3ad[_0x02c6('0x30')],qs[_0x02c6('0x36')](_0x5d5128[_0x02c6('0x32')][_0x02c6('0x36')]));_0x4245ba[_0x02c6('0x35')]=_0x4245ba[_0x02c6('0x35')][_0x02c6('0x37')]?_0x4245ba[_0x02c6('0x35')]:_0x14c3ad[_0x02c6('0x30')];if(!_0x5d5128[_0x02c6('0x32')]['hasOwnProperty'](_0x02c6('0x38'))){_0x4245ba['limit']=qs[_0x02c6('0x39')](_0x5d5128[_0x02c6('0x32')]['limit']);_0x4245ba['offset']=qs['offset'](_0x5d5128['query'][_0x02c6('0x1a')]);}_0x4245ba[_0x02c6('0x3a')]=qs[_0x02c6('0x3b')](_0x5d5128[_0x02c6('0x32')][_0x02c6('0x3b')]);_0x4245ba[_0x02c6('0x3c')]=qs[_0x02c6('0x3d')](_[_0x02c6('0x3e')](_0x5d5128[_0x02c6('0x32')],_0x14c3ad['filters']),_0x11fba1);if(_0x5d5128['query'][_0x02c6('0x3f')]){_0x4245ba[_0x02c6('0x3c')]=_['merge'](_0x4245ba['where'],{'$or':_[_0x02c6('0x31')](_0x11fba1,function(_0x5cebf8){if(_0x5cebf8['type']!=='VIRTUAL'){var _0x2b9e20={};_0x2b9e20[_0x5cebf8[_0x02c6('0x29')]]={'$like':'%'+_0x5d5128[_0x02c6('0x32')][_0x02c6('0x3f')]+'%'};return _0x2b9e20;}})});}_0x4245ba=_[_0x02c6('0x40')]({},_0x4245ba,_0x5d5128[_0x02c6('0x41')]);var _0x5f1ff4={'where':_0x4245ba[_0x02c6('0x3c')]};return db['Plugin'][_0x02c6('0x1c')](_0x5f1ff4)[_0x02c6('0x22')](function(_0x5ecf59){_0x272212[_0x02c6('0x1c')]=_0x5ecf59;if(_0x5d5128[_0x02c6('0x32')][_0x02c6('0x42')]){_0x4245ba[_0x02c6('0x43')]=[{'all':!![]}];}return db[_0x02c6('0x2b')][_0x02c6('0x44')](_0x4245ba);})[_0x02c6('0x22')](function(_0x2e797c){_0x272212[_0x02c6('0x45')]=_0x2e797c;return _0x272212;})[_0x02c6('0x22')](respondWithFilteredResult(_0x10cd62,_0x4245ba))[_0x02c6('0x46')](handleError(_0x10cd62,null));};exports['show']=function(_0xc70b98,_0x43e823){var _0x2d4f68={'raw':!![],'where':{'id':_0xc70b98[_0x02c6('0x47')]['id']}},_0x3be083={};_0x3be083['model']=_[_0x02c6('0x33')](db[_0x02c6('0x2b')][_0x02c6('0x2c')]);_0x3be083[_0x02c6('0x32')]=_[_0x02c6('0x33')](_0xc70b98[_0x02c6('0x32')]);_0x3be083['filters']=_[_0x02c6('0x34')](_0x3be083['model'],_0x3be083[_0x02c6('0x32')]);_0x2d4f68[_0x02c6('0x35')]=_['intersection'](_0x3be083['model'],qs['fields'](_0xc70b98[_0x02c6('0x32')][_0x02c6('0x36')]));_0x2d4f68['attributes']=_0x2d4f68[_0x02c6('0x35')]['length']?_0x2d4f68[_0x02c6('0x35')]:_0x3be083[_0x02c6('0x30')];if(_0xc70b98[_0x02c6('0x32')][_0x02c6('0x42')]){_0x2d4f68[_0x02c6('0x43')]=[{'all':!![]}];}_0x2d4f68=_[_0x02c6('0x40')]({},_0x2d4f68,_0xc70b98[_0x02c6('0x41')]);return db[_0x02c6('0x2b')][_0x02c6('0x48')](_0x2d4f68)[_0x02c6('0x22')](handleEntityNotFound(_0x43e823,null))[_0x02c6('0x22')](respondWithResult(_0x43e823,null))[_0x02c6('0x46')](handleError(_0x43e823,null));};exports[_0x02c6('0x49')]=function(_0x18d8ae,_0x26b748,_0x5f5985){return db['Plugin'][_0x02c6('0x48')]({'where':{'id':_0x18d8ae['params']['id']},'attributes':[_0x02c6('0x29'),_0x02c6('0x4a')],'raw':!![]})[_0x02c6('0x22')](handleEntityNotFound(_0x26b748,null))['then'](function(_0x3293cb){if(_0x3293cb){var _0x57ce3e=path[_0x02c6('0x4b')](config[_0x02c6('0x4c')],'server/files/plugins',util[_0x02c6('0x4d')](_0x02c6('0x4e'),path[_0x02c6('0x4f')](_0x3293cb['path'])));var _0x34a025=fs[_0x02c6('0x50')](_0x57ce3e);var _0x94897=archiver(_0x02c6('0x51'),{'zlib':{'level':0x9}});_0x94897['on']('warning',function(_0x518f26){if(_0x518f26[_0x02c6('0x52')]===_0x02c6('0x53')){logger[_0x02c6('0x27')](_0x518f26);}else{throw new db[(_0x02c6('0x54'))][(_0x02c6('0x55'))](_0x02c6('0x56'));}});_0x94897['on']('error',function(_0x4e69cc){throw new db[(_0x02c6('0x54'))][(_0x02c6('0x55'))](_0x02c6('0x56'));});_0x94897['pipe'](_0x34a025);_0x94897[_0x02c6('0x57')](_0x02c6('0x58'),{'cwd':path['join'](config[_0x02c6('0x4c')],_0x02c6('0x59'),path[_0x02c6('0x5a')](_0x3293cb[_0x02c6('0x4a')])),'ignore':[path[_0x02c6('0x4b')](path[_0x02c6('0x4f')](_0x3293cb[_0x02c6('0x4a')]),_0x02c6('0x5b')),path[_0x02c6('0x4b')](path[_0x02c6('0x4f')](_0x3293cb[_0x02c6('0x4a')]),'attachments/**/*')],'nodir':!![]})[_0x02c6('0x5c')]();_0x34a025['on'](_0x02c6('0x5d'),function(){if(!fs[_0x02c6('0x5e')](_0x57ce3e)){throw new db[(_0x02c6('0x54'))][(_0x02c6('0x55'))](_0x02c6('0x5f'));}return _0x26b748['download'](_0x57ce3e,util[_0x02c6('0x4d')](_0x02c6('0x4e'),path[_0x02c6('0x4f')](_0x3293cb[_0x02c6('0x4a')])),function(_0x3d7727){if(_0x3d7727){throw new db[(_0x02c6('0x54'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x02c6('0x60')](_0x57ce3e);logger[_0x02c6('0x61')](_0x02c6('0x62'));logger[_0x02c6('0x61')](_0x02c6('0x63'));});});}return null;})[_0x02c6('0x46')](handleError(_0x26b748,null));};exports[_0x02c6('0x64')]=function(_0x2ece56,_0x28883b,_0x1ed8e4){var _0x2da98d=path[_0x02c6('0x4f')](_0x2ece56[_0x02c6('0x65')]['filename'],path['extname'](_0x2ece56[_0x02c6('0x65')]['filename']));var _0x277bfc=path['join'](config['root'],_0x02c6('0x59'),_0x2ece56['file'][_0x02c6('0x66')]);var _0x2b743e=path[_0x02c6('0x4b')](config[_0x02c6('0x4c')],_0x02c6('0x59'),_0x2da98d);logger[_0x02c6('0x61')](_0x02c6('0x67'),_0x277bfc);logger[_0x02c6('0x61')](_0x02c6('0x68'),_0x2b743e);try{fs[_0x02c6('0x69')](_0x277bfc,parseInt(_0x02c6('0x6a'),0x8));extract(_0x277bfc,{'dir':_0x2b743e},function(_0x4d7997){if(_0x4d7997){logger['error'](_0x4d7997);handleError(_0x4d7997,!![]);};var _0x20e655=fs['readdirSync'](_0x2b743e);if(_0x20e655[_0x02c6('0x37')]>0x1){removeReferences(_0x277bfc,_0x2b743e);logger[_0x02c6('0x27')](_0x02c6('0x6b'));return _0x1ed8e4(new Error(_0x02c6('0x6b')));}var _0x5c500d=fs[_0x02c6('0x6c')](path[_0x02c6('0x4b')](_0x2b743e,_0x20e655[0x0]));if(_0x5c500d[_0x02c6('0x6d')]()){removeReferences(_0x277bfc,_0x2b743e);logger[_0x02c6('0x27')]('Invalid\x20plugin\x20structure');return _0x1ed8e4(new Error(_0x02c6('0x6b')));}if(_0x5c500d['isDirectory']()){var _0xbe558e=fs[_0x02c6('0x6e')](path['join'](_0x2b743e,_0x20e655[0x0]));if(_0xbe558e['length']===0x0){removeReferences(_0x277bfc,_0x2b743e);logger[_0x02c6('0x27')](_0x02c6('0x6b'));return _0x1ed8e4(new Error(_0x02c6('0x6b')));}var _0x4464ae=_0xbe558e[_0x02c6('0x6f')](function(_0x72ebb0){return _0x72ebb0===_0x02c6('0x70');});if(!_0x4464ae){return _0x1ed8e4(new Error(_0x02c6('0x71')));}var _0xedeaed=fs[_0x02c6('0x72')](path['join'](_0x2b743e,_0x20e655[0x0],'manifest.json'));var _0x2a0da6=JSON['parse'](_0xedeaed);if(_0x02c6('0x1b')==typeof _0x2a0da6[_0x02c6('0x29')]){return _0x1ed8e4(new Error(_0x02c6('0x73')));}if(_0x02c6('0x1b')==typeof _0x2a0da6[_0x02c6('0x2e')]){return _0x1ed8e4(new Error(_0x02c6('0x74')));}if(_0x02c6('0x1b')==typeof _0x2a0da6['version']){return _0x1ed8e4(new Error(_0x02c6('0x75')));}if('undefined'==typeof _0x2a0da6['parameters']){return _0x1ed8e4(new Error(_0x02c6('0x76')));}if(_0x2a0da6[_0x02c6('0x2e')]==='html'){if(_0x02c6('0x1b')==typeof _0x2a0da6[_0x02c6('0x77')]['views']){return _0x1ed8e4(new Error(_0x02c6('0x78')));}if(_0x02c6('0x1b')==typeof _0x2a0da6[_0x02c6('0x77')]['views']['admin']&&_0x02c6('0x1b')==typeof _0x2a0da6[_0x02c6('0x77')][_0x02c6('0x79')]['agent']){return _0x1ed8e4(new Error(_0x02c6('0x7a')));}}else if(_0x2a0da6[_0x02c6('0x2e')]===_0x02c6('0x7b')){if(_0x02c6('0x1b')==typeof _0x2a0da6[_0x02c6('0x77')][_0x02c6('0x7c')]){return _0x1ed8e4(new Error(_0x02c6('0x7d')));}if(_0x02c6('0x1b')==typeof _0x2a0da6[_0x02c6('0x77')][_0x02c6('0x7e')]){return _0x1ed8e4(new Error(_0x02c6('0x7f')));}}else{return _0x1ed8e4(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x5cbe45=_0x2a0da6[_0x02c6('0x29')];var _0xacdf77=_0x2a0da6[_0x02c6('0x80')];var _0x1b70b9=_0x2a0da6[_0x02c6('0x2e')];var _0xce2918=_0x2a0da6['sidebar']?_0x2a0da6[_0x02c6('0x81')]:_0x02c6('0x82');var _0x4193ee=_0x2a0da6[_0x02c6('0x83')]?_0x2a0da6[_0x02c6('0x83')]:_0x02c6('0x84');var _0x15deef='';var _0xd77241='';var _0xe1a91='';var _0x1de5d0='';var _0x4f2c80=_0x2a0da6[_0x02c6('0x85')];if(_0x1b70b9===_0x02c6('0x86')){if(_0x02c6('0x1b')!=typeof _0x2a0da6[_0x02c6('0x77')][_0x02c6('0x79')]['admin']){var _0x3b9f45=_0x2a0da6[_0x02c6('0x77')][_0x02c6('0x79')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x3b9f45)){_0x15deef=path['join'](_0x02c6('0x87'),_0x2da98d,_0x20e655[0x0],_0x3b9f45);}else{_0x15deef=_0x3b9f45;}}else{logger[_0x02c6('0x61')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x02c6('0x1b')!=typeof _0x2a0da6[_0x02c6('0x77')][_0x02c6('0x79')][_0x02c6('0x88')]){var _0x293932=_0x2a0da6[_0x02c6('0x77')][_0x02c6('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x02c6('0x89')](_0x293932)){_0xd77241=path[_0x02c6('0x4b')](_0x02c6('0x87'),_0x2da98d,_0x20e655[0x0],_0x293932);}else{_0xd77241=_0x293932;}}else{logger['info'](_0x02c6('0x8a'));}}else if(_0x1b70b9===_0x02c6('0x7b')){_0xe1a91=_0x2a0da6[_0x02c6('0x77')][_0x02c6('0x7c')];_0x1de5d0=_0x2a0da6['parameters'][_0x02c6('0x7e')];if('undefined'!=typeof _0x2a0da6[_0x02c6('0x77')][_0x02c6('0x79')]){if(_0x02c6('0x1b')!=typeof _0x2a0da6[_0x02c6('0x77')][_0x02c6('0x79')][_0x02c6('0x8b')]){var _0x3b9f45=_0x2a0da6[_0x02c6('0x77')][_0x02c6('0x79')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x02c6('0x89')](_0x3b9f45)){_0x15deef=path[_0x02c6('0x4b')](_0x02c6('0x87'),_0x2da98d,_0x20e655[0x0],_0x3b9f45);}else{_0x15deef=_0x3b9f45;}}if('undefined'!=typeof _0x2a0da6[_0x02c6('0x77')][_0x02c6('0x79')][_0x02c6('0x88')]){var _0x293932=_0x2a0da6[_0x02c6('0x77')][_0x02c6('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x293932)){_0xd77241=path[_0x02c6('0x4b')](_0x02c6('0x87'),_0x2da98d,_0x20e655[0x0],_0x293932);}else{_0xd77241=_0x293932;}}}}var _0xa9d389={'name':_0x5cbe45,'description':_0xacdf77,'path':path[_0x02c6('0x4b')](_0x2da98d,_0x20e655[0x0]),'type':_0x1b70b9,'sidebar':_0xce2918,'icon':_0x4193ee,'adminUrl':_0x15deef,'agentUrl':_0xd77241,'scriptName':_0xe1a91,'scriptPath':_0x1de5d0,'version':_0x4f2c80};removeReferences(_0x277bfc,null);return db['Plugin'][_0x02c6('0x8c')](_0xa9d389)[_0x02c6('0x22')](function(_0x1cb026){var _0x2fa830={'role':_0x2ece56[_0x02c6('0x8d')][_0x02c6('0x8e')],'userProfileId':_0x2ece56[_0x02c6('0x8d')]['userProfileId']};if(!_0x2fa830)throw new Error(_0x02c6('0x8f'));if(_0x2fa830[_0x02c6('0x8e')]===_0x02c6('0x90')){var _0x1bdb17=_0x1cb026[_0x02c6('0x23')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Plugins','userProfileId':_0x2fa830[_0x02c6('0x91')]},'raw':!![]})[_0x02c6('0x22')](function(_0x18b5ab){if(_0x18b5ab&&_0x18b5ab[_0x02c6('0x92')]===0x0){return db[_0x02c6('0x25')][_0x02c6('0x8c')]({'name':_0x1bdb17[_0x02c6('0x29')],'resourceId':_0x1bdb17['id'],'type':_0x18b5ab[_0x02c6('0x29')],'sectionId':_0x18b5ab['id']},{})['then'](function(){return _0x1cb026;});}else{return _0x1cb026;}})[_0x02c6('0x46')](function(_0x5754fe){logger[_0x02c6('0x27')](_0x02c6('0x93'),_0x5754fe);throw _0x5754fe;});}return _0x1cb026;})[_0x02c6('0x22')](respondWithResult(_0x28883b,null))[_0x02c6('0x46')](handleError(_0x28883b,null));}});}catch(_0x302889){_0x28883b[_0x02c6('0x18')](0x1f4)[_0x02c6('0x94')](_0x302889);}};function removeReferences(_0xe00b3b,_0x5cb732){try{if(_0xe00b3b){fs[_0x02c6('0x60')](_0xe00b3b);logger[_0x02c6('0x61')]('Zip\x20archive\x20removed');}if(_0x5cb732){rimraf(_0x5cb732,function(){});logger['info'](_0x02c6('0x95'));}}catch(_0x4e9ffd){logger[_0x02c6('0x27')](_0x4e9ffd);}}exports[_0x02c6('0x96')]=function(_0x263886,_0x58f8f6,_0x3f22ed){return db['Plugin']['find']({'where':{'id':_0x263886['params']['id']}})[_0x02c6('0x22')](handleEntityNotFound(_0x58f8f6,null))[_0x02c6('0x22')](saveUpdates(_0x263886[_0x02c6('0x8d')],null))[_0x02c6('0x22')](respondWithResult(_0x58f8f6,null))['catch'](handleError(_0x58f8f6,null));};exports[_0x02c6('0x97')]=function(_0x3c7633,_0x3ec4fe,_0x24f2e1){return db[_0x02c6('0x2b')]['find']({'where':{'id':_0x3c7633[_0x02c6('0x47')]['id']}})[_0x02c6('0x22')](function(_0x16dea5){if(_0x16dea5){return _0x16dea5[_0x02c6('0x26')]();}})[_0x02c6('0x22')](function(_0x2cfdf4){rimraf(path['join'](config['root'],'server/files/plugins',path[_0x02c6('0x5a')](_0x2cfdf4['path'])),function(){});return _0x2cfdf4;})['then'](handleEntityNotFound(_0x3ec4fe,null))[_0x02c6('0x22')](respondWithStatusCode(_0x3ec4fe,null))[_0x02c6('0x46')](handleError(_0x3ec4fe,null));};exports[_0x02c6('0x98')]=function(_0x4de203,_0x52ee24,_0x1dc19e){return BPromise[_0x02c6('0x99')]()[_0x02c6('0x22')](function(){if(!_0x4de203['query']['path']){throw new Error(_0x02c6('0x9a'));}if(!_0x4de203[_0x02c6('0x32')][_0x02c6('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x384b08=_0x4de203[_0x02c6('0x32')][_0x02c6('0x9c')]?_0x4de203['query'][_0x02c6('0x9c')]+':'+_0x4de203[_0x02c6('0x32')][_0x02c6('0x9b')]:_0x02c6('0x9d')+_0x4de203[_0x02c6('0x32')][_0x02c6('0x9b')];var _0x35be60=_0x4de203[_0x02c6('0x32')]['json']?_0x4de203[_0x02c6('0x32')][_0x02c6('0x1f')]:!![];var _0x6ef0b=_0x4de203[_0x02c6('0x32')][_0x02c6('0x9e')]?_0x4de203['query'][_0x02c6('0x9e')]:null;var _0xc766ec={'method':_0x4de203[_0x02c6('0x9f')],'uri':util[_0x02c6('0x4d')](_0x02c6('0xa0'),_0x384b08,_0x4de203[_0x02c6('0x32')][_0x02c6('0x4a')]),'json':_0x35be60,'resolveWithFullResponse':!![],'encoding':_0x6ef0b,'qs':_0x4de203[_0x02c6('0x32')]};if(_0x4de203['headers']){_0xc766ec['headers']=_0x4de203[_0x02c6('0xa1')];if(_0xc766ec[_0x02c6('0xa1')][_0x02c6('0xa2')]){delete _0xc766ec[_0x02c6('0xa1')][_0x02c6('0xa2')];}}if(_0xc766ec[_0x02c6('0xa1')]['content-type']){delete _0xc766ec['headers'][_0x02c6('0xa3')];}return rp(_0xc766ec);})[_0x02c6('0x22')](function(_0x24fb56){if(_0x24fb56){_0x52ee24['set'](_0x24fb56[_0x02c6('0xa1')]);logger[_0x02c6('0x61')](_0x24fb56[_0x02c6('0x8d')]);if(_['endsWith'](_0x4de203[_0x02c6('0x32')][_0x02c6('0x4a')],_0x02c6('0x49'))&&_0x24fb56[_0x02c6('0xa4')]==0x1f4){return _0x52ee24['sendStatus'](_0x24fb56[_0x02c6('0xa4')]);}else{return _0x52ee24[_0x02c6('0x18')](_0x24fb56['statusCode'])[_0x02c6('0x94')](_0x24fb56[_0x02c6('0x8d')]);}}else{return _0x52ee24['sendStatus'](0xc8);}})[_0x02c6('0x46')](handleError(_0x52ee24,null));};exports['webhookPost']=function(_0x3ca522,_0x517dd7,_0x3df091){return BPromise[_0x02c6('0x99')]()[_0x02c6('0x22')](function(){if(!_0x3ca522[_0x02c6('0x32')][_0x02c6('0x4a')]){throw new Error(_0x02c6('0x9a'));}if(!_0x3ca522[_0x02c6('0x32')][_0x02c6('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x156083=_0x3ca522['query'][_0x02c6('0x9c')]?_0x3ca522['query']['hostname']+':'+_0x3ca522[_0x02c6('0x32')][_0x02c6('0x9b')]:_0x02c6('0x9d')+_0x3ca522[_0x02c6('0x32')]['port'];var _0x308a40=_0x3ca522[_0x02c6('0x32')][_0x02c6('0x1f')]?_0x3ca522[_0x02c6('0x32')]['json']:!![];var _0x329016=_0x3ca522[_0x02c6('0x32')][_0x02c6('0x9e')]?_0x3ca522[_0x02c6('0x32')][_0x02c6('0x9e')]:null;var _0x251809={'method':_0x3ca522[_0x02c6('0x9f')],'uri':util[_0x02c6('0x4d')](_0x02c6('0xa0'),_0x156083,_0x3ca522['query'][_0x02c6('0x4a')]),'json':_0x308a40,'resolveWithFullResponse':!![],'encoding':_0x329016,'body':_0x3ca522[_0x02c6('0x8d')]};if(_0x3ca522[_0x02c6('0xa1')]){_0x251809['headers']=_0x3ca522[_0x02c6('0xa1')];if(_0x251809[_0x02c6('0xa1')][_0x02c6('0xa2')]){delete _0x251809[_0x02c6('0xa1')]['content-length'];}}if(_0x251809['headers'][_0x02c6('0xa3')]){delete _0x251809['headers'][_0x02c6('0xa3')];}return rp(_0x251809);})[_0x02c6('0x22')](function(_0x5de7d4){if(_0x5de7d4){_0x517dd7[_0x02c6('0x1d')](_0x5de7d4['headers']);logger[_0x02c6('0x61')](_0x5de7d4['body']);return _0x517dd7[_0x02c6('0x18')](_0x5de7d4[_0x02c6('0xa4')])[_0x02c6('0x94')](_0x5de7d4[_0x02c6('0x8d')]);}else{return _0x517dd7['sendStatus'](0xc8);}})['catch'](handleError(_0x517dd7,null));}; \ No newline at end of file +var _0x0c4f=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','params','root','server/files/plugins','format','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','pipe','glob','join','dirname','attachments/**/*','finalize','close','download','%s.zip','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','admin','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','views','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','sendStatus','webhookPost','hostname','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','register','status','end','json','offset','undefined','count','limit','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','fieldName','type','key','model'];(function(_0x13851b,_0x17f043){var _0x5effec=function(_0x107a09){while(--_0x107a09){_0x13851b['push'](_0x13851b['shift']());}};_0x5effec(++_0x17f043);}(_0x0c4f,0x1bf));var _0xf0c4=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0x0c4f[_0xfbdff6];return _0x4cb9be;};'use strict';var emlformat=require(_0xf0c4('0x0'));var rimraf=require(_0xf0c4('0x1'));var zipdir=require(_0xf0c4('0x2'));var jsonpatch=require(_0xf0c4('0x3'));var rp=require(_0xf0c4('0x4'));var moment=require('moment');var BPromise=require(_0xf0c4('0x5'));var Mustache=require(_0xf0c4('0x6'));var util=require('util');var path=require(_0xf0c4('0x7'));var sox=require(_0xf0c4('0x8'));var csv=require(_0xf0c4('0x9'));var ejs=require(_0xf0c4('0xa'));var fs=require('fs');var fs_extra=require(_0xf0c4('0xb'));var _=require('lodash');var squel=require(_0xf0c4('0xc'));var crypto=require(_0xf0c4('0xd'));var jsforce=require(_0xf0c4('0xe'));var deskjs=require(_0xf0c4('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf0c4('0x10'));var Papa=require(_0xf0c4('0x11'));var extract=require(_0xf0c4('0x12'));var rimraf=require(_0xf0c4('0x1'));var archiver=require(_0xf0c4('0x13'));var Redis=require(_0xf0c4('0x14'));var authService=require(_0xf0c4('0x15'));var qs=require(_0xf0c4('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf0c4('0x17'));var utils=require(_0xf0c4('0x18'));var config=require(_0xf0c4('0x19'));var licenseUtil=require(_0xf0c4('0x1a'));var db=require(_0xf0c4('0x1b'))['db'];config[_0xf0c4('0x1c')]=_[_0xf0c4('0x1d')](config[_0xf0c4('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xf0c4('0x1e'))(new Redis(config['redis']));require(_0xf0c4('0x1f'))[_0xf0c4('0x20')](socket);function respondWithStatusCode(_0x3100d2,_0x1f70ef){_0x1f70ef=_0x1f70ef||0xcc;return function(_0x561afc){if(_0x561afc){return _0x3100d2['sendStatus'](_0x1f70ef);}return _0x3100d2[_0xf0c4('0x21')](_0x1f70ef)[_0xf0c4('0x22')]();};}function respondWithResult(_0x3c4251,_0x395ceb){_0x395ceb=_0x395ceb||0xc8;return function(_0x56ea06){if(_0x56ea06){return _0x3c4251[_0xf0c4('0x21')](_0x395ceb)[_0xf0c4('0x23')](_0x56ea06);}};}function respondWithFilteredResult(_0x3cdc4d,_0x31a3a4){return function(_0x2e5352){if(_0x2e5352){var _0x89ef86=typeof _0x31a3a4[_0xf0c4('0x24')]===_0xf0c4('0x25')&&typeof _0x31a3a4['limit']==='undefined';var _0x5add54=_0x2e5352['count'];var _0x37b075=_0x89ef86?0x0:_0x31a3a4[_0xf0c4('0x24')];var _0x4072cf=_0x89ef86?_0x2e5352[_0xf0c4('0x26')]:_0x31a3a4[_0xf0c4('0x24')]+_0x31a3a4[_0xf0c4('0x27')];var _0x24ddc8;if(_0x4072cf>=_0x5add54){_0x4072cf=_0x5add54;_0x24ddc8=0xc8;}else{_0x24ddc8=0xce;}_0x3cdc4d[_0xf0c4('0x21')](_0x24ddc8);return _0x3cdc4d['set']('Content-Range',_0x37b075+'-'+_0x4072cf+'/'+_0x5add54)[_0xf0c4('0x23')](_0x2e5352);}return null;};}function patchUpdates(_0x52fc24){return function(_0x2f186f){try{jsonpatch['apply'](_0x2f186f,_0x52fc24,!![]);}catch(_0x17ed92){return BPromise['reject'](_0x17ed92);}return _0x2f186f['save']();};}function saveUpdates(_0x3ce175,_0x455562){return function(_0x50bf7c){if(_0x50bf7c){return _0x50bf7c[_0xf0c4('0x28')](_0x3ce175)[_0xf0c4('0x29')](function(_0x49bd60){return _0x49bd60;});}return null;};}function removeEntity(_0x355780,_0x5a3a25){return function(_0xe27b61){if(_0xe27b61){return _0xe27b61[_0xf0c4('0x2a')]()[_0xf0c4('0x29')](function(){var _0x27825a=_0xe27b61[_0xf0c4('0x2b')]({'plain':!![]});var _0x4cc5a0=_0xf0c4('0x2c');return db[_0xf0c4('0x2d')]['destroy']({'where':{'type':_0x4cc5a0,'resourceId':_0x27825a['id']}})[_0xf0c4('0x29')](function(){return _0xe27b61;});})['then'](function(){_0x355780['status'](0xcc)[_0xf0c4('0x22')]();});}};}function handleEntityNotFound(_0x2f7bc2,_0x1a07eb){return function(_0x3743cb){if(!_0x3743cb){_0x2f7bc2['sendStatus'](0x194);}return _0x3743cb;};}function handleError(_0x14fecc,_0x4748a5){_0x4748a5=_0x4748a5||0x1f4;return function(_0x440d7a){logger[_0xf0c4('0x2e')](_0x440d7a[_0xf0c4('0x2f')]);if(_0x440d7a[_0xf0c4('0x30')]){delete _0x440d7a[_0xf0c4('0x30')];}_0x14fecc[_0xf0c4('0x21')](_0x4748a5)[_0xf0c4('0x31')](_0x440d7a);};}exports[_0xf0c4('0x32')]=function(_0xc675df,_0xcd2253){var _0x9f92bb={},_0x3af31e={},_0x230e5e={'count':0x0,'rows':[]};var _0x32d99a=_[_0xf0c4('0x33')](db[_0xf0c4('0x34')]['rawAttributes'],function(_0xb86937){return{'name':_0xb86937[_0xf0c4('0x35')],'type':_0xb86937[_0xf0c4('0x36')][_0xf0c4('0x37')]};});_0x3af31e[_0xf0c4('0x38')]=_[_0xf0c4('0x33')](_0x32d99a,'name');_0x3af31e[_0xf0c4('0x39')]=_[_0xf0c4('0x3a')](_0xc675df[_0xf0c4('0x39')]);_0x3af31e[_0xf0c4('0x3b')]=_[_0xf0c4('0x3c')](_0x3af31e[_0xf0c4('0x38')],_0x3af31e[_0xf0c4('0x39')]);_0x9f92bb[_0xf0c4('0x3d')]=_[_0xf0c4('0x3c')](_0x3af31e[_0xf0c4('0x38')],qs[_0xf0c4('0x3e')](_0xc675df['query'][_0xf0c4('0x3e')]));_0x9f92bb['attributes']=_0x9f92bb[_0xf0c4('0x3d')][_0xf0c4('0x3f')]?_0x9f92bb['attributes']:_0x3af31e[_0xf0c4('0x38')];if(!_0xc675df[_0xf0c4('0x39')]['hasOwnProperty'](_0xf0c4('0x40'))){_0x9f92bb[_0xf0c4('0x27')]=qs['limit'](_0xc675df[_0xf0c4('0x39')]['limit']);_0x9f92bb[_0xf0c4('0x24')]=qs['offset'](_0xc675df['query'][_0xf0c4('0x24')]);}_0x9f92bb[_0xf0c4('0x41')]=qs[_0xf0c4('0x42')](_0xc675df['query'][_0xf0c4('0x42')]);_0x9f92bb[_0xf0c4('0x43')]=qs[_0xf0c4('0x3b')](_[_0xf0c4('0x44')](_0xc675df['query'],_0x3af31e['filters']),_0x32d99a);if(_0xc675df[_0xf0c4('0x39')][_0xf0c4('0x45')]){_0x9f92bb[_0xf0c4('0x43')]=_[_0xf0c4('0x46')](_0x9f92bb[_0xf0c4('0x43')],{'$or':_['map'](_0x32d99a,function(_0x37427f){if(_0x37427f[_0xf0c4('0x36')]!==_0xf0c4('0x47')){var _0x3a97dc={};_0x3a97dc[_0x37427f[_0xf0c4('0x30')]]={'$like':'%'+_0xc675df[_0xf0c4('0x39')][_0xf0c4('0x45')]+'%'};return _0x3a97dc;}})});}_0x9f92bb=_[_0xf0c4('0x46')]({},_0x9f92bb,_0xc675df[_0xf0c4('0x48')]);var _0x2dd831={'where':_0x9f92bb[_0xf0c4('0x43')]};return db[_0xf0c4('0x34')][_0xf0c4('0x26')](_0x2dd831)[_0xf0c4('0x29')](function(_0x3f5c71){_0x230e5e['count']=_0x3f5c71;if(_0xc675df[_0xf0c4('0x39')][_0xf0c4('0x49')]){_0x9f92bb[_0xf0c4('0x4a')]=[{'all':!![]}];}return db['Plugin'][_0xf0c4('0x4b')](_0x9f92bb);})[_0xf0c4('0x29')](function(_0x3418e5){_0x230e5e[_0xf0c4('0x4c')]=_0x3418e5;return _0x230e5e;})[_0xf0c4('0x29')](respondWithFilteredResult(_0xcd2253,_0x9f92bb))[_0xf0c4('0x4d')](handleError(_0xcd2253,null));};exports[_0xf0c4('0x4e')]=function(_0x186579,_0x265d1e){var _0x56c712={'raw':!![],'where':{'id':_0x186579['params']['id']}},_0x19787f={};_0x19787f[_0xf0c4('0x38')]=_[_0xf0c4('0x3a')](db[_0xf0c4('0x34')]['rawAttributes']);_0x19787f[_0xf0c4('0x39')]=_[_0xf0c4('0x3a')](_0x186579['query']);_0x19787f[_0xf0c4('0x3b')]=_[_0xf0c4('0x3c')](_0x19787f[_0xf0c4('0x38')],_0x19787f['query']);_0x56c712[_0xf0c4('0x3d')]=_[_0xf0c4('0x3c')](_0x19787f['model'],qs[_0xf0c4('0x3e')](_0x186579[_0xf0c4('0x39')][_0xf0c4('0x3e')]));_0x56c712['attributes']=_0x56c712[_0xf0c4('0x3d')][_0xf0c4('0x3f')]?_0x56c712[_0xf0c4('0x3d')]:_0x19787f[_0xf0c4('0x38')];if(_0x186579[_0xf0c4('0x39')][_0xf0c4('0x49')]){_0x56c712['include']=[{'all':!![]}];}_0x56c712=_['merge']({},_0x56c712,_0x186579[_0xf0c4('0x48')]);return db[_0xf0c4('0x34')]['find'](_0x56c712)[_0xf0c4('0x29')](handleEntityNotFound(_0x265d1e,null))[_0xf0c4('0x29')](respondWithResult(_0x265d1e,null))['catch'](handleError(_0x265d1e,null));};exports['download']=function(_0x314f37,_0xe25e8c,_0x2e9167){return db[_0xf0c4('0x34')][_0xf0c4('0x4f')]({'where':{'id':_0x314f37[_0xf0c4('0x50')]['id']},'attributes':[_0xf0c4('0x30'),_0xf0c4('0x7')],'raw':!![]})[_0xf0c4('0x29')](handleEntityNotFound(_0xe25e8c,null))[_0xf0c4('0x29')](function(_0xd4c133){if(_0xd4c133){var _0x25c61b=path['join'](config[_0xf0c4('0x51')],_0xf0c4('0x52'),util[_0xf0c4('0x53')]('%s.zip',path[_0xf0c4('0x54')](_0xd4c133[_0xf0c4('0x7')])));var _0x42c67b=fs[_0xf0c4('0x55')](_0x25c61b);var _0x11ff7f=archiver(_0xf0c4('0x56'),{'zlib':{'level':0x9}});_0x11ff7f['on'](_0xf0c4('0x57'),function(_0x227293){if(_0x227293[_0xf0c4('0x58')]===_0xf0c4('0x59')){logger[_0xf0c4('0x2e')](_0x227293);}else{throw new db[(_0xf0c4('0x5a'))][(_0xf0c4('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x11ff7f['on'](_0xf0c4('0x2e'),function(_0x4e10d3){throw new db['Sequelize'][(_0xf0c4('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x11ff7f[_0xf0c4('0x5c')](_0x42c67b);_0x11ff7f[_0xf0c4('0x5d')]('**/*',{'cwd':path[_0xf0c4('0x5e')](config['root'],_0xf0c4('0x52'),path[_0xf0c4('0x5f')](_0xd4c133[_0xf0c4('0x7')])),'ignore':[path['join'](path[_0xf0c4('0x54')](_0xd4c133['path']),'node_modules/**/*'),path[_0xf0c4('0x5e')](path['basename'](_0xd4c133[_0xf0c4('0x7')]),_0xf0c4('0x60'))],'nodir':!![]})[_0xf0c4('0x61')]();_0x42c67b['on'](_0xf0c4('0x62'),function(){if(!fs['existsSync'](_0x25c61b)){throw new db['Sequelize'][(_0xf0c4('0x5b'))]('Plugin\x20not\x20found');}return _0xe25e8c[_0xf0c4('0x63')](_0x25c61b,util[_0xf0c4('0x53')](_0xf0c4('0x64'),path['basename'](_0xd4c133['path'])),function(_0x22195c){if(_0x22195c){throw new db[(_0xf0c4('0x5a'))][(_0xf0c4('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xf0c4('0x65')](_0x25c61b);logger[_0xf0c4('0x66')]('Download\x20completed');logger[_0xf0c4('0x66')](_0xf0c4('0x67'));});});}return null;})[_0xf0c4('0x4d')](handleError(_0xe25e8c,null));};exports[_0xf0c4('0x68')]=function(_0x7938dd,_0x1a00ec,_0x5b640c){var _0x3cb3d7=path[_0xf0c4('0x54')](_0x7938dd[_0xf0c4('0x69')][_0xf0c4('0x6a')],path['extname'](_0x7938dd['file'][_0xf0c4('0x6a')]));var _0x236136=path[_0xf0c4('0x5e')](config['root'],_0xf0c4('0x52'),_0x7938dd[_0xf0c4('0x69')][_0xf0c4('0x6a')]);var _0x183e9b=path[_0xf0c4('0x5e')](config['root'],_0xf0c4('0x52'),_0x3cb3d7);logger[_0xf0c4('0x66')](_0xf0c4('0x6b'),_0x236136);logger[_0xf0c4('0x66')]('Plugin\x20upload\x20destination:\x20%s',_0x183e9b);try{fs[_0xf0c4('0x6c')](_0x236136,parseInt(_0xf0c4('0x6d'),0x8));extract(_0x236136,{'dir':_0x183e9b},function(_0x74956f){if(_0x74956f){logger[_0xf0c4('0x2e')](_0x74956f);handleError(_0x74956f,!![]);};var _0x154c1e=fs[_0xf0c4('0x6e')](_0x183e9b);if(_0x154c1e['length']>0x1){removeReferences(_0x236136,_0x183e9b);logger[_0xf0c4('0x2e')](_0xf0c4('0x6f'));return _0x5b640c(new Error(_0xf0c4('0x6f')));}var _0x412188=fs[_0xf0c4('0x70')](path[_0xf0c4('0x5e')](_0x183e9b,_0x154c1e[0x0]));if(_0x412188[_0xf0c4('0x71')]()){removeReferences(_0x236136,_0x183e9b);logger[_0xf0c4('0x2e')]('Invalid\x20plugin\x20structure');return _0x5b640c(new Error(_0xf0c4('0x6f')));}if(_0x412188[_0xf0c4('0x72')]()){var _0x545275=fs[_0xf0c4('0x6e')](path[_0xf0c4('0x5e')](_0x183e9b,_0x154c1e[0x0]));if(_0x545275[_0xf0c4('0x3f')]===0x0){removeReferences(_0x236136,_0x183e9b);logger[_0xf0c4('0x2e')]('Invalid\x20plugin\x20structure');return _0x5b640c(new Error(_0xf0c4('0x6f')));}var _0x2e82de=_0x545275['some'](function(_0x56ac33){return _0x56ac33===_0xf0c4('0x73');});if(!_0x2e82de){return _0x5b640c(new Error('Plugin\x20manifest\x20missing'));}var _0x3b3d85=fs[_0xf0c4('0x74')](path[_0xf0c4('0x5e')](_0x183e9b,_0x154c1e[0x0],_0xf0c4('0x73')));var _0x4a4453=JSON[_0xf0c4('0x75')](_0x3b3d85);if(_0xf0c4('0x25')==typeof _0x4a4453[_0xf0c4('0x30')]){return _0x5b640c(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xf0c4('0x25')==typeof _0x4a4453['type']){return _0x5b640c(new Error(_0xf0c4('0x76')));}if('undefined'==typeof _0x4a4453[_0xf0c4('0x77')]){return _0x5b640c(new Error(_0xf0c4('0x78')));}if('undefined'==typeof _0x4a4453[_0xf0c4('0x79')]){return _0x5b640c(new Error(_0xf0c4('0x7a')));}if(_0x4a4453['type']===_0xf0c4('0x7b')){if(_0xf0c4('0x25')==typeof _0x4a4453[_0xf0c4('0x79')]['views']){return _0x5b640c(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xf0c4('0x25')==typeof _0x4a4453[_0xf0c4('0x79')]['views'][_0xf0c4('0x7c')]&&'undefined'==typeof _0x4a4453[_0xf0c4('0x79')]['views']['agent']){return _0x5b640c(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x4a4453['type']===_0xf0c4('0x7d')){if(_0xf0c4('0x25')==typeof _0x4a4453[_0xf0c4('0x79')][_0xf0c4('0x7e')]){return _0x5b640c(new Error(_0xf0c4('0x7f')));}if(_0xf0c4('0x25')==typeof _0x4a4453[_0xf0c4('0x79')][_0xf0c4('0x80')]){return _0x5b640c(new Error(_0xf0c4('0x81')));}}else{return _0x5b640c(new Error(_0xf0c4('0x82')));}var _0x5805ac=_0x4a4453[_0xf0c4('0x30')];var _0x163ed8=_0x4a4453[_0xf0c4('0x83')];var _0x5627d1=_0x4a4453[_0xf0c4('0x36')];var _0x5a5c38=_0x4a4453[_0xf0c4('0x84')]?_0x4a4453[_0xf0c4('0x84')]:_0xf0c4('0x85');var _0x5780ba=_0x4a4453[_0xf0c4('0x86')]?_0x4a4453['icon']:_0xf0c4('0x87');var _0xbde22d='';var _0x268089='';var _0x2364de='';var _0x257db7='';var _0x38be10=_0x4a4453[_0xf0c4('0x77')];if(_0x5627d1===_0xf0c4('0x7b')){if(_0xf0c4('0x25')!=typeof _0x4a4453['parameters'][_0xf0c4('0x88')]['admin']){var _0xa48316=_0x4a4453[_0xf0c4('0x79')][_0xf0c4('0x88')][_0xf0c4('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0xf0c4('0x89')](_0xa48316)){_0xbde22d=path[_0xf0c4('0x5e')](_0xf0c4('0x8a'),_0x3cb3d7,_0x154c1e[0x0],_0xa48316);}else{_0xbde22d=_0xa48316;}}else{logger[_0xf0c4('0x66')](_0xf0c4('0x8b'));}if(_0xf0c4('0x25')!=typeof _0x4a4453['parameters'][_0xf0c4('0x88')][_0xf0c4('0x8c')]){var _0xbcefe7=_0x4a4453[_0xf0c4('0x79')]['views'][_0xf0c4('0x8c')];if(!/^(f|ht)tps?:\/\//i['test'](_0xbcefe7)){_0x268089=path[_0xf0c4('0x5e')]('plugins',_0x3cb3d7,_0x154c1e[0x0],_0xbcefe7);}else{_0x268089=_0xbcefe7;}}else{logger[_0xf0c4('0x66')](_0xf0c4('0x8d'));}}else if(_0x5627d1===_0xf0c4('0x7d')){_0x2364de=_0x4a4453['parameters'][_0xf0c4('0x7e')];_0x257db7=_0x4a4453[_0xf0c4('0x79')]['scriptPath'];if(_0xf0c4('0x25')!=typeof _0x4a4453[_0xf0c4('0x79')][_0xf0c4('0x88')]){if(_0xf0c4('0x25')!=typeof _0x4a4453[_0xf0c4('0x79')][_0xf0c4('0x88')]['admin']){var _0xa48316=_0x4a4453['parameters'][_0xf0c4('0x88')][_0xf0c4('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0xf0c4('0x89')](_0xa48316)){_0xbde22d=path[_0xf0c4('0x5e')](_0xf0c4('0x8a'),_0x3cb3d7,_0x154c1e[0x0],_0xa48316);}else{_0xbde22d=_0xa48316;}}if(_0xf0c4('0x25')!=typeof _0x4a4453[_0xf0c4('0x79')]['views'][_0xf0c4('0x8c')]){var _0xbcefe7=_0x4a4453[_0xf0c4('0x79')][_0xf0c4('0x88')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xf0c4('0x89')](_0xbcefe7)){_0x268089=path['join'](_0xf0c4('0x8a'),_0x3cb3d7,_0x154c1e[0x0],_0xbcefe7);}else{_0x268089=_0xbcefe7;}}}}var _0x4f0455={'name':_0x5805ac,'description':_0x163ed8,'path':path['join'](_0x3cb3d7,_0x154c1e[0x0]),'type':_0x5627d1,'sidebar':_0x5a5c38,'icon':_0x5780ba,'adminUrl':_0xbde22d,'agentUrl':_0x268089,'scriptName':_0x2364de,'scriptPath':_0x257db7,'version':_0x38be10};removeReferences(_0x236136,null);return db['Plugin'][_0xf0c4('0x8e')](_0x4f0455)['then'](function(_0xc6e1b9){var _0x1ca87d={'role':_0x7938dd[_0xf0c4('0x8f')][_0xf0c4('0x90')],'userProfileId':_0x7938dd[_0xf0c4('0x8f')][_0xf0c4('0x91')]};if(!_0x1ca87d)throw new Error(_0xf0c4('0x92'));if(_0x1ca87d[_0xf0c4('0x90')]===_0xf0c4('0x93')){var _0x39ac65=_0xc6e1b9[_0xf0c4('0x2b')]({'plain':!![]});return db[_0xf0c4('0x94')][_0xf0c4('0x4f')]({'where':{'name':_0xf0c4('0x2c'),'userProfileId':_0x1ca87d['userProfileId']},'raw':!![]})[_0xf0c4('0x29')](function(_0x4ab0e0){if(_0x4ab0e0&&_0x4ab0e0[_0xf0c4('0x95')]===0x0){return db[_0xf0c4('0x2d')]['create']({'name':_0x39ac65[_0xf0c4('0x30')],'resourceId':_0x39ac65['id'],'type':_0x4ab0e0['name'],'sectionId':_0x4ab0e0['id']},{})['then'](function(){return _0xc6e1b9;});}else{return _0xc6e1b9;}})[_0xf0c4('0x4d')](function(_0x36f515){logger[_0xf0c4('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36f515);throw _0x36f515;});}return _0xc6e1b9;})['then'](respondWithResult(_0x1a00ec,null))[_0xf0c4('0x4d')](handleError(_0x1a00ec,null));}});}catch(_0x58478a){_0x1a00ec[_0xf0c4('0x21')](0x1f4)[_0xf0c4('0x31')](_0x58478a);}};function removeReferences(_0x4ef0d6,_0x34a4f1){try{if(_0x4ef0d6){fs[_0xf0c4('0x65')](_0x4ef0d6);logger[_0xf0c4('0x66')](_0xf0c4('0x96'));}if(_0x34a4f1){rimraf(_0x34a4f1,function(){});logger[_0xf0c4('0x66')](_0xf0c4('0x97'));}}catch(_0xa6a469){logger['error'](_0xa6a469);}}exports['update']=function(_0x1ebd66,_0x5435d2,_0x265383){return db['Plugin'][_0xf0c4('0x4f')]({'where':{'id':_0x1ebd66['params']['id']}})[_0xf0c4('0x29')](handleEntityNotFound(_0x5435d2,null))[_0xf0c4('0x29')](saveUpdates(_0x1ebd66['body'],null))[_0xf0c4('0x29')](respondWithResult(_0x5435d2,null))['catch'](handleError(_0x5435d2,null));};exports[_0xf0c4('0x98')]=function(_0x1f45d8,_0x57fb01,_0x221771){return db['Plugin'][_0xf0c4('0x4f')]({'where':{'id':_0x1f45d8['params']['id']}})[_0xf0c4('0x29')](function(_0x152c1c){if(_0x152c1c){return _0x152c1c['destroy']();}})[_0xf0c4('0x29')](function(_0x2a9f25){rimraf(path[_0xf0c4('0x5e')](config['root'],_0xf0c4('0x52'),path[_0xf0c4('0x5f')](_0x2a9f25['path'])),function(){});return _0x2a9f25;})['then'](handleEntityNotFound(_0x57fb01,null))[_0xf0c4('0x29')](respondWithStatusCode(_0x57fb01,null))[_0xf0c4('0x4d')](handleError(_0x57fb01,null));};exports['webhookGet']=function(_0xc00bc3,_0x12705c,_0xb48fbf){return BPromise[_0xf0c4('0x99')]()[_0xf0c4('0x29')](function(){if(!_0xc00bc3[_0xf0c4('0x39')][_0xf0c4('0x7')]){throw new Error(_0xf0c4('0x9a'));}if(!_0xc00bc3[_0xf0c4('0x39')][_0xf0c4('0x9b')]){throw new Error(_0xf0c4('0x9c'));}var _0x4b8b80=_0xc00bc3[_0xf0c4('0x39')]['hostname']?_0xc00bc3['query']['hostname']+':'+_0xc00bc3[_0xf0c4('0x39')][_0xf0c4('0x9b')]:_0xf0c4('0x9d')+_0xc00bc3[_0xf0c4('0x39')]['port'];var _0x2f3784=_0xc00bc3['query'][_0xf0c4('0x23')]?_0xc00bc3[_0xf0c4('0x39')][_0xf0c4('0x23')]:!![];var _0x5c71c4=_0xc00bc3[_0xf0c4('0x39')][_0xf0c4('0x9e')]?_0xc00bc3[_0xf0c4('0x39')][_0xf0c4('0x9e')]:null;var _0x24cedd={'method':_0xc00bc3[_0xf0c4('0x9f')],'uri':util[_0xf0c4('0x53')](_0xf0c4('0xa0'),_0x4b8b80,_0xc00bc3['query'][_0xf0c4('0x7')]),'json':_0x2f3784,'resolveWithFullResponse':!![],'encoding':_0x5c71c4,'qs':_0xc00bc3[_0xf0c4('0x39')]};if(_0xc00bc3[_0xf0c4('0xa1')]){_0x24cedd[_0xf0c4('0xa1')]=_0xc00bc3[_0xf0c4('0xa1')];if(_0x24cedd[_0xf0c4('0xa1')][_0xf0c4('0xa2')]){delete _0x24cedd[_0xf0c4('0xa1')][_0xf0c4('0xa2')];}}if(_0x24cedd[_0xf0c4('0xa1')][_0xf0c4('0xa3')]){delete _0x24cedd[_0xf0c4('0xa1')][_0xf0c4('0xa3')];}return rp(_0x24cedd);})['then'](function(_0x5d0c65){if(_0x5d0c65){_0x12705c['set'](_0x5d0c65[_0xf0c4('0xa1')]);logger[_0xf0c4('0x66')](_0x5d0c65[_0xf0c4('0x8f')]);if(_['endsWith'](_0xc00bc3[_0xf0c4('0x39')][_0xf0c4('0x7')],_0xf0c4('0x63'))&&_0x5d0c65[_0xf0c4('0xa4')]==0x1f4){return _0x12705c[_0xf0c4('0xa5')](_0x5d0c65[_0xf0c4('0xa4')]);}else{return _0x12705c[_0xf0c4('0x21')](_0x5d0c65[_0xf0c4('0xa4')])[_0xf0c4('0x31')](_0x5d0c65['body']);}}else{return _0x12705c[_0xf0c4('0xa5')](0xc8);}})[_0xf0c4('0x4d')](handleError(_0x12705c,null));};exports[_0xf0c4('0xa6')]=function(_0x44f70c,_0x48ec67,_0x55b73d){return BPromise[_0xf0c4('0x99')]()['then'](function(){if(!_0x44f70c[_0xf0c4('0x39')][_0xf0c4('0x7')]){throw new Error(_0xf0c4('0x9a'));}if(!_0x44f70c['query'][_0xf0c4('0x9b')]){throw new Error(_0xf0c4('0x9c'));}var _0x4d277d=_0x44f70c[_0xf0c4('0x39')][_0xf0c4('0xa7')]?_0x44f70c[_0xf0c4('0x39')][_0xf0c4('0xa7')]+':'+_0x44f70c[_0xf0c4('0x39')][_0xf0c4('0x9b')]:_0xf0c4('0x9d')+_0x44f70c[_0xf0c4('0x39')][_0xf0c4('0x9b')];var _0x1a2ee5=_0x44f70c[_0xf0c4('0x39')][_0xf0c4('0x23')]?_0x44f70c[_0xf0c4('0x39')]['json']:!![];var _0x373d25=_0x44f70c[_0xf0c4('0x39')]['encoding']?_0x44f70c['query']['encoding']:null;var _0x24a921={'method':_0x44f70c[_0xf0c4('0x9f')],'uri':util[_0xf0c4('0x53')](_0xf0c4('0xa0'),_0x4d277d,_0x44f70c[_0xf0c4('0x39')][_0xf0c4('0x7')]),'json':_0x1a2ee5,'resolveWithFullResponse':!![],'encoding':_0x373d25,'body':_0x44f70c['body']};if(_0x44f70c[_0xf0c4('0xa1')]){_0x24a921[_0xf0c4('0xa1')]=_0x44f70c[_0xf0c4('0xa1')];if(_0x24a921[_0xf0c4('0xa1')][_0xf0c4('0xa2')]){delete _0x24a921['headers'][_0xf0c4('0xa2')];}}if(_0x24a921[_0xf0c4('0xa1')][_0xf0c4('0xa3')]){delete _0x24a921[_0xf0c4('0xa1')][_0xf0c4('0xa3')];}return rp(_0x24a921);})[_0xf0c4('0x29')](function(_0x4f3fdf){if(_0x4f3fdf){_0x48ec67['set'](_0x4f3fdf[_0xf0c4('0xa1')]);logger[_0xf0c4('0x66')](_0x4f3fdf[_0xf0c4('0x8f')]);return _0x48ec67[_0xf0c4('0x21')](_0x4f3fdf[_0xf0c4('0xa4')])[_0xf0c4('0x31')](_0x4f3fdf['body']);}else{return _0x48ec67[_0xf0c4('0xa5')](0xc8);}})[_0xf0c4('0x4d')](handleError(_0x48ec67,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 72a3ecc..142927c 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 _0xfd2e=['events','Plugin','save','remove','hasOwnProperty'];(function(_0x5c2fb6,_0x313d52){var _0x11e0f9=function(_0x55ede7){while(--_0x55ede7){_0x5c2fb6['push'](_0x5c2fb6['shift']());}};_0x11e0f9(++_0x313d52);}(_0xfd2e,0x6e));var _0xefd2=function(_0x59f381,_0x3a7337){_0x59f381=_0x59f381-0x0;var _0x51ddd8=_0xfd2e[_0x59f381];return _0x51ddd8;};'use strict';var EventEmitter=require(_0xefd2('0x0'));var Plugin=require('../../mysqldb')['db'][_0xefd2('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xefd2('0x2'),'afterUpdate':'update','afterDestroy':_0xefd2('0x3')};function emitEvent(_0x1c75dd){return function(_0x2b6511,_0x11d644,_0x2e095c){PluginEvents['emit'](_0x1c75dd+':'+_0x2b6511['id'],_0x2b6511);PluginEvents['emit'](_0x1c75dd,_0x2b6511);_0x2e095c(null);};}for(var e in events){if(events[_0xefd2('0x4')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xb073=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x2110c1,_0x13e5c6){var _0xf2caee=function(_0x4ccfd1){while(--_0x4ccfd1){_0x2110c1['push'](_0x2110c1['shift']());}};_0xf2caee(++_0x13e5c6);}(_0xb073,0x187));var _0x3b07=function(_0x59e06f,_0x42c0cf){_0x59e06f=_0x59e06f-0x0;var _0x3606ff=_0xb073[_0x59e06f];return _0x3606ff;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x3b07('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x3b07('0x1')](0x0);var events={'afterCreate':_0x3b07('0x2'),'afterUpdate':_0x3b07('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3d1733){return function(_0x3112da,_0x31e382,_0x48cf22){PluginEvents[_0x3b07('0x4')](_0x3d1733+':'+_0x3112da['id'],_0x3112da);PluginEvents[_0x3b07('0x4')](_0x3d1733,_0x3112da);_0x48cf22(null);};}for(var e in events){if(events[_0x3b07('0x5')](e)){var event=events[e];Plugin[_0x3b07('0x6')](e,emitEvent(event));}}module[_0x3b07('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 156af57..d6a9533 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 _0xfd32=['api','request-promise','rimraf','../../config/environment','./plugin.attributes','define','plugins','lodash','util','../../config/logger'];(function(_0x4cafef,_0x4b4409){var _0x4e1700=function(_0x3abdd0){while(--_0x3abdd0){_0x4cafef['push'](_0x4cafef['shift']());}};_0x4e1700(++_0x4b4409);}(_0xfd32,0xd9));var _0x2fd3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd32[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2fd3('0x0'));var util=require(_0x2fd3('0x1'));var logger=require(_0x2fd3('0x2'))(_0x2fd3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2fd3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2fd3('0x5'));var config=require(_0x2fd3('0x6'));var attributes=require(_0x2fd3('0x7'));module['exports']=function(_0x16a47a,_0x49194b){return _0x16a47a[_0x2fd3('0x8')]('Plugin',attributes,{'tableName':_0x2fd3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x687a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','lodash','util','../../config/logger'];(function(_0x160d3d,_0x252ce7){var _0x1df020=function(_0x2e08b0){while(--_0x2e08b0){_0x160d3d['push'](_0x160d3d['shift']());}};_0x1df020(++_0x252ce7);}(_0x687a,0x1cb));var _0xa687=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x687a[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xa687('0x0'));var util=require(_0xa687('0x1'));var logger=require(_0xa687('0x2'))(_0xa687('0x3'));var moment=require(_0xa687('0x4'));var BPromise=require(_0xa687('0x5'));var rp=require(_0xa687('0x6'));var fs=require('fs');var path=require(_0xa687('0x7'));var rimraf=require(_0xa687('0x8'));var config=require(_0xa687('0x9'));var attributes=require(_0xa687('0xa'));module[_0xa687('0xb')]=function(_0x397553,_0x418b98){return _0x397553[_0xa687('0xc')](_0xa687('0xd'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index df6cc3e..cfa52eb 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 _0x4d53=['redis','defaults','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','catch','Plugin','create','body','options','raw','CreatePlugin','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http'];(function(_0xbb59be,_0xd54a22){var _0x1969ce=function(_0x55cf80){while(--_0x55cf80){_0xbb59be['push'](_0xbb59be['shift']());}};_0x1969ce(++_0xd54a22);}(_0x4d53,0x170));var _0x34d5=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x4d53[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x34d5('0x0'));var util=require(_0x34d5('0x1'));var moment=require(_0x34d5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34d5('0x3'));var db=require(_0x34d5('0x4'))['db'];var utils=require(_0x34d5('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x34d5('0x6'));var client=jayson[_0x34d5('0x7')][_0x34d5('0x8')]({'port':0x232a});config[_0x34d5('0x9')]=_[_0x34d5('0xa')](config[_0x34d5('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x34d5('0xb'))(new Redis(config['redis']));require(_0x34d5('0xc'))[_0x34d5('0xd')](socket);function respondWithRpcPromise(_0x12c0cb,_0x1ba791,_0x35cdb9){return new BPromise(function(_0x2e5e39,_0x2f8b9e){return client['request'](_0x12c0cb,_0x35cdb9)[_0x34d5('0xe')](function(_0x20fc4a){logger[_0x34d5('0xf')](_0x34d5('0x10'),_0x1ba791,_0x34d5('0x11'));logger['debug'](_0x34d5('0x12'),_0x1ba791,_0x34d5('0x11'),JSON['stringify'](_0x20fc4a));if(_0x20fc4a[_0x34d5('0x13')]){if(_0x20fc4a['error'][_0x34d5('0x14')]===0x1f4){logger['error'](_0x34d5('0x10'),_0x1ba791,_0x20fc4a['error'][_0x34d5('0x15')]);return _0x2f8b9e(_0x20fc4a[_0x34d5('0x13')]['message']);}logger[_0x34d5('0x13')]('Plugin,\x20%s,\x20%s',_0x1ba791,_0x20fc4a[_0x34d5('0x13')][_0x34d5('0x15')]);return _0x2e5e39(_0x20fc4a['error']['message']);}else{logger[_0x34d5('0xf')](_0x34d5('0x10'),_0x1ba791,_0x34d5('0x11'));_0x2e5e39(_0x20fc4a['result'][_0x34d5('0x15')]);}})[_0x34d5('0x16')](function(_0x23969a){logger[_0x34d5('0x13')]('Plugin,\x20%s,\x20%s',_0x1ba791,_0x23969a);_0x2f8b9e(_0x23969a);});});}exports['CreatePlugin']=function(_0x88b1a0){var _0x5b0abf=this;return new Promise(function(_0xe58a13,_0x3331fc){return db[_0x34d5('0x17')][_0x34d5('0x18')](_0x88b1a0[_0x34d5('0x19')],{'raw':_0x88b1a0[_0x34d5('0x1a')]?_0x88b1a0[_0x34d5('0x1a')][_0x34d5('0x1b')]===undefined?!![]:![]:!![]})[_0x34d5('0xe')](function(_0x504013){logger['info'](_0x34d5('0x1c'),_0x88b1a0);logger['debug'](_0x34d5('0x1c'),_0x88b1a0,JSON['stringify'](_0x504013));_0xe58a13(_0x504013);})[_0x34d5('0x16')](function(_0x2c77e9){logger[_0x34d5('0x13')](_0x34d5('0x1c'),_0x2c77e9[_0x34d5('0x15')],_0x88b1a0);_0x3331fc(_0x5b0abf[_0x34d5('0x13')](0x1f4,_0x2c77e9[_0x34d5('0x15')]));});});}; \ No newline at end of file +var _0x764e=['Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','Plugin,\x20%s,\x20%s','info','request\x20sent','result','catch','CreatePlugin','Plugin','create','options','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','debug'];(function(_0x53b67c,_0x59e1fe){var _0x4778c8=function(_0xbf09f8){while(--_0xbf09f8){_0x53b67c['push'](_0x53b67c['shift']());}};_0x4778c8(++_0x59e1fe);}(_0x764e,0x16d));var _0xe764=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x764e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe764('0x0'));var moment=require(_0xe764('0x1'));var BPromise=require(_0xe764('0x2'));var rs=require(_0xe764('0x3'));var fs=require('fs');var Redis=require(_0xe764('0x4'));var db=require(_0xe764('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe764('0x6'))(_0xe764('0x7'));var config=require(_0xe764('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe764('0x9')][_0xe764('0xa')]({'port':0x232a});config[_0xe764('0xb')]=_['defaults'](config[_0xe764('0xb')],{'host':_0xe764('0xc'),'port':0x18eb});var socket=require(_0xe764('0xd'))(new Redis(config[_0xe764('0xb')]));require(_0xe764('0xe'))[_0xe764('0xf')](socket);function respondWithRpcPromise(_0x4f4c3f,_0x5e6a29,_0x3e7dcc){return new BPromise(function(_0x39b57a,_0x35b72e){return client[_0xe764('0x10')](_0x4f4c3f,_0x3e7dcc)[_0xe764('0x11')](function(_0x2840e0){logger['info']('Plugin,\x20%s,\x20%s',_0x5e6a29,'request\x20sent');logger[_0xe764('0x12')](_0xe764('0x13'),_0x5e6a29,'request\x20sent',JSON[_0xe764('0x14')](_0x2840e0));if(_0x2840e0['error']){if(_0x2840e0['error']['code']===0x1f4){logger[_0xe764('0x15')]('Plugin,\x20%s,\x20%s',_0x5e6a29,_0x2840e0[_0xe764('0x15')]['message']);return _0x35b72e(_0x2840e0['error'][_0xe764('0x16')]);}logger['error'](_0xe764('0x17'),_0x5e6a29,_0x2840e0['error']['message']);return _0x39b57a(_0x2840e0[_0xe764('0x15')][_0xe764('0x16')]);}else{logger[_0xe764('0x18')](_0xe764('0x17'),_0x5e6a29,_0xe764('0x19'));_0x39b57a(_0x2840e0[_0xe764('0x1a')][_0xe764('0x16')]);}})[_0xe764('0x1b')](function(_0x397439){logger['error']('Plugin,\x20%s,\x20%s',_0x5e6a29,_0x397439);_0x35b72e(_0x397439);});});}exports[_0xe764('0x1c')]=function(_0x4493ef){var _0xe60144=this;return new Promise(function(_0x45c6ea,_0x46e0d0){return db[_0xe764('0x1d')][_0xe764('0x1e')](_0x4493ef['body'],{'raw':_0x4493ef['options']?_0x4493ef[_0xe764('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xe764('0x11')](function(_0x3ff5d9){logger[_0xe764('0x18')](_0xe764('0x1c'),_0x4493ef);logger[_0xe764('0x12')]('CreatePlugin',_0x4493ef,JSON[_0xe764('0x14')](_0x3ff5d9));_0x45c6ea(_0x3ff5d9);})[_0xe764('0x1b')](function(_0x3fd339){logger[_0xe764('0x15')](_0xe764('0x1c'),_0x3fd339[_0xe764('0x16')],_0x4493ef);_0x46e0d0(_0xe60144[_0xe764('0x15')](0x1f4,_0x3fd339[_0xe764('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index fb9b767..f380c9c 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 _0xdb96=['emit','removeListener','register','length','update'];(function(_0x34532b,_0x168bc7){var _0x5cb8ad=function(_0x387821){while(--_0x387821){_0x34532b['push'](_0x34532b['shift']());}};_0x5cb8ad(++_0x168bc7);}(_0xdb96,0xd1));var _0x6db9=function(_0x2a5755,_0x17f587){_0x2a5755=_0x2a5755-0x0;var _0x1700da=_0xdb96[_0x2a5755];return _0x1700da;};'use strict';var PluginEvents=require('./plugin.events');var events=['save','remove',_0x6db9('0x0')];function createListener(_0x595819,_0x3affd3){return function(_0x355125){_0x3affd3[_0x6db9('0x1')](_0x595819,_0x355125);};}function removeListener(_0x5e07c1,_0x358103){return function(){PluginEvents[_0x6db9('0x2')](_0x5e07c1,_0x358103);};}exports[_0x6db9('0x3')]=function(_0x162f89){for(var _0xcb633c=0x0,_0x2ae8f6=events[_0x6db9('0x4')];_0xcb633c<_0x2ae8f6;_0xcb633c++){var _0x5aea42=events[_0xcb633c];var _0x3c37a6=createListener('plugin:'+_0x5aea42,_0x162f89);PluginEvents['on'](_0x5aea42,_0x3c37a6);}}; \ No newline at end of file +var _0xa1e6=['./plugin.events','save','remove','update','emit','removeListener','register','length','plugin:'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa1e6,0x1dd));var _0x6a1e=function(_0x5e240a,_0x5d5eb){_0x5e240a=_0x5e240a-0x0;var _0x56d799=_0xa1e6[_0x5e240a];return _0x56d799;};'use strict';var PluginEvents=require(_0x6a1e('0x0'));var events=[_0x6a1e('0x1'),_0x6a1e('0x2'),_0x6a1e('0x3')];function createListener(_0x42c288,_0x3e5e33){return function(_0x4010be){_0x3e5e33[_0x6a1e('0x4')](_0x42c288,_0x4010be);};}function removeListener(_0x1e710f,_0x5c69fc){return function(){PluginEvents[_0x6a1e('0x5')](_0x1e710f,_0x5c69fc);};}exports[_0x6a1e('0x6')]=function(_0x984986){for(var _0x3e4a30=0x0,_0x5917cd=events[_0x6a1e('0x7')];_0x3e4a30<_0x5917cd;_0x3e4a30++){var _0x5bb4ce=events[_0x3e4a30];var _0x3cb7d8=createListener(_0x6a1e('0x8')+_0x5bb4ce,_0x984986);PluginEvents['on'](_0x5bb4ce,_0x3cb7d8);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index e1682cf..7a24fd4 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(_0x508409,_0x18d9b5){var _0x499c8d=function(_0xc1ac2a){while(--_0xc1ac2a){_0x508409['push'](_0x508409['shift']());}};_0x499c8d(++_0x18d9b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x1e84c5,_0xbc6ec1){var _0x1fa07e=function(_0x204580){while(--_0x204580){_0x1e84c5['push'](_0x1e84c5['shift']());}};_0x1fa07e(++_0xbc6ec1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 2d8a816..f2355bb 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 _0xbc9d=['hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','sendStatus','json','error','name','status','send','npm\x20install','info','list','then','reject','motion2','catch','show','describe','params','body','script','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','stop'];(function(_0x3f32af,_0x3707be){var _0x4ea429=function(_0x1cfbd0){while(--_0x1cfbd0){_0x3f32af['push'](_0x3f32af['shift']());}};_0x4ea429(++_0x3707be);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x41e1ed,_0x1e4ed2){_0x41e1ed=_0x41e1ed-0x0;var _0x3d14b1=_0xbc9d[_0x41e1ed];return _0x3d14b1;};'use strict';var _=require(_0xdbc9('0x0'));var pm2=require(_0xdbc9('0x1'));var logger=require(_0xdbc9('0x2'))(_0xdbc9('0x3'));var path=require(_0xdbc9('0x4'));var exec=require('child_process')['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x2aba48,_0x404513){return function(_0x3e63f1){if(!_0x3e63f1){_0x2aba48[_0xdbc9('0x5')](0x194);;}return _0x3e63f1;};}function respondWithResult(_0x6ab397,_0x7c4c55){_0x7c4c55=_0x7c4c55||0xc8;return function(_0x381a0e){if(_0x381a0e){return _0x6ab397['status'](_0x7c4c55)[_0xdbc9('0x6')](_0x381a0e);}return null;};}function handleError(_0x181f8a,_0x3d4918){_0x3d4918=_0x3d4918||0x1f4;return function(_0x4d6493){logger[_0xdbc9('0x7')](_0x4d6493['stack']);if(_0x4d6493['name']){delete _0x4d6493[_0xdbc9('0x8')];}_0x181f8a[_0xdbc9('0x9')](_0x3d4918)[_0xdbc9('0xa')](_0x4d6493);};}function execChildProcess(){return new BPromise(function(_0x2f5e6d,_0x531f09){exec(_0xdbc9('0xb'),function(_0x187149,_0xcc898,_0xd026bc){logger[_0xdbc9('0xc')](_0xcc898);logger[_0xdbc9('0xc')](_0xd026bc);if(_0x187149){logger['error'](_0x187149);return _0x531f09(_0x187149);}return _0x2f5e6d(_0xcc898);});});}exports['index']=function(_0x3d0fdd,_0x15c0a6){return pm2[_0xdbc9('0xd')]()[_0xdbc9('0xe')](function(_0x53495d){if(_0x53495d){var _0x4a9dcb=_[_0xdbc9('0xf')](_0x53495d,function(_0x1e41cf){return _0x1e41cf[_0xdbc9('0x8')]==='express'||_0x1e41cf[_0xdbc9('0x8')]===_0xdbc9('0x10');});return{'rows':_0x4a9dcb,'count':_0x4a9dcb['length']};}return null;})[_0xdbc9('0xe')](respondWithResult(_0x15c0a6,null))[_0xdbc9('0x11')](handleError(_0x15c0a6,null));};exports[_0xdbc9('0x12')]=function(_0x14e655,_0x1f22f4){return pm2[_0xdbc9('0x13')](_0x14e655[_0xdbc9('0x14')]['id'])[_0xdbc9('0xe')](respondWithResult(_0x1f22f4,null))[_0xdbc9('0xe')](handleEntityNotFound(_0x1f22f4,null))[_0xdbc9('0x11')](handleError(_0x1f22f4,null));};exports['create']=function(_0x1ca5fd,_0x497be2){if(_0x1ca5fd[_0xdbc9('0x15')][_0xdbc9('0x8')]&&_0x1ca5fd['body'][_0xdbc9('0x16')]){var _0x5367dc=path['join'](__dirname,'../../files/plugins',_0x1ca5fd['body'][_0xdbc9('0x16')]);var _0x2011a2=process['cwd']();process[_0xdbc9('0x17')](path[_0xdbc9('0x18')](_0x5367dc));return execChildProcess()['then'](function(_0x1bc073){process[_0xdbc9('0x17')](_0x2011a2);return pm2[_0xdbc9('0x19')]({'name':_0x1ca5fd[_0xdbc9('0x15')][_0xdbc9('0x8')],'script':_0x5367dc});})[_0xdbc9('0xe')](function(_0x32822f){pm2[_0xdbc9('0x1a')]();return _0x32822f[0x0];})[_0xdbc9('0xe')](respondWithResult(_0x497be2,0xc9))['catch'](handleError(_0x497be2,null));}else{return _0x497be2[_0xdbc9('0x9')](0x1f4)[_0xdbc9('0xa')]({'message':_0xdbc9('0x1b')});}};exports[_0xdbc9('0x1c')]=function(_0x24fdec,_0x50c3ee){if(_0x24fdec[_0xdbc9('0x15')]['id']){delete _0x24fdec[_0xdbc9('0x15')]['id'];}var _0x5300bd={'online':'restart','stopped':_0xdbc9('0x1d')};if(_0x5300bd[_0xdbc9('0x1e')](_0x24fdec[_0xdbc9('0x15')]['status'])){return pm2[_0x5300bd[_0x24fdec[_0xdbc9('0x15')]['status']]](_0x24fdec['params']['id'])[_0xdbc9('0xe')](respondWithResult(_0x50c3ee,0xc8))['catch'](handleError(_0x50c3ee,null));}else{return _0x50c3ee['status'](0x1f4)[_0xdbc9('0xa')]({'message':_0xdbc9('0x1f')});}};exports[_0xdbc9('0x20')]=function(_0x4db824,_0x35eaf8){if(_0x4db824[_0xdbc9('0x15')]['id']){delete _0x4db824['body']['id'];}if(_0x4db824['params']['id']){return pm2[_0xdbc9('0x21')](_0x4db824[_0xdbc9('0x14')]['id'])[_0xdbc9('0xe')](function(_0x3ce701){pm2[_0xdbc9('0x1a')]();return _0x3ce701[0x0];})[_0xdbc9('0xe')](respondWithResult(_0x35eaf8,null))[_0xdbc9('0x11')](handleError(_0x35eaf8,null));}else{return _0x35eaf8['status'](0x1f4)[_0xdbc9('0xa')]({'message':_0xdbc9('0x22')});}}; \ No newline at end of file +var _0x5ff3=['Unknown\x20id','../../config/pm2','api','child_process','exec','bluebird','sendStatus','json','error','name','status','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','params','create','body','join','../../files/plugins','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','delete'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2c172f,_0x360721){_0x2c172f=_0x2c172f-0x0;var _0x121cb6=_0x5ff3[_0x2c172f];return _0x121cb6;};'use strict';var _=require('lodash');var pm2=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var path=require('path');var exec=require(_0x35ff('0x2'))[_0x35ff('0x3')];var BPromise=require(_0x35ff('0x4'));function handleEntityNotFound(_0xd0846d,_0x551514){return function(_0x2fcb74){if(!_0x2fcb74){_0xd0846d[_0x35ff('0x5')](0x194);;}return _0x2fcb74;};}function respondWithResult(_0x2e9873,_0x11e738){_0x11e738=_0x11e738||0xc8;return function(_0x30c3ff){if(_0x30c3ff){return _0x2e9873['status'](_0x11e738)[_0x35ff('0x6')](_0x30c3ff);}return null;};}function handleError(_0x4c9fab,_0x2e7470){_0x2e7470=_0x2e7470||0x1f4;return function(_0xfcec34){logger[_0x35ff('0x7')](_0xfcec34['stack']);if(_0xfcec34[_0x35ff('0x8')]){delete _0xfcec34['name'];}_0x4c9fab[_0x35ff('0x9')](_0x2e7470)[_0x35ff('0xa')](_0xfcec34);};}function execChildProcess(){return new BPromise(function(_0x57ad20,_0x5c3131){exec(_0x35ff('0xb'),function(_0x574c81,_0x592295,_0x567080){logger[_0x35ff('0xc')](_0x592295);logger[_0x35ff('0xc')](_0x567080);if(_0x574c81){logger[_0x35ff('0x7')](_0x574c81);return _0x5c3131(_0x574c81);}return _0x57ad20(_0x592295);});});}exports[_0x35ff('0xd')]=function(_0x559e33,_0x33154f){return pm2[_0x35ff('0xe')]()[_0x35ff('0xf')](function(_0x4d1d41){if(_0x4d1d41){var _0xff8ac=_[_0x35ff('0x10')](_0x4d1d41,function(_0x254975){return _0x254975[_0x35ff('0x8')]===_0x35ff('0x11')||_0x254975[_0x35ff('0x8')]===_0x35ff('0x12');});return{'rows':_0xff8ac,'count':_0xff8ac[_0x35ff('0x13')]};}return null;})[_0x35ff('0xf')](respondWithResult(_0x33154f,null))[_0x35ff('0x14')](handleError(_0x33154f,null));};exports[_0x35ff('0x15')]=function(_0x3430e2,_0x37ea06){return pm2[_0x35ff('0x16')](_0x3430e2[_0x35ff('0x17')]['id'])['then'](respondWithResult(_0x37ea06,null))[_0x35ff('0xf')](handleEntityNotFound(_0x37ea06,null))[_0x35ff('0x14')](handleError(_0x37ea06,null));};exports[_0x35ff('0x18')]=function(_0x1c0d8c,_0x567bcb){if(_0x1c0d8c['body'][_0x35ff('0x8')]&&_0x1c0d8c[_0x35ff('0x19')]['script']){var _0x238f65=path[_0x35ff('0x1a')](__dirname,_0x35ff('0x1b'),_0x1c0d8c[_0x35ff('0x19')]['script']);var _0x3d60b4=process['cwd']();process[_0x35ff('0x1c')](path[_0x35ff('0x1d')](_0x238f65));return execChildProcess()[_0x35ff('0xf')](function(_0x16a5a0){process[_0x35ff('0x1c')](_0x3d60b4);return pm2[_0x35ff('0x1e')]({'name':_0x1c0d8c[_0x35ff('0x19')]['name'],'script':_0x238f65});})[_0x35ff('0xf')](function(_0x2ffcb){pm2['dump']();return _0x2ffcb[0x0];})[_0x35ff('0xf')](respondWithResult(_0x567bcb,0xc9))['catch'](handleError(_0x567bcb,null));}else{return _0x567bcb['status'](0x1f4)[_0x35ff('0xa')]({'message':_0x35ff('0x1f')});}};exports[_0x35ff('0x20')]=function(_0x11a5eb,_0x302d5a){if(_0x11a5eb['body']['id']){delete _0x11a5eb[_0x35ff('0x19')]['id'];}var _0x412873={'online':_0x35ff('0x21'),'stopped':'stop'};if(_0x412873[_0x35ff('0x22')](_0x11a5eb[_0x35ff('0x19')][_0x35ff('0x9')])){return pm2[_0x412873[_0x11a5eb[_0x35ff('0x19')][_0x35ff('0x9')]]](_0x11a5eb[_0x35ff('0x17')]['id'])[_0x35ff('0xf')](respondWithResult(_0x302d5a,0xc8))[_0x35ff('0x14')](handleError(_0x302d5a,null));}else{return _0x302d5a[_0x35ff('0x9')](0x1f4)['send']({'message':_0x35ff('0x23')});}};exports['destroy']=function(_0x1cb370,_0x257501){if(_0x1cb370[_0x35ff('0x19')]['id']){delete _0x1cb370[_0x35ff('0x19')]['id'];}if(_0x1cb370['params']['id']){return pm2[_0x35ff('0x24')](_0x1cb370['params']['id'])[_0x35ff('0xf')](function(_0xf88865){pm2['dump']();return _0xf88865[0x0];})['then'](respondWithResult(_0x257501,null))[_0x35ff('0x14')](handleError(_0x257501,null));}else{return _0x257501[_0x35ff('0x9')](0x1f4)['send']({'message':_0x35ff('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index bb85941..613eed6 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 _0x3826=['express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getQueues','exports'];(function(_0x3e19d5,_0x5deb21){var _0x1b88c5=function(_0x30f9bd){while(--_0x30f9bd){_0x3e19d5['push'](_0x3e19d5['shift']());}};_0x1b88c5(++_0x5deb21);}(_0x3826,0x1ef));var _0x6382=function(_0x21cffc,_0x386d53){_0x21cffc=_0x21cffc-0x0;var _0x5818f3=_0x3826[_0x21cffc];return _0x5818f3;};'use strict';var express=require(_0x6382('0x0'));var router=express[_0x6382('0x1')]();var auth=require(_0x6382('0x2'));var controller=require(_0x6382('0x3'));router[_0x6382('0x4')](_0x6382('0x5'),auth[_0x6382('0x6')](),controller['getAgents']);router[_0x6382('0x4')]('/queues',auth[_0x6382('0x6')](),controller[_0x6382('0x7')]);module[_0x6382('0x8')]=router; \ No newline at end of file +var _0x049c=['/queues','getQueues','exports','Router','../../components/auth/service','./realtime.controller','get','isAuthenticated','getAgents'];(function(_0x4c2dfc,_0x4814c0){var _0xfd728d=function(_0x5b8d81){while(--_0x5b8d81){_0x4c2dfc['push'](_0x4c2dfc['shift']());}};_0xfd728d(++_0x4814c0);}(_0x049c,0x1b3));var _0xc049=function(_0x3e472c,_0x4accfb){_0x3e472c=_0x3e472c-0x0;var _0x55badc=_0x049c[_0x3e472c];return _0x55badc;};'use strict';var express=require('express');var router=express[_0xc049('0x0')]();var auth=require(_0xc049('0x1'));var controller=require(_0xc049('0x2'));router[_0xc049('0x3')]('/agents',auth[_0xc049('0x4')](),controller[_0xc049('0x5')]);router[_0xc049('0x3')](_0xc049('0x6'),auth['isAuthenticated'](),controller[_0xc049('0x7')]);module[_0xc049('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 60b1182..4b68079 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 _0x3ea3=['isEmpty','where','user','userProfileId','nolimit','UserProfile','getResources','findAndCountAll','rows','omit','globalStatusFilter','pauseTypeFilter','getQueues','type','QueueCampaigns','util','lodash','jayson/promise','../../config/logger','api','client','http','offset','undefined','limit','count','status','set','Content-Range','error','stack','name','send','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','request','startCase','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','waiting','talking','paused','outbound','pTalking','originated','message','dialActive','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','agents','loggedInDb','busy','find','pick','filter','queue','length','connectedlinenum','internal','getMembers','UserId','accountcode','online','voiceStatus','push','Queue','findAll','QueueId','idle','unknown','unavailable','isNil','faxPause','mailPause','voicePause','whatsappPause','every','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','*pause','mail','chat','sms','openchannel','fax','whatsapp','includes','toLowerCase','Invalid\x20channel','isArray','findOne','getAgents','all','uniq','fields','globalStatus','startsWith','DESC','ASC','sort','pauseType','userpic','lastLoginAt','lastPauseAt','address','chatPause','openchannelPause','smsPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','smsCurrentCapacity','faxCurrentCapacity','smsStatus','chatStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','resolve','query','channel','join','globalQueueFilter','User','rawAttributes','fieldName','key','role','agent','getOptions','raw'];(function(_0x1bb340,_0x2cce8b){var _0x42b2d0=function(_0x50dbf6){while(--_0x50dbf6){_0x1bb340['push'](_0x1bb340['shift']());}};_0x42b2d0(++_0x2cce8b);}(_0x3ea3,0xb0));var _0x33ea=function(_0x1a53b5,_0x2649a4){_0x1a53b5=_0x1a53b5-0x0;var _0x5d8029=_0x3ea3[_0x1a53b5];return _0x5d8029;};'use strict';var util=require(_0x33ea('0x0'));var _=require(_0x33ea('0x1'));var jayson=require(_0x33ea('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x33ea('0x3'))(_0x33ea('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x33ea('0x5')]['http']({'port':0x232a});var routingClient=jayson[_0x33ea('0x5')][_0x33ea('0x6')]({'port':0x232c});function respondWithFilteredResult(_0xc4a3f8,_0x3fee5c){return function(_0x1128af){if(_0x1128af){var _0xcd3bee=typeof _0x3fee5c[_0x33ea('0x7')]===_0x33ea('0x8')&&typeof _0x3fee5c[_0x33ea('0x9')]==='undefined';var _0x479dde=_0x1128af['count'];var _0x3feec1=_0xcd3bee?0x0:_0x3fee5c['offset'];var _0x491964=_0xcd3bee?_0x1128af[_0x33ea('0xa')]:_0x3fee5c['offset']+_0x3fee5c['limit'];var _0x227968;if(_0x491964>=_0x479dde){_0x491964=_0x479dde;_0x227968=0xc8;}else{_0x227968=0xce;}_0xc4a3f8[_0x33ea('0xb')](_0x227968);return _0xc4a3f8[_0x33ea('0xc')](_0x33ea('0xd'),_0x3feec1+'-'+_0x491964+'/'+_0x479dde)['json'](_0x1128af);}return null;};}function handleError(_0x5b0a86,_0x32dfef){_0x32dfef=_0x32dfef||0x1f4;return function(_0x6d0e21){logger[_0x33ea('0xe')](_0x6d0e21[_0x33ea('0xf')]);if(_0x6d0e21['name']){delete _0x6d0e21[_0x33ea('0x10')];}_0x5b0a86[_0x33ea('0xb')](_0x32dfef)[_0x33ea('0x11')](_0x6d0e21);};}function getRealtimeAgents(){return new Promise(function(_0x338dea,_0x3e0f58){return amiClient['request'](_0x33ea('0x12'),{})['then'](function(_0x116e7b){if(_0x116e7b[_0x33ea('0xe')])throw new Error(_0x33ea('0x13'));var _0x5487ea=_0x116e7b[_0x33ea('0x14')];return routingClient['request']('Agents',{})['then'](function(_0x3eec47){if(_0x3eec47[_0x33ea('0xe')])throw new Error(_0x33ea('0x15'));var _0x3a65c7=_0x3eec47[_0x33ea('0x14')];return _0x338dea(_[_0x33ea('0x16')]({},_0x5487ea,_0x3a65c7));});})[_0x33ea('0x17')](function(_0x37ae4b){_0x3e0f58(_0x37ae4b);});});}function getRealtimeQueues(_0x524f4f,_0x37aebd){return new Promise(function(_0x4fe8b5,_0x4702f7){var _0x3d8ce9=_0x37aebd===_0x33ea('0x18')?amiClient:routingClient;return _0x3d8ce9[_0x33ea('0x19')](_[_0x33ea('0x1a')](_0x37aebd)+_0x33ea('0x1b'),_0x524f4f)[_0x33ea('0x1c')](function(_0x56306b){if(_0x56306b[_0x33ea('0xe')])throw new Error(util[_0x33ea('0x1d')](_0x33ea('0x1e'),_0x37aebd));return _0x4fe8b5(_0x56306b[_0x33ea('0x14')]);})['catch'](function(_0x3ee232){_0x4702f7(_0x3ee232);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x267876,_0x35806f){return amiClient[_0x33ea('0x19')]('VoiceQueuesChannels',{})['then'](function(_0x1e9df2){if(_0x1e9df2[_0x33ea('0xe')])throw new Error(_0x33ea('0x1f'));return _0x267876(_0x1e9df2[_0x33ea('0x14')]);})[_0x33ea('0x17')](function(_0x56489e){_0x35806f(_0x56489e);});});}function initializeQueues(_0x436c53,_0x44e9d2,_0x9bfbfa,_0x18bc8c){var _0x1b98d2=[_0x33ea('0x20'),'available',_0x33ea('0x21'),_0x33ea('0x22'),_0x33ea('0x23')];if(_0x9bfbfa===_0x33ea('0x18')&&_0x18bc8c===_0x33ea('0x24')){_0x1b98d2['push'](_0x33ea('0x25'),_0x33ea('0x26'),_0x33ea('0x27'),_0x33ea('0x28'),'dialMethod',_0x33ea('0x29'),_0x33ea('0x2a'),'startProgressive',_0x33ea('0x2b'),_0x33ea('0x2c'),_0x33ea('0x2d'),_0x33ea('0x2e'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x33ea('0x2f'),_0x33ea('0x30'),_0x33ea('0x31'),'predictiveIntervalAnsweredCalls',_0x33ea('0x32'),_0x33ea('0x33'),_0x33ea('0x34'),_0x33ea('0x35'));}return _0x436c53[_0x33ea('0x36')](function(_0x417d1b){var _0x138ac8=_0x417d1b['get']({'plain':!![]});_0x138ac8[_0x33ea('0x37')]=[];_0x138ac8['paused']=0x0;_0x138ac8[_0x33ea('0x38')]=0x0;_0x138ac8[_0x33ea('0x20')]=0x0;_0x138ac8['available']=0x0;_0x138ac8['waiting']=0x0;if(_0x9bfbfa===_0x33ea('0x18')){_0x138ac8['talking']=0x0;_0x138ac8[_0x33ea('0x39')]=0x0;if(_0x18bc8c===_0x33ea('0x24')){_0x138ac8[_0x33ea('0x25')]=0x0;_0x138ac8[_0x33ea('0x26')]=0x0;}}var _0x1995ab=_[_0x33ea('0x3a')](_0x44e9d2,['id',_0x138ac8['id']]);if(_0x1995ab)_[_0x33ea('0x16')](_0x138ac8,_[_0x33ea('0x3b')](_0x1995ab,_0x1b98d2));return _0x138ac8;});}function updateAgentVoiceStatus(_0x4bea03,_0x369079,_0x297e79){var _0x10cd1e=_[_0x33ea('0x3c')](_0x297e79,[_0x33ea('0x3d'),_0x369079['name']]);if(_0x10cd1e[_0x33ea('0x3e')]===0x0)return _0x4bea03[_0x33ea('0x39')]=!![];if(_['some'](_0x10cd1e,[_0x33ea('0x3f'),_0x4bea03[_0x33ea('0x40')]['toString']()]))return _0x4bea03[_0x33ea('0x22')]=!![];if(!_0x4bea03['talking'])return _0x4bea03[_0x33ea('0x39')]=!![];}function getVoiceQueueAgents(_0x406981,_0x5ab6f1,_0x2a972c,_0x5ae1ee){var _0x16946e=_[_0x33ea('0x3a')](_0x5ab6f1,['id',_0x406981['id']]);if(!_0x16946e)return _0x406981;return _0x16946e[_0x33ea('0x41')]({'raw':!![]})['then'](function(_0x5403ee){for(var _0x2b4f70=0x0;_0x2b4f70<_0x5403ee[_0x33ea('0x3e')];_0x2b4f70++){var _0x12a956=_[_0x33ea('0x3a')](_0x2a972c,['id',_0x5403ee[_0x2b4f70][_0x33ea('0x42')]]);if(!_0x12a956){_0x12a956={'id':_0x5403ee[_0x2b4f70][_0x33ea('0x42')],'name':_0x5403ee[_0x2b4f70][_0x33ea('0x42')],'accountcode':'','online':![]};}var _0x521b36={'id':_0x12a956['id'],'name':_0x12a956[_0x33ea('0x10')],'internal':_0x12a956[_0x33ea('0x43')],'online':Boolean(_0x12a956[_0x33ea('0x44')]),'paused':Boolean(_0x5403ee[_0x2b4f70][_0x33ea('0x23')])};if(_0x12a956[_0x33ea('0x45')]===_0x33ea('0x22'))updateAgentVoiceStatus(_0x521b36,_0x406981,_0x5ae1ee);if(_0x521b36[_0x33ea('0x44')])_0x406981[_0x33ea('0x38')]++;if(_0x521b36['busy'])_0x406981['busy']++;if(_0x521b36[_0x33ea('0x23')]&&!_0x521b36[_0x33ea('0x39')]&&!_0x521b36[_0x33ea('0x22')])_0x406981[_0x33ea('0x23')]++;_0x406981[_0x33ea('0x37')][_0x33ea('0x46')](_0x521b36);}return _0x406981;});}function getQueueAgents(_0x3f14b0,_0x36f661,_0x44bb8){var _0x2cf864='User'+_[_0x33ea('0x1a')](_0x44bb8)+_0x33ea('0x47');var _0x4108b3=_0x44bb8+'Pause';return db[_0x2cf864][_0x33ea('0x48')]({'where':{[_[_0x33ea('0x1a')](_0x44bb8)+_0x33ea('0x49')]:_0x3f14b0['id']},'raw':!![]})['then'](function(_0x166064){for(var _0x2f7e4f=0x0;_0x2f7e4f<_0x166064['length'];_0x2f7e4f++){var _0x28c330=_['find'](_0x36f661,['id',_0x166064[_0x2f7e4f][_0x33ea('0x42')]]);if(!_0x28c330){_0x28c330={'id':_0x166064[_0x2f7e4f][_0x33ea('0x42')],'name':_0x166064[_0x2f7e4f][_0x33ea('0x42')],'online':![],['pauseField']:![]};}var _0x4e608e={'id':_0x28c330['id'],'name':_0x28c330['name'],'online':Boolean(_0x28c330[_0x33ea('0x44')]),'paused':Boolean(_0x28c330[_0x4108b3])};if(_0x4e608e[_0x33ea('0x44')])_0x3f14b0['loggedInDb']++;_0x3f14b0[_0x33ea('0x37')][_0x33ea('0x46')](_0x4e608e);}return _0x3f14b0;});}function isIdle(_0x665c0a){return _0x665c0a===_0x33ea('0x4a')||_0x665c0a===_0x33ea('0x4b')||_0x665c0a===_0x33ea('0x4c')||_0x665c0a==='ringing'||_[_0x33ea('0x4d')](_0x665c0a);}function isAgentPaused(_0x417d6e,_0x29eada){var _0x14bbdc=[_0x417d6e['chatPause'],_0x417d6e[_0x33ea('0x4e')],_0x417d6e[_0x33ea('0x4f')],_0x417d6e['openchannelPause'],_0x417d6e['smsPause'],_0x417d6e[_0x33ea('0x50')],_0x417d6e[_0x33ea('0x51')]];if(!_0x29eada)return _[_0x33ea('0x52')](_0x14bbdc);var _0x13cce7=_[_0x33ea('0x3c')](_0x14bbdc);return _0x13cce7[_0x33ea('0x3e')]>0x0&&_0x13cce7[_0x33ea('0x3e')]<_0x14bbdc[_0x33ea('0x3e')]?!![]:![];}function isAgentIdle(_0x328675){if(_0x328675[_0x33ea('0x45')]!=='idle'&&_0x328675[_0x33ea('0x50')]){_0x328675[_0x33ea('0x45')]=_0x33ea('0x53');return![];}return _[_0x33ea('0x52')]([_0x328675[_0x33ea('0x54')],_0x328675[_0x33ea('0x55')],_0x328675[_0x33ea('0x56')],_0x328675[_0x33ea('0x57')],_0x328675['smsStatus'],_0x328675[_0x33ea('0x45')],_0x328675[_0x33ea('0x58')]],isIdle);}function getAgentStatus(_0x2bb11f){var _0x156e2e=_0x33ea('0x4b');if(isAgentPaused(_0x2bb11f))_0x156e2e='pause';else if(isAgentPaused(_0x2bb11f,!![]))_0x156e2e=_0x33ea('0x59');else if(isAgentIdle(_0x2bb11f))_0x156e2e=_0x33ea('0x4a');else _0x156e2e=_0x33ea('0x39');return _0x156e2e;}function validateChannel(_0x407360){var _0x2c43f9=[_0x33ea('0x5a'),_0x33ea('0x5b'),_0x33ea('0x5c'),_0x33ea('0x5d'),_0x33ea('0x5e'),_0x33ea('0x5f'),'voice'];if(!_[_0x33ea('0x60')](_0x2c43f9,_0x407360[_0x33ea('0x61')]()))throw new Error(_0x33ea('0x62'));return _0x407360['toLowerCase']();}function getFilteredAgentIds(_0x7fea67,_0x33e364){var _0x2a009d=_[_0x33ea('0x63')](_0x7fea67)?_0x7fea67:[_0x7fea67];var _0x21ed29=_[_0x33ea('0x36')](_0x2a009d,function(_0x19d606){return db[_0x33e364][_0x33ea('0x64')]({'where':{'name':_0x19d606}})[_0x33ea('0x1c')](function(_0x11c536){if(!_0x11c536)return[];return _0x11c536[_0x33ea('0x65')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x33ea('0x66')](_0x21ed29)[_0x33ea('0x1c')](function(_0x4fb569){var _0xa0adf8=_(_0x4fb569)['flatten']()[_0x33ea('0x36')]('id')[_0x33ea('0x67')]()['value']();return _0xa0adf8;});}function getUpdatedSortOptions(_0x52aa41){var _0x1bd576={'fields':[],'order':null};var _0x26634d=_0x52aa41['split'](',');_0x1bd576[_0x33ea('0x68')]=_['filter'](_0x26634d,function(_0x9b9343){if(!_0x9b9343['includes'](_0x33ea('0x69')))return!![];_0x1bd576['order']=_[_0x33ea('0x6a')](_0x9b9343,'-')?_0x33ea('0x6b'):_0x33ea('0x6c');return![];});return _0x1bd576;}function orderAgentsByStatus(_0x795dc3,_0x3e69c5){return _0x795dc3[_0x33ea('0x6d')](function(_0x564c7a,_0x303cff){if(_0x564c7a[_0x33ea('0x69')]===_0x303cff[_0x33ea('0x69')]&&_0x564c7a[_0x33ea('0x69')]===_0x33ea('0x53')){if(_0x3e69c5===_0x33ea('0x6b'))return(_0x564c7a[_0x33ea('0x6e')]||'')<(_0x303cff['pauseType']||'')?0x1:-0x1;return _0x564c7a['pauseType']<_0x303cff[_0x33ea('0x6e')]?-0x1:0x1;}else{if(_0x3e69c5===_0x33ea('0x6b'))return _0x564c7a['globalStatus']<_0x303cff[_0x33ea('0x69')]?0x1:-0x1;return _0x564c7a[_0x33ea('0x69')]<_0x303cff[_0x33ea('0x69')]?-0x1:0x1;}});}exports[_0x33ea('0x65')]=function(_0x4fab7e,_0x3a80bf){var _0x2db340={'count':0x0,'rows':[]},_0x446d17={},_0x23cf35,_0x5dbf06,_0x97082d,_0x27b563,_0xe29633=[_0x33ea('0x6f'),_0x33ea('0x44'),_0x33ea('0x70'),_0x33ea('0x71'),'pauseType',_0x33ea('0x71'),_0x33ea('0x40'),_0x33ea('0x72'),_0x33ea('0x73'),_0x33ea('0x74'),_0x33ea('0x4f'),_0x33ea('0x75'),_0x33ea('0x51'),_0x33ea('0x4e'),_0x33ea('0x50'),_0x33ea('0x76'),_0x33ea('0x77'),_0x33ea('0x78'),_0x33ea('0x79'),_0x33ea('0x7a'),_0x33ea('0x7b'),'chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity',_0x33ea('0x7c'),'whatsappCurrentCapacity',_0x33ea('0x7d'),_0x33ea('0x54'),'openchannelStatus',_0x33ea('0x56'),_0x33ea('0x7e'),_0x33ea('0x58'),_0x33ea('0x55'),_0x33ea('0x45'),_0x33ea('0x7f'),'openchannelStatusTime',_0x33ea('0x80'),_0x33ea('0x81'),'whatsappStatusTime',_0x33ea('0x82'),'voiceStatusTime',_0x33ea('0x3d'),'destconnectedlinenum','screenrecording',_0x33ea('0x83'),_0x33ea('0x84'),'routealias'],_0x577903=['chatPause','openchannelPause','mailPause',_0x33ea('0x75'),_0x33ea('0x51'),_0x33ea('0x4e'),'voicePause',_0x33ea('0x44')];Promise[_0x33ea('0x85')]()['then'](function(){if(_0x4fab7e[_0x33ea('0x86')][_0x33ea('0x87')])_0x23cf35=validateChannel(_0x4fab7e[_0x33ea('0x86')]['channel']);if(!_0x4fab7e['query'][_0x33ea('0x6d')]||!_0x4fab7e[_0x33ea('0x86')][_0x33ea('0x6d')][_0x33ea('0x60')]('globalStatus'))return;var _0x26bef5=getUpdatedSortOptions(_0x4fab7e['query'][_0x33ea('0x6d')]);_0x4fab7e[_0x33ea('0x86')]['sort']=_0x26bef5[_0x33ea('0x68')][_0x33ea('0x88')](',');_0x5dbf06=_0x26bef5['order'];})[_0x33ea('0x1c')](function(){if(!_0x4fab7e[_0x33ea('0x86')]['globalQueueFilter'])return[];var _0x48ec64=_[_0x33ea('0x1a')](_0x23cf35)+_0x33ea('0x47');return getFilteredAgentIds(_0x4fab7e[_0x33ea('0x86')][_0x33ea('0x89')],_0x48ec64);})[_0x33ea('0x1c')](function(_0x937094){var _0x5f17b0=_[_0x33ea('0x36')](db[_0x33ea('0x8a')][_0x33ea('0x8b')],function(_0x20cc63){return{'name':_0x20cc63[_0x33ea('0x8c')],'type':_0x20cc63['type'][_0x33ea('0x8d')]};});_0x4fab7e[_0x33ea('0x86')][_0x33ea('0x8e')]=_0x33ea('0x8f');_0x4fab7e[_0x33ea('0x86')][_0x33ea('0x44')]=!![];_0x446d17=qs[_0x33ea('0x90')](_0x5f17b0,_0x4fab7e);_0x446d17[_0x33ea('0x91')]=!![];if(!_[_0x33ea('0x92')](_0x937094)){_0x446d17[_0x33ea('0x93')]=_[_0x33ea('0x16')](_0x446d17[_0x33ea('0x93')],{'$and':[{'id':{'$in':_0x937094}}]});}else if(!_[_0x33ea('0x92')](_0x4fab7e[_0x33ea('0x86')][_0x33ea('0x89')])){return _0x2db340;}if(_0x4fab7e[_0x33ea('0x94')][_0x33ea('0x8e')]===_0x33ea('0x94')){var _0x2b3815={'params':{'id':_0x4fab7e[_0x33ea('0x94')][_0x33ea('0x95')]},'query':{'section':_0x33ea('0x12'),'role':_0x33ea('0x8f'),'online':!![],'nolimit':_0x4fab7e['query'][_0x33ea('0x96')],'sort':_0x4fab7e[_0x33ea('0x86')][_0x33ea('0x6d')],'filter':_0x4fab7e[_0x33ea('0x86')][_0x33ea('0x3c')],'raw':!![],'ids':_0x937094}};return db[_0x33ea('0x97')][_0x33ea('0x98')](_0x2b3815);}return db[_0x33ea('0x8a')][_0x33ea('0x99')](_0x446d17);})[_0x33ea('0x1c')](function(_0x5c1a0a){_0x2db340[_0x33ea('0xa')]=_0x5c1a0a[_0x33ea('0xa')];_0x97082d=_0x5c1a0a[_0x33ea('0x9a')];return getRealtimeAgents();})[_0x33ea('0x1c')](function(_0x54bcbf){_0x27b563=_0x54bcbf['rows'];return _0x97082d[_0x33ea('0x36')](function(_0x5725fe){var _0x4a79d3=_[_0x33ea('0x3a')](_0x27b563,['id',_0x5725fe['id']]);if(_0x4a79d3)_['merge'](_0x5725fe,_[_0x33ea('0x3b')](_[_0x33ea('0x9b')](_0x4a79d3,_0x577903),_0xe29633));_0x5725fe['globalStatus']=getAgentStatus(_0x5725fe);return _0x5725fe;});})[_0x33ea('0x1c')](function(_0x1c4dd2){var _0x204f75;if(_0x4fab7e[_0x33ea('0x86')][_0x33ea('0x9c')]){_0x204f75=_['filter'](_0x1c4dd2,[_0x33ea('0x69'),_0x4fab7e[_0x33ea('0x86')][_0x33ea('0x9c')]]);if(_0x4fab7e[_0x33ea('0x86')]['pauseTypeFilter']){_0x204f75=_['filter'](_0x204f75,[_0x33ea('0x6e'),_0x4fab7e[_0x33ea('0x86')][_0x33ea('0x9d')]]);}}if(_0x204f75)_0x1c4dd2=_0x204f75;if(!_0x5dbf06)return _0x1c4dd2;return orderAgentsByStatus(_0x1c4dd2,_0x5dbf06);})[_0x33ea('0x1c')](function(_0x45c3ba){_0x2db340[_0x33ea('0x9a')]=_0x45c3ba;return _0x2db340;})[_0x33ea('0x1c')](respondWithFilteredResult(_0x3a80bf,_0x446d17))[_0x33ea('0x17')](handleError(_0x3a80bf,null));};exports[_0x33ea('0x9e')]=function(_0x4ec9f1,_0x424dc0){var _0xb49233={'count':0x0,'rows':[]},_0xfe94e9={},_0x5e0ac9,_0x5ef683,_0x2dcc09,_0x3645a1,_0x1988cf;Promise['resolve']()[_0x33ea('0x1c')](function(){if(_0x4ec9f1['query']['channel'])_0x5e0ac9=validateChannel(_0x4ec9f1[_0x33ea('0x86')][_0x33ea('0x87')]);var _0x5798e7=_[_0x33ea('0x1a')](_0x5e0ac9)+'Queue';var _0x22ec50=_[_0x33ea('0x36')](db[_0x5798e7]['rawAttributes'],function(_0x4bc0c2){return{'name':_0x4bc0c2['fieldName'],'type':_0x4bc0c2[_0x33ea('0x9f')][_0x33ea('0x8d')]};});_0xfe94e9=qs[_0x33ea('0x90')](_0x22ec50,_0x4ec9f1);if(_0x4ec9f1[_0x33ea('0x94')][_0x33ea('0x8e')]===_0x33ea('0x94')){var _0x403f24={'params':{'id':_0x4ec9f1[_0x33ea('0x94')][_0x33ea('0x95')]},'query':{'section':_0x5e0ac9===_0x33ea('0x18')&&_0x4ec9f1[_0x33ea('0x86')][_0x33ea('0x9f')]===_0x33ea('0x24')?_0x33ea('0xa0'):_[_0x33ea('0x1a')](_0x5e0ac9)+_0x33ea('0x1b'),'type':_0x4ec9f1[_0x33ea('0x86')][_0x33ea('0x9f')],'nolimit':!![],'sort':_0x33ea('0x10'),'filter':_0x4ec9f1[_0x33ea('0x86')][_0x33ea('0x3c')]}};return db[_0x33ea('0x97')][_0x33ea('0x98')](_0x403f24);}return db[_0x5798e7][_0x33ea('0x99')](_0xfe94e9);})[_0x33ea('0x1c')](function(_0x4d2183){_0xb49233['count']=_0x4d2183[_0x33ea('0xa')];_0x5ef683=_0x4d2183[_0x33ea('0x9a')];return getRealtimeQueues(_0x4ec9f1,_0x5e0ac9);})[_0x33ea('0x1c')](function(_0x330635){_0x3645a1=_0x330635[_0x33ea('0x9a')];return getRealtimeAgents();})['then'](function(_0x7fc121){_0x2dcc09=_0x7fc121[_0x33ea('0x9a')];if(_0x5e0ac9!=_0x33ea('0x18'))return;return getRealtimeVoiceQueueChannels();})[_0x33ea('0x1c')](function(_0x47512b){_0x1988cf=_0x47512b?_0x47512b[_0x33ea('0x9a')]:[];return initializeQueues(_0x5ef683,_0x3645a1,_0x5e0ac9,_0x4ec9f1[_0x33ea('0x86')]['type']);})['then'](function(_0x3ecdd8){var _0x505252=_0x3ecdd8['map'](function(_0x462db4){if(_0x5e0ac9===_0x33ea('0x18'))return getVoiceQueueAgents(_0x462db4,_0x5ef683,_0x2dcc09,_0x1988cf);else return getQueueAgents(_0x462db4,_0x2dcc09,_0x5e0ac9);});return Promise[_0x33ea('0x66')](_0x505252);})['then'](function(_0x551554){_0xb49233['rows']=_0x551554;return _0xb49233;})[_0x33ea('0x1c')](respondWithFilteredResult(_0x424dc0,_0xfe94e9))[_0x33ea('0x17')](handleError(_0x424dc0,null));}; \ No newline at end of file +var _0x1c16=['find','pick','queue','length','some','connectedlinenum','internal','toString','getMembers','UserId','online','voiceStatus','push','User','Queue','Pause','QueueId','idle','unavailable','isNil','faxPause','mailPause','voicePause','whatsappPause','filter','pause','every','faxStatus','mailStatus','openchannelStatus','unknown','*pause','mail','chat','sms','openchannel','fax','whatsapp','includes','toLowerCase','isArray','findOne','all','uniq','value','split','globalStatus','order','startsWith','DESC','ASC','sort','pauseType','getAgents','userpic','lastLoginAt','lastPauseAt','address','chatPause','openchannelPause','smsPause','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','smsStatus','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','query','channel','fields','join','globalQueueFilter','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','isEmpty','where','user','nolimit','UserProfile','findAndCountAll','rows','globalStatusFilter','pauseTypeFilter','getQueues','resolve','userProfileId','QueueCampaigns','getResources','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','offset','undefined','count','limit','status','set','Content-Range','name','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','then','error','merge','catch','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','voice','outbound','pTalking','message','dialActive','dialMethod','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','paused','loggedInDb','loggedIn','busy','originated'];(function(_0x2077be,_0x26136a){var _0x198bbf=function(_0x2fd7e3){while(--_0x2fd7e3){_0x2077be['push'](_0x2077be['shift']());}};_0x198bbf(++_0x26136a);}(_0x1c16,0x116));var _0x61c1=function(_0x4bed2d,_0x4ebe20){_0x4bed2d=_0x4bed2d-0x0;var _0xe82d9f=_0x1c16[_0x4bed2d];return _0xe82d9f;};'use strict';var util=require('util');var _=require(_0x61c1('0x0'));var jayson=require(_0x61c1('0x1'));var qs=require(_0x61c1('0x2'));var logger=require(_0x61c1('0x3'))(_0x61c1('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x61c1('0x5')]['http']({'port':0x232a});var routingClient=jayson['client'][_0x61c1('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x55c120,_0x21892f){return function(_0x3965a6){if(_0x3965a6){var _0x2058fc=typeof _0x21892f[_0x61c1('0x7')]===_0x61c1('0x8')&&typeof _0x21892f['limit']===_0x61c1('0x8');var _0x4a16aa=_0x3965a6[_0x61c1('0x9')];var _0x2a9c3f=_0x2058fc?0x0:_0x21892f[_0x61c1('0x7')];var _0x2daab4=_0x2058fc?_0x3965a6['count']:_0x21892f['offset']+_0x21892f[_0x61c1('0xa')];var _0x5739b1;if(_0x2daab4>=_0x4a16aa){_0x2daab4=_0x4a16aa;_0x5739b1=0xc8;}else{_0x5739b1=0xce;}_0x55c120[_0x61c1('0xb')](_0x5739b1);return _0x55c120[_0x61c1('0xc')](_0x61c1('0xd'),_0x2a9c3f+'-'+_0x2daab4+'/'+_0x4a16aa)['json'](_0x3965a6);}return null;};}function handleError(_0x438c81,_0x24c9c7){_0x24c9c7=_0x24c9c7||0x1f4;return function(_0x4b1732){logger['error'](_0x4b1732['stack']);if(_0x4b1732[_0x61c1('0xe')]){delete _0x4b1732[_0x61c1('0xe')];}_0x438c81['status'](_0x24c9c7)['send'](_0x4b1732);};}function getRealtimeAgents(){return new Promise(function(_0xa809a8,_0x4f0f96){return amiClient[_0x61c1('0xf')]('Agents',{})['then'](function(_0x33fb28){if(_0x33fb28['error'])throw new Error(_0x61c1('0x10'));var _0x332a88=_0x33fb28['result'];return routingClient[_0x61c1('0xf')](_0x61c1('0x11'),{})[_0x61c1('0x12')](function(_0x1b4322){if(_0x1b4322[_0x61c1('0x13')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x328161=_0x1b4322['result'];return _0xa809a8(_[_0x61c1('0x14')]({},_0x332a88,_0x328161));});})[_0x61c1('0x15')](function(_0x109a56){_0x4f0f96(_0x109a56);});});}function getRealtimeQueues(_0x29393b,_0x11f6f5){return new Promise(function(_0x339e9f,_0x502b7e){var _0x2cc39f=_0x11f6f5==='voice'?amiClient:routingClient;return _0x2cc39f['request'](_[_0x61c1('0x16')](_0x11f6f5)+_0x61c1('0x17'),_0x29393b)[_0x61c1('0x12')](function(_0x4c2d85){if(_0x4c2d85[_0x61c1('0x13')])throw new Error(util[_0x61c1('0x18')](_0x61c1('0x19'),_0x11f6f5));return _0x339e9f(_0x4c2d85[_0x61c1('0x1a')]);})[_0x61c1('0x15')](function(_0x157857){_0x502b7e(_0x157857);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x12b846,_0x1eaf54){return amiClient[_0x61c1('0xf')](_0x61c1('0x1b'),{})[_0x61c1('0x12')](function(_0x180210){if(_0x180210[_0x61c1('0x13')])throw new Error(_0x61c1('0x1c'));return _0x12b846(_0x180210[_0x61c1('0x1a')]);})[_0x61c1('0x15')](function(_0x5f560e){_0x1eaf54(_0x5f560e);});});}function initializeQueues(_0x11d081,_0x3aba40,_0x1f3c8b,_0xe34c8f){var _0x22805c=['loggedIn',_0x61c1('0x1d'),_0x61c1('0x1e'),_0x61c1('0x1f'),'paused'];if(_0x1f3c8b===_0x61c1('0x20')&&_0xe34c8f===_0x61c1('0x21')){_0x22805c['push'](_0x61c1('0x22'),'originated',_0x61c1('0x23'),_0x61c1('0x24'),_0x61c1('0x25'),'Trunk',_0x61c1('0x26'),_0x61c1('0x27'),_0x61c1('0x28'),'erlangCallToSecond',_0x61c1('0x29'),_0x61c1('0x2a'),_0x61c1('0x2b'),_0x61c1('0x2c'),_0x61c1('0x2d'),_0x61c1('0x2e'),'predictiveIntervalTotalCalls',_0x61c1('0x2f'),_0x61c1('0x30'),_0x61c1('0x31'),_0x61c1('0x32'),_0x61c1('0x33'));}return _0x11d081[_0x61c1('0x34')](function(_0xadf9e){var _0x51de74=_0xadf9e[_0x61c1('0x35')]({'plain':!![]});_0x51de74[_0x61c1('0x36')]=[];_0x51de74[_0x61c1('0x37')]=0x0;_0x51de74[_0x61c1('0x38')]=0x0;_0x51de74[_0x61c1('0x39')]=0x0;_0x51de74[_0x61c1('0x1d')]=0x0;_0x51de74[_0x61c1('0x1e')]=0x0;if(_0x1f3c8b==='voice'){_0x51de74[_0x61c1('0x1f')]=0x0;_0x51de74[_0x61c1('0x3a')]=0x0;if(_0xe34c8f===_0x61c1('0x21')){_0x51de74['pTalking']=0x0;_0x51de74[_0x61c1('0x3b')]=0x0;}}var _0x164a4e=_[_0x61c1('0x3c')](_0x3aba40,['id',_0x51de74['id']]);if(_0x164a4e)_[_0x61c1('0x14')](_0x51de74,_[_0x61c1('0x3d')](_0x164a4e,_0x22805c));return _0x51de74;});}function updateAgentVoiceStatus(_0x4dea1c,_0x439647,_0x7ddc76){var _0x1c15bd=_['filter'](_0x7ddc76,[_0x61c1('0x3e'),_0x439647[_0x61c1('0xe')]]);if(_0x1c15bd[_0x61c1('0x3f')]===0x0)return _0x4dea1c['busy']=!![];if(_[_0x61c1('0x40')](_0x1c15bd,[_0x61c1('0x41'),_0x4dea1c[_0x61c1('0x42')][_0x61c1('0x43')]()]))return _0x4dea1c['talking']=!![];if(!_0x4dea1c['talking'])return _0x4dea1c[_0x61c1('0x3a')]=!![];}function getVoiceQueueAgents(_0x49f107,_0x122116,_0xe003e4,_0x4ac5c9){var _0x394b63=_[_0x61c1('0x3c')](_0x122116,['id',_0x49f107['id']]);if(!_0x394b63)return _0x49f107;return _0x394b63[_0x61c1('0x44')]({'raw':!![]})['then'](function(_0x5d2954){for(var _0x8dd677=0x0;_0x8dd677<_0x5d2954[_0x61c1('0x3f')];_0x8dd677++){var _0x59073a=_[_0x61c1('0x3c')](_0xe003e4,['id',_0x5d2954[_0x8dd677][_0x61c1('0x45')]]);if(!_0x59073a){_0x59073a={'id':_0x5d2954[_0x8dd677][_0x61c1('0x45')],'name':_0x5d2954[_0x8dd677][_0x61c1('0x45')],'accountcode':'','online':![]};}var _0x35adf2={'id':_0x59073a['id'],'name':_0x59073a['name'],'internal':_0x59073a['accountcode'],'online':Boolean(_0x59073a[_0x61c1('0x46')]),'paused':Boolean(_0x5d2954[_0x8dd677]['paused'])};if(_0x59073a[_0x61c1('0x47')]===_0x61c1('0x1f'))updateAgentVoiceStatus(_0x35adf2,_0x49f107,_0x4ac5c9);if(_0x35adf2[_0x61c1('0x46')])_0x49f107[_0x61c1('0x38')]++;if(_0x35adf2[_0x61c1('0x3a')])_0x49f107['busy']++;if(_0x35adf2['paused']&&!_0x35adf2[_0x61c1('0x3a')]&&!_0x35adf2[_0x61c1('0x1f')])_0x49f107['paused']++;_0x49f107[_0x61c1('0x36')][_0x61c1('0x48')](_0x35adf2);}return _0x49f107;});}function getQueueAgents(_0x366eed,_0x2461d7,_0x3da606){var _0x298bcf=_0x61c1('0x49')+_[_0x61c1('0x16')](_0x3da606)+_0x61c1('0x4a');var _0x70468f=_0x3da606+_0x61c1('0x4b');return db[_0x298bcf]['findAll']({'where':{[_[_0x61c1('0x16')](_0x3da606)+_0x61c1('0x4c')]:_0x366eed['id']},'raw':!![]})[_0x61c1('0x12')](function(_0x2e8f42){for(var _0xd2ed0b=0x0;_0xd2ed0b<_0x2e8f42[_0x61c1('0x3f')];_0xd2ed0b++){var _0x4fda1b=_[_0x61c1('0x3c')](_0x2461d7,['id',_0x2e8f42[_0xd2ed0b]['UserId']]);if(!_0x4fda1b){_0x4fda1b={'id':_0x2e8f42[_0xd2ed0b][_0x61c1('0x45')],'name':_0x2e8f42[_0xd2ed0b][_0x61c1('0x45')],'online':![],['pauseField']:![]};}var _0x295d88={'id':_0x4fda1b['id'],'name':_0x4fda1b['name'],'online':Boolean(_0x4fda1b[_0x61c1('0x46')]),'paused':Boolean(_0x4fda1b[_0x70468f])};if(_0x295d88[_0x61c1('0x46')])_0x366eed['loggedInDb']++;_0x366eed[_0x61c1('0x36')][_0x61c1('0x48')](_0x295d88);}return _0x366eed;});}function isIdle(_0x4861a0){return _0x4861a0===_0x61c1('0x4d')||_0x4861a0==='unknown'||_0x4861a0===_0x61c1('0x4e')||_0x4861a0==='ringing'||_[_0x61c1('0x4f')](_0x4861a0);}function isAgentPaused(_0x30fc32,_0x3f323a){var _0xb49bc=[_0x30fc32['chatPause'],_0x30fc32[_0x61c1('0x50')],_0x30fc32[_0x61c1('0x51')],_0x30fc32['openchannelPause'],_0x30fc32['smsPause'],_0x30fc32[_0x61c1('0x52')],_0x30fc32[_0x61c1('0x53')]];if(!_0x3f323a)return _['every'](_0xb49bc);var _0x16cce3=_[_0x61c1('0x54')](_0xb49bc);return _0x16cce3['length']>0x0&&_0x16cce3['length']<_0xb49bc[_0x61c1('0x3f')]?!![]:![];}function isAgentIdle(_0x59cc2c){if(_0x59cc2c[_0x61c1('0x47')]!=='idle'&&_0x59cc2c['voicePause']){_0x59cc2c[_0x61c1('0x47')]=_0x61c1('0x55');return![];}return _[_0x61c1('0x56')]([_0x59cc2c['chatStatus'],_0x59cc2c[_0x61c1('0x57')],_0x59cc2c[_0x61c1('0x58')],_0x59cc2c[_0x61c1('0x59')],_0x59cc2c['smsStatus'],_0x59cc2c[_0x61c1('0x47')],_0x59cc2c['whatsappStatus']],isIdle);}function getAgentStatus(_0x28c331){var _0x27a597=_0x61c1('0x5a');if(isAgentPaused(_0x28c331))_0x27a597=_0x61c1('0x55');else if(isAgentPaused(_0x28c331,!![]))_0x27a597=_0x61c1('0x5b');else if(isAgentIdle(_0x28c331))_0x27a597=_0x61c1('0x4d');else _0x27a597=_0x61c1('0x3a');return _0x27a597;}function validateChannel(_0x17a987){var _0xe0a3bd=[_0x61c1('0x5c'),_0x61c1('0x5d'),_0x61c1('0x5e'),_0x61c1('0x5f'),_0x61c1('0x60'),_0x61c1('0x61'),_0x61c1('0x20')];if(!_[_0x61c1('0x62')](_0xe0a3bd,_0x17a987[_0x61c1('0x63')]()))throw new Error('Invalid\x20channel');return _0x17a987['toLowerCase']();}function getFilteredAgentIds(_0x1a4c0d,_0x3f010b){var _0x3e5331=_[_0x61c1('0x64')](_0x1a4c0d)?_0x1a4c0d:[_0x1a4c0d];var _0x15b6de=_[_0x61c1('0x34')](_0x3e5331,function(_0x38de8a){return db[_0x3f010b][_0x61c1('0x65')]({'where':{'name':_0x38de8a}})[_0x61c1('0x12')](function(_0x54f122){if(!_0x54f122)return[];return _0x54f122['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x61c1('0x66')](_0x15b6de)['then'](function(_0x1800ea){var _0x3fb623=_(_0x1800ea)['flatten']()['map']('id')[_0x61c1('0x67')]()[_0x61c1('0x68')]();return _0x3fb623;});}function getUpdatedSortOptions(_0xd0d42f){var _0x1c7e38={'fields':[],'order':null};var _0x5b7346=_0xd0d42f[_0x61c1('0x69')](',');_0x1c7e38['fields']=_[_0x61c1('0x54')](_0x5b7346,function(_0x376cf7){if(!_0x376cf7[_0x61c1('0x62')](_0x61c1('0x6a')))return!![];_0x1c7e38[_0x61c1('0x6b')]=_[_0x61c1('0x6c')](_0x376cf7,'-')?_0x61c1('0x6d'):_0x61c1('0x6e');return![];});return _0x1c7e38;}function orderAgentsByStatus(_0x1339e0,_0x5061b1){return _0x1339e0[_0x61c1('0x6f')](function(_0x110322,_0x2c1e2c){if(_0x110322['globalStatus']===_0x2c1e2c[_0x61c1('0x6a')]&&_0x110322[_0x61c1('0x6a')]===_0x61c1('0x55')){if(_0x5061b1===_0x61c1('0x6d'))return(_0x110322['pauseType']||'')<(_0x2c1e2c[_0x61c1('0x70')]||'')?0x1:-0x1;return _0x110322['pauseType']<_0x2c1e2c['pauseType']?-0x1:0x1;}else{if(_0x5061b1==='DESC')return _0x110322['globalStatus']<_0x2c1e2c[_0x61c1('0x6a')]?0x1:-0x1;return _0x110322['globalStatus']<_0x2c1e2c['globalStatus']?-0x1:0x1;}});}exports[_0x61c1('0x71')]=function(_0x4b5520,_0x226276){var _0x538f86={'count':0x0,'rows':[]},_0xb9c0c6={},_0x24277b,_0x4c0257,_0x365566,_0x239290,_0x5861aa=[_0x61c1('0x72'),'online',_0x61c1('0x73'),_0x61c1('0x74'),_0x61c1('0x70'),_0x61c1('0x74'),_0x61c1('0x42'),_0x61c1('0x75'),_0x61c1('0x76'),_0x61c1('0x77'),_0x61c1('0x51'),_0x61c1('0x78'),_0x61c1('0x53'),_0x61c1('0x50'),'voicePause',_0x61c1('0x79'),_0x61c1('0x7a'),_0x61c1('0x7b'),'smsCapacity',_0x61c1('0x7c'),_0x61c1('0x7d'),_0x61c1('0x7e'),_0x61c1('0x7f'),_0x61c1('0x80'),_0x61c1('0x81'),_0x61c1('0x82'),_0x61c1('0x83'),_0x61c1('0x84'),_0x61c1('0x59'),_0x61c1('0x58'),_0x61c1('0x85'),'whatsappStatus',_0x61c1('0x57'),_0x61c1('0x47'),'chatStatusTime',_0x61c1('0x86'),_0x61c1('0x87'),'smsStatusTime',_0x61c1('0x88'),_0x61c1('0x89'),_0x61c1('0x8a'),_0x61c1('0x3e'),'destconnectedlinenum',_0x61c1('0x8b'),'phoneBarEnableScreenRecordingByAgent',_0x61c1('0x8c'),_0x61c1('0x8d')],_0x52f063=[_0x61c1('0x76'),_0x61c1('0x77'),'mailPause','smsPause','whatsappPause',_0x61c1('0x50'),_0x61c1('0x52'),_0x61c1('0x46')];Promise['resolve']()[_0x61c1('0x12')](function(){if(_0x4b5520[_0x61c1('0x8e')]['channel'])_0x24277b=validateChannel(_0x4b5520[_0x61c1('0x8e')][_0x61c1('0x8f')]);if(!_0x4b5520[_0x61c1('0x8e')][_0x61c1('0x6f')]||!_0x4b5520[_0x61c1('0x8e')]['sort']['includes'](_0x61c1('0x6a')))return;var _0xcea20b=getUpdatedSortOptions(_0x4b5520[_0x61c1('0x8e')][_0x61c1('0x6f')]);_0x4b5520['query'][_0x61c1('0x6f')]=_0xcea20b[_0x61c1('0x90')][_0x61c1('0x91')](',');_0x4c0257=_0xcea20b[_0x61c1('0x6b')];})[_0x61c1('0x12')](function(){if(!_0x4b5520[_0x61c1('0x8e')][_0x61c1('0x92')])return[];var _0x3d7255=_[_0x61c1('0x16')](_0x24277b)+_0x61c1('0x4a');return getFilteredAgentIds(_0x4b5520[_0x61c1('0x8e')][_0x61c1('0x92')],_0x3d7255);})[_0x61c1('0x12')](function(_0x736034){var _0x33a5fb=_[_0x61c1('0x34')](db['User'][_0x61c1('0x93')],function(_0x441088){return{'name':_0x441088[_0x61c1('0x94')],'type':_0x441088[_0x61c1('0x95')][_0x61c1('0x96')]};});_0x4b5520[_0x61c1('0x8e')][_0x61c1('0x97')]=_0x61c1('0x98');_0x4b5520[_0x61c1('0x8e')][_0x61c1('0x46')]=!![];_0xb9c0c6=qs[_0x61c1('0x99')](_0x33a5fb,_0x4b5520);_0xb9c0c6[_0x61c1('0x9a')]=!![];if(!_[_0x61c1('0x9b')](_0x736034)){_0xb9c0c6[_0x61c1('0x9c')]=_['merge'](_0xb9c0c6['where'],{'$and':[{'id':{'$in':_0x736034}}]});}else if(!_[_0x61c1('0x9b')](_0x4b5520[_0x61c1('0x8e')][_0x61c1('0x92')])){return _0x538f86;}if(_0x4b5520[_0x61c1('0x9d')][_0x61c1('0x97')]===_0x61c1('0x9d')){var _0x3a55de={'params':{'id':_0x4b5520[_0x61c1('0x9d')]['userProfileId']},'query':{'section':_0x61c1('0x11'),'role':_0x61c1('0x98'),'online':!![],'nolimit':_0x4b5520[_0x61c1('0x8e')][_0x61c1('0x9e')],'sort':_0x4b5520[_0x61c1('0x8e')][_0x61c1('0x6f')],'filter':_0x4b5520[_0x61c1('0x8e')]['filter'],'raw':!![],'ids':_0x736034}};return db[_0x61c1('0x9f')]['getResources'](_0x3a55de);}return db[_0x61c1('0x49')][_0x61c1('0xa0')](_0xb9c0c6);})['then'](function(_0x1e55a9){_0x538f86[_0x61c1('0x9')]=_0x1e55a9[_0x61c1('0x9')];_0x365566=_0x1e55a9['rows'];return getRealtimeAgents();})['then'](function(_0x18c42c){_0x239290=_0x18c42c[_0x61c1('0xa1')];return _0x365566[_0x61c1('0x34')](function(_0x189b2c){var _0x43f953=_[_0x61c1('0x3c')](_0x239290,['id',_0x189b2c['id']]);if(_0x43f953)_[_0x61c1('0x14')](_0x189b2c,_[_0x61c1('0x3d')](_['omit'](_0x43f953,_0x52f063),_0x5861aa));_0x189b2c[_0x61c1('0x6a')]=getAgentStatus(_0x189b2c);return _0x189b2c;});})[_0x61c1('0x12')](function(_0x155f79){var _0x45292e;if(_0x4b5520[_0x61c1('0x8e')]['globalStatusFilter']){_0x45292e=_['filter'](_0x155f79,[_0x61c1('0x6a'),_0x4b5520[_0x61c1('0x8e')][_0x61c1('0xa2')]]);if(_0x4b5520[_0x61c1('0x8e')][_0x61c1('0xa3')]){_0x45292e=_[_0x61c1('0x54')](_0x45292e,[_0x61c1('0x70'),_0x4b5520[_0x61c1('0x8e')]['pauseTypeFilter']]);}}if(_0x45292e)_0x155f79=_0x45292e;if(!_0x4c0257)return _0x155f79;return orderAgentsByStatus(_0x155f79,_0x4c0257);})[_0x61c1('0x12')](function(_0xb3c68a){_0x538f86[_0x61c1('0xa1')]=_0xb3c68a;return _0x538f86;})[_0x61c1('0x12')](respondWithFilteredResult(_0x226276,_0xb9c0c6))[_0x61c1('0x15')](handleError(_0x226276,null));};exports[_0x61c1('0xa4')]=function(_0x26e665,_0x1b0114){var _0x2efe1e={'count':0x0,'rows':[]},_0x34e5a0={},_0x1ecd7b,_0x25cd0e,_0x40efbd,_0x1b599d,_0x40a6c4;Promise[_0x61c1('0xa5')]()[_0x61c1('0x12')](function(){if(_0x26e665[_0x61c1('0x8e')]['channel'])_0x1ecd7b=validateChannel(_0x26e665[_0x61c1('0x8e')][_0x61c1('0x8f')]);var _0x31bff5=_[_0x61c1('0x16')](_0x1ecd7b)+_0x61c1('0x4a');var _0x5401c7=_['map'](db[_0x31bff5]['rawAttributes'],function(_0x2e224){return{'name':_0x2e224[_0x61c1('0x94')],'type':_0x2e224['type'][_0x61c1('0x96')]};});_0x34e5a0=qs[_0x61c1('0x99')](_0x5401c7,_0x26e665);if(_0x26e665[_0x61c1('0x9d')][_0x61c1('0x97')]==='user'){var _0x2cbf84={'params':{'id':_0x26e665[_0x61c1('0x9d')][_0x61c1('0xa6')]},'query':{'section':_0x1ecd7b===_0x61c1('0x20')&&_0x26e665[_0x61c1('0x8e')][_0x61c1('0x95')]==='outbound'?_0x61c1('0xa7'):_[_0x61c1('0x16')](_0x1ecd7b)+_0x61c1('0x17'),'type':_0x26e665[_0x61c1('0x8e')][_0x61c1('0x95')],'nolimit':!![],'sort':_0x61c1('0xe'),'filter':_0x26e665['query'][_0x61c1('0x54')]}};return db[_0x61c1('0x9f')][_0x61c1('0xa8')](_0x2cbf84);}return db[_0x31bff5][_0x61c1('0xa0')](_0x34e5a0);})['then'](function(_0x241982){_0x2efe1e['count']=_0x241982['count'];_0x25cd0e=_0x241982[_0x61c1('0xa1')];return getRealtimeQueues(_0x26e665,_0x1ecd7b);})[_0x61c1('0x12')](function(_0xd0b7aa){_0x1b599d=_0xd0b7aa[_0x61c1('0xa1')];return getRealtimeAgents();})[_0x61c1('0x12')](function(_0x1c70ed){_0x40efbd=_0x1c70ed[_0x61c1('0xa1')];if(_0x1ecd7b!=_0x61c1('0x20'))return;return getRealtimeVoiceQueueChannels();})[_0x61c1('0x12')](function(_0x118dbd){_0x40a6c4=_0x118dbd?_0x118dbd[_0x61c1('0xa1')]:[];return initializeQueues(_0x25cd0e,_0x1b599d,_0x1ecd7b,_0x26e665[_0x61c1('0x8e')][_0x61c1('0x95')]);})[_0x61c1('0x12')](function(_0xd97467){var _0x12d2e6=_0xd97467[_0x61c1('0x34')](function(_0x5d77ed){if(_0x1ecd7b===_0x61c1('0x20'))return getVoiceQueueAgents(_0x5d77ed,_0x25cd0e,_0x40efbd,_0x40a6c4);else return getQueueAgents(_0x5d77ed,_0x40efbd,_0x1ecd7b);});return Promise[_0x61c1('0x66')](_0x12d2e6);})['then'](function(_0xdc8216){_0x2efe1e[_0x61c1('0xa1')]=_0xdc8216;return _0x2efe1e;})[_0x61c1('0x12')](respondWithFilteredResult(_0x1b0114,_0x34e5a0))[_0x61c1('0x15')](handleError(_0x1b0114,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index d33bd7f..6b18ea9 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x111614,_0x4a7ac4){var _0x2c958e=function(_0x227e95){while(--_0x227e95){_0x111614['push'](_0x111614['shift']());}};_0x2c958e(++_0x4a7ac4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3ab81b,_0x556b54){var _0x402d45=function(_0x19a589){while(--_0x19a589){_0x3ab81b['push'](_0x3ab81b['shift']());}};_0x402d45(++_0x556b54);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4179e2,_0xf2dbb){_0x4179e2=_0x4179e2-0x0;var _0x24cb50=_0xcb91[_0x4179e2];return _0x24cb50;};'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 d978247..8ceab10 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 _0x8c8b=['DATE','sequelize','STRING'];(function(_0x2b1f6e,_0x5d16f1){var _0x37eb42=function(_0x5aaf4e){while(--_0x5aaf4e){_0x2b1f6e['push'](_0x2b1f6e['shift']());}};_0x37eb42(++_0x5d16f1);}(_0x8c8b,0x106));var _0xb8c8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8c8b[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xb8c8('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb8c8('0x1')]},'scheduledat':{'type':Sequelize[_0xb8c8('0x2')]},'uniqueid':{'type':Sequelize[_0xb8c8('0x1')]},'starttime':{'type':Sequelize[_0xb8c8('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xb8c8('0x1')]},'campaigntype':{'type':Sequelize[_0xb8c8('0x1')]},'membername':{'type':Sequelize[_0xb8c8('0x1')]}}; \ No newline at end of file +var _0xc677=['exports','INTEGER','STRING','DATE'];(function(_0x9616d8,_0x5c0e8a){var _0x221b2f=function(_0x4c542e){while(--_0x4c542e){_0x9616d8['push'](_0x9616d8['shift']());}};_0x221b2f(++_0x5c0e8a);}(_0xc677,0x16c));var _0x7c67=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc677[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x7c67('0x0')]={'state':{'type':Sequelize[_0x7c67('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x7c67('0x2')]},'scheduledat':{'type':Sequelize[_0x7c67('0x3')]},'uniqueid':{'type':Sequelize[_0x7c67('0x2')]},'starttime':{'type':Sequelize[_0x7c67('0x3')]},'responsetime':{'type':Sequelize[_0x7c67('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 5b84d2e..60b69f2 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 _0x874f=['bluebird','path','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview','lodash','util','../../config/logger','moment'];(function(_0x55c1bb,_0x37c7a0){var _0xc6d2f7=function(_0x2bf5c1){while(--_0x2bf5c1){_0x55c1bb['push'](_0x55c1bb['shift']());}};_0xc6d2f7(++_0x37c7a0);}(_0x874f,0x164));var _0xf874=function(_0x47c5bd,_0x7605da){_0x47c5bd=_0x47c5bd-0x0;var _0x2447dc=_0x874f[_0x47c5bd];return _0x2447dc;};'use strict';var _=require(_0xf874('0x0'));var util=require(_0xf874('0x1'));var logger=require(_0xf874('0x2'))('api');var moment=require(_0xf874('0x3'));var BPromise=require(_0xf874('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf874('0x5'));var rimraf=require('rimraf');var config=require(_0xf874('0x6'));var attributes=require(_0xf874('0x7'));module['exports']=function(_0x8cc97,_0x331ee9){return _0x8cc97['define'](_0xf874('0x8'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cdd=['../../config/logger','api','moment','bluebird','path','rimraf','exports','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x5cdd,0x111));var _0xd5cd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5cdd[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd5cd('0x0'));var util=require(_0xd5cd('0x1'));var logger=require(_0xd5cd('0x2'))(_0xd5cd('0x3'));var moment=require(_0xd5cd('0x4'));var BPromise=require(_0xd5cd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd5cd('0x6'));var rimraf=require(_0xd5cd('0x7'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0xd5cd('0x8')]=function(_0xc392cd,_0x122123){return _0xc392cd['define'](_0xd5cd('0x9'),attributes,{'tableName':_0xd5cd('0xa'),'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 6fc5721..e557a7e 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 _0x3983=['create','body','options','then','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x3983,0x79));var _0x3398=function(_0x1b35f2,_0x4e6a6c){_0x1b35f2=_0x1b35f2-0x0;var _0xd8a3bd=_0x3983[_0x1b35f2];return _0xd8a3bd;};'use strict';var _=require('lodash');var util=require(_0x3398('0x0'));var moment=require('moment');var BPromise=require(_0x3398('0x1'));var rs=require(_0x3398('0x2'));var fs=require('fs');var Redis=require(_0x3398('0x3'));var db=require(_0x3398('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3398('0x5'))(_0x3398('0x6'));var config=require(_0x3398('0x7'));var jayson=require(_0x3398('0x8'));var client=jayson[_0x3398('0x9')][_0x3398('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1756b0,_0x277642,_0x80b8cc){return new BPromise(function(_0x53e5a4,_0x550ade){return client[_0x3398('0xb')](_0x1756b0,_0x80b8cc)['then'](function(_0x1da933){logger[_0x3398('0xc')](_0x3398('0xd'),_0x277642,_0x3398('0xe'));logger[_0x3398('0xf')](_0x3398('0x10'),_0x277642,'request\x20sent',JSON[_0x3398('0x11')](_0x1da933));if(_0x1da933['error']){if(_0x1da933[_0x3398('0x12')][_0x3398('0x13')]===0x1f4){logger[_0x3398('0x12')](_0x3398('0xd'),_0x277642,_0x1da933[_0x3398('0x12')][_0x3398('0x14')]);return _0x550ade(_0x1da933[_0x3398('0x12')][_0x3398('0x14')]);}logger[_0x3398('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x277642,_0x1da933[_0x3398('0x12')][_0x3398('0x14')]);return _0x53e5a4(_0x1da933[_0x3398('0x12')][_0x3398('0x14')]);}else{logger[_0x3398('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x277642,_0x3398('0xe'));_0x53e5a4(_0x1da933[_0x3398('0x15')][_0x3398('0x14')]);}})['catch'](function(_0x238536){logger[_0x3398('0x12')](_0x3398('0xd'),_0x277642,_0x238536);_0x550ade(_0x238536);});});}exports[_0x3398('0x16')]=function(_0x1c248e){var _0x330252=this;return new Promise(function(_0x2b35dd,_0x793793){return db[_0x3398('0x17')][_0x3398('0x18')](_0x1c248e[_0x3398('0x19')],{'raw':_0x1c248e[_0x3398('0x1a')]?_0x1c248e['options']['raw']===undefined?!![]:![]:!![]})[_0x3398('0x1b')](function(_0x5454da){logger[_0x3398('0xc')](_0x3398('0x16'),_0x1c248e);logger['debug'](_0x3398('0x16'),_0x1c248e,JSON[_0x3398('0x11')](_0x5454da));_0x2b35dd(_0x5454da);})[_0x3398('0x1c')](function(_0x3aa57){logger['error']('CreateReportAgentPreview',_0x3aa57[_0x3398('0x14')],_0x1c248e);_0x793793(_0x330252[_0x3398('0x12')](0x1f4,_0x3aa57[_0x3398('0x14')]));});});}; \ No newline at end of file +var _0x897e=['../../config/logger','../../config/environment','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','body','options','raw','CreateReportAgentPreview','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x27336c,_0x40a9fc){var _0x6ade80=function(_0x3c298e){while(--_0x3c298e){_0x27336c['push'](_0x27336c['shift']());}};_0x6ade80(++_0x40a9fc);}(_0x897e,0x159));var _0xe897=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x897e[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xe897('0x0'));var util=require(_0xe897('0x1'));var moment=require('moment');var BPromise=require(_0xe897('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe897('0x3'));var db=require(_0xe897('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe897('0x5'))('rpc');var config=require(_0xe897('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe897('0x7')][_0xe897('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f9ff5,_0x306ef7,_0x5a64a2){return new BPromise(function(_0x1f0e93,_0x4a475a){return client[_0xe897('0x9')](_0x4f9ff5,_0x5a64a2)[_0xe897('0xa')](function(_0x10716c){logger[_0xe897('0xb')](_0xe897('0xc'),_0x306ef7,'request\x20sent');logger[_0xe897('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x306ef7,_0xe897('0xe'),JSON[_0xe897('0xf')](_0x10716c));if(_0x10716c[_0xe897('0x10')]){if(_0x10716c['error'][_0xe897('0x11')]===0x1f4){logger[_0xe897('0x10')](_0xe897('0xc'),_0x306ef7,_0x10716c[_0xe897('0x10')]['message']);return _0x4a475a(_0x10716c[_0xe897('0x10')][_0xe897('0x12')]);}logger[_0xe897('0x10')](_0xe897('0xc'),_0x306ef7,_0x10716c[_0xe897('0x10')][_0xe897('0x12')]);return _0x1f0e93(_0x10716c[_0xe897('0x10')]['message']);}else{logger[_0xe897('0xb')](_0xe897('0xc'),_0x306ef7,_0xe897('0xe'));_0x1f0e93(_0x10716c[_0xe897('0x13')][_0xe897('0x12')]);}})['catch'](function(_0x1aa01c){logger[_0xe897('0x10')](_0xe897('0xc'),_0x306ef7,_0x1aa01c);_0x4a475a(_0x1aa01c);});});}exports['CreateReportAgentPreview']=function(_0x122578){var _0x2cc5d7=this;return new Promise(function(_0x5b24bb,_0x513b14){return db['ReportAgentPreview']['create'](_0x122578[_0xe897('0x14')],{'raw':_0x122578[_0xe897('0x15')]?_0x122578[_0xe897('0x15')][_0xe897('0x16')]===undefined?!![]:![]:!![]})[_0xe897('0xa')](function(_0x2ca6fe){logger[_0xe897('0xb')](_0xe897('0x17'),_0x122578);logger[_0xe897('0xd')]('CreateReportAgentPreview',_0x122578,JSON[_0xe897('0xf')](_0x2ca6fe));_0x5b24bb(_0x2ca6fe);})[_0xe897('0x18')](function(_0xb21fbf){logger['error'](_0xe897('0x17'),_0xb21fbf[_0xe897('0x12')],_0x122578);_0x513b14(_0x2cc5d7['error'](0x1f4,_0xb21fbf[_0xe897('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index ba801a3..8deb68c 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 _0x64ec=['chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','/whatsapp/queues/:id/notify','whatsapp','/whatsapp/queues/:id','showWhatsappQueues','exports','multer','util','path','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions'];(function(_0x301efe,_0x338d14){var _0x5d44c3=function(_0x10a315){while(--_0x10a315){_0x301efe['push'](_0x301efe['shift']());}};_0x5d44c3(++_0x338d14);}(_0x64ec,0xc2));var _0xc64e=function(_0x5a7558,_0x1a232d){_0x5a7558=_0x5a7558-0x0;var _0x1ff704=_0x64ec[_0x5a7558];return _0x1ff704;};'use strict';var multer=require(_0xc64e('0x0'));var util=require(_0xc64e('0x1'));var path=require(_0xc64e('0x2'));var express=require(_0xc64e('0x3'));var router=express[_0xc64e('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0xc64e('0x5'));router[_0xc64e('0x6')](_0xc64e('0x7'),auth[_0xc64e('0x8')](),controller['voiceChannels']);router[_0xc64e('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0xc64e('0x9')]);router[_0xc64e('0x6')](_0xc64e('0xa'),auth[_0xc64e('0x8')](),controller['voiceChannelStopMixMonitor']);router['get'](_0xc64e('0xb'),auth['isAuthenticated'](),controller[_0xc64e('0xc')]);router[_0xc64e('0x6')](_0xc64e('0xd'),auth[_0xc64e('0x8')](),controller[_0xc64e('0xe')]);router[_0xc64e('0x6')](_0xc64e('0xf'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x10')]);router['get'](_0xc64e('0x11'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x12')]);router[_0xc64e('0x6')](_0xc64e('0x13'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x14')]);router['get'](_0xc64e('0x15'),auth['isAuthenticated'](),controller['smsQueues']);router[_0xc64e('0x6')](_0xc64e('0x16'),auth[_0xc64e('0x8')](),controller['whatsappQueues']);router[_0xc64e('0x6')](_0xc64e('0x17'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x18')]);router['get'](_0xc64e('0x19'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x1a')]);router[_0xc64e('0x6')]('/voice/queues/channels',auth[_0xc64e('0x8')](),controller[_0xc64e('0x1b')]);router[_0xc64e('0x6')](_0xc64e('0x1c'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x1d')]);router[_0xc64e('0x6')](_0xc64e('0x1e'),auth['isAuthenticated'](),controller[_0xc64e('0x1f')]);router['get'](_0xc64e('0x20'),auth['isAuthenticated'](),controller[_0xc64e('0x21')]);router[_0xc64e('0x6')](_0xc64e('0x22'),auth['isAuthenticated'](),controller[_0xc64e('0x23')]);router[_0xc64e('0x24')](_0xc64e('0x22'),auth[_0xc64e('0x8')](),controller['updateVoiceQueue']);router['get'](_0xc64e('0x25'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x26')]);router[_0xc64e('0x6')](_0xc64e('0x27'),auth['isAuthenticated'](),controller[_0xc64e('0x28')]);router[_0xc64e('0x6')](_0xc64e('0x29'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x2a')]);router[_0xc64e('0x24')]('/agents/:id/capacity',auth[_0xc64e('0x8')](),controller[_0xc64e('0x2b')]);router[_0xc64e('0x6')](_0xc64e('0x2c'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x2d')]);router['get']('/trunks',auth[_0xc64e('0x8')](),controller[_0xc64e('0x2e')]);router['get'](_0xc64e('0x2f'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x30')]);router['get'](_0xc64e('0x31'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x32')]);router['get'](_0xc64e('0x33'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x34')]);router[_0xc64e('0x6')](_0xc64e('0x35'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x36')]);router[_0xc64e('0x6')](_0xc64e('0x37'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x38')]);router['get'](_0xc64e('0x39'),auth[_0xc64e('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xc64e('0x6')](_0xc64e('0x3a'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x3b')]);router['get'](_0xc64e('0x3c'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0xc64e('0x3d'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x3e')]);router['post'](_0xc64e('0x3f'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x40')](_0xc64e('0x41')));router[_0xc64e('0x6')](_0xc64e('0x42'),auth[_0xc64e('0x8')](),controller['showMailQueues']);router[_0xc64e('0x43')](_0xc64e('0x44'),auth[_0xc64e('0x8')](),controller['queueNotify'](_0xc64e('0x45')));router[_0xc64e('0x6')](_0xc64e('0x46'),auth[_0xc64e('0x8')](),controller[_0xc64e('0x47')]);router[_0xc64e('0x43')]('/fax/queues/:id/notify',auth[_0xc64e('0x8')](),controller[_0xc64e('0x40')](_0xc64e('0x48')));router[_0xc64e('0x6')](_0xc64e('0x49'),auth['isAuthenticated'](),controller[_0xc64e('0x4a')]);router[_0xc64e('0x43')](_0xc64e('0x4b'),auth['isAuthenticated'](),controller[_0xc64e('0x40')]('openchannel'));router['get'](_0xc64e('0x4c'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0xc64e('0x43')]('/sms/queues/:id/notify',auth[_0xc64e('0x8')](),controller[_0xc64e('0x40')]('sms'));router[_0xc64e('0x43')](_0xc64e('0x4d'),auth['isAuthenticated'](),controller[_0xc64e('0x40')](_0xc64e('0x4e')));router[_0xc64e('0x6')]('/sms/queues/:id',auth[_0xc64e('0x8')](),controller['showSmsQueues']);router[_0xc64e('0x6')](_0xc64e('0x4f'),auth['isAuthenticated'](),controller[_0xc64e('0x50')]);router[_0xc64e('0x43')]('/agents/:id/notify',auth[_0xc64e('0x8')](),controller['agentNotify']);module[_0xc64e('0x51')]=router; \ No newline at end of file +var _0x6725=['isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','outbound','/outbound/channels','agents','put','/agents/:id/capacity','/telephones','telephones','trunks','/campaigns','campaigns','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','showChatQueues','/fax/queues/:id','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','showSmsQueues','agentNotify','exports','multer','util','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels'];(function(_0x4ef734,_0x5826d){var _0x33a7cb=function(_0x127a2b){while(--_0x127a2b){_0x4ef734['push'](_0x4ef734['shift']());}};_0x33a7cb(++_0x5826d);}(_0x6725,0x1a2));var _0x5672=function(_0x218b43,_0x2b0128){_0x218b43=_0x218b43-0x0;var _0x449bcf=_0x6725[_0x218b43];return _0x449bcf;};'use strict';var multer=require(_0x5672('0x0'));var util=require(_0x5672('0x1'));var path=require(_0x5672('0x2'));var express=require(_0x5672('0x3'));var router=express['Router']();var auth=require(_0x5672('0x4'));var controller=require(_0x5672('0x5'));router[_0x5672('0x6')](_0x5672('0x7'),auth[_0x5672('0x8')](),controller['voiceChannels']);router['get'](_0x5672('0x9'),auth[_0x5672('0x8')](),controller['voiceChannelMixMonitor']);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x5672('0x8')](),controller['voiceChannelStopMixMonitor']);router[_0x5672('0x6')]('/voice/queues',auth[_0x5672('0x8')](),controller[_0x5672('0xa')]);router['get'](_0x5672('0xb'),auth[_0x5672('0x8')](),controller[_0x5672('0xc')]);router[_0x5672('0x6')](_0x5672('0xd'),auth[_0x5672('0x8')](),controller[_0x5672('0xe')]);router[_0x5672('0x6')]('/mail/accounts',auth[_0x5672('0x8')](),controller[_0x5672('0xf')]);router['get'](_0x5672('0x10'),auth[_0x5672('0x8')](),controller[_0x5672('0x11')]);router['get'](_0x5672('0x12'),auth['isAuthenticated'](),controller[_0x5672('0x13')]);router[_0x5672('0x6')](_0x5672('0x14'),auth[_0x5672('0x8')](),controller[_0x5672('0x15')]);router[_0x5672('0x6')](_0x5672('0x16'),auth[_0x5672('0x8')](),controller['faxQueues']);router['get'](_0x5672('0x17'),auth[_0x5672('0x8')](),controller[_0x5672('0x18')]);router[_0x5672('0x6')](_0x5672('0x19'),auth[_0x5672('0x8')](),controller[_0x5672('0x1a')]);router[_0x5672('0x6')](_0x5672('0x1b'),auth[_0x5672('0x8')](),controller['voiceQueuesChannel']);router['get'](_0x5672('0x1c'),auth[_0x5672('0x8')](),controller[_0x5672('0x1d')]);router[_0x5672('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x5672('0x8')](),controller[_0x5672('0x1e')]);router[_0x5672('0x6')](_0x5672('0x1f'),auth[_0x5672('0x8')](),controller[_0x5672('0x20')]);router['put'](_0x5672('0x1f'),auth[_0x5672('0x8')](),controller[_0x5672('0x21')]);router[_0x5672('0x6')]('/outbound',auth[_0x5672('0x8')](),controller[_0x5672('0x22')]);router[_0x5672('0x6')](_0x5672('0x23'),auth[_0x5672('0x8')](),controller['outboundChannels']);router[_0x5672('0x6')]('/agents',auth[_0x5672('0x8')](),controller[_0x5672('0x24')]);router[_0x5672('0x25')](_0x5672('0x26'),auth['isAuthenticated'](),controller['agentCapacity']);router['get'](_0x5672('0x27'),auth['isAuthenticated'](),controller[_0x5672('0x28')]);router[_0x5672('0x6')]('/trunks',auth[_0x5672('0x8')](),controller[_0x5672('0x29')]);router[_0x5672('0x6')](_0x5672('0x2a'),auth[_0x5672('0x8')](),controller[_0x5672('0x2b')]);router[_0x5672('0x6')]('/fax/accounts',auth[_0x5672('0x8')](),controller['faxAccounts']);router[_0x5672('0x6')](_0x5672('0x2c'),auth[_0x5672('0x8')](),controller[_0x5672('0x2d')]);router[_0x5672('0x6')]('/mail/queues/waitinginteractions',auth[_0x5672('0x8')](),controller['mailQueuesWaitingInteractions']);router[_0x5672('0x6')](_0x5672('0x2e'),auth[_0x5672('0x8')](),controller[_0x5672('0x2f')]);router[_0x5672('0x6')](_0x5672('0x30'),auth[_0x5672('0x8')](),controller[_0x5672('0x31')]);router[_0x5672('0x6')](_0x5672('0x32'),auth[_0x5672('0x8')](),controller[_0x5672('0x33')]);router[_0x5672('0x6')](_0x5672('0x34'),auth['isAuthenticated'](),controller[_0x5672('0x35')]);router[_0x5672('0x6')](_0x5672('0x36'),auth[_0x5672('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0x5672('0x37')]('/mail/queues/:id/notify',auth[_0x5672('0x8')](),controller[_0x5672('0x38')](_0x5672('0x39')));router['get'](_0x5672('0x3a'),auth[_0x5672('0x8')](),controller[_0x5672('0x3b')]);router['post']('/chat/queues/:id/notify',auth[_0x5672('0x8')](),controller[_0x5672('0x38')]('chat'));router[_0x5672('0x6')]('/chat/queues/:id',auth[_0x5672('0x8')](),controller[_0x5672('0x3c')]);router[_0x5672('0x37')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify']('fax'));router['get'](_0x5672('0x3d'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x5672('0x37')](_0x5672('0x3e'),auth['isAuthenticated'](),controller['queueNotify']('openchannel'));router['get'](_0x5672('0x3f'),auth[_0x5672('0x8')](),controller[_0x5672('0x40')]);router[_0x5672('0x37')](_0x5672('0x41'),auth['isAuthenticated'](),controller['queueNotify'](_0x5672('0x42')));router[_0x5672('0x37')](_0x5672('0x43'),auth[_0x5672('0x8')](),controller[_0x5672('0x38')]('whatsapp'));router[_0x5672('0x6')]('/sms/queues/:id',auth[_0x5672('0x8')](),controller[_0x5672('0x44')]);router[_0x5672('0x6')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x5672('0x37')]('/agents/:id/notify',auth[_0x5672('0x8')](),controller[_0x5672('0x45')]);module[_0x5672('0x46')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 14e4984..7b90d0f 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 _0x5fc3=['openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','chat','User','\x20Message\x20not\x20found','Start','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','status','json','sendStatus','name','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','format','length','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions'];(function(_0x5963e5,_0x5444c2){var _0x3132d8=function(_0x3b21bb){while(--_0x3b21bb){_0x5963e5['push'](_0x5963e5['shift']());}};_0x3132d8(++_0x5444c2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x5fc3[_0x409353];return _0x4f4b59;};'use strict';var BPromise=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));var _=require('lodash');var util=require(_0x35fc('0x2'));var db=require(_0x35fc('0x3'))['db'];var logger=require(_0x35fc('0x4'))(_0x35fc('0x5'));var jayson=require(_0x35fc('0x6'));var amiClient=jayson['client'][_0x35fc('0x7')]({'port':0x232a});var mailClient=jayson[_0x35fc('0x8')][_0x35fc('0x7')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){var _0x1e5f90=_0x16e153?_0x16e153:amiClient;return _0x1e5f90[_0x35fc('0x9')](_0x19a0d1,_0x508b32)[_0x35fc('0xa')](function(_0x2051ab){if(_0x2051ab['error']){if(_0x2051ab[_0x35fc('0xb')][_0x35fc('0xc')]===0x1f4){return _0xc72d93(_0x2051ab['error'][_0x35fc('0xd')]);}return _0x27524f(_0x2051ab[_0x35fc('0xb')]['message']);}else{_0x27524f(_0x2051ab[_0x35fc('0xe')]);}})[_0x35fc('0xf')](function(_0x5469f5){_0xc72d93(_0x5469f5);});});}function respondWithResult(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xc8;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x10')](_0x409357)[_0x35fc('0x11')](_0x5d462a);}return _0x4cbe74[_0x35fc('0x12')](0x194);};}function handleError(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0x1f4;return function(_0x5cfe94){logger['error'](_0x5cfe94['stack']);if(_0x5cfe94['name']){delete _0x5cfe94[_0x35fc('0x13')];}_0x29730f[_0x35fc('0x10')](_0x38d9f2)[_0x35fc('0x14')](_0x5cfe94);};}function findById(_0x154958){return function(_0x227a49){if(!_[_0x35fc('0x15')](_0x154958)&&!_['isNil'](_0x227a49)&&!_[_0x35fc('0x15')](_0x227a49[_0x35fc('0x16')])){return _['find'](_0x227a49[_0x35fc('0x16')],function(_0x363e47){return _0x363e47['id']==_0x154958;});}return null;};}exports[_0x35fc('0x17')]=function(_0x5f56c6,_0x1a86e9){return respondWithRpcPromise(_0x35fc('0x18'),_0x5f56c6[_0x35fc('0x19')])['then'](respondWithResult(_0x1a86e9,null))[_0x35fc('0xf')](handleError(_0x1a86e9,null));};exports[_0x35fc('0x1a')]=function(_0x3229d1,_0x251a1f){return respondWithRpcPromise(_0x35fc('0x1b'),_[_0x35fc('0x1c')](_0x3229d1[_0x35fc('0x19')],_0x3229d1[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x251a1f,null))[_0x35fc('0xf')](handleError(_0x251a1f,null));};exports['voiceChannelStopMixMonitor']=function(_0x323aee,_0xd5399f){return respondWithRpcPromise(_0x35fc('0x1e'),_[_0x35fc('0x1c')](_0x323aee[_0x35fc('0x19')],_0x323aee['params']))[_0x35fc('0xa')](respondWithResult(_0xd5399f,null))[_0x35fc('0xf')](handleError(_0xd5399f,null));};exports['voiceQueues']=function(_0x265324,_0x5a93df){return respondWithRpcPromise(_0x35fc('0x1f'),_0x265324['query'])[_0x35fc('0xa')](respondWithResult(_0x5a93df,null))['catch'](handleError(_0x5a93df,null));};exports[_0x35fc('0x20')]=function(_0xdfab9f,_0x5cb986){return respondWithRpcPromise('VoiceQueues',_0xdfab9f[_0x35fc('0x19')])['then'](findById(_0xdfab9f[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x5cb986,null))['catch'](handleError(_0x5cb986,null));};exports[_0x35fc('0x21')]=function(_0x645eac,_0x383837){return respondWithRpcPromise(_0x35fc('0x22'),_[_0x35fc('0x1c')](_0x645eac[_0x35fc('0x23')],_0x645eac[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x383837,null))['catch'](handleError(_0x383837,null));};exports[_0x35fc('0x24')]=function(_0x220931,_0x22af18){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x35fc('0x1c')](_0x220931[_0x35fc('0x19')],_0x220931[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x22af18,null))[_0x35fc('0xf')](handleError(_0x22af18,null));};exports[_0x35fc('0x25')]=function(_0x222ddb,_0x37b435){return respondWithRpcPromise(_0x35fc('0x26'),_0x222ddb[_0x35fc('0x19')])['then'](respondWithResult(_0x37b435,null))['catch'](handleError(_0x37b435,null));};exports[_0x35fc('0x27')]=function(_0x4af5fe,_0x37b394){return respondWithRpcPromise(_0x35fc('0x28'),_[_0x35fc('0x1c')](_0x4af5fe[_0x35fc('0x19')],_0x4af5fe[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x37b394,null))['catch'](handleError(_0x37b394,null));};exports[_0x35fc('0x29')]=function(_0x330a14,_0x46b9ef){return respondWithRpcPromise(_0x35fc('0x2a'),_[_0x35fc('0x1c')](_0x330a14[_0x35fc('0x19')],_0x330a14['params']))[_0x35fc('0xa')](respondWithResult(_0x46b9ef,null))[_0x35fc('0xf')](handleError(_0x46b9ef,null));};exports[_0x35fc('0x2b')]=function(_0x52f53d,_0x2c657d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x35fc('0x1c')](_0x52f53d[_0x35fc('0x19')],_0x52f53d[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x2c657d,null))['catch'](handleError(_0x2c657d,null));};exports['outbound']=function(_0x59e4fb,_0x20f5fe){return respondWithRpcPromise('Outbound',_0x59e4fb[_0x35fc('0x19')])['then'](respondWithResult(_0x20f5fe,null))[_0x35fc('0xf')](handleError(_0x20f5fe,null));};exports[_0x35fc('0x2c')]=function(_0x2ca9ac,_0x22b724){return respondWithRpcPromise(_0x35fc('0x2d'),_0x2ca9ac[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x22b724,null))['catch'](handleError(_0x22b724,null));};exports[_0x35fc('0x2e')]=function(_0x16087d,_0x4e0ce3){var _0x1feda5;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d[_0x35fc('0x19')])[_0x35fc('0xa')](function(_0x813866){_0x1feda5=_0x813866;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d['query'],routingClient);})[_0x35fc('0xa')](function(_0x267858){return _[_0x35fc('0x1c')]({},_0x267858,_0x1feda5);})['then'](respondWithResult(_0x4e0ce3,null))[_0x35fc('0xf')](handleError(_0x4e0ce3,null));};exports[_0x35fc('0x30')]=function(_0x596919,_0x237548){if(_0x596919[_0x35fc('0x23')]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]&&_0x596919[_0x35fc('0x32')]&&_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]){for(var _0x3ec51f in _0x596919['body']['interaction']){if(_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]['hasOwnProperty'](_0x3ec51f)){db['MemberReport']['findAll']({'where':{'channel':_0x3ec51f,'membername':_0x596919[_0x35fc('0x32')][_0x35fc('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length']?{'$notIn':_0x596919['body']['interaction'][_0x3ec51f]}:{'$ne':null}}})['then'](function(_0x56bdb9){var _0xb26e3f=moment()[_0x35fc('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x119925=0x0,_0x56cf1f=_0x56bdb9[_0x35fc('0x34')];_0x119925<_0x56cf1f;_0x119925+=0x1){_0x56bdb9[_0x119925][_0x35fc('0x35')]({'exitAt':_0xb26e3f});}});for(var _0x350237=0x0;_0x350237<_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length'];_0x350237+=0x1){db[_0x35fc('0x36')][_0x35fc('0x37')]({'where':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'type':_0x35fc('0x38'),'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237],'exitAt':null},'defaults':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'interface':_['isNil'](_0x596919['user'][_0x35fc('0x39')])?util[_0x35fc('0x33')](_0x35fc('0x3a'),_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]):_0x596919[_0x35fc('0x32')][_0x35fc('0x39')],'type':_0x35fc('0x38'),'enterAt':moment()['format'](_0x35fc('0x3b')),'role':_0x35fc('0x3c'),'internal':_0x596919[_0x35fc('0x32')][_0x35fc('0x3d')],'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237]}});}}}}return respondWithRpcPromise(_0x35fc('0x3e'),{'id':_0x596919[_0x35fc('0x1d')]['id'],'capacity':_0x596919[_0x35fc('0x23')][_0x35fc('0x3f')]},routingClient)[_0x35fc('0xa')](respondWithResult(_0x237548,null))[_0x35fc('0xf')](handleError(_0x237548,null));};exports[_0x35fc('0x40')]=function(_0x3146e2,_0x59c666){return respondWithRpcPromise('Telephones',_0x3146e2[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x59c666,null))[_0x35fc('0xf')](handleError(_0x59c666,null));};exports[_0x35fc('0x41')]=function(_0x3ee296,_0x3e6494){return respondWithRpcPromise('Trunks',_0x3ee296['query'])[_0x35fc('0xa')](respondWithResult(_0x3e6494,null))[_0x35fc('0xf')](handleError(_0x3e6494,null));};exports[_0x35fc('0x42')]=function(_0x38bc78,_0x5b2595){return respondWithRpcPromise(_0x35fc('0x43'),_0x38bc78[_0x35fc('0x19')])['then'](respondWithResult(_0x5b2595,null))[_0x35fc('0xf')](handleError(_0x5b2595,null));};exports[_0x35fc('0x44')]=function(_0x590faa,_0x3e12e4){return respondWithRpcPromise(_0x35fc('0x45'),_0x590faa[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x3e12e4,null))['catch'](handleError(_0x3e12e4,null));};exports['showChatQueues']=function(_0x502a15,_0x240338){return respondWithRpcPromise(_0x35fc('0x45'),_0x502a15['query'],routingClient)[_0x35fc('0xa')](findById(_0x502a15[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x240338,null))[_0x35fc('0xf')](handleError(_0x240338,null));};exports[_0x35fc('0x46')]=function(_0x538be0,_0x2d9d45){return respondWithRpcPromise(_0x35fc('0x47'),_0x538be0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x2d9d45,null))[_0x35fc('0xf')](handleError(_0x2d9d45,null));};exports[_0x35fc('0x48')]=function(_0x47fb1a,_0x35a676){return respondWithRpcPromise(_0x35fc('0x47'),_0x47fb1a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x47fb1a[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x35a676,null))[_0x35fc('0xf')](handleError(_0x35a676,null));};exports[_0x35fc('0x49')]=function(_0x53a79d,_0x10a5b8){return respondWithRpcPromise(_0x35fc('0x4a'),_0x53a79d[_0x35fc('0x19')],mailClient)['then'](respondWithResult(_0x10a5b8,null))[_0x35fc('0xf')](handleError(_0x10a5b8,null));};exports['openchannelQueues']=function(_0x4ceacc,_0x5d4a39){return respondWithRpcPromise(_0x35fc('0x4b'),_0x4ceacc[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x5d4a39,null))[_0x35fc('0xf')](handleError(_0x5d4a39,null));};exports[_0x35fc('0x4c')]=function(_0x4bbea0,_0x579f5a){return respondWithRpcPromise('OpenchannelQueues',_0x4bbea0['query'],routingClient)['then'](findById(_0x4bbea0[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x579f5a,null))[_0x35fc('0xf')](handleError(_0x579f5a,null));};exports[_0x35fc('0x4d')]=function(_0x511e8b,_0x458eb8){return respondWithRpcPromise(_0x35fc('0x4e'),_0x511e8b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x458eb8,null))[_0x35fc('0xf')](handleError(_0x458eb8,null));};exports[_0x35fc('0x4f')]=function(_0x27071b,_0x2127e0){return respondWithRpcPromise(_0x35fc('0x4e'),_0x27071b['query'],routingClient)[_0x35fc('0xa')](findById(_0x27071b['params']['id']))[_0x35fc('0xa')](respondWithResult(_0x2127e0,null))[_0x35fc('0xf')](handleError(_0x2127e0,null));};exports[_0x35fc('0x50')]=function(_0x2bc76c,_0x4bdde7){return respondWithRpcPromise(_0x35fc('0x51'),_0x2bc76c['query'],routingClient)['then'](respondWithResult(_0x4bdde7,null))['catch'](handleError(_0x4bdde7,null));};exports[_0x35fc('0x52')]=function(_0x5dfeb7,_0x3c9027){return respondWithRpcPromise('WhatsappQueues',_0x5dfeb7[_0x35fc('0x19')],routingClient)['then'](findById(_0x5dfeb7[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x3c9027,null))[_0x35fc('0xf')](handleError(_0x3c9027,null));};exports[_0x35fc('0x53')]=function(_0x5c2ec0,_0x3d0ecc){return respondWithRpcPromise(_0x35fc('0x54'),_0x5c2ec0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x3d0ecc,null))[_0x35fc('0xf')](handleError(_0x3d0ecc,null));};exports[_0x35fc('0x55')]=function(_0x37764b,_0x3c1b56){return respondWithRpcPromise(_0x35fc('0x54'),_0x37764b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x37764b[_0x35fc('0x1d')]['id']))['then'](respondWithResult(_0x3c1b56,null))[_0x35fc('0xf')](handleError(_0x3c1b56,null));};exports[_0x35fc('0x56')]=function(_0x2600d2,_0x4a926d){return respondWithRpcPromise(_0x35fc('0x57'),_0x2600d2[_0x35fc('0x19')])['then'](respondWithResult(_0x4a926d,null))['catch'](handleError(_0x4a926d,null));};exports[_0x35fc('0x58')]=function(_0x4835c2,_0x223ad3){return respondWithRpcPromise(_0x35fc('0x59'),_0x4835c2[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x223ad3,null))[_0x35fc('0xf')](handleError(_0x223ad3,null));};exports[_0x35fc('0x5a')]=function(_0x13f602,_0x104b1d){return respondWithRpcPromise(_0x35fc('0x5b'),_0x13f602[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x104b1d,null))[_0x35fc('0xf')](handleError(_0x104b1d,null));};exports[_0x35fc('0x5c')]=function(_0x9f034e,_0x184f28){return respondWithRpcPromise(_0x35fc('0x5d'),_0x9f034e[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x184f28,null))[_0x35fc('0xf')](handleError(_0x184f28,null));};exports[_0x35fc('0x5e')]=function(_0x4ba1b0,_0x1797d0){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4ba1b0[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](function(_0x2185ce){if(_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')]!==undefined){var _0x3f56f4=_(_0x2185ce[_0x35fc('0x16')])[_0x35fc('0x60')]([_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')],_0x4ba1b0[_0x35fc('0x1d')]['id']])['map'](_0x35fc('0x61'))[_0x35fc('0x62')]()[_0x35fc('0x63')]();return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x41a6de){return _0x3f56f4['indexOf'](_0x41a6de[_0x35fc('0x61')])>-0x1;});}else{return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x23206d){return _0x23206d[_0x35fc('0x61')]===parseInt(_0x4ba1b0[_0x35fc('0x1d')]['id']);});}})[_0x35fc('0xa')](respondWithResult(_0x1797d0,null))[_0x35fc('0xf')](handleError(_0x1797d0,null));};exports[_0x35fc('0x64')]=function(_0x5f23d8,_0x28f02b){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x5f23d8[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x28f02b,null))['catch'](handleError(_0x28f02b,null));};exports[_0x35fc('0x65')]=function(_0x41002a,_0xcaa49){return respondWithRpcPromise(_0x35fc('0x66'),_0x41002a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0xcaa49,null))[_0x35fc('0xf')](handleError(_0xcaa49,null));};exports[_0x35fc('0x67')]=function(_0x25ee61,_0x5806bf){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x25ee61['query'],routingClient)['then'](respondWithResult(_0x5806bf,null))[_0x35fc('0xf')](handleError(_0x5806bf,null));};exports[_0x35fc('0x68')]=function(_0x8fc410){return function(_0x1f5cbc,_0x35ef53){var _0x4f535a,_0x226fdf;var _0x19682e=_[_0x35fc('0x69')](_0x8fc410);var _0x169ea2=_0x8fc410==='chat'?_0x35fc('0x6a'):_0x35fc('0x6b');return db[_0x19682e+_0x35fc('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x1f5cbc[_0x35fc('0x1d')]['id']}})[_0x35fc('0xa')](function(_0x319033){if(_[_0x35fc('0x15')](_0x319033)){throw new Error(_0x19682e+_0x35fc('0x6d'));}_0x4f535a=_0x319033;return db[_0x19682e+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x1f5cbc[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x19682e+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x19682e+_0x169ea2],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x221c5b){if(_[_0x35fc('0x15')](_0x221c5b)){throw new Error(_0x19682e+'\x20Message\x20not\x20found');}_0x226fdf=_0x221c5b;return _0x221c5b[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4855ee={'uniqueid':_0x8fc410+'.'+_0x226fdf['id']+'.'+_0x226fdf[_0x35fc('0x70')]['id'],'FromUserId':_0x1f5cbc['user']['id'],'type':_0x35fc('0x72')};_0x4855ee[_0x19682e+_0x35fc('0x73')]=_0x226fdf['id'];_0x4855ee[_0x19682e+_0x35fc('0x74')]=_0x226fdf['Interaction']['id'];_0x4855ee[_0x35fc('0x75')+_0x19682e+_0x169ea2+'Id']=_0x226fdf[_0x35fc('0x6b')]['id'];_0x4855ee['To'+_0x19682e+_0x35fc('0x76')]=_0x4f535a['id'];return db[_0x19682e+_0x35fc('0x77')][_0x35fc('0x78')](_0x4855ee);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x8fc410,'interaction':_0x226fdf['Interaction'],'message':_0x226fdf,'account':_0x226fdf[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4f535a[_0x35fc('0x13')]+','+(_0x226fdf[_0x35fc('0x6b')][_0x35fc('0x79')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})['then'](respondWithResult(_0x35ef53,null))[_0x35fc('0xf')](handleError(_0x35ef53,null));};};exports[_0x35fc('0x7b')]=function(_0x312827,_0x47c507){var _0x128286,_0x175cc7;if(_[_0x35fc('0x15')](_0x312827['body']['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x32b9e1=_0x312827[_0x35fc('0x23')][_0x35fc('0x7c')];var _0x3858a9=_['capitalize'](_0x32b9e1);var _0x3ead4e=_0x32b9e1===_0x35fc('0x7d')?'Website':'Account';return db[_0x35fc('0x7e')][_0x35fc('0x6f')]({'raw':!![],'where':{'id':_0x312827[_0x35fc('0x1d')]['id'],'role':'agent'}})['then'](function(_0x134e60){if(_[_0x35fc('0x15')](_0x134e60)){throw new Error('Agent\x20not\x20found');}_0x128286=_0x134e60;return db[_0x3858a9+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x312827[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x3858a9+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x3858a9+_0x3ead4e],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x4fd676){if(_[_0x35fc('0x15')](_0x4fd676)){throw new Error(_0x3858a9+_0x35fc('0x7f'));}_0x175cc7=_0x4fd676;return _0x4fd676[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x96dfc={'uniqueid':_0x32b9e1+'.'+_0x175cc7['id']+'.'+_0x175cc7[_0x35fc('0x70')]['id'],'FromUserId':_0x312827[_0x35fc('0x32')]['id'],'type':'queue','ToUserId':_0x128286['id']};_0x96dfc[_0x3858a9+_0x35fc('0x73')]=_0x175cc7['id'];_0x96dfc[_0x3858a9+_0x35fc('0x74')]=_0x175cc7['Interaction']['id'];_0x96dfc[_0x35fc('0x75')+_0x3858a9+_0x3ead4e+'Id']=_0x175cc7[_0x35fc('0x6b')]['id'];return db[_0x3858a9+_0x35fc('0x77')][_0x35fc('0x78')](_0x96dfc);})[_0x35fc('0xa')](function(){return respondWithRpcPromise(_0x35fc('0x80'),{'channel':_0x32b9e1,'interaction':_0x175cc7[_0x35fc('0x70')],'message':_0x175cc7,'account':_0x175cc7[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x35fc('0x3c'),'appdata':_0x128286['name']+','+(_0x175cc7[_0x35fc('0x6b')][_0x35fc('0x81')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})[_0x35fc('0xa')](respondWithResult(_0x47c507,null))['catch'](handleError(_0x47c507,null));}; \ No newline at end of file +var _0x2bd8=['SmsQueues','showSmsQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','map','queue_id','uniq','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','Account','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','User','Agent\x20not\x20found','\x20Message\x20not\x20found','update','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','error','message','result','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','findAll','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','interface','SIP/%s','format','agent','internal','telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues'];(function(_0x9166a6,_0x287901){var _0x371ce3=function(_0x26f534){while(--_0x26f534){_0x9166a6['push'](_0x9166a6['shift']());}};_0x371ce3(++_0x287901);}(_0x2bd8,0x130));var _0x82bd=function(_0x42869b,_0x405eb9){_0x42869b=_0x42869b-0x0;var _0x186bca=_0x2bd8[_0x42869b];return _0x186bca;};'use strict';var BPromise=require(_0x82bd('0x0'));var moment=require('moment');var _=require(_0x82bd('0x1'));var util=require(_0x82bd('0x2'));var db=require(_0x82bd('0x3'))['db'];var logger=require(_0x82bd('0x4'))(_0x82bd('0x5'));var jayson=require(_0x82bd('0x6'));var amiClient=jayson[_0x82bd('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0x82bd('0x7')][_0x82bd('0x8')]({'port':0x232b});var routingClient=jayson[_0x82bd('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){var _0x1666cf=_0x226f60?_0x226f60:amiClient;return _0x1666cf['request'](_0x19dbb1,_0x77d7a9)['then'](function(_0x51c6ea){if(_0x51c6ea[_0x82bd('0x9')]){if(_0x51c6ea['error']['code']===0x1f4){return _0x4dc3a6(_0x51c6ea[_0x82bd('0x9')]['message']);}return _0x1f7463(_0x51c6ea['error'][_0x82bd('0xa')]);}else{_0x1f7463(_0x51c6ea[_0x82bd('0xb')]);}})['catch'](function(_0x140ad6){_0x4dc3a6(_0x140ad6);});});}function respondWithResult(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xc8;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0xc')](_0xfaccf7)[_0x82bd('0xd')](_0x51e17e);}return _0x5f1ab9[_0x82bd('0xe')](0x194);};}function handleError(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0x1f4;return function(_0x446ffc){logger[_0x82bd('0x9')](_0x446ffc['stack']);if(_0x446ffc[_0x82bd('0xf')]){delete _0x446ffc['name'];}_0x2ca530[_0x82bd('0xc')](_0x58d82b)[_0x82bd('0x10')](_0x446ffc);};}function findById(_0x2c5155){return function(_0x300982){if(!_[_0x82bd('0x11')](_0x2c5155)&&!_[_0x82bd('0x11')](_0x300982)&&!_[_0x82bd('0x11')](_0x300982[_0x82bd('0x12')])){return _[_0x82bd('0x13')](_0x300982[_0x82bd('0x12')],function(_0x390107){return _0x390107['id']==_0x2c5155;});}return null;};}exports[_0x82bd('0x14')]=function(_0x1c3779,_0x253741){return respondWithRpcPromise('VoiceChannels',_0x1c3779['query'])[_0x82bd('0x15')](respondWithResult(_0x253741,null))[_0x82bd('0x16')](handleError(_0x253741,null));};exports[_0x82bd('0x17')]=function(_0xc9fcdf,_0x34899b){return respondWithRpcPromise(_0x82bd('0x18'),_[_0x82bd('0x19')](_0xc9fcdf[_0x82bd('0x1a')],_0xc9fcdf[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0x34899b,null))[_0x82bd('0x16')](handleError(_0x34899b,null));};exports[_0x82bd('0x1c')]=function(_0x1ca91f,_0x3260c4){return respondWithRpcPromise(_0x82bd('0x1d'),_[_0x82bd('0x19')](_0x1ca91f[_0x82bd('0x1a')],_0x1ca91f[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0x3260c4,null))['catch'](handleError(_0x3260c4,null));};exports['voiceQueues']=function(_0x4248be,_0x436ecd){return respondWithRpcPromise(_0x82bd('0x1e'),_0x4248be[_0x82bd('0x1a')])[_0x82bd('0x15')](respondWithResult(_0x436ecd,null))[_0x82bd('0x16')](handleError(_0x436ecd,null));};exports[_0x82bd('0x1f')]=function(_0xbef23b,_0x2f0bb6){return respondWithRpcPromise(_0x82bd('0x1e'),_0xbef23b['query'])['then'](findById(_0xbef23b['params']['id']))['then'](respondWithResult(_0x2f0bb6,null))[_0x82bd('0x16')](handleError(_0x2f0bb6,null));};exports[_0x82bd('0x20')]=function(_0x351d3d,_0x190bca){return respondWithRpcPromise(_0x82bd('0x21'),_['merge'](_0x351d3d['body'],_0x351d3d['params']))[_0x82bd('0x15')](respondWithResult(_0x190bca,null))[_0x82bd('0x16')](handleError(_0x190bca,null));};exports[_0x82bd('0x22')]=function(_0x580ba8,_0x166c46){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x82bd('0x19')](_0x580ba8[_0x82bd('0x1a')],_0x580ba8[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0x166c46,null))[_0x82bd('0x16')](handleError(_0x166c46,null));};exports[_0x82bd('0x23')]=function(_0x5ca7fc,_0x591b38){return respondWithRpcPromise(_0x82bd('0x24'),_0x5ca7fc[_0x82bd('0x1a')])['then'](respondWithResult(_0x591b38,null))[_0x82bd('0x16')](handleError(_0x591b38,null));};exports['voiceQueuesChannel']=function(_0x578e6e,_0x3b8015){return respondWithRpcPromise(_0x82bd('0x25'),_[_0x82bd('0x19')](_0x578e6e[_0x82bd('0x1a')],_0x578e6e[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0x3b8015,null))[_0x82bd('0x16')](handleError(_0x3b8015,null));};exports[_0x82bd('0x26')]=function(_0x42dc7f,_0xefc6e4){return respondWithRpcPromise(_0x82bd('0x27'),_[_0x82bd('0x19')](_0x42dc7f[_0x82bd('0x1a')],_0x42dc7f[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0xefc6e4,null))[_0x82bd('0x16')](handleError(_0xefc6e4,null));};exports[_0x82bd('0x28')]=function(_0x4bdcae,_0x59b7ca){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x82bd('0x19')](_0x4bdcae[_0x82bd('0x1a')],_0x4bdcae['params']))[_0x82bd('0x15')](respondWithResult(_0x59b7ca,null))['catch'](handleError(_0x59b7ca,null));};exports['outbound']=function(_0x4c5f8d,_0x2b7675){return respondWithRpcPromise(_0x82bd('0x29'),_0x4c5f8d[_0x82bd('0x1a')])[_0x82bd('0x15')](respondWithResult(_0x2b7675,null))[_0x82bd('0x16')](handleError(_0x2b7675,null));};exports['outboundChannels']=function(_0x54e33f,_0x575c14){return respondWithRpcPromise(_0x82bd('0x2a'),_0x54e33f['query'])['then'](respondWithResult(_0x575c14,null))[_0x82bd('0x16')](handleError(_0x575c14,null));};exports[_0x82bd('0x2b')]=function(_0x3192e2,_0x2c5e7d){var _0x3ff054;return respondWithRpcPromise(_0x82bd('0x2c'),_0x3192e2[_0x82bd('0x1a')])[_0x82bd('0x15')](function(_0x18752a){_0x3ff054=_0x18752a;return respondWithRpcPromise('Agents',_0x3192e2['query'],routingClient);})[_0x82bd('0x15')](function(_0x689b3c){return _['merge']({},_0x689b3c,_0x3ff054);})['then'](respondWithResult(_0x2c5e7d,null))[_0x82bd('0x16')](handleError(_0x2c5e7d,null));};exports[_0x82bd('0x2d')]=function(_0x4d310b,_0x121f1f){if(_0x4d310b[_0x82bd('0x2e')]&&_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')]&&_0x4d310b[_0x82bd('0x30')]&&_0x4d310b[_0x82bd('0x30')][_0x82bd('0xf')]){for(var _0x2c429d in _0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')]){if(_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')]['hasOwnProperty'](_0x2c429d)){db[_0x82bd('0x31')][_0x82bd('0x32')]({'where':{'channel':_0x2c429d,'membername':_0x4d310b['user']['name'],'type':_0x82bd('0x33'),'exitAt':null,'uniqueid':_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')][_0x2c429d]&&_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')][_0x2c429d]['length']?{'$notIn':_0x4d310b['body'][_0x82bd('0x2f')][_0x2c429d]}:{'$ne':null}}})[_0x82bd('0x15')](function(_0x4b2fb8){var _0x158957=moment()['format'](_0x82bd('0x34'));for(var _0x6d65c6=0x0,_0x587aec=_0x4b2fb8[_0x82bd('0x35')];_0x6d65c6<_0x587aec;_0x6d65c6+=0x1){_0x4b2fb8[_0x6d65c6][_0x82bd('0x36')]({'exitAt':_0x158957});}});for(var _0x54d12e=0x0;_0x54d12e<_0x4d310b['body'][_0x82bd('0x2f')][_0x2c429d]['length'];_0x54d12e+=0x1){db[_0x82bd('0x31')][_0x82bd('0x37')]({'where':{'channel':_0x2c429d,'membername':_0x4d310b[_0x82bd('0x30')][_0x82bd('0xf')],'type':'INTERACTION','uniqueid':_0x4d310b['body'][_0x82bd('0x2f')][_0x2c429d][_0x54d12e],'exitAt':null},'defaults':{'channel':_0x2c429d,'membername':_0x4d310b[_0x82bd('0x30')]['name'],'interface':_[_0x82bd('0x11')](_0x4d310b[_0x82bd('0x30')][_0x82bd('0x38')])?util['format'](_0x82bd('0x39'),_0x4d310b[_0x82bd('0x30')][_0x82bd('0xf')]):_0x4d310b[_0x82bd('0x30')][_0x82bd('0x38')],'type':_0x82bd('0x33'),'enterAt':moment()[_0x82bd('0x3a')](_0x82bd('0x34')),'role':_0x82bd('0x3b'),'internal':_0x4d310b[_0x82bd('0x30')][_0x82bd('0x3c')],'uniqueid':_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')][_0x2c429d][_0x54d12e]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x4d310b[_0x82bd('0x1b')]['id'],'capacity':_0x4d310b[_0x82bd('0x2e')]['capacity']},routingClient)[_0x82bd('0x15')](respondWithResult(_0x121f1f,null))[_0x82bd('0x16')](handleError(_0x121f1f,null));};exports[_0x82bd('0x3d')]=function(_0x4237ef,_0x55a2e6){return respondWithRpcPromise('Telephones',_0x4237ef[_0x82bd('0x1a')])['then'](respondWithResult(_0x55a2e6,null))['catch'](handleError(_0x55a2e6,null));};exports[_0x82bd('0x3e')]=function(_0x4c35dd,_0x523cbe){return respondWithRpcPromise(_0x82bd('0x3f'),_0x4c35dd[_0x82bd('0x1a')])[_0x82bd('0x15')](respondWithResult(_0x523cbe,null))[_0x82bd('0x16')](handleError(_0x523cbe,null));};exports[_0x82bd('0x40')]=function(_0x1a7402,_0x417c29){return respondWithRpcPromise(_0x82bd('0x41'),_0x1a7402[_0x82bd('0x1a')])[_0x82bd('0x15')](respondWithResult(_0x417c29,null))[_0x82bd('0x16')](handleError(_0x417c29,null));};exports[_0x82bd('0x42')]=function(_0x153fad,_0x1a1cdc){return respondWithRpcPromise(_0x82bd('0x43'),_0x153fad['query'],routingClient)[_0x82bd('0x15')](respondWithResult(_0x1a1cdc,null))[_0x82bd('0x16')](handleError(_0x1a1cdc,null));};exports[_0x82bd('0x44')]=function(_0x354581,_0x9bf8fa){return respondWithRpcPromise('ChatQueues',_0x354581['query'],routingClient)['then'](findById(_0x354581['params']['id']))[_0x82bd('0x15')](respondWithResult(_0x9bf8fa,null))[_0x82bd('0x16')](handleError(_0x9bf8fa,null));};exports[_0x82bd('0x45')]=function(_0x127f8f,_0x568fc3){return respondWithRpcPromise('MailQueues',_0x127f8f[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](respondWithResult(_0x568fc3,null))[_0x82bd('0x16')](handleError(_0x568fc3,null));};exports['showMailQueues']=function(_0x2657bc,_0x2252ef){return respondWithRpcPromise(_0x82bd('0x46'),_0x2657bc[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x2657bc[_0x82bd('0x1b')]['id']))[_0x82bd('0x15')](respondWithResult(_0x2252ef,null))[_0x82bd('0x16')](handleError(_0x2252ef,null));};exports[_0x82bd('0x47')]=function(_0x20b636,_0x3ae44e){return respondWithRpcPromise(_0x82bd('0x48'),_0x20b636[_0x82bd('0x1a')],mailClient)[_0x82bd('0x15')](respondWithResult(_0x3ae44e,null))[_0x82bd('0x16')](handleError(_0x3ae44e,null));};exports[_0x82bd('0x49')]=function(_0x124ca4,_0x1fa71d){return respondWithRpcPromise('OpenchannelQueues',_0x124ca4[_0x82bd('0x1a')],routingClient)['then'](respondWithResult(_0x1fa71d,null))['catch'](handleError(_0x1fa71d,null));};exports[_0x82bd('0x4a')]=function(_0x4d2305,_0x306247){return respondWithRpcPromise(_0x82bd('0x4b'),_0x4d2305[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x4d2305[_0x82bd('0x1b')]['id']))[_0x82bd('0x15')](respondWithResult(_0x306247,null))[_0x82bd('0x16')](handleError(_0x306247,null));};exports[_0x82bd('0x4c')]=function(_0x40d6cf,_0x37ede1){return respondWithRpcPromise(_0x82bd('0x4d'),_0x40d6cf['query'],routingClient)['then'](respondWithResult(_0x37ede1,null))[_0x82bd('0x16')](handleError(_0x37ede1,null));};exports[_0x82bd('0x4e')]=function(_0x513e1d,_0x47d136){return respondWithRpcPromise(_0x82bd('0x4d'),_0x513e1d[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x513e1d[_0x82bd('0x1b')]['id']))['then'](respondWithResult(_0x47d136,null))[_0x82bd('0x16')](handleError(_0x47d136,null));};exports['whatsappQueues']=function(_0x1a16c1,_0x6ff77c){return respondWithRpcPromise('WhatsappQueues',_0x1a16c1[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](respondWithResult(_0x6ff77c,null))[_0x82bd('0x16')](handleError(_0x6ff77c,null));};exports[_0x82bd('0x4f')]=function(_0x5a5d66,_0x1b5b39){return respondWithRpcPromise(_0x82bd('0x50'),_0x5a5d66[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x5a5d66[_0x82bd('0x1b')]['id']))[_0x82bd('0x15')](respondWithResult(_0x1b5b39,null))[_0x82bd('0x16')](handleError(_0x1b5b39,null));};exports[_0x82bd('0x51')]=function(_0x1384b0,_0x544f10){return respondWithRpcPromise(_0x82bd('0x52'),_0x1384b0['query'],routingClient)['then'](respondWithResult(_0x544f10,null))[_0x82bd('0x16')](handleError(_0x544f10,null));};exports[_0x82bd('0x53')]=function(_0x529cb2,_0x2d2a7e){return respondWithRpcPromise('FaxQueues',_0x529cb2[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x529cb2['params']['id']))[_0x82bd('0x15')](respondWithResult(_0x2d2a7e,null))[_0x82bd('0x16')](handleError(_0x2d2a7e,null));};exports['faxAccounts']=function(_0x505032,_0x5bd3ae){return respondWithRpcPromise(_0x82bd('0x54'),_0x505032[_0x82bd('0x1a')])['then'](respondWithResult(_0x5bd3ae,null))[_0x82bd('0x16')](handleError(_0x5bd3ae,null));};exports[_0x82bd('0x55')]=function(_0x52b73f,_0x5591af){return respondWithRpcPromise(_0x82bd('0x56'),_0x52b73f['query'],routingClient)['then'](respondWithResult(_0x5591af,null))[_0x82bd('0x16')](handleError(_0x5591af,null));};exports[_0x82bd('0x57')]=function(_0x988094,_0x3d1f0d){return respondWithRpcPromise(_0x82bd('0x58'),_0x988094['query'],routingClient)[_0x82bd('0x15')](respondWithResult(_0x3d1f0d,null))['catch'](handleError(_0x3d1f0d,null));};exports[_0x82bd('0x59')]=function(_0x5e25c3,_0x2fbf08){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5e25c3['query'],routingClient)[_0x82bd('0x15')](respondWithResult(_0x2fbf08,null))[_0x82bd('0x16')](handleError(_0x2fbf08,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x282263,_0x15a849){return respondWithRpcPromise(_0x82bd('0x5a'),_0x282263['query'],routingClient)['then'](function(_0x197368){if(_0x282263[_0x82bd('0x1a')]['type']!==undefined){var _0x222f9d=_(_0x197368[_0x82bd('0x12')])['filter']([_0x282263[_0x82bd('0x1a')][_0x82bd('0x5b')],_0x282263[_0x82bd('0x1b')]['id']])[_0x82bd('0x5c')](_0x82bd('0x5d'))[_0x82bd('0x5e')]()['value']();return _0x197368[_0x82bd('0x12')][_0x82bd('0x5f')](function(_0x12bc87){return _0x222f9d['indexOf'](_0x12bc87[_0x82bd('0x5d')])>-0x1;});}else{return _0x197368['rows'][_0x82bd('0x5f')](function(_0x2d9bc0){return _0x2d9bc0[_0x82bd('0x5d')]===parseInt(_0x282263[_0x82bd('0x1b')]['id']);});}})[_0x82bd('0x15')](respondWithResult(_0x15a849,null))['catch'](handleError(_0x15a849,null));};exports[_0x82bd('0x60')]=function(_0x39b9d5,_0x54e547){return respondWithRpcPromise(_0x82bd('0x61'),_0x39b9d5[_0x82bd('0x1a')],routingClient)['then'](respondWithResult(_0x54e547,null))[_0x82bd('0x16')](handleError(_0x54e547,null));};exports[_0x82bd('0x62')]=function(_0x42d4c9,_0x55fe38){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x42d4c9[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](respondWithResult(_0x55fe38,null))[_0x82bd('0x16')](handleError(_0x55fe38,null));};exports['faxQueuesWaitingInteractions']=function(_0x465979,_0x4721c3){return respondWithRpcPromise(_0x82bd('0x63'),_0x465979['query'],routingClient)['then'](respondWithResult(_0x4721c3,null))['catch'](handleError(_0x4721c3,null));};exports['queueNotify']=function(_0x437463){return function(_0x45bbf7,_0x4b5bf4){var _0x35d111,_0x546106;var _0x1da93f=_['capitalize'](_0x437463);var _0x43d8a2=_0x437463===_0x82bd('0x64')?_0x82bd('0x65'):'Account';return db[_0x1da93f+_0x82bd('0x66')][_0x82bd('0x67')]({'raw':!![],'where':{'id':_0x45bbf7[_0x82bd('0x1b')]['id']}})[_0x82bd('0x15')](function(_0xbe937d){if(_['isNil'](_0xbe937d)){throw new Error(_0x1da93f+_0x82bd('0x68'));}_0x35d111=_0xbe937d;return db[_0x1da93f+_0x82bd('0x69')][_0x82bd('0x67')]({'where':{'id':_0x45bbf7['body']['messageId']},'include':[{'model':db[_0x1da93f+'Interaction'],'as':_0x82bd('0x6a')},{'model':db[_0x1da93f+_0x43d8a2],'as':_0x82bd('0x6b')}]});})[_0x82bd('0x15')](function(_0x1a7f98){if(_[_0x82bd('0x11')](_0x1a7f98)){throw new Error(_0x1da93f+'\x20Message\x20not\x20found');}_0x546106=_0x1a7f98;return _0x1a7f98['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5a8e7f={'uniqueid':_0x437463+'.'+_0x546106['id']+'.'+_0x546106[_0x82bd('0x6a')]['id'],'FromUserId':_0x45bbf7[_0x82bd('0x30')]['id'],'type':_0x82bd('0x6c')};_0x5a8e7f[_0x1da93f+_0x82bd('0x6d')]=_0x546106['id'];_0x5a8e7f[_0x1da93f+_0x82bd('0x6e')]=_0x546106[_0x82bd('0x6a')]['id'];_0x5a8e7f[_0x82bd('0x6f')+_0x1da93f+_0x43d8a2+'Id']=_0x546106['Account']['id'];_0x5a8e7f['To'+_0x1da93f+_0x82bd('0x70')]=_0x35d111['id'];return db[_0x1da93f+_0x82bd('0x71')][_0x82bd('0x72')](_0x5a8e7f);})[_0x82bd('0x15')](function(){return respondWithRpcPromise(_0x82bd('0x73'),{'channel':_0x437463,'interaction':_0x546106[_0x82bd('0x6a')],'message':_0x546106,'account':_0x546106[_0x82bd('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x82bd('0x6c'),'appdata':_0x35d111[_0x82bd('0xf')]+','+(_0x546106[_0x82bd('0x6b')][_0x82bd('0x74')]||0x12c),'interval':_0x82bd('0x75')}]},routingClient);})[_0x82bd('0x15')](respondWithResult(_0x4b5bf4,null))['catch'](handleError(_0x4b5bf4,null));};};exports[_0x82bd('0x76')]=function(_0x3d14c7,_0x57c71c){var _0x588d7f,_0x5ca4b5;if(_['isNil'](_0x3d14c7[_0x82bd('0x2e')][_0x82bd('0x77')])){throw new Error(_0x82bd('0x78'));}var _0x2eda47=_0x3d14c7[_0x82bd('0x2e')][_0x82bd('0x77')];var _0x17f2aa=_[_0x82bd('0x79')](_0x2eda47);var _0x534fee=_0x2eda47===_0x82bd('0x64')?'Website':_0x82bd('0x6b');return db[_0x82bd('0x7a')][_0x82bd('0x67')]({'raw':!![],'where':{'id':_0x3d14c7[_0x82bd('0x1b')]['id'],'role':'agent'}})[_0x82bd('0x15')](function(_0x2c92d8){if(_[_0x82bd('0x11')](_0x2c92d8)){throw new Error(_0x82bd('0x7b'));}_0x588d7f=_0x2c92d8;return db[_0x17f2aa+'Message'][_0x82bd('0x67')]({'where':{'id':_0x3d14c7[_0x82bd('0x2e')]['messageId']},'include':[{'model':db[_0x17f2aa+'Interaction'],'as':'Interaction'},{'model':db[_0x17f2aa+_0x534fee],'as':_0x82bd('0x6b')}]});})[_0x82bd('0x15')](function(_0x291587){if(_[_0x82bd('0x11')](_0x291587)){throw new Error(_0x17f2aa+_0x82bd('0x7c'));}_0x5ca4b5=_0x291587;return _0x291587[_0x82bd('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x82bd('0x15')](function(){var _0x8f45e2={'uniqueid':_0x2eda47+'.'+_0x5ca4b5['id']+'.'+_0x5ca4b5[_0x82bd('0x6a')]['id'],'FromUserId':_0x3d14c7[_0x82bd('0x30')]['id'],'type':_0x82bd('0x6c'),'ToUserId':_0x588d7f['id']};_0x8f45e2[_0x17f2aa+_0x82bd('0x6d')]=_0x5ca4b5['id'];_0x8f45e2[_0x17f2aa+_0x82bd('0x6e')]=_0x5ca4b5[_0x82bd('0x6a')]['id'];_0x8f45e2[_0x82bd('0x6f')+_0x17f2aa+_0x534fee+'Id']=_0x5ca4b5[_0x82bd('0x6b')]['id'];return db[_0x17f2aa+_0x82bd('0x71')][_0x82bd('0x72')](_0x8f45e2);})[_0x82bd('0x15')](function(){return respondWithRpcPromise(_0x82bd('0x73'),{'channel':_0x2eda47,'interaction':_0x5ca4b5[_0x82bd('0x6a')],'message':_0x5ca4b5,'account':_0x5ca4b5['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x588d7f[_0x82bd('0xf')]+','+(_0x5ca4b5[_0x82bd('0x6b')][_0x82bd('0x7e')]||0x12c),'interval':_0x82bd('0x75')}]},routingClient);})['then'](respondWithResult(_0x57c71c,null))['catch'](handleError(_0x57c71c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 748b775..1212f61 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 _0x7cfe=['run','post','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./schedule.controller','get','index','/:id','isAuthenticated','show'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x7cfe,0x180));var _0xe7cf=function(_0x3616d9,_0x3afc41){_0x3616d9=_0x3616d9-0x0;var _0x3ab121=_0x7cfe[_0x3616d9];return _0x3ab121;};'use strict';var multer=require(_0xe7cf('0x0'));var util=require('util');var path=require(_0xe7cf('0x1'));var timeout=require(_0xe7cf('0x2'));var express=require(_0xe7cf('0x3'));var router=express[_0xe7cf('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe7cf('0x5'));var config=require('../../config/environment');var controller=require(_0xe7cf('0x6'));router[_0xe7cf('0x7')]('/',auth['isAuthenticated'](),controller[_0xe7cf('0x8')]);router[_0xe7cf('0x7')](_0xe7cf('0x9'),auth[_0xe7cf('0xa')](),controller[_0xe7cf('0xb')]);router[_0xe7cf('0x7')]('/:id/run',auth['isAuthenticated'](),controller[_0xe7cf('0xc')]);router[_0xe7cf('0xd')]('/',auth[_0xe7cf('0xa')](),controller['create']);router[_0xe7cf('0xe')](_0xe7cf('0x9'),auth[_0xe7cf('0xa')](),controller['update']);router[_0xe7cf('0xf')](_0xe7cf('0x9'),auth['isAuthenticated'](),controller[_0xe7cf('0x10')]);module[_0xe7cf('0x11')]=router; \ No newline at end of file +var _0x58aa=['path','connect-timeout','express','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','put','delete','destroy','multer','util'];(function(_0x5c28d4,_0x7c5ece){var _0x5779a2=function(_0x3dd745){while(--_0x3dd745){_0x5c28d4['push'](_0x5c28d4['shift']());}};_0x5779a2(++_0x7c5ece);}(_0x58aa,0x9e));var _0xa58a=function(_0x116611,_0x38fe88){_0x116611=_0x116611-0x0;var _0x4336b7=_0x58aa[_0x116611];return _0x4336b7;};'use strict';var multer=require(_0xa58a('0x0'));var util=require(_0xa58a('0x1'));var path=require(_0xa58a('0x2'));var timeout=require(_0xa58a('0x3'));var express=require(_0xa58a('0x4'));var router=express['Router']();var fs_extra=require(_0xa58a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa58a('0x6'));var config=require('../../config/environment');var controller=require('./schedule.controller');router['get']('/',auth[_0xa58a('0x7')](),controller[_0xa58a('0x8')]);router[_0xa58a('0x9')](_0xa58a('0xa'),auth['isAuthenticated'](),controller[_0xa58a('0xb')]);router[_0xa58a('0x9')]('/:id/run',auth[_0xa58a('0x7')](),controller['run']);router[_0xa58a('0xc')]('/',auth[_0xa58a('0x7')](),controller['create']);router[_0xa58a('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa58a('0xe')](_0xa58a('0xa'),auth[_0xa58a('0x7')](),controller[_0xa58a('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 2fed417..b3f2635 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 _0x4078=['months','weeks','days','hours','minutes','csv','custom','default','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters'];(function(_0x3b7db2,_0x5edd58){var _0x3a819e=function(_0x207221){while(--_0x207221){_0x3b7db2['push'](_0x3b7db2['shift']());}};_0x3a819e(++_0x5edd58);}(_0x4078,0x1b1));var _0x8407=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x4078[_0x34325b];return _0x3da348;};'use strict';var Sequelize=require(_0x8407('0x0'));module[_0x8407('0x1')]={'name':{'type':Sequelize[_0x8407('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8407('0x2')]},'active':{'type':Sequelize[_0x8407('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8407('0x2')],'allowNull':![],'defaultValue':_0x8407('0x4')},'startAt':{'type':Sequelize[_0x8407('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x8407('0x6')](_0x8407('0x7'),_0x8407('0x8'),_0x8407('0x9'),_0x8407('0xa'),_0x8407('0xb'),_0x8407('0xc'),_0x8407('0xd')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x8407('0xe'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x8407('0xe')},'type':{'type':Sequelize[_0x8407('0x6')](_0x8407('0xf'),_0x8407('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x8407('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x8407('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x8407('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1462=['TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','weeks','days','hours','minutes','pdf','xlsx','csv','custom','default'];(function(_0x38c29b,_0x4e22ed){var _0x106295=function(_0x4eeb42){while(--_0x4eeb42){_0x38c29b['push'](_0x38c29b['shift']());}};_0x106295(++_0x4e22ed);}(_0x1462,0x131));var _0x2146=function(_0xb957fb,_0x26e116){_0xb957fb=_0xb957fb-0x0;var _0x4d6b5d=_0x1462[_0xb957fb];return _0x4d6b5d;};'use strict';var Sequelize=require(_0x2146('0x0'));module[_0x2146('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x2146('0x2')]},'active':{'type':Sequelize[_0x2146('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2146('0x4')},'startAt':{'type':Sequelize[_0x2146('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x2146('0x6')](_0x2146('0x7'),_0x2146('0x8'),'months',_0x2146('0x9'),_0x2146('0xa'),_0x2146('0xb'),_0x2146('0xc')),'allowNull':![],'defaultValue':_0x2146('0xa')},'output':{'type':Sequelize[_0x2146('0x6')]('csv',_0x2146('0xd'),_0x2146('0xe')),'allowNull':![],'defaultValue':_0x2146('0xf')},'type':{'type':Sequelize[_0x2146('0x6')](_0x2146('0x10'),_0x2146('0x11')),'allowNull':![],'defaultValue':_0x2146('0x10')},'sendMail':{'type':Sequelize[_0x2146('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x2146('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x2146('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x2146('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index c387556..2552ed1 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 _0xe559=['Scheduler','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','rows','catch','show','params','keys','includeAll','options','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','body','run','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','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','update','then','destroy'];(function(_0x32f850,_0x6ba444){var _0x38e424=function(_0x14e281){while(--_0x14e281){_0x32f850['push'](_0x32f850['shift']());}};_0x38e424(++_0x6ba444);}(_0xe559,0x7e));var _0x9e55=function(_0x59ec22,_0x29ddd0){_0x59ec22=_0x59ec22-0x0;var _0x14f69e=_0xe559[_0x59ec22];return _0x14f69e;};'use strict';var emlformat=require(_0x9e55('0x0'));var rimraf=require(_0x9e55('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e55('0x2'));var rp=require(_0x9e55('0x3'));var moment=require('moment');var BPromise=require(_0x9e55('0x4'));var Mustache=require(_0x9e55('0x5'));var util=require(_0x9e55('0x6'));var path=require(_0x9e55('0x7'));var sox=require(_0x9e55('0x8'));var csv=require(_0x9e55('0x9'));var ejs=require(_0x9e55('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e55('0xb'));var squel=require(_0x9e55('0xc'));var crypto=require(_0x9e55('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9e55('0xe'));var toCsv=require(_0x9e55('0x9'));var querystring=require(_0x9e55('0xf'));var Papa=require('papaparse');var Redis=require(_0x9e55('0x10'));var authService=require(_0x9e55('0x11'));var qs=require(_0x9e55('0x12'));var as=require(_0x9e55('0x13'));var hardwareService=require(_0x9e55('0x14'));var logger=require(_0x9e55('0x15'))(_0x9e55('0x16'));var utils=require('../../config/utils');var config=require(_0x9e55('0x17'));var licenseUtil=require(_0x9e55('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c2206,_0x3efb19){_0x3efb19=_0x3efb19||0xcc;return function(_0x25fdc6){if(_0x25fdc6){return _0x5c2206[_0x9e55('0x19')](_0x3efb19);}return _0x5c2206[_0x9e55('0x1a')](_0x3efb19)[_0x9e55('0x1b')]();};}function respondWithResult(_0x4c2b75,_0x304a3c){_0x304a3c=_0x304a3c||0xc8;return function(_0x94018e){if(_0x94018e){return _0x4c2b75['status'](_0x304a3c)[_0x9e55('0x1c')](_0x94018e);}};}function respondWithFilteredResult(_0x36aab0,_0x247bfd){return function(_0x47ef82){if(_0x47ef82){var _0x3e1545=typeof _0x247bfd[_0x9e55('0x1d')]===_0x9e55('0x1e')&&typeof _0x247bfd['limit']===_0x9e55('0x1e');var _0x4386b3=_0x47ef82[_0x9e55('0x1f')];var _0x13521c=_0x3e1545?0x0:_0x247bfd[_0x9e55('0x1d')];var _0x655c5a=_0x3e1545?_0x47ef82[_0x9e55('0x1f')]:_0x247bfd[_0x9e55('0x1d')]+_0x247bfd[_0x9e55('0x20')];var _0x301363;if(_0x655c5a>=_0x4386b3){_0x655c5a=_0x4386b3;_0x301363=0xc8;}else{_0x301363=0xce;}_0x36aab0['status'](_0x301363);return _0x36aab0[_0x9e55('0x21')](_0x9e55('0x22'),_0x13521c+'-'+_0x655c5a+'/'+_0x4386b3)['json'](_0x47ef82);}return null;};}function patchUpdates(_0x5aa60e){return function(_0x3e234b){try{jsonpatch['apply'](_0x3e234b,_0x5aa60e,!![]);}catch(_0x37e551){return BPromise['reject'](_0x37e551);}return _0x3e234b['save']();};}function saveUpdates(_0x3d8a3c,_0x1b28db){return function(_0x387f4f){if(_0x387f4f){return _0x387f4f[_0x9e55('0x23')](_0x3d8a3c)[_0x9e55('0x24')](function(_0x37543e){return _0x37543e;});}return null;};}function removeEntity(_0x48e96b,_0xe85ab1){return function(_0x109817){if(_0x109817){return _0x109817[_0x9e55('0x25')]()[_0x9e55('0x24')](function(){var _0x515b1a=_0x109817['get']({'plain':!![]});var _0x1a4aac=_0x9e55('0x26');return db[_0x9e55('0x27')][_0x9e55('0x25')]({'where':{'type':_0x1a4aac,'resourceId':_0x515b1a['id']}})[_0x9e55('0x24')](function(){return _0x109817;});})['then'](function(){_0x48e96b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50f4a1,_0x1ce0e9){return function(_0x3a5d62){if(!_0x3a5d62){_0x50f4a1[_0x9e55('0x19')](0x194);}return _0x3a5d62;};}function handleError(_0x2b55d0,_0x57e4bd){_0x57e4bd=_0x57e4bd||0x1f4;return function(_0x507d00){logger[_0x9e55('0x28')](_0x507d00[_0x9e55('0x29')]);if(_0x507d00[_0x9e55('0x2a')]){delete _0x507d00[_0x9e55('0x2a')];}_0x2b55d0[_0x9e55('0x1a')](_0x57e4bd)[_0x9e55('0x2b')](_0x507d00);};}exports[_0x9e55('0x2c')]=function(_0x288421,_0x231514){var _0xb1fc46={},_0x518304={},_0x3def17={'count':0x0,'rows':[]};var _0x5bb5b0=_[_0x9e55('0x2d')](db[_0x9e55('0x2e')][_0x9e55('0x2f')],function(_0x12354e){return{'name':_0x12354e['fieldName'],'type':_0x12354e[_0x9e55('0x30')][_0x9e55('0x31')]};});_0x518304[_0x9e55('0x32')]=_[_0x9e55('0x2d')](_0x5bb5b0,_0x9e55('0x2a'));_0x518304[_0x9e55('0x33')]=_['keys'](_0x288421['query']);_0x518304[_0x9e55('0x34')]=_[_0x9e55('0x35')](_0x518304[_0x9e55('0x32')],_0x518304[_0x9e55('0x33')]);_0xb1fc46[_0x9e55('0x36')]=_['intersection'](_0x518304['model'],qs['fields'](_0x288421[_0x9e55('0x33')][_0x9e55('0x37')]));_0xb1fc46[_0x9e55('0x36')]=_0xb1fc46['attributes'][_0x9e55('0x38')]?_0xb1fc46[_0x9e55('0x36')]:_0x518304[_0x9e55('0x32')];if(!_0x288421[_0x9e55('0x33')]['hasOwnProperty'](_0x9e55('0x39'))){_0xb1fc46[_0x9e55('0x20')]=qs[_0x9e55('0x20')](_0x288421[_0x9e55('0x33')]['limit']);_0xb1fc46[_0x9e55('0x1d')]=qs['offset'](_0x288421[_0x9e55('0x33')][_0x9e55('0x1d')]);}_0xb1fc46[_0x9e55('0x3a')]=qs[_0x9e55('0x3b')](_0x288421['query']['sort']);_0xb1fc46['where']=qs['filters'](_[_0x9e55('0x3c')](_0x288421[_0x9e55('0x33')],_0x518304['filters']),_0x5bb5b0);if(_0x288421['query'][_0x9e55('0x3d')]){_0xb1fc46[_0x9e55('0x3e')]=_[_0x9e55('0x3f')](_0xb1fc46[_0x9e55('0x3e')],{'$or':_[_0x9e55('0x2d')](_0x5bb5b0,function(_0x56aea4){if(_0x56aea4[_0x9e55('0x30')]!==_0x9e55('0x40')){var _0x182521={};_0x182521[_0x56aea4['name']]={'$like':'%'+_0x288421[_0x9e55('0x33')][_0x9e55('0x3d')]+'%'};return _0x182521;}})});}_0xb1fc46=_[_0x9e55('0x3f')]({},_0xb1fc46,_0x288421['options']);var _0x2b85f3={'where':_0xb1fc46[_0x9e55('0x3e')]};return db[_0x9e55('0x2e')][_0x9e55('0x1f')](_0x2b85f3)[_0x9e55('0x24')](function(_0x1a89d1){_0x3def17['count']=_0x1a89d1;if(_0x288421[_0x9e55('0x33')]['includeAll']){_0xb1fc46[_0x9e55('0x41')]=[{'all':!![]}];}return db[_0x9e55('0x2e')]['findAll'](_0xb1fc46);})[_0x9e55('0x24')](function(_0x26293b){_0x3def17[_0x9e55('0x42')]=_0x26293b;return _0x3def17;})[_0x9e55('0x24')](respondWithFilteredResult(_0x231514,_0xb1fc46))[_0x9e55('0x43')](handleError(_0x231514,null));};exports[_0x9e55('0x44')]=function(_0x1a3879,_0x35e079){var _0xbf328c={'raw':![],'where':{'id':_0x1a3879[_0x9e55('0x45')]['id']}},_0x1bbe3c={};_0x1bbe3c['model']=_[_0x9e55('0x46')](db[_0x9e55('0x2e')][_0x9e55('0x2f')]);_0x1bbe3c['query']=_['keys'](_0x1a3879[_0x9e55('0x33')]);_0x1bbe3c[_0x9e55('0x34')]=_[_0x9e55('0x35')](_0x1bbe3c[_0x9e55('0x32')],_0x1bbe3c[_0x9e55('0x33')]);_0xbf328c[_0x9e55('0x36')]=_[_0x9e55('0x35')](_0x1bbe3c[_0x9e55('0x32')],qs[_0x9e55('0x37')](_0x1a3879['query'][_0x9e55('0x37')]));_0xbf328c[_0x9e55('0x36')]=_0xbf328c[_0x9e55('0x36')][_0x9e55('0x38')]?_0xbf328c[_0x9e55('0x36')]:_0x1bbe3c[_0x9e55('0x32')];if(_0x1a3879[_0x9e55('0x33')][_0x9e55('0x47')]){_0xbf328c['include']=[{'all':!![]}];}_0xbf328c=_[_0x9e55('0x3f')]({},_0xbf328c,_0x1a3879[_0x9e55('0x48')]);return db[_0x9e55('0x2e')]['find'](_0xbf328c)[_0x9e55('0x24')](handleEntityNotFound(_0x35e079,null))['then'](respondWithResult(_0x35e079,null))[_0x9e55('0x43')](handleError(_0x35e079,null));};exports[_0x9e55('0x49')]=function(_0x163034,_0x31dbf8){return db[_0x9e55('0x2e')]['create'](_0x163034['body'],{})[_0x9e55('0x24')](function(_0x7b164b){var _0x5e9bdb=_0x163034['user'][_0x9e55('0x4a')]({'plain':!![]});if(!_0x5e9bdb)throw new Error(_0x9e55('0x4b'));if(_0x5e9bdb[_0x9e55('0x4c')]===_0x9e55('0x4d')){var _0x3e0bea=_0x7b164b['get']({'plain':!![]});var _0x274170='Scheduler';return db['UserProfileSection'][_0x9e55('0x4e')]({'where':{'name':_0x274170,'userProfileId':_0x5e9bdb[_0x9e55('0x4f')]},'raw':!![]})[_0x9e55('0x24')](function(_0x288fb6){if(_0x288fb6&&_0x288fb6['autoAssociation']===0x0){return db[_0x9e55('0x27')][_0x9e55('0x49')]({'name':_0x3e0bea['name'],'resourceId':_0x3e0bea['id'],'type':_0x288fb6['name'],'sectionId':_0x288fb6['id']},{})[_0x9e55('0x24')](function(){return _0x7b164b;});}else{return _0x7b164b;}})[_0x9e55('0x43')](function(_0x179783){logger[_0x9e55('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x179783);throw _0x179783;});}return _0x7b164b;})[_0x9e55('0x24')](respondWithResult(_0x31dbf8,0xc9))['catch'](handleError(_0x31dbf8,null));};exports['update']=function(_0x5495fa,_0x510596){if(_0x5495fa[_0x9e55('0x50')]['id']){delete _0x5495fa[_0x9e55('0x50')]['id'];}return db[_0x9e55('0x2e')][_0x9e55('0x4e')]({'where':{'id':_0x5495fa[_0x9e55('0x45')]['id']}})[_0x9e55('0x24')](handleEntityNotFound(_0x510596,null))['then'](saveUpdates(_0x5495fa[_0x9e55('0x50')],null))[_0x9e55('0x24')](respondWithResult(_0x510596,null))[_0x9e55('0x43')](handleError(_0x510596,null));};exports[_0x9e55('0x25')]=function(_0x2700a9,_0x1afce1){return db['Schedule']['find']({'where':{'id':_0x2700a9[_0x9e55('0x45')]['id']}})[_0x9e55('0x24')](handleEntityNotFound(_0x1afce1,null))[_0x9e55('0x24')](removeEntity(_0x1afce1,null))['catch'](handleError(_0x1afce1,null));};exports[_0x9e55('0x51')]=function(_0x16bc7d,_0x504403,_0x412866){var _0x2c0c1c=require('../../config/schedule');return db[_0x9e55('0x2e')]['find']({'where':{'id':_0x16bc7d[_0x9e55('0x45')]['id']},'raw':!![]})[_0x9e55('0x24')](handleEntityNotFound(_0x504403,null))[_0x9e55('0x24')](function(){_0x2c0c1c[_0x9e55('0x51')](_0x16bc7d[_0x9e55('0x45')]['id']);})[_0x9e55('0x24')](respondWithStatusCode(_0x504403,null))[_0x9e55('0x43')](handleError(_0x504403,null));}; \ No newline at end of file +var _0x4ac3=['Scheduler','UserProfileResource','end','sendStatus','error','stack','name','send','index','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Schedule','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','catch','run','../../config/schedule','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get'];(function(_0x309293,_0x1c1e8c){var _0x359ab3=function(_0x246887){while(--_0x246887){_0x309293['push'](_0x309293['shift']());}};_0x359ab3(++_0x1c1e8c);}(_0x4ac3,0x18d));var _0x34ac=function(_0x3bd079,_0x2a0dbb){_0x3bd079=_0x3bd079-0x0;var _0x55383d=_0x4ac3[_0x3bd079];return _0x55383d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x34ac('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x34ac('0x1'));var rp=require('request-promise');var moment=require(_0x34ac('0x2'));var BPromise=require(_0x34ac('0x3'));var Mustache=require(_0x34ac('0x4'));var util=require(_0x34ac('0x5'));var path=require(_0x34ac('0x6'));var sox=require('sox');var csv=require(_0x34ac('0x7'));var ejs=require(_0x34ac('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34ac('0x9'));var squel=require('squel');var crypto=require(_0x34ac('0xa'));var jsforce=require(_0x34ac('0xb'));var deskjs=require(_0x34ac('0xc'));var toCsv=require(_0x34ac('0x7'));var querystring=require(_0x34ac('0xd'));var Papa=require(_0x34ac('0xe'));var Redis=require(_0x34ac('0xf'));var authService=require(_0x34ac('0x10'));var qs=require(_0x34ac('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34ac('0x12'));var logger=require('../../config/logger')(_0x34ac('0x13'));var utils=require(_0x34ac('0x14'));var config=require(_0x34ac('0x15'));var licenseUtil=require(_0x34ac('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30791d,_0x375314){_0x375314=_0x375314||0xcc;return function(_0x108c1b){if(_0x108c1b){return _0x30791d['sendStatus'](_0x375314);}return _0x30791d[_0x34ac('0x17')](_0x375314)['end']();};}function respondWithResult(_0x20c9c9,_0x2aad74){_0x2aad74=_0x2aad74||0xc8;return function(_0x48f8f8){if(_0x48f8f8){return _0x20c9c9[_0x34ac('0x17')](_0x2aad74)[_0x34ac('0x18')](_0x48f8f8);}};}function respondWithFilteredResult(_0x5346c2,_0x19a9cb){return function(_0x3f64f1){if(_0x3f64f1){var _0x17ba62=typeof _0x19a9cb['offset']===_0x34ac('0x19')&&typeof _0x19a9cb['limit']===_0x34ac('0x19');var _0x19ef76=_0x3f64f1['count'];var _0x59cc46=_0x17ba62?0x0:_0x19a9cb['offset'];var _0x21b740=_0x17ba62?_0x3f64f1[_0x34ac('0x1a')]:_0x19a9cb[_0x34ac('0x1b')]+_0x19a9cb[_0x34ac('0x1c')];var _0x5c3180;if(_0x21b740>=_0x19ef76){_0x21b740=_0x19ef76;_0x5c3180=0xc8;}else{_0x5c3180=0xce;}_0x5346c2[_0x34ac('0x17')](_0x5c3180);return _0x5346c2[_0x34ac('0x1d')](_0x34ac('0x1e'),_0x59cc46+'-'+_0x21b740+'/'+_0x19ef76)[_0x34ac('0x18')](_0x3f64f1);}return null;};}function patchUpdates(_0x36c3fb){return function(_0x5128bc){try{jsonpatch[_0x34ac('0x1f')](_0x5128bc,_0x36c3fb,!![]);}catch(_0x49ee71){return BPromise[_0x34ac('0x20')](_0x49ee71);}return _0x5128bc[_0x34ac('0x21')]();};}function saveUpdates(_0xdfd48e,_0x53b9ba){return function(_0x150674){if(_0x150674){return _0x150674[_0x34ac('0x22')](_0xdfd48e)[_0x34ac('0x23')](function(_0x108aff){return _0x108aff;});}return null;};}function removeEntity(_0x54987b,_0xb9c2c3){return function(_0x8b459a){if(_0x8b459a){return _0x8b459a[_0x34ac('0x24')]()[_0x34ac('0x23')](function(){var _0x3d6a64=_0x8b459a[_0x34ac('0x25')]({'plain':!![]});var _0x19defc=_0x34ac('0x26');return db[_0x34ac('0x27')][_0x34ac('0x24')]({'where':{'type':_0x19defc,'resourceId':_0x3d6a64['id']}})[_0x34ac('0x23')](function(){return _0x8b459a;});})['then'](function(){_0x54987b['status'](0xcc)[_0x34ac('0x28')]();});}};}function handleEntityNotFound(_0x2bc723,_0x6c4c5e){return function(_0x5aef4e){if(!_0x5aef4e){_0x2bc723[_0x34ac('0x29')](0x194);}return _0x5aef4e;};}function handleError(_0x5667cb,_0x102dba){_0x102dba=_0x102dba||0x1f4;return function(_0x17aa13){logger[_0x34ac('0x2a')](_0x17aa13[_0x34ac('0x2b')]);if(_0x17aa13['name']){delete _0x17aa13[_0x34ac('0x2c')];}_0x5667cb[_0x34ac('0x17')](_0x102dba)[_0x34ac('0x2d')](_0x17aa13);};}exports[_0x34ac('0x2e')]=function(_0xcd722c,_0xb6ab90){var _0x479f6a={},_0x5631b9={},_0x299789={'count':0x0,'rows':[]};var _0x2a18ed=_['map'](db['Schedule']['rawAttributes'],function(_0x340293){return{'name':_0x340293[_0x34ac('0x2f')],'type':_0x340293[_0x34ac('0x30')][_0x34ac('0x31')]};});_0x5631b9[_0x34ac('0x32')]=_[_0x34ac('0x33')](_0x2a18ed,_0x34ac('0x2c'));_0x5631b9['query']=_[_0x34ac('0x34')](_0xcd722c[_0x34ac('0x35')]);_0x5631b9[_0x34ac('0x36')]=_[_0x34ac('0x37')](_0x5631b9[_0x34ac('0x32')],_0x5631b9[_0x34ac('0x35')]);_0x479f6a['attributes']=_[_0x34ac('0x37')](_0x5631b9[_0x34ac('0x32')],qs[_0x34ac('0x38')](_0xcd722c['query'][_0x34ac('0x38')]));_0x479f6a[_0x34ac('0x39')]=_0x479f6a['attributes'][_0x34ac('0x3a')]?_0x479f6a['attributes']:_0x5631b9['model'];if(!_0xcd722c[_0x34ac('0x35')][_0x34ac('0x3b')](_0x34ac('0x3c'))){_0x479f6a[_0x34ac('0x1c')]=qs[_0x34ac('0x1c')](_0xcd722c[_0x34ac('0x35')]['limit']);_0x479f6a[_0x34ac('0x1b')]=qs['offset'](_0xcd722c[_0x34ac('0x35')]['offset']);}_0x479f6a[_0x34ac('0x3d')]=qs[_0x34ac('0x3e')](_0xcd722c[_0x34ac('0x35')][_0x34ac('0x3e')]);_0x479f6a[_0x34ac('0x3f')]=qs[_0x34ac('0x36')](_['pick'](_0xcd722c[_0x34ac('0x35')],_0x5631b9[_0x34ac('0x36')]),_0x2a18ed);if(_0xcd722c[_0x34ac('0x35')][_0x34ac('0x40')]){_0x479f6a[_0x34ac('0x3f')]=_[_0x34ac('0x41')](_0x479f6a[_0x34ac('0x3f')],{'$or':_[_0x34ac('0x33')](_0x2a18ed,function(_0x4545ce){if(_0x4545ce[_0x34ac('0x30')]!==_0x34ac('0x42')){var _0x312c7b={};_0x312c7b[_0x4545ce[_0x34ac('0x2c')]]={'$like':'%'+_0xcd722c[_0x34ac('0x35')][_0x34ac('0x40')]+'%'};return _0x312c7b;}})});}_0x479f6a=_[_0x34ac('0x41')]({},_0x479f6a,_0xcd722c[_0x34ac('0x43')]);var _0x38f1f6={'where':_0x479f6a[_0x34ac('0x3f')]};return db[_0x34ac('0x44')][_0x34ac('0x1a')](_0x38f1f6)[_0x34ac('0x23')](function(_0x1f2852){_0x299789[_0x34ac('0x1a')]=_0x1f2852;if(_0xcd722c[_0x34ac('0x35')][_0x34ac('0x45')]){_0x479f6a[_0x34ac('0x46')]=[{'all':!![]}];}return db[_0x34ac('0x44')][_0x34ac('0x47')](_0x479f6a);})['then'](function(_0x29b760){_0x299789[_0x34ac('0x48')]=_0x29b760;return _0x299789;})['then'](respondWithFilteredResult(_0xb6ab90,_0x479f6a))['catch'](handleError(_0xb6ab90,null));};exports[_0x34ac('0x49')]=function(_0x543f63,_0x4355b8){var _0x4308f1={'raw':![],'where':{'id':_0x543f63['params']['id']}},_0x11e9bb={};_0x11e9bb[_0x34ac('0x32')]=_[_0x34ac('0x34')](db[_0x34ac('0x44')][_0x34ac('0x4a')]);_0x11e9bb[_0x34ac('0x35')]=_['keys'](_0x543f63[_0x34ac('0x35')]);_0x11e9bb[_0x34ac('0x36')]=_[_0x34ac('0x37')](_0x11e9bb[_0x34ac('0x32')],_0x11e9bb[_0x34ac('0x35')]);_0x4308f1['attributes']=_[_0x34ac('0x37')](_0x11e9bb[_0x34ac('0x32')],qs[_0x34ac('0x38')](_0x543f63[_0x34ac('0x35')][_0x34ac('0x38')]));_0x4308f1['attributes']=_0x4308f1['attributes'][_0x34ac('0x3a')]?_0x4308f1['attributes']:_0x11e9bb['model'];if(_0x543f63[_0x34ac('0x35')]['includeAll']){_0x4308f1[_0x34ac('0x46')]=[{'all':!![]}];}_0x4308f1=_[_0x34ac('0x41')]({},_0x4308f1,_0x543f63[_0x34ac('0x43')]);return db[_0x34ac('0x44')][_0x34ac('0x4b')](_0x4308f1)[_0x34ac('0x23')](handleEntityNotFound(_0x4355b8,null))['then'](respondWithResult(_0x4355b8,null))['catch'](handleError(_0x4355b8,null));};exports[_0x34ac('0x4c')]=function(_0x372b5f,_0x5b3f5f){return db['Schedule'][_0x34ac('0x4c')](_0x372b5f[_0x34ac('0x4d')],{})[_0x34ac('0x23')](function(_0x159b95){var _0x14fcd4=_0x372b5f['user']['get']({'plain':!![]});if(!_0x14fcd4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14fcd4[_0x34ac('0x4e')]===_0x34ac('0x4f')){var _0x83d56b=_0x159b95[_0x34ac('0x25')]({'plain':!![]});var _0x9e8d0c=_0x34ac('0x26');return db[_0x34ac('0x50')][_0x34ac('0x4b')]({'where':{'name':_0x9e8d0c,'userProfileId':_0x14fcd4[_0x34ac('0x51')]},'raw':!![]})[_0x34ac('0x23')](function(_0x38cfe7){if(_0x38cfe7&&_0x38cfe7[_0x34ac('0x52')]===0x0){return db[_0x34ac('0x27')][_0x34ac('0x4c')]({'name':_0x83d56b[_0x34ac('0x2c')],'resourceId':_0x83d56b['id'],'type':_0x38cfe7[_0x34ac('0x2c')],'sectionId':_0x38cfe7['id']},{})[_0x34ac('0x23')](function(){return _0x159b95;});}else{return _0x159b95;}})[_0x34ac('0x53')](function(_0x2c64c4){logger[_0x34ac('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c64c4);throw _0x2c64c4;});}return _0x159b95;})['then'](respondWithResult(_0x5b3f5f,0xc9))[_0x34ac('0x53')](handleError(_0x5b3f5f,null));};exports[_0x34ac('0x22')]=function(_0x2669cc,_0x3e18d4){if(_0x2669cc['body']['id']){delete _0x2669cc[_0x34ac('0x4d')]['id'];}return db[_0x34ac('0x44')][_0x34ac('0x4b')]({'where':{'id':_0x2669cc['params']['id']}})[_0x34ac('0x23')](handleEntityNotFound(_0x3e18d4,null))['then'](saveUpdates(_0x2669cc[_0x34ac('0x4d')],null))[_0x34ac('0x23')](respondWithResult(_0x3e18d4,null))[_0x34ac('0x53')](handleError(_0x3e18d4,null));};exports[_0x34ac('0x24')]=function(_0x5912f7,_0x2e21d3){return db[_0x34ac('0x44')][_0x34ac('0x4b')]({'where':{'id':_0x5912f7['params']['id']}})[_0x34ac('0x23')](handleEntityNotFound(_0x2e21d3,null))[_0x34ac('0x23')](removeEntity(_0x2e21d3,null))['catch'](handleError(_0x2e21d3,null));};exports[_0x34ac('0x54')]=function(_0x456241,_0x54586a,_0x39aaa9){var _0x3c97a4=require(_0x34ac('0x55'));return db[_0x34ac('0x44')][_0x34ac('0x4b')]({'where':{'id':_0x456241[_0x34ac('0x56')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x54586a,null))[_0x34ac('0x23')](function(){_0x3c97a4[_0x34ac('0x54')](_0x456241[_0x34ac('0x56')]['id']);})['then'](respondWithStatusCode(_0x54586a,null))[_0x34ac('0x53')](handleError(_0x54586a,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 57107b8..ebc14c7 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 _0x5a9a=['api','moment','path','rimraf','./schedule.attributes','define','Schedule','tools_schedules','lodash','util','../../config/logger'];(function(_0x512891,_0x46005a){var _0x1c190c=function(_0x42b95b){while(--_0x42b95b){_0x512891['push'](_0x512891['shift']());}};_0x1c190c(++_0x46005a);}(_0x5a9a,0xfa));var _0xa5a9=function(_0x501de3,_0x3883a5){_0x501de3=_0x501de3-0x0;var _0x4d10ea=_0x5a9a[_0x501de3];return _0x4d10ea;};'use strict';var _=require(_0xa5a9('0x0'));var util=require(_0xa5a9('0x1'));var logger=require(_0xa5a9('0x2'))(_0xa5a9('0x3'));var moment=require(_0xa5a9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5a9('0x5'));var rimraf=require(_0xa5a9('0x6'));var config=require('../../config/environment');var attributes=require(_0xa5a9('0x7'));module['exports']=function(_0x432b95,_0x255975){return _0x432b95[_0xa5a9('0x8')](_0xa5a9('0x9'),attributes,{'tableName':_0xa5a9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9ed=['../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0xb9ed,0x13d));var _0xdb9e=function(_0x1a2ceb,_0x4f4563){_0x1a2ceb=_0x1a2ceb-0x0;var _0x3f401c=_0xb9ed[_0x1a2ceb];return _0x3f401c;};'use strict';var _=require(_0xdb9e('0x0'));var util=require(_0xdb9e('0x1'));var logger=require(_0xdb9e('0x2'))(_0xdb9e('0x3'));var moment=require(_0xdb9e('0x4'));var BPromise=require(_0xdb9e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb9e('0x6'));var rimraf=require(_0xdb9e('0x7'));var config=require(_0xdb9e('0x8'));var attributes=require(_0xdb9e('0x9'));module[_0xdb9e('0xa')]=function(_0x3e45cb,_0x552b25){return _0x3e45cb['define'](_0xdb9e('0xb'),attributes,{'tableName':_0xdb9e('0xc'),'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 5dd973c..182b8dc 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 _0xd407=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x14f483,_0xa4f335){var _0x27b0a9=function(_0x50219a){while(--_0x50219a){_0x14f483['push'](_0x14f483['shift']());}};_0x27b0a9(++_0xa4f335);}(_0xd407,0x124));var _0x7d40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd407[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7d40('0x0'));var moment=require(_0x7d40('0x1'));var BPromise=require(_0x7d40('0x2'));var rs=require(_0x7d40('0x3'));var fs=require('fs');var Redis=require(_0x7d40('0x4'));var db=require(_0x7d40('0x5'))['db'];var utils=require(_0x7d40('0x6'));var logger=require(_0x7d40('0x7'))('rpc');var config=require(_0x7d40('0x8'));var jayson=require(_0x7d40('0x9'));var client=jayson[_0x7d40('0xa')][_0x7d40('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a5a6b,_0x66387d,_0x30ee7a){return new BPromise(function(_0x4234b0,_0x4dcdf9){return client[_0x7d40('0xc')](_0x3a5a6b,_0x30ee7a)[_0x7d40('0xd')](function(_0x39f4cf){logger[_0x7d40('0xe')](_0x7d40('0xf'),_0x66387d,_0x7d40('0x10'));logger[_0x7d40('0x11')](_0x7d40('0x12'),_0x66387d,_0x7d40('0x10'),JSON[_0x7d40('0x13')](_0x39f4cf));if(_0x39f4cf[_0x7d40('0x14')]){if(_0x39f4cf['error']['code']===0x1f4){logger[_0x7d40('0x14')](_0x7d40('0xf'),_0x66387d,_0x39f4cf['error'][_0x7d40('0x15')]);return _0x4dcdf9(_0x39f4cf['error'][_0x7d40('0x15')]);}logger[_0x7d40('0x14')](_0x7d40('0xf'),_0x66387d,_0x39f4cf[_0x7d40('0x14')][_0x7d40('0x15')]);return _0x4234b0(_0x39f4cf[_0x7d40('0x14')][_0x7d40('0x15')]);}else{logger[_0x7d40('0xe')]('Schedule,\x20%s,\x20%s',_0x66387d,_0x7d40('0x10'));_0x4234b0(_0x39f4cf['result'][_0x7d40('0x15')]);}})[_0x7d40('0x16')](function(_0x26e728){logger[_0x7d40('0x14')]('Schedule,\x20%s,\x20%s',_0x66387d,_0x26e728);_0x4dcdf9(_0x26e728);});});} \ No newline at end of file +var _0x0285=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','Schedule,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x4b55cb,_0x49791b){var _0x2631df=function(_0x2bf591){while(--_0x2bf591){_0x4b55cb['push'](_0x4b55cb['shift']());}};_0x2631df(++_0x49791b);}(_0x0285,0x98));var _0x5028=function(_0x151ae3,_0x3a9195){_0x151ae3=_0x151ae3-0x0;var _0x564680=_0x0285[_0x151ae3];return _0x564680;};'use strict';var _=require(_0x5028('0x0'));var util=require(_0x5028('0x1'));var moment=require('moment');var BPromise=require(_0x5028('0x2'));var rs=require(_0x5028('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5028('0x4'));var logger=require(_0x5028('0x5'))(_0x5028('0x6'));var config=require(_0x5028('0x7'));var jayson=require(_0x5028('0x8'));var client=jayson[_0x5028('0x9')][_0x5028('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3040ad,_0x2feff4,_0x114ede){return new BPromise(function(_0x5bd7a,_0x11db96){return client[_0x5028('0xb')](_0x3040ad,_0x114ede)[_0x5028('0xc')](function(_0x5dd5bc){logger['info']('Schedule,\x20%s,\x20%s',_0x2feff4,_0x5028('0xd'));logger[_0x5028('0xe')](_0x5028('0xf'),_0x2feff4,_0x5028('0xd'),JSON['stringify'](_0x5dd5bc));if(_0x5dd5bc['error']){if(_0x5dd5bc[_0x5028('0x10')][_0x5028('0x11')]===0x1f4){logger[_0x5028('0x10')]('Schedule,\x20%s,\x20%s',_0x2feff4,_0x5dd5bc[_0x5028('0x10')][_0x5028('0x12')]);return _0x11db96(_0x5dd5bc[_0x5028('0x10')][_0x5028('0x12')]);}logger[_0x5028('0x10')](_0x5028('0x13'),_0x2feff4,_0x5dd5bc['error'][_0x5028('0x12')]);return _0x5bd7a(_0x5dd5bc['error'][_0x5028('0x12')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x2feff4,_0x5028('0xd'));_0x5bd7a(_0x5dd5bc[_0x5028('0x14')]['message']);}})[_0x5028('0x15')](function(_0x2d7237){logger[_0x5028('0x10')](_0x5028('0x13'),_0x2feff4,_0x2d7237);_0x11db96(_0x2d7237);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 35ac652..c9670d2 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 _0x2d5f=['/:id/download','download','post','create','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','describe'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x2d5f,0x1ee));var _0xf2d5=function(_0x2d0953,_0x30bcf9){_0x2d0953=_0x2d0953-0x0;var _0x1e824a=_0x2d5f[_0x2d0953];return _0x1e824a;};'use strict';var multer=require(_0xf2d5('0x0'));var util=require(_0xf2d5('0x1'));var path=require('path');var timeout=require(_0xf2d5('0x2'));var express=require(_0xf2d5('0x3'));var router=express['Router']();var fs_extra=require(_0xf2d5('0x4'));var auth=require(_0xf2d5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf2d5('0x6'));var controller=require('./screenRecording.controller');router[_0xf2d5('0x7')]('/',auth[_0xf2d5('0x8')](),controller['index']);router[_0xf2d5('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xf2d5('0x9')]);router[_0xf2d5('0x7')]('/:id',auth[_0xf2d5('0x8')](),controller['show']);router[_0xf2d5('0x7')](_0xf2d5('0xa'),auth[_0xf2d5('0x8')](),controller[_0xf2d5('0xb')]);router[_0xf2d5('0xc')]('/',auth[_0xf2d5('0x8')](),controller[_0xf2d5('0xd')]);router[_0xf2d5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf2d5('0xf')]);router[_0xf2d5('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf2d5('0x11')]=router; \ No newline at end of file +var _0xec3c=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','create','put'];(function(_0x533843,_0x3d5ec0){var _0x55a5f4=function(_0x3ee88f){while(--_0x3ee88f){_0x533843['push'](_0x533843['shift']());}};_0x55a5f4(++_0x3d5ec0);}(_0xec3c,0x1e6));var _0xcec3=function(_0x57a9bc,_0x94124a){_0x57a9bc=_0x57a9bc-0x0;var _0x14cfc5=_0xec3c[_0x57a9bc];return _0x14cfc5;};'use strict';var multer=require(_0xcec3('0x0'));var util=require(_0xcec3('0x1'));var path=require(_0xcec3('0x2'));var timeout=require(_0xcec3('0x3'));var express=require(_0xcec3('0x4'));var router=express[_0xcec3('0x5')]();var fs_extra=require(_0xcec3('0x6'));var auth=require(_0xcec3('0x7'));var interaction=require(_0xcec3('0x8'));var config=require('../../config/environment');var controller=require(_0xcec3('0x9'));router[_0xcec3('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xcec3('0xb'),auth['isAuthenticated'](),controller[_0xcec3('0xc')]);router['get'](_0xcec3('0xd'),auth[_0xcec3('0xe')](),controller[_0xcec3('0xf')]);router[_0xcec3('0xa')](_0xcec3('0x10'),auth[_0xcec3('0xe')](),controller[_0xcec3('0x11')]);router['post']('/',auth[_0xcec3('0xe')](),controller[_0xcec3('0x12')]);router[_0xcec3('0x13')](_0xcec3('0xd'),auth[_0xcec3('0xe')](),controller[_0xcec3('0x14')]);router[_0xcec3('0x15')](_0xcec3('0xd'),auth['isAuthenticated'](),controller[_0xcec3('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index cba3a5c..86fdc44 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 _0xcd2f=['updatedAt','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','toString','DATE','format','createdAt','MM-DD-YYYY\x20HH:mm'];(function(_0x3f91ac,_0x43dbe3){var _0x23baa4=function(_0x281875){while(--_0x281875){_0x3f91ac['push'](_0x3f91ac['shift']());}};_0x23baa4(++_0x43dbe3);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xcd2f[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require('path');var config=require(_0xfcd2('0x0'));module[_0xfcd2('0x1')]={'format':{'type':Sequelize[_0xfcd2('0x2')],'get':function(){return this[_0xfcd2('0x3')](_0xfcd2('0x4'))?path[_0xfcd2('0x5')](this[_0xfcd2('0x3')](_0xfcd2('0x4'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfcd2('0x6')]},'value':{'type':Sequelize[_0xfcd2('0x6')],'set':function(_0x41e836){var _0x20ac59=_0x41e836[_0xfcd2('0x7')](/\\/g,'/');this[_0xfcd2('0x8')](_0xfcd2('0x4'),_0x20ac59);}},'rating':{'type':Sequelize[_0xfcd2('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xfcd2('0x9')],'set':function(_0x358fb4){this[_0xfcd2('0x8')]('startedAt',moment()[_0xfcd2('0xa')](_0x358fb4,'ms'));this[_0xfcd2('0x8')](_0xfcd2('0xb'),moment());this[_0xfcd2('0x8')](_0xfcd2('0xc'),_0x358fb4);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0xfcd2('0xd')]();}},'closedAt':{'type':Sequelize[_0xfcd2('0xe')],'get':function(){return moment(this['getDataValue'](_0xfcd2('0xb')))[_0xfcd2('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0xfcd2('0xe')],'get':function(){return moment(this[_0xfcd2('0x3')](_0xfcd2('0x10')))[_0xfcd2('0xf')](_0xfcd2('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0xfcd2('0xe')],'get':function(){return moment(this[_0xfcd2('0x3')](_0xfcd2('0x12')))[_0xfcd2('0xf')](_0xfcd2('0x11'))[_0xfcd2('0xd')]();}}}; \ No newline at end of file +var _0xd301=['MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','sequelize','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','format'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd301,0x145));var _0x1d30=function(_0x5f1297,_0x110b10){_0x5f1297=_0x5f1297-0x0;var _0x3c9295=_0xd301[_0x5f1297];return _0x3c9295;};'use strict';var Sequelize=require(_0x1d30('0x0'));var moment=require('moment');var path=require('path');var config=require('../../config/environment');module[_0x1d30('0x1')]={'format':{'type':Sequelize[_0x1d30('0x2')],'get':function(){return this[_0x1d30('0x3')](_0x1d30('0x4'))?path[_0x1d30('0x5')](this[_0x1d30('0x3')](_0x1d30('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x1d30('0x6')]},'channel':{'type':Sequelize[_0x1d30('0x6')]},'value':{'type':Sequelize['STRING'],'set':function(_0x2fe945){var _0x375cee=_0x2fe945[_0x1d30('0x7')](/\\/g,'/');this['setDataValue'](_0x1d30('0x4'),_0x375cee);}},'rating':{'type':Sequelize[_0x1d30('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x1d30('0x8')],'set':function(_0x18d077){this[_0x1d30('0x9')](_0x1d30('0xa'),moment()[_0x1d30('0xb')](_0x18d077,'ms'));this['setDataValue'](_0x1d30('0xc'),moment());this[_0x1d30('0x9')](_0x1d30('0xd'),_0x18d077);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x1d30('0x3')](_0x1d30('0xa')))[_0x1d30('0xe')](_0x1d30('0xf'))[_0x1d30('0x10')]();}},'closedAt':{'type':Sequelize[_0x1d30('0x11')],'get':function(){return moment(this[_0x1d30('0x3')](_0x1d30('0xc')))[_0x1d30('0xe')](_0x1d30('0xf'))[_0x1d30('0x10')]();}},'createdAt':{'type':Sequelize[_0x1d30('0x11')],'get':function(){return moment(this[_0x1d30('0x3')](_0x1d30('0x12')))[_0x1d30('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x1d30('0x10')]();}},'updatedAt':{'type':Sequelize[_0x1d30('0x11')],'get':function(){return moment(this[_0x1d30('0x3')](_0x1d30('0x13')))[_0x1d30('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 9a8b940..37f6488 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 _0x00bb=['json','undefined','limit','offset','apply','reject','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ScreenRecording','count','then','includeAll','include','rows','catch','show','params','length','options','find','body','createdAt','closedAt','value','describe','download','uniqueid','join','root','format','%s.cypher','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status'];(function(_0x4a81e4,_0x3e1e9f){var _0x59aea8=function(_0xa8e630){while(--_0xa8e630){_0x4a81e4['push'](_0x4a81e4['shift']());}};_0x59aea8(++_0x3e1e9f);}(_0x00bb,0x1d8));var _0xb00b=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x00bb[_0x47e7cb];return _0x2a8874;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){_0x2896d1[_0xb00b('0x16')](0xcc)[_0xb00b('0x1f')]();});}};}function handleEntityNotFound(_0x3c9500,_0x8caadf){return function(_0x520e55){if(!_0x520e55){_0x3c9500['sendStatus'](0x194);}return _0x520e55;};}function handleError(_0x3785e9,_0x490380){_0x490380=_0x490380||0x1f4;return function(_0x550587){logger['error'](_0x550587[_0xb00b('0x20')]);if(_0x550587[_0xb00b('0x21')]){delete _0x550587[_0xb00b('0x21')];}_0x3785e9[_0xb00b('0x16')](_0x490380)[_0xb00b('0x22')](_0x550587);};}exports[_0xb00b('0x23')]=function(_0x15d3b9,_0x4a8d2b){var _0x22c22d={},_0x503c9c={},_0x450129={'count':0x0,'rows':[]};var _0x348165=_[_0xb00b('0x24')](db['ScreenRecording'][_0xb00b('0x25')],function(_0x280ed3){return{'name':_0x280ed3[_0xb00b('0x26')],'type':_0x280ed3[_0xb00b('0x27')][_0xb00b('0x28')]};});_0x503c9c[_0xb00b('0x29')]=_[_0xb00b('0x2a')](_[_0xb00b('0x24')](_0x348165,_0xb00b('0x21')),['format']);_0x503c9c[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x15d3b9['query']);_0x503c9c[_0xb00b('0x2d')]=_[_0xb00b('0x2e')](_0x503c9c['model'],_0x503c9c[_0xb00b('0x2b')]);_0x22c22d['attributes']=_[_0xb00b('0x2e')](_0x503c9c[_0xb00b('0x29')],qs[_0xb00b('0x2f')](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x2f')]));_0x22c22d[_0xb00b('0x30')]=_0x22c22d[_0xb00b('0x30')]['length']?_0x22c22d['attributes']:_0x503c9c['model'];if(!_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x22c22d[_0xb00b('0x19')]=qs['limit'](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x22c22d[_0xb00b('0x1a')]=qs[_0xb00b('0x1a')](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x1a')]);}_0x22c22d[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x15d3b9['query']['sort']);_0x22c22d[_0xb00b('0x35')]=qs['filters'](_[_0xb00b('0x36')](_0x15d3b9[_0xb00b('0x2b')],_0x503c9c[_0xb00b('0x2d')]),_0x348165);if(_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x22c22d[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x22c22d['where'],{'$or':_[_0xb00b('0x24')](_0x348165,function(_0x25578e){if(_0x25578e[_0xb00b('0x27')]!==_0xb00b('0x39')){var _0x2496e2={};_0x2496e2[_0x25578e[_0xb00b('0x21')]]={'$like':'%'+_0x15d3b9['query'][_0xb00b('0x37')]+'%'};return _0x2496e2;}})});}_0x22c22d=_[_0xb00b('0x38')]({},_0x22c22d,_0x15d3b9['options']);var _0x17ff34={'where':_0x22c22d[_0xb00b('0x35')]};return db[_0xb00b('0x3a')][_0xb00b('0x3b')](_0x17ff34)[_0xb00b('0x3c')](function(_0x5636b1){_0x450129[_0xb00b('0x3b')]=_0x5636b1;if(_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x3d')]){_0x22c22d[_0xb00b('0x3e')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x22c22d);})[_0xb00b('0x3c')](function(_0xf6ae0c){_0x450129[_0xb00b('0x3f')]=_0xf6ae0c;return _0x450129;})[_0xb00b('0x3c')](respondWithFilteredResult(_0x4a8d2b,_0x22c22d))[_0xb00b('0x40')](handleError(_0x4a8d2b,null));};exports[_0xb00b('0x41')]=function(_0x275664,_0x493841){var _0x36200d={'raw':![],'where':{'id':_0x275664[_0xb00b('0x42')]['id']}},_0x3b72c4={};_0x3b72c4[_0xb00b('0x29')]=_[_0xb00b('0x2c')](db[_0xb00b('0x3a')][_0xb00b('0x25')]);_0x3b72c4[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x275664[_0xb00b('0x2b')]);_0x3b72c4[_0xb00b('0x2d')]=_[_0xb00b('0x2e')](_0x3b72c4['model'],_0x3b72c4[_0xb00b('0x2b')]);_0x36200d[_0xb00b('0x30')]=_[_0xb00b('0x2e')](_0x3b72c4[_0xb00b('0x29')],qs[_0xb00b('0x2f')](_0x275664[_0xb00b('0x2b')][_0xb00b('0x2f')]));_0x36200d[_0xb00b('0x30')]=_0x36200d[_0xb00b('0x30')][_0xb00b('0x43')]?_0x36200d[_0xb00b('0x30')]:_0x3b72c4[_0xb00b('0x29')];if(_0x275664['query']['includeAll']){_0x36200d['include']=[{'all':!![]}];}_0x36200d=_[_0xb00b('0x38')]({},_0x36200d,_0x275664[_0xb00b('0x44')]);return db['ScreenRecording'][_0xb00b('0x45')](_0x36200d)[_0xb00b('0x3c')](handleEntityNotFound(_0x493841,null))[_0xb00b('0x3c')](respondWithResult(_0x493841,null))[_0xb00b('0x40')](handleError(_0x493841,null));};exports['create']=function(_0x58e9cb,_0x172729){return db[_0xb00b('0x3a')]['create'](_0x58e9cb['body'],{})[_0xb00b('0x3c')](respondWithResult(_0x172729,0xc9))[_0xb00b('0x40')](handleError(_0x172729,null));};exports['update']=function(_0x2228e9,_0x47a814){if(_0x2228e9['body']['id']){delete _0x2228e9['body']['id'];}delete _0x2228e9[_0xb00b('0x46')]['duration'];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x47')];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x48')];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x49')];return db['ScreenRecording']['find']({'where':{'id':_0x2228e9[_0xb00b('0x42')]['id']}})[_0xb00b('0x3c')](handleEntityNotFound(_0x47a814,null))['then'](saveUpdates(_0x2228e9[_0xb00b('0x46')],null))[_0xb00b('0x3c')](respondWithResult(_0x47a814,null))['catch'](handleError(_0x47a814,null));};exports[_0xb00b('0x4a')]=function(_0x10e066,_0x3b5d82){return db['ScreenRecording']['describe']()[_0xb00b('0x3c')](respondWithResult(_0x3b5d82,null))[_0xb00b('0x40')](handleError(_0x3b5d82,null));};exports[_0xb00b('0x4b')]=function(_0xde3cc1,_0x489b49,_0x380acb){var _0x3f31e5=require('../../components/encryptor');var _0x4cd9fd=![];var _0x160965={};if(_0xde3cc1['query'][_0xb00b('0x27')]&&_0xde3cc1[_0xb00b('0x2b')][_0xb00b('0x27')]===_0xb00b('0x4c')){_0x160965[_0xb00b('0x4c')]=_0xde3cc1[_0xb00b('0x42')]['id'];}else{_0x160965['id']=_0xde3cc1['params']['id'];}return db[_0xb00b('0x3a')]['find']({'where':_0x160965,'attributes':['id',_0xb00b('0x49')],'raw':!![]})[_0xb00b('0x3c')](handleEntityNotFound(_0x489b49,null))[_0xb00b('0x3c')](function(_0x5ac79e){if(_0x5ac79e){var _0x248335=path[_0xb00b('0x4d')](config[_0xb00b('0x4e')],'server/files/screen_recordings',_0x5ac79e[_0xb00b('0x49')]);var _0x309ae6=util[_0xb00b('0x4f')](_0xb00b('0x50'),_0x248335);if(fs[_0xb00b('0x51')](_0x309ae6)){_0x4cd9fd=!![];return _0x3f31e5[_0xb00b('0x52')](_0x309ae6,_0x248335,config[_0xb00b('0x53')][_0xb00b('0x54')])['then'](function(){return _0x5ac79e;});}return _0x5ac79e;}})[_0xb00b('0x3c')](function(_0x2cbe80){if(_0x2cbe80){var _0x1b4860=path['join'](config[_0xb00b('0x4e')],_0xb00b('0x55'),_0x2cbe80[_0xb00b('0x49')]);if(!fs[_0xb00b('0x51')](_0x1b4860)){throw new db[(_0xb00b('0x56'))]['ValidationError'](_0xb00b('0x57'));}if(_0x2cbe80[_0xb00b('0x58')]){return _0x489b49[_0xb00b('0x4b')](_0x1b4860,_0x2cbe80[_0xb00b('0x58')]+path['extname'](_0x1b4860),function(){if(_0x4cd9fd){fs[_0xb00b('0x59')](_0x1b4860);}});}else{return _0x489b49[_0xb00b('0x4b')](_0x1b4860,function(_0x2c93db){if(_0x4cd9fd){fs[_0xb00b('0x59')](_0x1b4860);}});}}})[_0xb00b('0x40')](function(_0x1e5ed8){if(_0x1e5ed8[_0xb00b('0x5a')]==='ScreenRecording\x20not\x20found'){_0x489b49[_0xb00b('0x16')](0x194)['send'](_0xb00b('0x5b'));}else{return handleError(_0x489b49,null);}});};exports['destroy']=function(_0x3b3272,_0x530d4a){return db[_0xb00b('0x3a')]['find']({'where':{'id':_0x3b3272[_0xb00b('0x42')]['id']}})[_0xb00b('0x3c')](function(_0x3bae02){if(_['isNil'](_0x3bae02)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3bae02;})['then'](function(_0x21a53d){var _0x3126be=path[_0xb00b('0x4d')](config['root'],_0xb00b('0x55'),_0x21a53d[_0xb00b('0x49')]);logger[_0xb00b('0x5c')](_0xb00b('0x5d'),_0x3126be);if(!_[_0xb00b('0x5e')](_0x21a53d['value'])&&fs[_0xb00b('0x51')](_0x3126be)){logger[_0xb00b('0x5c')]('File:\x20\x22'+_0x3126be+_0xb00b('0x5f'));fs[_0xb00b('0x60')](_0x3126be);}_0x3126be=_0x3126be+_0xb00b('0x61');if(!_['isNil'](_0x21a53d['value'])&&fs[_0xb00b('0x51')](_0x3126be)){logger[_0xb00b('0x5c')](_0xb00b('0x62')+_0x3126be+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x3126be);}return _0x21a53d;})['then'](function(_0x5e9677){if(!_0x5e9677)throw new InternalError();return _0x5e9677[_0xb00b('0x1e')]();})['then'](function(){_0x530d4a[_0xb00b('0x16')](0xcc)[_0xb00b('0x1f')]();})['catch'](handleError(_0x530d4a,null));}; \ No newline at end of file +var _0xb4c7=['rawAttributes','fieldName','type','format','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','root','ValidationError','download','filename','extname','unlink','message','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording'];(function(_0x28e502,_0x3e36c5){var _0x2fd662=function(_0x35cb6a){while(--_0x35cb6a){_0x28e502['push'](_0x28e502['shift']());}};_0x2fd662(++_0x3e36c5);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x1d97fc,_0x767aeb){_0x1d97fc=_0x1d97fc-0x0;var _0x49bc1a=_0xb4c7[_0x1d97fc];return _0x49bc1a;};'use strict';var emlformat=require(_0x7b4c('0x0'));var rimraf=require(_0x7b4c('0x1'));var zipdir=require(_0x7b4c('0x2'));var jsonpatch=require(_0x7b4c('0x3'));var rp=require(_0x7b4c('0x4'));var moment=require('moment');var BPromise=require(_0x7b4c('0x5'));var Mustache=require(_0x7b4c('0x6'));var util=require(_0x7b4c('0x7'));var path=require(_0x7b4c('0x8'));var sox=require(_0x7b4c('0x9'));var csv=require('to-csv');var ejs=require(_0x7b4c('0xa'));var fs=require('fs');var fs_extra=require(_0x7b4c('0xb'));var _=require(_0x7b4c('0xc'));var squel=require('squel');var crypto=require(_0x7b4c('0xd'));var jsforce=require(_0x7b4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7b4c('0xf'));var querystring=require(_0x7b4c('0x10'));var Papa=require(_0x7b4c('0x11'));var Redis=require(_0x7b4c('0x12'));var authService=require(_0x7b4c('0x13'));var qs=require(_0x7b4c('0x14'));var as=require(_0x7b4c('0x15'));var hardwareService=require(_0x7b4c('0x16'));var logger=require(_0x7b4c('0x17'))(_0x7b4c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b4c('0x19'));var db=require(_0x7b4c('0x1a'))['db'];function respondWithStatusCode(_0x38656b,_0x1722ad){_0x1722ad=_0x1722ad||0xcc;return function(_0x3e1558){if(_0x3e1558){return _0x38656b[_0x7b4c('0x1b')](_0x1722ad);}return _0x38656b[_0x7b4c('0x1c')](_0x1722ad)[_0x7b4c('0x1d')]();};}function respondWithResult(_0x25b90b,_0x387488){_0x387488=_0x387488||0xc8;return function(_0x593a19){if(_0x593a19){return _0x25b90b[_0x7b4c('0x1c')](_0x387488)[_0x7b4c('0x1e')](_0x593a19);}};}function respondWithFilteredResult(_0xdc71cd,_0x2a0e2f){return function(_0xa0a812){if(_0xa0a812){var _0x2471b3=typeof _0x2a0e2f[_0x7b4c('0x1f')]===_0x7b4c('0x20')&&typeof _0x2a0e2f['limit']===_0x7b4c('0x20');var _0xe71d88=_0xa0a812[_0x7b4c('0x21')];var _0x36c02a=_0x2471b3?0x0:_0x2a0e2f['offset'];var _0x3ce10c=_0x2471b3?_0xa0a812[_0x7b4c('0x21')]:_0x2a0e2f[_0x7b4c('0x1f')]+_0x2a0e2f[_0x7b4c('0x22')];var _0x2d4c72;if(_0x3ce10c>=_0xe71d88){_0x3ce10c=_0xe71d88;_0x2d4c72=0xc8;}else{_0x2d4c72=0xce;}_0xdc71cd[_0x7b4c('0x1c')](_0x2d4c72);return _0xdc71cd[_0x7b4c('0x23')](_0x7b4c('0x24'),_0x36c02a+'-'+_0x3ce10c+'/'+_0xe71d88)[_0x7b4c('0x1e')](_0xa0a812);}return null;};}function patchUpdates(_0x55e3df){return function(_0x1f06ec){try{jsonpatch[_0x7b4c('0x25')](_0x1f06ec,_0x55e3df,!![]);}catch(_0x11996d){return BPromise[_0x7b4c('0x26')](_0x11996d);}return _0x1f06ec[_0x7b4c('0x27')]();};}function saveUpdates(_0x168ac9,_0x176704){return function(_0x3d4826){if(_0x3d4826){return _0x3d4826[_0x7b4c('0x28')](_0x168ac9)[_0x7b4c('0x29')](function(_0x5eec1e){return _0x5eec1e;});}return null;};}function removeEntity(_0x45438c,_0x4350c9){return function(_0x276271){if(_0x276271){return _0x276271[_0x7b4c('0x2a')]()[_0x7b4c('0x29')](function(){_0x45438c[_0x7b4c('0x1c')](0xcc)[_0x7b4c('0x1d')]();});}};}function handleEntityNotFound(_0x459eb4,_0x1f311e){return function(_0x1a69db){if(!_0x1a69db){_0x459eb4[_0x7b4c('0x1b')](0x194);}return _0x1a69db;};}function handleError(_0x257da2,_0x316e5f){_0x316e5f=_0x316e5f||0x1f4;return function(_0x501f75){logger[_0x7b4c('0x2b')](_0x501f75[_0x7b4c('0x2c')]);if(_0x501f75[_0x7b4c('0x2d')]){delete _0x501f75[_0x7b4c('0x2d')];}_0x257da2[_0x7b4c('0x1c')](_0x316e5f)[_0x7b4c('0x2e')](_0x501f75);};}exports[_0x7b4c('0x2f')]=function(_0x2552f9,_0x3e4a46){var _0x9a799b={},_0x3585cd={},_0x130ace={'count':0x0,'rows':[]};var _0x3544bc=_[_0x7b4c('0x30')](db[_0x7b4c('0x31')][_0x7b4c('0x32')],function(_0x1d0724){return{'name':_0x1d0724[_0x7b4c('0x33')],'type':_0x1d0724[_0x7b4c('0x34')]['key']};});_0x3585cd['model']=_['differenceBy'](_[_0x7b4c('0x30')](_0x3544bc,_0x7b4c('0x2d')),[_0x7b4c('0x35')]);_0x3585cd[_0x7b4c('0x36')]=_['keys'](_0x2552f9[_0x7b4c('0x36')]);_0x3585cd[_0x7b4c('0x37')]=_['intersection'](_0x3585cd[_0x7b4c('0x38')],_0x3585cd['query']);_0x9a799b[_0x7b4c('0x39')]=_[_0x7b4c('0x3a')](_0x3585cd[_0x7b4c('0x38')],qs['fields'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x9a799b['attributes']=_0x9a799b[_0x7b4c('0x39')][_0x7b4c('0x3c')]?_0x9a799b[_0x7b4c('0x39')]:_0x3585cd[_0x7b4c('0x38')];if(!_0x2552f9['query']['hasOwnProperty'](_0x7b4c('0x3d'))){_0x9a799b[_0x7b4c('0x22')]=qs['limit'](_0x2552f9[_0x7b4c('0x36')]['limit']);_0x9a799b['offset']=qs[_0x7b4c('0x1f')](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x1f')]);}_0x9a799b[_0x7b4c('0x3e')]=qs['sort'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3f')]);_0x9a799b[_0x7b4c('0x40')]=qs[_0x7b4c('0x37')](_[_0x7b4c('0x41')](_0x2552f9[_0x7b4c('0x36')],_0x3585cd[_0x7b4c('0x37')]),_0x3544bc);if(_0x2552f9['query']['filter']){_0x9a799b[_0x7b4c('0x40')]=_[_0x7b4c('0x42')](_0x9a799b[_0x7b4c('0x40')],{'$or':_[_0x7b4c('0x30')](_0x3544bc,function(_0xb8486d){if(_0xb8486d['type']!==_0x7b4c('0x43')){var _0x902367={};_0x902367[_0xb8486d[_0x7b4c('0x2d')]]={'$like':'%'+_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x44')]+'%'};return _0x902367;}})});}_0x9a799b=_[_0x7b4c('0x42')]({},_0x9a799b,_0x2552f9[_0x7b4c('0x45')]);var _0x1080fc={'where':_0x9a799b[_0x7b4c('0x40')]};return db['ScreenRecording'][_0x7b4c('0x21')](_0x1080fc)['then'](function(_0x2a3a74){_0x130ace['count']=_0x2a3a74;if(_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x9a799b['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x7b4c('0x47')](_0x9a799b);})[_0x7b4c('0x29')](function(_0x1def44){_0x130ace[_0x7b4c('0x48')]=_0x1def44;return _0x130ace;})['then'](respondWithFilteredResult(_0x3e4a46,_0x9a799b))[_0x7b4c('0x49')](handleError(_0x3e4a46,null));};exports[_0x7b4c('0x4a')]=function(_0x100774,_0x5d4ed8){var _0x45ad59={'raw':![],'where':{'id':_0x100774['params']['id']}},_0x4b4757={};_0x4b4757[_0x7b4c('0x38')]=_['keys'](db[_0x7b4c('0x31')][_0x7b4c('0x32')]);_0x4b4757[_0x7b4c('0x36')]=_[_0x7b4c('0x4b')](_0x100774[_0x7b4c('0x36')]);_0x4b4757[_0x7b4c('0x37')]=_[_0x7b4c('0x3a')](_0x4b4757[_0x7b4c('0x38')],_0x4b4757[_0x7b4c('0x36')]);_0x45ad59['attributes']=_[_0x7b4c('0x3a')](_0x4b4757['model'],qs['fields'](_0x100774[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x45ad59['attributes']=_0x45ad59['attributes'][_0x7b4c('0x3c')]?_0x45ad59[_0x7b4c('0x39')]:_0x4b4757[_0x7b4c('0x38')];if(_0x100774[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x45ad59[_0x7b4c('0x4c')]=[{'all':!![]}];}_0x45ad59=_[_0x7b4c('0x42')]({},_0x45ad59,_0x100774[_0x7b4c('0x45')]);return db['ScreenRecording'][_0x7b4c('0x4d')](_0x45ad59)[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4ed8,null))[_0x7b4c('0x29')](respondWithResult(_0x5d4ed8,null))[_0x7b4c('0x49')](handleError(_0x5d4ed8,null));};exports[_0x7b4c('0x4e')]=function(_0x379f15,_0x11a6f9){return db[_0x7b4c('0x31')][_0x7b4c('0x4e')](_0x379f15['body'],{})['then'](respondWithResult(_0x11a6f9,0xc9))[_0x7b4c('0x49')](handleError(_0x11a6f9,null));};exports[_0x7b4c('0x28')]=function(_0x97eadf,_0x5d4192){if(_0x97eadf[_0x7b4c('0x4f')]['id']){delete _0x97eadf[_0x7b4c('0x4f')]['id'];}delete _0x97eadf['body'][_0x7b4c('0x50')];delete _0x97eadf['body'][_0x7b4c('0x51')];delete _0x97eadf['body'][_0x7b4c('0x52')];delete _0x97eadf['body'][_0x7b4c('0x53')];return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x97eadf['params']['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4192,null))[_0x7b4c('0x29')](saveUpdates(_0x97eadf[_0x7b4c('0x4f')],null))['then'](respondWithResult(_0x5d4192,null))['catch'](handleError(_0x5d4192,null));};exports[_0x7b4c('0x54')]=function(_0x1c118a,_0x4cbf1b){return db['ScreenRecording'][_0x7b4c('0x54')]()[_0x7b4c('0x29')](respondWithResult(_0x4cbf1b,null))[_0x7b4c('0x49')](handleError(_0x4cbf1b,null));};exports['download']=function(_0x1d017d,_0x2f009a,_0x4aaf57){var _0x484e80=require(_0x7b4c('0x55'));var _0x4d8491=![];var _0x59db20={};if(_0x1d017d[_0x7b4c('0x36')]['type']&&_0x1d017d['query'][_0x7b4c('0x34')]===_0x7b4c('0x56')){_0x59db20[_0x7b4c('0x56')]=_0x1d017d[_0x7b4c('0x57')]['id'];}else{_0x59db20['id']=_0x1d017d['params']['id'];}return db['ScreenRecording'][_0x7b4c('0x4d')]({'where':_0x59db20,'attributes':['id',_0x7b4c('0x53')],'raw':!![]})[_0x7b4c('0x29')](handleEntityNotFound(_0x2f009a,null))['then'](function(_0x255262){if(_0x255262){var _0x3d81fb=path[_0x7b4c('0x58')](config['root'],_0x7b4c('0x59'),_0x255262[_0x7b4c('0x53')]);var _0x529803=util[_0x7b4c('0x35')](_0x7b4c('0x5a'),_0x3d81fb);if(fs[_0x7b4c('0x5b')](_0x529803)){_0x4d8491=!![];return _0x484e80[_0x7b4c('0x5c')](_0x529803,_0x3d81fb,config[_0x7b4c('0x5d')][_0x7b4c('0x5e')])[_0x7b4c('0x29')](function(){return _0x255262;});}return _0x255262;}})['then'](function(_0x4443d0){if(_0x4443d0){var _0x2dc79a=path['join'](config[_0x7b4c('0x5f')],_0x7b4c('0x59'),_0x4443d0[_0x7b4c('0x53')]);if(!fs[_0x7b4c('0x5b')](_0x2dc79a)){throw new db['Sequelize'][(_0x7b4c('0x60'))]('ScreenRecording\x20not\x20found');}if(_0x4443d0['filename']){return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,_0x4443d0[_0x7b4c('0x62')]+path[_0x7b4c('0x63')](_0x2dc79a),function(){if(_0x4d8491){fs[_0x7b4c('0x64')](_0x2dc79a);}});}else{return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,function(_0x5b24f6){if(_0x4d8491){fs['unlink'](_0x2dc79a);}});}}})[_0x7b4c('0x49')](function(_0x3c84af){if(_0x3c84af[_0x7b4c('0x65')]==='ScreenRecording\x20not\x20found'){_0x2f009a[_0x7b4c('0x1c')](0x194)[_0x7b4c('0x2e')](_0x7b4c('0x66'));}else{return handleError(_0x2f009a,null);}});};exports['destroy']=function(_0x222b47,_0x3b2144){return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x222b47[_0x7b4c('0x57')]['id']}})[_0x7b4c('0x29')](function(_0x4ac03e){if(_[_0x7b4c('0x67')](_0x4ac03e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4ac03e;})[_0x7b4c('0x29')](function(_0x11ae6e){var _0x3a3713=path['join'](config['root'],_0x7b4c('0x59'),_0x11ae6e[_0x7b4c('0x53')]);logger[_0x7b4c('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x3a3713);if(!_[_0x7b4c('0x67')](_0x11ae6e['value'])&&fs[_0x7b4c('0x5b')](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}_0x3a3713=_0x3a3713+'.cypher';if(!_[_0x7b4c('0x67')](_0x11ae6e[_0x7b4c('0x53')])&&fs['existsSync'](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}return _0x11ae6e;})[_0x7b4c('0x29')](function(_0x2befd7){if(!_0x2befd7)throw new InternalError();return _0x2befd7[_0x7b4c('0x2a')]();})[_0x7b4c('0x29')](function(){_0x3b2144['status'](0xcc)[_0x7b4c('0x1d')]();})[_0x7b4c('0x49')](handleError(_0x3b2144,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index cbec313..07fe89b 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 _0x4946=['path','../../config/environment','exports','define','ScreenRecording','interactionid','util','../../config/logger','api','moment','request-promise'];(function(_0x328026,_0x55df53){var _0x246abe=function(_0x360994){while(--_0x360994){_0x328026['push'](_0x328026['shift']());}};_0x246abe(++_0x55df53);}(_0x4946,0xed));var _0x6494=function(_0x2bad90,_0x38442c){_0x2bad90=_0x2bad90-0x0;var _0x1de2d9=_0x4946[_0x2bad90];return _0x1de2d9;};'use strict';var _=require('lodash');var util=require(_0x6494('0x0'));var logger=require(_0x6494('0x1'))(_0x6494('0x2'));var moment=require(_0x6494('0x3'));var BPromise=require('bluebird');var rp=require(_0x6494('0x4'));var fs=require('fs');var path=require(_0x6494('0x5'));var rimraf=require('rimraf');var config=require(_0x6494('0x6'));var attributes=require('./screenRecording.attributes');module[_0x6494('0x7')]=function(_0x5af0fa,_0x4ae2e2){return _0x5af0fa[_0x6494('0x8')](_0x6494('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x6494('0xa'),'fields':[_0x6494('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9703=['ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./screenRecording.attributes','exports'];(function(_0x2b2c71,_0x3eb727){var _0x178e4b=function(_0x1d1ca5){while(--_0x1d1ca5){_0x2b2c71['push'](_0x2b2c71['shift']());}};_0x178e4b(++_0x3eb727);}(_0x9703,0x1bd));var _0x3970=function(_0x32214a,_0x24fb09){_0x32214a=_0x32214a-0x0;var _0x1ce1a5=_0x9703[_0x32214a];return _0x1ce1a5;};'use strict';var _=require(_0x3970('0x0'));var util=require(_0x3970('0x1'));var logger=require('../../config/logger')(_0x3970('0x2'));var moment=require(_0x3970('0x3'));var BPromise=require(_0x3970('0x4'));var rp=require(_0x3970('0x5'));var fs=require('fs');var path=require(_0x3970('0x6'));var rimraf=require(_0x3970('0x7'));var config=require('../../config/environment');var attributes=require(_0x3970('0x8'));module[_0x3970('0x9')]=function(_0x171cb4,_0x4087b4){return _0x171cb4['define'](_0x3970('0xa'),attributes,{'tableName':_0x3970('0xb'),'paranoid':![],'indexes':[{'name':_0x3970('0xc'),'fields':[_0x3970('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index ea33cf2..85d3a2d 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 _0x3e1c=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x149c9c,_0x249082){var _0x47c99=function(_0x2ebc3e){while(--_0x2ebc3e){_0x149c9c['push'](_0x149c9c['shift']());}};_0x47c99(++_0x249082);}(_0x3e1c,0x84));var _0xc3e1=function(_0xd7b3a7,_0xf2fac7){_0xd7b3a7=_0xd7b3a7-0x0;var _0x1028c1=_0x3e1c[_0xd7b3a7];return _0x1028c1;};'use strict';var _=require(_0xc3e1('0x0'));var util=require(_0xc3e1('0x1'));var moment=require(_0xc3e1('0x2'));var BPromise=require(_0xc3e1('0x3'));var rs=require(_0xc3e1('0x4'));var fs=require('fs');var Redis=require(_0xc3e1('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc3e1('0x6'))(_0xc3e1('0x7'));var config=require(_0xc3e1('0x8'));var jayson=require(_0xc3e1('0x9'));var client=jayson[_0xc3e1('0xa')][_0xc3e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21d559,_0x48fcf4,_0x2572fc){return new BPromise(function(_0x3eea9b,_0x34b92c){return client[_0xc3e1('0xc')](_0x21d559,_0x2572fc)[_0xc3e1('0xd')](function(_0x55f178){logger[_0xc3e1('0xe')](_0xc3e1('0xf'),_0x48fcf4,'request\x20sent');logger['debug'](_0xc3e1('0x10'),_0x48fcf4,'request\x20sent',JSON[_0xc3e1('0x11')](_0x55f178));if(_0x55f178[_0xc3e1('0x12')]){if(_0x55f178['error'][_0xc3e1('0x13')]===0x1f4){logger[_0xc3e1('0x12')](_0xc3e1('0xf'),_0x48fcf4,_0x55f178[_0xc3e1('0x12')][_0xc3e1('0x14')]);return _0x34b92c(_0x55f178['error'][_0xc3e1('0x14')]);}logger['error'](_0xc3e1('0xf'),_0x48fcf4,_0x55f178[_0xc3e1('0x12')][_0xc3e1('0x14')]);return _0x3eea9b(_0x55f178[_0xc3e1('0x12')]['message']);}else{logger[_0xc3e1('0xe')](_0xc3e1('0xf'),_0x48fcf4,'request\x20sent');_0x3eea9b(_0x55f178['result']['message']);}})[_0xc3e1('0x15')](function(_0x2b3600){logger['error'](_0xc3e1('0xf'),_0x48fcf4,_0x2b3600);_0x34b92c(_0x2b3600);});});} \ No newline at end of file +var _0xd538=['then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http'];(function(_0x507f7e,_0x2f8b67){var _0xbeb074=function(_0x4bd4c0){while(--_0x4bd4c0){_0x507f7e['push'](_0x507f7e['shift']());}};_0xbeb074(++_0x2f8b67);}(_0xd538,0x148));var _0x8d53=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0xd538[_0xce93c];return _0x230720;};'use strict';var _=require(_0x8d53('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8d53('0x1'));var rs=require(_0x8d53('0x2'));var fs=require('fs');var Redis=require(_0x8d53('0x3'));var db=require(_0x8d53('0x4'))['db'];var utils=require(_0x8d53('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8d53('0x6')][_0x8d53('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x753fb7,_0x5972ba,_0x47127b){return new BPromise(function(_0x1ab2c2,_0x2ff265){return client['request'](_0x753fb7,_0x47127b)[_0x8d53('0x8')](function(_0x540dba){logger[_0x8d53('0x9')](_0x8d53('0xa'),_0x5972ba,_0x8d53('0xb'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x5972ba,_0x8d53('0xb'),JSON['stringify'](_0x540dba));if(_0x540dba[_0x8d53('0xc')]){if(_0x540dba['error'][_0x8d53('0xd')]===0x1f4){logger[_0x8d53('0xc')](_0x8d53('0xa'),_0x5972ba,_0x540dba['error']['message']);return _0x2ff265(_0x540dba[_0x8d53('0xc')][_0x8d53('0xe')]);}logger[_0x8d53('0xc')](_0x8d53('0xa'),_0x5972ba,_0x540dba['error'][_0x8d53('0xe')]);return _0x1ab2c2(_0x540dba[_0x8d53('0xc')][_0x8d53('0xe')]);}else{logger[_0x8d53('0x9')](_0x8d53('0xa'),_0x5972ba,'request\x20sent');_0x1ab2c2(_0x540dba[_0x8d53('0xf')]['message']);}})['catch'](function(_0x55ab51){logger[_0x8d53('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x5972ba,_0x55ab51);_0x2ff265(_0x55ab51);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 44455cf..8747c73 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 _0x5b52=['/now','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root','format','%s%s','logo','originalname','file','addLogo','server/files/images/logos/','logologin','extname','post','addLogoLogin','preferred','single','addPreferred','favicon','/:id/favicon','addFavicon','update','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated'];(function(_0xdd7ad9,_0x21c0fe){var _0x136202=function(_0x1ea017){while(--_0x1ea017){_0xdd7ad9['push'](_0xdd7ad9['shift']());}};_0x136202(++_0x21c0fe);}(_0x5b52,0xa2));var _0x25b5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5b52[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x25b5('0x0'));var util=require('util');var path=require(_0x25b5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x25b5('0x2')]();var fs_extra=require(_0x25b5('0x3'));var auth=require(_0x25b5('0x4'));var interaction=require(_0x25b5('0x5'));var config=require(_0x25b5('0x6'));var controller=require(_0x25b5('0x7'));router[_0x25b5('0x8')]('/',auth[_0x25b5('0x9')](),controller['index']);router['get'](_0x25b5('0xa'),controller['getDate']);router[_0x25b5('0x8')](_0x25b5('0xb'),controller[_0x25b5('0xc')]);router['get'](_0x25b5('0xd'),controller['getLogo']);router[_0x25b5('0x8')](_0x25b5('0xe'),controller[_0x25b5('0xf')]);router[_0x25b5('0x8')](_0x25b5('0x10'),controller[_0x25b5('0x11')]);router['get'](_0x25b5('0x12'),controller[_0x25b5('0x13')]);router[_0x25b5('0x8')]('/:id/favicon',controller[_0x25b5('0x14')]);var upload=multer({'storage':multer[_0x25b5('0x15')]({'destination':function(_0x4dfd8b,_0xa96fb9,_0x45ff77){_0x45ff77(null,path[_0x25b5('0x16')](config[_0x25b5('0x17')],'server/files/images/logos/'));},'filename':function(_0x332c40,_0x49b6a0,_0x271107){_0x271107(null,util[_0x25b5('0x18')](_0x25b5('0x19'),_0x25b5('0x1a'),path['extname'](_0x49b6a0[_0x25b5('0x1b')])));}})});router['post'](_0x25b5('0xd'),upload['single'](_0x25b5('0x1c')),controller[_0x25b5('0x1d')]);var upload=multer({'storage':multer[_0x25b5('0x15')]({'destination':function(_0x27fa22,_0x25f607,_0xfd6ef1){_0xfd6ef1(null,path[_0x25b5('0x16')](config[_0x25b5('0x17')],_0x25b5('0x1e')));},'filename':function(_0x188f44,_0x477ed2,_0x5c3d17){_0x5c3d17(null,util[_0x25b5('0x18')]('%s%s',_0x25b5('0x1f'),path[_0x25b5('0x20')](_0x477ed2[_0x25b5('0x1b')])));}})});router[_0x25b5('0x21')](_0x25b5('0xe'),upload['single'](_0x25b5('0x1c')),controller[_0x25b5('0x22')]);var upload=multer({'storage':multer[_0x25b5('0x15')]({'destination':function(_0x481673,_0x34270e,_0x236fd5){_0x236fd5(null,path['join'](config[_0x25b5('0x17')],'server/files/images/logos/'));},'filename':function(_0x5490b2,_0x45cef3,_0x43eaea){_0x43eaea(null,util[_0x25b5('0x18')](_0x25b5('0x19'),_0x25b5('0x23'),path[_0x25b5('0x20')](_0x45cef3['originalname'])));}})});router['post'](_0x25b5('0x12'),upload[_0x25b5('0x24')]('file'),controller[_0x25b5('0x25')]);var upload=multer({'storage':multer[_0x25b5('0x15')]({'destination':function(_0x2ff02d,_0x46e5d9,_0xa4a727){_0xa4a727(null,path[_0x25b5('0x16')](config[_0x25b5('0x17')],_0x25b5('0x1e')));},'filename':function(_0x5ede70,_0x5d67e5,_0x5719d5){_0x5719d5(null,util[_0x25b5('0x18')](_0x25b5('0x19'),_0x25b5('0x26'),path[_0x25b5('0x20')](_0x5d67e5[_0x25b5('0x1b')])));}})});router[_0x25b5('0x21')](_0x25b5('0x27'),upload[_0x25b5('0x24')](_0x25b5('0x1c')),controller[_0x25b5('0x28')]);router['put'](_0x25b5('0xb'),auth[_0x25b5('0x9')](),controller[_0x25b5('0x29')]);module[_0x25b5('0x2a')]=router; \ No newline at end of file +var _0x7fda=['path','connect-timeout','express','Router','fs-extra','./setting.controller','get','index','/now','getDate','/:id','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','extname','post','/:id/logo','file','addLogo','%s%s','originalname','single','addLogoLogin','preferred','favicon','/:id/favicon','addFavicon','put','isAuthenticated','update','exports','multer','util'];(function(_0x3aaa2e,_0x40731e){var _0x4452f7=function(_0x259db7){while(--_0x259db7){_0x3aaa2e['push'](_0x3aaa2e['shift']());}};_0x4452f7(++_0x40731e);}(_0x7fda,0x181));var _0xa7fd=function(_0x343154,_0x1876e3){_0x343154=_0x343154-0x0;var _0x1e9d47=_0x7fda[_0x343154];return _0x1e9d47;};'use strict';var multer=require(_0xa7fd('0x0'));var util=require(_0xa7fd('0x1'));var path=require(_0xa7fd('0x2'));var timeout=require(_0xa7fd('0x3'));var express=require(_0xa7fd('0x4'));var router=express[_0xa7fd('0x5')]();var fs_extra=require(_0xa7fd('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa7fd('0x7'));router[_0xa7fd('0x8')]('/',auth['isAuthenticated'](),controller[_0xa7fd('0x9')]);router['get'](_0xa7fd('0xa'),controller[_0xa7fd('0xb')]);router[_0xa7fd('0x8')](_0xa7fd('0xc'),controller['show']);router[_0xa7fd('0x8')]('/:id/logo',controller[_0xa7fd('0xd')]);router[_0xa7fd('0x8')](_0xa7fd('0xe'),controller[_0xa7fd('0xf')]);router['get'](_0xa7fd('0x10'),controller[_0xa7fd('0x11')]);router[_0xa7fd('0x8')](_0xa7fd('0x12'),controller['getPreferred']);router[_0xa7fd('0x8')]('/:id/favicon',controller[_0xa7fd('0x13')]);var upload=multer({'storage':multer[_0xa7fd('0x14')]({'destination':function(_0x50f778,_0x4f36cb,_0x1c09b3){_0x1c09b3(null,path[_0xa7fd('0x15')](config[_0xa7fd('0x16')],_0xa7fd('0x17')));},'filename':function(_0x285db5,_0x28567c,_0x1eb429){_0x1eb429(null,util[_0xa7fd('0x18')]('%s%s',_0xa7fd('0x19'),path[_0xa7fd('0x1a')](_0x28567c['originalname'])));}})});router[_0xa7fd('0x1b')](_0xa7fd('0x1c'),upload['single'](_0xa7fd('0x1d')),controller[_0xa7fd('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x51f7ca,_0xdcec1e,_0x2859cc){_0x2859cc(null,path[_0xa7fd('0x15')](config[_0xa7fd('0x16')],_0xa7fd('0x17')));},'filename':function(_0x519342,_0x52b646,_0x54e96a){_0x54e96a(null,util[_0xa7fd('0x18')](_0xa7fd('0x1f'),'logologin',path[_0xa7fd('0x1a')](_0x52b646[_0xa7fd('0x20')])));}})});router['post'](_0xa7fd('0xe'),upload[_0xa7fd('0x21')](_0xa7fd('0x1d')),controller[_0xa7fd('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1c8ea5,_0x37e1d2,_0x1e2956){_0x1e2956(null,path[_0xa7fd('0x15')](config[_0xa7fd('0x16')],_0xa7fd('0x17')));},'filename':function(_0x23ae45,_0x2b8c1a,_0x58f913){_0x58f913(null,util[_0xa7fd('0x18')]('%s%s',_0xa7fd('0x23'),path[_0xa7fd('0x1a')](_0x2b8c1a['originalname'])));}})});router[_0xa7fd('0x1b')]('/:id/preferred',upload['single'](_0xa7fd('0x1d')),controller['addPreferred']);var upload=multer({'storage':multer[_0xa7fd('0x14')]({'destination':function(_0x4de35f,_0x3bdb2d,_0x1f03dc){_0x1f03dc(null,path[_0xa7fd('0x15')](config['root'],_0xa7fd('0x17')));},'filename':function(_0x11ae3e,_0x50ce5f,_0x192a13){_0x192a13(null,util[_0xa7fd('0x18')](_0xa7fd('0x1f'),_0xa7fd('0x24'),path[_0xa7fd('0x1a')](_0x50ce5f[_0xa7fd('0x20')])));}})});router[_0xa7fd('0x1b')](_0xa7fd('0x25'),upload[_0xa7fd('0x21')](_0xa7fd('0x1d')),controller[_0xa7fd('0x26')]);router[_0xa7fd('0x27')](_0xa7fd('0xc'),auth[_0xa7fd('0x28')](),controller[_0xa7fd('0x29')]);module[_0xa7fd('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index b277a53..fabca53 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 _0x3f48=['alternate','UNSIGNED','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0x132fc8,_0x4f10c0){var _0x194b1d=function(_0x18024e){while(--_0x18024e){_0x132fc8['push'](_0x132fc8['shift']());}};_0x194b1d(++_0x4f10c0);}(_0x3f48,0x17c));var _0x83f4=function(_0x2a74dc,_0x243c46){_0x2a74dc=_0x2a74dc-0x0;var _0x56784c=_0x3f48[_0x2a74dc];return _0x56784c;};'use strict';var Sequelize=require('sequelize');module['exports']={'min_internal':{'type':Sequelize[_0x83f4('0x0')](0xb),'unique':_0x83f4('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x83f4('0x0')](0xb),'unique':_0x83f4('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x83f4('0x3')],'defaultValue':_0x83f4('0x4')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x83f4('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x83f4('0x3')]},'turnaddr':{'type':Sequelize[_0x83f4('0x3')]},'turnusername':{'type':Sequelize[_0x83f4('0x3')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x83f4('0x3')]},'defaultPageTitle':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x83f4('0x6')},'enableEmailPreview':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x83f4('0x0')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x83f4('0x0')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x83f4('0x7')},'chatTimeout':{'type':Sequelize[_0x83f4('0x0')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x83f4('0x3')]},'defaultPreferred':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x83f4('0x3')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x83f4('0x0')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x83f4('0x3')]},'defaultFavicon':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x83f4('0x0')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x83f4('0x3')]},'sentiment':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x83f4('0x0')]},'sentimentRegion':{'type':Sequelize[_0x83f4('0x3')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x83f4('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x83f4('0x0')](0x2)[_0x83f4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x83f4('0x0')](0x2)[_0x83f4('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x83f4('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x83f4('0x0')](0x2)[_0x83f4('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x83f4('0x0')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x83f4('0x0')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x83f4('0x0')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x83f4('0x0')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x83f4('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x83f4('0x0')],'defaultValue':0x14}}; \ No newline at end of file +var _0x97e7=['BOOLEAN','UNSIGNED','sequelize','exports','min_internal','INTEGER','min_mailbox','STRING'];(function(_0x1559c0,_0x1c49f5){var _0x24ff37=function(_0x3cfa0a){while(--_0x3cfa0a){_0x1559c0['push'](_0x1559c0['shift']());}};_0x24ff37(++_0x1c49f5);}(_0x97e7,0x7a));var _0x797e=function(_0x5931c0,_0x136287){_0x5931c0=_0x5931c0-0x0;var _0x56a6ba=_0x97e7[_0x5931c0];return _0x56a6ba;};'use strict';var Sequelize=require(_0x797e('0x0'));module[_0x797e('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x797e('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x797e('0x3')](0xb),'unique':_0x797e('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x797e('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x797e('0x5')]},'defaultLogo':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x797e('0x5')]},'turnusername':{'type':Sequelize[_0x797e('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x797e('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x797e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x797e('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x797e('0x5')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x797e('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x797e('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x797e('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x797e('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x797e('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x797e('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x797e('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x797e('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x797e('0x5')]},'defaultFavicon':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x797e('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x797e('0x3')]},'transcribeRegion':{'type':Sequelize[_0x797e('0x5')]},'sentiment':{'type':Sequelize[_0x797e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x797e('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x797e('0x3')]},'sentimentRegion':{'type':Sequelize[_0x797e('0x5')]},'language':{'type':Sequelize[_0x797e('0x5')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x797e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x797e('0x3')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x797e('0x3')](0x2)[_0x797e('0x7')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x797e('0x3')](0x2)[_0x797e('0x7')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x797e('0x3')](0x2)[_0x797e('0x7')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x797e('0x3')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x797e('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x797e('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x797e('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x797e('0x3')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x797e('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x797e('0x3')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index be90a13..9ec4628 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 _0x5f7d=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','stack','name','send','index','map','Setting','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','find','body','file','logo','addLogoLogin','filename','getLogo','server/files/images/logos','getLicense','defaultPreferred','existsSync','toLower','join','root','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','download','getLogoLogin','loginLogo','preferred','favicon','defaultLogo','defaultFavicon','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','defaultLoginLogo','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','crypto','desk.js','querystring'];(function(_0xfc2a63,_0x31d40f){var _0x493a3f=function(_0x352907){while(--_0x352907){_0xfc2a63['push'](_0xfc2a63['shift']());}};_0x493a3f(++_0x31d40f);}(_0x5f7d,0x6d));var _0xd5f7=function(_0x2e7b83,_0x4b81f4){_0x2e7b83=_0x2e7b83-0x0;var _0x330d68=_0x5f7d[_0x2e7b83];return _0x330d68;};'use strict';var emlformat=require(_0xd5f7('0x0'));var rimraf=require(_0xd5f7('0x1'));var zipdir=require(_0xd5f7('0x2'));var jsonpatch=require(_0xd5f7('0x3'));var rp=require('request-promise');var moment=require(_0xd5f7('0x4'));var BPromise=require(_0xd5f7('0x5'));var Mustache=require(_0xd5f7('0x6'));var util=require(_0xd5f7('0x7'));var path=require(_0xd5f7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd5f7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd5f7('0xa'));var squel=require('squel');var crypto=require(_0xd5f7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd5f7('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd5f7('0xd'));var Papa=require('papaparse');var Redis=require(_0xd5f7('0xe'));var authService=require(_0xd5f7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd5f7('0x10'));var hardwareService=require(_0xd5f7('0x11'));var logger=require('../../config/logger')(_0xd5f7('0x12'));var utils=require(_0xd5f7('0x13'));var config=require(_0xd5f7('0x14'));var licenseUtil=require(_0xd5f7('0x15'));var db=require(_0xd5f7('0x16'))['db'];var jayson=require(_0xd5f7('0x17'));var client=jayson[_0xd5f7('0x18')][_0xd5f7('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x11fb6b,_0x3690f5,_0x37190a,_0x2702e8){return new BPromise(function(_0x11a5a1,_0x48838e){var _0x3e3d68=_0x2702e8||client;return _0x3e3d68[_0xd5f7('0x1a')](_0x11fb6b,_0x37190a)[_0xd5f7('0x1b')](function(_0x400600){logger[_0xd5f7('0x1c')](_0xd5f7('0x1d'),_0x3690f5,'request\x20sent');logger[_0xd5f7('0x1e')](_0xd5f7('0x1f'),_0x3690f5,_0xd5f7('0x20'),JSON[_0xd5f7('0x21')](_0x400600));if(_0x400600[_0xd5f7('0x22')]){if(_0x400600[_0xd5f7('0x22')][_0xd5f7('0x23')]===0x1f4){logger[_0xd5f7('0x22')](_0xd5f7('0x1d'),_0x3690f5,_0x400600['error'][_0xd5f7('0x24')]);return _0x48838e(_0x400600['error']['message']);}logger[_0xd5f7('0x22')]('Setting,\x20%s,\x20%s',_0x3690f5,_0x400600[_0xd5f7('0x22')][_0xd5f7('0x24')]);return _0x11a5a1(_0x400600['error'][_0xd5f7('0x24')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x3690f5,_0xd5f7('0x20'));_0x11a5a1(_0x400600['result'][_0xd5f7('0x24')]);}})[_0xd5f7('0x25')](function(_0x3adae4){logger[_0xd5f7('0x22')](_0xd5f7('0x1d'),_0x3690f5,_0x3adae4);_0x48838e(_0x3adae4);});});}function respondWithStatusCode(_0x264c96,_0x117327){_0x117327=_0x117327||0xcc;return function(_0x524254){if(_0x524254){return _0x264c96['sendStatus'](_0x117327);}return _0x264c96['status'](_0x117327)[_0xd5f7('0x26')]();};}function respondWithResult(_0x507847,_0x374dc0){_0x374dc0=_0x374dc0||0xc8;return function(_0x333774){if(_0x333774){return _0x507847[_0xd5f7('0x27')](_0x374dc0)[_0xd5f7('0x28')](_0x333774);}};}function respondWithFilteredResult(_0x98870c,_0x4ce6ad){return function(_0x440380){if(_0x440380){var _0x1ad009=typeof _0x4ce6ad[_0xd5f7('0x29')]==='undefined'&&typeof _0x4ce6ad[_0xd5f7('0x2a')]===_0xd5f7('0x2b');var _0x2be775=_0x440380[_0xd5f7('0x2c')];var _0x1b7f9c=_0x1ad009?0x0:_0x4ce6ad[_0xd5f7('0x29')];var _0x226ffa=_0x1ad009?_0x440380[_0xd5f7('0x2c')]:_0x4ce6ad['offset']+_0x4ce6ad[_0xd5f7('0x2a')];var _0x462208;if(_0x226ffa>=_0x2be775){_0x226ffa=_0x2be775;_0x462208=0xc8;}else{_0x462208=0xce;}_0x98870c['status'](_0x462208);return _0x98870c['set'](_0xd5f7('0x2d'),_0x1b7f9c+'-'+_0x226ffa+'/'+_0x2be775)[_0xd5f7('0x28')](_0x440380);}return null;};}function patchUpdates(_0x4fb1d2){return function(_0x578251){try{jsonpatch[_0xd5f7('0x2e')](_0x578251,_0x4fb1d2,!![]);}catch(_0x25fb31){return BPromise[_0xd5f7('0x2f')](_0x25fb31);}return _0x578251[_0xd5f7('0x30')]();};}function saveUpdates(_0xfa6bb4,_0xfc2309){return function(_0x18298a){if(_0x18298a){return _0x18298a[_0xd5f7('0x31')](_0xfa6bb4)['then'](function(_0x3e7ffe){return _0x3e7ffe;});}return null;};}function removeEntity(_0x2c3571,_0x5ac04e){return function(_0x119938){if(_0x119938){return _0x119938['destroy']()['then'](function(){_0x2c3571[_0xd5f7('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3737dc,_0x108ba3){return function(_0x3e3698){if(!_0x3e3698){_0x3737dc['sendStatus'](0x194);}return _0x3e3698;};}function handleError(_0x31f7ea,_0x4b1d1f){_0x4b1d1f=_0x4b1d1f||0x1f4;return function(_0x1c9116){logger[_0xd5f7('0x22')](_0x1c9116[_0xd5f7('0x32')]);if(_0x1c9116[_0xd5f7('0x33')]){delete _0x1c9116[_0xd5f7('0x33')];}_0x31f7ea['status'](_0x4b1d1f)[_0xd5f7('0x34')](_0x1c9116);};}exports[_0xd5f7('0x35')]=function(_0x157a57,_0x26121c){var _0x55f099={},_0x3ecd00={},_0x26656f={'count':0x0,'rows':[]};var _0x12cb68=_[_0xd5f7('0x36')](db[_0xd5f7('0x37')][_0xd5f7('0x38')],function(_0x96e870){return{'name':_0x96e870[_0xd5f7('0x39')],'type':_0x96e870['type'][_0xd5f7('0x3a')]};});_0x3ecd00[_0xd5f7('0x3b')]=_['map'](_0x12cb68,_0xd5f7('0x33'));_0x3ecd00[_0xd5f7('0x3c')]=_[_0xd5f7('0x3d')](_0x157a57['query']);_0x3ecd00[_0xd5f7('0x3e')]=_[_0xd5f7('0x3f')](_0x3ecd00[_0xd5f7('0x3b')],_0x3ecd00['query']);_0x55f099[_0xd5f7('0x40')]=_[_0xd5f7('0x3f')](_0x3ecd00[_0xd5f7('0x3b')],qs[_0xd5f7('0x41')](_0x157a57['query'][_0xd5f7('0x41')]));_0x55f099['attributes']=_0x55f099['attributes'][_0xd5f7('0x42')]?_0x55f099[_0xd5f7('0x40')]:_0x3ecd00[_0xd5f7('0x3b')];if(!_0x157a57[_0xd5f7('0x3c')][_0xd5f7('0x43')](_0xd5f7('0x44'))){_0x55f099[_0xd5f7('0x2a')]=qs[_0xd5f7('0x2a')](_0x157a57[_0xd5f7('0x3c')][_0xd5f7('0x2a')]);_0x55f099['offset']=qs[_0xd5f7('0x29')](_0x157a57[_0xd5f7('0x3c')][_0xd5f7('0x29')]);}_0x55f099['order']=qs[_0xd5f7('0x45')](_0x157a57['query'][_0xd5f7('0x45')]);_0x55f099['where']=qs[_0xd5f7('0x3e')](_[_0xd5f7('0x46')](_0x157a57['query'],_0x3ecd00[_0xd5f7('0x3e')]),_0x12cb68);if(_0x157a57[_0xd5f7('0x3c')][_0xd5f7('0x47')]){_0x55f099[_0xd5f7('0x48')]=_[_0xd5f7('0x49')](_0x55f099[_0xd5f7('0x48')],{'$or':_[_0xd5f7('0x36')](_0x12cb68,function(_0x42fb3c){if(_0x42fb3c[_0xd5f7('0x4a')]!==_0xd5f7('0x4b')){var _0x48749e={};_0x48749e[_0x42fb3c[_0xd5f7('0x33')]]={'$like':'%'+_0x157a57[_0xd5f7('0x3c')]['filter']+'%'};return _0x48749e;}})});}_0x55f099=_['merge']({},_0x55f099,_0x157a57[_0xd5f7('0x4c')]);var _0x358079={'where':_0x55f099['where']};return db[_0xd5f7('0x37')][_0xd5f7('0x2c')](_0x358079)['then'](function(_0x216aae){_0x26656f[_0xd5f7('0x2c')]=_0x216aae;if(_0x157a57[_0xd5f7('0x3c')][_0xd5f7('0x4d')]){_0x55f099['include']=[{'all':!![]}];}return db[_0xd5f7('0x37')][_0xd5f7('0x4e')](_0x55f099);})['then'](function(_0x171eae){_0x26656f[_0xd5f7('0x4f')]=_0x171eae;return _0x26656f;})[_0xd5f7('0x1b')](respondWithFilteredResult(_0x26121c,_0x55f099))[_0xd5f7('0x25')](handleError(_0x26121c,null));};exports[_0xd5f7('0x50')]=function(_0x84767f,_0x23177b){var _0x31cfc0={'raw':![],'where':{'id':_0x84767f[_0xd5f7('0x51')]['id']}},_0x7a531e={};_0x7a531e[_0xd5f7('0x3b')]=_['keys'](db[_0xd5f7('0x37')][_0xd5f7('0x38')]);_0x7a531e[_0xd5f7('0x3c')]=_[_0xd5f7('0x3d')](_0x84767f[_0xd5f7('0x3c')]);_0x7a531e['filters']=_[_0xd5f7('0x3f')](_0x7a531e[_0xd5f7('0x3b')],_0x7a531e[_0xd5f7('0x3c')]);_0x31cfc0[_0xd5f7('0x40')]=_[_0xd5f7('0x3f')](_0x7a531e[_0xd5f7('0x3b')],qs['fields'](_0x84767f['query'][_0xd5f7('0x41')]));_0x31cfc0[_0xd5f7('0x40')]=_0x31cfc0[_0xd5f7('0x40')]['length']?_0x31cfc0[_0xd5f7('0x40')]:_0x7a531e['model'];if(_0x84767f['query'][_0xd5f7('0x4d')]){_0x31cfc0['include']=[{'all':!![]}];}_0x31cfc0=_[_0xd5f7('0x49')]({},_0x31cfc0,_0x84767f[_0xd5f7('0x4c')]);return db['Setting'][_0xd5f7('0x52')](_0x31cfc0)[_0xd5f7('0x1b')](handleEntityNotFound(_0x23177b,null))['then'](respondWithResult(_0x23177b,null))['catch'](handleError(_0x23177b,null));};exports[_0xd5f7('0x31')]=function(_0xaca6f8,_0x11a012){if(_0xaca6f8[_0xd5f7('0x53')]['id']){delete _0xaca6f8[_0xd5f7('0x53')]['id'];}return db[_0xd5f7('0x37')][_0xd5f7('0x52')]({'where':{'id':_0xaca6f8[_0xd5f7('0x51')]['id']}})[_0xd5f7('0x1b')](handleEntityNotFound(_0x11a012,null))['then'](saveUpdates(_0xaca6f8[_0xd5f7('0x53')],null))[_0xd5f7('0x1b')](respondWithResult(_0x11a012,null))[_0xd5f7('0x25')](handleError(_0x11a012,null));};exports['addLogo']=function(_0x5765a7,_0x230365,_0x5b1f29){if(_0x5765a7[_0xd5f7('0x54')]&&_0x5765a7['file']['filename']){_0x5765a7['body'][_0xd5f7('0x55')]=_0x5765a7[_0xd5f7('0x54')]['filename'];}return db[_0xd5f7('0x37')][_0xd5f7('0x52')]({'where':{'id':_0x5765a7[_0xd5f7('0x51')]['id']}})[_0xd5f7('0x1b')](handleEntityNotFound(_0x230365,null))['then'](saveUpdates(_0x5765a7[_0xd5f7('0x53')],null))[_0xd5f7('0x1b')](respondWithResult(_0x230365,null))['catch'](handleError(_0x230365,null));};exports[_0xd5f7('0x56')]=function(_0x551922,_0x5649bd,_0x28ddb9){if(_0x551922['file']&&_0x551922[_0xd5f7('0x54')][_0xd5f7('0x57')]){_0x551922[_0xd5f7('0x53')]['loginLogo']=_0x551922['file'][_0xd5f7('0x57')];}return db[_0xd5f7('0x37')][_0xd5f7('0x52')]({'where':{'id':_0x551922['params']['id']}})[_0xd5f7('0x1b')](handleEntityNotFound(_0x5649bd,null))[_0xd5f7('0x1b')](saveUpdates(_0x551922[_0xd5f7('0x53')],null))[_0xd5f7('0x1b')](respondWithResult(_0x5649bd,null))[_0xd5f7('0x25')](handleError(_0x5649bd,null));};var utilLicense=require(_0xd5f7('0x15'));exports[_0xd5f7('0x58')]=function(_0x3f397d,_0x210abd,_0x26c816){var _0x19d2f1=_0xd5f7('0x59');var _0x44a015={'custom':![]};return utilLicense[_0xd5f7('0x5a')]()[_0xd5f7('0x1b')](function(_0x194400){if(_0x194400){_0x44a015=_0x194400;}return db[_0xd5f7('0x37')][_0xd5f7('0x52')]({'where':{'id':_0x3f397d['params']['id']},'attributes':[_0xd5f7('0x55'),'loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo',_0xd5f7('0x5b'),'defaultFavicon'],'raw':!![]});})[_0xd5f7('0x1b')](handleEntityNotFound(_0x210abd,null))[_0xd5f7('0x1b')](function(_0x381501){if(_0x381501){var _0x362269=_0x381501[_0xd5f7('0x55')]&&fs[_0xd5f7('0x5c')](path['join'](config['root'],_0x19d2f1,_[_0xd5f7('0x5d')](_0x381501[_0xd5f7('0x55')])))?path[_0xd5f7('0x5e')](config[_0xd5f7('0x5f')],_0x19d2f1,_[_0xd5f7('0x5d')](_0x381501[_0xd5f7('0x55')])):path[_0xd5f7('0x5e')](config[_0xd5f7('0x5f')],_0x19d2f1,_[_0xd5f7('0x5d')](_0xd5f7('0x60')));var _0x4a6b18=_0xd5f7('0x61')+_['upperFirst']('logo');if(_0x381501[_0x4a6b18]||!_0x44a015[_0xd5f7('0x62')]){_0x362269=path['join'](config['root'],_0x19d2f1,_[_0xd5f7('0x5d')](_0xd5f7('0x60')));}if(!fs[_0xd5f7('0x5c')](_0x362269)){throw new db[(_0xd5f7('0x63'))][(_0xd5f7('0x64'))](_[_0xd5f7('0x65')](_0xd5f7('0x55'))+'\x20not\x20found');}return _0x210abd[_0xd5f7('0x66')](_0x362269);}})[_0xd5f7('0x25')](handleError(_0x210abd,null));};var utilLicense=require(_0xd5f7('0x15'));exports[_0xd5f7('0x67')]=function(_0x22425a,_0x31ca87,_0x3bbc44){var _0x44cf37=_0xd5f7('0x59');var _0x5c643a={'custom':![]};return utilLicense[_0xd5f7('0x5a')]()[_0xd5f7('0x1b')](function(_0x1910c9){if(_0x1910c9){_0x5c643a=_0x1910c9;}return db[_0xd5f7('0x37')][_0xd5f7('0x52')]({'where':{'id':_0x22425a['params']['id']},'attributes':[_0xd5f7('0x55'),_0xd5f7('0x68'),_0xd5f7('0x69'),_0xd5f7('0x6a'),_0xd5f7('0x6b'),'defaultLoginLogo',_0xd5f7('0x5b'),_0xd5f7('0x6c')],'raw':!![]});})['then'](handleEntityNotFound(_0x31ca87,null))['then'](function(_0x2c138b){if(_0x2c138b){var _0x521172=_0x2c138b['loginLogo']&&fs[_0xd5f7('0x5c')](path[_0xd5f7('0x5e')](config['root'],_0x44cf37,_[_0xd5f7('0x5d')](_0x2c138b[_0xd5f7('0x68')])))?path[_0xd5f7('0x5e')](config[_0xd5f7('0x5f')],_0x44cf37,_[_0xd5f7('0x5d')](_0x2c138b[_0xd5f7('0x68')])):path[_0xd5f7('0x5e')](config[_0xd5f7('0x5f')],_0x44cf37,_[_0xd5f7('0x5d')]('default_loginLogo.svg'));var _0x526f40=_0xd5f7('0x61')+_['upperFirst'](_0xd5f7('0x68'));if(_0x2c138b[_0x526f40]||!_0x5c643a[_0xd5f7('0x62')]){_0x521172=path[_0xd5f7('0x5e')](config[_0xd5f7('0x5f')],_0x44cf37,_['toLower']('default_loginLogo.svg'));}if(!fs[_0xd5f7('0x5c')](_0x521172)){throw new db[(_0xd5f7('0x63'))][(_0xd5f7('0x64'))](_[_0xd5f7('0x65')]('loginLogo')+_0xd5f7('0x6d'));}return _0x31ca87[_0xd5f7('0x66')](_0x521172);}})['catch'](handleError(_0x31ca87,null));};exports[_0xd5f7('0x6e')]=function(_0x10c388,_0x4609bd){return db[_0xd5f7('0x37')][_0xd5f7('0x52')]({'where':{'id':_0x10c388[_0xd5f7('0x51')]['id']},'attributes':[_0xd5f7('0x6f')]})[_0xd5f7('0x1b')](respondWithResult(_0x4609bd,null))[_0xd5f7('0x25')](handleError(_0x4609bd,null));};exports[_0xd5f7('0x70')]=function(_0x44d082,_0x5d0df3,_0x2f38cf){if(_0x44d082[_0xd5f7('0x54')]&&_0x44d082['file']['filename']){_0x44d082[_0xd5f7('0x53')]['preferred']=_0x44d082[_0xd5f7('0x54')][_0xd5f7('0x57')];}return db[_0xd5f7('0x37')]['find']({'where':{'id':_0x44d082[_0xd5f7('0x51')]['id']}})['then'](handleEntityNotFound(_0x5d0df3,null))[_0xd5f7('0x1b')](saveUpdates(_0x44d082[_0xd5f7('0x53')],null))['then'](respondWithResult(_0x5d0df3,null))[_0xd5f7('0x25')](handleError(_0x5d0df3,null));};var utilLicense=require(_0xd5f7('0x15'));exports[_0xd5f7('0x71')]=function(_0x4aabc3,_0x16226b,_0x30f3fa){var _0x1cf333=_0xd5f7('0x59');var _0x61d66f={'custom':![]};return utilLicense[_0xd5f7('0x5a')]()['then'](function(_0x5837d9){if(_0x5837d9){_0x61d66f=_0x5837d9;}return db[_0xd5f7('0x37')][_0xd5f7('0x52')]({'where':{'id':_0x4aabc3[_0xd5f7('0x51')]['id']},'attributes':[_0xd5f7('0x55'),'loginLogo',_0xd5f7('0x69'),_0xd5f7('0x6a'),_0xd5f7('0x6b'),_0xd5f7('0x72'),_0xd5f7('0x5b'),_0xd5f7('0x6c')],'raw':!![]});})['then'](handleEntityNotFound(_0x16226b,null))[_0xd5f7('0x1b')](function(_0x20c5f0){if(_0x20c5f0){var _0x2d3b56=_0x20c5f0[_0xd5f7('0x69')]&&fs[_0xd5f7('0x5c')](path['join'](config[_0xd5f7('0x5f')],_0x1cf333,_[_0xd5f7('0x5d')](_0x20c5f0['preferred'])))?path[_0xd5f7('0x5e')](config[_0xd5f7('0x5f')],_0x1cf333,_[_0xd5f7('0x5d')](_0x20c5f0[_0xd5f7('0x69')])):path[_0xd5f7('0x5e')](config[_0xd5f7('0x5f')],_0x1cf333,_[_0xd5f7('0x5d')]('default_preferred.png'));var _0x2579a9=_0xd5f7('0x61')+_[_0xd5f7('0x65')](_0xd5f7('0x69'));if(_0x20c5f0[_0x2579a9]||!_0x61d66f[_0xd5f7('0x62')]||!_0x61d66f[_0xd5f7('0x69')]){_0x2d3b56=path[_0xd5f7('0x5e')](config[_0xd5f7('0x5f')],_0x1cf333,_['toLower'](_0xd5f7('0x73')));}if(!fs['existsSync'](_0x2d3b56)){throw new db['Sequelize'][(_0xd5f7('0x64'))](_[_0xd5f7('0x65')](_0xd5f7('0x69'))+_0xd5f7('0x6d'));}return _0x16226b[_0xd5f7('0x66')](_0x2d3b56);}})['catch'](handleError(_0x16226b,null));};exports[_0xd5f7('0x74')]=function(_0x10fec5,_0x37f897,_0x1fb3d5){if(_0x10fec5['file']&&_0x10fec5[_0xd5f7('0x54')]['filename']){_0x10fec5['body'][_0xd5f7('0x6a')]=_0x10fec5[_0xd5f7('0x54')][_0xd5f7('0x57')];}return db[_0xd5f7('0x37')][_0xd5f7('0x52')]({'where':{'id':_0x10fec5[_0xd5f7('0x51')]['id']}})[_0xd5f7('0x1b')](handleEntityNotFound(_0x37f897,null))['then'](saveUpdates(_0x10fec5[_0xd5f7('0x53')],null))['then'](respondWithResult(_0x37f897,null))['catch'](handleError(_0x37f897,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x3d8d38,_0x260b78,_0x5ceb4e){var _0x5a1712=_0xd5f7('0x59');var _0x9b767d={'custom':![]};return utilLicense[_0xd5f7('0x5a')]()[_0xd5f7('0x1b')](function(_0x5bb7a8){if(_0x5bb7a8){_0x9b767d=_0x5bb7a8;}return db[_0xd5f7('0x37')][_0xd5f7('0x52')]({'where':{'id':_0x3d8d38[_0xd5f7('0x51')]['id']},'attributes':['logo',_0xd5f7('0x68'),_0xd5f7('0x69'),_0xd5f7('0x6a'),_0xd5f7('0x6b'),_0xd5f7('0x72'),_0xd5f7('0x5b'),_0xd5f7('0x6c')],'raw':!![]});})[_0xd5f7('0x1b')](handleEntityNotFound(_0x260b78,null))[_0xd5f7('0x1b')](function(_0x37465a){if(_0x37465a){var _0x1a0f72=_0x37465a[_0xd5f7('0x6a')]&&fs[_0xd5f7('0x5c')](path[_0xd5f7('0x5e')](config['root'],_0x5a1712,_[_0xd5f7('0x5d')](_0x37465a[_0xd5f7('0x6a')])))?path['join'](config[_0xd5f7('0x5f')],_0x5a1712,_[_0xd5f7('0x5d')](_0x37465a[_0xd5f7('0x6a')])):path[_0xd5f7('0x5e')](config['root'],_0x5a1712,_['toLower'](_0xd5f7('0x75')));var _0x18c8e7=_0xd5f7('0x61')+_[_0xd5f7('0x65')]('favicon');if(_0x37465a[_0x18c8e7]||!_0x9b767d['custom']){_0x1a0f72=path[_0xd5f7('0x5e')](config[_0xd5f7('0x5f')],_0x5a1712,_[_0xd5f7('0x5d')]('default_favicon.ico'));}if(!fs[_0xd5f7('0x5c')](_0x1a0f72)){throw new db[(_0xd5f7('0x63'))][(_0xd5f7('0x64'))](_[_0xd5f7('0x65')](_0xd5f7('0x6a'))+_0xd5f7('0x6d'));}return _0x260b78[_0xd5f7('0x66')](_0x1a0f72);}})[_0xd5f7('0x25')](handleError(_0x260b78,null));};exports[_0xd5f7('0x76')]=function(_0x2f4341,_0x2984aa){var _0x5329f7={'offset':moment()[_0xd5f7('0x77')]()};_0x5329f7[_0xd5f7('0x78')]=moment()[_0xd5f7('0x77')](_0x5329f7[_0xd5f7('0x29')])[_0xd5f7('0x79')](_0xd5f7('0x7a'));return _0x2984aa[_0xd5f7('0x27')](0xc8)[_0xd5f7('0x34')](_0x5329f7);}; \ No newline at end of file +var _0x048c=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','name','send','map','Setting','rawAttributes','fieldName','key','model','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','include','params','keys','includeAll','merge','body','find','addLogo','file','logo','filename','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','download','defaultLoginLogo','default_loginLogo.svg','gdpr','addPreferred','default_preferred.png','custom','addFavicon','getFavicon','default_favicon.ico','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0x048c,0xdb));var _0xc048=function(_0x4486e7,_0x3fd506){_0x4486e7=_0x4486e7-0x0;var _0x55b1b=_0x048c[_0x4486e7];return _0x55b1b;};'use strict';var emlformat=require(_0xc048('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc048('0x1'));var rp=require('request-promise');var moment=require(_0xc048('0x2'));var BPromise=require(_0xc048('0x3'));var Mustache=require('mustache');var util=require(_0xc048('0x4'));var path=require(_0xc048('0x5'));var sox=require(_0xc048('0x6'));var csv=require(_0xc048('0x7'));var ejs=require(_0xc048('0x8'));var fs=require('fs');var fs_extra=require(_0xc048('0x9'));var _=require(_0xc048('0xa'));var squel=require(_0xc048('0xb'));var crypto=require('crypto');var jsforce=require(_0xc048('0xc'));var deskjs=require(_0xc048('0xd'));var toCsv=require(_0xc048('0x7'));var querystring=require(_0xc048('0xe'));var Papa=require(_0xc048('0xf'));var Redis=require(_0xc048('0x10'));var authService=require(_0xc048('0x11'));var qs=require(_0xc048('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc048('0x13'));var logger=require(_0xc048('0x14'))(_0xc048('0x15'));var utils=require(_0xc048('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc048('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xc048('0x18'));var client=jayson['client'][_0xc048('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x29be51,_0x3b879e,_0x36ada9,_0x3c0a79){return new BPromise(function(_0x3c7e07,_0x20b0bc){var _0x225059=_0x3c0a79||client;return _0x225059[_0xc048('0x1a')](_0x29be51,_0x36ada9)[_0xc048('0x1b')](function(_0x1505ef){logger[_0xc048('0x1c')](_0xc048('0x1d'),_0x3b879e,'request\x20sent');logger['debug'](_0xc048('0x1e'),_0x3b879e,_0xc048('0x1f'),JSON[_0xc048('0x20')](_0x1505ef));if(_0x1505ef['error']){if(_0x1505ef[_0xc048('0x21')][_0xc048('0x22')]===0x1f4){logger[_0xc048('0x21')]('Setting,\x20%s,\x20%s',_0x3b879e,_0x1505ef[_0xc048('0x21')][_0xc048('0x23')]);return _0x20b0bc(_0x1505ef[_0xc048('0x21')][_0xc048('0x23')]);}logger['error'](_0xc048('0x1d'),_0x3b879e,_0x1505ef['error'][_0xc048('0x23')]);return _0x3c7e07(_0x1505ef[_0xc048('0x21')]['message']);}else{logger['info'](_0xc048('0x1d'),_0x3b879e,_0xc048('0x1f'));_0x3c7e07(_0x1505ef[_0xc048('0x24')]['message']);}})[_0xc048('0x25')](function(_0x267393){logger['error'](_0xc048('0x1d'),_0x3b879e,_0x267393);_0x20b0bc(_0x267393);});});}function respondWithStatusCode(_0x35160c,_0xa2a309){_0xa2a309=_0xa2a309||0xcc;return function(_0x4f4d3c){if(_0x4f4d3c){return _0x35160c[_0xc048('0x26')](_0xa2a309);}return _0x35160c[_0xc048('0x27')](_0xa2a309)['end']();};}function respondWithResult(_0x33a608,_0x44c3a0){_0x44c3a0=_0x44c3a0||0xc8;return function(_0x23c014){if(_0x23c014){return _0x33a608[_0xc048('0x27')](_0x44c3a0)[_0xc048('0x28')](_0x23c014);}};}function respondWithFilteredResult(_0x18a03a,_0x24b4e6){return function(_0x41de32){if(_0x41de32){var _0x49b07=typeof _0x24b4e6[_0xc048('0x29')]==='undefined'&&typeof _0x24b4e6[_0xc048('0x2a')]==='undefined';var _0x2b855b=_0x41de32[_0xc048('0x2b')];var _0x312d00=_0x49b07?0x0:_0x24b4e6[_0xc048('0x29')];var _0x3a421a=_0x49b07?_0x41de32[_0xc048('0x2b')]:_0x24b4e6[_0xc048('0x29')]+_0x24b4e6[_0xc048('0x2a')];var _0x5a6428;if(_0x3a421a>=_0x2b855b){_0x3a421a=_0x2b855b;_0x5a6428=0xc8;}else{_0x5a6428=0xce;}_0x18a03a['status'](_0x5a6428);return _0x18a03a[_0xc048('0x2c')](_0xc048('0x2d'),_0x312d00+'-'+_0x3a421a+'/'+_0x2b855b)[_0xc048('0x28')](_0x41de32);}return null;};}function patchUpdates(_0x21a3bd){return function(_0x47faef){try{jsonpatch[_0xc048('0x2e')](_0x47faef,_0x21a3bd,!![]);}catch(_0x4e64bd){return BPromise[_0xc048('0x2f')](_0x4e64bd);}return _0x47faef[_0xc048('0x30')]();};}function saveUpdates(_0x516e87,_0x3cca0b){return function(_0x1034ce){if(_0x1034ce){return _0x1034ce[_0xc048('0x31')](_0x516e87)['then'](function(_0x4b4e38){return _0x4b4e38;});}return null;};}function removeEntity(_0x2a4a9a,_0x89b6ec){return function(_0x204e35){if(_0x204e35){return _0x204e35['destroy']()[_0xc048('0x1b')](function(){_0x2a4a9a[_0xc048('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c4f6d,_0x53079a){return function(_0x2e1dde){if(!_0x2e1dde){_0x2c4f6d[_0xc048('0x26')](0x194);}return _0x2e1dde;};}function handleError(_0x936c5b,_0x15b6cd){_0x15b6cd=_0x15b6cd||0x1f4;return function(_0xa89004){logger['error'](_0xa89004['stack']);if(_0xa89004[_0xc048('0x32')]){delete _0xa89004[_0xc048('0x32')];}_0x936c5b[_0xc048('0x27')](_0x15b6cd)[_0xc048('0x33')](_0xa89004);};}exports['index']=function(_0x94c203,_0x360f06){var _0x10a197={},_0x2be52c={},_0x3fdf2e={'count':0x0,'rows':[]};var _0x29fb95=_[_0xc048('0x34')](db[_0xc048('0x35')][_0xc048('0x36')],function(_0x5cf1f1){return{'name':_0x5cf1f1[_0xc048('0x37')],'type':_0x5cf1f1['type'][_0xc048('0x38')]};});_0x2be52c[_0xc048('0x39')]=_[_0xc048('0x34')](_0x29fb95,_0xc048('0x32'));_0x2be52c[_0xc048('0x3a')]=_['keys'](_0x94c203[_0xc048('0x3a')]);_0x2be52c[_0xc048('0x3b')]=_[_0xc048('0x3c')](_0x2be52c['model'],_0x2be52c[_0xc048('0x3a')]);_0x10a197['attributes']=_['intersection'](_0x2be52c[_0xc048('0x39')],qs[_0xc048('0x3d')](_0x94c203[_0xc048('0x3a')][_0xc048('0x3d')]));_0x10a197['attributes']=_0x10a197['attributes'][_0xc048('0x3e')]?_0x10a197[_0xc048('0x3f')]:_0x2be52c[_0xc048('0x39')];if(!_0x94c203[_0xc048('0x3a')]['hasOwnProperty'](_0xc048('0x40'))){_0x10a197[_0xc048('0x2a')]=qs[_0xc048('0x2a')](_0x94c203['query'][_0xc048('0x2a')]);_0x10a197[_0xc048('0x29')]=qs[_0xc048('0x29')](_0x94c203[_0xc048('0x3a')][_0xc048('0x29')]);}_0x10a197[_0xc048('0x41')]=qs[_0xc048('0x42')](_0x94c203[_0xc048('0x3a')][_0xc048('0x42')]);_0x10a197[_0xc048('0x43')]=qs[_0xc048('0x3b')](_[_0xc048('0x44')](_0x94c203[_0xc048('0x3a')],_0x2be52c[_0xc048('0x3b')]),_0x29fb95);if(_0x94c203[_0xc048('0x3a')][_0xc048('0x45')]){_0x10a197[_0xc048('0x43')]=_['merge'](_0x10a197[_0xc048('0x43')],{'$or':_[_0xc048('0x34')](_0x29fb95,function(_0x344c3a){if(_0x344c3a[_0xc048('0x46')]!==_0xc048('0x47')){var _0x47d62c={};_0x47d62c[_0x344c3a[_0xc048('0x32')]]={'$like':'%'+_0x94c203[_0xc048('0x3a')][_0xc048('0x45')]+'%'};return _0x47d62c;}})});}_0x10a197=_['merge']({},_0x10a197,_0x94c203[_0xc048('0x48')]);var _0x381390={'where':_0x10a197[_0xc048('0x43')]};return db[_0xc048('0x35')][_0xc048('0x2b')](_0x381390)['then'](function(_0x577309){_0x3fdf2e[_0xc048('0x2b')]=_0x577309;if(_0x94c203[_0xc048('0x3a')]['includeAll']){_0x10a197[_0xc048('0x49')]=[{'all':!![]}];}return db[_0xc048('0x35')]['findAll'](_0x10a197);})[_0xc048('0x1b')](function(_0x57c3aa){_0x3fdf2e['rows']=_0x57c3aa;return _0x3fdf2e;})[_0xc048('0x1b')](respondWithFilteredResult(_0x360f06,_0x10a197))[_0xc048('0x25')](handleError(_0x360f06,null));};exports['show']=function(_0x13b011,_0x2cb61e){var _0x2ce0e6={'raw':![],'where':{'id':_0x13b011[_0xc048('0x4a')]['id']}},_0x1de5a1={};_0x1de5a1['model']=_['keys'](db['Setting']['rawAttributes']);_0x1de5a1['query']=_[_0xc048('0x4b')](_0x13b011[_0xc048('0x3a')]);_0x1de5a1['filters']=_[_0xc048('0x3c')](_0x1de5a1[_0xc048('0x39')],_0x1de5a1[_0xc048('0x3a')]);_0x2ce0e6[_0xc048('0x3f')]=_[_0xc048('0x3c')](_0x1de5a1[_0xc048('0x39')],qs[_0xc048('0x3d')](_0x13b011[_0xc048('0x3a')][_0xc048('0x3d')]));_0x2ce0e6[_0xc048('0x3f')]=_0x2ce0e6[_0xc048('0x3f')][_0xc048('0x3e')]?_0x2ce0e6[_0xc048('0x3f')]:_0x1de5a1[_0xc048('0x39')];if(_0x13b011[_0xc048('0x3a')][_0xc048('0x4c')]){_0x2ce0e6[_0xc048('0x49')]=[{'all':!![]}];}_0x2ce0e6=_[_0xc048('0x4d')]({},_0x2ce0e6,_0x13b011['options']);return db[_0xc048('0x35')]['find'](_0x2ce0e6)[_0xc048('0x1b')](handleEntityNotFound(_0x2cb61e,null))[_0xc048('0x1b')](respondWithResult(_0x2cb61e,null))[_0xc048('0x25')](handleError(_0x2cb61e,null));};exports[_0xc048('0x31')]=function(_0x2f83de,_0x490edd){if(_0x2f83de[_0xc048('0x4e')]['id']){delete _0x2f83de['body']['id'];}return db[_0xc048('0x35')][_0xc048('0x4f')]({'where':{'id':_0x2f83de[_0xc048('0x4a')]['id']}})[_0xc048('0x1b')](handleEntityNotFound(_0x490edd,null))[_0xc048('0x1b')](saveUpdates(_0x2f83de[_0xc048('0x4e')],null))[_0xc048('0x1b')](respondWithResult(_0x490edd,null))[_0xc048('0x25')](handleError(_0x490edd,null));};exports[_0xc048('0x50')]=function(_0x3c933e,_0x4f24bb,_0x2ac53f){if(_0x3c933e[_0xc048('0x51')]&&_0x3c933e[_0xc048('0x51')]['filename']){_0x3c933e[_0xc048('0x4e')][_0xc048('0x52')]=_0x3c933e[_0xc048('0x51')][_0xc048('0x53')];}return db[_0xc048('0x35')][_0xc048('0x4f')]({'where':{'id':_0x3c933e[_0xc048('0x4a')]['id']}})[_0xc048('0x1b')](handleEntityNotFound(_0x4f24bb,null))['then'](saveUpdates(_0x3c933e[_0xc048('0x4e')],null))['then'](respondWithResult(_0x4f24bb,null))[_0xc048('0x25')](handleError(_0x4f24bb,null));};exports['addLogoLogin']=function(_0x77f90,_0x45a41b,_0x56543a){if(_0x77f90['file']&&_0x77f90[_0xc048('0x51')][_0xc048('0x53')]){_0x77f90[_0xc048('0x4e')][_0xc048('0x54')]=_0x77f90['file']['filename'];}return db[_0xc048('0x35')][_0xc048('0x4f')]({'where':{'id':_0x77f90['params']['id']}})[_0xc048('0x1b')](handleEntityNotFound(_0x45a41b,null))[_0xc048('0x1b')](saveUpdates(_0x77f90[_0xc048('0x4e')],null))[_0xc048('0x1b')](respondWithResult(_0x45a41b,null))[_0xc048('0x25')](handleError(_0x45a41b,null));};var utilLicense=require(_0xc048('0x17'));exports[_0xc048('0x55')]=function(_0x553559,_0x54da77,_0x864279){var _0x4c171b=_0xc048('0x56');var _0xa1bad0={'custom':![]};return utilLicense[_0xc048('0x57')]()[_0xc048('0x1b')](function(_0x448376){if(_0x448376){_0xa1bad0=_0x448376;}return db[_0xc048('0x35')]['find']({'where':{'id':_0x553559['params']['id']},'attributes':['logo',_0xc048('0x54'),_0xc048('0x58'),_0xc048('0x59'),_0xc048('0x5a'),'defaultLoginLogo',_0xc048('0x5b'),_0xc048('0x5c')],'raw':!![]});})[_0xc048('0x1b')](handleEntityNotFound(_0x54da77,null))[_0xc048('0x1b')](function(_0x28949a){if(_0x28949a){var _0x4530d8=_0x28949a['logo']&&fs[_0xc048('0x5d')](path[_0xc048('0x5e')](config[_0xc048('0x5f')],_0x4c171b,_[_0xc048('0x60')](_0x28949a[_0xc048('0x52')])))?path['join'](config['root'],_0x4c171b,_[_0xc048('0x60')](_0x28949a[_0xc048('0x52')])):path[_0xc048('0x5e')](config[_0xc048('0x5f')],_0x4c171b,_['toLower'](_0xc048('0x61')));var _0x21b04f=_0xc048('0x62')+_[_0xc048('0x63')](_0xc048('0x52'));if(_0x28949a[_0x21b04f]||!_0xa1bad0['custom']){_0x4530d8=path['join'](config[_0xc048('0x5f')],_0x4c171b,_['toLower'](_0xc048('0x61')));}if(!fs[_0xc048('0x5d')](_0x4530d8)){throw new db[(_0xc048('0x64'))][(_0xc048('0x65'))](_[_0xc048('0x63')]('logo')+_0xc048('0x66'));}return _0x54da77[_0xc048('0x67')](_0x4530d8);}})[_0xc048('0x25')](handleError(_0x54da77,null));};var utilLicense=require(_0xc048('0x17'));exports['getLogoLogin']=function(_0xd77864,_0x510e15,_0x2d2b8c){var _0x392730='server/files/images/logos';var _0xc74f2f={'custom':![]};return utilLicense[_0xc048('0x57')]()[_0xc048('0x1b')](function(_0x4f244a){if(_0x4f244a){_0xc74f2f=_0x4f244a;}return db[_0xc048('0x35')][_0xc048('0x4f')]({'where':{'id':_0xd77864[_0xc048('0x4a')]['id']},'attributes':[_0xc048('0x52'),'loginLogo',_0xc048('0x58'),_0xc048('0x59'),_0xc048('0x5a'),_0xc048('0x68'),_0xc048('0x5b'),_0xc048('0x5c')],'raw':!![]});})[_0xc048('0x1b')](handleEntityNotFound(_0x510e15,null))[_0xc048('0x1b')](function(_0x284c4f){if(_0x284c4f){var _0x48a45f=_0x284c4f[_0xc048('0x54')]&&fs['existsSync'](path[_0xc048('0x5e')](config[_0xc048('0x5f')],_0x392730,_[_0xc048('0x60')](_0x284c4f[_0xc048('0x54')])))?path[_0xc048('0x5e')](config['root'],_0x392730,_['toLower'](_0x284c4f[_0xc048('0x54')])):path[_0xc048('0x5e')](config[_0xc048('0x5f')],_0x392730,_['toLower'](_0xc048('0x69')));var _0x5f1de5=_0xc048('0x62')+_['upperFirst']('loginLogo');if(_0x284c4f[_0x5f1de5]||!_0xc74f2f['custom']){_0x48a45f=path[_0xc048('0x5e')](config['root'],_0x392730,_['toLower'](_0xc048('0x69')));}if(!fs[_0xc048('0x5d')](_0x48a45f)){throw new db[(_0xc048('0x64'))][(_0xc048('0x65'))](_[_0xc048('0x63')](_0xc048('0x54'))+_0xc048('0x66'));}return _0x510e15[_0xc048('0x67')](_0x48a45f);}})['catch'](handleError(_0x510e15,null));};exports[_0xc048('0x6a')]=function(_0x1a30e5,_0x4aaa54){return db['Setting'][_0xc048('0x4f')]({'where':{'id':_0x1a30e5['params']['id']},'attributes':['securePassword']})[_0xc048('0x1b')](respondWithResult(_0x4aaa54,null))[_0xc048('0x25')](handleError(_0x4aaa54,null));};exports[_0xc048('0x6b')]=function(_0x3bd9ef,_0x562909,_0x1a16a3){if(_0x3bd9ef[_0xc048('0x51')]&&_0x3bd9ef[_0xc048('0x51')][_0xc048('0x53')]){_0x3bd9ef['body'][_0xc048('0x58')]=_0x3bd9ef[_0xc048('0x51')][_0xc048('0x53')];}return db['Setting']['find']({'where':{'id':_0x3bd9ef[_0xc048('0x4a')]['id']}})[_0xc048('0x1b')](handleEntityNotFound(_0x562909,null))[_0xc048('0x1b')](saveUpdates(_0x3bd9ef[_0xc048('0x4e')],null))[_0xc048('0x1b')](respondWithResult(_0x562909,null))[_0xc048('0x25')](handleError(_0x562909,null));};var utilLicense=require(_0xc048('0x17'));exports['getPreferred']=function(_0x46dc47,_0x447762,_0x3ca556){var _0x2e1488='server/files/images/logos';var _0x46b9ea={'custom':![]};return utilLicense[_0xc048('0x57')]()[_0xc048('0x1b')](function(_0x10a858){if(_0x10a858){_0x46b9ea=_0x10a858;}return db[_0xc048('0x35')][_0xc048('0x4f')]({'where':{'id':_0x46dc47[_0xc048('0x4a')]['id']},'attributes':[_0xc048('0x52'),_0xc048('0x54'),_0xc048('0x58'),_0xc048('0x59'),_0xc048('0x5a'),_0xc048('0x68'),_0xc048('0x5b'),_0xc048('0x5c')],'raw':!![]});})[_0xc048('0x1b')](handleEntityNotFound(_0x447762,null))[_0xc048('0x1b')](function(_0x636eef){if(_0x636eef){var _0x1a7a57=_0x636eef[_0xc048('0x58')]&&fs[_0xc048('0x5d')](path[_0xc048('0x5e')](config['root'],_0x2e1488,_[_0xc048('0x60')](_0x636eef[_0xc048('0x58')])))?path[_0xc048('0x5e')](config[_0xc048('0x5f')],_0x2e1488,_[_0xc048('0x60')](_0x636eef[_0xc048('0x58')])):path[_0xc048('0x5e')](config[_0xc048('0x5f')],_0x2e1488,_['toLower'](_0xc048('0x6c')));var _0x53125b=_0xc048('0x62')+_[_0xc048('0x63')](_0xc048('0x58'));if(_0x636eef[_0x53125b]||!_0x46b9ea[_0xc048('0x6d')]||!_0x46b9ea[_0xc048('0x58')]){_0x1a7a57=path['join'](config['root'],_0x2e1488,_[_0xc048('0x60')](_0xc048('0x6c')));}if(!fs['existsSync'](_0x1a7a57)){throw new db[(_0xc048('0x64'))][(_0xc048('0x65'))](_[_0xc048('0x63')](_0xc048('0x58'))+_0xc048('0x66'));}return _0x447762[_0xc048('0x67')](_0x1a7a57);}})[_0xc048('0x25')](handleError(_0x447762,null));};exports[_0xc048('0x6e')]=function(_0x43615d,_0x545264,_0x2cf8ef){if(_0x43615d[_0xc048('0x51')]&&_0x43615d[_0xc048('0x51')][_0xc048('0x53')]){_0x43615d[_0xc048('0x4e')][_0xc048('0x59')]=_0x43615d[_0xc048('0x51')][_0xc048('0x53')];}return db[_0xc048('0x35')][_0xc048('0x4f')]({'where':{'id':_0x43615d[_0xc048('0x4a')]['id']}})[_0xc048('0x1b')](handleEntityNotFound(_0x545264,null))[_0xc048('0x1b')](saveUpdates(_0x43615d[_0xc048('0x4e')],null))['then'](respondWithResult(_0x545264,null))[_0xc048('0x25')](handleError(_0x545264,null));};var utilLicense=require(_0xc048('0x17'));exports[_0xc048('0x6f')]=function(_0x3dd80b,_0x13717d,_0x1d55f8){var _0x499155='server/files/images/logos';var _0x44010e={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x594e0b){if(_0x594e0b){_0x44010e=_0x594e0b;}return db[_0xc048('0x35')]['find']({'where':{'id':_0x3dd80b[_0xc048('0x4a')]['id']},'attributes':['logo',_0xc048('0x54'),_0xc048('0x58'),_0xc048('0x59'),'defaultLogo','defaultLoginLogo',_0xc048('0x5b'),_0xc048('0x5c')],'raw':!![]});})[_0xc048('0x1b')](handleEntityNotFound(_0x13717d,null))['then'](function(_0x327ac4){if(_0x327ac4){var _0x198d26=_0x327ac4[_0xc048('0x59')]&&fs['existsSync'](path[_0xc048('0x5e')](config[_0xc048('0x5f')],_0x499155,_['toLower'](_0x327ac4['favicon'])))?path[_0xc048('0x5e')](config[_0xc048('0x5f')],_0x499155,_[_0xc048('0x60')](_0x327ac4[_0xc048('0x59')])):path['join'](config[_0xc048('0x5f')],_0x499155,_['toLower'](_0xc048('0x70')));var _0x2f8b1a=_0xc048('0x62')+_['upperFirst'](_0xc048('0x59'));if(_0x327ac4[_0x2f8b1a]||!_0x44010e[_0xc048('0x6d')]){_0x198d26=path['join'](config['root'],_0x499155,_['toLower'](_0xc048('0x70')));}if(!fs[_0xc048('0x5d')](_0x198d26)){throw new db[(_0xc048('0x64'))][(_0xc048('0x65'))](_[_0xc048('0x63')](_0xc048('0x59'))+_0xc048('0x66'));}return _0x13717d['download'](_0x198d26);}})['catch'](handleError(_0x13717d,null));};exports['getDate']=function(_0x37fcd1,_0x11dbfe){var _0x1d6e50={'offset':moment()['utcOffset']()};_0x1d6e50[_0xc048('0x71')]=moment()[_0xc048('0x72')](_0x1d6e50[_0xc048('0x29')])[_0xc048('0x73')](_0xc048('0x74'));return _0x11dbfe[_0xc048('0x27')](0xc8)['send'](_0x1d6e50);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 70cd0ae..a81cd92 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0x55ca,0x126));var _0xa55c=function(_0x55bd12,_0x3ccb52){_0x55bd12=_0x55bd12-0x0;var _0x1941dd=_0x55ca[_0x55bd12];return _0x1941dd;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x7217,0x19e));var _0x7721=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x7217[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'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 8dea5d2..f6a85e5 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 _0x132d=['../../config/utils','rpc','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','ShowSetting','find','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x3c105b,_0x462b53){var _0x27a3e4=function(_0x566b8e){while(--_0x566b8e){_0x3c105b['push'](_0x3c105b['shift']());}};_0x27a3e4(++_0x462b53);}(_0x132d,0x73));var _0xd132=function(_0x4dd1d4,_0x3530ff){_0x4dd1d4=_0x4dd1d4-0x0;var _0x18f3bd=_0x132d[_0x4dd1d4];return _0x18f3bd;};'use strict';var _=require(_0xd132('0x0'));var util=require(_0xd132('0x1'));var moment=require(_0xd132('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd132('0x3'));var db=require(_0xd132('0x4'))['db'];var utils=require(_0xd132('0x5'));var logger=require('../../config/logger')(_0xd132('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd132('0x7')][_0xd132('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xab84cc,_0x414de1,_0x337694){return new BPromise(function(_0x156377,_0x23d621){return client[_0xd132('0x9')](_0xab84cc,_0x337694)[_0xd132('0xa')](function(_0x2c8f3f){logger[_0xd132('0xb')](_0xd132('0xc'),_0x414de1,'request\x20sent');logger[_0xd132('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x414de1,_0xd132('0xe'),JSON['stringify'](_0x2c8f3f));if(_0x2c8f3f[_0xd132('0xf')]){if(_0x2c8f3f[_0xd132('0xf')][_0xd132('0x10')]===0x1f4){logger[_0xd132('0xf')](_0xd132('0xc'),_0x414de1,_0x2c8f3f[_0xd132('0xf')][_0xd132('0x11')]);return _0x23d621(_0x2c8f3f['error'][_0xd132('0x11')]);}logger[_0xd132('0xf')]('Setting,\x20%s,\x20%s',_0x414de1,_0x2c8f3f[_0xd132('0xf')]['message']);return _0x156377(_0x2c8f3f[_0xd132('0xf')]['message']);}else{logger[_0xd132('0xb')](_0xd132('0xc'),_0x414de1,_0xd132('0xe'));_0x156377(_0x2c8f3f[_0xd132('0x12')][_0xd132('0x11')]);}})[_0xd132('0x13')](function(_0x145710){logger['error']('Setting,\x20%s,\x20%s',_0x414de1,_0x145710);_0x23d621(_0x145710);});});}exports[_0xd132('0x14')]=function(_0x26c0bf){var _0xd7aa0b=this;return new Promise(function(_0x152abf,_0x5ada7b){return db['Setting'][_0xd132('0x15')]({'raw':_0x26c0bf[_0xd132('0x16')]?_0x26c0bf['options'][_0xd132('0x17')]===undefined?!![]:![]:!![],'where':_0x26c0bf[_0xd132('0x16')]?_0x26c0bf[_0xd132('0x16')][_0xd132('0x18')]||null:null,'attributes':_0x26c0bf['options']?_0x26c0bf[_0xd132('0x16')][_0xd132('0x19')]||null:null,'include':_0x26c0bf[_0xd132('0x16')]?_0x26c0bf[_0xd132('0x16')][_0xd132('0x1a')]?_[_0xd132('0x1b')](_0x26c0bf['options'][_0xd132('0x1a')],function(_0x3980b7){return{'model':db[_0x3980b7[_0xd132('0x1c')]],'as':_0x3980b7['as'],'attributes':_0x3980b7[_0xd132('0x19')],'include':_0x3980b7['include']?_[_0xd132('0x1b')](_0x3980b7['include'],function(_0x166fb6){return{'model':db[_0x166fb6[_0xd132('0x1c')]],'as':_0x166fb6['as'],'attributes':_0x166fb6[_0xd132('0x19')],'include':_0x166fb6[_0xd132('0x1a')]?_[_0xd132('0x1b')](_0x166fb6[_0xd132('0x1a')],function(_0x3644ea){return{'model':db[_0x3644ea[_0xd132('0x1c')]],'as':_0x3644ea['as'],'attributes':_0x3644ea[_0xd132('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd132('0xa')](function(_0x270000){logger['info'](_0xd132('0x14'),_0x26c0bf);logger[_0xd132('0xd')]('ShowSetting',_0x26c0bf,JSON[_0xd132('0x1d')](_0x270000));_0x152abf(_0x270000);})[_0xd132('0x13')](function(_0x42a9d3){logger[_0xd132('0xf')](_0xd132('0x14'),_0x42a9d3[_0xd132('0x11')],_0x26c0bf);_0x5ada7b(_0xd7aa0b[_0xd132('0xf')](0x1f4,_0x42a9d3['message']));});});}; \ No newline at end of file +var _0xc65f=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ShowSetting','find','options','raw','where','attributes','include','model','map','debug','lodash'];(function(_0x4b180c,_0x1a73cb){var _0x3edcf5=function(_0x5d9365){while(--_0x5d9365){_0x4b180c['push'](_0x4b180c['shift']());}};_0x3edcf5(++_0x1a73cb);}(_0xc65f,0x77));var _0xfc65=function(_0x1e2589,_0x1585dd){_0x1e2589=_0x1e2589-0x0;var _0x294fdf=_0xc65f[_0x1e2589];return _0x294fdf;};'use strict';var _=require(_0xfc65('0x0'));var util=require(_0xfc65('0x1'));var moment=require(_0xfc65('0x2'));var BPromise=require(_0xfc65('0x3'));var rs=require(_0xfc65('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc65('0x5'))['db'];var utils=require(_0xfc65('0x6'));var logger=require(_0xfc65('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfc65('0x8'));var client=jayson[_0xfc65('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c8b50,_0x15f6ff,_0xb2ee3e){return new BPromise(function(_0x5edc86,_0xdee06){return client['request'](_0x5c8b50,_0xb2ee3e)[_0xfc65('0xa')](function(_0x2669b3){logger['info'](_0xfc65('0xb'),_0x15f6ff,_0xfc65('0xc'));logger['debug'](_0xfc65('0xd'),_0x15f6ff,_0xfc65('0xc'),JSON[_0xfc65('0xe')](_0x2669b3));if(_0x2669b3['error']){if(_0x2669b3[_0xfc65('0xf')]['code']===0x1f4){logger[_0xfc65('0xf')](_0xfc65('0xb'),_0x15f6ff,_0x2669b3[_0xfc65('0xf')][_0xfc65('0x10')]);return _0xdee06(_0x2669b3[_0xfc65('0xf')]['message']);}logger[_0xfc65('0xf')]('Setting,\x20%s,\x20%s',_0x15f6ff,_0x2669b3['error']['message']);return _0x5edc86(_0x2669b3[_0xfc65('0xf')][_0xfc65('0x10')]);}else{logger[_0xfc65('0x11')](_0xfc65('0xb'),_0x15f6ff,_0xfc65('0xc'));_0x5edc86(_0x2669b3[_0xfc65('0x12')][_0xfc65('0x10')]);}})[_0xfc65('0x13')](function(_0xf42e1e){logger['error']('Setting,\x20%s,\x20%s',_0x15f6ff,_0xf42e1e);_0xdee06(_0xf42e1e);});});}exports[_0xfc65('0x14')]=function(_0x5026dc){var _0x5b04e4=this;return new Promise(function(_0x2d2f40,_0x21821e){return db['Setting'][_0xfc65('0x15')]({'raw':_0x5026dc[_0xfc65('0x16')]?_0x5026dc['options'][_0xfc65('0x17')]===undefined?!![]:![]:!![],'where':_0x5026dc[_0xfc65('0x16')]?_0x5026dc[_0xfc65('0x16')][_0xfc65('0x18')]||null:null,'attributes':_0x5026dc['options']?_0x5026dc[_0xfc65('0x16')][_0xfc65('0x19')]||null:null,'include':_0x5026dc[_0xfc65('0x16')]?_0x5026dc['options'][_0xfc65('0x1a')]?_['map'](_0x5026dc[_0xfc65('0x16')][_0xfc65('0x1a')],function(_0xff1d12){return{'model':db[_0xff1d12[_0xfc65('0x1b')]],'as':_0xff1d12['as'],'attributes':_0xff1d12['attributes'],'include':_0xff1d12['include']?_[_0xfc65('0x1c')](_0xff1d12[_0xfc65('0x1a')],function(_0x5b63e3){return{'model':db[_0x5b63e3[_0xfc65('0x1b')]],'as':_0x5b63e3['as'],'attributes':_0x5b63e3[_0xfc65('0x19')],'include':_0x5b63e3[_0xfc65('0x1a')]?_[_0xfc65('0x1c')](_0x5b63e3['include'],function(_0x5be9f7){return{'model':db[_0x5be9f7[_0xfc65('0x1b')]],'as':_0x5be9f7['as'],'attributes':_0x5be9f7[_0xfc65('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfc65('0xa')](function(_0xaabbda){logger[_0xfc65('0x11')]('ShowSetting',_0x5026dc);logger[_0xfc65('0x1d')](_0xfc65('0x14'),_0x5026dc,JSON[_0xfc65('0xe')](_0xaabbda));_0x2d2f40(_0xaabbda);})[_0xfc65('0x13')](function(_0x3ae1c1){logger[_0xfc65('0xf')](_0xfc65('0x14'),_0x3ae1c1[_0xfc65('0x10')],_0x5026dc);_0x21821e(_0x5b04e4['error'](0x1f4,_0x3ae1c1[_0xfc65('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 626a0b5..607943d 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 _0x5fc3=['/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/status','statusGet','post','create','/:id/dispositions','addAnswer','/:id/notify','/:id/send','send','status','/:id/users','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','describe'];(function(_0x19692c,_0x584d68){var _0x538892=function(_0x4ae2db){while(--_0x4ae2db){_0x19692c['push'](_0x19692c['shift']());}};_0x538892(++_0x584d68);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x5fc3[_0x1e1965];return _0x1a2e96;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/dispositions',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getAnswers']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x35fc('0x9')]('/:id/interactions',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router[_0x35fc('0x9')](_0x35fc('0x12'),controller[_0x35fc('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x14')]('/',auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x14')](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller['addDisposition']);router[_0x35fc('0x14')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x14')](_0x35fc('0x18'),controller['notify']);router[_0x35fc('0x14')](_0x35fc('0x10'),auth[_0x35fc('0xa')](),controller['addApplications']);router[_0x35fc('0x14')](_0x35fc('0x19'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1a')]);router[_0x35fc('0x14')](_0x35fc('0x12'),controller[_0x35fc('0x1b')]);router[_0x35fc('0x14')](_0x35fc('0x1c'),auth[_0x35fc('0xa')](),controller['addAgents']);router[_0x35fc('0x1d')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1e')]);router[_0x35fc('0x1f')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x20')]);router['delete'](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x21')]);router['delete'](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x22')]);router[_0x35fc('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x35fc('0x23')]);module['exports']=router; \ No newline at end of file +var _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7217,0x19e));var _0x7721=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x7217[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 0448277..21bd982 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 _0xc6ab=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','skebby','connectel','clicksend','plivo','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x2510dd,_0x1c151f){var _0x5573f5=function(_0x2122d2){while(--_0x2122d2){_0x2510dd['push'](_0x2510dd['shift']());}};_0x5573f5(++_0x1c151f);}(_0xc6ab,0x177));var _0xbc6a=function(_0x48457f,_0xfc36d2){_0x48457f=_0x48457f-0x0;var _0x2d591e=_0xc6ab[_0x48457f];return _0x2d591e;};'use strict';var Sequelize=require(_0xbc6a('0x0'));var rs=require(_0xbc6a('0x1'));module[_0xbc6a('0x2')]={'name':{'type':Sequelize[_0xbc6a('0x3')],'unique':_0xbc6a('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xbc6a('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xbc6a('0x3')]},'type':{'type':Sequelize[_0xbc6a('0x5')]('twilio',_0xbc6a('0x6'),_0xbc6a('0x7'),_0xbc6a('0x8'),_0xbc6a('0x9'),'clickatell',_0xbc6a('0xa'),_0xbc6a('0xb'),_0xbc6a('0xc'),_0xbc6a('0xd'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xbc6a('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xbc6a('0x3')]},'apiKey':{'type':Sequelize[_0xbc6a('0x3')]},'applicationId':{'type':Sequelize[_0xbc6a('0x3')]},'accountId':{'type':Sequelize[_0xbc6a('0x3')]},'senderString':{'type':Sequelize[_0xbc6a('0x3')]},'deliveryReport':{'type':Sequelize[_0xbc6a('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xbc6a('0x3')]},'notificationTemplate':{'type':Sequelize[_0xbc6a('0xf')],'defaultValue':function(){return _0xbc6a('0x10');}},'notificationSound':{'type':Sequelize[_0xbc6a('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbc6a('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbc6a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbc6a('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbc6a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbc6a('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbc6a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xbc6a('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbc6a('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbc6a('0x12'),'set':function(_0x3749f0){if(!_0x3749f0)this[_0xbc6a('0x13')](_0xbc6a('0x14'),null);this[_0xbc6a('0x13')](_0xbc6a('0x15'),_0x3749f0);}}}; \ No newline at end of file +var _0x8edb=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x97034e,_0xc1f3f2){var _0x31a4a3=function(_0x140a1a){while(--_0x140a1a){_0x97034e['push'](_0x97034e['shift']());}};_0x31a4a3(++_0xc1f3f2);}(_0x8edb,0x10c));var _0xb8ed=function(_0x444416,_0x2b11f4){_0x444416=_0x444416-0x0;var _0x22b20b=_0x8edb[_0x444416];return _0x22b20b;};'use strict';var Sequelize=require(_0xb8ed('0x0'));var rs=require(_0xb8ed('0x1'));module['exports']={'name':{'type':Sequelize[_0xb8ed('0x2')],'unique':_0xb8ed('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xb8ed('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xb8ed('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xb8ed('0x2')],'defaultValue':function(){return rs[_0xb8ed('0x4')]();}},'phone':{'type':Sequelize[_0xb8ed('0x2')]},'type':{'type':Sequelize[_0xb8ed('0x5')](_0xb8ed('0x6'),_0xb8ed('0x7'),_0xb8ed('0x8'),_0xb8ed('0x9'),_0xb8ed('0xa'),_0xb8ed('0xb'),_0xb8ed('0xc'),_0xb8ed('0xd'),_0xb8ed('0xe'),_0xb8ed('0xf'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xb8ed('0x2')]},'authToken':{'type':Sequelize[_0xb8ed('0x2')]},'smsMethod':{'type':Sequelize[_0xb8ed('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb8ed('0x2')]},'apiKey':{'type':Sequelize[_0xb8ed('0x2')]},'applicationId':{'type':Sequelize[_0xb8ed('0x2')]},'accountId':{'type':Sequelize[_0xb8ed('0x2')]},'senderString':{'type':Sequelize[_0xb8ed('0x2')]},'deliveryReport':{'type':Sequelize[_0xb8ed('0x10')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb8ed('0x11')],'defaultValue':function(){return _0xb8ed('0x12');}},'notificationSound':{'type':Sequelize[_0xb8ed('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb8ed('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb8ed('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb8ed('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb8ed('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb8ed('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xb8ed('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xb8ed('0x10')],'defaultValue':![],'comment':_0xb8ed('0x15'),'set':function(_0x108bf0){if(!_0x108bf0)this['setDataValue'](_0xb8ed('0x16'),null);this[_0xb8ed('0x17')]('mandatoryDisposition',_0x108bf0);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 9204c42..6865497 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 _0x06f3=['ListId','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','status_code','groupName','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./smsAccount.socket','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','stack','name','index','Pause','map','SmsAccount','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','mandatoryDispositionPause','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','SmsAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','notify','SmsApplication','Applications','account','applications','orderBy','priority','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','mobile','type','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','ValidationError','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','created','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','send','getApplications','getInteractions','User','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List'];(function(_0x51a939,_0x20e740){var _0x1250f4=function(_0x21a8e0){while(--_0x21a8e0){_0x51a939['push'](_0x51a939['shift']());}};_0x1250f4(++_0x20e740);}(_0x06f3,0x1e9));var _0x306f=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x06f3[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x306f('0x0'));var rimraf=require(_0x306f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x306f('0x2'));var rp=require(_0x306f('0x3'));var moment=require('moment');var BPromise=require(_0x306f('0x4'));var Mustache=require(_0x306f('0x5'));var util=require(_0x306f('0x6'));var path=require('path');var sox=require(_0x306f('0x7'));var csv=require(_0x306f('0x8'));var ejs=require(_0x306f('0x9'));var fs=require('fs');var fs_extra=require(_0x306f('0xa'));var _=require('lodash');var squel=require(_0x306f('0xb'));var crypto=require(_0x306f('0xc'));var jsforce=require(_0x306f('0xd'));var deskjs=require(_0x306f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x306f('0xf'));var Papa=require('papaparse');var Redis=require(_0x306f('0x10'));var authService=require(_0x306f('0x11'));var qs=require(_0x306f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x306f('0x13'))(_0x306f('0x14'));var utils=require(_0x306f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x306f('0x16'));var db=require('../../mysqldb')['db'];config[_0x306f('0x17')]=_[_0x306f('0x18')](config['redis'],{'host':_0x306f('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x306f('0x1a'))['register'](socket);var jayson=require(_0x306f('0x1b'));var client=jayson[_0x306f('0x1c')]['http']({'port':0x232c});function respondWithRpcPromise(_0x51e4be,_0x1ac5eb,_0x1480cd,_0x255b88){return new BPromise(function(_0x1f7f82,_0x33bb5e){var _0x464ffb=_0x255b88||client;return _0x464ffb[_0x306f('0x1d')](_0x51e4be,_0x1480cd)[_0x306f('0x1e')](function(_0x4cf271){logger[_0x306f('0x1f')](_0x306f('0x20'),_0x1ac5eb,_0x306f('0x21'));logger[_0x306f('0x22')](_0x306f('0x23'),_0x1ac5eb,'request\x20sent',JSON[_0x306f('0x24')](_0x4cf271));if(_0x4cf271['error']){if(_0x4cf271[_0x306f('0x25')][_0x306f('0x26')]===0x1f4){logger[_0x306f('0x25')](_0x306f('0x20'),_0x1ac5eb,_0x4cf271['error'][_0x306f('0x27')]);return _0x33bb5e(_0x4cf271[_0x306f('0x25')]['message']);}logger[_0x306f('0x25')](_0x306f('0x20'),_0x1ac5eb,_0x4cf271['error'][_0x306f('0x27')]);return _0x1f7f82(_0x4cf271['error'][_0x306f('0x27')]);}else{logger[_0x306f('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x1ac5eb,_0x306f('0x21'));_0x1f7f82(_0x4cf271[_0x306f('0x28')]['message']);}})[_0x306f('0x29')](function(_0x8af5a6){logger[_0x306f('0x25')]('SmsAccount,\x20%s,\x20%s',_0x1ac5eb,_0x8af5a6);_0x33bb5e(_0x8af5a6);});});}function respondWithStatusCode(_0x104481,_0x5db789){_0x5db789=_0x5db789||0xcc;return function(_0x5e609f){if(_0x5e609f){return _0x104481[_0x306f('0x2a')](_0x5db789);}return _0x104481['status'](_0x5db789)[_0x306f('0x2b')]();};}function respondWithResult(_0x2ff908,_0x409227){_0x409227=_0x409227||0xc8;return function(_0x325941){if(_0x325941){return _0x2ff908[_0x306f('0x2c')](_0x409227)[_0x306f('0x2d')](_0x325941);}};}function respondWithFilteredResult(_0x49e2fb,_0x1423c9){return function(_0x53fbe9){if(_0x53fbe9){var _0x4061ac=typeof _0x1423c9[_0x306f('0x2e')]==='undefined'&&typeof _0x1423c9[_0x306f('0x2f')]==='undefined';var _0x5f0666=_0x53fbe9[_0x306f('0x30')];var _0x561e96=_0x4061ac?0x0:_0x1423c9[_0x306f('0x2e')];var _0x3df700=_0x4061ac?_0x53fbe9[_0x306f('0x30')]:_0x1423c9[_0x306f('0x2e')]+_0x1423c9['limit'];var _0x3c07c4;if(_0x3df700>=_0x5f0666){_0x3df700=_0x5f0666;_0x3c07c4=0xc8;}else{_0x3c07c4=0xce;}_0x49e2fb[_0x306f('0x2c')](_0x3c07c4);return _0x49e2fb[_0x306f('0x31')](_0x306f('0x32'),_0x561e96+'-'+_0x3df700+'/'+_0x5f0666)[_0x306f('0x2d')](_0x53fbe9);}return null;};}function patchUpdates(_0x123b5c){return function(_0x22982e){try{jsonpatch[_0x306f('0x33')](_0x22982e,_0x123b5c,!![]);}catch(_0x572221){return BPromise[_0x306f('0x34')](_0x572221);}return _0x22982e[_0x306f('0x35')]();};}function saveUpdates(_0x2aa899,_0x56e9e7){return function(_0x2c9125){if(_0x2c9125){return _0x2c9125[_0x306f('0x36')](_0x2aa899)[_0x306f('0x1e')](function(_0x514cfb){return _0x514cfb;});}return null;};}function removeEntity(_0x1dbd96,_0x3b36b5){return function(_0x12daa5){if(_0x12daa5){return _0x12daa5[_0x306f('0x37')]()[_0x306f('0x1e')](function(){var _0x5d03ef=_0x12daa5[_0x306f('0x38')]({'plain':!![]});var _0x1a11fa=_0x306f('0x39');return db['UserProfileResource'][_0x306f('0x37')]({'where':{'type':_0x1a11fa,'resourceId':_0x5d03ef['id']}})['then'](function(){return _0x12daa5;});})[_0x306f('0x1e')](function(){_0x1dbd96[_0x306f('0x2c')](0xcc)[_0x306f('0x2b')]();});}};}function handleEntityNotFound(_0x18ccdc,_0x1502d7){return function(_0x194ed7){if(!_0x194ed7){_0x18ccdc[_0x306f('0x2a')](0x194);}return _0x194ed7;};}function handleError(_0x5c6e34,_0xa1a513){_0xa1a513=_0xa1a513||0x1f4;return function(_0x3fba9d){logger['error'](_0x3fba9d[_0x306f('0x3a')]);if(_0x3fba9d['name']){delete _0x3fba9d[_0x306f('0x3b')];}_0x5c6e34['status'](_0xa1a513)['send'](_0x3fba9d);};}exports[_0x306f('0x3c')]=function(_0x58df42,_0x519f71){var _0x44b8ae={'include':[{'model':db[_0x306f('0x3d')],'as':'mandatoryDispositionPause'}]},_0x49cc61={},_0x40238c={'count':0x0,'rows':[]};var _0x257553=_[_0x306f('0x3e')](db[_0x306f('0x3f')][_0x306f('0x40')],function(_0x45119e){return{'name':_0x45119e[_0x306f('0x41')],'type':_0x45119e['type']['key']};});_0x49cc61[_0x306f('0x42')]=_[_0x306f('0x3e')](_0x257553,'name');_0x49cc61[_0x306f('0x43')]=_[_0x306f('0x44')](_0x58df42['query']);_0x49cc61['filters']=_['intersection'](_0x49cc61[_0x306f('0x42')],_0x49cc61['query']);_0x44b8ae[_0x306f('0x45')]=_[_0x306f('0x46')](_0x49cc61[_0x306f('0x42')],qs[_0x306f('0x47')](_0x58df42[_0x306f('0x43')][_0x306f('0x47')]));_0x44b8ae[_0x306f('0x45')]=_0x44b8ae[_0x306f('0x45')][_0x306f('0x48')]?_0x44b8ae[_0x306f('0x45')]:_0x49cc61['model'];if(!_0x58df42[_0x306f('0x43')][_0x306f('0x49')](_0x306f('0x4a'))){_0x44b8ae[_0x306f('0x2f')]=qs[_0x306f('0x2f')](_0x58df42['query']['limit']);_0x44b8ae['offset']=qs[_0x306f('0x2e')](_0x58df42[_0x306f('0x43')][_0x306f('0x2e')]);}_0x44b8ae[_0x306f('0x4b')]=qs[_0x306f('0x4c')](_0x58df42[_0x306f('0x43')][_0x306f('0x4c')]);_0x44b8ae[_0x306f('0x4d')]=qs['filters'](_[_0x306f('0x4e')](_0x58df42[_0x306f('0x43')],_0x49cc61[_0x306f('0x4f')]),_0x257553);if(_0x58df42[_0x306f('0x43')][_0x306f('0x50')]){_0x44b8ae['where']=_[_0x306f('0x51')](_0x44b8ae[_0x306f('0x4d')],{'$or':_['map'](_0x257553,function(_0x361d7e){if(_0x361d7e['type']!==_0x306f('0x52')){var _0x5a6a59={};_0x5a6a59[_0x361d7e[_0x306f('0x3b')]]={'$like':'%'+_0x58df42['query'][_0x306f('0x50')]+'%'};return _0x5a6a59;}})});}_0x44b8ae=_[_0x306f('0x51')]({},_0x44b8ae,_0x58df42['options']);var _0x46711c={'where':_0x44b8ae['where']};return db[_0x306f('0x3f')]['count'](_0x46711c)[_0x306f('0x1e')](function(_0x4d78ef){_0x40238c[_0x306f('0x30')]=_0x4d78ef;if(_0x58df42[_0x306f('0x43')][_0x306f('0x53')]){_0x44b8ae[_0x306f('0x54')]=[{'all':!![]}];}return db[_0x306f('0x3f')][_0x306f('0x55')](_0x44b8ae);})[_0x306f('0x1e')](function(_0x373fb3){_0x40238c[_0x306f('0x56')]=_0x373fb3;return _0x40238c;})[_0x306f('0x1e')](respondWithFilteredResult(_0x519f71,_0x44b8ae))['catch'](handleError(_0x519f71,null));};exports[_0x306f('0x57')]=function(_0xb1c211,_0x3b8018){var _0x5e92a9={'raw':![],'where':{'id':_0xb1c211['params']['id']},'include':[{'model':db[_0x306f('0x3d')],'as':_0x306f('0x58')}]},_0xcb8b1={};_0xcb8b1[_0x306f('0x42')]=_[_0x306f('0x44')](db[_0x306f('0x3f')]['rawAttributes']);_0xcb8b1['query']=_[_0x306f('0x44')](_0xb1c211[_0x306f('0x43')]);_0xcb8b1[_0x306f('0x4f')]=_['intersection'](_0xcb8b1[_0x306f('0x42')],_0xcb8b1[_0x306f('0x43')]);_0x5e92a9[_0x306f('0x45')]=_['intersection'](_0xcb8b1[_0x306f('0x42')],qs[_0x306f('0x47')](_0xb1c211[_0x306f('0x43')][_0x306f('0x47')]));_0x5e92a9[_0x306f('0x45')]=_0x5e92a9['attributes'][_0x306f('0x48')]?_0x5e92a9[_0x306f('0x45')]:_0xcb8b1[_0x306f('0x42')];if(_0xb1c211['query'][_0x306f('0x53')]){_0x5e92a9[_0x306f('0x54')]=[{'all':!![]}];}_0x5e92a9=_[_0x306f('0x51')]({},_0x5e92a9,_0xb1c211[_0x306f('0x59')]);return db['SmsAccount'][_0x306f('0x5a')](_0x5e92a9)['then'](handleEntityNotFound(_0x3b8018,null))['then'](respondWithResult(_0x3b8018,null))[_0x306f('0x29')](handleError(_0x3b8018,null));};exports['create']=function(_0x4fbf30,_0xc030a){return db[_0x306f('0x3f')]['create'](_0x4fbf30[_0x306f('0x5b')],{})['then'](function(_0x5c17dc){var _0x48109c=_0x4fbf30[_0x306f('0x5c')]['get']({'plain':!![]});if(!_0x48109c)throw new Error(_0x306f('0x5d'));if(_0x48109c[_0x306f('0x5e')]===_0x306f('0x5c')){var _0x3f9f8f=_0x5c17dc[_0x306f('0x38')]({'plain':!![]});var _0x466152=_0x306f('0x39');return db[_0x306f('0x5f')]['find']({'where':{'name':_0x466152,'userProfileId':_0x48109c['userProfileId']},'raw':!![]})[_0x306f('0x1e')](function(_0x1df7ec){if(_0x1df7ec&&_0x1df7ec['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3f9f8f[_0x306f('0x3b')],'resourceId':_0x3f9f8f['id'],'type':_0x1df7ec[_0x306f('0x3b')],'sectionId':_0x1df7ec['id']},{})[_0x306f('0x1e')](function(){return _0x5c17dc;});}else{return _0x5c17dc;}})[_0x306f('0x29')](function(_0x5540e5){logger[_0x306f('0x25')](_0x306f('0x60'),_0x5540e5);throw _0x5540e5;});}return _0x5c17dc;})[_0x306f('0x1e')](respondWithResult(_0xc030a,0xc9))[_0x306f('0x29')](handleError(_0xc030a,null));};exports[_0x306f('0x36')]=function(_0x52408f,_0x3c0704){if(_0x52408f[_0x306f('0x5b')]['id']){delete _0x52408f['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x52408f[_0x306f('0x61')]['id']},'include':[{'model':db['Pause'],'as':_0x306f('0x58')}]})[_0x306f('0x1e')](handleEntityNotFound(_0x3c0704,null))['then'](saveUpdates(_0x52408f[_0x306f('0x5b')],null))[_0x306f('0x1e')](respondWithResult(_0x3c0704,null))[_0x306f('0x29')](handleError(_0x3c0704,null));};exports['destroy']=function(_0x21af1a,_0x294279){return db[_0x306f('0x3f')]['find']({'where':{'id':_0x21af1a[_0x306f('0x61')]['id']}})[_0x306f('0x1e')](handleEntityNotFound(_0x294279,null))[_0x306f('0x1e')](removeEntity(_0x294279,null))[_0x306f('0x29')](handleError(_0x294279,null));};exports[_0x306f('0x62')]=function(_0x389d73,_0x2541f7){return db[_0x306f('0x3f')]['describe']()['then'](respondWithResult(_0x2541f7,null))[_0x306f('0x29')](handleError(_0x2541f7,null));};exports['addDisposition']=function(_0x970469,_0x4e0bac,_0x48109b){if(_0x970469[_0x306f('0x5b')]['id']){delete _0x970469[_0x306f('0x5b')]['id'];}return db[_0x306f('0x3f')][_0x306f('0x5a')]({'where':{'id':_0x970469['params']['id']}})[_0x306f('0x1e')](handleEntityNotFound(_0x4e0bac,null))[_0x306f('0x1e')](function(_0x195c3f){if(_0x195c3f){_0x970469[_0x306f('0x5b')][_0x306f('0x63')]=_0x195c3f['id'];return db[_0x306f('0x64')][_0x306f('0x65')](_0x970469[_0x306f('0x5b')]);}})[_0x306f('0x1e')](respondWithResult(_0x4e0bac,null))[_0x306f('0x29')](handleError(_0x4e0bac,null));};exports[_0x306f('0x66')]=function(_0x3e149d,_0x26f714,_0x5dcb4d){var _0x5ebb7e={'raw':![],'where':{}};var _0x149e25={};var _0x287471={'count':0x0,'rows':[]};return db['SmsAccount'][_0x306f('0x67')]({'where':{'id':_0x3e149d[_0x306f('0x61')]['id']}})[_0x306f('0x1e')](handleEntityNotFound(_0x26f714,null))['then'](function(_0x58ec61){if(_0x58ec61){_0x149e25[_0x306f('0x42')]=_['keys'](db[_0x306f('0x64')][_0x306f('0x40')]);_0x149e25[_0x306f('0x43')]=_['keys'](_0x3e149d['query']);_0x149e25[_0x306f('0x4f')]=_[_0x306f('0x46')](_0x149e25[_0x306f('0x42')],_0x149e25[_0x306f('0x43')]);_0x5ebb7e[_0x306f('0x45')]=_[_0x306f('0x46')](_0x149e25[_0x306f('0x42')],qs[_0x306f('0x47')](_0x3e149d[_0x306f('0x43')][_0x306f('0x47')]));_0x5ebb7e['attributes']=_0x5ebb7e['attributes'][_0x306f('0x48')]?_0x5ebb7e[_0x306f('0x45')]:_0x149e25[_0x306f('0x42')];if(!_0x3e149d[_0x306f('0x43')][_0x306f('0x49')]('nolimit')){_0x5ebb7e[_0x306f('0x2f')]=qs[_0x306f('0x2f')](_0x3e149d[_0x306f('0x43')][_0x306f('0x2f')]);_0x5ebb7e['offset']=qs[_0x306f('0x2e')](_0x3e149d[_0x306f('0x43')][_0x306f('0x2e')]);}_0x5ebb7e['order']=qs[_0x306f('0x4c')](_0x3e149d['query'][_0x306f('0x4c')]);_0x5ebb7e[_0x306f('0x4d')]=qs[_0x306f('0x4f')](_['pick'](_0x3e149d['query'],_0x149e25[_0x306f('0x4f')]));_0x5ebb7e[_0x306f('0x4d')][_0x306f('0x63')]=_0x58ec61['id'];if(_0x3e149d[_0x306f('0x43')]['filter']){_0x5ebb7e[_0x306f('0x4d')]=_['merge'](_0x5ebb7e[_0x306f('0x4d')],{'$or':_[_0x306f('0x3e')](_0x5ebb7e['attributes'],function(_0x4d72ac){var _0x1d1737={};_0x1d1737[_0x4d72ac]={'$like':'%'+_0x3e149d[_0x306f('0x43')][_0x306f('0x50')]+'%'};return _0x1d1737;})});}_0x5ebb7e=_[_0x306f('0x51')]({},_0x5ebb7e,_0x3e149d['options']);return db[_0x306f('0x64')][_0x306f('0x30')]({'where':_0x5ebb7e['where']})[_0x306f('0x1e')](function(_0x814e80){_0x287471['count']=_0x814e80;if(_0x3e149d[_0x306f('0x43')][_0x306f('0x53')]){_0x5ebb7e[_0x306f('0x54')]=[{'all':!![]}];}return db[_0x306f('0x64')]['findAll'](_0x5ebb7e);})[_0x306f('0x1e')](function(_0x309e45){_0x287471[_0x306f('0x56')]=_0x309e45;return _0x287471;});}})[_0x306f('0x1e')](respondWithFilteredResult(_0x26f714,_0x5ebb7e))[_0x306f('0x29')](handleError(_0x26f714,null));};exports[_0x306f('0x68')]=function(_0x2676fd,_0x16a122,_0x922c49){return db[_0x306f('0x3f')]['find']({'where':{'id':_0x2676fd[_0x306f('0x61')]['id']}})[_0x306f('0x1e')](handleEntityNotFound(_0x16a122,null))['then'](function(_0x29f70e){if(_0x29f70e){return _0x29f70e['removeDispositions'](_0x2676fd[_0x306f('0x43')][_0x306f('0x69')]);}})[_0x306f('0x1e')](respondWithStatusCode(_0x16a122,null))[_0x306f('0x29')](handleError(_0x16a122,null));};exports['addAnswer']=function(_0x462b3e,_0x10e87d,_0x4d9eaf){if(_0x462b3e[_0x306f('0x5b')]['id']){delete _0x462b3e[_0x306f('0x5b')]['id'];}return db[_0x306f('0x3f')][_0x306f('0x5a')]({'where':{'id':_0x462b3e[_0x306f('0x61')]['id']}})[_0x306f('0x1e')](handleEntityNotFound(_0x10e87d,null))[_0x306f('0x1e')](function(_0x36681e){if(_0x36681e){_0x462b3e['body']['SmsAccountId']=_0x36681e['id'];return db['CannedAnswer']['create'](_0x462b3e[_0x306f('0x5b')]);}})[_0x306f('0x1e')](respondWithResult(_0x10e87d,null))[_0x306f('0x29')](handleError(_0x10e87d,null));};exports[_0x306f('0x6a')]=function(_0x24a393,_0x4b29a5,_0x53a971){var _0x9383b9={'raw':![],'where':{}};var _0x33201f={};var _0x8fbb7a={'count':0x0,'rows':[]};return db[_0x306f('0x3f')]['findOne']({'where':{'id':_0x24a393[_0x306f('0x61')]['id']}})['then'](handleEntityNotFound(_0x4b29a5,null))[_0x306f('0x1e')](function(_0x10cfba){if(_0x10cfba){_0x33201f[_0x306f('0x42')]=_['keys'](db[_0x306f('0x6b')][_0x306f('0x40')]);_0x33201f['query']=_[_0x306f('0x44')](_0x24a393[_0x306f('0x43')]);_0x33201f[_0x306f('0x4f')]=_[_0x306f('0x46')](_0x33201f[_0x306f('0x42')],_0x33201f[_0x306f('0x43')]);_0x9383b9['attributes']=_[_0x306f('0x46')](_0x33201f['model'],qs['fields'](_0x24a393[_0x306f('0x43')][_0x306f('0x47')]));_0x9383b9[_0x306f('0x45')]=_0x9383b9[_0x306f('0x45')][_0x306f('0x48')]?_0x9383b9[_0x306f('0x45')]:_0x33201f['model'];if(!_0x24a393[_0x306f('0x43')]['hasOwnProperty'](_0x306f('0x4a'))){_0x9383b9[_0x306f('0x2f')]=qs[_0x306f('0x2f')](_0x24a393[_0x306f('0x43')][_0x306f('0x2f')]);_0x9383b9['offset']=qs[_0x306f('0x2e')](_0x24a393['query']['offset']);}_0x9383b9[_0x306f('0x4b')]=qs[_0x306f('0x4c')](_0x24a393['query'][_0x306f('0x4c')]);_0x9383b9[_0x306f('0x4d')]=qs[_0x306f('0x4f')](_[_0x306f('0x4e')](_0x24a393[_0x306f('0x43')],_0x33201f[_0x306f('0x4f')]));_0x9383b9[_0x306f('0x4d')]['SmsAccountId']=_0x10cfba['id'];if(_0x24a393['query'][_0x306f('0x50')]){_0x9383b9['where']=_[_0x306f('0x51')](_0x9383b9[_0x306f('0x4d')],{'$or':_[_0x306f('0x3e')](_0x9383b9['attributes'],function(_0x3324a7){var _0xfb8a60={};_0xfb8a60[_0x3324a7]={'$like':'%'+_0x24a393[_0x306f('0x43')]['filter']+'%'};return _0xfb8a60;})});}_0x9383b9=_['merge']({},_0x9383b9,_0x24a393['options']);return db[_0x306f('0x6b')][_0x306f('0x30')]({'where':_0x9383b9['where']})[_0x306f('0x1e')](function(_0x7c5322){_0x8fbb7a['count']=_0x7c5322;if(_0x24a393[_0x306f('0x43')]['includeAll']){_0x9383b9['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x9383b9);})[_0x306f('0x1e')](function(_0x20fa70){_0x8fbb7a[_0x306f('0x56')]=_0x20fa70;return _0x8fbb7a;});}})[_0x306f('0x1e')](respondWithFilteredResult(_0x4b29a5,_0x9383b9))[_0x306f('0x29')](handleError(_0x4b29a5,null));};exports[_0x306f('0x6c')]=function(_0x512873,_0x181660,_0x2803a6){return db[_0x306f('0x3f')][_0x306f('0x5a')]({'where':{'id':_0x512873[_0x306f('0x61')]['id']}})['then'](handleEntityNotFound(_0x181660,null))[_0x306f('0x1e')](function(_0x4fa29c){if(_0x4fa29c){return _0x4fa29c[_0x306f('0x6c')](_0x512873['query']['ids']);}})[_0x306f('0x1e')](respondWithStatusCode(_0x181660,null))[_0x306f('0x29')](handleError(_0x181660,null));};exports[_0x306f('0x6d')]=function(_0x12c19e,_0x4070c3,_0x4d13f4){var _0x23f593={'channel':'sms'};var _0x3ad759=[];var _0x51093a=[];var _0x54ce9e={};return db[_0x306f('0x3f')][_0x306f('0x5a')]({'where':{'id':_0x12c19e[_0x306f('0x61')]['id']},'include':[{'model':db[_0x306f('0x6e')],'as':_0x306f('0x6f')}]})[_0x306f('0x1e')](handleEntityNotFound(_0x4070c3,null))[_0x306f('0x1e')](function(_0x433741){_0x23f593[_0x306f('0x70')]=_0x433741;_0x23f593[_0x306f('0x71')]=_[_0x306f('0x72')](_0x433741[_0x306f('0x6f')],[_0x306f('0x73')],['asc']);if(_0x23f593[_0x306f('0x70')][_0x306f('0x6f')]){delete _0x23f593[_0x306f('0x70')][_0x306f('0x6f')];}return db['CmContact']['describe']();})[_0x306f('0x1e')](function(_0x35e406){if(!_0x35e406){throw new db[(_0x306f('0x74'))]['ValidationError'](_0x306f('0x75'));}_0x3ad759=_[_0x306f('0x76')](_[_0x306f('0x44')](_0x35e406),['createdAt',_0x306f('0x77')]);_0x51093a=_[_0x306f('0x76')](_[_0x306f('0x44')](_0x35e406),[_0x306f('0x78'),_0x306f('0x77'),'CompanyId','ListId']);_0x23f593[_0x306f('0x5b')]={'mapKey':_0x306f('0x79')};if(_0x23f593['account'][_0x306f('0x7a')]){switch(_0x23f593['account'][_0x306f('0x7a')]){case _0x306f('0x7b'):_0x23f593[_0x306f('0x5b')][_0x306f('0x7c')]=_0x12c19e[_0x306f('0x5b')][_0x306f('0x7d')];_0x23f593['body'][_0x306f('0x5b')]=_0x12c19e[_0x306f('0x5b')][_0x306f('0x7e')];_0x23f593[_0x306f('0x5b')][_0x306f('0x7f')]=_0x12c19e[_0x306f('0x5b')][_0x306f('0x80')];break;case _0x306f('0x81'):_0x23f593[_0x306f('0x5b')]['from']='+'+_0x12c19e[_0x306f('0x5b')][_0x306f('0x82')];_0x23f593['body']['body']=_0x12c19e[_0x306f('0x5b')][_0x306f('0x83')];break;case _0x306f('0x84'):_0x23f593[_0x306f('0x5b')][_0x306f('0x7c')]=_0x12c19e['body'][_0x306f('0x7c')];_0x23f593[_0x306f('0x5b')][_0x306f('0x5b')]=_0x12c19e['body'][_0x306f('0x27')];break;case _0x306f('0x85'):_0x23f593[_0x306f('0x5b')][_0x306f('0x7c')]=_0x12c19e[_0x306f('0x5b')][_0x306f('0x7c')];_0x23f593['body'][_0x306f('0x5b')]=_0x12c19e[_0x306f('0x5b')][_0x306f('0x5b')];_0x23f593[_0x306f('0x5b')][_0x306f('0x7f')]=_0x12c19e['body'][_0x306f('0x86')];break;case _0x306f('0x87'):_0x23f593[_0x306f('0x5b')][_0x306f('0x7c')]=_0x12c19e[_0x306f('0x5b')]['From'];_0x23f593[_0x306f('0x5b')][_0x306f('0x5b')]=_0x12c19e[_0x306f('0x5b')][_0x306f('0x88')];_0x23f593[_0x306f('0x5b')][_0x306f('0x7f')]=_0x12c19e['body'][_0x306f('0x89')];break;case _0x306f('0x8a'):_0x23f593['body'][_0x306f('0x7c')]='+'+_0x12c19e[_0x306f('0x5b')][_0x306f('0x8b')][0x0][_0x306f('0x7c')];_0x23f593['body'][_0x306f('0x5b')]=_0x12c19e[_0x306f('0x5b')]['results'][0x0]['text'];_0x23f593[_0x306f('0x5b')][_0x306f('0x7f')]=_0x12c19e[_0x306f('0x5b')][_0x306f('0x8b')][0x0][_0x306f('0x7f')];break;case'csc':_0x23f593[_0x306f('0x5b')][_0x306f('0x7c')]=_0x12c19e[_0x306f('0x5b')][_0x306f('0x8c')];_0x23f593['body']['body']=_0x12c19e['body'][_0x306f('0x8d')]['message'];break;case _0x306f('0x8e'):_0x23f593[_0x306f('0x5b')][_0x306f('0x7c')]=_0x12c19e['body'][_0x306f('0x8f')];_0x23f593[_0x306f('0x5b')][_0x306f('0x5b')]=_0x12c19e[_0x306f('0x5b')][_0x306f('0x83')];_0x23f593[_0x306f('0x5b')]['messageId']=_0x12c19e[_0x306f('0x5b')][_0x306f('0x90')];break;case _0x306f('0x91'):_0x23f593['body'][_0x306f('0x7f')]=_0x12c19e[_0x306f('0x5b')][0x0][_0x306f('0x27')]['id'];_0x23f593[_0x306f('0x5b')]['from']=_0x12c19e[_0x306f('0x5b')][0x0][_0x306f('0x27')][_0x306f('0x7c')];_0x23f593['body'][_0x306f('0x5b')]=_0x12c19e[_0x306f('0x5b')][0x0][_0x306f('0x27')]['text'];break;case _0x306f('0x92'):_0x23f593[_0x306f('0x5b')]['from']=_0x12c19e[_0x306f('0x5b')][_0x306f('0x7c')];_0x23f593['body'][_0x306f('0x5b')]=_0x12c19e[_0x306f('0x5b')][_0x306f('0x27')];_0x23f593[_0x306f('0x5b')][_0x306f('0x7f')]=_0x12c19e['body'][_0x306f('0x93')];break;}}if(_0x23f593[_0x306f('0x5b')]['id']){delete _0x23f593[_0x306f('0x5b')]['id'];}if(_[_0x306f('0x94')](_0x23f593[_0x306f('0x5b')][_0x306f('0x7c')])){throw new db[(_0x306f('0x74'))]['ValidationError'](_0x306f('0x95'));}if(_[_0x306f('0x94')](_0x23f593['body'][_0x306f('0x5b')])||_0x23f593['body'][_0x306f('0x5b')]===''){throw new db[(_0x306f('0x74'))]['ValidationError'](_0x306f('0x96'));}if(_[_0x306f('0x94')](_0x23f593[_0x306f('0x5b')][_0x306f('0x97')])){throw new db[(_0x306f('0x74'))]['ValidationError'](_0x306f('0x98')+_0x51093a);}if(!_[_0x306f('0x99')](_0x51093a,_0x23f593[_0x306f('0x5b')][_0x306f('0x97')])){throw new db[(_0x306f('0x74'))][(_0x306f('0x9a'))](_0x306f('0x9b')+_0x51093a);}_0x54ce9e[_0x23f593[_0x306f('0x5b')]['mapKey']]=_0x23f593['body'][_0x306f('0x7c')];return db[_0x306f('0x9c')][_0x306f('0x5a')]({'where':{'id':_0x23f593[_0x306f('0x70')]['ListId']},'include':[{'model':db[_0x306f('0x9d')],'as':_0x306f('0x9e'),'where':_0x54ce9e,'limit':0x1,'order':[[_0x306f('0x77'),_0x306f('0x9f')]]}]});})[_0x306f('0x1e')](handleEntityNotFound(_0x4070c3,null))[_0x306f('0x1e')](function(_0x400aa6){if(_0x400aa6){_0x23f593[_0x306f('0xa0')]=_[_0x306f('0xa1')](_0x400aa6,['Contacts']);if(_0x400aa6['Contacts']['length']){return _0x400aa6['Contacts'][0x0];}var _0x26600f=_['defaults'](_0x23f593[_0x306f('0x5b')],{'firstName':_0x23f593[_0x306f('0x5b')][_0x306f('0x7c')],'ListId':_0x400aa6['id']});_0x26600f[_0x23f593[_0x306f('0x5b')]['mapKey']]=_0x23f593[_0x306f('0x5b')][_0x306f('0x7c')];return db[_0x306f('0x9d')][_0x306f('0x65')](_0x26600f,{'fields':_0x3ad759,'raw':!![]});}})[_0x306f('0x1e')](handleEntityNotFound(_0x4070c3,null))['then'](function(_0x431a52){if(_0x431a52){_0x23f593['contact']=_0x431a52;var _0x1a67da={'ContactId':_0x431a52['id'],'phone':_0x23f593[_0x306f('0x5b')][_0x306f('0x7c')],'SmsAccountId':_0x12c19e['params']['id']};var _0x4e6cfe={'ContactId':_0x431a52['id'],'SmsAccountId':_0x12c19e[_0x306f('0x61')]['id'],'closed':![]};return db[_0x306f('0xa2')][_0x306f('0x5a')]({'where':_0x4e6cfe})[_0x306f('0x1e')](function(_0x3f565a){if(_0x3f565a){return[_0x3f565a,![]];}return db[_0x306f('0xa2')][_0x306f('0x65')](_0x1a67da)['then'](function(_0x245aec){return[_0x245aec,!![]];});});}})[_0x306f('0xa3')](function(_0x5d03d5,_0xa408c7){_0x23f593['interaction']=_0x5d03d5[_0x306f('0x38')]({'plain':!![]});_0x23f593[_0x306f('0xa4')][_0x306f('0xa5')]=![];if(_0xa408c7){if(_0x23f593['account']['autoclose']){_0x23f593['applications'][_0x306f('0xa6')]({'id':0x0,'priority':_0x23f593[_0x306f('0x71')]['length']+0x1,'app':_0x306f('0xa7'),'appdata':'unmanaged','interval':_0x306f('0xa8')});}_0x23f593['interaction']['created']=!![];}return db[_0x306f('0xa9')][_0x306f('0x65')]({'phone':_0x23f593['body'][_0x306f('0x7c')],'messageId':_0x23f593[_0x306f('0x5b')][_0x306f('0x7f')],'body':_0x23f593[_0x306f('0x5b')][_0x306f('0x5b')],'SmsAccountId':_0x12c19e[_0x306f('0x61')]['id'],'SmsInteractionId':_0x5d03d5['id'],'direction':'in','ContactId':_0x5d03d5[_0x306f('0xaa')],'AttachmentId':_0x23f593[_0x306f('0x5b')][_0x306f('0xab')]});})['then'](function(_0x2c6000){_0x23f593[_0x306f('0x27')]=_0x2c6000;if(_0x23f593[_0x306f('0xa4')]['UserId']){return db['User'][_0x306f('0x5a')]({'attributes':['id',_0x306f('0x3b')],'where':{'id':_0x23f593[_0x306f('0xa4')][_0x306f('0xac')]}})[_0x306f('0x1e')](function(_0x15e69d){if(_0x15e69d){_0x23f593[_0x306f('0x71')]['unshift']({'id':0x0,'priority':0x0,'app':_0x306f('0xad'),'appdata':_0x15e69d[_0x306f('0x3b')]+','+(_0x23f593[_0x306f('0x70')][_0x306f('0xae')]||0xa),'interval':_0x306f('0xa8')});}return respondWithRpcPromise(_0x306f('0xaf'),'startRouting',_0x23f593);});}return respondWithRpcPromise(_0x306f('0xaf'),_0x306f('0xb0'),_0x23f593);})[_0x306f('0x1e')](function(_0x3ce15b){if(_0x3ce15b){var _0x4be58d=0xc8;var _0x21f1fc=_0x306f('0xb1');logger[_0x306f('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x21f1fc,_0x4be58d,_0x306f('0xb2'));logger['debug'](_0x306f('0xb3'),_0x21f1fc,_0x4be58d,_0x306f('0xb2'),JSON['stringify'](_0x3ce15b));if(_0x23f593[_0x306f('0x70')][_0x306f('0x7a')]==='twilio'){return _0x4070c3[_0x306f('0x2c')](_0x4be58d)[_0x306f('0x31')](_0x306f('0xb4'),_0x306f('0xb5'))['send'](_0x306f('0xb6'));}else{return _0x4070c3[_0x306f('0x2c')](_0x4be58d)[_0x306f('0x2d')](_0x3ce15b);}}})[_0x306f('0x29')](handleError(_0x4070c3,null));};exports[_0x306f('0xb7')]=function(_0x1ab859,_0x1b00c1){var _0x9d1db5=_0x1ab859['params']['id'];var _0x10a17d=_0x1ab859['body'];var _0x129e1b=0xc8;var _0x2818e0=null;return db[_0x306f('0xb8')][_0x306f('0xb9')]({'isolationLevel':db['sequelize']['Transaction'][_0x306f('0xba')][_0x306f('0xbb')]},function(_0xaf0c1f){return db[_0x306f('0x3f')][_0x306f('0x67')]({'where':{'id':_0x9d1db5},'transaction':_0xaf0c1f})[_0x306f('0x1e')](function(_0x35a468){if(_0x35a468){return db[_0x306f('0x6e')][_0x306f('0x37')]({'where':{'SmsAccountId':_0x9d1db5},'transaction':_0xaf0c1f})[_0x306f('0x1e')](function(){var _0x29bfd9=_[_0x306f('0x3e')](_0x10a17d,function(_0xaac3ac){_0xaac3ac['SmsAccountId']=_0x9d1db5;return _0xaac3ac;});return db[_0x306f('0x6e')][_0x306f('0xbc')](_0x29bfd9,{'transaction':_0xaf0c1f});});}else{_0x129e1b=0x194;_0x2818e0=[];}});})[_0x306f('0x1e')](function(){if(_0x129e1b!==0x194){return db['SmsApplication'][_0x306f('0xbd')]({'where':{'SmsAccountId':_0x9d1db5},'order':_0x306f('0x73')})[_0x306f('0x1e')](function(_0x2b5d48){_0x2818e0=_0x2b5d48;});}})[_0x306f('0x29')](function(_0x2a3c41){_0x129e1b=0x1f4;logger[_0x306f('0x25')](_0x2a3c41[_0x306f('0x3a')]);if(_0x2a3c41['name']){delete _0x2a3c41[_0x306f('0x3b')];}_0x2818e0=_0x2a3c41;})[_0x306f('0xbe')](function(){if(_0x2818e0===null){_0x1b00c1['sendStatus'](_0x129e1b);}else{if(_0x129e1b===0x1f4){_0x1b00c1['status'](_0x129e1b)[_0x306f('0xbf')](_0x2818e0);}else{_0x1b00c1[_0x306f('0x2c')](_0x129e1b)[_0x306f('0x2d')](_0x2818e0);}}});};exports[_0x306f('0xc0')]=function(_0x259d9f,_0x99f7bd,_0x5d08a8){var _0x49b9a7={};var _0x439658={};var _0x11547b;var _0x39a845;return db[_0x306f('0x3f')]['findOne']({'where':{'id':_0x259d9f[_0x306f('0x61')]['id']}})['then'](handleEntityNotFound(_0x99f7bd,null))[_0x306f('0x1e')](function(_0xb300de){if(_0xb300de){_0x11547b=_0xb300de;_0x439658['model']=_[_0x306f('0x44')](db[_0x306f('0x6e')][_0x306f('0x40')]);_0x439658['query']=_[_0x306f('0x44')](_0x259d9f[_0x306f('0x43')]);_0x439658['filters']=_[_0x306f('0x46')](_0x439658[_0x306f('0x42')],_0x439658[_0x306f('0x43')]);_0x49b9a7['attributes']=_[_0x306f('0x46')](_0x439658[_0x306f('0x42')],qs[_0x306f('0x47')](_0x259d9f[_0x306f('0x43')][_0x306f('0x47')]));_0x49b9a7[_0x306f('0x45')]=_0x49b9a7[_0x306f('0x45')]['length']?_0x49b9a7['attributes']:_0x439658[_0x306f('0x42')];_0x49b9a7['order']=qs['sort'](_0x259d9f[_0x306f('0x43')][_0x306f('0x4c')]);_0x49b9a7[_0x306f('0x4d')]=qs[_0x306f('0x4f')](_[_0x306f('0x4e')](_0x259d9f[_0x306f('0x43')],_0x439658['filters']));if(_0x259d9f[_0x306f('0x43')][_0x306f('0x50')]){_0x49b9a7[_0x306f('0x4d')]=_[_0x306f('0x51')](_0x49b9a7['where'],{'$or':_[_0x306f('0x3e')](_0x49b9a7[_0x306f('0x45')],function(_0x4c04b3){var _0x4f6e11={};_0x4f6e11[_0x4c04b3]={'$like':'%'+_0x259d9f[_0x306f('0x43')][_0x306f('0x50')]+'%'};return _0x4f6e11;})});}_0x49b9a7=_[_0x306f('0x51')]({},_0x49b9a7,_0x259d9f['options']);return _0x11547b[_0x306f('0xc0')](_0x49b9a7);}})[_0x306f('0x1e')](function(_0x58337b){if(_0x58337b){_0x39a845=_0x58337b[_0x306f('0x48')];if(!_0x259d9f[_0x306f('0x43')][_0x306f('0x49')](_0x306f('0x4a'))){_0x49b9a7[_0x306f('0x2f')]=qs[_0x306f('0x2f')](_0x259d9f[_0x306f('0x43')][_0x306f('0x2f')]);_0x49b9a7[_0x306f('0x2e')]=qs['offset'](_0x259d9f['query'][_0x306f('0x2e')]);}return _0x11547b[_0x306f('0xc0')](_0x49b9a7);}})['then'](function(_0x38c7bd){if(_0x38c7bd){return _0x38c7bd?{'count':_0x39a845,'rows':_0x38c7bd}:null;}})[_0x306f('0x1e')](respondWithResult(_0x99f7bd,null))['catch'](handleError(_0x99f7bd,null));};exports[_0x306f('0xc1')]=function(_0xd4c2a8,_0x20098b,_0x44e45f){var _0x34160b={'raw':![],'where':{}};var _0x1597fa={};var _0x4f36cc={'count':0x0,'rows':[]};return db[_0x306f('0x3f')][_0x306f('0x67')]({'where':{'id':_0xd4c2a8[_0x306f('0x61')]['id']}})[_0x306f('0x1e')](handleEntityNotFound(_0x20098b,null))[_0x306f('0x1e')](function(_0x5b20ea){if(_0x5b20ea){_0x1597fa['model']=_[_0x306f('0x44')](db[_0x306f('0xa2')][_0x306f('0x40')]);_0x1597fa['query']=_[_0x306f('0x44')](_0xd4c2a8[_0x306f('0x43')]);_0x1597fa[_0x306f('0x4f')]=_[_0x306f('0x46')](_0x1597fa['model'],_0x1597fa[_0x306f('0x43')]);_0x34160b['attributes']=_[_0x306f('0x46')](_0x1597fa['model'],qs[_0x306f('0x47')](_0xd4c2a8[_0x306f('0x43')]['fields']));_0x34160b[_0x306f('0x45')]=_0x34160b[_0x306f('0x45')][_0x306f('0x48')]?_0x34160b['attributes']:_0x1597fa[_0x306f('0x42')];if(!_0xd4c2a8[_0x306f('0x43')][_0x306f('0x49')](_0x306f('0x4a'))){_0x34160b[_0x306f('0x2f')]=qs['limit'](_0xd4c2a8[_0x306f('0x43')][_0x306f('0x2f')]);_0x34160b[_0x306f('0x2e')]=qs[_0x306f('0x2e')](_0xd4c2a8['query']['offset']);}_0x34160b[_0x306f('0x4b')]=qs[_0x306f('0x4c')](_0xd4c2a8[_0x306f('0x43')][_0x306f('0x4c')]);_0x34160b['where']=qs[_0x306f('0x4f')](_[_0x306f('0x4e')](_0xd4c2a8[_0x306f('0x43')],_0x1597fa[_0x306f('0x4f')]));_0x34160b[_0x306f('0x4d')][_0x306f('0x63')]=_0x5b20ea['id'];if(_0xd4c2a8['query'][_0x306f('0x50')]){_0x34160b[_0x306f('0x4d')]=_[_0x306f('0x51')](_0x34160b[_0x306f('0x4d')],{'$or':_[_0x306f('0x3e')](_0x34160b[_0x306f('0x45')],function(_0x653df){var _0x16be31={};_0x16be31[_0x653df]={'$like':'%'+_0xd4c2a8['query'][_0x306f('0x50')]+'%'};return _0x16be31;})});}_0x34160b=_['merge']({},_0x34160b,_0xd4c2a8[_0x306f('0x59')]);return db['SmsInteraction'][_0x306f('0x30')]({'where':_0x34160b[_0x306f('0x4d')]})[_0x306f('0x1e')](function(_0x38354f){_0x4f36cc[_0x306f('0x30')]=_0x38354f;if(_0xd4c2a8['query'][_0x306f('0x53')]){_0x34160b['include']=[{'model':db[_0x306f('0x9d')],'as':'Contact','required':![]},{'model':db[_0x306f('0xc2')],'as':_0x306f('0xc3'),'attributes':[_0x306f('0x3b'),_0x306f('0xc4'),_0x306f('0xc5')],'required':![]},{'model':db[_0x306f('0xc6')],'as':_0x306f('0xc7'),'attributes':['id',_0x306f('0x3b'),_0x306f('0xc8')],'where':_0xd4c2a8[_0x306f('0x43')][_0x306f('0xc9')]?{'id':_0xd4c2a8[_0x306f('0x43')][_0x306f('0xc9')]}:undefined,'required':_0xd4c2a8[_0x306f('0x43')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0x306f('0x55')](_0x34160b);})[_0x306f('0x1e')](function(_0x1c3e37){_0x4f36cc[_0x306f('0x56')]=_0x1c3e37;return _0x4f36cc;});}})[_0x306f('0x1e')](respondWithFilteredResult(_0x20098b,_0x34160b))['catch'](handleError(_0x20098b,null));};exports[_0x306f('0xbf')]=function(_0x531932,_0x5b746d,_0x3f2327){var _0x164322,_0x4fcea5,_0x251606;if(_[_0x306f('0x94')](_0x531932['body'][_0x306f('0x5b')])||_0x531932[_0x306f('0x5b')][_0x306f('0x5b')]===''){throw new db[(_0x306f('0x74'))][(_0x306f('0x9a'))](_0x306f('0x96'));}if(_[_0x306f('0x94')](_0x531932['body']['to'])){throw new db[(_0x306f('0x74'))][(_0x306f('0x9a'))](_0x306f('0xca'));}_0x164322=_0x531932[_0x306f('0x5b')]['to'];return db['SmsAccount'][_0x306f('0x5a')]({'where':{'id':_0x531932[_0x306f('0x61')]['id']},'include':[{'model':db[_0x306f('0x9c')],'as':_0x306f('0xcb'),'include':[{'model':db[_0x306f('0x9d')],'as':_0x306f('0x9e'),'where':{'mobile':_0x164322},'limit':0x1,'order':[['updatedAt',_0x306f('0x9f')]]}]}]})[_0x306f('0x1e')](handleEntityNotFound(_0x5b746d,null))[_0x306f('0x1e')](function(_0x52e7dd){if(_0x52e7dd&&_0x52e7dd[_0x306f('0xcb')]){_0x4fcea5=_0x52e7dd[_0x306f('0x38')]({'plain':!![]});if(_0x4fcea5[_0x306f('0xcb')]&&_0x4fcea5[_0x306f('0xcb')][_0x306f('0x9e')][_0x306f('0x48')]){return _0x4fcea5[_0x306f('0xcb')]['Contacts'][0x0];}return db['CmContact']['create'](_['defaults'](_0x531932['body'],{'firstName':_0x164322,'mobile':_0x164322,'phone':_0x164322,'ListId':_0x4fcea5[_0x306f('0xcc')]}));}})[_0x306f('0x1e')](handleEntityNotFound(_0x5b746d,null))[_0x306f('0x1e')](function(_0x2bc7a1){if(_0x2bc7a1){_0x251606=_0x2bc7a1;return db['SmsInteraction'][_0x306f('0x5a')]({'where':{'ContactId':_0x251606['id'],'closed':![],'SmsAccountId':_0x4fcea5['id']}})['then'](function(_0x2f0602){if(_0x2f0602){return[_0x2f0602,![]];}return db[_0x306f('0xa2')][_0x306f('0x65')]({'UserId':_0x531932[_0x306f('0x5c')]['id'],'ContactId':_0x251606['id'],'SmsAccountId':_0x4fcea5['id'],'phone':_0x164322,'firstMsgDirection':_0x306f('0xcd'),'Messages':[_[_0x306f('0x51')](_0x531932['body'],{'read':![],'body':_0x531932[_0x306f('0x5b')][_0x306f('0x5b')],'phone':_0x164322,'SmsAccountId':_0x4fcea5['id'],'UserId':_0x531932['user']['id'],'ContactId':_0x251606['id']})]},{'include':[{'model':db[_0x306f('0xa9')],'as':_0x306f('0xce')}]})[_0x306f('0x1e')](function(_0x54bd99){return[_0x54bd99,!![]];});});}})['spread'](function(_0x333791,_0x59f821){if(_0x59f821){return _0x333791;}return db['SmsMessage']['create'](_[_0x306f('0x51')](_0x531932[_0x306f('0x5b')],{'read':![],'body':_0x531932[_0x306f('0x5b')][_0x306f('0x5b')],'phone':_0x164322,'SmsAccountId':_0x4fcea5['id'],'SmsInteractionId':_0x333791['id'],'UserId':_0x531932[_0x306f('0x5c')]['id'],'ContactId':_0x251606['id']}))[_0x306f('0x1e')](function(_0x3b9570){_0x333791['dataValues']['Messages']=[];_0x333791[_0x306f('0xcf')]['Messages'][_0x306f('0xa6')](_0x3b9570['dataValues']);return _0x333791;});})[_0x306f('0x1e')](respondWithResult(_0x5b746d,null))[_0x306f('0x29')](handleError(_0x5b746d,null));};exports['status']=function(_0xda000b,_0x351a7d,_0x24eaff){if(_0xda000b[_0x306f('0x5b')]['id']){delete _0xda000b[_0x306f('0x5b')]['id'];}var _0xd46447,_0x180eee,_0x300a97;return db[_0x306f('0x3f')]['find']({'where':{'id':_0xda000b[_0x306f('0x61')]['id']}})[_0x306f('0x1e')](handleEntityNotFound(_0x351a7d,null))['then'](function(_0x3dc4b3){if(_0x3dc4b3){_0x300a97=_0x3dc4b3;logger['debug'](_0x306f('0x23'),_0x306f('0x2c'),_0x306f('0xd0'),_0x3dc4b3[_0x306f('0x7a')],util[_0x306f('0xd1')](_0xda000b['body'],{'showHidden':![],'depth':null}));switch(_0x3dc4b3[_0x306f('0x7a')]){case _0x306f('0x81'):if(_0xda000b[_0x306f('0x5b')][_0x306f('0xd2')]&&_0xda000b[_0x306f('0x5b')][_0x306f('0x2c')]){_0x180eee=_0xda000b[_0x306f('0x5b')][_0x306f('0x2c')];return db[_0x306f('0xa9')][_0x306f('0x5a')]({'where':{'messageId':_0xda000b[_0x306f('0x5b')][_0x306f('0xd2')]}});}break;case _0x306f('0x84'):if(_0xda000b[_0x306f('0x5b')][_0x306f('0xd3')]&&_0xda000b[_0x306f('0x5b')]['statusInt']){_0x180eee=_0xda000b['body']['statusInt'];return db[_0x306f('0xa9')][_0x306f('0x5a')]({'where':{'messageId':_0xda000b[_0x306f('0x5b')]['requestid']}});}break;case'clicksend':if(_0xda000b[_0x306f('0x5b')]['message_id']&&_0xda000b[_0x306f('0x5b')][_0x306f('0xd4')]){_0x180eee=_0xda000b[_0x306f('0x5b')]['status_code'];return db[_0x306f('0xa9')][_0x306f('0x5a')]({'where':{'messageId':_0xda000b['body'][_0x306f('0x86')]}});}break;case _0x306f('0x8a'):var _0x5a61a1=_0xda000b[_0x306f('0x5b')][_0x306f('0x8b')][0x0];if(_0x5a61a1[_0x306f('0x7f')]&&_0x5a61a1[_0x306f('0x2c')]['groupName']==='DELIVERED'){_0x180eee=_0x5a61a1[_0x306f('0x2c')][_0x306f('0xd5')];return db[_0x306f('0xa9')][_0x306f('0x5a')]({'where':{'messageId':_0x5a61a1[_0x306f('0x7f')]}});}break;case _0x306f('0x8e'):if(_0xda000b[_0x306f('0x5b')]['messageId']&&_0xda000b[_0x306f('0x5b')][_0x306f('0x2c')]){_0x180eee=_0xda000b[_0x306f('0x5b')][_0x306f('0x2c')];return db[_0x306f('0xa9')][_0x306f('0x5a')]({'where':{'messageId':_0xda000b[_0x306f('0x5b')]['messageId']}});}break;case _0x306f('0x91'):if(_0xda000b[_0x306f('0x5b')][0x0]['message']['id']){_0x180eee=_0xda000b[_0x306f('0x5b')][0x0][_0x306f('0x7a')];return db[_0x306f('0xa9')][_0x306f('0x5a')]({'where':{'messageId':_0xda000b[_0x306f('0x5b')][0x0][_0x306f('0x27')]['id']}});}break;case'intelepeer':if(_0xda000b[_0x306f('0x5b')]['redif']&&_0xda000b[_0x306f('0x5b')][_0x306f('0x2c')]){_0x180eee=_0xda000b[_0x306f('0x5b')][_0x306f('0x2c')];return db[_0x306f('0xa9')][_0x306f('0x5a')]({'where':{'messageId':_0xda000b[_0x306f('0x5b')]['redif']}});}break;}}})[_0x306f('0x1e')](handleEntityNotFound(_0x351a7d,null))['then'](function(_0x2782c2){if(_0x2782c2){_0xd46447=_0x2782c2;switch(_0x300a97[_0x306f('0x7a')]){case'skebby':if(_0x180eee===_0x306f('0xd6')){return _0xd46447['update']({'read':!![]});}else{logger[_0x306f('0x25')](_0x306f('0x23'),_0x306f('0x2c'),_0x306f('0x81'),util[_0x306f('0xd1')](_0xda000b['body'],{'showHidden':![],'depth':null}));}break;case _0x306f('0x84'):if(_0x180eee==='1'){return _0xd46447[_0x306f('0x36')]({'read':!![]});}else{logger['error'](_0x306f('0x23'),'status',_0x306f('0x81'),util[_0x306f('0xd1')](_0xda000b['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0xda000b[_0x306f('0x5b')][_0x306f('0xd7')]&&_0x180eee>=0xc8&&_0x180eee<=0xce){return _0xd46447[_0x306f('0x36')]({'read':!![]});}else{logger[_0x306f('0x25')](_0x306f('0x23'),_0x306f('0x2c'),_0x306f('0x85'),util['inspect'](_0xda000b[_0x306f('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x306f('0x8a'):var _0xf87e99=_0xda000b[_0x306f('0x5b')][_0x306f('0x8b')][0x0];if(_0xf87e99['status']['groupName']===_0x306f('0xd6')){return _0xd46447['update']({'read':!![]});}else{logger['error'](_0x306f('0x23'),_0x306f('0x2c'),'infobip',util[_0x306f('0xd1')](_0xda000b[_0x306f('0x5b')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x180eee==_0x306f('0xd8')||_0x180eee==_0x306f('0xd9')){return _0xd46447['update']({'read':!![]});}else{logger['error'](_0x306f('0x23'),_0x306f('0x2c'),_0x306f('0x8e'),util[_0x306f('0xd1')](_0xda000b[_0x306f('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x306f('0x91'):if(_0x180eee==_0x306f('0xda')){return _0xd46447[_0x306f('0x36')]({'read':!![]});}else{logger[_0x306f('0x25')](_0x306f('0x23'),_0x306f('0x2c'),_0x306f('0x91'),util[_0x306f('0xd1')](_0xda000b['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x180eee===_0x306f('0xdb')||_0x180eee===_0x306f('0xdc')){return _0xd46447[_0x306f('0x36')]({'read':!![]});}else{logger[_0x306f('0x25')](_0x306f('0x23'),_0x306f('0x2c'),'intelepeer',util['inspect'](_0xda000b[_0x306f('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0xd46447;}})[_0x306f('0x1e')](respondWithResult(_0x351a7d,null))[_0x306f('0x29')](handleError(_0x351a7d,null));};exports[_0x306f('0xdd')]=function(_0x2efbd0,_0x28f506,_0x39d087){var _0x31e293,_0x17654e,_0x4879b3;return db['SmsAccount'][_0x306f('0x5a')]({'where':{'id':_0x2efbd0['params']['id']}})[_0x306f('0x1e')](handleEntityNotFound(_0x28f506,null))['then'](function(_0x3f377a){if(_0x3f377a){_0x4879b3=_0x3f377a;logger[_0x306f('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x306f('0x2c'),'received\x20delivery\x20report\x20from',_0x3f377a[_0x306f('0x7a')],util[_0x306f('0xd1')](_0x2efbd0[_0x306f('0x43')],{'showHidden':![],'depth':null}));switch(_0x3f377a[_0x306f('0x7a')]){case _0x306f('0xde'):if(_0x2efbd0[_0x306f('0x43')][_0x306f('0xdf')]&&_0x2efbd0[_0x306f('0x43')][_0x306f('0xe0')]){_0x17654e=_0x2efbd0[_0x306f('0x43')][_0x306f('0xe0')];return db[_0x306f('0xa9')][_0x306f('0x5a')]({'where':{'messageId':_0x2efbd0[_0x306f('0x43')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x28f506,null))[_0x306f('0x1e')](function(_0x417b58){if(_0x417b58){_0x31e293=_0x417b58;switch(_0x4879b3[_0x306f('0x7a')]){case'csc':if(_0x17654e==='2'||_0x17654e==='6'){return _0x31e293[_0x306f('0x36')]({'read':!![]});}else{logger[_0x306f('0x25')](_0x306f('0x23'),_0x306f('0x2c'),_0x306f('0xde'),util[_0x306f('0xd1')](_0x2efbd0[_0x306f('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x31e293;}})['then'](respondWithResult(_0x28f506,null))[_0x306f('0x29')](handleError(_0x28f506,null));};exports['addAgents']=function(_0x46d66f,_0x1cd3d5,_0x4c45de){return db[_0x306f('0x3f')][_0x306f('0x5a')]({'where':{'id':_0x46d66f[_0x306f('0x61')]['id']}})[_0x306f('0x1e')](handleEntityNotFound(_0x1cd3d5,null))[_0x306f('0x1e')](function(_0x521583){if(_0x521583){return _0x521583['addAgents'](_0x46d66f[_0x306f('0x5b')][_0x306f('0x69')],_[_0x306f('0xa1')](_0x46d66f[_0x306f('0x5b')],[_0x306f('0x69'),'id'])||{})[_0x306f('0xa3')](function(_0x251268){for(var _0x51d79e=0x0;_0x51d79e<_0x46d66f[_0x306f('0x5b')][_0x306f('0x69')][_0x306f('0x48')];_0x51d79e+=0x1){socket[_0x306f('0xe1')](_0x306f('0xe2'),{'UserId':Number(_0x46d66f[_0x306f('0x5b')]['ids'][_0x51d79e]),'SmsAccountId':Number(_0x46d66f[_0x306f('0x61')]['id'])});}return _0x251268;});}})[_0x306f('0x1e')](respondWithResult(_0x1cd3d5,null))[_0x306f('0x29')](handleError(_0x1cd3d5,null));};exports[_0x306f('0xe3')]=function(_0x4ba2c6,_0x3d9363,_0x6ac718){return db[_0x306f('0x3f')]['find']({'where':{'id':_0x4ba2c6[_0x306f('0x61')]['id']}})[_0x306f('0x1e')](handleEntityNotFound(_0x3d9363,null))[_0x306f('0x1e')](function(_0x55a44b){if(_0x55a44b){return _0x55a44b['removeAgents'](_0x4ba2c6['query'][_0x306f('0x69')])[_0x306f('0x1e')](function(){if(_[_0x306f('0xe4')](_0x4ba2c6['query'][_0x306f('0x69')])){for(var _0x1c0424=0x0;_0x1c0424<_0x4ba2c6['query'][_0x306f('0x69')]['length'];_0x1c0424+=0x1){socket[_0x306f('0xe1')](_0x306f('0xe5'),{'UserId':Number(_0x4ba2c6[_0x306f('0x43')][_0x306f('0x69')][_0x1c0424]),'SmsAccountId':Number(_0x4ba2c6[_0x306f('0x61')]['id'])});}}else{socket['emit'](_0x306f('0xe5'),{'UserId':Number(_0x4ba2c6[_0x306f('0x43')][_0x306f('0x69')]),'SmsAccountId':Number(_0x4ba2c6[_0x306f('0x61')]['id'])});}});}})[_0x306f('0x1e')](respondWithStatusCode(_0x3d9363,null))[_0x306f('0x29')](handleError(_0x3d9363,null));};exports[_0x306f('0xe6')]=function(_0x2ef47e,_0x19b433,_0x3bb6ed){var _0xa0001={};var _0x16a421={};var _0x2e5ca4;var _0x1ab66f;return db[_0x306f('0x3f')][_0x306f('0x67')]({'where':{'id':_0x2ef47e['params']['id']}})[_0x306f('0x1e')](handleEntityNotFound(_0x19b433,null))[_0x306f('0x1e')](function(_0x4a30c5){if(_0x4a30c5){_0x2e5ca4=_0x4a30c5;_0x16a421['model']=_[_0x306f('0x44')](db[_0x306f('0xc2')]['rawAttributes']);_0x16a421['query']=_[_0x306f('0x44')](_0x2ef47e[_0x306f('0x43')]);_0x16a421[_0x306f('0x4f')]=_[_0x306f('0x46')](_0x16a421[_0x306f('0x42')],_0x16a421[_0x306f('0x43')]);_0xa0001[_0x306f('0x45')]=_[_0x306f('0x46')](_0x16a421[_0x306f('0x42')],qs['fields'](_0x2ef47e[_0x306f('0x43')][_0x306f('0x47')]));_0xa0001[_0x306f('0x45')]=_0xa0001[_0x306f('0x45')][_0x306f('0x48')]?_0xa0001['attributes']:_0x16a421[_0x306f('0x42')];_0xa0001[_0x306f('0x4b')]=qs[_0x306f('0x4c')](_0x2ef47e['query']['sort']);_0xa0001[_0x306f('0x4d')]=qs[_0x306f('0x4f')](_['pick'](_0x2ef47e['query'],_0x16a421[_0x306f('0x4f')]));if(_0x2ef47e[_0x306f('0x43')]['filter']){_0xa0001[_0x306f('0x4d')]=_[_0x306f('0x51')](_0xa0001[_0x306f('0x4d')],{'$or':_[_0x306f('0x3e')](_0xa0001['attributes'],function(_0x1c8b9a){var _0x14cefb={};_0x14cefb[_0x1c8b9a]={'$like':'%'+_0x2ef47e[_0x306f('0x43')][_0x306f('0x50')]+'%'};return _0x14cefb;})});}_0xa0001=_[_0x306f('0x51')]({},_0xa0001,_0x2ef47e['options']);return _0x2e5ca4['getAgents'](_0xa0001);}})[_0x306f('0x1e')](function(_0x43f9b5){if(_0x43f9b5){_0x1ab66f=_0x43f9b5[_0x306f('0x48')];if(!_0x2ef47e[_0x306f('0x43')][_0x306f('0x49')]('nolimit')){_0xa0001[_0x306f('0x2f')]=qs[_0x306f('0x2f')](_0x2ef47e[_0x306f('0x43')][_0x306f('0x2f')]);_0xa0001[_0x306f('0x2e')]=qs[_0x306f('0x2e')](_0x2ef47e[_0x306f('0x43')][_0x306f('0x2e')]);}return _0x2e5ca4[_0x306f('0xe6')](_0xa0001);}})[_0x306f('0x1e')](function(_0x2f7870){if(_0x2f7870){return _0x2f7870?{'count':_0x1ab66f,'rows':_0x2f7870}:null;}})['then'](respondWithResult(_0x19b433,null))[_0x306f('0x29')](handleError(_0x19b433,null));}; \ No newline at end of file +var _0x90c2=['bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','map','SmsAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','merge','filter','includeAll','include','findAll','rows','options','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','update','params','mandatoryDispositionPause','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','sort','pick','SmsAccountId','removeDispositions','ids','CannedAnswer','removeAnswers','notify','Applications','account','applications','orderBy','priority','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','CompanyId','type','twilio','from','Body','messageId','MessageSid','skebby','sender','text','connectel','message_id','plivo','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','isNil','ValidationError','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','updatedAt','list','omit','Contacts','contact','spread','interaction','created','close','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','send','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','CmList','List','ListId','SmsInteraction','dataValues','Messages','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','bandwidth','intelepeer','redif','clicksend','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x32c3a7,_0x32ddc8){var _0x2d77a1=function(_0x6a7761){while(--_0x6a7761){_0x32c3a7['push'](_0x32c3a7['shift']());}};_0x2d77a1(++_0x32ddc8);}(_0x90c2,0x1c1));var _0x290c=function(_0x35c2ca,_0x4bf1bf){_0x35c2ca=_0x35c2ca-0x0;var _0x5e835d=_0x90c2[_0x35c2ca];return _0x5e835d;};'use strict';var emlformat=require(_0x290c('0x0'));var rimraf=require(_0x290c('0x1'));var zipdir=require(_0x290c('0x2'));var jsonpatch=require(_0x290c('0x3'));var rp=require('request-promise');var moment=require(_0x290c('0x4'));var BPromise=require(_0x290c('0x5'));var Mustache=require('mustache');var util=require(_0x290c('0x6'));var path=require('path');var sox=require(_0x290c('0x7'));var csv=require('to-csv');var ejs=require(_0x290c('0x8'));var fs=require('fs');var fs_extra=require(_0x290c('0x9'));var _=require(_0x290c('0xa'));var squel=require(_0x290c('0xb'));var crypto=require(_0x290c('0xc'));var jsforce=require(_0x290c('0xd'));var deskjs=require(_0x290c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x290c('0xf'));var Papa=require(_0x290c('0x10'));var Redis=require(_0x290c('0x11'));var authService=require(_0x290c('0x12'));var qs=require(_0x290c('0x13'));var as=require(_0x290c('0x14'));var hardwareService=require(_0x290c('0x15'));var logger=require(_0x290c('0x16'))(_0x290c('0x17'));var utils=require(_0x290c('0x18'));var config=require(_0x290c('0x19'));var licenseUtil=require(_0x290c('0x1a'));var db=require(_0x290c('0x1b'))['db'];config[_0x290c('0x1c')]=_[_0x290c('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x290c('0x1e'))(new Redis(config[_0x290c('0x1c')]));require('./smsAccount.socket')[_0x290c('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2816f4,_0x441ffc,_0x5c067b,_0x1b03c3){return new BPromise(function(_0x348d5a,_0x492bfd){var _0x5af7a4=_0x1b03c3||client;return _0x5af7a4['request'](_0x2816f4,_0x5c067b)[_0x290c('0x20')](function(_0x15b606){logger[_0x290c('0x21')]('SmsAccount,\x20%s,\x20%s',_0x441ffc,_0x290c('0x22'));logger[_0x290c('0x23')](_0x290c('0x24'),_0x441ffc,'request\x20sent',JSON['stringify'](_0x15b606));if(_0x15b606[_0x290c('0x25')]){if(_0x15b606['error']['code']===0x1f4){logger[_0x290c('0x25')]('SmsAccount,\x20%s,\x20%s',_0x441ffc,_0x15b606['error']['message']);return _0x492bfd(_0x15b606[_0x290c('0x25')]['message']);}logger[_0x290c('0x25')](_0x290c('0x26'),_0x441ffc,_0x15b606[_0x290c('0x25')][_0x290c('0x27')]);return _0x348d5a(_0x15b606['error']['message']);}else{logger['info'](_0x290c('0x26'),_0x441ffc,_0x290c('0x22'));_0x348d5a(_0x15b606[_0x290c('0x28')][_0x290c('0x27')]);}})[_0x290c('0x29')](function(_0x303314){logger[_0x290c('0x25')](_0x290c('0x26'),_0x441ffc,_0x303314);_0x492bfd(_0x303314);});});}function respondWithStatusCode(_0x127129,_0x2351cb){_0x2351cb=_0x2351cb||0xcc;return function(_0xb52bae){if(_0xb52bae){return _0x127129[_0x290c('0x2a')](_0x2351cb);}return _0x127129[_0x290c('0x2b')](_0x2351cb)[_0x290c('0x2c')]();};}function respondWithResult(_0x15fcd6,_0x4de83a){_0x4de83a=_0x4de83a||0xc8;return function(_0x4fa31f){if(_0x4fa31f){return _0x15fcd6[_0x290c('0x2b')](_0x4de83a)['json'](_0x4fa31f);}};}function respondWithFilteredResult(_0x4d0693,_0x247cc0){return function(_0x5764b5){if(_0x5764b5){var _0x31ff97=typeof _0x247cc0['offset']===_0x290c('0x2d')&&typeof _0x247cc0[_0x290c('0x2e')]===_0x290c('0x2d');var _0x268068=_0x5764b5[_0x290c('0x2f')];var _0x4d324f=_0x31ff97?0x0:_0x247cc0['offset'];var _0x19ad5b=_0x31ff97?_0x5764b5[_0x290c('0x2f')]:_0x247cc0[_0x290c('0x30')]+_0x247cc0[_0x290c('0x2e')];var _0x384420;if(_0x19ad5b>=_0x268068){_0x19ad5b=_0x268068;_0x384420=0xc8;}else{_0x384420=0xce;}_0x4d0693['status'](_0x384420);return _0x4d0693[_0x290c('0x31')](_0x290c('0x32'),_0x4d324f+'-'+_0x19ad5b+'/'+_0x268068)[_0x290c('0x33')](_0x5764b5);}return null;};}function patchUpdates(_0xba3c87){return function(_0x4a9cda){try{jsonpatch[_0x290c('0x34')](_0x4a9cda,_0xba3c87,!![]);}catch(_0x1a0cd1){return BPromise[_0x290c('0x35')](_0x1a0cd1);}return _0x4a9cda[_0x290c('0x36')]();};}function saveUpdates(_0x4bc9b0,_0x1908bf){return function(_0x11bc9d){if(_0x11bc9d){return _0x11bc9d['update'](_0x4bc9b0)[_0x290c('0x20')](function(_0x3b53d2){return _0x3b53d2;});}return null;};}function removeEntity(_0x55d4a6,_0x53bda0){return function(_0x54de09){if(_0x54de09){return _0x54de09[_0x290c('0x37')]()['then'](function(){var _0x102c2c=_0x54de09[_0x290c('0x38')]({'plain':!![]});var _0x234346=_0x290c('0x39');return db[_0x290c('0x3a')][_0x290c('0x37')]({'where':{'type':_0x234346,'resourceId':_0x102c2c['id']}})[_0x290c('0x20')](function(){return _0x54de09;});})['then'](function(){_0x55d4a6[_0x290c('0x2b')](0xcc)[_0x290c('0x2c')]();});}};}function handleEntityNotFound(_0x231240,_0x11e6f8){return function(_0x265311){if(!_0x265311){_0x231240[_0x290c('0x2a')](0x194);}return _0x265311;};}function handleError(_0x2b1a52,_0x2c3295){_0x2c3295=_0x2c3295||0x1f4;return function(_0x1a6f38){logger[_0x290c('0x25')](_0x1a6f38[_0x290c('0x3b')]);if(_0x1a6f38[_0x290c('0x3c')]){delete _0x1a6f38[_0x290c('0x3c')];}_0x2b1a52['status'](_0x2c3295)['send'](_0x1a6f38);};}exports[_0x290c('0x3d')]=function(_0x35c30d,_0x492ead){var _0x22f419={'include':[{'model':db[_0x290c('0x3e')],'as':'mandatoryDispositionPause'}]},_0x3a7177={},_0x20906b={'count':0x0,'rows':[]};var _0x58e40a=_[_0x290c('0x3f')](db[_0x290c('0x40')][_0x290c('0x41')],function(_0x39c762){return{'name':_0x39c762['fieldName'],'type':_0x39c762['type'][_0x290c('0x42')]};});_0x3a7177[_0x290c('0x43')]=_[_0x290c('0x3f')](_0x58e40a,_0x290c('0x3c'));_0x3a7177[_0x290c('0x44')]=_[_0x290c('0x45')](_0x35c30d[_0x290c('0x44')]);_0x3a7177[_0x290c('0x46')]=_[_0x290c('0x47')](_0x3a7177['model'],_0x3a7177[_0x290c('0x44')]);_0x22f419[_0x290c('0x48')]=_[_0x290c('0x47')](_0x3a7177[_0x290c('0x43')],qs['fields'](_0x35c30d[_0x290c('0x44')][_0x290c('0x49')]));_0x22f419[_0x290c('0x48')]=_0x22f419[_0x290c('0x48')][_0x290c('0x4a')]?_0x22f419[_0x290c('0x48')]:_0x3a7177[_0x290c('0x43')];if(!_0x35c30d[_0x290c('0x44')]['hasOwnProperty'](_0x290c('0x4b'))){_0x22f419[_0x290c('0x2e')]=qs[_0x290c('0x2e')](_0x35c30d[_0x290c('0x44')][_0x290c('0x2e')]);_0x22f419[_0x290c('0x30')]=qs[_0x290c('0x30')](_0x35c30d[_0x290c('0x44')][_0x290c('0x30')]);}_0x22f419[_0x290c('0x4c')]=qs['sort'](_0x35c30d[_0x290c('0x44')]['sort']);_0x22f419[_0x290c('0x4d')]=qs[_0x290c('0x46')](_['pick'](_0x35c30d[_0x290c('0x44')],_0x3a7177['filters']),_0x58e40a);if(_0x35c30d[_0x290c('0x44')]['filter']){_0x22f419[_0x290c('0x4d')]=_[_0x290c('0x4e')](_0x22f419[_0x290c('0x4d')],{'$or':_['map'](_0x58e40a,function(_0x5ab6a2){if(_0x5ab6a2['type']!=='VIRTUAL'){var _0x3d7134={};_0x3d7134[_0x5ab6a2[_0x290c('0x3c')]]={'$like':'%'+_0x35c30d['query'][_0x290c('0x4f')]+'%'};return _0x3d7134;}})});}_0x22f419=_[_0x290c('0x4e')]({},_0x22f419,_0x35c30d['options']);var _0x2ff44d={'where':_0x22f419[_0x290c('0x4d')]};return db[_0x290c('0x40')]['count'](_0x2ff44d)[_0x290c('0x20')](function(_0x4e08db){_0x20906b['count']=_0x4e08db;if(_0x35c30d['query'][_0x290c('0x50')]){_0x22f419[_0x290c('0x51')]=[{'all':!![]}];}return db['SmsAccount'][_0x290c('0x52')](_0x22f419);})[_0x290c('0x20')](function(_0x245aed){_0x20906b[_0x290c('0x53')]=_0x245aed;return _0x20906b;})[_0x290c('0x20')](respondWithFilteredResult(_0x492ead,_0x22f419))[_0x290c('0x29')](handleError(_0x492ead,null));};exports['show']=function(_0x6b1807,_0x58c88e){var _0x39b8d1={'raw':![],'where':{'id':_0x6b1807['params']['id']},'include':[{'model':db[_0x290c('0x3e')],'as':'mandatoryDispositionPause'}]},_0x3eb14e={};_0x3eb14e[_0x290c('0x43')]=_[_0x290c('0x45')](db[_0x290c('0x40')][_0x290c('0x41')]);_0x3eb14e[_0x290c('0x44')]=_[_0x290c('0x45')](_0x6b1807[_0x290c('0x44')]);_0x3eb14e[_0x290c('0x46')]=_['intersection'](_0x3eb14e[_0x290c('0x43')],_0x3eb14e['query']);_0x39b8d1[_0x290c('0x48')]=_['intersection'](_0x3eb14e[_0x290c('0x43')],qs[_0x290c('0x49')](_0x6b1807[_0x290c('0x44')]['fields']));_0x39b8d1[_0x290c('0x48')]=_0x39b8d1[_0x290c('0x48')]['length']?_0x39b8d1['attributes']:_0x3eb14e[_0x290c('0x43')];if(_0x6b1807[_0x290c('0x44')][_0x290c('0x50')]){_0x39b8d1[_0x290c('0x51')]=[{'all':!![]}];}_0x39b8d1=_[_0x290c('0x4e')]({},_0x39b8d1,_0x6b1807[_0x290c('0x54')]);return db['SmsAccount'][_0x290c('0x55')](_0x39b8d1)[_0x290c('0x20')](handleEntityNotFound(_0x58c88e,null))[_0x290c('0x20')](respondWithResult(_0x58c88e,null))[_0x290c('0x29')](handleError(_0x58c88e,null));};exports['create']=function(_0x5e9ef3,_0x2c2cfc){return db[_0x290c('0x40')][_0x290c('0x56')](_0x5e9ef3[_0x290c('0x57')],{})['then'](function(_0x4367c4){var _0x2ecff5=_0x5e9ef3['user']['get']({'plain':!![]});if(!_0x2ecff5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ecff5[_0x290c('0x58')]===_0x290c('0x59')){var _0x10eb0a=_0x4367c4['get']({'plain':!![]});var _0x4eae7a=_0x290c('0x39');return db[_0x290c('0x5a')][_0x290c('0x55')]({'where':{'name':_0x4eae7a,'userProfileId':_0x2ecff5[_0x290c('0x5b')]},'raw':!![]})[_0x290c('0x20')](function(_0xd10ab9){if(_0xd10ab9&&_0xd10ab9[_0x290c('0x5c')]===0x0){return db['UserProfileResource'][_0x290c('0x56')]({'name':_0x10eb0a['name'],'resourceId':_0x10eb0a['id'],'type':_0xd10ab9['name'],'sectionId':_0xd10ab9['id']},{})[_0x290c('0x20')](function(){return _0x4367c4;});}else{return _0x4367c4;}})['catch'](function(_0x17a1e6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17a1e6);throw _0x17a1e6;});}return _0x4367c4;})[_0x290c('0x20')](respondWithResult(_0x2c2cfc,0xc9))['catch'](handleError(_0x2c2cfc,null));};exports[_0x290c('0x5d')]=function(_0x31c3c4,_0x594890){if(_0x31c3c4['body']['id']){delete _0x31c3c4[_0x290c('0x57')]['id'];}return db[_0x290c('0x40')][_0x290c('0x55')]({'where':{'id':_0x31c3c4[_0x290c('0x5e')]['id']},'include':[{'model':db[_0x290c('0x3e')],'as':_0x290c('0x5f')}]})[_0x290c('0x20')](handleEntityNotFound(_0x594890,null))[_0x290c('0x20')](saveUpdates(_0x31c3c4[_0x290c('0x57')],null))[_0x290c('0x20')](respondWithResult(_0x594890,null))[_0x290c('0x29')](handleError(_0x594890,null));};exports[_0x290c('0x37')]=function(_0x4c120e,_0x17aa6d){return db['SmsAccount'][_0x290c('0x55')]({'where':{'id':_0x4c120e['params']['id']}})[_0x290c('0x20')](handleEntityNotFound(_0x17aa6d,null))[_0x290c('0x20')](removeEntity(_0x17aa6d,null))['catch'](handleError(_0x17aa6d,null));};exports[_0x290c('0x60')]=function(_0xa4a18f,_0x280bd8){return db[_0x290c('0x40')][_0x290c('0x60')]()[_0x290c('0x20')](respondWithResult(_0x280bd8,null))[_0x290c('0x29')](handleError(_0x280bd8,null));};exports[_0x290c('0x61')]=function(_0x568de3,_0x3478b2,_0x1d1467){if(_0x568de3[_0x290c('0x57')]['id']){delete _0x568de3[_0x290c('0x57')]['id'];}return db[_0x290c('0x40')]['find']({'where':{'id':_0x568de3[_0x290c('0x5e')]['id']}})[_0x290c('0x20')](handleEntityNotFound(_0x3478b2,null))['then'](function(_0x199d17){if(_0x199d17){_0x568de3[_0x290c('0x57')]['SmsAccountId']=_0x199d17['id'];return db[_0x290c('0x62')][_0x290c('0x56')](_0x568de3[_0x290c('0x57')]);}})[_0x290c('0x20')](respondWithResult(_0x3478b2,null))[_0x290c('0x29')](handleError(_0x3478b2,null));};exports[_0x290c('0x63')]=function(_0x10af65,_0x2ff15f,_0x2d0e6a){var _0x50ca96={'raw':![],'where':{}};var _0x5417be={};var _0xd929a1={'count':0x0,'rows':[]};return db[_0x290c('0x40')][_0x290c('0x64')]({'where':{'id':_0x10af65['params']['id']}})[_0x290c('0x20')](handleEntityNotFound(_0x2ff15f,null))[_0x290c('0x20')](function(_0xbb9c4b){if(_0xbb9c4b){_0x5417be['model']=_[_0x290c('0x45')](db['Disposition'][_0x290c('0x41')]);_0x5417be[_0x290c('0x44')]=_['keys'](_0x10af65[_0x290c('0x44')]);_0x5417be[_0x290c('0x46')]=_[_0x290c('0x47')](_0x5417be[_0x290c('0x43')],_0x5417be[_0x290c('0x44')]);_0x50ca96[_0x290c('0x48')]=_[_0x290c('0x47')](_0x5417be[_0x290c('0x43')],qs[_0x290c('0x49')](_0x10af65[_0x290c('0x44')][_0x290c('0x49')]));_0x50ca96[_0x290c('0x48')]=_0x50ca96[_0x290c('0x48')][_0x290c('0x4a')]?_0x50ca96[_0x290c('0x48')]:_0x5417be[_0x290c('0x43')];if(!_0x10af65['query'][_0x290c('0x65')](_0x290c('0x4b'))){_0x50ca96[_0x290c('0x2e')]=qs[_0x290c('0x2e')](_0x10af65[_0x290c('0x44')][_0x290c('0x2e')]);_0x50ca96[_0x290c('0x30')]=qs[_0x290c('0x30')](_0x10af65[_0x290c('0x44')]['offset']);}_0x50ca96[_0x290c('0x4c')]=qs[_0x290c('0x66')](_0x10af65[_0x290c('0x44')]['sort']);_0x50ca96[_0x290c('0x4d')]=qs[_0x290c('0x46')](_[_0x290c('0x67')](_0x10af65[_0x290c('0x44')],_0x5417be[_0x290c('0x46')]));_0x50ca96[_0x290c('0x4d')][_0x290c('0x68')]=_0xbb9c4b['id'];if(_0x10af65['query']['filter']){_0x50ca96[_0x290c('0x4d')]=_[_0x290c('0x4e')](_0x50ca96['where'],{'$or':_['map'](_0x50ca96['attributes'],function(_0x51ad03){var _0x49560a={};_0x49560a[_0x51ad03]={'$like':'%'+_0x10af65['query']['filter']+'%'};return _0x49560a;})});}_0x50ca96=_[_0x290c('0x4e')]({},_0x50ca96,_0x10af65[_0x290c('0x54')]);return db[_0x290c('0x62')]['count']({'where':_0x50ca96[_0x290c('0x4d')]})['then'](function(_0x225bd7){_0xd929a1[_0x290c('0x2f')]=_0x225bd7;if(_0x10af65[_0x290c('0x44')]['includeAll']){_0x50ca96['include']=[{'all':!![]}];}return db[_0x290c('0x62')][_0x290c('0x52')](_0x50ca96);})[_0x290c('0x20')](function(_0x549e4d){_0xd929a1[_0x290c('0x53')]=_0x549e4d;return _0xd929a1;});}})[_0x290c('0x20')](respondWithFilteredResult(_0x2ff15f,_0x50ca96))['catch'](handleError(_0x2ff15f,null));};exports[_0x290c('0x69')]=function(_0x55a515,_0x13737e,_0x2537da){return db[_0x290c('0x40')][_0x290c('0x55')]({'where':{'id':_0x55a515[_0x290c('0x5e')]['id']}})[_0x290c('0x20')](handleEntityNotFound(_0x13737e,null))[_0x290c('0x20')](function(_0x12ce47){if(_0x12ce47){return _0x12ce47[_0x290c('0x69')](_0x55a515[_0x290c('0x44')][_0x290c('0x6a')]);}})['then'](respondWithStatusCode(_0x13737e,null))['catch'](handleError(_0x13737e,null));};exports['addAnswer']=function(_0x4b0a8f,_0x527161,_0x330c74){if(_0x4b0a8f['body']['id']){delete _0x4b0a8f[_0x290c('0x57')]['id'];}return db[_0x290c('0x40')][_0x290c('0x55')]({'where':{'id':_0x4b0a8f[_0x290c('0x5e')]['id']}})[_0x290c('0x20')](handleEntityNotFound(_0x527161,null))[_0x290c('0x20')](function(_0x1398ca){if(_0x1398ca){_0x4b0a8f[_0x290c('0x57')]['SmsAccountId']=_0x1398ca['id'];return db[_0x290c('0x6b')]['create'](_0x4b0a8f['body']);}})[_0x290c('0x20')](respondWithResult(_0x527161,null))[_0x290c('0x29')](handleError(_0x527161,null));};exports['getAnswers']=function(_0x5acaa0,_0x540af7,_0x43b798){var _0x4fe299={'raw':![],'where':{}};var _0x5e74e6={};var _0x314d85={'count':0x0,'rows':[]};return db[_0x290c('0x40')][_0x290c('0x64')]({'where':{'id':_0x5acaa0[_0x290c('0x5e')]['id']}})[_0x290c('0x20')](handleEntityNotFound(_0x540af7,null))[_0x290c('0x20')](function(_0x5740b7){if(_0x5740b7){_0x5e74e6[_0x290c('0x43')]=_['keys'](db[_0x290c('0x6b')][_0x290c('0x41')]);_0x5e74e6[_0x290c('0x44')]=_[_0x290c('0x45')](_0x5acaa0[_0x290c('0x44')]);_0x5e74e6[_0x290c('0x46')]=_[_0x290c('0x47')](_0x5e74e6['model'],_0x5e74e6[_0x290c('0x44')]);_0x4fe299[_0x290c('0x48')]=_['intersection'](_0x5e74e6[_0x290c('0x43')],qs[_0x290c('0x49')](_0x5acaa0[_0x290c('0x44')][_0x290c('0x49')]));_0x4fe299[_0x290c('0x48')]=_0x4fe299['attributes']['length']?_0x4fe299[_0x290c('0x48')]:_0x5e74e6[_0x290c('0x43')];if(!_0x5acaa0[_0x290c('0x44')][_0x290c('0x65')](_0x290c('0x4b'))){_0x4fe299['limit']=qs[_0x290c('0x2e')](_0x5acaa0[_0x290c('0x44')][_0x290c('0x2e')]);_0x4fe299[_0x290c('0x30')]=qs[_0x290c('0x30')](_0x5acaa0[_0x290c('0x44')]['offset']);}_0x4fe299[_0x290c('0x4c')]=qs['sort'](_0x5acaa0[_0x290c('0x44')][_0x290c('0x66')]);_0x4fe299[_0x290c('0x4d')]=qs[_0x290c('0x46')](_[_0x290c('0x67')](_0x5acaa0[_0x290c('0x44')],_0x5e74e6[_0x290c('0x46')]));_0x4fe299[_0x290c('0x4d')][_0x290c('0x68')]=_0x5740b7['id'];if(_0x5acaa0[_0x290c('0x44')]['filter']){_0x4fe299[_0x290c('0x4d')]=_[_0x290c('0x4e')](_0x4fe299[_0x290c('0x4d')],{'$or':_[_0x290c('0x3f')](_0x4fe299[_0x290c('0x48')],function(_0x45f639){var _0x27243a={};_0x27243a[_0x45f639]={'$like':'%'+_0x5acaa0['query'][_0x290c('0x4f')]+'%'};return _0x27243a;})});}_0x4fe299=_[_0x290c('0x4e')]({},_0x4fe299,_0x5acaa0[_0x290c('0x54')]);return db[_0x290c('0x6b')][_0x290c('0x2f')]({'where':_0x4fe299['where']})['then'](function(_0x5d1d03){_0x314d85[_0x290c('0x2f')]=_0x5d1d03;if(_0x5acaa0[_0x290c('0x44')][_0x290c('0x50')]){_0x4fe299['include']=[{'all':!![]}];}return db[_0x290c('0x6b')][_0x290c('0x52')](_0x4fe299);})[_0x290c('0x20')](function(_0x53da97){_0x314d85[_0x290c('0x53')]=_0x53da97;return _0x314d85;});}})[_0x290c('0x20')](respondWithFilteredResult(_0x540af7,_0x4fe299))['catch'](handleError(_0x540af7,null));};exports[_0x290c('0x6c')]=function(_0x51d950,_0x6ccfb6,_0x420b48){return db[_0x290c('0x40')][_0x290c('0x55')]({'where':{'id':_0x51d950['params']['id']}})[_0x290c('0x20')](handleEntityNotFound(_0x6ccfb6,null))['then'](function(_0x49f76e){if(_0x49f76e){return _0x49f76e[_0x290c('0x6c')](_0x51d950[_0x290c('0x44')][_0x290c('0x6a')]);}})['then'](respondWithStatusCode(_0x6ccfb6,null))['catch'](handleError(_0x6ccfb6,null));};exports[_0x290c('0x6d')]=function(_0x297cdd,_0x50b65d,_0x21f184){var _0x406fa8={'channel':'sms'};var _0x367e69=[];var _0x127265=[];var _0x342f70={};return db[_0x290c('0x40')][_0x290c('0x55')]({'where':{'id':_0x297cdd['params']['id']},'include':[{'model':db['SmsApplication'],'as':_0x290c('0x6e')}]})[_0x290c('0x20')](handleEntityNotFound(_0x50b65d,null))[_0x290c('0x20')](function(_0x331655){_0x406fa8[_0x290c('0x6f')]=_0x331655;_0x406fa8[_0x290c('0x70')]=_[_0x290c('0x71')](_0x331655[_0x290c('0x6e')],[_0x290c('0x72')],['asc']);if(_0x406fa8[_0x290c('0x6f')][_0x290c('0x6e')]){delete _0x406fa8[_0x290c('0x6f')][_0x290c('0x6e')];}return db[_0x290c('0x73')]['describe']();})['then'](function(_0x31dd3a){if(!_0x31dd3a){throw new db[(_0x290c('0x74'))]['ValidationError'](_0x290c('0x75'));}_0x367e69=_[_0x290c('0x76')](_[_0x290c('0x45')](_0x31dd3a),[_0x290c('0x77'),'updatedAt']);_0x127265=_[_0x290c('0x76')](_[_0x290c('0x45')](_0x31dd3a),[_0x290c('0x77'),'updatedAt',_0x290c('0x78'),'ListId']);_0x406fa8[_0x290c('0x57')]={'mapKey':'mobile'};if(_0x406fa8[_0x290c('0x6f')][_0x290c('0x79')]){switch(_0x406fa8[_0x290c('0x6f')][_0x290c('0x79')]){case _0x290c('0x7a'):_0x406fa8[_0x290c('0x57')][_0x290c('0x7b')]=_0x297cdd[_0x290c('0x57')]['From'];_0x406fa8[_0x290c('0x57')][_0x290c('0x57')]=_0x297cdd[_0x290c('0x57')][_0x290c('0x7c')];_0x406fa8[_0x290c('0x57')][_0x290c('0x7d')]=_0x297cdd['body'][_0x290c('0x7e')];break;case _0x290c('0x7f'):_0x406fa8['body'][_0x290c('0x7b')]='+'+_0x297cdd[_0x290c('0x57')][_0x290c('0x80')];_0x406fa8['body']['body']=_0x297cdd[_0x290c('0x57')][_0x290c('0x81')];break;case _0x290c('0x82'):_0x406fa8[_0x290c('0x57')][_0x290c('0x7b')]=_0x297cdd[_0x290c('0x57')][_0x290c('0x7b')];_0x406fa8['body'][_0x290c('0x57')]=_0x297cdd['body'][_0x290c('0x27')];break;case'clicksend':_0x406fa8['body'][_0x290c('0x7b')]=_0x297cdd[_0x290c('0x57')][_0x290c('0x7b')];_0x406fa8[_0x290c('0x57')][_0x290c('0x57')]=_0x297cdd[_0x290c('0x57')]['body'];_0x406fa8[_0x290c('0x57')]['messageId']=_0x297cdd[_0x290c('0x57')][_0x290c('0x83')];break;case _0x290c('0x84'):_0x406fa8[_0x290c('0x57')][_0x290c('0x7b')]=_0x297cdd[_0x290c('0x57')][_0x290c('0x85')];_0x406fa8[_0x290c('0x57')][_0x290c('0x57')]=_0x297cdd[_0x290c('0x57')][_0x290c('0x86')];_0x406fa8['body'][_0x290c('0x7d')]=_0x297cdd[_0x290c('0x57')][_0x290c('0x87')];break;case _0x290c('0x88'):_0x406fa8[_0x290c('0x57')]['from']='+'+_0x297cdd[_0x290c('0x57')][_0x290c('0x89')][0x0][_0x290c('0x7b')];_0x406fa8[_0x290c('0x57')][_0x290c('0x57')]=_0x297cdd[_0x290c('0x57')]['results'][0x0][_0x290c('0x81')];_0x406fa8['body'][_0x290c('0x7d')]=_0x297cdd[_0x290c('0x57')][_0x290c('0x89')][0x0]['messageId'];break;case _0x290c('0x8a'):_0x406fa8[_0x290c('0x57')][_0x290c('0x7b')]=_0x297cdd[_0x290c('0x57')][_0x290c('0x8b')];_0x406fa8[_0x290c('0x57')][_0x290c('0x57')]=_0x297cdd[_0x290c('0x57')][_0x290c('0x8c')]['message'];break;case _0x290c('0x8d'):_0x406fa8[_0x290c('0x57')][_0x290c('0x7b')]=_0x297cdd['body'][_0x290c('0x8e')];_0x406fa8[_0x290c('0x57')][_0x290c('0x57')]=_0x297cdd[_0x290c('0x57')]['text'];_0x406fa8['body'][_0x290c('0x7d')]=_0x297cdd['body'][_0x290c('0x8f')];break;case'bandwidth':_0x406fa8['body']['messageId']=_0x297cdd[_0x290c('0x57')][0x0][_0x290c('0x27')]['id'];_0x406fa8['body'][_0x290c('0x7b')]=_0x297cdd[_0x290c('0x57')][0x0][_0x290c('0x27')]['from'];_0x406fa8[_0x290c('0x57')][_0x290c('0x57')]=_0x297cdd['body'][0x0]['message'][_0x290c('0x81')];break;case'intelepeer':_0x406fa8[_0x290c('0x57')][_0x290c('0x7b')]=_0x297cdd['body'][_0x290c('0x7b')];_0x406fa8[_0x290c('0x57')][_0x290c('0x57')]=_0x297cdd[_0x290c('0x57')]['message'];_0x406fa8[_0x290c('0x57')][_0x290c('0x7d')]=_0x297cdd[_0x290c('0x57')]['refid'];break;}}if(_0x406fa8[_0x290c('0x57')]['id']){delete _0x406fa8[_0x290c('0x57')]['id'];}if(_[_0x290c('0x90')](_0x406fa8['body'][_0x290c('0x7b')])){throw new db['Sequelize'][(_0x290c('0x91'))](_0x290c('0x92'));}if(_[_0x290c('0x90')](_0x406fa8[_0x290c('0x57')][_0x290c('0x57')])||_0x406fa8['body'][_0x290c('0x57')]===''){throw new db[(_0x290c('0x74'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x290c('0x90')](_0x406fa8['body'][_0x290c('0x93')])){throw new db['Sequelize'][(_0x290c('0x91'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x127265);}if(!_[_0x290c('0x94')](_0x127265,_0x406fa8[_0x290c('0x57')][_0x290c('0x93')])){throw new db[(_0x290c('0x74'))][(_0x290c('0x91'))](_0x290c('0x95')+_0x127265);}_0x342f70[_0x406fa8[_0x290c('0x57')][_0x290c('0x93')]]=_0x406fa8[_0x290c('0x57')]['from'];return db['CmList'][_0x290c('0x55')]({'where':{'id':_0x406fa8[_0x290c('0x6f')]['ListId']},'include':[{'model':db[_0x290c('0x73')],'as':'Contacts','where':_0x342f70,'limit':0x1,'order':[[_0x290c('0x96'),'DESC']]}]});})[_0x290c('0x20')](handleEntityNotFound(_0x50b65d,null))[_0x290c('0x20')](function(_0x539da7){if(_0x539da7){_0x406fa8[_0x290c('0x97')]=_[_0x290c('0x98')](_0x539da7,[_0x290c('0x99')]);if(_0x539da7[_0x290c('0x99')][_0x290c('0x4a')]){return _0x539da7[_0x290c('0x99')][0x0];}var _0x136005=_[_0x290c('0x1d')](_0x406fa8[_0x290c('0x57')],{'firstName':_0x406fa8['body'][_0x290c('0x7b')],'ListId':_0x539da7['id']});_0x136005[_0x406fa8['body'][_0x290c('0x93')]]=_0x406fa8[_0x290c('0x57')][_0x290c('0x7b')];return db[_0x290c('0x73')]['create'](_0x136005,{'fields':_0x367e69,'raw':!![]});}})[_0x290c('0x20')](handleEntityNotFound(_0x50b65d,null))['then'](function(_0x4a8410){if(_0x4a8410){_0x406fa8[_0x290c('0x9a')]=_0x4a8410;var _0x392deb={'ContactId':_0x4a8410['id'],'phone':_0x406fa8[_0x290c('0x57')][_0x290c('0x7b')],'SmsAccountId':_0x297cdd[_0x290c('0x5e')]['id']};var _0x1a74e2={'ContactId':_0x4a8410['id'],'SmsAccountId':_0x297cdd['params']['id'],'closed':![]};return db['SmsInteraction'][_0x290c('0x55')]({'where':_0x1a74e2})[_0x290c('0x20')](function(_0x292d21){if(_0x292d21){return[_0x292d21,![]];}return db['SmsInteraction']['create'](_0x392deb)[_0x290c('0x20')](function(_0x551c32){return[_0x551c32,!![]];});});}})[_0x290c('0x9b')](function(_0x58cce2,_0x4b7ad9){_0x406fa8['interaction']=_0x58cce2[_0x290c('0x38')]({'plain':!![]});_0x406fa8[_0x290c('0x9c')][_0x290c('0x9d')]=![];if(_0x4b7ad9){if(_0x406fa8[_0x290c('0x6f')]['autoclose']){_0x406fa8[_0x290c('0x70')]['push']({'id':0x0,'priority':_0x406fa8['applications']['length']+0x1,'app':_0x290c('0x9e'),'appdata':_0x290c('0x9f'),'interval':'*,*,*,*'});}_0x406fa8['interaction'][_0x290c('0x9d')]=!![];}return db[_0x290c('0xa0')][_0x290c('0x56')]({'phone':_0x406fa8[_0x290c('0x57')][_0x290c('0x7b')],'messageId':_0x406fa8[_0x290c('0x57')][_0x290c('0x7d')],'body':_0x406fa8[_0x290c('0x57')]['body'],'SmsAccountId':_0x297cdd[_0x290c('0x5e')]['id'],'SmsInteractionId':_0x58cce2['id'],'direction':'in','ContactId':_0x58cce2[_0x290c('0xa1')],'AttachmentId':_0x406fa8[_0x290c('0x57')][_0x290c('0xa2')]});})['then'](function(_0xd97797){_0x406fa8[_0x290c('0x27')]=_0xd97797;if(_0x406fa8[_0x290c('0x9c')][_0x290c('0xa3')]){return db['User'][_0x290c('0x55')]({'attributes':['id',_0x290c('0x3c')],'where':{'id':_0x406fa8['interaction'][_0x290c('0xa3')]}})[_0x290c('0x20')](function(_0x197b92){if(_0x197b92){_0x406fa8[_0x290c('0x70')][_0x290c('0xa4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x197b92[_0x290c('0x3c')]+','+(_0x406fa8[_0x290c('0x6f')][_0x290c('0xa5')]||0xa),'interval':_0x290c('0xa6')});}return respondWithRpcPromise('Start','startRouting',_0x406fa8);});}return respondWithRpcPromise(_0x290c('0xa7'),_0x290c('0xa8'),_0x406fa8);})[_0x290c('0x20')](function(_0x3802ff){if(_0x3802ff){var _0x18f4d0=0xc8;var _0x562569=_0x290c('0xa9');logger[_0x290c('0x21')](_0x290c('0x24'),_0x562569,_0x18f4d0,_0x290c('0xaa'));logger['debug'](_0x290c('0xab'),_0x562569,_0x18f4d0,_0x290c('0xaa'),JSON['stringify'](_0x3802ff));if(_0x406fa8[_0x290c('0x6f')][_0x290c('0x79')]===_0x290c('0x7a')){return _0x50b65d['status'](_0x18f4d0)[_0x290c('0x31')]('Content-Type',_0x290c('0xac'))[_0x290c('0xad')](_0x290c('0xae'));}else{return _0x50b65d[_0x290c('0x2b')](_0x18f4d0)[_0x290c('0x33')](_0x3802ff);}}})[_0x290c('0x29')](handleError(_0x50b65d,null));};exports[_0x290c('0xaf')]=function(_0x2b212d,_0x38d954){var _0x423b2c=_0x2b212d[_0x290c('0x5e')]['id'];var _0x1ac5c3=_0x2b212d['body'];var _0x1c2e02=0xc8;var _0x1c494c=null;return db[_0x290c('0xb0')][_0x290c('0xb1')]({'isolationLevel':db[_0x290c('0xb0')][_0x290c('0xb2')][_0x290c('0xb3')][_0x290c('0xb4')]},function(_0x4498d9){return db[_0x290c('0x40')][_0x290c('0x64')]({'where':{'id':_0x423b2c},'transaction':_0x4498d9})[_0x290c('0x20')](function(_0x590c06){if(_0x590c06){return db[_0x290c('0xb5')]['destroy']({'where':{'SmsAccountId':_0x423b2c},'transaction':_0x4498d9})[_0x290c('0x20')](function(){var _0x58d1fc=_[_0x290c('0x3f')](_0x1ac5c3,function(_0x448772){_0x448772[_0x290c('0x68')]=_0x423b2c;return _0x448772;});return db[_0x290c('0xb5')][_0x290c('0xb6')](_0x58d1fc,{'transaction':_0x4498d9});});}else{_0x1c2e02=0x194;_0x1c494c=[];}});})[_0x290c('0x20')](function(){if(_0x1c2e02!==0x194){return db[_0x290c('0xb5')][_0x290c('0xb7')]({'where':{'SmsAccountId':_0x423b2c},'order':_0x290c('0x72')})['then'](function(_0x2b1b47){_0x1c494c=_0x2b1b47;});}})[_0x290c('0x29')](function(_0x3e61b6){_0x1c2e02=0x1f4;logger[_0x290c('0x25')](_0x3e61b6[_0x290c('0x3b')]);if(_0x3e61b6[_0x290c('0x3c')]){delete _0x3e61b6[_0x290c('0x3c')];}_0x1c494c=_0x3e61b6;})['finally'](function(){if(_0x1c494c===null){_0x38d954[_0x290c('0x2a')](_0x1c2e02);}else{if(_0x1c2e02===0x1f4){_0x38d954['status'](_0x1c2e02)[_0x290c('0xad')](_0x1c494c);}else{_0x38d954['status'](_0x1c2e02)['json'](_0x1c494c);}}});};exports[_0x290c('0xb8')]=function(_0x4dfbd2,_0x4e9d88,_0x21e66a){var _0x3e5940={};var _0x19efde={};var _0x5b7be0;var _0x20e381;return db[_0x290c('0x40')]['findOne']({'where':{'id':_0x4dfbd2[_0x290c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4e9d88,null))[_0x290c('0x20')](function(_0x7620bb){if(_0x7620bb){_0x5b7be0=_0x7620bb;_0x19efde[_0x290c('0x43')]=_[_0x290c('0x45')](db['SmsApplication'][_0x290c('0x41')]);_0x19efde[_0x290c('0x44')]=_[_0x290c('0x45')](_0x4dfbd2['query']);_0x19efde[_0x290c('0x46')]=_[_0x290c('0x47')](_0x19efde[_0x290c('0x43')],_0x19efde[_0x290c('0x44')]);_0x3e5940[_0x290c('0x48')]=_[_0x290c('0x47')](_0x19efde[_0x290c('0x43')],qs[_0x290c('0x49')](_0x4dfbd2[_0x290c('0x44')][_0x290c('0x49')]));_0x3e5940['attributes']=_0x3e5940[_0x290c('0x48')][_0x290c('0x4a')]?_0x3e5940[_0x290c('0x48')]:_0x19efde[_0x290c('0x43')];_0x3e5940['order']=qs[_0x290c('0x66')](_0x4dfbd2[_0x290c('0x44')][_0x290c('0x66')]);_0x3e5940[_0x290c('0x4d')]=qs[_0x290c('0x46')](_['pick'](_0x4dfbd2['query'],_0x19efde['filters']));if(_0x4dfbd2[_0x290c('0x44')][_0x290c('0x4f')]){_0x3e5940[_0x290c('0x4d')]=_[_0x290c('0x4e')](_0x3e5940[_0x290c('0x4d')],{'$or':_[_0x290c('0x3f')](_0x3e5940['attributes'],function(_0x562777){var _0x4d85c3={};_0x4d85c3[_0x562777]={'$like':'%'+_0x4dfbd2[_0x290c('0x44')][_0x290c('0x4f')]+'%'};return _0x4d85c3;})});}_0x3e5940=_[_0x290c('0x4e')]({},_0x3e5940,_0x4dfbd2['options']);return _0x5b7be0['getApplications'](_0x3e5940);}})[_0x290c('0x20')](function(_0x4c2253){if(_0x4c2253){_0x20e381=_0x4c2253[_0x290c('0x4a')];if(!_0x4dfbd2['query'][_0x290c('0x65')](_0x290c('0x4b'))){_0x3e5940[_0x290c('0x2e')]=qs[_0x290c('0x2e')](_0x4dfbd2['query'][_0x290c('0x2e')]);_0x3e5940[_0x290c('0x30')]=qs[_0x290c('0x30')](_0x4dfbd2[_0x290c('0x44')]['offset']);}return _0x5b7be0[_0x290c('0xb8')](_0x3e5940);}})[_0x290c('0x20')](function(_0x4c230b){if(_0x4c230b){return _0x4c230b?{'count':_0x20e381,'rows':_0x4c230b}:null;}})[_0x290c('0x20')](respondWithResult(_0x4e9d88,null))[_0x290c('0x29')](handleError(_0x4e9d88,null));};exports[_0x290c('0xb9')]=function(_0x1c09df,_0x53dc34,_0x38b93a){var _0x584574={'raw':![],'where':{}};var _0x13c922={};var _0x2d17b3={'count':0x0,'rows':[]};return db[_0x290c('0x40')]['findOne']({'where':{'id':_0x1c09df[_0x290c('0x5e')]['id']}})[_0x290c('0x20')](handleEntityNotFound(_0x53dc34,null))[_0x290c('0x20')](function(_0x43c780){if(_0x43c780){_0x13c922[_0x290c('0x43')]=_[_0x290c('0x45')](db['SmsInteraction']['rawAttributes']);_0x13c922[_0x290c('0x44')]=_[_0x290c('0x45')](_0x1c09df[_0x290c('0x44')]);_0x13c922[_0x290c('0x46')]=_[_0x290c('0x47')](_0x13c922['model'],_0x13c922[_0x290c('0x44')]);_0x584574[_0x290c('0x48')]=_[_0x290c('0x47')](_0x13c922['model'],qs[_0x290c('0x49')](_0x1c09df[_0x290c('0x44')][_0x290c('0x49')]));_0x584574[_0x290c('0x48')]=_0x584574[_0x290c('0x48')][_0x290c('0x4a')]?_0x584574['attributes']:_0x13c922[_0x290c('0x43')];if(!_0x1c09df[_0x290c('0x44')][_0x290c('0x65')](_0x290c('0x4b'))){_0x584574[_0x290c('0x2e')]=qs[_0x290c('0x2e')](_0x1c09df[_0x290c('0x44')][_0x290c('0x2e')]);_0x584574['offset']=qs[_0x290c('0x30')](_0x1c09df[_0x290c('0x44')][_0x290c('0x30')]);}_0x584574[_0x290c('0x4c')]=qs[_0x290c('0x66')](_0x1c09df[_0x290c('0x44')][_0x290c('0x66')]);_0x584574[_0x290c('0x4d')]=qs['filters'](_['pick'](_0x1c09df[_0x290c('0x44')],_0x13c922[_0x290c('0x46')]));_0x584574['where']['SmsAccountId']=_0x43c780['id'];if(_0x1c09df[_0x290c('0x44')][_0x290c('0x4f')]){_0x584574[_0x290c('0x4d')]=_[_0x290c('0x4e')](_0x584574[_0x290c('0x4d')],{'$or':_[_0x290c('0x3f')](_0x584574[_0x290c('0x48')],function(_0x106f80){var _0x18ae72={};_0x18ae72[_0x106f80]={'$like':'%'+_0x1c09df[_0x290c('0x44')][_0x290c('0x4f')]+'%'};return _0x18ae72;})});}_0x584574=_[_0x290c('0x4e')]({},_0x584574,_0x1c09df[_0x290c('0x54')]);return db['SmsInteraction'][_0x290c('0x2f')]({'where':_0x584574[_0x290c('0x4d')]})[_0x290c('0x20')](function(_0x3982a7){_0x2d17b3[_0x290c('0x2f')]=_0x3982a7;if(_0x1c09df[_0x290c('0x44')]['includeAll']){_0x584574[_0x290c('0x51')]=[{'model':db[_0x290c('0x73')],'as':_0x290c('0xba'),'required':![]},{'model':db[_0x290c('0xbb')],'as':'Owner','attributes':[_0x290c('0x3c'),_0x290c('0xbc'),_0x290c('0xbd')],'required':![]},{'model':db[_0x290c('0xbe')],'as':'Tags','attributes':['id',_0x290c('0x3c'),_0x290c('0xbf')],'where':_0x1c09df[_0x290c('0x44')]['tag']?{'id':_0x1c09df[_0x290c('0x44')][_0x290c('0xc0')]}:undefined,'required':_0x1c09df[_0x290c('0x44')][_0x290c('0xc0')]?!![]:![]}];}return db['SmsInteraction'][_0x290c('0x52')](_0x584574);})[_0x290c('0x20')](function(_0x265c75){_0x2d17b3[_0x290c('0x53')]=_0x265c75;return _0x2d17b3;});}})[_0x290c('0x20')](respondWithFilteredResult(_0x53dc34,_0x584574))['catch'](handleError(_0x53dc34,null));};exports[_0x290c('0xad')]=function(_0x5cb398,_0x2cc180,_0x516ace){var _0x1227c9,_0x2a7614,_0x8d5a22;if(_[_0x290c('0x90')](_0x5cb398[_0x290c('0x57')][_0x290c('0x57')])||_0x5cb398['body'][_0x290c('0x57')]===''){throw new db[(_0x290c('0x74'))][(_0x290c('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x290c('0x90')](_0x5cb398[_0x290c('0x57')]['to'])){throw new db[(_0x290c('0x74'))][(_0x290c('0x91'))](_0x290c('0xc1'));}_0x1227c9=_0x5cb398[_0x290c('0x57')]['to'];return db[_0x290c('0x40')][_0x290c('0x55')]({'where':{'id':_0x5cb398[_0x290c('0x5e')]['id']},'include':[{'model':db[_0x290c('0xc2')],'as':_0x290c('0xc3'),'include':[{'model':db['CmContact'],'as':_0x290c('0x99'),'where':{'mobile':_0x1227c9},'limit':0x1,'order':[[_0x290c('0x96'),'DESC']]}]}]})[_0x290c('0x20')](handleEntityNotFound(_0x2cc180,null))[_0x290c('0x20')](function(_0x118f5d){if(_0x118f5d&&_0x118f5d[_0x290c('0xc3')]){_0x2a7614=_0x118f5d[_0x290c('0x38')]({'plain':!![]});if(_0x2a7614[_0x290c('0xc3')]&&_0x2a7614['List']['Contacts'][_0x290c('0x4a')]){return _0x2a7614[_0x290c('0xc3')][_0x290c('0x99')][0x0];}return db[_0x290c('0x73')][_0x290c('0x56')](_[_0x290c('0x1d')](_0x5cb398[_0x290c('0x57')],{'firstName':_0x1227c9,'mobile':_0x1227c9,'phone':_0x1227c9,'ListId':_0x2a7614[_0x290c('0xc4')]}));}})[_0x290c('0x20')](handleEntityNotFound(_0x2cc180,null))[_0x290c('0x20')](function(_0x2010a7){if(_0x2010a7){_0x8d5a22=_0x2010a7;return db[_0x290c('0xc5')]['find']({'where':{'ContactId':_0x8d5a22['id'],'closed':![],'SmsAccountId':_0x2a7614['id']}})['then'](function(_0x1f4442){if(_0x1f4442){return[_0x1f4442,![]];}return db[_0x290c('0xc5')][_0x290c('0x56')]({'UserId':_0x5cb398['user']['id'],'ContactId':_0x8d5a22['id'],'SmsAccountId':_0x2a7614['id'],'phone':_0x1227c9,'firstMsgDirection':'out','Messages':[_['merge'](_0x5cb398['body'],{'read':![],'body':_0x5cb398[_0x290c('0x57')]['body'],'phone':_0x1227c9,'SmsAccountId':_0x2a7614['id'],'UserId':_0x5cb398[_0x290c('0x59')]['id'],'ContactId':_0x8d5a22['id']})]},{'include':[{'model':db[_0x290c('0xa0')],'as':'Messages'}]})[_0x290c('0x20')](function(_0xbc08ae){return[_0xbc08ae,!![]];});});}})[_0x290c('0x9b')](function(_0x17826a,_0x13d879){if(_0x13d879){return _0x17826a;}return db[_0x290c('0xa0')]['create'](_['merge'](_0x5cb398[_0x290c('0x57')],{'read':![],'body':_0x5cb398[_0x290c('0x57')][_0x290c('0x57')],'phone':_0x1227c9,'SmsAccountId':_0x2a7614['id'],'SmsInteractionId':_0x17826a['id'],'UserId':_0x5cb398[_0x290c('0x59')]['id'],'ContactId':_0x8d5a22['id']}))[_0x290c('0x20')](function(_0x7a559){_0x17826a[_0x290c('0xc6')][_0x290c('0xc7')]=[];_0x17826a[_0x290c('0xc6')][_0x290c('0xc7')][_0x290c('0xc8')](_0x7a559[_0x290c('0xc6')]);return _0x17826a;});})[_0x290c('0x20')](respondWithResult(_0x2cc180,null))[_0x290c('0x29')](handleError(_0x2cc180,null));};exports[_0x290c('0x2b')]=function(_0x44d7aa,_0x100cf0,_0x23bdf0){if(_0x44d7aa[_0x290c('0x57')]['id']){delete _0x44d7aa[_0x290c('0x57')]['id'];}var _0x19a230,_0x43abf3,_0x7b06a9;return db[_0x290c('0x40')][_0x290c('0x55')]({'where':{'id':_0x44d7aa['params']['id']}})[_0x290c('0x20')](handleEntityNotFound(_0x100cf0,null))['then'](function(_0x2f7c59){if(_0x2f7c59){_0x7b06a9=_0x2f7c59;logger[_0x290c('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x290c('0xc9'),_0x2f7c59[_0x290c('0x79')],util[_0x290c('0xca')](_0x44d7aa['body'],{'showHidden':![],'depth':null}));switch(_0x2f7c59[_0x290c('0x79')]){case _0x290c('0x7f'):if(_0x44d7aa[_0x290c('0x57')][_0x290c('0xcb')]&&_0x44d7aa[_0x290c('0x57')][_0x290c('0x2b')]){_0x43abf3=_0x44d7aa['body'][_0x290c('0x2b')];return db[_0x290c('0xa0')][_0x290c('0x55')]({'where':{'messageId':_0x44d7aa['body'][_0x290c('0xcb')]}});}break;case _0x290c('0x82'):if(_0x44d7aa[_0x290c('0x57')][_0x290c('0xcc')]&&_0x44d7aa[_0x290c('0x57')][_0x290c('0xcd')]){_0x43abf3=_0x44d7aa[_0x290c('0x57')][_0x290c('0xcd')];return db[_0x290c('0xa0')]['find']({'where':{'messageId':_0x44d7aa[_0x290c('0x57')]['requestid']}});}break;case'clicksend':if(_0x44d7aa[_0x290c('0x57')]['message_id']&&_0x44d7aa[_0x290c('0x57')][_0x290c('0xce')]){_0x43abf3=_0x44d7aa['body'][_0x290c('0xce')];return db['SmsMessage'][_0x290c('0x55')]({'where':{'messageId':_0x44d7aa[_0x290c('0x57')][_0x290c('0x83')]}});}break;case'infobip':var _0x33476e=_0x44d7aa[_0x290c('0x57')]['results'][0x0];if(_0x33476e['messageId']&&_0x33476e[_0x290c('0x2b')][_0x290c('0xcf')]===_0x290c('0xd0')){_0x43abf3=_0x33476e[_0x290c('0x2b')][_0x290c('0xcf')];return db[_0x290c('0xa0')][_0x290c('0x55')]({'where':{'messageId':_0x33476e[_0x290c('0x7d')]}});}break;case'clickatell':if(_0x44d7aa[_0x290c('0x57')][_0x290c('0x7d')]&&_0x44d7aa[_0x290c('0x57')][_0x290c('0x2b')]){_0x43abf3=_0x44d7aa[_0x290c('0x57')][_0x290c('0x2b')];return db[_0x290c('0xa0')][_0x290c('0x55')]({'where':{'messageId':_0x44d7aa[_0x290c('0x57')][_0x290c('0x7d')]}});}break;case _0x290c('0xd1'):if(_0x44d7aa[_0x290c('0x57')][0x0][_0x290c('0x27')]['id']){_0x43abf3=_0x44d7aa[_0x290c('0x57')][0x0]['type'];return db[_0x290c('0xa0')][_0x290c('0x55')]({'where':{'messageId':_0x44d7aa[_0x290c('0x57')][0x0][_0x290c('0x27')]['id']}});}break;case _0x290c('0xd2'):if(_0x44d7aa[_0x290c('0x57')][_0x290c('0xd3')]&&_0x44d7aa['body'][_0x290c('0x2b')]){_0x43abf3=_0x44d7aa[_0x290c('0x57')]['status'];return db[_0x290c('0xa0')][_0x290c('0x55')]({'where':{'messageId':_0x44d7aa[_0x290c('0x57')][_0x290c('0xd3')]}});}break;}}})[_0x290c('0x20')](handleEntityNotFound(_0x100cf0,null))[_0x290c('0x20')](function(_0x15fbc3){if(_0x15fbc3){_0x19a230=_0x15fbc3;switch(_0x7b06a9[_0x290c('0x79')]){case _0x290c('0x7f'):if(_0x43abf3===_0x290c('0xd0')){return _0x19a230['update']({'read':!![]});}else{logger['error'](_0x290c('0x24'),_0x290c('0x2b'),_0x290c('0x7f'),util[_0x290c('0xca')](_0x44d7aa[_0x290c('0x57')],{'showHidden':![],'depth':null}));}break;case _0x290c('0x82'):if(_0x43abf3==='1'){return _0x19a230[_0x290c('0x5d')]({'read':!![]});}else{logger[_0x290c('0x25')](_0x290c('0x24'),_0x290c('0x2b'),_0x290c('0x7f'),util[_0x290c('0xca')](_0x44d7aa[_0x290c('0x57')],{'showHidden':![],'depth':null}));}break;case _0x290c('0xd4'):if(!_0x44d7aa[_0x290c('0x57')][_0x290c('0xd5')]&&_0x43abf3>=0xc8&&_0x43abf3<=0xce){return _0x19a230[_0x290c('0x5d')]({'read':!![]});}else{logger['error'](_0x290c('0x24'),_0x290c('0x2b'),'clicksend',util[_0x290c('0xca')](_0x44d7aa[_0x290c('0x57')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5b45d9=_0x44d7aa['body']['results'][0x0];if(_0x5b45d9[_0x290c('0x2b')][_0x290c('0xcf')]===_0x290c('0xd0')){return _0x19a230[_0x290c('0x5d')]({'read':!![]});}else{logger['error'](_0x290c('0x24'),_0x290c('0x2b'),_0x290c('0x88'),util[_0x290c('0xca')](_0x44d7aa[_0x290c('0x57')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x43abf3==_0x290c('0xd6')||_0x43abf3=='RECEIVED_BY_RECIPIENT'){return _0x19a230[_0x290c('0x5d')]({'read':!![]});}else{logger[_0x290c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x290c('0x2b'),_0x290c('0x8d'),util[_0x290c('0xca')](_0x44d7aa[_0x290c('0x57')],{'showHidden':![],'depth':null}));}break;case _0x290c('0xd1'):if(_0x43abf3==_0x290c('0xd7')){return _0x19a230[_0x290c('0x5d')]({'read':!![]});}else{logger[_0x290c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x290c('0x2b'),_0x290c('0xd1'),util[_0x290c('0xca')](_0x44d7aa[_0x290c('0x57')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x43abf3===_0x290c('0xd8')||_0x43abf3===_0x290c('0xd9')){return _0x19a230[_0x290c('0x5d')]({'read':!![]});}else{logger[_0x290c('0x25')](_0x290c('0x24'),'status',_0x290c('0xd2'),util[_0x290c('0xca')](_0x44d7aa[_0x290c('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x19a230;}})['then'](respondWithResult(_0x100cf0,null))[_0x290c('0x29')](handleError(_0x100cf0,null));};exports['statusGet']=function(_0x427535,_0x141c61,_0x598bfd){var _0x4b134e,_0x1544ea,_0x43c5da;return db[_0x290c('0x40')][_0x290c('0x55')]({'where':{'id':_0x427535['params']['id']}})[_0x290c('0x20')](handleEntityNotFound(_0x141c61,null))['then'](function(_0x3f41af){if(_0x3f41af){_0x43c5da=_0x3f41af;logger[_0x290c('0x23')](_0x290c('0x24'),_0x290c('0x2b'),'received\x20delivery\x20report\x20from',_0x3f41af[_0x290c('0x79')],util['inspect'](_0x427535[_0x290c('0x44')],{'showHidden':![],'depth':null}));switch(_0x3f41af['type']){case _0x290c('0x8a'):if(_0x427535[_0x290c('0x44')][_0x290c('0xda')]&&_0x427535[_0x290c('0x44')][_0x290c('0xdb')]){_0x1544ea=_0x427535[_0x290c('0x44')]['state'];return db['SmsMessage'][_0x290c('0x55')]({'where':{'messageId':_0x427535[_0x290c('0x44')][_0x290c('0xda')]}});}break;}}})['then'](handleEntityNotFound(_0x141c61,null))['then'](function(_0x5c9c02){if(_0x5c9c02){_0x4b134e=_0x5c9c02;switch(_0x43c5da[_0x290c('0x79')]){case'csc':if(_0x1544ea==='2'||_0x1544ea==='6'){return _0x4b134e[_0x290c('0x5d')]({'read':!![]});}else{logger[_0x290c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x290c('0x2b'),_0x290c('0x8a'),util[_0x290c('0xca')](_0x427535[_0x290c('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x4b134e;}})[_0x290c('0x20')](respondWithResult(_0x141c61,null))['catch'](handleError(_0x141c61,null));};exports[_0x290c('0xdc')]=function(_0x5b3c50,_0x1dd40f,_0x311273){return db[_0x290c('0x40')][_0x290c('0x55')]({'where':{'id':_0x5b3c50['params']['id']}})['then'](handleEntityNotFound(_0x1dd40f,null))[_0x290c('0x20')](function(_0x20ea6b){if(_0x20ea6b){return _0x20ea6b[_0x290c('0xdc')](_0x5b3c50[_0x290c('0x57')]['ids'],_[_0x290c('0x98')](_0x5b3c50[_0x290c('0x57')],[_0x290c('0x6a'),'id'])||{})[_0x290c('0x9b')](function(_0x565e56){for(var _0x35d0ca=0x0;_0x35d0ca<_0x5b3c50[_0x290c('0x57')][_0x290c('0x6a')][_0x290c('0x4a')];_0x35d0ca+=0x1){socket[_0x290c('0xdd')](_0x290c('0xde'),{'UserId':Number(_0x5b3c50[_0x290c('0x57')][_0x290c('0x6a')][_0x35d0ca]),'SmsAccountId':Number(_0x5b3c50[_0x290c('0x5e')]['id'])});}return _0x565e56;});}})[_0x290c('0x20')](respondWithResult(_0x1dd40f,null))[_0x290c('0x29')](handleError(_0x1dd40f,null));};exports[_0x290c('0xdf')]=function(_0x396617,_0x16c3e3,_0x2bb3b0){return db['SmsAccount'][_0x290c('0x55')]({'where':{'id':_0x396617[_0x290c('0x5e')]['id']}})[_0x290c('0x20')](handleEntityNotFound(_0x16c3e3,null))[_0x290c('0x20')](function(_0x5b31bf){if(_0x5b31bf){return _0x5b31bf[_0x290c('0xdf')](_0x396617[_0x290c('0x44')][_0x290c('0x6a')])['then'](function(){if(_[_0x290c('0xe0')](_0x396617[_0x290c('0x44')]['ids'])){for(var _0x3842c3=0x0;_0x3842c3<_0x396617[_0x290c('0x44')][_0x290c('0x6a')][_0x290c('0x4a')];_0x3842c3+=0x1){socket['emit'](_0x290c('0xe1'),{'UserId':Number(_0x396617['query'][_0x290c('0x6a')][_0x3842c3]),'SmsAccountId':Number(_0x396617[_0x290c('0x5e')]['id'])});}}else{socket['emit'](_0x290c('0xe1'),{'UserId':Number(_0x396617['query'][_0x290c('0x6a')]),'SmsAccountId':Number(_0x396617['params']['id'])});}});}})[_0x290c('0x20')](respondWithStatusCode(_0x16c3e3,null))[_0x290c('0x29')](handleError(_0x16c3e3,null));};exports[_0x290c('0xe2')]=function(_0x115e2c,_0x25949f,_0x2cecb9){var _0x3b27d9={};var _0x574769={};var _0x42637e;var _0x1b72a7;return db['SmsAccount']['findOne']({'where':{'id':_0x115e2c[_0x290c('0x5e')]['id']}})[_0x290c('0x20')](handleEntityNotFound(_0x25949f,null))[_0x290c('0x20')](function(_0x190554){if(_0x190554){_0x42637e=_0x190554;_0x574769[_0x290c('0x43')]=_['keys'](db[_0x290c('0xbb')]['rawAttributes']);_0x574769[_0x290c('0x44')]=_['keys'](_0x115e2c[_0x290c('0x44')]);_0x574769[_0x290c('0x46')]=_[_0x290c('0x47')](_0x574769[_0x290c('0x43')],_0x574769[_0x290c('0x44')]);_0x3b27d9[_0x290c('0x48')]=_[_0x290c('0x47')](_0x574769[_0x290c('0x43')],qs[_0x290c('0x49')](_0x115e2c[_0x290c('0x44')][_0x290c('0x49')]));_0x3b27d9['attributes']=_0x3b27d9[_0x290c('0x48')]['length']?_0x3b27d9[_0x290c('0x48')]:_0x574769[_0x290c('0x43')];_0x3b27d9[_0x290c('0x4c')]=qs[_0x290c('0x66')](_0x115e2c[_0x290c('0x44')][_0x290c('0x66')]);_0x3b27d9[_0x290c('0x4d')]=qs[_0x290c('0x46')](_[_0x290c('0x67')](_0x115e2c[_0x290c('0x44')],_0x574769[_0x290c('0x46')]));if(_0x115e2c[_0x290c('0x44')][_0x290c('0x4f')]){_0x3b27d9[_0x290c('0x4d')]=_[_0x290c('0x4e')](_0x3b27d9[_0x290c('0x4d')],{'$or':_[_0x290c('0x3f')](_0x3b27d9[_0x290c('0x48')],function(_0x42bc54){var _0x3ed14a={};_0x3ed14a[_0x42bc54]={'$like':'%'+_0x115e2c[_0x290c('0x44')]['filter']+'%'};return _0x3ed14a;})});}_0x3b27d9=_[_0x290c('0x4e')]({},_0x3b27d9,_0x115e2c['options']);return _0x42637e[_0x290c('0xe2')](_0x3b27d9);}})['then'](function(_0xc06ec6){if(_0xc06ec6){_0x1b72a7=_0xc06ec6[_0x290c('0x4a')];if(!_0x115e2c[_0x290c('0x44')]['hasOwnProperty'](_0x290c('0x4b'))){_0x3b27d9[_0x290c('0x2e')]=qs[_0x290c('0x2e')](_0x115e2c[_0x290c('0x44')][_0x290c('0x2e')]);_0x3b27d9['offset']=qs[_0x290c('0x30')](_0x115e2c[_0x290c('0x44')][_0x290c('0x30')]);}return _0x42637e['getAgents'](_0x3b27d9);}})['then'](function(_0x28d474){if(_0x28d474){return _0x28d474?{'count':_0x1b72a7,'rows':_0x28d474}:null;}})['then'](respondWithResult(_0x25949f,null))[_0x290c('0x29')](handleError(_0x25949f,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 6b10677..0eae50a 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 _0x3e04=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0x3e04,0x19e));var _0x43e0=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x3e04[_0x9aada2];return _0x196dff;};'use strict';var EventEmitter=require(_0x43e0('0x0'));var SmsAccount=require(_0x43e0('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x43e0('0x2')](0x0);var events={'afterCreate':_0x43e0('0x3'),'afterUpdate':_0x43e0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x52da6c){return function(_0x5cdbb4,_0x442b4b,_0x4bcbc9){SmsAccountEvents[_0x43e0('0x5')](_0x52da6c+':'+_0x5cdbb4['id'],_0x5cdbb4);SmsAccountEvents[_0x43e0('0x5')](_0x52da6c,_0x5cdbb4);_0x4bcbc9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x43e0('0x6')](e,emitEvent(event));}}module[_0x43e0('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0xc4e5=['hasOwnProperty','exports','../../mysqldb','SmsAccount','setMaxListeners','remove','emit'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xc4e5,0xb8));var _0x5c4e=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0xc4e5[_0x307086];return _0x699043;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x5c4e('0x0'))['db'][_0x5c4e('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x5c4e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5c4e('0x3')};function emitEvent(_0x9825b0){return function(_0x4f2ed0,_0xc58cb,_0x2cfc8d){SmsAccountEvents[_0x5c4e('0x4')](_0x9825b0+':'+_0x4f2ed0['id'],_0x4f2ed0);SmsAccountEvents[_0x5c4e('0x4')](_0x9825b0,_0x4f2ed0);_0x2cfc8d(null);};}for(var e in events){if(events[_0x5c4e('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x5c4e('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 3cb246d..e95acd4 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 _0xa92b=['util','../../config/logger','bluebird','request-promise','path','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash'];(function(_0x435162,_0x5a3ca0){var _0x557ed6=function(_0x1b791e){while(--_0x1b791e){_0x435162['push'](_0x435162['shift']());}};_0x557ed6(++_0x5a3ca0);}(_0xa92b,0x95));var _0xba92=function(_0x3d2e4b,_0x1f6653){_0x3d2e4b=_0x3d2e4b-0x0;var _0x509e78=_0xa92b[_0x3d2e4b];return _0x509e78;};'use strict';var _=require(_0xba92('0x0'));var util=require(_0xba92('0x1'));var logger=require(_0xba92('0x2'))('api');var moment=require('moment');var BPromise=require(_0xba92('0x3'));var rp=require(_0xba92('0x4'));var fs=require('fs');var path=require(_0xba92('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xba92('0x6'));module[_0xba92('0x7')]=function(_0x15642d,_0x3bd88c){return _0x15642d['define'](_0xba92('0x8'),attributes,{'tableName':_0xba92('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0e2=['../../config/logger','moment','rimraf','./smsAccount.attributes','exports','define','SmsAccount','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe0e2,0x197));var _0x2e0e=function(_0x4d6c87,_0x3ec771){_0x4d6c87=_0x4d6c87-0x0;var _0x2988fb=_0xe0e2[_0x4d6c87];return _0x2988fb;};'use strict';var _=require('lodash');var util=require(_0x2e0e('0x0'));var logger=require(_0x2e0e('0x1'))('api');var moment=require(_0x2e0e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2e0e('0x3'));var config=require('../../config/environment');var attributes=require(_0x2e0e('0x4'));module[_0x2e0e('0x5')]=function(_0x170902,_0x3723c1){return _0x170902[_0x2e0e('0x6')](_0x2e0e('0x7'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 9aa725b..36446d4 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 _0x4322=['message','result','ShowSmsAccount','SmsAccount','find','options','attributes','include','model','map','stringify','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s'];(function(_0x55c603,_0x5dd6ca){var _0x525d68=function(_0x413e40){while(--_0x413e40){_0x55c603['push'](_0x55c603['shift']());}};_0x525d68(++_0x5dd6ca);}(_0x4322,0x198));var _0x2432=function(_0x1185d5,_0x11f04f){_0x1185d5=_0x1185d5-0x0;var _0x110006=_0x4322[_0x1185d5];return _0x110006;};'use strict';var _=require('lodash');var util=require(_0x2432('0x0'));var moment=require(_0x2432('0x1'));var BPromise=require(_0x2432('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2432('0x3'));var db=require(_0x2432('0x4'))['db'];var utils=require(_0x2432('0x5'));var logger=require('../../config/logger')(_0x2432('0x6'));var config=require(_0x2432('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2432('0x8')][_0x2432('0x9')]({'port':0x232a});config['redis']=_[_0x2432('0xa')](config[_0x2432('0xb')],{'host':_0x2432('0xc'),'port':0x18eb});var socket=require(_0x2432('0xd'))(new Redis(config[_0x2432('0xb')]));require(_0x2432('0xe'))['register'](socket);function respondWithRpcPromise(_0x500b3c,_0x5edbc5,_0x84d340){return new BPromise(function(_0x374c25,_0x2ed7f2){return client[_0x2432('0xf')](_0x500b3c,_0x84d340)[_0x2432('0x10')](function(_0x1b95f6){logger[_0x2432('0x11')]('SmsAccount,\x20%s,\x20%s',_0x5edbc5,_0x2432('0x12'));logger[_0x2432('0x13')](_0x2432('0x14'),_0x5edbc5,_0x2432('0x12'),JSON['stringify'](_0x1b95f6));if(_0x1b95f6[_0x2432('0x15')]){if(_0x1b95f6[_0x2432('0x15')][_0x2432('0x16')]===0x1f4){logger[_0x2432('0x15')](_0x2432('0x17'),_0x5edbc5,_0x1b95f6[_0x2432('0x15')][_0x2432('0x18')]);return _0x2ed7f2(_0x1b95f6['error'][_0x2432('0x18')]);}logger['error'](_0x2432('0x17'),_0x5edbc5,_0x1b95f6['error']['message']);return _0x374c25(_0x1b95f6['error'][_0x2432('0x18')]);}else{logger[_0x2432('0x11')](_0x2432('0x17'),_0x5edbc5,_0x2432('0x12'));_0x374c25(_0x1b95f6[_0x2432('0x19')][_0x2432('0x18')]);}})['catch'](function(_0x31a87b){logger[_0x2432('0x15')](_0x2432('0x17'),_0x5edbc5,_0x31a87b);_0x2ed7f2(_0x31a87b);});});}exports[_0x2432('0x1a')]=function(_0x4153a8){var _0x5e7e7d=this;return new Promise(function(_0x10abae,_0x3bf19f){return db[_0x2432('0x1b')][_0x2432('0x1c')]({'raw':_0x4153a8[_0x2432('0x1d')]?_0x4153a8['options']['raw']===undefined?!![]:![]:!![],'where':_0x4153a8[_0x2432('0x1d')]?_0x4153a8[_0x2432('0x1d')]['where']||null:null,'attributes':_0x4153a8['options']?_0x4153a8[_0x2432('0x1d')][_0x2432('0x1e')]||null:null,'include':_0x4153a8[_0x2432('0x1d')]?_0x4153a8[_0x2432('0x1d')][_0x2432('0x1f')]?_['map'](_0x4153a8[_0x2432('0x1d')][_0x2432('0x1f')],function(_0x3d16ac){return{'model':db[_0x3d16ac[_0x2432('0x20')]],'as':_0x3d16ac['as'],'attributes':_0x3d16ac[_0x2432('0x1e')],'include':_0x3d16ac['include']?_[_0x2432('0x21')](_0x3d16ac[_0x2432('0x1f')],function(_0x365fcb){return{'model':db[_0x365fcb['model']],'as':_0x365fcb['as'],'attributes':_0x365fcb[_0x2432('0x1e')],'include':_0x365fcb[_0x2432('0x1f')]?_['map'](_0x365fcb['include'],function(_0x49b8f4){return{'model':db[_0x49b8f4[_0x2432('0x20')]],'as':_0x49b8f4['as'],'attributes':_0x49b8f4[_0x2432('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55a0a2){logger[_0x2432('0x11')](_0x2432('0x1a'),_0x4153a8);logger[_0x2432('0x13')](_0x2432('0x1a'),_0x4153a8,JSON[_0x2432('0x22')](_0x55a0a2));_0x10abae(_0x55a0a2);})[_0x2432('0x23')](function(_0x481333){logger[_0x2432('0x15')](_0x2432('0x1a'),_0x481333['message'],_0x4153a8);_0x3bf19f(_0x5e7e7d[_0x2432('0x15')](0x1f4,_0x481333[_0x2432('0x18')]));});});}; \ No newline at end of file +var _0x13c3=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','register','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','catch','ShowSmsAccount','SmsAccount','options','raw','where','include','model','attributes','map','then','debug','lodash','moment','bluebird','randomstring'];(function(_0x122f9f,_0x378505){var _0x20fce5=function(_0x6a5cf4){while(--_0x6a5cf4){_0x122f9f['push'](_0x122f9f['shift']());}};_0x20fce5(++_0x378505);}(_0x13c3,0x137));var _0x313c=function(_0x1f50b7,_0x3832ab){_0x1f50b7=_0x1f50b7-0x0;var _0xfc3517=_0x13c3[_0x1f50b7];return _0xfc3517;};'use strict';var _=require(_0x313c('0x0'));var util=require('util');var moment=require(_0x313c('0x1'));var BPromise=require(_0x313c('0x2'));var rs=require(_0x313c('0x3'));var fs=require('fs');var Redis=require(_0x313c('0x4'));var db=require(_0x313c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x313c('0x6'))(_0x313c('0x7'));var config=require('../../config/environment');var jayson=require(_0x313c('0x8'));var client=jayson[_0x313c('0x9')][_0x313c('0xa')]({'port':0x232a});config['redis']=_[_0x313c('0xb')](config['redis'],{'host':_0x313c('0xc'),'port':0x18eb});var socket=require(_0x313c('0xd'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x313c('0xe')](socket);function respondWithRpcPromise(_0x36978b,_0x305978,_0x26b804){return new BPromise(function(_0x25bc26,_0x16b5d4){return client['request'](_0x36978b,_0x26b804)['then'](function(_0x358acb){logger[_0x313c('0xf')]('SmsAccount,\x20%s,\x20%s',_0x305978,_0x313c('0x10'));logger['debug'](_0x313c('0x11'),_0x305978,'request\x20sent',JSON[_0x313c('0x12')](_0x358acb));if(_0x358acb['error']){if(_0x358acb[_0x313c('0x13')][_0x313c('0x14')]===0x1f4){logger[_0x313c('0x13')](_0x313c('0x15'),_0x305978,_0x358acb[_0x313c('0x13')][_0x313c('0x16')]);return _0x16b5d4(_0x358acb[_0x313c('0x13')][_0x313c('0x16')]);}logger[_0x313c('0x13')]('SmsAccount,\x20%s,\x20%s',_0x305978,_0x358acb[_0x313c('0x13')][_0x313c('0x16')]);return _0x25bc26(_0x358acb[_0x313c('0x13')][_0x313c('0x16')]);}else{logger[_0x313c('0xf')](_0x313c('0x15'),_0x305978,'request\x20sent');_0x25bc26(_0x358acb['result'][_0x313c('0x16')]);}})[_0x313c('0x17')](function(_0x5bacf5){logger[_0x313c('0x13')](_0x313c('0x15'),_0x305978,_0x5bacf5);_0x16b5d4(_0x5bacf5);});});}exports[_0x313c('0x18')]=function(_0x354d71){var _0x1ae104=this;return new Promise(function(_0x47dcd1,_0x55cd46){return db[_0x313c('0x19')]['find']({'raw':_0x354d71['options']?_0x354d71[_0x313c('0x1a')][_0x313c('0x1b')]===undefined?!![]:![]:!![],'where':_0x354d71[_0x313c('0x1a')]?_0x354d71[_0x313c('0x1a')][_0x313c('0x1c')]||null:null,'attributes':_0x354d71[_0x313c('0x1a')]?_0x354d71[_0x313c('0x1a')]['attributes']||null:null,'include':_0x354d71[_0x313c('0x1a')]?_0x354d71['options'][_0x313c('0x1d')]?_['map'](_0x354d71[_0x313c('0x1a')]['include'],function(_0x2d313c){return{'model':db[_0x2d313c[_0x313c('0x1e')]],'as':_0x2d313c['as'],'attributes':_0x2d313c[_0x313c('0x1f')],'include':_0x2d313c[_0x313c('0x1d')]?_[_0x313c('0x20')](_0x2d313c[_0x313c('0x1d')],function(_0x16b124){return{'model':db[_0x16b124[_0x313c('0x1e')]],'as':_0x16b124['as'],'attributes':_0x16b124['attributes'],'include':_0x16b124[_0x313c('0x1d')]?_[_0x313c('0x20')](_0x16b124[_0x313c('0x1d')],function(_0x2f7d41){return{'model':db[_0x2f7d41[_0x313c('0x1e')]],'as':_0x2f7d41['as'],'attributes':_0x2f7d41[_0x313c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x313c('0x21')](function(_0x25bb3e){logger[_0x313c('0xf')]('ShowSmsAccount',_0x354d71);logger[_0x313c('0x22')]('ShowSmsAccount',_0x354d71,JSON[_0x313c('0x12')](_0x25bb3e));_0x47dcd1(_0x25bb3e);})[_0x313c('0x17')](function(_0x12cdab){logger[_0x313c('0x13')](_0x313c('0x18'),_0x12cdab[_0x313c('0x16')],_0x354d71);_0x55cd46(_0x1ae104[_0x313c('0x13')](0x1f4,_0x12cdab[_0x313c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index fbdd5e4..aba9157 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 06cd458..aea428d 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x176f0d,_0x28d379){var _0x444789=function(_0x48f64a){while(--_0x48f64a){_0x176f0d['push'](_0x176f0d['shift']());}};_0x444789(++_0x28d379);}(_0xedd9,0xfc));var _0x9edd=function(_0x5785a0,_0x4a5e9d){_0x5785a0=_0x5785a0-0x0;var _0x5d120c=_0xedd9[_0x5785a0];return _0x5d120c;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file +var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5b2312,_0x36d65b){var _0x30f634=function(_0x2c7bf8){while(--_0x2c7bf8){_0x5b2312['push'](_0x5b2312['shift']());}};_0x30f634(++_0x36d65b);}(_0xedd9,0xfc));var _0x9edd=function(_0x3e3daa,_0x44bf35){_0x3e3daa=_0x3e3daa-0x0;var _0x52be33=_0xedd9[_0x3e3daa];return _0x52be33;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 0d7e5fc..caa6aa2 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 _0x3622=['*,*,*,*','STRING','noop'];(function(_0x499217,_0x400dd5){var _0x5e3c53=function(_0xe8344c){while(--_0xe8344c){_0x499217['push'](_0x499217['shift']());}};_0x5e3c53(++_0x400dd5);}(_0x3622,0x70));var _0x2362=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0x3622[_0x365e54];return _0x13317a;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2362('0x0')],'allowNull':![],'defaultValue':_0x2362('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2362('0x0')]},'interval':{'type':Sequelize[_0x2362('0x0')],'defaultValue':_0x2362('0x2')}}; \ No newline at end of file +var _0x9140=['TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x1123a4,_0x5b42cd){var _0x4cb7be=function(_0x5047ef){while(--_0x5047ef){_0x1123a4['push'](_0x1123a4['shift']());}};_0x4cb7be(++_0x5b42cd);}(_0x9140,0x8e));var _0x0914=function(_0x24daae,_0x4098f0){_0x24daae=_0x24daae-0x0;var _0x4d18ae=_0x9140[_0x24daae];return _0x4d18ae;};'use strict';var Sequelize=require('sequelize');module[_0x0914('0x0')]={'priority':{'type':Sequelize[_0x0914('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0914('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0914('0x3')]()},'description':{'type':Sequelize[_0x0914('0x2')]},'interval':{'type':Sequelize[_0x0914('0x2')],'defaultValue':_0x0914('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index e5215b2..87f2cac 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 _0xbe5c=['pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','SmsApplication','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe5c,0xe8));var _0xcbe5=function(_0x1bd49b,_0x139307){_0x1bd49b=_0x1bd49b-0x0;var _0xdc3b5d=_0xbe5c[_0x1bd49b];return _0xdc3b5d;};'use strict';var emlformat=require(_0xcbe5('0x0'));var rimraf=require(_0xcbe5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcbe5('0x2'));var rp=require('request-promise');var moment=require(_0xcbe5('0x3'));var BPromise=require(_0xcbe5('0x4'));var Mustache=require(_0xcbe5('0x5'));var util=require(_0xcbe5('0x6'));var path=require(_0xcbe5('0x7'));var sox=require(_0xcbe5('0x8'));var csv=require(_0xcbe5('0x9'));var ejs=require(_0xcbe5('0xa'));var fs=require('fs');var fs_extra=require(_0xcbe5('0xb'));var _=require(_0xcbe5('0xc'));var squel=require(_0xcbe5('0xd'));var crypto=require(_0xcbe5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcbe5('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcbe5('0x10'));var Papa=require(_0xcbe5('0x11'));var Redis=require('ioredis');var authService=require(_0xcbe5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcbe5('0x13'));var hardwareService=require(_0xcbe5('0x14'));var logger=require('../../config/logger')(_0xcbe5('0x15'));var utils=require('../../config/utils');var config=require(_0xcbe5('0x16'));var licenseUtil=require(_0xcbe5('0x17'));var db=require(_0xcbe5('0x18'))['db'];function respondWithStatusCode(_0x29338f,_0xe236c4){_0xe236c4=_0xe236c4||0xcc;return function(_0x4e6157){if(_0x4e6157){return _0x29338f[_0xcbe5('0x19')](_0xe236c4);}return _0x29338f[_0xcbe5('0x1a')](_0xe236c4)[_0xcbe5('0x1b')]();};}function respondWithResult(_0x408963,_0x5a986e){_0x5a986e=_0x5a986e||0xc8;return function(_0x269de6){if(_0x269de6){return _0x408963[_0xcbe5('0x1a')](_0x5a986e)[_0xcbe5('0x1c')](_0x269de6);}};}function respondWithFilteredResult(_0x4ef00d,_0x1da9aa){return function(_0x5207eb){if(_0x5207eb){var _0x1d6430=typeof _0x1da9aa['offset']==='undefined'&&typeof _0x1da9aa['limit']===_0xcbe5('0x1d');var _0x264a45=_0x5207eb[_0xcbe5('0x1e')];var _0x3e19bc=_0x1d6430?0x0:_0x1da9aa['offset'];var _0x1410c6=_0x1d6430?_0x5207eb[_0xcbe5('0x1e')]:_0x1da9aa['offset']+_0x1da9aa[_0xcbe5('0x1f')];var _0x30ef52;if(_0x1410c6>=_0x264a45){_0x1410c6=_0x264a45;_0x30ef52=0xc8;}else{_0x30ef52=0xce;}_0x4ef00d[_0xcbe5('0x1a')](_0x30ef52);return _0x4ef00d['set'](_0xcbe5('0x20'),_0x3e19bc+'-'+_0x1410c6+'/'+_0x264a45)[_0xcbe5('0x1c')](_0x5207eb);}return null;};}function patchUpdates(_0x25c098){return function(_0x4951ef){try{jsonpatch['apply'](_0x4951ef,_0x25c098,!![]);}catch(_0x388366){return BPromise[_0xcbe5('0x21')](_0x388366);}return _0x4951ef[_0xcbe5('0x22')]();};}function saveUpdates(_0x1c791b,_0x3dd89b){return function(_0x2271f9){if(_0x2271f9){return _0x2271f9[_0xcbe5('0x23')](_0x1c791b)[_0xcbe5('0x24')](function(_0x4cbb43){return _0x4cbb43;});}return null;};}function removeEntity(_0xa5c54d,_0x5c17fa){return function(_0x2287ff){if(_0x2287ff){return _0x2287ff[_0xcbe5('0x25')]()['then'](function(){_0xa5c54d[_0xcbe5('0x1a')](0xcc)[_0xcbe5('0x1b')]();});}};}function handleEntityNotFound(_0x1f9f11,_0x54bcb7){return function(_0x5be376){if(!_0x5be376){_0x1f9f11[_0xcbe5('0x19')](0x194);}return _0x5be376;};}function handleError(_0x1673c3,_0x500e1c){_0x500e1c=_0x500e1c||0x1f4;return function(_0x128a05){logger[_0xcbe5('0x26')](_0x128a05['stack']);if(_0x128a05[_0xcbe5('0x27')]){delete _0x128a05['name'];}_0x1673c3[_0xcbe5('0x1a')](_0x500e1c)[_0xcbe5('0x28')](_0x128a05);};}exports[_0xcbe5('0x29')]=function(_0x2ea5cf,_0x5d580f){var _0x3af891={},_0x41fd90={},_0x285aa6={'count':0x0,'rows':[]};var _0x1d530f=_[_0xcbe5('0x2a')](db[_0xcbe5('0x2b')]['rawAttributes'],function(_0x26677d){return{'name':_0x26677d[_0xcbe5('0x2c')],'type':_0x26677d[_0xcbe5('0x2d')][_0xcbe5('0x2e')]};});_0x41fd90[_0xcbe5('0x2f')]=_['map'](_0x1d530f,'name');_0x41fd90['query']=_[_0xcbe5('0x30')](_0x2ea5cf[_0xcbe5('0x31')]);_0x41fd90[_0xcbe5('0x32')]=_['intersection'](_0x41fd90[_0xcbe5('0x2f')],_0x41fd90[_0xcbe5('0x31')]);_0x3af891[_0xcbe5('0x33')]=_[_0xcbe5('0x34')](_0x41fd90[_0xcbe5('0x2f')],qs[_0xcbe5('0x35')](_0x2ea5cf[_0xcbe5('0x31')][_0xcbe5('0x35')]));_0x3af891[_0xcbe5('0x33')]=_0x3af891[_0xcbe5('0x33')][_0xcbe5('0x36')]?_0x3af891[_0xcbe5('0x33')]:_0x41fd90['model'];if(!_0x2ea5cf[_0xcbe5('0x31')][_0xcbe5('0x37')](_0xcbe5('0x38'))){_0x3af891[_0xcbe5('0x1f')]=qs[_0xcbe5('0x1f')](_0x2ea5cf[_0xcbe5('0x31')][_0xcbe5('0x1f')]);_0x3af891[_0xcbe5('0x39')]=qs['offset'](_0x2ea5cf['query']['offset']);}_0x3af891['order']=qs[_0xcbe5('0x3a')](_0x2ea5cf[_0xcbe5('0x31')]['sort']);_0x3af891[_0xcbe5('0x3b')]=qs[_0xcbe5('0x32')](_[_0xcbe5('0x3c')](_0x2ea5cf['query'],_0x41fd90[_0xcbe5('0x32')]),_0x1d530f);if(_0x2ea5cf[_0xcbe5('0x31')][_0xcbe5('0x3d')]){_0x3af891['where']=_[_0xcbe5('0x3e')](_0x3af891[_0xcbe5('0x3b')],{'$or':_[_0xcbe5('0x2a')](_0x1d530f,function(_0x4fdf11){if(_0x4fdf11[_0xcbe5('0x2d')]!==_0xcbe5('0x3f')){var _0x20eb64={};_0x20eb64[_0x4fdf11[_0xcbe5('0x27')]]={'$like':'%'+_0x2ea5cf[_0xcbe5('0x31')][_0xcbe5('0x3d')]+'%'};return _0x20eb64;}})});}_0x3af891=_[_0xcbe5('0x3e')]({},_0x3af891,_0x2ea5cf[_0xcbe5('0x40')]);var _0x176932={'where':_0x3af891[_0xcbe5('0x3b')]};return db[_0xcbe5('0x2b')][_0xcbe5('0x1e')](_0x176932)[_0xcbe5('0x24')](function(_0x2087b4){_0x285aa6[_0xcbe5('0x1e')]=_0x2087b4;if(_0x2ea5cf['query'][_0xcbe5('0x41')]){_0x3af891[_0xcbe5('0x42')]=[{'all':!![]}];}return db[_0xcbe5('0x2b')]['findAll'](_0x3af891);})['then'](function(_0x5831e3){_0x285aa6[_0xcbe5('0x43')]=_0x5831e3;return _0x285aa6;})[_0xcbe5('0x24')](respondWithFilteredResult(_0x5d580f,_0x3af891))['catch'](handleError(_0x5d580f,null));};exports[_0xcbe5('0x44')]=function(_0x490b1a,_0x13e727){var _0x4262eb={'raw':!![],'where':{'id':_0x490b1a[_0xcbe5('0x45')]['id']}},_0x2763cc={};_0x2763cc[_0xcbe5('0x2f')]=_[_0xcbe5('0x30')](db[_0xcbe5('0x2b')]['rawAttributes']);_0x2763cc['query']=_[_0xcbe5('0x30')](_0x490b1a[_0xcbe5('0x31')]);_0x2763cc[_0xcbe5('0x32')]=_[_0xcbe5('0x34')](_0x2763cc[_0xcbe5('0x2f')],_0x2763cc['query']);_0x4262eb['attributes']=_['intersection'](_0x2763cc[_0xcbe5('0x2f')],qs[_0xcbe5('0x35')](_0x490b1a[_0xcbe5('0x31')][_0xcbe5('0x35')]));_0x4262eb[_0xcbe5('0x33')]=_0x4262eb[_0xcbe5('0x33')][_0xcbe5('0x36')]?_0x4262eb['attributes']:_0x2763cc['model'];if(_0x490b1a[_0xcbe5('0x31')][_0xcbe5('0x41')]){_0x4262eb[_0xcbe5('0x42')]=[{'all':!![]}];}_0x4262eb=_[_0xcbe5('0x3e')]({},_0x4262eb,_0x490b1a[_0xcbe5('0x40')]);return db['SmsApplication'][_0xcbe5('0x46')](_0x4262eb)[_0xcbe5('0x24')](handleEntityNotFound(_0x13e727,null))[_0xcbe5('0x24')](respondWithResult(_0x13e727,null))[_0xcbe5('0x47')](handleError(_0x13e727,null));};exports['create']=function(_0x471040,_0x56ac2f){return db[_0xcbe5('0x2b')]['create'](_0x471040[_0xcbe5('0x48')],{})[_0xcbe5('0x24')](respondWithResult(_0x56ac2f,0xc9))[_0xcbe5('0x47')](handleError(_0x56ac2f,null));};exports['update']=function(_0x21d7de,_0x4cb9b0){if(_0x21d7de[_0xcbe5('0x48')]['id']){delete _0x21d7de['body']['id'];}return db['SmsApplication']['find']({'where':{'id':_0x21d7de[_0xcbe5('0x45')]['id']}})[_0xcbe5('0x24')](handleEntityNotFound(_0x4cb9b0,null))[_0xcbe5('0x24')](saveUpdates(_0x21d7de[_0xcbe5('0x48')],null))[_0xcbe5('0x24')](respondWithResult(_0x4cb9b0,null))[_0xcbe5('0x47')](handleError(_0x4cb9b0,null));};exports[_0xcbe5('0x25')]=function(_0x329f0a,_0x189d9d){return db['SmsApplication']['find']({'where':{'id':_0x329f0a['params']['id']}})[_0xcbe5('0x24')](handleEntityNotFound(_0x189d9d,null))[_0xcbe5('0x24')](removeEntity(_0x189d9d,null))[_0xcbe5('0x47')](handleError(_0x189d9d,null));}; \ No newline at end of file +var _0xbefb=['find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','update','destroy','then','sendStatus','stack','name','send','index','map','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','options','includeAll','SmsApplication','findAll','rows','catch','params','keys'];(function(_0x8ef572,_0x5cfd9c){var _0x3edf84=function(_0x2809c2){while(--_0x2809c2){_0x8ef572['push'](_0x8ef572['shift']());}};_0x3edf84(++_0x5cfd9c);}(_0xbefb,0x161));var _0xbbef=function(_0x177aae,_0x30fae7){_0x177aae=_0x177aae-0x0;var _0xa3cee0=_0xbefb[_0x177aae];return _0xa3cee0;};'use strict';var emlformat=require(_0xbbef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbbef('0x1'));var jsonpatch=require(_0xbbef('0x2'));var rp=require(_0xbbef('0x3'));var moment=require(_0xbbef('0x4'));var BPromise=require(_0xbbef('0x5'));var Mustache=require(_0xbbef('0x6'));var util=require(_0xbbef('0x7'));var path=require(_0xbbef('0x8'));var sox=require(_0xbbef('0x9'));var csv=require(_0xbbef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbbef('0xb'));var squel=require(_0xbbef('0xc'));var crypto=require(_0xbbef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbbef('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbbef('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbbef('0x10'));var qs=require(_0xbbef('0x11'));var as=require(_0xbbef('0x12'));var hardwareService=require(_0xbbef('0x13'));var logger=require('../../config/logger')(_0xbbef('0x14'));var utils=require(_0xbbef('0x15'));var config=require(_0xbbef('0x16'));var licenseUtil=require(_0xbbef('0x17'));var db=require(_0xbbef('0x18'))['db'];function respondWithStatusCode(_0x3df707,_0x52f2e3){_0x52f2e3=_0x52f2e3||0xcc;return function(_0x13355c){if(_0x13355c){return _0x3df707['sendStatus'](_0x52f2e3);}return _0x3df707[_0xbbef('0x19')](_0x52f2e3)[_0xbbef('0x1a')]();};}function respondWithResult(_0x62d1e2,_0x5664f0){_0x5664f0=_0x5664f0||0xc8;return function(_0x359d15){if(_0x359d15){return _0x62d1e2[_0xbbef('0x19')](_0x5664f0)[_0xbbef('0x1b')](_0x359d15);}};}function respondWithFilteredResult(_0x137096,_0x382b87){return function(_0x14678d){if(_0x14678d){var _0x5a855a=typeof _0x382b87['offset']==='undefined'&&typeof _0x382b87[_0xbbef('0x1c')]===_0xbbef('0x1d');var _0x17baf8=_0x14678d[_0xbbef('0x1e')];var _0x473faf=_0x5a855a?0x0:_0x382b87[_0xbbef('0x1f')];var _0x18716f=_0x5a855a?_0x14678d['count']:_0x382b87[_0xbbef('0x1f')]+_0x382b87[_0xbbef('0x1c')];var _0x2b22f2;if(_0x18716f>=_0x17baf8){_0x18716f=_0x17baf8;_0x2b22f2=0xc8;}else{_0x2b22f2=0xce;}_0x137096[_0xbbef('0x19')](_0x2b22f2);return _0x137096[_0xbbef('0x20')](_0xbbef('0x21'),_0x473faf+'-'+_0x18716f+'/'+_0x17baf8)['json'](_0x14678d);}return null;};}function patchUpdates(_0x1fb8d5){return function(_0x5a92d1){try{jsonpatch['apply'](_0x5a92d1,_0x1fb8d5,!![]);}catch(_0x4e5507){return BPromise[_0xbbef('0x22')](_0x4e5507);}return _0x5a92d1['save']();};}function saveUpdates(_0x4016d3,_0x338055){return function(_0x263842){if(_0x263842){return _0x263842[_0xbbef('0x23')](_0x4016d3)['then'](function(_0x100b13){return _0x100b13;});}return null;};}function removeEntity(_0x1b756a,_0x28883e){return function(_0x4a7209){if(_0x4a7209){return _0x4a7209[_0xbbef('0x24')]()[_0xbbef('0x25')](function(){_0x1b756a['status'](0xcc)[_0xbbef('0x1a')]();});}};}function handleEntityNotFound(_0x2b315c,_0x59d1ee){return function(_0x525ab4){if(!_0x525ab4){_0x2b315c[_0xbbef('0x26')](0x194);}return _0x525ab4;};}function handleError(_0x53e455,_0x4fbc60){_0x4fbc60=_0x4fbc60||0x1f4;return function(_0xe8fd2a){logger['error'](_0xe8fd2a[_0xbbef('0x27')]);if(_0xe8fd2a[_0xbbef('0x28')]){delete _0xe8fd2a[_0xbbef('0x28')];}_0x53e455['status'](_0x4fbc60)[_0xbbef('0x29')](_0xe8fd2a);};}exports[_0xbbef('0x2a')]=function(_0x2f097b,_0x35638e){var _0x4e33a7={},_0x4dd449={},_0xf56c01={'count':0x0,'rows':[]};var _0x3686b5=_[_0xbbef('0x2b')](db['SmsApplication'][_0xbbef('0x2c')],function(_0x34c159){return{'name':_0x34c159['fieldName'],'type':_0x34c159[_0xbbef('0x2d')]['key']};});_0x4dd449[_0xbbef('0x2e')]=_['map'](_0x3686b5,'name');_0x4dd449[_0xbbef('0x2f')]=_['keys'](_0x2f097b[_0xbbef('0x2f')]);_0x4dd449['filters']=_[_0xbbef('0x30')](_0x4dd449[_0xbbef('0x2e')],_0x4dd449['query']);_0x4e33a7[_0xbbef('0x31')]=_[_0xbbef('0x30')](_0x4dd449[_0xbbef('0x2e')],qs[_0xbbef('0x32')](_0x2f097b['query'][_0xbbef('0x32')]));_0x4e33a7[_0xbbef('0x31')]=_0x4e33a7[_0xbbef('0x31')][_0xbbef('0x33')]?_0x4e33a7[_0xbbef('0x31')]:_0x4dd449[_0xbbef('0x2e')];if(!_0x2f097b[_0xbbef('0x2f')][_0xbbef('0x34')](_0xbbef('0x35'))){_0x4e33a7[_0xbbef('0x1c')]=qs[_0xbbef('0x1c')](_0x2f097b[_0xbbef('0x2f')]['limit']);_0x4e33a7[_0xbbef('0x1f')]=qs['offset'](_0x2f097b[_0xbbef('0x2f')][_0xbbef('0x1f')]);}_0x4e33a7['order']=qs[_0xbbef('0x36')](_0x2f097b[_0xbbef('0x2f')]['sort']);_0x4e33a7[_0xbbef('0x37')]=qs['filters'](_['pick'](_0x2f097b[_0xbbef('0x2f')],_0x4dd449[_0xbbef('0x38')]),_0x3686b5);if(_0x2f097b[_0xbbef('0x2f')]['filter']){_0x4e33a7['where']=_[_0xbbef('0x39')](_0x4e33a7[_0xbbef('0x37')],{'$or':_[_0xbbef('0x2b')](_0x3686b5,function(_0x471bf4){if(_0x471bf4[_0xbbef('0x2d')]!==_0xbbef('0x3a')){var _0x1ad402={};_0x1ad402[_0x471bf4[_0xbbef('0x28')]]={'$like':'%'+_0x2f097b[_0xbbef('0x2f')]['filter']+'%'};return _0x1ad402;}})});}_0x4e33a7=_[_0xbbef('0x39')]({},_0x4e33a7,_0x2f097b[_0xbbef('0x3b')]);var _0x1c4f63={'where':_0x4e33a7[_0xbbef('0x37')]};return db['SmsApplication'][_0xbbef('0x1e')](_0x1c4f63)[_0xbbef('0x25')](function(_0x15f887){_0xf56c01['count']=_0x15f887;if(_0x2f097b[_0xbbef('0x2f')][_0xbbef('0x3c')]){_0x4e33a7['include']=[{'all':!![]}];}return db[_0xbbef('0x3d')][_0xbbef('0x3e')](_0x4e33a7);})['then'](function(_0x7a7bf){_0xf56c01[_0xbbef('0x3f')]=_0x7a7bf;return _0xf56c01;})[_0xbbef('0x25')](respondWithFilteredResult(_0x35638e,_0x4e33a7))[_0xbbef('0x40')](handleError(_0x35638e,null));};exports['show']=function(_0x45c425,_0x65fdc9){var _0x450793={'raw':!![],'where':{'id':_0x45c425[_0xbbef('0x41')]['id']}},_0x7fe1c7={};_0x7fe1c7['model']=_[_0xbbef('0x42')](db[_0xbbef('0x3d')][_0xbbef('0x2c')]);_0x7fe1c7[_0xbbef('0x2f')]=_[_0xbbef('0x42')](_0x45c425[_0xbbef('0x2f')]);_0x7fe1c7[_0xbbef('0x38')]=_['intersection'](_0x7fe1c7[_0xbbef('0x2e')],_0x7fe1c7[_0xbbef('0x2f')]);_0x450793[_0xbbef('0x31')]=_[_0xbbef('0x30')](_0x7fe1c7[_0xbbef('0x2e')],qs[_0xbbef('0x32')](_0x45c425[_0xbbef('0x2f')][_0xbbef('0x32')]));_0x450793[_0xbbef('0x31')]=_0x450793[_0xbbef('0x31')][_0xbbef('0x33')]?_0x450793[_0xbbef('0x31')]:_0x7fe1c7[_0xbbef('0x2e')];if(_0x45c425[_0xbbef('0x2f')][_0xbbef('0x3c')]){_0x450793['include']=[{'all':!![]}];}_0x450793=_[_0xbbef('0x39')]({},_0x450793,_0x45c425[_0xbbef('0x3b')]);return db[_0xbbef('0x3d')][_0xbbef('0x43')](_0x450793)[_0xbbef('0x25')](handleEntityNotFound(_0x65fdc9,null))[_0xbbef('0x25')](respondWithResult(_0x65fdc9,null))[_0xbbef('0x40')](handleError(_0x65fdc9,null));};exports[_0xbbef('0x44')]=function(_0x3cedc2,_0x3289e0){return db[_0xbbef('0x3d')][_0xbbef('0x44')](_0x3cedc2[_0xbbef('0x45')],{})[_0xbbef('0x25')](respondWithResult(_0x3289e0,0xc9))[_0xbbef('0x40')](handleError(_0x3289e0,null));};exports['update']=function(_0x1f668c,_0x4fe358){if(_0x1f668c[_0xbbef('0x45')]['id']){delete _0x1f668c[_0xbbef('0x45')]['id'];}return db[_0xbbef('0x3d')][_0xbbef('0x43')]({'where':{'id':_0x1f668c['params']['id']}})[_0xbbef('0x25')](handleEntityNotFound(_0x4fe358,null))[_0xbbef('0x25')](saveUpdates(_0x1f668c[_0xbbef('0x45')],null))['then'](respondWithResult(_0x4fe358,null))[_0xbbef('0x40')](handleError(_0x4fe358,null));};exports['destroy']=function(_0x5924f5,_0x24bbe3){return db[_0xbbef('0x3d')][_0xbbef('0x43')]({'where':{'id':_0x5924f5[_0xbbef('0x41')]['id']}})[_0xbbef('0x25')](handleEntityNotFound(_0x24bbe3,null))[_0xbbef('0x25')](removeEntity(_0x24bbe3,null))['catch'](handleError(_0x24bbe3,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 5ffe853..593e0a9 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 _0xe250=['SmsApplication','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','define'];(function(_0x7185f7,_0x37065){var _0x182e45=function(_0x519e0d){while(--_0x519e0d){_0x7185f7['push'](_0x7185f7['shift']());}};_0x182e45(++_0x37065);}(_0xe250,0x12b));var _0x0e25=function(_0x1f06aa,_0x2ec8e0){_0x1f06aa=_0x1f06aa-0x0;var _0x4bda3d=_0xe250[_0x1f06aa];return _0x4bda3d;};'use strict';var _=require('lodash');var util=require(_0x0e25('0x0'));var logger=require('../../config/logger')(_0x0e25('0x1'));var moment=require(_0x0e25('0x2'));var BPromise=require(_0x0e25('0x3'));var rp=require(_0x0e25('0x4'));var fs=require('fs');var path=require(_0x0e25('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module['exports']=function(_0x5cfbfe,_0x5d7802){return _0x5cfbfe[_0x0e25('0x6')](_0x0e25('0x7'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0e25('0x8')});}; \ No newline at end of file +var _0x850a=['sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication'];(function(_0x3c5f82,_0x5f1989){var _0x3fb8ff=function(_0xd9abd8){while(--_0xd9abd8){_0x3c5f82['push'](_0x3c5f82['shift']());}};_0x3fb8ff(++_0x5f1989);}(_0x850a,0x123));var _0xa850=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x850a[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xa850('0x0'));var util=require(_0xa850('0x1'));var logger=require(_0xa850('0x2'))(_0xa850('0x3'));var moment=require(_0xa850('0x4'));var BPromise=require('bluebird');var rp=require(_0xa850('0x5'));var fs=require('fs');var path=require(_0xa850('0x6'));var rimraf=require(_0xa850('0x7'));var config=require(_0xa850('0x8'));var attributes=require(_0xa850('0x9'));module[_0xa850('0xa')]=function(_0x5501ab,_0x48a0a8){return _0x5501ab[_0xa850('0xb')](_0xa850('0xc'),attributes,{'tableName':_0xa850('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa850('0xe'),'collate':_0xa850('0xf')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index e83286a..3a2cfd4 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 _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SmsApplication,\x20%s,\x20%s','message','catch','lodash'];(function(_0x20472e,_0x4633a7){var _0x320426=function(_0x39d102){while(--_0x39d102){_0x20472e['push'](_0x20472e['shift']());}};_0x320426(++_0x4633a7);}(_0x66fa,0x117));var _0xa66f=function(_0x1faca3,_0x1c1ebc){_0x1faca3=_0x1faca3-0x0;var _0x4d0a32=_0x66fa[_0x1faca3];return _0x4d0a32;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('SmsApplication,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('SmsApplication,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file +var _0x881e=['stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SmsApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x106972,_0x35d62b){var _0xdea321=function(_0x14eb8c){while(--_0x14eb8c){_0x106972['push'](_0x106972['shift']());}};_0xdea321(++_0x35d62b);}(_0x881e,0x146));var _0xe881=function(_0x5e1557,_0x31ae98){_0x5e1557=_0x5e1557-0x0;var _0x250536=_0x881e[_0x5e1557];return _0x250536;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe881('0x0'));var BPromise=require(_0xe881('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe881('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe881('0x3'));var logger=require(_0xe881('0x4'))(_0xe881('0x5'));var config=require(_0xe881('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe881('0x7')][_0xe881('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x561c1c,_0x3f6894,_0x2413dc){return new BPromise(function(_0xe16d23,_0x547217){return client['request'](_0x561c1c,_0x2413dc)[_0xe881('0x9')](function(_0x26e29e){logger[_0xe881('0xa')](_0xe881('0xb'),_0x3f6894,'request\x20sent');logger[_0xe881('0xc')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x3f6894,_0xe881('0xd'),JSON[_0xe881('0xe')](_0x26e29e));if(_0x26e29e[_0xe881('0xf')]){if(_0x26e29e[_0xe881('0xf')][_0xe881('0x10')]===0x1f4){logger[_0xe881('0xf')](_0xe881('0xb'),_0x3f6894,_0x26e29e['error'][_0xe881('0x11')]);return _0x547217(_0x26e29e[_0xe881('0xf')][_0xe881('0x11')]);}logger['error'](_0xe881('0xb'),_0x3f6894,_0x26e29e['error'][_0xe881('0x11')]);return _0xe16d23(_0x26e29e[_0xe881('0xf')][_0xe881('0x11')]);}else{logger[_0xe881('0xa')]('SmsApplication,\x20%s,\x20%s',_0x3f6894,_0xe881('0xd'));_0xe16d23(_0x26e29e[_0xe881('0x12')][_0xe881('0x11')]);}})[_0xe881('0x13')](function(_0x59b441){logger[_0xe881('0xf')](_0xe881('0xb'),_0x3f6894,_0x59b441);_0x547217(_0x59b441);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index b32a204..a3180b9 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 _0xe511=['addTags','put','update','smsinteraction:destroy','destroy','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','describe','show','/:id/messages','isAuthenticated','getMessages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xe511,0x16f));var _0x1e51=function(_0x48b4a1,_0x3c2bf4){_0x48b4a1=_0x48b4a1-0x0;var _0x2df379=_0xe511[_0x48b4a1];return _0x2df379;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xb')]);router[_0x1e51('0x8')](_0x1e51('0xc'),auth[_0x1e51('0xd')](),controller[_0x1e51('0xe')]);router[_0x1e51('0x8')]('/:id/download',auth[_0x1e51('0xd')](),controller[_0x1e51('0xf')]);router[_0x1e51('0x10')]('/',auth[_0x1e51('0xd')](),controller[_0x1e51('0x11')]);router[_0x1e51('0x10')]('/:id/messages',auth[_0x1e51('0xd')](),controller[_0x1e51('0x12')]);router[_0x1e51('0x10')](_0x1e51('0x13'),auth[_0x1e51('0xd')](),interaction[_0x1e51('0x14')](_0x1e51('0x15'),_0x1e51('0x16')),controller[_0x1e51('0x17')]);router[_0x1e51('0x18')]('/:id',auth[_0x1e51('0xd')](),interaction[_0x1e51('0x14')](_0x1e51('0x15'),'smsinteraction:update'),controller[_0x1e51('0x19')]);router['delete']('/:id',auth[_0x1e51('0xd')](),interaction[_0x1e51('0x14')](_0x1e51('0x15'),_0x1e51('0x1a')),controller[_0x1e51('0x1b')]);router[_0x1e51('0x1c')]('/:id/tags',auth[_0x1e51('0xd')](),controller['removeTags']);module[_0x1e51('0x1d')]=router; \ No newline at end of file +var _0x0972=['tracked','sms','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x22f1c5,_0x2f778a){var _0x26d77f=function(_0x98b4b9){while(--_0x98b4b9){_0x22f1c5['push'](_0x22f1c5['shift']());}};_0x26d77f(++_0x2f778a);}(_0x0972,0x64));var _0x2097=function(_0x44c5a0,_0x39c1df){_0x44c5a0=_0x44c5a0-0x0;var _0x33452e=_0x0972[_0x44c5a0];return _0x33452e;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/describe',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['show']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0x7')](_0x2097('0xe'),auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0x10')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x11')]);router[_0x2097('0x10')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0x12')]);router[_0x2097('0x10')](_0x2097('0x13'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')](_0x2097('0x15'),'smsinteraction:addtags'),controller[_0x2097('0x16')]);router[_0x2097('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x2097('0x15'),'smsinteraction:update'),controller[_0x2097('0x18')]);router[_0x2097('0x19')](_0x2097('0xb'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')]('sms',_0x2097('0x1a')),controller[_0x2097('0x1b')]);router[_0x2097('0x19')](_0x2097('0x13'),auth[_0x2097('0x8')](),controller[_0x2097('0x1c')]);module[_0x2097('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 93e00ab..a6c991b 100644 --- a/server/api/smsInteraction/smsInteraction.attributes.js +++ b/server/api/smsInteraction/smsInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36b2=['ENUM','out','BOOLEAN','sequelize','moment','exports','DATE','STRING'];(function(_0x848300,_0xd6f38a){var _0x50ace4=function(_0x99adc6){while(--_0x99adc6){_0x848300['push'](_0x848300['shift']());}};_0x50ace4(++_0xd6f38a);}(_0x36b2,0x6b));var _0x236b=function(_0x216943,_0x2a2265){_0x216943=_0x216943-0x0;var _0x3ab407=_0x36b2[_0x216943];return _0x3ab407;};'use strict';var Sequelize=require(_0x236b('0x0'));var moment=require(_0x236b('0x1'));module[_0x236b('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x236b('0x3')]},'disposition':{'type':Sequelize[_0x236b('0x4')]},'secondDisposition':{'type':Sequelize[_0x236b('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x236b('0x4')]},'phone':{'type':Sequelize[_0x236b('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x236b('0x5')]('in',_0x236b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x236b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x236b('0x5')]('in',_0x236b('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x236b('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xe260=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe260,0x94));var _0x0e26=function(_0x53efd7,_0x1f1df1){_0x53efd7=_0x53efd7-0x0;var _0x139b4a=_0xe260[_0x53efd7];return _0x139b4a;};'use strict';var Sequelize=require(_0x0e26('0x0'));var moment=require('moment');module[_0x0e26('0x1')]={'closed':{'type':Sequelize[_0x0e26('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0e26('0x3')]},'disposition':{'type':Sequelize[_0x0e26('0x4')]},'secondDisposition':{'type':Sequelize[_0x0e26('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0e26('0x4')]},'note':{'type':Sequelize[_0x0e26('0x4')]},'phone':{'type':Sequelize[_0x0e26('0x4')]},'read1stAt':{'type':Sequelize[_0x0e26('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0e26('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0e26('0x5')]('in',_0x0e26('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0e26('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 88703cd..b7af66c 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 _0x3c4d=['disposition','direction','System','lastName','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','reject','save','update','error','name','Users','map','fullname','TagIds','split','forEach','then','catch','waiting','talking','unmanaged','closed','UserId','total','index','SmsInteraction','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','select','field','color','from','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','body','some','compact','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','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','contactName','i.*','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.SmsInteractionId\x20IN\x20?','groupBy','push','all','show','params','keys','includeAll','include','create','destroy','addMessage','SmsMessage','ids','omit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','User','CmContact','firstName','Messages','secret','SmsAccount','Sms','Owner','N.A.','closedAt'];(function(_0x40c98c,_0x1ef7ea){var _0x27e636=function(_0x37e316){while(--_0x37e316){_0x40c98c['push'](_0x40c98c['shift']());}};_0x27e636(++_0x1ef7ea);}(_0x3c4d,0x1dd));var _0xd3c4=function(_0x120aaf,_0x2fc83a){_0x120aaf=_0x120aaf-0x0;var _0x20bdde=_0x3c4d[_0x120aaf];return _0x20bdde;};'use strict';var emlformat=require(_0xd3c4('0x0'));var rimraf=require(_0xd3c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3c4('0x2'));var rp=require('request-promise');var moment=require(_0xd3c4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd3c4('0x4'));var util=require(_0xd3c4('0x5'));var path=require(_0xd3c4('0x6'));var sox=require('sox');var csv=require(_0xd3c4('0x7'));var ejs=require(_0xd3c4('0x8'));var fs=require('fs');var fs_extra=require(_0xd3c4('0x9'));var _=require(_0xd3c4('0xa'));var squel=require(_0xd3c4('0xb'));var crypto=require(_0xd3c4('0xc'));var jsforce=require(_0xd3c4('0xd'));var deskjs=require(_0xd3c4('0xe'));var toCsv=require(_0xd3c4('0x7'));var querystring=require(_0xd3c4('0xf'));var Papa=require('papaparse');var Redis=require(_0xd3c4('0x10'));var authService=require(_0xd3c4('0x11'));var qs=require(_0xd3c4('0x12'));var as=require(_0xd3c4('0x13'));var pdf=require(_0xd3c4('0x14'));var hardwareService=require(_0xd3c4('0x15'));var logger=require(_0xd3c4('0x16'))(_0xd3c4('0x17'));var utils=require(_0xd3c4('0x18'));var config=require(_0xd3c4('0x19'));var licenseUtil=require(_0xd3c4('0x1a'));var db=require(_0xd3c4('0x1b'))['db'];config['redis']=_[_0xd3c4('0x1c')](config[_0xd3c4('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xd3c4('0x1e'))(new Redis(config[_0xd3c4('0x1d')]));require(_0xd3c4('0x1f'))[_0xd3c4('0x20')](socket);function respondWithStatusCode(_0x24b8a1,_0xc79c1a){_0xc79c1a=_0xc79c1a||0xcc;return function(_0x49c624){if(_0x49c624){return _0x24b8a1[_0xd3c4('0x21')](_0xc79c1a);}return _0x24b8a1['status'](_0xc79c1a)[_0xd3c4('0x22')]();};}function respondWithResult(_0x5d7e13,_0x561fc2){_0x561fc2=_0x561fc2||0xc8;return function(_0x2e0437){if(_0x2e0437){return _0x5d7e13['status'](_0x561fc2)['json'](_0x2e0437);}};}function respondWithFilteredResult(_0x3e5f71,_0x20bd63){return function(_0x5f4696){if(_0x5f4696){var _0x57edbd=typeof _0x20bd63[_0xd3c4('0x23')]===_0xd3c4('0x24')&&typeof _0x20bd63['limit']===_0xd3c4('0x24');var _0x20ad44=_0x5f4696['count'];var _0x266064=_0x57edbd?0x0:_0x20bd63[_0xd3c4('0x23')];var _0x16f1aa=_0x57edbd?_0x5f4696[_0xd3c4('0x25')]:_0x20bd63[_0xd3c4('0x23')]+_0x20bd63[_0xd3c4('0x26')];var _0x157405;if(_0x16f1aa>=_0x20ad44){_0x16f1aa=_0x20ad44;_0x157405=0xc8;}else{_0x157405=0xce;}_0x3e5f71[_0xd3c4('0x27')](_0x157405);return _0x3e5f71[_0xd3c4('0x28')](_0xd3c4('0x29'),_0x266064+'-'+_0x16f1aa+'/'+_0x20ad44)[_0xd3c4('0x2a')](_0x5f4696);}return null;};}function patchUpdates(_0x40fe32){return function(_0x32fc5a){try{jsonpatch[_0xd3c4('0x2b')](_0x32fc5a,_0x40fe32,!![]);}catch(_0x8d12ed){return BPromise[_0xd3c4('0x2c')](_0x8d12ed);}return _0x32fc5a[_0xd3c4('0x2d')]();};}function saveUpdates(_0x1a0405,_0x3fcc2f){return function(_0x504965){if(_0x504965){return _0x504965[_0xd3c4('0x2e')](_0x1a0405)['then'](function(_0x4138f3){return _0x4138f3;});}return null;};}function removeEntity(_0x410124,_0x540838){return function(_0x23e8fc){if(_0x23e8fc){return _0x23e8fc['destroy']()['then'](function(){_0x410124['status'](0xcc)[_0xd3c4('0x22')]();});}};}function handleEntityNotFound(_0x24b129,_0x2050ce){return function(_0x1111ad){if(!_0x1111ad){_0x24b129[_0xd3c4('0x21')](0x194);}return _0x1111ad;};}function handleError(_0x2a9b2b,_0xfa43ca){_0xfa43ca=_0xfa43ca||0x1f4;return function(_0x3b7f12){logger[_0xd3c4('0x2f')](_0x3b7f12['stack']);if(_0x3b7f12[_0xd3c4('0x30')]){delete _0x3b7f12[_0xd3c4('0x30')];}_0x2a9b2b[_0xd3c4('0x27')](_0xfa43ca)['send'](_0x3b7f12);};}function getInteractionUsers(_0x19c805,_0x48bb8b){return new BPromise(function(_0x5167fd,_0x38cbec){try{if(_0x48bb8b[_0x19c805['id']]){_0x19c805[_0xd3c4('0x31')]=_[_0xd3c4('0x32')](_0x48bb8b[_0x19c805['id']],function(_0x73d3ab){return{'id':_0x73d3ab['id'],'fullname':_0x73d3ab[_0xd3c4('0x33')]};});}}catch(_0x358b3e){_0x38cbec(_0x358b3e);}_0x5167fd(_0x19c805);});}function getInteractionTags(_0xe0df1d,_0x6fd696){return new BPromise(function(_0x51777e,_0x743aee){try{if(_0xe0df1d['TagIds']){_0xe0df1d['Tags']=[];_0xe0df1d[_0xd3c4('0x34')][_0xd3c4('0x35')](',')[_0xd3c4('0x36')](function(_0x38a13b){_0xe0df1d['Tags']['push'](_0x6fd696[_0x38a13b]);});}delete _0xe0df1d['TagIds'];}catch(_0x4aace9){_0x743aee(_0x4aace9);}_0x51777e(_0xe0df1d);});}function updateSmsInteraction(_0x1f06e1,_0x3e5a4c,_0x4036b5){return new BPromise(function(_0x458cfe,_0x37a5c2){return getInteractionUsers(_0x1f06e1,_0x4036b5)[_0xd3c4('0x37')](function(_0x50eb69){return getInteractionTags(_0x50eb69,_0x3e5a4c);})[_0xd3c4('0x37')](function(_0xf2e2b9){return getStateInteraction(_0xf2e2b9);})[_0xd3c4('0x37')](function(_0x47ccb0){_0x458cfe(_0x47ccb0);})[_0xd3c4('0x38')](function(_0x1b4793){_0x37a5c2(_0x1b4793);});});}function getStateInteraction(_0x496752){return new BPromise(function(_0xfefbb0){_0x496752[_0xd3c4('0x39')]=0x0;_0x496752[_0xd3c4('0x3a')]=0x0;_0x496752['answered']=0x0;_0x496752[_0xd3c4('0x3b')]=0x0;_0x496752['total']=0x0;if(!_0x496752[_0xd3c4('0x3c')]&&!_0x496752['UserId']){_0x496752[_0xd3c4('0x39')]+=0x1;}if(!_0x496752[_0xd3c4('0x3c')]&&_0x496752[_0xd3c4('0x3d')]){_0x496752[_0xd3c4('0x3a')]+=0x1;if(_0x496752[_0xd3c4('0x39')]){_0x496752['waiting']-=0x1;}}if(_0x496752['closed']&&_0x496752[_0xd3c4('0x3d')]){_0x496752['answered']+=0x1;if(_0x496752['talking']){_0x496752[_0xd3c4('0x3a')]-=0x1;}}if(_0x496752[_0xd3c4('0x3c')]&&!_0x496752[_0xd3c4('0x3d')]){_0x496752[_0xd3c4('0x3b')]+=0x1;if(_0x496752[_0xd3c4('0x39')]){_0x496752[_0xd3c4('0x39')]-=0x1;}}_0x496752[_0xd3c4('0x3e')]+=0x1;_0xfefbb0(_0x496752);});}exports[_0xd3c4('0x3f')]=function(_0x146401,_0x2a11d0){var _0x2f799a={},_0x595cc0={},_0x4918ee={'count':0x0,'rows':[]};var _0x2e72ba=_[_0xd3c4('0x32')](db[_0xd3c4('0x40')][_0xd3c4('0x41')],function(_0x4fb351){return{'name':_0x4fb351[_0xd3c4('0x42')],'type':_0x4fb351[_0xd3c4('0x43')]['key']};});_0x595cc0[_0xd3c4('0x44')]=_[_0xd3c4('0x32')](_0x2e72ba,'name');_0x595cc0[_0xd3c4('0x45')]=_['keys'](_0x146401['query']);_0x595cc0[_0xd3c4('0x46')]=_['intersection'](_0x595cc0[_0xd3c4('0x44')],_0x595cc0[_0xd3c4('0x45')]);_0x2f799a[_0xd3c4('0x47')]=_[_0xd3c4('0x48')](_0x595cc0[_0xd3c4('0x44')],qs[_0xd3c4('0x49')](_0x146401[_0xd3c4('0x45')][_0xd3c4('0x49')]));_0x2f799a[_0xd3c4('0x47')]=_0x2f799a[_0xd3c4('0x47')]['length']?_0x2f799a[_0xd3c4('0x47')]:_0x595cc0[_0xd3c4('0x44')];if(!_0x146401[_0xd3c4('0x45')][_0xd3c4('0x4a')]('nolimit')){_0x2f799a[_0xd3c4('0x26')]=qs[_0xd3c4('0x26')](_0x146401[_0xd3c4('0x45')][_0xd3c4('0x26')]);_0x2f799a[_0xd3c4('0x23')]=qs[_0xd3c4('0x23')](_0x146401['query'][_0xd3c4('0x23')]);}_0x2f799a[_0xd3c4('0x4b')]=qs[_0xd3c4('0x4c')](_0x146401[_0xd3c4('0x45')]['sort']);_0x2f799a['where']=qs['filters'](_[_0xd3c4('0x4d')](_0x146401['query'],_0x595cc0[_0xd3c4('0x46')]),_0x2e72ba);var _0x11de3c=[];var _0x44da73=squel[_0xd3c4('0x4e')]()['field']('id')[_0xd3c4('0x4f')](_0xd3c4('0x30'))['field'](_0xd3c4('0x50'))[_0xd3c4('0x51')]('tools_tags');var _0x5edd70=squel[_0xd3c4('0x4e')]()[_0xd3c4('0x4f')](_0xd3c4('0x52'))[_0xd3c4('0x4f')]('u.fullname')[_0xd3c4('0x4f')](_0xd3c4('0x53'))[_0xd3c4('0x51')](_0xd3c4('0x54'),'ui')[_0xd3c4('0x55')](_0xd3c4('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x21907b=squel[_0xd3c4('0x4e')]()[_0xd3c4('0x51')](_0xd3c4('0x57'),'i')[_0xd3c4('0x55')](_0xd3c4('0x58'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xd3c4('0x56'),'o',_0xd3c4('0x59'))[_0xd3c4('0x55')](_0xd3c4('0x5a'),'a',_0xd3c4('0x5b'))[_0xd3c4('0x55')](_0xd3c4('0x5c'),'me',_0xd3c4('0x5d'))[_0xd3c4('0x55')](_0xd3c4('0x5e'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xd3c4('0x55')](_0xd3c4('0x5f'),'t',_0xd3c4('0x60'));var _0x2f54b1=squel[_0xd3c4('0x61')]();var _0x2d78fc=[];var _0x192308=squel[_0xd3c4('0x61')]();var _0x11d105;if(_0x146401[_0xd3c4('0x45')][_0xd3c4('0x62')]){_0x11d105=as[_0xd3c4('0x63')](_0x146401[_0xd3c4('0x45')][_0xd3c4('0x62')]);var _0x151934=_0x11d105[_0xd3c4('0x64')];for(var _0x454eeb=0x0;_0x454eeb<_0x11d105[_0xd3c4('0x65')][_0xd3c4('0x66')];_0x454eeb++){var _0x123109=_0x11d105[_0xd3c4('0x65')][_0x454eeb];var _0x2aa937='i';var _0x2e4300=_[_0xd3c4('0x67')](_0x2e72ba,[_0xd3c4('0x30'),_0x123109[_0xd3c4('0x4f')]]);if(!_0x2e4300){switch(_0x123109[_0xd3c4('0x4f')]){case _0xd3c4('0x68'):if(_0x123109['value']==0x1){_0x21907b[_0xd3c4('0x69')]('`'+_0x123109[_0xd3c4('0x4f')]+_0xd3c4('0x6a'));}else{_0x21907b[_0xd3c4('0x69')]('`'+_0x123109['field']+_0xd3c4('0x6b'));}break;case _0xd3c4('0x6c'):if(_0x123109['operator']===_0xd3c4('0x6d')){if(_0x123109['value'][_0xd3c4('0x35')]('\x20')[_0xd3c4('0x66')]>0x1){_0x2f54b1[_0x151934](_0xd3c4('0x6e'),qs[_0xd3c4('0x6f')](_0x123109[_0xd3c4('0x70')]),null);}else{var _0x482134='%'+_0x123109[_0xd3c4('0x70')]+'%';_0x2f54b1[_0x151934]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x482134,_0x482134,_0x482134);}}else{_0x2e4300=_[_0xd3c4('0x67')](_0x2e72ba,['name',_0xd3c4('0x71')]);_0x123109[_0xd3c4('0x4f')]=_0xd3c4('0x71');_0x4b0e6e=as[_0xd3c4('0x72')](_0x2aa937,_0x2e4300[_0xd3c4('0x43')],_0x123109);_0x2f54b1[_0x151934](_0x4b0e6e['text'],_0x4b0e6e['value']['start'],_0x4b0e6e['value'][_0xd3c4('0x22')]);}break;case _0xd3c4('0x73'):var _0x1b433c=_0x123109['value'][_0xd3c4('0x35')](',')[_0xd3c4('0x32')](function(_0xfcdbec){return Number(_0xfcdbec);});_0x1b433c[_0xd3c4('0x36')](function(_0x1451c8){_0x192308['or'](_0xd3c4('0x74'),'%,'+_0x1451c8+',%');});_0x2d78fc=_[_0xd3c4('0x75')](_0x2d78fc,_0x1b433c);break;case'User':if(_0x123109[_0xd3c4('0x76')]===_0xd3c4('0x6d')){_0x2f54b1[_0x151934](_0xd3c4('0x77'),'%'+_0x123109['value']+'%',null);}else{_0x2e4300=_[_0xd3c4('0x67')](_0x2e72ba,[_0xd3c4('0x30'),'UserId']);_0x123109[_0xd3c4('0x4f')]='UserId';_0x4b0e6e=as[_0xd3c4('0x72')](_0x2aa937,_0x2e4300['type'],_0x123109);_0x2f54b1[_0x151934](_0x4b0e6e[_0xd3c4('0x78')],_0x4b0e6e[_0xd3c4('0x70')][_0xd3c4('0x79')],_0x4b0e6e[_0xd3c4('0x70')][_0xd3c4('0x22')]);}break;case _0xd3c4('0x7a'):_0x4b0e6e=as[_0xd3c4('0x72')]('me',null,_0x123109);_0x2f54b1[_0x151934](_0x4b0e6e[_0xd3c4('0x78')],_0x4b0e6e[_0xd3c4('0x70')][_0xd3c4('0x79')],_0x4b0e6e[_0xd3c4('0x70')][_0xd3c4('0x22')]);break;}}else{var _0x4b0e6e=as[_0xd3c4('0x72')](_0x2aa937,_0x2e4300[_0xd3c4('0x43')],_0x123109);_0x2f54b1[_0x151934](_0x4b0e6e[_0xd3c4('0x78')],_0x4b0e6e[_0xd3c4('0x70')][_0xd3c4('0x79')],_0x4b0e6e['value'][_0xd3c4('0x22')]);}}}else{var _0x35a9ce=_(_0x146401[_0xd3c4('0x45')])['keys']()['map'](function(_0x1e9afa){return _[_0xd3c4('0x7b')](_0x2e72ba,['name',_0x1e9afa])?_0x1e9afa:undefined;})[_0xd3c4('0x7c')]()[_0xd3c4('0x70')]();if(!_[_0xd3c4('0x7d')](_0x35a9ce)){_0x35a9ce[_0xd3c4('0x36')](function(_0x389b63){if(_0x389b63==='SmsAccountId'){_0x21907b['where'](_0xd3c4('0x7e'),[][_0xd3c4('0x7f')](_0x146401['query'][_0x389b63]));}else if(_0x389b63===_0xd3c4('0x80')){var _0x4d9312=JSON[_0xd3c4('0x81')](_0x146401[_0xd3c4('0x45')][_0x389b63])[_0xd3c4('0x82')];var _0x26c05a=JSON[_0xd3c4('0x81')](_0x146401[_0xd3c4('0x45')][_0x389b63])['$lte'];_0x21907b[_0xd3c4('0x83')](_0xd3c4('0x84'),_0x4d9312,_0x26c05a);}else{if(_0x146401[_0xd3c4('0x45')][_0x389b63]===_0xd3c4('0x85')){_0x21907b[_0xd3c4('0x83')]('i.'+_0x389b63+_0xd3c4('0x86'));}else{_0x21907b[_0xd3c4('0x83')]('i.'+_0x389b63+_0xd3c4('0x87'),_0x146401[_0xd3c4('0x45')][_0x389b63]);}}});}if(_0x146401[_0xd3c4('0x45')][_0xd3c4('0x88')]){if(_0x146401[_0xd3c4('0x45')]['read']==0x1){_0x21907b[_0xd3c4('0x69')](_0xd3c4('0x89'));}else{_0x21907b[_0xd3c4('0x69')]('`unreadMessages`\x20>\x200');}}if(_0x146401[_0xd3c4('0x45')][_0xd3c4('0x8a')]){_0x2d78fc=_['isArray'](_0x146401[_0xd3c4('0x45')]['tag'])?_0x146401[_0xd3c4('0x45')][_0xd3c4('0x8a')]:new Array(_0x146401[_0xd3c4('0x45')][_0xd3c4('0x8a')]);_0x2d78fc[_0xd3c4('0x36')](function(_0x106f9c){_0x192308['or'](_0xd3c4('0x74'),'%,'+_0x106f9c+',%');});}if(_0x146401['query'][_0xd3c4('0x8b')]){var _0xd9e48a=_0x146401[_0xd3c4('0x45')][_0xd3c4('0x8b')]['replace']('\x5c','\x5c\x5c')[_0xd3c4('0x8c')](/'/g,'\x27\x27');if(qs[_0xd3c4('0x8d')](_0xd9e48a)){_0x2f54b1['or'](_0xd3c4('0x8e'),_0xd9e48a+'%')['or']('i.phone\x20LIKE\x20?',_0xd9e48a+'%');}else{_0x2f54b1['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd3c4('0x6f')](_0xd9e48a))['or'](_0xd3c4('0x8f'),_0xd9e48a+'%');}}}_0x21907b['where'](_0x2f54b1);_0x21907b[_0xd3c4('0x90')](_0xd3c4('0x91'));var _0x189c91={'type':db[_0xd3c4('0x92')]['QueryTypes']['SELECT'],'raw':!![]};var _0x173930=_0x21907b[_0xd3c4('0x93')]();_0x173930[_0xd3c4('0x4f')](_0xd3c4('0x91'));_0x173930[_0xd3c4('0x4f')](_0xd3c4('0x94'),_0xd3c4('0x68'));if(_0x2f799a['order']){_0x2f799a[_0xd3c4('0x4b')][_0xd3c4('0x36')](function(_0x2b32eb){var _0x183803=_0x2b32eb[0x0]==='contactName'?_0x2b32eb[0x0]:'i.'+_0x2b32eb[0x0];_0x21907b[_0xd3c4('0x4b')](_0x183803,_0x2b32eb[0x1]===_0xd3c4('0x95')?![]:!![]);});}if(!_['isEmpty'](_0x2d78fc)){_0x21907b[_0xd3c4('0x69')](_0x192308);_0x173930[_0xd3c4('0x83')]('t.id\x20IN\x20?',_0x2d78fc);}BPromise[_0xd3c4('0x96')]()[_0xd3c4('0x37')](function(){if(!_0x11d105){if(_0x146401['query'][_0xd3c4('0x97')])return;_0x173930[_0xd3c4('0x83')](_0xd3c4('0x98'));_0x21907b['where'](_0xd3c4('0x98'));return;}if(_0x146401['user'][_0xd3c4('0x99')]!==_0xd3c4('0x9a'))return;return _0x146401[_0xd3c4('0x9b')][_0xd3c4('0x9c')]({'attributes':['id'],'raw':!![]})[_0xd3c4('0x37')](function(_0x5c7e7c){if(_['isEmpty'](_0x5c7e7c)){_0x173930[_0xd3c4('0x83')](_0xd3c4('0x9d'));_0x21907b[_0xd3c4('0x83')](_0xd3c4('0x9d'));}else{_0x173930[_0xd3c4('0x83')](_0xd3c4('0x7e'),_[_0xd3c4('0x32')](_0x5c7e7c,'id'));_0x21907b['where']('i.SmsAccountId\x20IN\x20?',_[_0xd3c4('0x32')](_0x5c7e7c,'id'));}});})[_0xd3c4('0x37')](function(){if(_0x146401['user'][_0xd3c4('0x99')]==='agent'&&!_0x11d105&&!_0x146401['query'][_0xd3c4('0x97')])return[];return db[_0xd3c4('0x9e')][_0xd3c4('0x45')](_0x173930[_0xd3c4('0x9f')](),_0x189c91);})[_0xd3c4('0x37')](function(_0xf38e21){_0x4918ee['count']=_0xf38e21[_0xd3c4('0x66')];if(_0x4918ee[_0xd3c4('0x25')]===0x0)return[];return db[_0xd3c4('0x9e')][_0xd3c4('0x45')](_0x44da73[_0xd3c4('0x9f')](),_0x189c91)[_0xd3c4('0x37')](function(_0x42122a){_0x11de3c=_[_0xd3c4('0xa0')](_0x42122a,'id');_0x189c91=_[_0xd3c4('0xa1')](_0x189c91,{'model':db[_0xd3c4('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x146401[_0xd3c4('0x45')][_0xd3c4('0x49')]){_0x2f799a[_0xd3c4('0x47')][_0xd3c4('0x36')](function(_0x18a768){_0x21907b[_0xd3c4('0x4f')]('i.'+_0x18a768);});}else{_0x21907b['field'](_0xd3c4('0x94'),_0xd3c4('0x68'));_0x21907b[_0xd3c4('0x4f')]('a.key','Account.key');_0x21907b[_0xd3c4('0x4f')](_0xd3c4('0xa2'),'Account.mandatoryDisposition');_0x21907b[_0xd3c4('0x4f')](_0xd3c4('0xa3'),_0xd3c4('0xa4'));_0x21907b['field'](_0xd3c4('0xa5'));_0x21907b[_0xd3c4('0x4f')]('c.firstName',_0xd3c4('0xa6'));_0x21907b[_0xd3c4('0x4f')]('c.lastName',_0xd3c4('0xa7'));_0x21907b['field']('c.email',_0xd3c4('0xa8'));_0x21907b[_0xd3c4('0x4f')](_0xd3c4('0xa9'),_0xd3c4('0xaa'));_0x21907b['field'](_0xd3c4('0xab'),_0xd3c4('0xac'));_0x21907b['field'](_0xd3c4('0xad'),_0xd3c4('0xae'));_0x21907b['field'](_0xd3c4('0xaf'),_0xd3c4('0xb0'));_0x21907b[_0xd3c4('0x4f')](_0xd3c4('0xb1'),_0xd3c4('0xb2'));_0x21907b[_0xd3c4('0x4f')](_0xd3c4('0xb3'),_0xd3c4('0x34'));}if(_0x2f799a[_0xd3c4('0x26')])_0x21907b[_0xd3c4('0x26')](_0x2f799a[_0xd3c4('0x26')]);if(_0x2f799a[_0xd3c4('0x23')])_0x21907b['offset'](_0x2f799a['offset']);return db[_0xd3c4('0x9e')]['query'](_0x21907b[_0xd3c4('0x9f')](),_0x189c91);})[_0xd3c4('0x37')](function(_0x49b397){if(_0x49b397['length']>0x0)_0x5edd70['where'](_0xd3c4('0xb4'),_[_0xd3c4('0x32')](_0x49b397,'id'));return db[_0xd3c4('0x9e')][_0xd3c4('0x45')](_0x5edd70[_0xd3c4('0x9f')](),_0x189c91)[_0xd3c4('0x37')](function(_0x553d08){var _0x5bc818=_[_0xd3c4('0xb5')](_0x553d08,'SmsInteractionId');var _0x2c246d=[];_0x49b397[_0xd3c4('0x36')](function(_0x25e338){_0x2c246d[_0xd3c4('0xb6')](updateSmsInteraction(_0x25e338,_0x11de3c,_0x5bc818));});return BPromise[_0xd3c4('0xb7')](_0x2c246d);});});})['then'](function(_0x24b0ed){_0x4918ee['rows']=_0x24b0ed;return _0x4918ee;})[_0xd3c4('0x37')](respondWithFilteredResult(_0x2a11d0,_0x2f799a))[_0xd3c4('0x38')](handleError(_0x2a11d0,null));};exports[_0xd3c4('0xb8')]=function(_0x558326,_0x54c3b5){var _0x88c972={'raw':![],'where':{'id':_0x558326[_0xd3c4('0xb9')]['id']}},_0x17f6d0={};_0x17f6d0['model']=_['keys'](db[_0xd3c4('0x40')][_0xd3c4('0x41')]);_0x17f6d0[_0xd3c4('0x45')]=_[_0xd3c4('0xba')](_0x558326['query']);_0x17f6d0['filters']=_['intersection'](_0x17f6d0[_0xd3c4('0x44')],_0x17f6d0[_0xd3c4('0x45')]);_0x88c972[_0xd3c4('0x47')]=_[_0xd3c4('0x48')](_0x17f6d0[_0xd3c4('0x44')],qs[_0xd3c4('0x49')](_0x558326[_0xd3c4('0x45')][_0xd3c4('0x49')]));_0x88c972[_0xd3c4('0x47')]=_0x88c972['attributes'][_0xd3c4('0x66')]?_0x88c972[_0xd3c4('0x47')]:_0x17f6d0[_0xd3c4('0x44')];if(_0x558326[_0xd3c4('0x45')][_0xd3c4('0xbb')]){_0x88c972[_0xd3c4('0xbc')]=[{'all':!![]}];}_0x88c972=_[_0xd3c4('0xa1')]({},_0x88c972,_0x558326['options']);return db[_0xd3c4('0x40')]['find'](_0x88c972)[_0xd3c4('0x37')](handleEntityNotFound(_0x54c3b5,null))['then'](respondWithResult(_0x54c3b5,null))[_0xd3c4('0x38')](handleError(_0x54c3b5,null));};exports[_0xd3c4('0xbd')]=function(_0x52fa76,_0x277393){return db[_0xd3c4('0x40')]['create'](_0x52fa76[_0xd3c4('0x7a')],{})[_0xd3c4('0x37')](respondWithResult(_0x277393,0xc9))[_0xd3c4('0x38')](handleError(_0x277393,null));};exports[_0xd3c4('0x2e')]=function(_0x46049f,_0x1b0253){if(_0x46049f[_0xd3c4('0x7a')]['id']){delete _0x46049f[_0xd3c4('0x7a')]['id'];}return db[_0xd3c4('0x40')][_0xd3c4('0x67')]({'where':{'id':_0x46049f[_0xd3c4('0xb9')]['id']}})[_0xd3c4('0x37')](handleEntityNotFound(_0x1b0253,null))[_0xd3c4('0x37')](saveUpdates(_0x46049f[_0xd3c4('0x7a')],null))[_0xd3c4('0x37')](respondWithResult(_0x1b0253,null))[_0xd3c4('0x38')](handleError(_0x1b0253,null));};exports[_0xd3c4('0xbe')]=function(_0x106077,_0x233d3a){return db[_0xd3c4('0x40')][_0xd3c4('0x67')]({'where':{'id':_0x106077[_0xd3c4('0xb9')]['id']}})[_0xd3c4('0x37')](handleEntityNotFound(_0x233d3a,null))[_0xd3c4('0x37')](removeEntity(_0x233d3a,null))['catch'](handleError(_0x233d3a,null));};exports['describe']=function(_0x14ad36,_0x1b4a95){return db[_0xd3c4('0x40')]['describe']()['then'](respondWithResult(_0x1b4a95,null))['catch'](handleError(_0x1b4a95,null));};exports[_0xd3c4('0xbf')]=function(_0x595e93,_0x42159d,_0x3b5f93){return db[_0xd3c4('0xc0')][_0xd3c4('0x67')]({'where':{'id':_0x595e93['params']['id']}})[_0xd3c4('0x37')](handleEntityNotFound(_0x42159d,null))[_0xd3c4('0x37')](function(_0x5a4693){if(_0x5a4693){return _0x5a4693[_0xd3c4('0xbf')](_0x595e93[_0xd3c4('0x7a')][_0xd3c4('0xc1')],_[_0xd3c4('0xc2')](_0x595e93[_0xd3c4('0x7a')],[_0xd3c4('0xc1'),'id'])||{});}})[_0xd3c4('0x37')](respondWithResult(_0x42159d,null))['catch'](handleError(_0x42159d,null));};exports['getMessages']=function(_0x5612d0,_0x4c3e48,_0x2ba254){var _0x3f9abe={'raw':![],'where':{}};var _0x1b25ec={};var _0x8acbcd={'count':0x0,'rows':[]};return db[_0xd3c4('0x40')]['findOne']({'where':{'id':_0x5612d0['params']['id']}})[_0xd3c4('0x37')](handleEntityNotFound(_0x4c3e48,null))[_0xd3c4('0x37')](function(_0x1d00ce){if(_0x1d00ce){_0x1b25ec[_0xd3c4('0x44')]=_[_0xd3c4('0xba')](db[_0xd3c4('0xc0')][_0xd3c4('0x41')]);_0x1b25ec[_0xd3c4('0x45')]=_[_0xd3c4('0xba')](_0x5612d0[_0xd3c4('0x45')]);_0x1b25ec['filters']=_['intersection'](_0x1b25ec['model'],_0x1b25ec[_0xd3c4('0x45')]);_0x3f9abe[_0xd3c4('0x47')]=_[_0xd3c4('0x48')](_0x1b25ec[_0xd3c4('0x44')],qs[_0xd3c4('0x49')](_0x5612d0['query'][_0xd3c4('0x49')]));_0x3f9abe[_0xd3c4('0x47')]=_0x3f9abe[_0xd3c4('0x47')][_0xd3c4('0x66')]?_0x3f9abe['attributes']:_0x1b25ec['model'];if(!_0x5612d0['query']['hasOwnProperty']('nolimit')){_0x3f9abe[_0xd3c4('0x26')]=qs[_0xd3c4('0x26')](_0x5612d0['query'][_0xd3c4('0x26')]);_0x3f9abe[_0xd3c4('0x23')]=qs[_0xd3c4('0x23')](_0x5612d0[_0xd3c4('0x45')]['offset']);}_0x3f9abe[_0xd3c4('0x4b')]=qs['sort'](_0x5612d0[_0xd3c4('0x45')]['sort']);_0x3f9abe[_0xd3c4('0x83')]=qs[_0xd3c4('0x46')](_[_0xd3c4('0x4d')](_0x5612d0[_0xd3c4('0x45')],_0x1b25ec[_0xd3c4('0x46')]));_0x3f9abe['where']['SmsInteractionId']=_0x1d00ce['id'];if(_0x5612d0['query'][_0xd3c4('0x8b')]){_0x3f9abe['where']=_[_0xd3c4('0xa1')](_0x3f9abe['where'],{'$or':_[_0xd3c4('0x32')](_0x3f9abe['attributes'],function(_0xdece44){var _0x2efe28={};_0x2efe28[_0xdece44]={'$like':'%'+_0x5612d0[_0xd3c4('0x45')][_0xd3c4('0x8b')]+'%'};return _0x2efe28;})});}if(_0x5612d0[_0xd3c4('0x45')]['$gte']){var _0x2abe97=_0x5612d0[_0xd3c4('0x45')]['$gte'][_0xd3c4('0x35')](',');var _0x3ccc53={};_0x3ccc53[_0x2abe97[0x0]]={'$gte':moment(_0x2abe97[0x1])[_0xd3c4('0xc3')](_0xd3c4('0xc4'))};_0x3f9abe[_0xd3c4('0x83')]=_[_0xd3c4('0xa1')](_0x3f9abe['where'],_0x3ccc53);}_0x3f9abe=_[_0xd3c4('0xa1')]({},_0x3f9abe,_0x5612d0['options']);return db[_0xd3c4('0xc0')][_0xd3c4('0x25')]({'where':_0x3f9abe[_0xd3c4('0x83')]})[_0xd3c4('0x37')](function(_0x5caf3e){_0x8acbcd[_0xd3c4('0x25')]=_0x5caf3e;if(_0x5612d0[_0xd3c4('0x45')][_0xd3c4('0xbb')]){_0x3f9abe[_0xd3c4('0xbc')]=[{'all':!![]}];}return db[_0xd3c4('0xc0')][_0xd3c4('0xc5')](_0x3f9abe);})['then'](function(_0x1e0239){_0x8acbcd[_0xd3c4('0xc6')]=_0x1e0239;return _0x8acbcd;});}})[_0xd3c4('0x37')](respondWithFilteredResult(_0x4c3e48,_0x3f9abe))[_0xd3c4('0x38')](handleError(_0x4c3e48,null));};exports[_0xd3c4('0xc7')]=function(_0x4ba276,_0x39a8a2,_0x4b6951){return db[_0xd3c4('0x40')][_0xd3c4('0x67')]({'where':{'id':_0x4ba276[_0xd3c4('0xb9')]['id']}})['then'](handleEntityNotFound(_0x39a8a2,null))[_0xd3c4('0x37')](function(_0x46f448){if(_0x46f448){return _0x46f448[_0xd3c4('0xc8')](_0x4ba276['body'][_0xd3c4('0xc1')],_[_0xd3c4('0xc2')](_0x4ba276['body'],[_0xd3c4('0xc1'),'id'])||{})[_0xd3c4('0xc9')](function(){return db[_0xd3c4('0x73')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x4ba276['body'][_0xd3c4('0xc1')]}});})[_0xd3c4('0x37')](function(_0x34dcfb){socket['emit'](_0xd3c4('0xca'),{'id':Number(_0x4ba276['params']['id']),'tags':_0x34dcfb||[]});return{'id':Number(_0x4ba276[_0xd3c4('0xb9')]['id']),'tags':_0x34dcfb||[]};});}})[_0xd3c4('0x37')](respondWithResult(_0x39a8a2,null))[_0xd3c4('0x38')](handleError(_0x39a8a2,null));};exports[_0xd3c4('0xcb')]=function(_0x795cb7,_0x116eaa,_0x550c87){return db[_0xd3c4('0x40')][_0xd3c4('0x67')]({'where':{'id':_0x795cb7[_0xd3c4('0xb9')]['id']}})[_0xd3c4('0x37')](handleEntityNotFound(_0x116eaa,null))[_0xd3c4('0x37')](function(_0x15fec7){if(_0x15fec7){return _0x15fec7['removeTags'](_0x795cb7[_0xd3c4('0x45')][_0xd3c4('0xc1')]);}})[_0xd3c4('0x37')](respondWithStatusCode(_0x116eaa,null))['catch'](handleError(_0x116eaa,null));};exports[_0xd3c4('0xcc')]=function(_0x4735fa,_0x8196fe){var _0x49e574=moment()[_0xd3c4('0xcd')]()['toString']();var _0x10c488=path[_0xd3c4('0xce')](config[_0xd3c4('0xcf')],_0xd3c4('0xd0'),_0xd3c4('0xd1'),'tmp');var _0x2740b7=path[_0xd3c4('0xce')](config[_0xd3c4('0xcf')],_0xd3c4('0xd0'),_0xd3c4('0xd1'),_0xd3c4('0xd2'));var _0x56a364=path[_0xd3c4('0xce')](_0x10c488,_0x49e574);var _0x4dad3b=util[_0xd3c4('0xc3')](_0xd3c4('0xd3'),_0x4735fa[_0xd3c4('0xb9')]['id'],_0x49e574);var _0x4b53a1=path[_0xd3c4('0xce')](_0x10c488,_0x4dad3b);var _0x15e04a=[];_0x15e04a['push']({'model':db[_0xd3c4('0xd4')],'as':_0xd3c4('0xd4'),'attributes':['id',_0xd3c4('0x33')],'raw':!![]});_0x15e04a[_0xd3c4('0xb6')]({'model':db[_0xd3c4('0xd5')],'as':_0xd3c4('0x6c'),'attributes':['id',_0xd3c4('0xd6'),'lastName'],'raw':!![]});var _0x52317f=[{'model':db[_0xd3c4('0xc0')],'as':_0xd3c4('0xd7'),'attributes':['id',_0xd3c4('0x7a'),'createdAt','direction',_0xd3c4('0xd8'),_0xd3c4('0x88')],'include':_0x15e04a}];_0x52317f['push']({'model':db[_0xd3c4('0xd9')],'as':'Account','attributes':['id',_0xd3c4('0x30')]});_0x52317f[_0xd3c4('0xb6')]({'model':db[_0xd3c4('0xd4')],'as':'Owner','attributes':['id',_0xd3c4('0x33')]});return db[_0xd3c4('0x40')][_0xd3c4('0x67')]({'where':{'id':_0x4735fa[_0xd3c4('0xb9')]['id']},'include':_0x52317f})['then'](handleEntityNotFound(_0x8196fe,null))['then'](function(_0x1c924d){if(_0x1c924d){var _0x2e5a36=_0x1c924d['get']({'plain':!![]});fs['mkdirSync'](_0x56a364);var _0x572163={'channel':_0xd3c4('0xda'),'account':_0x2e5a36['Account'][_0xd3c4('0x30')],'agent':_0x2e5a36[_0xd3c4('0xdb')]?_0x2e5a36[_0xd3c4('0xdb')][_0xd3c4('0x33')]:_0xd3c4('0xdc'),'createdAt':moment(_0x2e5a36['createdAt'])[_0xd3c4('0xc3')](_0xd3c4('0xc4'))[_0xd3c4('0x9f')](),'closedAt':_0x2e5a36[_0xd3c4('0x3c')]?moment(_0x2e5a36[_0xd3c4('0xdd')])[_0xd3c4('0xc3')](_0xd3c4('0xc4'))['toString']():'','disposition':_0x2e5a36[_0xd3c4('0xde')],'messages':_(_0x2e5a36['Messages'])[_0xd3c4('0x8b')]({'secret':![]})[_0xd3c4('0x32')](function(_0x45fd9d){return{'date':moment(_0x45fd9d['createdAt'])[_0xd3c4('0xc3')](_0xd3c4('0xc4'))[_0xd3c4('0x9f')](),'sender':_0x45fd9d[_0xd3c4('0xdf')]==='out'?_0x45fd9d[_0xd3c4('0xd4')]?_0x45fd9d[_0xd3c4('0xd4')][_0xd3c4('0x33')]:_0xd3c4('0xe0'):_0x45fd9d[_0xd3c4('0x6c')]['firstName']+(_0x45fd9d[_0xd3c4('0x6c')][_0xd3c4('0xe1')]?'\x20'+_0x45fd9d[_0xd3c4('0x6c')][_0xd3c4('0xe1')]:''),'body':_0x45fd9d[_0xd3c4('0x7a')],'direction':_0x45fd9d['direction']==='out'?'A':'C','secret':_0x45fd9d['secret'],'read':_0x45fd9d[_0xd3c4('0x88')]};})['value']()};return ejs[_0xd3c4('0xe2')](path[_0xd3c4('0xce')](config[_0xd3c4('0xcf')],_0xd3c4('0xd0'),_0xd3c4('0xe3'),_0xd3c4('0xe4')),{'interaction':_0x572163})[_0xd3c4('0x37')](function(_0x261718){var _0x19285f=path['join'](_0x56a364,'transcript-'+_0x2e5a36['id']+'-'+_0x49e574+'.pdf');var _0x2c7590={'path':_0x19285f,'channel':_0xd3c4('0xda'),'interactionId':_0x2e5a36['id']};return pdf[_0xd3c4('0xe5')](_0x261718,_0x2c7590);})['then'](function(){return new BPromise(function(_0x439f19,_0x360593){zipdir(_0x56a364,{'saveTo':_0x4b53a1},function(_0x44f086,_0x5aa8ca){if(_0x44f086)return _0x360593(_0x44f086);return _0x439f19(_0x5aa8ca);});})[_0xd3c4('0x37')](function(){return new BPromise(function(_0x330265,_0x5ae019){rimraf(_0x56a364,function(_0x18a8a6){if(_0x18a8a6)_0x5ae019(_0x18a8a6);return _0x330265();});});})[_0xd3c4('0x37')](function(){return _0x8196fe[_0xd3c4('0xcc')](_0x4b53a1,_0x4dad3b,function(_0x12e25d){if(_0x12e25d){console[_0xd3c4('0xe6')](_0xd3c4('0xe7'),_0x12e25d);}else{fs[_0xd3c4('0xe8')](_0x4b53a1);}});});});}else{return _0x8196fe[_0xd3c4('0x21')](0xc8);}})[_0xd3c4('0x38')](handleError(_0x8196fe,null));}; \ No newline at end of file +var _0xe595=['fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','Users','map','TagIds','Tags','split','catch','waiting','talking','answered','total','closed','UserId','unmanaged','index','SmsInteraction','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','select','field','color','tools_tags','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','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','type','text','start','Tag','union','User','operator','buildExpression','body','keys','some','compact','forEach','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`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.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','groupBy','push','all','rows','show','params','includeAll','include','merge','options','create','destroy','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','nolimit','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','emit','smsInteractionTags:save','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','createdAt','direction','secret','read','SmsAccount','Account','Owner','mkdirSync','Sms','closedAt','disposition','System','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir'];(function(_0x1b0111,_0x27aa91){var _0x3ed76f=function(_0x2dbd01){while(--_0x2dbd01){_0x1b0111['push'](_0x1b0111['shift']());}};_0x3ed76f(++_0x27aa91);}(_0xe595,0xf0));var _0x5e59=function(_0x2c4a97,_0x2e06e9){_0x2c4a97=_0x2c4a97-0x0;var _0x447e2e=_0xe595[_0x2c4a97];return _0x447e2e;};'use strict';var emlformat=require(_0x5e59('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e59('0x1'));var jsonpatch=require(_0x5e59('0x2'));var rp=require('request-promise');var moment=require(_0x5e59('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5e59('0x4'));var util=require(_0x5e59('0x5'));var path=require(_0x5e59('0x6'));var sox=require('sox');var csv=require(_0x5e59('0x7'));var ejs=require(_0x5e59('0x8'));var fs=require('fs');var fs_extra=require(_0x5e59('0x9'));var _=require(_0x5e59('0xa'));var squel=require(_0x5e59('0xb'));var crypto=require(_0x5e59('0xc'));var jsforce=require(_0x5e59('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5e59('0x7'));var querystring=require(_0x5e59('0xe'));var Papa=require('papaparse');var Redis=require(_0x5e59('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5e59('0x10'));var as=require(_0x5e59('0x11'));var pdf=require(_0x5e59('0x12'));var hardwareService=require(_0x5e59('0x13'));var logger=require('../../config/logger')(_0x5e59('0x14'));var utils=require('../../config/utils');var config=require(_0x5e59('0x15'));var licenseUtil=require(_0x5e59('0x16'));var db=require(_0x5e59('0x17'))['db'];config['redis']=_[_0x5e59('0x18')](config[_0x5e59('0x19')],{'host':_0x5e59('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e59('0x19')]));require('./smsInteraction.socket')[_0x5e59('0x1b')](socket);function respondWithStatusCode(_0x253405,_0x403413){_0x403413=_0x403413||0xcc;return function(_0x3a0a16){if(_0x3a0a16){return _0x253405[_0x5e59('0x1c')](_0x403413);}return _0x253405[_0x5e59('0x1d')](_0x403413)[_0x5e59('0x1e')]();};}function respondWithResult(_0x1cbf76,_0x76c201){_0x76c201=_0x76c201||0xc8;return function(_0x18e3c1){if(_0x18e3c1){return _0x1cbf76[_0x5e59('0x1d')](_0x76c201)['json'](_0x18e3c1);}};}function respondWithFilteredResult(_0x48b509,_0xdc1d9c){return function(_0x10afda){if(_0x10afda){var _0x3fb940=typeof _0xdc1d9c['offset']===_0x5e59('0x1f')&&typeof _0xdc1d9c[_0x5e59('0x20')]==='undefined';var _0x13b574=_0x10afda[_0x5e59('0x21')];var _0x2f5e69=_0x3fb940?0x0:_0xdc1d9c[_0x5e59('0x22')];var _0x5d8541=_0x3fb940?_0x10afda[_0x5e59('0x21')]:_0xdc1d9c[_0x5e59('0x22')]+_0xdc1d9c['limit'];var _0x3e1b1c;if(_0x5d8541>=_0x13b574){_0x5d8541=_0x13b574;_0x3e1b1c=0xc8;}else{_0x3e1b1c=0xce;}_0x48b509[_0x5e59('0x1d')](_0x3e1b1c);return _0x48b509[_0x5e59('0x23')](_0x5e59('0x24'),_0x2f5e69+'-'+_0x5d8541+'/'+_0x13b574)[_0x5e59('0x25')](_0x10afda);}return null;};}function patchUpdates(_0xd9f80f){return function(_0x10832c){try{jsonpatch[_0x5e59('0x26')](_0x10832c,_0xd9f80f,!![]);}catch(_0x2fe915){return BPromise[_0x5e59('0x27')](_0x2fe915);}return _0x10832c[_0x5e59('0x28')]();};}function saveUpdates(_0x34fc69,_0x2c8bee){return function(_0x20b950){if(_0x20b950){return _0x20b950['update'](_0x34fc69)[_0x5e59('0x29')](function(_0x491701){return _0x491701;});}return null;};}function removeEntity(_0x4d5794,_0x1a9925){return function(_0x207d47){if(_0x207d47){return _0x207d47['destroy']()[_0x5e59('0x29')](function(){_0x4d5794[_0x5e59('0x1d')](0xcc)[_0x5e59('0x1e')]();});}};}function handleEntityNotFound(_0x187c41,_0x5687d5){return function(_0x18fd6b){if(!_0x18fd6b){_0x187c41['sendStatus'](0x194);}return _0x18fd6b;};}function handleError(_0x4f88af,_0x3848ac){_0x3848ac=_0x3848ac||0x1f4;return function(_0x297181){logger[_0x5e59('0x2a')](_0x297181[_0x5e59('0x2b')]);if(_0x297181['name']){delete _0x297181[_0x5e59('0x2c')];}_0x4f88af[_0x5e59('0x1d')](_0x3848ac)[_0x5e59('0x2d')](_0x297181);};}function getInteractionUsers(_0xae7481,_0x41e40f){return new BPromise(function(_0x495212,_0xd96186){try{if(_0x41e40f[_0xae7481['id']]){_0xae7481[_0x5e59('0x2e')]=_[_0x5e59('0x2f')](_0x41e40f[_0xae7481['id']],function(_0x493540){return{'id':_0x493540['id'],'fullname':_0x493540['fullname']};});}}catch(_0x255a25){_0xd96186(_0x255a25);}_0x495212(_0xae7481);});}function getInteractionTags(_0x1e119c,_0x4f41a4){return new BPromise(function(_0x1551a7,_0x5830f4){try{if(_0x1e119c[_0x5e59('0x30')]){_0x1e119c[_0x5e59('0x31')]=[];_0x1e119c['TagIds'][_0x5e59('0x32')](',')['forEach'](function(_0x4cfa69){_0x1e119c[_0x5e59('0x31')]['push'](_0x4f41a4[_0x4cfa69]);});}delete _0x1e119c[_0x5e59('0x30')];}catch(_0x18dfdb){_0x5830f4(_0x18dfdb);}_0x1551a7(_0x1e119c);});}function updateSmsInteraction(_0x1cd980,_0x55784c,_0x3b1041){return new BPromise(function(_0x313720,_0x13f323){return getInteractionUsers(_0x1cd980,_0x3b1041)[_0x5e59('0x29')](function(_0x3a963c){return getInteractionTags(_0x3a963c,_0x55784c);})[_0x5e59('0x29')](function(_0x4f1ea2){return getStateInteraction(_0x4f1ea2);})[_0x5e59('0x29')](function(_0x340fb7){_0x313720(_0x340fb7);})[_0x5e59('0x33')](function(_0x17b9d6){_0x13f323(_0x17b9d6);});});}function getStateInteraction(_0x52dc8b){return new BPromise(function(_0x46df96){_0x52dc8b[_0x5e59('0x34')]=0x0;_0x52dc8b[_0x5e59('0x35')]=0x0;_0x52dc8b[_0x5e59('0x36')]=0x0;_0x52dc8b['unmanaged']=0x0;_0x52dc8b[_0x5e59('0x37')]=0x0;if(!_0x52dc8b['closed']&&!_0x52dc8b['UserId']){_0x52dc8b[_0x5e59('0x34')]+=0x1;}if(!_0x52dc8b[_0x5e59('0x38')]&&_0x52dc8b[_0x5e59('0x39')]){_0x52dc8b['talking']+=0x1;if(_0x52dc8b[_0x5e59('0x34')]){_0x52dc8b[_0x5e59('0x34')]-=0x1;}}if(_0x52dc8b[_0x5e59('0x38')]&&_0x52dc8b[_0x5e59('0x39')]){_0x52dc8b['answered']+=0x1;if(_0x52dc8b[_0x5e59('0x35')]){_0x52dc8b['talking']-=0x1;}}if(_0x52dc8b[_0x5e59('0x38')]&&!_0x52dc8b['UserId']){_0x52dc8b[_0x5e59('0x3a')]+=0x1;if(_0x52dc8b[_0x5e59('0x34')]){_0x52dc8b[_0x5e59('0x34')]-=0x1;}}_0x52dc8b[_0x5e59('0x37')]+=0x1;_0x46df96(_0x52dc8b);});}exports[_0x5e59('0x3b')]=function(_0x254f2b,_0xcc9459){var _0x42e8d4={},_0x4cdbda={},_0x31af18={'count':0x0,'rows':[]};var _0x31c356=_[_0x5e59('0x2f')](db[_0x5e59('0x3c')][_0x5e59('0x3d')],function(_0x279ea9){return{'name':_0x279ea9['fieldName'],'type':_0x279ea9['type'][_0x5e59('0x3e')]};});_0x4cdbda[_0x5e59('0x3f')]=_[_0x5e59('0x2f')](_0x31c356,_0x5e59('0x2c'));_0x4cdbda[_0x5e59('0x40')]=_['keys'](_0x254f2b[_0x5e59('0x40')]);_0x4cdbda[_0x5e59('0x41')]=_[_0x5e59('0x42')](_0x4cdbda[_0x5e59('0x3f')],_0x4cdbda['query']);_0x42e8d4[_0x5e59('0x43')]=_[_0x5e59('0x42')](_0x4cdbda[_0x5e59('0x3f')],qs['fields'](_0x254f2b[_0x5e59('0x40')][_0x5e59('0x44')]));_0x42e8d4[_0x5e59('0x43')]=_0x42e8d4[_0x5e59('0x43')][_0x5e59('0x45')]?_0x42e8d4[_0x5e59('0x43')]:_0x4cdbda['model'];if(!_0x254f2b['query'][_0x5e59('0x46')]('nolimit')){_0x42e8d4[_0x5e59('0x20')]=qs[_0x5e59('0x20')](_0x254f2b[_0x5e59('0x40')][_0x5e59('0x20')]);_0x42e8d4[_0x5e59('0x22')]=qs[_0x5e59('0x22')](_0x254f2b[_0x5e59('0x40')][_0x5e59('0x22')]);}_0x42e8d4['order']=qs[_0x5e59('0x47')](_0x254f2b[_0x5e59('0x40')][_0x5e59('0x47')]);_0x42e8d4[_0x5e59('0x48')]=qs['filters'](_[_0x5e59('0x49')](_0x254f2b[_0x5e59('0x40')],_0x4cdbda['filters']),_0x31c356);var _0x5a2049=[];var _0x46b53e=squel[_0x5e59('0x4a')]()['field']('id')[_0x5e59('0x4b')](_0x5e59('0x2c'))[_0x5e59('0x4b')](_0x5e59('0x4c'))['from'](_0x5e59('0x4d'));var _0x261601=squel[_0x5e59('0x4a')]()[_0x5e59('0x4b')]('u.id')['field'](_0x5e59('0x4e'))[_0x5e59('0x4b')](_0x5e59('0x4f'))[_0x5e59('0x50')](_0x5e59('0x51'),'ui')[_0x5e59('0x52')](_0x5e59('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x1dc603=squel[_0x5e59('0x4a')]()[_0x5e59('0x50')](_0x5e59('0x54'),'i')['left_join']('cm_contacts','c',_0x5e59('0x55'))[_0x5e59('0x52')](_0x5e59('0x53'),'o',_0x5e59('0x56'))['left_join'](_0x5e59('0x57'),'a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0x5e59('0x58'),'me',_0x5e59('0x59'))[_0x5e59('0x52')](_0x5e59('0x5a'),'it',_0x5e59('0x5b'))[_0x5e59('0x52')](_0x5e59('0x4d'),'t','t.id\x20=\x20it.TagId');var _0x23019e=squel['expr']();var _0x226d28=[];var _0x143ec1=squel['expr']();var _0x30634a;if(_0x254f2b['query'][_0x5e59('0x5c')]){_0x30634a=as[_0x5e59('0x5d')](_0x254f2b[_0x5e59('0x40')][_0x5e59('0x5c')]);var _0x47df1c=_0x30634a[_0x5e59('0x5e')];for(var _0x146581=0x0;_0x146581<_0x30634a[_0x5e59('0x5f')][_0x5e59('0x45')];_0x146581++){var _0x33d8a7=_0x30634a[_0x5e59('0x5f')][_0x146581];var _0x474810='i';var _0x57d410=_[_0x5e59('0x60')](_0x31c356,[_0x5e59('0x2c'),_0x33d8a7['field']]);if(!_0x57d410){switch(_0x33d8a7[_0x5e59('0x4b')]){case _0x5e59('0x61'):if(_0x33d8a7[_0x5e59('0x62')]==0x1){_0x1dc603['having']('`'+_0x33d8a7[_0x5e59('0x4b')]+_0x5e59('0x63'));}else{_0x1dc603[_0x5e59('0x64')]('`'+_0x33d8a7[_0x5e59('0x4b')]+'`\x20>\x200');}break;case _0x5e59('0x65'):if(_0x33d8a7['operator']===_0x5e59('0x66')){if(_0x33d8a7[_0x5e59('0x62')][_0x5e59('0x32')]('\x20')[_0x5e59('0x45')]>0x1){_0x23019e[_0x47df1c](_0x5e59('0x67'),qs[_0x5e59('0x68')](_0x33d8a7[_0x5e59('0x62')]),null);}else{var _0x4691b9='%'+_0x33d8a7[_0x5e59('0x62')]+'%';_0x23019e[_0x47df1c](_0x5e59('0x69'),_0x4691b9,_0x4691b9,_0x4691b9);}}else{_0x57d410=_[_0x5e59('0x60')](_0x31c356,['name',_0x5e59('0x6a')]);_0x33d8a7[_0x5e59('0x4b')]=_0x5e59('0x6a');_0x2576ed=as['buildExpression'](_0x474810,_0x57d410[_0x5e59('0x6b')],_0x33d8a7);_0x23019e[_0x47df1c](_0x2576ed[_0x5e59('0x6c')],_0x2576ed[_0x5e59('0x62')][_0x5e59('0x6d')],_0x2576ed[_0x5e59('0x62')][_0x5e59('0x1e')]);}break;case _0x5e59('0x6e'):var _0xda6afe=_0x33d8a7[_0x5e59('0x62')][_0x5e59('0x32')](',')['map'](function(_0x56a0a2){return Number(_0x56a0a2);});_0xda6afe['forEach'](function(_0x2216cd){_0x143ec1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2216cd+',%');});_0x226d28=_[_0x5e59('0x6f')](_0x226d28,_0xda6afe);break;case _0x5e59('0x70'):if(_0x33d8a7[_0x5e59('0x71')]==='$substring'){_0x23019e[_0x47df1c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x33d8a7['value']+'%',null);}else{_0x57d410=_[_0x5e59('0x60')](_0x31c356,['name','UserId']);_0x33d8a7[_0x5e59('0x4b')]=_0x5e59('0x39');_0x2576ed=as[_0x5e59('0x72')](_0x474810,_0x57d410[_0x5e59('0x6b')],_0x33d8a7);_0x23019e[_0x47df1c](_0x2576ed['text'],_0x2576ed[_0x5e59('0x62')][_0x5e59('0x6d')],_0x2576ed[_0x5e59('0x62')]['end']);}break;case _0x5e59('0x73'):_0x2576ed=as['buildExpression']('me',null,_0x33d8a7);_0x23019e[_0x47df1c](_0x2576ed[_0x5e59('0x6c')],_0x2576ed[_0x5e59('0x62')][_0x5e59('0x6d')],_0x2576ed['value'][_0x5e59('0x1e')]);break;}}else{var _0x2576ed=as['buildExpression'](_0x474810,_0x57d410[_0x5e59('0x6b')],_0x33d8a7);_0x23019e[_0x47df1c](_0x2576ed['text'],_0x2576ed[_0x5e59('0x62')][_0x5e59('0x6d')],_0x2576ed[_0x5e59('0x62')][_0x5e59('0x1e')]);}}}else{var _0x1a19bb=_(_0x254f2b[_0x5e59('0x40')])[_0x5e59('0x74')]()[_0x5e59('0x2f')](function(_0x10b67f){return _[_0x5e59('0x75')](_0x31c356,[_0x5e59('0x2c'),_0x10b67f])?_0x10b67f:undefined;})[_0x5e59('0x76')]()[_0x5e59('0x62')]();if(!_['isEmpty'](_0x1a19bb)){_0x1a19bb[_0x5e59('0x77')](function(_0x3e16de){if(_0x3e16de===_0x5e59('0x78')){_0x1dc603[_0x5e59('0x48')](_0x5e59('0x79'),[][_0x5e59('0x7a')](_0x254f2b[_0x5e59('0x40')][_0x3e16de]));}else if(_0x3e16de==='createdAt'){var _0x2e1b10=JSON[_0x5e59('0x7b')](_0x254f2b[_0x5e59('0x40')][_0x3e16de])[_0x5e59('0x7c')];var _0x39d02d=JSON[_0x5e59('0x7b')](_0x254f2b['query'][_0x3e16de])['$lte'];_0x1dc603['where'](_0x5e59('0x7d'),_0x2e1b10,_0x39d02d);}else{if(_0x254f2b[_0x5e59('0x40')][_0x3e16de]===_0x5e59('0x7e')){_0x1dc603[_0x5e59('0x48')]('i.'+_0x3e16de+_0x5e59('0x7f'));}else{_0x1dc603[_0x5e59('0x48')]('i.'+_0x3e16de+_0x5e59('0x80'),_0x254f2b[_0x5e59('0x40')][_0x3e16de]);}}});}if(_0x254f2b[_0x5e59('0x40')]['read']){if(_0x254f2b[_0x5e59('0x40')]['read']==0x1){_0x1dc603[_0x5e59('0x64')](_0x5e59('0x81'));}else{_0x1dc603[_0x5e59('0x64')](_0x5e59('0x82'));}}if(_0x254f2b[_0x5e59('0x40')][_0x5e59('0x83')]){_0x226d28=_[_0x5e59('0x84')](_0x254f2b[_0x5e59('0x40')][_0x5e59('0x83')])?_0x254f2b[_0x5e59('0x40')]['tag']:new Array(_0x254f2b[_0x5e59('0x40')][_0x5e59('0x83')]);_0x226d28[_0x5e59('0x77')](function(_0x2e9b67){_0x143ec1['or'](_0x5e59('0x85'),'%,'+_0x2e9b67+',%');});}if(_0x254f2b[_0x5e59('0x40')][_0x5e59('0x86')]){var _0x315a3b=_0x254f2b[_0x5e59('0x40')][_0x5e59('0x86')][_0x5e59('0x87')]('\x5c','\x5c\x5c')[_0x5e59('0x87')](/'/g,'\x27\x27');if(qs[_0x5e59('0x88')](_0x315a3b)){_0x23019e['or'](_0x5e59('0x89'),_0x315a3b+'%')['or'](_0x5e59('0x8a'),_0x315a3b+'%');}else{_0x23019e['or'](_0x5e59('0x8b'),qs[_0x5e59('0x68')](_0x315a3b))['or'](_0x5e59('0x8c'),_0x315a3b+'%');}}}_0x1dc603[_0x5e59('0x48')](_0x23019e);_0x1dc603[_0x5e59('0x8d')](_0x5e59('0x8e'));var _0x575274={'type':db[_0x5e59('0x8f')][_0x5e59('0x90')][_0x5e59('0x91')],'raw':!![]};var _0x175a94=_0x1dc603[_0x5e59('0x92')]();_0x175a94[_0x5e59('0x4b')]('i.id');_0x175a94[_0x5e59('0x4b')](_0x5e59('0x93'),'unreadMessages');if(_0x42e8d4['order']){_0x42e8d4[_0x5e59('0x94')][_0x5e59('0x77')](function(_0x139c88){var _0x49812a=_0x139c88[0x0]===_0x5e59('0x95')?_0x139c88[0x0]:'i.'+_0x139c88[0x0];_0x1dc603[_0x5e59('0x94')](_0x49812a,_0x139c88[0x1]===_0x5e59('0x96')?![]:!![]);});}if(!_[_0x5e59('0x97')](_0x226d28)){_0x1dc603['having'](_0x143ec1);_0x175a94[_0x5e59('0x48')](_0x5e59('0x98'),_0x226d28);}BPromise[_0x5e59('0x99')]()['then'](function(){if(!_0x30634a){if(_0x254f2b[_0x5e59('0x40')][_0x5e59('0x78')])return;_0x175a94[_0x5e59('0x48')](_0x5e59('0x9a'));_0x1dc603[_0x5e59('0x48')](_0x5e59('0x9a'));return;}if(_0x254f2b['user']['role']!==_0x5e59('0x9b'))return;return _0x254f2b[_0x5e59('0x9c')][_0x5e59('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x258219){if(_[_0x5e59('0x97')](_0x258219)){_0x175a94[_0x5e59('0x48')](_0x5e59('0x9e'));_0x1dc603[_0x5e59('0x48')](_0x5e59('0x9e'));}else{_0x175a94[_0x5e59('0x48')](_0x5e59('0x79'),_[_0x5e59('0x2f')](_0x258219,'id'));_0x1dc603['where'](_0x5e59('0x79'),_[_0x5e59('0x2f')](_0x258219,'id'));}});})[_0x5e59('0x29')](function(){if(_0x254f2b[_0x5e59('0x9c')][_0x5e59('0x9f')]===_0x5e59('0x9b')&&!_0x30634a&&!_0x254f2b['query'][_0x5e59('0x78')])return[];return db[_0x5e59('0xa0')]['query'](_0x175a94[_0x5e59('0xa1')](),_0x575274);})[_0x5e59('0x29')](function(_0x4fa08e){_0x31af18['count']=_0x4fa08e[_0x5e59('0x45')];if(_0x31af18[_0x5e59('0x21')]===0x0)return[];return db[_0x5e59('0xa0')][_0x5e59('0x40')](_0x46b53e[_0x5e59('0xa1')](),_0x575274)[_0x5e59('0x29')](function(_0x4c53b9){_0x5a2049=_[_0x5e59('0xa2')](_0x4c53b9,'id');_0x575274=_['merge'](_0x575274,{'model':db[_0x5e59('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x254f2b['query'][_0x5e59('0x44')]){_0x42e8d4[_0x5e59('0x43')][_0x5e59('0x77')](function(_0x2bf965){_0x1dc603[_0x5e59('0x4b')]('i.'+_0x2bf965);});}else{_0x1dc603[_0x5e59('0x4b')](_0x5e59('0x93'),'unreadMessages');_0x1dc603[_0x5e59('0x4b')](_0x5e59('0xa3'),_0x5e59('0xa4'));_0x1dc603[_0x5e59('0x4b')]('a.mandatoryDisposition',_0x5e59('0xa5'));_0x1dc603[_0x5e59('0x4b')](_0x5e59('0xa6'),'contactName');_0x1dc603[_0x5e59('0x4b')]('i.*');_0x1dc603['field']('c.firstName',_0x5e59('0xa7'));_0x1dc603[_0x5e59('0x4b')](_0x5e59('0xa8'),'Contact.lastName');_0x1dc603[_0x5e59('0x4b')]('c.email',_0x5e59('0xa9'));_0x1dc603['field'](_0x5e59('0xaa'),_0x5e59('0xab'));_0x1dc603[_0x5e59('0x4b')](_0x5e59('0xac'),_0x5e59('0xad'));_0x1dc603['field'](_0x5e59('0xae'),'Contact.fax');_0x1dc603[_0x5e59('0x4b')](_0x5e59('0xaf'),_0x5e59('0xb0'));_0x1dc603[_0x5e59('0x4b')](_0x5e59('0xb1'),'Owner.internal');_0x1dc603['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5e59('0x30'));}if(_0x42e8d4[_0x5e59('0x20')])_0x1dc603['limit'](_0x42e8d4['limit']);if(_0x42e8d4[_0x5e59('0x22')])_0x1dc603['offset'](_0x42e8d4['offset']);return db[_0x5e59('0xa0')][_0x5e59('0x40')](_0x1dc603[_0x5e59('0xa1')](),_0x575274);})[_0x5e59('0x29')](function(_0x355500){if(_0x355500['length']>0x0)_0x261601[_0x5e59('0x48')]('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x355500,'id'));return db[_0x5e59('0xa0')][_0x5e59('0x40')](_0x261601[_0x5e59('0xa1')](),_0x575274)[_0x5e59('0x29')](function(_0x57c2e2){var _0xa55ee3=_[_0x5e59('0xb2')](_0x57c2e2,'SmsInteractionId');var _0x843666=[];_0x355500[_0x5e59('0x77')](function(_0x55e1ed){_0x843666[_0x5e59('0xb3')](updateSmsInteraction(_0x55e1ed,_0x5a2049,_0xa55ee3));});return BPromise[_0x5e59('0xb4')](_0x843666);});});})[_0x5e59('0x29')](function(_0xa77568){_0x31af18[_0x5e59('0xb5')]=_0xa77568;return _0x31af18;})[_0x5e59('0x29')](respondWithFilteredResult(_0xcc9459,_0x42e8d4))[_0x5e59('0x33')](handleError(_0xcc9459,null));};exports[_0x5e59('0xb6')]=function(_0x2909d4,_0x221842){var _0x4b9bb9={'raw':![],'where':{'id':_0x2909d4[_0x5e59('0xb7')]['id']}},_0x4d6de0={};_0x4d6de0[_0x5e59('0x3f')]=_[_0x5e59('0x74')](db[_0x5e59('0x3c')][_0x5e59('0x3d')]);_0x4d6de0['query']=_['keys'](_0x2909d4[_0x5e59('0x40')]);_0x4d6de0[_0x5e59('0x41')]=_[_0x5e59('0x42')](_0x4d6de0[_0x5e59('0x3f')],_0x4d6de0[_0x5e59('0x40')]);_0x4b9bb9[_0x5e59('0x43')]=_[_0x5e59('0x42')](_0x4d6de0[_0x5e59('0x3f')],qs[_0x5e59('0x44')](_0x2909d4[_0x5e59('0x40')][_0x5e59('0x44')]));_0x4b9bb9[_0x5e59('0x43')]=_0x4b9bb9[_0x5e59('0x43')]['length']?_0x4b9bb9['attributes']:_0x4d6de0[_0x5e59('0x3f')];if(_0x2909d4[_0x5e59('0x40')][_0x5e59('0xb8')]){_0x4b9bb9[_0x5e59('0xb9')]=[{'all':!![]}];}_0x4b9bb9=_[_0x5e59('0xba')]({},_0x4b9bb9,_0x2909d4[_0x5e59('0xbb')]);return db[_0x5e59('0x3c')][_0x5e59('0x60')](_0x4b9bb9)[_0x5e59('0x29')](handleEntityNotFound(_0x221842,null))['then'](respondWithResult(_0x221842,null))['catch'](handleError(_0x221842,null));};exports['create']=function(_0x41ba67,_0x5e2306){return db[_0x5e59('0x3c')][_0x5e59('0xbc')](_0x41ba67[_0x5e59('0x73')],{})[_0x5e59('0x29')](respondWithResult(_0x5e2306,0xc9))[_0x5e59('0x33')](handleError(_0x5e2306,null));};exports['update']=function(_0x129799,_0x11f22f){if(_0x129799[_0x5e59('0x73')]['id']){delete _0x129799[_0x5e59('0x73')]['id'];}return db['SmsInteraction'][_0x5e59('0x60')]({'where':{'id':_0x129799[_0x5e59('0xb7')]['id']}})[_0x5e59('0x29')](handleEntityNotFound(_0x11f22f,null))[_0x5e59('0x29')](saveUpdates(_0x129799[_0x5e59('0x73')],null))[_0x5e59('0x29')](respondWithResult(_0x11f22f,null))[_0x5e59('0x33')](handleError(_0x11f22f,null));};exports[_0x5e59('0xbd')]=function(_0x1c257c,_0x2d63bb){return db['SmsInteraction'][_0x5e59('0x60')]({'where':{'id':_0x1c257c[_0x5e59('0xb7')]['id']}})[_0x5e59('0x29')](handleEntityNotFound(_0x2d63bb,null))[_0x5e59('0x29')](removeEntity(_0x2d63bb,null))[_0x5e59('0x33')](handleError(_0x2d63bb,null));};exports[_0x5e59('0xbe')]=function(_0x2ebd8e,_0x4f6f8e){return db[_0x5e59('0x3c')][_0x5e59('0xbe')]()[_0x5e59('0x29')](respondWithResult(_0x4f6f8e,null))['catch'](handleError(_0x4f6f8e,null));};exports[_0x5e59('0xbf')]=function(_0x13c477,_0x436e87,_0x3970f7){return db[_0x5e59('0xc0')][_0x5e59('0x60')]({'where':{'id':_0x13c477[_0x5e59('0xb7')]['id']}})[_0x5e59('0x29')](handleEntityNotFound(_0x436e87,null))['then'](function(_0x4cd53e){if(_0x4cd53e){return _0x4cd53e[_0x5e59('0xbf')](_0x13c477[_0x5e59('0x73')][_0x5e59('0xc1')],_[_0x5e59('0xc2')](_0x13c477[_0x5e59('0x73')],[_0x5e59('0xc1'),'id'])||{});}})[_0x5e59('0x29')](respondWithResult(_0x436e87,null))[_0x5e59('0x33')](handleError(_0x436e87,null));};exports[_0x5e59('0xc3')]=function(_0x5e0efd,_0x41c474,_0x5a00c6){var _0x4376de={'raw':![],'where':{}};var _0x32522b={};var _0x44b8d0={'count':0x0,'rows':[]};return db[_0x5e59('0x3c')][_0x5e59('0xc4')]({'where':{'id':_0x5e0efd['params']['id']}})[_0x5e59('0x29')](handleEntityNotFound(_0x41c474,null))[_0x5e59('0x29')](function(_0x43339b){if(_0x43339b){_0x32522b[_0x5e59('0x3f')]=_['keys'](db[_0x5e59('0xc0')]['rawAttributes']);_0x32522b[_0x5e59('0x40')]=_['keys'](_0x5e0efd[_0x5e59('0x40')]);_0x32522b[_0x5e59('0x41')]=_['intersection'](_0x32522b[_0x5e59('0x3f')],_0x32522b[_0x5e59('0x40')]);_0x4376de[_0x5e59('0x43')]=_['intersection'](_0x32522b[_0x5e59('0x3f')],qs['fields'](_0x5e0efd[_0x5e59('0x40')][_0x5e59('0x44')]));_0x4376de['attributes']=_0x4376de[_0x5e59('0x43')]['length']?_0x4376de[_0x5e59('0x43')]:_0x32522b[_0x5e59('0x3f')];if(!_0x5e0efd[_0x5e59('0x40')][_0x5e59('0x46')](_0x5e59('0xc5'))){_0x4376de['limit']=qs[_0x5e59('0x20')](_0x5e0efd[_0x5e59('0x40')]['limit']);_0x4376de[_0x5e59('0x22')]=qs[_0x5e59('0x22')](_0x5e0efd[_0x5e59('0x40')][_0x5e59('0x22')]);}_0x4376de[_0x5e59('0x94')]=qs[_0x5e59('0x47')](_0x5e0efd[_0x5e59('0x40')][_0x5e59('0x47')]);_0x4376de[_0x5e59('0x48')]=qs['filters'](_[_0x5e59('0x49')](_0x5e0efd['query'],_0x32522b[_0x5e59('0x41')]));_0x4376de['where'][_0x5e59('0xc6')]=_0x43339b['id'];if(_0x5e0efd[_0x5e59('0x40')][_0x5e59('0x86')]){_0x4376de[_0x5e59('0x48')]=_[_0x5e59('0xba')](_0x4376de[_0x5e59('0x48')],{'$or':_[_0x5e59('0x2f')](_0x4376de[_0x5e59('0x43')],function(_0x31e505){var _0x266c4a={};_0x266c4a[_0x31e505]={'$like':'%'+_0x5e0efd['query']['filter']+'%'};return _0x266c4a;})});}if(_0x5e0efd[_0x5e59('0x40')][_0x5e59('0x7c')]){var _0xdfe862=_0x5e0efd[_0x5e59('0x40')][_0x5e59('0x7c')][_0x5e59('0x32')](',');var _0x2f795f={};_0x2f795f[_0xdfe862[0x0]]={'$gte':moment(_0xdfe862[0x1])[_0x5e59('0xc7')](_0x5e59('0xc8'))};_0x4376de[_0x5e59('0x48')]=_['merge'](_0x4376de[_0x5e59('0x48')],_0x2f795f);}_0x4376de=_[_0x5e59('0xba')]({},_0x4376de,_0x5e0efd[_0x5e59('0xbb')]);return db[_0x5e59('0xc0')][_0x5e59('0x21')]({'where':_0x4376de[_0x5e59('0x48')]})[_0x5e59('0x29')](function(_0x2f4ee9){_0x44b8d0[_0x5e59('0x21')]=_0x2f4ee9;if(_0x5e0efd[_0x5e59('0x40')]['includeAll']){_0x4376de[_0x5e59('0xb9')]=[{'all':!![]}];}return db[_0x5e59('0xc0')]['findAll'](_0x4376de);})[_0x5e59('0x29')](function(_0x2dd3d1){_0x44b8d0[_0x5e59('0xb5')]=_0x2dd3d1;return _0x44b8d0;});}})['then'](respondWithFilteredResult(_0x41c474,_0x4376de))['catch'](handleError(_0x41c474,null));};exports[_0x5e59('0xc9')]=function(_0x37ed67,_0x4c67c9,_0x60bd08){return db[_0x5e59('0x3c')][_0x5e59('0x60')]({'where':{'id':_0x37ed67[_0x5e59('0xb7')]['id']}})[_0x5e59('0x29')](handleEntityNotFound(_0x4c67c9,null))[_0x5e59('0x29')](function(_0x2f35c1){if(_0x2f35c1){return _0x2f35c1[_0x5e59('0xca')](_0x37ed67[_0x5e59('0x73')][_0x5e59('0xc1')],_[_0x5e59('0xc2')](_0x37ed67[_0x5e59('0x73')],[_0x5e59('0xc1'),'id'])||{})[_0x5e59('0xcb')](function(){return db[_0x5e59('0x6e')][_0x5e59('0xcc')]({'attributes':['id',_0x5e59('0x2c'),'color'],'where':{'id':_0x37ed67['body'][_0x5e59('0xc1')]}});})[_0x5e59('0x29')](function(_0x2da554){socket[_0x5e59('0xcd')](_0x5e59('0xce'),{'id':Number(_0x37ed67[_0x5e59('0xb7')]['id']),'tags':_0x2da554||[]});return{'id':Number(_0x37ed67[_0x5e59('0xb7')]['id']),'tags':_0x2da554||[]};});}})[_0x5e59('0x29')](respondWithResult(_0x4c67c9,null))[_0x5e59('0x33')](handleError(_0x4c67c9,null));};exports['removeTags']=function(_0x322358,_0xe94a56,_0xd569c5){return db[_0x5e59('0x3c')][_0x5e59('0x60')]({'where':{'id':_0x322358[_0x5e59('0xb7')]['id']}})['then'](handleEntityNotFound(_0xe94a56,null))[_0x5e59('0x29')](function(_0x17ba63){if(_0x17ba63){return _0x17ba63['removeTags'](_0x322358[_0x5e59('0x40')][_0x5e59('0xc1')]);}})[_0x5e59('0x29')](respondWithStatusCode(_0xe94a56,null))[_0x5e59('0x33')](handleError(_0xe94a56,null));};exports[_0x5e59('0xcf')]=function(_0x334219,_0x325efb){var _0x1c88dc=moment()[_0x5e59('0xd0')]()[_0x5e59('0xa1')]();var _0x3d279b=path['join'](config[_0x5e59('0xd1')],_0x5e59('0xd2'),_0x5e59('0xd3'),_0x5e59('0xd4'));var _0x549a5c=path[_0x5e59('0xd5')](config['root'],_0x5e59('0xd2'),_0x5e59('0xd3'),_0x5e59('0xd6'));var _0x31ddf3=path[_0x5e59('0xd5')](_0x3d279b,_0x1c88dc);var _0x150be2=util[_0x5e59('0xc7')](_0x5e59('0xd7'),_0x334219['params']['id'],_0x1c88dc);var _0x104bdd=path[_0x5e59('0xd5')](_0x3d279b,_0x150be2);var _0x469947=[];_0x469947[_0x5e59('0xb3')]({'model':db[_0x5e59('0x70')],'as':_0x5e59('0x70'),'attributes':['id',_0x5e59('0xd8')],'raw':!![]});_0x469947[_0x5e59('0xb3')]({'model':db[_0x5e59('0xd9')],'as':_0x5e59('0x65'),'attributes':['id',_0x5e59('0xda'),_0x5e59('0xdb')],'raw':!![]});var _0x3ad2fd=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x5e59('0x73'),_0x5e59('0xdc'),_0x5e59('0xdd'),_0x5e59('0xde'),_0x5e59('0xdf')],'include':_0x469947}];_0x3ad2fd[_0x5e59('0xb3')]({'model':db[_0x5e59('0xe0')],'as':_0x5e59('0xe1'),'attributes':['id',_0x5e59('0x2c')]});_0x3ad2fd[_0x5e59('0xb3')]({'model':db[_0x5e59('0x70')],'as':_0x5e59('0xe2'),'attributes':['id',_0x5e59('0xd8')]});return db[_0x5e59('0x3c')][_0x5e59('0x60')]({'where':{'id':_0x334219[_0x5e59('0xb7')]['id']},'include':_0x3ad2fd})[_0x5e59('0x29')](handleEntityNotFound(_0x325efb,null))[_0x5e59('0x29')](function(_0x33402e){if(_0x33402e){var _0x4b47c5=_0x33402e['get']({'plain':!![]});fs[_0x5e59('0xe3')](_0x31ddf3);var _0x299045={'channel':_0x5e59('0xe4'),'account':_0x4b47c5[_0x5e59('0xe1')][_0x5e59('0x2c')],'agent':_0x4b47c5[_0x5e59('0xe2')]?_0x4b47c5[_0x5e59('0xe2')][_0x5e59('0xd8')]:'N.A.','createdAt':moment(_0x4b47c5['createdAt'])[_0x5e59('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5e59('0xa1')](),'closedAt':_0x4b47c5[_0x5e59('0x38')]?moment(_0x4b47c5[_0x5e59('0xe5')])[_0x5e59('0xc7')](_0x5e59('0xc8'))[_0x5e59('0xa1')]():'','disposition':_0x4b47c5[_0x5e59('0xe6')],'messages':_(_0x4b47c5['Messages'])[_0x5e59('0x86')]({'secret':![]})['map'](function(_0x3bde7c){return{'date':moment(_0x3bde7c[_0x5e59('0xdc')])[_0x5e59('0xc7')](_0x5e59('0xc8'))[_0x5e59('0xa1')](),'sender':_0x3bde7c[_0x5e59('0xdd')]==='out'?_0x3bde7c[_0x5e59('0x70')]?_0x3bde7c[_0x5e59('0x70')]['fullname']:_0x5e59('0xe7'):_0x3bde7c[_0x5e59('0x65')][_0x5e59('0xda')]+(_0x3bde7c[_0x5e59('0x65')][_0x5e59('0xdb')]?'\x20'+_0x3bde7c[_0x5e59('0x65')][_0x5e59('0xdb')]:''),'body':_0x3bde7c[_0x5e59('0x73')],'direction':_0x3bde7c[_0x5e59('0xdd')]===_0x5e59('0xe8')?'A':'C','secret':_0x3bde7c['secret'],'read':_0x3bde7c[_0x5e59('0xdf')]};})[_0x5e59('0x62')]()};return ejs[_0x5e59('0xe9')](path[_0x5e59('0xd5')](config['root'],_0x5e59('0xd2'),_0x5e59('0xea'),_0x5e59('0xeb')),{'interaction':_0x299045})[_0x5e59('0x29')](function(_0x508759){var _0x16d252=path[_0x5e59('0xd5')](_0x31ddf3,_0x5e59('0xec')+_0x4b47c5['id']+'-'+_0x1c88dc+_0x5e59('0xed'));var _0x394b6e={'path':_0x16d252,'channel':'Sms','interactionId':_0x4b47c5['id']};return pdf[_0x5e59('0xee')](_0x508759,_0x394b6e);})[_0x5e59('0x29')](function(){return new BPromise(function(_0xa8cc52,_0x51071b){zipdir(_0x31ddf3,{'saveTo':_0x104bdd},function(_0x40b14b,_0x41149b){if(_0x40b14b)return _0x51071b(_0x40b14b);return _0xa8cc52(_0x41149b);});})['then'](function(){return new BPromise(function(_0x1958a9,_0x5c632a){rimraf(_0x31ddf3,function(_0x13704d){if(_0x13704d)_0x5c632a(_0x13704d);return _0x1958a9();});});})[_0x5e59('0x29')](function(){return _0x325efb[_0x5e59('0xcf')](_0x104bdd,_0x150be2,function(_0x6f1326){if(_0x6f1326){console[_0x5e59('0xef')](_0x5e59('0xf0'),_0x6f1326);}else{fs[_0x5e59('0xf1')](_0x104bdd);}});});});}else{return _0x325efb[_0x5e59('0x1c')](0xc8);}})[_0x5e59('0x33')](handleError(_0x325efb,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index ef76fe5..7cceecd 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 _0x5f2f=['catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','getUsers','then','Users','map','setDataValue','length'];(function(_0x4a061f,_0x503b5f){var _0x362146=function(_0x75dcfb){while(--_0x75dcfb){_0x4a061f['push'](_0x4a061f['shift']());}};_0x362146(++_0x503b5f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4f5738,_0x35171f){_0x4f5738=_0x4f5738-0x0;var _0x4753f0=_0x5f2f[_0x4f5738];return _0x4753f0;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var SmsInteraction=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var SmsMessage=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xf5f2('0x4')](0x0);var events={'afterCreate':_0xf5f2('0x5'),'afterUpdate':_0xf5f2('0x6'),'afterDestroy':'remove'};function emitEvent(_0x4854b6){return function(_0x1665c7,_0x192215,_0xad7f65){_0x1665c7[_0xf5f2('0x7')]({'attributes':['id'],'raw':!![]})[_0xf5f2('0x8')](function(_0x473100){_0x1665c7['setDataValue'](_0xf5f2('0x9'),_0x473100[_0xf5f2('0xa')](function(_0x2ec345){return{'id':_0x2ec345['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x1665c7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf5f2('0x8')](function(_0x15dd7c){_0x1665c7[_0xf5f2('0xb')]('unreadMessages',_0x15dd7c[_0xf5f2('0xc')]);SmsInteractionEvents['emit'](_0x4854b6+':'+_0x1665c7['id'],_0x1665c7);SmsInteractionEvents['emit'](_0x4854b6,_0x1665c7);_0xad7f65(null);})[_0xf5f2('0xd')](_0xad7f65(null));};}for(var e in events){if(events[_0xf5f2('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xf5f2('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0x93e9=['getUsers','then','setDataValue','map','findAll','unreadMessages','emit','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save'];(function(_0x44a186,_0x1fd4df){var _0x27dc5a=function(_0x16bdda){while(--_0x16bdda){_0x44a186['push'](_0x44a186['shift']());}};_0x27dc5a(++_0x1fd4df);}(_0x93e9,0xcc));var _0x993e=function(_0x5f5be8,_0x56cc02){_0x5f5be8=_0x5f5be8-0x0;var _0x5a9a36=_0x93e9[_0x5f5be8];return _0x5a9a36;};'use strict';var EventEmitter=require(_0x993e('0x0'));var SmsInteraction=require(_0x993e('0x1'))['db'][_0x993e('0x2')];var SmsMessage=require(_0x993e('0x1'))['db'][_0x993e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x993e('0x4')](0x0);var events={'afterCreate':_0x993e('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b762e){return function(_0x255045,_0x15ce9b,_0x45f52e){_0x255045[_0x993e('0x6')]({'attributes':['id'],'raw':!![]})[_0x993e('0x7')](function(_0x12ac94){_0x255045[_0x993e('0x8')]('Users',_0x12ac94[_0x993e('0x9')](function(_0x69ff1){return{'id':_0x69ff1['id']};}));return SmsMessage[_0x993e('0xa')]({'where':{'SmsInteractionId':_0x255045['id'],'direction':'in','read':![]},'raw':!![]});})[_0x993e('0x7')](function(_0x2cd389){_0x255045[_0x993e('0x8')](_0x993e('0xb'),_0x2cd389['length']);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e+':'+_0x255045['id'],_0x255045);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e,_0x255045);_0x45f52e(null);})['catch'](_0x45f52e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x993e('0xd')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 1311275..c90724e 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 _0xff29=['closedAt','format','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closed'];(function(_0x3ac856,_0x5ced85){var _0x39ceee=function(_0x4ef551){while(--_0x4ef551){_0x3ac856['push'](_0x3ac856['shift']());}};_0x39ceee(++_0x5ced85);}(_0xff29,0x182));var _0x9ff2=function(_0x29836d,_0x1babe6){_0x29836d=_0x29836d-0x0;var _0x537c4d=_0xff29[_0x29836d];return _0x537c4d;};'use strict';var _=require('lodash');var util=require(_0x9ff2('0x0'));var logger=require(_0x9ff2('0x1'))(_0x9ff2('0x2'));var moment=require(_0x9ff2('0x3'));var BPromise=require(_0x9ff2('0x4'));var rp=require(_0x9ff2('0x5'));var fs=require('fs');var path=require(_0x9ff2('0x6'));var rimraf=require('rimraf');var config=require(_0x9ff2('0x7'));var attributes=require(_0x9ff2('0x8'));module[_0x9ff2('0x9')]=function(_0x2cbd00,_0x2e9281){return _0x2cbd00['define'](_0x9ff2('0xa'),attributes,{'tableName':_0x9ff2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc5b6b9,_0x451482,_0x5463b4){if(_0xc5b6b9[_0x9ff2('0xc')](_0x9ff2('0xd'))){_0xc5b6b9[_0x9ff2('0xe')]=moment()[_0x9ff2('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5463b4(null,_0xc5b6b9);}}});}; \ No newline at end of file +var _0x810a=['rimraf','../../config/environment','./smsInteraction.attributes','SmsInteraction','sms_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4924ae,_0x1dd735){var _0x2238e4=function(_0x48dc88){while(--_0x48dc88){_0x4924ae['push'](_0x4924ae['shift']());}};_0x2238e4(++_0x1dd735);}(_0x810a,0x182));var _0xa810=function(_0x54acc6,_0x1b8605){_0x54acc6=_0x54acc6-0x0;var _0x3f430e=_0x810a[_0x54acc6];return _0x3f430e;};'use strict';var _=require(_0xa810('0x0'));var util=require(_0xa810('0x1'));var logger=require(_0xa810('0x2'))('api');var moment=require(_0xa810('0x3'));var BPromise=require(_0xa810('0x4'));var rp=require(_0xa810('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa810('0x6'));var config=require(_0xa810('0x7'));var attributes=require(_0xa810('0x8'));module['exports']=function(_0xe59d74,_0x28e75b){return _0xe59d74['define'](_0xa810('0x9'),attributes,{'tableName':_0xa810('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x6ed32b,_0x1b3f99,_0x185591){if(_0x6ed32b[_0xa810('0xb')]('closed')){_0x6ed32b[_0xa810('0xc')]=moment()['format'](_0xa810('0xd'));}_0x185591(null,_0x6ed32b);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 70fdf9c..6486173 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 _0xb7ed=['where','attributes','limit','stringify','SmsInteraction','find','addTags','ids','omit','AddTags','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','update','body','options','raw'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0xb7ed,0x1d2));var _0xdb7e=function(_0x36147b,_0x57f40b){_0x36147b=_0x36147b-0x0;var _0x141351=_0xb7ed[_0x36147b];return _0x141351;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdb7e('0x0'));var BPromise=require('bluebird');var rs=require(_0xdb7e('0x1'));var fs=require('fs');var Redis=require(_0xdb7e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdb7e('0x3'))('rpc');var config=require(_0xdb7e('0x4'));var jayson=require(_0xdb7e('0x5'));var client=jayson[_0xdb7e('0x6')]['http']({'port':0x232a});config[_0xdb7e('0x7')]=_[_0xdb7e('0x8')](config[_0xdb7e('0x7')],{'host':_0xdb7e('0x9'),'port':0x18eb});var socket=require(_0xdb7e('0xa'))(new Redis(config[_0xdb7e('0x7')]));require('./smsInteraction.socket')[_0xdb7e('0xb')](socket);function respondWithRpcPromise(_0x562693,_0x49b737,_0x305954){return new BPromise(function(_0x347496,_0x5cbfd4){return client[_0xdb7e('0xc')](_0x562693,_0x305954)[_0xdb7e('0xd')](function(_0x3b507f){logger[_0xdb7e('0xe')]('SmsInteraction,\x20%s,\x20%s',_0x49b737,_0xdb7e('0xf'));logger[_0xdb7e('0x10')](_0xdb7e('0x11'),_0x49b737,_0xdb7e('0xf'),JSON['stringify'](_0x3b507f));if(_0x3b507f[_0xdb7e('0x12')]){if(_0x3b507f[_0xdb7e('0x12')]['code']===0x1f4){logger[_0xdb7e('0x12')](_0xdb7e('0x13'),_0x49b737,_0x3b507f[_0xdb7e('0x12')]['message']);return _0x5cbfd4(_0x3b507f[_0xdb7e('0x12')][_0xdb7e('0x14')]);}logger[_0xdb7e('0x12')](_0xdb7e('0x13'),_0x49b737,_0x3b507f['error'][_0xdb7e('0x14')]);return _0x347496(_0x3b507f[_0xdb7e('0x12')]['message']);}else{logger['info'](_0xdb7e('0x13'),_0x49b737,_0xdb7e('0xf'));_0x347496(_0x3b507f[_0xdb7e('0x15')][_0xdb7e('0x14')]);}})[_0xdb7e('0x16')](function(_0x51f38d){logger[_0xdb7e('0x12')](_0xdb7e('0x13'),_0x49b737,_0x51f38d);_0x5cbfd4(_0x51f38d);});});}exports[_0xdb7e('0x17')]=function(_0x4f56c1){var _0x530dc8=this;return new Promise(function(_0x53ecbe,_0x30563d){return db['SmsInteraction'][_0xdb7e('0x18')](_0x4f56c1[_0xdb7e('0x19')],{'raw':_0x4f56c1['options']?_0x4f56c1[_0xdb7e('0x1a')][_0xdb7e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f56c1[_0xdb7e('0x1a')]?_0x4f56c1['options'][_0xdb7e('0x1c')]||null:null,'attributes':_0x4f56c1[_0xdb7e('0x1a')]?_0x4f56c1[_0xdb7e('0x1a')][_0xdb7e('0x1d')]||null:null,'limit':_0x4f56c1['options']?_0x4f56c1[_0xdb7e('0x1a')][_0xdb7e('0x1e')]||null:null})['then'](function(_0x4f4a6c){logger[_0xdb7e('0xe')](_0xdb7e('0x17'),_0x4f56c1);logger['debug'](_0xdb7e('0x17'),_0x4f56c1,JSON[_0xdb7e('0x1f')](_0x4f4a6c));_0x53ecbe(_0x4f4a6c);})[_0xdb7e('0x16')](function(_0x32c385){logger[_0xdb7e('0x12')](_0xdb7e('0x17'),_0x32c385[_0xdb7e('0x14')],_0x4f56c1);_0x30563d(_0x530dc8[_0xdb7e('0x12')](0x1f4,_0x32c385[_0xdb7e('0x14')]));});});};exports['AddTagsToSmsInteraction']=function(_0x2305de){return new Promise(function(_0x4f644d,_0x1edb5b){return db[_0xdb7e('0x20')][_0xdb7e('0x21')]({'where':_0x2305de[_0xdb7e('0x1a')]?_0x2305de[_0xdb7e('0x1a')][_0xdb7e('0x1c')]||null:null})[_0xdb7e('0xd')](function(_0x48fa59){if(_0x48fa59){return _0x48fa59[_0xdb7e('0x22')](_0x2305de['body'][_0xdb7e('0x23')],_[_0xdb7e('0x24')](_0x2305de['body'],[_0xdb7e('0x23'),'id'])||{});}})['spread'](function(_0x5b97ea){logger[_0xdb7e('0xe')](_0xdb7e('0x25'),_0x2305de);logger['debug']('AddTags',_0x2305de,JSON['stringify'](_0x5b97ea));_0x4f644d(_0x5b97ea);})[_0xdb7e('0x16')](function(_0x184c18){logger[_0xdb7e('0x12')](_0xdb7e('0x25'),_0x184c18['message'],_0x2305de);_0x1edb5b(_this[_0xdb7e('0x12')](0x1f4,_0x184c18['message']));});});}; \ No newline at end of file +var _0xee09=['result','catch','SmsInteraction','update','options','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','SmsInteraction,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee09,0x1a6));var _0x9ee0=function(_0x3fca09,_0x49b8ee){_0x3fca09=_0x3fca09-0x0;var _0xb5e829=_0xee09[_0x3fca09];return _0xb5e829;};'use strict';var _=require(_0x9ee0('0x0'));var util=require(_0x9ee0('0x1'));var moment=require(_0x9ee0('0x2'));var BPromise=require(_0x9ee0('0x3'));var rs=require(_0x9ee0('0x4'));var fs=require('fs');var Redis=require(_0x9ee0('0x5'));var db=require(_0x9ee0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ee0('0x7'))(_0x9ee0('0x8'));var config=require(_0x9ee0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9ee0('0xa')][_0x9ee0('0xb')]({'port':0x232a});config[_0x9ee0('0xc')]=_[_0x9ee0('0xd')](config[_0x9ee0('0xc')],{'host':_0x9ee0('0xe'),'port':0x18eb});var socket=require(_0x9ee0('0xf'))(new Redis(config['redis']));require(_0x9ee0('0x10'))[_0x9ee0('0x11')](socket);function respondWithRpcPromise(_0x5ba7cf,_0x128fe8,_0x3d6bc2){return new BPromise(function(_0x55fb8a,_0x3a10c7){return client[_0x9ee0('0x12')](_0x5ba7cf,_0x3d6bc2)[_0x9ee0('0x13')](function(_0x4ca3bf){logger[_0x9ee0('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x128fe8,_0x9ee0('0x15'));logger[_0x9ee0('0x16')](_0x9ee0('0x17'),_0x128fe8,_0x9ee0('0x15'),JSON[_0x9ee0('0x18')](_0x4ca3bf));if(_0x4ca3bf[_0x9ee0('0x19')]){if(_0x4ca3bf[_0x9ee0('0x19')]['code']===0x1f4){logger[_0x9ee0('0x19')](_0x9ee0('0x1a'),_0x128fe8,_0x4ca3bf[_0x9ee0('0x19')][_0x9ee0('0x1b')]);return _0x3a10c7(_0x4ca3bf[_0x9ee0('0x19')][_0x9ee0('0x1b')]);}logger['error'](_0x9ee0('0x1a'),_0x128fe8,_0x4ca3bf[_0x9ee0('0x19')][_0x9ee0('0x1b')]);return _0x55fb8a(_0x4ca3bf['error'][_0x9ee0('0x1b')]);}else{logger['info'](_0x9ee0('0x1a'),_0x128fe8,_0x9ee0('0x15'));_0x55fb8a(_0x4ca3bf[_0x9ee0('0x1c')][_0x9ee0('0x1b')]);}})[_0x9ee0('0x1d')](function(_0x312098){logger[_0x9ee0('0x19')](_0x9ee0('0x1a'),_0x128fe8,_0x312098);_0x3a10c7(_0x312098);});});}exports['UpdateSmsInteraction']=function(_0x4c30b){var _0x91b4e5=this;return new Promise(function(_0x3ab3c2,_0xed5ac4){return db[_0x9ee0('0x1e')][_0x9ee0('0x1f')](_0x4c30b['body'],{'raw':_0x4c30b['options']?_0x4c30b[_0x9ee0('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c30b['options']?_0x4c30b[_0x9ee0('0x20')][_0x9ee0('0x21')]||null:null,'attributes':_0x4c30b[_0x9ee0('0x20')]?_0x4c30b['options'][_0x9ee0('0x22')]||null:null,'limit':_0x4c30b[_0x9ee0('0x20')]?_0x4c30b[_0x9ee0('0x20')][_0x9ee0('0x23')]||null:null})['then'](function(_0x42a652){logger[_0x9ee0('0x14')](_0x9ee0('0x24'),_0x4c30b);logger[_0x9ee0('0x16')](_0x9ee0('0x24'),_0x4c30b,JSON['stringify'](_0x42a652));_0x3ab3c2(_0x42a652);})['catch'](function(_0x284984){logger[_0x9ee0('0x19')]('UpdateSmsInteraction',_0x284984[_0x9ee0('0x1b')],_0x4c30b);_0xed5ac4(_0x91b4e5[_0x9ee0('0x19')](0x1f4,_0x284984[_0x9ee0('0x1b')]));});});};exports[_0x9ee0('0x25')]=function(_0x2eea3e){return new Promise(function(_0x23bd72,_0x2c39f5){return db[_0x9ee0('0x1e')][_0x9ee0('0x26')]({'where':_0x2eea3e[_0x9ee0('0x20')]?_0x2eea3e[_0x9ee0('0x20')]['where']||null:null})[_0x9ee0('0x13')](function(_0x4f1f41){if(_0x4f1f41){return _0x4f1f41[_0x9ee0('0x27')](_0x2eea3e[_0x9ee0('0x28')][_0x9ee0('0x29')],_[_0x9ee0('0x2a')](_0x2eea3e['body'],[_0x9ee0('0x29'),'id'])||{});}})[_0x9ee0('0x2b')](function(_0x48f0cb){logger[_0x9ee0('0x14')](_0x9ee0('0x2c'),_0x2eea3e);logger[_0x9ee0('0x16')](_0x9ee0('0x2c'),_0x2eea3e,JSON[_0x9ee0('0x18')](_0x48f0cb));_0x23bd72(_0x48f0cb);})[_0x9ee0('0x1d')](function(_0xf6728f){logger[_0x9ee0('0x19')](_0x9ee0('0x2c'),_0xf6728f['message'],_0x2eea3e);_0x2c39f5(_this[_0x9ee0('0x19')](0x1f4,_0xf6728f[_0x9ee0('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index f76a9e6..57620b8 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 _0x3080=['length','smsInteraction:','./smsInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0x3080,0xec));var _0x0308=function(_0xbe5e43,_0x4e46c8){_0xbe5e43=_0xbe5e43-0x0;var _0x5f3a45=_0x3080[_0xbe5e43];return _0x5f3a45;};'use strict';var SmsInteractionEvents=require(_0x0308('0x0'));var events=[_0x0308('0x1'),_0x0308('0x2'),_0x0308('0x3')];function createListener(_0xffc88,_0x3976c9){return function(_0x167454){_0x3976c9[_0x0308('0x4')](_0xffc88,_0x167454);};}function removeListener(_0x28dab6,_0x5296a8){return function(){SmsInteractionEvents[_0x0308('0x5')](_0x28dab6,_0x5296a8);};}exports[_0x0308('0x6')]=function(_0x98b89f){for(var _0x1da90e=0x0,_0xc07209=events[_0x0308('0x7')];_0x1da90e<_0xc07209;_0x1da90e++){var _0x549f2b=events[_0x1da90e];var _0x1b85af=createListener(_0x0308('0x8')+_0x549f2b,_0x98b89f);SmsInteractionEvents['on'](_0x549f2b,_0x1b85af);}}; \ No newline at end of file +var _0xaae1=['remove','update','emit','removeListener','register','length','./smsInteraction.events','save'];(function(_0x202905,_0x34f417){var _0x2d070d=function(_0x26bcf0){while(--_0x26bcf0){_0x202905['push'](_0x202905['shift']());}};_0x2d070d(++_0x34f417);}(_0xaae1,0x96));var _0x1aae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaae1[_0x3dd15e];return _0x231fd0;};'use strict';var SmsInteractionEvents=require(_0x1aae('0x0'));var events=[_0x1aae('0x1'),_0x1aae('0x2'),_0x1aae('0x3')];function createListener(_0x27a4a5,_0x7ca412){return function(_0x75e60b){_0x7ca412[_0x1aae('0x4')](_0x27a4a5,_0x75e60b);};}function removeListener(_0x2cb032,_0x38b21c){return function(){SmsInteractionEvents[_0x1aae('0x5')](_0x2cb032,_0x38b21c);};}exports[_0x1aae('0x6')]=function(_0xd295ba){for(var _0x2e1763=0x0,_0x5c57bb=events[_0x1aae('0x7')];_0x2e1763<_0x5c57bb;_0x2e1763++){var _0x47a2ea=events[_0x2e1763];var _0x34e7fa=createListener('smsInteraction:'+_0x47a2ea,_0xd295ba);SmsInteractionEvents['on'](_0x47a2ea,_0x34e7fa);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 5792c40..89ad71c 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 _0x0d99=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','sms','smsmessage:create','create','status','put','/:id/accept','accept','reject','destroy','exports'];(function(_0x1c1cd0,_0x4b5ae7){var _0x3af1b2=function(_0x2c67b5){while(--_0x2c67b5){_0x1c1cd0['push'](_0x1c1cd0['shift']());}};_0x3af1b2(++_0x4b5ae7);}(_0x0d99,0x1d4));var _0x90d9=function(_0x2a4d07,_0x4144a4){_0x2a4d07=_0x2a4d07-0x0;var _0x204644=_0x0d99[_0x2a4d07];return _0x204644;};'use strict';var multer=require(_0x90d9('0x0'));var util=require(_0x90d9('0x1'));var path=require(_0x90d9('0x2'));var timeout=require(_0x90d9('0x3'));var express=require(_0x90d9('0x4'));var router=express[_0x90d9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x90d9('0x6'));var interaction=require(_0x90d9('0x7'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x90d9('0x8')]('/',auth[_0x90d9('0x9')](),controller[_0x90d9('0xa')]);router[_0x90d9('0x8')](_0x90d9('0xb'),auth[_0x90d9('0x9')](),controller[_0x90d9('0xc')]);router[_0x90d9('0x8')](_0x90d9('0xd'),auth[_0x90d9('0x9')](),controller['show']);router[_0x90d9('0xe')]('/',auth[_0x90d9('0x9')](),interaction[_0x90d9('0xf')](_0x90d9('0x10'),_0x90d9('0x11')),controller[_0x90d9('0x12')]);router[_0x90d9('0xe')]('/:id/status',controller[_0x90d9('0x13')]);router[_0x90d9('0x14')](_0x90d9('0xd'),auth[_0x90d9('0x9')](),controller['update']);router[_0x90d9('0x14')](_0x90d9('0x15'),auth[_0x90d9('0x9')](),controller[_0x90d9('0x16')]);router[_0x90d9('0x14')]('/:id/reject',auth[_0x90d9('0x9')](),controller[_0x90d9('0x17')]);router['delete'](_0x90d9('0xd'),auth[_0x90d9('0x9')](),controller[_0x90d9('0x18')]);module[_0x90d9('0x19')]=router; \ No newline at end of file +var _0xe1e3=['put','/:id/reject','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','tracked','smsmessage:create','create','post','status','/:id/accept'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x23336d,_0x26067f){_0x23336d=_0x23336d-0x0;var _0x36c5b6=_0xe1e3[_0x23336d];return _0x36c5b6;};'use strict';var multer=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var path=require('path');var timeout=require(_0x3e1e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3e1e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3e1e('0x4'));var config=require(_0x3e1e('0x5'));var controller=require(_0x3e1e('0x6'));router[_0x3e1e('0x7')]('/',auth[_0x3e1e('0x8')](),controller[_0x3e1e('0x9')]);router['get'](_0x3e1e('0xa'),auth[_0x3e1e('0x8')](),controller[_0x3e1e('0xb')]);router[_0x3e1e('0x7')](_0x3e1e('0xc'),auth[_0x3e1e('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0x3e1e('0xd')]('sms',_0x3e1e('0xe')),controller[_0x3e1e('0xf')]);router[_0x3e1e('0x10')]('/:id/status',controller[_0x3e1e('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['put'](_0x3e1e('0x12'),auth['isAuthenticated'](),controller['accept']);router[_0x3e1e('0x13')](_0x3e1e('0x14'),auth[_0x3e1e('0x8')](),controller['reject']);router['delete'](_0x3e1e('0xc'),auth[_0x3e1e('0x8')](),controller['destroy']);module[_0x3e1e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 758cccb..0a0b3fb 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 _0x34f8=['sequelize','exports','TEXT','medium','BOOLEAN','out','STRING','DATE'];(function(_0x2e96a0,_0x3e067d){var _0xf29ff6=function(_0x903e4f){while(--_0x903e4f){_0x2e96a0['push'](_0x2e96a0['shift']());}};_0xf29ff6(++_0x3e067d);}(_0x34f8,0x80));var _0x834f=function(_0xd6165e,_0x2195e1){_0xd6165e=_0xd6165e-0x0;var _0x207e4f=_0x34f8[_0xd6165e];return _0x207e4f;};'use strict';var Sequelize=require(_0x834f('0x0'));module[_0x834f('0x1')]={'body':{'type':Sequelize[_0x834f('0x2')](_0x834f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x834f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x834f('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x834f('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x834f('0x7')]},'secret':{'type':Sequelize[_0x834f('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x834f('0x6')]},'providerResponse':{'type':Sequelize[_0x834f('0x2')]}}; \ No newline at end of file +var _0xbcc9=['medium','ENUM','out','STRING','BOOLEAN','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbcc9,0x13d));var _0x9bcc=function(_0x315c3c,_0x70a19c){_0x315c3c=_0x315c3c-0x0;var _0x529bda=_0xbcc9[_0x315c3c];return _0x529bda;};'use strict';var Sequelize=require('sequelize');module[_0x9bcc('0x0')]={'body':{'type':Sequelize['TEXT'](_0x9bcc('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9bcc('0x2')]('in',_0x9bcc('0x3')),'defaultValue':_0x9bcc('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9bcc('0x4')](0xbe)},'phone':{'type':Sequelize[_0x9bcc('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x9bcc('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3002cc6..cdf95a5 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 _0xdca4=['SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','SmsMessage','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','create','body','find','describe','../../config/logger','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','SmsInteraction','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','plivo','MessageUUID','messageId','indexOf','sent'];(function(_0x110321,_0x32c3cc){var _0x33afe5=function(_0x292d1f){while(--_0x292d1f){_0x110321['push'](_0x110321['shift']());}};_0x33afe5(++_0x32c3cc);}(_0xdca4,0x138));var _0x4dca=function(_0x10a082,_0x48b11a){_0x10a082=_0x10a082-0x0;var _0x54fedd=_0xdca4[_0x10a082];return _0x54fedd;};'use strict';var emlformat=require(_0x4dca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4dca('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4dca('0x2'));var moment=require(_0x4dca('0x3'));var BPromise=require(_0x4dca('0x4'));var Mustache=require(_0x4dca('0x5'));var util=require(_0x4dca('0x6'));var path=require(_0x4dca('0x7'));var sox=require(_0x4dca('0x8'));var csv=require('to-csv');var ejs=require(_0x4dca('0x9'));var fs=require('fs');var fs_extra=require(_0x4dca('0xa'));var _=require(_0x4dca('0xb'));var squel=require(_0x4dca('0xc'));var crypto=require('crypto');var jsforce=require(_0x4dca('0xd'));var deskjs=require(_0x4dca('0xe'));var toCsv=require(_0x4dca('0xf'));var querystring=require(_0x4dca('0x10'));var Papa=require(_0x4dca('0x11'));var Redis=require(_0x4dca('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4dca('0x13'));var as=require(_0x4dca('0x14'));var hardwareService=require(_0x4dca('0x15'));var logger=require('../../config/logger')(_0x4dca('0x16'));var utils=require(_0x4dca('0x17'));var config=require(_0x4dca('0x18'));var licenseUtil=require(_0x4dca('0x19'));var db=require(_0x4dca('0x1a'))['db'];config[_0x4dca('0x1b')]=_[_0x4dca('0x1c')](config[_0x4dca('0x1b')],{'host':_0x4dca('0x1d'),'port':0x18eb});var socket=require(_0x4dca('0x1e'))(new Redis(config[_0x4dca('0x1b')]));require('./smsMessage.socket')[_0x4dca('0x1f')](socket);var jayson=require(_0x4dca('0x20'));var client=jayson[_0x4dca('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x4dca('0x21')][_0x4dca('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x4da393,_0x3216e9,_0x3635cd,_0x4df467){return new BPromise(function(_0x327050,_0x2b2d22){var _0x2fea94=_0x4df467||client;return _0x2fea94[_0x4dca('0x23')](_0x4da393,_0x3635cd)[_0x4dca('0x24')](function(_0xef705){logger['info'](_0x4dca('0x25'),_0x3216e9,_0x4dca('0x26'));logger[_0x4dca('0x27')](_0x4dca('0x28'),_0x3216e9,'request\x20sent',JSON[_0x4dca('0x29')](_0xef705));if(_0xef705['error']){if(_0xef705['error'][_0x4dca('0x2a')]===0x1f4){logger[_0x4dca('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x3216e9,_0xef705[_0x4dca('0x2b')][_0x4dca('0x2c')]);return _0x2b2d22(_0xef705['error'][_0x4dca('0x2c')]);}logger[_0x4dca('0x2b')](_0x4dca('0x25'),_0x3216e9,_0xef705[_0x4dca('0x2b')][_0x4dca('0x2c')]);return _0x327050(_0xef705[_0x4dca('0x2b')]['message']);}else{logger[_0x4dca('0x2d')]('SmsMessage,\x20%s,\x20%s',_0x3216e9,_0x4dca('0x26'));_0x327050(_0xef705[_0x4dca('0x2e')][_0x4dca('0x2c')]);}})[_0x4dca('0x2f')](function(_0x5e651b){logger[_0x4dca('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x3216e9,_0x5e651b);_0x2b2d22(_0x5e651b);});});}function respondWithStatusCode(_0x17f6b9,_0x374043){_0x374043=_0x374043||0xcc;return function(_0x3c9013){if(_0x3c9013){return _0x17f6b9['sendStatus'](_0x374043);}return _0x17f6b9['status'](_0x374043)[_0x4dca('0x30')]();};}function respondWithResult(_0x1e0cf,_0x34d70e){_0x34d70e=_0x34d70e||0xc8;return function(_0xc833f4){if(_0xc833f4){return _0x1e0cf['status'](_0x34d70e)[_0x4dca('0x31')](_0xc833f4);}};}function respondWithFilteredResult(_0x5c02aa,_0x35be18){return function(_0x28f1e1){if(_0x28f1e1){var _0x60caa1=typeof _0x35be18[_0x4dca('0x32')]===_0x4dca('0x33')&&typeof _0x35be18[_0x4dca('0x34')]===_0x4dca('0x33');var _0x1a08f7=_0x28f1e1[_0x4dca('0x35')];var _0x3f9171=_0x60caa1?0x0:_0x35be18['offset'];var _0x500f2b=_0x60caa1?_0x28f1e1['count']:_0x35be18[_0x4dca('0x32')]+_0x35be18[_0x4dca('0x34')];var _0x403064;if(_0x500f2b>=_0x1a08f7){_0x500f2b=_0x1a08f7;_0x403064=0xc8;}else{_0x403064=0xce;}_0x5c02aa[_0x4dca('0x36')](_0x403064);return _0x5c02aa['set'](_0x4dca('0x37'),_0x3f9171+'-'+_0x500f2b+'/'+_0x1a08f7)[_0x4dca('0x31')](_0x28f1e1);}return null;};}function patchUpdates(_0x2615ad){return function(_0x4e42c8){try{jsonpatch[_0x4dca('0x38')](_0x4e42c8,_0x2615ad,!![]);}catch(_0x564d3c){return BPromise[_0x4dca('0x39')](_0x564d3c);}return _0x4e42c8[_0x4dca('0x3a')]();};}function saveUpdates(_0x5b3ccb,_0x211151){return function(_0x20eaa4){if(_0x20eaa4){return _0x20eaa4[_0x4dca('0x3b')](_0x5b3ccb)[_0x4dca('0x24')](function(_0x5b5726){return _0x5b5726;});}return null;};}function removeEntity(_0x405855,_0x47a181){return function(_0x48490b){if(_0x48490b){return _0x48490b[_0x4dca('0x3c')]()[_0x4dca('0x24')](function(){_0x405855[_0x4dca('0x36')](0xcc)[_0x4dca('0x30')]();});}};}function handleEntityNotFound(_0x3beb24,_0x1911ab){return function(_0x3c45cb){if(!_0x3c45cb){_0x3beb24[_0x4dca('0x3d')](0x194);}return _0x3c45cb;};}function handleError(_0x5c3ee0,_0xf96ca9){_0xf96ca9=_0xf96ca9||0x1f4;return function(_0x1c60ae){logger['error'](_0x1c60ae['stack']);if(_0x1c60ae['name']){delete _0x1c60ae[_0x4dca('0x3e')];}_0x5c3ee0[_0x4dca('0x36')](_0xf96ca9)[_0x4dca('0x3f')](_0x1c60ae);};}exports[_0x4dca('0x40')]=function(_0x5115bc,_0x48ab13){var _0x1f3954={},_0x529318={},_0x4533c0={'count':0x0,'rows':[]};var _0x1a51ad=_['map'](db[_0x4dca('0x41')][_0x4dca('0x42')],function(_0x44f700){return{'name':_0x44f700[_0x4dca('0x43')],'type':_0x44f700[_0x4dca('0x44')]['key']};});_0x529318[_0x4dca('0x45')]=_[_0x4dca('0x46')](_0x1a51ad,'name');_0x529318[_0x4dca('0x47')]=_[_0x4dca('0x48')](_0x5115bc['query']);_0x529318[_0x4dca('0x49')]=_['intersection'](_0x529318[_0x4dca('0x45')],_0x529318[_0x4dca('0x47')]);_0x1f3954['attributes']=_[_0x4dca('0x4a')](_0x529318[_0x4dca('0x45')],qs[_0x4dca('0x4b')](_0x5115bc[_0x4dca('0x47')][_0x4dca('0x4b')]));_0x1f3954[_0x4dca('0x4c')]=_0x1f3954[_0x4dca('0x4c')]['length']?_0x1f3954[_0x4dca('0x4c')]:_0x529318[_0x4dca('0x45')];if(!_0x5115bc[_0x4dca('0x47')][_0x4dca('0x4d')]('nolimit')){_0x1f3954[_0x4dca('0x34')]=qs[_0x4dca('0x34')](_0x5115bc[_0x4dca('0x47')]['limit']);_0x1f3954[_0x4dca('0x32')]=qs[_0x4dca('0x32')](_0x5115bc[_0x4dca('0x47')][_0x4dca('0x32')]);}_0x1f3954[_0x4dca('0x4e')]=qs[_0x4dca('0x4f')](_0x5115bc[_0x4dca('0x47')][_0x4dca('0x4f')]);_0x1f3954['where']=qs[_0x4dca('0x49')](_['pick'](_0x5115bc[_0x4dca('0x47')],_0x529318[_0x4dca('0x49')]),_0x1a51ad);if(_0x5115bc['query']['filter']){_0x1f3954[_0x4dca('0x50')]=_[_0x4dca('0x51')](_0x1f3954[_0x4dca('0x50')],{'$or':_['map'](_0x1a51ad,function(_0x2e9b53){if(_0x2e9b53[_0x4dca('0x44')]!==_0x4dca('0x52')){var _0xf6f024={};_0xf6f024[_0x2e9b53[_0x4dca('0x3e')]]={'$like':'%'+_0x5115bc['query'][_0x4dca('0x53')]+'%'};return _0xf6f024;}})});}_0x1f3954=_['merge']({},_0x1f3954,_0x5115bc[_0x4dca('0x54')]);var _0x273937={'where':_0x1f3954[_0x4dca('0x50')]};return db[_0x4dca('0x41')]['count'](_0x273937)['then'](function(_0x2cae34){_0x4533c0['count']=_0x2cae34;if(_0x5115bc[_0x4dca('0x47')][_0x4dca('0x55')]){_0x1f3954[_0x4dca('0x56')]=[{'all':!![]}];}return db[_0x4dca('0x41')][_0x4dca('0x57')](_0x1f3954);})[_0x4dca('0x24')](function(_0x42edf7){_0x4533c0[_0x4dca('0x58')]=_0x42edf7;return _0x4533c0;})['then'](respondWithFilteredResult(_0x48ab13,_0x1f3954))[_0x4dca('0x2f')](handleError(_0x48ab13,null));};exports[_0x4dca('0x59')]=function(_0x34f806,_0x4b9306){var _0x2b1388={'raw':!![],'where':{'id':_0x34f806[_0x4dca('0x5a')]['id']}},_0xe208cd={};_0xe208cd[_0x4dca('0x45')]=_[_0x4dca('0x48')](db[_0x4dca('0x41')]['rawAttributes']);_0xe208cd['query']=_['keys'](_0x34f806[_0x4dca('0x47')]);_0xe208cd[_0x4dca('0x49')]=_['intersection'](_0xe208cd[_0x4dca('0x45')],_0xe208cd[_0x4dca('0x47')]);_0x2b1388[_0x4dca('0x4c')]=_[_0x4dca('0x4a')](_0xe208cd[_0x4dca('0x45')],qs[_0x4dca('0x4b')](_0x34f806[_0x4dca('0x47')]['fields']));_0x2b1388[_0x4dca('0x4c')]=_0x2b1388[_0x4dca('0x4c')][_0x4dca('0x5b')]?_0x2b1388[_0x4dca('0x4c')]:_0xe208cd[_0x4dca('0x45')];if(_0x34f806['query'][_0x4dca('0x55')]){_0x2b1388[_0x4dca('0x56')]=[{'all':!![]}];}_0x2b1388=_[_0x4dca('0x51')]({},_0x2b1388,_0x34f806[_0x4dca('0x54')]);return db[_0x4dca('0x41')]['find'](_0x2b1388)[_0x4dca('0x24')](handleEntityNotFound(_0x4b9306,null))[_0x4dca('0x24')](respondWithResult(_0x4b9306,null))['catch'](handleError(_0x4b9306,null));};exports['create']=function(_0x39294d,_0x178363){return db[_0x4dca('0x41')][_0x4dca('0x5c')](_0x39294d[_0x4dca('0x5d')],{})[_0x4dca('0x24')](respondWithResult(_0x178363,0xc9))['catch'](handleError(_0x178363,null));};exports[_0x4dca('0x3b')]=function(_0xeade6e,_0x50ef3e){if(_0xeade6e['body']['id']){delete _0xeade6e['body']['id'];}return db[_0x4dca('0x41')]['find']({'where':{'id':_0xeade6e[_0x4dca('0x5a')]['id']}})[_0x4dca('0x24')](handleEntityNotFound(_0x50ef3e,null))[_0x4dca('0x24')](saveUpdates(_0xeade6e[_0x4dca('0x5d')],null))[_0x4dca('0x24')](respondWithResult(_0x50ef3e,null))[_0x4dca('0x2f')](handleError(_0x50ef3e,null));};exports['destroy']=function(_0x425474,_0x1a7df1){return db['SmsMessage'][_0x4dca('0x5e')]({'where':{'id':_0x425474[_0x4dca('0x5a')]['id']}})[_0x4dca('0x24')](handleEntityNotFound(_0x1a7df1,null))[_0x4dca('0x24')](removeEntity(_0x1a7df1,null))[_0x4dca('0x2f')](handleError(_0x1a7df1,null));};exports['describe']=function(_0x3d86c1,_0x13cf2c){return db['SmsMessage'][_0x4dca('0x5f')]()[_0x4dca('0x24')](respondWithResult(_0x13cf2c,null))['catch'](handleError(_0x13cf2c,null));};var interaction_log=require(_0x4dca('0x60'))('sms-interactions');exports[_0x4dca('0x61')]=function(_0x1d2ef7,_0x22c3f3,_0x380e52){var _0x209d9e={'agent':{},'channel':_0x4dca('0x62')};if(_0x1d2ef7[_0x4dca('0x5d')]['id']){delete _0x1d2ef7[_0x4dca('0x5d')]['id'];}_0x1d2ef7[_0x4dca('0x5d')][_0x4dca('0x63')]=!![];_0x1d2ef7[_0x4dca('0x5d')][_0x4dca('0x64')]=moment()[_0x4dca('0x65')](_0x4dca('0x66'));_0x1d2ef7[_0x4dca('0x5d')][_0x4dca('0x67')]=_0x1d2ef7['body'][_0x4dca('0x67')]||_0x1d2ef7[_0x4dca('0x68')]['id'];_0x209d9e[_0x4dca('0x69')]['id']=_0x1d2ef7[_0x4dca('0x5d')][_0x4dca('0x67')];return db[_0x4dca('0x41')][_0x4dca('0x5e')]({'where':{'id':_0x1d2ef7['params']['id'],'UserId':null}})[_0x4dca('0x24')](handleEntityNotFound(_0x22c3f3,null))[_0x4dca('0x24')](saveUpdates(_0x1d2ef7[_0x4dca('0x5d')],null))['then'](function(_0x1749c0){if(_0x1749c0){_0x209d9e[_0x4dca('0x2c')]=_0x1749c0[_0x4dca('0x6a')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x1749c0['SmsInteractionId']}});}return null;})[_0x4dca('0x24')](handleEntityNotFound(_0x22c3f3,null))[_0x4dca('0x24')](function(_0x266c72){if(_0x266c72){return _0x266c72[_0x4dca('0x3b')]({'UserId':_0x1d2ef7[_0x4dca('0x5d')][_0x4dca('0x67')],'read1stAt':_[_0x4dca('0x6b')](_0x266c72[_0x4dca('0x6c')])?moment()[_0x4dca('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4dca('0x24')](function(_0x4a1613){if(_0x4a1613){_0x209d9e[_0x4dca('0x6d')]=_0x4a1613[_0x4dca('0x6a')]({'plain':!![]});interaction_log[_0x4dca('0x2d')](_0x4dca('0x6e'),_0x1d2ef7[_0x4dca('0x68')]['id'],_0x1d2ef7[_0x4dca('0x68')]['name'],_0x1d2ef7[_0x4dca('0x68')][_0x4dca('0x6f')],_0x209d9e[_0x4dca('0x6d')]['id'],_0x1d2ef7['body']?JSON[_0x4dca('0x29')](_0x1d2ef7[_0x4dca('0x5d')]):_0x4dca('0x70'));return respondWithRpcPromise(_0x4dca('0x71'),_0x4dca('0x72'),_0x209d9e);}return null;})[_0x4dca('0x24')](function(_0x51da0b){var _0x4a294c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x51da0b[_0x4dca('0x2c')][_0x4dca('0x73')];return db[_0x4dca('0x74')]['query'](_0x4a294c,{'type':db[_0x4dca('0x75')][_0x4dca('0x76')][_0x4dca('0x77')],'raw':!![]})['then'](function(_0x573060){return _0x573060;});})[_0x4dca('0x24')](function(_0x13f134){if(_0x13f134){_0x209d9e[_0x4dca('0x2c')][_0x4dca('0x78')]=_0x13f134[0x0];if(!_0x1d2ef7[_0x4dca('0x5d')][_0x4dca('0x67')])return;return db[_0x4dca('0x79')][_0x4dca('0x5e')]({'where':{'id':_0x1d2ef7[_0x4dca('0x5d')][_0x4dca('0x67')],'role':'agent'},'attributes':['id',_0x4dca('0x3e'),_0x4dca('0x7a'),_0x4dca('0x7b'),_0x4dca('0x7c')],'raw':!![]});}return null;})['then'](function(_0x5a8c8d){if(!_0x5a8c8d)return null;_0x209d9e['message'][_0x4dca('0x69')]=_0x5a8c8d;return _0x209d9e;})[_0x4dca('0x24')](function(_0x3e19ba){if(_0x3e19ba){if(_0x1d2ef7['body']['manual']){_0x209d9e['message'][_0x4dca('0x7d')]=util[_0x4dca('0x65')](_0x4dca('0x7e'),_0x1d2ef7[_0x4dca('0x68')][_0x4dca('0x3e')]);_0x209d9e[_0x4dca('0x2c')][_0x4dca('0x7f')]=_0x209d9e['channel'];_0x209d9e[_0x4dca('0x2c')][_0x4dca('0x80')]=_0x209d9e['channel'];_0x209d9e[_0x4dca('0x2c')][_0x4dca('0x81')]=_0x4dca('0x61');return respondWithRpcPromise(_0x4dca('0x82'),'EventManager',{'event':'acceptmessage','message':_0x209d9e['message']},client9002)['then'](function(){return _0x209d9e;});}return _0x209d9e;}return null;})[_0x4dca('0x24')](respondWithResult(_0x22c3f3,null))['catch'](handleError(_0x22c3f3,null));};var interaction_log=require(_0x4dca('0x60'))('sms-interactions');exports['reject']=function(_0x5b4d21,_0x16c0b8,_0x29f50a){var _0x4f6bb3={'agent':{},'channel':_0x4dca('0x62')};if(_0x5b4d21[_0x4dca('0x5d')]['id']){delete _0x5b4d21['body']['id'];}_0x5b4d21[_0x4dca('0x5d')][_0x4dca('0x67')]=_0x5b4d21[_0x4dca('0x5d')][_0x4dca('0x67')]||_0x5b4d21[_0x4dca('0x68')]['id'];_0x4f6bb3[_0x4dca('0x69')]['id']=_0x5b4d21[_0x4dca('0x5d')]['UserId'];return db['SmsMessage'][_0x4dca('0x5e')]({'where':{'id':_0x5b4d21[_0x4dca('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x16c0b8,null))['then'](function(_0x106ace){if(_0x106ace){_0x4f6bb3[_0x4dca('0x2c')]=_0x106ace[_0x4dca('0x6a')]({'plain':!![]});return db[_0x4dca('0x83')][_0x4dca('0x5e')]({'where':{'id':_0x106ace[_0x4dca('0x84')]}});}return null;})[_0x4dca('0x24')](handleEntityNotFound(_0x16c0b8,null))[_0x4dca('0x24')](function(_0x33d859){if(_0x33d859){_0x4f6bb3[_0x4dca('0x6d')]=_0x33d859[_0x4dca('0x6a')]({'plain':!![]});interaction_log[_0x4dca('0x2d')](_0x4dca('0x85'),_0x5b4d21[_0x4dca('0x68')]['id'],_0x5b4d21['user'][_0x4dca('0x3e')],_0x5b4d21[_0x4dca('0x68')][_0x4dca('0x6f')],_0x4f6bb3[_0x4dca('0x6d')]['id'],_0x5b4d21[_0x4dca('0x5d')]?JSON[_0x4dca('0x29')](_0x5b4d21['body']):_0x4dca('0x70'));return respondWithRpcPromise('RejectMessage',_0x4dca('0x86'),_0x4f6bb3);}return null;})[_0x4dca('0x24')](function(_0x3e7c73){var _0x1a4ba1=_0x4dca('0x87')+_0x3e7c73[_0x4dca('0x2c')][_0x4dca('0x73')];return db[_0x4dca('0x74')]['query'](_0x1a4ba1,{'type':db[_0x4dca('0x75')][_0x4dca('0x76')][_0x4dca('0x77')],'raw':!![]})[_0x4dca('0x24')](function(_0x4ca9a4){return _0x4ca9a4;});})[_0x4dca('0x24')](function(_0x3ab6f3){if(_0x3ab6f3){_0x4f6bb3[_0x4dca('0x2c')]['contact']=_0x3ab6f3[0x0];if(!_0x5b4d21[_0x4dca('0x5d')]['UserId'])return;return db[_0x4dca('0x79')]['find']({'where':{'id':_0x5b4d21[_0x4dca('0x5d')]['UserId'],'role':'agent'},'attributes':['id',_0x4dca('0x3e'),_0x4dca('0x7a'),'email',_0x4dca('0x7c')],'raw':!![]});}return null;})[_0x4dca('0x24')](function(_0x95a153){if(!_0x95a153)return null;_0x4f6bb3[_0x4dca('0x2c')][_0x4dca('0x69')]=_0x95a153;return _0x4f6bb3;})[_0x4dca('0x24')](function(_0x4eb305){if(_0x4eb305){_0x4eb305[_0x4dca('0x2c')][_0x4dca('0x7d')]=util[_0x4dca('0x65')](_0x4dca('0x7e'),_0x5b4d21[_0x4dca('0x68')][_0x4dca('0x3e')]);_0x4eb305['message'][_0x4dca('0x7f')]=_0x4f6bb3['channel'];_0x4eb305[_0x4dca('0x2c')][_0x4dca('0x80')]=_0x4f6bb3[_0x4dca('0x7f')];_0x4eb305[_0x4dca('0x2c')][_0x4dca('0x81')]='reject';respondWithRpcPromise(_0x4dca('0x82'),_0x4dca('0x82'),{'event':'rejectmessage','message':_0x4eb305[_0x4dca('0x2c')]},client9002);return _0x4f6bb3;}return null;})[_0x4dca('0x24')](respondWithResult(_0x16c0b8,null))[_0x4dca('0x2f')](handleError(_0x16c0b8,null));};exports[_0x4dca('0x36')]=function(_0x1b6113,_0x269bff,_0x1ca4cd){if(_0x1b6113['body']['id']){delete _0x1b6113[_0x4dca('0x5d')]['id'];}var _0x1a5416;return db['SmsMessage']['find']({'where':{'id':_0x1b6113['params']['id']}})[_0x4dca('0x24')](handleEntityNotFound(_0x269bff,null))['then'](function(_0x4a03d8){if(_0x4a03d8){_0x1a5416=_0x4a03d8;return db[_0x4dca('0x88')][_0x4dca('0x5e')]({'where':{'id':_0x4a03d8[_0x4dca('0x89')]}});}})[_0x4dca('0x24')](handleEntityNotFound(_0x269bff,null))['then'](function(_0x86fb99){if(_0x86fb99){logger[_0x4dca('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4dca('0x36'),_0x4dca('0x8a'),_0x86fb99[_0x4dca('0x44')],util[_0x4dca('0x8b')](_0x1b6113['body'],{'showHidden':![],'depth':null}));switch(_0x86fb99[_0x4dca('0x44')]){case _0x4dca('0x8c'):if(_0x1b6113['body'][_0x4dca('0x8d')]&&_0x1b6113['body'][_0x4dca('0x8d')]===_0x1a5416['messageId']){return _0x1a5416['update']({'read':!![]});}else{logger[_0x4dca('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4dca('0x8c'),util['inspect'](_0x1b6113[_0x4dca('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x4dca('0x8e'):if(_0x1b6113['body'][_0x4dca('0x8f')]&&_0x1b6113[_0x4dca('0x5d')][_0x4dca('0x8f')]===_0x1a5416[_0x4dca('0x90')]&&_[_0x4dca('0x91')]([_0x4dca('0x92'),'delivered'],_0x1b6113[_0x4dca('0x5d')]['Status'])>=0x0){return _0x1a5416[_0x4dca('0x3b')]({'read':!![]});}else{logger['error'](_0x4dca('0x93'),_0x4dca('0x36'),_0x4dca('0x94'),util[_0x4dca('0x8b')](_0x1b6113[_0x4dca('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x4dca('0x95'):var _0x4a1a23=_0x1b6113[_0x4dca('0x5d')][_0x4dca('0x96')][0x0];if(_0x4a1a23['status'][_0x4dca('0x97')]===_0x4dca('0x98')){return _0x1a5416[_0x4dca('0x3b')]({'read':!![]});}else{logger[_0x4dca('0x2b')](_0x4dca('0x93'),_0x4dca('0x36'),_0x4dca('0x95'),util[_0x4dca('0x8b')](_0x1b6113['body'],{'showHidden':![],'depth':null}));}break;}return _0x1a5416;}})[_0x4dca('0x24')](respondWithResult(_0x269bff,null))['catch'](handleError(_0x269bff,null));}; \ No newline at end of file +var _0xbca0=['util','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','show','params','keys','length','options','find','body','describe','sms-interactions','accept','readAt','format','UserId','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','get','user','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','internal','motionChannel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageUUID','indexOf','Status','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','results','DELIVERED','eml-format','rimraf','moment','bluebird','mustache'];(function(_0x163875,_0x23eab9){var _0x38e02a=function(_0x43fe02){while(--_0x43fe02){_0x163875['push'](_0x163875['shift']());}};_0x38e02a(++_0x23eab9);}(_0xbca0,0x8b));var _0x0bca=function(_0x34293b,_0x1c96d4){_0x34293b=_0x34293b-0x0;var _0x5da666=_0xbca0[_0x34293b];return _0x5da666;};'use strict';var emlformat=require(_0x0bca('0x0'));var rimraf=require(_0x0bca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0bca('0x2'));var BPromise=require(_0x0bca('0x3'));var Mustache=require(_0x0bca('0x4'));var util=require(_0x0bca('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0bca('0x6'));var ejs=require(_0x0bca('0x7'));var fs=require('fs');var fs_extra=require(_0x0bca('0x8'));var _=require(_0x0bca('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0bca('0xa'));var toCsv=require(_0x0bca('0x6'));var querystring=require(_0x0bca('0xb'));var Papa=require(_0x0bca('0xc'));var Redis=require(_0x0bca('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0bca('0xe'));var hardwareService=require(_0x0bca('0xf'));var logger=require(_0x0bca('0x10'))(_0x0bca('0x11'));var utils=require(_0x0bca('0x12'));var config=require(_0x0bca('0x13'));var licenseUtil=require(_0x0bca('0x14'));var db=require(_0x0bca('0x15'))['db'];config[_0x0bca('0x16')]=_[_0x0bca('0x17')](config[_0x0bca('0x16')],{'host':_0x0bca('0x18'),'port':0x18eb});var socket=require(_0x0bca('0x19'))(new Redis(config[_0x0bca('0x16')]));require(_0x0bca('0x1a'))[_0x0bca('0x1b')](socket);var jayson=require(_0x0bca('0x1c'));var client=jayson[_0x0bca('0x1d')][_0x0bca('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x0bca('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x464fbf,_0x13c80a,_0x2e1c82,_0x466b72){return new BPromise(function(_0x2ed970,_0x44f6d1){var _0x512830=_0x466b72||client;return _0x512830[_0x0bca('0x1f')](_0x464fbf,_0x2e1c82)[_0x0bca('0x20')](function(_0x821736){logger[_0x0bca('0x21')](_0x0bca('0x22'),_0x13c80a,_0x0bca('0x23'));logger[_0x0bca('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x13c80a,_0x0bca('0x23'),JSON['stringify'](_0x821736));if(_0x821736['error']){if(_0x821736[_0x0bca('0x25')][_0x0bca('0x26')]===0x1f4){logger[_0x0bca('0x25')](_0x0bca('0x22'),_0x13c80a,_0x821736[_0x0bca('0x25')][_0x0bca('0x27')]);return _0x44f6d1(_0x821736['error'][_0x0bca('0x27')]);}logger[_0x0bca('0x25')]('SmsMessage,\x20%s,\x20%s',_0x13c80a,_0x821736[_0x0bca('0x25')][_0x0bca('0x27')]);return _0x2ed970(_0x821736[_0x0bca('0x25')][_0x0bca('0x27')]);}else{logger[_0x0bca('0x21')](_0x0bca('0x22'),_0x13c80a,_0x0bca('0x23'));_0x2ed970(_0x821736['result'][_0x0bca('0x27')]);}})[_0x0bca('0x28')](function(_0x2cece9){logger[_0x0bca('0x25')](_0x0bca('0x22'),_0x13c80a,_0x2cece9);_0x44f6d1(_0x2cece9);});});}function respondWithStatusCode(_0x1d7f87,_0x1fafc9){_0x1fafc9=_0x1fafc9||0xcc;return function(_0xabafd1){if(_0xabafd1){return _0x1d7f87[_0x0bca('0x29')](_0x1fafc9);}return _0x1d7f87[_0x0bca('0x2a')](_0x1fafc9)[_0x0bca('0x2b')]();};}function respondWithResult(_0x3fc816,_0x45f4da){_0x45f4da=_0x45f4da||0xc8;return function(_0x268df5){if(_0x268df5){return _0x3fc816[_0x0bca('0x2a')](_0x45f4da)[_0x0bca('0x2c')](_0x268df5);}};}function respondWithFilteredResult(_0x3d687c,_0x1b7e2b){return function(_0x1be2b7){if(_0x1be2b7){var _0x3810ed=typeof _0x1b7e2b[_0x0bca('0x2d')]===_0x0bca('0x2e')&&typeof _0x1b7e2b['limit']===_0x0bca('0x2e');var _0x75ef08=_0x1be2b7[_0x0bca('0x2f')];var _0x3faad1=_0x3810ed?0x0:_0x1b7e2b[_0x0bca('0x2d')];var _0x4e8b17=_0x3810ed?_0x1be2b7['count']:_0x1b7e2b[_0x0bca('0x2d')]+_0x1b7e2b[_0x0bca('0x30')];var _0x23ab74;if(_0x4e8b17>=_0x75ef08){_0x4e8b17=_0x75ef08;_0x23ab74=0xc8;}else{_0x23ab74=0xce;}_0x3d687c[_0x0bca('0x2a')](_0x23ab74);return _0x3d687c[_0x0bca('0x31')](_0x0bca('0x32'),_0x3faad1+'-'+_0x4e8b17+'/'+_0x75ef08)[_0x0bca('0x2c')](_0x1be2b7);}return null;};}function patchUpdates(_0x3fa3c3){return function(_0x3baa39){try{jsonpatch[_0x0bca('0x33')](_0x3baa39,_0x3fa3c3,!![]);}catch(_0x8544b2){return BPromise[_0x0bca('0x34')](_0x8544b2);}return _0x3baa39[_0x0bca('0x35')]();};}function saveUpdates(_0x40b08a,_0x3e1d36){return function(_0x1832b3){if(_0x1832b3){return _0x1832b3[_0x0bca('0x36')](_0x40b08a)[_0x0bca('0x20')](function(_0x395060){return _0x395060;});}return null;};}function removeEntity(_0xe333ca,_0x184773){return function(_0x519e5e){if(_0x519e5e){return _0x519e5e[_0x0bca('0x37')]()[_0x0bca('0x20')](function(){_0xe333ca[_0x0bca('0x2a')](0xcc)[_0x0bca('0x2b')]();});}};}function handleEntityNotFound(_0x8aea9e,_0x1ccb47){return function(_0x1ad69e){if(!_0x1ad69e){_0x8aea9e[_0x0bca('0x29')](0x194);}return _0x1ad69e;};}function handleError(_0x26fd11,_0x343ff7){_0x343ff7=_0x343ff7||0x1f4;return function(_0x5e480e){logger[_0x0bca('0x25')](_0x5e480e[_0x0bca('0x38')]);if(_0x5e480e[_0x0bca('0x39')]){delete _0x5e480e[_0x0bca('0x39')];}_0x26fd11[_0x0bca('0x2a')](_0x343ff7)[_0x0bca('0x3a')](_0x5e480e);};}exports[_0x0bca('0x3b')]=function(_0x4b1650,_0x2fcc24){var _0x3d7e97={},_0x2051eb={},_0x2f5875={'count':0x0,'rows':[]};var _0x45b0ed=_[_0x0bca('0x3c')](db[_0x0bca('0x3d')][_0x0bca('0x3e')],function(_0x22674d){return{'name':_0x22674d[_0x0bca('0x3f')],'type':_0x22674d[_0x0bca('0x40')]['key']};});_0x2051eb[_0x0bca('0x41')]=_[_0x0bca('0x3c')](_0x45b0ed,_0x0bca('0x39'));_0x2051eb[_0x0bca('0x42')]=_['keys'](_0x4b1650[_0x0bca('0x42')]);_0x2051eb[_0x0bca('0x43')]=_['intersection'](_0x2051eb['model'],_0x2051eb[_0x0bca('0x42')]);_0x3d7e97[_0x0bca('0x44')]=_[_0x0bca('0x45')](_0x2051eb['model'],qs['fields'](_0x4b1650['query'][_0x0bca('0x46')]));_0x3d7e97[_0x0bca('0x44')]=_0x3d7e97['attributes']['length']?_0x3d7e97[_0x0bca('0x44')]:_0x2051eb['model'];if(!_0x4b1650[_0x0bca('0x42')][_0x0bca('0x47')](_0x0bca('0x48'))){_0x3d7e97[_0x0bca('0x30')]=qs[_0x0bca('0x30')](_0x4b1650['query'][_0x0bca('0x30')]);_0x3d7e97[_0x0bca('0x2d')]=qs['offset'](_0x4b1650['query'][_0x0bca('0x2d')]);}_0x3d7e97['order']=qs[_0x0bca('0x49')](_0x4b1650[_0x0bca('0x42')][_0x0bca('0x49')]);_0x3d7e97[_0x0bca('0x4a')]=qs[_0x0bca('0x43')](_[_0x0bca('0x4b')](_0x4b1650[_0x0bca('0x42')],_0x2051eb[_0x0bca('0x43')]),_0x45b0ed);if(_0x4b1650[_0x0bca('0x42')]['filter']){_0x3d7e97['where']=_[_0x0bca('0x4c')](_0x3d7e97[_0x0bca('0x4a')],{'$or':_[_0x0bca('0x3c')](_0x45b0ed,function(_0x7e37ff){if(_0x7e37ff['type']!==_0x0bca('0x4d')){var _0x4840ce={};_0x4840ce[_0x7e37ff['name']]={'$like':'%'+_0x4b1650[_0x0bca('0x42')]['filter']+'%'};return _0x4840ce;}})});}_0x3d7e97=_[_0x0bca('0x4c')]({},_0x3d7e97,_0x4b1650['options']);var _0x5d9ed3={'where':_0x3d7e97[_0x0bca('0x4a')]};return db[_0x0bca('0x3d')][_0x0bca('0x2f')](_0x5d9ed3)['then'](function(_0x50d8d6){_0x2f5875[_0x0bca('0x2f')]=_0x50d8d6;if(_0x4b1650[_0x0bca('0x42')][_0x0bca('0x4e')]){_0x3d7e97[_0x0bca('0x4f')]=[{'all':!![]}];}return db[_0x0bca('0x3d')][_0x0bca('0x50')](_0x3d7e97);})['then'](function(_0x3f80be){_0x2f5875['rows']=_0x3f80be;return _0x2f5875;})[_0x0bca('0x20')](respondWithFilteredResult(_0x2fcc24,_0x3d7e97))[_0x0bca('0x28')](handleError(_0x2fcc24,null));};exports[_0x0bca('0x51')]=function(_0x31f636,_0x171b6d){var _0x49e6c9={'raw':!![],'where':{'id':_0x31f636[_0x0bca('0x52')]['id']}},_0x578bc6={};_0x578bc6[_0x0bca('0x41')]=_['keys'](db[_0x0bca('0x3d')][_0x0bca('0x3e')]);_0x578bc6[_0x0bca('0x42')]=_[_0x0bca('0x53')](_0x31f636['query']);_0x578bc6[_0x0bca('0x43')]=_[_0x0bca('0x45')](_0x578bc6[_0x0bca('0x41')],_0x578bc6['query']);_0x49e6c9[_0x0bca('0x44')]=_[_0x0bca('0x45')](_0x578bc6[_0x0bca('0x41')],qs[_0x0bca('0x46')](_0x31f636[_0x0bca('0x42')][_0x0bca('0x46')]));_0x49e6c9[_0x0bca('0x44')]=_0x49e6c9[_0x0bca('0x44')][_0x0bca('0x54')]?_0x49e6c9[_0x0bca('0x44')]:_0x578bc6[_0x0bca('0x41')];if(_0x31f636[_0x0bca('0x42')][_0x0bca('0x4e')]){_0x49e6c9[_0x0bca('0x4f')]=[{'all':!![]}];}_0x49e6c9=_['merge']({},_0x49e6c9,_0x31f636[_0x0bca('0x55')]);return db[_0x0bca('0x3d')][_0x0bca('0x56')](_0x49e6c9)[_0x0bca('0x20')](handleEntityNotFound(_0x171b6d,null))['then'](respondWithResult(_0x171b6d,null))['catch'](handleError(_0x171b6d,null));};exports['create']=function(_0x5be0d8,_0x2d8582){return db['SmsMessage']['create'](_0x5be0d8[_0x0bca('0x57')],{})['then'](respondWithResult(_0x2d8582,0xc9))[_0x0bca('0x28')](handleError(_0x2d8582,null));};exports[_0x0bca('0x36')]=function(_0x437f0a,_0x78e8dd){if(_0x437f0a[_0x0bca('0x57')]['id']){delete _0x437f0a[_0x0bca('0x57')]['id'];}return db['SmsMessage'][_0x0bca('0x56')]({'where':{'id':_0x437f0a[_0x0bca('0x52')]['id']}})[_0x0bca('0x20')](handleEntityNotFound(_0x78e8dd,null))[_0x0bca('0x20')](saveUpdates(_0x437f0a[_0x0bca('0x57')],null))[_0x0bca('0x20')](respondWithResult(_0x78e8dd,null))[_0x0bca('0x28')](handleError(_0x78e8dd,null));};exports['destroy']=function(_0x420d13,_0x4c9e4b){return db[_0x0bca('0x3d')][_0x0bca('0x56')]({'where':{'id':_0x420d13['params']['id']}})[_0x0bca('0x20')](handleEntityNotFound(_0x4c9e4b,null))['then'](removeEntity(_0x4c9e4b,null))[_0x0bca('0x28')](handleError(_0x4c9e4b,null));};exports['describe']=function(_0x5dc0e7,_0x32c938){return db[_0x0bca('0x3d')][_0x0bca('0x58')]()['then'](respondWithResult(_0x32c938,null))[_0x0bca('0x28')](handleError(_0x32c938,null));};var interaction_log=require('../../config/logger')(_0x0bca('0x59'));exports[_0x0bca('0x5a')]=function(_0x4257c0,_0x41687a,_0xdd115b){var _0x49cb5b={'agent':{},'channel':'sms'};if(_0x4257c0[_0x0bca('0x57')]['id']){delete _0x4257c0['body']['id'];}_0x4257c0['body']['read']=!![];_0x4257c0[_0x0bca('0x57')][_0x0bca('0x5b')]=moment()[_0x0bca('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4257c0[_0x0bca('0x57')][_0x0bca('0x5d')]=_0x4257c0[_0x0bca('0x57')][_0x0bca('0x5d')]||_0x4257c0['user']['id'];_0x49cb5b[_0x0bca('0x5e')]['id']=_0x4257c0[_0x0bca('0x57')][_0x0bca('0x5d')];return db[_0x0bca('0x3d')][_0x0bca('0x56')]({'where':{'id':_0x4257c0[_0x0bca('0x52')]['id'],'UserId':null}})[_0x0bca('0x20')](handleEntityNotFound(_0x41687a,null))['then'](saveUpdates(_0x4257c0['body'],null))[_0x0bca('0x20')](function(_0xa7c2bd){if(_0xa7c2bd){_0x49cb5b['message']=_0xa7c2bd['get']({'plain':!![]});return db[_0x0bca('0x5f')][_0x0bca('0x56')]({'where':{'id':_0xa7c2bd[_0x0bca('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x41687a,null))[_0x0bca('0x20')](function(_0x3ba2a2){if(_0x3ba2a2){return _0x3ba2a2['update']({'UserId':_0x4257c0[_0x0bca('0x57')][_0x0bca('0x5d')],'read1stAt':_[_0x0bca('0x61')](_0x3ba2a2[_0x0bca('0x62')])?moment()[_0x0bca('0x5c')](_0x0bca('0x63')):undefined});}return null;})[_0x0bca('0x20')](function(_0x45b271){if(_0x45b271){_0x49cb5b['interaction']=_0x45b271[_0x0bca('0x64')]({'plain':!![]});interaction_log[_0x0bca('0x21')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4257c0[_0x0bca('0x65')]['id'],_0x4257c0[_0x0bca('0x65')][_0x0bca('0x39')],_0x4257c0['user'][_0x0bca('0x66')],_0x49cb5b[_0x0bca('0x67')]['id'],_0x4257c0['body']?JSON[_0x0bca('0x68')](_0x4257c0['body']):_0x0bca('0x69'));return respondWithRpcPromise(_0x0bca('0x6a'),_0x0bca('0x6b'),_0x49cb5b);}return null;})['then'](function(_0x10beee){var _0x3639e5=_0x0bca('0x6c')+_0x10beee['message'][_0x0bca('0x6d')];return db[_0x0bca('0x6e')][_0x0bca('0x42')](_0x3639e5,{'type':db[_0x0bca('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0x0bca('0x20')](function(_0x29ebf2){return _0x29ebf2;});})[_0x0bca('0x20')](function(_0x2c4317){if(_0x2c4317){_0x49cb5b[_0x0bca('0x27')][_0x0bca('0x70')]=_0x2c4317[0x0];if(!_0x4257c0[_0x0bca('0x57')][_0x0bca('0x5d')])return;return db[_0x0bca('0x71')]['find']({'where':{'id':_0x4257c0[_0x0bca('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0x0bca('0x39'),_0x0bca('0x72'),_0x0bca('0x73'),'internal'],'raw':!![]});}return null;})[_0x0bca('0x20')](function(_0x504233){if(!_0x504233)return null;_0x49cb5b['message']['agent']=_0x504233;return _0x49cb5b;})[_0x0bca('0x20')](function(_0x5bceb6){if(_0x5bceb6){if(_0x4257c0['body'][_0x0bca('0x74')]){_0x49cb5b[_0x0bca('0x27')][_0x0bca('0x75')]=util[_0x0bca('0x5c')](_0x0bca('0x76'),_0x4257c0[_0x0bca('0x65')][_0x0bca('0x39')]);_0x49cb5b[_0x0bca('0x27')]['channel']=_0x49cb5b[_0x0bca('0x77')];_0x49cb5b['message']['motionChannel']=_0x49cb5b[_0x0bca('0x77')];_0x49cb5b[_0x0bca('0x27')][_0x0bca('0x78')]='accept';return respondWithRpcPromise(_0x0bca('0x79'),_0x0bca('0x79'),{'event':_0x0bca('0x7a'),'message':_0x49cb5b[_0x0bca('0x27')]},client9002)[_0x0bca('0x20')](function(){return _0x49cb5b;});}return _0x49cb5b;}return null;})['then'](respondWithResult(_0x41687a,null))[_0x0bca('0x28')](handleError(_0x41687a,null));};var interaction_log=require(_0x0bca('0x10'))(_0x0bca('0x59'));exports[_0x0bca('0x34')]=function(_0x57aaac,_0x224947,_0x5c7235){var _0x57443e={'agent':{},'channel':_0x0bca('0x7b')};if(_0x57aaac['body']['id']){delete _0x57aaac[_0x0bca('0x57')]['id'];}_0x57aaac[_0x0bca('0x57')][_0x0bca('0x5d')]=_0x57aaac['body']['UserId']||_0x57aaac['user']['id'];_0x57443e[_0x0bca('0x5e')]['id']=_0x57aaac[_0x0bca('0x57')][_0x0bca('0x5d')];return db['SmsMessage']['find']({'where':{'id':_0x57aaac[_0x0bca('0x52')]['id'],'UserId':null}})[_0x0bca('0x20')](handleEntityNotFound(_0x224947,null))['then'](function(_0x278c6e){if(_0x278c6e){_0x57443e['message']=_0x278c6e[_0x0bca('0x64')]({'plain':!![]});return db[_0x0bca('0x5f')][_0x0bca('0x56')]({'where':{'id':_0x278c6e[_0x0bca('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x224947,null))['then'](function(_0xcf2296){if(_0xcf2296){_0x57443e[_0x0bca('0x67')]=_0xcf2296[_0x0bca('0x64')]({'plain':!![]});interaction_log['info'](_0x0bca('0x7c'),_0x57aaac[_0x0bca('0x65')]['id'],_0x57aaac['user']['name'],_0x57aaac['user'][_0x0bca('0x66')],_0x57443e['interaction']['id'],_0x57aaac[_0x0bca('0x57')]?JSON[_0x0bca('0x68')](_0x57aaac[_0x0bca('0x57')]):_0x0bca('0x69'));return respondWithRpcPromise(_0x0bca('0x7d'),_0x0bca('0x7e'),_0x57443e);}return null;})['then'](function(_0x22c646){var _0x47a3ea=_0x0bca('0x6c')+_0x22c646['message']['ContactId'];return db[_0x0bca('0x6e')][_0x0bca('0x42')](_0x47a3ea,{'type':db[_0x0bca('0x6f')]['QueryTypes'][_0x0bca('0x7f')],'raw':!![]})['then'](function(_0xcc4555){return _0xcc4555;});})[_0x0bca('0x20')](function(_0x32add2){if(_0x32add2){_0x57443e[_0x0bca('0x27')][_0x0bca('0x70')]=_0x32add2[0x0];if(!_0x57aaac[_0x0bca('0x57')][_0x0bca('0x5d')])return;return db[_0x0bca('0x71')][_0x0bca('0x56')]({'where':{'id':_0x57aaac[_0x0bca('0x57')][_0x0bca('0x5d')],'role':'agent'},'attributes':['id',_0x0bca('0x39'),_0x0bca('0x72'),_0x0bca('0x73'),_0x0bca('0x80')],'raw':!![]});}return null;})[_0x0bca('0x20')](function(_0x29fe14){if(!_0x29fe14)return null;_0x57443e[_0x0bca('0x27')][_0x0bca('0x5e')]=_0x29fe14;return _0x57443e;})[_0x0bca('0x20')](function(_0x564e19){if(_0x564e19){_0x564e19[_0x0bca('0x27')]['interface']=util[_0x0bca('0x5c')](_0x0bca('0x76'),_0x57aaac[_0x0bca('0x65')][_0x0bca('0x39')]);_0x564e19[_0x0bca('0x27')][_0x0bca('0x77')]=_0x57443e['channel'];_0x564e19[_0x0bca('0x27')][_0x0bca('0x81')]=_0x57443e[_0x0bca('0x77')];_0x564e19[_0x0bca('0x27')][_0x0bca('0x78')]='reject';respondWithRpcPromise(_0x0bca('0x79'),_0x0bca('0x79'),{'event':_0x0bca('0x82'),'message':_0x564e19['message']},client9002);return _0x57443e;}return null;})['then'](respondWithResult(_0x224947,null))[_0x0bca('0x28')](handleError(_0x224947,null));};exports[_0x0bca('0x2a')]=function(_0x355a25,_0x37078c,_0x4a8012){if(_0x355a25[_0x0bca('0x57')]['id']){delete _0x355a25[_0x0bca('0x57')]['id'];}var _0x2066ab;return db[_0x0bca('0x3d')][_0x0bca('0x56')]({'where':{'id':_0x355a25[_0x0bca('0x52')]['id']}})[_0x0bca('0x20')](handleEntityNotFound(_0x37078c,null))[_0x0bca('0x20')](function(_0x4bc75b){if(_0x4bc75b){_0x2066ab=_0x4bc75b;return db[_0x0bca('0x83')]['find']({'where':{'id':_0x4bc75b[_0x0bca('0x84')]}});}})[_0x0bca('0x20')](handleEntityNotFound(_0x37078c,null))[_0x0bca('0x20')](function(_0x31a9f3){if(_0x31a9f3){logger[_0x0bca('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s','status',_0x0bca('0x85'),_0x31a9f3[_0x0bca('0x40')],util[_0x0bca('0x86')](_0x355a25['body'],{'showHidden':![],'depth':null}));switch(_0x31a9f3[_0x0bca('0x40')]){case'twilio':if(_0x355a25[_0x0bca('0x57')][_0x0bca('0x87')]&&_0x355a25[_0x0bca('0x57')][_0x0bca('0x87')]===_0x2066ab[_0x0bca('0x88')]){return _0x2066ab[_0x0bca('0x36')]({'read':!![]});}else{logger[_0x0bca('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','twilio',util[_0x0bca('0x86')](_0x355a25[_0x0bca('0x57')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x355a25[_0x0bca('0x57')][_0x0bca('0x89')]&&_0x355a25[_0x0bca('0x57')][_0x0bca('0x89')]===_0x2066ab[_0x0bca('0x88')]&&_[_0x0bca('0x8a')](['sent','delivered'],_0x355a25[_0x0bca('0x57')][_0x0bca('0x8b')])>=0x0){return _0x2066ab[_0x0bca('0x36')]({'read':!![]});}else{logger[_0x0bca('0x25')](_0x0bca('0x8c'),_0x0bca('0x2a'),'plivio',util[_0x0bca('0x86')](_0x355a25[_0x0bca('0x57')],{'showHidden':![],'depth':null}));}break;case _0x0bca('0x8d'):var _0x4c7213=_0x355a25['body'][_0x0bca('0x8e')][0x0];if(_0x4c7213[_0x0bca('0x2a')]['groupName']===_0x0bca('0x8f')){return _0x2066ab[_0x0bca('0x36')]({'read':!![]});}else{logger[_0x0bca('0x25')](_0x0bca('0x8c'),_0x0bca('0x2a'),_0x0bca('0x8d'),util[_0x0bca('0x86')](_0x355a25[_0x0bca('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x2066ab;}})[_0x0bca('0x20')](respondWithResult(_0x37078c,null))[_0x0bca('0x28')](handleError(_0x37078c,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 4b1a713..5c90677 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 _0x5146=['save','update','emit','hasOwnProperty','events','../../mysqldb','SmsMessage'];(function(_0x5e515c,_0x3319a7){var _0x4f3109=function(_0xc823f5){while(--_0xc823f5){_0x5e515c['push'](_0x5e515c['shift']());}};_0x4f3109(++_0x3319a7);}(_0x5146,0x131));var _0x6514=function(_0x2989f1,_0x2b32df){_0x2989f1=_0x2989f1-0x0;var _0x1934c5=_0x5146[_0x2989f1];return _0x1934c5;};'use strict';var EventEmitter=require(_0x6514('0x0'));var SmsMessage=require(_0x6514('0x1'))['db'][_0x6514('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6514('0x3'),'afterUpdate':_0x6514('0x4'),'afterDestroy':'remove'};function emitEvent(_0x34e846){return function(_0x409e1a,_0x467d0d,_0x2bad24){SmsMessageEvents[_0x6514('0x5')](_0x34e846+':'+_0x409e1a['id'],_0x409e1a);SmsMessageEvents['emit'](_0x34e846,_0x409e1a);_0x2bad24(null);};}for(var e in events){if(events[_0x6514('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xaebe=['setMaxListeners','update','emit','hasOwnProperty','hook','../../mysqldb','SmsMessage'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xaebe,0x1d3));var _0xeaeb=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xaebe[_0x4b73a2];return _0x383c66;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xeaeb('0x0'))['db'][_0xeaeb('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xeaeb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeaeb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x347879){return function(_0x235ea6,_0x329c88,_0x2a7bd6){SmsMessageEvents[_0xeaeb('0x4')](_0x347879+':'+_0x235ea6['id'],_0x235ea6);SmsMessageEvents[_0xeaeb('0x4')](_0x347879,_0x235ea6);_0x2a7bd6(null);};}for(var e in events){if(events[_0xeaeb('0x5')](e)){var event=events[e];SmsMessage[_0xeaeb('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index fb26734..67253e4 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 _0xd5d0=['Basic\x20%s','toString','base64','http_code','data','head','message_id','clickSend','authId','token','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','messages','Missing\x20parameters:\x20base_url','csc','crypto','sort','apiKey','createHash','digest','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','api','moment','request-promise','path','rimraf','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','SmsInteraction','findOne','update','createdAt','catch','error','secret','find','SmsAccountId','then','type','twilio','authToken','create','phone','remote','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','body','smsMethod','login?username=','username','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format'];(function(_0x187279,_0x26d152){var _0x3da59d=function(_0x41c808){while(--_0x41c808){_0x187279['push'](_0x187279['shift']());}};_0x3da59d(++_0x26d152);}(_0xd5d0,0xad));var _0x0d5d=function(_0x1c3a86,_0x5c1f99){_0x1c3a86=_0x1c3a86-0x0;var _0xa2e06=_0xd5d0[_0x1c3a86];return _0xa2e06;};'use strict';var _=require('lodash');var util=require(_0x0d5d('0x0'));var logger=require('../../config/logger')(_0x0d5d('0x1'));var moment=require(_0x0d5d('0x2'));var BPromise=require('bluebird');var rp=require(_0x0d5d('0x3'));var fs=require('fs');var path=require(_0x0d5d('0x4'));var rimraf=require(_0x0d5d('0x5'));var config=require('../../config/environment');var attributes=require(_0x0d5d('0x6'));module['exports']=function(_0x2790ed,_0x485e04){return _0x2790ed[_0x0d5d('0x7')](_0x0d5d('0x8'),attributes,{'tableName':_0x0d5d('0x9'),'paranoid':![],'indexes':[{'name':_0x0d5d('0xa'),'fields':[_0x0d5d('0xa')]},{'name':_0x0d5d('0xb'),'fields':['body'],'type':_0x0d5d('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5aed04,_0x29915e,_0x227428){var _0x17adc8=_0x2790ed[_0x0d5d('0xd')];var _0x266fd9=_0x5aed04[_0x0d5d('0xe')]({'plain':!![]});if(_0x266fd9[_0x0d5d('0xf')]['toLowerCase']()==='in'||_0x266fd9[_0x0d5d('0xf')][_0x0d5d('0x10')]()===_0x0d5d('0x11')&&!_0x266fd9['secret']&&!_[_0x0d5d('0x12')](_0x266fd9[_0x0d5d('0x13')])&&!_[_0x0d5d('0x12')](_0x266fd9['SmsInteractionId'])){_0x17adc8[_0x0d5d('0x14')][_0x0d5d('0x15')]({'where':{'id':_0x266fd9['SmsInteractionId']}})['then'](function(_0x2fc866){if(_0x2fc866){_0x2fc866[_0x0d5d('0x16')]({'lastMsgAt':_0x266fd9[_0x0d5d('0x17')],'lastMsgDirection':_0x266fd9[_0x0d5d('0xf')][_0x0d5d('0x10')]()});}})[_0x0d5d('0x18')](function(_0x42cc84){console[_0x0d5d('0x19')](_0x42cc84);});}if(_0x266fd9['direction']===_0x0d5d('0x11')&&!_0x266fd9[_0x0d5d('0x1a')]){var _0x2ecebb;_0x17adc8['SmsAccount'][_0x0d5d('0x1b')]({'where':{'id':_0x266fd9[_0x0d5d('0x1c')]},'raw':!![]})[_0x0d5d('0x1d')](function(_0x4f3aa4){_0x2ecebb=_0x4f3aa4;if(_0x2ecebb&&_0x2ecebb['type']){switch(_0x2ecebb[_0x0d5d('0x1e')]){case _0x0d5d('0x1f'):var _0x3efb73=require(_0x0d5d('0x1f'));if(_0x2ecebb['accountSid']&&_0x2ecebb[_0x0d5d('0x20')]&&_0x2ecebb['phone']){var _0xf388c8=new _0x3efb73(_0x2ecebb['accountSid'],_0x2ecebb[_0x0d5d('0x20')]);_0xf388c8['messages'][_0x0d5d('0x21')]({'body':_0x266fd9['body'],'to':_0x266fd9['phone'],'from':_0x2ecebb[_0x0d5d('0x22')],'statusCallback':_0x2ecebb[_0x0d5d('0x23')]+_0x0d5d('0x24')+_0x266fd9['id']+_0x0d5d('0x25')+_0x2ecebb['token']})['then'](function(_0x27334d){if(_0x27334d[_0x0d5d('0x26')]){return _0x5aed04[_0x0d5d('0x16')]({'messageId':_0x27334d[_0x0d5d('0x26')]});}})['catch'](function(_0x3409fe){logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),'twilio',util[_0x0d5d('0x29')](_0x3409fe,{'showHidden':![],'depth':null}));});}else{logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),_0x0d5d('0x1f'),_0x0d5d('0x2a'));}break;case _0x0d5d('0x2b'):var _0x457275=_0x0d5d('0x2c');if(_0x2ecebb['username']&&_0x2ecebb[_0x0d5d('0x2d')]){var _0x4d3003={'recipient':[_0x266fd9[_0x0d5d('0x22')]],'message':_0x266fd9[_0x0d5d('0x2e')],'message_type':_0x2ecebb[_0x0d5d('0x2f')]};if(_0x2ecebb['smsMethod']&&_0x2ecebb['smsMethod']!=='SI'){_0x4d3003['sender']=_0x2ecebb[_0x0d5d('0x22')];}var _0x126584={'url':_0x457275+_0x0d5d('0x30')+_0x2ecebb[_0x0d5d('0x31')]+_0x0d5d('0x32')+_0x2ecebb['password'],'method':_0x0d5d('0x33')};rp(_0x126584)[_0x0d5d('0x1d')](function(_0x340357){var _0x4ed207=_0x340357[_0x0d5d('0x34')](';');var _0x3090ef={'user_key':_0x4ed207[0x0],'session_key':_0x4ed207[0x1]};_0x126584={'url':_0x457275+_0x0d5d('0x35'),'method':_0x0d5d('0x36'),'headers':{'user_key':_0x3090ef[_0x0d5d('0x37')],'Session_key':_0x3090ef[_0x0d5d('0x38')]},'json':!![],'body':_0x4d3003};return rp(_0x126584);})[_0x0d5d('0x1d')](function(_0x549876){if(_0x549876[_0x0d5d('0x39')]>=0x1){var _0x29faf0={'messageId':_0x549876[_0x0d5d('0x3a')]};if(_0x2ecebb[_0x0d5d('0x2f')]!=='GP'||!_0x2ecebb[_0x0d5d('0x3b')]){_0x29faf0['read']=!![];}return _0x5aed04[_0x0d5d('0x16')](_0x29faf0);}else{return logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),'skebby',util[_0x0d5d('0x29')](_0x549876,{'showHidden':![],'depth':null}));}})[_0x0d5d('0x18')](function(_0x43567c){return logger[_0x0d5d('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0d5d('0x28'),_0x0d5d('0x2b'),util['inspect'](_0x43567c,{'showHidden':![],'depth':null}));});}else{logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),_0x0d5d('0x2b'),_0x0d5d('0x3c'));}break;case'connectel':if(_0x2ecebb[_0x0d5d('0x20')]){var _0x53a9ab={'recipient':_0x266fd9[_0x0d5d('0x22')],'message':_0x266fd9[_0x0d5d('0x2e')],'sender':_0x2ecebb[_0x0d5d('0x3d')]||_0x2ecebb[_0x0d5d('0x22')],'authorization':_0x2ecebb['authToken']};var _0x29915e={'method':_0x0d5d('0x36'),'uri':_0x0d5d('0x3e'),'body':_0x53a9ab,'json':!![]};rp(_0x29915e)['then'](function(_0x3beabc){var _0xdc3f3f={'messageId':_0x3beabc[_0x0d5d('0x3f')]};if(!_0x2ecebb[_0x0d5d('0x3b')]){_0xdc3f3f[_0x0d5d('0x40')]=!![];}return _0x5aed04[_0x0d5d('0x16')](_0xdc3f3f);})[_0x0d5d('0x18')](function(_0x597259){logger[_0x0d5d('0x19')](_0x0d5d('0x27'),'afterCreate','connectel',util[_0x0d5d('0x29')](_0x597259,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0d5d('0x27'),_0x0d5d('0x28'),'connectel',_0x0d5d('0x41'));}break;case _0x0d5d('0x42'):if(_0x2ecebb[_0x0d5d('0x31')]&&_0x2ecebb[_0x0d5d('0x2d')]){var _0x53a9ab={'messages':[{'source':_0x0d5d('0x43'),'to':_0x266fd9[_0x0d5d('0x22')],'body':_0x266fd9['body'],'from':_0x2ecebb[_0x0d5d('0x3d')]||_0x2ecebb['phone']}]};var _0x639c98=util['format'](_0x0d5d('0x44'),_0x2ecebb[_0x0d5d('0x31')],_0x2ecebb[_0x0d5d('0x2d')]);var _0x29915e={'method':'POST','uri':_0x0d5d('0x45'),'body':_0x53a9ab,'headers':{'Authorization':util[_0x0d5d('0x46')](_0x0d5d('0x47'),new Buffer(_0x639c98)[_0x0d5d('0x48')](_0x0d5d('0x49')))},'json':!![]};rp(_0x29915e)['then'](function(_0x28ad0){if(_0x28ad0['http_code']>=0xc8&&_0x28ad0[_0x0d5d('0x4a')]<=0xce){if(_0x28ad0[_0x0d5d('0x4b')]&&_0x28ad0[_0x0d5d('0x4b')]['queued_count']>0x0){var _0x3be767=_[_0x0d5d('0x4c')](_0x28ad0[_0x0d5d('0x4b')]['messages']);var _0x4adda6={'messageId':_0x3be767[_0x0d5d('0x4d')]};if(!_0x2ecebb[_0x0d5d('0x3b')]){_0x4adda6[_0x0d5d('0x40')]=!![];}return _0x5aed04['update'](_0x4adda6);}else{logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),'clickSend',util[_0x0d5d('0x29')](_0x28ad0,{'showHidden':![],'depth':null}));}}else{logger[_0x0d5d('0x19')](_0x0d5d('0x27'),'afterCreate',_0x0d5d('0x4e'),util[_0x0d5d('0x29')](_0x28ad0,{'showHidden':![],'depth':null}));}})[_0x0d5d('0x18')](function(_0x3b7699){logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),_0x0d5d('0x4e'),util['inspect'](_0x3b7699,{'showHidden':![],'depth':null}));});}else{logger[_0x0d5d('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0d5d('0x28'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x2ecebb[_0x0d5d('0x4f')]&&_0x2ecebb[_0x0d5d('0x20')]){var _0x53a9ab={'dst':_0x266fd9['phone'],'text':_0x266fd9[_0x0d5d('0x2e')],'src':_0x2ecebb['senderString']||_0x2ecebb[_0x0d5d('0x22')],'url':_0x2ecebb[_0x0d5d('0x23')]+_0x0d5d('0x24')+_0x266fd9['id']+_0x0d5d('0x25')+_0x2ecebb[_0x0d5d('0x50')]};var _0x639c98=util['format'](_0x0d5d('0x44'),_0x2ecebb['authId'],_0x2ecebb[_0x0d5d('0x20')]);var _0x29915e={'method':_0x0d5d('0x36'),'uri':util[_0x0d5d('0x46')](_0x0d5d('0x51'),_0x2ecebb[_0x0d5d('0x4f')]),'body':_0x53a9ab,'headers':{'Authorization':util[_0x0d5d('0x46')](_0x0d5d('0x47'),new Buffer(_0x639c98)['toString'](_0x0d5d('0x49')))},'json':!![]};rp(_0x29915e)[_0x0d5d('0x1d')](function(_0x3b06a8){var _0x4c83ed={'messageId':_0x3b06a8[_0x0d5d('0x52')][0x0]};return _0x5aed04[_0x0d5d('0x16')](_0x4c83ed);})['catch'](function(_0x453e18){logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),'plivo',util['inspect'](_0x453e18,{'showHidden':![],'depth':null}));});}else{logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),_0x0d5d('0x53'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x0d5d('0x54'):if(_0x2ecebb[_0x0d5d('0x31')]&&_0x2ecebb[_0x0d5d('0x2d')]){if(_0x2ecebb[_0x0d5d('0x55')]){var _0x2da4e2={'method':_0x0d5d('0x36'),'uri':_0x2ecebb['baseUrl']+'/auth/1/session','body':{'username':_0x2ecebb[_0x0d5d('0x31')],'password':_0x2ecebb[_0x0d5d('0x2d')]},'json':!![]};return rp(_0x2da4e2)['then'](function(_0x2ac1d2){var _0x55c2c1={'method':_0x0d5d('0x36'),'uri':_0x2ecebb[_0x0d5d('0x55')]+_0x0d5d('0x56'),'body':{'messages':[{'from':_0x2ecebb[_0x0d5d('0x22')],'destinations':[{'to':_0x266fd9['phone']}],'text':_0x266fd9[_0x0d5d('0x2e')],'notifyUrl':_0x2ecebb[_0x0d5d('0x23')]+_0x0d5d('0x24')+_0x266fd9['id']+_0x0d5d('0x25')+_0x2ecebb[_0x0d5d('0x50')],'notifyContentType':_0x0d5d('0x57'),'callbackData':_0x2ecebb['phone']+';'+_0x266fd9['body']}]},'headers':{'Authorization':_0x0d5d('0x58')+_0x2ac1d2['token']},'json':!![]};return rp(_0x55c2c1)[_0x0d5d('0x1d')](function(_0x21b0a1){if(_0x21b0a1[_0x0d5d('0x59')]){var _0x331ebb={'messageId':_0x21b0a1[_0x0d5d('0x59')][0x0]['messageId']};if(!_0x2ecebb['deliveryReport']){_0x331ebb[_0x0d5d('0x40')]=!![];}return _0x5aed04[_0x0d5d('0x16')](_0x331ebb);}else{return logger[_0x0d5d('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0d5d('0x28'),_0x0d5d('0x54'),util[_0x0d5d('0x29')](_0x21b0a1,{'showHidden':![],'depth':null}));}});})[_0x0d5d('0x18')](function(_0x4c2b04){return logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),'infobip',util[_0x0d5d('0x29')](_0x4c2b04,{'showHidden':![],'depth':null}));});}else{logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),'infobip',_0x0d5d('0x5a'));}}else{logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),_0x0d5d('0x54'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x0d5d('0x5b'):var _0x5c4bd3=require(_0x0d5d('0x5c'));if(_0x2ecebb['apiKey']){var _0x5a99b8={};_0x5a99b8['login']=_0x2ecebb[_0x0d5d('0x31')];_0x5a99b8[_0x0d5d('0x22')]=_0x266fd9[_0x0d5d('0x22')];_0x5a99b8['sender']=_0x2ecebb[_0x0d5d('0x22')];_0x5a99b8['text']=_0x266fd9[_0x0d5d('0x2e')];_0x5a99b8['timestamp']=+new Date();var _0x200555='';var _0x5422fb='';var _0x4c6c67=Object['keys'](_0x5a99b8);_0x4c6c67[_0x0d5d('0x5d')]();for(var _0x2ab84e=0x0;_0x2ab84e<_0x4c6c67['length'];_0x2ab84e++){if(_0x200555!=''){_0x200555+='&';}_0x200555+=_0x4c6c67[_0x2ab84e]+'='+encodeURIComponent(_0x5a99b8[_0x4c6c67[_0x2ab84e]]);_0x5422fb+=_0x5a99b8[_0x4c6c67[_0x2ab84e]];}_0x5422fb+=_0x2ecebb[_0x0d5d('0x5e')];_0x5422fb=_0x5c4bd3[_0x0d5d('0x5f')]('md5')['update'](_0x5422fb)[_0x0d5d('0x60')]('hex');if(_0x200555!==''){_0x200555+='&';}_0x200555+=_0x0d5d('0x61')+_0x5422fb;var _0x126584={'method':_0x0d5d('0x33'),'uri':_0x2ecebb[_0x0d5d('0x55')]+_0x0d5d('0x62')+_0x200555,'json':!![]};return rp(_0x126584)[_0x0d5d('0x1d')](function(_0x1574da){var _0x132d9d=Object[_0x0d5d('0x63')](_0x1574da);if(_0x1574da[_0x132d9d[0x0]][_0x0d5d('0x19')]&&parseInt(_0x1574da[_0x132d9d[0x0]][_0x0d5d('0x19')])===0x0){var _0x1c62cf={'messageId':_0x1574da[_0x132d9d[0x0]][_0x0d5d('0x64')]};if(!_0x2ecebb[_0x0d5d('0x3b')]){_0x1c62cf[_0x0d5d('0x40')]=!![];}return _0x5aed04[_0x0d5d('0x16')](_0x1c62cf);}else{return logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),_0x0d5d('0x5b'),util[_0x0d5d('0x29')](_0x1574da[_0x0d5d('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3a91c9){return logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),'csc',util[_0x0d5d('0x29')](_0x3a91c9,{'showHidden':![],'depth':null}));});}else{logger[_0x0d5d('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0d5d('0x28'),'csc',_0x0d5d('0x65'));}break;case _0x0d5d('0x66'):if(_0x2ecebb['apiKey']){var _0x52fc2e={'method':_0x0d5d('0x36'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x2ecebb['apiKey']},'body':{'content':_0x266fd9['body'],'to':[_0x266fd9[_0x0d5d('0x22')]],'from':_0x2ecebb[_0x0d5d('0x22')],'binary':![],'clientMessageId':_0x0d5d('0x67'),'charset':_0x0d5d('0x68')},'json':!![]};rp(_0x52fc2e)[_0x0d5d('0x1d')](function(_0x331de7){if(!_0x331de7[_0x0d5d('0x19')]){var _0x4f28cf={'messageId':_0x331de7['messages'][0x0]['apiMessageId']};if(!_0x2ecebb[_0x0d5d('0x3b')]){_0x4f28cf[_0x0d5d('0x40')]=!![];}return _0x5aed04[_0x0d5d('0x16')](_0x4f28cf);}else{return logger['error'](_0x0d5d('0x27'),_0x0d5d('0x28'),'clickatell',util[_0x0d5d('0x29')](_0x331de7[_0x0d5d('0x19')],{'showHidden':![],'depth':null}));}})[_0x0d5d('0x18')](function(_0x2352b5){return logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),_0x0d5d('0x66'),util[_0x0d5d('0x29')](_0x2352b5,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0d5d('0x28'),_0x0d5d('0x66'),'Missing\x20parameters:\x20apiKey');}break;case _0x0d5d('0x69'):if(_0x2ecebb[_0x0d5d('0x31')]&&_0x2ecebb[_0x0d5d('0x2d')]){var _0x639c98=util['format']('%s:%s',_0x2ecebb['username'],_0x2ecebb[_0x0d5d('0x2d')]);var _0x29915e={'method':'POST','uri':_0x0d5d('0x6a')+_0x2ecebb[_0x0d5d('0x6b')]+_0x0d5d('0x6c'),'body':{'to':[_0x266fd9['phone']],'text':_0x266fd9[_0x0d5d('0x2e')],'from':_0x2ecebb[_0x0d5d('0x22')],'applicationId':_0x2ecebb[_0x0d5d('0x6d')]},'headers':{'Authorization':util[_0x0d5d('0x46')]('Basic\x20%s',new Buffer(_0x639c98)['toString'](_0x0d5d('0x49')))},'json':!![]};rp(_0x29915e)[_0x0d5d('0x1d')](function(_0x1a3e8e){if(_0x1a3e8e['id']){var _0x49000f={'messageId':_0x1a3e8e['id']};return _0x5aed04[_0x0d5d('0x16')](_0x49000f);}else{logger[_0x0d5d('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0d5d('0x69'),util[_0x0d5d('0x29')](_0x1a3e8e,{'showHidden':![],'depth':null}));}})[_0x0d5d('0x18')](function(_0x3c03ab){logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),_0x0d5d('0x69'),util['inspect'](_0x3c03ab,{'showHidden':![],'depth':null}));});}else{logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),_0x0d5d('0x69'),_0x0d5d('0x3c'));}break;case _0x0d5d('0x6e'):if(_0x2ecebb[_0x0d5d('0x5e')]){var _0x16da07={};var _0x126584={'method':_0x0d5d('0x36'),'uri':_0x0d5d('0x6f'),'headers':{'Authorization':_0x0d5d('0x70')+_0x2ecebb[_0x0d5d('0x5e')],'Content-Type':'application/json'},'body':{'from':_0x2ecebb[_0x0d5d('0x22')],'to':_0x266fd9['phone'],'text':_0x266fd9[_0x0d5d('0x2e')]},'json':!![]};return rp(_0x126584)[_0x0d5d('0x1d')](function(_0xa5a861){if(_0xa5a861[_0x0d5d('0x71')]==0xca){_0x16da07[_0x0d5d('0x72')]=_0xa5a861;var _0x314fcd={'method':_0x0d5d('0x36'),'uri':_0x0d5d('0x73'),'headers':{'Authorization':_0x0d5d('0x70')+_0x2ecebb[_0x0d5d('0x5e')],'Content-Type':_0x0d5d('0x57')},'body':{'refid':_0x16da07[_0x0d5d('0x72')][_0x0d5d('0x74')]},'json':!![]};return rp(_0x314fcd)[_0x0d5d('0x1d')](function(_0x55aedb){_0x16da07[_0x0d5d('0x75')]=_0x55aedb;var _0x516654={'messageId':_0x16da07[_0x0d5d('0x72')]['refid'],'read':!![]};return _0x5aed04[_0x0d5d('0x16')](_0x516654);});}else{return logger['error'](_0x0d5d('0x27'),_0x0d5d('0x28'),'intelepeer',util[_0x0d5d('0x29')](_0xa5a861,{'showHidden':![],'depth':null}));}})[_0x0d5d('0x18')](function(_0x1fe73d){return logger[_0x0d5d('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0d5d('0x28'),'intelepeer',util[_0x0d5d('0x29')](_0x1fe73d,{'showHidden':![],'depth':null}));});}else{return logger[_0x0d5d('0x19')](_0x0d5d('0x27'),_0x0d5d('0x28'),_0x0d5d('0x6e'),_0x0d5d('0x76'));}break;}}})[_0x0d5d('0x77')](function(){_0x227428();});}else{_0x227428();}}},'charset':_0x0d5d('0x78'),'collate':_0x0d5d('0x79')});}; \ No newline at end of file +var _0xdc8d=['error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','then','sid','update','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','smsMethod','sender','login?username=','&password=','password','GET','POST','user_key','session_key','internal_order_id','deliveryReport','read','catch','Missing\x20parameters:\x20username,\x20password','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','username','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','senderString','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','application/json','Missing\x20parameters:\x20base_url','apiKey','login','text','keys','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','refid','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','../../config/logger','moment','path','rimraf','./smsMessage.attributes','exports','SmsMessage','messageId','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','SmsInteractionId','findOne','createdAt'];(function(_0x1a3690,_0x4eaf05){var _0x54cd0f=function(_0x28467a){while(--_0x28467a){_0x1a3690['push'](_0x1a3690['shift']());}};_0x54cd0f(++_0x4eaf05);}(_0xdc8d,0x14b));var _0xddc8=function(_0x2716e0,_0x228734){_0x2716e0=_0x2716e0-0x0;var _0x3bc369=_0xdc8d[_0x2716e0];return _0x3bc369;};'use strict';var _=require(_0xddc8('0x0'));var util=require('util');var logger=require(_0xddc8('0x1'))('api');var moment=require(_0xddc8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xddc8('0x3'));var rimraf=require(_0xddc8('0x4'));var config=require('../../config/environment');var attributes=require(_0xddc8('0x5'));module[_0xddc8('0x6')]=function(_0x16c06a,_0x12cecc){return _0x16c06a['define'](_0xddc8('0x7'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xddc8('0x8')]},{'name':'fti_sms_messages','fields':[_0xddc8('0x9')],'type':_0xddc8('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e6be3,_0x14a829,_0x35555a){var _0x3899ca=_0x16c06a['models'];var _0x285707=_0x3e6be3[_0xddc8('0xb')]({'plain':!![]});if(_0x285707[_0xddc8('0xc')][_0xddc8('0xd')]()==='in'||_0x285707[_0xddc8('0xc')][_0xddc8('0xd')]()===_0xddc8('0xe')&&!_0x285707[_0xddc8('0xf')]&&!_['isNil'](_0x285707[_0xddc8('0x10')])&&!_['isNil'](_0x285707[_0xddc8('0x11')])){_0x3899ca['SmsInteraction'][_0xddc8('0x12')]({'where':{'id':_0x285707[_0xddc8('0x11')]}})['then'](function(_0x619068){if(_0x619068){_0x619068['update']({'lastMsgAt':_0x285707[_0xddc8('0x13')],'lastMsgDirection':_0x285707[_0xddc8('0xc')][_0xddc8('0xd')]()});}})['catch'](function(_0x28e525){console[_0xddc8('0x14')](_0x28e525);});}if(_0x285707[_0xddc8('0xc')]===_0xddc8('0xe')&&!_0x285707[_0xddc8('0xf')]){var _0x3d3acb;_0x3899ca[_0xddc8('0x15')][_0xddc8('0x16')]({'where':{'id':_0x285707[_0xddc8('0x17')]},'raw':!![]})['then'](function(_0x17584e){_0x3d3acb=_0x17584e;if(_0x3d3acb&&_0x3d3acb[_0xddc8('0x18')]){switch(_0x3d3acb[_0xddc8('0x18')]){case _0xddc8('0x19'):var _0x82f2f6=require(_0xddc8('0x19'));if(_0x3d3acb[_0xddc8('0x1a')]&&_0x3d3acb[_0xddc8('0x1b')]&&_0x3d3acb[_0xddc8('0x1c')]){var _0x343f03=new _0x82f2f6(_0x3d3acb[_0xddc8('0x1a')],_0x3d3acb['authToken']);_0x343f03[_0xddc8('0x1d')][_0xddc8('0x1e')]({'body':_0x285707['body'],'to':_0x285707['phone'],'from':_0x3d3acb[_0xddc8('0x1c')],'statusCallback':_0x3d3acb[_0xddc8('0x1f')]+_0xddc8('0x20')+_0x285707['id']+_0xddc8('0x21')+_0x3d3acb[_0xddc8('0x22')]})[_0xddc8('0x23')](function(_0x371705){if(_0x371705[_0xddc8('0x24')]){return _0x3e6be3[_0xddc8('0x25')]({'messageId':_0x371705[_0xddc8('0x24')]});}})['catch'](function(_0x32ca7d){logger[_0xddc8('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xddc8('0x26'),_0xddc8('0x19'),util[_0xddc8('0x27')](_0x32ca7d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xddc8('0x28'),_0xddc8('0x26'),'twilio',_0xddc8('0x29'));}break;case _0xddc8('0x2a'):var _0x57133a=_0xddc8('0x2b');if(_0x3d3acb['username']&&_0x3d3acb['password']){var _0x44f50d={'recipient':[_0x285707[_0xddc8('0x1c')]],'message':_0x285707[_0xddc8('0x9')],'message_type':_0x3d3acb[_0xddc8('0x2c')]};if(_0x3d3acb[_0xddc8('0x2c')]&&_0x3d3acb['smsMethod']!=='SI'){_0x44f50d[_0xddc8('0x2d')]=_0x3d3acb[_0xddc8('0x1c')];}var _0x2acbb0={'url':_0x57133a+_0xddc8('0x2e')+_0x3d3acb['username']+_0xddc8('0x2f')+_0x3d3acb[_0xddc8('0x30')],'method':_0xddc8('0x31')};rp(_0x2acbb0)[_0xddc8('0x23')](function(_0x31ee01){var _0x56a49d=_0x31ee01['split'](';');var _0x49b712={'user_key':_0x56a49d[0x0],'session_key':_0x56a49d[0x1]};_0x2acbb0={'url':_0x57133a+'sms','method':_0xddc8('0x32'),'headers':{'user_key':_0x49b712[_0xddc8('0x33')],'Session_key':_0x49b712[_0xddc8('0x34')]},'json':!![],'body':_0x44f50d};return rp(_0x2acbb0);})[_0xddc8('0x23')](function(_0x4f1f86){if(_0x4f1f86['total_sent']>=0x1){var _0x5dd7ab={'messageId':_0x4f1f86[_0xddc8('0x35')]};if(_0x3d3acb[_0xddc8('0x2c')]!=='GP'||!_0x3d3acb[_0xddc8('0x36')]){_0x5dd7ab[_0xddc8('0x37')]=!![];}return _0x3e6be3[_0xddc8('0x25')](_0x5dd7ab);}else{return logger[_0xddc8('0x14')](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x2a'),util[_0xddc8('0x27')](_0x4f1f86,{'showHidden':![],'depth':null}));}})[_0xddc8('0x38')](function(_0x131156){return logger['error'](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x2a'),util[_0xddc8('0x27')](_0x131156,{'showHidden':![],'depth':null}));});}else{logger[_0xddc8('0x14')](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x2a'),_0xddc8('0x39'));}break;case'connectel':if(_0x3d3acb['authToken']){var _0x5a1b91={'recipient':_0x285707[_0xddc8('0x1c')],'message':_0x285707[_0xddc8('0x9')],'sender':_0x3d3acb['senderString']||_0x3d3acb['phone'],'authorization':_0x3d3acb['authToken']};var _0x14a829={'method':_0xddc8('0x32'),'uri':_0xddc8('0x3a'),'body':_0x5a1b91,'json':!![]};rp(_0x14a829)[_0xddc8('0x23')](function(_0x995745){var _0x3af61a={'messageId':_0x995745[_0xddc8('0x3b')]};if(!_0x3d3acb[_0xddc8('0x36')]){_0x3af61a['read']=!![];}return _0x3e6be3[_0xddc8('0x25')](_0x3af61a);})[_0xddc8('0x38')](function(_0x272a00){logger[_0xddc8('0x14')](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x3c'),util[_0xddc8('0x27')](_0x272a00,{'showHidden':![],'depth':null}));});}else{logger[_0xddc8('0x14')](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x3c'),_0xddc8('0x3d'));}break;case _0xddc8('0x3e'):if(_0x3d3acb[_0xddc8('0x3f')]&&_0x3d3acb['password']){var _0x5a1b91={'messages':[{'source':_0xddc8('0x40'),'to':_0x285707[_0xddc8('0x1c')],'body':_0x285707[_0xddc8('0x9')],'from':_0x3d3acb['senderString']||_0x3d3acb[_0xddc8('0x1c')]}]};var _0x4e0e6d=util[_0xddc8('0x41')](_0xddc8('0x42'),_0x3d3acb['username'],_0x3d3acb[_0xddc8('0x30')]);var _0x14a829={'method':_0xddc8('0x32'),'uri':_0xddc8('0x43'),'body':_0x5a1b91,'headers':{'Authorization':util[_0xddc8('0x41')](_0xddc8('0x44'),new Buffer(_0x4e0e6d)[_0xddc8('0x45')](_0xddc8('0x46')))},'json':!![]};rp(_0x14a829)['then'](function(_0x8d2c08){if(_0x8d2c08[_0xddc8('0x47')]>=0xc8&&_0x8d2c08[_0xddc8('0x47')]<=0xce){if(_0x8d2c08[_0xddc8('0x48')]&&_0x8d2c08[_0xddc8('0x48')][_0xddc8('0x49')]>0x0){var _0x1abbad=_[_0xddc8('0x4a')](_0x8d2c08[_0xddc8('0x48')][_0xddc8('0x1d')]);var _0x29bcf8={'messageId':_0x1abbad[_0xddc8('0x4b')]};if(!_0x3d3acb[_0xddc8('0x36')]){_0x29bcf8[_0xddc8('0x37')]=!![];}return _0x3e6be3['update'](_0x29bcf8);}else{logger[_0xddc8('0x14')](_0xddc8('0x28'),'afterCreate',_0xddc8('0x4c'),util[_0xddc8('0x27')](_0x8d2c08,{'showHidden':![],'depth':null}));}}else{logger[_0xddc8('0x14')](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x4c'),util['inspect'](_0x8d2c08,{'showHidden':![],'depth':null}));}})[_0xddc8('0x38')](function(_0x5f3e94){logger[_0xddc8('0x14')](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x4c'),util['inspect'](_0x5f3e94,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x4c'),_0xddc8('0x39'));}break;case _0xddc8('0x4d'):if(_0x3d3acb[_0xddc8('0x4e')]&&_0x3d3acb[_0xddc8('0x1b')]){var _0x5a1b91={'dst':_0x285707[_0xddc8('0x1c')],'text':_0x285707[_0xddc8('0x9')],'src':_0x3d3acb[_0xddc8('0x4f')]||_0x3d3acb[_0xddc8('0x1c')],'url':_0x3d3acb['remote']+_0xddc8('0x20')+_0x285707['id']+_0xddc8('0x21')+_0x3d3acb['token']};var _0x4e0e6d=util[_0xddc8('0x41')]('%s:%s',_0x3d3acb[_0xddc8('0x4e')],_0x3d3acb[_0xddc8('0x1b')]);var _0x14a829={'method':_0xddc8('0x32'),'uri':util[_0xddc8('0x41')](_0xddc8('0x50'),_0x3d3acb[_0xddc8('0x4e')]),'body':_0x5a1b91,'headers':{'Authorization':util['format'](_0xddc8('0x44'),new Buffer(_0x4e0e6d)[_0xddc8('0x45')](_0xddc8('0x46')))},'json':!![]};rp(_0x14a829)[_0xddc8('0x23')](function(_0x13f20c){var _0x4794ce={'messageId':_0x13f20c['message_uuid'][0x0]};return _0x3e6be3[_0xddc8('0x25')](_0x4794ce);})[_0xddc8('0x38')](function(_0x58def9){logger[_0xddc8('0x14')](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x4d'),util[_0xddc8('0x27')](_0x58def9,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xddc8('0x4d'),_0xddc8('0x51'));}break;case _0xddc8('0x52'):if(_0x3d3acb['username']&&_0x3d3acb[_0xddc8('0x30')]){if(_0x3d3acb[_0xddc8('0x53')]){var _0x56e909={'method':_0xddc8('0x32'),'uri':_0x3d3acb[_0xddc8('0x53')]+'/auth/1/session','body':{'username':_0x3d3acb['username'],'password':_0x3d3acb['password']},'json':!![]};return rp(_0x56e909)[_0xddc8('0x23')](function(_0x3e548b){var _0x84ee52={'method':_0xddc8('0x32'),'uri':_0x3d3acb[_0xddc8('0x53')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3d3acb[_0xddc8('0x1c')],'destinations':[{'to':_0x285707[_0xddc8('0x1c')]}],'text':_0x285707['body'],'notifyUrl':_0x3d3acb['remote']+'/api/sms/messages/'+_0x285707['id']+_0xddc8('0x21')+_0x3d3acb[_0xddc8('0x22')],'notifyContentType':_0xddc8('0x54'),'callbackData':_0x3d3acb[_0xddc8('0x1c')]+';'+_0x285707[_0xddc8('0x9')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x3e548b[_0xddc8('0x22')]},'json':!![]};return rp(_0x84ee52)[_0xddc8('0x23')](function(_0x643390){if(_0x643390[_0xddc8('0x1d')]){var _0x23b9d6={'messageId':_0x643390[_0xddc8('0x1d')][0x0][_0xddc8('0x8')]};if(!_0x3d3acb[_0xddc8('0x36')]){_0x23b9d6[_0xddc8('0x37')]=!![];}return _0x3e6be3[_0xddc8('0x25')](_0x23b9d6);}else{return logger[_0xddc8('0x14')](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x52'),util[_0xddc8('0x27')](_0x643390,{'showHidden':![],'depth':null}));}});})[_0xddc8('0x38')](function(_0xfe9715){return logger[_0xddc8('0x14')](_0xddc8('0x28'),_0xddc8('0x26'),'infobip',util['inspect'](_0xfe9715,{'showHidden':![],'depth':null}));});}else{logger[_0xddc8('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xddc8('0x26'),_0xddc8('0x52'),_0xddc8('0x55'));}}else{logger[_0xddc8('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xddc8('0x52'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0xfc3782=require('crypto');if(_0x3d3acb[_0xddc8('0x56')]){var _0x5d09bb={};_0x5d09bb[_0xddc8('0x57')]=_0x3d3acb[_0xddc8('0x3f')];_0x5d09bb[_0xddc8('0x1c')]=_0x285707[_0xddc8('0x1c')];_0x5d09bb[_0xddc8('0x2d')]=_0x3d3acb[_0xddc8('0x1c')];_0x5d09bb[_0xddc8('0x58')]=_0x285707[_0xddc8('0x9')];_0x5d09bb['timestamp']=+new Date();var _0xeb63f5='';var _0x4ff089='';var _0x48d320=Object[_0xddc8('0x59')](_0x5d09bb);_0x48d320['sort']();for(var _0x520f4e=0x0;_0x520f4e<_0x48d320[_0xddc8('0x5a')];_0x520f4e++){if(_0xeb63f5!=''){_0xeb63f5+='&';}_0xeb63f5+=_0x48d320[_0x520f4e]+'='+encodeURIComponent(_0x5d09bb[_0x48d320[_0x520f4e]]);_0x4ff089+=_0x5d09bb[_0x48d320[_0x520f4e]];}_0x4ff089+=_0x3d3acb[_0xddc8('0x56')];_0x4ff089=_0xfc3782[_0xddc8('0x5b')](_0xddc8('0x5c'))[_0xddc8('0x25')](_0x4ff089)[_0xddc8('0x5d')](_0xddc8('0x5e'));if(_0xeb63f5!==''){_0xeb63f5+='&';}_0xeb63f5+=_0xddc8('0x5f')+_0x4ff089;var _0x2acbb0={'method':_0xddc8('0x31'),'uri':_0x3d3acb[_0xddc8('0x53')]+_0xddc8('0x60')+_0xeb63f5,'json':!![]};return rp(_0x2acbb0)['then'](function(_0x3d6e5b){var _0x35290b=Object['keys'](_0x3d6e5b);if(_0x3d6e5b[_0x35290b[0x0]]['error']&&parseInt(_0x3d6e5b[_0x35290b[0x0]]['error'])===0x0){var _0x32645f={'messageId':_0x3d6e5b[_0x35290b[0x0]][_0xddc8('0x61')]};if(!_0x3d3acb['deliveryReport']){_0x32645f[_0xddc8('0x37')]=!![];}return _0x3e6be3[_0xddc8('0x25')](_0x32645f);}else{return logger[_0xddc8('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xddc8('0x62'),util[_0xddc8('0x27')](_0x3d6e5b[_0xddc8('0x14')],{'showHidden':![],'depth':null}));}})[_0xddc8('0x38')](function(_0x3cc4eb){return logger['error'](_0xddc8('0x28'),_0xddc8('0x26'),'csc',util[_0xddc8('0x27')](_0x3cc4eb,{'showHidden':![],'depth':null}));});}else{logger[_0xddc8('0x14')](_0xddc8('0x28'),'afterCreate',_0xddc8('0x62'),_0xddc8('0x63'));}break;case'clickatell':if(_0x3d3acb['apiKey']){var _0x1341ef={'method':_0xddc8('0x32'),'uri':_0xddc8('0x64'),'headers':{'Authorization':_0x3d3acb[_0xddc8('0x56')]},'body':{'content':_0x285707[_0xddc8('0x9')],'to':[_0x285707[_0xddc8('0x1c')]],'from':_0x3d3acb[_0xddc8('0x1c')],'binary':![],'clientMessageId':_0xddc8('0x65'),'charset':_0xddc8('0x66')},'json':!![]};rp(_0x1341ef)[_0xddc8('0x23')](function(_0x24b498){if(!_0x24b498[_0xddc8('0x14')]){var _0x26027c={'messageId':_0x24b498[_0xddc8('0x1d')][0x0][_0xddc8('0x67')]};if(!_0x3d3acb[_0xddc8('0x36')]){_0x26027c['read']=!![];}return _0x3e6be3[_0xddc8('0x25')](_0x26027c);}else{return logger[_0xddc8('0x14')](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x68'),util[_0xddc8('0x27')](_0x24b498[_0xddc8('0x14')],{'showHidden':![],'depth':null}));}})[_0xddc8('0x38')](function(_0xeda6cc){return logger[_0xddc8('0x14')](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x68'),util['inspect'](_0xeda6cc,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x68'),_0xddc8('0x63'));}break;case _0xddc8('0x69'):if(_0x3d3acb[_0xddc8('0x3f')]&&_0x3d3acb[_0xddc8('0x30')]){var _0x4e0e6d=util[_0xddc8('0x41')]('%s:%s',_0x3d3acb['username'],_0x3d3acb[_0xddc8('0x30')]);var _0x14a829={'method':_0xddc8('0x32'),'uri':_0xddc8('0x6a')+_0x3d3acb['accountId']+_0xddc8('0x6b'),'body':{'to':[_0x285707[_0xddc8('0x1c')]],'text':_0x285707['body'],'from':_0x3d3acb[_0xddc8('0x1c')],'applicationId':_0x3d3acb[_0xddc8('0x6c')]},'headers':{'Authorization':util[_0xddc8('0x41')]('Basic\x20%s',new Buffer(_0x4e0e6d)[_0xddc8('0x45')](_0xddc8('0x46')))},'json':!![]};rp(_0x14a829)[_0xddc8('0x23')](function(_0x2b9da7){if(_0x2b9da7['id']){var _0x165243={'messageId':_0x2b9da7['id']};return _0x3e6be3['update'](_0x165243);}else{logger[_0xddc8('0x14')](_0xddc8('0x28'),'afterCreate',_0xddc8('0x69'),util['inspect'](_0x2b9da7,{'showHidden':![],'depth':null}));}})[_0xddc8('0x38')](function(_0x34c098){logger[_0xddc8('0x14')](_0xddc8('0x28'),_0xddc8('0x26'),'bandwidth',util['inspect'](_0x34c098,{'showHidden':![],'depth':null}));});}else{logger[_0xddc8('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xddc8('0x26'),_0xddc8('0x69'),_0xddc8('0x39'));}break;case _0xddc8('0x6d'):if(_0x3d3acb[_0xddc8('0x56')]){var _0x1449a0={};var _0x2acbb0={'method':_0xddc8('0x32'),'uri':_0xddc8('0x6e'),'headers':{'Authorization':_0xddc8('0x6f')+_0x3d3acb[_0xddc8('0x56')],'Content-Type':_0xddc8('0x54')},'body':{'from':_0x3d3acb[_0xddc8('0x1c')],'to':_0x285707[_0xddc8('0x1c')],'text':_0x285707['body']},'json':!![]};return rp(_0x2acbb0)[_0xddc8('0x23')](function(_0x1c0a23){if(_0x1c0a23[_0xddc8('0x70')]==0xca){_0x1449a0['message']=_0x1c0a23;var _0x1f4bcb={'method':_0xddc8('0x32'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x3d3acb[_0xddc8('0x56')],'Content-Type':'application/json'},'body':{'refid':_0x1449a0['message'][_0xddc8('0x71')]},'json':!![]};return rp(_0x1f4bcb)[_0xddc8('0x23')](function(_0x2af31e){_0x1449a0['status']=_0x2af31e;var _0x1da58f={'messageId':_0x1449a0['message'][_0xddc8('0x71')],'read':!![]};return _0x3e6be3[_0xddc8('0x25')](_0x1da58f);});}else{return logger[_0xddc8('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xddc8('0x26'),'intelepeer',util[_0xddc8('0x27')](_0x1c0a23,{'showHidden':![],'depth':null}));}})[_0xddc8('0x38')](function(_0x5e137a){return logger[_0xddc8('0x14')](_0xddc8('0x28'),_0xddc8('0x26'),_0xddc8('0x6d'),util[_0xddc8('0x27')](_0x5e137a,{'showHidden':![],'depth':null}));});}else{return logger[_0xddc8('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xddc8('0x26'),_0xddc8('0x6d'),_0xddc8('0x72'));}break;}}})[_0xddc8('0x73')](function(){_0x35555a();});}else{_0x35555a();}}},'charset':'utf8mb4','collate':_0xddc8('0x74')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index a4dfd4c..245bf64 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 _0x7afc=['body','options','CreateSmsMessage','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','catch','SmsMessage','create'];(function(_0x37bba0,_0x38bae8){var _0x47d7ab=function(_0x2f8e1e){while(--_0x2f8e1e){_0x37bba0['push'](_0x37bba0['shift']());}};_0x47d7ab(++_0x38bae8);}(_0x7afc,0x80));var _0xc7af=function(_0x14a34a,_0x424129){_0x14a34a=_0x14a34a-0x0;var _0x4d921e=_0x7afc[_0x14a34a];return _0x4d921e;};'use strict';var _=require('lodash');var util=require(_0xc7af('0x0'));var moment=require(_0xc7af('0x1'));var BPromise=require(_0xc7af('0x2'));var rs=require(_0xc7af('0x3'));var fs=require('fs');var Redis=require(_0xc7af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc7af('0x5'));var logger=require(_0xc7af('0x6'))(_0xc7af('0x7'));var config=require(_0xc7af('0x8'));var jayson=require(_0xc7af('0x9'));var client=jayson[_0xc7af('0xa')]['http']({'port':0x232a});config[_0xc7af('0xb')]=_[_0xc7af('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc7af('0xd'))(new Redis(config[_0xc7af('0xb')]));require('./smsMessage.socket')[_0xc7af('0xe')](socket);function respondWithRpcPromise(_0x505638,_0x296657,_0x11ccd8){return new BPromise(function(_0x199a47,_0x392cc6){return client[_0xc7af('0xf')](_0x505638,_0x11ccd8)[_0xc7af('0x10')](function(_0x51ba22){logger[_0xc7af('0x11')](_0xc7af('0x12'),_0x296657,_0xc7af('0x13'));logger[_0xc7af('0x14')](_0xc7af('0x15'),_0x296657,_0xc7af('0x13'),JSON['stringify'](_0x51ba22));if(_0x51ba22['error']){if(_0x51ba22[_0xc7af('0x16')]['code']===0x1f4){logger[_0xc7af('0x16')](_0xc7af('0x12'),_0x296657,_0x51ba22[_0xc7af('0x16')][_0xc7af('0x17')]);return _0x392cc6(_0x51ba22[_0xc7af('0x16')][_0xc7af('0x17')]);}logger[_0xc7af('0x16')]('SmsMessage,\x20%s,\x20%s',_0x296657,_0x51ba22[_0xc7af('0x16')][_0xc7af('0x17')]);return _0x199a47(_0x51ba22[_0xc7af('0x16')][_0xc7af('0x17')]);}else{logger[_0xc7af('0x11')](_0xc7af('0x12'),_0x296657,_0xc7af('0x13'));_0x199a47(_0x51ba22['result'][_0xc7af('0x17')]);}})[_0xc7af('0x18')](function(_0x497a01){logger[_0xc7af('0x16')](_0xc7af('0x12'),_0x296657,_0x497a01);_0x392cc6(_0x497a01);});});}exports['CreateSmsMessage']=function(_0x3b24e3){var _0x3c11ac=this;return new Promise(function(_0x24105f,_0x3778d9){return db[_0xc7af('0x19')][_0xc7af('0x1a')](_0x3b24e3[_0xc7af('0x1b')],{'raw':_0x3b24e3['options']?_0x3b24e3[_0xc7af('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xc7af('0x10')](function(_0x1b810e){logger[_0xc7af('0x11')]('CreateSmsMessage',_0x3b24e3);logger['debug'](_0xc7af('0x1d'),_0x3b24e3,JSON[_0xc7af('0x1e')](_0x1b810e));_0x24105f(_0x1b810e);})[_0xc7af('0x18')](function(_0x18706e){logger[_0xc7af('0x16')](_0xc7af('0x1d'),_0x18706e['message'],_0x3b24e3);_0x3778d9(_0x3c11ac['error'](0x1f4,_0x18706e[_0xc7af('0x17')]));});});}; \ No newline at end of file +var _0xbd3c=['SmsMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsMessage'];(function(_0x4e40e4,_0x31d44f){var _0x4eeb6f=function(_0x159cdf){while(--_0x159cdf){_0x4e40e4['push'](_0x4e40e4['shift']());}};_0x4eeb6f(++_0x31d44f);}(_0xbd3c,0xed));var _0xcbd3=function(_0x13b747,_0x58dce2){_0x13b747=_0x13b747-0x0;var _0x1ffa30=_0xbd3c[_0x13b747];return _0x1ffa30;};'use strict';var _=require(_0xcbd3('0x0'));var util=require(_0xcbd3('0x1'));var moment=require(_0xcbd3('0x2'));var BPromise=require(_0xcbd3('0x3'));var rs=require(_0xcbd3('0x4'));var fs=require('fs');var Redis=require(_0xcbd3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcbd3('0x6'))(_0xcbd3('0x7'));var config=require(_0xcbd3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcbd3('0x9')]['http']({'port':0x232a});config[_0xcbd3('0xa')]=_[_0xcbd3('0xb')](config[_0xcbd3('0xa')],{'host':_0xcbd3('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcbd3('0xa')]));require(_0xcbd3('0xd'))[_0xcbd3('0xe')](socket);function respondWithRpcPromise(_0x38dab1,_0x299567,_0x4fcd0b){return new BPromise(function(_0x2e9934,_0x3d5cea){return client[_0xcbd3('0xf')](_0x38dab1,_0x4fcd0b)[_0xcbd3('0x10')](function(_0x182c8c){logger[_0xcbd3('0x11')](_0xcbd3('0x12'),_0x299567,_0xcbd3('0x13'));logger['debug'](_0xcbd3('0x14'),_0x299567,_0xcbd3('0x13'),JSON[_0xcbd3('0x15')](_0x182c8c));if(_0x182c8c[_0xcbd3('0x16')]){if(_0x182c8c[_0xcbd3('0x16')][_0xcbd3('0x17')]===0x1f4){logger[_0xcbd3('0x16')]('SmsMessage,\x20%s,\x20%s',_0x299567,_0x182c8c[_0xcbd3('0x16')][_0xcbd3('0x18')]);return _0x3d5cea(_0x182c8c[_0xcbd3('0x16')][_0xcbd3('0x18')]);}logger[_0xcbd3('0x16')](_0xcbd3('0x12'),_0x299567,_0x182c8c['error'][_0xcbd3('0x18')]);return _0x2e9934(_0x182c8c[_0xcbd3('0x16')][_0xcbd3('0x18')]);}else{logger[_0xcbd3('0x11')](_0xcbd3('0x12'),_0x299567,_0xcbd3('0x13'));_0x2e9934(_0x182c8c[_0xcbd3('0x19')][_0xcbd3('0x18')]);}})['catch'](function(_0x834c4f){logger[_0xcbd3('0x16')]('SmsMessage,\x20%s,\x20%s',_0x299567,_0x834c4f);_0x3d5cea(_0x834c4f);});});}exports[_0xcbd3('0x1a')]=function(_0x302aaa){var _0x5652dd=this;return new Promise(function(_0x53a3b2,_0x30e2ce){return db[_0xcbd3('0x1b')][_0xcbd3('0x1c')](_0x302aaa[_0xcbd3('0x1d')],{'raw':_0x302aaa[_0xcbd3('0x1e')]?_0x302aaa['options'][_0xcbd3('0x1f')]===undefined?!![]:![]:!![]})[_0xcbd3('0x10')](function(_0x21f532){logger['info']('CreateSmsMessage',_0x302aaa);logger['debug'](_0xcbd3('0x1a'),_0x302aaa,JSON['stringify'](_0x21f532));_0x53a3b2(_0x21f532);})[_0xcbd3('0x20')](function(_0x6e433d){logger[_0xcbd3('0x16')](_0xcbd3('0x1a'),_0x6e433d[_0xcbd3('0x18')],_0x302aaa);_0x30e2ce(_0x5652dd[_0xcbd3('0x16')](0x1f4,_0x6e433d['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 703cd7e..45e5fe7 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 _0xf148=['save','update','emit','removeListener','register','smsMessage:','./smsMessage.events'];(function(_0x5dd3a3,_0x24b2b3){var _0x51a4ba=function(_0x3ce1c8){while(--_0x3ce1c8){_0x5dd3a3['push'](_0x5dd3a3['shift']());}};_0x51a4ba(++_0x24b2b3);}(_0xf148,0x148));var _0x8f14=function(_0x365131,_0x12e59a){_0x365131=_0x365131-0x0;var _0x1ad8b2=_0xf148[_0x365131];return _0x1ad8b2;};'use strict';var SmsMessageEvents=require(_0x8f14('0x0'));var events=[_0x8f14('0x1'),'remove',_0x8f14('0x2')];function createListener(_0x149bfd,_0x5aabe6){return function(_0x354a88){_0x5aabe6[_0x8f14('0x3')](_0x149bfd,_0x354a88);};}function removeListener(_0x10f896,_0x2e16b8){return function(){SmsMessageEvents[_0x8f14('0x4')](_0x10f896,_0x2e16b8);};}exports[_0x8f14('0x5')]=function(_0x18eaf2){for(var _0x296cef=0x0,_0x3d7e6b=events['length'];_0x296cef<_0x3d7e6b;_0x296cef++){var _0x437e08=events[_0x296cef];var _0x3f512a=createListener(_0x8f14('0x6')+_0x437e08,_0x18eaf2);SmsMessageEvents['on'](_0x437e08,_0x3f512a);}}; \ No newline at end of file +var _0x94dc=['register','smsMessage:','./smsMessage.events','remove','removeListener'];(function(_0x55c083,_0x2200df){var _0x9c3e3d=function(_0x24238b){while(--_0x24238b){_0x55c083['push'](_0x55c083['shift']());}};_0x9c3e3d(++_0x2200df);}(_0x94dc,0xb1));var _0xc94d=function(_0x37188b,_0x37d9d1){_0x37188b=_0x37188b-0x0;var _0x55d474=_0x94dc[_0x37188b];return _0x55d474;};'use strict';var SmsMessageEvents=require(_0xc94d('0x0'));var events=['save',_0xc94d('0x1'),'update'];function createListener(_0x1645b0,_0x1b2070){return function(_0x40e7d8){_0x1b2070['emit'](_0x1645b0,_0x40e7d8);};}function removeListener(_0x306706,_0x41d4ec){return function(){SmsMessageEvents[_0xc94d('0x2')](_0x306706,_0x41d4ec);};}exports[_0xc94d('0x3')]=function(_0x3c0601){for(var _0x344188=0x0,_0xb7275c=events['length'];_0x344188<_0xb7275c;_0x344188++){var _0x2f9757=events[_0x344188];var _0xbe5904=createListener(_0xc94d('0x4')+_0x2f9757,_0x3c0601);SmsMessageEvents['on'](_0x2f9757,_0xbe5904);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 5a9da1a..69d7cf1 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 _0xa363=['isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','post','create','/:id/teams','/:id/users','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x24815b,_0xc86ea4){var _0x3b74d9=function(_0x232479){while(--_0x232479){_0x24815b['push'](_0x24815b['shift']());}};_0x3b74d9(++_0xc86ea4);}(_0xa363,0x19b));var _0x3a36=function(_0x4c32f5,_0x3dbbf1){_0x4c32f5=_0x4c32f5-0x0;var _0x19cae9=_0xa363[_0x4c32f5];return _0x19cae9;};'use strict';var multer=require(_0x3a36('0x0'));var util=require(_0x3a36('0x1'));var path=require(_0x3a36('0x2'));var timeout=require('connect-timeout');var express=require(_0x3a36('0x3'));var router=express[_0x3a36('0x4')]();var fs_extra=require(_0x3a36('0x5'));var auth=require(_0x3a36('0x6'));var interaction=require(_0x3a36('0x7'));var config=require(_0x3a36('0x8'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0x3a36('0x9')](),controller[_0x3a36('0xa')]);router[_0x3a36('0xb')](_0x3a36('0xc'),auth[_0x3a36('0x9')](),controller[_0x3a36('0xd')]);router[_0x3a36('0xb')](_0x3a36('0xe'),auth[_0x3a36('0x9')](),controller[_0x3a36('0xf')]);router[_0x3a36('0xb')](_0x3a36('0x10'),auth[_0x3a36('0x9')](),controller[_0x3a36('0x11')]);router['get']('/:id/teams',auth[_0x3a36('0x9')](),controller[_0x3a36('0x12')]);router[_0x3a36('0xb')]('/:id/users',auth[_0x3a36('0x9')](),controller['getAgents']);router[_0x3a36('0x13')]('/',auth[_0x3a36('0x9')](),controller[_0x3a36('0x14')]);router[_0x3a36('0x13')](_0x3a36('0x15'),auth[_0x3a36('0x9')](),controller['addTeams']);router['post'](_0x3a36('0x16'),auth[_0x3a36('0x9')](),controller[_0x3a36('0x17')]);router[_0x3a36('0x18')](_0x3a36('0xe'),auth[_0x3a36('0x9')](),controller['update']);router[_0x3a36('0x19')]('/:id',auth[_0x3a36('0x9')](),controller[_0x3a36('0x1a')]);router['delete'](_0x3a36('0x15'),auth[_0x3a36('0x9')](),controller[_0x3a36('0x1b')]);router[_0x3a36('0x19')](_0x3a36('0x16'),auth[_0x3a36('0x9')](),controller[_0x3a36('0x1c')]);module[_0x3a36('0x1d')]=router; \ No newline at end of file +var _0xd91d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','put','/:id','update','destroy','removeTeams','delete','exports','multer','util','path','connect-timeout'];(function(_0x5e918f,_0x30ac4f){var _0x1828fd=function(_0x2881fb){while(--_0x2881fb){_0x5e918f['push'](_0x5e918f['shift']());}};_0x1828fd(++_0x30ac4f);}(_0xd91d,0x1cc));var _0xdd91=function(_0x59f1ff,_0x55a95b){_0x59f1ff=_0x59f1ff-0x0;var _0x418178=_0xd91d[_0x59f1ff];return _0x418178;};'use strict';var multer=require(_0xdd91('0x0'));var util=require(_0xdd91('0x1'));var path=require(_0xdd91('0x2'));var timeout=require(_0xdd91('0x3'));var express=require(_0xdd91('0x4'));var router=express[_0xdd91('0x5')]();var fs_extra=require(_0xdd91('0x6'));var auth=require(_0xdd91('0x7'));var interaction=require(_0xdd91('0x8'));var config=require(_0xdd91('0x9'));var controller=require('./smsQueue.controller');router[_0xdd91('0xa')]('/',auth['isAuthenticated'](),controller[_0xdd91('0xb')]);router['get'](_0xdd91('0xc'),auth[_0xdd91('0xd')](),controller[_0xdd91('0xe')]);router['get']('/:id',auth[_0xdd91('0xd')](),controller[_0xdd91('0xf')]);router[_0xdd91('0xa')]('/:id/members',auth[_0xdd91('0xd')](),controller[_0xdd91('0x10')]);router['get'](_0xdd91('0x11'),auth[_0xdd91('0xd')](),controller['getTeams']);router[_0xdd91('0xa')](_0xdd91('0x12'),auth[_0xdd91('0xd')](),controller[_0xdd91('0x13')]);router['post']('/',auth[_0xdd91('0xd')](),controller['create']);router[_0xdd91('0x14')](_0xdd91('0x11'),auth['isAuthenticated'](),controller[_0xdd91('0x15')]);router[_0xdd91('0x14')]('/:id/users',auth[_0xdd91('0xd')](),controller['addAgents']);router[_0xdd91('0x16')](_0xdd91('0x17'),auth[_0xdd91('0xd')](),controller[_0xdd91('0x18')]);router['delete'](_0xdd91('0x17'),auth['isAuthenticated'](),controller[_0xdd91('0x19')]);router['delete'](_0xdd91('0x11'),auth['isAuthenticated'](),controller[_0xdd91('0x1a')]);router[_0xdd91('0x1b')](_0xdd91('0x12'),auth[_0xdd91('0xd')](),controller['removeAgents']);module[_0xdd91('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 45f7fb0..3685416 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 _0x4b75=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x449cee,_0x3d88b0){var _0x58de0a=function(_0x3636a6){while(--_0x3636a6){_0x449cee['push'](_0x449cee['shift']());}};_0x58de0a(++_0x3d88b0);}(_0x4b75,0xef));var _0x54b7=function(_0x4f7082,_0x54a8f2){_0x4f7082=_0x4f7082-0x0;var _0x251a37=_0x4b75[_0x4f7082];return _0x251a37;};'use strict';var Sequelize=require(_0x54b7('0x0'));module[_0x54b7('0x1')]={'name':{'type':Sequelize[_0x54b7('0x2')],'unique':_0x54b7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x54b7('0x2')]},'timeout':{'type':Sequelize[_0x54b7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x54b7('0x5')]('rrmemory',_0x54b7('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x4014=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x3e532b,_0x59a264){var _0x1af062=function(_0x4f0d6d){while(--_0x4f0d6d){_0x3e532b['push'](_0x3e532b['shift']());}};_0x1af062(++_0x59a264);}(_0x4014,0x1d4));var _0x4401=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x4014[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0x4401('0x0'));module['exports']={'name':{'type':Sequelize[_0x4401('0x1')],'unique':_0x4401('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4401('0x1')]},'timeout':{'type':Sequelize[_0x4401('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4401('0x4')](_0x4401('0x5'),_0x4401('0x6'),_0x4401('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 65ec220..26ec339 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 _0xaf79=['nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','smsPause','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','userSmsQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','SmsQueues','UserProfileResource','destroy','error','stack','name','SmsQueue','rawAttributes','fieldName','type','key','model','map','keys','filters','query','fields','attributes','length','hasOwnProperty'];(function(_0x4f6a02,_0x1a9f63){var _0x538c63=function(_0x8f5323){while(--_0x8f5323){_0x4f6a02['push'](_0x4f6a02['shift']());}};_0x538c63(++_0x1a9f63);}(_0xaf79,0xe4));var _0x9af7=function(_0x4903e3,_0x2f1a47){_0x4903e3=_0x4903e3-0x0;var _0x35e723=_0xaf79[_0x4903e3];return _0x35e723;};'use strict';var emlformat=require(_0x9af7('0x0'));var rimraf=require(_0x9af7('0x1'));var zipdir=require(_0x9af7('0x2'));var jsonpatch=require(_0x9af7('0x3'));var rp=require(_0x9af7('0x4'));var moment=require(_0x9af7('0x5'));var BPromise=require(_0x9af7('0x6'));var Mustache=require(_0x9af7('0x7'));var util=require(_0x9af7('0x8'));var path=require(_0x9af7('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9af7('0xa'));var _=require(_0x9af7('0xb'));var squel=require(_0x9af7('0xc'));var crypto=require(_0x9af7('0xd'));var jsforce=require(_0x9af7('0xe'));var deskjs=require(_0x9af7('0xf'));var toCsv=require(_0x9af7('0x10'));var querystring=require(_0x9af7('0x11'));var Papa=require(_0x9af7('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9af7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9af7('0x14'));var logger=require(_0x9af7('0x15'))(_0x9af7('0x16'));var utils=require(_0x9af7('0x17'));var config=require(_0x9af7('0x18'));var licenseUtil=require(_0x9af7('0x19'));var db=require('../../mysqldb')['db'];config[_0x9af7('0x1a')]=_[_0x9af7('0x1b')](config[_0x9af7('0x1a')],{'host':_0x9af7('0x1c'),'port':0x18eb});var socket=require(_0x9af7('0x1d'))(new Redis(config[_0x9af7('0x1a')]));require(_0x9af7('0x1e'))[_0x9af7('0x1f')](socket);function respondWithStatusCode(_0x109052,_0x3ad37c){_0x3ad37c=_0x3ad37c||0xcc;return function(_0x30c8cb){if(_0x30c8cb){return _0x109052[_0x9af7('0x20')](_0x3ad37c);}return _0x109052['status'](_0x3ad37c)[_0x9af7('0x21')]();};}function respondWithResult(_0x10d96b,_0x48feb1){_0x48feb1=_0x48feb1||0xc8;return function(_0x372991){if(_0x372991){return _0x10d96b[_0x9af7('0x22')](_0x48feb1)[_0x9af7('0x23')](_0x372991);}};}function respondWithFilteredResult(_0x4de57f,_0x36910f){return function(_0x416aea){if(_0x416aea){var _0xe74d23=typeof _0x36910f[_0x9af7('0x24')]===_0x9af7('0x25')&&typeof _0x36910f[_0x9af7('0x26')]===_0x9af7('0x25');var _0x5efbcc=_0x416aea['count'];var _0x1941fc=_0xe74d23?0x0:_0x36910f[_0x9af7('0x24')];var _0x250cc5=_0xe74d23?_0x416aea[_0x9af7('0x27')]:_0x36910f[_0x9af7('0x24')]+_0x36910f[_0x9af7('0x26')];var _0xbd042d;if(_0x250cc5>=_0x5efbcc){_0x250cc5=_0x5efbcc;_0xbd042d=0xc8;}else{_0xbd042d=0xce;}_0x4de57f[_0x9af7('0x22')](_0xbd042d);return _0x4de57f[_0x9af7('0x28')](_0x9af7('0x29'),_0x1941fc+'-'+_0x250cc5+'/'+_0x5efbcc)[_0x9af7('0x23')](_0x416aea);}return null;};}function patchUpdates(_0x144b7a){return function(_0x2baf02){try{jsonpatch[_0x9af7('0x2a')](_0x2baf02,_0x144b7a,!![]);}catch(_0x442640){return BPromise[_0x9af7('0x2b')](_0x442640);}return _0x2baf02[_0x9af7('0x2c')]();};}function saveUpdates(_0x5ab3d0,_0x105837){return function(_0x5c587f){if(_0x5c587f){return _0x5c587f['update'](_0x5ab3d0)[_0x9af7('0x2d')](function(_0x1b5b50){return _0x1b5b50;});}return null;};}function removeEntity(_0x27aeee,_0x568d8e){return function(_0x148d09){if(_0x148d09){return _0x148d09['destroy']()[_0x9af7('0x2d')](function(){var _0xdf3c54=_0x148d09['get']({'plain':!![]});var _0x437899=_0x9af7('0x2e');return db[_0x9af7('0x2f')][_0x9af7('0x30')]({'where':{'type':_0x437899,'resourceId':_0xdf3c54['id']}})[_0x9af7('0x2d')](function(){return _0x148d09;});})[_0x9af7('0x2d')](function(){_0x27aeee[_0x9af7('0x22')](0xcc)[_0x9af7('0x21')]();});}};}function handleEntityNotFound(_0x5c29b9,_0x4fb57f){return function(_0x1bc398){if(!_0x1bc398){_0x5c29b9[_0x9af7('0x20')](0x194);}return _0x1bc398;};}function handleError(_0x190cd5,_0x49c08c){_0x49c08c=_0x49c08c||0x1f4;return function(_0xc5e9de){logger[_0x9af7('0x31')](_0xc5e9de[_0x9af7('0x32')]);if(_0xc5e9de[_0x9af7('0x33')]){delete _0xc5e9de[_0x9af7('0x33')];}_0x190cd5[_0x9af7('0x22')](_0x49c08c)['send'](_0xc5e9de);};}exports['index']=function(_0x321bc9,_0x2d2faf){var _0x312232={},_0x1e6630={},_0x2d01f2={'count':0x0,'rows':[]};var _0x4dc32a=_['map'](db[_0x9af7('0x34')][_0x9af7('0x35')],function(_0x1152bb){return{'name':_0x1152bb[_0x9af7('0x36')],'type':_0x1152bb[_0x9af7('0x37')][_0x9af7('0x38')]};});_0x1e6630[_0x9af7('0x39')]=_[_0x9af7('0x3a')](_0x4dc32a,_0x9af7('0x33'));_0x1e6630['query']=_[_0x9af7('0x3b')](_0x321bc9['query']);_0x1e6630[_0x9af7('0x3c')]=_['intersection'](_0x1e6630['model'],_0x1e6630['query']);_0x312232['attributes']=_['intersection'](_0x1e6630[_0x9af7('0x39')],qs['fields'](_0x321bc9[_0x9af7('0x3d')][_0x9af7('0x3e')]));_0x312232['attributes']=_0x312232[_0x9af7('0x3f')][_0x9af7('0x40')]?_0x312232[_0x9af7('0x3f')]:_0x1e6630[_0x9af7('0x39')];if(!_0x321bc9['query'][_0x9af7('0x41')](_0x9af7('0x42'))){_0x312232[_0x9af7('0x26')]=qs[_0x9af7('0x26')](_0x321bc9[_0x9af7('0x3d')][_0x9af7('0x26')]);_0x312232['offset']=qs[_0x9af7('0x24')](_0x321bc9['query'][_0x9af7('0x24')]);}_0x312232[_0x9af7('0x43')]=qs[_0x9af7('0x44')](_0x321bc9[_0x9af7('0x3d')][_0x9af7('0x44')]);_0x312232['where']=qs[_0x9af7('0x3c')](_[_0x9af7('0x45')](_0x321bc9['query'],_0x1e6630[_0x9af7('0x3c')]),_0x4dc32a);if(_0x321bc9[_0x9af7('0x3d')][_0x9af7('0x46')]){_0x312232[_0x9af7('0x47')]=_[_0x9af7('0x48')](_0x312232[_0x9af7('0x47')],{'$or':_[_0x9af7('0x3a')](_0x4dc32a,function(_0x2b2c07){if(_0x2b2c07[_0x9af7('0x37')]!==_0x9af7('0x49')){var _0x7b2d07={};_0x7b2d07[_0x2b2c07['name']]={'$like':'%'+_0x321bc9[_0x9af7('0x3d')][_0x9af7('0x46')]+'%'};return _0x7b2d07;}})});}_0x312232=_['merge']({},_0x312232,_0x321bc9[_0x9af7('0x4a')]);var _0xbea7e8={'where':_0x312232[_0x9af7('0x47')]};return db[_0x9af7('0x34')][_0x9af7('0x27')](_0xbea7e8)[_0x9af7('0x2d')](function(_0x49dad9){_0x2d01f2[_0x9af7('0x27')]=_0x49dad9;if(_0x321bc9[_0x9af7('0x3d')][_0x9af7('0x4b')]){_0x312232['include']=[{'all':!![]}];}return db['SmsQueue'][_0x9af7('0x4c')](_0x312232);})[_0x9af7('0x2d')](function(_0x3f0f60){_0x2d01f2[_0x9af7('0x4d')]=_0x3f0f60;return _0x2d01f2;})[_0x9af7('0x2d')](respondWithFilteredResult(_0x2d2faf,_0x312232))[_0x9af7('0x4e')](handleError(_0x2d2faf,null));};exports[_0x9af7('0x4f')]=function(_0x33cc59,_0x3a45b3){var _0x5c2c3c={'raw':!![],'where':{'id':_0x33cc59[_0x9af7('0x50')]['id']}},_0x121c6c={};_0x121c6c[_0x9af7('0x39')]=_[_0x9af7('0x3b')](db['SmsQueue'][_0x9af7('0x35')]);_0x121c6c[_0x9af7('0x3d')]=_[_0x9af7('0x3b')](_0x33cc59[_0x9af7('0x3d')]);_0x121c6c[_0x9af7('0x3c')]=_[_0x9af7('0x51')](_0x121c6c[_0x9af7('0x39')],_0x121c6c['query']);_0x5c2c3c[_0x9af7('0x3f')]=_['intersection'](_0x121c6c[_0x9af7('0x39')],qs[_0x9af7('0x3e')](_0x33cc59[_0x9af7('0x3d')][_0x9af7('0x3e')]));_0x5c2c3c['attributes']=_0x5c2c3c[_0x9af7('0x3f')][_0x9af7('0x40')]?_0x5c2c3c['attributes']:_0x121c6c[_0x9af7('0x39')];if(_0x33cc59['query']['includeAll']){_0x5c2c3c[_0x9af7('0x52')]=[{'all':!![]}];}_0x5c2c3c=_[_0x9af7('0x48')]({},_0x5c2c3c,_0x33cc59['options']);return db['SmsQueue'][_0x9af7('0x53')](_0x5c2c3c)[_0x9af7('0x2d')](handleEntityNotFound(_0x3a45b3,null))[_0x9af7('0x2d')](respondWithResult(_0x3a45b3,null))['catch'](handleError(_0x3a45b3,null));};exports[_0x9af7('0x54')]=function(_0x300f55,_0x5678df){return db[_0x9af7('0x34')][_0x9af7('0x54')](_0x300f55[_0x9af7('0x55')],{})[_0x9af7('0x2d')](function(_0x20ea4c){var _0x267bf6=_0x300f55[_0x9af7('0x56')][_0x9af7('0x57')]({'plain':!![]});if(!_0x267bf6)throw new Error(_0x9af7('0x58'));if(_0x267bf6[_0x9af7('0x59')]===_0x9af7('0x56')){var _0x3e6998=_0x20ea4c['get']({'plain':!![]});var _0x143583=_0x9af7('0x2e');return db[_0x9af7('0x5a')][_0x9af7('0x53')]({'where':{'name':_0x143583,'userProfileId':_0x267bf6[_0x9af7('0x5b')]},'raw':!![]})[_0x9af7('0x2d')](function(_0x5c9efd){if(_0x5c9efd&&_0x5c9efd[_0x9af7('0x5c')]===0x0){return db[_0x9af7('0x2f')][_0x9af7('0x54')]({'name':_0x3e6998[_0x9af7('0x33')],'resourceId':_0x3e6998['id'],'type':_0x5c9efd['name'],'sectionId':_0x5c9efd['id']},{})[_0x9af7('0x2d')](function(){return _0x20ea4c;});}else{return _0x20ea4c;}})[_0x9af7('0x4e')](function(_0x1a2571){logger['error'](_0x9af7('0x5d'),_0x1a2571);throw _0x1a2571;});}return _0x20ea4c;})['then'](respondWithResult(_0x5678df,0xc9))['catch'](handleError(_0x5678df,null));};exports[_0x9af7('0x5e')]=function(_0x27eeaa,_0x157f27){if(_0x27eeaa[_0x9af7('0x55')]['id']){delete _0x27eeaa[_0x9af7('0x55')]['id'];}return db['SmsQueue'][_0x9af7('0x53')]({'where':{'id':_0x27eeaa[_0x9af7('0x50')]['id']}})[_0x9af7('0x2d')](handleEntityNotFound(_0x157f27,null))[_0x9af7('0x2d')](saveUpdates(_0x27eeaa['body'],null))[_0x9af7('0x2d')](respondWithResult(_0x157f27,null))['catch'](handleError(_0x157f27,null));};exports['destroy']=function(_0x3c830c,_0x33a0c2){return db[_0x9af7('0x34')][_0x9af7('0x53')]({'where':{'id':_0x3c830c[_0x9af7('0x50')]['id']}})[_0x9af7('0x2d')](handleEntityNotFound(_0x33a0c2,null))[_0x9af7('0x2d')](removeEntity(_0x33a0c2,null))[_0x9af7('0x4e')](handleError(_0x33a0c2,null));};exports[_0x9af7('0x5f')]=function(_0x131f8e,_0x41f4f5){return db[_0x9af7('0x34')][_0x9af7('0x5f')]()[_0x9af7('0x2d')](respondWithResult(_0x41f4f5,null))[_0x9af7('0x4e')](handleError(_0x41f4f5,null));};exports[_0x9af7('0x60')]=function(_0x2aac11,_0x3ae03d,_0x4fe591){var _0x38a4bf={'raw':!![],'where':{}},_0x4f8add={},_0x4add0a;return db[_0x9af7('0x34')][_0x9af7('0x61')]({'where':{'id':_0x2aac11[_0x9af7('0x50')]['id']}})['then'](handleEntityNotFound(_0x3ae03d,null))[_0x9af7('0x2d')](function(_0x2b18a9){if(_0x2b18a9){_0x4add0a=_0x2b18a9['get']({'plain':!![]});_0x4f8add['model']=_[_0x9af7('0x3b')](db[_0x9af7('0x62')]['rawAttributes']);_0x4f8add[_0x9af7('0x3d')]=_[_0x9af7('0x3b')](_0x2aac11[_0x9af7('0x3d')]);_0x4f8add[_0x9af7('0x3c')]=_[_0x9af7('0x51')](_0x4f8add['model'],_0x4f8add[_0x9af7('0x3d')]);_0x38a4bf[_0x9af7('0x3f')]=_[_0x9af7('0x51')](_0x4f8add[_0x9af7('0x39')],qs[_0x9af7('0x3e')](_0x2aac11['query'][_0x9af7('0x3e')]));_0x38a4bf['attributes']=_0x38a4bf[_0x9af7('0x3f')][_0x9af7('0x40')]?_0x38a4bf['attributes']:_0x4f8add['model'];if(!_0x2aac11[_0x9af7('0x3d')][_0x9af7('0x41')]('nolimit')){_0x38a4bf['limit']=qs['limit'](_0x2aac11['query'][_0x9af7('0x26')]);_0x38a4bf['offset']=qs[_0x9af7('0x24')](_0x2aac11[_0x9af7('0x3d')][_0x9af7('0x24')]);}_0x38a4bf[_0x9af7('0x43')]=qs['sort'](_0x2aac11[_0x9af7('0x3d')][_0x9af7('0x44')]);_0x38a4bf[_0x9af7('0x47')]=qs[_0x9af7('0x3c')](_[_0x9af7('0x45')](_0x2aac11[_0x9af7('0x3d')],_0x4f8add['filters']));_0x38a4bf['where'][_0x9af7('0x63')]=_0x2b18a9['id'];if(_0x2aac11['query']['filter']){_0x38a4bf[_0x9af7('0x47')]=_[_0x9af7('0x48')](_0x38a4bf[_0x9af7('0x47')],{'$or':_[_0x9af7('0x3a')](_0x38a4bf[_0x9af7('0x3f')],function(_0x33e0fa){var _0x575265={};_0x575265[_0x33e0fa]={'$like':'%'+_0x2aac11['query']['filter']+'%'};return _0x575265;})});}_0x38a4bf=_[_0x9af7('0x48')]({},_0x38a4bf,_0x2aac11['options']);return db[_0x9af7('0x62')]['findAll'](_0x38a4bf);}})[_0x9af7('0x2d')](function(_0x906e6){if(_0x906e6){return db[_0x9af7('0x64')][_0x9af7('0x65')]({'where':{'id':_[_0x9af7('0x3a')](_0x906e6,'UserId'),'role':'agent'},'attributes':['id','name',_0x9af7('0x66'),'updatedAt',_0x9af7('0x67')]});}})['then'](function(_0x12bc8c){if(_0x12bc8c){return{'count':_0x12bc8c['count'],'rows':_[_0x9af7('0x3a')](_0x12bc8c[_0x9af7('0x4d')],function(_0x5417a4){return{'membername':_0x5417a4[_0x9af7('0x33')],'UserId':_0x5417a4['id'],'queue_name':_0x4add0a[_0x9af7('0x33')],'SmsQueueId':_0x4add0a['id'],'interface':util[_0x9af7('0x68')](_0x9af7('0x69'),_0x9af7('0x6a'),_0x5417a4[_0x9af7('0x33')]),'penalty':0x0,'paused':_0x5417a4[_0x9af7('0x66')],'createdAt':_0x5417a4[_0x9af7('0x67')],'updatedAt':_0x5417a4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9af7('0x2d')](respondWithFilteredResult(_0x3ae03d,_0x38a4bf))[_0x9af7('0x4e')](handleError(_0x3ae03d,null));};exports[_0x9af7('0x6b')]=function(_0x38b93d,_0x42f254,_0xe4371c){var _0x76fbb6={};var _0x429411={};var _0x51ec94;var _0x360835;return db[_0x9af7('0x34')][_0x9af7('0x61')]({'where':{'id':_0x38b93d[_0x9af7('0x50')]['id']}})[_0x9af7('0x2d')](handleEntityNotFound(_0x42f254,null))[_0x9af7('0x2d')](function(_0x9cfcb7){if(_0x9cfcb7){_0x51ec94=_0x9cfcb7;_0x429411[_0x9af7('0x39')]=_[_0x9af7('0x3b')](db[_0x9af7('0x6c')][_0x9af7('0x35')]);_0x429411['query']=_[_0x9af7('0x3b')](_0x38b93d[_0x9af7('0x3d')]);_0x429411[_0x9af7('0x3c')]=_['intersection'](_0x429411[_0x9af7('0x39')],_0x429411[_0x9af7('0x3d')]);_0x76fbb6[_0x9af7('0x3f')]=_[_0x9af7('0x51')](_0x429411[_0x9af7('0x39')],qs[_0x9af7('0x3e')](_0x38b93d[_0x9af7('0x3d')][_0x9af7('0x3e')]));_0x76fbb6[_0x9af7('0x3f')]=_0x76fbb6[_0x9af7('0x3f')][_0x9af7('0x40')]?_0x76fbb6[_0x9af7('0x3f')]:_0x429411[_0x9af7('0x39')];_0x76fbb6[_0x9af7('0x43')]=qs[_0x9af7('0x44')](_0x38b93d['query']['sort']);_0x76fbb6['where']=qs[_0x9af7('0x3c')](_['pick'](_0x38b93d['query'],_0x429411[_0x9af7('0x3c')]));if(_0x38b93d[_0x9af7('0x3d')]['filter']){_0x76fbb6[_0x9af7('0x47')]=_['merge'](_0x76fbb6['where'],{'$or':_[_0x9af7('0x3a')](_0x76fbb6['attributes'],function(_0x23be37){var _0x38f28f={};_0x38f28f[_0x23be37]={'$like':'%'+_0x38b93d[_0x9af7('0x3d')][_0x9af7('0x46')]+'%'};return _0x38f28f;})});}_0x76fbb6=_[_0x9af7('0x48')]({},_0x76fbb6,_0x38b93d[_0x9af7('0x4a')]);return _0x51ec94[_0x9af7('0x6b')](_0x76fbb6);}})[_0x9af7('0x2d')](function(_0x607599){if(_0x607599){_0x360835=_0x607599[_0x9af7('0x40')];if(!_0x38b93d['query'][_0x9af7('0x41')](_0x9af7('0x42'))){_0x76fbb6['limit']=qs[_0x9af7('0x26')](_0x38b93d['query'][_0x9af7('0x26')]);_0x76fbb6[_0x9af7('0x24')]=qs[_0x9af7('0x24')](_0x38b93d[_0x9af7('0x3d')][_0x9af7('0x24')]);}return _0x51ec94[_0x9af7('0x6b')](_0x76fbb6);}})[_0x9af7('0x2d')](function(_0x22f694){if(_0x22f694){return _0x22f694?{'count':_0x360835,'rows':_0x22f694}:null;}})[_0x9af7('0x2d')](respondWithResult(_0x42f254,null))[_0x9af7('0x4e')](handleError(_0x42f254,null));};exports[_0x9af7('0x6d')]=function(_0x3d6b84,_0x4054d1,_0x14a446){var _0x7b8658=_0x3d6b84[_0x9af7('0x55')][_0x9af7('0x6e')];return db[_0x9af7('0x6c')][_0x9af7('0x4c')]({'where':{'id':_0x7b8658},'attributes':['id'],'include':[{'model':db[_0x9af7('0x64')],'as':_0x9af7('0x6f'),'attributes':['id',_0x9af7('0x33'),_0x9af7('0x70'),_0x9af7('0x71'),_0x9af7('0x72')],'raw':!![]}]})['then'](function(_0x3098dd){if(_0x3098dd){var _0x2bc9c1=_['flatMap'](_0x3098dd,function(_0x2ee20b){var _0x134c7c=_0x2ee20b[_0x9af7('0x57')]({'plain':!![]});return _0x134c7c[_0x9af7('0x6f')];});return db[_0x9af7('0x34')][_0x9af7('0x53')]({'where':{'id':_0x3d6b84['params']['id']}})['then'](function(_0x6cadaa){return db[_0x9af7('0x73')]['transaction'](function(_0x376b40){return _0x6cadaa[_0x9af7('0x6d')](_0x7b8658,{'transaction':_0x376b40})['then'](function(){return BPromise[_0x9af7('0x74')](_0x2bc9c1,function(_0x59c441){return db[_0x9af7('0x62')][_0x9af7('0x75')]({'where':{'UserId':_0x59c441['id'],'SmsQueueId':_0x3d6b84['params']['id']},'transaction':_0x376b40});});})['then'](function(){_0x2bc9c1[_0x9af7('0x76')](function(_0x303355){socket[_0x9af7('0x77')]('userSmsQueue:save',{'UserId':_0x303355['id'],'SmsQueueId':_0x6cadaa['id']});});});});});}})[_0x9af7('0x2d')](respondWithStatusCode(_0x4054d1,null))[_0x9af7('0x4e')](handleError(_0x4054d1,null));};exports[_0x9af7('0x78')]=function(_0xaffc38,_0x2532ea,_0x45083f){return db[_0x9af7('0x6c')][_0x9af7('0x4c')]({'where':{'id':_0xaffc38[_0x9af7('0x3d')][_0x9af7('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x9af7('0x64')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9af7('0x2d')](handleEntityNotFound(_0x2532ea,null))[_0x9af7('0x2d')](function(_0xe3450a){var _0x11c480=_[_0x9af7('0x3a')](_0xe3450a,'id');var _0x150eea=[];var _0x151405=[];var _0x5368ca=squel[_0x9af7('0x79')]();_0x5368ca[_0x9af7('0x7a')](_0x9af7('0x7b'))[_0x9af7('0x7c')](_0x9af7('0x7d'),'tq')[_0x9af7('0x7e')](_0x9af7('0x7f'),'ut',_0x9af7('0x80'))[_0x9af7('0x47')]('SmsQueueId\x20=\x20?',_0xaffc38[_0x9af7('0x50')]['id']);for(var _0x276611=0x0;_0x276611<_0xe3450a[_0x9af7('0x40')];_0x276611+=0x1){let _0x25b7f1=_0xe3450a[_0x276611];for(var _0x10b248=0x0;_0x10b248<_0x25b7f1['Agents'][_0x9af7('0x40')];_0x10b248+=0x1){let _0x2eebeb=_0x25b7f1[_0x9af7('0x6f')][_0x10b248];var _0x198f2f=_0x5368ca[_0x9af7('0x81')]();_0x198f2f[_0x9af7('0x47')](_0x9af7('0x82'),_0x2eebeb['id']);_0x151405['push'](db[_0x9af7('0x73')][_0x9af7('0x3d')](_0x198f2f['toString'](),{'type':db[_0x9af7('0x73')][_0x9af7('0x83')][_0x9af7('0x84')]})[_0x9af7('0x2d')](function(_0x3fe053){if(_0x3fe053[_0x9af7('0x40')]===0x1){return _0x2eebeb['id'];}else{var _0x2d60d4=_[_0x9af7('0x85')](_[_0x9af7('0x3a')](_0x3fe053,_0x9af7('0x86')),function(_0x200e78){return _[_0x9af7('0x87')](_0x11c480,_0x200e78);});if(_0x2d60d4){return _0x2eebeb['id'];}}}));}}return BPromise[_0x9af7('0x88')](_0x151405)['then'](function(_0x308c3c){_0x150eea=_(_0x150eea)[_0x9af7('0x89')](_0x308c3c)[_0x9af7('0x8a')]()['value']();return db[_0x9af7('0x34')][_0x9af7('0x53')]({'where':{'id':_0xaffc38['params']['id']}})[_0x9af7('0x2d')](function(_0x52f499){return db[_0x9af7('0x73')]['transaction'](function(_0x10c1e8){return _0x52f499[_0x9af7('0x78')](_0xaffc38[_0x9af7('0x3d')][_0x9af7('0x6e')],{'transaction':_0x10c1e8})[_0x9af7('0x2d')](function(){if(!_[_0x9af7('0x8b')](_0x150eea)){return _0x52f499[_0x9af7('0x8c')](_0x150eea,{'transaction':_0x10c1e8});}})[_0x9af7('0x2d')](function(){_0x150eea[_0x9af7('0x76')](function(_0xd20af8){socket[_0x9af7('0x77')](_0x9af7('0x8d'),{'UserId':_0xd20af8,'SmsQueueId':_0x52f499['id']});});});});});});})[_0x9af7('0x2d')](respondWithStatusCode(_0x2532ea,null))[_0x9af7('0x4e')](handleError(_0x2532ea,null));};exports[_0x9af7('0x8e')]=function(_0x40def7,_0x76276b,_0xb9bc18){return db[_0x9af7('0x34')][_0x9af7('0x53')]({'where':{'id':_0x40def7[_0x9af7('0x50')]['id']}})[_0x9af7('0x2d')](handleEntityNotFound(_0x76276b,null))[_0x9af7('0x2d')](function(_0x536d64){if(_0x536d64){return _0x536d64[_0x9af7('0x8e')](_0x40def7[_0x9af7('0x55')]['ids'],_['omit'](_0x40def7[_0x9af7('0x55')],[_0x9af7('0x6e'),'id'])||{})[_0x9af7('0x8f')](function(_0xdd0b43){for(var _0x174812=0x0;_0x174812<_0x40def7[_0x9af7('0x55')]['ids'][_0x9af7('0x40')];_0x174812+=0x1){socket['emit'](_0x9af7('0x90'),{'UserId':Number(_0x40def7[_0x9af7('0x55')]['ids'][_0x174812]),'SmsQueueId':Number(_0x40def7[_0x9af7('0x50')]['id'])});}return _0xdd0b43;});}})[_0x9af7('0x2d')](respondWithResult(_0x76276b,null))[_0x9af7('0x4e')](handleError(_0x76276b,null));};exports[_0x9af7('0x8c')]=function(_0x198e30,_0x584b9f,_0x55002a){return db[_0x9af7('0x34')][_0x9af7('0x53')]({'where':{'id':_0x198e30['params']['id']}})[_0x9af7('0x2d')](handleEntityNotFound(_0x584b9f,null))[_0x9af7('0x2d')](function(_0x3ba3e9){if(_0x3ba3e9){return _0x3ba3e9[_0x9af7('0x8c')](_0x198e30[_0x9af7('0x3d')][_0x9af7('0x6e')])[_0x9af7('0x2d')](function(){if(_[_0x9af7('0x91')](_0x198e30[_0x9af7('0x3d')][_0x9af7('0x6e')])){for(var _0x22e263=0x0;_0x22e263<_0x198e30[_0x9af7('0x3d')][_0x9af7('0x6e')][_0x9af7('0x40')];_0x22e263+=0x1){socket['emit'](_0x9af7('0x8d'),{'UserId':Number(_0x198e30[_0x9af7('0x3d')][_0x9af7('0x6e')][_0x22e263]),'SmsQueueId':Number(_0x198e30[_0x9af7('0x50')]['id'])});}}else{socket['emit'](_0x9af7('0x8d'),{'UserId':Number(_0x198e30[_0x9af7('0x3d')]['ids']),'SmsQueueId':Number(_0x198e30[_0x9af7('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x584b9f,null))['catch'](handleError(_0x584b9f,null));};exports['getAgents']=function(_0x2006a7,_0x787ede,_0x190f93){var _0x188fdf={};var _0x1857cc={};var _0x135f8d;var _0x47c60e;return db['SmsQueue']['findOne']({'where':{'id':_0x2006a7['params']['id']}})[_0x9af7('0x2d')](handleEntityNotFound(_0x787ede,null))[_0x9af7('0x2d')](function(_0x5d2644){if(_0x5d2644){_0x135f8d=_0x5d2644;_0x1857cc[_0x9af7('0x39')]=_[_0x9af7('0x3b')](db[_0x9af7('0x64')][_0x9af7('0x35')]);_0x1857cc[_0x9af7('0x3d')]=_['keys'](_0x2006a7[_0x9af7('0x3d')]);_0x1857cc[_0x9af7('0x3c')]=_[_0x9af7('0x51')](_0x1857cc['model'],_0x1857cc[_0x9af7('0x3d')]);_0x188fdf[_0x9af7('0x3f')]=_[_0x9af7('0x51')](_0x1857cc[_0x9af7('0x39')],qs[_0x9af7('0x3e')](_0x2006a7[_0x9af7('0x3d')][_0x9af7('0x3e')]));_0x188fdf['attributes']=_0x188fdf[_0x9af7('0x3f')][_0x9af7('0x40')]?_0x188fdf['attributes']:_0x1857cc[_0x9af7('0x39')];_0x188fdf[_0x9af7('0x43')]=qs['sort'](_0x2006a7[_0x9af7('0x3d')][_0x9af7('0x44')]);_0x188fdf[_0x9af7('0x47')]=qs[_0x9af7('0x3c')](_[_0x9af7('0x45')](_0x2006a7['query'],_0x1857cc[_0x9af7('0x3c')]));if(_0x2006a7['query'][_0x9af7('0x46')]){_0x188fdf[_0x9af7('0x47')]=_['merge'](_0x188fdf[_0x9af7('0x47')],{'$or':_['map'](_0x188fdf[_0x9af7('0x3f')],function(_0x804686){var _0x42bdeb={};_0x42bdeb[_0x804686]={'$like':'%'+_0x2006a7['query']['filter']+'%'};return _0x42bdeb;})});}_0x188fdf=_[_0x9af7('0x48')]({},_0x188fdf,_0x2006a7[_0x9af7('0x4a')]);return _0x135f8d[_0x9af7('0x92')](_0x188fdf);}})[_0x9af7('0x2d')](function(_0x4650a2){if(_0x4650a2){_0x47c60e=_0x4650a2[_0x9af7('0x40')];if(!_0x2006a7['query'][_0x9af7('0x41')](_0x9af7('0x42'))){_0x188fdf['limit']=qs['limit'](_0x2006a7[_0x9af7('0x3d')][_0x9af7('0x26')]);_0x188fdf[_0x9af7('0x24')]=qs[_0x9af7('0x24')](_0x2006a7['query'][_0x9af7('0x24')]);}return _0x135f8d['getAgents'](_0x188fdf);}})[_0x9af7('0x2d')](function(_0x585557){if(_0x585557){return _0x585557?{'count':_0x47c60e,'rows':_0x585557}:null;}})['then'](respondWithResult(_0x787ede,null))[_0x9af7('0x4e')](handleError(_0x787ede,null));}; \ No newline at end of file +var _0xa44c=['../../config/license/util','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','get','end','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsQueues','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserSmsQueue','SmsQueueId','User','UserId','agent','smsPause','createdAt','format','SIP','getTeams','findOne','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','all','compact','value','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x540315,_0x5e4286){var _0x45b752=function(_0x42f23e){while(--_0x42f23e){_0x540315['push'](_0x540315['shift']());}};_0x45b752(++_0x5e4286);}(_0xa44c,0x18d));var _0xca44=function(_0x1c088e,_0x1f269c){_0x1c088e=_0x1c088e-0x0;var _0x4f15fe=_0xa44c[_0x1c088e];return _0x4f15fe;};'use strict';var emlformat=require(_0xca44('0x0'));var rimraf=require(_0xca44('0x1'));var zipdir=require(_0xca44('0x2'));var jsonpatch=require(_0xca44('0x3'));var rp=require(_0xca44('0x4'));var moment=require('moment');var BPromise=require(_0xca44('0x5'));var Mustache=require(_0xca44('0x6'));var util=require(_0xca44('0x7'));var path=require(_0xca44('0x8'));var sox=require('sox');var csv=require(_0xca44('0x9'));var ejs=require(_0xca44('0xa'));var fs=require('fs');var fs_extra=require(_0xca44('0xb'));var _=require('lodash');var squel=require(_0xca44('0xc'));var crypto=require(_0xca44('0xd'));var jsforce=require(_0xca44('0xe'));var deskjs=require(_0xca44('0xf'));var toCsv=require(_0xca44('0x9'));var querystring=require(_0xca44('0x10'));var Papa=require(_0xca44('0x11'));var Redis=require(_0xca44('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xca44('0x13'));var as=require(_0xca44('0x14'));var hardwareService=require(_0xca44('0x15'));var logger=require(_0xca44('0x16'))(_0xca44('0x17'));var utils=require(_0xca44('0x18'));var config=require(_0xca44('0x19'));var licenseUtil=require(_0xca44('0x1a'));var db=require('../../mysqldb')['db'];config[_0xca44('0x1b')]=_['defaults'](config[_0xca44('0x1b')],{'host':_0xca44('0x1c'),'port':0x18eb});var socket=require(_0xca44('0x1d'))(new Redis(config['redis']));require(_0xca44('0x1e'))[_0xca44('0x1f')](socket);function respondWithStatusCode(_0xf00ec7,_0x16cde5){_0x16cde5=_0x16cde5||0xcc;return function(_0x29ba57){if(_0x29ba57){return _0xf00ec7[_0xca44('0x20')](_0x16cde5);}return _0xf00ec7[_0xca44('0x21')](_0x16cde5)['end']();};}function respondWithResult(_0x2c765b,_0x2efb34){_0x2efb34=_0x2efb34||0xc8;return function(_0x412fe9){if(_0x412fe9){return _0x2c765b[_0xca44('0x21')](_0x2efb34)[_0xca44('0x22')](_0x412fe9);}};}function respondWithFilteredResult(_0x46221c,_0x3180e8){return function(_0x53e8cc){if(_0x53e8cc){var _0x3fd19f=typeof _0x3180e8[_0xca44('0x23')]==='undefined'&&typeof _0x3180e8[_0xca44('0x24')]===_0xca44('0x25');var _0x3f5bb0=_0x53e8cc[_0xca44('0x26')];var _0x821639=_0x3fd19f?0x0:_0x3180e8['offset'];var _0x506472=_0x3fd19f?_0x53e8cc[_0xca44('0x26')]:_0x3180e8['offset']+_0x3180e8[_0xca44('0x24')];var _0x533781;if(_0x506472>=_0x3f5bb0){_0x506472=_0x3f5bb0;_0x533781=0xc8;}else{_0x533781=0xce;}_0x46221c['status'](_0x533781);return _0x46221c[_0xca44('0x27')](_0xca44('0x28'),_0x821639+'-'+_0x506472+'/'+_0x3f5bb0)[_0xca44('0x22')](_0x53e8cc);}return null;};}function patchUpdates(_0x1b78c8){return function(_0x104963){try{jsonpatch[_0xca44('0x29')](_0x104963,_0x1b78c8,!![]);}catch(_0x4e9c95){return BPromise['reject'](_0x4e9c95);}return _0x104963[_0xca44('0x2a')]();};}function saveUpdates(_0x18b06c,_0xb522bd){return function(_0x6e951a){if(_0x6e951a){return _0x6e951a[_0xca44('0x2b')](_0x18b06c)['then'](function(_0xee0574){return _0xee0574;});}return null;};}function removeEntity(_0x45eb27,_0x3612aa){return function(_0x4af227){if(_0x4af227){return _0x4af227[_0xca44('0x2c')]()[_0xca44('0x2d')](function(){var _0x3f8a71=_0x4af227[_0xca44('0x2e')]({'plain':!![]});var _0x294fe1='SmsQueues';return db['UserProfileResource'][_0xca44('0x2c')]({'where':{'type':_0x294fe1,'resourceId':_0x3f8a71['id']}})[_0xca44('0x2d')](function(){return _0x4af227;});})[_0xca44('0x2d')](function(){_0x45eb27[_0xca44('0x21')](0xcc)[_0xca44('0x2f')]();});}};}function handleEntityNotFound(_0x3513c6,_0x4d5fad){return function(_0x1e25dd){if(!_0x1e25dd){_0x3513c6[_0xca44('0x20')](0x194);}return _0x1e25dd;};}function handleError(_0x28f5e2,_0x229655){_0x229655=_0x229655||0x1f4;return function(_0x5137a9){logger[_0xca44('0x30')](_0x5137a9[_0xca44('0x31')]);if(_0x5137a9[_0xca44('0x32')]){delete _0x5137a9[_0xca44('0x32')];}_0x28f5e2['status'](_0x229655)[_0xca44('0x33')](_0x5137a9);};}exports[_0xca44('0x34')]=function(_0x91f3f3,_0x403775){var _0x1a7d6f={},_0x179cc1={},_0xacf921={'count':0x0,'rows':[]};var _0x21e862=_[_0xca44('0x35')](db[_0xca44('0x36')][_0xca44('0x37')],function(_0x4ad65a){return{'name':_0x4ad65a[_0xca44('0x38')],'type':_0x4ad65a['type']['key']};});_0x179cc1['model']=_['map'](_0x21e862,'name');_0x179cc1[_0xca44('0x39')]=_[_0xca44('0x3a')](_0x91f3f3[_0xca44('0x39')]);_0x179cc1['filters']=_[_0xca44('0x3b')](_0x179cc1[_0xca44('0x3c')],_0x179cc1[_0xca44('0x39')]);_0x1a7d6f[_0xca44('0x3d')]=_['intersection'](_0x179cc1[_0xca44('0x3c')],qs[_0xca44('0x3e')](_0x91f3f3[_0xca44('0x39')][_0xca44('0x3e')]));_0x1a7d6f[_0xca44('0x3d')]=_0x1a7d6f[_0xca44('0x3d')][_0xca44('0x3f')]?_0x1a7d6f[_0xca44('0x3d')]:_0x179cc1['model'];if(!_0x91f3f3['query'][_0xca44('0x40')](_0xca44('0x41'))){_0x1a7d6f[_0xca44('0x24')]=qs[_0xca44('0x24')](_0x91f3f3[_0xca44('0x39')]['limit']);_0x1a7d6f[_0xca44('0x23')]=qs[_0xca44('0x23')](_0x91f3f3[_0xca44('0x39')][_0xca44('0x23')]);}_0x1a7d6f[_0xca44('0x42')]=qs[_0xca44('0x43')](_0x91f3f3['query'][_0xca44('0x43')]);_0x1a7d6f[_0xca44('0x44')]=qs[_0xca44('0x45')](_[_0xca44('0x46')](_0x91f3f3[_0xca44('0x39')],_0x179cc1['filters']),_0x21e862);if(_0x91f3f3[_0xca44('0x39')]['filter']){_0x1a7d6f[_0xca44('0x44')]=_[_0xca44('0x47')](_0x1a7d6f[_0xca44('0x44')],{'$or':_['map'](_0x21e862,function(_0x3addaf){if(_0x3addaf[_0xca44('0x48')]!==_0xca44('0x49')){var _0x10b0d0={};_0x10b0d0[_0x3addaf[_0xca44('0x32')]]={'$like':'%'+_0x91f3f3[_0xca44('0x39')][_0xca44('0x4a')]+'%'};return _0x10b0d0;}})});}_0x1a7d6f=_[_0xca44('0x47')]({},_0x1a7d6f,_0x91f3f3[_0xca44('0x4b')]);var _0x56ee38={'where':_0x1a7d6f[_0xca44('0x44')]};return db[_0xca44('0x36')][_0xca44('0x26')](_0x56ee38)[_0xca44('0x2d')](function(_0x2de870){_0xacf921[_0xca44('0x26')]=_0x2de870;if(_0x91f3f3['query'][_0xca44('0x4c')]){_0x1a7d6f['include']=[{'all':!![]}];}return db[_0xca44('0x36')][_0xca44('0x4d')](_0x1a7d6f);})[_0xca44('0x2d')](function(_0x87974f){_0xacf921[_0xca44('0x4e')]=_0x87974f;return _0xacf921;})['then'](respondWithFilteredResult(_0x403775,_0x1a7d6f))[_0xca44('0x4f')](handleError(_0x403775,null));};exports[_0xca44('0x50')]=function(_0xd40472,_0x45ed85){var _0x3cf2e3={'raw':!![],'where':{'id':_0xd40472[_0xca44('0x51')]['id']}},_0x354d7c={};_0x354d7c['model']=_['keys'](db[_0xca44('0x36')][_0xca44('0x37')]);_0x354d7c[_0xca44('0x39')]=_[_0xca44('0x3a')](_0xd40472[_0xca44('0x39')]);_0x354d7c['filters']=_[_0xca44('0x3b')](_0x354d7c[_0xca44('0x3c')],_0x354d7c['query']);_0x3cf2e3['attributes']=_[_0xca44('0x3b')](_0x354d7c[_0xca44('0x3c')],qs[_0xca44('0x3e')](_0xd40472[_0xca44('0x39')][_0xca44('0x3e')]));_0x3cf2e3[_0xca44('0x3d')]=_0x3cf2e3[_0xca44('0x3d')]['length']?_0x3cf2e3[_0xca44('0x3d')]:_0x354d7c[_0xca44('0x3c')];if(_0xd40472[_0xca44('0x39')][_0xca44('0x4c')]){_0x3cf2e3[_0xca44('0x52')]=[{'all':!![]}];}_0x3cf2e3=_[_0xca44('0x47')]({},_0x3cf2e3,_0xd40472[_0xca44('0x4b')]);return db[_0xca44('0x36')][_0xca44('0x53')](_0x3cf2e3)['then'](handleEntityNotFound(_0x45ed85,null))[_0xca44('0x2d')](respondWithResult(_0x45ed85,null))[_0xca44('0x4f')](handleError(_0x45ed85,null));};exports['create']=function(_0x141db7,_0x3a9cb2){return db[_0xca44('0x36')]['create'](_0x141db7[_0xca44('0x54')],{})[_0xca44('0x2d')](function(_0x5908dd){var _0x52e680=_0x141db7[_0xca44('0x55')][_0xca44('0x2e')]({'plain':!![]});if(!_0x52e680)throw new Error(_0xca44('0x56'));if(_0x52e680['role']===_0xca44('0x55')){var _0x188e5f=_0x5908dd['get']({'plain':!![]});var _0x2ef4e8=_0xca44('0x57');return db['UserProfileSection']['find']({'where':{'name':_0x2ef4e8,'userProfileId':_0x52e680['userProfileId']},'raw':!![]})[_0xca44('0x2d')](function(_0x287126){if(_0x287126&&_0x287126['autoAssociation']===0x0){return db[_0xca44('0x58')][_0xca44('0x59')]({'name':_0x188e5f['name'],'resourceId':_0x188e5f['id'],'type':_0x287126[_0xca44('0x32')],'sectionId':_0x287126['id']},{})[_0xca44('0x2d')](function(){return _0x5908dd;});}else{return _0x5908dd;}})[_0xca44('0x4f')](function(_0x4ba2a3){logger['error'](_0xca44('0x5a'),_0x4ba2a3);throw _0x4ba2a3;});}return _0x5908dd;})[_0xca44('0x2d')](respondWithResult(_0x3a9cb2,0xc9))[_0xca44('0x4f')](handleError(_0x3a9cb2,null));};exports['update']=function(_0x421a04,_0xd9829b){if(_0x421a04[_0xca44('0x54')]['id']){delete _0x421a04[_0xca44('0x54')]['id'];}return db[_0xca44('0x36')][_0xca44('0x53')]({'where':{'id':_0x421a04[_0xca44('0x51')]['id']}})['then'](handleEntityNotFound(_0xd9829b,null))[_0xca44('0x2d')](saveUpdates(_0x421a04[_0xca44('0x54')],null))['then'](respondWithResult(_0xd9829b,null))['catch'](handleError(_0xd9829b,null));};exports[_0xca44('0x2c')]=function(_0x3e6871,_0x5aabae){return db[_0xca44('0x36')][_0xca44('0x53')]({'where':{'id':_0x3e6871[_0xca44('0x51')]['id']}})[_0xca44('0x2d')](handleEntityNotFound(_0x5aabae,null))[_0xca44('0x2d')](removeEntity(_0x5aabae,null))[_0xca44('0x4f')](handleError(_0x5aabae,null));};exports[_0xca44('0x5b')]=function(_0x5233f0,_0x9764cc){return db['SmsQueue']['describe']()[_0xca44('0x2d')](respondWithResult(_0x9764cc,null))['catch'](handleError(_0x9764cc,null));};exports[_0xca44('0x5c')]=function(_0x3a79c7,_0x33f989,_0x543e1d){var _0x2fa9b1={'raw':!![],'where':{}},_0x19af23={},_0x34bdc1;return db[_0xca44('0x36')]['findOne']({'where':{'id':_0x3a79c7[_0xca44('0x51')]['id']}})['then'](handleEntityNotFound(_0x33f989,null))['then'](function(_0x569e59){if(_0x569e59){_0x34bdc1=_0x569e59['get']({'plain':!![]});_0x19af23[_0xca44('0x3c')]=_['keys'](db[_0xca44('0x5d')]['rawAttributes']);_0x19af23[_0xca44('0x39')]=_[_0xca44('0x3a')](_0x3a79c7[_0xca44('0x39')]);_0x19af23[_0xca44('0x45')]=_[_0xca44('0x3b')](_0x19af23[_0xca44('0x3c')],_0x19af23['query']);_0x2fa9b1[_0xca44('0x3d')]=_[_0xca44('0x3b')](_0x19af23[_0xca44('0x3c')],qs[_0xca44('0x3e')](_0x3a79c7['query'][_0xca44('0x3e')]));_0x2fa9b1[_0xca44('0x3d')]=_0x2fa9b1[_0xca44('0x3d')][_0xca44('0x3f')]?_0x2fa9b1['attributes']:_0x19af23[_0xca44('0x3c')];if(!_0x3a79c7[_0xca44('0x39')]['hasOwnProperty'](_0xca44('0x41'))){_0x2fa9b1[_0xca44('0x24')]=qs[_0xca44('0x24')](_0x3a79c7[_0xca44('0x39')]['limit']);_0x2fa9b1['offset']=qs[_0xca44('0x23')](_0x3a79c7[_0xca44('0x39')][_0xca44('0x23')]);}_0x2fa9b1[_0xca44('0x42')]=qs[_0xca44('0x43')](_0x3a79c7[_0xca44('0x39')]['sort']);_0x2fa9b1[_0xca44('0x44')]=qs[_0xca44('0x45')](_[_0xca44('0x46')](_0x3a79c7['query'],_0x19af23[_0xca44('0x45')]));_0x2fa9b1[_0xca44('0x44')][_0xca44('0x5e')]=_0x569e59['id'];if(_0x3a79c7[_0xca44('0x39')]['filter']){_0x2fa9b1[_0xca44('0x44')]=_[_0xca44('0x47')](_0x2fa9b1['where'],{'$or':_['map'](_0x2fa9b1[_0xca44('0x3d')],function(_0x3b3796){var _0x3a4fe2={};_0x3a4fe2[_0x3b3796]={'$like':'%'+_0x3a79c7[_0xca44('0x39')][_0xca44('0x4a')]+'%'};return _0x3a4fe2;})});}_0x2fa9b1=_[_0xca44('0x47')]({},_0x2fa9b1,_0x3a79c7[_0xca44('0x4b')]);return db['UserSmsQueue'][_0xca44('0x4d')](_0x2fa9b1);}})[_0xca44('0x2d')](function(_0x1c99da){if(_0x1c99da){return db[_0xca44('0x5f')]['findAndCountAll']({'where':{'id':_[_0xca44('0x35')](_0x1c99da,_0xca44('0x60')),'role':_0xca44('0x61')},'attributes':['id',_0xca44('0x32'),_0xca44('0x62'),'updatedAt',_0xca44('0x63')]});}})[_0xca44('0x2d')](function(_0x3fad34){if(_0x3fad34){return{'count':_0x3fad34[_0xca44('0x26')],'rows':_[_0xca44('0x35')](_0x3fad34['rows'],function(_0x16e1c4){return{'membername':_0x16e1c4[_0xca44('0x32')],'UserId':_0x16e1c4['id'],'queue_name':_0x34bdc1['name'],'SmsQueueId':_0x34bdc1['id'],'interface':util[_0xca44('0x64')]('%s/%s',_0xca44('0x65'),_0x16e1c4[_0xca44('0x32')]),'penalty':0x0,'paused':_0x16e1c4[_0xca44('0x62')],'createdAt':_0x16e1c4['createdAt'],'updatedAt':_0x16e1c4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xca44('0x2d')](respondWithFilteredResult(_0x33f989,_0x2fa9b1))[_0xca44('0x4f')](handleError(_0x33f989,null));};exports[_0xca44('0x66')]=function(_0xe41152,_0x230bfd,_0x14091f){var _0x39ac41={};var _0xd9323b={};var _0xbeb2ab;var _0xf51ff3;return db[_0xca44('0x36')][_0xca44('0x67')]({'where':{'id':_0xe41152[_0xca44('0x51')]['id']}})[_0xca44('0x2d')](handleEntityNotFound(_0x230bfd,null))[_0xca44('0x2d')](function(_0x45db7e){if(_0x45db7e){_0xbeb2ab=_0x45db7e;_0xd9323b[_0xca44('0x3c')]=_['keys'](db['Team'][_0xca44('0x37')]);_0xd9323b[_0xca44('0x39')]=_[_0xca44('0x3a')](_0xe41152['query']);_0xd9323b['filters']=_[_0xca44('0x3b')](_0xd9323b['model'],_0xd9323b[_0xca44('0x39')]);_0x39ac41['attributes']=_[_0xca44('0x3b')](_0xd9323b[_0xca44('0x3c')],qs['fields'](_0xe41152[_0xca44('0x39')][_0xca44('0x3e')]));_0x39ac41[_0xca44('0x3d')]=_0x39ac41[_0xca44('0x3d')][_0xca44('0x3f')]?_0x39ac41['attributes']:_0xd9323b['model'];_0x39ac41[_0xca44('0x42')]=qs[_0xca44('0x43')](_0xe41152['query'][_0xca44('0x43')]);_0x39ac41[_0xca44('0x44')]=qs[_0xca44('0x45')](_[_0xca44('0x46')](_0xe41152[_0xca44('0x39')],_0xd9323b[_0xca44('0x45')]));if(_0xe41152[_0xca44('0x39')][_0xca44('0x4a')]){_0x39ac41[_0xca44('0x44')]=_[_0xca44('0x47')](_0x39ac41[_0xca44('0x44')],{'$or':_['map'](_0x39ac41[_0xca44('0x3d')],function(_0x3537c7){var _0x2345c4={};_0x2345c4[_0x3537c7]={'$like':'%'+_0xe41152[_0xca44('0x39')][_0xca44('0x4a')]+'%'};return _0x2345c4;})});}_0x39ac41=_[_0xca44('0x47')]({},_0x39ac41,_0xe41152['options']);return _0xbeb2ab['getTeams'](_0x39ac41);}})['then'](function(_0x22dd8a){if(_0x22dd8a){_0xf51ff3=_0x22dd8a[_0xca44('0x3f')];if(!_0xe41152[_0xca44('0x39')][_0xca44('0x40')](_0xca44('0x41'))){_0x39ac41[_0xca44('0x24')]=qs[_0xca44('0x24')](_0xe41152['query'][_0xca44('0x24')]);_0x39ac41[_0xca44('0x23')]=qs[_0xca44('0x23')](_0xe41152[_0xca44('0x39')][_0xca44('0x23')]);}return _0xbeb2ab[_0xca44('0x66')](_0x39ac41);}})[_0xca44('0x2d')](function(_0x377c9d){if(_0x377c9d){return _0x377c9d?{'count':_0xf51ff3,'rows':_0x377c9d}:null;}})['then'](respondWithResult(_0x230bfd,null))[_0xca44('0x4f')](handleError(_0x230bfd,null));};exports['addTeams']=function(_0x4514c9,_0x38273d,_0x207fb1){var _0x551180=_0x4514c9[_0xca44('0x54')][_0xca44('0x68')];return db[_0xca44('0x69')][_0xca44('0x4d')]({'where':{'id':_0x551180},'attributes':['id'],'include':[{'model':db['User'],'as':_0xca44('0x6a'),'attributes':['id',_0xca44('0x32'),_0xca44('0x6b'),_0xca44('0x6c'),_0xca44('0x6d')],'raw':!![]}]})[_0xca44('0x2d')](function(_0x3b3974){if(_0x3b3974){var _0x2d9212=_[_0xca44('0x6e')](_0x3b3974,function(_0x551742){var _0x5927a0=_0x551742[_0xca44('0x2e')]({'plain':!![]});return _0x5927a0[_0xca44('0x6a')];});return db[_0xca44('0x36')][_0xca44('0x53')]({'where':{'id':_0x4514c9[_0xca44('0x51')]['id']}})[_0xca44('0x2d')](function(_0x4e2166){return db[_0xca44('0x6f')][_0xca44('0x70')](function(_0x3f1435){return _0x4e2166[_0xca44('0x71')](_0x551180,{'transaction':_0x3f1435})[_0xca44('0x2d')](function(){return BPromise['each'](_0x2d9212,function(_0x22d340){return db[_0xca44('0x5d')][_0xca44('0x72')]({'where':{'UserId':_0x22d340['id'],'SmsQueueId':_0x4514c9[_0xca44('0x51')]['id']},'transaction':_0x3f1435});});})['then'](function(){_0x2d9212['forEach'](function(_0x20811f){socket[_0xca44('0x73')](_0xca44('0x74'),{'UserId':_0x20811f['id'],'SmsQueueId':_0x4e2166['id']});});});});});}})['then'](respondWithStatusCode(_0x38273d,null))['catch'](handleError(_0x38273d,null));};exports[_0xca44('0x75')]=function(_0x403b2e,_0x412845,_0x50e478){return db[_0xca44('0x69')][_0xca44('0x4d')]({'where':{'id':_0x403b2e[_0xca44('0x39')][_0xca44('0x68')]},'attributes':['id'],'include':[{'model':db[_0xca44('0x5f')],'as':_0xca44('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x412845,null))[_0xca44('0x2d')](function(_0x49d390){var _0x120f57=_[_0xca44('0x35')](_0x49d390,'id');var _0x56196d=[];var _0x280d2f=[];var _0x15ce17=squel[_0xca44('0x76')]();_0x15ce17[_0xca44('0x77')](_0xca44('0x78'))[_0xca44('0x79')](_0xca44('0x7a'),'tq')[_0xca44('0x7b')](_0xca44('0x7c'),'ut',_0xca44('0x7d'))['where'](_0xca44('0x7e'),_0x403b2e[_0xca44('0x51')]['id']);for(var _0x4b70b3=0x0;_0x4b70b3<_0x49d390[_0xca44('0x3f')];_0x4b70b3+=0x1){let _0x5b751e=_0x49d390[_0x4b70b3];for(var _0x159161=0x0;_0x159161<_0x5b751e['Agents']['length'];_0x159161+=0x1){let _0x4385b6=_0x5b751e[_0xca44('0x6a')][_0x159161];var _0x47a1d0=_0x15ce17[_0xca44('0x7f')]();_0x47a1d0[_0xca44('0x44')](_0xca44('0x80'),_0x4385b6['id']);_0x280d2f[_0xca44('0x81')](db[_0xca44('0x6f')]['query'](_0x47a1d0['toString'](),{'type':db['sequelize'][_0xca44('0x82')]['SELECT']})[_0xca44('0x2d')](function(_0x299971){if(_0x299971[_0xca44('0x3f')]===0x1){return _0x4385b6['id'];}else{var _0x20ac37=_['every'](_[_0xca44('0x35')](_0x299971,'TeamId'),function(_0x427186){return _['includes'](_0x120f57,_0x427186);});if(_0x20ac37){return _0x4385b6['id'];}}}));}}return BPromise[_0xca44('0x83')](_0x280d2f)[_0xca44('0x2d')](function(_0x304c09){_0x56196d=_(_0x56196d)['union'](_0x304c09)[_0xca44('0x84')]()[_0xca44('0x85')]();return db['SmsQueue'][_0xca44('0x53')]({'where':{'id':_0x403b2e[_0xca44('0x51')]['id']}})[_0xca44('0x2d')](function(_0x55da19){return db[_0xca44('0x6f')][_0xca44('0x70')](function(_0x212f7f){return _0x55da19[_0xca44('0x75')](_0x403b2e[_0xca44('0x39')][_0xca44('0x68')],{'transaction':_0x212f7f})[_0xca44('0x2d')](function(){if(!_['isEmpty'](_0x56196d)){return _0x55da19['removeAgents'](_0x56196d,{'transaction':_0x212f7f});}})['then'](function(){_0x56196d['forEach'](function(_0x632b1f){socket[_0xca44('0x73')](_0xca44('0x86'),{'UserId':_0x632b1f,'SmsQueueId':_0x55da19['id']});});});});});});})[_0xca44('0x2d')](respondWithStatusCode(_0x412845,null))[_0xca44('0x4f')](handleError(_0x412845,null));};exports[_0xca44('0x87')]=function(_0x3cdcf8,_0x46a44c,_0x395cd1){return db[_0xca44('0x36')][_0xca44('0x53')]({'where':{'id':_0x3cdcf8[_0xca44('0x51')]['id']}})[_0xca44('0x2d')](handleEntityNotFound(_0x46a44c,null))['then'](function(_0x47466b){if(_0x47466b){return _0x47466b[_0xca44('0x87')](_0x3cdcf8[_0xca44('0x54')][_0xca44('0x68')],_[_0xca44('0x88')](_0x3cdcf8[_0xca44('0x54')],[_0xca44('0x68'),'id'])||{})[_0xca44('0x89')](function(_0xddb5b6){for(var _0x3496fc=0x0;_0x3496fc<_0x3cdcf8[_0xca44('0x54')][_0xca44('0x68')]['length'];_0x3496fc+=0x1){socket[_0xca44('0x73')](_0xca44('0x74'),{'UserId':Number(_0x3cdcf8[_0xca44('0x54')]['ids'][_0x3496fc]),'SmsQueueId':Number(_0x3cdcf8[_0xca44('0x51')]['id'])});}return _0xddb5b6;});}})[_0xca44('0x2d')](respondWithResult(_0x46a44c,null))[_0xca44('0x4f')](handleError(_0x46a44c,null));};exports[_0xca44('0x8a')]=function(_0x28fbae,_0x579a2d,_0x3a5e42){return db[_0xca44('0x36')][_0xca44('0x53')]({'where':{'id':_0x28fbae[_0xca44('0x51')]['id']}})['then'](handleEntityNotFound(_0x579a2d,null))[_0xca44('0x2d')](function(_0x549d32){if(_0x549d32){return _0x549d32[_0xca44('0x8a')](_0x28fbae[_0xca44('0x39')][_0xca44('0x68')])['then'](function(){if(_[_0xca44('0x8b')](_0x28fbae[_0xca44('0x39')][_0xca44('0x68')])){for(var _0x54cee9=0x0;_0x54cee9<_0x28fbae['query'][_0xca44('0x68')][_0xca44('0x3f')];_0x54cee9+=0x1){socket[_0xca44('0x73')](_0xca44('0x86'),{'UserId':Number(_0x28fbae[_0xca44('0x39')][_0xca44('0x68')][_0x54cee9]),'SmsQueueId':Number(_0x28fbae[_0xca44('0x51')]['id'])});}}else{socket[_0xca44('0x73')](_0xca44('0x86'),{'UserId':Number(_0x28fbae['query'][_0xca44('0x68')]),'SmsQueueId':Number(_0x28fbae['params']['id'])});}});}})['then'](respondWithStatusCode(_0x579a2d,null))['catch'](handleError(_0x579a2d,null));};exports[_0xca44('0x8c')]=function(_0x5e6cbd,_0x1400a3,_0x5e8202){var _0x2a77dc={};var _0x25a72b={};var _0x34f2b8;var _0x305d8a;return db['SmsQueue'][_0xca44('0x67')]({'where':{'id':_0x5e6cbd[_0xca44('0x51')]['id']}})[_0xca44('0x2d')](handleEntityNotFound(_0x1400a3,null))[_0xca44('0x2d')](function(_0xabae07){if(_0xabae07){_0x34f2b8=_0xabae07;_0x25a72b[_0xca44('0x3c')]=_['keys'](db['User'][_0xca44('0x37')]);_0x25a72b[_0xca44('0x39')]=_[_0xca44('0x3a')](_0x5e6cbd[_0xca44('0x39')]);_0x25a72b[_0xca44('0x45')]=_[_0xca44('0x3b')](_0x25a72b[_0xca44('0x3c')],_0x25a72b['query']);_0x2a77dc[_0xca44('0x3d')]=_['intersection'](_0x25a72b[_0xca44('0x3c')],qs['fields'](_0x5e6cbd[_0xca44('0x39')]['fields']));_0x2a77dc[_0xca44('0x3d')]=_0x2a77dc[_0xca44('0x3d')][_0xca44('0x3f')]?_0x2a77dc['attributes']:_0x25a72b[_0xca44('0x3c')];_0x2a77dc[_0xca44('0x42')]=qs[_0xca44('0x43')](_0x5e6cbd[_0xca44('0x39')][_0xca44('0x43')]);_0x2a77dc[_0xca44('0x44')]=qs[_0xca44('0x45')](_[_0xca44('0x46')](_0x5e6cbd['query'],_0x25a72b[_0xca44('0x45')]));if(_0x5e6cbd[_0xca44('0x39')][_0xca44('0x4a')]){_0x2a77dc[_0xca44('0x44')]=_[_0xca44('0x47')](_0x2a77dc[_0xca44('0x44')],{'$or':_[_0xca44('0x35')](_0x2a77dc[_0xca44('0x3d')],function(_0x186e0b){var _0xcfb418={};_0xcfb418[_0x186e0b]={'$like':'%'+_0x5e6cbd[_0xca44('0x39')]['filter']+'%'};return _0xcfb418;})});}_0x2a77dc=_[_0xca44('0x47')]({},_0x2a77dc,_0x5e6cbd[_0xca44('0x4b')]);return _0x34f2b8['getAgents'](_0x2a77dc);}})[_0xca44('0x2d')](function(_0x31cdc1){if(_0x31cdc1){_0x305d8a=_0x31cdc1[_0xca44('0x3f')];if(!_0x5e6cbd[_0xca44('0x39')][_0xca44('0x40')](_0xca44('0x41'))){_0x2a77dc[_0xca44('0x24')]=qs[_0xca44('0x24')](_0x5e6cbd[_0xca44('0x39')][_0xca44('0x24')]);_0x2a77dc['offset']=qs[_0xca44('0x23')](_0x5e6cbd[_0xca44('0x39')]['offset']);}return _0x34f2b8[_0xca44('0x8c')](_0x2a77dc);}})[_0xca44('0x2d')](function(_0x4daf3e){if(_0x4daf3e){return _0x4daf3e?{'count':_0x305d8a,'rows':_0x4daf3e}:null;}})[_0xca44('0x2d')](respondWithResult(_0x1400a3,null))['catch'](handleError(_0x1400a3,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 955b1f1..810f8f1 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 _0x9af5=['../../mysqldb','SmsQueue','save','remove','emit','hook','exports','events'];(function(_0x5ac5d6,_0x51eb3e){var _0x2c8e34=function(_0x5103c7){while(--_0x5103c7){_0x5ac5d6['push'](_0x5ac5d6['shift']());}};_0x2c8e34(++_0x51eb3e);}(_0x9af5,0xa7));var _0x59af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9af5[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x59af('0x0'));var SmsQueue=require(_0x59af('0x1'))['db'][_0x59af('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x59af('0x3'),'afterUpdate':'update','afterDestroy':_0x59af('0x4')};function emitEvent(_0x73937c){return function(_0x406a3b,_0x21d625,_0x162a86){SmsQueueEvents[_0x59af('0x5')](_0x73937c+':'+_0x406a3b['id'],_0x406a3b);SmsQueueEvents[_0x59af('0x5')](_0x73937c,_0x406a3b);_0x162a86(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x59af('0x6')](e,emitEvent(event));}}module[_0x59af('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0xf1a3=['emit','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','remove'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xf1a3,0x78));var _0x3f1a=function(_0x2a3c4d,_0x9c6b37){_0x2a3c4d=_0x2a3c4d-0x0;var _0x55c390=_0xf1a3[_0x2a3c4d];return _0x55c390;};'use strict';var EventEmitter=require(_0x3f1a('0x0'));var SmsQueue=require(_0x3f1a('0x1'))['db'][_0x3f1a('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3f1a('0x3')](0x0);var events={'afterCreate':_0x3f1a('0x4'),'afterUpdate':'update','afterDestroy':_0x3f1a('0x5')};function emitEvent(_0x4120c2){return function(_0x4c3cee,_0x111994,_0x470b27){SmsQueueEvents[_0x3f1a('0x6')](_0x4120c2+':'+_0x4c3cee['id'],_0x4c3cee);SmsQueueEvents[_0x3f1a('0x6')](_0x4120c2,_0x4c3cee);_0x470b27(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x3f1a('0x7')](e,emitEvent(event));}}module[_0x3f1a('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index fb65c49..04ff5e4 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 _0xfb97=['bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','lodash','util','../../config/logger','api','moment'];(function(_0x1ce236,_0xca922e){var _0x241819=function(_0x1a66f8){while(--_0x1a66f8){_0x1ce236['push'](_0x1ce236['shift']());}};_0x241819(++_0xca922e);}(_0xfb97,0xf7));var _0x7fb9=function(_0x61711c,_0x5b2962){_0x61711c=_0x61711c-0x0;var _0x4cf0e9=_0xfb97[_0x61711c];return _0x4cf0e9;};'use strict';var _=require(_0x7fb9('0x0'));var util=require(_0x7fb9('0x1'));var logger=require(_0x7fb9('0x2'))(_0x7fb9('0x3'));var moment=require(_0x7fb9('0x4'));var BPromise=require(_0x7fb9('0x5'));var rp=require(_0x7fb9('0x6'));var fs=require('fs');var path=require(_0x7fb9('0x7'));var rimraf=require(_0x7fb9('0x8'));var config=require(_0x7fb9('0x9'));var attributes=require(_0x7fb9('0xa'));module[_0x7fb9('0xb')]=function(_0x52cc4a,_0x53dce1){return _0x52cc4a[_0x7fb9('0xc')](_0x7fb9('0xd'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d37=['api','moment','bluebird','request-promise','path','../../config/environment','./smsQueue.attributes','exports','define','sms_queues','../../config/logger'];(function(_0x20b89d,_0x5d1de6){var _0x4d7d33=function(_0x39ddc3){while(--_0x39ddc3){_0x20b89d['push'](_0x20b89d['shift']());}};_0x4d7d33(++_0x5d1de6);}(_0x2d37,0xaf));var _0x72d3=function(_0x441283,_0x16c643){_0x441283=_0x441283-0x0;var _0x396983=_0x2d37[_0x441283];return _0x396983;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x72d3('0x0'))(_0x72d3('0x1'));var moment=require(_0x72d3('0x2'));var BPromise=require(_0x72d3('0x3'));var rp=require(_0x72d3('0x4'));var fs=require('fs');var path=require(_0x72d3('0x5'));var rimraf=require('rimraf');var config=require(_0x72d3('0x6'));var attributes=require(_0x72d3('0x7'));module[_0x72d3('0x8')]=function(_0x357cbb,_0x34e312){return _0x357cbb[_0x72d3('0x9')]('SmsQueue',attributes,{'tableName':_0x72d3('0xa'),'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 99c7a8d..ce01435 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 _0x8f62=['GetSmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','SmsQueue','ShowSmsQueue','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','request','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsQueue,\x20%s,\x20%s','result','catch'];(function(_0x59726f,_0x12ca2b){var _0x261676=function(_0x48bc57){while(--_0x48bc57){_0x59726f['push'](_0x59726f['shift']());}};_0x261676(++_0x12ca2b);}(_0x8f62,0x81));var _0x28f6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8f62[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x28f6('0x0'));var moment=require(_0x28f6('0x1'));var BPromise=require(_0x28f6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x28f6('0x4'));var logger=require(_0x28f6('0x5'))('rpc');var config=require(_0x28f6('0x6'));var jayson=require(_0x28f6('0x7'));var client=jayson[_0x28f6('0x8')][_0x28f6('0x9')]({'port':0x232a});config[_0x28f6('0xa')]=_[_0x28f6('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x28f6('0xc'))(new Redis(config[_0x28f6('0xa')]));require(_0x28f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x3ec537,_0xe6f021,_0x279ab1){return new BPromise(function(_0x3e0929,_0x3fa69f){return client[_0x28f6('0xe')](_0x3ec537,_0x279ab1)[_0x28f6('0xf')](function(_0x3583ff){logger[_0x28f6('0x10')]('SmsQueue,\x20%s,\x20%s',_0xe6f021,_0x28f6('0x11'));logger[_0x28f6('0x12')](_0x28f6('0x13'),_0xe6f021,'request\x20sent',JSON[_0x28f6('0x14')](_0x3583ff));if(_0x3583ff[_0x28f6('0x15')]){if(_0x3583ff['error'][_0x28f6('0x16')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0xe6f021,_0x3583ff[_0x28f6('0x15')][_0x28f6('0x17')]);return _0x3fa69f(_0x3583ff[_0x28f6('0x15')][_0x28f6('0x17')]);}logger['error'](_0x28f6('0x18'),_0xe6f021,_0x3583ff[_0x28f6('0x15')]['message']);return _0x3e0929(_0x3583ff[_0x28f6('0x15')][_0x28f6('0x17')]);}else{logger[_0x28f6('0x10')]('SmsQueue,\x20%s,\x20%s',_0xe6f021,_0x28f6('0x11'));_0x3e0929(_0x3583ff[_0x28f6('0x19')]['message']);}})[_0x28f6('0x1a')](function(_0x5c0bc5){logger[_0x28f6('0x15')](_0x28f6('0x18'),_0xe6f021,_0x5c0bc5);_0x3fa69f(_0x5c0bc5);});});}exports[_0x28f6('0x1b')]=function(_0x335a47){var _0x27b52f=this;return new Promise(function(_0x40277a,_0x142402){return db['SmsQueue'][_0x28f6('0x1c')]({'raw':_0x335a47[_0x28f6('0x1d')]?_0x335a47[_0x28f6('0x1d')][_0x28f6('0x1e')]===undefined?!![]:![]:!![],'where':_0x335a47[_0x28f6('0x1d')]?_0x335a47[_0x28f6('0x1d')][_0x28f6('0x1f')]||null:null,'attributes':_0x335a47[_0x28f6('0x1d')]?_0x335a47[_0x28f6('0x1d')][_0x28f6('0x20')]||null:null,'limit':_0x335a47[_0x28f6('0x1d')]?_0x335a47[_0x28f6('0x1d')][_0x28f6('0x21')]||null:null,'include':_0x335a47[_0x28f6('0x1d')]?_0x335a47['options'][_0x28f6('0x22')]?_[_0x28f6('0x23')](_0x335a47[_0x28f6('0x1d')][_0x28f6('0x22')],function(_0x53bbdf){return{'model':db[_0x53bbdf[_0x28f6('0x24')]],'as':_0x53bbdf['as'],'attributes':_0x53bbdf[_0x28f6('0x20')],'include':_0x53bbdf['include']?_[_0x28f6('0x23')](_0x53bbdf[_0x28f6('0x22')],function(_0x55c2e4){return{'model':db[_0x55c2e4[_0x28f6('0x24')]],'as':_0x55c2e4['as'],'attributes':_0x55c2e4[_0x28f6('0x20')],'include':_0x55c2e4['include']?_[_0x28f6('0x23')](_0x55c2e4[_0x28f6('0x22')],function(_0x18c0f6){return{'model':db[_0x18c0f6[_0x28f6('0x24')]],'as':_0x18c0f6['as'],'attributes':_0x18c0f6['attributes']};}):[]};}):[]};}):[]:[]})[_0x28f6('0xf')](function(_0x4b4d1e){logger[_0x28f6('0x10')]('GetSmsQueue',_0x335a47);logger[_0x28f6('0x12')]('GetSmsQueue',_0x335a47,JSON[_0x28f6('0x14')](_0x4b4d1e));_0x40277a(_0x4b4d1e);})['catch'](function(_0x57454a){logger[_0x28f6('0x15')](_0x28f6('0x1b'),_0x57454a[_0x28f6('0x17')],_0x335a47);_0x142402(_0x27b52f['error'](0x1f4,_0x57454a[_0x28f6('0x17')]));});});};exports['ShowSmsQueue']=function(_0x25f370){var _0x13ded3=this;return new Promise(function(_0x174441,_0x591b80){return db[_0x28f6('0x25')]['find']({'raw':_0x25f370[_0x28f6('0x1d')]?_0x25f370['options'][_0x28f6('0x1e')]===undefined?!![]:![]:!![],'where':_0x25f370[_0x28f6('0x1d')]?_0x25f370['options'][_0x28f6('0x1f')]||null:null,'attributes':_0x25f370[_0x28f6('0x1d')]?_0x25f370[_0x28f6('0x1d')][_0x28f6('0x20')]||null:null,'include':_0x25f370[_0x28f6('0x1d')]?_0x25f370[_0x28f6('0x1d')][_0x28f6('0x22')]?_[_0x28f6('0x23')](_0x25f370[_0x28f6('0x1d')][_0x28f6('0x22')],function(_0x20d416){return{'model':db[_0x20d416['model']],'as':_0x20d416['as'],'attributes':_0x20d416[_0x28f6('0x20')],'include':_0x20d416['include']?_[_0x28f6('0x23')](_0x20d416['include'],function(_0x44d5e9){return{'model':db[_0x44d5e9[_0x28f6('0x24')]],'as':_0x44d5e9['as'],'attributes':_0x44d5e9[_0x28f6('0x20')],'include':_0x44d5e9[_0x28f6('0x22')]?_[_0x28f6('0x23')](_0x44d5e9[_0x28f6('0x22')],function(_0x27c1c5){return{'model':db[_0x27c1c5['model']],'as':_0x27c1c5['as'],'attributes':_0x27c1c5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ee1f1){logger[_0x28f6('0x10')]('ShowSmsQueue',_0x25f370);logger[_0x28f6('0x12')](_0x28f6('0x26'),_0x25f370,JSON[_0x28f6('0x14')](_0x5ee1f1));_0x174441(_0x5ee1f1);})[_0x28f6('0x1a')](function(_0x3eb70e){logger[_0x28f6('0x15')](_0x28f6('0x26'),_0x3eb70e['message'],_0x25f370);_0x591b80(_0x13ded3['error'](0x1f4,_0x3eb70e[_0x28f6('0x17')]));});});}; \ No newline at end of file +var _0xdece=['options','raw','where','attributes','limit','include','map','model','ShowSmsQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','defaults','localhost','socket.io-emitter','redis','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdece,0x88));var _0xedec=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xdece[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xedec('0x0'));var util=require(_0xedec('0x1'));var moment=require(_0xedec('0x2'));var BPromise=require('bluebird');var rs=require(_0xedec('0x3'));var fs=require('fs');var Redis=require(_0xedec('0x4'));var db=require(_0xedec('0x5'))['db'];var utils=require(_0xedec('0x6'));var logger=require(_0xedec('0x7'))('rpc');var config=require(_0xedec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xedec('0x9')]['http']({'port':0x232a});config['redis']=_[_0xedec('0xa')](config['redis'],{'host':_0xedec('0xb'),'port':0x18eb});var socket=require(_0xedec('0xc'))(new Redis(config[_0xedec('0xd')]));require(_0xedec('0xe'))[_0xedec('0xf')](socket);function respondWithRpcPromise(_0xaef4a7,_0x4b172d,_0xcc89c6){return new BPromise(function(_0x530a4f,_0x20b295){return client[_0xedec('0x10')](_0xaef4a7,_0xcc89c6)[_0xedec('0x11')](function(_0x121d64){logger[_0xedec('0x12')](_0xedec('0x13'),_0x4b172d,_0xedec('0x14'));logger[_0xedec('0x15')](_0xedec('0x16'),_0x4b172d,'request\x20sent',JSON[_0xedec('0x17')](_0x121d64));if(_0x121d64['error']){if(_0x121d64[_0xedec('0x18')][_0xedec('0x19')]===0x1f4){logger[_0xedec('0x18')]('SmsQueue,\x20%s,\x20%s',_0x4b172d,_0x121d64[_0xedec('0x18')][_0xedec('0x1a')]);return _0x20b295(_0x121d64[_0xedec('0x18')][_0xedec('0x1a')]);}logger[_0xedec('0x18')](_0xedec('0x13'),_0x4b172d,_0x121d64[_0xedec('0x18')]['message']);return _0x530a4f(_0x121d64['error'][_0xedec('0x1a')]);}else{logger[_0xedec('0x12')](_0xedec('0x13'),_0x4b172d,_0xedec('0x14'));_0x530a4f(_0x121d64[_0xedec('0x1b')][_0xedec('0x1a')]);}})[_0xedec('0x1c')](function(_0x3243f2){logger[_0xedec('0x18')](_0xedec('0x13'),_0x4b172d,_0x3243f2);_0x20b295(_0x3243f2);});});}exports[_0xedec('0x1d')]=function(_0x9f14a8){var _0x3fe5b6=this;return new Promise(function(_0x293146,_0x382acc){return db[_0xedec('0x1e')][_0xedec('0x1f')]({'raw':_0x9f14a8[_0xedec('0x20')]?_0x9f14a8[_0xedec('0x20')][_0xedec('0x21')]===undefined?!![]:![]:!![],'where':_0x9f14a8[_0xedec('0x20')]?_0x9f14a8[_0xedec('0x20')][_0xedec('0x22')]||null:null,'attributes':_0x9f14a8[_0xedec('0x20')]?_0x9f14a8[_0xedec('0x20')][_0xedec('0x23')]||null:null,'limit':_0x9f14a8[_0xedec('0x20')]?_0x9f14a8[_0xedec('0x20')][_0xedec('0x24')]||null:null,'include':_0x9f14a8[_0xedec('0x20')]?_0x9f14a8[_0xedec('0x20')][_0xedec('0x25')]?_[_0xedec('0x26')](_0x9f14a8[_0xedec('0x20')][_0xedec('0x25')],function(_0x4b84f7){return{'model':db[_0x4b84f7[_0xedec('0x27')]],'as':_0x4b84f7['as'],'attributes':_0x4b84f7[_0xedec('0x23')],'include':_0x4b84f7[_0xedec('0x25')]?_[_0xedec('0x26')](_0x4b84f7[_0xedec('0x25')],function(_0x3258d4){return{'model':db[_0x3258d4['model']],'as':_0x3258d4['as'],'attributes':_0x3258d4[_0xedec('0x23')],'include':_0x3258d4[_0xedec('0x25')]?_[_0xedec('0x26')](_0x3258d4[_0xedec('0x25')],function(_0x399b8c){return{'model':db[_0x399b8c['model']],'as':_0x399b8c['as'],'attributes':_0x399b8c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x189c67){logger[_0xedec('0x12')](_0xedec('0x1d'),_0x9f14a8);logger[_0xedec('0x15')]('GetSmsQueue',_0x9f14a8,JSON['stringify'](_0x189c67));_0x293146(_0x189c67);})[_0xedec('0x1c')](function(_0x337cb0){logger[_0xedec('0x18')](_0xedec('0x1d'),_0x337cb0['message'],_0x9f14a8);_0x382acc(_0x3fe5b6[_0xedec('0x18')](0x1f4,_0x337cb0[_0xedec('0x1a')]));});});};exports[_0xedec('0x28')]=function(_0x3529f5){var _0x2b02b8=this;return new Promise(function(_0x3a0d85,_0x313fea){return db[_0xedec('0x1e')][_0xedec('0x29')]({'raw':_0x3529f5[_0xedec('0x20')]?_0x3529f5['options'][_0xedec('0x21')]===undefined?!![]:![]:!![],'where':_0x3529f5[_0xedec('0x20')]?_0x3529f5['options'][_0xedec('0x22')]||null:null,'attributes':_0x3529f5[_0xedec('0x20')]?_0x3529f5[_0xedec('0x20')]['attributes']||null:null,'include':_0x3529f5['options']?_0x3529f5['options']['include']?_[_0xedec('0x26')](_0x3529f5[_0xedec('0x20')]['include'],function(_0x2db1e6){return{'model':db[_0x2db1e6[_0xedec('0x27')]],'as':_0x2db1e6['as'],'attributes':_0x2db1e6[_0xedec('0x23')],'include':_0x2db1e6[_0xedec('0x25')]?_[_0xedec('0x26')](_0x2db1e6['include'],function(_0x4b30eb){return{'model':db[_0x4b30eb[_0xedec('0x27')]],'as':_0x4b30eb['as'],'attributes':_0x4b30eb['attributes'],'include':_0x4b30eb['include']?_[_0xedec('0x26')](_0x4b30eb[_0xedec('0x25')],function(_0x43e52a){return{'model':db[_0x43e52a['model']],'as':_0x43e52a['as'],'attributes':_0x43e52a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe894fd){logger[_0xedec('0x12')]('ShowSmsQueue',_0x3529f5);logger[_0xedec('0x15')](_0xedec('0x28'),_0x3529f5,JSON[_0xedec('0x17')](_0xe894fd));_0x3a0d85(_0xe894fd);})[_0xedec('0x1c')](function(_0x341912){logger[_0xedec('0x18')](_0xedec('0x28'),_0x341912[_0xedec('0x1a')],_0x3529f5);_0x313fea(_0x2b02b8[_0xedec('0x18')](0x1f4,_0x341912[_0xedec('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 95f927a..c99dfb8 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 _0xe095=['./smsQueue.events','remove','removeListener','register','length','smsQueue:'];(function(_0x40e63a,_0xf7513a){var _0x8c950a=function(_0x10e67e){while(--_0x10e67e){_0x40e63a['push'](_0x40e63a['shift']());}};_0x8c950a(++_0xf7513a);}(_0xe095,0x198));var _0x5e09=function(_0x1bc82d,_0xef9531){_0x1bc82d=_0x1bc82d-0x0;var _0x11a505=_0xe095[_0x1bc82d];return _0x11a505;};'use strict';var SmsQueueEvents=require(_0x5e09('0x0'));var events=['save',_0x5e09('0x1'),'update'];function createListener(_0x3e4b3c,_0x20e948){return function(_0xec1e50){_0x20e948['emit'](_0x3e4b3c,_0xec1e50);};}function removeListener(_0x4db5ce,_0x286252){return function(){SmsQueueEvents[_0x5e09('0x2')](_0x4db5ce,_0x286252);};}exports[_0x5e09('0x3')]=function(_0x535fb7){for(var _0x1584b3=0x0,_0x596d2b=events[_0x5e09('0x4')];_0x1584b3<_0x596d2b;_0x1584b3++){var _0x5702dc=events[_0x1584b3];var _0xcde27c=createListener(_0x5e09('0x5')+_0x5702dc,_0x535fb7);SmsQueueEvents['on'](_0x5702dc,_0xcde27c);}}; \ No newline at end of file +var _0x88e1=['emit','removeListener','length','smsQueue:','./smsQueue.events','save'];(function(_0x5e0bfe,_0x747312){var _0x6468b8=function(_0x20e5e0){while(--_0x20e5e0){_0x5e0bfe['push'](_0x5e0bfe['shift']());}};_0x6468b8(++_0x747312);}(_0x88e1,0x7c));var _0x188e=function(_0xf36a76,_0x3967b3){_0xf36a76=_0xf36a76-0x0;var _0x414aa5=_0x88e1[_0xf36a76];return _0x414aa5;};'use strict';var SmsQueueEvents=require(_0x188e('0x0'));var events=[_0x188e('0x1'),'remove','update'];function createListener(_0x2f22e6,_0x1478a4){return function(_0x2607dc){_0x1478a4[_0x188e('0x2')](_0x2f22e6,_0x2607dc);};}function removeListener(_0x1c0bdb,_0x25e667){return function(){SmsQueueEvents[_0x188e('0x3')](_0x1c0bdb,_0x25e667);};}exports['register']=function(_0x402b9a){for(var _0x1bf4e2=0x0,_0x1a4808=events[_0x188e('0x4')];_0x1bf4e2<_0x1a4808;_0x1bf4e2++){var _0x3dc5ba=events[_0x1bf4e2];var _0x487265=createListener(_0x188e('0x5')+_0x3dc5ba,_0x402b9a);SmsQueueEvents['on'](_0x3dc5ba,_0x487265);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 2361f8d..7da81df 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 _0xce50=['index','describe','/:id','show','post','create','update','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated'];(function(_0xec0f10,_0x155f24){var _0x57bea5=function(_0x47f4aa){while(--_0x47f4aa){_0xec0f10['push'](_0xec0f10['shift']());}};_0x57bea5(++_0x155f24);}(_0xce50,0x1d8));var _0x0ce5=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xce50[_0x413feb];return _0x40ee88;};'use strict';var multer=require('multer');var util=require(_0x0ce5('0x0'));var path=require(_0x0ce5('0x1'));var timeout=require(_0x0ce5('0x2'));var express=require(_0x0ce5('0x3'));var router=express[_0x0ce5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0ce5('0x5'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0x0ce5('0x6')]('/',auth[_0x0ce5('0x7')](),controller[_0x0ce5('0x8')]);router[_0x0ce5('0x6')]('/describe',auth[_0x0ce5('0x7')](),controller[_0x0ce5('0x9')]);router['get'](_0x0ce5('0xa'),auth['isAuthenticated'](),controller[_0x0ce5('0xb')]);router[_0x0ce5('0xc')]('/',auth[_0x0ce5('0x7')](),controller[_0x0ce5('0xd')]);router['put'](_0x0ce5('0xa'),auth[_0x0ce5('0x7')](),controller[_0x0ce5('0xe')]);router[_0x0ce5('0xf')](_0x0ce5('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xddf7=['../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x7a1589,_0x58e8d2){var _0x570127=function(_0x4e588c){while(--_0x4e588c){_0x7a1589['push'](_0x7a1589['shift']());}};_0x570127(++_0x58e8d2);}(_0xddf7,0x13c));var _0x7ddf=function(_0x54bb69,_0x59d70b){_0x54bb69=_0x54bb69-0x0;var _0x5b2741=_0xddf7[_0x54bb69];return _0x5b2741;};'use strict';var multer=require('multer');var util=require(_0x7ddf('0x0'));var path=require(_0x7ddf('0x1'));var timeout=require(_0x7ddf('0x2'));var express=require(_0x7ddf('0x3'));var router=express[_0x7ddf('0x4')]();var fs_extra=require(_0x7ddf('0x5'));var auth=require(_0x7ddf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7ddf('0x7'));var controller=require(_0x7ddf('0x8'));router[_0x7ddf('0x9')]('/',auth[_0x7ddf('0xa')](),controller[_0x7ddf('0xb')]);router[_0x7ddf('0x9')]('/describe',auth[_0x7ddf('0xa')](),controller[_0x7ddf('0xc')]);router['get'](_0x7ddf('0xd'),auth[_0x7ddf('0xa')](),controller[_0x7ddf('0xe')]);router['post']('/',auth[_0x7ddf('0xa')](),controller['create']);router['put'](_0x7ddf('0xd'),auth[_0x7ddf('0xa')](),controller['update']);router[_0x7ddf('0xf')](_0x7ddf('0xd'),auth[_0x7ddf('0xa')](),controller['destroy']);module[_0x7ddf('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index e5fdaab..08fac68 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 _0xd40a=['sequelize','STRING','DATE'];(function(_0x5e6515,_0x2954b1){var _0xd33ce2=function(_0x5ce7ea){while(--_0x5ce7ea){_0x5e6515['push'](_0x5e6515['shift']());}};_0xd33ce2(++_0x2954b1);}(_0xd40a,0x17d));var _0xad40=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd40a[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var Sequelize=require(_0xad40('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xad40('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xad40('0x1')]},'joinAt':{'type':Sequelize[_0xad40('0x2')]},'leaveAt':{'type':Sequelize[_0xad40('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xad40('0x2')]},'reason':{'type':Sequelize[_0xad40('0x1')]}}; \ No newline at end of file +var _0xde15=['moment','exports','STRING','DATE'];(function(_0xfd495c,_0x4a3c1a){var _0x561dd8=function(_0x83e915){while(--_0x83e915){_0xfd495c['push'](_0xfd495c['shift']());}};_0x561dd8(++_0x4a3c1a);}(_0xde15,0x148));var _0x5de1=function(_0x20ceac,_0x1d2284){_0x20ceac=_0x20ceac-0x0;var _0x2bf862=_0xde15[_0x20ceac];return _0x2bf862;};'use strict';var moment=require(_0x5de1('0x0'));var Sequelize=require('sequelize');module[_0x5de1('0x1')]={'uniqueid':{'type':Sequelize[_0x5de1('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x5de1('0x3')]},'leaveAt':{'type':Sequelize[_0x5de1('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5de1('0x3')]},'reason':{'type':Sequelize[_0x5de1('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index e0ea4bc..8416393 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 _0x31d1=['Content-Range','apply','save','then','destroy','error','stack','name','send','map','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','SmsQueueReport','findAll','rows','catch','show','keys','rawAttributes','include','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0xd1d90b,_0x3b8750){var _0x4aaa76=function(_0x4347c8){while(--_0x4347c8){_0xd1d90b['push'](_0xd1d90b['shift']());}};_0x4aaa76(++_0x3b8750);}(_0x31d1,0x116));var _0x131d=function(_0x1203d4,_0x19014c){_0x1203d4=_0x1203d4-0x0;var _0x481779=_0x31d1[_0x1203d4];return _0x481779;};'use strict';var emlformat=require(_0x131d('0x0'));var rimraf=require(_0x131d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x131d('0x2'));var rp=require(_0x131d('0x3'));var moment=require(_0x131d('0x4'));var BPromise=require(_0x131d('0x5'));var Mustache=require(_0x131d('0x6'));var util=require('util');var path=require(_0x131d('0x7'));var sox=require(_0x131d('0x8'));var csv=require(_0x131d('0x9'));var ejs=require(_0x131d('0xa'));var fs=require('fs');var fs_extra=require(_0x131d('0xb'));var _=require(_0x131d('0xc'));var squel=require(_0x131d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x131d('0x9'));var querystring=require(_0x131d('0xe'));var Papa=require(_0x131d('0xf'));var Redis=require(_0x131d('0x10'));var authService=require(_0x131d('0x11'));var qs=require(_0x131d('0x12'));var as=require(_0x131d('0x13'));var hardwareService=require(_0x131d('0x14'));var logger=require(_0x131d('0x15'))(_0x131d('0x16'));var utils=require(_0x131d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x131d('0x18'))['db'];function respondWithStatusCode(_0x386650,_0x3879ec){_0x3879ec=_0x3879ec||0xcc;return function(_0x4133a4){if(_0x4133a4){return _0x386650[_0x131d('0x19')](_0x3879ec);}return _0x386650[_0x131d('0x1a')](_0x3879ec)[_0x131d('0x1b')]();};}function respondWithResult(_0x4f776a,_0x3a4b0b){_0x3a4b0b=_0x3a4b0b||0xc8;return function(_0x49ef6f){if(_0x49ef6f){return _0x4f776a[_0x131d('0x1a')](_0x3a4b0b)[_0x131d('0x1c')](_0x49ef6f);}};}function respondWithFilteredResult(_0x4e1e61,_0x45520e){return function(_0x3b8e44){if(_0x3b8e44){var _0x4716ab=typeof _0x45520e[_0x131d('0x1d')]===_0x131d('0x1e')&&typeof _0x45520e[_0x131d('0x1f')]==='undefined';var _0x2cff41=_0x3b8e44[_0x131d('0x20')];var _0x51690d=_0x4716ab?0x0:_0x45520e['offset'];var _0xfec784=_0x4716ab?_0x3b8e44[_0x131d('0x20')]:_0x45520e[_0x131d('0x1d')]+_0x45520e['limit'];var _0x88ae89;if(_0xfec784>=_0x2cff41){_0xfec784=_0x2cff41;_0x88ae89=0xc8;}else{_0x88ae89=0xce;}_0x4e1e61[_0x131d('0x1a')](_0x88ae89);return _0x4e1e61[_0x131d('0x21')](_0x131d('0x22'),_0x51690d+'-'+_0xfec784+'/'+_0x2cff41)[_0x131d('0x1c')](_0x3b8e44);}return null;};}function patchUpdates(_0xc5fa4c){return function(_0x152765){try{jsonpatch[_0x131d('0x23')](_0x152765,_0xc5fa4c,!![]);}catch(_0x56a878){return BPromise['reject'](_0x56a878);}return _0x152765[_0x131d('0x24')]();};}function saveUpdates(_0x16f40a,_0x3f2062){return function(_0x59e4d8){if(_0x59e4d8){return _0x59e4d8['update'](_0x16f40a)[_0x131d('0x25')](function(_0x48f026){return _0x48f026;});}return null;};}function removeEntity(_0x344302,_0x199807){return function(_0x274610){if(_0x274610){return _0x274610[_0x131d('0x26')]()[_0x131d('0x25')](function(){_0x344302[_0x131d('0x1a')](0xcc)[_0x131d('0x1b')]();});}};}function handleEntityNotFound(_0x32a2c4,_0x20aeaf){return function(_0x10c115){if(!_0x10c115){_0x32a2c4[_0x131d('0x19')](0x194);}return _0x10c115;};}function handleError(_0x52f9ea,_0x2f6233){_0x2f6233=_0x2f6233||0x1f4;return function(_0x4aa304){logger[_0x131d('0x27')](_0x4aa304[_0x131d('0x28')]);if(_0x4aa304[_0x131d('0x29')]){delete _0x4aa304[_0x131d('0x29')];}_0x52f9ea[_0x131d('0x1a')](_0x2f6233)[_0x131d('0x2a')](_0x4aa304);};}exports['index']=function(_0x48e735,_0x463660){var _0x526890={},_0x17c7c1={},_0x25ca4c={'count':0x0,'rows':[]};var _0x475995=_[_0x131d('0x2b')](db['SmsQueueReport']['rawAttributes'],function(_0x1797ff){return{'name':_0x1797ff[_0x131d('0x2c')],'type':_0x1797ff[_0x131d('0x2d')][_0x131d('0x2e')]};});_0x17c7c1['model']=_[_0x131d('0x2b')](_0x475995,_0x131d('0x29'));_0x17c7c1[_0x131d('0x2f')]=_['keys'](_0x48e735[_0x131d('0x2f')]);_0x17c7c1['filters']=_[_0x131d('0x30')](_0x17c7c1[_0x131d('0x31')],_0x17c7c1[_0x131d('0x2f')]);_0x526890[_0x131d('0x32')]=_[_0x131d('0x30')](_0x17c7c1[_0x131d('0x31')],qs[_0x131d('0x33')](_0x48e735['query'][_0x131d('0x33')]));_0x526890[_0x131d('0x32')]=_0x526890[_0x131d('0x32')][_0x131d('0x34')]?_0x526890[_0x131d('0x32')]:_0x17c7c1[_0x131d('0x31')];if(!_0x48e735['query'][_0x131d('0x35')](_0x131d('0x36'))){_0x526890[_0x131d('0x1f')]=qs[_0x131d('0x1f')](_0x48e735[_0x131d('0x2f')][_0x131d('0x1f')]);_0x526890[_0x131d('0x1d')]=qs[_0x131d('0x1d')](_0x48e735[_0x131d('0x2f')][_0x131d('0x1d')]);}_0x526890[_0x131d('0x37')]=qs[_0x131d('0x38')](_0x48e735[_0x131d('0x2f')][_0x131d('0x38')]);_0x526890['where']=qs[_0x131d('0x39')](_[_0x131d('0x3a')](_0x48e735[_0x131d('0x2f')],_0x17c7c1[_0x131d('0x39')]),_0x475995);if(_0x48e735[_0x131d('0x2f')][_0x131d('0x3b')]){_0x526890['where']=_[_0x131d('0x3c')](_0x526890[_0x131d('0x3d')],{'$or':_[_0x131d('0x2b')](_0x475995,function(_0x4f63d9){if(_0x4f63d9[_0x131d('0x2d')]!==_0x131d('0x3e')){var _0x462df7={};_0x462df7[_0x4f63d9[_0x131d('0x29')]]={'$like':'%'+_0x48e735[_0x131d('0x2f')][_0x131d('0x3b')]+'%'};return _0x462df7;}})});}_0x526890=_[_0x131d('0x3c')]({},_0x526890,_0x48e735[_0x131d('0x3f')]);var _0x19f7c6={'where':_0x526890[_0x131d('0x3d')]};return db[_0x131d('0x40')]['count'](_0x19f7c6)[_0x131d('0x25')](function(_0x3b66ff){_0x25ca4c['count']=_0x3b66ff;if(_0x48e735[_0x131d('0x2f')]['includeAll']){_0x526890['include']=[{'all':!![]}];}return db[_0x131d('0x40')][_0x131d('0x41')](_0x526890);})['then'](function(_0x344cdd){_0x25ca4c[_0x131d('0x42')]=_0x344cdd;return _0x25ca4c;})[_0x131d('0x25')](respondWithFilteredResult(_0x463660,_0x526890))[_0x131d('0x43')](handleError(_0x463660,null));};exports[_0x131d('0x44')]=function(_0x2d843a,_0x125fd6){var _0x98e57={'raw':!![],'where':{'id':_0x2d843a['params']['id']}},_0xa16bf2={};_0xa16bf2[_0x131d('0x31')]=_[_0x131d('0x45')](db[_0x131d('0x40')][_0x131d('0x46')]);_0xa16bf2[_0x131d('0x2f')]=_[_0x131d('0x45')](_0x2d843a[_0x131d('0x2f')]);_0xa16bf2['filters']=_['intersection'](_0xa16bf2[_0x131d('0x31')],_0xa16bf2[_0x131d('0x2f')]);_0x98e57[_0x131d('0x32')]=_[_0x131d('0x30')](_0xa16bf2['model'],qs[_0x131d('0x33')](_0x2d843a[_0x131d('0x2f')][_0x131d('0x33')]));_0x98e57[_0x131d('0x32')]=_0x98e57[_0x131d('0x32')][_0x131d('0x34')]?_0x98e57[_0x131d('0x32')]:_0xa16bf2['model'];if(_0x2d843a[_0x131d('0x2f')]['includeAll']){_0x98e57[_0x131d('0x47')]=[{'all':!![]}];}_0x98e57=_['merge']({},_0x98e57,_0x2d843a['options']);return db[_0x131d('0x40')][_0x131d('0x48')](_0x98e57)['then'](handleEntityNotFound(_0x125fd6,null))[_0x131d('0x25')](respondWithResult(_0x125fd6,null))[_0x131d('0x43')](handleError(_0x125fd6,null));};exports[_0x131d('0x49')]=function(_0x4d0167,_0x3510d6){return db[_0x131d('0x40')]['create'](_0x4d0167[_0x131d('0x4a')],{})[_0x131d('0x25')](respondWithResult(_0x3510d6,0xc9))[_0x131d('0x43')](handleError(_0x3510d6,null));};exports[_0x131d('0x4b')]=function(_0x475a5a,_0x547759){if(_0x475a5a['body']['id']){delete _0x475a5a[_0x131d('0x4a')]['id'];}return db['SmsQueueReport'][_0x131d('0x48')]({'where':{'id':_0x475a5a[_0x131d('0x4c')]['id']}})[_0x131d('0x25')](handleEntityNotFound(_0x547759,null))[_0x131d('0x25')](saveUpdates(_0x475a5a[_0x131d('0x4a')],null))[_0x131d('0x25')](respondWithResult(_0x547759,null))['catch'](handleError(_0x547759,null));};exports[_0x131d('0x26')]=function(_0x28ebe2,_0xb1b8bd){return db[_0x131d('0x40')]['find']({'where':{'id':_0x28ebe2[_0x131d('0x4c')]['id']}})['then'](handleEntityNotFound(_0xb1b8bd,null))[_0x131d('0x25')](removeEntity(_0xb1b8bd,null))[_0x131d('0x43')](handleError(_0xb1b8bd,null));};exports[_0x131d('0x4d')]=function(_0x100c93,_0x5c0741){return db[_0x131d('0x40')]['describe']()['then'](respondWithResult(_0x5c0741,null))['catch'](handleError(_0x5c0741,null));}; \ No newline at end of file +var _0x8352=['desk.js','querystring','papaparse','ioredis','../../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','apply','reject','save','update','then','stack','name','send','index','map','SmsQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x174e6b,_0x124a26){var _0x10ab0e=function(_0x704225){while(--_0x704225){_0x174e6b['push'](_0x174e6b['shift']());}};_0x10ab0e(++_0x124a26);}(_0x8352,0xd5));var _0x2835=function(_0x131a53,_0x12ab1e){_0x131a53=_0x131a53-0x0;var _0x20f5a8=_0x8352[_0x131a53];return _0x20f5a8;};'use strict';var emlformat=require(_0x2835('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2835('0x1'));var rp=require(_0x2835('0x2'));var moment=require(_0x2835('0x3'));var BPromise=require(_0x2835('0x4'));var Mustache=require(_0x2835('0x5'));var util=require(_0x2835('0x6'));var path=require(_0x2835('0x7'));var sox=require(_0x2835('0x8'));var csv=require(_0x2835('0x9'));var ejs=require(_0x2835('0xa'));var fs=require('fs');var fs_extra=require(_0x2835('0xb'));var _=require(_0x2835('0xc'));var squel=require(_0x2835('0xd'));var crypto=require(_0x2835('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2835('0xf'));var toCsv=require(_0x2835('0x9'));var querystring=require(_0x2835('0x10'));var Papa=require(_0x2835('0x11'));var Redis=require(_0x2835('0x12'));var authService=require(_0x2835('0x13'));var qs=require(_0x2835('0x14'));var as=require(_0x2835('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2835('0x16'))('api');var utils=require(_0x2835('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2835('0x18'));var db=require(_0x2835('0x19'))['db'];function respondWithStatusCode(_0x35a294,_0x497800){_0x497800=_0x497800||0xcc;return function(_0x49faf1){if(_0x49faf1){return _0x35a294[_0x2835('0x1a')](_0x497800);}return _0x35a294[_0x2835('0x1b')](_0x497800)[_0x2835('0x1c')]();};}function respondWithResult(_0x266b14,_0x536fad){_0x536fad=_0x536fad||0xc8;return function(_0x196d20){if(_0x196d20){return _0x266b14[_0x2835('0x1b')](_0x536fad)[_0x2835('0x1d')](_0x196d20);}};}function respondWithFilteredResult(_0x3b4eac,_0x4ca54c){return function(_0x1deab7){if(_0x1deab7){var _0x3a6ad7=typeof _0x4ca54c[_0x2835('0x1e')]===_0x2835('0x1f')&&typeof _0x4ca54c[_0x2835('0x20')]===_0x2835('0x1f');var _0xb005e4=_0x1deab7[_0x2835('0x21')];var _0x1407d1=_0x3a6ad7?0x0:_0x4ca54c['offset'];var _0x57ad32=_0x3a6ad7?_0x1deab7[_0x2835('0x21')]:_0x4ca54c[_0x2835('0x1e')]+_0x4ca54c[_0x2835('0x20')];var _0x2845ca;if(_0x57ad32>=_0xb005e4){_0x57ad32=_0xb005e4;_0x2845ca=0xc8;}else{_0x2845ca=0xce;}_0x3b4eac[_0x2835('0x1b')](_0x2845ca);return _0x3b4eac[_0x2835('0x22')]('Content-Range',_0x1407d1+'-'+_0x57ad32+'/'+_0xb005e4)[_0x2835('0x1d')](_0x1deab7);}return null;};}function patchUpdates(_0x5bdb39){return function(_0x5d15ff){try{jsonpatch[_0x2835('0x23')](_0x5d15ff,_0x5bdb39,!![]);}catch(_0x288fed){return BPromise[_0x2835('0x24')](_0x288fed);}return _0x5d15ff[_0x2835('0x25')]();};}function saveUpdates(_0xcef503,_0x2a349b){return function(_0x5f1715){if(_0x5f1715){return _0x5f1715[_0x2835('0x26')](_0xcef503)[_0x2835('0x27')](function(_0x849f3){return _0x849f3;});}return null;};}function removeEntity(_0x1b5c3e,_0x29a48f){return function(_0x4911b2){if(_0x4911b2){return _0x4911b2['destroy']()[_0x2835('0x27')](function(){_0x1b5c3e[_0x2835('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b1c15,_0xfa70d8){return function(_0x3dfb91){if(!_0x3dfb91){_0x5b1c15[_0x2835('0x1a')](0x194);}return _0x3dfb91;};}function handleError(_0x451e5d,_0x560122){_0x560122=_0x560122||0x1f4;return function(_0x33b400){logger['error'](_0x33b400[_0x2835('0x28')]);if(_0x33b400[_0x2835('0x29')]){delete _0x33b400[_0x2835('0x29')];}_0x451e5d[_0x2835('0x1b')](_0x560122)[_0x2835('0x2a')](_0x33b400);};}exports[_0x2835('0x2b')]=function(_0x4f8c49,_0x1b9348){var _0x54067c={},_0x160168={},_0x7891c={'count':0x0,'rows':[]};var _0x4048ac=_[_0x2835('0x2c')](db[_0x2835('0x2d')][_0x2835('0x2e')],function(_0x40cfbf){return{'name':_0x40cfbf['fieldName'],'type':_0x40cfbf[_0x2835('0x2f')][_0x2835('0x30')]};});_0x160168[_0x2835('0x31')]=_[_0x2835('0x2c')](_0x4048ac,'name');_0x160168[_0x2835('0x32')]=_[_0x2835('0x33')](_0x4f8c49[_0x2835('0x32')]);_0x160168[_0x2835('0x34')]=_[_0x2835('0x35')](_0x160168['model'],_0x160168[_0x2835('0x32')]);_0x54067c[_0x2835('0x36')]=_[_0x2835('0x35')](_0x160168[_0x2835('0x31')],qs[_0x2835('0x37')](_0x4f8c49[_0x2835('0x32')]['fields']));_0x54067c['attributes']=_0x54067c[_0x2835('0x36')]['length']?_0x54067c[_0x2835('0x36')]:_0x160168[_0x2835('0x31')];if(!_0x4f8c49[_0x2835('0x32')][_0x2835('0x38')](_0x2835('0x39'))){_0x54067c['limit']=qs[_0x2835('0x20')](_0x4f8c49[_0x2835('0x32')][_0x2835('0x20')]);_0x54067c[_0x2835('0x1e')]=qs[_0x2835('0x1e')](_0x4f8c49[_0x2835('0x32')][_0x2835('0x1e')]);}_0x54067c[_0x2835('0x3a')]=qs['sort'](_0x4f8c49['query'][_0x2835('0x3b')]);_0x54067c['where']=qs[_0x2835('0x34')](_['pick'](_0x4f8c49[_0x2835('0x32')],_0x160168[_0x2835('0x34')]),_0x4048ac);if(_0x4f8c49[_0x2835('0x32')][_0x2835('0x3c')]){_0x54067c[_0x2835('0x3d')]=_[_0x2835('0x3e')](_0x54067c[_0x2835('0x3d')],{'$or':_[_0x2835('0x2c')](_0x4048ac,function(_0x5f32e8){if(_0x5f32e8[_0x2835('0x2f')]!==_0x2835('0x3f')){var _0x16468e={};_0x16468e[_0x5f32e8['name']]={'$like':'%'+_0x4f8c49[_0x2835('0x32')][_0x2835('0x3c')]+'%'};return _0x16468e;}})});}_0x54067c=_[_0x2835('0x3e')]({},_0x54067c,_0x4f8c49[_0x2835('0x40')]);var _0x24a172={'where':_0x54067c[_0x2835('0x3d')]};return db[_0x2835('0x2d')][_0x2835('0x21')](_0x24a172)[_0x2835('0x27')](function(_0x17a4ab){_0x7891c[_0x2835('0x21')]=_0x17a4ab;if(_0x4f8c49[_0x2835('0x32')][_0x2835('0x41')]){_0x54067c[_0x2835('0x42')]=[{'all':!![]}];}return db[_0x2835('0x2d')][_0x2835('0x43')](_0x54067c);})[_0x2835('0x27')](function(_0x2eed88){_0x7891c[_0x2835('0x44')]=_0x2eed88;return _0x7891c;})[_0x2835('0x27')](respondWithFilteredResult(_0x1b9348,_0x54067c))[_0x2835('0x45')](handleError(_0x1b9348,null));};exports['show']=function(_0x4c5229,_0x330326){var _0x4903c7={'raw':!![],'where':{'id':_0x4c5229[_0x2835('0x46')]['id']}},_0x530377={};_0x530377[_0x2835('0x31')]=_[_0x2835('0x33')](db['SmsQueueReport'][_0x2835('0x2e')]);_0x530377[_0x2835('0x32')]=_['keys'](_0x4c5229[_0x2835('0x32')]);_0x530377[_0x2835('0x34')]=_[_0x2835('0x35')](_0x530377[_0x2835('0x31')],_0x530377[_0x2835('0x32')]);_0x4903c7[_0x2835('0x36')]=_[_0x2835('0x35')](_0x530377[_0x2835('0x31')],qs[_0x2835('0x37')](_0x4c5229[_0x2835('0x32')][_0x2835('0x37')]));_0x4903c7[_0x2835('0x36')]=_0x4903c7['attributes'][_0x2835('0x47')]?_0x4903c7[_0x2835('0x36')]:_0x530377['model'];if(_0x4c5229[_0x2835('0x32')][_0x2835('0x41')]){_0x4903c7[_0x2835('0x42')]=[{'all':!![]}];}_0x4903c7=_[_0x2835('0x3e')]({},_0x4903c7,_0x4c5229['options']);return db[_0x2835('0x2d')][_0x2835('0x48')](_0x4903c7)[_0x2835('0x27')](handleEntityNotFound(_0x330326,null))['then'](respondWithResult(_0x330326,null))['catch'](handleError(_0x330326,null));};exports[_0x2835('0x49')]=function(_0x2bfb93,_0x319f25){return db[_0x2835('0x2d')][_0x2835('0x49')](_0x2bfb93[_0x2835('0x4a')],{})[_0x2835('0x27')](respondWithResult(_0x319f25,0xc9))[_0x2835('0x45')](handleError(_0x319f25,null));};exports[_0x2835('0x26')]=function(_0x548c6c,_0x22cd4f){if(_0x548c6c[_0x2835('0x4a')]['id']){delete _0x548c6c[_0x2835('0x4a')]['id'];}return db[_0x2835('0x2d')][_0x2835('0x48')]({'where':{'id':_0x548c6c[_0x2835('0x46')]['id']}})[_0x2835('0x27')](handleEntityNotFound(_0x22cd4f,null))[_0x2835('0x27')](saveUpdates(_0x548c6c[_0x2835('0x4a')],null))['then'](respondWithResult(_0x22cd4f,null))[_0x2835('0x45')](handleError(_0x22cd4f,null));};exports[_0x2835('0x4b')]=function(_0xd6c065,_0x17795a){return db[_0x2835('0x2d')][_0x2835('0x48')]({'where':{'id':_0xd6c065[_0x2835('0x46')]['id']}})[_0x2835('0x27')](handleEntityNotFound(_0x17795a,null))[_0x2835('0x27')](removeEntity(_0x17795a,null))['catch'](handleError(_0x17795a,null));};exports['describe']=function(_0x2c616b,_0x203216){return db[_0x2835('0x2d')]['describe']()[_0x2835('0x27')](respondWithResult(_0x203216,null))['catch'](handleError(_0x203216,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 7c2737c..da95a13 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 _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x8a240f,_0x1f6bf9){var _0x16a92b=function(_0x5cda68){while(--_0x5cda68){_0x8a240f['push'](_0x8a240f['shift']());}};_0x16a92b(++_0x1f6bf9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xb7e7[_0x424a9a];return _0xa7831c;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 648eeef..9b7fffc 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 _0xd3fe=['UpdateSmsQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','create','body','options','raw','CreateSmsQueueReport','stringify','SmsQueueReport','update','where','limit'];(function(_0x18b34e,_0x2f643a){var _0x1e693b=function(_0x7b6599){while(--_0x7b6599){_0x18b34e['push'](_0x18b34e['shift']());}};_0x1e693b(++_0x2f643a);}(_0xd3fe,0x155));var _0xed3f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd3fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xed3f('0x0'));var util=require('util');var moment=require(_0xed3f('0x1'));var BPromise=require(_0xed3f('0x2'));var rs=require(_0xed3f('0x3'));var fs=require('fs');var Redis=require(_0xed3f('0x4'));var db=require(_0xed3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xed3f('0x6'))(_0xed3f('0x7'));var config=require(_0xed3f('0x8'));var jayson=require(_0xed3f('0x9'));var client=jayson[_0xed3f('0xa')][_0xed3f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39c15c,_0x44a351,_0x31216e){return new BPromise(function(_0x54b0c7,_0x5ea0b8){return client[_0xed3f('0xc')](_0x39c15c,_0x31216e)[_0xed3f('0xd')](function(_0x336427){logger[_0xed3f('0xe')](_0xed3f('0xf'),_0x44a351,_0xed3f('0x10'));logger[_0xed3f('0x11')](_0xed3f('0x12'),_0x44a351,_0xed3f('0x10'),JSON['stringify'](_0x336427));if(_0x336427['error']){if(_0x336427[_0xed3f('0x13')]['code']===0x1f4){logger[_0xed3f('0x13')](_0xed3f('0xf'),_0x44a351,_0x336427[_0xed3f('0x13')][_0xed3f('0x14')]);return _0x5ea0b8(_0x336427[_0xed3f('0x13')][_0xed3f('0x14')]);}logger[_0xed3f('0x13')](_0xed3f('0xf'),_0x44a351,_0x336427[_0xed3f('0x13')][_0xed3f('0x14')]);return _0x54b0c7(_0x336427[_0xed3f('0x13')][_0xed3f('0x14')]);}else{logger[_0xed3f('0xe')](_0xed3f('0xf'),_0x44a351,_0xed3f('0x10'));_0x54b0c7(_0x336427[_0xed3f('0x15')][_0xed3f('0x14')]);}})[_0xed3f('0x16')](function(_0x5710a0){logger[_0xed3f('0x13')](_0xed3f('0xf'),_0x44a351,_0x5710a0);_0x5ea0b8(_0x5710a0);});});}exports['CreateSmsQueueReport']=function(_0x1ef803){var _0x272cff=this;return new Promise(function(_0x3029ba,_0x2b74ac){return db['SmsQueueReport'][_0xed3f('0x17')](_0x1ef803[_0xed3f('0x18')],{'raw':_0x1ef803[_0xed3f('0x19')]?_0x1ef803['options'][_0xed3f('0x1a')]===undefined?!![]:![]:!![]})[_0xed3f('0xd')](function(_0x11c3ee){logger['info']('CreateSmsQueueReport',_0x1ef803);logger[_0xed3f('0x11')](_0xed3f('0x1b'),_0x1ef803,JSON[_0xed3f('0x1c')](_0x11c3ee));_0x3029ba(_0x11c3ee);})[_0xed3f('0x16')](function(_0x55fd88){logger[_0xed3f('0x13')](_0xed3f('0x1b'),_0x55fd88[_0xed3f('0x14')],_0x1ef803);_0x2b74ac(_0x272cff[_0xed3f('0x13')](0x1f4,_0x55fd88[_0xed3f('0x14')]));});});};exports['UpdateSmsQueueReport']=function(_0x5c42eb){var _0x3b151e=this;return new Promise(function(_0x3389d0,_0x517217){return db[_0xed3f('0x1d')][_0xed3f('0x1e')](_0x5c42eb[_0xed3f('0x18')],{'raw':_0x5c42eb[_0xed3f('0x19')]?_0x5c42eb[_0xed3f('0x19')][_0xed3f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c42eb[_0xed3f('0x19')]?_0x5c42eb[_0xed3f('0x19')][_0xed3f('0x1f')]||null:null,'attributes':_0x5c42eb[_0xed3f('0x19')]?_0x5c42eb[_0xed3f('0x19')]['attributes']||null:null,'limit':_0x5c42eb['options']?_0x5c42eb[_0xed3f('0x19')][_0xed3f('0x20')]||null:null})[_0xed3f('0xd')](function(_0x5723a2){logger['info']('UpdateSmsQueueReport',_0x5c42eb);logger[_0xed3f('0x11')](_0xed3f('0x21'),_0x5c42eb,JSON[_0xed3f('0x1c')](_0x5723a2));_0x3389d0(_0x5723a2);})[_0xed3f('0x16')](function(_0x4822bf){logger['error'](_0xed3f('0x21'),_0x4822bf['message'],_0x5c42eb);_0x517217(_0x3b151e[_0xed3f('0x13')](0x1f4,_0x4822bf[_0xed3f('0x14')]));});});}; \ No newline at end of file +var _0xe957=['http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','create','body','options','raw','CreateSmsQueueReport','update','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x51ce98,_0x3605bb){var _0x9ee315=function(_0x824af6){while(--_0x824af6){_0x51ce98['push'](_0x51ce98['shift']());}};_0x9ee315(++_0x3605bb);}(_0xe957,0x99));var _0x7e95=function(_0x1b9786,_0x616794){_0x1b9786=_0x1b9786-0x0;var _0x3d39a5=_0xe957[_0x1b9786];return _0x3d39a5;};'use strict';var _=require(_0x7e95('0x0'));var util=require(_0x7e95('0x1'));var moment=require(_0x7e95('0x2'));var BPromise=require(_0x7e95('0x3'));var rs=require(_0x7e95('0x4'));var fs=require('fs');var Redis=require(_0x7e95('0x5'));var db=require(_0x7e95('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e95('0x7'))(_0x7e95('0x8'));var config=require(_0x7e95('0x9'));var jayson=require(_0x7e95('0xa'));var client=jayson[_0x7e95('0xb')][_0x7e95('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xae45cb,_0x2b5f15,_0x3d49f3){return new BPromise(function(_0x3054e1,_0xef7fd3){return client[_0x7e95('0xd')](_0xae45cb,_0x3d49f3)[_0x7e95('0xe')](function(_0x3e4d60){logger[_0x7e95('0xf')](_0x7e95('0x10'),_0x2b5f15,'request\x20sent');logger[_0x7e95('0x11')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x2b5f15,_0x7e95('0x12'),JSON[_0x7e95('0x13')](_0x3e4d60));if(_0x3e4d60['error']){if(_0x3e4d60['error'][_0x7e95('0x14')]===0x1f4){logger[_0x7e95('0x15')](_0x7e95('0x10'),_0x2b5f15,_0x3e4d60[_0x7e95('0x15')][_0x7e95('0x16')]);return _0xef7fd3(_0x3e4d60[_0x7e95('0x15')][_0x7e95('0x16')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x2b5f15,_0x3e4d60[_0x7e95('0x15')][_0x7e95('0x16')]);return _0x3054e1(_0x3e4d60['error'][_0x7e95('0x16')]);}else{logger[_0x7e95('0xf')](_0x7e95('0x10'),_0x2b5f15,'request\x20sent');_0x3054e1(_0x3e4d60[_0x7e95('0x17')][_0x7e95('0x16')]);}})[_0x7e95('0x18')](function(_0x15f780){logger[_0x7e95('0x15')](_0x7e95('0x10'),_0x2b5f15,_0x15f780);_0xef7fd3(_0x15f780);});});}exports['CreateSmsQueueReport']=function(_0x36b5b2){var _0x4480be=this;return new Promise(function(_0x17af8c,_0xcd3d7c){return db['SmsQueueReport'][_0x7e95('0x19')](_0x36b5b2[_0x7e95('0x1a')],{'raw':_0x36b5b2[_0x7e95('0x1b')]?_0x36b5b2[_0x7e95('0x1b')][_0x7e95('0x1c')]===undefined?!![]:![]:!![]})[_0x7e95('0xe')](function(_0x42c569){logger[_0x7e95('0xf')](_0x7e95('0x1d'),_0x36b5b2);logger[_0x7e95('0x11')](_0x7e95('0x1d'),_0x36b5b2,JSON[_0x7e95('0x13')](_0x42c569));_0x17af8c(_0x42c569);})[_0x7e95('0x18')](function(_0x5b6808){logger[_0x7e95('0x15')](_0x7e95('0x1d'),_0x5b6808['message'],_0x36b5b2);_0xcd3d7c(_0x4480be[_0x7e95('0x15')](0x1f4,_0x5b6808['message']));});});};exports['UpdateSmsQueueReport']=function(_0x257e3d){var _0x55d268=this;return new Promise(function(_0x535dc6,_0x5e6adc){return db['SmsQueueReport'][_0x7e95('0x1e')](_0x257e3d['body'],{'raw':_0x257e3d[_0x7e95('0x1b')]?_0x257e3d[_0x7e95('0x1b')][_0x7e95('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x257e3d[_0x7e95('0x1b')]?_0x257e3d[_0x7e95('0x1b')]['where']||null:null,'attributes':_0x257e3d['options']?_0x257e3d[_0x7e95('0x1b')]['attributes']||null:null,'limit':_0x257e3d[_0x7e95('0x1b')]?_0x257e3d[_0x7e95('0x1b')][_0x7e95('0x1f')]||null:null})[_0x7e95('0xe')](function(_0x53ef44){logger['info'](_0x7e95('0x20'),_0x257e3d);logger[_0x7e95('0x11')](_0x7e95('0x20'),_0x257e3d,JSON[_0x7e95('0x13')](_0x53ef44));_0x535dc6(_0x53ef44);})[_0x7e95('0x18')](function(_0x476131){logger[_0x7e95('0x15')](_0x7e95('0x20'),_0x476131[_0x7e95('0x16')],_0x257e3d);_0x5e6adc(_0x55d268[_0x7e95('0x15')](0x1f4,_0x476131['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index c26f8ee..1290d80 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 _0x31f0=['./smsTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x51f923,_0x37ed33){var _0x5d906d=function(_0x4f23eb){while(--_0x4f23eb){_0x51f923['push'](_0x51f923['shift']());}};_0x5d906d(++_0x37ed33);}(_0x31f0,0xb7));var _0x031f=function(_0x4e383f,_0x18f1bf){_0x4e383f=_0x4e383f-0x0;var _0xc1fa1d=_0x31f0[_0x4e383f];return _0xc1fa1d;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var fs_extra=require(_0x031f('0x4'));var auth=require(_0x031f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x031f('0x6'));var controller=require(_0x031f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x031f('0x8')]('/describe',auth[_0x031f('0x9')](),controller[_0x031f('0xa')]);router[_0x031f('0x8')](_0x031f('0xb'),auth['isAuthenticated'](),controller[_0x031f('0xc')]);router[_0x031f('0xd')]('/',auth[_0x031f('0x9')](),controller[_0x031f('0xe')]);router[_0x031f('0xf')](_0x031f('0xb'),auth[_0x031f('0x9')](),controller[_0x031f('0x10')]);router['delete'](_0x031f('0xb'),auth[_0x031f('0x9')](),controller[_0x031f('0x11')]);module[_0x031f('0x12')]=router; \ No newline at end of file +var _0x6aa7=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','post','create','put','update','delete','exports','multer','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6aa7,0x178));var _0x76aa=function(_0x20920b,_0x525837){_0x20920b=_0x20920b-0x0;var _0x4d5e03=_0x6aa7[_0x20920b];return _0x4d5e03;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0xc')]('/',auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0xe')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x10')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['destroy']);module[_0x76aa('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 c9366b8..c7dd735 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x2d38f0,_0x79ecf){var _0x4f0ee2=function(_0x3f5b2b){while(--_0x3f5b2b){_0x2d38f0['push'](_0x2d38f0['shift']());}};_0x4f0ee2(++_0x79ecf);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xcb91[_0x2ed8f3];return _0x525a55;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x3ff9d2,_0x112a99){var _0x4cc269=function(_0x2a0353){while(--_0x2a0353){_0x3ff9d2['push'](_0x3ff9d2['shift']());}};_0x4cc269(++_0x112a99);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index e750493..989fe5c 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 _0xa1c2=['merge','options','includeAll','rows','catch','show','params','include','create','body','update','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','where','filter'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0xa1c2,0x9d));var _0x2a1c=function(_0x4fdcc0,_0x560a01){_0x4fdcc0=_0x4fdcc0-0x0;var _0xc0ce94=_0xa1c2[_0x4fdcc0];return _0xc0ce94;};'use strict';var emlformat=require(_0x2a1c('0x0'));var rimraf=require(_0x2a1c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a1c('0x2'));var rp=require(_0x2a1c('0x3'));var moment=require(_0x2a1c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2a1c('0x5'));var path=require('path');var sox=require(_0x2a1c('0x6'));var csv=require(_0x2a1c('0x7'));var ejs=require(_0x2a1c('0x8'));var fs=require('fs');var fs_extra=require(_0x2a1c('0x9'));var _=require(_0x2a1c('0xa'));var squel=require(_0x2a1c('0xb'));var crypto=require('crypto');var jsforce=require(_0x2a1c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2a1c('0x7'));var querystring=require(_0x2a1c('0xd'));var Papa=require('papaparse');var Redis=require(_0x2a1c('0xe'));var authService=require(_0x2a1c('0xf'));var qs=require(_0x2a1c('0x10'));var as=require(_0x2a1c('0x11'));var hardwareService=require(_0x2a1c('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x2a1c('0x13'));var config=require(_0x2a1c('0x14'));var licenseUtil=require(_0x2a1c('0x15'));var db=require(_0x2a1c('0x16'))['db'];function respondWithStatusCode(_0xceeb42,_0x3d5898){_0x3d5898=_0x3d5898||0xcc;return function(_0x599c78){if(_0x599c78){return _0xceeb42[_0x2a1c('0x17')](_0x3d5898);}return _0xceeb42[_0x2a1c('0x18')](_0x3d5898)['end']();};}function respondWithResult(_0x2bd0d1,_0x41783d){_0x41783d=_0x41783d||0xc8;return function(_0x2a0267){if(_0x2a0267){return _0x2bd0d1[_0x2a1c('0x18')](_0x41783d)[_0x2a1c('0x19')](_0x2a0267);}};}function respondWithFilteredResult(_0x42b490,_0x427049){return function(_0x53478b){if(_0x53478b){var _0x5c56ec=typeof _0x427049[_0x2a1c('0x1a')]===_0x2a1c('0x1b')&&typeof _0x427049[_0x2a1c('0x1c')]===_0x2a1c('0x1b');var _0x20e24b=_0x53478b[_0x2a1c('0x1d')];var _0x419ca0=_0x5c56ec?0x0:_0x427049[_0x2a1c('0x1a')];var _0x12e383=_0x5c56ec?_0x53478b[_0x2a1c('0x1d')]:_0x427049[_0x2a1c('0x1a')]+_0x427049[_0x2a1c('0x1c')];var _0x3d8743;if(_0x12e383>=_0x20e24b){_0x12e383=_0x20e24b;_0x3d8743=0xc8;}else{_0x3d8743=0xce;}_0x42b490[_0x2a1c('0x18')](_0x3d8743);return _0x42b490['set'](_0x2a1c('0x1e'),_0x419ca0+'-'+_0x12e383+'/'+_0x20e24b)[_0x2a1c('0x19')](_0x53478b);}return null;};}function patchUpdates(_0x4ece93){return function(_0x4519be){try{jsonpatch[_0x2a1c('0x1f')](_0x4519be,_0x4ece93,!![]);}catch(_0x171be9){return BPromise[_0x2a1c('0x20')](_0x171be9);}return _0x4519be[_0x2a1c('0x21')]();};}function saveUpdates(_0x3623f5,_0x54b6f3){return function(_0x34365e){if(_0x34365e){return _0x34365e['update'](_0x3623f5)['then'](function(_0x1ab44f){return _0x1ab44f;});}return null;};}function removeEntity(_0x13643b,_0x35191f){return function(_0x41bc54){if(_0x41bc54){return _0x41bc54[_0x2a1c('0x22')]()[_0x2a1c('0x23')](function(){_0x13643b[_0x2a1c('0x18')](0xcc)[_0x2a1c('0x24')]();});}};}function handleEntityNotFound(_0xf7e71a,_0x5ce1fa){return function(_0x3e6d8d){if(!_0x3e6d8d){_0xf7e71a[_0x2a1c('0x17')](0x194);}return _0x3e6d8d;};}function handleError(_0x45d832,_0x5699ad){_0x5699ad=_0x5699ad||0x1f4;return function(_0x528ad0){logger[_0x2a1c('0x25')](_0x528ad0[_0x2a1c('0x26')]);if(_0x528ad0[_0x2a1c('0x27')]){delete _0x528ad0[_0x2a1c('0x27')];}_0x45d832[_0x2a1c('0x18')](_0x5699ad)[_0x2a1c('0x28')](_0x528ad0);};}exports['index']=function(_0x2c0eb5,_0x163f73){var _0x47c964={},_0x579dd6={},_0x47dfb4={'count':0x0,'rows':[]};var _0x1e3030=_[_0x2a1c('0x29')](db[_0x2a1c('0x2a')][_0x2a1c('0x2b')],function(_0x5a1d2f){return{'name':_0x5a1d2f[_0x2a1c('0x2c')],'type':_0x5a1d2f[_0x2a1c('0x2d')][_0x2a1c('0x2e')]};});_0x579dd6['model']=_['map'](_0x1e3030,_0x2a1c('0x27'));_0x579dd6[_0x2a1c('0x2f')]=_[_0x2a1c('0x30')](_0x2c0eb5[_0x2a1c('0x2f')]);_0x579dd6[_0x2a1c('0x31')]=_[_0x2a1c('0x32')](_0x579dd6[_0x2a1c('0x33')],_0x579dd6[_0x2a1c('0x2f')]);_0x47c964[_0x2a1c('0x34')]=_[_0x2a1c('0x32')](_0x579dd6[_0x2a1c('0x33')],qs[_0x2a1c('0x35')](_0x2c0eb5[_0x2a1c('0x2f')][_0x2a1c('0x35')]));_0x47c964[_0x2a1c('0x34')]=_0x47c964['attributes'][_0x2a1c('0x36')]?_0x47c964['attributes']:_0x579dd6[_0x2a1c('0x33')];if(!_0x2c0eb5[_0x2a1c('0x2f')]['hasOwnProperty'](_0x2a1c('0x37'))){_0x47c964[_0x2a1c('0x1c')]=qs['limit'](_0x2c0eb5['query'][_0x2a1c('0x1c')]);_0x47c964[_0x2a1c('0x1a')]=qs[_0x2a1c('0x1a')](_0x2c0eb5[_0x2a1c('0x2f')][_0x2a1c('0x1a')]);}_0x47c964[_0x2a1c('0x38')]=qs['sort'](_0x2c0eb5[_0x2a1c('0x2f')]['sort']);_0x47c964['where']=qs[_0x2a1c('0x31')](_['pick'](_0x2c0eb5[_0x2a1c('0x2f')],_0x579dd6[_0x2a1c('0x31')]),_0x1e3030);if(_0x2c0eb5['query']['filter']){_0x47c964[_0x2a1c('0x39')]=_['merge'](_0x47c964[_0x2a1c('0x39')],{'$or':_[_0x2a1c('0x29')](_0x1e3030,function(_0x34c885){if(_0x34c885[_0x2a1c('0x2d')]!=='VIRTUAL'){var _0x49026f={};_0x49026f[_0x34c885[_0x2a1c('0x27')]]={'$like':'%'+_0x2c0eb5['query'][_0x2a1c('0x3a')]+'%'};return _0x49026f;}})});}_0x47c964=_[_0x2a1c('0x3b')]({},_0x47c964,_0x2c0eb5[_0x2a1c('0x3c')]);var _0x35229a={'where':_0x47c964['where']};return db[_0x2a1c('0x2a')][_0x2a1c('0x1d')](_0x35229a)[_0x2a1c('0x23')](function(_0x4da749){_0x47dfb4[_0x2a1c('0x1d')]=_0x4da749;if(_0x2c0eb5['query'][_0x2a1c('0x3d')]){_0x47c964['include']=[{'all':!![]}];}return db[_0x2a1c('0x2a')]['findAll'](_0x47c964);})[_0x2a1c('0x23')](function(_0xe3f741){_0x47dfb4[_0x2a1c('0x3e')]=_0xe3f741;return _0x47dfb4;})[_0x2a1c('0x23')](respondWithFilteredResult(_0x163f73,_0x47c964))[_0x2a1c('0x3f')](handleError(_0x163f73,null));};exports[_0x2a1c('0x40')]=function(_0x22d3b1,_0x19e700){var _0xd47685={'raw':!![],'where':{'id':_0x22d3b1[_0x2a1c('0x41')]['id']}},_0x228e34={};_0x228e34['model']=_[_0x2a1c('0x30')](db['SmsTransferReport']['rawAttributes']);_0x228e34[_0x2a1c('0x2f')]=_[_0x2a1c('0x30')](_0x22d3b1[_0x2a1c('0x2f')]);_0x228e34['filters']=_[_0x2a1c('0x32')](_0x228e34[_0x2a1c('0x33')],_0x228e34[_0x2a1c('0x2f')]);_0xd47685[_0x2a1c('0x34')]=_[_0x2a1c('0x32')](_0x228e34['model'],qs[_0x2a1c('0x35')](_0x22d3b1[_0x2a1c('0x2f')]['fields']));_0xd47685[_0x2a1c('0x34')]=_0xd47685[_0x2a1c('0x34')][_0x2a1c('0x36')]?_0xd47685['attributes']:_0x228e34[_0x2a1c('0x33')];if(_0x22d3b1[_0x2a1c('0x2f')][_0x2a1c('0x3d')]){_0xd47685[_0x2a1c('0x42')]=[{'all':!![]}];}_0xd47685=_[_0x2a1c('0x3b')]({},_0xd47685,_0x22d3b1[_0x2a1c('0x3c')]);return db['SmsTransferReport']['find'](_0xd47685)[_0x2a1c('0x23')](handleEntityNotFound(_0x19e700,null))['then'](respondWithResult(_0x19e700,null))[_0x2a1c('0x3f')](handleError(_0x19e700,null));};exports[_0x2a1c('0x43')]=function(_0x55b3aa,_0x3d5a1d){return db[_0x2a1c('0x2a')][_0x2a1c('0x43')](_0x55b3aa[_0x2a1c('0x44')],{})['then'](respondWithResult(_0x3d5a1d,0xc9))[_0x2a1c('0x3f')](handleError(_0x3d5a1d,null));};exports[_0x2a1c('0x45')]=function(_0xe13370,_0x5162ac){if(_0xe13370[_0x2a1c('0x44')]['id']){delete _0xe13370['body']['id'];}return db[_0x2a1c('0x2a')][_0x2a1c('0x46')]({'where':{'id':_0xe13370['params']['id']}})[_0x2a1c('0x23')](handleEntityNotFound(_0x5162ac,null))['then'](saveUpdates(_0xe13370[_0x2a1c('0x44')],null))['then'](respondWithResult(_0x5162ac,null))['catch'](handleError(_0x5162ac,null));};exports['destroy']=function(_0x546478,_0x293fbf){return db[_0x2a1c('0x2a')][_0x2a1c('0x46')]({'where':{'id':_0x546478[_0x2a1c('0x41')]['id']}})[_0x2a1c('0x23')](handleEntityNotFound(_0x293fbf,null))['then'](removeEntity(_0x293fbf,null))[_0x2a1c('0x3f')](handleError(_0x293fbf,null));};exports[_0x2a1c('0x47')]=function(_0x5df103,_0x3fabb2){return db[_0x2a1c('0x2a')]['describe']()[_0x2a1c('0x23')](respondWithResult(_0x3fabb2,null))[_0x2a1c('0x3f')](handleError(_0x3fabb2,null));}; \ No newline at end of file +var _0xf7f2=['error','name','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','includeAll','include','find','body','describe','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy'];(function(_0x40d9e2,_0x32eaae){var _0xd999f1=function(_0xd09244){while(--_0xd09244){_0x40d9e2['push'](_0x40d9e2['shift']());}};_0xd999f1(++_0x32eaae);}(_0xf7f2,0x6c));var _0x2f7f=function(_0x1fd4d7,_0x2feafd){_0x1fd4d7=_0x1fd4d7-0x0;var _0x7efe8a=_0xf7f2[_0x1fd4d7];return _0x7efe8a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f7f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f7f('0x1'));var rp=require(_0x2f7f('0x2'));var moment=require('moment');var BPromise=require(_0x2f7f('0x3'));var Mustache=require('mustache');var util=require(_0x2f7f('0x4'));var path=require(_0x2f7f('0x5'));var sox=require(_0x2f7f('0x6'));var csv=require(_0x2f7f('0x7'));var ejs=require(_0x2f7f('0x8'));var fs=require('fs');var fs_extra=require(_0x2f7f('0x9'));var _=require(_0x2f7f('0xa'));var squel=require(_0x2f7f('0xb'));var crypto=require(_0x2f7f('0xc'));var jsforce=require(_0x2f7f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2f7f('0x7'));var querystring=require('querystring');var Papa=require(_0x2f7f('0xe'));var Redis=require(_0x2f7f('0xf'));var authService=require(_0x2f7f('0x10'));var qs=require(_0x2f7f('0x11'));var as=require(_0x2f7f('0x12'));var hardwareService=require(_0x2f7f('0x13'));var logger=require(_0x2f7f('0x14'))(_0x2f7f('0x15'));var utils=require(_0x2f7f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2f7f('0x17'));var db=require(_0x2f7f('0x18'))['db'];function respondWithStatusCode(_0x10c3fa,_0x5c421b){_0x5c421b=_0x5c421b||0xcc;return function(_0x2f129f){if(_0x2f129f){return _0x10c3fa[_0x2f7f('0x19')](_0x5c421b);}return _0x10c3fa[_0x2f7f('0x1a')](_0x5c421b)[_0x2f7f('0x1b')]();};}function respondWithResult(_0x1ab1be,_0x5432d2){_0x5432d2=_0x5432d2||0xc8;return function(_0x2604d2){if(_0x2604d2){return _0x1ab1be[_0x2f7f('0x1a')](_0x5432d2)['json'](_0x2604d2);}};}function respondWithFilteredResult(_0x2713d2,_0x1b868f){return function(_0x432450){if(_0x432450){var _0x295b58=typeof _0x1b868f[_0x2f7f('0x1c')]===_0x2f7f('0x1d')&&typeof _0x1b868f[_0x2f7f('0x1e')]===_0x2f7f('0x1d');var _0x377d7d=_0x432450[_0x2f7f('0x1f')];var _0x70de10=_0x295b58?0x0:_0x1b868f[_0x2f7f('0x1c')];var _0x5f2e36=_0x295b58?_0x432450[_0x2f7f('0x1f')]:_0x1b868f[_0x2f7f('0x1c')]+_0x1b868f[_0x2f7f('0x1e')];var _0x443f49;if(_0x5f2e36>=_0x377d7d){_0x5f2e36=_0x377d7d;_0x443f49=0xc8;}else{_0x443f49=0xce;}_0x2713d2[_0x2f7f('0x1a')](_0x443f49);return _0x2713d2[_0x2f7f('0x20')](_0x2f7f('0x21'),_0x70de10+'-'+_0x5f2e36+'/'+_0x377d7d)['json'](_0x432450);}return null;};}function patchUpdates(_0x38e5eb){return function(_0x46a08d){try{jsonpatch[_0x2f7f('0x22')](_0x46a08d,_0x38e5eb,!![]);}catch(_0x532658){return BPromise['reject'](_0x532658);}return _0x46a08d[_0x2f7f('0x23')]();};}function saveUpdates(_0x49bc9a,_0x1d4da8){return function(_0x60a35c){if(_0x60a35c){return _0x60a35c['update'](_0x49bc9a)[_0x2f7f('0x24')](function(_0x4cee50){return _0x4cee50;});}return null;};}function removeEntity(_0x3ebc4c,_0x1b59f5){return function(_0x27e3a1){if(_0x27e3a1){return _0x27e3a1[_0x2f7f('0x25')]()[_0x2f7f('0x24')](function(){_0x3ebc4c[_0x2f7f('0x1a')](0xcc)[_0x2f7f('0x1b')]();});}};}function handleEntityNotFound(_0xeea7e6,_0x17dc29){return function(_0x1fd1e8){if(!_0x1fd1e8){_0xeea7e6[_0x2f7f('0x19')](0x194);}return _0x1fd1e8;};}function handleError(_0xefd55,_0x36c0e2){_0x36c0e2=_0x36c0e2||0x1f4;return function(_0x1eac28){logger[_0x2f7f('0x26')](_0x1eac28['stack']);if(_0x1eac28[_0x2f7f('0x27')]){delete _0x1eac28[_0x2f7f('0x27')];}_0xefd55[_0x2f7f('0x1a')](_0x36c0e2)['send'](_0x1eac28);};}exports[_0x2f7f('0x28')]=function(_0x30ae49,_0xfe5090){var _0x48dedd={},_0x2fb70b={},_0x4d3da2={'count':0x0,'rows':[]};var _0x98bc65=_[_0x2f7f('0x29')](db[_0x2f7f('0x2a')][_0x2f7f('0x2b')],function(_0x4e81c7){return{'name':_0x4e81c7[_0x2f7f('0x2c')],'type':_0x4e81c7[_0x2f7f('0x2d')][_0x2f7f('0x2e')]};});_0x2fb70b[_0x2f7f('0x2f')]=_[_0x2f7f('0x29')](_0x98bc65,_0x2f7f('0x27'));_0x2fb70b[_0x2f7f('0x30')]=_['keys'](_0x30ae49[_0x2f7f('0x30')]);_0x2fb70b[_0x2f7f('0x31')]=_['intersection'](_0x2fb70b[_0x2f7f('0x2f')],_0x2fb70b['query']);_0x48dedd[_0x2f7f('0x32')]=_[_0x2f7f('0x33')](_0x2fb70b[_0x2f7f('0x2f')],qs['fields'](_0x30ae49[_0x2f7f('0x30')][_0x2f7f('0x34')]));_0x48dedd[_0x2f7f('0x32')]=_0x48dedd[_0x2f7f('0x32')]['length']?_0x48dedd[_0x2f7f('0x32')]:_0x2fb70b[_0x2f7f('0x2f')];if(!_0x30ae49[_0x2f7f('0x30')]['hasOwnProperty'](_0x2f7f('0x35'))){_0x48dedd[_0x2f7f('0x1e')]=qs[_0x2f7f('0x1e')](_0x30ae49[_0x2f7f('0x30')][_0x2f7f('0x1e')]);_0x48dedd[_0x2f7f('0x1c')]=qs[_0x2f7f('0x1c')](_0x30ae49[_0x2f7f('0x30')][_0x2f7f('0x1c')]);}_0x48dedd[_0x2f7f('0x36')]=qs[_0x2f7f('0x37')](_0x30ae49[_0x2f7f('0x30')]['sort']);_0x48dedd[_0x2f7f('0x38')]=qs[_0x2f7f('0x31')](_[_0x2f7f('0x39')](_0x30ae49['query'],_0x2fb70b[_0x2f7f('0x31')]),_0x98bc65);if(_0x30ae49['query'][_0x2f7f('0x3a')]){_0x48dedd[_0x2f7f('0x38')]=_[_0x2f7f('0x3b')](_0x48dedd['where'],{'$or':_[_0x2f7f('0x29')](_0x98bc65,function(_0x1b17dd){if(_0x1b17dd[_0x2f7f('0x2d')]!==_0x2f7f('0x3c')){var _0x154c38={};_0x154c38[_0x1b17dd['name']]={'$like':'%'+_0x30ae49[_0x2f7f('0x30')][_0x2f7f('0x3a')]+'%'};return _0x154c38;}})});}_0x48dedd=_[_0x2f7f('0x3b')]({},_0x48dedd,_0x30ae49[_0x2f7f('0x3d')]);var _0x308218={'where':_0x48dedd[_0x2f7f('0x38')]};return db['SmsTransferReport'][_0x2f7f('0x1f')](_0x308218)['then'](function(_0x39bf9f){_0x4d3da2['count']=_0x39bf9f;if(_0x30ae49['query']['includeAll']){_0x48dedd['include']=[{'all':!![]}];}return db[_0x2f7f('0x2a')][_0x2f7f('0x3e')](_0x48dedd);})[_0x2f7f('0x24')](function(_0x211f7a){_0x4d3da2[_0x2f7f('0x3f')]=_0x211f7a;return _0x4d3da2;})[_0x2f7f('0x24')](respondWithFilteredResult(_0xfe5090,_0x48dedd))[_0x2f7f('0x40')](handleError(_0xfe5090,null));};exports[_0x2f7f('0x41')]=function(_0xaf3cb3,_0x217261){var _0xe7308b={'raw':!![],'where':{'id':_0xaf3cb3[_0x2f7f('0x42')]['id']}},_0x29838e={};_0x29838e[_0x2f7f('0x2f')]=_[_0x2f7f('0x43')](db[_0x2f7f('0x2a')][_0x2f7f('0x2b')]);_0x29838e[_0x2f7f('0x30')]=_[_0x2f7f('0x43')](_0xaf3cb3[_0x2f7f('0x30')]);_0x29838e[_0x2f7f('0x31')]=_[_0x2f7f('0x33')](_0x29838e['model'],_0x29838e[_0x2f7f('0x30')]);_0xe7308b['attributes']=_[_0x2f7f('0x33')](_0x29838e[_0x2f7f('0x2f')],qs[_0x2f7f('0x34')](_0xaf3cb3[_0x2f7f('0x30')][_0x2f7f('0x34')]));_0xe7308b[_0x2f7f('0x32')]=_0xe7308b[_0x2f7f('0x32')]['length']?_0xe7308b['attributes']:_0x29838e[_0x2f7f('0x2f')];if(_0xaf3cb3[_0x2f7f('0x30')][_0x2f7f('0x44')]){_0xe7308b[_0x2f7f('0x45')]=[{'all':!![]}];}_0xe7308b=_[_0x2f7f('0x3b')]({},_0xe7308b,_0xaf3cb3[_0x2f7f('0x3d')]);return db['SmsTransferReport'][_0x2f7f('0x46')](_0xe7308b)['then'](handleEntityNotFound(_0x217261,null))[_0x2f7f('0x24')](respondWithResult(_0x217261,null))[_0x2f7f('0x40')](handleError(_0x217261,null));};exports['create']=function(_0x4e95a9,_0x321cae){return db[_0x2f7f('0x2a')]['create'](_0x4e95a9['body'],{})['then'](respondWithResult(_0x321cae,0xc9))[_0x2f7f('0x40')](handleError(_0x321cae,null));};exports['update']=function(_0x3c914f,_0x5bc558){if(_0x3c914f[_0x2f7f('0x47')]['id']){delete _0x3c914f[_0x2f7f('0x47')]['id'];}return db[_0x2f7f('0x2a')]['find']({'where':{'id':_0x3c914f[_0x2f7f('0x42')]['id']}})['then'](handleEntityNotFound(_0x5bc558,null))[_0x2f7f('0x24')](saveUpdates(_0x3c914f[_0x2f7f('0x47')],null))[_0x2f7f('0x24')](respondWithResult(_0x5bc558,null))['catch'](handleError(_0x5bc558,null));};exports[_0x2f7f('0x25')]=function(_0x3f5741,_0x53d47d){return db[_0x2f7f('0x2a')][_0x2f7f('0x46')]({'where':{'id':_0x3f5741[_0x2f7f('0x42')]['id']}})[_0x2f7f('0x24')](handleEntityNotFound(_0x53d47d,null))[_0x2f7f('0x24')](removeEntity(_0x53d47d,null))[_0x2f7f('0x40')](handleError(_0x53d47d,null));};exports[_0x2f7f('0x48')]=function(_0x235d68,_0x28bcf1){return db[_0x2f7f('0x2a')][_0x2f7f('0x48')]()[_0x2f7f('0x24')](respondWithResult(_0x28bcf1,null))[_0x2f7f('0x40')](handleError(_0x28bcf1,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 806ecee..05f2ff7 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 _0xa162=['bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','api','moment'];(function(_0x146837,_0x2aa6a2){var _0x3d7e60=function(_0x1301ac){while(--_0x1301ac){_0x146837['push'](_0x146837['shift']());}};_0x3d7e60(++_0x2aa6a2);}(_0xa162,0x169));var _0x2a16=function(_0x4c771b,_0x2ab782){_0x4c771b=_0x4c771b-0x0;var _0x3c4f0f=_0xa162[_0x4c771b];return _0x3c4f0f;};'use strict';var _=require(_0x2a16('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2a16('0x1'));var moment=require(_0x2a16('0x2'));var BPromise=require(_0x2a16('0x3'));var rp=require(_0x2a16('0x4'));var fs=require('fs');var path=require(_0x2a16('0x5'));var rimraf=require(_0x2a16('0x6'));var config=require(_0x2a16('0x7'));var attributes=require(_0x2a16('0x8'));module['exports']=function(_0x2674f6,_0xc66f31){return _0x2674f6[_0x2a16('0x9')](_0x2a16('0xa'),attributes,{'tableName':_0x2a16('0xb'),'paranoid':![],'indexes':[{'name':_0x2a16('0xc'),'fields':[_0x2a16('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x74a3=['report_sms_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./smsTransferReport.attributes','exports','SmsTransferReport'];(function(_0x25bd0a,_0x12aa4d){var _0x1bfa51=function(_0x4ba754){while(--_0x4ba754){_0x25bd0a['push'](_0x25bd0a['shift']());}};_0x1bfa51(++_0x12aa4d);}(_0x74a3,0x1b2));var _0x374a=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x74a3[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x374a('0x0'));var util=require(_0x374a('0x1'));var logger=require(_0x374a('0x2'))('api');var moment=require(_0x374a('0x3'));var BPromise=require(_0x374a('0x4'));var rp=require(_0x374a('0x5'));var fs=require('fs');var path=require(_0x374a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x374a('0x7'));module[_0x374a('0x8')]=function(_0x3e6b2f,_0x278137){return _0x3e6b2f['define'](_0x374a('0x9'),attributes,{'tableName':_0x374a('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x374a('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 585a7a3..494037a 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 _0x9973=['http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xbee7ab,_0x485dfc){var _0x4f1e2e=function(_0x4b09d6){while(--_0x4b09d6){_0xbee7ab['push'](_0xbee7ab['shift']());}};_0x4f1e2e(++_0x485dfc);}(_0x9973,0x157));var _0x3997=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9973[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x3997('0x0'));var moment=require(_0x3997('0x1'));var BPromise=require('bluebird');var rs=require(_0x3997('0x2'));var fs=require('fs');var Redis=require(_0x3997('0x3'));var db=require(_0x3997('0x4'))['db'];var utils=require(_0x3997('0x5'));var logger=require(_0x3997('0x6'))(_0x3997('0x7'));var config=require(_0x3997('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3997('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x114d26,_0x3c6b75,_0x483d44){return new BPromise(function(_0x569ddf,_0x559dba){return client[_0x3997('0xa')](_0x114d26,_0x483d44)[_0x3997('0xb')](function(_0x1848ca){logger[_0x3997('0xc')](_0x3997('0xd'),_0x3c6b75,_0x3997('0xe'));logger[_0x3997('0xf')](_0x3997('0x10'),_0x3c6b75,_0x3997('0xe'),JSON[_0x3997('0x11')](_0x1848ca));if(_0x1848ca[_0x3997('0x12')]){if(_0x1848ca[_0x3997('0x12')][_0x3997('0x13')]===0x1f4){logger[_0x3997('0x12')](_0x3997('0xd'),_0x3c6b75,_0x1848ca[_0x3997('0x12')][_0x3997('0x14')]);return _0x559dba(_0x1848ca[_0x3997('0x12')][_0x3997('0x14')]);}logger[_0x3997('0x12')](_0x3997('0xd'),_0x3c6b75,_0x1848ca[_0x3997('0x12')][_0x3997('0x14')]);return _0x569ddf(_0x1848ca['error'][_0x3997('0x14')]);}else{logger[_0x3997('0xc')](_0x3997('0xd'),_0x3c6b75,_0x3997('0xe'));_0x569ddf(_0x1848ca['result'][_0x3997('0x14')]);}})[_0x3997('0x15')](function(_0x4cb897){logger['error'](_0x3997('0xd'),_0x3c6b75,_0x4cb897);_0x559dba(_0x4cb897);});});} \ No newline at end of file +var _0x291c=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','code'];(function(_0x26596b,_0x5b9a6f){var _0x57cb64=function(_0x5151ad){while(--_0x5151ad){_0x26596b['push'](_0x26596b['shift']());}};_0x57cb64(++_0x5b9a6f);}(_0x291c,0x137));var _0xc291=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x291c[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xc291('0x0'));var util=require(_0xc291('0x1'));var moment=require(_0xc291('0x2'));var BPromise=require(_0xc291('0x3'));var rs=require(_0xc291('0x4'));var fs=require('fs');var Redis=require(_0xc291('0x5'));var db=require(_0xc291('0x6'))['db'];var utils=require(_0xc291('0x7'));var logger=require(_0xc291('0x8'))(_0xc291('0x9'));var config=require(_0xc291('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc291('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a7459,_0x40dc89,_0x2d3526){return new BPromise(function(_0x42a6ac,_0x26e775){return client['request'](_0x5a7459,_0x2d3526)[_0xc291('0xc')](function(_0x2beb3b){logger[_0xc291('0xd')](_0xc291('0xe'),_0x40dc89,_0xc291('0xf'));logger[_0xc291('0x10')](_0xc291('0x11'),_0x40dc89,_0xc291('0xf'),JSON['stringify'](_0x2beb3b));if(_0x2beb3b['error']){if(_0x2beb3b['error'][_0xc291('0x12')]===0x1f4){logger[_0xc291('0x13')](_0xc291('0xe'),_0x40dc89,_0x2beb3b['error'][_0xc291('0x14')]);return _0x26e775(_0x2beb3b['error'][_0xc291('0x14')]);}logger[_0xc291('0x13')](_0xc291('0xe'),_0x40dc89,_0x2beb3b[_0xc291('0x13')][_0xc291('0x14')]);return _0x42a6ac(_0x2beb3b[_0xc291('0x13')][_0xc291('0x14')]);}else{logger[_0xc291('0xd')](_0xc291('0xe'),_0x40dc89,_0xc291('0xf'));_0x42a6ac(_0x2beb3b['result'][_0xc291('0x14')]);}})[_0xc291('0x15')](function(_0x5888de){logger[_0xc291('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x40dc89,_0x5888de);_0x26e775(_0x5888de);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 539287d..adf0944 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 _0xe0b3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','extname','post','single','file','create','delete','multer'];(function(_0xbcbd76,_0x25722b){var _0x503680=function(_0x163649){while(--_0x163649){_0xbcbd76['push'](_0xbcbd76['shift']());}};_0x503680(++_0x25722b);}(_0xe0b3,0x143));var _0x3e0b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe0b3[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x3e0b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3e0b('0x1'));var express=require(_0x3e0b('0x2'));var router=express[_0x3e0b('0x3')]();var fs_extra=require(_0x3e0b('0x4'));var auth=require(_0x3e0b('0x5'));var interaction=require(_0x3e0b('0x6'));var config=require(_0x3e0b('0x7'));var controller=require('./sound.controller');router[_0x3e0b('0x8')]('/',auth[_0x3e0b('0x9')](),controller[_0x3e0b('0xa')]);router[_0x3e0b('0x8')](_0x3e0b('0xb'),auth['isAuthenticated'](),controller[_0x3e0b('0xc')]);router[_0x3e0b('0x8')](_0x3e0b('0xd'),auth[_0x3e0b('0x9')](),controller[_0x3e0b('0xe')]);var upload=multer({'storage':multer[_0x3e0b('0xf')]({'destination':function(_0x120c9e,_0x3a1390,_0x30ea58){_0x30ea58(null,path[_0x3e0b('0x10')](config[_0x3e0b('0x11')],_0x3e0b('0x12')));},'filename':function(_0x448334,_0x3310a9,_0x5b96cb){_0x3310a9['originalname']=_0x3310a9[_0x3e0b('0x13')][_0x3e0b('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5b96cb(null,util['format']('%s-%s%s',path['basename'](_0x3310a9['originalname'],path[_0x3e0b('0x15')](_0x3310a9['originalname'])),Date['now'](),path[_0x3e0b('0x15')](_0x3310a9[_0x3e0b('0x13')])));}})});router[_0x3e0b('0x16')]('/',upload[_0x3e0b('0x17')](_0x3e0b('0x18')),controller[_0x3e0b('0x19')]);router['put'](_0x3e0b('0xb'),auth[_0x3e0b('0x9')](),controller['update']);router['delete']('/:id',auth[_0x3e0b('0x9')](),controller[_0x3e0b('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x3ef4=['extname','now','post','single','file','put','/:id','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename'];(function(_0x28278f,_0x574b0d){var _0x3d9f74=function(_0x306742){while(--_0x306742){_0x28278f['push'](_0x28278f['shift']());}};_0x3d9f74(++_0x574b0d);}(_0x3ef4,0x81));var _0x43ef=function(_0x2b0960,_0x525d1c){_0x2b0960=_0x2b0960-0x0;var _0x140c06=_0x3ef4[_0x2b0960];return _0x140c06;};'use strict';var multer=require(_0x43ef('0x0'));var util=require(_0x43ef('0x1'));var path=require(_0x43ef('0x2'));var timeout=require(_0x43ef('0x3'));var express=require(_0x43ef('0x4'));var router=express['Router']();var fs_extra=require(_0x43ef('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x43ef('0x6'));var controller=require(_0x43ef('0x7'));router[_0x43ef('0x8')]('/',auth[_0x43ef('0x9')](),controller[_0x43ef('0xa')]);router[_0x43ef('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x43ef('0x8')](_0x43ef('0xb'),auth['isAuthenticated'](),controller[_0x43ef('0xc')]);var upload=multer({'storage':multer[_0x43ef('0xd')]({'destination':function(_0x4bd2bd,_0x161562,_0x45c088){_0x45c088(null,path['join'](config[_0x43ef('0xe')],_0x43ef('0xf')));},'filename':function(_0x394dce,_0x4fb00a,_0x1c2d27){_0x4fb00a['originalname']=_0x4fb00a[_0x43ef('0x10')][_0x43ef('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1c2d27(null,util[_0x43ef('0x12')](_0x43ef('0x13'),path[_0x43ef('0x14')](_0x4fb00a[_0x43ef('0x10')],path[_0x43ef('0x15')](_0x4fb00a[_0x43ef('0x10')])),Date[_0x43ef('0x16')](),path['extname'](_0x4fb00a[_0x43ef('0x10')])));}})});router[_0x43ef('0x17')]('/',upload[_0x43ef('0x18')](_0x43ef('0x19')),controller['create']);router[_0x43ef('0x1a')](_0x43ef('0x1b'),auth[_0x43ef('0x9')](),controller['update']);router['delete'](_0x43ef('0x1b'),auth['isAuthenticated'](),controller[_0x43ef('0x1c')]);module[_0x43ef('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 6724063..7adf330 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 _0x1bf0=['INTEGER','BIGINT','sequelize','exports','STRING','FLOAT'];(function(_0x4bc276,_0x3a0014){var _0x3cb106=function(_0x27c889){while(--_0x27c889){_0x4bc276['push'](_0x4bc276['shift']());}};_0x3cb106(++_0x3a0014);}(_0x1bf0,0x1c4));var _0x01bf=function(_0x3e14ce,_0x3243bd){_0x3e14ce=_0x3e14ce-0x0;var _0x4a63ca=_0x1bf0[_0x3e14ce];return _0x4a63ca;};'use strict';var Sequelize=require(_0x01bf('0x0'));module[_0x01bf('0x1')]={'name':{'type':Sequelize[_0x01bf('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x01bf('0x2')]},'display_name':{'type':Sequelize[_0x01bf('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x01bf('0x2')]},'original_format':{'type':Sequelize[_0x01bf('0x2')]},'original_duration':{'type':Sequelize[_0x01bf('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x01bf('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x01bf('0x4')]},'converted_format':{'type':Sequelize[_0x01bf('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x01bf('0x5')]},'converted_channelCount':{'type':Sequelize[_0x01bf('0x4')]},'converted_bitRate':{'type':Sequelize[_0x01bf('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x01bf('0x4')]}}; \ No newline at end of file +var _0x01c8=['FLOAT','BIGINT','INTEGER','sequelize','exports','name','STRING'];(function(_0x94e784,_0x473912){var _0x130025=function(_0x2ed9e8){while(--_0x2ed9e8){_0x94e784['push'](_0x94e784['shift']());}};_0x130025(++_0x473912);}(_0x01c8,0x18b));var _0x801c=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x01c8[_0x934425];return _0x31d596;};'use strict';var Sequelize=require(_0x801c('0x0'));module[_0x801c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x801c('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x801c('0x3')]},'display_name':{'type':Sequelize[_0x801c('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x801c('0x3')]},'original_format':{'type':Sequelize[_0x801c('0x3')]},'original_duration':{'type':Sequelize[_0x801c('0x4')]},'original_sampleCount':{'type':Sequelize[_0x801c('0x5')]},'original_channelCount':{'type':Sequelize[_0x801c('0x6')]},'original_bitRate':{'type':Sequelize[_0x801c('0x5')]},'original_sampleRate':{'type':Sequelize[_0x801c('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x801c('0x5')]},'converted_channelCount':{'type':Sequelize[_0x801c('0x6')]},'converted_bitRate':{'type':Sequelize[_0x801c('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 1951d27..4240d86 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 _0x8dc3=['info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','error','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','sampleRate','dest','converted_duration','converted_channelCount','bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','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','sendStatus','status','json','limit','count','offset','set','apply','reject','save','update','then','destroy','UserProfileResource','end','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','includeAll','include','rows','catch','show','params','options','find','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','originalname','extname','filename','file','substring','wav','server/files/sounds/original'];(function(_0x448774,_0x45ddc7){var _0x46b2f6=function(_0x1dee94){while(--_0x1dee94){_0x448774['push'](_0x448774['shift']());}};_0x46b2f6(++_0x45ddc7);}(_0x8dc3,0x121));var _0x38dc=function(_0xed24f4,_0xb0ae10){_0xed24f4=_0xed24f4-0x0;var _0x256fea=_0x8dc3[_0xed24f4];return _0x256fea;};'use strict';var emlformat=require(_0x38dc('0x0'));var rimraf=require(_0x38dc('0x1'));var zipdir=require(_0x38dc('0x2'));var jsonpatch=require(_0x38dc('0x3'));var rp=require(_0x38dc('0x4'));var moment=require(_0x38dc('0x5'));var BPromise=require(_0x38dc('0x6'));var Mustache=require('mustache');var util=require(_0x38dc('0x7'));var path=require(_0x38dc('0x8'));var sox=require(_0x38dc('0x9'));var csv=require('to-csv');var ejs=require(_0x38dc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x38dc('0xb'));var crypto=require('crypto');var jsforce=require(_0x38dc('0xc'));var deskjs=require(_0x38dc('0xd'));var toCsv=require(_0x38dc('0xe'));var querystring=require(_0x38dc('0xf'));var Papa=require(_0x38dc('0x10'));var Redis=require(_0x38dc('0x11'));var authService=require(_0x38dc('0x12'));var qs=require(_0x38dc('0x13'));var as=require(_0x38dc('0x14'));var hardwareService=require(_0x38dc('0x15'));var logger=require('../../config/logger')(_0x38dc('0x16'));var utils=require(_0x38dc('0x17'));var config=require(_0x38dc('0x18'));var licenseUtil=require(_0x38dc('0x19'));var db=require(_0x38dc('0x1a'))['db'];function respondWithStatusCode(_0x17db04,_0x4d3ecb){_0x4d3ecb=_0x4d3ecb||0xcc;return function(_0x57a63a){if(_0x57a63a){return _0x17db04[_0x38dc('0x1b')](_0x4d3ecb);}return _0x17db04[_0x38dc('0x1c')](_0x4d3ecb)['end']();};}function respondWithResult(_0x10f4cd,_0x171bc8){_0x171bc8=_0x171bc8||0xc8;return function(_0x143d0f){if(_0x143d0f){return _0x10f4cd['status'](_0x171bc8)[_0x38dc('0x1d')](_0x143d0f);}};}function respondWithFilteredResult(_0x2b3cdd,_0x111bde){return function(_0x555c08){if(_0x555c08){var _0x3c0e40=typeof _0x111bde['offset']==='undefined'&&typeof _0x111bde[_0x38dc('0x1e')]==='undefined';var _0x44843b=_0x555c08[_0x38dc('0x1f')];var _0x4d23dd=_0x3c0e40?0x0:_0x111bde[_0x38dc('0x20')];var _0x11c813=_0x3c0e40?_0x555c08[_0x38dc('0x1f')]:_0x111bde[_0x38dc('0x20')]+_0x111bde[_0x38dc('0x1e')];var _0x10ca7b;if(_0x11c813>=_0x44843b){_0x11c813=_0x44843b;_0x10ca7b=0xc8;}else{_0x10ca7b=0xce;}_0x2b3cdd['status'](_0x10ca7b);return _0x2b3cdd[_0x38dc('0x21')]('Content-Range',_0x4d23dd+'-'+_0x11c813+'/'+_0x44843b)[_0x38dc('0x1d')](_0x555c08);}return null;};}function patchUpdates(_0x2de7a4){return function(_0x2d9e21){try{jsonpatch[_0x38dc('0x22')](_0x2d9e21,_0x2de7a4,!![]);}catch(_0x56cfbe){return BPromise[_0x38dc('0x23')](_0x56cfbe);}return _0x2d9e21[_0x38dc('0x24')]();};}function saveUpdates(_0x41746c,_0x31b420){return function(_0x4aa7d9){if(_0x4aa7d9){return _0x4aa7d9[_0x38dc('0x25')](_0x41746c)[_0x38dc('0x26')](function(_0x271a5e){return _0x271a5e;});}return null;};}function removeEntity(_0x2f1917,_0x353fc5){return function(_0x3218fd){if(_0x3218fd){return _0x3218fd[_0x38dc('0x27')]()[_0x38dc('0x26')](function(){var _0x12937d=_0x3218fd['get']({'plain':!![]});var _0x59a525='Sounds';return db[_0x38dc('0x28')][_0x38dc('0x27')]({'where':{'type':_0x59a525,'resourceId':_0x12937d['id']}})[_0x38dc('0x26')](function(){return _0x3218fd;});})[_0x38dc('0x26')](function(){_0x2f1917['status'](0xcc)[_0x38dc('0x29')]();});}};}function handleEntityNotFound(_0x95305b,_0x58f564){return function(_0xa3e4de){if(!_0xa3e4de){_0x95305b['sendStatus'](0x194);}return _0xa3e4de;};}function handleError(_0x48a8bb,_0x55f9b3){_0x55f9b3=_0x55f9b3||0x1f4;return function(_0x361b13){logger['error'](_0x361b13[_0x38dc('0x2a')]);if(_0x361b13[_0x38dc('0x2b')]){delete _0x361b13[_0x38dc('0x2b')];}_0x48a8bb[_0x38dc('0x1c')](_0x55f9b3)[_0x38dc('0x2c')](_0x361b13);};}exports[_0x38dc('0x2d')]=function(_0x5b959d,_0x50d55d){var _0x1b0528={},_0x73b71c={},_0x14cbad={'count':0x0,'rows':[]};var _0x55e36f=_[_0x38dc('0x2e')](db[_0x38dc('0x2f')][_0x38dc('0x30')],function(_0x5e257a){return{'name':_0x5e257a[_0x38dc('0x31')],'type':_0x5e257a[_0x38dc('0x32')][_0x38dc('0x33')]};});_0x73b71c[_0x38dc('0x34')]=_[_0x38dc('0x2e')](_0x55e36f,'name');_0x73b71c[_0x38dc('0x35')]=_[_0x38dc('0x36')](_0x5b959d['query']);_0x73b71c[_0x38dc('0x37')]=_[_0x38dc('0x38')](_0x73b71c[_0x38dc('0x34')],_0x73b71c[_0x38dc('0x35')]);_0x1b0528[_0x38dc('0x39')]=_[_0x38dc('0x38')](_0x73b71c[_0x38dc('0x34')],qs[_0x38dc('0x3a')](_0x5b959d['query'][_0x38dc('0x3a')]));_0x1b0528[_0x38dc('0x39')]=_0x1b0528[_0x38dc('0x39')][_0x38dc('0x3b')]?_0x1b0528[_0x38dc('0x39')]:_0x73b71c['model'];if(!_0x5b959d['query']['hasOwnProperty'](_0x38dc('0x3c'))){_0x1b0528[_0x38dc('0x1e')]=qs['limit'](_0x5b959d[_0x38dc('0x35')][_0x38dc('0x1e')]);_0x1b0528[_0x38dc('0x20')]=qs[_0x38dc('0x20')](_0x5b959d['query'][_0x38dc('0x20')]);}_0x1b0528[_0x38dc('0x3d')]=qs[_0x38dc('0x3e')](_0x5b959d['query'][_0x38dc('0x3e')]);_0x1b0528['where']=qs[_0x38dc('0x37')](_[_0x38dc('0x3f')](_0x5b959d[_0x38dc('0x35')],_0x73b71c[_0x38dc('0x37')]),_0x55e36f);if(_0x5b959d['query'][_0x38dc('0x40')]){_0x1b0528['where']=_[_0x38dc('0x41')](_0x1b0528['where'],{'$or':_[_0x38dc('0x2e')](_0x55e36f,function(_0x67d5db){if(_0x67d5db[_0x38dc('0x32')]!=='VIRTUAL'){var _0x2afad7={};_0x2afad7[_0x67d5db[_0x38dc('0x2b')]]={'$like':'%'+_0x5b959d[_0x38dc('0x35')][_0x38dc('0x40')]+'%'};return _0x2afad7;}})});}_0x1b0528=_[_0x38dc('0x41')]({},_0x1b0528,_0x5b959d['options']);var _0x3f003d={'where':_0x1b0528[_0x38dc('0x42')]};return db[_0x38dc('0x2f')]['count'](_0x3f003d)[_0x38dc('0x26')](function(_0x455787){_0x14cbad[_0x38dc('0x1f')]=_0x455787;if(_0x5b959d[_0x38dc('0x35')][_0x38dc('0x43')]){_0x1b0528[_0x38dc('0x44')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x1b0528);})[_0x38dc('0x26')](function(_0x5c5c1c){_0x14cbad[_0x38dc('0x45')]=_0x5c5c1c;return _0x14cbad;})[_0x38dc('0x26')](respondWithFilteredResult(_0x50d55d,_0x1b0528))[_0x38dc('0x46')](handleError(_0x50d55d,null));};exports[_0x38dc('0x47')]=function(_0x1bf544,_0xf0b709){var _0x59625b={'raw':!![],'where':{'id':_0x1bf544[_0x38dc('0x48')]['id']}},_0x5f4d83={};_0x5f4d83[_0x38dc('0x34')]=_[_0x38dc('0x36')](db[_0x38dc('0x2f')][_0x38dc('0x30')]);_0x5f4d83[_0x38dc('0x35')]=_[_0x38dc('0x36')](_0x1bf544[_0x38dc('0x35')]);_0x5f4d83['filters']=_[_0x38dc('0x38')](_0x5f4d83['model'],_0x5f4d83[_0x38dc('0x35')]);_0x59625b[_0x38dc('0x39')]=_[_0x38dc('0x38')](_0x5f4d83[_0x38dc('0x34')],qs[_0x38dc('0x3a')](_0x1bf544['query'][_0x38dc('0x3a')]));_0x59625b[_0x38dc('0x39')]=_0x59625b[_0x38dc('0x39')][_0x38dc('0x3b')]?_0x59625b[_0x38dc('0x39')]:_0x5f4d83[_0x38dc('0x34')];if(_0x1bf544[_0x38dc('0x35')][_0x38dc('0x43')]){_0x59625b[_0x38dc('0x44')]=[{'all':!![]}];}_0x59625b=_[_0x38dc('0x41')]({},_0x59625b,_0x1bf544[_0x38dc('0x49')]);return db['Sound'][_0x38dc('0x4a')](_0x59625b)['then'](handleEntityNotFound(_0xf0b709,null))['then'](respondWithResult(_0xf0b709,null))[_0x38dc('0x46')](handleError(_0xf0b709,null));};exports[_0x38dc('0x4b')]=function(_0x12bd50,_0x5a8af5,_0x1b82f5){return db['Sound']['find']({'where':{'id':_0x12bd50[_0x38dc('0x48')]['id']},'attributes':[_0x38dc('0x2b'),_0x38dc('0x4c'),'converted_format'],'raw':!![]})[_0x38dc('0x26')](handleEntityNotFound(_0x5a8af5,null))[_0x38dc('0x26')](function(_0x57764c){if(_0x57764c){if(!fs[_0x38dc('0x4d')](path[_0x38dc('0x4e')](config[_0x38dc('0x4f')],_0x38dc('0x50'),_0x57764c[_0x38dc('0x4c')]+'.'+_0x57764c[_0x38dc('0x51')]))){throw new db[(_0x38dc('0x52'))]['ValidationError'](_0x38dc('0x53'));}return _0x5a8af5[_0x38dc('0x4b')](path[_0x38dc('0x4e')](config['root'],_0x38dc('0x50'),util[_0x38dc('0x54')](_0x38dc('0x55'),_0x57764c[_0x38dc('0x4c')],_0x57764c[_0x38dc('0x51')])),util[_0x38dc('0x54')](_0x38dc('0x55'),_0x57764c['name'],_0x57764c['converted_format']));}return null;})[_0x38dc('0x46')](handleError(_0x5a8af5,null));};exports[_0x38dc('0x56')]=function(_0x21b7b4,_0x479595,_0x2e8a7e){var _0x25d691={'name':path[_0x38dc('0x57')](_0x21b7b4['file'][_0x38dc('0x58')],path[_0x38dc('0x59')](_0x21b7b4['file'][_0x38dc('0x58')])),'save_name':path['basename'](_0x21b7b4['file'][_0x38dc('0x5a')],path[_0x38dc('0x59')](_0x21b7b4[_0x38dc('0x5b')][_0x38dc('0x5a')])),'original_format':path[_0x38dc('0x59')](_0x21b7b4[_0x38dc('0x5b')][_0x38dc('0x58')])[_0x38dc('0x5c')](0x1),'converted_format':_0x38dc('0x5d')};var _0x3fb34c=path[_0x38dc('0x4e')](config['root'],_0x38dc('0x5e'),_0x21b7b4[_0x38dc('0x5b')][_0x38dc('0x5a')]);var _0x7df2f1=path[_0x38dc('0x4e')](config[_0x38dc('0x4f')],'server/files/sounds/converted',util['format']('%s.%s',path[_0x38dc('0x57')](_0x21b7b4[_0x38dc('0x5b')][_0x38dc('0x5a')],path[_0x38dc('0x59')](_0x21b7b4[_0x38dc('0x5b')][_0x38dc('0x5a')])),_0x25d691['converted_format']));logger[_0x38dc('0x5f')](_0x38dc('0x60'),_0x3fb34c);logger[_0x38dc('0x5f')](_0x38dc('0x61'),_0x7df2f1);try{fs[_0x38dc('0x62')](_0x3fb34c,parseInt(_0x38dc('0x63'),0x8));var _0xac5d9d=sox['transcode'](_0x3fb34c,_0x7df2f1,{'sampleRate':0x1f40,'format':_0x38dc('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xac5d9d['on'](_0x38dc('0x64'),function(_0x27e753){fs[_0x38dc('0x65')](_0x3fb34c);_0x479595[_0x38dc('0x1c')](0x1f4)[_0x38dc('0x2c')](_0x27e753);});_0xac5d9d['on']('src',function(_0x34f5aa){_0x25d691[_0x38dc('0x66')]=isNaN(_0x34f5aa['duration'])?null:_0x34f5aa[_0x38dc('0x67')]*0x3e8;_0x25d691[_0x38dc('0x68')]=isNaN(_0x34f5aa[_0x38dc('0x69')])?null:_0x34f5aa['sampleCount'];_0x25d691[_0x38dc('0x6a')]=isNaN(_0x34f5aa[_0x38dc('0x6b')])?null:_0x34f5aa[_0x38dc('0x6b')];_0x25d691[_0x38dc('0x6c')]=isNaN(_0x34f5aa['bitRate'])?null:_0x34f5aa['bitRate'];_0x25d691['original_sampleRate']=isNaN(_0x34f5aa[_0x38dc('0x6d')])?null:_0x34f5aa[_0x38dc('0x6d')];});_0xac5d9d['on'](_0x38dc('0x6e'),function(_0x54a140){_0x25d691[_0x38dc('0x6f')]=isNaN(_0x54a140[_0x38dc('0x67')])?null:_0x54a140['duration']*0x3e8;_0x25d691['converted_sampleCount']=isNaN(_0x54a140['sampleCount'])?null:_0x54a140[_0x38dc('0x69')];_0x25d691[_0x38dc('0x70')]=isNaN(_0x54a140['channelCount'])?null:_0x54a140[_0x38dc('0x6b')];_0x25d691['converted_bitRate']=isNaN(_0x54a140[_0x38dc('0x71')])?null:_0x54a140[_0x38dc('0x71')];_0x25d691[_0x38dc('0x72')]=isNaN(_0x54a140['sampleRate'])?null:_0x54a140[_0x38dc('0x6d')];});_0xac5d9d['on']('end',function(){fs[_0x38dc('0x62')](_0x7df2f1,parseInt(_0x38dc('0x63'),0x8));return db['Sound'][_0x38dc('0x56')](_0x25d691)[_0x38dc('0x26')](function(_0x60bf36){var _0x2c3f63={'role':_0x21b7b4[_0x38dc('0x73')][_0x38dc('0x74')],'userProfileId':_0x21b7b4[_0x38dc('0x73')][_0x38dc('0x75')]};if(!_0x2c3f63)throw new Error(_0x38dc('0x76'));if(_0x2c3f63['role']===_0x38dc('0x77')){var _0x5db809=_0x60bf36[_0x38dc('0x78')]({'plain':!![]});return db[_0x38dc('0x79')][_0x38dc('0x4a')]({'where':{'name':_0x38dc('0x7a'),'userProfileId':_0x2c3f63[_0x38dc('0x75')]},'raw':!![]})[_0x38dc('0x26')](function(_0x2491e0){if(_0x2491e0&&_0x2491e0[_0x38dc('0x7b')]===0x0){return db[_0x38dc('0x28')][_0x38dc('0x56')]({'name':_0x5db809[_0x38dc('0x2b')],'resourceId':_0x5db809['id'],'type':_0x2491e0[_0x38dc('0x2b')],'sectionId':_0x2491e0['id']},{})[_0x38dc('0x26')](function(){return _0x60bf36;});}else{return _0x60bf36;}})['catch'](function(_0x33e1a2){logger['error'](_0x38dc('0x7c'),_0x33e1a2);throw _0x33e1a2;});}return _0x60bf36;})['then'](respondWithResult(_0x479595,null))[_0x38dc('0x46')](handleError(_0x479595,null));});_0xac5d9d[_0x38dc('0x7d')]();}catch(_0x2b9abd){_0x479595['status'](0x1f4)[_0x38dc('0x2c')](_0x2b9abd);}};exports[_0x38dc('0x25')]=function(_0x3fa240,_0x50ba2e,_0x29f774){return db['Sound']['find']({'where':{'id':_0x3fa240['params']['id']}})[_0x38dc('0x26')](handleEntityNotFound(_0x50ba2e,null))[_0x38dc('0x26')](saveUpdates(_[_0x38dc('0x3f')](_0x3fa240[_0x38dc('0x73')],[_0x38dc('0x2b'),_0x38dc('0x7e')]),null))[_0x38dc('0x26')](respondWithResult(_0x50ba2e,null))[_0x38dc('0x46')](handleError(_0x50ba2e,null));};exports[_0x38dc('0x7f')]=function(_0x56b8f6,_0x1a73a4,_0x2d39f8){return db[_0x38dc('0x2f')][_0x38dc('0x4a')]({'where':{'id':_0x56b8f6[_0x38dc('0x48')]['id']}})[_0x38dc('0x26')](function(_0x513232){if(_0x513232){return _0x513232[_0x38dc('0x27')]();}})[_0x38dc('0x26')](function(_0xcd4f12){var _0x214074=path[_0x38dc('0x4e')](config[_0x38dc('0x4f')],_0x38dc('0x5e'),util[_0x38dc('0x54')](_0x38dc('0x55'),_0xcd4f12[_0x38dc('0x4c')],_0xcd4f12['original_format']));var _0x307f07=path['join'](config[_0x38dc('0x4f')],'server/files/sounds/converted',util[_0x38dc('0x54')](_0x38dc('0x55'),_0xcd4f12[_0x38dc('0x4c')],_0xcd4f12[_0x38dc('0x51')]));fs[_0x38dc('0x65')](_0x214074);fs[_0x38dc('0x65')](_0x307f07);return _0xcd4f12;})[_0x38dc('0x26')](function(_0xb41223){if(_0xb41223){return _0x1a73a4['status'](0xcc)['end']();}})[_0x38dc('0x26')](handleEntityNotFound(_0x1a73a4,null))[_0x38dc('0x46')](handleError(_0x1a73a4,null));}; \ No newline at end of file +var _0x1976=['save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','Sound','fieldName','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','rawAttributes','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','%s.%s','format','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','chmodSync','body','role','user','UserProfileSection','Sounds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','params','description','delete','original_format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','Content-Range','json','apply','reject'];(function(_0x2d6b40,_0x5007f4){var _0x24224f=function(_0x253b34){while(--_0x253b34){_0x2d6b40['push'](_0x2d6b40['shift']());}};_0x24224f(++_0x5007f4);}(_0x1976,0x14d));var _0x6197=function(_0x3f75e9,_0x376ee2){_0x3f75e9=_0x3f75e9-0x0;var _0x560c3f=_0x1976[_0x3f75e9];return _0x560c3f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6197('0x0'));var zipdir=require(_0x6197('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6197('0x2'));var moment=require(_0x6197('0x3'));var BPromise=require(_0x6197('0x4'));var Mustache=require(_0x6197('0x5'));var util=require(_0x6197('0x6'));var path=require('path');var sox=require(_0x6197('0x7'));var csv=require(_0x6197('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6197('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6197('0xa'));var deskjs=require(_0x6197('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6197('0xc'));var Redis=require('ioredis');var authService=require(_0x6197('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x6197('0xe'));var hardwareService=require(_0x6197('0xf'));var logger=require(_0x6197('0x10'))(_0x6197('0x11'));var utils=require(_0x6197('0x12'));var config=require(_0x6197('0x13'));var licenseUtil=require(_0x6197('0x14'));var db=require(_0x6197('0x15'))['db'];function respondWithStatusCode(_0x3622ce,_0x3dcba1){_0x3dcba1=_0x3dcba1||0xcc;return function(_0x1ac0a9){if(_0x1ac0a9){return _0x3622ce[_0x6197('0x16')](_0x3dcba1);}return _0x3622ce[_0x6197('0x17')](_0x3dcba1)[_0x6197('0x18')]();};}function respondWithResult(_0x8b025,_0x3d43fa){_0x3d43fa=_0x3d43fa||0xc8;return function(_0x39c2d4){if(_0x39c2d4){return _0x8b025[_0x6197('0x17')](_0x3d43fa)['json'](_0x39c2d4);}};}function respondWithFilteredResult(_0x436bce,_0x8a290){return function(_0x5e6304){if(_0x5e6304){var _0x26fd66=typeof _0x8a290['offset']===_0x6197('0x19')&&typeof _0x8a290[_0x6197('0x1a')]===_0x6197('0x19');var _0x18b82e=_0x5e6304['count'];var _0x42c78e=_0x26fd66?0x0:_0x8a290[_0x6197('0x1b')];var _0xca318=_0x26fd66?_0x5e6304[_0x6197('0x1c')]:_0x8a290[_0x6197('0x1b')]+_0x8a290[_0x6197('0x1a')];var _0x289d3b;if(_0xca318>=_0x18b82e){_0xca318=_0x18b82e;_0x289d3b=0xc8;}else{_0x289d3b=0xce;}_0x436bce[_0x6197('0x17')](_0x289d3b);return _0x436bce['set'](_0x6197('0x1d'),_0x42c78e+'-'+_0xca318+'/'+_0x18b82e)[_0x6197('0x1e')](_0x5e6304);}return null;};}function patchUpdates(_0x41e8ba){return function(_0x4371d9){try{jsonpatch[_0x6197('0x1f')](_0x4371d9,_0x41e8ba,!![]);}catch(_0x4997ee){return BPromise[_0x6197('0x20')](_0x4997ee);}return _0x4371d9[_0x6197('0x21')]();};}function saveUpdates(_0x2905dc,_0x4e2034){return function(_0x4bdcca){if(_0x4bdcca){return _0x4bdcca[_0x6197('0x22')](_0x2905dc)[_0x6197('0x23')](function(_0xf50b23){return _0xf50b23;});}return null;};}function removeEntity(_0x180e9a,_0x420386){return function(_0x2f4707){if(_0x2f4707){return _0x2f4707[_0x6197('0x24')]()['then'](function(){var _0x42540f=_0x2f4707[_0x6197('0x25')]({'plain':!![]});var _0xf19c64='Sounds';return db[_0x6197('0x26')][_0x6197('0x24')]({'where':{'type':_0xf19c64,'resourceId':_0x42540f['id']}})[_0x6197('0x23')](function(){return _0x2f4707;});})['then'](function(){_0x180e9a['status'](0xcc)[_0x6197('0x18')]();});}};}function handleEntityNotFound(_0x11be0c,_0x3490ee){return function(_0x1c2c53){if(!_0x1c2c53){_0x11be0c[_0x6197('0x16')](0x194);}return _0x1c2c53;};}function handleError(_0x5a2217,_0x3411d9){_0x3411d9=_0x3411d9||0x1f4;return function(_0x539670){logger[_0x6197('0x27')](_0x539670['stack']);if(_0x539670[_0x6197('0x28')]){delete _0x539670['name'];}_0x5a2217[_0x6197('0x17')](_0x3411d9)[_0x6197('0x29')](_0x539670);};}exports[_0x6197('0x2a')]=function(_0x40a499,_0x3af979){var _0x488bf3={},_0x4ab6dc={},_0xcf35c8={'count':0x0,'rows':[]};var _0x3536fd=_[_0x6197('0x2b')](db[_0x6197('0x2c')]['rawAttributes'],function(_0x5013b1){return{'name':_0x5013b1[_0x6197('0x2d')],'type':_0x5013b1[_0x6197('0x2e')][_0x6197('0x2f')]};});_0x4ab6dc['model']=_[_0x6197('0x2b')](_0x3536fd,_0x6197('0x28'));_0x4ab6dc[_0x6197('0x30')]=_[_0x6197('0x31')](_0x40a499[_0x6197('0x30')]);_0x4ab6dc['filters']=_['intersection'](_0x4ab6dc['model'],_0x4ab6dc['query']);_0x488bf3[_0x6197('0x32')]=_[_0x6197('0x33')](_0x4ab6dc[_0x6197('0x34')],qs[_0x6197('0x35')](_0x40a499['query']['fields']));_0x488bf3[_0x6197('0x32')]=_0x488bf3[_0x6197('0x32')][_0x6197('0x36')]?_0x488bf3[_0x6197('0x32')]:_0x4ab6dc[_0x6197('0x34')];if(!_0x40a499[_0x6197('0x30')][_0x6197('0x37')]('nolimit')){_0x488bf3[_0x6197('0x1a')]=qs[_0x6197('0x1a')](_0x40a499[_0x6197('0x30')][_0x6197('0x1a')]);_0x488bf3[_0x6197('0x1b')]=qs[_0x6197('0x1b')](_0x40a499[_0x6197('0x30')][_0x6197('0x1b')]);}_0x488bf3['order']=qs[_0x6197('0x38')](_0x40a499['query']['sort']);_0x488bf3[_0x6197('0x39')]=qs[_0x6197('0x3a')](_[_0x6197('0x3b')](_0x40a499[_0x6197('0x30')],_0x4ab6dc['filters']),_0x3536fd);if(_0x40a499[_0x6197('0x30')][_0x6197('0x3c')]){_0x488bf3[_0x6197('0x39')]=_[_0x6197('0x3d')](_0x488bf3['where'],{'$or':_[_0x6197('0x2b')](_0x3536fd,function(_0x59275d){if(_0x59275d[_0x6197('0x2e')]!=='VIRTUAL'){var _0x340859={};_0x340859[_0x59275d[_0x6197('0x28')]]={'$like':'%'+_0x40a499[_0x6197('0x30')][_0x6197('0x3c')]+'%'};return _0x340859;}})});}_0x488bf3=_[_0x6197('0x3d')]({},_0x488bf3,_0x40a499[_0x6197('0x3e')]);var _0x2f4b6e={'where':_0x488bf3[_0x6197('0x39')]};return db['Sound']['count'](_0x2f4b6e)[_0x6197('0x23')](function(_0x6aee04){_0xcf35c8[_0x6197('0x1c')]=_0x6aee04;if(_0x40a499[_0x6197('0x30')][_0x6197('0x3f')]){_0x488bf3[_0x6197('0x40')]=[{'all':!![]}];}return db[_0x6197('0x2c')]['findAll'](_0x488bf3);})[_0x6197('0x23')](function(_0x48ec0e){_0xcf35c8[_0x6197('0x41')]=_0x48ec0e;return _0xcf35c8;})[_0x6197('0x23')](respondWithFilteredResult(_0x3af979,_0x488bf3))[_0x6197('0x42')](handleError(_0x3af979,null));};exports[_0x6197('0x43')]=function(_0x5303e7,_0x480ec3){var _0x2ef62d={'raw':!![],'where':{'id':_0x5303e7['params']['id']}},_0x5e1bef={};_0x5e1bef['model']=_[_0x6197('0x31')](db[_0x6197('0x2c')][_0x6197('0x44')]);_0x5e1bef[_0x6197('0x30')]=_[_0x6197('0x31')](_0x5303e7['query']);_0x5e1bef[_0x6197('0x3a')]=_[_0x6197('0x33')](_0x5e1bef[_0x6197('0x34')],_0x5e1bef[_0x6197('0x30')]);_0x2ef62d[_0x6197('0x32')]=_[_0x6197('0x33')](_0x5e1bef[_0x6197('0x34')],qs[_0x6197('0x35')](_0x5303e7[_0x6197('0x30')]['fields']));_0x2ef62d[_0x6197('0x32')]=_0x2ef62d['attributes'][_0x6197('0x36')]?_0x2ef62d[_0x6197('0x32')]:_0x5e1bef[_0x6197('0x34')];if(_0x5303e7['query'][_0x6197('0x3f')]){_0x2ef62d[_0x6197('0x40')]=[{'all':!![]}];}_0x2ef62d=_['merge']({},_0x2ef62d,_0x5303e7[_0x6197('0x3e')]);return db[_0x6197('0x2c')][_0x6197('0x45')](_0x2ef62d)[_0x6197('0x23')](handleEntityNotFound(_0x480ec3,null))[_0x6197('0x23')](respondWithResult(_0x480ec3,null))[_0x6197('0x42')](handleError(_0x480ec3,null));};exports[_0x6197('0x46')]=function(_0x55c1b9,_0xca6aa2,_0x43a768){return db[_0x6197('0x2c')][_0x6197('0x45')]({'where':{'id':_0x55c1b9['params']['id']},'attributes':[_0x6197('0x28'),_0x6197('0x47'),_0x6197('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0xca6aa2,null))['then'](function(_0x288fe){if(_0x288fe){if(!fs[_0x6197('0x49')](path[_0x6197('0x4a')](config[_0x6197('0x4b')],_0x6197('0x4c'),_0x288fe[_0x6197('0x47')]+'.'+_0x288fe[_0x6197('0x48')]))){throw new db['Sequelize'][(_0x6197('0x4d'))](_0x6197('0x4e'));}return _0xca6aa2[_0x6197('0x46')](path['join'](config['root'],_0x6197('0x4c'),util['format'](_0x6197('0x4f'),_0x288fe[_0x6197('0x47')],_0x288fe['converted_format'])),util[_0x6197('0x50')](_0x6197('0x4f'),_0x288fe[_0x6197('0x28')],_0x288fe[_0x6197('0x48')]));}return null;})[_0x6197('0x42')](handleError(_0xca6aa2,null));};exports[_0x6197('0x51')]=function(_0x42b8b8,_0x8411b1,_0x4a41d2){var _0x449874={'name':path[_0x6197('0x52')](_0x42b8b8[_0x6197('0x53')][_0x6197('0x54')],path[_0x6197('0x55')](_0x42b8b8[_0x6197('0x53')]['originalname'])),'save_name':path[_0x6197('0x52')](_0x42b8b8[_0x6197('0x53')][_0x6197('0x56')],path[_0x6197('0x55')](_0x42b8b8[_0x6197('0x53')]['filename'])),'original_format':path[_0x6197('0x55')](_0x42b8b8[_0x6197('0x53')][_0x6197('0x54')])[_0x6197('0x57')](0x1),'converted_format':_0x6197('0x58')};var _0x2598b8=path['join'](config[_0x6197('0x4b')],_0x6197('0x59'),_0x42b8b8['file'][_0x6197('0x56')]);var _0xa84d8a=path[_0x6197('0x4a')](config[_0x6197('0x4b')],_0x6197('0x4c'),util[_0x6197('0x50')](_0x6197('0x4f'),path[_0x6197('0x52')](_0x42b8b8['file'][_0x6197('0x56')],path[_0x6197('0x55')](_0x42b8b8[_0x6197('0x53')][_0x6197('0x56')])),_0x449874[_0x6197('0x48')]));logger[_0x6197('0x5a')]('Sound\x20upload\x20filepath:\x20%s',_0x2598b8);logger['info']('Sound\x20upload\x20destination:\x20%s',_0xa84d8a);try{fs['chmodSync'](_0x2598b8,parseInt(_0x6197('0x5b'),0x8));var _0x5b1a98=sox[_0x6197('0x5c')](_0x2598b8,_0xa84d8a,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5b1a98['on']('error',function(_0x566173){fs[_0x6197('0x5d')](_0x2598b8);_0x8411b1['status'](0x1f4)[_0x6197('0x29')](_0x566173);});_0x5b1a98['on'](_0x6197('0x5e'),function(_0x5d6360){_0x449874[_0x6197('0x5f')]=isNaN(_0x5d6360[_0x6197('0x60')])?null:_0x5d6360[_0x6197('0x60')]*0x3e8;_0x449874[_0x6197('0x61')]=isNaN(_0x5d6360[_0x6197('0x62')])?null:_0x5d6360['sampleCount'];_0x449874['original_channelCount']=isNaN(_0x5d6360[_0x6197('0x63')])?null:_0x5d6360['channelCount'];_0x449874['original_bitRate']=isNaN(_0x5d6360[_0x6197('0x64')])?null:_0x5d6360[_0x6197('0x64')];_0x449874[_0x6197('0x65')]=isNaN(_0x5d6360[_0x6197('0x66')])?null:_0x5d6360['sampleRate'];});_0x5b1a98['on'](_0x6197('0x67'),function(_0x34614a){_0x449874[_0x6197('0x68')]=isNaN(_0x34614a[_0x6197('0x60')])?null:_0x34614a[_0x6197('0x60')]*0x3e8;_0x449874[_0x6197('0x69')]=isNaN(_0x34614a['sampleCount'])?null:_0x34614a[_0x6197('0x62')];_0x449874['converted_channelCount']=isNaN(_0x34614a[_0x6197('0x63')])?null:_0x34614a[_0x6197('0x63')];_0x449874[_0x6197('0x6a')]=isNaN(_0x34614a['bitRate'])?null:_0x34614a[_0x6197('0x64')];_0x449874[_0x6197('0x6b')]=isNaN(_0x34614a['sampleRate'])?null:_0x34614a['sampleRate'];});_0x5b1a98['on'](_0x6197('0x18'),function(){fs[_0x6197('0x6c')](_0xa84d8a,parseInt(_0x6197('0x5b'),0x8));return db['Sound'][_0x6197('0x51')](_0x449874)[_0x6197('0x23')](function(_0x38c9ca){var _0x2cd9ea={'role':_0x42b8b8[_0x6197('0x6d')][_0x6197('0x6e')],'userProfileId':_0x42b8b8[_0x6197('0x6d')]['userProfileId']};if(!_0x2cd9ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cd9ea['role']===_0x6197('0x6f')){var _0x159b65=_0x38c9ca[_0x6197('0x25')]({'plain':!![]});return db[_0x6197('0x70')][_0x6197('0x45')]({'where':{'name':_0x6197('0x71'),'userProfileId':_0x2cd9ea[_0x6197('0x72')]},'raw':!![]})[_0x6197('0x23')](function(_0x33a34e){if(_0x33a34e&&_0x33a34e[_0x6197('0x73')]===0x0){return db[_0x6197('0x26')][_0x6197('0x51')]({'name':_0x159b65[_0x6197('0x28')],'resourceId':_0x159b65['id'],'type':_0x33a34e[_0x6197('0x28')],'sectionId':_0x33a34e['id']},{})['then'](function(){return _0x38c9ca;});}else{return _0x38c9ca;}})['catch'](function(_0x4562dc){logger[_0x6197('0x27')](_0x6197('0x74'),_0x4562dc);throw _0x4562dc;});}return _0x38c9ca;})[_0x6197('0x23')](respondWithResult(_0x8411b1,null))['catch'](handleError(_0x8411b1,null));});_0x5b1a98[_0x6197('0x75')]();}catch(_0x1f0073){_0x8411b1['status'](0x1f4)[_0x6197('0x29')](_0x1f0073);}};exports['update']=function(_0x4d1ece,_0x132709,_0x33890e){return db[_0x6197('0x2c')]['find']({'where':{'id':_0x4d1ece[_0x6197('0x76')]['id']}})[_0x6197('0x23')](handleEntityNotFound(_0x132709,null))['then'](saveUpdates(_[_0x6197('0x3b')](_0x4d1ece[_0x6197('0x6d')],[_0x6197('0x28'),_0x6197('0x77')]),null))[_0x6197('0x23')](respondWithResult(_0x132709,null))['catch'](handleError(_0x132709,null));};exports[_0x6197('0x78')]=function(_0x1681ab,_0x138545,_0x4a485a){return db['Sound']['find']({'where':{'id':_0x1681ab[_0x6197('0x76')]['id']}})[_0x6197('0x23')](function(_0x2fd512){if(_0x2fd512){return _0x2fd512[_0x6197('0x24')]();}})[_0x6197('0x23')](function(_0x28862d){var _0x2b9bdd=path[_0x6197('0x4a')](config[_0x6197('0x4b')],_0x6197('0x59'),util[_0x6197('0x50')](_0x6197('0x4f'),_0x28862d['save_name'],_0x28862d[_0x6197('0x79')]));var _0x26db28=path[_0x6197('0x4a')](config[_0x6197('0x4b')],'server/files/sounds/converted',util[_0x6197('0x50')]('%s.%s',_0x28862d[_0x6197('0x47')],_0x28862d[_0x6197('0x48')]));fs[_0x6197('0x5d')](_0x2b9bdd);fs[_0x6197('0x5d')](_0x26db28);return _0x28862d;})[_0x6197('0x23')](function(_0x4ff1c2){if(_0x4ff1c2){return _0x138545['status'](0xcc)['end']();}})['then'](handleEntityNotFound(_0x138545,null))[_0x6197('0x42')](handleError(_0x138545,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index d00aa5f..b84dec9 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 _0x5dbf=['moment','request-promise','path','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','util','../../config/logger','api'];(function(_0x43c5f1,_0x24aded){var _0x3662ff=function(_0x11638d){while(--_0x11638d){_0x43c5f1['push'](_0x43c5f1['shift']());}};_0x3662ff(++_0x24aded);}(_0x5dbf,0x8d));var _0xf5db=function(_0x4e54c8,_0x5a6cf6){_0x4e54c8=_0x4e54c8-0x0;var _0x51db4f=_0x5dbf[_0x4e54c8];return _0x51db4f;};'use strict';var _=require('lodash');var util=require(_0xf5db('0x0'));var logger=require(_0xf5db('0x1'))(_0xf5db('0x2'));var moment=require(_0xf5db('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5db('0x4'));var fs=require('fs');var path=require(_0xf5db('0x5'));var rimraf=require('rimraf');var config=require(_0xf5db('0x6'));var attributes=require(_0xf5db('0x7'));module[_0xf5db('0x8')]=function(_0x5998a6,_0x234842){return _0x5998a6[_0xf5db('0x9')](_0xf5db('0xa'),attributes,{'tableName':_0xf5db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2985=['tools_sounds','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./sound.attributes','exports'];(function(_0x10dfc9,_0x25b62c){var _0x154afc=function(_0x5099ac){while(--_0x5099ac){_0x10dfc9['push'](_0x10dfc9['shift']());}};_0x154afc(++_0x25b62c);}(_0x2985,0x198));var _0x5298=function(_0x12c0ea,_0x2ed696){_0x12c0ea=_0x12c0ea-0x0;var _0x276352=_0x2985[_0x12c0ea];return _0x276352;};'use strict';var _=require(_0x5298('0x0'));var util=require(_0x5298('0x1'));var logger=require(_0x5298('0x2'))(_0x5298('0x3'));var moment=require(_0x5298('0x4'));var BPromise=require('bluebird');var rp=require(_0x5298('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5298('0x6'));var config=require(_0x5298('0x7'));var attributes=require(_0x5298('0x8'));module[_0x5298('0x9')]=function(_0x4f15ad,_0x21fa83){return _0x4f15ad['define']('Sound',attributes,{'tableName':_0x5298('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index ed5bfb2..ac7e571 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 _0xcd6f=['find','options','where','attributes','include','model','map','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','ShowSound','Sound'];(function(_0x153461,_0x2daf30){var _0x9791c8=function(_0x523ab5){while(--_0x523ab5){_0x153461['push'](_0x153461['shift']());}};_0x9791c8(++_0x2daf30);}(_0xcd6f,0x6b));var _0xfcd6=function(_0x253772,_0x3a98fe){_0x253772=_0x253772-0x0;var _0xfdf302=_0xcd6f[_0x253772];return _0xfdf302;};'use strict';var _=require(_0xfcd6('0x0'));var util=require(_0xfcd6('0x1'));var moment=require(_0xfcd6('0x2'));var BPromise=require(_0xfcd6('0x3'));var rs=require(_0xfcd6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcd6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfcd6('0x6'))(_0xfcd6('0x7'));var config=require(_0xfcd6('0x8'));var jayson=require(_0xfcd6('0x9'));var client=jayson[_0xfcd6('0xa')][_0xfcd6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58097e,_0x28dabb,_0x2d4aae){return new BPromise(function(_0x832261,_0x36658d){return client[_0xfcd6('0xc')](_0x58097e,_0x2d4aae)[_0xfcd6('0xd')](function(_0x5a8b90){logger[_0xfcd6('0xe')](_0xfcd6('0xf'),_0x28dabb,'request\x20sent');logger[_0xfcd6('0x10')]('Sound,\x20%s,\x20%s,\x20%s',_0x28dabb,_0xfcd6('0x11'),JSON[_0xfcd6('0x12')](_0x5a8b90));if(_0x5a8b90[_0xfcd6('0x13')]){if(_0x5a8b90['error'][_0xfcd6('0x14')]===0x1f4){logger[_0xfcd6('0x13')](_0xfcd6('0xf'),_0x28dabb,_0x5a8b90[_0xfcd6('0x13')][_0xfcd6('0x15')]);return _0x36658d(_0x5a8b90[_0xfcd6('0x13')][_0xfcd6('0x15')]);}logger[_0xfcd6('0x13')](_0xfcd6('0xf'),_0x28dabb,_0x5a8b90[_0xfcd6('0x13')][_0xfcd6('0x15')]);return _0x832261(_0x5a8b90[_0xfcd6('0x13')][_0xfcd6('0x15')]);}else{logger[_0xfcd6('0xe')](_0xfcd6('0xf'),_0x28dabb,'request\x20sent');_0x832261(_0x5a8b90[_0xfcd6('0x16')][_0xfcd6('0x15')]);}})['catch'](function(_0x32ca92){logger[_0xfcd6('0x13')](_0xfcd6('0xf'),_0x28dabb,_0x32ca92);_0x36658d(_0x32ca92);});});}exports[_0xfcd6('0x17')]=function(_0x383112){var _0x483908=this;return new Promise(function(_0x5ca03c,_0x245f22){return db[_0xfcd6('0x18')][_0xfcd6('0x19')]({'raw':_0x383112[_0xfcd6('0x1a')]?_0x383112['options']['raw']===undefined?!![]:![]:!![],'where':_0x383112[_0xfcd6('0x1a')]?_0x383112[_0xfcd6('0x1a')][_0xfcd6('0x1b')]||null:null,'attributes':_0x383112[_0xfcd6('0x1a')]?_0x383112[_0xfcd6('0x1a')][_0xfcd6('0x1c')]||null:null,'include':_0x383112[_0xfcd6('0x1a')]?_0x383112[_0xfcd6('0x1a')]['include']?_['map'](_0x383112[_0xfcd6('0x1a')][_0xfcd6('0x1d')],function(_0x599284){return{'model':db[_0x599284[_0xfcd6('0x1e')]],'as':_0x599284['as'],'attributes':_0x599284[_0xfcd6('0x1c')],'include':_0x599284[_0xfcd6('0x1d')]?_[_0xfcd6('0x1f')](_0x599284['include'],function(_0x4bc5ff){return{'model':db[_0x4bc5ff[_0xfcd6('0x1e')]],'as':_0x4bc5ff['as'],'attributes':_0x4bc5ff[_0xfcd6('0x1c')],'include':_0x4bc5ff[_0xfcd6('0x1d')]?_[_0xfcd6('0x1f')](_0x4bc5ff[_0xfcd6('0x1d')],function(_0x1c434b){return{'model':db[_0x1c434b[_0xfcd6('0x1e')]],'as':_0x1c434b['as'],'attributes':_0x1c434b[_0xfcd6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfcd6('0xd')](function(_0x43f85e){logger[_0xfcd6('0xe')](_0xfcd6('0x17'),_0x383112);logger['debug'](_0xfcd6('0x17'),_0x383112,JSON['stringify'](_0x43f85e));_0x5ca03c(_0x43f85e);})[_0xfcd6('0x20')](function(_0xa904a1){logger['error'](_0xfcd6('0x17'),_0xa904a1['message'],_0x383112);_0x245f22(_0x483908[_0xfcd6('0x13')](0x1f4,_0xa904a1[_0xfcd6('0x15')]));});});}; \ No newline at end of file +var _0x42c5=['Sound','find','raw','options','include','map','model','attributes','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ShowSound'];(function(_0x38d689,_0x20fb5c){var _0x421f11=function(_0x12fae0){while(--_0x12fae0){_0x38d689['push'](_0x38d689['shift']());}};_0x421f11(++_0x20fb5c);}(_0x42c5,0x152));var _0x542c=function(_0x5d9f55,_0x13ec05){_0x5d9f55=_0x5d9f55-0x0;var _0x4ece29=_0x42c5[_0x5d9f55];return _0x4ece29;};'use strict';var _=require(_0x542c('0x0'));var util=require(_0x542c('0x1'));var moment=require(_0x542c('0x2'));var BPromise=require('bluebird');var rs=require(_0x542c('0x3'));var fs=require('fs');var Redis=require(_0x542c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x542c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x542c('0x6'));var jayson=require(_0x542c('0x7'));var client=jayson[_0x542c('0x8')][_0x542c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4339a2,_0x3c9f50,_0x3dcb03){return new BPromise(function(_0x37b840,_0x3caaa1){return client['request'](_0x4339a2,_0x3dcb03)['then'](function(_0x27df4a){logger['info'](_0x542c('0xa'),_0x3c9f50,'request\x20sent');logger[_0x542c('0xb')](_0x542c('0xc'),_0x3c9f50,_0x542c('0xd'),JSON[_0x542c('0xe')](_0x27df4a));if(_0x27df4a[_0x542c('0xf')]){if(_0x27df4a[_0x542c('0xf')][_0x542c('0x10')]===0x1f4){logger[_0x542c('0xf')]('Sound,\x20%s,\x20%s',_0x3c9f50,_0x27df4a[_0x542c('0xf')][_0x542c('0x11')]);return _0x3caaa1(_0x27df4a[_0x542c('0xf')][_0x542c('0x11')]);}logger[_0x542c('0xf')](_0x542c('0xa'),_0x3c9f50,_0x27df4a[_0x542c('0xf')][_0x542c('0x11')]);return _0x37b840(_0x27df4a['error'][_0x542c('0x11')]);}else{logger[_0x542c('0x12')](_0x542c('0xa'),_0x3c9f50,_0x542c('0xd'));_0x37b840(_0x27df4a[_0x542c('0x13')]['message']);}})[_0x542c('0x14')](function(_0x474620){logger['error'](_0x542c('0xa'),_0x3c9f50,_0x474620);_0x3caaa1(_0x474620);});});}exports[_0x542c('0x15')]=function(_0x3079f6){var _0x29bc45=this;return new Promise(function(_0x5208b4,_0x2563cb){return db[_0x542c('0x16')][_0x542c('0x17')]({'raw':_0x3079f6['options']?_0x3079f6['options'][_0x542c('0x18')]===undefined?!![]:![]:!![],'where':_0x3079f6[_0x542c('0x19')]?_0x3079f6[_0x542c('0x19')]['where']||null:null,'attributes':_0x3079f6['options']?_0x3079f6[_0x542c('0x19')]['attributes']||null:null,'include':_0x3079f6['options']?_0x3079f6[_0x542c('0x19')][_0x542c('0x1a')]?_[_0x542c('0x1b')](_0x3079f6['options']['include'],function(_0x3f46e1){return{'model':db[_0x3f46e1[_0x542c('0x1c')]],'as':_0x3f46e1['as'],'attributes':_0x3f46e1[_0x542c('0x1d')],'include':_0x3f46e1[_0x542c('0x1a')]?_['map'](_0x3f46e1[_0x542c('0x1a')],function(_0x3744a7){return{'model':db[_0x3744a7[_0x542c('0x1c')]],'as':_0x3744a7['as'],'attributes':_0x3744a7[_0x542c('0x1d')],'include':_0x3744a7[_0x542c('0x1a')]?_[_0x542c('0x1b')](_0x3744a7['include'],function(_0x2fe3b4){return{'model':db[_0x2fe3b4[_0x542c('0x1c')]],'as':_0x2fe3b4['as'],'attributes':_0x2fe3b4[_0x542c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb2e58b){logger[_0x542c('0x12')](_0x542c('0x15'),_0x3079f6);logger[_0x542c('0xb')](_0x542c('0x15'),_0x3079f6,JSON[_0x542c('0xe')](_0xb2e58b));_0x5208b4(_0xb2e58b);})[_0x542c('0x14')](function(_0x2b2461){logger[_0x542c('0xf')](_0x542c('0x15'),_0x2b2461[_0x542c('0x11')],_0x3079f6);_0x2563cb(_0x29bc45[_0x542c('0xf')](0x1f4,_0x2b2461[_0x542c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index dee4519..249bfa4 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 _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0xe6f4e1,_0x3c46e1){var _0x4e1f15=function(_0x19f161){while(--_0x19f161){_0xe6f4e1['push'](_0xe6f4e1['shift']());}};_0x4e1f15(++_0x3c46e1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=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(_0x5a43b8,_0x2e0eb2){var _0x26eeef=function(_0x4b1451){while(--_0x4b1451){_0x5a43b8['push'](_0x5a43b8['shift']());}};_0x26eeef(++_0x2e0eb2);}(_0xda3f,0xec));var _0xfda3=function(_0x1e88b8,_0x41c2f4){_0x1e88b8=_0x1e88b8-0x0;var _0x86af67=_0xda3f[_0x1e88b8];return _0x86af67;};'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 d83029c..56835ed 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 _0xc593=['medium','ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x962fc5,_0x58f074){var _0x43667c=function(_0x5e6ec0){while(--_0x5e6ec0){_0x962fc5['push'](_0x962fc5['shift']());}};_0x43667c(++_0x58f074);}(_0xc593,0x15a));var _0x3c59=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc593[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x3c59('0x0'));module[_0x3c59('0x1')]={'uniqueid':{'type':Sequelize[_0x3c59('0x2')]},'body':{'type':Sequelize[_0x3c59('0x3')](_0x3c59('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x3c59('0x5')]('in','out'),'defaultValue':_0x3c59('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3c59('0x2')]},'providerResponse':{'type':Sequelize[_0x3c59('0x3')]}}; \ No newline at end of file +var _0xb760=['sequelize','exports','STRING','ENUM','out','TEXT'];(function(_0xf5aede,_0x5b2e7f){var _0x5c6890=function(_0x12db0f){while(--_0x12db0f){_0xf5aede['push'](_0xf5aede['shift']());}};_0x5c6890(++_0x5b2e7f);}(_0xb760,0x8a));var _0x0b76=function(_0x19bd5d,_0x310e12){_0x19bd5d=_0x19bd5d-0x0;var _0x330445=_0xb760[_0x19bd5d];return _0x330445;};'use strict';var Sequelize=require(_0x0b76('0x0'));module[_0x0b76('0x1')]={'uniqueid':{'type':Sequelize[_0x0b76('0x2')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x0b76('0x3')]('in',_0x0b76('0x4')),'defaultValue':_0x0b76('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x0b76('0x2')]},'providerResponse':{'type':Sequelize[_0x0b76('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index b1e5928..696ca8d 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 _0x5f4d=['body','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','end','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x5f4d,0x91));var _0xd5f4=function(_0xaf08f2,_0x12f3c9){_0xaf08f2=_0xaf08f2-0x0;var _0xd2510a=_0x5f4d[_0xaf08f2];return _0xd2510a;};'use strict';var emlformat=require(_0xd5f4('0x0'));var rimraf=require(_0xd5f4('0x1'));var zipdir=require(_0xd5f4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd5f4('0x3'));var moment=require(_0xd5f4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd5f4('0x5'));var path=require('path');var sox=require(_0xd5f4('0x6'));var csv=require(_0xd5f4('0x7'));var ejs=require(_0xd5f4('0x8'));var fs=require('fs');var fs_extra=require(_0xd5f4('0x9'));var _=require(_0xd5f4('0xa'));var squel=require(_0xd5f4('0xb'));var crypto=require(_0xd5f4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd5f4('0xd'));var toCsv=require(_0xd5f4('0x7'));var querystring=require(_0xd5f4('0xe'));var Papa=require(_0xd5f4('0xf'));var Redis=require('ioredis');var authService=require(_0xd5f4('0x10'));var qs=require(_0xd5f4('0x11'));var as=require(_0xd5f4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5f4('0x13'))(_0xd5f4('0x14'));var utils=require(_0xd5f4('0x15'));var config=require(_0xd5f4('0x16'));var licenseUtil=require(_0xd5f4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23f551,_0x42b25d){_0x42b25d=_0x42b25d||0xcc;return function(_0x2c1ec1){if(_0x2c1ec1){return _0x23f551[_0xd5f4('0x18')](_0x42b25d);}return _0x23f551[_0xd5f4('0x19')](_0x42b25d)['end']();};}function respondWithResult(_0x503909,_0x46f403){_0x46f403=_0x46f403||0xc8;return function(_0x1273b6){if(_0x1273b6){return _0x503909[_0xd5f4('0x19')](_0x46f403)[_0xd5f4('0x1a')](_0x1273b6);}};}function respondWithFilteredResult(_0xf2ac4d,_0x277f8e){return function(_0x1082ea){if(_0x1082ea){var _0x4dca10=typeof _0x277f8e[_0xd5f4('0x1b')]==='undefined'&&typeof _0x277f8e[_0xd5f4('0x1c')]==='undefined';var _0x4b9fcf=_0x1082ea[_0xd5f4('0x1d')];var _0x5845b7=_0x4dca10?0x0:_0x277f8e['offset'];var _0x17a9ad=_0x4dca10?_0x1082ea['count']:_0x277f8e[_0xd5f4('0x1b')]+_0x277f8e[_0xd5f4('0x1c')];var _0x33b7d3;if(_0x17a9ad>=_0x4b9fcf){_0x17a9ad=_0x4b9fcf;_0x33b7d3=0xc8;}else{_0x33b7d3=0xce;}_0xf2ac4d['status'](_0x33b7d3);return _0xf2ac4d[_0xd5f4('0x1e')](_0xd5f4('0x1f'),_0x5845b7+'-'+_0x17a9ad+'/'+_0x4b9fcf)[_0xd5f4('0x1a')](_0x1082ea);}return null;};}function patchUpdates(_0xe86d89){return function(_0x164552){try{jsonpatch['apply'](_0x164552,_0xe86d89,!![]);}catch(_0x187177){return BPromise[_0xd5f4('0x20')](_0x187177);}return _0x164552[_0xd5f4('0x21')]();};}function saveUpdates(_0x3b1560,_0xab182c){return function(_0x265299){if(_0x265299){return _0x265299[_0xd5f4('0x22')](_0x3b1560)[_0xd5f4('0x23')](function(_0x5e43b7){return _0x5e43b7;});}return null;};}function removeEntity(_0x1e601e,_0x1356a5){return function(_0x5cd927){if(_0x5cd927){return _0x5cd927['destroy']()['then'](function(){_0x1e601e['status'](0xcc)[_0xd5f4('0x24')]();});}};}function handleEntityNotFound(_0x7e1494,_0x29f9e4){return function(_0x1b811c){if(!_0x1b811c){_0x7e1494[_0xd5f4('0x18')](0x194);}return _0x1b811c;};}function handleError(_0x247e92,_0x471dd6){_0x471dd6=_0x471dd6||0x1f4;return function(_0x58fd9c){logger[_0xd5f4('0x25')](_0x58fd9c[_0xd5f4('0x26')]);if(_0x58fd9c[_0xd5f4('0x27')]){delete _0x58fd9c[_0xd5f4('0x27')];}_0x247e92[_0xd5f4('0x19')](_0x471dd6)[_0xd5f4('0x28')](_0x58fd9c);};}exports[_0xd5f4('0x29')]=function(_0x16223c,_0x53fb69){var _0x2bf553={},_0x4e3742={},_0x3e10ff={'count':0x0,'rows':[]};var _0x114023=_[_0xd5f4('0x2a')](db[_0xd5f4('0x2b')][_0xd5f4('0x2c')],function(_0x36ba7c){return{'name':_0x36ba7c[_0xd5f4('0x2d')],'type':_0x36ba7c['type'][_0xd5f4('0x2e')]};});_0x4e3742['model']=_[_0xd5f4('0x2a')](_0x114023,_0xd5f4('0x27'));_0x4e3742[_0xd5f4('0x2f')]=_[_0xd5f4('0x30')](_0x16223c[_0xd5f4('0x2f')]);_0x4e3742[_0xd5f4('0x31')]=_[_0xd5f4('0x32')](_0x4e3742[_0xd5f4('0x33')],_0x4e3742['query']);_0x2bf553[_0xd5f4('0x34')]=_[_0xd5f4('0x32')](_0x4e3742[_0xd5f4('0x33')],qs['fields'](_0x16223c[_0xd5f4('0x2f')][_0xd5f4('0x35')]));_0x2bf553[_0xd5f4('0x34')]=_0x2bf553[_0xd5f4('0x34')][_0xd5f4('0x36')]?_0x2bf553[_0xd5f4('0x34')]:_0x4e3742[_0xd5f4('0x33')];if(!_0x16223c[_0xd5f4('0x2f')][_0xd5f4('0x37')]('nolimit')){_0x2bf553['limit']=qs[_0xd5f4('0x1c')](_0x16223c[_0xd5f4('0x2f')][_0xd5f4('0x1c')]);_0x2bf553['offset']=qs[_0xd5f4('0x1b')](_0x16223c['query'][_0xd5f4('0x1b')]);}_0x2bf553[_0xd5f4('0x38')]=qs[_0xd5f4('0x39')](_0x16223c[_0xd5f4('0x2f')][_0xd5f4('0x39')]);_0x2bf553[_0xd5f4('0x3a')]=qs[_0xd5f4('0x31')](_[_0xd5f4('0x3b')](_0x16223c['query'],_0x4e3742[_0xd5f4('0x31')]),_0x114023);if(_0x16223c[_0xd5f4('0x2f')][_0xd5f4('0x3c')]){_0x2bf553['where']=_['merge'](_0x2bf553[_0xd5f4('0x3a')],{'$or':_['map'](_0x114023,function(_0x395044){if(_0x395044['type']!==_0xd5f4('0x3d')){var _0xe94da8={};_0xe94da8[_0x395044[_0xd5f4('0x27')]]={'$like':'%'+_0x16223c[_0xd5f4('0x2f')][_0xd5f4('0x3c')]+'%'};return _0xe94da8;}})});}_0x2bf553=_[_0xd5f4('0x3e')]({},_0x2bf553,_0x16223c[_0xd5f4('0x3f')]);var _0x3856cd={'where':_0x2bf553[_0xd5f4('0x3a')]};return db[_0xd5f4('0x2b')][_0xd5f4('0x1d')](_0x3856cd)[_0xd5f4('0x23')](function(_0xed93cf){_0x3e10ff[_0xd5f4('0x1d')]=_0xed93cf;if(_0x16223c[_0xd5f4('0x2f')][_0xd5f4('0x40')]){_0x2bf553[_0xd5f4('0x41')]=[{'all':!![]}];}return db[_0xd5f4('0x2b')]['findAll'](_0x2bf553);})[_0xd5f4('0x23')](function(_0x5c89ed){_0x3e10ff[_0xd5f4('0x42')]=_0x5c89ed;return _0x3e10ff;})[_0xd5f4('0x23')](respondWithFilteredResult(_0x53fb69,_0x2bf553))[_0xd5f4('0x43')](handleError(_0x53fb69,null));};exports['show']=function(_0x427ce1,_0xde04b3){var _0x2c829a={'raw':!![],'where':{'id':_0x427ce1[_0xd5f4('0x44')]['id']}},_0x4a7455={};_0x4a7455['model']=_[_0xd5f4('0x30')](db[_0xd5f4('0x2b')]['rawAttributes']);_0x4a7455[_0xd5f4('0x2f')]=_[_0xd5f4('0x30')](_0x427ce1[_0xd5f4('0x2f')]);_0x4a7455[_0xd5f4('0x31')]=_[_0xd5f4('0x32')](_0x4a7455[_0xd5f4('0x33')],_0x4a7455[_0xd5f4('0x2f')]);_0x2c829a['attributes']=_['intersection'](_0x4a7455[_0xd5f4('0x33')],qs[_0xd5f4('0x35')](_0x427ce1[_0xd5f4('0x2f')]['fields']));_0x2c829a[_0xd5f4('0x34')]=_0x2c829a['attributes'][_0xd5f4('0x36')]?_0x2c829a['attributes']:_0x4a7455['model'];if(_0x427ce1['query'][_0xd5f4('0x40')]){_0x2c829a['include']=[{'all':!![]}];}_0x2c829a=_['merge']({},_0x2c829a,_0x427ce1['options']);return db[_0xd5f4('0x2b')][_0xd5f4('0x45')](_0x2c829a)[_0xd5f4('0x23')](handleEntityNotFound(_0xde04b3,null))['then'](respondWithResult(_0xde04b3,null))[_0xd5f4('0x43')](handleError(_0xde04b3,null));};exports[_0xd5f4('0x46')]=function(_0x3bc05a,_0x21dc98){return db[_0xd5f4('0x2b')][_0xd5f4('0x46')](_0x3bc05a['body'],{})['then'](respondWithResult(_0x21dc98,0xc9))[_0xd5f4('0x43')](handleError(_0x21dc98,null));};exports['update']=function(_0x237ecd,_0x2de58e){if(_0x237ecd['body']['id']){delete _0x237ecd[_0xd5f4('0x47')]['id'];}return db['SquareMessage'][_0xd5f4('0x45')]({'where':{'id':_0x237ecd['params']['id']}})[_0xd5f4('0x23')](handleEntityNotFound(_0x2de58e,null))[_0xd5f4('0x23')](saveUpdates(_0x237ecd[_0xd5f4('0x47')],null))['then'](respondWithResult(_0x2de58e,null))[_0xd5f4('0x43')](handleError(_0x2de58e,null));};exports['destroy']=function(_0x523988,_0x51ffb9){return db[_0xd5f4('0x2b')]['find']({'where':{'id':_0x523988[_0xd5f4('0x44')]['id']}})[_0xd5f4('0x23')](handleEntityNotFound(_0x51ffb9,null))[_0xd5f4('0x23')](removeEntity(_0x51ffb9,null))['catch'](handleError(_0x51ffb9,null));}; \ No newline at end of file +var _0x8786=['offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','SquareMessage','count','includeAll','include','findAll','catch','show','length','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','end','status','json'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x8786,0x153));var _0x6878=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x8786[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0x6878('0x0'));var rimraf=require(_0x6878('0x1'));var zipdir=require(_0x6878('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6878('0x3'));var moment=require(_0x6878('0x4'));var BPromise=require(_0x6878('0x5'));var Mustache=require('mustache');var util=require(_0x6878('0x6'));var path=require(_0x6878('0x7'));var sox=require(_0x6878('0x8'));var csv=require(_0x6878('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6878('0xa'));var _=require(_0x6878('0xb'));var squel=require('squel');var crypto=require(_0x6878('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6878('0xd'));var toCsv=require(_0x6878('0x9'));var querystring=require(_0x6878('0xe'));var Papa=require(_0x6878('0xf'));var Redis=require(_0x6878('0x10'));var authService=require(_0x6878('0x11'));var qs=require(_0x6878('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6878('0x13'))(_0x6878('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6878('0x15'))['db'];function respondWithStatusCode(_0x170497,_0x2b434c){_0x2b434c=_0x2b434c||0xcc;return function(_0x509ddc){if(_0x509ddc){return _0x170497[_0x6878('0x16')](_0x2b434c);}return _0x170497['status'](_0x2b434c)[_0x6878('0x17')]();};}function respondWithResult(_0x459b35,_0x429bd8){_0x429bd8=_0x429bd8||0xc8;return function(_0x35d228){if(_0x35d228){return _0x459b35[_0x6878('0x18')](_0x429bd8)[_0x6878('0x19')](_0x35d228);}};}function respondWithFilteredResult(_0x174524,_0x28c755){return function(_0x55b13a){if(_0x55b13a){var _0x1a9e52=typeof _0x28c755[_0x6878('0x1a')]===_0x6878('0x1b')&&typeof _0x28c755['limit']===_0x6878('0x1b');var _0x490576=_0x55b13a['count'];var _0x5e4b07=_0x1a9e52?0x0:_0x28c755[_0x6878('0x1a')];var _0x5622ea=_0x1a9e52?_0x55b13a['count']:_0x28c755[_0x6878('0x1a')]+_0x28c755[_0x6878('0x1c')];var _0x365b0a;if(_0x5622ea>=_0x490576){_0x5622ea=_0x490576;_0x365b0a=0xc8;}else{_0x365b0a=0xce;}_0x174524[_0x6878('0x18')](_0x365b0a);return _0x174524[_0x6878('0x1d')](_0x6878('0x1e'),_0x5e4b07+'-'+_0x5622ea+'/'+_0x490576)['json'](_0x55b13a);}return null;};}function patchUpdates(_0x2551a2){return function(_0x363765){try{jsonpatch[_0x6878('0x1f')](_0x363765,_0x2551a2,!![]);}catch(_0x43cf55){return BPromise[_0x6878('0x20')](_0x43cf55);}return _0x363765[_0x6878('0x21')]();};}function saveUpdates(_0x1a5580,_0xc53f30){return function(_0x4fbf59){if(_0x4fbf59){return _0x4fbf59['update'](_0x1a5580)[_0x6878('0x22')](function(_0x4f5637){return _0x4f5637;});}return null;};}function removeEntity(_0x13417f,_0x5ddfbb){return function(_0x4b0752){if(_0x4b0752){return _0x4b0752[_0x6878('0x23')]()[_0x6878('0x22')](function(){_0x13417f[_0x6878('0x18')](0xcc)[_0x6878('0x17')]();});}};}function handleEntityNotFound(_0x2a5b2e,_0x2d6dd9){return function(_0x3a4c8a){if(!_0x3a4c8a){_0x2a5b2e[_0x6878('0x16')](0x194);}return _0x3a4c8a;};}function handleError(_0x3837af,_0x264d91){_0x264d91=_0x264d91||0x1f4;return function(_0x4e775b){logger[_0x6878('0x24')](_0x4e775b[_0x6878('0x25')]);if(_0x4e775b[_0x6878('0x26')]){delete _0x4e775b[_0x6878('0x26')];}_0x3837af['status'](_0x264d91)['send'](_0x4e775b);};}exports[_0x6878('0x27')]=function(_0x463ae9,_0x654970){var _0x2e6324={},_0x3323c7={},_0x2dcf3b={'count':0x0,'rows':[]};var _0xb4c6a1=_['map'](db['SquareMessage'][_0x6878('0x28')],function(_0x12b4ad){return{'name':_0x12b4ad[_0x6878('0x29')],'type':_0x12b4ad[_0x6878('0x2a')][_0x6878('0x2b')]};});_0x3323c7[_0x6878('0x2c')]=_['map'](_0xb4c6a1,'name');_0x3323c7['query']=_[_0x6878('0x2d')](_0x463ae9[_0x6878('0x2e')]);_0x3323c7['filters']=_[_0x6878('0x2f')](_0x3323c7[_0x6878('0x2c')],_0x3323c7[_0x6878('0x2e')]);_0x2e6324['attributes']=_[_0x6878('0x2f')](_0x3323c7[_0x6878('0x2c')],qs[_0x6878('0x30')](_0x463ae9[_0x6878('0x2e')]['fields']));_0x2e6324[_0x6878('0x31')]=_0x2e6324[_0x6878('0x31')]['length']?_0x2e6324['attributes']:_0x3323c7[_0x6878('0x2c')];if(!_0x463ae9[_0x6878('0x2e')][_0x6878('0x32')](_0x6878('0x33'))){_0x2e6324[_0x6878('0x1c')]=qs[_0x6878('0x1c')](_0x463ae9[_0x6878('0x2e')][_0x6878('0x1c')]);_0x2e6324[_0x6878('0x1a')]=qs[_0x6878('0x1a')](_0x463ae9[_0x6878('0x2e')][_0x6878('0x1a')]);}_0x2e6324[_0x6878('0x34')]=qs['sort'](_0x463ae9[_0x6878('0x2e')][_0x6878('0x35')]);_0x2e6324[_0x6878('0x36')]=qs[_0x6878('0x37')](_[_0x6878('0x38')](_0x463ae9[_0x6878('0x2e')],_0x3323c7[_0x6878('0x37')]),_0xb4c6a1);if(_0x463ae9['query'][_0x6878('0x39')]){_0x2e6324['where']=_[_0x6878('0x3a')](_0x2e6324['where'],{'$or':_[_0x6878('0x3b')](_0xb4c6a1,function(_0x12cb50){if(_0x12cb50[_0x6878('0x2a')]!=='VIRTUAL'){var _0x3aa053={};_0x3aa053[_0x12cb50['name']]={'$like':'%'+_0x463ae9[_0x6878('0x2e')][_0x6878('0x39')]+'%'};return _0x3aa053;}})});}_0x2e6324=_['merge']({},_0x2e6324,_0x463ae9[_0x6878('0x3c')]);var _0x47c32d={'where':_0x2e6324['where']};return db[_0x6878('0x3d')]['count'](_0x47c32d)['then'](function(_0x17fd86){_0x2dcf3b[_0x6878('0x3e')]=_0x17fd86;if(_0x463ae9[_0x6878('0x2e')][_0x6878('0x3f')]){_0x2e6324[_0x6878('0x40')]=[{'all':!![]}];}return db[_0x6878('0x3d')][_0x6878('0x41')](_0x2e6324);})[_0x6878('0x22')](function(_0x420db5){_0x2dcf3b['rows']=_0x420db5;return _0x2dcf3b;})[_0x6878('0x22')](respondWithFilteredResult(_0x654970,_0x2e6324))[_0x6878('0x42')](handleError(_0x654970,null));};exports[_0x6878('0x43')]=function(_0x39ad32,_0x3ffc69){var _0x55da36={'raw':!![],'where':{'id':_0x39ad32['params']['id']}},_0x90190a={};_0x90190a['model']=_[_0x6878('0x2d')](db[_0x6878('0x3d')][_0x6878('0x28')]);_0x90190a[_0x6878('0x2e')]=_[_0x6878('0x2d')](_0x39ad32[_0x6878('0x2e')]);_0x90190a[_0x6878('0x37')]=_[_0x6878('0x2f')](_0x90190a[_0x6878('0x2c')],_0x90190a[_0x6878('0x2e')]);_0x55da36[_0x6878('0x31')]=_['intersection'](_0x90190a[_0x6878('0x2c')],qs[_0x6878('0x30')](_0x39ad32[_0x6878('0x2e')][_0x6878('0x30')]));_0x55da36[_0x6878('0x31')]=_0x55da36['attributes'][_0x6878('0x44')]?_0x55da36['attributes']:_0x90190a[_0x6878('0x2c')];if(_0x39ad32[_0x6878('0x2e')]['includeAll']){_0x55da36[_0x6878('0x40')]=[{'all':!![]}];}_0x55da36=_['merge']({},_0x55da36,_0x39ad32['options']);return db['SquareMessage'][_0x6878('0x45')](_0x55da36)[_0x6878('0x22')](handleEntityNotFound(_0x3ffc69,null))[_0x6878('0x22')](respondWithResult(_0x3ffc69,null))[_0x6878('0x42')](handleError(_0x3ffc69,null));};exports[_0x6878('0x46')]=function(_0x5878b3,_0x169a1d){return db[_0x6878('0x3d')][_0x6878('0x46')](_0x5878b3[_0x6878('0x47')],{})['then'](respondWithResult(_0x169a1d,0xc9))[_0x6878('0x42')](handleError(_0x169a1d,null));};exports['update']=function(_0x87991b,_0x200795){if(_0x87991b[_0x6878('0x47')]['id']){delete _0x87991b['body']['id'];}return db[_0x6878('0x3d')][_0x6878('0x45')]({'where':{'id':_0x87991b[_0x6878('0x48')]['id']}})['then'](handleEntityNotFound(_0x200795,null))[_0x6878('0x22')](saveUpdates(_0x87991b[_0x6878('0x47')],null))['then'](respondWithResult(_0x200795,null))[_0x6878('0x42')](handleError(_0x200795,null));};exports['destroy']=function(_0x33566c,_0x26ca9e){return db[_0x6878('0x3d')][_0x6878('0x45')]({'where':{'id':_0x33566c[_0x6878('0x48')]['id']}})['then'](handleEntityNotFound(_0x26ca9e,null))[_0x6878('0x22')](removeEntity(_0x26ca9e,null))['catch'](handleError(_0x26ca9e,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 1666ae5..d05b67b 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 _0x72b1=['bluebird','path','../../config/environment','./squareMessage.attributes','define','SquareMessage','lodash','util','../../config/logger','api','moment'];(function(_0x587f48,_0x2c1310){var _0x4fd9a5=function(_0x3690d3){while(--_0x3690d3){_0x587f48['push'](_0x587f48['shift']());}};_0x4fd9a5(++_0x2c1310);}(_0x72b1,0xa0));var _0x172b=function(_0x4ba14e,_0x3d8032){_0x4ba14e=_0x4ba14e-0x0;var _0xb1f4d4=_0x72b1[_0x4ba14e];return _0xb1f4d4;};'use strict';var _=require(_0x172b('0x0'));var util=require(_0x172b('0x1'));var logger=require(_0x172b('0x2'))(_0x172b('0x3'));var moment=require(_0x172b('0x4'));var BPromise=require(_0x172b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x172b('0x6'));var rimraf=require('rimraf');var config=require(_0x172b('0x7'));var attributes=require(_0x172b('0x8'));module['exports']=function(_0x29ea0f,_0x56c43d){return _0x29ea0f[_0x172b('0x9')](_0x172b('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa44f=['util','../../config/logger','api','request-promise','rimraf','./squareMessage.attributes','define','SquareMessage','square_messages','lodash'];(function(_0xf0d8d,_0x31bdfa){var _0xfb5275=function(_0x534b58){while(--_0x534b58){_0xf0d8d['push'](_0xf0d8d['shift']());}};_0xfb5275(++_0x31bdfa);}(_0xa44f,0xf9));var _0xfa44=function(_0x717739,_0x2f79c8){_0x717739=_0x717739-0x0;var _0x32aab3=_0xa44f[_0x717739];return _0x32aab3;};'use strict';var _=require(_0xfa44('0x0'));var util=require(_0xfa44('0x1'));var logger=require(_0xfa44('0x2'))(_0xfa44('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfa44('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa44('0x5'));var config=require('../../config/environment');var attributes=require(_0xfa44('0x6'));module['exports']=function(_0x30a177,_0x425b03){return _0x30a177[_0xfa44('0x7')](_0xfa44('0x8'),attributes,{'tableName':_0xfa44('0x9'),'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 b4cfc79..8b104d2 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 _0xfd94=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','bluebird'];(function(_0x1c2c48,_0x21760c){var _0x21c607=function(_0x143a67){while(--_0x143a67){_0x1c2c48['push'](_0x1c2c48['shift']());}};_0x21c607(++_0x21760c);}(_0xfd94,0x8b));var _0x4fd9=function(_0x463dfd,_0x4d92a3){_0x463dfd=_0x463dfd-0x0;var _0xc434ee=_0xfd94[_0x463dfd];return _0xc434ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4fd9('0x0'));var rs=require(_0x4fd9('0x1'));var fs=require('fs');var Redis=require(_0x4fd9('0x2'));var db=require(_0x4fd9('0x3'))['db'];var utils=require(_0x4fd9('0x4'));var logger=require(_0x4fd9('0x5'))('rpc');var config=require(_0x4fd9('0x6'));var jayson=require(_0x4fd9('0x7'));var client=jayson[_0x4fd9('0x8')][_0x4fd9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x574302,_0x30f202,_0x4ed13d){return new BPromise(function(_0x3ad9c4,_0x49cfbe){return client[_0x4fd9('0xa')](_0x574302,_0x4ed13d)[_0x4fd9('0xb')](function(_0x410759){logger[_0x4fd9('0xc')]('SquareMessage,\x20%s,\x20%s',_0x30f202,_0x4fd9('0xd'));logger[_0x4fd9('0xe')](_0x4fd9('0xf'),_0x30f202,_0x4fd9('0xd'),JSON[_0x4fd9('0x10')](_0x410759));if(_0x410759['error']){if(_0x410759[_0x4fd9('0x11')][_0x4fd9('0x12')]===0x1f4){logger[_0x4fd9('0x11')](_0x4fd9('0x13'),_0x30f202,_0x410759[_0x4fd9('0x11')]['message']);return _0x49cfbe(_0x410759[_0x4fd9('0x11')][_0x4fd9('0x14')]);}logger[_0x4fd9('0x11')](_0x4fd9('0x13'),_0x30f202,_0x410759[_0x4fd9('0x11')][_0x4fd9('0x14')]);return _0x3ad9c4(_0x410759[_0x4fd9('0x11')][_0x4fd9('0x14')]);}else{logger[_0x4fd9('0xc')]('SquareMessage,\x20%s,\x20%s',_0x30f202,_0x4fd9('0xd'));_0x3ad9c4(_0x410759['result'][_0x4fd9('0x14')]);}})[_0x4fd9('0x15')](function(_0x2f4eb9){logger[_0x4fd9('0x11')](_0x4fd9('0x13'),_0x30f202,_0x2f4eb9);_0x49cfbe(_0x2f4eb9);});});}exports[_0x4fd9('0x16')]=function(_0xe8f15f){var _0x2b7969=this;return new Promise(function(_0x3bc136,_0x14fe49){return db[_0x4fd9('0x17')][_0x4fd9('0x18')](_0xe8f15f[_0x4fd9('0x19')],{'raw':_0xe8f15f[_0x4fd9('0x1a')]?_0xe8f15f[_0x4fd9('0x1a')][_0x4fd9('0x1b')]===undefined?!![]:![]:!![]})[_0x4fd9('0xb')](function(_0x148ca4){logger[_0x4fd9('0xc')]('CreateSquareMessage',_0xe8f15f);logger[_0x4fd9('0xe')]('CreateSquareMessage',_0xe8f15f,JSON[_0x4fd9('0x10')](_0x148ca4));_0x3bc136(_0x148ca4);})['catch'](function(_0x495f76){logger[_0x4fd9('0x11')](_0x4fd9('0x16'),_0x495f76['message'],_0xe8f15f);_0x14fe49(_0x2b7969['error'](0x1f4,_0x495f76[_0x4fd9('0x14')]));});});}; \ No newline at end of file +var _0xe9c4=['util','moment','bluebird','../../config/environment','client','http','request','then','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe9c4,0xcf));var _0x4e9c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xe9c4[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x4e9c('0x0'));var util=require(_0x4e9c('0x1'));var moment=require(_0x4e9c('0x2'));var BPromise=require(_0x4e9c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4e9c('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4e9c('0x5')][_0x4e9c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1a1f18,_0x27ac81,_0x4c454b){return new BPromise(function(_0x228cca,_0x526ff9){return client[_0x4e9c('0x7')](_0x1a1f18,_0x4c454b)[_0x4e9c('0x8')](function(_0x52df1d){logger['info'](_0x4e9c('0x9'),_0x27ac81,'request\x20sent');logger[_0x4e9c('0xa')](_0x4e9c('0xb'),_0x27ac81,_0x4e9c('0xc'),JSON[_0x4e9c('0xd')](_0x52df1d));if(_0x52df1d[_0x4e9c('0xe')]){if(_0x52df1d[_0x4e9c('0xe')][_0x4e9c('0xf')]===0x1f4){logger[_0x4e9c('0xe')](_0x4e9c('0x9'),_0x27ac81,_0x52df1d['error']['message']);return _0x526ff9(_0x52df1d[_0x4e9c('0xe')]['message']);}logger[_0x4e9c('0xe')](_0x4e9c('0x9'),_0x27ac81,_0x52df1d[_0x4e9c('0xe')][_0x4e9c('0x10')]);return _0x228cca(_0x52df1d[_0x4e9c('0xe')]['message']);}else{logger[_0x4e9c('0x11')]('SquareMessage,\x20%s,\x20%s',_0x27ac81,_0x4e9c('0xc'));_0x228cca(_0x52df1d[_0x4e9c('0x12')][_0x4e9c('0x10')]);}})[_0x4e9c('0x13')](function(_0x49597e){logger['error'](_0x4e9c('0x9'),_0x27ac81,_0x49597e);_0x526ff9(_0x49597e);});});}exports[_0x4e9c('0x14')]=function(_0x5b6869){var _0xa56213=this;return new Promise(function(_0xb2c1c0,_0x167b2b){return db[_0x4e9c('0x15')][_0x4e9c('0x16')](_0x5b6869[_0x4e9c('0x17')],{'raw':_0x5b6869[_0x4e9c('0x18')]?_0x5b6869[_0x4e9c('0x18')][_0x4e9c('0x19')]===undefined?!![]:![]:!![]})[_0x4e9c('0x8')](function(_0x2f1c9f){logger[_0x4e9c('0x11')](_0x4e9c('0x14'),_0x5b6869);logger['debug'](_0x4e9c('0x14'),_0x5b6869,JSON['stringify'](_0x2f1c9f));_0xb2c1c0(_0x2f1c9f);})[_0x4e9c('0x13')](function(_0x5be360){logger['error'](_0x4e9c('0x14'),_0x5be360[_0x4e9c('0x10')],_0x5b6869);_0x167b2b(_0xa56213[_0x4e9c('0xe')](0x1f4,_0x5be360[_0x4e9c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 4017f7d..5292b90 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 _0xa55a=['destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','15s','test','post','create','update','delete'];(function(_0x60df74,_0x458e29){var _0x5ee872=function(_0x356888){while(--_0x356888){_0x60df74['push'](_0x60df74['shift']());}};_0x5ee872(++_0x458e29);}(_0xa55a,0x7f));var _0xaa55=function(_0x12dbc4,_0x49d2de){_0x12dbc4=_0x12dbc4-0x0;var _0x54a850=_0xa55a[_0x12dbc4];return _0x54a850;};'use strict';var multer=require('multer');var util=require(_0xaa55('0x0'));var path=require('path');var timeout=require(_0xaa55('0x1'));var express=require(_0xaa55('0x2'));var router=express[_0xaa55('0x3')]();var fs_extra=require(_0xaa55('0x4'));var auth=require(_0xaa55('0x5'));var interaction=require(_0xaa55('0x6'));var config=require(_0xaa55('0x7'));var controller=require(_0xaa55('0x8'));router[_0xaa55('0x9')]('/',auth['isAuthenticated'](),controller[_0xaa55('0xa')]);router['get'](_0xaa55('0xb'),auth[_0xaa55('0xc')](),controller[_0xaa55('0xd')]);router[_0xaa55('0x9')]('/:id/test',auth[_0xaa55('0xc')](),timeout(_0xaa55('0xe')),controller[_0xaa55('0xf')]);router[_0xaa55('0x10')]('/',auth[_0xaa55('0xc')](),controller[_0xaa55('0x11')]);router['put'](_0xaa55('0xb'),auth[_0xaa55('0xc')](),controller[_0xaa55('0x12')]);router[_0xaa55('0x13')](_0xaa55('0xb'),auth[_0xaa55('0xc')](),controller[_0xaa55('0x14')]);module['exports']=router; \ No newline at end of file +var _0x91f9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','test','post','create','put','update','exports','multer','path','connect-timeout','express','Router'];(function(_0x40ef83,_0x1604b6){var _0x1066a6=function(_0x288e6a){while(--_0x288e6a){_0x40ef83['push'](_0x40ef83['shift']());}};_0x1066a6(++_0x1604b6);}(_0x91f9,0x19d));var _0x991f=function(_0x5e53ae,_0x24af4f){_0x5e53ae=_0x5e53ae-0x0;var _0x27a8a2=_0x91f9[_0x5e53ae];return _0x27a8a2;};'use strict';var multer=require(_0x991f('0x0'));var util=require('util');var path=require(_0x991f('0x1'));var timeout=require(_0x991f('0x2'));var express=require(_0x991f('0x3'));var router=express[_0x991f('0x4')]();var fs_extra=require(_0x991f('0x5'));var auth=require(_0x991f('0x6'));var interaction=require(_0x991f('0x7'));var config=require(_0x991f('0x8'));var controller=require(_0x991f('0x9'));router[_0x991f('0xa')]('/',auth[_0x991f('0xb')](),controller[_0x991f('0xc')]);router[_0x991f('0xa')](_0x991f('0xd'),auth[_0x991f('0xb')](),controller[_0x991f('0xe')]);router[_0x991f('0xa')]('/:id/test',auth[_0x991f('0xb')](),timeout(_0x991f('0xf')),controller[_0x991f('0x10')]);router[_0x991f('0x11')]('/',auth['isAuthenticated'](),controller[_0x991f('0x12')]);router[_0x991f('0x13')](_0x991f('0xd'),auth['isAuthenticated'](),controller[_0x991f('0x14')]);router['delete'](_0x991f('0xd'),auth[_0x991f('0xb')](),controller['destroy']);module[_0x991f('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 2add623..c2fa34d 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 _0x9fa8=['sequelize','name','STRING'];(function(_0x86271d,_0x2ccd0f){var _0x135777=function(_0x224373){while(--_0x224373){_0x86271d['push'](_0x86271d['shift']());}};_0x135777(++_0x2ccd0f);}(_0x9fa8,0xc9));var _0x89fa=function(_0x26b730,_0x408d19){_0x26b730=_0x26b730-0x0;var _0x548987=_0x9fa8[_0x26b730];return _0x548987;};'use strict';var Sequelize=require(_0x89fa('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x89fa('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x89fa('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe4e7=['sequelize','exports','STRING'];(function(_0x2d2a1a,_0x106fa7){var _0x5b1508=function(_0x32ac4c){while(--_0x32ac4c){_0x2d2a1a['push'](_0x2d2a1a['shift']());}};_0x5b1508(++_0x106fa7);}(_0xe4e7,0x1a4));var _0x7e4e=function(_0x49fe7f,_0x5349c1){_0x49fe7f=_0x49fe7f-0x0;var _0x1b5ce1=_0xe4e7[_0x49fe7f];return _0x1b5ce1;};'use strict';var Sequelize=require(_0x7e4e('0x0'));module[_0x7e4e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x7e4e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 4c643b6..3f29e5b 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 _0xa541=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ODBC','UserProfileSection','userProfileId','test','dsn','odbc','openSync','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1fc3ea,_0x51c25b){var _0x25f4ee=function(_0x17af49){while(--_0x17af49){_0x1fc3ea['push'](_0x1fc3ea['shift']());}};_0x25f4ee(++_0x51c25b);}(_0xa541,0xa1));var _0x1a54=function(_0x5e1994,_0x317ce2){_0x5e1994=_0x5e1994-0x0;var _0x227dd7=_0xa541[_0x5e1994];return _0x227dd7;};'use strict';var emlformat=require(_0x1a54('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a54('0x1'));var jsonpatch=require(_0x1a54('0x2'));var rp=require(_0x1a54('0x3'));var moment=require(_0x1a54('0x4'));var BPromise=require(_0x1a54('0x5'));var Mustache=require(_0x1a54('0x6'));var util=require(_0x1a54('0x7'));var path=require(_0x1a54('0x8'));var sox=require('sox');var csv=require(_0x1a54('0x9'));var ejs=require(_0x1a54('0xa'));var fs=require('fs');var fs_extra=require(_0x1a54('0xb'));var _=require(_0x1a54('0xc'));var squel=require('squel');var crypto=require(_0x1a54('0xd'));var jsforce=require(_0x1a54('0xe'));var deskjs=require(_0x1a54('0xf'));var toCsv=require(_0x1a54('0x9'));var querystring=require(_0x1a54('0x10'));var Papa=require(_0x1a54('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1a54('0x12'));var as=require(_0x1a54('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a54('0x14'))(_0x1a54('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a54('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x577522,_0x2dbb0f){_0x2dbb0f=_0x2dbb0f||0xcc;return function(_0x5300e1){if(_0x5300e1){return _0x577522[_0x1a54('0x17')](_0x2dbb0f);}return _0x577522[_0x1a54('0x18')](_0x2dbb0f)[_0x1a54('0x19')]();};}function respondWithResult(_0x2a95b7,_0x5bbfbb){_0x5bbfbb=_0x5bbfbb||0xc8;return function(_0x52ab9a){if(_0x52ab9a){return _0x2a95b7[_0x1a54('0x18')](_0x5bbfbb)[_0x1a54('0x1a')](_0x52ab9a);}};}function respondWithFilteredResult(_0x434b85,_0x2de090){return function(_0x160b76){if(_0x160b76){var _0x3f2ede=typeof _0x2de090[_0x1a54('0x1b')]===_0x1a54('0x1c')&&typeof _0x2de090['limit']===_0x1a54('0x1c');var _0x298cc8=_0x160b76[_0x1a54('0x1d')];var _0x301e0b=_0x3f2ede?0x0:_0x2de090['offset'];var _0x2f3507=_0x3f2ede?_0x160b76['count']:_0x2de090['offset']+_0x2de090[_0x1a54('0x1e')];var _0x3d7bca;if(_0x2f3507>=_0x298cc8){_0x2f3507=_0x298cc8;_0x3d7bca=0xc8;}else{_0x3d7bca=0xce;}_0x434b85[_0x1a54('0x18')](_0x3d7bca);return _0x434b85[_0x1a54('0x1f')](_0x1a54('0x20'),_0x301e0b+'-'+_0x2f3507+'/'+_0x298cc8)[_0x1a54('0x1a')](_0x160b76);}return null;};}function patchUpdates(_0x45a2e4){return function(_0x1e29d9){try{jsonpatch['apply'](_0x1e29d9,_0x45a2e4,!![]);}catch(_0x1c3cb7){return BPromise[_0x1a54('0x21')](_0x1c3cb7);}return _0x1e29d9[_0x1a54('0x22')]();};}function saveUpdates(_0x211567,_0x2be820){return function(_0x3cf3cb){if(_0x3cf3cb){return _0x3cf3cb[_0x1a54('0x23')](_0x211567)[_0x1a54('0x24')](function(_0x505037){return _0x505037;});}return null;};}function removeEntity(_0x28513d,_0x5d90a4){return function(_0x547374){if(_0x547374){return _0x547374[_0x1a54('0x25')]()['then'](function(){var _0x3e0896=_0x547374[_0x1a54('0x26')]({'plain':!![]});var _0x2f378e='ODBC';return db[_0x1a54('0x27')][_0x1a54('0x25')]({'where':{'type':_0x2f378e,'resourceId':_0x3e0896['id']}})['then'](function(){return _0x547374;});})[_0x1a54('0x24')](function(){_0x28513d['status'](0xcc)[_0x1a54('0x19')]();});}};}function handleEntityNotFound(_0x5b521b,_0x37423e){return function(_0x54b7c3){if(!_0x54b7c3){_0x5b521b[_0x1a54('0x17')](0x194);}return _0x54b7c3;};}function handleError(_0x2377de,_0x181e87){_0x181e87=_0x181e87||0x1f4;return function(_0x39dc33){logger[_0x1a54('0x28')](_0x39dc33[_0x1a54('0x29')]);if(_0x39dc33['name']){delete _0x39dc33[_0x1a54('0x2a')];}_0x2377de['status'](_0x181e87)['send'](_0x39dc33);};}exports[_0x1a54('0x2b')]=function(_0x5e3772,_0x14d27b){var _0x312aa1={},_0x189816={},_0x39ca0a={'count':0x0,'rows':[]};var _0x474ced=_[_0x1a54('0x2c')](db[_0x1a54('0x2d')][_0x1a54('0x2e')],function(_0x2d3799){return{'name':_0x2d3799[_0x1a54('0x2f')],'type':_0x2d3799[_0x1a54('0x30')][_0x1a54('0x31')]};});_0x189816['model']=_[_0x1a54('0x2c')](_0x474ced,_0x1a54('0x2a'));_0x189816['query']=_[_0x1a54('0x32')](_0x5e3772['query']);_0x189816[_0x1a54('0x33')]=_[_0x1a54('0x34')](_0x189816[_0x1a54('0x35')],_0x189816[_0x1a54('0x36')]);_0x312aa1[_0x1a54('0x37')]=_[_0x1a54('0x34')](_0x189816[_0x1a54('0x35')],qs['fields'](_0x5e3772['query'][_0x1a54('0x38')]));_0x312aa1[_0x1a54('0x37')]=_0x312aa1['attributes'][_0x1a54('0x39')]?_0x312aa1[_0x1a54('0x37')]:_0x189816['model'];if(!_0x5e3772[_0x1a54('0x36')][_0x1a54('0x3a')](_0x1a54('0x3b'))){_0x312aa1[_0x1a54('0x1e')]=qs['limit'](_0x5e3772[_0x1a54('0x36')][_0x1a54('0x1e')]);_0x312aa1[_0x1a54('0x1b')]=qs[_0x1a54('0x1b')](_0x5e3772[_0x1a54('0x36')]['offset']);}_0x312aa1['order']=qs[_0x1a54('0x3c')](_0x5e3772['query']['sort']);_0x312aa1[_0x1a54('0x3d')]=qs[_0x1a54('0x33')](_[_0x1a54('0x3e')](_0x5e3772[_0x1a54('0x36')],_0x189816[_0x1a54('0x33')]),_0x474ced);if(_0x5e3772[_0x1a54('0x36')][_0x1a54('0x3f')]){_0x312aa1[_0x1a54('0x3d')]=_['merge'](_0x312aa1['where'],{'$or':_[_0x1a54('0x2c')](_0x474ced,function(_0x2c5f34){if(_0x2c5f34[_0x1a54('0x30')]!=='VIRTUAL'){var _0x2e8cc1={};_0x2e8cc1[_0x2c5f34['name']]={'$like':'%'+_0x5e3772['query'][_0x1a54('0x3f')]+'%'};return _0x2e8cc1;}})});}_0x312aa1=_[_0x1a54('0x40')]({},_0x312aa1,_0x5e3772[_0x1a54('0x41')]);var _0x108a38={'where':_0x312aa1[_0x1a54('0x3d')]};return db[_0x1a54('0x2d')][_0x1a54('0x1d')](_0x108a38)[_0x1a54('0x24')](function(_0x490ca3){_0x39ca0a['count']=_0x490ca3;if(_0x5e3772[_0x1a54('0x36')]['includeAll']){_0x312aa1[_0x1a54('0x42')]=[{'all':!![]}];}return db[_0x1a54('0x2d')][_0x1a54('0x43')](_0x312aa1);})[_0x1a54('0x24')](function(_0x3f09b6){_0x39ca0a[_0x1a54('0x44')]=_0x3f09b6;return _0x39ca0a;})[_0x1a54('0x24')](respondWithFilteredResult(_0x14d27b,_0x312aa1))[_0x1a54('0x45')](handleError(_0x14d27b,null));};exports['show']=function(_0x496ed4,_0xd913b5){var _0x155d11={'raw':!![],'where':{'id':_0x496ed4[_0x1a54('0x46')]['id']}},_0xcb3c22={};_0xcb3c22['model']=_['keys'](db[_0x1a54('0x2d')][_0x1a54('0x2e')]);_0xcb3c22[_0x1a54('0x36')]=_[_0x1a54('0x32')](_0x496ed4[_0x1a54('0x36')]);_0xcb3c22[_0x1a54('0x33')]=_[_0x1a54('0x34')](_0xcb3c22[_0x1a54('0x35')],_0xcb3c22[_0x1a54('0x36')]);_0x155d11[_0x1a54('0x37')]=_['intersection'](_0xcb3c22['model'],qs[_0x1a54('0x38')](_0x496ed4[_0x1a54('0x36')][_0x1a54('0x38')]));_0x155d11['attributes']=_0x155d11[_0x1a54('0x37')][_0x1a54('0x39')]?_0x155d11['attributes']:_0xcb3c22[_0x1a54('0x35')];if(_0x496ed4['query'][_0x1a54('0x47')]){_0x155d11[_0x1a54('0x42')]=[{'all':!![]}];}_0x155d11=_[_0x1a54('0x40')]({},_0x155d11,_0x496ed4['options']);return db[_0x1a54('0x2d')][_0x1a54('0x48')](_0x155d11)['then'](handleEntityNotFound(_0xd913b5,null))[_0x1a54('0x24')](respondWithResult(_0xd913b5,null))[_0x1a54('0x45')](handleError(_0xd913b5,null));};exports['create']=function(_0x3d5972,_0x3717dc){return db[_0x1a54('0x2d')][_0x1a54('0x49')](_0x3d5972[_0x1a54('0x4a')],{})[_0x1a54('0x24')](function(_0x2401a4){var _0x4dcbe2=_0x3d5972[_0x1a54('0x4b')][_0x1a54('0x26')]({'plain':!![]});if(!_0x4dcbe2)throw new Error(_0x1a54('0x4c'));if(_0x4dcbe2['role']==='user'){var _0x30f5ec=_0x2401a4[_0x1a54('0x26')]({'plain':!![]});var _0x1d7129=_0x1a54('0x4d');return db[_0x1a54('0x4e')][_0x1a54('0x48')]({'where':{'name':_0x1d7129,'userProfileId':_0x4dcbe2[_0x1a54('0x4f')]},'raw':!![]})['then'](function(_0x43337c){if(_0x43337c&&_0x43337c['autoAssociation']===0x0){return db[_0x1a54('0x27')]['create']({'name':_0x30f5ec[_0x1a54('0x2a')],'resourceId':_0x30f5ec['id'],'type':_0x43337c[_0x1a54('0x2a')],'sectionId':_0x43337c['id']},{})[_0x1a54('0x24')](function(){return _0x2401a4;});}else{return _0x2401a4;}})[_0x1a54('0x45')](function(_0x2851a2){logger[_0x1a54('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2851a2);throw _0x2851a2;});}return _0x2401a4;})['then'](respondWithResult(_0x3717dc,0xc9))['catch'](handleError(_0x3717dc,null));};exports[_0x1a54('0x23')]=function(_0x4b1c31,_0x2c558a){if(_0x4b1c31[_0x1a54('0x4a')]['id']){delete _0x4b1c31['body']['id'];}return db[_0x1a54('0x2d')][_0x1a54('0x48')]({'where':{'id':_0x4b1c31[_0x1a54('0x46')]['id']}})[_0x1a54('0x24')](handleEntityNotFound(_0x2c558a,null))[_0x1a54('0x24')](saveUpdates(_0x4b1c31['body'],null))[_0x1a54('0x24')](respondWithResult(_0x2c558a,null))['catch'](handleError(_0x2c558a,null));};exports[_0x1a54('0x25')]=function(_0x57b3db,_0x4da2e6){return db[_0x1a54('0x2d')][_0x1a54('0x48')]({'where':{'id':_0x57b3db[_0x1a54('0x46')]['id']}})['then'](handleEntityNotFound(_0x4da2e6,null))[_0x1a54('0x24')](removeEntity(_0x4da2e6,null))['catch'](handleError(_0x4da2e6,null));};exports[_0x1a54('0x50')]=function(_0x30015a,_0x24ac75,_0xa17bf8){var _0x193a3c;return db[_0x1a54('0x2d')][_0x1a54('0x48')]({'where':{'id':_0x30015a['params']['id']},'attributes':['id',_0x1a54('0x51')]})[_0x1a54('0x24')](handleEntityNotFound(_0x24ac75,null))[_0x1a54('0x24')](function(_0x52c2c7){if(_0x52c2c7){var _0x166a9d=require(_0x1a54('0x52'))();_0x166a9d[_0x1a54('0x53')](_0x52c2c7['dsn']);_0x166a9d[_0x1a54('0x54')]();return _0x52c2c7;}})[_0x1a54('0x24')](respondWithResult(_0x24ac75,null))['catch'](handleError(_0x24ac75,null));}; \ No newline at end of file +var _0x96bf=['rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','odbc','zip-dir','fast-json-patch','request-promise','moment','mustache','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','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','map','SquareOdbc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x96bf,0x129));var _0xf96b=function(_0x43d79c,_0x531a55){_0x43d79c=_0x43d79c-0x0;var _0x4866b0=_0x96bf[_0x43d79c];return _0x4866b0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf96b('0x0'));var jsonpatch=require(_0xf96b('0x1'));var rp=require(_0xf96b('0x2'));var moment=require(_0xf96b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf96b('0x4'));var util=require('util');var path=require(_0xf96b('0x5'));var sox=require('sox');var csv=require(_0xf96b('0x6'));var ejs=require(_0xf96b('0x7'));var fs=require('fs');var fs_extra=require(_0xf96b('0x8'));var _=require(_0xf96b('0x9'));var squel=require(_0xf96b('0xa'));var crypto=require(_0xf96b('0xb'));var jsforce=require(_0xf96b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf96b('0xd'));var Papa=require(_0xf96b('0xe'));var Redis=require(_0xf96b('0xf'));var authService=require(_0xf96b('0x10'));var qs=require(_0xf96b('0x11'));var as=require(_0xf96b('0x12'));var hardwareService=require(_0xf96b('0x13'));var logger=require(_0xf96b('0x14'))(_0xf96b('0x15'));var utils=require('../../config/utils');var config=require(_0xf96b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf96b('0x17'))['db'];function respondWithStatusCode(_0x5b0dcf,_0x191820){_0x191820=_0x191820||0xcc;return function(_0x39ba3e){if(_0x39ba3e){return _0x5b0dcf[_0xf96b('0x18')](_0x191820);}return _0x5b0dcf[_0xf96b('0x19')](_0x191820)[_0xf96b('0x1a')]();};}function respondWithResult(_0x5b9e29,_0x343c98){_0x343c98=_0x343c98||0xc8;return function(_0x7443c4){if(_0x7443c4){return _0x5b9e29['status'](_0x343c98)[_0xf96b('0x1b')](_0x7443c4);}};}function respondWithFilteredResult(_0x290dde,_0x5bd109){return function(_0x22c371){if(_0x22c371){var _0x2c24d6=typeof _0x5bd109['offset']===_0xf96b('0x1c')&&typeof _0x5bd109[_0xf96b('0x1d')]==='undefined';var _0x561c0f=_0x22c371['count'];var _0xed2959=_0x2c24d6?0x0:_0x5bd109[_0xf96b('0x1e')];var _0x337ec4=_0x2c24d6?_0x22c371[_0xf96b('0x1f')]:_0x5bd109['offset']+_0x5bd109['limit'];var _0x2eb550;if(_0x337ec4>=_0x561c0f){_0x337ec4=_0x561c0f;_0x2eb550=0xc8;}else{_0x2eb550=0xce;}_0x290dde[_0xf96b('0x19')](_0x2eb550);return _0x290dde[_0xf96b('0x20')](_0xf96b('0x21'),_0xed2959+'-'+_0x337ec4+'/'+_0x561c0f)[_0xf96b('0x1b')](_0x22c371);}return null;};}function patchUpdates(_0x578811){return function(_0x2609f8){try{jsonpatch[_0xf96b('0x22')](_0x2609f8,_0x578811,!![]);}catch(_0x1ed801){return BPromise['reject'](_0x1ed801);}return _0x2609f8[_0xf96b('0x23')]();};}function saveUpdates(_0x4e4a89,_0x3e6636){return function(_0x1ee3a8){if(_0x1ee3a8){return _0x1ee3a8[_0xf96b('0x24')](_0x4e4a89)[_0xf96b('0x25')](function(_0x4fa3ef){return _0x4fa3ef;});}return null;};}function removeEntity(_0x599f09,_0x3af978){return function(_0xa135c){if(_0xa135c){return _0xa135c[_0xf96b('0x26')]()[_0xf96b('0x25')](function(){var _0x36b376=_0xa135c[_0xf96b('0x27')]({'plain':!![]});var _0x5db805=_0xf96b('0x28');return db[_0xf96b('0x29')][_0xf96b('0x26')]({'where':{'type':_0x5db805,'resourceId':_0x36b376['id']}})[_0xf96b('0x25')](function(){return _0xa135c;});})[_0xf96b('0x25')](function(){_0x599f09[_0xf96b('0x19')](0xcc)[_0xf96b('0x1a')]();});}};}function handleEntityNotFound(_0x59550e,_0x4b3c1e){return function(_0x4c3a87){if(!_0x4c3a87){_0x59550e[_0xf96b('0x18')](0x194);}return _0x4c3a87;};}function handleError(_0x43ef51,_0x597da1){_0x597da1=_0x597da1||0x1f4;return function(_0x131f4c){logger[_0xf96b('0x2a')](_0x131f4c[_0xf96b('0x2b')]);if(_0x131f4c['name']){delete _0x131f4c[_0xf96b('0x2c')];}_0x43ef51[_0xf96b('0x19')](_0x597da1)['send'](_0x131f4c);};}exports['index']=function(_0x5cdcc7,_0x4b9e6b){var _0x4ff341={},_0x5f35db={},_0x1eaf01={'count':0x0,'rows':[]};var _0x1e1ad7=_[_0xf96b('0x2d')](db[_0xf96b('0x2e')][_0xf96b('0x2f')],function(_0x1352cc){return{'name':_0x1352cc[_0xf96b('0x30')],'type':_0x1352cc[_0xf96b('0x31')][_0xf96b('0x32')]};});_0x5f35db['model']=_['map'](_0x1e1ad7,_0xf96b('0x2c'));_0x5f35db[_0xf96b('0x33')]=_[_0xf96b('0x34')](_0x5cdcc7[_0xf96b('0x33')]);_0x5f35db[_0xf96b('0x35')]=_[_0xf96b('0x36')](_0x5f35db[_0xf96b('0x37')],_0x5f35db[_0xf96b('0x33')]);_0x4ff341[_0xf96b('0x38')]=_['intersection'](_0x5f35db[_0xf96b('0x37')],qs[_0xf96b('0x39')](_0x5cdcc7['query'][_0xf96b('0x39')]));_0x4ff341['attributes']=_0x4ff341[_0xf96b('0x38')][_0xf96b('0x3a')]?_0x4ff341[_0xf96b('0x38')]:_0x5f35db[_0xf96b('0x37')];if(!_0x5cdcc7[_0xf96b('0x33')][_0xf96b('0x3b')]('nolimit')){_0x4ff341[_0xf96b('0x1d')]=qs[_0xf96b('0x1d')](_0x5cdcc7[_0xf96b('0x33')][_0xf96b('0x1d')]);_0x4ff341[_0xf96b('0x1e')]=qs[_0xf96b('0x1e')](_0x5cdcc7[_0xf96b('0x33')]['offset']);}_0x4ff341[_0xf96b('0x3c')]=qs[_0xf96b('0x3d')](_0x5cdcc7['query'][_0xf96b('0x3d')]);_0x4ff341[_0xf96b('0x3e')]=qs[_0xf96b('0x35')](_[_0xf96b('0x3f')](_0x5cdcc7[_0xf96b('0x33')],_0x5f35db['filters']),_0x1e1ad7);if(_0x5cdcc7[_0xf96b('0x33')][_0xf96b('0x40')]){_0x4ff341['where']=_['merge'](_0x4ff341[_0xf96b('0x3e')],{'$or':_[_0xf96b('0x2d')](_0x1e1ad7,function(_0x201ba3){if(_0x201ba3[_0xf96b('0x31')]!==_0xf96b('0x41')){var _0x446cb0={};_0x446cb0[_0x201ba3[_0xf96b('0x2c')]]={'$like':'%'+_0x5cdcc7[_0xf96b('0x33')][_0xf96b('0x40')]+'%'};return _0x446cb0;}})});}_0x4ff341=_[_0xf96b('0x42')]({},_0x4ff341,_0x5cdcc7[_0xf96b('0x43')]);var _0x40ebd8={'where':_0x4ff341[_0xf96b('0x3e')]};return db['SquareOdbc'][_0xf96b('0x1f')](_0x40ebd8)[_0xf96b('0x25')](function(_0x270274){_0x1eaf01[_0xf96b('0x1f')]=_0x270274;if(_0x5cdcc7[_0xf96b('0x33')][_0xf96b('0x44')]){_0x4ff341[_0xf96b('0x45')]=[{'all':!![]}];}return db[_0xf96b('0x2e')][_0xf96b('0x46')](_0x4ff341);})[_0xf96b('0x25')](function(_0x4a28ef){_0x1eaf01[_0xf96b('0x47')]=_0x4a28ef;return _0x1eaf01;})[_0xf96b('0x25')](respondWithFilteredResult(_0x4b9e6b,_0x4ff341))[_0xf96b('0x48')](handleError(_0x4b9e6b,null));};exports[_0xf96b('0x49')]=function(_0x50a833,_0x5c45b3){var _0xd2492a={'raw':!![],'where':{'id':_0x50a833[_0xf96b('0x4a')]['id']}},_0x36f4e={};_0x36f4e[_0xf96b('0x37')]=_['keys'](db[_0xf96b('0x2e')]['rawAttributes']);_0x36f4e[_0xf96b('0x33')]=_[_0xf96b('0x34')](_0x50a833[_0xf96b('0x33')]);_0x36f4e[_0xf96b('0x35')]=_[_0xf96b('0x36')](_0x36f4e[_0xf96b('0x37')],_0x36f4e[_0xf96b('0x33')]);_0xd2492a[_0xf96b('0x38')]=_[_0xf96b('0x36')](_0x36f4e[_0xf96b('0x37')],qs['fields'](_0x50a833['query'][_0xf96b('0x39')]));_0xd2492a[_0xf96b('0x38')]=_0xd2492a[_0xf96b('0x38')][_0xf96b('0x3a')]?_0xd2492a[_0xf96b('0x38')]:_0x36f4e[_0xf96b('0x37')];if(_0x50a833['query']['includeAll']){_0xd2492a[_0xf96b('0x45')]=[{'all':!![]}];}_0xd2492a=_[_0xf96b('0x42')]({},_0xd2492a,_0x50a833[_0xf96b('0x43')]);return db[_0xf96b('0x2e')]['find'](_0xd2492a)[_0xf96b('0x25')](handleEntityNotFound(_0x5c45b3,null))['then'](respondWithResult(_0x5c45b3,null))[_0xf96b('0x48')](handleError(_0x5c45b3,null));};exports[_0xf96b('0x4b')]=function(_0x536d73,_0x38a6dd){return db[_0xf96b('0x2e')][_0xf96b('0x4b')](_0x536d73[_0xf96b('0x4c')],{})[_0xf96b('0x25')](function(_0x3851e7){var _0x26c897=_0x536d73[_0xf96b('0x4d')]['get']({'plain':!![]});if(!_0x26c897)throw new Error(_0xf96b('0x4e'));if(_0x26c897[_0xf96b('0x4f')]===_0xf96b('0x4d')){var _0xe83447=_0x3851e7[_0xf96b('0x27')]({'plain':!![]});var _0x4eb5ac=_0xf96b('0x28');return db[_0xf96b('0x50')][_0xf96b('0x51')]({'where':{'name':_0x4eb5ac,'userProfileId':_0x26c897['userProfileId']},'raw':!![]})[_0xf96b('0x25')](function(_0x5f1f99){if(_0x5f1f99&&_0x5f1f99[_0xf96b('0x52')]===0x0){return db[_0xf96b('0x29')][_0xf96b('0x4b')]({'name':_0xe83447[_0xf96b('0x2c')],'resourceId':_0xe83447['id'],'type':_0x5f1f99[_0xf96b('0x2c')],'sectionId':_0x5f1f99['id']},{})['then'](function(){return _0x3851e7;});}else{return _0x3851e7;}})[_0xf96b('0x48')](function(_0x5c12a4){logger[_0xf96b('0x2a')](_0xf96b('0x53'),_0x5c12a4);throw _0x5c12a4;});}return _0x3851e7;})[_0xf96b('0x25')](respondWithResult(_0x38a6dd,0xc9))[_0xf96b('0x48')](handleError(_0x38a6dd,null));};exports[_0xf96b('0x24')]=function(_0x4685c3,_0xf45800){if(_0x4685c3['body']['id']){delete _0x4685c3[_0xf96b('0x4c')]['id'];}return db['SquareOdbc'][_0xf96b('0x51')]({'where':{'id':_0x4685c3[_0xf96b('0x4a')]['id']}})[_0xf96b('0x25')](handleEntityNotFound(_0xf45800,null))[_0xf96b('0x25')](saveUpdates(_0x4685c3['body'],null))[_0xf96b('0x25')](respondWithResult(_0xf45800,null))[_0xf96b('0x48')](handleError(_0xf45800,null));};exports[_0xf96b('0x26')]=function(_0x44bf3f,_0x4da2c4){return db[_0xf96b('0x2e')][_0xf96b('0x51')]({'where':{'id':_0x44bf3f[_0xf96b('0x4a')]['id']}})[_0xf96b('0x25')](handleEntityNotFound(_0x4da2c4,null))[_0xf96b('0x25')](removeEntity(_0x4da2c4,null))[_0xf96b('0x48')](handleError(_0x4da2c4,null));};exports['test']=function(_0x51983e,_0x59d9ea,_0xa505c6){var _0x16359a;return db['SquareOdbc'][_0xf96b('0x51')]({'where':{'id':_0x51983e[_0xf96b('0x4a')]['id']},'attributes':['id',_0xf96b('0x54')]})[_0xf96b('0x25')](handleEntityNotFound(_0x59d9ea,null))[_0xf96b('0x25')](function(_0x131138){if(_0x131138){var _0x4cb4e9=require(_0xf96b('0x55'))();_0x4cb4e9['openSync'](_0x131138['dsn']);_0x4cb4e9['closeSync']();return _0x131138;}})['then'](respondWithResult(_0x59d9ea,null))[_0xf96b('0x48')](handleError(_0x59d9ea,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index f3d869b..11818c6 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 _0xd702=['api','moment','path','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','lodash'];(function(_0x447197,_0x4e191d){var _0x303a6b=function(_0x4f05a8){while(--_0x4f05a8){_0x447197['push'](_0x447197['shift']());}};_0x303a6b(++_0x4e191d);}(_0xd702,0xe5));var _0x2d70=function(_0x1671ee,_0x3b605c){_0x1671ee=_0x1671ee-0x0;var _0x1cd3fe=_0xd702[_0x1671ee];return _0x1cd3fe;};'use strict';var _=require(_0x2d70('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2d70('0x1'));var moment=require(_0x2d70('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d70('0x3'));var rimraf=require(_0x2d70('0x4'));var config=require(_0x2d70('0x5'));var attributes=require(_0x2d70('0x6'));module['exports']=function(_0xf8315a,_0x560470){return _0xf8315a[_0x2d70('0x7')](_0x2d70('0x8'),attributes,{'tableName':_0x2d70('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bbe=['../../config/environment','exports','SquareOdbc','square_odbc','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3763da,_0x58158b){var _0x5d192f=function(_0x329668){while(--_0x329668){_0x3763da['push'](_0x3763da['shift']());}};_0x5d192f(++_0x58158b);}(_0x0bbe,0x13c));var _0xe0bb=function(_0xfc6407,_0xe82001){_0xfc6407=_0xfc6407-0x0;var _0x2544b9=_0x0bbe[_0xfc6407];return _0x2544b9;};'use strict';var _=require(_0xe0bb('0x0'));var util=require(_0xe0bb('0x1'));var logger=require('../../config/logger')(_0xe0bb('0x2'));var moment=require(_0xe0bb('0x3'));var BPromise=require(_0xe0bb('0x4'));var rp=require(_0xe0bb('0x5'));var fs=require('fs');var path=require(_0xe0bb('0x6'));var rimraf=require(_0xe0bb('0x7'));var config=require(_0xe0bb('0x8'));var attributes=require('./squareOdbc.attributes');module[_0xe0bb('0x9')]=function(_0x2a6f67,_0x359304){return _0x2a6f67['define'](_0xe0bb('0xa'),attributes,{'tableName':_0xe0bb('0xb'),'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 8a5b9da..1e48047 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 _0x59c2=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','catch','SquareOdbc','find','options','raw','attributes','include','map','model','then','ShowSquareOdbc','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x52f7a0,_0x2bbdd3){var _0x38d8a1=function(_0x59f568){while(--_0x59f568){_0x52f7a0['push'](_0x52f7a0['shift']());}};_0x38d8a1(++_0x2bbdd3);}(_0x59c2,0x122));var _0x259c=function(_0x164760,_0x5874b0){_0x164760=_0x164760-0x0;var _0x8b91b2=_0x59c2[_0x164760];return _0x8b91b2;};'use strict';var _=require(_0x259c('0x0'));var util=require(_0x259c('0x1'));var moment=require(_0x259c('0x2'));var BPromise=require('bluebird');var rs=require(_0x259c('0x3'));var fs=require('fs');var Redis=require(_0x259c('0x4'));var db=require(_0x259c('0x5'))['db'];var utils=require(_0x259c('0x6'));var logger=require(_0x259c('0x7'))(_0x259c('0x8'));var config=require(_0x259c('0x9'));var jayson=require(_0x259c('0xa'));var client=jayson[_0x259c('0xb')][_0x259c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a6dc4,_0x18dfe8,_0x597c87){return new BPromise(function(_0x82deba,_0xc8cc2a){return client['request'](_0x2a6dc4,_0x597c87)['then'](function(_0x263402){logger[_0x259c('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x18dfe8,'request\x20sent');logger[_0x259c('0xe')](_0x259c('0xf'),_0x18dfe8,_0x259c('0x10'),JSON[_0x259c('0x11')](_0x263402));if(_0x263402[_0x259c('0x12')]){if(_0x263402[_0x259c('0x12')][_0x259c('0x13')]===0x1f4){logger['error'](_0x259c('0x14'),_0x18dfe8,_0x263402['error'][_0x259c('0x15')]);return _0xc8cc2a(_0x263402['error'][_0x259c('0x15')]);}logger[_0x259c('0x12')](_0x259c('0x14'),_0x18dfe8,_0x263402[_0x259c('0x12')]['message']);return _0x82deba(_0x263402['error'][_0x259c('0x15')]);}else{logger['info'](_0x259c('0x14'),_0x18dfe8,_0x259c('0x10'));_0x82deba(_0x263402['result'][_0x259c('0x15')]);}})[_0x259c('0x16')](function(_0x13e777){logger[_0x259c('0x12')](_0x259c('0x14'),_0x18dfe8,_0x13e777);_0xc8cc2a(_0x13e777);});});}exports['ShowSquareOdbc']=function(_0x183c4b){var _0x4964e9=this;return new Promise(function(_0x24ea8c,_0x1db5af){return db[_0x259c('0x17')][_0x259c('0x18')]({'raw':_0x183c4b['options']?_0x183c4b[_0x259c('0x19')][_0x259c('0x1a')]===undefined?!![]:![]:!![],'where':_0x183c4b[_0x259c('0x19')]?_0x183c4b[_0x259c('0x19')]['where']||null:null,'attributes':_0x183c4b[_0x259c('0x19')]?_0x183c4b['options'][_0x259c('0x1b')]||null:null,'include':_0x183c4b[_0x259c('0x19')]?_0x183c4b[_0x259c('0x19')][_0x259c('0x1c')]?_[_0x259c('0x1d')](_0x183c4b['options'][_0x259c('0x1c')],function(_0x50f03d){return{'model':db[_0x50f03d[_0x259c('0x1e')]],'as':_0x50f03d['as'],'attributes':_0x50f03d['attributes'],'include':_0x50f03d[_0x259c('0x1c')]?_[_0x259c('0x1d')](_0x50f03d[_0x259c('0x1c')],function(_0x4527da){return{'model':db[_0x4527da[_0x259c('0x1e')]],'as':_0x4527da['as'],'attributes':_0x4527da[_0x259c('0x1b')],'include':_0x4527da['include']?_[_0x259c('0x1d')](_0x4527da[_0x259c('0x1c')],function(_0x42cd0c){return{'model':db[_0x42cd0c[_0x259c('0x1e')]],'as':_0x42cd0c['as'],'attributes':_0x42cd0c[_0x259c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x259c('0x1f')](function(_0xec266f){logger[_0x259c('0xd')](_0x259c('0x20'),_0x183c4b);logger['debug'](_0x259c('0x20'),_0x183c4b,JSON[_0x259c('0x11')](_0xec266f));_0x24ea8c(_0xec266f);})[_0x259c('0x16')](function(_0x2c4faa){logger[_0x259c('0x12')](_0x259c('0x20'),_0x2c4faa[_0x259c('0x15')],_0x183c4b);_0x1db5af(_0x4964e9[_0x259c('0x12')](0x1f4,_0x2c4faa[_0x259c('0x15')]));});});}; \ No newline at end of file +var _0x7b4b=['SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SquareOdbc','options','where','attributes','map','include','model','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent'];(function(_0x4dfccc,_0xd04a68){var _0x5c87b0=function(_0x52c4ce){while(--_0x52c4ce){_0x4dfccc['push'](_0x4dfccc['shift']());}};_0x5c87b0(++_0xd04a68);}(_0x7b4b,0xd0));var _0xb7b4=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x7b4b[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xb7b4('0x0'));var util=require('util');var moment=require(_0xb7b4('0x1'));var BPromise=require(_0xb7b4('0x2'));var rs=require(_0xb7b4('0x3'));var fs=require('fs');var Redis=require(_0xb7b4('0x4'));var db=require(_0xb7b4('0x5'))['db'];var utils=require(_0xb7b4('0x6'));var logger=require(_0xb7b4('0x7'))(_0xb7b4('0x8'));var config=require(_0xb7b4('0x9'));var jayson=require(_0xb7b4('0xa'));var client=jayson[_0xb7b4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56de2a,_0x215d4d,_0xcb440f){return new BPromise(function(_0x2389e6,_0x24f2bd){return client[_0xb7b4('0xc')](_0x56de2a,_0xcb440f)[_0xb7b4('0xd')](function(_0x1cc641){logger['info'](_0xb7b4('0xe'),_0x215d4d,_0xb7b4('0xf'));logger['debug'](_0xb7b4('0x10'),_0x215d4d,'request\x20sent',JSON[_0xb7b4('0x11')](_0x1cc641));if(_0x1cc641[_0xb7b4('0x12')]){if(_0x1cc641[_0xb7b4('0x12')][_0xb7b4('0x13')]===0x1f4){logger[_0xb7b4('0x12')](_0xb7b4('0xe'),_0x215d4d,_0x1cc641[_0xb7b4('0x12')][_0xb7b4('0x14')]);return _0x24f2bd(_0x1cc641[_0xb7b4('0x12')][_0xb7b4('0x14')]);}logger[_0xb7b4('0x12')](_0xb7b4('0xe'),_0x215d4d,_0x1cc641[_0xb7b4('0x12')][_0xb7b4('0x14')]);return _0x2389e6(_0x1cc641[_0xb7b4('0x12')][_0xb7b4('0x14')]);}else{logger[_0xb7b4('0x15')](_0xb7b4('0xe'),_0x215d4d,_0xb7b4('0xf'));_0x2389e6(_0x1cc641[_0xb7b4('0x16')][_0xb7b4('0x14')]);}})[_0xb7b4('0x17')](function(_0x57acf7){logger[_0xb7b4('0x12')](_0xb7b4('0xe'),_0x215d4d,_0x57acf7);_0x24f2bd(_0x57acf7);});});}exports['ShowSquareOdbc']=function(_0x1cf7ff){var _0x4f2dd1=this;return new Promise(function(_0x226672,_0x5a78ba){return db[_0xb7b4('0x18')]['find']({'raw':_0x1cf7ff['options']?_0x1cf7ff['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cf7ff['options']?_0x1cf7ff[_0xb7b4('0x19')][_0xb7b4('0x1a')]||null:null,'attributes':_0x1cf7ff['options']?_0x1cf7ff[_0xb7b4('0x19')][_0xb7b4('0x1b')]||null:null,'include':_0x1cf7ff['options']?_0x1cf7ff[_0xb7b4('0x19')]['include']?_[_0xb7b4('0x1c')](_0x1cf7ff[_0xb7b4('0x19')][_0xb7b4('0x1d')],function(_0x4a686d){return{'model':db[_0x4a686d[_0xb7b4('0x1e')]],'as':_0x4a686d['as'],'attributes':_0x4a686d['attributes'],'include':_0x4a686d[_0xb7b4('0x1d')]?_[_0xb7b4('0x1c')](_0x4a686d[_0xb7b4('0x1d')],function(_0x591eaa){return{'model':db[_0x591eaa[_0xb7b4('0x1e')]],'as':_0x591eaa['as'],'attributes':_0x591eaa['attributes'],'include':_0x591eaa[_0xb7b4('0x1d')]?_[_0xb7b4('0x1c')](_0x591eaa[_0xb7b4('0x1d')],function(_0x4fc30a){return{'model':db[_0x4fc30a['model']],'as':_0x4fc30a['as'],'attributes':_0x4fc30a['attributes']};}):[]};}):[]};}):[]:[]})[_0xb7b4('0xd')](function(_0x2294ac){logger[_0xb7b4('0x15')]('ShowSquareOdbc',_0x1cf7ff);logger[_0xb7b4('0x1f')]('ShowSquareOdbc',_0x1cf7ff,JSON[_0xb7b4('0x11')](_0x2294ac));_0x226672(_0x2294ac);})[_0xb7b4('0x17')](function(_0x126ba3){logger[_0xb7b4('0x12')]('ShowSquareOdbc',_0x126ba3[_0xb7b4('0x14')],_0x1cf7ff);_0x5a78ba(_0x4f2dd1[_0xb7b4('0x12')](0x1f4,_0x126ba3[_0xb7b4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 5a66c41..dc3c98a 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 _0x4cd3=['util','fs-extra','../../components/auth/service','get','/:id','show','/:id/users','getUsers','post','isAuthenticated','create','addUsers','put','delete','destroy','exports','multer'];(function(_0x43fb7a,_0x3807f1){var _0x1be693=function(_0x4e12f8){while(--_0x4e12f8){_0x43fb7a['push'](_0x43fb7a['shift']());}};_0x1be693(++_0x3807f1);}(_0x4cd3,0x1ca));var _0x34cd=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x4cd3[_0x56916d];return _0x2b7f1f;};'use strict';var multer=require(_0x34cd('0x0'));var util=require(_0x34cd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x34cd('0x2'));var auth=require(_0x34cd('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0x34cd('0x4')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x34cd('0x5'),auth['isAuthenticated'](),controller[_0x34cd('0x6')]);router[_0x34cd('0x4')](_0x34cd('0x7'),auth['isAuthenticated'](),controller[_0x34cd('0x8')]);router[_0x34cd('0x9')]('/',auth[_0x34cd('0xa')](),controller[_0x34cd('0xb')]);router[_0x34cd('0x9')](_0x34cd('0x7'),auth[_0x34cd('0xa')](),controller[_0x34cd('0xc')]);router[_0x34cd('0xd')](_0x34cd('0x5'),auth[_0x34cd('0xa')](),controller['update']);router[_0x34cd('0xe')](_0x34cd('0x5'),auth[_0x34cd('0xa')](),controller[_0x34cd('0xf')]);router[_0x34cd('0xe')](_0x34cd('0x7'),auth[_0x34cd('0xa')](),controller['removeUsers']);module[_0x34cd('0x10')]=router; \ No newline at end of file +var _0x6215=['/:id','isAuthenticated','show','getUsers','post','/:id/users','put','update','delete','destroy','removeUsers','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2102e0,_0x4b7fe0){var _0x968f45=function(_0x3e8827){while(--_0x3e8827){_0x2102e0['push'](_0x2102e0['shift']());}};_0x968f45(++_0x4b7fe0);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5621('0x0'));var util=require(_0x5621('0x1'));var path=require(_0x5621('0x2'));var timeout=require('connect-timeout');var express=require(_0x5621('0x3'));var router=express[_0x5621('0x4')]();var fs_extra=require(_0x5621('0x5'));var auth=require(_0x5621('0x6'));var interaction=require(_0x5621('0x7'));var config=require(_0x5621('0x8'));var controller=require('./squareProject.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5621('0x9')](_0x5621('0xa'),auth[_0x5621('0xb')](),controller[_0x5621('0xc')]);router[_0x5621('0x9')]('/:id/users',auth[_0x5621('0xb')](),controller[_0x5621('0xd')]);router[_0x5621('0xe')]('/',auth[_0x5621('0xb')](),controller['create']);router[_0x5621('0xe')](_0x5621('0xf'),auth[_0x5621('0xb')](),controller['addUsers']);router[_0x5621('0x10')](_0x5621('0xa'),auth[_0x5621('0xb')](),controller[_0x5621('0x11')]);router[_0x5621('0x12')](_0x5621('0xa'),auth[_0x5621('0xb')](),controller[_0x5621('0x13')]);router[_0x5621('0x12')](_0x5621('0xf'),auth['isAuthenticated'](),controller[_0x5621('0x14')]);module[_0x5621('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index fd617ff..b3566ef 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 _0xd3ed=['STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports'];(function(_0x3ab3fb,_0x44f17f){var _0x1a3633=function(_0x1e8684){while(--_0x1e8684){_0x3ab3fb['push'](_0x3ab3fb['shift']());}};_0x1a3633(++_0x44f17f);}(_0xd3ed,0x142));var _0xdd3e=function(_0x2fa1fe,_0x592647){_0x2fa1fe=_0x2fa1fe-0x0;var _0xf87f21=_0xd3ed[_0x2fa1fe];return _0xf87f21;};'use strict';var Sequelize=require(_0xdd3e('0x0'));module[_0xdd3e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xdd3e('0x2')]},'notes':{'type':Sequelize[_0xdd3e('0x3')]},'preproduction':{'type':Sequelize[_0xdd3e('0x4')](_0xdd3e('0x5')),'get':function(){if(this[_0xdd3e('0x6')](_0xdd3e('0x7'))){return this[_0xdd3e('0x6')](_0xdd3e('0x7'))[_0xdd3e('0x8')](_0xdd3e('0x9'));}}},'production':{'type':Sequelize[_0xdd3e('0x4')](_0xdd3e('0x5')),'get':function(){if(this[_0xdd3e('0x6')](_0xdd3e('0xa'))){return this[_0xdd3e('0x6')]('production')[_0xdd3e('0x8')](_0xdd3e('0x9'));}}},'savedAt':{'type':Sequelize[_0xdd3e('0xb')]},'publishedAt':{'type':Sequelize[_0xdd3e('0xb')]}}; \ No newline at end of file +var _0x0aaa=['toString','production','utf8','DATE','sequelize','exports','STRING','TEXT','BLOB','long','getDataValue','preproduction'];(function(_0x451bb6,_0x317d6b){var _0x446674=function(_0x39c545){while(--_0x39c545){_0x451bb6['push'](_0x451bb6['shift']());}};_0x446674(++_0x317d6b);}(_0x0aaa,0x160));var _0xa0aa=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x0aaa[_0x525af9];return _0x129fbf;};'use strict';var Sequelize=require(_0xa0aa('0x0'));module[_0xa0aa('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xa0aa('0x2')]},'notes':{'type':Sequelize[_0xa0aa('0x3')]},'preproduction':{'type':Sequelize[_0xa0aa('0x4')](_0xa0aa('0x5')),'get':function(){if(this[_0xa0aa('0x6')](_0xa0aa('0x7'))){return this[_0xa0aa('0x6')]('preproduction')[_0xa0aa('0x8')]('utf8');}}},'production':{'type':Sequelize[_0xa0aa('0x4')]('long'),'get':function(){if(this[_0xa0aa('0x6')]('production')){return this[_0xa0aa('0x6')](_0xa0aa('0x9'))[_0xa0aa('0x8')](_0xa0aa('0xa'));}}},'savedAt':{'type':Sequelize[_0xa0aa('0xb')]},'publishedAt':{'type':Sequelize[_0xa0aa('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ac645cf..61ad8e4 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 _0xd5b7=['sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','then','destroy','get','SquareProjects','UserProfileResource','stringify','name','send','net','Socket','port','127.0.0.1','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','params','length','options','catch','create','body','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','spread','production','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','ioredis','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0xe4f3f0,_0xbe6c93){var _0x359497=function(_0xe52c95){while(--_0xe52c95){_0xe4f3f0['push'](_0xe4f3f0['shift']());}};_0x359497(++_0xbe6c93);}(_0xd5b7,0xe8));var _0x7d5b=function(_0x5df61d,_0x158640){_0x5df61d=_0x5df61d-0x0;var _0x24cc4c=_0xd5b7[_0x5df61d];return _0x24cc4c;};'use strict';var _=require('lodash');var Redis=require(_0x7d5b('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x7d5b('0x1'))(_0x7d5b('0x2'));var config=require(_0x7d5b('0x3'));var db=require('../../mysqldb')['db'];config[_0x7d5b('0x4')]=_[_0x7d5b('0x5')](config[_0x7d5b('0x4')],{'host':_0x7d5b('0x6'),'port':0x18eb});var socket=require(_0x7d5b('0x7'))(new Redis(config[_0x7d5b('0x4')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x350d13,_0x4fd1cb){_0x4fd1cb=_0x4fd1cb||0xcc;return function(_0xde9ad3){if(_0xde9ad3){return _0x350d13[_0x7d5b('0x8')](_0x4fd1cb);}return _0x350d13[_0x7d5b('0x9')](_0x4fd1cb)[_0x7d5b('0xa')]();};}function respondWithResult(_0x4d1ccf,_0x5ec50a){_0x5ec50a=_0x5ec50a||0xc8;return function(_0x15343a){if(_0x15343a){return _0x4d1ccf[_0x7d5b('0x9')](_0x5ec50a)['json'](_0x15343a);}};}function respondWithFilteredResult(_0x4aeec3,_0x49d2db){return function(_0x4f9c48){if(_0x4f9c48){var _0x72e28f=typeof _0x49d2db['offset']==='undefined'&&typeof _0x49d2db[_0x7d5b('0xb')]===_0x7d5b('0xc');var _0x135d1b=_0x4f9c48[_0x7d5b('0xd')];var _0x411504=_0x72e28f?0x0:_0x49d2db[_0x7d5b('0xe')];var _0xe494e9=_0x72e28f?_0x4f9c48[_0x7d5b('0xd')]:_0x49d2db[_0x7d5b('0xe')]+_0x49d2db[_0x7d5b('0xb')];var _0xa5bae8;if(_0xe494e9>=_0x135d1b){_0xe494e9=_0x135d1b;_0xa5bae8=0xc8;}else{_0xa5bae8=0xce;}_0x4aeec3[_0x7d5b('0x9')](_0xa5bae8);return _0x4aeec3[_0x7d5b('0xf')](_0x7d5b('0x10'),_0x411504+'-'+_0xe494e9+'/'+_0x135d1b)[_0x7d5b('0x11')](_0x4f9c48);}return null;};}function saveUpdates(_0x40755a){return function(_0xdcd484){if(_0xdcd484){return _0xdcd484['update'](_0x40755a)[_0x7d5b('0x12')](function(_0x2a6356){return _0x2a6356;});}return null;};}function removeEntity(_0x573444){return function(_0x2dda1e){if(_0x2dda1e){return _0x2dda1e[_0x7d5b('0x13')]()[_0x7d5b('0x12')](function(){var _0xd5a5e2=_0x2dda1e[_0x7d5b('0x14')]({'plain':!![]});var _0x3c2429=_0x7d5b('0x15');return db[_0x7d5b('0x16')][_0x7d5b('0x13')]({'where':{'type':_0x3c2429,'resourceId':_0xd5a5e2['id']}})['then'](function(){return _0x2dda1e;});})[_0x7d5b('0x12')](function(){return createAgiSocket();})[_0x7d5b('0x12')](function(_0x296286){_0x296286[_0x7d5b('0xa')](JSON[_0x7d5b('0x17')]({'id':_0x2dda1e['id'],'deleted':!![]}));})[_0x7d5b('0x12')](function(){_0x573444['status'](0xcc)[_0x7d5b('0xa')]();});}};}function handleEntityNotFound(_0x45d7af){return function(_0x151fb7){if(!_0x151fb7){_0x45d7af[_0x7d5b('0x8')](0x194);}return _0x151fb7;};}function handleError(_0xad8fe7,_0x160144){_0x160144=_0x160144||0x1f4;return function(_0x20eae5){logger['error'](_0x20eae5['stack']);if(_0x20eae5['name']){delete _0x20eae5[_0x7d5b('0x18')];}_0xad8fe7[_0x7d5b('0x9')](_0x160144)[_0x7d5b('0x19')](_0x20eae5);};}function createAgiSocket(){try{var _0x4ed484=require(_0x7d5b('0x1a'));var _0x3aabb1=new _0x4ed484[(_0x7d5b('0x1b'))]();return _0x3aabb1['connect'](config['agi'][_0x7d5b('0x1c')]||0x11dd,_0x7d5b('0x1d'));}catch(_0x2c6c05){throw _0x2c6c05;}}exports[_0x7d5b('0x1e')]=function(_0x495689,_0x2a6539){var _0x3d8a94={},_0x30d593={},_0x4d7fcc={'count':0x0,'rows':[]};var _0xb4b54=_[_0x7d5b('0x1f')](db[_0x7d5b('0x20')][_0x7d5b('0x21')],function(_0x1147ff){return{'name':_0x1147ff[_0x7d5b('0x22')],'type':_0x1147ff[_0x7d5b('0x23')][_0x7d5b('0x24')]};});_0x30d593[_0x7d5b('0x25')]=_[_0x7d5b('0x1f')](_0xb4b54,_0x7d5b('0x18'));_0x30d593[_0x7d5b('0x26')]=_[_0x7d5b('0x27')](_0x495689[_0x7d5b('0x26')]);_0x30d593[_0x7d5b('0x28')]=_[_0x7d5b('0x29')](_0x30d593['model'],_0x30d593[_0x7d5b('0x26')]);_0x3d8a94[_0x7d5b('0x2a')]=_['intersection'](_0x30d593[_0x7d5b('0x25')],qs[_0x7d5b('0x2b')](_0x495689['query'][_0x7d5b('0x2b')]));_0x3d8a94[_0x7d5b('0x2a')]=_0x3d8a94[_0x7d5b('0x2a')]['length']?_0x3d8a94['attributes']:_0x30d593[_0x7d5b('0x25')];if(!_0x495689[_0x7d5b('0x26')][_0x7d5b('0x2c')](_0x7d5b('0x2d'))){_0x3d8a94[_0x7d5b('0xb')]=qs[_0x7d5b('0xb')](_0x495689[_0x7d5b('0x26')][_0x7d5b('0xb')]);_0x3d8a94[_0x7d5b('0xe')]=qs[_0x7d5b('0xe')](_0x495689[_0x7d5b('0x26')][_0x7d5b('0xe')]);}_0x3d8a94[_0x7d5b('0x2e')]=qs['sort'](_0x495689['query'][_0x7d5b('0x2f')]);_0x3d8a94[_0x7d5b('0x30')]=qs[_0x7d5b('0x28')](_[_0x7d5b('0x31')](_0x495689['query'],_0x30d593[_0x7d5b('0x28')]),_0xb4b54);if(_0x495689[_0x7d5b('0x26')]['filter']){_0x3d8a94[_0x7d5b('0x30')]=_[_0x7d5b('0x32')](_0x3d8a94['where'],{'$or':_['map'](_0xb4b54,function(_0x4249c4){if(_0x4249c4[_0x7d5b('0x23')]!==_0x7d5b('0x33')){var _0x27c710={};_0x27c710[_0x4249c4[_0x7d5b('0x18')]]={'$like':'%'+_0x495689[_0x7d5b('0x26')][_0x7d5b('0x34')]+'%'};return _0x27c710;}})});}_0x3d8a94=_['merge']({},_0x3d8a94,_0x495689['options']);var _0x308ddb={'where':_0x3d8a94[_0x7d5b('0x30')]};return db[_0x7d5b('0x20')][_0x7d5b('0xd')](_0x308ddb)[_0x7d5b('0x12')](function(_0x1dc361){_0x4d7fcc[_0x7d5b('0xd')]=_0x1dc361;if(_0x495689[_0x7d5b('0x26')][_0x7d5b('0x35')]){_0x3d8a94[_0x7d5b('0x36')]=[{'all':!![]}];}return db[_0x7d5b('0x20')][_0x7d5b('0x37')](_0x3d8a94);})[_0x7d5b('0x12')](function(_0x2550b2){_0x4d7fcc[_0x7d5b('0x38')]=_0x2550b2;return _0x4d7fcc;})[_0x7d5b('0x12')](respondWithFilteredResult(_0x2a6539,_0x3d8a94))['catch'](handleError(_0x2a6539,null));};exports['show']=function(_0x583472,_0x232417){var _0xdbc7f8={'raw':![],'where':{'id':_0x583472[_0x7d5b('0x39')]['id']}},_0x2b9137={};_0x2b9137[_0x7d5b('0x25')]=_[_0x7d5b('0x27')](db[_0x7d5b('0x20')][_0x7d5b('0x21')]);_0x2b9137[_0x7d5b('0x26')]=_[_0x7d5b('0x27')](_0x583472[_0x7d5b('0x26')]);_0x2b9137[_0x7d5b('0x28')]=_[_0x7d5b('0x29')](_0x2b9137[_0x7d5b('0x25')],_0x2b9137[_0x7d5b('0x26')]);_0xdbc7f8[_0x7d5b('0x2a')]=_[_0x7d5b('0x29')](_0x2b9137['model'],qs[_0x7d5b('0x2b')](_0x583472[_0x7d5b('0x26')][_0x7d5b('0x2b')]));_0xdbc7f8[_0x7d5b('0x2a')]=_0xdbc7f8[_0x7d5b('0x2a')][_0x7d5b('0x3a')]?_0xdbc7f8['attributes']:_0x2b9137['model'];if(_0x583472['query'][_0x7d5b('0x35')]){_0xdbc7f8[_0x7d5b('0x36')]=[{'all':!![]}];}_0xdbc7f8=_[_0x7d5b('0x32')]({},_0xdbc7f8,_0x583472[_0x7d5b('0x3b')]);return db[_0x7d5b('0x20')]['find'](_0xdbc7f8)[_0x7d5b('0x12')](handleEntityNotFound(_0x232417,null))[_0x7d5b('0x12')](respondWithResult(_0x232417,null))[_0x7d5b('0x3c')](handleError(_0x232417,null));};exports['create']=function(_0x3a422b,_0x3c6d1b){return db[_0x7d5b('0x20')][_0x7d5b('0x3d')](_0x3a422b[_0x7d5b('0x3e')],{})[_0x7d5b('0x12')](function(_0x2adcc7){var _0x5c45c7=_0x3a422b[_0x7d5b('0x3f')][_0x7d5b('0x14')]({'plain':!![]});if(!_0x5c45c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c45c7[_0x7d5b('0x40')]===_0x7d5b('0x3f')){var _0x3c2fdf=_0x2adcc7[_0x7d5b('0x14')]({'plain':!![]});var _0x593935=_0x7d5b('0x15');return db[_0x7d5b('0x41')][_0x7d5b('0x42')]({'where':{'name':_0x593935,'userProfileId':_0x5c45c7['userProfileId']},'raw':!![]})[_0x7d5b('0x12')](function(_0x258602){if(_0x258602&&_0x258602[_0x7d5b('0x43')]===0x0){return db[_0x7d5b('0x16')][_0x7d5b('0x3d')]({'name':_0x3c2fdf['name'],'resourceId':_0x3c2fdf['id'],'type':_0x258602[_0x7d5b('0x18')],'sectionId':_0x258602['id']},{})['then'](function(){return _0x2adcc7;});}else{return _0x2adcc7;}})['catch'](function(_0x1977e6){logger['error'](_0x7d5b('0x44'),_0x1977e6);throw _0x1977e6;});}return _0x2adcc7;})[_0x7d5b('0x12')](respondWithResult(_0x3c6d1b,0xc9))['catch'](handleError(_0x3c6d1b,null));};exports['update']=function(_0x1e8b54,_0x35d4ea){if(_0x1e8b54[_0x7d5b('0x3e')]['id']){delete _0x1e8b54[_0x7d5b('0x3e')]['id'];}return db[_0x7d5b('0x20')][_0x7d5b('0x42')]({'where':{'id':_0x1e8b54[_0x7d5b('0x39')]['id']}})['then'](handleEntityNotFound(_0x35d4ea,null))[_0x7d5b('0x12')](saveUpdates(_0x1e8b54[_0x7d5b('0x3e')],null))[_0x7d5b('0x12')](function(_0x4010b9){if(!_0x4010b9)return;var _0x2e5aed=_0x4010b9[_0x7d5b('0x14')]({'plain':!![]});return[createAgiSocket(),_0x2e5aed];})[_0x7d5b('0x45')](function(_0xa03dc3,_0x503d2d){_0xa03dc3[_0x7d5b('0xa')](JSON[_0x7d5b('0x17')](_['pick'](_0x503d2d,['id',_0x7d5b('0x18'),_0x7d5b('0x46')])));return _0x503d2d;})[_0x7d5b('0x12')](respondWithResult(_0x35d4ea,null))['catch'](handleError(_0x35d4ea,null));};exports['destroy']=function(_0xbdd0b3,_0x40137b){return db[_0x7d5b('0x20')][_0x7d5b('0x42')]({'where':{'id':_0xbdd0b3[_0x7d5b('0x39')]['id']}})[_0x7d5b('0x12')](handleEntityNotFound(_0x40137b,null))['then'](removeEntity(_0x40137b,null))[_0x7d5b('0x3c')](handleError(_0x40137b,null));};exports[_0x7d5b('0x47')]=function(_0x57a271,_0x20a1bb){return db[_0x7d5b('0x20')][_0x7d5b('0x42')]({'where':{'id':_0x57a271[_0x7d5b('0x39')]['id']}})[_0x7d5b('0x12')](handleEntityNotFound(_0x20a1bb,null))[_0x7d5b('0x12')](function(_0x1983c5){if(_0x1983c5){return _0x1983c5['addUsers'](_0x57a271['body'][_0x7d5b('0x48')],_['omit'](_0x57a271[_0x7d5b('0x3e')],['ids','id'])||{});}})[_0x7d5b('0x12')](respondWithResult(_0x20a1bb,null))[_0x7d5b('0x3c')](handleError(_0x20a1bb,null));};exports['removeUsers']=function(_0x2555f8,_0x50d897){return db[_0x7d5b('0x20')][_0x7d5b('0x42')]({'where':{'id':_0x2555f8[_0x7d5b('0x39')]['id']}})[_0x7d5b('0x12')](handleEntityNotFound(_0x50d897,null))[_0x7d5b('0x12')](function(_0x575c2f){if(_0x575c2f){return _0x575c2f[_0x7d5b('0x49')](_0x2555f8[_0x7d5b('0x26')][_0x7d5b('0x48')])[_0x7d5b('0x12')](function(){if(_[_0x7d5b('0x4a')](_0x2555f8[_0x7d5b('0x26')][_0x7d5b('0x48')])){for(var _0x2dd9ae=0x0;_0x2dd9ae<_0x2555f8[_0x7d5b('0x26')][_0x7d5b('0x48')][_0x7d5b('0x3a')];_0x2dd9ae+=0x1){socket[_0x7d5b('0x4b')](_0x7d5b('0x4c'),{'UserId':Number(_0x2555f8[_0x7d5b('0x26')]['ids'][_0x2dd9ae]),'SquareProjectId':Number(_0x2555f8[_0x7d5b('0x39')]['id'])});}}else{socket[_0x7d5b('0x4b')](_0x7d5b('0x4c'),{'UserId':Number(_0x2555f8[_0x7d5b('0x26')]['ids']),'SquareProjectId':Number(_0x2555f8[_0x7d5b('0x39')]['id'])});}});}})[_0x7d5b('0x12')](respondWithStatusCode(_0x50d897,null))[_0x7d5b('0x3c')](handleError(_0x50d897,null));};exports[_0x7d5b('0x4d')]=function(_0x54510d,_0x2ae138){var _0x35e00b={};var _0x32a17c={};var _0x3442fc;var _0x4efe80;return db['SquareProject'][_0x7d5b('0x4e')]({'where':{'id':_0x54510d[_0x7d5b('0x39')]['id']}})[_0x7d5b('0x12')](handleEntityNotFound(_0x2ae138,null))['then'](function(_0x2417d5){if(_0x2417d5){_0x3442fc=_0x2417d5;_0x32a17c[_0x7d5b('0x25')]=_[_0x7d5b('0x27')](db[_0x7d5b('0x4f')]['rawAttributes']);_0x32a17c['query']=_[_0x7d5b('0x27')](_0x54510d[_0x7d5b('0x26')]);_0x32a17c[_0x7d5b('0x28')]=_[_0x7d5b('0x29')](_0x32a17c[_0x7d5b('0x25')],_0x32a17c[_0x7d5b('0x26')]);_0x35e00b[_0x7d5b('0x2a')]=_[_0x7d5b('0x29')](_0x32a17c[_0x7d5b('0x25')],qs[_0x7d5b('0x2b')](_0x54510d[_0x7d5b('0x26')][_0x7d5b('0x2b')]));_0x35e00b[_0x7d5b('0x2a')]=_0x35e00b[_0x7d5b('0x2a')][_0x7d5b('0x3a')]?_0x35e00b[_0x7d5b('0x2a')]:_0x32a17c[_0x7d5b('0x25')];_0x35e00b[_0x7d5b('0x2e')]=qs[_0x7d5b('0x2f')](_0x54510d['query'][_0x7d5b('0x2f')]);_0x35e00b['where']=qs['filters'](_[_0x7d5b('0x31')](_0x54510d[_0x7d5b('0x26')],_0x32a17c[_0x7d5b('0x28')]));if(_0x54510d[_0x7d5b('0x26')]['filter']){_0x35e00b[_0x7d5b('0x30')]=_[_0x7d5b('0x32')](_0x35e00b[_0x7d5b('0x30')],{'$or':_['map'](_0x35e00b[_0x7d5b('0x2a')],function(_0x102b38){var _0x2adf36={};_0x2adf36[_0x102b38]={'$like':'%'+_0x54510d[_0x7d5b('0x26')][_0x7d5b('0x34')]+'%'};return _0x2adf36;})});}_0x35e00b=_[_0x7d5b('0x32')]({},_0x35e00b,_0x54510d[_0x7d5b('0x3b')]);return _0x3442fc[_0x7d5b('0x4d')](_0x35e00b);}})[_0x7d5b('0x12')](function(_0x263d0b){if(_0x263d0b){_0x4efe80=_0x263d0b[_0x7d5b('0x3a')];if(!_0x54510d['query'][_0x7d5b('0x2c')](_0x7d5b('0x2d'))){_0x35e00b['limit']=qs[_0x7d5b('0xb')](_0x54510d[_0x7d5b('0x26')][_0x7d5b('0xb')]);_0x35e00b[_0x7d5b('0xe')]=qs['offset'](_0x54510d['query']['offset']);}return _0x3442fc[_0x7d5b('0x4d')](_0x35e00b);}})[_0x7d5b('0x12')](function(_0x5a2be8){if(_0x5a2be8){return _0x5a2be8?{'count':_0x4efe80,'rows':_0x5a2be8}:null;}})[_0x7d5b('0x12')](respondWithResult(_0x2ae138,null))[_0x7d5b('0x3c')](handleError(_0x2ae138,null));}; \ No newline at end of file +var _0x9e91=['count','limit','update','then','destroy','get','SquareProjects','stringify','stack','name','send','net','Socket','connect','agi','port','127.0.0.1','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','find','SquareProject','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','spread','addUsers','ids','omit','removeUsers','emit','getUsers','findOne','User','hasOwnProperty','nolimit','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined'];(function(_0x321327,_0x4965b){var _0x33be38=function(_0x27e02c){while(--_0x27e02c){_0x321327['push'](_0x321327['shift']());}};_0x33be38(++_0x4965b);}(_0x9e91,0x18a));var _0x19e9=function(_0x31f279,_0x48a399){_0x31f279=_0x31f279-0x0;var _0x2e4b3f=_0x9e91[_0x31f279];return _0x2e4b3f;};'use strict';var _=require(_0x19e9('0x0'));var Redis=require(_0x19e9('0x1'));var qs=require(_0x19e9('0x2'));var logger=require('../../config/logger')(_0x19e9('0x3'));var config=require(_0x19e9('0x4'));var db=require(_0x19e9('0x5'))['db'];config[_0x19e9('0x6')]=_['defaults'](config[_0x19e9('0x6')],{'host':_0x19e9('0x7'),'port':0x18eb});var socket=require(_0x19e9('0x8'))(new Redis(config[_0x19e9('0x6')]));require('./squareProject.socket')[_0x19e9('0x9')](socket);function respondWithStatusCode(_0x216913,_0xc57995){_0xc57995=_0xc57995||0xcc;return function(_0x2173c8){if(_0x2173c8){return _0x216913[_0x19e9('0xa')](_0xc57995);}return _0x216913['status'](_0xc57995)[_0x19e9('0xb')]();};}function respondWithResult(_0x47b6aa,_0x16e46c){_0x16e46c=_0x16e46c||0xc8;return function(_0x114d90){if(_0x114d90){return _0x47b6aa[_0x19e9('0xc')](_0x16e46c)[_0x19e9('0xd')](_0x114d90);}};}function respondWithFilteredResult(_0x2af0e0,_0x3ce5ad){return function(_0xe39f36){if(_0xe39f36){var _0x327cbe=typeof _0x3ce5ad[_0x19e9('0xe')]===_0x19e9('0xf')&&typeof _0x3ce5ad['limit']==='undefined';var _0xb501d5=_0xe39f36['count'];var _0x52b33f=_0x327cbe?0x0:_0x3ce5ad[_0x19e9('0xe')];var _0x4e6d67=_0x327cbe?_0xe39f36[_0x19e9('0x10')]:_0x3ce5ad['offset']+_0x3ce5ad[_0x19e9('0x11')];var _0x2d2fe6;if(_0x4e6d67>=_0xb501d5){_0x4e6d67=_0xb501d5;_0x2d2fe6=0xc8;}else{_0x2d2fe6=0xce;}_0x2af0e0[_0x19e9('0xc')](_0x2d2fe6);return _0x2af0e0['set']('Content-Range',_0x52b33f+'-'+_0x4e6d67+'/'+_0xb501d5)[_0x19e9('0xd')](_0xe39f36);}return null;};}function saveUpdates(_0x3e5116){return function(_0x58c962){if(_0x58c962){return _0x58c962[_0x19e9('0x12')](_0x3e5116)[_0x19e9('0x13')](function(_0x4f9cc0){return _0x4f9cc0;});}return null;};}function removeEntity(_0x11a73b){return function(_0x1f1620){if(_0x1f1620){return _0x1f1620[_0x19e9('0x14')]()['then'](function(){var _0x36457f=_0x1f1620[_0x19e9('0x15')]({'plain':!![]});var _0x5388e0=_0x19e9('0x16');return db['UserProfileResource'][_0x19e9('0x14')]({'where':{'type':_0x5388e0,'resourceId':_0x36457f['id']}})['then'](function(){return _0x1f1620;});})[_0x19e9('0x13')](function(){return createAgiSocket();})[_0x19e9('0x13')](function(_0x4de20b){_0x4de20b[_0x19e9('0xb')](JSON[_0x19e9('0x17')]({'id':_0x1f1620['id'],'deleted':!![]}));})['then'](function(){_0x11a73b[_0x19e9('0xc')](0xcc)[_0x19e9('0xb')]();});}};}function handleEntityNotFound(_0x5d4816){return function(_0x817d15){if(!_0x817d15){_0x5d4816[_0x19e9('0xa')](0x194);}return _0x817d15;};}function handleError(_0xefca,_0x5c675){_0x5c675=_0x5c675||0x1f4;return function(_0x3b15a8){logger['error'](_0x3b15a8[_0x19e9('0x18')]);if(_0x3b15a8[_0x19e9('0x19')]){delete _0x3b15a8[_0x19e9('0x19')];}_0xefca[_0x19e9('0xc')](_0x5c675)[_0x19e9('0x1a')](_0x3b15a8);};}function createAgiSocket(){try{var _0x1b8b6b=require(_0x19e9('0x1b'));var _0x3821fb=new _0x1b8b6b[(_0x19e9('0x1c'))]();return _0x3821fb[_0x19e9('0x1d')](config[_0x19e9('0x1e')][_0x19e9('0x1f')]||0x11dd,_0x19e9('0x20'));}catch(_0x196d04){throw _0x196d04;}}exports['index']=function(_0x34cc09,_0xcfa964){var _0x383ae9={},_0x56f0ee={},_0xe96572={'count':0x0,'rows':[]};var _0x1c5f53=_[_0x19e9('0x21')](db['SquareProject'][_0x19e9('0x22')],function(_0x4e978e){return{'name':_0x4e978e[_0x19e9('0x23')],'type':_0x4e978e['type'][_0x19e9('0x24')]};});_0x56f0ee[_0x19e9('0x25')]=_[_0x19e9('0x21')](_0x1c5f53,_0x19e9('0x19'));_0x56f0ee[_0x19e9('0x26')]=_['keys'](_0x34cc09[_0x19e9('0x26')]);_0x56f0ee[_0x19e9('0x27')]=_[_0x19e9('0x28')](_0x56f0ee[_0x19e9('0x25')],_0x56f0ee['query']);_0x383ae9[_0x19e9('0x29')]=_[_0x19e9('0x28')](_0x56f0ee[_0x19e9('0x25')],qs[_0x19e9('0x2a')](_0x34cc09[_0x19e9('0x26')][_0x19e9('0x2a')]));_0x383ae9[_0x19e9('0x29')]=_0x383ae9[_0x19e9('0x29')][_0x19e9('0x2b')]?_0x383ae9[_0x19e9('0x29')]:_0x56f0ee[_0x19e9('0x25')];if(!_0x34cc09[_0x19e9('0x26')]['hasOwnProperty']('nolimit')){_0x383ae9[_0x19e9('0x11')]=qs[_0x19e9('0x11')](_0x34cc09['query']['limit']);_0x383ae9[_0x19e9('0xe')]=qs['offset'](_0x34cc09['query'][_0x19e9('0xe')]);}_0x383ae9[_0x19e9('0x2c')]=qs[_0x19e9('0x2d')](_0x34cc09[_0x19e9('0x26')][_0x19e9('0x2d')]);_0x383ae9['where']=qs[_0x19e9('0x27')](_[_0x19e9('0x2e')](_0x34cc09[_0x19e9('0x26')],_0x56f0ee[_0x19e9('0x27')]),_0x1c5f53);if(_0x34cc09[_0x19e9('0x26')][_0x19e9('0x2f')]){_0x383ae9[_0x19e9('0x30')]=_[_0x19e9('0x31')](_0x383ae9[_0x19e9('0x30')],{'$or':_[_0x19e9('0x21')](_0x1c5f53,function(_0x187f2a){if(_0x187f2a['type']!==_0x19e9('0x32')){var _0x436bf7={};_0x436bf7[_0x187f2a[_0x19e9('0x19')]]={'$like':'%'+_0x34cc09['query'][_0x19e9('0x2f')]+'%'};return _0x436bf7;}})});}_0x383ae9=_['merge']({},_0x383ae9,_0x34cc09[_0x19e9('0x33')]);var _0x53e3fd={'where':_0x383ae9['where']};return db['SquareProject'][_0x19e9('0x10')](_0x53e3fd)['then'](function(_0xf1c398){_0xe96572['count']=_0xf1c398;if(_0x34cc09['query']['includeAll']){_0x383ae9[_0x19e9('0x34')]=[{'all':!![]}];}return db['SquareProject'][_0x19e9('0x35')](_0x383ae9);})['then'](function(_0x54cb77){_0xe96572[_0x19e9('0x36')]=_0x54cb77;return _0xe96572;})[_0x19e9('0x13')](respondWithFilteredResult(_0xcfa964,_0x383ae9))[_0x19e9('0x37')](handleError(_0xcfa964,null));};exports[_0x19e9('0x38')]=function(_0x4a4fd4,_0x958bcc){var _0x455735={'raw':![],'where':{'id':_0x4a4fd4[_0x19e9('0x39')]['id']}},_0x231914={};_0x231914[_0x19e9('0x25')]=_['keys'](db['SquareProject'][_0x19e9('0x22')]);_0x231914[_0x19e9('0x26')]=_[_0x19e9('0x3a')](_0x4a4fd4[_0x19e9('0x26')]);_0x231914['filters']=_[_0x19e9('0x28')](_0x231914[_0x19e9('0x25')],_0x231914[_0x19e9('0x26')]);_0x455735[_0x19e9('0x29')]=_[_0x19e9('0x28')](_0x231914[_0x19e9('0x25')],qs[_0x19e9('0x2a')](_0x4a4fd4[_0x19e9('0x26')][_0x19e9('0x2a')]));_0x455735['attributes']=_0x455735['attributes'][_0x19e9('0x2b')]?_0x455735['attributes']:_0x231914[_0x19e9('0x25')];if(_0x4a4fd4[_0x19e9('0x26')]['includeAll']){_0x455735[_0x19e9('0x34')]=[{'all':!![]}];}_0x455735=_[_0x19e9('0x31')]({},_0x455735,_0x4a4fd4[_0x19e9('0x33')]);return db['SquareProject'][_0x19e9('0x3b')](_0x455735)[_0x19e9('0x13')](handleEntityNotFound(_0x958bcc,null))['then'](respondWithResult(_0x958bcc,null))['catch'](handleError(_0x958bcc,null));};exports['create']=function(_0x231658,_0x584e24){return db[_0x19e9('0x3c')][_0x19e9('0x3d')](_0x231658['body'],{})[_0x19e9('0x13')](function(_0x17910d){var _0x504b5d=_0x231658[_0x19e9('0x3e')][_0x19e9('0x15')]({'plain':!![]});if(!_0x504b5d)throw new Error(_0x19e9('0x3f'));if(_0x504b5d[_0x19e9('0x40')]===_0x19e9('0x3e')){var _0x33b070=_0x17910d[_0x19e9('0x15')]({'plain':!![]});var _0x3cbdb6='SquareProjects';return db[_0x19e9('0x41')][_0x19e9('0x3b')]({'where':{'name':_0x3cbdb6,'userProfileId':_0x504b5d[_0x19e9('0x42')]},'raw':!![]})['then'](function(_0x1beab5){if(_0x1beab5&&_0x1beab5['autoAssociation']===0x0){return db[_0x19e9('0x43')]['create']({'name':_0x33b070[_0x19e9('0x19')],'resourceId':_0x33b070['id'],'type':_0x1beab5['name'],'sectionId':_0x1beab5['id']},{})['then'](function(){return _0x17910d;});}else{return _0x17910d;}})[_0x19e9('0x37')](function(_0x57a495){logger[_0x19e9('0x44')](_0x19e9('0x45'),_0x57a495);throw _0x57a495;});}return _0x17910d;})['then'](respondWithResult(_0x584e24,0xc9))['catch'](handleError(_0x584e24,null));};exports[_0x19e9('0x12')]=function(_0x418695,_0x3130e5){if(_0x418695[_0x19e9('0x46')]['id']){delete _0x418695[_0x19e9('0x46')]['id'];}return db[_0x19e9('0x3c')][_0x19e9('0x3b')]({'where':{'id':_0x418695[_0x19e9('0x39')]['id']}})[_0x19e9('0x13')](handleEntityNotFound(_0x3130e5,null))[_0x19e9('0x13')](saveUpdates(_0x418695[_0x19e9('0x46')],null))[_0x19e9('0x13')](function(_0x47ef0d){if(!_0x47ef0d)return;var _0x7dc718=_0x47ef0d['get']({'plain':!![]});return[createAgiSocket(),_0x7dc718];})[_0x19e9('0x47')](function(_0x54da47,_0x2b5382){_0x54da47[_0x19e9('0xb')](JSON[_0x19e9('0x17')](_[_0x19e9('0x2e')](_0x2b5382,['id',_0x19e9('0x19'),'production'])));return _0x2b5382;})[_0x19e9('0x13')](respondWithResult(_0x3130e5,null))['catch'](handleError(_0x3130e5,null));};exports['destroy']=function(_0x5d09cb,_0x363a25){return db['SquareProject']['find']({'where':{'id':_0x5d09cb[_0x19e9('0x39')]['id']}})[_0x19e9('0x13')](handleEntityNotFound(_0x363a25,null))[_0x19e9('0x13')](removeEntity(_0x363a25,null))[_0x19e9('0x37')](handleError(_0x363a25,null));};exports[_0x19e9('0x48')]=function(_0x4b2bf0,_0x528688){return db[_0x19e9('0x3c')]['find']({'where':{'id':_0x4b2bf0[_0x19e9('0x39')]['id']}})[_0x19e9('0x13')](handleEntityNotFound(_0x528688,null))[_0x19e9('0x13')](function(_0x19e100){if(_0x19e100){return _0x19e100['addUsers'](_0x4b2bf0[_0x19e9('0x46')][_0x19e9('0x49')],_[_0x19e9('0x4a')](_0x4b2bf0[_0x19e9('0x46')],[_0x19e9('0x49'),'id'])||{});}})['then'](respondWithResult(_0x528688,null))[_0x19e9('0x37')](handleError(_0x528688,null));};exports[_0x19e9('0x4b')]=function(_0x448da5,_0x4b7bcd){return db['SquareProject'][_0x19e9('0x3b')]({'where':{'id':_0x448da5['params']['id']}})[_0x19e9('0x13')](handleEntityNotFound(_0x4b7bcd,null))[_0x19e9('0x13')](function(_0x358f70){if(_0x358f70){return _0x358f70[_0x19e9('0x4b')](_0x448da5[_0x19e9('0x26')][_0x19e9('0x49')])[_0x19e9('0x13')](function(){if(_['isArray'](_0x448da5[_0x19e9('0x26')][_0x19e9('0x49')])){for(var _0x31839a=0x0;_0x31839a<_0x448da5['query'][_0x19e9('0x49')][_0x19e9('0x2b')];_0x31839a+=0x1){socket[_0x19e9('0x4c')]('userSquareProject:remove',{'UserId':Number(_0x448da5['query'][_0x19e9('0x49')][_0x31839a]),'SquareProjectId':Number(_0x448da5[_0x19e9('0x39')]['id'])});}}else{socket[_0x19e9('0x4c')]('userSquareProject:remove',{'UserId':Number(_0x448da5[_0x19e9('0x26')]['ids']),'SquareProjectId':Number(_0x448da5[_0x19e9('0x39')]['id'])});}});}})[_0x19e9('0x13')](respondWithStatusCode(_0x4b7bcd,null))[_0x19e9('0x37')](handleError(_0x4b7bcd,null));};exports[_0x19e9('0x4d')]=function(_0x1c03e8,_0x324d91){var _0xaa5102={};var _0x1c1e1b={};var _0x3ed657;var _0x490973;return db[_0x19e9('0x3c')][_0x19e9('0x4e')]({'where':{'id':_0x1c03e8[_0x19e9('0x39')]['id']}})['then'](handleEntityNotFound(_0x324d91,null))[_0x19e9('0x13')](function(_0x368295){if(_0x368295){_0x3ed657=_0x368295;_0x1c1e1b['model']=_[_0x19e9('0x3a')](db[_0x19e9('0x4f')][_0x19e9('0x22')]);_0x1c1e1b[_0x19e9('0x26')]=_['keys'](_0x1c03e8['query']);_0x1c1e1b[_0x19e9('0x27')]=_[_0x19e9('0x28')](_0x1c1e1b['model'],_0x1c1e1b['query']);_0xaa5102[_0x19e9('0x29')]=_['intersection'](_0x1c1e1b['model'],qs[_0x19e9('0x2a')](_0x1c03e8['query'][_0x19e9('0x2a')]));_0xaa5102[_0x19e9('0x29')]=_0xaa5102[_0x19e9('0x29')][_0x19e9('0x2b')]?_0xaa5102[_0x19e9('0x29')]:_0x1c1e1b[_0x19e9('0x25')];_0xaa5102['order']=qs[_0x19e9('0x2d')](_0x1c03e8[_0x19e9('0x26')][_0x19e9('0x2d')]);_0xaa5102[_0x19e9('0x30')]=qs[_0x19e9('0x27')](_[_0x19e9('0x2e')](_0x1c03e8['query'],_0x1c1e1b[_0x19e9('0x27')]));if(_0x1c03e8[_0x19e9('0x26')]['filter']){_0xaa5102[_0x19e9('0x30')]=_['merge'](_0xaa5102['where'],{'$or':_[_0x19e9('0x21')](_0xaa5102[_0x19e9('0x29')],function(_0x4df83f){var _0x1e8415={};_0x1e8415[_0x4df83f]={'$like':'%'+_0x1c03e8[_0x19e9('0x26')][_0x19e9('0x2f')]+'%'};return _0x1e8415;})});}_0xaa5102=_['merge']({},_0xaa5102,_0x1c03e8[_0x19e9('0x33')]);return _0x3ed657['getUsers'](_0xaa5102);}})[_0x19e9('0x13')](function(_0x5c0e34){if(_0x5c0e34){_0x490973=_0x5c0e34[_0x19e9('0x2b')];if(!_0x1c03e8[_0x19e9('0x26')][_0x19e9('0x50')](_0x19e9('0x51'))){_0xaa5102[_0x19e9('0x11')]=qs[_0x19e9('0x11')](_0x1c03e8['query'][_0x19e9('0x11')]);_0xaa5102[_0x19e9('0xe')]=qs[_0x19e9('0xe')](_0x1c03e8[_0x19e9('0x26')][_0x19e9('0xe')]);}return _0x3ed657[_0x19e9('0x4d')](_0xaa5102);}})[_0x19e9('0x13')](function(_0xea811f){if(_0xea811f){return _0xea811f?{'count':_0x490973,'rows':_0xea811f}:null;}})[_0x19e9('0x13')](respondWithResult(_0x324d91,null))['catch'](handleError(_0x324d91,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 0a3a74d..cf4aeff 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 _0x065f=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject'];(function(_0x21a340,_0x2800fc){var _0x29e222=function(_0x2ac8d1){while(--_0x2ac8d1){_0x21a340['push'](_0x21a340['shift']());}};_0x29e222(++_0x2800fc);}(_0x065f,0x15b));var _0xf065=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x065f[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0xf065('0x0'));var SquareProject=require(_0xf065('0x1'))['db'][_0xf065('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xf065('0x3')](0x0);var events={'afterCreate':_0xf065('0x4'),'afterUpdate':_0xf065('0x5'),'afterDestroy':'remove'};function emitEvent(_0x445c21){return function(_0x344a06,_0x1208aa,_0x59f864){SquareProjectEvents[_0xf065('0x6')](_0x445c21+':'+_0x344a06['id'],_0x344a06);SquareProjectEvents[_0xf065('0x6')](_0x445c21,_0x344a06);_0x59f864(null);};}for(var e in events){if(events[_0xf065('0x7')](e)){var event=events[e];SquareProject[_0xf065('0x8')](e,emitEvent(event));}}module[_0xf065('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0x32eb=['../../mysqldb','SquareProject','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x42532b,_0x4672ab){var _0x1e8ecb=function(_0x2bb506){while(--_0x2bb506){_0x42532b['push'](_0x42532b['shift']());}};_0x1e8ecb(++_0x4672ab);}(_0x32eb,0xc7));var _0xb32e=function(_0x19159d,_0x3d05c8){_0x19159d=_0x19159d-0x0;var _0x35884a=_0x32eb[_0x19159d];return _0x35884a;};'use strict';var EventEmitter=require(_0xb32e('0x0'));var SquareProject=require(_0xb32e('0x1'))['db'][_0xb32e('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb32e('0x3'),'afterUpdate':_0xb32e('0x4'),'afterDestroy':_0xb32e('0x5')};function emitEvent(_0x13c5c2){return function(_0x516cb8,_0x3c46ee,_0x1a67e3){SquareProjectEvents[_0xb32e('0x6')](_0x13c5c2+':'+_0x516cb8['id'],_0x516cb8);SquareProjectEvents[_0xb32e('0x6')](_0x13c5c2,_0x516cb8);_0x1a67e3(null);};}for(var e in events){if(events[_0xb32e('0x7')](e)){var event=events[e];SquareProject[_0xb32e('0x8')](e,emitEvent(event));}}module[_0xb32e('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 0ef10fb..dd6534c 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 _0x7710=['api','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7710,0x1f1));var _0x0771=function(_0x2daf7b,_0x310791){_0x2daf7b=_0x2daf7b-0x0;var _0x4a1f8c=_0x7710[_0x2daf7b];return _0x4a1f8c;};'use strict';var _=require(_0x0771('0x0'));var util=require(_0x0771('0x1'));var logger=require(_0x0771('0x2'))(_0x0771('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0771('0x4'));var fs=require('fs');var path=require(_0x0771('0x5'));var rimraf=require(_0x0771('0x6'));var config=require(_0x0771('0x7'));var attributes=require(_0x0771('0x8'));module[_0x0771('0x9')]=function(_0xe77ed0,_0x4e217e){return _0xe77ed0[_0x0771('0xa')](_0x0771('0xb'),attributes,{'tableName':_0x0771('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x27b631,_0x119933,_0x1cce0c){if(_0x27b631[_0x0771('0xd')](_0x0771('0xe'))){_0x27b631[_0x0771('0xf')]=moment()[_0x0771('0x10')](_0x0771('0x11'));}if(_0x27b631[_0x0771('0xd')](_0x0771('0x12'))){_0x27b631[_0x0771('0x13')]=moment()[_0x0771('0x10')](_0x0771('0x11'));}_0x1cce0c(null,_0x27b631);}}});}; \ No newline at end of file +var _0x19ef=['preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','api','moment','request-promise','path','rimraf','exports','define','SquareProject','square_projects','changed'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x19ef,0xd5));var _0xf19e=function(_0x5cee2c,_0xce0660){_0x5cee2c=_0x5cee2c-0x0;var _0x4b27a9=_0x19ef[_0x5cee2c];return _0x4b27a9;};'use strict';var _=require('lodash');var util=require(_0xf19e('0x0'));var logger=require('../../config/logger')(_0xf19e('0x1'));var moment=require(_0xf19e('0x2'));var BPromise=require('bluebird');var rp=require(_0xf19e('0x3'));var fs=require('fs');var path=require(_0xf19e('0x4'));var rimraf=require(_0xf19e('0x5'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0xf19e('0x6')]=function(_0x1ec877,_0x3b3ed3){return _0x1ec877[_0xf19e('0x7')](_0xf19e('0x8'),attributes,{'tableName':_0xf19e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33640f,_0x463061,_0x1e668d){if(_0x33640f[_0xf19e('0xa')](_0xf19e('0xb'))){_0x33640f['savedAt']=moment()[_0xf19e('0xc')](_0xf19e('0xd'));}if(_0x33640f['changed'](_0xf19e('0xe'))){_0x33640f[_0xf19e('0xf')]=moment()['format'](_0xf19e('0xd'));}_0x1e668d(null,_0x33640f);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index a058f59..b6466d7 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 _0xf856=['SquareProject','find','info','debug','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','./squareProject.socket','register','options','raw','attributes','limit','include','model','map','then','GetSquareProjects','stringify','catch','error','message','ShowSquareProject'];(function(_0x535cb8,_0x2e6aa7){var _0x3ce9d9=function(_0x315ac9){while(--_0x315ac9){_0x535cb8['push'](_0x535cb8['shift']());}};_0x3ce9d9(++_0x2e6aa7);}(_0xf856,0x1b7));var _0x6f85=function(_0x9dd2e0,_0xcc6c6b){_0x9dd2e0=_0x9dd2e0-0x0;var _0x5d90d6=_0xf856[_0x9dd2e0];return _0x5d90d6;};'use strict';var _=require(_0x6f85('0x0'));var Redis=require(_0x6f85('0x1'));var db=require(_0x6f85('0x2'))['db'];var logger=require(_0x6f85('0x3'))(_0x6f85('0x4'));var config=require(_0x6f85('0x5'));config[_0x6f85('0x6')]=_[_0x6f85('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6f85('0x8'))(new Redis(config[_0x6f85('0x6')]));require(_0x6f85('0x9'))[_0x6f85('0xa')](socket);exports['GetSquareProjects']=function(_0x57a5db){var _0x25362b=this;return new Promise(function(_0x394eac,_0x482968){return db['SquareProject']['findAll']({'raw':_0x57a5db[_0x6f85('0xb')]?_0x57a5db['options'][_0x6f85('0xc')]===undefined?!![]:![]:!![],'where':_0x57a5db['options']?_0x57a5db['options']['where']||null:null,'attributes':_0x57a5db[_0x6f85('0xb')]?_0x57a5db[_0x6f85('0xb')][_0x6f85('0xd')]||null:null,'limit':_0x57a5db[_0x6f85('0xb')]?_0x57a5db['options'][_0x6f85('0xe')]||null:null,'include':_0x57a5db[_0x6f85('0xb')]?_0x57a5db[_0x6f85('0xb')][_0x6f85('0xf')]?_['map'](_0x57a5db[_0x6f85('0xb')]['include'],function(_0x5edb57){return{'model':db[_0x5edb57['model']],'as':_0x5edb57['as'],'attributes':_0x5edb57[_0x6f85('0xd')],'include':_0x5edb57[_0x6f85('0xf')]?_['map'](_0x5edb57[_0x6f85('0xf')],function(_0x5c77b1){return{'model':db[_0x5c77b1[_0x6f85('0x10')]],'as':_0x5c77b1['as'],'attributes':_0x5c77b1[_0x6f85('0xd')],'include':_0x5c77b1[_0x6f85('0xf')]?_[_0x6f85('0x11')](_0x5c77b1[_0x6f85('0xf')],function(_0x3902d7){return{'model':db[_0x3902d7[_0x6f85('0x10')]],'as':_0x3902d7['as'],'attributes':_0x3902d7['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f85('0x12')](function(_0x23495f){logger['info']('GetSquareProjects',_0x57a5db);logger['debug'](_0x6f85('0x13'),_0x57a5db,JSON[_0x6f85('0x14')](_0x23495f));_0x394eac(_0x23495f);})[_0x6f85('0x15')](function(_0x3a9577){logger[_0x6f85('0x16')](_0x6f85('0x13'),_0x3a9577[_0x6f85('0x17')],_0x57a5db);_0x482968(_0x25362b['error'](0x1f4,_0x3a9577[_0x6f85('0x17')]));});});};exports[_0x6f85('0x18')]=function(_0x3fc6ad){var _0x191576=this;return new Promise(function(_0x356b5b,_0x2a9a90){return db[_0x6f85('0x19')][_0x6f85('0x1a')]({'raw':_0x3fc6ad[_0x6f85('0xb')]?_0x3fc6ad[_0x6f85('0xb')][_0x6f85('0xc')]===undefined?!![]:![]:!![],'where':_0x3fc6ad['options']?_0x3fc6ad[_0x6f85('0xb')]['where']||null:null,'attributes':_0x3fc6ad['options']?_0x3fc6ad[_0x6f85('0xb')][_0x6f85('0xd')]||null:null,'include':_0x3fc6ad[_0x6f85('0xb')]?_0x3fc6ad[_0x6f85('0xb')][_0x6f85('0xf')]?_[_0x6f85('0x11')](_0x3fc6ad[_0x6f85('0xb')][_0x6f85('0xf')],function(_0xcc1662){return{'model':db[_0xcc1662[_0x6f85('0x10')]],'as':_0xcc1662['as'],'attributes':_0xcc1662[_0x6f85('0xd')],'include':_0xcc1662[_0x6f85('0xf')]?_[_0x6f85('0x11')](_0xcc1662[_0x6f85('0xf')],function(_0x387edc){return{'model':db[_0x387edc['model']],'as':_0x387edc['as'],'attributes':_0x387edc[_0x6f85('0xd')],'include':_0x387edc[_0x6f85('0xf')]?_[_0x6f85('0x11')](_0x387edc[_0x6f85('0xf')],function(_0x19ead3){return{'model':db[_0x19ead3[_0x6f85('0x10')]],'as':_0x19ead3['as'],'attributes':_0x19ead3[_0x6f85('0xd')]};}):[]};}):[]};}):[]:[]})[_0x6f85('0x12')](function(_0xa74878){logger[_0x6f85('0x1b')](_0x6f85('0x18'),_0x3fc6ad);logger[_0x6f85('0x1c')](_0x6f85('0x18'),_0x3fc6ad,JSON[_0x6f85('0x14')](_0xa74878));_0x356b5b(_0xa74878);})[_0x6f85('0x15')](function(_0x414066){logger[_0x6f85('0x16')](_0x6f85('0x18'),_0x414066[_0x6f85('0x17')],_0x3fc6ad);_0x2a9a90(_0x191576['error'](0x1f4,_0x414066['message']));});});}; \ No newline at end of file +var _0x037e=['socket.io-emitter','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','attributes','limit','include','map','model','info','debug','stringify','message','error','find','raw','where','then','ShowSquareProject','catch','lodash','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','localhost'];(function(_0x28b866,_0x4a699b){var _0x36b22b=function(_0x5e24ff){while(--_0x5e24ff){_0x28b866['push'](_0x28b866['shift']());}};_0x36b22b(++_0x4a699b);}(_0x037e,0xa7));var _0xe037=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x037e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe037('0x0'));var Redis=require('ioredis');var db=require(_0xe037('0x1'))['db'];var logger=require(_0xe037('0x2'))('rpc');var config=require(_0xe037('0x3'));config[_0xe037('0x4')]=_[_0xe037('0x5')](config[_0xe037('0x4')],{'host':_0xe037('0x6'),'port':0x18eb});var socket=require(_0xe037('0x7'))(new Redis(config[_0xe037('0x4')]));require(_0xe037('0x8'))['register'](socket);exports[_0xe037('0x9')]=function(_0x12fdad){var _0x45a198=this;return new Promise(function(_0x43ebee,_0x57bd6f){return db[_0xe037('0xa')][_0xe037('0xb')]({'raw':_0x12fdad[_0xe037('0xc')]?_0x12fdad['options']['raw']===undefined?!![]:![]:!![],'where':_0x12fdad[_0xe037('0xc')]?_0x12fdad[_0xe037('0xc')]['where']||null:null,'attributes':_0x12fdad['options']?_0x12fdad[_0xe037('0xc')][_0xe037('0xd')]||null:null,'limit':_0x12fdad[_0xe037('0xc')]?_0x12fdad[_0xe037('0xc')][_0xe037('0xe')]||null:null,'include':_0x12fdad[_0xe037('0xc')]?_0x12fdad[_0xe037('0xc')][_0xe037('0xf')]?_[_0xe037('0x10')](_0x12fdad[_0xe037('0xc')][_0xe037('0xf')],function(_0xedf44c){return{'model':db[_0xedf44c[_0xe037('0x11')]],'as':_0xedf44c['as'],'attributes':_0xedf44c[_0xe037('0xd')],'include':_0xedf44c[_0xe037('0xf')]?_[_0xe037('0x10')](_0xedf44c[_0xe037('0xf')],function(_0x4ed410){return{'model':db[_0x4ed410[_0xe037('0x11')]],'as':_0x4ed410['as'],'attributes':_0x4ed410[_0xe037('0xd')],'include':_0x4ed410[_0xe037('0xf')]?_['map'](_0x4ed410[_0xe037('0xf')],function(_0x48d607){return{'model':db[_0x48d607[_0xe037('0x11')]],'as':_0x48d607['as'],'attributes':_0x48d607[_0xe037('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xad7b11){logger[_0xe037('0x12')](_0xe037('0x9'),_0x12fdad);logger[_0xe037('0x13')](_0xe037('0x9'),_0x12fdad,JSON[_0xe037('0x14')](_0xad7b11));_0x43ebee(_0xad7b11);})['catch'](function(_0x2a7085){logger['error']('GetSquareProjects',_0x2a7085[_0xe037('0x15')],_0x12fdad);_0x57bd6f(_0x45a198[_0xe037('0x16')](0x1f4,_0x2a7085['message']));});});};exports['ShowSquareProject']=function(_0xbe9417){var _0x2ce98b=this;return new Promise(function(_0x3bd008,_0x3c856c){return db[_0xe037('0xa')][_0xe037('0x17')]({'raw':_0xbe9417['options']?_0xbe9417['options'][_0xe037('0x18')]===undefined?!![]:![]:!![],'where':_0xbe9417[_0xe037('0xc')]?_0xbe9417['options'][_0xe037('0x19')]||null:null,'attributes':_0xbe9417[_0xe037('0xc')]?_0xbe9417[_0xe037('0xc')]['attributes']||null:null,'include':_0xbe9417['options']?_0xbe9417[_0xe037('0xc')][_0xe037('0xf')]?_['map'](_0xbe9417[_0xe037('0xc')][_0xe037('0xf')],function(_0x329b80){return{'model':db[_0x329b80['model']],'as':_0x329b80['as'],'attributes':_0x329b80[_0xe037('0xd')],'include':_0x329b80[_0xe037('0xf')]?_[_0xe037('0x10')](_0x329b80['include'],function(_0x2cf9d0){return{'model':db[_0x2cf9d0[_0xe037('0x11')]],'as':_0x2cf9d0['as'],'attributes':_0x2cf9d0[_0xe037('0xd')],'include':_0x2cf9d0[_0xe037('0xf')]?_[_0xe037('0x10')](_0x2cf9d0[_0xe037('0xf')],function(_0xe3dd59){return{'model':db[_0xe3dd59[_0xe037('0x11')]],'as':_0xe3dd59['as'],'attributes':_0xe3dd59['attributes']};}):[]};}):[]};}):[]:[]})[_0xe037('0x1a')](function(_0x30125f){logger[_0xe037('0x12')](_0xe037('0x1b'),_0xbe9417);logger[_0xe037('0x13')](_0xe037('0x1b'),_0xbe9417,JSON[_0xe037('0x14')](_0x30125f));_0x3bd008(_0x30125f);})[_0xe037('0x1c')](function(_0x5e45ea){logger[_0xe037('0x16')](_0xe037('0x1b'),_0x5e45ea['message'],_0xbe9417);_0x3c856c(_0x2ce98b[_0xe037('0x16')](0x1f4,_0x5e45ea[_0xe037('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index f75b365..ac991f6 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 _0xdf29=['save','update','emit','removeListener','register','length','./squareProject.events'];(function(_0x1468bc,_0x2317a5){var _0x342420=function(_0x2622f1){while(--_0x2622f1){_0x1468bc['push'](_0x1468bc['shift']());}};_0x342420(++_0x2317a5);}(_0xdf29,0xc3));var _0x9df2=function(_0x5bfdd0,_0x21162f){_0x5bfdd0=_0x5bfdd0-0x0;var _0x100c0a=_0xdf29[_0x5bfdd0];return _0x100c0a;};'use strict';var SquareProjectEvents=require(_0x9df2('0x0'));var events=[_0x9df2('0x1'),'remove',_0x9df2('0x2')];function createListener(_0x2af8cf,_0x1d837b){return function(_0x4ac72e){_0x1d837b[_0x9df2('0x3')](_0x2af8cf,_0x4ac72e);};}function removeListener(_0x1ed129,_0x320add){return function(){SquareProjectEvents[_0x9df2('0x4')](_0x1ed129,_0x320add);};}exports[_0x9df2('0x5')]=function(_0x3bad3c){for(var _0x23c435=0x0,_0x584a8e=events[_0x9df2('0x6')];_0x23c435<_0x584a8e;_0x23c435++){var _0x1575db=events[_0x23c435];var _0x873ce4=createListener('squareProject:'+_0x1575db,_0x3bad3c);SquareProjectEvents['on'](_0x1575db,_0x873ce4);}}; \ No newline at end of file +var _0xd1b8=['save','remove','update','emit','removeListener','register','squareProject:'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0xd1b8,0x196));var _0x8d1b=function(_0x3e8cae,_0x4cb96a){_0x3e8cae=_0x3e8cae-0x0;var _0x45c4d6=_0xd1b8[_0x3e8cae];return _0x45c4d6;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x8d1b('0x0'),_0x8d1b('0x1'),_0x8d1b('0x2')];function createListener(_0x336401,_0x1c7905){return function(_0xabd4){_0x1c7905[_0x8d1b('0x3')](_0x336401,_0xabd4);};}function removeListener(_0x1f71e8,_0x18dd35){return function(){SquareProjectEvents[_0x8d1b('0x4')](_0x1f71e8,_0x18dd35);};}exports[_0x8d1b('0x5')]=function(_0xe446c2){for(var _0x23737d=0x0,_0x2f8ede=events['length'];_0x23737d<_0x2f8ede;_0x23737d++){var _0x3253ee=events[_0x23737d];var _0x56e2fd=createListener(_0x8d1b('0x6')+_0x3253ee,_0xe446c2);SquareProjectEvents['on'](_0x3253ee,_0x56e2fd);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index e60402e..e07be0c 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x4fb6e4,_0x4cf1c0){var _0x4517b8=function(_0xdd6851){while(--_0xdd6851){_0x4fb6e4['push'](_0x4fb6e4['shift']());}};_0x4517b8(++_0x4cf1c0);}(_0x326f,0xd1));var _0xf326=function(_0xb9c05a,_0x565124){_0xb9c05a=_0xb9c05a-0x0;var _0x4d1cbb=_0x326f[_0xb9c05a];return _0x4d1cbb;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x3289de,_0x574a31){var _0x4658de=function(_0x34b175){while(--_0x34b175){_0x3289de['push'](_0x3289de['shift']());}};_0x4658de(++_0x574a31);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5924ee,_0x2402ed){_0x5924ee=_0x5924ee-0x0;var _0x5dfb4f=_0x1cb9[_0x5924ee];return _0x5dfb4f;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 3df2a12..e86cfa9 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 _0x2eb2=['substring','lastIndexOf','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x2eb2,0x19f));var _0x22eb=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x2eb2[_0x266618];return _0x54dbf5;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'uniqueid':{'type':Sequelize[_0x22eb('0x1')]},'callerid':{'type':Sequelize[_0x22eb('0x1')]},'calleridname':{'type':Sequelize[_0x22eb('0x1')]},'context':{'type':Sequelize[_0x22eb('0x1')]},'extension':{'type':Sequelize[_0x22eb('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x22eb('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x22eb('0x1')]},'filename':{'type':Sequelize[_0x22eb('0x1')]},'savePath':{'type':Sequelize[_0x22eb('0x1')]},'format':{'type':Sequelize[_0x22eb('0x2')],'get':function(){var _0x4539d0='';var _0x396806=this[_0x22eb('0x3')](_0x22eb('0x4'));if(_0x396806){_0x4539d0=_0x396806[_0x22eb('0x5')](_0x396806[_0x22eb('0x6')]('.'));}return _0x4539d0;}}}; \ No newline at end of file +var _0xb138=['getDataValue','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x590efe,_0x1ff842){var _0x5300f1=function(_0x419d58){while(--_0x419d58){_0x590efe['push'](_0x590efe['shift']());}};_0x5300f1(++_0x1ff842);}(_0xb138,0x1dd));var _0x8b13=function(_0x431171,_0x4e3ac2){_0x431171=_0x431171-0x0;var _0x54aeac=_0xb138[_0x431171];return _0x54aeac;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'uniqueid':{'type':Sequelize[_0x8b13('0x2')]},'callerid':{'type':Sequelize[_0x8b13('0x2')]},'calleridname':{'type':Sequelize[_0x8b13('0x2')]},'context':{'type':Sequelize[_0x8b13('0x2')]},'extension':{'type':Sequelize[_0x8b13('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8b13('0x2')]},'dnid':{'type':Sequelize[_0x8b13('0x2')]},'projectName':{'type':Sequelize[_0x8b13('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x8b13('0x2')]},'savePath':{'type':Sequelize[_0x8b13('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x3fdf4d='';var _0x33d1a7=this[_0x8b13('0x3')]('savePath');if(_0x33d1a7){_0x3fdf4d=_0x33d1a7[_0x8b13('0x4')](_0x33d1a7[_0x8b13('0x5')]('.'));}return _0x3fdf4d;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 3213115..ff925e0 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 _0x6bc0=['rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','body','download','../../components/encryptor','type','uniqueid','savePath','%s.cypher','existsSync','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','SquareRecording'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x6bc0,0xf8));var _0x06bc=function(_0x25283e,_0x371e47){_0x25283e=_0x25283e-0x0;var _0x5ac25b=_0x6bc0[_0x25283e];return _0x5ac25b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x06bc('0x0'));var jsonpatch=require(_0x06bc('0x1'));var rp=require(_0x06bc('0x2'));var moment=require(_0x06bc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x06bc('0x4'));var util=require(_0x06bc('0x5'));var path=require(_0x06bc('0x6'));var sox=require(_0x06bc('0x7'));var csv=require(_0x06bc('0x8'));var ejs=require(_0x06bc('0x9'));var fs=require('fs');var fs_extra=require(_0x06bc('0xa'));var _=require('lodash');var squel=require(_0x06bc('0xb'));var crypto=require('crypto');var jsforce=require(_0x06bc('0xc'));var deskjs=require(_0x06bc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x06bc('0xe'));var Papa=require(_0x06bc('0xf'));var Redis=require('ioredis');var authService=require(_0x06bc('0x10'));var qs=require(_0x06bc('0x11'));var as=require(_0x06bc('0x12'));var hardwareService=require(_0x06bc('0x13'));var logger=require(_0x06bc('0x14'))(_0x06bc('0x15'));var utils=require(_0x06bc('0x16'));var config=require(_0x06bc('0x17'));var licenseUtil=require(_0x06bc('0x18'));var db=require(_0x06bc('0x19'))['db'];function respondWithStatusCode(_0x2d3004,_0x9ddd95){_0x9ddd95=_0x9ddd95||0xcc;return function(_0x46b863){if(_0x46b863){return _0x2d3004[_0x06bc('0x1a')](_0x9ddd95);}return _0x2d3004['status'](_0x9ddd95)['end']();};}function respondWithResult(_0x1b7385,_0x860899){_0x860899=_0x860899||0xc8;return function(_0x2779a4){if(_0x2779a4){return _0x1b7385[_0x06bc('0x1b')](_0x860899)[_0x06bc('0x1c')](_0x2779a4);}};}function respondWithFilteredResult(_0x850f61,_0x4f55bb){return function(_0x387841){if(_0x387841){var _0x17ff53=typeof _0x4f55bb[_0x06bc('0x1d')]===_0x06bc('0x1e')&&typeof _0x4f55bb[_0x06bc('0x1f')]===_0x06bc('0x1e');var _0x5b2127=_0x387841['count'];var _0x2fa8ed=_0x17ff53?0x0:_0x4f55bb[_0x06bc('0x1d')];var _0x47013b=_0x17ff53?_0x387841[_0x06bc('0x20')]:_0x4f55bb[_0x06bc('0x1d')]+_0x4f55bb[_0x06bc('0x1f')];var _0x111bca;if(_0x47013b>=_0x5b2127){_0x47013b=_0x5b2127;_0x111bca=0xc8;}else{_0x111bca=0xce;}_0x850f61['status'](_0x111bca);return _0x850f61[_0x06bc('0x21')](_0x06bc('0x22'),_0x2fa8ed+'-'+_0x47013b+'/'+_0x5b2127)[_0x06bc('0x1c')](_0x387841);}return null;};}function patchUpdates(_0x495ded){return function(_0x3adecd){try{jsonpatch['apply'](_0x3adecd,_0x495ded,!![]);}catch(_0xca80bd){return BPromise[_0x06bc('0x23')](_0xca80bd);}return _0x3adecd[_0x06bc('0x24')]();};}function saveUpdates(_0x17c449,_0x4ba8c9){return function(_0x4a2bbb){if(_0x4a2bbb){return _0x4a2bbb[_0x06bc('0x25')](_0x17c449)[_0x06bc('0x26')](function(_0x8436e8){return _0x8436e8;});}return null;};}function removeEntity(_0x9f7628,_0x17bdd3){return function(_0x50e013){if(_0x50e013){return _0x50e013[_0x06bc('0x27')]()[_0x06bc('0x26')](function(){_0x9f7628[_0x06bc('0x1b')](0xcc)[_0x06bc('0x28')]();});}};}function handleEntityNotFound(_0x47cfdd,_0x59c627){return function(_0x46c486){if(!_0x46c486){_0x47cfdd[_0x06bc('0x1a')](0x194);}return _0x46c486;};}function handleError(_0x34db52,_0x5e3a4d){_0x5e3a4d=_0x5e3a4d||0x1f4;return function(_0x4aa170){logger[_0x06bc('0x29')](_0x4aa170[_0x06bc('0x2a')]);if(_0x4aa170[_0x06bc('0x2b')]){delete _0x4aa170[_0x06bc('0x2b')];}_0x34db52[_0x06bc('0x1b')](_0x5e3a4d)[_0x06bc('0x2c')](_0x4aa170);};}exports['index']=function(_0x48bf01,_0x46521e){var _0x3a3097={},_0x526af0={},_0x32b7be={'count':0x0,'rows':[]};var _0x33d6ea=_['map'](db[_0x06bc('0x2d')][_0x06bc('0x2e')],function(_0x3b5b18){return{'name':_0x3b5b18[_0x06bc('0x2f')],'type':_0x3b5b18['type'][_0x06bc('0x30')]};});_0x526af0[_0x06bc('0x31')]=_['map'](_0x33d6ea,_0x06bc('0x2b'));_0x526af0[_0x06bc('0x32')]=_['keys'](_0x48bf01[_0x06bc('0x32')]);_0x526af0[_0x06bc('0x33')]=_[_0x06bc('0x34')](_0x526af0[_0x06bc('0x31')],_0x526af0[_0x06bc('0x32')]);_0x3a3097[_0x06bc('0x35')]=_[_0x06bc('0x34')](_0x526af0[_0x06bc('0x31')],qs[_0x06bc('0x36')](_0x48bf01[_0x06bc('0x32')][_0x06bc('0x36')]));_0x3a3097[_0x06bc('0x35')]=_0x3a3097[_0x06bc('0x35')][_0x06bc('0x37')]?_0x3a3097[_0x06bc('0x35')]:_0x526af0[_0x06bc('0x31')];if(!_0x48bf01[_0x06bc('0x32')]['hasOwnProperty'](_0x06bc('0x38'))){_0x3a3097['limit']=qs[_0x06bc('0x1f')](_0x48bf01['query'][_0x06bc('0x1f')]);_0x3a3097[_0x06bc('0x1d')]=qs[_0x06bc('0x1d')](_0x48bf01['query'][_0x06bc('0x1d')]);}_0x3a3097['order']=qs[_0x06bc('0x39')](_0x48bf01[_0x06bc('0x32')]['sort']);_0x3a3097[_0x06bc('0x3a')]=qs[_0x06bc('0x33')](_[_0x06bc('0x3b')](_0x48bf01['query'],_0x526af0[_0x06bc('0x33')]),_0x33d6ea);if(_0x48bf01[_0x06bc('0x32')][_0x06bc('0x3c')]){_0x3a3097[_0x06bc('0x3a')]=_[_0x06bc('0x3d')](_0x3a3097[_0x06bc('0x3a')],{'$or':_['map'](_0x33d6ea,function(_0x4c1809){if(_0x4c1809['type']!==_0x06bc('0x3e')){var _0x4175d3={};_0x4175d3[_0x4c1809[_0x06bc('0x2b')]]={'$like':'%'+_0x48bf01[_0x06bc('0x32')][_0x06bc('0x3c')]+'%'};return _0x4175d3;}})});}_0x3a3097=_[_0x06bc('0x3d')]({},_0x3a3097,_0x48bf01[_0x06bc('0x3f')]);var _0x3d6ce4={'where':_0x3a3097[_0x06bc('0x3a')]};return db[_0x06bc('0x2d')][_0x06bc('0x20')](_0x3d6ce4)[_0x06bc('0x26')](function(_0x42367b){_0x32b7be[_0x06bc('0x20')]=_0x42367b;if(_0x48bf01[_0x06bc('0x32')][_0x06bc('0x40')]){_0x3a3097['include']=[{'all':!![]}];}return db[_0x06bc('0x2d')][_0x06bc('0x41')](_0x3a3097);})[_0x06bc('0x26')](function(_0x457bd8){_0x32b7be[_0x06bc('0x42')]=_0x457bd8;return _0x32b7be;})[_0x06bc('0x26')](respondWithFilteredResult(_0x46521e,_0x3a3097))[_0x06bc('0x43')](handleError(_0x46521e,null));};exports[_0x06bc('0x44')]=function(_0x119328,_0x2694b1){var _0x3ea10d={'raw':!![],'where':{'id':_0x119328[_0x06bc('0x45')]['id']}},_0x3280e1={};_0x3280e1[_0x06bc('0x31')]=_[_0x06bc('0x46')](db[_0x06bc('0x2d')]['rawAttributes']);_0x3280e1[_0x06bc('0x32')]=_[_0x06bc('0x46')](_0x119328[_0x06bc('0x32')]);_0x3280e1[_0x06bc('0x33')]=_[_0x06bc('0x34')](_0x3280e1[_0x06bc('0x31')],_0x3280e1[_0x06bc('0x32')]);_0x3ea10d[_0x06bc('0x35')]=_[_0x06bc('0x34')](_0x3280e1[_0x06bc('0x31')],qs['fields'](_0x119328[_0x06bc('0x32')][_0x06bc('0x36')]));_0x3ea10d['attributes']=_0x3ea10d[_0x06bc('0x35')][_0x06bc('0x37')]?_0x3ea10d[_0x06bc('0x35')]:_0x3280e1['model'];if(_0x119328[_0x06bc('0x32')]['includeAll']){_0x3ea10d[_0x06bc('0x47')]=[{'all':!![]}];}_0x3ea10d=_['merge']({},_0x3ea10d,_0x119328[_0x06bc('0x3f')]);return db[_0x06bc('0x2d')][_0x06bc('0x48')](_0x3ea10d)[_0x06bc('0x26')](handleEntityNotFound(_0x2694b1,null))[_0x06bc('0x26')](respondWithResult(_0x2694b1,null))[_0x06bc('0x43')](handleError(_0x2694b1,null));};exports['create']=function(_0x2341af,_0x46ea5a){return db[_0x06bc('0x2d')]['create'](_0x2341af[_0x06bc('0x49')],{})[_0x06bc('0x26')](respondWithResult(_0x46ea5a,0xc9))[_0x06bc('0x43')](handleError(_0x46ea5a,null));};exports['update']=function(_0x20d3e1,_0x3f9f0d){if(_0x20d3e1[_0x06bc('0x49')]['id']){delete _0x20d3e1[_0x06bc('0x49')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x20d3e1[_0x06bc('0x45')]['id']}})[_0x06bc('0x26')](handleEntityNotFound(_0x3f9f0d,null))['then'](saveUpdates(_0x20d3e1['body'],null))[_0x06bc('0x26')](respondWithResult(_0x3f9f0d,null))['catch'](handleError(_0x3f9f0d,null));};exports[_0x06bc('0x4a')]=function(_0x540f05,_0x7494b1,_0x48fd52){var _0xddb6d1=require(_0x06bc('0x4b'));var _0x25ec8c=![];var _0xbf932={};if(_0x540f05[_0x06bc('0x32')][_0x06bc('0x4c')]&&_0x540f05['query'][_0x06bc('0x4c')]===_0x06bc('0x4d')){_0xbf932[_0x06bc('0x4d')]=_0x540f05[_0x06bc('0x45')]['id'];}else{_0xbf932['id']=_0x540f05[_0x06bc('0x45')]['id'];}return db[_0x06bc('0x2d')][_0x06bc('0x48')]({'where':_0xbf932,'attributes':['id',_0x06bc('0x4e'),'filename'],'raw':!![]})[_0x06bc('0x26')](handleEntityNotFound(_0x7494b1,null))[_0x06bc('0x26')](function(_0x49b36f){if(_0x49b36f){var _0x3cc01d=_0x49b36f[_0x06bc('0x4e')];var _0x1f7ac1=util['format'](_0x06bc('0x4f'),_0x3cc01d);if(fs[_0x06bc('0x50')](_0x1f7ac1)){_0x25ec8c=!![];return _0xddb6d1['decryptFile'](_0x1f7ac1,_0x3cc01d,config['secrets'][_0x06bc('0x51')])[_0x06bc('0x26')](function(){return _0x49b36f;});}return _0x49b36f;}})[_0x06bc('0x26')](function(_0x38f344){if(_0x38f344){var _0x57b67b=_0x38f344[_0x06bc('0x4e')];if(!fs['existsSync'](_0x57b67b)){throw new db[(_0x06bc('0x52'))][(_0x06bc('0x53'))](_0x06bc('0x54'));}if(_0x38f344[_0x06bc('0x55')]){return _0x7494b1[_0x06bc('0x4a')](_0x57b67b,_0x38f344[_0x06bc('0x55')]+path[_0x06bc('0x56')](_0x57b67b),function(){if(_0x25ec8c){fs[_0x06bc('0x57')](_0x57b67b);}});}else{return _0x7494b1[_0x06bc('0x4a')](_0x57b67b,function(_0x469ced){if(_0x25ec8c){fs[_0x06bc('0x57')](_0x57b67b);}});}}})[_0x06bc('0x43')](function(_0x2bffa5){if(_0x2bffa5[_0x06bc('0x58')]===_0x06bc('0x54')){_0x7494b1['status'](0x194)[_0x06bc('0x2c')](_0x06bc('0x59'));}else{return handleError(_0x7494b1,null);}});};exports[_0x06bc('0x27')]=function(_0x4b3034,_0x5dd39f){return db['SquareRecording'][_0x06bc('0x48')]({'where':{'id':_0x4b3034[_0x06bc('0x45')]['id']}})[_0x06bc('0x26')](function(_0x3d712d){if(_['isNil'](_0x3d712d)){throw new ReferenceError(_0x06bc('0x5a'));}return _0x3d712d;})['then'](function(_0x32abe8){var _0x4ce84b=_0x32abe8['savePath'];logger['info'](_0x06bc('0x5b'),_0x4ce84b);if(!_[_0x06bc('0x5c')](_0x32abe8[_0x06bc('0x4e')])&&fs[_0x06bc('0x50')](_0x4ce84b)){logger[_0x06bc('0x5d')](_0x06bc('0x5e')+_0x4ce84b+_0x06bc('0x5f'));fs[_0x06bc('0x60')](_0x4ce84b);}_0x4ce84b=_0x4ce84b+_0x06bc('0x61');if(!_['isNil'](_0x32abe8[_0x06bc('0x4e')])&&fs[_0x06bc('0x50')](_0x4ce84b)){logger[_0x06bc('0x5d')](_0x06bc('0x5e')+_0x4ce84b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x4ce84b);}return _0x32abe8;})[_0x06bc('0x26')](function(_0x21cd1c){if(!_0x21cd1c)throw new InternalError();return _0x21cd1c[_0x06bc('0x27')]();})[_0x06bc('0x26')](function(){_0x5dd39f[_0x06bc('0x1b')](0xcc)[_0x06bc('0x28')]();})[_0x06bc('0x43')](handleError(_0x5dd39f,null));}; \ No newline at end of file +var _0xf58e=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','end','sendStatus','error','name','send','map','SquareRecording','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','findAll','rows','show','params','include','find','create','body','catch','download','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x558d1e,_0x122fcd){var _0x2139c9=function(_0x242652){while(--_0x242652){_0x558d1e['push'](_0x558d1e['shift']());}};_0x2139c9(++_0x122fcd);}(_0xf58e,0xa8));var _0xef58=function(_0x25fa5d,_0x5c4e9b){_0x25fa5d=_0x25fa5d-0x0;var _0x516f20=_0xf58e[_0x25fa5d];return _0x516f20;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xef58('0x0'));var jsonpatch=require(_0xef58('0x1'));var rp=require(_0xef58('0x2'));var moment=require(_0xef58('0x3'));var BPromise=require(_0xef58('0x4'));var Mustache=require(_0xef58('0x5'));var util=require('util');var path=require(_0xef58('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(_0xef58('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xef58('0x8'));var toCsv=require(_0xef58('0x9'));var querystring=require(_0xef58('0xa'));var Papa=require(_0xef58('0xb'));var Redis=require(_0xef58('0xc'));var authService=require(_0xef58('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xef58('0xe'));var hardwareService=require(_0xef58('0xf'));var logger=require(_0xef58('0x10'))(_0xef58('0x11'));var utils=require(_0xef58('0x12'));var config=require(_0xef58('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xef58('0x14'))['db'];function respondWithStatusCode(_0x210b43,_0x3dbc7c){_0x3dbc7c=_0x3dbc7c||0xcc;return function(_0x57e722){if(_0x57e722){return _0x210b43['sendStatus'](_0x3dbc7c);}return _0x210b43['status'](_0x3dbc7c)['end']();};}function respondWithResult(_0x2689db,_0x209a32){_0x209a32=_0x209a32||0xc8;return function(_0x5623ec){if(_0x5623ec){return _0x2689db[_0xef58('0x15')](_0x209a32)[_0xef58('0x16')](_0x5623ec);}};}function respondWithFilteredResult(_0x13ee61,_0x5d5e79){return function(_0x13801a){if(_0x13801a){var _0x30072b=typeof _0x5d5e79[_0xef58('0x17')]==='undefined'&&typeof _0x5d5e79[_0xef58('0x18')]===_0xef58('0x19');var _0x61e63a=_0x13801a[_0xef58('0x1a')];var _0x5dc5eb=_0x30072b?0x0:_0x5d5e79['offset'];var _0x7e06bd=_0x30072b?_0x13801a[_0xef58('0x1a')]:_0x5d5e79[_0xef58('0x17')]+_0x5d5e79[_0xef58('0x18')];var _0x4e5ab8;if(_0x7e06bd>=_0x61e63a){_0x7e06bd=_0x61e63a;_0x4e5ab8=0xc8;}else{_0x4e5ab8=0xce;}_0x13ee61[_0xef58('0x15')](_0x4e5ab8);return _0x13ee61[_0xef58('0x1b')]('Content-Range',_0x5dc5eb+'-'+_0x7e06bd+'/'+_0x61e63a)[_0xef58('0x16')](_0x13801a);}return null;};}function patchUpdates(_0x4ea729){return function(_0x400be0){try{jsonpatch[_0xef58('0x1c')](_0x400be0,_0x4ea729,!![]);}catch(_0x474a8e){return BPromise['reject'](_0x474a8e);}return _0x400be0[_0xef58('0x1d')]();};}function saveUpdates(_0x1b8cb1,_0x3d44b9){return function(_0x554a1e){if(_0x554a1e){return _0x554a1e[_0xef58('0x1e')](_0x1b8cb1)[_0xef58('0x1f')](function(_0x361ee5){return _0x361ee5;});}return null;};}function removeEntity(_0x590c23,_0x2094bd){return function(_0x31e3c0){if(_0x31e3c0){return _0x31e3c0[_0xef58('0x20')]()[_0xef58('0x1f')](function(){_0x590c23[_0xef58('0x15')](0xcc)[_0xef58('0x21')]();});}};}function handleEntityNotFound(_0x349d54,_0x39f61f){return function(_0x41862b){if(!_0x41862b){_0x349d54[_0xef58('0x22')](0x194);}return _0x41862b;};}function handleError(_0x1a1f9d,_0x489265){_0x489265=_0x489265||0x1f4;return function(_0x5ea821){logger[_0xef58('0x23')](_0x5ea821['stack']);if(_0x5ea821[_0xef58('0x24')]){delete _0x5ea821[_0xef58('0x24')];}_0x1a1f9d[_0xef58('0x15')](_0x489265)[_0xef58('0x25')](_0x5ea821);};}exports['index']=function(_0x5e7c32,_0x5166a2){var _0x763980={},_0x360d43={},_0x1e0574={'count':0x0,'rows':[]};var _0x460e22=_[_0xef58('0x26')](db[_0xef58('0x27')][_0xef58('0x28')],function(_0x14fc0e){return{'name':_0x14fc0e['fieldName'],'type':_0x14fc0e['type'][_0xef58('0x29')]};});_0x360d43[_0xef58('0x2a')]=_[_0xef58('0x26')](_0x460e22,_0xef58('0x24'));_0x360d43['query']=_[_0xef58('0x2b')](_0x5e7c32[_0xef58('0x2c')]);_0x360d43[_0xef58('0x2d')]=_[_0xef58('0x2e')](_0x360d43[_0xef58('0x2a')],_0x360d43[_0xef58('0x2c')]);_0x763980[_0xef58('0x2f')]=_[_0xef58('0x2e')](_0x360d43[_0xef58('0x2a')],qs[_0xef58('0x30')](_0x5e7c32[_0xef58('0x2c')][_0xef58('0x30')]));_0x763980['attributes']=_0x763980[_0xef58('0x2f')][_0xef58('0x31')]?_0x763980[_0xef58('0x2f')]:_0x360d43[_0xef58('0x2a')];if(!_0x5e7c32['query'][_0xef58('0x32')](_0xef58('0x33'))){_0x763980[_0xef58('0x18')]=qs[_0xef58('0x18')](_0x5e7c32[_0xef58('0x2c')][_0xef58('0x18')]);_0x763980[_0xef58('0x17')]=qs['offset'](_0x5e7c32['query'][_0xef58('0x17')]);}_0x763980[_0xef58('0x34')]=qs[_0xef58('0x35')](_0x5e7c32[_0xef58('0x2c')][_0xef58('0x35')]);_0x763980[_0xef58('0x36')]=qs[_0xef58('0x2d')](_[_0xef58('0x37')](_0x5e7c32[_0xef58('0x2c')],_0x360d43[_0xef58('0x2d')]),_0x460e22);if(_0x5e7c32[_0xef58('0x2c')][_0xef58('0x38')]){_0x763980['where']=_[_0xef58('0x39')](_0x763980[_0xef58('0x36')],{'$or':_[_0xef58('0x26')](_0x460e22,function(_0x552321){if(_0x552321[_0xef58('0x3a')]!=='VIRTUAL'){var _0x5b375e={};_0x5b375e[_0x552321[_0xef58('0x24')]]={'$like':'%'+_0x5e7c32[_0xef58('0x2c')][_0xef58('0x38')]+'%'};return _0x5b375e;}})});}_0x763980=_['merge']({},_0x763980,_0x5e7c32[_0xef58('0x3b')]);var _0x21e3be={'where':_0x763980[_0xef58('0x36')]};return db[_0xef58('0x27')][_0xef58('0x1a')](_0x21e3be)['then'](function(_0x20ba62){_0x1e0574[_0xef58('0x1a')]=_0x20ba62;if(_0x5e7c32[_0xef58('0x2c')]['includeAll']){_0x763980['include']=[{'all':!![]}];}return db['SquareRecording'][_0xef58('0x3c')](_0x763980);})[_0xef58('0x1f')](function(_0x25662f){_0x1e0574[_0xef58('0x3d')]=_0x25662f;return _0x1e0574;})['then'](respondWithFilteredResult(_0x5166a2,_0x763980))['catch'](handleError(_0x5166a2,null));};exports[_0xef58('0x3e')]=function(_0x109add,_0x35f8cb){var _0x57303a={'raw':!![],'where':{'id':_0x109add[_0xef58('0x3f')]['id']}},_0x4b2e7f={};_0x4b2e7f[_0xef58('0x2a')]=_['keys'](db['SquareRecording'][_0xef58('0x28')]);_0x4b2e7f[_0xef58('0x2c')]=_[_0xef58('0x2b')](_0x109add[_0xef58('0x2c')]);_0x4b2e7f[_0xef58('0x2d')]=_[_0xef58('0x2e')](_0x4b2e7f[_0xef58('0x2a')],_0x4b2e7f[_0xef58('0x2c')]);_0x57303a['attributes']=_[_0xef58('0x2e')](_0x4b2e7f[_0xef58('0x2a')],qs['fields'](_0x109add[_0xef58('0x2c')][_0xef58('0x30')]));_0x57303a[_0xef58('0x2f')]=_0x57303a['attributes'][_0xef58('0x31')]?_0x57303a['attributes']:_0x4b2e7f[_0xef58('0x2a')];if(_0x109add[_0xef58('0x2c')]['includeAll']){_0x57303a[_0xef58('0x40')]=[{'all':!![]}];}_0x57303a=_['merge']({},_0x57303a,_0x109add['options']);return db[_0xef58('0x27')][_0xef58('0x41')](_0x57303a)['then'](handleEntityNotFound(_0x35f8cb,null))[_0xef58('0x1f')](respondWithResult(_0x35f8cb,null))['catch'](handleError(_0x35f8cb,null));};exports[_0xef58('0x42')]=function(_0xc62927,_0x10d950){return db[_0xef58('0x27')][_0xef58('0x42')](_0xc62927[_0xef58('0x43')],{})[_0xef58('0x1f')](respondWithResult(_0x10d950,0xc9))[_0xef58('0x44')](handleError(_0x10d950,null));};exports[_0xef58('0x1e')]=function(_0xdff167,_0x55d5d0){if(_0xdff167['body']['id']){delete _0xdff167[_0xef58('0x43')]['id'];}return db[_0xef58('0x27')][_0xef58('0x41')]({'where':{'id':_0xdff167[_0xef58('0x3f')]['id']}})['then'](handleEntityNotFound(_0x55d5d0,null))['then'](saveUpdates(_0xdff167['body'],null))['then'](respondWithResult(_0x55d5d0,null))[_0xef58('0x44')](handleError(_0x55d5d0,null));};exports[_0xef58('0x45')]=function(_0x27377b,_0x87d604,_0x4bfcaa){var _0x5f3310=require('../../components/encryptor');var _0x174307=![];var _0x15e0f8={};if(_0x27377b['query'][_0xef58('0x3a')]&&_0x27377b[_0xef58('0x2c')][_0xef58('0x3a')]===_0xef58('0x46')){_0x15e0f8['uniqueid']=_0x27377b[_0xef58('0x3f')]['id'];}else{_0x15e0f8['id']=_0x27377b[_0xef58('0x3f')]['id'];}return db[_0xef58('0x27')]['find']({'where':_0x15e0f8,'attributes':['id',_0xef58('0x47'),'filename'],'raw':!![]})[_0xef58('0x1f')](handleEntityNotFound(_0x87d604,null))[_0xef58('0x1f')](function(_0x1cc519){if(_0x1cc519){var _0xd9fcea=_0x1cc519['savePath'];var _0x181cb1=util[_0xef58('0x48')](_0xef58('0x49'),_0xd9fcea);if(fs[_0xef58('0x4a')](_0x181cb1)){_0x174307=!![];return _0x5f3310[_0xef58('0x4b')](_0x181cb1,_0xd9fcea,config[_0xef58('0x4c')][_0xef58('0x4d')])[_0xef58('0x1f')](function(){return _0x1cc519;});}return _0x1cc519;}})[_0xef58('0x1f')](function(_0x3afedc){if(_0x3afedc){var _0x1675a7=_0x3afedc[_0xef58('0x47')];if(!fs[_0xef58('0x4a')](_0x1675a7)){throw new db[(_0xef58('0x4e'))][(_0xef58('0x4f'))]('SquareRecording\x20not\x20found');}if(_0x3afedc[_0xef58('0x50')]){return _0x87d604[_0xef58('0x45')](_0x1675a7,_0x3afedc[_0xef58('0x50')]+path[_0xef58('0x51')](_0x1675a7),function(){if(_0x174307){fs[_0xef58('0x52')](_0x1675a7);}});}else{return _0x87d604[_0xef58('0x45')](_0x1675a7,function(_0x32db0d){if(_0x174307){fs[_0xef58('0x52')](_0x1675a7);}});}}})[_0xef58('0x44')](function(_0x413a17){if(_0x413a17[_0xef58('0x53')]==='SquareRecording\x20not\x20found'){_0x87d604[_0xef58('0x15')](0x194)['send'](_0xef58('0x54'));}else{return handleError(_0x87d604,null);}});};exports[_0xef58('0x20')]=function(_0x3f586f,_0x14658d){return db[_0xef58('0x27')][_0xef58('0x41')]({'where':{'id':_0x3f586f['params']['id']}})[_0xef58('0x1f')](function(_0x1f217e){if(_[_0xef58('0x55')](_0x1f217e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1f217e;})[_0xef58('0x1f')](function(_0x37af20){var _0x4f22d8=_0x37af20['savePath'];logger[_0xef58('0x56')](_0xef58('0x57'),_0x4f22d8);if(!_['isNil'](_0x37af20[_0xef58('0x47')])&&fs[_0xef58('0x4a')](_0x4f22d8)){logger[_0xef58('0x56')](_0xef58('0x58')+_0x4f22d8+_0xef58('0x59'));fs[_0xef58('0x5a')](_0x4f22d8);}_0x4f22d8=_0x4f22d8+_0xef58('0x5b');if(!_[_0xef58('0x55')](_0x37af20['savePath'])&&fs[_0xef58('0x4a')](_0x4f22d8)){logger['info'](_0xef58('0x58')+_0x4f22d8+_0xef58('0x59'));fs[_0xef58('0x5a')](_0x4f22d8);}return _0x37af20;})[_0xef58('0x1f')](function(_0x285f18){if(!_0x285f18)throw new InternalError();return _0x285f18[_0xef58('0x20')]();})[_0xef58('0x1f')](function(){_0x14658d['status'](0xcc)['end']();})['catch'](handleError(_0x14658d,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index b27ab97..7bf92a5 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 _0x077e=['./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x077e,0x14a));var _0xe077=function(_0x57028f,_0x4bfc1d){_0x57028f=_0x57028f-0x0;var _0x59279d=_0x077e[_0x57028f];return _0x59279d;};'use strict';var _=require(_0xe077('0x0'));var util=require(_0xe077('0x1'));var logger=require(_0xe077('0x2'))(_0xe077('0x3'));var moment=require('moment');var BPromise=require(_0xe077('0x4'));var rp=require(_0xe077('0x5'));var fs=require('fs');var path=require(_0xe077('0x6'));var rimraf=require('rimraf');var config=require(_0xe077('0x7'));var attributes=require(_0xe077('0x8'));module[_0xe077('0x9')]=function(_0xe4430c,_0x3a9d18){return _0xe4430c[_0xe077('0xa')](_0xe077('0xb'),attributes,{'tableName':_0xe077('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd48e=['../../config/environment','exports','SquareRecording','square_recordings','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x33240f,_0x520f5d){var _0xe5d11e=function(_0x1ed4f3){while(--_0x1ed4f3){_0x33240f['push'](_0x33240f['shift']());}};_0xe5d11e(++_0x520f5d);}(_0xd48e,0x93));var _0xed48=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xd48e[_0x11ce46];return _0x368a1e;};'use strict';var _=require('lodash');var util=require(_0xed48('0x0'));var logger=require(_0xed48('0x1'))(_0xed48('0x2'));var moment=require(_0xed48('0x3'));var BPromise=require(_0xed48('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed48('0x5'));var rimraf=require(_0xed48('0x6'));var config=require(_0xed48('0x7'));var attributes=require('./squareRecording.attributes');module[_0xed48('0x8')]=function(_0x2c937c,_0x400239){return _0x2c937c['define'](_0xed48('0x9'),attributes,{'tableName':_0xed48('0xa'),'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 181284c..eb52daf 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 _0xa321=['randomstring','../../config/logger','rpc','jayson/promise','client','http','then','info','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','code','error','SquareRecording,\x20%s,\x20%s','message','result','catch','SquareRecording','create','body','options','CreateSquareRecording','lodash','moment','bluebird'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0xa321,0x1f1));var _0x1a32=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0xa321[_0x1a89a1];return _0x3d5b46;};'use strict';var _=require(_0x1a32('0x0'));var util=require('util');var moment=require(_0x1a32('0x1'));var BPromise=require(_0x1a32('0x2'));var rs=require(_0x1a32('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1a32('0x4'))(_0x1a32('0x5'));var config=require('../../config/environment');var jayson=require(_0x1a32('0x6'));var client=jayson[_0x1a32('0x7')][_0x1a32('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d4917,_0x21a397,_0x51981e){return new BPromise(function(_0x7a0b00,_0xacf70c){return client['request'](_0x5d4917,_0x51981e)[_0x1a32('0x9')](function(_0x38f052){logger[_0x1a32('0xa')]('SquareRecording,\x20%s,\x20%s',_0x21a397,'request\x20sent');logger[_0x1a32('0xb')](_0x1a32('0xc'),_0x21a397,'request\x20sent',JSON[_0x1a32('0xd')](_0x38f052));if(_0x38f052['error']){if(_0x38f052['error'][_0x1a32('0xe')]===0x1f4){logger[_0x1a32('0xf')](_0x1a32('0x10'),_0x21a397,_0x38f052[_0x1a32('0xf')]['message']);return _0xacf70c(_0x38f052['error']['message']);}logger[_0x1a32('0xf')](_0x1a32('0x10'),_0x21a397,_0x38f052[_0x1a32('0xf')]['message']);return _0x7a0b00(_0x38f052[_0x1a32('0xf')][_0x1a32('0x11')]);}else{logger[_0x1a32('0xa')](_0x1a32('0x10'),_0x21a397,'request\x20sent');_0x7a0b00(_0x38f052[_0x1a32('0x12')]['message']);}})[_0x1a32('0x13')](function(_0x55f69a){logger[_0x1a32('0xf')](_0x1a32('0x10'),_0x21a397,_0x55f69a);_0xacf70c(_0x55f69a);});});}exports['CreateSquareRecording']=function(_0x14af22){var _0x4dc89d=this;return new Promise(function(_0x8a956f,_0x4de4a8){return db[_0x1a32('0x14')][_0x1a32('0x15')](_0x14af22[_0x1a32('0x16')],{'raw':_0x14af22[_0x1a32('0x17')]?_0x14af22[_0x1a32('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x1a32('0x9')](function(_0x281ffd){logger[_0x1a32('0xa')]('CreateSquareRecording',_0x14af22);logger[_0x1a32('0xb')](_0x1a32('0x18'),_0x14af22,JSON[_0x1a32('0xd')](_0x281ffd));_0x8a956f(_0x281ffd);})[_0x1a32('0x13')](function(_0x52155c){logger[_0x1a32('0xf')](_0x1a32('0x18'),_0x52155c[_0x1a32('0x11')],_0x14af22);_0x4de4a8(_0x4dc89d['error'](0x1f4,_0x52155c[_0x1a32('0x11')]));});});}; \ No newline at end of file +var _0xa166=['message','result','catch','SquareRecording','create','body','options','then','CreateSquareRecording','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4990c8,_0x2ef789){var _0x4eab0b=function(_0x575bf6){while(--_0x575bf6){_0x4990c8['push'](_0x4990c8['shift']());}};_0x4eab0b(++_0x2ef789);}(_0xa166,0xcd));var _0x6a16=function(_0x363593,_0x3b4415){_0x363593=_0x363593-0x0;var _0x439351=_0xa166[_0x363593];return _0x439351;};'use strict';var _=require('lodash');var util=require(_0x6a16('0x0'));var moment=require(_0x6a16('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a16('0x2'));var db=require(_0x6a16('0x3'))['db'];var utils=require(_0x6a16('0x4'));var logger=require(_0x6a16('0x5'))(_0x6a16('0x6'));var config=require(_0x6a16('0x7'));var jayson=require(_0x6a16('0x8'));var client=jayson[_0x6a16('0x9')][_0x6a16('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eedca,_0x570c74,_0x15f662){return new BPromise(function(_0x535cd4,_0x400084){return client['request'](_0x2eedca,_0x15f662)['then'](function(_0x13791c){logger[_0x6a16('0xb')](_0x6a16('0xc'),_0x570c74,'request\x20sent');logger[_0x6a16('0xd')](_0x6a16('0xe'),_0x570c74,_0x6a16('0xf'),JSON[_0x6a16('0x10')](_0x13791c));if(_0x13791c['error']){if(_0x13791c[_0x6a16('0x11')][_0x6a16('0x12')]===0x1f4){logger['error'](_0x6a16('0xc'),_0x570c74,_0x13791c[_0x6a16('0x11')][_0x6a16('0x13')]);return _0x400084(_0x13791c['error'][_0x6a16('0x13')]);}logger[_0x6a16('0x11')]('SquareRecording,\x20%s,\x20%s',_0x570c74,_0x13791c[_0x6a16('0x11')][_0x6a16('0x13')]);return _0x535cd4(_0x13791c[_0x6a16('0x11')][_0x6a16('0x13')]);}else{logger[_0x6a16('0xb')]('SquareRecording,\x20%s,\x20%s',_0x570c74,_0x6a16('0xf'));_0x535cd4(_0x13791c[_0x6a16('0x14')][_0x6a16('0x13')]);}})[_0x6a16('0x15')](function(_0x5a43e3){logger[_0x6a16('0x11')]('SquareRecording,\x20%s,\x20%s',_0x570c74,_0x5a43e3);_0x400084(_0x5a43e3);});});}exports['CreateSquareRecording']=function(_0x525a93){var _0x174574=this;return new Promise(function(_0x26ba35,_0x38af9e){return db[_0x6a16('0x16')][_0x6a16('0x17')](_0x525a93[_0x6a16('0x18')],{'raw':_0x525a93['options']?_0x525a93[_0x6a16('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x6a16('0x1a')](function(_0x48ef12){logger[_0x6a16('0xb')](_0x6a16('0x1b'),_0x525a93);logger[_0x6a16('0xd')](_0x6a16('0x1b'),_0x525a93,JSON[_0x6a16('0x10')](_0x48ef12));_0x26ba35(_0x48ef12);})[_0x6a16('0x15')](function(_0x4d8d81){logger['error'](_0x6a16('0x1b'),_0x4d8d81[_0x6a16('0x13')],_0x525a93);_0x38af9e(_0x174574[_0x6a16('0x11')](0x1f4,_0x4d8d81[_0x6a16('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 9988382..e22ee26 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x482a1c,_0xcecccf){var _0x2dab39=function(_0x314535){while(--_0x314535){_0x482a1c['push'](_0x482a1c['shift']());}};_0x2dab39(++_0xcecccf);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x24e705,_0x378e42){var _0x39eaca=function(_0x347f40){while(--_0x347f40){_0x24e705['push'](_0x24e705['shift']());}};_0x39eaca(++_0x378e42);}(_0xe706,0xa3));var _0x6e70=function(_0xfaddc9,_0x5c9ad2){_0xfaddc9=_0xfaddc9-0x0;var _0x579846=_0xe706[_0xfaddc9];return _0x579846;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index f00c84d..0e0af4a 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 _0x3418=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3418,0x6b));var _0x8341=function(_0x5c186f,_0x3f3b7b){_0x5c186f=_0x5c186f-0x0;var _0x1d0c56=_0x3418[_0x5c186f];return _0x1d0c56;};'use strict';var Sequelize=require(_0x8341('0x0'));module['exports']={'network':{'type':Sequelize[_0x8341('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8341('0x1')]},'language':{'type':Sequelize[_0x8341('0x1')]},'type':{'type':Sequelize[_0x8341('0x1')]},'uniqueid':{'type':Sequelize[_0x8341('0x1')]},'version':{'type':Sequelize[_0x8341('0x1')]},'callerid':{'type':Sequelize[_0x8341('0x1')]},'calleridname':{'type':Sequelize[_0x8341('0x1')]},'callingpres':{'type':Sequelize[_0x8341('0x1')]},'callingani2':{'type':Sequelize[_0x8341('0x1')]},'callington':{'type':Sequelize[_0x8341('0x1')]},'callingtns':{'type':Sequelize[_0x8341('0x1')]},'dnid':{'type':Sequelize[_0x8341('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8341('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8341('0x1')]},'threadid':{'type':Sequelize[_0x8341('0x1')]},'project_name':{'type':Sequelize[_0x8341('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8341('0x2')]},'bot':{'type':Sequelize[_0x8341('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xd775=['sequelize','exports','STRING','DATE'];(function(_0x4904e9,_0x92c1ca){var _0x491a61=function(_0x49d1a1){while(--_0x49d1a1){_0x4904e9['push'](_0x4904e9['shift']());}};_0x491a61(++_0x92c1ca);}(_0xd775,0x16c));var _0x5d77=function(_0x1c6f3a,_0xbd10f8){_0x1c6f3a=_0x1c6f3a-0x0;var _0x35fbe8=_0xd775[_0x1c6f3a];return _0x35fbe8;};'use strict';var Sequelize=require(_0x5d77('0x0'));module[_0x5d77('0x1')]={'network':{'type':Sequelize[_0x5d77('0x2')]},'network_script':{'type':Sequelize[_0x5d77('0x2')]},'request':{'type':Sequelize[_0x5d77('0x2')]},'channel':{'type':Sequelize[_0x5d77('0x2')]},'language':{'type':Sequelize[_0x5d77('0x2')]},'type':{'type':Sequelize[_0x5d77('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x5d77('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x5d77('0x2')]},'callington':{'type':Sequelize[_0x5d77('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x5d77('0x2')]},'rdnis':{'type':Sequelize[_0x5d77('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x5d77('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x5d77('0x2')]},'accountcode':{'type':Sequelize[_0x5d77('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x5d77('0x2')]},'joinAt':{'type':Sequelize[_0x5d77('0x3')]},'leaveAt':{'type':Sequelize[_0x5d77('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index e93ef38..fb15ef9 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 _0x93f9=['save','update','then','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','map','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','SquareReport','includeAll','include','rows','catch','show','params','keys','options','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0xe98f85,_0x2e4ce2){var _0x19f549=function(_0x341f4d){while(--_0x341f4d){_0xe98f85['push'](_0xe98f85['shift']());}};_0x19f549(++_0x2e4ce2);}(_0x93f9,0x77));var _0x993f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x93f9[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x993f('0x0'));var rimraf=require(_0x993f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x993f('0x2'));var rp=require('request-promise');var moment=require(_0x993f('0x3'));var BPromise=require(_0x993f('0x4'));var Mustache=require(_0x993f('0x5'));var util=require('util');var path=require(_0x993f('0x6'));var sox=require('sox');var csv=require(_0x993f('0x7'));var ejs=require(_0x993f('0x8'));var fs=require('fs');var fs_extra=require(_0x993f('0x9'));var _=require(_0x993f('0xa'));var squel=require(_0x993f('0xb'));var crypto=require(_0x993f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x993f('0xd'));var toCsv=require(_0x993f('0x7'));var querystring=require('querystring');var Papa=require(_0x993f('0xe'));var Redis=require(_0x993f('0xf'));var authService=require(_0x993f('0x10'));var qs=require(_0x993f('0x11'));var as=require(_0x993f('0x12'));var hardwareService=require(_0x993f('0x13'));var logger=require(_0x993f('0x14'))('api');var utils=require(_0x993f('0x15'));var config=require(_0x993f('0x16'));var licenseUtil=require(_0x993f('0x17'));var db=require(_0x993f('0x18'))['db'];function respondWithStatusCode(_0x436373,_0x33f256){_0x33f256=_0x33f256||0xcc;return function(_0x545b7){if(_0x545b7){return _0x436373['sendStatus'](_0x33f256);}return _0x436373[_0x993f('0x19')](_0x33f256)['end']();};}function respondWithResult(_0x859f91,_0x77e34){_0x77e34=_0x77e34||0xc8;return function(_0x2fd64d){if(_0x2fd64d){return _0x859f91[_0x993f('0x19')](_0x77e34)['json'](_0x2fd64d);}};}function respondWithFilteredResult(_0x42dbbf,_0x5dd26b){return function(_0x5ac616){if(_0x5ac616){var _0x3cbab3=typeof _0x5dd26b[_0x993f('0x1a')]===_0x993f('0x1b')&&typeof _0x5dd26b[_0x993f('0x1c')]===_0x993f('0x1b');var _0x4c3957=_0x5ac616[_0x993f('0x1d')];var _0x5c6f00=_0x3cbab3?0x0:_0x5dd26b[_0x993f('0x1a')];var _0x116c7d=_0x3cbab3?_0x5ac616[_0x993f('0x1d')]:_0x5dd26b[_0x993f('0x1a')]+_0x5dd26b['limit'];var _0x22f33b;if(_0x116c7d>=_0x4c3957){_0x116c7d=_0x4c3957;_0x22f33b=0xc8;}else{_0x22f33b=0xce;}_0x42dbbf['status'](_0x22f33b);return _0x42dbbf['set'](_0x993f('0x1e'),_0x5c6f00+'-'+_0x116c7d+'/'+_0x4c3957)['json'](_0x5ac616);}return null;};}function patchUpdates(_0x10f7fd){return function(_0x5d379c){try{jsonpatch[_0x993f('0x1f')](_0x5d379c,_0x10f7fd,!![]);}catch(_0x56e8ce){return BPromise[_0x993f('0x20')](_0x56e8ce);}return _0x5d379c[_0x993f('0x21')]();};}function saveUpdates(_0x256d40,_0x294146){return function(_0x54e93f){if(_0x54e93f){return _0x54e93f[_0x993f('0x22')](_0x256d40)[_0x993f('0x23')](function(_0x3cf952){return _0x3cf952;});}return null;};}function removeEntity(_0x1b8fff,_0xb95c53){return function(_0x137030){if(_0x137030){return _0x137030['destroy']()['then'](function(){_0x1b8fff[_0x993f('0x19')](0xcc)[_0x993f('0x24')]();});}};}function handleEntityNotFound(_0x3356e2,_0x3c22b1){return function(_0x2b8642){if(!_0x2b8642){_0x3356e2[_0x993f('0x25')](0x194);}return _0x2b8642;};}function handleError(_0x206a2a,_0x1e44bf){_0x1e44bf=_0x1e44bf||0x1f4;return function(_0x5ab037){logger['error'](_0x5ab037[_0x993f('0x26')]);if(_0x5ab037['name']){delete _0x5ab037[_0x993f('0x27')];}_0x206a2a[_0x993f('0x19')](_0x1e44bf)[_0x993f('0x28')](_0x5ab037);};}exports[_0x993f('0x29')]=function(_0x2f211c,_0x5ee59a){var _0x43f4aa={},_0x1fd3f0={},_0x442cdc={'count':0x0,'rows':[]};var _0x344830=_['map'](db['SquareReport'][_0x993f('0x2a')],function(_0x55fd92){return{'name':_0x55fd92[_0x993f('0x2b')],'type':_0x55fd92[_0x993f('0x2c')][_0x993f('0x2d')]};});_0x1fd3f0['model']=_[_0x993f('0x2e')](_0x344830,_0x993f('0x27'));_0x1fd3f0['query']=_['keys'](_0x2f211c['query']);_0x1fd3f0[_0x993f('0x2f')]=_[_0x993f('0x30')](_0x1fd3f0[_0x993f('0x31')],_0x1fd3f0[_0x993f('0x32')]);_0x43f4aa[_0x993f('0x33')]=_['intersection'](_0x1fd3f0[_0x993f('0x31')],qs[_0x993f('0x34')](_0x2f211c[_0x993f('0x32')][_0x993f('0x34')]));_0x43f4aa[_0x993f('0x33')]=_0x43f4aa[_0x993f('0x33')][_0x993f('0x35')]?_0x43f4aa[_0x993f('0x33')]:_0x1fd3f0['model'];if(!_0x2f211c[_0x993f('0x32')][_0x993f('0x36')](_0x993f('0x37'))){_0x43f4aa[_0x993f('0x1c')]=qs[_0x993f('0x1c')](_0x2f211c[_0x993f('0x32')][_0x993f('0x1c')]);_0x43f4aa[_0x993f('0x1a')]=qs[_0x993f('0x1a')](_0x2f211c['query'][_0x993f('0x1a')]);}_0x43f4aa[_0x993f('0x38')]=qs[_0x993f('0x39')](_0x2f211c['query'][_0x993f('0x39')]);_0x43f4aa['where']=qs[_0x993f('0x2f')](_[_0x993f('0x3a')](_0x2f211c[_0x993f('0x32')],_0x1fd3f0[_0x993f('0x2f')]),_0x344830);if(_0x2f211c[_0x993f('0x32')][_0x993f('0x3b')]){_0x43f4aa['where']=_['merge'](_0x43f4aa[_0x993f('0x3c')],{'$or':_[_0x993f('0x2e')](_0x344830,function(_0x369498){if(_0x369498[_0x993f('0x2c')]!=='VIRTUAL'){var _0x192c86={};_0x192c86[_0x369498[_0x993f('0x27')]]={'$like':'%'+_0x2f211c[_0x993f('0x32')][_0x993f('0x3b')]+'%'};return _0x192c86;}})});}_0x43f4aa=_[_0x993f('0x3d')]({},_0x43f4aa,_0x2f211c['options']);var _0x252312={'where':_0x43f4aa[_0x993f('0x3c')]};return db[_0x993f('0x3e')][_0x993f('0x1d')](_0x252312)[_0x993f('0x23')](function(_0x15127d){_0x442cdc[_0x993f('0x1d')]=_0x15127d;if(_0x2f211c[_0x993f('0x32')][_0x993f('0x3f')]){_0x43f4aa[_0x993f('0x40')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x43f4aa);})[_0x993f('0x23')](function(_0x5719aa){_0x442cdc[_0x993f('0x41')]=_0x5719aa;return _0x442cdc;})[_0x993f('0x23')](respondWithFilteredResult(_0x5ee59a,_0x43f4aa))[_0x993f('0x42')](handleError(_0x5ee59a,null));};exports[_0x993f('0x43')]=function(_0x48c81f,_0x236c7b){var _0x1cb6af={'raw':!![],'where':{'id':_0x48c81f[_0x993f('0x44')]['id']}},_0x2756b3={};_0x2756b3[_0x993f('0x31')]=_['keys'](db[_0x993f('0x3e')][_0x993f('0x2a')]);_0x2756b3['query']=_[_0x993f('0x45')](_0x48c81f['query']);_0x2756b3[_0x993f('0x2f')]=_[_0x993f('0x30')](_0x2756b3[_0x993f('0x31')],_0x2756b3[_0x993f('0x32')]);_0x1cb6af['attributes']=_[_0x993f('0x30')](_0x2756b3[_0x993f('0x31')],qs[_0x993f('0x34')](_0x48c81f[_0x993f('0x32')][_0x993f('0x34')]));_0x1cb6af[_0x993f('0x33')]=_0x1cb6af[_0x993f('0x33')][_0x993f('0x35')]?_0x1cb6af[_0x993f('0x33')]:_0x2756b3[_0x993f('0x31')];if(_0x48c81f[_0x993f('0x32')][_0x993f('0x3f')]){_0x1cb6af[_0x993f('0x40')]=[{'all':!![]}];}_0x1cb6af=_[_0x993f('0x3d')]({},_0x1cb6af,_0x48c81f[_0x993f('0x46')]);return db[_0x993f('0x3e')][_0x993f('0x47')](_0x1cb6af)[_0x993f('0x23')](handleEntityNotFound(_0x236c7b,null))[_0x993f('0x23')](respondWithResult(_0x236c7b,null))[_0x993f('0x42')](handleError(_0x236c7b,null));};exports[_0x993f('0x48')]=function(_0x404c6e,_0x147e09){return db[_0x993f('0x3e')]['create'](_0x404c6e[_0x993f('0x49')],{})[_0x993f('0x23')](respondWithResult(_0x147e09,0xc9))['catch'](handleError(_0x147e09,null));};exports[_0x993f('0x22')]=function(_0x5149e5,_0x599f72){if(_0x5149e5['body']['id']){delete _0x5149e5[_0x993f('0x49')]['id'];}return db[_0x993f('0x3e')][_0x993f('0x47')]({'where':{'id':_0x5149e5[_0x993f('0x44')]['id']}})[_0x993f('0x23')](handleEntityNotFound(_0x599f72,null))['then'](saveUpdates(_0x5149e5['body'],null))[_0x993f('0x23')](respondWithResult(_0x599f72,null))[_0x993f('0x42')](handleError(_0x599f72,null));};exports[_0x993f('0x4a')]=function(_0x2b6a21,_0x240310){return db[_0x993f('0x3e')][_0x993f('0x47')]({'where':{'id':_0x2b6a21[_0x993f('0x44')]['id']}})[_0x993f('0x23')](handleEntityNotFound(_0x240310,null))[_0x993f('0x23')](removeEntity(_0x240310,null))[_0x993f('0x42')](handleError(_0x240310,null));};exports['describe']=function(_0x2467ef,_0x632a45){return db[_0x993f('0x3e')][_0x993f('0x4b')]()['then'](respondWithResult(_0x632a45,null))[_0x993f('0x42')](handleError(_0x632a45,null));}; \ No newline at end of file +var _0x54e3=['map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','SquareReport','includeAll','findAll','rows','catch','params','find','create','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','name','send','index'];(function(_0x581feb,_0x475a85){var _0x29fe1a=function(_0x34b44d){while(--_0x34b44d){_0x581feb['push'](_0x581feb['shift']());}};_0x29fe1a(++_0x475a85);}(_0x54e3,0xa9));var _0x354e=function(_0x5eb250,_0x509c4d){_0x5eb250=_0x5eb250-0x0;var _0x817463=_0x54e3[_0x5eb250];return _0x817463;};'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('bluebird');var Mustache=require(_0x354e('0x4'));var util=require('util');var path=require(_0x354e('0x5'));var sox=require('sox');var csv=require(_0x354e('0x6'));var ejs=require(_0x354e('0x7'));var fs=require('fs');var fs_extra=require(_0x354e('0x8'));var _=require('lodash');var squel=require(_0x354e('0x9'));var crypto=require(_0x354e('0xa'));var jsforce=require(_0x354e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x354e('0x6'));var querystring=require(_0x354e('0xc'));var Papa=require(_0x354e('0xd'));var Redis=require('ioredis');var authService=require(_0x354e('0xe'));var qs=require(_0x354e('0xf'));var as=require(_0x354e('0x10'));var hardwareService=require(_0x354e('0x11'));var logger=require(_0x354e('0x12'))('api');var utils=require(_0x354e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x354e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3984ad,_0x484336){_0x484336=_0x484336||0xcc;return function(_0x5537e2){if(_0x5537e2){return _0x3984ad[_0x354e('0x15')](_0x484336);}return _0x3984ad[_0x354e('0x16')](_0x484336)[_0x354e('0x17')]();};}function respondWithResult(_0x4daf94,_0x3c0632){_0x3c0632=_0x3c0632||0xc8;return function(_0x4ab55d){if(_0x4ab55d){return _0x4daf94[_0x354e('0x16')](_0x3c0632)['json'](_0x4ab55d);}};}function respondWithFilteredResult(_0x57b784,_0xbdc2d2){return function(_0x471a31){if(_0x471a31){var _0x22b6eb=typeof _0xbdc2d2[_0x354e('0x18')]===_0x354e('0x19')&&typeof _0xbdc2d2[_0x354e('0x1a')]==='undefined';var _0x495b7e=_0x471a31[_0x354e('0x1b')];var _0x1949da=_0x22b6eb?0x0:_0xbdc2d2[_0x354e('0x18')];var _0x3fc239=_0x22b6eb?_0x471a31[_0x354e('0x1b')]:_0xbdc2d2['offset']+_0xbdc2d2[_0x354e('0x1a')];var _0x3b657e;if(_0x3fc239>=_0x495b7e){_0x3fc239=_0x495b7e;_0x3b657e=0xc8;}else{_0x3b657e=0xce;}_0x57b784['status'](_0x3b657e);return _0x57b784['set'](_0x354e('0x1c'),_0x1949da+'-'+_0x3fc239+'/'+_0x495b7e)['json'](_0x471a31);}return null;};}function patchUpdates(_0x254af9){return function(_0x35ed3d){try{jsonpatch[_0x354e('0x1d')](_0x35ed3d,_0x254af9,!![]);}catch(_0x229a57){return BPromise[_0x354e('0x1e')](_0x229a57);}return _0x35ed3d['save']();};}function saveUpdates(_0x39f993,_0x545ed7){return function(_0x430533){if(_0x430533){return _0x430533[_0x354e('0x1f')](_0x39f993)['then'](function(_0x582b8e){return _0x582b8e;});}return null;};}function removeEntity(_0x41aa68,_0x409431){return function(_0x5c7715){if(_0x5c7715){return _0x5c7715[_0x354e('0x20')]()[_0x354e('0x21')](function(){_0x41aa68['status'](0xcc)[_0x354e('0x17')]();});}};}function handleEntityNotFound(_0x1b521a,_0x579f9f){return function(_0xc231d1){if(!_0xc231d1){_0x1b521a['sendStatus'](0x194);}return _0xc231d1;};}function handleError(_0x4d486d,_0x307336){_0x307336=_0x307336||0x1f4;return function(_0x1a63dc){logger[_0x354e('0x22')](_0x1a63dc['stack']);if(_0x1a63dc[_0x354e('0x23')]){delete _0x1a63dc[_0x354e('0x23')];}_0x4d486d[_0x354e('0x16')](_0x307336)[_0x354e('0x24')](_0x1a63dc);};}exports[_0x354e('0x25')]=function(_0x402606,_0x4dc5f3){var _0x1cb40b={},_0x4a1065={},_0x51741c={'count':0x0,'rows':[]};var _0x3f2541=_[_0x354e('0x26')](db['SquareReport'][_0x354e('0x27')],function(_0x3441c6){return{'name':_0x3441c6[_0x354e('0x28')],'type':_0x3441c6[_0x354e('0x29')][_0x354e('0x2a')]};});_0x4a1065[_0x354e('0x2b')]=_[_0x354e('0x26')](_0x3f2541,_0x354e('0x23'));_0x4a1065[_0x354e('0x2c')]=_[_0x354e('0x2d')](_0x402606[_0x354e('0x2c')]);_0x4a1065[_0x354e('0x2e')]=_['intersection'](_0x4a1065[_0x354e('0x2b')],_0x4a1065[_0x354e('0x2c')]);_0x1cb40b[_0x354e('0x2f')]=_[_0x354e('0x30')](_0x4a1065[_0x354e('0x2b')],qs[_0x354e('0x31')](_0x402606['query'][_0x354e('0x31')]));_0x1cb40b[_0x354e('0x2f')]=_0x1cb40b['attributes'][_0x354e('0x32')]?_0x1cb40b[_0x354e('0x2f')]:_0x4a1065[_0x354e('0x2b')];if(!_0x402606[_0x354e('0x2c')][_0x354e('0x33')](_0x354e('0x34'))){_0x1cb40b[_0x354e('0x1a')]=qs[_0x354e('0x1a')](_0x402606[_0x354e('0x2c')]['limit']);_0x1cb40b[_0x354e('0x18')]=qs['offset'](_0x402606[_0x354e('0x2c')][_0x354e('0x18')]);}_0x1cb40b['order']=qs[_0x354e('0x35')](_0x402606[_0x354e('0x2c')][_0x354e('0x35')]);_0x1cb40b['where']=qs[_0x354e('0x2e')](_[_0x354e('0x36')](_0x402606[_0x354e('0x2c')],_0x4a1065['filters']),_0x3f2541);if(_0x402606[_0x354e('0x2c')][_0x354e('0x37')]){_0x1cb40b[_0x354e('0x38')]=_['merge'](_0x1cb40b[_0x354e('0x38')],{'$or':_[_0x354e('0x26')](_0x3f2541,function(_0x481e21){if(_0x481e21[_0x354e('0x29')]!==_0x354e('0x39')){var _0x2aedda={};_0x2aedda[_0x481e21['name']]={'$like':'%'+_0x402606[_0x354e('0x2c')][_0x354e('0x37')]+'%'};return _0x2aedda;}})});}_0x1cb40b=_[_0x354e('0x3a')]({},_0x1cb40b,_0x402606[_0x354e('0x3b')]);var _0x11b167={'where':_0x1cb40b['where']};return db[_0x354e('0x3c')][_0x354e('0x1b')](_0x11b167)['then'](function(_0x462c8d){_0x51741c[_0x354e('0x1b')]=_0x462c8d;if(_0x402606['query'][_0x354e('0x3d')]){_0x1cb40b['include']=[{'all':!![]}];}return db[_0x354e('0x3c')][_0x354e('0x3e')](_0x1cb40b);})[_0x354e('0x21')](function(_0x216747){_0x51741c[_0x354e('0x3f')]=_0x216747;return _0x51741c;})[_0x354e('0x21')](respondWithFilteredResult(_0x4dc5f3,_0x1cb40b))[_0x354e('0x40')](handleError(_0x4dc5f3,null));};exports['show']=function(_0x57296c,_0x3bd3a9){var _0x3355a2={'raw':!![],'where':{'id':_0x57296c[_0x354e('0x41')]['id']}},_0x247df6={};_0x247df6[_0x354e('0x2b')]=_[_0x354e('0x2d')](db[_0x354e('0x3c')][_0x354e('0x27')]);_0x247df6[_0x354e('0x2c')]=_['keys'](_0x57296c[_0x354e('0x2c')]);_0x247df6[_0x354e('0x2e')]=_[_0x354e('0x30')](_0x247df6[_0x354e('0x2b')],_0x247df6['query']);_0x3355a2['attributes']=_[_0x354e('0x30')](_0x247df6[_0x354e('0x2b')],qs[_0x354e('0x31')](_0x57296c['query'][_0x354e('0x31')]));_0x3355a2[_0x354e('0x2f')]=_0x3355a2[_0x354e('0x2f')][_0x354e('0x32')]?_0x3355a2[_0x354e('0x2f')]:_0x247df6[_0x354e('0x2b')];if(_0x57296c['query'][_0x354e('0x3d')]){_0x3355a2['include']=[{'all':!![]}];}_0x3355a2=_[_0x354e('0x3a')]({},_0x3355a2,_0x57296c[_0x354e('0x3b')]);return db['SquareReport'][_0x354e('0x42')](_0x3355a2)['then'](handleEntityNotFound(_0x3bd3a9,null))[_0x354e('0x21')](respondWithResult(_0x3bd3a9,null))['catch'](handleError(_0x3bd3a9,null));};exports[_0x354e('0x43')]=function(_0x557dd8,_0x4385a9){return db[_0x354e('0x3c')]['create'](_0x557dd8['body'],{})['then'](respondWithResult(_0x4385a9,0xc9))[_0x354e('0x40')](handleError(_0x4385a9,null));};exports['update']=function(_0x85fac6,_0x1d31ae){if(_0x85fac6['body']['id']){delete _0x85fac6['body']['id'];}return db['SquareReport'][_0x354e('0x42')]({'where':{'id':_0x85fac6[_0x354e('0x41')]['id']}})[_0x354e('0x21')](handleEntityNotFound(_0x1d31ae,null))['then'](saveUpdates(_0x85fac6['body'],null))[_0x354e('0x21')](respondWithResult(_0x1d31ae,null))['catch'](handleError(_0x1d31ae,null));};exports[_0x354e('0x20')]=function(_0x56fa02,_0x2d9b52){return db[_0x354e('0x3c')][_0x354e('0x42')]({'where':{'id':_0x56fa02[_0x354e('0x41')]['id']}})[_0x354e('0x21')](handleEntityNotFound(_0x2d9b52,null))['then'](removeEntity(_0x2d9b52,null))[_0x354e('0x40')](handleError(_0x2d9b52,null));};exports[_0x354e('0x44')]=function(_0x5ed9bd,_0x52f898){return db['SquareReport'][_0x354e('0x44')]()['then'](respondWithResult(_0x52f898,null))[_0x354e('0x40')](handleError(_0x52f898,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index c617821..32c2351 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 _0x3a82=['bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','uid_pname','util','../../config/logger','moment'];(function(_0x2f3e44,_0x459e06){var _0x4306ec=function(_0x55a660){while(--_0x55a660){_0x2f3e44['push'](_0x2f3e44['shift']());}};_0x4306ec(++_0x459e06);}(_0x3a82,0x16f));var _0x23a8=function(_0x2f0e60,_0x22c602){_0x2f0e60=_0x2f0e60-0x0;var _0x283e09=_0x3a82[_0x2f0e60];return _0x283e09;};'use strict';var _=require('lodash');var util=require(_0x23a8('0x0'));var logger=require(_0x23a8('0x1'))('api');var moment=require(_0x23a8('0x2'));var BPromise=require(_0x23a8('0x3'));var rp=require(_0x23a8('0x4'));var fs=require('fs');var path=require(_0x23a8('0x5'));var rimraf=require(_0x23a8('0x6'));var config=require(_0x23a8('0x7'));var attributes=require(_0x23a8('0x8'));module['exports']=function(_0x224ec1,_0x50263a){return _0x224ec1['define']('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x23a8('0x9'),'fields':['uniqueid','project_name']},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b65=['uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','exports'];(function(_0x379798,_0x18dfaf){var _0x1276d8=function(_0x539d53){while(--_0x539d53){_0x379798['push'](_0x379798['shift']());}};_0x1276d8(++_0x18dfaf);}(_0x5b65,0x9a));var _0x55b6=function(_0xfb8bd6,_0x48bc6b){_0xfb8bd6=_0xfb8bd6-0x0;var _0x272081=_0x5b65[_0xfb8bd6];return _0x272081;};'use strict';var _=require(_0x55b6('0x0'));var util=require(_0x55b6('0x1'));var logger=require(_0x55b6('0x2'))(_0x55b6('0x3'));var moment=require(_0x55b6('0x4'));var BPromise=require(_0x55b6('0x5'));var rp=require(_0x55b6('0x6'));var fs=require('fs');var path=require(_0x55b6('0x7'));var rimraf=require('rimraf');var config=require(_0x55b6('0x8'));var attributes=require(_0x55b6('0x9'));module[_0x55b6('0xa')]=function(_0x9dc4d1,_0x350278){return _0x9dc4d1['define']('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x55b6('0xb'),'fields':[_0x55b6('0xc'),_0x55b6('0xd')]},{'name':_0x55b6('0xe'),'fields':[_0x55b6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index d69f01c..22c7371 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 _0x42b9=['../../config/environment','jayson/promise','client','request','then','info','debug','stringify','error','code','SquareReport,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateSquareReport','create','body','options','raw','UpdateSquareReport','SquareReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0x42b9,0xc9));var _0x942b=function(_0xb342c0,_0x57c0dd){_0xb342c0=_0xb342c0-0x0;var _0x191031=_0x42b9[_0xb342c0];return _0x191031;};'use strict';var _=require('lodash');var util=require(_0x942b('0x0'));var moment=require(_0x942b('0x1'));var BPromise=require(_0x942b('0x2'));var rs=require(_0x942b('0x3'));var fs=require('fs');var Redis=require(_0x942b('0x4'));var db=require(_0x942b('0x5'))['db'];var utils=require(_0x942b('0x6'));var logger=require(_0x942b('0x7'))(_0x942b('0x8'));var config=require(_0x942b('0x9'));var jayson=require(_0x942b('0xa'));var client=jayson[_0x942b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x96d6c6,_0x783911,_0x2219f7){return new BPromise(function(_0x4f8850,_0x478bfb){return client[_0x942b('0xc')](_0x96d6c6,_0x2219f7)[_0x942b('0xd')](function(_0x28e7d0){logger[_0x942b('0xe')]('SquareReport,\x20%s,\x20%s',_0x783911,'request\x20sent');logger[_0x942b('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x783911,'request\x20sent',JSON[_0x942b('0x10')](_0x28e7d0));if(_0x28e7d0[_0x942b('0x11')]){if(_0x28e7d0[_0x942b('0x11')][_0x942b('0x12')]===0x1f4){logger[_0x942b('0x11')](_0x942b('0x13'),_0x783911,_0x28e7d0[_0x942b('0x11')][_0x942b('0x14')]);return _0x478bfb(_0x28e7d0[_0x942b('0x11')][_0x942b('0x14')]);}logger['error'](_0x942b('0x13'),_0x783911,_0x28e7d0[_0x942b('0x11')][_0x942b('0x14')]);return _0x4f8850(_0x28e7d0[_0x942b('0x11')][_0x942b('0x14')]);}else{logger[_0x942b('0xe')]('SquareReport,\x20%s,\x20%s',_0x783911,_0x942b('0x15'));_0x4f8850(_0x28e7d0[_0x942b('0x16')][_0x942b('0x14')]);}})[_0x942b('0x17')](function(_0x431443){logger[_0x942b('0x11')](_0x942b('0x13'),_0x783911,_0x431443);_0x478bfb(_0x431443);});});}exports[_0x942b('0x18')]=function(_0x437dd0){var _0xcbf5fe=this;return new Promise(function(_0x1054ca,_0x2621b6){return db['SquareReport'][_0x942b('0x19')](_0x437dd0[_0x942b('0x1a')],{'raw':_0x437dd0['options']?_0x437dd0[_0x942b('0x1b')][_0x942b('0x1c')]===undefined?!![]:![]:!![]})[_0x942b('0xd')](function(_0x1197c1){logger['info'](_0x942b('0x18'),_0x437dd0);logger['debug'](_0x942b('0x18'),_0x437dd0,JSON[_0x942b('0x10')](_0x1197c1));_0x1054ca(_0x1197c1);})[_0x942b('0x17')](function(_0x1b0894){logger['error'](_0x942b('0x18'),_0x1b0894['message'],_0x437dd0);_0x2621b6(_0xcbf5fe['error'](0x1f4,_0x1b0894['message']));});});};exports[_0x942b('0x1d')]=function(_0x400007){var _0x350d9c=this;return new Promise(function(_0x37fa1b,_0x4e9443){return db[_0x942b('0x1e')][_0x942b('0x1f')](_0x400007['body'],{'raw':_0x400007['options']?_0x400007[_0x942b('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x400007[_0x942b('0x1b')]?_0x400007['options'][_0x942b('0x20')]||null:null,'attributes':_0x400007[_0x942b('0x1b')]?_0x400007['options'][_0x942b('0x21')]||null:null,'limit':_0x400007[_0x942b('0x1b')]?_0x400007['options'][_0x942b('0x22')]||null:null})['then'](function(_0x7275b0){logger[_0x942b('0xe')](_0x942b('0x1d'),_0x400007);logger[_0x942b('0xf')]('UpdateSquareReport',_0x400007,JSON['stringify'](_0x7275b0));_0x37fa1b(_0x7275b0);})[_0x942b('0x17')](function(_0x18db98){logger[_0x942b('0x11')](_0x942b('0x1d'),_0x18db98[_0x942b('0x14')],_0x400007);_0x4e9443(_0x350d9c[_0x942b('0x11')](0x1f4,_0x18db98[_0x942b('0x14')]));});});}; \ No newline at end of file +var _0x80e0=['client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareReport','SquareReport','create','options','raw','UpdateSquareReport','update','body','attributes','limit','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x20a3bf,_0x28f161){var _0x5cc42e=function(_0xa22785){while(--_0xa22785){_0x20a3bf['push'](_0x20a3bf['shift']());}};_0x5cc42e(++_0x28f161);}(_0x80e0,0x1d8));var _0x080e=function(_0x1dea01,_0x3ef37a){_0x1dea01=_0x1dea01-0x0;var _0x3cdd61=_0x80e0[_0x1dea01];return _0x3cdd61;};'use strict';var _=require(_0x080e('0x0'));var util=require('util');var moment=require(_0x080e('0x1'));var BPromise=require(_0x080e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x080e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x080e('0x4'));var logger=require(_0x080e('0x5'))(_0x080e('0x6'));var config=require('../../config/environment');var jayson=require(_0x080e('0x7'));var client=jayson[_0x080e('0x8')][_0x080e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x596567,_0x596969,_0x42c514){return new BPromise(function(_0x3591e6,_0x501dee){return client[_0x080e('0xa')](_0x596567,_0x42c514)[_0x080e('0xb')](function(_0x3bd175){logger[_0x080e('0xc')](_0x080e('0xd'),_0x596969,_0x080e('0xe'));logger[_0x080e('0xf')](_0x080e('0x10'),_0x596969,'request\x20sent',JSON[_0x080e('0x11')](_0x3bd175));if(_0x3bd175[_0x080e('0x12')]){if(_0x3bd175[_0x080e('0x12')]['code']===0x1f4){logger[_0x080e('0x12')](_0x080e('0xd'),_0x596969,_0x3bd175['error']['message']);return _0x501dee(_0x3bd175[_0x080e('0x12')][_0x080e('0x13')]);}logger[_0x080e('0x12')](_0x080e('0xd'),_0x596969,_0x3bd175['error'][_0x080e('0x13')]);return _0x3591e6(_0x3bd175[_0x080e('0x12')][_0x080e('0x13')]);}else{logger[_0x080e('0xc')](_0x080e('0xd'),_0x596969,_0x080e('0xe'));_0x3591e6(_0x3bd175[_0x080e('0x14')][_0x080e('0x13')]);}})[_0x080e('0x15')](function(_0x565bc4){logger[_0x080e('0x12')](_0x080e('0xd'),_0x596969,_0x565bc4);_0x501dee(_0x565bc4);});});}exports[_0x080e('0x16')]=function(_0x2775b9){var _0x5edc3a=this;return new Promise(function(_0x353f57,_0x14c302){return db[_0x080e('0x17')][_0x080e('0x18')](_0x2775b9['body'],{'raw':_0x2775b9[_0x080e('0x19')]?_0x2775b9['options'][_0x080e('0x1a')]===undefined?!![]:![]:!![]})[_0x080e('0xb')](function(_0x523c91){logger[_0x080e('0xc')](_0x080e('0x16'),_0x2775b9);logger[_0x080e('0xf')](_0x080e('0x16'),_0x2775b9,JSON[_0x080e('0x11')](_0x523c91));_0x353f57(_0x523c91);})[_0x080e('0x15')](function(_0x15998c){logger[_0x080e('0x12')](_0x080e('0x16'),_0x15998c[_0x080e('0x13')],_0x2775b9);_0x14c302(_0x5edc3a[_0x080e('0x12')](0x1f4,_0x15998c[_0x080e('0x13')]));});});};exports[_0x080e('0x1b')]=function(_0x4b522){var _0x1047eb=this;return new Promise(function(_0x5a60a2,_0x10ee42){return db[_0x080e('0x17')][_0x080e('0x1c')](_0x4b522[_0x080e('0x1d')],{'raw':_0x4b522[_0x080e('0x19')]?_0x4b522['options'][_0x080e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b522[_0x080e('0x19')]?_0x4b522[_0x080e('0x19')]['where']||null:null,'attributes':_0x4b522[_0x080e('0x19')]?_0x4b522[_0x080e('0x19')][_0x080e('0x1e')]||null:null,'limit':_0x4b522[_0x080e('0x19')]?_0x4b522[_0x080e('0x19')][_0x080e('0x1f')]||null:null})[_0x080e('0xb')](function(_0x529342){logger['info'](_0x080e('0x1b'),_0x4b522);logger[_0x080e('0xf')](_0x080e('0x1b'),_0x4b522,JSON['stringify'](_0x529342));_0x5a60a2(_0x529342);})[_0x080e('0x15')](function(_0x101dfa){logger['error'](_0x080e('0x1b'),_0x101dfa[_0x080e('0x13')],_0x4b522);_0x10ee42(_0x1047eb[_0x080e('0x12')](0x1f4,_0x101dfa['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 9e46452..7522def 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 _0x8b46=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x8b46,0x108));var _0x68b4=function(_0x45673b,_0x7a4c21){_0x45673b=_0x45673b-0x0;var _0x5af26d=_0x8b46[_0x45673b];return _0x5af26d;};'use strict';var multer=require(_0x68b4('0x0'));var util=require(_0x68b4('0x1'));var path=require(_0x68b4('0x2'));var timeout=require(_0x68b4('0x3'));var express=require(_0x68b4('0x4'));var router=express[_0x68b4('0x5')]();var fs_extra=require(_0x68b4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68b4('0x7'));var config=require(_0x68b4('0x8'));var controller=require(_0x68b4('0x9'));router[_0x68b4('0xa')]('/',auth[_0x68b4('0xb')](),controller[_0x68b4('0xc')]);router[_0x68b4('0xa')](_0x68b4('0xd'),auth['isAuthenticated'](),controller[_0x68b4('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x68b4('0xf')]);router[_0x68b4('0x10')]('/',auth['isAuthenticated'](),controller[_0x68b4('0x11')]);router[_0x68b4('0x12')](_0x68b4('0x13'),auth['isAuthenticated'](),controller[_0x68b4('0x14')]);router[_0x68b4('0x15')]('/:id',auth[_0x68b4('0xb')](),controller[_0x68b4('0x16')]);module[_0x68b4('0x17')]=router; \ No newline at end of file +var _0x9296=['express','Router','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','index','/describe','isAuthenticated','show','post','/:id','delete','destroy','exports','multer','util','path'];(function(_0x27c2cd,_0x521304){var _0x33998a=function(_0xd87537){while(--_0xd87537){_0x27c2cd['push'](_0x27c2cd['shift']());}};_0x33998a(++_0x521304);}(_0x9296,0x177));var _0x6929=function(_0x124789,_0x39c8cb){_0x124789=_0x124789-0x0;var _0x188f01=_0x9296[_0x124789];return _0x188f01;};'use strict';var multer=require(_0x6929('0x0'));var util=require(_0x6929('0x1'));var path=require(_0x6929('0x2'));var timeout=require('connect-timeout');var express=require(_0x6929('0x3'));var router=express[_0x6929('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6929('0x5'));var interaction=require(_0x6929('0x6'));var config=require('../../config/environment');var controller=require(_0x6929('0x7'));router[_0x6929('0x8')]('/',auth['isAuthenticated'](),controller[_0x6929('0x9')]);router[_0x6929('0x8')](_0x6929('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x6929('0x8')]('/:id',auth[_0x6929('0xb')](),controller[_0x6929('0xc')]);router[_0x6929('0xd')]('/',auth[_0x6929('0xb')](),controller['create']);router['put'](_0x6929('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x6929('0xf')](_0x6929('0xe'),auth[_0x6929('0xb')](),controller[_0x6929('0x10')]);module[_0x6929('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 85e1873..aaf8ff7 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 _0x4fa6=['exports','STRING','TEXT','sequelize'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0x4fa6,0xc3));var _0x64fa=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x4fa6[_0x40a825];return _0x273a54;};'use strict';var Sequelize=require(_0x64fa('0x0'));module[_0x64fa('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x64fa('0x2')]},'application':{'type':Sequelize[_0x64fa('0x2')]},'data':{'type':Sequelize[_0x64fa('0x3')]},'project_name':{'type':Sequelize[_0x64fa('0x2')]},'callerid':{'type':Sequelize[_0x64fa('0x2')]}}; \ No newline at end of file +var _0xbe77=['STRING','TEXT','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbe77,0x16d));var _0x7be7=function(_0x41924e,_0x51ff4e){_0x41924e=_0x41924e-0x0;var _0x273214=_0xbe77[_0x41924e];return _0x273214;};'use strict';var Sequelize=require(_0x7be7('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x7be7('0x1')]},'application':{'type':Sequelize[_0x7be7('0x1')]},'data':{'type':Sequelize[_0x7be7('0x2')]},'project_name':{'type':Sequelize[_0x7be7('0x1')]},'callerid':{'type':Sequelize[_0x7be7('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index fee6808..1078895 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 _0x664d=['includeAll','include','rows','catch','show','params','length','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options'];(function(_0x408d22,_0x53eef9){var _0x58effd=function(_0x4ab8ee){while(--_0x4ab8ee){_0x408d22['push'](_0x408d22['shift']());}};_0x58effd(++_0x53eef9);}(_0x664d,0x179));var _0xd664=function(_0xe9c8e4,_0x3aa2f6){_0xe9c8e4=_0xe9c8e4-0x0;var _0x2037fa=_0x664d[_0xe9c8e4];return _0x2037fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd664('0x0'));var zipdir=require(_0xd664('0x1'));var jsonpatch=require(_0xd664('0x2'));var rp=require(_0xd664('0x3'));var moment=require('moment');var BPromise=require(_0xd664('0x4'));var Mustache=require(_0xd664('0x5'));var util=require('util');var path=require(_0xd664('0x6'));var sox=require(_0xd664('0x7'));var csv=require(_0xd664('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd664('0x9'));var _=require(_0xd664('0xa'));var squel=require('squel');var crypto=require(_0xd664('0xb'));var jsforce=require(_0xd664('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd664('0x8'));var querystring=require(_0xd664('0xd'));var Papa=require('papaparse');var Redis=require(_0xd664('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd664('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd664('0x10'));var logger=require(_0xd664('0x11'))('api');var utils=require(_0xd664('0x12'));var config=require(_0xd664('0x13'));var licenseUtil=require(_0xd664('0x14'));var db=require(_0xd664('0x15'))['db'];function respondWithStatusCode(_0x400f5a,_0x1986fe){_0x1986fe=_0x1986fe||0xcc;return function(_0x225854){if(_0x225854){return _0x400f5a['sendStatus'](_0x1986fe);}return _0x400f5a[_0xd664('0x16')](_0x1986fe)[_0xd664('0x17')]();};}function respondWithResult(_0x4040ec,_0x54a978){_0x54a978=_0x54a978||0xc8;return function(_0xa600c7){if(_0xa600c7){return _0x4040ec['status'](_0x54a978)[_0xd664('0x18')](_0xa600c7);}};}function respondWithFilteredResult(_0x2e7e68,_0x3d7493){return function(_0x5b4c96){if(_0x5b4c96){var _0x3d5d38=typeof _0x3d7493[_0xd664('0x19')]==='undefined'&&typeof _0x3d7493[_0xd664('0x1a')]===_0xd664('0x1b');var _0x2de2dc=_0x5b4c96[_0xd664('0x1c')];var _0x1a0ca8=_0x3d5d38?0x0:_0x3d7493[_0xd664('0x19')];var _0x4b26c4=_0x3d5d38?_0x5b4c96[_0xd664('0x1c')]:_0x3d7493[_0xd664('0x19')]+_0x3d7493[_0xd664('0x1a')];var _0x4fd738;if(_0x4b26c4>=_0x2de2dc){_0x4b26c4=_0x2de2dc;_0x4fd738=0xc8;}else{_0x4fd738=0xce;}_0x2e7e68[_0xd664('0x16')](_0x4fd738);return _0x2e7e68['set'](_0xd664('0x1d'),_0x1a0ca8+'-'+_0x4b26c4+'/'+_0x2de2dc)[_0xd664('0x18')](_0x5b4c96);}return null;};}function patchUpdates(_0x5ed7b8){return function(_0x4b655c){try{jsonpatch[_0xd664('0x1e')](_0x4b655c,_0x5ed7b8,!![]);}catch(_0x38030e){return BPromise[_0xd664('0x1f')](_0x38030e);}return _0x4b655c[_0xd664('0x20')]();};}function saveUpdates(_0x876d84,_0x401a13){return function(_0xb4ed5c){if(_0xb4ed5c){return _0xb4ed5c['update'](_0x876d84)[_0xd664('0x21')](function(_0x369607){return _0x369607;});}return null;};}function removeEntity(_0x204c3a,_0x41b15f){return function(_0x8eb024){if(_0x8eb024){return _0x8eb024['destroy']()[_0xd664('0x21')](function(){_0x204c3a[_0xd664('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2aed77,_0x46f10d){return function(_0x36302e){if(!_0x36302e){_0x2aed77['sendStatus'](0x194);}return _0x36302e;};}function handleError(_0x2dfd26,_0x5b1644){_0x5b1644=_0x5b1644||0x1f4;return function(_0x5c20dd){logger[_0xd664('0x22')](_0x5c20dd['stack']);if(_0x5c20dd[_0xd664('0x23')]){delete _0x5c20dd['name'];}_0x2dfd26[_0xd664('0x16')](_0x5b1644)[_0xd664('0x24')](_0x5c20dd);};}exports[_0xd664('0x25')]=function(_0x41e5cb,_0x4ab858){var _0x5ed2cd={},_0x3409c={},_0x1050fa={'count':0x0,'rows':[]};var _0x1e5a17=_[_0xd664('0x26')](db[_0xd664('0x27')][_0xd664('0x28')],function(_0x2cb205){return{'name':_0x2cb205[_0xd664('0x29')],'type':_0x2cb205[_0xd664('0x2a')][_0xd664('0x2b')]};});_0x3409c[_0xd664('0x2c')]=_['map'](_0x1e5a17,'name');_0x3409c[_0xd664('0x2d')]=_[_0xd664('0x2e')](_0x41e5cb[_0xd664('0x2d')]);_0x3409c['filters']=_[_0xd664('0x2f')](_0x3409c['model'],_0x3409c[_0xd664('0x2d')]);_0x5ed2cd[_0xd664('0x30')]=_[_0xd664('0x2f')](_0x3409c['model'],qs[_0xd664('0x31')](_0x41e5cb[_0xd664('0x2d')][_0xd664('0x31')]));_0x5ed2cd['attributes']=_0x5ed2cd['attributes']['length']?_0x5ed2cd[_0xd664('0x30')]:_0x3409c[_0xd664('0x2c')];if(!_0x41e5cb[_0xd664('0x2d')][_0xd664('0x32')](_0xd664('0x33'))){_0x5ed2cd[_0xd664('0x1a')]=qs[_0xd664('0x1a')](_0x41e5cb[_0xd664('0x2d')]['limit']);_0x5ed2cd['offset']=qs[_0xd664('0x19')](_0x41e5cb[_0xd664('0x2d')][_0xd664('0x19')]);}_0x5ed2cd[_0xd664('0x34')]=qs['sort'](_0x41e5cb[_0xd664('0x2d')][_0xd664('0x35')]);_0x5ed2cd[_0xd664('0x36')]=qs[_0xd664('0x37')](_[_0xd664('0x38')](_0x41e5cb[_0xd664('0x2d')],_0x3409c[_0xd664('0x37')]),_0x1e5a17);if(_0x41e5cb['query']['filter']){_0x5ed2cd[_0xd664('0x36')]=_['merge'](_0x5ed2cd[_0xd664('0x36')],{'$or':_[_0xd664('0x26')](_0x1e5a17,function(_0x157393){if(_0x157393[_0xd664('0x2a')]!==_0xd664('0x39')){var _0x2d864b={};_0x2d864b[_0x157393[_0xd664('0x23')]]={'$like':'%'+_0x41e5cb[_0xd664('0x2d')][_0xd664('0x3a')]+'%'};return _0x2d864b;}})});}_0x5ed2cd=_[_0xd664('0x3b')]({},_0x5ed2cd,_0x41e5cb[_0xd664('0x3c')]);var _0x214055={'where':_0x5ed2cd[_0xd664('0x36')]};return db[_0xd664('0x27')]['count'](_0x214055)[_0xd664('0x21')](function(_0xda6e61){_0x1050fa[_0xd664('0x1c')]=_0xda6e61;if(_0x41e5cb[_0xd664('0x2d')][_0xd664('0x3d')]){_0x5ed2cd[_0xd664('0x3e')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x5ed2cd);})[_0xd664('0x21')](function(_0x1b5064){_0x1050fa[_0xd664('0x3f')]=_0x1b5064;return _0x1050fa;})[_0xd664('0x21')](respondWithFilteredResult(_0x4ab858,_0x5ed2cd))[_0xd664('0x40')](handleError(_0x4ab858,null));};exports[_0xd664('0x41')]=function(_0x41378a,_0x1d0278){var _0x2714c6={'raw':!![],'where':{'id':_0x41378a[_0xd664('0x42')]['id']}},_0x5c0b24={};_0x5c0b24[_0xd664('0x2c')]=_[_0xd664('0x2e')](db['SquareDetailsReport'][_0xd664('0x28')]);_0x5c0b24['query']=_['keys'](_0x41378a[_0xd664('0x2d')]);_0x5c0b24['filters']=_[_0xd664('0x2f')](_0x5c0b24[_0xd664('0x2c')],_0x5c0b24[_0xd664('0x2d')]);_0x2714c6[_0xd664('0x30')]=_[_0xd664('0x2f')](_0x5c0b24[_0xd664('0x2c')],qs[_0xd664('0x31')](_0x41378a['query'][_0xd664('0x31')]));_0x2714c6[_0xd664('0x30')]=_0x2714c6[_0xd664('0x30')][_0xd664('0x43')]?_0x2714c6[_0xd664('0x30')]:_0x5c0b24[_0xd664('0x2c')];if(_0x41378a['query'][_0xd664('0x3d')]){_0x2714c6[_0xd664('0x3e')]=[{'all':!![]}];}_0x2714c6=_[_0xd664('0x3b')]({},_0x2714c6,_0x41378a[_0xd664('0x3c')]);return db['SquareDetailsReport']['find'](_0x2714c6)['then'](handleEntityNotFound(_0x1d0278,null))[_0xd664('0x21')](respondWithResult(_0x1d0278,null))['catch'](handleError(_0x1d0278,null));};exports[_0xd664('0x44')]=function(_0xdf3f32,_0x4a2432){return db[_0xd664('0x27')][_0xd664('0x44')](_0xdf3f32[_0xd664('0x45')],{})[_0xd664('0x21')](respondWithResult(_0x4a2432,0xc9))[_0xd664('0x40')](handleError(_0x4a2432,null));};exports['update']=function(_0xa46d9d,_0x25ecb2){if(_0xa46d9d[_0xd664('0x45')]['id']){delete _0xa46d9d['body']['id'];}return db[_0xd664('0x27')]['find']({'where':{'id':_0xa46d9d[_0xd664('0x42')]['id']}})[_0xd664('0x21')](handleEntityNotFound(_0x25ecb2,null))[_0xd664('0x21')](saveUpdates(_0xa46d9d[_0xd664('0x45')],null))[_0xd664('0x21')](respondWithResult(_0x25ecb2,null))['catch'](handleError(_0x25ecb2,null));};exports[_0xd664('0x46')]=function(_0x1e35c0,_0x54ebd3){return db[_0xd664('0x27')][_0xd664('0x47')]({'where':{'id':_0x1e35c0[_0xd664('0x42')]['id']}})[_0xd664('0x21')](handleEntityNotFound(_0x54ebd3,null))[_0xd664('0x21')](removeEntity(_0x54ebd3,null))[_0xd664('0x40')](handleError(_0x54ebd3,null));};exports[_0xd664('0x48')]=function(_0x31fec5,_0x7ab54a){return db[_0xd664('0x27')][_0xd664('0x48')]()[_0xd664('0x21')](respondWithResult(_0x7ab54a,null))[_0xd664('0x40')](handleError(_0x7ab54a,null));}; \ No newline at end of file +var _0x7f2c=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','find','catch','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x7f2c,0x85));var _0xc7f2=function(_0x14510c,_0x3f66f0){_0x14510c=_0x14510c-0x0;var _0x31c5f8=_0x7f2c[_0x14510c];return _0x31c5f8;};'use strict';var emlformat=require(_0xc7f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc7f2('0x1'));var jsonpatch=require(_0xc7f2('0x2'));var rp=require(_0xc7f2('0x3'));var moment=require('moment');var BPromise=require(_0xc7f2('0x4'));var Mustache=require(_0xc7f2('0x5'));var util=require(_0xc7f2('0x6'));var path=require(_0xc7f2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc7f2('0x8'));var fs=require('fs');var fs_extra=require(_0xc7f2('0x9'));var _=require(_0xc7f2('0xa'));var squel=require(_0xc7f2('0xb'));var crypto=require(_0xc7f2('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc7f2('0xd'));var Papa=require(_0xc7f2('0xe'));var Redis=require(_0xc7f2('0xf'));var authService=require(_0xc7f2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc7f2('0x11'));var hardwareService=require(_0xc7f2('0x12'));var logger=require(_0xc7f2('0x13'))('api');var utils=require(_0xc7f2('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x570a0b,_0x117db2){_0x117db2=_0x117db2||0xcc;return function(_0x297a10){if(_0x297a10){return _0x570a0b[_0xc7f2('0x15')](_0x117db2);}return _0x570a0b['status'](_0x117db2)[_0xc7f2('0x16')]();};}function respondWithResult(_0x329993,_0x181b29){_0x181b29=_0x181b29||0xc8;return function(_0x3d10b9){if(_0x3d10b9){return _0x329993[_0xc7f2('0x17')](_0x181b29)[_0xc7f2('0x18')](_0x3d10b9);}};}function respondWithFilteredResult(_0x263c50,_0x54979e){return function(_0x4e97c5){if(_0x4e97c5){var _0x9be592=typeof _0x54979e[_0xc7f2('0x19')]===_0xc7f2('0x1a')&&typeof _0x54979e[_0xc7f2('0x1b')]===_0xc7f2('0x1a');var _0x5f503e=_0x4e97c5[_0xc7f2('0x1c')];var _0xb401ec=_0x9be592?0x0:_0x54979e[_0xc7f2('0x19')];var _0x492f1a=_0x9be592?_0x4e97c5[_0xc7f2('0x1c')]:_0x54979e[_0xc7f2('0x19')]+_0x54979e['limit'];var _0x406e90;if(_0x492f1a>=_0x5f503e){_0x492f1a=_0x5f503e;_0x406e90=0xc8;}else{_0x406e90=0xce;}_0x263c50[_0xc7f2('0x17')](_0x406e90);return _0x263c50['set']('Content-Range',_0xb401ec+'-'+_0x492f1a+'/'+_0x5f503e)['json'](_0x4e97c5);}return null;};}function patchUpdates(_0x8b6e16){return function(_0x34b3ab){try{jsonpatch[_0xc7f2('0x1d')](_0x34b3ab,_0x8b6e16,!![]);}catch(_0x45ded4){return BPromise[_0xc7f2('0x1e')](_0x45ded4);}return _0x34b3ab[_0xc7f2('0x1f')]();};}function saveUpdates(_0x3d9aa8,_0x5830e8){return function(_0x48308a){if(_0x48308a){return _0x48308a[_0xc7f2('0x20')](_0x3d9aa8)[_0xc7f2('0x21')](function(_0x2633d3){return _0x2633d3;});}return null;};}function removeEntity(_0x54defe,_0x2b4ebb){return function(_0x53f66f){if(_0x53f66f){return _0x53f66f['destroy']()[_0xc7f2('0x21')](function(){_0x54defe[_0xc7f2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e2fe0,_0x5aac89){return function(_0x4ac480){if(!_0x4ac480){_0x3e2fe0[_0xc7f2('0x15')](0x194);}return _0x4ac480;};}function handleError(_0x56ed97,_0x17d402){_0x17d402=_0x17d402||0x1f4;return function(_0x266b70){logger[_0xc7f2('0x22')](_0x266b70[_0xc7f2('0x23')]);if(_0x266b70[_0xc7f2('0x24')]){delete _0x266b70[_0xc7f2('0x24')];}_0x56ed97[_0xc7f2('0x17')](_0x17d402)[_0xc7f2('0x25')](_0x266b70);};}exports[_0xc7f2('0x26')]=function(_0x350bf7,_0x70f84){var _0x59d86a={},_0x479607={},_0x2065eb={'count':0x0,'rows':[]};var _0x63b564=_[_0xc7f2('0x27')](db[_0xc7f2('0x28')][_0xc7f2('0x29')],function(_0x400386){return{'name':_0x400386[_0xc7f2('0x2a')],'type':_0x400386[_0xc7f2('0x2b')][_0xc7f2('0x2c')]};});_0x479607['model']=_[_0xc7f2('0x27')](_0x63b564,_0xc7f2('0x24'));_0x479607[_0xc7f2('0x2d')]=_[_0xc7f2('0x2e')](_0x350bf7['query']);_0x479607[_0xc7f2('0x2f')]=_[_0xc7f2('0x30')](_0x479607['model'],_0x479607['query']);_0x59d86a[_0xc7f2('0x31')]=_['intersection'](_0x479607[_0xc7f2('0x32')],qs[_0xc7f2('0x33')](_0x350bf7[_0xc7f2('0x2d')][_0xc7f2('0x33')]));_0x59d86a['attributes']=_0x59d86a['attributes'][_0xc7f2('0x34')]?_0x59d86a[_0xc7f2('0x31')]:_0x479607[_0xc7f2('0x32')];if(!_0x350bf7[_0xc7f2('0x2d')][_0xc7f2('0x35')](_0xc7f2('0x36'))){_0x59d86a[_0xc7f2('0x1b')]=qs[_0xc7f2('0x1b')](_0x350bf7['query']['limit']);_0x59d86a['offset']=qs[_0xc7f2('0x19')](_0x350bf7[_0xc7f2('0x2d')][_0xc7f2('0x19')]);}_0x59d86a[_0xc7f2('0x37')]=qs[_0xc7f2('0x38')](_0x350bf7['query'][_0xc7f2('0x38')]);_0x59d86a[_0xc7f2('0x39')]=qs[_0xc7f2('0x2f')](_['pick'](_0x350bf7[_0xc7f2('0x2d')],_0x479607[_0xc7f2('0x2f')]),_0x63b564);if(_0x350bf7['query']['filter']){_0x59d86a['where']=_[_0xc7f2('0x3a')](_0x59d86a['where'],{'$or':_[_0xc7f2('0x27')](_0x63b564,function(_0x2bb389){if(_0x2bb389[_0xc7f2('0x2b')]!==_0xc7f2('0x3b')){var _0x48d258={};_0x48d258[_0x2bb389[_0xc7f2('0x24')]]={'$like':'%'+_0x350bf7[_0xc7f2('0x2d')][_0xc7f2('0x3c')]+'%'};return _0x48d258;}})});}_0x59d86a=_['merge']({},_0x59d86a,_0x350bf7[_0xc7f2('0x3d')]);var _0x50f7cf={'where':_0x59d86a[_0xc7f2('0x39')]};return db['SquareDetailsReport']['count'](_0x50f7cf)[_0xc7f2('0x21')](function(_0x16aeb9){_0x2065eb[_0xc7f2('0x1c')]=_0x16aeb9;if(_0x350bf7[_0xc7f2('0x2d')][_0xc7f2('0x3e')]){_0x59d86a[_0xc7f2('0x3f')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x59d86a);})[_0xc7f2('0x21')](function(_0x14a10d){_0x2065eb[_0xc7f2('0x40')]=_0x14a10d;return _0x2065eb;})[_0xc7f2('0x21')](respondWithFilteredResult(_0x70f84,_0x59d86a))['catch'](handleError(_0x70f84,null));};exports[_0xc7f2('0x41')]=function(_0x5349ec,_0xafb9c8){var _0x1514d6={'raw':!![],'where':{'id':_0x5349ec[_0xc7f2('0x42')]['id']}},_0x230d01={};_0x230d01[_0xc7f2('0x32')]=_[_0xc7f2('0x2e')](db['SquareDetailsReport'][_0xc7f2('0x29')]);_0x230d01['query']=_[_0xc7f2('0x2e')](_0x5349ec[_0xc7f2('0x2d')]);_0x230d01[_0xc7f2('0x2f')]=_[_0xc7f2('0x30')](_0x230d01[_0xc7f2('0x32')],_0x230d01['query']);_0x1514d6[_0xc7f2('0x31')]=_[_0xc7f2('0x30')](_0x230d01[_0xc7f2('0x32')],qs[_0xc7f2('0x33')](_0x5349ec[_0xc7f2('0x2d')][_0xc7f2('0x33')]));_0x1514d6['attributes']=_0x1514d6[_0xc7f2('0x31')]['length']?_0x1514d6[_0xc7f2('0x31')]:_0x230d01[_0xc7f2('0x32')];if(_0x5349ec['query'][_0xc7f2('0x3e')]){_0x1514d6['include']=[{'all':!![]}];}_0x1514d6=_['merge']({},_0x1514d6,_0x5349ec['options']);return db[_0xc7f2('0x28')][_0xc7f2('0x43')](_0x1514d6)[_0xc7f2('0x21')](handleEntityNotFound(_0xafb9c8,null))['then'](respondWithResult(_0xafb9c8,null))[_0xc7f2('0x44')](handleError(_0xafb9c8,null));};exports[_0xc7f2('0x45')]=function(_0x40459c,_0x136dc3){return db[_0xc7f2('0x28')][_0xc7f2('0x45')](_0x40459c[_0xc7f2('0x46')],{})[_0xc7f2('0x21')](respondWithResult(_0x136dc3,0xc9))[_0xc7f2('0x44')](handleError(_0x136dc3,null));};exports[_0xc7f2('0x20')]=function(_0x2ac156,_0xf44bf0){if(_0x2ac156[_0xc7f2('0x46')]['id']){delete _0x2ac156[_0xc7f2('0x46')]['id'];}return db['SquareDetailsReport'][_0xc7f2('0x43')]({'where':{'id':_0x2ac156[_0xc7f2('0x42')]['id']}})[_0xc7f2('0x21')](handleEntityNotFound(_0xf44bf0,null))[_0xc7f2('0x21')](saveUpdates(_0x2ac156[_0xc7f2('0x46')],null))['then'](respondWithResult(_0xf44bf0,null))[_0xc7f2('0x44')](handleError(_0xf44bf0,null));};exports[_0xc7f2('0x47')]=function(_0xe8203e,_0xcb1715){return db[_0xc7f2('0x28')]['find']({'where':{'id':_0xe8203e[_0xc7f2('0x42')]['id']}})[_0xc7f2('0x21')](handleEntityNotFound(_0xcb1715,null))[_0xc7f2('0x21')](removeEntity(_0xcb1715,null))['catch'](handleError(_0xcb1715,null));};exports[_0xc7f2('0x48')]=function(_0x26662c,_0x40a807){return db['SquareDetailsReport'][_0xc7f2('0x48')]()[_0xc7f2('0x21')](respondWithResult(_0x40a807,null))[_0xc7f2('0x44')](handleError(_0x40a807,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index ee4225a..8465d50 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 _0xe3d5=['define','SquareDetailsReport','report_square_details','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x5b7010,_0x581a43){var _0x188dc0=function(_0x4fbbf3){while(--_0x4fbbf3){_0x5b7010['push'](_0x5b7010['shift']());}};_0x188dc0(++_0x581a43);}(_0xe3d5,0xdb));var _0x5e3d=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0xe3d5[_0x35007a];return _0x574f68;};'use strict';var _=require(_0x5e3d('0x0'));var util=require(_0x5e3d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5e3d('0x2'));var BPromise=require(_0x5e3d('0x3'));var rp=require(_0x5e3d('0x4'));var fs=require('fs');var path=require(_0x5e3d('0x5'));var rimraf=require(_0x5e3d('0x6'));var config=require(_0x5e3d('0x7'));var attributes=require(_0x5e3d('0x8'));module['exports']=function(_0x117a19,_0x58897e){return _0x117a19[_0x5e3d('0x9')](_0x5e3d('0xa'),attributes,{'tableName':_0x5e3d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe134=['define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0xe134,0x65));var _0x4e13=function(_0x531692,_0x6d376e){_0x531692=_0x531692-0x0;var _0x1ecc9c=_0xe134[_0x531692];return _0x1ecc9c;};'use strict';var _=require(_0x4e13('0x0'));var util=require(_0x4e13('0x1'));var logger=require(_0x4e13('0x2'))('api');var moment=require(_0x4e13('0x3'));var BPromise=require(_0x4e13('0x4'));var rp=require(_0x4e13('0x5'));var fs=require('fs');var path=require(_0x4e13('0x6'));var rimraf=require(_0x4e13('0x7'));var config=require(_0x4e13('0x8'));var attributes=require(_0x4e13('0x9'));module[_0x4e13('0xa')]=function(_0x4a7e74,_0xe2dfa3){return _0x4a7e74[_0x4e13('0xb')](_0x4e13('0xc'),attributes,{'tableName':_0x4e13('0xd'),'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 08916ee..9f3a364 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 _0x34b7=['stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s'];(function(_0x4dbdda,_0x11f07c){var _0x1acbf1=function(_0x1a9fc8){while(--_0x1a9fc8){_0x4dbdda['push'](_0x4dbdda['shift']());}};_0x1acbf1(++_0x11f07c);}(_0x34b7,0x196));var _0x734b=function(_0x2e84ee,_0x283c59){_0x2e84ee=_0x2e84ee-0x0;var _0x5c82d0=_0x34b7[_0x2e84ee];return _0x5c82d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28918a,_0x35d685,_0x58e2f1){return new BPromise(function(_0x1eb803,_0x2e7932){return client['request'](_0x28918a,_0x58e2f1)['then'](function(_0x5f4b3a){logger[_0x734b('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x35d685,_0x734b('0xb'));logger[_0x734b('0xc')](_0x734b('0xd'),_0x35d685,_0x734b('0xb'),JSON[_0x734b('0xe')](_0x5f4b3a));if(_0x5f4b3a[_0x734b('0xf')]){if(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x2e7932(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}logger['error'](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x1eb803(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}else{logger[_0x734b('0xa')](_0x734b('0x11'),_0x35d685,_0x734b('0xb'));_0x1eb803(_0x5f4b3a[_0x734b('0x13')][_0x734b('0x12')]);}})[_0x734b('0x14')](function(_0x4d2d23){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x4d2d23);_0x2e7932(_0x4d2d23);});});}exports[_0x734b('0x15')]=function(_0x5edbe9){var _0x4d3b9c=this;return new Promise(function(_0x56a95c,_0xcd12a1){return db[_0x734b('0x16')][_0x734b('0x17')](_0x5edbe9[_0x734b('0x18')],{'raw':_0x5edbe9[_0x734b('0x19')]?_0x5edbe9[_0x734b('0x19')][_0x734b('0x1a')]===undefined?!![]:![]:!![]})[_0x734b('0x1b')](function(_0x67eed){logger[_0x734b('0xa')](_0x734b('0x15'),_0x5edbe9);logger[_0x734b('0xc')](_0x734b('0x15'),_0x5edbe9,JSON[_0x734b('0xe')](_0x67eed));_0x56a95c(_0x67eed);})['catch'](function(_0x1e4dcc){logger[_0x734b('0xf')]('CreateSquareDetailsReport',_0x1e4dcc[_0x734b('0x12')],_0x5edbe9);_0xcd12a1(_0x4d3b9c[_0x734b('0xf')](0x1f4,_0x1e4dcc[_0x734b('0x12')]));});});}; \ No newline at end of file +var _0x5713=['SquareDetailsReport','create','body','options','raw','stringify','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','SquareDetailsReport,\x20%s,\x20%s','message','result','CreateSquareDetailsReport'];(function(_0x46cf00,_0x457a43){var _0x3974dc=function(_0x4b5d0a){while(--_0x4b5d0a){_0x46cf00['push'](_0x46cf00['shift']());}};_0x3974dc(++_0x457a43);}(_0x5713,0x1c7));var _0x3571=function(_0x3fc9a2,_0x508760){_0x3fc9a2=_0x3fc9a2-0x0;var _0x3d2c92=_0x5713[_0x3fc9a2];return _0x3d2c92;};'use strict';var _=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var moment=require('moment');var BPromise=require(_0x3571('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3571('0x3'));var db=require(_0x3571('0x4'))['db'];var utils=require(_0x3571('0x5'));var logger=require(_0x3571('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3571('0x7'));var client=jayson[_0x3571('0x8')][_0x3571('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x432a48,_0x3a6f29,_0x1f8f0f){return new BPromise(function(_0x48b06d,_0x358ba1){return client[_0x3571('0xa')](_0x432a48,_0x1f8f0f)[_0x3571('0xb')](function(_0x288fc8){logger[_0x3571('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x3a6f29,'request\x20sent');logger[_0x3571('0xd')](_0x3571('0xe'),_0x3a6f29,_0x3571('0xf'),JSON['stringify'](_0x288fc8));if(_0x288fc8['error']){if(_0x288fc8['error']['code']===0x1f4){logger[_0x3571('0x10')](_0x3571('0x11'),_0x3a6f29,_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);return _0x358ba1(_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);}logger[_0x3571('0x10')](_0x3571('0x11'),_0x3a6f29,_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);return _0x48b06d(_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);}else{logger[_0x3571('0xc')](_0x3571('0x11'),_0x3a6f29,_0x3571('0xf'));_0x48b06d(_0x288fc8[_0x3571('0x13')]['message']);}})['catch'](function(_0x48c77e){logger[_0x3571('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x3a6f29,_0x48c77e);_0x358ba1(_0x48c77e);});});}exports[_0x3571('0x14')]=function(_0x37881f){var _0x4b745a=this;return new Promise(function(_0x22a418,_0xab19b1){return db[_0x3571('0x15')][_0x3571('0x16')](_0x37881f[_0x3571('0x17')],{'raw':_0x37881f[_0x3571('0x18')]?_0x37881f['options'][_0x3571('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1cdda8){logger[_0x3571('0xc')]('CreateSquareDetailsReport',_0x37881f);logger['debug']('CreateSquareDetailsReport',_0x37881f,JSON[_0x3571('0x1a')](_0x1cdda8));_0x22a418(_0x1cdda8);})[_0x3571('0x1b')](function(_0xa6cd35){logger[_0x3571('0x10')](_0x3571('0x14'),_0xa6cd35['message'],_0x37881f);_0xab19b1(_0x4b745a[_0x3571('0x10')](0x1f4,_0xa6cd35[_0x3571('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 86d7e67..1d071fe 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 _0xb4ba=['/process/:pid/kill','killProcess','exports','express','Router','get','isAuthenticated','index'];(function(_0x1420f1,_0x3cdafd){var _0x1f2e65=function(_0x46e0b1){while(--_0x46e0b1){_0x1420f1['push'](_0x1420f1['shift']());}};_0x1f2e65(++_0x3cdafd);}(_0xb4ba,0xd3));var _0xab4b=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xb4ba[_0x373dee];return _0x46798f;};'use strict';var express=require(_0xab4b('0x0'));var router=express[_0xab4b('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0xab4b('0x2')]('/',auth[_0xab4b('0x3')](),controller[_0xab4b('0x4')]);router[_0xab4b('0x2')](_0xab4b('0x5'),auth[_0xab4b('0x3')](),controller[_0xab4b('0x6')]);module[_0xab4b('0x7')]=router; \ No newline at end of file +var _0x87d6=['../../components/auth/service','get','isAuthenticated','killProcess','exports','express','Router'];(function(_0x390e6c,_0x4d7d42){var _0x596b05=function(_0xe6d4aa){while(--_0xe6d4aa){_0x390e6c['push'](_0x390e6c['shift']());}};_0x596b05(++_0x4d7d42);}(_0x87d6,0x98));var _0x687d=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x87d6[_0x36884e];return _0x1cc367;};'use strict';var express=require(_0x687d('0x0'));var router=express[_0x687d('0x1')]();var auth=require(_0x687d('0x2'));var controller=require('./system.controller');router[_0x687d('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0x687d('0x3')]('/process/:pid/kill',auth[_0x687d('0x4')](),controller[_0x687d('0x5')]);module[_0x687d('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index ee59113..6123a89 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 _0x5c33=['name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect'];(function(_0xa010c1,_0x3dc335){var _0xd51b04=function(_0x292584){while(--_0x292584){_0xa010c1['push'](_0xa010c1['shift']());}};_0xd51b04(++_0x3dc335);}(_0x5c33,0x1f4));var _0x35c3=function(_0x3ae98b,_0x294260){_0x3ae98b=_0x3ae98b-0x0;var _0x1ac2b2=_0x5c33[_0x3ae98b];return _0x1ac2b2;};'use strict';var info=require(_0x35c3('0x0'));var exec=require(_0x35c3('0x1'))[_0x35c3('0x2')];var logger=require(_0x35c3('0x3'))(_0x35c3('0x4'));var util=require(_0x35c3('0x5'));var BPromise=require(_0x35c3('0x6'));var _=require(_0x35c3('0x7'));function handleError(_0x293649,_0x4e25cb,_0x3a03be){_0x4e25cb=_0x4e25cb||0x1f4;return function(_0x54d3f1){logger['error'](_0x35c3('0x8'),_0x3a03be,_0x4e25cb,util[_0x35c3('0x9')](_0x54d3f1,{'showHidden':![],'depth':null}));delete _0x54d3f1[_0x35c3('0xa')];_0x293649[_0x35c3('0xb')](_0x4e25cb)[_0x35c3('0xc')](_0x54d3f1);};}exports[_0x35c3('0xd')]=function(_0x2bd136,_0x6dfcf8){return info[_0x35c3('0xe')]()[_0x35c3('0xf')](function(_0x4e3d53){return _0x6dfcf8[_0x35c3('0xb')](0xc8)[_0x35c3('0x10')](_0x4e3d53);})[_0x35c3('0x11')](function(_0x5aba49){return _0x6dfcf8['status'](0x1f4)['json'](_0x5aba49);});};exports[_0x35c3('0x12')]=function(_0x2ac593,_0x547235){var _0x380b17=[_0x35c3('0x13')];return new BPromise(function(_0x5cffc5,_0x4304d3){return exec(util[_0x35c3('0x14')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x2ac593['params']['pid']),function(_0x2d8241,_0x163053,_0x1575f2){if(_0x2d8241){return _0x4304d3(_0x2d8241);}return _0x5cffc5(_0x163053);});})[_0x35c3('0xf')](function(_0x243839){var _0x4f361a=![];var _0x50e40e=_0x243839[_0x35c3('0x15')](/\n/);for(var _0x2541fb=0x0,_0x3d79e1=_0x380b17[_0x35c3('0x16')];_0x2541fb<_0x3d79e1,_0x4f361a===![];_0x2541fb+=0x1){if(_0x243839[_0x35c3('0x17')](_0x380b17[_0x2541fb])>=0x0){_0x4f361a=!![];}}if(!_0x4f361a){throw new Error(util['format'](_0x35c3('0x18'),_0x2ac593[_0x35c3('0x19')]['pid']));}process[_0x35c3('0x1a')](_0x2ac593[_0x35c3('0x19')][_0x35c3('0x1b')],_0x35c3('0x1c'));return _0x547235['status'](0xc8)[_0x35c3('0x10')]({'message':util[_0x35c3('0x14')](_0x35c3('0x1d'),_0x2ac593['params'][_0x35c3('0x1b')])});})[_0x35c3('0x11')](handleError(_0x547235,null,_0x35c3('0x12')));}; \ No newline at end of file +var _0xd968=['length','Process\x20with\x20pid\x20%s\x20not\x20found!','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','index','getAllData','json','catch','components/import/cm','format','params','pid','then','split'];(function(_0x4fe504,_0x1f0f17){var _0x4f210f=function(_0x37fd4a){while(--_0x37fd4a){_0x4fe504['push'](_0x4fe504['shift']());}};_0x4f210f(++_0x1f0f17);}(_0xd968,0x81));var _0x8d96=function(_0x2dd042,_0x5cfd1d){_0x2dd042=_0x2dd042-0x0;var _0x1b9fbf=_0xd968[_0x2dd042];return _0x1b9fbf;};'use strict';var info=require(_0x8d96('0x0'));var exec=require(_0x8d96('0x1'))[_0x8d96('0x2')];var logger=require(_0x8d96('0x3'))(_0x8d96('0x4'));var util=require(_0x8d96('0x5'));var BPromise=require(_0x8d96('0x6'));var _=require(_0x8d96('0x7'));function handleError(_0x30f1d6,_0x469380,_0x582467){_0x469380=_0x469380||0x1f4;return function(_0x5c32c8){logger['error'](_0x8d96('0x8'),_0x582467,_0x469380,util['inspect'](_0x5c32c8,{'showHidden':![],'depth':null}));delete _0x5c32c8[_0x8d96('0x9')];_0x30f1d6[_0x8d96('0xa')](_0x469380)['send'](_0x5c32c8);};}exports[_0x8d96('0xb')]=function(_0x3b64ad,_0x3dbab7){return info[_0x8d96('0xc')]()['then'](function(_0x1101b0){return _0x3dbab7[_0x8d96('0xa')](0xc8)[_0x8d96('0xd')](_0x1101b0);})[_0x8d96('0xe')](function(_0x4efc96){return _0x3dbab7['status'](0x1f4)[_0x8d96('0xd')](_0x4efc96);});};exports['killProcess']=function(_0x58af72,_0x38e499){var _0x2a85d9=[_0x8d96('0xf')];return new BPromise(function(_0x2370c9,_0xa001c4){return exec(util[_0x8d96('0x10')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x58af72[_0x8d96('0x11')][_0x8d96('0x12')]),function(_0x3a5125,_0x4491a2,_0x1fca02){if(_0x3a5125){return _0xa001c4(_0x3a5125);}return _0x2370c9(_0x4491a2);});})[_0x8d96('0x13')](function(_0x602955){var _0x2316f0=![];var _0x147f83=_0x602955[_0x8d96('0x14')](/\n/);for(var _0xad5786=0x0,_0x57547d=_0x2a85d9[_0x8d96('0x15')];_0xad5786<_0x57547d,_0x2316f0===![];_0xad5786+=0x1){if(_0x602955['indexOf'](_0x2a85d9[_0xad5786])>=0x0){_0x2316f0=!![];}}if(!_0x2316f0){throw new Error(util[_0x8d96('0x10')](_0x8d96('0x16'),_0x58af72[_0x8d96('0x11')][_0x8d96('0x12')]));}process['kill'](_0x58af72[_0x8d96('0x11')][_0x8d96('0x12')],'SIGINT');return _0x38e499[_0x8d96('0xa')](0xc8)[_0x8d96('0xd')]({'message':util[_0x8d96('0x10')](_0x8d96('0x17'),_0x58af72['params']['pid'])});})[_0x8d96('0xe')](handleError(_0x38e499,null,_0x8d96('0x18')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 37fdce9..35caf7d 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 _0xf0a3=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy'];(function(_0x3fc8b7,_0x2849a7){var _0x2f7414=function(_0x59bb4e){while(--_0x59bb4e){_0x3fc8b7['push'](_0x3fc8b7['shift']());}};_0x2f7414(++_0x2849a7);}(_0xf0a3,0x18d));var _0x3f0a=function(_0x11c649,_0x5b7812){_0x11c649=_0x11c649-0x0;var _0xfa2f4b=_0xf0a3[_0x11c649];return _0xfa2f4b;};'use strict';var multer=require('multer');var util=require(_0x3f0a('0x0'));var path=require(_0x3f0a('0x1'));var timeout=require(_0x3f0a('0x2'));var express=require('express');var router=express[_0x3f0a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3f0a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3f0a('0x5'));var controller=require(_0x3f0a('0x6'));router[_0x3f0a('0x7')]('/',auth[_0x3f0a('0x8')](),controller[_0x3f0a('0x9')]);router[_0x3f0a('0x7')](_0x3f0a('0xa'),auth[_0x3f0a('0x8')](),controller[_0x3f0a('0xb')]);router[_0x3f0a('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3f0a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3f0a('0xe')]);router[_0x3f0a('0xf')](_0x3f0a('0xa'),auth[_0x3f0a('0x8')](),controller[_0x3f0a('0x10')]);module[_0x3f0a('0x11')]=router; \ No newline at end of file +var _0x90d0=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy','path'];(function(_0x2e75d7,_0x3c84a1){var _0xad8375=function(_0x410b95){while(--_0x410b95){_0x2e75d7['push'](_0x2e75d7['shift']());}};_0xad8375(++_0x3c84a1);}(_0x90d0,0x10f));var _0x090d=function(_0x61bb05,_0x47421f){_0x61bb05=_0x61bb05-0x0;var _0x3ceb3e=_0x90d0[_0x61bb05];return _0x3ceb3e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x090d('0x0'));var timeout=require(_0x090d('0x1'));var express=require('express');var router=express[_0x090d('0x2')]();var fs_extra=require(_0x090d('0x3'));var auth=require(_0x090d('0x4'));var interaction=require(_0x090d('0x5'));var config=require(_0x090d('0x6'));var controller=require(_0x090d('0x7'));router[_0x090d('0x8')]('/',auth[_0x090d('0x9')](),controller[_0x090d('0xa')]);router[_0x090d('0x8')](_0x090d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x090d('0xc')]('/',auth[_0x090d('0x9')](),controller[_0x090d('0xd')]);router[_0x090d('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x090d('0xf')]);router['delete']('/:id',auth[_0x090d('0x9')](),controller[_0x090d('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 8e6c27b..38ec91a 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 _0xa958=['sequelize','STRING','name','#0091EA'];(function(_0x4b23b0,_0xf3d9b4){var _0x1440d7=function(_0xcbf17b){while(--_0xcbf17b){_0x4b23b0['push'](_0x4b23b0['shift']());}};_0x1440d7(++_0xf3d9b4);}(_0xa958,0x94));var _0x8a95=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa958[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8a95('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a95('0x1')],'unique':_0x8a95('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8a95('0x1')],'defaultValue':_0x8a95('0x3')},'description':{'type':Sequelize[_0x8a95('0x1')]}}; \ No newline at end of file +var _0x7366=['name','#0091EA','sequelize','exports','STRING'];(function(_0x428000,_0x4cbf82){var _0x1cfec8=function(_0xcb2041){while(--_0xcb2041){_0x428000['push'](_0x428000['shift']());}};_0x1cfec8(++_0x4cbf82);}(_0x7366,0x9d));var _0x6736=function(_0x3d20d1,_0x5bdb8a){_0x3d20d1=_0x3d20d1-0x0;var _0x4d28a0=_0x7366[_0x3d20d1];return _0x4d28a0;};'use strict';var Sequelize=require(_0x6736('0x0'));module[_0x6736('0x1')]={'name':{'type':Sequelize[_0x6736('0x2')],'unique':_0x6736('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x6736('0x2')],'defaultValue':_0x6736('0x4')},'description':{'type':Sequelize[_0x6736('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 54c951c..1b8040c 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 _0x8ce3=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','autoAssociation','UserProfileResource','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0x8ce3,0xc3));var _0x38ce=function(_0x15df7f,_0x318875){_0x15df7f=_0x15df7f-0x0;var _0x2cb715=_0x8ce3[_0x15df7f];return _0x2cb715;};'use strict';var emlformat=require(_0x38ce('0x0'));var rimraf=require(_0x38ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38ce('0x2'));var rp=require(_0x38ce('0x3'));var moment=require(_0x38ce('0x4'));var BPromise=require(_0x38ce('0x5'));var Mustache=require(_0x38ce('0x6'));var util=require(_0x38ce('0x7'));var path=require(_0x38ce('0x8'));var sox=require(_0x38ce('0x9'));var csv=require('to-csv');var ejs=require(_0x38ce('0xa'));var fs=require('fs');var fs_extra=require(_0x38ce('0xb'));var _=require('lodash');var squel=require(_0x38ce('0xc'));var crypto=require(_0x38ce('0xd'));var jsforce=require(_0x38ce('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x38ce('0xf'));var querystring=require('querystring');var Papa=require(_0x38ce('0x10'));var Redis=require('ioredis');var authService=require(_0x38ce('0x11'));var qs=require(_0x38ce('0x12'));var as=require(_0x38ce('0x13'));var hardwareService=require(_0x38ce('0x14'));var logger=require(_0x38ce('0x15'))(_0x38ce('0x16'));var utils=require(_0x38ce('0x17'));var config=require(_0x38ce('0x18'));var licenseUtil=require(_0x38ce('0x19'));var db=require(_0x38ce('0x1a'))['db'];function respondWithStatusCode(_0x42e234,_0x3ef662){_0x3ef662=_0x3ef662||0xcc;return function(_0x28b554){if(_0x28b554){return _0x42e234[_0x38ce('0x1b')](_0x3ef662);}return _0x42e234[_0x38ce('0x1c')](_0x3ef662)[_0x38ce('0x1d')]();};}function respondWithResult(_0x56a09f,_0x48ba7c){_0x48ba7c=_0x48ba7c||0xc8;return function(_0x3c4d7f){if(_0x3c4d7f){return _0x56a09f[_0x38ce('0x1c')](_0x48ba7c)[_0x38ce('0x1e')](_0x3c4d7f);}};}function respondWithFilteredResult(_0x55be6a,_0x2f3b99){return function(_0x54fcd3){if(_0x54fcd3){var _0x2771ec=typeof _0x2f3b99[_0x38ce('0x1f')]==='undefined'&&typeof _0x2f3b99[_0x38ce('0x20')]===_0x38ce('0x21');var _0x1dfaba=_0x54fcd3['count'];var _0xe4099a=_0x2771ec?0x0:_0x2f3b99[_0x38ce('0x1f')];var _0x3df527=_0x2771ec?_0x54fcd3[_0x38ce('0x22')]:_0x2f3b99[_0x38ce('0x1f')]+_0x2f3b99[_0x38ce('0x20')];var _0x2d4218;if(_0x3df527>=_0x1dfaba){_0x3df527=_0x1dfaba;_0x2d4218=0xc8;}else{_0x2d4218=0xce;}_0x55be6a['status'](_0x2d4218);return _0x55be6a[_0x38ce('0x23')](_0x38ce('0x24'),_0xe4099a+'-'+_0x3df527+'/'+_0x1dfaba)[_0x38ce('0x1e')](_0x54fcd3);}return null;};}function patchUpdates(_0x303391){return function(_0x30b060){try{jsonpatch[_0x38ce('0x25')](_0x30b060,_0x303391,!![]);}catch(_0x323490){return BPromise[_0x38ce('0x26')](_0x323490);}return _0x30b060[_0x38ce('0x27')]();};}function saveUpdates(_0x3cf50b,_0x1aace7){return function(_0x580cf3){if(_0x580cf3){return _0x580cf3[_0x38ce('0x28')](_0x3cf50b)[_0x38ce('0x29')](function(_0xe40e9c){return _0xe40e9c;});}return null;};}function removeEntity(_0xcf5d9e,_0x4a56b0){return function(_0x2c85e6){if(_0x2c85e6){return _0x2c85e6[_0x38ce('0x2a')]()['then'](function(){var _0xe0af00=_0x2c85e6[_0x38ce('0x2b')]({'plain':!![]});var _0x43b479='Tags';return db['UserProfileResource'][_0x38ce('0x2a')]({'where':{'type':_0x43b479,'resourceId':_0xe0af00['id']}})[_0x38ce('0x29')](function(){return _0x2c85e6;});})[_0x38ce('0x29')](function(){_0xcf5d9e[_0x38ce('0x1c')](0xcc)[_0x38ce('0x1d')]();});}};}function handleEntityNotFound(_0x2a59fe,_0x13e2fc){return function(_0xce1f64){if(!_0xce1f64){_0x2a59fe[_0x38ce('0x1b')](0x194);}return _0xce1f64;};}function handleError(_0x4649be,_0xfc590a){_0xfc590a=_0xfc590a||0x1f4;return function(_0x381703){logger['error'](_0x381703[_0x38ce('0x2c')]);if(_0x381703[_0x38ce('0x2d')]){delete _0x381703['name'];}_0x4649be[_0x38ce('0x1c')](_0xfc590a)[_0x38ce('0x2e')](_0x381703);};}exports['index']=function(_0xd96d33,_0x282ee4){var _0x568d94={},_0x28d775={},_0x53f2c9={'count':0x0,'rows':[]};var _0x1aa8fb=_[_0x38ce('0x2f')](db[_0x38ce('0x30')][_0x38ce('0x31')],function(_0x444b93){return{'name':_0x444b93[_0x38ce('0x32')],'type':_0x444b93[_0x38ce('0x33')][_0x38ce('0x34')]};});_0x28d775['model']=_['map'](_0x1aa8fb,_0x38ce('0x2d'));_0x28d775[_0x38ce('0x35')]=_[_0x38ce('0x36')](_0xd96d33[_0x38ce('0x35')]);_0x28d775[_0x38ce('0x37')]=_['intersection'](_0x28d775[_0x38ce('0x38')],_0x28d775[_0x38ce('0x35')]);_0x568d94[_0x38ce('0x39')]=_[_0x38ce('0x3a')](_0x28d775[_0x38ce('0x38')],qs[_0x38ce('0x3b')](_0xd96d33[_0x38ce('0x35')]['fields']));_0x568d94[_0x38ce('0x39')]=_0x568d94[_0x38ce('0x39')]['length']?_0x568d94[_0x38ce('0x39')]:_0x28d775[_0x38ce('0x38')];if(!_0xd96d33[_0x38ce('0x35')][_0x38ce('0x3c')](_0x38ce('0x3d'))){_0x568d94[_0x38ce('0x20')]=qs[_0x38ce('0x20')](_0xd96d33[_0x38ce('0x35')]['limit']);_0x568d94[_0x38ce('0x1f')]=qs[_0x38ce('0x1f')](_0xd96d33[_0x38ce('0x35')][_0x38ce('0x1f')]);}_0x568d94['order']=qs[_0x38ce('0x3e')](_0xd96d33['query'][_0x38ce('0x3e')]);_0x568d94[_0x38ce('0x3f')]=qs[_0x38ce('0x37')](_[_0x38ce('0x40')](_0xd96d33[_0x38ce('0x35')],_0x28d775[_0x38ce('0x37')]),_0x1aa8fb);if(_0xd96d33['query'][_0x38ce('0x41')]){_0x568d94['where']=_[_0x38ce('0x42')](_0x568d94[_0x38ce('0x3f')],{'$or':_[_0x38ce('0x2f')](_0x1aa8fb,function(_0x37b738){if(_0x37b738[_0x38ce('0x33')]!==_0x38ce('0x43')){var _0x5209ee={};_0x5209ee[_0x37b738[_0x38ce('0x2d')]]={'$like':'%'+_0xd96d33[_0x38ce('0x35')][_0x38ce('0x41')]+'%'};return _0x5209ee;}})});}_0x568d94=_[_0x38ce('0x42')]({},_0x568d94,_0xd96d33[_0x38ce('0x44')]);var _0x467d3e={'where':_0x568d94['where']};return db['Tag'][_0x38ce('0x22')](_0x467d3e)[_0x38ce('0x29')](function(_0x174c86){_0x53f2c9[_0x38ce('0x22')]=_0x174c86;if(_0xd96d33[_0x38ce('0x35')][_0x38ce('0x45')]){_0x568d94[_0x38ce('0x46')]=[{'all':!![]}];}return db['Tag'][_0x38ce('0x47')](_0x568d94);})[_0x38ce('0x29')](function(_0x5a689b){_0x53f2c9[_0x38ce('0x48')]=_0x5a689b;return _0x53f2c9;})[_0x38ce('0x29')](respondWithFilteredResult(_0x282ee4,_0x568d94))[_0x38ce('0x49')](handleError(_0x282ee4,null));};exports['show']=function(_0xaf99ce,_0xd95bc8){var _0x33f6a6={'raw':!![],'where':{'id':_0xaf99ce[_0x38ce('0x4a')]['id']}},_0x981068={};_0x981068[_0x38ce('0x38')]=_['keys'](db[_0x38ce('0x30')][_0x38ce('0x31')]);_0x981068[_0x38ce('0x35')]=_[_0x38ce('0x36')](_0xaf99ce[_0x38ce('0x35')]);_0x981068[_0x38ce('0x37')]=_['intersection'](_0x981068[_0x38ce('0x38')],_0x981068[_0x38ce('0x35')]);_0x33f6a6['attributes']=_['intersection'](_0x981068['model'],qs[_0x38ce('0x3b')](_0xaf99ce[_0x38ce('0x35')]['fields']));_0x33f6a6['attributes']=_0x33f6a6[_0x38ce('0x39')]['length']?_0x33f6a6[_0x38ce('0x39')]:_0x981068['model'];if(_0xaf99ce[_0x38ce('0x35')][_0x38ce('0x45')]){_0x33f6a6['include']=[{'all':!![]}];}_0x33f6a6=_[_0x38ce('0x42')]({},_0x33f6a6,_0xaf99ce[_0x38ce('0x44')]);return db['Tag'][_0x38ce('0x4b')](_0x33f6a6)[_0x38ce('0x29')](handleEntityNotFound(_0xd95bc8,null))[_0x38ce('0x29')](respondWithResult(_0xd95bc8,null))[_0x38ce('0x49')](handleError(_0xd95bc8,null));};exports[_0x38ce('0x4c')]=function(_0x25a299,_0x58cc6f){return db[_0x38ce('0x30')][_0x38ce('0x4c')](_0x25a299['body'],{})[_0x38ce('0x29')](function(_0x316eec){var _0x429517=_0x25a299[_0x38ce('0x4d')][_0x38ce('0x2b')]({'plain':!![]});if(!_0x429517)throw new Error(_0x38ce('0x4e'));if(_0x429517[_0x38ce('0x4f')]==='user'){var _0x3e1522=_0x316eec[_0x38ce('0x2b')]({'plain':!![]});var _0x3f88df=_0x38ce('0x50');return db[_0x38ce('0x51')][_0x38ce('0x4b')]({'where':{'name':_0x3f88df,'userProfileId':_0x429517['userProfileId']},'raw':!![]})['then'](function(_0xc2c9d3){if(_0xc2c9d3&&_0xc2c9d3[_0x38ce('0x52')]===0x0){return db[_0x38ce('0x53')][_0x38ce('0x4c')]({'name':_0x3e1522[_0x38ce('0x2d')],'resourceId':_0x3e1522['id'],'type':_0xc2c9d3[_0x38ce('0x2d')],'sectionId':_0xc2c9d3['id']},{})['then'](function(){return _0x316eec;});}else{return _0x316eec;}})['catch'](function(_0x199c5b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x199c5b);throw _0x199c5b;});}return _0x316eec;})[_0x38ce('0x29')](respondWithResult(_0x58cc6f,0xc9))[_0x38ce('0x49')](handleError(_0x58cc6f,null));};exports[_0x38ce('0x28')]=function(_0xbe5626,_0xd031c0){if(_0xbe5626['body']['id']){delete _0xbe5626[_0x38ce('0x54')]['id'];}return db[_0x38ce('0x30')][_0x38ce('0x4b')]({'where':{'id':_0xbe5626[_0x38ce('0x4a')]['id']}})[_0x38ce('0x29')](handleEntityNotFound(_0xd031c0,null))[_0x38ce('0x29')](saveUpdates(_0xbe5626[_0x38ce('0x54')],null))[_0x38ce('0x29')](respondWithResult(_0xd031c0,null))[_0x38ce('0x49')](handleError(_0xd031c0,null));};exports[_0x38ce('0x2a')]=function(_0x2db125,_0x56d63e){return db['Tag'][_0x38ce('0x4b')]({'where':{'id':_0x2db125[_0x38ce('0x4a')]['id']}})[_0x38ce('0x29')](handleEntityNotFound(_0x56d63e,null))[_0x38ce('0x29')](removeEntity(_0x56d63e,null))['catch'](handleError(_0x56d63e,null));}; \ No newline at end of file +var _0xd382=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','create','body','user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Tags','UserProfileResource','destroy','name','send','map','Tag','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0xf61c79,_0x43c6fa){var _0x127d26=function(_0x598bf6){while(--_0x598bf6){_0xf61c79['push'](_0xf61c79['shift']());}};_0x127d26(++_0x43c6fa);}(_0xd382,0x1b6));var _0x2d38=function(_0x54c0f8,_0x2759ad){_0x54c0f8=_0x54c0f8-0x0;var _0x4a7ea3=_0xd382[_0x54c0f8];return _0x4a7ea3;};'use strict';var emlformat=require(_0x2d38('0x0'));var rimraf=require(_0x2d38('0x1'));var zipdir=require(_0x2d38('0x2'));var jsonpatch=require(_0x2d38('0x3'));var rp=require(_0x2d38('0x4'));var moment=require(_0x2d38('0x5'));var BPromise=require(_0x2d38('0x6'));var Mustache=require(_0x2d38('0x7'));var util=require(_0x2d38('0x8'));var path=require(_0x2d38('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d38('0xa'));var _=require(_0x2d38('0xb'));var squel=require('squel');var crypto=require(_0x2d38('0xc'));var jsforce=require(_0x2d38('0xd'));var deskjs=require(_0x2d38('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2d38('0xf'));var Redis=require(_0x2d38('0x10'));var authService=require(_0x2d38('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2d38('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d38('0x13'))(_0x2d38('0x14'));var utils=require(_0x2d38('0x15'));var config=require(_0x2d38('0x16'));var licenseUtil=require(_0x2d38('0x17'));var db=require(_0x2d38('0x18'))['db'];function respondWithStatusCode(_0x3c068b,_0x4ed69b){_0x4ed69b=_0x4ed69b||0xcc;return function(_0x3dd2c1){if(_0x3dd2c1){return _0x3c068b[_0x2d38('0x19')](_0x4ed69b);}return _0x3c068b[_0x2d38('0x1a')](_0x4ed69b)[_0x2d38('0x1b')]();};}function respondWithResult(_0x149ac2,_0x5cc0a4){_0x5cc0a4=_0x5cc0a4||0xc8;return function(_0x1c7c1d){if(_0x1c7c1d){return _0x149ac2[_0x2d38('0x1a')](_0x5cc0a4)[_0x2d38('0x1c')](_0x1c7c1d);}};}function respondWithFilteredResult(_0x1a2e74,_0x408141){return function(_0xf346b2){if(_0xf346b2){var _0xc6de5a=typeof _0x408141[_0x2d38('0x1d')]===_0x2d38('0x1e')&&typeof _0x408141[_0x2d38('0x1f')]===_0x2d38('0x1e');var _0x13b3fd=_0xf346b2[_0x2d38('0x20')];var _0x1e3028=_0xc6de5a?0x0:_0x408141[_0x2d38('0x1d')];var _0x9904e0=_0xc6de5a?_0xf346b2['count']:_0x408141[_0x2d38('0x1d')]+_0x408141[_0x2d38('0x1f')];var _0x508b8b;if(_0x9904e0>=_0x13b3fd){_0x9904e0=_0x13b3fd;_0x508b8b=0xc8;}else{_0x508b8b=0xce;}_0x1a2e74[_0x2d38('0x1a')](_0x508b8b);return _0x1a2e74[_0x2d38('0x21')](_0x2d38('0x22'),_0x1e3028+'-'+_0x9904e0+'/'+_0x13b3fd)['json'](_0xf346b2);}return null;};}function patchUpdates(_0x46f8be){return function(_0x5ed42e){try{jsonpatch['apply'](_0x5ed42e,_0x46f8be,!![]);}catch(_0xed190){return BPromise[_0x2d38('0x23')](_0xed190);}return _0x5ed42e[_0x2d38('0x24')]();};}function saveUpdates(_0x3892a5,_0x19e658){return function(_0x3138bc){if(_0x3138bc){return _0x3138bc[_0x2d38('0x25')](_0x3892a5)[_0x2d38('0x26')](function(_0x24e2cb){return _0x24e2cb;});}return null;};}function removeEntity(_0x383a0e,_0x584e1f){return function(_0x3283b4){if(_0x3283b4){return _0x3283b4['destroy']()[_0x2d38('0x26')](function(){var _0x530fd9=_0x3283b4[_0x2d38('0x27')]({'plain':!![]});var _0xfa9bd=_0x2d38('0x28');return db[_0x2d38('0x29')][_0x2d38('0x2a')]({'where':{'type':_0xfa9bd,'resourceId':_0x530fd9['id']}})[_0x2d38('0x26')](function(){return _0x3283b4;});})[_0x2d38('0x26')](function(){_0x383a0e['status'](0xcc)[_0x2d38('0x1b')]();});}};}function handleEntityNotFound(_0x3f0f7a,_0x34599a){return function(_0x3d18cd){if(!_0x3d18cd){_0x3f0f7a[_0x2d38('0x19')](0x194);}return _0x3d18cd;};}function handleError(_0xe73710,_0x81299c){_0x81299c=_0x81299c||0x1f4;return function(_0x3a6437){logger['error'](_0x3a6437['stack']);if(_0x3a6437['name']){delete _0x3a6437[_0x2d38('0x2b')];}_0xe73710[_0x2d38('0x1a')](_0x81299c)[_0x2d38('0x2c')](_0x3a6437);};}exports['index']=function(_0x29a38c,_0x4b5891){var _0x2b84cc={},_0x210283={},_0x11e27b={'count':0x0,'rows':[]};var _0x4e8674=_[_0x2d38('0x2d')](db[_0x2d38('0x2e')][_0x2d38('0x2f')],function(_0x52a3ce){return{'name':_0x52a3ce[_0x2d38('0x30')],'type':_0x52a3ce[_0x2d38('0x31')][_0x2d38('0x32')]};});_0x210283[_0x2d38('0x33')]=_[_0x2d38('0x2d')](_0x4e8674,_0x2d38('0x2b'));_0x210283['query']=_[_0x2d38('0x34')](_0x29a38c[_0x2d38('0x35')]);_0x210283[_0x2d38('0x36')]=_[_0x2d38('0x37')](_0x210283['model'],_0x210283[_0x2d38('0x35')]);_0x2b84cc[_0x2d38('0x38')]=_[_0x2d38('0x37')](_0x210283[_0x2d38('0x33')],qs[_0x2d38('0x39')](_0x29a38c[_0x2d38('0x35')][_0x2d38('0x39')]));_0x2b84cc[_0x2d38('0x38')]=_0x2b84cc[_0x2d38('0x38')][_0x2d38('0x3a')]?_0x2b84cc['attributes']:_0x210283['model'];if(!_0x29a38c[_0x2d38('0x35')][_0x2d38('0x3b')](_0x2d38('0x3c'))){_0x2b84cc[_0x2d38('0x1f')]=qs[_0x2d38('0x1f')](_0x29a38c[_0x2d38('0x35')][_0x2d38('0x1f')]);_0x2b84cc[_0x2d38('0x1d')]=qs[_0x2d38('0x1d')](_0x29a38c[_0x2d38('0x35')][_0x2d38('0x1d')]);}_0x2b84cc[_0x2d38('0x3d')]=qs[_0x2d38('0x3e')](_0x29a38c['query'][_0x2d38('0x3e')]);_0x2b84cc[_0x2d38('0x3f')]=qs[_0x2d38('0x36')](_[_0x2d38('0x40')](_0x29a38c['query'],_0x210283[_0x2d38('0x36')]),_0x4e8674);if(_0x29a38c[_0x2d38('0x35')][_0x2d38('0x41')]){_0x2b84cc[_0x2d38('0x3f')]=_[_0x2d38('0x42')](_0x2b84cc[_0x2d38('0x3f')],{'$or':_[_0x2d38('0x2d')](_0x4e8674,function(_0x1084a5){if(_0x1084a5[_0x2d38('0x31')]!==_0x2d38('0x43')){var _0x3cd072={};_0x3cd072[_0x1084a5[_0x2d38('0x2b')]]={'$like':'%'+_0x29a38c[_0x2d38('0x35')][_0x2d38('0x41')]+'%'};return _0x3cd072;}})});}_0x2b84cc=_['merge']({},_0x2b84cc,_0x29a38c[_0x2d38('0x44')]);var _0x1db297={'where':_0x2b84cc['where']};return db['Tag'][_0x2d38('0x20')](_0x1db297)[_0x2d38('0x26')](function(_0x28110c){_0x11e27b['count']=_0x28110c;if(_0x29a38c[_0x2d38('0x35')][_0x2d38('0x45')]){_0x2b84cc[_0x2d38('0x46')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x2b84cc);})[_0x2d38('0x26')](function(_0x59de7d){_0x11e27b[_0x2d38('0x47')]=_0x59de7d;return _0x11e27b;})[_0x2d38('0x26')](respondWithFilteredResult(_0x4b5891,_0x2b84cc))[_0x2d38('0x48')](handleError(_0x4b5891,null));};exports['show']=function(_0x50cb25,_0x166af1){var _0x907c4f={'raw':!![],'where':{'id':_0x50cb25['params']['id']}},_0x306d6d={};_0x306d6d[_0x2d38('0x33')]=_[_0x2d38('0x34')](db[_0x2d38('0x2e')]['rawAttributes']);_0x306d6d[_0x2d38('0x35')]=_[_0x2d38('0x34')](_0x50cb25[_0x2d38('0x35')]);_0x306d6d['filters']=_['intersection'](_0x306d6d[_0x2d38('0x33')],_0x306d6d[_0x2d38('0x35')]);_0x907c4f[_0x2d38('0x38')]=_[_0x2d38('0x37')](_0x306d6d['model'],qs[_0x2d38('0x39')](_0x50cb25[_0x2d38('0x35')][_0x2d38('0x39')]));_0x907c4f['attributes']=_0x907c4f[_0x2d38('0x38')]['length']?_0x907c4f['attributes']:_0x306d6d[_0x2d38('0x33')];if(_0x50cb25[_0x2d38('0x35')][_0x2d38('0x45')]){_0x907c4f[_0x2d38('0x46')]=[{'all':!![]}];}_0x907c4f=_['merge']({},_0x907c4f,_0x50cb25['options']);return db[_0x2d38('0x2e')]['find'](_0x907c4f)[_0x2d38('0x26')](handleEntityNotFound(_0x166af1,null))[_0x2d38('0x26')](respondWithResult(_0x166af1,null))[_0x2d38('0x48')](handleError(_0x166af1,null));};exports[_0x2d38('0x49')]=function(_0x35a2ae,_0x1b94de){return db[_0x2d38('0x2e')][_0x2d38('0x49')](_0x35a2ae[_0x2d38('0x4a')],{})['then'](function(_0x218c61){var _0x481320=_0x35a2ae[_0x2d38('0x4b')][_0x2d38('0x27')]({'plain':!![]});if(!_0x481320)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x481320[_0x2d38('0x4c')]===_0x2d38('0x4b')){var _0x187ba3=_0x218c61[_0x2d38('0x27')]({'plain':!![]});var _0x275078=_0x2d38('0x28');return db[_0x2d38('0x4d')][_0x2d38('0x4e')]({'where':{'name':_0x275078,'userProfileId':_0x481320['userProfileId']},'raw':!![]})[_0x2d38('0x26')](function(_0x8d781e){if(_0x8d781e&&_0x8d781e[_0x2d38('0x4f')]===0x0){return db[_0x2d38('0x29')][_0x2d38('0x49')]({'name':_0x187ba3[_0x2d38('0x2b')],'resourceId':_0x187ba3['id'],'type':_0x8d781e[_0x2d38('0x2b')],'sectionId':_0x8d781e['id']},{})[_0x2d38('0x26')](function(){return _0x218c61;});}else{return _0x218c61;}})[_0x2d38('0x48')](function(_0x5c7dd5){logger[_0x2d38('0x50')](_0x2d38('0x51'),_0x5c7dd5);throw _0x5c7dd5;});}return _0x218c61;})['then'](respondWithResult(_0x1b94de,0xc9))['catch'](handleError(_0x1b94de,null));};exports[_0x2d38('0x25')]=function(_0x5ba127,_0x208ae0){if(_0x5ba127[_0x2d38('0x4a')]['id']){delete _0x5ba127['body']['id'];}return db['Tag'][_0x2d38('0x4e')]({'where':{'id':_0x5ba127[_0x2d38('0x52')]['id']}})[_0x2d38('0x26')](handleEntityNotFound(_0x208ae0,null))[_0x2d38('0x26')](saveUpdates(_0x5ba127[_0x2d38('0x4a')],null))[_0x2d38('0x26')](respondWithResult(_0x208ae0,null))[_0x2d38('0x48')](handleError(_0x208ae0,null));};exports[_0x2d38('0x2a')]=function(_0x1348f8,_0x24c107){return db[_0x2d38('0x2e')]['find']({'where':{'id':_0x1348f8[_0x2d38('0x52')]['id']}})['then'](handleEntityNotFound(_0x24c107,null))['then'](removeEntity(_0x24c107,null))[_0x2d38('0x48')](handleError(_0x24c107,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 6dada1b..ea4046a 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 _0x305c=['moment','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','api'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x305c,0x103));var _0xc305=function(_0x2b6c01,_0x4a1d39){_0x2b6c01=_0x2b6c01-0x0;var _0x4c051e=_0x305c[_0x2b6c01];return _0x4c051e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc305('0x0'));var moment=require(_0xc305('0x1'));var BPromise=require(_0xc305('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc305('0x3'));var rimraf=require(_0xc305('0x4'));var config=require(_0xc305('0x5'));var attributes=require(_0xc305('0x6'));module[_0xc305('0x7')]=function(_0x8ad5b6,_0x5a9275){return _0x8ad5b6[_0xc305('0x8')](_0xc305('0x9'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f0c=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./tag.attributes','define','Tag','tools_tags','lodash'];(function(_0x4e0a52,_0x349821){var _0x1fd213=function(_0x4651bd){while(--_0x4651bd){_0x4e0a52['push'](_0x4e0a52['shift']());}};_0x1fd213(++_0x349821);}(_0x0f0c,0xaf));var _0xc0f0=function(_0x203536,_0x2189a1){_0x203536=_0x203536-0x0;var _0x897e83=_0x0f0c[_0x203536];return _0x897e83;};'use strict';var _=require(_0xc0f0('0x0'));var util=require('util');var logger=require(_0xc0f0('0x1'))(_0xc0f0('0x2'));var moment=require(_0xc0f0('0x3'));var BPromise=require(_0xc0f0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc0f0('0x5'));var config=require(_0xc0f0('0x6'));var attributes=require(_0xc0f0('0x7'));module['exports']=function(_0x471a2f,_0x57a5d3){return _0x471a2f[_0xc0f0('0x8')](_0xc0f0('0x9'),attributes,{'tableName':_0xc0f0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 274ab67..221c95c 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 _0x9335=['error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3f0bc9,_0x5ad2a8){var _0x1d334d=function(_0x12563f){while(--_0x12563f){_0x3f0bc9['push'](_0x3f0bc9['shift']());}};_0x1d334d(++_0x5ad2a8);}(_0x9335,0xab));var _0x5933=function(_0x3476c7,_0xa8ab14){_0x3476c7=_0x3476c7-0x0;var _0x1101dd=_0x9335[_0x3476c7];return _0x1101dd;};'use strict';var _=require(_0x5933('0x0'));var util=require(_0x5933('0x1'));var moment=require('moment');var BPromise=require(_0x5933('0x2'));var rs=require(_0x5933('0x3'));var fs=require('fs');var Redis=require(_0x5933('0x4'));var db=require(_0x5933('0x5'))['db'];var utils=require(_0x5933('0x6'));var logger=require(_0x5933('0x7'))(_0x5933('0x8'));var config=require('../../config/environment');var jayson=require(_0x5933('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21f4c1,_0x3f15fc,_0x21ab46){return new BPromise(function(_0x59c5cb,_0x2ad740){return client[_0x5933('0xa')](_0x21f4c1,_0x21ab46)[_0x5933('0xb')](function(_0xbcd6bb){logger[_0x5933('0xc')](_0x5933('0xd'),_0x3f15fc,_0x5933('0xe'));logger[_0x5933('0xf')](_0x5933('0x10'),_0x3f15fc,_0x5933('0xe'),JSON[_0x5933('0x11')](_0xbcd6bb));if(_0xbcd6bb[_0x5933('0x12')]){if(_0xbcd6bb[_0x5933('0x12')]['code']===0x1f4){logger[_0x5933('0x12')]('Tag,\x20%s,\x20%s',_0x3f15fc,_0xbcd6bb[_0x5933('0x12')][_0x5933('0x13')]);return _0x2ad740(_0xbcd6bb[_0x5933('0x12')]['message']);}logger[_0x5933('0x12')]('Tag,\x20%s,\x20%s',_0x3f15fc,_0xbcd6bb[_0x5933('0x12')]['message']);return _0x59c5cb(_0xbcd6bb[_0x5933('0x12')]['message']);}else{logger[_0x5933('0xc')]('Tag,\x20%s,\x20%s',_0x3f15fc,_0x5933('0xe'));_0x59c5cb(_0xbcd6bb[_0x5933('0x14')][_0x5933('0x13')]);}})['catch'](function(_0x48dc5b){logger[_0x5933('0x12')](_0x5933('0xd'),_0x3f15fc,_0x48dc5b);_0x2ad740(_0x48dc5b);});});} \ No newline at end of file +var _0xed1f=['request','then','info','Tag,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x396945,_0x5268a0){var _0x55e0c7=function(_0x275e3f){while(--_0x275e3f){_0x396945['push'](_0x396945['shift']());}};_0x55e0c7(++_0x5268a0);}(_0xed1f,0x6a));var _0xfed1=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xed1f[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){return client[_0xfed1('0xe')](_0x380e18,_0x2a6082)[_0xfed1('0xf')](function(_0x48862d){logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,'request\x20sent');logger[_0xfed1('0x12')]('Tag,\x20%s,\x20%s,\x20%s',_0x612b38,_0xfed1('0x13'),JSON[_0xfed1('0x14')](_0x48862d));if(_0x48862d['error']){if(_0x48862d['error'][_0xfed1('0x15')]===0x1f4){logger[_0xfed1('0x16')]('Tag,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('Tag,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x2967ef(_0x48862d['error'][_0xfed1('0x17')]);}else{logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,_0xfed1('0x13'));_0x2967ef(_0x48862d['result'][_0xfed1('0x17')]);}})['catch'](function(_0x36ff34){logger[_0xfed1('0x16')]('Tag,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 27cb4bb..b3b9b45 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(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 fa441ce..3799a50 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 _0xbaf0=['name','exports','STRING'];(function(_0x187718,_0x427383){var _0x29ddf4=function(_0x2ec62a){while(--_0x2ec62a){_0x187718['push'](_0x187718['shift']());}};_0x29ddf4(++_0x427383);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0xe706=['STRING','sequelize','exports'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xe706,0xa3));var _0x6e70=function(_0x5a300a,_0x198ebb){_0x5a300a=_0x5a300a-0x0;var _0xb2260f=_0xe706[_0x5a300a];return _0xb2260f;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 56288f3..b1a30c2 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 _0xed38=['map','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','merge','filter','options','Team','then','includeAll','include','findAll','catch','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','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','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','isValidChannel','channel','Unknown\x20channel','capitalize','filters','length','order','pick','toLowerCase','Queues','addQueues','findOne','ValidationError','add','ids','removeQueues','remove','isArray','Voice','Chat','Mail','Sms','Openchannel','Whatsapp','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','UserVoicePrefix','spread','removeAgents','Fax','Queue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','update','name','send','index'];(function(_0x43305f,_0x320675){var _0x32a65f=function(_0x3497f9){while(--_0x3497f9){_0x43305f['push'](_0x43305f['shift']());}};_0x32a65f(++_0x320675);}(_0xed38,0x70));var _0x8ed3=function(_0x4ce0fb,_0x2ce5b4){_0x4ce0fb=_0x4ce0fb-0x0;var _0xf04134=_0xed38[_0x4ce0fb];return _0xf04134;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ed3('0x0'));var zipdir=require(_0x8ed3('0x1'));var jsonpatch=require(_0x8ed3('0x2'));var rp=require(_0x8ed3('0x3'));var moment=require(_0x8ed3('0x4'));var BPromise=require(_0x8ed3('0x5'));var Mustache=require(_0x8ed3('0x6'));var util=require(_0x8ed3('0x7'));var path=require(_0x8ed3('0x8'));var sox=require(_0x8ed3('0x9'));var csv=require(_0x8ed3('0xa'));var ejs=require(_0x8ed3('0xb'));var fs=require('fs');var fs_extra=require(_0x8ed3('0xc'));var _=require('lodash');var squel=require(_0x8ed3('0xd'));var crypto=require(_0x8ed3('0xe'));var jsforce=require(_0x8ed3('0xf'));var deskjs=require(_0x8ed3('0x10'));var toCsv=require(_0x8ed3('0xa'));var querystring=require(_0x8ed3('0x11'));var Papa=require('papaparse');var Redis=require(_0x8ed3('0x12'));var authService=require(_0x8ed3('0x13'));var qs=require(_0x8ed3('0x14'));var as=require(_0x8ed3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ed3('0x16'))(_0x8ed3('0x17'));var utils=require(_0x8ed3('0x18'));var config=require(_0x8ed3('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ed3('0x1a'))['db'];config[_0x8ed3('0x1b')]=_[_0x8ed3('0x1c')](config[_0x8ed3('0x1b')],{'host':_0x8ed3('0x1d'),'port':0x18eb});var socket=require(_0x8ed3('0x1e'))(new Redis(config[_0x8ed3('0x1b')]));require(_0x8ed3('0x1f'))[_0x8ed3('0x20')](socket);function respondWithStatusCode(_0x129bd0,_0x120a32){_0x120a32=_0x120a32||0xcc;return function(_0x3178b7){if(_0x3178b7){return _0x129bd0[_0x8ed3('0x21')](_0x120a32);}return _0x129bd0[_0x8ed3('0x22')](_0x120a32)['end']();};}function respondWithResult(_0x3bed2b,_0x3535da){_0x3535da=_0x3535da||0xc8;return function(_0x56e1e3){if(_0x56e1e3){return _0x3bed2b[_0x8ed3('0x22')](_0x3535da)['json'](_0x56e1e3);}};}function respondWithFilteredResult(_0xe62037,_0x1b7b5b){return function(_0x489d0e){if(_0x489d0e){var _0x281082=typeof _0x1b7b5b['offset']===_0x8ed3('0x23')&&typeof _0x1b7b5b[_0x8ed3('0x24')]===_0x8ed3('0x23');var _0x90efe3=_0x489d0e[_0x8ed3('0x25')];var _0x48854e=_0x281082?0x0:_0x1b7b5b[_0x8ed3('0x26')];var _0x11302c=_0x281082?_0x489d0e[_0x8ed3('0x25')]:_0x1b7b5b[_0x8ed3('0x26')]+_0x1b7b5b[_0x8ed3('0x24')];var _0x423fa8;if(_0x11302c>=_0x90efe3){_0x11302c=_0x90efe3;_0x423fa8=0xc8;}else{_0x423fa8=0xce;}_0xe62037[_0x8ed3('0x22')](_0x423fa8);return _0xe62037[_0x8ed3('0x27')](_0x8ed3('0x28'),_0x48854e+'-'+_0x11302c+'/'+_0x90efe3)[_0x8ed3('0x29')](_0x489d0e);}return null;};}function patchUpdates(_0x3d78fb){return function(_0x72e9bb){try{jsonpatch['apply'](_0x72e9bb,_0x3d78fb,!![]);}catch(_0x4f8079){return BPromise[_0x8ed3('0x2a')](_0x4f8079);}return _0x72e9bb['save']();};}function saveUpdates(_0x158c70,_0x5b9c3f){return function(_0x267e21){if(_0x267e21){return _0x267e21[_0x8ed3('0x2b')](_0x158c70)['then'](function(_0x521b1f){return _0x521b1f;});}return null;};}function handleEntityNotFound(_0xf211e7,_0x5955a6){return function(_0x1980e1){if(!_0x1980e1){_0xf211e7[_0x8ed3('0x21')](0x194);}return _0x1980e1;};}function handleError(_0x1495ea,_0x2a523c){_0x2a523c=_0x2a523c||0x1f4;return function(_0x12c547){logger['error'](_0x12c547['stack']);if(_0x12c547[_0x8ed3('0x2c')]){delete _0x12c547[_0x8ed3('0x2c')];}_0x1495ea[_0x8ed3('0x22')](_0x2a523c)[_0x8ed3('0x2d')](_0x12c547);};}exports[_0x8ed3('0x2e')]=function(_0x2fbde4,_0x340f93){var _0x5e59c1={},_0x6b4a86={},_0x4b79a3={'count':0x0,'rows':[]};var _0xb8546=_[_0x8ed3('0x2f')](db['Team'][_0x8ed3('0x30')],function(_0x1811a4){return{'name':_0x1811a4['fieldName'],'type':_0x1811a4[_0x8ed3('0x31')][_0x8ed3('0x32')]};});_0x6b4a86['model']=_['map'](_0xb8546,'name');_0x6b4a86[_0x8ed3('0x33')]=_[_0x8ed3('0x34')](_0x2fbde4['query']);_0x6b4a86['filters']=_[_0x8ed3('0x35')](_0x6b4a86[_0x8ed3('0x36')],_0x6b4a86['query']);_0x5e59c1['attributes']=_['intersection'](_0x6b4a86['model'],qs['fields'](_0x2fbde4[_0x8ed3('0x33')][_0x8ed3('0x37')]));_0x5e59c1[_0x8ed3('0x38')]=_0x5e59c1[_0x8ed3('0x38')]['length']?_0x5e59c1[_0x8ed3('0x38')]:_0x6b4a86[_0x8ed3('0x36')];if(!_0x2fbde4['query'][_0x8ed3('0x39')](_0x8ed3('0x3a'))){_0x5e59c1[_0x8ed3('0x24')]=qs[_0x8ed3('0x24')](_0x2fbde4[_0x8ed3('0x33')][_0x8ed3('0x24')]);_0x5e59c1[_0x8ed3('0x26')]=qs[_0x8ed3('0x26')](_0x2fbde4['query']['offset']);}_0x5e59c1['order']=qs[_0x8ed3('0x3b')](_0x2fbde4[_0x8ed3('0x33')]['sort']);_0x5e59c1[_0x8ed3('0x3c')]=qs['filters'](_['pick'](_0x2fbde4[_0x8ed3('0x33')],_0x6b4a86['filters']),_0xb8546);if(_0x2fbde4['query']['filter']){_0x5e59c1[_0x8ed3('0x3c')]=_[_0x8ed3('0x3d')](_0x5e59c1[_0x8ed3('0x3c')],{'$or':_['map'](_0xb8546,function(_0x454ae5){if(_0x454ae5[_0x8ed3('0x31')]!=='VIRTUAL'){var _0x191abe={};_0x191abe[_0x454ae5[_0x8ed3('0x2c')]]={'$like':'%'+_0x2fbde4[_0x8ed3('0x33')][_0x8ed3('0x3e')]+'%'};return _0x191abe;}})});}_0x5e59c1=_[_0x8ed3('0x3d')]({},_0x5e59c1,_0x2fbde4[_0x8ed3('0x3f')]);var _0x3373d2={'where':_0x5e59c1['where']};return db[_0x8ed3('0x40')][_0x8ed3('0x25')](_0x3373d2)[_0x8ed3('0x41')](function(_0x3f0563){_0x4b79a3[_0x8ed3('0x25')]=_0x3f0563;if(_0x2fbde4[_0x8ed3('0x33')][_0x8ed3('0x42')]){_0x5e59c1[_0x8ed3('0x43')]=[{'all':!![]}];}return db['Team'][_0x8ed3('0x44')](_0x5e59c1);})[_0x8ed3('0x41')](function(_0x350dbd){_0x4b79a3['rows']=_0x350dbd;return _0x4b79a3;})[_0x8ed3('0x41')](respondWithFilteredResult(_0x340f93,_0x5e59c1))[_0x8ed3('0x45')](handleError(_0x340f93,null));};exports['show']=function(_0x3667c4,_0x466ace){var _0x23e76a={'raw':![],'where':{'id':_0x3667c4[_0x8ed3('0x46')]['id']}},_0x34b209={};_0x34b209['model']=_[_0x8ed3('0x34')](db[_0x8ed3('0x40')][_0x8ed3('0x30')]);_0x34b209[_0x8ed3('0x33')]=_[_0x8ed3('0x34')](_0x3667c4['query']);_0x34b209['filters']=_[_0x8ed3('0x35')](_0x34b209[_0x8ed3('0x36')],_0x34b209[_0x8ed3('0x33')]);_0x23e76a['attributes']=_[_0x8ed3('0x35')](_0x34b209[_0x8ed3('0x36')],qs[_0x8ed3('0x37')](_0x3667c4[_0x8ed3('0x33')][_0x8ed3('0x37')]));_0x23e76a[_0x8ed3('0x38')]=_0x23e76a[_0x8ed3('0x38')]['length']?_0x23e76a['attributes']:_0x34b209[_0x8ed3('0x36')];if(_0x3667c4['query']['includeAll']){_0x23e76a[_0x8ed3('0x43')]=[{'all':!![]}];}_0x23e76a=_[_0x8ed3('0x3d')]({},_0x23e76a,_0x3667c4[_0x8ed3('0x3f')]);return db[_0x8ed3('0x40')][_0x8ed3('0x47')](_0x23e76a)['then'](handleEntityNotFound(_0x466ace,null))['then'](respondWithResult(_0x466ace,null))[_0x8ed3('0x45')](handleError(_0x466ace,null));};exports[_0x8ed3('0x48')]=function(_0x2a2edb,_0x4e503c){return db['Team'][_0x8ed3('0x48')](_0x2a2edb[_0x8ed3('0x49')],{})[_0x8ed3('0x41')](function(_0x58632f){var _0x3e18b6=_0x2a2edb['user'][_0x8ed3('0x4a')]({'plain':!![]});if(!_0x3e18b6)throw new Error(_0x8ed3('0x4b'));if(_0x3e18b6[_0x8ed3('0x4c')]===_0x8ed3('0x4d')){var _0x1031d4=_0x58632f['get']({'plain':!![]});var _0x7c9498=_0x8ed3('0x4e');return db[_0x8ed3('0x4f')][_0x8ed3('0x47')]({'where':{'name':_0x7c9498,'userProfileId':_0x3e18b6[_0x8ed3('0x50')]},'raw':!![]})[_0x8ed3('0x41')](function(_0x45477e){if(_0x45477e&&_0x45477e[_0x8ed3('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x1031d4[_0x8ed3('0x2c')],'resourceId':_0x1031d4['id'],'type':_0x45477e['name'],'sectionId':_0x45477e['id']},{})[_0x8ed3('0x41')](function(){return _0x58632f;});}else{return _0x58632f;}})[_0x8ed3('0x45')](function(_0x3eeef2){logger[_0x8ed3('0x52')](_0x8ed3('0x53'),_0x3eeef2);throw _0x3eeef2;});}return _0x58632f;})[_0x8ed3('0x41')](respondWithResult(_0x4e503c,0xc9))[_0x8ed3('0x45')](handleError(_0x4e503c,null));};exports['update']=function(_0x5243d3,_0x3ed2f4){if(_0x5243d3['body']['id']){delete _0x5243d3[_0x8ed3('0x49')]['id'];}return db[_0x8ed3('0x40')]['find']({'where':{'id':_0x5243d3['params']['id']}})[_0x8ed3('0x41')](handleEntityNotFound(_0x3ed2f4,null))[_0x8ed3('0x41')](saveUpdates(_0x5243d3[_0x8ed3('0x49')],null))[_0x8ed3('0x41')](respondWithResult(_0x3ed2f4,null))[_0x8ed3('0x45')](handleError(_0x3ed2f4,null));};exports['destroy']=function(_0x11caae,_0x5b235c){var _0x4ef2d4=_0x11caae[_0x8ed3('0x46')]['id'];var _0x4dedc7=[];return db[_0x8ed3('0x54')][_0x8ed3('0x55')](function(_0x28c3b6){var _0x5d6822=_0x8ed3('0x56')+_0x4ef2d4;return db[_0x8ed3('0x54')][_0x8ed3('0x33')](_0x5d6822,{'type':db[_0x8ed3('0x57')][_0x8ed3('0x58')][_0x8ed3('0x59')],'raw':!![],'transaction':_0x28c3b6})[_0x8ed3('0x41')](function(_0x1a2639){_0x4dedc7=_['map'](_0x1a2639,function(_0xed360a){return Number(_0xed360a[_0x8ed3('0x5a')]);});})['then'](function(){var _0x33dd34=_0x8ed3('0x5b')+_0x4ef2d4;return db['sequelize'][_0x8ed3('0x33')](_0x33dd34,{'type':db[_0x8ed3('0x57')][_0x8ed3('0x58')][_0x8ed3('0x59')],'raw':!![],'transaction':_0x28c3b6});})[_0x8ed3('0x41')](function(_0x25bf82){var _0x18bdf4=_[_0x8ed3('0x2f')](_0x25bf82,function(_0x5f13c9){return Number(_0x5f13c9[_0x8ed3('0x5c')]);});return db[_0x8ed3('0x5d')][_0x8ed3('0x5e')]({'where':{'UserId':{'$in':_0x4dedc7},'VoiceQueueId':{'$in':_0x18bdf4}},'transaction':_0x28c3b6});})[_0x8ed3('0x41')](function(){var _0x502d7c=_0x8ed3('0x5f')+_0x4ef2d4;return db[_0x8ed3('0x54')][_0x8ed3('0x33')](_0x502d7c,{'type':db[_0x8ed3('0x57')][_0x8ed3('0x58')][_0x8ed3('0x59')],'raw':!![],'transaction':_0x28c3b6});})[_0x8ed3('0x41')](function(_0x37cfee){var _0xafd90f=_[_0x8ed3('0x2f')](_0x37cfee,function(_0x7016cc){return Number(_0x7016cc[_0x8ed3('0x60')]);});return db['UserMailQueue'][_0x8ed3('0x5e')]({'where':{'UserId':{'$in':_0x4dedc7},'MailQueueId':{'$in':_0xafd90f}},'transaction':_0x28c3b6});})['then'](function(){var _0xb8da9='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4ef2d4;return db[_0x8ed3('0x54')]['query'](_0xb8da9,{'type':db['Sequelize'][_0x8ed3('0x58')][_0x8ed3('0x59')],'raw':!![],'transaction':_0x28c3b6});})[_0x8ed3('0x41')](function(_0x8a7596){var _0x6f93de=_[_0x8ed3('0x2f')](_0x8a7596,function(_0x483817){return Number(_0x483817[_0x8ed3('0x61')]);});return db[_0x8ed3('0x62')][_0x8ed3('0x5e')]({'where':{'UserId':{'$in':_0x4dedc7},'SmsQueueId':{'$in':_0x6f93de}},'transaction':_0x28c3b6});})['then'](function(){var _0x21396d=_0x8ed3('0x63')+_0x4ef2d4;return db[_0x8ed3('0x54')][_0x8ed3('0x33')](_0x21396d,{'type':db[_0x8ed3('0x57')]['QueryTypes'][_0x8ed3('0x59')],'raw':!![],'transaction':_0x28c3b6});})[_0x8ed3('0x41')](function(_0x119922){var _0x86af46=_[_0x8ed3('0x2f')](_0x119922,function(_0x26cdd3){return Number(_0x26cdd3[_0x8ed3('0x64')]);});return db['UserChatQueue'][_0x8ed3('0x5e')]({'where':{'UserId':{'$in':_0x4dedc7},'ChatQueueId':{'$in':_0x86af46}},'transaction':_0x28c3b6});})['then'](function(){var _0x379b77=_0x8ed3('0x65')+_0x4ef2d4;return db[_0x8ed3('0x54')][_0x8ed3('0x33')](_0x379b77,{'type':db[_0x8ed3('0x57')][_0x8ed3('0x58')][_0x8ed3('0x59')],'raw':!![],'transaction':_0x28c3b6});})['then'](function(_0x39776a){var _0x192f92=_[_0x8ed3('0x2f')](_0x39776a,function(_0xa2307d){return Number(_0xa2307d[_0x8ed3('0x66')]);});return db[_0x8ed3('0x67')][_0x8ed3('0x5e')]({'where':{'UserId':{'$in':_0x4dedc7},'FaxQueueId':{'$in':_0x192f92}},'transaction':_0x28c3b6});})[_0x8ed3('0x41')](function(){var _0x46f5b7=_0x8ed3('0x68')+_0x4ef2d4;return db[_0x8ed3('0x54')][_0x8ed3('0x33')](_0x46f5b7,{'type':db[_0x8ed3('0x57')][_0x8ed3('0x58')][_0x8ed3('0x59')],'raw':!![],'transaction':_0x28c3b6});})['then'](function(_0x5ea2da){var _0x5e756a=_['map'](_0x5ea2da,function(_0x10e0fa){return Number(_0x10e0fa[_0x8ed3('0x69')]);});return db[_0x8ed3('0x6a')][_0x8ed3('0x5e')]({'where':{'UserId':{'$in':_0x4dedc7},'OpenchannelQueueId':{'$in':_0x5e756a}},'transaction':_0x28c3b6});})[_0x8ed3('0x41')](function(){var _0x2befda=_0x8ed3('0x6b')+_0x4ef2d4;return db[_0x8ed3('0x54')][_0x8ed3('0x33')](_0x2befda,{'type':db[_0x8ed3('0x57')][_0x8ed3('0x58')]['SELECT'],'raw':!![],'transaction':_0x28c3b6});})[_0x8ed3('0x41')](function(_0x6c5eb9){var _0x23dc28=_[_0x8ed3('0x2f')](_0x6c5eb9,function(_0x1aaf76){return Number(_0x1aaf76[_0x8ed3('0x6c')]);});return db[_0x8ed3('0x6d')][_0x8ed3('0x5e')]({'where':{'UserId':{'$in':_0x4dedc7},'WhatsappQueueId':{'$in':_0x23dc28}},'transaction':_0x28c3b6});})['then'](function(){return db[_0x8ed3('0x6e')][_0x8ed3('0x47')]({'where':{'TeamId':_0x4ef2d4}});})[_0x8ed3('0x41')](function(_0x4d4db5){if(_0x4d4db5===null){return;}return db['UserVoicePrefix'][_0x8ed3('0x5e')]({'where':{'UserId':{'$in':_0x4dedc7},'VoicePrefixId':_0x4d4db5[_0x8ed3('0x6f')]},'transaction':_0x28c3b6});})[_0x8ed3('0x41')](function(){return db['Team']['destroy']({'where':{'id':_0x4ef2d4},'cascade':!![],'transaction':_0x28c3b6});})['then'](function(_0x2502e7){if(_0x2502e7===0x0){_0x5b235c[_0x8ed3('0x21')](0x194);}else{return db[_0x8ed3('0x70')]['destroy']({'where':{'type':_0x8ed3('0x4e'),'resourceId':_0x4ef2d4},'cascade':!![],'transaction':_0x28c3b6})[_0x8ed3('0x41')](function(){_0x5b235c[_0x8ed3('0x22')](0xcc)['end']();});}})[_0x8ed3('0x45')](function(_0x51228b){_0x5b235c['status'](0x1f4)[_0x8ed3('0x2d')](_0x51228b);});});};exports[_0x8ed3('0x71')]=function(_0x5dc5be,_0x3c791c,_0x5b8774){return db['Team']['findOne']({'where':{'id':_0x5dc5be[_0x8ed3('0x46')]['id']}})[_0x8ed3('0x41')](handleEntityNotFound(_0x3c791c,null))[_0x8ed3('0x41')](function(_0x1132ea){if(!_0x5dc5be['query']['channel']||!utils[_0x8ed3('0x72')](_0x5dc5be['query'][_0x8ed3('0x73')])){throw new db[(_0x8ed3('0x57'))]['ValidationError'](_0x8ed3('0x74'));}var _0x17d07a={};var _0x1bf662={};_0x1bf662[_0x8ed3('0x36')]=_[_0x8ed3('0x34')](db[_[_0x8ed3('0x75')](_0x5dc5be[_0x8ed3('0x33')]['channel']['toLowerCase']())+'Queue'][_0x8ed3('0x30')]);_0x1bf662[_0x8ed3('0x33')]=_[_0x8ed3('0x34')](_0x5dc5be[_0x8ed3('0x33')]);_0x1bf662[_0x8ed3('0x76')]=_['intersection'](_0x1bf662[_0x8ed3('0x36')],_0x1bf662['query']);_0x17d07a[_0x8ed3('0x38')]=_[_0x8ed3('0x35')](_0x1bf662['model'],qs[_0x8ed3('0x37')](_0x5dc5be[_0x8ed3('0x33')][_0x8ed3('0x37')]));_0x17d07a[_0x8ed3('0x38')]=_0x17d07a['attributes'][_0x8ed3('0x77')]?_0x17d07a[_0x8ed3('0x38')]:_0x1bf662['model'];_0x17d07a['limit']=qs['limit'](_0x5dc5be[_0x8ed3('0x33')][_0x8ed3('0x24')]);_0x17d07a[_0x8ed3('0x26')]=qs['offset'](_0x5dc5be[_0x8ed3('0x33')]['offset']);_0x17d07a[_0x8ed3('0x78')]=qs[_0x8ed3('0x3b')](_0x5dc5be[_0x8ed3('0x33')]['sort']);_0x17d07a[_0x8ed3('0x3c')]=qs['filters'](_[_0x8ed3('0x79')](_0x5dc5be[_0x8ed3('0x33')],_0x1bf662[_0x8ed3('0x76')]));_0x17d07a=_[_0x8ed3('0x3d')]({},_0x17d07a,_0x5dc5be['options']);return _0x1132ea[_0x8ed3('0x4a')+_[_0x8ed3('0x75')](_0x5dc5be[_0x8ed3('0x33')]['channel'][_0x8ed3('0x7a')]())+_0x8ed3('0x7b')](_0x17d07a);})[_0x8ed3('0x41')](respondWithResult(_0x3c791c,null))[_0x8ed3('0x45')](handleError(_0x3c791c,null));};exports[_0x8ed3('0x7c')]=function(_0x5589fd,_0x4b792f,_0x1c7b62){return db[_0x8ed3('0x40')][_0x8ed3('0x7d')]({'where':{'id':_0x5589fd[_0x8ed3('0x46')]['id']}})[_0x8ed3('0x41')](function(_0x53c1d0){if(_0x53c1d0){if(!_0x5589fd[_0x8ed3('0x49')][_0x8ed3('0x73')]||!utils[_0x8ed3('0x72')](_0x5589fd[_0x8ed3('0x49')][_0x8ed3('0x73')])){throw new db[(_0x8ed3('0x57'))][(_0x8ed3('0x7e'))](_0x8ed3('0x74'));}return _0x53c1d0[_0x8ed3('0x7f')+_[_0x8ed3('0x75')](_0x5589fd[_0x8ed3('0x49')]['channel'][_0x8ed3('0x7a')]())+'Queues'](_0x5589fd[_0x8ed3('0x49')][_0x8ed3('0x80')]);}return null;})[_0x8ed3('0x41')](handleEntityNotFound(_0x4b792f,null))['then'](respondWithStatusCode(_0x4b792f,null))['catch'](handleError(_0x4b792f,null));};exports[_0x8ed3('0x81')]=function(_0x43758a,_0x4654a8,_0x46c56c){return db['Team'][_0x8ed3('0x7d')]({'where':{'id':_0x43758a[_0x8ed3('0x46')]['id']}})[_0x8ed3('0x41')](function(_0x398092){if(_0x398092){if(!_0x43758a[_0x8ed3('0x33')][_0x8ed3('0x73')]||!utils[_0x8ed3('0x72')](_0x43758a[_0x8ed3('0x33')][_0x8ed3('0x73')])){throw new db[(_0x8ed3('0x57'))]['ValidationError'](_0x8ed3('0x74'));}return _0x398092[_0x8ed3('0x82')+_['capitalize'](_0x43758a[_0x8ed3('0x33')]['channel']['toLowerCase']())+_0x8ed3('0x7b')](_0x43758a[_0x8ed3('0x33')]['ids']);}return null;})[_0x8ed3('0x41')](handleEntityNotFound(_0x4654a8,null))[_0x8ed3('0x41')](respondWithStatusCode(_0x4654a8,null))[_0x8ed3('0x45')](handleError(_0x4654a8,null));};exports['addAgents']=function(_0x3944f3,_0x2d3d03){var _0x435caa=_[_0x8ed3('0x83')](_0x3944f3['body'][_0x8ed3('0x80')])?_0x3944f3[_0x8ed3('0x49')][_0x8ed3('0x80')]:[_0x3944f3[_0x8ed3('0x49')]['ids']];var _0x139ea0=_0x3944f3[_0x8ed3('0x46')]['id'];return db[_0x8ed3('0x40')][_0x8ed3('0x47')]({'where':{'id':_0x139ea0}})[_0x8ed3('0x41')](handleEntityNotFound(_0x2d3d03,null))[_0x8ed3('0x41')](function(_0x3dad0){if(_0x3dad0){var _0x4b9b7c=[_0x8ed3('0x84'),_0x8ed3('0x85'),_0x8ed3('0x86'),_0x8ed3('0x87'),'Fax',_0x8ed3('0x88'),_0x8ed3('0x89')];return db[_0x8ed3('0x54')]['transaction'](function(_0x571e80){var _0x518b2c=_[_0x8ed3('0x2f')](_0x4b9b7c,function(_0x2a3f47){var _0x43b86f={'attributes':['id','name']};if(_0x2a3f47===_0x8ed3('0x84')){_0x43b86f[_0x8ed3('0x8a')]={'attributes':['penalty']};}return _0x3dad0[_0x8ed3('0x4a')+_0x2a3f47+_0x8ed3('0x7b')](_0x43b86f)[_0x8ed3('0x41')](function(_0x45f961){var _0x1e2895=_[_0x8ed3('0x2f')](_0x45f961,function(_0x3f163f){var _0x4a7670=_[_0x8ed3('0x2f')](_0x435caa,function(_0x42c137){var _0x34f7bf={'where':{'UserId':_0x42c137,[_0x2a3f47+_0x8ed3('0x8b')]:_0x3f163f['id']},'transaction':_0x571e80};if(_0x2a3f47==='Voice'){_0x34f7bf['defaults']={'penalty':_0x3f163f[_0x8ed3('0x8c')][_0x8ed3('0x8d')]};}return db[_0x8ed3('0x8e')+_0x2a3f47+'Queue'][_0x8ed3('0x8f')](_0x34f7bf)['then'](function(){socket[_0x8ed3('0x90')](_0x8ed3('0x4d')+_0x2a3f47+'Queue:save',{'UserId':_0x42c137,[_0x2a3f47+_0x8ed3('0x8b')]:_0x3f163f['id']});if(_0x2a3f47!==_0x8ed3('0x84')){return;}return db[_0x8ed3('0x8e')][_0x8ed3('0x44')]({'where':{'id':_0x435caa,'online':0x1},'attributes':['id',_0x8ed3('0x2c'),'online',_0x8ed3('0x91'),_0x8ed3('0x92')],'raw':!![]})[_0x8ed3('0x41')](function(_0x3b0b25){var _0x5158c2=_[_0x8ed3('0x2f')](_0x3b0b25,function(_0x2dcc52){return db[_0x8ed3('0x93')][_0x8ed3('0x94')]({'membername':_0x2dcc52[_0x8ed3('0x2c')],'UserId':_0x2dcc52['id'],'queue_name':_0x3f163f[_0x8ed3('0x2c')],'VoiceQueueId':_0x3f163f['id'],'interface':_[_0x8ed3('0x95')](_0x2dcc52[_0x8ed3('0x92')])?util[_0x8ed3('0x96')](_0x8ed3('0x97'),_0x2dcc52[_0x8ed3('0x2c')]):_0x2dcc52[_0x8ed3('0x92')],'paused':_0x2dcc52['voicePause']||![],'penalty':_0x3f163f[_0x8ed3('0x8c')][_0x8ed3('0x8d')]},{'transaction':_0x571e80});});return Promise[_0x8ed3('0x98')](_0x5158c2);});});});return Promise[_0x8ed3('0x98')](_0x4a7670);});return Promise[_0x8ed3('0x98')](_0x1e2895);})[_0x8ed3('0x41')](function(){return db[_0x8ed3('0x6e')][_0x8ed3('0x7d')]({'where':{'teamId':_0x139ea0}})['then'](function(_0x5503c1){if(_0x5503c1){var _0xf8d3df=_[_0x8ed3('0x2f')](_0x435caa,function(_0x543836){db[_0x8ed3('0x99')]['upsert']({'UserId':_0x543836,'VoicePrefixId':_0x5503c1[_0x8ed3('0x6f')]});});return Promise[_0x8ed3('0x98')](_0xf8d3df);}});});});return Promise[_0x8ed3('0x98')](_0x518b2c)[_0x8ed3('0x41')](function(){return _0x3dad0['addAgents'](_0x435caa,{'transaction':_0x571e80})[_0x8ed3('0x9a')](function(_0x1290cb){return _0x1290cb;});});});}})[_0x8ed3('0x41')](respondWithResult(_0x2d3d03,null))[_0x8ed3('0x45')](handleError(_0x2d3d03,null));};exports[_0x8ed3('0x9b')]=function(_0x2d14bf,_0x5712f7){var _0x5f2c43=_['isArray'](_0x2d14bf[_0x8ed3('0x33')][_0x8ed3('0x80')])?_0x2d14bf[_0x8ed3('0x33')][_0x8ed3('0x80')]:[_0x2d14bf[_0x8ed3('0x33')]['ids']];var _0x208b42=_0x2d14bf[_0x8ed3('0x46')]['id'];return db[_0x8ed3('0x40')][_0x8ed3('0x47')]({'where':{'id':_0x208b42}})[_0x8ed3('0x41')](handleEntityNotFound(_0x5712f7,null))[_0x8ed3('0x41')](function(_0x59c7e9){if(_0x59c7e9){var _0x1dc5d9=[_0x8ed3('0x84'),_0x8ed3('0x85'),'Mail',_0x8ed3('0x87'),_0x8ed3('0x9c'),_0x8ed3('0x88'),_0x8ed3('0x89')];return db[_0x8ed3('0x54')][_0x8ed3('0x55')](function(_0x452f58){var _0x5a1cf6=_[_0x8ed3('0x2f')](_0x1dc5d9,function(_0x40d425){var _0x435e45={'attributes':['id','name']};return _0x59c7e9[_0x8ed3('0x4a')+_0x40d425+_0x8ed3('0x7b')](_0x435e45)['then'](function(_0x539e54){var _0x2d1d65=_[_0x8ed3('0x2f')](_0x539e54,function(_0x4a71b3){return _0x4a71b3[_0x8ed3('0x9b')](_0x5f2c43,{'transaction':_0x452f58})['then'](function(){var _0x138abb=_['map'](_0x5f2c43,function(_0x4f6b1f){socket[_0x8ed3('0x90')]('user'+_0x40d425+_0x8ed3('0x9d'),{'UserId':Number(_0x4f6b1f),[_0x40d425+_0x8ed3('0x8b')]:_0x4a71b3['id']});if(_0x40d425!==_0x8ed3('0x84')){return;}return db[_0x8ed3('0x93')][_0x8ed3('0x5e')]({'where':{'VoiceQueueId':_0x4a71b3['id'],'UserId':_0x4f6b1f},'transaction':_0x452f58});});return Promise[_0x8ed3('0x98')](_0x138abb);});});return Promise[_0x8ed3('0x98')](_0x2d1d65);});});return Promise[_0x8ed3('0x98')](_0x5a1cf6)[_0x8ed3('0x41')](function(){return _0x59c7e9[_0x8ed3('0x9b')](_0x5f2c43,{'transaction':_0x452f58});})[_0x8ed3('0x41')](function(){return db[_0x8ed3('0x6e')][_0x8ed3('0x7d')]({'where':{'teamId':_0x208b42}})[_0x8ed3('0x41')](function(_0x18aa57){if(_0x18aa57){var _0x55c60e=_['map'](_0x5f2c43,function(_0x2e4bc6){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x2e4bc6,'VoicePrefixId':_0x18aa57[_0x8ed3('0x6f')]}});});return Promise[_0x8ed3('0x98')](_0x55c60e);}});});});}})[_0x8ed3('0x41')](respondWithStatusCode(_0x5712f7,null))[_0x8ed3('0x45')](handleError(_0x5712f7,null));};exports[_0x8ed3('0x9e')]=function(_0xe2ee71,_0x53c589,_0x43bc04){var _0x11dcf4={};var _0x49b770={};var _0x5d99e5;var _0x3acd61;return db[_0x8ed3('0x40')][_0x8ed3('0x7d')]({'where':{'id':_0xe2ee71[_0x8ed3('0x46')]['id']}})['then'](handleEntityNotFound(_0x53c589,null))[_0x8ed3('0x41')](function(_0xf2a6f4){if(_0xf2a6f4){_0x5d99e5=_0xf2a6f4;_0x49b770[_0x8ed3('0x36')]=_[_0x8ed3('0x34')](db[_0x8ed3('0x8e')]['rawAttributes']);_0x49b770[_0x8ed3('0x33')]=_[_0x8ed3('0x34')](_0xe2ee71[_0x8ed3('0x33')]);_0x49b770[_0x8ed3('0x76')]=_['intersection'](_0x49b770['model'],_0x49b770[_0x8ed3('0x33')]);_0x11dcf4[_0x8ed3('0x38')]=_[_0x8ed3('0x35')](_0x49b770[_0x8ed3('0x36')],qs[_0x8ed3('0x37')](_0xe2ee71[_0x8ed3('0x33')][_0x8ed3('0x37')]));_0x11dcf4[_0x8ed3('0x38')]=_0x11dcf4[_0x8ed3('0x38')]['length']?_0x11dcf4[_0x8ed3('0x38')]:_0x49b770[_0x8ed3('0x36')];_0x11dcf4[_0x8ed3('0x78')]=qs[_0x8ed3('0x3b')](_0xe2ee71[_0x8ed3('0x33')][_0x8ed3('0x3b')]);_0x11dcf4[_0x8ed3('0x3c')]=qs[_0x8ed3('0x76')](_[_0x8ed3('0x79')](_0xe2ee71[_0x8ed3('0x33')],_0x49b770[_0x8ed3('0x76')]));if(_0xe2ee71['query'][_0x8ed3('0x3e')]){_0x11dcf4[_0x8ed3('0x3c')]=_['merge'](_0x11dcf4['where'],{'$or':_[_0x8ed3('0x2f')](_0x11dcf4[_0x8ed3('0x38')],function(_0x1cde53){var _0x50d2ac={};_0x50d2ac[_0x1cde53]={'$like':'%'+_0xe2ee71['query']['filter']+'%'};return _0x50d2ac;})});}_0x11dcf4=_[_0x8ed3('0x3d')]({},_0x11dcf4,_0xe2ee71[_0x8ed3('0x3f')]);return _0x5d99e5['getAgents'](_0x11dcf4);}})[_0x8ed3('0x41')](function(_0x381582){if(_0x381582){_0x3acd61=_0x381582[_0x8ed3('0x77')];if(!_0xe2ee71['query'][_0x8ed3('0x39')]('nolimit')){_0x11dcf4[_0x8ed3('0x24')]=qs[_0x8ed3('0x24')](_0xe2ee71['query']['limit']);_0x11dcf4[_0x8ed3('0x26')]=qs['offset'](_0xe2ee71[_0x8ed3('0x33')][_0x8ed3('0x26')]);}return _0x5d99e5[_0x8ed3('0x9e')](_0x11dcf4);}})[_0x8ed3('0x41')](function(_0x1566cd){if(_0x1566cd){return _0x1566cd?{'count':_0x3acd61,'rows':_0x1566cd}:null;}})[_0x8ed3('0x41')](respondWithResult(_0x53c589,null))[_0x8ed3('0x45')](handleError(_0x53c589,null));}; \ No newline at end of file +var _0x9796=['sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','undefined','count','offset','set','json','apply','reject','save','update','then','sendStatus','error','name','send','index','map','Team','rawAttributes','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','user','get','role','Teams','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','addQueues','ids','ValidationError','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','all','VoicePrefixId','spread','removeAgents','Openchannel','emit','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0xd6d2b9,_0x48c95a){var _0x2a51c5=function(_0x5133ce){while(--_0x5133ce){_0xd6d2b9['push'](_0xd6d2b9['shift']());}};_0x2a51c5(++_0x48c95a);}(_0x9796,0x1d7));var _0x6979=function(_0x5af755,_0x16d631){_0x5af755=_0x5af755-0x0;var _0x261c36=_0x9796[_0x5af755];return _0x261c36;};'use strict';var emlformat=require(_0x6979('0x0'));var rimraf=require(_0x6979('0x1'));var zipdir=require(_0x6979('0x2'));var jsonpatch=require(_0x6979('0x3'));var rp=require(_0x6979('0x4'));var moment=require(_0x6979('0x5'));var BPromise=require(_0x6979('0x6'));var Mustache=require(_0x6979('0x7'));var util=require('util');var path=require(_0x6979('0x8'));var sox=require(_0x6979('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6979('0xa'));var _=require(_0x6979('0xb'));var squel=require(_0x6979('0xc'));var crypto=require(_0x6979('0xd'));var jsforce=require(_0x6979('0xe'));var deskjs=require(_0x6979('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6979('0x10'));var Papa=require(_0x6979('0x11'));var Redis=require('ioredis');var authService=require(_0x6979('0x12'));var qs=require(_0x6979('0x13'));var as=require(_0x6979('0x14'));var hardwareService=require(_0x6979('0x15'));var logger=require(_0x6979('0x16'))(_0x6979('0x17'));var utils=require(_0x6979('0x18'));var config=require(_0x6979('0x19'));var licenseUtil=require(_0x6979('0x1a'));var db=require(_0x6979('0x1b'))['db'];config[_0x6979('0x1c')]=_[_0x6979('0x1d')](config['redis'],{'host':_0x6979('0x1e'),'port':0x18eb});var socket=require(_0x6979('0x1f'))(new Redis(config[_0x6979('0x1c')]));require('./team.socket')[_0x6979('0x20')](socket);function respondWithStatusCode(_0x56b7d3,_0x4685a3){_0x4685a3=_0x4685a3||0xcc;return function(_0x56d929){if(_0x56d929){return _0x56b7d3['sendStatus'](_0x4685a3);}return _0x56b7d3[_0x6979('0x21')](_0x4685a3)['end']();};}function respondWithResult(_0x133a0c,_0x22f12f){_0x22f12f=_0x22f12f||0xc8;return function(_0x577933){if(_0x577933){return _0x133a0c[_0x6979('0x21')](_0x22f12f)['json'](_0x577933);}};}function respondWithFilteredResult(_0x154ee7,_0x2841b2){return function(_0x202476){if(_0x202476){var _0xda52fd=typeof _0x2841b2['offset']===_0x6979('0x22')&&typeof _0x2841b2['limit']===_0x6979('0x22');var _0x44fa25=_0x202476[_0x6979('0x23')];var _0x482189=_0xda52fd?0x0:_0x2841b2[_0x6979('0x24')];var _0x51a2ba=_0xda52fd?_0x202476[_0x6979('0x23')]:_0x2841b2[_0x6979('0x24')]+_0x2841b2['limit'];var _0x12b7a1;if(_0x51a2ba>=_0x44fa25){_0x51a2ba=_0x44fa25;_0x12b7a1=0xc8;}else{_0x12b7a1=0xce;}_0x154ee7[_0x6979('0x21')](_0x12b7a1);return _0x154ee7[_0x6979('0x25')]('Content-Range',_0x482189+'-'+_0x51a2ba+'/'+_0x44fa25)[_0x6979('0x26')](_0x202476);}return null;};}function patchUpdates(_0x43dc59){return function(_0x2cd6e9){try{jsonpatch[_0x6979('0x27')](_0x2cd6e9,_0x43dc59,!![]);}catch(_0x17b2d5){return BPromise[_0x6979('0x28')](_0x17b2d5);}return _0x2cd6e9[_0x6979('0x29')]();};}function saveUpdates(_0x59ec8d,_0x1cf759){return function(_0x975ec){if(_0x975ec){return _0x975ec[_0x6979('0x2a')](_0x59ec8d)[_0x6979('0x2b')](function(_0x4bf73a){return _0x4bf73a;});}return null;};}function handleEntityNotFound(_0x96670a,_0x596c61){return function(_0x22d028){if(!_0x22d028){_0x96670a[_0x6979('0x2c')](0x194);}return _0x22d028;};}function handleError(_0x257a40,_0x4560ef){_0x4560ef=_0x4560ef||0x1f4;return function(_0x4c1240){logger[_0x6979('0x2d')](_0x4c1240['stack']);if(_0x4c1240[_0x6979('0x2e')]){delete _0x4c1240['name'];}_0x257a40[_0x6979('0x21')](_0x4560ef)[_0x6979('0x2f')](_0x4c1240);};}exports[_0x6979('0x30')]=function(_0x3dd4a0,_0x591b13){var _0x4dcc76={},_0x36ac26={},_0x3fabc6={'count':0x0,'rows':[]};var _0x91f7bb=_[_0x6979('0x31')](db[_0x6979('0x32')][_0x6979('0x33')],function(_0x44e0e7){return{'name':_0x44e0e7['fieldName'],'type':_0x44e0e7['type'][_0x6979('0x34')]};});_0x36ac26[_0x6979('0x35')]=_[_0x6979('0x31')](_0x91f7bb,'name');_0x36ac26['query']=_[_0x6979('0x36')](_0x3dd4a0['query']);_0x36ac26['filters']=_[_0x6979('0x37')](_0x36ac26[_0x6979('0x35')],_0x36ac26[_0x6979('0x38')]);_0x4dcc76[_0x6979('0x39')]=_[_0x6979('0x37')](_0x36ac26[_0x6979('0x35')],qs[_0x6979('0x3a')](_0x3dd4a0['query']['fields']));_0x4dcc76[_0x6979('0x39')]=_0x4dcc76[_0x6979('0x39')][_0x6979('0x3b')]?_0x4dcc76[_0x6979('0x39')]:_0x36ac26[_0x6979('0x35')];if(!_0x3dd4a0[_0x6979('0x38')][_0x6979('0x3c')](_0x6979('0x3d'))){_0x4dcc76[_0x6979('0x3e')]=qs['limit'](_0x3dd4a0[_0x6979('0x38')]['limit']);_0x4dcc76['offset']=qs[_0x6979('0x24')](_0x3dd4a0['query'][_0x6979('0x24')]);}_0x4dcc76[_0x6979('0x3f')]=qs[_0x6979('0x40')](_0x3dd4a0['query'][_0x6979('0x40')]);_0x4dcc76[_0x6979('0x41')]=qs[_0x6979('0x42')](_[_0x6979('0x43')](_0x3dd4a0['query'],_0x36ac26['filters']),_0x91f7bb);if(_0x3dd4a0[_0x6979('0x38')][_0x6979('0x44')]){_0x4dcc76[_0x6979('0x41')]=_['merge'](_0x4dcc76[_0x6979('0x41')],{'$or':_[_0x6979('0x31')](_0x91f7bb,function(_0x482bb9){if(_0x482bb9[_0x6979('0x45')]!==_0x6979('0x46')){var _0x2cc01d={};_0x2cc01d[_0x482bb9[_0x6979('0x2e')]]={'$like':'%'+_0x3dd4a0['query'][_0x6979('0x44')]+'%'};return _0x2cc01d;}})});}_0x4dcc76=_[_0x6979('0x47')]({},_0x4dcc76,_0x3dd4a0[_0x6979('0x48')]);var _0x1339fb={'where':_0x4dcc76[_0x6979('0x41')]};return db[_0x6979('0x32')][_0x6979('0x23')](_0x1339fb)['then'](function(_0x1731ca){_0x3fabc6[_0x6979('0x23')]=_0x1731ca;if(_0x3dd4a0[_0x6979('0x38')][_0x6979('0x49')]){_0x4dcc76[_0x6979('0x4a')]=[{'all':!![]}];}return db['Team'][_0x6979('0x4b')](_0x4dcc76);})['then'](function(_0x4cb972){_0x3fabc6['rows']=_0x4cb972;return _0x3fabc6;})[_0x6979('0x2b')](respondWithFilteredResult(_0x591b13,_0x4dcc76))[_0x6979('0x4c')](handleError(_0x591b13,null));};exports[_0x6979('0x4d')]=function(_0x2ea70f,_0x581c74){var _0xa3af18={'raw':![],'where':{'id':_0x2ea70f[_0x6979('0x4e')]['id']}},_0x167551={};_0x167551[_0x6979('0x35')]=_['keys'](db[_0x6979('0x32')]['rawAttributes']);_0x167551['query']=_[_0x6979('0x36')](_0x2ea70f[_0x6979('0x38')]);_0x167551['filters']=_[_0x6979('0x37')](_0x167551['model'],_0x167551['query']);_0xa3af18[_0x6979('0x39')]=_[_0x6979('0x37')](_0x167551['model'],qs[_0x6979('0x3a')](_0x2ea70f['query']['fields']));_0xa3af18[_0x6979('0x39')]=_0xa3af18[_0x6979('0x39')][_0x6979('0x3b')]?_0xa3af18[_0x6979('0x39')]:_0x167551[_0x6979('0x35')];if(_0x2ea70f[_0x6979('0x38')][_0x6979('0x49')]){_0xa3af18['include']=[{'all':!![]}];}_0xa3af18=_['merge']({},_0xa3af18,_0x2ea70f[_0x6979('0x48')]);return db[_0x6979('0x32')]['find'](_0xa3af18)[_0x6979('0x2b')](handleEntityNotFound(_0x581c74,null))['then'](respondWithResult(_0x581c74,null))[_0x6979('0x4c')](handleError(_0x581c74,null));};exports[_0x6979('0x4f')]=function(_0x5bb914,_0xa95627){return db[_0x6979('0x32')]['create'](_0x5bb914[_0x6979('0x50')],{})['then'](function(_0x5a5312){var _0x1271fd=_0x5bb914[_0x6979('0x51')][_0x6979('0x52')]({'plain':!![]});if(!_0x1271fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1271fd[_0x6979('0x53')]===_0x6979('0x51')){var _0x5341d4=_0x5a5312[_0x6979('0x52')]({'plain':!![]});var _0x4a8fd6=_0x6979('0x54');return db[_0x6979('0x55')][_0x6979('0x56')]({'where':{'name':_0x4a8fd6,'userProfileId':_0x1271fd[_0x6979('0x57')]},'raw':!![]})['then'](function(_0x2b228e){if(_0x2b228e&&_0x2b228e['autoAssociation']===0x0){return db[_0x6979('0x58')]['create']({'name':_0x5341d4['name'],'resourceId':_0x5341d4['id'],'type':_0x2b228e[_0x6979('0x2e')],'sectionId':_0x2b228e['id']},{})[_0x6979('0x2b')](function(){return _0x5a5312;});}else{return _0x5a5312;}})[_0x6979('0x4c')](function(_0x3d7e8d){logger[_0x6979('0x2d')](_0x6979('0x59'),_0x3d7e8d);throw _0x3d7e8d;});}return _0x5a5312;})[_0x6979('0x2b')](respondWithResult(_0xa95627,0xc9))[_0x6979('0x4c')](handleError(_0xa95627,null));};exports[_0x6979('0x2a')]=function(_0x1b04a8,_0x943c9c){if(_0x1b04a8[_0x6979('0x50')]['id']){delete _0x1b04a8[_0x6979('0x50')]['id'];}return db[_0x6979('0x32')][_0x6979('0x56')]({'where':{'id':_0x1b04a8[_0x6979('0x4e')]['id']}})['then'](handleEntityNotFound(_0x943c9c,null))[_0x6979('0x2b')](saveUpdates(_0x1b04a8['body'],null))[_0x6979('0x2b')](respondWithResult(_0x943c9c,null))[_0x6979('0x4c')](handleError(_0x943c9c,null));};exports[_0x6979('0x5a')]=function(_0x49c987,_0x817673){var _0xa6d59d=_0x49c987[_0x6979('0x4e')]['id'];var _0x3494cd=[];return db[_0x6979('0x5b')][_0x6979('0x5c')](function(_0x8c3dba){var _0x268e0b=_0x6979('0x5d')+_0xa6d59d;return db[_0x6979('0x5b')][_0x6979('0x38')](_0x268e0b,{'type':db[_0x6979('0x5e')][_0x6979('0x5f')][_0x6979('0x60')],'raw':!![],'transaction':_0x8c3dba})[_0x6979('0x2b')](function(_0x59c7fc){_0x3494cd=_[_0x6979('0x31')](_0x59c7fc,function(_0x4c38e7){return Number(_0x4c38e7['UserId']);});})[_0x6979('0x2b')](function(){var _0xdaee4=_0x6979('0x61')+_0xa6d59d;return db[_0x6979('0x5b')][_0x6979('0x38')](_0xdaee4,{'type':db['Sequelize'][_0x6979('0x5f')]['SELECT'],'raw':!![],'transaction':_0x8c3dba});})['then'](function(_0x502d9c){var _0x53785c=_[_0x6979('0x31')](_0x502d9c,function(_0x13e831){return Number(_0x13e831[_0x6979('0x62')]);});return db[_0x6979('0x63')]['destroy']({'where':{'UserId':{'$in':_0x3494cd},'VoiceQueueId':{'$in':_0x53785c}},'transaction':_0x8c3dba});})[_0x6979('0x2b')](function(){var _0x3f7388=_0x6979('0x64')+_0xa6d59d;return db[_0x6979('0x5b')]['query'](_0x3f7388,{'type':db['Sequelize'][_0x6979('0x5f')][_0x6979('0x60')],'raw':!![],'transaction':_0x8c3dba});})[_0x6979('0x2b')](function(_0x4bced9){var _0x18454b=_[_0x6979('0x31')](_0x4bced9,function(_0x342d08){return Number(_0x342d08[_0x6979('0x65')]);});return db['UserMailQueue'][_0x6979('0x5a')]({'where':{'UserId':{'$in':_0x3494cd},'MailQueueId':{'$in':_0x18454b}},'transaction':_0x8c3dba});})[_0x6979('0x2b')](function(){var _0x47a5ed=_0x6979('0x66')+_0xa6d59d;return db[_0x6979('0x5b')][_0x6979('0x38')](_0x47a5ed,{'type':db[_0x6979('0x5e')][_0x6979('0x5f')][_0x6979('0x60')],'raw':!![],'transaction':_0x8c3dba});})[_0x6979('0x2b')](function(_0x5a92b8){var _0x22a88f=_[_0x6979('0x31')](_0x5a92b8,function(_0x2e07f3){return Number(_0x2e07f3['SmsQueueId']);});return db[_0x6979('0x67')][_0x6979('0x5a')]({'where':{'UserId':{'$in':_0x3494cd},'SmsQueueId':{'$in':_0x22a88f}},'transaction':_0x8c3dba});})[_0x6979('0x2b')](function(){var _0x5ee965=_0x6979('0x68')+_0xa6d59d;return db[_0x6979('0x5b')][_0x6979('0x38')](_0x5ee965,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x8c3dba});})[_0x6979('0x2b')](function(_0x100301){var _0x3c54b2=_[_0x6979('0x31')](_0x100301,function(_0x196210){return Number(_0x196210[_0x6979('0x69')]);});return db[_0x6979('0x6a')][_0x6979('0x5a')]({'where':{'UserId':{'$in':_0x3494cd},'ChatQueueId':{'$in':_0x3c54b2}},'transaction':_0x8c3dba});})['then'](function(){var _0x615c5a=_0x6979('0x6b')+_0xa6d59d;return db[_0x6979('0x5b')]['query'](_0x615c5a,{'type':db[_0x6979('0x5e')][_0x6979('0x5f')][_0x6979('0x60')],'raw':!![],'transaction':_0x8c3dba});})['then'](function(_0x2c7ea8){var _0xe42111=_[_0x6979('0x31')](_0x2c7ea8,function(_0x9b33f){return Number(_0x9b33f[_0x6979('0x6c')]);});return db[_0x6979('0x6d')]['destroy']({'where':{'UserId':{'$in':_0x3494cd},'FaxQueueId':{'$in':_0xe42111}},'transaction':_0x8c3dba});})[_0x6979('0x2b')](function(){var _0xfba9e1=_0x6979('0x6e')+_0xa6d59d;return db[_0x6979('0x5b')][_0x6979('0x38')](_0xfba9e1,{'type':db[_0x6979('0x5e')]['QueryTypes'][_0x6979('0x60')],'raw':!![],'transaction':_0x8c3dba});})[_0x6979('0x2b')](function(_0x207cfe){var _0x25de6b=_['map'](_0x207cfe,function(_0x18dc8d){return Number(_0x18dc8d[_0x6979('0x6f')]);});return db[_0x6979('0x70')][_0x6979('0x5a')]({'where':{'UserId':{'$in':_0x3494cd},'OpenchannelQueueId':{'$in':_0x25de6b}},'transaction':_0x8c3dba});})[_0x6979('0x2b')](function(){var _0xa64fcf=_0x6979('0x71')+_0xa6d59d;return db[_0x6979('0x5b')]['query'](_0xa64fcf,{'type':db[_0x6979('0x5e')][_0x6979('0x5f')][_0x6979('0x60')],'raw':!![],'transaction':_0x8c3dba});})[_0x6979('0x2b')](function(_0x3675df){var _0x1c2b39=_[_0x6979('0x31')](_0x3675df,function(_0x56a5a8){return Number(_0x56a5a8[_0x6979('0x72')]);});return db[_0x6979('0x73')][_0x6979('0x5a')]({'where':{'UserId':{'$in':_0x3494cd},'WhatsappQueueId':{'$in':_0x1c2b39}},'transaction':_0x8c3dba});})[_0x6979('0x2b')](function(){return db['TeamVoicePrefix'][_0x6979('0x56')]({'where':{'TeamId':_0xa6d59d}});})['then'](function(_0x2ffefd){if(_0x2ffefd===null){return;}return db[_0x6979('0x74')]['destroy']({'where':{'UserId':{'$in':_0x3494cd},'VoicePrefixId':_0x2ffefd['VoicePrefixId']},'transaction':_0x8c3dba});})[_0x6979('0x2b')](function(){return db[_0x6979('0x32')][_0x6979('0x5a')]({'where':{'id':_0xa6d59d},'cascade':!![],'transaction':_0x8c3dba});})[_0x6979('0x2b')](function(_0x26ccb7){if(_0x26ccb7===0x0){_0x817673['sendStatus'](0x194);}else{return db[_0x6979('0x58')][_0x6979('0x5a')]({'where':{'type':_0x6979('0x54'),'resourceId':_0xa6d59d},'cascade':!![],'transaction':_0x8c3dba})[_0x6979('0x2b')](function(){_0x817673[_0x6979('0x21')](0xcc)['end']();});}})[_0x6979('0x4c')](function(_0x47501){_0x817673[_0x6979('0x21')](0x1f4)[_0x6979('0x2f')](_0x47501);});});};exports[_0x6979('0x75')]=function(_0x20a2c5,_0x20108c,_0x4c7a6a){return db[_0x6979('0x32')][_0x6979('0x76')]({'where':{'id':_0x20a2c5['params']['id']}})[_0x6979('0x2b')](handleEntityNotFound(_0x20108c,null))[_0x6979('0x2b')](function(_0x421ddb){if(!_0x20a2c5[_0x6979('0x38')][_0x6979('0x77')]||!utils[_0x6979('0x78')](_0x20a2c5[_0x6979('0x38')][_0x6979('0x77')])){throw new db[(_0x6979('0x5e'))]['ValidationError'](_0x6979('0x79'));}var _0x349d74={};var _0x1fa351={};_0x1fa351['model']=_['keys'](db[_['capitalize'](_0x20a2c5[_0x6979('0x38')]['channel'][_0x6979('0x7a')]())+_0x6979('0x7b')][_0x6979('0x33')]);_0x1fa351[_0x6979('0x38')]=_[_0x6979('0x36')](_0x20a2c5[_0x6979('0x38')]);_0x1fa351[_0x6979('0x42')]=_[_0x6979('0x37')](_0x1fa351[_0x6979('0x35')],_0x1fa351['query']);_0x349d74['attributes']=_[_0x6979('0x37')](_0x1fa351[_0x6979('0x35')],qs[_0x6979('0x3a')](_0x20a2c5[_0x6979('0x38')]['fields']));_0x349d74[_0x6979('0x39')]=_0x349d74['attributes'][_0x6979('0x3b')]?_0x349d74[_0x6979('0x39')]:_0x1fa351[_0x6979('0x35')];_0x349d74[_0x6979('0x3e')]=qs['limit'](_0x20a2c5[_0x6979('0x38')]['limit']);_0x349d74[_0x6979('0x24')]=qs[_0x6979('0x24')](_0x20a2c5[_0x6979('0x38')][_0x6979('0x24')]);_0x349d74[_0x6979('0x3f')]=qs['sort'](_0x20a2c5[_0x6979('0x38')]['sort']);_0x349d74[_0x6979('0x41')]=qs[_0x6979('0x42')](_[_0x6979('0x43')](_0x20a2c5[_0x6979('0x38')],_0x1fa351['filters']));_0x349d74=_[_0x6979('0x47')]({},_0x349d74,_0x20a2c5[_0x6979('0x48')]);return _0x421ddb[_0x6979('0x52')+_[_0x6979('0x7c')](_0x20a2c5[_0x6979('0x38')][_0x6979('0x77')]['toLowerCase']())+_0x6979('0x7d')](_0x349d74);})[_0x6979('0x2b')](respondWithResult(_0x20108c,null))[_0x6979('0x4c')](handleError(_0x20108c,null));};exports[_0x6979('0x7e')]=function(_0x28b088,_0x223824,_0x3aee89){return db[_0x6979('0x32')][_0x6979('0x76')]({'where':{'id':_0x28b088[_0x6979('0x4e')]['id']}})['then'](function(_0x590a82){if(_0x590a82){if(!_0x28b088[_0x6979('0x50')][_0x6979('0x77')]||!utils[_0x6979('0x78')](_0x28b088[_0x6979('0x50')][_0x6979('0x77')])){throw new db[(_0x6979('0x5e'))]['ValidationError']('Unknown\x20channel');}return _0x590a82['add'+_[_0x6979('0x7c')](_0x28b088[_0x6979('0x50')][_0x6979('0x77')][_0x6979('0x7a')]())+'Queues'](_0x28b088[_0x6979('0x50')][_0x6979('0x7f')]);}return null;})['then'](handleEntityNotFound(_0x223824,null))[_0x6979('0x2b')](respondWithStatusCode(_0x223824,null))[_0x6979('0x4c')](handleError(_0x223824,null));};exports['removeQueues']=function(_0x164d8d,_0x37829d,_0xba721f){return db[_0x6979('0x32')][_0x6979('0x76')]({'where':{'id':_0x164d8d['params']['id']}})[_0x6979('0x2b')](function(_0x203f6d){if(_0x203f6d){if(!_0x164d8d[_0x6979('0x38')][_0x6979('0x77')]||!utils[_0x6979('0x78')](_0x164d8d['query'][_0x6979('0x77')])){throw new db[(_0x6979('0x5e'))][(_0x6979('0x80'))](_0x6979('0x79'));}return _0x203f6d[_0x6979('0x81')+_[_0x6979('0x7c')](_0x164d8d[_0x6979('0x38')][_0x6979('0x77')][_0x6979('0x7a')]())+_0x6979('0x7d')](_0x164d8d[_0x6979('0x38')][_0x6979('0x7f')]);}return null;})[_0x6979('0x2b')](handleEntityNotFound(_0x37829d,null))[_0x6979('0x2b')](respondWithStatusCode(_0x37829d,null))[_0x6979('0x4c')](handleError(_0x37829d,null));};exports[_0x6979('0x82')]=function(_0x27d184,_0x53ff45){var _0x5a9cef=_[_0x6979('0x83')](_0x27d184[_0x6979('0x50')][_0x6979('0x7f')])?_0x27d184[_0x6979('0x50')][_0x6979('0x7f')]:[_0x27d184['body'][_0x6979('0x7f')]];var _0x45f4bb=_0x27d184[_0x6979('0x4e')]['id'];return db[_0x6979('0x32')]['find']({'where':{'id':_0x45f4bb}})[_0x6979('0x2b')](handleEntityNotFound(_0x53ff45,null))['then'](function(_0xa6f804){if(_0xa6f804){var _0x44b104=[_0x6979('0x84'),_0x6979('0x85'),_0x6979('0x86'),_0x6979('0x87'),_0x6979('0x88'),'Openchannel',_0x6979('0x89')];return db[_0x6979('0x5b')][_0x6979('0x5c')](function(_0x41e252){var _0x86de2a=_[_0x6979('0x31')](_0x44b104,function(_0x1b05f1){var _0x15d1b3={'attributes':['id',_0x6979('0x2e')]};if(_0x1b05f1===_0x6979('0x84')){_0x15d1b3[_0x6979('0x8a')]={'attributes':[_0x6979('0x8b')]};}return _0xa6f804[_0x6979('0x52')+_0x1b05f1+'Queues'](_0x15d1b3)[_0x6979('0x2b')](function(_0x4b3e44){var _0x3aff8b=_[_0x6979('0x31')](_0x4b3e44,function(_0x546d09){var _0x18da63=_['map'](_0x5a9cef,function(_0x3b2315){var _0x272a1e={'where':{'UserId':_0x3b2315,[_0x1b05f1+_0x6979('0x8c')]:_0x546d09['id']},'transaction':_0x41e252};if(_0x1b05f1==='Voice'){_0x272a1e['defaults']={'penalty':_0x546d09[_0x6979('0x8d')][_0x6979('0x8b')]};}return db[_0x6979('0x8e')+_0x1b05f1+'Queue'][_0x6979('0x8f')](_0x272a1e)[_0x6979('0x2b')](function(){socket['emit'](_0x6979('0x51')+_0x1b05f1+_0x6979('0x90'),{'UserId':_0x3b2315,[_0x1b05f1+_0x6979('0x8c')]:_0x546d09['id']});if(_0x1b05f1!==_0x6979('0x84')){return;}return db['User'][_0x6979('0x4b')]({'where':{'id':_0x5a9cef,'online':0x1},'attributes':['id',_0x6979('0x2e'),_0x6979('0x91'),_0x6979('0x92'),_0x6979('0x93')],'raw':!![]})['then'](function(_0x50f839){var _0xb9caaa=_[_0x6979('0x31')](_0x50f839,function(_0x2a0784){return db[_0x6979('0x94')][_0x6979('0x95')]({'membername':_0x2a0784['name'],'UserId':_0x2a0784['id'],'queue_name':_0x546d09[_0x6979('0x2e')],'VoiceQueueId':_0x546d09['id'],'interface':_[_0x6979('0x96')](_0x2a0784[_0x6979('0x93')])?util[_0x6979('0x97')]('SIP/%s',_0x2a0784[_0x6979('0x2e')]):_0x2a0784[_0x6979('0x93')],'paused':_0x2a0784[_0x6979('0x92')]||![],'penalty':_0x546d09['TeamVoiceQueue'][_0x6979('0x8b')]},{'transaction':_0x41e252});});return Promise[_0x6979('0x98')](_0xb9caaa);});});});return Promise[_0x6979('0x98')](_0x18da63);});return Promise[_0x6979('0x98')](_0x3aff8b);})[_0x6979('0x2b')](function(){return db['TeamVoicePrefix'][_0x6979('0x76')]({'where':{'teamId':_0x45f4bb}})[_0x6979('0x2b')](function(_0x191f56){if(_0x191f56){var _0x5006ea=_[_0x6979('0x31')](_0x5a9cef,function(_0x3f91ba){db['UserVoicePrefix'][_0x6979('0x95')]({'UserId':_0x3f91ba,'VoicePrefixId':_0x191f56[_0x6979('0x99')]});});return Promise[_0x6979('0x98')](_0x5006ea);}});});});return Promise[_0x6979('0x98')](_0x86de2a)[_0x6979('0x2b')](function(){return _0xa6f804[_0x6979('0x82')](_0x5a9cef,{'transaction':_0x41e252})[_0x6979('0x9a')](function(_0x1b0214){return _0x1b0214;});});});}})[_0x6979('0x2b')](respondWithResult(_0x53ff45,null))[_0x6979('0x4c')](handleError(_0x53ff45,null));};exports[_0x6979('0x9b')]=function(_0x5360fa,_0x13c70d){var _0x410b10=_['isArray'](_0x5360fa[_0x6979('0x38')][_0x6979('0x7f')])?_0x5360fa['query'][_0x6979('0x7f')]:[_0x5360fa[_0x6979('0x38')][_0x6979('0x7f')]];var _0x24f0cc=_0x5360fa[_0x6979('0x4e')]['id'];return db[_0x6979('0x32')][_0x6979('0x56')]({'where':{'id':_0x24f0cc}})[_0x6979('0x2b')](handleEntityNotFound(_0x13c70d,null))['then'](function(_0x425b94){if(_0x425b94){var _0x54ccc1=[_0x6979('0x84'),'Chat',_0x6979('0x86'),_0x6979('0x87'),_0x6979('0x88'),_0x6979('0x9c'),_0x6979('0x89')];return db[_0x6979('0x5b')][_0x6979('0x5c')](function(_0x410a14){var _0x1d6650=_[_0x6979('0x31')](_0x54ccc1,function(_0x1812d8){var _0x2a70ec={'attributes':['id',_0x6979('0x2e')]};return _0x425b94[_0x6979('0x52')+_0x1812d8+_0x6979('0x7d')](_0x2a70ec)['then'](function(_0x3ed754){var _0x495c75=_['map'](_0x3ed754,function(_0x1c9b59){return _0x1c9b59['removeAgents'](_0x410b10,{'transaction':_0x410a14})[_0x6979('0x2b')](function(){var _0x935169=_[_0x6979('0x31')](_0x410b10,function(_0x59e511){socket[_0x6979('0x9d')](_0x6979('0x51')+_0x1812d8+_0x6979('0x9e'),{'UserId':Number(_0x59e511),[_0x1812d8+_0x6979('0x8c')]:_0x1c9b59['id']});if(_0x1812d8!==_0x6979('0x84')){return;}return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x1c9b59['id'],'UserId':_0x59e511},'transaction':_0x410a14});});return Promise[_0x6979('0x98')](_0x935169);});});return Promise['all'](_0x495c75);});});return Promise[_0x6979('0x98')](_0x1d6650)[_0x6979('0x2b')](function(){return _0x425b94[_0x6979('0x9b')](_0x410b10,{'transaction':_0x410a14});})[_0x6979('0x2b')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x24f0cc}})[_0x6979('0x2b')](function(_0x2b4541){if(_0x2b4541){var _0x5be33d=_[_0x6979('0x31')](_0x410b10,function(_0x1b86b5){db[_0x6979('0x74')][_0x6979('0x5a')]({'where':{'UserId':_0x1b86b5,'VoicePrefixId':_0x2b4541['VoicePrefixId']}});});return Promise[_0x6979('0x98')](_0x5be33d);}});});});}})['then'](respondWithStatusCode(_0x13c70d,null))['catch'](handleError(_0x13c70d,null));};exports[_0x6979('0x9f')]=function(_0x288214,_0x505090,_0x334b41){var _0x149996={};var _0x554f5c={};var _0xcdf881;var _0x329805;return db['Team'][_0x6979('0x76')]({'where':{'id':_0x288214[_0x6979('0x4e')]['id']}})['then'](handleEntityNotFound(_0x505090,null))[_0x6979('0x2b')](function(_0x51917d){if(_0x51917d){_0xcdf881=_0x51917d;_0x554f5c['model']=_[_0x6979('0x36')](db[_0x6979('0x8e')]['rawAttributes']);_0x554f5c[_0x6979('0x38')]=_[_0x6979('0x36')](_0x288214[_0x6979('0x38')]);_0x554f5c[_0x6979('0x42')]=_[_0x6979('0x37')](_0x554f5c[_0x6979('0x35')],_0x554f5c['query']);_0x149996[_0x6979('0x39')]=_[_0x6979('0x37')](_0x554f5c['model'],qs[_0x6979('0x3a')](_0x288214[_0x6979('0x38')][_0x6979('0x3a')]));_0x149996[_0x6979('0x39')]=_0x149996[_0x6979('0x39')][_0x6979('0x3b')]?_0x149996[_0x6979('0x39')]:_0x554f5c[_0x6979('0x35')];_0x149996['order']=qs['sort'](_0x288214[_0x6979('0x38')][_0x6979('0x40')]);_0x149996['where']=qs[_0x6979('0x42')](_[_0x6979('0x43')](_0x288214[_0x6979('0x38')],_0x554f5c[_0x6979('0x42')]));if(_0x288214[_0x6979('0x38')][_0x6979('0x44')]){_0x149996[_0x6979('0x41')]=_['merge'](_0x149996[_0x6979('0x41')],{'$or':_[_0x6979('0x31')](_0x149996[_0x6979('0x39')],function(_0xe90b57){var _0x51a24f={};_0x51a24f[_0xe90b57]={'$like':'%'+_0x288214[_0x6979('0x38')]['filter']+'%'};return _0x51a24f;})});}_0x149996=_[_0x6979('0x47')]({},_0x149996,_0x288214[_0x6979('0x48')]);return _0xcdf881[_0x6979('0x9f')](_0x149996);}})[_0x6979('0x2b')](function(_0x13da46){if(_0x13da46){_0x329805=_0x13da46[_0x6979('0x3b')];if(!_0x288214[_0x6979('0x38')][_0x6979('0x3c')]('nolimit')){_0x149996[_0x6979('0x3e')]=qs[_0x6979('0x3e')](_0x288214['query'][_0x6979('0x3e')]);_0x149996['offset']=qs[_0x6979('0x24')](_0x288214[_0x6979('0x38')]['offset']);}return _0xcdf881[_0x6979('0x9f')](_0x149996);}})[_0x6979('0x2b')](function(_0x558515){if(_0x558515){return _0x558515?{'count':_0x329805,'rows':_0x558515}:null;}})[_0x6979('0x2b')](respondWithResult(_0x505090,null))['catch'](handleError(_0x505090,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index f8ebe31..e33d9be 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 _0x2c49=['setMaxListeners','remove','emit','hook','events','../../mysqldb'];(function(_0x5d629d,_0x56e2ee){var _0x3cee0d=function(_0x126e54){while(--_0x126e54){_0x5d629d['push'](_0x5d629d['shift']());}};_0x3cee0d(++_0x56e2ee);}(_0x2c49,0x142));var _0x92c4=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x2c49[_0x2a67fe];return _0x57e726;};'use strict';var EventEmitter=require(_0x92c4('0x0'));var Team=require(_0x92c4('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x92c4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x92c4('0x3')};function emitEvent(_0x572f26){return function(_0x10fd9f,_0x107899,_0x2ffcb2){TeamEvents['emit'](_0x572f26+':'+_0x10fd9f['id'],_0x10fd9f);TeamEvents[_0x92c4('0x4')](_0x572f26,_0x10fd9f);_0x2ffcb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x92c4('0x5')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x4ab4=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','Team'];(function(_0x1e6cba,_0x4e3737){var _0x577bab=function(_0x5bc38a){while(--_0x5bc38a){_0x1e6cba['push'](_0x1e6cba['shift']());}};_0x577bab(++_0x4e3737);}(_0x4ab4,0x1b7));var _0x44ab=function(_0x18ee7f,_0x572a0d){_0x18ee7f=_0x18ee7f-0x0;var _0x54074c=_0x4ab4[_0x18ee7f];return _0x54074c;};'use strict';var EventEmitter=require(_0x44ab('0x0'));var Team=require('../../mysqldb')['db'][_0x44ab('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x44ab('0x2')](0x0);var events={'afterCreate':_0x44ab('0x3'),'afterUpdate':_0x44ab('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1832a9){return function(_0x4eaadb,_0x13a66b,_0x3b0120){TeamEvents[_0x44ab('0x5')](_0x1832a9+':'+_0x4eaadb['id'],_0x4eaadb);TeamEvents[_0x44ab('0x5')](_0x1832a9,_0x4eaadb);_0x3b0120(null);};}for(var e in events){if(events[_0x44ab('0x6')](e)){var event=events[e];Team[_0x44ab('0x7')](e,emitEvent(event));}}module[_0x44ab('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index df962ef..7e9b5e9 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 _0xe142=['path','rimraf','exports','define','Team','lodash','util','api'];(function(_0x26d188,_0x4306a3){var _0x4008bc=function(_0x59bc55){while(--_0x59bc55){_0x26d188['push'](_0x26d188['shift']());}};_0x4008bc(++_0x4306a3);}(_0xe142,0xed));var _0x2e14=function(_0x2e9782,_0xe29fa2){_0x2e9782=_0x2e9782-0x0;var _0x174ed2=_0xe142[_0x2e9782];return _0x174ed2;};'use strict';var _=require(_0x2e14('0x0'));var util=require(_0x2e14('0x1'));var logger=require('../../config/logger')(_0x2e14('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e14('0x3'));var rimraf=require(_0x2e14('0x4'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0x2e14('0x5')]=function(_0x52f4ce,_0x2eccc4){return _0x52f4ce[_0x2e14('0x6')](_0x2e14('0x7'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa97e=['Team','teams','util','../../config/logger','api','moment','rimraf','./team.attributes','exports'];(function(_0x5545b9,_0x2c9c85){var _0x15888f=function(_0x52e0f4){while(--_0x52e0f4){_0x5545b9['push'](_0x5545b9['shift']());}};_0x15888f(++_0x2c9c85);}(_0xa97e,0xc8));var _0xea97=function(_0xe20500,_0x3bf4aa){_0xe20500=_0xe20500-0x0;var _0x3e38b1=_0xa97e[_0xe20500];return _0x3e38b1;};'use strict';var _=require('lodash');var util=require(_0xea97('0x0'));var logger=require(_0xea97('0x1'))(_0xea97('0x2'));var moment=require(_0xea97('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xea97('0x4'));var config=require('../../config/environment');var attributes=require(_0xea97('0x5'));module[_0xea97('0x6')]=function(_0x3ad081,_0x47005c){return _0x3ad081['define'](_0xea97('0x7'),attributes,{'tableName':_0xea97('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 1dc496f..afc3f24 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 _0x1775=['Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','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','info'];(function(_0x33f34e,_0x4fde5b){var _0x58dc01=function(_0x36e155){while(--_0x36e155){_0x33f34e['push'](_0x33f34e['shift']());}};_0x58dc01(++_0x4fde5b);}(_0x1775,0x94));var _0x5177=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1775[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));var BPromise=require(_0x5177('0x2'));var rs=require(_0x5177('0x3'));var fs=require('fs');var Redis=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var utils=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))('rpc');var config=require(_0x5177('0x8'));var jayson=require(_0x5177('0x9'));var client=jayson[_0x5177('0xa')][_0x5177('0xb')]({'port':0x232a});config[_0x5177('0xc')]=_[_0x5177('0xd')](config[_0x5177('0xc')],{'host':_0x5177('0xe'),'port':0x18eb});var socket=require(_0x5177('0xf'))(new Redis(config['redis']));require('./team.socket')[_0x5177('0x10')](socket);function respondWithRpcPromise(_0x46eadb,_0x26c03e,_0x123442){return new BPromise(function(_0x87a0ad,_0x401728){return client[_0x5177('0x11')](_0x46eadb,_0x123442)[_0x5177('0x12')](function(_0x359cfc){logger[_0x5177('0x13')](_0x5177('0x14'),_0x26c03e,_0x5177('0x15'));logger[_0x5177('0x16')](_0x5177('0x17'),_0x26c03e,_0x5177('0x15'),JSON[_0x5177('0x18')](_0x359cfc));if(_0x359cfc[_0x5177('0x19')]){if(_0x359cfc[_0x5177('0x19')][_0x5177('0x1a')]===0x1f4){logger[_0x5177('0x19')](_0x5177('0x14'),_0x26c03e,_0x359cfc[_0x5177('0x19')][_0x5177('0x1b')]);return _0x401728(_0x359cfc[_0x5177('0x19')][_0x5177('0x1b')]);}logger['error']('Team,\x20%s,\x20%s',_0x26c03e,_0x359cfc[_0x5177('0x19')][_0x5177('0x1b')]);return _0x87a0ad(_0x359cfc[_0x5177('0x19')][_0x5177('0x1b')]);}else{logger[_0x5177('0x13')](_0x5177('0x14'),_0x26c03e,_0x5177('0x15'));_0x87a0ad(_0x359cfc['result'][_0x5177('0x1b')]);}})['catch'](function(_0x3429de){logger[_0x5177('0x19')](_0x5177('0x14'),_0x26c03e,_0x3429de);_0x401728(_0x3429de);});});} \ No newline at end of file +var _0xf34b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x35e4e8,_0x231074){var _0x3cc5a3=function(_0x16b37c){while(--_0x16b37c){_0x35e4e8['push'](_0x35e4e8['shift']());}};_0x3cc5a3(++_0x231074);}(_0xf34b,0x66));var _0xbf34=function(_0x139601,_0x2943ef){_0x139601=_0x139601-0x0;var _0x2cea01=_0xf34b[_0x139601];return _0x2cea01;};'use strict';var _=require(_0xbf34('0x0'));var util=require(_0xbf34('0x1'));var moment=require(_0xbf34('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf34('0x3'));var fs=require('fs');var Redis=require(_0xbf34('0x4'));var db=require(_0xbf34('0x5'))['db'];var utils=require(_0xbf34('0x6'));var logger=require(_0xbf34('0x7'))(_0xbf34('0x8'));var config=require(_0xbf34('0x9'));var jayson=require(_0xbf34('0xa'));var client=jayson[_0xbf34('0xb')][_0xbf34('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xbf34('0xd')],{'host':_0xbf34('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf34('0xd')]));require('./team.socket')[_0xbf34('0xf')](socket);function respondWithRpcPromise(_0x34f274,_0x284cb9,_0x2d8c56){return new BPromise(function(_0x51d008,_0x1f30e9){return client[_0xbf34('0x10')](_0x34f274,_0x2d8c56)['then'](function(_0x484e92){logger[_0xbf34('0x11')](_0xbf34('0x12'),_0x284cb9,_0xbf34('0x13'));logger[_0xbf34('0x14')](_0xbf34('0x15'),_0x284cb9,_0xbf34('0x13'),JSON[_0xbf34('0x16')](_0x484e92));if(_0x484e92[_0xbf34('0x17')]){if(_0x484e92[_0xbf34('0x17')]['code']===0x1f4){logger[_0xbf34('0x17')](_0xbf34('0x12'),_0x284cb9,_0x484e92[_0xbf34('0x17')]['message']);return _0x1f30e9(_0x484e92[_0xbf34('0x17')][_0xbf34('0x18')]);}logger['error'](_0xbf34('0x12'),_0x284cb9,_0x484e92[_0xbf34('0x17')][_0xbf34('0x18')]);return _0x51d008(_0x484e92[_0xbf34('0x17')][_0xbf34('0x18')]);}else{logger[_0xbf34('0x11')](_0xbf34('0x12'),_0x284cb9,'request\x20sent');_0x51d008(_0x484e92[_0xbf34('0x19')][_0xbf34('0x18')]);}})[_0xbf34('0x1a')](function(_0x38eebe){logger[_0xbf34('0x17')](_0xbf34('0x12'),_0x284cb9,_0x38eebe);_0x1f30e9(_0x38eebe);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 94e0b0b..7f66708 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 _0xf9fd=['remove','update','emit','removeListener','register','team:','save'];(function(_0x2c7516,_0x2ca7f1){var _0x1d76a2=function(_0x5ce25f){while(--_0x5ce25f){_0x2c7516['push'](_0x2c7516['shift']());}};_0x1d76a2(++_0x2ca7f1);}(_0xf9fd,0x14f));var _0xdf9f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9fd[_0x14add3];return _0x4a174f;};'use strict';var TeamEvents=require('./team.events');var events=[_0xdf9f('0x0'),_0xdf9f('0x1'),_0xdf9f('0x2')];function createListener(_0x337b40,_0x56bec4){return function(_0x49cb56){_0x56bec4[_0xdf9f('0x3')](_0x337b40,_0x49cb56);};}function removeListener(_0x150a0b,_0x3c9418){return function(){TeamEvents[_0xdf9f('0x4')](_0x150a0b,_0x3c9418);};}exports[_0xdf9f('0x5')]=function(_0x549031){for(var _0x4734df=0x0,_0x41d712=events['length'];_0x4734df<_0x41d712;_0x4734df++){var _0x56a29b=events[_0x4734df];var _0x41d667=createListener(_0xdf9f('0x6')+_0x56a29b,_0x549031);TeamEvents['on'](_0x56a29b,_0x41d667);}}; \ No newline at end of file +var _0x35d4=['register','./team.events','remove','update','emit','removeListener'];(function(_0x15bd8c,_0x930227){var _0x24e162=function(_0x5e9451){while(--_0x5e9451){_0x15bd8c['push'](_0x15bd8c['shift']());}};_0x24e162(++_0x930227);}(_0x35d4,0x1e7));var _0x435d=function(_0x104d29,_0x465be4){_0x104d29=_0x104d29-0x0;var _0xe514fc=_0x35d4[_0x104d29];return _0xe514fc;};'use strict';var TeamEvents=require(_0x435d('0x0'));var events=['save',_0x435d('0x1'),_0x435d('0x2')];function createListener(_0x10cf4d,_0x11cdd5){return function(_0x40102e){_0x11cdd5[_0x435d('0x3')](_0x10cf4d,_0x40102e);};}function removeListener(_0x3e7edf,_0x52c38a){return function(){TeamEvents[_0x435d('0x4')](_0x3e7edf,_0x52c38a);};}exports[_0x435d('0x5')]=function(_0x550c5d){for(var _0x539a8d=0x0,_0x2b1cc7=events['length'];_0x539a8d<_0x2b1cc7;_0x539a8d++){var _0x5f39e1=events[_0x539a8d];var _0xfbcabe=createListener('team:'+_0x5f39e1,_0x550c5d);TeamEvents['on'](_0x5f39e1,_0xfbcabe);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 9d4c41c..44d9091 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 _0x64e9=['sequelize','INTEGER'];(function(_0x2abd13,_0x501317){var _0x5ad645=function(_0x55ae11){while(--_0x55ae11){_0x2abd13['push'](_0x2abd13['shift']());}};_0x5ad645(++_0x501317);}(_0x64e9,0x136));var _0x964e=function(_0x58332b,_0x158d5d){_0x58332b=_0x58332b-0x0;var _0x2376af=_0x64e9[_0x58332b];return _0x2376af;};'use strict';var Sequelize=require(_0x964e('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x964e('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x4133=['sequelize','INTEGER'];(function(_0x1a87b3,_0x45ba68){var _0x37e84d=function(_0x39f49e){while(--_0x39f49e){_0x1a87b3['push'](_0x1a87b3['shift']());}};_0x37e84d(++_0x45ba68);}(_0x4133,0x17a));var _0x3413=function(_0x10826f,_0xf13fdd){_0x10826f=_0x10826f-0x0;var _0x2ad5c3=_0x4133[_0x10826f];return _0x2ad5c3;};'use strict';var Sequelize=require(_0x3413('0x0'));module['exports']={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x3413('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 7985592..4f890e5 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 _0x215d=['TeamVoicePrefix','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x1073d7,_0x30148f){var _0xc3a63c=function(_0x2b5bf2){while(--_0x2b5bf2){_0x1073d7['push'](_0x1073d7['shift']());}};_0xc3a63c(++_0x30148f);}(_0x215d,0x187));var _0xd215=function(_0x27bd40,_0x258633){_0x27bd40=_0x27bd40-0x0;var _0x54f699=_0x215d[_0x27bd40];return _0x54f699;};'use strict';var _=require(_0xd215('0x0'));var util=require('util');var logger=require(_0xd215('0x1'))(_0xd215('0x2'));var moment=require(_0xd215('0x3'));var BPromise=require(_0xd215('0x4'));var rp=require(_0xd215('0x5'));var fs=require('fs');var path=require(_0xd215('0x6'));var rimraf=require('rimraf');var config=require(_0xd215('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0xd215('0x8')]=function(_0x1c1356,_0x269e38){return _0x1c1356['define'](_0xd215('0x9'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1399=['TeamVoicePrefix','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','define'];(function(_0xabad7,_0x2fb967){var _0xa1a6d1=function(_0x396882){while(--_0x396882){_0xabad7['push'](_0xabad7['shift']());}};_0xa1a6d1(++_0x2fb967);}(_0x1399,0x16c));var _0x9139=function(_0x3e8f4d,_0x2973ed){_0x3e8f4d=_0x3e8f4d-0x0;var _0x590a2e=_0x1399[_0x3e8f4d];return _0x590a2e;};'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':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index d9b9f09..d3657d4 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x10e2c9,_0x489aab){var _0x426947=function(_0x123624){while(--_0x123624){_0x10e2c9['push'](_0x10e2c9['shift']());}};_0x426947(++_0x489aab);}(_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(_0x2a01fb,_0x251be6){var _0x2f05c3=function(_0x3ac643){while(--_0x3ac643){_0x2a01fb['push'](_0x2a01fb['shift']());}};_0x2f05c3(++_0x251be6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2f48cd,_0x46a75a){_0x2f48cd=_0x2f48cd-0x0;var _0x193ae2=_0xcb91[_0x2f48cd];return _0x193ae2;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 3a05a9b..600aa8c 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 _0x2ce4=['sequelize','exports','INTEGER'];(function(_0x1210af,_0xf5151){var _0x4db6a5=function(_0x4e3c0e){while(--_0x4e3c0e){_0x1210af['push'](_0x1210af['shift']());}};_0x4db6a5(++_0xf5151);}(_0x2ce4,0x141));var _0x42ce=function(_0x427c74,_0x1ad51b){_0x427c74=_0x427c74-0x0;var _0x24f675=_0x2ce4[_0x427c74];return _0x24f675;};'use strict';var Sequelize=require(_0x42ce('0x0'));module[_0x42ce('0x1')]={'penalty':{'type':Sequelize[_0x42ce('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x673b=['INTEGER','sequelize','exports'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x673b,0xb8));var _0xb673=function(_0x21d6fa,_0x5e623a){_0x21d6fa=_0x21d6fa-0x0;var _0x405b62=_0x673b[_0x21d6fa];return _0x405b62;};'use strict';var Sequelize=require(_0xb673('0x0'));module[_0xb673('0x1')]={'penalty':{'type':Sequelize[_0xb673('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 d854fc4..2a90d97 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 _0x3ee5=['rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x726d91,_0x2f9bc9){_0x726d91=_0x726d91-0x0;var _0x47c0ea=_0x3ee5[_0x726d91];return _0x47c0ea;};'use strict';var _=require('lodash');var util=require(_0x53ee('0x0'));var logger=require(_0x53ee('0x1'))('api');var moment=require(_0x53ee('0x2'));var BPromise=require(_0x53ee('0x3'));var rp=require(_0x53ee('0x4'));var fs=require('fs');var path=require(_0x53ee('0x5'));var rimraf=require(_0x53ee('0x6'));var config=require(_0x53ee('0x7'));var attributes=require(_0x53ee('0x8'));module[_0x53ee('0x9')]=function(_0x343bbb,_0x16ad68){return _0x343bbb[_0x53ee('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0x53ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c8e=['exports','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x2c79b9,_0x38910c){var _0x10bc6a=function(_0x51d624){while(--_0x51d624){_0x2c79b9['push'](_0x2c79b9['shift']());}};_0x10bc6a(++_0x38910c);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x403ad6,_0x137771){_0x403ad6=_0x403ad6-0x0;var _0x4736bc=_0x7c8e[_0x403ad6];return _0x4736bc;};'use strict';var _=require('lodash');var util=require(_0xe7c8('0x0'));var logger=require(_0xe7c8('0x1'))(_0xe7c8('0x2'));var moment=require(_0xe7c8('0x3'));var BPromise=require(_0xe7c8('0x4'));var rp=require(_0xe7c8('0x5'));var fs=require('fs');var path=require(_0xe7c8('0x6'));var rimraf=require(_0xe7c8('0x7'));var config=require(_0xe7c8('0x8'));var attributes=require(_0xe7c8('0x9'));module[_0xe7c8('0xa')]=function(_0x1f0a65,_0x293383){return _0x1f0a65[_0xe7c8('0xb')](_0xe7c8('0xc'),attributes,{'tableName':_0xe7c8('0xd'),'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 0031c73..7348949 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 _0xdd32=['rpc','../../config/environment','jayson/promise','http','then','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','TeamVoiceQueue,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x528d4f,_0x19b4f9){var _0x3df605=function(_0x18ed9d){while(--_0x18ed9d){_0x528d4f['push'](_0x528d4f['shift']());}};_0x3df605(++_0x19b4f9);}(_0xdd32,0x98));var _0x2dd3=function(_0x5c8f65,_0x406d32){_0x5c8f65=_0x5c8f65-0x0;var _0x156260=_0xdd32[_0x5c8f65];return _0x156260;};'use strict';var _=require(_0x2dd3('0x0'));var util=require(_0x2dd3('0x1'));var moment=require(_0x2dd3('0x2'));var BPromise=require(_0x2dd3('0x3'));var rs=require(_0x2dd3('0x4'));var fs=require('fs');var Redis=require(_0x2dd3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2dd3('0x6'));var logger=require(_0x2dd3('0x7'))(_0x2dd3('0x8'));var config=require(_0x2dd3('0x9'));var jayson=require(_0x2dd3('0xa'));var client=jayson['client'][_0x2dd3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbb8917,_0x5e8fb1,_0xe2814f){return new BPromise(function(_0x337424,_0x1baebd){return client['request'](_0xbb8917,_0xe2814f)[_0x2dd3('0xc')](function(_0x43f8d0){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x5e8fb1,_0x2dd3('0xd'));logger['debug'](_0x2dd3('0xe'),_0x5e8fb1,_0x2dd3('0xd'),JSON['stringify'](_0x43f8d0));if(_0x43f8d0['error']){if(_0x43f8d0[_0x2dd3('0xf')]['code']===0x1f4){logger[_0x2dd3('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5e8fb1,_0x43f8d0[_0x2dd3('0xf')][_0x2dd3('0x10')]);return _0x1baebd(_0x43f8d0[_0x2dd3('0xf')][_0x2dd3('0x10')]);}logger[_0x2dd3('0xf')](_0x2dd3('0x11'),_0x5e8fb1,_0x43f8d0[_0x2dd3('0xf')][_0x2dd3('0x10')]);return _0x337424(_0x43f8d0['error'][_0x2dd3('0x10')]);}else{logger[_0x2dd3('0x12')](_0x2dd3('0x11'),_0x5e8fb1,_0x2dd3('0xd'));_0x337424(_0x43f8d0[_0x2dd3('0x13')][_0x2dd3('0x10')]);}})['catch'](function(_0x5ad554){logger[_0x2dd3('0xf')](_0x2dd3('0x11'),_0x5e8fb1,_0x5ad554);_0x1baebd(_0x5ad554);});});} \ No newline at end of file +var _0xee6e=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xee6e,0x128));var _0xeee6=function(_0x206763,_0x4b41f4){_0x206763=_0x206763-0x0;var _0x225b32=_0xee6e[_0x206763];return _0x225b32;};'use strict';var _=require(_0xeee6('0x0'));var util=require('util');var moment=require(_0xeee6('0x1'));var BPromise=require(_0xeee6('0x2'));var rs=require(_0xeee6('0x3'));var fs=require('fs');var Redis=require(_0xeee6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xeee6('0x5'));var logger=require(_0xeee6('0x6'))(_0xeee6('0x7'));var config=require(_0xeee6('0x8'));var jayson=require(_0xeee6('0x9'));var client=jayson['client'][_0xeee6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x121049,_0x30a928,_0x118a66){return new BPromise(function(_0x2a8227,_0x7aa501){return client['request'](_0x121049,_0x118a66)[_0xeee6('0xb')](function(_0x2fdb4b){logger['info'](_0xeee6('0xc'),_0x30a928,_0xeee6('0xd'));logger[_0xeee6('0xe')](_0xeee6('0xf'),_0x30a928,_0xeee6('0xd'),JSON['stringify'](_0x2fdb4b));if(_0x2fdb4b['error']){if(_0x2fdb4b[_0xeee6('0x10')][_0xeee6('0x11')]===0x1f4){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x30a928,_0x2fdb4b[_0xeee6('0x10')][_0xeee6('0x12')]);return _0x7aa501(_0x2fdb4b['error'][_0xeee6('0x12')]);}logger[_0xeee6('0x10')](_0xeee6('0xc'),_0x30a928,_0x2fdb4b[_0xeee6('0x10')][_0xeee6('0x12')]);return _0x2a8227(_0x2fdb4b[_0xeee6('0x10')][_0xeee6('0x12')]);}else{logger['info'](_0xeee6('0xc'),_0x30a928,'request\x20sent');_0x2a8227(_0x2fdb4b['result']['message']);}})[_0xeee6('0x13')](function(_0x4e0c7e){logger[_0xeee6('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x30a928,_0x4e0c7e);_0x7aa501(_0x4e0c7e);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index d34a895..10f25d1 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 _0xf0f4=['/:id','show','create','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0f4,0x182));var _0x4f0f=function(_0x392bcc,_0x20df9f){_0x392bcc=_0x392bcc-0x0;var _0x2fc292=_0xf0f4[_0x392bcc];return _0x2fc292;};'use strict';var multer=require('multer');var util=require(_0x4f0f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4f0f('0x1'));var router=express[_0x4f0f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4f0f('0x3'));var interaction=require(_0x4f0f('0x4'));var config=require(_0x4f0f('0x5'));var controller=require(_0x4f0f('0x6'));router[_0x4f0f('0x7')]('/',auth[_0x4f0f('0x8')](),controller[_0x4f0f('0x9')]);router['get'](_0x4f0f('0xa'),auth[_0x4f0f('0x8')](),controller[_0x4f0f('0xb')]);router['post']('/',auth[_0x4f0f('0x8')](),controller[_0x4f0f('0xc')]);router[_0x4f0f('0xd')](_0x4f0f('0xa'),auth[_0x4f0f('0x8')](),controller[_0x4f0f('0xe')]);router[_0x4f0f('0xf')](_0x4f0f('0xa'),auth['isAuthenticated'](),controller[_0x4f0f('0x10')]);module[_0x4f0f('0x11')]=router; \ No newline at end of file +var _0xa5c1=['show','post','create','/:id','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated'];(function(_0x389821,_0x52ea49){var _0x3771de=function(_0x13527a){while(--_0x13527a){_0x389821['push'](_0x389821['shift']());}};_0x3771de(++_0x52ea49);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x158333,_0x5eda34){_0x158333=_0x158333-0x0;var _0x4f4690=_0xa5c1[_0x158333];return _0x4f4690;};'use strict';var multer=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var path=require(_0x1a5c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1a5c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1a5c('0x4'));var interaction=require(_0x1a5c('0x5'));var config=require(_0x1a5c('0x6'));var controller=require(_0x1a5c('0x7'));router[_0x1a5c('0x8')]('/',auth[_0x1a5c('0x9')](),controller['index']);router[_0x1a5c('0x8')]('/:id',auth[_0x1a5c('0x9')](),controller[_0x1a5c('0xa')]);router[_0x1a5c('0xb')]('/',auth['isAuthenticated'](),controller[_0x1a5c('0xc')]);router['put'](_0x1a5c('0xd'),auth[_0x1a5c('0x9')](),controller['update']);router[_0x1a5c('0xe')](_0x1a5c('0xd'),auth['isAuthenticated'](),controller[_0x1a5c('0xf')]);module[_0x1a5c('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index aa60af6..b4eb119 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 _0x4c70=['exports','STRING'];(function(_0x35e268,_0x5182b6){var _0x501fb1=function(_0x37e6e0){while(--_0x37e6e0){_0x35e268['push'](_0x35e268['shift']());}};_0x501fb1(++_0x5182b6);}(_0x4c70,0x150));var _0x04c7=function(_0x414166,_0x5e87f3){_0x414166=_0x414166-0x0;var _0x373505=_0x4c70[_0x414166];return _0x373505;};'use strict';var Sequelize=require('sequelize');module[_0x04c7('0x0')]={'name':{'type':Sequelize[_0x04c7('0x1')]},'description':{'type':Sequelize[_0x04c7('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xc1a4=['STRING','TEXT','exports'];(function(_0x3181cc,_0x28447f){var _0x547a4a=function(_0x3ede80){while(--_0x3ede80){_0x3181cc['push'](_0x3181cc['shift']());}};_0x547a4a(++_0x28447f);}(_0xc1a4,0x155));var _0x4c1a=function(_0x3425b6,_0x4dca03){_0x3425b6=_0x3425b6-0x0;var _0x5aa3b7=_0xc1a4[_0x3425b6];return _0x5aa3b7;};'use strict';var Sequelize=require('sequelize');module[_0x4c1a('0x0')]={'name':{'type':Sequelize[_0x4c1a('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x4c1a('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 35ac2cc..182e4af 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 _0x2f8d=['apply','reject','update','destroy','Templates','UserProfileResource','then','error','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','desk.js','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','undefined','limit','offset','count','set','json'];(function(_0x595fff,_0x2f1f7d){var _0xb9dd0c=function(_0xe1d963){while(--_0xe1d963){_0x595fff['push'](_0x595fff['shift']());}};_0xb9dd0c(++_0x2f1f7d);}(_0x2f8d,0x82));var _0xd2f8=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x2f8d[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd2f8('0x0'));var zipdir=require(_0xd2f8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd2f8('0x2'));var BPromise=require(_0xd2f8('0x3'));var Mustache=require('mustache');var util=require(_0xd2f8('0x4'));var path=require(_0xd2f8('0x5'));var sox=require('sox');var csv=require(_0xd2f8('0x6'));var ejs=require(_0xd2f8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd2f8('0x8'));var squel=require('squel');var crypto=require(_0xd2f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xd2f8('0xa'));var toCsv=require(_0xd2f8('0x6'));var querystring=require('querystring');var Papa=require(_0xd2f8('0xb'));var Redis=require(_0xd2f8('0xc'));var authService=require(_0xd2f8('0xd'));var qs=require(_0xd2f8('0xe'));var as=require(_0xd2f8('0xf'));var hardwareService=require(_0xd2f8('0x10'));var logger=require(_0xd2f8('0x11'))('api');var utils=require(_0xd2f8('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd2f8('0x13'));var db=require(_0xd2f8('0x14'))['db'];function respondWithStatusCode(_0x30a81c,_0x4d28ff){_0x4d28ff=_0x4d28ff||0xcc;return function(_0x284ae9){if(_0x284ae9){return _0x30a81c[_0xd2f8('0x15')](_0x4d28ff);}return _0x30a81c[_0xd2f8('0x16')](_0x4d28ff)[_0xd2f8('0x17')]();};}function respondWithResult(_0x3e9b5d,_0x55d124){_0x55d124=_0x55d124||0xc8;return function(_0x30be91){if(_0x30be91){return _0x3e9b5d[_0xd2f8('0x16')](_0x55d124)['json'](_0x30be91);}};}function respondWithFilteredResult(_0x3bbbc2,_0xb9e803){return function(_0x1b99b9){if(_0x1b99b9){var _0x4205d5=typeof _0xb9e803['offset']===_0xd2f8('0x18')&&typeof _0xb9e803[_0xd2f8('0x19')]===_0xd2f8('0x18');var _0x5b4bcd=_0x1b99b9['count'];var _0x2b3cd7=_0x4205d5?0x0:_0xb9e803[_0xd2f8('0x1a')];var _0x1a7d21=_0x4205d5?_0x1b99b9[_0xd2f8('0x1b')]:_0xb9e803[_0xd2f8('0x1a')]+_0xb9e803[_0xd2f8('0x19')];var _0x22b13d;if(_0x1a7d21>=_0x5b4bcd){_0x1a7d21=_0x5b4bcd;_0x22b13d=0xc8;}else{_0x22b13d=0xce;}_0x3bbbc2[_0xd2f8('0x16')](_0x22b13d);return _0x3bbbc2[_0xd2f8('0x1c')]('Content-Range',_0x2b3cd7+'-'+_0x1a7d21+'/'+_0x5b4bcd)[_0xd2f8('0x1d')](_0x1b99b9);}return null;};}function patchUpdates(_0x25012e){return function(_0x156e66){try{jsonpatch[_0xd2f8('0x1e')](_0x156e66,_0x25012e,!![]);}catch(_0x3c1d6a){return BPromise[_0xd2f8('0x1f')](_0x3c1d6a);}return _0x156e66['save']();};}function saveUpdates(_0x44e579,_0x40d857){return function(_0x25f7db){if(_0x25f7db){return _0x25f7db[_0xd2f8('0x20')](_0x44e579)['then'](function(_0x4fead3){return _0x4fead3;});}return null;};}function removeEntity(_0xa68a19,_0x1da30d){return function(_0x5dd75c){if(_0x5dd75c){return _0x5dd75c[_0xd2f8('0x21')]()['then'](function(){var _0x3a32d6=_0x5dd75c['get']({'plain':!![]});var _0x123716=_0xd2f8('0x22');return db[_0xd2f8('0x23')][_0xd2f8('0x21')]({'where':{'type':_0x123716,'resourceId':_0x3a32d6['id']}})[_0xd2f8('0x24')](function(){return _0x5dd75c;});})['then'](function(){_0xa68a19[_0xd2f8('0x16')](0xcc)[_0xd2f8('0x17')]();});}};}function handleEntityNotFound(_0x436700,_0x56fd36){return function(_0x1b6e13){if(!_0x1b6e13){_0x436700[_0xd2f8('0x15')](0x194);}return _0x1b6e13;};}function handleError(_0xc27c6e,_0x2b373c){_0x2b373c=_0x2b373c||0x1f4;return function(_0x21806e){logger[_0xd2f8('0x25')](_0x21806e['stack']);if(_0x21806e[_0xd2f8('0x26')]){delete _0x21806e[_0xd2f8('0x26')];}_0xc27c6e[_0xd2f8('0x16')](_0x2b373c)[_0xd2f8('0x27')](_0x21806e);};}exports[_0xd2f8('0x28')]=function(_0x2bff1d,_0x41d32b){var _0x4cd033={},_0x5dc437={},_0x56c2e0={'count':0x0,'rows':[]};var _0x1076b2=_[_0xd2f8('0x29')](db[_0xd2f8('0x2a')][_0xd2f8('0x2b')],function(_0x2a5f8c){return{'name':_0x2a5f8c[_0xd2f8('0x2c')],'type':_0x2a5f8c[_0xd2f8('0x2d')][_0xd2f8('0x2e')]};});_0x5dc437[_0xd2f8('0x2f')]=_['map'](_0x1076b2,_0xd2f8('0x26'));_0x5dc437[_0xd2f8('0x30')]=_['keys'](_0x2bff1d[_0xd2f8('0x30')]);_0x5dc437[_0xd2f8('0x31')]=_[_0xd2f8('0x32')](_0x5dc437[_0xd2f8('0x2f')],_0x5dc437['query']);_0x4cd033[_0xd2f8('0x33')]=_[_0xd2f8('0x32')](_0x5dc437['model'],qs[_0xd2f8('0x34')](_0x2bff1d[_0xd2f8('0x30')][_0xd2f8('0x34')]));_0x4cd033['attributes']=_0x4cd033[_0xd2f8('0x33')]['length']?_0x4cd033[_0xd2f8('0x33')]:_0x5dc437[_0xd2f8('0x2f')];if(!_0x2bff1d['query'][_0xd2f8('0x35')](_0xd2f8('0x36'))){_0x4cd033[_0xd2f8('0x19')]=qs['limit'](_0x2bff1d[_0xd2f8('0x30')][_0xd2f8('0x19')]);_0x4cd033[_0xd2f8('0x1a')]=qs[_0xd2f8('0x1a')](_0x2bff1d[_0xd2f8('0x30')]['offset']);}_0x4cd033[_0xd2f8('0x37')]=qs[_0xd2f8('0x38')](_0x2bff1d[_0xd2f8('0x30')][_0xd2f8('0x38')]);_0x4cd033['where']=qs[_0xd2f8('0x31')](_[_0xd2f8('0x39')](_0x2bff1d[_0xd2f8('0x30')],_0x5dc437[_0xd2f8('0x31')]),_0x1076b2);if(_0x2bff1d[_0xd2f8('0x30')][_0xd2f8('0x3a')]){_0x4cd033[_0xd2f8('0x3b')]=_[_0xd2f8('0x3c')](_0x4cd033['where'],{'$or':_[_0xd2f8('0x29')](_0x1076b2,function(_0x3ece04){if(_0x3ece04[_0xd2f8('0x2d')]!==_0xd2f8('0x3d')){var _0x4698fd={};_0x4698fd[_0x3ece04['name']]={'$like':'%'+_0x2bff1d['query'][_0xd2f8('0x3a')]+'%'};return _0x4698fd;}})});}_0x4cd033=_[_0xd2f8('0x3c')]({},_0x4cd033,_0x2bff1d[_0xd2f8('0x3e')]);var _0xdf8f97={'where':_0x4cd033['where']};return db[_0xd2f8('0x2a')][_0xd2f8('0x1b')](_0xdf8f97)[_0xd2f8('0x24')](function(_0x594b06){_0x56c2e0['count']=_0x594b06;if(_0x2bff1d[_0xd2f8('0x30')][_0xd2f8('0x3f')]){_0x4cd033[_0xd2f8('0x40')]=[{'all':!![]}];}return db['Template']['findAll'](_0x4cd033);})['then'](function(_0x587eb1){_0x56c2e0[_0xd2f8('0x41')]=_0x587eb1;return _0x56c2e0;})[_0xd2f8('0x24')](respondWithFilteredResult(_0x41d32b,_0x4cd033))[_0xd2f8('0x42')](handleError(_0x41d32b,null));};exports[_0xd2f8('0x43')]=function(_0x2949d5,_0x17439f){var _0x121039={'raw':!![],'where':{'id':_0x2949d5['params']['id']}},_0x4b11e6={};_0x4b11e6[_0xd2f8('0x2f')]=_[_0xd2f8('0x44')](db[_0xd2f8('0x2a')][_0xd2f8('0x2b')]);_0x4b11e6['query']=_[_0xd2f8('0x44')](_0x2949d5[_0xd2f8('0x30')]);_0x4b11e6['filters']=_['intersection'](_0x4b11e6[_0xd2f8('0x2f')],_0x4b11e6[_0xd2f8('0x30')]);_0x121039[_0xd2f8('0x33')]=_[_0xd2f8('0x32')](_0x4b11e6[_0xd2f8('0x2f')],qs[_0xd2f8('0x34')](_0x2949d5['query'][_0xd2f8('0x34')]));_0x121039[_0xd2f8('0x33')]=_0x121039['attributes'][_0xd2f8('0x45')]?_0x121039['attributes']:_0x4b11e6[_0xd2f8('0x2f')];if(_0x2949d5[_0xd2f8('0x30')][_0xd2f8('0x3f')]){_0x121039[_0xd2f8('0x40')]=[{'all':!![]}];}_0x121039=_['merge']({},_0x121039,_0x2949d5[_0xd2f8('0x3e')]);return db['Template'][_0xd2f8('0x46')](_0x121039)[_0xd2f8('0x24')](handleEntityNotFound(_0x17439f,null))[_0xd2f8('0x24')](respondWithResult(_0x17439f,null))[_0xd2f8('0x42')](handleError(_0x17439f,null));};exports[_0xd2f8('0x47')]=function(_0x47626d,_0x28ff7c){return db[_0xd2f8('0x2a')]['create'](_0x47626d['body'],{})['then'](function(_0x314b7c){var _0x4034c5=_0x47626d[_0xd2f8('0x48')][_0xd2f8('0x49')]({'plain':!![]});if(!_0x4034c5)throw new Error(_0xd2f8('0x4a'));if(_0x4034c5[_0xd2f8('0x4b')]===_0xd2f8('0x48')){var _0x19ea7c=_0x314b7c[_0xd2f8('0x49')]({'plain':!![]});var _0x2e73a6=_0xd2f8('0x22');return db['UserProfileSection'][_0xd2f8('0x46')]({'where':{'name':_0x2e73a6,'userProfileId':_0x4034c5[_0xd2f8('0x4c')]},'raw':!![]})[_0xd2f8('0x24')](function(_0x4ab205){if(_0x4ab205&&_0x4ab205['autoAssociation']===0x0){return db[_0xd2f8('0x23')]['create']({'name':_0x19ea7c[_0xd2f8('0x26')],'resourceId':_0x19ea7c['id'],'type':_0x4ab205[_0xd2f8('0x26')],'sectionId':_0x4ab205['id']},{})['then'](function(){return _0x314b7c;});}else{return _0x314b7c;}})[_0xd2f8('0x42')](function(_0x1220ff){logger[_0xd2f8('0x25')](_0xd2f8('0x4d'),_0x1220ff);throw _0x1220ff;});}return _0x314b7c;})[_0xd2f8('0x24')](respondWithResult(_0x28ff7c,0xc9))[_0xd2f8('0x42')](handleError(_0x28ff7c,null));};exports[_0xd2f8('0x20')]=function(_0x4bcbe0,_0x3436d9){if(_0x4bcbe0[_0xd2f8('0x4e')]['id']){delete _0x4bcbe0[_0xd2f8('0x4e')]['id'];}return db[_0xd2f8('0x2a')][_0xd2f8('0x46')]({'where':{'id':_0x4bcbe0[_0xd2f8('0x4f')]['id']}})[_0xd2f8('0x24')](handleEntityNotFound(_0x3436d9,null))[_0xd2f8('0x24')](saveUpdates(_0x4bcbe0[_0xd2f8('0x4e')],null))[_0xd2f8('0x24')](respondWithResult(_0x3436d9,null))[_0xd2f8('0x42')](handleError(_0x3436d9,null));};exports[_0xd2f8('0x21')]=function(_0x3fae92,_0x3ed981){return db[_0xd2f8('0x2a')][_0xd2f8('0x46')]({'where':{'id':_0x3fae92[_0xd2f8('0x4f')]['id']}})[_0xd2f8('0x24')](handleEntityNotFound(_0x3ed981,null))[_0xd2f8('0x24')](removeEntity(_0x3ed981,null))[_0xd2f8('0x42')](handleError(_0x3ed981,null));}; \ No newline at end of file +var _0x160b=['type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','findAll','rows','catch','show','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','get','Templates','UserProfileResource','destroy','error','name','send','index','map','Template','rawAttributes','fieldName'];(function(_0x3d4347,_0x412b60){var _0x2e2219=function(_0x2477c6){while(--_0x2477c6){_0x3d4347['push'](_0x3d4347['shift']());}};_0x2e2219(++_0x412b60);}(_0x160b,0xcf));var _0xb160=function(_0xa53e51,_0x1c93df){_0xa53e51=_0xa53e51-0x0;var _0x778ef7=_0x160b[_0xa53e51];return _0x778ef7;};'use strict';var emlformat=require(_0xb160('0x0'));var rimraf=require(_0xb160('0x1'));var zipdir=require(_0xb160('0x2'));var jsonpatch=require(_0xb160('0x3'));var rp=require('request-promise');var moment=require(_0xb160('0x4'));var BPromise=require(_0xb160('0x5'));var Mustache=require(_0xb160('0x6'));var util=require(_0xb160('0x7'));var path=require(_0xb160('0x8'));var sox=require(_0xb160('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb160('0xa'));var squel=require(_0xb160('0xb'));var crypto=require(_0xb160('0xc'));var jsforce=require(_0xb160('0xd'));var deskjs=require(_0xb160('0xe'));var toCsv=require(_0xb160('0xf'));var querystring=require(_0xb160('0x10'));var Papa=require('papaparse');var Redis=require(_0xb160('0x11'));var authService=require(_0xb160('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb160('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb160('0x14'))(_0xb160('0x15'));var utils=require(_0xb160('0x16'));var config=require(_0xb160('0x17'));var licenseUtil=require(_0xb160('0x18'));var db=require(_0xb160('0x19'))['db'];function respondWithStatusCode(_0x2eaaca,_0x4256b9){_0x4256b9=_0x4256b9||0xcc;return function(_0x57c6e4){if(_0x57c6e4){return _0x2eaaca[_0xb160('0x1a')](_0x4256b9);}return _0x2eaaca['status'](_0x4256b9)[_0xb160('0x1b')]();};}function respondWithResult(_0x12a05c,_0x4a49c4){_0x4a49c4=_0x4a49c4||0xc8;return function(_0x4ad96f){if(_0x4ad96f){return _0x12a05c[_0xb160('0x1c')](_0x4a49c4)[_0xb160('0x1d')](_0x4ad96f);}};}function respondWithFilteredResult(_0x6229ef,_0xa1945a){return function(_0x42b3d5){if(_0x42b3d5){var _0x4d8d49=typeof _0xa1945a['offset']===_0xb160('0x1e')&&typeof _0xa1945a[_0xb160('0x1f')]==='undefined';var _0x2ec52c=_0x42b3d5[_0xb160('0x20')];var _0x2520cd=_0x4d8d49?0x0:_0xa1945a[_0xb160('0x21')];var _0x5dbdde=_0x4d8d49?_0x42b3d5[_0xb160('0x20')]:_0xa1945a[_0xb160('0x21')]+_0xa1945a['limit'];var _0x334e30;if(_0x5dbdde>=_0x2ec52c){_0x5dbdde=_0x2ec52c;_0x334e30=0xc8;}else{_0x334e30=0xce;}_0x6229ef[_0xb160('0x1c')](_0x334e30);return _0x6229ef[_0xb160('0x22')](_0xb160('0x23'),_0x2520cd+'-'+_0x5dbdde+'/'+_0x2ec52c)[_0xb160('0x1d')](_0x42b3d5);}return null;};}function patchUpdates(_0x1e72e1){return function(_0xadd43f){try{jsonpatch['apply'](_0xadd43f,_0x1e72e1,!![]);}catch(_0x21047d){return BPromise[_0xb160('0x24')](_0x21047d);}return _0xadd43f['save']();};}function saveUpdates(_0x4ad92c,_0x2f54b0){return function(_0xb3d0e1){if(_0xb3d0e1){return _0xb3d0e1[_0xb160('0x25')](_0x4ad92c)['then'](function(_0x965086){return _0x965086;});}return null;};}function removeEntity(_0x24d19b,_0x25fc8e){return function(_0xf1b7fc){if(_0xf1b7fc){return _0xf1b7fc['destroy']()[_0xb160('0x26')](function(){var _0xd7a552=_0xf1b7fc[_0xb160('0x27')]({'plain':!![]});var _0x5aa6f6=_0xb160('0x28');return db[_0xb160('0x29')][_0xb160('0x2a')]({'where':{'type':_0x5aa6f6,'resourceId':_0xd7a552['id']}})[_0xb160('0x26')](function(){return _0xf1b7fc;});})[_0xb160('0x26')](function(){_0x24d19b[_0xb160('0x1c')](0xcc)[_0xb160('0x1b')]();});}};}function handleEntityNotFound(_0x1a97d2,_0x5de14a){return function(_0x1b34cd){if(!_0x1b34cd){_0x1a97d2[_0xb160('0x1a')](0x194);}return _0x1b34cd;};}function handleError(_0x10e89c,_0x1c0f2a){_0x1c0f2a=_0x1c0f2a||0x1f4;return function(_0x5ef953){logger[_0xb160('0x2b')](_0x5ef953['stack']);if(_0x5ef953[_0xb160('0x2c')]){delete _0x5ef953['name'];}_0x10e89c[_0xb160('0x1c')](_0x1c0f2a)[_0xb160('0x2d')](_0x5ef953);};}exports[_0xb160('0x2e')]=function(_0x4a2ce0,_0x12efd2){var _0x415ec5={},_0x432d0={},_0x4c48c1={'count':0x0,'rows':[]};var _0x19005a=_[_0xb160('0x2f')](db[_0xb160('0x30')][_0xb160('0x31')],function(_0x3b40b5){return{'name':_0x3b40b5[_0xb160('0x32')],'type':_0x3b40b5[_0xb160('0x33')]['key']};});_0x432d0[_0xb160('0x34')]=_[_0xb160('0x2f')](_0x19005a,_0xb160('0x2c'));_0x432d0['query']=_[_0xb160('0x35')](_0x4a2ce0['query']);_0x432d0[_0xb160('0x36')]=_[_0xb160('0x37')](_0x432d0[_0xb160('0x34')],_0x432d0[_0xb160('0x38')]);_0x415ec5[_0xb160('0x39')]=_[_0xb160('0x37')](_0x432d0[_0xb160('0x34')],qs[_0xb160('0x3a')](_0x4a2ce0[_0xb160('0x38')][_0xb160('0x3a')]));_0x415ec5['attributes']=_0x415ec5['attributes'][_0xb160('0x3b')]?_0x415ec5['attributes']:_0x432d0['model'];if(!_0x4a2ce0[_0xb160('0x38')][_0xb160('0x3c')](_0xb160('0x3d'))){_0x415ec5['limit']=qs[_0xb160('0x1f')](_0x4a2ce0[_0xb160('0x38')][_0xb160('0x1f')]);_0x415ec5[_0xb160('0x21')]=qs['offset'](_0x4a2ce0['query'][_0xb160('0x21')]);}_0x415ec5[_0xb160('0x3e')]=qs[_0xb160('0x3f')](_0x4a2ce0['query'][_0xb160('0x3f')]);_0x415ec5['where']=qs[_0xb160('0x36')](_[_0xb160('0x40')](_0x4a2ce0['query'],_0x432d0[_0xb160('0x36')]),_0x19005a);if(_0x4a2ce0[_0xb160('0x38')][_0xb160('0x41')]){_0x415ec5['where']=_[_0xb160('0x42')](_0x415ec5['where'],{'$or':_['map'](_0x19005a,function(_0xce3f7c){if(_0xce3f7c[_0xb160('0x33')]!==_0xb160('0x43')){var _0x52584a={};_0x52584a[_0xce3f7c[_0xb160('0x2c')]]={'$like':'%'+_0x4a2ce0[_0xb160('0x38')][_0xb160('0x41')]+'%'};return _0x52584a;}})});}_0x415ec5=_[_0xb160('0x42')]({},_0x415ec5,_0x4a2ce0[_0xb160('0x44')]);var _0x3add5a={'where':_0x415ec5[_0xb160('0x45')]};return db[_0xb160('0x30')][_0xb160('0x20')](_0x3add5a)[_0xb160('0x26')](function(_0x55d298){_0x4c48c1['count']=_0x55d298;if(_0x4a2ce0['query']['includeAll']){_0x415ec5['include']=[{'all':!![]}];}return db[_0xb160('0x30')][_0xb160('0x46')](_0x415ec5);})[_0xb160('0x26')](function(_0x40fdb7){_0x4c48c1[_0xb160('0x47')]=_0x40fdb7;return _0x4c48c1;})[_0xb160('0x26')](respondWithFilteredResult(_0x12efd2,_0x415ec5))[_0xb160('0x48')](handleError(_0x12efd2,null));};exports[_0xb160('0x49')]=function(_0x368a6c,_0x3d5839){var _0x264874={'raw':!![],'where':{'id':_0x368a6c['params']['id']}},_0x631eb={};_0x631eb[_0xb160('0x34')]=_['keys'](db[_0xb160('0x30')][_0xb160('0x31')]);_0x631eb['query']=_['keys'](_0x368a6c[_0xb160('0x38')]);_0x631eb['filters']=_['intersection'](_0x631eb[_0xb160('0x34')],_0x631eb[_0xb160('0x38')]);_0x264874[_0xb160('0x39')]=_[_0xb160('0x37')](_0x631eb[_0xb160('0x34')],qs[_0xb160('0x3a')](_0x368a6c[_0xb160('0x38')][_0xb160('0x3a')]));_0x264874[_0xb160('0x39')]=_0x264874[_0xb160('0x39')]['length']?_0x264874['attributes']:_0x631eb[_0xb160('0x34')];if(_0x368a6c['query'][_0xb160('0x4a')]){_0x264874[_0xb160('0x4b')]=[{'all':!![]}];}_0x264874=_[_0xb160('0x42')]({},_0x264874,_0x368a6c[_0xb160('0x44')]);return db[_0xb160('0x30')][_0xb160('0x4c')](_0x264874)[_0xb160('0x26')](handleEntityNotFound(_0x3d5839,null))[_0xb160('0x26')](respondWithResult(_0x3d5839,null))[_0xb160('0x48')](handleError(_0x3d5839,null));};exports['create']=function(_0x1aa961,_0x5c771b){return db[_0xb160('0x30')][_0xb160('0x4d')](_0x1aa961[_0xb160('0x4e')],{})[_0xb160('0x26')](function(_0x105f9f){var _0x109608=_0x1aa961[_0xb160('0x4f')][_0xb160('0x27')]({'plain':!![]});if(!_0x109608)throw new Error(_0xb160('0x50'));if(_0x109608['role']===_0xb160('0x4f')){var _0x55e315=_0x105f9f[_0xb160('0x27')]({'plain':!![]});var _0x2ce793='Templates';return db[_0xb160('0x51')]['find']({'where':{'name':_0x2ce793,'userProfileId':_0x109608[_0xb160('0x52')]},'raw':!![]})[_0xb160('0x26')](function(_0x4250b0){if(_0x4250b0&&_0x4250b0[_0xb160('0x53')]===0x0){return db[_0xb160('0x29')][_0xb160('0x4d')]({'name':_0x55e315[_0xb160('0x2c')],'resourceId':_0x55e315['id'],'type':_0x4250b0[_0xb160('0x2c')],'sectionId':_0x4250b0['id']},{})[_0xb160('0x26')](function(){return _0x105f9f;});}else{return _0x105f9f;}})[_0xb160('0x48')](function(_0x172732){logger['error'](_0xb160('0x54'),_0x172732);throw _0x172732;});}return _0x105f9f;})[_0xb160('0x26')](respondWithResult(_0x5c771b,0xc9))[_0xb160('0x48')](handleError(_0x5c771b,null));};exports['update']=function(_0x4d0b07,_0x87669a){if(_0x4d0b07[_0xb160('0x4e')]['id']){delete _0x4d0b07[_0xb160('0x4e')]['id'];}return db[_0xb160('0x30')][_0xb160('0x4c')]({'where':{'id':_0x4d0b07[_0xb160('0x55')]['id']}})[_0xb160('0x26')](handleEntityNotFound(_0x87669a,null))[_0xb160('0x26')](saveUpdates(_0x4d0b07[_0xb160('0x4e')],null))[_0xb160('0x26')](respondWithResult(_0x87669a,null))[_0xb160('0x48')](handleError(_0x87669a,null));};exports[_0xb160('0x2a')]=function(_0x3eef6a,_0x267c8b){return db[_0xb160('0x30')][_0xb160('0x4c')]({'where':{'id':_0x3eef6a[_0xb160('0x55')]['id']}})['then'](handleEntityNotFound(_0x267c8b,null))[_0xb160('0x26')](removeEntity(_0x267c8b,null))['catch'](handleError(_0x267c8b,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index e87dcf2..f36bb9d 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 _0x0283=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','define','Template'];(function(_0x4a5f20,_0x38a6a3){var _0x141e8b=function(_0x1d6501){while(--_0x1d6501){_0x4a5f20['push'](_0x4a5f20['shift']());}};_0x141e8b(++_0x38a6a3);}(_0x0283,0x120));var _0x3028=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0x0283[_0x3f88bc];return _0x4df1c4;};'use strict';var _=require(_0x3028('0x0'));var util=require(_0x3028('0x1'));var logger=require(_0x3028('0x2'))(_0x3028('0x3'));var moment=require('moment');var BPromise=require(_0x3028('0x4'));var rp=require(_0x3028('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3028('0x6'));var config=require('../../config/environment');var attributes=require('./template.attributes');module['exports']=function(_0x4c249d,_0x3f0a4e){return _0x4c249d[_0x3028('0x7')](_0x3028('0x8'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1538=['./template.attributes','exports','define','Template','tools_templates','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x1538,0x13d));var _0x8153=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0x1538[_0x3cfb0d];return _0x3486b4;};'use strict';var _=require('lodash');var util=require(_0x8153('0x0'));var logger=require(_0x8153('0x1'))(_0x8153('0x2'));var moment=require(_0x8153('0x3'));var BPromise=require(_0x8153('0x4'));var rp=require(_0x8153('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8153('0x6'));var config=require(_0x8153('0x7'));var attributes=require(_0x8153('0x8'));module[_0x8153('0x9')]=function(_0x59ed32,_0xe391fc){return _0x59ed32[_0x8153('0xa')](_0x8153('0xb'),attributes,{'tableName':_0x8153('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index fd84467..a2d966d 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 _0x8ae0=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetTemplate','Template','options','attributes','limit','include','model','map','lodash','util'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x8ae0,0x115));var _0x08ae=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x8ae0[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x08ae('0x0'));var util=require(_0x08ae('0x1'));var moment=require(_0x08ae('0x2'));var BPromise=require(_0x08ae('0x3'));var rs=require(_0x08ae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x08ae('0x5'))['db'];var utils=require(_0x08ae('0x6'));var logger=require(_0x08ae('0x7'))(_0x08ae('0x8'));var config=require(_0x08ae('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x08ae('0xa')][_0x08ae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14ece5,_0x539956,_0x16b61f){return new BPromise(function(_0x5880de,_0x49f013){return client['request'](_0x14ece5,_0x16b61f)[_0x08ae('0xc')](function(_0xff81d2){logger[_0x08ae('0xd')](_0x08ae('0xe'),_0x539956,'request\x20sent');logger[_0x08ae('0xf')](_0x08ae('0x10'),_0x539956,_0x08ae('0x11'),JSON[_0x08ae('0x12')](_0xff81d2));if(_0xff81d2[_0x08ae('0x13')]){if(_0xff81d2['error'][_0x08ae('0x14')]===0x1f4){logger[_0x08ae('0x13')](_0x08ae('0xe'),_0x539956,_0xff81d2['error'][_0x08ae('0x15')]);return _0x49f013(_0xff81d2[_0x08ae('0x13')][_0x08ae('0x15')]);}logger[_0x08ae('0x13')](_0x08ae('0xe'),_0x539956,_0xff81d2[_0x08ae('0x13')][_0x08ae('0x15')]);return _0x5880de(_0xff81d2[_0x08ae('0x13')][_0x08ae('0x15')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x539956,_0x08ae('0x11'));_0x5880de(_0xff81d2[_0x08ae('0x16')][_0x08ae('0x15')]);}})['catch'](function(_0x48ea78){logger['error'](_0x08ae('0xe'),_0x539956,_0x48ea78);_0x49f013(_0x48ea78);});});}exports[_0x08ae('0x17')]=function(_0x1589df){var _0x23365a=this;return new Promise(function(_0x36dc40,_0xfed2a3){return db[_0x08ae('0x18')]['findAll']({'raw':_0x1589df['options']?_0x1589df[_0x08ae('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1589df[_0x08ae('0x19')]?_0x1589df[_0x08ae('0x19')]['where']||null:null,'attributes':_0x1589df[_0x08ae('0x19')]?_0x1589df['options'][_0x08ae('0x1a')]||null:null,'limit':_0x1589df['options']?_0x1589df[_0x08ae('0x19')][_0x08ae('0x1b')]||null:null,'include':_0x1589df[_0x08ae('0x19')]?_0x1589df[_0x08ae('0x19')]['include']?_['map'](_0x1589df[_0x08ae('0x19')][_0x08ae('0x1c')],function(_0x1639a6){return{'model':db[_0x1639a6[_0x08ae('0x1d')]],'as':_0x1639a6['as'],'attributes':_0x1639a6[_0x08ae('0x1a')],'include':_0x1639a6[_0x08ae('0x1c')]?_[_0x08ae('0x1e')](_0x1639a6[_0x08ae('0x1c')],function(_0xbd97e1){return{'model':db[_0xbd97e1['model']],'as':_0xbd97e1['as'],'attributes':_0xbd97e1['attributes'],'include':_0xbd97e1[_0x08ae('0x1c')]?_[_0x08ae('0x1e')](_0xbd97e1[_0x08ae('0x1c')],function(_0x39ac46){return{'model':db[_0x39ac46[_0x08ae('0x1d')]],'as':_0x39ac46['as'],'attributes':_0x39ac46[_0x08ae('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x08ae('0xc')](function(_0xb30ce2){logger[_0x08ae('0xd')]('GetTemplate',_0x1589df);logger['debug']('GetTemplate',_0x1589df,JSON['stringify'](_0xb30ce2));_0x36dc40(_0xb30ce2);})['catch'](function(_0x121fbe){logger['error'](_0x08ae('0x17'),_0x121fbe[_0x08ae('0x15')],_0x1589df);_0xfed2a3(_0x23365a['error'](0x1f4,_0x121fbe['message']));});});}; \ No newline at end of file +var _0xf608=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTemplate','options','raw','model','map','include','attributes','debug','catch'];(function(_0x2ba356,_0x947db2){var _0x5eeda0=function(_0x3c4fe3){while(--_0x3c4fe3){_0x2ba356['push'](_0x2ba356['shift']());}};_0x5eeda0(++_0x947db2);}(_0xf608,0x1a4));var _0x8f60=function(_0x3d64cf,_0x30ed5f){_0x3d64cf=_0x3d64cf-0x0;var _0x5839fa=_0xf608[_0x3d64cf];return _0x5839fa;};'use strict';var _=require('lodash');var util=require(_0x8f60('0x0'));var moment=require(_0x8f60('0x1'));var BPromise=require(_0x8f60('0x2'));var rs=require(_0x8f60('0x3'));var fs=require('fs');var Redis=require(_0x8f60('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8f60('0x5'))(_0x8f60('0x6'));var config=require(_0x8f60('0x7'));var jayson=require(_0x8f60('0x8'));var client=jayson[_0x8f60('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a0a29,_0x54cc00,_0x1624c5){return new BPromise(function(_0x19034c,_0x1888ad){return client[_0x8f60('0xa')](_0x5a0a29,_0x1624c5)[_0x8f60('0xb')](function(_0x4306ac){logger[_0x8f60('0xc')](_0x8f60('0xd'),_0x54cc00,_0x8f60('0xe'));logger['debug'](_0x8f60('0xf'),_0x54cc00,'request\x20sent',JSON[_0x8f60('0x10')](_0x4306ac));if(_0x4306ac[_0x8f60('0x11')]){if(_0x4306ac[_0x8f60('0x11')][_0x8f60('0x12')]===0x1f4){logger[_0x8f60('0x11')](_0x8f60('0xd'),_0x54cc00,_0x4306ac[_0x8f60('0x11')][_0x8f60('0x13')]);return _0x1888ad(_0x4306ac['error']['message']);}logger['error'](_0x8f60('0xd'),_0x54cc00,_0x4306ac[_0x8f60('0x11')]['message']);return _0x19034c(_0x4306ac[_0x8f60('0x11')][_0x8f60('0x13')]);}else{logger[_0x8f60('0xc')](_0x8f60('0xd'),_0x54cc00,_0x8f60('0xe'));_0x19034c(_0x4306ac[_0x8f60('0x14')]['message']);}})['catch'](function(_0x1c3ac3){logger[_0x8f60('0x11')](_0x8f60('0xd'),_0x54cc00,_0x1c3ac3);_0x1888ad(_0x1c3ac3);});});}exports[_0x8f60('0x15')]=function(_0x21e64f){var _0x208583=this;return new Promise(function(_0x23d740,_0x3d213c){return db['Template']['findAll']({'raw':_0x21e64f['options']?_0x21e64f[_0x8f60('0x16')][_0x8f60('0x17')]===undefined?!![]:![]:!![],'where':_0x21e64f[_0x8f60('0x16')]?_0x21e64f[_0x8f60('0x16')]['where']||null:null,'attributes':_0x21e64f[_0x8f60('0x16')]?_0x21e64f[_0x8f60('0x16')]['attributes']||null:null,'limit':_0x21e64f[_0x8f60('0x16')]?_0x21e64f[_0x8f60('0x16')]['limit']||null:null,'include':_0x21e64f[_0x8f60('0x16')]?_0x21e64f['options']['include']?_['map'](_0x21e64f[_0x8f60('0x16')]['include'],function(_0x173228){return{'model':db[_0x173228[_0x8f60('0x18')]],'as':_0x173228['as'],'attributes':_0x173228['attributes'],'include':_0x173228['include']?_[_0x8f60('0x19')](_0x173228[_0x8f60('0x1a')],function(_0x2715cb){return{'model':db[_0x2715cb[_0x8f60('0x18')]],'as':_0x2715cb['as'],'attributes':_0x2715cb['attributes'],'include':_0x2715cb[_0x8f60('0x1a')]?_[_0x8f60('0x19')](_0x2715cb[_0x8f60('0x1a')],function(_0x40a640){return{'model':db[_0x40a640[_0x8f60('0x18')]],'as':_0x40a640['as'],'attributes':_0x40a640[_0x8f60('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8f60('0xb')](function(_0xc1a1b9){logger[_0x8f60('0xc')](_0x8f60('0x15'),_0x21e64f);logger[_0x8f60('0x1c')](_0x8f60('0x15'),_0x21e64f,JSON[_0x8f60('0x10')](_0xc1a1b9));_0x23d740(_0xc1a1b9);})[_0x8f60('0x1d')](function(_0x3cc0b5){logger[_0x8f60('0x11')](_0x8f60('0x15'),_0x3cc0b5[_0x8f60('0x13')],_0x21e64f);_0x3d213c(_0x208583[_0x8f60('0x11')](0x1f4,_0x3cc0b5['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 81f5f87..fdcf4dd 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 _0xefdf=['express','Router','../../components/auth/service','../../components/interaction/service','./trigger.controller','isAuthenticated','get','/:id','show','/:id/any_conditions','getAnyConditions','getActions','post','create','/:id/all_conditions','addAnyCondition','/:id/actions','addAction','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x8529ba,_0xab9f8a){var _0x3660ac=function(_0x31c555){while(--_0x31c555){_0x8529ba['push'](_0x8529ba['shift']());}};_0x3660ac(++_0xab9f8a);}(_0xefdf,0x129));var _0xfefd=function(_0x5c85c8,_0x16110b){_0x5c85c8=_0x5c85c8-0x0;var _0x42d66f=_0xefdf[_0x5c85c8];return _0x42d66f;};'use strict';var multer=require('multer');var util=require(_0xfefd('0x0'));var path=require(_0xfefd('0x1'));var timeout=require(_0xfefd('0x2'));var express=require(_0xfefd('0x3'));var router=express[_0xfefd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfefd('0x5'));var interaction=require(_0xfefd('0x6'));var config=require('../../config/environment');var controller=require(_0xfefd('0x7'));router['get']('/',auth[_0xfefd('0x8')](),controller['index']);router[_0xfefd('0x9')](_0xfefd('0xa'),auth[_0xfefd('0x8')](),controller[_0xfefd('0xb')]);router[_0xfefd('0x9')]('/:id/all_conditions',auth['isAuthenticated'](),controller['getAllConditions']);router['get'](_0xfefd('0xc'),auth['isAuthenticated'](),controller[_0xfefd('0xd')]);router[_0xfefd('0x9')]('/:id/actions',auth[_0xfefd('0x8')](),controller[_0xfefd('0xe')]);router[_0xfefd('0xf')]('/',auth['isAuthenticated'](),controller[_0xfefd('0x10')]);router['post'](_0xfefd('0x11'),auth[_0xfefd('0x8')](),controller['addAllCondition']);router['post']('/:id/any_conditions',auth[_0xfefd('0x8')](),controller[_0xfefd('0x12')]);router[_0xfefd('0xf')](_0xfefd('0x13'),auth[_0xfefd('0x8')](),controller[_0xfefd('0x14')]);router[_0xfefd('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xfefd('0x16')]);router['delete'](_0xfefd('0xa'),auth['isAuthenticated'](),controller[_0xfefd('0x17')]);module[_0xfefd('0x18')]=router; \ No newline at end of file +var _0x315b=['get','isAuthenticated','index','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','addAnyCondition','addAction','put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller'];(function(_0x22fed7,_0x386e81){var _0x2feca2=function(_0x4e5dff){while(--_0x4e5dff){_0x22fed7['push'](_0x22fed7['shift']());}};_0x2feca2(++_0x386e81);}(_0x315b,0x162));var _0xb315=function(_0x185ee1,_0x5696e0){_0x185ee1=_0x185ee1-0x0;var _0x255b34=_0x315b[_0x185ee1];return _0x255b34;};'use strict';var multer=require(_0xb315('0x0'));var util=require(_0xb315('0x1'));var path=require(_0xb315('0x2'));var timeout=require(_0xb315('0x3'));var express=require(_0xb315('0x4'));var router=express['Router']();var fs_extra=require(_0xb315('0x5'));var auth=require(_0xb315('0x6'));var interaction=require(_0xb315('0x7'));var config=require(_0xb315('0x8'));var controller=require(_0xb315('0x9'));router[_0xb315('0xa')]('/',auth[_0xb315('0xb')](),controller[_0xb315('0xc')]);router['get'](_0xb315('0xd'),auth[_0xb315('0xb')](),controller['show']);router[_0xb315('0xa')](_0xb315('0xe'),auth[_0xb315('0xb')](),controller[_0xb315('0xf')]);router[_0xb315('0xa')](_0xb315('0x10'),auth[_0xb315('0xb')](),controller[_0xb315('0x11')]);router['get'](_0xb315('0x12'),auth[_0xb315('0xb')](),controller[_0xb315('0x13')]);router['post']('/',auth[_0xb315('0xb')](),controller[_0xb315('0x14')]);router[_0xb315('0x15')]('/:id/all_conditions',auth[_0xb315('0xb')](),controller[_0xb315('0x16')]);router['post'](_0xb315('0x10'),auth[_0xb315('0xb')](),controller[_0xb315('0x17')]);router[_0xb315('0x15')](_0xb315('0x12'),auth[_0xb315('0xb')](),controller[_0xb315('0x18')]);router[_0xb315('0x19')](_0xb315('0xd'),auth[_0xb315('0xb')](),controller[_0xb315('0x1a')]);router[_0xb315('0x1b')]('/:id',auth[_0xb315('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index abc762b..4a829b5 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 _0x9aa9=['STRING','sequelize'];(function(_0x11ab2c,_0x4ebf1c){var _0x41af3d=function(_0x406746){while(--_0x406746){_0x11ab2c['push'](_0x11ab2c['shift']());}};_0x41af3d(++_0x4ebf1c);}(_0x9aa9,0x193));var _0x99aa=function(_0x1bfc2d,_0x181462){_0x1bfc2d=_0x1bfc2d-0x0;var _0x501195=_0x9aa9[_0x1bfc2d];return _0x501195;};'use strict';var Sequelize=require(_0x99aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x99aa('0x1')]},'channel':{'type':Sequelize[_0x99aa('0x1')]},'description':{'type':Sequelize[_0x99aa('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa209=['STRING','BOOLEAN','sequelize','exports'];(function(_0x231962,_0x382414){var _0x40a960=function(_0x5e8708){while(--_0x5e8708){_0x231962['push'](_0x231962['shift']());}};_0x40a960(++_0x382414);}(_0xa209,0xba));var _0x9a20=function(_0x32de24,_0x200829){_0x32de24=_0x32de24-0x0;var _0xf5f735=_0xa209[_0x32de24];return _0xf5f735;};'use strict';var Sequelize=require(_0x9a20('0x0'));module[_0x9a20('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9a20('0x2')]},'description':{'type':Sequelize[_0x9a20('0x2')]},'status':{'type':Sequelize[_0x9a20('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index e91fbac..bf7b98a 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 _0x4ea6=['attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','count','includeAll','findAll','rows','catch','include','create','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','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','getAnyConditions','TriggerId','Action','getActions','pick','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','then','destroy','get','Triggers','error','name','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields'];(function(_0x35f83e,_0x30ec55){var _0x249b05=function(_0x2c2fcc){while(--_0x2c2fcc){_0x35f83e['push'](_0x35f83e['shift']());}};_0x249b05(++_0x30ec55);}(_0x4ea6,0x146));var _0x64ea=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0x4ea6[_0x396466];return _0x5e9ab4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x64ea('0x0'));var zipdir=require(_0x64ea('0x1'));var jsonpatch=require(_0x64ea('0x2'));var rp=require(_0x64ea('0x3'));var moment=require(_0x64ea('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x64ea('0x5'));var sox=require(_0x64ea('0x6'));var csv=require(_0x64ea('0x7'));var ejs=require(_0x64ea('0x8'));var fs=require('fs');var fs_extra=require(_0x64ea('0x9'));var _=require('lodash');var squel=require(_0x64ea('0xa'));var crypto=require(_0x64ea('0xb'));var jsforce=require(_0x64ea('0xc'));var deskjs=require(_0x64ea('0xd'));var toCsv=require(_0x64ea('0x7'));var querystring=require(_0x64ea('0xe'));var Papa=require(_0x64ea('0xf'));var Redis=require(_0x64ea('0x10'));var authService=require(_0x64ea('0x11'));var qs=require(_0x64ea('0x12'));var as=require(_0x64ea('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x64ea('0x14'))(_0x64ea('0x15'));var utils=require('../../config/utils');var config=require(_0x64ea('0x16'));var licenseUtil=require(_0x64ea('0x17'));var db=require(_0x64ea('0x18'))['db'];function respondWithStatusCode(_0x264f7b,_0x5bf0b4){_0x5bf0b4=_0x5bf0b4||0xcc;return function(_0x5658be){if(_0x5658be){return _0x264f7b[_0x64ea('0x19')](_0x5bf0b4);}return _0x264f7b[_0x64ea('0x1a')](_0x5bf0b4)[_0x64ea('0x1b')]();};}function respondWithResult(_0x369cc8,_0xe9799f){_0xe9799f=_0xe9799f||0xc8;return function(_0x48a279){if(_0x48a279){return _0x369cc8[_0x64ea('0x1a')](_0xe9799f)[_0x64ea('0x1c')](_0x48a279);}};}function respondWithFilteredResult(_0x26088e,_0xff5c32){return function(_0x52468c){if(_0x52468c){var _0x1d780e=typeof _0xff5c32[_0x64ea('0x1d')]==='undefined'&&typeof _0xff5c32[_0x64ea('0x1e')]===_0x64ea('0x1f');var _0x1ffc33=_0x52468c['count'];var _0x17f57e=_0x1d780e?0x0:_0xff5c32[_0x64ea('0x1d')];var _0x5a4215=_0x1d780e?_0x52468c['count']:_0xff5c32[_0x64ea('0x1d')]+_0xff5c32[_0x64ea('0x1e')];var _0x589997;if(_0x5a4215>=_0x1ffc33){_0x5a4215=_0x1ffc33;_0x589997=0xc8;}else{_0x589997=0xce;}_0x26088e['status'](_0x589997);return _0x26088e[_0x64ea('0x20')](_0x64ea('0x21'),_0x17f57e+'-'+_0x5a4215+'/'+_0x1ffc33)[_0x64ea('0x1c')](_0x52468c);}return null;};}function patchUpdates(_0x597a50){return function(_0x4b3611){try{jsonpatch[_0x64ea('0x22')](_0x4b3611,_0x597a50,!![]);}catch(_0x3e4a95){return BPromise[_0x64ea('0x23')](_0x3e4a95);}return _0x4b3611[_0x64ea('0x24')]();};}function saveUpdates(_0x5f3781,_0x4d4436){return function(_0x3841b2){if(_0x3841b2){return _0x3841b2['update'](_0x5f3781)[_0x64ea('0x25')](function(_0x45b8c3){return _0x45b8c3;});}return null;};}function removeEntity(_0x5f3520,_0x3c41db){return function(_0x17905b){if(_0x17905b){return _0x17905b[_0x64ea('0x26')]()[_0x64ea('0x25')](function(){var _0x44bea7=_0x17905b[_0x64ea('0x27')]({'plain':!![]});var _0x65a8c5=_0x64ea('0x28');return db['UserProfileResource'][_0x64ea('0x26')]({'where':{'type':_0x65a8c5,'resourceId':_0x44bea7['id']}})[_0x64ea('0x25')](function(){return _0x17905b;});})[_0x64ea('0x25')](function(){_0x5f3520[_0x64ea('0x1a')](0xcc)[_0x64ea('0x1b')]();});}};}function handleEntityNotFound(_0x3a9723,_0x44f12b){return function(_0x596fd2){if(!_0x596fd2){_0x3a9723[_0x64ea('0x19')](0x194);}return _0x596fd2;};}function handleError(_0x44c00d,_0x3cf5c4){_0x3cf5c4=_0x3cf5c4||0x1f4;return function(_0x2d4e69){logger[_0x64ea('0x29')](_0x2d4e69['stack']);if(_0x2d4e69[_0x64ea('0x2a')]){delete _0x2d4e69[_0x64ea('0x2a')];}_0x44c00d[_0x64ea('0x1a')](_0x3cf5c4)['send'](_0x2d4e69);};}exports['index']=function(_0xdafc1e,_0xdd5866){var _0x5bae26={},_0xc0b77f={},_0x20a1f6={'count':0x0,'rows':[]};var _0x38b840=_[_0x64ea('0x2b')](db[_0x64ea('0x2c')][_0x64ea('0x2d')],function(_0x5e2dc){return{'name':_0x5e2dc[_0x64ea('0x2e')],'type':_0x5e2dc[_0x64ea('0x2f')][_0x64ea('0x30')]};});_0xc0b77f[_0x64ea('0x31')]=_[_0x64ea('0x2b')](_0x38b840,_0x64ea('0x2a'));_0xc0b77f[_0x64ea('0x32')]=_[_0x64ea('0x33')](_0xdafc1e[_0x64ea('0x32')]);_0xc0b77f['filters']=_[_0x64ea('0x34')](_0xc0b77f[_0x64ea('0x31')],_0xc0b77f[_0x64ea('0x32')]);_0x5bae26['attributes']=_[_0x64ea('0x34')](_0xc0b77f[_0x64ea('0x31')],qs[_0x64ea('0x35')](_0xdafc1e[_0x64ea('0x32')][_0x64ea('0x35')]));_0x5bae26[_0x64ea('0x36')]=_0x5bae26[_0x64ea('0x36')][_0x64ea('0x37')]?_0x5bae26['attributes']:_0xc0b77f[_0x64ea('0x31')];if(!_0xdafc1e[_0x64ea('0x32')][_0x64ea('0x38')](_0x64ea('0x39'))){_0x5bae26[_0x64ea('0x1e')]=qs[_0x64ea('0x1e')](_0xdafc1e['query'][_0x64ea('0x1e')]);_0x5bae26[_0x64ea('0x1d')]=qs[_0x64ea('0x1d')](_0xdafc1e['query'][_0x64ea('0x1d')]);}_0x5bae26[_0x64ea('0x3a')]=qs[_0x64ea('0x3b')](_0xdafc1e[_0x64ea('0x32')][_0x64ea('0x3b')]);_0x5bae26[_0x64ea('0x3c')]=qs[_0x64ea('0x3d')](_['pick'](_0xdafc1e[_0x64ea('0x32')],_0xc0b77f[_0x64ea('0x3d')]),_0x38b840);if(_0xdafc1e[_0x64ea('0x32')]['filter']){_0x5bae26[_0x64ea('0x3c')]=_['merge'](_0x5bae26[_0x64ea('0x3c')],{'$or':_[_0x64ea('0x2b')](_0x38b840,function(_0x1d705a){if(_0x1d705a[_0x64ea('0x2f')]!==_0x64ea('0x3e')){var _0x7e6abe={};_0x7e6abe[_0x1d705a[_0x64ea('0x2a')]]={'$like':'%'+_0xdafc1e[_0x64ea('0x32')][_0x64ea('0x3f')]+'%'};return _0x7e6abe;}})});}_0x5bae26=_[_0x64ea('0x40')]({},_0x5bae26,_0xdafc1e[_0x64ea('0x41')]);var _0x316421={'where':_0x5bae26[_0x64ea('0x3c')]};return db[_0x64ea('0x2c')][_0x64ea('0x42')](_0x316421)[_0x64ea('0x25')](function(_0x380b71){_0x20a1f6['count']=_0x380b71;if(_0xdafc1e[_0x64ea('0x32')][_0x64ea('0x43')]){_0x5bae26['include']=[{'all':!![]}];}return db[_0x64ea('0x2c')][_0x64ea('0x44')](_0x5bae26);})[_0x64ea('0x25')](function(_0xda4c43){_0x20a1f6[_0x64ea('0x45')]=_0xda4c43;return _0x20a1f6;})['then'](respondWithFilteredResult(_0xdd5866,_0x5bae26))[_0x64ea('0x46')](handleError(_0xdd5866,null));};exports['show']=function(_0x529a33,_0x2ddefc){var _0x44ad67={'raw':![],'where':{'id':_0x529a33['params']['id']}},_0x45fc66={};_0x45fc66['model']=_[_0x64ea('0x33')](db[_0x64ea('0x2c')][_0x64ea('0x2d')]);_0x45fc66['query']=_[_0x64ea('0x33')](_0x529a33['query']);_0x45fc66[_0x64ea('0x3d')]=_[_0x64ea('0x34')](_0x45fc66['model'],_0x45fc66[_0x64ea('0x32')]);_0x44ad67[_0x64ea('0x36')]=_[_0x64ea('0x34')](_0x45fc66[_0x64ea('0x31')],qs['fields'](_0x529a33[_0x64ea('0x32')][_0x64ea('0x35')]));_0x44ad67[_0x64ea('0x36')]=_0x44ad67[_0x64ea('0x36')][_0x64ea('0x37')]?_0x44ad67['attributes']:_0x45fc66[_0x64ea('0x31')];if(_0x529a33[_0x64ea('0x32')][_0x64ea('0x43')]){_0x44ad67[_0x64ea('0x47')]=[{'all':!![]}];}_0x44ad67=_[_0x64ea('0x40')]({},_0x44ad67,_0x529a33[_0x64ea('0x41')]);return db[_0x64ea('0x2c')]['find'](_0x44ad67)[_0x64ea('0x25')](handleEntityNotFound(_0x2ddefc,null))[_0x64ea('0x25')](respondWithResult(_0x2ddefc,null))[_0x64ea('0x46')](handleError(_0x2ddefc,null));};exports['create']=function(_0x22efa7,_0x1c108c){return db['Trigger'][_0x64ea('0x48')](_0x22efa7[_0x64ea('0x49')],{})[_0x64ea('0x25')](function(_0x2281aa){var _0x5d2492=_0x22efa7[_0x64ea('0x4a')][_0x64ea('0x27')]({'plain':!![]});if(!_0x5d2492)throw new Error(_0x64ea('0x4b'));if(_0x5d2492[_0x64ea('0x4c')]===_0x64ea('0x4a')){var _0x21015c=_0x2281aa['get']({'plain':!![]});var _0x4fced6=_0x64ea('0x28');return db[_0x64ea('0x4d')][_0x64ea('0x4e')]({'where':{'name':_0x4fced6,'userProfileId':_0x5d2492[_0x64ea('0x4f')]},'raw':!![]})[_0x64ea('0x25')](function(_0x336942){if(_0x336942&&_0x336942[_0x64ea('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x21015c[_0x64ea('0x2a')],'resourceId':_0x21015c['id'],'type':_0x336942['name'],'sectionId':_0x336942['id']},{})[_0x64ea('0x25')](function(){return _0x2281aa;});}else{return _0x2281aa;}})[_0x64ea('0x46')](function(_0x41f72c){logger[_0x64ea('0x29')](_0x64ea('0x51'),_0x41f72c);throw _0x41f72c;});}return _0x2281aa;})[_0x64ea('0x25')](respondWithResult(_0x1c108c,0xc9))[_0x64ea('0x46')](handleError(_0x1c108c,null));};exports['update']=function(_0x445d79,_0x3c07cb){if(_0x445d79[_0x64ea('0x49')]['id']){delete _0x445d79[_0x64ea('0x49')]['id'];}return db['Trigger'][_0x64ea('0x4e')]({'where':{'id':_0x445d79[_0x64ea('0x52')]['id']}})[_0x64ea('0x25')](handleEntityNotFound(_0x3c07cb,null))['then'](saveUpdates(_0x445d79['body'],null))[_0x64ea('0x25')](respondWithResult(_0x3c07cb,null))[_0x64ea('0x46')](handleError(_0x3c07cb,null));};exports[_0x64ea('0x26')]=function(_0x4516dc,_0x18d2ca){return db[_0x64ea('0x2c')]['find']({'where':{'id':_0x4516dc[_0x64ea('0x52')]['id']}})[_0x64ea('0x25')](handleEntityNotFound(_0x18d2ca,null))[_0x64ea('0x25')](removeEntity(_0x18d2ca,null))[_0x64ea('0x46')](handleError(_0x18d2ca,null));};exports[_0x64ea('0x53')]=function(_0xeaf065,_0x343203,_0x27c937){if(_0xeaf065['body']['id']){delete _0xeaf065['body']['id'];}return db['Trigger'][_0x64ea('0x4e')]({'where':{'id':_0xeaf065[_0x64ea('0x52')]['id']}})[_0x64ea('0x25')](handleEntityNotFound(_0x343203,null))[_0x64ea('0x25')](function(_0x4bd778){if(_0x4bd778){_0xeaf065[_0x64ea('0x49')][_0x64ea('0x54')]=_0x4bd778['id'];return db['Condition'][_0x64ea('0x48')](_0xeaf065[_0x64ea('0x49')]);}})[_0x64ea('0x25')](respondWithResult(_0x343203,null))['catch'](handleError(_0x343203,null));};exports[_0x64ea('0x55')]=function(_0x4dbf2a,_0x92ba12,_0x426c48){if(_0x4dbf2a[_0x64ea('0x49')]['id']){delete _0x4dbf2a['body']['id'];}return db[_0x64ea('0x2c')][_0x64ea('0x4e')]({'where':{'id':_0x4dbf2a['params']['id']}})[_0x64ea('0x25')](handleEntityNotFound(_0x92ba12,null))[_0x64ea('0x25')](function(_0xa8860f){if(_0xa8860f){_0x4dbf2a[_0x64ea('0x49')][_0x64ea('0x56')]=_0xa8860f['id'];return db[_0x64ea('0x57')]['create'](_0x4dbf2a[_0x64ea('0x49')]);}})[_0x64ea('0x25')](respondWithResult(_0x92ba12,null))[_0x64ea('0x46')](handleError(_0x92ba12,null));};exports[_0x64ea('0x58')]=function(_0x1ca08e,_0x3ffcb3,_0x2c9811){var _0x37a768={};var _0x4d0996={};var _0x518f9c;var _0x19ccc9;return db['Trigger']['findOne']({'where':{'id':_0x1ca08e[_0x64ea('0x52')]['id']}})[_0x64ea('0x25')](handleEntityNotFound(_0x3ffcb3,null))[_0x64ea('0x25')](function(_0xd8fc8c){if(_0xd8fc8c){_0x518f9c=_0xd8fc8c;_0x4d0996[_0x64ea('0x31')]=_[_0x64ea('0x33')](db[_0x64ea('0x57')][_0x64ea('0x2d')]);_0x4d0996[_0x64ea('0x32')]=_[_0x64ea('0x33')](_0x1ca08e[_0x64ea('0x32')]);_0x4d0996[_0x64ea('0x3d')]=_[_0x64ea('0x34')](_0x4d0996[_0x64ea('0x31')],_0x4d0996[_0x64ea('0x32')]);_0x37a768[_0x64ea('0x36')]=_[_0x64ea('0x34')](_0x4d0996[_0x64ea('0x31')],qs[_0x64ea('0x35')](_0x1ca08e[_0x64ea('0x32')][_0x64ea('0x35')]));_0x37a768[_0x64ea('0x36')]=_0x37a768['attributes'][_0x64ea('0x37')]?_0x37a768['attributes']:_0x4d0996[_0x64ea('0x31')];_0x37a768[_0x64ea('0x3a')]=qs['sort'](_0x1ca08e[_0x64ea('0x32')]['sort']);_0x37a768['where']=qs[_0x64ea('0x3d')](_['pick'](_0x1ca08e['query'],_0x4d0996[_0x64ea('0x3d')]));if(_0x1ca08e['query'][_0x64ea('0x3f')]){_0x37a768[_0x64ea('0x3c')]=_[_0x64ea('0x40')](_0x37a768['where'],{'$or':_[_0x64ea('0x2b')](_0x37a768['attributes'],function(_0x201369){var _0x436558={};_0x436558[_0x201369]={'$like':'%'+_0x1ca08e[_0x64ea('0x32')][_0x64ea('0x3f')]+'%'};return _0x436558;})});}_0x37a768=_[_0x64ea('0x40')]({},_0x37a768,_0x1ca08e['options']);return _0x518f9c[_0x64ea('0x58')](_0x37a768);}})[_0x64ea('0x25')](function(_0x82adac){if(_0x82adac){_0x19ccc9=_0x82adac[_0x64ea('0x37')];if(!_0x1ca08e['query']['hasOwnProperty']('nolimit')){_0x37a768[_0x64ea('0x1e')]=qs[_0x64ea('0x1e')](_0x1ca08e[_0x64ea('0x32')][_0x64ea('0x1e')]);_0x37a768[_0x64ea('0x1d')]=qs[_0x64ea('0x1d')](_0x1ca08e['query'][_0x64ea('0x1d')]);}return _0x518f9c[_0x64ea('0x58')](_0x37a768);}})[_0x64ea('0x25')](function(_0x597bc0){if(_0x597bc0){return _0x597bc0?{'count':_0x19ccc9,'rows':_0x597bc0}:null;}})[_0x64ea('0x25')](respondWithResult(_0x3ffcb3,null))['catch'](handleError(_0x3ffcb3,null));};exports['getAnyConditions']=function(_0x363310,_0x3a23f6,_0xf927e8){var _0x1abfae={};var _0x409620={};var _0x503efc;var _0x3c68d6;return db[_0x64ea('0x2c')][_0x64ea('0x59')]({'where':{'id':_0x363310[_0x64ea('0x52')]['id']}})[_0x64ea('0x25')](handleEntityNotFound(_0x3a23f6,null))[_0x64ea('0x25')](function(_0x448716){if(_0x448716){_0x503efc=_0x448716;_0x409620[_0x64ea('0x31')]=_[_0x64ea('0x33')](db[_0x64ea('0x57')][_0x64ea('0x2d')]);_0x409620[_0x64ea('0x32')]=_['keys'](_0x363310[_0x64ea('0x32')]);_0x409620[_0x64ea('0x3d')]=_['intersection'](_0x409620[_0x64ea('0x31')],_0x409620[_0x64ea('0x32')]);_0x1abfae['attributes']=_['intersection'](_0x409620[_0x64ea('0x31')],qs[_0x64ea('0x35')](_0x363310[_0x64ea('0x32')][_0x64ea('0x35')]));_0x1abfae[_0x64ea('0x36')]=_0x1abfae[_0x64ea('0x36')][_0x64ea('0x37')]?_0x1abfae[_0x64ea('0x36')]:_0x409620[_0x64ea('0x31')];_0x1abfae[_0x64ea('0x3a')]=qs[_0x64ea('0x3b')](_0x363310['query'][_0x64ea('0x3b')]);_0x1abfae['where']=qs['filters'](_['pick'](_0x363310[_0x64ea('0x32')],_0x409620[_0x64ea('0x3d')]));if(_0x363310['query']['filter']){_0x1abfae[_0x64ea('0x3c')]=_['merge'](_0x1abfae[_0x64ea('0x3c')],{'$or':_[_0x64ea('0x2b')](_0x1abfae[_0x64ea('0x36')],function(_0x218486){var _0x282649={};_0x282649[_0x218486]={'$like':'%'+_0x363310[_0x64ea('0x32')][_0x64ea('0x3f')]+'%'};return _0x282649;})});}_0x1abfae=_[_0x64ea('0x40')]({},_0x1abfae,_0x363310['options']);return _0x503efc['getAnyConditions'](_0x1abfae);}})[_0x64ea('0x25')](function(_0x427b40){if(_0x427b40){_0x3c68d6=_0x427b40[_0x64ea('0x37')];if(!_0x363310[_0x64ea('0x32')][_0x64ea('0x38')](_0x64ea('0x39'))){_0x1abfae[_0x64ea('0x1e')]=qs[_0x64ea('0x1e')](_0x363310[_0x64ea('0x32')]['limit']);_0x1abfae[_0x64ea('0x1d')]=qs['offset'](_0x363310[_0x64ea('0x32')]['offset']);}return _0x503efc[_0x64ea('0x5a')](_0x1abfae);}})[_0x64ea('0x25')](function(_0x31d7b3){if(_0x31d7b3){return _0x31d7b3?{'count':_0x3c68d6,'rows':_0x31d7b3}:null;}})[_0x64ea('0x25')](respondWithResult(_0x3a23f6,null))[_0x64ea('0x46')](handleError(_0x3a23f6,null));};exports['addAction']=function(_0x2b09d7,_0x8c8d92,_0x1f125f){if(_0x2b09d7[_0x64ea('0x49')]['id']){delete _0x2b09d7[_0x64ea('0x49')]['id'];}return db[_0x64ea('0x2c')][_0x64ea('0x4e')]({'where':{'id':_0x2b09d7[_0x64ea('0x52')]['id']}})[_0x64ea('0x25')](handleEntityNotFound(_0x8c8d92,null))[_0x64ea('0x25')](function(_0x7bedb9){if(_0x7bedb9){_0x2b09d7['body'][_0x64ea('0x5b')]=_0x7bedb9['id'];return db[_0x64ea('0x5c')]['create'](_0x2b09d7[_0x64ea('0x49')]);}})[_0x64ea('0x25')](respondWithResult(_0x8c8d92,null))[_0x64ea('0x46')](handleError(_0x8c8d92,null));};exports[_0x64ea('0x5d')]=function(_0x8219d9,_0x24aada,_0x4af20c){var _0x1f0e21={};var _0x5a4b54={};var _0xcfc0b6;var _0xbac262;return db[_0x64ea('0x2c')][_0x64ea('0x59')]({'where':{'id':_0x8219d9['params']['id']}})['then'](handleEntityNotFound(_0x24aada,null))[_0x64ea('0x25')](function(_0x3ce7c2){if(_0x3ce7c2){_0xcfc0b6=_0x3ce7c2;_0x5a4b54[_0x64ea('0x31')]=_[_0x64ea('0x33')](db[_0x64ea('0x5c')][_0x64ea('0x2d')]);_0x5a4b54[_0x64ea('0x32')]=_[_0x64ea('0x33')](_0x8219d9['query']);_0x5a4b54[_0x64ea('0x3d')]=_['intersection'](_0x5a4b54[_0x64ea('0x31')],_0x5a4b54[_0x64ea('0x32')]);_0x1f0e21[_0x64ea('0x36')]=_[_0x64ea('0x34')](_0x5a4b54['model'],qs[_0x64ea('0x35')](_0x8219d9[_0x64ea('0x32')][_0x64ea('0x35')]));_0x1f0e21[_0x64ea('0x36')]=_0x1f0e21[_0x64ea('0x36')][_0x64ea('0x37')]?_0x1f0e21[_0x64ea('0x36')]:_0x5a4b54[_0x64ea('0x31')];_0x1f0e21['order']=qs['sort'](_0x8219d9[_0x64ea('0x32')][_0x64ea('0x3b')]);_0x1f0e21['where']=qs[_0x64ea('0x3d')](_[_0x64ea('0x5e')](_0x8219d9['query'],_0x5a4b54[_0x64ea('0x3d')]));if(_0x8219d9[_0x64ea('0x32')][_0x64ea('0x3f')]){_0x1f0e21['where']=_[_0x64ea('0x40')](_0x1f0e21[_0x64ea('0x3c')],{'$or':_['map'](_0x1f0e21[_0x64ea('0x36')],function(_0x5a5441){var _0x32712b={};_0x32712b[_0x5a5441]={'$like':'%'+_0x8219d9[_0x64ea('0x32')][_0x64ea('0x3f')]+'%'};return _0x32712b;})});}_0x1f0e21=_['merge']({},_0x1f0e21,_0x8219d9[_0x64ea('0x41')]);return _0xcfc0b6[_0x64ea('0x5d')](_0x1f0e21);}})[_0x64ea('0x25')](function(_0x58505f){if(_0x58505f){_0xbac262=_0x58505f['length'];if(!_0x8219d9[_0x64ea('0x32')][_0x64ea('0x38')](_0x64ea('0x39'))){_0x1f0e21[_0x64ea('0x1e')]=qs[_0x64ea('0x1e')](_0x8219d9['query'][_0x64ea('0x1e')]);_0x1f0e21[_0x64ea('0x1d')]=qs[_0x64ea('0x1d')](_0x8219d9['query'][_0x64ea('0x1d')]);}return _0xcfc0b6[_0x64ea('0x5d')](_0x1f0e21);}})[_0x64ea('0x25')](function(_0x5495e1){if(_0x5495e1){return _0x5495e1?{'count':_0xbac262,'rows':_0x5495e1}:null;}})[_0x64ea('0x25')](respondWithResult(_0x24aada,null))[_0x64ea('0x46')](handleError(_0x24aada,null));}; \ No newline at end of file +var _0x3316=['includeAll','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Triggers','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addAllCondition','TriggerAllId','addAnyCondition','getAllConditions','findOne','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','UserProfileResource','error','stack','send','index','map','Trigger','rawAttributes','type','model','name','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','keys','length'];(function(_0x46bd1c,_0x5bbaf9){var _0x33da8c=function(_0x10b13c){while(--_0x10b13c){_0x46bd1c['push'](_0x46bd1c['shift']());}};_0x33da8c(++_0x5bbaf9);}(_0x3316,0xd2));var _0x6331=function(_0x2ae8ce,_0x2a5a1f){_0x2ae8ce=_0x2ae8ce-0x0;var _0x4bf686=_0x3316[_0x2ae8ce];return _0x4bf686;};'use strict';var emlformat=require(_0x6331('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6331('0x1'));var jsonpatch=require(_0x6331('0x2'));var rp=require(_0x6331('0x3'));var moment=require(_0x6331('0x4'));var BPromise=require(_0x6331('0x5'));var Mustache=require('mustache');var util=require(_0x6331('0x6'));var path=require(_0x6331('0x7'));var sox=require('sox');var csv=require(_0x6331('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6331('0x9'));var _=require(_0x6331('0xa'));var squel=require(_0x6331('0xb'));var crypto=require(_0x6331('0xc'));var jsforce=require(_0x6331('0xd'));var deskjs=require(_0x6331('0xe'));var toCsv=require(_0x6331('0x8'));var querystring=require(_0x6331('0xf'));var Papa=require(_0x6331('0x10'));var Redis=require(_0x6331('0x11'));var authService=require(_0x6331('0x12'));var qs=require(_0x6331('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6331('0x14'));var logger=require(_0x6331('0x15'))('api');var utils=require(_0x6331('0x16'));var config=require(_0x6331('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6331('0x18'))['db'];function respondWithStatusCode(_0x5604ac,_0x26325e){_0x26325e=_0x26325e||0xcc;return function(_0x3527a5){if(_0x3527a5){return _0x5604ac[_0x6331('0x19')](_0x26325e);}return _0x5604ac[_0x6331('0x1a')](_0x26325e)['end']();};}function respondWithResult(_0x251e43,_0x4308cb){_0x4308cb=_0x4308cb||0xc8;return function(_0xa4789d){if(_0xa4789d){return _0x251e43[_0x6331('0x1a')](_0x4308cb)[_0x6331('0x1b')](_0xa4789d);}};}function respondWithFilteredResult(_0xead74b,_0x2ebc96){return function(_0x94ea13){if(_0x94ea13){var _0x5b39c2=typeof _0x2ebc96[_0x6331('0x1c')]===_0x6331('0x1d')&&typeof _0x2ebc96[_0x6331('0x1e')]===_0x6331('0x1d');var _0x2bbbc9=_0x94ea13[_0x6331('0x1f')];var _0x5c4985=_0x5b39c2?0x0:_0x2ebc96[_0x6331('0x1c')];var _0x5ef432=_0x5b39c2?_0x94ea13[_0x6331('0x1f')]:_0x2ebc96[_0x6331('0x1c')]+_0x2ebc96[_0x6331('0x1e')];var _0x388121;if(_0x5ef432>=_0x2bbbc9){_0x5ef432=_0x2bbbc9;_0x388121=0xc8;}else{_0x388121=0xce;}_0xead74b[_0x6331('0x1a')](_0x388121);return _0xead74b[_0x6331('0x20')](_0x6331('0x21'),_0x5c4985+'-'+_0x5ef432+'/'+_0x2bbbc9)['json'](_0x94ea13);}return null;};}function patchUpdates(_0x2c1754){return function(_0x20484e){try{jsonpatch[_0x6331('0x22')](_0x20484e,_0x2c1754,!![]);}catch(_0x415d91){return BPromise['reject'](_0x415d91);}return _0x20484e[_0x6331('0x23')]();};}function saveUpdates(_0x4dc4df,_0x2217f4){return function(_0x425b62){if(_0x425b62){return _0x425b62[_0x6331('0x24')](_0x4dc4df)[_0x6331('0x25')](function(_0xcd4ec){return _0xcd4ec;});}return null;};}function removeEntity(_0x3a56ff,_0x2943c1){return function(_0x43db99){if(_0x43db99){return _0x43db99['destroy']()[_0x6331('0x25')](function(){var _0xfe3671=_0x43db99['get']({'plain':!![]});var _0x2d5abd='Triggers';return db[_0x6331('0x26')]['destroy']({'where':{'type':_0x2d5abd,'resourceId':_0xfe3671['id']}})[_0x6331('0x25')](function(){return _0x43db99;});})[_0x6331('0x25')](function(){_0x3a56ff[_0x6331('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x425fca,_0x3f6737){return function(_0x49df0a){if(!_0x49df0a){_0x425fca['sendStatus'](0x194);}return _0x49df0a;};}function handleError(_0xb1b05b,_0x2d1868){_0x2d1868=_0x2d1868||0x1f4;return function(_0x3fb4f7){logger[_0x6331('0x27')](_0x3fb4f7[_0x6331('0x28')]);if(_0x3fb4f7['name']){delete _0x3fb4f7['name'];}_0xb1b05b[_0x6331('0x1a')](_0x2d1868)[_0x6331('0x29')](_0x3fb4f7);};}exports[_0x6331('0x2a')]=function(_0xc769d6,_0x353304){var _0x347e58={},_0x3efdb5={},_0x33e8e9={'count':0x0,'rows':[]};var _0x37caf4=_[_0x6331('0x2b')](db[_0x6331('0x2c')][_0x6331('0x2d')],function(_0x17d7bd){return{'name':_0x17d7bd['fieldName'],'type':_0x17d7bd[_0x6331('0x2e')]['key']};});_0x3efdb5[_0x6331('0x2f')]=_[_0x6331('0x2b')](_0x37caf4,_0x6331('0x30'));_0x3efdb5['query']=_['keys'](_0xc769d6[_0x6331('0x31')]);_0x3efdb5['filters']=_[_0x6331('0x32')](_0x3efdb5[_0x6331('0x2f')],_0x3efdb5[_0x6331('0x31')]);_0x347e58[_0x6331('0x33')]=_[_0x6331('0x32')](_0x3efdb5[_0x6331('0x2f')],qs[_0x6331('0x34')](_0xc769d6[_0x6331('0x31')][_0x6331('0x34')]));_0x347e58[_0x6331('0x33')]=_0x347e58[_0x6331('0x33')]['length']?_0x347e58[_0x6331('0x33')]:_0x3efdb5['model'];if(!_0xc769d6[_0x6331('0x31')]['hasOwnProperty'](_0x6331('0x35'))){_0x347e58[_0x6331('0x1e')]=qs[_0x6331('0x1e')](_0xc769d6['query'][_0x6331('0x1e')]);_0x347e58[_0x6331('0x1c')]=qs['offset'](_0xc769d6[_0x6331('0x31')]['offset']);}_0x347e58[_0x6331('0x36')]=qs[_0x6331('0x37')](_0xc769d6[_0x6331('0x31')][_0x6331('0x37')]);_0x347e58[_0x6331('0x38')]=qs[_0x6331('0x39')](_[_0x6331('0x3a')](_0xc769d6[_0x6331('0x31')],_0x3efdb5[_0x6331('0x39')]),_0x37caf4);if(_0xc769d6[_0x6331('0x31')][_0x6331('0x3b')]){_0x347e58['where']=_[_0x6331('0x3c')](_0x347e58[_0x6331('0x38')],{'$or':_[_0x6331('0x2b')](_0x37caf4,function(_0x5d4314){if(_0x5d4314[_0x6331('0x2e')]!==_0x6331('0x3d')){var _0x1e9c8c={};_0x1e9c8c[_0x5d4314['name']]={'$like':'%'+_0xc769d6['query'][_0x6331('0x3b')]+'%'};return _0x1e9c8c;}})});}_0x347e58=_['merge']({},_0x347e58,_0xc769d6[_0x6331('0x3e')]);var _0x54d352={'where':_0x347e58[_0x6331('0x38')]};return db[_0x6331('0x2c')][_0x6331('0x1f')](_0x54d352)[_0x6331('0x25')](function(_0x63627d){_0x33e8e9[_0x6331('0x1f')]=_0x63627d;if(_0xc769d6[_0x6331('0x31')]['includeAll']){_0x347e58['include']=[{'all':!![]}];}return db[_0x6331('0x2c')][_0x6331('0x3f')](_0x347e58);})[_0x6331('0x25')](function(_0x42e6b8){_0x33e8e9[_0x6331('0x40')]=_0x42e6b8;return _0x33e8e9;})['then'](respondWithFilteredResult(_0x353304,_0x347e58))[_0x6331('0x41')](handleError(_0x353304,null));};exports[_0x6331('0x42')]=function(_0x2d8586,_0x65b63d){var _0xa0f3c5={'raw':![],'where':{'id':_0x2d8586['params']['id']}},_0x517607={};_0x517607[_0x6331('0x2f')]=_[_0x6331('0x43')](db[_0x6331('0x2c')][_0x6331('0x2d')]);_0x517607[_0x6331('0x31')]=_[_0x6331('0x43')](_0x2d8586[_0x6331('0x31')]);_0x517607[_0x6331('0x39')]=_['intersection'](_0x517607[_0x6331('0x2f')],_0x517607['query']);_0xa0f3c5[_0x6331('0x33')]=_['intersection'](_0x517607[_0x6331('0x2f')],qs[_0x6331('0x34')](_0x2d8586[_0x6331('0x31')][_0x6331('0x34')]));_0xa0f3c5['attributes']=_0xa0f3c5[_0x6331('0x33')][_0x6331('0x44')]?_0xa0f3c5[_0x6331('0x33')]:_0x517607[_0x6331('0x2f')];if(_0x2d8586[_0x6331('0x31')][_0x6331('0x45')]){_0xa0f3c5[_0x6331('0x46')]=[{'all':!![]}];}_0xa0f3c5=_[_0x6331('0x3c')]({},_0xa0f3c5,_0x2d8586[_0x6331('0x3e')]);return db[_0x6331('0x2c')][_0x6331('0x47')](_0xa0f3c5)['then'](handleEntityNotFound(_0x65b63d,null))['then'](respondWithResult(_0x65b63d,null))[_0x6331('0x41')](handleError(_0x65b63d,null));};exports['create']=function(_0x2ab356,_0x45ea18){return db[_0x6331('0x2c')][_0x6331('0x48')](_0x2ab356['body'],{})[_0x6331('0x25')](function(_0x8d2112){var _0x5c4bbe=_0x2ab356[_0x6331('0x49')][_0x6331('0x4a')]({'plain':!![]});if(!_0x5c4bbe)throw new Error(_0x6331('0x4b'));if(_0x5c4bbe['role']===_0x6331('0x49')){var _0x1df9ba=_0x8d2112['get']({'plain':!![]});var _0x5bd016=_0x6331('0x4c');return db[_0x6331('0x4d')]['find']({'where':{'name':_0x5bd016,'userProfileId':_0x5c4bbe['userProfileId']},'raw':!![]})[_0x6331('0x25')](function(_0x504960){if(_0x504960&&_0x504960[_0x6331('0x4e')]===0x0){return db[_0x6331('0x26')][_0x6331('0x48')]({'name':_0x1df9ba['name'],'resourceId':_0x1df9ba['id'],'type':_0x504960[_0x6331('0x30')],'sectionId':_0x504960['id']},{})['then'](function(){return _0x8d2112;});}else{return _0x8d2112;}})['catch'](function(_0x314545){logger[_0x6331('0x27')](_0x6331('0x4f'),_0x314545);throw _0x314545;});}return _0x8d2112;})['then'](respondWithResult(_0x45ea18,0xc9))[_0x6331('0x41')](handleError(_0x45ea18,null));};exports[_0x6331('0x24')]=function(_0x358215,_0x5c229b){if(_0x358215[_0x6331('0x50')]['id']){delete _0x358215[_0x6331('0x50')]['id'];}return db['Trigger']['find']({'where':{'id':_0x358215[_0x6331('0x51')]['id']}})[_0x6331('0x25')](handleEntityNotFound(_0x5c229b,null))[_0x6331('0x25')](saveUpdates(_0x358215['body'],null))['then'](respondWithResult(_0x5c229b,null))['catch'](handleError(_0x5c229b,null));};exports['destroy']=function(_0x167406,_0x44b3b3){return db[_0x6331('0x2c')][_0x6331('0x47')]({'where':{'id':_0x167406[_0x6331('0x51')]['id']}})['then'](handleEntityNotFound(_0x44b3b3,null))[_0x6331('0x25')](removeEntity(_0x44b3b3,null))[_0x6331('0x41')](handleError(_0x44b3b3,null));};exports[_0x6331('0x52')]=function(_0x178027,_0x13f259,_0x566a5a){if(_0x178027[_0x6331('0x50')]['id']){delete _0x178027[_0x6331('0x50')]['id'];}return db['Trigger'][_0x6331('0x47')]({'where':{'id':_0x178027[_0x6331('0x51')]['id']}})[_0x6331('0x25')](handleEntityNotFound(_0x13f259,null))['then'](function(_0x276a75){if(_0x276a75){_0x178027[_0x6331('0x50')][_0x6331('0x53')]=_0x276a75['id'];return db['Condition'][_0x6331('0x48')](_0x178027[_0x6331('0x50')]);}})[_0x6331('0x25')](respondWithResult(_0x13f259,null))['catch'](handleError(_0x13f259,null));};exports[_0x6331('0x54')]=function(_0x3207e8,_0x14371f,_0x1ad811){if(_0x3207e8[_0x6331('0x50')]['id']){delete _0x3207e8[_0x6331('0x50')]['id'];}return db['Trigger']['find']({'where':{'id':_0x3207e8[_0x6331('0x51')]['id']}})[_0x6331('0x25')](handleEntityNotFound(_0x14371f,null))[_0x6331('0x25')](function(_0x98efd9){if(_0x98efd9){_0x3207e8[_0x6331('0x50')]['TriggerAnyId']=_0x98efd9['id'];return db['Condition'][_0x6331('0x48')](_0x3207e8['body']);}})['then'](respondWithResult(_0x14371f,null))[_0x6331('0x41')](handleError(_0x14371f,null));};exports[_0x6331('0x55')]=function(_0xc65a80,_0x3e1659,_0x43c451){var _0x4cf59a={};var _0xe94beb={};var _0x119da5;var _0x1a5f27;return db['Trigger'][_0x6331('0x56')]({'where':{'id':_0xc65a80[_0x6331('0x51')]['id']}})[_0x6331('0x25')](handleEntityNotFound(_0x3e1659,null))[_0x6331('0x25')](function(_0xd50095){if(_0xd50095){_0x119da5=_0xd50095;_0xe94beb[_0x6331('0x2f')]=_[_0x6331('0x43')](db['Condition'][_0x6331('0x2d')]);_0xe94beb[_0x6331('0x31')]=_[_0x6331('0x43')](_0xc65a80[_0x6331('0x31')]);_0xe94beb[_0x6331('0x39')]=_['intersection'](_0xe94beb[_0x6331('0x2f')],_0xe94beb['query']);_0x4cf59a[_0x6331('0x33')]=_[_0x6331('0x32')](_0xe94beb[_0x6331('0x2f')],qs[_0x6331('0x34')](_0xc65a80[_0x6331('0x31')][_0x6331('0x34')]));_0x4cf59a[_0x6331('0x33')]=_0x4cf59a[_0x6331('0x33')][_0x6331('0x44')]?_0x4cf59a[_0x6331('0x33')]:_0xe94beb[_0x6331('0x2f')];_0x4cf59a['order']=qs[_0x6331('0x37')](_0xc65a80['query'][_0x6331('0x37')]);_0x4cf59a[_0x6331('0x38')]=qs[_0x6331('0x39')](_['pick'](_0xc65a80['query'],_0xe94beb[_0x6331('0x39')]));if(_0xc65a80[_0x6331('0x31')]['filter']){_0x4cf59a[_0x6331('0x38')]=_['merge'](_0x4cf59a['where'],{'$or':_[_0x6331('0x2b')](_0x4cf59a[_0x6331('0x33')],function(_0x1ce7fb){var _0x54e423={};_0x54e423[_0x1ce7fb]={'$like':'%'+_0xc65a80['query'][_0x6331('0x3b')]+'%'};return _0x54e423;})});}_0x4cf59a=_[_0x6331('0x3c')]({},_0x4cf59a,_0xc65a80[_0x6331('0x3e')]);return _0x119da5['getAllConditions'](_0x4cf59a);}})[_0x6331('0x25')](function(_0x295ec9){if(_0x295ec9){_0x1a5f27=_0x295ec9[_0x6331('0x44')];if(!_0xc65a80[_0x6331('0x31')][_0x6331('0x57')](_0x6331('0x35'))){_0x4cf59a[_0x6331('0x1e')]=qs[_0x6331('0x1e')](_0xc65a80[_0x6331('0x31')]['limit']);_0x4cf59a['offset']=qs[_0x6331('0x1c')](_0xc65a80['query'][_0x6331('0x1c')]);}return _0x119da5['getAllConditions'](_0x4cf59a);}})[_0x6331('0x25')](function(_0x3caba9){if(_0x3caba9){return _0x3caba9?{'count':_0x1a5f27,'rows':_0x3caba9}:null;}})['then'](respondWithResult(_0x3e1659,null))[_0x6331('0x41')](handleError(_0x3e1659,null));};exports[_0x6331('0x58')]=function(_0x2c8c3b,_0x4f9f82,_0x4183bd){var _0x1d51ee={};var _0x5211f8={};var _0x963910;var _0x2e038a;return db['Trigger']['findOne']({'where':{'id':_0x2c8c3b[_0x6331('0x51')]['id']}})[_0x6331('0x25')](handleEntityNotFound(_0x4f9f82,null))[_0x6331('0x25')](function(_0x27b436){if(_0x27b436){_0x963910=_0x27b436;_0x5211f8[_0x6331('0x2f')]=_[_0x6331('0x43')](db['Condition'][_0x6331('0x2d')]);_0x5211f8[_0x6331('0x31')]=_[_0x6331('0x43')](_0x2c8c3b['query']);_0x5211f8[_0x6331('0x39')]=_['intersection'](_0x5211f8['model'],_0x5211f8[_0x6331('0x31')]);_0x1d51ee[_0x6331('0x33')]=_[_0x6331('0x32')](_0x5211f8[_0x6331('0x2f')],qs['fields'](_0x2c8c3b[_0x6331('0x31')]['fields']));_0x1d51ee[_0x6331('0x33')]=_0x1d51ee['attributes'][_0x6331('0x44')]?_0x1d51ee[_0x6331('0x33')]:_0x5211f8[_0x6331('0x2f')];_0x1d51ee[_0x6331('0x36')]=qs[_0x6331('0x37')](_0x2c8c3b[_0x6331('0x31')][_0x6331('0x37')]);_0x1d51ee[_0x6331('0x38')]=qs[_0x6331('0x39')](_[_0x6331('0x3a')](_0x2c8c3b[_0x6331('0x31')],_0x5211f8[_0x6331('0x39')]));if(_0x2c8c3b[_0x6331('0x31')][_0x6331('0x3b')]){_0x1d51ee['where']=_[_0x6331('0x3c')](_0x1d51ee['where'],{'$or':_[_0x6331('0x2b')](_0x1d51ee[_0x6331('0x33')],function(_0x13dfa8){var _0x27f84c={};_0x27f84c[_0x13dfa8]={'$like':'%'+_0x2c8c3b[_0x6331('0x31')]['filter']+'%'};return _0x27f84c;})});}_0x1d51ee=_[_0x6331('0x3c')]({},_0x1d51ee,_0x2c8c3b[_0x6331('0x3e')]);return _0x963910[_0x6331('0x58')](_0x1d51ee);}})['then'](function(_0x1a8e8b){if(_0x1a8e8b){_0x2e038a=_0x1a8e8b['length'];if(!_0x2c8c3b[_0x6331('0x31')]['hasOwnProperty']('nolimit')){_0x1d51ee['limit']=qs[_0x6331('0x1e')](_0x2c8c3b['query'][_0x6331('0x1e')]);_0x1d51ee[_0x6331('0x1c')]=qs['offset'](_0x2c8c3b[_0x6331('0x31')][_0x6331('0x1c')]);}return _0x963910['getAnyConditions'](_0x1d51ee);}})[_0x6331('0x25')](function(_0x477971){if(_0x477971){return _0x477971?{'count':_0x2e038a,'rows':_0x477971}:null;}})[_0x6331('0x25')](respondWithResult(_0x4f9f82,null))[_0x6331('0x41')](handleError(_0x4f9f82,null));};exports[_0x6331('0x59')]=function(_0x5ea078,_0x3c4fe3,_0x267986){if(_0x5ea078[_0x6331('0x50')]['id']){delete _0x5ea078[_0x6331('0x50')]['id'];}return db[_0x6331('0x2c')][_0x6331('0x47')]({'where':{'id':_0x5ea078[_0x6331('0x51')]['id']}})[_0x6331('0x25')](handleEntityNotFound(_0x3c4fe3,null))[_0x6331('0x25')](function(_0x6c0bc4){if(_0x6c0bc4){_0x5ea078[_0x6331('0x50')][_0x6331('0x5a')]=_0x6c0bc4['id'];return db[_0x6331('0x5b')][_0x6331('0x48')](_0x5ea078['body']);}})[_0x6331('0x25')](respondWithResult(_0x3c4fe3,null))[_0x6331('0x41')](handleError(_0x3c4fe3,null));};exports[_0x6331('0x5c')]=function(_0xd53c39,_0xd23f46,_0x7b9f33){var _0x3101bd={};var _0x10a5e8={};var _0x16bdab;var _0x34bde4;return db['Trigger']['findOne']({'where':{'id':_0xd53c39[_0x6331('0x51')]['id']}})[_0x6331('0x25')](handleEntityNotFound(_0xd23f46,null))['then'](function(_0x1edfd5){if(_0x1edfd5){_0x16bdab=_0x1edfd5;_0x10a5e8[_0x6331('0x2f')]=_['keys'](db[_0x6331('0x5b')][_0x6331('0x2d')]);_0x10a5e8[_0x6331('0x31')]=_[_0x6331('0x43')](_0xd53c39[_0x6331('0x31')]);_0x10a5e8[_0x6331('0x39')]=_[_0x6331('0x32')](_0x10a5e8['model'],_0x10a5e8[_0x6331('0x31')]);_0x3101bd[_0x6331('0x33')]=_[_0x6331('0x32')](_0x10a5e8[_0x6331('0x2f')],qs['fields'](_0xd53c39[_0x6331('0x31')]['fields']));_0x3101bd[_0x6331('0x33')]=_0x3101bd[_0x6331('0x33')][_0x6331('0x44')]?_0x3101bd[_0x6331('0x33')]:_0x10a5e8[_0x6331('0x2f')];_0x3101bd[_0x6331('0x36')]=qs[_0x6331('0x37')](_0xd53c39[_0x6331('0x31')][_0x6331('0x37')]);_0x3101bd[_0x6331('0x38')]=qs[_0x6331('0x39')](_[_0x6331('0x3a')](_0xd53c39['query'],_0x10a5e8[_0x6331('0x39')]));if(_0xd53c39['query'][_0x6331('0x3b')]){_0x3101bd[_0x6331('0x38')]=_[_0x6331('0x3c')](_0x3101bd['where'],{'$or':_[_0x6331('0x2b')](_0x3101bd[_0x6331('0x33')],function(_0x21ad5c){var _0x45f6a2={};_0x45f6a2[_0x21ad5c]={'$like':'%'+_0xd53c39[_0x6331('0x31')]['filter']+'%'};return _0x45f6a2;})});}_0x3101bd=_['merge']({},_0x3101bd,_0xd53c39['options']);return _0x16bdab[_0x6331('0x5c')](_0x3101bd);}})[_0x6331('0x25')](function(_0x537fcf){if(_0x537fcf){_0x34bde4=_0x537fcf[_0x6331('0x44')];if(!_0xd53c39[_0x6331('0x31')][_0x6331('0x57')](_0x6331('0x35'))){_0x3101bd[_0x6331('0x1e')]=qs['limit'](_0xd53c39['query']['limit']);_0x3101bd[_0x6331('0x1c')]=qs['offset'](_0xd53c39['query'][_0x6331('0x1c')]);}return _0x16bdab[_0x6331('0x5c')](_0x3101bd);}})[_0x6331('0x25')](function(_0x2e65ec){if(_0x2e65ec){return _0x2e65ec?{'count':_0x34bde4,'rows':_0x2e65ec}:null;}})[_0x6331('0x25')](respondWithResult(_0xd23f46,null))[_0x6331('0x41')](handleError(_0xd23f46,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 7e493a2..098f5c2 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 _0xc01b=['Trigger','tools_triggers','lodash','util','../../config/logger','api','bluebird','request-promise','./trigger.attributes','exports','define'];(function(_0x2f5ea7,_0x3eb157){var _0xb24286=function(_0x16c2bb){while(--_0x16c2bb){_0x2f5ea7['push'](_0x2f5ea7['shift']());}};_0xb24286(++_0x3eb157);}(_0xc01b,0x65));var _0xbc01=function(_0x4451b0,_0x205311){_0x4451b0=_0x4451b0-0x0;var _0xe828b1=_0xc01b[_0x4451b0];return _0xe828b1;};'use strict';var _=require(_0xbc01('0x0'));var util=require(_0xbc01('0x1'));var logger=require(_0xbc01('0x2'))(_0xbc01('0x3'));var moment=require('moment');var BPromise=require(_0xbc01('0x4'));var rp=require(_0xbc01('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbc01('0x6'));module[_0xbc01('0x7')]=function(_0x53b2e6,_0x525a49){return _0x53b2e6[_0xbc01('0x8')](_0xbc01('0x9'),attributes,{'tableName':_0xbc01('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79d3=['Trigger','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports'];(function(_0x3bd61e,_0x38ef3f){var _0x5350c6=function(_0x55e34b){while(--_0x55e34b){_0x3bd61e['push'](_0x3bd61e['shift']());}};_0x5350c6(++_0x38ef3f);}(_0x79d3,0x15f));var _0x379d=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0x79d3[_0x4b174a];return _0x3cd7bf;};'use strict';var _=require(_0x379d('0x0'));var util=require('util');var logger=require(_0x379d('0x1'))('api');var moment=require(_0x379d('0x2'));var BPromise=require(_0x379d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x379d('0x4'));var rimraf=require(_0x379d('0x5'));var config=require(_0x379d('0x6'));var attributes=require(_0x379d('0x7'));module[_0x379d('0x8')]=function(_0x2078a6,_0x2a1b43){return _0x2078a6['define'](_0x379d('0x9'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 4dd6cde..5305ec0 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 _0x03cb=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Trigger,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrigger','find','util','moment','randomstring','ioredis'];(function(_0x5ecac1,_0x2d7338){var _0x1fe487=function(_0x94c196){while(--_0x94c196){_0x5ecac1['push'](_0x5ecac1['shift']());}};_0x1fe487(++_0x2d7338);}(_0x03cb,0x1eb));var _0xb03c=function(_0x35ba87,_0xc7d66a){_0x35ba87=_0x35ba87-0x0;var _0x336d59=_0x03cb[_0x35ba87];return _0x336d59;};'use strict';var _=require('lodash');var util=require(_0xb03c('0x0'));var moment=require(_0xb03c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb03c('0x2'));var fs=require('fs');var Redis=require(_0xb03c('0x3'));var db=require(_0xb03c('0x4'))['db'];var utils=require(_0xb03c('0x5'));var logger=require(_0xb03c('0x6'))(_0xb03c('0x7'));var config=require(_0xb03c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb03c('0x9')][_0xb03c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c8a21,_0x4fa6ee,_0x44367b){return new BPromise(function(_0x129793,_0x43bcaf){return client['request'](_0x2c8a21,_0x44367b)[_0xb03c('0xb')](function(_0x536b07){logger[_0xb03c('0xc')](_0xb03c('0xd'),_0x4fa6ee,'request\x20sent');logger[_0xb03c('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x4fa6ee,_0xb03c('0xf'),JSON['stringify'](_0x536b07));if(_0x536b07[_0xb03c('0x10')]){if(_0x536b07[_0xb03c('0x10')]['code']===0x1f4){logger[_0xb03c('0x10')](_0xb03c('0xd'),_0x4fa6ee,_0x536b07[_0xb03c('0x10')][_0xb03c('0x11')]);return _0x43bcaf(_0x536b07[_0xb03c('0x10')][_0xb03c('0x11')]);}logger[_0xb03c('0x10')](_0xb03c('0xd'),_0x4fa6ee,_0x536b07['error'][_0xb03c('0x11')]);return _0x129793(_0x536b07['error'][_0xb03c('0x11')]);}else{logger['info'](_0xb03c('0xd'),_0x4fa6ee,_0xb03c('0xf'));_0x129793(_0x536b07[_0xb03c('0x12')][_0xb03c('0x11')]);}})[_0xb03c('0x13')](function(_0xbe19ec){logger[_0xb03c('0x10')](_0xb03c('0xd'),_0x4fa6ee,_0xbe19ec);_0x43bcaf(_0xbe19ec);});});}exports[_0xb03c('0x14')]=function(_0x12246d){var _0x56eafe=this;return new Promise(function(_0x556014,_0x368eab){return db[_0xb03c('0x15')][_0xb03c('0x16')]({'raw':_0x12246d[_0xb03c('0x17')]?_0x12246d[_0xb03c('0x17')][_0xb03c('0x18')]===undefined?!![]:![]:!![],'where':_0x12246d['options']?_0x12246d['options'][_0xb03c('0x19')]||null:null,'attributes':_0x12246d[_0xb03c('0x17')]?_0x12246d[_0xb03c('0x17')][_0xb03c('0x1a')]||null:null,'limit':_0x12246d[_0xb03c('0x17')]?_0x12246d[_0xb03c('0x17')][_0xb03c('0x1b')]||null:null,'include':_0x12246d['options']?_0x12246d['options']['include']?_['map'](_0x12246d[_0xb03c('0x17')]['include'],function(_0x5f5337){return{'model':db[_0x5f5337['model']],'as':_0x5f5337['as'],'attributes':_0x5f5337[_0xb03c('0x1a')],'include':_0x5f5337[_0xb03c('0x1c')]?_[_0xb03c('0x1d')](_0x5f5337['include'],function(_0x3f3ee8){return{'model':db[_0x3f3ee8[_0xb03c('0x1e')]],'as':_0x3f3ee8['as'],'attributes':_0x3f3ee8[_0xb03c('0x1a')],'include':_0x3f3ee8[_0xb03c('0x1c')]?_[_0xb03c('0x1d')](_0x3f3ee8[_0xb03c('0x1c')],function(_0x55f80f){return{'model':db[_0x55f80f[_0xb03c('0x1e')]],'as':_0x55f80f['as'],'attributes':_0x55f80f[_0xb03c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb03c('0xb')](function(_0x10180a){logger[_0xb03c('0xc')](_0xb03c('0x14'),_0x12246d);logger[_0xb03c('0xe')](_0xb03c('0x14'),_0x12246d,JSON['stringify'](_0x10180a));_0x556014(_0x10180a);})[_0xb03c('0x13')](function(_0x4dd6a1){logger['error']('GetTrigger',_0x4dd6a1[_0xb03c('0x11')],_0x12246d);_0x368eab(_0x56eafe[_0xb03c('0x10')](0x1f4,_0x4dd6a1['message']));});});};exports[_0xb03c('0x1f')]=function(_0xd7535c){var _0x16b139=this;return new Promise(function(_0x46ebb0,_0x19e186){return db[_0xb03c('0x15')][_0xb03c('0x20')]({'raw':_0xd7535c[_0xb03c('0x17')]?_0xd7535c[_0xb03c('0x17')][_0xb03c('0x18')]===undefined?!![]:![]:!![],'where':_0xd7535c[_0xb03c('0x17')]?_0xd7535c[_0xb03c('0x17')][_0xb03c('0x19')]||null:null,'attributes':_0xd7535c[_0xb03c('0x17')]?_0xd7535c[_0xb03c('0x17')]['attributes']||null:null,'include':_0xd7535c[_0xb03c('0x17')]?_0xd7535c[_0xb03c('0x17')]['include']?_[_0xb03c('0x1d')](_0xd7535c[_0xb03c('0x17')][_0xb03c('0x1c')],function(_0x2aaad3){return{'model':db[_0x2aaad3['model']],'as':_0x2aaad3['as'],'attributes':_0x2aaad3[_0xb03c('0x1a')],'include':_0x2aaad3[_0xb03c('0x1c')]?_[_0xb03c('0x1d')](_0x2aaad3[_0xb03c('0x1c')],function(_0xaaaab5){return{'model':db[_0xaaaab5[_0xb03c('0x1e')]],'as':_0xaaaab5['as'],'attributes':_0xaaaab5[_0xb03c('0x1a')],'include':_0xaaaab5['include']?_['map'](_0xaaaab5['include'],function(_0x1c49bb){return{'model':db[_0x1c49bb[_0xb03c('0x1e')]],'as':_0x1c49bb['as'],'attributes':_0x1c49bb[_0xb03c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45d68d){logger['info'](_0xb03c('0x1f'),_0xd7535c);logger[_0xb03c('0xe')](_0xb03c('0x1f'),_0xd7535c,JSON['stringify'](_0x45d68d));_0x46ebb0(_0x45d68d);})[_0xb03c('0x13')](function(_0x5c466c){logger[_0xb03c('0x10')](_0xb03c('0x1f'),_0x5c466c[_0xb03c('0x11')],_0xd7535c);_0x19e186(_0x16b139[_0xb03c('0x10')](0x1f4,_0x5c466c['message']));});});}; \ No newline at end of file +var _0xa25d=['jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','raw','limit','include','model','attributes','map','ShowTrigger','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x200647,_0x61d05f){var _0x5bc9d3=function(_0x34727e){while(--_0x34727e){_0x200647['push'](_0x200647['shift']());}};_0x5bc9d3(++_0x61d05f);}(_0xa25d,0xca));var _0xda25=function(_0x217ecd,_0x5b35da){_0x217ecd=_0x217ecd-0x0;var _0x50b480=_0xa25d[_0x217ecd];return _0x50b480;};'use strict';var _=require(_0xda25('0x0'));var util=require(_0xda25('0x1'));var moment=require(_0xda25('0x2'));var BPromise=require('bluebird');var rs=require(_0xda25('0x3'));var fs=require('fs');var Redis=require(_0xda25('0x4'));var db=require(_0xda25('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xda25('0x6'));var config=require(_0xda25('0x7'));var jayson=require(_0xda25('0x8'));var client=jayson[_0xda25('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d7bec,_0x33006e,_0x3b9286){return new BPromise(function(_0x15a1eb,_0x2d2aa8){return client[_0xda25('0xa')](_0x2d7bec,_0x3b9286)[_0xda25('0xb')](function(_0x595620){logger[_0xda25('0xc')](_0xda25('0xd'),_0x33006e,_0xda25('0xe'));logger[_0xda25('0xf')]('Trigger,\x20%s,\x20%s,\x20%s',_0x33006e,_0xda25('0xe'),JSON[_0xda25('0x10')](_0x595620));if(_0x595620[_0xda25('0x11')]){if(_0x595620['error'][_0xda25('0x12')]===0x1f4){logger['error'](_0xda25('0xd'),_0x33006e,_0x595620['error']['message']);return _0x2d2aa8(_0x595620[_0xda25('0x11')][_0xda25('0x13')]);}logger[_0xda25('0x11')](_0xda25('0xd'),_0x33006e,_0x595620['error']['message']);return _0x15a1eb(_0x595620[_0xda25('0x11')]['message']);}else{logger[_0xda25('0xc')](_0xda25('0xd'),_0x33006e,_0xda25('0xe'));_0x15a1eb(_0x595620[_0xda25('0x14')]['message']);}})[_0xda25('0x15')](function(_0x499392){logger[_0xda25('0x11')]('Trigger,\x20%s,\x20%s',_0x33006e,_0x499392);_0x2d2aa8(_0x499392);});});}exports[_0xda25('0x16')]=function(_0xdb5ddc){var _0x1e6187=this;return new Promise(function(_0x7f170f,_0x4a3463){return db[_0xda25('0x17')][_0xda25('0x18')]({'raw':_0xdb5ddc[_0xda25('0x19')]?_0xdb5ddc[_0xda25('0x19')][_0xda25('0x1a')]===undefined?!![]:![]:!![],'where':_0xdb5ddc[_0xda25('0x19')]?_0xdb5ddc[_0xda25('0x19')]['where']||null:null,'attributes':_0xdb5ddc[_0xda25('0x19')]?_0xdb5ddc['options']['attributes']||null:null,'limit':_0xdb5ddc['options']?_0xdb5ddc['options'][_0xda25('0x1b')]||null:null,'include':_0xdb5ddc[_0xda25('0x19')]?_0xdb5ddc['options'][_0xda25('0x1c')]?_['map'](_0xdb5ddc[_0xda25('0x19')][_0xda25('0x1c')],function(_0x6acbcf){return{'model':db[_0x6acbcf[_0xda25('0x1d')]],'as':_0x6acbcf['as'],'attributes':_0x6acbcf[_0xda25('0x1e')],'include':_0x6acbcf[_0xda25('0x1c')]?_[_0xda25('0x1f')](_0x6acbcf[_0xda25('0x1c')],function(_0x38d3a1){return{'model':db[_0x38d3a1[_0xda25('0x1d')]],'as':_0x38d3a1['as'],'attributes':_0x38d3a1['attributes'],'include':_0x38d3a1[_0xda25('0x1c')]?_[_0xda25('0x1f')](_0x38d3a1[_0xda25('0x1c')],function(_0x26dee3){return{'model':db[_0x26dee3[_0xda25('0x1d')]],'as':_0x26dee3['as'],'attributes':_0x26dee3[_0xda25('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf0ac0d){logger['info'](_0xda25('0x16'),_0xdb5ddc);logger['debug'](_0xda25('0x16'),_0xdb5ddc,JSON['stringify'](_0xf0ac0d));_0x7f170f(_0xf0ac0d);})[_0xda25('0x15')](function(_0x129fe2){logger[_0xda25('0x11')](_0xda25('0x16'),_0x129fe2[_0xda25('0x13')],_0xdb5ddc);_0x4a3463(_0x1e6187[_0xda25('0x11')](0x1f4,_0x129fe2['message']));});});};exports[_0xda25('0x20')]=function(_0x3e75f4){var _0x52557e=this;return new Promise(function(_0x3f2463,_0x17d1b3){return db[_0xda25('0x17')][_0xda25('0x21')]({'raw':_0x3e75f4[_0xda25('0x19')]?_0x3e75f4[_0xda25('0x19')][_0xda25('0x1a')]===undefined?!![]:![]:!![],'where':_0x3e75f4[_0xda25('0x19')]?_0x3e75f4[_0xda25('0x19')][_0xda25('0x22')]||null:null,'attributes':_0x3e75f4['options']?_0x3e75f4[_0xda25('0x19')][_0xda25('0x1e')]||null:null,'include':_0x3e75f4[_0xda25('0x19')]?_0x3e75f4[_0xda25('0x19')][_0xda25('0x1c')]?_[_0xda25('0x1f')](_0x3e75f4[_0xda25('0x19')]['include'],function(_0x44aff7){return{'model':db[_0x44aff7[_0xda25('0x1d')]],'as':_0x44aff7['as'],'attributes':_0x44aff7[_0xda25('0x1e')],'include':_0x44aff7[_0xda25('0x1c')]?_[_0xda25('0x1f')](_0x44aff7['include'],function(_0x195911){return{'model':db[_0x195911['model']],'as':_0x195911['as'],'attributes':_0x195911[_0xda25('0x1e')],'include':_0x195911[_0xda25('0x1c')]?_[_0xda25('0x1f')](_0x195911['include'],function(_0x435420){return{'model':db[_0x435420[_0xda25('0x1d')]],'as':_0x435420['as'],'attributes':_0x435420[_0xda25('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfae08d){logger[_0xda25('0xc')](_0xda25('0x20'),_0x3e75f4);logger['debug'](_0xda25('0x20'),_0x3e75f4,JSON[_0xda25('0x10')](_0xfae08d));_0x3f2463(_0xfae08d);})[_0xda25('0x15')](function(_0x523c4c){logger[_0xda25('0x11')](_0xda25('0x20'),_0x523c4c[_0xda25('0x13')],_0x3e75f4);_0x17d1b3(_0x52557e[_0xda25('0x11')](0x1f4,_0x523c4c['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 938f78f..6cb6b04 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 _0xaca1=['get','show','post','/:id/clone','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','isAuthenticated','index'];(function(_0x49225c,_0x401017){var _0x42cd8b=function(_0x5a8cb9){while(--_0x5a8cb9){_0x49225c['push'](_0x49225c['shift']());}};_0x42cd8b(++_0x401017);}(_0xaca1,0x1d9));var _0x1aca=function(_0x2c215d,_0x28b602){_0x2c215d=_0x2c215d-0x0;var _0x498b4a=_0xaca1[_0x2c215d];return _0x498b4a;};'use strict';var multer=require(_0x1aca('0x0'));var util=require(_0x1aca('0x1'));var path=require(_0x1aca('0x2'));var timeout=require(_0x1aca('0x3'));var express=require('express');var router=express[_0x1aca('0x4')]();var fs_extra=require(_0x1aca('0x5'));var auth=require(_0x1aca('0x6'));var interaction=require(_0x1aca('0x7'));var config=require('../../config/environment');var controller=require(_0x1aca('0x8'));router['get']('/',auth[_0x1aca('0x9')](),controller[_0x1aca('0xa')]);router[_0x1aca('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x1aca('0xc')]);router[_0x1aca('0xd')](_0x1aca('0xe'),auth[_0x1aca('0x9')](),controller['clone']);router[_0x1aca('0xd')]('/',auth[_0x1aca('0x9')](),controller[_0x1aca('0xf')]);router[_0x1aca('0x10')](_0x1aca('0x11'),auth[_0x1aca('0x9')](),controller[_0x1aca('0x12')]);router[_0x1aca('0x13')](_0x1aca('0x11'),auth[_0x1aca('0x9')](),controller[_0x1aca('0x14')]);module[_0x1aca('0x15')]=router; \ No newline at end of file +var _0x34c9=['create','put','delete','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone'];(function(_0x890fe2,_0x415c83){var _0x381fa9=function(_0x52bacc){while(--_0x52bacc){_0x890fe2['push'](_0x890fe2['shift']());}};_0x381fa9(++_0x415c83);}(_0x34c9,0x193));var _0x934c=function(_0x1871f7,_0x3ae8b8){_0x1871f7=_0x1871f7-0x0;var _0x24c783=_0x34c9[_0x1871f7];return _0x24c783;};'use strict';var multer=require('multer');var util=require(_0x934c('0x0'));var path=require(_0x934c('0x1'));var timeout=require('connect-timeout');var express=require(_0x934c('0x2'));var router=express[_0x934c('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x934c('0x4'));var config=require(_0x934c('0x5'));var controller=require(_0x934c('0x6'));router[_0x934c('0x7')]('/',auth[_0x934c('0x8')](),controller[_0x934c('0x9')]);router[_0x934c('0x7')](_0x934c('0xa'),auth[_0x934c('0x8')](),controller[_0x934c('0xb')]);router[_0x934c('0xc')](_0x934c('0xd'),auth['isAuthenticated'](),controller[_0x934c('0xe')]);router['post']('/',auth[_0x934c('0x8')](),controller[_0x934c('0xf')]);router[_0x934c('0x10')](_0x934c('0xa'),auth[_0x934c('0x8')](),controller['update']);router[_0x934c('0x11')](_0x934c('0xa'),auth[_0x934c('0x8')](),controller['destroy']);module[_0x934c('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 29c4588..91bec9f 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 _0x593d=['split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','update','outgoing','yes','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','nonat','update,nonat','sequelize','STRING','name','friend','user','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue'];(function(_0x1c36c9,_0x4aabda){var _0x3feb27=function(_0x30f80b){while(--_0x30f80b){_0x1c36c9['push'](_0x1c36c9['shift']());}};_0x3feb27(++_0x4aabda);}(_0x593d,0x1c2));var _0xd593=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x593d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xd593('0x0'));module['exports']={'name':{'type':Sequelize[_0xd593('0x1')],'allowNull':![],'unique':_0xd593('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xd593('0x3'),_0xd593('0x4'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xd593('0x1')],'allowNull':![],'defaultValue':_0xd593('0x5')},'callingpres':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x7'),_0xd593('0x8'),_0xd593('0x9'),_0xd593('0xa'),_0xd593('0xb'),_0xd593('0xc'),'PROHIB_FAILED_SCREEN',_0xd593('0xd'))},'deny':{'type':Sequelize[_0xd593('0x1')]},'permit':{'type':Sequelize[_0xd593('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xd593('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xd593('0x1')],'defaultValue':_0xd593('0xe'),'set':function(_0x4ad15d){this[_0xd593('0xf')](_0xd593('0x10'),_0x4ad15d?_0x4ad15d['join'](','):null);},'get':function(){return this[_0xd593('0x11')]('transport')?this[_0xd593('0x11')](_0xd593('0x10'))[_0xd593('0x12')](','):null;},'comment':_0xd593('0x13')},'dtmfmode':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x14'),_0xd593('0x15'),_0xd593('0x16'),_0xd593('0x17'),_0xd593('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xd593('0x6')]('yes','no','nonat',_0xd593('0x19'),_0xd593('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xd593('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x55c248){this['setDataValue'](_0xd593('0x1c'),_0x55c248?_0x55c248['join'](','):null);},'get':function(){return this['getDataValue'](_0xd593('0x1c'))?this[_0xd593('0x11')](_0xd593('0x1c'))[_0xd593('0x12')](','):null;},'comment':_0xd593('0x1d')},'callgroup':{'type':Sequelize[_0xd593('0x1')]},'namedcallgroup':{'type':Sequelize[_0xd593('0x1')]},'pickupgroup':{'type':Sequelize[_0xd593('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd593('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd593('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xd593('0x1')],'defaultValue':_0xd593('0x1e')},'allow':{'type':Sequelize[_0xd593('0x1')],'allowNull':![],'defaultValue':_0xd593('0x1f'),'set':function(_0x21227c){this[_0xd593('0xf')]('allow',_0x21227c?_0x21227c[_0xd593('0x20')](';'):_0xd593('0x1f'));},'get':function(){return this['getDataValue']('allow')?this['getDataValue']('allow')[_0xd593('0x12')](';'):null;},'comment':_0xd593('0x21')},'autoframing':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no')},'insecure':{'type':Sequelize[_0xd593('0x1')],'defaultValue':_0xd593('0x22'),'set':function(_0x50e968){this[_0xd593('0xf')](_0xd593('0x23'),_0x50e968?_0x50e968[_0xd593('0x20')](','):null);},'get':function(){return this[_0xd593('0x11')]('insecure')?this[_0xd593('0x11')]('insecure')[_0xd593('0x12')](','):null;},'comment':_0xd593('0x24')},'trustrpid':{'type':Sequelize[_0xd593('0x6')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no',_0xd593('0x25'))},'promiscredir':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0xd593('0x6')]('yes','no')},'accountcode':{'type':Sequelize[_0xd593('0x26')](0xb)},'setvar':{'type':Sequelize[_0xd593('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xd593('0x1')]},'callcounter':{'type':Sequelize[_0xd593('0x6')]('yes','no'),'defaultValue':_0xd593('0x1b')},'busylevel':{'type':Sequelize[_0xd593('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no')},'allowsubscribe':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no')},'subscribecontext':{'type':Sequelize[_0xd593('0x1')]},'template':{'type':Sequelize[_0xd593('0x1')]},'videosupport':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no',_0xd593('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd593('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xd593('0x1b'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x28'),_0xd593('0x29'),_0xd593('0x2a'))},'session_expires':{'type':Sequelize[_0xd593('0x26')](0xb)},'session_minse':{'type':Sequelize[_0xd593('0x26')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xd593('0x2b'),_0xd593('0x2c')),'defaultValue':_0xd593('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xd593('0x1')]},'regexten':{'type':Sequelize[_0xd593('0x1')]},'fromdomain':{'type':Sequelize[_0xd593('0x1')]},'fromuser':{'type':Sequelize[_0xd593('0x1')]},'port':{'type':Sequelize[_0xd593('0x26')](0x5)},'qualify':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no'),'defaultValue':_0xd593('0x1b')},'keepalive':{'type':Sequelize[_0xd593('0x26')](0xb)},'defaultip':{'type':Sequelize[_0xd593('0x1')]},'defaultuser':{'type':Sequelize[_0xd593('0x1')]},'rtptimeout':{'type':Sequelize[_0xd593('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xd593('0x26')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xd593('0x1b'),'no',_0xd593('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd593('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xd593('0x26')](0xb)},'timerb':{'type':Sequelize[_0xd593('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0xd593('0x26')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xd593('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xd593('0x1')]},'use_q850_reason':{'type':Sequelize[_0xd593('0x1')]},'maxforwards':{'type':Sequelize[_0xd593('0x26')](0xb)},'encryption':{'type':Sequelize[_0xd593('0x6')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd593('0x6')]('yes','no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0xd593('0x6')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xd593('0x6')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xd593('0x1b'),'no',_0xd593('0x2e'),_0xd593('0x2f'))},'dtlsrekey':{'type':Sequelize[_0xd593('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xd593('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xd593('0x1')]},'dtlscipher':{'type':Sequelize[_0xd593('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x30'),_0xd593('0x31'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd593('0x1')]},'usereqphone':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xd593('0x1')]},'call_limit':{'type':Sequelize[_0xd593('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no')},'vmexten':{'type':Sequelize[_0xd593('0x1')]},'mohinterpret':{'type':Sequelize[_0xd593('0x1')]},'mohsuggest':{'type':Sequelize[_0xd593('0x1')]},'parkinglot':{'type':Sequelize[_0xd593('0x1')]},'description':{'type':Sequelize[_0xd593('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xd593('0x6')](_0xd593('0x1b'),'no',_0xd593('0x32'),'update',_0xd593('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xd593('0x1')]},'otherFields':{'type':Sequelize[_0xd593('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xd593('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x6209=['inband','auto','nonat','update','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','update,nonat','sequelize','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','rfc2833','info'];(function(_0x525673,_0xb429c2){var _0x8f7574=function(_0xeb3bce){while(--_0xeb3bce){_0x525673['push'](_0x525673['shift']());}};_0x8f7574(++_0xb429c2);}(_0x6209,0x83));var _0x9620=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x6209[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x9620('0x0'));module['exports']={'name':{'type':Sequelize[_0x9620('0x1')],'allowNull':![],'unique':_0x9620('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x4'),_0x9620('0x5'),_0x9620('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x9620('0x1')],'allowNull':![],'defaultValue':_0x9620('0x7')},'callingpres':{'type':Sequelize[_0x9620('0x3')]('ALLOWED_NOT_SCREENED',_0x9620('0x8'),_0x9620('0x9'),_0x9620('0xa'),'PROHIB_NOT_SCREENED',_0x9620('0xb'),_0x9620('0xc'),_0x9620('0xd'))},'deny':{'type':Sequelize[_0x9620('0x1')]},'permit':{'type':Sequelize[_0x9620('0x1')]},'secret':{'type':Sequelize[_0x9620('0x1')]},'md5secret':{'type':Sequelize[_0x9620('0x1')]},'remotesecret':{'type':Sequelize[_0x9620('0x1')]},'transport':{'type':Sequelize[_0x9620('0x1')],'defaultValue':_0x9620('0xe'),'set':function(_0x562c4d){this[_0x9620('0xf')](_0x9620('0x10'),_0x562c4d?_0x562c4d[_0x9620('0x11')](','):null);},'get':function(){return this[_0x9620('0x12')](_0x9620('0x10'))?this[_0x9620('0x12')]('transport')[_0x9620('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x14'),_0x9620('0x15'),'shortinfo',_0x9620('0x16'),_0x9620('0x17')),'defaultValue':_0x9620('0x14')},'directmedia':{'type':Sequelize[_0x9620('0x3')]('yes','no',_0x9620('0x18'),_0x9620('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9620('0x1')]},'directmediadeny':{'type':Sequelize[_0x9620('0x1')]},'nat':{'type':Sequelize[_0x9620('0x1')],'defaultValue':_0x9620('0x1b'),'set':function(_0x283cf2){this['setDataValue']('nat',_0x283cf2?_0x283cf2[_0x9620('0x11')](','):null);},'get':function(){return this[_0x9620('0x12')](_0x9620('0x1c'))?this['getDataValue'](_0x9620('0x1c'))[_0x9620('0x13')](','):null;},'comment':_0x9620('0x1d')},'callgroup':{'type':Sequelize[_0x9620('0x1')]},'namedcallgroup':{'type':Sequelize[_0x9620('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9620('0x1')]},'language':{'type':Sequelize[_0x9620('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9620('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x9620('0x1')],'defaultValue':_0x9620('0x1e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9620('0x1f'),'set':function(_0x37ed3b){this['setDataValue'](_0x9620('0x20'),_0x37ed3b?_0x37ed3b['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9620('0x12')](_0x9620('0x20'))?this[_0x9620('0x12')]('allow')[_0x9620('0x13')](';'):null;},'comment':_0x9620('0x21')},'autoframing':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no')},'insecure':{'type':Sequelize[_0x9620('0x1')],'defaultValue':_0x9620('0x22'),'set':function(_0x4f25db){this[_0x9620('0xf')](_0x9620('0x23'),_0x4f25db?_0x4f25db['join'](','):null);},'get':function(){return this[_0x9620('0x12')](_0x9620('0x23'))?this['getDataValue']('insecure')[_0x9620('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x9620('0x1a'),'no','never')},'promiscredir':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x9620('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x9620('0x24')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x9620('0x25')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x9620('0x24')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9620('0x1a'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x9620('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x9620('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no',_0x9620('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x27'),_0x9620('0x28'),_0x9620('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x2a'),_0x9620('0x2b')),'defaultValue':_0x9620('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x9620('0x1')]},'regexten':{'type':Sequelize[_0x9620('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x9620('0x1')]},'port':{'type':Sequelize[_0x9620('0x24')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x9620('0x1a'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x9620('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x9620('0x1')]},'defaultuser':{'type':Sequelize[_0x9620('0x1')]},'rtptimeout':{'type':Sequelize[_0x9620('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9620('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x9620('0x3')]('yes','no',_0x9620('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9620('0x1')]},'callbackextension':{'type':Sequelize[_0x9620('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x9620('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x9620('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x9620('0x1')]},'contactdeny':{'type':Sequelize[_0x9620('0x1')]},'contactacl':{'type':Sequelize[_0x9620('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x9620('0x1')]},'use_q850_reason':{'type':Sequelize[_0x9620('0x1')]},'maxforwards':{'type':Sequelize[_0x9620('0x24')](0xb)},'encryption':{'type':Sequelize[_0x9620('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x9620('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0x9620('0x3')]('yes','no',_0x9620('0x2d'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x9620('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9620('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x9620('0x1')]},'dtlscipher':{'type':Sequelize[_0x9620('0x1')]},'dtlscafile':{'type':Sequelize[_0x9620('0x1')]},'dtlscapath':{'type':Sequelize[_0x9620('0x1')]},'dtlssetup':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x2e'),_0x9620('0x2f'),_0x9620('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9620('0x1')]},'usereqphone':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x9620('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x9620('0x1')]},'mohinterpret':{'type':Sequelize[_0x9620('0x1')]},'mohsuggest':{'type':Sequelize[_0x9620('0x1')]},'parkinglot':{'type':Sequelize[_0x9620('0x1')]},'description':{'type':Sequelize[_0x9620('0x1')]},'host':{'type':Sequelize[_0x9620('0x1')],'defaultValue':_0x9620('0x31')},'canreinvite':{'type':Sequelize[_0x9620('0x3')](_0x9620('0x1a'),'no',_0x9620('0x18'),_0x9620('0x19'),_0x9620('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9620('0x1')]},'otherFields':{'type':Sequelize[_0x9620('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x9620('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 0a530d0..41ffa46 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 _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(_0x5d617f,_0x3ce07a){var _0x3034e1=function(_0x3a3bb5){while(--_0x3a3bb5){_0x5d617f['push'](_0x5d617f['shift']());}};_0x3034e1(++_0x3ce07a);}(_0xbec5,0xe5));var _0x5bec=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xbec5[_0x26f702];return _0x11417d;};'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 +var _0x9c44=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','clone','find','omit','createdAt','body','updatedAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','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','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','params','/etc/asterisk/sip_xcally_registers.conf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','get','Trunks','destroy','stack','name','send','index','Trunk','rawAttributes','fieldName','type'];(function(_0x591053,_0x523072){var _0x31ab80=function(_0x4a543f){while(--_0x4a543f){_0x591053['push'](_0x591053['shift']());}};_0x31ab80(++_0x523072);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x16')][_0x49c4('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5f2fd9,_0x1909fe,_0x280996,_0x21f15a){return new BPromise(function(_0x2decee,_0x12777c){var _0x18211c=_0x21f15a||client;return _0x18211c[_0x49c4('0x18')](_0x5f2fd9,_0x280996)[_0x49c4('0x19')](function(_0x58d177){logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));logger[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x1909fe,'request\x20sent',JSON[_0x49c4('0x1f')](_0x58d177));if(_0x58d177[_0x49c4('0x20')]){if(_0x58d177['error']['code']===0x1f4){logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')]['message']);return _0x12777c(_0x58d177[_0x49c4('0x20')]['message']);}logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);return _0x2decee(_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);}else{logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));_0x2decee(_0x58d177['result']['message']);}})['catch'](function(_0x1c99b1){logger['error']('Trunk,\x20%s,\x20%s',_0x1909fe,_0x1c99b1);_0x12777c(_0x1c99b1);});});}function respondWithStatusCode(_0x2263ae,_0x15581b){_0x15581b=_0x15581b||0xcc;return function(_0x26c640){if(_0x26c640){return _0x2263ae[_0x49c4('0x22')](_0x15581b);}return _0x2263ae['status'](_0x15581b)['end']();};}function respondWithResult(_0x180276,_0x9cb797){_0x9cb797=_0x9cb797||0xc8;return function(_0x565423){if(_0x565423){return _0x180276[_0x49c4('0x23')](_0x9cb797)[_0x49c4('0x24')](_0x565423);}};}function respondWithFilteredResult(_0x210159,_0xa7a826){return function(_0x531d92){if(_0x531d92){var _0x543ea2=typeof _0xa7a826[_0x49c4('0x25')]==='undefined'&&typeof _0xa7a826[_0x49c4('0x26')]===_0x49c4('0x27');var _0x3f1708=_0x531d92[_0x49c4('0x28')];var _0x5987ae=_0x543ea2?0x0:_0xa7a826[_0x49c4('0x25')];var _0x2b2793=_0x543ea2?_0x531d92[_0x49c4('0x28')]:_0xa7a826[_0x49c4('0x25')]+_0xa7a826[_0x49c4('0x26')];var _0x29f835;if(_0x2b2793>=_0x3f1708){_0x2b2793=_0x3f1708;_0x29f835=0xc8;}else{_0x29f835=0xce;}_0x210159[_0x49c4('0x23')](_0x29f835);return _0x210159[_0x49c4('0x29')](_0x49c4('0x2a'),_0x5987ae+'-'+_0x2b2793+'/'+_0x3f1708)[_0x49c4('0x24')](_0x531d92);}return null;};}function patchUpdates(_0x46f7ea){return function(_0x4ea6ea){try{jsonpatch['apply'](_0x4ea6ea,_0x46f7ea,!![]);}catch(_0x59eb84){return BPromise[_0x49c4('0x2b')](_0x59eb84);}return _0x4ea6ea[_0x49c4('0x2c')]();};}function saveUpdates(_0x1eb035,_0x27e467){return function(_0x28eb47){if(_0x28eb47){return _0x28eb47['update'](_0x1eb035)[_0x49c4('0x19')](function(_0x116eb4){return _0x116eb4;});}return null;};}function removeEntity(_0x2e7a69,_0x24bba9){return function(_0x58e252){if(_0x58e252){return _0x58e252['destroy']()[_0x49c4('0x19')](function(){var _0x9a1bed=_0x58e252[_0x49c4('0x2d')]({'plain':!![]});var _0x13b3b4=_0x49c4('0x2e');return db['UserProfileResource'][_0x49c4('0x2f')]({'where':{'type':_0x13b3b4,'resourceId':_0x9a1bed['id']}})[_0x49c4('0x19')](function(){return _0x58e252;});})[_0x49c4('0x19')](function(){_0x2e7a69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x85dce2,_0x1991e9){return function(_0x3bec0a){if(!_0x3bec0a){_0x85dce2[_0x49c4('0x22')](0x194);}return _0x3bec0a;};}function handleError(_0x2b45a1,_0x2cf897){_0x2cf897=_0x2cf897||0x1f4;return function(_0x1d1557){logger[_0x49c4('0x20')](_0x1d1557[_0x49c4('0x30')]);if(_0x1d1557['name']){delete _0x1d1557[_0x49c4('0x31')];}_0x2b45a1['status'](_0x2cf897)[_0x49c4('0x32')](_0x1d1557);};}exports[_0x49c4('0x33')]=function(_0x2625a6,_0x1c2830){var _0x4ed4f8={},_0x335f0c={},_0x31f3ff={'count':0x0,'rows':[]};var _0x1c910a=_['map'](db[_0x49c4('0x34')][_0x49c4('0x35')],function(_0x178987){return{'name':_0x178987[_0x49c4('0x36')],'type':_0x178987[_0x49c4('0x37')][_0x49c4('0x38')]};});_0x335f0c[_0x49c4('0x39')]=_[_0x49c4('0x3a')](_0x1c910a,_0x49c4('0x31'));_0x335f0c[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2625a6['query']);_0x335f0c[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],_0x335f0c[_0x49c4('0x3b')]);_0x4ed4f8[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x4ed4f8[_0x49c4('0x3f')]=_0x4ed4f8[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x4ed4f8['attributes']:_0x335f0c[_0x49c4('0x39')];if(!_0x2625a6['query'][_0x49c4('0x42')](_0x49c4('0x43'))){_0x4ed4f8[_0x49c4('0x26')]=qs[_0x49c4('0x26')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x26')]);_0x4ed4f8['offset']=qs['offset'](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x25')]);}_0x4ed4f8[_0x49c4('0x44')]=qs[_0x49c4('0x45')](_0x2625a6['query'][_0x49c4('0x45')]);_0x4ed4f8[_0x49c4('0x46')]=qs[_0x49c4('0x3d')](_[_0x49c4('0x47')](_0x2625a6[_0x49c4('0x3b')],_0x335f0c[_0x49c4('0x3d')]),_0x1c910a);if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x48')]){_0x4ed4f8[_0x49c4('0x46')]=_['merge'](_0x4ed4f8[_0x49c4('0x46')],{'$or':_['map'](_0x1c910a,function(_0x33696e){if(_0x33696e[_0x49c4('0x37')]!==_0x49c4('0x49')){var _0x258abe={};_0x258abe[_0x33696e[_0x49c4('0x31')]]={'$like':'%'+_0x2625a6['query'][_0x49c4('0x48')]+'%'};return _0x258abe;}})});}_0x4ed4f8=_[_0x49c4('0x4a')]({},_0x4ed4f8,_0x2625a6[_0x49c4('0x4b')]);var _0x254d07={'where':_0x4ed4f8[_0x49c4('0x46')]};return db[_0x49c4('0x34')][_0x49c4('0x28')](_0x254d07)['then'](function(_0x3bac1b){_0x31f3ff['count']=_0x3bac1b;if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x4c')]){_0x4ed4f8[_0x49c4('0x4d')]=[{'all':!![]}];}return db[_0x49c4('0x34')][_0x49c4('0x4e')](_0x4ed4f8);})[_0x49c4('0x19')](function(_0x2c6be1){_0x31f3ff['rows']=_0x2c6be1;return _0x31f3ff;})[_0x49c4('0x19')](respondWithFilteredResult(_0x1c2830,_0x4ed4f8))[_0x49c4('0x4f')](handleError(_0x1c2830,null));};exports['show']=function(_0x1e1ac4,_0xaece5f){var _0xfbe179={'raw':![],'where':{'id':_0x1e1ac4['params']['id']}},_0x242afc={};_0x242afc['model']=_[_0x49c4('0x3c')](db['Trunk'][_0x49c4('0x35')]);_0x242afc[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x1e1ac4[_0x49c4('0x3b')]);_0x242afc[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],_0x242afc['query']);_0xfbe179[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x1e1ac4[_0x49c4('0x3b')][_0x49c4('0x40')]));_0xfbe179[_0x49c4('0x3f')]=_0xfbe179[_0x49c4('0x3f')][_0x49c4('0x41')]?_0xfbe179[_0x49c4('0x3f')]:_0x242afc['model'];if(_0x1e1ac4['query'][_0x49c4('0x4c')]){_0xfbe179[_0x49c4('0x4d')]=[{'all':!![]}];}_0xfbe179=_['merge']({},_0xfbe179,_0x1e1ac4['options']);return db[_0x49c4('0x34')]['find'](_0xfbe179)['then'](handleEntityNotFound(_0xaece5f,null))[_0x49c4('0x19')](respondWithResult(_0xaece5f,null))[_0x49c4('0x4f')](handleError(_0xaece5f,null));};exports[_0x49c4('0x50')]=function(_0x38c480,_0x2884ca){var _0x16949a={'where':{'id':_0x38c480['params']['id']}},_0x35724e={};_0x35724e[_0x49c4('0x39')]=_[_0x49c4('0x3c')](db[_0x49c4('0x34')][_0x49c4('0x35')]);_0x16949a[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x35724e['model'],qs['fields'](_0x38c480[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x16949a[_0x49c4('0x3f')]=_0x16949a[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x16949a[_0x49c4('0x3f')]:_0x35724e[_0x49c4('0x39')];if(_0x38c480['query'][_0x49c4('0x4c')]){_0x16949a[_0x49c4('0x4d')]=[{'all':!![]}];}_0x16949a=_['merge']({},_0x16949a,_0x38c480[_0x49c4('0x4b')]);return db['Trunk'][_0x49c4('0x51')](_0x16949a)[_0x49c4('0x19')](handleEntityNotFound(_0x2884ca,null))[_0x49c4('0x19')](function(_0x2fe89a){if(_0x2fe89a){var _0x845f7e=_0x2fe89a[_0x49c4('0x2d')]({'plain':!![]});_0x845f7e=qs[_0x49c4('0x52')](_0x845f7e,['id',_0x49c4('0x53'),'updatedAt']);_0x38c480[_0x49c4('0x54')]=_[_0x49c4('0x52')](_0x38c480['body'],['id',_0x49c4('0x53'),_0x49c4('0x55')]);return db['Trunk'][_0x49c4('0x56')](_[_0x49c4('0x4a')](_0x845f7e,_0x38c480['body']),{'include':_0x38c480['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xc43386){var _0x54947d=_0x38c480[_0x49c4('0x57')][_0x49c4('0x2d')]({'plain':!![]});if(!_0x54947d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54947d[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x5ac9f0=_0xc43386[_0x49c4('0x2d')]({'plain':!![]});var _0x3dcf4c=_0x49c4('0x2e');return db[_0x49c4('0x59')]['find']({'where':{'name':_0x3dcf4c,'userProfileId':_0x54947d[_0x49c4('0x5a')]},'raw':!![]})[_0x49c4('0x19')](function(_0x3cc604){if(_0x3cc604&&_0x3cc604[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x5ac9f0['name'],'resourceId':_0x5ac9f0['id'],'type':_0x3cc604['name'],'sectionId':_0x3cc604['id']},{})['then'](function(){return _0xc43386;});}else{return _0xc43386;}})['catch'](function(_0x302251){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x302251);throw _0x302251;});}return _0xc43386;});}})[_0x49c4('0x19')](respondWithResult(_0x2884ca,0xc9))['catch'](handleError(_0x2884ca,null));};exports['create']=function(_0x340523,_0x109b81,_0x342326){var _0x295ad0;return db[_0x49c4('0x34')][_0x49c4('0x56')](_0x340523[_0x49c4('0x54')],{'raw':!![]})[_0x49c4('0x19')](function(_0x4d49e0){_0x295ad0=_0x4d49e0;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x264902){var _0x1a5d4c=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x13d951=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x2d5f63=ejs[_0x49c4('0x63')](_0x1a5d4c,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x2d5f63);if(_0x295ad0['registry']){var _0x5ec201=ejs[_0x49c4('0x63')](_0x13d951,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x5ec201);}})[_0x49c4('0x19')](function(){return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x56'),{'module':_0x49c4('0x67')});})['then'](function(){var _0x5a14a5=_0x340523['user'][_0x49c4('0x2d')]({'plain':!![]});if(!_0x5a14a5)throw new Error(_0x49c4('0x68'));if(_0x5a14a5[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x118fc4=_0x295ad0[_0x49c4('0x2d')]({'plain':!![]});return db[_0x49c4('0x59')][_0x49c4('0x51')]({'where':{'name':_0x49c4('0x2e'),'userProfileId':_0x5a14a5['userProfileId']},'raw':!![]})[_0x49c4('0x19')](function(_0x10fb84){if(_0x10fb84&&_0x10fb84[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x118fc4[_0x49c4('0x31')],'resourceId':_0x118fc4['id'],'type':_0x10fb84[_0x49c4('0x31')],'sectionId':_0x10fb84['id']},{})[_0x49c4('0x19')](function(){return _0x295ad0;});}else{return _0x295ad0;}})[_0x49c4('0x4f')](function(_0x2fd749){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x2fd749);throw _0x2fd749;});}return _0x295ad0;})['then'](respondWithResult(_0x109b81,0xc9))[_0x49c4('0x4f')](handleError(_0x109b81,null));};exports[_0x49c4('0x69')]=function(_0x85540f,_0x18e82b,_0x1e948a){var _0x4a204d;return db['Trunk'][_0x49c4('0x51')]({'where':{'id':_0x85540f['params']['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x18e82b,null))['then'](saveUpdates(_0x85540f[_0x49c4('0x54')],null))[_0x49c4('0x19')](function(_0x3b03dd){if(_0x3b03dd){_0x4a204d=_0x3b03dd;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});}})[_0x49c4('0x19')](function(_0x38d7d3){if(_0x38d7d3){var _0x2ceada=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x46477f=fs[_0x49c4('0x5d')](path['join'](config[_0x49c4('0x5f')],_0x49c4('0x62')),'utf8');var _0x15bee0=ejs['render'](_0x2ceada,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x15bee0);var _0x1f14a6=ejs[_0x49c4('0x63')](_0x46477f,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x1f14a6);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x69'),{'module':'chan_sip.so'});}return null;})[_0x49c4('0x19')](function(_0x167e41){if(_0x167e41){return _0x4a204d;}})['then'](respondWithResult(_0x18e82b,null))[_0x49c4('0x4f')](handleError(_0x18e82b,null));};exports[_0x49c4('0x2f')]=function(_0x57b137,_0x37fef1,_0x993d00){var _0x25989a;return db[_0x49c4('0x34')]['find']({'where':{'id':_0x57b137[_0x49c4('0x6a')]['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x37fef1,null))['then'](removeEntity(_0x37fef1,null))[_0x49c4('0x19')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x507078){var _0x50fd24=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config['root'],_0x49c4('0x60')),'utf8');var _0x578f4b=fs['readFileSync'](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x4a5f0b=ejs['render'](_0x50fd24,{'trunks':_0x507078});var _0x348693=ejs['render'](_0x578f4b,{'trunks':_0x507078});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a5f0b);fs[_0x49c4('0x64')](_0x49c4('0x6b'),_0x348693);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x2f'),{'module':_0x49c4('0x67')});})[_0x49c4('0x4f')](handleError(_0x37fef1,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index ae4e69d..42f0d1e 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 _0x3901=['moment','request-promise','path','rimraf','../../config/environment','./trunk.attributes','define','Trunk','lodash','util','api'];(function(_0x573f4b,_0x31feec){var _0x5b31dd=function(_0x1dc9eb){while(--_0x1dc9eb){_0x573f4b['push'](_0x573f4b['shift']());}};_0x5b31dd(++_0x31feec);}(_0x3901,0xb8));var _0x1390=function(_0x461c2c,_0x13f720){_0x461c2c=_0x461c2c-0x0;var _0x34ce82=_0x3901[_0x461c2c];return _0x34ce82;};'use strict';var _=require(_0x1390('0x0'));var util=require(_0x1390('0x1'));var logger=require('../../config/logger')(_0x1390('0x2'));var moment=require(_0x1390('0x3'));var BPromise=require('bluebird');var rp=require(_0x1390('0x4'));var fs=require('fs');var path=require(_0x1390('0x5'));var rimraf=require(_0x1390('0x6'));var config=require(_0x1390('0x7'));var attributes=require(_0x1390('0x8'));module['exports']=function(_0x16d1bd,_0x65a974){return _0x16d1bd[_0x1390('0x9')](_0x1390('0xa'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3767=['bluebird','request-promise','path','./trunk.attributes','exports','define','tools_trunks','util','../../config/logger','api'];(function(_0x5eab9b,_0x113241){var _0x16bbc5=function(_0x523fae){while(--_0x523fae){_0x5eab9b['push'](_0x5eab9b['shift']());}};_0x16bbc5(++_0x113241);}(_0x3767,0x10b));var _0x7376=function(_0x16fafa,_0x341eee){_0x16fafa=_0x16fafa-0x0;var _0x587f7c=_0x3767[_0x16fafa];return _0x587f7c;};'use strict';var _=require('lodash');var util=require(_0x7376('0x0'));var logger=require(_0x7376('0x1'))(_0x7376('0x2'));var moment=require('moment');var BPromise=require(_0x7376('0x3'));var rp=require(_0x7376('0x4'));var fs=require('fs');var path=require(_0x7376('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7376('0x6'));module[_0x7376('0x7')]=function(_0x49f86d,_0x2670b7){return _0x49f86d[_0x7376('0x8')]('Trunk',attributes,{'tableName':_0x7376('0x9'),'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 8366df4..a124714 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 _0x9780=['debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','error','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','map','model','then','ShowTrunk','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent'];(function(_0x5b5348,_0x114705){var _0x5badd6=function(_0x1f8c4b){while(--_0x1f8c4b){_0x5b5348['push'](_0x5b5348['shift']());}};_0x5badd6(++_0x114705);}(_0x9780,0x196));var _0x0978=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x9780[_0x220afa];return _0x1b79d1;};'use strict';var _=require(_0x0978('0x0'));var util=require('util');var moment=require(_0x0978('0x1'));var BPromise=require(_0x0978('0x2'));var rs=require(_0x0978('0x3'));var fs=require('fs');var Redis=require(_0x0978('0x4'));var db=require(_0x0978('0x5'))['db'];var utils=require(_0x0978('0x6'));var logger=require(_0x0978('0x7'))(_0x0978('0x8'));var config=require('../../config/environment');var jayson=require(_0x0978('0x9'));var client=jayson[_0x0978('0xa')][_0x0978('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13581c,_0x1936c3,_0x5b7c8a){return new BPromise(function(_0x1b9454,_0x1d3c41){return client['request'](_0x13581c,_0x5b7c8a)['then'](function(_0x483e86){logger[_0x0978('0xc')]('Trunk,\x20%s,\x20%s',_0x1936c3,_0x0978('0xd'));logger[_0x0978('0xe')](_0x0978('0xf'),_0x1936c3,'request\x20sent',JSON[_0x0978('0x10')](_0x483e86));if(_0x483e86['error']){if(_0x483e86['error'][_0x0978('0x11')]===0x1f4){logger[_0x0978('0x12')](_0x0978('0x13'),_0x1936c3,_0x483e86[_0x0978('0x12')][_0x0978('0x14')]);return _0x1d3c41(_0x483e86[_0x0978('0x12')]['message']);}logger[_0x0978('0x12')](_0x0978('0x13'),_0x1936c3,_0x483e86[_0x0978('0x12')]['message']);return _0x1b9454(_0x483e86[_0x0978('0x12')][_0x0978('0x14')]);}else{logger[_0x0978('0xc')]('Trunk,\x20%s,\x20%s',_0x1936c3,_0x0978('0xd'));_0x1b9454(_0x483e86[_0x0978('0x15')]['message']);}})[_0x0978('0x16')](function(_0x3f396b){logger[_0x0978('0x12')](_0x0978('0x13'),_0x1936c3,_0x3f396b);_0x1d3c41(_0x3f396b);});});}exports[_0x0978('0x17')]=function(_0x15f90d){var _0x2b8b8b=this;return new Promise(function(_0x448839,_0x25bc83){return db[_0x0978('0x18')][_0x0978('0x19')]({'raw':_0x15f90d[_0x0978('0x1a')]?_0x15f90d['options']['raw']===undefined?!![]:![]:!![],'where':_0x15f90d[_0x0978('0x1a')]?_0x15f90d[_0x0978('0x1a')][_0x0978('0x1b')]||null:null,'attributes':_0x15f90d['options']?_0x15f90d[_0x0978('0x1a')][_0x0978('0x1c')]||null:null,'limit':_0x15f90d['options']?_0x15f90d['options'][_0x0978('0x1d')]||null:null,'include':_0x15f90d[_0x0978('0x1a')]?_0x15f90d[_0x0978('0x1a')][_0x0978('0x1e')]?_[_0x0978('0x1f')](_0x15f90d[_0x0978('0x1a')][_0x0978('0x1e')],function(_0x579a5d){return{'model':db[_0x579a5d[_0x0978('0x20')]],'as':_0x579a5d['as'],'attributes':_0x579a5d['attributes'],'include':_0x579a5d[_0x0978('0x1e')]?_[_0x0978('0x1f')](_0x579a5d[_0x0978('0x1e')],function(_0x3fd8df){return{'model':db[_0x3fd8df[_0x0978('0x20')]],'as':_0x3fd8df['as'],'attributes':_0x3fd8df['attributes'],'include':_0x3fd8df[_0x0978('0x1e')]?_[_0x0978('0x1f')](_0x3fd8df[_0x0978('0x1e')],function(_0x1c563c){return{'model':db[_0x1c563c['model']],'as':_0x1c563c['as'],'attributes':_0x1c563c[_0x0978('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0978('0x21')](function(_0x25d8be){logger['info'](_0x0978('0x17'),_0x15f90d);logger[_0x0978('0xe')]('GetTrunk',_0x15f90d,JSON[_0x0978('0x10')](_0x25d8be));_0x448839(_0x25d8be);})[_0x0978('0x16')](function(_0x1de3ce){logger[_0x0978('0x12')](_0x0978('0x17'),_0x1de3ce['message'],_0x15f90d);_0x25bc83(_0x2b8b8b[_0x0978('0x12')](0x1f4,_0x1de3ce['message']));});});};exports['ShowTrunk']=function(_0x14b97f){var _0x2e649=this;return new Promise(function(_0x274933,_0x555c12){return db[_0x0978('0x18')]['find']({'raw':_0x14b97f[_0x0978('0x1a')]?_0x14b97f[_0x0978('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x14b97f[_0x0978('0x1a')]?_0x14b97f[_0x0978('0x1a')][_0x0978('0x1b')]||null:null,'attributes':_0x14b97f[_0x0978('0x1a')]?_0x14b97f[_0x0978('0x1a')][_0x0978('0x1c')]||null:null,'include':_0x14b97f[_0x0978('0x1a')]?_0x14b97f[_0x0978('0x1a')][_0x0978('0x1e')]?_['map'](_0x14b97f[_0x0978('0x1a')]['include'],function(_0x1d2112){return{'model':db[_0x1d2112[_0x0978('0x20')]],'as':_0x1d2112['as'],'attributes':_0x1d2112[_0x0978('0x1c')],'include':_0x1d2112[_0x0978('0x1e')]?_['map'](_0x1d2112['include'],function(_0x343cc7){return{'model':db[_0x343cc7['model']],'as':_0x343cc7['as'],'attributes':_0x343cc7[_0x0978('0x1c')],'include':_0x343cc7[_0x0978('0x1e')]?_['map'](_0x343cc7[_0x0978('0x1e')],function(_0x5ed3fd){return{'model':db[_0x5ed3fd[_0x0978('0x20')]],'as':_0x5ed3fd['as'],'attributes':_0x5ed3fd[_0x0978('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0978('0x21')](function(_0x41e600){logger[_0x0978('0xc')](_0x0978('0x22'),_0x14b97f);logger[_0x0978('0xe')]('ShowTrunk',_0x14b97f,JSON['stringify'](_0x41e600));_0x274933(_0x41e600);})[_0x0978('0x16')](function(_0x23f5fb){logger[_0x0978('0x12')](_0x0978('0x22'),_0x23f5fb['message'],_0x14b97f);_0x555c12(_0x2e649['error'](0x1f4,_0x23f5fb[_0x0978('0x14')]));});});}; \ No newline at end of file +var _0x1f67=['result','catch','GetTrunk','Trunk','options','where','attributes','limit','include','map','model','ShowTrunk','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4b1596,_0x4a101d){var _0x5df17f=function(_0x38d7d9){while(--_0x38d7d9){_0x4b1596['push'](_0x4b1596['shift']());}};_0x5df17f(++_0x4a101d);}(_0x1f67,0x146));var _0x71f6=function(_0xc9d15a,_0x546b57){_0xc9d15a=_0xc9d15a-0x0;var _0xa8e068=_0x1f67[_0xc9d15a];return _0xa8e068;};'use strict';var _=require(_0x71f6('0x0'));var util=require(_0x71f6('0x1'));var moment=require(_0x71f6('0x2'));var BPromise=require(_0x71f6('0x3'));var rs=require(_0x71f6('0x4'));var fs=require('fs');var Redis=require(_0x71f6('0x5'));var db=require(_0x71f6('0x6'))['db'];var utils=require(_0x71f6('0x7'));var logger=require(_0x71f6('0x8'))(_0x71f6('0x9'));var config=require(_0x71f6('0xa'));var jayson=require(_0x71f6('0xb'));var client=jayson[_0x71f6('0xc')][_0x71f6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1b8fd9,_0x3bf6e6,_0x3cd73a){return new BPromise(function(_0x3e0d51,_0x54d7d6){return client[_0x71f6('0xe')](_0x1b8fd9,_0x3cd73a)[_0x71f6('0xf')](function(_0xd2e995){logger[_0x71f6('0x10')](_0x71f6('0x11'),_0x3bf6e6,'request\x20sent');logger[_0x71f6('0x12')](_0x71f6('0x13'),_0x3bf6e6,_0x71f6('0x14'),JSON[_0x71f6('0x15')](_0xd2e995));if(_0xd2e995[_0x71f6('0x16')]){if(_0xd2e995[_0x71f6('0x16')][_0x71f6('0x17')]===0x1f4){logger[_0x71f6('0x16')](_0x71f6('0x11'),_0x3bf6e6,_0xd2e995[_0x71f6('0x16')][_0x71f6('0x18')]);return _0x54d7d6(_0xd2e995[_0x71f6('0x16')][_0x71f6('0x18')]);}logger[_0x71f6('0x16')](_0x71f6('0x11'),_0x3bf6e6,_0xd2e995[_0x71f6('0x16')][_0x71f6('0x18')]);return _0x3e0d51(_0xd2e995[_0x71f6('0x16')][_0x71f6('0x18')]);}else{logger[_0x71f6('0x10')](_0x71f6('0x11'),_0x3bf6e6,'request\x20sent');_0x3e0d51(_0xd2e995[_0x71f6('0x19')][_0x71f6('0x18')]);}})[_0x71f6('0x1a')](function(_0x803803){logger[_0x71f6('0x16')](_0x71f6('0x11'),_0x3bf6e6,_0x803803);_0x54d7d6(_0x803803);});});}exports[_0x71f6('0x1b')]=function(_0x237a22){var _0x432c80=this;return new Promise(function(_0x47558a,_0x36b7f7){return db[_0x71f6('0x1c')]['findAll']({'raw':_0x237a22[_0x71f6('0x1d')]?_0x237a22[_0x71f6('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x237a22[_0x71f6('0x1d')]?_0x237a22[_0x71f6('0x1d')][_0x71f6('0x1e')]||null:null,'attributes':_0x237a22[_0x71f6('0x1d')]?_0x237a22['options'][_0x71f6('0x1f')]||null:null,'limit':_0x237a22['options']?_0x237a22[_0x71f6('0x1d')][_0x71f6('0x20')]||null:null,'include':_0x237a22[_0x71f6('0x1d')]?_0x237a22['options'][_0x71f6('0x21')]?_[_0x71f6('0x22')](_0x237a22[_0x71f6('0x1d')][_0x71f6('0x21')],function(_0x5ba7c2){return{'model':db[_0x5ba7c2['model']],'as':_0x5ba7c2['as'],'attributes':_0x5ba7c2[_0x71f6('0x1f')],'include':_0x5ba7c2['include']?_[_0x71f6('0x22')](_0x5ba7c2[_0x71f6('0x21')],function(_0x8ee356){return{'model':db[_0x8ee356[_0x71f6('0x23')]],'as':_0x8ee356['as'],'attributes':_0x8ee356[_0x71f6('0x1f')],'include':_0x8ee356[_0x71f6('0x21')]?_[_0x71f6('0x22')](_0x8ee356[_0x71f6('0x21')],function(_0x5375ee){return{'model':db[_0x5375ee['model']],'as':_0x5375ee['as'],'attributes':_0x5375ee[_0x71f6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x71f6('0xf')](function(_0x3c59ff){logger['info'](_0x71f6('0x1b'),_0x237a22);logger[_0x71f6('0x12')]('GetTrunk',_0x237a22,JSON['stringify'](_0x3c59ff));_0x47558a(_0x3c59ff);})[_0x71f6('0x1a')](function(_0x36b204){logger[_0x71f6('0x16')]('GetTrunk',_0x36b204[_0x71f6('0x18')],_0x237a22);_0x36b7f7(_0x432c80['error'](0x1f4,_0x36b204[_0x71f6('0x18')]));});});};exports[_0x71f6('0x24')]=function(_0x34935f){var _0x3b1e63=this;return new Promise(function(_0x2deb71,_0x424840){return db[_0x71f6('0x1c')][_0x71f6('0x25')]({'raw':_0x34935f['options']?_0x34935f[_0x71f6('0x1d')][_0x71f6('0x26')]===undefined?!![]:![]:!![],'where':_0x34935f[_0x71f6('0x1d')]?_0x34935f['options']['where']||null:null,'attributes':_0x34935f[_0x71f6('0x1d')]?_0x34935f[_0x71f6('0x1d')][_0x71f6('0x1f')]||null:null,'include':_0x34935f['options']?_0x34935f[_0x71f6('0x1d')][_0x71f6('0x21')]?_[_0x71f6('0x22')](_0x34935f['options'][_0x71f6('0x21')],function(_0x303ff7){return{'model':db[_0x303ff7[_0x71f6('0x23')]],'as':_0x303ff7['as'],'attributes':_0x303ff7[_0x71f6('0x1f')],'include':_0x303ff7['include']?_[_0x71f6('0x22')](_0x303ff7['include'],function(_0x365486){return{'model':db[_0x365486[_0x71f6('0x23')]],'as':_0x365486['as'],'attributes':_0x365486[_0x71f6('0x1f')],'include':_0x365486[_0x71f6('0x21')]?_['map'](_0x365486[_0x71f6('0x21')],function(_0x1f1db9){return{'model':db[_0x1f1db9[_0x71f6('0x23')]],'as':_0x1f1db9['as'],'attributes':_0x1f1db9[_0x71f6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x71f6('0xf')](function(_0x506ac2){logger[_0x71f6('0x10')]('ShowTrunk',_0x34935f);logger[_0x71f6('0x12')]('ShowTrunk',_0x34935f,JSON[_0x71f6('0x15')](_0x506ac2));_0x2deb71(_0x506ac2);})[_0x71f6('0x1a')](function(_0x4d5bc7){logger[_0x71f6('0x16')](_0x71f6('0x24'),_0x4d5bc7['message'],_0x34935f);_0x424840(_0x3b1e63[_0x71f6('0x16')](0x1f4,_0x4d5bc7[_0x71f6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 3d1590e..1bb3878 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d21=['put','/:id','update','exports','express','Router','../../components/auth/service','./user-setting.controller'];(function(_0x31fbaa,_0x2fde64){var _0x514f58=function(_0x118ac9){while(--_0x118ac9){_0x31fbaa['push'](_0x31fbaa['shift']());}};_0x514f58(++_0x2fde64);}(_0x0d21,0x1d4));var _0x10d2=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x0d21[_0x1b349a];return _0x5d1f7c;};'use strict';var express=require(_0x10d2('0x0'));var router=express[_0x10d2('0x1')]();var auth=require(_0x10d2('0x2'));var controller=require(_0x10d2('0x3'));router[_0x10d2('0x4')](_0x10d2('0x5'),auth['isAuthenticated'](),controller[_0x10d2('0x6')]);module[_0x10d2('0x7')]=router; \ No newline at end of file +var _0xdec8=['exports','./user-setting.controller','put','/:id','isAuthenticated','update'];(function(_0x59f9b0,_0x1d3569){var _0x539d9b=function(_0x500b3b){while(--_0x500b3b){_0x59f9b0['push'](_0x59f9b0['shift']());}};_0x539d9b(++_0x1d3569);}(_0xdec8,0x85));var _0x8dec=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xdec8[_0x4baae2];return _0x1a2285;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x8dec('0x0'));router[_0x8dec('0x1')](_0x8dec('0x2'),auth[_0x8dec('0x3')](),controller[_0x8dec('0x4')]);module[_0x8dec('0x5')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index b0d73fa..7080a1c 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5cf=['DATE','INTEGER','error','info','debug','exports','ENUM','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb5cf,0x102));var _0xfb5c=function(_0x4812d4,_0xf73537){_0x4812d4=_0x4812d4-0x0;var _0x3119aa=_0xb5cf[_0x4812d4];return _0x3119aa;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0xfb5c('0x0'),'warning',_0xfb5c('0x1'),_0xfb5c('0x2')];module[_0xfb5c('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xfb5c('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xfb5c('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xfb5c('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xfb5c('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xfb5c('0x7')],'unique':'UserId'}}; \ No newline at end of file +var _0xe138=['ENUM','BOOLEAN','TEXT','DATE','INTEGER','sequelize','error','warning','debug','exports'];(function(_0x1dea61,_0x39f907){var _0x5d8aec=function(_0x54ddca){while(--_0x54ddca){_0x1dea61['push'](_0x1dea61['shift']());}};_0x5d8aec(++_0x39f907);}(_0xe138,0x16d));var _0x8e13=function(_0x5a8333,_0xce4cb9){_0x5a8333=_0x5a8333-0x0;var _0x199c26=_0xe138[_0x5a8333];return _0x199c26;};'use strict';var Sequelize=require(_0x8e13('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x8e13('0x1'),_0x8e13('0x2'),'info',_0x8e13('0x3')];module[_0x8e13('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x8e13('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x8e13('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x8e13('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x8e13('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x8e13('0x9')],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 2273ba0..bff059e 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4ba=['error','stack','name','status','send','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter','register','redis','defaults','update','then','sendStatus'];(function(_0x1eca97,_0x1e1c87){var _0x25c9f6=function(_0x87d471){while(--_0x87d471){_0x1eca97['push'](_0x1eca97['shift']());}};_0x25c9f6(++_0x1e1c87);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xa4ba[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require('lodash');var Redis=require(_0xaa4b('0x0'));var logger=require(_0xaa4b('0x1'))(_0xaa4b('0x2'));var config=require(_0xaa4b('0x3'));var db=require('../../mysqldb')['db'];var socket=require(_0xaa4b('0x4'))(new Redis(config['redis']));require('./user-setting.socket')[_0xaa4b('0x5')](socket);config[_0xaa4b('0x6')]=_[_0xaa4b('0x7')](config[_0xaa4b('0x6')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x40f127,_0x4d6e56){_0x4d6e56=_0x4d6e56||0xc8;return function(_0x3a6f0d){if(_0x3a6f0d){return _0x40f127['status'](_0x4d6e56)['json'](_0x3a6f0d);}};}function saveUpdates(_0x3e5546){return function(_0xcdbe18){if(_0xcdbe18){return _0xcdbe18[_0xaa4b('0x8')](_0x3e5546)[_0xaa4b('0x9')](function(_0xf06108){return _0xf06108;});}return null;};}function handleEntityNotFound(_0xdefae0){return function(_0x46c8b1){if(!_0x46c8b1){_0xdefae0[_0xaa4b('0xa')](0x194);}return _0x46c8b1;};}function handleError(_0xfb7353,_0x3cb231){_0x3cb231=_0x3cb231||0x1f4;return function(_0x2c7057){logger[_0xaa4b('0xb')](_0x2c7057[_0xaa4b('0xc')]);if(_0x2c7057[_0xaa4b('0xd')]){delete _0x2c7057[_0xaa4b('0xd')];}_0xfb7353[_0xaa4b('0xe')](_0x3cb231)[_0xaa4b('0xf')](_0x2c7057);};}exports['update']=function(_0x5c940c,_0x302695){if(_0x5c940c[_0xaa4b('0x10')]['role']!==_0xaa4b('0x11'))throw new Error(_0xaa4b('0x12'));if(isNaN(Number(_0x5c940c[_0xaa4b('0x13')]['id'])))throw new Error(_0xaa4b('0x14'));return db[_0xaa4b('0x15')][_0xaa4b('0x16')]({'where':{'id':_0x5c940c[_0xaa4b('0x13')]['id']}})[_0xaa4b('0x9')](handleEntityNotFound(_0x302695,null))[_0xaa4b('0x9')](saveUpdates(_0x5c940c[_0xaa4b('0x17')],null))[_0xaa4b('0x9')](respondWithResult(_0x302695,null))[_0xaa4b('0x18')](handleError(_0x302695,null));}; \ No newline at end of file +var _0xac31=['socket.io-emitter','./user-setting.socket','register','redis','localhost','json','update','then','sendStatus','stack','name','status','user','admin','Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x233067,_0x43c492){var _0x108074=function(_0xfcaa4c){while(--_0xfcaa4c){_0x233067['push'](_0x233067['shift']());}};_0x108074(++_0x43c492);}(_0xac31,0xca));var _0x1ac3=function(_0x2bca3d,_0x172ec4){_0x2bca3d=_0x2bca3d-0x0;var _0x249ae1=_0xac31[_0x2bca3d];return _0x249ae1;};'use strict';var _=require(_0x1ac3('0x0'));var Redis=require(_0x1ac3('0x1'));var logger=require(_0x1ac3('0x2'))(_0x1ac3('0x3'));var config=require(_0x1ac3('0x4'));var db=require(_0x1ac3('0x5'))['db'];var socket=require(_0x1ac3('0x6'))(new Redis(config['redis']));require(_0x1ac3('0x7'))[_0x1ac3('0x8')](socket);config['redis']=_['defaults'](config[_0x1ac3('0x9')],{'host':_0x1ac3('0xa'),'port':0x18eb});function respondWithResult(_0x2bf9b1,_0x1be223){_0x1be223=_0x1be223||0xc8;return function(_0x157604){if(_0x157604){return _0x2bf9b1['status'](_0x1be223)[_0x1ac3('0xb')](_0x157604);}};}function saveUpdates(_0x4d7695){return function(_0x1286d2){if(_0x1286d2){return _0x1286d2[_0x1ac3('0xc')](_0x4d7695)[_0x1ac3('0xd')](function(_0x53500b){return _0x53500b;});}return null;};}function handleEntityNotFound(_0xa26c88){return function(_0x1e2642){if(!_0x1e2642){_0xa26c88[_0x1ac3('0xe')](0x194);}return _0x1e2642;};}function handleError(_0x24f0d2,_0x2a8dc7){_0x2a8dc7=_0x2a8dc7||0x1f4;return function(_0x422d19){logger['error'](_0x422d19[_0x1ac3('0xf')]);if(_0x422d19[_0x1ac3('0x10')]){delete _0x422d19[_0x1ac3('0x10')];}_0x24f0d2[_0x1ac3('0x11')](_0x2a8dc7)['send'](_0x422d19);};}exports[_0x1ac3('0xc')]=function(_0x37d426,_0x46c0e9){if(_0x37d426[_0x1ac3('0x12')]['role']!==_0x1ac3('0x13'))throw new Error(_0x1ac3('0x14'));if(isNaN(Number(_0x37d426['params']['id'])))throw new Error(_0x1ac3('0x15'));return db[_0x1ac3('0x16')][_0x1ac3('0x17')]({'where':{'id':_0x37d426['params']['id']}})[_0x1ac3('0xd')](handleEntityNotFound(_0x46c0e9,null))[_0x1ac3('0xd')](saveUpdates(_0x37d426[_0x1ac3('0x18')],null))['then'](respondWithResult(_0x46c0e9,null))[_0x1ac3('0x19')](handleError(_0x46c0e9,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index d048b60..62a783f 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d91=['exports','events','../../mysqldb','UserSetting','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x54ac38,_0x4f0b1b){var _0x152d6a=function(_0x45c040){while(--_0x45c040){_0x54ac38['push'](_0x54ac38['shift']());}};_0x152d6a(++_0x4f0b1b);}(_0x4d91,0x97));var _0x14d9=function(_0x6dd5c,_0x4bfc19){_0x6dd5c=_0x6dd5c-0x0;var _0x5a87fa=_0x4d91[_0x6dd5c];return _0x5a87fa;};'use strict';var EventEmitter=require(_0x14d9('0x0'));var UserSetting=require(_0x14d9('0x1'))['db'][_0x14d9('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x14d9('0x3')](0x0);var events={'afterCreate':_0x14d9('0x4'),'afterUpdate':_0x14d9('0x5'),'afterDestroy':_0x14d9('0x6')};function emitEvent(_0x50d1bd){return function(_0x3e5239,_0x76d4e0,_0x1ebe02){UserSettingEvents['emit'](_0x50d1bd+':'+_0x3e5239['id'],_0x3e5239);UserSettingEvents[_0x14d9('0x7')](_0x50d1bd,_0x3e5239);_0x1ebe02(null);};}for(var e in events){if(events[_0x14d9('0x8')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x14d9('0x9')]=UserSettingEvents; \ No newline at end of file +var _0x4551=['hook','events','../../mysqldb','UserSetting','setMaxListeners','save','update','remove','emit'];(function(_0x3c11e4,_0x5a5122){var _0x29050f=function(_0x4470dc){while(--_0x4470dc){_0x3c11e4['push'](_0x3c11e4['shift']());}};_0x29050f(++_0x5a5122);}(_0x4551,0x1f0));var _0x1455=function(_0x12b1d5,_0x335527){_0x12b1d5=_0x12b1d5-0x0;var _0x2f293a=_0x4551[_0x12b1d5];return _0x2f293a;};'use strict';var EventEmitter=require(_0x1455('0x0'));var UserSetting=require(_0x1455('0x1'))['db'][_0x1455('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x1455('0x3')](0x0);var events={'afterCreate':_0x1455('0x4'),'afterUpdate':_0x1455('0x5'),'afterDestroy':_0x1455('0x6')};function emitEvent(_0x138046){return function(_0x3fd30a,_0x5dcaed,_0x1ed201){UserSettingEvents[_0x1455('0x7')](_0x138046+':'+_0x3fd30a['id'],_0x3fd30a);UserSettingEvents[_0x1455('0x7')](_0x138046,_0x3fd30a);_0x1ed201(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x1455('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 47142e8..3582c5a 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb01a=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x175dcc,_0x385886){var _0x4384b5=function(_0x164a7c){while(--_0x164a7c){_0x175dcc['push'](_0x175dcc['shift']());}};_0x4384b5(++_0x385886);}(_0xb01a,0x1a1));var _0xab01=function(_0x1e3cf9,_0x1fd35a){_0x1e3cf9=_0x1e3cf9-0x0;var _0x461065=_0xb01a[_0x1e3cf9];return _0x461065;};'use strict';var attributes=require(_0xab01('0x0'));module[_0xab01('0x1')]=function(_0x463eac){return _0x463eac[_0xab01('0x2')](_0xab01('0x3'),attributes,{'tableName':_0xab01('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd3eaba){if(!_0xd3eaba[_0xab01('0x5')])_0xd3eaba[_0xab01('0x6')]=null;else if(_0xd3eaba[_0xab01('0x6')]===null)_0xd3eaba[_0xab01('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x89c4=['./user-setting.attributes','exports','define','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x3a2269,_0x3ef598){var _0x34b10b=function(_0x5a397f){while(--_0x5a397f){_0x3a2269['push'](_0x3a2269['shift']());}};_0x34b10b(++_0x3ef598);}(_0x89c4,0x82));var _0x489c=function(_0x157dd4,_0x2c706d){_0x157dd4=_0x157dd4-0x0;var _0x367a64=_0x89c4[_0x157dd4];return _0x367a64;};'use strict';var attributes=require(_0x489c('0x0'));module[_0x489c('0x1')]=function(_0x55c4f5){return _0x55c4f5[_0x489c('0x2')]('UserSetting',attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x165089){if(!_0x165089[_0x489c('0x3')])_0x165089[_0x489c('0x4')]=null;else if(_0x165089[_0x489c('0x4')]===null)_0x165089[_0x489c('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 264c11a..87008d2 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf13b=['./user-setting.events','save','update','emit','user-setting:update:user-','UserId','register','user-setting:'];(function(_0x2af353,_0x418430){var _0x3f3f4e=function(_0x186bb5){while(--_0x186bb5){_0x2af353['push'](_0x2af353['shift']());}};_0x3f3f4e(++_0x418430);}(_0xf13b,0x158));var _0xbf13=function(_0x5e7699,_0x34c7cf){_0x5e7699=_0x5e7699-0x0;var _0x139ad2=_0xf13b[_0x5e7699];return _0x139ad2;};'use strict';var UserSettingEvents=require(_0xbf13('0x0'));var events=[_0xbf13('0x1'),'remove',_0xbf13('0x2')];function createListener(_0x10d188,_0x1e2fa1){return function(_0x142a0e){_0x1e2fa1[_0xbf13('0x3')](_0x10d188,_0x142a0e);if(_0x10d188==='user-setting:update'){_0x1e2fa1[_0xbf13('0x3')](_0xbf13('0x4')+_0x142a0e[_0xbf13('0x5')],_0x142a0e);}};}exports[_0xbf13('0x6')]=function(_0x2852bb){for(var _0x57c84d=0x0,_0x3bd3a6=events['length'];_0x57c84d<_0x3bd3a6;_0x57c84d++){var _0xbb0fc=events[_0x57c84d];var _0x3a2cd8=createListener(_0xbf13('0x7')+_0xbb0fc,_0x2852bb);UserSettingEvents['on'](_0xbb0fc,_0x3a2cd8);}}; \ No newline at end of file +var _0x4eb2=['register','length','user-setting:','./user-setting.events','save','remove','emit','user-setting:update','user-setting:update:user-'];(function(_0x1ff5ef,_0xb8815c){var _0x1f519e=function(_0xe64425){while(--_0xe64425){_0x1ff5ef['push'](_0x1ff5ef['shift']());}};_0x1f519e(++_0xb8815c);}(_0x4eb2,0xe4));var _0x24eb=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x4eb2[_0x31cb5f];return _0x586042;};'use strict';var UserSettingEvents=require(_0x24eb('0x0'));var events=[_0x24eb('0x1'),_0x24eb('0x2'),'update'];function createListener(_0xeb7314,_0x21bc22){return function(_0x139e4e){_0x21bc22[_0x24eb('0x3')](_0xeb7314,_0x139e4e);if(_0xeb7314===_0x24eb('0x4')){_0x21bc22[_0x24eb('0x3')](_0x24eb('0x5')+_0x139e4e['UserId'],_0x139e4e);}};}exports[_0x24eb('0x6')]=function(_0x54497d){for(var _0xd72ba7=0x0,_0x37ab74=events[_0x24eb('0x7')];_0xd72ba7<_0x37ab74;_0xd72ba7++){var _0x1a1438=events[_0xd72ba7];var _0x5829d4=createListener(_0x24eb('0x8')+_0x1a1438,_0x54497d);UserSettingEvents['on'](_0x1a1438,_0x5829d4);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 9ac5c50..c80ae10 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 _0x7276=['../../components/interaction/service','./user.controller','get','index','/describe','isAuthenticated','describe','/whoami','whoami','/presence','/:id','show','getAvatar','/:id/open_tabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','/:id/contacts','addContacts','post','create','bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/pause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1791b2,_0x3def9b){var _0x8d366b=function(_0x4fadb7){while(--_0x4fadb7){_0x1791b2['push'](_0x1791b2['shift']());}};_0x8d366b(++_0x3def9b);}(_0x7276,0x6c));var _0x6727=function(_0x5a1fd3,_0x2ac694){_0x5a1fd3=_0x5a1fd3-0x0;var _0x49bb7a=_0x7276[_0x5a1fd3];return _0x49bb7a;};'use strict';var multer=require(_0x6727('0x0'));var util=require(_0x6727('0x1'));var path=require('path');var timeout=require(_0x6727('0x2'));var express=require(_0x6727('0x3'));var router=express[_0x6727('0x4')]();var fs_extra=require(_0x6727('0x5'));var auth=require(_0x6727('0x6'));var interaction=require(_0x6727('0x7'));var config=require('../../config/environment');var controller=require(_0x6727('0x8'));router[_0x6727('0x9')]('/',auth['isAuthenticated'](),controller[_0x6727('0xa')]);router[_0x6727('0x9')](_0x6727('0xb'),auth[_0x6727('0xc')](),controller[_0x6727('0xd')]);router[_0x6727('0x9')](_0x6727('0xe'),auth[_0x6727('0xc')](),controller[_0x6727('0xf')]);router['get'](_0x6727('0x10'),auth[_0x6727('0xc')](),controller['getPresence']);router['get'](_0x6727('0x11'),auth[_0x6727('0xc')](),controller[_0x6727('0x12')]);router['get']('/:id/avatar',controller[_0x6727('0x13')]);router[_0x6727('0x9')](_0x6727('0x14'),auth[_0x6727('0xc')](),controller['getOpenTabs']);router[_0x6727('0x9')]('/:id/contacts',auth[_0x6727('0xc')](),controller[_0x6727('0x15')]);router[_0x6727('0x9')](_0x6727('0x16'),auth['isAuthenticated'](),controller[_0x6727('0x17')]);router[_0x6727('0x9')](_0x6727('0x18'),auth[_0x6727('0xc')](),controller['getVoiceQueuesRt']);router[_0x6727('0x9')](_0x6727('0x19'),auth[_0x6727('0xc')](),controller[_0x6727('0x1a')]);router[_0x6727('0x9')](_0x6727('0x1b'),auth[_0x6727('0xc')](),controller[_0x6727('0x1c')]);router[_0x6727('0x9')](_0x6727('0x1d'),auth[_0x6727('0xc')](),controller['getScreenRecordings']);router[_0x6727('0x9')](_0x6727('0x1e'),auth[_0x6727('0xc')](),controller[_0x6727('0x1f')]);router[_0x6727('0x9')]('/:id/openchannel/interactions',auth[_0x6727('0xc')](),controller[_0x6727('0x20')]);router[_0x6727('0x9')]('/:id/mail/interactions',auth[_0x6727('0xc')](),controller[_0x6727('0x21')]);router[_0x6727('0x9')](_0x6727('0x22'),auth['isAuthenticated'](),controller[_0x6727('0x23')]);router[_0x6727('0x9')](_0x6727('0x24'),auth[_0x6727('0xc')](),controller[_0x6727('0x25')]);router[_0x6727('0x9')]('/:id/whatsapp/interactions',auth[_0x6727('0xc')](),controller['getWhatsappInteractions']);router[_0x6727('0x9')](_0x6727('0x26'),auth[_0x6727('0xc')](),controller[_0x6727('0x27')]);router[_0x6727('0x9')]('/:id/lists',auth[_0x6727('0xc')](),controller[_0x6727('0x28')]);router[_0x6727('0x9')](_0x6727('0x29'),auth[_0x6727('0xc')](),controller[_0x6727('0x2a')]);router[_0x6727('0x9')]('/:id/prefixes',auth[_0x6727('0xc')](),controller[_0x6727('0x2b')]);router[_0x6727('0x9')](_0x6727('0x2c'),auth[_0x6727('0xc')](),controller['getFaxAccounts']);router['get'](_0x6727('0x2d'),auth[_0x6727('0xc')](),controller[_0x6727('0x2e')]);router['get'](_0x6727('0x2f'),auth[_0x6727('0xc')](),controller[_0x6727('0x30')]);router[_0x6727('0x9')]('/:id/sms_accounts',auth[_0x6727('0xc')](),controller['getSmsAccounts']);router['get'](_0x6727('0x31'),auth[_0x6727('0xc')](),controller[_0x6727('0x32')]);router[_0x6727('0x9')](_0x6727('0x33'),auth['isAuthenticated'](),controller[_0x6727('0x34')]);router[_0x6727('0x9')](_0x6727('0x35'),auth[_0x6727('0xc')](),controller[_0x6727('0x36')]);router['get'](_0x6727('0x37'),auth[_0x6727('0xc')](),controller[_0x6727('0x38')]);router[_0x6727('0x9')](_0x6727('0x39'),auth[_0x6727('0xc')](),controller[_0x6727('0x3a')]);router['post'](_0x6727('0x3b'),auth[_0x6727('0xc')](),controller[_0x6727('0x3c')]);router[_0x6727('0x3d')]('/',auth[_0x6727('0xc')](),controller[_0x6727('0x3e')]);router['post']('/create_many',auth[_0x6727('0xc')](),controller[_0x6727('0x3f')]);router['post']('/:id/queues',auth[_0x6727('0xc')](),controller[_0x6727('0x40')]);var upload=multer({'storage':multer[_0x6727('0x41')]({'destination':function(_0x4fcac3,_0x42c8f5,_0x36c6ef){_0x36c6ef(null,path[_0x6727('0x42')](config[_0x6727('0x43')],'server/files/images/'));},'filename':function(_0x23f76f,_0x2ebd68,_0x2bf072){_0x2bf072(null,util[_0x6727('0x44')](_0x6727('0x45'),Date[_0x6727('0x46')](),_0x2ebd68[_0x6727('0x47')]));}})});router['post'](_0x6727('0x48'),upload[_0x6727('0x49')](_0x6727('0x4a')),controller[_0x6727('0x4b')]);router[_0x6727('0x3d')](_0x6727('0x4c'),auth['isAuthenticated'](),controller[_0x6727('0x4d')]);router[_0x6727('0x3d')]('/:id/logout',auth[_0x6727('0xc')](),controller['logout']);router[_0x6727('0x3d')](_0x6727('0x4e'),auth[_0x6727('0xc')](),controller['pause']);router[_0x6727('0x3d')]('/:id/unpause',auth[_0x6727('0xc')](),controller[_0x6727('0x4f')]);router['post'](_0x6727('0x26'),auth[_0x6727('0xc')](),controller[_0x6727('0x50')]);router[_0x6727('0x3d')]('/:id/chat_interactions',auth[_0x6727('0xc')](),controller[_0x6727('0x51')]);router[_0x6727('0x3d')](_0x6727('0x52'),auth['isAuthenticated'](),controller[_0x6727('0x53')]);router[_0x6727('0x3d')](_0x6727('0x54'),auth[_0x6727('0xc')](),controller['addFaxInteractions']);router[_0x6727('0x3d')](_0x6727('0x55'),auth['isAuthenticated'](),controller[_0x6727('0x56')]);router[_0x6727('0x3d')](_0x6727('0x57'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x6727('0x3d')]('/:id/whatsapp_interactions',auth[_0x6727('0xc')](),controller[_0x6727('0x58')]);router[_0x6727('0x3d')](_0x6727('0x2c'),auth[_0x6727('0xc')](),controller[_0x6727('0x59')]);router[_0x6727('0x3d')](_0x6727('0x2d'),auth[_0x6727('0xc')](),controller[_0x6727('0x5a')]);router[_0x6727('0x3d')](_0x6727('0x2f'),auth[_0x6727('0xc')](),controller[_0x6727('0x5b')]);router[_0x6727('0x3d')](_0x6727('0x5c'),auth[_0x6727('0xc')](),controller['addSmsAccounts']);router[_0x6727('0x3d')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x6727('0x5d')]);router[_0x6727('0x3d')](_0x6727('0x33'),auth[_0x6727('0xc')](),controller[_0x6727('0x5e')]);router[_0x6727('0x3d')](_0x6727('0x35'),auth[_0x6727('0xc')](),controller['addSquareProjects']);router[_0x6727('0x3d')](_0x6727('0x39'),auth['isAuthenticated'](),controller[_0x6727('0x5f')]);router[_0x6727('0x60')](_0x6727('0x11'),auth[_0x6727('0xc')](),controller['update']);router[_0x6727('0x60')]('/:id/password',auth[_0x6727('0xc')](),controller[_0x6727('0x61')]);router[_0x6727('0x62')]('/:id/queues',auth[_0x6727('0xc')](),controller[_0x6727('0x63')]);router[_0x6727('0x62')](_0x6727('0x26'),auth[_0x6727('0xc')](),controller[_0x6727('0x64')]);router['delete'](_0x6727('0x11'),auth[_0x6727('0xc')](),controller[_0x6727('0x65')]);router[_0x6727('0x62')](_0x6727('0x66'),auth[_0x6727('0xc')](),controller[_0x6727('0x67')]);router[_0x6727('0x62')](_0x6727('0x52'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x6727('0x62')](_0x6727('0x54'),auth[_0x6727('0xc')](),controller[_0x6727('0x68')]);router[_0x6727('0x62')](_0x6727('0x55'),auth[_0x6727('0xc')](),controller[_0x6727('0x69')]);router[_0x6727('0x62')]('/:id/openchannel_interactions',auth[_0x6727('0xc')](),controller[_0x6727('0x6a')]);router[_0x6727('0x62')](_0x6727('0x6b'),auth[_0x6727('0xc')](),controller[_0x6727('0x6c')]);router[_0x6727('0x62')](_0x6727('0x2c'),auth[_0x6727('0xc')](),controller['removeFaxAccounts']);router[_0x6727('0x62')](_0x6727('0x2d'),auth[_0x6727('0xc')](),controller[_0x6727('0x6d')]);router[_0x6727('0x62')](_0x6727('0x2f'),auth[_0x6727('0xc')](),controller['removeOpenchannelAccounts']);router[_0x6727('0x62')]('/:id/sms_accounts',auth[_0x6727('0xc')](),controller[_0x6727('0x6e')]);router[_0x6727('0x62')](_0x6727('0x31'),auth[_0x6727('0xc')](),controller[_0x6727('0x6f')]);router[_0x6727('0x62')](_0x6727('0x33'),auth[_0x6727('0xc')](),controller[_0x6727('0x70')]);router[_0x6727('0x62')](_0x6727('0x35'),auth['isAuthenticated'](),controller['removeSquareProjects']);router[_0x6727('0x62')](_0x6727('0x39'),auth[_0x6727('0xc')](),controller[_0x6727('0x71')]);module[_0x6727('0x72')]=router; \ No newline at end of file +var _0xc682=['removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','post','create','bulkCreate','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','/:id/chat_websites','createApiKey','put','/:id/password','removeQueues','delete','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts'];(function(_0x12ba59,_0x139b9d){var _0x147a9c=function(_0xf1804a){while(--_0xf1804a){_0x12ba59['push'](_0x12ba59['shift']());}};_0x147a9c(++_0x139b9d);}(_0xc682,0x1c2));var _0x2c68=function(_0x2925a6,_0x373d0c){_0x2925a6=_0x2925a6-0x0;var _0xcf8208=_0xc682[_0x2925a6];return _0xcf8208;};'use strict';var multer=require(_0x2c68('0x0'));var util=require(_0x2c68('0x1'));var path=require(_0x2c68('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c68('0x3')]();var fs_extra=require(_0x2c68('0x4'));var auth=require(_0x2c68('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2c68('0x6'));var controller=require(_0x2c68('0x7'));router[_0x2c68('0x8')]('/',auth[_0x2c68('0x9')](),controller[_0x2c68('0xa')]);router[_0x2c68('0x8')](_0x2c68('0xb'),auth['isAuthenticated'](),controller[_0x2c68('0xc')]);router['get'](_0x2c68('0xd'),auth['isAuthenticated'](),controller[_0x2c68('0xe')]);router[_0x2c68('0x8')](_0x2c68('0xf'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x10')]);router[_0x2c68('0x8')](_0x2c68('0x11'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x12')]);router['get']('/:id/avatar',controller['getAvatar']);router[_0x2c68('0x8')](_0x2c68('0x13'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x14')]);router[_0x2c68('0x8')](_0x2c68('0x15'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x16')]);router[_0x2c68('0x8')](_0x2c68('0x17'),auth['isAuthenticated'](),controller['getQueues']);router['get'](_0x2c68('0x18'),auth[_0x2c68('0x9')](),controller['getVoiceQueuesRt']);router['get']('/:id/groups',auth[_0x2c68('0x9')](),controller[_0x2c68('0x19')]);router[_0x2c68('0x8')](_0x2c68('0x1a'),auth['isAuthenticated'](),controller['getRecordings']);router[_0x2c68('0x8')](_0x2c68('0x1b'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x1c')]);router[_0x2c68('0x8')](_0x2c68('0x1d'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x1e')]);router[_0x2c68('0x8')]('/:id/openchannel/interactions',auth[_0x2c68('0x9')](),controller[_0x2c68('0x1f')]);router[_0x2c68('0x8')](_0x2c68('0x20'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x21')]);router[_0x2c68('0x8')](_0x2c68('0x22'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x23')]);router[_0x2c68('0x8')](_0x2c68('0x24'),auth['isAuthenticated'](),controller[_0x2c68('0x25')]);router[_0x2c68('0x8')](_0x2c68('0x26'),auth['isAuthenticated'](),controller[_0x2c68('0x27')]);router[_0x2c68('0x8')](_0x2c68('0x28'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x29')]);router['get']('/:id/lists',auth[_0x2c68('0x9')](),controller[_0x2c68('0x2a')]);router[_0x2c68('0x8')]('/:id/agents',auth[_0x2c68('0x9')](),controller[_0x2c68('0x2b')]);router['get']('/:id/prefixes',auth[_0x2c68('0x9')](),controller[_0x2c68('0x2c')]);router[_0x2c68('0x8')](_0x2c68('0x2d'),auth[_0x2c68('0x9')](),controller['getFaxAccounts']);router[_0x2c68('0x8')](_0x2c68('0x2e'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x2f')]);router['get'](_0x2c68('0x30'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x31')]);router[_0x2c68('0x8')](_0x2c68('0x32'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0x2c68('0x8')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x2c68('0x33')]);router[_0x2c68('0x8')](_0x2c68('0x34'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x35')]);router[_0x2c68('0x8')](_0x2c68('0x36'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x37')]);router[_0x2c68('0x8')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0x2c68('0x38')]);router[_0x2c68('0x8')](_0x2c68('0x39'),auth[_0x2c68('0x9')](),controller['getApiKey']);router[_0x2c68('0x3a')](_0x2c68('0x15'),auth['isAuthenticated'](),controller['addContacts']);router[_0x2c68('0x3a')]('/',auth[_0x2c68('0x9')](),controller[_0x2c68('0x3b')]);router[_0x2c68('0x3a')]('/create_many',auth[_0x2c68('0x9')](),controller[_0x2c68('0x3c')]);router[_0x2c68('0x3a')](_0x2c68('0x17'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x3d')]);var upload=multer({'storage':multer[_0x2c68('0x3e')]({'destination':function(_0x495e12,_0x38a5a4,_0x3fc190){_0x3fc190(null,path['join'](config[_0x2c68('0x3f')],_0x2c68('0x40')));},'filename':function(_0x44b3b8,_0x960bd7,_0x5b9e36){_0x5b9e36(null,util[_0x2c68('0x41')](_0x2c68('0x42'),Date[_0x2c68('0x43')](),_0x960bd7[_0x2c68('0x44')]));}})});router[_0x2c68('0x3a')](_0x2c68('0x45'),upload[_0x2c68('0x46')]('file'),controller[_0x2c68('0x47')]);router[_0x2c68('0x3a')](_0x2c68('0x48'),auth['isAuthenticated'](),controller['login']);router[_0x2c68('0x3a')](_0x2c68('0x49'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x4a')]);router['post'](_0x2c68('0x4b'),auth['isAuthenticated'](),controller[_0x2c68('0x4c')]);router[_0x2c68('0x3a')](_0x2c68('0x4d'),auth['isAuthenticated'](),controller['unpause']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x2c68('0x4e')]);router[_0x2c68('0x3a')](_0x2c68('0x4f'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x50')]);router[_0x2c68('0x3a')]('/:id/mail_interactions',auth[_0x2c68('0x9')](),controller['addMailInteractions']);router[_0x2c68('0x3a')]('/:id/fax_interactions',auth[_0x2c68('0x9')](),controller[_0x2c68('0x51')]);router[_0x2c68('0x3a')](_0x2c68('0x52'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x53')]);router['post'](_0x2c68('0x54'),auth[_0x2c68('0x9')](),controller['addOpenchannelInteractions']);router[_0x2c68('0x3a')]('/:id/whatsapp_interactions',auth[_0x2c68('0x9')](),controller[_0x2c68('0x55')]);router[_0x2c68('0x3a')](_0x2c68('0x2d'),auth['isAuthenticated'](),controller[_0x2c68('0x56')]);router[_0x2c68('0x3a')](_0x2c68('0x2e'),auth[_0x2c68('0x9')](),controller['addMailAccounts']);router[_0x2c68('0x3a')]('/:id/openchannel_accounts',auth[_0x2c68('0x9')](),controller[_0x2c68('0x57')]);router['post'](_0x2c68('0x32'),auth[_0x2c68('0x9')](),controller['addSmsAccounts']);router[_0x2c68('0x3a')](_0x2c68('0x58'),auth[_0x2c68('0x9')](),controller['addChatWebsites']);router[_0x2c68('0x3a')](_0x2c68('0x34'),auth[_0x2c68('0x9')](),controller['addWhatsappAccounts']);router[_0x2c68('0x3a')]('/:id/square_projects',auth[_0x2c68('0x9')](),controller['addSquareProjects']);router['post'](_0x2c68('0x39'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x59')]);router[_0x2c68('0x5a')](_0x2c68('0x11'),auth[_0x2c68('0x9')](),controller['update']);router[_0x2c68('0x5a')](_0x2c68('0x5b'),auth[_0x2c68('0x9')](),controller['changePassword']);router['delete'](_0x2c68('0x17'),auth['isAuthenticated'](),controller[_0x2c68('0x5c')]);router[_0x2c68('0x5d')](_0x2c68('0x28'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x2c68('0x5d')](_0x2c68('0x11'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x5e')]);router[_0x2c68('0x5d')](_0x2c68('0x4f'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x5f')]);router[_0x2c68('0x5d')](_0x2c68('0x60'),auth['isAuthenticated'](),controller[_0x2c68('0x61')]);router[_0x2c68('0x5d')](_0x2c68('0x62'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x63')]);router['delete'](_0x2c68('0x52'),auth['isAuthenticated'](),controller[_0x2c68('0x64')]);router[_0x2c68('0x5d')](_0x2c68('0x54'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x65')]);router[_0x2c68('0x5d')](_0x2c68('0x66'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x67')]);router['delete']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x2c68('0x68')]);router[_0x2c68('0x5d')](_0x2c68('0x2e'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x69')]);router[_0x2c68('0x5d')](_0x2c68('0x30'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x6a')]);router['delete'](_0x2c68('0x32'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0x2c68('0x5d')]('/:id/chat_websites',auth[_0x2c68('0x9')](),controller[_0x2c68('0x6b')]);router[_0x2c68('0x5d')](_0x2c68('0x34'),auth['isAuthenticated'](),controller[_0x2c68('0x6c')]);router[_0x2c68('0x5d')]('/:id/square_projects',auth[_0x2c68('0x9')](),controller[_0x2c68('0x6d')]);router[_0x2c68('0x5d')](_0x2c68('0x39'),auth[_0x2c68('0x9')](),controller[_0x2c68('0x6e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index e511f8d..acde1c9 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 _0xa9e0=['certificate','passive','nonat','update,nonat','TEXT','showWebBar','wss','encryption','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','split','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a9e('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x14')},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x0a9e('0xc'),_0x0a9e('0x17')),'allowNull':!![],'defaultValue':_0x0a9e('0x16')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')]('ALLOWED_NOT_SCREENED',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),'PROHIB_PASSED_SCREEN',_0x0a9e('0x1d'),_0x0a9e('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x540530){this[_0x0a9e('0x4')]('transport',_0x540530?_0x540530[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))['split'](','):null;},'comment':_0x0a9e('0x22')},'dtmfmode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x23'),_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27')),'allowNull':!![],'defaultValue':_0x0a9e('0x23')},'directmedia':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no','nonat',_0x0a9e('0x29'),_0x0a9e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0x15de0e){this['setDataValue']('nat',_0x15de0e?_0x15de0e[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this[_0x0a9e('0x8')](_0x0a9e('0x2c'))[_0x0a9e('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a9e('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a9e('0x3')]},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2e'),'set':function(_0x40d766){this['setDataValue'](_0x0a9e('0x2f'),_0x40d766?_0x40d766[_0x0a9e('0x20')](';'):_0x0a9e('0x2e'));},'get':function(){return this[_0x0a9e('0x8')]('allow')?this['getDataValue'](_0x0a9e('0x2f'))[_0x0a9e('0x2d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x5b4f5e){this[_0x0a9e('0x4')](_0x0a9e('0x30'),_0x5b4f5e?_0x5b4f5e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x30'))?this[_0x0a9e('0x8')](_0x0a9e('0x30'))[_0x0a9e('0x2d')](','):null;},'comment':_0x0a9e('0x31')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x32')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x28')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x34'),_0x0a9e('0x35'),_0x0a9e('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38')),'allowNull':!![],'defaultValue':_0x0a9e('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','fingerprint',_0x0a9e('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no',_0x0a9e('0x3b'),_0x0a9e('0x29'),_0x0a9e('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a9e('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3649cc){this['setDataValue'](_0x0a9e('0x3e'),_0x3649cc);var _0x5ba1f9=this['get']({'plain':!![]});switch(_0x3649cc){case 0x0:case 0x1:var _0x5674ee=_0x5ba1f9[_0x0a9e('0x21')]?_['isArray'](_0x5ba1f9[_0x0a9e('0x21')])?_0x5ba1f9[_0x0a9e('0x21')][_0x0a9e('0x20')]():_0x5ba1f9[_0x0a9e('0x21')]:_0x0a9e('0x1f');if(_0x5674ee===_0x0a9e('0x3f')){_0x5674ee='udp';}this[_0x0a9e('0x4')]('transport',_0x5674ee);this[_0x0a9e('0x4')](_0x0a9e('0x40'),'no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x41'),null);this[_0x0a9e('0x4')](_0x0a9e('0x42'),null);this['setDataValue'](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('dtlsverify',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this[_0x0a9e('0x4')]('dtlsprivatekey',null);this[_0x0a9e('0x4')](_0x0a9e('0x46'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x3f'));this['setDataValue']('encryption',_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x47'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x41'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x42'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x49'));this['setDataValue'](_0x0a9e('0x45'),_0x5ba1f9[_0x0a9e('0x45')]||_0x0a9e('0x4a'));this['setDataValue'](_0x0a9e('0x4b'),_0x5ba1f9[_0x0a9e('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x0a9e('0x3d')],'set':function(_0x13b5c0){this['setDataValue']('permissions',_0x13b5c0?_0x13b5c0['join'](','):[]);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x4c'))?_[_0x0a9e('0x4d')](this[_0x0a9e('0x8')](_0x0a9e('0x4c'))[_0x0a9e('0x2d')](','),function(_0xeef20){return parseInt(_0xeef20,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0a9e('0x4e')],'get':function(){return this[_0x0a9e('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a9e('0x8')](_0x0a9e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0xdb98ca){if(typeof _0xdb98ca===_0x0a9e('0x50')){var _0x3df0e3=_0xdb98ca==='1'?!![]:_0xdb98ca==='0'?![]:_0xdb98ca===_0x0a9e('0x51')?!![]:_0xdb98ca===_0x0a9e('0x52')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0x3df0e3);}else{this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0xdb98ca);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf4120f){this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0xf4120f);if(_0xf4120f===!![]){this['setDataValue'](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')](_0x0a9e('0x56'),0x0);}else{this[_0x0a9e('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0a9e('0xf')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index c59dd3b..fa5c3ec 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 _0x20d6=['limit','count','set','Content-Range','update','admin','Users','user','Agents','Telephones','telephone','filter','value','includes','role','find','name','UserProfileResource','stack','send','rawAttributes','map','fieldName','type','key','salt','getOptions','where','User','query','includeAll','include','true','UserSetting','userSetting','attributes','push','findAll','openTabs','rows','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','show','params','model','differenceBy','keys','password','filters','intersection','fields','merge','all','body','describe','addContacts','ids','omit','internal','Setting','findById','validatePasswordPattern','isNil','min_internal','sequelize','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','105','107','108','109','100','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','agent','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','UserProfileSection','isEmpty','compact','changePassword','oldPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','newPassword','Sequelize','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','securePassword','enforcePasswordHistory','previousPasswords','passwordHistoryLimit','updatePasswordsHistory','channel','online','loginInPause','isValidChannel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','voice','VoiceQueue','get','interface','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','Unknown\x20channel','remove','isArray','emit','Queue:remove','destroy','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WHATSAPP','concat','getContacts','findOne','CmContact','order','sort','pick','options','List','Tag','Tags','color','tag','getQueues','Queue','hasOwnProperty','getVoiceQueuesRt','nolimit','getGroups','getRecordings','VoiceRecording','ScreenRecording','UserId','ChatInteraction','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','getChannels','DEFAULT\x20PAUSE','voicePause','openchannelPause','whatsapppause','manual','Pause','getTeams','addTeams','Team','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','VoicePrefixId','removeTeams','Whatsapp','getLists','CmList','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','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','getFaxAccounts','addFaxAccounts','MailAccount','getMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','firstName','lastName','phone','Contact','dialActive','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','getUserSetting','queues','teams','inbound','getAgents','col','toString','asc','desc','substring','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','unknown','unavailable','ringing','voiceStatus','busy','slice','toUpperCase','QueryTypes','field','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','util','path','lodash','jayson/promise','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','socket.io-emitter','redis','register','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined'];(function(_0x2cbb7c,_0x2ee0c6){var _0x49bf09=function(_0xf9ff26){while(--_0xf9ff26){_0x2cbb7c['push'](_0x2cbb7c['shift']());}};_0x49bf09(++_0x2ee0c6);}(_0x20d6,0x170));var _0x620d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x20d6[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0x620d('0x0'));var BPromise=require('bluebird');var util=require(_0x620d('0x1'));var path=require(_0x620d('0x2'));var fs=require('fs');var _=require(_0x620d('0x3'));var squel=require('squel');var jayson=require(_0x620d('0x4'));var Redis=require(_0x620d('0x5'));var authService=require(_0x620d('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x620d('0x7'))(_0x620d('0x8'));var utils=require(_0x620d('0x9'));var config=require(_0x620d('0xa'));var licenseUtil=require(_0x620d('0xb'));var db=require('../../mysqldb')['db'];var socket=require(_0x620d('0xc'))(new Redis(config[_0x620d('0xd')]));require('./user.socket')[_0x620d('0xe')](socket);config[_0x620d('0xd')]=_[_0x620d('0xf')](config['redis'],{'host':_0x620d('0x10'),'port':0x18eb});var client=jayson[_0x620d('0x11')][_0x620d('0x12')]({'port':0x232a});var values;function respondWithRpcPromise(_0xa705c9,_0x361047,_0x21023f,_0x26615a){return new BPromise(function(_0x433853,_0x3a5e0d){var _0x524926=_0x26615a||client;return _0x524926[_0x620d('0x13')](_0xa705c9,_0x21023f)[_0x620d('0x14')](function(_0x3655fd){logger[_0x620d('0x15')](_0x620d('0x16'),_0x361047,_0x620d('0x17'));logger[_0x620d('0x18')]('User,\x20%s,\x20%s,\x20%s',_0x361047,_0x620d('0x17'),JSON[_0x620d('0x19')](_0x3655fd));if(_0x3655fd[_0x620d('0x1a')]){if(_0x3655fd[_0x620d('0x1a')]['code']===0x1f4){logger[_0x620d('0x1a')](_0x620d('0x16'),_0x361047,_0x3655fd[_0x620d('0x1a')][_0x620d('0x1b')]);return _0x3a5e0d(_0x3655fd[_0x620d('0x1a')][_0x620d('0x1b')]);}logger[_0x620d('0x1a')](_0x620d('0x16'),_0x361047,_0x3655fd['error'][_0x620d('0x1b')]);return _0x433853(_0x3655fd['error'][_0x620d('0x1b')]);}else{logger['info'](_0x620d('0x16'),_0x361047,'request\x20sent');_0x433853(_0x3655fd[_0x620d('0x1c')][_0x620d('0x1b')]);}})[_0x620d('0x1d')](function(_0x442007){logger[_0x620d('0x1a')](_0x620d('0x16'),_0x361047,_0x442007);_0x3a5e0d(_0x442007);});});}function respondWithStatusCode(_0x4e59d9,_0x27faa8){_0x27faa8=_0x27faa8||0xcc;return function(_0x1f4dfd){if(_0x1f4dfd){return _0x4e59d9[_0x620d('0x1e')](_0x27faa8);}return _0x4e59d9[_0x620d('0x1f')](_0x27faa8)[_0x620d('0x20')]();};}function respondWithResult(_0xfbfd24,_0x25e278){_0x25e278=_0x25e278||0xc8;return function(_0x3a602a){if(_0x3a602a){return _0xfbfd24['status'](_0x25e278)[_0x620d('0x21')](_0x3a602a);}};}function respondWithFilteredResult(_0x1f6c7d,_0x4bbd7b){return function(_0x10f3e3){if(_0x10f3e3){var _0x4cf247=typeof _0x4bbd7b[_0x620d('0x22')]===_0x620d('0x23')&&typeof _0x4bbd7b[_0x620d('0x24')]===_0x620d('0x23');var _0x30fc1e=_0x10f3e3[_0x620d('0x25')];var _0x33dec8=_0x4cf247?0x0:_0x4bbd7b[_0x620d('0x22')];var _0x4c81dd=_0x4cf247?_0x10f3e3[_0x620d('0x25')]:_0x4bbd7b[_0x620d('0x22')]+_0x4bbd7b['limit'];var _0xfb9dc9;if(_0x4c81dd>=_0x30fc1e){_0x4c81dd=_0x30fc1e;_0xfb9dc9=0xc8;}else{_0xfb9dc9=0xce;}_0x1f6c7d[_0x620d('0x1f')](_0xfb9dc9);return _0x1f6c7d[_0x620d('0x26')](_0x620d('0x27'),_0x33dec8+'-'+_0x4c81dd+'/'+_0x30fc1e)[_0x620d('0x21')](_0x10f3e3);}return null;};}function saveUpdates(_0x241cc8){return function(_0x153a6a){if(_0x153a6a){return _0x153a6a[_0x620d('0x28')](_0x241cc8)[_0x620d('0x14')](function(_0x5003f5){return _0x5003f5;});}return null;};}function removeEntity(_0x34490c){return function(_0x26ae5d){if(_0x26ae5d){return _0x26ae5d['destroy']()[_0x620d('0x14')](function(){var _0x3d570f=_0x26ae5d['get']({'plain':!![]});if(_0x3d570f['role']===_0x620d('0x29'))return;var _0x2e790e=[{'name':_0x620d('0x2a'),'value':_0x620d('0x2b'),'ignore':!![]},{'name':_0x620d('0x2c'),'value':'agent','ignore':![]},{'name':_0x620d('0x2d'),'value':_0x620d('0x2e'),'ignore':![]}];var _0x3628a1=_(_0x2e790e)[_0x620d('0x2f')]('ignore')['map'](_0x620d('0x30'))[_0x620d('0x30')]();if(_[_0x620d('0x31')](_0x3628a1,_0x3d570f[_0x620d('0x32')])){return;}var _0x14d400=_[_0x620d('0x33')](_0x2e790e,[_0x620d('0x30'),_0x3d570f[_0x620d('0x32')]])[_0x620d('0x34')];return db[_0x620d('0x35')]['destroy']({'where':{'type':_0x14d400,'resourceId':_0x3d570f['id']}})['then'](function(){return _0x26ae5d;});})[_0x620d('0x14')](function(){_0x34490c[_0x620d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5717cf){return function(_0x500364){if(!_0x500364){_0x5717cf[_0x620d('0x1e')](0x194);}return _0x500364;};}function handleError(_0x440df0,_0x4f738d){_0x4f738d=_0x4f738d||0x1f4;return function(_0x4832ed){logger[_0x620d('0x1a')](_0x4832ed[_0x620d('0x36')]);if(_0x4832ed['name']){delete _0x4832ed[_0x620d('0x34')];}_0x440df0[_0x620d('0x1f')](_0x4f738d)[_0x620d('0x37')](_0x4832ed);};}exports['index']=function(_0x589681,_0x4428b1){var _0x2735ff={},_0x1ce4e1={'count':0x0,'rows':[]};var _0x2a4556=_(db['User'][_0x620d('0x38')])[_0x620d('0x39')](function(_0x228e11){return{'name':_0x228e11[_0x620d('0x3a')],'type':_0x228e11[_0x620d('0x3b')][_0x620d('0x3c')]};})[_0x620d('0x2f')](function(_0x2d7170){return!_[_0x620d('0x31')](['password',_0x620d('0x3d')],_0x2d7170[_0x620d('0x34')]);})[_0x620d('0x30')]();_0x2735ff=qs[_0x620d('0x3e')](_0x2a4556,_0x589681);var _0x3250d1={'where':_0x2735ff[_0x620d('0x3f')]};return db[_0x620d('0x40')][_0x620d('0x25')](_0x3250d1)[_0x620d('0x14')](function(_0x686b62){_0x1ce4e1[_0x620d('0x25')]=_0x686b62;if(_0x589681[_0x620d('0x41')][_0x620d('0x42')]){_0x2735ff[_0x620d('0x43')]=[{'all':!![]}];}if(_0x589681['query']['userSetting']===_0x620d('0x44')){_0x2735ff['include']=[{'model':db[_0x620d('0x45')],'as':_0x620d('0x46')}];}if(!_[_0x620d('0x31')](_0x2735ff[_0x620d('0x47')],'id')){_0x2735ff[_0x620d('0x47')][_0x620d('0x48')]('id');}return db['User'][_0x620d('0x49')](_0x2735ff);})[_0x620d('0x14')](function(_0x3856e5){_0x1ce4e1['rows']=_0x3856e5;if(_0x589681[_0x620d('0x41')][_0x620d('0x4a')]===_0x620d('0x44')){var _0x19426b=[];for(var _0x3481c2=0x0;_0x3481c2<_0x1ce4e1[_0x620d('0x4b')][_0x620d('0x4c')];_0x3481c2++){_0x19426b[_0x620d('0x48')](get_open_tabs(_0x620d('0x4d'),_0x1ce4e1[_0x620d('0x4b')][_0x3481c2][_0x620d('0x4e')]));_0x19426b['push'](get_open_tabs(_0x620d('0x4f'),_0x1ce4e1[_0x620d('0x4b')][_0x3481c2][_0x620d('0x4e')]));_0x19426b[_0x620d('0x48')](get_open_tabs(_0x620d('0x50'),_0x1ce4e1['rows'][_0x3481c2][_0x620d('0x4e')]));_0x19426b[_0x620d('0x48')](get_open_tabs(_0x620d('0x51'),_0x1ce4e1['rows'][_0x3481c2][_0x620d('0x4e')]));_0x19426b[_0x620d('0x48')](get_open_tabs(_0x620d('0x52'),_0x1ce4e1['rows'][_0x3481c2][_0x620d('0x4e')]));_0x19426b[_0x620d('0x48')](get_open_tabs(_0x620d('0x53'),_0x1ce4e1[_0x620d('0x4b')][_0x3481c2][_0x620d('0x4e')]));}return BPromise['all'](_0x19426b)[_0x620d('0x14')](function(){return _0x1ce4e1;});}else{return _0x1ce4e1;}})[_0x620d('0x14')](respondWithFilteredResult(_0x4428b1,_0x2735ff))[_0x620d('0x1d')](handleError(_0x4428b1,null));};exports[_0x620d('0x54')]=function(_0xe7cf95,_0x12bf9c){var _0x570139={'raw':![],'where':{'id':_0xe7cf95[_0x620d('0x55')]['id']}},_0x52d033={};_0x52d033[_0x620d('0x56')]=_[_0x620d('0x57')](_[_0x620d('0x58')](db[_0x620d('0x40')][_0x620d('0x38')]),[_0x620d('0x59'),'salt']);_0x52d033[_0x620d('0x41')]=_[_0x620d('0x58')](_0xe7cf95[_0x620d('0x41')]);_0x52d033[_0x620d('0x5a')]=_[_0x620d('0x5b')](_0x52d033[_0x620d('0x56')],_0x52d033[_0x620d('0x41')]);_0x570139[_0x620d('0x47')]=_[_0x620d('0x5b')](_0x52d033[_0x620d('0x56')],qs[_0x620d('0x5c')](_0xe7cf95[_0x620d('0x41')]['fields']));_0x570139[_0x620d('0x47')]=_0x570139[_0x620d('0x47')][_0x620d('0x4c')]?_0x570139[_0x620d('0x47')]:_0x52d033[_0x620d('0x56')];if(_0xe7cf95[_0x620d('0x41')][_0x620d('0x42')]){_0x570139[_0x620d('0x43')]=[{'all':!![]}];}if(_0xe7cf95['query'][_0x620d('0x46')]===_0x620d('0x44')){_0x570139[_0x620d('0x43')]=[{'model':db['UserSetting'],'as':_0x620d('0x46')}];}_0x570139=_[_0x620d('0x5d')]({},_0x570139,_0xe7cf95['options']);if(!_[_0x620d('0x31')](_0x570139[_0x620d('0x47')],'id')){_0x570139[_0x620d('0x47')][_0x620d('0x48')]('id');}return db['User'][_0x620d('0x33')](_0x570139)[_0x620d('0x14')](handleEntityNotFound(_0x12bf9c,null))[_0x620d('0x14')](function(_0x2b97cb){var _0x30030d=[];values=_0x2b97cb;if(_0xe7cf95[_0x620d('0x41')][_0x620d('0x4a')]==='true'){_0x30030d['push'](get_open_tabs(_0x620d('0x4d'),_0x2b97cb['dataValues']));_0x30030d[_0x620d('0x48')](get_open_tabs(_0x620d('0x4f'),_0x2b97cb[_0x620d('0x4e')]));_0x30030d['push'](get_open_tabs('openchannel',_0x2b97cb[_0x620d('0x4e')]));_0x30030d[_0x620d('0x48')](get_open_tabs(_0x620d('0x53'),_0x2b97cb[_0x620d('0x4e')]));_0x30030d['push'](get_open_tabs(_0x620d('0x50'),_0x2b97cb['dataValues']));_0x30030d[_0x620d('0x48')](get_open_tabs(_0x620d('0x51'),_0x2b97cb[_0x620d('0x4e')]));return BPromise[_0x620d('0x5e')](_0x30030d);}else{return values;}})['then'](function(){return values;})['then'](respondWithResult(_0x12bf9c,null))[_0x620d('0x1d')](handleError(_0x12bf9c,null));};exports[_0x620d('0x28')]=function(_0x49e55d,_0x172db0){if(_0x49e55d[_0x620d('0x5f')]['id']){delete _0x49e55d[_0x620d('0x5f')]['id'];}delete _0x49e55d[_0x620d('0x5f')][_0x620d('0x32')];return db['User'][_0x620d('0x33')]({'where':{'id':_0x49e55d[_0x620d('0x55')]['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x172db0,null))[_0x620d('0x14')](saveUpdates(_0x49e55d[_0x620d('0x5f')],null))['then'](respondWithResult(_0x172db0,null))['catch'](handleError(_0x172db0,null));};exports['describe']=function(_0x29d9ab,_0x1d168d){return db[_0x620d('0x40')][_0x620d('0x60')]()[_0x620d('0x14')](respondWithResult(_0x1d168d,null))[_0x620d('0x1d')](handleError(_0x1d168d,null));};exports['addContacts']=function(_0x2134de,_0x17ae4b){return db[_0x620d('0x40')][_0x620d('0x33')]({'where':{'id':_0x2134de[_0x620d('0x55')]['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x17ae4b,null))['then'](function(_0x3af84e){if(_0x3af84e){return _0x3af84e[_0x620d('0x61')](_0x2134de[_0x620d('0x5f')][_0x620d('0x62')],_[_0x620d('0x63')](_0x2134de[_0x620d('0x5f')],[_0x620d('0x62'),'id'])||{});}})[_0x620d('0x14')](respondWithResult(_0x17ae4b,null))[_0x620d('0x1d')](handleError(_0x17ae4b,null));};function validateUser(_0x468f1){return new BPromise(function(_0x4c26b9,_0x165ca8){if(_0x468f1[_0x620d('0x64')])return _0x4c26b9(_0x468f1);return db[_0x620d('0x65')][_0x620d('0x66')](0x1)[_0x620d('0x14')](function(_0x52b62b){if(_0x52b62b['securePassword'])authService[_0x620d('0x67')](_0x468f1[_0x620d('0x59')]);db[_0x620d('0x40')]['max']('internal')[_0x620d('0x14')](function(_0x10e1a5){if(_[_0x620d('0x68')](_0x10e1a5)){_0x468f1[_0x620d('0x64')]=_0x52b62b[_0x620d('0x69')]||0x1;return;}if(_[_0x620d('0x68')](_0x52b62b['min_internal'])||_0x52b62b[_0x620d('0x69')]===_0x10e1a5){_0x468f1['internal']=_0x10e1a5+0x1;return;}if(_0x52b62b[_0x620d('0x69')]>_0x10e1a5){_0x468f1[_0x620d('0x64')]=_0x52b62b[_0x620d('0x69')];return;}return db[_0x620d('0x6a')]['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x620d('0x6a')]['QueryTypes'][_0x620d('0x6b')]})[_0x620d('0x14')](function(_0x4691a0){if(_0x4691a0&&_0x4691a0[_0x620d('0x4c')]){for(var _0x39cc61=0x0,_0x401dd8=_0x4691a0['length'];_0x39cc61<_0x401dd8&&_['isNil'](_0x468f1[_0x620d('0x64')]);_0x39cc61++){if(_0x52b62b['min_internal']<=_0x4691a0[_0x39cc61][_0x620d('0x6c')]){_0x468f1['internal']=_0x4691a0[_0x39cc61][_0x620d('0x6c')];}else if(_0x52b62b[_0x620d('0x69')]>_0x4691a0[_0x39cc61][_0x620d('0x6c')]&&_0x52b62b[_0x620d('0x69')]<=_0x4691a0[_0x39cc61]['to']){_0x468f1[_0x620d('0x64')]=_0x52b62b[_0x620d('0x69')];}}}if(_[_0x620d('0x68')](_0x468f1['internal'])){_0x468f1[_0x620d('0x64')]=_0x10e1a5+0x1;}return _0x4c26b9(_0x468f1);});});})[_0x620d('0x1d')](function(_0x2f7fbe){_0x165ca8(_0x2f7fbe);});});}function updateUser(_0x4fb9eb){return new BPromise(function(_0x4d7362,_0x31ab79){try{if(_0x4fb9eb[_0x620d('0x6d')]){_0x4fb9eb[_0x620d('0x6e')]=_0x4fb9eb[_0x620d('0x64')];_0x4fb9eb[_0x620d('0x6f')]={'mailbox':_0x4fb9eb[_0x620d('0x64')],'password':_0x4fb9eb[_0x620d('0x59')],'fullname':_0x4fb9eb[_0x620d('0x70')],'email':_0x4fb9eb[_0x620d('0x71')]};}if(_0x4fb9eb[_0x620d('0x32')]==='agent'){if(!_0x4fb9eb[_0x620d('0x72')])_0x4fb9eb[_0x620d('0x72')]=[_0x620d('0x73'),_0x620d('0x74'),_0x620d('0x75'),_0x620d('0x76'),'110','104',_0x620d('0x77'),'106',_0x620d('0x78'),_0x620d('0x79'),_0x620d('0x7a'),_0x620d('0x7b'),'111',_0x620d('0x7c'),_0x620d('0x7d')];}_0x4d7362(_0x4fb9eb);}catch(_0x7a7ac8){_0x31ab79(_0x7a7ac8);}});}exports[_0x620d('0x7e')]=function(_0x1aa3b9,_0x1fdbf6){if(_0x1aa3b9['user'][_0x620d('0x32')]==='agent')throw new Error(_0x620d('0x7f'));if(_0x1aa3b9[_0x620d('0x5f')][_0x620d('0x32')]==='user'&&_0x1aa3b9[_0x620d('0x2b')][_0x620d('0x32')]!==_0x620d('0x29')){throw new Error(_0x620d('0x80'));}if(_0x1aa3b9[_0x620d('0x5f')][_0x620d('0x32')]===_0x620d('0x29')&&_0x1aa3b9['user'][_0x620d('0x32')]!==_0x620d('0x29')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x620d('0x81')]([_0x1aa3b9[_0x620d('0x5f')]])[_0x620d('0x14')](function(){return validateUser(_0x1aa3b9[_0x620d('0x5f')]);})[_0x620d('0x14')](function(_0x15a5b3){return updateUser(_0x15a5b3)[_0x620d('0x14')](function(_0x18ec35){if(_0x18ec35[_0x620d('0x32')]===_0x620d('0x29')){_0x18ec35['settingsEnabled']=_0x1aa3b9[_0x620d('0x2b')][_0x620d('0x82')];delete _0x18ec35[_0x620d('0x83')];}return _0x18ec35;});})[_0x620d('0x14')](function(_0x2ad798){return db['User']['create'](_0x2ad798,{'include':[{'model':db['VoiceMail'],'as':_0x620d('0x6f')}]});})['then'](function(_0x419897){if(_0x1aa3b9[_0x620d('0x5f')][_0x620d('0x32')]==='user')return _0x419897;if(_0x1aa3b9[_0x620d('0x2b')][_0x620d('0x32')]!==_0x620d('0x2b'))return _0x419897;return db['UserProfileSection'][_0x620d('0x33')]({'where':{'name':_0x419897[_0x620d('0x32')]===_0x620d('0x84')?_0x620d('0x2c'):_0x620d('0x2d'),'userProfileId':_0x1aa3b9[_0x620d('0x2b')][_0x620d('0x83')]},'raw':!![]})[_0x620d('0x14')](function(_0x33fa3b){if(!_0x33fa3b||_0x33fa3b[_0x620d('0x85')]!=0x0)return _0x419897;return db[_0x620d('0x35')][_0x620d('0x7e')]({'name':_0x419897[_0x620d('0x34')],'resourceId':_0x419897['id'],'type':_0x33fa3b[_0x620d('0x34')],'sectionId':_0x33fa3b['id']},{})[_0x620d('0x14')](function(){return _0x419897;});})[_0x620d('0x1d')](function(_0x3f1e63){logger[_0x620d('0x1a')](_0x620d('0x86'),_0x3f1e63);throw _0x3f1e63;});})[_0x620d('0x14')](respondWithResult(_0x1fdbf6,0xc9))['catch'](handleError(_0x1fdbf6,null));};exports[_0x620d('0x87')]=function(_0x301193,_0xf9d0f0){var _0x4acf3c=_0x301193[_0x620d('0x5f')];var _0x3fbaa2=[];if(_0x301193[_0x620d('0x2b')][_0x620d('0x32')]===_0x620d('0x84'))throw new Error(_0x620d('0x7f'));if(_[_0x620d('0x88')](_0x4acf3c,[_0x620d('0x32'),_0x620d('0x2b')])&&_0x301193[_0x620d('0x2b')][_0x620d('0x32')]!==_0x620d('0x29')){throw new Error(_0x620d('0x80'));}if(_[_0x620d('0x88')](_0x4acf3c,[_0x620d('0x32'),_0x620d('0x29')])&&_0x301193[_0x620d('0x2b')][_0x620d('0x32')]!==_0x620d('0x29')){throw new Error(_0x620d('0x89'));}return licenseUtil[_0x620d('0x81')](_0x4acf3c)[_0x620d('0x14')](function(){return validateUser(_0x4acf3c[0x0]);})[_0x620d('0x14')](function(){for(var _0x2a63ed=0x1;_0x2a63ed<_0x4acf3c['length'];_0x2a63ed++){var _0x4e1f61=_0x4acf3c[_0x2a63ed-0x1]['internal'];if(!_0x4acf3c[_0x2a63ed][_0x620d('0x64')])_0x4acf3c[_0x2a63ed]['internal']=_0x4e1f61+0x1;_0x3fbaa2[_0x620d('0x48')](validateUser(_0x4acf3c[_0x2a63ed]));}return BPromise[_0x620d('0x5e')](_0x3fbaa2);})[_0x620d('0x14')](function(){_0x3fbaa2=[];for(var _0x493887=0x0;_0x493887<_0x4acf3c[_0x620d('0x4c')];_0x493887++){_0x3fbaa2[_0x620d('0x48')](updateUser(_0x4acf3c[_0x493887]));}return BPromise[_0x620d('0x5e')](_0x3fbaa2);})[_0x620d('0x14')](function(){return BPromise[_0x620d('0x8a')](_0x4acf3c,function(_0x1ce8bb){return db[_0x620d('0x40')][_0x620d('0x7e')](_0x1ce8bb,{'include':[{'model':db[_0x620d('0x6f')],'as':_0x620d('0x6f')}]})['then'](function(_0x483695){_0x1ce8bb['id']=_0x483695['id'];return _0x1ce8bb;});});})[_0x620d('0x14')](function(_0x38bf40){if(_0x301193['body'][_0x620d('0x32')]===_0x620d('0x2b'))return _0x38bf40;if(_0x301193['user'][_0x620d('0x32')]!==_0x620d('0x2b'))return _0x38bf40;var _0x4e8620=_['some'](_0x38bf40,function(_0x2a298e){return _0x2a298e[_0x620d('0x32')]===_0x620d('0x84')||_0x2a298e[_0x620d('0x32')]==='telephone';});if(!_0x4e8620)return _0x38bf40;return db[_0x620d('0x8b')][_0x620d('0x49')]({'where':{'name':{'$or':[_0x620d('0x2c'),'Telephones']},'userProfileId':_0x301193[_0x620d('0x2b')][_0x620d('0x83')]},'raw':!![]})[_0x620d('0x14')](function(_0x91561c){if(_[_0x620d('0x8c')](_0x91561c)||!_['some'](_0x91561c,[_0x620d('0x85'),0x0]))return _0x38bf40;_0x3fbaa2=[];var _0x3cb666=_(_0x91561c)[_0x620d('0x39')](function(_0x22098d){if(_0x22098d[_0x620d('0x85')]===0x1)return;return _0x22098d[_0x620d('0x34')]===_0x620d('0x2c')?_0x620d('0x84'):_0x620d('0x2e');})[_0x620d('0x8d')]()[_0x620d('0x30')]();for(var _0x619298=0x0;_0x619298<_0x38bf40['length'];_0x619298++){if(!_['includes'](_0x3cb666,_0x38bf40[_0x619298][_0x620d('0x32')]))return;var _0x10efe1=_0x38bf40[_0x619298][_0x620d('0x32')]==='agent'?_0x620d('0x2c'):'Telephones';_0x3fbaa2[_0x620d('0x48')](db[_0x620d('0x35')]['create']({'name':_0x38bf40[_0x619298]['name'],'resourceId':_0x38bf40[_0x619298]['id'],'type':_0x10efe1,'sectionId':_[_0x620d('0x33')](_0x91561c,[_0x620d('0x34'),_0x10efe1])['id']},{}));}return BPromise[_0x620d('0x5e')](_0x3fbaa2);});})[_0x620d('0x14')](respondWithResult(_0xf9d0f0,0xc9))[_0x620d('0x1d')](handleError(_0xf9d0f0,null));};exports[_0x620d('0x8e')]=function(_0x206ece,_0x3d5538){if(_0x206ece[_0x620d('0x5f')]['id']){delete _0x206ece[_0x620d('0x5f')]['id'];}return db['User'][_0x620d('0x33')]({'where':{'id':_0x206ece[_0x620d('0x55')]['id']}})[_0x620d('0x14')](function(_0x456caa){if(!_0x456caa)return null;if(_0x456caa['id']===_0x206ece[_0x620d('0x2b')]['id']){if(!_0x206ece['body'][_0x620d('0x8f')]||!_0x206ece['body']['newPassword']){throw new db['Sequelize'][(_0x620d('0x90'))](_0x620d('0x91'));}if(!_0x456caa[_0x620d('0x92')](_0x206ece[_0x620d('0x5f')]['oldPassword'])){throw new db['Sequelize']['ValidationError'](_0x620d('0x93'));}if(_0x206ece[_0x620d('0x5f')][_0x620d('0x8f')]===_0x206ece[_0x620d('0x5f')][_0x620d('0x94')]){throw new db[(_0x620d('0x95'))]['ValidationError'](_0x620d('0x96'));}}else if(_0x206ece['user'][_0x620d('0x32')]===_0x620d('0x29')){if(!_0x206ece[_0x620d('0x5f')][_0x620d('0x94')]){throw new db[(_0x620d('0x95'))]['ValidationError'](_0x620d('0x97'));}}else if(_0x206ece['user'][_0x620d('0x32')]==='user'){if(!_0x206ece[_0x620d('0x5f')][_0x620d('0x94')]){throw new db['Sequelize'][(_0x620d('0x90'))](_0x620d('0x97'));}if(_0x456caa[_0x620d('0x32')]!==_0x620d('0x84')){throw new db[(_0x620d('0x95'))][(_0x620d('0x90'))](_0x620d('0x7f'));}}else{throw new db[(_0x620d('0x95'))][(_0x620d('0x90'))](_0x620d('0x7f'));}return _0x456caa;})['then'](handleEntityNotFound(_0x3d5538,null))[_0x620d('0x14')](function(_0x5cca2d){return db['Setting']['findOne']({'attributes':['id',_0x620d('0x98'),_0x620d('0x99'),'passwordHistoryLimit']})[_0x620d('0x14')](function(_0x5cae43){if(_0x5cae43[_0x620d('0x98')])authService[_0x620d('0x67')](_0x206ece['body'][_0x620d('0x94')]);if(!_0x5cae43[_0x620d('0x99')]||!_0x5cca2d['previousPasswords'])return _0x5cca2d;authService['validatePasswordHistory'](_0x206ece[_0x620d('0x5f')][_0x620d('0x94')],_0x5cca2d[_0x620d('0x9a')],_0x5cae43[_0x620d('0x9b')]);return _0x5cca2d;})[_0x620d('0x14')](saveUpdates({'password':_0x206ece[_0x620d('0x5f')]['newPassword'],'passwordResetAt':_0x206ece[_0x620d('0x2b')]['id']==_0x206ece[_0x620d('0x55')]['id']?moment():null,'previousPasswords':authService[_0x620d('0x9c')](_0x206ece[_0x620d('0x5f')][_0x620d('0x94')],_0x5cca2d[_0x620d('0x9a')])},null));})[_0x620d('0x14')](respondWithResult(_0x3d5538,null))['catch'](handleError(_0x3d5538,null));};exports['addQueues']=function(_0x3c99b1,_0x2229e3){var _0x522f6d=_0x3c99b1[_0x620d('0x5f')][_0x620d('0x9d')];return db[_0x620d('0x40')][_0x620d('0x33')]({'where':{'id':_0x3c99b1[_0x620d('0x55')]['id']},'attributes':['id',_0x620d('0x34'),_0x620d('0x32'),_0x620d('0x9e'),_0x620d('0x9f'),'voicePause','interface']})[_0x620d('0x14')](handleEntityNotFound(_0x2229e3,null))['then'](function(_0x1d9b13){if(_0x1d9b13){if(!utils[_0x620d('0xa0')](_0x522f6d)){throw new db['Sequelize'][(_0x620d('0x90'))]('Unknown\x20channel');}return _0x1d9b13[_0x620d('0xa1')+_[_0x620d('0xa2')](_0x522f6d[_0x620d('0xa3')]())+_0x620d('0xa4')](_0x3c99b1['body'][_0x620d('0x62')],{'penalty':_0x3c99b1['body'][_0x620d('0xa5')]||0x0})[_0x620d('0xa6')](function(_0x2502e0){for(var _0x404081=0x0;_0x404081<_0x3c99b1[_0x620d('0x5f')][_0x620d('0x62')][_0x620d('0x4c')];_0x404081+=0x1){var _0x1a6e47={'UserId':Number(_0x3c99b1[_0x620d('0x55')]['id'])};_0x1a6e47[_[_0x620d('0xa2')](_0x522f6d[_0x620d('0xa3')]())+_0x620d('0xa7')]=Number(_0x3c99b1[_0x620d('0x5f')][_0x620d('0x62')][_0x404081]);socket['emit'](_0x620d('0x2b')+_[_0x620d('0xa2')](_0x522f6d['toLowerCase']())+'Queue:save',_0x1a6e47);}return _0x2502e0;})[_0x620d('0x14')](function(){if(_0x522f6d===_0x620d('0xa8')){return db[_0x620d('0xa9')][_0x620d('0x49')]({'where':{'id':_0x3c99b1[_0x620d('0x5f')][_0x620d('0x62')]||[]},'raw':!![],'attributes':['id',_0x620d('0x34')]});}})['then'](function(_0x3203f4){var _0x4d8a10=_0x1d9b13[_0x620d('0xaa')]({'plain':!![]});var _0x2eb1eb=[];if(_0x522f6d===_0x620d('0xa8')&&_0x4d8a10['role']==='agent'&&_0x4d8a10[_0x620d('0x9e')]){for(var _0x781fb=0x0;_0x781fb<_0x3203f4[_0x620d('0x4c')];_0x781fb+=0x1){_0x2eb1eb[_0x620d('0x48')]({'membername':_0x4d8a10[_0x620d('0x34')],'UserId':_0x4d8a10['id'],'queue_name':_0x3203f4[_0x781fb][_0x620d('0x34')],'VoiceQueueId':_0x3203f4[_0x781fb]['id'],'interface':_[_0x620d('0x68')](_0x4d8a10[_0x620d('0xab')])?util[_0x620d('0xac')](_0x620d('0xad'),_0x4d8a10[_0x620d('0x34')]):_0x4d8a10['interface'],'paused':_0x4d8a10['voicePause']||![],'penalty':_0x3c99b1[_0x620d('0x5f')][_0x620d('0xa5')]||0x0});}return BPromise[_0x620d('0x8a')](_0x2eb1eb,function(_0x17febb){return db[_0x620d('0xae')][_0x620d('0xaf')](_0x17febb);});}return _0x1d9b13;});}})[_0x620d('0x14')](respondWithStatusCode(_0x2229e3,null))[_0x620d('0x1d')](handleError(_0x2229e3,null));};exports[_0x620d('0xb0')]=function(_0x4c0794,_0x3681ff){var _0x325185,_0x1c292e;return db[_0x620d('0x40')][_0x620d('0x33')]({'where':{'id':_0x4c0794['params']['id']},'attributes':['id',_0x620d('0x34'),'role']})[_0x620d('0x14')](handleEntityNotFound(_0x3681ff,null))[_0x620d('0x14')](function(_0x55cbef){if(_0x55cbef){_0x325185=_0x55cbef;if(!_0x4c0794['query']['channel']||!utils['isValidChannel'](_0x4c0794[_0x620d('0x41')][_0x620d('0x9d')])){throw new db[(_0x620d('0x95'))][(_0x620d('0x90'))](_0x620d('0xb1'));}return _0x55cbef[_0x620d('0xb2')+_[_0x620d('0xa2')](_0x4c0794[_0x620d('0x41')][_0x620d('0x9d')]['toLowerCase']())+'Queues'](_0x4c0794[_0x620d('0x41')][_0x620d('0x62')]);}})[_0x620d('0x14')](function(_0x9b492b){if(_[_0x620d('0xb3')](_0x4c0794['query'][_0x620d('0x62')])){for(var _0x396e5e=0x0;_0x396e5e<_0x4c0794['query'][_0x620d('0x62')]['length'];_0x396e5e+=0x1){_0x1c292e={'UserId':Number(_0x4c0794[_0x620d('0x55')]['id'])};_0x1c292e[_[_0x620d('0xa2')](_0x4c0794[_0x620d('0x41')]['channel']['toLowerCase']())+_0x620d('0xa7')]=Number(_0x4c0794[_0x620d('0x41')]['ids'][_0x396e5e]);socket[_0x620d('0xb4')]('user'+_[_0x620d('0xa2')](_0x4c0794[_0x620d('0x41')][_0x620d('0x9d')][_0x620d('0xa3')]())+_0x620d('0xb5'),_0x1c292e);}}else{_0x1c292e={'UserId':Number(_0x4c0794['params']['id'])};_0x1c292e[_[_0x620d('0xa2')](_0x4c0794[_0x620d('0x41')][_0x620d('0x9d')][_0x620d('0xa3')]())+_0x620d('0xa7')]=Number(_0x4c0794[_0x620d('0x41')][_0x620d('0x62')]);socket[_0x620d('0xb4')]('user'+_[_0x620d('0xa2')](_0x4c0794[_0x620d('0x41')][_0x620d('0x9d')]['toLowerCase']())+_0x620d('0xb5'),_0x1c292e);}return _0x9b492b;})['then'](function(){if(_0x4c0794[_0x620d('0x41')][_0x620d('0x9d')]==='voice'){return db['UserVoiceQueueRt'][_0x620d('0xb6')]({'where':{'UserId':_0x4c0794[_0x620d('0x55')]['id'],'VoiceQueueId':_0x4c0794['query'][_0x620d('0x62')]},'individualHooks':!![]})[_0x620d('0x14')](function(){return _0x325185;});}return _0x325185;})[_0x620d('0x14')](respondWithStatusCode(_0x3681ff,null))[_0x620d('0x1d')](handleError(_0x3681ff,null));};exports[_0x620d('0xb7')]=function(_0x24ee07,_0x19b69c){_0x24ee07[_0x620d('0x5f')][_0x620d('0xb8')]=_0x24ee07[_0x620d('0xb9')]['filename'];return db['User'][_0x620d('0x33')]({'where':{'id':_0x24ee07[_0x620d('0x55')]['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x19b69c,null))['then'](saveUpdates(_0x24ee07['body'],null))[_0x620d('0x14')](respondWithResult(_0x19b69c,null))[_0x620d('0x1d')](handleError(_0x19b69c,null));};exports[_0x620d('0xba')]=function(_0x41783e,_0x50a9cf){var _0x205f7a=path[_0x620d('0xbb')](config[_0x620d('0xbc')],_0x620d('0xbd'));return db[_0x620d('0x40')][_0x620d('0x33')]({'where':{'id':_0x41783e[_0x620d('0x55')]['id']},'attributes':['id',_0x620d('0xb8')],'raw':!![]})[_0x620d('0x14')](handleEntityNotFound(_0x50a9cf,null))[_0x620d('0x14')](function(_0x131cdb){if(_0x131cdb){if(_['isNil'](_0x131cdb[_0x620d('0xb8')])){return _0x50a9cf[_0x620d('0xbe')](_0x205f7a);}else{if(!fs[_0x620d('0xbf')](path[_0x620d('0xbb')](config['root'],'server/files/images/',_0x131cdb[_0x620d('0xb8')]))){return _0x50a9cf[_0x620d('0xbe')](_0x205f7a);}return _0x50a9cf[_0x620d('0xbe')](path[_0x620d('0xbb')](config[_0x620d('0xbc')],_0x620d('0xc0'),_0x131cdb[_0x620d('0xb8')]));}}})[_0x620d('0x1d')](handleError(_0x50a9cf,null));};exports[_0x620d('0xc1')]=function(_0x57b851,_0x5cda92){return db[_0x620d('0x40')][_0x620d('0x33')]({'where':{'id':_0x57b851[_0x620d('0x55')]['id']},'attributes':['id']})[_0x620d('0x14')](handleEntityNotFound(_0x5cda92,null))[_0x620d('0x14')](function(_0x17ecec){var _0x4a521d=[];values=_0x17ecec[_0x620d('0x4e')];_0x4a521d['push'](get_open_tabs('chat',_0x17ecec['dataValues']));_0x4a521d['push'](get_open_tabs('sms',_0x17ecec[_0x620d('0x4e')]));_0x4a521d['push'](get_open_tabs(_0x620d('0x52'),_0x17ecec[_0x620d('0x4e')]));_0x4a521d['push'](get_open_tabs(_0x620d('0x53'),_0x17ecec[_0x620d('0x4e')]));_0x4a521d['push'](get_open_tabs('fax',_0x17ecec[_0x620d('0x4e')]));_0x4a521d['push'](get_open_tabs(_0x620d('0x51'),_0x17ecec[_0x620d('0x4e')]));return BPromise[_0x620d('0x5e')](_0x4a521d);})[_0x620d('0x14')](function(_0xd1ab9f){if(_0xd1ab9f){var _0xdfc7f0=_[_0x620d('0x39')](values[_0x620d('0xc2')],function(_0x4d4843){return{'channel':'CHAT','id':_0x4d4843['id'],'createdAt':_0x4d4843[_0x620d('0xc3')]};});var _0x20aab6=_[_0x620d('0x39')](values[_0x620d('0xc4')],function(_0x516f3a){return{'channel':_0x620d('0xc5'),'id':_0x516f3a['id'],'createdAt':_0x516f3a[_0x620d('0xc3')]};});var _0x420eb1=_['map'](values[_0x620d('0xc6')],function(_0x5dd3c0){return{'channel':_0x620d('0xc7'),'id':_0x5dd3c0['id'],'createdAt':_0x5dd3c0[_0x620d('0xc3')]};});var _0x1ba6f4=_['map'](values[_0x620d('0xc8')],function(_0x1dbc87){return{'channel':_0x620d('0xc9'),'id':_0x1dbc87['id'],'createdAt':_0x1dbc87[_0x620d('0xc3')]};});var _0x1987e2=_[_0x620d('0x39')](values[_0x620d('0xca')],function(_0x4fdccf){return{'channel':_0x620d('0xcb'),'id':_0x4fdccf['id'],'createdAt':_0x4fdccf[_0x620d('0xc3')]};});var _0x19380c=_[_0x620d('0x39')](values['WhatsappOpenTabs'],function(_0x14b53d){return{'channel':_0x620d('0xcc'),'id':_0x14b53d['id'],'createdAt':_0x14b53d['createdAt']};});var _0x196303=_[_0x620d('0xcd')](_0xdfc7f0,_0x20aab6,_0x420eb1,_0x1ba6f4,_0x1987e2,_0x19380c);var _0x5c5e6d={'count':_0x196303['length'],'rows':_0x196303};return _0x5c5e6d;}else return null;})[_0x620d('0x14')](respondWithResult(_0x5cda92,null))[_0x620d('0x1d')](handleError(_0x5cda92,null));};exports[_0x620d('0xce')]=function(_0x54321a,_0x103d65){var _0x6caa9b={};var _0x7d2d8a={};var _0x272b0e;var _0x219bbb;return db[_0x620d('0x40')][_0x620d('0xcf')]({'where':{'id':_0x54321a[_0x620d('0x55')]['id']}})['then'](handleEntityNotFound(_0x103d65,null))['then'](function(_0xb4f5fb){if(_0xb4f5fb){_0x272b0e=_0xb4f5fb;_0x7d2d8a[_0x620d('0x56')]=_[_0x620d('0x58')](db[_0x620d('0xd0')][_0x620d('0x38')]);_0x7d2d8a['query']=_[_0x620d('0x58')](_0x54321a[_0x620d('0x41')]);_0x7d2d8a[_0x620d('0x5a')]=_[_0x620d('0x5b')](_0x7d2d8a[_0x620d('0x56')],_0x7d2d8a[_0x620d('0x41')]);_0x6caa9b['attributes']=_[_0x620d('0x5b')](_0x7d2d8a[_0x620d('0x56')],qs[_0x620d('0x5c')](_0x54321a[_0x620d('0x41')][_0x620d('0x5c')]));_0x6caa9b[_0x620d('0x47')]=_0x6caa9b[_0x620d('0x47')]['length']?_0x6caa9b['attributes']:_0x7d2d8a[_0x620d('0x56')];_0x6caa9b[_0x620d('0xd1')]=qs[_0x620d('0xd2')](_0x54321a[_0x620d('0x41')][_0x620d('0xd2')]);_0x6caa9b[_0x620d('0x3f')]=qs[_0x620d('0x5a')](_[_0x620d('0xd3')](_0x54321a[_0x620d('0x41')],_0x7d2d8a[_0x620d('0x5a')]));if(_0x54321a['query'][_0x620d('0x2f')]){_0x6caa9b[_0x620d('0x3f')]=_[_0x620d('0x5d')](_0x6caa9b[_0x620d('0x3f')],{'$or':_[_0x620d('0x39')](_0x6caa9b[_0x620d('0x47')],function(_0x436369){var _0x2c62fb={};_0x2c62fb[_0x436369]={'$like':'%'+_0x54321a[_0x620d('0x41')][_0x620d('0x2f')]+'%'};return _0x2c62fb;})});}_0x6caa9b=_['merge']({},_0x6caa9b,_0x54321a[_0x620d('0xd4')]);return _0x272b0e['getContacts'](_0x6caa9b);}})['then'](function(_0x57e009){if(_0x57e009){_0x219bbb=_0x57e009[_0x620d('0x4c')];if(_0x54321a[_0x620d('0x41')]['hasOwnProperty'](_0x620d('0x42'))){_0x6caa9b[_0x620d('0x43')]=[{'model':db['CmList'],'as':_0x620d('0xd5'),'required':![]},{'model':db[_0x620d('0xd6')],'as':_0x620d('0xd7'),'attributes':['id',_0x620d('0x34'),_0x620d('0xd8')],'where':_0x54321a['query'][_0x620d('0xd9')]?{'id':_0x54321a['query'][_0x620d('0xd9')]}:undefined,'required':_0x54321a[_0x620d('0x41')]['tag']?!![]:![]}];}if(!_0x54321a[_0x620d('0x41')]['hasOwnProperty']('nolimit')){_0x6caa9b['limit']=qs['limit'](_0x54321a[_0x620d('0x41')][_0x620d('0x24')]);_0x6caa9b['offset']=qs[_0x620d('0x22')](_0x54321a['query'][_0x620d('0x22')]);}return _0x272b0e['getContacts'](_0x6caa9b);}})[_0x620d('0x14')](function(_0x2dd5cf){if(_0x2dd5cf){return _0x2dd5cf?{'count':_0x219bbb,'rows':_0x2dd5cf}:null;}})[_0x620d('0x14')](respondWithResult(_0x103d65,null))['catch'](handleError(_0x103d65,null));};exports[_0x620d('0xda')]=function(_0x354da9,_0x11affd){var _0x40860c;var _0x433462={};var _0xb92018;return db[_0x620d('0x40')]['findOne']({'where':{'id':_0x354da9[_0x620d('0x55')]['id']},'attributes':['id',_0x620d('0x34'),_0x620d('0x32')]})['then'](handleEntityNotFound(_0x11affd,null))[_0x620d('0x14')](function(_0x21ffe6){if(!utils[_0x620d('0xa0')](_0x354da9['query']['channel'])){throw new db[(_0x620d('0x95'))]['ValidationError'](_0x620d('0xb1'));}_0x40860c=_0x21ffe6;var _0x287991={};_0x287991[_0x620d('0x56')]=_[_0x620d('0x58')](db[_['capitalize'](_0x354da9['query'][_0x620d('0x9d')])+'Queue']['rawAttributes']);_0x287991[_0x620d('0x41')]=_['keys'](_0x354da9[_0x620d('0x41')]);_0x287991[_0x620d('0x5a')]=_['intersection'](_0x287991[_0x620d('0x56')],_0x287991[_0x620d('0x41')]);_0x433462[_0x620d('0x47')]=_[_0x620d('0x5b')](_0x287991[_0x620d('0x56')],qs[_0x620d('0x5c')](_0x354da9[_0x620d('0x41')][_0x620d('0x5c')]));_0x433462[_0x620d('0x47')]=_0x433462[_0x620d('0x47')][_0x620d('0x4c')]?_0x433462[_0x620d('0x47')]:_0x287991[_0x620d('0x56')];_0x433462[_0x620d('0xd1')]=qs[_0x620d('0xd2')](_0x354da9['query'][_0x620d('0xd2')]);_0x433462[_0x620d('0x3f')]=qs[_0x620d('0x5a')](_['pick'](_0x354da9[_0x620d('0x41')],_0x287991[_0x620d('0x5a')]));if(_0x354da9['query'][_0x620d('0x2f')]){_0x433462['where']=_[_0x620d('0x5d')](_0x433462[_0x620d('0x3f')],{'$or':_[_0x620d('0x39')](_0x433462[_0x620d('0x47')],function(_0x2f1411){var _0x42e8e8={};_0x42e8e8[_0x2f1411]={'$like':'%'+_0x354da9['query']['filter']+'%'};return _0x42e8e8;})});}_0x433462=_[_0x620d('0x5d')]({},_0x433462,_0x354da9[_0x620d('0xd4')]);switch(_0x40860c[_0x620d('0x32')]){case _0x620d('0x29'):return db[_[_0x620d('0xa2')](_0x354da9[_0x620d('0x41')][_0x620d('0x9d')])+_0x620d('0xdb')][_0x620d('0x49')](_0x433462);case _0x620d('0x2b'):case'agent':return _0x40860c[_0x620d('0xaa')+_['capitalize'](_0x354da9[_0x620d('0x41')][_0x620d('0x9d')])+_0x620d('0xa4')](_0x433462);default:throw new db[(_0x620d('0x95'))][(_0x620d('0x90'))]('Unknown\x20role');}})[_0x620d('0x14')](function(_0x2b15c8){_0xb92018=_0x2b15c8[_0x620d('0x4c')];if(!_0x354da9[_0x620d('0x41')][_0x620d('0xdc')]('nolimit')){_0x433462[_0x620d('0x24')]=qs['limit'](_0x354da9['query']['limit']);_0x433462['offset']=qs[_0x620d('0x22')](_0x354da9[_0x620d('0x41')][_0x620d('0x22')]);}switch(_0x40860c[_0x620d('0x32')]){case _0x620d('0x29'):return db[_['capitalize'](_0x354da9[_0x620d('0x41')][_0x620d('0x9d')])+_0x620d('0xdb')][_0x620d('0x49')](_0x433462);case _0x620d('0x2b'):case _0x620d('0x84'):return _0x40860c['get'+_[_0x620d('0xa2')](_0x354da9[_0x620d('0x41')]['channel'])+_0x620d('0xa4')](_0x433462);}})[_0x620d('0x14')](function(_0x987f3a){return{'count':_0xb92018,'rows':_0x987f3a};})[_0x620d('0x14')](respondWithResult(_0x11affd,null))[_0x620d('0x1d')](handleError(_0x11affd,null));};exports['getVoiceQueuesRt']=function(_0x4b9ad3,_0x55b429){var _0x280cd0={};var _0x63164c={};var _0x4b75de;var _0x44e94d;return db[_0x620d('0x40')]['findOne']({'where':{'id':_0x4b9ad3[_0x620d('0x55')]['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x55b429,null))[_0x620d('0x14')](function(_0x3ec142){if(_0x3ec142){_0x4b75de=_0x3ec142;_0x63164c[_0x620d('0x56')]=_[_0x620d('0x58')](db[_0x620d('0xae')][_0x620d('0x38')]);_0x63164c['query']=_[_0x620d('0x58')](_0x4b9ad3[_0x620d('0x41')]);_0x63164c[_0x620d('0x5a')]=_[_0x620d('0x5b')](_0x63164c['model'],_0x63164c[_0x620d('0x41')]);_0x280cd0['attributes']=_[_0x620d('0x5b')](_0x63164c['model'],qs[_0x620d('0x5c')](_0x4b9ad3[_0x620d('0x41')][_0x620d('0x5c')]));_0x280cd0[_0x620d('0x47')]=_0x280cd0[_0x620d('0x47')][_0x620d('0x4c')]?_0x280cd0[_0x620d('0x47')]:_0x63164c[_0x620d('0x56')];_0x280cd0[_0x620d('0xd1')]=qs[_0x620d('0xd2')](_0x4b9ad3[_0x620d('0x41')]['sort']);_0x280cd0[_0x620d('0x3f')]=qs[_0x620d('0x5a')](_['pick'](_0x4b9ad3[_0x620d('0x41')],_0x63164c['filters']));if(_0x4b9ad3['query']['filter']){_0x280cd0[_0x620d('0x3f')]=_[_0x620d('0x5d')](_0x280cd0[_0x620d('0x3f')],{'$or':_[_0x620d('0x39')](_0x280cd0[_0x620d('0x47')],function(_0x18aacf){var _0x7c16a2={};_0x7c16a2[_0x18aacf]={'$like':'%'+_0x4b9ad3[_0x620d('0x41')][_0x620d('0x2f')]+'%'};return _0x7c16a2;})});}_0x280cd0=_[_0x620d('0x5d')]({},_0x280cd0,_0x4b9ad3['options']);return _0x4b75de[_0x620d('0xdd')](_0x280cd0);}})[_0x620d('0x14')](function(_0x59e120){if(_0x59e120){_0x44e94d=_0x59e120[_0x620d('0x4c')];if(!_0x4b9ad3[_0x620d('0x41')][_0x620d('0xdc')](_0x620d('0xde'))){_0x280cd0[_0x620d('0x24')]=qs[_0x620d('0x24')](_0x4b9ad3['query'][_0x620d('0x24')]);_0x280cd0[_0x620d('0x22')]=qs[_0x620d('0x22')](_0x4b9ad3[_0x620d('0x41')][_0x620d('0x22')]);}return _0x4b75de[_0x620d('0xdd')](_0x280cd0);}})['then'](function(_0x422aa6){if(_0x422aa6){return _0x422aa6?{'count':_0x44e94d,'rows':_0x422aa6}:null;}})[_0x620d('0x14')](respondWithResult(_0x55b429,null))[_0x620d('0x1d')](handleError(_0x55b429,null));};exports['getGroups']=function(_0x3f728f,_0x38fd24){var _0x174f14={};var _0x23a184={};var _0x1f4101;var _0x56b3f3;return db[_0x620d('0x40')][_0x620d('0xcf')]({'where':{'id':_0x3f728f[_0x620d('0x55')]['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x38fd24,null))['then'](function(_0x3c4228){if(_0x3c4228){_0x1f4101=_0x3c4228;_0x23a184[_0x620d('0x56')]=_[_0x620d('0x58')](db['ChatGroup'][_0x620d('0x38')]);_0x23a184[_0x620d('0x41')]=_[_0x620d('0x58')](_0x3f728f[_0x620d('0x41')]);_0x23a184['filters']=_['intersection'](_0x23a184[_0x620d('0x56')],_0x23a184['query']);_0x174f14[_0x620d('0x47')]=_[_0x620d('0x5b')](_0x23a184[_0x620d('0x56')],qs[_0x620d('0x5c')](_0x3f728f[_0x620d('0x41')][_0x620d('0x5c')]));_0x174f14[_0x620d('0x47')]=_0x174f14['attributes'][_0x620d('0x4c')]?_0x174f14[_0x620d('0x47')]:_0x23a184[_0x620d('0x56')];_0x174f14[_0x620d('0xd1')]=qs[_0x620d('0xd2')](_0x3f728f[_0x620d('0x41')][_0x620d('0xd2')]);_0x174f14['where']=qs[_0x620d('0x5a')](_[_0x620d('0xd3')](_0x3f728f[_0x620d('0x41')],_0x23a184['filters']));if(_0x3f728f[_0x620d('0x41')][_0x620d('0x2f')]){_0x174f14[_0x620d('0x3f')]=_[_0x620d('0x5d')](_0x174f14[_0x620d('0x3f')],{'$or':_[_0x620d('0x39')](_0x174f14[_0x620d('0x47')],function(_0x2dda31){var _0x60085b={};_0x60085b[_0x2dda31]={'$like':'%'+_0x3f728f['query'][_0x620d('0x2f')]+'%'};return _0x60085b;})});}_0x174f14=_[_0x620d('0x5d')]({},_0x174f14,_0x3f728f['options']);return _0x1f4101[_0x620d('0xdf')](_0x174f14);}})[_0x620d('0x14')](function(_0x18ed51){if(_0x18ed51){_0x56b3f3=_0x18ed51['length'];if(!_0x3f728f[_0x620d('0x41')]['hasOwnProperty'](_0x620d('0xde'))){_0x174f14[_0x620d('0x24')]=qs['limit'](_0x3f728f[_0x620d('0x41')]['limit']);_0x174f14[_0x620d('0x22')]=qs[_0x620d('0x22')](_0x3f728f[_0x620d('0x41')][_0x620d('0x22')]);}return _0x1f4101[_0x620d('0xdf')](_0x174f14);}})[_0x620d('0x14')](function(_0x1a7be3){if(_0x1a7be3){return _0x1a7be3?{'count':_0x56b3f3,'rows':_0x1a7be3}:null;}})[_0x620d('0x14')](respondWithResult(_0x38fd24,null))[_0x620d('0x1d')](handleError(_0x38fd24,null));};exports[_0x620d('0xe0')]=function(_0x376021,_0x15476c){var _0x2b1419={'raw':!![],'where':{}};var _0x2e2d35={};var _0x579cb4={'count':0x0,'rows':[]};return db['User'][_0x620d('0xcf')]({'where':{'id':_0x376021[_0x620d('0x55')]['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x15476c,null))[_0x620d('0x14')](function(_0x5c205f){if(_0x5c205f){_0x2e2d35[_0x620d('0x56')]=_[_0x620d('0x58')](db['VoiceRecording'][_0x620d('0x38')]);_0x2e2d35[_0x620d('0x41')]=_[_0x620d('0x58')](_0x376021[_0x620d('0x41')]);_0x2e2d35[_0x620d('0x5a')]=_['intersection'](_0x2e2d35['model'],_0x2e2d35[_0x620d('0x41')]);_0x2b1419['attributes']=_[_0x620d('0x5b')](_0x2e2d35[_0x620d('0x56')],qs[_0x620d('0x5c')](_0x376021['query'][_0x620d('0x5c')]));_0x2b1419[_0x620d('0x47')]=_0x2b1419[_0x620d('0x47')][_0x620d('0x4c')]?_0x2b1419[_0x620d('0x47')]:_0x2e2d35['model'];if(!_0x376021[_0x620d('0x41')][_0x620d('0xdc')](_0x620d('0xde'))){_0x2b1419['limit']=qs[_0x620d('0x24')](_0x376021[_0x620d('0x41')][_0x620d('0x24')]);_0x2b1419[_0x620d('0x22')]=qs[_0x620d('0x22')](_0x376021[_0x620d('0x41')][_0x620d('0x22')]);}_0x2b1419[_0x620d('0xd1')]=qs[_0x620d('0xd2')](_0x376021[_0x620d('0x41')][_0x620d('0xd2')]);_0x2b1419[_0x620d('0x3f')]=qs['filters'](_[_0x620d('0xd3')](_0x376021[_0x620d('0x41')],_0x2e2d35['filters']));_0x2b1419[_0x620d('0x3f')]['UserId']=_0x5c205f['id'];if(_0x376021[_0x620d('0x41')][_0x620d('0x2f')]){_0x2b1419[_0x620d('0x3f')]=_[_0x620d('0x5d')](_0x2b1419[_0x620d('0x3f')],{'$or':_[_0x620d('0x39')](_0x2b1419[_0x620d('0x47')],function(_0x1c3564){var _0x51d50c={};_0x51d50c[_0x1c3564]={'$like':'%'+_0x376021['query'][_0x620d('0x2f')]+'%'};return _0x51d50c;})});}_0x2b1419=_['merge']({},_0x2b1419,_0x376021[_0x620d('0xd4')]);return db[_0x620d('0xe1')][_0x620d('0x25')]({'where':_0x2b1419[_0x620d('0x3f')]})[_0x620d('0x14')](function(_0x396faf){_0x579cb4[_0x620d('0x25')]=_0x396faf;if(_0x376021[_0x620d('0x41')]['includeAll']){_0x2b1419['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x620d('0x49')](_0x2b1419);})['then'](function(_0x405647){_0x579cb4[_0x620d('0x4b')]=_0x405647;return _0x579cb4;});}})[_0x620d('0x14')](respondWithFilteredResult(_0x15476c,_0x2b1419))[_0x620d('0x1d')](handleError(_0x15476c,null));};exports['getScreenRecordings']=function(_0x59029c,_0x7bbfc4){var _0x1f3f82={'raw':!![],'where':{}};var _0x5549ee={};var _0xfa6208={'count':0x0,'rows':[]};return db['User'][_0x620d('0xcf')]({'where':{'id':_0x59029c['params']['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x7bbfc4,null))['then'](function(_0x2ffa8b){if(_0x2ffa8b){_0x5549ee[_0x620d('0x56')]=_[_0x620d('0x58')](db[_0x620d('0xe2')]['rawAttributes']);_0x5549ee[_0x620d('0x41')]=_[_0x620d('0x58')](_0x59029c[_0x620d('0x41')]);_0x5549ee[_0x620d('0x5a')]=_['intersection'](_0x5549ee[_0x620d('0x56')],_0x5549ee[_0x620d('0x41')]);_0x1f3f82[_0x620d('0x47')]=_[_0x620d('0x5b')](_0x5549ee[_0x620d('0x56')],qs['fields'](_0x59029c[_0x620d('0x41')][_0x620d('0x5c')]));_0x1f3f82[_0x620d('0x47')]=_0x1f3f82[_0x620d('0x47')][_0x620d('0x4c')]?_0x1f3f82[_0x620d('0x47')]:_0x5549ee[_0x620d('0x56')];if(!_0x59029c[_0x620d('0x41')][_0x620d('0xdc')](_0x620d('0xde'))){_0x1f3f82[_0x620d('0x24')]=qs['limit'](_0x59029c[_0x620d('0x41')][_0x620d('0x24')]);_0x1f3f82[_0x620d('0x22')]=qs[_0x620d('0x22')](_0x59029c[_0x620d('0x41')][_0x620d('0x22')]);}_0x1f3f82['order']=qs[_0x620d('0xd2')](_0x59029c['query'][_0x620d('0xd2')]);_0x1f3f82[_0x620d('0x3f')]=qs[_0x620d('0x5a')](_['pick'](_0x59029c[_0x620d('0x41')],_0x5549ee[_0x620d('0x5a')]));_0x1f3f82['where'][_0x620d('0xe3')]=_0x2ffa8b['id'];if(_0x59029c[_0x620d('0x41')][_0x620d('0x2f')]){_0x1f3f82[_0x620d('0x3f')]=_[_0x620d('0x5d')](_0x1f3f82[_0x620d('0x3f')],{'$or':_['map'](_0x1f3f82[_0x620d('0x47')],function(_0x2361ed){var _0x44c5b6={};_0x44c5b6[_0x2361ed]={'$like':'%'+_0x59029c[_0x620d('0x41')][_0x620d('0x2f')]+'%'};return _0x44c5b6;})});}_0x1f3f82=_[_0x620d('0x5d')]({},_0x1f3f82,_0x59029c['options']);return db[_0x620d('0xe2')]['count']({'where':_0x1f3f82['where']})[_0x620d('0x14')](function(_0x53e7c0){_0xfa6208[_0x620d('0x25')]=_0x53e7c0;if(_0x59029c['query']['includeAll']){_0x1f3f82[_0x620d('0x43')]=[{'all':!![]}];}return db[_0x620d('0xe2')]['findAll'](_0x1f3f82);})[_0x620d('0x14')](function(_0xa8a3fb){_0xfa6208[_0x620d('0x4b')]=_0xa8a3fb;return _0xfa6208;});}})[_0x620d('0x14')](respondWithFilteredResult(_0x7bbfc4,_0x1f3f82))[_0x620d('0x1d')](handleError(_0x7bbfc4,null));};exports['getChatInteractions']=function(_0x1c9495,_0x2a1d88){var _0x369618={};var _0x26a9a0={};var _0x30ac05;var _0x452e0a;return db[_0x620d('0x40')][_0x620d('0xcf')]({'where':{'id':_0x1c9495['params']['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x2a1d88,null))['then'](function(_0x4593d4){if(_0x4593d4){_0x30ac05=_0x4593d4;_0x26a9a0[_0x620d('0x56')]=_['keys'](db[_0x620d('0xe4')][_0x620d('0x38')]);_0x26a9a0[_0x620d('0x41')]=_[_0x620d('0x58')](_0x1c9495['query']);_0x26a9a0[_0x620d('0x5a')]=_['intersection'](_0x26a9a0[_0x620d('0x56')],_0x26a9a0[_0x620d('0x41')]);_0x369618[_0x620d('0x47')]=_['intersection'](_0x26a9a0['model'],qs[_0x620d('0x5c')](_0x1c9495['query'][_0x620d('0x5c')]));_0x369618[_0x620d('0x47')]=_0x369618[_0x620d('0x47')][_0x620d('0x4c')]?_0x369618['attributes']:_0x26a9a0[_0x620d('0x56')];_0x369618[_0x620d('0xd1')]=qs[_0x620d('0xd2')](_0x1c9495[_0x620d('0x41')][_0x620d('0xd2')]);_0x369618[_0x620d('0x3f')]=qs['filters'](_[_0x620d('0xd3')](_0x1c9495['query'],_0x26a9a0[_0x620d('0x5a')]));if(_0x1c9495[_0x620d('0x41')][_0x620d('0x2f')]){_0x369618[_0x620d('0x3f')]=_[_0x620d('0x5d')](_0x369618[_0x620d('0x3f')],{'$or':_['map'](_0x369618[_0x620d('0x47')],function(_0x1bec66){var _0x1a32ff={};_0x1a32ff[_0x1bec66]={'$like':'%'+_0x1c9495[_0x620d('0x41')][_0x620d('0x2f')]+'%'};return _0x1a32ff;})});}_0x369618=_[_0x620d('0x5d')]({},_0x369618,_0x1c9495[_0x620d('0xd4')]);return _0x30ac05[_0x620d('0xe5')](_0x369618);}})[_0x620d('0x14')](function(_0x35bda0){if(_0x35bda0){_0x452e0a=_0x35bda0[_0x620d('0x4c')];if(!_0x1c9495[_0x620d('0x41')][_0x620d('0xdc')](_0x620d('0xde'))){_0x369618[_0x620d('0x24')]=qs['limit'](_0x1c9495[_0x620d('0x41')][_0x620d('0x24')]);_0x369618[_0x620d('0x22')]=qs[_0x620d('0x22')](_0x1c9495[_0x620d('0x41')][_0x620d('0x22')]);}return _0x30ac05[_0x620d('0xe5')](_0x369618);}})['then'](function(_0x367c98){if(_0x367c98){return _0x367c98?{'count':_0x452e0a,'rows':_0x367c98}:null;}})[_0x620d('0x14')](respondWithResult(_0x2a1d88,null))[_0x620d('0x1d')](handleError(_0x2a1d88,null));};exports['getOpenchannelInteractions']=function(_0x3b6de5,_0x1bcc45){var _0x54e681={};var _0x2b5109={};var _0x49de1e;var _0x3a48e1;return db[_0x620d('0x40')][_0x620d('0xcf')]({'where':{'id':_0x3b6de5[_0x620d('0x55')]['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x1bcc45,null))[_0x620d('0x14')](function(_0x1bb08e){if(_0x1bb08e){_0x49de1e=_0x1bb08e;_0x2b5109[_0x620d('0x56')]=_[_0x620d('0x58')](db[_0x620d('0xe6')][_0x620d('0x38')]);_0x2b5109[_0x620d('0x41')]=_[_0x620d('0x58')](_0x3b6de5[_0x620d('0x41')]);_0x2b5109[_0x620d('0x5a')]=_['intersection'](_0x2b5109[_0x620d('0x56')],_0x2b5109[_0x620d('0x41')]);_0x54e681[_0x620d('0x47')]=_[_0x620d('0x5b')](_0x2b5109['model'],qs[_0x620d('0x5c')](_0x3b6de5[_0x620d('0x41')]['fields']));_0x54e681['attributes']=_0x54e681[_0x620d('0x47')][_0x620d('0x4c')]?_0x54e681[_0x620d('0x47')]:_0x2b5109[_0x620d('0x56')];_0x54e681[_0x620d('0xd1')]=qs[_0x620d('0xd2')](_0x3b6de5['query'][_0x620d('0xd2')]);_0x54e681[_0x620d('0x3f')]=qs['filters'](_[_0x620d('0xd3')](_0x3b6de5[_0x620d('0x41')],_0x2b5109[_0x620d('0x5a')]));if(_0x3b6de5[_0x620d('0x41')]['filter']){_0x54e681[_0x620d('0x3f')]=_['merge'](_0x54e681[_0x620d('0x3f')],{'$or':_[_0x620d('0x39')](_0x54e681[_0x620d('0x47')],function(_0x40dee4){var _0x40dd02={};_0x40dd02[_0x40dee4]={'$like':'%'+_0x3b6de5[_0x620d('0x41')]['filter']+'%'};return _0x40dd02;})});}_0x54e681=_[_0x620d('0x5d')]({},_0x54e681,_0x3b6de5['options']);return _0x49de1e[_0x620d('0xe7')](_0x54e681);}})[_0x620d('0x14')](function(_0x7325a8){if(_0x7325a8){_0x3a48e1=_0x7325a8['length'];if(!_0x3b6de5[_0x620d('0x41')][_0x620d('0xdc')](_0x620d('0xde'))){_0x54e681[_0x620d('0x24')]=qs[_0x620d('0x24')](_0x3b6de5[_0x620d('0x41')][_0x620d('0x24')]);_0x54e681[_0x620d('0x22')]=qs[_0x620d('0x22')](_0x3b6de5['query'][_0x620d('0x22')]);}return _0x49de1e[_0x620d('0xe7')](_0x54e681);}})[_0x620d('0x14')](function(_0x4e0e7b){if(_0x4e0e7b){return _0x4e0e7b?{'count':_0x3a48e1,'rows':_0x4e0e7b}:null;}})['then'](respondWithResult(_0x1bcc45,null))[_0x620d('0x1d')](handleError(_0x1bcc45,null));};exports[_0x620d('0xe8')]=function(_0x2ae08f,_0x52b875){var _0x4dc21c={'raw':!![],'where':{}};var _0x42e3ed={};var _0x4afd7f={'count':0x0,'rows':[]};return db[_0x620d('0x40')]['findOne']({'where':{'id':_0x2ae08f['params']['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x52b875,null))['then'](function(_0x36ede8){if(_0x36ede8){_0x42e3ed['model']=_[_0x620d('0x58')](db[_0x620d('0xe9')][_0x620d('0x38')]);_0x42e3ed[_0x620d('0x41')]=_['keys'](_0x2ae08f[_0x620d('0x41')]);_0x42e3ed[_0x620d('0x5a')]=_[_0x620d('0x5b')](_0x42e3ed[_0x620d('0x56')],_0x42e3ed['query']);_0x4dc21c[_0x620d('0x47')]=_[_0x620d('0x5b')](_0x42e3ed['model'],qs[_0x620d('0x5c')](_0x2ae08f[_0x620d('0x41')]['fields']));_0x4dc21c['attributes']=_0x4dc21c['attributes']['length']?_0x4dc21c['attributes']:_0x42e3ed[_0x620d('0x56')];if(!_0x2ae08f[_0x620d('0x41')][_0x620d('0xdc')](_0x620d('0xde'))){_0x4dc21c[_0x620d('0x24')]=qs[_0x620d('0x24')](_0x2ae08f[_0x620d('0x41')]['limit']);_0x4dc21c[_0x620d('0x22')]=qs[_0x620d('0x22')](_0x2ae08f[_0x620d('0x41')][_0x620d('0x22')]);}_0x4dc21c[_0x620d('0xd1')]=qs[_0x620d('0xd2')](_0x2ae08f[_0x620d('0x41')][_0x620d('0xd2')]);_0x4dc21c['where']=qs[_0x620d('0x5a')](_['pick'](_0x2ae08f[_0x620d('0x41')],_0x42e3ed[_0x620d('0x5a')]));_0x4dc21c['where'][_0x620d('0xe3')]=_0x36ede8['id'];if(_0x2ae08f[_0x620d('0x41')]['filter']){_0x4dc21c[_0x620d('0x3f')]=_[_0x620d('0x5d')](_0x4dc21c[_0x620d('0x3f')],{'$or':_[_0x620d('0x39')](_0x4dc21c[_0x620d('0x47')],function(_0x435335){var _0x4de279={};_0x4de279[_0x435335]={'$like':'%'+_0x2ae08f[_0x620d('0x41')][_0x620d('0x2f')]+'%'};return _0x4de279;})});}_0x4dc21c=_[_0x620d('0x5d')]({},_0x4dc21c,_0x2ae08f[_0x620d('0xd4')]);return db[_0x620d('0xe9')][_0x620d('0x25')]({'where':_0x4dc21c[_0x620d('0x3f')]})[_0x620d('0x14')](function(_0x88df9d){_0x4afd7f[_0x620d('0x25')]=_0x88df9d;if(_0x2ae08f[_0x620d('0x41')][_0x620d('0x42')]){_0x4dc21c[_0x620d('0x43')]=[{'all':!![]}];}return db[_0x620d('0xe9')]['findAll'](_0x4dc21c);})[_0x620d('0x14')](function(_0x177c92){_0x4afd7f[_0x620d('0x4b')]=_0x177c92;return _0x4afd7f;});}})[_0x620d('0x14')](respondWithFilteredResult(_0x52b875,_0x4dc21c))[_0x620d('0x1d')](handleError(_0x52b875,null));};exports['getSmsInteractions']=function(_0x3f521f,_0x46415e){var _0x276e38={};var _0x350737={};var _0x3c6c4;var _0x22837e;return db[_0x620d('0x40')][_0x620d('0xcf')]({'where':{'id':_0x3f521f[_0x620d('0x55')]['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x46415e,null))[_0x620d('0x14')](function(_0x370eda){if(_0x370eda){_0x3c6c4=_0x370eda;_0x350737['model']=_['keys'](db[_0x620d('0xea')][_0x620d('0x38')]);_0x350737['query']=_[_0x620d('0x58')](_0x3f521f[_0x620d('0x41')]);_0x350737[_0x620d('0x5a')]=_[_0x620d('0x5b')](_0x350737[_0x620d('0x56')],_0x350737[_0x620d('0x41')]);_0x276e38[_0x620d('0x47')]=_[_0x620d('0x5b')](_0x350737['model'],qs[_0x620d('0x5c')](_0x3f521f['query'][_0x620d('0x5c')]));_0x276e38[_0x620d('0x47')]=_0x276e38['attributes'][_0x620d('0x4c')]?_0x276e38[_0x620d('0x47')]:_0x350737[_0x620d('0x56')];_0x276e38['order']=qs[_0x620d('0xd2')](_0x3f521f[_0x620d('0x41')][_0x620d('0xd2')]);_0x276e38[_0x620d('0x3f')]=qs[_0x620d('0x5a')](_[_0x620d('0xd3')](_0x3f521f[_0x620d('0x41')],_0x350737['filters']));if(_0x3f521f['query'][_0x620d('0x2f')]){_0x276e38[_0x620d('0x3f')]=_[_0x620d('0x5d')](_0x276e38['where'],{'$or':_[_0x620d('0x39')](_0x276e38['attributes'],function(_0x521d3a){var _0xb1d00a={};_0xb1d00a[_0x521d3a]={'$like':'%'+_0x3f521f[_0x620d('0x41')][_0x620d('0x2f')]+'%'};return _0xb1d00a;})});}_0x276e38=_[_0x620d('0x5d')]({},_0x276e38,_0x3f521f[_0x620d('0xd4')]);return _0x3c6c4[_0x620d('0xeb')](_0x276e38);}})['then'](function(_0x3675e6){if(_0x3675e6){_0x22837e=_0x3675e6[_0x620d('0x4c')];if(!_0x3f521f[_0x620d('0x41')][_0x620d('0xdc')](_0x620d('0xde'))){_0x276e38[_0x620d('0x24')]=qs['limit'](_0x3f521f[_0x620d('0x41')][_0x620d('0x24')]);_0x276e38[_0x620d('0x22')]=qs['offset'](_0x3f521f['query']['offset']);}return _0x3c6c4[_0x620d('0xeb')](_0x276e38);}})[_0x620d('0x14')](function(_0x20fa9a){if(_0x20fa9a){return _0x20fa9a?{'count':_0x22837e,'rows':_0x20fa9a}:null;}})[_0x620d('0x14')](respondWithResult(_0x46415e,null))[_0x620d('0x1d')](handleError(_0x46415e,null));};exports[_0x620d('0xec')]=function(_0x257482,_0x5c57a3){var _0x26d42e={};var _0x3796e5={};var _0x1eff60;var _0x8316fc;return db[_0x620d('0x40')][_0x620d('0xcf')]({'where':{'id':_0x257482[_0x620d('0x55')]['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x5c57a3,null))[_0x620d('0x14')](function(_0x4d0610){if(_0x4d0610){_0x1eff60=_0x4d0610;_0x3796e5[_0x620d('0x56')]=_['keys'](db[_0x620d('0xed')][_0x620d('0x38')]);_0x3796e5['query']=_['keys'](_0x257482['query']);_0x3796e5['filters']=_[_0x620d('0x5b')](_0x3796e5['model'],_0x3796e5[_0x620d('0x41')]);_0x26d42e[_0x620d('0x47')]=_[_0x620d('0x5b')](_0x3796e5[_0x620d('0x56')],qs[_0x620d('0x5c')](_0x257482[_0x620d('0x41')]['fields']));_0x26d42e[_0x620d('0x47')]=_0x26d42e[_0x620d('0x47')][_0x620d('0x4c')]?_0x26d42e[_0x620d('0x47')]:_0x3796e5[_0x620d('0x56')];_0x26d42e['order']=qs['sort'](_0x257482['query'][_0x620d('0xd2')]);_0x26d42e['where']=qs[_0x620d('0x5a')](_['pick'](_0x257482[_0x620d('0x41')],_0x3796e5[_0x620d('0x5a')]));if(_0x257482[_0x620d('0x41')][_0x620d('0x2f')]){_0x26d42e[_0x620d('0x3f')]=_['merge'](_0x26d42e['where'],{'$or':_[_0x620d('0x39')](_0x26d42e[_0x620d('0x47')],function(_0x5a85dd){var _0x277e1c={};_0x277e1c[_0x5a85dd]={'$like':'%'+_0x257482[_0x620d('0x41')][_0x620d('0x2f')]+'%'};return _0x277e1c;})});}_0x26d42e=_['merge']({},_0x26d42e,_0x257482[_0x620d('0xd4')]);return _0x1eff60[_0x620d('0xec')](_0x26d42e);}})[_0x620d('0x14')](function(_0x4aaeee){if(_0x4aaeee){_0x8316fc=_0x4aaeee[_0x620d('0x4c')];if(!_0x257482['query'][_0x620d('0xdc')]('nolimit')){_0x26d42e[_0x620d('0x24')]=qs[_0x620d('0x24')](_0x257482[_0x620d('0x41')]['limit']);_0x26d42e[_0x620d('0x22')]=qs[_0x620d('0x22')](_0x257482['query'][_0x620d('0x22')]);}return _0x1eff60[_0x620d('0xec')](_0x26d42e);}})[_0x620d('0x14')](function(_0x56223c){if(_0x56223c){return _0x56223c?{'count':_0x8316fc,'rows':_0x56223c}:null;}})[_0x620d('0x14')](respondWithResult(_0x5c57a3,null))['catch'](handleError(_0x5c57a3,null));};exports['getWhatsappInteractions']=function(_0x24d683,_0x244bc7){var _0x3a9966={};var _0xfa570={};var _0x1d3a42;var _0x397099;return db[_0x620d('0x40')][_0x620d('0xcf')]({'where':{'id':_0x24d683[_0x620d('0x55')]['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x244bc7,null))['then'](function(_0x5a01b6){if(_0x5a01b6){_0x1d3a42=_0x5a01b6;_0xfa570[_0x620d('0x56')]=_[_0x620d('0x58')](db[_0x620d('0xee')][_0x620d('0x38')]);_0xfa570[_0x620d('0x41')]=_[_0x620d('0x58')](_0x24d683[_0x620d('0x41')]);_0xfa570['filters']=_[_0x620d('0x5b')](_0xfa570[_0x620d('0x56')],_0xfa570['query']);_0x3a9966[_0x620d('0x47')]=_['intersection'](_0xfa570[_0x620d('0x56')],qs['fields'](_0x24d683[_0x620d('0x41')]['fields']));_0x3a9966[_0x620d('0x47')]=_0x3a9966['attributes']['length']?_0x3a9966[_0x620d('0x47')]:_0xfa570[_0x620d('0x56')];_0x3a9966[_0x620d('0xd1')]=qs[_0x620d('0xd2')](_0x24d683[_0x620d('0x41')][_0x620d('0xd2')]);_0x3a9966[_0x620d('0x3f')]=qs['filters'](_[_0x620d('0xd3')](_0x24d683[_0x620d('0x41')],_0xfa570['filters']));if(_0x24d683[_0x620d('0x41')][_0x620d('0x2f')]){_0x3a9966[_0x620d('0x3f')]=_[_0x620d('0x5d')](_0x3a9966[_0x620d('0x3f')],{'$or':_[_0x620d('0x39')](_0x3a9966[_0x620d('0x47')],function(_0x40a89c){var _0x2ec83d={};_0x2ec83d[_0x40a89c]={'$like':'%'+_0x24d683[_0x620d('0x41')][_0x620d('0x2f')]+'%'};return _0x2ec83d;})});}_0x3a9966=_[_0x620d('0x5d')]({},_0x3a9966,_0x24d683[_0x620d('0xd4')]);return _0x1d3a42[_0x620d('0xef')](_0x3a9966);}})['then'](function(_0x1d1d15){if(_0x1d1d15){_0x397099=_0x1d1d15[_0x620d('0x4c')];if(!_0x24d683[_0x620d('0x41')][_0x620d('0xdc')](_0x620d('0xde'))){_0x3a9966['limit']=qs[_0x620d('0x24')](_0x24d683['query'][_0x620d('0x24')]);_0x3a9966[_0x620d('0x22')]=qs[_0x620d('0x22')](_0x24d683[_0x620d('0x41')][_0x620d('0x22')]);}return _0x1d3a42[_0x620d('0xef')](_0x3a9966);}})['then'](function(_0x4fd43d){if(_0x4fd43d){return _0x4fd43d?{'count':_0x397099,'rows':_0x4fd43d}:null;}})[_0x620d('0x14')](respondWithResult(_0x244bc7,null))[_0x620d('0x1d')](handleError(_0x244bc7,null));};exports['login']=function(_0x2055b1,_0x5883cb,_0x2f958a){var _0x519bc3;var _0x310667;var _0xe7f32e;var _0x3c3e5c=!_[_0x620d('0x68')](_0x2055b1['params']['id'])?_0x2055b1[_0x620d('0x55')]['id']:!_[_0x620d('0x68')](_0x2055b1[_0x620d('0x2b')]['id'])?_0x2055b1[_0x620d('0x2b')]['id']:null;return db[_0x620d('0x40')][_0x620d('0x33')]({'where':{'id':_0x3c3e5c,'role':{'$or':[_0x620d('0x29'),_0x620d('0x2b'),'agent']}},'attributes':['id',_0x620d('0x34'),'phone','mobile',_0x620d('0x32'),_0x620d('0x64'),_0x620d('0x9f')]})[_0x620d('0x14')](function(_0x1ee9bf){if(_0x1ee9bf){if(_0x1ee9bf[_0x620d('0x32')]==='agent'){_0x519bc3=_0x1ee9bf;if(_0x2055b1[_0x620d('0x5f')][_0x620d('0xab')]){_0xe7f32e=util['format']('LOCAL/%s@from-sip/n',_0x519bc3[_0x2055b1[_0x620d('0x5f')][_0x620d('0xab')]]);}else if(_0x2055b1[_0x620d('0x5f')]['intrf']){_0xe7f32e=util[_0x620d('0xac')](_0x620d('0xad'),_0x2055b1[_0x620d('0x5f')][_0x620d('0xf0')]);}else{_0xe7f32e=util[_0x620d('0xac')]('SIP/%s',_0x519bc3['name']);}socket['to'](util[_0x620d('0xac')](_0x620d('0xf1'),_0x519bc3['name']))[_0x620d('0xb4')](_0x620d('0xf2'),{'user':{'id':_0x519bc3['id'],'name':_0x519bc3[_0x620d('0x34')]},'ip':_0x2055b1[_0x620d('0xf3')][_0x620d('0xf4')]||_0x2055b1['connection']['remoteAddress']||_0x2055b1[_0x620d('0xf5')][_0x620d('0xf6')]||_0x2055b1['connection'][_0x620d('0xf5')][_0x620d('0xf6')]});return db['UserVoiceQueueRt'][_0x620d('0xb6')]({'where':{'membername':_0x519bc3[_0x620d('0x34')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x620d('0x90'))](_0x620d('0xf7'));}})[_0x620d('0x14')](function(){if(_0x519bc3){return _0x519bc3[_0x620d('0xf8')]({'raw':!![]});}})['then'](function(_0x30b677){if(_0x519bc3){var _0x401829=[];if(_0x30b677){_0x310667=_0x30b677;if(_0x310667[_0x620d('0x4c')]){for(var _0x533719=0x0;_0x533719<_0x310667[_0x620d('0x4c')];_0x533719++){_0x401829[_0x620d('0x48')]({'membername':_0x519bc3[_0x620d('0x34')],'UserId':_0x519bc3['id'],'queue_name':_0x310667[_0x533719]['name'],'VoiceQueueId':_0x310667[_0x533719]['id'],'interface':_0xe7f32e,'paused':_0x519bc3[_0x620d('0x9f')]||![],'penalty':_0x310667[_0x533719]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x620d('0x8a')](_0x401829,function(_0x1ff091){return db[_0x620d('0xae')][_0x620d('0xaf')](_0x1ff091);});}}}})['then'](function(){if(_0x519bc3){return db[_0x620d('0xf9')][_0x620d('0x49')]({'where':{'membername':_0x519bc3[_0x620d('0x34')],'exitAt':null}});}})[_0x620d('0x14')](function(_0x20a29e){if(_0x519bc3){var _0x54d450=[];_0x20a29e[_0x620d('0xfa')](function(_0x200c19){_0x54d450[_0x620d('0x48')](_0x200c19['update']({'exitAt':moment()[_0x620d('0xac')](_0x620d('0xfb'))}));});return BPromise[_0x620d('0x5e')](_0x54d450);}})[_0x620d('0x14')](function(){if(_0x519bc3){var _0x4583a9=[];var _0x36391c=[];var _0x196b95=utils['getChannels']();var _0x53af20={'membername':_0x519bc3[_0x620d('0x34')],'interface':_0xe7f32e,'enterAt':moment()['format'](_0x620d('0xfb')),'role':_0x519bc3['role'],'internal':_0x519bc3[_0x620d('0x64')]};_0x196b95['forEach'](function(_0xe61eb2){_0x4583a9[_0x620d('0x48')](_[_0x620d('0x5d')]({'channel':_0xe61eb2,'type':_0x620d('0xfc'),'data1':_0x2055b1[_0x620d('0x5f')][_0x620d('0xfd')],'data2':_0xe7f32e},_0x53af20));if(_0x519bc3[_0x620d('0x9f')]){_0x36391c[_0x620d('0x48')](_['merge']({'channel':_0xe61eb2,'type':_0x620d('0xfe'),'data1':_0x620d('0xff')},_0x53af20));}});return db['MemberReport'][_0x620d('0x87')](_0x4583a9[_0x620d('0xcd')](_0x36391c),{'individualHooks':!![]});}})[_0x620d('0x14')](function(){if(_0x519bc3){return _0x519bc3['update']({'online':!![],'lastLoginAt':moment()[_0x620d('0xac')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x519bc3['loginInPause']||![],'mailPause':_0x519bc3[_0x620d('0x9f')]||![],'chatPause':_0x519bc3[_0x620d('0x9f')]||![],'faxPause':_0x519bc3['loginInPause']||![],'smsPause':_0x519bc3[_0x620d('0x9f')]||![],'openchannelPause':_0x519bc3[_0x620d('0x9f')]||![],'whatsappPause':_0x519bc3['loginInPause']||![],'pauseType':_0x519bc3[_0x620d('0x9f')]?_0x620d('0xff'):null,'interface':_0xe7f32e,'lastPauseAt':moment()['format'](_0x620d('0xfb'))});}})['then'](function(_0x574069){if(_0x2055b1[_0x620d('0x100')]){return _0x2f958a();}else{return BPromise[_0x620d('0x101')](_0x574069)[_0x620d('0x14')](respondWithResult(_0x5883cb,null));}})[_0x620d('0x1d')](handleError(_0x5883cb,null));};exports[_0x620d('0x102')]=function(_0x3de115,_0x3dff52){var _0x40994b;return db[_0x620d('0x40')][_0x620d('0x33')]({'where':{'id':_0x3de115['params']['id'],'role':_0x620d('0x84')},'attributes':['id','name',_0x620d('0x32')]})['then'](handleEntityNotFound(_0x3dff52,null))[_0x620d('0x14')](function(_0x543fe6){if(_0x543fe6){_0x40994b=_0x543fe6;return db[_0x620d('0xae')]['destroy']({'where':{'membername':_0x40994b[_0x620d('0x34')]},'individualHooks':!![]});}})[_0x620d('0x14')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x40994b[_0x620d('0x34')],'exitAt':null}});})[_0x620d('0x14')](function(_0x577629){var _0x37c67b=[];_0x577629[_0x620d('0xfa')](function(_0x8de5d8){_0x37c67b[_0x620d('0x48')](_0x8de5d8['update']({'exitAt':moment()[_0x620d('0xac')](_0x620d('0xfb'))}));});return BPromise[_0x620d('0x5e')](_0x37c67b);})['then'](function(){return _0x40994b['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x620d('0x14')](respondWithResult(_0x3dff52,null))['catch'](handleError(_0x3dff52,null));};exports[_0x620d('0x103')]=function(_0x35a35f,_0x9706e8){var _0x304228;return db[_0x620d('0xae')][_0x620d('0x28')]({'paused':0x1},{'where':{'UserId':_0x35a35f[_0x620d('0x55')]['id']},'individualHooks':!![]})[_0x620d('0x14')](function(){return db[_0x620d('0x40')]['find']({'where':{'id':_0x35a35f[_0x620d('0x55')]['id'],'role':'agent'},'attributes':['id',_0x620d('0x34'),_0x620d('0x32'),_0x620d('0x64'),'interface']});})[_0x620d('0x14')](handleEntityNotFound(_0x9706e8,null))[_0x620d('0x14')](function(_0xc72102){if(_0xc72102){_0x304228=_0xc72102;return respondWithRpcPromise(_0x620d('0x104'),_0x620d('0x103'),{'id':_0x304228['id'],'name':_0x304228[_0x620d('0x34')],'pause':!![]});}})[_0x620d('0x14')](function(){if(_0x304228){return db[_0x620d('0xf9')][_0x620d('0x49')]({'where':{'membername':_0x304228['name'],'type':_0x620d('0xfe'),'exitAt':null}});}})['then'](function(_0x2e0507){if(_0x2e0507[_0x620d('0x4c')]){var _0x2d260b=moment()[_0x620d('0xac')](_0x620d('0xfb'));for(var _0x5efca2=0x0,_0x25c553=_0x2e0507[_0x620d('0x4c')];_0x5efca2<_0x25c553;_0x5efca2++){_0x2e0507[_0x5efca2][_0x620d('0x105')]({'exitAt':_0x2d260b});}}})[_0x620d('0x14')](function(){var _0x23868b=[];var _0x6086e8=utils[_0x620d('0x106')]();_0x6086e8[_0x620d('0xfa')](function(_0xa09c0a){_0x23868b[_0x620d('0x48')]({'channel':_0xa09c0a,'membername':_0x304228[_0x620d('0x34')],'interface':_['isNil'](_0x304228[_0x620d('0xab')])?util['format']('SIP/%s',_0x304228[_0x620d('0x34')]):_0x304228[_0x620d('0xab')],'type':_0x620d('0xfe'),'enterAt':moment()['format'](_0x620d('0xfb')),'data1':_0x35a35f[_0x620d('0x5f')][_0x620d('0x3b')]||_0x620d('0x107'),'role':_0x304228[_0x620d('0x32')],'internal':_0x304228[_0x620d('0x64')]});});return db['MemberReport']['bulkCreate'](_0x23868b,{'individualHooks':!![]});})[_0x620d('0x14')](function(){return _0x304228[_0x620d('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x35a35f[_0x620d('0x5f')][_0x620d('0x3b')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x620d('0xac')](_0x620d('0xfb'))});})[_0x620d('0x14')](respondWithResult(_0x9706e8,null))['catch'](handleError(_0x9706e8,null));};exports['unpause']=function(_0x50495b,_0x1df1c9){var _0x31669f;return db[_0x620d('0x40')][_0x620d('0x33')]({'where':{'id':_0x50495b['params']['id']},'attributes':['id',_0x620d('0x34'),_0x620d('0x32'),_0x620d('0x108'),'mailPause','chatPause','faxPause',_0x620d('0x109'),'smsPause',_0x620d('0x10a'),'pauseType','lastPauseAt']})[_0x620d('0x14')](handleEntityNotFound(_0x1df1c9,null))[_0x620d('0x14')](function(_0x38f81d){if(_0x38f81d){_0x31669f=_0x38f81d;if(_0x50495b['body'][_0x620d('0x9d')]&&!utils[_0x620d('0xa0')](_0x50495b[_0x620d('0x5f')][_0x620d('0x9d')])){throw new db[(_0x620d('0x95'))][(_0x620d('0x90'))](_0x620d('0xb1'));}switch(_0x50495b['body'][_0x620d('0x9d')]){case _0x620d('0xa8'):return respondWithRpcPromise('QueuePause','unpause',{'id':_0x31669f['id'],'name':_0x31669f[_0x620d('0x34')],'pause':![]})[_0x620d('0x14')](function(){return db[_0x620d('0xae')][_0x620d('0x28')]({'paused':0x0},{'where':{'UserId':_0x31669f['id']},'individualHooks':!![]});})[_0x620d('0x14')](function(){return db[_0x620d('0xf9')][_0x620d('0x33')]({'where':{'channel':_0x50495b[_0x620d('0x5f')][_0x620d('0x9d')],'membername':_0x31669f['name'],'type':'PAUSE','exitAt':null}});})[_0x620d('0x14')](function(_0x3fac1f){if(_0x3fac1f){return _0x3fac1f['update']({'exitAt':moment()[_0x620d('0xac')](_0x620d('0xfb')),'data2':_0x620d('0x10b')},{'individualHooks':!![]});}return null;})[_0x620d('0x14')](function(){return _0x31669f['update']({'voicePause':![]});});case _0x620d('0x51'):case _0x620d('0x4d'):case _0x620d('0x50'):case _0x620d('0x4f'):case _0x620d('0x53'):case'openchannel':return db['MemberReport'][_0x620d('0x33')]({'where':{'channel':_0x50495b[_0x620d('0x5f')][_0x620d('0x9d')],'membername':_0x31669f[_0x620d('0x34')],'type':_0x620d('0xfe'),'exitAt':null}})['then'](function(_0x8e94fb){if(_0x8e94fb){return _0x8e94fb[_0x620d('0x28')]({'exitAt':moment()[_0x620d('0xac')](_0x620d('0xfb')),'data2':_0x620d('0x10b')},{'individualHooks':!![]});}return null;})[_0x620d('0x14')](function(){var _0x277561={};_[_0x620d('0x26')](_0x277561,util[_0x620d('0xac')]('%s%s',_0x50495b['body'][_0x620d('0x9d')],_0x620d('0x10c')),![]);return _0x31669f['update'](_0x277561);});default:return respondWithRpcPromise(_0x620d('0x104'),'unpause',{'id':_0x31669f['id'],'name':_0x31669f[_0x620d('0x34')],'pause':![]})[_0x620d('0x14')](function(){return db['UserVoiceQueueRt'][_0x620d('0x28')]({'paused':0x0},{'where':{'UserId':_0x31669f['id']}});})['then'](function(){return db[_0x620d('0xf9')]['findAll']({'where':{'membername':_0x31669f[_0x620d('0x34')],'type':_0x620d('0xfe'),'exitAt':null}});})[_0x620d('0x14')](function(_0x47d642){var _0x200744=[];_0x47d642[_0x620d('0xfa')](function(_0x2621c6){_0x200744[_0x620d('0x48')](_0x2621c6['update']({'exitAt':moment()['format'](_0x620d('0xfb')),'data2':'manual'}));});return BPromise['all'](_0x200744);})[_0x620d('0x14')](function(){return _0x31669f[_0x620d('0x28')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x1df1c9,null))[_0x620d('0x1d')](handleError(_0x1df1c9,null));};exports[_0x620d('0x10d')]=function(_0x327c7,_0xd1808e){var _0x554822={};var _0x50ac40={};var _0x36b1b1;var _0x9b78a9;return db['User'][_0x620d('0xcf')]({'where':{'id':_0x327c7[_0x620d('0x55')]['id']}})[_0x620d('0x14')](handleEntityNotFound(_0xd1808e,null))[_0x620d('0x14')](function(_0x4bf4c8){if(_0x4bf4c8){_0x36b1b1=_0x4bf4c8;_0x50ac40['model']=_[_0x620d('0x58')](db['Team'][_0x620d('0x38')]);_0x50ac40[_0x620d('0x41')]=_['keys'](_0x327c7[_0x620d('0x41')]);_0x50ac40[_0x620d('0x5a')]=_[_0x620d('0x5b')](_0x50ac40[_0x620d('0x56')],_0x50ac40[_0x620d('0x41')]);_0x554822[_0x620d('0x47')]=_['intersection'](_0x50ac40[_0x620d('0x56')],qs['fields'](_0x327c7[_0x620d('0x41')][_0x620d('0x5c')]));_0x554822[_0x620d('0x47')]=_0x554822[_0x620d('0x47')][_0x620d('0x4c')]?_0x554822[_0x620d('0x47')]:_0x50ac40[_0x620d('0x56')];_0x554822[_0x620d('0xd1')]=qs[_0x620d('0xd2')](_0x327c7[_0x620d('0x41')][_0x620d('0xd2')]);_0x554822[_0x620d('0x3f')]=qs['filters'](_[_0x620d('0xd3')](_0x327c7['query'],_0x50ac40[_0x620d('0x5a')]));if(_0x327c7['query'][_0x620d('0x2f')]){_0x554822['where']=_[_0x620d('0x5d')](_0x554822[_0x620d('0x3f')],{'$or':_['map'](_0x554822[_0x620d('0x47')],function(_0x4f9a01){var _0x20a1a8={};_0x20a1a8[_0x4f9a01]={'$like':'%'+_0x327c7[_0x620d('0x41')][_0x620d('0x2f')]+'%'};return _0x20a1a8;})});}_0x554822=_[_0x620d('0x5d')]({},_0x554822,_0x327c7[_0x620d('0xd4')]);return _0x36b1b1[_0x620d('0x10d')](_0x554822);}})['then'](function(_0x2c5833){if(_0x2c5833){_0x9b78a9=_0x2c5833[_0x620d('0x4c')];if(!_0x327c7[_0x620d('0x41')]['hasOwnProperty']('nolimit')){_0x554822['limit']=qs[_0x620d('0x24')](_0x327c7[_0x620d('0x41')][_0x620d('0x24')]);_0x554822[_0x620d('0x22')]=qs[_0x620d('0x22')](_0x327c7['query'][_0x620d('0x22')]);}return _0x36b1b1[_0x620d('0x10d')](_0x554822);}})[_0x620d('0x14')](function(_0x1309c3){if(_0x1309c3){return _0x1309c3?{'count':_0x9b78a9,'rows':_0x1309c3}:null;}})[_0x620d('0x14')](respondWithResult(_0xd1808e,null))['catch'](handleError(_0xd1808e,null));};exports['addTeams']=function(_0x3200ff,_0x417608){return db['User'][_0x620d('0x33')]({'where':{'id':_0x3200ff[_0x620d('0x55')]['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x417608,null))['then'](function(_0x114981){if(_0x114981){var _0x538a66=_0x114981[_0x620d('0xaa')]({'plain':!![]});return _0x114981[_0x620d('0x10e')](_0x3200ff[_0x620d('0x5f')]['ids'],_[_0x620d('0x63')](_0x3200ff[_0x620d('0x5f')],[_0x620d('0x62'),'id'])||{})[_0x620d('0x14')](function(){for(var _0x13d94e=0x0;_0x13d94e<_0x3200ff['body'][_0x620d('0x62')][_0x620d('0x4c')];_0x13d94e++){var _0xa9f975=[];var _0x127875={};db[_0x620d('0x10f')][_0x620d('0xcf')]({'where':{'id':_0x3200ff[_0x620d('0x5f')][_0x620d('0x62')][_0x13d94e]}})[_0x620d('0x14')](function(_0x560120){_0x127875=_0x560120[_0x620d('0x4e')];_0xa9f975[_0x620d('0x48')](_0x560120[_0x620d('0xf8')]()[_0x620d('0x14')](function(_0x2b0b2e){for(var _0x4f2565=0x0;_0x4f2565<_0x2b0b2e[_0x620d('0x4c')];_0x4f2565++){_0x2b0b2e[_0x4f2565][_0x620d('0x110')](_0x620d('0x9d'),_0x620d('0x111'));}return _0x2b0b2e;}));_0xa9f975[_0x620d('0x48')](_0x560120[_0x620d('0x112')]()['then'](function(_0x582fd6){for(var _0x5b143f=0x0;_0x5b143f<_0x582fd6[_0x620d('0x4c')];_0x5b143f++){_0x582fd6[_0x5b143f][_0x620d('0x110')](_0x620d('0x9d'),_0x620d('0x113'));}return _0x582fd6;}));_0xa9f975[_0x620d('0x48')](_0x560120[_0x620d('0x114')]()['then'](function(_0x242014){for(var _0x3c8488=0x0;_0x3c8488<_0x242014['length'];_0x3c8488++){_0x242014[_0x3c8488][_0x620d('0x110')]('channel',_0x620d('0x115'));}return _0x242014;}));_0xa9f975[_0x620d('0x48')](_0x560120[_0x620d('0x116')]()[_0x620d('0x14')](function(_0x73895e){for(var _0x4b79f9=0x0;_0x4b79f9<_0x73895e['length'];_0x4b79f9++){_0x73895e[_0x4b79f9][_0x620d('0x110')]('channel',_0x620d('0x117'));}return _0x73895e;}));_0xa9f975['push'](_0x560120[_0x620d('0x118')]()[_0x620d('0x14')](function(_0x1cc90b){for(var _0x1d31cb=0x0;_0x1d31cb<_0x1cc90b[_0x620d('0x4c')];_0x1d31cb++){_0x1cc90b[_0x1d31cb][_0x620d('0x110')](_0x620d('0x9d'),'Whatsapp');}return _0x1cc90b;}));_0xa9f975[_0x620d('0x48')](_0x560120[_0x620d('0x119')]()['then'](function(_0x1b216f){for(var _0x4a21af=0x0;_0x4a21af<_0x1b216f[_0x620d('0x4c')];_0x4a21af++){_0x1b216f[_0x4a21af][_0x620d('0x110')]('channel',_0x620d('0x11a'));}return _0x1b216f;}));_0xa9f975[_0x620d('0x48')](_0x560120[_0x620d('0x11b')]()[_0x620d('0x14')](function(_0x2df841){for(var _0x22b3a8=0x0;_0x22b3a8<_0x2df841['length'];_0x22b3a8++){_0x2df841[_0x22b3a8][_0x620d('0x110')](_0x620d('0x9d'),_0x620d('0x11c'));}return _0x2df841;}));return BPromise[_0x620d('0x5e')](_0xa9f975);})[_0x620d('0x14')](function(_0x463f96){var _0x44df2c=_[_0x620d('0x11d')](_0x463f96);_0xa9f975=[];return db[_0x620d('0x6a')][_0x620d('0x11e')](function(_0x3bff4c){for(var _0x3329cb=0x0;_0x3329cb<_0x44df2c['length'];_0x3329cb++){_0xa9f975['push'](_0x44df2c[_0x3329cb][_0x620d('0x11f')](_0x538a66['id']),{'transaction':_0x3bff4c});}return BPromise[_0x620d('0x5e')](_0xa9f975)['then'](function(){if(_0x538a66[_0x620d('0x9e')]){return BPromise['each'](_['filter'](_0x44df2c,function(_0x560edf){return _0x560edf[_0x620d('0x120')](_0x620d('0x9d'))===_0x620d('0x111');}),function(_0x10f6f8){return db[_0x620d('0xae')]['upsert']({'membername':_0x538a66[_0x620d('0x34')],'UserId':_0x538a66['id'],'queue_name':_0x10f6f8[_0x620d('0x34')],'VoiceQueueId':_0x10f6f8['id'],'interface':_[_0x620d('0x68')](_0x538a66['interface'])?util[_0x620d('0xac')](_0x620d('0xad'),_0x538a66['name']):_0x538a66['interface'],'paused':_0x538a66[_0x620d('0x108')]||![],'penalty':_0x538a66[_0x620d('0xa5')]},{'transaction':_0x3bff4c});});}else{return;}})[_0x620d('0x14')](function(){for(var _0x19286e=0x0;_0x19286e<_0x44df2c[_0x620d('0x4c')];_0x19286e++){var _0x726582=_0x44df2c[_0x19286e][_0x620d('0x120')](_0x620d('0x9d'));var _0x4bafe7=_0x726582+_0x620d('0xa7');socket['emit'](_0x620d('0x2b')+_0x726582+'Queue:save',{'UserId':_0x538a66['id'],['queueField']:_0x44df2c[_0x19286e]['id']});}});});})['then'](function(){db[_0x620d('0x121')][_0x620d('0xcf')]({'where':{'teamId':_0x127875['id']}})[_0x620d('0x14')](function(_0x1bc106){if(_0x1bc106){db['UserVoicePrefix'][_0x620d('0x7e')]({'UserId':_0x3200ff['params']['id'],'VoicePrefixId':_0x1bc106[_0x620d('0x122')]});}});});}});}})['then'](respondWithStatusCode(_0x417608,null))[_0x620d('0x1d')](handleError(_0x417608,null));};exports[_0x620d('0x123')]=function(_0x188460,_0x2fe69f){return db[_0x620d('0x40')]['findOne']({'where':{'id':_0x188460[_0x620d('0x55')]['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x2fe69f,null))[_0x620d('0x14')](function(_0x2a166d){if(_0x2a166d){var _0x2356e2=_0x2a166d['get']({'plain':!![]});var _0x4e91d6=_0x188460[_0x620d('0x41')][_0x620d('0x62')];return _0x2a166d[_0x620d('0x123')](_0x4e91d6)[_0x620d('0x14')](function(){for(var _0xe75b40=0x0;_0xe75b40<_0x4e91d6['length'];_0xe75b40++){var _0x5c5361=[];var _0x23d5c5={};db[_0x620d('0x10f')][_0x620d('0xcf')]({'where':{'id':_0x4e91d6[_0xe75b40]}})[_0x620d('0x14')](function(_0x3cc786){_0x23d5c5=_0x3cc786['dataValues'];_0x5c5361[_0x620d('0x48')](_0x3cc786[_0x620d('0xf8')]()[_0x620d('0x14')](function(_0x26aac8){for(var _0x44c9b6=0x0;_0x44c9b6<_0x26aac8[_0x620d('0x4c')];_0x44c9b6++){_0x26aac8[_0x44c9b6][_0x620d('0x110')]('channel',_0x620d('0x111'));}return _0x26aac8;}));_0x5c5361[_0x620d('0x48')](_0x3cc786[_0x620d('0x112')]()[_0x620d('0x14')](function(_0x3cc2aa){for(var _0x421ae5=0x0;_0x421ae5<_0x3cc2aa[_0x620d('0x4c')];_0x421ae5++){_0x3cc2aa[_0x421ae5][_0x620d('0x110')]('channel',_0x620d('0x113'));}return _0x3cc2aa;}));_0x5c5361[_0x620d('0x48')](_0x3cc786[_0x620d('0x114')]()[_0x620d('0x14')](function(_0x40884d){for(var _0x355b56=0x0;_0x355b56<_0x40884d[_0x620d('0x4c')];_0x355b56++){_0x40884d[_0x355b56][_0x620d('0x110')](_0x620d('0x9d'),'Mail');}return _0x40884d;}));_0x5c5361[_0x620d('0x48')](_0x3cc786['getSmsQueues']()[_0x620d('0x14')](function(_0x366eb6){for(var _0x13522b=0x0;_0x13522b<_0x366eb6[_0x620d('0x4c')];_0x13522b++){_0x366eb6[_0x13522b]['setDataValue'](_0x620d('0x9d'),_0x620d('0x117'));}return _0x366eb6;}));_0x5c5361[_0x620d('0x48')](_0x3cc786[_0x620d('0x118')]()[_0x620d('0x14')](function(_0x147a2f){for(var _0x2144f1=0x0;_0x2144f1<_0x147a2f['length'];_0x2144f1++){_0x147a2f[_0x2144f1][_0x620d('0x110')](_0x620d('0x9d'),_0x620d('0x124'));}return _0x147a2f;}));_0x5c5361[_0x620d('0x48')](_0x3cc786[_0x620d('0x119')]()[_0x620d('0x14')](function(_0x42d4a2){for(var _0x75fe99=0x0;_0x75fe99<_0x42d4a2[_0x620d('0x4c')];_0x75fe99++){_0x42d4a2[_0x75fe99]['setDataValue'](_0x620d('0x9d'),_0x620d('0x11a'));}return _0x42d4a2;}));_0x5c5361[_0x620d('0x48')](_0x3cc786[_0x620d('0x11b')]()[_0x620d('0x14')](function(_0x5c5271){for(var _0x597bc3=0x0;_0x597bc3<_0x5c5271[_0x620d('0x4c')];_0x597bc3++){_0x5c5271[_0x597bc3][_0x620d('0x110')](_0x620d('0x9d'),'Openchannel');}return _0x5c5271;}));return BPromise[_0x620d('0x5e')](_0x5c5361);})[_0x620d('0x14')](function(_0x53bc6a){var _0x42e7f9=_[_0x620d('0x11d')](_0x53bc6a);_0x5c5361=[];return db[_0x620d('0x6a')][_0x620d('0x11e')](function(_0x1c9a4d){for(var _0x99539f=0x0;_0x99539f<_0x42e7f9[_0x620d('0x4c')];_0x99539f++){_0x5c5361[_0x620d('0x48')](_0x42e7f9[_0x99539f]['removeAgent'](_0x2356e2['id']),{'transaction':_0x1c9a4d});}return BPromise[_0x620d('0x5e')](_0x5c5361)[_0x620d('0x14')](function(){if(_0x2356e2['online']){return BPromise[_0x620d('0x8a')](_[_0x620d('0x2f')](_0x42e7f9,function(_0x13417d){return _0x13417d['getDataValue'](_0x620d('0x9d'))===_0x620d('0x111');}),function(_0x503122){return db[_0x620d('0xae')][_0x620d('0xb6')]({'where':{'VoiceQueueId':_0x503122['id'],'UserId':_0x2356e2['id']},'transaction':_0x1c9a4d});});}else{return;}})[_0x620d('0x14')](function(){db[_0x620d('0x121')][_0x620d('0xcf')]({'where':{'teamId':_0x23d5c5['id']}})[_0x620d('0x14')](function(_0x4ad24e){if(_0x4ad24e){return db['UserVoicePrefix'][_0x620d('0xb6')]({'where':{'UserId':_0x2356e2['id'],'VoicePrefixId':_0x4ad24e[_0x620d('0x4e')]['VoicePrefixId']}});}});})[_0x620d('0x14')](function(){for(var _0x3efc9b=0x0;_0x3efc9b<_0x42e7f9[_0x620d('0x4c')];_0x3efc9b++){var _0x1d297e=_0x42e7f9[_0x3efc9b][_0x620d('0x120')](_0x620d('0x9d'));var _0x96e4e0=_0x1d297e+'QueueId';socket[_0x620d('0xb4')](_0x620d('0x2b')+_0x1d297e+_0x620d('0xb5'),{'UserId':_0x2356e2['id'],['queueField']:_0x42e7f9[_0x3efc9b]['id']});}});});});}});}})[_0x620d('0x14')](respondWithStatusCode(_0x2fe69f,null))[_0x620d('0x1d')](handleError(_0x2fe69f,null));};exports[_0x620d('0x125')]=function(_0x440221,_0x5d91fc){var _0x38472b={};var _0x12c152={};var _0x103209;var _0x2a6327;return db[_0x620d('0x40')][_0x620d('0xcf')]({'where':{'id':_0x440221['params']['id']}})[_0x620d('0x14')](handleEntityNotFound(_0x5d91fc,null))[_0x620d('0x14')](function(_0x51b964){if(_0x51b964){_0x103209=_0x51b964;_0x12c152[_0x620d('0x56')]=_[_0x620d('0x58')](db[_0x620d('0x126')][_0x620d('0x38')]);_0x12c152[_0x620d('0x41')]=_['keys'](_0x440221[_0x620d('0x41')]);_0x12c152['filters']=_['intersection'](_0x12c152['model'],_0x12c152['query']);_0x38472b[_0x620d('0x47')]=_[_0x620d('0x5b')](_0x12c152['model'],qs[_0x620d('0x5c')](_0x440221['query'][_0x620d('0x5c')]));_0x38472b[_0x620d('0x47')]=_0x38472b[_0x620d('0x47')][_0x620d('0x4c')]?_0x38472b[_0x620d('0x47')]:_0x12c152[_0x620d('0x56')];_0x38472b[_0x620d('0xd1')]=qs[_0x620d('0xd2')](_0x440221[_0x620d('0x41')][_0x620d('0xd2')]);_0x38472b['where']=qs[_0x620d('0x5a')](_[_0x620d('0xd3')](_0x440221['query'],_0x12c152[_0x620d('0x5a')]));if(_0x440221[_0x620d('0x41')][_0x620d('0x2f')]){_0x38472b[_0x620d('0x3f')]=_[_0x620d('0x5d')](_0x38472b[_0x620d('0x3f')],{'$or':_[_0x620d('0x39')](_0x38472b[_0x620d('0x47')],function(_0x1c8a75){var _0x2f86b6={};_0x2f86b6[_0x1c8a75]={'$like':'%'+_0x440221[_0x620d('0x41')]['filter']+'%'};return _0x2f86b6;})});}_0x38472b=_[_0x620d('0x5d')]({},_0x38472b,_0x440221[_0x620d('0xd4')]);return _0x103209[_0x620d('0x125')](_0x38472b);}})[_0x620d('0x14')](function(_0x4f0d77){if(_0x4f0d77){_0x2a6327=_0x4f0d77['length'];if(!_0x440221[_0x620d('0x41')]['hasOwnProperty']('nolimit')){_0x38472b['limit']=qs['limit'](_0x440221[_0x620d('0x41')]['limit']);_0x38472b['offset']=qs['offset'](_0x440221[_0x620d('0x41')][_0x620d('0x22')]);}return _0x103209[_0x620d('0x125')](_0x38472b);}})[_0x620d('0x14')](function(_0x5d8117){if(_0x5d8117){return _0x5d8117?{'count':_0x2a6327,'rows':_0x5d8117}:null;}})[_0x620d('0x14')](respondWithResult(_0x5d91fc,null))[_0x620d('0x1d')](handleError(_0x5d91fc,null));};exports['getAgents']=function(_0x2316fe,_0xa52f1){var _0x2bff6d={};var _0x55cff0={};var _0x29fa16;return db[_0x620d('0x40')]['findOne']({'where':{'id':_0x2316fe['params']['id']}})[_0x620d('0x14')](handleEntityNotFound(_0xa52f1,null))[_0x620d('0x14')](function(_0x2418d7){if(_0x2418d7){_0x29fa16=_0x2418d7;_0x55cff0[_0x620d('0x56')]=_[_0x620d('0x58')](db[_0x620d('0x40')][_0x620d('0x38')]);_0x55cff0[_0x620d('0x41')]=_[_0x620d('0x58')](_0x2316fe[_0x620d('0x41')]);_0x55cff0[_0x620d('0x5a')]=_[_0x620d('0x5b')](_0x55cff0[_0x620d('0x56')],_0x55cff0[_0x620d('0x41')]);_0x2bff6d[_0x620d('0x47')]=_['intersection'](_0x55cff0['model'],qs[_0x620d('0x5c')](_0x2316fe[_0x620d('0x41')][_0x620d('0x5c')]));_0x2bff6d[_0x620d('0x47')]=_0x2bff6d[_0x620d('0x47')]['length']?_0x2bff6d[_0x620d('0x47')]:_0x55cff0[_0x620d('0x56')];_0x2bff6d[_0x620d('0xd1')]=qs[_0x620d('0xd2')](_0x2316fe[_0x620d('0x41')]['sort']);_0x2bff6d['where']=qs[_0x620d('0x5a')](_[_0x620d('0xd3')](_0x2316fe[_0x620d('0x41')],_0x55cff0[_0x620d('0x5a')]));if(_0x2316fe[_0x620d('0x41')][_0x620d('0x2f')]){_0x2bff6d[_0x620d('0x3f')]=_[_0x620d('0x5d')](_0x2bff6d[_0x620d('0x3f')],{'$or':_['map'](_0x2bff6d[_0x620d('0x47')],function(_0x452d2d){var _0x490ca0={};_0x490ca0[_0x452d2d]={'$like':'%'+_0x2316fe['query'][_0x620d('0x2f')]+'%'};return _0x490ca0;})});}_0x2bff6d[_0x620d('0x56')]=db[_0x620d('0x40')];_0x2bff6d['as']='Agents';_0x2bff6d=_['merge']({},_0x2bff6d,_0x2316fe['options']);return _0x29fa16[_0x620d('0xf8')]({'include':[_0x2bff6d]});}})['then'](function(_0x25a4e0){if(_0x25a4e0){var _0x9a2624={},_0x207224=[];for(var _0x6376d=0x0;_0x6376d<_0x25a4e0[_0x620d('0x4c')];_0x6376d+=0x1){for(var _0x1456f3=0x0,_0x36a3bd;_0x1456f3<_0x25a4e0[_0x6376d][_0x620d('0x2c')][_0x620d('0x4c')];_0x1456f3+=0x1){_0x36a3bd=_0x25a4e0[_0x6376d][_0x620d('0x2c')][_0x1456f3][_0x620d('0xaa')]({'plain':!![]});_0x9a2624[_0x36a3bd['id']]=_0x36a3bd;}}_0x9a2624=_[_0x620d('0x127')](_0x9a2624);for(var _0x4bbdbc=qs[_0x620d('0x22')](_0x2316fe[_0x620d('0x41')][_0x620d('0x22')]);_0x4bbdbc<_0x9a2624[_0x620d('0x4c')]&&_0x207224[_0x620d('0x4c')]=_0x3f44f0){_0x133709=_0x3f44f0;_0x54372c=0xc8;}else{_0x54372c=0xce;}_0x4e2b4e['status'](_0x54372c);return _0x4e2b4e[_0x1326('0x25')](_0x1326('0x26'),_0x798666+'-'+_0x133709+'/'+_0x3f44f0)['json'](_0x193d4f);}return null;};}function saveUpdates(_0x2d7293){return function(_0x3d5a0a){if(_0x3d5a0a){return _0x3d5a0a[_0x1326('0x27')](_0x2d7293)[_0x1326('0x13')](function(_0x849424){return _0x849424;});}return null;};}function removeEntity(_0x586b63){return function(_0x2c366e){if(_0x2c366e){return _0x2c366e[_0x1326('0x28')]()['then'](function(){var _0x5c3f9d=_0x2c366e['get']({'plain':!![]});if(_0x5c3f9d[_0x1326('0x29')]===_0x1326('0x2a'))return;var _0x384a05=[{'name':_0x1326('0x2b'),'value':_0x1326('0x2c'),'ignore':!![]},{'name':_0x1326('0x2d'),'value':_0x1326('0x2e'),'ignore':![]},{'name':'Telephones','value':_0x1326('0x2f'),'ignore':![]}];var _0x2376d5=_(_0x384a05)[_0x1326('0x30')]('ignore')[_0x1326('0x31')](_0x1326('0x32'))[_0x1326('0x32')]();if(_[_0x1326('0x33')](_0x2376d5,_0x5c3f9d[_0x1326('0x29')])){return;}var _0x3f877c=_['find'](_0x384a05,['value',_0x5c3f9d[_0x1326('0x29')]])['name'];return db[_0x1326('0x34')][_0x1326('0x28')]({'where':{'type':_0x3f877c,'resourceId':_0x5c3f9d['id']}})[_0x1326('0x13')](function(){return _0x2c366e;});})[_0x1326('0x13')](function(){_0x586b63[_0x1326('0x1f')](0xcc)[_0x1326('0x20')]();});}};}function handleEntityNotFound(_0x5dcd9a){return function(_0x1c0b1f){if(!_0x1c0b1f){_0x5dcd9a['sendStatus'](0x194);}return _0x1c0b1f;};}function handleError(_0x29264a,_0x40d682){_0x40d682=_0x40d682||0x1f4;return function(_0xff5eb7){logger['error'](_0xff5eb7[_0x1326('0x35')]);if(_0xff5eb7[_0x1326('0x36')]){delete _0xff5eb7[_0x1326('0x36')];}_0x29264a['status'](_0x40d682)[_0x1326('0x37')](_0xff5eb7);};}exports['index']=function(_0x4a60f4,_0x4c3df1){var _0x33b65d={},_0x507fac={'count':0x0,'rows':[]};var _0x79a591=_(db[_0x1326('0x38')]['rawAttributes'])[_0x1326('0x31')](function(_0x2b42c2){return{'name':_0x2b42c2[_0x1326('0x39')],'type':_0x2b42c2[_0x1326('0x3a')][_0x1326('0x3b')]};})['filter'](function(_0x289915){return!_['includes'](['password',_0x1326('0x3c')],_0x289915[_0x1326('0x36')]);})[_0x1326('0x32')]();_0x33b65d=qs[_0x1326('0x3d')](_0x79a591,_0x4a60f4);var _0x49e3ab={'where':_0x33b65d[_0x1326('0x3e')]};return db[_0x1326('0x38')]['count'](_0x49e3ab)[_0x1326('0x13')](function(_0x2dcfb4){_0x507fac[_0x1326('0x23')]=_0x2dcfb4;if(_0x4a60f4[_0x1326('0x3f')]['includeAll']){_0x33b65d[_0x1326('0x40')]=[{'all':!![]}];}if(_0x4a60f4[_0x1326('0x3f')]['userSetting']===_0x1326('0x41')){_0x33b65d[_0x1326('0x40')]=[{'model':db[_0x1326('0x42')],'as':_0x1326('0x43')}];}if(!_['includes'](_0x33b65d['attributes'],'id')){_0x33b65d[_0x1326('0x44')]['push']('id');}return db[_0x1326('0x38')][_0x1326('0x45')](_0x33b65d);})['then'](function(_0x2bb8f6){_0x507fac[_0x1326('0x46')]=_0x2bb8f6;if(_0x4a60f4['query']['openTabs']==='true'){var _0x86cc86=[];for(var _0x54ba20=0x0;_0x54ba20<_0x507fac[_0x1326('0x46')][_0x1326('0x47')];_0x54ba20++){_0x86cc86[_0x1326('0x48')](get_open_tabs(_0x1326('0x49'),_0x507fac['rows'][_0x54ba20]['dataValues']));_0x86cc86[_0x1326('0x48')](get_open_tabs(_0x1326('0x4a'),_0x507fac[_0x1326('0x46')][_0x54ba20][_0x1326('0x4b')]));_0x86cc86[_0x1326('0x48')](get_open_tabs('fax',_0x507fac[_0x1326('0x46')][_0x54ba20]['dataValues']));_0x86cc86[_0x1326('0x48')](get_open_tabs('mail',_0x507fac['rows'][_0x54ba20][_0x1326('0x4b')]));_0x86cc86['push'](get_open_tabs('openchannel',_0x507fac[_0x1326('0x46')][_0x54ba20][_0x1326('0x4b')]));_0x86cc86[_0x1326('0x48')](get_open_tabs(_0x1326('0x4c'),_0x507fac[_0x1326('0x46')][_0x54ba20][_0x1326('0x4b')]));}return BPromise[_0x1326('0x4d')](_0x86cc86)['then'](function(){return _0x507fac;});}else{return _0x507fac;}})[_0x1326('0x13')](respondWithFilteredResult(_0x4c3df1,_0x33b65d))[_0x1326('0x1e')](handleError(_0x4c3df1,null));};exports[_0x1326('0x4e')]=function(_0x1cf1ee,_0x241d1b){var _0x274ed5={'raw':![],'where':{'id':_0x1cf1ee[_0x1326('0x4f')]['id']}},_0x15e803={};_0x15e803[_0x1326('0x50')]=_['differenceBy'](_[_0x1326('0x51')](db[_0x1326('0x38')][_0x1326('0x52')]),[_0x1326('0x53'),_0x1326('0x3c')]);_0x15e803[_0x1326('0x3f')]=_[_0x1326('0x51')](_0x1cf1ee[_0x1326('0x3f')]);_0x15e803[_0x1326('0x54')]=_[_0x1326('0x55')](_0x15e803[_0x1326('0x50')],_0x15e803[_0x1326('0x3f')]);_0x274ed5[_0x1326('0x44')]=_[_0x1326('0x55')](_0x15e803[_0x1326('0x50')],qs[_0x1326('0x56')](_0x1cf1ee[_0x1326('0x3f')][_0x1326('0x56')]));_0x274ed5[_0x1326('0x44')]=_0x274ed5['attributes']['length']?_0x274ed5[_0x1326('0x44')]:_0x15e803[_0x1326('0x50')];if(_0x1cf1ee[_0x1326('0x3f')][_0x1326('0x57')]){_0x274ed5[_0x1326('0x40')]=[{'all':!![]}];}if(_0x1cf1ee[_0x1326('0x3f')][_0x1326('0x43')]===_0x1326('0x41')){_0x274ed5[_0x1326('0x40')]=[{'model':db[_0x1326('0x42')],'as':_0x1326('0x43')}];}_0x274ed5=_[_0x1326('0x58')]({},_0x274ed5,_0x1cf1ee[_0x1326('0x59')]);if(!_[_0x1326('0x33')](_0x274ed5['attributes'],'id')){_0x274ed5[_0x1326('0x44')]['push']('id');}return db[_0x1326('0x38')][_0x1326('0x5a')](_0x274ed5)[_0x1326('0x13')](handleEntityNotFound(_0x241d1b,null))[_0x1326('0x13')](function(_0x59f49f){var _0x2c9cbf=[];values=_0x59f49f;if(_0x1cf1ee['query']['openTabs']===_0x1326('0x41')){_0x2c9cbf[_0x1326('0x48')](get_open_tabs(_0x1326('0x49'),_0x59f49f['dataValues']));_0x2c9cbf['push'](get_open_tabs(_0x1326('0x4a'),_0x59f49f['dataValues']));_0x2c9cbf[_0x1326('0x48')](get_open_tabs(_0x1326('0x5b'),_0x59f49f[_0x1326('0x4b')]));_0x2c9cbf['push'](get_open_tabs('whatsapp',_0x59f49f[_0x1326('0x4b')]));_0x2c9cbf['push'](get_open_tabs(_0x1326('0x5c'),_0x59f49f[_0x1326('0x4b')]));_0x2c9cbf['push'](get_open_tabs('mail',_0x59f49f[_0x1326('0x4b')]));return BPromise[_0x1326('0x4d')](_0x2c9cbf);}else{return values;}})[_0x1326('0x13')](function(){return values;})['then'](respondWithResult(_0x241d1b,null))[_0x1326('0x1e')](handleError(_0x241d1b,null));};exports['update']=function(_0x1cb198,_0x516ef3){if(_0x1cb198[_0x1326('0x5d')]['id']){delete _0x1cb198[_0x1326('0x5d')]['id'];}delete _0x1cb198[_0x1326('0x5d')]['role'];return db[_0x1326('0x38')][_0x1326('0x5a')]({'where':{'id':_0x1cb198[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x516ef3,null))['then'](saveUpdates(_0x1cb198[_0x1326('0x5d')],null))[_0x1326('0x13')](respondWithResult(_0x516ef3,null))[_0x1326('0x1e')](handleError(_0x516ef3,null));};exports['describe']=function(_0x16d2e7,_0x46d502){return db['User']['describe']()['then'](respondWithResult(_0x46d502,null))[_0x1326('0x1e')](handleError(_0x46d502,null));};exports[_0x1326('0x5e')]=function(_0x5d1ca5,_0x1fbc2c){return db[_0x1326('0x38')][_0x1326('0x5a')]({'where':{'id':_0x5d1ca5[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x1fbc2c,null))['then'](function(_0x30e900){if(_0x30e900){return _0x30e900[_0x1326('0x5e')](_0x5d1ca5[_0x1326('0x5d')][_0x1326('0x5f')],_[_0x1326('0x60')](_0x5d1ca5[_0x1326('0x5d')],[_0x1326('0x5f'),'id'])||{});}})[_0x1326('0x13')](respondWithResult(_0x1fbc2c,null))[_0x1326('0x1e')](handleError(_0x1fbc2c,null));};function validateUser(_0x453e63){return new BPromise(function(_0x360682,_0x429198){if(_0x453e63[_0x1326('0x61')])return _0x360682(_0x453e63);return db[_0x1326('0x62')][_0x1326('0x63')](0x1)['then'](function(_0x50fb0e){if(_0x50fb0e['securePassword'])authService[_0x1326('0x64')](_0x453e63[_0x1326('0x53')]);db[_0x1326('0x38')]['max'](_0x1326('0x61'))['then'](function(_0x20f771){if(_[_0x1326('0x65')](_0x20f771)){_0x453e63['internal']=_0x50fb0e[_0x1326('0x66')]||0x1;return;}if(_['isNil'](_0x50fb0e['min_internal'])||_0x50fb0e[_0x1326('0x66')]===_0x20f771){_0x453e63[_0x1326('0x61')]=_0x20f771+0x1;return;}if(_0x50fb0e[_0x1326('0x66')]>_0x20f771){_0x453e63[_0x1326('0x61')]=_0x50fb0e[_0x1326('0x66')];return;}return db[_0x1326('0x67')][_0x1326('0x3f')](_0x1326('0x68'),{'type':db[_0x1326('0x67')][_0x1326('0x69')][_0x1326('0x6a')]})[_0x1326('0x13')](function(_0xc3be41){if(_0xc3be41&&_0xc3be41[_0x1326('0x47')]){for(var _0x5c4480=0x0,_0x4975ce=_0xc3be41[_0x1326('0x47')];_0x5c4480<_0x4975ce&&_[_0x1326('0x65')](_0x453e63[_0x1326('0x61')]);_0x5c4480++){if(_0x50fb0e[_0x1326('0x66')]<=_0xc3be41[_0x5c4480][_0x1326('0x6b')]){_0x453e63[_0x1326('0x61')]=_0xc3be41[_0x5c4480][_0x1326('0x6b')];}else if(_0x50fb0e[_0x1326('0x66')]>_0xc3be41[_0x5c4480][_0x1326('0x6b')]&&_0x50fb0e[_0x1326('0x66')]<=_0xc3be41[_0x5c4480]['to']){_0x453e63['internal']=_0x50fb0e[_0x1326('0x66')];}}}if(_[_0x1326('0x65')](_0x453e63[_0x1326('0x61')])){_0x453e63[_0x1326('0x61')]=_0x20f771+0x1;}return _0x360682(_0x453e63);});});})[_0x1326('0x1e')](function(_0x1ce414){_0x429198(_0x1ce414);});});}function updateUser(_0x3d4b22){return new BPromise(function(_0x132c1c,_0x1d19b1){try{if(_0x3d4b22[_0x1326('0x6c')]){_0x3d4b22[_0x1326('0x6d')]=_0x3d4b22[_0x1326('0x61')];_0x3d4b22[_0x1326('0x6e')]={'mailbox':_0x3d4b22[_0x1326('0x61')],'password':_0x3d4b22[_0x1326('0x53')],'fullname':_0x3d4b22[_0x1326('0x6f')],'email':_0x3d4b22[_0x1326('0x70')]};}if(_0x3d4b22['role']===_0x1326('0x2e')){if(!_0x3d4b22['permissions'])_0x3d4b22[_0x1326('0x71')]=['101',_0x1326('0x72'),_0x1326('0x73'),'113',_0x1326('0x74'),_0x1326('0x75'),_0x1326('0x76'),_0x1326('0x77'),_0x1326('0x78'),_0x1326('0x79'),_0x1326('0x7a'),_0x1326('0x7b'),_0x1326('0x7c'),_0x1326('0x7d'),_0x1326('0x7e')];}_0x132c1c(_0x3d4b22);}catch(_0x937127){_0x1d19b1(_0x937127);}});}exports[_0x1326('0x7f')]=function(_0x33d0ae,_0x2cdbb5){if(_0x33d0ae[_0x1326('0x2c')][_0x1326('0x29')]===_0x1326('0x2e'))throw new Error(_0x1326('0x80'));if(_0x33d0ae[_0x1326('0x5d')][_0x1326('0x29')]===_0x1326('0x2c')&&_0x33d0ae[_0x1326('0x2c')][_0x1326('0x29')]!==_0x1326('0x2a')){throw new Error(_0x1326('0x81'));}if(_0x33d0ae[_0x1326('0x5d')][_0x1326('0x29')]===_0x1326('0x2a')&&_0x33d0ae[_0x1326('0x2c')]['role']!==_0x1326('0x2a')){throw new Error(_0x1326('0x82'));}return licenseUtil[_0x1326('0x83')]([_0x33d0ae[_0x1326('0x5d')]])['then'](function(){return validateUser(_0x33d0ae[_0x1326('0x5d')]);})[_0x1326('0x13')](function(_0x469f27){return updateUser(_0x469f27)[_0x1326('0x13')](function(_0x33b9d1){if(_0x33b9d1[_0x1326('0x29')]===_0x1326('0x2a')){_0x33b9d1[_0x1326('0x84')]=_0x33d0ae[_0x1326('0x2c')][_0x1326('0x84')];delete _0x33b9d1['userProfileId'];}return _0x33b9d1;});})[_0x1326('0x13')](function(_0x7c3c06){return db[_0x1326('0x38')][_0x1326('0x7f')](_0x7c3c06,{'include':[{'model':db[_0x1326('0x6e')],'as':_0x1326('0x6e')}]});})[_0x1326('0x13')](function(_0xd7c665){if(_0x33d0ae[_0x1326('0x5d')][_0x1326('0x29')]===_0x1326('0x2c'))return _0xd7c665;if(_0x33d0ae['user'][_0x1326('0x29')]!==_0x1326('0x2c'))return _0xd7c665;return db[_0x1326('0x85')][_0x1326('0x5a')]({'where':{'name':_0xd7c665[_0x1326('0x29')]==='agent'?_0x1326('0x2d'):_0x1326('0x86'),'userProfileId':_0x33d0ae[_0x1326('0x2c')]['userProfileId']},'raw':!![]})[_0x1326('0x13')](function(_0x39eff0){if(!_0x39eff0||_0x39eff0['autoAssociation']!=0x0)return _0xd7c665;return db[_0x1326('0x34')][_0x1326('0x7f')]({'name':_0xd7c665[_0x1326('0x36')],'resourceId':_0xd7c665['id'],'type':_0x39eff0[_0x1326('0x36')],'sectionId':_0x39eff0['id']},{})[_0x1326('0x13')](function(){return _0xd7c665;});})[_0x1326('0x1e')](function(_0x21ac8c){logger['error'](_0x1326('0x87'),_0x21ac8c);throw _0x21ac8c;});})['then'](respondWithResult(_0x2cdbb5,0xc9))[_0x1326('0x1e')](handleError(_0x2cdbb5,null));};exports[_0x1326('0x88')]=function(_0x14f7ff,_0x5631e9){var _0x19a57f=_0x14f7ff[_0x1326('0x5d')];var _0x341c70=[];if(_0x14f7ff[_0x1326('0x2c')][_0x1326('0x29')]===_0x1326('0x2e'))throw new Error(_0x1326('0x80'));if(_[_0x1326('0x89')](_0x19a57f,[_0x1326('0x29'),_0x1326('0x2c')])&&_0x14f7ff[_0x1326('0x2c')]['role']!==_0x1326('0x2a')){throw new Error(_0x1326('0x81'));}if(_['some'](_0x19a57f,[_0x1326('0x29'),'admin'])&&_0x14f7ff['user'][_0x1326('0x29')]!==_0x1326('0x2a')){throw new Error(_0x1326('0x8a'));}return licenseUtil[_0x1326('0x83')](_0x19a57f)['then'](function(){return validateUser(_0x19a57f[0x0]);})[_0x1326('0x13')](function(){for(var _0x7ce46f=0x1;_0x7ce46f<_0x19a57f[_0x1326('0x47')];_0x7ce46f++){var _0x57bf51=_0x19a57f[_0x7ce46f-0x1]['internal'];if(!_0x19a57f[_0x7ce46f][_0x1326('0x61')])_0x19a57f[_0x7ce46f][_0x1326('0x61')]=_0x57bf51+0x1;_0x341c70[_0x1326('0x48')](validateUser(_0x19a57f[_0x7ce46f]));}return BPromise[_0x1326('0x4d')](_0x341c70);})[_0x1326('0x13')](function(){_0x341c70=[];for(var _0x226269=0x0;_0x226269<_0x19a57f[_0x1326('0x47')];_0x226269++){_0x341c70['push'](updateUser(_0x19a57f[_0x226269]));}return BPromise[_0x1326('0x4d')](_0x341c70);})[_0x1326('0x13')](function(){return BPromise[_0x1326('0x8b')](_0x19a57f,function(_0x16d025){return db[_0x1326('0x38')][_0x1326('0x7f')](_0x16d025,{'include':[{'model':db['VoiceMail'],'as':_0x1326('0x6e')}]})[_0x1326('0x13')](function(_0x4eceb4){_0x16d025['id']=_0x4eceb4['id'];return _0x16d025;});});})[_0x1326('0x13')](function(_0x54035c){if(_0x14f7ff['body'][_0x1326('0x29')]===_0x1326('0x2c'))return _0x54035c;if(_0x14f7ff[_0x1326('0x2c')][_0x1326('0x29')]!==_0x1326('0x2c'))return _0x54035c;var _0x1f276a=_['some'](_0x54035c,function(_0x5beaf1){return _0x5beaf1[_0x1326('0x29')]===_0x1326('0x2e')||_0x5beaf1[_0x1326('0x29')]===_0x1326('0x2f');});if(!_0x1f276a)return _0x54035c;return db[_0x1326('0x85')][_0x1326('0x45')]({'where':{'name':{'$or':[_0x1326('0x2d'),_0x1326('0x86')]},'userProfileId':_0x14f7ff[_0x1326('0x2c')][_0x1326('0x8c')]},'raw':!![]})[_0x1326('0x13')](function(_0x2acc37){if(_[_0x1326('0x8d')](_0x2acc37)||!_[_0x1326('0x89')](_0x2acc37,[_0x1326('0x8e'),0x0]))return _0x54035c;_0x341c70=[];var _0x2c05a6=_(_0x2acc37)[_0x1326('0x31')](function(_0x473269){if(_0x473269[_0x1326('0x8e')]===0x1)return;return _0x473269['name']===_0x1326('0x2d')?_0x1326('0x2e'):_0x1326('0x2f');})['compact']()[_0x1326('0x32')]();for(var _0x4251b6=0x0;_0x4251b6<_0x54035c[_0x1326('0x47')];_0x4251b6++){if(!_[_0x1326('0x33')](_0x2c05a6,_0x54035c[_0x4251b6][_0x1326('0x29')]))return;var _0x3236c5=_0x54035c[_0x4251b6][_0x1326('0x29')]===_0x1326('0x2e')?_0x1326('0x2d'):'Telephones';_0x341c70[_0x1326('0x48')](db[_0x1326('0x34')][_0x1326('0x7f')]({'name':_0x54035c[_0x4251b6][_0x1326('0x36')],'resourceId':_0x54035c[_0x4251b6]['id'],'type':_0x3236c5,'sectionId':_[_0x1326('0x5a')](_0x2acc37,[_0x1326('0x36'),_0x3236c5])['id']},{}));}return BPromise[_0x1326('0x4d')](_0x341c70);});})[_0x1326('0x13')](respondWithResult(_0x5631e9,0xc9))[_0x1326('0x1e')](handleError(_0x5631e9,null));};exports['changePassword']=function(_0x54e63b,_0x5094aa){if(_0x54e63b['body']['id']){delete _0x54e63b[_0x1326('0x5d')]['id'];}return db['User']['find']({'where':{'id':_0x54e63b[_0x1326('0x4f')]['id']}})['then'](function(_0x5c9d2f){if(!_0x5c9d2f)return null;if(_0x5c9d2f['id']===_0x54e63b[_0x1326('0x2c')]['id']){if(!_0x54e63b[_0x1326('0x5d')][_0x1326('0x8f')]||!_0x54e63b[_0x1326('0x5d')][_0x1326('0x90')]){throw new db[(_0x1326('0x91'))][(_0x1326('0x92'))](_0x1326('0x93'));}if(!_0x5c9d2f[_0x1326('0x94')](_0x54e63b['body']['oldPassword'])){throw new db[(_0x1326('0x91'))][(_0x1326('0x92'))](_0x1326('0x95'));}if(_0x54e63b[_0x1326('0x5d')][_0x1326('0x8f')]===_0x54e63b[_0x1326('0x5d')][_0x1326('0x90')]){throw new db['Sequelize'][(_0x1326('0x92'))](_0x1326('0x96'));}}else if(_0x54e63b[_0x1326('0x2c')][_0x1326('0x29')]===_0x1326('0x2a')){if(!_0x54e63b[_0x1326('0x5d')][_0x1326('0x90')]){throw new db[(_0x1326('0x91'))][(_0x1326('0x92'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x54e63b[_0x1326('0x2c')][_0x1326('0x29')]==='user'){if(!_0x54e63b['body'][_0x1326('0x90')]){throw new db[(_0x1326('0x91'))][(_0x1326('0x92'))](_0x1326('0x97'));}if(_0x5c9d2f[_0x1326('0x29')]!==_0x1326('0x2e')){throw new db[(_0x1326('0x91'))]['ValidationError']('Unauthorized');}}else{throw new db['Sequelize']['ValidationError'](_0x1326('0x80'));}return _0x5c9d2f;})[_0x1326('0x13')](handleEntityNotFound(_0x5094aa,null))['then'](function(_0x6c47f1){return db['Setting']['findOne']({'attributes':['id','securePassword',_0x1326('0x98'),'passwordHistoryLimit']})['then'](function(_0x1b3e0f){if(_0x1b3e0f[_0x1326('0x99')])authService['validatePasswordPattern'](_0x54e63b[_0x1326('0x5d')][_0x1326('0x90')]);if(!_0x1b3e0f[_0x1326('0x98')]||!_0x6c47f1[_0x1326('0x9a')])return _0x6c47f1;authService[_0x1326('0x9b')](_0x54e63b[_0x1326('0x5d')][_0x1326('0x90')],_0x6c47f1['previousPasswords'],_0x1b3e0f[_0x1326('0x9c')]);return _0x6c47f1;})[_0x1326('0x13')](saveUpdates({'password':_0x54e63b[_0x1326('0x5d')][_0x1326('0x90')],'passwordResetAt':_0x54e63b['user']['id']==_0x54e63b[_0x1326('0x4f')]['id']?moment():null,'previousPasswords':authService[_0x1326('0x9d')](_0x54e63b['body'][_0x1326('0x90')],_0x6c47f1[_0x1326('0x9a')])},null));})[_0x1326('0x13')](respondWithResult(_0x5094aa,null))[_0x1326('0x1e')](handleError(_0x5094aa,null));};exports['addQueues']=function(_0x3bbad3,_0x2bd36d){var _0x335995=_0x3bbad3['body']['channel'];return db['User'][_0x1326('0x5a')]({'where':{'id':_0x3bbad3['params']['id']},'attributes':['id',_0x1326('0x36'),_0x1326('0x29'),_0x1326('0x9e'),_0x1326('0x9f'),_0x1326('0xa0'),'interface']})[_0x1326('0x13')](handleEntityNotFound(_0x2bd36d,null))['then'](function(_0x1e13f1){if(_0x1e13f1){if(!utils['isValidChannel'](_0x335995)){throw new db[(_0x1326('0x91'))][(_0x1326('0x92'))]('Unknown\x20channel');}return _0x1e13f1[_0x1326('0xa1')+_[_0x1326('0xa2')](_0x335995[_0x1326('0xa3')]())+_0x1326('0xa4')](_0x3bbad3[_0x1326('0x5d')][_0x1326('0x5f')],{'penalty':_0x3bbad3[_0x1326('0x5d')][_0x1326('0xa5')]||0x0})[_0x1326('0xa6')](function(_0x1506f5){for(var _0x2783b2=0x0;_0x2783b2<_0x3bbad3[_0x1326('0x5d')][_0x1326('0x5f')][_0x1326('0x47')];_0x2783b2+=0x1){var _0x503176={'UserId':Number(_0x3bbad3[_0x1326('0x4f')]['id'])};_0x503176[_['capitalize'](_0x335995[_0x1326('0xa3')]())+_0x1326('0xa7')]=Number(_0x3bbad3[_0x1326('0x5d')][_0x1326('0x5f')][_0x2783b2]);socket[_0x1326('0xa8')](_0x1326('0x2c')+_[_0x1326('0xa2')](_0x335995[_0x1326('0xa3')]())+_0x1326('0xa9'),_0x503176);}return _0x1506f5;})[_0x1326('0x13')](function(){if(_0x335995===_0x1326('0xaa')){return db[_0x1326('0xab')][_0x1326('0x45')]({'where':{'id':_0x3bbad3[_0x1326('0x5d')][_0x1326('0x5f')]||[]},'raw':!![],'attributes':['id',_0x1326('0x36')]});}})['then'](function(_0x96be28){var _0x28d831=_0x1e13f1['get']({'plain':!![]});var _0x345bf9=[];if(_0x335995==='voice'&&_0x28d831[_0x1326('0x29')]===_0x1326('0x2e')&&_0x28d831[_0x1326('0x9e')]){for(var _0x2aefdc=0x0;_0x2aefdc<_0x96be28[_0x1326('0x47')];_0x2aefdc+=0x1){_0x345bf9['push']({'membername':_0x28d831['name'],'UserId':_0x28d831['id'],'queue_name':_0x96be28[_0x2aefdc]['name'],'VoiceQueueId':_0x96be28[_0x2aefdc]['id'],'interface':_[_0x1326('0x65')](_0x28d831[_0x1326('0xac')])?util[_0x1326('0xad')](_0x1326('0xae'),_0x28d831[_0x1326('0x36')]):_0x28d831[_0x1326('0xac')],'paused':_0x28d831[_0x1326('0xa0')]||![],'penalty':_0x3bbad3[_0x1326('0x5d')]['penalty']||0x0});}return BPromise[_0x1326('0x8b')](_0x345bf9,function(_0x21a973){return db[_0x1326('0xaf')][_0x1326('0xb0')](_0x21a973);});}return _0x1e13f1;});}})['then'](respondWithStatusCode(_0x2bd36d,null))[_0x1326('0x1e')](handleError(_0x2bd36d,null));};exports[_0x1326('0xb1')]=function(_0x23b538,_0x4f5d29){var _0x526af2,_0x189ec1;return db[_0x1326('0x38')][_0x1326('0x5a')]({'where':{'id':_0x23b538['params']['id']},'attributes':['id','name',_0x1326('0x29')]})[_0x1326('0x13')](handleEntityNotFound(_0x4f5d29,null))[_0x1326('0x13')](function(_0x896af8){if(_0x896af8){_0x526af2=_0x896af8;if(!_0x23b538[_0x1326('0x3f')][_0x1326('0xb2')]||!utils[_0x1326('0xb3')](_0x23b538[_0x1326('0x3f')]['channel'])){throw new db[(_0x1326('0x91'))][(_0x1326('0x92'))](_0x1326('0xb4'));}return _0x896af8[_0x1326('0xb5')+_['capitalize'](_0x23b538[_0x1326('0x3f')][_0x1326('0xb2')][_0x1326('0xa3')]())+_0x1326('0xa4')](_0x23b538[_0x1326('0x3f')][_0x1326('0x5f')]);}})['then'](function(_0x5c44f1){if(_[_0x1326('0xb6')](_0x23b538[_0x1326('0x3f')][_0x1326('0x5f')])){for(var _0x523c26=0x0;_0x523c26<_0x23b538['query'][_0x1326('0x5f')]['length'];_0x523c26+=0x1){_0x189ec1={'UserId':Number(_0x23b538[_0x1326('0x4f')]['id'])};_0x189ec1[_['capitalize'](_0x23b538[_0x1326('0x3f')][_0x1326('0xb2')][_0x1326('0xa3')]())+_0x1326('0xa7')]=Number(_0x23b538['query'][_0x1326('0x5f')][_0x523c26]);socket[_0x1326('0xa8')](_0x1326('0x2c')+_['capitalize'](_0x23b538[_0x1326('0x3f')]['channel'][_0x1326('0xa3')]())+_0x1326('0xb7'),_0x189ec1);}}else{_0x189ec1={'UserId':Number(_0x23b538[_0x1326('0x4f')]['id'])};_0x189ec1[_[_0x1326('0xa2')](_0x23b538[_0x1326('0x3f')]['channel']['toLowerCase']())+_0x1326('0xa7')]=Number(_0x23b538[_0x1326('0x3f')][_0x1326('0x5f')]);socket[_0x1326('0xa8')](_0x1326('0x2c')+_[_0x1326('0xa2')](_0x23b538[_0x1326('0x3f')]['channel'][_0x1326('0xa3')]())+_0x1326('0xb7'),_0x189ec1);}return _0x5c44f1;})[_0x1326('0x13')](function(){if(_0x23b538[_0x1326('0x3f')]['channel']===_0x1326('0xaa')){return db[_0x1326('0xaf')][_0x1326('0x28')]({'where':{'UserId':_0x23b538[_0x1326('0x4f')]['id'],'VoiceQueueId':_0x23b538[_0x1326('0x3f')][_0x1326('0x5f')]},'individualHooks':!![]})[_0x1326('0x13')](function(){return _0x526af2;});}return _0x526af2;})[_0x1326('0x13')](respondWithStatusCode(_0x4f5d29,null))['catch'](handleError(_0x4f5d29,null));};exports['addAvatar']=function(_0x5a9326,_0xdb8b93){_0x5a9326[_0x1326('0x5d')][_0x1326('0xb8')]=_0x5a9326['file'][_0x1326('0xb9')];return db[_0x1326('0x38')][_0x1326('0x5a')]({'where':{'id':_0x5a9326['params']['id']}})[_0x1326('0x13')](handleEntityNotFound(_0xdb8b93,null))[_0x1326('0x13')](saveUpdates(_0x5a9326[_0x1326('0x5d')],null))['then'](respondWithResult(_0xdb8b93,null))[_0x1326('0x1e')](handleError(_0xdb8b93,null));};exports[_0x1326('0xba')]=function(_0x297823,_0x94c041){var _0x2e8163=path[_0x1326('0xbb')](config[_0x1326('0xbc')],_0x1326('0xbd'));return db[_0x1326('0x38')][_0x1326('0x5a')]({'where':{'id':_0x297823[_0x1326('0x4f')]['id']},'attributes':['id',_0x1326('0xb8')],'raw':!![]})[_0x1326('0x13')](handleEntityNotFound(_0x94c041,null))[_0x1326('0x13')](function(_0x46d6ab){if(_0x46d6ab){if(_[_0x1326('0x65')](_0x46d6ab['userpic'])){return _0x94c041[_0x1326('0xbe')](_0x2e8163);}else{if(!fs[_0x1326('0xbf')](path[_0x1326('0xbb')](config[_0x1326('0xbc')],_0x1326('0xc0'),_0x46d6ab[_0x1326('0xb8')]))){return _0x94c041['download'](_0x2e8163);}return _0x94c041[_0x1326('0xbe')](path[_0x1326('0xbb')](config[_0x1326('0xbc')],_0x1326('0xc0'),_0x46d6ab[_0x1326('0xb8')]));}}})[_0x1326('0x1e')](handleError(_0x94c041,null));};exports['getOpenTabs']=function(_0x1a9f9b,_0x134981){return db[_0x1326('0x38')][_0x1326('0x5a')]({'where':{'id':_0x1a9f9b['params']['id']},'attributes':['id']})[_0x1326('0x13')](handleEntityNotFound(_0x134981,null))[_0x1326('0x13')](function(_0x90feaa){var _0x3e7512=[];values=_0x90feaa['dataValues'];_0x3e7512[_0x1326('0x48')](get_open_tabs(_0x1326('0x49'),_0x90feaa[_0x1326('0x4b')]));_0x3e7512['push'](get_open_tabs(_0x1326('0x4a'),_0x90feaa[_0x1326('0x4b')]));_0x3e7512[_0x1326('0x48')](get_open_tabs(_0x1326('0x5b'),_0x90feaa[_0x1326('0x4b')]));_0x3e7512[_0x1326('0x48')](get_open_tabs(_0x1326('0x4c'),_0x90feaa[_0x1326('0x4b')]));_0x3e7512[_0x1326('0x48')](get_open_tabs('fax',_0x90feaa[_0x1326('0x4b')]));_0x3e7512[_0x1326('0x48')](get_open_tabs(_0x1326('0xc1'),_0x90feaa[_0x1326('0x4b')]));return BPromise[_0x1326('0x4d')](_0x3e7512);})[_0x1326('0x13')](function(_0x3f6512){if(_0x3f6512){var _0x5e291d=_[_0x1326('0x31')](values[_0x1326('0xc2')],function(_0x249849){return{'channel':_0x1326('0xc3'),'id':_0x249849['id'],'createdAt':_0x249849[_0x1326('0xc4')]};});var _0x6e57d0=_[_0x1326('0x31')](values[_0x1326('0xc5')],function(_0x2197a2){return{'channel':'FAX','id':_0x2197a2['id'],'createdAt':_0x2197a2[_0x1326('0xc4')]};});var _0x374889=_['map'](values[_0x1326('0xc6')],function(_0x311c42){return{'channel':_0x1326('0xc7'),'id':_0x311c42['id'],'createdAt':_0x311c42[_0x1326('0xc4')]};});var _0x36362a=_[_0x1326('0x31')](values['MailOpenTabs'],function(_0x42ea89){return{'channel':_0x1326('0xc8'),'id':_0x42ea89['id'],'createdAt':_0x42ea89[_0x1326('0xc4')]};});var _0x47ba71=_[_0x1326('0x31')](values['SmsOpenTabs'],function(_0x258be5){return{'channel':'SMS','id':_0x258be5['id'],'createdAt':_0x258be5['createdAt']};});var _0x57cb47=_[_0x1326('0x31')](values[_0x1326('0xc9')],function(_0x5114d7){return{'channel':_0x1326('0xca'),'id':_0x5114d7['id'],'createdAt':_0x5114d7[_0x1326('0xc4')]};});var _0x3e953c=_[_0x1326('0xcb')](_0x5e291d,_0x6e57d0,_0x374889,_0x36362a,_0x47ba71,_0x57cb47);var _0x11e03a={'count':_0x3e953c['length'],'rows':_0x3e953c};return _0x11e03a;}else return null;})[_0x1326('0x13')](respondWithResult(_0x134981,null))['catch'](handleError(_0x134981,null));};exports[_0x1326('0xcc')]=function(_0x298733,_0x425f91){var _0x744099={};var _0x58ecb0={};var _0x4b3746;var _0x489166;return db[_0x1326('0x38')][_0x1326('0xcd')]({'where':{'id':_0x298733[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x425f91,null))[_0x1326('0x13')](function(_0x158aca){if(_0x158aca){_0x4b3746=_0x158aca;_0x58ecb0[_0x1326('0x50')]=_[_0x1326('0x51')](db[_0x1326('0xce')]['rawAttributes']);_0x58ecb0['query']=_[_0x1326('0x51')](_0x298733['query']);_0x58ecb0[_0x1326('0x54')]=_[_0x1326('0x55')](_0x58ecb0[_0x1326('0x50')],_0x58ecb0[_0x1326('0x3f')]);_0x744099[_0x1326('0x44')]=_['intersection'](_0x58ecb0['model'],qs[_0x1326('0x56')](_0x298733[_0x1326('0x3f')][_0x1326('0x56')]));_0x744099[_0x1326('0x44')]=_0x744099['attributes'][_0x1326('0x47')]?_0x744099[_0x1326('0x44')]:_0x58ecb0[_0x1326('0x50')];_0x744099['order']=qs[_0x1326('0xcf')](_0x298733[_0x1326('0x3f')]['sort']);_0x744099[_0x1326('0x3e')]=qs[_0x1326('0x54')](_[_0x1326('0xd0')](_0x298733[_0x1326('0x3f')],_0x58ecb0[_0x1326('0x54')]));if(_0x298733[_0x1326('0x3f')][_0x1326('0x30')]){_0x744099[_0x1326('0x3e')]=_[_0x1326('0x58')](_0x744099['where'],{'$or':_[_0x1326('0x31')](_0x744099['attributes'],function(_0x1ac79b){var _0x4fdcaf={};_0x4fdcaf[_0x1ac79b]={'$like':'%'+_0x298733[_0x1326('0x3f')]['filter']+'%'};return _0x4fdcaf;})});}_0x744099=_[_0x1326('0x58')]({},_0x744099,_0x298733[_0x1326('0x59')]);return _0x4b3746['getContacts'](_0x744099);}})[_0x1326('0x13')](function(_0x19c110){if(_0x19c110){_0x489166=_0x19c110[_0x1326('0x47')];if(_0x298733[_0x1326('0x3f')][_0x1326('0xd1')](_0x1326('0x57'))){_0x744099[_0x1326('0x40')]=[{'model':db[_0x1326('0xd2')],'as':_0x1326('0xd3'),'required':![]},{'model':db[_0x1326('0xd4')],'as':_0x1326('0xd5'),'attributes':['id',_0x1326('0x36'),_0x1326('0xd6')],'where':_0x298733[_0x1326('0x3f')][_0x1326('0xd7')]?{'id':_0x298733[_0x1326('0x3f')][_0x1326('0xd7')]}:undefined,'required':_0x298733[_0x1326('0x3f')][_0x1326('0xd7')]?!![]:![]}];}if(!_0x298733[_0x1326('0x3f')][_0x1326('0xd1')](_0x1326('0xd8'))){_0x744099['limit']=qs[_0x1326('0x24')](_0x298733[_0x1326('0x3f')][_0x1326('0x24')]);_0x744099[_0x1326('0x21')]=qs['offset'](_0x298733[_0x1326('0x3f')][_0x1326('0x21')]);}return _0x4b3746[_0x1326('0xcc')](_0x744099);}})['then'](function(_0x4bbe44){if(_0x4bbe44){return _0x4bbe44?{'count':_0x489166,'rows':_0x4bbe44}:null;}})['then'](respondWithResult(_0x425f91,null))[_0x1326('0x1e')](handleError(_0x425f91,null));};exports['getQueues']=function(_0x432b9c,_0x2742ef){var _0x6d8a09;var _0x3f89c0={};var _0xdbe43f;return db[_0x1326('0x38')][_0x1326('0xcd')]({'where':{'id':_0x432b9c[_0x1326('0x4f')]['id']},'attributes':['id',_0x1326('0x36'),'role']})[_0x1326('0x13')](handleEntityNotFound(_0x2742ef,null))[_0x1326('0x13')](function(_0x402153){if(!utils[_0x1326('0xb3')](_0x432b9c[_0x1326('0x3f')][_0x1326('0xb2')])){throw new db[(_0x1326('0x91'))][(_0x1326('0x92'))](_0x1326('0xb4'));}_0x6d8a09=_0x402153;var _0x195119={};_0x195119[_0x1326('0x50')]=_[_0x1326('0x51')](db[_[_0x1326('0xa2')](_0x432b9c['query'][_0x1326('0xb2')])+_0x1326('0xd9')][_0x1326('0x52')]);_0x195119['query']=_[_0x1326('0x51')](_0x432b9c[_0x1326('0x3f')]);_0x195119[_0x1326('0x54')]=_[_0x1326('0x55')](_0x195119['model'],_0x195119['query']);_0x3f89c0[_0x1326('0x44')]=_[_0x1326('0x55')](_0x195119['model'],qs[_0x1326('0x56')](_0x432b9c[_0x1326('0x3f')][_0x1326('0x56')]));_0x3f89c0[_0x1326('0x44')]=_0x3f89c0['attributes'][_0x1326('0x47')]?_0x3f89c0['attributes']:_0x195119['model'];_0x3f89c0['order']=qs[_0x1326('0xcf')](_0x432b9c[_0x1326('0x3f')][_0x1326('0xcf')]);_0x3f89c0[_0x1326('0x3e')]=qs[_0x1326('0x54')](_['pick'](_0x432b9c['query'],_0x195119[_0x1326('0x54')]));if(_0x432b9c[_0x1326('0x3f')][_0x1326('0x30')]){_0x3f89c0['where']=_['merge'](_0x3f89c0[_0x1326('0x3e')],{'$or':_[_0x1326('0x31')](_0x3f89c0['attributes'],function(_0x11486c){var _0x1480e9={};_0x1480e9[_0x11486c]={'$like':'%'+_0x432b9c[_0x1326('0x3f')][_0x1326('0x30')]+'%'};return _0x1480e9;})});}_0x3f89c0=_[_0x1326('0x58')]({},_0x3f89c0,_0x432b9c['options']);switch(_0x6d8a09[_0x1326('0x29')]){case _0x1326('0x2a'):return db[_[_0x1326('0xa2')](_0x432b9c['query'][_0x1326('0xb2')])+'Queue'][_0x1326('0x45')](_0x3f89c0);case _0x1326('0x2c'):case _0x1326('0x2e'):return _0x6d8a09[_0x1326('0xda')+_[_0x1326('0xa2')](_0x432b9c['query']['channel'])+_0x1326('0xa4')](_0x3f89c0);default:throw new db['Sequelize']['ValidationError'](_0x1326('0xdb'));}})['then'](function(_0x3a9232){_0xdbe43f=_0x3a9232['length'];if(!_0x432b9c[_0x1326('0x3f')][_0x1326('0xd1')](_0x1326('0xd8'))){_0x3f89c0[_0x1326('0x24')]=qs[_0x1326('0x24')](_0x432b9c['query'][_0x1326('0x24')]);_0x3f89c0['offset']=qs[_0x1326('0x21')](_0x432b9c[_0x1326('0x3f')][_0x1326('0x21')]);}switch(_0x6d8a09['role']){case _0x1326('0x2a'):return db[_[_0x1326('0xa2')](_0x432b9c[_0x1326('0x3f')]['channel'])+_0x1326('0xd9')][_0x1326('0x45')](_0x3f89c0);case _0x1326('0x2c'):case _0x1326('0x2e'):return _0x6d8a09[_0x1326('0xda')+_[_0x1326('0xa2')](_0x432b9c[_0x1326('0x3f')]['channel'])+'Queues'](_0x3f89c0);}})['then'](function(_0x200560){return{'count':_0xdbe43f,'rows':_0x200560};})[_0x1326('0x13')](respondWithResult(_0x2742ef,null))['catch'](handleError(_0x2742ef,null));};exports[_0x1326('0xdc')]=function(_0x1b1c47,_0x1ee287){var _0x323956={};var _0x3ee5b9={};var _0x274bf2;var _0x2a23ea;return db[_0x1326('0x38')][_0x1326('0xcd')]({'where':{'id':_0x1b1c47['params']['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x1ee287,null))[_0x1326('0x13')](function(_0x5ac2aa){if(_0x5ac2aa){_0x274bf2=_0x5ac2aa;_0x3ee5b9[_0x1326('0x50')]=_[_0x1326('0x51')](db[_0x1326('0xaf')]['rawAttributes']);_0x3ee5b9['query']=_[_0x1326('0x51')](_0x1b1c47['query']);_0x3ee5b9[_0x1326('0x54')]=_[_0x1326('0x55')](_0x3ee5b9[_0x1326('0x50')],_0x3ee5b9[_0x1326('0x3f')]);_0x323956[_0x1326('0x44')]=_[_0x1326('0x55')](_0x3ee5b9[_0x1326('0x50')],qs[_0x1326('0x56')](_0x1b1c47['query'][_0x1326('0x56')]));_0x323956[_0x1326('0x44')]=_0x323956['attributes'][_0x1326('0x47')]?_0x323956[_0x1326('0x44')]:_0x3ee5b9['model'];_0x323956[_0x1326('0xdd')]=qs[_0x1326('0xcf')](_0x1b1c47['query'][_0x1326('0xcf')]);_0x323956[_0x1326('0x3e')]=qs[_0x1326('0x54')](_[_0x1326('0xd0')](_0x1b1c47['query'],_0x3ee5b9[_0x1326('0x54')]));if(_0x1b1c47[_0x1326('0x3f')][_0x1326('0x30')]){_0x323956[_0x1326('0x3e')]=_['merge'](_0x323956[_0x1326('0x3e')],{'$or':_[_0x1326('0x31')](_0x323956[_0x1326('0x44')],function(_0x16ccda){var _0x54ceae={};_0x54ceae[_0x16ccda]={'$like':'%'+_0x1b1c47[_0x1326('0x3f')][_0x1326('0x30')]+'%'};return _0x54ceae;})});}_0x323956=_[_0x1326('0x58')]({},_0x323956,_0x1b1c47[_0x1326('0x59')]);return _0x274bf2[_0x1326('0xdc')](_0x323956);}})[_0x1326('0x13')](function(_0x5513bf){if(_0x5513bf){_0x2a23ea=_0x5513bf['length'];if(!_0x1b1c47[_0x1326('0x3f')][_0x1326('0xd1')](_0x1326('0xd8'))){_0x323956['limit']=qs[_0x1326('0x24')](_0x1b1c47[_0x1326('0x3f')][_0x1326('0x24')]);_0x323956[_0x1326('0x21')]=qs['offset'](_0x1b1c47[_0x1326('0x3f')][_0x1326('0x21')]);}return _0x274bf2[_0x1326('0xdc')](_0x323956);}})['then'](function(_0x1d1ed5){if(_0x1d1ed5){return _0x1d1ed5?{'count':_0x2a23ea,'rows':_0x1d1ed5}:null;}})[_0x1326('0x13')](respondWithResult(_0x1ee287,null))[_0x1326('0x1e')](handleError(_0x1ee287,null));};exports[_0x1326('0xde')]=function(_0x1bb31e,_0x55324f){var _0x10e4eb={};var _0x2f15cc={};var _0xaecf5e;var _0x108648;return db[_0x1326('0x38')][_0x1326('0xcd')]({'where':{'id':_0x1bb31e[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x55324f,null))[_0x1326('0x13')](function(_0x15a867){if(_0x15a867){_0xaecf5e=_0x15a867;_0x2f15cc[_0x1326('0x50')]=_[_0x1326('0x51')](db[_0x1326('0xdf')][_0x1326('0x52')]);_0x2f15cc[_0x1326('0x3f')]=_[_0x1326('0x51')](_0x1bb31e[_0x1326('0x3f')]);_0x2f15cc[_0x1326('0x54')]=_[_0x1326('0x55')](_0x2f15cc['model'],_0x2f15cc[_0x1326('0x3f')]);_0x10e4eb[_0x1326('0x44')]=_[_0x1326('0x55')](_0x2f15cc[_0x1326('0x50')],qs['fields'](_0x1bb31e['query'][_0x1326('0x56')]));_0x10e4eb['attributes']=_0x10e4eb[_0x1326('0x44')][_0x1326('0x47')]?_0x10e4eb[_0x1326('0x44')]:_0x2f15cc[_0x1326('0x50')];_0x10e4eb[_0x1326('0xdd')]=qs[_0x1326('0xcf')](_0x1bb31e['query'][_0x1326('0xcf')]);_0x10e4eb['where']=qs[_0x1326('0x54')](_[_0x1326('0xd0')](_0x1bb31e['query'],_0x2f15cc[_0x1326('0x54')]));if(_0x1bb31e['query'][_0x1326('0x30')]){_0x10e4eb['where']=_[_0x1326('0x58')](_0x10e4eb[_0x1326('0x3e')],{'$or':_[_0x1326('0x31')](_0x10e4eb[_0x1326('0x44')],function(_0x53f73b){var _0x44d16f={};_0x44d16f[_0x53f73b]={'$like':'%'+_0x1bb31e[_0x1326('0x3f')][_0x1326('0x30')]+'%'};return _0x44d16f;})});}_0x10e4eb=_[_0x1326('0x58')]({},_0x10e4eb,_0x1bb31e[_0x1326('0x59')]);return _0xaecf5e[_0x1326('0xde')](_0x10e4eb);}})['then'](function(_0xa21191){if(_0xa21191){_0x108648=_0xa21191[_0x1326('0x47')];if(!_0x1bb31e['query']['hasOwnProperty'](_0x1326('0xd8'))){_0x10e4eb[_0x1326('0x24')]=qs[_0x1326('0x24')](_0x1bb31e[_0x1326('0x3f')][_0x1326('0x24')]);_0x10e4eb[_0x1326('0x21')]=qs['offset'](_0x1bb31e[_0x1326('0x3f')][_0x1326('0x21')]);}return _0xaecf5e[_0x1326('0xde')](_0x10e4eb);}})['then'](function(_0xbcdb1c){if(_0xbcdb1c){return _0xbcdb1c?{'count':_0x108648,'rows':_0xbcdb1c}:null;}})[_0x1326('0x13')](respondWithResult(_0x55324f,null))[_0x1326('0x1e')](handleError(_0x55324f,null));};exports[_0x1326('0xe0')]=function(_0x5e2cfb,_0x50874d){var _0xca965={'raw':!![],'where':{}};var _0x5d231e={};var _0x2059a7={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x5e2cfb[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x50874d,null))['then'](function(_0x408a16){if(_0x408a16){_0x5d231e[_0x1326('0x50')]=_['keys'](db[_0x1326('0xe1')][_0x1326('0x52')]);_0x5d231e[_0x1326('0x3f')]=_[_0x1326('0x51')](_0x5e2cfb['query']);_0x5d231e[_0x1326('0x54')]=_[_0x1326('0x55')](_0x5d231e[_0x1326('0x50')],_0x5d231e[_0x1326('0x3f')]);_0xca965[_0x1326('0x44')]=_[_0x1326('0x55')](_0x5d231e[_0x1326('0x50')],qs['fields'](_0x5e2cfb[_0x1326('0x3f')][_0x1326('0x56')]));_0xca965[_0x1326('0x44')]=_0xca965[_0x1326('0x44')][_0x1326('0x47')]?_0xca965[_0x1326('0x44')]:_0x5d231e['model'];if(!_0x5e2cfb['query'][_0x1326('0xd1')](_0x1326('0xd8'))){_0xca965[_0x1326('0x24')]=qs['limit'](_0x5e2cfb[_0x1326('0x3f')][_0x1326('0x24')]);_0xca965[_0x1326('0x21')]=qs[_0x1326('0x21')](_0x5e2cfb[_0x1326('0x3f')][_0x1326('0x21')]);}_0xca965[_0x1326('0xdd')]=qs[_0x1326('0xcf')](_0x5e2cfb['query'][_0x1326('0xcf')]);_0xca965[_0x1326('0x3e')]=qs[_0x1326('0x54')](_[_0x1326('0xd0')](_0x5e2cfb['query'],_0x5d231e[_0x1326('0x54')]));_0xca965['where'][_0x1326('0xe2')]=_0x408a16['id'];if(_0x5e2cfb[_0x1326('0x3f')][_0x1326('0x30')]){_0xca965['where']=_['merge'](_0xca965[_0x1326('0x3e')],{'$or':_[_0x1326('0x31')](_0xca965['attributes'],function(_0xa1dbb2){var _0x49ded2={};_0x49ded2[_0xa1dbb2]={'$like':'%'+_0x5e2cfb[_0x1326('0x3f')]['filter']+'%'};return _0x49ded2;})});}_0xca965=_[_0x1326('0x58')]({},_0xca965,_0x5e2cfb[_0x1326('0x59')]);return db[_0x1326('0xe1')]['count']({'where':_0xca965[_0x1326('0x3e')]})[_0x1326('0x13')](function(_0x494703){_0x2059a7['count']=_0x494703;if(_0x5e2cfb[_0x1326('0x3f')][_0x1326('0x57')]){_0xca965['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x1326('0x45')](_0xca965);})[_0x1326('0x13')](function(_0x10aac8){_0x2059a7[_0x1326('0x46')]=_0x10aac8;return _0x2059a7;});}})[_0x1326('0x13')](respondWithFilteredResult(_0x50874d,_0xca965))[_0x1326('0x1e')](handleError(_0x50874d,null));};exports[_0x1326('0xe3')]=function(_0x19b148,_0x5a5ff6){var _0x41eb17={'raw':!![],'where':{}};var _0xdef9f3={};var _0xc07cc={'count':0x0,'rows':[]};return db[_0x1326('0x38')][_0x1326('0xcd')]({'where':{'id':_0x19b148[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x5a5ff6,null))[_0x1326('0x13')](function(_0x356f34){if(_0x356f34){_0xdef9f3['model']=_[_0x1326('0x51')](db['ScreenRecording'][_0x1326('0x52')]);_0xdef9f3[_0x1326('0x3f')]=_[_0x1326('0x51')](_0x19b148[_0x1326('0x3f')]);_0xdef9f3[_0x1326('0x54')]=_['intersection'](_0xdef9f3[_0x1326('0x50')],_0xdef9f3[_0x1326('0x3f')]);_0x41eb17[_0x1326('0x44')]=_[_0x1326('0x55')](_0xdef9f3[_0x1326('0x50')],qs[_0x1326('0x56')](_0x19b148[_0x1326('0x3f')][_0x1326('0x56')]));_0x41eb17[_0x1326('0x44')]=_0x41eb17[_0x1326('0x44')]['length']?_0x41eb17['attributes']:_0xdef9f3[_0x1326('0x50')];if(!_0x19b148[_0x1326('0x3f')][_0x1326('0xd1')](_0x1326('0xd8'))){_0x41eb17['limit']=qs[_0x1326('0x24')](_0x19b148['query'][_0x1326('0x24')]);_0x41eb17['offset']=qs['offset'](_0x19b148[_0x1326('0x3f')][_0x1326('0x21')]);}_0x41eb17[_0x1326('0xdd')]=qs[_0x1326('0xcf')](_0x19b148['query'][_0x1326('0xcf')]);_0x41eb17[_0x1326('0x3e')]=qs[_0x1326('0x54')](_[_0x1326('0xd0')](_0x19b148[_0x1326('0x3f')],_0xdef9f3[_0x1326('0x54')]));_0x41eb17[_0x1326('0x3e')]['UserId']=_0x356f34['id'];if(_0x19b148[_0x1326('0x3f')][_0x1326('0x30')]){_0x41eb17['where']=_['merge'](_0x41eb17['where'],{'$or':_[_0x1326('0x31')](_0x41eb17[_0x1326('0x44')],function(_0x3af6f1){var _0x32b649={};_0x32b649[_0x3af6f1]={'$like':'%'+_0x19b148[_0x1326('0x3f')]['filter']+'%'};return _0x32b649;})});}_0x41eb17=_['merge']({},_0x41eb17,_0x19b148[_0x1326('0x59')]);return db[_0x1326('0xe4')][_0x1326('0x23')]({'where':_0x41eb17[_0x1326('0x3e')]})[_0x1326('0x13')](function(_0x4fa1c5){_0xc07cc[_0x1326('0x23')]=_0x4fa1c5;if(_0x19b148[_0x1326('0x3f')][_0x1326('0x57')]){_0x41eb17['include']=[{'all':!![]}];}return db[_0x1326('0xe4')]['findAll'](_0x41eb17);})[_0x1326('0x13')](function(_0x117670){_0xc07cc[_0x1326('0x46')]=_0x117670;return _0xc07cc;});}})[_0x1326('0x13')](respondWithFilteredResult(_0x5a5ff6,_0x41eb17))['catch'](handleError(_0x5a5ff6,null));};exports['getChatInteractions']=function(_0x5c0785,_0x449519){var _0x54e57c={};var _0x7b04a7={};var _0x363f4c;var _0x24eaa8;return db[_0x1326('0x38')]['findOne']({'where':{'id':_0x5c0785['params']['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x449519,null))['then'](function(_0x3dc3fb){if(_0x3dc3fb){_0x363f4c=_0x3dc3fb;_0x7b04a7['model']=_[_0x1326('0x51')](db[_0x1326('0xe5')][_0x1326('0x52')]);_0x7b04a7[_0x1326('0x3f')]=_[_0x1326('0x51')](_0x5c0785['query']);_0x7b04a7[_0x1326('0x54')]=_[_0x1326('0x55')](_0x7b04a7[_0x1326('0x50')],_0x7b04a7[_0x1326('0x3f')]);_0x54e57c['attributes']=_['intersection'](_0x7b04a7['model'],qs[_0x1326('0x56')](_0x5c0785[_0x1326('0x3f')][_0x1326('0x56')]));_0x54e57c[_0x1326('0x44')]=_0x54e57c[_0x1326('0x44')][_0x1326('0x47')]?_0x54e57c[_0x1326('0x44')]:_0x7b04a7[_0x1326('0x50')];_0x54e57c['order']=qs[_0x1326('0xcf')](_0x5c0785['query']['sort']);_0x54e57c[_0x1326('0x3e')]=qs[_0x1326('0x54')](_[_0x1326('0xd0')](_0x5c0785[_0x1326('0x3f')],_0x7b04a7['filters']));if(_0x5c0785[_0x1326('0x3f')][_0x1326('0x30')]){_0x54e57c[_0x1326('0x3e')]=_['merge'](_0x54e57c[_0x1326('0x3e')],{'$or':_['map'](_0x54e57c[_0x1326('0x44')],function(_0x479276){var _0x1421a7={};_0x1421a7[_0x479276]={'$like':'%'+_0x5c0785[_0x1326('0x3f')]['filter']+'%'};return _0x1421a7;})});}_0x54e57c=_[_0x1326('0x58')]({},_0x54e57c,_0x5c0785[_0x1326('0x59')]);return _0x363f4c['getChatInteractions'](_0x54e57c);}})[_0x1326('0x13')](function(_0xf3b45){if(_0xf3b45){_0x24eaa8=_0xf3b45[_0x1326('0x47')];if(!_0x5c0785[_0x1326('0x3f')][_0x1326('0xd1')](_0x1326('0xd8'))){_0x54e57c['limit']=qs[_0x1326('0x24')](_0x5c0785[_0x1326('0x3f')]['limit']);_0x54e57c[_0x1326('0x21')]=qs[_0x1326('0x21')](_0x5c0785['query'][_0x1326('0x21')]);}return _0x363f4c[_0x1326('0xe6')](_0x54e57c);}})['then'](function(_0x2a89c3){if(_0x2a89c3){return _0x2a89c3?{'count':_0x24eaa8,'rows':_0x2a89c3}:null;}})['then'](respondWithResult(_0x449519,null))[_0x1326('0x1e')](handleError(_0x449519,null));};exports[_0x1326('0xe7')]=function(_0x4cb4d4,_0x16b195){var _0x2dcc0f={};var _0xbc8c1={};var _0x1ccbdb;var _0x5a3284;return db[_0x1326('0x38')]['findOne']({'where':{'id':_0x4cb4d4[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x16b195,null))[_0x1326('0x13')](function(_0x19b180){if(_0x19b180){_0x1ccbdb=_0x19b180;_0xbc8c1[_0x1326('0x50')]=_[_0x1326('0x51')](db[_0x1326('0xe8')][_0x1326('0x52')]);_0xbc8c1[_0x1326('0x3f')]=_[_0x1326('0x51')](_0x4cb4d4[_0x1326('0x3f')]);_0xbc8c1[_0x1326('0x54')]=_[_0x1326('0x55')](_0xbc8c1[_0x1326('0x50')],_0xbc8c1[_0x1326('0x3f')]);_0x2dcc0f[_0x1326('0x44')]=_[_0x1326('0x55')](_0xbc8c1['model'],qs[_0x1326('0x56')](_0x4cb4d4[_0x1326('0x3f')]['fields']));_0x2dcc0f[_0x1326('0x44')]=_0x2dcc0f[_0x1326('0x44')][_0x1326('0x47')]?_0x2dcc0f['attributes']:_0xbc8c1[_0x1326('0x50')];_0x2dcc0f[_0x1326('0xdd')]=qs[_0x1326('0xcf')](_0x4cb4d4[_0x1326('0x3f')]['sort']);_0x2dcc0f[_0x1326('0x3e')]=qs['filters'](_['pick'](_0x4cb4d4[_0x1326('0x3f')],_0xbc8c1[_0x1326('0x54')]));if(_0x4cb4d4[_0x1326('0x3f')][_0x1326('0x30')]){_0x2dcc0f['where']=_[_0x1326('0x58')](_0x2dcc0f[_0x1326('0x3e')],{'$or':_['map'](_0x2dcc0f[_0x1326('0x44')],function(_0x4177df){var _0x4cd4fe={};_0x4cd4fe[_0x4177df]={'$like':'%'+_0x4cb4d4[_0x1326('0x3f')][_0x1326('0x30')]+'%'};return _0x4cd4fe;})});}_0x2dcc0f=_[_0x1326('0x58')]({},_0x2dcc0f,_0x4cb4d4['options']);return _0x1ccbdb[_0x1326('0xe7')](_0x2dcc0f);}})[_0x1326('0x13')](function(_0x3da19b){if(_0x3da19b){_0x5a3284=_0x3da19b[_0x1326('0x47')];if(!_0x4cb4d4[_0x1326('0x3f')][_0x1326('0xd1')](_0x1326('0xd8'))){_0x2dcc0f['limit']=qs[_0x1326('0x24')](_0x4cb4d4[_0x1326('0x3f')]['limit']);_0x2dcc0f[_0x1326('0x21')]=qs[_0x1326('0x21')](_0x4cb4d4[_0x1326('0x3f')][_0x1326('0x21')]);}return _0x1ccbdb[_0x1326('0xe7')](_0x2dcc0f);}})[_0x1326('0x13')](function(_0x10a6a5){if(_0x10a6a5){return _0x10a6a5?{'count':_0x5a3284,'rows':_0x10a6a5}:null;}})['then'](respondWithResult(_0x16b195,null))[_0x1326('0x1e')](handleError(_0x16b195,null));};exports[_0x1326('0xe9')]=function(_0x73a7d0,_0x5b2c21){var _0x549821={'raw':!![],'where':{}};var _0x5cee4f={};var _0x4af2c8={'count':0x0,'rows':[]};return db[_0x1326('0x38')]['findOne']({'where':{'id':_0x73a7d0[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x5b2c21,null))[_0x1326('0x13')](function(_0x281966){if(_0x281966){_0x5cee4f[_0x1326('0x50')]=_['keys'](db[_0x1326('0xea')][_0x1326('0x52')]);_0x5cee4f[_0x1326('0x3f')]=_[_0x1326('0x51')](_0x73a7d0['query']);_0x5cee4f[_0x1326('0x54')]=_[_0x1326('0x55')](_0x5cee4f[_0x1326('0x50')],_0x5cee4f[_0x1326('0x3f')]);_0x549821[_0x1326('0x44')]=_[_0x1326('0x55')](_0x5cee4f[_0x1326('0x50')],qs[_0x1326('0x56')](_0x73a7d0[_0x1326('0x3f')][_0x1326('0x56')]));_0x549821['attributes']=_0x549821[_0x1326('0x44')][_0x1326('0x47')]?_0x549821['attributes']:_0x5cee4f[_0x1326('0x50')];if(!_0x73a7d0[_0x1326('0x3f')][_0x1326('0xd1')]('nolimit')){_0x549821[_0x1326('0x24')]=qs[_0x1326('0x24')](_0x73a7d0[_0x1326('0x3f')][_0x1326('0x24')]);_0x549821[_0x1326('0x21')]=qs['offset'](_0x73a7d0['query'][_0x1326('0x21')]);}_0x549821[_0x1326('0xdd')]=qs[_0x1326('0xcf')](_0x73a7d0[_0x1326('0x3f')][_0x1326('0xcf')]);_0x549821[_0x1326('0x3e')]=qs[_0x1326('0x54')](_[_0x1326('0xd0')](_0x73a7d0[_0x1326('0x3f')],_0x5cee4f[_0x1326('0x54')]));_0x549821[_0x1326('0x3e')][_0x1326('0xe2')]=_0x281966['id'];if(_0x73a7d0[_0x1326('0x3f')][_0x1326('0x30')]){_0x549821[_0x1326('0x3e')]=_[_0x1326('0x58')](_0x549821[_0x1326('0x3e')],{'$or':_[_0x1326('0x31')](_0x549821[_0x1326('0x44')],function(_0x5563ce){var _0x2535e0={};_0x2535e0[_0x5563ce]={'$like':'%'+_0x73a7d0[_0x1326('0x3f')]['filter']+'%'};return _0x2535e0;})});}_0x549821=_['merge']({},_0x549821,_0x73a7d0['options']);return db[_0x1326('0xea')][_0x1326('0x23')]({'where':_0x549821[_0x1326('0x3e')]})[_0x1326('0x13')](function(_0x2155b5){_0x4af2c8[_0x1326('0x23')]=_0x2155b5;if(_0x73a7d0[_0x1326('0x3f')][_0x1326('0x57')]){_0x549821[_0x1326('0x40')]=[{'all':!![]}];}return db['MailInteraction'][_0x1326('0x45')](_0x549821);})[_0x1326('0x13')](function(_0x5676a5){_0x4af2c8['rows']=_0x5676a5;return _0x4af2c8;});}})[_0x1326('0x13')](respondWithFilteredResult(_0x5b2c21,_0x549821))[_0x1326('0x1e')](handleError(_0x5b2c21,null));};exports['getSmsInteractions']=function(_0x1cf903,_0x3780c2){var _0x59cdb4={};var _0x3349ea={};var _0x23c169;var _0x3b39b1;return db[_0x1326('0x38')][_0x1326('0xcd')]({'where':{'id':_0x1cf903[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x3780c2,null))[_0x1326('0x13')](function(_0x54b1df){if(_0x54b1df){_0x23c169=_0x54b1df;_0x3349ea['model']=_['keys'](db[_0x1326('0xeb')][_0x1326('0x52')]);_0x3349ea[_0x1326('0x3f')]=_['keys'](_0x1cf903[_0x1326('0x3f')]);_0x3349ea[_0x1326('0x54')]=_[_0x1326('0x55')](_0x3349ea[_0x1326('0x50')],_0x3349ea[_0x1326('0x3f')]);_0x59cdb4['attributes']=_[_0x1326('0x55')](_0x3349ea[_0x1326('0x50')],qs[_0x1326('0x56')](_0x1cf903['query'][_0x1326('0x56')]));_0x59cdb4['attributes']=_0x59cdb4['attributes']['length']?_0x59cdb4[_0x1326('0x44')]:_0x3349ea['model'];_0x59cdb4[_0x1326('0xdd')]=qs[_0x1326('0xcf')](_0x1cf903[_0x1326('0x3f')][_0x1326('0xcf')]);_0x59cdb4[_0x1326('0x3e')]=qs[_0x1326('0x54')](_[_0x1326('0xd0')](_0x1cf903['query'],_0x3349ea['filters']));if(_0x1cf903[_0x1326('0x3f')][_0x1326('0x30')]){_0x59cdb4['where']=_['merge'](_0x59cdb4[_0x1326('0x3e')],{'$or':_[_0x1326('0x31')](_0x59cdb4['attributes'],function(_0x1d80ef){var _0x819138={};_0x819138[_0x1d80ef]={'$like':'%'+_0x1cf903[_0x1326('0x3f')]['filter']+'%'};return _0x819138;})});}_0x59cdb4=_[_0x1326('0x58')]({},_0x59cdb4,_0x1cf903[_0x1326('0x59')]);return _0x23c169['getSmsInteractions'](_0x59cdb4);}})['then'](function(_0xf58951){if(_0xf58951){_0x3b39b1=_0xf58951['length'];if(!_0x1cf903[_0x1326('0x3f')][_0x1326('0xd1')](_0x1326('0xd8'))){_0x59cdb4[_0x1326('0x24')]=qs['limit'](_0x1cf903[_0x1326('0x3f')]['limit']);_0x59cdb4['offset']=qs[_0x1326('0x21')](_0x1cf903['query'][_0x1326('0x21')]);}return _0x23c169[_0x1326('0xec')](_0x59cdb4);}})['then'](function(_0x531317){if(_0x531317){return _0x531317?{'count':_0x3b39b1,'rows':_0x531317}:null;}})[_0x1326('0x13')](respondWithResult(_0x3780c2,null))[_0x1326('0x1e')](handleError(_0x3780c2,null));};exports[_0x1326('0xed')]=function(_0x100be3,_0x175260){var _0x2b567f={};var _0x3a4a72={};var _0x52b434;var _0x4973f5;return db[_0x1326('0x38')][_0x1326('0xcd')]({'where':{'id':_0x100be3['params']['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x175260,null))['then'](function(_0x28cc69){if(_0x28cc69){_0x52b434=_0x28cc69;_0x3a4a72['model']=_[_0x1326('0x51')](db[_0x1326('0xee')][_0x1326('0x52')]);_0x3a4a72[_0x1326('0x3f')]=_[_0x1326('0x51')](_0x100be3[_0x1326('0x3f')]);_0x3a4a72['filters']=_['intersection'](_0x3a4a72[_0x1326('0x50')],_0x3a4a72[_0x1326('0x3f')]);_0x2b567f[_0x1326('0x44')]=_[_0x1326('0x55')](_0x3a4a72[_0x1326('0x50')],qs['fields'](_0x100be3['query'][_0x1326('0x56')]));_0x2b567f['attributes']=_0x2b567f[_0x1326('0x44')][_0x1326('0x47')]?_0x2b567f[_0x1326('0x44')]:_0x3a4a72[_0x1326('0x50')];_0x2b567f['order']=qs[_0x1326('0xcf')](_0x100be3['query'][_0x1326('0xcf')]);_0x2b567f[_0x1326('0x3e')]=qs[_0x1326('0x54')](_[_0x1326('0xd0')](_0x100be3[_0x1326('0x3f')],_0x3a4a72['filters']));if(_0x100be3[_0x1326('0x3f')]['filter']){_0x2b567f[_0x1326('0x3e')]=_[_0x1326('0x58')](_0x2b567f[_0x1326('0x3e')],{'$or':_[_0x1326('0x31')](_0x2b567f[_0x1326('0x44')],function(_0x8eae57){var _0x2bf2bf={};_0x2bf2bf[_0x8eae57]={'$like':'%'+_0x100be3[_0x1326('0x3f')][_0x1326('0x30')]+'%'};return _0x2bf2bf;})});}_0x2b567f=_['merge']({},_0x2b567f,_0x100be3[_0x1326('0x59')]);return _0x52b434[_0x1326('0xed')](_0x2b567f);}})['then'](function(_0x4fe245){if(_0x4fe245){_0x4973f5=_0x4fe245['length'];if(!_0x100be3[_0x1326('0x3f')]['hasOwnProperty'](_0x1326('0xd8'))){_0x2b567f[_0x1326('0x24')]=qs['limit'](_0x100be3[_0x1326('0x3f')][_0x1326('0x24')]);_0x2b567f[_0x1326('0x21')]=qs['offset'](_0x100be3[_0x1326('0x3f')][_0x1326('0x21')]);}return _0x52b434[_0x1326('0xed')](_0x2b567f);}})[_0x1326('0x13')](function(_0x528443){if(_0x528443){return _0x528443?{'count':_0x4973f5,'rows':_0x528443}:null;}})[_0x1326('0x13')](respondWithResult(_0x175260,null))[_0x1326('0x1e')](handleError(_0x175260,null));};exports['getWhatsappInteractions']=function(_0x4ca029,_0x355477){var _0x34e327={};var _0x156c18={};var _0x31500a;var _0x478384;return db[_0x1326('0x38')][_0x1326('0xcd')]({'where':{'id':_0x4ca029[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x355477,null))[_0x1326('0x13')](function(_0x33b59c){if(_0x33b59c){_0x31500a=_0x33b59c;_0x156c18[_0x1326('0x50')]=_[_0x1326('0x51')](db['WhatsappInteraction'][_0x1326('0x52')]);_0x156c18[_0x1326('0x3f')]=_[_0x1326('0x51')](_0x4ca029['query']);_0x156c18[_0x1326('0x54')]=_[_0x1326('0x55')](_0x156c18[_0x1326('0x50')],_0x156c18[_0x1326('0x3f')]);_0x34e327[_0x1326('0x44')]=_[_0x1326('0x55')](_0x156c18[_0x1326('0x50')],qs[_0x1326('0x56')](_0x4ca029[_0x1326('0x3f')]['fields']));_0x34e327[_0x1326('0x44')]=_0x34e327['attributes']['length']?_0x34e327[_0x1326('0x44')]:_0x156c18[_0x1326('0x50')];_0x34e327[_0x1326('0xdd')]=qs[_0x1326('0xcf')](_0x4ca029[_0x1326('0x3f')][_0x1326('0xcf')]);_0x34e327[_0x1326('0x3e')]=qs[_0x1326('0x54')](_[_0x1326('0xd0')](_0x4ca029['query'],_0x156c18[_0x1326('0x54')]));if(_0x4ca029[_0x1326('0x3f')]['filter']){_0x34e327[_0x1326('0x3e')]=_[_0x1326('0x58')](_0x34e327[_0x1326('0x3e')],{'$or':_['map'](_0x34e327['attributes'],function(_0x6d2f32){var _0x32de0d={};_0x32de0d[_0x6d2f32]={'$like':'%'+_0x4ca029[_0x1326('0x3f')][_0x1326('0x30')]+'%'};return _0x32de0d;})});}_0x34e327=_[_0x1326('0x58')]({},_0x34e327,_0x4ca029[_0x1326('0x59')]);return _0x31500a[_0x1326('0xef')](_0x34e327);}})['then'](function(_0xaa59ca){if(_0xaa59ca){_0x478384=_0xaa59ca[_0x1326('0x47')];if(!_0x4ca029[_0x1326('0x3f')][_0x1326('0xd1')]('nolimit')){_0x34e327[_0x1326('0x24')]=qs[_0x1326('0x24')](_0x4ca029[_0x1326('0x3f')][_0x1326('0x24')]);_0x34e327[_0x1326('0x21')]=qs[_0x1326('0x21')](_0x4ca029[_0x1326('0x3f')][_0x1326('0x21')]);}return _0x31500a[_0x1326('0xef')](_0x34e327);}})[_0x1326('0x13')](function(_0x45b589){if(_0x45b589){return _0x45b589?{'count':_0x478384,'rows':_0x45b589}:null;}})['then'](respondWithResult(_0x355477,null))[_0x1326('0x1e')](handleError(_0x355477,null));};exports[_0x1326('0xf0')]=function(_0x51d317,_0x106973,_0x229bf5){var _0x56f9ba;var _0x418081;var _0x5dd1af;var _0x4e57e3=!_[_0x1326('0x65')](_0x51d317['params']['id'])?_0x51d317['params']['id']:!_[_0x1326('0x65')](_0x51d317[_0x1326('0x2c')]['id'])?_0x51d317[_0x1326('0x2c')]['id']:null;return db[_0x1326('0x38')][_0x1326('0x5a')]({'where':{'id':_0x4e57e3,'role':{'$or':['admin','user','agent']}},'attributes':['id',_0x1326('0x36'),_0x1326('0xf1'),_0x1326('0xf2'),_0x1326('0x29'),_0x1326('0x61'),_0x1326('0x9f')]})[_0x1326('0x13')](function(_0x51b38c){if(_0x51b38c){if(_0x51b38c[_0x1326('0x29')]===_0x1326('0x2e')){_0x56f9ba=_0x51b38c;if(_0x51d317[_0x1326('0x5d')][_0x1326('0xac')]){_0x5dd1af=util[_0x1326('0xad')](_0x1326('0xf3'),_0x56f9ba[_0x51d317[_0x1326('0x5d')][_0x1326('0xac')]]);}else if(_0x51d317['body'][_0x1326('0xf4')]){_0x5dd1af=util[_0x1326('0xad')]('SIP/%s',_0x51d317['body'][_0x1326('0xf4')]);}else{_0x5dd1af=util[_0x1326('0xad')](_0x1326('0xae'),_0x56f9ba['name']);}socket['to'](util[_0x1326('0xad')](_0x1326('0xf5'),_0x56f9ba[_0x1326('0x36')]))[_0x1326('0xa8')](_0x1326('0xf6'),{'user':{'id':_0x56f9ba['id'],'name':_0x56f9ba['name']},'ip':_0x51d317[_0x1326('0xf7')][_0x1326('0xf8')]||_0x51d317[_0x1326('0xf9')]['remoteAddress']||_0x51d317[_0x1326('0xfa')][_0x1326('0xfb')]||_0x51d317[_0x1326('0xf9')][_0x1326('0xfa')][_0x1326('0xfb')]});return db[_0x1326('0xaf')][_0x1326('0x28')]({'where':{'membername':_0x56f9ba['name']},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x1326('0x92'))](_0x1326('0xfc'));}})[_0x1326('0x13')](function(){if(_0x56f9ba){return _0x56f9ba[_0x1326('0xfd')]({'raw':!![]});}})[_0x1326('0x13')](function(_0x1749ee){if(_0x56f9ba){var _0x540029=[];if(_0x1749ee){_0x418081=_0x1749ee;if(_0x418081['length']){for(var _0x32fda0=0x0;_0x32fda0<_0x418081['length'];_0x32fda0++){_0x540029[_0x1326('0x48')]({'membername':_0x56f9ba[_0x1326('0x36')],'UserId':_0x56f9ba['id'],'queue_name':_0x418081[_0x32fda0]['name'],'VoiceQueueId':_0x418081[_0x32fda0]['id'],'interface':_0x5dd1af,'paused':_0x56f9ba[_0x1326('0x9f')]||![],'penalty':_0x418081[_0x32fda0]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x1326('0x8b')](_0x540029,function(_0x4ba84b){return db[_0x1326('0xaf')][_0x1326('0xb0')](_0x4ba84b);});}}}})[_0x1326('0x13')](function(){if(_0x56f9ba){return db[_0x1326('0xfe')]['findAll']({'where':{'membername':_0x56f9ba[_0x1326('0x36')],'exitAt':null}});}})[_0x1326('0x13')](function(_0x24f65a){if(_0x56f9ba){var _0x31fd0e=[];_0x24f65a[_0x1326('0xff')](function(_0x2d1d9f){_0x31fd0e[_0x1326('0x48')](_0x2d1d9f[_0x1326('0x27')]({'exitAt':moment()[_0x1326('0xad')](_0x1326('0x100'))}));});return BPromise['all'](_0x31fd0e);}})[_0x1326('0x13')](function(){if(_0x56f9ba){var _0x58e7fc=[];var _0x336f14=[];var _0x3807ba=utils[_0x1326('0x101')]();var _0x4254dc={'membername':_0x56f9ba[_0x1326('0x36')],'interface':_0x5dd1af,'enterAt':moment()[_0x1326('0xad')](_0x1326('0x100')),'role':_0x56f9ba[_0x1326('0x29')],'internal':_0x56f9ba[_0x1326('0x61')]};_0x3807ba[_0x1326('0xff')](function(_0x24ea5f){_0x58e7fc['push'](_[_0x1326('0x58')]({'channel':_0x24ea5f,'type':'LOGIN','data1':_0x51d317[_0x1326('0x5d')][_0x1326('0x102')],'data2':_0x5dd1af},_0x4254dc));if(_0x56f9ba[_0x1326('0x9f')]){_0x336f14[_0x1326('0x48')](_[_0x1326('0x58')]({'channel':_0x24ea5f,'type':_0x1326('0x103'),'data1':'LOGININPAUSE'},_0x4254dc));}});return db['MemberReport'][_0x1326('0x88')](_0x58e7fc[_0x1326('0xcb')](_0x336f14),{'individualHooks':!![]});}})['then'](function(){if(_0x56f9ba){return _0x56f9ba[_0x1326('0x27')]({'online':!![],'lastLoginAt':moment()[_0x1326('0xad')](_0x1326('0x100')),'voicePause':_0x56f9ba['loginInPause']||![],'mailPause':_0x56f9ba[_0x1326('0x9f')]||![],'chatPause':_0x56f9ba['loginInPause']||![],'faxPause':_0x56f9ba['loginInPause']||![],'smsPause':_0x56f9ba[_0x1326('0x9f')]||![],'openchannelPause':_0x56f9ba['loginInPause']||![],'whatsappPause':_0x56f9ba[_0x1326('0x9f')]||![],'pauseType':_0x56f9ba['loginInPause']?'LOGININPAUSE':null,'interface':_0x5dd1af,'lastPauseAt':moment()[_0x1326('0xad')](_0x1326('0x100'))});}})[_0x1326('0x13')](function(_0x3dd13f){if(_0x51d317['isMiddleware']){return _0x229bf5();}else{return BPromise['resolve'](_0x3dd13f)[_0x1326('0x13')](respondWithResult(_0x106973,null));}})['catch'](handleError(_0x106973,null));};exports['logout']=function(_0xdbecd3,_0x2d3cec){var _0x2bdfa8;return db[_0x1326('0x38')]['find']({'where':{'id':_0xdbecd3[_0x1326('0x4f')]['id'],'role':_0x1326('0x2e')},'attributes':['id','name',_0x1326('0x29')]})[_0x1326('0x13')](handleEntityNotFound(_0x2d3cec,null))[_0x1326('0x13')](function(_0x1b6574){if(_0x1b6574){_0x2bdfa8=_0x1b6574;return db[_0x1326('0xaf')][_0x1326('0x28')]({'where':{'membername':_0x2bdfa8[_0x1326('0x36')]},'individualHooks':!![]});}})[_0x1326('0x13')](function(){return db[_0x1326('0xfe')][_0x1326('0x45')]({'where':{'membername':_0x2bdfa8[_0x1326('0x36')],'exitAt':null}});})[_0x1326('0x13')](function(_0x383c1e){var _0x15e84f=[];_0x383c1e['forEach'](function(_0x1406b9){_0x15e84f[_0x1326('0x48')](_0x1406b9[_0x1326('0x27')]({'exitAt':moment()[_0x1326('0xad')](_0x1326('0x100'))}));});return BPromise[_0x1326('0x4d')](_0x15e84f);})[_0x1326('0x13')](function(){return _0x2bdfa8['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x1326('0x13')](respondWithResult(_0x2d3cec,null))['catch'](handleError(_0x2d3cec,null));};exports[_0x1326('0x104')]=function(_0x38e4a8,_0x2b6fdc){var _0x2064a5;return db[_0x1326('0xaf')]['update']({'paused':0x1},{'where':{'UserId':_0x38e4a8[_0x1326('0x4f')]['id']},'individualHooks':!![]})[_0x1326('0x13')](function(){return db[_0x1326('0x38')][_0x1326('0x5a')]({'where':{'id':_0x38e4a8[_0x1326('0x4f')]['id'],'role':_0x1326('0x2e')},'attributes':['id',_0x1326('0x36'),_0x1326('0x29'),_0x1326('0x61'),_0x1326('0xac')]});})['then'](handleEntityNotFound(_0x2b6fdc,null))[_0x1326('0x13')](function(_0x11c0df){if(_0x11c0df){_0x2064a5=_0x11c0df;return respondWithRpcPromise('QueuePause',_0x1326('0x104'),{'id':_0x2064a5['id'],'name':_0x2064a5['name'],'pause':!![]});}})[_0x1326('0x13')](function(){if(_0x2064a5){return db[_0x1326('0xfe')][_0x1326('0x45')]({'where':{'membername':_0x2064a5['name'],'type':_0x1326('0x103'),'exitAt':null}});}})[_0x1326('0x13')](function(_0x5baf83){if(_0x5baf83[_0x1326('0x47')]){var _0x5b1f05=moment()[_0x1326('0xad')](_0x1326('0x100'));for(var _0x488044=0x0,_0x39722d=_0x5baf83[_0x1326('0x47')];_0x488044<_0x39722d;_0x488044++){_0x5baf83[_0x488044][_0x1326('0x105')]({'exitAt':_0x5b1f05});}}})['then'](function(){var _0x526c6b=[];var _0x23c0c0=utils[_0x1326('0x101')]();_0x23c0c0[_0x1326('0xff')](function(_0x36b176){_0x526c6b[_0x1326('0x48')]({'channel':_0x36b176,'membername':_0x2064a5[_0x1326('0x36')],'interface':_[_0x1326('0x65')](_0x2064a5['interface'])?util[_0x1326('0xad')]('SIP/%s',_0x2064a5[_0x1326('0x36')]):_0x2064a5[_0x1326('0xac')],'type':'PAUSE','enterAt':moment()[_0x1326('0xad')](_0x1326('0x100')),'data1':_0x38e4a8['body'][_0x1326('0x3a')]||_0x1326('0x106'),'role':_0x2064a5[_0x1326('0x29')],'internal':_0x2064a5[_0x1326('0x61')]});});return db[_0x1326('0xfe')][_0x1326('0x88')](_0x526c6b,{'individualHooks':!![]});})[_0x1326('0x13')](function(){return _0x2064a5[_0x1326('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x38e4a8[_0x1326('0x5d')][_0x1326('0x3a')]||_0x1326('0x106'),'lastPauseAt':moment()[_0x1326('0xad')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x2b6fdc,null))[_0x1326('0x1e')](handleError(_0x2b6fdc,null));};exports[_0x1326('0x107')]=function(_0xfb5e7a,_0x14b19e){var _0x550ef4;return db['User']['find']({'where':{'id':_0xfb5e7a['params']['id']},'attributes':['id',_0x1326('0x36'),_0x1326('0x29'),_0x1326('0xa0'),_0x1326('0x108'),_0x1326('0x109'),_0x1326('0x10a'),'openchannelPause',_0x1326('0x10b'),_0x1326('0x10c'),'pauseType','lastPauseAt']})[_0x1326('0x13')](handleEntityNotFound(_0x14b19e,null))['then'](function(_0x47ae42){if(_0x47ae42){_0x550ef4=_0x47ae42;if(_0xfb5e7a[_0x1326('0x5d')][_0x1326('0xb2')]&&!utils[_0x1326('0xb3')](_0xfb5e7a[_0x1326('0x5d')][_0x1326('0xb2')])){throw new db[(_0x1326('0x91'))]['ValidationError'](_0x1326('0xb4'));}switch(_0xfb5e7a['body'][_0x1326('0xb2')]){case _0x1326('0xaa'):return respondWithRpcPromise(_0x1326('0x10d'),'unpause',{'id':_0x550ef4['id'],'name':_0x550ef4[_0x1326('0x36')],'pause':![]})['then'](function(){return db[_0x1326('0xaf')][_0x1326('0x27')]({'paused':0x0},{'where':{'UserId':_0x550ef4['id']},'individualHooks':!![]});})[_0x1326('0x13')](function(){return db[_0x1326('0xfe')][_0x1326('0x5a')]({'where':{'channel':_0xfb5e7a[_0x1326('0x5d')][_0x1326('0xb2')],'membername':_0x550ef4['name'],'type':_0x1326('0x103'),'exitAt':null}});})[_0x1326('0x13')](function(_0x5207ed){if(_0x5207ed){return _0x5207ed[_0x1326('0x27')]({'exitAt':moment()[_0x1326('0xad')](_0x1326('0x100')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x1326('0x13')](function(){return _0x550ef4[_0x1326('0x27')]({'voicePause':![]});});case _0x1326('0xc1'):case'chat':case _0x1326('0x5c'):case _0x1326('0x4a'):case _0x1326('0x4c'):case _0x1326('0x5b'):return db[_0x1326('0xfe')][_0x1326('0x5a')]({'where':{'channel':_0xfb5e7a['body'][_0x1326('0xb2')],'membername':_0x550ef4['name'],'type':_0x1326('0x103'),'exitAt':null}})[_0x1326('0x13')](function(_0x48faad){if(_0x48faad){return _0x48faad[_0x1326('0x27')]({'exitAt':moment()[_0x1326('0xad')](_0x1326('0x100')),'data2':_0x1326('0x10e')},{'individualHooks':!![]});}return null;})[_0x1326('0x13')](function(){var _0x34f996={};_[_0x1326('0x25')](_0x34f996,util[_0x1326('0xad')](_0x1326('0x10f'),_0xfb5e7a['body'][_0x1326('0xb2')],_0x1326('0x110')),![]);return _0x550ef4[_0x1326('0x27')](_0x34f996);});default:return respondWithRpcPromise(_0x1326('0x10d'),_0x1326('0x107'),{'id':_0x550ef4['id'],'name':_0x550ef4[_0x1326('0x36')],'pause':![]})['then'](function(){return db[_0x1326('0xaf')][_0x1326('0x27')]({'paused':0x0},{'where':{'UserId':_0x550ef4['id']}});})[_0x1326('0x13')](function(){return db[_0x1326('0xfe')][_0x1326('0x45')]({'where':{'membername':_0x550ef4['name'],'type':_0x1326('0x103'),'exitAt':null}});})['then'](function(_0x197d25){var _0x20a57e=[];_0x197d25[_0x1326('0xff')](function(_0x3dc70f){_0x20a57e[_0x1326('0x48')](_0x3dc70f[_0x1326('0x27')]({'exitAt':moment()[_0x1326('0xad')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x1326('0x10e')}));});return BPromise[_0x1326('0x4d')](_0x20a57e);})[_0x1326('0x13')](function(){return _0x550ef4[_0x1326('0x27')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x1326('0x13')](respondWithResult(_0x14b19e,null))[_0x1326('0x1e')](handleError(_0x14b19e,null));};exports['getTeams']=function(_0x145861,_0x16bb42){var _0x4350cf={};var _0x52dbd4={};var _0x421177;var _0xa298ba;return db[_0x1326('0x38')]['findOne']({'where':{'id':_0x145861['params']['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x16bb42,null))[_0x1326('0x13')](function(_0x4e5032){if(_0x4e5032){_0x421177=_0x4e5032;_0x52dbd4['model']=_[_0x1326('0x51')](db[_0x1326('0x111')][_0x1326('0x52')]);_0x52dbd4[_0x1326('0x3f')]=_['keys'](_0x145861[_0x1326('0x3f')]);_0x52dbd4[_0x1326('0x54')]=_['intersection'](_0x52dbd4[_0x1326('0x50')],_0x52dbd4[_0x1326('0x3f')]);_0x4350cf[_0x1326('0x44')]=_[_0x1326('0x55')](_0x52dbd4['model'],qs['fields'](_0x145861[_0x1326('0x3f')][_0x1326('0x56')]));_0x4350cf['attributes']=_0x4350cf[_0x1326('0x44')]['length']?_0x4350cf[_0x1326('0x44')]:_0x52dbd4[_0x1326('0x50')];_0x4350cf[_0x1326('0xdd')]=qs['sort'](_0x145861[_0x1326('0x3f')][_0x1326('0xcf')]);_0x4350cf[_0x1326('0x3e')]=qs[_0x1326('0x54')](_[_0x1326('0xd0')](_0x145861['query'],_0x52dbd4[_0x1326('0x54')]));if(_0x145861[_0x1326('0x3f')][_0x1326('0x30')]){_0x4350cf[_0x1326('0x3e')]=_[_0x1326('0x58')](_0x4350cf[_0x1326('0x3e')],{'$or':_[_0x1326('0x31')](_0x4350cf['attributes'],function(_0x2c8c51){var _0x448b28={};_0x448b28[_0x2c8c51]={'$like':'%'+_0x145861[_0x1326('0x3f')]['filter']+'%'};return _0x448b28;})});}_0x4350cf=_[_0x1326('0x58')]({},_0x4350cf,_0x145861[_0x1326('0x59')]);return _0x421177[_0x1326('0x112')](_0x4350cf);}})[_0x1326('0x13')](function(_0x439c1b){if(_0x439c1b){_0xa298ba=_0x439c1b['length'];if(!_0x145861[_0x1326('0x3f')][_0x1326('0xd1')]('nolimit')){_0x4350cf[_0x1326('0x24')]=qs[_0x1326('0x24')](_0x145861[_0x1326('0x3f')][_0x1326('0x24')]);_0x4350cf['offset']=qs[_0x1326('0x21')](_0x145861[_0x1326('0x3f')][_0x1326('0x21')]);}return _0x421177[_0x1326('0x112')](_0x4350cf);}})[_0x1326('0x13')](function(_0x2ea32a){if(_0x2ea32a){return _0x2ea32a?{'count':_0xa298ba,'rows':_0x2ea32a}:null;}})[_0x1326('0x13')](respondWithResult(_0x16bb42,null))['catch'](handleError(_0x16bb42,null));};exports[_0x1326('0x113')]=function(_0x18e9aa,_0x2f91d1){return db[_0x1326('0x38')][_0x1326('0x5a')]({'where':{'id':_0x18e9aa[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x2f91d1,null))[_0x1326('0x13')](function(_0x340e3b){if(_0x340e3b){var _0x26d79d=_0x340e3b['get']({'plain':!![]});return _0x340e3b[_0x1326('0x113')](_0x18e9aa[_0x1326('0x5d')][_0x1326('0x5f')],_[_0x1326('0x60')](_0x18e9aa[_0x1326('0x5d')],[_0x1326('0x5f'),'id'])||{})['then'](function(){for(var _0x39c92e=0x0;_0x39c92e<_0x18e9aa[_0x1326('0x5d')]['ids'][_0x1326('0x47')];_0x39c92e++){var _0x9c3c2d=[];var _0x2fbb5a={};db[_0x1326('0x111')][_0x1326('0xcd')]({'where':{'id':_0x18e9aa[_0x1326('0x5d')]['ids'][_0x39c92e]}})[_0x1326('0x13')](function(_0x3e75d6){_0x2fbb5a=_0x3e75d6[_0x1326('0x4b')];_0x9c3c2d[_0x1326('0x48')](_0x3e75d6[_0x1326('0xfd')]()['then'](function(_0x3a63c2){for(var _0x3e4159=0x0;_0x3e4159<_0x3a63c2['length'];_0x3e4159++){_0x3a63c2[_0x3e4159][_0x1326('0x114')](_0x1326('0xb2'),_0x1326('0x115'));}return _0x3a63c2;}));_0x9c3c2d['push'](_0x3e75d6[_0x1326('0x116')]()[_0x1326('0x13')](function(_0x410bfa){for(var _0x3ed7b3=0x0;_0x3ed7b3<_0x410bfa['length'];_0x3ed7b3++){_0x410bfa[_0x3ed7b3][_0x1326('0x114')]('channel',_0x1326('0x117'));}return _0x410bfa;}));_0x9c3c2d[_0x1326('0x48')](_0x3e75d6[_0x1326('0x118')]()['then'](function(_0x406e83){for(var _0x5d271c=0x0;_0x5d271c<_0x406e83[_0x1326('0x47')];_0x5d271c++){_0x406e83[_0x5d271c][_0x1326('0x114')](_0x1326('0xb2'),'Mail');}return _0x406e83;}));_0x9c3c2d[_0x1326('0x48')](_0x3e75d6['getSmsQueues']()[_0x1326('0x13')](function(_0x1189ec){for(var _0x9fcb71=0x0;_0x9fcb71<_0x1189ec[_0x1326('0x47')];_0x9fcb71++){_0x1189ec[_0x9fcb71][_0x1326('0x114')](_0x1326('0xb2'),'Sms');}return _0x1189ec;}));_0x9c3c2d['push'](_0x3e75d6[_0x1326('0x119')]()['then'](function(_0x2abb8c){for(var _0x58b6cd=0x0;_0x58b6cd<_0x2abb8c[_0x1326('0x47')];_0x58b6cd++){_0x2abb8c[_0x58b6cd][_0x1326('0x114')](_0x1326('0xb2'),_0x1326('0x11a'));}return _0x2abb8c;}));_0x9c3c2d[_0x1326('0x48')](_0x3e75d6[_0x1326('0x11b')]()['then'](function(_0xc238f9){for(var _0x298e4e=0x0;_0x298e4e<_0xc238f9['length'];_0x298e4e++){_0xc238f9[_0x298e4e][_0x1326('0x114')](_0x1326('0xb2'),_0x1326('0x11c'));}return _0xc238f9;}));_0x9c3c2d['push'](_0x3e75d6[_0x1326('0x11d')]()[_0x1326('0x13')](function(_0x3a3112){for(var _0x2e4bcc=0x0;_0x2e4bcc<_0x3a3112[_0x1326('0x47')];_0x2e4bcc++){_0x3a3112[_0x2e4bcc][_0x1326('0x114')]('channel',_0x1326('0x11e'));}return _0x3a3112;}));return BPromise[_0x1326('0x4d')](_0x9c3c2d);})[_0x1326('0x13')](function(_0x500f5f){var _0x3a3d97=_[_0x1326('0x11f')](_0x500f5f);_0x9c3c2d=[];return db[_0x1326('0x67')][_0x1326('0x120')](function(_0x2e6086){for(var _0xff02be=0x0;_0xff02be<_0x3a3d97[_0x1326('0x47')];_0xff02be++){_0x9c3c2d[_0x1326('0x48')](_0x3a3d97[_0xff02be][_0x1326('0x121')](_0x26d79d['id']),{'transaction':_0x2e6086});}return BPromise[_0x1326('0x4d')](_0x9c3c2d)['then'](function(){if(_0x26d79d[_0x1326('0x9e')]){return BPromise[_0x1326('0x8b')](_[_0x1326('0x30')](_0x3a3d97,function(_0x53800e){return _0x53800e[_0x1326('0x122')]('channel')==='Voice';}),function(_0x5d9dc6){return db[_0x1326('0xaf')]['upsert']({'membername':_0x26d79d[_0x1326('0x36')],'UserId':_0x26d79d['id'],'queue_name':_0x5d9dc6[_0x1326('0x36')],'VoiceQueueId':_0x5d9dc6['id'],'interface':_[_0x1326('0x65')](_0x26d79d[_0x1326('0xac')])?util[_0x1326('0xad')](_0x1326('0xae'),_0x26d79d[_0x1326('0x36')]):_0x26d79d['interface'],'paused':_0x26d79d[_0x1326('0xa0')]||![],'penalty':_0x26d79d[_0x1326('0xa5')]},{'transaction':_0x2e6086});});}else{return;}})[_0x1326('0x13')](function(){for(var _0x10e7e7=0x0;_0x10e7e7<_0x3a3d97[_0x1326('0x47')];_0x10e7e7++){var _0x30ddd8=_0x3a3d97[_0x10e7e7]['getDataValue'](_0x1326('0xb2'));var _0x57019e=_0x30ddd8+_0x1326('0xa7');socket[_0x1326('0xa8')](_0x1326('0x2c')+_0x30ddd8+_0x1326('0xa9'),{'UserId':_0x26d79d['id'],['queueField']:_0x3a3d97[_0x10e7e7]['id']});}});});})[_0x1326('0x13')](function(){db[_0x1326('0x123')][_0x1326('0xcd')]({'where':{'teamId':_0x2fbb5a['id']}})[_0x1326('0x13')](function(_0x131393){if(_0x131393){db[_0x1326('0x124')]['create']({'UserId':_0x18e9aa[_0x1326('0x4f')]['id'],'VoicePrefixId':_0x131393[_0x1326('0x125')]});}});});}});}})[_0x1326('0x13')](respondWithStatusCode(_0x2f91d1,null))[_0x1326('0x1e')](handleError(_0x2f91d1,null));};exports[_0x1326('0x126')]=function(_0x50e746,_0x2f8c6f){return db['User']['findOne']({'where':{'id':_0x50e746[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x2f8c6f,null))['then'](function(_0x1ac32f){if(_0x1ac32f){var _0xfdbec3=_0x1ac32f[_0x1326('0xda')]({'plain':!![]});var _0x5445e2=_0x50e746[_0x1326('0x3f')][_0x1326('0x5f')];return _0x1ac32f['removeTeams'](_0x5445e2)[_0x1326('0x13')](function(){for(var _0xc4ac5b=0x0;_0xc4ac5b<_0x5445e2[_0x1326('0x47')];_0xc4ac5b++){var _0x4be98c=[];var _0xb591d8={};db[_0x1326('0x111')][_0x1326('0xcd')]({'where':{'id':_0x5445e2[_0xc4ac5b]}})['then'](function(_0x1c2f6f){_0xb591d8=_0x1c2f6f['dataValues'];_0x4be98c[_0x1326('0x48')](_0x1c2f6f[_0x1326('0xfd')]()['then'](function(_0x21bacc){for(var _0x5d9deb=0x0;_0x5d9deb<_0x21bacc[_0x1326('0x47')];_0x5d9deb++){_0x21bacc[_0x5d9deb][_0x1326('0x114')](_0x1326('0xb2'),'Voice');}return _0x21bacc;}));_0x4be98c['push'](_0x1c2f6f[_0x1326('0x116')]()[_0x1326('0x13')](function(_0x6acfdf){for(var _0x1e242b=0x0;_0x1e242b<_0x6acfdf[_0x1326('0x47')];_0x1e242b++){_0x6acfdf[_0x1e242b][_0x1326('0x114')](_0x1326('0xb2'),_0x1326('0x117'));}return _0x6acfdf;}));_0x4be98c[_0x1326('0x48')](_0x1c2f6f['getMailQueues']()[_0x1326('0x13')](function(_0x5424cd){for(var _0xf9e3e2=0x0;_0xf9e3e2<_0x5424cd[_0x1326('0x47')];_0xf9e3e2++){_0x5424cd[_0xf9e3e2][_0x1326('0x114')](_0x1326('0xb2'),_0x1326('0x127'));}return _0x5424cd;}));_0x4be98c[_0x1326('0x48')](_0x1c2f6f[_0x1326('0x128')]()[_0x1326('0x13')](function(_0x54d297){for(var _0x447e6d=0x0;_0x447e6d<_0x54d297[_0x1326('0x47')];_0x447e6d++){_0x54d297[_0x447e6d][_0x1326('0x114')](_0x1326('0xb2'),_0x1326('0x129'));}return _0x54d297;}));_0x4be98c[_0x1326('0x48')](_0x1c2f6f['getWhatsappQueues']()[_0x1326('0x13')](function(_0x365c1b){for(var _0x51b235=0x0;_0x51b235<_0x365c1b[_0x1326('0x47')];_0x51b235++){_0x365c1b[_0x51b235][_0x1326('0x114')]('channel',_0x1326('0x11a'));}return _0x365c1b;}));_0x4be98c['push'](_0x1c2f6f[_0x1326('0x11b')]()[_0x1326('0x13')](function(_0x5359ab){for(var _0x296a19=0x0;_0x296a19<_0x5359ab[_0x1326('0x47')];_0x296a19++){_0x5359ab[_0x296a19][_0x1326('0x114')](_0x1326('0xb2'),'Fax');}return _0x5359ab;}));_0x4be98c[_0x1326('0x48')](_0x1c2f6f['getOpenchannelQueues']()[_0x1326('0x13')](function(_0x4dd216){for(var _0x2f3f49=0x0;_0x2f3f49<_0x4dd216['length'];_0x2f3f49++){_0x4dd216[_0x2f3f49][_0x1326('0x114')](_0x1326('0xb2'),_0x1326('0x11e'));}return _0x4dd216;}));return BPromise[_0x1326('0x4d')](_0x4be98c);})[_0x1326('0x13')](function(_0x2740d3){var _0x4f4f77=_['flatten'](_0x2740d3);_0x4be98c=[];return db['sequelize']['transaction'](function(_0x3bd0d1){for(var _0x31e300=0x0;_0x31e300<_0x4f4f77[_0x1326('0x47')];_0x31e300++){_0x4be98c[_0x1326('0x48')](_0x4f4f77[_0x31e300][_0x1326('0x12a')](_0xfdbec3['id']),{'transaction':_0x3bd0d1});}return BPromise[_0x1326('0x4d')](_0x4be98c)[_0x1326('0x13')](function(){if(_0xfdbec3[_0x1326('0x9e')]){return BPromise[_0x1326('0x8b')](_[_0x1326('0x30')](_0x4f4f77,function(_0x49b37d){return _0x49b37d['getDataValue'](_0x1326('0xb2'))===_0x1326('0x115');}),function(_0x3df1ca){return db[_0x1326('0xaf')]['destroy']({'where':{'VoiceQueueId':_0x3df1ca['id'],'UserId':_0xfdbec3['id']},'transaction':_0x3bd0d1});});}else{return;}})[_0x1326('0x13')](function(){db[_0x1326('0x123')][_0x1326('0xcd')]({'where':{'teamId':_0xb591d8['id']}})[_0x1326('0x13')](function(_0x3201b0){if(_0x3201b0){return db[_0x1326('0x124')]['destroy']({'where':{'UserId':_0xfdbec3['id'],'VoicePrefixId':_0x3201b0[_0x1326('0x4b')]['VoicePrefixId']}});}});})['then'](function(){for(var _0x135d0c=0x0;_0x135d0c<_0x4f4f77['length'];_0x135d0c++){var _0x4f6fb1=_0x4f4f77[_0x135d0c][_0x1326('0x122')]('channel');var _0x55855e=_0x4f6fb1+_0x1326('0xa7');socket[_0x1326('0xa8')](_0x1326('0x2c')+_0x4f6fb1+_0x1326('0xb7'),{'UserId':_0xfdbec3['id'],['queueField']:_0x4f4f77[_0x135d0c]['id']});}});});});}});}})[_0x1326('0x13')](respondWithStatusCode(_0x2f8c6f,null))['catch'](handleError(_0x2f8c6f,null));};exports[_0x1326('0x12b')]=function(_0x17e73a,_0x9a491f){var _0x310213={};var _0x5ba613={};var _0x2c9393;var _0x2ac248;return db['User']['findOne']({'where':{'id':_0x17e73a[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x9a491f,null))['then'](function(_0x5e4ed7){if(_0x5e4ed7){_0x2c9393=_0x5e4ed7;_0x5ba613['model']=_[_0x1326('0x51')](db['CmList'][_0x1326('0x52')]);_0x5ba613[_0x1326('0x3f')]=_[_0x1326('0x51')](_0x17e73a[_0x1326('0x3f')]);_0x5ba613['filters']=_[_0x1326('0x55')](_0x5ba613[_0x1326('0x50')],_0x5ba613['query']);_0x310213[_0x1326('0x44')]=_[_0x1326('0x55')](_0x5ba613[_0x1326('0x50')],qs[_0x1326('0x56')](_0x17e73a[_0x1326('0x3f')][_0x1326('0x56')]));_0x310213[_0x1326('0x44')]=_0x310213[_0x1326('0x44')][_0x1326('0x47')]?_0x310213[_0x1326('0x44')]:_0x5ba613[_0x1326('0x50')];_0x310213[_0x1326('0xdd')]=qs[_0x1326('0xcf')](_0x17e73a[_0x1326('0x3f')][_0x1326('0xcf')]);_0x310213[_0x1326('0x3e')]=qs[_0x1326('0x54')](_['pick'](_0x17e73a['query'],_0x5ba613[_0x1326('0x54')]));if(_0x17e73a[_0x1326('0x3f')]['filter']){_0x310213[_0x1326('0x3e')]=_['merge'](_0x310213['where'],{'$or':_[_0x1326('0x31')](_0x310213[_0x1326('0x44')],function(_0x266094){var _0x379149={};_0x379149[_0x266094]={'$like':'%'+_0x17e73a[_0x1326('0x3f')][_0x1326('0x30')]+'%'};return _0x379149;})});}_0x310213=_[_0x1326('0x58')]({},_0x310213,_0x17e73a['options']);return _0x2c9393[_0x1326('0x12b')](_0x310213);}})[_0x1326('0x13')](function(_0x3dffc2){if(_0x3dffc2){_0x2ac248=_0x3dffc2[_0x1326('0x47')];if(!_0x17e73a[_0x1326('0x3f')][_0x1326('0xd1')](_0x1326('0xd8'))){_0x310213[_0x1326('0x24')]=qs['limit'](_0x17e73a[_0x1326('0x3f')][_0x1326('0x24')]);_0x310213[_0x1326('0x21')]=qs[_0x1326('0x21')](_0x17e73a['query'][_0x1326('0x21')]);}return _0x2c9393[_0x1326('0x12b')](_0x310213);}})[_0x1326('0x13')](function(_0x6bb1d8){if(_0x6bb1d8){return _0x6bb1d8?{'count':_0x2ac248,'rows':_0x6bb1d8}:null;}})['then'](respondWithResult(_0x9a491f,null))[_0x1326('0x1e')](handleError(_0x9a491f,null));};exports[_0x1326('0x12c')]=function(_0x105c6e,_0x2c3a77){var _0x425baa={};var _0x41d1f7={};var _0x5411b1;return db['User']['findOne']({'where':{'id':_0x105c6e[_0x1326('0x4f')]['id']}})[_0x1326('0x13')](handleEntityNotFound(_0x2c3a77,null))[_0x1326('0x13')](function(_0xd43ccb){if(_0xd43ccb){_0x5411b1=_0xd43ccb;_0x41d1f7['model']=_[_0x1326('0x51')](db[_0x1326('0x38')][_0x1326('0x52')]);_0x41d1f7[_0x1326('0x3f')]=_[_0x1326('0x51')](_0x105c6e[_0x1326('0x3f')]);_0x41d1f7[_0x1326('0x54')]=_[_0x1326('0x55')](_0x41d1f7['model'],_0x41d1f7[_0x1326('0x3f')]);_0x425baa[_0x1326('0x44')]=_[_0x1326('0x55')](_0x41d1f7[_0x1326('0x50')],qs[_0x1326('0x56')](_0x105c6e[_0x1326('0x3f')]['fields']));_0x425baa[_0x1326('0x44')]=_0x425baa[_0x1326('0x44')][_0x1326('0x47')]?_0x425baa['attributes']:_0x41d1f7[_0x1326('0x50')];_0x425baa['order']=qs[_0x1326('0xcf')](_0x105c6e['query'][_0x1326('0xcf')]);_0x425baa[_0x1326('0x3e')]=qs[_0x1326('0x54')](_['pick'](_0x105c6e[_0x1326('0x3f')],_0x41d1f7[_0x1326('0x54')]));if(_0x105c6e[_0x1326('0x3f')][_0x1326('0x30')]){_0x425baa['where']=_['merge'](_0x425baa[_0x1326('0x3e')],{'$or':_[_0x1326('0x31')](_0x425baa['attributes'],function(_0x32ce13){var _0x1f50c9={};_0x1f50c9[_0x32ce13]={'$like':'%'+_0x105c6e[_0x1326('0x3f')][_0x1326('0x30')]+'%'};return _0x1f50c9;})});}_0x425baa[_0x1326('0x50')]=db[_0x1326('0x38')];_0x425baa['as']=_0x1326('0x2d');_0x425baa=_[_0x1326('0x58')]({},_0x425baa,_0x105c6e[_0x1326('0x59')]);return _0x5411b1['getVoiceQueues']({'include':[_0x425baa]});}})[_0x1326('0x13')](function(_0x2fd107){if(_0x2fd107){var _0x321cc8={},_0x2517ad=[];for(var _0x4014f3=0x0;_0x4014f3<_0x2fd107[_0x1326('0x47')];_0x4014f3+=0x1){for(var _0x189a1d=0x0,_0x268188;_0x189a1d<_0x2fd107[_0x4014f3][_0x1326('0x2d')][_0x1326('0x47')];_0x189a1d+=0x1){_0x268188=_0x2fd107[_0x4014f3]['Agents'][_0x189a1d]['get']({'plain':!![]});_0x321cc8[_0x268188['id']]=_0x268188;}}_0x321cc8=_[_0x1326('0x12d')](_0x321cc8);for(var _0x21456b=qs[_0x1326('0x21')](_0x105c6e[_0x1326('0x3f')][_0x1326('0x21')]);_0x21456b<_0x321cc8[_0x1326('0x47')]&&_0x2517ad[_0x1326('0x47')]=_0x5173ab[_0x0a26('0x50')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x22c105){return db[_0x0a26('0x2a')][_0x0a26('0x51')]({'where':{'membername':_0x22c105['name']},'individualHooks':!![]});}})[_0x0a26('0x10')](function(){if(_0x22c105){return _0x22c105[_0x0a26('0x52')]({'raw':!![]});}})['then'](function(_0xbf443f){if(_0x22c105){if(_0xbf443f){var _0x287f7d=[];_0x4b64d1=_0xbf443f;if(_0x4b64d1[_0x0a26('0x2d')]){for(var _0x34aecc=0x0;_0x34aecc<_0x4b64d1[_0x0a26('0x2d')];_0x34aecc++){_0x287f7d[_0x0a26('0x31')](db[_0x0a26('0x2a')][_0x0a26('0x53')]({'membername':_0x22c105['name'],'UserId':_0x22c105['id'],'queue_name':_0x4b64d1[_0x34aecc][_0x0a26('0x27')],'VoiceQueueId':_0x4b64d1[_0x34aecc]['id'],'interface':_0x368fd9,'paused':_0x22c105[_0x0a26('0x4c')]||![],'penalty':_0x4b64d1[_0x34aecc]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0a26('0x48')](_0x287f7d);}}}})[_0x0a26('0x10')](function(){if(_0x22c105){return db[_0x0a26('0x39')][_0x0a26('0x1b')]({'where':{'membername':_0x22c105['name'],'exitAt':null}});}})[_0x0a26('0x10')](function(_0x34ea57){if(_0x22c105){if(_0x34ea57&&_0x34ea57[_0x0a26('0x2d')]){var _0x4d102a=[];_0x34ea57[_0x0a26('0x30')](function(_0x780c01){_0x4d102a[_0x0a26('0x31')](_0x780c01[_0x0a26('0x3a')]({'exitAt':moment()['format'](_0x0a26('0x34'))}));});return BPromise[_0x0a26('0x48')](_0x4d102a);}}})[_0x0a26('0x10')](function(_0x3f6d69){if(_0x22c105){var _0xb631a6=[];var _0x3f615e=[];var _0x32488f=utils[_0x0a26('0x2f')]();var _0x5b72a1={'membername':_0x22c105[_0x0a26('0x27')],'interface':_0x368fd9,'enterAt':moment()['format'](_0x0a26('0x34')),'role':_0x22c105[_0x0a26('0x28')],'internal':_0x22c105[_0x0a26('0x29')]};_0x32488f[_0x0a26('0x30')](function(_0x44c6cc){_0xb631a6[_0x0a26('0x31')](_['merge']({'channel':_0x44c6cc,'type':_0x0a26('0x54'),'data1':_0x0a26('0x55'),'data2':_0x368fd9},_0x5b72a1));if(_0x22c105['loginInPause']){_0x3f615e['push'](_[_0x0a26('0x56')]({'channel':_0x44c6cc,'type':_0x0a26('0x2b'),'data1':_0x0a26('0x57')},_0x5b72a1));}});return db[_0x0a26('0x39')]['bulkCreate'](_0xb631a6['concat'](_0x3f615e),{'individualHooks':!![]});}})[_0x0a26('0x10')](function(){if(_0x22c105){return _0x22c105[_0x0a26('0x3a')]({'online':!![],'lastLoginAt':moment()[_0x0a26('0x2c')](_0x0a26('0x34')),'voicePause':_0x22c105[_0x0a26('0x4c')]||![],'mailPause':_0x22c105[_0x0a26('0x4c')]||![],'chatPause':_0x22c105[_0x0a26('0x4c')]||![],'faxPause':_0x22c105['loginInPause']||![],'smsPause':_0x22c105[_0x0a26('0x4c')]||![],'openchannelPause':_0x22c105[_0x0a26('0x4c')]||![],'pauseType':_0x22c105['loginInPause']?_0x0a26('0x57'):null,'lastPauseAt':moment()[_0x0a26('0x2c')](_0x0a26('0x34')),'interface':_0x368fd9});}})[_0x0a26('0x10')](function(_0x3ea878){_0x2d6d17(_0x3ea878);})[_0x0a26('0x25')](function(_0x2d114b){_0x515df6(_0x17115e['error'](0x1f4,_0x2d114b[_0x0a26('0x17')]));});});}; \ No newline at end of file +var _0x0cd8=['User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','User','findAll','options','raw','where','attributes','limit','include','map','model','catch','GetUser','ShowUser','find','PauseUser','internal','interface','UserVoiceQueueRt','update','MemberReport','name','PAUSE','format','length','updateAttributes','forEach','push','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','bulkCreate','UnpauseUser','isValidChannel','channel','Unknown\x20channel','system','mail','chat','sms','openchannel','whatsapp','set','%s%s','Pause','all','destroy','findOne','role','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','getChannels','LOGIN','callysquare','merge','LOGININPAUSE','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','register','then','info'];(function(_0x355be2,_0x4dbc7f){var _0x21b8d7=function(_0x5e8801){while(--_0x5e8801){_0x355be2['push'](_0x355be2['shift']());}};_0x21b8d7(++_0x4dbc7f);}(_0x0cd8,0xfc));var _0x80cd=function(_0xdaa4ff,_0x5d12c4){_0xdaa4ff=_0xdaa4ff-0x0;var _0x3e7342=_0x0cd8[_0xdaa4ff];return _0x3e7342;};'use strict';var _=require(_0x80cd('0x0'));var util=require('util');var moment=require(_0x80cd('0x1'));var BPromise=require(_0x80cd('0x2'));var rs=require(_0x80cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x80cd('0x5'))(_0x80cd('0x6'));var config=require('../../config/environment');var jayson=require(_0x80cd('0x7'));var client=jayson['client'][_0x80cd('0x8')]({'port':0x232a});config[_0x80cd('0x9')]=_[_0x80cd('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x80cd('0xb'))(new Redis(config[_0x80cd('0x9')]));require('./user.socket')[_0x80cd('0xc')](socket);function respondWithRpcPromise(_0x1b81c9,_0x2a6dea,_0x47da04){return new BPromise(function(_0x43a7b6,_0x16539b){return client['request'](_0x1b81c9,_0x47da04)[_0x80cd('0xd')](function(_0x5e32f9){logger[_0x80cd('0xe')](_0x80cd('0xf'),_0x2a6dea,_0x80cd('0x10'));logger[_0x80cd('0x11')](_0x80cd('0x12'),_0x2a6dea,_0x80cd('0x10'),JSON[_0x80cd('0x13')](_0x5e32f9));if(_0x5e32f9[_0x80cd('0x14')]){if(_0x5e32f9[_0x80cd('0x14')][_0x80cd('0x15')]===0x1f4){logger[_0x80cd('0x14')]('User,\x20%s,\x20%s',_0x2a6dea,_0x5e32f9['error']['message']);return _0x16539b(_0x5e32f9['error']['message']);}logger['error'](_0x80cd('0xf'),_0x2a6dea,_0x5e32f9['error'][_0x80cd('0x16')]);return _0x43a7b6(_0x5e32f9[_0x80cd('0x14')]['message']);}else{logger[_0x80cd('0xe')](_0x80cd('0xf'),_0x2a6dea,_0x80cd('0x10'));_0x43a7b6(_0x5e32f9[_0x80cd('0x17')][_0x80cd('0x16')]);}})['catch'](function(_0x3c998a){logger['error'](_0x80cd('0xf'),_0x2a6dea,_0x3c998a);_0x16539b(_0x3c998a);});});}exports['GetUser']=function(_0x3f95d8){var _0x236eb6=this;return new Promise(function(_0xccee87,_0x3c4f7b){return db[_0x80cd('0x18')][_0x80cd('0x19')]({'raw':_0x3f95d8[_0x80cd('0x1a')]?_0x3f95d8[_0x80cd('0x1a')][_0x80cd('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f95d8[_0x80cd('0x1a')]?_0x3f95d8['options'][_0x80cd('0x1c')]||null:null,'attributes':_0x3f95d8[_0x80cd('0x1a')]?_0x3f95d8[_0x80cd('0x1a')][_0x80cd('0x1d')]||null:null,'limit':_0x3f95d8['options']?_0x3f95d8[_0x80cd('0x1a')][_0x80cd('0x1e')]||null:null,'include':_0x3f95d8[_0x80cd('0x1a')]?_0x3f95d8[_0x80cd('0x1a')][_0x80cd('0x1f')]?_[_0x80cd('0x20')](_0x3f95d8[_0x80cd('0x1a')]['include'],function(_0x478123){return{'model':db[_0x478123['model']],'as':_0x478123['as'],'attributes':_0x478123[_0x80cd('0x1d')],'include':_0x478123['include']?_[_0x80cd('0x20')](_0x478123[_0x80cd('0x1f')],function(_0x4791bf){return{'model':db[_0x4791bf[_0x80cd('0x21')]],'as':_0x4791bf['as'],'attributes':_0x4791bf[_0x80cd('0x1d')],'include':_0x4791bf[_0x80cd('0x1f')]?_[_0x80cd('0x20')](_0x4791bf[_0x80cd('0x1f')],function(_0x586660){return{'model':db[_0x586660[_0x80cd('0x21')]],'as':_0x586660['as'],'attributes':_0x586660['attributes']};}):[]};}):[]};}):[]:[]})[_0x80cd('0xd')](function(_0x165bef){logger[_0x80cd('0xe')]('GetUser',_0x3f95d8);logger[_0x80cd('0x11')]('GetUser',_0x3f95d8,JSON[_0x80cd('0x13')](_0x165bef));_0xccee87(_0x165bef);})[_0x80cd('0x22')](function(_0x470ed7){logger[_0x80cd('0x14')](_0x80cd('0x23'),_0x470ed7[_0x80cd('0x16')],_0x3f95d8);_0x3c4f7b(_0x236eb6['error'](0x1f4,_0x470ed7[_0x80cd('0x16')]));});});};exports[_0x80cd('0x24')]=function(_0x4dcd4e){var _0x51faa2=this;return new Promise(function(_0x3568ee,_0xbcc9c5){return db[_0x80cd('0x18')][_0x80cd('0x25')]({'raw':_0x4dcd4e[_0x80cd('0x1a')]?_0x4dcd4e[_0x80cd('0x1a')][_0x80cd('0x1b')]===undefined?!![]:![]:!![],'where':_0x4dcd4e[_0x80cd('0x1a')]?_0x4dcd4e[_0x80cd('0x1a')][_0x80cd('0x1c')]||null:null,'attributes':_0x4dcd4e[_0x80cd('0x1a')]?_0x4dcd4e[_0x80cd('0x1a')]['attributes']||null:null,'include':_0x4dcd4e['options']?_0x4dcd4e['options'][_0x80cd('0x1f')]?_[_0x80cd('0x20')](_0x4dcd4e[_0x80cd('0x1a')][_0x80cd('0x1f')],function(_0x3a4a48){return{'model':db[_0x3a4a48['model']],'as':_0x3a4a48['as'],'attributes':_0x3a4a48[_0x80cd('0x1d')],'include':_0x3a4a48[_0x80cd('0x1f')]?_[_0x80cd('0x20')](_0x3a4a48[_0x80cd('0x1f')],function(_0x29461f){return{'model':db[_0x29461f['model']],'as':_0x29461f['as'],'attributes':_0x29461f[_0x80cd('0x1d')],'include':_0x29461f[_0x80cd('0x1f')]?_[_0x80cd('0x20')](_0x29461f[_0x80cd('0x1f')],function(_0x4d7d66){return{'model':db[_0x4d7d66[_0x80cd('0x21')]],'as':_0x4d7d66['as'],'attributes':_0x4d7d66['attributes']};}):[]};}):[]};}):[]:[]})[_0x80cd('0xd')](function(_0x13ea5d){logger[_0x80cd('0xe')](_0x80cd('0x24'),_0x4dcd4e);logger[_0x80cd('0x11')](_0x80cd('0x24'),_0x4dcd4e,JSON[_0x80cd('0x13')](_0x13ea5d));_0x3568ee(_0x13ea5d);})[_0x80cd('0x22')](function(_0x4fa10b){logger['error']('ShowUser',_0x4fa10b[_0x80cd('0x16')],_0x4dcd4e);_0xbcc9c5(_0x51faa2['error'](0x1f4,_0x4fa10b[_0x80cd('0x16')]));});});};exports[_0x80cd('0x26')]=function(_0x1dc414){var _0x3d1213=this;return new Promise(function(_0x1d5e7b,_0x51c2f9){var _0x386a42;return db[_0x80cd('0x18')][_0x80cd('0x25')]({'where':_0x1dc414['options'][_0x80cd('0x1c')]||{},'attributes':['id','name','role',_0x80cd('0x27'),_0x80cd('0x28')]})[_0x80cd('0xd')](function(_0x1fb7e2){if(_0x1fb7e2){_0x386a42=_0x1fb7e2;return db[_0x80cd('0x29')][_0x80cd('0x2a')]({'paused':0x1},{'where':{'UserId':_0x386a42['id']},'individualHooks':!![]});}})[_0x80cd('0xd')](function(){if(_0x386a42){return db[_0x80cd('0x2b')][_0x80cd('0x19')]({'where':{'membername':_0x386a42[_0x80cd('0x2c')],'type':_0x80cd('0x2d'),'exitAt':null}});}})[_0x80cd('0xd')](function(_0x551d29){if(_0x386a42){if(_0x551d29&&_0x551d29['length']){var _0x65b192=moment()[_0x80cd('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0xb0a661=0x0,_0x29106a=_0x551d29[_0x80cd('0x2f')];_0xb0a661<_0x29106a;_0xb0a661++){_0x551d29[_0xb0a661][_0x80cd('0x30')]({'exitAt':_0x65b192});}}}})[_0x80cd('0xd')](function(){if(_0x386a42){var _0x176d37=[];var _0x2c6918=utils['getChannels']();_0x2c6918[_0x80cd('0x31')](function(_0x4ddc00){_0x176d37[_0x80cd('0x32')]({'channel':_0x4ddc00,'membername':_0x386a42[_0x80cd('0x2c')],'interface':_['isNil'](_0x386a42[_0x80cd('0x28')])?util[_0x80cd('0x2e')]('SIP/%s',_0x386a42[_0x80cd('0x2c')]):_0x386a42['interface'],'type':_0x80cd('0x2d'),'enterAt':moment()['format'](_0x80cd('0x33')),'data1':_0x1dc414[_0x80cd('0x34')][_0x80cd('0x35')]||_0x80cd('0x36'),'role':_0x386a42['role'],'internal':_0x386a42['internal'],'uniqueid':_0x1dc414['body']['uniqueid']||null});});return db['MemberReport'][_0x80cd('0x37')](_0x176d37,{'individualHooks':!![]});}})[_0x80cd('0xd')](function(){if(_0x386a42){return _0x386a42['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x1dc414[_0x80cd('0x34')][_0x80cd('0x35')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x80cd('0x2e')](_0x80cd('0x33'))});}})['then'](function(_0x310cb4){_0x1d5e7b(_0x310cb4);})['catch'](function(_0x5c91d7){_0x51c2f9(_0x3d1213['error'](0x1f4,_0x5c91d7[_0x80cd('0x16')]));});});};exports[_0x80cd('0x38')]=function(_0x48f115){var _0x190a68=this;return new Promise(function(_0x213734,_0x2b0f5f){var _0x1f73d0;return db[_0x80cd('0x18')]['findOne']({'where':_0x48f115[_0x80cd('0x1a')][_0x80cd('0x1c')]||{},'attributes':['id','name']})[_0x80cd('0xd')](function(_0x59260a){if(_0x59260a){_0x1f73d0=_0x59260a;if(_0x48f115[_0x80cd('0x34')]['channel']&&!utils[_0x80cd('0x39')](_0x48f115['body'][_0x80cd('0x3a')])){throw new Error(_0x80cd('0x3b'));}switch(_0x48f115['body'][_0x80cd('0x3a')]){case'voice':return db[_0x80cd('0x29')]['update']({'paused':0x0},{'where':{'UserId':_0x1f73d0['id']}})[_0x80cd('0xd')](function(){return db[_0x80cd('0x2b')][_0x80cd('0x25')]({'where':{'channel':_0x48f115[_0x80cd('0x34')][_0x80cd('0x3a')],'membername':_0x1f73d0[_0x80cd('0x2c')],'type':_0x80cd('0x2d'),'exitAt':null}});})[_0x80cd('0xd')](function(_0x264ea5){if(_0x264ea5){return _0x264ea5[_0x80cd('0x2a')]({'exitAt':moment()[_0x80cd('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x80cd('0x3c')},{'individualHooks':!![]});}return null;})[_0x80cd('0xd')](function(){return _0x1f73d0['update']({'voicePause':![]});});case _0x80cd('0x3d'):case _0x80cd('0x3e'):case'fax':case _0x80cd('0x3f'):case _0x80cd('0x40'):case _0x80cd('0x41'):return db[_0x80cd('0x2b')][_0x80cd('0x25')]({'where':{'channel':_0x48f115[_0x80cd('0x34')]['channel'],'membername':_0x1f73d0[_0x80cd('0x2c')],'type':_0x80cd('0x2d'),'exitAt':null}})['then'](function(_0x23cf60){return _0x23cf60[_0x80cd('0x2a')]({'exitAt':moment()[_0x80cd('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x80cd('0x3c')},{'individualHooks':!![]});})[_0x80cd('0xd')](function(){var _0x32fd9b={};_[_0x80cd('0x42')](_0x32fd9b,util[_0x80cd('0x2e')](_0x80cd('0x43'),_0x48f115[_0x80cd('0x34')]['channel'],_0x80cd('0x44')),![]);return _0x1f73d0['update'](_0x32fd9b);});default:return db['UserVoiceQueueRt'][_0x80cd('0x2a')]({'paused':0x0},{'where':{'UserId':_0x1f73d0['id']}})[_0x80cd('0xd')](function(){return db[_0x80cd('0x2b')][_0x80cd('0x19')]({'where':{'membername':_0x1f73d0[_0x80cd('0x2c')],'type':_0x80cd('0x2d'),'exitAt':null}});})[_0x80cd('0xd')](function(_0x442519){var _0x542e0c=[];_0x442519[_0x80cd('0x31')](function(_0x5ce094){_0x542e0c[_0x80cd('0x32')](_0x5ce094[_0x80cd('0x2a')]({'exitAt':moment()[_0x80cd('0x2e')](_0x80cd('0x33')),'data2':_0x80cd('0x3c')}));});return BPromise[_0x80cd('0x45')](_0x542e0c);})['then'](function(){return _0x1f73d0['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x80cd('0xd')](function(_0x4ea6ca){_0x213734(_0x4ea6ca);})[_0x80cd('0x22')](function(_0x3e19a9){_0x2b0f5f(_0x190a68[_0x80cd('0x14')](0x1f4,_0x3e19a9['message']));});});};exports['LogoutUser']=function(_0x10754c){var _0x9f0104=this;return new Promise(function(_0x1bd7a7,_0x284bd3){var _0x47b521;return db[_0x80cd('0x18')]['findOne']({'where':_0x10754c[_0x80cd('0x1a')][_0x80cd('0x1c')]||{},'attributes':['id',_0x80cd('0x2c')]})[_0x80cd('0xd')](function(_0x4b2562){if(_0x4b2562){_0x47b521=_0x4b2562;return db[_0x80cd('0x29')][_0x80cd('0x46')]({'where':{'membername':_0x47b521[_0x80cd('0x2c')]},'individualHooks':!![]});}})[_0x80cd('0xd')](function(){if(_0x47b521){return db['MemberReport']['findAll']({'where':{'membername':_0x47b521[_0x80cd('0x2c')],'exitAt':null}});}})[_0x80cd('0xd')](function(_0x1f1051){if(_0x47b521){if(_0x1f1051&&_0x1f1051[_0x80cd('0x2f')]){var _0x97f6bb=[];_0x1f1051[_0x80cd('0x31')](function(_0x30522f){_0x97f6bb[_0x80cd('0x32')](_0x30522f['update']({'exitAt':moment()[_0x80cd('0x2e')](_0x80cd('0x33'))}));});return BPromise[_0x80cd('0x45')](_0x97f6bb);}}})['then'](function(){if(_0x47b521){return _0x47b521[_0x80cd('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x80cd('0xd')](function(_0x258e27){_0x1bd7a7(_0x258e27);})[_0x80cd('0x22')](function(_0x43b215){_0x284bd3(_0x9f0104[_0x80cd('0x14')](0x1f4,_0x43b215[_0x80cd('0x16')]));});});};exports['LoginUser']=function(_0x5a6e6c){var _0xccfb1a=this;return new Promise(function(_0xa9a73e,_0x425a2f){var _0x476b3a;var _0xa6e075;var _0x2b5ef3;var _0x4ce9a0;return db['User'][_0x80cd('0x47')]({'where':_0x5a6e6c[_0x80cd('0x1a')][_0x80cd('0x1c')]||{},'attributes':['id',_0x80cd('0x2c'),_0x80cd('0x48'),_0x80cd('0x49'),_0x80cd('0x4a'),'internal',_0x80cd('0x4b'),'interface']})['then'](function(_0x438731){if(_0x438731){_0x476b3a=_0x438731;_0x4ce9a0=_0x5a6e6c['body']['interface']?_0x5a6e6c['body'][_0x80cd('0x28')]:util[_0x80cd('0x2e')]('SIP/%s',_0x476b3a[_0x80cd('0x2c')]);return db['User'][_0x80cd('0x4c')]({'where':{'role':_0x80cd('0x4d'),'online':!![],'id':{'$ne':_0x476b3a['id']}}});}})[_0x80cd('0xd')](function(_0x45b2a6){if(_0x45b2a6){_0x2b5ef3=_0x45b2a6;return require(_0x80cd('0x4e'))[_0x80cd('0x4f')]();}})[_0x80cd('0xd')](function(_0x216d6a){if(_0x216d6a&&_0x216d6a[_0x80cd('0x50')]&&_0x2b5ef3>=_0x216d6a[_0x80cd('0x50')]){throw new Error(_0x80cd('0x51'));}})['then'](function(){if(_0x476b3a){return db['UserVoiceQueueRt'][_0x80cd('0x46')]({'where':{'membername':_0x476b3a[_0x80cd('0x2c')]},'individualHooks':!![]});}})[_0x80cd('0xd')](function(){if(_0x476b3a){return _0x476b3a[_0x80cd('0x52')]({'raw':!![]});}})[_0x80cd('0xd')](function(_0x57e884){if(_0x476b3a){if(_0x57e884){var _0x28227d=[];_0xa6e075=_0x57e884;if(_0xa6e075[_0x80cd('0x2f')]){for(var _0xefa6f4=0x0;_0xefa6f4<_0xa6e075[_0x80cd('0x2f')];_0xefa6f4++){_0x28227d[_0x80cd('0x32')](db[_0x80cd('0x29')]['upsert']({'membername':_0x476b3a[_0x80cd('0x2c')],'UserId':_0x476b3a['id'],'queue_name':_0xa6e075[_0xefa6f4][_0x80cd('0x2c')],'VoiceQueueId':_0xa6e075[_0xefa6f4]['id'],'interface':_0x4ce9a0,'paused':_0x476b3a[_0x80cd('0x4b')]||![],'penalty':_0xa6e075[_0xefa6f4][_0x80cd('0x53')]||0x0}));}return BPromise[_0x80cd('0x45')](_0x28227d);}}}})[_0x80cd('0xd')](function(){if(_0x476b3a){return db[_0x80cd('0x2b')][_0x80cd('0x19')]({'where':{'membername':_0x476b3a[_0x80cd('0x2c')],'exitAt':null}});}})[_0x80cd('0xd')](function(_0x2ef60d){if(_0x476b3a){if(_0x2ef60d&&_0x2ef60d[_0x80cd('0x2f')]){var _0x50e800=[];_0x2ef60d[_0x80cd('0x31')](function(_0x247c7d){_0x50e800[_0x80cd('0x32')](_0x247c7d[_0x80cd('0x2a')]({'exitAt':moment()[_0x80cd('0x2e')](_0x80cd('0x33'))}));});return BPromise[_0x80cd('0x45')](_0x50e800);}}})[_0x80cd('0xd')](function(_0x19f78e){if(_0x476b3a){var _0x8123f2=[];var _0x344c40=[];var _0x23fe99=utils[_0x80cd('0x54')]();var _0x391959={'membername':_0x476b3a[_0x80cd('0x2c')],'interface':_0x4ce9a0,'enterAt':moment()['format'](_0x80cd('0x33')),'role':_0x476b3a['role'],'internal':_0x476b3a[_0x80cd('0x27')]};_0x23fe99[_0x80cd('0x31')](function(_0x20482f){_0x8123f2[_0x80cd('0x32')](_['merge']({'channel':_0x20482f,'type':_0x80cd('0x55'),'data1':_0x80cd('0x56'),'data2':_0x4ce9a0},_0x391959));if(_0x476b3a[_0x80cd('0x4b')]){_0x344c40[_0x80cd('0x32')](_[_0x80cd('0x57')]({'channel':_0x20482f,'type':_0x80cd('0x2d'),'data1':_0x80cd('0x58')},_0x391959));}});return db[_0x80cd('0x2b')][_0x80cd('0x37')](_0x8123f2['concat'](_0x344c40),{'individualHooks':!![]});}})[_0x80cd('0xd')](function(){if(_0x476b3a){return _0x476b3a[_0x80cd('0x2a')]({'online':!![],'lastLoginAt':moment()[_0x80cd('0x2e')](_0x80cd('0x33')),'voicePause':_0x476b3a[_0x80cd('0x4b')]||![],'mailPause':_0x476b3a[_0x80cd('0x4b')]||![],'chatPause':_0x476b3a[_0x80cd('0x4b')]||![],'faxPause':_0x476b3a['loginInPause']||![],'smsPause':_0x476b3a[_0x80cd('0x4b')]||![],'openchannelPause':_0x476b3a['loginInPause']||![],'pauseType':_0x476b3a[_0x80cd('0x4b')]?_0x80cd('0x58'):null,'lastPauseAt':moment()[_0x80cd('0x2e')](_0x80cd('0x33')),'interface':_0x4ce9a0});}})['then'](function(_0x47d269){_0xa9a73e(_0x47d269);})[_0x80cd('0x22')](function(_0x232c02){_0x425a2f(_0xccfb1a['error'](0x1f4,_0x232c02['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 412b85c..144833a 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 _0x9f3d=['./user.events','remove','emit','removeListener','length'];(function(_0x51b698,_0x2fd161){var _0xfa0590=function(_0x3741ce){while(--_0x3741ce){_0x51b698['push'](_0x51b698['shift']());}};_0xfa0590(++_0x2fd161);}(_0x9f3d,0x78));var _0xd9f3=function(_0x28d6af,_0x1967d3){_0x28d6af=_0x28d6af-0x0;var _0x5c7a53=_0x9f3d[_0x28d6af];return _0x5c7a53;};'use strict';var UserEvents=require(_0xd9f3('0x0'));var events=['save',_0xd9f3('0x1'),'update'];function createListener(_0x2eed9a,_0x1ea73b){return function(_0x26ce04){_0x1ea73b[_0xd9f3('0x2')](_0x2eed9a,_0x26ce04);};}function removeListener(_0x172cfd,_0x475d42){return function(){UserEvents[_0xd9f3('0x3')](_0x172cfd,_0x475d42);};}exports['register']=function(_0x2c403e){for(var _0x112f59=0x0,_0x2f77c3=events[_0xd9f3('0x4')];_0x112f59<_0x2f77c3;_0x112f59++){var _0x17c876=events[_0x112f59];var _0x1aa8d8=createListener('user:'+_0x17c876,_0x2c403e);UserEvents['on'](_0x17c876,_0x1aa8d8);}}; \ No newline at end of file +var _0xe867=['save','remove','update','emit','removeListener','user:','./user.events'];(function(_0x2d6a31,_0x2dd440){var _0x51c488=function(_0x173a6a){while(--_0x173a6a){_0x2d6a31['push'](_0x2d6a31['shift']());}};_0x51c488(++_0x2dd440);}(_0xe867,0x19c));var _0x7e86=function(_0x23926a,_0x16f8c2){_0x23926a=_0x23926a-0x0;var _0x3e803=_0xe867[_0x23926a];return _0x3e803;};'use strict';var UserEvents=require(_0x7e86('0x0'));var events=[_0x7e86('0x1'),_0x7e86('0x2'),_0x7e86('0x3')];function createListener(_0x348b03,_0x3dce1c){return function(_0x144430){_0x3dce1c[_0x7e86('0x4')](_0x348b03,_0x144430);};}function removeListener(_0x4541dd,_0x23b056){return function(){UserEvents[_0x7e86('0x5')](_0x4541dd,_0x23b056);};}exports['register']=function(_0x77425e){for(var _0xbd4a64=0x0,_0x58ef5b=events['length'];_0xbd4a64<_0x58ef5b;_0xbd4a64++){var _0xca1a79=events[_0xbd4a64];var _0x201177=createListener(_0x7e86('0x6')+_0xca1a79,_0x77425e);UserEvents['on'](_0xca1a79,_0x201177);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 7baf68c..c59a22a 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x111ee6,_0xd8a3ea){var _0x8bbb51=function(_0x273011){while(--_0x273011){_0x111ee6['push'](_0x111ee6['shift']());}};_0x8bbb51(++_0xd8a3ea);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4c4380,_0x44289b){var _0x2893a9=function(_0x35f6f5){while(--_0x35f6f5){_0x4c4380['push'](_0x4c4380['shift']());}};_0x2893a9(++_0x44289b);}(_0xe706,0xa3));var _0x6e70=function(_0x1a4528,_0x54d423){_0x1a4528=_0x1a4528-0x0;var _0x368a2c=_0xe706[_0x1a4528];return _0x368a2c;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 710f409..fea9a92 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 _0xc00e=['exports','sequelize'];(function(_0x426fce,_0x11e55a){var _0x19332f=function(_0x3c064d){while(--_0x3c064d){_0x426fce['push'](_0x426fce['shift']());}};_0x19332f(++_0x11e55a);}(_0xc00e,0xe1));var _0xec00=function(_0x1b1f31,_0x3b4f0e){_0x1b1f31=_0x1b1f31-0x0;var _0x61e39f=_0xc00e[_0x1b1f31];return _0x61e39f;};'use strict';var Sequelize=require(_0xec00('0x0'));module[_0xec00('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x70e8=['INTEGER','sequelize','exports'];(function(_0x510794,_0x120e85){var _0x3bd818=function(_0x34fab5){while(--_0x34fab5){_0x510794['push'](_0x510794['shift']());}};_0x3bd818(++_0x120e85);}(_0x70e8,0x18d));var _0x870e=function(_0x3487b8,_0x13a194){_0x3487b8=_0x3487b8-0x0;var _0x33830c=_0x70e8[_0x3487b8];return _0x33830c;};'use strict';var Sequelize=require(_0x870e('0x0'));module[_0x870e('0x1')]={'penalty':{'type':Sequelize[_0x870e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index aff932f..3d6b8db 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 _0x22b4=['exports','define','UserChatQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes'];(function(_0xc6575,_0x16a6e1){var _0x58a184=function(_0xde2863){while(--_0xde2863){_0xc6575['push'](_0xc6575['shift']());}};_0x58a184(++_0x16a6e1);}(_0x22b4,0x6f));var _0x422b=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x22b4[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x422b('0x0'));var util=require('util');var logger=require(_0x422b('0x1'))(_0x422b('0x2'));var moment=require(_0x422b('0x3'));var BPromise=require(_0x422b('0x4'));var rp=require(_0x422b('0x5'));var fs=require('fs');var path=require(_0x422b('0x6'));var rimraf=require('rimraf');var config=require(_0x422b('0x7'));var attributes=require(_0x422b('0x8'));module[_0x422b('0x9')]=function(_0x23fcf4,_0x1b19fb){return _0x23fcf4[_0x422b('0xa')](_0x422b('0xb'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9e6=['define','user_has_chat_queues','lodash','util','../../config/logger','api','bluebird','path','./userChatQueue.attributes'];(function(_0xa223ad,_0x5a574b){var _0x306d47=function(_0x4b19ab){while(--_0x4b19ab){_0xa223ad['push'](_0xa223ad['shift']());}};_0x306d47(++_0x5a574b);}(_0xe9e6,0x80));var _0x6e9e=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0xe9e6[_0x1044e5];return _0x5ad0dd;};'use strict';var _=require(_0x6e9e('0x0'));var util=require(_0x6e9e('0x1'));var logger=require(_0x6e9e('0x2'))(_0x6e9e('0x3'));var moment=require('moment');var BPromise=require(_0x6e9e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e9e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6e9e('0x6'));module['exports']=function(_0xf3f8f9,_0x5d32ea){return _0xf3f8f9[_0x6e9e('0x7')]('UserChatQueue',attributes,{'tableName':_0x6e9e('0x8'),'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 0027e20..7d125f4 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 _0x7f61=['../../mysqldb','../../config/utils','../../config/logger','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird'];(function(_0xdc1176,_0x55c094){var _0x4d7c39=function(_0x280d21){while(--_0x280d21){_0xdc1176['push'](_0xdc1176['shift']());}};_0x4d7c39(++_0x55c094);}(_0x7f61,0x16c));var _0x17f6=function(_0x172aa3,_0x20a67e){_0x172aa3=_0x172aa3-0x0;var _0xe0b916=_0x7f61[_0x172aa3];return _0xe0b916;};'use strict';var _=require(_0x17f6('0x0'));var util=require(_0x17f6('0x1'));var moment=require(_0x17f6('0x2'));var BPromise=require(_0x17f6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17f6('0x4'))['db'];var utils=require(_0x17f6('0x5'));var logger=require(_0x17f6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4986ba,_0x44fc1d,_0x1d248c){return new BPromise(function(_0x15d9bf,_0x291d6c){return client['request'](_0x4986ba,_0x1d248c)[_0x17f6('0x7')](function(_0x310486){logger[_0x17f6('0x8')](_0x17f6('0x9'),_0x44fc1d,_0x17f6('0xa'));logger[_0x17f6('0xb')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x44fc1d,'request\x20sent',JSON['stringify'](_0x310486));if(_0x310486[_0x17f6('0xc')]){if(_0x310486[_0x17f6('0xc')][_0x17f6('0xd')]===0x1f4){logger['error'](_0x17f6('0x9'),_0x44fc1d,_0x310486[_0x17f6('0xc')][_0x17f6('0xe')]);return _0x291d6c(_0x310486[_0x17f6('0xc')]['message']);}logger['error'](_0x17f6('0x9'),_0x44fc1d,_0x310486[_0x17f6('0xc')][_0x17f6('0xe')]);return _0x15d9bf(_0x310486['error'][_0x17f6('0xe')]);}else{logger[_0x17f6('0x8')](_0x17f6('0x9'),_0x44fc1d,_0x17f6('0xa'));_0x15d9bf(_0x310486[_0x17f6('0xf')]['message']);}})['catch'](function(_0x2922dd){logger[_0x17f6('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x44fc1d,_0x2922dd);_0x291d6c(_0x2922dd);});});} \ No newline at end of file +var _0xaf52=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xaf52,0xb3));var _0x2af5=function(_0x12e898,_0x1ef073){_0x12e898=_0x12e898-0x0;var _0x190631=_0xaf52[_0x12e898];return _0x190631;};'use strict';var _=require(_0x2af5('0x0'));var util=require(_0x2af5('0x1'));var moment=require(_0x2af5('0x2'));var BPromise=require(_0x2af5('0x3'));var rs=require(_0x2af5('0x4'));var fs=require('fs');var Redis=require(_0x2af5('0x5'));var db=require(_0x2af5('0x6'))['db'];var utils=require(_0x2af5('0x7'));var logger=require(_0x2af5('0x8'))(_0x2af5('0x9'));var config=require('../../config/environment');var jayson=require(_0x2af5('0xa'));var client=jayson[_0x2af5('0xb')][_0x2af5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1feb08,_0x31bdcd,_0x30d6e7){return new BPromise(function(_0x32ac5e,_0x580346){return client[_0x2af5('0xd')](_0x1feb08,_0x30d6e7)[_0x2af5('0xe')](function(_0x49e72a){logger[_0x2af5('0xf')](_0x2af5('0x10'),_0x31bdcd,_0x2af5('0x11'));logger[_0x2af5('0x12')](_0x2af5('0x13'),_0x31bdcd,'request\x20sent',JSON['stringify'](_0x49e72a));if(_0x49e72a[_0x2af5('0x14')]){if(_0x49e72a[_0x2af5('0x14')][_0x2af5('0x15')]===0x1f4){logger[_0x2af5('0x14')](_0x2af5('0x10'),_0x31bdcd,_0x49e72a[_0x2af5('0x14')][_0x2af5('0x16')]);return _0x580346(_0x49e72a[_0x2af5('0x14')][_0x2af5('0x16')]);}logger[_0x2af5('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x31bdcd,_0x49e72a['error'][_0x2af5('0x16')]);return _0x32ac5e(_0x49e72a[_0x2af5('0x14')]['message']);}else{logger[_0x2af5('0xf')](_0x2af5('0x10'),_0x31bdcd,_0x2af5('0x11'));_0x32ac5e(_0x49e72a[_0x2af5('0x17')][_0x2af5('0x16')]);}})[_0x2af5('0x18')](function(_0x534af2){logger[_0x2af5('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x31bdcd,_0x534af2);_0x580346(_0x534af2);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 0c20ef2..52ee666 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x409fb8,_0x5ab3d3){var _0x278270=function(_0x58849c){while(--_0x58849c){_0x409fb8['push'](_0x409fb8['shift']());}};_0x278270(++_0x5ab3d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x6c0b0a,_0x496391){var _0x5f456a=function(_0x5ae918){while(--_0x5ae918){_0x6c0b0a['push'](_0x6c0b0a['shift']());}};_0x5f456a(++_0x496391);}(_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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 794ad88..5515918 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 _0x809a=['sequelize','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x809a,0x13e));var _0xa809=function(_0x3b84cc,_0x1715b7){_0x3b84cc=_0x3b84cc-0x0;var _0x232ff2=_0x809a[_0x3b84cc];return _0x232ff2;};'use strict';var Sequelize=require(_0xa809('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xa809('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa809('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xa809('0x2')]}}; \ No newline at end of file +var _0xccfa=['exports','INTEGER','STRING','sequelize'];(function(_0x51b52a,_0x59ff96){var _0x4cdc82=function(_0x4e41a1){while(--_0x4e41a1){_0x51b52a['push'](_0x51b52a['shift']());}};_0x4cdc82(++_0x59ff96);}(_0xccfa,0x153));var _0xaccf=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xccfa[_0x5ddaac];return _0x2a9c58;};'use strict';var Sequelize=require(_0xaccf('0x0'));module[_0xaccf('0x1')]={'penalty':{'type':Sequelize[_0xaccf('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xaccf('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index d0356df..f0f3725 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 _0xfaf1=['util','api','moment','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue'];(function(_0x48cd3f,_0x2b7efc){var _0x1b333f=function(_0x5a9034){while(--_0x5a9034){_0x48cd3f['push'](_0x48cd3f['shift']());}};_0x1b333f(++_0x2b7efc);}(_0xfaf1,0x19a));var _0x1faf=function(_0x240957,_0x2d254a){_0x240957=_0x240957-0x0;var _0x542cb5=_0xfaf1[_0x240957];return _0x542cb5;};'use strict';var _=require('lodash');var util=require(_0x1faf('0x0'));var logger=require('../../config/logger')(_0x1faf('0x1'));var moment=require(_0x1faf('0x2'));var BPromise=require(_0x1faf('0x3'));var rp=require(_0x1faf('0x4'));var fs=require('fs');var path=require(_0x1faf('0x5'));var rimraf=require('rimraf');var config=require(_0x1faf('0x6'));var attributes=require(_0x1faf('0x7'));module['exports']=function(_0x6c15cd,_0x52d9eb){return _0x6c15cd[_0x1faf('0x8')](_0x1faf('0x9'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef9d=['./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1fa381,_0x758c2a){var _0x47eefe=function(_0x127f8c){while(--_0x127f8c){_0x1fa381['push'](_0x1fa381['shift']());}};_0x47eefe(++_0x758c2a);}(_0xef9d,0xad));var _0xdef9=function(_0x4c883d,_0xc5c2ff){_0x4c883d=_0x4c883d-0x0;var _0x374948=_0xef9d[_0x4c883d];return _0x374948;};'use strict';var _=require(_0xdef9('0x0'));var util=require(_0xdef9('0x1'));var logger=require('../../config/logger')(_0xdef9('0x2'));var moment=require(_0xdef9('0x3'));var BPromise=require(_0xdef9('0x4'));var rp=require(_0xdef9('0x5'));var fs=require('fs');var path=require(_0xdef9('0x6'));var rimraf=require(_0xdef9('0x7'));var config=require(_0xdef9('0x8'));var attributes=require(_0xdef9('0x9'));module[_0xdef9('0xa')]=function(_0x4b1070,_0x4cee92){return _0x4b1070[_0xdef9('0xb')](_0xdef9('0xc'),attributes,{'tableName':_0xdef9('0xd'),'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 6effdb1..0512ab3 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 _0x54c4=['request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x14d1e4,_0x43f72c){var _0x14feed=function(_0x45d84c){while(--_0x45d84c){_0x14d1e4['push'](_0x14d1e4['shift']());}};_0x14feed(++_0x43f72c);}(_0x54c4,0x1f1));var _0x454c=function(_0x841fbe,_0x181bf0){_0x841fbe=_0x841fbe-0x0;var _0x2ad020=_0x54c4[_0x841fbe];return _0x2ad020;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x454c('0x0'));var rs=require(_0x454c('0x1'));var fs=require('fs');var Redis=require(_0x454c('0x2'));var db=require(_0x454c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x454c('0x4'));var config=require(_0x454c('0x5'));var jayson=require(_0x454c('0x6'));var client=jayson[_0x454c('0x7')][_0x454c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b9a33,_0x164cf5,_0x1e8b55){return new BPromise(function(_0x520c9f,_0x1c9e0a){return client[_0x454c('0x9')](_0x5b9a33,_0x1e8b55)[_0x454c('0xa')](function(_0x4b37a8){logger[_0x454c('0xb')](_0x454c('0xc'),_0x164cf5,_0x454c('0xd'));logger[_0x454c('0xe')](_0x454c('0xf'),_0x164cf5,'request\x20sent',JSON[_0x454c('0x10')](_0x4b37a8));if(_0x4b37a8[_0x454c('0x11')]){if(_0x4b37a8[_0x454c('0x11')][_0x454c('0x12')]===0x1f4){logger[_0x454c('0x11')](_0x454c('0xc'),_0x164cf5,_0x4b37a8[_0x454c('0x11')][_0x454c('0x13')]);return _0x1c9e0a(_0x4b37a8['error']['message']);}logger[_0x454c('0x11')](_0x454c('0xc'),_0x164cf5,_0x4b37a8[_0x454c('0x11')]['message']);return _0x520c9f(_0x4b37a8['error'][_0x454c('0x13')]);}else{logger[_0x454c('0xb')](_0x454c('0xc'),_0x164cf5,_0x454c('0xd'));_0x520c9f(_0x4b37a8[_0x454c('0x14')][_0x454c('0x13')]);}})[_0x454c('0x15')](function(_0x20bd33){logger[_0x454c('0x11')](_0x454c('0xc'),_0x164cf5,_0x20bd33);_0x1c9e0a(_0x20bd33);});});} \ No newline at end of file +var _0xb55b=['client','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x27c382,_0x42b2ab){var _0x3d702c=function(_0x526b03){while(--_0x526b03){_0x27c382['push'](_0x27c382['shift']());}};_0x3d702c(++_0x42b2ab);}(_0xb55b,0x1a6));var _0xbb55=function(_0x3ea933,_0x2b5814){_0x3ea933=_0x3ea933-0x0;var _0x153be7=_0xb55b[_0x3ea933];return _0x153be7;};'use strict';var _=require(_0xbb55('0x0'));var util=require('util');var moment=require(_0xbb55('0x1'));var BPromise=require(_0xbb55('0x2'));var rs=require(_0xbb55('0x3'));var fs=require('fs');var Redis=require(_0xbb55('0x4'));var db=require(_0xbb55('0x5'))['db'];var utils=require(_0xbb55('0x6'));var logger=require(_0xbb55('0x7'))('rpc');var config=require(_0xbb55('0x8'));var jayson=require(_0xbb55('0x9'));var client=jayson[_0xbb55('0xa')][_0xbb55('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52b238,_0x4825d5,_0x5b73b5){return new BPromise(function(_0x5af3e7,_0x1395f9){return client[_0xbb55('0xc')](_0x52b238,_0x5b73b5)[_0xbb55('0xd')](function(_0x1bde2d){logger['info'](_0xbb55('0xe'),_0x4825d5,_0xbb55('0xf'));logger['debug'](_0xbb55('0x10'),_0x4825d5,_0xbb55('0xf'),JSON[_0xbb55('0x11')](_0x1bde2d));if(_0x1bde2d[_0xbb55('0x12')]){if(_0x1bde2d[_0xbb55('0x12')][_0xbb55('0x13')]===0x1f4){logger['error'](_0xbb55('0xe'),_0x4825d5,_0x1bde2d[_0xbb55('0x12')][_0xbb55('0x14')]);return _0x1395f9(_0x1bde2d[_0xbb55('0x12')][_0xbb55('0x14')]);}logger[_0xbb55('0x12')](_0xbb55('0xe'),_0x4825d5,_0x1bde2d['error']['message']);return _0x5af3e7(_0x1bde2d[_0xbb55('0x12')][_0xbb55('0x14')]);}else{logger[_0xbb55('0x15')](_0xbb55('0xe'),_0x4825d5,_0xbb55('0xf'));_0x5af3e7(_0x1bde2d[_0xbb55('0x16')]['message']);}})[_0xbb55('0x17')](function(_0x3cb8e5){logger[_0xbb55('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x4825d5,_0x3cb8e5);_0x1395f9(_0x3cb8e5);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 49a5fb4..88676b0 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5681f5,_0x3f3c4e){var _0x4fae5b=function(_0x4aa003){while(--_0x4aa003){_0x5681f5['push'](_0x5681f5['shift']());}};_0x4fae5b(++_0x3f3c4e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3452a8,_0x4bfaa4){_0x3452a8=_0x3452a8-0x0;var _0x233814=_0xcb91[_0x3452a8];return _0x233814;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2f6cbd,_0x4dbbd3){var _0x530361=function(_0x56ed42){while(--_0x56ed42){_0x2f6cbd['push'](_0x2f6cbd['shift']());}};_0x530361(++_0x4dbbd3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 31fee27..35226a3 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 _0x2649=['exports','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2649,0x16a));var _0x9264=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0x2649[_0x7791d5];return _0x5ce288;};'use strict';var Sequelize=require('sequelize');module[_0x9264('0x0')]={'penalty':{'type':Sequelize[_0x9264('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb1ed=['INTEGER'];(function(_0x3bfdde,_0x306be4){var _0x3f752a=function(_0x3b6751){while(--_0x3b6751){_0x3bfdde['push'](_0x3bfdde['shift']());}};_0x3f752a(++_0x306be4);}(_0xb1ed,0x8b));var _0xdb1e=function(_0x39d024,_0x5c5797){_0x39d024=_0x39d024-0x0;var _0x311bdd=_0xb1ed[_0x39d024];return _0x311bdd;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xdb1e('0x0')],'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 5e6b775..edf72f8 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 _0xa638=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x1121fc,_0x3ad11a){var _0x7963c3=function(_0x257bf0){while(--_0x257bf0){_0x1121fc['push'](_0x1121fc['shift']());}};_0x7963c3(++_0x3ad11a);}(_0xa638,0x14f));var _0x8a63=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xa638[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x8a63('0x0'));var util=require('util');var logger=require(_0x8a63('0x1'))(_0x8a63('0x2'));var moment=require(_0x8a63('0x3'));var BPromise=require(_0x8a63('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8a63('0x5'));var config=require(_0x8a63('0x6'));var attributes=require(_0x8a63('0x7'));module[_0x8a63('0x8')]=function(_0x42bd1a,_0x47a769){return _0x42bd1a[_0x8a63('0x9')](_0x8a63('0xa'),attributes,{'tableName':_0x8a63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad0b=['request-promise','path','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api','moment'];(function(_0x594f9c,_0x529ce6){var _0x4db873=function(_0x70bd9a){while(--_0x70bd9a){_0x594f9c['push'](_0x594f9c['shift']());}};_0x4db873(++_0x529ce6);}(_0xad0b,0x125));var _0xbad0=function(_0x4014ef,_0x51517a){_0x4014ef=_0x4014ef-0x0;var _0x202c63=_0xad0b[_0x4014ef];return _0x202c63;};'use strict';var _=require(_0xbad0('0x0'));var util=require('util');var logger=require(_0xbad0('0x1'))(_0xbad0('0x2'));var moment=require(_0xbad0('0x3'));var BPromise=require('bluebird');var rp=require(_0xbad0('0x4'));var fs=require('fs');var path=require(_0xbad0('0x5'));var rimraf=require('rimraf');var config=require(_0xbad0('0x6'));var attributes=require(_0xbad0('0x7'));module['exports']=function(_0x441c77,_0x347c3a){return _0x441c77[_0xbad0('0x8')](_0xbad0('0x9'),attributes,{'tableName':_0xbad0('0xa'),'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 0253ade..ee2cd9f 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserMailQueue,\x20%s,\x20%s','message','result'];(function(_0x55f687,_0x31dfc9){var _0x4e0ccd=function(_0x2517e4){while(--_0x2517e4){_0x55f687['push'](_0x55f687['shift']());}};_0x4e0ccd(++_0x31dfc9);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x7185f7,_0x37065){_0x7185f7=_0x7185f7-0x0;var _0x182e45=_0xf3cd[_0x7185f7];return _0x182e45;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x526cda,_0x4edc1e){var _0x3cd159=function(_0x4b71ef){while(--_0x4b71ef){_0x526cda['push'](_0x526cda['shift']());}};_0x3cd159(++_0x4edc1e);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3c2e18,_0x1e8f5a){_0x3c2e18=_0x3c2e18-0x0;var _0x5c74dd=_0x8ef6[_0x3c2e18];return _0x5c74dd;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index fbcb8d4..2101dcd 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 _0x6df0=['sendUserNotification','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','post','isAuthenticated'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0x6df0,0x9e));var _0x06df=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6df0[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x06df('0x0'));var path=require(_0x06df('0x1'));var timeout=require('connect-timeout');var express=require(_0x06df('0x2'));var router=express[_0x06df('0x3')]();var fs_extra=require(_0x06df('0x4'));var auth=require(_0x06df('0x5'));var interaction=require(_0x06df('0x6'));var config=require(_0x06df('0x7'));var controller=require('./userNotification.controller');router[_0x06df('0x8')]('/',auth[_0x06df('0x9')](),controller[_0x06df('0xa')]);module[_0x06df('0xb')]=router; \ No newline at end of file +var _0x59c2=['isAuthenticated','sendUserNotification','exports','path','express','Router','../../components/interaction/service','../../config/environment','./userNotification.controller','post'];(function(_0x4fb081,_0x8c884c){var _0x49a2a1=function(_0x5dfc7d){while(--_0x5dfc7d){_0x4fb081['push'](_0x4fb081['shift']());}};_0x49a2a1(++_0x8c884c);}(_0x59c2,0xcb));var _0x259c=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x59c2[_0x424a9a];return _0xa7831c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x259c('0x0'));var timeout=require('connect-timeout');var express=require(_0x259c('0x1'));var router=express[_0x259c('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x259c('0x3'));var config=require(_0x259c('0x4'));var controller=require(_0x259c('0x5'));router[_0x259c('0x6')]('/',auth[_0x259c('0x7')](),controller[_0x259c('0x8')]);module[_0x259c('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 546b4d5..ce851aa 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 _0x7eee=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x553f9f,_0x19d019){var _0x1ca672=function(_0x579af6){while(--_0x579af6){_0x553f9f['push'](_0x553f9f['shift']());}};_0x1ca672(++_0x19d019);}(_0x7eee,0x12b));var _0xe7ee=function(_0xd3e596,_0xae908a){_0xd3e596=_0xd3e596-0x0;var _0x3c01f7=_0x7eee[_0xd3e596];return _0x3c01f7;};'use strict';var Sequelize=require(_0xe7ee('0x0'));module[_0xe7ee('0x1')]={'body':{'type':Sequelize[_0xe7ee('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xe7ee('0x2')]},'recipientsDescription':{'type':Sequelize[_0xe7ee('0x3')]},'beep':{'type':Sequelize[_0xe7ee('0x4')]}}; \ No newline at end of file +var _0xbc85=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x4d5f7f,_0x180da6){var _0x36d267=function(_0x507a32){while(--_0x507a32){_0x4d5f7f['push'](_0x4d5f7f['shift']());}};_0x36d267(++_0x180da6);}(_0xbc85,0x17b));var _0x5bc8=function(_0x55976e,_0x27e156){_0x55976e=_0x55976e-0x0;var _0x169ee6=_0xbc85[_0x55976e];return _0x169ee6;};'use strict';var Sequelize=require(_0x5bc8('0x0'));module[_0x5bc8('0x1')]={'body':{'type':Sequelize[_0x5bc8('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x5bc8('0x3')]},'beep':{'type':Sequelize[_0x5bc8('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index f145a6a..0d49c5a 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 _0x7754=['path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','localhost','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','faxqueue','smsqueue','voicequeue','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','union','ids','replace','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x34f46b,_0x24ec8b){var _0x422b82=function(_0x3f3733){while(--_0x3f3733){_0x34f46b['push'](_0x34f46b['shift']());}};_0x422b82(++_0x24ec8b);}(_0x7754,0x1e2));var _0x4775=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0x7754[_0x478c8a];return _0x3b6b3e;};'use strict';var emlformat=require(_0x4775('0x0'));var rimraf=require(_0x4775('0x1'));var zipdir=require(_0x4775('0x2'));var jsonpatch=require(_0x4775('0x3'));var rp=require(_0x4775('0x4'));var moment=require(_0x4775('0x5'));var BPromise=require(_0x4775('0x6'));var Mustache=require(_0x4775('0x7'));var util=require('util');var path=require(_0x4775('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4775('0x9'));var _=require('lodash');var squel=require(_0x4775('0xa'));var crypto=require(_0x4775('0xb'));var jsforce=require(_0x4775('0xc'));var deskjs=require(_0x4775('0xd'));var toCsv=require(_0x4775('0xe'));var querystring=require('querystring');var Papa=require(_0x4775('0xf'));var Redis=require(_0x4775('0x10'));var authService=require(_0x4775('0x11'));var qs=require(_0x4775('0x12'));var as=require(_0x4775('0x13'));var hardwareService=require(_0x4775('0x14'));var logger=require('../../config/logger')(_0x4775('0x15'));var utils=require(_0x4775('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4775('0x17'));var db=require('../../mysqldb')['db'];config[_0x4775('0x18')]=_['defaults'](config[_0x4775('0x18')],{'host':_0x4775('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4775('0x18')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x2f393b,_0x4b1df3){_0x4b1df3=_0x4b1df3||0xcc;return function(_0x1a7a3f){if(_0x1a7a3f){return _0x2f393b['sendStatus'](_0x4b1df3);}return _0x2f393b[_0x4775('0x1a')](_0x4b1df3)[_0x4775('0x1b')]();};}function respondWithResult(_0x1ee1cb,_0x4c263f){_0x4c263f=_0x4c263f||0xc8;return function(_0x1b4139){if(_0x1b4139){return _0x1ee1cb['status'](_0x4c263f)[_0x4775('0x1c')](_0x1b4139);}};}function respondWithFilteredResult(_0x45c762,_0x43c7bb){return function(_0x3113a3){if(_0x3113a3){var _0x1f89dc=typeof _0x43c7bb[_0x4775('0x1d')]==='undefined'&&typeof _0x43c7bb['limit']===_0x4775('0x1e');var _0x515d95=_0x3113a3[_0x4775('0x1f')];var _0x1ce8d8=_0x1f89dc?0x0:_0x43c7bb[_0x4775('0x1d')];var _0xc2b9dc=_0x1f89dc?_0x3113a3['count']:_0x43c7bb[_0x4775('0x1d')]+_0x43c7bb[_0x4775('0x20')];var _0x37962f;if(_0xc2b9dc>=_0x515d95){_0xc2b9dc=_0x515d95;_0x37962f=0xc8;}else{_0x37962f=0xce;}_0x45c762[_0x4775('0x1a')](_0x37962f);return _0x45c762[_0x4775('0x21')](_0x4775('0x22'),_0x1ce8d8+'-'+_0xc2b9dc+'/'+_0x515d95)[_0x4775('0x1c')](_0x3113a3);}return null;};}function patchUpdates(_0x33b1c1){return function(_0x36ef86){try{jsonpatch[_0x4775('0x23')](_0x36ef86,_0x33b1c1,!![]);}catch(_0xf24caa){return BPromise['reject'](_0xf24caa);}return _0x36ef86[_0x4775('0x24')]();};}function saveUpdates(_0x3a1f98,_0x566965){return function(_0x2879db){if(_0x2879db){return _0x2879db[_0x4775('0x25')](_0x3a1f98)[_0x4775('0x26')](function(_0x57ec66){return _0x57ec66;});}return null;};}function removeEntity(_0x275034,_0x205d48){return function(_0xa218f9){if(_0xa218f9){return _0xa218f9[_0x4775('0x27')]()['then'](function(){_0x275034[_0x4775('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2de8a5,_0x43a993){return function(_0x15b8cb){if(!_0x15b8cb){_0x2de8a5[_0x4775('0x28')](0x194);}return _0x15b8cb;};}function handleError(_0x45f234,_0x264ae8){_0x264ae8=_0x264ae8||0x1f4;return function(_0x34d483){logger[_0x4775('0x29')](_0x34d483[_0x4775('0x2a')]);if(_0x34d483[_0x4775('0x2b')]){delete _0x34d483['name'];}_0x45f234[_0x4775('0x1a')](_0x264ae8)[_0x4775('0x2c')](_0x34d483);};}exports[_0x4775('0x2d')]=function(_0x3653e9,_0x108da3,_0x5f03fb){if(!_0x3653e9[_0x4775('0x2e')][_0x4775('0x2f')]('text')&&!_0x3653e9[_0x4775('0x2e')][_0x4775('0x2f')](_0x4775('0x30'))){throw new db[(_0x4775('0x31'))][(_0x4775('0x32'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x3653e9['body'][_0x4775('0x2f')]('TemplateId')&&!_0x3653e9['body'][_0x4775('0x2f')](_0x4775('0x33'))){throw new db['Sequelize'][(_0x4775('0x32'))](_0x4775('0x34'));}if(!_0x3653e9['body'][_0x4775('0x2f')]('recipients')){throw new db[(_0x4775('0x31'))][(_0x4775('0x32'))](_0x4775('0x35'));}else{try{var _0x1d70fa=JSON[_0x4775('0x36')](_0x3653e9['body'][_0x4775('0x37')]);}catch(_0x2cb29b){logger[_0x4775('0x29')](_0x2cb29b);throw new db[(_0x4775('0x31'))][(_0x4775('0x32'))](_0x4775('0x38'));}var _0x31b3c8=['chatqueue',_0x4775('0x39'),'mailqueue','openchannelqueue',_0x4775('0x3a'),_0x4775('0x3b'),'whatsappqueue','team','user'];if(_[_0x4775('0x3c')](_0x1d70fa,function(_0x20ca90){return!_[_0x4775('0x3d')](_0x31b3c8,_0x20ca90[_0x4775('0x3e')][_0x4775('0x3f')]());})){throw new db[(_0x4775('0x31'))][(_0x4775('0x32'))](_0x4775('0x40'));}}}var _0x469a9a={};_0x469a9a['senderName']=_0x3653e9['body']['hasOwnProperty']('senderName')?_0x3653e9[_0x4775('0x2e')][_0x4775('0x41')]:_0x3653e9[_0x4775('0x42')]['fullname'];_0x469a9a[_0x4775('0x43')]=_[_0x4775('0x44')](_0x3653e9['body']['recipientsDescription'])?null:_0x3653e9[_0x4775('0x2e')][_0x4775('0x43')];_0x469a9a[_0x4775('0x45')]=_0x3653e9[_0x4775('0x2e')]['beep']||![];_0x469a9a[_0x4775('0x46')]=_0x3653e9[_0x4775('0x42')]['id'];return getContent(_0x3653e9[_0x4775('0x2e')])[_0x4775('0x26')](function(_0x12d301){_0x469a9a[_0x4775('0x2e')]=_0x12d301;return getRecipients(_0x1d70fa);})[_0x4775('0x26')](function(_0x36c2de){_0x469a9a[_0x4775('0x47')]=_[_0x4775('0x48')](_0x36c2de)[_0x4775('0x49')](',');return db[_0x4775('0x4a')][_0x4775('0x4b')](function(_0x51f103){return db[_0x4775('0x4c')][_0x4775('0x4d')](_0x469a9a,{'raw':!![],'transaction':_0x51f103})['then'](function(_0x2330f2){var _0x17946b={'sender':_0x469a9a[_0x4775('0x41')],'description':_0x469a9a['recipientsDescription'],'content':_0x469a9a[_0x4775('0x2e')],'beep':_0x469a9a[_0x4775('0x45')]};_0x36c2de[_0x4775('0x4e')](function(_0x1d1c11){_0x17946b[_0x4775('0x4f')]=_0x1d1c11;socket[_0x4775('0x50')](_0x4775('0x51'),_0x17946b);});return _0x2330f2;});});})['then'](respondWithResult(_0x108da3,0xc9))[_0x4775('0x52')](handleError(_0x108da3,null));};function getContent(_0x320ae5){return new BPromise(function(_0x2eeede,_0x4ea147){if(_0x320ae5[_0x4775('0x53')]){_0x2eeede(_0x320ae5[_0x4775('0x53')]);return;}return db[_0x4775('0x54')][_0x4775('0x55')]({'attributes':[_0x4775('0x56')],'where':{'id':_0x320ae5[_0x4775('0x30')]},'raw':!![]})[_0x4775('0x26')](function(_0x20896f){if(!_0x20896f)throw new db[(_0x4775('0x31'))]['ValidationError'](_0x4775('0x57'));var _0x4f80f7=Mustache[_0x4775('0x58')](_0x20896f[_0x4775('0x56')],_0x320ae5[_0x4775('0x33')]);_0x2eeede(_0x4f80f7);})[_0x4775('0x52')](function(_0x471430){_0x4ea147(_0x471430);});});}function getRecipients(_0x171b57){return new BPromise(function(_0x161dfd,_0x56dbf4){var _0x7a1308=[];var _0xb14f4e=[];_0x171b57[_0x4775('0x4e')](function(_0x21d810){var _0x540409=_['startCase'](_0x21d810[_0x4775('0x3e')]['toLowerCase']());if(_0x540409==='User'){_0x7a1308=_[_0x4775('0x59')](_0x7a1308,_0x21d810[_0x4775('0x5a')]);}else{if(_[_0x4775('0x3d')](_0x540409,'queue'))_0x540409=_0x540409[_0x4775('0x5b')]('queue',_0x4775('0x5c'));_0x21d810[_0x4775('0x5a')][_0x4775('0x4e')](function(_0x49c0b6){_0xb14f4e[_0x4775('0x5d')](getAgents(_0x540409,_0x49c0b6));});}});return BPromise[_0x4775('0x5e')](_0xb14f4e)[_0x4775('0x26')](function(_0x16252c){_0x7a1308=_['union'](_0x7a1308,_[_0x4775('0x5f')](_0x16252c));_0x161dfd(_0x7a1308);})[_0x4775('0x52')](function(_0x4ad988){_0x56dbf4(_0x4ad988);});});}function getAgents(_0x2a0d0d,_0x2eb488){return new BPromise(function(_0x58d6e5,_0x17a735){return db[_0x2a0d0d]['findOne']({'where':{'id':_0x2eb488}})['then'](function(_0x4c842b){return _0x4c842b[_0x4775('0x60')]({'attributes':['id'],'raw':!![]})[_0x4775('0x26')](function(_0x465a31){var _0x2811c5=_[_0x4775('0x61')](_0x465a31,'id');_0x58d6e5(_0x2811c5);});})[_0x4775('0x52')](function(_0x90ee3b){_0x17a735(_0x90ee3b);});});} \ No newline at end of file +var _0x0104=['some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','isEmpty','recipientsDescription','beep','sortBy','join','transaction','create','forEach','recipient','emit','userNotification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','User','union','ids','queue','Queue','push','all','getAgents','map','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./userNotification.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','hasOwnProperty','text','body','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','team','user'];(function(_0x1fc274,_0x1167be){var _0x11391f=function(_0x487b99){while(--_0x487b99){_0x1fc274['push'](_0x1fc274['shift']());}};_0x11391f(++_0x1167be);}(_0x0104,0x143));var _0x4010=function(_0x428695,_0x531520){_0x428695=_0x428695-0x0;var _0x36beff=_0x0104[_0x428695];return _0x36beff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4010('0x0'));var jsonpatch=require(_0x4010('0x1'));var rp=require(_0x4010('0x2'));var moment=require(_0x4010('0x3'));var BPromise=require(_0x4010('0x4'));var Mustache=require(_0x4010('0x5'));var util=require(_0x4010('0x6'));var path=require(_0x4010('0x7'));var sox=require(_0x4010('0x8'));var csv=require(_0x4010('0x9'));var ejs=require(_0x4010('0xa'));var fs=require('fs');var fs_extra=require(_0x4010('0xb'));var _=require(_0x4010('0xc'));var squel=require(_0x4010('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4010('0xe'));var toCsv=require(_0x4010('0x9'));var querystring=require(_0x4010('0xf'));var Papa=require(_0x4010('0x10'));var Redis=require(_0x4010('0x11'));var authService=require(_0x4010('0x12'));var qs=require(_0x4010('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4010('0x14'));var logger=require('../../config/logger')(_0x4010('0x15'));var utils=require(_0x4010('0x16'));var config=require(_0x4010('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4010('0x18'))['db'];config[_0x4010('0x19')]=_[_0x4010('0x1a')](config[_0x4010('0x19')],{'host':_0x4010('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4010('0x19')]));require(_0x4010('0x1c'))[_0x4010('0x1d')](socket);function respondWithStatusCode(_0x558899,_0x6646a7){_0x6646a7=_0x6646a7||0xcc;return function(_0x557b1e){if(_0x557b1e){return _0x558899[_0x4010('0x1e')](_0x6646a7);}return _0x558899[_0x4010('0x1f')](_0x6646a7)[_0x4010('0x20')]();};}function respondWithResult(_0x40868b,_0x5c43c3){_0x5c43c3=_0x5c43c3||0xc8;return function(_0x5db846){if(_0x5db846){return _0x40868b[_0x4010('0x1f')](_0x5c43c3)[_0x4010('0x21')](_0x5db846);}};}function respondWithFilteredResult(_0x4b4930,_0x5bed18){return function(_0x183ac9){if(_0x183ac9){var _0x4f7a7c=typeof _0x5bed18[_0x4010('0x22')]==='undefined'&&typeof _0x5bed18[_0x4010('0x23')]===_0x4010('0x24');var _0x170302=_0x183ac9[_0x4010('0x25')];var _0x2c8fba=_0x4f7a7c?0x0:_0x5bed18[_0x4010('0x22')];var _0x7e31b9=_0x4f7a7c?_0x183ac9[_0x4010('0x25')]:_0x5bed18[_0x4010('0x22')]+_0x5bed18[_0x4010('0x23')];var _0x507533;if(_0x7e31b9>=_0x170302){_0x7e31b9=_0x170302;_0x507533=0xc8;}else{_0x507533=0xce;}_0x4b4930[_0x4010('0x1f')](_0x507533);return _0x4b4930['set'](_0x4010('0x26'),_0x2c8fba+'-'+_0x7e31b9+'/'+_0x170302)[_0x4010('0x21')](_0x183ac9);}return null;};}function patchUpdates(_0x465006){return function(_0x48bc4a){try{jsonpatch['apply'](_0x48bc4a,_0x465006,!![]);}catch(_0x183a5f){return BPromise[_0x4010('0x27')](_0x183a5f);}return _0x48bc4a[_0x4010('0x28')]();};}function saveUpdates(_0x35c2e0,_0x3bf7ab){return function(_0x3d047d){if(_0x3d047d){return _0x3d047d[_0x4010('0x29')](_0x35c2e0)[_0x4010('0x2a')](function(_0x7e447e){return _0x7e447e;});}return null;};}function removeEntity(_0x3d978f,_0x4b3dbe){return function(_0x2bb949){if(_0x2bb949){return _0x2bb949[_0x4010('0x2b')]()[_0x4010('0x2a')](function(){_0x3d978f['status'](0xcc)[_0x4010('0x20')]();});}};}function handleEntityNotFound(_0x925fb6,_0x5787c7){return function(_0x289d58){if(!_0x289d58){_0x925fb6[_0x4010('0x1e')](0x194);}return _0x289d58;};}function handleError(_0x3d2799,_0x538db3){_0x538db3=_0x538db3||0x1f4;return function(_0xa2197b){logger[_0x4010('0x2c')](_0xa2197b[_0x4010('0x2d')]);if(_0xa2197b['name']){delete _0xa2197b[_0x4010('0x2e')];}_0x3d2799['status'](_0x538db3)[_0x4010('0x2f')](_0xa2197b);};}exports[_0x4010('0x30')]=function(_0xc3029e,_0x3b18b2,_0x305f13){if(!_0xc3029e['body'][_0x4010('0x31')](_0x4010('0x32'))&&!_0xc3029e[_0x4010('0x33')][_0x4010('0x31')](_0x4010('0x34'))){throw new db[(_0x4010('0x35'))][(_0x4010('0x36'))](_0x4010('0x37'));}else{if(_0xc3029e[_0x4010('0x33')][_0x4010('0x31')]('TemplateId')&&!_0xc3029e[_0x4010('0x33')][_0x4010('0x31')](_0x4010('0x38'))){throw new db[(_0x4010('0x35'))][(_0x4010('0x36'))](_0x4010('0x39'));}if(!_0xc3029e[_0x4010('0x33')][_0x4010('0x31')](_0x4010('0x3a'))){throw new db[(_0x4010('0x35'))][(_0x4010('0x36'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x3aba98=JSON['parse'](_0xc3029e[_0x4010('0x33')][_0x4010('0x3a')]);}catch(_0x1bba31){logger[_0x4010('0x2c')](_0x1bba31);throw new db[(_0x4010('0x35'))][(_0x4010('0x36'))](_0x4010('0x3b'));}var _0x1e0ff1=[_0x4010('0x3c'),_0x4010('0x3d'),_0x4010('0x3e'),'openchannelqueue','smsqueue','voicequeue','whatsappqueue',_0x4010('0x3f'),_0x4010('0x40')];if(_[_0x4010('0x41')](_0x3aba98,function(_0x19860e){return!_[_0x4010('0x42')](_0x1e0ff1,_0x19860e['model'][_0x4010('0x43')]());})){throw new db[(_0x4010('0x35'))]['ValidationError'](_0x4010('0x44'));}}}var _0x4dd241={};_0x4dd241[_0x4010('0x45')]=_0xc3029e[_0x4010('0x33')][_0x4010('0x31')](_0x4010('0x45'))?_0xc3029e[_0x4010('0x33')][_0x4010('0x45')]:_0xc3029e[_0x4010('0x40')]['fullname'];_0x4dd241['recipientsDescription']=_[_0x4010('0x46')](_0xc3029e[_0x4010('0x33')][_0x4010('0x47')])?null:_0xc3029e['body'][_0x4010('0x47')];_0x4dd241[_0x4010('0x48')]=_0xc3029e[_0x4010('0x33')][_0x4010('0x48')]||![];_0x4dd241['SenderId']=_0xc3029e[_0x4010('0x40')]['id'];return getContent(_0xc3029e['body'])['then'](function(_0x348c40){_0x4dd241['body']=_0x348c40;return getRecipients(_0x3aba98);})['then'](function(_0x57252e){_0x4dd241['recipientsId']=_[_0x4010('0x49')](_0x57252e)[_0x4010('0x4a')](',');return db['sequelize'][_0x4010('0x4b')](function(_0x1c3ec6){return db['UserNotification'][_0x4010('0x4c')](_0x4dd241,{'raw':!![],'transaction':_0x1c3ec6})[_0x4010('0x2a')](function(_0x614a7f){var _0x1df85a={'sender':_0x4dd241[_0x4010('0x45')],'description':_0x4dd241[_0x4010('0x47')],'content':_0x4dd241[_0x4010('0x33')],'beep':_0x4dd241[_0x4010('0x48')]};_0x57252e[_0x4010('0x4d')](function(_0x376cab){_0x1df85a[_0x4010('0x4e')]=_0x376cab;socket[_0x4010('0x4f')](_0x4010('0x50'),_0x1df85a);});return _0x614a7f;});});})[_0x4010('0x2a')](respondWithResult(_0x3b18b2,0xc9))[_0x4010('0x51')](handleError(_0x3b18b2,null));};function getContent(_0x34cf0d){return new BPromise(function(_0x440f40,_0x12a96a){if(_0x34cf0d[_0x4010('0x32')]){_0x440f40(_0x34cf0d[_0x4010('0x32')]);return;}return db[_0x4010('0x52')]['findOne']({'attributes':[_0x4010('0x53')],'where':{'id':_0x34cf0d[_0x4010('0x34')]},'raw':!![]})[_0x4010('0x2a')](function(_0x4e3287){if(!_0x4e3287)throw new db['Sequelize'][(_0x4010('0x36'))](_0x4010('0x54'));var _0x450f21=Mustache[_0x4010('0x55')](_0x4e3287[_0x4010('0x53')],_0x34cf0d[_0x4010('0x38')]);_0x440f40(_0x450f21);})[_0x4010('0x51')](function(_0x2dd1a1){_0x12a96a(_0x2dd1a1);});});}function getRecipients(_0x22cacc){return new BPromise(function(_0x22c91d,_0x527e38){var _0xd5edc5=[];var _0xb98723=[];_0x22cacc['forEach'](function(_0x20d777){var _0x57375a=_[_0x4010('0x56')](_0x20d777[_0x4010('0x57')][_0x4010('0x43')]());if(_0x57375a===_0x4010('0x58')){_0xd5edc5=_[_0x4010('0x59')](_0xd5edc5,_0x20d777[_0x4010('0x5a')]);}else{if(_[_0x4010('0x42')](_0x57375a,_0x4010('0x5b')))_0x57375a=_0x57375a['replace'](_0x4010('0x5b'),_0x4010('0x5c'));_0x20d777['ids'][_0x4010('0x4d')](function(_0x1d94e8){_0xb98723[_0x4010('0x5d')](getAgents(_0x57375a,_0x1d94e8));});}});return BPromise[_0x4010('0x5e')](_0xb98723)[_0x4010('0x2a')](function(_0x30e6b1){_0xd5edc5=_['union'](_0xd5edc5,_['flatten'](_0x30e6b1));_0x22c91d(_0xd5edc5);})[_0x4010('0x51')](function(_0x5586e1){_0x527e38(_0x5586e1);});});}function getAgents(_0x40f228,_0x4da97e){return new BPromise(function(_0x555813,_0x114ea6){return db[_0x40f228]['findOne']({'where':{'id':_0x4da97e}})[_0x4010('0x2a')](function(_0x5f288c){return _0x5f288c[_0x4010('0x5f')]({'attributes':['id'],'raw':!![]})[_0x4010('0x2a')](function(_0x354900){var _0x36c2a2=_[_0x4010('0x60')](_0x354900,'id');_0x555813(_0x36c2a2);});})['catch'](function(_0x546b7d){_0x114ea6(_0x546b7d);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 361afdb..f46e127 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 _0x1861=['hook','exports','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x226c11,_0x14c0a4){var _0x4dc73e=function(_0x17e242){while(--_0x17e242){_0x226c11['push'](_0x226c11['shift']());}};_0x4dc73e(++_0x14c0a4);}(_0x1861,0xd1));var _0x1186=function(_0x8e45f4,_0x4ec7fb){_0x8e45f4=_0x8e45f4-0x0;var _0x547279=_0x1861[_0x8e45f4];return _0x547279;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0x1186('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x1186('0x1')](0x0);var events={'afterCreate':_0x1186('0x2'),'afterUpdate':_0x1186('0x3'),'afterDestroy':_0x1186('0x4')};function emitEvent(_0x564284){return function(_0x3d0eae,_0x62736a,_0x460cee){UserNotificationEvents[_0x1186('0x5')](_0x564284+':'+_0x3d0eae['id'],_0x3d0eae);UserNotificationEvents[_0x1186('0x5')](_0x564284,_0x3d0eae);_0x460cee(null);};}for(var e in events){if(events[_0x1186('0x6')](e)){var event=events[e];UserNotification[_0x1186('0x7')](e,emitEvent(event));}}module[_0x1186('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x9653=['setMaxListeners','save','remove','emit','hook','exports','events','../../mysqldb','UserNotification'];(function(_0x37d225,_0x2ed664){var _0x26834b=function(_0x32260c){while(--_0x32260c){_0x37d225['push'](_0x37d225['shift']());}};_0x26834b(++_0x2ed664);}(_0x9653,0x1da));var _0x3965=function(_0x1e4032,_0x48c1f7){_0x1e4032=_0x1e4032-0x0;var _0x118ca8=_0x9653[_0x1e4032];return _0x118ca8;};'use strict';var EventEmitter=require(_0x3965('0x0'));var UserNotification=require(_0x3965('0x1'))['db'][_0x3965('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x3965('0x3')](0x0);var events={'afterCreate':_0x3965('0x4'),'afterUpdate':'update','afterDestroy':_0x3965('0x5')};function emitEvent(_0x4b2e42){return function(_0x4eb796,_0x403873,_0x176c5b){UserNotificationEvents[_0x3965('0x6')](_0x4b2e42+':'+_0x4eb796['id'],_0x4eb796);UserNotificationEvents['emit'](_0x4b2e42,_0x4eb796);_0x176c5b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x3965('0x7')](e,emitEvent(event));}}module[_0x3965('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 8e13528..e37cf7f 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 _0xbee1=['userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define'];(function(_0x53a56f,_0x38f8c0){var _0x33bc06=function(_0x2967b5){while(--_0x2967b5){_0x53a56f['push'](_0x53a56f['shift']());}};_0x33bc06(++_0x38f8c0);}(_0xbee1,0xb3));var _0x1bee=function(_0x23a484,_0x2db584){_0x23a484=_0x23a484-0x0;var _0x579e05=_0xbee1[_0x23a484];return _0x579e05;};'use strict';var _=require(_0x1bee('0x0'));var util=require(_0x1bee('0x1'));var logger=require(_0x1bee('0x2'))(_0x1bee('0x3'));var moment=require(_0x1bee('0x4'));var BPromise=require(_0x1bee('0x5'));var rp=require(_0x1bee('0x6'));var fs=require('fs');var path=require(_0x1bee('0x7'));var rimraf=require(_0x1bee('0x8'));var config=require(_0x1bee('0x9'));var attributes=require(_0x1bee('0xa'));module[_0x1bee('0xb')]=function(_0x3cd725,_0x5b9a1e){return _0x3cd725[_0x1bee('0xc')]('UserNotification',attributes,{'tableName':_0x1bee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1bee('0xe'),'collate':_0x1bee('0xf')});}; \ No newline at end of file +var _0xa5ae=['../../config/environment','./userNotification.attributes','exports','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x529a06,_0x4ed039){var _0x5ce753=function(_0x1f7179){while(--_0x1f7179){_0x529a06['push'](_0x529a06['shift']());}};_0x5ce753(++_0x4ed039);}(_0xa5ae,0x157));var _0xea5a=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0xa5ae[_0x44c768];return _0x55daf5;};'use strict';var _=require(_0xea5a('0x0'));var util=require(_0xea5a('0x1'));var logger=require(_0xea5a('0x2'))('api');var moment=require(_0xea5a('0x3'));var BPromise=require('bluebird');var rp=require(_0xea5a('0x4'));var fs=require('fs');var path=require(_0xea5a('0x5'));var rimraf=require(_0xea5a('0x6'));var config=require(_0xea5a('0x7'));var attributes=require(_0xea5a('0x8'));module[_0xea5a('0x9')]=function(_0x20250f,_0x30c776){return _0x20250f[_0xea5a('0xa')](_0xea5a('0xb'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xea5a('0xc'),'collate':_0xea5a('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 113ddbe..6a3e2c7 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 _0xaa58=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result'];(function(_0x4ce5b1,_0x438620){var _0xb5ccfc=function(_0x14b56e){while(--_0x14b56e){_0x4ce5b1['push'](_0x4ce5b1['shift']());}};_0xb5ccfc(++_0x438620);}(_0xaa58,0x188));var _0x8aa5=function(_0x4403e0,_0x26be98){_0x4403e0=_0x4403e0-0x0;var _0x4aa5e4=_0xaa58[_0x4403e0];return _0x4aa5e4;};'use strict';var _=require(_0x8aa5('0x0'));var util=require(_0x8aa5('0x1'));var moment=require(_0x8aa5('0x2'));var BPromise=require('bluebird');var rs=require(_0x8aa5('0x3'));var fs=require('fs');var Redis=require(_0x8aa5('0x4'));var db=require(_0x8aa5('0x5'))['db'];var utils=require(_0x8aa5('0x6'));var logger=require(_0x8aa5('0x7'))(_0x8aa5('0x8'));var config=require('../../config/environment');var jayson=require(_0x8aa5('0x9'));var client=jayson[_0x8aa5('0xa')][_0x8aa5('0xb')]({'port':0x232a});config[_0x8aa5('0xc')]=_['defaults'](config[_0x8aa5('0xc')],{'host':_0x8aa5('0xd'),'port':0x18eb});var socket=require(_0x8aa5('0xe'))(new Redis(config[_0x8aa5('0xc')]));require(_0x8aa5('0xf'))[_0x8aa5('0x10')](socket);function respondWithRpcPromise(_0x1c7e93,_0x27dd1f,_0x8d050d){return new BPromise(function(_0x2c2386,_0x307ee3){return client[_0x8aa5('0x11')](_0x1c7e93,_0x8d050d)[_0x8aa5('0x12')](function(_0x3e8d11){logger[_0x8aa5('0x13')](_0x8aa5('0x14'),_0x27dd1f,'request\x20sent');logger[_0x8aa5('0x15')](_0x8aa5('0x16'),_0x27dd1f,'request\x20sent',JSON['stringify'](_0x3e8d11));if(_0x3e8d11[_0x8aa5('0x17')]){if(_0x3e8d11['error'][_0x8aa5('0x18')]===0x1f4){logger['error'](_0x8aa5('0x14'),_0x27dd1f,_0x3e8d11[_0x8aa5('0x17')][_0x8aa5('0x19')]);return _0x307ee3(_0x3e8d11[_0x8aa5('0x17')][_0x8aa5('0x19')]);}logger[_0x8aa5('0x17')](_0x8aa5('0x14'),_0x27dd1f,_0x3e8d11['error'][_0x8aa5('0x19')]);return _0x2c2386(_0x3e8d11[_0x8aa5('0x17')][_0x8aa5('0x19')]);}else{logger[_0x8aa5('0x13')](_0x8aa5('0x14'),_0x27dd1f,_0x8aa5('0x1a'));_0x2c2386(_0x3e8d11[_0x8aa5('0x1b')][_0x8aa5('0x19')]);}})['catch'](function(_0x202cad){logger[_0x8aa5('0x17')](_0x8aa5('0x14'),_0x27dd1f,_0x202cad);_0x307ee3(_0x202cad);});});} \ No newline at end of file +var _0x0f13=['stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0x0f13,0xde));var _0x30f1=function(_0x147897,_0x59c00a){_0x147897=_0x147897-0x0;var _0x3757ea=_0x0f13[_0x147897];return _0x3757ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x30f1('0x0'));var BPromise=require(_0x30f1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x30f1('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x30f1('0x3'));var logger=require(_0x30f1('0x4'))(_0x30f1('0x5'));var config=require(_0x30f1('0x6'));var jayson=require(_0x30f1('0x7'));var client=jayson['client'][_0x30f1('0x8')]({'port':0x232a});config[_0x30f1('0x9')]=_[_0x30f1('0xa')](config['redis'],{'host':_0x30f1('0xb'),'port':0x18eb});var socket=require(_0x30f1('0xc'))(new Redis(config[_0x30f1('0x9')]));require(_0x30f1('0xd'))[_0x30f1('0xe')](socket);function respondWithRpcPromise(_0x2bb2ba,_0x4e866e,_0x4c7fde){return new BPromise(function(_0x4991cf,_0x44017e){return client['request'](_0x2bb2ba,_0x4c7fde)[_0x30f1('0xf')](function(_0x41eec4){logger[_0x30f1('0x10')](_0x30f1('0x11'),_0x4e866e,_0x30f1('0x12'));logger[_0x30f1('0x13')](_0x30f1('0x14'),_0x4e866e,_0x30f1('0x12'),JSON[_0x30f1('0x15')](_0x41eec4));if(_0x41eec4[_0x30f1('0x16')]){if(_0x41eec4[_0x30f1('0x16')][_0x30f1('0x17')]===0x1f4){logger[_0x30f1('0x16')](_0x30f1('0x11'),_0x4e866e,_0x41eec4[_0x30f1('0x16')][_0x30f1('0x18')]);return _0x44017e(_0x41eec4[_0x30f1('0x16')][_0x30f1('0x18')]);}logger[_0x30f1('0x16')]('UserNotification,\x20%s,\x20%s',_0x4e866e,_0x41eec4['error'][_0x30f1('0x18')]);return _0x4991cf(_0x41eec4[_0x30f1('0x16')][_0x30f1('0x18')]);}else{logger[_0x30f1('0x10')](_0x30f1('0x11'),_0x4e866e,_0x30f1('0x12'));_0x4991cf(_0x41eec4[_0x30f1('0x19')]['message']);}})[_0x30f1('0x1a')](function(_0x1aab46){logger[_0x30f1('0x16')]('UserNotification,\x20%s,\x20%s',_0x4e866e,_0x1aab46);_0x44017e(_0x1aab46);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 352f275..3c3ebd8 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 _0xefbf=['length','save','remove','update','emit','register'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0xefbf,0xe5));var _0xfefb=function(_0x36bb20,_0x57df9a){_0x36bb20=_0x36bb20-0x0;var _0xd3c635=_0xefbf[_0x36bb20];return _0xd3c635;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xfefb('0x0'),_0xfefb('0x1'),_0xfefb('0x2')];function createListener(_0x5099bb,_0x3092c0){return function(_0x3d4537){_0x3092c0[_0xfefb('0x3')](_0x5099bb,_0x3d4537);};}function removeListener(_0x7fa79f,_0x1028b1){return function(){UserNotificationEvents['removeListener'](_0x7fa79f,_0x1028b1);};}exports[_0xfefb('0x4')]=function(_0xf39e44){for(var _0x2b8b29=0x0,_0x1c9a7c=events[_0xfefb('0x5')];_0x2b8b29<_0x1c9a7c;_0x2b8b29++){var _0x22c3a7=events[_0x2b8b29];var _0x9c9830=createListener('userNotification:'+_0x22c3a7,_0xf39e44);UserNotificationEvents['on'](_0x22c3a7,_0x9c9830);}}; \ No newline at end of file +var _0xbfa1=['./userNotification.events','remove','emit','length'];(function(_0x393d8d,_0x1cda65){var _0x96148b=function(_0xe809d0){while(--_0xe809d0){_0x393d8d['push'](_0x393d8d['shift']());}};_0x96148b(++_0x1cda65);}(_0xbfa1,0x7c));var _0x1bfa=function(_0x3147b3,_0xb305c6){_0x3147b3=_0x3147b3-0x0;var _0x7690aa=_0xbfa1[_0x3147b3];return _0x7690aa;};'use strict';var UserNotificationEvents=require(_0x1bfa('0x0'));var events=['save',_0x1bfa('0x1'),'update'];function createListener(_0x356e37,_0x226939){return function(_0x41fb32){_0x226939[_0x1bfa('0x2')](_0x356e37,_0x41fb32);};}function removeListener(_0x2aa391,_0x2881e7){return function(){UserNotificationEvents['removeListener'](_0x2aa391,_0x2881e7);};}exports['register']=function(_0x328887){for(var _0x293626=0x0,_0x37417a=events[_0x1bfa('0x3')];_0x293626<_0x37417a;_0x293626++){var _0x2e41ee=events[_0x293626];var _0x19de35=createListener('userNotification:'+_0x2e41ee,_0x328887);UserNotificationEvents['on'](_0x2e41ee,_0x19de35);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 5aaca23..7fa8e7d 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x50e065,_0x4a6ee9){var _0x4fe802=function(_0x2b6548){while(--_0x2b6548){_0x50e065['push'](_0x50e065['shift']());}};_0x4fe802(++_0x4a6ee9);}(_0xedd9,0xfc));var _0x9edd=function(_0x44ed77,_0x168347){_0x44ed77=_0x44ed77-0x0;var _0x3ad8b8=_0xedd9[_0x44ed77];return _0x3ad8b8;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5dc6f5,_0x4f73b8){var _0x622454=function(_0x2bb17a){while(--_0x2bb17a){_0x5dc6f5['push'](_0x5dc6f5['shift']());}};_0x622454(++_0x4f73b8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xcb91[_0x609988];return _0x159984;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index f2ed445..f34dc18 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 _0x34f9=['exports','INTEGER','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x34f9,0x158));var _0x934f=function(_0x40852a,_0x192b56){_0x40852a=_0x40852a-0x0;var _0x24ffc0=_0x34f9[_0x40852a];return _0x24ffc0;};'use strict';var Sequelize=require(_0x934f('0x0'));module[_0x934f('0x1')]={'penalty':{'type':Sequelize[_0x934f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcaf1=['INTEGER','sequelize'];(function(_0x50d61d,_0x3e7a4e){var _0x26b5a4=function(_0x322381){while(--_0x322381){_0x50d61d['push'](_0x50d61d['shift']());}};_0x26b5a4(++_0x3e7a4e);}(_0xcaf1,0x71));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1caf('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1caf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index d28c79d..132a75b 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 _0x51db=['user_has_openchannel_queues','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define'];(function(_0x48eec8,_0x220f7f){var _0x3755cb=function(_0x3a9963){while(--_0x3a9963){_0x48eec8['push'](_0x48eec8['shift']());}};_0x3755cb(++_0x220f7f);}(_0x51db,0x156));var _0xb51d=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x51db[_0x43a37c];return _0x5d1d40;};'use strict';var _=require(_0xb51d('0x0'));var util=require('util');var logger=require(_0xb51d('0x1'))(_0xb51d('0x2'));var moment=require(_0xb51d('0x3'));var BPromise=require('bluebird');var rp=require(_0xb51d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb51d('0x5'));var config=require(_0xb51d('0x6'));var attributes=require(_0xb51d('0x7'));module[_0xb51d('0x8')]=function(_0xb6eac8,_0x29869e){return _0xb6eac8[_0xb51d('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0xb51d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12e1=['api','moment','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util'];(function(_0x3e06a2,_0x1afff5){var _0x594b13=function(_0x54c641){while(--_0x54c641){_0x3e06a2['push'](_0x3e06a2['shift']());}};_0x594b13(++_0x1afff5);}(_0x12e1,0x1de));var _0x112e=function(_0x34f980,_0x54f0ed){_0x34f980=_0x34f980-0x0;var _0xcd1aa9=_0x12e1[_0x34f980];return _0xcd1aa9;};'use strict';var _=require(_0x112e('0x0'));var util=require(_0x112e('0x1'));var logger=require('../../config/logger')(_0x112e('0x2'));var moment=require(_0x112e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x112e('0x4'));var rimraf=require(_0x112e('0x5'));var config=require(_0x112e('0x6'));var attributes=require(_0x112e('0x7'));module['exports']=function(_0x2ceef7,_0x2acceb){return _0x2ceef7['define'](_0x112e('0x8'),attributes,{'tableName':_0x112e('0x9'),'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 e5a5827..0aea86a 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 _0x0530=['util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x4309e6,_0x328456){var _0x4f5ff8=function(_0x14f213){while(--_0x14f213){_0x4309e6['push'](_0x4309e6['shift']());}};_0x4f5ff8(++_0x328456);}(_0x0530,0x72));var _0x0053=function(_0x336ef2,_0x83fd79){_0x336ef2=_0x336ef2-0x0;var _0x324fe=_0x0530[_0x336ef2];return _0x324fe;};'use strict';var _=require(_0x0053('0x0'));var util=require(_0x0053('0x1'));var moment=require('moment');var BPromise=require(_0x0053('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0053('0x3'));var db=require(_0x0053('0x4'))['db'];var utils=require(_0x0053('0x5'));var logger=require('../../config/logger')(_0x0053('0x6'));var config=require(_0x0053('0x7'));var jayson=require(_0x0053('0x8'));var client=jayson[_0x0053('0x9')][_0x0053('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e244d,_0x5beedd,_0x27fcf9){return new BPromise(function(_0x4db241,_0x42a345){return client[_0x0053('0xb')](_0x4e244d,_0x27fcf9)[_0x0053('0xc')](function(_0x572bf0){logger[_0x0053('0xd')](_0x0053('0xe'),_0x5beedd,'request\x20sent');logger[_0x0053('0xf')](_0x0053('0x10'),_0x5beedd,_0x0053('0x11'),JSON['stringify'](_0x572bf0));if(_0x572bf0[_0x0053('0x12')]){if(_0x572bf0['error'][_0x0053('0x13')]===0x1f4){logger['error'](_0x0053('0xe'),_0x5beedd,_0x572bf0['error'][_0x0053('0x14')]);return _0x42a345(_0x572bf0[_0x0053('0x12')][_0x0053('0x14')]);}logger['error'](_0x0053('0xe'),_0x5beedd,_0x572bf0[_0x0053('0x12')][_0x0053('0x14')]);return _0x4db241(_0x572bf0[_0x0053('0x12')][_0x0053('0x14')]);}else{logger[_0x0053('0xd')](_0x0053('0xe'),_0x5beedd,_0x0053('0x11'));_0x4db241(_0x572bf0[_0x0053('0x15')][_0x0053('0x14')]);}})[_0x0053('0x16')](function(_0x62dce5){logger[_0x0053('0x12')](_0x0053('0xe'),_0x5beedd,_0x62dce5);_0x42a345(_0x62dce5);});});} \ No newline at end of file +var _0x65fc=['code','message','info','result','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x114efe,_0x29836c){var _0x1d46ed=function(_0x2e6d03){while(--_0x2e6d03){_0x114efe['push'](_0x114efe['shift']());}};_0x1d46ed(++_0x29836c);}(_0x65fc,0x1bd));var _0xc65f=function(_0x312b60,_0x14d3a2){_0x312b60=_0x312b60-0x0;var _0xb70116=_0x65fc[_0x312b60];return _0xb70116;};'use strict';var _=require(_0xc65f('0x0'));var util=require('util');var moment=require(_0xc65f('0x1'));var BPromise=require('bluebird');var rs=require(_0xc65f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc65f('0x3'));var logger=require(_0xc65f('0x4'))(_0xc65f('0x5'));var config=require(_0xc65f('0x6'));var jayson=require(_0xc65f('0x7'));var client=jayson[_0xc65f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c5d5c,_0x445afb,_0x3c400d){return new BPromise(function(_0x5387c9,_0x217aca){return client[_0xc65f('0x9')](_0x2c5d5c,_0x3c400d)[_0xc65f('0xa')](function(_0x421802){logger['info'](_0xc65f('0xb'),_0x445afb,_0xc65f('0xc'));logger[_0xc65f('0xd')](_0xc65f('0xe'),_0x445afb,'request\x20sent',JSON[_0xc65f('0xf')](_0x421802));if(_0x421802[_0xc65f('0x10')]){if(_0x421802['error'][_0xc65f('0x11')]===0x1f4){logger['error'](_0xc65f('0xb'),_0x445afb,_0x421802[_0xc65f('0x10')][_0xc65f('0x12')]);return _0x217aca(_0x421802['error'][_0xc65f('0x12')]);}logger[_0xc65f('0x10')](_0xc65f('0xb'),_0x445afb,_0x421802[_0xc65f('0x10')][_0xc65f('0x12')]);return _0x5387c9(_0x421802['error'][_0xc65f('0x12')]);}else{logger[_0xc65f('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x445afb,_0xc65f('0xc'));_0x5387c9(_0x421802[_0xc65f('0x14')][_0xc65f('0x12')]);}})['catch'](function(_0xf89a29){logger[_0xc65f('0x10')](_0xc65f('0xb'),_0x445afb,_0xf89a29);_0x217aca(_0xf89a29);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 50ec238..536e401 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 _0x37f8=['getSections','/:id/resources','getResources','post','/:id/clone','addResources','put','update','delete','destroy','removeResources','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','index','isAuthenticated','describe','/:id','show','/:id/sections'];(function(_0x352c0f,_0x3109c1){var _0x39a584=function(_0x5b0f58){while(--_0x5b0f58){_0x352c0f['push'](_0x352c0f['shift']());}};_0x39a584(++_0x3109c1);}(_0x37f8,0x1ab));var _0x837f=function(_0x418ece,_0x40f4e8){_0x418ece=_0x418ece-0x0;var _0xed1034=_0x37f8[_0x418ece];return _0xed1034;};'use strict';var multer=require(_0x837f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x837f('0x1'));var express=require(_0x837f('0x2'));var router=express[_0x837f('0x3')]();var fs_extra=require(_0x837f('0x4'));var auth=require(_0x837f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x837f('0x6'));var controller=require(_0x837f('0x7'));router[_0x837f('0x8')]('/',auth['isAuthenticated'](),controller[_0x837f('0x9')]);router[_0x837f('0x8')]('/describe',auth[_0x837f('0xa')](),controller[_0x837f('0xb')]);router[_0x837f('0x8')](_0x837f('0xc'),auth[_0x837f('0xa')](),controller[_0x837f('0xd')]);router[_0x837f('0x8')](_0x837f('0xe'),auth[_0x837f('0xa')](),controller[_0x837f('0xf')]);router['get'](_0x837f('0x10'),auth[_0x837f('0xa')](),controller[_0x837f('0x11')]);router['post']('/',auth[_0x837f('0xa')](),controller['create']);router[_0x837f('0x12')](_0x837f('0x13'),auth[_0x837f('0xa')](),controller['clone']);router[_0x837f('0x12')](_0x837f('0xe'),auth[_0x837f('0xa')](),controller['addSections']);router[_0x837f('0x12')](_0x837f('0x10'),auth['isAuthenticated'](),controller[_0x837f('0x14')]);router[_0x837f('0x15')](_0x837f('0xc'),auth[_0x837f('0xa')](),controller[_0x837f('0x16')]);router[_0x837f('0x17')](_0x837f('0xc'),auth[_0x837f('0xa')](),controller[_0x837f('0x18')]);router[_0x837f('0x17')](_0x837f('0xe'),auth[_0x837f('0xa')](),controller['removeSections']);router[_0x837f('0x17')](_0x837f('0x10'),auth[_0x837f('0xa')](),controller[_0x837f('0x19')]);module['exports']=router; \ No newline at end of file +var _0xf5c1=['removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','delete'];(function(_0x257e3e,_0x561626){var _0x1244c6=function(_0x1a4f46){while(--_0x1a4f46){_0x257e3e['push'](_0x257e3e['shift']());}};_0x1244c6(++_0x561626);}(_0xf5c1,0x1a7));var _0x1f5c=function(_0x34ecbf,_0x210898){_0x34ecbf=_0x34ecbf-0x0;var _0x115f8a=_0xf5c1[_0x34ecbf];return _0x115f8a;};'use strict';var multer=require(_0x1f5c('0x0'));var util=require(_0x1f5c('0x1'));var path=require(_0x1f5c('0x2'));var timeout=require(_0x1f5c('0x3'));var express=require(_0x1f5c('0x4'));var router=express[_0x1f5c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1f5c('0x6'));var interaction=require(_0x1f5c('0x7'));var config=require(_0x1f5c('0x8'));var controller=require(_0x1f5c('0x9'));router[_0x1f5c('0xa')]('/',auth[_0x1f5c('0xb')](),controller['index']);router[_0x1f5c('0xa')](_0x1f5c('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x1f5c('0xd'),auth[_0x1f5c('0xb')](),controller[_0x1f5c('0xe')]);router[_0x1f5c('0xa')](_0x1f5c('0xf'),auth['isAuthenticated'](),controller[_0x1f5c('0x10')]);router[_0x1f5c('0xa')](_0x1f5c('0x11'),auth[_0x1f5c('0xb')](),controller[_0x1f5c('0x12')]);router[_0x1f5c('0x13')]('/',auth[_0x1f5c('0xb')](),controller[_0x1f5c('0x14')]);router[_0x1f5c('0x13')](_0x1f5c('0x15'),auth[_0x1f5c('0xb')](),controller[_0x1f5c('0x16')]);router['post'](_0x1f5c('0xf'),auth['isAuthenticated'](),controller[_0x1f5c('0x17')]);router['post']('/:id/resources',auth[_0x1f5c('0xb')](),controller[_0x1f5c('0x18')]);router[_0x1f5c('0x19')](_0x1f5c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x1f5c('0x1a')](_0x1f5c('0xd'),auth[_0x1f5c('0xb')](),controller['destroy']);router[_0x1f5c('0x1a')](_0x1f5c('0xf'),auth[_0x1f5c('0xb')](),controller[_0x1f5c('0x1b')]);router[_0x1f5c('0x1a')](_0x1f5c('0x11'),auth[_0x1f5c('0xb')](),controller[_0x1f5c('0x1c')]);module[_0x1f5c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index f7a6c74..70c0aeb 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 _0x39cd=['split','BOOLEAN','sequelize','exports','STRING','name','crudPermissions','getDataValue'];(function(_0x18216c,_0x4adb34){var _0x23aa05=function(_0x1c9faf){while(--_0x1c9faf){_0x18216c['push'](_0x18216c['shift']());}};_0x23aa05(++_0x4adb34);}(_0x39cd,0x182));var _0xd39c=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x39cd[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0xd39c('0x0'));module[_0xd39c('0x1')]={'name':{'type':Sequelize[_0xd39c('0x2')],'allowNull':![],'unique':_0xd39c('0x3')},'crudPermissions':{'type':Sequelize[_0xd39c('0x2')],'set':function(_0x391c86){this['setDataValue'](_0xd39c('0x4'),_0x391c86?_0x391c86['join'](''):[]);},'get':function(){return this[_0xd39c('0x5')](_0xd39c('0x4'))?this[_0xd39c('0x5')](_0xd39c('0x4'))[_0xd39c('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd39c('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd39c('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xd39c('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd39c('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd39c('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd39c('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd39c('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd39c('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd39c('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xbfe1=['BOOLEAN','sequelize','name','STRING','setDataValue','crudPermissions','join','getDataValue'];(function(_0x5dab64,_0x2a01f2){var _0x1f99f5=function(_0x5cf221){while(--_0x5cf221){_0x5dab64['push'](_0x5dab64['shift']());}};_0x1f99f5(++_0x2a01f2);}(_0xbfe1,0x111));var _0x1bfe=function(_0xf9301f,_0x5d4b1c){_0xf9301f=_0xf9301f-0x0;var _0x55f6fb=_0xbfe1[_0xf9301f];return _0x55f6fb;};'use strict';var Sequelize=require(_0x1bfe('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1bfe('0x1')},'crudPermissions':{'type':Sequelize[_0x1bfe('0x2')],'set':function(_0x57b3a2){this[_0x1bfe('0x3')](_0x1bfe('0x4'),_0x57b3a2?_0x57b3a2[_0x1bfe('0x5')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x1bfe('0x6')](_0x1bfe('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x1bfe('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x1bfe('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x1bfe('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1bfe('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x1bfe('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index d67d14c..aee5d55 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 _0x1c7c=['rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','UserProfile','includeAll','include','findAll','rows','catch','params','find','create','clone','get','omit','createdAt','body','updatedAt','transaction','UserProfileSection','each','sectionId','userProfileId','Resources','describe','addSections','sequelize','UserProfileResource','push','removeSections','ids','enabled','includes','isEmpty','subsections','autoAssociation','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format'];(function(_0x3a20ae,_0x3233b1){var _0x4a012d=function(_0x2450c5){while(--_0x2450c5){_0x3a20ae['push'](_0x3a20ae['shift']());}};_0x4a012d(++_0x3233b1);}(_0x1c7c,0x164));var _0xc1c7=function(_0x184bc0,_0x4dc26d){_0x184bc0=_0x184bc0-0x0;var _0x3f3e2e=_0x1c7c[_0x184bc0];return _0x3f3e2e;};'use strict';var emlformat=require(_0xc1c7('0x0'));var rimraf=require(_0xc1c7('0x1'));var zipdir=require(_0xc1c7('0x2'));var jsonpatch=require(_0xc1c7('0x3'));var rp=require('request-promise');var moment=require(_0xc1c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1c7('0x5'));var util=require(_0xc1c7('0x6'));var path=require(_0xc1c7('0x7'));var sox=require(_0xc1c7('0x8'));var csv=require(_0xc1c7('0x9'));var ejs=require(_0xc1c7('0xa'));var fs=require('fs');var fs_extra=require(_0xc1c7('0xb'));var _=require(_0xc1c7('0xc'));var squel=require(_0xc1c7('0xd'));var crypto=require(_0xc1c7('0xe'));var jsforce=require(_0xc1c7('0xf'));var deskjs=require(_0xc1c7('0x10'));var toCsv=require(_0xc1c7('0x9'));var querystring=require(_0xc1c7('0x11'));var Papa=require(_0xc1c7('0x12'));var Redis=require(_0xc1c7('0x13'));var authService=require(_0xc1c7('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc1c7('0x15'));var hardwareService=require(_0xc1c7('0x16'));var logger=require('../../config/logger')(_0xc1c7('0x17'));var utils=require(_0xc1c7('0x18'));var config=require(_0xc1c7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1c7('0x1a'))['db'];config[_0xc1c7('0x1b')]=_[_0xc1c7('0x1c')](config[_0xc1c7('0x1b')],{'host':_0xc1c7('0x1d'),'port':0x18eb});var socket=require(_0xc1c7('0x1e'))(new Redis(config[_0xc1c7('0x1b')]));require(_0xc1c7('0x1f'))[_0xc1c7('0x20')](socket);function respondWithStatusCode(_0x1b6905,_0x99b874){_0x99b874=_0x99b874||0xcc;return function(_0x34d392){if(_0x34d392){return _0x1b6905['sendStatus'](_0x99b874);}return _0x1b6905[_0xc1c7('0x21')](_0x99b874)[_0xc1c7('0x22')]();};}function respondWithResult(_0x21911c,_0x555b59){_0x555b59=_0x555b59||0xc8;return function(_0x94678a){if(_0x94678a){return _0x21911c[_0xc1c7('0x21')](_0x555b59)[_0xc1c7('0x23')](_0x94678a);}};}function respondWithFilteredResult(_0x39ac54,_0x20439e){return function(_0xb42702){if(_0xb42702){var _0x21758a=typeof _0x20439e[_0xc1c7('0x24')]==='undefined'&&typeof _0x20439e[_0xc1c7('0x25')]===_0xc1c7('0x26');var _0x3ec66a=_0xb42702[_0xc1c7('0x27')];var _0x4b706e=_0x21758a?0x0:_0x20439e[_0xc1c7('0x24')];var _0x4d6171=_0x21758a?_0xb42702[_0xc1c7('0x27')]:_0x20439e[_0xc1c7('0x24')]+_0x20439e['limit'];var _0x5846f0;if(_0x4d6171>=_0x3ec66a){_0x4d6171=_0x3ec66a;_0x5846f0=0xc8;}else{_0x5846f0=0xce;}_0x39ac54[_0xc1c7('0x21')](_0x5846f0);return _0x39ac54[_0xc1c7('0x28')](_0xc1c7('0x29'),_0x4b706e+'-'+_0x4d6171+'/'+_0x3ec66a)['json'](_0xb42702);}return null;};}function patchUpdates(_0x813853){return function(_0x341b41){try{jsonpatch[_0xc1c7('0x2a')](_0x341b41,_0x813853,!![]);}catch(_0x31a0e0){return BPromise[_0xc1c7('0x2b')](_0x31a0e0);}return _0x341b41[_0xc1c7('0x2c')]();};}function saveUpdates(_0x3180fd,_0x120168){return function(_0x22b654){if(_0x22b654){return _0x22b654[_0xc1c7('0x2d')](_0x3180fd)[_0xc1c7('0x2e')](function(_0x363fbc){return _0x363fbc;});}return null;};}function removeEntity(_0x33aac7,_0x260a3f){return function(_0xf1c405){if(_0xf1c405){return _0xf1c405[_0xc1c7('0x2f')]()['then'](function(){_0x33aac7[_0xc1c7('0x21')](0xcc)[_0xc1c7('0x22')]();});}};}function handleEntityNotFound(_0x4e1721,_0x52a1d5){return function(_0x352f24){if(!_0x352f24){_0x4e1721['sendStatus'](0x194);}return _0x352f24;};}function handleError(_0x544fbb,_0x541f12){_0x541f12=_0x541f12||0x1f4;return function(_0x1b873c){logger[_0xc1c7('0x30')](_0x1b873c[_0xc1c7('0x31')]);if(_0x1b873c[_0xc1c7('0x32')]){delete _0x1b873c['name'];}_0x544fbb['status'](_0x541f12)[_0xc1c7('0x33')](_0x1b873c);};}exports[_0xc1c7('0x34')]=function(_0x9a0ab3,_0x3a786f){var _0x2e35f1={},_0x4968b0={},_0x50042f={'count':0x0,'rows':[]};var _0x125920=_[_0xc1c7('0x35')](db['UserProfile'][_0xc1c7('0x36')],function(_0x3cf425){return{'name':_0x3cf425[_0xc1c7('0x37')],'type':_0x3cf425[_0xc1c7('0x38')][_0xc1c7('0x39')]};});_0x4968b0[_0xc1c7('0x3a')]=_[_0xc1c7('0x35')](_0x125920,'name');_0x4968b0[_0xc1c7('0x3b')]=_[_0xc1c7('0x3c')](_0x9a0ab3[_0xc1c7('0x3b')]);_0x4968b0[_0xc1c7('0x3d')]=_[_0xc1c7('0x3e')](_0x4968b0[_0xc1c7('0x3a')],_0x4968b0[_0xc1c7('0x3b')]);_0x2e35f1[_0xc1c7('0x3f')]=_[_0xc1c7('0x3e')](_0x4968b0['model'],qs['fields'](_0x9a0ab3[_0xc1c7('0x3b')][_0xc1c7('0x40')]));_0x2e35f1[_0xc1c7('0x3f')]=_0x2e35f1[_0xc1c7('0x3f')][_0xc1c7('0x41')]?_0x2e35f1[_0xc1c7('0x3f')]:_0x4968b0[_0xc1c7('0x3a')];if(!_0x9a0ab3[_0xc1c7('0x3b')][_0xc1c7('0x42')](_0xc1c7('0x43'))){_0x2e35f1[_0xc1c7('0x25')]=qs[_0xc1c7('0x25')](_0x9a0ab3[_0xc1c7('0x3b')][_0xc1c7('0x25')]);_0x2e35f1[_0xc1c7('0x24')]=qs[_0xc1c7('0x24')](_0x9a0ab3[_0xc1c7('0x3b')][_0xc1c7('0x24')]);}_0x2e35f1[_0xc1c7('0x44')]=qs[_0xc1c7('0x45')](_0x9a0ab3[_0xc1c7('0x3b')]['sort']);_0x2e35f1['where']=qs['filters'](_[_0xc1c7('0x46')](_0x9a0ab3['query'],_0x4968b0['filters']),_0x125920);if(_0x9a0ab3[_0xc1c7('0x3b')][_0xc1c7('0x47')]){_0x2e35f1[_0xc1c7('0x48')]=_[_0xc1c7('0x49')](_0x2e35f1['where'],{'$or':_[_0xc1c7('0x35')](_0x125920,function(_0x25e005){if(_0x25e005[_0xc1c7('0x38')]!==_0xc1c7('0x4a')){var _0x1a395c={};_0x1a395c[_0x25e005[_0xc1c7('0x32')]]={'$like':'%'+_0x9a0ab3[_0xc1c7('0x3b')][_0xc1c7('0x47')]+'%'};return _0x1a395c;}})});}_0x2e35f1=_[_0xc1c7('0x49')]({},_0x2e35f1,_0x9a0ab3[_0xc1c7('0x4b')]);var _0x955ba6={'where':_0x2e35f1[_0xc1c7('0x48')]};return db[_0xc1c7('0x4c')]['count'](_0x955ba6)[_0xc1c7('0x2e')](function(_0x412520){_0x50042f['count']=_0x412520;if(_0x9a0ab3[_0xc1c7('0x3b')][_0xc1c7('0x4d')]){_0x2e35f1[_0xc1c7('0x4e')]=[{'all':!![]}];}return db[_0xc1c7('0x4c')][_0xc1c7('0x4f')](_0x2e35f1);})[_0xc1c7('0x2e')](function(_0xd5e06a){_0x50042f[_0xc1c7('0x50')]=_0xd5e06a;return _0x50042f;})[_0xc1c7('0x2e')](respondWithFilteredResult(_0x3a786f,_0x2e35f1))[_0xc1c7('0x51')](handleError(_0x3a786f,null));};exports['show']=function(_0x14b61f,_0x16fbf5){var _0x519665={'raw':![],'where':{'id':_0x14b61f[_0xc1c7('0x52')]['id']}},_0x4c6834={};_0x4c6834[_0xc1c7('0x3a')]=_[_0xc1c7('0x3c')](db[_0xc1c7('0x4c')][_0xc1c7('0x36')]);_0x4c6834['query']=_[_0xc1c7('0x3c')](_0x14b61f[_0xc1c7('0x3b')]);_0x4c6834['filters']=_['intersection'](_0x4c6834['model'],_0x4c6834[_0xc1c7('0x3b')]);_0x519665[_0xc1c7('0x3f')]=_[_0xc1c7('0x3e')](_0x4c6834['model'],qs[_0xc1c7('0x40')](_0x14b61f[_0xc1c7('0x3b')]['fields']));_0x519665[_0xc1c7('0x3f')]=_0x519665[_0xc1c7('0x3f')][_0xc1c7('0x41')]?_0x519665[_0xc1c7('0x3f')]:_0x4c6834[_0xc1c7('0x3a')];if(_0x14b61f[_0xc1c7('0x3b')][_0xc1c7('0x4d')]){_0x519665[_0xc1c7('0x4e')]=[{'all':!![]}];}_0x519665=_[_0xc1c7('0x49')]({},_0x519665,_0x14b61f[_0xc1c7('0x4b')]);return db[_0xc1c7('0x4c')][_0xc1c7('0x53')](_0x519665)[_0xc1c7('0x2e')](handleEntityNotFound(_0x16fbf5,null))[_0xc1c7('0x2e')](respondWithResult(_0x16fbf5,null))[_0xc1c7('0x51')](handleError(_0x16fbf5,null));};exports[_0xc1c7('0x54')]=function(_0x2967b7,_0x1addc8){return db['UserProfile'][_0xc1c7('0x54')](_0x2967b7['body'],{})[_0xc1c7('0x2e')](respondWithResult(_0x1addc8,0xc9))[_0xc1c7('0x51')](handleError(_0x1addc8,null));};exports[_0xc1c7('0x55')]=function(_0x524088,_0x473e8d){var _0x24db6c={'where':{'id':_0x524088['params']['id']}},_0x4ac5c7={};_0x4ac5c7['model']=_[_0xc1c7('0x3c')](db[_0xc1c7('0x4c')]['rawAttributes']);_0x24db6c[_0xc1c7('0x3f')]=_[_0xc1c7('0x3e')](_0x4ac5c7[_0xc1c7('0x3a')],qs[_0xc1c7('0x40')](_0x524088[_0xc1c7('0x3b')][_0xc1c7('0x40')]));_0x24db6c['attributes']=_0x24db6c[_0xc1c7('0x3f')]['length']?_0x24db6c[_0xc1c7('0x3f')]:_0x4ac5c7[_0xc1c7('0x3a')];if(_0x524088[_0xc1c7('0x3b')]['includeAll']){_0x24db6c[_0xc1c7('0x4e')]=[{'all':!![]}];}_0x24db6c=_[_0xc1c7('0x49')]({},_0x24db6c,_0x524088[_0xc1c7('0x4b')]);return db[_0xc1c7('0x4c')][_0xc1c7('0x53')](_0x24db6c)[_0xc1c7('0x2e')](handleEntityNotFound(_0x473e8d,null))[_0xc1c7('0x2e')](function(_0x3eb3a5){if(_0x3eb3a5){var _0x5725af=_0x3eb3a5[_0xc1c7('0x56')]({'plain':!![]});_0x5725af=qs[_0xc1c7('0x57')](_0x5725af,['id',_0xc1c7('0x58'),'updatedAt','crudPermissions']);_0x524088[_0xc1c7('0x59')]=_[_0xc1c7('0x57')](_0x524088[_0xc1c7('0x59')],['id','createdAt',_0xc1c7('0x5a')]);return db['sequelize'][_0xc1c7('0x5b')](function(_0x4b9d7c){return db[_0xc1c7('0x4c')][_0xc1c7('0x54')](_[_0xc1c7('0x49')](_0x5725af,_0x524088[_0xc1c7('0x59')]),{'include':_0x524088[_0xc1c7('0x3b')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x4b9d7c})[_0xc1c7('0x2e')](function(_0x2ad2d5){var _0x441740=_0x2ad2d5['get']({'plain':!![]});return db[_0xc1c7('0x5c')]['findAll']({'where':{'userProfileId':_0x524088[_0xc1c7('0x52')]['id']},'raw':!![]})['then'](function(_0x39d3e2){if(_0x39d3e2){return BPromise[_0xc1c7('0x5d')](_0x39d3e2,function(_0x314232){return new BPromise(function(_0x3a94fb,_0x156d51){if(_0x314232['autoAssociation']===null||_0x314232['autoAssociation']===0x1)_0x3a94fb(null);return db['UserProfileResource'][_0xc1c7('0x4f')]({'where':{'sectionId':_0x314232['id']},'raw':!![]})[_0xc1c7('0x2e')](function(_0x1f16d1){var _0x149c0f=_[_0xc1c7('0x35')](_0x1f16d1,function(_0x33731c){return qs['omit'](_0x33731c,['id',_0xc1c7('0x58'),_0xc1c7('0x5a'),_0xc1c7('0x5e')]);});_0x3a94fb(_0x149c0f);})[_0xc1c7('0x51')](function(_0x5f4f7a){_0x156d51(_0x5f4f7a);});})[_0xc1c7('0x2e')](function(_0x19a4d7){var _0x2a0bb3=qs['omit'](_0x314232,['id',_0xc1c7('0x58'),_0xc1c7('0x5a')]);_0x2a0bb3[_0xc1c7('0x5f')]=_0x441740['id'];if(_0x19a4d7)_0x2a0bb3[_0xc1c7('0x60')]=_0x19a4d7;return _0x2a0bb3;})['then'](function(_0x552691){return db[_0xc1c7('0x5c')][_0xc1c7('0x54')](_0x552691,{'include':[{'model':db['UserProfileResource'],'as':_0xc1c7('0x60')}],'raw':!![],'transaction':_0x4b9d7c});});})[_0xc1c7('0x2e')](function(){return _0x441740;});}});});});}})['then'](respondWithResult(_0x473e8d,0xc9))[_0xc1c7('0x51')](handleError(_0x473e8d,null));};exports[_0xc1c7('0x2d')]=function(_0x4ecb39,_0x6b9337){if(_0x4ecb39[_0xc1c7('0x59')]['id']){delete _0x4ecb39[_0xc1c7('0x59')]['id'];}return db[_0xc1c7('0x4c')][_0xc1c7('0x53')]({'where':{'id':_0x4ecb39[_0xc1c7('0x52')]['id']}})[_0xc1c7('0x2e')](handleEntityNotFound(_0x6b9337,null))[_0xc1c7('0x2e')](saveUpdates(_0x4ecb39[_0xc1c7('0x59')],null))[_0xc1c7('0x2e')](respondWithResult(_0x6b9337,null))[_0xc1c7('0x51')](handleError(_0x6b9337,null));};exports[_0xc1c7('0x2f')]=function(_0x206afd,_0x3c9ffe){return db[_0xc1c7('0x4c')][_0xc1c7('0x53')]({'where':{'id':_0x206afd[_0xc1c7('0x52')]['id']}})[_0xc1c7('0x2e')](handleEntityNotFound(_0x3c9ffe,null))[_0xc1c7('0x2e')](removeEntity(_0x3c9ffe,null))[_0xc1c7('0x51')](handleError(_0x3c9ffe,null));};exports[_0xc1c7('0x61')]=function(_0x31bb3c,_0x37938a){return db[_0xc1c7('0x4c')][_0xc1c7('0x61')]()[_0xc1c7('0x2e')](respondWithResult(_0x37938a,null))[_0xc1c7('0x51')](handleError(_0x37938a,null));};exports[_0xc1c7('0x62')]=function(_0x47d58e,_0x8c88c0){var _0x244b8c=_0x47d58e[_0xc1c7('0x59')];return db[_0xc1c7('0x4c')][_0xc1c7('0x53')]({'where':{'id':_0x47d58e[_0xc1c7('0x52')]['id']}})[_0xc1c7('0x2e')](handleEntityNotFound(_0x8c88c0,null))[_0xc1c7('0x2e')](function(_0x5f4f50){if(_0x5f4f50){return db[_0xc1c7('0x63')][_0xc1c7('0x5b')](function(_0x268a41){return db[_0xc1c7('0x5c')][_0xc1c7('0x2f')]({'where':{'userProfileId':_0x47d58e[_0xc1c7('0x52')]['id'],'sectionId':_[_0xc1c7('0x35')](_0x244b8c,function(_0xa00af6){return _0xa00af6['sectionId'];})},'transaction':_0x268a41})[_0xc1c7('0x2e')](function(){var _0x2547aa=_[_0xc1c7('0x35')](_0x244b8c,function(_0x4225ce){_0x4225ce[_0xc1c7('0x5f')]=_0x47d58e[_0xc1c7('0x52')]['id'];return _0x4225ce;});var _0x426698=[];return BPromise[_0xc1c7('0x5d')](_0x2547aa,function(_0x31948f){return db[_0xc1c7('0x5c')][_0xc1c7('0x54')](_0x31948f,{'include':[{'model':db[_0xc1c7('0x64')],'as':'Resources'}],'raw':!![],'transaction':_0x268a41})['then'](function(_0x1927c3){_0x426698[_0xc1c7('0x65')](_0x1927c3[_0xc1c7('0x56')]({'plain':!![]}));});})[_0xc1c7('0x2e')](function(){return _0x426698;});});});}})[_0xc1c7('0x2e')](function(_0x258dc5){return _0x258dc5;})[_0xc1c7('0x2e')](respondWithResult(_0x8c88c0,null))[_0xc1c7('0x51')](handleError(_0x8c88c0,null));};exports[_0xc1c7('0x66')]=function(_0xd5e555,_0x180607){var _0x1a59f0;return db[_0xc1c7('0x4c')]['find']({'where':{'id':_0xd5e555[_0xc1c7('0x52')]['id']},'attributes':['id',_0xc1c7('0x32')]})[_0xc1c7('0x2e')](handleEntityNotFound(_0x180607,null))['then'](function(_0x4de022){if(_0x4de022){_0x1a59f0=_0x4de022;return db['UserProfileSection'][_0xc1c7('0x2f')]({'where':{'userProfileId':_0xd5e555[_0xc1c7('0x52')]['id'],'sectionId':_0xd5e555['query'][_0xc1c7('0x67')]}});}})[_0xc1c7('0x2e')](function(){return _0x1a59f0;})['then'](respondWithStatusCode(_0x180607,null))['catch'](handleError(_0x180607,null));};exports['getSections']=function(_0x19263c,_0x515e58){var _0x219d44=[];var _0x3bc3aa=[];return db[_0xc1c7('0x5c')]['findAll']({'where':{'userProfileId':_0x19263c[_0xc1c7('0x52')]['id']},'raw':!![]})['then'](function(_0x32d38a){_0x219d44=_[_0xc1c7('0x47')](_0x32d38a,function(_0x51d66d){return _0x51d66d[_0xc1c7('0x68')]===0x1||_[_0xc1c7('0x69')]([0x3eb,0x709],_0x51d66d[_0xc1c7('0x5e')]);});if(!_[_0xc1c7('0x6a')](_0x219d44)){return _[_0xc1c7('0x35')](_0x219d44,function(_0x2d017c){return _0x2d017c[_0xc1c7('0x5e')];});}else{return;}})[_0xc1c7('0x2e')](function(_0x425f3d){if(_0x425f3d)_0x3bc3aa=_0x425f3d;if(_[_0xc1c7('0x69')](_0x3bc3aa,0x64)){var _0x4bb9bc=_[_0xc1c7('0x53')](_0x219d44,{'sectionId':0x64});return hasDefaultDashboard(_0x4bb9bc)[_0xc1c7('0x2e')](function(_0xae85a9){return _[_0xc1c7('0x35')](_0x219d44,function(_0x54f90e){if(_0x54f90e[_0xc1c7('0x5e')]===0x64){_0x54f90e[_0xc1c7('0x6b')]=_0xae85a9;}return _0x54f90e;});});}else{return;}})['then'](function(_0x4eaa5c){if(_0x4eaa5c)_0x219d44=_0x4eaa5c;if(_[_0xc1c7('0x69')](_0x3bc3aa,0x3eb)){var _0x22b364=_[_0xc1c7('0x53')](_0x219d44,{'sectionId':0x3eb});return getCustomDashboards(_0x22b364)[_0xc1c7('0x2e')](function(_0x157d40){return _[_0xc1c7('0x35')](_0x219d44,function(_0x48309e){if(_0x22b364[_0xc1c7('0x68')]){if(_0x48309e[_0xc1c7('0x5e')]===0x3eb){_0x48309e['subsections']=_0x157d40;}}else{if(_0x48309e[_0xc1c7('0x5e')]===0x64){_0x48309e[_0xc1c7('0x6b')]=_0x157d40;}}return _0x48309e;});});}else{return;}})[_0xc1c7('0x2e')](function(_0x392005){if(_0x392005)_0x219d44=_0x392005;if(_[_0xc1c7('0x69')](_0x3bc3aa,0x709)){var _0x2528f3=_[_0xc1c7('0x53')](_0x219d44,{'sectionId':0x709});return getPlugins(_0x2528f3)[_0xc1c7('0x2e')](function(_0x2dfefa){if(_0x2528f3[_0xc1c7('0x68')]){return _[_0xc1c7('0x35')](_0x219d44,function(_0x42863c){if(_0x42863c[_0xc1c7('0x5e')]===0x709){_0x42863c[_0xc1c7('0x6b')]=_0x2dfefa;}return _0x42863c;});}else{var _0x5c82da={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2dfefa};var _0x257a35=_[_0xc1c7('0x35')](_0x219d44);_0x257a35[_0xc1c7('0x65')](_0x5c82da);return _0x257a35;}});}else{return;}})[_0xc1c7('0x2e')](function(_0x421a11){if(_0x421a11)_0x219d44=_0x421a11;return _[_0xc1c7('0x47')](_0x219d44,['enabled',0x1]);})[_0xc1c7('0x2e')](respondWithResult(_0x515e58,null))[_0xc1c7('0x51')](handleError(_0x515e58,null));};function hasDefaultDashboard(_0x558066){var _0x5df8f4=[0x65];return new BPromise(function(_0xb2124e,_0x9145ec){try{if(_0x558066[_0xc1c7('0x6c')]){_0xb2124e(_0x5df8f4);}else{return db[_0xc1c7('0x64')][_0xc1c7('0x6d')]({'where':{'sectionId':_0x558066['id']},'raw':!![]})[_0xc1c7('0x2e')](function(_0x5258c4){_0x5258c4?_0xb2124e(_0x5df8f4):_0xb2124e();});}}catch(_0x158c94){_0x9145ec(_0x158c94);}});}function getCustomDashboards(_0xc8633e){var _0x3f61ae=[];return new BPromise(function(_0x393676,_0x4d06c7){try{if(_0xc8633e[_0xc1c7('0x6c')]){return db['Dashboard'][_0xc1c7('0x4f')]({'raw':!![]})['then'](function(_0x3aca9a){_0x3aca9a[_0xc1c7('0x6e')](function(_0x5b4a9b){_0x3f61ae[_0xc1c7('0x65')](_0x5b4a9b['id']+0x1869f);});_0x393676(_0x3f61ae);});}else{return db[_0xc1c7('0x64')][_0xc1c7('0x4f')]({'where':{'sectionId':_0xc8633e['id']},'raw':!![]})[_0xc1c7('0x2e')](function(_0x1ff3a3){_0x1ff3a3[_0xc1c7('0x6e')](function(_0x283689){_0x3f61ae[_0xc1c7('0x65')](_0x283689[_0xc1c7('0x6f')]+0x1869f);});_0x393676(_0x3f61ae);});}}catch(_0xe1e5dd){_0x4d06c7(_0xe1e5dd);}});}function getPlugins(_0x4510ea){var _0x94cc51=[];return new BPromise(function(_0x3615a5,_0x18f9c1){try{if(_0x4510ea[_0xc1c7('0x6c')]){return db[_0xc1c7('0x70')][_0xc1c7('0x4f')]({'raw':!![]})[_0xc1c7('0x2e')](function(_0x3045eb){_0x3045eb['forEach'](function(_0x48cddc){_0x94cc51['push'](_0x48cddc['id']+0x15b38);});_0x3615a5(_0x94cc51);});}else{return db[_0xc1c7('0x64')]['findAll']({'where':{'sectionId':_0x4510ea['id']},'raw':!![]})['then'](function(_0x5e1b46){_0x5e1b46[_0xc1c7('0x6e')](function(_0x2afcd2){_0x94cc51['push'](_0x2afcd2['resourceId']+0x15b38);});_0x3615a5(_0x94cc51);});}}catch(_0x57b04b){_0x18f9c1(_0x57b04b);}});}exports[_0xc1c7('0x71')]=function(_0x454b0d,_0x20a948){return db[_0xc1c7('0x4c')][_0xc1c7('0x53')]({'where':{'id':_0x454b0d[_0xc1c7('0x52')]['id']}})['then'](handleEntityNotFound(_0x20a948,null))[_0xc1c7('0x2e')](function(_0x12f753){if(_0x12f753){return db[_0xc1c7('0x63')]['transaction'](function(_0x3866a1){return db[_0xc1c7('0x5c')][_0xc1c7('0x4f')]({'where':{'userProfileId':_0x454b0d['params']['id']},'attributes':['id'],'raw':!![]})[_0xc1c7('0x2e')](function(_0x3231c7){if(_0x3231c7){return db[_0xc1c7('0x5c')][_0xc1c7('0x2f')]({'where':{'userProfileId':_0x454b0d[_0xc1c7('0x52')]['id'],'id':_[_0xc1c7('0x35')](_0x3231c7,function(_0x213f8e){return _0x213f8e['id'];})},'transaction':_0x3866a1});}})[_0xc1c7('0x2e')](function(_0x5ab498){var _0x4e7ed1=_[_0xc1c7('0x35')](_0x454b0d[_0xc1c7('0x59')],function(_0x1994c3){_0x1994c3['userProfileId']=_0x454b0d[_0xc1c7('0x52')]['id'];return _0x1994c3;});return db[_0xc1c7('0x5c')][_0xc1c7('0x72')](_0x4e7ed1,{'raw':!![],'transaction':_0x3866a1});})[_0xc1c7('0x2e')](function(_0x3369e2){var _0x48a85e=_[_0xc1c7('0x47')](_[_0xc1c7('0x35')](_0x3369e2,function(_0x405395){return _0x405395[_0xc1c7('0x56')]({'plain':!![]});}),{'includeAll':![]});if(_0x48a85e){return db[_0xc1c7('0x5c')][_0xc1c7('0x4f')]({'where':{'userProfileId':_0x454b0d[_0xc1c7('0x52')]['id'],'sectionId':_[_0xc1c7('0x35')](_0x48a85e,function(_0x44245c){return _0x44245c[_0xc1c7('0x5e')];})},'attributes':['id',_0xc1c7('0x5e')],'raw':!![]})[_0xc1c7('0x2e')](function(_0x38fce7){var _0x38e932=_[_0xc1c7('0x35')](_0x454b0d['body'],function(_0x2656a7){_0x2656a7[_0xc1c7('0x5f')]=_0x454b0d[_0xc1c7('0x52')]['id'];return _0x2656a7;});return db[_0xc1c7('0x64')][_0xc1c7('0x72')](_0x38e932,{'raw':!![],'transaction':_0x3866a1});});}})['catch'](handleError(_0x20a948,null));});}})[_0xc1c7('0x2e')](function(_0x54f25b){var _0x29df03=_[_0xc1c7('0x35')](_0x54f25b,function(_0xd6ab9){return _0xd6ab9[_0xc1c7('0x56')]({'plain':!![]});});})['then'](respondWithResult(_0x20a948,null))[_0xc1c7('0x51')](handleError(_0x20a948,null));};exports['removeResources']=function(_0x2f4833,_0x344a09,_0x48f0fb){return db[_0xc1c7('0x4c')][_0xc1c7('0x53')]({'where':{'id':_0x2f4833[_0xc1c7('0x52')]['id']}})['then'](handleEntityNotFound(_0x344a09,null))[_0xc1c7('0x2e')](function(_0x415a0d){if(_0x415a0d){return _0x415a0d[_0xc1c7('0x73')](_0x2f4833[_0xc1c7('0x3b')][_0xc1c7('0x67')]);}})['then'](respondWithStatusCode(_0x344a09,null))[_0xc1c7('0x51')](handleError(_0x344a09,null));};exports['getResources']=function(_0x183c59,_0x4f445d){var _0x4f8ebf={};if(!_0x183c59[_0xc1c7('0x3b')][_0xc1c7('0x74')])throw new Error('Missing\x20section\x20parameter');if(!_0x183c59[_0xc1c7('0x3b')][_0xc1c7('0x42')](_0xc1c7('0x43'))){_0x4f8ebf[_0xc1c7('0x25')]=qs['limit'](_0x183c59[_0xc1c7('0x3b')][_0xc1c7('0x25')]);_0x4f8ebf[_0xc1c7('0x24')]=qs[_0xc1c7('0x24')](_0x183c59[_0xc1c7('0x3b')][_0xc1c7('0x24')]);}return db[_0xc1c7('0x4c')][_0xc1c7('0x53')]({'where':{'id':_0x183c59[_0xc1c7('0x52')]['id']}})[_0xc1c7('0x2e')](function(_0x45e974){if(!_0x45e974)throw new Error(_0xc1c7('0x75')+_0x183c59[_0xc1c7('0x52')]['id']);return db['UserProfile'][_0xc1c7('0x76')](_0x183c59);})[_0xc1c7('0x2e')](respondWithFilteredResult(_0x4f445d,_0x4f8ebf))['catch'](handleError(_0x4f445d,null));}; \ No newline at end of file +var _0x75b6=['destroy','end','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','params','includeAll','create','clone','get','omit','updatedAt','crudPermissions','body','createdAt','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','Resources','UserProfileSection','find','describe','addSections','userProfileId','push','removeSections','ids','getSections','enabled','isEmpty','subsections','includes','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','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','redis','./userProfile.socket','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then'];(function(_0x3ebff4,_0x5efe9a){var _0x6331b7=function(_0x4860d6){while(--_0x4860d6){_0x3ebff4['push'](_0x3ebff4['shift']());}};_0x6331b7(++_0x5efe9a);}(_0x75b6,0x1a4));var _0x675b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x75b6[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x675b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x675b('0x1'));var rp=require(_0x675b('0x2'));var moment=require(_0x675b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x675b('0x4'));var util=require(_0x675b('0x5'));var path=require(_0x675b('0x6'));var sox=require('sox');var csv=require(_0x675b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x675b('0x8'));var _=require(_0x675b('0x9'));var squel=require(_0x675b('0xa'));var crypto=require('crypto');var jsforce=require(_0x675b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x675b('0x7'));var querystring=require(_0x675b('0xc'));var Papa=require(_0x675b('0xd'));var Redis=require(_0x675b('0xe'));var authService=require(_0x675b('0xf'));var qs=require(_0x675b('0x10'));var as=require(_0x675b('0x11'));var hardwareService=require(_0x675b('0x12'));var logger=require(_0x675b('0x13'))(_0x675b('0x14'));var utils=require('../../config/utils');var config=require(_0x675b('0x15'));var licenseUtil=require(_0x675b('0x16'));var db=require(_0x675b('0x17'))['db'];config[_0x675b('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x675b('0x19'))['register'](socket);function respondWithStatusCode(_0x5be52c,_0x1d6b18){_0x1d6b18=_0x1d6b18||0xcc;return function(_0x36993e){if(_0x36993e){return _0x5be52c[_0x675b('0x1a')](_0x1d6b18);}return _0x5be52c[_0x675b('0x1b')](_0x1d6b18)['end']();};}function respondWithResult(_0x3243ea,_0x1ddd4f){_0x1ddd4f=_0x1ddd4f||0xc8;return function(_0x1ebce7){if(_0x1ebce7){return _0x3243ea[_0x675b('0x1b')](_0x1ddd4f)[_0x675b('0x1c')](_0x1ebce7);}};}function respondWithFilteredResult(_0x17608c,_0x1f7b2e){return function(_0x303a4d){if(_0x303a4d){var _0x5cf336=typeof _0x1f7b2e['offset']===_0x675b('0x1d')&&typeof _0x1f7b2e[_0x675b('0x1e')]==='undefined';var _0x5d23b8=_0x303a4d[_0x675b('0x1f')];var _0x3a3e8b=_0x5cf336?0x0:_0x1f7b2e[_0x675b('0x20')];var _0x5b550a=_0x5cf336?_0x303a4d[_0x675b('0x1f')]:_0x1f7b2e[_0x675b('0x20')]+_0x1f7b2e['limit'];var _0x55226b;if(_0x5b550a>=_0x5d23b8){_0x5b550a=_0x5d23b8;_0x55226b=0xc8;}else{_0x55226b=0xce;}_0x17608c[_0x675b('0x1b')](_0x55226b);return _0x17608c[_0x675b('0x21')](_0x675b('0x22'),_0x3a3e8b+'-'+_0x5b550a+'/'+_0x5d23b8)[_0x675b('0x1c')](_0x303a4d);}return null;};}function patchUpdates(_0x362dfb){return function(_0xcef27b){try{jsonpatch[_0x675b('0x23')](_0xcef27b,_0x362dfb,!![]);}catch(_0xca02e7){return BPromise[_0x675b('0x24')](_0xca02e7);}return _0xcef27b[_0x675b('0x25')]();};}function saveUpdates(_0x4b460a,_0x2d9b3a){return function(_0xf0662c){if(_0xf0662c){return _0xf0662c[_0x675b('0x26')](_0x4b460a)[_0x675b('0x27')](function(_0x507088){return _0x507088;});}return null;};}function removeEntity(_0xec389f,_0x24e8e9){return function(_0x4e7a65){if(_0x4e7a65){return _0x4e7a65[_0x675b('0x28')]()['then'](function(){_0xec389f[_0x675b('0x1b')](0xcc)[_0x675b('0x29')]();});}};}function handleEntityNotFound(_0x5c3f61,_0x1377ef){return function(_0x44d8e3){if(!_0x44d8e3){_0x5c3f61[_0x675b('0x1a')](0x194);}return _0x44d8e3;};}function handleError(_0x3330b6,_0x1a46a7){_0x1a46a7=_0x1a46a7||0x1f4;return function(_0x59dbbe){logger[_0x675b('0x2a')](_0x59dbbe[_0x675b('0x2b')]);if(_0x59dbbe[_0x675b('0x2c')]){delete _0x59dbbe[_0x675b('0x2c')];}_0x3330b6[_0x675b('0x1b')](_0x1a46a7)[_0x675b('0x2d')](_0x59dbbe);};}exports[_0x675b('0x2e')]=function(_0x5f2cde,_0x373a56){var _0xe7c579={},_0x21f34d={},_0x2b2aca={'count':0x0,'rows':[]};var _0x5f579d=_[_0x675b('0x2f')](db[_0x675b('0x30')][_0x675b('0x31')],function(_0x20b953){return{'name':_0x20b953[_0x675b('0x32')],'type':_0x20b953[_0x675b('0x33')][_0x675b('0x34')]};});_0x21f34d[_0x675b('0x35')]=_['map'](_0x5f579d,_0x675b('0x2c'));_0x21f34d['query']=_[_0x675b('0x36')](_0x5f2cde[_0x675b('0x37')]);_0x21f34d['filters']=_['intersection'](_0x21f34d[_0x675b('0x35')],_0x21f34d[_0x675b('0x37')]);_0xe7c579['attributes']=_[_0x675b('0x38')](_0x21f34d[_0x675b('0x35')],qs[_0x675b('0x39')](_0x5f2cde[_0x675b('0x37')][_0x675b('0x39')]));_0xe7c579[_0x675b('0x3a')]=_0xe7c579['attributes'][_0x675b('0x3b')]?_0xe7c579[_0x675b('0x3a')]:_0x21f34d['model'];if(!_0x5f2cde['query'][_0x675b('0x3c')](_0x675b('0x3d'))){_0xe7c579[_0x675b('0x1e')]=qs[_0x675b('0x1e')](_0x5f2cde[_0x675b('0x37')][_0x675b('0x1e')]);_0xe7c579[_0x675b('0x20')]=qs[_0x675b('0x20')](_0x5f2cde[_0x675b('0x37')][_0x675b('0x20')]);}_0xe7c579[_0x675b('0x3e')]=qs['sort'](_0x5f2cde['query'][_0x675b('0x3f')]);_0xe7c579['where']=qs[_0x675b('0x40')](_[_0x675b('0x41')](_0x5f2cde[_0x675b('0x37')],_0x21f34d['filters']),_0x5f579d);if(_0x5f2cde['query']['filter']){_0xe7c579[_0x675b('0x42')]=_['merge'](_0xe7c579[_0x675b('0x42')],{'$or':_['map'](_0x5f579d,function(_0x532363){if(_0x532363[_0x675b('0x33')]!==_0x675b('0x43')){var _0x3dfd3f={};_0x3dfd3f[_0x532363['name']]={'$like':'%'+_0x5f2cde[_0x675b('0x37')][_0x675b('0x44')]+'%'};return _0x3dfd3f;}})});}_0xe7c579=_[_0x675b('0x45')]({},_0xe7c579,_0x5f2cde[_0x675b('0x46')]);var _0x29d076={'where':_0xe7c579['where']};return db[_0x675b('0x30')][_0x675b('0x1f')](_0x29d076)[_0x675b('0x27')](function(_0x1d74f3){_0x2b2aca[_0x675b('0x1f')]=_0x1d74f3;if(_0x5f2cde[_0x675b('0x37')]['includeAll']){_0xe7c579[_0x675b('0x47')]=[{'all':!![]}];}return db[_0x675b('0x30')][_0x675b('0x48')](_0xe7c579);})['then'](function(_0x403ce4){_0x2b2aca[_0x675b('0x49')]=_0x403ce4;return _0x2b2aca;})[_0x675b('0x27')](respondWithFilteredResult(_0x373a56,_0xe7c579))[_0x675b('0x4a')](handleError(_0x373a56,null));};exports['show']=function(_0x3931cb,_0x369cd4){var _0x5d00ac={'raw':![],'where':{'id':_0x3931cb[_0x675b('0x4b')]['id']}},_0x3ae7e3={};_0x3ae7e3[_0x675b('0x35')]=_[_0x675b('0x36')](db['UserProfile'][_0x675b('0x31')]);_0x3ae7e3[_0x675b('0x37')]=_[_0x675b('0x36')](_0x3931cb[_0x675b('0x37')]);_0x3ae7e3[_0x675b('0x40')]=_[_0x675b('0x38')](_0x3ae7e3[_0x675b('0x35')],_0x3ae7e3['query']);_0x5d00ac[_0x675b('0x3a')]=_[_0x675b('0x38')](_0x3ae7e3[_0x675b('0x35')],qs['fields'](_0x3931cb[_0x675b('0x37')][_0x675b('0x39')]));_0x5d00ac[_0x675b('0x3a')]=_0x5d00ac[_0x675b('0x3a')][_0x675b('0x3b')]?_0x5d00ac[_0x675b('0x3a')]:_0x3ae7e3[_0x675b('0x35')];if(_0x3931cb[_0x675b('0x37')][_0x675b('0x4c')]){_0x5d00ac['include']=[{'all':!![]}];}_0x5d00ac=_[_0x675b('0x45')]({},_0x5d00ac,_0x3931cb[_0x675b('0x46')]);return db[_0x675b('0x30')]['find'](_0x5d00ac)[_0x675b('0x27')](handleEntityNotFound(_0x369cd4,null))[_0x675b('0x27')](respondWithResult(_0x369cd4,null))[_0x675b('0x4a')](handleError(_0x369cd4,null));};exports[_0x675b('0x4d')]=function(_0x285b95,_0x550e15){return db[_0x675b('0x30')][_0x675b('0x4d')](_0x285b95['body'],{})[_0x675b('0x27')](respondWithResult(_0x550e15,0xc9))[_0x675b('0x4a')](handleError(_0x550e15,null));};exports[_0x675b('0x4e')]=function(_0xfb084f,_0x20dfcf){var _0xa89a4d={'where':{'id':_0xfb084f[_0x675b('0x4b')]['id']}},_0x4671e3={};_0x4671e3[_0x675b('0x35')]=_[_0x675b('0x36')](db['UserProfile'][_0x675b('0x31')]);_0xa89a4d[_0x675b('0x3a')]=_[_0x675b('0x38')](_0x4671e3[_0x675b('0x35')],qs[_0x675b('0x39')](_0xfb084f['query'][_0x675b('0x39')]));_0xa89a4d[_0x675b('0x3a')]=_0xa89a4d[_0x675b('0x3a')][_0x675b('0x3b')]?_0xa89a4d[_0x675b('0x3a')]:_0x4671e3[_0x675b('0x35')];if(_0xfb084f[_0x675b('0x37')][_0x675b('0x4c')]){_0xa89a4d[_0x675b('0x47')]=[{'all':!![]}];}_0xa89a4d=_['merge']({},_0xa89a4d,_0xfb084f[_0x675b('0x46')]);return db[_0x675b('0x30')]['find'](_0xa89a4d)[_0x675b('0x27')](handleEntityNotFound(_0x20dfcf,null))['then'](function(_0x2de5cc){if(_0x2de5cc){var _0x472e48=_0x2de5cc[_0x675b('0x4f')]({'plain':!![]});_0x472e48=qs[_0x675b('0x50')](_0x472e48,['id','createdAt',_0x675b('0x51'),_0x675b('0x52')]);_0xfb084f[_0x675b('0x53')]=_[_0x675b('0x50')](_0xfb084f[_0x675b('0x53')],['id',_0x675b('0x54'),_0x675b('0x51')]);return db[_0x675b('0x55')][_0x675b('0x56')](function(_0x5ef475){return db[_0x675b('0x30')]['create'](_[_0x675b('0x45')](_0x472e48,_0xfb084f[_0x675b('0x53')]),{'include':_0xfb084f[_0x675b('0x37')][_0x675b('0x4c')]?[{'all':!![]}]:undefined,'transaction':_0x5ef475})[_0x675b('0x27')](function(_0x165517){var _0x228d47=_0x165517[_0x675b('0x4f')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0xfb084f[_0x675b('0x4b')]['id']},'raw':!![]})[_0x675b('0x27')](function(_0x3e8506){if(_0x3e8506){return BPromise[_0x675b('0x57')](_0x3e8506,function(_0x4cbec9){return new BPromise(function(_0x11b215,_0x52196d){if(_0x4cbec9[_0x675b('0x58')]===null||_0x4cbec9[_0x675b('0x58')]===0x1)_0x11b215(null);return db[_0x675b('0x59')][_0x675b('0x48')]({'where':{'sectionId':_0x4cbec9['id']},'raw':!![]})['then'](function(_0x231cf2){var _0x3ccf38=_[_0x675b('0x2f')](_0x231cf2,function(_0x2ffaee){return qs[_0x675b('0x50')](_0x2ffaee,['id',_0x675b('0x54'),_0x675b('0x51'),_0x675b('0x5a')]);});_0x11b215(_0x3ccf38);})[_0x675b('0x4a')](function(_0x56cb6f){_0x52196d(_0x56cb6f);});})[_0x675b('0x27')](function(_0x3181ce){var _0x3de076=qs[_0x675b('0x50')](_0x4cbec9,['id',_0x675b('0x54'),_0x675b('0x51')]);_0x3de076['userProfileId']=_0x228d47['id'];if(_0x3181ce)_0x3de076[_0x675b('0x5b')]=_0x3181ce;return _0x3de076;})['then'](function(_0x2aeb6e){return db[_0x675b('0x5c')][_0x675b('0x4d')](_0x2aeb6e,{'include':[{'model':db[_0x675b('0x59')],'as':'Resources'}],'raw':!![],'transaction':_0x5ef475});});})['then'](function(){return _0x228d47;});}});});});}})[_0x675b('0x27')](respondWithResult(_0x20dfcf,0xc9))[_0x675b('0x4a')](handleError(_0x20dfcf,null));};exports[_0x675b('0x26')]=function(_0x711428,_0x14ba5f){if(_0x711428[_0x675b('0x53')]['id']){delete _0x711428[_0x675b('0x53')]['id'];}return db[_0x675b('0x30')][_0x675b('0x5d')]({'where':{'id':_0x711428[_0x675b('0x4b')]['id']}})[_0x675b('0x27')](handleEntityNotFound(_0x14ba5f,null))['then'](saveUpdates(_0x711428['body'],null))['then'](respondWithResult(_0x14ba5f,null))['catch'](handleError(_0x14ba5f,null));};exports[_0x675b('0x28')]=function(_0x1aa13f,_0x18d8ed){return db[_0x675b('0x30')][_0x675b('0x5d')]({'where':{'id':_0x1aa13f[_0x675b('0x4b')]['id']}})[_0x675b('0x27')](handleEntityNotFound(_0x18d8ed,null))[_0x675b('0x27')](removeEntity(_0x18d8ed,null))['catch'](handleError(_0x18d8ed,null));};exports[_0x675b('0x5e')]=function(_0xcb3612,_0x23799c){return db['UserProfile'][_0x675b('0x5e')]()['then'](respondWithResult(_0x23799c,null))[_0x675b('0x4a')](handleError(_0x23799c,null));};exports[_0x675b('0x5f')]=function(_0x8a9467,_0x3fbd57){var _0x1d6720=_0x8a9467['body'];return db['UserProfile'][_0x675b('0x5d')]({'where':{'id':_0x8a9467[_0x675b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3fbd57,null))['then'](function(_0x4e64a7){if(_0x4e64a7){return db[_0x675b('0x55')][_0x675b('0x56')](function(_0x40fee1){return db[_0x675b('0x5c')][_0x675b('0x28')]({'where':{'userProfileId':_0x8a9467[_0x675b('0x4b')]['id'],'sectionId':_[_0x675b('0x2f')](_0x1d6720,function(_0x2dcd57){return _0x2dcd57[_0x675b('0x5a')];})},'transaction':_0x40fee1})[_0x675b('0x27')](function(){var _0x1dfe3f=_[_0x675b('0x2f')](_0x1d6720,function(_0x53a617){_0x53a617[_0x675b('0x60')]=_0x8a9467[_0x675b('0x4b')]['id'];return _0x53a617;});var _0x995d7c=[];return BPromise[_0x675b('0x57')](_0x1dfe3f,function(_0x11af6b){return db[_0x675b('0x5c')]['create'](_0x11af6b,{'include':[{'model':db[_0x675b('0x59')],'as':_0x675b('0x5b')}],'raw':!![],'transaction':_0x40fee1})['then'](function(_0x5aaec6){_0x995d7c[_0x675b('0x61')](_0x5aaec6[_0x675b('0x4f')]({'plain':!![]}));});})['then'](function(){return _0x995d7c;});});});}})[_0x675b('0x27')](function(_0x38d268){return _0x38d268;})[_0x675b('0x27')](respondWithResult(_0x3fbd57,null))[_0x675b('0x4a')](handleError(_0x3fbd57,null));};exports[_0x675b('0x62')]=function(_0x29a23b,_0x5eeecf){var _0x2f370b;return db[_0x675b('0x30')]['find']({'where':{'id':_0x29a23b[_0x675b('0x4b')]['id']},'attributes':['id',_0x675b('0x2c')]})['then'](handleEntityNotFound(_0x5eeecf,null))[_0x675b('0x27')](function(_0x92010){if(_0x92010){_0x2f370b=_0x92010;return db[_0x675b('0x5c')][_0x675b('0x28')]({'where':{'userProfileId':_0x29a23b[_0x675b('0x4b')]['id'],'sectionId':_0x29a23b['query'][_0x675b('0x63')]}});}})[_0x675b('0x27')](function(){return _0x2f370b;})[_0x675b('0x27')](respondWithStatusCode(_0x5eeecf,null))['catch'](handleError(_0x5eeecf,null));};exports[_0x675b('0x64')]=function(_0x248737,_0x3857c1){var _0x16e009=[];var _0x1cdbaf=[];return db[_0x675b('0x5c')][_0x675b('0x48')]({'where':{'userProfileId':_0x248737['params']['id']},'raw':!![]})[_0x675b('0x27')](function(_0x27de62){_0x16e009=_['filter'](_0x27de62,function(_0x4324b4){return _0x4324b4[_0x675b('0x65')]===0x1||_['includes']([0x3eb,0x709],_0x4324b4[_0x675b('0x5a')]);});if(!_[_0x675b('0x66')](_0x16e009)){return _['map'](_0x16e009,function(_0x5aa623){return _0x5aa623['sectionId'];});}else{return;}})[_0x675b('0x27')](function(_0x1ff732){if(_0x1ff732)_0x1cdbaf=_0x1ff732;if(_['includes'](_0x1cdbaf,0x64)){var _0x5eee9e=_[_0x675b('0x5d')](_0x16e009,{'sectionId':0x64});return hasDefaultDashboard(_0x5eee9e)['then'](function(_0xeea22b){return _[_0x675b('0x2f')](_0x16e009,function(_0x4a9e06){if(_0x4a9e06[_0x675b('0x5a')]===0x64){_0x4a9e06[_0x675b('0x67')]=_0xeea22b;}return _0x4a9e06;});});}else{return;}})[_0x675b('0x27')](function(_0x54122){if(_0x54122)_0x16e009=_0x54122;if(_[_0x675b('0x68')](_0x1cdbaf,0x3eb)){var _0x25c3f3=_[_0x675b('0x5d')](_0x16e009,{'sectionId':0x3eb});return getCustomDashboards(_0x25c3f3)[_0x675b('0x27')](function(_0x51dd1a){return _[_0x675b('0x2f')](_0x16e009,function(_0x442902){if(_0x25c3f3[_0x675b('0x65')]){if(_0x442902[_0x675b('0x5a')]===0x3eb){_0x442902[_0x675b('0x67')]=_0x51dd1a;}}else{if(_0x442902[_0x675b('0x5a')]===0x64){_0x442902[_0x675b('0x67')]=_0x51dd1a;}}return _0x442902;});});}else{return;}})[_0x675b('0x27')](function(_0xd287d1){if(_0xd287d1)_0x16e009=_0xd287d1;if(_[_0x675b('0x68')](_0x1cdbaf,0x709)){var _0x1aeca8=_[_0x675b('0x5d')](_0x16e009,{'sectionId':0x709});return getPlugins(_0x1aeca8)['then'](function(_0x11ea08){if(_0x1aeca8[_0x675b('0x65')]){return _['map'](_0x16e009,function(_0x53192f){if(_0x53192f['sectionId']===0x709){_0x53192f[_0x675b('0x67')]=_0x11ea08;}return _0x53192f;});}else{var _0x1fa2f7={'sectionId':0x76c,'enabled':0x1,'subsections':_0x11ea08};var _0x2c9109=_[_0x675b('0x2f')](_0x16e009);_0x2c9109['push'](_0x1fa2f7);return _0x2c9109;}});}else{return;}})[_0x675b('0x27')](function(_0x197022){if(_0x197022)_0x16e009=_0x197022;return _[_0x675b('0x44')](_0x16e009,[_0x675b('0x65'),0x1]);})['then'](respondWithResult(_0x3857c1,null))['catch'](handleError(_0x3857c1,null));};function hasDefaultDashboard(_0x918c0d){var _0x16cbf0=[0x65];return new BPromise(function(_0x5dcaf5,_0x4953ac){try{if(_0x918c0d[_0x675b('0x58')]){_0x5dcaf5(_0x16cbf0);}else{return db['UserProfileResource'][_0x675b('0x69')]({'where':{'sectionId':_0x918c0d['id']},'raw':!![]})['then'](function(_0xb7dbb6){_0xb7dbb6?_0x5dcaf5(_0x16cbf0):_0x5dcaf5();});}}catch(_0x3e0c89){_0x4953ac(_0x3e0c89);}});}function getCustomDashboards(_0x3e90ae){var _0x3215ca=[];return new BPromise(function(_0x48cbd7,_0x14c728){try{if(_0x3e90ae[_0x675b('0x58')]){return db[_0x675b('0x6a')][_0x675b('0x48')]({'raw':!![]})[_0x675b('0x27')](function(_0x5a0227){_0x5a0227[_0x675b('0x6b')](function(_0x557668){_0x3215ca[_0x675b('0x61')](_0x557668['id']+0x1869f);});_0x48cbd7(_0x3215ca);});}else{return db[_0x675b('0x59')][_0x675b('0x48')]({'where':{'sectionId':_0x3e90ae['id']},'raw':!![]})[_0x675b('0x27')](function(_0xcccb11){_0xcccb11['forEach'](function(_0x51df87){_0x3215ca[_0x675b('0x61')](_0x51df87[_0x675b('0x6c')]+0x1869f);});_0x48cbd7(_0x3215ca);});}}catch(_0x4016cb){_0x14c728(_0x4016cb);}});}function getPlugins(_0x1b557c){var _0x11c87d=[];return new BPromise(function(_0x861e6b,_0x4f33d0){try{if(_0x1b557c[_0x675b('0x58')]){return db['Plugin'][_0x675b('0x48')]({'raw':!![]})[_0x675b('0x27')](function(_0x595553){_0x595553[_0x675b('0x6b')](function(_0x18def0){_0x11c87d[_0x675b('0x61')](_0x18def0['id']+0x15b38);});_0x861e6b(_0x11c87d);});}else{return db[_0x675b('0x59')][_0x675b('0x48')]({'where':{'sectionId':_0x1b557c['id']},'raw':!![]})[_0x675b('0x27')](function(_0x2f5b3e){_0x2f5b3e[_0x675b('0x6b')](function(_0x1cecfe){_0x11c87d['push'](_0x1cecfe[_0x675b('0x6c')]+0x15b38);});_0x861e6b(_0x11c87d);});}}catch(_0x12367d){_0x4f33d0(_0x12367d);}});}exports[_0x675b('0x6d')]=function(_0xd6a304,_0x53445e){return db[_0x675b('0x30')]['find']({'where':{'id':_0xd6a304['params']['id']}})[_0x675b('0x27')](handleEntityNotFound(_0x53445e,null))['then'](function(_0x178e67){if(_0x178e67){return db[_0x675b('0x55')]['transaction'](function(_0x50fb83){return db['UserProfileSection'][_0x675b('0x48')]({'where':{'userProfileId':_0xd6a304[_0x675b('0x4b')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x5bb768){if(_0x5bb768){return db[_0x675b('0x5c')][_0x675b('0x28')]({'where':{'userProfileId':_0xd6a304[_0x675b('0x4b')]['id'],'id':_[_0x675b('0x2f')](_0x5bb768,function(_0x1e7b80){return _0x1e7b80['id'];})},'transaction':_0x50fb83});}})['then'](function(_0x34eaf2){var _0x2cc5c0=_[_0x675b('0x2f')](_0xd6a304[_0x675b('0x53')],function(_0x371508){_0x371508[_0x675b('0x60')]=_0xd6a304[_0x675b('0x4b')]['id'];return _0x371508;});return db[_0x675b('0x5c')][_0x675b('0x6e')](_0x2cc5c0,{'raw':!![],'transaction':_0x50fb83});})['then'](function(_0x1f94e2){var _0x485a4f=_[_0x675b('0x44')](_[_0x675b('0x2f')](_0x1f94e2,function(_0x2a8d46){return _0x2a8d46[_0x675b('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x485a4f){return db[_0x675b('0x5c')][_0x675b('0x48')]({'where':{'userProfileId':_0xd6a304[_0x675b('0x4b')]['id'],'sectionId':_['map'](_0x485a4f,function(_0x24f52d){return _0x24f52d[_0x675b('0x5a')];})},'attributes':['id',_0x675b('0x5a')],'raw':!![]})[_0x675b('0x27')](function(_0x1fdfc5){var _0x34acf8=_[_0x675b('0x2f')](_0xd6a304['body'],function(_0x52954d){_0x52954d[_0x675b('0x60')]=_0xd6a304[_0x675b('0x4b')]['id'];return _0x52954d;});return db['UserProfileResource'][_0x675b('0x6e')](_0x34acf8,{'raw':!![],'transaction':_0x50fb83});});}})[_0x675b('0x4a')](handleError(_0x53445e,null));});}})[_0x675b('0x27')](function(_0x45b189){var _0x3d4180=_['map'](_0x45b189,function(_0x50a455){return _0x50a455[_0x675b('0x4f')]({'plain':!![]});});})[_0x675b('0x27')](respondWithResult(_0x53445e,null))[_0x675b('0x4a')](handleError(_0x53445e,null));};exports[_0x675b('0x6f')]=function(_0x35dd18,_0x32180d,_0x3e2bef){return db[_0x675b('0x30')]['find']({'where':{'id':_0x35dd18['params']['id']}})[_0x675b('0x27')](handleEntityNotFound(_0x32180d,null))[_0x675b('0x27')](function(_0x56f40d){if(_0x56f40d){return _0x56f40d[_0x675b('0x6f')](_0x35dd18[_0x675b('0x37')]['ids']);}})[_0x675b('0x27')](respondWithStatusCode(_0x32180d,null))['catch'](handleError(_0x32180d,null));};exports[_0x675b('0x70')]=function(_0x545f66,_0x8e14d4){var _0x21f641={};if(!_0x545f66[_0x675b('0x37')][_0x675b('0x71')])throw new Error(_0x675b('0x72'));if(!_0x545f66[_0x675b('0x37')][_0x675b('0x3c')]('nolimit')){_0x21f641['limit']=qs[_0x675b('0x1e')](_0x545f66[_0x675b('0x37')][_0x675b('0x1e')]);_0x21f641['offset']=qs['offset'](_0x545f66['query'][_0x675b('0x20')]);}return db['UserProfile'][_0x675b('0x5d')]({'where':{'id':_0x545f66['params']['id']}})[_0x675b('0x27')](function(_0x185601){if(!_0x185601)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x545f66[_0x675b('0x4b')]['id']);return db['UserProfile'][_0x675b('0x70')](_0x545f66);})[_0x675b('0x27')](respondWithFilteredResult(_0x8e14d4,_0x21f641))[_0x675b('0x4a')](handleError(_0x8e14d4,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 6343299..cbd4bdb 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 _0xf2e3=['remove','emit','hasOwnProperty','hook','exports','events','UserProfile','setMaxListeners','save','update'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xf2e3[_0x1da527];return _0x40fc7c;};'use strict';var EventEmitter=require(_0x3f2e('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x3f2e('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3f2e('0x2')](0x0);var events={'afterCreate':_0x3f2e('0x3'),'afterUpdate':_0x3f2e('0x4'),'afterDestroy':_0x3f2e('0x5')};function emitEvent(_0x1634cd){return function(_0x3938e2,_0xabcf5c,_0x216b26){UserProfileEvents['emit'](_0x1634cd+':'+_0x3938e2['id'],_0x3938e2);UserProfileEvents[_0x3f2e('0x6')](_0x1634cd,_0x3938e2);_0x216b26(null);};}for(var e in events){if(events[_0x3f2e('0x7')](e)){var event=events[e];UserProfile[_0x3f2e('0x8')](e,emitEvent(event));}}module[_0x3f2e('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x9e2e=['save','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile'];(function(_0x23eca3,_0x2a1e28){var _0xfe9c26=function(_0x1ab89d){while(--_0x1ab89d){_0x23eca3['push'](_0x23eca3['shift']());}};_0xfe9c26(++_0x2a1e28);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x3a3e30,_0x5996b5){_0x3a3e30=_0x3a3e30-0x0;var _0x19f849=_0x9e2e[_0x3a3e30];return _0x19f849;};'use strict';var EventEmitter=require(_0xe9e2('0x0'));var UserProfile=require(_0xe9e2('0x1'))['db'][_0xe9e2('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe9e2('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2d34ef){return function(_0x11a0e5,_0x3bfa90,_0x212d98){UserProfileEvents[_0xe9e2('0x4')](_0x2d34ef+':'+_0x11a0e5['id'],_0x11a0e5);UserProfileEvents[_0xe9e2('0x4')](_0x2d34ef,_0x11a0e5);_0x212d98(null);};}for(var e in events){if(events[_0xe9e2('0x5')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xe9e2('0x6')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 772fd41..d159a29 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 _0x5f66=['key','VIRTUAL','forEach','autoAssociation','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','ids','CmContact','Tags','color','tag','ThroughTags','rows','openTabs','true','chat','dataValues','sms','fax','openchannel','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','then','map','catch','model','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','ListId','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','membername','role','agent','Telephones','User','telephone','queue','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','VoiceQueues','QueueCampaigns','users','agents','Users','admin','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Trigger','trunks','variables','Variable','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','select','ui.','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','params','isEmpty','union','ignore','all','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','offset','order','pick','merge'];(function(_0x179bb9,_0x444a3c){var _0x165dcd=function(_0x52dbe0){while(--_0x52dbe0){_0x179bb9['push'](_0x179bb9['shift']());}};_0x165dcd(++_0x444a3c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var attributes=require(_0x65f6('0x0'));var qs=require('../../components/parsers/qs');var squel=require(_0x65f6('0x1'));module[_0x65f6('0x2')]=function(_0x3461cd){var _0xbce843=_0x3461cd[_0x65f6('0x3')];function _0x5eb9ad(_0x3c5029,_0x5150c8){return new Promise(function(_0x1c9f5b,_0x22b017){if(!_0x5150c8)return _0x1c9f5b(null);var _0x4ec221=_0x5150c8['filter']?{[_0x5150c8[_0x65f6('0x4')][_0x65f6('0x5')]]:_0x5150c8[_0x65f6('0x4')][_0x65f6('0x6')]}:undefined;return _0xbce843[_0x3c5029][_0x65f6('0x7')]({'where':_0x4ec221,'raw':!![]})[_0x65f6('0x8')](function(_0x48d85c){_0x5150c8['associatedResources']=_[_0x65f6('0x9')](_0x48d85c,'id');_0x1c9f5b(_0x5150c8);})[_0x65f6('0xa')](function(_0x264647){_0x22b017(_0x264647);});});}function _0x25c416(_0x50d26d,_0x41a7fd){return new Promise(function(_0x571436,_0x497cf3){var _0x2d2dfa=_0x50d26d['filter']?{[_0x50d26d[_0x65f6('0x4')]['field']]:_0x50d26d[_0x65f6('0x4')][_0x65f6('0x6')]}:undefined;return _0xbce843[_0x50d26d[_0x65f6('0xb')]][_0x65f6('0x7')]({'where':_0x2d2dfa,'raw':!![]})[_0x65f6('0x8')](function(_0x1d29fd){_0x41a7fd[_0x65f6('0xc')]=_[_0x65f6('0x9')](_0x1d29fd,function(_0x46dbc6){return _0x46dbc6[_0x65f6('0xd')];});_0x571436(_0x41a7fd);})['catch'](function(_0x19b9ff){_0x497cf3(_0x19b9ff);});});}function _0x49a913(_0x5dd324,_0x1693e6,_0x5c69f8){if(!_0x1693e6)return Promise[_0x65f6('0xe')](null);return new Promise(function(_0x1c955c,_0x1b1cbb){return _0xbce843[_0x65f6('0xf')][_0x65f6('0x7')]({'where':{'sectionId':_0x1693e6['id']},'raw':!![]})[_0x65f6('0x8')](function(_0x495dd6){if(_0x5dd324['field']&&_0x5dd324[_0x65f6('0x5')]!=='id'){_0x1693e6['associatedResources']=_['map'](_0x495dd6,function(_0x5c5b91){return _0x5c5b91[_0x5dd324[_0x65f6('0x5')]];});}else{if(_0x5c69f8===_0x65f6('0x10')){_0x1693e6['associatedResources']=_[_0x65f6('0x9')](_0x495dd6,function(_0x270893){return{'id':_0x270893[_0x65f6('0x11')],'type':_0x270893[_0x65f6('0x12')]};});}else{_0x1693e6[_0x65f6('0xc')]=_[_0x65f6('0x9')](_0x495dd6,function(_0x581374){return _0x581374[_0x65f6('0x11')];});}}_0x1c955c(_0x1693e6);})['catch'](function(_0x5b9e2a){_0x1b1cbb(_0x5b9e2a);});});}function _0x212247(_0xd173f4,_0x524e42){var _0x1eeaaa={'parentSections':[]};switch(_0xd173f4[_0x65f6('0x13')]()){case _0x65f6('0x14'):_0x1eeaaa[_0x65f6('0x15')]='SquareProject';break;case _0x65f6('0x16'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x17');break;case'squarerecordings':_0x1eeaaa['childModel']='SquareRecording';_0x1eeaaa[_0x65f6('0x18')]=[{'name':_0x65f6('0x19'),'field':'name','foreignKey':_0x65f6('0x1a')}];break;case _0x65f6('0x1b'):_0x1eeaaa['childModel']=_0x65f6('0x1c');break;case _0x65f6('0x1d'):_0x1eeaaa[_0x65f6('0x15')]='CmContact';_0x1eeaaa['parentSections']=[{'name':'Lists','field':'id','foreignKey':_0x65f6('0x1e')}];break;case _0x65f6('0x1f'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x20');break;case _0x65f6('0x21'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x22');break;case'globalcustomfields':_0x1eeaaa['childModel']=_0x65f6('0x23');break;case _0x65f6('0x24'):_0x1eeaaa['childModel']='ChatQueue';break;case _0x65f6('0x25'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x26');break;case _0x65f6('0x27'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x28');break;case'faxaccounts':_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x29');break;case _0x65f6('0x2a'):case'internalroutes':case _0x65f6('0x2b'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x2c');break;case _0x65f6('0x2d'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x2e');break;case'voicemails':_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x2f');break;case'voicerecordings':_0x1eeaaa[_0x65f6('0x15')]='VoiceRecording';_0x1eeaaa[_0x65f6('0x18')]=[{'name':'Agents','field':_0x65f6('0xd'),'foreignKey':_0x65f6('0x30'),'model':'User','filter':{'field':_0x65f6('0x31'),'value':[_0x65f6('0x32')]}},{'name':_0x65f6('0x33'),'field':'name','foreignKey':'membername','model':_0x65f6('0x34'),'filter':{'field':'role','value':[_0x65f6('0x35')]}},{'name':'VoiceQueues','field':_0x65f6('0xd'),'foreignKey':_0x65f6('0x36'),'model':'VoiceQueue','filter':{'field':_0x65f6('0x12'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0x65f6('0xd'),'foreignKey':_0x65f6('0x36'),'model':_0x65f6('0x37'),'filter':{'field':_0x65f6('0x12'),'value':[_0x65f6('0x38')]}}];break;case _0x65f6('0x39'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x3a');break;case'chanspies':_0x1eeaaa[_0x65f6('0x15')]='VoiceChanSpy';break;case _0x65f6('0x3b'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x3c');break;case _0x65f6('0x3d'):_0x1eeaaa['childModel']=_0x65f6('0x3e');break;case _0x65f6('0x3f'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x40');break;case _0x65f6('0x41'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x42');break;case _0x65f6('0x43'):_0x1eeaaa[_0x65f6('0x15')]='MailSubstatus';break;case _0x65f6('0x44'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x45');break;case _0x65f6('0x46'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x47');break;case _0x65f6('0x48'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x49');break;case _0x65f6('0x4a'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x4b');break;case _0x65f6('0x4c'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x4d');break;case _0x65f6('0x4e'):_0x1eeaaa['childModel']=_0x65f6('0x4f');break;case _0x65f6('0x50'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x51');break;case'voicequeues':case _0x65f6('0x52'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x37');if(_0x524e42){_0x1eeaaa['parentSections']=[{'name':_0x65f6('0x53')},{'name':_0x65f6('0x54')}];}break;case _0x65f6('0x55'):case _0x65f6('0x56'):case'telephones':_0x1eeaaa[_0x65f6('0x15')]='User';if(_0x524e42){_0x1eeaaa[_0x65f6('0x18')]=[{'name':_0x65f6('0x57'),'filter':{'field':'role','value':[_0x65f6('0x58'),'user']},'ignore':!![]},{'name':_0x65f6('0x59')},{'name':_0x65f6('0x33')}];}break;case _0x65f6('0x5a'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x5b');break;case _0x65f6('0x5c'):_0x1eeaaa['childModel']='SalesforceAccount';break;case _0x65f6('0x5d'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x5e');break;case _0x65f6('0x5f'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x60');break;case _0x65f6('0x61'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x62');break;case'zohoaccounts':_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x63');break;case _0x65f6('0x64'):_0x1eeaaa['childModel']=_0x65f6('0x34');break;case _0x65f6('0x65'):_0x1eeaaa['childModel']=_0x65f6('0x66');break;case _0x65f6('0x67'):_0x1eeaaa['childModel']=_0x65f6('0x68');break;case'customdashboards':_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x69');break;case _0x65f6('0x6a'):_0x1eeaaa['childModel']=_0x65f6('0x6b');break;case _0x65f6('0x6c'):_0x1eeaaa['childModel']=_0x65f6('0x6d');break;case _0x65f6('0x6e'):_0x1eeaaa['childModel']=_0x65f6('0x6f');break;case _0x65f6('0x70'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x71');break;case _0x65f6('0x72'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x73');break;case _0x65f6('0x74'):_0x1eeaaa['childModel']='Template';break;case'triggers':_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x75');break;case _0x65f6('0x76'):_0x1eeaaa[_0x65f6('0x15')]='Trunk';break;case _0x65f6('0x77'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x78');break;case'plugins':_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x79');break;case _0x65f6('0x7a'):_0x1eeaaa['childModel']='AnalyticExtractedReport';_0x1eeaaa[_0x65f6('0x18')]=[{'name':_0x65f6('0x7b'),'field':'id','foreignKey':_0x65f6('0x7c')}];break;case _0x65f6('0x7d'):_0x1eeaaa[_0x65f6('0x15')]=_0x65f6('0x7e');break;}return _0x1eeaaa;}function _0x35d77f(_0x138334,_0x2d8b5b){var _0xddbd90=_0x138334[_0x65f6('0x7f')](0x0)[_0x65f6('0x80')]()+_0x138334[_0x65f6('0x81')](0x1);var _0x3e3143={'type':_0xbce843['Sequelize'][_0x65f6('0x82')][_0x65f6('0x83')],'raw':!![]};return new Promise(function(_0x42a805,_0x4b4efe){var _0x25cf9f=squel[_0x65f6('0x84')]()[_0x65f6('0x5')](_0x65f6('0x85')+_0xddbd90+'InteractionId','id')[_0x65f6('0x5')](_0x65f6('0x86'))[_0x65f6('0x87')](_0x65f6('0x88')+_0x138334+'_interactions','ui')[_0x65f6('0x89')](_0x65f6('0x8a'),_0x2d8b5b['id']);return _0xbce843['sequelize'][_0x65f6('0x8b')](_0x25cf9f[_0x65f6('0x8c')](),_0x3e3143)[_0x65f6('0x8')](function(_0x51549d){_0x2d8b5b[_0xddbd90+_0x65f6('0x8d')]=_0x51549d;_0x42a805(_0x51549d);})[_0x65f6('0xa')](function(_0x3974ef){_0x4b4efe(_0x3974ef);});});}return _0x3461cd[_0x65f6('0x8e')](_0x65f6('0x8f'),attributes,{'tableName':_0x65f6('0x90'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x5e4759){var _0x4ee8bd={'raw':_0x5e4759['query'][_0x65f6('0x91')],'where':{}};var _0x367d95={};var _0x376a79={'count':0x0,'rows':[]};var _0x471bec=_0x5e4759[_0x65f6('0x8b')][_0x65f6('0x92')];var _0x4c5cd2=_0x5e4759[_0x65f6('0x8b')][_0x65f6('0x93')]||![];var _0x54b569=_0x212247(_0x471bec,_0x4c5cd2);if(!_0x54b569[_0x65f6('0x15')])throw new Error(_0x65f6('0x94')+_0x471bec+'\x27');var _0x477489=[{'name':_0x471bec}];if(!_['isEmpty'](_0x54b569[_0x65f6('0x18')]))_0x477489=_0x54b569[_0x65f6('0x18')];var _0x4e83dc=[];for(var _0x271d76=0x0;_0x271d76<_0x477489[_0x65f6('0x95')];_0x271d76++){_0x4e83dc[_0x65f6('0x96')](_0xbce843[_0x65f6('0x97')][_0x65f6('0x98')]({'where':{'userProfileId':_0x5e4759[_0x65f6('0x99')]['id'],'name':_0x477489[_0x271d76][_0x65f6('0xd')]},'raw':!![]}));}return Promise['all'](_0x4e83dc)['then'](function(_0x3eb33e){var _0x3da139=_['filter'](_0x3eb33e,function(_0x417ba5){return _0x417ba5?_0x417ba5:undefined;});var _0x5f3df9=_[_0x65f6('0x4')](_0x477489,['ignore',!![]]);var _0x440df1=_[_0x65f6('0x9a')](_0x3da139)&&_[_0x65f6('0x9a')](_0x5f3df9)?null:_[_0x65f6('0x9b')](_0x5f3df9,_0x3da139);if(!_0x440df1)return null;var _0x145aaa=[];for(var _0x264e6c=0x0;_0x264e6c<_0x440df1[_0x65f6('0x95')];_0x264e6c++){var _0x1cc66a=_[_0x65f6('0x98')](_0x477489,function(_0x4b7ecd){return _0x440df1[_0x264e6c]?_0x4b7ecd['name']===_0x440df1[_0x264e6c][_0x65f6('0xd')]:null;});if(_0x1cc66a){if(_0x440df1[_0x264e6c][_0x65f6('0x9c')]){_0x145aaa[_0x65f6('0x96')](_0x5eb9ad(_0x54b569['childModel'],_0x440df1[_0x264e6c]));}else{if(!_0x440df1[_0x264e6c]['autoAssociation']){_0x145aaa[_0x65f6('0x96')](_0x49a913(_0x1cc66a,_0x440df1[_0x264e6c],_0x54b569[_0x65f6('0x15')]));}else{if(_0x1cc66a[_0x65f6('0xb')]){_0x145aaa[_0x65f6('0x96')](_0x25c416(_0x1cc66a,_0x440df1[_0x264e6c]));}}}}}return Promise[_0x65f6('0x9d')](_0x145aaa);})[_0x65f6('0x8')](function(_0x522d32){var _0x4f42ae=_0x522d32;var _0x215a91=null;if(_0x4f42ae){_0x215a91=_0x4f42ae[_0x65f6('0x95')]===0x1?_0x4f42ae[0x0]:null;}if(!_0x215a91&&!_0x4f42ae)return _0x376a79;var _0x5543bc=_0xbce843[_0x54b569[_0x65f6('0x15')]]['rawAttributes'];_0x367d95[_0x65f6('0xb')]=_[_0x65f6('0x9e')](_0x5543bc);_0x367d95[_0x65f6('0x8b')]=_[_0x65f6('0x9e')](_0x5e4759['query']);_0x367d95[_0x65f6('0x9f')]=_[_0x65f6('0xa0')](_0x367d95[_0x65f6('0xb')],_0x367d95['query']);_0x4ee8bd['attributes']=_[_0x65f6('0xa0')](_0x367d95['model'],qs[_0x65f6('0xa1')](_0x5e4759[_0x65f6('0x8b')][_0x65f6('0xa1')]));_0x4ee8bd[_0x65f6('0xa2')]=_0x4ee8bd['attributes']['length']?_0x4ee8bd['attributes']:_0x367d95[_0x65f6('0xb')];if(!_0x5e4759[_0x65f6('0x8b')][_0x65f6('0xa3')]('nolimit')){_0x4ee8bd[_0x65f6('0xa4')]=qs[_0x65f6('0xa4')](_0x5e4759[_0x65f6('0x8b')]['limit']);_0x4ee8bd[_0x65f6('0xa5')]=qs[_0x65f6('0xa5')](_0x5e4759['query'][_0x65f6('0xa5')]);}_0x4ee8bd[_0x65f6('0xa6')]=qs['sort'](_0x5e4759[_0x65f6('0x8b')]['sort']);_0x4ee8bd[_0x65f6('0x89')]=qs['filters'](_[_0x65f6('0xa7')](_0x5e4759[_0x65f6('0x8b')],_0x367d95['filters']));if(_0x5e4759[_0x65f6('0x8b')][_0x65f6('0x4')]){_0x4ee8bd[_0x65f6('0x89')]=_[_0x65f6('0xa8')](_0x4ee8bd[_0x65f6('0x89')],{'$or':_[_0x65f6('0x9')](_0x5543bc,function(_0x46af9f){if(_0x46af9f[_0x65f6('0x12')][_0x65f6('0xa9')]!==_0x65f6('0xaa')){var _0x288eb0={};_0x288eb0[_0x46af9f['field']]={'$like':'%'+_0x5e4759[_0x65f6('0x8b')][_0x65f6('0x4')]+'%'};return _0x288eb0;}})});}var _0x15c8b7=[];var _0x219e42=null;var _0x5694f9={};if(_0x215a91){_0x219e42=_[_0x65f6('0x98')](_0x477489,[_0x65f6('0xd'),_0x215a91['name']]);if(_0x219e42[_0x65f6('0x5')]){_0x5694f9={};if(_0x54b569['childModel']===_0x65f6('0x10')){_0x5694f9[_0x219e42['foreignKey']]=_[_0x65f6('0x9')](_0x215a91[_0x65f6('0xc')],'id');}else{_0x5694f9[_0x219e42['foreignKey']]=_0x215a91['associatedResources'];}_0x15c8b7[_0x65f6('0x96')](_0x5694f9);}else{_0x4ee8bd[_0x65f6('0x89')]['id']=_0x215a91['associatedResources'];}}else{for(var _0x2d86c8=0x0;_0x2d86c8<_0x4f42ae[_0x65f6('0x95')];_0x2d86c8++){_0x219e42=_[_0x65f6('0x98')](_0x477489,['name',_0x4f42ae[_0x2d86c8][_0x65f6('0xd')]]);if(_0x219e42[_0x65f6('0x5')]){_0x5694f9={};_0x5694f9[_0x219e42['foreignKey']]=_0x4f42ae[_0x2d86c8][_0x65f6('0xc')];_0x15c8b7['push'](_0x5694f9);}else{if(!_0x4ee8bd[_0x65f6('0x89')]['id'])_0x4ee8bd['where']['id']=[];_0x4f42ae[_0x2d86c8]['associatedResources'][_0x65f6('0xab')](function(_0x1cf4ed){_0x4ee8bd[_0x65f6('0x89')]['id'][_0x65f6('0x96')](_0x1cf4ed);});}}}if(!_[_0x65f6('0x9a')](_0x15c8b7)){_0x4ee8bd[_0x65f6('0x89')]=_[_0x65f6('0xa8')](_0x4ee8bd[_0x65f6('0x89')],{'$and':{'$or':_0x15c8b7}});}_0x4ee8bd=_['merge']({},_0x4ee8bd,_0x5e4759['options']);if(_0x215a91&&!_0x215a91[_0x65f6('0xac')]&&_0x54b569['childModel']===_0x65f6('0x10')){if(_0x5e4759[_0x65f6('0x8b')][_0x65f6('0xad')]){_0x4ee8bd[_0x65f6('0xae')]=[{'all':!![]}];}return _0xbce843[_0x54b569[_0x65f6('0x15')]]['findAll'](_0x4ee8bd)[_0x65f6('0x8')](function(_0x257247){var _0x14c908=[];_0x257247['forEach'](function(_0xc7cee1){var _0x443aed;switch(_0xc7cee1[_0x65f6('0xaf')]){case _0x65f6('0xb0'):_0x443aed=_[_0x65f6('0x98')](_0x215a91[_0x65f6('0xc')],function(_0x53f0ea){return _0x53f0ea['id']===_0xc7cee1['reportId']&&_0x53f0ea[_0x65f6('0x12')]===_0x65f6('0xb1');});break;case _0x65f6('0xb2'):_0x443aed=_[_0x65f6('0x98')](_0x215a91['associatedResources'],function(_0x4bda86){return _0x4bda86['id']===_0xc7cee1[_0x65f6('0x7c')]&&_0x4bda86[_0x65f6('0x12')]===_0x65f6('0xb3');});break;}if(_0x443aed)_0x14c908[_0x65f6('0x96')](_0xc7cee1);});_0x376a79[_0x65f6('0xb4')]=_0x14c908[_0x65f6('0x95')];_0x376a79['rows']=_0x14c908;return _0x376a79;});}else{if(!_['isEmpty'](_0x5e4759['query'][_0x65f6('0xb5')])){_0x4ee8bd[_0x65f6('0x89')]['id']=_0x4ee8bd[_0x65f6('0x89')]['id']?_[_0x65f6('0xa0')](_0x4ee8bd['where']['id'],_0x5e4759['query'][_0x65f6('0xb5')]):_0x5e4759[_0x65f6('0x8b')]['ids'];}return _0xbce843[_0x54b569[_0x65f6('0x15')]]['count']({'where':_0x4ee8bd[_0x65f6('0x89')]})['then'](function(_0x3a30ed){_0x376a79[_0x65f6('0xb4')]=_0x3a30ed;if(_0x5e4759['query'][_0x65f6('0xad')]){if(_0x54b569[_0x65f6('0x15')]===_0x65f6('0xb6')){_0x4ee8bd[_0x65f6('0xae')]=[{'model':_0xbce843[_0x65f6('0x73')],'as':_0x65f6('0xb7'),'attributes':['id','name',_0x65f6('0xb8')],'required':_0x5e4759['query'][_0x65f6('0xb9')]?!![]:![]},{'model':_0xbce843['Tag'],'as':_0x65f6('0xba'),'attributes':['id',_0x65f6('0xd'),_0x65f6('0xb8')],'through':_0x5e4759[_0x65f6('0x8b')]['tag']?{'attributes':[],'where':{'TagId':_0x5e4759[_0x65f6('0x8b')][_0x65f6('0xb9')]||undefined}}:{},'required':_0x5e4759[_0x65f6('0x8b')]['tag']?!![]:![]}];}else{_0x4ee8bd['include']=[{'all':!![]}];}}return _0xbce843[_0x54b569[_0x65f6('0x15')]][_0x65f6('0x7')](_0x4ee8bd);})['then'](function(_0x180cde){_0x376a79[_0x65f6('0xbb')]=_0x180cde;if(_0x471bec===_0x65f6('0x59')&&_0x5e4759['query'][_0x65f6('0xbc')]===_0x65f6('0xbd')){var _0x5df361=[];for(var _0x709725=0x0;_0x709725<_0x376a79[_0x65f6('0xbb')][_0x65f6('0x95')];_0x709725++){_0x5df361['push'](_0x35d77f(_0x65f6('0xbe'),_0x376a79[_0x65f6('0xbb')][_0x709725][_0x65f6('0xbf')]));_0x5df361['push'](_0x35d77f(_0x65f6('0xc0'),_0x376a79['rows'][_0x709725][_0x65f6('0xbf')]));_0x5df361[_0x65f6('0x96')](_0x35d77f(_0x65f6('0xc1'),_0x376a79[_0x65f6('0xbb')][_0x709725][_0x65f6('0xbf')]));_0x5df361[_0x65f6('0x96')](_0x35d77f('mail',_0x376a79[_0x65f6('0xbb')][_0x709725][_0x65f6('0xbf')]));_0x5df361[_0x65f6('0x96')](_0x35d77f(_0x65f6('0xc2'),_0x376a79[_0x65f6('0xbb')][_0x709725]['dataValues']));_0x5df361['push'](_0x35d77f('whatsapp',_0x376a79[_0x65f6('0xbb')][_0x709725][_0x65f6('0xbf')]));}return Promise[_0x65f6('0x9d')](_0x5df361)['then'](function(){return _0x376a79;});}return _0x376a79;});}});}}});}; \ No newline at end of file +var _0xd117=['foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','ids','color','tag','ThroughTags','rows','openTabs','true','dataValues','fax','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value','findAll','associatedResources','map','field','model','then','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','odbc','parentSections','SquareProjects','projects','JscriptyProject','CmContact','Lists','lists','CmList','CmCompany','globalcustomfields','chatqueues','chatwebsites','ChatWebsite','inboundroutes','internalroutes','outboundroutes','contexts','VoiceMail','Agents','User','role','agent','Telephones','membername','telephone','VoiceQueues','queue','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','Users','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','CannedAnswer','dispositions','Dashboard','Interval','pauses','scheduler','Schedule','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','OpenTabs','define','UserProfile','user_profiles','raw','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','filters','pick','merge','key','VIRTUAL'];(function(_0x30f68d,_0x12cb44){var _0x4ac6bf=function(_0x15da9c){while(--_0x15da9c){_0x30f68d['push'](_0x30f68d['shift']());}};_0x4ac6bf(++_0x12cb44);}(_0xd117,0x182));var _0x7d11=function(_0x22205c,_0x473493){_0x22205c=_0x22205c-0x0;var _0x3f5efe=_0xd117[_0x22205c];return _0x3f5efe;};'use strict';var _=require(_0x7d11('0x0'));var attributes=require(_0x7d11('0x1'));var qs=require(_0x7d11('0x2'));var squel=require(_0x7d11('0x3'));module[_0x7d11('0x4')]=function(_0x26e0f0){var _0x306ae4=_0x26e0f0[_0x7d11('0x5')];function _0x3c07be(_0x31fcb0,_0x589c51){return new Promise(function(_0x2689c6,_0x27d7e8){if(!_0x589c51)return _0x2689c6(null);var _0x40c3c4=_0x589c51[_0x7d11('0x6')]?{[_0x589c51[_0x7d11('0x6')]['field']]:_0x589c51[_0x7d11('0x6')][_0x7d11('0x7')]}:undefined;return _0x306ae4[_0x31fcb0][_0x7d11('0x8')]({'where':_0x40c3c4,'raw':!![]})['then'](function(_0x305eef){_0x589c51[_0x7d11('0x9')]=_[_0x7d11('0xa')](_0x305eef,'id');_0x2689c6(_0x589c51);})['catch'](function(_0x37047f){_0x27d7e8(_0x37047f);});});}function _0x48b0f1(_0x58a6fd,_0xb15984){return new Promise(function(_0x5c6d5d,_0x4a8668){var _0xc52a95=_0x58a6fd['filter']?{[_0x58a6fd[_0x7d11('0x6')][_0x7d11('0xb')]]:_0x58a6fd['filter'][_0x7d11('0x7')]}:undefined;return _0x306ae4[_0x58a6fd[_0x7d11('0xc')]]['findAll']({'where':_0xc52a95,'raw':!![]})[_0x7d11('0xd')](function(_0x16949d){_0xb15984[_0x7d11('0x9')]=_[_0x7d11('0xa')](_0x16949d,function(_0x417e2d){return _0x417e2d[_0x7d11('0xe')];});_0x5c6d5d(_0xb15984);})[_0x7d11('0xf')](function(_0xb1669e){_0x4a8668(_0xb1669e);});});}function _0x4aa795(_0x1db0df,_0x12c2ff,_0x169733){if(!_0x12c2ff)return Promise[_0x7d11('0x10')](null);return new Promise(function(_0x45f916,_0x528fdc){return _0x306ae4[_0x7d11('0x11')][_0x7d11('0x8')]({'where':{'sectionId':_0x12c2ff['id']},'raw':!![]})['then'](function(_0x5459df){if(_0x1db0df[_0x7d11('0xb')]&&_0x1db0df['field']!=='id'){_0x12c2ff[_0x7d11('0x9')]=_['map'](_0x5459df,function(_0xbe0a79){return _0xbe0a79[_0x1db0df[_0x7d11('0xb')]];});}else{if(_0x169733===_0x7d11('0x12')){_0x12c2ff[_0x7d11('0x9')]=_[_0x7d11('0xa')](_0x5459df,function(_0x117bb9){return{'id':_0x117bb9[_0x7d11('0x13')],'type':_0x117bb9[_0x7d11('0x14')]};});}else{_0x12c2ff['associatedResources']=_[_0x7d11('0xa')](_0x5459df,function(_0x4a34f4){return _0x4a34f4['resourceId'];});}}_0x45f916(_0x12c2ff);})['catch'](function(_0x27a818){_0x528fdc(_0x27a818);});});}function _0x3545dc(_0x44476c,_0x1a7853){var _0x355d14={'parentSections':[]};switch(_0x44476c[_0x7d11('0x15')]()){case _0x7d11('0x16'):_0x355d14[_0x7d11('0x17')]='SquareProject';break;case _0x7d11('0x18'):_0x355d14['childModel']='SquareOdbc';break;case'squarerecordings':_0x355d14[_0x7d11('0x17')]='SquareRecording';_0x355d14[_0x7d11('0x19')]=[{'name':_0x7d11('0x1a'),'field':_0x7d11('0xe'),'foreignKey':'projectName'}];break;case _0x7d11('0x1b'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x1c');break;case'contacts':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x1d');_0x355d14[_0x7d11('0x19')]=[{'name':_0x7d11('0x1e'),'field':'id','foreignKey':'ListId'}];break;case _0x7d11('0x1f'):_0x355d14['childModel']=_0x7d11('0x20');break;case'companies':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x21');break;case _0x7d11('0x22'):_0x355d14['childModel']='CmCustomField';break;case _0x7d11('0x23'):_0x355d14[_0x7d11('0x17')]='ChatQueue';break;case _0x7d11('0x24'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x25');break;case'faxqueues':_0x355d14[_0x7d11('0x17')]='FaxQueue';break;case'faxaccounts':_0x355d14[_0x7d11('0x17')]='FaxAccount';break;case _0x7d11('0x26'):case _0x7d11('0x27'):case _0x7d11('0x28'):_0x355d14[_0x7d11('0x17')]='VoiceExtension';break;case _0x7d11('0x29'):_0x355d14[_0x7d11('0x17')]='VoiceContext';break;case'voicemails':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x2a');break;case'voicerecordings':_0x355d14[_0x7d11('0x17')]='VoiceRecording';_0x355d14['parentSections']=[{'name':_0x7d11('0x2b'),'field':'name','foreignKey':'membername','model':_0x7d11('0x2c'),'filter':{'field':_0x7d11('0x2d'),'value':[_0x7d11('0x2e')]}},{'name':_0x7d11('0x2f'),'field':_0x7d11('0xe'),'foreignKey':_0x7d11('0x30'),'model':_0x7d11('0x2c'),'filter':{'field':_0x7d11('0x2d'),'value':[_0x7d11('0x31')]}},{'name':_0x7d11('0x32'),'field':_0x7d11('0xe'),'foreignKey':_0x7d11('0x33'),'model':'VoiceQueue','filter':{'field':_0x7d11('0x14'),'value':['inbound']}},{'name':_0x7d11('0x34'),'field':_0x7d11('0xe'),'foreignKey':_0x7d11('0x33'),'model':_0x7d11('0x35'),'filter':{'field':'type','value':[_0x7d11('0x36')]}}];break;case _0x7d11('0x37'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x38');break;case'chanspies':_0x355d14[_0x7d11('0x17')]='VoiceChanSpy';break;case _0x7d11('0x39'):_0x355d14['childModel']=_0x7d11('0x3a');break;case _0x7d11('0x3b'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x3c');break;case'mailqueues':_0x355d14['childModel']=_0x7d11('0x3d');break;case _0x7d11('0x3e'):_0x355d14['childModel']=_0x7d11('0x3f');break;case _0x7d11('0x40'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x41');break;case _0x7d11('0x42'):_0x355d14[_0x7d11('0x17')]='OpenchannelQueue';break;case _0x7d11('0x43'):_0x355d14['childModel']=_0x7d11('0x44');break;case _0x7d11('0x45'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x46');break;case _0x7d11('0x47'):_0x355d14[_0x7d11('0x17')]='SmsAccount';break;case'whatsappqueues':_0x355d14['childModel']=_0x7d11('0x48');break;case _0x7d11('0x49'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x4a');break;case _0x7d11('0x4b'):_0x355d14['childModel']=_0x7d11('0x4c');break;case _0x7d11('0x4d'):case'queuecampaigns':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x35');if(_0x1a7853){_0x355d14[_0x7d11('0x19')]=[{'name':'VoiceQueues'},{'name':_0x7d11('0x34')}];}break;case _0x7d11('0x4e'):case _0x7d11('0x4f'):case'telephones':_0x355d14[_0x7d11('0x17')]='User';if(_0x1a7853){_0x355d14[_0x7d11('0x19')]=[{'name':_0x7d11('0x50'),'filter':{'field':_0x7d11('0x2d'),'value':[_0x7d11('0x51'),_0x7d11('0x52')]},'ignore':!![]},{'name':_0x7d11('0x2b')},{'name':_0x7d11('0x2f')}];}break;case _0x7d11('0x53'):_0x355d14[_0x7d11('0x17')]='ZendeskAccount';break;case'salesforceaccounts':_0x355d14['childModel']=_0x7d11('0x54');break;case _0x7d11('0x55'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x56');break;case _0x7d11('0x57'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x58');break;case _0x7d11('0x59'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x5a');break;case _0x7d11('0x5b'):_0x355d14[_0x7d11('0x17')]='ZohoAccount';break;case _0x7d11('0x5c'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x2c');break;case'cannedanswers':_0x355d14['childModel']=_0x7d11('0x5d');break;case _0x7d11('0x5e'):_0x355d14[_0x7d11('0x17')]='Disposition';break;case'customdashboards':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x5f');break;case'intervals':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x60');break;case _0x7d11('0x61'):_0x355d14[_0x7d11('0x17')]='Pause';break;case _0x7d11('0x62'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x63');break;case'sounds':_0x355d14['childModel']=_0x7d11('0x64');break;case _0x7d11('0x65'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x66');break;case _0x7d11('0x67'):_0x355d14['childModel']=_0x7d11('0x68');break;case _0x7d11('0x69'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x6a');break;case'trunks':_0x355d14['childModel']=_0x7d11('0x6b');break;case _0x7d11('0x6c'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x6d');break;case _0x7d11('0x6e'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x6f');break;case _0x7d11('0x70'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x12');_0x355d14['parentSections']=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0x7d11('0x71'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x72');break;}return _0x355d14;}function _0x5508cf(_0x45918d,_0x222375){var _0x3b1762=_0x45918d[_0x7d11('0x73')](0x0)[_0x7d11('0x74')]()+_0x45918d[_0x7d11('0x75')](0x1);var _0x505573={'type':_0x306ae4[_0x7d11('0x76')][_0x7d11('0x77')][_0x7d11('0x78')],'raw':!![]};return new Promise(function(_0x4c072b,_0x5e5ac3){var _0x481a64=squel['select']()[_0x7d11('0xb')]('ui.'+_0x3b1762+'InteractionId','id')['field'](_0x7d11('0x79'))[_0x7d11('0x7a')](_0x7d11('0x7b')+_0x45918d+_0x7d11('0x7c'),'ui')[_0x7d11('0x7d')](_0x7d11('0x7e'),_0x222375['id']);return _0x306ae4['sequelize'][_0x7d11('0x7f')](_0x481a64['toString'](),_0x505573)[_0x7d11('0xd')](function(_0x49f904){_0x222375[_0x3b1762+_0x7d11('0x80')]=_0x49f904;_0x4c072b(_0x49f904);})[_0x7d11('0xf')](function(_0x4ce8f2){_0x5e5ac3(_0x4ce8f2);});});}return _0x26e0f0[_0x7d11('0x81')](_0x7d11('0x82'),attributes,{'tableName':_0x7d11('0x83'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x8201e3){var _0x5581bb={'raw':_0x8201e3['query'][_0x7d11('0x84')],'where':{}};var _0x23b502={};var _0x2e57e4={'count':0x0,'rows':[]};var _0x4027f8=_0x8201e3[_0x7d11('0x7f')]['section'];var _0x2b9ba0=_0x8201e3['query'][_0x7d11('0x85')]||![];var _0x1c33dd=_0x3545dc(_0x4027f8,_0x2b9ba0);if(!_0x1c33dd[_0x7d11('0x17')])throw new Error(_0x7d11('0x86')+_0x4027f8+'\x27');var _0x4df2da=[{'name':_0x4027f8}];if(!_[_0x7d11('0x87')](_0x1c33dd['parentSections']))_0x4df2da=_0x1c33dd[_0x7d11('0x19')];var _0x366f5e=[];for(var _0x19015f=0x0;_0x19015f<_0x4df2da[_0x7d11('0x88')];_0x19015f++){_0x366f5e[_0x7d11('0x89')](_0x306ae4[_0x7d11('0x8a')][_0x7d11('0x8b')]({'where':{'userProfileId':_0x8201e3[_0x7d11('0x8c')]['id'],'name':_0x4df2da[_0x19015f][_0x7d11('0xe')]},'raw':!![]}));}return Promise[_0x7d11('0x8d')](_0x366f5e)[_0x7d11('0xd')](function(_0x850e26){var _0x346250=_[_0x7d11('0x6')](_0x850e26,function(_0x490434){return _0x490434?_0x490434:undefined;});var _0x36895a=_['filter'](_0x4df2da,[_0x7d11('0x8e'),!![]]);var _0x4c113b=_[_0x7d11('0x87')](_0x346250)&&_[_0x7d11('0x87')](_0x36895a)?null:_[_0x7d11('0x8f')](_0x36895a,_0x346250);if(!_0x4c113b)return null;var _0x1d54f7=[];for(var _0x4aac67=0x0;_0x4aac67<_0x4c113b['length'];_0x4aac67++){var _0x1351ee=_[_0x7d11('0x8b')](_0x4df2da,function(_0x12566a){return _0x4c113b[_0x4aac67]?_0x12566a['name']===_0x4c113b[_0x4aac67][_0x7d11('0xe')]:null;});if(_0x1351ee){if(_0x4c113b[_0x4aac67][_0x7d11('0x8e')]){_0x1d54f7[_0x7d11('0x89')](_0x3c07be(_0x1c33dd[_0x7d11('0x17')],_0x4c113b[_0x4aac67]));}else{if(!_0x4c113b[_0x4aac67][_0x7d11('0x90')]){_0x1d54f7[_0x7d11('0x89')](_0x4aa795(_0x1351ee,_0x4c113b[_0x4aac67],_0x1c33dd['childModel']));}else{if(_0x1351ee[_0x7d11('0xc')]){_0x1d54f7['push'](_0x48b0f1(_0x1351ee,_0x4c113b[_0x4aac67]));}}}}}return Promise[_0x7d11('0x8d')](_0x1d54f7);})['then'](function(_0x48f52c){var _0x26dd08=_0x48f52c;var _0x235658=null;if(_0x26dd08){_0x235658=_0x26dd08[_0x7d11('0x88')]===0x1?_0x26dd08[0x0]:null;}if(!_0x235658&&!_0x26dd08)return _0x2e57e4;var _0x14ee15=_0x306ae4[_0x1c33dd[_0x7d11('0x17')]][_0x7d11('0x91')];_0x23b502[_0x7d11('0xc')]=_[_0x7d11('0x92')](_0x14ee15);_0x23b502[_0x7d11('0x7f')]=_[_0x7d11('0x92')](_0x8201e3[_0x7d11('0x7f')]);_0x23b502['filters']=_[_0x7d11('0x93')](_0x23b502['model'],_0x23b502[_0x7d11('0x7f')]);_0x5581bb[_0x7d11('0x94')]=_[_0x7d11('0x93')](_0x23b502[_0x7d11('0xc')],qs[_0x7d11('0x95')](_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x95')]));_0x5581bb['attributes']=_0x5581bb['attributes'][_0x7d11('0x88')]?_0x5581bb[_0x7d11('0x94')]:_0x23b502[_0x7d11('0xc')];if(!_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x96')]('nolimit')){_0x5581bb[_0x7d11('0x97')]=qs['limit'](_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x97')]);_0x5581bb[_0x7d11('0x98')]=qs[_0x7d11('0x98')](_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x98')]);}_0x5581bb[_0x7d11('0x99')]=qs[_0x7d11('0x9a')](_0x8201e3['query']['sort']);_0x5581bb[_0x7d11('0x7d')]=qs[_0x7d11('0x9b')](_[_0x7d11('0x9c')](_0x8201e3['query'],_0x23b502['filters']));if(_0x8201e3[_0x7d11('0x7f')]['filter']){_0x5581bb[_0x7d11('0x7d')]=_[_0x7d11('0x9d')](_0x5581bb[_0x7d11('0x7d')],{'$or':_[_0x7d11('0xa')](_0x14ee15,function(_0x4b4dd5){if(_0x4b4dd5[_0x7d11('0x14')][_0x7d11('0x9e')]!==_0x7d11('0x9f')){var _0x3ee9b4={};_0x3ee9b4[_0x4b4dd5[_0x7d11('0xb')]]={'$like':'%'+_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x6')]+'%'};return _0x3ee9b4;}})});}var _0x1b719a=[];var _0x481e2f=null;var _0x41f989={};if(_0x235658){_0x481e2f=_[_0x7d11('0x8b')](_0x4df2da,[_0x7d11('0xe'),_0x235658[_0x7d11('0xe')]]);if(_0x481e2f[_0x7d11('0xb')]){_0x41f989={};if(_0x1c33dd['childModel']===_0x7d11('0x12')){_0x41f989[_0x481e2f[_0x7d11('0xa0')]]=_[_0x7d11('0xa')](_0x235658[_0x7d11('0x9')],'id');}else{_0x41f989[_0x481e2f[_0x7d11('0xa0')]]=_0x235658['associatedResources'];}_0x1b719a['push'](_0x41f989);}else{_0x5581bb['where']['id']=_0x235658[_0x7d11('0x9')];}}else{for(var _0x4c15e9=0x0;_0x4c15e9<_0x26dd08[_0x7d11('0x88')];_0x4c15e9++){_0x481e2f=_['find'](_0x4df2da,['name',_0x26dd08[_0x4c15e9][_0x7d11('0xe')]]);if(_0x481e2f[_0x7d11('0xb')]){_0x41f989={};_0x41f989[_0x481e2f[_0x7d11('0xa0')]]=_0x26dd08[_0x4c15e9][_0x7d11('0x9')];_0x1b719a[_0x7d11('0x89')](_0x41f989);}else{if(!_0x5581bb[_0x7d11('0x7d')]['id'])_0x5581bb[_0x7d11('0x7d')]['id']=[];_0x26dd08[_0x4c15e9][_0x7d11('0x9')][_0x7d11('0xa1')](function(_0x29eda1){_0x5581bb['where']['id'][_0x7d11('0x89')](_0x29eda1);});}}}if(!_[_0x7d11('0x87')](_0x1b719a)){_0x5581bb['where']=_[_0x7d11('0x9d')](_0x5581bb[_0x7d11('0x7d')],{'$and':{'$or':_0x1b719a}});}_0x5581bb=_[_0x7d11('0x9d')]({},_0x5581bb,_0x8201e3[_0x7d11('0xa2')]);if(_0x235658&&!_0x235658['autoAssociation']&&_0x1c33dd['childModel']===_0x7d11('0x12')){if(_0x8201e3['query'][_0x7d11('0xa3')]){_0x5581bb[_0x7d11('0xa4')]=[{'all':!![]}];}return _0x306ae4[_0x1c33dd[_0x7d11('0x17')]][_0x7d11('0x8')](_0x5581bb)[_0x7d11('0xd')](function(_0x269f3f){var _0x238486=[];_0x269f3f['forEach'](function(_0x3381e0){var _0x3212fa;switch(_0x3381e0[_0x7d11('0xa5')]){case _0x7d11('0xa6'):_0x3212fa=_['find'](_0x235658[_0x7d11('0x9')],function(_0x18cb6b){return _0x18cb6b['id']===_0x3381e0['reportId']&&_0x18cb6b[_0x7d11('0x14')]===_0x7d11('0xa7');});break;case _0x7d11('0xa8'):_0x3212fa=_['find'](_0x235658[_0x7d11('0x9')],function(_0x34d95d){return _0x34d95d['id']===_0x3381e0['reportId']&&_0x34d95d[_0x7d11('0x14')]===_0x7d11('0xa9');});break;}if(_0x3212fa)_0x238486['push'](_0x3381e0);});_0x2e57e4[_0x7d11('0xaa')]=_0x238486['length'];_0x2e57e4['rows']=_0x238486;return _0x2e57e4;});}else{if(!_['isEmpty'](_0x8201e3['query'][_0x7d11('0xab')])){_0x5581bb[_0x7d11('0x7d')]['id']=_0x5581bb[_0x7d11('0x7d')]['id']?_[_0x7d11('0x93')](_0x5581bb[_0x7d11('0x7d')]['id'],_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xab')]):_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xab')];}return _0x306ae4[_0x1c33dd[_0x7d11('0x17')]]['count']({'where':_0x5581bb['where']})[_0x7d11('0xd')](function(_0x158e0f){_0x2e57e4['count']=_0x158e0f;if(_0x8201e3['query'][_0x7d11('0xa3')]){if(_0x1c33dd[_0x7d11('0x17')]===_0x7d11('0x1d')){_0x5581bb[_0x7d11('0xa4')]=[{'model':_0x306ae4['Tag'],'as':'Tags','attributes':['id','name',_0x7d11('0xac')],'required':_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xad')]?!![]:![]},{'model':_0x306ae4['Tag'],'as':_0x7d11('0xae'),'attributes':['id',_0x7d11('0xe'),'color'],'through':_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xad')]?{'attributes':[],'where':{'TagId':_0x8201e3['query']['tag']||undefined}}:{},'required':_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xad')]?!![]:![]}];}else{_0x5581bb['include']=[{'all':!![]}];}}return _0x306ae4[_0x1c33dd['childModel']][_0x7d11('0x8')](_0x5581bb);})[_0x7d11('0xd')](function(_0x3df0ab){_0x2e57e4[_0x7d11('0xaf')]=_0x3df0ab;if(_0x4027f8==='Agents'&&_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xb0')]===_0x7d11('0xb1')){var _0x83416b=[];for(var _0x491d94=0x0;_0x491d94<_0x2e57e4[_0x7d11('0xaf')][_0x7d11('0x88')];_0x491d94++){_0x83416b[_0x7d11('0x89')](_0x5508cf('chat',_0x2e57e4[_0x7d11('0xaf')][_0x491d94]['dataValues']));_0x83416b[_0x7d11('0x89')](_0x5508cf('sms',_0x2e57e4[_0x7d11('0xaf')][_0x491d94][_0x7d11('0xb2')]));_0x83416b[_0x7d11('0x89')](_0x5508cf(_0x7d11('0xb3'),_0x2e57e4[_0x7d11('0xaf')][_0x491d94][_0x7d11('0xb2')]));_0x83416b['push'](_0x5508cf('mail',_0x2e57e4[_0x7d11('0xaf')][_0x491d94][_0x7d11('0xb2')]));_0x83416b[_0x7d11('0x89')](_0x5508cf(_0x7d11('0xb4'),_0x2e57e4['rows'][_0x491d94][_0x7d11('0xb2')]));_0x83416b[_0x7d11('0x89')](_0x5508cf(_0x7d11('0xb5'),_0x2e57e4[_0x7d11('0xaf')][_0x491d94]['dataValues']));}return Promise[_0x7d11('0x8d')](_0x83416b)[_0x7d11('0xd')](function(){return _0x2e57e4;});}return _0x2e57e4;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 88a1094..8bbe2a5 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 _0x4e47=['client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\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(_0x3fd691,_0x58331d){var _0x241e8e=function(_0x3f1651){while(--_0x3f1651){_0x3fd691['push'](_0x3fd691['shift']());}};_0x241e8e(++_0x58331d);}(_0x4e47,0x17f));var _0x74e4=function(_0xe0de7b,_0x45977c){_0xe0de7b=_0xe0de7b-0x0;var _0x2006f9=_0x4e47[_0xe0de7b];return _0x2006f9;};'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 +var _0x4253=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4253,0x14c));var _0x3425=function(_0x17a6b0,_0x5ffb1f){_0x17a6b0=_0x17a6b0-0x0;var _0x29b906=_0x4253[_0x17a6b0];return _0x29b906;};'use strict';var _=require(_0x3425('0x0'));var util=require(_0x3425('0x1'));var moment=require('moment');var BPromise=require(_0x3425('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3425('0x3'));var db=require(_0x3425('0x4'))['db'];var utils=require(_0x3425('0x5'));var logger=require(_0x3425('0x6'))(_0x3425('0x7'));var config=require(_0x3425('0x8'));var jayson=require(_0x3425('0x9'));var client=jayson[_0x3425('0xa')][_0x3425('0xb')]({'port':0x232a});config['redis']=_[_0x3425('0xc')](config[_0x3425('0xd')],{'host':_0x3425('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3425('0xd')]));require(_0x3425('0xf'))['register'](socket);function respondWithRpcPromise(_0x21c54d,_0x562e27,_0x5bcbf0){return new BPromise(function(_0x528436,_0x196d62){return client[_0x3425('0x10')](_0x21c54d,_0x5bcbf0)[_0x3425('0x11')](function(_0x5788e7){logger[_0x3425('0x12')](_0x3425('0x13'),_0x562e27,_0x3425('0x14'));logger['debug'](_0x3425('0x15'),_0x562e27,_0x3425('0x14'),JSON[_0x3425('0x16')](_0x5788e7));if(_0x5788e7[_0x3425('0x17')]){if(_0x5788e7[_0x3425('0x17')][_0x3425('0x18')]===0x1f4){logger[_0x3425('0x17')]('UserProfile,\x20%s,\x20%s',_0x562e27,_0x5788e7[_0x3425('0x17')]['message']);return _0x196d62(_0x5788e7[_0x3425('0x17')][_0x3425('0x19')]);}logger['error'](_0x3425('0x13'),_0x562e27,_0x5788e7[_0x3425('0x17')]['message']);return _0x528436(_0x5788e7[_0x3425('0x17')]['message']);}else{logger[_0x3425('0x12')](_0x3425('0x13'),_0x562e27,_0x3425('0x14'));_0x528436(_0x5788e7[_0x3425('0x1a')]['message']);}})[_0x3425('0x1b')](function(_0x5a5876){logger[_0x3425('0x17')](_0x3425('0x13'),_0x562e27,_0x5a5876);_0x196d62(_0x5a5876);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 9c046bf..a1c34ca 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 _0x3d58=['emit','removeListener','register','length','userProfile:','./userProfile.events','save','update'];(function(_0x10ecc7,_0x4f6235){var _0xf9b77a=function(_0x4f37a0){while(--_0x4f37a0){_0x10ecc7['push'](_0x10ecc7['shift']());}};_0xf9b77a(++_0x4f6235);}(_0x3d58,0x1e5));var _0x83d5=function(_0x10c70a,_0x37da2a){_0x10c70a=_0x10c70a-0x0;var _0x486a73=_0x3d58[_0x10c70a];return _0x486a73;};'use strict';var UserProfileEvents=require(_0x83d5('0x0'));var events=[_0x83d5('0x1'),'remove',_0x83d5('0x2')];function createListener(_0xdb27b0,_0x52224e){return function(_0x3a6169){_0x52224e[_0x83d5('0x3')](_0xdb27b0,_0x3a6169);};}function removeListener(_0x24ae4a,_0x297545){return function(){UserProfileEvents[_0x83d5('0x4')](_0x24ae4a,_0x297545);};}exports[_0x83d5('0x5')]=function(_0x517a81){for(var _0x3a7732=0x0,_0x298429=events[_0x83d5('0x6')];_0x3a7732<_0x298429;_0x3a7732++){var _0x510f72=events[_0x3a7732];var _0xddf073=createListener(_0x83d5('0x7')+_0x510f72,_0x517a81);UserProfileEvents['on'](_0x510f72,_0xddf073);}}; \ No newline at end of file +var _0xf280=['register','length','userProfile:','./userProfile.events','save','update','emit','removeListener'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xf280,0x1a3));var _0x0f28=function(_0x122d9f,_0x2c9e5b){_0x122d9f=_0x122d9f-0x0;var _0x41a09e=_0xf280[_0x122d9f];return _0x41a09e;};'use strict';var UserProfileEvents=require(_0x0f28('0x0'));var events=[_0x0f28('0x1'),'remove',_0x0f28('0x2')];function createListener(_0x5d4762,_0x438474){return function(_0x2133ce){_0x438474[_0x0f28('0x3')](_0x5d4762,_0x2133ce);};}function removeListener(_0x1d376,_0x1b52f2){return function(){UserProfileEvents[_0x0f28('0x4')](_0x1d376,_0x1b52f2);};}exports[_0x0f28('0x5')]=function(_0x3eb1e4){for(var _0x52a4de=0x0,_0x18d4cc=events[_0x0f28('0x6')];_0x52a4de<_0x18d4cc;_0x52a4de++){var _0x4d327b=events[_0x52a4de];var _0x2dcd6c=createListener(_0x0f28('0x7')+_0x4d327b,_0x3eb1e4);UserProfileEvents['on'](_0x4d327b,_0x2dcd6c);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 90c4082..aae0a5a 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 _0xca14=['update','delete','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','/:id','show','create'];(function(_0x1c94a6,_0x2a938d){var _0xdb5e65=function(_0x214da9){while(--_0x214da9){_0x1c94a6['push'](_0x1c94a6['shift']());}};_0xdb5e65(++_0x2a938d);}(_0xca14,0x1e0));var _0x4ca1=function(_0x3bc3b4,_0x5acff4){_0x3bc3b4=_0x3bc3b4-0x0;var _0x4c546b=_0xca14[_0x3bc3b4];return _0x4c546b;};'use strict';var multer=require('multer');var util=require(_0x4ca1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4ca1('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x4ca1('0x2'));var interaction=require(_0x4ca1('0x3'));var config=require(_0x4ca1('0x4'));var controller=require(_0x4ca1('0x5'));router[_0x4ca1('0x6')]('/',auth[_0x4ca1('0x7')](),controller[_0x4ca1('0x8')]);router['get'](_0x4ca1('0x9'),auth[_0x4ca1('0x7')](),controller['describe']);router['get'](_0x4ca1('0xa'),auth[_0x4ca1('0x7')](),controller[_0x4ca1('0xb')]);router['post']('/',auth[_0x4ca1('0x7')](),controller[_0x4ca1('0xc')]);router['put'](_0x4ca1('0xa'),auth[_0x4ca1('0x7')](),controller[_0x4ca1('0xd')]);router[_0x4ca1('0xe')]('/:id',auth[_0x4ca1('0x7')](),controller[_0x4ca1('0xf')]);module[_0x4ca1('0x10')]=router; \ No newline at end of file +var _0xfb34=['post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','index','get','/describe','describe','/:id','isAuthenticated'];(function(_0x54ab63,_0x56ce3c){var _0x1e903b=function(_0x27e652){while(--_0x27e652){_0x54ab63['push'](_0x54ab63['shift']());}};_0x1e903b(++_0x56ce3c);}(_0xfb34,0x1e9));var _0x4fb3=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0xfb34[_0x50a004];return _0x5e9992;};'use strict';var multer=require('multer');var util=require(_0x4fb3('0x0'));var path=require(_0x4fb3('0x1'));var timeout=require(_0x4fb3('0x2'));var express=require(_0x4fb3('0x3'));var router=express[_0x4fb3('0x4')]();var fs_extra=require(_0x4fb3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4fb3('0x6'));var config=require(_0x4fb3('0x7'));var controller=require(_0x4fb3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4fb3('0x9')]);router[_0x4fb3('0xa')](_0x4fb3('0xb'),auth['isAuthenticated'](),controller[_0x4fb3('0xc')]);router[_0x4fb3('0xa')](_0x4fb3('0xd'),auth[_0x4fb3('0xe')](),controller['show']);router[_0x4fb3('0xf')]('/',auth[_0x4fb3('0xe')](),controller[_0x4fb3('0x10')]);router[_0x4fb3('0x11')]('/:id',auth[_0x4fb3('0xe')](),controller[_0x4fb3('0x12')]);router[_0x4fb3('0x13')](_0x4fb3('0xd'),auth[_0x4fb3('0xe')](),controller[_0x4fb3('0x14')]);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 7928925..729a9d1 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 _0xc2e8=['INTEGER','sequelize','STRING'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc2e8,0x112));var _0x8c2e=function(_0x3cf89e,_0x4c40bb){_0x3cf89e=_0x3cf89e-0x0;var _0x168c11=_0xc2e8[_0x3cf89e];return _0x168c11;};'use strict';var Sequelize=require(_0x8c2e('0x0'));module['exports']={'name':{'type':Sequelize[_0x8c2e('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x8c2e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8c2e('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8331=['exports','STRING','INTEGER','sequelize'];(function(_0x5d57c7,_0x3547be){var _0x2ee0ee=function(_0x4da696){while(--_0x4da696){_0x5d57c7['push'](_0x5d57c7['shift']());}};_0x2ee0ee(++_0x3547be);}(_0x8331,0x197));var _0x1833=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x8331[_0x264545];return _0x114d10;};'use strict';var Sequelize=require(_0x1833('0x0'));module[_0x1833('0x1')]={'name':{'type':Sequelize[_0x1833('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x1833('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x1833('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 695a7d7..f924744 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 _0x5c3c=['findAll','rows','params','merge','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','UserProfileResource','includeAll','include'];(function(_0x497f48,_0x4e11f2){var _0x510210=function(_0x441d34){while(--_0x441d34){_0x497f48['push'](_0x497f48['shift']());}};_0x510210(++_0x4e11f2);}(_0x5c3c,0x132));var _0xc5c3=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x5c3c[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){_0x52d638[_0xc5c3('0x18')](0xcc)[_0xc5c3('0x19')]();});}};}function handleEntityNotFound(_0x38a3df,_0x52e54a){return function(_0x4af067){if(!_0x4af067){_0x38a3df[_0xc5c3('0x24')](0x194);}return _0x4af067;};}function handleError(_0x22f607,_0x20c506){_0x20c506=_0x20c506||0x1f4;return function(_0x29791c){logger['error'](_0x29791c[_0xc5c3('0x25')]);if(_0x29791c['name']){delete _0x29791c[_0xc5c3('0x26')];}_0x22f607['status'](_0x20c506)[_0xc5c3('0x27')](_0x29791c);};}exports[_0xc5c3('0x28')]=function(_0x4269eb,_0x4773c5){var _0x15361c={},_0x2d07e1={},_0x35a397={'count':0x0,'rows':[]};var _0x4b5a0c=_[_0xc5c3('0x29')](db['UserProfileResource'][_0xc5c3('0x2a')],function(_0x43ebfc){return{'name':_0x43ebfc['fieldName'],'type':_0x43ebfc['type'][_0xc5c3('0x2b')]};});_0x2d07e1[_0xc5c3('0x2c')]=_[_0xc5c3('0x29')](_0x4b5a0c,_0xc5c3('0x26'));_0x2d07e1['query']=_[_0xc5c3('0x2d')](_0x4269eb[_0xc5c3('0x2e')]);_0x2d07e1[_0xc5c3('0x2f')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],_0x2d07e1[_0xc5c3('0x2e')]);_0x15361c[_0xc5c3('0x31')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],qs['fields'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x32')]));_0x15361c[_0xc5c3('0x31')]=_0x15361c[_0xc5c3('0x31')][_0xc5c3('0x33')]?_0x15361c[_0xc5c3('0x31')]:_0x2d07e1[_0xc5c3('0x2c')];if(!_0x4269eb['query']['hasOwnProperty'](_0xc5c3('0x34'))){_0x15361c['limit']=qs[_0xc5c3('0x1a')](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x1a')]);_0x15361c[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0x4269eb['query'][_0xc5c3('0x1c')]);}_0x15361c[_0xc5c3('0x35')]=qs['sort'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x36')]);_0x15361c[_0xc5c3('0x37')]=qs[_0xc5c3('0x2f')](_[_0xc5c3('0x38')](_0x4269eb[_0xc5c3('0x2e')],_0x2d07e1[_0xc5c3('0x2f')]),_0x4b5a0c);if(_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x39')]){_0x15361c[_0xc5c3('0x37')]=_['merge'](_0x15361c[_0xc5c3('0x37')],{'$or':_['map'](_0x4b5a0c,function(_0x4fdbe6){if(_0x4fdbe6[_0xc5c3('0x3a')]!==_0xc5c3('0x3b')){var _0x1b546e={};_0x1b546e[_0x4fdbe6[_0xc5c3('0x26')]]={'$like':'%'+_0x4269eb[_0xc5c3('0x2e')]['filter']+'%'};return _0x1b546e;}})});}_0x15361c=_['merge']({},_0x15361c,_0x4269eb[_0xc5c3('0x3c')]);var _0xa7cb91={'where':_0x15361c['where']};return db[_0xc5c3('0x3d')]['count'](_0xa7cb91)[_0xc5c3('0x23')](function(_0x2dfd19){_0x35a397[_0xc5c3('0x1b')]=_0x2dfd19;if(_0x4269eb['query'][_0xc5c3('0x3e')]){_0x15361c[_0xc5c3('0x3f')]=[{'all':!![]}];}return db['UserProfileResource'][_0xc5c3('0x40')](_0x15361c);})['then'](function(_0x33936c){_0x35a397[_0xc5c3('0x41')]=_0x33936c;return _0x35a397;})['then'](respondWithFilteredResult(_0x4773c5,_0x15361c))['catch'](handleError(_0x4773c5,null));};exports['show']=function(_0xfb64bb,_0x2f02ab){var _0x49b1fc={'raw':![],'where':{'id':_0xfb64bb[_0xc5c3('0x42')]['id']}},_0x1a8490={};_0x1a8490[_0xc5c3('0x2c')]=_[_0xc5c3('0x2d')](db['UserProfileResource'][_0xc5c3('0x2a')]);_0x1a8490['query']=_['keys'](_0xfb64bb[_0xc5c3('0x2e')]);_0x1a8490[_0xc5c3('0x2f')]=_['intersection'](_0x1a8490[_0xc5c3('0x2c')],_0x1a8490[_0xc5c3('0x2e')]);_0x49b1fc['attributes']=_[_0xc5c3('0x30')](_0x1a8490['model'],qs[_0xc5c3('0x32')](_0xfb64bb[_0xc5c3('0x2e')]['fields']));_0x49b1fc[_0xc5c3('0x31')]=_0x49b1fc['attributes'][_0xc5c3('0x33')]?_0x49b1fc[_0xc5c3('0x31')]:_0x1a8490['model'];if(_0xfb64bb[_0xc5c3('0x2e')][_0xc5c3('0x3e')]){_0x49b1fc[_0xc5c3('0x3f')]=[{'all':!![]}];}_0x49b1fc=_[_0xc5c3('0x43')]({},_0x49b1fc,_0xfb64bb[_0xc5c3('0x3c')]);return db[_0xc5c3('0x3d')]['find'](_0x49b1fc)[_0xc5c3('0x23')](handleEntityNotFound(_0x2f02ab,null))[_0xc5c3('0x23')](respondWithResult(_0x2f02ab,null))[_0xc5c3('0x44')](handleError(_0x2f02ab,null));};exports[_0xc5c3('0x45')]=function(_0x23002b,_0x4a7330){return db['UserProfileResource'][_0xc5c3('0x45')](_0x23002b[_0xc5c3('0x46')],{})[_0xc5c3('0x23')](respondWithResult(_0x4a7330,0xc9))['catch'](handleError(_0x4a7330,null));};exports[_0xc5c3('0x22')]=function(_0x65f720,_0x3a901f){if(_0x65f720[_0xc5c3('0x46')]['id']){delete _0x65f720[_0xc5c3('0x46')]['id'];}return db[_0xc5c3('0x3d')][_0xc5c3('0x47')]({'where':{'id':_0x65f720['params']['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x3a901f,null))[_0xc5c3('0x23')](saveUpdates(_0x65f720[_0xc5c3('0x46')],null))['then'](respondWithResult(_0x3a901f,null))[_0xc5c3('0x44')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x48')]=function(_0x3b1bc2,_0x103bde){return db[_0xc5c3('0x3d')]['find']({'where':{'id':_0x3b1bc2[_0xc5c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x103bde,null))[_0xc5c3('0x23')](removeEntity(_0x103bde,null))['catch'](handleError(_0x103bde,null));};exports[_0xc5c3('0x49')]=function(_0x34a2c3,_0x4add6b){return db[_0xc5c3('0x3d')][_0xc5c3('0x49')]()['then'](respondWithResult(_0x4add6b,null))[_0xc5c3('0x44')](handleError(_0x4add6b,null));}; \ No newline at end of file +var _0x896e=['hasOwnProperty','nolimit','order','sort','where','merge','filter','UserProfileResource','includeAll','include','findAll','rows','catch','keys','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x896e,0x1e9));var _0xe896=function(_0x59d2dd,_0x9b6f69){_0x59d2dd=_0x59d2dd-0x0;var _0x1de850=_0x896e[_0x59d2dd];return _0x1de850;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];function respondWithStatusCode(_0x3e8ac9,_0x580aac){_0x580aac=_0x580aac||0xcc;return function(_0x2aa522){if(_0x2aa522){return _0x3e8ac9[_0xe896('0x1a')](_0x580aac);}return _0x3e8ac9[_0xe896('0x1b')](_0x580aac)['end']();};}function respondWithResult(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xc8;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['status'](_0x7dcf8a)['json'](_0x1e7ef8);}};}function respondWithFilteredResult(_0x446ce2,_0x25606b){return function(_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=typeof _0x25606b[_0xe896('0x1c')]===_0xe896('0x1d')&&typeof _0x25606b['limit']===_0xe896('0x1d');var _0x4e062a=_0x51e7b7[_0xe896('0x1e')];var _0x32f86d=_0x5e78d6?0x0:_0x25606b[_0xe896('0x1c')];var _0x5dc89d=_0x5e78d6?_0x51e7b7[_0xe896('0x1e')]:_0x25606b[_0xe896('0x1c')]+_0x25606b[_0xe896('0x1f')];var _0xbebbe1;if(_0x5dc89d>=_0x4e062a){_0x5dc89d=_0x4e062a;_0xbebbe1=0xc8;}else{_0xbebbe1=0xce;}_0x446ce2[_0xe896('0x1b')](_0xbebbe1);return _0x446ce2[_0xe896('0x20')](_0xe896('0x21'),_0x32f86d+'-'+_0x5dc89d+'/'+_0x4e062a)[_0xe896('0x22')](_0x51e7b7);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x23')](_0x5d2c8d);}return _0x180d46[_0xe896('0x24')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x25')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x26')]()[_0xe896('0x27')](function(){_0x45dd49[_0xe896('0x1b')](0xcc)[_0xe896('0x28')]();});}};}function handleEntityNotFound(_0x4b71cc,_0x390128){return function(_0x163a75){if(!_0x163a75){_0x4b71cc[_0xe896('0x1a')](0x194);}return _0x163a75;};}function handleError(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0x1f4;return function(_0xd50fe2){logger[_0xe896('0x29')](_0xd50fe2[_0xe896('0x2a')]);if(_0xd50fe2[_0xe896('0x2b')]){delete _0xd50fe2[_0xe896('0x2b')];}_0x569d5f['status'](_0x26635e)[_0xe896('0x2c')](_0xd50fe2);};}exports[_0xe896('0x2d')]=function(_0x201653,_0xbfb15b){var _0xace03f={},_0x5e0d9b={},_0x47c268={'count':0x0,'rows':[]};var _0x5c7dae=_['map'](db['UserProfileResource'][_0xe896('0x2e')],function(_0x29a18e){return{'name':_0x29a18e[_0xe896('0x2f')],'type':_0x29a18e[_0xe896('0x30')][_0xe896('0x31')]};});_0x5e0d9b[_0xe896('0x32')]=_[_0xe896('0x33')](_0x5c7dae,_0xe896('0x2b'));_0x5e0d9b['query']=_['keys'](_0x201653[_0xe896('0x34')]);_0x5e0d9b[_0xe896('0x35')]=_[_0xe896('0x36')](_0x5e0d9b[_0xe896('0x32')],_0x5e0d9b['query']);_0xace03f[_0xe896('0x37')]=_['intersection'](_0x5e0d9b['model'],qs[_0xe896('0x38')](_0x201653[_0xe896('0x34')][_0xe896('0x38')]));_0xace03f['attributes']=_0xace03f['attributes']['length']?_0xace03f[_0xe896('0x37')]:_0x5e0d9b[_0xe896('0x32')];if(!_0x201653[_0xe896('0x34')][_0xe896('0x39')](_0xe896('0x3a'))){_0xace03f['limit']=qs[_0xe896('0x1f')](_0x201653[_0xe896('0x34')][_0xe896('0x1f')]);_0xace03f[_0xe896('0x1c')]=qs[_0xe896('0x1c')](_0x201653[_0xe896('0x34')][_0xe896('0x1c')]);}_0xace03f[_0xe896('0x3b')]=qs['sort'](_0x201653[_0xe896('0x34')][_0xe896('0x3c')]);_0xace03f['where']=qs[_0xe896('0x35')](_['pick'](_0x201653[_0xe896('0x34')],_0x5e0d9b['filters']),_0x5c7dae);if(_0x201653[_0xe896('0x34')]['filter']){_0xace03f[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0xace03f[_0xe896('0x3d')],{'$or':_[_0xe896('0x33')](_0x5c7dae,function(_0xeb9bbf){if(_0xeb9bbf['type']!=='VIRTUAL'){var _0x203aea={};_0x203aea[_0xeb9bbf[_0xe896('0x2b')]]={'$like':'%'+_0x201653[_0xe896('0x34')][_0xe896('0x3f')]+'%'};return _0x203aea;}})});}_0xace03f=_[_0xe896('0x3e')]({},_0xace03f,_0x201653['options']);var _0x5b8131={'where':_0xace03f[_0xe896('0x3d')]};return db[_0xe896('0x40')]['count'](_0x5b8131)['then'](function(_0x19d2fd){_0x47c268[_0xe896('0x1e')]=_0x19d2fd;if(_0x201653[_0xe896('0x34')][_0xe896('0x41')]){_0xace03f[_0xe896('0x42')]=[{'all':!![]}];}return db[_0xe896('0x40')][_0xe896('0x43')](_0xace03f);})[_0xe896('0x27')](function(_0x372c71){_0x47c268[_0xe896('0x44')]=_0x372c71;return _0x47c268;})[_0xe896('0x27')](respondWithFilteredResult(_0xbfb15b,_0xace03f))[_0xe896('0x45')](handleError(_0xbfb15b,null));};exports['show']=function(_0x1e5434,_0x143ad4){var _0x59b97f={'raw':![],'where':{'id':_0x1e5434['params']['id']}},_0x57366b={};_0x57366b[_0xe896('0x32')]=_[_0xe896('0x46')](db[_0xe896('0x40')]['rawAttributes']);_0x57366b[_0xe896('0x34')]=_[_0xe896('0x46')](_0x1e5434['query']);_0x57366b['filters']=_['intersection'](_0x57366b[_0xe896('0x32')],_0x57366b[_0xe896('0x34')]);_0x59b97f[_0xe896('0x37')]=_[_0xe896('0x36')](_0x57366b[_0xe896('0x32')],qs[_0xe896('0x38')](_0x1e5434['query'][_0xe896('0x38')]));_0x59b97f[_0xe896('0x37')]=_0x59b97f['attributes'][_0xe896('0x47')]?_0x59b97f[_0xe896('0x37')]:_0x57366b[_0xe896('0x32')];if(_0x1e5434[_0xe896('0x34')]['includeAll']){_0x59b97f[_0xe896('0x42')]=[{'all':!![]}];}_0x59b97f=_[_0xe896('0x3e')]({},_0x59b97f,_0x1e5434[_0xe896('0x48')]);return db[_0xe896('0x40')][_0xe896('0x49')](_0x59b97f)[_0xe896('0x27')](handleEntityNotFound(_0x143ad4,null))['then'](respondWithResult(_0x143ad4,null))[_0xe896('0x45')](handleError(_0x143ad4,null));};exports['create']=function(_0x234a22,_0x1c6ae1){return db[_0xe896('0x40')][_0xe896('0x4a')](_0x234a22[_0xe896('0x4b')],{})[_0xe896('0x27')](respondWithResult(_0x1c6ae1,0xc9))['catch'](handleError(_0x1c6ae1,null));};exports[_0xe896('0x25')]=function(_0x206ad3,_0x4818cd){if(_0x206ad3[_0xe896('0x4b')]['id']){delete _0x206ad3[_0xe896('0x4b')]['id'];}return db['UserProfileResource'][_0xe896('0x49')]({'where':{'id':_0x206ad3['params']['id']}})[_0xe896('0x27')](handleEntityNotFound(_0x4818cd,null))[_0xe896('0x27')](saveUpdates(_0x206ad3[_0xe896('0x4b')],null))[_0xe896('0x27')](respondWithResult(_0x4818cd,null))[_0xe896('0x45')](handleError(_0x4818cd,null));};exports['destroy']=function(_0x1fa3fd,_0x819c8a){return db[_0xe896('0x40')]['find']({'where':{'id':_0x1fa3fd[_0xe896('0x4c')]['id']}})['then'](handleEntityNotFound(_0x819c8a,null))['then'](removeEntity(_0x819c8a,null))[_0xe896('0x45')](handleError(_0x819c8a,null));};exports[_0xe896('0x4d')]=function(_0x57aed3,_0x343adb){return db[_0xe896('0x40')]['describe']()['then'](respondWithResult(_0x343adb,null))[_0xe896('0x45')](handleError(_0x343adb,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 76502c1..f7ca93b 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 _0x9178=['path','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','bluebird'];(function(_0x9c297f,_0x1e1fbe){var _0x170b76=function(_0x476f6b){while(--_0x476f6b){_0x9c297f['push'](_0x9c297f['shift']());}};_0x170b76(++_0x1e1fbe);}(_0x9178,0x69));var _0x8917=function(_0x2d6dd1,_0x598d01){_0x2d6dd1=_0x2d6dd1-0x0;var _0x485ab1=_0x9178[_0x2d6dd1];return _0x485ab1;};'use strict';var _=require(_0x8917('0x0'));var util=require(_0x8917('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8917('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8917('0x3'));var rimraf=require('rimraf');var config=require(_0x8917('0x4'));var attributes=require('./userProfileResource.attributes');module[_0x8917('0x5')]=function(_0x2e95e1,_0x14b25d){return _0x2e95e1[_0x8917('0x6')](_0x8917('0x7'),attributes,{'tableName':_0x8917('0x8'),'paranoid':![],'indexes':[{'name':_0x8917('0x9'),'fields':[_0x8917('0xa'),_0x8917('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc41f=['../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','lodash','util'];(function(_0x287201,_0x2aca32){var _0x31188=function(_0x6326b5){while(--_0x6326b5){_0x287201['push'](_0x287201['shift']());}};_0x31188(++_0x2aca32);}(_0xc41f,0x16a));var _0xfc41=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0xc41f[_0x479509];return _0x382da8;};'use strict';var _=require(_0xfc41('0x0'));var util=require(_0xfc41('0x1'));var logger=require(_0xfc41('0x2'))(_0xfc41('0x3'));var moment=require('moment');var BPromise=require(_0xfc41('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfc41('0x5'));var config=require(_0xfc41('0x6'));var attributes=require('./userProfileResource.attributes');module[_0xfc41('0x7')]=function(_0x586b98,_0x490dd3){return _0x586b98[_0xfc41('0x8')](_0xfc41('0x9'),attributes,{'tableName':_0xfc41('0xa'),'paranoid':![],'indexes':[{'name':_0xfc41('0xb'),'fields':[_0xfc41('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 7f0fca2..9df85fc 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 _0xd2dd=['jayson/promise','client','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x36b0a3,_0xbf646a){var _0x38245d=function(_0x6bb05f){while(--_0x6bb05f){_0x36b0a3['push'](_0x36b0a3['shift']());}};_0x38245d(++_0xbf646a);}(_0xd2dd,0x1f1));var _0xdd2d=function(_0x8bc0de,_0x4baa98){_0x8bc0de=_0x8bc0de-0x0;var _0x40427d=_0xd2dd[_0x8bc0de];return _0x40427d;};'use strict';var _=require(_0xdd2d('0x0'));var util=require(_0xdd2d('0x1'));var moment=require(_0xdd2d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd2d('0x3'));var db=require(_0xdd2d('0x4'))['db'];var utils=require(_0xdd2d('0x5'));var logger=require(_0xdd2d('0x6'))(_0xdd2d('0x7'));var config=require(_0xdd2d('0x8'));var jayson=require(_0xdd2d('0x9'));var client=jayson[_0xdd2d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc0e8,_0x4c2b7f,_0x2a754e){return new BPromise(function(_0x55f775,_0x43f6c5){return client['request'](_0x4dc0e8,_0x2a754e)[_0xdd2d('0xb')](function(_0x261cd6){logger[_0xdd2d('0xc')](_0xdd2d('0xd'),_0x4c2b7f,_0xdd2d('0xe'));logger[_0xdd2d('0xf')](_0xdd2d('0x10'),_0x4c2b7f,_0xdd2d('0xe'),JSON['stringify'](_0x261cd6));if(_0x261cd6[_0xdd2d('0x11')]){if(_0x261cd6[_0xdd2d('0x11')][_0xdd2d('0x12')]===0x1f4){logger[_0xdd2d('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x4c2b7f,_0x261cd6[_0xdd2d('0x11')][_0xdd2d('0x13')]);return _0x43f6c5(_0x261cd6[_0xdd2d('0x11')][_0xdd2d('0x13')]);}logger['error'](_0xdd2d('0xd'),_0x4c2b7f,_0x261cd6[_0xdd2d('0x11')][_0xdd2d('0x13')]);return _0x55f775(_0x261cd6[_0xdd2d('0x11')][_0xdd2d('0x13')]);}else{logger[_0xdd2d('0xc')](_0xdd2d('0xd'),_0x4c2b7f,'request\x20sent');_0x55f775(_0x261cd6[_0xdd2d('0x14')][_0xdd2d('0x13')]);}})[_0xdd2d('0x15')](function(_0x4e7f6f){logger['error'](_0xdd2d('0xd'),_0x4c2b7f,_0x4e7f6f);_0x43f6c5(_0x4e7f6f);});});} \ No newline at end of file +var _0x9e00=['request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','UserProfileResource,\x20%s,\x20%s'];(function(_0x85948c,_0x5cc1c0){var _0x24f542=function(_0x5a1050){while(--_0x5a1050){_0x85948c['push'](_0x85948c['shift']());}};_0x24f542(++_0x5cc1c0);}(_0x9e00,0x80));var _0x09e0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9e00[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x09e0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x09e0('0x1'));var rs=require(_0x09e0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x09e0('0x3'))['db'];var utils=require(_0x09e0('0x4'));var logger=require(_0x09e0('0x5'))(_0x09e0('0x6'));var config=require(_0x09e0('0x7'));var jayson=require(_0x09e0('0x8'));var client=jayson[_0x09e0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57116c,_0x4c6720,_0x208f27){return new BPromise(function(_0x2967db,_0x245834){return client['request'](_0x57116c,_0x208f27)[_0x09e0('0xa')](function(_0x19083f){logger['info'](_0x09e0('0xb'),_0x4c6720,_0x09e0('0xc'));logger['debug'](_0x09e0('0xd'),_0x4c6720,_0x09e0('0xc'),JSON[_0x09e0('0xe')](_0x19083f));if(_0x19083f[_0x09e0('0xf')]){if(_0x19083f[_0x09e0('0xf')]['code']===0x1f4){logger[_0x09e0('0xf')](_0x09e0('0xb'),_0x4c6720,_0x19083f[_0x09e0('0xf')][_0x09e0('0x10')]);return _0x245834(_0x19083f[_0x09e0('0xf')]['message']);}logger['error'](_0x09e0('0xb'),_0x4c6720,_0x19083f[_0x09e0('0xf')][_0x09e0('0x10')]);return _0x2967db(_0x19083f['error']['message']);}else{logger[_0x09e0('0x11')](_0x09e0('0xb'),_0x4c6720,_0x09e0('0xc'));_0x2967db(_0x19083f[_0x09e0('0x12')]['message']);}})[_0x09e0('0x13')](function(_0x8a885c){logger[_0x09e0('0xf')](_0x09e0('0xb'),_0x4c6720,_0x8a885c);_0x245834(_0x8a885c);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 6f90c20..4ace612 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 _0x0138=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x48e0bf,_0x19f2f3){var _0x56f176=function(_0x201d45){while(--_0x201d45){_0x48e0bf['push'](_0x48e0bf['shift']());}};_0x56f176(++_0x19f2f3);}(_0x0138,0x161));var _0x8013=function(_0x1d234d,_0x12b084){_0x1d234d=_0x1d234d-0x0;var _0x477d21=_0x0138[_0x1d234d];return _0x477d21;};'use strict';var multer=require(_0x8013('0x0'));var util=require(_0x8013('0x1'));var path=require(_0x8013('0x2'));var timeout=require(_0x8013('0x3'));var express=require(_0x8013('0x4'));var router=express[_0x8013('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8013('0x6'));var interaction=require(_0x8013('0x7'));var config=require(_0x8013('0x8'));var controller=require(_0x8013('0x9'));router[_0x8013('0xa')]('/',auth[_0x8013('0xb')](),controller[_0x8013('0xc')]);router[_0x8013('0xa')]('/describe',auth[_0x8013('0xb')](),controller['describe']);router[_0x8013('0xa')](_0x8013('0xd'),auth[_0x8013('0xb')](),controller[_0x8013('0xe')]);router[_0x8013('0xf')]('/',auth[_0x8013('0xb')](),controller['create']);router[_0x8013('0x10')](_0x8013('0xd'),auth[_0x8013('0xb')](),controller[_0x8013('0x11')]);router[_0x8013('0x12')]('/:id',auth[_0x8013('0xb')](),controller[_0x8013('0x13')]);module[_0x8013('0x14')]=router; \ No newline at end of file +var _0x2639=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','index','get','/describe','isAuthenticated','/:id','show','create','put','update','exports','multer','path','connect-timeout','express','Router'];(function(_0x52465f,_0x2dfdef){var _0x48ea12=function(_0x4ecac9){while(--_0x4ecac9){_0x52465f['push'](_0x52465f['shift']());}};_0x48ea12(++_0x2dfdef);}(_0x2639,0xcc));var _0x9263=function(_0x5a5633,_0x4d68be){_0x5a5633=_0x5a5633-0x0;var _0xdae7fa=_0x2639[_0x5a5633];return _0xdae7fa;};'use strict';var multer=require(_0x9263('0x0'));var util=require('util');var path=require(_0x9263('0x1'));var timeout=require(_0x9263('0x2'));var express=require(_0x9263('0x3'));var router=express[_0x9263('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9263('0x5'));var interaction=require(_0x9263('0x6'));var config=require(_0x9263('0x7'));var controller=require(_0x9263('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9263('0x9')]);router[_0x9263('0xa')](_0x9263('0xb'),auth[_0x9263('0xc')](),controller['describe']);router[_0x9263('0xa')](_0x9263('0xd'),auth[_0x9263('0xc')](),controller[_0x9263('0xe')]);router['post']('/',auth[_0x9263('0xc')](),controller[_0x9263('0xf')]);router[_0x9263('0x10')](_0x9263('0xd'),auth[_0x9263('0xc')](),controller[_0x9263('0x11')]);router['delete'](_0x9263('0xd'),auth[_0x9263('0xc')](),controller['destroy']);module[_0x9263('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 946b1c1..919d552 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 _0x02ce=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','sequelize','exports','STRING','INTEGER'];(function(_0x51614d,_0x5b316f){var _0x3ad77e=function(_0x2b9bdf){while(--_0x2b9bdf){_0x51614d['push'](_0x51614d['shift']());}};_0x3ad77e(++_0x5b316f);}(_0x02ce,0x1ac));var _0xe02c=function(_0x4dafe7,_0x24f53b){_0x4dafe7=_0x4dafe7-0x0;var _0x17d233=_0x02ce[_0x4dafe7];return _0x17d233;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'name':{'type':Sequelize[_0xe02c('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xe02c('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xe02c('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xe02c('0x2')],'set':function(_0x46475c){this[_0xe02c('0x5')](_0xe02c('0x6'),_0x46475c?_0x46475c[_0xe02c('0x7')](''):[]);},'get':function(){return this[_0xe02c('0x8')](_0xe02c('0x6'))?this[_0xe02c('0x8')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0xf45e=['INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','STRING'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xf45e,0x115));var _0xef45=function(_0x4ec4c6,_0xee1082){_0x4ec4c6=_0x4ec4c6-0x0;var _0x25c91d=_0xf45e[_0x4ec4c6];return _0x25c91d;};'use strict';var Sequelize=require(_0xef45('0x0'));module['exports']={'name':{'type':Sequelize[_0xef45('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xef45('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xef45('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xef45('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xef45('0x1')],'set':function(_0x37772f){this[_0xef45('0x4')](_0xef45('0x5'),_0x37772f?_0x37772f[_0xef45('0x6')](''):[]);},'get':function(){return this[_0xef45('0x7')](_0xef45('0x5'))?this[_0xef45('0x7')](_0xef45('0x5'))[_0xef45('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 1d6b672..199b231 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 _0x2ec2=['then','destroy','status','error','stack','name','send','index','map','UserProfileSection','rawAttributes','type','query','intersection','model','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','limit','undefined','offset','count','set','reject','save'];(function(_0x58dc50,_0x2af0b7){var _0x1fda34=function(_0x5cf61b){while(--_0x5cf61b){_0x58dc50['push'](_0x58dc50['shift']());}};_0x1fda34(++_0x2af0b7);}(_0x2ec2,0x156));var _0x22ec=function(_0x4da4ea,_0x2875d3){_0x4da4ea=_0x4da4ea-0x0;var _0x3cc102=_0x2ec2[_0x4da4ea];return _0x3cc102;};'use strict';var emlformat=require(_0x22ec('0x0'));var rimraf=require(_0x22ec('0x1'));var zipdir=require(_0x22ec('0x2'));var jsonpatch=require(_0x22ec('0x3'));var rp=require(_0x22ec('0x4'));var moment=require(_0x22ec('0x5'));var BPromise=require(_0x22ec('0x6'));var Mustache=require(_0x22ec('0x7'));var util=require(_0x22ec('0x8'));var path=require(_0x22ec('0x9'));var sox=require(_0x22ec('0xa'));var csv=require(_0x22ec('0xb'));var ejs=require(_0x22ec('0xc'));var fs=require('fs');var fs_extra=require(_0x22ec('0xd'));var _=require('lodash');var squel=require(_0x22ec('0xe'));var crypto=require(_0x22ec('0xf'));var jsforce=require(_0x22ec('0x10'));var deskjs=require(_0x22ec('0x11'));var toCsv=require(_0x22ec('0xb'));var querystring=require(_0x22ec('0x12'));var Papa=require(_0x22ec('0x13'));var Redis=require(_0x22ec('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x22ec('0x15'));var as=require(_0x22ec('0x16'));var hardwareService=require(_0x22ec('0x17'));var logger=require(_0x22ec('0x18'))(_0x22ec('0x19'));var utils=require(_0x22ec('0x1a'));var config=require(_0x22ec('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x22ec('0x1c'))['db'];function respondWithStatusCode(_0x4a4b44,_0x6b3460){_0x6b3460=_0x6b3460||0xcc;return function(_0x422812){if(_0x422812){return _0x4a4b44['sendStatus'](_0x6b3460);}return _0x4a4b44['status'](_0x6b3460)[_0x22ec('0x1d')]();};}function respondWithResult(_0x96a82e,_0x1b8166){_0x1b8166=_0x1b8166||0xc8;return function(_0x3617a7){if(_0x3617a7){return _0x96a82e['status'](_0x1b8166)[_0x22ec('0x1e')](_0x3617a7);}};}function respondWithFilteredResult(_0x5cf58c,_0xe4f3ce){return function(_0x3e3112){if(_0x3e3112){var _0x4e2e3f=typeof _0xe4f3ce['offset']==='undefined'&&typeof _0xe4f3ce[_0x22ec('0x1f')]===_0x22ec('0x20');var _0x2e534d=_0x3e3112['count'];var _0x5e166e=_0x4e2e3f?0x0:_0xe4f3ce[_0x22ec('0x21')];var _0xfc628a=_0x4e2e3f?_0x3e3112[_0x22ec('0x22')]:_0xe4f3ce['offset']+_0xe4f3ce[_0x22ec('0x1f')];var _0x5e7fb5;if(_0xfc628a>=_0x2e534d){_0xfc628a=_0x2e534d;_0x5e7fb5=0xc8;}else{_0x5e7fb5=0xce;}_0x5cf58c['status'](_0x5e7fb5);return _0x5cf58c[_0x22ec('0x23')]('Content-Range',_0x5e166e+'-'+_0xfc628a+'/'+_0x2e534d)[_0x22ec('0x1e')](_0x3e3112);}return null;};}function patchUpdates(_0x4038d1){return function(_0x2d28b0){try{jsonpatch['apply'](_0x2d28b0,_0x4038d1,!![]);}catch(_0xb4fcaf){return BPromise[_0x22ec('0x24')](_0xb4fcaf);}return _0x2d28b0[_0x22ec('0x25')]();};}function saveUpdates(_0x1873d6,_0x1b7011){return function(_0x172c4e){if(_0x172c4e){return _0x172c4e['update'](_0x1873d6)[_0x22ec('0x26')](function(_0x4f8553){return _0x4f8553;});}return null;};}function removeEntity(_0x519435,_0x461e3e){return function(_0x4259a1){if(_0x4259a1){return _0x4259a1[_0x22ec('0x27')]()[_0x22ec('0x26')](function(){_0x519435[_0x22ec('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42ad77,_0x536484){return function(_0x40d113){if(!_0x40d113){_0x42ad77['sendStatus'](0x194);}return _0x40d113;};}function handleError(_0x2d2921,_0x5acd9b){_0x5acd9b=_0x5acd9b||0x1f4;return function(_0x2625d8){logger[_0x22ec('0x29')](_0x2625d8[_0x22ec('0x2a')]);if(_0x2625d8[_0x22ec('0x2b')]){delete _0x2625d8[_0x22ec('0x2b')];}_0x2d2921['status'](_0x5acd9b)[_0x22ec('0x2c')](_0x2625d8);};}exports[_0x22ec('0x2d')]=function(_0x41c9ab,_0x4e549b){var _0x4863f3={},_0x11188e={},_0x155d24={'count':0x0,'rows':[]};var _0x5a257e=_[_0x22ec('0x2e')](db[_0x22ec('0x2f')][_0x22ec('0x30')],function(_0x19d1d4){return{'name':_0x19d1d4['fieldName'],'type':_0x19d1d4[_0x22ec('0x31')]['key']};});_0x11188e['model']=_[_0x22ec('0x2e')](_0x5a257e,_0x22ec('0x2b'));_0x11188e[_0x22ec('0x32')]=_['keys'](_0x41c9ab[_0x22ec('0x32')]);_0x11188e['filters']=_[_0x22ec('0x33')](_0x11188e[_0x22ec('0x34')],_0x11188e[_0x22ec('0x32')]);_0x4863f3[_0x22ec('0x35')]=_[_0x22ec('0x33')](_0x11188e[_0x22ec('0x34')],qs[_0x22ec('0x36')](_0x41c9ab[_0x22ec('0x32')][_0x22ec('0x36')]));_0x4863f3[_0x22ec('0x35')]=_0x4863f3[_0x22ec('0x35')][_0x22ec('0x37')]?_0x4863f3[_0x22ec('0x35')]:_0x11188e[_0x22ec('0x34')];if(!_0x41c9ab[_0x22ec('0x32')]['hasOwnProperty']('nolimit')){_0x4863f3[_0x22ec('0x1f')]=qs[_0x22ec('0x1f')](_0x41c9ab['query'][_0x22ec('0x1f')]);_0x4863f3[_0x22ec('0x21')]=qs[_0x22ec('0x21')](_0x41c9ab[_0x22ec('0x32')][_0x22ec('0x21')]);}_0x4863f3[_0x22ec('0x38')]=qs[_0x22ec('0x39')](_0x41c9ab[_0x22ec('0x32')][_0x22ec('0x39')]);_0x4863f3[_0x22ec('0x3a')]=qs[_0x22ec('0x3b')](_[_0x22ec('0x3c')](_0x41c9ab[_0x22ec('0x32')],_0x11188e[_0x22ec('0x3b')]),_0x5a257e);if(_0x41c9ab[_0x22ec('0x32')][_0x22ec('0x3d')]){_0x4863f3['where']=_[_0x22ec('0x3e')](_0x4863f3[_0x22ec('0x3a')],{'$or':_[_0x22ec('0x2e')](_0x5a257e,function(_0x3a1423){if(_0x3a1423[_0x22ec('0x31')]!==_0x22ec('0x3f')){var _0x55beeb={};_0x55beeb[_0x3a1423[_0x22ec('0x2b')]]={'$like':'%'+_0x41c9ab['query'][_0x22ec('0x3d')]+'%'};return _0x55beeb;}})});}_0x4863f3=_[_0x22ec('0x3e')]({},_0x4863f3,_0x41c9ab[_0x22ec('0x40')]);var _0x69ac86={'where':_0x4863f3['where']};return db[_0x22ec('0x2f')][_0x22ec('0x22')](_0x69ac86)['then'](function(_0x5692b8){_0x155d24[_0x22ec('0x22')]=_0x5692b8;if(_0x41c9ab[_0x22ec('0x32')][_0x22ec('0x41')]){_0x4863f3[_0x22ec('0x42')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x4863f3);})[_0x22ec('0x26')](function(_0x23db2c){_0x155d24[_0x22ec('0x43')]=_0x23db2c;return _0x155d24;})[_0x22ec('0x26')](respondWithFilteredResult(_0x4e549b,_0x4863f3))['catch'](handleError(_0x4e549b,null));};exports[_0x22ec('0x44')]=function(_0x259301,_0x356a77){var _0x37528f={'raw':![],'where':{'id':_0x259301[_0x22ec('0x45')]['id']}},_0x3bf462={};_0x3bf462[_0x22ec('0x34')]=_[_0x22ec('0x46')](db[_0x22ec('0x2f')]['rawAttributes']);_0x3bf462[_0x22ec('0x32')]=_[_0x22ec('0x46')](_0x259301[_0x22ec('0x32')]);_0x3bf462[_0x22ec('0x3b')]=_[_0x22ec('0x33')](_0x3bf462['model'],_0x3bf462['query']);_0x37528f[_0x22ec('0x35')]=_[_0x22ec('0x33')](_0x3bf462[_0x22ec('0x34')],qs[_0x22ec('0x36')](_0x259301['query'][_0x22ec('0x36')]));_0x37528f[_0x22ec('0x35')]=_0x37528f['attributes'][_0x22ec('0x37')]?_0x37528f['attributes']:_0x3bf462[_0x22ec('0x34')];if(_0x259301[_0x22ec('0x32')][_0x22ec('0x41')]){_0x37528f[_0x22ec('0x42')]=[{'all':!![]}];}_0x37528f=_[_0x22ec('0x3e')]({},_0x37528f,_0x259301['options']);return db[_0x22ec('0x2f')][_0x22ec('0x47')](_0x37528f)[_0x22ec('0x26')](handleEntityNotFound(_0x356a77,null))[_0x22ec('0x26')](respondWithResult(_0x356a77,null))[_0x22ec('0x48')](handleError(_0x356a77,null));};exports[_0x22ec('0x49')]=function(_0x16d742,_0x109222){return db[_0x22ec('0x2f')][_0x22ec('0x49')](_0x16d742['body'],{})[_0x22ec('0x26')](respondWithResult(_0x109222,0xc9))[_0x22ec('0x48')](handleError(_0x109222,null));};exports['update']=function(_0x2c8ae7,_0x1bc6b1){if(_0x2c8ae7[_0x22ec('0x4a')]['id']){delete _0x2c8ae7[_0x22ec('0x4a')]['id'];}return db[_0x22ec('0x2f')][_0x22ec('0x47')]({'where':{'id':_0x2c8ae7['params']['id']}})[_0x22ec('0x26')](handleEntityNotFound(_0x1bc6b1,null))[_0x22ec('0x26')](saveUpdates(_0x2c8ae7['body'],null))[_0x22ec('0x26')](respondWithResult(_0x1bc6b1,null))['catch'](handleError(_0x1bc6b1,null));};exports[_0x22ec('0x27')]=function(_0x1acea4,_0x39cd6b){return db['UserProfileSection'][_0x22ec('0x47')]({'where':{'id':_0x1acea4[_0x22ec('0x45')]['id']}})[_0x22ec('0x26')](handleEntityNotFound(_0x39cd6b,null))[_0x22ec('0x26')](removeEntity(_0x39cd6b,null))[_0x22ec('0x48')](handleError(_0x39cd6b,null));};exports['describe']=function(_0x5550ac,_0x3ba51b){return db['UserProfileSection'][_0x22ec('0x4b')]()[_0x22ec('0x26')](respondWithResult(_0x3ba51b,null))[_0x22ec('0x48')](handleError(_0x3ba51b,null));}; \ No newline at end of file +var _0x9114=['where','pick','filter','merge','options','include','findAll','catch','show','params','keys','rawAttributes','includeAll','create','body','find','describe','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','UserProfileSection','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort'];(function(_0x558e45,_0x4f5e4f){var _0x3e9075=function(_0x289725){while(--_0x289725){_0x558e45['push'](_0x558e45['shift']());}};_0x3e9075(++_0x4f5e4f);}(_0x9114,0xa7));var _0x4911=function(_0xb89c8b,_0x22812c){_0xb89c8b=_0xb89c8b-0x0;var _0x1d0c38=_0x9114[_0xb89c8b];return _0x1d0c38;};'use strict';var emlformat=require(_0x4911('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4911('0x1'));var moment=require(_0x4911('0x2'));var BPromise=require(_0x4911('0x3'));var Mustache=require(_0x4911('0x4'));var util=require(_0x4911('0x5'));var path=require('path');var sox=require(_0x4911('0x6'));var csv=require(_0x4911('0x7'));var ejs=require(_0x4911('0x8'));var fs=require('fs');var fs_extra=require(_0x4911('0x9'));var _=require(_0x4911('0xa'));var squel=require(_0x4911('0xb'));var crypto=require('crypto');var jsforce=require(_0x4911('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4911('0x7'));var querystring=require(_0x4911('0xd'));var Papa=require(_0x4911('0xe'));var Redis=require(_0x4911('0xf'));var authService=require(_0x4911('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4911('0x11'));var hardwareService=require(_0x4911('0x12'));var logger=require('../../config/logger')(_0x4911('0x13'));var utils=require(_0x4911('0x14'));var config=require(_0x4911('0x15'));var licenseUtil=require(_0x4911('0x16'));var db=require(_0x4911('0x17'))['db'];function respondWithStatusCode(_0x3e4a7b,_0x4c6007){_0x4c6007=_0x4c6007||0xcc;return function(_0x234cf8){if(_0x234cf8){return _0x3e4a7b['sendStatus'](_0x4c6007);}return _0x3e4a7b['status'](_0x4c6007)[_0x4911('0x18')]();};}function respondWithResult(_0x5d9baf,_0x53873a){_0x53873a=_0x53873a||0xc8;return function(_0x2d9727){if(_0x2d9727){return _0x5d9baf[_0x4911('0x19')](_0x53873a)[_0x4911('0x1a')](_0x2d9727);}};}function respondWithFilteredResult(_0x3ce3dc,_0x2890f9){return function(_0x11d8f6){if(_0x11d8f6){var _0x292fbc=typeof _0x2890f9[_0x4911('0x1b')]===_0x4911('0x1c')&&typeof _0x2890f9[_0x4911('0x1d')]===_0x4911('0x1c');var _0x2a7602=_0x11d8f6[_0x4911('0x1e')];var _0x13c2e0=_0x292fbc?0x0:_0x2890f9['offset'];var _0x84ac06=_0x292fbc?_0x11d8f6[_0x4911('0x1e')]:_0x2890f9[_0x4911('0x1b')]+_0x2890f9[_0x4911('0x1d')];var _0x4cb86f;if(_0x84ac06>=_0x2a7602){_0x84ac06=_0x2a7602;_0x4cb86f=0xc8;}else{_0x4cb86f=0xce;}_0x3ce3dc[_0x4911('0x19')](_0x4cb86f);return _0x3ce3dc[_0x4911('0x1f')](_0x4911('0x20'),_0x13c2e0+'-'+_0x84ac06+'/'+_0x2a7602)['json'](_0x11d8f6);}return null;};}function patchUpdates(_0x16033f){return function(_0x2f8e33){try{jsonpatch[_0x4911('0x21')](_0x2f8e33,_0x16033f,!![]);}catch(_0x110f2d){return BPromise[_0x4911('0x22')](_0x110f2d);}return _0x2f8e33[_0x4911('0x23')]();};}function saveUpdates(_0x449daf,_0x5cc9bd){return function(_0x26648c){if(_0x26648c){return _0x26648c[_0x4911('0x24')](_0x449daf)['then'](function(_0x2e8e57){return _0x2e8e57;});}return null;};}function removeEntity(_0x231899,_0x2f571c){return function(_0xcac96b){if(_0xcac96b){return _0xcac96b[_0x4911('0x25')]()[_0x4911('0x26')](function(){_0x231899['status'](0xcc)[_0x4911('0x18')]();});}};}function handleEntityNotFound(_0x5e39e6,_0x3c3d9b){return function(_0x271928){if(!_0x271928){_0x5e39e6[_0x4911('0x27')](0x194);}return _0x271928;};}function handleError(_0x421cc7,_0x43c865){_0x43c865=_0x43c865||0x1f4;return function(_0x17d947){logger[_0x4911('0x28')](_0x17d947[_0x4911('0x29')]);if(_0x17d947[_0x4911('0x2a')]){delete _0x17d947[_0x4911('0x2a')];}_0x421cc7[_0x4911('0x19')](_0x43c865)[_0x4911('0x2b')](_0x17d947);};}exports['index']=function(_0x3f3df4,_0x8d1601){var _0xbb4024={},_0x3b5881={},_0x351421={'count':0x0,'rows':[]};var _0x2c517f=_[_0x4911('0x2c')](db[_0x4911('0x2d')]['rawAttributes'],function(_0x32045e){return{'name':_0x32045e[_0x4911('0x2e')],'type':_0x32045e[_0x4911('0x2f')][_0x4911('0x30')]};});_0x3b5881[_0x4911('0x31')]=_[_0x4911('0x2c')](_0x2c517f,_0x4911('0x2a'));_0x3b5881[_0x4911('0x32')]=_['keys'](_0x3f3df4[_0x4911('0x32')]);_0x3b5881[_0x4911('0x33')]=_[_0x4911('0x34')](_0x3b5881[_0x4911('0x31')],_0x3b5881[_0x4911('0x32')]);_0xbb4024[_0x4911('0x35')]=_['intersection'](_0x3b5881[_0x4911('0x31')],qs[_0x4911('0x36')](_0x3f3df4['query'][_0x4911('0x36')]));_0xbb4024['attributes']=_0xbb4024[_0x4911('0x35')][_0x4911('0x37')]?_0xbb4024[_0x4911('0x35')]:_0x3b5881[_0x4911('0x31')];if(!_0x3f3df4[_0x4911('0x32')]['hasOwnProperty']('nolimit')){_0xbb4024[_0x4911('0x1d')]=qs[_0x4911('0x1d')](_0x3f3df4[_0x4911('0x32')][_0x4911('0x1d')]);_0xbb4024[_0x4911('0x1b')]=qs['offset'](_0x3f3df4[_0x4911('0x32')][_0x4911('0x1b')]);}_0xbb4024[_0x4911('0x38')]=qs[_0x4911('0x39')](_0x3f3df4[_0x4911('0x32')][_0x4911('0x39')]);_0xbb4024[_0x4911('0x3a')]=qs['filters'](_[_0x4911('0x3b')](_0x3f3df4['query'],_0x3b5881[_0x4911('0x33')]),_0x2c517f);if(_0x3f3df4[_0x4911('0x32')][_0x4911('0x3c')]){_0xbb4024[_0x4911('0x3a')]=_[_0x4911('0x3d')](_0xbb4024[_0x4911('0x3a')],{'$or':_[_0x4911('0x2c')](_0x2c517f,function(_0x22f2f1){if(_0x22f2f1[_0x4911('0x2f')]!=='VIRTUAL'){var _0x5e6dcf={};_0x5e6dcf[_0x22f2f1[_0x4911('0x2a')]]={'$like':'%'+_0x3f3df4[_0x4911('0x32')][_0x4911('0x3c')]+'%'};return _0x5e6dcf;}})});}_0xbb4024=_[_0x4911('0x3d')]({},_0xbb4024,_0x3f3df4[_0x4911('0x3e')]);var _0x41ad01={'where':_0xbb4024['where']};return db['UserProfileSection'][_0x4911('0x1e')](_0x41ad01)[_0x4911('0x26')](function(_0x52ddb2){_0x351421[_0x4911('0x1e')]=_0x52ddb2;if(_0x3f3df4[_0x4911('0x32')]['includeAll']){_0xbb4024[_0x4911('0x3f')]=[{'all':!![]}];}return db[_0x4911('0x2d')][_0x4911('0x40')](_0xbb4024);})[_0x4911('0x26')](function(_0x37b2df){_0x351421['rows']=_0x37b2df;return _0x351421;})[_0x4911('0x26')](respondWithFilteredResult(_0x8d1601,_0xbb4024))[_0x4911('0x41')](handleError(_0x8d1601,null));};exports[_0x4911('0x42')]=function(_0x42373e,_0x132dbd){var _0x4b8016={'raw':![],'where':{'id':_0x42373e[_0x4911('0x43')]['id']}},_0xa16757={};_0xa16757['model']=_[_0x4911('0x44')](db[_0x4911('0x2d')][_0x4911('0x45')]);_0xa16757[_0x4911('0x32')]=_[_0x4911('0x44')](_0x42373e[_0x4911('0x32')]);_0xa16757['filters']=_[_0x4911('0x34')](_0xa16757[_0x4911('0x31')],_0xa16757[_0x4911('0x32')]);_0x4b8016[_0x4911('0x35')]=_[_0x4911('0x34')](_0xa16757[_0x4911('0x31')],qs[_0x4911('0x36')](_0x42373e['query']['fields']));_0x4b8016[_0x4911('0x35')]=_0x4b8016[_0x4911('0x35')]['length']?_0x4b8016['attributes']:_0xa16757[_0x4911('0x31')];if(_0x42373e[_0x4911('0x32')][_0x4911('0x46')]){_0x4b8016[_0x4911('0x3f')]=[{'all':!![]}];}_0x4b8016=_[_0x4911('0x3d')]({},_0x4b8016,_0x42373e[_0x4911('0x3e')]);return db[_0x4911('0x2d')]['find'](_0x4b8016)['then'](handleEntityNotFound(_0x132dbd,null))[_0x4911('0x26')](respondWithResult(_0x132dbd,null))[_0x4911('0x41')](handleError(_0x132dbd,null));};exports[_0x4911('0x47')]=function(_0x563901,_0xeb7c6b){return db[_0x4911('0x2d')][_0x4911('0x47')](_0x563901[_0x4911('0x48')],{})['then'](respondWithResult(_0xeb7c6b,0xc9))['catch'](handleError(_0xeb7c6b,null));};exports[_0x4911('0x24')]=function(_0x1ee13a,_0x28e271){if(_0x1ee13a[_0x4911('0x48')]['id']){delete _0x1ee13a[_0x4911('0x48')]['id'];}return db[_0x4911('0x2d')]['find']({'where':{'id':_0x1ee13a['params']['id']}})[_0x4911('0x26')](handleEntityNotFound(_0x28e271,null))[_0x4911('0x26')](saveUpdates(_0x1ee13a['body'],null))['then'](respondWithResult(_0x28e271,null))[_0x4911('0x41')](handleError(_0x28e271,null));};exports[_0x4911('0x25')]=function(_0x459719,_0x3a5a7f){return db[_0x4911('0x2d')][_0x4911('0x49')]({'where':{'id':_0x459719['params']['id']}})[_0x4911('0x26')](handleEntityNotFound(_0x3a5a7f,null))[_0x4911('0x26')](removeEntity(_0x3a5a7f,null))[_0x4911('0x41')](handleError(_0x3a5a7f,null));};exports[_0x4911('0x4a')]=function(_0x299e4a,_0x13437c){return db['UserProfileSection'][_0x4911('0x4a')]()[_0x4911('0x26')](respondWithResult(_0x13437c,null))[_0x4911('0x41')](handleError(_0x13437c,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index a4602ca..c324103 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 _0xf5da=['sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','UserProfileSection','compositeIndex'];(function(_0x57953d,_0x2d146e){var _0x1cdf93=function(_0x57b789){while(--_0x57b789){_0x57953d['push'](_0x57953d['shift']());}};_0x1cdf93(++_0x2d146e);}(_0xf5da,0x1a6));var _0xaf5d=function(_0x4991d6,_0x348deb){_0x4991d6=_0x4991d6-0x0;var _0x50faf7=_0xf5da[_0x4991d6];return _0x50faf7;};'use strict';var _=require(_0xaf5d('0x0'));var util=require(_0xaf5d('0x1'));var logger=require(_0xaf5d('0x2'))(_0xaf5d('0x3'));var moment=require(_0xaf5d('0x4'));var BPromise=require(_0xaf5d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf5d('0x6'));var rimraf=require(_0xaf5d('0x7'));var config=require(_0xaf5d('0x8'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x4958b4,_0x4a2d4b){return _0x4958b4[_0xaf5d('0x9')](_0xaf5d('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xaf5d('0xb'),'fields':[_0xaf5d('0xc'),_0xaf5d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ed4=['sectionId','userProfileId','../../config/logger','api','moment','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex'];(function(_0x4e4e38,_0x3d9401){var _0xe2549c=function(_0x1c6e0e){while(--_0x1c6e0e){_0x4e4e38['push'](_0x4e4e38['shift']());}};_0xe2549c(++_0x3d9401);}(_0x4ed4,0x80));var _0x44ed=function(_0x3dcfb9,_0x31b829){_0x3dcfb9=_0x3dcfb9-0x0;var _0x434373=_0x4ed4[_0x3dcfb9];return _0x434373;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x44ed('0x0'))(_0x44ed('0x1'));var moment=require(_0x44ed('0x2'));var BPromise=require('bluebird');var rp=require(_0x44ed('0x3'));var fs=require('fs');var path=require(_0x44ed('0x4'));var rimraf=require(_0x44ed('0x5'));var config=require('../../config/environment');var attributes=require(_0x44ed('0x6'));module[_0x44ed('0x7')]=function(_0x3d2149,_0x233bba){return _0x3d2149[_0x44ed('0x8')](_0x44ed('0x9'),attributes,{'tableName':_0x44ed('0xa'),'paranoid':![],'indexes':[{'name':_0x44ed('0xb'),'fields':[_0x44ed('0xc'),_0x44ed('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 3069d6e..ed773d0 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 _0x3a14=['../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x4cc960,_0x5e143e){var _0xdf9bc8=function(_0x3cfa90){while(--_0x3cfa90){_0x4cc960['push'](_0x4cc960['shift']());}};_0xdf9bc8(++_0x5e143e);}(_0x3a14,0xdf));var _0x43a1=function(_0x136309,_0x1835c1){_0x136309=_0x136309-0x0;var _0x1f4d18=_0x3a14[_0x136309];return _0x1f4d18;};'use strict';var _=require(_0x43a1('0x0'));var util=require(_0x43a1('0x1'));var moment=require(_0x43a1('0x2'));var BPromise=require(_0x43a1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43a1('0x4'));var db=require(_0x43a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x43a1('0x6'))(_0x43a1('0x7'));var config=require(_0x43a1('0x8'));var jayson=require(_0x43a1('0x9'));var client=jayson[_0x43a1('0xa')][_0x43a1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5288a2,_0x4f83f8,_0x451941){return new BPromise(function(_0x3c4603,_0x2ebfe1){return client['request'](_0x5288a2,_0x451941)[_0x43a1('0xc')](function(_0x2ed9f6){logger[_0x43a1('0xd')](_0x43a1('0xe'),_0x4f83f8,_0x43a1('0xf'));logger[_0x43a1('0x10')](_0x43a1('0x11'),_0x4f83f8,'request\x20sent',JSON['stringify'](_0x2ed9f6));if(_0x2ed9f6['error']){if(_0x2ed9f6[_0x43a1('0x12')][_0x43a1('0x13')]===0x1f4){logger[_0x43a1('0x12')](_0x43a1('0xe'),_0x4f83f8,_0x2ed9f6[_0x43a1('0x12')][_0x43a1('0x14')]);return _0x2ebfe1(_0x2ed9f6['error'][_0x43a1('0x14')]);}logger[_0x43a1('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x4f83f8,_0x2ed9f6[_0x43a1('0x12')][_0x43a1('0x14')]);return _0x3c4603(_0x2ed9f6['error'][_0x43a1('0x14')]);}else{logger['info'](_0x43a1('0xe'),_0x4f83f8,_0x43a1('0xf'));_0x3c4603(_0x2ed9f6['result'][_0x43a1('0x14')]);}})['catch'](function(_0x3fd7e8){logger[_0x43a1('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x4f83f8,_0x3fd7e8);_0x2ebfe1(_0x3fd7e8);});});} \ No newline at end of file +var _0x31af=['client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x31af,0xde));var _0xf31a=function(_0x4c69d3,_0x446f68){_0x4c69d3=_0x4c69d3-0x0;var _0x2b7642=_0x31af[_0x4c69d3];return _0x2b7642;};'use strict';var _=require(_0xf31a('0x0'));var util=require(_0xf31a('0x1'));var moment=require(_0xf31a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf31a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf31a('0x4'));var logger=require(_0xf31a('0x5'))(_0xf31a('0x6'));var config=require(_0xf31a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf31a('0x8')][_0xf31a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x405926,_0x1dc7cc,_0x47b7a1){return new BPromise(function(_0x31f8e7,_0xe5778a){return client[_0xf31a('0xa')](_0x405926,_0x47b7a1)[_0xf31a('0xb')](function(_0x48cc46){logger[_0xf31a('0xc')](_0xf31a('0xd'),_0x1dc7cc,_0xf31a('0xe'));logger[_0xf31a('0xf')](_0xf31a('0x10'),_0x1dc7cc,'request\x20sent',JSON[_0xf31a('0x11')](_0x48cc46));if(_0x48cc46[_0xf31a('0x12')]){if(_0x48cc46[_0xf31a('0x12')][_0xf31a('0x13')]===0x1f4){logger['error'](_0xf31a('0xd'),_0x1dc7cc,_0x48cc46[_0xf31a('0x12')]['message']);return _0xe5778a(_0x48cc46[_0xf31a('0x12')][_0xf31a('0x14')]);}logger[_0xf31a('0x12')](_0xf31a('0xd'),_0x1dc7cc,_0x48cc46[_0xf31a('0x12')][_0xf31a('0x14')]);return _0x31f8e7(_0x48cc46[_0xf31a('0x12')][_0xf31a('0x14')]);}else{logger[_0xf31a('0xc')](_0xf31a('0xd'),_0x1dc7cc,_0xf31a('0xe'));_0x31f8e7(_0x48cc46[_0xf31a('0x15')][_0xf31a('0x14')]);}})[_0xf31a('0x16')](function(_0x1429c8){logger['error'](_0xf31a('0xd'),_0x1dc7cc,_0x1429c8);_0xe5778a(_0x1429c8);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index caf7501..c264b3c 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x42ad47,_0x2439b1){var _0x53cadd=function(_0x248655){while(--_0x248655){_0x42ad47['push'](_0x42ad47['shift']());}};_0x53cadd(++_0x2439b1);}(_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(_0x5728a2,_0x5a2e30){var _0x1fc437=function(_0x1316a7){while(--_0x1316a7){_0x5728a2['push'](_0x5728a2['shift']());}};_0x1fc437(++_0x5a2e30);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xcb91[_0x15c421];return _0x5e5ed5;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 70f1b63..ce48b9a 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 _0x5aa1=['exports','INTEGER','sequelize'];(function(_0x4504e7,_0x2ae46f){var _0x98c486=function(_0x2ad867){while(--_0x2ad867){_0x4504e7['push'](_0x4504e7['shift']());}};_0x98c486(++_0x2ae46f);}(_0x5aa1,0x158));var _0x15aa=function(_0x74763b,_0x3adad4){_0x74763b=_0x74763b-0x0;var _0x738f43=_0x5aa1[_0x74763b];return _0x738f43;};'use strict';var Sequelize=require(_0x15aa('0x0'));module[_0x15aa('0x1')]={'penalty':{'type':Sequelize[_0x15aa('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbafd=['INTEGER','sequelize','exports'];(function(_0x352ffc,_0x2f9172){var _0x43345d=function(_0x45e416){while(--_0x45e416){_0x352ffc['push'](_0x352ffc['shift']());}};_0x43345d(++_0x2f9172);}(_0xbafd,0xac));var _0xdbaf=function(_0x9d35b5,_0x5cde87){_0x9d35b5=_0x9d35b5-0x0;var _0x25fb99=_0xbafd[_0x9d35b5];return _0x25fb99;};'use strict';var Sequelize=require(_0xdbaf('0x0'));module[_0xdbaf('0x1')]={'penalty':{'type':Sequelize[_0xdbaf('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index b5b0890..2970946 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 _0x524e=['define','UserSmsQueue','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x53b50e,_0xc49361){var _0x3f8625=function(_0x4ce88b){while(--_0x4ce88b){_0x53b50e['push'](_0x53b50e['shift']());}};_0x3f8625(++_0xc49361);}(_0x524e,0x15e));var _0xe524=function(_0x15f66d,_0x3cb992){_0x15f66d=_0x15f66d-0x0;var _0x2a66cf=_0x524e[_0x15f66d];return _0x2a66cf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));module[_0xe524('0x9')]=function(_0x4f75d6,_0xaaeaa9){return _0x4f75d6[_0xe524('0xa')](_0xe524('0xb'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2fe=['../../config/environment','exports','define','UserSmsQueue','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0xee2f('0x7')]=function(_0x2b7e7c,_0x49926b){return _0x2b7e7c[_0xee2f('0x8')](_0xee2f('0x9'),attributes,{'tableName':'user_has_sms_queues','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 be6f113..8a0a903 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 _0x8591=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserSmsQueue,\x20%s,\x20%s','message','lodash','util','moment'];(function(_0x40042d,_0x3ce810){var _0x3889a1=function(_0x2fdcbb){while(--_0x2fdcbb){_0x40042d['push'](_0x40042d['shift']());}};_0x3889a1(++_0x3ce810);}(_0x8591,0x66));var _0x1859=function(_0x1f93d4,_0x1e2e0a){_0x1f93d4=_0x1f93d4-0x0;var _0xfe08cc=_0x8591[_0x1f93d4];return _0xfe08cc;};'use strict';var _=require(_0x1859('0x0'));var util=require(_0x1859('0x1'));var moment=require(_0x1859('0x2'));var BPromise=require(_0x1859('0x3'));var rs=require(_0x1859('0x4'));var fs=require('fs');var Redis=require(_0x1859('0x5'));var db=require(_0x1859('0x6'))['db'];var utils=require(_0x1859('0x7'));var logger=require(_0x1859('0x8'))(_0x1859('0x9'));var config=require(_0x1859('0xa'));var jayson=require(_0x1859('0xb'));var client=jayson[_0x1859('0xc')][_0x1859('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d5598,_0x10c31f,_0x174e7a){return new BPromise(function(_0x360824,_0x33896a){return client['request'](_0x4d5598,_0x174e7a)['then'](function(_0x2478f6){logger[_0x1859('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x10c31f,_0x1859('0xf'));logger['debug'](_0x1859('0x10'),_0x10c31f,_0x1859('0xf'),JSON[_0x1859('0x11')](_0x2478f6));if(_0x2478f6[_0x1859('0x12')]){if(_0x2478f6['error']['code']===0x1f4){logger[_0x1859('0x12')](_0x1859('0x13'),_0x10c31f,_0x2478f6['error'][_0x1859('0x14')]);return _0x33896a(_0x2478f6['error']['message']);}logger[_0x1859('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x10c31f,_0x2478f6[_0x1859('0x12')][_0x1859('0x14')]);return _0x360824(_0x2478f6[_0x1859('0x12')][_0x1859('0x14')]);}else{logger[_0x1859('0xe')](_0x1859('0x13'),_0x10c31f,_0x1859('0xf'));_0x360824(_0x2478f6['result'][_0x1859('0x14')]);}})['catch'](function(_0x48b0ae){logger[_0x1859('0x12')](_0x1859('0x13'),_0x10c31f,_0x48b0ae);_0x33896a(_0x48b0ae);});});} \ No newline at end of file +var _0x22aa=['util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x21714f,_0x44d915){var _0x36ed8f=function(_0x337171){while(--_0x337171){_0x21714f['push'](_0x21714f['shift']());}};_0x36ed8f(++_0x44d915);}(_0x22aa,0x1b4));var _0xa22a=function(_0x2bbd6b,_0x40ede7){_0x2bbd6b=_0x2bbd6b-0x0;var _0x2482a7=_0x22aa[_0x2bbd6b];return _0x2482a7;};'use strict';var _=require(_0xa22a('0x0'));var util=require(_0xa22a('0x1'));var moment=require(_0xa22a('0x2'));var BPromise=require(_0xa22a('0x3'));var rs=require(_0xa22a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa22a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa22a('0x6'));var config=require(_0xa22a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa22a('0x8')][_0xa22a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56e64d,_0x118670,_0x214f59){return new BPromise(function(_0x687a91,_0x3b5608){return client[_0xa22a('0xa')](_0x56e64d,_0x214f59)[_0xa22a('0xb')](function(_0x434b0b){logger[_0xa22a('0xc')](_0xa22a('0xd'),_0x118670,_0xa22a('0xe'));logger[_0xa22a('0xf')](_0xa22a('0x10'),_0x118670,_0xa22a('0xe'),JSON[_0xa22a('0x11')](_0x434b0b));if(_0x434b0b[_0xa22a('0x12')]){if(_0x434b0b['error'][_0xa22a('0x13')]===0x1f4){logger[_0xa22a('0x12')](_0xa22a('0xd'),_0x118670,_0x434b0b['error']['message']);return _0x3b5608(_0x434b0b[_0xa22a('0x12')][_0xa22a('0x14')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x118670,_0x434b0b[_0xa22a('0x12')]['message']);return _0x687a91(_0x434b0b[_0xa22a('0x12')][_0xa22a('0x14')]);}else{logger['info'](_0xa22a('0xd'),_0x118670,_0xa22a('0xe'));_0x687a91(_0x434b0b[_0xa22a('0x15')]['message']);}})[_0xa22a('0x16')](function(_0x55a227){logger[_0xa22a('0x12')](_0xa22a('0xd'),_0x118670,_0x55a227);_0x3b5608(_0x55a227);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 397b512..fb1e838 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 _0x49b9=['INTEGER','sequelize','exports'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0x49b9,0x154));var _0x949b=function(_0x157416,_0x94217){_0x157416=_0x157416-0x0;var _0x1052ea=_0x49b9[_0x157416];return _0x1052ea;};'use strict';var Sequelize=require(_0x949b('0x0'));module[_0x949b('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x949b('0x2')]}}; \ No newline at end of file +var _0x9330=['sequelize','exports','INTEGER'];(function(_0x3cdcde,_0x5b42c4){var _0x271b35=function(_0xb0db6){while(--_0xb0db6){_0x3cdcde['push'](_0x3cdcde['shift']());}};_0x271b35(++_0x5b42c4);}(_0x9330,0xba));var _0x0933=function(_0xa5c859,_0x4638f1){_0xa5c859=_0xa5c859-0x0;var _0x444c7f=_0x9330[_0xa5c859];return _0x444c7f;};'use strict';var Sequelize=require(_0x0933('0x0'));module[_0x0933('0x1')]={'UserId':{'type':Sequelize[_0x0933('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 6a6df0d..3ad9b91 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(_0xb43dd5,_0x2fc474){var _0x55d7dd=function(_0x14c0c3){while(--_0x14c0c3){_0xb43dd5['push'](_0xb43dd5['shift']());}};_0x55d7dd(++_0x2fc474);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x2988aa,_0x55c080){var _0x41904d=function(_0x4a3703){while(--_0x4a3703){_0x2988aa['push'](_0x2988aa['shift']());}};_0x41904d(++_0x55c080);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 7f718f8..053462e 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(_0x1dd02e,_0x65089){var _0x100a9e=function(_0x42ba71){while(--_0x42ba71){_0x1dd02e['push'](_0x1dd02e['shift']());}};_0x100a9e(++_0x65089);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0xcb91[_0x4bcf38];return _0x4a89be;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x15ab16,_0x2c34b5){var _0x14b31e=function(_0x3ace19){while(--_0x3ace19){_0x15ab16['push'](_0x15ab16['shift']());}};_0x14b31e(++_0x2c34b5);}(_0xe706,0xa3));var _0x6e70=function(_0xa06e0b,_0x6c2305){_0xa06e0b=_0xa06e0b-0x0;var _0x14142f=_0xe706[_0xa06e0b];return _0x14142f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 89d4be1..88c72a8 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 _0x0e0d=['sequelize','exports'];(function(_0x3c6dce,_0x5424dd){var _0x1450e9=function(_0xd51b5c){while(--_0xd51b5c){_0x3c6dce['push'](_0x3c6dce['shift']());}};_0x1450e9(++_0x5424dd);}(_0x0e0d,0x100));var _0xd0e0=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0e0d[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xd0e0('0x0'));module[_0xd0e0('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xeb5d=['INTEGER','exports'];(function(_0x21c23e,_0x1d33e3){var _0xa7b7e2=function(_0x6ac2a8){while(--_0x6ac2a8){_0x21c23e['push'](_0x21c23e['shift']());}};_0xa7b7e2(++_0x1d33e3);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xeb5d[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module[_0xdeb5('0x0')]={'penalty':{'type':Sequelize[_0xdeb5('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 ecd8299..a0726bb 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 _0xa0ea=['exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes'];(function(_0x26227f,_0x4c1d08){var _0x31a385=function(_0x135a8c){while(--_0x135a8c){_0x26227f['push'](_0x26227f['shift']());}};_0x31a385(++_0x4c1d08);}(_0xa0ea,0xe0));var _0xaa0e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa0ea[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xaa0e('0x0'));var util=require(_0xaa0e('0x1'));var logger=require(_0xaa0e('0x2'))(_0xaa0e('0x3'));var moment=require(_0xaa0e('0x4'));var BPromise=require(_0xaa0e('0x5'));var rp=require(_0xaa0e('0x6'));var fs=require('fs');var path=require(_0xaa0e('0x7'));var rimraf=require('rimraf');var config=require(_0xaa0e('0x8'));var attributes=require(_0xaa0e('0x9'));module[_0xaa0e('0xa')]=function(_0x3a4f6d,_0x593df3){return _0x3a4f6d['define'](_0xaa0e('0xb'),attributes,{'tableName':_0xaa0e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87a5=['../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x4505ae,_0xdd31bc){var _0x8361b9=function(_0x2a9883){while(--_0x2a9883){_0x4505ae['push'](_0x4505ae['shift']());}};_0x8361b9(++_0xdd31bc);}(_0x87a5,0x19d));var _0x587a=function(_0xd93b26,_0x12bbf2){_0xd93b26=_0xd93b26-0x0;var _0x25f668=_0x87a5[_0xd93b26];return _0x25f668;};'use strict';var _=require(_0x587a('0x0'));var util=require(_0x587a('0x1'));var logger=require('../../config/logger')(_0x587a('0x2'));var moment=require(_0x587a('0x3'));var BPromise=require(_0x587a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x587a('0x5'));var rimraf=require(_0x587a('0x6'));var config=require(_0x587a('0x7'));var attributes=require(_0x587a('0x8'));module[_0x587a('0x9')]=function(_0x1c9421,_0x12d077){return _0x1c9421['define'](_0x587a('0xa'),attributes,{'tableName':_0x587a('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 2dc5ecc..8c49c83 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 _0x09a4=['stringify','error','code','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2309f9,_0x335abb){var _0x3ea602=function(_0x17de93){while(--_0x17de93){_0x2309f9['push'](_0x2309f9['shift']());}};_0x3ea602(++_0x335abb);}(_0x09a4,0x1a9));var _0x409a=function(_0x547c64,_0x26e343){_0x547c64=_0x547c64-0x0;var _0xa948f1=_0x09a4[_0x547c64];return _0xa948f1;};'use strict';var _=require(_0x409a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x409a('0x1'));var fs=require('fs');var Redis=require(_0x409a('0x2'));var db=require(_0x409a('0x3'))['db'];var utils=require(_0x409a('0x4'));var logger=require(_0x409a('0x5'))(_0x409a('0x6'));var config=require(_0x409a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x409a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a2b1c,_0xe7f37,_0x23d24b){return new BPromise(function(_0x56232b,_0x44f0f5){return client[_0x409a('0x9')](_0x5a2b1c,_0x23d24b)[_0x409a('0xa')](function(_0x2dd71e){logger[_0x409a('0xb')](_0x409a('0xc'),_0xe7f37,'request\x20sent');logger[_0x409a('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0xe7f37,_0x409a('0xe'),JSON[_0x409a('0xf')](_0x2dd71e));if(_0x2dd71e['error']){if(_0x2dd71e[_0x409a('0x10')][_0x409a('0x11')]===0x1f4){logger[_0x409a('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0xe7f37,_0x2dd71e[_0x409a('0x10')][_0x409a('0x12')]);return _0x44f0f5(_0x2dd71e[_0x409a('0x10')]['message']);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0xe7f37,_0x2dd71e[_0x409a('0x10')]['message']);return _0x56232b(_0x2dd71e['error'][_0x409a('0x12')]);}else{logger[_0x409a('0xb')](_0x409a('0xc'),_0xe7f37,_0x409a('0xe'));_0x56232b(_0x2dd71e[_0x409a('0x13')][_0x409a('0x12')]);}})['catch'](function(_0x258cd7){logger[_0x409a('0x10')](_0x409a('0xc'),_0xe7f37,_0x258cd7);_0x44f0f5(_0x258cd7);});});} \ No newline at end of file +var _0x6250=['UserVoiceQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','then','info'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x6250,0x1b0));var _0x0625=function(_0x5786e0,_0x3b89be){_0x5786e0=_0x5786e0-0x0;var _0x25666b=_0x6250[_0x5786e0];return _0x25666b;};'use strict';var _=require('lodash');var util=require(_0x0625('0x0'));var moment=require('moment');var BPromise=require(_0x0625('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0625('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0625('0x3'));var logger=require(_0x0625('0x4'))('rpc');var config=require(_0x0625('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0625('0x6')][_0x0625('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x42bb48,_0x50c122,_0x14a80a){return new BPromise(function(_0x595d0e,_0x4a2644){return client['request'](_0x42bb48,_0x14a80a)[_0x0625('0x8')](function(_0x251638){logger[_0x0625('0x9')](_0x0625('0xa'),_0x50c122,_0x0625('0xb'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x50c122,'request\x20sent',JSON['stringify'](_0x251638));if(_0x251638[_0x0625('0xc')]){if(_0x251638[_0x0625('0xc')][_0x0625('0xd')]===0x1f4){logger[_0x0625('0xc')](_0x0625('0xa'),_0x50c122,_0x251638[_0x0625('0xc')]['message']);return _0x4a2644(_0x251638['error'][_0x0625('0xe')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x50c122,_0x251638['error'][_0x0625('0xe')]);return _0x595d0e(_0x251638[_0x0625('0xc')][_0x0625('0xe')]);}else{logger[_0x0625('0x9')](_0x0625('0xa'),_0x50c122,_0x0625('0xb'));_0x595d0e(_0x251638[_0x0625('0xf')][_0x0625('0xe')]);}})[_0x0625('0x10')](function(_0x10925d){logger['error'](_0x0625('0xa'),_0x50c122,_0x10925d);_0x4a2644(_0x10925d);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 30382e2..669532d 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(_0x305dc8,_0x2aa7cd){var _0x427688=function(_0x1e8e4f){while(--_0x1e8e4f){_0x305dc8['push'](_0x305dc8['shift']());}};_0x427688(++_0x2aa7cd);}(_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(_0x3bee55,_0x4e25c8){var _0x5649d2=function(_0x13d730){while(--_0x13d730){_0x3bee55['push'](_0x3bee55['shift']());}};_0x5649d2(++_0x4e25c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 3ea7c3f..35dde20 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 _0x5c34=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports','INTEGER'];(function(_0x4422ad,_0x2856a8){var _0xa11ce7=function(_0x5c7f15){while(--_0x5c7f15){_0x4422ad['push'](_0x4422ad['shift']());}};_0xa11ce7(++_0x2856a8);}(_0x5c34,0x129));var _0x45c3=function(_0x461440,_0x4f40ca){_0x461440=_0x461440-0x0;var _0x389298=_0x5c34[_0x461440];return _0x389298;};'use strict';var Sequelize=require(_0x45c3('0x0'));module[_0x45c3('0x1')]={'uniqueid':{'type':Sequelize[_0x45c3('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x45c3('0x3')},'membername':{'type':Sequelize[_0x45c3('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x45c3('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x45c3('0x4')],'allowNull':![],'unique':_0x45c3('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x45c3('0x2')](0xb),'defaultValue':0x0,'comment':_0x45c3('0x3')},'paused':{'type':Sequelize[_0x45c3('0x2')](0xb),'defaultValue':0x0,'comment':_0x45c3('0x3')}}; \ No newline at end of file +var _0x4605=['Required\x20by\x20Asterisk','exports','INTEGER','STRING','queue_interface'];(function(_0x133296,_0xe8ff9a){var _0x193517=function(_0x161ffd){while(--_0x161ffd){_0x133296['push'](_0x133296['shift']());}};_0x193517(++_0xe8ff9a);}(_0x4605,0xb5));var _0x5460=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0x4605[_0x5c6244];return _0x5800ce;};'use strict';var Sequelize=require('sequelize');module[_0x5460('0x0')]={'uniqueid':{'type':Sequelize[_0x5460('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x5460('0x2')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x5460('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x5460('0x2')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x5460('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x5460('0x2')],'allowNull':![],'unique':_0x5460('0x3'),'comment':_0x5460('0x4')},'penalty':{'type':Sequelize[_0x5460('0x1')](0xb),'defaultValue':0x0,'comment':_0x5460('0x4')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x5460('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 0eca85e..ea17c53 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 _0x2a3b=['UserVoiceQueueRt','setMaxListeners','update','remove','emit','hook','../../mysqldb'];(function(_0x5d3896,_0x2c2e33){var _0x139bcf=function(_0x29c7bf){while(--_0x29c7bf){_0x5d3896['push'](_0x5d3896['shift']());}};_0x139bcf(++_0x2c2e33);}(_0x2a3b,0x172));var _0xb2a3=function(_0x435e16,_0x21c780){_0x435e16=_0x435e16-0x0;var _0xb9477a=_0x2a3b[_0x435e16];return _0xb9477a;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xb2a3('0x0'))['db'][_0xb2a3('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb2a3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb2a3('0x3'),'afterDestroy':_0xb2a3('0x4')};function emitEvent(_0x1f5719){return function(_0x12d81f,_0xb54eb2,_0x270cf0){UserVoiceQueueRtEvents[_0xb2a3('0x5')](_0x1f5719+':'+_0x12d81f['id'],_0x12d81f);UserVoiceQueueRtEvents[_0xb2a3('0x5')](_0x1f5719,_0x12d81f);_0x270cf0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xb2a3('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x3805=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x76e91e,_0xd53986){var _0x417d21=function(_0x1e5333){while(--_0x1e5333){_0x76e91e['push'](_0x76e91e['shift']());}};_0x417d21(++_0xd53986);}(_0x3805,0xe6));var _0x5380=function(_0x4f3da4,_0x121375){_0x4f3da4=_0x4f3da4-0x0;var _0x1df1a1=_0x3805[_0x4f3da4];return _0x1df1a1;};'use strict';var EventEmitter=require(_0x5380('0x0'));var UserVoiceQueueRt=require(_0x5380('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5380('0x2')](0x0);var events={'afterCreate':_0x5380('0x3'),'afterUpdate':_0x5380('0x4'),'afterDestroy':_0x5380('0x5')};function emitEvent(_0x49e683){return function(_0x3c331a,_0x24484d,_0x381b7f){UserVoiceQueueRtEvents[_0x5380('0x6')](_0x49e683+':'+_0x3c331a['id'],_0x3c331a);UserVoiceQueueRtEvents[_0x5380('0x6')](_0x49e683,_0x3c331a);_0x381b7f(null);};}for(var e in events){if(events[_0x5380('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x5380('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 29a7f5d..f742a28 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 _0x726e=['../../config/environment','define','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5b1ec0,_0xeddd47){var _0x1519c7=function(_0x31d1af){while(--_0x31d1af){_0x5b1ec0['push'](_0x5b1ec0['shift']());}};_0x1519c7(++_0xeddd47);}(_0x726e,0x100));var _0xe726=function(_0x49fe12,_0x5a6532){_0x49fe12=_0x49fe12-0x0;var _0x566134=_0x726e[_0x49fe12];return _0x566134;};'use strict';var _=require(_0xe726('0x0'));var util=require(_0xe726('0x1'));var logger=require(_0xe726('0x2'))('api');var moment=require(_0xe726('0x3'));var BPromise=require(_0xe726('0x4'));var rp=require(_0xe726('0x5'));var fs=require('fs');var path=require(_0xe726('0x6'));var rimraf=require(_0xe726('0x7'));var config=require(_0xe726('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x180fd6,_0x464b75){return _0x180fd6[_0xe726('0x9')]('UserVoiceQueueRt',attributes,{'tableName':_0xe726('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0126=['lodash','util','../../config/logger','api','moment','path','rimraf','exports','define','UserVoiceQueueRt'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0x0126,0x1c2));var _0x6012=function(_0x4f7b18,_0x12eee3){_0x4f7b18=_0x4f7b18-0x0;var _0x5c3f9c=_0x0126[_0x4f7b18];return _0x5c3f9c;};'use strict';var _=require(_0x6012('0x0'));var util=require(_0x6012('0x1'));var logger=require(_0x6012('0x2'))(_0x6012('0x3'));var moment=require(_0x6012('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6012('0x5'));var rimraf=require(_0x6012('0x6'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0x6012('0x7')]=function(_0x74b7a8,_0x4f46e2){return _0x74b7a8[_0x6012('0x8')](_0x6012('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 3047077..b258820 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 _0x29fe=['http','defaults','localhost','redis','./userVoiceQueueRt.socket','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','then','GetVoiceQueueRtPauses','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_0x29fe,0x69));var _0xe29f=function(_0x368c72,_0x1dd70e){_0x368c72=_0x368c72-0x0;var _0x4c42d6=_0x29fe[_0x368c72];return _0x4c42d6;};'use strict';var _=require(_0xe29f('0x0'));var util=require(_0xe29f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe29f('0x2'));var fs=require('fs');var Redis=require(_0xe29f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe29f('0x4'));var logger=require(_0xe29f('0x5'))('rpc');var config=require(_0xe29f('0x6'));var jayson=require(_0xe29f('0x7'));var client=jayson[_0xe29f('0x8')][_0xe29f('0x9')]({'port':0x232a});config['redis']=_[_0xe29f('0xa')](config['redis'],{'host':_0xe29f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe29f('0xc')]));require(_0xe29f('0xd'))[_0xe29f('0xe')](socket);function respondWithRpcPromise(_0x38bc41,_0xff0291,_0x5c0a1f){return new BPromise(function(_0x28051a,_0x9cf76e){return client[_0xe29f('0xf')](_0x38bc41,_0x5c0a1f)['then'](function(_0x4bc4a7){logger[_0xe29f('0x10')](_0xe29f('0x11'),_0xff0291,_0xe29f('0x12'));logger[_0xe29f('0x13')](_0xe29f('0x14'),_0xff0291,'request\x20sent',JSON[_0xe29f('0x15')](_0x4bc4a7));if(_0x4bc4a7[_0xe29f('0x16')]){if(_0x4bc4a7['error'][_0xe29f('0x17')]===0x1f4){logger[_0xe29f('0x16')](_0xe29f('0x11'),_0xff0291,_0x4bc4a7[_0xe29f('0x16')][_0xe29f('0x18')]);return _0x9cf76e(_0x4bc4a7[_0xe29f('0x16')][_0xe29f('0x18')]);}logger[_0xe29f('0x16')](_0xe29f('0x11'),_0xff0291,_0x4bc4a7[_0xe29f('0x16')][_0xe29f('0x18')]);return _0x28051a(_0x4bc4a7['error'][_0xe29f('0x18')]);}else{logger[_0xe29f('0x10')](_0xe29f('0x11'),_0xff0291,'request\x20sent');_0x28051a(_0x4bc4a7[_0xe29f('0x19')][_0xe29f('0x18')]);}})[_0xe29f('0x1a')](function(_0x252f80){logger[_0xe29f('0x16')](_0xe29f('0x11'),_0xff0291,_0x252f80);_0x9cf76e(_0x252f80);});});}exports['GetVoiceQueueRtPauses']=function(_0x30257e){var _0x10a761=this;return new Promise(function(_0x5cec68,_0xa26ae3){return db[_0xe29f('0x1b')][_0xe29f('0x1c')]({'raw':_0x30257e[_0xe29f('0x1d')]?_0x30257e[_0xe29f('0x1d')][_0xe29f('0x1e')]===undefined?!![]:![]:!![],'where':_0x30257e['options']?_0x30257e[_0xe29f('0x1d')][_0xe29f('0x1f')]||null:null,'attributes':[[db[_0xe29f('0x20')]['fn'](_0xe29f('0x21'),db[_0xe29f('0x20')]['fn']('IF',db[_0xe29f('0x20')][_0xe29f('0x22')](_0xe29f('0x23')))),'outboundQueuePauses']]})[_0xe29f('0x24')](function(_0x112afc){logger['info'](_0xe29f('0x25'),_0x30257e);logger[_0xe29f('0x13')]('GetVoiceQueueRtPauses',_0x30257e,JSON[_0xe29f('0x15')](_0x112afc));_0x5cec68(_0x112afc);})[_0xe29f('0x1a')](function(_0xf79b41){logger['error'](_0xe29f('0x25'),_0xf79b41['message'],_0x30257e);_0xa26ae3(_0x10a761[_0xe29f('0x16')](0x1f4,_0xf79b41[_0xe29f('0x18')]));});});}; \ No newline at end of file +var _0xb599=['../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','info','lodash','util','moment','ioredis','../../config/utils','rpc'];(function(_0x5b04d6,_0x38f693){var _0x43ca78=function(_0xbc0a50){while(--_0xbc0a50){_0x5b04d6['push'](_0x5b04d6['shift']());}};_0x43ca78(++_0x38f693);}(_0xb599,0x1ce));var _0x9b59=function(_0x18ffb2,_0x458055){_0x18ffb2=_0x18ffb2-0x0;var _0x4a48c0=_0xb599[_0x18ffb2];return _0x4a48c0;};'use strict';var _=require(_0x9b59('0x0'));var util=require(_0x9b59('0x1'));var moment=require(_0x9b59('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b59('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b59('0x4'));var logger=require('../../config/logger')(_0x9b59('0x5'));var config=require(_0x9b59('0x6'));var jayson=require(_0x9b59('0x7'));var client=jayson[_0x9b59('0x8')]['http']({'port':0x232a});config['redis']=_[_0x9b59('0x9')](config[_0x9b59('0xa')],{'host':_0x9b59('0xb'),'port':0x18eb});var socket=require(_0x9b59('0xc'))(new Redis(config[_0x9b59('0xa')]));require(_0x9b59('0xd'))[_0x9b59('0xe')](socket);function respondWithRpcPromise(_0x3735ec,_0x3254fe,_0x206a9e){return new BPromise(function(_0x1ed6e1,_0x792c8f){return client[_0x9b59('0xf')](_0x3735ec,_0x206a9e)[_0x9b59('0x10')](function(_0x4aa953){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x3254fe,_0x9b59('0x11'));logger[_0x9b59('0x12')](_0x9b59('0x13'),_0x3254fe,'request\x20sent',JSON[_0x9b59('0x14')](_0x4aa953));if(_0x4aa953[_0x9b59('0x15')]){if(_0x4aa953[_0x9b59('0x15')][_0x9b59('0x16')]===0x1f4){logger['error'](_0x9b59('0x17'),_0x3254fe,_0x4aa953[_0x9b59('0x15')][_0x9b59('0x18')]);return _0x792c8f(_0x4aa953[_0x9b59('0x15')][_0x9b59('0x18')]);}logger[_0x9b59('0x15')](_0x9b59('0x17'),_0x3254fe,_0x4aa953['error']['message']);return _0x1ed6e1(_0x4aa953['error']['message']);}else{logger['info'](_0x9b59('0x17'),_0x3254fe,_0x9b59('0x11'));_0x1ed6e1(_0x4aa953[_0x9b59('0x19')][_0x9b59('0x18')]);}})[_0x9b59('0x1a')](function(_0x400499){logger['error'](_0x9b59('0x17'),_0x3254fe,_0x400499);_0x792c8f(_0x400499);});});}exports[_0x9b59('0x1b')]=function(_0x2413e7){var _0x1c0525=this;return new Promise(function(_0x4bf293,_0x2db1a5){return db[_0x9b59('0x1c')][_0x9b59('0x1d')]({'raw':_0x2413e7[_0x9b59('0x1e')]?_0x2413e7[_0x9b59('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2413e7[_0x9b59('0x1e')]?_0x2413e7[_0x9b59('0x1e')][_0x9b59('0x1f')]||null:null,'attributes':[[db[_0x9b59('0x20')]['fn']('COUNT',db[_0x9b59('0x20')]['fn']('IF',db[_0x9b59('0x20')][_0x9b59('0x21')](_0x9b59('0x22')))),'outboundQueuePauses']]})[_0x9b59('0x10')](function(_0x3857f8){logger[_0x9b59('0x23')](_0x9b59('0x1b'),_0x2413e7);logger['debug']('GetVoiceQueueRtPauses',_0x2413e7,JSON[_0x9b59('0x14')](_0x3857f8));_0x4bf293(_0x3857f8);})['catch'](function(_0x30da6e){logger[_0x9b59('0x15')](_0x9b59('0x1b'),_0x30da6e['message'],_0x2413e7);_0x2db1a5(_0x1c0525[_0x9b59('0x15')](0x1f4,_0x30da6e['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index f80cb3e..1e0b3db 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 _0xd206=['emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','update'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xd206,0x107));var _0x6d20=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xd206[_0x4ae6ef];return _0x3cbb4e;};'use strict';var UserVoiceQueueRtEvents=require(_0x6d20('0x0'));var events=[_0x6d20('0x1'),'remove',_0x6d20('0x2')];function createListener(_0x2a6fc3,_0xbf89ef){return function(_0x580523){_0xbf89ef[_0x6d20('0x3')](_0x2a6fc3,_0x580523);};}function removeListener(_0x28bc49,_0x243da3){return function(){UserVoiceQueueRtEvents[_0x6d20('0x4')](_0x28bc49,_0x243da3);};}exports['register']=function(_0x467e6e){for(var _0x5c5950=0x0,_0x4dc981=events[_0x6d20('0x5')];_0x5c5950<_0x4dc981;_0x5c5950++){var _0x3080fb=events[_0x5c5950];var _0x5b4154=createListener(_0x6d20('0x6')+_0x3080fb,_0x467e6e);UserVoiceQueueRtEvents['on'](_0x3080fb,_0x5b4154);}}; \ No newline at end of file +var _0x0738=['update','emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove'];(function(_0x1e2e73,_0x518a66){var _0x823079=function(_0x37b6e2){while(--_0x37b6e2){_0x1e2e73['push'](_0x1e2e73['shift']());}};_0x823079(++_0x518a66);}(_0x0738,0x6e));var _0x8073=function(_0x324fe8,_0x1ccb46){_0x324fe8=_0x324fe8-0x0;var _0x4a1cd9=_0x0738[_0x324fe8];return _0x4a1cd9;};'use strict';var UserVoiceQueueRtEvents=require(_0x8073('0x0'));var events=['save',_0x8073('0x1'),_0x8073('0x2')];function createListener(_0x46b716,_0xf6179e){return function(_0x8e2e35){_0xf6179e[_0x8073('0x3')](_0x46b716,_0x8e2e35);};}function removeListener(_0x176f52,_0x38b47d){return function(){UserVoiceQueueRtEvents[_0x8073('0x4')](_0x176f52,_0x38b47d);};}exports[_0x8073('0x5')]=function(_0x2f90b9){for(var _0x588057=0x0,_0x1aad61=events[_0x8073('0x6')];_0x588057<_0x1aad61;_0x588057++){var _0x2899ce=events[_0x588057];var _0x310f3a=createListener(_0x8073('0x7')+_0x2899ce,_0x2f90b9);UserVoiceQueueRtEvents['on'](_0x2899ce,_0x310f3a);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 452847e..f979537 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(_0x18aca6,_0x12f9b7){var _0x393027=function(_0x237ec1){while(--_0x237ec1){_0x18aca6['push'](_0x18aca6['shift']());}};_0x393027(++_0x12f9b7);}(_0x70e0,0x17b));var _0x070e=function(_0x200b2b,_0x1b0996){_0x200b2b=_0x200b2b-0x0;var _0x1340c7=_0x70e0[_0x200b2b];return _0x1340c7;};'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(_0x259a42,_0x2b4483){var _0x548d68=function(_0x47656e){while(--_0x47656e){_0x259a42['push'](_0x259a42['shift']());}};_0x548d68(++_0x2b4483);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 70bcd4b..d9406ef 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 _0x33fb=['exports','INTEGER'];(function(_0x5a8bb4,_0x10fab8){var _0x156a15=function(_0x26474b){while(--_0x26474b){_0x5a8bb4['push'](_0x5a8bb4['shift']());}};_0x156a15(++_0x10fab8);}(_0x33fb,0xaa));var _0xb33f=function(_0x16ce21,_0x280469){_0x16ce21=_0x16ce21-0x0;var _0x2ba3ea=_0x33fb[_0x16ce21];return _0x2ba3ea;};'use strict';var Sequelize=require('sequelize');module[_0xb33f('0x0')]={'penalty':{'type':Sequelize[_0xb33f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcc25=['exports'];(function(_0x144f25,_0x26a56c){var _0x4b0407=function(_0x25feca){while(--_0x25feca){_0x144f25['push'](_0x144f25['shift']());}};_0x4b0407(++_0x26a56c);}(_0xcc25,0x1e1));var _0x5cc2=function(_0x3d3ae4,_0x2cbf69){_0x3d3ae4=_0x3d3ae4-0x0;var _0x277d5e=_0xcc25[_0x3d3ae4];return _0x277d5e;};'use strict';var Sequelize=require('sequelize');module[_0x5cc2('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'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 944b0d6..57143d0 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 _0xe8e8=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x587805,_0x164a4a){var _0x493ab6=function(_0x4c703a){while(--_0x4c703a){_0x587805['push'](_0x587805['shift']());}};_0x493ab6(++_0x164a4a);}(_0xe8e8,0x1b0));var _0x8e8e=function(_0x44e681,_0x20db64){_0x44e681=_0x44e681-0x0;var _0x54b06d=_0xe8e8[_0x44e681];return _0x54b06d;};'use strict';var _=require('lodash');var util=require(_0x8e8e('0x0'));var logger=require(_0x8e8e('0x1'))(_0x8e8e('0x2'));var moment=require('moment');var BPromise=require(_0x8e8e('0x3'));var rp=require(_0x8e8e('0x4'));var fs=require('fs');var path=require(_0x8e8e('0x5'));var rimraf=require(_0x8e8e('0x6'));var config=require('../../config/environment');var attributes=require(_0x8e8e('0x7'));module[_0x8e8e('0x8')]=function(_0x50d834,_0x140738){return _0x50d834[_0x8e8e('0x9')](_0x8e8e('0xa'),attributes,{'tableName':_0x8e8e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5022=['define','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports'];(function(_0x2d5497,_0x4deab3){var _0x34d69e=function(_0x91e4){while(--_0x91e4){_0x2d5497['push'](_0x2d5497['shift']());}};_0x34d69e(++_0x4deab3);}(_0x5022,0x84));var _0x2502=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x5022[_0x1477ef];return _0x164acd;};'use strict';var _=require(_0x2502('0x0'));var util=require(_0x2502('0x1'));var logger=require(_0x2502('0x2'))(_0x2502('0x3'));var moment=require(_0x2502('0x4'));var BPromise=require(_0x2502('0x5'));var rp=require(_0x2502('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2502('0x7'));var config=require(_0x2502('0x8'));var attributes=require(_0x2502('0x9'));module[_0x2502('0xa')]=function(_0x1a1272,_0x260c0e){return _0x1a1272[_0x2502('0xb')]('UserWhatsappQueue',attributes,{'tableName':_0x2502('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index f17eabf..890177d 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 _0xe12b=['../../config/logger','jayson/promise','http','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x11238d,_0x499ac8){var _0x3686b0=function(_0x1b7cbc){while(--_0x1b7cbc){_0x11238d['push'](_0x11238d['shift']());}};_0x3686b0(++_0x499ac8);}(_0xe12b,0xc8));var _0xbe12=function(_0x34aaff,_0x5ca8a1){_0x34aaff=_0x34aaff-0x0;var _0x142c27=_0xe12b[_0x34aaff];return _0x142c27;};'use strict';var _=require(_0xbe12('0x0'));var util=require(_0xbe12('0x1'));var moment=require(_0xbe12('0x2'));var BPromise=require('bluebird');var rs=require(_0xbe12('0x3'));var fs=require('fs');var Redis=require(_0xbe12('0x4'));var db=require(_0xbe12('0x5'))['db'];var utils=require(_0xbe12('0x6'));var logger=require(_0xbe12('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbe12('0x8'));var client=jayson['client'][_0xbe12('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x318acf,_0x40f8cd,_0x1562d5){return new BPromise(function(_0xd1af73,_0x1410fd){return client[_0xbe12('0xa')](_0x318acf,_0x1562d5)[_0xbe12('0xb')](function(_0x2f6bc4){logger[_0xbe12('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x40f8cd,_0xbe12('0xd'));logger[_0xbe12('0xe')](_0xbe12('0xf'),_0x40f8cd,_0xbe12('0xd'),JSON[_0xbe12('0x10')](_0x2f6bc4));if(_0x2f6bc4['error']){if(_0x2f6bc4[_0xbe12('0x11')][_0xbe12('0x12')]===0x1f4){logger[_0xbe12('0x11')](_0xbe12('0x13'),_0x40f8cd,_0x2f6bc4[_0xbe12('0x11')][_0xbe12('0x14')]);return _0x1410fd(_0x2f6bc4[_0xbe12('0x11')][_0xbe12('0x14')]);}logger['error'](_0xbe12('0x13'),_0x40f8cd,_0x2f6bc4[_0xbe12('0x11')]['message']);return _0xd1af73(_0x2f6bc4[_0xbe12('0x11')][_0xbe12('0x14')]);}else{logger[_0xbe12('0xc')](_0xbe12('0x13'),_0x40f8cd,_0xbe12('0xd'));_0xd1af73(_0x2f6bc4[_0xbe12('0x15')][_0xbe12('0x14')]);}})[_0xbe12('0x16')](function(_0x3680eb){logger[_0xbe12('0x11')](_0xbe12('0x13'),_0x40f8cd,_0x3680eb);_0x1410fd(_0x3680eb);});});} \ No newline at end of file +var _0xbe8f=['client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xbe8f,0x80));var _0xfbe8=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xbe8f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xfbe8('0x0'));var util=require('util');var moment=require(_0xfbe8('0x1'));var BPromise=require(_0xfbe8('0x2'));var rs=require(_0xfbe8('0x3'));var fs=require('fs');var Redis=require(_0xfbe8('0x4'));var db=require(_0xfbe8('0x5'))['db'];var utils=require(_0xfbe8('0x6'));var logger=require(_0xfbe8('0x7'))(_0xfbe8('0x8'));var config=require(_0xfbe8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfbe8('0xa')][_0xfbe8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ac0d9,_0x5a7e2c,_0x4e872c){return new BPromise(function(_0x43eaef,_0x4e2621){return client[_0xfbe8('0xc')](_0x2ac0d9,_0x4e872c)['then'](function(_0xcddfc){logger[_0xfbe8('0xd')](_0xfbe8('0xe'),_0x5a7e2c,_0xfbe8('0xf'));logger[_0xfbe8('0x10')](_0xfbe8('0x11'),_0x5a7e2c,_0xfbe8('0xf'),JSON['stringify'](_0xcddfc));if(_0xcddfc[_0xfbe8('0x12')]){if(_0xcddfc[_0xfbe8('0x12')][_0xfbe8('0x13')]===0x1f4){logger[_0xfbe8('0x12')](_0xfbe8('0xe'),_0x5a7e2c,_0xcddfc['error'][_0xfbe8('0x14')]);return _0x4e2621(_0xcddfc[_0xfbe8('0x12')][_0xfbe8('0x14')]);}logger[_0xfbe8('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5a7e2c,_0xcddfc[_0xfbe8('0x12')][_0xfbe8('0x14')]);return _0x43eaef(_0xcddfc[_0xfbe8('0x12')][_0xfbe8('0x14')]);}else{logger['info'](_0xfbe8('0xe'),_0x5a7e2c,_0xfbe8('0xf'));_0x43eaef(_0xcddfc[_0xfbe8('0x15')][_0xfbe8('0x14')]);}})[_0xfbe8('0x16')](function(_0x12351d){logger[_0xfbe8('0x12')](_0xfbe8('0xe'),_0x5a7e2c,_0x12351d);_0x4e2621(_0x12351d);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index ef131aa..838c74e 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 _0xea03=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','./variable.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x42490d,_0x1d07be){var _0x48d18c=function(_0x4ac0b9){while(--_0x4ac0b9){_0x42490d['push'](_0x42490d['shift']());}};_0x48d18c(++_0x1d07be);}(_0xea03,0x1ba));var _0x3ea0=function(_0x5ad60a,_0x5262c5){_0x5ad60a=_0x5ad60a-0x0;var _0x266de2=_0xea03[_0x5ad60a];return _0x266de2;};'use strict';var multer=require(_0x3ea0('0x0'));var util=require('util');var path=require(_0x3ea0('0x1'));var timeout=require(_0x3ea0('0x2'));var express=require(_0x3ea0('0x3'));var router=express[_0x3ea0('0x4')]();var fs_extra=require(_0x3ea0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3ea0('0x6'));router[_0x3ea0('0x7')]('/',auth[_0x3ea0('0x8')](),controller[_0x3ea0('0x9')]);router[_0x3ea0('0x7')]('/:id',auth[_0x3ea0('0x8')](),controller[_0x3ea0('0xa')]);router[_0x3ea0('0xb')]('/',auth[_0x3ea0('0x8')](),controller[_0x3ea0('0xc')]);router[_0x3ea0('0xd')](_0x3ea0('0xe'),auth['isAuthenticated'](),controller[_0x3ea0('0xf')]);router[_0x3ea0('0x10')](_0x3ea0('0xe'),auth['isAuthenticated'](),controller[_0x3ea0('0x11')]);module[_0x3ea0('0x12')]=router; \ No newline at end of file +var _0x455d=['exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy'];(function(_0x23713a,_0x3fc1e1){var _0x566a38=function(_0x5b707e){while(--_0x5b707e){_0x23713a['push'](_0x23713a['shift']());}};_0x566a38(++_0x3fc1e1);}(_0x455d,0x190));var _0xd455=function(_0x35ea9a,_0x1bd48f){_0x35ea9a=_0x35ea9a-0x0;var _0x3b36d2=_0x455d[_0x35ea9a];return _0x3b36d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd455('0x0'));var timeout=require(_0xd455('0x1'));var express=require(_0xd455('0x2'));var router=express['Router']();var fs_extra=require(_0xd455('0x3'));var auth=require(_0xd455('0x4'));var interaction=require(_0xd455('0x5'));var config=require(_0xd455('0x6'));var controller=require(_0xd455('0x7'));router[_0xd455('0x8')]('/',auth[_0xd455('0x9')](),controller[_0xd455('0xa')]);router[_0xd455('0x8')]('/:id',auth[_0xd455('0x9')](),controller[_0xd455('0xb')]);router['post']('/',auth[_0xd455('0x9')](),controller[_0xd455('0xc')]);router[_0xd455('0xd')](_0xd455('0xe'),auth['isAuthenticated'](),controller[_0xd455('0xf')]);router[_0xd455('0x10')]('/:id',auth[_0xd455('0x9')](),controller[_0xd455('0x11')]);module[_0xd455('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 eae2774..e070ed6 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 _0x65a0=['STRING','sequelize','exports','name'];(function(_0x2ccc71,_0x1c458a){var _0x20fa15=function(_0x320e61){while(--_0x320e61){_0x2ccc71['push'](_0x2ccc71['shift']());}};_0x20fa15(++_0x1c458a);}(_0x65a0,0x89));var _0x065a=function(_0x1dbdf3,_0x164544){_0x1dbdf3=_0x1dbdf3-0x0;var _0x1191b5=_0x65a0[_0x1dbdf3];return _0x1191b5;};'use strict';var Sequelize=require(_0x065a('0x0'));module[_0x065a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x065a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x065a('0x3')]}}; \ No newline at end of file +var _0xc2b2=['exports','STRING','name','sequelize'];(function(_0x53b594,_0x559767){var _0x1e616f=function(_0x333eda){while(--_0x333eda){_0x53b594['push'](_0x53b594['shift']());}};_0x1e616f(++_0x559767);}(_0xc2b2,0xd3));var _0x2c2b=function(_0x2398f9,_0x2132b4){_0x2398f9=_0x2398f9-0x0;var _0x12adf5=_0xc2b2[_0x2398f9];return _0x12adf5;};'use strict';var Sequelize=require(_0x2c2b('0x0'));module[_0x2c2b('0x1')]={'name':{'type':Sequelize[_0x2c2b('0x2')],'unique':_0x2c2b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2c2b('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 99a3785..fbc7faf 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 _0xdba1=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','Variable','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x483578,_0xfb8c1c){var _0x287922=function(_0x43a8b0){while(--_0x43a8b0){_0x483578['push'](_0x483578['shift']());}};_0x287922(++_0xfb8c1c);}(_0xdba1,0x1e3));var _0x1dba=function(_0x5840cd,_0xa2a210){_0x5840cd=_0x5840cd-0x0;var _0x532203=_0xdba1[_0x5840cd];return _0x532203;};'use strict';var emlformat=require(_0x1dba('0x0'));var rimraf=require(_0x1dba('0x1'));var zipdir=require(_0x1dba('0x2'));var jsonpatch=require(_0x1dba('0x3'));var rp=require(_0x1dba('0x4'));var moment=require(_0x1dba('0x5'));var BPromise=require(_0x1dba('0x6'));var Mustache=require(_0x1dba('0x7'));var util=require(_0x1dba('0x8'));var path=require(_0x1dba('0x9'));var sox=require('sox');var csv=require(_0x1dba('0xa'));var ejs=require(_0x1dba('0xb'));var fs=require('fs');var fs_extra=require(_0x1dba('0xc'));var _=require(_0x1dba('0xd'));var squel=require('squel');var crypto=require(_0x1dba('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1dba('0xf'));var toCsv=require(_0x1dba('0xa'));var querystring=require(_0x1dba('0x10'));var Papa=require(_0x1dba('0x11'));var Redis=require('ioredis');var authService=require(_0x1dba('0x12'));var qs=require(_0x1dba('0x13'));var as=require(_0x1dba('0x14'));var hardwareService=require(_0x1dba('0x15'));var logger=require(_0x1dba('0x16'))(_0x1dba('0x17'));var utils=require(_0x1dba('0x18'));var config=require(_0x1dba('0x19'));var licenseUtil=require(_0x1dba('0x1a'));var db=require(_0x1dba('0x1b'))['db'];function respondWithStatusCode(_0x527747,_0x1e9196){_0x1e9196=_0x1e9196||0xcc;return function(_0x33039a){if(_0x33039a){return _0x527747[_0x1dba('0x1c')](_0x1e9196);}return _0x527747['status'](_0x1e9196)[_0x1dba('0x1d')]();};}function respondWithResult(_0x26e454,_0x156704){_0x156704=_0x156704||0xc8;return function(_0x52c9e7){if(_0x52c9e7){return _0x26e454[_0x1dba('0x1e')](_0x156704)[_0x1dba('0x1f')](_0x52c9e7);}};}function respondWithFilteredResult(_0x4ccbe9,_0x1f8053){return function(_0x5cb4c1){if(_0x5cb4c1){var _0x4798b7=typeof _0x1f8053[_0x1dba('0x20')]===_0x1dba('0x21')&&typeof _0x1f8053[_0x1dba('0x22')]===_0x1dba('0x21');var _0x9c7822=_0x5cb4c1[_0x1dba('0x23')];var _0x37baba=_0x4798b7?0x0:_0x1f8053[_0x1dba('0x20')];var _0xf37f20=_0x4798b7?_0x5cb4c1[_0x1dba('0x23')]:_0x1f8053[_0x1dba('0x20')]+_0x1f8053[_0x1dba('0x22')];var _0xb05b44;if(_0xf37f20>=_0x9c7822){_0xf37f20=_0x9c7822;_0xb05b44=0xc8;}else{_0xb05b44=0xce;}_0x4ccbe9['status'](_0xb05b44);return _0x4ccbe9[_0x1dba('0x24')](_0x1dba('0x25'),_0x37baba+'-'+_0xf37f20+'/'+_0x9c7822)[_0x1dba('0x1f')](_0x5cb4c1);}return null;};}function patchUpdates(_0x4d94fd){return function(_0x45645f){try{jsonpatch[_0x1dba('0x26')](_0x45645f,_0x4d94fd,!![]);}catch(_0x1e2ce1){return BPromise['reject'](_0x1e2ce1);}return _0x45645f[_0x1dba('0x27')]();};}function saveUpdates(_0x10b572,_0x753c44){return function(_0x2856ac){if(_0x2856ac){return _0x2856ac[_0x1dba('0x28')](_0x10b572)[_0x1dba('0x29')](function(_0x372a87){return _0x372a87;});}return null;};}function removeEntity(_0x2f1e54,_0x5c052f){return function(_0x2638eb){if(_0x2638eb){return _0x2638eb[_0x1dba('0x2a')]()[_0x1dba('0x29')](function(){var _0x5461c1=_0x2638eb[_0x1dba('0x2b')]({'plain':!![]});var _0x498979='Variables';return db[_0x1dba('0x2c')][_0x1dba('0x2a')]({'where':{'type':_0x498979,'resourceId':_0x5461c1['id']}})['then'](function(){return _0x2638eb;});})[_0x1dba('0x29')](function(){_0x2f1e54[_0x1dba('0x1e')](0xcc)[_0x1dba('0x1d')]();});}};}function handleEntityNotFound(_0x512f02,_0xf6cb6b){return function(_0x3ad963){if(!_0x3ad963){_0x512f02[_0x1dba('0x1c')](0x194);}return _0x3ad963;};}function handleError(_0x1dfd97,_0x598225){_0x598225=_0x598225||0x1f4;return function(_0x202b83){logger[_0x1dba('0x2d')](_0x202b83[_0x1dba('0x2e')]);if(_0x202b83[_0x1dba('0x2f')]){delete _0x202b83[_0x1dba('0x2f')];}_0x1dfd97[_0x1dba('0x1e')](_0x598225)['send'](_0x202b83);};}exports[_0x1dba('0x30')]=function(_0x1d5efb,_0x2d049d){var _0x1ea3b1={},_0x3da578={},_0x1fecc7={'count':0x0,'rows':[]};var _0x106815=_[_0x1dba('0x31')](db[_0x1dba('0x32')][_0x1dba('0x33')],function(_0x2feebc){return{'name':_0x2feebc[_0x1dba('0x34')],'type':_0x2feebc[_0x1dba('0x35')]['key']};});_0x3da578[_0x1dba('0x36')]=_['map'](_0x106815,_0x1dba('0x2f'));_0x3da578[_0x1dba('0x37')]=_[_0x1dba('0x38')](_0x1d5efb['query']);_0x3da578[_0x1dba('0x39')]=_[_0x1dba('0x3a')](_0x3da578[_0x1dba('0x36')],_0x3da578[_0x1dba('0x37')]);_0x1ea3b1[_0x1dba('0x3b')]=_[_0x1dba('0x3a')](_0x3da578[_0x1dba('0x36')],qs[_0x1dba('0x3c')](_0x1d5efb[_0x1dba('0x37')][_0x1dba('0x3c')]));_0x1ea3b1[_0x1dba('0x3b')]=_0x1ea3b1[_0x1dba('0x3b')][_0x1dba('0x3d')]?_0x1ea3b1[_0x1dba('0x3b')]:_0x3da578[_0x1dba('0x36')];if(!_0x1d5efb['query'][_0x1dba('0x3e')]('nolimit')){_0x1ea3b1[_0x1dba('0x22')]=qs[_0x1dba('0x22')](_0x1d5efb['query'][_0x1dba('0x22')]);_0x1ea3b1[_0x1dba('0x20')]=qs[_0x1dba('0x20')](_0x1d5efb[_0x1dba('0x37')][_0x1dba('0x20')]);}_0x1ea3b1[_0x1dba('0x3f')]=qs[_0x1dba('0x40')](_0x1d5efb[_0x1dba('0x37')]['sort']);_0x1ea3b1[_0x1dba('0x41')]=qs[_0x1dba('0x39')](_['pick'](_0x1d5efb['query'],_0x3da578['filters']),_0x106815);if(_0x1d5efb[_0x1dba('0x37')][_0x1dba('0x42')]){_0x1ea3b1[_0x1dba('0x41')]=_[_0x1dba('0x43')](_0x1ea3b1[_0x1dba('0x41')],{'$or':_[_0x1dba('0x31')](_0x106815,function(_0x40ff31){if(_0x40ff31['type']!=='VIRTUAL'){var _0x4059ca={};_0x4059ca[_0x40ff31[_0x1dba('0x2f')]]={'$like':'%'+_0x1d5efb[_0x1dba('0x37')][_0x1dba('0x42')]+'%'};return _0x4059ca;}})});}_0x1ea3b1=_[_0x1dba('0x43')]({},_0x1ea3b1,_0x1d5efb[_0x1dba('0x44')]);var _0x350020={'where':_0x1ea3b1['where']};return db['Variable']['count'](_0x350020)[_0x1dba('0x29')](function(_0x497002){_0x1fecc7[_0x1dba('0x23')]=_0x497002;if(_0x1d5efb[_0x1dba('0x37')][_0x1dba('0x45')]){_0x1ea3b1[_0x1dba('0x46')]=[{'all':!![]}];}return db[_0x1dba('0x32')][_0x1dba('0x47')](_0x1ea3b1);})[_0x1dba('0x29')](function(_0xf483f3){_0x1fecc7['rows']=_0xf483f3;return _0x1fecc7;})[_0x1dba('0x29')](respondWithFilteredResult(_0x2d049d,_0x1ea3b1))[_0x1dba('0x48')](handleError(_0x2d049d,null));};exports['show']=function(_0x4158d2,_0x4d9bbd){var _0x278b15={'raw':!![],'where':{'id':_0x4158d2['params']['id']}},_0x31b2f8={};_0x31b2f8[_0x1dba('0x36')]=_[_0x1dba('0x38')](db[_0x1dba('0x32')][_0x1dba('0x33')]);_0x31b2f8[_0x1dba('0x37')]=_['keys'](_0x4158d2['query']);_0x31b2f8[_0x1dba('0x39')]=_[_0x1dba('0x3a')](_0x31b2f8[_0x1dba('0x36')],_0x31b2f8[_0x1dba('0x37')]);_0x278b15['attributes']=_[_0x1dba('0x3a')](_0x31b2f8[_0x1dba('0x36')],qs[_0x1dba('0x3c')](_0x4158d2[_0x1dba('0x37')][_0x1dba('0x3c')]));_0x278b15['attributes']=_0x278b15['attributes'][_0x1dba('0x3d')]?_0x278b15[_0x1dba('0x3b')]:_0x31b2f8[_0x1dba('0x36')];if(_0x4158d2[_0x1dba('0x37')][_0x1dba('0x45')]){_0x278b15[_0x1dba('0x46')]=[{'all':!![]}];}_0x278b15=_[_0x1dba('0x43')]({},_0x278b15,_0x4158d2[_0x1dba('0x44')]);return db['Variable'][_0x1dba('0x49')](_0x278b15)['then'](handleEntityNotFound(_0x4d9bbd,null))[_0x1dba('0x29')](respondWithResult(_0x4d9bbd,null))[_0x1dba('0x48')](handleError(_0x4d9bbd,null));};exports[_0x1dba('0x4a')]=function(_0x4b3ff6,_0x221958){return db['Variable']['create'](_0x4b3ff6['body'],{})[_0x1dba('0x29')](function(_0x3a8695){var _0xc95434=_0x4b3ff6[_0x1dba('0x4b')]['get']({'plain':!![]});if(!_0xc95434)throw new Error(_0x1dba('0x4c'));if(_0xc95434[_0x1dba('0x4d')]===_0x1dba('0x4b')){var _0x237eb6=_0x3a8695[_0x1dba('0x2b')]({'plain':!![]});var _0xfc2e61=_0x1dba('0x4e');return db['UserProfileSection'][_0x1dba('0x49')]({'where':{'name':_0xfc2e61,'userProfileId':_0xc95434[_0x1dba('0x4f')]},'raw':!![]})[_0x1dba('0x29')](function(_0x59613a){if(_0x59613a&&_0x59613a[_0x1dba('0x50')]===0x0){return db['UserProfileResource'][_0x1dba('0x4a')]({'name':_0x237eb6['name'],'resourceId':_0x237eb6['id'],'type':_0x59613a[_0x1dba('0x2f')],'sectionId':_0x59613a['id']},{})['then'](function(){return _0x3a8695;});}else{return _0x3a8695;}})[_0x1dba('0x48')](function(_0x47c828){logger[_0x1dba('0x2d')](_0x1dba('0x51'),_0x47c828);throw _0x47c828;});}return _0x3a8695;})[_0x1dba('0x29')](respondWithResult(_0x221958,0xc9))[_0x1dba('0x48')](handleError(_0x221958,null));};exports['update']=function(_0x44243,_0x5cec92){if(_0x44243[_0x1dba('0x52')]['id']){delete _0x44243[_0x1dba('0x52')]['id'];}return db[_0x1dba('0x32')][_0x1dba('0x49')]({'where':{'id':_0x44243['params']['id']}})[_0x1dba('0x29')](handleEntityNotFound(_0x5cec92,null))[_0x1dba('0x29')](saveUpdates(_0x44243['body'],null))[_0x1dba('0x29')](respondWithResult(_0x5cec92,null))[_0x1dba('0x48')](handleError(_0x5cec92,null));};exports[_0x1dba('0x2a')]=function(_0x7b19af,_0xbdd6a2){return db[_0x1dba('0x32')]['find']({'where':{'id':_0x7b19af[_0x1dba('0x53')]['id']}})['then'](handleEntityNotFound(_0xbdd6a2,null))[_0x1dba('0x29')](removeEntity(_0xbdd6a2,null))[_0x1dba('0x48')](handleError(_0xbdd6a2,null));}; \ No newline at end of file +var _0x6fe1=['reject','save','then','destroy','get','Variables','UserProfileResource','end','error','stack','send','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Variable','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6fe1,0x17c));var _0x16fe=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x6fe1[_0x4d613c];return _0x301fe3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16fe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x16fe('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x16fe('0x2'));var util=require(_0x16fe('0x3'));var path=require(_0x16fe('0x4'));var sox=require('sox');var csv=require(_0x16fe('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x16fe('0x6'));var _=require(_0x16fe('0x7'));var squel=require(_0x16fe('0x8'));var crypto=require(_0x16fe('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x16fe('0x5'));var querystring=require(_0x16fe('0xa'));var Papa=require(_0x16fe('0xb'));var Redis=require(_0x16fe('0xc'));var authService=require(_0x16fe('0xd'));var qs=require(_0x16fe('0xe'));var as=require(_0x16fe('0xf'));var hardwareService=require(_0x16fe('0x10'));var logger=require(_0x16fe('0x11'))('api');var utils=require(_0x16fe('0x12'));var config=require(_0x16fe('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45efda,_0x4a4c9c){_0x4a4c9c=_0x4a4c9c||0xcc;return function(_0x1dc7fe){if(_0x1dc7fe){return _0x45efda[_0x16fe('0x14')](_0x4a4c9c);}return _0x45efda[_0x16fe('0x15')](_0x4a4c9c)['end']();};}function respondWithResult(_0xb8eb2,_0x8bc4b7){_0x8bc4b7=_0x8bc4b7||0xc8;return function(_0x3744de){if(_0x3744de){return _0xb8eb2['status'](_0x8bc4b7)[_0x16fe('0x16')](_0x3744de);}};}function respondWithFilteredResult(_0x4397b8,_0x449a48){return function(_0x57f8fb){if(_0x57f8fb){var _0x29fb3b=typeof _0x449a48[_0x16fe('0x17')]==='undefined'&&typeof _0x449a48[_0x16fe('0x18')]===_0x16fe('0x19');var _0x3f2588=_0x57f8fb[_0x16fe('0x1a')];var _0x3ddcd2=_0x29fb3b?0x0:_0x449a48[_0x16fe('0x17')];var _0xcb5d5b=_0x29fb3b?_0x57f8fb[_0x16fe('0x1a')]:_0x449a48[_0x16fe('0x17')]+_0x449a48['limit'];var _0x3e0af4;if(_0xcb5d5b>=_0x3f2588){_0xcb5d5b=_0x3f2588;_0x3e0af4=0xc8;}else{_0x3e0af4=0xce;}_0x4397b8[_0x16fe('0x15')](_0x3e0af4);return _0x4397b8[_0x16fe('0x1b')](_0x16fe('0x1c'),_0x3ddcd2+'-'+_0xcb5d5b+'/'+_0x3f2588)[_0x16fe('0x16')](_0x57f8fb);}return null;};}function patchUpdates(_0x9831f6){return function(_0x5c922e){try{jsonpatch[_0x16fe('0x1d')](_0x5c922e,_0x9831f6,!![]);}catch(_0x153fbe){return BPromise[_0x16fe('0x1e')](_0x153fbe);}return _0x5c922e[_0x16fe('0x1f')]();};}function saveUpdates(_0x7bc1df,_0x1822e7){return function(_0xe27b1){if(_0xe27b1){return _0xe27b1['update'](_0x7bc1df)[_0x16fe('0x20')](function(_0x4bad2a){return _0x4bad2a;});}return null;};}function removeEntity(_0x49ed6c,_0x482b92){return function(_0x37b5a1){if(_0x37b5a1){return _0x37b5a1[_0x16fe('0x21')]()[_0x16fe('0x20')](function(){var _0x44aad9=_0x37b5a1[_0x16fe('0x22')]({'plain':!![]});var _0x5561a6=_0x16fe('0x23');return db[_0x16fe('0x24')][_0x16fe('0x21')]({'where':{'type':_0x5561a6,'resourceId':_0x44aad9['id']}})[_0x16fe('0x20')](function(){return _0x37b5a1;});})[_0x16fe('0x20')](function(){_0x49ed6c['status'](0xcc)[_0x16fe('0x25')]();});}};}function handleEntityNotFound(_0x146227,_0x1679ac){return function(_0x3ff061){if(!_0x3ff061){_0x146227['sendStatus'](0x194);}return _0x3ff061;};}function handleError(_0x487c9b,_0x189992){_0x189992=_0x189992||0x1f4;return function(_0x14a018){logger[_0x16fe('0x26')](_0x14a018[_0x16fe('0x27')]);if(_0x14a018['name']){delete _0x14a018['name'];}_0x487c9b['status'](_0x189992)[_0x16fe('0x28')](_0x14a018);};}exports[_0x16fe('0x29')]=function(_0x42b009,_0xa9b483){var _0x5bbcdc={},_0x5ceb94={},_0x35088b={'count':0x0,'rows':[]};var _0x2b25f1=_[_0x16fe('0x2a')](db['Variable'][_0x16fe('0x2b')],function(_0xa7d2a4){return{'name':_0xa7d2a4[_0x16fe('0x2c')],'type':_0xa7d2a4[_0x16fe('0x2d')]['key']};});_0x5ceb94[_0x16fe('0x2e')]=_['map'](_0x2b25f1,_0x16fe('0x2f'));_0x5ceb94[_0x16fe('0x30')]=_[_0x16fe('0x31')](_0x42b009[_0x16fe('0x30')]);_0x5ceb94[_0x16fe('0x32')]=_['intersection'](_0x5ceb94['model'],_0x5ceb94['query']);_0x5bbcdc['attributes']=_[_0x16fe('0x33')](_0x5ceb94[_0x16fe('0x2e')],qs[_0x16fe('0x34')](_0x42b009[_0x16fe('0x30')][_0x16fe('0x34')]));_0x5bbcdc[_0x16fe('0x35')]=_0x5bbcdc['attributes'][_0x16fe('0x36')]?_0x5bbcdc[_0x16fe('0x35')]:_0x5ceb94['model'];if(!_0x42b009['query'][_0x16fe('0x37')](_0x16fe('0x38'))){_0x5bbcdc[_0x16fe('0x18')]=qs[_0x16fe('0x18')](_0x42b009[_0x16fe('0x30')][_0x16fe('0x18')]);_0x5bbcdc['offset']=qs[_0x16fe('0x17')](_0x42b009[_0x16fe('0x30')][_0x16fe('0x17')]);}_0x5bbcdc[_0x16fe('0x39')]=qs[_0x16fe('0x3a')](_0x42b009['query'][_0x16fe('0x3a')]);_0x5bbcdc[_0x16fe('0x3b')]=qs[_0x16fe('0x32')](_[_0x16fe('0x3c')](_0x42b009['query'],_0x5ceb94['filters']),_0x2b25f1);if(_0x42b009[_0x16fe('0x30')][_0x16fe('0x3d')]){_0x5bbcdc['where']=_[_0x16fe('0x3e')](_0x5bbcdc[_0x16fe('0x3b')],{'$or':_[_0x16fe('0x2a')](_0x2b25f1,function(_0x4a9bad){if(_0x4a9bad[_0x16fe('0x2d')]!==_0x16fe('0x3f')){var _0x186ea1={};_0x186ea1[_0x4a9bad[_0x16fe('0x2f')]]={'$like':'%'+_0x42b009['query'][_0x16fe('0x3d')]+'%'};return _0x186ea1;}})});}_0x5bbcdc=_['merge']({},_0x5bbcdc,_0x42b009[_0x16fe('0x40')]);var _0x4d8349={'where':_0x5bbcdc['where']};return db['Variable'][_0x16fe('0x1a')](_0x4d8349)[_0x16fe('0x20')](function(_0x5133ba){_0x35088b[_0x16fe('0x1a')]=_0x5133ba;if(_0x42b009['query'][_0x16fe('0x41')]){_0x5bbcdc[_0x16fe('0x42')]=[{'all':!![]}];}return db[_0x16fe('0x43')][_0x16fe('0x44')](_0x5bbcdc);})[_0x16fe('0x20')](function(_0x2a51d6){_0x35088b[_0x16fe('0x45')]=_0x2a51d6;return _0x35088b;})['then'](respondWithFilteredResult(_0xa9b483,_0x5bbcdc))[_0x16fe('0x46')](handleError(_0xa9b483,null));};exports[_0x16fe('0x47')]=function(_0x54f077,_0xced8f1){var _0x2c76d0={'raw':!![],'where':{'id':_0x54f077[_0x16fe('0x48')]['id']}},_0x350e3f={};_0x350e3f['model']=_['keys'](db[_0x16fe('0x43')]['rawAttributes']);_0x350e3f[_0x16fe('0x30')]=_['keys'](_0x54f077[_0x16fe('0x30')]);_0x350e3f['filters']=_['intersection'](_0x350e3f[_0x16fe('0x2e')],_0x350e3f['query']);_0x2c76d0[_0x16fe('0x35')]=_[_0x16fe('0x33')](_0x350e3f[_0x16fe('0x2e')],qs[_0x16fe('0x34')](_0x54f077[_0x16fe('0x30')][_0x16fe('0x34')]));_0x2c76d0[_0x16fe('0x35')]=_0x2c76d0['attributes'][_0x16fe('0x36')]?_0x2c76d0[_0x16fe('0x35')]:_0x350e3f[_0x16fe('0x2e')];if(_0x54f077[_0x16fe('0x30')][_0x16fe('0x41')]){_0x2c76d0['include']=[{'all':!![]}];}_0x2c76d0=_['merge']({},_0x2c76d0,_0x54f077[_0x16fe('0x40')]);return db[_0x16fe('0x43')]['find'](_0x2c76d0)['then'](handleEntityNotFound(_0xced8f1,null))[_0x16fe('0x20')](respondWithResult(_0xced8f1,null))[_0x16fe('0x46')](handleError(_0xced8f1,null));};exports[_0x16fe('0x49')]=function(_0x5630d2,_0x4886f3){return db[_0x16fe('0x43')][_0x16fe('0x49')](_0x5630d2[_0x16fe('0x4a')],{})['then'](function(_0x1ef077){var _0x364203=_0x5630d2[_0x16fe('0x4b')][_0x16fe('0x22')]({'plain':!![]});if(!_0x364203)throw new Error(_0x16fe('0x4c'));if(_0x364203[_0x16fe('0x4d')]==='user'){var _0x5004d7=_0x1ef077[_0x16fe('0x22')]({'plain':!![]});var _0x456cd2=_0x16fe('0x23');return db[_0x16fe('0x4e')][_0x16fe('0x4f')]({'where':{'name':_0x456cd2,'userProfileId':_0x364203['userProfileId']},'raw':!![]})[_0x16fe('0x20')](function(_0x49d637){if(_0x49d637&&_0x49d637['autoAssociation']===0x0){return db[_0x16fe('0x24')][_0x16fe('0x49')]({'name':_0x5004d7['name'],'resourceId':_0x5004d7['id'],'type':_0x49d637[_0x16fe('0x2f')],'sectionId':_0x49d637['id']},{})['then'](function(){return _0x1ef077;});}else{return _0x1ef077;}})[_0x16fe('0x46')](function(_0x3f21cc){logger['error'](_0x16fe('0x50'),_0x3f21cc);throw _0x3f21cc;});}return _0x1ef077;})[_0x16fe('0x20')](respondWithResult(_0x4886f3,0xc9))[_0x16fe('0x46')](handleError(_0x4886f3,null));};exports[_0x16fe('0x51')]=function(_0x10323b,_0xd7ab60){if(_0x10323b[_0x16fe('0x4a')]['id']){delete _0x10323b[_0x16fe('0x4a')]['id'];}return db['Variable'][_0x16fe('0x4f')]({'where':{'id':_0x10323b[_0x16fe('0x48')]['id']}})[_0x16fe('0x20')](handleEntityNotFound(_0xd7ab60,null))[_0x16fe('0x20')](saveUpdates(_0x10323b[_0x16fe('0x4a')],null))[_0x16fe('0x20')](respondWithResult(_0xd7ab60,null))['catch'](handleError(_0xd7ab60,null));};exports[_0x16fe('0x21')]=function(_0x24aef7,_0x40171e){return db['Variable'][_0x16fe('0x4f')]({'where':{'id':_0x24aef7[_0x16fe('0x48')]['id']}})[_0x16fe('0x20')](handleEntityNotFound(_0x40171e,null))[_0x16fe('0x20')](removeEntity(_0x40171e,null))[_0x16fe('0x46')](handleError(_0x40171e,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 1f8666a..8df1423 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 _0xa48b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','lodash','util','api'];(function(_0x36d04d,_0x469817){var _0x213b48=function(_0x407b54){while(--_0x407b54){_0x36d04d['push'](_0x36d04d['shift']());}};_0x213b48(++_0x469817);}(_0xa48b,0x1aa));var _0xba48=function(_0x51293c,_0x1a01e8){_0x51293c=_0x51293c-0x0;var _0x2cabbe=_0xa48b[_0x51293c];return _0x2cabbe;};'use strict';var _=require(_0xba48('0x0'));var util=require(_0xba48('0x1'));var logger=require('../../config/logger')(_0xba48('0x2'));var moment=require(_0xba48('0x3'));var BPromise=require(_0xba48('0x4'));var rp=require(_0xba48('0x5'));var fs=require('fs');var path=require(_0xba48('0x6'));var rimraf=require(_0xba48('0x7'));var config=require(_0xba48('0x8'));var attributes=require(_0xba48('0x9'));module[_0xba48('0xa')]=function(_0x4d88be,_0x594dc4){return _0x4d88be[_0xba48('0xb')](_0xba48('0xc'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x904e=['api','moment','bluebird','request-promise','path','../../config/environment','define','Variable','tools_variables','lodash','util','../../config/logger'];(function(_0x5a4066,_0x3b352c){var _0x46543e=function(_0x6a5e41){while(--_0x6a5e41){_0x5a4066['push'](_0x5a4066['shift']());}};_0x46543e(++_0x3b352c);}(_0x904e,0xb1));var _0xe904=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x904e[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0xe904('0x0'));var util=require(_0xe904('0x1'));var logger=require(_0xe904('0x2'))(_0xe904('0x3'));var moment=require(_0xe904('0x4'));var BPromise=require(_0xe904('0x5'));var rp=require(_0xe904('0x6'));var fs=require('fs');var path=require(_0xe904('0x7'));var rimraf=require('rimraf');var config=require(_0xe904('0x8'));var attributes=require('./variable.attributes');module['exports']=function(_0x417b02,_0x584d96){return _0x417b02[_0xe904('0x9')](_0xe904('0xa'),attributes,{'tableName':_0xe904('0xb'),'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 5f6e4ad..cbb586c 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 _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x42ea7e,_0x5075d2){var _0x567e8c=function(_0x503bea){while(--_0x503bea){_0x42ea7e['push'](_0x42ea7e['shift']());}};_0x567e8c(++_0x5075d2);}(_0x7217,0x19e));var _0x7721=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7217[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file +var _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x5a54f2,_0x774ad6){var _0x1fffe9=function(_0x317519){while(--_0x317519){_0x5a54f2['push'](_0x5a54f2['shift']());}};_0x1fffe9(++_0x774ad6);}(_0xabce,0x103));var _0xeabc=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xabce[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index d88ed57..5b305ee 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 _0x696a=['/fetch','isAuthenticated','fetch','/reset','get','/pull','canUpdate','pull','/migrations','Router','../../components/auth/service','./version.controller','index'];(function(_0x437707,_0x36c3c8){var _0x19fa0e=function(_0x424753){while(--_0x424753){_0x437707['push'](_0x437707['shift']());}};_0x19fa0e(++_0x36c3c8);}(_0x696a,0x19c));var _0xa696=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x696a[_0x2adbeb];return _0x5e18a6;};'use strict';var express=require('express');var router=express[_0xa696('0x0')]();var auth=require(_0xa696('0x1'));var controller=require(_0xa696('0x2'));router['get']('/',controller[_0xa696('0x3')]);router['get'](_0xa696('0x4'),auth[_0xa696('0x5')](),auth['canUpdate'](),controller[_0xa696('0x6')]);router['get'](_0xa696('0x7'),auth['isAuthenticated'](),auth['canUpdate'](),controller['reset']);router[_0xa696('0x8')](_0xa696('0x9'),auth[_0xa696('0x5')](),auth[_0xa696('0xa')](),controller[_0xa696('0xb')]);router[_0xa696('0x8')]('/restart',auth[_0xa696('0x5')](),controller['restart']);router[_0xa696('0x8')](_0xa696('0xc'),controller['migrations']);module['exports']=router; \ No newline at end of file +var _0x7feb=['../../components/auth/service','./version.controller','get','index','isAuthenticated','reset','canUpdate','pull','/restart','/migrations','migrations','exports'];(function(_0x237868,_0x267e95){var _0x3bc4f6=function(_0x4bed0d){while(--_0x4bed0d){_0x237868['push'](_0x237868['shift']());}};_0x3bc4f6(++_0x267e95);}(_0x7feb,0x168));var _0xb7fe=function(_0x1d7676,_0x4317f7){_0x1d7676=_0x1d7676-0x0;var _0x3832c9=_0x7feb[_0x1d7676];return _0x3832c9;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xb7fe('0x0'));var controller=require(_0xb7fe('0x1'));router[_0xb7fe('0x2')]('/',controller[_0xb7fe('0x3')]);router[_0xb7fe('0x2')]('/fetch',auth[_0xb7fe('0x4')](),auth['canUpdate'](),controller['fetch']);router[_0xb7fe('0x2')]('/reset',auth[_0xb7fe('0x4')](),auth['canUpdate'](),controller[_0xb7fe('0x5')]);router[_0xb7fe('0x2')]('/pull',auth[_0xb7fe('0x4')](),auth[_0xb7fe('0x6')](),controller[_0xb7fe('0x7')]);router['get'](_0xb7fe('0x8'),auth[_0xb7fe('0x4')](),controller['restart']);router[_0xb7fe('0x2')](_0xb7fe('0x9'),controller[_0xb7fe('0xa')]);module[_0xb7fe('0xb')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 296e2b5..dc35d56 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 _0xbf32=['status','json','origin','master','error','git\x20fetch\x20origin\x20master','reset','info','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','length','replace','.js','push','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','Database\x20migrated\x20successfully\x20from\x20version\x20','last','catch','Database\x20already\x20up-to-date','umzug','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0'];(function(_0x2fab20,_0x1de496){var _0x57512b=function(_0x30d94f){while(--_0x30d94f){_0x2fab20['push'](_0x2fab20['shift']());}};_0x57512b(++_0x1de496);}(_0xbf32,0x16e));var _0x2bf3=function(_0x4eecc0,_0x1ee119){_0x4eecc0=_0x4eecc0-0x0;var _0xf21f5d=_0xbf32[_0x4eecc0];return _0xf21f5d;};'use strict';var Umzug=require(_0x2bf3('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x2bf3('0x1'))(module,_0x2bf3('0x2'));var compareVersions=require('compare-versions');var exec=require(_0x2bf3('0x3'))[_0x2bf3('0x4')];var db=require(_0x2bf3('0x5'))['db'];var config=require(_0x2bf3('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x2bf3('0x7'))(_0x2bf3('0x8'));var git=require(_0x2bf3('0x9'))(config[_0x2bf3('0xa')]);exports[_0x2bf3('0xb')]=function(_0x3a60e0,_0x15bc87){var _0x5bee62={'current':module[_0x2bf3('0xc')][_0x2bf3('0x2')],'phonebar':0x2};if(_0x3a60e0[_0x2bf3('0xd')]&&_0x3a60e0[_0x2bf3('0xd')][_0x2bf3('0xe')]){return git[_0x2bf3('0xf')]()[_0x2bf3('0x10')](function(_0x18deda,_0x5323f9){_0x5bee62['latest']=(_0x18deda?module[_0x2bf3('0xc')][_0x2bf3('0x2')]:_0x5323f9[_0x2bf3('0xe')])||_0x2bf3('0x11');return _0x15bc87[_0x2bf3('0x12')](0xc8)[_0x2bf3('0x13')](_0x5bee62);});}else{return _0x15bc87[_0x2bf3('0x12')](0xc8)[_0x2bf3('0x13')](_0x5bee62);}};exports[_0x2bf3('0xf')]=function(_0x58c62e,_0x28555b){return git[_0x2bf3('0xf')]([_0x2bf3('0x14'),_0x2bf3('0x15')],function(_0x4e6639){if(_0x4e6639){logger[_0x2bf3('0x16')](_0x4e6639);return _0x28555b[_0x2bf3('0x12')](0x1f4)[_0x2bf3('0x13')](_0x4e6639);}logger['info']('git\x20fetch');return _0x28555b[_0x2bf3('0x12')](0xc8)[_0x2bf3('0x13')]({'output':_0x2bf3('0x17')});});};exports[_0x2bf3('0x18')]=function(_0x109507,_0x343817){return git[_0x2bf3('0x18')](['--hard','FETCH_HEAD'],function(_0x2110fd){if(_0x2110fd){logger[_0x2bf3('0x16')](_0x2110fd);return _0x343817[_0x2bf3('0x12')](0x1f4)[_0x2bf3('0x13')](_0x2110fd);}logger[_0x2bf3('0x19')](_0x2bf3('0x1a'));return _0x343817['status'](0xc8)[_0x2bf3('0x13')]({'output':'git\x20reset\x20--hard'});});};exports[_0x2bf3('0x1b')]=function(_0xb60d29,_0x31603e){exec(_0x2bf3('0x1c'),function(_0x4ec686,_0x244967,_0x462e2d){logger[_0x2bf3('0x19')](_0x244967);logger[_0x2bf3('0x19')](_0x462e2d);if(_0x4ec686){logger[_0x2bf3('0x16')](_0x4ec686);return _0x31603e[_0x2bf3('0x12')](0x1f4)[_0x2bf3('0x13')](_0x4ec686);}return _0x31603e[_0x2bf3('0x12')](0xc8)[_0x2bf3('0x13')]({'output':_0x244967});});};exports[_0x2bf3('0x1d')]=function(_0x26abe0,_0x2e9ba2){return pm2['restart']('motion2')[_0x2bf3('0x1e')](function(_0x5c4c2b){logger[_0x2bf3('0x19')]('pm2\x20restart\x20motion\x20%s',_0x5c4c2b);return _0x2e9ba2[_0x2bf3('0x12')](0xc8)[_0x2bf3('0x13')]({'output':_0x2bf3('0x1f')});})['catch'](function(_0x3b1a1d){logger[_0x2bf3('0x16')](_0x3b1a1d);return _0x2e9ba2[_0x2bf3('0x12')](0x1f4)[_0x2bf3('0x13')](_0x3b1a1d);});};exports[_0x2bf3('0x20')]=function(_0x1b8823,_0x531a56){var _0x217893=fs[_0x2bf3('0x21')](path['join'](config['root'],'server',_0x2bf3('0x20')));var _0x4fe8d6=[];for(var _0x3ba3a3=0x0;_0x3ba3a3<_0x217893[_0x2bf3('0x22')];_0x3ba3a3++){var _0x286b88=_0x217893[_0x3ba3a3][_0x2bf3('0x23')](_0x2bf3('0x24'),'');if(compareVersions(module[_0x2bf3('0xc')][_0x2bf3('0x2')],_0x286b88)===-0x1){_0x4fe8d6[_0x2bf3('0x25')](_0x286b88);}}if(_0x4fe8d6[_0x2bf3('0x22')]){var _0x4a5d61=_0x4fe8d6[_0x2bf3('0x26')](compareVersions);var _0x38f119=new Umzug({'storage':_0x2bf3('0x27'),'storageOptions':{'model':db[_0x2bf3('0x28')],'modelName':_0x2bf3('0x28'),'columnName':_0x2bf3('0x2')},'migrations':{'params':[db[_0x2bf3('0x27')]['getQueryInterface'](),db[_0x2bf3('0x27')][_0x2bf3('0x29')],function(){throw new Error(_0x2bf3('0x2a'));}],'path':path[_0x2bf3('0x2b')](config[_0x2bf3('0xa')],'server','migrations'),'pattern':/\.js$/}});_0x38f119['up']({'migrations':_['map'](_0x4a5d61,function(_0x179132){return _0x179132+'.js';})})[_0x2bf3('0x1e')](function(){return _0x531a56[_0x2bf3('0x12')](0xc8)[_0x2bf3('0x13')]({'output':_0x2bf3('0x2c')+module[_0x2bf3('0xc')][_0x2bf3('0x2')]+'\x20to\x20'+_[_0x2bf3('0x2d')](_0x4a5d61),'migrations':_[_0x2bf3('0x2b')](_0x4a5d61)});})[_0x2bf3('0x2e')](function(_0x2fa124){if(_0x2fa124 instanceof db[_0x2bf3('0x27')]['UniqueConstraintError']){return _0x531a56[_0x2bf3('0x12')](0xc8)[_0x2bf3('0x13')]({'output':_0x2bf3('0x2f')});}else{return _0x531a56['status'](0x1f4)[_0x2bf3('0x13')](_0x2fa124);}});}else{return _0x531a56[_0x2bf3('0x12')](0xc8)['json']({'output':_0x2bf3('0x2f')});}}; \ No newline at end of file +var _0x18d5=['master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','exports','version','query','fetch','tags','latest','2.0.0','json','status','origin'];(function(_0x11a6c7,_0x2e0bf0){var _0x28415d=function(_0xc83b43){while(--_0xc83b43){_0x11a6c7['push'](_0x11a6c7['shift']());}};_0x28415d(++_0x2e0bf0);}(_0x18d5,0xc1));var _0x518d=function(_0x2f3a8f,_0x18ecc7){_0x2f3a8f=_0x2f3a8f-0x0;var _0x124e2c=_0x18d5[_0x2f3a8f];return _0x124e2c;};'use strict';var Umzug=require(_0x518d('0x0'));var path=require(_0x518d('0x1'));var fs=require('fs');var _=require(_0x518d('0x2'));var pkginfo=require(_0x518d('0x3'))(module,'version');var compareVersions=require(_0x518d('0x4'));var exec=require(_0x518d('0x5'))[_0x518d('0x6')];var db=require(_0x518d('0x7'))['db'];var config=require(_0x518d('0x8'));var pm2=require(_0x518d('0x9'));var logger=require('../../config/logger')(_0x518d('0xa'));var git=require(_0x518d('0xb'))(config[_0x518d('0xc')]);exports['index']=function(_0x2e2abb,_0xdd1ce1){var _0x30dd8d={'current':module[_0x518d('0xd')][_0x518d('0xe')],'phonebar':0x2};if(_0x2e2abb['query']&&_0x2e2abb[_0x518d('0xf')]['latest']){return git[_0x518d('0x10')]()[_0x518d('0x11')](function(_0x2b0e80,_0xa47dfa){_0x30dd8d[_0x518d('0x12')]=(_0x2b0e80?module[_0x518d('0xd')][_0x518d('0xe')]:_0xa47dfa['latest'])||_0x518d('0x13');return _0xdd1ce1['status'](0xc8)[_0x518d('0x14')](_0x30dd8d);});}else{return _0xdd1ce1[_0x518d('0x15')](0xc8)[_0x518d('0x14')](_0x30dd8d);}};exports['fetch']=function(_0x4dfa66,_0x1f44c5){return git[_0x518d('0x10')]([_0x518d('0x16'),_0x518d('0x17')],function(_0x589263){if(_0x589263){logger[_0x518d('0x18')](_0x589263);return _0x1f44c5['status'](0x1f4)[_0x518d('0x14')](_0x589263);}logger[_0x518d('0x19')](_0x518d('0x1a'));return _0x1f44c5[_0x518d('0x15')](0xc8)[_0x518d('0x14')]({'output':_0x518d('0x1b')});});};exports[_0x518d('0x1c')]=function(_0x47223d,_0x192858){return git[_0x518d('0x1c')](['--hard','FETCH_HEAD'],function(_0x40b585){if(_0x40b585){logger[_0x518d('0x18')](_0x40b585);return _0x192858[_0x518d('0x15')](0x1f4)['json'](_0x40b585);}logger[_0x518d('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x192858[_0x518d('0x15')](0xc8)[_0x518d('0x14')]({'output':'git\x20reset\x20--hard'});});};exports[_0x518d('0x1d')]=function(_0x3e29b9,_0x19c3d8){exec(_0x518d('0x1e'),function(_0x41bc29,_0x3d0fca,_0x5aa4b9){logger[_0x518d('0x19')](_0x3d0fca);logger['info'](_0x5aa4b9);if(_0x41bc29){logger['error'](_0x41bc29);return _0x19c3d8[_0x518d('0x15')](0x1f4)[_0x518d('0x14')](_0x41bc29);}return _0x19c3d8['status'](0xc8)[_0x518d('0x14')]({'output':_0x3d0fca});});};exports[_0x518d('0x1f')]=function(_0x5652a7,_0x436784){return pm2[_0x518d('0x1f')](_0x518d('0x20'))['then'](function(_0x53e4f5){logger[_0x518d('0x19')](_0x518d('0x21'),_0x53e4f5);return _0x436784[_0x518d('0x15')](0xc8)['json']({'output':_0x518d('0x22')});})[_0x518d('0x23')](function(_0x14a645){logger[_0x518d('0x18')](_0x14a645);return _0x436784['status'](0x1f4)[_0x518d('0x14')](_0x14a645);});};exports[_0x518d('0x24')]=function(_0x131551,_0x49f52c){var _0x257ef1=fs[_0x518d('0x25')](path[_0x518d('0x26')](config[_0x518d('0xc')],_0x518d('0x27'),_0x518d('0x24')));var _0x43ed01=[];for(var _0x4dc45d=0x0;_0x4dc45d<_0x257ef1[_0x518d('0x28')];_0x4dc45d++){var _0x221bf3=_0x257ef1[_0x4dc45d][_0x518d('0x29')](_0x518d('0x2a'),'');if(compareVersions(module[_0x518d('0xd')][_0x518d('0xe')],_0x221bf3)===-0x1){_0x43ed01[_0x518d('0x2b')](_0x221bf3);}}if(_0x43ed01[_0x518d('0x28')]){var _0x24b66a=_0x43ed01[_0x518d('0x2c')](compareVersions);var _0x29d4f5=new Umzug({'storage':_0x518d('0x2d'),'storageOptions':{'model':db[_0x518d('0x2e')],'modelName':_0x518d('0x2e'),'columnName':_0x518d('0xe')},'migrations':{'params':[db[_0x518d('0x2d')][_0x518d('0x2f')](),db['sequelize']['constructor'],function(){throw new Error(_0x518d('0x30'));}],'path':path['join'](config[_0x518d('0xc')],_0x518d('0x27'),'migrations'),'pattern':/\.js$/}});_0x29d4f5['up']({'migrations':_['map'](_0x24b66a,function(_0x6588e9){return _0x6588e9+_0x518d('0x2a');})})[_0x518d('0x31')](function(){return _0x49f52c[_0x518d('0x15')](0xc8)[_0x518d('0x14')]({'output':_0x518d('0x32')+module[_0x518d('0xd')][_0x518d('0xe')]+_0x518d('0x33')+_['last'](_0x24b66a),'migrations':_[_0x518d('0x26')](_0x24b66a)});})['catch'](function(_0x688c4c){if(_0x688c4c instanceof db['sequelize'][_0x518d('0x34')]){return _0x49f52c['status'](0xc8)[_0x518d('0x14')]({'output':_0x518d('0x35')});}else{return _0x49f52c[_0x518d('0x15')](0x1f4)[_0x518d('0x14')](_0x688c4c);}});}else{return _0x49f52c[_0x518d('0x15')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 440effa..9fb5eb6 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 _0x3ce1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x10ab79,_0x400c25){var _0x51bdd8=function(_0x393a72){while(--_0x393a72){_0x10ab79['push'](_0x10ab79['shift']());}};_0x51bdd8(++_0x400c25);}(_0x3ce1,0x12f));var _0x13ce=function(_0x3846d7,_0x12d3e1){_0x3846d7=_0x3846d7-0x0;var _0x518be2=_0x3ce1[_0x3846d7];return _0x518be2;};'use strict';var multer=require(_0x13ce('0x0'));var util=require(_0x13ce('0x1'));var path=require(_0x13ce('0x2'));var timeout=require(_0x13ce('0x3'));var express=require(_0x13ce('0x4'));var router=express['Router']();var fs_extra=require(_0x13ce('0x5'));var auth=require(_0x13ce('0x6'));var interaction=require(_0x13ce('0x7'));var config=require(_0x13ce('0x8'));var controller=require(_0x13ce('0x9'));router[_0x13ce('0xa')]('/',auth[_0x13ce('0xb')](),controller[_0x13ce('0xc')]);router[_0x13ce('0xa')]('/describe',auth[_0x13ce('0xb')](),controller[_0x13ce('0xd')]);router['get']('/:id',auth[_0x13ce('0xb')](),controller[_0x13ce('0xe')]);router[_0x13ce('0xf')]('/',auth[_0x13ce('0xb')](),controller[_0x13ce('0x10')]);router[_0x13ce('0x11')](_0x13ce('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x13ce('0x13')](_0x13ce('0x12'),auth[_0x13ce('0xb')](),controller[_0x13ce('0x14')]);module[_0x13ce('0x15')]=router; \ No newline at end of file +var _0xf381=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','show','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3eb466,_0x2464c2){var _0xed74eb=function(_0x10376f){while(--_0x10376f){_0x3eb466['push'](_0x3eb466['shift']());}};_0xed74eb(++_0x2464c2);}(_0xf381,0xf9));var _0x1f38=function(_0x325bb8,_0x54f2fd){_0x325bb8=_0x325bb8-0x0;var _0x4987ec=_0xf381[_0x325bb8];return _0x4987ec;};'use strict';var multer=require(_0x1f38('0x0'));var util=require(_0x1f38('0x1'));var path=require(_0x1f38('0x2'));var timeout=require(_0x1f38('0x3'));var express=require(_0x1f38('0x4'));var router=express[_0x1f38('0x5')]();var fs_extra=require(_0x1f38('0x6'));var auth=require(_0x1f38('0x7'));var interaction=require(_0x1f38('0x8'));var config=require(_0x1f38('0x9'));var controller=require(_0x1f38('0xa'));router[_0x1f38('0xb')]('/',auth[_0x1f38('0xc')](),controller[_0x1f38('0xd')]);router[_0x1f38('0xb')](_0x1f38('0xe'),auth[_0x1f38('0xc')](),controller['describe']);router[_0x1f38('0xb')]('/:id',auth[_0x1f38('0xc')](),controller[_0x1f38('0xf')]);router['post']('/',auth[_0x1f38('0xc')](),controller[_0x1f38('0x10')]);router[_0x1f38('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x1f38('0x12')]);router[_0x1f38('0x13')](_0x1f38('0x14'),auth['isAuthenticated'](),controller[_0x1f38('0x15')]);module[_0x1f38('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index c17d185..6fb01a4 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 _0xbd8e=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x31b641,_0x569245){var _0x19f278=function(_0x385964){while(--_0x385964){_0x31b641['push'](_0x31b641['shift']());}};_0x19f278(++_0x569245);}(_0xbd8e,0x1b5));var _0xebd8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xbd8e[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xebd8('0x0'));module[_0xebd8('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xebd8('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xebd8('0x2')]},'interface':{'type':Sequelize[_0xebd8('0x2')]},'membername':{'type':Sequelize[_0xebd8('0x2')]},'agentcalledAt':{'type':Sequelize[_0xebd8('0x3')]},'agentconnectAt':{'type':Sequelize[_0xebd8('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xebd8('0x3')]},'agentdumpAt':{'type':Sequelize[_0xebd8('0x3')]},'holdtime':{'type':Sequelize[_0xebd8('0x4')]},'agentcomplete':{'type':Sequelize[_0xebd8('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xebd8('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xebd8('0x4')]},'agentacw':{'type':Sequelize[_0xebd8('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xebd8('0x4')]},'reason':{'type':Sequelize[_0xebd8('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xebd8('0x2')]},'connectedlinenum':{'type':Sequelize[_0xebd8('0x2')]},'connectedlinename':{'type':Sequelize[_0xebd8('0x2')]},'language':{'type':Sequelize[_0xebd8('0x2')]},'accountcode':{'type':Sequelize[_0xebd8('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xebd8('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xebd8('0x2')]},'destchannelstate':{'type':Sequelize[_0xebd8('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xebd8('0x2')]},'destcalleridname':{'type':Sequelize[_0xebd8('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xebd8('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xebd8('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xebd8('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xebd8('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xebd8('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xebd8('0x2')]},'transfer':{'type':Sequelize[_0xebd8('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xebd8('0x2')],'comment':_0xebd8('0x6')},'transferexten':{'type':Sequelize[_0xebd8('0x2')]},'transferuniqueid':{'type':Sequelize[_0xebd8('0x2')]},'agententerreason':{'type':Sequelize[_0xebd8('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING'];(function(_0xd245e2,_0x12efd1){var _0x96508c=function(_0x364359){while(--_0x364359){_0xd245e2['push'](_0xd245e2['shift']());}};_0x96508c(++_0x12efd1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'type':{'type':Sequelize[_0x0baf('0x1')]},'uniqueid':{'type':Sequelize[_0x0baf('0x1')]},'calleridnum':{'type':Sequelize[_0x0baf('0x1')]},'calleridname':{'type':Sequelize[_0x0baf('0x1')]},'queue':{'type':Sequelize[_0x0baf('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0baf('0x1')]},'agentcalledAt':{'type':Sequelize[_0x0baf('0x2')]},'agentconnectAt':{'type':Sequelize[_0x0baf('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x0baf('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x0baf('0x2')]},'agentdumpAt':{'type':Sequelize[_0x0baf('0x2')]},'holdtime':{'type':Sequelize[_0x0baf('0x3')]},'agentcomplete':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x0baf('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x0baf('0x3')]},'reason':{'type':Sequelize[_0x0baf('0x1')]},'lastevent':{'type':Sequelize[_0x0baf('0x1')]},'channel':{'type':Sequelize[_0x0baf('0x1')]},'channelstate':{'type':Sequelize[_0x0baf('0x3')]},'channelstatedesc':{'type':Sequelize[_0x0baf('0x1')]},'connectedlinenum':{'type':Sequelize[_0x0baf('0x1')]},'connectedlinename':{'type':Sequelize[_0x0baf('0x1')]},'language':{'type':Sequelize[_0x0baf('0x1')]},'accountcode':{'type':Sequelize[_0x0baf('0x1')]},'context':{'type':Sequelize[_0x0baf('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x0baf('0x1')]},'destchannelstate':{'type':Sequelize[_0x0baf('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x0baf('0x1')]},'destcalleridnum':{'type':Sequelize[_0x0baf('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x0baf('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x0baf('0x1')]},'destaccountcode':{'type':Sequelize[_0x0baf('0x1')]},'destcontext':{'type':Sequelize[_0x0baf('0x1')]},'destexten':{'type':Sequelize[_0x0baf('0x1')]},'destpriority':{'type':Sequelize[_0x0baf('0x1')]},'destuniqueid':{'type':Sequelize[_0x0baf('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0baf('0x1')],'comment':_0x0baf('0x5')},'transferexten':{'type':Sequelize[_0x0baf('0x1')]},'transferuniqueid':{'type':Sequelize[_0x0baf('0x1')]},'agententerreason':{'type':Sequelize[_0x0baf('0x3')],'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 de1cdd5..9e22efa 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 942adc3..4fb7c70 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 _0x39d9=['path','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xf30d85,_0x1bb86b){var _0xd5116a=function(_0x57fae9){while(--_0x57fae9){_0xf30d85['push'](_0xf30d85['shift']());}};_0xd5116a(++_0x1bb86b);}(_0x39d9,0x17f));var _0x939d=function(_0x3671b7,_0x5398bd){_0x3671b7=_0x3671b7-0x0;var _0x50f41b=_0x39d9[_0x3671b7];return _0x50f41b;};'use strict';var _=require(_0x939d('0x0'));var util=require(_0x939d('0x1'));var logger=require(_0x939d('0x2'))(_0x939d('0x3'));var moment=require(_0x939d('0x4'));var BPromise=require(_0x939d('0x5'));var rp=require(_0x939d('0x6'));var fs=require('fs');var path=require(_0x939d('0x7'));var rimraf=require('rimraf');var config=require(_0x939d('0x8'));var attributes=require(_0x939d('0x9'));module[_0x939d('0xa')]=function(_0x48b22f,_0x41c89f){return _0x48b22f['define'](_0x939d('0xb'),attributes,{'tableName':_0x939d('0xc'),'paranoid':![],'indexes':[{'fields':[_0x939d('0xd'),_0x939d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb70=['request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1252ad,_0x125889){var _0x1818b4=function(_0x4f872a){while(--_0x4f872a){_0x1252ad['push'](_0x1252ad['shift']());}};_0x1818b4(++_0x125889);}(_0xdb70,0xa0));var _0x0db7=function(_0x19f96c,_0x52e14e){_0x19f96c=_0x19f96c-0x0;var _0x2475cd=_0xdb70[_0x19f96c];return _0x2475cd;};'use strict';var _=require(_0x0db7('0x0'));var util=require(_0x0db7('0x1'));var logger=require(_0x0db7('0x2'))('api');var moment=require(_0x0db7('0x3'));var BPromise=require(_0x0db7('0x4'));var rp=require(_0x0db7('0x5'));var fs=require('fs');var path=require(_0x0db7('0x6'));var rimraf=require(_0x0db7('0x7'));var config=require(_0x0db7('0x8'));var attributes=require(_0x0db7('0x9'));module[_0x0db7('0xa')]=function(_0x13fcf7,_0xbefc2a){return _0x13fcf7[_0x0db7('0xb')]('VoiceAgentReport',attributes,{'tableName':_0x0db7('0xc'),'paranoid':![],'indexes':[{'fields':[_0x0db7('0xd'),_0x0db7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 455f7ce..5d7b0a5 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 _0x7318=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','create','body','options','raw','VoiceAgentReport','update','where','attributes','limit','UpdateVoiceAgentReport','lodash'];(function(_0xb54b2f,_0x3fd425){var _0x4bbbb7=function(_0x526447){while(--_0x526447){_0xb54b2f['push'](_0xb54b2f['shift']());}};_0x4bbbb7(++_0x3fd425);}(_0x7318,0x10f));var _0x8731=function(_0x2d6f8a,_0x31f818){_0x2d6f8a=_0x2d6f8a-0x0;var _0x4a4c7c=_0x7318[_0x2d6f8a];return _0x4a4c7c;};'use strict';var _=require(_0x8731('0x0'));var util=require('util');var moment=require(_0x8731('0x1'));var BPromise=require(_0x8731('0x2'));var rs=require(_0x8731('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8731('0x4'))['db'];var utils=require(_0x8731('0x5'));var logger=require(_0x8731('0x6'))('rpc');var config=require(_0x8731('0x7'));var jayson=require(_0x8731('0x8'));var client=jayson[_0x8731('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1241c9,_0x6bff8a,_0x5b9605){return new BPromise(function(_0xdedbb9,_0x246e90){return client[_0x8731('0xa')](_0x1241c9,_0x5b9605)[_0x8731('0xb')](function(_0x1364cf){logger[_0x8731('0xc')](_0x8731('0xd'),_0x6bff8a,_0x8731('0xe'));logger[_0x8731('0xf')](_0x8731('0x10'),_0x6bff8a,_0x8731('0xe'),JSON[_0x8731('0x11')](_0x1364cf));if(_0x1364cf[_0x8731('0x12')]){if(_0x1364cf[_0x8731('0x12')][_0x8731('0x13')]===0x1f4){logger['error'](_0x8731('0xd'),_0x6bff8a,_0x1364cf[_0x8731('0x12')][_0x8731('0x14')]);return _0x246e90(_0x1364cf[_0x8731('0x12')][_0x8731('0x14')]);}logger[_0x8731('0x12')](_0x8731('0xd'),_0x6bff8a,_0x1364cf[_0x8731('0x12')][_0x8731('0x14')]);return _0xdedbb9(_0x1364cf[_0x8731('0x12')]['message']);}else{logger['info'](_0x8731('0xd'),_0x6bff8a,_0x8731('0xe'));_0xdedbb9(_0x1364cf[_0x8731('0x15')][_0x8731('0x14')]);}})[_0x8731('0x16')](function(_0x528954){logger[_0x8731('0x12')](_0x8731('0xd'),_0x6bff8a,_0x528954);_0x246e90(_0x528954);});});}exports[_0x8731('0x17')]=function(_0x599131){var _0x1b622c=this;return new Promise(function(_0x1072a3,_0x46c935){return db['VoiceAgentReport'][_0x8731('0x18')](_0x599131[_0x8731('0x19')],{'raw':_0x599131['options']?_0x599131[_0x8731('0x1a')][_0x8731('0x1b')]===undefined?!![]:![]:!![]})[_0x8731('0xb')](function(_0x3de91c){logger[_0x8731('0xc')](_0x8731('0x17'),_0x599131);logger['debug'](_0x8731('0x17'),_0x599131,JSON[_0x8731('0x11')](_0x3de91c));_0x1072a3(_0x3de91c);})[_0x8731('0x16')](function(_0x3f366e){logger[_0x8731('0x12')](_0x8731('0x17'),_0x3f366e[_0x8731('0x14')],_0x599131);_0x46c935(_0x1b622c[_0x8731('0x12')](0x1f4,_0x3f366e[_0x8731('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x21f013){var _0x3c38d3=this;return new Promise(function(_0x2c4b62,_0x3be97b){return db[_0x8731('0x1c')][_0x8731('0x1d')](_0x21f013['body'],{'raw':_0x21f013[_0x8731('0x1a')]?_0x21f013[_0x8731('0x1a')][_0x8731('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21f013['options']?_0x21f013[_0x8731('0x1a')][_0x8731('0x1e')]||null:null,'attributes':_0x21f013[_0x8731('0x1a')]?_0x21f013[_0x8731('0x1a')][_0x8731('0x1f')]||null:null,'limit':_0x21f013[_0x8731('0x1a')]?_0x21f013[_0x8731('0x1a')][_0x8731('0x20')]||null:null})['then'](function(_0x45f4ec){logger[_0x8731('0xc')](_0x8731('0x21'),_0x21f013);logger[_0x8731('0xf')]('UpdateVoiceAgentReport',_0x21f013,JSON[_0x8731('0x11')](_0x45f4ec));_0x2c4b62(_0x45f4ec);})['catch'](function(_0x4c371f){logger[_0x8731('0x12')](_0x8731('0x21'),_0x4c371f['message'],_0x21f013);_0x3be97b(_0x3c38d3[_0x8731('0x12')](0x1f4,_0x4c371f[_0x8731('0x14')]));});});}; \ No newline at end of file +var _0xad76=['body','options','raw','where','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','VoiceAgentReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','CreateVoiceAgentReport','create','then','UpdateVoiceAgentReport','VoiceAgentReport'];(function(_0x1c9181,_0x39f42d){var _0x29f036=function(_0x46fbcb){while(--_0x46fbcb){_0x1c9181['push'](_0x1c9181['shift']());}};_0x29f036(++_0x39f42d);}(_0xad76,0xc5));var _0x6ad7=function(_0x579dd8,_0x2eaa36){_0x579dd8=_0x579dd8-0x0;var _0x4075d3=_0xad76[_0x579dd8];return _0x4075d3;};'use strict';var _=require('lodash');var util=require(_0x6ad7('0x0'));var moment=require(_0x6ad7('0x1'));var BPromise=require(_0x6ad7('0x2'));var rs=require(_0x6ad7('0x3'));var fs=require('fs');var Redis=require(_0x6ad7('0x4'));var db=require(_0x6ad7('0x5'))['db'];var utils=require(_0x6ad7('0x6'));var logger=require(_0x6ad7('0x7'))(_0x6ad7('0x8'));var config=require('../../config/environment');var jayson=require(_0x6ad7('0x9'));var client=jayson[_0x6ad7('0xa')][_0x6ad7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dcb55,_0x554ceb,_0x1b452a){return new BPromise(function(_0x5103fe,_0x2ff8cf){return client[_0x6ad7('0xc')](_0x1dcb55,_0x1b452a)['then'](function(_0x123ad3){logger['info'](_0x6ad7('0xd'),_0x554ceb,'request\x20sent');logger[_0x6ad7('0xe')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x554ceb,_0x6ad7('0xf'),JSON[_0x6ad7('0x10')](_0x123ad3));if(_0x123ad3['error']){if(_0x123ad3[_0x6ad7('0x11')][_0x6ad7('0x12')]===0x1f4){logger[_0x6ad7('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x554ceb,_0x123ad3[_0x6ad7('0x11')][_0x6ad7('0x13')]);return _0x2ff8cf(_0x123ad3[_0x6ad7('0x11')][_0x6ad7('0x13')]);}logger[_0x6ad7('0x11')](_0x6ad7('0xd'),_0x554ceb,_0x123ad3[_0x6ad7('0x11')][_0x6ad7('0x13')]);return _0x5103fe(_0x123ad3[_0x6ad7('0x11')]['message']);}else{logger[_0x6ad7('0x14')](_0x6ad7('0xd'),_0x554ceb,_0x6ad7('0xf'));_0x5103fe(_0x123ad3['result'][_0x6ad7('0x13')]);}})[_0x6ad7('0x15')](function(_0x16d451){logger[_0x6ad7('0x11')](_0x6ad7('0xd'),_0x554ceb,_0x16d451);_0x2ff8cf(_0x16d451);});});}exports[_0x6ad7('0x16')]=function(_0x2e193c){var _0xc55b8f=this;return new Promise(function(_0x310640,_0x20a777){return db['VoiceAgentReport'][_0x6ad7('0x17')](_0x2e193c['body'],{'raw':_0x2e193c['options']?_0x2e193c['options']['raw']===undefined?!![]:![]:!![]})[_0x6ad7('0x18')](function(_0x319f9c){logger['info'](_0x6ad7('0x16'),_0x2e193c);logger[_0x6ad7('0xe')](_0x6ad7('0x16'),_0x2e193c,JSON[_0x6ad7('0x10')](_0x319f9c));_0x310640(_0x319f9c);})[_0x6ad7('0x15')](function(_0x290e8b){logger['error'](_0x6ad7('0x16'),_0x290e8b[_0x6ad7('0x13')],_0x2e193c);_0x20a777(_0xc55b8f[_0x6ad7('0x11')](0x1f4,_0x290e8b[_0x6ad7('0x13')]));});});};exports[_0x6ad7('0x19')]=function(_0x181f51){var _0x3ed295=this;return new Promise(function(_0x1935a5,_0x41d4b4){return db[_0x6ad7('0x1a')]['update'](_0x181f51[_0x6ad7('0x1b')],{'raw':_0x181f51['options']?_0x181f51[_0x6ad7('0x1c')][_0x6ad7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x181f51[_0x6ad7('0x1c')]?_0x181f51[_0x6ad7('0x1c')][_0x6ad7('0x1e')]||null:null,'attributes':_0x181f51[_0x6ad7('0x1c')]?_0x181f51['options']['attributes']||null:null,'limit':_0x181f51[_0x6ad7('0x1c')]?_0x181f51[_0x6ad7('0x1c')][_0x6ad7('0x1f')]||null:null})[_0x6ad7('0x18')](function(_0x1d71a8){logger['info'](_0x6ad7('0x19'),_0x181f51);logger[_0x6ad7('0xe')](_0x6ad7('0x19'),_0x181f51,JSON['stringify'](_0x1d71a8));_0x1935a5(_0x1d71a8);})[_0x6ad7('0x15')](function(_0x157bc1){logger[_0x6ad7('0x11')](_0x6ad7('0x19'),_0x157bc1[_0x6ad7('0x13')],_0x181f51);_0x41d4b4(_0x3ed295[_0x6ad7('0x11')](0x1f4,_0x157bc1[_0x6ad7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 5937f16..3309db0 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 _0x0fda=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x2a9e81,_0x56c735){var _0x3d2051=function(_0x478330){while(--_0x478330){_0x2a9e81['push'](_0x2a9e81['shift']());}};_0x3d2051(++_0x56c735);}(_0x0fda,0x1a0));var _0xa0fd=function(_0xc18408,_0x37cb15){_0xc18408=_0xc18408-0x0;var _0x470b95=_0x0fda[_0xc18408];return _0x470b95;};'use strict';var multer=require(_0xa0fd('0x0'));var util=require('util');var path=require(_0xa0fd('0x1'));var timeout=require(_0xa0fd('0x2'));var express=require(_0xa0fd('0x3'));var router=express[_0xa0fd('0x4')]();var fs_extra=require(_0xa0fd('0x5'));var auth=require(_0xa0fd('0x6'));var interaction=require(_0xa0fd('0x7'));var config=require('../../config/environment');var controller=require('./voiceCallReport.controller');router[_0xa0fd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa0fd('0x8')](_0xa0fd('0x9'),auth[_0xa0fd('0xa')](),controller[_0xa0fd('0xb')]);router['get'](_0xa0fd('0xc'),auth[_0xa0fd('0xa')](),controller[_0xa0fd('0xd')]);router[_0xa0fd('0xe')]('/',auth['isAuthenticated'](),controller[_0xa0fd('0xf')]);router[_0xa0fd('0x10')](_0xa0fd('0xc'),auth['isAuthenticated'](),controller[_0xa0fd('0x11')]);router[_0xa0fd('0x12')](_0xa0fd('0xc'),auth[_0xa0fd('0xa')](),controller[_0xa0fd('0x13')]);module['exports']=router; \ No newline at end of file +var _0xd6d6=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post'];(function(_0x213d29,_0x1c4ce2){var _0x3d388f=function(_0x44e360){while(--_0x44e360){_0x213d29['push'](_0x213d29['shift']());}};_0x3d388f(++_0x1c4ce2);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x2cd35a,_0x4a025b){_0x2cd35a=_0x2cd35a-0x0;var _0x1c8641=_0xd6d6[_0x2cd35a];return _0x1c8641;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require(_0x6d6d('0x3'));var express=require('express');var router=express[_0x6d6d('0x4')]();var fs_extra=require(_0x6d6d('0x5'));var auth=require(_0x6d6d('0x6'));var interaction=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var controller=require(_0x6d6d('0x9'));router[_0x6d6d('0xa')]('/',auth['isAuthenticated'](),controller[_0x6d6d('0xb')]);router[_0x6d6d('0xa')](_0x6d6d('0xc'),auth[_0x6d6d('0xd')](),controller[_0x6d6d('0xe')]);router[_0x6d6d('0xa')](_0x6d6d('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x6d6d('0x10')]('/',auth[_0x6d6d('0xd')](),controller[_0x6d6d('0x11')]);router[_0x6d6d('0x12')](_0x6d6d('0xf'),auth['isAuthenticated'](),controller[_0x6d6d('0x13')]);router[_0x6d6d('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6d6d('0x15')]);module[_0x6d6d('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index dbf2c84..304fdaf 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 _0xd878=['sequelize','exports','STRING','ENUM','inbound','internal','outbound','TEXT','DATE','INTEGER'];(function(_0xc767a,_0x1ef0f9){var _0x3ab7c6=function(_0x2b6f8a){while(--_0x2b6f8a){_0xc767a['push'](_0xc767a['shift']());}};_0x3ab7c6(++_0x1ef0f9);}(_0xd878,0x118));var _0x8d87=function(_0x1be965,_0x50754a){_0x1be965=_0x1be965-0x0;var _0x5c0851=_0xd878[_0x1be965];return _0x5c0851;};'use strict';var Sequelize=require(_0x8d87('0x0'));module[_0x8d87('0x1')]={'uniqueid':{'type':Sequelize[_0x8d87('0x2')]},'type':{'type':Sequelize[_0x8d87('0x3')](_0x8d87('0x4'),_0x8d87('0x5'),_0x8d87('0x6'),'inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize[_0x8d87('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x8d87('0x2')]},'destinationcontext':{'type':Sequelize[_0x8d87('0x2')]},'callerid':{'type':Sequelize[_0x8d87('0x2')]},'channel':{'type':Sequelize[_0x8d87('0x2')]},'destinationchannel':{'type':Sequelize[_0x8d87('0x2')]},'lastapplication':{'type':Sequelize[_0x8d87('0x2')]},'lastdata':{'type':Sequelize[_0x8d87('0x7')]},'starttime':{'type':Sequelize[_0x8d87('0x8')]},'systemanswertime':{'type':Sequelize[_0x8d87('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x8d87('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8d87('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8d87('0x2')]},'amaflags':{'type':Sequelize[_0x8d87('0x2')]},'userfield':{'type':Sequelize[_0x8d87('0x2')]},'userDisposition':{'type':Sequelize[_0x8d87('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x8d87('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8d87('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x8d87('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4c2c=['STRING','ENUM','inbound','outbound','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize'];(function(_0x50a338,_0x465e8b){var _0x5cf1ee=function(_0x22da42){while(--_0x22da42){_0x50a338['push'](_0x50a338['shift']());}};_0x5cf1ee(++_0x465e8b);}(_0x4c2c,0x1c1));var _0xc4c2=function(_0x451e44,_0x2a4226){_0x451e44=_0x451e44-0x0;var _0x58f6ca=_0x4c2c[_0x451e44];return _0x58f6ca;};'use strict';var Sequelize=require(_0xc4c2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc4c2('0x1')]},'type':{'type':Sequelize[_0xc4c2('0x2')](_0xc4c2('0x3'),'internal',_0xc4c2('0x4'),'inbound-fax',_0xc4c2('0x5'),_0xc4c2('0x6'))},'tag':{'type':Sequelize[_0xc4c2('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xc4c2('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc4c2('0x1')]},'destinationchannel':{'type':Sequelize[_0xc4c2('0x1')]},'lastapplication':{'type':Sequelize[_0xc4c2('0x1')]},'lastdata':{'type':Sequelize[_0xc4c2('0x7')]},'starttime':{'type':Sequelize[_0xc4c2('0x8')]},'systemanswertime':{'type':Sequelize[_0xc4c2('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc4c2('0x8')]},'duration':{'type':Sequelize[_0xc4c2('0x9')]},'billableseconds':{'type':Sequelize[_0xc4c2('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc4c2('0x1')]},'amaflags':{'type':Sequelize[_0xc4c2('0x1')]},'userfield':{'type':Sequelize[_0xc4c2('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xc4c2('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc4c2('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xc4c2('0x9')]},'sipcallid':{'type':Sequelize[_0xc4c2('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 655d865..a936fbd 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 _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(_0x10401b,_0x4c3284){var _0x51696a=function(_0x4db693){while(--_0x4db693){_0x10401b['push'](_0x10401b['shift']());}};_0x51696a(++_0x4c3284);}(_0x0b0e,0x187));var _0xe0b0=function(_0x8fa4bc,_0x5cd2af){_0x8fa4bc=_0x8fa4bc-0x0;var _0x35b6a7=_0x0b0e[_0x8fa4bc];return _0x35b6a7;};'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 +var _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x2a9d1c,_0x4f29d0){var _0xd00a45=function(_0x146b2d){while(--_0x146b2d){_0x2a9d1c['push'](_0x2a9d1c['shift']());}};_0xd00a45(++_0x4f29d0);}(_0xb10b,0x12a));var _0xbb10=function(_0x278646,_0x25736a){_0x278646=_0x278646-0x0;var _0x1bba75=_0xb10b[_0x278646];return _0x1bba75;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 90d7bdf..1ec8bbe 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 _0xaf62=['define','lodash','../../config/logger','api','moment','request-promise','path','rimraf','exports'];(function(_0x41ade1,_0x34af04){var _0x465d5f=function(_0x22a1af){while(--_0x22a1af){_0x41ade1['push'](_0x41ade1['shift']());}};_0x465d5f(++_0x34af04);}(_0xaf62,0x88));var _0x2af6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xaf62[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x2af6('0x0'));var util=require('util');var logger=require(_0x2af6('0x1'))(_0x2af6('0x2'));var moment=require(_0x2af6('0x3'));var BPromise=require('bluebird');var rp=require(_0x2af6('0x4'));var fs=require('fs');var path=require(_0x2af6('0x5'));var rimraf=require(_0x2af6('0x6'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x2af6('0x7')]=function(_0x11ce83,_0x547e2){return _0x11ce83[_0x2af6('0x8')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf92f=['uniqueid','util','../../config/logger','bluebird','path','../../config/environment','exports','VoiceCallReport','report_call'];(function(_0x1c1457,_0x299928){var _0x2a019a=function(_0x338d5e){while(--_0x338d5e){_0x1c1457['push'](_0x1c1457['shift']());}};_0x2a019a(++_0x299928);}(_0xf92f,0x1f0));var _0xff92=function(_0x4cdca4,_0x2f0bb0){_0x4cdca4=_0x4cdca4-0x0;var _0x2325e5=_0xf92f[_0x4cdca4];return _0x2325e5;};'use strict';var _=require('lodash');var util=require(_0xff92('0x0'));var logger=require(_0xff92('0x1'))('api');var moment=require('moment');var BPromise=require(_0xff92('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff92('0x3'));var rimraf=require('rimraf');var config=require(_0xff92('0x4'));var attributes=require('./voiceCallReport.attributes');module[_0xff92('0x5')]=function(_0x2db7fe,_0x2f9724){return _0x2db7fe['define'](_0xff92('0x6'),attributes,{'tableName':_0xff92('0x7'),'paranoid':![],'indexes':[{'fields':[_0xff92('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index a4801ef..7ab08b7 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 _0xa3d5=['info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','GetVoiceCallReport','stringify','CreateVoiceCallReport','body','UpdateVoiceCallReport','update','where','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x23fc49,_0x24b727){var _0x39e5ed=function(_0x56ce61){while(--_0x56ce61){_0x23fc49['push'](_0x23fc49['shift']());}};_0x39e5ed(++_0x24b727);}(_0xa3d5,0xfe));var _0x5a3d=function(_0x47878f,_0x48d3bf){_0x47878f=_0x47878f-0x0;var _0x4b05b8=_0xa3d5[_0x47878f];return _0x4b05b8;};'use strict';var _=require(_0x5a3d('0x0'));var util=require('util');var moment=require(_0x5a3d('0x1'));var BPromise=require(_0x5a3d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a3d('0x3'));var db=require(_0x5a3d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a3d('0x5'))(_0x5a3d('0x6'));var config=require(_0x5a3d('0x7'));var jayson=require(_0x5a3d('0x8'));var client=jayson['client'][_0x5a3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c0cbc,_0x36d87a,_0x31bd06){return new BPromise(function(_0x4ab6f8,_0x5131d7){return client[_0x5a3d('0xa')](_0x4c0cbc,_0x31bd06)[_0x5a3d('0xb')](function(_0x3ceeb6){logger[_0x5a3d('0xc')](_0x5a3d('0xd'),_0x36d87a,_0x5a3d('0xe'));logger[_0x5a3d('0xf')](_0x5a3d('0x10'),_0x36d87a,_0x5a3d('0xe'),JSON['stringify'](_0x3ceeb6));if(_0x3ceeb6['error']){if(_0x3ceeb6[_0x5a3d('0x11')][_0x5a3d('0x12')]===0x1f4){logger['error'](_0x5a3d('0xd'),_0x36d87a,_0x3ceeb6[_0x5a3d('0x11')]['message']);return _0x5131d7(_0x3ceeb6[_0x5a3d('0x11')][_0x5a3d('0x13')]);}logger[_0x5a3d('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x36d87a,_0x3ceeb6['error'][_0x5a3d('0x13')]);return _0x4ab6f8(_0x3ceeb6['error'][_0x5a3d('0x13')]);}else{logger[_0x5a3d('0xc')](_0x5a3d('0xd'),_0x36d87a,'request\x20sent');_0x4ab6f8(_0x3ceeb6[_0x5a3d('0x14')][_0x5a3d('0x13')]);}})[_0x5a3d('0x15')](function(_0x184431){logger[_0x5a3d('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x36d87a,_0x184431);_0x5131d7(_0x184431);});});}exports['GetVoiceCallReport']=function(_0x53ea4a){var _0xa53d4c=this;return new Promise(function(_0x5788c6,_0x2e2f35){return db[_0x5a3d('0x16')][_0x5a3d('0x17')]({'raw':_0x53ea4a['options']?_0x53ea4a[_0x5a3d('0x18')][_0x5a3d('0x19')]===undefined?!![]:![]:!![],'where':_0x53ea4a[_0x5a3d('0x18')]?_0x53ea4a[_0x5a3d('0x18')]['where']||null:null,'attributes':_0x53ea4a[_0x5a3d('0x18')]?_0x53ea4a[_0x5a3d('0x18')][_0x5a3d('0x1a')]||null:null,'limit':_0x53ea4a[_0x5a3d('0x18')]?_0x53ea4a[_0x5a3d('0x18')][_0x5a3d('0x1b')]||null:null,'include':_0x53ea4a['options']?_0x53ea4a[_0x5a3d('0x18')]['include']?_['map'](_0x53ea4a[_0x5a3d('0x18')]['include'],function(_0x5027ea){return{'model':db[_0x5027ea['model']],'as':_0x5027ea['as'],'attributes':_0x5027ea[_0x5a3d('0x1a')],'include':_0x5027ea[_0x5a3d('0x1c')]?_[_0x5a3d('0x1d')](_0x5027ea['include'],function(_0x5147d6){return{'model':db[_0x5147d6[_0x5a3d('0x1e')]],'as':_0x5147d6['as'],'attributes':_0x5147d6[_0x5a3d('0x1a')],'include':_0x5147d6['include']?_[_0x5a3d('0x1d')](_0x5147d6[_0x5a3d('0x1c')],function(_0x55e93f){return{'model':db[_0x55e93f[_0x5a3d('0x1e')]],'as':_0x55e93f['as'],'attributes':_0x55e93f[_0x5a3d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f5b8b){logger[_0x5a3d('0xc')](_0x5a3d('0x1f'),_0x53ea4a);logger[_0x5a3d('0xf')](_0x5a3d('0x1f'),_0x53ea4a,JSON[_0x5a3d('0x20')](_0x5f5b8b));_0x5788c6(_0x5f5b8b);})[_0x5a3d('0x15')](function(_0x46b023){logger['error'](_0x5a3d('0x1f'),_0x46b023['message'],_0x53ea4a);_0x2e2f35(_0xa53d4c['error'](0x1f4,_0x46b023['message']));});});};exports[_0x5a3d('0x21')]=function(_0x38bb4a){var _0x368cc2=this;return new Promise(function(_0x319514,_0x3a3110){return db[_0x5a3d('0x16')]['create'](_0x38bb4a[_0x5a3d('0x22')],{'raw':_0x38bb4a['options']?_0x38bb4a[_0x5a3d('0x18')][_0x5a3d('0x19')]===undefined?!![]:![]:!![]})[_0x5a3d('0xb')](function(_0x29a183){logger[_0x5a3d('0xc')](_0x5a3d('0x21'),_0x38bb4a);logger[_0x5a3d('0xf')](_0x5a3d('0x21'),_0x38bb4a,JSON[_0x5a3d('0x20')](_0x29a183));_0x319514(_0x29a183);})['catch'](function(_0xb99141){logger[_0x5a3d('0x11')](_0x5a3d('0x21'),_0xb99141[_0x5a3d('0x13')],_0x38bb4a);_0x3a3110(_0x368cc2[_0x5a3d('0x11')](0x1f4,_0xb99141[_0x5a3d('0x13')]));});});};exports[_0x5a3d('0x23')]=function(_0x3dea81){var _0x4144b3=this;return new Promise(function(_0x342837,_0x31c88e){return db[_0x5a3d('0x16')][_0x5a3d('0x24')](_0x3dea81[_0x5a3d('0x22')],{'raw':_0x3dea81['options']?_0x3dea81[_0x5a3d('0x18')][_0x5a3d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dea81[_0x5a3d('0x18')]?_0x3dea81[_0x5a3d('0x18')][_0x5a3d('0x25')]||null:null,'attributes':_0x3dea81[_0x5a3d('0x18')]?_0x3dea81[_0x5a3d('0x18')][_0x5a3d('0x1a')]||null:null,'limit':_0x3dea81[_0x5a3d('0x18')]?_0x3dea81[_0x5a3d('0x18')]['limit']||null:null})[_0x5a3d('0xb')](function(_0x498f7f){logger[_0x5a3d('0xc')](_0x5a3d('0x23'),_0x3dea81);logger[_0x5a3d('0xf')](_0x5a3d('0x23'),_0x3dea81,JSON[_0x5a3d('0x20')](_0x498f7f));_0x342837(_0x498f7f);})[_0x5a3d('0x15')](function(_0x15b3c6){logger[_0x5a3d('0x11')](_0x5a3d('0x23'),_0x15b3c6[_0x5a3d('0x13')],_0x3dea81);_0x31c88e(_0x4144b3[_0x5a3d('0x11')](0x1f4,_0x15b3c6[_0x5a3d('0x13')]));});});}; \ No newline at end of file +var _0xdfa1=['stringify','code','error','message','result','GetVoiceCallReport','VoiceCallReport','findAll','raw','options','where','attributes','limit','include','model','map','then','create','body','CreateVoiceCallReport','catch','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s'];(function(_0x3e85e2,_0x218a20){var _0xa92db0=function(_0x1b3dd3){while(--_0x1b3dd3){_0x3e85e2['push'](_0x3e85e2['shift']());}};_0xa92db0(++_0x218a20);}(_0xdfa1,0x188));var _0x1dfa=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xdfa1[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0x1dfa('0x0'));var util=require(_0x1dfa('0x1'));var moment=require(_0x1dfa('0x2'));var BPromise=require(_0x1dfa('0x3'));var rs=require(_0x1dfa('0x4'));var fs=require('fs');var Redis=require(_0x1dfa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1dfa('0x6'));var logger=require('../../config/logger')(_0x1dfa('0x7'));var config=require(_0x1dfa('0x8'));var jayson=require(_0x1dfa('0x9'));var client=jayson[_0x1dfa('0xa')][_0x1dfa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x211062,_0x5156b2,_0x47470c){return new BPromise(function(_0x51e2f7,_0x2c61a7){return client[_0x1dfa('0xc')](_0x211062,_0x47470c)['then'](function(_0x19f525){logger[_0x1dfa('0xd')](_0x1dfa('0xe'),_0x5156b2,_0x1dfa('0xf'));logger[_0x1dfa('0x10')](_0x1dfa('0x11'),_0x5156b2,'request\x20sent',JSON[_0x1dfa('0x12')](_0x19f525));if(_0x19f525['error']){if(_0x19f525['error'][_0x1dfa('0x13')]===0x1f4){logger[_0x1dfa('0x14')](_0x1dfa('0xe'),_0x5156b2,_0x19f525[_0x1dfa('0x14')][_0x1dfa('0x15')]);return _0x2c61a7(_0x19f525[_0x1dfa('0x14')]['message']);}logger[_0x1dfa('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x5156b2,_0x19f525['error'][_0x1dfa('0x15')]);return _0x51e2f7(_0x19f525[_0x1dfa('0x14')][_0x1dfa('0x15')]);}else{logger[_0x1dfa('0xd')](_0x1dfa('0xe'),_0x5156b2,'request\x20sent');_0x51e2f7(_0x19f525[_0x1dfa('0x16')][_0x1dfa('0x15')]);}})['catch'](function(_0xe95ec9){logger[_0x1dfa('0x14')](_0x1dfa('0xe'),_0x5156b2,_0xe95ec9);_0x2c61a7(_0xe95ec9);});});}exports[_0x1dfa('0x17')]=function(_0x39fa82){var _0x54daf9=this;return new Promise(function(_0x599a1a,_0x503c31){return db[_0x1dfa('0x18')][_0x1dfa('0x19')]({'raw':_0x39fa82['options']?_0x39fa82['options'][_0x1dfa('0x1a')]===undefined?!![]:![]:!![],'where':_0x39fa82[_0x1dfa('0x1b')]?_0x39fa82['options'][_0x1dfa('0x1c')]||null:null,'attributes':_0x39fa82[_0x1dfa('0x1b')]?_0x39fa82[_0x1dfa('0x1b')][_0x1dfa('0x1d')]||null:null,'limit':_0x39fa82[_0x1dfa('0x1b')]?_0x39fa82[_0x1dfa('0x1b')][_0x1dfa('0x1e')]||null:null,'include':_0x39fa82[_0x1dfa('0x1b')]?_0x39fa82[_0x1dfa('0x1b')][_0x1dfa('0x1f')]?_['map'](_0x39fa82[_0x1dfa('0x1b')][_0x1dfa('0x1f')],function(_0x43dd98){return{'model':db[_0x43dd98[_0x1dfa('0x20')]],'as':_0x43dd98['as'],'attributes':_0x43dd98[_0x1dfa('0x1d')],'include':_0x43dd98[_0x1dfa('0x1f')]?_[_0x1dfa('0x21')](_0x43dd98['include'],function(_0x115a6d){return{'model':db[_0x115a6d[_0x1dfa('0x20')]],'as':_0x115a6d['as'],'attributes':_0x115a6d[_0x1dfa('0x1d')],'include':_0x115a6d[_0x1dfa('0x1f')]?_['map'](_0x115a6d['include'],function(_0x57c322){return{'model':db[_0x57c322[_0x1dfa('0x20')]],'as':_0x57c322['as'],'attributes':_0x57c322[_0x1dfa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1dfa('0x22')](function(_0x4ed4ef){logger[_0x1dfa('0xd')](_0x1dfa('0x17'),_0x39fa82);logger[_0x1dfa('0x10')](_0x1dfa('0x17'),_0x39fa82,JSON[_0x1dfa('0x12')](_0x4ed4ef));_0x599a1a(_0x4ed4ef);})['catch'](function(_0xd17092){logger[_0x1dfa('0x14')]('GetVoiceCallReport',_0xd17092['message'],_0x39fa82);_0x503c31(_0x54daf9[_0x1dfa('0x14')](0x1f4,_0xd17092[_0x1dfa('0x15')]));});});};exports['CreateVoiceCallReport']=function(_0x26d11a){var _0x6afa1b=this;return new Promise(function(_0x42fba8,_0x47bf5e){return db[_0x1dfa('0x18')][_0x1dfa('0x23')](_0x26d11a[_0x1dfa('0x24')],{'raw':_0x26d11a[_0x1dfa('0x1b')]?_0x26d11a['options'][_0x1dfa('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x462caf){logger[_0x1dfa('0xd')](_0x1dfa('0x25'),_0x26d11a);logger['debug'](_0x1dfa('0x25'),_0x26d11a,JSON[_0x1dfa('0x12')](_0x462caf));_0x42fba8(_0x462caf);})[_0x1dfa('0x26')](function(_0x2e369f){logger[_0x1dfa('0x14')]('CreateVoiceCallReport',_0x2e369f[_0x1dfa('0x15')],_0x26d11a);_0x47bf5e(_0x6afa1b[_0x1dfa('0x14')](0x1f4,_0x2e369f[_0x1dfa('0x15')]));});});};exports[_0x1dfa('0x27')]=function(_0x31146b){var _0x590984=this;return new Promise(function(_0xca6e2f,_0x147863){return db[_0x1dfa('0x18')][_0x1dfa('0x28')](_0x31146b[_0x1dfa('0x24')],{'raw':_0x31146b['options']?_0x31146b[_0x1dfa('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31146b['options']?_0x31146b[_0x1dfa('0x1b')][_0x1dfa('0x1c')]||null:null,'attributes':_0x31146b[_0x1dfa('0x1b')]?_0x31146b['options'][_0x1dfa('0x1d')]||null:null,'limit':_0x31146b[_0x1dfa('0x1b')]?_0x31146b['options']['limit']||null:null})[_0x1dfa('0x22')](function(_0x33bd29){logger[_0x1dfa('0xd')](_0x1dfa('0x27'),_0x31146b);logger[_0x1dfa('0x10')](_0x1dfa('0x27'),_0x31146b,JSON['stringify'](_0x33bd29));_0xca6e2f(_0x33bd29);})['catch'](function(_0x53d6e9){logger[_0x1dfa('0x14')]('UpdateVoiceCallReport',_0x53d6e9[_0x1dfa('0x15')],_0x31146b);_0x147863(_0x590984[_0x1dfa('0x14')](0x1f4,_0x53d6e9['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 71715bc..37e6d7e 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 _0x7712=['index','/:id','show','post','isAuthenticated','destroy','exports','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get'];(function(_0x28c939,_0x110e29){var _0x527fe9=function(_0x1df2a6){while(--_0x1df2a6){_0x28c939['push'](_0x28c939['shift']());}};_0x527fe9(++_0x110e29);}(_0x7712,0x18f));var _0x2771=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7712[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2771('0x0'));var router=express['Router']();var fs_extra=require(_0x2771('0x1'));var auth=require(_0x2771('0x2'));var interaction=require(_0x2771('0x3'));var config=require(_0x2771('0x4'));var controller=require(_0x2771('0x5'));router[_0x2771('0x6')]('/',auth['isAuthenticated'](),controller[_0x2771('0x7')]);router[_0x2771('0x6')](_0x2771('0x8'),auth['isAuthenticated'](),controller[_0x2771('0x9')]);router[_0x2771('0xa')]('/',auth[_0x2771('0xb')](),controller['create']);router['put']('/:id',auth[_0x2771('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2771('0xc')]);module[_0x2771('0xd')]=router; \ No newline at end of file +var _0xe98a=['create','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','show','post'];(function(_0x243002,_0x538db3){var _0x37a38c=function(_0x5426a5){while(--_0x5426a5){_0x243002['push'](_0x243002['shift']());}};_0x37a38c(++_0x538db3);}(_0xe98a,0xbf));var _0xae98=function(_0x6182ff,_0x59d492){_0x6182ff=_0x6182ff-0x0;var _0x1cec22=_0xe98a[_0x6182ff];return _0x1cec22;};'use strict';var multer=require(_0xae98('0x0'));var util=require(_0xae98('0x1'));var path=require('path');var timeout=require(_0xae98('0x2'));var express=require(_0xae98('0x3'));var router=express[_0xae98('0x4')]();var fs_extra=require(_0xae98('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xae98('0x6'));var controller=require(_0xae98('0x7'));router[_0xae98('0x8')]('/',auth[_0xae98('0x9')](),controller[_0xae98('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xae98('0xb')]);router[_0xae98('0xc')]('/',auth[_0xae98('0x9')](),controller[_0xae98('0xd')]);router['put'](_0xae98('0xe'),auth[_0xae98('0x9')](),controller['update']);router[_0xae98('0xf')](_0xae98('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xae98('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 703e3c1..759ea34 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 _0x1f11=['setDataValue','options','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x20130c,_0x1d1159){var _0x20630b=function(_0x47c4b3){while(--_0x47c4b3){_0x20130c['push'](_0x20130c['shift']());}};_0x20630b(++_0x1d1159);}(_0x1f11,0xb0));var _0x11f1=function(_0x2ea20d,_0x5e8e3c){_0x2ea20d=_0x2ea20d-0x0;var _0x3ba66a=_0x1f11[_0x2ea20d];return _0x3ba66a;};'use strict';var Sequelize=require(_0x11f1('0x0'));module[_0x11f1('0x1')]={'name':{'type':Sequelize[_0x11f1('0x2')]},'prefix':{'type':Sequelize[_0x11f1('0x2')],'unique':_0x11f1('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x11f1('0x2')],'set':function(_0x594cd3){this[_0x11f1('0x4')](_0x11f1('0x5'),_0x594cd3?_0x594cd3['join'](''):[]);},'get':function(){return this[_0x11f1('0x6')](_0x11f1('0x5'))?this[_0x11f1('0x6')](_0x11f1('0x5'))[_0x11f1('0x7')](''):[];}},'auth':{'type':Sequelize[_0x11f1('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x11f1('0x2')]},'record':{'type':Sequelize[_0x11f1('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x11f1('0x2')]}}; \ No newline at end of file +var _0xb212=['options','getDataValue','split','BOOLEAN','sequelize','STRING','name','setDataValue'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0xb212,0x134));var _0x2b21=function(_0x2accf9,_0x236a44){_0x2accf9=_0x2accf9-0x0;var _0x127309=_0xb212[_0x2accf9];return _0x127309;};'use strict';var Sequelize=require(_0x2b21('0x0'));module['exports']={'name':{'type':Sequelize[_0x2b21('0x1')]},'prefix':{'type':Sequelize[_0x2b21('0x1')],'unique':_0x2b21('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x2b21('0x1')],'set':function(_0x33d37c){this[_0x2b21('0x3')](_0x2b21('0x4'),_0x33d37c?_0x33d37c['join'](''):[]);},'get':function(){return this[_0x2b21('0x5')]('options')?this[_0x2b21('0x5')](_0x2b21('0x4'))[_0x2b21('0x6')](''):[];}},'auth':{'type':Sequelize[_0x2b21('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x2b21('0x1')]},'record':{'type':Sequelize[_0x2b21('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'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 e3440f2..5bb6653 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 _0x1b73=['map','VoiceChanSpy','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','get','UserProfileResource','error','stack','name','send','index'];(function(_0x39d0f2,_0x1d63e1){var _0x2febf1=function(_0x5588ed){while(--_0x5588ed){_0x39d0f2['push'](_0x39d0f2['shift']());}};_0x2febf1(++_0x1d63e1);}(_0x1b73,0x1d5));var _0x31b7=function(_0x87f4f0,_0x505c12){_0x87f4f0=_0x87f4f0-0x0;var _0x4aa369=_0x1b73[_0x87f4f0];return _0x4aa369;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31b7('0x0'));var zipdir=require(_0x31b7('0x1'));var jsonpatch=require(_0x31b7('0x2'));var rp=require(_0x31b7('0x3'));var moment=require('moment');var BPromise=require(_0x31b7('0x4'));var Mustache=require('mustache');var util=require(_0x31b7('0x5'));var path=require(_0x31b7('0x6'));var sox=require('sox');var csv=require(_0x31b7('0x7'));var ejs=require(_0x31b7('0x8'));var fs=require('fs');var fs_extra=require(_0x31b7('0x9'));var _=require('lodash');var squel=require(_0x31b7('0xa'));var crypto=require(_0x31b7('0xb'));var jsforce=require(_0x31b7('0xc'));var deskjs=require(_0x31b7('0xd'));var toCsv=require(_0x31b7('0x7'));var querystring=require(_0x31b7('0xe'));var Papa=require(_0x31b7('0xf'));var Redis=require('ioredis');var authService=require(_0x31b7('0x10'));var qs=require(_0x31b7('0x11'));var as=require(_0x31b7('0x12'));var hardwareService=require(_0x31b7('0x13'));var logger=require(_0x31b7('0x14'))(_0x31b7('0x15'));var utils=require(_0x31b7('0x16'));var config=require(_0x31b7('0x17'));var licenseUtil=require(_0x31b7('0x18'));var db=require(_0x31b7('0x19'))['db'];function respondWithStatusCode(_0x492612,_0x32afeb){_0x32afeb=_0x32afeb||0xcc;return function(_0x55e1bb){if(_0x55e1bb){return _0x492612[_0x31b7('0x1a')](_0x32afeb);}return _0x492612[_0x31b7('0x1b')](_0x32afeb)[_0x31b7('0x1c')]();};}function respondWithResult(_0x1969d2,_0x7988e2){_0x7988e2=_0x7988e2||0xc8;return function(_0x34e917){if(_0x34e917){return _0x1969d2[_0x31b7('0x1b')](_0x7988e2)['json'](_0x34e917);}};}function respondWithFilteredResult(_0x1e93fb,_0x491c98){return function(_0x210f18){if(_0x210f18){var _0xf213c9=typeof _0x491c98['offset']===_0x31b7('0x1d')&&typeof _0x491c98[_0x31b7('0x1e')]===_0x31b7('0x1d');var _0x39eee9=_0x210f18[_0x31b7('0x1f')];var _0x5f3245=_0xf213c9?0x0:_0x491c98[_0x31b7('0x20')];var _0x437eba=_0xf213c9?_0x210f18[_0x31b7('0x1f')]:_0x491c98[_0x31b7('0x20')]+_0x491c98[_0x31b7('0x1e')];var _0x4b8ab1;if(_0x437eba>=_0x39eee9){_0x437eba=_0x39eee9;_0x4b8ab1=0xc8;}else{_0x4b8ab1=0xce;}_0x1e93fb[_0x31b7('0x1b')](_0x4b8ab1);return _0x1e93fb[_0x31b7('0x21')](_0x31b7('0x22'),_0x5f3245+'-'+_0x437eba+'/'+_0x39eee9)[_0x31b7('0x23')](_0x210f18);}return null;};}function patchUpdates(_0x5b56bc){return function(_0x892fe4){try{jsonpatch[_0x31b7('0x24')](_0x892fe4,_0x5b56bc,!![]);}catch(_0x424318){return BPromise[_0x31b7('0x25')](_0x424318);}return _0x892fe4['save']();};}function saveUpdates(_0x33dd04,_0x20cb03){return function(_0x250574){if(_0x250574){return _0x250574[_0x31b7('0x26')](_0x33dd04)[_0x31b7('0x27')](function(_0x2d24bf){return _0x2d24bf;});}return null;};}function removeEntity(_0x36492c,_0x20e5b0){return function(_0x3b0eff){if(_0x3b0eff){return _0x3b0eff['destroy']()[_0x31b7('0x27')](function(){var _0x35a51f=_0x3b0eff[_0x31b7('0x28')]({'plain':!![]});var _0x2c993b='ChanSpies';return db[_0x31b7('0x29')]['destroy']({'where':{'type':_0x2c993b,'resourceId':_0x35a51f['id']}})[_0x31b7('0x27')](function(){return _0x3b0eff;});})[_0x31b7('0x27')](function(){_0x36492c[_0x31b7('0x1b')](0xcc)[_0x31b7('0x1c')]();});}};}function handleEntityNotFound(_0xffacb,_0x128865){return function(_0x21ab03){if(!_0x21ab03){_0xffacb[_0x31b7('0x1a')](0x194);}return _0x21ab03;};}function handleError(_0x4e58e5,_0x47ef33){_0x47ef33=_0x47ef33||0x1f4;return function(_0x503549){logger[_0x31b7('0x2a')](_0x503549[_0x31b7('0x2b')]);if(_0x503549[_0x31b7('0x2c')]){delete _0x503549['name'];}_0x4e58e5[_0x31b7('0x1b')](_0x47ef33)[_0x31b7('0x2d')](_0x503549);};}exports[_0x31b7('0x2e')]=function(_0x277273,_0x58a87e){var _0x5b0ed2={},_0x34c62a={},_0x4b5cf9={'count':0x0,'rows':[]};var _0x574dfe=_[_0x31b7('0x2f')](db[_0x31b7('0x30')][_0x31b7('0x31')],function(_0x35f83c){return{'name':_0x35f83c['fieldName'],'type':_0x35f83c['type'][_0x31b7('0x32')]};});_0x34c62a[_0x31b7('0x33')]=_[_0x31b7('0x2f')](_0x574dfe,_0x31b7('0x2c'));_0x34c62a[_0x31b7('0x34')]=_['keys'](_0x277273['query']);_0x34c62a[_0x31b7('0x35')]=_[_0x31b7('0x36')](_0x34c62a['model'],_0x34c62a[_0x31b7('0x34')]);_0x5b0ed2[_0x31b7('0x37')]=_['intersection'](_0x34c62a[_0x31b7('0x33')],qs[_0x31b7('0x38')](_0x277273[_0x31b7('0x34')][_0x31b7('0x38')]));_0x5b0ed2[_0x31b7('0x37')]=_0x5b0ed2[_0x31b7('0x37')][_0x31b7('0x39')]?_0x5b0ed2[_0x31b7('0x37')]:_0x34c62a[_0x31b7('0x33')];if(!_0x277273[_0x31b7('0x34')][_0x31b7('0x3a')](_0x31b7('0x3b'))){_0x5b0ed2[_0x31b7('0x1e')]=qs['limit'](_0x277273['query'][_0x31b7('0x1e')]);_0x5b0ed2[_0x31b7('0x20')]=qs[_0x31b7('0x20')](_0x277273[_0x31b7('0x34')][_0x31b7('0x20')]);}_0x5b0ed2[_0x31b7('0x3c')]=qs[_0x31b7('0x3d')](_0x277273[_0x31b7('0x34')][_0x31b7('0x3d')]);_0x5b0ed2[_0x31b7('0x3e')]=qs['filters'](_[_0x31b7('0x3f')](_0x277273[_0x31b7('0x34')],_0x34c62a[_0x31b7('0x35')]),_0x574dfe);if(_0x277273[_0x31b7('0x34')]['filter']){_0x5b0ed2[_0x31b7('0x3e')]=_[_0x31b7('0x40')](_0x5b0ed2['where'],{'$or':_[_0x31b7('0x2f')](_0x574dfe,function(_0x5724fa){if(_0x5724fa['type']!==_0x31b7('0x41')){var _0x10e82c={};_0x10e82c[_0x5724fa[_0x31b7('0x2c')]]={'$like':'%'+_0x277273[_0x31b7('0x34')][_0x31b7('0x42')]+'%'};return _0x10e82c;}})});}_0x5b0ed2=_['merge']({},_0x5b0ed2,_0x277273[_0x31b7('0x43')]);var _0x5d01ee={'where':_0x5b0ed2['where']};return db['VoiceChanSpy'][_0x31b7('0x1f')](_0x5d01ee)[_0x31b7('0x27')](function(_0x1527b3){_0x4b5cf9[_0x31b7('0x1f')]=_0x1527b3;if(_0x277273[_0x31b7('0x34')]['includeAll']){_0x5b0ed2[_0x31b7('0x44')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x31b7('0x45')](_0x5b0ed2);})[_0x31b7('0x27')](function(_0x41c92e){_0x4b5cf9[_0x31b7('0x46')]=_0x41c92e;return _0x4b5cf9;})['then'](respondWithFilteredResult(_0x58a87e,_0x5b0ed2))[_0x31b7('0x47')](handleError(_0x58a87e,null));};exports[_0x31b7('0x48')]=function(_0x1046fb,_0x4b3d24){var _0x31fd89={'raw':![],'where':{'id':_0x1046fb[_0x31b7('0x49')]['id']}},_0x51918d={};_0x51918d[_0x31b7('0x33')]=_['keys'](db[_0x31b7('0x30')][_0x31b7('0x31')]);_0x51918d[_0x31b7('0x34')]=_[_0x31b7('0x4a')](_0x1046fb['query']);_0x51918d[_0x31b7('0x35')]=_['intersection'](_0x51918d['model'],_0x51918d[_0x31b7('0x34')]);_0x31fd89[_0x31b7('0x37')]=_[_0x31b7('0x36')](_0x51918d[_0x31b7('0x33')],qs['fields'](_0x1046fb[_0x31b7('0x34')][_0x31b7('0x38')]));_0x31fd89['attributes']=_0x31fd89[_0x31b7('0x37')][_0x31b7('0x39')]?_0x31fd89[_0x31b7('0x37')]:_0x51918d['model'];if(_0x1046fb[_0x31b7('0x34')][_0x31b7('0x4b')]){_0x31fd89[_0x31b7('0x44')]=[{'all':!![]}];}_0x31fd89=_[_0x31b7('0x40')]({},_0x31fd89,_0x1046fb[_0x31b7('0x43')]);return db[_0x31b7('0x30')][_0x31b7('0x4c')](_0x31fd89)[_0x31b7('0x27')](handleEntityNotFound(_0x4b3d24,null))['then'](respondWithResult(_0x4b3d24,null))[_0x31b7('0x47')](handleError(_0x4b3d24,null));};exports['create']=function(_0x5a72ee,_0x22cc77){return db[_0x31b7('0x30')][_0x31b7('0x4d')](_0x5a72ee[_0x31b7('0x4e')],{})['then'](function(_0x322798){var _0x18556b=_0x5a72ee[_0x31b7('0x4f')]['get']({'plain':!![]});if(!_0x18556b)throw new Error(_0x31b7('0x50'));if(_0x18556b[_0x31b7('0x51')]===_0x31b7('0x4f')){var _0x3b5868=_0x322798[_0x31b7('0x28')]({'plain':!![]});var _0x309077=_0x31b7('0x52');return db[_0x31b7('0x53')]['find']({'where':{'name':_0x309077,'userProfileId':_0x18556b['userProfileId']},'raw':!![]})[_0x31b7('0x27')](function(_0x1d55e6){if(_0x1d55e6&&_0x1d55e6[_0x31b7('0x54')]===0x0){return db[_0x31b7('0x29')]['create']({'name':_0x3b5868['name'],'resourceId':_0x3b5868['id'],'type':_0x1d55e6[_0x31b7('0x2c')],'sectionId':_0x1d55e6['id']},{})[_0x31b7('0x27')](function(){return _0x322798;});}else{return _0x322798;}})[_0x31b7('0x47')](function(_0x5ea605){logger[_0x31b7('0x2a')](_0x31b7('0x55'),_0x5ea605);throw _0x5ea605;});}return _0x322798;})[_0x31b7('0x27')](respondWithResult(_0x22cc77,0xc9))[_0x31b7('0x47')](handleError(_0x22cc77,null));};exports['update']=function(_0x535a3c,_0x43c1ee){if(_0x535a3c[_0x31b7('0x4e')]['id']){delete _0x535a3c[_0x31b7('0x4e')]['id'];}return db[_0x31b7('0x30')][_0x31b7('0x4c')]({'where':{'id':_0x535a3c[_0x31b7('0x49')]['id']}})[_0x31b7('0x27')](handleEntityNotFound(_0x43c1ee,null))[_0x31b7('0x27')](saveUpdates(_0x535a3c[_0x31b7('0x4e')],null))[_0x31b7('0x27')](respondWithResult(_0x43c1ee,null))['catch'](handleError(_0x43c1ee,null));};exports['destroy']=function(_0x4bd00d,_0x954c){return db[_0x31b7('0x30')][_0x31b7('0x4c')]({'where':{'id':_0x4bd00d['params']['id']}})[_0x31b7('0x27')](handleEntityNotFound(_0x954c,null))[_0x31b7('0x27')](removeEntity(_0x954c,null))[_0x31b7('0x47')](handleError(_0x954c,null));}; \ No newline at end of file +var _0x402f=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','map','VoiceChanSpy','rawAttributes','type','key','model','query'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x402f,0x6f));var _0xf402=function(_0x1eacc4,_0x169efa){_0x1eacc4=_0x1eacc4-0x0;var _0x89886a=_0x402f[_0x1eacc4];return _0x89886a;};'use strict';var emlformat=require(_0xf402('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf402('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf402('0x2'));var BPromise=require(_0xf402('0x3'));var Mustache=require(_0xf402('0x4'));var util=require('util');var path=require(_0xf402('0x5'));var sox=require('sox');var csv=require(_0xf402('0x6'));var ejs=require(_0xf402('0x7'));var fs=require('fs');var fs_extra=require(_0xf402('0x8'));var _=require(_0xf402('0x9'));var squel=require(_0xf402('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf402('0xb'));var toCsv=require(_0xf402('0x6'));var querystring=require(_0xf402('0xc'));var Papa=require(_0xf402('0xd'));var Redis=require(_0xf402('0xe'));var authService=require(_0xf402('0xf'));var qs=require(_0xf402('0x10'));var as=require(_0xf402('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf402('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46758d,_0x4f8073){_0x4f8073=_0x4f8073||0xcc;return function(_0x5c127f){if(_0x5c127f){return _0x46758d['sendStatus'](_0x4f8073);}return _0x46758d[_0xf402('0x13')](_0x4f8073)['end']();};}function respondWithResult(_0x2ff50e,_0xb3deb6){_0xb3deb6=_0xb3deb6||0xc8;return function(_0x1ce72a){if(_0x1ce72a){return _0x2ff50e[_0xf402('0x13')](_0xb3deb6)['json'](_0x1ce72a);}};}function respondWithFilteredResult(_0x16767b,_0x4baaec){return function(_0x3af9e3){if(_0x3af9e3){var _0x5e38d8=typeof _0x4baaec['offset']==='undefined'&&typeof _0x4baaec[_0xf402('0x14')]===_0xf402('0x15');var _0xd406bf=_0x3af9e3[_0xf402('0x16')];var _0x2fbe36=_0x5e38d8?0x0:_0x4baaec[_0xf402('0x17')];var _0x3ed3eb=_0x5e38d8?_0x3af9e3[_0xf402('0x16')]:_0x4baaec[_0xf402('0x17')]+_0x4baaec[_0xf402('0x14')];var _0x5bb928;if(_0x3ed3eb>=_0xd406bf){_0x3ed3eb=_0xd406bf;_0x5bb928=0xc8;}else{_0x5bb928=0xce;}_0x16767b[_0xf402('0x13')](_0x5bb928);return _0x16767b[_0xf402('0x18')](_0xf402('0x19'),_0x2fbe36+'-'+_0x3ed3eb+'/'+_0xd406bf)[_0xf402('0x1a')](_0x3af9e3);}return null;};}function patchUpdates(_0x3d3ed4){return function(_0x30f661){try{jsonpatch[_0xf402('0x1b')](_0x30f661,_0x3d3ed4,!![]);}catch(_0xf52248){return BPromise[_0xf402('0x1c')](_0xf52248);}return _0x30f661['save']();};}function saveUpdates(_0x3cfe38,_0x4ffe46){return function(_0x297a68){if(_0x297a68){return _0x297a68[_0xf402('0x1d')](_0x3cfe38)[_0xf402('0x1e')](function(_0x477709){return _0x477709;});}return null;};}function removeEntity(_0x20dca1,_0x9cbd83){return function(_0x1b8064){if(_0x1b8064){return _0x1b8064[_0xf402('0x1f')]()[_0xf402('0x1e')](function(){var _0x427173=_0x1b8064[_0xf402('0x20')]({'plain':!![]});var _0xfad629='ChanSpies';return db[_0xf402('0x21')][_0xf402('0x1f')]({'where':{'type':_0xfad629,'resourceId':_0x427173['id']}})[_0xf402('0x1e')](function(){return _0x1b8064;});})[_0xf402('0x1e')](function(){_0x20dca1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e26d3,_0x3f837e){return function(_0x3a6a8d){if(!_0x3a6a8d){_0x3e26d3[_0xf402('0x22')](0x194);}return _0x3a6a8d;};}function handleError(_0x32f1dc,_0x496d66){_0x496d66=_0x496d66||0x1f4;return function(_0x39a38a){logger['error'](_0x39a38a[_0xf402('0x23')]);if(_0x39a38a[_0xf402('0x24')]){delete _0x39a38a[_0xf402('0x24')];}_0x32f1dc[_0xf402('0x13')](_0x496d66)[_0xf402('0x25')](_0x39a38a);};}exports['index']=function(_0xaeda0f,_0x3720c6){var _0x10f130={},_0x5bb711={},_0x4d86bd={'count':0x0,'rows':[]};var _0x3ffab6=_[_0xf402('0x26')](db[_0xf402('0x27')][_0xf402('0x28')],function(_0x162cce){return{'name':_0x162cce['fieldName'],'type':_0x162cce[_0xf402('0x29')][_0xf402('0x2a')]};});_0x5bb711[_0xf402('0x2b')]=_[_0xf402('0x26')](_0x3ffab6,_0xf402('0x24'));_0x5bb711[_0xf402('0x2c')]=_['keys'](_0xaeda0f[_0xf402('0x2c')]);_0x5bb711[_0xf402('0x2d')]=_[_0xf402('0x2e')](_0x5bb711['model'],_0x5bb711['query']);_0x10f130[_0xf402('0x2f')]=_[_0xf402('0x2e')](_0x5bb711[_0xf402('0x2b')],qs['fields'](_0xaeda0f[_0xf402('0x2c')][_0xf402('0x30')]));_0x10f130[_0xf402('0x2f')]=_0x10f130[_0xf402('0x2f')][_0xf402('0x31')]?_0x10f130[_0xf402('0x2f')]:_0x5bb711['model'];if(!_0xaeda0f[_0xf402('0x2c')][_0xf402('0x32')](_0xf402('0x33'))){_0x10f130[_0xf402('0x14')]=qs[_0xf402('0x14')](_0xaeda0f['query'][_0xf402('0x14')]);_0x10f130[_0xf402('0x17')]=qs[_0xf402('0x17')](_0xaeda0f['query']['offset']);}_0x10f130[_0xf402('0x34')]=qs['sort'](_0xaeda0f[_0xf402('0x2c')][_0xf402('0x35')]);_0x10f130['where']=qs[_0xf402('0x2d')](_[_0xf402('0x36')](_0xaeda0f[_0xf402('0x2c')],_0x5bb711[_0xf402('0x2d')]),_0x3ffab6);if(_0xaeda0f[_0xf402('0x2c')][_0xf402('0x37')]){_0x10f130[_0xf402('0x38')]=_[_0xf402('0x39')](_0x10f130['where'],{'$or':_[_0xf402('0x26')](_0x3ffab6,function(_0x7301bf){if(_0x7301bf[_0xf402('0x29')]!==_0xf402('0x3a')){var _0x2fb923={};_0x2fb923[_0x7301bf['name']]={'$like':'%'+_0xaeda0f[_0xf402('0x2c')]['filter']+'%'};return _0x2fb923;}})});}_0x10f130=_[_0xf402('0x39')]({},_0x10f130,_0xaeda0f[_0xf402('0x3b')]);var _0x46b57f={'where':_0x10f130[_0xf402('0x38')]};return db[_0xf402('0x27')][_0xf402('0x16')](_0x46b57f)[_0xf402('0x1e')](function(_0x5d8a26){_0x4d86bd['count']=_0x5d8a26;if(_0xaeda0f[_0xf402('0x2c')][_0xf402('0x3c')]){_0x10f130[_0xf402('0x3d')]=[{'all':!![]}];}return db[_0xf402('0x27')][_0xf402('0x3e')](_0x10f130);})[_0xf402('0x1e')](function(_0x488587){_0x4d86bd[_0xf402('0x3f')]=_0x488587;return _0x4d86bd;})[_0xf402('0x1e')](respondWithFilteredResult(_0x3720c6,_0x10f130))[_0xf402('0x40')](handleError(_0x3720c6,null));};exports[_0xf402('0x41')]=function(_0x50c439,_0x16263b){var _0x1f0b26={'raw':![],'where':{'id':_0x50c439[_0xf402('0x42')]['id']}},_0x299af2={};_0x299af2[_0xf402('0x2b')]=_[_0xf402('0x43')](db['VoiceChanSpy'][_0xf402('0x28')]);_0x299af2[_0xf402('0x2c')]=_['keys'](_0x50c439['query']);_0x299af2[_0xf402('0x2d')]=_[_0xf402('0x2e')](_0x299af2['model'],_0x299af2[_0xf402('0x2c')]);_0x1f0b26[_0xf402('0x2f')]=_[_0xf402('0x2e')](_0x299af2['model'],qs[_0xf402('0x30')](_0x50c439['query'][_0xf402('0x30')]));_0x1f0b26['attributes']=_0x1f0b26[_0xf402('0x2f')][_0xf402('0x31')]?_0x1f0b26['attributes']:_0x299af2['model'];if(_0x50c439[_0xf402('0x2c')][_0xf402('0x3c')]){_0x1f0b26['include']=[{'all':!![]}];}_0x1f0b26=_['merge']({},_0x1f0b26,_0x50c439[_0xf402('0x3b')]);return db[_0xf402('0x27')][_0xf402('0x44')](_0x1f0b26)[_0xf402('0x1e')](handleEntityNotFound(_0x16263b,null))[_0xf402('0x1e')](respondWithResult(_0x16263b,null))[_0xf402('0x40')](handleError(_0x16263b,null));};exports[_0xf402('0x45')]=function(_0xf91b26,_0x48dc6){return db['VoiceChanSpy'][_0xf402('0x45')](_0xf91b26[_0xf402('0x46')],{})[_0xf402('0x1e')](function(_0x5c2926){var _0x2e1b55=_0xf91b26[_0xf402('0x47')][_0xf402('0x20')]({'plain':!![]});if(!_0x2e1b55)throw new Error(_0xf402('0x48'));if(_0x2e1b55['role']===_0xf402('0x47')){var _0x411fa3=_0x5c2926[_0xf402('0x20')]({'plain':!![]});var _0x3e089e=_0xf402('0x49');return db[_0xf402('0x4a')][_0xf402('0x44')]({'where':{'name':_0x3e089e,'userProfileId':_0x2e1b55[_0xf402('0x4b')]},'raw':!![]})[_0xf402('0x1e')](function(_0x17ea91){if(_0x17ea91&&_0x17ea91[_0xf402('0x4c')]===0x0){return db[_0xf402('0x21')][_0xf402('0x45')]({'name':_0x411fa3['name'],'resourceId':_0x411fa3['id'],'type':_0x17ea91['name'],'sectionId':_0x17ea91['id']},{})[_0xf402('0x1e')](function(){return _0x5c2926;});}else{return _0x5c2926;}})['catch'](function(_0x5876da){logger['error'](_0xf402('0x4d'),_0x5876da);throw _0x5876da;});}return _0x5c2926;})[_0xf402('0x1e')](respondWithResult(_0x48dc6,0xc9))['catch'](handleError(_0x48dc6,null));};exports[_0xf402('0x1d')]=function(_0x30c78f,_0x12e61e){if(_0x30c78f[_0xf402('0x46')]['id']){delete _0x30c78f[_0xf402('0x46')]['id'];}return db[_0xf402('0x27')][_0xf402('0x44')]({'where':{'id':_0x30c78f[_0xf402('0x42')]['id']}})['then'](handleEntityNotFound(_0x12e61e,null))['then'](saveUpdates(_0x30c78f[_0xf402('0x46')],null))[_0xf402('0x1e')](respondWithResult(_0x12e61e,null))['catch'](handleError(_0x12e61e,null));};exports[_0xf402('0x1f')]=function(_0x2ee779,_0x49b1d6){return db['VoiceChanSpy'][_0xf402('0x44')]({'where':{'id':_0x2ee779['params']['id']}})[_0xf402('0x1e')](handleEntityNotFound(_0x49b1d6,null))['then'](removeEntity(_0x49b1d6,null))[_0xf402('0x40')](handleError(_0x49b1d6,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index e72e466..d8b4a97 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 _0x0f4d=['MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','User','findAll','agent','then','catch','exports','models','define','voice_chanspy','VoiceExtension','bulkCreate','destroy','length','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','merge','Set','CDR(type)=%s','chanspy','record','push'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x0f4d,0xbf));var _0xd0f4=function(_0x28ce0d,_0x30c8db){_0x28ce0d=_0x28ce0d-0x0;var _0x3740cb=_0x0f4d[_0x28ce0d];return _0x3740cb;};'use strict';var _=require(_0xd0f4('0x0'));var util=require(_0xd0f4('0x1'));var BPromise=require(_0xd0f4('0x2'));var attributes=require(_0xd0f4('0x3'));var getUserApplications=function(_0x49d468,_0x44077d,_0x3abd32){var _0x34f5b4=0x1;var _0x316af1=[];var _0x14c10e={'context':_0x44077d[_0xd0f4('0x4')]||_0xd0f4('0x5'),'exten':util[_0xd0f4('0x6')](_0xd0f4('0x7'),_0x49d468['prefix'],_0x3abd32),'type':'system','isApp':![],'ChanSpyId':_0x49d468['id'],'UserId':_0x44077d['id']};_0x316af1['push'](_[_0xd0f4('0x8')]({'app':_0xd0f4('0x9'),'appdata':util[_0xd0f4('0x6')](_0xd0f4('0xa'),_0xd0f4('0xb')),'priority':_0x34f5b4++},_0x14c10e));if(_0x49d468[_0xd0f4('0xc')]){_0x316af1[_0xd0f4('0xd')](_[_0xd0f4('0x8')]({'app':_0xd0f4('0xe'),'appdata':util[_0xd0f4('0x6')](_0xd0f4('0xf'),_0x49d468[_0xd0f4('0x10')]),'priority':_0x34f5b4++},_0x14c10e));}if(_0x49d468[_0xd0f4('0x11')]){_0x316af1['push'](_[_0xd0f4('0x8')]({'app':_0xd0f4('0x12'),'appdata':_0x49d468[_0xd0f4('0x13')],'priority':_0x34f5b4++},_0x14c10e));}_0x316af1[_0xd0f4('0xd')](_[_0xd0f4('0x8')]({'app':_0xd0f4('0x14'),'appdata':util[_0xd0f4('0x6')](_0xd0f4('0x15'),_0x44077d[_0xd0f4('0x16')],_0x49d468[_0xd0f4('0x17')]?_0x49d468[_0xd0f4('0x17')][_0xd0f4('0x18')](''):''),'priority':_0x34f5b4++},_0x14c10e));if(_0x49d468[_0xd0f4('0xc')]){_0x316af1['push'](_[_0xd0f4('0x8')]({'app':_0xd0f4('0x19'),'priority':_0x34f5b4++},_0x14c10e));}return _0x316af1;};var getChanSpyApplications=function(_0x404c74,_0x42c1d9){var _0x141a89=[];for(var _0x12e836=0x0,_0x5eb6ad=0x1;_0x12e836<_0x42c1d9['length'];_0x12e836++,_0x5eb6ad=0x1){_0x141a89=_0x141a89[_0xd0f4('0x1a')](getUserApplications(_0x404c74,_0x42c1d9[_0x12e836],_0x42c1d9[_0x12e836][_0xd0f4('0x1b')]));if(_0x42c1d9[_0x12e836][_0xd0f4('0x1b')]!=_0x42c1d9[_0x12e836][_0xd0f4('0x16')]){_0x141a89=_0x141a89['concat'](getUserApplications(_0x404c74,_0x42c1d9[_0x12e836],_0x42c1d9[_0x12e836][_0xd0f4('0x16')]));}}return _0x141a89;};var getChanSpyPromise=function(_0x278803,_0x3bbedb){return new BPromise(function(_0x46a66c,_0x3e8fa3){return _0x278803[_0xd0f4('0x1c')][_0xd0f4('0x1d')]({'attributes':['id',_0xd0f4('0x16'),_0xd0f4('0x1b')],'where':{'role':_0xd0f4('0x1e'),'chanspy':!![]},'raw':!![]})[_0xd0f4('0x1f')](function(_0x28deb3){if(_0x28deb3){return _0x46a66c(getChanSpyApplications(_0x3bbedb,_0x28deb3));}return _0x46a66c([]);})[_0xd0f4('0x20')](function(_0xb4322b){_0x3e8fa3(_0xb4322b);});});};module[_0xd0f4('0x21')]=function(_0x11214e,_0x1b5f91){var _0x2b008c=_0x11214e[_0xd0f4('0x22')];return _0x11214e[_0xd0f4('0x23')]('VoiceChanSpy',attributes,{'tableName':_0xd0f4('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b9ef3,_0x4ab549,_0x5eefca){return getChanSpyPromise(_0x2b008c,_0x5b9ef3)['then'](function(_0x45ce5c){if(_0x45ce5c&&_0x45ce5c['length']){return _0x2b008c[_0xd0f4('0x25')][_0xd0f4('0x26')](_0x45ce5c);}})[_0xd0f4('0x1f')](function(){_0x5eefca();})['catch'](function(_0x1ac988){_0x5eefca(_0x1ac988);});},'afterUpdate':function(_0x249893,_0x56ee51,_0x14fb06){return _0x2b008c['VoiceExtension'][_0xd0f4('0x27')]({'where':{'ChanSpyId':_0x249893['id']}})[_0xd0f4('0x1f')](function(){return getChanSpyPromise(_0x2b008c,_0x249893);})['then'](function(_0x32240d){if(_0x32240d&&_0x32240d[_0xd0f4('0x28')]){return _0x2b008c['VoiceExtension'][_0xd0f4('0x26')](_0x32240d);}})[_0xd0f4('0x1f')](function(){_0x14fb06();})['catch'](function(_0x5a2d66){_0x14fb06(_0x5a2d66);});},'afterDestroy':function(_0x3e30ab,_0xfbe37,_0x202009){return _0x2b008c[_0xd0f4('0x25')][_0xd0f4('0x27')]({'where':{'ChanSpyId':_0x3e30ab['id']}})[_0xd0f4('0x1f')](function(){_0x202009();})[_0xd0f4('0x20')](function(_0x4530ed){_0x202009(_0x4530ed);});}}});}; \ No newline at end of file +var _0x43f4=['destroy','bulkCreate','lodash','util','from-sip','format','%s%s','prefix','system','push','CDR(type)=%s','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','options','StopMixMonitor','length','concat','internal','name','User','findAll','agent','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x43f4,0x105));var _0x443f=function(_0x3b7050,_0x174381){_0x3b7050=_0x3b7050-0x0;var _0x39a9ba=_0x43f4[_0x3b7050];return _0x39a9ba;};'use strict';var _=require(_0x443f('0x0'));var util=require(_0x443f('0x1'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x513353,_0x377396,_0x230097){var _0x8bcc04=0x1;var _0x4fae87=[];var _0x3876f0={'context':_0x377396['context']||_0x443f('0x2'),'exten':util[_0x443f('0x3')](_0x443f('0x4'),_0x513353[_0x443f('0x5')],_0x230097),'type':_0x443f('0x6'),'isApp':![],'ChanSpyId':_0x513353['id'],'UserId':_0x377396['id']};_0x4fae87[_0x443f('0x7')](_['merge']({'app':'Set','appdata':util[_0x443f('0x3')](_0x443f('0x8'),'chanspy'),'priority':_0x8bcc04++},_0x3876f0));if(_0x513353[_0x443f('0x9')]){_0x4fae87[_0x443f('0x7')](_[_0x443f('0xa')]({'app':_0x443f('0xb'),'appdata':util[_0x443f('0x3')](_0x443f('0xc'),_0x513353[_0x443f('0xd')]),'priority':_0x8bcc04++},_0x3876f0));}if(_0x513353['auth']){_0x4fae87[_0x443f('0x7')](_['merge']({'app':_0x443f('0xe'),'appdata':_0x513353[_0x443f('0xf')],'priority':_0x8bcc04++},_0x3876f0));}_0x4fae87[_0x443f('0x7')](_[_0x443f('0xa')]({'app':_0x443f('0x10'),'appdata':util[_0x443f('0x3')](_0x443f('0x11'),_0x377396['name'],_0x513353[_0x443f('0x12')]?_0x513353[_0x443f('0x12')]['join'](''):''),'priority':_0x8bcc04++},_0x3876f0));if(_0x513353['record']){_0x4fae87[_0x443f('0x7')](_[_0x443f('0xa')]({'app':_0x443f('0x13'),'priority':_0x8bcc04++},_0x3876f0));}return _0x4fae87;};var getChanSpyApplications=function(_0x26fb52,_0xcea2ff){var _0x84a64b=[];for(var _0x4abd96=0x0,_0x451864=0x1;_0x4abd96<_0xcea2ff[_0x443f('0x14')];_0x4abd96++,_0x451864=0x1){_0x84a64b=_0x84a64b[_0x443f('0x15')](getUserApplications(_0x26fb52,_0xcea2ff[_0x4abd96],_0xcea2ff[_0x4abd96][_0x443f('0x16')]));if(_0xcea2ff[_0x4abd96][_0x443f('0x16')]!=_0xcea2ff[_0x4abd96][_0x443f('0x17')]){_0x84a64b=_0x84a64b[_0x443f('0x15')](getUserApplications(_0x26fb52,_0xcea2ff[_0x4abd96],_0xcea2ff[_0x4abd96][_0x443f('0x17')]));}}return _0x84a64b;};var getChanSpyPromise=function(_0x440b8c,_0x370af0){return new BPromise(function(_0x39f20b,_0x174c69){return _0x440b8c[_0x443f('0x18')][_0x443f('0x19')]({'attributes':['id',_0x443f('0x17'),'internal'],'where':{'role':_0x443f('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x4c6fd3){if(_0x4c6fd3){return _0x39f20b(getChanSpyApplications(_0x370af0,_0x4c6fd3));}return _0x39f20b([]);})[_0x443f('0x1b')](function(_0x412565){_0x174c69(_0x412565);});});};module[_0x443f('0x1c')]=function(_0x2b4494,_0x267d8e){var _0x3272e0=_0x2b4494[_0x443f('0x1d')];return _0x2b4494[_0x443f('0x1e')](_0x443f('0x1f'),attributes,{'tableName':_0x443f('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3cbe25,_0x175a9b,_0x35262a){return getChanSpyPromise(_0x3272e0,_0x3cbe25)['then'](function(_0x493285){if(_0x493285&&_0x493285[_0x443f('0x14')]){return _0x3272e0[_0x443f('0x21')]['bulkCreate'](_0x493285);}})[_0x443f('0x22')](function(){_0x35262a();})[_0x443f('0x1b')](function(_0x4f826f){_0x35262a(_0x4f826f);});},'afterUpdate':function(_0x34eabd,_0x1644e1,_0x2fa6f2){return _0x3272e0['VoiceExtension'][_0x443f('0x23')]({'where':{'ChanSpyId':_0x34eabd['id']}})[_0x443f('0x22')](function(){return getChanSpyPromise(_0x3272e0,_0x34eabd);})[_0x443f('0x22')](function(_0x279466){if(_0x279466&&_0x279466[_0x443f('0x14')]){return _0x3272e0[_0x443f('0x21')][_0x443f('0x24')](_0x279466);}})['then'](function(){_0x2fa6f2();})[_0x443f('0x1b')](function(_0x404c91){_0x2fa6f2(_0x404c91);});},'afterDestroy':function(_0x312f0d,_0x1474a8,_0x5e6dda){return _0x3272e0[_0x443f('0x21')][_0x443f('0x23')]({'where':{'ChanSpyId':_0x312f0d['id']}})[_0x443f('0x22')](function(){_0x5e6dda();})[_0x443f('0x1b')](function(_0x1c58d8){_0x5e6dda(_0x1c58d8);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index c4725c6..6a7f575 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 _0x0e9f=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','catch','lodash','util','randomstring','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0x0e9f,0x116));var _0xf0e9=function(_0x5c5355,_0x2e1e40){_0x5c5355=_0x5c5355-0x0;var _0x133e79=_0x0e9f[_0x5c5355];return _0x133e79;};'use strict';var _=require(_0xf0e9('0x0'));var util=require(_0xf0e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf0e9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf0e9('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0e9('0x4'));var jayson=require(_0xf0e9('0x5'));var client=jayson['client'][_0xf0e9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4a35a3,_0x3f9792,_0x2fa08f){return new BPromise(function(_0x106ba0,_0x58edfe){return client['request'](_0x4a35a3,_0x2fa08f)[_0xf0e9('0x7')](function(_0x7b3146){logger[_0xf0e9('0x8')]('VoiceChanSpy,\x20%s,\x20%s',_0x3f9792,_0xf0e9('0x9'));logger[_0xf0e9('0xa')](_0xf0e9('0xb'),_0x3f9792,'request\x20sent',JSON[_0xf0e9('0xc')](_0x7b3146));if(_0x7b3146[_0xf0e9('0xd')]){if(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0xe')]===0x1f4){logger['error'](_0xf0e9('0xf'),_0x3f9792,_0x7b3146['error'][_0xf0e9('0x10')]);return _0x58edfe(_0x7b3146[_0xf0e9('0xd')]['message']);}logger[_0xf0e9('0xd')](_0xf0e9('0xf'),_0x3f9792,_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);return _0x106ba0(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);}else{logger['info'](_0xf0e9('0xf'),_0x3f9792,_0xf0e9('0x9'));_0x106ba0(_0x7b3146['result'][_0xf0e9('0x10')]);}})[_0xf0e9('0x11')](function(_0x3d0b4d){logger[_0xf0e9('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x3f9792,_0x3d0b4d);_0x58edfe(_0x3d0b4d);});});} \ No newline at end of file +var _0xd757=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xd757,0x1e5));var _0x7d75=function(_0x5cd65e,_0x474d81){_0x5cd65e=_0x5cd65e-0x0;var _0x29fb99=_0xd757[_0x5cd65e];return _0x29fb99;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var moment=require(_0x7d75('0x2'));var BPromise=require(_0x7d75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d75('0x4'))['db'];var utils=require(_0x7d75('0x5'));var logger=require('../../config/logger')(_0x7d75('0x6'));var config=require(_0x7d75('0x7'));var jayson=require(_0x7d75('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x108c0d,_0x3fde33,_0x1cf272){return new BPromise(function(_0x276fb0,_0x4030ee){return client[_0x7d75('0x9')](_0x108c0d,_0x1cf272)[_0x7d75('0xa')](function(_0x3720c7){logger[_0x7d75('0xb')](_0x7d75('0xc'),_0x3fde33,_0x7d75('0xd'));logger[_0x7d75('0xe')](_0x7d75('0xf'),_0x3fde33,'request\x20sent',JSON['stringify'](_0x3720c7));if(_0x3720c7[_0x7d75('0x10')]){if(_0x3720c7[_0x7d75('0x10')][_0x7d75('0x11')]===0x1f4){logger['error'](_0x7d75('0xc'),_0x3fde33,_0x3720c7[_0x7d75('0x10')]['message']);return _0x4030ee(_0x3720c7[_0x7d75('0x10')][_0x7d75('0x12')]);}logger[_0x7d75('0x10')](_0x7d75('0xc'),_0x3fde33,_0x3720c7[_0x7d75('0x10')][_0x7d75('0x12')]);return _0x276fb0(_0x3720c7['error'][_0x7d75('0x12')]);}else{logger[_0x7d75('0xb')](_0x7d75('0xc'),_0x3fde33,_0x7d75('0xd'));_0x276fb0(_0x3720c7[_0x7d75('0x13')][_0x7d75('0x12')]);}})['catch'](function(_0x15ba5f){logger['error'](_0x7d75('0xc'),_0x3fde33,_0x15ba5f);_0x4030ee(_0x15ba5f);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 1d1e5d4..9c2c203 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 _0x8b88=['update','delete','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x30eab9,_0x38bf99){var _0x305c01=function(_0x4a4479){while(--_0x4a4479){_0x30eab9['push'](_0x30eab9['shift']());}};_0x305c01(++_0x38bf99);}(_0x8b88,0x64));var _0x88b8=function(_0x2c4c06,_0x2d0497){_0x2c4c06=_0x2c4c06-0x0;var _0x9410b4=_0x8b88[_0x2c4c06];return _0x9410b4;};'use strict';var multer=require('multer');var util=require(_0x88b8('0x0'));var path=require(_0x88b8('0x1'));var timeout=require(_0x88b8('0x2'));var express=require('express');var router=express[_0x88b8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x88b8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x88b8('0x5'));var controller=require(_0x88b8('0x6'));router[_0x88b8('0x7')]('/',auth[_0x88b8('0x8')](),controller[_0x88b8('0x9')]);router['get']('/:id',auth[_0x88b8('0x8')](),controller[_0x88b8('0xa')]);router[_0x88b8('0xb')]('/',auth[_0x88b8('0x8')](),controller[_0x88b8('0xc')]);router[_0x88b8('0xd')]('/:id',auth[_0x88b8('0x8')](),controller[_0x88b8('0xe')]);router[_0x88b8('0xf')](_0x88b8('0x10'),auth[_0x88b8('0x8')](),controller[_0x88b8('0x11')]);module[_0x88b8('0x12')]=router; \ No newline at end of file +var _0xf1a4=['post','isAuthenticated','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceContext.controller','get','/:id','show'];(function(_0x46bb4b,_0x4321fc){var _0x503334=function(_0x26f626){while(--_0x26f626){_0x46bb4b['push'](_0x46bb4b['shift']());}};_0x503334(++_0x4321fc);}(_0xf1a4,0x196));var _0x4f1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1a4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4f1a('0x0'));var util=require(_0x4f1a('0x1'));var path=require(_0x4f1a('0x2'));var timeout=require(_0x4f1a('0x3'));var express=require(_0x4f1a('0x4'));var router=express[_0x4f1a('0x5')]();var fs_extra=require(_0x4f1a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4f1a('0x7'));var controller=require(_0x4f1a('0x8'));router[_0x4f1a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4f1a('0xa'),auth['isAuthenticated'](),controller[_0x4f1a('0xb')]);router[_0x4f1a('0xc')]('/',auth[_0x4f1a('0xd')](),controller[_0x4f1a('0xe')]);router[_0x4f1a('0xf')]('/:id',auth[_0x4f1a('0xd')](),controller[_0x4f1a('0x10')]);router['delete'](_0x4f1a('0xa'),auth['isAuthenticated'](),controller[_0x4f1a('0x11')]);module[_0x4f1a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index e2c6d1c..ddf3b52 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 _0x2815=['BOOLEAN','name'];(function(_0x10924a,_0x187ed8){var _0xa6c621=function(_0x15d8bd){while(--_0x15d8bd){_0x10924a['push'](_0x10924a['shift']());}};_0xa6c621(++_0x187ed8);}(_0x2815,0xc5));var _0x5281=function(_0x4dd199,_0x2ec032){_0x4dd199=_0x4dd199-0x0;var _0x3646b4=_0x2815[_0x4dd199];return _0x3646b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5281('0x0')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5281('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfc87=['exports','STRING','BOOLEAN'];(function(_0x221524,_0x5837e8){var _0x40e5e6=function(_0x36278a){while(--_0x36278a){_0x221524['push'](_0x221524['shift']());}};_0x40e5e6(++_0x5837e8);}(_0xfc87,0x12c));var _0x7fc8=function(_0x26c712,_0xcfbc5f){_0x26c712=_0x26c712-0x0;var _0x575834=_0xfc87[_0x26c712];return _0x575834;};'use strict';var Sequelize=require('sequelize');module[_0x7fc8('0x0')]={'name':{'type':Sequelize[_0x7fc8('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x7fc8('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7fc8('0x2')],'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 550f458..3d970e7 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 _0x8a25=['zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Contexts','end','stack','name','send','index','map','VoiceContext','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','type','VIRTUAL','merge','include','findAll','rows','show','params','rawAttributes','includeAll','options','create','body','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','eml-format','rimraf'];(function(_0x7c18a9,_0x535d80){var _0x1126d6=function(_0x485aa7){while(--_0x485aa7){_0x7c18a9['push'](_0x7c18a9['shift']());}};_0x1126d6(++_0x535d80);}(_0x8a25,0x1a2));var _0x58a2=function(_0x778d9d,_0x4024ef){_0x778d9d=_0x778d9d-0x0;var _0x87abf5=_0x8a25[_0x778d9d];return _0x87abf5;};'use strict';var emlformat=require(_0x58a2('0x0'));var rimraf=require(_0x58a2('0x1'));var zipdir=require(_0x58a2('0x2'));var jsonpatch=require(_0x58a2('0x3'));var rp=require(_0x58a2('0x4'));var moment=require(_0x58a2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x58a2('0x6'));var path=require(_0x58a2('0x7'));var sox=require(_0x58a2('0x8'));var csv=require('to-csv');var ejs=require(_0x58a2('0x9'));var fs=require('fs');var fs_extra=require(_0x58a2('0xa'));var _=require(_0x58a2('0xb'));var squel=require(_0x58a2('0xc'));var crypto=require(_0x58a2('0xd'));var jsforce=require(_0x58a2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x58a2('0xf'));var querystring=require(_0x58a2('0x10'));var Papa=require(_0x58a2('0x11'));var Redis=require(_0x58a2('0x12'));var authService=require(_0x58a2('0x13'));var qs=require(_0x58a2('0x14'));var as=require(_0x58a2('0x15'));var hardwareService=require(_0x58a2('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x58a2('0x17'));var config=require(_0x58a2('0x18'));var licenseUtil=require(_0x58a2('0x19'));var db=require(_0x58a2('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x58a2('0x1b')][_0x58a2('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x267e84,_0x5d3f5c,_0x6d4769,_0x54ac3b){return new BPromise(function(_0x14e953,_0x457984){var _0x513f5a=_0x54ac3b||client;return _0x513f5a[_0x58a2('0x1d')](_0x267e84,_0x6d4769)['then'](function(_0x2d9808){logger[_0x58a2('0x1e')](_0x58a2('0x1f'),_0x5d3f5c,_0x58a2('0x20'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5d3f5c,'request\x20sent',JSON[_0x58a2('0x21')](_0x2d9808));if(_0x2d9808[_0x58a2('0x22')]){if(_0x2d9808['error'][_0x58a2('0x23')]===0x1f4){logger[_0x58a2('0x22')](_0x58a2('0x1f'),_0x5d3f5c,_0x2d9808[_0x58a2('0x22')]['message']);return _0x457984(_0x2d9808['error'][_0x58a2('0x24')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x5d3f5c,_0x2d9808['error'][_0x58a2('0x24')]);return _0x14e953(_0x2d9808[_0x58a2('0x22')][_0x58a2('0x24')]);}else{logger[_0x58a2('0x1e')](_0x58a2('0x1f'),_0x5d3f5c,_0x58a2('0x20'));_0x14e953(_0x2d9808[_0x58a2('0x25')][_0x58a2('0x24')]);}})[_0x58a2('0x26')](function(_0x262949){logger[_0x58a2('0x22')](_0x58a2('0x1f'),_0x5d3f5c,_0x262949);_0x457984(_0x262949);});});}function respondWithStatusCode(_0x5a4d35,_0x38880e){_0x38880e=_0x38880e||0xcc;return function(_0x46709a){if(_0x46709a){return _0x5a4d35[_0x58a2('0x27')](_0x38880e);}return _0x5a4d35[_0x58a2('0x28')](_0x38880e)['end']();};}function respondWithResult(_0x4ef232,_0x50c115){_0x50c115=_0x50c115||0xc8;return function(_0x57ef5f){if(_0x57ef5f){return _0x4ef232[_0x58a2('0x28')](_0x50c115)[_0x58a2('0x29')](_0x57ef5f);}};}function respondWithFilteredResult(_0x1ef088,_0x26a8a3){return function(_0x3d4634){if(_0x3d4634){var _0x3e3e08=typeof _0x26a8a3[_0x58a2('0x2a')]===_0x58a2('0x2b')&&typeof _0x26a8a3[_0x58a2('0x2c')]===_0x58a2('0x2b');var _0x3c34e3=_0x3d4634['count'];var _0x152ac5=_0x3e3e08?0x0:_0x26a8a3[_0x58a2('0x2a')];var _0x466e50=_0x3e3e08?_0x3d4634['count']:_0x26a8a3[_0x58a2('0x2a')]+_0x26a8a3[_0x58a2('0x2c')];var _0xc72473;if(_0x466e50>=_0x3c34e3){_0x466e50=_0x3c34e3;_0xc72473=0xc8;}else{_0xc72473=0xce;}_0x1ef088['status'](_0xc72473);return _0x1ef088[_0x58a2('0x2d')](_0x58a2('0x2e'),_0x152ac5+'-'+_0x466e50+'/'+_0x3c34e3)[_0x58a2('0x29')](_0x3d4634);}return null;};}function patchUpdates(_0x4e35b6){return function(_0x577641){try{jsonpatch[_0x58a2('0x2f')](_0x577641,_0x4e35b6,!![]);}catch(_0x583220){return BPromise[_0x58a2('0x30')](_0x583220);}return _0x577641[_0x58a2('0x31')]();};}function saveUpdates(_0x2e15bf,_0x351da6){return function(_0x2fb83f){if(_0x2fb83f){return _0x2fb83f[_0x58a2('0x32')](_0x2e15bf)[_0x58a2('0x33')](function(_0x5d597e){return _0x5d597e;});}return null;};}function removeEntity(_0xa9ab05,_0x1e0523){return function(_0x2c2254){if(_0x2c2254){return _0x2c2254[_0x58a2('0x34')]()[_0x58a2('0x33')](function(){var _0x58b459=_0x2c2254[_0x58a2('0x35')]({'plain':!![]});var _0x36c5e4=_0x58a2('0x36');return db['UserProfileResource'][_0x58a2('0x34')]({'where':{'type':_0x36c5e4,'resourceId':_0x58b459['id']}})[_0x58a2('0x33')](function(){return _0x2c2254;});})['then'](function(){_0xa9ab05[_0x58a2('0x28')](0xcc)[_0x58a2('0x37')]();});}};}function handleEntityNotFound(_0x53dfe5,_0x160390){return function(_0x5c30b9){if(!_0x5c30b9){_0x53dfe5[_0x58a2('0x27')](0x194);}return _0x5c30b9;};}function handleError(_0x40ce8e,_0x1afccc){_0x1afccc=_0x1afccc||0x1f4;return function(_0x4c5a81){logger[_0x58a2('0x22')](_0x4c5a81[_0x58a2('0x38')]);if(_0x4c5a81[_0x58a2('0x39')]){delete _0x4c5a81[_0x58a2('0x39')];}_0x40ce8e['status'](_0x1afccc)[_0x58a2('0x3a')](_0x4c5a81);};}exports[_0x58a2('0x3b')]=function(_0x3a833e,_0x5e7630){var _0x4d8717={},_0x5399a5={},_0x1dc448={'count':0x0,'rows':[]};var _0x19c3c5=_[_0x58a2('0x3c')](db[_0x58a2('0x3d')]['rawAttributes'],function(_0x13a882){return{'name':_0x13a882[_0x58a2('0x3e')],'type':_0x13a882['type'][_0x58a2('0x3f')]};});_0x5399a5['model']=_[_0x58a2('0x3c')](_0x19c3c5,_0x58a2('0x39'));_0x5399a5[_0x58a2('0x40')]=_[_0x58a2('0x41')](_0x3a833e['query']);_0x5399a5[_0x58a2('0x42')]=_[_0x58a2('0x43')](_0x5399a5[_0x58a2('0x44')],_0x5399a5[_0x58a2('0x40')]);_0x4d8717[_0x58a2('0x45')]=_[_0x58a2('0x43')](_0x5399a5[_0x58a2('0x44')],qs[_0x58a2('0x46')](_0x3a833e['query'][_0x58a2('0x46')]));_0x4d8717[_0x58a2('0x45')]=_0x4d8717[_0x58a2('0x45')][_0x58a2('0x47')]?_0x4d8717[_0x58a2('0x45')]:_0x5399a5[_0x58a2('0x44')];if(!_0x3a833e['query']['hasOwnProperty'](_0x58a2('0x48'))){_0x4d8717[_0x58a2('0x2c')]=qs[_0x58a2('0x2c')](_0x3a833e[_0x58a2('0x40')][_0x58a2('0x2c')]);_0x4d8717['offset']=qs[_0x58a2('0x2a')](_0x3a833e[_0x58a2('0x40')]['offset']);}_0x4d8717[_0x58a2('0x49')]=qs[_0x58a2('0x4a')](_0x3a833e[_0x58a2('0x40')][_0x58a2('0x4a')]);_0x4d8717[_0x58a2('0x4b')]=qs[_0x58a2('0x42')](_['pick'](_0x3a833e[_0x58a2('0x40')],_0x5399a5[_0x58a2('0x42')]),_0x19c3c5);if(_0x3a833e[_0x58a2('0x40')]['filter']){_0x4d8717['where']=_['merge'](_0x4d8717[_0x58a2('0x4b')],{'$or':_[_0x58a2('0x3c')](_0x19c3c5,function(_0x4327fb){if(_0x4327fb[_0x58a2('0x4c')]!==_0x58a2('0x4d')){var _0x536601={};_0x536601[_0x4327fb[_0x58a2('0x39')]]={'$like':'%'+_0x3a833e[_0x58a2('0x40')]['filter']+'%'};return _0x536601;}})});}_0x4d8717=_[_0x58a2('0x4e')]({},_0x4d8717,_0x3a833e['options']);var _0x31656c={'where':_0x4d8717[_0x58a2('0x4b')]};return db[_0x58a2('0x3d')]['count'](_0x31656c)[_0x58a2('0x33')](function(_0x433d5b){_0x1dc448['count']=_0x433d5b;if(_0x3a833e[_0x58a2('0x40')]['includeAll']){_0x4d8717[_0x58a2('0x4f')]=[{'all':!![]}];}return db[_0x58a2('0x3d')][_0x58a2('0x50')](_0x4d8717);})[_0x58a2('0x33')](function(_0x3acce5){_0x1dc448[_0x58a2('0x51')]=_0x3acce5;return _0x1dc448;})['then'](respondWithFilteredResult(_0x5e7630,_0x4d8717))[_0x58a2('0x26')](handleError(_0x5e7630,null));};exports[_0x58a2('0x52')]=function(_0x1c59dc,_0x53bce7){var _0x45737a={'raw':![],'where':{'id':_0x1c59dc[_0x58a2('0x53')]['id']}},_0x2cfcf8={};_0x2cfcf8['model']=_[_0x58a2('0x41')](db[_0x58a2('0x3d')][_0x58a2('0x54')]);_0x2cfcf8[_0x58a2('0x40')]=_[_0x58a2('0x41')](_0x1c59dc[_0x58a2('0x40')]);_0x2cfcf8[_0x58a2('0x42')]=_['intersection'](_0x2cfcf8[_0x58a2('0x44')],_0x2cfcf8[_0x58a2('0x40')]);_0x45737a[_0x58a2('0x45')]=_[_0x58a2('0x43')](_0x2cfcf8[_0x58a2('0x44')],qs[_0x58a2('0x46')](_0x1c59dc[_0x58a2('0x40')][_0x58a2('0x46')]));_0x45737a[_0x58a2('0x45')]=_0x45737a[_0x58a2('0x45')][_0x58a2('0x47')]?_0x45737a[_0x58a2('0x45')]:_0x2cfcf8[_0x58a2('0x44')];if(_0x1c59dc[_0x58a2('0x40')][_0x58a2('0x55')]){_0x45737a[_0x58a2('0x4f')]=[{'all':!![]}];}_0x45737a=_[_0x58a2('0x4e')]({},_0x45737a,_0x1c59dc[_0x58a2('0x56')]);return db[_0x58a2('0x3d')]['find'](_0x45737a)[_0x58a2('0x33')](handleEntityNotFound(_0x53bce7,null))[_0x58a2('0x33')](respondWithResult(_0x53bce7,null))['catch'](handleError(_0x53bce7,null));};exports[_0x58a2('0x57')]=function(_0x2b77f5,_0x4b6313,_0x42f85e){var _0x30614b;return db['VoiceContext'][_0x58a2('0x57')](_0x2b77f5[_0x58a2('0x58')],{'raw':!![]})[_0x58a2('0x33')](function(_0x43facf){_0x30614b=_0x43facf;return db['VoiceContext'][_0x58a2('0x50')]({'raw':!![]});})[_0x58a2('0x33')](function(_0x4b49ec){var _0x1cc420=fs[_0x58a2('0x59')](path[_0x58a2('0x5a')](config[_0x58a2('0x5b')],'server/files/templates/context.ejs'),_0x58a2('0x5c'));var _0x2dee4b=ejs[_0x58a2('0x5d')](_0x1cc420,{'contexts':_0x4b49ec||[]});fs[_0x58a2('0x5e')](_0x58a2('0x5f'),_0x2dee4b);})[_0x58a2('0x33')](function(){return respondWithRpcPromise(_0x58a2('0x60'),_0x58a2('0x57'),{'module':_0x58a2('0x61')});})[_0x58a2('0x33')](function(){var _0x1ae410=_0x2b77f5[_0x58a2('0x62')][_0x58a2('0x35')]({'plain':!![]});if(!_0x1ae410)throw new Error(_0x58a2('0x63'));if(_0x1ae410[_0x58a2('0x64')]===_0x58a2('0x62')){var _0x3c4214=_0x30614b[_0x58a2('0x35')]({'plain':!![]});return db[_0x58a2('0x65')][_0x58a2('0x66')]({'where':{'name':_0x58a2('0x36'),'userProfileId':_0x1ae410['userProfileId']},'raw':!![]})['then'](function(_0x42963a){if(_0x42963a&&_0x42963a['autoAssociation']===0x0){return db['UserProfileResource'][_0x58a2('0x57')]({'name':_0x3c4214[_0x58a2('0x39')],'resourceId':_0x3c4214['id'],'type':_0x42963a[_0x58a2('0x39')],'sectionId':_0x42963a['id']},{})[_0x58a2('0x33')](function(){return _0x30614b;});}else{return _0x30614b;}})['catch'](function(_0x53e053){logger[_0x58a2('0x22')](_0x58a2('0x67'),_0x53e053);throw _0x53e053;});}return _0x30614b;})['then'](respondWithResult(_0x4b6313,0xc9))['catch'](handleError(_0x4b6313,null));};exports['update']=function(_0x20b3ac,_0x75c34f,_0x192a09){var _0x138f62;return db['VoiceContext'][_0x58a2('0x66')]({'where':{'id':_0x20b3ac['params']['id']}})[_0x58a2('0x33')](handleEntityNotFound(_0x75c34f,null))[_0x58a2('0x33')](saveUpdates(_0x20b3ac['body'],null))['then'](function(_0x59d54b){if(_0x59d54b){_0x138f62=_0x59d54b;return db[_0x58a2('0x3d')][_0x58a2('0x50')]({'raw':!![]});}})[_0x58a2('0x33')](function(_0x54dcc){var _0x4d9045=fs['readFileSync'](path[_0x58a2('0x5a')](config[_0x58a2('0x5b')],_0x58a2('0x68')),_0x58a2('0x5c'));var _0x45acc0=ejs[_0x58a2('0x5d')](_0x4d9045,{'contexts':_0x54dcc||[]});fs['writeFileSync'](_0x58a2('0x5f'),_0x45acc0);})[_0x58a2('0x33')](function(){return respondWithRpcPromise(_0x58a2('0x60'),_0x58a2('0x32'),{'module':_0x58a2('0x61')});})[_0x58a2('0x33')](function(){return _0x138f62;})[_0x58a2('0x33')](respondWithResult(_0x75c34f,null))['catch'](handleError(_0x75c34f,null));};exports['destroy']=function(_0x4734d3,_0x523fc8,_0x27ce4a){var _0x546127;return db[_0x58a2('0x3d')][_0x58a2('0x66')]({'where':{'id':_0x4734d3[_0x58a2('0x53')]['id']}})[_0x58a2('0x33')](handleEntityNotFound(_0x523fc8,null))[_0x58a2('0x33')](removeEntity(_0x523fc8,null))[_0x58a2('0x33')](function(){return db[_0x58a2('0x3d')][_0x58a2('0x50')]({'raw':!![]});})[_0x58a2('0x33')](function(_0x468582){var _0x3d5ec2=fs['readFileSync'](path[_0x58a2('0x5a')](config[_0x58a2('0x5b')],_0x58a2('0x68')),_0x58a2('0x5c'));var _0x87c8ad=ejs[_0x58a2('0x5d')](_0x3d5ec2,{'contexts':_0x468582});fs['writeFileSync'](_0x58a2('0x5f'),_0x87c8ad);return respondWithRpcPromise(_0x58a2('0x60'),'destroy',{'module':'chan_sip.so'});})[_0x58a2('0x26')](handleError(_0x523fc8,null));}; \ No newline at end of file +var _0x501d=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','findAll','rows','show','params','include','find','create','body','readFileSync','server/files/templates/context.ejs','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','utf8','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','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/license/util','jayson/promise','http','request','then','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','sendStatus','status','end','undefined','limit','count','offset','set','apply','reject','save','update','destroy','Contexts','stack','name','send','map','VoiceContext','rawAttributes','fieldName','type','key','model','query'];(function(_0x37e7a4,_0xb7a496){var _0x269b2a=function(_0x19ee3f){while(--_0x19ee3f){_0x37e7a4['push'](_0x37e7a4['shift']());}};_0x269b2a(++_0xb7a496);}(_0x501d,0x8d));var _0xd501=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x501d[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xd501('0x0'));var rimraf=require(_0xd501('0x1'));var zipdir=require(_0xd501('0x2'));var jsonpatch=require(_0xd501('0x3'));var rp=require(_0xd501('0x4'));var moment=require(_0xd501('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd501('0x6'));var util=require(_0xd501('0x7'));var path=require(_0xd501('0x8'));var sox=require(_0xd501('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd501('0xa'));var _=require(_0xd501('0xb'));var squel=require(_0xd501('0xc'));var crypto=require('crypto');var jsforce=require(_0xd501('0xd'));var deskjs=require(_0xd501('0xe'));var toCsv=require(_0xd501('0xf'));var querystring=require(_0xd501('0x10'));var Papa=require(_0xd501('0x11'));var Redis=require('ioredis');var authService=require(_0xd501('0x12'));var qs=require(_0xd501('0x13'));var as=require(_0xd501('0x14'));var hardwareService=require(_0xd501('0x15'));var logger=require(_0xd501('0x16'))(_0xd501('0x17'));var utils=require(_0xd501('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd501('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd501('0x1a'));var client=jayson['client'][_0xd501('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4ad52e,_0x75bccc,_0x481c38,_0x356f09){return new BPromise(function(_0x3caf26,_0x4bd13b){var _0x45f176=_0x356f09||client;return _0x45f176[_0xd501('0x1c')](_0x4ad52e,_0x481c38)[_0xd501('0x1d')](function(_0x2e5616){logger['info'](_0xd501('0x1e'),_0x75bccc,'request\x20sent');logger['debug'](_0xd501('0x1f'),_0x75bccc,_0xd501('0x20'),JSON['stringify'](_0x2e5616));if(_0x2e5616[_0xd501('0x21')]){if(_0x2e5616[_0xd501('0x21')]['code']===0x1f4){logger[_0xd501('0x21')](_0xd501('0x1e'),_0x75bccc,_0x2e5616[_0xd501('0x21')]['message']);return _0x4bd13b(_0x2e5616[_0xd501('0x21')][_0xd501('0x22')]);}logger[_0xd501('0x21')](_0xd501('0x1e'),_0x75bccc,_0x2e5616[_0xd501('0x21')][_0xd501('0x22')]);return _0x3caf26(_0x2e5616['error'][_0xd501('0x22')]);}else{logger['info'](_0xd501('0x1e'),_0x75bccc,_0xd501('0x20'));_0x3caf26(_0x2e5616['result'][_0xd501('0x22')]);}})[_0xd501('0x23')](function(_0x1b7581){logger[_0xd501('0x21')](_0xd501('0x1e'),_0x75bccc,_0x1b7581);_0x4bd13b(_0x1b7581);});});}function respondWithStatusCode(_0x1927ac,_0x555e49){_0x555e49=_0x555e49||0xcc;return function(_0x14b1a0){if(_0x14b1a0){return _0x1927ac[_0xd501('0x24')](_0x555e49);}return _0x1927ac[_0xd501('0x25')](_0x555e49)[_0xd501('0x26')]();};}function respondWithResult(_0x111c45,_0x54e0e9){_0x54e0e9=_0x54e0e9||0xc8;return function(_0x170e9c){if(_0x170e9c){return _0x111c45[_0xd501('0x25')](_0x54e0e9)['json'](_0x170e9c);}};}function respondWithFilteredResult(_0x1bfd8b,_0x55de83){return function(_0x38d857){if(_0x38d857){var _0x2cc972=typeof _0x55de83['offset']===_0xd501('0x27')&&typeof _0x55de83[_0xd501('0x28')]===_0xd501('0x27');var _0x33da7f=_0x38d857[_0xd501('0x29')];var _0x269065=_0x2cc972?0x0:_0x55de83['offset'];var _0x2e5036=_0x2cc972?_0x38d857[_0xd501('0x29')]:_0x55de83[_0xd501('0x2a')]+_0x55de83[_0xd501('0x28')];var _0xcd99f7;if(_0x2e5036>=_0x33da7f){_0x2e5036=_0x33da7f;_0xcd99f7=0xc8;}else{_0xcd99f7=0xce;}_0x1bfd8b[_0xd501('0x25')](_0xcd99f7);return _0x1bfd8b[_0xd501('0x2b')]('Content-Range',_0x269065+'-'+_0x2e5036+'/'+_0x33da7f)['json'](_0x38d857);}return null;};}function patchUpdates(_0x5cb7e9){return function(_0x4840e2){try{jsonpatch[_0xd501('0x2c')](_0x4840e2,_0x5cb7e9,!![]);}catch(_0x407bd2){return BPromise[_0xd501('0x2d')](_0x407bd2);}return _0x4840e2[_0xd501('0x2e')]();};}function saveUpdates(_0x35d225,_0x5d94a1){return function(_0x58c7c6){if(_0x58c7c6){return _0x58c7c6[_0xd501('0x2f')](_0x35d225)['then'](function(_0x19b609){return _0x19b609;});}return null;};}function removeEntity(_0x6f7d8,_0x57d6ff){return function(_0x242ec2){if(_0x242ec2){return _0x242ec2[_0xd501('0x30')]()[_0xd501('0x1d')](function(){var _0x320081=_0x242ec2['get']({'plain':!![]});var _0x2f43bf=_0xd501('0x31');return db['UserProfileResource'][_0xd501('0x30')]({'where':{'type':_0x2f43bf,'resourceId':_0x320081['id']}})[_0xd501('0x1d')](function(){return _0x242ec2;});})['then'](function(){_0x6f7d8['status'](0xcc)[_0xd501('0x26')]();});}};}function handleEntityNotFound(_0x2baefc,_0x4b708f){return function(_0x5f6b61){if(!_0x5f6b61){_0x2baefc[_0xd501('0x24')](0x194);}return _0x5f6b61;};}function handleError(_0x4853d0,_0x413eb6){_0x413eb6=_0x413eb6||0x1f4;return function(_0x388920){logger[_0xd501('0x21')](_0x388920[_0xd501('0x32')]);if(_0x388920['name']){delete _0x388920[_0xd501('0x33')];}_0x4853d0['status'](_0x413eb6)[_0xd501('0x34')](_0x388920);};}exports['index']=function(_0x4eac12,_0x5347c4){var _0x29dbf3={},_0x5159b8={},_0x45dc96={'count':0x0,'rows':[]};var _0x59f418=_[_0xd501('0x35')](db[_0xd501('0x36')][_0xd501('0x37')],function(_0x5a3bee){return{'name':_0x5a3bee[_0xd501('0x38')],'type':_0x5a3bee[_0xd501('0x39')][_0xd501('0x3a')]};});_0x5159b8[_0xd501('0x3b')]=_[_0xd501('0x35')](_0x59f418,_0xd501('0x33'));_0x5159b8[_0xd501('0x3c')]=_[_0xd501('0x3d')](_0x4eac12['query']);_0x5159b8['filters']=_[_0xd501('0x3e')](_0x5159b8['model'],_0x5159b8[_0xd501('0x3c')]);_0x29dbf3[_0xd501('0x3f')]=_[_0xd501('0x3e')](_0x5159b8[_0xd501('0x3b')],qs['fields'](_0x4eac12[_0xd501('0x3c')][_0xd501('0x40')]));_0x29dbf3[_0xd501('0x3f')]=_0x29dbf3[_0xd501('0x3f')][_0xd501('0x41')]?_0x29dbf3[_0xd501('0x3f')]:_0x5159b8[_0xd501('0x3b')];if(!_0x4eac12['query'][_0xd501('0x42')](_0xd501('0x43'))){_0x29dbf3[_0xd501('0x28')]=qs[_0xd501('0x28')](_0x4eac12[_0xd501('0x3c')]['limit']);_0x29dbf3[_0xd501('0x2a')]=qs[_0xd501('0x2a')](_0x4eac12['query'][_0xd501('0x2a')]);}_0x29dbf3['order']=qs[_0xd501('0x44')](_0x4eac12[_0xd501('0x3c')][_0xd501('0x44')]);_0x29dbf3[_0xd501('0x45')]=qs[_0xd501('0x46')](_['pick'](_0x4eac12[_0xd501('0x3c')],_0x5159b8['filters']),_0x59f418);if(_0x4eac12[_0xd501('0x3c')]['filter']){_0x29dbf3[_0xd501('0x45')]=_['merge'](_0x29dbf3['where'],{'$or':_[_0xd501('0x35')](_0x59f418,function(_0x5d5e16){if(_0x5d5e16['type']!=='VIRTUAL'){var _0x4468ae={};_0x4468ae[_0x5d5e16[_0xd501('0x33')]]={'$like':'%'+_0x4eac12[_0xd501('0x3c')][_0xd501('0x47')]+'%'};return _0x4468ae;}})});}_0x29dbf3=_[_0xd501('0x48')]({},_0x29dbf3,_0x4eac12[_0xd501('0x49')]);var _0x22c408={'where':_0x29dbf3['where']};return db[_0xd501('0x36')][_0xd501('0x29')](_0x22c408)[_0xd501('0x1d')](function(_0xda59cb){_0x45dc96[_0xd501('0x29')]=_0xda59cb;if(_0x4eac12[_0xd501('0x3c')][_0xd501('0x4a')]){_0x29dbf3['include']=[{'all':!![]}];}return db[_0xd501('0x36')][_0xd501('0x4b')](_0x29dbf3);})['then'](function(_0x22c631){_0x45dc96[_0xd501('0x4c')]=_0x22c631;return _0x45dc96;})[_0xd501('0x1d')](respondWithFilteredResult(_0x5347c4,_0x29dbf3))[_0xd501('0x23')](handleError(_0x5347c4,null));};exports[_0xd501('0x4d')]=function(_0x5762a2,_0x3b4e87){var _0x39fabf={'raw':![],'where':{'id':_0x5762a2[_0xd501('0x4e')]['id']}},_0x1820ef={};_0x1820ef[_0xd501('0x3b')]=_['keys'](db['VoiceContext'][_0xd501('0x37')]);_0x1820ef[_0xd501('0x3c')]=_[_0xd501('0x3d')](_0x5762a2[_0xd501('0x3c')]);_0x1820ef[_0xd501('0x46')]=_[_0xd501('0x3e')](_0x1820ef[_0xd501('0x3b')],_0x1820ef[_0xd501('0x3c')]);_0x39fabf[_0xd501('0x3f')]=_[_0xd501('0x3e')](_0x1820ef[_0xd501('0x3b')],qs[_0xd501('0x40')](_0x5762a2[_0xd501('0x3c')][_0xd501('0x40')]));_0x39fabf['attributes']=_0x39fabf[_0xd501('0x3f')][_0xd501('0x41')]?_0x39fabf[_0xd501('0x3f')]:_0x1820ef['model'];if(_0x5762a2[_0xd501('0x3c')]['includeAll']){_0x39fabf[_0xd501('0x4f')]=[{'all':!![]}];}_0x39fabf=_[_0xd501('0x48')]({},_0x39fabf,_0x5762a2[_0xd501('0x49')]);return db[_0xd501('0x36')][_0xd501('0x50')](_0x39fabf)[_0xd501('0x1d')](handleEntityNotFound(_0x3b4e87,null))[_0xd501('0x1d')](respondWithResult(_0x3b4e87,null))[_0xd501('0x23')](handleError(_0x3b4e87,null));};exports['create']=function(_0x178155,_0x4e7f2f,_0x302d90){var _0x2e0274;return db[_0xd501('0x36')][_0xd501('0x51')](_0x178155[_0xd501('0x52')],{'raw':!![]})[_0xd501('0x1d')](function(_0x135613){_0x2e0274=_0x135613;return db['VoiceContext'][_0xd501('0x4b')]({'raw':!![]});})['then'](function(_0x46d1ba){var _0x472566=fs[_0xd501('0x53')](path['join'](config['root'],_0xd501('0x54')),'utf8');var _0x322812=ejs[_0xd501('0x55')](_0x472566,{'contexts':_0x46d1ba||[]});fs[_0xd501('0x56')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x322812);})[_0xd501('0x1d')](function(){return respondWithRpcPromise(_0xd501('0x57'),'create',{'module':_0xd501('0x58')});})[_0xd501('0x1d')](function(){var _0x957614=_0x178155[_0xd501('0x59')]['get']({'plain':!![]});if(!_0x957614)throw new Error(_0xd501('0x5a'));if(_0x957614[_0xd501('0x5b')]==='user'){var _0x1f8fb3=_0x2e0274['get']({'plain':!![]});return db[_0xd501('0x5c')][_0xd501('0x50')]({'where':{'name':_0xd501('0x31'),'userProfileId':_0x957614[_0xd501('0x5d')]},'raw':!![]})['then'](function(_0x5af69c){if(_0x5af69c&&_0x5af69c[_0xd501('0x5e')]===0x0){return db[_0xd501('0x5f')][_0xd501('0x51')]({'name':_0x1f8fb3[_0xd501('0x33')],'resourceId':_0x1f8fb3['id'],'type':_0x5af69c[_0xd501('0x33')],'sectionId':_0x5af69c['id']},{})['then'](function(){return _0x2e0274;});}else{return _0x2e0274;}})[_0xd501('0x23')](function(_0x5b346d){logger[_0xd501('0x21')](_0xd501('0x60'),_0x5b346d);throw _0x5b346d;});}return _0x2e0274;})[_0xd501('0x1d')](respondWithResult(_0x4e7f2f,0xc9))[_0xd501('0x23')](handleError(_0x4e7f2f,null));};exports[_0xd501('0x2f')]=function(_0x3b37a1,_0xf2f850,_0xcd6715){var _0x108242;return db[_0xd501('0x36')]['find']({'where':{'id':_0x3b37a1[_0xd501('0x4e')]['id']}})[_0xd501('0x1d')](handleEntityNotFound(_0xf2f850,null))[_0xd501('0x1d')](saveUpdates(_0x3b37a1[_0xd501('0x52')],null))['then'](function(_0x3b14b3){if(_0x3b14b3){_0x108242=_0x3b14b3;return db[_0xd501('0x36')][_0xd501('0x4b')]({'raw':!![]});}})[_0xd501('0x1d')](function(_0x57c0d3){var _0x5df6df=fs['readFileSync'](path[_0xd501('0x61')](config[_0xd501('0x62')],_0xd501('0x54')),_0xd501('0x63'));var _0x13959b=ejs['render'](_0x5df6df,{'contexts':_0x57c0d3||[]});fs[_0xd501('0x56')](_0xd501('0x64'),_0x13959b);})[_0xd501('0x1d')](function(){return respondWithRpcPromise('Reload',_0xd501('0x2f'),{'module':_0xd501('0x58')});})[_0xd501('0x1d')](function(){return _0x108242;})[_0xd501('0x1d')](respondWithResult(_0xf2f850,null))['catch'](handleError(_0xf2f850,null));};exports[_0xd501('0x30')]=function(_0x454dce,_0x3e8d5f,_0x8e0dd2){var _0x4ca405;return db[_0xd501('0x36')][_0xd501('0x50')]({'where':{'id':_0x454dce[_0xd501('0x4e')]['id']}})[_0xd501('0x1d')](handleEntityNotFound(_0x3e8d5f,null))[_0xd501('0x1d')](removeEntity(_0x3e8d5f,null))[_0xd501('0x1d')](function(){return db['VoiceContext'][_0xd501('0x4b')]({'raw':!![]});})[_0xd501('0x1d')](function(_0x4dbca7){var _0x43942a=fs[_0xd501('0x53')](path[_0xd501('0x61')](config['root'],_0xd501('0x54')),_0xd501('0x63'));var _0x29fd4c=ejs[_0xd501('0x55')](_0x43942a,{'contexts':_0x4dbca7});fs[_0xd501('0x56')](_0xd501('0x64'),_0x29fd4c);return respondWithRpcPromise(_0xd501('0x57'),'destroy',{'module':_0xd501('0x58')});})['catch'](handleError(_0x3e8d5f,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 31d251d..4bae4e3 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 _0xb652=['util','api','rimraf','./voiceContext.attributes','exports','voice_contexts'];(function(_0xfe26da,_0x5ac1b7){var _0x2abe6e=function(_0x586ea1){while(--_0x586ea1){_0xfe26da['push'](_0xfe26da['shift']());}};_0x2abe6e(++_0x5ac1b7);}(_0xb652,0x1ce));var _0x2b65=function(_0x22edf7,_0x528a09){_0x22edf7=_0x22edf7-0x0;var _0x4b4829=_0xb652[_0x22edf7];return _0x4b4829;};'use strict';var _=require('lodash');var util=require(_0x2b65('0x0'));var logger=require('../../config/logger')(_0x2b65('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2b65('0x2'));var config=require('../../config/environment');var attributes=require(_0x2b65('0x3'));module[_0x2b65('0x4')]=function(_0x23c03e,_0x2c20b4){return _0x23c03e['define']('VoiceContext',attributes,{'tableName':_0x2b65('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd237=['path','rimraf','../../config/environment','./voiceContext.attributes','voice_contexts','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x388493,_0x23301e){var _0x5300a1=function(_0x1d9c91){while(--_0x1d9c91){_0x388493['push'](_0x388493['shift']());}};_0x5300a1(++_0x23301e);}(_0xd237,0x14f));var _0x7d23=function(_0x49a181,_0x4745ae){_0x49a181=_0x49a181-0x0;var _0xa5733f=_0xd237[_0x49a181];return _0xa5733f;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var logger=require(_0x7d23('0x2'))(_0x7d23('0x3'));var moment=require('moment');var BPromise=require(_0x7d23('0x4'));var rp=require(_0x7d23('0x5'));var fs=require('fs');var path=require(_0x7d23('0x6'));var rimraf=require(_0x7d23('0x7'));var config=require(_0x7d23('0x8'));var attributes=require(_0x7d23('0x9'));module['exports']=function(_0x24f10b,_0x5e9d09){return _0x24f10b['define']('VoiceContext',attributes,{'tableName':_0x7d23('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 548c58d..00ca47b 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 _0xeb00=['then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0xeb00,0x129));var _0x0eb0=function(_0x1c1099,_0xb3dfa4){_0x1c1099=_0x1c1099-0x0;var _0x137178=_0xeb00[_0x1c1099];return _0x137178;};'use strict';var _=require(_0x0eb0('0x0'));var util=require('util');var moment=require(_0x0eb0('0x1'));var BPromise=require(_0x0eb0('0x2'));var rs=require(_0x0eb0('0x3'));var fs=require('fs');var Redis=require(_0x0eb0('0x4'));var db=require(_0x0eb0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0eb0('0x6'));var config=require(_0x0eb0('0x7'));var jayson=require(_0x0eb0('0x8'));var client=jayson[_0x0eb0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x440e92,_0x44d592,_0x247477){return new BPromise(function(_0x25ad9e,_0x77c7a6){return client[_0x0eb0('0xa')](_0x440e92,_0x247477)[_0x0eb0('0xb')](function(_0x409f32){logger[_0x0eb0('0xc')](_0x0eb0('0xd'),_0x44d592,'request\x20sent');logger[_0x0eb0('0xe')](_0x0eb0('0xf'),_0x44d592,_0x0eb0('0x10'),JSON[_0x0eb0('0x11')](_0x409f32));if(_0x409f32['error']){if(_0x409f32[_0x0eb0('0x12')][_0x0eb0('0x13')]===0x1f4){logger[_0x0eb0('0x12')]('VoiceContext,\x20%s,\x20%s',_0x44d592,_0x409f32['error']['message']);return _0x77c7a6(_0x409f32[_0x0eb0('0x12')]['message']);}logger['error'](_0x0eb0('0xd'),_0x44d592,_0x409f32[_0x0eb0('0x12')]['message']);return _0x25ad9e(_0x409f32[_0x0eb0('0x12')][_0x0eb0('0x14')]);}else{logger[_0x0eb0('0xc')]('VoiceContext,\x20%s,\x20%s',_0x44d592,'request\x20sent');_0x25ad9e(_0x409f32[_0x0eb0('0x15')][_0x0eb0('0x14')]);}})['catch'](function(_0x28c3f1){logger[_0x0eb0('0x12')](_0x0eb0('0xd'),_0x44d592,_0x28c3f1);_0x77c7a6(_0x28c3f1);});});} \ No newline at end of file +var _0x1a4d=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../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','stringify','error','code'];(function(_0x465cbe,_0x1a3b8d){var _0x5e81c5=function(_0x190a1e){while(--_0x190a1e){_0x465cbe['push'](_0x465cbe['shift']());}};_0x5e81c5(++_0x1a3b8d);}(_0x1a4d,0x189));var _0xd1a4=function(_0x60ee71,_0x45e411){_0x60ee71=_0x60ee71-0x0;var _0x4db390=_0x1a4d[_0x60ee71];return _0x4db390;};'use strict';var _=require(_0xd1a4('0x0'));var util=require(_0xd1a4('0x1'));var moment=require('moment');var BPromise=require(_0xd1a4('0x2'));var rs=require(_0xd1a4('0x3'));var fs=require('fs');var Redis=require(_0xd1a4('0x4'));var db=require(_0xd1a4('0x5'))['db'];var utils=require(_0xd1a4('0x6'));var logger=require(_0xd1a4('0x7'))(_0xd1a4('0x8'));var config=require(_0xd1a4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd1a4('0xa')][_0xd1a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29010f,_0x37f83c,_0x238061){return new BPromise(function(_0x86c4e4,_0xb89e6){return client[_0xd1a4('0xc')](_0x29010f,_0x238061)[_0xd1a4('0xd')](function(_0x1c6c5d){logger['info'](_0xd1a4('0xe'),_0x37f83c,'request\x20sent');logger[_0xd1a4('0xf')](_0xd1a4('0x10'),_0x37f83c,_0xd1a4('0x11'),JSON[_0xd1a4('0x12')](_0x1c6c5d));if(_0x1c6c5d[_0xd1a4('0x13')]){if(_0x1c6c5d[_0xd1a4('0x13')][_0xd1a4('0x14')]===0x1f4){logger[_0xd1a4('0x13')](_0xd1a4('0xe'),_0x37f83c,_0x1c6c5d[_0xd1a4('0x13')]['message']);return _0xb89e6(_0x1c6c5d[_0xd1a4('0x13')]['message']);}logger[_0xd1a4('0x13')](_0xd1a4('0xe'),_0x37f83c,_0x1c6c5d[_0xd1a4('0x13')]['message']);return _0x86c4e4(_0x1c6c5d[_0xd1a4('0x13')][_0xd1a4('0x15')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x37f83c,_0xd1a4('0x11'));_0x86c4e4(_0x1c6c5d['result']['message']);}})[_0xd1a4('0x16')](function(_0x426a47){logger['error'](_0xd1a4('0xe'),_0x37f83c,_0x426a47);_0xb89e6(_0x426a47);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 50ffc07..fef72a6 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 _0x53d0=['isAuthenticated','create','put','/:id','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','describe','show','post'];(function(_0x52ec13,_0xb520ab){var _0x4bf818=function(_0x31a40a){while(--_0x31a40a){_0x52ec13['push'](_0x52ec13['shift']());}};_0x4bf818(++_0xb520ab);}(_0x53d0,0x6c));var _0x053d=function(_0x3e9d20,_0x16afdd){_0x3e9d20=_0x3e9d20-0x0;var _0x1e21a2=_0x53d0[_0x3e9d20];return _0x1e21a2;};'use strict';var multer=require('multer');var util=require(_0x053d('0x0'));var path=require(_0x053d('0x1'));var timeout=require('connect-timeout');var express=require(_0x053d('0x2'));var router=express['Router']();var fs_extra=require(_0x053d('0x3'));var auth=require(_0x053d('0x4'));var interaction=require(_0x053d('0x5'));var config=require(_0x053d('0x6'));var controller=require(_0x053d('0x7'));router[_0x053d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x053d('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x053d('0x9')]);router[_0x053d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x053d('0xa')]);router[_0x053d('0xb')]('/',auth[_0x053d('0xc')](),controller[_0x053d('0xd')]);router[_0x053d('0xe')](_0x053d('0xf'),auth[_0x053d('0xc')](),controller[_0x053d('0x10')]);router[_0x053d('0x11')](_0x053d('0xf'),auth[_0x053d('0xc')](),controller[_0x053d('0x12')]);module[_0x053d('0x13')]=router; \ No newline at end of file +var _0xfa71=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','put','update'];(function(_0x487a0b,_0x33c302){var _0x4cb1ba=function(_0x2a3615){while(--_0x2a3615){_0x487a0b['push'](_0x487a0b['shift']());}};_0x4cb1ba(++_0x33c302);}(_0xfa71,0xa2));var _0x1fa7=function(_0x1414b3,_0x477031){_0x1414b3=_0x1414b3-0x0;var _0x5761ab=_0xfa71[_0x1414b3];return _0x5761ab;};'use strict';var multer=require(_0x1fa7('0x0'));var util=require(_0x1fa7('0x1'));var path=require(_0x1fa7('0x2'));var timeout=require(_0x1fa7('0x3'));var express=require(_0x1fa7('0x4'));var router=express[_0x1fa7('0x5')]();var fs_extra=require(_0x1fa7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1fa7('0x7'));var config=require(_0x1fa7('0x8'));var controller=require('./voiceDialReport.controller');router[_0x1fa7('0x9')]('/',auth[_0x1fa7('0xa')](),controller[_0x1fa7('0xb')]);router[_0x1fa7('0x9')](_0x1fa7('0xc'),auth[_0x1fa7('0xa')](),controller[_0x1fa7('0xd')]);router[_0x1fa7('0x9')](_0x1fa7('0xe'),auth[_0x1fa7('0xa')](),controller['show']);router[_0x1fa7('0xf')]('/',auth[_0x1fa7('0xa')](),controller['create']);router[_0x1fa7('0x10')](_0x1fa7('0xe'),auth['isAuthenticated'](),controller[_0x1fa7('0x11')]);router[_0x1fa7('0x12')](_0x1fa7('0xe'),auth[_0x1fa7('0xa')](),controller['destroy']);module[_0x1fa7('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 58ebf99..13f3353 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(_0x4bb265,_0x5a3252){var _0x33430a=function(_0x16c049){while(--_0x16c049){_0x4bb265['push'](_0x4bb265['shift']());}};_0x33430a(++_0x5a3252);}(_0x84ab,0x12f));var _0xb84a=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x84ab[_0x2a55f8];return _0x245efd;};'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 _0xe5b3=['STRING','INTEGER','DATE','exports'];(function(_0x29f56c,_0x2d2032){var _0x4f10bf=function(_0x106d12){while(--_0x106d12){_0x29f56c['push'](_0x29f56c['shift']());}};_0x4f10bf(++_0x2d2032);}(_0xe5b3,0x133));var _0x3e5b=function(_0x28c64e,_0x40d01a){_0x28c64e=_0x28c64e-0x0;var _0x2b0012=_0xe5b3[_0x28c64e];return _0x2b0012;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'privilege':{'type':Sequelize[_0x3e5b('0x1')]},'channel':{'type':Sequelize[_0x3e5b('0x1')]},'channelstate':{'type':Sequelize[_0x3e5b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'calleridnum':{'type':Sequelize[_0x3e5b('0x1')]},'calleridname':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'language':{'type':Sequelize[_0x3e5b('0x1')]},'accountcode':{'type':Sequelize[_0x3e5b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3e5b('0x1')]},'priority':{'type':Sequelize[_0x3e5b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3e5b('0x1')]},'destchannel':{'type':Sequelize[_0x3e5b('0x1')]},'destchannelstate':{'type':Sequelize[_0x3e5b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'destlanguage':{'type':Sequelize[_0x3e5b('0x1')]},'destaccountcode':{'type':Sequelize[_0x3e5b('0x1')]},'destcontext':{'type':Sequelize[_0x3e5b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e5b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x3e5b('0x1')]},'dialstring':{'type':Sequelize[_0x3e5b('0x1')]},'dialstatus':{'type':Sequelize[_0x3e5b('0x1')]},'starttime':{'type':Sequelize[_0x3e5b('0x3')]},'answertime':{'type':Sequelize[_0x3e5b('0x3')]},'endtime':{'type':Sequelize[_0x3e5b('0x3')]},'lastevent':{'type':Sequelize[_0x3e5b('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x3e5b('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index e4cadbe..e0f3cd1 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 _0x803e=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','offset','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x256341,_0x2169e8){var _0x377b74=function(_0x135e70){while(--_0x135e70){_0x256341['push'](_0x256341['shift']());}};_0x377b74(++_0x2169e8);}(_0x803e,0x83));var _0xe803=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x803e[_0x1b3a5c];return _0x2ae8cb;};'use strict';var emlformat=require(_0xe803('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe803('0x1'));var jsonpatch=require(_0xe803('0x2'));var rp=require('request-promise');var moment=require(_0xe803('0x3'));var BPromise=require(_0xe803('0x4'));var Mustache=require('mustache');var util=require(_0xe803('0x5'));var path=require('path');var sox=require(_0xe803('0x6'));var csv=require(_0xe803('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe803('0x8'));var _=require(_0xe803('0x9'));var squel=require(_0xe803('0xa'));var crypto=require('crypto');var jsforce=require(_0xe803('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe803('0x7'));var querystring=require(_0xe803('0xc'));var Papa=require(_0xe803('0xd'));var Redis=require('ioredis');var authService=require(_0xe803('0xe'));var qs=require(_0xe803('0xf'));var as=require(_0xe803('0x10'));var hardwareService=require(_0xe803('0x11'));var logger=require(_0xe803('0x12'))('api');var utils=require(_0xe803('0x13'));var config=require(_0xe803('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe803('0x15'))['db'];function respondWithStatusCode(_0x588e12,_0x59eac5){_0x59eac5=_0x59eac5||0xcc;return function(_0x3e5b8f){if(_0x3e5b8f){return _0x588e12['sendStatus'](_0x59eac5);}return _0x588e12[_0xe803('0x16')](_0x59eac5)['end']();};}function respondWithResult(_0xd6e5f3,_0x4f9673){_0x4f9673=_0x4f9673||0xc8;return function(_0x3fc264){if(_0x3fc264){return _0xd6e5f3[_0xe803('0x16')](_0x4f9673)[_0xe803('0x17')](_0x3fc264);}};}function respondWithFilteredResult(_0x5e37ef,_0x13619f){return function(_0x2f9f6c){if(_0x2f9f6c){var _0x57b449=typeof _0x13619f['offset']===_0xe803('0x18')&&typeof _0x13619f['limit']===_0xe803('0x18');var _0x2b1584=_0x2f9f6c[_0xe803('0x19')];var _0x1dc14f=_0x57b449?0x0:_0x13619f['offset'];var _0x398df8=_0x57b449?_0x2f9f6c[_0xe803('0x19')]:_0x13619f['offset']+_0x13619f[_0xe803('0x1a')];var _0x44a0bd;if(_0x398df8>=_0x2b1584){_0x398df8=_0x2b1584;_0x44a0bd=0xc8;}else{_0x44a0bd=0xce;}_0x5e37ef[_0xe803('0x16')](_0x44a0bd);return _0x5e37ef[_0xe803('0x1b')](_0xe803('0x1c'),_0x1dc14f+'-'+_0x398df8+'/'+_0x2b1584)[_0xe803('0x17')](_0x2f9f6c);}return null;};}function patchUpdates(_0x75887a){return function(_0x92c154){try{jsonpatch[_0xe803('0x1d')](_0x92c154,_0x75887a,!![]);}catch(_0x5b2a88){return BPromise[_0xe803('0x1e')](_0x5b2a88);}return _0x92c154[_0xe803('0x1f')]();};}function saveUpdates(_0xbb21c0,_0x2748fb){return function(_0x11c94e){if(_0x11c94e){return _0x11c94e[_0xe803('0x20')](_0xbb21c0)['then'](function(_0x1edffa){return _0x1edffa;});}return null;};}function removeEntity(_0x48dadc,_0x1904d6){return function(_0x5253f9){if(_0x5253f9){return _0x5253f9[_0xe803('0x21')]()[_0xe803('0x22')](function(){_0x48dadc['status'](0xcc)[_0xe803('0x23')]();});}};}function handleEntityNotFound(_0x4c10a6,_0x433568){return function(_0x2508d8){if(!_0x2508d8){_0x4c10a6[_0xe803('0x24')](0x194);}return _0x2508d8;};}function handleError(_0x1aacf8,_0x4d92fd){_0x4d92fd=_0x4d92fd||0x1f4;return function(_0xc43e76){logger[_0xe803('0x25')](_0xc43e76[_0xe803('0x26')]);if(_0xc43e76['name']){delete _0xc43e76['name'];}_0x1aacf8[_0xe803('0x16')](_0x4d92fd)['send'](_0xc43e76);};}exports[_0xe803('0x27')]=function(_0xf7464c,_0x302f4a){var _0x463957={},_0x42c596={},_0x45f9e4={'count':0x0,'rows':[]};var _0x426014=_[_0xe803('0x28')](db[_0xe803('0x29')][_0xe803('0x2a')],function(_0x513929){return{'name':_0x513929[_0xe803('0x2b')],'type':_0x513929[_0xe803('0x2c')][_0xe803('0x2d')]};});_0x42c596['model']=_[_0xe803('0x28')](_0x426014,_0xe803('0x2e'));_0x42c596[_0xe803('0x2f')]=_[_0xe803('0x30')](_0xf7464c[_0xe803('0x2f')]);_0x42c596[_0xe803('0x31')]=_[_0xe803('0x32')](_0x42c596[_0xe803('0x33')],_0x42c596['query']);_0x463957[_0xe803('0x34')]=_['intersection'](_0x42c596['model'],qs['fields'](_0xf7464c[_0xe803('0x2f')][_0xe803('0x35')]));_0x463957['attributes']=_0x463957[_0xe803('0x34')][_0xe803('0x36')]?_0x463957[_0xe803('0x34')]:_0x42c596[_0xe803('0x33')];if(!_0xf7464c[_0xe803('0x2f')][_0xe803('0x37')]('nolimit')){_0x463957['limit']=qs['limit'](_0xf7464c['query']['limit']);_0x463957['offset']=qs[_0xe803('0x38')](_0xf7464c[_0xe803('0x2f')][_0xe803('0x38')]);}_0x463957['order']=qs[_0xe803('0x39')](_0xf7464c[_0xe803('0x2f')]['sort']);_0x463957['where']=qs[_0xe803('0x31')](_[_0xe803('0x3a')](_0xf7464c[_0xe803('0x2f')],_0x42c596[_0xe803('0x31')]),_0x426014);if(_0xf7464c['query']['filter']){_0x463957[_0xe803('0x3b')]=_[_0xe803('0x3c')](_0x463957['where'],{'$or':_[_0xe803('0x28')](_0x426014,function(_0x3b4f9a){if(_0x3b4f9a[_0xe803('0x2c')]!==_0xe803('0x3d')){var _0x4be0bc={};_0x4be0bc[_0x3b4f9a[_0xe803('0x2e')]]={'$like':'%'+_0xf7464c['query'][_0xe803('0x3e')]+'%'};return _0x4be0bc;}})});}_0x463957=_[_0xe803('0x3c')]({},_0x463957,_0xf7464c['options']);var _0x31b533={'where':_0x463957[_0xe803('0x3b')]};return db[_0xe803('0x29')]['count'](_0x31b533)[_0xe803('0x22')](function(_0x405b88){_0x45f9e4[_0xe803('0x19')]=_0x405b88;if(_0xf7464c[_0xe803('0x2f')][_0xe803('0x3f')]){_0x463957[_0xe803('0x40')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xe803('0x41')](_0x463957);})[_0xe803('0x22')](function(_0x36477b){_0x45f9e4[_0xe803('0x42')]=_0x36477b;return _0x45f9e4;})[_0xe803('0x22')](respondWithFilteredResult(_0x302f4a,_0x463957))[_0xe803('0x43')](handleError(_0x302f4a,null));};exports[_0xe803('0x44')]=function(_0x4b75ee,_0x21ea3a){var _0x5f806c={'raw':!![],'where':{'id':_0x4b75ee[_0xe803('0x45')]['id']}},_0x874795={};_0x874795[_0xe803('0x33')]=_[_0xe803('0x30')](db[_0xe803('0x29')][_0xe803('0x2a')]);_0x874795[_0xe803('0x2f')]=_[_0xe803('0x30')](_0x4b75ee['query']);_0x874795[_0xe803('0x31')]=_[_0xe803('0x32')](_0x874795['model'],_0x874795[_0xe803('0x2f')]);_0x5f806c[_0xe803('0x34')]=_[_0xe803('0x32')](_0x874795[_0xe803('0x33')],qs['fields'](_0x4b75ee[_0xe803('0x2f')][_0xe803('0x35')]));_0x5f806c[_0xe803('0x34')]=_0x5f806c[_0xe803('0x34')][_0xe803('0x36')]?_0x5f806c[_0xe803('0x34')]:_0x874795[_0xe803('0x33')];if(_0x4b75ee['query'][_0xe803('0x3f')]){_0x5f806c['include']=[{'all':!![]}];}_0x5f806c=_[_0xe803('0x3c')]({},_0x5f806c,_0x4b75ee['options']);return db['VoiceDialReport'][_0xe803('0x46')](_0x5f806c)[_0xe803('0x22')](handleEntityNotFound(_0x21ea3a,null))[_0xe803('0x22')](respondWithResult(_0x21ea3a,null))[_0xe803('0x43')](handleError(_0x21ea3a,null));};exports[_0xe803('0x47')]=function(_0x52470d,_0x352205){return db[_0xe803('0x29')][_0xe803('0x47')](_0x52470d['body'],{})[_0xe803('0x22')](respondWithResult(_0x352205,0xc9))[_0xe803('0x43')](handleError(_0x352205,null));};exports[_0xe803('0x20')]=function(_0x45306f,_0x12f518){if(_0x45306f[_0xe803('0x48')]['id']){delete _0x45306f['body']['id'];}return db[_0xe803('0x29')][_0xe803('0x46')]({'where':{'id':_0x45306f['params']['id']}})['then'](handleEntityNotFound(_0x12f518,null))['then'](saveUpdates(_0x45306f['body'],null))[_0xe803('0x22')](respondWithResult(_0x12f518,null))[_0xe803('0x43')](handleError(_0x12f518,null));};exports[_0xe803('0x21')]=function(_0x260b06,_0x5c28a6){return db['VoiceDialReport'][_0xe803('0x46')]({'where':{'id':_0x260b06[_0xe803('0x45')]['id']}})[_0xe803('0x22')](handleEntityNotFound(_0x5c28a6,null))[_0xe803('0x22')](removeEntity(_0x5c28a6,null))[_0xe803('0x43')](handleError(_0x5c28a6,null));};exports[_0xe803('0x49')]=function(_0x19a93b,_0x32bc6a){return db[_0xe803('0x29')]['describe']()[_0xe803('0x22')](respondWithResult(_0x32bc6a,null))[_0xe803('0x43')](handleError(_0x32bc6a,null));}; \ No newline at end of file +var _0x0bea=['includeAll','include','catch','show','params','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../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','apply','reject','save','update','destroy','then','error','stack','name','index','map','VoiceDialReport','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options'];(function(_0x2f52e3,_0x2066f5){var _0x43e4bc=function(_0x4ecfa8){while(--_0x4ecfa8){_0x2f52e3['push'](_0x2f52e3['shift']());}};_0x43e4bc(++_0x2066f5);}(_0x0bea,0x9d));var _0xa0be=function(_0x2b38f7,_0x3897af){_0x2b38f7=_0x2b38f7-0x0;var _0x4f8e27=_0x0bea[_0x2b38f7];return _0x4f8e27;};'use strict';var emlformat=require(_0xa0be('0x0'));var rimraf=require(_0xa0be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa0be('0x2'));var moment=require(_0xa0be('0x3'));var BPromise=require(_0xa0be('0x4'));var Mustache=require(_0xa0be('0x5'));var util=require(_0xa0be('0x6'));var path=require(_0xa0be('0x7'));var sox=require(_0xa0be('0x8'));var csv=require(_0xa0be('0x9'));var ejs=require(_0xa0be('0xa'));var fs=require('fs');var fs_extra=require(_0xa0be('0xb'));var _=require(_0xa0be('0xc'));var squel=require(_0xa0be('0xd'));var crypto=require('crypto');var jsforce=require(_0xa0be('0xe'));var deskjs=require(_0xa0be('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa0be('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa0be('0x11'));var as=require(_0xa0be('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0be('0x13'))(_0xa0be('0x14'));var utils=require(_0xa0be('0x15'));var config=require(_0xa0be('0x16'));var licenseUtil=require(_0xa0be('0x17'));var db=require(_0xa0be('0x18'))['db'];function respondWithStatusCode(_0x4e13e5,_0x229073){_0x229073=_0x229073||0xcc;return function(_0x2fceca){if(_0x2fceca){return _0x4e13e5['sendStatus'](_0x229073);}return _0x4e13e5[_0xa0be('0x19')](_0x229073)[_0xa0be('0x1a')]();};}function respondWithResult(_0x5ca1f8,_0x5c143a){_0x5c143a=_0x5c143a||0xc8;return function(_0x25092f){if(_0x25092f){return _0x5ca1f8['status'](_0x5c143a)[_0xa0be('0x1b')](_0x25092f);}};}function respondWithFilteredResult(_0x1e5392,_0x5dbfd1){return function(_0x5b387b){if(_0x5b387b){var _0x432f9b=typeof _0x5dbfd1[_0xa0be('0x1c')]===_0xa0be('0x1d')&&typeof _0x5dbfd1[_0xa0be('0x1e')]==='undefined';var _0x1da70c=_0x5b387b[_0xa0be('0x1f')];var _0x4813a6=_0x432f9b?0x0:_0x5dbfd1[_0xa0be('0x1c')];var _0xa89dbe=_0x432f9b?_0x5b387b['count']:_0x5dbfd1['offset']+_0x5dbfd1[_0xa0be('0x1e')];var _0x3d2630;if(_0xa89dbe>=_0x1da70c){_0xa89dbe=_0x1da70c;_0x3d2630=0xc8;}else{_0x3d2630=0xce;}_0x1e5392[_0xa0be('0x19')](_0x3d2630);return _0x1e5392[_0xa0be('0x20')](_0xa0be('0x21'),_0x4813a6+'-'+_0xa89dbe+'/'+_0x1da70c)['json'](_0x5b387b);}return null;};}function patchUpdates(_0x2fdaf0){return function(_0x2dbe34){try{jsonpatch[_0xa0be('0x22')](_0x2dbe34,_0x2fdaf0,!![]);}catch(_0x29a567){return BPromise[_0xa0be('0x23')](_0x29a567);}return _0x2dbe34[_0xa0be('0x24')]();};}function saveUpdates(_0x463a3f,_0x1b35ab){return function(_0x44b2dd){if(_0x44b2dd){return _0x44b2dd[_0xa0be('0x25')](_0x463a3f)['then'](function(_0x1c7fe5){return _0x1c7fe5;});}return null;};}function removeEntity(_0x6588d7,_0x39230e){return function(_0x2185b7){if(_0x2185b7){return _0x2185b7[_0xa0be('0x26')]()[_0xa0be('0x27')](function(){_0x6588d7[_0xa0be('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a68ed,_0x437de9){return function(_0x56698b){if(!_0x56698b){_0x1a68ed['sendStatus'](0x194);}return _0x56698b;};}function handleError(_0x214284,_0x3d444b){_0x3d444b=_0x3d444b||0x1f4;return function(_0x14b8b9){logger[_0xa0be('0x28')](_0x14b8b9[_0xa0be('0x29')]);if(_0x14b8b9[_0xa0be('0x2a')]){delete _0x14b8b9[_0xa0be('0x2a')];}_0x214284[_0xa0be('0x19')](_0x3d444b)['send'](_0x14b8b9);};}exports[_0xa0be('0x2b')]=function(_0x158e51,_0xb8d25f){var _0x3ceade={},_0x18dff6={},_0x5d02cb={'count':0x0,'rows':[]};var _0x33170b=_[_0xa0be('0x2c')](db[_0xa0be('0x2d')][_0xa0be('0x2e')],function(_0x219204){return{'name':_0x219204[_0xa0be('0x2f')],'type':_0x219204['type']['key']};});_0x18dff6[_0xa0be('0x30')]=_[_0xa0be('0x2c')](_0x33170b,_0xa0be('0x2a'));_0x18dff6[_0xa0be('0x31')]=_[_0xa0be('0x32')](_0x158e51['query']);_0x18dff6[_0xa0be('0x33')]=_['intersection'](_0x18dff6[_0xa0be('0x30')],_0x18dff6[_0xa0be('0x31')]);_0x3ceade[_0xa0be('0x34')]=_[_0xa0be('0x35')](_0x18dff6[_0xa0be('0x30')],qs[_0xa0be('0x36')](_0x158e51['query'][_0xa0be('0x36')]));_0x3ceade[_0xa0be('0x34')]=_0x3ceade[_0xa0be('0x34')][_0xa0be('0x37')]?_0x3ceade[_0xa0be('0x34')]:_0x18dff6['model'];if(!_0x158e51[_0xa0be('0x31')][_0xa0be('0x38')]('nolimit')){_0x3ceade['limit']=qs[_0xa0be('0x1e')](_0x158e51['query']['limit']);_0x3ceade[_0xa0be('0x1c')]=qs[_0xa0be('0x1c')](_0x158e51['query'][_0xa0be('0x1c')]);}_0x3ceade['order']=qs[_0xa0be('0x39')](_0x158e51[_0xa0be('0x31')][_0xa0be('0x39')]);_0x3ceade[_0xa0be('0x3a')]=qs['filters'](_[_0xa0be('0x3b')](_0x158e51['query'],_0x18dff6[_0xa0be('0x33')]),_0x33170b);if(_0x158e51[_0xa0be('0x31')][_0xa0be('0x3c')]){_0x3ceade[_0xa0be('0x3a')]=_[_0xa0be('0x3d')](_0x3ceade[_0xa0be('0x3a')],{'$or':_[_0xa0be('0x2c')](_0x33170b,function(_0x26cdc6){if(_0x26cdc6[_0xa0be('0x3e')]!==_0xa0be('0x3f')){var _0x44cd00={};_0x44cd00[_0x26cdc6[_0xa0be('0x2a')]]={'$like':'%'+_0x158e51[_0xa0be('0x31')][_0xa0be('0x3c')]+'%'};return _0x44cd00;}})});}_0x3ceade=_[_0xa0be('0x3d')]({},_0x3ceade,_0x158e51[_0xa0be('0x40')]);var _0x45f46c={'where':_0x3ceade[_0xa0be('0x3a')]};return db[_0xa0be('0x2d')][_0xa0be('0x1f')](_0x45f46c)[_0xa0be('0x27')](function(_0x4bb993){_0x5d02cb[_0xa0be('0x1f')]=_0x4bb993;if(_0x158e51[_0xa0be('0x31')][_0xa0be('0x41')]){_0x3ceade[_0xa0be('0x42')]=[{'all':!![]}];}return db[_0xa0be('0x2d')]['findAll'](_0x3ceade);})[_0xa0be('0x27')](function(_0x334625){_0x5d02cb['rows']=_0x334625;return _0x5d02cb;})['then'](respondWithFilteredResult(_0xb8d25f,_0x3ceade))[_0xa0be('0x43')](handleError(_0xb8d25f,null));};exports[_0xa0be('0x44')]=function(_0x15b03a,_0x334dfd){var _0x1dfc93={'raw':!![],'where':{'id':_0x15b03a[_0xa0be('0x45')]['id']}},_0x39c241={};_0x39c241[_0xa0be('0x30')]=_[_0xa0be('0x32')](db[_0xa0be('0x2d')][_0xa0be('0x2e')]);_0x39c241[_0xa0be('0x31')]=_[_0xa0be('0x32')](_0x15b03a[_0xa0be('0x31')]);_0x39c241[_0xa0be('0x33')]=_[_0xa0be('0x35')](_0x39c241[_0xa0be('0x30')],_0x39c241[_0xa0be('0x31')]);_0x1dfc93[_0xa0be('0x34')]=_['intersection'](_0x39c241['model'],qs[_0xa0be('0x36')](_0x15b03a[_0xa0be('0x31')][_0xa0be('0x36')]));_0x1dfc93[_0xa0be('0x34')]=_0x1dfc93['attributes'][_0xa0be('0x37')]?_0x1dfc93[_0xa0be('0x34')]:_0x39c241[_0xa0be('0x30')];if(_0x15b03a[_0xa0be('0x31')][_0xa0be('0x41')]){_0x1dfc93['include']=[{'all':!![]}];}_0x1dfc93=_[_0xa0be('0x3d')]({},_0x1dfc93,_0x15b03a[_0xa0be('0x40')]);return db['VoiceDialReport'][_0xa0be('0x46')](_0x1dfc93)[_0xa0be('0x27')](handleEntityNotFound(_0x334dfd,null))[_0xa0be('0x27')](respondWithResult(_0x334dfd,null))[_0xa0be('0x43')](handleError(_0x334dfd,null));};exports[_0xa0be('0x47')]=function(_0x5a42ef,_0x28edb5){return db[_0xa0be('0x2d')][_0xa0be('0x47')](_0x5a42ef[_0xa0be('0x48')],{})[_0xa0be('0x27')](respondWithResult(_0x28edb5,0xc9))['catch'](handleError(_0x28edb5,null));};exports[_0xa0be('0x25')]=function(_0x3525ed,_0xfadd6e){if(_0x3525ed[_0xa0be('0x48')]['id']){delete _0x3525ed['body']['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x3525ed[_0xa0be('0x45')]['id']}})[_0xa0be('0x27')](handleEntityNotFound(_0xfadd6e,null))[_0xa0be('0x27')](saveUpdates(_0x3525ed[_0xa0be('0x48')],null))[_0xa0be('0x27')](respondWithResult(_0xfadd6e,null))[_0xa0be('0x43')](handleError(_0xfadd6e,null));};exports[_0xa0be('0x26')]=function(_0x439f54,_0x181814){return db[_0xa0be('0x2d')][_0xa0be('0x46')]({'where':{'id':_0x439f54[_0xa0be('0x45')]['id']}})['then'](handleEntityNotFound(_0x181814,null))[_0xa0be('0x27')](removeEntity(_0x181814,null))[_0xa0be('0x43')](handleError(_0x181814,null));};exports[_0xa0be('0x49')]=function(_0x4e03a8,_0x4710e7){return db[_0xa0be('0x2d')][_0xa0be('0x49')]()['then'](respondWithResult(_0x4710e7,null))['catch'](handleError(_0x4710e7,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 74f2d56..66c9330 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 _0x5a96=['bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','lodash','util','api','moment'];(function(_0x572342,_0x26552c){var _0x2b4d3=function(_0x4811f1){while(--_0x4811f1){_0x572342['push'](_0x572342['shift']());}};_0x2b4d3(++_0x26552c);}(_0x5a96,0xbc));var _0x65a9=function(_0x4df7a7,_0x357bb5){_0x4df7a7=_0x4df7a7-0x0;var _0x17528d=_0x5a96[_0x4df7a7];return _0x17528d;};'use strict';var _=require(_0x65a9('0x0'));var util=require(_0x65a9('0x1'));var logger=require('../../config/logger')(_0x65a9('0x2'));var moment=require(_0x65a9('0x3'));var BPromise=require(_0x65a9('0x4'));var rp=require(_0x65a9('0x5'));var fs=require('fs');var path=require(_0x65a9('0x6'));var rimraf=require(_0x65a9('0x7'));var config=require('../../config/environment');var attributes=require(_0x65a9('0x8'));module['exports']=function(_0x512646,_0x4b8b3e){return _0x512646[_0x65a9('0x9')](_0x65a9('0xa'),attributes,{'tableName':_0x65a9('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d8a=['define','report_dial','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x2ce9d2,_0x21b3f8){var _0x2cc46b=function(_0x3407c7){while(--_0x3407c7){_0x2ce9d2['push'](_0x2ce9d2['shift']());}};_0x2cc46b(++_0x21b3f8);}(_0x8d8a,0x189));var _0xa8d8=function(_0x5d780f,_0xca612d){_0x5d780f=_0x5d780f-0x0;var _0xdea064=_0x8d8a[_0x5d780f];return _0xdea064;};'use strict';var _=require(_0xa8d8('0x0'));var util=require(_0xa8d8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa8d8('0x2'));var BPromise=require(_0xa8d8('0x3'));var rp=require(_0xa8d8('0x4'));var fs=require('fs');var path=require(_0xa8d8('0x5'));var rimraf=require(_0xa8d8('0x6'));var config=require(_0xa8d8('0x7'));var attributes=require(_0xa8d8('0x8'));module[_0xa8d8('0x9')]=function(_0xa30536,_0x4ce0aa){return _0xa30536[_0xa8d8('0xa')]('VoiceDialReport',attributes,{'tableName':_0xa8d8('0xb'),'paranoid':![],'indexes':[{'fields':[_0xa8d8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 9580724..2448233 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 _0x83b9=['VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','VoiceDialReport,\x20%s,\x20%s','result','catch','VoiceDialReport','create','body','options','CreateVoiceDialReport','stringify','UpdateVoiceDialReport','update','where','attributes','limit','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x1eed8c,_0x3d4497){var _0x4b2760=function(_0x4f222c){while(--_0x4f222c){_0x1eed8c['push'](_0x1eed8c['shift']());}};_0x4b2760(++_0x3d4497);}(_0x83b9,0x15c));var _0x983b=function(_0x4da1d1,_0x7e80bf){_0x4da1d1=_0x4da1d1-0x0;var _0x42b10c=_0x83b9[_0x4da1d1];return _0x42b10c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x983b('0x0'));var BPromise=require(_0x983b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x983b('0x2'))['db'];var utils=require(_0x983b('0x3'));var logger=require(_0x983b('0x4'))(_0x983b('0x5'));var config=require(_0x983b('0x6'));var jayson=require(_0x983b('0x7'));var client=jayson[_0x983b('0x8')][_0x983b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3504,_0x204317,_0x3adbd4){return new BPromise(function(_0x100dcf,_0x1c3f2b){return client[_0x983b('0xa')](_0x5b3504,_0x3adbd4)[_0x983b('0xb')](function(_0x282770){logger[_0x983b('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x204317,_0x983b('0xd'));logger[_0x983b('0xe')](_0x983b('0xf'),_0x204317,_0x983b('0xd'),JSON['stringify'](_0x282770));if(_0x282770[_0x983b('0x10')]){if(_0x282770[_0x983b('0x10')][_0x983b('0x11')]===0x1f4){logger[_0x983b('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x204317,_0x282770[_0x983b('0x10')][_0x983b('0x12')]);return _0x1c3f2b(_0x282770['error'][_0x983b('0x12')]);}logger[_0x983b('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x204317,_0x282770[_0x983b('0x10')][_0x983b('0x12')]);return _0x100dcf(_0x282770['error'][_0x983b('0x12')]);}else{logger[_0x983b('0xc')](_0x983b('0x13'),_0x204317,'request\x20sent');_0x100dcf(_0x282770[_0x983b('0x14')][_0x983b('0x12')]);}})[_0x983b('0x15')](function(_0x40ca86){logger['error'](_0x983b('0x13'),_0x204317,_0x40ca86);_0x1c3f2b(_0x40ca86);});});}exports['CreateVoiceDialReport']=function(_0xbbbdd7){var _0x361887=this;return new Promise(function(_0x12b9cc,_0x9e0c56){return db[_0x983b('0x16')][_0x983b('0x17')](_0xbbbdd7[_0x983b('0x18')],{'raw':_0xbbbdd7[_0x983b('0x19')]?_0xbbbdd7['options']['raw']===undefined?!![]:![]:!![]})[_0x983b('0xb')](function(_0xea5e6){logger['info'](_0x983b('0x1a'),_0xbbbdd7);logger[_0x983b('0xe')](_0x983b('0x1a'),_0xbbbdd7,JSON[_0x983b('0x1b')](_0xea5e6));_0x12b9cc(_0xea5e6);})[_0x983b('0x15')](function(_0xaad765){logger['error'](_0x983b('0x1a'),_0xaad765[_0x983b('0x12')],_0xbbbdd7);_0x9e0c56(_0x361887['error'](0x1f4,_0xaad765[_0x983b('0x12')]));});});};exports[_0x983b('0x1c')]=function(_0x1d9e81){var _0x1613a3=this;return new Promise(function(_0x396cda,_0x2580c1){return db['VoiceDialReport'][_0x983b('0x1d')](_0x1d9e81[_0x983b('0x18')],{'raw':_0x1d9e81[_0x983b('0x19')]?_0x1d9e81[_0x983b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d9e81[_0x983b('0x19')]?_0x1d9e81[_0x983b('0x19')][_0x983b('0x1e')]||null:null,'attributes':_0x1d9e81['options']?_0x1d9e81[_0x983b('0x19')][_0x983b('0x1f')]||null:null,'limit':_0x1d9e81[_0x983b('0x19')]?_0x1d9e81[_0x983b('0x19')][_0x983b('0x20')]||null:null})[_0x983b('0xb')](function(_0x3ba0e5){logger[_0x983b('0xc')](_0x983b('0x1c'),_0x1d9e81);logger[_0x983b('0xe')](_0x983b('0x1c'),_0x1d9e81,JSON[_0x983b('0x1b')](_0x3ba0e5));_0x396cda(_0x3ba0e5);})['catch'](function(_0x39c1e5){logger[_0x983b('0x10')](_0x983b('0x1c'),_0x39c1e5['message'],_0x1d9e81);_0x2580c1(_0x1613a3[_0x983b('0x10')](0x1f4,_0x39c1e5['message']));});});}; \ No newline at end of file +var _0x12ee=['../../config/logger','jayson/promise','then','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceDialReport,\x20%s,\x20%s','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','info','UpdateVoiceDialReport','update','raw','where','attributes','limit','lodash','bluebird','randomstring','../../config/utils'];(function(_0x8d2823,_0x30edde){var _0x52b795=function(_0x45de91){while(--_0x45de91){_0x8d2823['push'](_0x8d2823['shift']());}};_0x52b795(++_0x30edde);}(_0x12ee,0x13b));var _0xe12e=function(_0x4dee88,_0xcee781){_0x4dee88=_0x4dee88-0x0;var _0x2c306b=_0x12ee[_0x4dee88];return _0x2c306b;};'use strict';var _=require(_0xe12e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe12e('0x1'));var rs=require(_0xe12e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe12e('0x3'));var logger=require(_0xe12e('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe12e('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x172d83,_0x2b5bec,_0x57ef9c){return new BPromise(function(_0x215e24,_0x409f4d){return client['request'](_0x172d83,_0x57ef9c)[_0xe12e('0x6')](function(_0x42b5a0){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x2b5bec,_0xe12e('0x7'));logger[_0xe12e('0x8')](_0xe12e('0x9'),_0x2b5bec,_0xe12e('0x7'),JSON[_0xe12e('0xa')](_0x42b5a0));if(_0x42b5a0[_0xe12e('0xb')]){if(_0x42b5a0['error'][_0xe12e('0xc')]===0x1f4){logger[_0xe12e('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x2b5bec,_0x42b5a0['error'][_0xe12e('0xd')]);return _0x409f4d(_0x42b5a0[_0xe12e('0xb')][_0xe12e('0xd')]);}logger[_0xe12e('0xb')](_0xe12e('0xe'),_0x2b5bec,_0x42b5a0['error'][_0xe12e('0xd')]);return _0x215e24(_0x42b5a0[_0xe12e('0xb')][_0xe12e('0xd')]);}else{logger['info'](_0xe12e('0xe'),_0x2b5bec,_0xe12e('0x7'));_0x215e24(_0x42b5a0[_0xe12e('0xf')][_0xe12e('0xd')]);}})[_0xe12e('0x10')](function(_0x5870cc){logger['error'](_0xe12e('0xe'),_0x2b5bec,_0x5870cc);_0x409f4d(_0x5870cc);});});}exports[_0xe12e('0x11')]=function(_0x32b6e7){var _0x5b4cb9=this;return new Promise(function(_0x2e426e,_0x2df1cf){return db[_0xe12e('0x12')][_0xe12e('0x13')](_0x32b6e7[_0xe12e('0x14')],{'raw':_0x32b6e7[_0xe12e('0x15')]?_0x32b6e7['options']['raw']===undefined?!![]:![]:!![]})[_0xe12e('0x6')](function(_0x118e53){logger[_0xe12e('0x16')](_0xe12e('0x11'),_0x32b6e7);logger[_0xe12e('0x8')]('CreateVoiceDialReport',_0x32b6e7,JSON[_0xe12e('0xa')](_0x118e53));_0x2e426e(_0x118e53);})[_0xe12e('0x10')](function(_0x2b609b){logger[_0xe12e('0xb')]('CreateVoiceDialReport',_0x2b609b[_0xe12e('0xd')],_0x32b6e7);_0x2df1cf(_0x5b4cb9['error'](0x1f4,_0x2b609b[_0xe12e('0xd')]));});});};exports[_0xe12e('0x17')]=function(_0x421d8e){var _0x3baa2b=this;return new Promise(function(_0x392a6d,_0x4d1f99){return db[_0xe12e('0x12')][_0xe12e('0x18')](_0x421d8e[_0xe12e('0x14')],{'raw':_0x421d8e['options']?_0x421d8e[_0xe12e('0x15')][_0xe12e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x421d8e[_0xe12e('0x15')]?_0x421d8e[_0xe12e('0x15')][_0xe12e('0x1a')]||null:null,'attributes':_0x421d8e['options']?_0x421d8e[_0xe12e('0x15')][_0xe12e('0x1b')]||null:null,'limit':_0x421d8e[_0xe12e('0x15')]?_0x421d8e[_0xe12e('0x15')][_0xe12e('0x1c')]||null:null})['then'](function(_0x43d0c2){logger[_0xe12e('0x16')](_0xe12e('0x17'),_0x421d8e);logger[_0xe12e('0x8')](_0xe12e('0x17'),_0x421d8e,JSON[_0xe12e('0xa')](_0x43d0c2));_0x392a6d(_0x43d0c2);})[_0xe12e('0x10')](function(_0x4fd766){logger[_0xe12e('0xb')](_0xe12e('0x17'),_0x4fd766[_0xe12e('0xd')],_0x421d8e);_0x4d1f99(_0x3baa2b[_0xe12e('0xb')](0x1f4,_0x4fd766['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index b954ad2..d8f841e 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 _0xa41d=['../../components/auth/service','../../config/environment','./voiceExtension.controller','get','/:id','isAuthenticated','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x707d43,_0x53c59c){var _0x2cd625=function(_0x2079e2){while(--_0x2079e2){_0x707d43['push'](_0x707d43['shift']());}};_0x2cd625(++_0x53c59c);}(_0xa41d,0x144));var _0xda41=function(_0x19aa26,_0x5f17b3){_0x19aa26=_0x19aa26-0x0;var _0x19da4e=_0xa41d[_0x19aa26];return _0x19da4e;};'use strict';var multer=require(_0xda41('0x0'));var util=require(_0xda41('0x1'));var path=require(_0xda41('0x2'));var timeout=require('connect-timeout');var express=require(_0xda41('0x3'));var router=express[_0xda41('0x4')]();var fs_extra=require(_0xda41('0x5'));var auth=require(_0xda41('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xda41('0x7'));var controller=require(_0xda41('0x8'));router[_0xda41('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xda41('0xa'),auth[_0xda41('0xb')](),controller[_0xda41('0xc')]);router[_0xda41('0xd')]('/',auth[_0xda41('0xb')](),controller[_0xda41('0xe')]);router['post'](_0xda41('0xf'),auth[_0xda41('0xb')](),controller[_0xda41('0x10')]);router[_0xda41('0x11')](_0xda41('0xa'),auth['isAuthenticated'](),controller[_0xda41('0x12')]);router[_0xda41('0x13')](_0xda41('0xa'),auth[_0xda41('0xb')](),controller[_0xda41('0x14')]);module[_0xda41('0x15')]=router; \ No newline at end of file +var _0xeadb=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','create','/:id/applications','addApplications','delete','destroy'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xeadb,0x166));var _0xbead=function(_0x5a94af,_0x4b8272){_0x5a94af=_0x5a94af-0x0;var _0x12ceb0=_0xeadb[_0x5a94af];return _0x12ceb0;};'use strict';var multer=require(_0xbead('0x0'));var util=require(_0xbead('0x1'));var path=require(_0xbead('0x2'));var timeout=require(_0xbead('0x3'));var express=require(_0xbead('0x4'));var router=express[_0xbead('0x5')]();var fs_extra=require(_0xbead('0x6'));var auth=require(_0xbead('0x7'));var interaction=require(_0xbead('0x8'));var config=require(_0xbead('0x9'));var controller=require(_0xbead('0xa'));router[_0xbead('0xb')]('/',auth[_0xbead('0xc')](),controller[_0xbead('0xd')]);router[_0xbead('0xb')](_0xbead('0xe'),auth[_0xbead('0xc')](),controller['show']);router['post']('/',auth[_0xbead('0xc')](),controller[_0xbead('0xf')]);router['post'](_0xbead('0x10'),auth['isAuthenticated'](),controller[_0xbead('0x11')]);router['put'](_0xbead('0xe'),auth[_0xbead('0xc')](),controller['update']);router[_0xbead('0x12')](_0xbead('0xe'),auth[_0xbead('0xc')](),controller[_0xbead('0x13')]);module[_0xbead('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index fd5a45e..1734eb9 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 _0x84f7=['outbound-fax','system','any','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x84f7,0x14c));var _0x784f=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x84f7[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x784f('0x0'));module[_0x784f('0x1')]={'context':{'type':Sequelize[_0x784f('0x2')],'allowNull':![],'unique':_0x784f('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x784f('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x784f('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x784f('0x2')],'allowNull':![],'defaultValue':_0x784f('0x4')},'appdata':{'type':Sequelize[_0x784f('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x784f('0x5')](_0x784f('0x6'),_0x784f('0x7'),_0x784f('0x8'),_0x784f('0x9'),_0x784f('0xa'),_0x784f('0xb'),_0x784f('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0x784f('0x2')]},'interval':{'type':Sequelize[_0x784f('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x784f('0xd')]},'isApp':{'type':Sequelize[_0x784f('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x784f('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x784f('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x784f('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x784f('0xd')]},'recordingFormat':{'type':Sequelize[_0x784f('0x2')],'defaultValue':_0x784f('0xf')},'answer':{'type':Sequelize[_0x784f('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x784f('0x10')],'get':function(_0x56c178){return this[_0x784f('0x11')](_0x784f('0x12'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x282b=['outbound-fax','*,*,*,*','INTEGER','BOOLEAN','wav','exten','exports','STRING','compositeIndex','ENUM','outbound','internal','inbound-fax'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x282b,0x1a6));var _0xb282=function(_0x57cb04,_0x1a7c70){_0x57cb04=_0x57cb04-0x0;var _0x5f1769=_0x282b[_0x57cb04];return _0x5f1769;};'use strict';var Sequelize=require('sequelize');module[_0xb282('0x0')]={'context':{'type':Sequelize[_0xb282('0x1')],'allowNull':![],'unique':_0xb282('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xb282('0x1')],'allowNull':![],'unique':_0xb282('0x2')},'priority':{'type':Sequelize[_0xb282('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xb282('0x2')},'tag':{'type':Sequelize[_0xb282('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xb282('0x1')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xb282('0x3')]('inbound',_0xb282('0x4'),_0xb282('0x5'),_0xb282('0x6'),_0xb282('0x7'),'system','any'),'allowNull':![]},'description':{'type':Sequelize[_0xb282('0x1')]},'interval':{'type':Sequelize[_0xb282('0x1')],'allowNull':![],'defaultValue':_0xb282('0x8')},'IntervalId':{'type':Sequelize[_0xb282('0x9')]},'isApp':{'type':Sequelize[_0xb282('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xb282('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xb282('0x9')]},'recordingFormat':{'type':Sequelize[_0xb282('0x1')],'defaultValue':_0xb282('0xb')},'answer':{'type':Sequelize[_0xb282('0xa')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x181320){return this['getDataValue'](_0xb282('0xc'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index e0b8a8e..31b7c76 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 _0xbe6e=['hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','startsWith','exten','user','OutboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','send','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','then','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','map','value','type','UserProfileResource','error','index','VoiceExtension','model','name','query','keys','filters','intersection','attributes','fields','length'];(function(_0x275fe7,_0x3f5a81){var _0x28ca20=function(_0x3599a4){while(--_0x3599a4){_0x275fe7['push'](_0x275fe7['shift']());}};_0x28ca20(++_0x3f5a81);}(_0xbe6e,0x138));var _0xebe6=function(_0x576572,_0x1b2768){_0x576572=_0x576572-0x0;var _0x1eabb2=_0xbe6e[_0x576572];return _0x1eabb2;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xebe6('0x0'));var logger=require(_0xebe6('0x1'))(_0xebe6('0x2'));var config=require(_0xebe6('0x3'));var db=require(_0xebe6('0x4'))['db'];config[_0xebe6('0x5')]=_['defaults'](config[_0xebe6('0x5')],{'host':_0xebe6('0x6'),'port':0x18eb});var socket=require(_0xebe6('0x7'))(new Redis(config[_0xebe6('0x5')]));require(_0xebe6('0x8'))[_0xebe6('0x9')](socket);function respondWithStatusCode(_0x207bae,_0x2836ed){_0x2836ed=_0x2836ed||0xcc;return function(_0x554798){if(_0x554798){return _0x207bae[_0xebe6('0xa')](_0x2836ed);}return _0x207bae[_0xebe6('0xb')](_0x2836ed)[_0xebe6('0xc')]();};}function respondWithResult(_0x482bc9,_0x12c34e){_0x12c34e=_0x12c34e||0xc8;return function(_0x5b65ac){if(_0x5b65ac){return _0x482bc9[_0xebe6('0xb')](_0x12c34e)[_0xebe6('0xd')](_0x5b65ac);}};}function respondWithFilteredResult(_0x450f0a,_0x2cf815){return function(_0xd549e7){if(_0xd549e7){var _0x58760c=typeof _0x2cf815[_0xebe6('0xe')]===_0xebe6('0xf')&&typeof _0x2cf815[_0xebe6('0x10')]==='undefined';var _0x4d13a6=_0xd549e7[_0xebe6('0x11')];var _0x4ecf8c=_0x58760c?0x0:_0x2cf815[_0xebe6('0xe')];var _0x37183b=_0x58760c?_0xd549e7['count']:_0x2cf815[_0xebe6('0xe')]+_0x2cf815[_0xebe6('0x10')];var _0x17243e;if(_0x37183b>=_0x4d13a6){_0x37183b=_0x4d13a6;_0x17243e=0xc8;}else{_0x17243e=0xce;}_0x450f0a[_0xebe6('0xb')](_0x17243e);return _0x450f0a[_0xebe6('0x12')]('Content-Range',_0x4ecf8c+'-'+_0x37183b+'/'+_0x4d13a6)[_0xebe6('0xd')](_0xd549e7);}return null;};}function removeEntity(_0x12a47a){return function(_0x283793){if(_0x283793){return _0x283793[_0xebe6('0x13')]()[_0xebe6('0x14')](function(){var _0x2d6d32=_0x283793[_0xebe6('0x15')]({'plain':!![]});var _0x1dfe83=[{'name':_0xebe6('0x16'),'value':_0xebe6('0x17'),'ignore':![]},{'name':'OutboundRoutes','value':_0xebe6('0x18'),'ignore':![]},{'name':_0xebe6('0x19'),'value':_0xebe6('0x1a'),'ignore':![]}];var _0x1351e2=_(_0x1dfe83)[_0xebe6('0x1b')]('ignore')[_0xebe6('0x1c')](_0xebe6('0x1d'))[_0xebe6('0x1d')]();if(_['includes'](_0x1351e2,_0x2d6d32[_0xebe6('0x1e')])){return;}var _0x3f19fa=_['find'](_0x1dfe83,[_0xebe6('0x1d'),_0x2d6d32[_0xebe6('0x1e')]])['name'];return db[_0xebe6('0x1f')]['destroy']({'where':{'type':_0x3f19fa,'resourceId':_0x2d6d32['id']}})['then'](function(){return _0x283793;});})[_0xebe6('0x14')](function(){_0x12a47a[_0xebe6('0xb')](0xcc)[_0xebe6('0xc')]();});}};}function handleEntityNotFound(_0x7e78d6){return function(_0x16ed69){if(!_0x16ed69){_0x7e78d6['sendStatus'](0x194);}return _0x16ed69;};}function handleError(_0x208320,_0x3b3070){_0x3b3070=_0x3b3070||0x1f4;return function(_0x1e79dc){logger[_0xebe6('0x20')](_0x1e79dc['stack']);if(_0x1e79dc['name']){delete _0x1e79dc['name'];}_0x208320[_0xebe6('0xb')](_0x3b3070)['send'](_0x1e79dc);};}exports[_0xebe6('0x21')]=function(_0x240359,_0x4810f8){var _0x2b0b9e={},_0x53857a={},_0x5ddb1b={'count':0x0,'rows':[]};var _0x2fcedd=_['map'](db[_0xebe6('0x22')]['rawAttributes'],function(_0x554a9e){return{'name':_0x554a9e['fieldName'],'type':_0x554a9e[_0xebe6('0x1e')]['key']};});_0x53857a[_0xebe6('0x23')]=_[_0xebe6('0x1c')](_0x2fcedd,_0xebe6('0x24'));_0x53857a[_0xebe6('0x25')]=_[_0xebe6('0x26')](_0x240359['query']);_0x53857a[_0xebe6('0x27')]=_[_0xebe6('0x28')](_0x53857a[_0xebe6('0x23')],_0x53857a[_0xebe6('0x25')]);_0x2b0b9e[_0xebe6('0x29')]=_[_0xebe6('0x28')](_0x53857a[_0xebe6('0x23')],qs[_0xebe6('0x2a')](_0x240359[_0xebe6('0x25')][_0xebe6('0x2a')]));_0x2b0b9e[_0xebe6('0x29')]=_0x2b0b9e[_0xebe6('0x29')][_0xebe6('0x2b')]?_0x2b0b9e[_0xebe6('0x29')]:_0x53857a['model'];if(!_0x240359[_0xebe6('0x25')][_0xebe6('0x2c')](_0xebe6('0x2d'))){_0x2b0b9e[_0xebe6('0x10')]=qs['limit'](_0x240359[_0xebe6('0x25')][_0xebe6('0x10')]);_0x2b0b9e[_0xebe6('0xe')]=qs[_0xebe6('0xe')](_0x240359[_0xebe6('0x25')]['offset']);}_0x2b0b9e[_0xebe6('0x2e')]=qs[_0xebe6('0x2f')](_0x240359[_0xebe6('0x25')][_0xebe6('0x2f')]);_0x2b0b9e[_0xebe6('0x30')]=qs[_0xebe6('0x27')](_['pick'](_0x240359[_0xebe6('0x25')],_0x53857a[_0xebe6('0x27')]),_0x2fcedd);if(_0x240359[_0xebe6('0x25')][_0xebe6('0x1b')]){_0x2b0b9e[_0xebe6('0x30')]=_[_0xebe6('0x31')](_0x2b0b9e['where'],{'$or':_['map'](_0x2fcedd,function(_0x5ab1e7){if(_0x5ab1e7[_0xebe6('0x1e')]!==_0xebe6('0x32')){var _0xf72004={};_0xf72004[_0x5ab1e7[_0xebe6('0x24')]]={'$like':'%'+_0x240359[_0xebe6('0x25')]['filter']+'%'};return _0xf72004;}})});}_0x2b0b9e=_[_0xebe6('0x31')]({},_0x2b0b9e,_0x240359[_0xebe6('0x33')]);var _0x18f557={'where':_0x2b0b9e[_0xebe6('0x30')]};return db[_0xebe6('0x22')][_0xebe6('0x11')](_0x18f557)[_0xebe6('0x14')](function(_0x4005b2){_0x5ddb1b[_0xebe6('0x11')]=_0x4005b2;if(_0x240359[_0xebe6('0x25')][_0xebe6('0x34')]){_0x2b0b9e[_0xebe6('0x35')]=[{'all':!![]}];}return db[_0xebe6('0x22')]['findAll'](_0x2b0b9e);})['then'](function(_0x483f46){_0x5ddb1b[_0xebe6('0x36')]=_0x483f46;return _0x5ddb1b;})[_0xebe6('0x14')](respondWithFilteredResult(_0x4810f8,_0x2b0b9e))[_0xebe6('0x37')](handleError(_0x4810f8,null));};exports[_0xebe6('0x38')]=function(_0x26ab93,_0xef0527){var _0x36ad83={'raw':![],'where':{'id':_0x26ab93[_0xebe6('0x39')]['id']}},_0x4e94c8={};_0x4e94c8['model']=_[_0xebe6('0x26')](db['VoiceExtension'][_0xebe6('0x3a')]);_0x4e94c8[_0xebe6('0x25')]=_[_0xebe6('0x26')](_0x26ab93[_0xebe6('0x25')]);_0x4e94c8[_0xebe6('0x27')]=_[_0xebe6('0x28')](_0x4e94c8['model'],_0x4e94c8[_0xebe6('0x25')]);_0x36ad83[_0xebe6('0x29')]=_['intersection'](_0x4e94c8[_0xebe6('0x23')],qs[_0xebe6('0x2a')](_0x26ab93[_0xebe6('0x25')]['fields']));_0x36ad83[_0xebe6('0x29')]=_0x36ad83[_0xebe6('0x29')][_0xebe6('0x2b')]?_0x36ad83['attributes']:_0x4e94c8['model'];if(_0x26ab93['query']['includeAll']){_0x36ad83[_0xebe6('0x35')]=[{'all':!![]}];}_0x36ad83=_[_0xebe6('0x31')]({},_0x36ad83,_0x26ab93[_0xebe6('0x33')]);return db[_0xebe6('0x22')][_0xebe6('0x3b')](_0x36ad83)[_0xebe6('0x14')](handleEntityNotFound(_0xef0527,null))[_0xebe6('0x14')](respondWithResult(_0xef0527,null))[_0xebe6('0x37')](handleError(_0xef0527,null));};exports[_0xebe6('0x13')]=function(_0x47c6e6,_0x2a5470){return db[_0xebe6('0x22')][_0xebe6('0x3b')]({'where':{'id':_0x47c6e6[_0xebe6('0x39')]['id']}})['then'](handleEntityNotFound(_0x2a5470,null))[_0xebe6('0x14')](removeEntity(_0x2a5470,null))[_0xebe6('0x37')](handleError(_0x2a5470,null));};exports[_0xebe6('0x3c')]=function(_0x5d58e3,_0x1996a6){if(_0x5d58e3[_0xebe6('0x3d')]['type']==='outbound'&&!_[_0xebe6('0x3e')](_0x5d58e3[_0xebe6('0x3d')][_0xebe6('0x3f')],'_')){_0x5d58e3[_0xebe6('0x3d')][_0xebe6('0x3f')]='_'['concat'](_0x5d58e3[_0xebe6('0x3d')][_0xebe6('0x3f')]);}return db[_0xebe6('0x22')][_0xebe6('0x3c')](_0x5d58e3[_0xebe6('0x3d')],{'raw':![]})[_0xebe6('0x14')](function(_0x31a6f9){var _0x2fc020=_0x5d58e3[_0xebe6('0x40')][_0xebe6('0x15')]({'plain':!![]});if(!_0x2fc020)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fc020['role']===_0xebe6('0x40')){var _0x10ffc9=_0x31a6f9[_0xebe6('0x15')]({'plain':!![]});var _0x55f00d=[{'name':_0xebe6('0x16'),'value':_0xebe6('0x17')},{'name':_0xebe6('0x41'),'value':_0xebe6('0x18')},{'name':'InternalRoutes','value':_0xebe6('0x1a')}];var _0x235a9d=_['find'](_0x55f00d,[_0xebe6('0x1d'),_0x10ffc9[_0xebe6('0x1e')]])[_0xebe6('0x24')];return db[_0xebe6('0x42')][_0xebe6('0x3b')]({'where':{'name':_0x235a9d,'userProfileId':_0x2fc020[_0xebe6('0x43')]},'raw':!![]})[_0xebe6('0x14')](function(_0x16f824){if(_0x16f824&&_0x16f824[_0xebe6('0x44')]===0x0){return db[_0xebe6('0x1f')][_0xebe6('0x3c')]({'name':_0x10ffc9[_0xebe6('0x24')],'resourceId':_0x10ffc9['id'],'type':_0x16f824[_0xebe6('0x24')],'sectionId':_0x16f824['id']},{})[_0xebe6('0x14')](function(){return _0x31a6f9;});}else{return _0x31a6f9;}})['catch'](function(_0x408657){logger['error'](_0xebe6('0x45'),_0x408657);throw _0x408657;});}return _0x31a6f9;})['then'](respondWithResult(_0x1996a6,0xc9))[_0xebe6('0x37')](handleError(_0x1996a6,null));};exports['update']=function(_0x20c03d,_0x53bf2e){if(_0x20c03d[_0xebe6('0x3d')]['id']){delete _0x20c03d[_0xebe6('0x3d')]['id'];}return db[_0xebe6('0x22')][_0xebe6('0x3b')]({'where':{'id':_0x20c03d['params']['id']}})[_0xebe6('0x14')](handleEntityNotFound(_0x53bf2e,null))[_0xebe6('0x14')](function(_0x192c06){if(_0x192c06){return db[_0xebe6('0x22')]['update'](_[_0xebe6('0x46')](_0x20c03d[_0xebe6('0x3d')],[_0xebe6('0x3f'),_0xebe6('0x47'),_0xebe6('0x48'),_0xebe6('0x49'),_0xebe6('0x4a'),_0xebe6('0x4b'),_0xebe6('0x4c')]),{'where':{'context':_0x192c06[_0xebe6('0x47')],'exten':_0x192c06['exten']},'individualHooks':!![]})[_0xebe6('0x14')](function(_0x22dccd){return _0x22dccd;});}return null;})[_0xebe6('0x14')](respondWithStatusCode(_0x53bf2e,null))[_0xebe6('0x37')](handleError(_0x53bf2e,null));};exports[_0xebe6('0x4d')]=function(_0x1680d7,_0x53d915){var _0x26144d=_0x1680d7[_0xebe6('0x39')]['id'];var _0x44546b=_0x1680d7[_0xebe6('0x3d')];var _0x27b26a=0xc8;var _0x3b9d69=null;return db[_0xebe6('0x4e')]['transaction']({'isolationLevel':db[_0xebe6('0x4e')][_0xebe6('0x4f')][_0xebe6('0x50')][_0xebe6('0x51')]},function(_0x7b5878){return db[_0xebe6('0x22')][_0xebe6('0x52')]({'where':{'id':_0x26144d},'transaction':_0x7b5878})['then'](function(_0x395077){if(_0x395077){return db['VoiceExtension'][_0xebe6('0x13')]({'where':{'VoiceExtensionId':_0x26144d},'transaction':_0x7b5878})[_0xebe6('0x14')](function(){var _0x5ee4c4=_[_0xebe6('0x1c')](_0x44546b,function(_0x4309be){_0x4309be[_0xebe6('0x53')]=_0x26144d;_0x4309be[_0xebe6('0x54')]=!![];return _0x4309be;});return _0x395077['createRouting'](_0x5ee4c4);})[_0xebe6('0x14')](function(_0x485678){return db['VoiceExtension'][_0xebe6('0x55')](_0x485678,{'transaction':_0x7b5878});});}else{_0x27b26a=0x194;_0x3b9d69=[];}});})[_0xebe6('0x14')](function(){if(_0x27b26a!==0x194){return db[_0xebe6('0x22')][_0xebe6('0x56')]({'where':{'isApp':!![],'VoiceExtensionId':_0x26144d},'order':_0xebe6('0x57')})[_0xebe6('0x14')](function(_0x1b7864){_0x3b9d69=_0x1b7864;});}})[_0xebe6('0x37')](function(_0x5a3f89){_0x27b26a=0x1f4;logger[_0xebe6('0x20')](_0x5a3f89['stack']);if(_0x5a3f89[_0xebe6('0x24')]){delete _0x5a3f89['name'];}_0x3b9d69=_0x5a3f89;})['finally'](function(){if(_0x3b9d69===null){_0x53d915['sendStatus'](_0x27b26a);}else{if(_0x27b26a===0x1f4){_0x53d915[_0xebe6('0xb')](_0x27b26a)[_0xebe6('0x58')](_0x3b9d69);}else{_0x53d915['status'](_0x27b26a)['json'](_0x3b9d69);}}});}; \ No newline at end of file +var _0x7f79=['./voiceExtension.socket','sendStatus','end','status','offset','undefined','limit','set','Content-Range','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','keys','query','filters','attributes','fields','length','model','hasOwnProperty','nolimit','pick','filter','where','VIRTUAL','merge','count','includeAll','include','findAll','catch','show','params','intersection','options','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis'];(function(_0x49c1f6,_0xbaa661){var _0x27c633=function(_0x2a5c42){while(--_0x2a5c42){_0x49c1f6['push'](_0x49c1f6['shift']());}};_0x27c633(++_0xbaa661);}(_0x7f79,0x16b));var _0x97f7=function(_0x5a1a99,_0x3102a5){_0x5a1a99=_0x5a1a99-0x0;var _0x4355c2=_0x7f79[_0x5a1a99];return _0x4355c2;};'use strict';var _=require(_0x97f7('0x0'));var Redis=require(_0x97f7('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x97f7('0x2'))(_0x97f7('0x3'));var config=require('../../config/environment');var db=require(_0x97f7('0x4'))['db'];config['redis']=_[_0x97f7('0x5')](config['redis'],{'host':_0x97f7('0x6'),'port':0x18eb});var socket=require(_0x97f7('0x7'))(new Redis(config[_0x97f7('0x8')]));require(_0x97f7('0x9'))['register'](socket);function respondWithStatusCode(_0x3ebee4,_0x238774){_0x238774=_0x238774||0xcc;return function(_0x5450f6){if(_0x5450f6){return _0x3ebee4[_0x97f7('0xa')](_0x238774);}return _0x3ebee4['status'](_0x238774)[_0x97f7('0xb')]();};}function respondWithResult(_0x15a66b,_0x5a3d5d){_0x5a3d5d=_0x5a3d5d||0xc8;return function(_0x25b25e){if(_0x25b25e){return _0x15a66b[_0x97f7('0xc')](_0x5a3d5d)['json'](_0x25b25e);}};}function respondWithFilteredResult(_0x25c3ee,_0x549cc7){return function(_0x46256c){if(_0x46256c){var _0x7af32e=typeof _0x549cc7[_0x97f7('0xd')]===_0x97f7('0xe')&&typeof _0x549cc7['limit']===_0x97f7('0xe');var _0x4f1efa=_0x46256c['count'];var _0x391bc8=_0x7af32e?0x0:_0x549cc7[_0x97f7('0xd')];var _0x471468=_0x7af32e?_0x46256c['count']:_0x549cc7[_0x97f7('0xd')]+_0x549cc7[_0x97f7('0xf')];var _0x3b535f;if(_0x471468>=_0x4f1efa){_0x471468=_0x4f1efa;_0x3b535f=0xc8;}else{_0x3b535f=0xce;}_0x25c3ee[_0x97f7('0xc')](_0x3b535f);return _0x25c3ee[_0x97f7('0x10')](_0x97f7('0x11'),_0x391bc8+'-'+_0x471468+'/'+_0x4f1efa)['json'](_0x46256c);}return null;};}function removeEntity(_0x383c8f){return function(_0x292b8a){if(_0x292b8a){return _0x292b8a['destroy']()[_0x97f7('0x12')](function(){var _0x45a183=_0x292b8a[_0x97f7('0x13')]({'plain':!![]});var _0x27cf7d=[{'name':_0x97f7('0x14'),'value':_0x97f7('0x15'),'ignore':![]},{'name':_0x97f7('0x16'),'value':_0x97f7('0x17'),'ignore':![]},{'name':_0x97f7('0x18'),'value':_0x97f7('0x19'),'ignore':![]}];var _0x4bd6e3=_(_0x27cf7d)['filter'](_0x97f7('0x1a'))[_0x97f7('0x1b')](_0x97f7('0x1c'))[_0x97f7('0x1c')]();if(_[_0x97f7('0x1d')](_0x4bd6e3,_0x45a183[_0x97f7('0x1e')])){return;}var _0x50f95c=_[_0x97f7('0x1f')](_0x27cf7d,[_0x97f7('0x1c'),_0x45a183['type']])[_0x97f7('0x20')];return db[_0x97f7('0x21')][_0x97f7('0x22')]({'where':{'type':_0x50f95c,'resourceId':_0x45a183['id']}})[_0x97f7('0x12')](function(){return _0x292b8a;});})[_0x97f7('0x12')](function(){_0x383c8f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x589b0d){return function(_0x3abb86){if(!_0x3abb86){_0x589b0d[_0x97f7('0xa')](0x194);}return _0x3abb86;};}function handleError(_0x22aef3,_0x5a89e7){_0x5a89e7=_0x5a89e7||0x1f4;return function(_0x2627ad){logger[_0x97f7('0x23')](_0x2627ad[_0x97f7('0x24')]);if(_0x2627ad['name']){delete _0x2627ad[_0x97f7('0x20')];}_0x22aef3[_0x97f7('0xc')](_0x5a89e7)[_0x97f7('0x25')](_0x2627ad);};}exports[_0x97f7('0x26')]=function(_0x27e14f,_0x100c5a){var _0xd66a4c={},_0xcdfde9={},_0x5f32b3={'count':0x0,'rows':[]};var _0x55a72d=_[_0x97f7('0x1b')](db[_0x97f7('0x27')][_0x97f7('0x28')],function(_0x49fed6){return{'name':_0x49fed6[_0x97f7('0x29')],'type':_0x49fed6[_0x97f7('0x1e')][_0x97f7('0x2a')]};});_0xcdfde9['model']=_['map'](_0x55a72d,_0x97f7('0x20'));_0xcdfde9['query']=_[_0x97f7('0x2b')](_0x27e14f[_0x97f7('0x2c')]);_0xcdfde9[_0x97f7('0x2d')]=_['intersection'](_0xcdfde9['model'],_0xcdfde9[_0x97f7('0x2c')]);_0xd66a4c[_0x97f7('0x2e')]=_['intersection'](_0xcdfde9['model'],qs[_0x97f7('0x2f')](_0x27e14f[_0x97f7('0x2c')]['fields']));_0xd66a4c[_0x97f7('0x2e')]=_0xd66a4c[_0x97f7('0x2e')][_0x97f7('0x30')]?_0xd66a4c[_0x97f7('0x2e')]:_0xcdfde9[_0x97f7('0x31')];if(!_0x27e14f[_0x97f7('0x2c')][_0x97f7('0x32')](_0x97f7('0x33'))){_0xd66a4c[_0x97f7('0xf')]=qs[_0x97f7('0xf')](_0x27e14f[_0x97f7('0x2c')][_0x97f7('0xf')]);_0xd66a4c[_0x97f7('0xd')]=qs[_0x97f7('0xd')](_0x27e14f[_0x97f7('0x2c')][_0x97f7('0xd')]);}_0xd66a4c['order']=qs['sort'](_0x27e14f['query']['sort']);_0xd66a4c['where']=qs[_0x97f7('0x2d')](_[_0x97f7('0x34')](_0x27e14f[_0x97f7('0x2c')],_0xcdfde9['filters']),_0x55a72d);if(_0x27e14f[_0x97f7('0x2c')][_0x97f7('0x35')]){_0xd66a4c['where']=_['merge'](_0xd66a4c[_0x97f7('0x36')],{'$or':_[_0x97f7('0x1b')](_0x55a72d,function(_0x15899b){if(_0x15899b[_0x97f7('0x1e')]!==_0x97f7('0x37')){var _0x26f7f0={};_0x26f7f0[_0x15899b[_0x97f7('0x20')]]={'$like':'%'+_0x27e14f[_0x97f7('0x2c')][_0x97f7('0x35')]+'%'};return _0x26f7f0;}})});}_0xd66a4c=_[_0x97f7('0x38')]({},_0xd66a4c,_0x27e14f['options']);var _0x585a50={'where':_0xd66a4c[_0x97f7('0x36')]};return db[_0x97f7('0x27')][_0x97f7('0x39')](_0x585a50)[_0x97f7('0x12')](function(_0x1dd67a){_0x5f32b3[_0x97f7('0x39')]=_0x1dd67a;if(_0x27e14f[_0x97f7('0x2c')][_0x97f7('0x3a')]){_0xd66a4c[_0x97f7('0x3b')]=[{'all':!![]}];}return db['VoiceExtension'][_0x97f7('0x3c')](_0xd66a4c);})[_0x97f7('0x12')](function(_0x2d6b0b){_0x5f32b3['rows']=_0x2d6b0b;return _0x5f32b3;})[_0x97f7('0x12')](respondWithFilteredResult(_0x100c5a,_0xd66a4c))[_0x97f7('0x3d')](handleError(_0x100c5a,null));};exports[_0x97f7('0x3e')]=function(_0x3051fa,_0x3b389e){var _0x3fc94f={'raw':![],'where':{'id':_0x3051fa[_0x97f7('0x3f')]['id']}},_0x1b336b={};_0x1b336b['model']=_[_0x97f7('0x2b')](db[_0x97f7('0x27')][_0x97f7('0x28')]);_0x1b336b[_0x97f7('0x2c')]=_[_0x97f7('0x2b')](_0x3051fa['query']);_0x1b336b[_0x97f7('0x2d')]=_[_0x97f7('0x40')](_0x1b336b[_0x97f7('0x31')],_0x1b336b['query']);_0x3fc94f[_0x97f7('0x2e')]=_[_0x97f7('0x40')](_0x1b336b[_0x97f7('0x31')],qs[_0x97f7('0x2f')](_0x3051fa[_0x97f7('0x2c')][_0x97f7('0x2f')]));_0x3fc94f[_0x97f7('0x2e')]=_0x3fc94f[_0x97f7('0x2e')][_0x97f7('0x30')]?_0x3fc94f[_0x97f7('0x2e')]:_0x1b336b[_0x97f7('0x31')];if(_0x3051fa[_0x97f7('0x2c')][_0x97f7('0x3a')]){_0x3fc94f[_0x97f7('0x3b')]=[{'all':!![]}];}_0x3fc94f=_['merge']({},_0x3fc94f,_0x3051fa[_0x97f7('0x41')]);return db[_0x97f7('0x27')][_0x97f7('0x1f')](_0x3fc94f)[_0x97f7('0x12')](handleEntityNotFound(_0x3b389e,null))[_0x97f7('0x12')](respondWithResult(_0x3b389e,null))[_0x97f7('0x3d')](handleError(_0x3b389e,null));};exports[_0x97f7('0x22')]=function(_0xe9d395,_0x1d5e49){return db['VoiceExtension'][_0x97f7('0x1f')]({'where':{'id':_0xe9d395[_0x97f7('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1d5e49,null))['then'](removeEntity(_0x1d5e49,null))[_0x97f7('0x3d')](handleError(_0x1d5e49,null));};exports[_0x97f7('0x42')]=function(_0x110b90,_0x39bfa0){if(_0x110b90[_0x97f7('0x43')][_0x97f7('0x1e')]===_0x97f7('0x17')&&!_['startsWith'](_0x110b90[_0x97f7('0x43')][_0x97f7('0x44')],'_')){_0x110b90[_0x97f7('0x43')][_0x97f7('0x44')]='_'[_0x97f7('0x45')](_0x110b90[_0x97f7('0x43')][_0x97f7('0x44')]);}return db['VoiceExtension']['create'](_0x110b90[_0x97f7('0x43')],{'raw':![]})[_0x97f7('0x12')](function(_0x1bbc1c){var _0x1a07ce=_0x110b90[_0x97f7('0x46')][_0x97f7('0x13')]({'plain':!![]});if(!_0x1a07ce)throw new Error(_0x97f7('0x47'));if(_0x1a07ce['role']===_0x97f7('0x46')){var _0x42d4e9=_0x1bbc1c[_0x97f7('0x13')]({'plain':!![]});var _0x493d25=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x97f7('0x16'),'value':_0x97f7('0x17')},{'name':_0x97f7('0x18'),'value':_0x97f7('0x19')}];var _0x10bdc0=_[_0x97f7('0x1f')](_0x493d25,['value',_0x42d4e9[_0x97f7('0x1e')]])['name'];return db[_0x97f7('0x48')][_0x97f7('0x1f')]({'where':{'name':_0x10bdc0,'userProfileId':_0x1a07ce[_0x97f7('0x49')]},'raw':!![]})[_0x97f7('0x12')](function(_0x591233){if(_0x591233&&_0x591233[_0x97f7('0x4a')]===0x0){return db['UserProfileResource'][_0x97f7('0x42')]({'name':_0x42d4e9['name'],'resourceId':_0x42d4e9['id'],'type':_0x591233[_0x97f7('0x20')],'sectionId':_0x591233['id']},{})[_0x97f7('0x12')](function(){return _0x1bbc1c;});}else{return _0x1bbc1c;}})['catch'](function(_0x5d573a){logger['error'](_0x97f7('0x4b'),_0x5d573a);throw _0x5d573a;});}return _0x1bbc1c;})['then'](respondWithResult(_0x39bfa0,0xc9))['catch'](handleError(_0x39bfa0,null));};exports[_0x97f7('0x4c')]=function(_0x15afa9,_0x569b7f){if(_0x15afa9[_0x97f7('0x43')]['id']){delete _0x15afa9['body']['id'];}return db[_0x97f7('0x27')][_0x97f7('0x1f')]({'where':{'id':_0x15afa9[_0x97f7('0x3f')]['id']}})[_0x97f7('0x12')](handleEntityNotFound(_0x569b7f,null))[_0x97f7('0x12')](function(_0x350382){if(_0x350382){return db[_0x97f7('0x27')][_0x97f7('0x4c')](_[_0x97f7('0x34')](_0x15afa9[_0x97f7('0x43')],[_0x97f7('0x44'),_0x97f7('0x4d'),_0x97f7('0x4e'),_0x97f7('0x4f'),_0x97f7('0x50'),_0x97f7('0x51'),_0x97f7('0x52')]),{'where':{'context':_0x350382['context'],'exten':_0x350382[_0x97f7('0x44')]},'individualHooks':!![]})[_0x97f7('0x12')](function(_0xd275a8){return _0xd275a8;});}return null;})[_0x97f7('0x12')](respondWithStatusCode(_0x569b7f,null))[_0x97f7('0x3d')](handleError(_0x569b7f,null));};exports['addApplications']=function(_0x1bf5d5,_0x1f2ec1){var _0x39d140=_0x1bf5d5[_0x97f7('0x3f')]['id'];var _0x5e0064=_0x1bf5d5[_0x97f7('0x43')];var _0xcbe9b1=0xc8;var _0x2b7c1f=null;return db[_0x97f7('0x53')][_0x97f7('0x54')]({'isolationLevel':db[_0x97f7('0x53')][_0x97f7('0x55')][_0x97f7('0x56')]['READ_COMMITTED']},function(_0x29d3ec){return db[_0x97f7('0x27')][_0x97f7('0x57')]({'where':{'id':_0x39d140},'transaction':_0x29d3ec})[_0x97f7('0x12')](function(_0x596d13){if(_0x596d13){return db[_0x97f7('0x27')][_0x97f7('0x22')]({'where':{'VoiceExtensionId':_0x39d140},'transaction':_0x29d3ec})[_0x97f7('0x12')](function(){var _0x981199=_[_0x97f7('0x1b')](_0x5e0064,function(_0x288160){_0x288160[_0x97f7('0x58')]=_0x39d140;_0x288160['isApp']=!![];return _0x288160;});return _0x596d13[_0x97f7('0x59')](_0x981199);})['then'](function(_0xa26ab5){return db[_0x97f7('0x27')][_0x97f7('0x5a')](_0xa26ab5,{'transaction':_0x29d3ec});});}else{_0xcbe9b1=0x194;_0x2b7c1f=[];}});})[_0x97f7('0x12')](function(){if(_0xcbe9b1!==0x194){return db[_0x97f7('0x27')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x39d140},'order':_0x97f7('0x5b')})[_0x97f7('0x12')](function(_0x361923){_0x2b7c1f=_0x361923;});}})[_0x97f7('0x3d')](function(_0x494696){_0xcbe9b1=0x1f4;logger[_0x97f7('0x23')](_0x494696['stack']);if(_0x494696[_0x97f7('0x20')]){delete _0x494696[_0x97f7('0x20')];}_0x2b7c1f=_0x494696;})[_0x97f7('0x5c')](function(){if(_0x2b7c1f===null){_0x1f2ec1[_0x97f7('0xa')](_0xcbe9b1);}else{if(_0xcbe9b1===0x1f4){_0x1f2ec1[_0x97f7('0xc')](_0xcbe9b1)[_0x97f7('0x25')](_0x2b7c1f);}else{_0x1f2ec1[_0x97f7('0xc')](_0xcbe9b1)['json'](_0x2b7c1f);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index aa705df..45558dd 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 _0x3cc3=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5d506b,_0x41b1ca){var _0x2a8f24=function(_0x12821c){while(--_0x12821c){_0x5d506b['push'](_0x5d506b['shift']());}};_0x2a8f24(++_0x41b1ca);}(_0x3cc3,0x95));var _0x33cc=function(_0x3c7e04,_0xb41daf){_0x3c7e04=_0x3c7e04-0x0;var _0xa700fa=_0x3cc3[_0x3c7e04];return _0xa700fa;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x33cc('0x0'))['db'][_0x33cc('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x33cc('0x2')](0x0);var events={'afterCreate':_0x33cc('0x3'),'afterUpdate':_0x33cc('0x4'),'afterDestroy':_0x33cc('0x5')};function emitEvent(_0x29ae11){return function(_0x36c583,_0x11b152,_0x59a225){VoiceExtensionEvents[_0x33cc('0x6')](_0x29ae11+':'+_0x36c583['id'],_0x36c583);VoiceExtensionEvents[_0x33cc('0x6')](_0x29ae11,_0x36c583);_0x59a225(null);};}for(var e in events){if(events[_0x33cc('0x7')](e)){var event=events[e];VoiceExtension[_0x33cc('0x8')](e,emitEvent(event));}}module[_0x33cc('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0xb3fb=['VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x54395b,_0x51babb){var _0x199c87=function(_0x3e7bd8){while(--_0x3e7bd8){_0x54395b['push'](_0x54395b['shift']());}};_0x199c87(++_0x51babb);}(_0xb3fb,0x1b7));var _0xbb3f=function(_0x336030,_0x4086ea){_0x336030=_0x336030-0x0;var _0x2b203b=_0xb3fb[_0x336030];return _0x2b203b;};'use strict';var EventEmitter=require(_0xbb3f('0x0'));var VoiceExtension=require(_0xbb3f('0x1'))['db'][_0xbb3f('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xbb3f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbb3f('0x4'),'afterDestroy':_0xbb3f('0x5')};function emitEvent(_0x32c785){return function(_0x32f574,_0x8802af,_0x547d8e){VoiceExtensionEvents[_0xbb3f('0x6')](_0x32c785+':'+_0x32f574['id'],_0x32f574);VoiceExtensionEvents['emit'](_0x32c785,_0x32f574);_0x547d8e(null);};}for(var e in events){if(events[_0xbb3f('0x7')](e)){var event=events[e];VoiceExtension[_0xbb3f('0x8')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 2c158d9..c815b25 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 _0xe008=['answer','queue','playback','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','get','Hangup','./voiceExtension.attributes','exports','models','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','No\x20alias\x20set','outbound','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','join','U(xcally-mixmonitor-context)','replace','Interval','findAll','then','interval','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)'];(function(_0x4c1daa,_0x3837dd){var _0x523d81=function(_0x32ffaa){while(--_0x32ffaa){_0x4c1daa['push'](_0x4c1daa['shift']());}};_0x523d81(++_0x3837dd);}(_0xe008,0x14f));var _0x8e00=function(_0x44f447,_0x163ad3){_0x44f447=_0x44f447-0x0;var _0x1a140c=_0xe008[_0x44f447];return _0x1a140c;};'use strict';var _=require('lodash');var attributes=require(_0x8e00('0x0'));module[_0x8e00('0x1')]=function(_0x38d153){var _0x1b8e93=_0x38d153[_0x8e00('0x2')];function _0x5d8b6a(_0x1d9a68){var _0x555e84=0x2;var _0x4a6810=[{'type':_0x1d9a68[_0x8e00('0x3')],'app':_0x8e00('0x4'),'appdata':'CDR(type)='+_0x1d9a68[_0x8e00('0x3')],'context':_0x1d9a68[_0x8e00('0x5')],'exten':_0x1d9a68[_0x8e00('0x6')],'priority':_0x555e84++,'VoiceExtensionId':_0x1d9a68['id']},{'type':_0x1d9a68[_0x8e00('0x3')],'app':_0x1d9a68[_0x8e00('0x7')]?'Set':_0x8e00('0x8'),'appdata':_0x1d9a68[_0x8e00('0x7')]?_0x8e00('0x9')+_0x1d9a68['alias']:'No\x20alias\x20set','context':_0x1d9a68[_0x8e00('0x5')],'exten':_0x1d9a68[_0x8e00('0x6')],'priority':_0x555e84++,'VoiceExtensionId':_0x1d9a68['id']}];if(_0x1d9a68['type']===_0x8e00('0xa')){_0x4a6810['push']({'type':_0x8e00('0xa'),'app':'Set','appdata':_0x8e00('0xb')+_0x1d9a68['id'],'context':_0x1d9a68[_0x8e00('0x5')],'exten':_0x1d9a68['exten'],'priority':_0x555e84++,'VoiceExtensionId':_0x1d9a68['id']});}_0x4a6810[_0x8e00('0xc')]({'type':_0x1d9a68[_0x8e00('0x3')],'app':_0x8e00('0x4'),'appdata':_0x8e00('0xd'),'context':_0x1d9a68[_0x8e00('0x5')],'exten':_0x1d9a68[_0x8e00('0x6')],'priority':_0x555e84++,'VoiceExtensionId':_0x1d9a68['id']},{'type':_0x1d9a68[_0x8e00('0x3')],'app':'Set','appdata':_0x8e00('0xe'),'context':_0x1d9a68['context'],'exten':_0x1d9a68[_0x8e00('0x6')],'priority':_0x555e84++,'VoiceExtensionId':_0x1d9a68['id']},{'type':_0x1d9a68[_0x8e00('0x3')],'app':_0x8e00('0x4'),'appdata':_0x8e00('0xf'),'context':_0x1d9a68[_0x8e00('0x5')],'exten':_0x1d9a68[_0x8e00('0x6')],'priority':_0x555e84++,'VoiceExtensionId':_0x1d9a68['id']});return _0x4a6810;}function _0x5977e0(_0x1d209b){var _0x1b8093=0x2;var _0x475c49=[{'type':'outbound','app':_0x8e00('0x4'),'appdata':'CDR(type)=outbound','context':_0x1d209b['context'],'exten':_0x1d209b['exten'],'priority':_0x1b8093++,'VoiceExtensionId':_0x1d209b['id']},{'type':'outbound','app':_0x1d209b[_0x8e00('0x7')]?_0x8e00('0x4'):'NoOp','appdata':_0x1d209b[_0x8e00('0x7')]?'CDR(routeAlias)='+_0x1d209b[_0x8e00('0x7')]:_0x8e00('0x10'),'context':_0x1d209b[_0x8e00('0x5')],'exten':_0x1d209b[_0x8e00('0x6')],'priority':_0x1b8093++,'VoiceExtensionId':_0x1d209b['id']},{'type':_0x8e00('0x11'),'app':_0x8e00('0x4'),'appdata':'CDR(destination)='+(_0x1d209b[_0x8e00('0x12')]?_0x8e00('0x13')+_0x1d209b['cutdigits']+'}':'${EXTEN}'),'context':_0x1d209b[_0x8e00('0x5')],'exten':_0x1d209b[_0x8e00('0x6')],'priority':_0x1b8093++,'VoiceExtensionId':_0x1d209b['id']},{'type':'outbound','app':'Set','appdata':_0x8e00('0xb')+_0x1d209b['id'],'context':_0x1d209b[_0x8e00('0x5')],'exten':_0x1d209b[_0x8e00('0x6')],'priority':_0x1b8093++,'VoiceExtensionId':_0x1d209b['id']},{'type':_0x8e00('0x11'),'app':_0x8e00('0x14'),'appdata':_0x8e00('0x15')+(_0x1b8093+0x2)+_0x8e00('0x16')+(_0x1b8093+0x1)+')','context':_0x1d209b[_0x8e00('0x5')],'exten':_0x1d209b[_0x8e00('0x6')],'priority':_0x1b8093++,'VoiceExtensionId':_0x1d209b['id']},{'type':_0x8e00('0x11'),'app':'Set','appdata':_0x1d209b[_0x8e00('0x12')]?_0x8e00('0x17')+_0x1d209b[_0x8e00('0x12')]+'}':_0x8e00('0x18'),'context':_0x1d209b['context'],'exten':_0x1d209b[_0x8e00('0x6')],'priority':_0x1b8093++,'VoiceExtensionId':_0x1d209b['id']},{'type':_0x8e00('0x11'),'app':_0x8e00('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1d209b[_0x8e00('0x5')],'exten':_0x1d209b[_0x8e00('0x6')],'priority':_0x1b8093++,'VoiceExtensionId':_0x1d209b['id']},{'type':_0x8e00('0x11'),'app':_0x8e00('0x4'),'appdata':_0x8e00('0xe'),'context':_0x1d209b[_0x8e00('0x5')],'exten':_0x1d209b[_0x8e00('0x6')],'priority':_0x1b8093++,'VoiceExtensionId':_0x1d209b['id']},{'type':_0x8e00('0x11'),'app':_0x8e00('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1d209b[_0x8e00('0x5')],'exten':_0x1d209b[_0x8e00('0x6')],'priority':_0x1b8093++,'VoiceExtensionId':_0x1d209b['id']},{'type':'outbound','app':_0x8e00('0x4'),'appdata':_0x8e00('0x19')+_0x1d209b['id'],'context':_0x1d209b[_0x8e00('0x5')],'exten':_0x1d209b['exten'],'priority':_0x1b8093++,'VoiceExtensionId':_0x1d209b['id']}];if(_0x1d209b[_0x8e00('0x1a')]('recordingFormat')&&_0x1d209b[_0x8e00('0x1b')]!==_0x8e00('0x1c')){_0x475c49[_0x8e00('0xc')]({'type':_0x8e00('0x11'),'app':_0x8e00('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1d209b['context'],'exten':_0x1d209b[_0x8e00('0x6')],'priority':_0x1b8093++,'VoiceExtensionId':_0x1d209b['id']},{'type':_0x8e00('0x11'),'app':_0x8e00('0x4'),'appdata':_0x8e00('0x1d')+_0x1d209b[_0x8e00('0x1b')]||_0x8e00('0x1e'),'context':_0x1d209b[_0x8e00('0x5')],'exten':_0x1d209b[_0x8e00('0x6')],'priority':_0x1b8093++,'VoiceExtensionId':_0x1d209b['id']});}return _0x475c49;}function _0x122e46(_0x231043,_0x348222){var _0x46aa42=[{'name':_0x8e00('0x1f'),'param':0x0},{'name':_0x8e00('0x20'),'param':0x1},{'name':_0x8e00('0x21'),'param':0x2},{'name':_0x8e00('0x22'),'param':0x3}];var _0x5b5258={};var _0xd01870=_0x348222[_0x8e00('0x23')](',');var _0x59264a=[];for(var _0x26aa43=0x0;_0x26aa43<_0x46aa42[_0x8e00('0x24')];_0x26aa43++){switch(_0x46aa42[_0x26aa43][_0x8e00('0x25')]){case _0x8e00('0x1f'):_0x5b5258[_0x8e00('0x1f')]=_0xd01870[_0x46aa42[_0x26aa43][_0x8e00('0x26')]][_0x8e00('0x23')]('/')[0x1];_0x5b5258[_0x8e00('0x27')]=_0xd01870[_0x46aa42[_0x26aa43][_0x8e00('0x26')]]['split']('/')[0x2];_0x5b5258[_0x8e00('0x28')]=_0x5b5258[_0x8e00('0x27')]?_0x5b5258[_0x8e00('0x27')][_0x8e00('0x23')]('$')[0x0]:undefined;_0x5b5258['phone']=_0x231043['cutdigits']?(_0x5b5258['prefix']||'')+_0x8e00('0x13')+_0x231043[_0x8e00('0x12')]+'}':(_0x5b5258[_0x8e00('0x28')]||'')+'${EXTEN}';_0x59264a[_0x46aa42[_0x26aa43]['param']]=[_0x8e00('0x29'),_0x5b5258[_0x8e00('0x1f')],_0x5b5258['phone']][_0x8e00('0x2a')]('/');break;case _0x8e00('0x21'):_0x5b5258[_0x8e00('0x21')]=_0xd01870[_0x46aa42[_0x26aa43][_0x8e00('0x26')]];if(_0x231043['recordingFormat']!==_0x8e00('0x1c')){if(_0x5b5258['options']['indexOf'](_0x8e00('0x2b'))<0x0){_0x5b5258['options']+=_0x8e00('0x2b');}}else{_0x5b5258[_0x8e00('0x21')]=_0x5b5258['options'][_0x8e00('0x2c')](_0x8e00('0x2b'),'');}_0x59264a[_0x46aa42[_0x26aa43][_0x8e00('0x26')]]=_0x5b5258[_0x8e00('0x21')];break;default:_0x59264a[_0x46aa42[_0x26aa43]['param']]=_0xd01870[_0x46aa42[_0x26aa43][_0x8e00('0x26')]];}}return _0x59264a[_0x8e00('0x2a')](',');}function _0x3d8b75(_0x93f17e,_0x29de9e,_0x3727ea){return new Promise(function(_0x37bf60,_0x4289c7){var _0x588c57=[];if(_['isEmpty'](_0x29de9e))return _0x37bf60(_0x588c57);_0x1b8e93[_0x8e00('0x2d')][_0x8e00('0x2e')]({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0x8e00('0x2f')](function(_0xa90ade){for(var _0x35c67e=0x0,_0x365909=0x0;_0x35c67e<_0x29de9e['length'];_0x35c67e++,_0x365909=0x0){var _0x51ec39=_0x29de9e[_0x35c67e];var _0x5abffb=[];var _0x5c3fe4=[];delete _0x51ec39['id'];if(_0x51ec39[_0x8e00('0x30')]!==_0x8e00('0x31')){_0x51ec39[_0x8e00('0x32')]=[_0x51ec39[_0x8e00('0x30')]];}else{_0x51ec39['intervals']=_0x51ec39[_0x8e00('0x33')]?_[_0x8e00('0x34')](_[_0x8e00('0x35')](_0xa90ade,{'IntervalId':_0x51ec39[_0x8e00('0x33')]}),_0x8e00('0x30')):[];}_0x51ec39[_0x8e00('0x5')]=_0x93f17e[_0x8e00('0x5')];_0x51ec39[_0x8e00('0x6')]=_0x93f17e[_0x8e00('0x6')];if(_0x51ec39['type'])_0x51ec39[_0x8e00('0x3')]=_0x51ec39[_0x8e00('0x3')][_0x8e00('0x36')]();if(_0x93f17e[_0x8e00('0x3')]===_0x8e00('0x11')){if(_0x51ec39[_0x8e00('0x1a')](_0x8e00('0x37'))&&_0x51ec39[_0x8e00('0x37')]&&_0x51ec39[_0x8e00('0x37')]!=='--'){_0x5abffb[_0x8e00('0xc')]({'type':_0x51ec39[_0x8e00('0x3')]['toLowerCase'](),'app':_0x8e00('0x4'),'appdata':'CDR(tag)='+_0x51ec39[_0x8e00('0x37')],'context':_0x93f17e[_0x8e00('0x5')],'exten':_0x93f17e[_0x8e00('0x6')],'priority':_0x51ec39[_0x8e00('0x32')][_0x8e00('0x24')]+_0x3727ea+_0x365909++,'VoiceExtensionId':_0x93f17e['id']});}_0x5abffb['push']({'type':_0x51ec39[_0x8e00('0x3')][_0x8e00('0x36')](),'app':_0x8e00('0x14'),'appdata':_0x8e00('0x38')+(_0x51ec39['callerID']?_0x8e00('0x39')+_0x51ec39[_0x8e00('0x3a')]+')':_0x8e00('0x3b')),'context':_0x93f17e[_0x8e00('0x5')],'exten':_0x93f17e[_0x8e00('0x6')],'priority':_0x51ec39[_0x8e00('0x32')][_0x8e00('0x24')]+_0x3727ea+_0x365909++,'VoiceExtensionId':_0x93f17e['id']});}else{if(_0x51ec39[_0x8e00('0x1a')](_0x8e00('0x3c'))){if([_0x8e00('0x3d'),_0x8e00('0x3e')]['includes'](_0x51ec39[_0x8e00('0x3f')][_0x8e00('0x36')]())&&_0x51ec39[_0x8e00('0x40')]!==_0x8e00('0x41')){if(_0x51ec39[_0x8e00('0x3c')]){_0x5abffb[_0x8e00('0xc')]({'type':_0x51ec39[_0x8e00('0x3')][_0x8e00('0x36')](),'app':_0x8e00('0x14'),'appdata':_0x8e00('0x42'),'context':_0x93f17e['context'],'exten':_0x93f17e[_0x8e00('0x6')],'priority':_0x51ec39[_0x8e00('0x32')][_0x8e00('0x24')]+_0x3727ea+_0x365909++,'VoiceExtensionId':_0x93f17e['id']});_0x5abffb[_0x8e00('0xc')]({'type':_0x51ec39['type'][_0x8e00('0x36')](),'app':_0x8e00('0x4'),'appdata':_0x8e00('0x43'),'context':_0x93f17e[_0x8e00('0x5')],'exten':_0x93f17e['exten'],'priority':_0x51ec39[_0x8e00('0x32')]['length']+_0x3727ea+_0x365909++,'VoiceExtensionId':_0x93f17e['id']});}else{_0x5abffb[_0x8e00('0xc')]({'type':_0x51ec39[_0x8e00('0x3')][_0x8e00('0x36')](),'app':_0x8e00('0x14'),'appdata':_0x8e00('0x44'),'context':_0x93f17e[_0x8e00('0x5')],'exten':_0x93f17e[_0x8e00('0x6')],'priority':_0x51ec39[_0x8e00('0x32')]['length']+_0x3727ea+_0x365909++,'VoiceExtensionId':_0x93f17e['id']});_0x5abffb[_0x8e00('0xc')]({'type':_0x51ec39['type']['toLowerCase'](),'app':_0x8e00('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x93f17e['context'],'exten':_0x93f17e[_0x8e00('0x6')],'priority':_0x51ec39[_0x8e00('0x32')][_0x8e00('0x24')]+_0x3727ea+_0x365909++,'VoiceExtensionId':_0x93f17e['id']});}}}}for(var _0x2edfb4=0x0;_0x2edfb4<_0x51ec39[_0x8e00('0x32')][_0x8e00('0x24')];_0x2edfb4++){var _0x4b3d97=_0x3727ea+_0x51ec39[_0x8e00('0x32')][_0x8e00('0x24')];var _0x399814=_0x2edfb4===_0x51ec39[_0x8e00('0x32')][_0x8e00('0x24')]-0x1?_0x3727ea+_0x5abffb['length']+_0x5c3fe4[_0x8e00('0x24')]+0x2:_0x3727ea+_0x2edfb4+0x1;_0x5abffb[_0x8e00('0x45')](_0x2edfb4,0x0,{'type':_0x93f17e[_0x8e00('0x3')],'app':_0x8e00('0x46'),'appdata':_0x51ec39[_0x8e00('0x32')][_0x2edfb4]+'?'+_0x93f17e[_0x8e00('0x5')]+_0x8e00('0x47')+_0x4b3d97+':'+_0x93f17e[_0x8e00('0x5')]+_0x8e00('0x47')+_0x399814,'exten':_0x93f17e[_0x8e00('0x6')],'context':_0x93f17e[_0x8e00('0x5')],'priority':_0x3727ea+_0x2edfb4,'VoiceExtensionId':_0x93f17e['id']});}if(_0x51ec39[_0x8e00('0x40')]===_0x8e00('0x48'))_0x51ec39[_0x8e00('0x49')]=_0x122e46(_0x93f17e,_0x51ec39[_0x8e00('0x49')]);_0x51ec39[_0x8e00('0x4a')]=_0x5abffb[_0x8e00('0x24')]?_[_0x8e00('0x4b')](_0x5abffb)[_0x8e00('0x4a')]+0x1:_0x3727ea;_0x588c57=_[_0x8e00('0x4c')](_0x588c57,_0x5abffb,[_0x51ec39],_0x5c3fe4);_0x3727ea=_['last'](_0x588c57)[_0x8e00('0x4a')]+0x1;}return _0x37bf60(_0x588c57);})['catch'](function(_0x334532){_0x4289c7(_0x334532);});});}return _0x38d153['define']('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x18fa37){var _0x533be7=this[_0x8e00('0x4d')]({'plain':!![]});var _0x2ffa02=_0x533be7[_0x8e00('0x3')]==='outbound'?_0x5977e0(_0x533be7):_0x5d8b6a(_0x533be7);return _0x3d8b75(_0x533be7,_0x18fa37,_[_0x8e00('0x4b')](_0x2ffa02)['priority']+0x1)[_0x8e00('0x2f')](function(_0x33c51e){var _0xe237ff=_[_0x8e00('0x4c')](_0x2ffa02,_0x33c51e);_0xe237ff[_0x8e00('0xc')]({'type':_0x533be7[_0x8e00('0x3')],'app':_0x8e00('0x4e'),'exten':_0x533be7['exten'],'context':_0x533be7[_0x8e00('0x5')],'priority':_['last'](_0xe237ff)[_0x8e00('0x4a')]+0x1,'VoiceExtensionId':_0x533be7['id']});return _0xe237ff;});}}});}; \ No newline at end of file +var _0x444a=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','hasOwnProperty','tag','CDR(tag)=','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','playback','includes','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','get','concat','lodash','exports','models','Set','type','context','exten','NoOp','CDR(routeAlias)=','alias','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','No\x20alias\x20set','${EXTEN:','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','recordingFormat'];(function(_0x2485a3,_0x11bb0b){var _0x1ff6ac=function(_0x58f48f){while(--_0x58f48f){_0x2485a3['push'](_0x2485a3['shift']());}};_0x1ff6ac(++_0x11bb0b);}(_0x444a,0x170));var _0xa444=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0x444a[_0x4cc492];return _0x1f36b9;};'use strict';var _=require(_0xa444('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xa444('0x1')]=function(_0x30df14){var _0xb8db2e=_0x30df14[_0xa444('0x2')];function _0xc3acef(_0x1950cd){var _0x5a3426=0x2;var _0x30b1e8=[{'type':_0x1950cd['type'],'app':_0xa444('0x3'),'appdata':'CDR(type)='+_0x1950cd[_0xa444('0x4')],'context':_0x1950cd[_0xa444('0x5')],'exten':_0x1950cd[_0xa444('0x6')],'priority':_0x5a3426++,'VoiceExtensionId':_0x1950cd['id']},{'type':_0x1950cd[_0xa444('0x4')],'app':_0x1950cd['alias']?_0xa444('0x3'):_0xa444('0x7'),'appdata':_0x1950cd['alias']?_0xa444('0x8')+_0x1950cd[_0xa444('0x9')]:'No\x20alias\x20set','context':_0x1950cd['context'],'exten':_0x1950cd[_0xa444('0x6')],'priority':_0x5a3426++,'VoiceExtensionId':_0x1950cd['id']}];if(_0x1950cd['type']===_0xa444('0xa')){_0x30b1e8[_0xa444('0xb')]({'type':_0xa444('0xa'),'app':_0xa444('0x3'),'appdata':_0xa444('0xc')+_0x1950cd['id'],'context':_0x1950cd['context'],'exten':_0x1950cd['exten'],'priority':_0x5a3426++,'VoiceExtensionId':_0x1950cd['id']});}_0x30b1e8[_0xa444('0xb')]({'type':_0x1950cd['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1950cd[_0xa444('0x5')],'exten':_0x1950cd['exten'],'priority':_0x5a3426++,'VoiceExtensionId':_0x1950cd['id']},{'type':_0x1950cd[_0xa444('0x4')],'app':_0xa444('0x3'),'appdata':_0xa444('0xd'),'context':_0x1950cd[_0xa444('0x5')],'exten':_0x1950cd[_0xa444('0x6')],'priority':_0x5a3426++,'VoiceExtensionId':_0x1950cd['id']},{'type':_0x1950cd[_0xa444('0x4')],'app':_0xa444('0x3'),'appdata':_0xa444('0xe'),'context':_0x1950cd[_0xa444('0x5')],'exten':_0x1950cd[_0xa444('0x6')],'priority':_0x5a3426++,'VoiceExtensionId':_0x1950cd['id']});return _0x30b1e8;}function _0x21ee23(_0x439ebe){var _0x3eef32=0x2;var _0x453be3=[{'type':'outbound','app':_0xa444('0x3'),'appdata':_0xa444('0xf'),'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':_0xa444('0x10'),'app':_0x439ebe['alias']?_0xa444('0x3'):_0xa444('0x7'),'appdata':_0x439ebe[_0xa444('0x9')]?'CDR(routeAlias)='+_0x439ebe[_0xa444('0x9')]:_0xa444('0x11'),'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':'outbound','app':_0xa444('0x3'),'appdata':'CDR(destination)='+(_0x439ebe['cutdigits']?_0xa444('0x12')+_0x439ebe[_0xa444('0x13')]+'}':_0xa444('0x14')),'context':_0x439ebe['context'],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':_0xa444('0x10'),'app':_0xa444('0x3'),'appdata':_0xa444('0xc')+_0x439ebe['id'],'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe['exten'],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':_0xa444('0x10'),'app':_0xa444('0x15'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3eef32+0x2)+_0xa444('0x16')+(_0x3eef32+0x1)+')','context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe['exten'],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':'outbound','app':_0xa444('0x3'),'appdata':_0x439ebe['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x439ebe[_0xa444('0x13')]+'}':_0xa444('0x17'),'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':'outbound','app':_0xa444('0x3'),'appdata':_0xa444('0x18'),'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe['exten'],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':_0xa444('0x10'),'app':_0xa444('0x3'),'appdata':_0xa444('0xd'),'context':_0x439ebe['context'],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':'outbound','app':_0xa444('0x3'),'appdata':_0xa444('0xe'),'context':_0x439ebe['context'],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':_0xa444('0x10'),'app':_0xa444('0x3'),'appdata':_0xa444('0x19')+_0x439ebe['id'],'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']}];if(_0x439ebe['hasOwnProperty'](_0xa444('0x1a'))&&_0x439ebe[_0xa444('0x1a')]!=='none'){_0x453be3[_0xa444('0xb')]({'type':_0xa444('0x10'),'app':_0xa444('0x3'),'appdata':_0xa444('0x1b'),'context':_0x439ebe['context'],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':_0xa444('0x10'),'app':_0xa444('0x3'),'appdata':_0xa444('0x1c')+_0x439ebe[_0xa444('0x1a')]||_0xa444('0x1d'),'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']});}return _0x453be3;}function _0x243302(_0x4e450d,_0x5984ba){var _0xed78de=[{'name':_0xa444('0x1e'),'param':0x0},{'name':_0xa444('0x1f'),'param':0x1},{'name':_0xa444('0x20'),'param':0x2},{'name':_0xa444('0x21'),'param':0x3}];var _0x8c35da={};var _0x6ca740=_0x5984ba[_0xa444('0x22')](',');var _0x2ad35f=[];for(var _0x349577=0x0;_0x349577<_0xed78de[_0xa444('0x23')];_0x349577++){switch(_0xed78de[_0x349577][_0xa444('0x24')]){case _0xa444('0x1e'):_0x8c35da['trunk']=_0x6ca740[_0xed78de[_0x349577][_0xa444('0x25')]][_0xa444('0x22')]('/')[0x1];_0x8c35da[_0xa444('0x26')]=_0x6ca740[_0xed78de[_0x349577][_0xa444('0x25')]]['split']('/')[0x2];_0x8c35da[_0xa444('0x27')]=_0x8c35da[_0xa444('0x26')]?_0x8c35da[_0xa444('0x26')][_0xa444('0x22')]('$')[0x0]:undefined;_0x8c35da[_0xa444('0x26')]=_0x4e450d[_0xa444('0x13')]?(_0x8c35da['prefix']||'')+_0xa444('0x12')+_0x4e450d[_0xa444('0x13')]+'}':(_0x8c35da[_0xa444('0x27')]||'')+_0xa444('0x14');_0x2ad35f[_0xed78de[_0x349577]['param']]=[_0xa444('0x28'),_0x8c35da[_0xa444('0x1e')],_0x8c35da['phone']][_0xa444('0x29')]('/');break;case _0xa444('0x20'):_0x8c35da[_0xa444('0x20')]=_0x6ca740[_0xed78de[_0x349577][_0xa444('0x25')]];if(_0x4e450d[_0xa444('0x1a')]!=='none'){if(_0x8c35da[_0xa444('0x20')][_0xa444('0x2a')]('U(xcally-mixmonitor-context)')<0x0){_0x8c35da[_0xa444('0x20')]+=_0xa444('0x2b');}}else{_0x8c35da[_0xa444('0x20')]=_0x8c35da[_0xa444('0x20')][_0xa444('0x2c')](_0xa444('0x2b'),'');}_0x2ad35f[_0xed78de[_0x349577][_0xa444('0x25')]]=_0x8c35da[_0xa444('0x20')];break;default:_0x2ad35f[_0xed78de[_0x349577]['param']]=_0x6ca740[_0xed78de[_0x349577]['param']];}}return _0x2ad35f[_0xa444('0x29')](',');}function _0x250108(_0x2dc082,_0x589188,_0x5a16c2){return new Promise(function(_0x1a9856,_0x4102ec){var _0x3a2168=[];if(_[_0xa444('0x2d')](_0x589188))return _0x1a9856(_0x3a2168);_0xb8db2e[_0xa444('0x2e')][_0xa444('0x2f')]({'attributes':['id',_0xa444('0x30'),_0xa444('0x31')],'raw':!![]})[_0xa444('0x32')](function(_0x586dd4){for(var _0x1e2eee=0x0,_0x3e61ce=0x0;_0x1e2eee<_0x589188[_0xa444('0x23')];_0x1e2eee++,_0x3e61ce=0x0){var _0x5c49fa=_0x589188[_0x1e2eee];var _0xbda0ea=[];var _0x56df7a=[];delete _0x5c49fa['id'];if(_0x5c49fa[_0xa444('0x30')]!==_0xa444('0x33')){_0x5c49fa[_0xa444('0x34')]=[_0x5c49fa[_0xa444('0x30')]];}else{_0x5c49fa['intervals']=_0x5c49fa[_0xa444('0x31')]?_['map'](_['filter'](_0x586dd4,{'IntervalId':_0x5c49fa['IntervalId']}),_0xa444('0x30')):[];}_0x5c49fa[_0xa444('0x5')]=_0x2dc082[_0xa444('0x5')];_0x5c49fa[_0xa444('0x6')]=_0x2dc082[_0xa444('0x6')];if(_0x5c49fa['type'])_0x5c49fa['type']=_0x5c49fa[_0xa444('0x4')]['toLowerCase']();if(_0x2dc082[_0xa444('0x4')]===_0xa444('0x10')){if(_0x5c49fa[_0xa444('0x35')](_0xa444('0x36'))&&_0x5c49fa['tag']&&_0x5c49fa[_0xa444('0x36')]!=='--'){_0xbda0ea[_0xa444('0xb')]({'type':_0x5c49fa[_0xa444('0x4')]['toLowerCase'](),'app':_0xa444('0x3'),'appdata':_0xa444('0x37')+_0x5c49fa[_0xa444('0x36')],'context':_0x2dc082[_0xa444('0x5')],'exten':_0x2dc082[_0xa444('0x6')],'priority':_0x5c49fa[_0xa444('0x34')][_0xa444('0x23')]+_0x5a16c2+_0x3e61ce++,'VoiceExtensionId':_0x2dc082['id']});}_0xbda0ea[_0xa444('0xb')]({'type':_0x5c49fa[_0xa444('0x4')][_0xa444('0x38')](),'app':'ExecIf','appdata':_0xa444('0x39')+(_0x5c49fa[_0xa444('0x3a')]?'Set(CALLERID(all)='+_0x5c49fa['callerID']+')':_0xa444('0x3b')),'context':_0x2dc082[_0xa444('0x5')],'exten':_0x2dc082[_0xa444('0x6')],'priority':_0x5c49fa['intervals'][_0xa444('0x23')]+_0x5a16c2+_0x3e61ce++,'VoiceExtensionId':_0x2dc082['id']});}else{if(_0x5c49fa[_0xa444('0x35')](_0xa444('0x3c'))){if(['queue',_0xa444('0x3d')][_0xa444('0x3e')](_0x5c49fa['app']['toLowerCase']())&&_0x5c49fa[_0xa444('0x3f')]!==_0xa444('0x40')){if(_0x5c49fa[_0xa444('0x3c')]){_0xbda0ea[_0xa444('0xb')]({'type':_0x5c49fa[_0xa444('0x4')][_0xa444('0x38')](),'app':_0xa444('0x15'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2dc082[_0xa444('0x5')],'exten':_0x2dc082[_0xa444('0x6')],'priority':_0x5c49fa[_0xa444('0x34')][_0xa444('0x23')]+_0x5a16c2+_0x3e61ce++,'VoiceExtensionId':_0x2dc082['id']});_0xbda0ea[_0xa444('0xb')]({'type':_0x5c49fa['type'][_0xa444('0x38')](),'app':_0xa444('0x3'),'appdata':_0xa444('0x41'),'context':_0x2dc082['context'],'exten':_0x2dc082[_0xa444('0x6')],'priority':_0x5c49fa[_0xa444('0x34')][_0xa444('0x23')]+_0x5a16c2+_0x3e61ce++,'VoiceExtensionId':_0x2dc082['id']});}else{_0xbda0ea[_0xa444('0xb')]({'type':_0x5c49fa[_0xa444('0x4')][_0xa444('0x38')](),'app':_0xa444('0x15'),'appdata':_0xa444('0x42'),'context':_0x2dc082['context'],'exten':_0x2dc082['exten'],'priority':_0x5c49fa['intervals'][_0xa444('0x23')]+_0x5a16c2+_0x3e61ce++,'VoiceExtensionId':_0x2dc082['id']});_0xbda0ea['push']({'type':_0x5c49fa[_0xa444('0x4')][_0xa444('0x38')](),'app':_0xa444('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x2dc082[_0xa444('0x5')],'exten':_0x2dc082[_0xa444('0x6')],'priority':_0x5c49fa[_0xa444('0x34')][_0xa444('0x23')]+_0x5a16c2+_0x3e61ce++,'VoiceExtensionId':_0x2dc082['id']});}}}}for(var _0x2c906a=0x0;_0x2c906a<_0x5c49fa[_0xa444('0x34')][_0xa444('0x23')];_0x2c906a++){var _0x4b93e2=_0x5a16c2+_0x5c49fa['intervals'][_0xa444('0x23')];var _0x2baa8c=_0x2c906a===_0x5c49fa[_0xa444('0x34')][_0xa444('0x23')]-0x1?_0x5a16c2+_0xbda0ea[_0xa444('0x23')]+_0x56df7a[_0xa444('0x23')]+0x2:_0x5a16c2+_0x2c906a+0x1;_0xbda0ea[_0xa444('0x43')](_0x2c906a,0x0,{'type':_0x2dc082[_0xa444('0x4')],'app':_0xa444('0x44'),'appdata':_0x5c49fa['intervals'][_0x2c906a]+'?'+_0x2dc082[_0xa444('0x5')]+_0xa444('0x45')+_0x4b93e2+':'+_0x2dc082[_0xa444('0x5')]+_0xa444('0x45')+_0x2baa8c,'exten':_0x2dc082[_0xa444('0x6')],'context':_0x2dc082['context'],'priority':_0x5a16c2+_0x2c906a,'VoiceExtensionId':_0x2dc082['id']});}if(_0x5c49fa[_0xa444('0x3f')]===_0xa444('0x46'))_0x5c49fa[_0xa444('0x47')]=_0x243302(_0x2dc082,_0x5c49fa[_0xa444('0x47')]);_0x5c49fa[_0xa444('0x48')]=_0xbda0ea[_0xa444('0x23')]?_[_0xa444('0x49')](_0xbda0ea)[_0xa444('0x48')]+0x1:_0x5a16c2;_0x3a2168=_['concat'](_0x3a2168,_0xbda0ea,[_0x5c49fa],_0x56df7a);_0x5a16c2=_[_0xa444('0x49')](_0x3a2168)[_0xa444('0x48')]+0x1;}return _0x1a9856(_0x3a2168);})[_0xa444('0x4a')](function(_0xb65f0c){_0x4102ec(_0xb65f0c);});});}return _0x30df14[_0xa444('0x4b')](_0xa444('0x4c'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x45e270){var _0x10f933=this[_0xa444('0x4d')]({'plain':!![]});var _0x1d162b=_0x10f933[_0xa444('0x4')]==='outbound'?_0x21ee23(_0x10f933):_0xc3acef(_0x10f933);return _0x250108(_0x10f933,_0x45e270,_['last'](_0x1d162b)['priority']+0x1)['then'](function(_0x5c5e5d){var _0x4dc582=_[_0xa444('0x4e')](_0x1d162b,_0x5c5e5d);_0x4dc582[_0xa444('0xb')]({'type':_0x10f933[_0xa444('0x4')],'app':'Hangup','exten':_0x10f933['exten'],'context':_0x10f933[_0xa444('0x5')],'priority':_['last'](_0x4dc582)[_0xa444('0x48')]+0x1,'VoiceExtensionId':_0x10f933['id']});return _0x4dc582;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 7329de9..2e3ef60 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 _0xb242=['defaults','localhost','./voiceExtension.socket','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','findAll','options','raw','where','limit','include','model','attributes','GetVoiceExtension','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis'];(function(_0x4f4b56,_0x248ae9){var _0x10d809=function(_0x4a90ee){while(--_0x4a90ee){_0x4f4b56['push'](_0x4f4b56['shift']());}};_0x10d809(++_0x248ae9);}(_0xb242,0x1f3));var _0x2b24=function(_0x3f25b2,_0x412bd4){_0x3f25b2=_0x3f25b2-0x0;var _0xd8caeb=_0xb242[_0x3f25b2];return _0xd8caeb;};'use strict';var _=require('lodash');var util=require(_0x2b24('0x0'));var moment=require(_0x2b24('0x1'));var BPromise=require(_0x2b24('0x2'));var rs=require(_0x2b24('0x3'));var fs=require('fs');var Redis=require(_0x2b24('0x4'));var db=require(_0x2b24('0x5'))['db'];var utils=require(_0x2b24('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2b24('0x7'));var jayson=require(_0x2b24('0x8'));var client=jayson['client'][_0x2b24('0x9')]({'port':0x232a});config[_0x2b24('0xa')]=_[_0x2b24('0xb')](config['redis'],{'host':_0x2b24('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2b24('0xa')]));require(_0x2b24('0xd'))['register'](socket);function respondWithRpcPromise(_0x280030,_0x56dd79,_0x24efd2){return new BPromise(function(_0x12a5cb,_0x5e219d){return client['request'](_0x280030,_0x24efd2)[_0x2b24('0xe')](function(_0x4ab047){logger[_0x2b24('0xf')](_0x2b24('0x10'),_0x56dd79,_0x2b24('0x11'));logger[_0x2b24('0x12')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x56dd79,'request\x20sent',JSON[_0x2b24('0x13')](_0x4ab047));if(_0x4ab047[_0x2b24('0x14')]){if(_0x4ab047[_0x2b24('0x14')][_0x2b24('0x15')]===0x1f4){logger[_0x2b24('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x56dd79,_0x4ab047[_0x2b24('0x14')][_0x2b24('0x16')]);return _0x5e219d(_0x4ab047['error'][_0x2b24('0x16')]);}logger[_0x2b24('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x56dd79,_0x4ab047[_0x2b24('0x14')][_0x2b24('0x16')]);return _0x12a5cb(_0x4ab047[_0x2b24('0x14')][_0x2b24('0x16')]);}else{logger['info'](_0x2b24('0x10'),_0x56dd79,_0x2b24('0x11'));_0x12a5cb(_0x4ab047[_0x2b24('0x17')]['message']);}})[_0x2b24('0x18')](function(_0xa45843){logger[_0x2b24('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x56dd79,_0xa45843);_0x5e219d(_0xa45843);});});}exports['GetVoiceExtension']=function(_0x30f993){var _0x271827=this;return new Promise(function(_0xb6e4f8,_0x357596){return db['VoiceExtension'][_0x2b24('0x19')]({'raw':_0x30f993[_0x2b24('0x1a')]?_0x30f993[_0x2b24('0x1a')][_0x2b24('0x1b')]===undefined?!![]:![]:!![],'where':_0x30f993['options']?_0x30f993['options'][_0x2b24('0x1c')]||null:null,'attributes':_0x30f993['options']?_0x30f993['options']['attributes']||null:null,'limit':_0x30f993['options']?_0x30f993[_0x2b24('0x1a')][_0x2b24('0x1d')]||null:null,'include':_0x30f993[_0x2b24('0x1a')]?_0x30f993[_0x2b24('0x1a')]['include']?_['map'](_0x30f993['options'][_0x2b24('0x1e')],function(_0x20801c){return{'model':db[_0x20801c[_0x2b24('0x1f')]],'as':_0x20801c['as'],'attributes':_0x20801c[_0x2b24('0x20')],'include':_0x20801c['include']?_['map'](_0x20801c[_0x2b24('0x1e')],function(_0x3bd10a){return{'model':db[_0x3bd10a['model']],'as':_0x3bd10a['as'],'attributes':_0x3bd10a['attributes'],'include':_0x3bd10a[_0x2b24('0x1e')]?_['map'](_0x3bd10a['include'],function(_0x2a9a05){return{'model':db[_0x2a9a05[_0x2b24('0x1f')]],'as':_0x2a9a05['as'],'attributes':_0x2a9a05[_0x2b24('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2b24('0xe')](function(_0x4e6991){logger[_0x2b24('0xf')]('GetVoiceExtension',_0x30f993);logger[_0x2b24('0x12')](_0x2b24('0x21'),_0x30f993,JSON[_0x2b24('0x13')](_0x4e6991));_0xb6e4f8(_0x4e6991);})[_0x2b24('0x18')](function(_0x316253){logger[_0x2b24('0x14')](_0x2b24('0x21'),_0x316253[_0x2b24('0x16')],_0x30f993);_0x357596(_0x271827[_0x2b24('0x14')](0x1f4,_0x316253[_0x2b24('0x16')]));});});}; \ No newline at end of file +var _0x56a6=['where','attributes','limit','include','map','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','info','result','GetVoiceExtension','findAll','options'];(function(_0x1f1f3b,_0x227aa9){var _0x2e63aa=function(_0x165a34){while(--_0x165a34){_0x1f1f3b['push'](_0x1f1f3b['shift']());}};_0x2e63aa(++_0x227aa9);}(_0x56a6,0x17b));var _0x656a=function(_0x3aaa3b,_0x3ddddc){_0x3aaa3b=_0x3aaa3b-0x0;var _0x28983f=_0x56a6[_0x3aaa3b];return _0x28983f;};'use strict';var _=require(_0x656a('0x0'));var util=require(_0x656a('0x1'));var moment=require(_0x656a('0x2'));var BPromise=require(_0x656a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x656a('0x4'))['db'];var utils=require(_0x656a('0x5'));var logger=require(_0x656a('0x6'))('rpc');var config=require(_0x656a('0x7'));var jayson=require(_0x656a('0x8'));var client=jayson[_0x656a('0x9')]['http']({'port':0x232a});config[_0x656a('0xa')]=_[_0x656a('0xb')](config[_0x656a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x656a('0xc'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x656a('0xd')](socket);function respondWithRpcPromise(_0x11c10f,_0x380aa8,_0x218d19){return new BPromise(function(_0x4d9f32,_0x2bc0ae){return client[_0x656a('0xe')](_0x11c10f,_0x218d19)[_0x656a('0xf')](function(_0x111aaa){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x380aa8,'request\x20sent');logger[_0x656a('0x10')](_0x656a('0x11'),_0x380aa8,_0x656a('0x12'),JSON[_0x656a('0x13')](_0x111aaa));if(_0x111aaa[_0x656a('0x14')]){if(_0x111aaa['error'][_0x656a('0x15')]===0x1f4){logger[_0x656a('0x14')](_0x656a('0x16'),_0x380aa8,_0x111aaa[_0x656a('0x14')][_0x656a('0x17')]);return _0x2bc0ae(_0x111aaa[_0x656a('0x14')][_0x656a('0x17')]);}logger[_0x656a('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x380aa8,_0x111aaa[_0x656a('0x14')][_0x656a('0x17')]);return _0x4d9f32(_0x111aaa[_0x656a('0x14')][_0x656a('0x17')]);}else{logger[_0x656a('0x18')](_0x656a('0x16'),_0x380aa8,_0x656a('0x12'));_0x4d9f32(_0x111aaa[_0x656a('0x19')][_0x656a('0x17')]);}})['catch'](function(_0x38be9f){logger[_0x656a('0x14')](_0x656a('0x16'),_0x380aa8,_0x38be9f);_0x2bc0ae(_0x38be9f);});});}exports[_0x656a('0x1a')]=function(_0x2ecc76){var _0x17377a=this;return new Promise(function(_0x3e1307,_0x1cecf4){return db['VoiceExtension'][_0x656a('0x1b')]({'raw':_0x2ecc76['options']?_0x2ecc76['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ecc76['options']?_0x2ecc76[_0x656a('0x1c')][_0x656a('0x1d')]||null:null,'attributes':_0x2ecc76['options']?_0x2ecc76[_0x656a('0x1c')][_0x656a('0x1e')]||null:null,'limit':_0x2ecc76[_0x656a('0x1c')]?_0x2ecc76['options'][_0x656a('0x1f')]||null:null,'include':_0x2ecc76[_0x656a('0x1c')]?_0x2ecc76[_0x656a('0x1c')][_0x656a('0x20')]?_[_0x656a('0x21')](_0x2ecc76[_0x656a('0x1c')][_0x656a('0x20')],function(_0x15271f){return{'model':db[_0x15271f['model']],'as':_0x15271f['as'],'attributes':_0x15271f[_0x656a('0x1e')],'include':_0x15271f['include']?_[_0x656a('0x21')](_0x15271f['include'],function(_0x2008fe){return{'model':db[_0x2008fe['model']],'as':_0x2008fe['as'],'attributes':_0x2008fe[_0x656a('0x1e')],'include':_0x2008fe['include']?_[_0x656a('0x21')](_0x2008fe['include'],function(_0x55abd2){return{'model':db[_0x55abd2['model']],'as':_0x55abd2['as'],'attributes':_0x55abd2[_0x656a('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb19ba7){logger['info'](_0x656a('0x1a'),_0x2ecc76);logger[_0x656a('0x10')](_0x656a('0x1a'),_0x2ecc76,JSON[_0x656a('0x13')](_0xb19ba7));_0x3e1307(_0xb19ba7);})['catch'](function(_0x4f81bb){logger[_0x656a('0x14')](_0x656a('0x1a'),_0x4f81bb['message'],_0x2ecc76);_0x1cecf4(_0x17377a[_0x656a('0x14')](0x1f4,_0x4f81bb[_0x656a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 49fdccc..4cc43ac 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1b721f,_0xeaebe4){_0x1b721f=_0x1b721f-0x0;var _0x366333=_0x1cb9[_0x1b721f];return _0x366333;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file +var _0x7fbe=['length','voiceExtension:','remove','update','emit','removeListener','register'];(function(_0x5e497c,_0x35e06e){var _0x51620b=function(_0x2a066d){while(--_0x2a066d){_0x5e497c['push'](_0x5e497c['shift']());}};_0x51620b(++_0x35e06e);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1f4449,_0xe1b863){_0x1f4449=_0x1f4449-0x0;var _0x1c860a=_0x7fbe[_0x1f4449];return _0x1c860a;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=['save',_0xe7fb('0x0'),_0xe7fb('0x1')];function createListener(_0x294c21,_0x1703d5){return function(_0x517d3a){_0x1703d5[_0xe7fb('0x2')](_0x294c21,_0x517d3a);};}function removeListener(_0x11d2c4,_0x4524ff){return function(){VoiceExtensionEvents[_0xe7fb('0x3')](_0x11d2c4,_0x4524ff);};}exports[_0xe7fb('0x4')]=function(_0x290172){for(var _0x12d1b0=0x0,_0x24cd67=events[_0xe7fb('0x5')];_0x12d1b0<_0x24cd67;_0x12d1b0++){var _0x5ad75b=events[_0x12d1b0];var _0x213ebc=createListener(_0xe7fb('0x6')+_0x5ad75b,_0x290172);VoiceExtensionEvents['on'](_0x5ad75b,_0x213ebc);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 94de276..37d21b9 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 _0xa6b0=['post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages'];(function(_0x222dc8,_0x5b78cc){var _0x39c25b=function(_0x2902d2){while(--_0x2902d2){_0x222dc8['push'](_0x222dc8['shift']());}};_0x39c25b(++_0x5b78cc);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x44af3a,_0x1fa781){_0x44af3a=_0x44af3a-0x0;var _0x10c37f=_0xa6b0[_0x44af3a];return _0x10c37f;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var fs_extra=require(_0x0a6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var controller=require(_0x0a6b('0x7'));router[_0x0a6b('0x8')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x8')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xc')]);router[_0x0a6b('0x8')](_0x0a6b('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x0a6b('0xe')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xf')]);router[_0x0a6b('0x10')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x11')]);router[_0x0a6b('0x12')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x13')]);module[_0x0a6b('0x14')]=router; \ No newline at end of file +var _0x7096=['../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x23cc14,_0x1a9a85){var _0xacc80c=function(_0x38e067){while(--_0x38e067){_0x23cc14['push'](_0x23cc14['shift']());}};_0xacc80c(++_0x1a9a85);}(_0x7096,0x10c));var _0x6709=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x7096[_0x5447fd];return _0x15b28a;};'use strict';var multer=require('multer');var util=require(_0x6709('0x0'));var path=require('path');var timeout=require(_0x6709('0x1'));var express=require('express');var router=express[_0x6709('0x2')]();var fs_extra=require(_0x6709('0x3'));var auth=require(_0x6709('0x4'));var interaction=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var controller=require(_0x6709('0x7'));router[_0x6709('0x8')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xa')]);router[_0x6709('0x8')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0xc')]);router['get']('/:id/messages',auth[_0x6709('0x9')](),controller[_0x6709('0xd')]);router[_0x6709('0xe')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xf')]);router[_0x6709('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6709('0x11')]);router[_0x6709('0x12')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0x13')]);module[_0x6709('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index d6b0824..e3fd833 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 _0xdc6a=['VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','trim','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x58121f,_0x3b3c32){var _0x2708d1=function(_0x16d89f){while(--_0x16d89f){_0x58121f['push'](_0x58121f['shift']());}};_0x2708d1(++_0x3b3c32);}(_0xdc6a,0xaf));var _0xadc6=function(_0x5c54c2,_0x7f25e0){_0x5c54c2=_0x5c54c2-0x0;var _0x304b2d=_0xdc6a[_0x5c54c2];return _0x304b2d;};'use strict';var Sequelize=require('sequelize');module[_0xadc6('0x0')]={'customer_id':{'type':Sequelize[_0xadc6('0x1')]},'context':{'type':Sequelize[_0xadc6('0x1')],'defaultValue':_0xadc6('0x2'),'unique':_0xadc6('0x3')},'mailbox':{'type':Sequelize[_0xadc6('0x1')],'defaultValue':'','allowNull':![],'unique':_0xadc6('0x3')},'password':{'type':Sequelize[_0xadc6('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xadc6('0x1')],'validate':{'isEmail':!![]},'set':function(_0x10c63d){this[_0xadc6('0x4')](_0xadc6('0x5'),typeof _0x10c63d==='string'&&_0x10c63d[_0xadc6('0x6')]()?_0x10c63d[_0xadc6('0x6')]():null);}},'pager':{'type':Sequelize[_0xadc6('0x1')]},'tz':{'type':Sequelize[_0xadc6('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0xadc6('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xadc6('0x8')](_0xadc6('0x7'),'no'),'defaultValue':_0xadc6('0x7'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xadc6('0x1')]},'review':{'type':Sequelize['ENUM'](_0xadc6('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xadc6('0x8')](_0xadc6('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xadc6('0x8')](_0xadc6('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xadc6('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xadc6('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xadc6('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xadc6('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0xadc6('0x8')](_0xadc6('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xadc6('0x8')](_0xadc6('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xadc6('0x8')](_0xadc6('0x7'),'no'),'defaultValue':_0xadc6('0x7'),'allowNull':![]},'stamp':{'type':_0xadc6('0xa')},'emailsubject':{'type':Sequelize[_0xadc6('0x1')]},'emailbody':{'type':Sequelize[_0xadc6('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xadc6('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xadc6('0xc')],'get':function(){return this['getDataValue'](_0xadc6('0xd'))+_0xadc6('0xe')+this[_0xadc6('0xf')](_0xadc6('0x10'));}}}; \ No newline at end of file +var _0xcb86=['INTEGER','VIRTUAL','getDataValue','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP'];(function(_0x5045f3,_0x9084e1){var _0x867321=function(_0x17f342){while(--_0x17f342){_0x5045f3['push'](_0x5045f3['shift']());}};_0x867321(++_0x9084e1);}(_0xcb86,0xb8));var _0x6cb8=function(_0x30838e,_0x12c644){_0x30838e=_0x30838e-0x0;var _0x4a0ef5=_0xcb86[_0x30838e];return _0x4a0ef5;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x6cb8('0x0')]},'context':{'type':Sequelize[_0x6cb8('0x0')],'defaultValue':_0x6cb8('0x1'),'unique':_0x6cb8('0x2')},'mailbox':{'type':Sequelize[_0x6cb8('0x0')],'defaultValue':'','allowNull':![],'unique':_0x6cb8('0x2')},'password':{'type':Sequelize[_0x6cb8('0x0')]},'fullname':{'type':Sequelize[_0x6cb8('0x0')]},'email':{'type':Sequelize[_0x6cb8('0x0')],'validate':{'isEmail':!![]},'set':function(_0x48731a){this[_0x6cb8('0x3')]('email',typeof _0x48731a===_0x6cb8('0x4')&&_0x48731a[_0x6cb8('0x5')]()?_0x48731a['trim']():null);}},'pager':{'type':Sequelize[_0x6cb8('0x0')]},'tz':{'type':Sequelize[_0x6cb8('0x0')],'defaultValue':_0x6cb8('0x6')},'attach':{'type':Sequelize['ENUM'](_0x6cb8('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x6cb8('0x8')](_0x6cb8('0x7'),'no'),'defaultValue':_0x6cb8('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x6cb8('0x0')]},'callback':{'type':Sequelize[_0x6cb8('0x0')]},'review':{'type':Sequelize['ENUM'](_0x6cb8('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x6cb8('0x8')](_0x6cb8('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x6cb8('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x6cb8('0x8')](_0x6cb8('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x6cb8('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x6cb8('0x8')](_0x6cb8('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x6cb8('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x6cb8('0x8')](_0x6cb8('0x7'),'no'),'defaultValue':_0x6cb8('0x7'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x6cb8('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x6cb8('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x6cb8('0x8')](_0x6cb8('0x7'),'no'),'defaultValue':_0x6cb8('0x7'),'allowNull':![]},'stamp':{'type':_0x6cb8('0xa')},'emailsubject':{'type':Sequelize[_0x6cb8('0x0')]},'emailbody':{'type':Sequelize[_0x6cb8('0x0')]},'maxsecs':{'type':Sequelize[_0x6cb8('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x6cb8('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x6cb8('0xc')],'get':function(){return this[_0x6cb8('0xd')]('fullname')+'\x20-\x20'+this[_0x6cb8('0xd')](_0x6cb8('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index b1e0114..1c867ef 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 _0xb9a7=['model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','filter','options','VoiceMail','includeAll','include','findAll','rows','params','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','body','findOne','VoiceMailMessage','rawAttributes','nolimit','findAndCountAll','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','fieldName','type'];(function(_0x1f0ce9,_0x4e3353){var _0x2c2d34=function(_0x5eefd2){while(--_0x5eefd2){_0x1f0ce9['push'](_0x1f0ce9['shift']());}};_0x2c2d34(++_0x4e3353);}(_0xb9a7,0x112));var _0x7b9a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xb9a7[_0x342baa];return _0x1208f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];function respondWithStatusCode(_0x5948ca,_0x32f616){_0x32f616=_0x32f616||0xcc;return function(_0xec5949){if(_0xec5949){return _0x5948ca['sendStatus'](_0x32f616);}return _0x5948ca[_0x7b9a('0x14')](_0x32f616)[_0x7b9a('0x15')]();};}function respondWithResult(_0x4b7ec0,_0xb157e5){_0xb157e5=_0xb157e5||0xc8;return function(_0xde180d){if(_0xde180d){return _0x4b7ec0[_0x7b9a('0x14')](_0xb157e5)[_0x7b9a('0x16')](_0xde180d);}};}function respondWithFilteredResult(_0x344fa7,_0x346daa){return function(_0x22a7e4){if(_0x22a7e4){var _0x35e602=typeof _0x346daa[_0x7b9a('0x17')]==='undefined'&&typeof _0x346daa[_0x7b9a('0x18')]==='undefined';var _0x123921=_0x22a7e4[_0x7b9a('0x19')];var _0x271263=_0x35e602?0x0:_0x346daa[_0x7b9a('0x17')];var _0x44a232=_0x35e602?_0x22a7e4[_0x7b9a('0x19')]:_0x346daa[_0x7b9a('0x17')]+_0x346daa[_0x7b9a('0x18')];var _0x2064a0;if(_0x44a232>=_0x123921){_0x44a232=_0x123921;_0x2064a0=0xc8;}else{_0x2064a0=0xce;}_0x344fa7[_0x7b9a('0x14')](_0x2064a0);return _0x344fa7[_0x7b9a('0x1a')](_0x7b9a('0x1b'),_0x271263+'-'+_0x44a232+'/'+_0x123921)[_0x7b9a('0x16')](_0x22a7e4);}return null;};}function patchUpdates(_0x58aed7){return function(_0x993048){try{jsonpatch['apply'](_0x993048,_0x58aed7,!![]);}catch(_0x1eacbc){return BPromise['reject'](_0x1eacbc);}return _0x993048[_0x7b9a('0x1c')]();};}function saveUpdates(_0x331ae6,_0x23d812){return function(_0x54fda7){if(_0x54fda7){return _0x54fda7[_0x7b9a('0x1d')](_0x331ae6)[_0x7b9a('0x1e')](function(_0x5705b2){return _0x5705b2;});}return null;};}function removeEntity(_0x35aca7,_0x374dca){return function(_0x269c07){if(_0x269c07){return _0x269c07[_0x7b9a('0x1f')]()[_0x7b9a('0x1e')](function(){var _0x5b2f52=_0x269c07[_0x7b9a('0x20')]({'plain':!![]});var _0x23219e='Voicemails';return db[_0x7b9a('0x21')]['destroy']({'where':{'type':_0x23219e,'resourceId':_0x5b2f52['id']}})[_0x7b9a('0x1e')](function(){return _0x269c07;});})[_0x7b9a('0x1e')](function(){_0x35aca7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24d886,_0x55301c){return function(_0x54df8a){if(!_0x54df8a){_0x24d886[_0x7b9a('0x22')](0x194);}return _0x54df8a;};}function handleError(_0x58fec8,_0x5be740){_0x5be740=_0x5be740||0x1f4;return function(_0x3847b4){logger['error'](_0x3847b4[_0x7b9a('0x23')]);if(_0x3847b4[_0x7b9a('0x24')]){delete _0x3847b4['name'];}_0x58fec8[_0x7b9a('0x14')](_0x5be740)[_0x7b9a('0x25')](_0x3847b4);};}exports[_0x7b9a('0x26')]=function(_0x5b64d7,_0x45ccf5){var _0x2ce78b={},_0x181e9c={},_0x6c8b1f={'count':0x0,'rows':[]};var _0x5028e7=_[_0x7b9a('0x27')](db['VoiceMail']['rawAttributes'],function(_0x2d278e){return{'name':_0x2d278e[_0x7b9a('0x28')],'type':_0x2d278e[_0x7b9a('0x29')]['key']};});_0x181e9c[_0x7b9a('0x2a')]=_[_0x7b9a('0x27')](_0x5028e7,'name');_0x181e9c['query']=_[_0x7b9a('0x2b')](_0x5b64d7[_0x7b9a('0x2c')]);_0x181e9c['filters']=_[_0x7b9a('0x2d')](_0x181e9c[_0x7b9a('0x2a')],_0x181e9c[_0x7b9a('0x2c')]);_0x2ce78b[_0x7b9a('0x2e')]=_[_0x7b9a('0x2d')](_0x181e9c['model'],qs[_0x7b9a('0x2f')](_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x2ce78b[_0x7b9a('0x2e')]=_0x2ce78b[_0x7b9a('0x2e')][_0x7b9a('0x30')]?_0x2ce78b['attributes']:_0x181e9c['model'];if(!_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x31')]('nolimit')){_0x2ce78b[_0x7b9a('0x18')]=qs[_0x7b9a('0x18')](_0x5b64d7[_0x7b9a('0x2c')]['limit']);_0x2ce78b[_0x7b9a('0x17')]=qs[_0x7b9a('0x17')](_0x5b64d7['query']['offset']);}_0x2ce78b[_0x7b9a('0x32')]=qs[_0x7b9a('0x33')](_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x33')]);_0x2ce78b[_0x7b9a('0x34')]=qs[_0x7b9a('0x35')](_[_0x7b9a('0x36')](_0x5b64d7[_0x7b9a('0x2c')],_0x181e9c['filters']),_0x5028e7);if(_0x5b64d7[_0x7b9a('0x2c')]['filter']){_0x2ce78b[_0x7b9a('0x34')]=_[_0x7b9a('0x37')](_0x2ce78b[_0x7b9a('0x34')],{'$or':_[_0x7b9a('0x27')](_0x5028e7,function(_0x3fa4cd){if(_0x3fa4cd[_0x7b9a('0x29')]!=='VIRTUAL'){var _0x34eebe={};_0x34eebe[_0x3fa4cd[_0x7b9a('0x24')]]={'$like':'%'+_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x38')]+'%'};return _0x34eebe;}})});}_0x2ce78b=_['merge']({},_0x2ce78b,_0x5b64d7[_0x7b9a('0x39')]);var _0xf86939={'where':_0x2ce78b[_0x7b9a('0x34')]};return db[_0x7b9a('0x3a')]['count'](_0xf86939)[_0x7b9a('0x1e')](function(_0x53d89a){_0x6c8b1f[_0x7b9a('0x19')]=_0x53d89a;if(_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x3b')]){_0x2ce78b[_0x7b9a('0x3c')]=[{'all':!![]}];}return db[_0x7b9a('0x3a')][_0x7b9a('0x3d')](_0x2ce78b);})['then'](function(_0x33edc6){_0x6c8b1f[_0x7b9a('0x3e')]=_0x33edc6;return _0x6c8b1f;})[_0x7b9a('0x1e')](respondWithFilteredResult(_0x45ccf5,_0x2ce78b))['catch'](handleError(_0x45ccf5,null));};exports['show']=function(_0x3724fe,_0x454b35){var _0x995d59={'raw':!![],'where':{'id':_0x3724fe[_0x7b9a('0x3f')]['id']}},_0x5cd3dd={};_0x5cd3dd[_0x7b9a('0x2a')]=_['keys'](db['VoiceMail']['rawAttributes']);_0x5cd3dd[_0x7b9a('0x2c')]=_[_0x7b9a('0x2b')](_0x3724fe['query']);_0x5cd3dd[_0x7b9a('0x35')]=_[_0x7b9a('0x2d')](_0x5cd3dd[_0x7b9a('0x2a')],_0x5cd3dd['query']);_0x995d59[_0x7b9a('0x2e')]=_['intersection'](_0x5cd3dd[_0x7b9a('0x2a')],qs[_0x7b9a('0x2f')](_0x3724fe[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x995d59[_0x7b9a('0x2e')]=_0x995d59['attributes'][_0x7b9a('0x30')]?_0x995d59['attributes']:_0x5cd3dd[_0x7b9a('0x2a')];if(_0x3724fe['query']['includeAll']){_0x995d59[_0x7b9a('0x3c')]=[{'all':!![]}];}_0x995d59=_[_0x7b9a('0x37')]({},_0x995d59,_0x3724fe[_0x7b9a('0x39')]);return db[_0x7b9a('0x3a')][_0x7b9a('0x40')](_0x995d59)[_0x7b9a('0x1e')](handleEntityNotFound(_0x454b35,null))[_0x7b9a('0x1e')](respondWithResult(_0x454b35,null))[_0x7b9a('0x41')](handleError(_0x454b35,null));};exports[_0x7b9a('0x42')]=function(_0x5088c7,_0x1d7957){return db[_0x7b9a('0x3a')]['create'](_0x5088c7['body'],{})['then'](function(_0x1b3e65){var _0x30296e=_0x5088c7[_0x7b9a('0x43')][_0x7b9a('0x20')]({'plain':!![]});if(!_0x30296e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30296e[_0x7b9a('0x44')]===_0x7b9a('0x43')){var _0x287dea=_0x1b3e65[_0x7b9a('0x20')]({'plain':!![]});var _0x2d083b='Voicemails';return db[_0x7b9a('0x45')]['find']({'where':{'name':_0x2d083b,'userProfileId':_0x30296e[_0x7b9a('0x46')]},'raw':!![]})[_0x7b9a('0x1e')](function(_0x239146){if(_0x239146&&_0x239146[_0x7b9a('0x47')]===0x0){return db['UserProfileResource'][_0x7b9a('0x42')]({'name':_0x287dea[_0x7b9a('0x24')],'resourceId':_0x287dea['id'],'type':_0x239146[_0x7b9a('0x24')],'sectionId':_0x239146['id']},{})[_0x7b9a('0x1e')](function(){return _0x1b3e65;});}else{return _0x1b3e65;}})[_0x7b9a('0x41')](function(_0x3e2f1b){logger[_0x7b9a('0x48')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e2f1b);throw _0x3e2f1b;});}return _0x1b3e65;})['then'](respondWithResult(_0x1d7957,0xc9))['catch'](handleError(_0x1d7957,null));};exports[_0x7b9a('0x1d')]=function(_0x2f8929,_0x5a1b7d){if(_0x2f8929['body']['id']){delete _0x2f8929['body']['id'];}return db['VoiceMail'][_0x7b9a('0x40')]({'where':{'id':_0x2f8929[_0x7b9a('0x3f')]['id']}})[_0x7b9a('0x1e')](handleEntityNotFound(_0x5a1b7d,null))[_0x7b9a('0x1e')](saveUpdates(_0x2f8929[_0x7b9a('0x49')],null))[_0x7b9a('0x1e')](respondWithResult(_0x5a1b7d,null))[_0x7b9a('0x41')](handleError(_0x5a1b7d,null));};exports[_0x7b9a('0x1f')]=function(_0x5dc17e,_0x1f99f5){return db['VoiceMail'][_0x7b9a('0x40')]({'where':{'id':_0x5dc17e[_0x7b9a('0x3f')]['id']}})[_0x7b9a('0x1e')](handleEntityNotFound(_0x1f99f5,null))[_0x7b9a('0x1e')](removeEntity(_0x1f99f5,null))[_0x7b9a('0x41')](handleError(_0x1f99f5,null));};exports['getMessages']=function(_0x25ec82,_0x491804,_0x3d2df4){return db[_0x7b9a('0x3a')][_0x7b9a('0x4a')]({'where':{'id':_0x25ec82['params']['id']}})['then'](handleEntityNotFound(_0x491804,null))['then'](function(_0x4f6843){var _0x33375c;var _0x8a777f={},_0xb91099={};_0xb91099['model']=_[_0x7b9a('0x2b')](db[_0x7b9a('0x4b')][_0x7b9a('0x4c')]);_0xb91099[_0x7b9a('0x2c')]=_[_0x7b9a('0x2b')](_0x25ec82['query']);_0xb91099[_0x7b9a('0x35')]=_[_0x7b9a('0x2d')](_0xb91099[_0x7b9a('0x2a')],_0xb91099['query']);_0x8a777f['attributes']=_['intersection'](_0xb91099[_0x7b9a('0x2a')],qs[_0x7b9a('0x2f')](_0x25ec82[_0x7b9a('0x2c')]['fields']));_0x8a777f[_0x7b9a('0x2e')]=_0x8a777f[_0x7b9a('0x2e')]['length']?_0x8a777f[_0x7b9a('0x2e')]:_0xb91099['model'];if(!_0x25ec82[_0x7b9a('0x2c')]['hasOwnProperty'](_0x7b9a('0x4d'))){_0x8a777f[_0x7b9a('0x18')]=qs[_0x7b9a('0x18')](_0x25ec82[_0x7b9a('0x2c')]['limit']);_0x8a777f[_0x7b9a('0x17')]=qs[_0x7b9a('0x17')](_0x25ec82[_0x7b9a('0x2c')][_0x7b9a('0x17')]);}_0x8a777f['order']=qs[_0x7b9a('0x33')](_0x25ec82['query'][_0x7b9a('0x33')]);_0x8a777f['where']=qs[_0x7b9a('0x35')](_['pick'](_0x25ec82['query'],_0xb91099['filters']));if(_0x25ec82['query'][_0x7b9a('0x38')]){_0x8a777f[_0x7b9a('0x34')]=_[_0x7b9a('0x37')](_0x8a777f[_0x7b9a('0x34')],{'$or':_['map'](_0x8a777f[_0x7b9a('0x2e')],function(_0x4b9462){var _0x50b6f1={};_0x50b6f1[_0x4b9462]={'$like':'%'+_0x25ec82[_0x7b9a('0x2c')]['filter']+'%'};return _0x50b6f1;})});}_0x8a777f['where']=_[_0x7b9a('0x37')](_0x8a777f[_0x7b9a('0x34')],{'mailboxuser':_0x4f6843['mailbox']});_0x8a777f=_[_0x7b9a('0x37')]({},_0x8a777f,_0x25ec82['options']);return db[_0x7b9a('0x4b')][_0x7b9a('0x4e')](_0x8a777f)[_0x7b9a('0x1e')](respondWithFilteredResult(_0x491804,_0x8a777f));})['catch'](handleError(_0x491804,null));}; \ No newline at end of file +var _0x7916=['update','then','get','destroy','end','error','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','length','attributes','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','getMessages','VoiceMailMessage','hasOwnProperty','pick','mailbox','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','reject'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7916,0x128));var _0x6791=function(_0x5b959e,_0x28debf){_0x5b959e=_0x5b959e-0x0;var _0x11df5a=_0x7916[_0x5b959e];return _0x11df5a;};'use strict';var emlformat=require(_0x6791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6791('0x1'));var jsonpatch=require(_0x6791('0x2'));var rp=require('request-promise');var moment=require(_0x6791('0x3'));var BPromise=require(_0x6791('0x4'));var Mustache=require(_0x6791('0x5'));var util=require(_0x6791('0x6'));var path=require('path');var sox=require(_0x6791('0x7'));var csv=require('to-csv');var ejs=require(_0x6791('0x8'));var fs=require('fs');var fs_extra=require(_0x6791('0x9'));var _=require('lodash');var squel=require(_0x6791('0xa'));var crypto=require('crypto');var jsforce=require(_0x6791('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6791('0xc'));var Papa=require(_0x6791('0xd'));var Redis=require('ioredis');var authService=require(_0x6791('0xe'));var qs=require(_0x6791('0xf'));var as=require(_0x6791('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6791('0x11'))(_0x6791('0x12'));var utils=require(_0x6791('0x13'));var config=require(_0x6791('0x14'));var licenseUtil=require(_0x6791('0x15'));var db=require(_0x6791('0x16'))['db'];function respondWithStatusCode(_0x61ac73,_0x16c62b){_0x16c62b=_0x16c62b||0xcc;return function(_0x423e22){if(_0x423e22){return _0x61ac73[_0x6791('0x17')](_0x16c62b);}return _0x61ac73[_0x6791('0x18')](_0x16c62b)['end']();};}function respondWithResult(_0x4b1719,_0x34b28d){_0x34b28d=_0x34b28d||0xc8;return function(_0x5122f9){if(_0x5122f9){return _0x4b1719[_0x6791('0x18')](_0x34b28d)['json'](_0x5122f9);}};}function respondWithFilteredResult(_0x3be9f0,_0x163898){return function(_0x517910){if(_0x517910){var _0x3e4792=typeof _0x163898['offset']===_0x6791('0x19')&&typeof _0x163898[_0x6791('0x1a')]==='undefined';var _0xbc35d=_0x517910[_0x6791('0x1b')];var _0x5bec14=_0x3e4792?0x0:_0x163898[_0x6791('0x1c')];var _0x4d8a79=_0x3e4792?_0x517910[_0x6791('0x1b')]:_0x163898[_0x6791('0x1c')]+_0x163898[_0x6791('0x1a')];var _0x3a72ce;if(_0x4d8a79>=_0xbc35d){_0x4d8a79=_0xbc35d;_0x3a72ce=0xc8;}else{_0x3a72ce=0xce;}_0x3be9f0[_0x6791('0x18')](_0x3a72ce);return _0x3be9f0[_0x6791('0x1d')](_0x6791('0x1e'),_0x5bec14+'-'+_0x4d8a79+'/'+_0xbc35d)['json'](_0x517910);}return null;};}function patchUpdates(_0x4a2922){return function(_0x306acb){try{jsonpatch['apply'](_0x306acb,_0x4a2922,!![]);}catch(_0x21ef16){return BPromise[_0x6791('0x1f')](_0x21ef16);}return _0x306acb['save']();};}function saveUpdates(_0x17f200,_0x309610){return function(_0x15b9ab){if(_0x15b9ab){return _0x15b9ab[_0x6791('0x20')](_0x17f200)['then'](function(_0x3e17b3){return _0x3e17b3;});}return null;};}function removeEntity(_0x1b516d,_0x4a8717){return function(_0x53bb44){if(_0x53bb44){return _0x53bb44['destroy']()[_0x6791('0x21')](function(){var _0x502043=_0x53bb44[_0x6791('0x22')]({'plain':!![]});var _0x5409f1='Voicemails';return db['UserProfileResource'][_0x6791('0x23')]({'where':{'type':_0x5409f1,'resourceId':_0x502043['id']}})[_0x6791('0x21')](function(){return _0x53bb44;});})[_0x6791('0x21')](function(){_0x1b516d['status'](0xcc)[_0x6791('0x24')]();});}};}function handleEntityNotFound(_0x30cc17,_0x493a59){return function(_0x342107){if(!_0x342107){_0x30cc17['sendStatus'](0x194);}return _0x342107;};}function handleError(_0x424b0e,_0x49dd24){_0x49dd24=_0x49dd24||0x1f4;return function(_0x4fc5d5){logger[_0x6791('0x25')](_0x4fc5d5['stack']);if(_0x4fc5d5[_0x6791('0x26')]){delete _0x4fc5d5[_0x6791('0x26')];}_0x424b0e['status'](_0x49dd24)[_0x6791('0x27')](_0x4fc5d5);};}exports[_0x6791('0x28')]=function(_0x234c5e,_0xd36448){var _0x5d9d54={},_0x4f91d6={},_0x348b9c={'count':0x0,'rows':[]};var _0x5e5ac3=_[_0x6791('0x29')](db[_0x6791('0x2a')][_0x6791('0x2b')],function(_0x2b98b8){return{'name':_0x2b98b8[_0x6791('0x2c')],'type':_0x2b98b8[_0x6791('0x2d')][_0x6791('0x2e')]};});_0x4f91d6[_0x6791('0x2f')]=_[_0x6791('0x29')](_0x5e5ac3,_0x6791('0x26'));_0x4f91d6['query']=_[_0x6791('0x30')](_0x234c5e[_0x6791('0x31')]);_0x4f91d6[_0x6791('0x32')]=_[_0x6791('0x33')](_0x4f91d6[_0x6791('0x2f')],_0x4f91d6[_0x6791('0x31')]);_0x5d9d54['attributes']=_['intersection'](_0x4f91d6['model'],qs[_0x6791('0x34')](_0x234c5e[_0x6791('0x31')][_0x6791('0x34')]));_0x5d9d54['attributes']=_0x5d9d54['attributes'][_0x6791('0x35')]?_0x5d9d54[_0x6791('0x36')]:_0x4f91d6[_0x6791('0x2f')];if(!_0x234c5e[_0x6791('0x31')]['hasOwnProperty'](_0x6791('0x37'))){_0x5d9d54[_0x6791('0x1a')]=qs[_0x6791('0x1a')](_0x234c5e['query'][_0x6791('0x1a')]);_0x5d9d54['offset']=qs['offset'](_0x234c5e[_0x6791('0x31')][_0x6791('0x1c')]);}_0x5d9d54['order']=qs[_0x6791('0x38')](_0x234c5e[_0x6791('0x31')][_0x6791('0x38')]);_0x5d9d54[_0x6791('0x39')]=qs[_0x6791('0x32')](_['pick'](_0x234c5e[_0x6791('0x31')],_0x4f91d6[_0x6791('0x32')]),_0x5e5ac3);if(_0x234c5e[_0x6791('0x31')]['filter']){_0x5d9d54[_0x6791('0x39')]=_[_0x6791('0x3a')](_0x5d9d54[_0x6791('0x39')],{'$or':_['map'](_0x5e5ac3,function(_0x11a012){if(_0x11a012[_0x6791('0x2d')]!==_0x6791('0x3b')){var _0x122aa5={};_0x122aa5[_0x11a012['name']]={'$like':'%'+_0x234c5e[_0x6791('0x31')][_0x6791('0x3c')]+'%'};return _0x122aa5;}})});}_0x5d9d54=_[_0x6791('0x3a')]({},_0x5d9d54,_0x234c5e[_0x6791('0x3d')]);var _0x12f121={'where':_0x5d9d54[_0x6791('0x39')]};return db[_0x6791('0x2a')][_0x6791('0x1b')](_0x12f121)[_0x6791('0x21')](function(_0x4e4004){_0x348b9c['count']=_0x4e4004;if(_0x234c5e[_0x6791('0x31')][_0x6791('0x3e')]){_0x5d9d54['include']=[{'all':!![]}];}return db[_0x6791('0x2a')][_0x6791('0x3f')](_0x5d9d54);})[_0x6791('0x21')](function(_0x3edb86){_0x348b9c[_0x6791('0x40')]=_0x3edb86;return _0x348b9c;})[_0x6791('0x21')](respondWithFilteredResult(_0xd36448,_0x5d9d54))[_0x6791('0x41')](handleError(_0xd36448,null));};exports['show']=function(_0xb3bea8,_0x4b9fca){var _0x17ecf0={'raw':!![],'where':{'id':_0xb3bea8[_0x6791('0x42')]['id']}},_0xfc170e={};_0xfc170e[_0x6791('0x2f')]=_['keys'](db[_0x6791('0x2a')][_0x6791('0x2b')]);_0xfc170e[_0x6791('0x31')]=_[_0x6791('0x30')](_0xb3bea8[_0x6791('0x31')]);_0xfc170e[_0x6791('0x32')]=_[_0x6791('0x33')](_0xfc170e[_0x6791('0x2f')],_0xfc170e['query']);_0x17ecf0[_0x6791('0x36')]=_[_0x6791('0x33')](_0xfc170e[_0x6791('0x2f')],qs[_0x6791('0x34')](_0xb3bea8['query'][_0x6791('0x34')]));_0x17ecf0[_0x6791('0x36')]=_0x17ecf0['attributes'][_0x6791('0x35')]?_0x17ecf0['attributes']:_0xfc170e[_0x6791('0x2f')];if(_0xb3bea8[_0x6791('0x31')][_0x6791('0x3e')]){_0x17ecf0[_0x6791('0x43')]=[{'all':!![]}];}_0x17ecf0=_[_0x6791('0x3a')]({},_0x17ecf0,_0xb3bea8[_0x6791('0x3d')]);return db[_0x6791('0x2a')][_0x6791('0x44')](_0x17ecf0)[_0x6791('0x21')](handleEntityNotFound(_0x4b9fca,null))['then'](respondWithResult(_0x4b9fca,null))[_0x6791('0x41')](handleError(_0x4b9fca,null));};exports['create']=function(_0x10e806,_0x2bb86a){return db[_0x6791('0x2a')][_0x6791('0x45')](_0x10e806[_0x6791('0x46')],{})['then'](function(_0x2bc08d){var _0x35e087=_0x10e806[_0x6791('0x47')][_0x6791('0x22')]({'plain':!![]});if(!_0x35e087)throw new Error(_0x6791('0x48'));if(_0x35e087['role']===_0x6791('0x47')){var _0x42948b=_0x2bc08d['get']({'plain':!![]});var _0x3df699='Voicemails';return db[_0x6791('0x49')][_0x6791('0x44')]({'where':{'name':_0x3df699,'userProfileId':_0x35e087[_0x6791('0x4a')]},'raw':!![]})[_0x6791('0x21')](function(_0x558069){if(_0x558069&&_0x558069[_0x6791('0x4b')]===0x0){return db[_0x6791('0x4c')]['create']({'name':_0x42948b[_0x6791('0x26')],'resourceId':_0x42948b['id'],'type':_0x558069[_0x6791('0x26')],'sectionId':_0x558069['id']},{})[_0x6791('0x21')](function(){return _0x2bc08d;});}else{return _0x2bc08d;}})['catch'](function(_0x355e97){logger[_0x6791('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x355e97);throw _0x355e97;});}return _0x2bc08d;})[_0x6791('0x21')](respondWithResult(_0x2bb86a,0xc9))[_0x6791('0x41')](handleError(_0x2bb86a,null));};exports['update']=function(_0x169531,_0x216498){if(_0x169531[_0x6791('0x46')]['id']){delete _0x169531[_0x6791('0x46')]['id'];}return db['VoiceMail'][_0x6791('0x44')]({'where':{'id':_0x169531[_0x6791('0x42')]['id']}})[_0x6791('0x21')](handleEntityNotFound(_0x216498,null))['then'](saveUpdates(_0x169531['body'],null))[_0x6791('0x21')](respondWithResult(_0x216498,null))[_0x6791('0x41')](handleError(_0x216498,null));};exports[_0x6791('0x23')]=function(_0x45756f,_0x288f05){return db['VoiceMail']['find']({'where':{'id':_0x45756f[_0x6791('0x42')]['id']}})['then'](handleEntityNotFound(_0x288f05,null))['then'](removeEntity(_0x288f05,null))[_0x6791('0x41')](handleError(_0x288f05,null));};exports[_0x6791('0x4d')]=function(_0x2cb48e,_0x10b41b,_0x13089d){return db[_0x6791('0x2a')]['findOne']({'where':{'id':_0x2cb48e['params']['id']}})[_0x6791('0x21')](handleEntityNotFound(_0x10b41b,null))[_0x6791('0x21')](function(_0x56e424){var _0x44b1df;var _0x535ecf={},_0x473443={};_0x473443[_0x6791('0x2f')]=_['keys'](db[_0x6791('0x4e')][_0x6791('0x2b')]);_0x473443[_0x6791('0x31')]=_['keys'](_0x2cb48e[_0x6791('0x31')]);_0x473443[_0x6791('0x32')]=_[_0x6791('0x33')](_0x473443[_0x6791('0x2f')],_0x473443[_0x6791('0x31')]);_0x535ecf['attributes']=_['intersection'](_0x473443[_0x6791('0x2f')],qs[_0x6791('0x34')](_0x2cb48e['query'][_0x6791('0x34')]));_0x535ecf[_0x6791('0x36')]=_0x535ecf[_0x6791('0x36')][_0x6791('0x35')]?_0x535ecf[_0x6791('0x36')]:_0x473443[_0x6791('0x2f')];if(!_0x2cb48e[_0x6791('0x31')][_0x6791('0x4f')]('nolimit')){_0x535ecf[_0x6791('0x1a')]=qs[_0x6791('0x1a')](_0x2cb48e[_0x6791('0x31')][_0x6791('0x1a')]);_0x535ecf['offset']=qs[_0x6791('0x1c')](_0x2cb48e[_0x6791('0x31')][_0x6791('0x1c')]);}_0x535ecf['order']=qs[_0x6791('0x38')](_0x2cb48e[_0x6791('0x31')][_0x6791('0x38')]);_0x535ecf[_0x6791('0x39')]=qs['filters'](_[_0x6791('0x50')](_0x2cb48e[_0x6791('0x31')],_0x473443['filters']));if(_0x2cb48e[_0x6791('0x31')][_0x6791('0x3c')]){_0x535ecf[_0x6791('0x39')]=_[_0x6791('0x3a')](_0x535ecf[_0x6791('0x39')],{'$or':_[_0x6791('0x29')](_0x535ecf['attributes'],function(_0x301f2f){var _0x33caf0={};_0x33caf0[_0x301f2f]={'$like':'%'+_0x2cb48e[_0x6791('0x31')]['filter']+'%'};return _0x33caf0;})});}_0x535ecf[_0x6791('0x39')]=_['merge'](_0x535ecf[_0x6791('0x39')],{'mailboxuser':_0x56e424[_0x6791('0x51')]});_0x535ecf=_[_0x6791('0x3a')]({},_0x535ecf,_0x2cb48e[_0x6791('0x3d')]);return db[_0x6791('0x4e')]['findAndCountAll'](_0x535ecf)[_0x6791('0x21')](respondWithFilteredResult(_0x10b41b,_0x535ecf));})[_0x6791('0x41')](handleError(_0x10b41b,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 4d644c2..62c90ed 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 _0x5763=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','context'];(function(_0x5a966c,_0x21654e){var _0x2cb5f8=function(_0x45d202){while(--_0x45d202){_0x5a966c['push'](_0x5a966c['shift']());}};_0x2cb5f8(++_0x21654e);}(_0x5763,0x10e));var _0x3576=function(_0x191828,_0x5c5de8){_0x191828=_0x191828-0x0;var _0x276a8d=_0x5763[_0x191828];return _0x276a8d;};'use strict';var _=require(_0x3576('0x0'));var util=require(_0x3576('0x1'));var logger=require(_0x3576('0x2'))(_0x3576('0x3'));var moment=require(_0x3576('0x4'));var BPromise=require('bluebird');var rp=require(_0x3576('0x5'));var fs=require('fs');var path=require(_0x3576('0x6'));var rimraf=require(_0x3576('0x7'));var config=require(_0x3576('0x8'));var attributes=require('./voiceMail.attributes');module[_0x3576('0x9')]=function(_0x271fd1,_0x32f13d){return _0x271fd1['define'](_0x3576('0xa'),attributes,{'tableName':_0x3576('0xb'),'paranoid':![],'indexes':[{'name':_0x3576('0xc'),'fields':[_0x3576('0xd'),_0x3576('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x02c0=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','lodash'];(function(_0x542149,_0x5df180){var _0x36df57=function(_0x1f6e73){while(--_0x1f6e73){_0x542149['push'](_0x542149['shift']());}};_0x36df57(++_0x5df180);}(_0x02c0,0x6f));var _0x002c=function(_0x3ecbe1,_0xce2903){_0x3ecbe1=_0x3ecbe1-0x0;var _0x555f4d=_0x02c0[_0x3ecbe1];return _0x555f4d;};'use strict';var _=require(_0x002c('0x0'));var util=require(_0x002c('0x1'));var logger=require(_0x002c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x002c('0x3'));var rp=require(_0x002c('0x4'));var fs=require('fs');var path=require(_0x002c('0x5'));var rimraf=require(_0x002c('0x6'));var config=require(_0x002c('0x7'));var attributes=require(_0x002c('0x8'));module[_0x002c('0x9')]=function(_0x8be2d8,_0x2eb674){return _0x8be2d8[_0x002c('0xa')]('VoiceMail',attributes,{'tableName':_0x002c('0xb'),'paranoid':![],'indexes':[{'name':_0x002c('0xc'),'fields':[_0x002c('0xd'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 64a8d56..09a886e 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 _0x69a1=['http','request','then','info','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1eec1e,_0xa321f3){var _0x20d874=function(_0x576194){while(--_0x576194){_0x1eec1e['push'](_0x1eec1e['shift']());}};_0x20d874(++_0xa321f3);}(_0x69a1,0x17d));var _0x169a=function(_0x219d39,_0x3ec116){_0x219d39=_0x219d39-0x0;var _0x4d9be9=_0x69a1[_0x219d39];return _0x4d9be9;};'use strict';var _=require(_0x169a('0x0'));var util=require(_0x169a('0x1'));var moment=require('moment');var BPromise=require(_0x169a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x169a('0x3'));var db=require(_0x169a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x169a('0x5'))(_0x169a('0x6'));var config=require(_0x169a('0x7'));var jayson=require(_0x169a('0x8'));var client=jayson[_0x169a('0x9')][_0x169a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51a0f3,_0x125f02,_0x418e81){return new BPromise(function(_0x288568,_0x4ed112){return client[_0x169a('0xb')](_0x51a0f3,_0x418e81)[_0x169a('0xc')](function(_0x242acb){logger[_0x169a('0xd')](_0x169a('0xe'),_0x125f02,'request\x20sent');logger['debug'](_0x169a('0xf'),_0x125f02,'request\x20sent',JSON[_0x169a('0x10')](_0x242acb));if(_0x242acb[_0x169a('0x11')]){if(_0x242acb[_0x169a('0x11')][_0x169a('0x12')]===0x1f4){logger[_0x169a('0x11')](_0x169a('0xe'),_0x125f02,_0x242acb[_0x169a('0x11')][_0x169a('0x13')]);return _0x4ed112(_0x242acb['error']['message']);}logger[_0x169a('0x11')](_0x169a('0xe'),_0x125f02,_0x242acb['error']['message']);return _0x288568(_0x242acb[_0x169a('0x11')][_0x169a('0x13')]);}else{logger[_0x169a('0xd')](_0x169a('0xe'),_0x125f02,_0x169a('0x14'));_0x288568(_0x242acb[_0x169a('0x15')][_0x169a('0x13')]);}})[_0x169a('0x16')](function(_0x57a103){logger[_0x169a('0x11')](_0x169a('0xe'),_0x125f02,_0x57a103);_0x4ed112(_0x57a103);});});} \ No newline at end of file +var _0xe2a6=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xe2a6,0x1cc));var _0x6e2a=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0xe2a6[_0x3818c0];return _0x55ec33;};'use strict';var _=require(_0x6e2a('0x0'));var util=require(_0x6e2a('0x1'));var moment=require(_0x6e2a('0x2'));var BPromise=require(_0x6e2a('0x3'));var rs=require(_0x6e2a('0x4'));var fs=require('fs');var Redis=require(_0x6e2a('0x5'));var db=require(_0x6e2a('0x6'))['db'];var utils=require(_0x6e2a('0x7'));var logger=require('../../config/logger')(_0x6e2a('0x8'));var config=require(_0x6e2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6e2a('0xa')][_0x6e2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44949c,_0x11b28f,_0x5cec36){return new BPromise(function(_0x44738e,_0x248560){return client[_0x6e2a('0xc')](_0x44949c,_0x5cec36)[_0x6e2a('0xd')](function(_0x19f777){logger[_0x6e2a('0xe')](_0x6e2a('0xf'),_0x11b28f,_0x6e2a('0x10'));logger[_0x6e2a('0x11')](_0x6e2a('0x12'),_0x11b28f,_0x6e2a('0x10'),JSON[_0x6e2a('0x13')](_0x19f777));if(_0x19f777[_0x6e2a('0x14')]){if(_0x19f777[_0x6e2a('0x14')]['code']===0x1f4){logger[_0x6e2a('0x14')]('VoiceMail,\x20%s,\x20%s',_0x11b28f,_0x19f777[_0x6e2a('0x14')][_0x6e2a('0x15')]);return _0x248560(_0x19f777[_0x6e2a('0x14')][_0x6e2a('0x15')]);}logger[_0x6e2a('0x14')](_0x6e2a('0xf'),_0x11b28f,_0x19f777[_0x6e2a('0x14')]['message']);return _0x44738e(_0x19f777[_0x6e2a('0x14')][_0x6e2a('0x15')]);}else{logger[_0x6e2a('0xe')](_0x6e2a('0xf'),_0x11b28f,_0x6e2a('0x10'));_0x44738e(_0x19f777[_0x6e2a('0x16')][_0x6e2a('0x15')]);}})[_0x6e2a('0x17')](function(_0x58f17d){logger[_0x6e2a('0x14')](_0x6e2a('0xf'),_0x11b28f,_0x58f17d);_0x248560(_0x58f17d);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 0052ac8..86232fe 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 _0xc1cc=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','/:id/download','post','put','/:id','update','delete','destroy'];(function(_0x4f8897,_0x30f547){var _0x5b638c=function(_0x303508){while(--_0x303508){_0x4f8897['push'](_0x4f8897['shift']());}};_0x5b638c(++_0x30f547);}(_0xc1cc,0x169));var _0xcc1c=function(_0x30e4e3,_0x3d854a){_0x30e4e3=_0x30e4e3-0x0;var _0x37e107=_0xc1cc[_0x30e4e3];return _0x37e107;};'use strict';var multer=require(_0xcc1c('0x0'));var util=require(_0xcc1c('0x1'));var path=require('path');var timeout=require(_0xcc1c('0x2'));var express=require(_0xcc1c('0x3'));var router=express['Router']();var fs_extra=require(_0xcc1c('0x4'));var auth=require(_0xcc1c('0x5'));var interaction=require(_0xcc1c('0x6'));var config=require('../../config/environment');var controller=require(_0xcc1c('0x7'));router[_0xcc1c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcc1c('0x8')]('/:id',auth[_0xcc1c('0x9')](),controller['show']);router[_0xcc1c('0x8')](_0xcc1c('0xa'),auth[_0xcc1c('0x9')](),controller['download']);router[_0xcc1c('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcc1c('0xc')](_0xcc1c('0xd'),auth[_0xcc1c('0x9')](),controller[_0xcc1c('0xe')]);router[_0xcc1c('0xf')](_0xcc1c('0xd'),auth[_0xcc1c('0x9')](),controller[_0xcc1c('0x10')]);module[_0xcc1c('0x11')]=router; \ No newline at end of file +var _0xf368=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller'];(function(_0x146faa,_0x4881eb){var _0x3601ac=function(_0xca37ba){while(--_0xca37ba){_0x146faa['push'](_0x146faa['shift']());}};_0x3601ac(++_0x4881eb);}(_0xf368,0xbd));var _0x8f36=function(_0x5e7aa2,_0x5b87b4){_0x5e7aa2=_0x5e7aa2-0x0;var _0x3d06a6=_0xf368[_0x5e7aa2];return _0x3d06a6;};'use strict';var multer=require('multer');var util=require(_0x8f36('0x0'));var path=require(_0x8f36('0x1'));var timeout=require('connect-timeout');var express=require(_0x8f36('0x2'));var router=express[_0x8f36('0x3')]();var fs_extra=require(_0x8f36('0x4'));var auth=require(_0x8f36('0x5'));var interaction=require(_0x8f36('0x6'));var config=require(_0x8f36('0x7'));var controller=require(_0x8f36('0x8'));router[_0x8f36('0x9')]('/',auth[_0x8f36('0xa')](),controller[_0x8f36('0xb')]);router[_0x8f36('0x9')](_0x8f36('0xc'),auth[_0x8f36('0xa')](),controller[_0x8f36('0xd')]);router['get'](_0x8f36('0xe'),auth['isAuthenticated'](),controller[_0x8f36('0xf')]);router[_0x8f36('0x10')]('/',auth[_0x8f36('0xa')](),controller[_0x8f36('0x11')]);router[_0x8f36('0x12')](_0x8f36('0xc'),auth[_0x8f36('0xa')](),controller[_0x8f36('0x13')]);router[_0x8f36('0x14')](_0x8f36('0xc'),auth[_0x8f36('0xa')](),controller[_0x8f36('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 470dbf8..91b45a8 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 _0x1b4d=['STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER'];(function(_0x2523b0,_0x450793){var _0x39ec6d=function(_0x4a9fea){while(--_0x4a9fea){_0x2523b0['push'](_0x2523b0['shift']());}};_0x39ec6d(++_0x450793);}(_0x1b4d,0x1eb));var _0xd1b4=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x1b4d[_0x55e08b];return _0xd1a7ff;};'use strict';var Sequelize=require(_0xd1b4('0x0'));module['exports']={'name':{'type':Sequelize[_0xd1b4('0x1')],'get':function(_0xd69746){return this[_0xd1b4('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xd1b4('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd1b4('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xd1b4('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd1b4('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xd1b4('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd1b4('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd1b4('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xd1b4('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xd1b4('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xd1b4('0x6'),'defaultValue':Sequelize[_0xd1b4('0x7')](_0xd1b4('0x8'))}}; \ No newline at end of file +var _0x5eb2=['getDataValue','INTEGER','STRING','BLOB','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports'];(function(_0x1bfa86,_0x4a8606){var _0x1bd346=function(_0x1a1135){while(--_0x1a1135){_0x1bfa86['push'](_0x1bfa86['shift']());}};_0x1bd346(++_0x4a8606);}(_0x5eb2,0xa9));var _0x25eb=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x5eb2[_0x59162a];return _0x35e50d;};'use strict';var Sequelize=require(_0x25eb('0x0'));module[_0x25eb('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x317aa9){return this[_0x25eb('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x25eb('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x25eb('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x25eb('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x25eb('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x25eb('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x25eb('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x25eb('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x25eb('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x25eb('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x25eb('0x4')],'defaultValue':''},'stamp':{'type':_0x25eb('0x6'),'defaultValue':Sequelize[_0x25eb('0x7')](_0x25eb('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index db531a0..160c17e 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 _0x420b=['status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','create','body','catch','params','download','msg_id','recording','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','.wav\x22','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x1a8ca6,_0x2868bb){var _0x993297=function(_0x3ab545){while(--_0x3ab545){_0x1a8ca6['push'](_0x1a8ca6['shift']());}};_0x993297(++_0x2868bb);}(_0x420b,0x141));var _0xb420=function(_0x1dbd93,_0x5d5f30){_0x1dbd93=_0x1dbd93-0x0;var _0x2a551b=_0x420b[_0x1dbd93];return _0x2a551b;};'use strict';var emlformat=require(_0xb420('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb420('0x1'));var jsonpatch=require(_0xb420('0x2'));var rp=require(_0xb420('0x3'));var moment=require(_0xb420('0x4'));var BPromise=require(_0xb420('0x5'));var Mustache=require(_0xb420('0x6'));var util=require(_0xb420('0x7'));var path=require(_0xb420('0x8'));var sox=require(_0xb420('0x9'));var csv=require(_0xb420('0xa'));var ejs=require(_0xb420('0xb'));var fs=require('fs');var fs_extra=require(_0xb420('0xc'));var _=require(_0xb420('0xd'));var squel=require(_0xb420('0xe'));var crypto=require('crypto');var jsforce=require(_0xb420('0xf'));var deskjs=require(_0xb420('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb420('0x11'));var Papa=require(_0xb420('0x12'));var Redis=require(_0xb420('0x13'));var authService=require(_0xb420('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb420('0x15'));var hardwareService=require(_0xb420('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xb420('0x17'));var config=require(_0xb420('0x18'));var licenseUtil=require(_0xb420('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42bd52,_0x228418){_0x228418=_0x228418||0xcc;return function(_0x59c94a){if(_0x59c94a){return _0x42bd52[_0xb420('0x1a')](_0x228418);}return _0x42bd52[_0xb420('0x1b')](_0x228418)[_0xb420('0x1c')]();};}function respondWithResult(_0x3f3b64,_0xf1f878){_0xf1f878=_0xf1f878||0xc8;return function(_0x3f58d0){if(_0x3f58d0){return _0x3f3b64[_0xb420('0x1b')](_0xf1f878)['json'](_0x3f58d0);}};}function respondWithFilteredResult(_0xad99a6,_0x2c7121){return function(_0xe384b5){if(_0xe384b5){var _0x1087d8=typeof _0x2c7121[_0xb420('0x1d')]===_0xb420('0x1e')&&typeof _0x2c7121[_0xb420('0x1f')]===_0xb420('0x1e');var _0x23229d=_0xe384b5[_0xb420('0x20')];var _0x17ece7=_0x1087d8?0x0:_0x2c7121['offset'];var _0x2067e6=_0x1087d8?_0xe384b5[_0xb420('0x20')]:_0x2c7121[_0xb420('0x1d')]+_0x2c7121[_0xb420('0x1f')];var _0x59073c;if(_0x2067e6>=_0x23229d){_0x2067e6=_0x23229d;_0x59073c=0xc8;}else{_0x59073c=0xce;}_0xad99a6[_0xb420('0x1b')](_0x59073c);return _0xad99a6[_0xb420('0x21')](_0xb420('0x22'),_0x17ece7+'-'+_0x2067e6+'/'+_0x23229d)['json'](_0xe384b5);}return null;};}function patchUpdates(_0x3ff744){return function(_0xe5fc4a){try{jsonpatch[_0xb420('0x23')](_0xe5fc4a,_0x3ff744,!![]);}catch(_0x430103){return BPromise['reject'](_0x430103);}return _0xe5fc4a[_0xb420('0x24')]();};}function saveUpdates(_0x2df13f,_0x581a48){return function(_0x2945ee){if(_0x2945ee){return _0x2945ee[_0xb420('0x25')](_0x2df13f)[_0xb420('0x26')](function(_0x27abbe){return _0x27abbe;});}return null;};}function removeEntity(_0x4cf1d5,_0x5746b8){return function(_0x278513){if(_0x278513){return _0x278513[_0xb420('0x27')]()[_0xb420('0x26')](function(){_0x4cf1d5[_0xb420('0x1b')](0xcc)[_0xb420('0x1c')]();});}};}function handleEntityNotFound(_0x5493c1,_0x3ed606){return function(_0x2ddbb1){if(!_0x2ddbb1){_0x5493c1['sendStatus'](0x194);}return _0x2ddbb1;};}function handleError(_0x38b2e9,_0x8373a3){_0x8373a3=_0x8373a3||0x1f4;return function(_0x209e50){logger[_0xb420('0x28')](_0x209e50[_0xb420('0x29')]);if(_0x209e50['name']){delete _0x209e50[_0xb420('0x2a')];}_0x38b2e9[_0xb420('0x1b')](_0x8373a3)[_0xb420('0x2b')](_0x209e50);};}exports[_0xb420('0x2c')]=function(_0x518b50,_0x339379){var _0x56bfe4={},_0x507628={},_0x28893b={'count':0x0,'rows':[]};var _0x390f56=_['map'](db[_0xb420('0x2d')][_0xb420('0x2e')],function(_0x2c8d51){return{'name':_0x2c8d51[_0xb420('0x2f')],'type':_0x2c8d51[_0xb420('0x30')][_0xb420('0x31')]};});_0x507628['model']=_[_0xb420('0x32')](_['map'](_0x390f56,'name'),['name']);_0x507628['query']=_[_0xb420('0x33')](_0x518b50[_0xb420('0x34')]);_0x507628[_0xb420('0x35')]=_[_0xb420('0x36')](_0x507628[_0xb420('0x37')],_0x507628['query']);_0x56bfe4['attributes']=_[_0xb420('0x36')](_0x507628[_0xb420('0x37')],qs[_0xb420('0x38')](_0x518b50[_0xb420('0x34')][_0xb420('0x38')]));_0x56bfe4[_0xb420('0x39')]=_0x56bfe4[_0xb420('0x39')][_0xb420('0x3a')]?_0x56bfe4[_0xb420('0x39')]:_0x507628[_0xb420('0x37')];if(!_0x518b50[_0xb420('0x34')][_0xb420('0x3b')](_0xb420('0x3c'))){_0x56bfe4[_0xb420('0x1f')]=qs[_0xb420('0x1f')](_0x518b50[_0xb420('0x34')][_0xb420('0x1f')]);_0x56bfe4[_0xb420('0x1d')]=qs[_0xb420('0x1d')](_0x518b50[_0xb420('0x34')][_0xb420('0x1d')]);}_0x56bfe4[_0xb420('0x3d')]=qs[_0xb420('0x3e')](_0x518b50['query'][_0xb420('0x3e')]);_0x56bfe4[_0xb420('0x3f')]=qs[_0xb420('0x35')](_[_0xb420('0x40')](_0x518b50['query'],_0x507628['filters']),_0x390f56);if(_0x518b50[_0xb420('0x34')][_0xb420('0x41')]){_0x56bfe4[_0xb420('0x3f')]=_[_0xb420('0x42')](_0x56bfe4['where'],{'$or':_['map'](_0x390f56,function(_0x35fea1){if(_0x35fea1[_0xb420('0x30')]!==_0xb420('0x43')){var _0x43af54={};_0x43af54[_0x35fea1[_0xb420('0x2a')]]={'$like':'%'+_0x518b50[_0xb420('0x34')][_0xb420('0x41')]+'%'};return _0x43af54;}})});}_0x56bfe4=_[_0xb420('0x42')]({},_0x56bfe4,_0x518b50[_0xb420('0x44')]);var _0x30c76a={'where':_0x56bfe4['where']};return db[_0xb420('0x2d')][_0xb420('0x20')](_0x30c76a)['then'](function(_0x4c5285){_0x28893b[_0xb420('0x20')]=_0x4c5285;if(_0x518b50[_0xb420('0x34')][_0xb420('0x45')]){_0x56bfe4['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0xb420('0x46')](_0x56bfe4);})['then'](function(_0x2548a4){_0x28893b[_0xb420('0x47')]=_0x2548a4;return _0x28893b;})[_0xb420('0x26')](respondWithFilteredResult(_0x339379,_0x56bfe4))['catch'](handleError(_0x339379,null));};exports[_0xb420('0x48')]=function(_0x466789,_0x2cb597){var _0x4fed59={'raw':!![],'where':{'id':_0x466789['params']['id']}},_0x109e6c={};_0x109e6c[_0xb420('0x37')]=_[_0xb420('0x33')](db['VoiceMailMessage']['rawAttributes']);_0x109e6c['query']=_['keys'](_0x466789[_0xb420('0x34')]);_0x109e6c[_0xb420('0x35')]=_[_0xb420('0x36')](_0x109e6c[_0xb420('0x37')],_0x109e6c[_0xb420('0x34')]);_0x4fed59[_0xb420('0x39')]=_[_0xb420('0x36')](_0x109e6c[_0xb420('0x37')],qs[_0xb420('0x38')](_0x466789[_0xb420('0x34')]['fields']));_0x4fed59[_0xb420('0x39')]=_0x4fed59[_0xb420('0x39')][_0xb420('0x3a')]?_0x4fed59[_0xb420('0x39')]:_0x109e6c[_0xb420('0x37')];if(_0x466789['query'][_0xb420('0x45')]){_0x4fed59[_0xb420('0x49')]=[{'all':!![]}];}_0x4fed59=_[_0xb420('0x42')]({},_0x4fed59,_0x466789[_0xb420('0x44')]);return db[_0xb420('0x2d')][_0xb420('0x4a')](_0x4fed59)[_0xb420('0x26')](handleEntityNotFound(_0x2cb597,null))[_0xb420('0x26')](respondWithResult(_0x2cb597,null))['catch'](handleError(_0x2cb597,null));};exports[_0xb420('0x4b')]=function(_0x210156,_0x477609){return db[_0xb420('0x2d')][_0xb420('0x4b')](_0x210156[_0xb420('0x4c')],{})['then'](respondWithResult(_0x477609,0xc9))[_0xb420('0x4d')](handleError(_0x477609,null));};exports[_0xb420('0x25')]=function(_0x5c443a,_0x6e5844){if(_0x5c443a[_0xb420('0x4c')]['id']){delete _0x5c443a[_0xb420('0x4c')]['id'];}return db[_0xb420('0x2d')]['find']({'where':{'id':_0x5c443a[_0xb420('0x4e')]['id']}})[_0xb420('0x26')](handleEntityNotFound(_0x6e5844,null))['then'](saveUpdates(_0x5c443a[_0xb420('0x4c')],null))[_0xb420('0x26')](respondWithResult(_0x6e5844,null))[_0xb420('0x4d')](handleError(_0x6e5844,null));};exports[_0xb420('0x27')]=function(_0x461c89,_0x59c6f3){return db[_0xb420('0x2d')][_0xb420('0x4a')]({'where':{'id':_0x461c89[_0xb420('0x4e')]['id']}})[_0xb420('0x26')](handleEntityNotFound(_0x59c6f3,null))['then'](removeEntity(_0x59c6f3,null))[_0xb420('0x4d')](handleError(_0x59c6f3,null));};exports[_0xb420('0x4f')]=function(_0x443deb,_0x40b4dd,_0x590985){return db['VoiceMailMessage']['find']({'where':{'id':_0x443deb[_0xb420('0x4e')]['id']},'attributes':['id','recording',_0xb420('0x50')]})[_0xb420('0x26')](handleEntityNotFound(_0x40b4dd,null))[_0xb420('0x26')](function(_0x41b342){if(_0x41b342){if(!_0x41b342[_0xb420('0x51')]){throw new db['Sequelize'][(_0xb420('0x52'))](_0xb420('0x53'));}var _0x54e6ca={'Content-Type':'audio/wav','Content-Disposition':_0xb420('0x54')};if(_0x41b342[_0xb420('0x50')]){_0x54e6ca[_0xb420('0x55')]='attachment;\x20filename=\x22'+_0x41b342[_0xb420('0x50')]+_0xb420('0x56');}_0x40b4dd['set'](_0x54e6ca);return _0x40b4dd['send'](new Buffer(_0x41b342[_0xb420('0x51')]));}})[_0xb420('0x4d')](handleError(_0x40b4dd,null));}; \ No newline at end of file +var _0xc34b=['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','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','fs-extra','squel','crypto'];(function(_0x2a6492,_0x328c6a){var _0x1193a8=function(_0x3fb9fc){while(--_0x3fb9fc){_0x2a6492['push'](_0x2a6492['shift']());}};_0x1193a8(++_0x328c6a);}(_0xc34b,0x18f));var _0xbc34=function(_0x104b35,_0x13f218){_0x104b35=_0x104b35-0x0;var _0x55584d=_0xc34b[_0x104b35];return _0x55584d;};'use strict';var emlformat=require(_0xbc34('0x0'));var rimraf=require(_0xbc34('0x1'));var zipdir=require(_0xbc34('0x2'));var jsonpatch=require(_0xbc34('0x3'));var rp=require(_0xbc34('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbc34('0x5'));var sox=require(_0xbc34('0x6'));var csv=require(_0xbc34('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc34('0x8'));var _=require('lodash');var squel=require(_0xbc34('0x9'));var crypto=require(_0xbc34('0xa'));var jsforce=require(_0xbc34('0xb'));var deskjs=require(_0xbc34('0xc'));var toCsv=require(_0xbc34('0x7'));var querystring=require(_0xbc34('0xd'));var Papa=require(_0xbc34('0xe'));var Redis=require('ioredis');var authService=require(_0xbc34('0xf'));var qs=require(_0xbc34('0x10'));var as=require(_0xbc34('0x11'));var hardwareService=require(_0xbc34('0x12'));var logger=require('../../config/logger')(_0xbc34('0x13'));var utils=require(_0xbc34('0x14'));var config=require(_0xbc34('0x15'));var licenseUtil=require(_0xbc34('0x16'));var db=require(_0xbc34('0x17'))['db'];function respondWithStatusCode(_0x2bec38,_0x164f5f){_0x164f5f=_0x164f5f||0xcc;return function(_0x54d9be){if(_0x54d9be){return _0x2bec38['sendStatus'](_0x164f5f);}return _0x2bec38['status'](_0x164f5f)[_0xbc34('0x18')]();};}function respondWithResult(_0x248268,_0x4ec13f){_0x4ec13f=_0x4ec13f||0xc8;return function(_0x7e42c0){if(_0x7e42c0){return _0x248268[_0xbc34('0x19')](_0x4ec13f)[_0xbc34('0x1a')](_0x7e42c0);}};}function respondWithFilteredResult(_0xa8ef55,_0x4ad66d){return function(_0x5cabff){if(_0x5cabff){var _0x4d340d=typeof _0x4ad66d[_0xbc34('0x1b')]===_0xbc34('0x1c')&&typeof _0x4ad66d[_0xbc34('0x1d')]===_0xbc34('0x1c');var _0x4b9fa0=_0x5cabff[_0xbc34('0x1e')];var _0x1b69ca=_0x4d340d?0x0:_0x4ad66d['offset'];var _0x4afd1f=_0x4d340d?_0x5cabff[_0xbc34('0x1e')]:_0x4ad66d[_0xbc34('0x1b')]+_0x4ad66d[_0xbc34('0x1d')];var _0x2092b9;if(_0x4afd1f>=_0x4b9fa0){_0x4afd1f=_0x4b9fa0;_0x2092b9=0xc8;}else{_0x2092b9=0xce;}_0xa8ef55[_0xbc34('0x19')](_0x2092b9);return _0xa8ef55[_0xbc34('0x1f')](_0xbc34('0x20'),_0x1b69ca+'-'+_0x4afd1f+'/'+_0x4b9fa0)[_0xbc34('0x1a')](_0x5cabff);}return null;};}function patchUpdates(_0x12e0f1){return function(_0x4f3b32){try{jsonpatch[_0xbc34('0x21')](_0x4f3b32,_0x12e0f1,!![]);}catch(_0xd71179){return BPromise[_0xbc34('0x22')](_0xd71179);}return _0x4f3b32[_0xbc34('0x23')]();};}function saveUpdates(_0x176bbf,_0x1c5bd7){return function(_0x59ca9a){if(_0x59ca9a){return _0x59ca9a[_0xbc34('0x24')](_0x176bbf)['then'](function(_0x1b3612){return _0x1b3612;});}return null;};}function removeEntity(_0x221007,_0x49be06){return function(_0x3cacd1){if(_0x3cacd1){return _0x3cacd1[_0xbc34('0x25')]()[_0xbc34('0x26')](function(){_0x221007[_0xbc34('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cb834,_0x53ed72){return function(_0x2dc244){if(!_0x2dc244){_0x3cb834['sendStatus'](0x194);}return _0x2dc244;};}function handleError(_0x230805,_0x85d166){_0x85d166=_0x85d166||0x1f4;return function(_0x4654f0){logger[_0xbc34('0x27')](_0x4654f0[_0xbc34('0x28')]);if(_0x4654f0[_0xbc34('0x29')]){delete _0x4654f0['name'];}_0x230805['status'](_0x85d166)[_0xbc34('0x2a')](_0x4654f0);};}exports[_0xbc34('0x2b')]=function(_0x4709fc,_0x4d4e03){var _0x2a62e5={},_0x10d676={},_0x632a6c={'count':0x0,'rows':[]};var _0x26057e=_[_0xbc34('0x2c')](db[_0xbc34('0x2d')][_0xbc34('0x2e')],function(_0x2e0af6){return{'name':_0x2e0af6[_0xbc34('0x2f')],'type':_0x2e0af6[_0xbc34('0x30')][_0xbc34('0x31')]};});_0x10d676['model']=_[_0xbc34('0x32')](_[_0xbc34('0x2c')](_0x26057e,'name'),[_0xbc34('0x29')]);_0x10d676[_0xbc34('0x33')]=_[_0xbc34('0x34')](_0x4709fc[_0xbc34('0x33')]);_0x10d676[_0xbc34('0x35')]=_['intersection'](_0x10d676[_0xbc34('0x36')],_0x10d676[_0xbc34('0x33')]);_0x2a62e5[_0xbc34('0x37')]=_[_0xbc34('0x38')](_0x10d676[_0xbc34('0x36')],qs[_0xbc34('0x39')](_0x4709fc[_0xbc34('0x33')]['fields']));_0x2a62e5[_0xbc34('0x37')]=_0x2a62e5[_0xbc34('0x37')][_0xbc34('0x3a')]?_0x2a62e5[_0xbc34('0x37')]:_0x10d676['model'];if(!_0x4709fc['query'][_0xbc34('0x3b')]('nolimit')){_0x2a62e5[_0xbc34('0x1d')]=qs[_0xbc34('0x1d')](_0x4709fc[_0xbc34('0x33')][_0xbc34('0x1d')]);_0x2a62e5[_0xbc34('0x1b')]=qs[_0xbc34('0x1b')](_0x4709fc[_0xbc34('0x33')]['offset']);}_0x2a62e5['order']=qs[_0xbc34('0x3c')](_0x4709fc[_0xbc34('0x33')][_0xbc34('0x3c')]);_0x2a62e5[_0xbc34('0x3d')]=qs[_0xbc34('0x35')](_['pick'](_0x4709fc[_0xbc34('0x33')],_0x10d676['filters']),_0x26057e);if(_0x4709fc['query']['filter']){_0x2a62e5[_0xbc34('0x3d')]=_[_0xbc34('0x3e')](_0x2a62e5[_0xbc34('0x3d')],{'$or':_['map'](_0x26057e,function(_0x2b70dc){if(_0x2b70dc[_0xbc34('0x30')]!==_0xbc34('0x3f')){var _0x149d43={};_0x149d43[_0x2b70dc[_0xbc34('0x29')]]={'$like':'%'+_0x4709fc[_0xbc34('0x33')][_0xbc34('0x40')]+'%'};return _0x149d43;}})});}_0x2a62e5=_[_0xbc34('0x3e')]({},_0x2a62e5,_0x4709fc[_0xbc34('0x41')]);var _0xd94f6={'where':_0x2a62e5['where']};return db[_0xbc34('0x2d')][_0xbc34('0x1e')](_0xd94f6)['then'](function(_0xeec4bf){_0x632a6c[_0xbc34('0x1e')]=_0xeec4bf;if(_0x4709fc[_0xbc34('0x33')][_0xbc34('0x42')]){_0x2a62e5[_0xbc34('0x43')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x2a62e5);})[_0xbc34('0x26')](function(_0x318eac){_0x632a6c[_0xbc34('0x44')]=_0x318eac;return _0x632a6c;})['then'](respondWithFilteredResult(_0x4d4e03,_0x2a62e5))[_0xbc34('0x45')](handleError(_0x4d4e03,null));};exports[_0xbc34('0x46')]=function(_0x37f744,_0x142478){var _0x5be5aa={'raw':!![],'where':{'id':_0x37f744[_0xbc34('0x47')]['id']}},_0x5b489b={};_0x5b489b[_0xbc34('0x36')]=_[_0xbc34('0x34')](db[_0xbc34('0x2d')][_0xbc34('0x2e')]);_0x5b489b[_0xbc34('0x33')]=_[_0xbc34('0x34')](_0x37f744[_0xbc34('0x33')]);_0x5b489b['filters']=_[_0xbc34('0x38')](_0x5b489b[_0xbc34('0x36')],_0x5b489b['query']);_0x5be5aa[_0xbc34('0x37')]=_['intersection'](_0x5b489b['model'],qs[_0xbc34('0x39')](_0x37f744[_0xbc34('0x33')][_0xbc34('0x39')]));_0x5be5aa[_0xbc34('0x37')]=_0x5be5aa['attributes'][_0xbc34('0x3a')]?_0x5be5aa[_0xbc34('0x37')]:_0x5b489b[_0xbc34('0x36')];if(_0x37f744[_0xbc34('0x33')][_0xbc34('0x42')]){_0x5be5aa['include']=[{'all':!![]}];}_0x5be5aa=_['merge']({},_0x5be5aa,_0x37f744['options']);return db[_0xbc34('0x2d')][_0xbc34('0x48')](_0x5be5aa)[_0xbc34('0x26')](handleEntityNotFound(_0x142478,null))['then'](respondWithResult(_0x142478,null))['catch'](handleError(_0x142478,null));};exports[_0xbc34('0x49')]=function(_0x5869d3,_0x5beb55){return db['VoiceMailMessage'][_0xbc34('0x49')](_0x5869d3['body'],{})[_0xbc34('0x26')](respondWithResult(_0x5beb55,0xc9))['catch'](handleError(_0x5beb55,null));};exports[_0xbc34('0x24')]=function(_0x44260e,_0x53afc5){if(_0x44260e['body']['id']){delete _0x44260e[_0xbc34('0x4a')]['id'];}return db[_0xbc34('0x2d')][_0xbc34('0x48')]({'where':{'id':_0x44260e[_0xbc34('0x47')]['id']}})['then'](handleEntityNotFound(_0x53afc5,null))[_0xbc34('0x26')](saveUpdates(_0x44260e[_0xbc34('0x4a')],null))[_0xbc34('0x26')](respondWithResult(_0x53afc5,null))[_0xbc34('0x45')](handleError(_0x53afc5,null));};exports['destroy']=function(_0x42df8a,_0x30edb3){return db[_0xbc34('0x2d')][_0xbc34('0x48')]({'where':{'id':_0x42df8a['params']['id']}})[_0xbc34('0x26')](handleEntityNotFound(_0x30edb3,null))[_0xbc34('0x26')](removeEntity(_0x30edb3,null))[_0xbc34('0x45')](handleError(_0x30edb3,null));};exports['download']=function(_0x402996,_0x3b0093,_0x3de934){return db['VoiceMailMessage']['find']({'where':{'id':_0x402996[_0xbc34('0x47')]['id']},'attributes':['id',_0xbc34('0x4b'),_0xbc34('0x4c')]})[_0xbc34('0x26')](handleEntityNotFound(_0x3b0093,null))[_0xbc34('0x26')](function(_0x970d96){if(_0x970d96){if(!_0x970d96['recording']){throw new db[(_0xbc34('0x4d'))]['ValidationError'](_0xbc34('0x4e'));}var _0xfb9416={'Content-Type':_0xbc34('0x4f'),'Content-Disposition':'attachment'};if(_0x970d96[_0xbc34('0x4c')]){_0xfb9416['Content-Disposition']=_0xbc34('0x50')+_0x970d96['msg_id']+_0xbc34('0x51');}_0x3b0093[_0xbc34('0x1f')](_0xfb9416);return _0x3b0093['send'](new Buffer(_0x970d96[_0xbc34('0x4b')]));}})[_0xbc34('0x45')](handleError(_0x3b0093,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 671068f..fdb2c23 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 _0x0d3d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash'];(function(_0x3b8de0,_0x2e5f3a){var _0x653e71=function(_0x129d73){while(--_0x129d73){_0x3b8de0['push'](_0x3b8de0['shift']());}};_0x653e71(++_0x2e5f3a);}(_0x0d3d,0xf6));var _0xd0d3=function(_0x3f0b3d,_0x4f004a){_0x3f0b3d=_0x3f0b3d-0x0;var _0x471192=_0x0d3d[_0x3f0b3d];return _0x471192;};'use strict';var _=require(_0xd0d3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd0d3('0x1'));var moment=require('moment');var BPromise=require(_0xd0d3('0x2'));var rp=require(_0xd0d3('0x3'));var fs=require('fs');var path=require(_0xd0d3('0x4'));var rimraf=require(_0xd0d3('0x5'));var config=require(_0xd0d3('0x6'));var attributes=require(_0xd0d3('0x7'));module[_0xd0d3('0x8')]=function(_0x2ddc8c,_0x15793f){return _0x2ddc8c[_0xd0d3('0x9')](_0xd0d3('0xa'),attributes,{'tableName':_0xd0d3('0xb'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xd0d3('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6c7c=['path','../../config/environment','VoiceMailMessage','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x10cd5b,_0x4278fd){var _0x9d7638=function(_0x273474){while(--_0x273474){_0x10cd5b['push'](_0x10cd5b['shift']());}};_0x9d7638(++_0x4278fd);}(_0x6c7c,0x10c));var _0xc6c7=function(_0x1ef27e,_0x56b302){_0x1ef27e=_0x1ef27e-0x0;var _0x93f05=_0x6c7c[_0x1ef27e];return _0x93f05;};'use strict';var _=require(_0xc6c7('0x0'));var util=require(_0xc6c7('0x1'));var logger=require(_0xc6c7('0x2'))(_0xc6c7('0x3'));var moment=require(_0xc6c7('0x4'));var BPromise=require(_0xc6c7('0x5'));var rp=require(_0xc6c7('0x6'));var fs=require('fs');var path=require(_0xc6c7('0x7'));var rimraf=require('rimraf');var config=require(_0xc6c7('0x8'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x4b77fe,_0x1d6163){return _0x4b77fe['define'](_0xc6c7('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xc6c7('0xa'),'fields':[_0xc6c7('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 23c875e..c3b8562 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 _0x6cd7=['error','message','VoiceMailMessage,\x20%s,\x20%s','info','result','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','request','then','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x218aa7,_0x36ae2c){var _0x53e85d=function(_0xe31799){while(--_0xe31799){_0x218aa7['push'](_0x218aa7['shift']());}};_0x53e85d(++_0x36ae2c);}(_0x6cd7,0x19d));var _0x76cd=function(_0x38f34e,_0x287825){_0x38f34e=_0x38f34e-0x0;var _0x3f3adf=_0x6cd7[_0x38f34e];return _0x3f3adf;};'use strict';var _=require('lodash');var util=require(_0x76cd('0x0'));var moment=require(_0x76cd('0x1'));var BPromise=require(_0x76cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76cd('0x3'));var db=require(_0x76cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x76cd('0x5'));var config=require(_0x76cd('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x126868,_0x4d3ce1,_0x314a51){return new BPromise(function(_0x595733,_0x5c556a){return client[_0x76cd('0x7')](_0x126868,_0x314a51)[_0x76cd('0x8')](function(_0x13bdb8){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x4d3ce1,_0x76cd('0x9'));logger[_0x76cd('0xa')](_0x76cd('0xb'),_0x4d3ce1,_0x76cd('0x9'),JSON['stringify'](_0x13bdb8));if(_0x13bdb8[_0x76cd('0xc')]){if(_0x13bdb8[_0x76cd('0xc')]['code']===0x1f4){logger[_0x76cd('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x4d3ce1,_0x13bdb8[_0x76cd('0xc')][_0x76cd('0xd')]);return _0x5c556a(_0x13bdb8['error'][_0x76cd('0xd')]);}logger[_0x76cd('0xc')](_0x76cd('0xe'),_0x4d3ce1,_0x13bdb8[_0x76cd('0xc')][_0x76cd('0xd')]);return _0x595733(_0x13bdb8[_0x76cd('0xc')][_0x76cd('0xd')]);}else{logger[_0x76cd('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x4d3ce1,_0x76cd('0x9'));_0x595733(_0x13bdb8[_0x76cd('0x10')][_0x76cd('0xd')]);}})['catch'](function(_0x1c7cfe){logger[_0x76cd('0xc')](_0x76cd('0xe'),_0x4d3ce1,_0x1c7cfe);_0x5c556a(_0x1c7cfe);});});} \ No newline at end of file +var _0xfe74=['http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x59984c,_0x4ba834){var _0x373304=function(_0x38568c){while(--_0x38568c){_0x59984c['push'](_0x59984c['shift']());}};_0x373304(++_0x4ba834);}(_0xfe74,0x123));var _0x4fe7=function(_0x10edb1,_0x41f408){_0x10edb1=_0x10edb1-0x0;var _0x2c6ac7=_0xfe74[_0x10edb1];return _0x2c6ac7;};'use strict';var _=require('lodash');var util=require(_0x4fe7('0x0'));var moment=require(_0x4fe7('0x1'));var BPromise=require('bluebird');var rs=require(_0x4fe7('0x2'));var fs=require('fs');var Redis=require(_0x4fe7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4fe7('0x4'));var logger=require(_0x4fe7('0x5'))(_0x4fe7('0x6'));var config=require(_0x4fe7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4fe7('0x8')][_0x4fe7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c904b,_0x324500,_0x57f723){return new BPromise(function(_0x12ea77,_0x13afb4){return client[_0x4fe7('0xa')](_0x5c904b,_0x57f723)['then'](function(_0xdcc5a2){logger[_0x4fe7('0xb')](_0x4fe7('0xc'),_0x324500,_0x4fe7('0xd'));logger['debug'](_0x4fe7('0xe'),_0x324500,'request\x20sent',JSON[_0x4fe7('0xf')](_0xdcc5a2));if(_0xdcc5a2[_0x4fe7('0x10')]){if(_0xdcc5a2[_0x4fe7('0x10')]['code']===0x1f4){logger['error'](_0x4fe7('0xc'),_0x324500,_0xdcc5a2['error']['message']);return _0x13afb4(_0xdcc5a2[_0x4fe7('0x10')][_0x4fe7('0x11')]);}logger['error'](_0x4fe7('0xc'),_0x324500,_0xdcc5a2['error'][_0x4fe7('0x11')]);return _0x12ea77(_0xdcc5a2[_0x4fe7('0x10')][_0x4fe7('0x11')]);}else{logger['info'](_0x4fe7('0xc'),_0x324500,_0x4fe7('0xd'));_0x12ea77(_0xdcc5a2[_0x4fe7('0x12')][_0x4fe7('0x11')]);}})[_0x4fe7('0x13')](function(_0x5c8720){logger[_0x4fe7('0x10')](_0x4fe7('0xc'),_0x324500,_0x5c8720);_0x13afb4(_0x5c8720);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 8e03e5a..0ca3c36 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 _0x6c2a=['addSound','put','update','destroy','delete','removeSound','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','/:id/sounds','getSounds','post'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x6c2a,0x1bc));var _0xa6c2=function(_0x222f08,_0x140c5c){_0x222f08=_0x222f08-0x0;var _0x41eaa6=_0x6c2a[_0x222f08];return _0x41eaa6;};'use strict';var multer=require(_0xa6c2('0x0'));var util=require(_0xa6c2('0x1'));var path=require('path');var timeout=require(_0xa6c2('0x2'));var express=require(_0xa6c2('0x3'));var router=express[_0xa6c2('0x4')]();var fs_extra=require(_0xa6c2('0x5'));var auth=require(_0xa6c2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa6c2('0x7'));var controller=require(_0xa6c2('0x8'));router[_0xa6c2('0x9')]('/',auth[_0xa6c2('0xa')](),controller[_0xa6c2('0xb')]);router['get'](_0xa6c2('0xc'),auth[_0xa6c2('0xa')](),controller['show']);router['get'](_0xa6c2('0xd'),auth['isAuthenticated'](),controller[_0xa6c2('0xe')]);router[_0xa6c2('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa6c2('0xf')](_0xa6c2('0xd'),auth[_0xa6c2('0xa')](),controller[_0xa6c2('0x10')]);router[_0xa6c2('0x11')](_0xa6c2('0xc'),auth['isAuthenticated'](),controller[_0xa6c2('0x12')]);router['delete'](_0xa6c2('0xc'),auth[_0xa6c2('0xa')](),controller[_0xa6c2('0x13')]);router[_0xa6c2('0x14')]('/:id/sounds/:id2',auth[_0xa6c2('0xa')](),controller[_0xa6c2('0x15')]);module[_0xa6c2('0x16')]=router; \ No newline at end of file +var _0x445c=['put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','getSounds','post','addSound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x445c,0x104));var _0xc445=function(_0x33e350,_0x2f7bd1){_0x33e350=_0x33e350-0x0;var _0x303ee9=_0x445c[_0x33e350];return _0x303ee9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc445('0x0'));var timeout=require(_0xc445('0x1'));var express=require(_0xc445('0x2'));var router=express[_0xc445('0x3')]();var fs_extra=require(_0xc445('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc445('0x5'));var config=require(_0xc445('0x6'));var controller=require(_0xc445('0x7'));router[_0xc445('0x8')]('/',auth[_0xc445('0x9')](),controller['index']);router[_0xc445('0x8')](_0xc445('0xa'),auth[_0xc445('0x9')](),controller[_0xc445('0xb')]);router[_0xc445('0x8')](_0xc445('0xc'),auth[_0xc445('0x9')](),controller[_0xc445('0xd')]);router[_0xc445('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc445('0xe')](_0xc445('0xc'),auth[_0xc445('0x9')](),controller[_0xc445('0xf')]);router[_0xc445('0x10')](_0xc445('0xa'),auth[_0xc445('0x9')](),controller[_0xc445('0x11')]);router[_0xc445('0x12')](_0xc445('0xa'),auth[_0xc445('0x9')](),controller[_0xc445('0x13')]);router[_0xc445('0x12')](_0xc445('0x14'),auth[_0xc445('0x9')](),controller[_0xc445('0x15')]);module[_0xc445('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 efe092f..356e183 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 _0x5ea4=['mp3nb','quietmp3nb','quietmp3','alpha','BOOLEAN','exports','STRING','name','ENUM','custom','files'];(function(_0x34f7bb,_0x547eb3){var _0x2efee3=function(_0x1fc766){while(--_0x1fc766){_0x34f7bb['push'](_0x34f7bb['shift']());}};_0x2efee3(++_0x547eb3);}(_0x5ea4,0x7e));var _0x45ea=function(_0xdfad94,_0x500479){_0xdfad94=_0xdfad94-0x0;var _0x348a4e=_0x5ea4[_0xdfad94];return _0x348a4e;};'use strict';var Sequelize=require('sequelize');module[_0x45ea('0x0')]={'name':{'type':Sequelize[_0x45ea('0x1')],'allowNull':![],'unique':_0x45ea('0x2')},'mode':{'type':Sequelize[_0x45ea('0x3')](_0x45ea('0x4'),_0x45ea('0x5'),_0x45ea('0x6'),_0x45ea('0x7'),_0x45ea('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0x45ea('0x5')},'directory':{'type':Sequelize[_0x45ea('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x45ea('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x45ea('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x45ea('0x1')],'allowNull':!![],'defaultValue':_0x45ea('0x9')},'format':{'type':Sequelize[_0x45ea('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x45ea('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x409a=['mp3nb','quietmp3','mp3','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','ENUM','custom','files'];(function(_0x1f6aa4,_0x1045f2){var _0x371226=function(_0x1e514a){while(--_0x1e514a){_0x1f6aa4['push'](_0x1f6aa4['shift']());}};_0x371226(++_0x1045f2);}(_0x409a,0x67));var _0xa409=function(_0x97b8d,_0x144fc5){_0x97b8d=_0x97b8d-0x0;var _0x5468b2=_0x409a[_0x97b8d];return _0x5468b2;};'use strict';var Sequelize=require(_0xa409('0x0'));module[_0xa409('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xa409('0x2')](_0xa409('0x3'),_0xa409('0x4'),_0xa409('0x5'),'quietmp3nb',_0xa409('0x6'),_0xa409('0x7')),'allowNull':!![],'defaultValue':_0xa409('0x4')},'directory':{'type':Sequelize[_0xa409('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0xa409('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0xa409('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0xa409('0x8')],'allowNull':!![],'defaultValue':_0xa409('0x9')},'format':{'type':Sequelize[_0xa409('0x8')],'allowNull':!![]},'stamp':{'type':_0xa409('0xa')},'defaultEntry':{'type':Sequelize[_0xa409('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 64fe6ee..4c1f899 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 _0x0fcb=['role','UserProfileSection','userProfileId','UserProfileResource','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','basename','server/files/moh','symlinkSync','removeSound','id2','directory','format','%s.%s','message','getSounds','order','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','get','MusicOnHolds','sendStatus','error','stack','name','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','params','includeAll','find','body','create','sequelize','transaction','mode','files','join','root','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x53796a,_0x5c7a57){var _0x1b6dff=function(_0x24115c){while(--_0x24115c){_0x53796a['push'](_0x53796a['shift']());}};_0x1b6dff(++_0x5c7a57);}(_0x0fcb,0x89));var _0xb0fc=function(_0x1c8e45,_0x2cbc28){_0x1c8e45=_0x1c8e45-0x0;var _0x3952ec=_0x0fcb[_0x1c8e45];return _0x3952ec;};'use strict';var emlformat=require(_0xb0fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0fc('0x1'));var jsonpatch=require(_0xb0fc('0x2'));var rp=require(_0xb0fc('0x3'));var moment=require('moment');var BPromise=require(_0xb0fc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb0fc('0x5'));var sox=require(_0xb0fc('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0fc('0x7'));var _=require(_0xb0fc('0x8'));var squel=require(_0xb0fc('0x9'));var crypto=require(_0xb0fc('0xa'));var jsforce=require(_0xb0fc('0xb'));var deskjs=require(_0xb0fc('0xc'));var toCsv=require(_0xb0fc('0xd'));var querystring=require(_0xb0fc('0xe'));var Papa=require(_0xb0fc('0xf'));var Redis=require(_0xb0fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb0fc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0fc('0x12'))(_0xb0fc('0x13'));var utils=require(_0xb0fc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb0fc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f5725,_0x214af6){_0x214af6=_0x214af6||0xcc;return function(_0x49039b){if(_0x49039b){return _0x3f5725['sendStatus'](_0x214af6);}return _0x3f5725[_0xb0fc('0x16')](_0x214af6)[_0xb0fc('0x17')]();};}function respondWithResult(_0x64fd58,_0x38ae46){_0x38ae46=_0x38ae46||0xc8;return function(_0xed0d68){if(_0xed0d68){return _0x64fd58[_0xb0fc('0x16')](_0x38ae46)[_0xb0fc('0x18')](_0xed0d68);}};}function respondWithFilteredResult(_0x209d4d,_0x54f0ad){return function(_0x3437f4){if(_0x3437f4){var _0x4a2b60=typeof _0x54f0ad[_0xb0fc('0x19')]===_0xb0fc('0x1a')&&typeof _0x54f0ad['limit']===_0xb0fc('0x1a');var _0xb63530=_0x3437f4[_0xb0fc('0x1b')];var _0x28510a=_0x4a2b60?0x0:_0x54f0ad['offset'];var _0x3c8bca=_0x4a2b60?_0x3437f4['count']:_0x54f0ad[_0xb0fc('0x19')]+_0x54f0ad[_0xb0fc('0x1c')];var _0x3caa50;if(_0x3c8bca>=_0xb63530){_0x3c8bca=_0xb63530;_0x3caa50=0xc8;}else{_0x3caa50=0xce;}_0x209d4d[_0xb0fc('0x16')](_0x3caa50);return _0x209d4d['set']('Content-Range',_0x28510a+'-'+_0x3c8bca+'/'+_0xb63530)[_0xb0fc('0x18')](_0x3437f4);}return null;};}function patchUpdates(_0x3020b1){return function(_0x423d61){try{jsonpatch[_0xb0fc('0x1d')](_0x423d61,_0x3020b1,!![]);}catch(_0x29c0b7){return BPromise[_0xb0fc('0x1e')](_0x29c0b7);}return _0x423d61[_0xb0fc('0x1f')]();};}function saveUpdates(_0x506cae,_0x24fc8b){return function(_0xaeb3e1){if(_0xaeb3e1){return _0xaeb3e1[_0xb0fc('0x20')](_0x506cae)[_0xb0fc('0x21')](function(_0x5d40f4){return _0x5d40f4;});}return null;};}function removeEntity(_0x36efcc,_0x1b08a0){return function(_0x3d8be4){if(_0x3d8be4){return _0x3d8be4[_0xb0fc('0x22')]()[_0xb0fc('0x21')](function(){var _0x894748=_0x3d8be4[_0xb0fc('0x23')]({'plain':!![]});var _0x1f30cc=_0xb0fc('0x24');return db['UserProfileResource'][_0xb0fc('0x22')]({'where':{'type':_0x1f30cc,'resourceId':_0x894748['id']}})[_0xb0fc('0x21')](function(){return _0x3d8be4;});})['then'](function(){_0x36efcc[_0xb0fc('0x16')](0xcc)[_0xb0fc('0x17')]();});}};}function handleEntityNotFound(_0x485fd4,_0x29a4b8){return function(_0x97ba5c){if(!_0x97ba5c){_0x485fd4[_0xb0fc('0x25')](0x194);}return _0x97ba5c;};}function handleError(_0x4cb5ab,_0x2750dc){_0x2750dc=_0x2750dc||0x1f4;return function(_0xb08487){logger[_0xb0fc('0x26')](_0xb08487[_0xb0fc('0x27')]);if(_0xb08487[_0xb0fc('0x28')]){delete _0xb08487[_0xb0fc('0x28')];}_0x4cb5ab[_0xb0fc('0x16')](_0x2750dc)['send'](_0xb08487);};}exports[_0xb0fc('0x29')]=function(_0xd83a29,_0x4044aa){var _0x10b723={},_0x5f5120={},_0x30bab3={'count':0x0,'rows':[]};var _0x452615=_['map'](db[_0xb0fc('0x2a')][_0xb0fc('0x2b')],function(_0x276c6b){return{'name':_0x276c6b[_0xb0fc('0x2c')],'type':_0x276c6b[_0xb0fc('0x2d')][_0xb0fc('0x2e')]};});_0x5f5120[_0xb0fc('0x2f')]=_[_0xb0fc('0x30')](_0x452615,'name');_0x5f5120[_0xb0fc('0x31')]=_[_0xb0fc('0x32')](_0xd83a29[_0xb0fc('0x31')]);_0x5f5120[_0xb0fc('0x33')]=_[_0xb0fc('0x34')](_0x5f5120['model'],_0x5f5120[_0xb0fc('0x31')]);_0x10b723['attributes']=_[_0xb0fc('0x34')](_0x5f5120[_0xb0fc('0x2f')],qs['fields'](_0xd83a29[_0xb0fc('0x31')][_0xb0fc('0x35')]));_0x10b723[_0xb0fc('0x36')]=_0x10b723['attributes'][_0xb0fc('0x37')]?_0x10b723[_0xb0fc('0x36')]:_0x5f5120[_0xb0fc('0x2f')];if(!_0xd83a29[_0xb0fc('0x31')][_0xb0fc('0x38')](_0xb0fc('0x39'))){_0x10b723[_0xb0fc('0x1c')]=qs[_0xb0fc('0x1c')](_0xd83a29['query']['limit']);_0x10b723[_0xb0fc('0x19')]=qs[_0xb0fc('0x19')](_0xd83a29[_0xb0fc('0x31')][_0xb0fc('0x19')]);}_0x10b723['order']=qs[_0xb0fc('0x3a')](_0xd83a29['query'][_0xb0fc('0x3a')]);delete _0xd83a29[_0xb0fc('0x31')][_0xb0fc('0x3a')];_0x10b723[_0xb0fc('0x3b')]=qs['filters'](_[_0xb0fc('0x3c')](_0xd83a29[_0xb0fc('0x31')],_0x5f5120[_0xb0fc('0x33')]),_0x452615);if(_0xd83a29['query'][_0xb0fc('0x3d')]){_0x10b723[_0xb0fc('0x3b')]=_['merge'](_0x10b723[_0xb0fc('0x3b')],{'$or':_[_0xb0fc('0x30')](_0x452615,function(_0x1c743c){if(_0x1c743c['type']!==_0xb0fc('0x3e')){var _0x3fd246={};_0x3fd246[_0x1c743c[_0xb0fc('0x28')]]={'$like':'%'+_0xd83a29['query'][_0xb0fc('0x3d')]+'%'};return _0x3fd246;}})});}_0x10b723=_[_0xb0fc('0x3f')]({},_0x10b723,_0xd83a29[_0xb0fc('0x40')]);var _0x35c605={'where':_0x10b723[_0xb0fc('0x3b')]};return db[_0xb0fc('0x2a')][_0xb0fc('0x1b')](_0x35c605)['then'](function(_0x193e63){_0x30bab3['count']=_0x193e63;if(_0xd83a29[_0xb0fc('0x31')]['includeAll']){_0x10b723[_0xb0fc('0x41')]=[{'all':!![]}];}return db[_0xb0fc('0x2a')][_0xb0fc('0x42')](_0x10b723);})[_0xb0fc('0x21')](function(_0x58e3bf){_0x30bab3[_0xb0fc('0x43')]=_0x58e3bf;return _0x30bab3;})[_0xb0fc('0x21')](respondWithFilteredResult(_0x4044aa,_0x10b723))[_0xb0fc('0x44')](handleError(_0x4044aa,null));};exports['show']=function(_0x185f46,_0x3ccd67){var _0x4d1a59={'raw':![],'where':{'id':_0x185f46[_0xb0fc('0x45')]['id']}},_0x500234={};_0x500234[_0xb0fc('0x2f')]=_[_0xb0fc('0x32')](db[_0xb0fc('0x2a')][_0xb0fc('0x2b')]);_0x500234['query']=_[_0xb0fc('0x32')](_0x185f46[_0xb0fc('0x31')]);_0x500234[_0xb0fc('0x33')]=_[_0xb0fc('0x34')](_0x500234[_0xb0fc('0x2f')],_0x500234[_0xb0fc('0x31')]);_0x4d1a59[_0xb0fc('0x36')]=_[_0xb0fc('0x34')](_0x500234[_0xb0fc('0x2f')],qs[_0xb0fc('0x35')](_0x185f46[_0xb0fc('0x31')][_0xb0fc('0x35')]));_0x4d1a59[_0xb0fc('0x36')]=_0x4d1a59[_0xb0fc('0x36')][_0xb0fc('0x37')]?_0x4d1a59[_0xb0fc('0x36')]:_0x500234[_0xb0fc('0x2f')];if(_0x185f46[_0xb0fc('0x31')][_0xb0fc('0x46')]){_0x4d1a59['include']=[{'all':!![]}];}_0x4d1a59=_[_0xb0fc('0x3f')]({},_0x4d1a59,_0x185f46[_0xb0fc('0x40')]);return db['VoiceMusicOnHold'][_0xb0fc('0x47')](_0x4d1a59)[_0xb0fc('0x21')](handleEntityNotFound(_0x3ccd67,null))[_0xb0fc('0x21')](respondWithResult(_0x3ccd67,null))[_0xb0fc('0x44')](handleError(_0x3ccd67,null));};exports[_0xb0fc('0x20')]=function(_0x1caa70,_0x126aaa){if(_0x1caa70['body']['id']){delete _0x1caa70['body']['id'];}return db['VoiceMusicOnHold'][_0xb0fc('0x47')]({'where':{'id':_0x1caa70[_0xb0fc('0x45')]['id']}})[_0xb0fc('0x21')](handleEntityNotFound(_0x126aaa,null))[_0xb0fc('0x21')](saveUpdates(_0x1caa70[_0xb0fc('0x48')],null))[_0xb0fc('0x21')](respondWithResult(_0x126aaa,null))[_0xb0fc('0x44')](handleError(_0x126aaa,null));};exports[_0xb0fc('0x49')]=function(_0x15d154,_0x43a0df,_0x3d5774){return db[_0xb0fc('0x4a')][_0xb0fc('0x4b')](function(_0x2f58b0){if(_0x15d154[_0xb0fc('0x48')][_0xb0fc('0x4c')]===_0xb0fc('0x4d')){_0x15d154[_0xb0fc('0x48')]['directory']=path[_0xb0fc('0x4e')](config[_0xb0fc('0x4f')],'server/files/moh',_0x15d154[_0xb0fc('0x48')][_0xb0fc('0x28')]);}return db['VoiceMusicOnHold']['create'](_0x15d154[_0xb0fc('0x48')],{'transaction':_0x2f58b0})[_0xb0fc('0x21')](function(_0xdc723f){if(_0x15d154['body'][_0xb0fc('0x4c')]===_0xb0fc('0x4d')){fs[_0xb0fc('0x50')](_0xdc723f['directory'],parseInt('0777',0x8));}var _0x528a7c=_0x15d154[_0xb0fc('0x51')][_0xb0fc('0x23')]({'plain':!![]});if(!_0x528a7c)throw new Error(_0xb0fc('0x52'));if(_0x528a7c[_0xb0fc('0x53')]===_0xb0fc('0x51')){var _0x29ffc9=_0xdc723f[_0xb0fc('0x23')]({'plain':!![]});return db[_0xb0fc('0x54')][_0xb0fc('0x47')]({'where':{'name':'MusicOnHolds','userProfileId':_0x528a7c[_0xb0fc('0x55')]},'raw':!![]})[_0xb0fc('0x21')](function(_0x203190){if(_0x203190&&_0x203190['autoAssociation']===0x0){return db[_0xb0fc('0x56')]['create']({'name':_0x29ffc9[_0xb0fc('0x28')],'resourceId':_0x29ffc9['id'],'type':_0x203190[_0xb0fc('0x28')],'sectionId':_0x203190['id']},{})[_0xb0fc('0x21')](function(){return _0xdc723f;});}else{return _0xdc723f;}})[_0xb0fc('0x44')](function(_0x1b6fea){logger[_0xb0fc('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b6fea);});}return _0xdc723f;});})[_0xb0fc('0x21')](respondWithResult(_0x43a0df,0xc9))[_0xb0fc('0x44')](handleError(_0x43a0df,null));};exports[_0xb0fc('0x22')]=function(_0x5004f4,_0x1646fb,_0x159f4f){var _0x2b0f8e;return db['VoiceMusicOnHold'][_0xb0fc('0x47')]({'where':{'id':_0x5004f4[_0xb0fc('0x45')]['id']}})[_0xb0fc('0x21')](function(_0x3b3c09){if(_0x3b3c09){return db[_0xb0fc('0x4a')]['transaction'](function(_0x44ec6c){return _0x3b3c09[_0xb0fc('0x22')]({'transaction':_0x44ec6c,'raw':!![]})[_0xb0fc('0x21')](function(_0x1144e1){if(_0x1144e1['directory']){fs[_0xb0fc('0x57')](_0x1144e1['directory'])[_0xb0fc('0x58')](function(_0x5d5926){fs[_0xb0fc('0x59')](path['join'](_0x1144e1['directory'],_0x5d5926));});fs[_0xb0fc('0x5a')](_0x1144e1['directory']);}return _0x1144e1;});})[_0xb0fc('0x44')](function(_0x305d2a){throw new db[(_0xb0fc('0x5b'))][(_0xb0fc('0x5c'))](_0x305d2a['message']);});}})[_0xb0fc('0x21')](handleEntityNotFound(_0x1646fb,null))[_0xb0fc('0x21')](removeEntity(_0x1646fb,null))[_0xb0fc('0x44')](handleError(_0x1646fb,null));};exports[_0xb0fc('0x5d')]=function(_0x501404,_0x2a34fb,_0xb05519){return db[_0xb0fc('0x4a')][_0xb0fc('0x4b')](function(_0x55a45f){var _0x3c935b;return db[_0xb0fc('0x2a')][_0xb0fc('0x47')]({'where':{'id':_0x501404[_0xb0fc('0x45')]['id']}})[_0xb0fc('0x21')](function(_0x12a475){if(_0x12a475){_0x3c935b=_0x12a475;return _0x12a475[_0xb0fc('0x5d')](_0x501404[_0xb0fc('0x48')]['id'],{'transaction':_0x55a45f});}})[_0xb0fc('0x21')](function(_0x3acb9f){if(_0x3acb9f){return db[_0xb0fc('0x5e')][_0xb0fc('0x5f')]({'where':{'id':_0x501404[_0xb0fc('0x48')]['id']},'attributes':['id',_0xb0fc('0x28'),_0xb0fc('0x60'),_0xb0fc('0x61'),_0xb0fc('0x62')],'raw':!![]});}})[_0xb0fc('0x21')](function(_0x34a81d){if(_0x34a81d){var _0x24c88f=path[_0xb0fc('0x4e')](config['root'],'server/files/sounds/converted',util['format']('%s.%s',path[_0xb0fc('0x63')](_0x34a81d['save_name'],path['extname'](_0x34a81d[_0xb0fc('0x60')])),_0x34a81d['converted_format']));var _0x4d70fe=path[_0xb0fc('0x4e')](config[_0xb0fc('0x4f')],_0xb0fc('0x64'),_0x3c935b[_0xb0fc('0x28')],util['format']('%s.%s',_0x34a81d[_0xb0fc('0x28')],_0x34a81d[_0xb0fc('0x61')]));fs[_0xb0fc('0x65')](_0x24c88f,_0x4d70fe);return _0x34a81d;}})[_0xb0fc('0x44')](function(_0x2de86d){throw new db[(_0xb0fc('0x5b'))][(_0xb0fc('0x5c'))](_0x2de86d['message']);});})['then'](handleEntityNotFound(_0x2a34fb,null))[_0xb0fc('0x21')](respondWithResult(_0x2a34fb,0xc9))['catch'](handleError(_0x2a34fb,null));};exports['removeSound']=function(_0x5f00b7,_0x3bfc34,_0x590d7a){return db['sequelize'][_0xb0fc('0x4b')](function(_0xfe6f1e){var _0x443b27;return db[_0xb0fc('0x2a')][_0xb0fc('0x5f')]({'where':{'id':_0x5f00b7[_0xb0fc('0x45')]['id']}})[_0xb0fc('0x21')](handleEntityNotFound(_0x3bfc34,null))[_0xb0fc('0x21')](function(_0x52e3af){if(_0x52e3af){_0x443b27=_0x52e3af;return _0x52e3af[_0xb0fc('0x66')](_0x5f00b7[_0xb0fc('0x45')][_0xb0fc('0x67')]);}})[_0xb0fc('0x21')](function(_0x4c5ede){if(_0x4c5ede){return db[_0xb0fc('0x5e')][_0xb0fc('0x5f')]({'where':{'id':_0x5f00b7[_0xb0fc('0x45')][_0xb0fc('0x67')]},'attributes':['id','name',_0xb0fc('0x60'),'converted_format',_0xb0fc('0x62')],'raw':!![]});}})[_0xb0fc('0x21')](function(_0x183a07){if(_0x183a07){fs[_0xb0fc('0x59')](path[_0xb0fc('0x4e')](_0x443b27[_0xb0fc('0x68')],util[_0xb0fc('0x69')](_0xb0fc('0x6a'),_0x183a07['name'],_0x183a07[_0xb0fc('0x61')])));return _0x183a07;}})['catch'](function(_0x4f3081){throw new db[(_0xb0fc('0x5b'))][(_0xb0fc('0x5c'))](_0x4f3081[_0xb0fc('0x6b')]);});})[_0xb0fc('0x21')](handleEntityNotFound(_0x3bfc34,null))[_0xb0fc('0x21')](respondWithStatusCode(_0x3bfc34,0xcc))[_0xb0fc('0x44')](handleError(_0x3bfc34,null));};exports[_0xb0fc('0x6c')]=function(_0x134ca0,_0x26e014,_0x2c803e){var _0x38b088={};var _0x2171a9={};var _0x387dac;var _0x171ffc;return db[_0xb0fc('0x2a')][_0xb0fc('0x5f')]({'where':{'id':_0x134ca0['params']['id']}})['then'](handleEntityNotFound(_0x26e014,null))[_0xb0fc('0x21')](function(_0x3be24f){if(_0x3be24f){_0x387dac=_0x3be24f;_0x2171a9[_0xb0fc('0x2f')]=_['keys'](db[_0xb0fc('0x5e')][_0xb0fc('0x2b')]);_0x2171a9[_0xb0fc('0x31')]=_[_0xb0fc('0x32')](_0x134ca0[_0xb0fc('0x31')]);_0x2171a9[_0xb0fc('0x33')]=_[_0xb0fc('0x34')](_0x2171a9['model'],_0x2171a9[_0xb0fc('0x31')]);_0x38b088[_0xb0fc('0x36')]=_[_0xb0fc('0x34')](_0x2171a9[_0xb0fc('0x2f')],qs[_0xb0fc('0x35')](_0x134ca0['query'][_0xb0fc('0x35')]));_0x38b088[_0xb0fc('0x36')]=_0x38b088[_0xb0fc('0x36')][_0xb0fc('0x37')]?_0x38b088[_0xb0fc('0x36')]:_0x2171a9[_0xb0fc('0x2f')];_0x38b088[_0xb0fc('0x6d')]=qs['sort'](_0x134ca0['query'][_0xb0fc('0x3a')]);_0x38b088[_0xb0fc('0x3b')]=qs[_0xb0fc('0x33')](_[_0xb0fc('0x3c')](_0x134ca0[_0xb0fc('0x31')],_0x2171a9[_0xb0fc('0x33')]));if(_0x134ca0[_0xb0fc('0x31')][_0xb0fc('0x3d')]){_0x38b088[_0xb0fc('0x3b')]=_[_0xb0fc('0x3f')](_0x38b088[_0xb0fc('0x3b')],{'$or':_[_0xb0fc('0x30')](_0x38b088[_0xb0fc('0x36')],function(_0x546a2e){var _0x4f653d={};_0x4f653d[_0x546a2e]={'$like':'%'+_0x134ca0[_0xb0fc('0x31')][_0xb0fc('0x3d')]+'%'};return _0x4f653d;})});}_0x38b088=_[_0xb0fc('0x3f')]({},_0x38b088,_0x134ca0[_0xb0fc('0x40')]);return _0x387dac[_0xb0fc('0x6c')](_0x38b088);}})['then'](function(_0x5d92ca){if(_0x5d92ca){_0x171ffc=_0x5d92ca['length'];if(!_0x134ca0[_0xb0fc('0x31')][_0xb0fc('0x38')](_0xb0fc('0x39'))){_0x38b088[_0xb0fc('0x1c')]=qs[_0xb0fc('0x1c')](_0x134ca0[_0xb0fc('0x31')]['limit']);_0x38b088[_0xb0fc('0x19')]=qs[_0xb0fc('0x19')](_0x134ca0[_0xb0fc('0x31')][_0xb0fc('0x19')]);}return _0x387dac[_0xb0fc('0x6c')](_0x38b088);}})['then'](function(_0x14c7a5){if(_0x14c7a5){return _0x14c7a5?{'count':_0x171ffc,'rows':_0x14c7a5}:null;}})['then'](respondWithResult(_0x26e014,null))[_0xb0fc('0x44')](handleError(_0x26e014,null));}; \ No newline at end of file +var _0xc5a0=['rmdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','createdAt','server/files/sounds/converted','%s.%s','extname','converted_format','format','removeSound','id2','Sound','getSounds','rimraf','zip-dir','fast-json-patch','bluebird','sox','to-csv','ejs','fs-extra','squel','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','MusicOnHolds','destroy','end','error','stack','name','VoiceMusicOnHold','rawAttributes','fieldName','key','map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','includeAll','include','find','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5a0,0x79));var _0x0c5a=function(_0x1266f9,_0x40f076){_0x1266f9=_0x1266f9-0x0;var _0x56ced3=_0xc5a0[_0x1266f9];return _0x56ced3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c5a('0x0'));var zipdir=require(_0x0c5a('0x1'));var jsonpatch=require(_0x0c5a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0c5a('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0c5a('0x4'));var csv=require(_0x0c5a('0x5'));var ejs=require(_0x0c5a('0x6'));var fs=require('fs');var fs_extra=require(_0x0c5a('0x7'));var _=require('lodash');var squel=require(_0x0c5a('0x8'));var crypto=require('crypto');var jsforce=require(_0x0c5a('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0c5a('0xa'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0c5a('0xb'));var hardwareService=require(_0x0c5a('0xc'));var logger=require(_0x0c5a('0xd'))(_0x0c5a('0xe'));var utils=require(_0x0c5a('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x0c5a('0x10'));var db=require(_0x0c5a('0x11'))['db'];function respondWithStatusCode(_0x3525cb,_0x10a111){_0x10a111=_0x10a111||0xcc;return function(_0xe567e2){if(_0xe567e2){return _0x3525cb[_0x0c5a('0x12')](_0x10a111);}return _0x3525cb['status'](_0x10a111)['end']();};}function respondWithResult(_0x3832d9,_0x142289){_0x142289=_0x142289||0xc8;return function(_0x404108){if(_0x404108){return _0x3832d9[_0x0c5a('0x13')](_0x142289)[_0x0c5a('0x14')](_0x404108);}};}function respondWithFilteredResult(_0x963205,_0x1dce53){return function(_0x39c666){if(_0x39c666){var _0xd98e77=typeof _0x1dce53[_0x0c5a('0x15')]==='undefined'&&typeof _0x1dce53[_0x0c5a('0x16')]===_0x0c5a('0x17');var _0x1579bd=_0x39c666['count'];var _0x305265=_0xd98e77?0x0:_0x1dce53[_0x0c5a('0x15')];var _0x461860=_0xd98e77?_0x39c666[_0x0c5a('0x18')]:_0x1dce53['offset']+_0x1dce53[_0x0c5a('0x16')];var _0x231c6a;if(_0x461860>=_0x1579bd){_0x461860=_0x1579bd;_0x231c6a=0xc8;}else{_0x231c6a=0xce;}_0x963205[_0x0c5a('0x13')](_0x231c6a);return _0x963205[_0x0c5a('0x19')](_0x0c5a('0x1a'),_0x305265+'-'+_0x461860+'/'+_0x1579bd)[_0x0c5a('0x14')](_0x39c666);}return null;};}function patchUpdates(_0x333467){return function(_0x4fdd1a){try{jsonpatch['apply'](_0x4fdd1a,_0x333467,!![]);}catch(_0x336315){return BPromise[_0x0c5a('0x1b')](_0x336315);}return _0x4fdd1a['save']();};}function saveUpdates(_0x54adcb,_0x43477b){return function(_0x1699f5){if(_0x1699f5){return _0x1699f5[_0x0c5a('0x1c')](_0x54adcb)[_0x0c5a('0x1d')](function(_0x22c567){return _0x22c567;});}return null;};}function removeEntity(_0x20ac18,_0x4965ab){return function(_0x5047cc){if(_0x5047cc){return _0x5047cc['destroy']()['then'](function(){var _0x192503=_0x5047cc['get']({'plain':!![]});var _0x5a76bd=_0x0c5a('0x1e');return db['UserProfileResource'][_0x0c5a('0x1f')]({'where':{'type':_0x5a76bd,'resourceId':_0x192503['id']}})[_0x0c5a('0x1d')](function(){return _0x5047cc;});})[_0x0c5a('0x1d')](function(){_0x20ac18['status'](0xcc)[_0x0c5a('0x20')]();});}};}function handleEntityNotFound(_0x54aa22,_0x1e39d5){return function(_0x4fb253){if(!_0x4fb253){_0x54aa22[_0x0c5a('0x12')](0x194);}return _0x4fb253;};}function handleError(_0x435df9,_0x3c8915){_0x3c8915=_0x3c8915||0x1f4;return function(_0x4fc70b){logger[_0x0c5a('0x21')](_0x4fc70b[_0x0c5a('0x22')]);if(_0x4fc70b[_0x0c5a('0x23')]){delete _0x4fc70b[_0x0c5a('0x23')];}_0x435df9['status'](_0x3c8915)['send'](_0x4fc70b);};}exports['index']=function(_0x31f026,_0x419d32){var _0x1bcf2b={},_0x32f473={},_0x3d5b20={'count':0x0,'rows':[]};var _0x5e2e5c=_['map'](db[_0x0c5a('0x24')][_0x0c5a('0x25')],function(_0x592388){return{'name':_0x592388[_0x0c5a('0x26')],'type':_0x592388['type'][_0x0c5a('0x27')]};});_0x32f473['model']=_[_0x0c5a('0x28')](_0x5e2e5c,'name');_0x32f473[_0x0c5a('0x29')]=_[_0x0c5a('0x2a')](_0x31f026[_0x0c5a('0x29')]);_0x32f473['filters']=_[_0x0c5a('0x2b')](_0x32f473['model'],_0x32f473[_0x0c5a('0x29')]);_0x1bcf2b[_0x0c5a('0x2c')]=_['intersection'](_0x32f473[_0x0c5a('0x2d')],qs[_0x0c5a('0x2e')](_0x31f026[_0x0c5a('0x29')]['fields']));_0x1bcf2b[_0x0c5a('0x2c')]=_0x1bcf2b[_0x0c5a('0x2c')][_0x0c5a('0x2f')]?_0x1bcf2b[_0x0c5a('0x2c')]:_0x32f473[_0x0c5a('0x2d')];if(!_0x31f026['query'][_0x0c5a('0x30')](_0x0c5a('0x31'))){_0x1bcf2b[_0x0c5a('0x16')]=qs[_0x0c5a('0x16')](_0x31f026[_0x0c5a('0x29')]['limit']);_0x1bcf2b[_0x0c5a('0x15')]=qs[_0x0c5a('0x15')](_0x31f026[_0x0c5a('0x29')]['offset']);}_0x1bcf2b[_0x0c5a('0x32')]=qs[_0x0c5a('0x33')](_0x31f026[_0x0c5a('0x29')][_0x0c5a('0x33')]);delete _0x31f026[_0x0c5a('0x29')][_0x0c5a('0x33')];_0x1bcf2b[_0x0c5a('0x34')]=qs[_0x0c5a('0x35')](_[_0x0c5a('0x36')](_0x31f026[_0x0c5a('0x29')],_0x32f473[_0x0c5a('0x35')]),_0x5e2e5c);if(_0x31f026['query'][_0x0c5a('0x37')]){_0x1bcf2b[_0x0c5a('0x34')]=_[_0x0c5a('0x38')](_0x1bcf2b[_0x0c5a('0x34')],{'$or':_[_0x0c5a('0x28')](_0x5e2e5c,function(_0xd202d3){if(_0xd202d3['type']!==_0x0c5a('0x39')){var _0x4b2af2={};_0x4b2af2[_0xd202d3[_0x0c5a('0x23')]]={'$like':'%'+_0x31f026[_0x0c5a('0x29')][_0x0c5a('0x37')]+'%'};return _0x4b2af2;}})});}_0x1bcf2b=_[_0x0c5a('0x38')]({},_0x1bcf2b,_0x31f026[_0x0c5a('0x3a')]);var _0x5ccd01={'where':_0x1bcf2b['where']};return db[_0x0c5a('0x24')][_0x0c5a('0x18')](_0x5ccd01)[_0x0c5a('0x1d')](function(_0x1cc153){_0x3d5b20[_0x0c5a('0x18')]=_0x1cc153;if(_0x31f026[_0x0c5a('0x29')]['includeAll']){_0x1bcf2b['include']=[{'all':!![]}];}return db[_0x0c5a('0x24')]['findAll'](_0x1bcf2b);})[_0x0c5a('0x1d')](function(_0xf51560){_0x3d5b20[_0x0c5a('0x3b')]=_0xf51560;return _0x3d5b20;})[_0x0c5a('0x1d')](respondWithFilteredResult(_0x419d32,_0x1bcf2b))[_0x0c5a('0x3c')](handleError(_0x419d32,null));};exports[_0x0c5a('0x3d')]=function(_0x488dd3,_0x848f88){var _0x54bbfd={'raw':![],'where':{'id':_0x488dd3[_0x0c5a('0x3e')]['id']}},_0x240e54={};_0x240e54[_0x0c5a('0x2d')]=_['keys'](db[_0x0c5a('0x24')][_0x0c5a('0x25')]);_0x240e54[_0x0c5a('0x29')]=_[_0x0c5a('0x2a')](_0x488dd3[_0x0c5a('0x29')]);_0x240e54['filters']=_['intersection'](_0x240e54[_0x0c5a('0x2d')],_0x240e54[_0x0c5a('0x29')]);_0x54bbfd['attributes']=_[_0x0c5a('0x2b')](_0x240e54['model'],qs[_0x0c5a('0x2e')](_0x488dd3['query'][_0x0c5a('0x2e')]));_0x54bbfd['attributes']=_0x54bbfd[_0x0c5a('0x2c')]['length']?_0x54bbfd[_0x0c5a('0x2c')]:_0x240e54[_0x0c5a('0x2d')];if(_0x488dd3[_0x0c5a('0x29')][_0x0c5a('0x3f')]){_0x54bbfd[_0x0c5a('0x40')]=[{'all':!![]}];}_0x54bbfd=_[_0x0c5a('0x38')]({},_0x54bbfd,_0x488dd3[_0x0c5a('0x3a')]);return db[_0x0c5a('0x24')][_0x0c5a('0x41')](_0x54bbfd)[_0x0c5a('0x1d')](handleEntityNotFound(_0x848f88,null))[_0x0c5a('0x1d')](respondWithResult(_0x848f88,null))[_0x0c5a('0x3c')](handleError(_0x848f88,null));};exports[_0x0c5a('0x1c')]=function(_0x235e92,_0x5d73ce){if(_0x235e92[_0x0c5a('0x42')]['id']){delete _0x235e92[_0x0c5a('0x42')]['id'];}return db['VoiceMusicOnHold'][_0x0c5a('0x41')]({'where':{'id':_0x235e92[_0x0c5a('0x3e')]['id']}})[_0x0c5a('0x1d')](handleEntityNotFound(_0x5d73ce,null))[_0x0c5a('0x1d')](saveUpdates(_0x235e92['body'],null))[_0x0c5a('0x1d')](respondWithResult(_0x5d73ce,null))[_0x0c5a('0x3c')](handleError(_0x5d73ce,null));};exports[_0x0c5a('0x43')]=function(_0x5892a2,_0x4c2706,_0x1f0093){return db[_0x0c5a('0x44')][_0x0c5a('0x45')](function(_0xc7807a){if(_0x5892a2[_0x0c5a('0x42')][_0x0c5a('0x46')]===_0x0c5a('0x47')){_0x5892a2['body'][_0x0c5a('0x48')]=path[_0x0c5a('0x49')](config[_0x0c5a('0x4a')],_0x0c5a('0x4b'),_0x5892a2['body'][_0x0c5a('0x23')]);}return db[_0x0c5a('0x24')][_0x0c5a('0x43')](_0x5892a2[_0x0c5a('0x42')],{'transaction':_0xc7807a})[_0x0c5a('0x1d')](function(_0x50b81d){if(_0x5892a2[_0x0c5a('0x42')][_0x0c5a('0x46')]==='files'){fs['mkdirSync'](_0x50b81d[_0x0c5a('0x48')],parseInt('0777',0x8));}var _0x62de22=_0x5892a2[_0x0c5a('0x4c')][_0x0c5a('0x4d')]({'plain':!![]});if(!_0x62de22)throw new Error(_0x0c5a('0x4e'));if(_0x62de22[_0x0c5a('0x4f')]===_0x0c5a('0x4c')){var _0x4a7e2a=_0x50b81d[_0x0c5a('0x4d')]({'plain':!![]});return db[_0x0c5a('0x50')][_0x0c5a('0x41')]({'where':{'name':_0x0c5a('0x1e'),'userProfileId':_0x62de22[_0x0c5a('0x51')]},'raw':!![]})[_0x0c5a('0x1d')](function(_0x434966){if(_0x434966&&_0x434966[_0x0c5a('0x52')]===0x0){return db[_0x0c5a('0x53')][_0x0c5a('0x43')]({'name':_0x4a7e2a[_0x0c5a('0x23')],'resourceId':_0x4a7e2a['id'],'type':_0x434966[_0x0c5a('0x23')],'sectionId':_0x434966['id']},{})[_0x0c5a('0x1d')](function(){return _0x50b81d;});}else{return _0x50b81d;}})[_0x0c5a('0x3c')](function(_0x45f67d){logger[_0x0c5a('0x21')](_0x0c5a('0x54'),_0x45f67d);});}return _0x50b81d;});})['then'](respondWithResult(_0x4c2706,0xc9))[_0x0c5a('0x3c')](handleError(_0x4c2706,null));};exports['destroy']=function(_0x3d6e7f,_0x265ff5,_0x3f5a95){var _0x17ea37;return db[_0x0c5a('0x24')][_0x0c5a('0x41')]({'where':{'id':_0x3d6e7f[_0x0c5a('0x3e')]['id']}})[_0x0c5a('0x1d')](function(_0x370cf4){if(_0x370cf4){return db[_0x0c5a('0x44')][_0x0c5a('0x45')](function(_0x14cfff){return _0x370cf4[_0x0c5a('0x1f')]({'transaction':_0x14cfff,'raw':!![]})['then'](function(_0xa4493a){if(_0xa4493a[_0x0c5a('0x48')]){fs[_0x0c5a('0x55')](_0xa4493a[_0x0c5a('0x48')])['forEach'](function(_0x183f44){fs[_0x0c5a('0x56')](path[_0x0c5a('0x49')](_0xa4493a['directory'],_0x183f44));});fs[_0x0c5a('0x57')](_0xa4493a[_0x0c5a('0x48')]);}return _0xa4493a;});})['catch'](function(_0x4342c9){throw new db[(_0x0c5a('0x58'))][(_0x0c5a('0x59'))](_0x4342c9[_0x0c5a('0x5a')]);});}})[_0x0c5a('0x1d')](handleEntityNotFound(_0x265ff5,null))[_0x0c5a('0x1d')](removeEntity(_0x265ff5,null))[_0x0c5a('0x3c')](handleError(_0x265ff5,null));};exports[_0x0c5a('0x5b')]=function(_0xb0f4e4,_0x14e353,_0x51807a){return db[_0x0c5a('0x44')][_0x0c5a('0x45')](function(_0x342ea3){var _0x4bcbe6;return db[_0x0c5a('0x24')][_0x0c5a('0x41')]({'where':{'id':_0xb0f4e4[_0x0c5a('0x3e')]['id']}})[_0x0c5a('0x1d')](function(_0x7428b1){if(_0x7428b1){_0x4bcbe6=_0x7428b1;return _0x7428b1[_0x0c5a('0x5b')](_0xb0f4e4[_0x0c5a('0x42')]['id'],{'transaction':_0x342ea3});}})['then'](function(_0x4aebe8){if(_0x4aebe8){return db['Sound'][_0x0c5a('0x5c')]({'where':{'id':_0xb0f4e4[_0x0c5a('0x42')]['id']},'attributes':['id',_0x0c5a('0x23'),_0x0c5a('0x5d'),'converted_format',_0x0c5a('0x5e')],'raw':!![]});}})['then'](function(_0x55375c){if(_0x55375c){var _0xdf314=path[_0x0c5a('0x49')](config[_0x0c5a('0x4a')],_0x0c5a('0x5f'),util['format'](_0x0c5a('0x60'),path['basename'](_0x55375c[_0x0c5a('0x5d')],path[_0x0c5a('0x61')](_0x55375c[_0x0c5a('0x5d')])),_0x55375c[_0x0c5a('0x62')]));var _0x15d8ca=path[_0x0c5a('0x49')](config[_0x0c5a('0x4a')],_0x0c5a('0x4b'),_0x4bcbe6[_0x0c5a('0x23')],util[_0x0c5a('0x63')](_0x0c5a('0x60'),_0x55375c[_0x0c5a('0x23')],_0x55375c[_0x0c5a('0x62')]));fs['symlinkSync'](_0xdf314,_0x15d8ca);return _0x55375c;}})['catch'](function(_0x40fcd9){throw new db[(_0x0c5a('0x58'))][(_0x0c5a('0x59'))](_0x40fcd9[_0x0c5a('0x5a')]);});})[_0x0c5a('0x1d')](handleEntityNotFound(_0x14e353,null))[_0x0c5a('0x1d')](respondWithResult(_0x14e353,0xc9))[_0x0c5a('0x3c')](handleError(_0x14e353,null));};exports[_0x0c5a('0x64')]=function(_0x3884de,_0x2eb1d4,_0x15205f){return db[_0x0c5a('0x44')]['transaction'](function(_0x20a572){var _0x5279f3;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x3884de['params']['id']}})[_0x0c5a('0x1d')](handleEntityNotFound(_0x2eb1d4,null))['then'](function(_0x4375e3){if(_0x4375e3){_0x5279f3=_0x4375e3;return _0x4375e3['removeSound'](_0x3884de[_0x0c5a('0x3e')][_0x0c5a('0x65')]);}})[_0x0c5a('0x1d')](function(_0x2969ca){if(_0x2969ca){return db[_0x0c5a('0x66')][_0x0c5a('0x5c')]({'where':{'id':_0x3884de[_0x0c5a('0x3e')][_0x0c5a('0x65')]},'attributes':['id',_0x0c5a('0x23'),_0x0c5a('0x5d'),_0x0c5a('0x62'),_0x0c5a('0x5e')],'raw':!![]});}})[_0x0c5a('0x1d')](function(_0x1dfdf7){if(_0x1dfdf7){fs['unlinkSync'](path[_0x0c5a('0x49')](_0x5279f3[_0x0c5a('0x48')],util['format'](_0x0c5a('0x60'),_0x1dfdf7[_0x0c5a('0x23')],_0x1dfdf7[_0x0c5a('0x62')])));return _0x1dfdf7;}})['catch'](function(_0x31851e){throw new db[(_0x0c5a('0x58'))][(_0x0c5a('0x59'))](_0x31851e['message']);});})['then'](handleEntityNotFound(_0x2eb1d4,null))[_0x0c5a('0x1d')](respondWithStatusCode(_0x2eb1d4,0xcc))[_0x0c5a('0x3c')](handleError(_0x2eb1d4,null));};exports['getSounds']=function(_0x1e89fa,_0x13ce61,_0x74c3c){var _0x278718={};var _0x5f0d34={};var _0x2f29ff;var _0x2dd47e;return db[_0x0c5a('0x24')]['findOne']({'where':{'id':_0x1e89fa['params']['id']}})['then'](handleEntityNotFound(_0x13ce61,null))[_0x0c5a('0x1d')](function(_0x562ab0){if(_0x562ab0){_0x2f29ff=_0x562ab0;_0x5f0d34[_0x0c5a('0x2d')]=_[_0x0c5a('0x2a')](db[_0x0c5a('0x66')]['rawAttributes']);_0x5f0d34['query']=_[_0x0c5a('0x2a')](_0x1e89fa['query']);_0x5f0d34[_0x0c5a('0x35')]=_[_0x0c5a('0x2b')](_0x5f0d34['model'],_0x5f0d34[_0x0c5a('0x29')]);_0x278718[_0x0c5a('0x2c')]=_['intersection'](_0x5f0d34['model'],qs[_0x0c5a('0x2e')](_0x1e89fa['query'][_0x0c5a('0x2e')]));_0x278718[_0x0c5a('0x2c')]=_0x278718[_0x0c5a('0x2c')][_0x0c5a('0x2f')]?_0x278718['attributes']:_0x5f0d34[_0x0c5a('0x2d')];_0x278718[_0x0c5a('0x32')]=qs[_0x0c5a('0x33')](_0x1e89fa[_0x0c5a('0x29')][_0x0c5a('0x33')]);_0x278718['where']=qs[_0x0c5a('0x35')](_['pick'](_0x1e89fa[_0x0c5a('0x29')],_0x5f0d34[_0x0c5a('0x35')]));if(_0x1e89fa[_0x0c5a('0x29')][_0x0c5a('0x37')]){_0x278718[_0x0c5a('0x34')]=_[_0x0c5a('0x38')](_0x278718[_0x0c5a('0x34')],{'$or':_['map'](_0x278718[_0x0c5a('0x2c')],function(_0x1926d7){var _0x223c61={};_0x223c61[_0x1926d7]={'$like':'%'+_0x1e89fa['query'][_0x0c5a('0x37')]+'%'};return _0x223c61;})});}_0x278718=_['merge']({},_0x278718,_0x1e89fa[_0x0c5a('0x3a')]);return _0x2f29ff['getSounds'](_0x278718);}})[_0x0c5a('0x1d')](function(_0x30966c){if(_0x30966c){_0x2dd47e=_0x30966c[_0x0c5a('0x2f')];if(!_0x1e89fa[_0x0c5a('0x29')][_0x0c5a('0x30')](_0x0c5a('0x31'))){_0x278718[_0x0c5a('0x16')]=qs[_0x0c5a('0x16')](_0x1e89fa[_0x0c5a('0x29')][_0x0c5a('0x16')]);_0x278718[_0x0c5a('0x15')]=qs[_0x0c5a('0x15')](_0x1e89fa[_0x0c5a('0x29')]['offset']);}return _0x2f29ff[_0x0c5a('0x67')](_0x278718);}})['then'](function(_0x43b7c1){if(_0x43b7c1){return _0x43b7c1?{'count':_0x2dd47e,'rows':_0x43b7c1}:null;}})[_0x0c5a('0x1d')](respondWithResult(_0x13ce61,null))['catch'](handleError(_0x13ce61,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 12f5cc3..57544ac 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 _0xc886=['voice_musiconhold','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','VoiceMusicOnHold'];(function(_0x51179f,_0x2d93f7){var _0x184c8d=function(_0x122038){while(--_0x122038){_0x51179f['push'](_0x51179f['shift']());}};_0x184c8d(++_0x2d93f7);}(_0xc886,0x135));var _0x6c88=function(_0x343801,_0x3e4437){_0x343801=_0x343801-0x0;var _0x3425b0=_0xc886[_0x343801];return _0x3425b0;};'use strict';var _=require(_0x6c88('0x0'));var util=require(_0x6c88('0x1'));var logger=require(_0x6c88('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6c88('0x3'));var rp=require(_0x6c88('0x4'));var fs=require('fs');var path=require(_0x6c88('0x5'));var rimraf=require(_0x6c88('0x6'));var config=require(_0x6c88('0x7'));var attributes=require(_0x6c88('0x8'));module['exports']=function(_0x1f882c,_0x135fa7){return _0x1f882c['define'](_0x6c88('0x9'),attributes,{'tableName':_0x6c88('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cd9=['VoiceMusicOnHold','voice_musiconhold','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x1be790,_0x112549){var _0x7668c8=function(_0x47a470){while(--_0x47a470){_0x1be790['push'](_0x1be790['shift']());}};_0x7668c8(++_0x112549);}(_0x4cd9,0x178));var _0x94cd=function(_0x54b9c6,_0x2c697e){_0x54b9c6=_0x54b9c6-0x0;var _0x251824=_0x4cd9[_0x54b9c6];return _0x251824;};'use strict';var _=require(_0x94cd('0x0'));var util=require(_0x94cd('0x1'));var logger=require('../../config/logger')(_0x94cd('0x2'));var moment=require(_0x94cd('0x3'));var BPromise=require(_0x94cd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94cd('0x5'));var rimraf=require(_0x94cd('0x6'));var config=require(_0x94cd('0x7'));var attributes=require(_0x94cd('0x8'));module['exports']=function(_0x4b5bc0,_0x57af3a){return _0x4b5bc0['define'](_0x94cd('0x9'),attributes,{'tableName':_0x94cd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 9f7ba8d..d1f476b 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 _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x273b4b,_0x4ce452){var _0x53eaae=function(_0x4ea919){while(--_0x4ea919){_0x273b4b['push'](_0x273b4b['shift']());}};_0x53eaae(++_0x4ce452);}(_0xe706,0xa3));var _0x6e70=function(_0x235f7f,_0x4cc112){_0x235f7f=_0x235f7f-0x0;var _0x3bf31e=_0xe706[_0x235f7f];return _0x3bf31e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xb5d6ab,_0x9f1c92){var _0x46ca88=function(_0x35d4ab){while(--_0x35d4ab){_0xb5d6ab['push'](_0xb5d6ab['shift']());}};_0x46ca88(++_0x9f1c92);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index ea310ce..a89e7b9 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 _0x58ef=['/:id','show','/:id/teams','getTeams','post','create','/:id/users','addAgents','put','update','delete','destroy','removeAgents','removeTeams','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x58ef,0x1ce));var _0xf58e=function(_0xc1de64,_0x904dbf){_0xc1de64=_0xc1de64-0x0;var _0x4b1137=_0x58ef[_0xc1de64];return _0x4b1137;};'use strict';var multer=require(_0xf58e('0x0'));var util=require('util');var path=require(_0xf58e('0x1'));var timeout=require(_0xf58e('0x2'));var express=require(_0xf58e('0x3'));var router=express[_0xf58e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf58e('0x5'));var interaction=require(_0xf58e('0x6'));var config=require(_0xf58e('0x7'));var controller=require(_0xf58e('0x8'));router[_0xf58e('0x9')]('/',auth[_0xf58e('0xa')](),controller[_0xf58e('0xb')]);router[_0xf58e('0x9')](_0xf58e('0xc'),auth['isAuthenticated'](),controller[_0xf58e('0xd')]);router['get'](_0xf58e('0xe'),auth[_0xf58e('0xa')](),controller[_0xf58e('0xf')]);router[_0xf58e('0x9')]('/:id/users',auth[_0xf58e('0xa')](),controller['getAgents']);router[_0xf58e('0x9')](_0xf58e('0x10'),auth['isAuthenticated'](),controller[_0xf58e('0x11')]);router[_0xf58e('0x12')]('/',auth[_0xf58e('0xa')](),controller[_0xf58e('0x13')]);router[_0xf58e('0x12')](_0xf58e('0x14'),auth[_0xf58e('0xa')](),controller[_0xf58e('0x15')]);router['post'](_0xf58e('0x10'),auth[_0xf58e('0xa')](),controller['addTeams']);router[_0xf58e('0x16')](_0xf58e('0xe'),auth[_0xf58e('0xa')](),controller[_0xf58e('0x17')]);router[_0xf58e('0x18')](_0xf58e('0xe'),auth[_0xf58e('0xa')](),controller[_0xf58e('0x19')]);router[_0xf58e('0x18')](_0xf58e('0x14'),auth['isAuthenticated'](),controller[_0xf58e('0x1a')]);router[_0xf58e('0x18')](_0xf58e('0x10'),auth[_0xf58e('0xa')](),controller[_0xf58e('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xdb5c=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addTeams','update','destroy','removeAgents','delete','removeTeams','exports','multer','util','path'];(function(_0x388f95,_0x272730){var _0x127306=function(_0xa04847){while(--_0xa04847){_0x388f95['push'](_0x388f95['shift']());}};_0x127306(++_0x272730);}(_0xdb5c,0x169));var _0xcdb5=function(_0x45a63d,_0x33f5c7){_0x45a63d=_0x45a63d-0x0;var _0x67362b=_0xdb5c[_0x45a63d];return _0x67362b;};'use strict';var multer=require(_0xcdb5('0x0'));var util=require(_0xcdb5('0x1'));var path=require(_0xcdb5('0x2'));var timeout=require(_0xcdb5('0x3'));var express=require(_0xcdb5('0x4'));var router=express['Router']();var fs_extra=require(_0xcdb5('0x5'));var auth=require(_0xcdb5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcdb5('0x7'));var controller=require(_0xcdb5('0x8'));router[_0xcdb5('0x9')]('/',auth[_0xcdb5('0xa')](),controller[_0xcdb5('0xb')]);router[_0xcdb5('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xcdb5('0xc')]);router[_0xcdb5('0x9')](_0xcdb5('0xd'),auth[_0xcdb5('0xa')](),controller[_0xcdb5('0xe')]);router['get'](_0xcdb5('0xf'),auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x10')]);router['get'](_0xcdb5('0x11'),auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x12')]);router[_0xcdb5('0x13')]('/',auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x14')]);router[_0xcdb5('0x13')](_0xcdb5('0xf'),auth[_0xcdb5('0xa')](),controller['addAgents']);router[_0xcdb5('0x13')](_0xcdb5('0x11'),auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x15')]);router['put'](_0xcdb5('0xd'),auth['isAuthenticated'](),controller[_0xcdb5('0x16')]);router['delete'](_0xcdb5('0xd'),auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x17')]);router['delete']('/:id/users',auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x18')]);router[_0xcdb5('0x19')](_0xcdb5('0x11'),auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x1a')]);module[_0xcdb5('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 15cfabd..db4ff1c 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 _0x11ae=['exports','STRING','name','system-','INTEGER'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0x11ae,0x113));var _0xe11a=function(_0x3e786a,_0x7490ff){_0x3e786a=_0x3e786a-0x0;var _0x3a9454=_0x11ae[_0x3e786a];return _0x3a9454;};'use strict';var Sequelize=require('sequelize');module[_0xe11a('0x0')]={'name':{'type':Sequelize[_0xe11a('0x1')],'allowNull':![],'unique':_0xe11a('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x4914f9){return _0xe11a('0x3')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize[_0xe11a('0x1')]},'callerIdAll':{'type':Sequelize[_0xe11a('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xe11a('0x4')]}}; \ No newline at end of file +var _0x2d28=['exports','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x2d28,0x78));var _0x82d2=function(_0x13cd20,_0x1d9211){_0x13cd20=_0x13cd20-0x0;var _0x22b6de=_0x2d28[_0x13cd20];return _0x22b6de;};'use strict';var Sequelize=require('sequelize');module[_0x82d2('0x0')]={'name':{'type':Sequelize[_0x82d2('0x1')],'allowNull':![],'unique':_0x82d2('0x2')},'prefix':{'type':Sequelize[_0x82d2('0x3')],'get':function(_0x449de0){return _0x82d2('0x4')+this[_0x82d2('0x5')](_0x82d2('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 4975184..489ad1d 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 _0xb10b=['redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','pick','filter','where','type','VIRTUAL','merge','options','catch','show','params','fields','includeAll','find','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','prefix','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','transaction','addAgents','omit','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','order','getTeams','Team','nolimit','addTeams','User','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb10b,0x12a));var _0xbb10=function(_0x1202a2,_0x2912d9){_0x1202a2=_0x1202a2-0x0;var _0x3a8ac6=_0xb10b[_0x1202a2];return _0x3a8ac6;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config['redis']));require(_0xbb10('0x1c'))[_0xbb10('0x1d')](socket);function respondWithStatusCode(_0x45b9d6,_0x17fd46){_0x17fd46=_0x17fd46||0xcc;return function(_0x3df17b){if(_0x3df17b){return _0x45b9d6[_0xbb10('0x1e')](_0x17fd46);}return _0x45b9d6[_0xbb10('0x1f')](_0x17fd46)[_0xbb10('0x20')]();};}function respondWithResult(_0x3e26f4,_0x2b184e){_0x2b184e=_0x2b184e||0xc8;return function(_0x4a2bfc){if(_0x4a2bfc){return _0x3e26f4[_0xbb10('0x1f')](_0x2b184e)[_0xbb10('0x21')](_0x4a2bfc);}};}function respondWithFilteredResult(_0x133ac2,_0x42db98){return function(_0x378da8){if(_0x378da8){var _0x1682a4=typeof _0x42db98[_0xbb10('0x22')]===_0xbb10('0x23')&&typeof _0x42db98[_0xbb10('0x24')]===_0xbb10('0x23');var _0x48b6e9=_0x378da8[_0xbb10('0x25')];var _0x19f48d=_0x1682a4?0x0:_0x42db98[_0xbb10('0x22')];var _0x109908=_0x1682a4?_0x378da8[_0xbb10('0x25')]:_0x42db98[_0xbb10('0x22')]+_0x42db98['limit'];var _0x12f888;if(_0x109908>=_0x48b6e9){_0x109908=_0x48b6e9;_0x12f888=0xc8;}else{_0x12f888=0xce;}_0x133ac2[_0xbb10('0x1f')](_0x12f888);return _0x133ac2['set']('Content-Range',_0x19f48d+'-'+_0x109908+'/'+_0x48b6e9)[_0xbb10('0x21')](_0x378da8);}return null;};}function patchUpdates(_0x311abe){return function(_0x2e911d){try{jsonpatch[_0xbb10('0x26')](_0x2e911d,_0x311abe,!![]);}catch(_0x445761){return BPromise[_0xbb10('0x27')](_0x445761);}return _0x2e911d[_0xbb10('0x28')]();};}function saveUpdates(_0x436104,_0x7f2377){return function(_0x395404){if(_0x395404){return _0x395404[_0xbb10('0x29')](_0x436104)[_0xbb10('0x2a')](function(_0x537898){return _0x537898;});}return null;};}function removeEntity(_0x4fedac,_0x4fb5e0){return function(_0xc93a04){if(_0xc93a04){return _0xc93a04[_0xbb10('0x2b')]()[_0xbb10('0x2a')](function(){var _0x4e25ff=_0xc93a04[_0xbb10('0x2c')]({'plain':!![]});var _0x24d586=_0xbb10('0x2d');return db[_0xbb10('0x2e')][_0xbb10('0x2b')]({'where':{'type':_0x24d586,'resourceId':_0x4e25ff['id']}})[_0xbb10('0x2a')](function(){return _0xc93a04;});})[_0xbb10('0x2a')](function(){_0x4fedac['status'](0xcc)[_0xbb10('0x20')]();});}};}function handleEntityNotFound(_0x21ac54,_0xfc3595){return function(_0x2e0249){if(!_0x2e0249){_0x21ac54[_0xbb10('0x1e')](0x194);}return _0x2e0249;};}function handleError(_0x2ff4c1,_0x5d5c80){_0x5d5c80=_0x5d5c80||0x1f4;return function(_0x221624){logger['error'](_0x221624[_0xbb10('0x2f')]);if(_0x221624['name']){delete _0x221624[_0xbb10('0x30')];}_0x2ff4c1[_0xbb10('0x1f')](_0x5d5c80)[_0xbb10('0x31')](_0x221624);};}exports['index']=function(_0x518d47,_0x4c3744){var _0x34f65e={},_0x4f590d={},_0x359ad4={'count':0x0,'rows':[]};var _0x37dde7=_[_0xbb10('0x32')](db[_0xbb10('0x33')][_0xbb10('0x34')],function(_0x138bc6){return{'name':_0x138bc6[_0xbb10('0x35')],'type':_0x138bc6['type'][_0xbb10('0x36')]};});_0x4f590d[_0xbb10('0x37')]=_[_0xbb10('0x32')](_0x37dde7,_0xbb10('0x30'));_0x4f590d[_0xbb10('0x38')]=_[_0xbb10('0x39')](_0x518d47[_0xbb10('0x38')]);_0x4f590d[_0xbb10('0x3a')]=_[_0xbb10('0x3b')](_0x4f590d['model'],_0x4f590d[_0xbb10('0x38')]);_0x34f65e[_0xbb10('0x3c')]=_[_0xbb10('0x3b')](_0x4f590d[_0xbb10('0x37')],qs['fields'](_0x518d47[_0xbb10('0x38')]['fields']));_0x34f65e['attributes']=_0x34f65e[_0xbb10('0x3c')][_0xbb10('0x3d')]?_0x34f65e[_0xbb10('0x3c')]:_0x4f590d[_0xbb10('0x37')];if(!_0x518d47[_0xbb10('0x38')][_0xbb10('0x3e')]('nolimit')){_0x34f65e[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x518d47['query']['limit']);_0x34f65e['offset']=qs[_0xbb10('0x22')](_0x518d47[_0xbb10('0x38')][_0xbb10('0x22')]);}_0x34f65e['order']=qs[_0xbb10('0x3f')](_0x518d47[_0xbb10('0x38')][_0xbb10('0x3f')]);_0x34f65e['where']=qs[_0xbb10('0x3a')](_[_0xbb10('0x40')](_0x518d47[_0xbb10('0x38')],_0x4f590d[_0xbb10('0x3a')]),_0x37dde7);if(_0x518d47['query'][_0xbb10('0x41')]){_0x34f65e[_0xbb10('0x42')]=_['merge'](_0x34f65e[_0xbb10('0x42')],{'$or':_[_0xbb10('0x32')](_0x37dde7,function(_0x44d6ae){if(_0x44d6ae[_0xbb10('0x43')]!==_0xbb10('0x44')){var _0x185a52={};_0x185a52[_0x44d6ae['name']]={'$like':'%'+_0x518d47[_0xbb10('0x38')][_0xbb10('0x41')]+'%'};return _0x185a52;}})});}_0x34f65e=_[_0xbb10('0x45')]({},_0x34f65e,_0x518d47[_0xbb10('0x46')]);var _0x4943d9={'where':_0x34f65e[_0xbb10('0x42')]};return db[_0xbb10('0x33')][_0xbb10('0x25')](_0x4943d9)[_0xbb10('0x2a')](function(_0x5e2cfa){_0x359ad4[_0xbb10('0x25')]=_0x5e2cfa;if(_0x518d47[_0xbb10('0x38')]['includeAll']){_0x34f65e['include']=[{'all':!![]}];}return db[_0xbb10('0x33')]['findAll'](_0x34f65e);})[_0xbb10('0x2a')](function(_0x180933){_0x359ad4['rows']=_0x180933;return _0x359ad4;})[_0xbb10('0x2a')](respondWithFilteredResult(_0x4c3744,_0x34f65e))[_0xbb10('0x47')](handleError(_0x4c3744,null));};exports[_0xbb10('0x48')]=function(_0x5cf4f8,_0x2dd02b){var _0xebd70c={'raw':![],'where':{'id':_0x5cf4f8[_0xbb10('0x49')]['id']}},_0x3b9fdf={};_0x3b9fdf[_0xbb10('0x37')]=_[_0xbb10('0x39')](db[_0xbb10('0x33')][_0xbb10('0x34')]);_0x3b9fdf[_0xbb10('0x38')]=_[_0xbb10('0x39')](_0x5cf4f8[_0xbb10('0x38')]);_0x3b9fdf[_0xbb10('0x3a')]=_['intersection'](_0x3b9fdf[_0xbb10('0x37')],_0x3b9fdf[_0xbb10('0x38')]);_0xebd70c['attributes']=_[_0xbb10('0x3b')](_0x3b9fdf[_0xbb10('0x37')],qs[_0xbb10('0x4a')](_0x5cf4f8[_0xbb10('0x38')][_0xbb10('0x4a')]));_0xebd70c[_0xbb10('0x3c')]=_0xebd70c[_0xbb10('0x3c')]['length']?_0xebd70c['attributes']:_0x3b9fdf[_0xbb10('0x37')];if(_0x5cf4f8[_0xbb10('0x38')][_0xbb10('0x4b')]){_0xebd70c['include']=[{'all':!![]}];}_0xebd70c=_['merge']({},_0xebd70c,_0x5cf4f8[_0xbb10('0x46')]);return db[_0xbb10('0x33')][_0xbb10('0x4c')](_0xebd70c)[_0xbb10('0x2a')](handleEntityNotFound(_0x2dd02b,null))[_0xbb10('0x2a')](respondWithResult(_0x2dd02b,null))[_0xbb10('0x47')](handleError(_0x2dd02b,null));};exports[_0xbb10('0x2b')]=function(_0x460788,_0x2626d8){return db[_0xbb10('0x33')]['find']({'where':{'id':_0x460788['params']['id']}})[_0xbb10('0x2a')](handleEntityNotFound(_0x2626d8,null))[_0xbb10('0x2a')](removeEntity(_0x2626d8,null))[_0xbb10('0x47')](handleError(_0x2626d8,null));};exports[_0xbb10('0x4d')]=function(_0x36aa7d,_0x440f9e){return db[_0xbb10('0x33')][_0xbb10('0x4d')]()[_0xbb10('0x2a')](respondWithResult(_0x440f9e,null))[_0xbb10('0x47')](handleError(_0x440f9e,null));};exports[_0xbb10('0x4e')]=function(_0x20e18a,_0x61e689){var _0x2e6fd9;return db[_0xbb10('0x4f')]['transaction'](function(_0x124052){return db['VoicePrefix'][_0xbb10('0x4e')](_0x20e18a[_0xbb10('0x50')],{'transaction':_0x124052})[_0xbb10('0x2a')](function(_0x3f27ce){_0x2e6fd9=_0x3f27ce[_0xbb10('0x2c')]({'plain':!![]});return db[_0xbb10('0x51')][_0xbb10('0x4c')]({'where':{'id':_0x2e6fd9[_0xbb10('0x52')]},'raw':!![]})[_0xbb10('0x2a')](function(_0x3d71e){return createVoicePrefixExtensions(_0x2e6fd9,_0x3d71e,_0x124052);});});})[_0xbb10('0x2a')](function(){var _0x1c2dce=_0x20e18a[_0xbb10('0x53')][_0xbb10('0x2c')]({'plain':!![]});if(!_0x1c2dce)throw new Error(_0xbb10('0x54'));if(_0x1c2dce['role']===_0xbb10('0x53')){var _0x466eb7=_0x2e6fd9;return db[_0xbb10('0x55')][_0xbb10('0x4c')]({'where':{'name':_0xbb10('0x2d'),'userProfileId':_0x1c2dce[_0xbb10('0x56')]},'raw':!![]})['then'](function(_0x120bda){if(_0x120bda&&_0x120bda[_0xbb10('0x57')]===0x0){return db[_0xbb10('0x2e')][_0xbb10('0x4e')]({'name':_0x466eb7[_0xbb10('0x30')],'resourceId':_0x466eb7['id'],'type':_0x120bda[_0xbb10('0x30')],'sectionId':_0x120bda['id']},{})[_0xbb10('0x2a')](function(){return _0x2e6fd9;});}else{return _0x2e6fd9;}})[_0xbb10('0x47')](function(_0x205e01){logger[_0xbb10('0x58')](_0xbb10('0x59'),_0x205e01);throw _0x205e01;});}return _0x2e6fd9;})[_0xbb10('0x2a')](respondWithResult(_0x61e689,null))[_0xbb10('0x47')](handleError(_0x61e689,null));};function Extension(_0x4e7fac,_0x4ea1a6,_0x16272d,_0x3e6338){this[_0xbb10('0x5a')]=_0xbb10('0x5b');this['exten']=_0x4e7fac;this['app']=_0x16272d;this[_0xbb10('0x43')]=_0xbb10('0x5c');this[_0xbb10('0x5d')]=_0xbb10('0x5e');this[_0xbb10('0x5f')]=_0x4ea1a6;this[_0xbb10('0x60')]=_0x3e6338;}function createVoicePrefixExtensions(_0x45c0dc,_0x4a5fb9,_0x117e84){return new BPromise(function(_0x216cff,_0x4917a5){var _0x5e03cb=new Extension(formatPrefixName(_0x45c0dc['prefix']),0x1,_0xbb10('0x61'),_0xbb10('0x62'));_0x5e03cb[_0xbb10('0x63')]=_0x45c0dc['id'];return db['VoiceExtension']['create'](_0x5e03cb,{'transaction':_0x117e84})['then'](function(_0x3ebc5f){var _0x249b33=_0x3ebc5f[_0xbb10('0x2c')]({'plain':!![]});var _0x4e9fbd=_[_0xbb10('0x32')](addVoicePrefixExtensions(_0x45c0dc,_0x4a5fb9),function(_0x13131c){_0x13131c['VoiceExtensionId']=_0x249b33['id'];_0x13131c['VoicePrefixId']=_0x45c0dc['id'];return _0x13131c;});return db[_0xbb10('0x51')][_0xbb10('0x64')](_0x4e9fbd,{'transaction':_0x117e84})[_0xbb10('0x2a')](function(_0x237246){if(!_0x237246){return _0x4917a5('Extensions\x20creation\x20failed');}else{return _0x216cff(_0x237246);}})[_0xbb10('0x47')](function(_0xec48ac){return _0x4917a5(_0xec48ac);});});;});};function addVoicePrefixExtensions(_0xa7179d,_0x5202d7){var _0x402a01=[];var _0x2f05bc=formatPrefixName(_0xa7179d[_0xbb10('0x65')]);_0x402a01['push'](new Extension(_0x2f05bc,0x2,_0xbb10('0x66'),_0xbb10('0x67')+_0xa7179d[_0xbb10('0x30')]));if(_0xa7179d[_0xbb10('0x68')]){_0x402a01['push'](new Extension(_0x2f05bc,0x3,_0xbb10('0x66'),_0xbb10('0x69')+_0xa7179d[_0xbb10('0x68')]));}else{_0x402a01[_0xbb10('0x6a')](new Extension(_0x2f05bc,0x3,'NoOp',_0xbb10('0x6b')));}_0x402a01[_0xbb10('0x6a')](new Extension(_0x2f05bc,0x4,_0xbb10('0x6c'),_0x5202d7[_0xbb10('0x5a')]+','+_0xbb10('0x6d')+(0x8+_0xa7179d[_0xbb10('0x30')][_0xbb10('0x3d')])+'}'+','+0x1));return _0x402a01;}function formatPrefixName(_0x4a30c5){var _0x4a13d7='_';for(var _0x5acd5e=0x0;_0x5acd5e<_0x4a30c5[_0xbb10('0x3d')];_0x5acd5e++){if(_0x4a30c5[_0xbb10('0x6e')](_0x5acd5e)=='-'){_0x4a13d7+=_0x4a30c5[_0xbb10('0x6e')](_0x5acd5e);}else{_0x4a13d7+='['+_0x4a30c5['charAt'](_0x5acd5e)+']';}}_0x4a13d7+='.';return _0x4a13d7;}exports['update']=function(_0x46f462,_0x1b11c0,_0xd9e743){var _0x3a9677=_0x46f462[_0xbb10('0x50')];_0x3a9677[_0xbb10('0x65')]='system-'+_0x3a9677[_0xbb10('0x30')]+'-';return db[_0xbb10('0x4f')][_0xbb10('0x6f')](function(_0x14f16b){return db[_0xbb10('0x33')]['update'](_0x3a9677,{'where':{'id':_0x3a9677['id']},'transaction':_0x14f16b})['then'](function(){return db['VoiceExtension'][_0xbb10('0x2b')]({'where':{'VoicePrefixId':_0x3a9677['id']},'transaction':_0x14f16b})[_0xbb10('0x2a')](function(){return db[_0xbb10('0x51')][_0xbb10('0x4c')]({'where':{'id':_0x3a9677[_0xbb10('0x52')]},'raw':!![]})[_0xbb10('0x2a')](function(_0x5d942d){return createVoicePrefixExtensions(_0x3a9677,_0x5d942d,_0x14f16b);});});});})[_0xbb10('0x2a')](function(){return db['VoicePrefix']['findById'](_0x3a9677['id']);})['then'](respondWithResult(_0x1b11c0,null))[_0xbb10('0x47')](handleError(_0x1b11c0,null));};exports[_0xbb10('0x70')]=function(_0x23b1d5,_0x108f99,_0x5ce94f){return db[_0xbb10('0x33')]['find']({'where':{'id':_0x23b1d5['params']['id']}})[_0xbb10('0x2a')](handleEntityNotFound(_0x108f99,null))[_0xbb10('0x2a')](function(_0x29529c){if(_0x29529c){return _0x29529c[_0xbb10('0x70')](_0x23b1d5[_0xbb10('0x50')]['ids'],_[_0xbb10('0x71')](_0x23b1d5[_0xbb10('0x50')],[_0xbb10('0x72'),'id'])||{})[_0xbb10('0x73')](function(_0x43cdb7){for(var _0x27f42f=0x0;_0x27f42f<_0x23b1d5[_0xbb10('0x50')]['ids'][_0xbb10('0x3d')];_0x27f42f+=0x1){socket[_0xbb10('0x74')](_0xbb10('0x75'),{'UserId':Number(_0x23b1d5[_0xbb10('0x50')][_0xbb10('0x72')][_0x27f42f]),'VoicePrefixId':Number(_0x23b1d5[_0xbb10('0x49')]['id'])});}return _0x43cdb7;});}})[_0xbb10('0x2a')](respondWithResult(_0x108f99,null))[_0xbb10('0x47')](handleError(_0x108f99,null));};exports['removeAgents']=function(_0x428146,_0x218690,_0x145baf){return db['VoicePrefix']['find']({'where':{'id':_0x428146['params']['id']}})[_0xbb10('0x2a')](handleEntityNotFound(_0x218690,null))['then'](function(_0x4e3d6a){if(_0x4e3d6a){return _0x4e3d6a[_0xbb10('0x76')](_0x428146[_0xbb10('0x38')][_0xbb10('0x72')])[_0xbb10('0x2a')](function(){if(_[_0xbb10('0x77')](_0x428146[_0xbb10('0x38')][_0xbb10('0x72')])){for(var _0x417304=0x0;_0x417304<_0x428146[_0xbb10('0x38')]['ids'][_0xbb10('0x3d')];_0x417304+=0x1){socket[_0xbb10('0x74')](_0xbb10('0x78'),{'UserId':Number(_0x428146[_0xbb10('0x38')]['ids'][_0x417304]),'VoicePrefixId':Number(_0x428146['params']['id'])});}}else{socket[_0xbb10('0x74')](_0xbb10('0x78'),{'UserId':Number(_0x428146[_0xbb10('0x38')][_0xbb10('0x72')]),'VoicePrefixId':Number(_0x428146['params']['id'])});}});}})[_0xbb10('0x2a')](respondWithStatusCode(_0x218690,null))[_0xbb10('0x47')](handleError(_0x218690,null));};exports[_0xbb10('0x79')]=function(_0xf7b3e1,_0x35c1e8,_0x517185){var _0x5f0691={};var _0x372636={};var _0x53c698;var _0x22c030;return db['VoicePrefix'][_0xbb10('0x7a')]({'where':{'id':_0xf7b3e1[_0xbb10('0x49')]['id']}})['then'](handleEntityNotFound(_0x35c1e8,null))['then'](function(_0x2f667f){if(_0x2f667f){_0x53c698=_0x2f667f;_0x372636[_0xbb10('0x37')]=_[_0xbb10('0x39')](db['User'][_0xbb10('0x34')]);_0x372636[_0xbb10('0x38')]=_[_0xbb10('0x39')](_0xf7b3e1[_0xbb10('0x38')]);_0x372636[_0xbb10('0x3a')]=_[_0xbb10('0x3b')](_0x372636[_0xbb10('0x37')],_0x372636[_0xbb10('0x38')]);_0x5f0691[_0xbb10('0x3c')]=_['intersection'](_0x372636[_0xbb10('0x37')],qs[_0xbb10('0x4a')](_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x4a')]));_0x5f0691[_0xbb10('0x3c')]=_0x5f0691[_0xbb10('0x3c')][_0xbb10('0x3d')]?_0x5f0691[_0xbb10('0x3c')]:_0x372636[_0xbb10('0x37')];_0x5f0691[_0xbb10('0x7b')]=qs[_0xbb10('0x3f')](_0xf7b3e1[_0xbb10('0x38')]['sort']);_0x5f0691['where']=qs[_0xbb10('0x3a')](_[_0xbb10('0x40')](_0xf7b3e1[_0xbb10('0x38')],_0x372636[_0xbb10('0x3a')]));if(_0xf7b3e1[_0xbb10('0x38')]['filter']){_0x5f0691[_0xbb10('0x42')]=_[_0xbb10('0x45')](_0x5f0691[_0xbb10('0x42')],{'$or':_[_0xbb10('0x32')](_0x5f0691[_0xbb10('0x3c')],function(_0x379d49){var _0x546db5={};_0x546db5[_0x379d49]={'$like':'%'+_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x41')]+'%'};return _0x546db5;})});}_0x5f0691=_['merge']({},_0x5f0691,_0xf7b3e1[_0xbb10('0x46')]);return _0x53c698['getAgents'](_0x5f0691);}})[_0xbb10('0x2a')](function(_0x28bd76){if(_0x28bd76){_0x22c030=_0x28bd76[_0xbb10('0x3d')];if(!_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x3e')]('nolimit')){_0x5f0691[_0xbb10('0x24')]=qs['limit'](_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x24')]);_0x5f0691['offset']=qs['offset'](_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x22')]);}return _0x53c698[_0xbb10('0x79')](_0x5f0691);}})[_0xbb10('0x2a')](function(_0x18d18d){if(_0x18d18d){return _0x18d18d?{'count':_0x22c030,'rows':_0x18d18d}:null;}})[_0xbb10('0x2a')](respondWithResult(_0x35c1e8,null))[_0xbb10('0x47')](handleError(_0x35c1e8,null));};exports[_0xbb10('0x7c')]=function(_0x252ab8,_0xbccd46,_0x2bf9dd){var _0x4c0b83={};var _0x2b9a50={};var _0x3eeceb;var _0x1b0a6c;return db[_0xbb10('0x33')][_0xbb10('0x7a')]({'where':{'id':_0x252ab8[_0xbb10('0x49')]['id']}})[_0xbb10('0x2a')](handleEntityNotFound(_0xbccd46,null))[_0xbb10('0x2a')](function(_0x3e6fe2){if(_0x3e6fe2){_0x3eeceb=_0x3e6fe2;_0x2b9a50[_0xbb10('0x37')]=_[_0xbb10('0x39')](db[_0xbb10('0x7d')]['rawAttributes']);_0x2b9a50[_0xbb10('0x38')]=_['keys'](_0x252ab8[_0xbb10('0x38')]);_0x2b9a50[_0xbb10('0x3a')]=_[_0xbb10('0x3b')](_0x2b9a50[_0xbb10('0x37')],_0x2b9a50[_0xbb10('0x38')]);_0x4c0b83['attributes']=_[_0xbb10('0x3b')](_0x2b9a50[_0xbb10('0x37')],qs[_0xbb10('0x4a')](_0x252ab8[_0xbb10('0x38')][_0xbb10('0x4a')]));_0x4c0b83[_0xbb10('0x3c')]=_0x4c0b83['attributes']['length']?_0x4c0b83[_0xbb10('0x3c')]:_0x2b9a50[_0xbb10('0x37')];_0x4c0b83[_0xbb10('0x7b')]=qs['sort'](_0x252ab8[_0xbb10('0x38')][_0xbb10('0x3f')]);_0x4c0b83['where']=qs[_0xbb10('0x3a')](_[_0xbb10('0x40')](_0x252ab8['query'],_0x2b9a50[_0xbb10('0x3a')]));if(_0x252ab8['query'][_0xbb10('0x41')]){_0x4c0b83[_0xbb10('0x42')]=_['merge'](_0x4c0b83[_0xbb10('0x42')],{'$or':_[_0xbb10('0x32')](_0x4c0b83['attributes'],function(_0x5dae56){var _0xea6bf2={};_0xea6bf2[_0x5dae56]={'$like':'%'+_0x252ab8[_0xbb10('0x38')][_0xbb10('0x41')]+'%'};return _0xea6bf2;})});}_0x4c0b83=_[_0xbb10('0x45')]({},_0x4c0b83,_0x252ab8[_0xbb10('0x46')]);return _0x3eeceb['getTeams'](_0x4c0b83);}})[_0xbb10('0x2a')](function(_0x9f2e0f){if(_0x9f2e0f){_0x1b0a6c=_0x9f2e0f[_0xbb10('0x3d')];if(!_0x252ab8['query'][_0xbb10('0x3e')](_0xbb10('0x7e'))){_0x4c0b83[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x252ab8[_0xbb10('0x38')][_0xbb10('0x24')]);_0x4c0b83[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0x252ab8[_0xbb10('0x38')]['offset']);}return _0x3eeceb['getTeams'](_0x4c0b83);}})[_0xbb10('0x2a')](function(_0xe7238b){if(_0xe7238b){return _0xe7238b?{'count':_0x1b0a6c,'rows':_0xe7238b}:null;}})[_0xbb10('0x2a')](respondWithResult(_0xbccd46,null))[_0xbb10('0x47')](handleError(_0xbccd46,null));};exports[_0xbb10('0x7f')]=function(_0x363b81,_0x1cccec,_0x1674f7){var _0x3ede66=_0x363b81[_0xbb10('0x50')][_0xbb10('0x72')];var _0x167734;return db[_0xbb10('0x7d')]['findAll']({'where':{'id':_0x3ede66},'attributes':['id'],'include':[{'model':db[_0xbb10('0x80')],'as':_0xbb10('0x81'),'attributes':['id',_0xbb10('0x30'),_0xbb10('0x82'),_0xbb10('0x83'),_0xbb10('0x84')],'raw':!![]}]})[_0xbb10('0x2a')](function(_0x1421e2){if(_0x1421e2){_0x167734=_0x1421e2;var _0x3c6c45=_[_0xbb10('0x85')](_0x1421e2,function(_0x2a1c53){var _0x57f4a3=_0x2a1c53[_0xbb10('0x2c')]({'plain':!![]});return _0x57f4a3['Agents'];});return db[_0xbb10('0x33')][_0xbb10('0x4c')]({'where':{'id':_0x363b81[_0xbb10('0x49')]['id']}})[_0xbb10('0x2a')](function(_0x2b6e27){return db[_0xbb10('0x4f')]['transaction'](function(_0x2d8a25){return _0x2b6e27['addTeams'](_0x3ede66,{'transaction':_0x2d8a25})[_0xbb10('0x2a')](function(){return BPromise[_0xbb10('0x86')](_0x167734,function(_0xda122){return db[_0xbb10('0x87')][_0xbb10('0x88')]({'TeamId':_0xda122['id'],'VoicePrefixId':_0x363b81[_0xbb10('0x49')]['id']},{'transaction':_0x2d8a25});});})[_0xbb10('0x2a')](function(){return BPromise[_0xbb10('0x86')](_0x3c6c45,function(_0x25c5b2){return db[_0xbb10('0x89')][_0xbb10('0x8a')]({'where':{'UserId':_0x25c5b2['id'],'VoicePrefixId':_0x363b81[_0xbb10('0x49')]['id']},'transaction':_0x2d8a25});});})['then'](function(){_0x3c6c45[_0xbb10('0x8b')](function(_0x516520){socket[_0xbb10('0x74')](_0xbb10('0x75'),{'UserId':_0x516520['id'],'VoicePrefixId':_0x2b6e27['id']});});});});});}})[_0xbb10('0x2a')](respondWithStatusCode(_0x1cccec,null))[_0xbb10('0x47')](handleError(_0x1cccec,null));};exports[_0xbb10('0x8c')]=function(_0x40271f,_0x185ec9,_0x5e9888){return db[_0xbb10('0x7d')]['findAll']({'where':{'id':_0x40271f['query'][_0xbb10('0x72')]},'attributes':['id'],'include':[{'model':db[_0xbb10('0x80')],'as':_0xbb10('0x81'),'attributes':['id'],'raw':!![]}]})[_0xbb10('0x2a')](handleEntityNotFound(_0x185ec9,null))[_0xbb10('0x2a')](function(_0x16b8c1){var _0x5d1077=_[_0xbb10('0x32')](_0x16b8c1,'id');var _0x2c25ab=[];var _0x39aa9e=[];var _0xb1b7c8=squel[_0xbb10('0x8d')]();_0xb1b7c8[_0xbb10('0x8e')]('tq.TeamId')[_0xbb10('0x8f')](_0xbb10('0x90'),'tq')[_0xbb10('0x91')](_0xbb10('0x92'),'ut',_0xbb10('0x93'))[_0xbb10('0x42')](_0xbb10('0x94'),_0x40271f['params']['id']);for(var _0x33a43e=0x0;_0x33a43e<_0x16b8c1['length'];_0x33a43e+=0x1){let _0x3afbcf=_0x16b8c1[_0x33a43e];for(var _0x4a6660=0x0;_0x4a6660<_0x3afbcf['Agents'][_0xbb10('0x3d')];_0x4a6660+=0x1){let _0x225064=_0x3afbcf[_0xbb10('0x81')][_0x4a6660];var _0x3b7552=_0xb1b7c8[_0xbb10('0x95')]();_0x3b7552['where'](_0xbb10('0x96'),_0x225064['id']);_0x39aa9e['push'](db['sequelize']['query'](_0x3b7552[_0xbb10('0x97')](),{'type':db[_0xbb10('0x4f')][_0xbb10('0x98')][_0xbb10('0x99')]})[_0xbb10('0x2a')](function(_0x5abedf){if(_0x5abedf[_0xbb10('0x3d')]===0x1){return _0x225064['id'];}else{var _0x42a2d7=_[_0xbb10('0x9a')](_[_0xbb10('0x32')](_0x5abedf,_0xbb10('0x9b')),function(_0x37ff15){return _[_0xbb10('0x9c')](_0x5d1077,_0x37ff15);});if(_0x42a2d7){return _0x225064['id'];}}}));}}return BPromise['all'](_0x39aa9e)['then'](function(_0x584a62){_0x2c25ab=_(_0x2c25ab)[_0xbb10('0x9d')](_0x584a62)[_0xbb10('0x9e')]()[_0xbb10('0x9f')]();return db[_0xbb10('0x33')][_0xbb10('0x4c')]({'where':{'id':_0x40271f[_0xbb10('0x49')]['id']}})[_0xbb10('0x2a')](function(_0x423628){return db[_0xbb10('0x4f')][_0xbb10('0x6f')](function(_0x4cc8d4){return _0x423628['removeTeams'](_0x40271f['query'][_0xbb10('0x72')],{'transaction':_0x4cc8d4})[_0xbb10('0x2a')](function(){if(!_[_0xbb10('0xa0')](_0x2c25ab)){return _0x423628['removeAgents'](_0x2c25ab,{'transaction':_0x4cc8d4});}})[_0xbb10('0x2a')](function(){_0x2c25ab[_0xbb10('0x8b')](function(_0x2c638d){socket[_0xbb10('0x74')](_0xbb10('0x78'),{'UserId':_0x2c638d,'VoicePrefixId':_0x423628['id']});});});});});});})[_0xbb10('0x2a')](respondWithStatusCode(_0x185ec9,null))['catch'](handleError(_0x185ec9,null));}; \ No newline at end of file +var _0xcf2f=['removeTeams','Team','User','select','field','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','send','VoicePrefix','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','find','describe','create','sequelize','transaction','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','description','appdata','prefix','Voice\x20Prefix','VoicePrefixId','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','VoiceExtension','findById','addAgents','omit','ids','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','order','getTeams','findOne','addTeams','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','forEach'];(function(_0x425138,_0x225538){var _0x3cdcf7=function(_0x51bf24){while(--_0x51bf24){_0x425138['push'](_0x425138['shift']());}};_0x3cdcf7(++_0x225538);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x524e28,_0x1992af){_0x524e28=_0x524e28-0x0;var _0x10ccdc=_0xcf2f[_0x524e28];return _0x10ccdc;};'use strict';var emlformat=require(_0xfcf2('0x0'));var rimraf=require(_0xfcf2('0x1'));var zipdir=require(_0xfcf2('0x2'));var jsonpatch=require(_0xfcf2('0x3'));var rp=require(_0xfcf2('0x4'));var moment=require('moment');var BPromise=require(_0xfcf2('0x5'));var Mustache=require(_0xfcf2('0x6'));var util=require(_0xfcf2('0x7'));var path=require(_0xfcf2('0x8'));var sox=require(_0xfcf2('0x9'));var csv=require(_0xfcf2('0xa'));var ejs=require(_0xfcf2('0xb'));var fs=require('fs');var fs_extra=require(_0xfcf2('0xc'));var _=require(_0xfcf2('0xd'));var squel=require(_0xfcf2('0xe'));var crypto=require(_0xfcf2('0xf'));var jsforce=require(_0xfcf2('0x10'));var deskjs=require(_0xfcf2('0x11'));var toCsv=require(_0xfcf2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfcf2('0x12'));var qs=require(_0xfcf2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfcf2('0x14'));var logger=require(_0xfcf2('0x15'))(_0xfcf2('0x16'));var utils=require(_0xfcf2('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfcf2('0x18'))['db'];config[_0xfcf2('0x19')]=_[_0xfcf2('0x1a')](config[_0xfcf2('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xfcf2('0x1b'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0xc87ff4,_0x5ef004){_0x5ef004=_0x5ef004||0xcc;return function(_0x3aa6c0){if(_0x3aa6c0){return _0xc87ff4[_0xfcf2('0x1c')](_0x5ef004);}return _0xc87ff4[_0xfcf2('0x1d')](_0x5ef004)[_0xfcf2('0x1e')]();};}function respondWithResult(_0x315b2f,_0x44320d){_0x44320d=_0x44320d||0xc8;return function(_0x1de1e5){if(_0x1de1e5){return _0x315b2f['status'](_0x44320d)[_0xfcf2('0x1f')](_0x1de1e5);}};}function respondWithFilteredResult(_0x213125,_0x2a1865){return function(_0x581d78){if(_0x581d78){var _0xd87472=typeof _0x2a1865[_0xfcf2('0x20')]===_0xfcf2('0x21')&&typeof _0x2a1865[_0xfcf2('0x22')]===_0xfcf2('0x21');var _0x53c406=_0x581d78[_0xfcf2('0x23')];var _0x11c34f=_0xd87472?0x0:_0x2a1865['offset'];var _0x9a1d9f=_0xd87472?_0x581d78[_0xfcf2('0x23')]:_0x2a1865[_0xfcf2('0x20')]+_0x2a1865[_0xfcf2('0x22')];var _0x51e0b7;if(_0x9a1d9f>=_0x53c406){_0x9a1d9f=_0x53c406;_0x51e0b7=0xc8;}else{_0x51e0b7=0xce;}_0x213125[_0xfcf2('0x1d')](_0x51e0b7);return _0x213125[_0xfcf2('0x24')](_0xfcf2('0x25'),_0x11c34f+'-'+_0x9a1d9f+'/'+_0x53c406)[_0xfcf2('0x1f')](_0x581d78);}return null;};}function patchUpdates(_0x5afab5){return function(_0x3790ed){try{jsonpatch[_0xfcf2('0x26')](_0x3790ed,_0x5afab5,!![]);}catch(_0x232f6f){return BPromise['reject'](_0x232f6f);}return _0x3790ed[_0xfcf2('0x27')]();};}function saveUpdates(_0x151aa8,_0x5ddea1){return function(_0x3c3774){if(_0x3c3774){return _0x3c3774[_0xfcf2('0x28')](_0x151aa8)['then'](function(_0x1e6f14){return _0x1e6f14;});}return null;};}function removeEntity(_0x26bfcc,_0x1f0f07){return function(_0x21ca98){if(_0x21ca98){return _0x21ca98['destroy']()[_0xfcf2('0x29')](function(){var _0x448222=_0x21ca98[_0xfcf2('0x2a')]({'plain':!![]});var _0x3779ee=_0xfcf2('0x2b');return db[_0xfcf2('0x2c')][_0xfcf2('0x2d')]({'where':{'type':_0x3779ee,'resourceId':_0x448222['id']}})[_0xfcf2('0x29')](function(){return _0x21ca98;});})[_0xfcf2('0x29')](function(){_0x26bfcc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x695f31,_0x878504){return function(_0x3308c3){if(!_0x3308c3){_0x695f31['sendStatus'](0x194);}return _0x3308c3;};}function handleError(_0x560898,_0x598832){_0x598832=_0x598832||0x1f4;return function(_0x3ce9f8){logger[_0xfcf2('0x2e')](_0x3ce9f8[_0xfcf2('0x2f')]);if(_0x3ce9f8[_0xfcf2('0x30')]){delete _0x3ce9f8[_0xfcf2('0x30')];}_0x560898[_0xfcf2('0x1d')](_0x598832)[_0xfcf2('0x31')](_0x3ce9f8);};}exports['index']=function(_0x4796c4,_0xfc3b86){var _0x1acbea={},_0x147ed2={},_0xd76c56={'count':0x0,'rows':[]};var _0x4913fc=_['map'](db[_0xfcf2('0x32')]['rawAttributes'],function(_0x1f5117){return{'name':_0x1f5117[_0xfcf2('0x33')],'type':_0x1f5117['type'][_0xfcf2('0x34')]};});_0x147ed2[_0xfcf2('0x35')]=_[_0xfcf2('0x36')](_0x4913fc,_0xfcf2('0x30'));_0x147ed2[_0xfcf2('0x37')]=_[_0xfcf2('0x38')](_0x4796c4[_0xfcf2('0x37')]);_0x147ed2['filters']=_[_0xfcf2('0x39')](_0x147ed2[_0xfcf2('0x35')],_0x147ed2['query']);_0x1acbea[_0xfcf2('0x3a')]=_[_0xfcf2('0x39')](_0x147ed2['model'],qs[_0xfcf2('0x3b')](_0x4796c4[_0xfcf2('0x37')]['fields']));_0x1acbea[_0xfcf2('0x3a')]=_0x1acbea[_0xfcf2('0x3a')][_0xfcf2('0x3c')]?_0x1acbea[_0xfcf2('0x3a')]:_0x147ed2['model'];if(!_0x4796c4[_0xfcf2('0x37')][_0xfcf2('0x3d')](_0xfcf2('0x3e'))){_0x1acbea[_0xfcf2('0x22')]=qs[_0xfcf2('0x22')](_0x4796c4['query'][_0xfcf2('0x22')]);_0x1acbea[_0xfcf2('0x20')]=qs[_0xfcf2('0x20')](_0x4796c4[_0xfcf2('0x37')][_0xfcf2('0x20')]);}_0x1acbea['order']=qs[_0xfcf2('0x3f')](_0x4796c4['query'][_0xfcf2('0x3f')]);_0x1acbea[_0xfcf2('0x40')]=qs[_0xfcf2('0x41')](_[_0xfcf2('0x42')](_0x4796c4[_0xfcf2('0x37')],_0x147ed2['filters']),_0x4913fc);if(_0x4796c4[_0xfcf2('0x37')][_0xfcf2('0x43')]){_0x1acbea[_0xfcf2('0x40')]=_['merge'](_0x1acbea[_0xfcf2('0x40')],{'$or':_[_0xfcf2('0x36')](_0x4913fc,function(_0x45fb6f){if(_0x45fb6f[_0xfcf2('0x44')]!==_0xfcf2('0x45')){var _0x1d4942={};_0x1d4942[_0x45fb6f['name']]={'$like':'%'+_0x4796c4['query']['filter']+'%'};return _0x1d4942;}})});}_0x1acbea=_[_0xfcf2('0x46')]({},_0x1acbea,_0x4796c4[_0xfcf2('0x47')]);var _0x24802d={'where':_0x1acbea['where']};return db['VoicePrefix']['count'](_0x24802d)[_0xfcf2('0x29')](function(_0xab0747){_0xd76c56[_0xfcf2('0x23')]=_0xab0747;if(_0x4796c4[_0xfcf2('0x37')][_0xfcf2('0x48')]){_0x1acbea[_0xfcf2('0x49')]=[{'all':!![]}];}return db[_0xfcf2('0x32')][_0xfcf2('0x4a')](_0x1acbea);})[_0xfcf2('0x29')](function(_0x467ecd){_0xd76c56[_0xfcf2('0x4b')]=_0x467ecd;return _0xd76c56;})['then'](respondWithFilteredResult(_0xfc3b86,_0x1acbea))['catch'](handleError(_0xfc3b86,null));};exports[_0xfcf2('0x4c')]=function(_0x1ecba0,_0x4752d0){var _0x34283b={'raw':![],'where':{'id':_0x1ecba0[_0xfcf2('0x4d')]['id']}},_0x3bdfd3={};_0x3bdfd3[_0xfcf2('0x35')]=_[_0xfcf2('0x38')](db[_0xfcf2('0x32')][_0xfcf2('0x4e')]);_0x3bdfd3[_0xfcf2('0x37')]=_[_0xfcf2('0x38')](_0x1ecba0[_0xfcf2('0x37')]);_0x3bdfd3[_0xfcf2('0x41')]=_[_0xfcf2('0x39')](_0x3bdfd3[_0xfcf2('0x35')],_0x3bdfd3[_0xfcf2('0x37')]);_0x34283b['attributes']=_[_0xfcf2('0x39')](_0x3bdfd3[_0xfcf2('0x35')],qs['fields'](_0x1ecba0[_0xfcf2('0x37')]['fields']));_0x34283b[_0xfcf2('0x3a')]=_0x34283b[_0xfcf2('0x3a')][_0xfcf2('0x3c')]?_0x34283b[_0xfcf2('0x3a')]:_0x3bdfd3['model'];if(_0x1ecba0['query']['includeAll']){_0x34283b[_0xfcf2('0x49')]=[{'all':!![]}];}_0x34283b=_[_0xfcf2('0x46')]({},_0x34283b,_0x1ecba0[_0xfcf2('0x47')]);return db[_0xfcf2('0x32')]['find'](_0x34283b)[_0xfcf2('0x29')](handleEntityNotFound(_0x4752d0,null))[_0xfcf2('0x29')](respondWithResult(_0x4752d0,null))[_0xfcf2('0x4f')](handleError(_0x4752d0,null));};exports['destroy']=function(_0x1e3668,_0x21c836){return db[_0xfcf2('0x32')][_0xfcf2('0x50')]({'where':{'id':_0x1e3668[_0xfcf2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x21c836,null))[_0xfcf2('0x29')](removeEntity(_0x21c836,null))[_0xfcf2('0x4f')](handleError(_0x21c836,null));};exports[_0xfcf2('0x51')]=function(_0x42acb9,_0x17592d){return db[_0xfcf2('0x32')]['describe']()['then'](respondWithResult(_0x17592d,null))['catch'](handleError(_0x17592d,null));};exports[_0xfcf2('0x52')]=function(_0x9ddcd4,_0x5ecbf2){var _0x53058a;return db[_0xfcf2('0x53')][_0xfcf2('0x54')](function(_0x137a47){return db['VoicePrefix'][_0xfcf2('0x52')](_0x9ddcd4[_0xfcf2('0x55')],{'transaction':_0x137a47})['then'](function(_0x5aaf01){_0x53058a=_0x5aaf01[_0xfcf2('0x2a')]({'plain':!![]});return db['VoiceExtension'][_0xfcf2('0x50')]({'where':{'id':_0x53058a[_0xfcf2('0x56')]},'raw':!![]})['then'](function(_0x236b97){return createVoicePrefixExtensions(_0x53058a,_0x236b97,_0x137a47);});});})['then'](function(){var _0x26acdc=_0x9ddcd4['user'][_0xfcf2('0x2a')]({'plain':!![]});if(!_0x26acdc)throw new Error(_0xfcf2('0x57'));if(_0x26acdc[_0xfcf2('0x58')]==='user'){var _0x235b06=_0x53058a;return db[_0xfcf2('0x59')][_0xfcf2('0x50')]({'where':{'name':_0xfcf2('0x2b'),'userProfileId':_0x26acdc[_0xfcf2('0x5a')]},'raw':!![]})[_0xfcf2('0x29')](function(_0x445b17){if(_0x445b17&&_0x445b17['autoAssociation']===0x0){return db[_0xfcf2('0x2c')][_0xfcf2('0x52')]({'name':_0x235b06['name'],'resourceId':_0x235b06['id'],'type':_0x445b17[_0xfcf2('0x30')],'sectionId':_0x445b17['id']},{})[_0xfcf2('0x29')](function(){return _0x53058a;});}else{return _0x53058a;}})[_0xfcf2('0x4f')](function(_0xe3d645){logger['error'](_0xfcf2('0x5b'),_0xe3d645);throw _0xe3d645;});}return _0x53058a;})['then'](respondWithResult(_0x5ecbf2,null))[_0xfcf2('0x4f')](handleError(_0x5ecbf2,null));};function Extension(_0x17d449,_0x2d0696,_0x2eb6bd,_0x101e85){this[_0xfcf2('0x5c')]=_0xfcf2('0x5d');this['exten']=_0x17d449;this[_0xfcf2('0x5e')]=_0x2eb6bd;this[_0xfcf2('0x44')]='system';this[_0xfcf2('0x5f')]='Voice\x20Prefix\x20Extension';this['priority']=_0x2d0696;this[_0xfcf2('0x60')]=_0x101e85;}function createVoicePrefixExtensions(_0x375d6f,_0x98be70,_0xfef0e9){return new BPromise(function(_0x2fc657,_0x545dd7){var _0x2579de=new Extension(formatPrefixName(_0x375d6f[_0xfcf2('0x61')]),0x1,'NoOp',_0xfcf2('0x62'));_0x2579de[_0xfcf2('0x63')]=_0x375d6f['id'];return db['VoiceExtension'][_0xfcf2('0x52')](_0x2579de,{'transaction':_0xfef0e9})[_0xfcf2('0x29')](function(_0x326144){var _0x9efe34=_0x326144[_0xfcf2('0x2a')]({'plain':!![]});var _0x302852=_[_0xfcf2('0x36')](addVoicePrefixExtensions(_0x375d6f,_0x98be70),function(_0x5c28de){_0x5c28de[_0xfcf2('0x56')]=_0x9efe34['id'];_0x5c28de[_0xfcf2('0x63')]=_0x375d6f['id'];return _0x5c28de;});return db['VoiceExtension']['bulkCreate'](_0x302852,{'transaction':_0xfef0e9})['then'](function(_0x25acf7){if(!_0x25acf7){return _0x545dd7('Extensions\x20creation\x20failed');}else{return _0x2fc657(_0x25acf7);}})[_0xfcf2('0x4f')](function(_0x535d40){return _0x545dd7(_0x535d40);});});;});};function addVoicePrefixExtensions(_0x388721,_0x2ca9a1){var _0x48f654=[];var _0x51891d=formatPrefixName(_0x388721[_0xfcf2('0x61')]);_0x48f654[_0xfcf2('0x64')](new Extension(_0x51891d,0x2,_0xfcf2('0x65'),_0xfcf2('0x66')+_0x388721['name']));if(_0x388721[_0xfcf2('0x67')]){_0x48f654[_0xfcf2('0x64')](new Extension(_0x51891d,0x3,_0xfcf2('0x65'),_0xfcf2('0x68')+_0x388721['callerIdAll']));}else{_0x48f654['push'](new Extension(_0x51891d,0x3,'NoOp','No\x20callerid\x20available'));}_0x48f654[_0xfcf2('0x64')](new Extension(_0x51891d,0x4,_0xfcf2('0x69'),_0x2ca9a1['context']+','+_0xfcf2('0x6a')+(0x8+_0x388721[_0xfcf2('0x30')]['length'])+'}'+','+0x1));return _0x48f654;}function formatPrefixName(_0x2844b4){var _0x4a648d='_';for(var _0x51e8bd=0x0;_0x51e8bd<_0x2844b4[_0xfcf2('0x3c')];_0x51e8bd++){if(_0x2844b4[_0xfcf2('0x6b')](_0x51e8bd)=='-'){_0x4a648d+=_0x2844b4[_0xfcf2('0x6b')](_0x51e8bd);}else{_0x4a648d+='['+_0x2844b4['charAt'](_0x51e8bd)+']';}}_0x4a648d+='.';return _0x4a648d;}exports[_0xfcf2('0x28')]=function(_0x3b6232,_0x4ec509,_0x57d354){var _0x57c2d6=_0x3b6232[_0xfcf2('0x55')];_0x57c2d6[_0xfcf2('0x61')]=_0xfcf2('0x6c')+_0x57c2d6['name']+'-';return db[_0xfcf2('0x53')][_0xfcf2('0x54')](function(_0x451050){return db[_0xfcf2('0x32')][_0xfcf2('0x28')](_0x57c2d6,{'where':{'id':_0x57c2d6['id']},'transaction':_0x451050})[_0xfcf2('0x29')](function(){return db[_0xfcf2('0x6d')]['destroy']({'where':{'VoicePrefixId':_0x57c2d6['id']},'transaction':_0x451050})['then'](function(){return db['VoiceExtension']['find']({'where':{'id':_0x57c2d6[_0xfcf2('0x56')]},'raw':!![]})[_0xfcf2('0x29')](function(_0x2a30be){return createVoicePrefixExtensions(_0x57c2d6,_0x2a30be,_0x451050);});});});})['then'](function(){return db[_0xfcf2('0x32')][_0xfcf2('0x6e')](_0x57c2d6['id']);})['then'](respondWithResult(_0x4ec509,null))[_0xfcf2('0x4f')](handleError(_0x4ec509,null));};exports[_0xfcf2('0x6f')]=function(_0x16d2cf,_0x174142,_0x171c90){return db[_0xfcf2('0x32')]['find']({'where':{'id':_0x16d2cf['params']['id']}})[_0xfcf2('0x29')](handleEntityNotFound(_0x174142,null))[_0xfcf2('0x29')](function(_0x22e07b){if(_0x22e07b){return _0x22e07b['addAgents'](_0x16d2cf['body']['ids'],_[_0xfcf2('0x70')](_0x16d2cf[_0xfcf2('0x55')],['ids','id'])||{})['spread'](function(_0xce5424){for(var _0x3e42c2=0x0;_0x3e42c2<_0x16d2cf['body'][_0xfcf2('0x71')][_0xfcf2('0x3c')];_0x3e42c2+=0x1){socket['emit'](_0xfcf2('0x72'),{'UserId':Number(_0x16d2cf[_0xfcf2('0x55')]['ids'][_0x3e42c2]),'VoicePrefixId':Number(_0x16d2cf['params']['id'])});}return _0xce5424;});}})[_0xfcf2('0x29')](respondWithResult(_0x174142,null))['catch'](handleError(_0x174142,null));};exports[_0xfcf2('0x73')]=function(_0x1d0a3b,_0x2ec0c5,_0x61a297){return db[_0xfcf2('0x32')][_0xfcf2('0x50')]({'where':{'id':_0x1d0a3b['params']['id']}})[_0xfcf2('0x29')](handleEntityNotFound(_0x2ec0c5,null))[_0xfcf2('0x29')](function(_0xf1ef46){if(_0xf1ef46){return _0xf1ef46[_0xfcf2('0x73')](_0x1d0a3b[_0xfcf2('0x37')][_0xfcf2('0x71')])['then'](function(){if(_[_0xfcf2('0x74')](_0x1d0a3b[_0xfcf2('0x37')][_0xfcf2('0x71')])){for(var _0x4266f2=0x0;_0x4266f2<_0x1d0a3b['query']['ids'][_0xfcf2('0x3c')];_0x4266f2+=0x1){socket[_0xfcf2('0x75')](_0xfcf2('0x76'),{'UserId':Number(_0x1d0a3b[_0xfcf2('0x37')]['ids'][_0x4266f2]),'VoicePrefixId':Number(_0x1d0a3b[_0xfcf2('0x4d')]['id'])});}}else{socket['emit'](_0xfcf2('0x76'),{'UserId':Number(_0x1d0a3b[_0xfcf2('0x37')][_0xfcf2('0x71')]),'VoicePrefixId':Number(_0x1d0a3b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2ec0c5,null))[_0xfcf2('0x4f')](handleError(_0x2ec0c5,null));};exports[_0xfcf2('0x77')]=function(_0x26f450,_0x485b9,_0x52cbcb){var _0x3f95a5={};var _0x4eacee={};var _0xa295d3;var _0x14da0f;return db[_0xfcf2('0x32')]['findOne']({'where':{'id':_0x26f450['params']['id']}})['then'](handleEntityNotFound(_0x485b9,null))['then'](function(_0x3b25cb){if(_0x3b25cb){_0xa295d3=_0x3b25cb;_0x4eacee[_0xfcf2('0x35')]=_['keys'](db['User'][_0xfcf2('0x4e')]);_0x4eacee[_0xfcf2('0x37')]=_['keys'](_0x26f450[_0xfcf2('0x37')]);_0x4eacee[_0xfcf2('0x41')]=_['intersection'](_0x4eacee[_0xfcf2('0x35')],_0x4eacee[_0xfcf2('0x37')]);_0x3f95a5[_0xfcf2('0x3a')]=_[_0xfcf2('0x39')](_0x4eacee[_0xfcf2('0x35')],qs[_0xfcf2('0x3b')](_0x26f450[_0xfcf2('0x37')][_0xfcf2('0x3b')]));_0x3f95a5[_0xfcf2('0x3a')]=_0x3f95a5[_0xfcf2('0x3a')][_0xfcf2('0x3c')]?_0x3f95a5[_0xfcf2('0x3a')]:_0x4eacee[_0xfcf2('0x35')];_0x3f95a5[_0xfcf2('0x78')]=qs['sort'](_0x26f450[_0xfcf2('0x37')][_0xfcf2('0x3f')]);_0x3f95a5[_0xfcf2('0x40')]=qs[_0xfcf2('0x41')](_[_0xfcf2('0x42')](_0x26f450[_0xfcf2('0x37')],_0x4eacee[_0xfcf2('0x41')]));if(_0x26f450[_0xfcf2('0x37')][_0xfcf2('0x43')]){_0x3f95a5[_0xfcf2('0x40')]=_[_0xfcf2('0x46')](_0x3f95a5[_0xfcf2('0x40')],{'$or':_[_0xfcf2('0x36')](_0x3f95a5['attributes'],function(_0x5e03f0){var _0x4f640c={};_0x4f640c[_0x5e03f0]={'$like':'%'+_0x26f450[_0xfcf2('0x37')][_0xfcf2('0x43')]+'%'};return _0x4f640c;})});}_0x3f95a5=_[_0xfcf2('0x46')]({},_0x3f95a5,_0x26f450[_0xfcf2('0x47')]);return _0xa295d3[_0xfcf2('0x77')](_0x3f95a5);}})[_0xfcf2('0x29')](function(_0x2f8e66){if(_0x2f8e66){_0x14da0f=_0x2f8e66[_0xfcf2('0x3c')];if(!_0x26f450[_0xfcf2('0x37')][_0xfcf2('0x3d')](_0xfcf2('0x3e'))){_0x3f95a5[_0xfcf2('0x22')]=qs['limit'](_0x26f450[_0xfcf2('0x37')][_0xfcf2('0x22')]);_0x3f95a5[_0xfcf2('0x20')]=qs[_0xfcf2('0x20')](_0x26f450[_0xfcf2('0x37')][_0xfcf2('0x20')]);}return _0xa295d3[_0xfcf2('0x77')](_0x3f95a5);}})['then'](function(_0x192d7b){if(_0x192d7b){return _0x192d7b?{'count':_0x14da0f,'rows':_0x192d7b}:null;}})[_0xfcf2('0x29')](respondWithResult(_0x485b9,null))[_0xfcf2('0x4f')](handleError(_0x485b9,null));};exports[_0xfcf2('0x79')]=function(_0x3664b0,_0x2ee51b,_0x6dba54){var _0x5137d1={};var _0x10caf3={};var _0x26432f;var _0x11701f;return db[_0xfcf2('0x32')][_0xfcf2('0x7a')]({'where':{'id':_0x3664b0[_0xfcf2('0x4d')]['id']}})[_0xfcf2('0x29')](handleEntityNotFound(_0x2ee51b,null))['then'](function(_0x1061a7){if(_0x1061a7){_0x26432f=_0x1061a7;_0x10caf3[_0xfcf2('0x35')]=_[_0xfcf2('0x38')](db['Team'][_0xfcf2('0x4e')]);_0x10caf3['query']=_[_0xfcf2('0x38')](_0x3664b0[_0xfcf2('0x37')]);_0x10caf3['filters']=_[_0xfcf2('0x39')](_0x10caf3[_0xfcf2('0x35')],_0x10caf3[_0xfcf2('0x37')]);_0x5137d1[_0xfcf2('0x3a')]=_[_0xfcf2('0x39')](_0x10caf3['model'],qs[_0xfcf2('0x3b')](_0x3664b0[_0xfcf2('0x37')]['fields']));_0x5137d1[_0xfcf2('0x3a')]=_0x5137d1[_0xfcf2('0x3a')][_0xfcf2('0x3c')]?_0x5137d1['attributes']:_0x10caf3['model'];_0x5137d1[_0xfcf2('0x78')]=qs[_0xfcf2('0x3f')](_0x3664b0[_0xfcf2('0x37')][_0xfcf2('0x3f')]);_0x5137d1[_0xfcf2('0x40')]=qs['filters'](_['pick'](_0x3664b0[_0xfcf2('0x37')],_0x10caf3[_0xfcf2('0x41')]));if(_0x3664b0[_0xfcf2('0x37')][_0xfcf2('0x43')]){_0x5137d1['where']=_[_0xfcf2('0x46')](_0x5137d1['where'],{'$or':_[_0xfcf2('0x36')](_0x5137d1['attributes'],function(_0x2bb04c){var _0x4ef12e={};_0x4ef12e[_0x2bb04c]={'$like':'%'+_0x3664b0[_0xfcf2('0x37')]['filter']+'%'};return _0x4ef12e;})});}_0x5137d1=_[_0xfcf2('0x46')]({},_0x5137d1,_0x3664b0[_0xfcf2('0x47')]);return _0x26432f['getTeams'](_0x5137d1);}})[_0xfcf2('0x29')](function(_0x18995d){if(_0x18995d){_0x11701f=_0x18995d[_0xfcf2('0x3c')];if(!_0x3664b0[_0xfcf2('0x37')][_0xfcf2('0x3d')]('nolimit')){_0x5137d1['limit']=qs['limit'](_0x3664b0[_0xfcf2('0x37')][_0xfcf2('0x22')]);_0x5137d1['offset']=qs[_0xfcf2('0x20')](_0x3664b0['query']['offset']);}return _0x26432f['getTeams'](_0x5137d1);}})[_0xfcf2('0x29')](function(_0x23e7f4){if(_0x23e7f4){return _0x23e7f4?{'count':_0x11701f,'rows':_0x23e7f4}:null;}})[_0xfcf2('0x29')](respondWithResult(_0x2ee51b,null))[_0xfcf2('0x4f')](handleError(_0x2ee51b,null));};exports[_0xfcf2('0x7b')]=function(_0x39e2a3,_0x2e68ea,_0x2d3c0d){var _0x2af260=_0x39e2a3[_0xfcf2('0x55')][_0xfcf2('0x71')];var _0x3c7e2d;return db['Team'][_0xfcf2('0x4a')]({'where':{'id':_0x2af260},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfcf2('0x7c'),'attributes':['id',_0xfcf2('0x30'),_0xfcf2('0x7d'),_0xfcf2('0x7e'),'interface'],'raw':!![]}]})['then'](function(_0x521851){if(_0x521851){_0x3c7e2d=_0x521851;var _0x456185=_[_0xfcf2('0x7f')](_0x521851,function(_0x487590){var _0x471b3c=_0x487590[_0xfcf2('0x2a')]({'plain':!![]});return _0x471b3c[_0xfcf2('0x7c')];});return db[_0xfcf2('0x32')]['find']({'where':{'id':_0x39e2a3['params']['id']}})[_0xfcf2('0x29')](function(_0x597cd9){return db[_0xfcf2('0x53')][_0xfcf2('0x54')](function(_0x3d3616){return _0x597cd9[_0xfcf2('0x7b')](_0x2af260,{'transaction':_0x3d3616})['then'](function(){return BPromise[_0xfcf2('0x80')](_0x3c7e2d,function(_0x3353d2){return db[_0xfcf2('0x81')]['upsert']({'TeamId':_0x3353d2['id'],'VoicePrefixId':_0x39e2a3[_0xfcf2('0x4d')]['id']},{'transaction':_0x3d3616});});})[_0xfcf2('0x29')](function(){return BPromise[_0xfcf2('0x80')](_0x456185,function(_0x5b6950){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0x5b6950['id'],'VoicePrefixId':_0x39e2a3[_0xfcf2('0x4d')]['id']},'transaction':_0x3d3616});});})[_0xfcf2('0x29')](function(){_0x456185[_0xfcf2('0x82')](function(_0x50be02){socket[_0xfcf2('0x75')]('userVoicePrefix:save',{'UserId':_0x50be02['id'],'VoicePrefixId':_0x597cd9['id']});});});});});}})[_0xfcf2('0x29')](respondWithStatusCode(_0x2e68ea,null))['catch'](handleError(_0x2e68ea,null));};exports[_0xfcf2('0x83')]=function(_0x20889c,_0x4f166b,_0x1e954f){return db[_0xfcf2('0x84')][_0xfcf2('0x4a')]({'where':{'id':_0x20889c[_0xfcf2('0x37')][_0xfcf2('0x71')]},'attributes':['id'],'include':[{'model':db[_0xfcf2('0x85')],'as':_0xfcf2('0x7c'),'attributes':['id'],'raw':!![]}]})[_0xfcf2('0x29')](handleEntityNotFound(_0x4f166b,null))['then'](function(_0x140aa4){var _0x402cb0=_[_0xfcf2('0x36')](_0x140aa4,'id');var _0x1dd3ce=[];var _0xfff48e=[];var _0x10a120=squel[_0xfcf2('0x86')]();_0x10a120[_0xfcf2('0x87')]('tq.TeamId')['from'](_0xfcf2('0x88'),'tq')['join'](_0xfcf2('0x89'),'ut',_0xfcf2('0x8a'))[_0xfcf2('0x40')]('VoicePrefixId\x20=\x20?',_0x20889c[_0xfcf2('0x4d')]['id']);for(var _0xd3cd6f=0x0;_0xd3cd6f<_0x140aa4['length'];_0xd3cd6f+=0x1){let _0x3291ac=_0x140aa4[_0xd3cd6f];for(var _0x469a9b=0x0;_0x469a9b<_0x3291ac[_0xfcf2('0x7c')][_0xfcf2('0x3c')];_0x469a9b+=0x1){let _0x4cdbd4=_0x3291ac[_0xfcf2('0x7c')][_0x469a9b];var _0x32a6e8=_0x10a120['clone']();_0x32a6e8[_0xfcf2('0x40')](_0xfcf2('0x8b'),_0x4cdbd4['id']);_0xfff48e[_0xfcf2('0x64')](db['sequelize']['query'](_0x32a6e8[_0xfcf2('0x8c')](),{'type':db['sequelize']['QueryTypes'][_0xfcf2('0x8d')]})[_0xfcf2('0x29')](function(_0x2e5d14){if(_0x2e5d14[_0xfcf2('0x3c')]===0x1){return _0x4cdbd4['id'];}else{var _0x306809=_[_0xfcf2('0x8e')](_[_0xfcf2('0x36')](_0x2e5d14,_0xfcf2('0x8f')),function(_0x7e30bd){return _[_0xfcf2('0x90')](_0x402cb0,_0x7e30bd);});if(_0x306809){return _0x4cdbd4['id'];}}}));}}return BPromise['all'](_0xfff48e)[_0xfcf2('0x29')](function(_0x445de1){_0x1dd3ce=_(_0x1dd3ce)[_0xfcf2('0x91')](_0x445de1)[_0xfcf2('0x92')]()[_0xfcf2('0x93')]();return db['VoicePrefix'][_0xfcf2('0x50')]({'where':{'id':_0x20889c[_0xfcf2('0x4d')]['id']}})['then'](function(_0x50b78a){return db[_0xfcf2('0x53')][_0xfcf2('0x54')](function(_0x314762){return _0x50b78a['removeTeams'](_0x20889c[_0xfcf2('0x37')]['ids'],{'transaction':_0x314762})[_0xfcf2('0x29')](function(){if(!_[_0xfcf2('0x94')](_0x1dd3ce)){return _0x50b78a[_0xfcf2('0x73')](_0x1dd3ce,{'transaction':_0x314762});}})['then'](function(){_0x1dd3ce[_0xfcf2('0x82')](function(_0x5bf3a2){socket['emit'](_0xfcf2('0x76'),{'UserId':_0x5bf3a2,'VoicePrefixId':_0x50b78a['id']});});});});});});})[_0xfcf2('0x29')](respondWithStatusCode(_0x4f166b,null))['catch'](handleError(_0x4f166b,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 47bfe11..93d87db 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 _0x4a68=['hasOwnProperty','hook','exports','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove'];(function(_0x549dda,_0x2463a7){var _0x2c5ff0=function(_0x42860b){while(--_0x42860b){_0x549dda['push'](_0x549dda['shift']());}};_0x2c5ff0(++_0x2463a7);}(_0x4a68,0x123));var _0x84a6=function(_0x482c95,_0x504190){_0x482c95=_0x482c95-0x0;var _0x38c2e8=_0x4a68[_0x482c95];return _0x38c2e8;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x84a6('0x0'))['db'][_0x84a6('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x84a6('0x2')](0x0);var events={'afterCreate':_0x84a6('0x3'),'afterUpdate':_0x84a6('0x4'),'afterDestroy':_0x84a6('0x5')};function emitEvent(_0x5197a6){return function(_0x946cb0,_0x34eb9e,_0x2665b1){VoicePrefixEvents['emit'](_0x5197a6+':'+_0x946cb0['id'],_0x946cb0);VoicePrefixEvents['emit'](_0x5197a6,_0x946cb0);_0x2665b1(null);};}for(var e in events){if(events[_0x84a6('0x6')](e)){var event=events[e];VoicePrefix[_0x84a6('0x7')](e,emitEvent(event));}}module[_0x84a6('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xe94d=['emit','hook','exports','../../mysqldb','VoicePrefix','setMaxListeners','remove'];(function(_0x375335,_0x12ae30){var _0x53d403=function(_0x2e792e){while(--_0x2e792e){_0x375335['push'](_0x375335['shift']());}};_0x53d403(++_0x12ae30);}(_0xe94d,0x137));var _0xde94=function(_0x5065e2,_0x3f4670){_0x5065e2=_0x5065e2-0x0;var _0x5db3b0=_0xe94d[_0x5065e2];return _0x5db3b0;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xde94('0x0'))['db'][_0xde94('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xde94('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xde94('0x3')};function emitEvent(_0x31f59b){return function(_0x8173a0,_0x5eab5f,_0x8d1fca){VoicePrefixEvents[_0xde94('0x4')](_0x31f59b+':'+_0x8173a0['id'],_0x8173a0);VoicePrefixEvents[_0xde94('0x4')](_0x31f59b,_0x8173a0);_0x8d1fca(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xde94('0x5')](e,emitEvent(event));}}module[_0xde94('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 8486894..495a485 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 _0x2998=['../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x2a7bde,_0x4fe9d4){var _0x20e16f=function(_0x5b7fc3){while(--_0x5b7fc3){_0x2a7bde['push'](_0x2a7bde['shift']());}};_0x20e16f(++_0x4fe9d4);}(_0x2998,0x179));var _0x8299=function(_0x478bc0,_0x3c3cc9){_0x478bc0=_0x478bc0-0x0;var _0x39c121=_0x2998[_0x478bc0];return _0x39c121;};'use strict';var _=require(_0x8299('0x0'));var util=require(_0x8299('0x1'));var logger=require(_0x8299('0x2'))('api');var moment=require(_0x8299('0x3'));var BPromise=require('bluebird');var rp=require(_0x8299('0x4'));var fs=require('fs');var path=require(_0x8299('0x5'));var rimraf=require(_0x8299('0x6'));var config=require(_0x8299('0x7'));var attributes=require(_0x8299('0x8'));module['exports']=function(_0x385cd5,_0x45d421){return _0x385cd5[_0x8299('0x9')](_0x8299('0xa'),attributes,{'tableName':_0x8299('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b0a=['voice_prefixes','lodash','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','VoicePrefix'];(function(_0x5d3c82,_0x406384){var _0x89bea6=function(_0x1cc4bf){while(--_0x1cc4bf){_0x5d3c82['push'](_0x5d3c82['shift']());}};_0x89bea6(++_0x406384);}(_0x8b0a,0xe8));var _0xa8b0=function(_0x18a385,_0x487e93){_0x18a385=_0x18a385-0x0;var _0x999059=_0x8b0a[_0x18a385];return _0x999059;};'use strict';var _=require(_0xa8b0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa8b0('0x1'));var moment=require(_0xa8b0('0x2'));var BPromise=require(_0xa8b0('0x3'));var rp=require(_0xa8b0('0x4'));var fs=require('fs');var path=require(_0xa8b0('0x5'));var rimraf=require('rimraf');var config=require(_0xa8b0('0x6'));var attributes=require('./voicePrefix.attributes');module[_0xa8b0('0x7')]=function(_0x5ac04e,_0x5894ce){return _0x5ac04e[_0xa8b0('0x8')](_0xa8b0('0x9'),attributes,{'tableName':_0xa8b0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 74cd08c..e275074 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 _0x21b7=['request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','error','message','catch','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./voicePrefix.socket','register'];(function(_0x4d4e92,_0x51997c){var _0x5d8fa0=function(_0x1df501){while(--_0x1df501){_0x4d4e92['push'](_0x4d4e92['shift']());}};_0x5d8fa0(++_0x51997c);}(_0x21b7,0xef));var _0x721b=function(_0x595378,_0x4d8aed){_0x595378=_0x595378-0x0;var _0x3f7bdc=_0x21b7[_0x595378];return _0x3f7bdc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x721b('0x0'));var rs=require(_0x721b('0x1'));var fs=require('fs');var Redis=require(_0x721b('0x2'));var db=require(_0x721b('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x721b('0x4'));var config=require(_0x721b('0x5'));var jayson=require(_0x721b('0x6'));var client=jayson[_0x721b('0x7')][_0x721b('0x8')]({'port':0x232a});config[_0x721b('0x9')]=_['defaults'](config[_0x721b('0x9')],{'host':_0x721b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x721b('0xb'))[_0x721b('0xc')](socket);function respondWithRpcPromise(_0xe13699,_0x35f524,_0xfcc6d7){return new BPromise(function(_0x5e11e3,_0x302bfd){return client[_0x721b('0xd')](_0xe13699,_0xfcc6d7)[_0x721b('0xe')](function(_0x2c6f5a){logger[_0x721b('0xf')](_0x721b('0x10'),_0x35f524,_0x721b('0x11'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x35f524,_0x721b('0x11'),JSON['stringify'](_0x2c6f5a));if(_0x2c6f5a[_0x721b('0x12')]){if(_0x2c6f5a[_0x721b('0x12')]['code']===0x1f4){logger['error'](_0x721b('0x10'),_0x35f524,_0x2c6f5a[_0x721b('0x12')][_0x721b('0x13')]);return _0x302bfd(_0x2c6f5a[_0x721b('0x12')][_0x721b('0x13')]);}logger[_0x721b('0x12')](_0x721b('0x10'),_0x35f524,_0x2c6f5a[_0x721b('0x12')][_0x721b('0x13')]);return _0x5e11e3(_0x2c6f5a[_0x721b('0x12')][_0x721b('0x13')]);}else{logger[_0x721b('0xf')](_0x721b('0x10'),_0x35f524,_0x721b('0x11'));_0x5e11e3(_0x2c6f5a['result'][_0x721b('0x13')]);}})[_0x721b('0x14')](function(_0x821d77){logger[_0x721b('0x12')](_0x721b('0x10'),_0x35f524,_0x821d77);_0x302bfd(_0x821d77);});});} \ No newline at end of file +var _0xfa25=['../../config/logger','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','register','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x443cc7,_0x52a07e){var _0x15e1de=function(_0xf53ab0){while(--_0xf53ab0){_0x443cc7['push'](_0x443cc7['shift']());}};_0x15e1de(++_0x52a07e);}(_0xfa25,0xd1));var _0x5fa2=function(_0x2f279a,_0x3acb74){_0x2f279a=_0x2f279a-0x0;var _0x183d73=_0xfa25[_0x2f279a];return _0x183d73;};'use strict';var _=require('lodash');var util=require(_0x5fa2('0x0'));var moment=require(_0x5fa2('0x1'));var BPromise=require(_0x5fa2('0x2'));var rs=require(_0x5fa2('0x3'));var fs=require('fs');var Redis=require(_0x5fa2('0x4'));var db=require(_0x5fa2('0x5'))['db'];var utils=require(_0x5fa2('0x6'));var logger=require(_0x5fa2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5fa2('0x8'));var client=jayson[_0x5fa2('0x9')]['http']({'port':0x232a});config['redis']=_[_0x5fa2('0xa')](config['redis'],{'host':_0x5fa2('0xb'),'port':0x18eb});var socket=require(_0x5fa2('0xc'))(new Redis(config[_0x5fa2('0xd')]));require('./voicePrefix.socket')[_0x5fa2('0xe')](socket);function respondWithRpcPromise(_0x3a2222,_0x174b84,_0x53a368){return new BPromise(function(_0x474efa,_0x4ab368){return client['request'](_0x3a2222,_0x53a368)[_0x5fa2('0xf')](function(_0x3a1df9){logger['info'](_0x5fa2('0x10'),_0x174b84,_0x5fa2('0x11'));logger[_0x5fa2('0x12')](_0x5fa2('0x13'),_0x174b84,_0x5fa2('0x11'),JSON[_0x5fa2('0x14')](_0x3a1df9));if(_0x3a1df9[_0x5fa2('0x15')]){if(_0x3a1df9[_0x5fa2('0x15')][_0x5fa2('0x16')]===0x1f4){logger[_0x5fa2('0x15')](_0x5fa2('0x10'),_0x174b84,_0x3a1df9[_0x5fa2('0x15')][_0x5fa2('0x17')]);return _0x4ab368(_0x3a1df9[_0x5fa2('0x15')]['message']);}logger[_0x5fa2('0x15')](_0x5fa2('0x10'),_0x174b84,_0x3a1df9[_0x5fa2('0x15')]['message']);return _0x474efa(_0x3a1df9['error'][_0x5fa2('0x17')]);}else{logger[_0x5fa2('0x18')](_0x5fa2('0x10'),_0x174b84,'request\x20sent');_0x474efa(_0x3a1df9[_0x5fa2('0x19')]['message']);}})[_0x5fa2('0x1a')](function(_0x4e0243){logger[_0x5fa2('0x15')](_0x5fa2('0x10'),_0x174b84,_0x4e0243);_0x4ab368(_0x4e0243);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index f3f6eb9..3ba9e40 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 _0x847d=['length','voicePrefix:','save','remove','update','emit','removeListener','register'];(function(_0x2da0d1,_0x2be18b){var _0x227c84=function(_0x14a3f7){while(--_0x14a3f7){_0x2da0d1['push'](_0x2da0d1['shift']());}};_0x227c84(++_0x2be18b);}(_0x847d,0x14a));var _0xd847=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0x847d[_0x4aba15];return _0x1c8122;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xd847('0x0'),_0xd847('0x1'),_0xd847('0x2')];function createListener(_0x4f2500,_0x202b1c){return function(_0x4a85d8){_0x202b1c[_0xd847('0x3')](_0x4f2500,_0x4a85d8);};}function removeListener(_0x18051f,_0x5258c0){return function(){VoicePrefixEvents[_0xd847('0x4')](_0x18051f,_0x5258c0);};}exports[_0xd847('0x5')]=function(_0x375a88){for(var _0x13d8d4=0x0,_0x5f3349=events[_0xd847('0x6')];_0x13d8d4<_0x5f3349;_0x13d8d4++){var _0x19fdb5=events[_0x13d8d4];var _0x2bb22b=createListener(_0xd847('0x7')+_0x19fdb5,_0x375a88);VoicePrefixEvents['on'](_0x19fdb5,_0x2bb22b);}}; \ No newline at end of file +var _0xd49c=['removeListener','register','length','voicePrefix:','save','update'];(function(_0x35b16,_0x1f85b7){var _0x106b2c=function(_0x2475f7){while(--_0x2475f7){_0x35b16['push'](_0x35b16['shift']());}};_0x106b2c(++_0x1f85b7);}(_0xd49c,0x1d8));var _0xcd49=function(_0x53f005,_0xfae300){_0x53f005=_0x53f005-0x0;var _0x3c3464=_0xd49c[_0x53f005];return _0x3c3464;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xcd49('0x0'),'remove',_0xcd49('0x1')];function createListener(_0x190db1,_0x5bda72){return function(_0x1181d4){_0x5bda72['emit'](_0x190db1,_0x1181d4);};}function removeListener(_0x3a3034,_0x4c36ab){return function(){VoicePrefixEvents[_0xcd49('0x2')](_0x3a3034,_0x4c36ab);};}exports[_0xcd49('0x3')]=function(_0x3296c7){for(var _0x2a87f9=0x0,_0x704584=events[_0xcd49('0x4')];_0x2a87f9<_0x704584;_0x2a87f9++){var _0x321013=events[_0x2a87f9];var _0x17f26f=createListener(_0xcd49('0x5')+_0x321013,_0x3296c7);VoicePrefixEvents['on'](_0x321013,_0x17f26f);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 7775355..267b88b 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(_0x3d1ce2,_0x2a9d26){var _0x43c682=function(_0x1d3031){while(--_0x1d3031){_0x3d1ce2['push'](_0x3d1ce2['shift']());}};_0x43c682(++_0x2a9d26);}(_0xb10b,0x12a));var _0xbb10=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0xb10b[_0x43a5c7];return _0x3b12a2;};'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 _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(_0x4ae459,_0x3bf329){var _0x51d0c9=function(_0x1ce66b){while(--_0x1ce66b){_0x4ae459['push'](_0x4ae459['shift']());}};_0x51d0c9(++_0x3bf329);}(_0xb10b,0x12a));var _0xbb10=function(_0x1de1c9,_0x179709){_0x1de1c9=_0x1de1c9-0x0;var _0x41618e=_0xb10b[_0x1de1c9];return _0x41618e;};'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 diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 61cf082..836e153 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 _0xcb43=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','ENUM','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','setDataValue','type','getDataValue','strategy','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','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)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0xb476fa,_0x49adfd){var _0x47d49b=function(_0x2d240a){while(--_0x2d240a){_0xb476fa['push'](_0xb476fa['shift']());}};_0x47d49b(++_0x49adfd);}(_0xcb43,0xe9));var _0x3cb4=function(_0x1602fb,_0x20b6b3){_0x1602fb=_0x1602fb-0x0;var _0x461831=_0xcb43[_0x1602fb];return _0x461831;};'use strict';var Sequelize=require(_0x3cb4('0x0'));module[_0x3cb4('0x1')]={'name':{'type':Sequelize[_0x3cb4('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3cb4('0x3')](_0x3cb4('0x4'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':_0x3cb4('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x3cb4('0x3')]('rr',_0x3cb4('0x6'),_0x3cb4('0x7'),_0x3cb4('0x8'),_0x3cb4('0x9'),_0x3cb4('0xa'),_0x3cb4('0xb'),'wrandom',_0x3cb4('0xc')),'allowNull':![],'defaultValue':_0x3cb4('0x6'),'set':function(_0x2f8cc6){this[_0x3cb4('0xd')]('strategy',_0x2f8cc6?_0x2f8cc6:_0x3cb4('0xa'));},'get':function(){var _0x5ee553=this['getDataValue'](_0x3cb4('0xe'));var _0x4ccfe8=this[_0x3cb4('0xf')]('dialMethod');var _0xd5231e=this['getDataValue'](_0x3cb4('0x10'));if(_0x5ee553==='inbound'){return _0xd5231e;}if(_0x4ccfe8===_0x3cb4('0x11')&&_0xd5231e===_0x3cb4('0xa')||_0x4ccfe8===_0x3cb4('0x11')&&_0xd5231e===_0x3cb4('0x12')){return _0xd5231e;}if(_0x4ccfe8===_0x3cb4('0x13')||_0x4ccfe8===_0x3cb4('0x14')||_0x4ccfe8===_0x3cb4('0x15')){return _0xd5231e;}return null;}},'servicelevel':{'type':Sequelize[_0x3cb4('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x3cb4('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x3cb4('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3cb4('0x2')]},'weight':{'type':Sequelize[_0x3cb4('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x3cb4('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3cb4('0x3')](_0x3cb4('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0x3cb4('0x17'),'no',_0x3cb4('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x3cb4('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x3cb4('0x3')](_0x3cb4('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3cb4('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3cb4('0x3')](_0x3cb4('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3cb4('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x3cb4('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x3cb4('0x3')](_0x3cb4('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3cb4('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x3cb4('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3cb4('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3cb4('0x3')](_0x3cb4('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3cb4('0x3')](_0x3cb4('0x17'),'no'),'defaultValue':_0x3cb4('0x17')},'announce_holdtime':{'type':Sequelize[_0x3cb4('0x3')](_0x3cb4('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3cb4('0x3')](_0x3cb4('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x3cb4('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x3cb4('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x3cb4('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3cb4('0x2')]},'queue_quantity1':{'type':Sequelize[_0x3cb4('0x2')]},'queue_quantity2':{'type':Sequelize[_0x3cb4('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x3cb4('0x2')]},'queue_less_than':{'type':Sequelize[_0x3cb4('0x2')]},'periodic_announce':{'type':Sequelize[_0x3cb4('0x19')],'set':function(_0x1e5302){this[_0x3cb4('0xd')](_0x3cb4('0x1a'),_0x1e5302?_0x1e5302[_0x3cb4('0x1b')](','):[]);},'get':function(){return this[_0x3cb4('0xf')](_0x3cb4('0x1a'))?this['getDataValue'](_0x3cb4('0x1a'))[_0x3cb4('0x1c')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x3cb4('0x17'),'set':function(_0xeb0fcb){this['setDataValue'](_0x3cb4('0x1d'),_0xeb0fcb?_0xeb0fcb[_0x3cb4('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x3cb4('0x1d'))?this[_0x3cb4('0xf')](_0x3cb4('0x1d'))[_0x3cb4('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':'no','set':function(_0x27053f){this[_0x3cb4('0xd')](_0x3cb4('0x1e'),_0x27053f?_0x27053f['join'](','):undefined);},'get':function(){return this[_0x3cb4('0xf')](_0x3cb4('0x1e'))?this[_0x3cb4('0xf')](_0x3cb4('0x1e'))[_0x3cb4('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x3cb4('0x3')](_0x3cb4('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x3cb4('0x3')](_0x3cb4('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3cb4('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3cb4('0x3')](_0x3cb4('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3cb4('0x2')]},'description':{'type':Sequelize[_0x3cb4('0x2')]},'acw':{'type':Sequelize[_0x3cb4('0x1f')],'defaultValue':0x0,'set':function(_0x4f7768){this[_0x3cb4('0xd')]('acw',_0x4f7768);if(_0x4f7768){if(this[_0x3cb4('0xf')](_0x3cb4('0x20'))<0x2){this[_0x3cb4('0xd')](_0x3cb4('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3cb4('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3cb4('0x1f')],'defaultValue':0x0,'comment':_0x3cb4('0x21')},'dialMethod':{'type':Sequelize['ENUM'](_0x3cb4('0x22'),'progressive',_0x3cb4('0x15'),_0x3cb4('0x14'),_0x3cb4('0x11')),'defaultValue':_0x3cb4('0x13'),'comment':_0x3cb4('0x23')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x3cb4('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3cb4('0x25')},'dialLimitQueue':{'type':Sequelize[_0x3cb4('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3cb4('0x26')},'dialPowerLevel':{'type':Sequelize[_0x3cb4('0x27')](0x2)[_0x3cb4('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x3cb4('0x28'),'dropRate'),'defaultValue':_0x3cb4('0x29'),'comment':_0x3cb4('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x3cb4('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x3cb4('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x3cb4('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3cb4('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3cb4('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x3cb4('0x16')](0x3)[_0x3cb4('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':'tTxX','comment':_0x3cb4('0x2d')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x3cb4('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x3cb4('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x3cb4('0x16')](0x3)[_0x3cb4('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3cb4('0x16')](0x5)[_0x3cb4('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3cb4('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0x3cb4('0x16')](0x3)[_0x3cb4('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3cb4('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3cb4('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3cb4('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3cb4('0x16')](0x3)[_0x3cb4('0x24')],'defaultValue':0x3,'comment':_0x3cb4('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3cb4('0x32')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3cb4('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3cb4('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x3cb4('0x33'),_0x3cb4('0x34'),_0x3cb4('0x35')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3cb4('0x36')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3cb4('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3cb4('0x37')},'dialAMDGreeting':{'type':Sequelize[_0x3cb4('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3cb4('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3cb4('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3cb4('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3cb4('0x16')](0x9)[_0x3cb4('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3cb4('0x3a')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3cb4('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3cb4('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3cb4('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3cb4('0x16')](0x9)[_0x3cb4('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3cb4('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x3cb4('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3cb4('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3cb4('0x16')](0x9)[_0x3cb4('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3cb4('0x3e')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x3cb4('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3cb4('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3cb4('0x3')]('DESC','ASC'),'defaultValue':_0x3cb4('0x40')},'dialQueueProject2':{'type':Sequelize[_0x3cb4('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x3cb4('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3cb4('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3cb4('0x41')},'dialCutDigit':{'type':Sequelize[_0x3cb4('0x16')](0x3)[_0x3cb4('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3cb4('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3cb4('0x16')](0x3)[_0x3cb4('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3cb4('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x3cb4('0x16')](0x3)[_0x3cb4('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3cb4('0x43')},'dialDropRetryFrequency':{'type':Sequelize[_0x3cb4('0x16')](0x5)[_0x3cb4('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3cb4('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3cb4('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3cb4('0x16')](0x5)[_0x3cb4('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3cb4('0x45')},'dialMachineMaxRetry':{'type':Sequelize[_0x3cb4('0x16')](0x3)[_0x3cb4('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x3cb4('0x16')](0x5)[_0x3cb4('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3cb4('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3cb4('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3cb4('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3cb4('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3cb4('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x3cb4('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x3cb4('0x1f')],'defaultValue':![],'comment':_0x3cb4('0x4a'),'set':function(_0x32bb6d){if(!_0x32bb6d)this[_0x3cb4('0xd')]('mandatoryDispositionPauseId',null);this[_0x3cb4('0xd')](_0x3cb4('0x4b'),_0x32bb6d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x3cb4('0x16')](0x3)[_0x3cb4('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x3cb4('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x3cb4('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0x3d58=['Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\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','sequelize','STRING','ENUM','inbound','ringall','fewestcalls','random','linear','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','progressive','power','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','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','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x3d58,0x1e5));var _0x83d5=function(_0x2a1b65,_0x3d6be3){_0x2a1b65=_0x2a1b65-0x0;var _0x18cfff=_0x3d58[_0x2a1b65];return _0x18cfff;};'use strict';var Sequelize=require(_0x83d5('0x0'));module['exports']={'name':{'type':Sequelize[_0x83d5('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x83d5('0x2')](_0x83d5('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x83d5('0x3')},'musiconhold':{'type':Sequelize[_0x83d5('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x83d5('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x83d5('0x2')]('rr',_0x83d5('0x4'),'leastrecent',_0x83d5('0x5'),_0x83d5('0x6'),'rrmemory',_0x83d5('0x7'),'wrandom',_0x83d5('0x8')),'allowNull':![],'defaultValue':_0x83d5('0x4'),'set':function(_0x1830e3){this[_0x83d5('0x9')](_0x83d5('0xa'),_0x1830e3?_0x1830e3:_0x83d5('0xb'));},'get':function(){var _0x1fb3a5=this[_0x83d5('0xc')](_0x83d5('0xd'));var _0x5a44a8=this[_0x83d5('0xc')](_0x83d5('0xe'));var _0x251ff8=this['getDataValue'](_0x83d5('0xa'));if(_0x1fb3a5===_0x83d5('0x3')){return _0x251ff8;}if(_0x5a44a8===_0x83d5('0xf')&&_0x251ff8===_0x83d5('0xb')||_0x5a44a8==='booked'&&_0x251ff8===_0x83d5('0x10')){return _0x251ff8;}if(_0x5a44a8===_0x83d5('0x11')||_0x5a44a8==='predictive'||_0x5a44a8===_0x83d5('0x12')){return _0x251ff8;}return null;}},'servicelevel':{'type':Sequelize[_0x83d5('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x83d5('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x83d5('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x83d5('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x83d5('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x83d5('0x2')](_0x83d5('0x14'),'no'),'defaultValue':_0x83d5('0x14')},'autopause':{'type':Sequelize[_0x83d5('0x2')](_0x83d5('0x14'),'no',_0x83d5('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x83d5('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x83d5('0x2')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x83d5('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x83d5('0x2')](_0x83d5('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x83d5('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x83d5('0x2')](_0x83d5('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x83d5('0x2')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x83d5('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x83d5('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x83d5('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x83d5('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x83d5('0x2')](_0x83d5('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x83d5('0x2')](_0x83d5('0x14'),'no'),'defaultValue':_0x83d5('0x14')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x83d5('0x14'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x83d5('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x83d5('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0x83d5('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x83d5('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x83d5('0x1')]},'queue_youarenext':{'type':Sequelize[_0x83d5('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x83d5('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x83d5('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x83d5('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x83d5('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x83d5('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x83d5('0x1')]},'periodic_announce':{'type':Sequelize[_0x83d5('0x16')],'set':function(_0x409655){this[_0x83d5('0x9')](_0x83d5('0x17'),_0x409655?_0x409655[_0x83d5('0x18')](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0x83d5('0xc')](_0x83d5('0x17'))[_0x83d5('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x83d5('0x1')],'defaultValue':_0x83d5('0x14'),'set':function(_0xbac6b7){this[_0x83d5('0x9')]('joinempty',_0xbac6b7?_0xbac6b7[_0x83d5('0x18')](','):undefined);},'get':function(){return this[_0x83d5('0xc')](_0x83d5('0x1a'))?this[_0x83d5('0xc')](_0x83d5('0x1a'))[_0x83d5('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x83d5('0x1')],'defaultValue':'no','set':function(_0xfc46bd){this[_0x83d5('0x9')](_0x83d5('0x1b'),_0xfc46bd?_0xfc46bd[_0x83d5('0x18')](','):undefined);},'get':function(){return this[_0x83d5('0xc')](_0x83d5('0x1b'))?this[_0x83d5('0xc')](_0x83d5('0x1b'))[_0x83d5('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x83d5('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x83d5('0x2')](_0x83d5('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x83d5('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x83d5('0x2')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x83d5('0x1')]},'description':{'type':Sequelize[_0x83d5('0x1')]},'acw':{'type':Sequelize[_0x83d5('0x1c')],'defaultValue':0x0,'set':function(_0x28786a){this[_0x83d5('0x9')](_0x83d5('0x1d'),_0x28786a);if(_0x28786a){if(this[_0x83d5('0xc')](_0x83d5('0x1e'))<0x2){this[_0x83d5('0x9')](_0x83d5('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x83d5('0x1f')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x83d5('0x11'),_0x83d5('0x12'),_0x83d5('0x20'),'booked'),'defaultValue':_0x83d5('0x11'),'comment':_0x83d5('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x83d5('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x83d5('0x23')},'dialLimitQueue':{'type':Sequelize[_0x83d5('0x13')](0x4)[_0x83d5('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x83d5('0x24')},'dialPowerLevel':{'type':Sequelize[_0x83d5('0x25')](0x2)[_0x83d5('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x83d5('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x83d5('0x2')](_0x83d5('0x27'),_0x83d5('0x28')),'defaultValue':_0x83d5('0x28'),'comment':_0x83d5('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x83d5('0x25')](0x2)[_0x83d5('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x83d5('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x83d5('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x83d5('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x83d5('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83d5('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x83d5('0x1')],'defaultValue':_0x83d5('0x2c'),'comment':_0x83d5('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x83d5('0x13')](0x3)[_0x83d5('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x83d5('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x83d5('0x13')](0x3)[_0x83d5('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x83d5('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83d5('0x2e')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x83d5('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83d5('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0x83d5('0x13')](0x5)[_0x83d5('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83d5('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x83d5('0x13')](0x3)[_0x83d5('0x22')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x83d5('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83d5('0x31')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x83d5('0x32')},'dialTimezone':{'type':Sequelize[_0x83d5('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x83d5('0x33')},'dialPrefix':{'type':Sequelize[_0x83d5('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x83d5('0x34'),_0x83d5('0x35'),'onlyIfOpen'),'defaultValue':_0x83d5('0x34')},'dialAMDActive':{'type':Sequelize[_0x83d5('0x1c')],'defaultValue':0x0,'comment':_0x83d5('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0x83d5('0x13')](0x9)[_0x83d5('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x83d5('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x83d5('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x83d5('0x13')](0x9)[_0x83d5('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x83d5('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x83d5('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x83d5('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x83d5('0x13')](0x9)[_0x83d5('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x83d5('0x13')](0x9)[_0x83d5('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x83d5('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x83d5('0x13')](0x9)[_0x83d5('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x83d5('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x83d5('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x83d5('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x83d5('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x83d5('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0x83d5('0x13')](0x5)[_0x83d5('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x83d5('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0x83d5('0x2')](_0x83d5('0x3f'),_0x83d5('0x40')),'defaultValue':_0x83d5('0x3f')},'dialQueueProject2':{'type':Sequelize[_0x83d5('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x83d5('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x83d5('0x13')](0x3)[_0x83d5('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x83d5('0x41')},'dialCutDigit':{'type':Sequelize[_0x83d5('0x13')](0x3)[_0x83d5('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x83d5('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x83d5('0x13')](0x5)[_0x83d5('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83d5('0x42')},'dialDropMaxRetry':{'type':Sequelize[_0x83d5('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83d5('0x43')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83d5('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x83d5('0x13')](0x3)[_0x83d5('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x83d5('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83d5('0x45')},'dialMachineMaxRetry':{'type':Sequelize[_0x83d5('0x13')](0x3)[_0x83d5('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83d5('0x46')},'dialMachineRetryFrequency':{'type':Sequelize[_0x83d5('0x13')](0x5)[_0x83d5('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83d5('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x83d5('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83d5('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x83d5('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83d5('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x83d5('0x13')],'allowNull':!![],'comment':_0x83d5('0x4a')},'mandatoryDisposition':{'type':Sequelize[_0x83d5('0x1c')],'defaultValue':![],'comment':_0x83d5('0x4b'),'set':function(_0x4c8f09){if(!_0x4c8f09)this[_0x83d5('0x9')](_0x83d5('0x4c'),null);this['setDataValue']('mandatoryDisposition',_0x4c8f09);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x83d5('0x13')](0x3)[_0x83d5('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x83d5('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x83d5('0x1c')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x83d5('0x1c')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index ebf966e..d0003e0 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 _0x3263=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','inbound','userProfileId','getHoppers','findOne','VoiceQueueId','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','User','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','interface','SIP/%s','userVoiceQueue:save','removeTeams','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','every','TeamId','all','union','compact','ids','emit','userVoiceQueue:remove','spread','isEmpty','format','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','select','field','CmListId','toString','ListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','removeLists','getBlackLists','addBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','QueueCampaigns','outbound','filter','ignore','map','value','includes','find','name','UserProfileResource','sendStatus','stack','index','VoiceQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','rows','catch','show','params','keys','options','create','body','user','get'];(function(_0x4f6400,_0x379b1b){var _0x4e447=function(_0x5766a2){while(--_0x5766a2){_0x4f6400['push'](_0x4f6400['shift']());}};_0x4e447(++_0x379b1b);}(_0x3263,0x122));var _0x3326=function(_0x8f7825,_0xaa0ca0){_0x8f7825=_0x8f7825-0x0;var _0x29a7c9=_0x3263[_0x8f7825];return _0x29a7c9;};'use strict';var emlformat=require(_0x3326('0x0'));var rimraf=require(_0x3326('0x1'));var zipdir=require(_0x3326('0x2'));var jsonpatch=require(_0x3326('0x3'));var rp=require(_0x3326('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3326('0x5'));var util=require(_0x3326('0x6'));var path=require(_0x3326('0x7'));var sox=require(_0x3326('0x8'));var csv=require(_0x3326('0x9'));var ejs=require(_0x3326('0xa'));var fs=require('fs');var fs_extra=require(_0x3326('0xb'));var _=require(_0x3326('0xc'));var squel=require(_0x3326('0xd'));var crypto=require(_0x3326('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3326('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3326('0x10'));var Papa=require(_0x3326('0x11'));var Redis=require(_0x3326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3326('0x13'));var as=require(_0x3326('0x14'));var hardwareService=require(_0x3326('0x15'));var logger=require(_0x3326('0x16'))(_0x3326('0x17'));var utils=require(_0x3326('0x18'));var config=require(_0x3326('0x19'));var licenseUtil=require(_0x3326('0x1a'));var db=require(_0x3326('0x1b'))['db'];config[_0x3326('0x1c')]=_[_0x3326('0x1d')](config[_0x3326('0x1c')],{'host':_0x3326('0x1e'),'port':0x18eb});var socket=require(_0x3326('0x1f'))(new Redis(config[_0x3326('0x1c')]));require(_0x3326('0x20'))[_0x3326('0x21')](socket);function respondWithStatusCode(_0x124696,_0x51534b){_0x51534b=_0x51534b||0xcc;return function(_0x158d82){if(_0x158d82){return _0x124696['sendStatus'](_0x51534b);}return _0x124696[_0x3326('0x22')](_0x51534b)[_0x3326('0x23')]();};}function respondWithResult(_0x28b267,_0x1927e0){_0x1927e0=_0x1927e0||0xc8;return function(_0x5595d8){if(_0x5595d8){return _0x28b267[_0x3326('0x22')](_0x1927e0)[_0x3326('0x24')](_0x5595d8);}};}function respondWithFilteredResult(_0x5480f7,_0xee55b){return function(_0x1dda08){if(_0x1dda08){var _0x48de46=typeof _0xee55b[_0x3326('0x25')]===_0x3326('0x26')&&typeof _0xee55b['limit']===_0x3326('0x26');var _0x19a8fa=_0x1dda08[_0x3326('0x27')];var _0x55728d=_0x48de46?0x0:_0xee55b['offset'];var _0x3247b3=_0x48de46?_0x1dda08[_0x3326('0x27')]:_0xee55b['offset']+_0xee55b['limit'];var _0x456d33;if(_0x3247b3>=_0x19a8fa){_0x3247b3=_0x19a8fa;_0x456d33=0xc8;}else{_0x456d33=0xce;}_0x5480f7['status'](_0x456d33);return _0x5480f7[_0x3326('0x28')](_0x3326('0x29'),_0x55728d+'-'+_0x3247b3+'/'+_0x19a8fa)['json'](_0x1dda08);}return null;};}function patchUpdates(_0x45d167){return function(_0x35784e){try{jsonpatch[_0x3326('0x2a')](_0x35784e,_0x45d167,!![]);}catch(_0x14fd53){return BPromise[_0x3326('0x2b')](_0x14fd53);}return _0x35784e[_0x3326('0x2c')]();};}function saveUpdates(_0x3a93f8,_0x259c5c){return function(_0x108b50){if(_0x108b50){return _0x108b50[_0x3326('0x2d')](_0x3a93f8)[_0x3326('0x2e')](function(_0x58e748){return _0x58e748;});}return null;};}function removeEntity(_0x32ff37,_0x2b3f0e){return function(_0x5ca104){if(_0x5ca104){return _0x5ca104[_0x3326('0x2f')]()['then'](function(){var _0x59bc2f=_0x5ca104['get']({'plain':!![]});var _0x5b0e68=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x3326('0x30'),'value':_0x3326('0x31'),'ignore':![]}];var _0x474a54=_(_0x5b0e68)[_0x3326('0x32')](_0x3326('0x33'))[_0x3326('0x34')](_0x3326('0x35'))[_0x3326('0x35')]();if(_[_0x3326('0x36')](_0x474a54,_0x59bc2f['type'])){return;}var _0x2ca862=_[_0x3326('0x37')](_0x5b0e68,[_0x3326('0x35'),_0x59bc2f['type']])[_0x3326('0x38')];return db[_0x3326('0x39')][_0x3326('0x2f')]({'where':{'type':_0x2ca862,'resourceId':_0x59bc2f['id']}})[_0x3326('0x2e')](function(){return _0x5ca104;});})['then'](function(){_0x32ff37['status'](0xcc)[_0x3326('0x23')]();});}};}function handleEntityNotFound(_0x59efe5,_0xdf9e8b){return function(_0xd25b49){if(!_0xd25b49){_0x59efe5[_0x3326('0x3a')](0x194);}return _0xd25b49;};}function handleError(_0x46c16e,_0x115aa7){_0x115aa7=_0x115aa7||0x1f4;return function(_0xf6f4ca){logger['error'](_0xf6f4ca[_0x3326('0x3b')]);if(_0xf6f4ca[_0x3326('0x38')]){delete _0xf6f4ca['name'];}_0x46c16e[_0x3326('0x22')](_0x115aa7)['send'](_0xf6f4ca);};}exports[_0x3326('0x3c')]=function(_0xfda964,_0x3b71be){var _0x2b743c={},_0x2ae06a={},_0x516987={'count':0x0,'rows':[]};var _0x42784f=_['map'](db[_0x3326('0x3d')][_0x3326('0x3e')],function(_0x5cbd58){return{'name':_0x5cbd58[_0x3326('0x3f')],'type':_0x5cbd58[_0x3326('0x40')][_0x3326('0x41')]};});_0x2ae06a[_0x3326('0x42')]=_[_0x3326('0x34')](_0x42784f,'name');_0x2ae06a[_0x3326('0x43')]=_['keys'](_0xfda964[_0x3326('0x43')]);_0x2ae06a[_0x3326('0x44')]=_[_0x3326('0x45')](_0x2ae06a[_0x3326('0x42')],_0x2ae06a[_0x3326('0x43')]);_0x2b743c[_0x3326('0x46')]=_['intersection'](_0x2ae06a[_0x3326('0x42')],qs[_0x3326('0x47')](_0xfda964[_0x3326('0x43')][_0x3326('0x47')]));_0x2b743c[_0x3326('0x46')]=_0x2b743c[_0x3326('0x46')][_0x3326('0x48')]?_0x2b743c[_0x3326('0x46')]:_0x2ae06a[_0x3326('0x42')];if(!_0xfda964['query'][_0x3326('0x49')](_0x3326('0x4a'))){_0x2b743c['limit']=qs[_0x3326('0x4b')](_0xfda964[_0x3326('0x43')][_0x3326('0x4b')]);_0x2b743c[_0x3326('0x25')]=qs[_0x3326('0x25')](_0xfda964[_0x3326('0x43')][_0x3326('0x25')]);}_0x2b743c[_0x3326('0x4c')]=qs[_0x3326('0x4d')](_0xfda964['query'][_0x3326('0x4d')]);_0x2b743c[_0x3326('0x4e')]=qs[_0x3326('0x44')](_[_0x3326('0x4f')](_0xfda964[_0x3326('0x43')],_0x2ae06a[_0x3326('0x44')]),_0x42784f);if(_0xfda964[_0x3326('0x43')][_0x3326('0x32')]){_0x2b743c[_0x3326('0x4e')]=_[_0x3326('0x50')](_0x2b743c[_0x3326('0x4e')],{'$or':_[_0x3326('0x34')](_0x42784f,function(_0x4f1ce4){if(_0x4f1ce4[_0x3326('0x40')]!==_0x3326('0x51')){var _0x39dfd5={};_0x39dfd5[_0x4f1ce4[_0x3326('0x38')]]={'$like':'%'+_0xfda964[_0x3326('0x43')][_0x3326('0x32')]+'%'};return _0x39dfd5;}})});}_0x2b743c=_['merge']({},_0x2b743c,_0xfda964['options']);var _0x4d823d={'where':_0x2b743c[_0x3326('0x4e')]};return db[_0x3326('0x3d')]['count'](_0x4d823d)['then'](function(_0x2e7984){_0x516987[_0x3326('0x27')]=_0x2e7984;if(_0xfda964[_0x3326('0x43')][_0x3326('0x52')]){_0x2b743c[_0x3326('0x53')]=[{'all':!![]}];}return db[_0x3326('0x3d')]['findAll'](_0x2b743c);})[_0x3326('0x2e')](function(_0x491340){_0x516987[_0x3326('0x54')]=_0x491340;return _0x516987;})[_0x3326('0x2e')](respondWithFilteredResult(_0x3b71be,_0x2b743c))[_0x3326('0x55')](handleError(_0x3b71be,null));};exports[_0x3326('0x56')]=function(_0x5bff1d,_0x2d0aa4){var _0x47f3b2={'raw':![],'where':{'id':_0x5bff1d[_0x3326('0x57')]['id']}},_0xd05ab5={};_0xd05ab5['model']=_[_0x3326('0x58')](db[_0x3326('0x3d')]['rawAttributes']);_0xd05ab5[_0x3326('0x43')]=_['keys'](_0x5bff1d[_0x3326('0x43')]);_0xd05ab5[_0x3326('0x44')]=_[_0x3326('0x45')](_0xd05ab5['model'],_0xd05ab5[_0x3326('0x43')]);_0x47f3b2[_0x3326('0x46')]=_[_0x3326('0x45')](_0xd05ab5[_0x3326('0x42')],qs[_0x3326('0x47')](_0x5bff1d[_0x3326('0x43')][_0x3326('0x47')]));_0x47f3b2[_0x3326('0x46')]=_0x47f3b2[_0x3326('0x46')][_0x3326('0x48')]?_0x47f3b2[_0x3326('0x46')]:_0xd05ab5[_0x3326('0x42')];if(_0x5bff1d[_0x3326('0x43')][_0x3326('0x52')]){_0x47f3b2[_0x3326('0x53')]=[{'all':!![]}];}_0x47f3b2=_[_0x3326('0x50')]({},_0x47f3b2,_0x5bff1d[_0x3326('0x59')]);return db['VoiceQueue'][_0x3326('0x37')](_0x47f3b2)[_0x3326('0x2e')](handleEntityNotFound(_0x2d0aa4,null))['then'](respondWithResult(_0x2d0aa4,null))[_0x3326('0x55')](handleError(_0x2d0aa4,null));};exports['create']=function(_0x3a9934,_0xc96387){return db['VoiceQueue'][_0x3326('0x5a')](_0x3a9934[_0x3326('0x5b')],{})[_0x3326('0x2e')](function(_0xfef03b){var _0x5c505f=_0x3a9934[_0x3326('0x5c')][_0x3326('0x5d')]({'plain':!![]});if(!_0x5c505f)throw new Error(_0x3326('0x5e'));if(_0x5c505f[_0x3326('0x5f')]===_0x3326('0x5c')){var _0x5e8914=_0xfef03b[_0x3326('0x5d')]({'plain':!![]});var _0x4fd5dd=[{'name':_0x3326('0x60'),'value':'inbound'},{'name':_0x3326('0x30'),'value':_0x3326('0x31')}];var _0x24aaa2=_[_0x3326('0x37')](_0x4fd5dd,[_0x3326('0x35'),_0x5e8914['type']])[_0x3326('0x38')];return db[_0x3326('0x61')]['find']({'where':{'name':_0x24aaa2,'userProfileId':_0x5c505f['userProfileId']},'raw':!![]})[_0x3326('0x2e')](function(_0x1f96c7){if(_0x1f96c7&&_0x1f96c7[_0x3326('0x62')]===0x0){return db['UserProfileResource'][_0x3326('0x5a')]({'name':_0x5e8914[_0x3326('0x38')],'resourceId':_0x5e8914['id'],'type':_0x1f96c7[_0x3326('0x38')],'sectionId':_0x1f96c7['id']},{})[_0x3326('0x2e')](function(){return _0xfef03b;});}else{return _0xfef03b;}})[_0x3326('0x55')](function(_0x3281b6){logger[_0x3326('0x63')](_0x3326('0x64'),_0x3281b6);throw _0x3281b6;});}return _0xfef03b;})['then'](respondWithResult(_0xc96387,0xc9))[_0x3326('0x55')](handleError(_0xc96387,null));};exports['clone']=function(_0x266ccc,_0x2b9136){var _0x49ebe8={'where':{'id':_0x266ccc[_0x3326('0x57')]['id']}},_0x183864={};_0x183864[_0x3326('0x42')]=_[_0x3326('0x58')](db[_0x3326('0x3d')][_0x3326('0x3e')]);_0x49ebe8[_0x3326('0x46')]=_[_0x3326('0x45')](_0x183864[_0x3326('0x42')],qs[_0x3326('0x47')](_0x266ccc[_0x3326('0x43')][_0x3326('0x47')]));_0x49ebe8[_0x3326('0x46')]=_0x49ebe8[_0x3326('0x46')]['length']?_0x49ebe8[_0x3326('0x46')]:_0x183864[_0x3326('0x42')];if(_0x266ccc[_0x3326('0x43')][_0x3326('0x52')]){_0x49ebe8[_0x3326('0x53')]=[{'all':!![]}];}_0x49ebe8=_[_0x3326('0x50')]({},_0x49ebe8,_0x266ccc[_0x3326('0x59')]);return db[_0x3326('0x3d')][_0x3326('0x37')](_0x49ebe8)['then'](handleEntityNotFound(_0x2b9136,null))[_0x3326('0x2e')](function(_0x11ca5c){if(_0x11ca5c){var _0x3a3b68=_0x11ca5c[_0x3326('0x5d')]({'plain':!![]});_0x3a3b68=qs[_0x3326('0x65')](_0x3a3b68,['id',_0x3326('0x66'),'updatedAt']);_0x266ccc[_0x3326('0x5b')]=_[_0x3326('0x65')](_0x266ccc[_0x3326('0x5b')],['id',_0x3326('0x66'),_0x3326('0x67')]);return db['VoiceQueue']['create'](_[_0x3326('0x50')](_0x3a3b68,_0x266ccc[_0x3326('0x5b')]),{'include':_0x266ccc[_0x3326('0x43')][_0x3326('0x52')]?[{'all':!![]}]:undefined})[_0x3326('0x2e')](function(_0x175d9a){var _0x4b7237=_0x266ccc[_0x3326('0x5c')][_0x3326('0x5d')]({'plain':!![]});if(!_0x4b7237)throw new Error(_0x3326('0x5e'));if(_0x4b7237[_0x3326('0x5f')]==='user'){var _0x38d849=_0x175d9a[_0x3326('0x5d')]({'plain':!![]});var _0x1f5a14=[{'name':_0x3326('0x60'),'value':_0x3326('0x68')},{'name':_0x3326('0x30'),'value':_0x3326('0x31')}];var _0x5ef01e=_['find'](_0x1f5a14,[_0x3326('0x35'),_0x38d849['type']])[_0x3326('0x38')];return db['UserProfileSection'][_0x3326('0x37')]({'where':{'name':_0x5ef01e,'userProfileId':_0x4b7237[_0x3326('0x69')]},'raw':!![]})['then'](function(_0x5069ca){if(_0x5069ca&&_0x5069ca[_0x3326('0x62')]===0x0){return db[_0x3326('0x39')]['create']({'name':_0x38d849[_0x3326('0x38')],'resourceId':_0x38d849['id'],'type':_0x5069ca[_0x3326('0x38')],'sectionId':_0x5069ca['id']},{})[_0x3326('0x2e')](function(){return _0x175d9a;});}else{return _0x175d9a;}})[_0x3326('0x55')](function(_0x2900d8){logger[_0x3326('0x63')](_0x3326('0x64'),_0x2900d8);throw _0x2900d8;});}return _0x175d9a;});}})[_0x3326('0x2e')](respondWithResult(_0x2b9136,0xc9))[_0x3326('0x55')](handleError(_0x2b9136,null));};exports[_0x3326('0x2d')]=function(_0x11d7ec,_0x4caeaf){if(_0x11d7ec['body']['id']){delete _0x11d7ec[_0x3326('0x5b')]['id'];}return db['VoiceQueue'][_0x3326('0x37')]({'where':{'id':_0x11d7ec[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x4caeaf,null))[_0x3326('0x2e')](saveUpdates(_0x11d7ec['body'],null))['then'](respondWithResult(_0x4caeaf,null))['catch'](handleError(_0x4caeaf,null));};exports[_0x3326('0x2f')]=function(_0x5e47bf,_0x30b6d7){return db[_0x3326('0x3d')][_0x3326('0x37')]({'where':{'id':_0x5e47bf[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x30b6d7,null))[_0x3326('0x2e')](removeEntity(_0x30b6d7,null))[_0x3326('0x55')](handleError(_0x30b6d7,null));};exports[_0x3326('0x6a')]=function(_0x114deb,_0x3d8ad9,_0xc319bc){var _0x5dc291={'raw':![],'where':{}};var _0x4d0de8={};var _0x4c1690={'count':0x0,'rows':[]};return db[_0x3326('0x3d')][_0x3326('0x6b')]({'where':{'id':_0x114deb[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x3d8ad9,null))[_0x3326('0x2e')](function(_0x1355c8){if(_0x1355c8){_0x4d0de8[_0x3326('0x42')]=_[_0x3326('0x58')](db['CmHopper']['rawAttributes']);_0x4d0de8['query']=_[_0x3326('0x58')](_0x114deb['query']);_0x4d0de8[_0x3326('0x44')]=_[_0x3326('0x45')](_0x4d0de8[_0x3326('0x42')],_0x4d0de8['query']);_0x5dc291[_0x3326('0x46')]=_['intersection'](_0x4d0de8[_0x3326('0x42')],qs['fields'](_0x114deb[_0x3326('0x43')][_0x3326('0x47')]));_0x5dc291[_0x3326('0x46')]=_0x5dc291[_0x3326('0x46')][_0x3326('0x48')]?_0x5dc291[_0x3326('0x46')]:_0x4d0de8[_0x3326('0x42')];if(!_0x114deb['query'][_0x3326('0x49')](_0x3326('0x4a'))){_0x5dc291['limit']=qs[_0x3326('0x4b')](_0x114deb['query']['limit']);_0x5dc291[_0x3326('0x25')]=qs[_0x3326('0x25')](_0x114deb[_0x3326('0x43')][_0x3326('0x25')]);}_0x5dc291[_0x3326('0x4c')]=qs[_0x3326('0x4d')](_0x114deb['query']['sort']);_0x5dc291[_0x3326('0x4e')]=qs['filters'](_[_0x3326('0x4f')](_0x114deb[_0x3326('0x43')],_0x4d0de8['filters']));_0x5dc291['where'][_0x3326('0x6c')]=_0x1355c8['id'];if(_0x114deb[_0x3326('0x43')][_0x3326('0x32')]){_0x5dc291[_0x3326('0x4e')]=_[_0x3326('0x50')](_0x5dc291['where'],{'$or':_[_0x3326('0x34')](_0x5dc291[_0x3326('0x46')],function(_0x56f787){var _0x2c6d3c={};_0x2c6d3c[_0x56f787]={'$like':'%'+_0x114deb[_0x3326('0x43')][_0x3326('0x32')]+'%'};return _0x2c6d3c;})});}_0x5dc291=_[_0x3326('0x50')]({},_0x5dc291,_0x114deb['options']);return db[_0x3326('0x6d')][_0x3326('0x27')]({'where':_0x5dc291[_0x3326('0x4e')]})[_0x3326('0x2e')](function(_0x27382b){_0x4c1690[_0x3326('0x27')]=_0x27382b;if(_0x114deb['query']['includeAll']){_0x5dc291[_0x3326('0x53')]=[{'all':!![]}];}return db[_0x3326('0x6d')][_0x3326('0x6e')](_0x5dc291);})['then'](function(_0x9de1d6){_0x4c1690[_0x3326('0x54')]=_0x9de1d6;return _0x4c1690;});}})['then'](respondWithFilteredResult(_0x3d8ad9,_0x5dc291))['catch'](handleError(_0x3d8ad9,null));};exports[_0x3326('0x6f')]=function(_0x56b143,_0x273c8f,_0x5234fe){var _0x28cd3d={'raw':!![],'where':{}};var _0x35ba7b={};var _0x229533={'count':0x0,'rows':[]};return db[_0x3326('0x3d')][_0x3326('0x6b')]({'where':{'id':_0x56b143[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x273c8f,null))[_0x3326('0x2e')](function(_0x4fe96c){if(_0x4fe96c){_0x35ba7b[_0x3326('0x42')]=_['keys'](db['CmHopperHistory'][_0x3326('0x3e')]);_0x35ba7b[_0x3326('0x43')]=_[_0x3326('0x58')](_0x56b143['query']);_0x35ba7b[_0x3326('0x44')]=_[_0x3326('0x45')](_0x35ba7b[_0x3326('0x42')],_0x35ba7b[_0x3326('0x43')]);_0x28cd3d[_0x3326('0x46')]=_[_0x3326('0x45')](_0x35ba7b[_0x3326('0x42')],qs[_0x3326('0x47')](_0x56b143[_0x3326('0x43')][_0x3326('0x47')]));_0x28cd3d[_0x3326('0x46')]=_0x28cd3d[_0x3326('0x46')][_0x3326('0x48')]?_0x28cd3d[_0x3326('0x46')]:_0x35ba7b[_0x3326('0x42')];if(!_0x56b143['query'][_0x3326('0x49')](_0x3326('0x4a'))){_0x28cd3d[_0x3326('0x4b')]=qs['limit'](_0x56b143[_0x3326('0x43')][_0x3326('0x4b')]);_0x28cd3d[_0x3326('0x25')]=qs['offset'](_0x56b143['query'][_0x3326('0x25')]);}_0x28cd3d[_0x3326('0x4c')]=qs[_0x3326('0x4d')](_0x56b143[_0x3326('0x43')][_0x3326('0x4d')]);_0x28cd3d[_0x3326('0x4e')]=qs[_0x3326('0x44')](_[_0x3326('0x4f')](_0x56b143[_0x3326('0x43')],_0x35ba7b['filters']));_0x28cd3d[_0x3326('0x4e')][_0x3326('0x6c')]=_0x4fe96c['id'];if(_0x56b143[_0x3326('0x43')][_0x3326('0x32')]){_0x28cd3d['where']=_[_0x3326('0x50')](_0x28cd3d['where'],{'$or':_['map'](_0x28cd3d[_0x3326('0x46')],function(_0x5b17e5){var _0x4e0224={};_0x4e0224[_0x5b17e5]={'$like':'%'+_0x56b143[_0x3326('0x43')]['filter']+'%'};return _0x4e0224;})});}_0x28cd3d=_['merge']({},_0x28cd3d,_0x56b143['options']);return db[_0x3326('0x70')][_0x3326('0x27')]({'where':_0x28cd3d['where']})[_0x3326('0x2e')](function(_0x1cd121){_0x229533[_0x3326('0x27')]=_0x1cd121;if(_0x56b143['query']['includeAll']){_0x28cd3d[_0x3326('0x53')]=[{'all':!![]}];}return db[_0x3326('0x70')]['findAll'](_0x28cd3d);})[_0x3326('0x2e')](function(_0x1e7128){_0x229533[_0x3326('0x54')]=_0x1e7128;return _0x229533;});}})['then'](respondWithFilteredResult(_0x273c8f,_0x28cd3d))['catch'](handleError(_0x273c8f,null));};exports[_0x3326('0x71')]=function(_0x2d3bbb,_0x449370,_0x4e1c30){var _0x51a657={'raw':!![],'where':{}};var _0x46a4e1={};var _0x21a639={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3326('0x6b')]({'where':{'id':_0x2d3bbb[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x449370,null))[_0x3326('0x2e')](function(_0x127322){if(_0x127322){_0x46a4e1['model']=_[_0x3326('0x58')](db[_0x3326('0x72')][_0x3326('0x3e')]);_0x46a4e1[_0x3326('0x43')]=_[_0x3326('0x58')](_0x2d3bbb[_0x3326('0x43')]);_0x46a4e1['filters']=_[_0x3326('0x45')](_0x46a4e1['model'],_0x46a4e1[_0x3326('0x43')]);_0x51a657[_0x3326('0x46')]=_[_0x3326('0x45')](_0x46a4e1['model'],qs[_0x3326('0x47')](_0x2d3bbb['query'][_0x3326('0x47')]));_0x51a657[_0x3326('0x46')]=_0x51a657[_0x3326('0x46')][_0x3326('0x48')]?_0x51a657[_0x3326('0x46')]:_0x46a4e1['model'];if(!_0x2d3bbb[_0x3326('0x43')][_0x3326('0x49')](_0x3326('0x4a'))){_0x51a657[_0x3326('0x4b')]=qs['limit'](_0x2d3bbb['query'][_0x3326('0x4b')]);_0x51a657[_0x3326('0x25')]=qs[_0x3326('0x25')](_0x2d3bbb[_0x3326('0x43')]['offset']);}_0x51a657[_0x3326('0x4c')]=qs[_0x3326('0x4d')](_0x2d3bbb[_0x3326('0x43')][_0x3326('0x4d')]);_0x51a657[_0x3326('0x4e')]=qs['filters'](_[_0x3326('0x4f')](_0x2d3bbb[_0x3326('0x43')],_0x46a4e1[_0x3326('0x44')]));_0x51a657[_0x3326('0x4e')][_0x3326('0x6c')]=_0x127322['id'];if(_0x2d3bbb[_0x3326('0x43')][_0x3326('0x32')]){_0x51a657[_0x3326('0x4e')]=_[_0x3326('0x50')](_0x51a657[_0x3326('0x4e')],{'$or':_[_0x3326('0x34')](_0x51a657['attributes'],function(_0x35275c){var _0x47dfcd={};_0x47dfcd[_0x35275c]={'$like':'%'+_0x2d3bbb[_0x3326('0x43')][_0x3326('0x32')]+'%'};return _0x47dfcd;})});}_0x51a657=_['merge']({},_0x51a657,_0x2d3bbb[_0x3326('0x59')]);return db['CmHopperFinal']['count']({'where':_0x51a657[_0x3326('0x4e')]})[_0x3326('0x2e')](function(_0x35752e){_0x21a639[_0x3326('0x27')]=_0x35752e;if(_0x2d3bbb[_0x3326('0x43')]['includeAll']){_0x51a657['include']=[{'all':!![]}];}return db[_0x3326('0x72')][_0x3326('0x6e')](_0x51a657);})[_0x3326('0x2e')](function(_0x1f998e){_0x21a639['rows']=_0x1f998e;return _0x21a639;});}})[_0x3326('0x2e')](respondWithFilteredResult(_0x449370,_0x51a657))[_0x3326('0x55')](handleError(_0x449370,null));};exports[_0x3326('0x73')]=function(_0x5f5bde,_0x2319bc,_0x3544b6){var _0x6e1bbc={'raw':!![],'where':{}};var _0xb876ee={};var _0x529464={'count':0x0,'rows':[]};return db[_0x3326('0x3d')][_0x3326('0x6b')]({'where':{'id':_0x5f5bde[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x2319bc,null))[_0x3326('0x2e')](function(_0x101cd4){if(_0x101cd4){_0xb876ee[_0x3326('0x42')]=_[_0x3326('0x58')](db[_0x3326('0x74')][_0x3326('0x3e')]);_0xb876ee[_0x3326('0x43')]=_['keys'](_0x5f5bde['query']);_0xb876ee[_0x3326('0x44')]=_[_0x3326('0x45')](_0xb876ee[_0x3326('0x42')],_0xb876ee['query']);_0x6e1bbc[_0x3326('0x46')]=_[_0x3326('0x45')](_0xb876ee['model'],qs['fields'](_0x5f5bde[_0x3326('0x43')][_0x3326('0x47')]));_0x6e1bbc[_0x3326('0x46')]=_0x6e1bbc[_0x3326('0x46')][_0x3326('0x48')]?_0x6e1bbc[_0x3326('0x46')]:_0xb876ee['model'];if(!_0x5f5bde[_0x3326('0x43')]['hasOwnProperty'](_0x3326('0x4a'))){_0x6e1bbc[_0x3326('0x4b')]=qs[_0x3326('0x4b')](_0x5f5bde[_0x3326('0x43')]['limit']);_0x6e1bbc[_0x3326('0x25')]=qs[_0x3326('0x25')](_0x5f5bde[_0x3326('0x43')][_0x3326('0x25')]);}_0x6e1bbc[_0x3326('0x4c')]=qs[_0x3326('0x4d')](_0x5f5bde[_0x3326('0x43')][_0x3326('0x4d')]);_0x6e1bbc[_0x3326('0x4e')]=qs[_0x3326('0x44')](_['pick'](_0x5f5bde['query'],_0xb876ee[_0x3326('0x44')]));_0x6e1bbc['where'][_0x3326('0x6c')]=_0x101cd4['id'];if(_0x5f5bde[_0x3326('0x43')][_0x3326('0x32')]){_0x6e1bbc['where']=_[_0x3326('0x50')](_0x6e1bbc['where'],{'$or':_[_0x3326('0x34')](_0x6e1bbc['attributes'],function(_0xdfeb3b){var _0xfa4516={};_0xfa4516[_0xdfeb3b]={'$like':'%'+_0x5f5bde[_0x3326('0x43')]['filter']+'%'};return _0xfa4516;})});}_0x6e1bbc=_[_0x3326('0x50')]({},_0x6e1bbc,_0x5f5bde[_0x3326('0x59')]);return db['CmHopperBlack'][_0x3326('0x27')]({'where':_0x6e1bbc[_0x3326('0x4e')]})[_0x3326('0x2e')](function(_0x5f48f9){_0x529464[_0x3326('0x27')]=_0x5f48f9;if(_0x5f5bde[_0x3326('0x43')][_0x3326('0x52')]){_0x6e1bbc[_0x3326('0x53')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x3326('0x6e')](_0x6e1bbc);})['then'](function(_0x4b0163){_0x529464[_0x3326('0x54')]=_0x4b0163;return _0x529464;});}})[_0x3326('0x2e')](respondWithFilteredResult(_0x2319bc,_0x6e1bbc))[_0x3326('0x55')](handleError(_0x2319bc,null));};exports[_0x3326('0x75')]=function(_0x9a61bc,_0x327aca,_0x111a2a){var _0x5e9d0e={};var _0x4272c5={};var _0xd40032;var _0x306714;return db[_0x3326('0x3d')][_0x3326('0x6b')]({'where':{'id':_0x9a61bc['params']['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x327aca,null))[_0x3326('0x2e')](function(_0x2e1c1f){if(_0x2e1c1f){_0xd40032=_0x2e1c1f;_0x4272c5[_0x3326('0x42')]=_[_0x3326('0x58')](db['Team'][_0x3326('0x3e')]);_0x4272c5[_0x3326('0x43')]=_[_0x3326('0x58')](_0x9a61bc[_0x3326('0x43')]);_0x4272c5['filters']=_[_0x3326('0x45')](_0x4272c5[_0x3326('0x42')],_0x4272c5[_0x3326('0x43')]);_0x5e9d0e['attributes']=_['intersection'](_0x4272c5[_0x3326('0x42')],qs[_0x3326('0x47')](_0x9a61bc[_0x3326('0x43')][_0x3326('0x47')]));_0x5e9d0e[_0x3326('0x46')]=_0x5e9d0e['attributes']['length']?_0x5e9d0e[_0x3326('0x46')]:_0x4272c5[_0x3326('0x42')];_0x5e9d0e[_0x3326('0x4c')]=qs[_0x3326('0x4d')](_0x9a61bc[_0x3326('0x43')][_0x3326('0x4d')]);_0x5e9d0e['where']=qs[_0x3326('0x44')](_['pick'](_0x9a61bc[_0x3326('0x43')],_0x4272c5[_0x3326('0x44')]));if(_0x9a61bc[_0x3326('0x43')][_0x3326('0x32')]){_0x5e9d0e[_0x3326('0x4e')]=_[_0x3326('0x50')](_0x5e9d0e[_0x3326('0x4e')],{'$or':_[_0x3326('0x34')](_0x5e9d0e[_0x3326('0x46')],function(_0x3f200d){var _0x21c651={};_0x21c651[_0x3f200d]={'$like':'%'+_0x9a61bc[_0x3326('0x43')][_0x3326('0x32')]+'%'};return _0x21c651;})});}_0x5e9d0e=_[_0x3326('0x50')]({},_0x5e9d0e,_0x9a61bc[_0x3326('0x59')]);return _0xd40032['getTeams'](_0x5e9d0e);}})['then'](function(_0x319775){if(_0x319775){_0x306714=_0x319775['length'];if(!_0x9a61bc[_0x3326('0x43')][_0x3326('0x49')](_0x3326('0x4a'))){_0x5e9d0e[_0x3326('0x4b')]=qs[_0x3326('0x4b')](_0x9a61bc['query'][_0x3326('0x4b')]);_0x5e9d0e['offset']=qs['offset'](_0x9a61bc[_0x3326('0x43')][_0x3326('0x25')]);}return _0xd40032[_0x3326('0x75')](_0x5e9d0e);}})[_0x3326('0x2e')](function(_0x238267){if(_0x238267){return _0x238267?{'count':_0x306714,'rows':_0x238267}:null;}})[_0x3326('0x2e')](respondWithResult(_0x327aca,null))['catch'](handleError(_0x327aca,null));};exports['addTeams']=function(_0x43f5b2,_0x5879de,_0x474f2e){var _0x465638=_0x43f5b2['body']['teams'];var _0x320918=_[_0x3326('0x34')](_0x465638,'id');return db[_0x3326('0x76')][_0x3326('0x6e')]({'where':{'id':_0x320918},'attributes':['id'],'include':[{'model':db[_0x3326('0x77')],'as':_0x3326('0x78'),'attributes':['id',_0x3326('0x38'),_0x3326('0x79'),_0x3326('0x7a'),'interface'],'raw':!![]}]})[_0x3326('0x2e')](function(_0x5a9c43){if(_0x5a9c43){var _0x35f777=_[_0x3326('0x7b')](_0x5a9c43,function(_0x9088c6){var _0x4b8fb5=_0x9088c6['get']({'plain':!![]});_0x4b8fb5[_0x3326('0x78')][_0x3326('0x7c')](function(_0x5e5acf){_0x5e5acf['penalty']=_['find'](_0x465638,{'id':_0x4b8fb5['id']})[_0x3326('0x7d')];});return _0x4b8fb5['Agents'];});return db['VoiceQueue'][_0x3326('0x37')]({'where':{'id':_0x43f5b2[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](function(_0x271298){return db[_0x3326('0x7e')][_0x3326('0x7f')](function(_0x4c7f01){return _0x271298[_0x3326('0x80')](_0x320918,{'transaction':_0x4c7f01})[_0x3326('0x2e')](function(){return BPromise[_0x3326('0x81')](_0x465638,function(_0x39e7f4){return db[_0x3326('0x82')]['upsert']({'TeamId':_0x39e7f4['id'],'VoiceQueueId':_0x43f5b2[_0x3326('0x57')]['id'],'penalty':_0x39e7f4['penalty']},{'transaction':_0x4c7f01});});})[_0x3326('0x2e')](function(){return BPromise['each'](_0x35f777,function(_0x4770f7){return db[_0x3326('0x83')][_0x3326('0x84')]({'where':{'UserId':_0x4770f7['id'],'VoiceQueueId':_0x43f5b2[_0x3326('0x57')]['id']},'defaults':{'penalty':_0x4770f7[_0x3326('0x7d')]},'transaction':_0x4c7f01});});})[_0x3326('0x2e')](function(){return BPromise[_0x3326('0x81')](_[_0x3326('0x32')](_0x35f777,{'online':!![]}),function(_0x15f127){return db[_0x3326('0x85')][_0x3326('0x86')]({'membername':_0x15f127[_0x3326('0x38')],'UserId':_0x15f127['id'],'queue_name':_0x271298[_0x3326('0x38')],'VoiceQueueId':_0x271298['id'],'interface':_[_0x3326('0x87')](_0x15f127[_0x3326('0x88')])?util['format'](_0x3326('0x89'),_0x15f127[_0x3326('0x38')]):_0x15f127[_0x3326('0x88')],'paused':_0x15f127[_0x3326('0x7a')]||![],'penalty':_0x15f127['penalty']},{'transaction':_0x4c7f01});});})[_0x3326('0x2e')](function(){_0x35f777[_0x3326('0x7c')](function(_0x58cce1){socket['emit'](_0x3326('0x8a'),{'UserId':_0x58cce1['id'],'VoiceQueueId':_0x271298['id']});});});});});}})['then'](respondWithStatusCode(_0x5879de,null))[_0x3326('0x55')](handleError(_0x5879de,null));};exports[_0x3326('0x8b')]=function(_0x19d18d,_0x3c6b11,_0x1f2cec){return db[_0x3326('0x76')][_0x3326('0x6e')]({'where':{'id':_0x19d18d[_0x3326('0x43')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3326('0x77')],'as':_0x3326('0x78'),'attributes':['id'],'raw':!![]}]})[_0x3326('0x2e')](handleEntityNotFound(_0x3c6b11,null))[_0x3326('0x2e')](function(_0x4f8810){var _0x5ee227=_[_0x3326('0x34')](_0x4f8810,'id');var _0x50b164=[];var _0x50f18f=[];var _0x1d7206=squel['select']();_0x1d7206['field'](_0x3326('0x8c'))[_0x3326('0x8d')]('team_has_voice_queues','tq')[_0x3326('0x8e')]('user_has_teams','ut',_0x3326('0x8f'))['where'](_0x3326('0x90'),_0x19d18d['params']['id']);for(var _0x2d1490=0x0;_0x2d1490<_0x4f8810[_0x3326('0x48')];_0x2d1490+=0x1){let _0x3c84a5=_0x4f8810[_0x2d1490];for(var _0x17aedf=0x0;_0x17aedf<_0x3c84a5[_0x3326('0x78')][_0x3326('0x48')];_0x17aedf+=0x1){let _0x38152d=_0x3c84a5[_0x3326('0x78')][_0x17aedf];var _0x1cebcf=_0x1d7206['clone']();_0x1cebcf['where'](_0x3326('0x91'),_0x38152d['id']);_0x50f18f[_0x3326('0x92')](db['sequelize'][_0x3326('0x43')](_0x1cebcf['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x3326('0x2e')](function(_0x235163){if(_0x235163[_0x3326('0x48')]===0x1){return _0x38152d['id'];}else{var _0x1e50d4=_[_0x3326('0x93')](_[_0x3326('0x34')](_0x235163,_0x3326('0x94')),function(_0x5b9bd7){return _[_0x3326('0x36')](_0x5ee227,_0x5b9bd7);});if(_0x1e50d4){return _0x38152d['id'];}}}));}}return BPromise[_0x3326('0x95')](_0x50f18f)[_0x3326('0x2e')](function(_0x274408){_0x50b164=_(_0x50b164)[_0x3326('0x96')](_0x274408)[_0x3326('0x97')]()[_0x3326('0x35')]();return db[_0x3326('0x3d')]['find']({'where':{'id':_0x19d18d[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](function(_0x5d3e95){return db[_0x3326('0x7e')][_0x3326('0x7f')](function(_0x3fb408){return _0x5d3e95[_0x3326('0x8b')](_0x19d18d[_0x3326('0x43')][_0x3326('0x98')],{'transaction':_0x3fb408})[_0x3326('0x2e')](function(){if(!_['isEmpty'](_0x50b164)){return _0x5d3e95['removeAgents'](_0x50b164,{'transaction':_0x3fb408})[_0x3326('0x2e')](function(){return db['UserVoiceQueueRt'][_0x3326('0x2f')]({'where':{'VoiceQueueId':_0x19d18d[_0x3326('0x57')]['id'],'UserId':_0x50b164},'transaction':_0x3fb408});});}})[_0x3326('0x2e')](function(){_0x50b164['forEach'](function(_0x3bc3aa){socket[_0x3326('0x99')](_0x3326('0x9a'),{'UserId':_0x3bc3aa,'VoiceQueueId':_0x5d3e95['id']});});});});});});})[_0x3326('0x2e')](respondWithStatusCode(_0x3c6b11,null))['catch'](handleError(_0x3c6b11,null));};exports['addAgents']=function(_0x3847dd,_0x412f64,_0x1907bb){var _0x1054ef,_0xb09414;return db[_0x3326('0x3d')][_0x3326('0x37')]({'where':{'id':_0x3847dd['params']['id']}})['then'](handleEntityNotFound(_0x412f64,null))[_0x3326('0x2e')](function(_0x4cbce7){if(_0x4cbce7){_0xb09414=_0x4cbce7;return _0x4cbce7['addAgents'](_0x3847dd['body'][_0x3326('0x98')],_[_0x3326('0x65')](_0x3847dd['body'],[_0x3326('0x98'),'id'])||{})[_0x3326('0x9b')](function(_0x98cb73){for(var _0x56cdba=0x0;_0x56cdba<_0x3847dd[_0x3326('0x5b')][_0x3326('0x98')][_0x3326('0x48')];_0x56cdba+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x3847dd[_0x3326('0x5b')][_0x3326('0x98')][_0x56cdba]),'VoiceQueueId':Number(_0x3847dd[_0x3326('0x57')]['id'])});}return _0x98cb73;});}})['then'](function(_0x54a70b){_0x1054ef=_0x54a70b||[];if(_0xb09414){return db['User'][_0x3326('0x6e')]({'where':{'id':_0x3847dd[_0x3326('0x5b')][_0x3326('0x98')]},'attributes':['id',_0x3326('0x38'),_0x3326('0x79'),_0x3326('0x7a'),'interface'],'raw':!![]});}})[_0x3326('0x2e')](function(_0xc898b8){if(!_[_0x3326('0x9c')](_0xc898b8)){var _0x1eacae=[];for(var _0x5ce2a6=0x0;_0x5ce2a6<_0xc898b8[_0x3326('0x48')];_0x5ce2a6++){if(_0xc898b8[_0x5ce2a6][_0x3326('0x79')]){_0x1eacae[_0x3326('0x92')](db[_0x3326('0x85')][_0x3326('0x86')]({'membername':_0xc898b8[_0x5ce2a6][_0x3326('0x38')],'UserId':_0xc898b8[_0x5ce2a6]['id'],'queue_name':_0xb09414[_0x3326('0x38')],'VoiceQueueId':_0xb09414['id'],'interface':_[_0x3326('0x87')](_0xc898b8[_0x5ce2a6]['interface'])?util[_0x3326('0x9d')](_0x3326('0x89'),_0xc898b8[_0x5ce2a6]['name']):_0xc898b8[_0x5ce2a6]['interface'],'paused':_0xc898b8[_0x5ce2a6][_0x3326('0x7a')]||![],'penalty':_0x3847dd['body'][_0x3326('0x7d')]||0x0}));}}return BPromise[_0x3326('0x95')](_0x1eacae);}})[_0x3326('0x2e')](function(){return _0x1054ef;})[_0x3326('0x2e')](respondWithResult(_0x412f64,null))[_0x3326('0x55')](handleError(_0x412f64,null));};exports[_0x3326('0x9e')]=function(_0x528a9f,_0x2b9014,_0x2033db){return db[_0x3326('0x3d')][_0x3326('0x37')]({'where':{'id':_0x528a9f[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x2b9014,null))[_0x3326('0x2e')](function(_0x49a8e3){if(_0x49a8e3){return _0x49a8e3[_0x3326('0x9e')](_0x528a9f['query']['ids'])['then'](function(){if(_[_0x3326('0x9f')](_0x528a9f['query'][_0x3326('0x98')])){for(var _0x49d569=0x0;_0x49d569<_0x528a9f['query']['ids'][_0x3326('0x48')];_0x49d569+=0x1){socket[_0x3326('0x99')](_0x3326('0x9a'),{'UserId':Number(_0x528a9f[_0x3326('0x43')]['ids'][_0x49d569]),'VoiceQueueId':Number(_0x528a9f[_0x3326('0x57')]['id'])});}}else{socket[_0x3326('0x99')](_0x3326('0x9a'),{'UserId':Number(_0x528a9f['query']['ids']),'VoiceQueueId':Number(_0x528a9f[_0x3326('0x57')]['id'])});}});}})[_0x3326('0x2e')](function(_0x251bee){return db[_0x3326('0x85')]['destroy']({'where':{'VoiceQueueId':_0x528a9f[_0x3326('0x57')]['id'],'UserId':_0x528a9f[_0x3326('0x43')][_0x3326('0x98')]}})[_0x3326('0x2e')](function(){return _0x251bee;});})['then'](respondWithStatusCode(_0x2b9014,null))['catch'](handleError(_0x2b9014,null));};exports['getAgents']=function(_0x4826e2,_0x1a2d87,_0x2514c8){var _0x1d9f7a={};var _0x206e41={};var _0x32826c;var _0x3aadff;return db[_0x3326('0x3d')][_0x3326('0x6b')]({'where':{'id':_0x4826e2[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x1a2d87,null))['then'](function(_0x1f79b7){if(_0x1f79b7){_0x32826c=_0x1f79b7;_0x206e41[_0x3326('0x42')]=_[_0x3326('0x58')](db[_0x3326('0x77')][_0x3326('0x3e')]);_0x206e41[_0x3326('0x43')]=_['keys'](_0x4826e2[_0x3326('0x43')]);_0x206e41['filters']=_[_0x3326('0x45')](_0x206e41[_0x3326('0x42')],_0x206e41[_0x3326('0x43')]);_0x1d9f7a[_0x3326('0x46')]=_[_0x3326('0x45')](_0x206e41[_0x3326('0x42')],qs['fields'](_0x4826e2[_0x3326('0x43')]['fields']));_0x1d9f7a['attributes']=_0x1d9f7a[_0x3326('0x46')][_0x3326('0x48')]?_0x1d9f7a['attributes']:_0x206e41[_0x3326('0x42')];_0x1d9f7a['order']=qs['sort'](_0x4826e2['query'][_0x3326('0x4d')]);_0x1d9f7a[_0x3326('0x4e')]=qs['filters'](_[_0x3326('0x4f')](_0x4826e2[_0x3326('0x43')],_0x206e41[_0x3326('0x44')]));if(_0x4826e2[_0x3326('0x43')]['filter']){_0x1d9f7a[_0x3326('0x4e')]=_[_0x3326('0x50')](_0x1d9f7a[_0x3326('0x4e')],{'$or':_[_0x3326('0x34')](_0x1d9f7a[_0x3326('0x46')],function(_0x3e1a52){var _0x5c9aa2={};_0x5c9aa2[_0x3e1a52]={'$like':'%'+_0x4826e2[_0x3326('0x43')][_0x3326('0x32')]+'%'};return _0x5c9aa2;})});}_0x1d9f7a=_[_0x3326('0x50')]({},_0x1d9f7a,_0x4826e2[_0x3326('0x59')]);return _0x32826c['getAgents'](_0x1d9f7a);}})[_0x3326('0x2e')](function(_0x3ebec5){if(_0x3ebec5){_0x3aadff=_0x3ebec5[_0x3326('0x48')];if(!_0x4826e2['query'][_0x3326('0x49')](_0x3326('0x4a'))){_0x1d9f7a[_0x3326('0x4b')]=qs[_0x3326('0x4b')](_0x4826e2[_0x3326('0x43')][_0x3326('0x4b')]);_0x1d9f7a[_0x3326('0x25')]=qs[_0x3326('0x25')](_0x4826e2[_0x3326('0x43')]['offset']);}return _0x32826c[_0x3326('0xa0')](_0x1d9f7a);}})[_0x3326('0x2e')](function(_0x27f2f0){if(_0x27f2f0){return _0x27f2f0?{'count':_0x3aadff,'rows':_0x27f2f0}:null;}})['then'](respondWithResult(_0x1a2d87,null))[_0x3326('0x55')](handleError(_0x1a2d87,null));};exports[_0x3326('0xa1')]=function(_0x4e6a25,_0x18b57e,_0x5bceeb){var _0x4235c4={};var _0xd4df2d={};var _0x1e47f9;var _0x245a25;return db[_0x3326('0x3d')][_0x3326('0x6b')]({'where':{'id':_0x4e6a25['params']['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x18b57e,null))[_0x3326('0x2e')](function(_0x1c449c){if(_0x1c449c){_0x1e47f9=_0x1c449c;_0xd4df2d[_0x3326('0x42')]=_[_0x3326('0x58')](db['UserVoiceQueueRt']['rawAttributes']);_0xd4df2d[_0x3326('0x43')]=_[_0x3326('0x58')](_0x4e6a25[_0x3326('0x43')]);_0xd4df2d[_0x3326('0x44')]=_['intersection'](_0xd4df2d[_0x3326('0x42')],_0xd4df2d['query']);_0x4235c4[_0x3326('0x46')]=_['intersection'](_0xd4df2d['model'],qs['fields'](_0x4e6a25[_0x3326('0x43')][_0x3326('0x47')]));_0x4235c4[_0x3326('0x46')]=_0x4235c4['attributes'][_0x3326('0x48')]?_0x4235c4['attributes']:_0xd4df2d['model'];_0x4235c4[_0x3326('0x4c')]=qs[_0x3326('0x4d')](_0x4e6a25['query'][_0x3326('0x4d')]);_0x4235c4['where']=qs[_0x3326('0x44')](_[_0x3326('0x4f')](_0x4e6a25[_0x3326('0x43')],_0xd4df2d[_0x3326('0x44')]));if(_0x4e6a25[_0x3326('0x43')][_0x3326('0x32')]){_0x4235c4['where']=_[_0x3326('0x50')](_0x4235c4[_0x3326('0x4e')],{'$or':_[_0x3326('0x34')](_0x4235c4[_0x3326('0x46')],function(_0x29f296){var _0x390349={};_0x390349[_0x29f296]={'$like':'%'+_0x4e6a25[_0x3326('0x43')][_0x3326('0x32')]+'%'};return _0x390349;})});}_0x4235c4=_['merge']({},_0x4235c4,_0x4e6a25[_0x3326('0x59')]);return _0x1e47f9['getMembers'](_0x4235c4);}})[_0x3326('0x2e')](function(_0x1d7e53){if(_0x1d7e53){_0x245a25=_0x1d7e53[_0x3326('0x48')];if(!_0x4e6a25['query'][_0x3326('0x49')](_0x3326('0x4a'))){_0x4235c4[_0x3326('0x4b')]=qs[_0x3326('0x4b')](_0x4e6a25[_0x3326('0x43')][_0x3326('0x4b')]);_0x4235c4[_0x3326('0x25')]=qs['offset'](_0x4e6a25['query'][_0x3326('0x25')]);}return _0x1e47f9[_0x3326('0xa1')](_0x4235c4);}})[_0x3326('0x2e')](function(_0x52cc58){return _0x52cc58?{'count':_0x245a25,'rows':_0x52cc58}:null;})[_0x3326('0x2e')](respondWithResult(_0x18b57e,null))[_0x3326('0x55')](handleError(_0x18b57e,null));};exports[_0x3326('0xa2')]=function(_0x3b9b0b,_0x51420c,_0x3b0ef4){var _0x43b828={};var _0x2e6c3b={};var _0x23fcfa;var _0x374cf4;return db[_0x3326('0x3d')][_0x3326('0x6b')]({'where':{'id':_0x3b9b0b[_0x3326('0x57')]['id']}})['then'](handleEntityNotFound(_0x51420c,null))[_0x3326('0x2e')](function(_0xc3eb44){if(_0xc3eb44){_0x23fcfa=_0xc3eb44;_0x2e6c3b[_0x3326('0x42')]=_[_0x3326('0x58')](db[_0x3326('0xa3')]['rawAttributes']);_0x2e6c3b[_0x3326('0x43')]=_['keys'](_0x3b9b0b['query']);_0x2e6c3b[_0x3326('0x44')]=_[_0x3326('0x45')](_0x2e6c3b['model'],_0x2e6c3b[_0x3326('0x43')]);_0x43b828[_0x3326('0x46')]=_['intersection'](_0x2e6c3b[_0x3326('0x42')],qs[_0x3326('0x47')](_0x3b9b0b['query'][_0x3326('0x47')]));_0x43b828[_0x3326('0x46')]=_0x43b828[_0x3326('0x46')][_0x3326('0x48')]?_0x43b828[_0x3326('0x46')]:_0x2e6c3b['model'];_0x43b828[_0x3326('0x4c')]=qs['sort'](_0x3b9b0b[_0x3326('0x43')][_0x3326('0x4d')]);_0x43b828[_0x3326('0x4e')]=qs[_0x3326('0x44')](_[_0x3326('0x4f')](_0x3b9b0b[_0x3326('0x43')],_0x2e6c3b[_0x3326('0x44')]));if(_0x3b9b0b[_0x3326('0x43')][_0x3326('0x32')]){_0x43b828[_0x3326('0x4e')]=_[_0x3326('0x50')](_0x43b828[_0x3326('0x4e')],{'$or':_['map'](_0x43b828['attributes'],function(_0x3a8f56){var _0x33c69d={};_0x33c69d[_0x3a8f56]={'$like':'%'+_0x3b9b0b[_0x3326('0x43')][_0x3326('0x32')]+'%'};return _0x33c69d;})});}_0x43b828=_[_0x3326('0x50')]({},_0x43b828,_0x3b9b0b[_0x3326('0x59')]);return _0x23fcfa[_0x3326('0xa2')](_0x43b828);}})[_0x3326('0x2e')](function(_0x378cbf){if(_0x378cbf){_0x374cf4=_0x378cbf[_0x3326('0x48')];if(!_0x3b9b0b['query']['hasOwnProperty'](_0x3326('0x4a'))){_0x43b828['limit']=qs[_0x3326('0x4b')](_0x3b9b0b[_0x3326('0x43')][_0x3326('0x4b')]);_0x43b828[_0x3326('0x25')]=qs[_0x3326('0x25')](_0x3b9b0b['query'][_0x3326('0x25')]);}return _0x23fcfa['getLists'](_0x43b828);}})[_0x3326('0x2e')](function(_0x49a835){if(_0x49a835){return _0x49a835?{'count':_0x374cf4,'rows':_0x49a835}:null;}})[_0x3326('0x2e')](respondWithResult(_0x51420c,null))[_0x3326('0x55')](handleError(_0x51420c,null));};exports[_0x3326('0xa4')]=function(_0xce651a,_0xdd2d71,_0x52be27){var _0x338db7,_0x55ee7c;return db[_0x3326('0x3d')]['find']({'where':{'id':_0xce651a['params']['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0xdd2d71,null))['then'](function(_0x189eb0){if(_0x189eb0){_0x55ee7c=_0x189eb0;return _0x189eb0[_0x3326('0xa4')](_0xce651a[_0x3326('0x5b')][_0x3326('0x98')],_[_0x3326('0x65')](_0xce651a[_0x3326('0x5b')],['ids','id'])||{});}return null;})[_0x3326('0x9b')](function(_0x22b7a8){var _0x3031f0;_0x338db7=_0x22b7a8||[];var _0x16e7d4=[];if(_0x22b7a8){for(var _0x55109a=0x0;_0x55109a<_0x22b7a8[_0x3326('0x48')];_0x55109a+=0x1){var _0x732fc4=_0x22b7a8[_0x55109a][_0x3326('0x5d')]({'plain':!![]});_0x55ee7c[_0x3326('0xa5')]=_0xce651a[_0x3326('0x5b')][_0x3326('0xa5')]?_0xce651a[_0x3326('0x5b')][_0x3326('0xa5')]:_0x55ee7c[_0x3326('0xa5')];switch(_0x55ee7c['dialCheckDuplicateType']){case _0x3326('0xa6'):_0x3031f0=squel[_0x3326('0xa7')]()[_0x3326('0xa8')]('cm_hopper')['fromQuery']([_0x3326('0xa9'),_0x3326('0xaa'),_0x3326('0xab'),'ListId','VoiceQueueId',_0x3326('0x66'),_0x3326('0x67')],squel[_0x3326('0xac')]()[_0x3326('0xad')](_0x3326('0xa9'),'phone')[_0x3326('0xad')]('NOW()','scheduledAt')[_0x3326('0xad')]('id',_0x3326('0xab'))[_0x3326('0xad')](_0x732fc4[_0x3326('0xae')][_0x3326('0xaf')](),_0x3326('0xb0'))[_0x3326('0xad')](_0xce651a[_0x3326('0x57')]['id'][_0x3326('0xaf')](),_0x3326('0x6c'))[_0x3326('0xad')](_0x3326('0xb1'),_0x3326('0x66'))['field'](_0x3326('0xb1'),'updatedAt')[_0x3326('0x8d')](_0x3326('0xb2'))[_0x3326('0x4e')](_0x3326('0xb3'))[_0x3326('0x4e')](_0x3326('0xb4'),_0x732fc4[_0x3326('0xae')][_0x3326('0xaf')]())['where'](_0x3326('0xb5'))[_0x3326('0x4e')](_0x3326('0xb6'),squel[_0x3326('0xac')]()[_0x3326('0xad')](_0x3326('0xb7'))[_0x3326('0x8d')](_0x3326('0xb8'))[_0x3326('0x4e')]('VoiceQueueId\x20=\x20?',_0xce651a[_0x3326('0x57')]['id']['toString']()))[_0x3326('0x4e')](_0x3326('0xb6'),squel['select']()[_0x3326('0xad')](_0x3326('0xb9'))['from'](_0x3326('0xba'))[_0x3326('0x4e')](_0x3326('0x90'),_0xce651a['params']['id'][_0x3326('0xaf')]())))[_0x3326('0xaf')]();break;case _0x3326('0xbb'):_0x3031f0=squel[_0x3326('0xa7')]()['into'](_0x3326('0xba'))[_0x3326('0xbc')]([_0x3326('0xa9'),_0x3326('0xaa'),'ContactId','ListId',_0x3326('0x6c'),_0x3326('0x66'),_0x3326('0x67')],squel[_0x3326('0xac')]()[_0x3326('0xad')]('phone','phone')[_0x3326('0xad')](_0x3326('0xb1'),_0x3326('0xaa'))[_0x3326('0xad')]('id',_0x3326('0xab'))[_0x3326('0xad')](_0x732fc4[_0x3326('0xae')]['toString'](),'ListId')[_0x3326('0xad')](_0xce651a[_0x3326('0x57')]['id'][_0x3326('0xaf')](),_0x3326('0x6c'))['field'](_0x3326('0xb1'),'createdAt')['field'](_0x3326('0xb1'),'updatedAt')['from'](_0x3326('0xb2'))[_0x3326('0x4e')]('deletedAt\x20IS\x20NULL')[_0x3326('0x4e')](_0x3326('0xb4'),_0x732fc4[_0x3326('0xae')]['toString']())[_0x3326('0x4e')](_0x3326('0xb5'))[_0x3326('0x4e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3326('0xac')]()['field']('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x3326('0x4e')](_0x3326('0x90'),_0xce651a[_0x3326('0x57')]['id'][_0x3326('0xaf')]())))[_0x3326('0xaf')]();break;default:_0x3031f0=squel[_0x3326('0xa7')]()['into'](_0x3326('0xba'))['fromQuery']([_0x3326('0xa9'),_0x3326('0xaa'),_0x3326('0xab'),_0x3326('0xb0'),_0x3326('0x6c'),'createdAt',_0x3326('0x67')],squel['select']()['field'](_0x3326('0xa9'),_0x3326('0xa9'))[_0x3326('0xad')](_0x3326('0xb1'),_0x3326('0xaa'))['field']('id',_0x3326('0xab'))[_0x3326('0xad')](_0x732fc4[_0x3326('0xae')][_0x3326('0xaf')](),_0x3326('0xb0'))['field'](_0xce651a[_0x3326('0x57')]['id'][_0x3326('0xaf')](),_0x3326('0x6c'))['field']('NOW()',_0x3326('0x66'))[_0x3326('0xad')](_0x3326('0xb1'),_0x3326('0x67'))[_0x3326('0x8d')](_0x3326('0xb2'))[_0x3326('0x4e')](_0x3326('0xb3'))['where']('ListId\x20=\x20?',_0x732fc4[_0x3326('0xae')][_0x3326('0xaf')]())[_0x3326('0x4e')]('phone\x20IS\x20NOT\x20NULL'))[_0x3326('0xaf')]();}_0x16e7d4['push'](db[_0x3326('0x7e')][_0x3326('0x43')](_0x3031f0));}return BPromise[_0x3326('0x95')](_0x16e7d4);}})['then'](function(){return _0x338db7;})[_0x3326('0x2e')](respondWithResult(_0xdd2d71,null))['catch'](handleError(_0xdd2d71,null));};exports[_0x3326('0xbd')]=function(_0x5e1ba3,_0x1708d0,_0x33dc25){return db['VoiceQueue'][_0x3326('0x37')]({'where':{'id':_0x5e1ba3[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x1708d0,null))[_0x3326('0x2e')](function(_0x30299e){if(_0x30299e){return _0x30299e['removeLists'](_0x5e1ba3[_0x3326('0x43')]['ids']);}})['then'](function(_0x2e40cb){if(_0x2e40cb){return db[_0x3326('0x6d')][_0x3326('0x2f')]({'where':{'ListId':_0x5e1ba3[_0x3326('0x43')]['ids'],'VoiceQueueId':_0x5e1ba3['params']['id']}})[_0x3326('0x2e')](function(){return _0x2e40cb;});}})[_0x3326('0x2e')](respondWithStatusCode(_0x1708d0,null))[_0x3326('0x55')](handleError(_0x1708d0,null));};exports[_0x3326('0xbe')]=function(_0xae038c,_0x3bd048,_0x3f53fd){var _0x33707b={};var _0x46957e={};var _0x76ba60;var _0x2e4efe;return db[_0x3326('0x3d')][_0x3326('0x6b')]({'where':{'id':_0xae038c[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x3bd048,null))[_0x3326('0x2e')](function(_0x3aa92c){if(_0x3aa92c){_0x76ba60=_0x3aa92c;_0x46957e['model']=_[_0x3326('0x58')](db['CmList']['rawAttributes']);_0x46957e[_0x3326('0x43')]=_['keys'](_0xae038c[_0x3326('0x43')]);_0x46957e['filters']=_[_0x3326('0x45')](_0x46957e[_0x3326('0x42')],_0x46957e['query']);_0x33707b[_0x3326('0x46')]=_[_0x3326('0x45')](_0x46957e[_0x3326('0x42')],qs[_0x3326('0x47')](_0xae038c[_0x3326('0x43')][_0x3326('0x47')]));_0x33707b[_0x3326('0x46')]=_0x33707b[_0x3326('0x46')]['length']?_0x33707b[_0x3326('0x46')]:_0x46957e['model'];_0x33707b[_0x3326('0x4c')]=qs[_0x3326('0x4d')](_0xae038c['query']['sort']);_0x33707b[_0x3326('0x4e')]=qs['filters'](_[_0x3326('0x4f')](_0xae038c[_0x3326('0x43')],_0x46957e[_0x3326('0x44')]));if(_0xae038c['query'][_0x3326('0x32')]){_0x33707b[_0x3326('0x4e')]=_[_0x3326('0x50')](_0x33707b[_0x3326('0x4e')],{'$or':_[_0x3326('0x34')](_0x33707b['attributes'],function(_0x358b52){var _0x315b65={};_0x315b65[_0x358b52]={'$like':'%'+_0xae038c[_0x3326('0x43')][_0x3326('0x32')]+'%'};return _0x315b65;})});}_0x33707b=_[_0x3326('0x50')]({},_0x33707b,_0xae038c[_0x3326('0x59')]);return _0x76ba60[_0x3326('0xbe')](_0x33707b);}})[_0x3326('0x2e')](function(_0x459509){if(_0x459509){_0x2e4efe=_0x459509['length'];if(!_0xae038c[_0x3326('0x43')][_0x3326('0x49')](_0x3326('0x4a'))){_0x33707b[_0x3326('0x4b')]=qs[_0x3326('0x4b')](_0xae038c[_0x3326('0x43')][_0x3326('0x4b')]);_0x33707b[_0x3326('0x25')]=qs[_0x3326('0x25')](_0xae038c['query'][_0x3326('0x25')]);}return _0x76ba60[_0x3326('0xbe')](_0x33707b);}})[_0x3326('0x2e')](function(_0x1eff94){if(_0x1eff94){return _0x1eff94?{'count':_0x2e4efe,'rows':_0x1eff94}:null;}})[_0x3326('0x2e')](respondWithResult(_0x3bd048,null))[_0x3326('0x55')](handleError(_0x3bd048,null));};exports[_0x3326('0xbf')]=function(_0x4ad000,_0x17d2ee,_0xa62972){var _0x357c6e,_0x3498d9;return db[_0x3326('0x3d')]['find']({'where':{'id':_0x4ad000['params']['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x17d2ee,null))[_0x3326('0x2e')](function(_0x2f5a0c){if(_0x2f5a0c){_0x3498d9=_0x2f5a0c;return _0x2f5a0c[_0x3326('0xbf')](_0x4ad000[_0x3326('0x5b')][_0x3326('0x98')],_[_0x3326('0x65')](_0x4ad000[_0x3326('0x5b')],[_0x3326('0x98'),'id'])||{});}return null;})['spread'](function(_0x333ee3){var _0x3e4372;_0x357c6e=_0x333ee3||[];var _0x3e0d49=[];if(_0x333ee3){for(var _0x337627=0x0;_0x337627<_0x333ee3[_0x3326('0x48')];_0x337627+=0x1){var _0xe14545=_0x333ee3[_0x337627][_0x3326('0x5d')]({'plain':!![]});_0x3e4372=squel['insert']()[_0x3326('0xa8')]('cm_hopper_black')['fromQuery']([_0x3326('0xa9'),'ContactId',_0x3326('0xb0'),_0x3326('0x6c'),_0x3326('0x66'),_0x3326('0x67')],squel[_0x3326('0xac')]()[_0x3326('0xad')](_0x3326('0xa9'),_0x3326('0xa9'))['field']('id',_0x3326('0xab'))[_0x3326('0xad')](_0xe14545['CmListId']['toString'](),'ListId')[_0x3326('0xad')](_0x4ad000['params']['id'][_0x3326('0xaf')](),'VoiceQueueId')[_0x3326('0xad')](_0x3326('0xb1'),_0x3326('0x66'))['field'](_0x3326('0xb1'),'updatedAt')[_0x3326('0x8d')]('cm_contacts')['where'](_0x3326('0xb3'))['where'](_0x3326('0xb4'),_0xe14545[_0x3326('0xae')][_0x3326('0xaf')]())[_0x3326('0x4e')](_0x3326('0xb5')))[_0x3326('0xaf')]();_0x3e0d49['push'](db[_0x3326('0x7e')]['query'](_0x3e4372));}return BPromise[_0x3326('0x95')](_0x3e0d49);}})[_0x3326('0x2e')](function(){return _0x357c6e;})['then'](respondWithResult(_0x17d2ee,null))[_0x3326('0x55')](handleError(_0x17d2ee,null));};exports['removeBlackLists']=function(_0x7c04a,_0x1a7925,_0x1eba9d){return db[_0x3326('0x3d')][_0x3326('0x37')]({'where':{'id':_0x7c04a[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](handleEntityNotFound(_0x1a7925,null))[_0x3326('0x2e')](function(_0x1e8c67){if(_0x1e8c67){return _0x1e8c67['removeBlackLists'](_0x7c04a[_0x3326('0x43')]['ids']);}})[_0x3326('0x2e')](function(_0x4876b3){if(_0x4876b3){return db[_0x3326('0x74')][_0x3326('0x2f')]({'where':{'ListId':_0x7c04a[_0x3326('0x43')][_0x3326('0x98')],'VoiceQueueId':_0x7c04a[_0x3326('0x57')]['id']}})[_0x3326('0x2e')](function(){return _0x4876b3;});}})['then'](respondWithStatusCode(_0x1a7925,null))[_0x3326('0x55')](handleError(_0x1a7925,null));}; \ No newline at end of file +var _0xd1df=['index','rawAttributes','fieldName','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','VoiceQueue','include','catch','show','params','keys','includeAll','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','getHoppers','findOne','hasOwnProperty','VoiceQueueId','CmHopper','findAll','getHopperHistories','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','online','voicePause','interface','flatMap','Agents','penalty','sequelize','transaction','upsert','each','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','emit','ids','User','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','isArray','getAgents','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','ListId\x20=\x20?','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','VoiceQueues','inbound','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','sendStatus','stack'];(function(_0x25e0f0,_0x107a89){var _0x4b75c2=function(_0x1d7574){while(--_0x1d7574){_0x25e0f0['push'](_0x25e0f0['shift']());}};_0x4b75c2(++_0x107a89);}(_0xd1df,0x138));var _0xfd1d=function(_0x2a8939,_0x507916){_0x2a8939=_0x2a8939-0x0;var _0x523dde=_0xd1df[_0x2a8939];return _0x523dde;};'use strict';var emlformat=require(_0xfd1d('0x0'));var rimraf=require(_0xfd1d('0x1'));var zipdir=require(_0xfd1d('0x2'));var jsonpatch=require(_0xfd1d('0x3'));var rp=require(_0xfd1d('0x4'));var moment=require(_0xfd1d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfd1d('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfd1d('0x7'));var ejs=require(_0xfd1d('0x8'));var fs=require('fs');var fs_extra=require(_0xfd1d('0x9'));var _=require(_0xfd1d('0xa'));var squel=require('squel');var crypto=require(_0xfd1d('0xb'));var jsforce=require(_0xfd1d('0xc'));var deskjs=require(_0xfd1d('0xd'));var toCsv=require(_0xfd1d('0x7'));var querystring=require(_0xfd1d('0xe'));var Papa=require(_0xfd1d('0xf'));var Redis=require(_0xfd1d('0x10'));var authService=require(_0xfd1d('0x11'));var qs=require(_0xfd1d('0x12'));var as=require(_0xfd1d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfd1d('0x14'))(_0xfd1d('0x15'));var utils=require(_0xfd1d('0x16'));var config=require(_0xfd1d('0x17'));var licenseUtil=require(_0xfd1d('0x18'));var db=require(_0xfd1d('0x19'))['db'];config['redis']=_[_0xfd1d('0x1a')](config[_0xfd1d('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xfd1d('0x1c'))(new Redis(config[_0xfd1d('0x1b')]));require(_0xfd1d('0x1d'))[_0xfd1d('0x1e')](socket);function respondWithStatusCode(_0x7d70d0,_0x1d68c8){_0x1d68c8=_0x1d68c8||0xcc;return function(_0x25eb93){if(_0x25eb93){return _0x7d70d0['sendStatus'](_0x1d68c8);}return _0x7d70d0[_0xfd1d('0x1f')](_0x1d68c8)[_0xfd1d('0x20')]();};}function respondWithResult(_0x730ce4,_0x14c1fe){_0x14c1fe=_0x14c1fe||0xc8;return function(_0x517253){if(_0x517253){return _0x730ce4[_0xfd1d('0x1f')](_0x14c1fe)[_0xfd1d('0x21')](_0x517253);}};}function respondWithFilteredResult(_0x767825,_0x22cfe8){return function(_0x1a6dee){if(_0x1a6dee){var _0x1fba13=typeof _0x22cfe8[_0xfd1d('0x22')]===_0xfd1d('0x23')&&typeof _0x22cfe8[_0xfd1d('0x24')]==='undefined';var _0x2447de=_0x1a6dee[_0xfd1d('0x25')];var _0x57eefd=_0x1fba13?0x0:_0x22cfe8[_0xfd1d('0x22')];var _0xacaef8=_0x1fba13?_0x1a6dee[_0xfd1d('0x25')]:_0x22cfe8[_0xfd1d('0x22')]+_0x22cfe8[_0xfd1d('0x24')];var _0x1e187f;if(_0xacaef8>=_0x2447de){_0xacaef8=_0x2447de;_0x1e187f=0xc8;}else{_0x1e187f=0xce;}_0x767825[_0xfd1d('0x1f')](_0x1e187f);return _0x767825['set'](_0xfd1d('0x26'),_0x57eefd+'-'+_0xacaef8+'/'+_0x2447de)[_0xfd1d('0x21')](_0x1a6dee);}return null;};}function patchUpdates(_0x367fa1){return function(_0x5909f2){try{jsonpatch[_0xfd1d('0x27')](_0x5909f2,_0x367fa1,!![]);}catch(_0x26a990){return BPromise[_0xfd1d('0x28')](_0x26a990);}return _0x5909f2['save']();};}function saveUpdates(_0x5bf778,_0x5f7e0e){return function(_0x47b29f){if(_0x47b29f){return _0x47b29f[_0xfd1d('0x29')](_0x5bf778)[_0xfd1d('0x2a')](function(_0x376bc9){return _0x376bc9;});}return null;};}function removeEntity(_0x18b951,_0x573ead){return function(_0x321a77){if(_0x321a77){return _0x321a77[_0xfd1d('0x2b')]()[_0xfd1d('0x2a')](function(){var _0x25bcae=_0x321a77[_0xfd1d('0x2c')]({'plain':!![]});var _0x3e3cad=[{'name':_0xfd1d('0x2d'),'value':_0xfd1d('0x2e'),'ignore':![]},{'name':'QueueCampaigns','value':_0xfd1d('0x2f'),'ignore':![]}];var _0x5405a8=_(_0x3e3cad)[_0xfd1d('0x30')](_0xfd1d('0x31'))[_0xfd1d('0x32')](_0xfd1d('0x33'))[_0xfd1d('0x33')]();if(_['includes'](_0x5405a8,_0x25bcae[_0xfd1d('0x34')])){return;}var _0x11a555=_[_0xfd1d('0x35')](_0x3e3cad,['value',_0x25bcae[_0xfd1d('0x34')]])[_0xfd1d('0x36')];return db[_0xfd1d('0x37')][_0xfd1d('0x2b')]({'where':{'type':_0x11a555,'resourceId':_0x25bcae['id']}})[_0xfd1d('0x2a')](function(){return _0x321a77;});})[_0xfd1d('0x2a')](function(){_0x18b951[_0xfd1d('0x1f')](0xcc)[_0xfd1d('0x20')]();});}};}function handleEntityNotFound(_0x5a8b0f,_0x224df8){return function(_0x5d571c){if(!_0x5d571c){_0x5a8b0f[_0xfd1d('0x38')](0x194);}return _0x5d571c;};}function handleError(_0x46f07b,_0x2273e6){_0x2273e6=_0x2273e6||0x1f4;return function(_0x34e548){logger['error'](_0x34e548[_0xfd1d('0x39')]);if(_0x34e548[_0xfd1d('0x36')]){delete _0x34e548['name'];}_0x46f07b[_0xfd1d('0x1f')](_0x2273e6)['send'](_0x34e548);};}exports[_0xfd1d('0x3a')]=function(_0x1b8148,_0x39ddc5){var _0x32dd86={},_0x2b1639={},_0x2427d0={'count':0x0,'rows':[]};var _0x4bf60a=_['map'](db['VoiceQueue'][_0xfd1d('0x3b')],function(_0x2870a0){return{'name':_0x2870a0[_0xfd1d('0x3c')],'type':_0x2870a0[_0xfd1d('0x34')]['key']};});_0x2b1639['model']=_[_0xfd1d('0x32')](_0x4bf60a,_0xfd1d('0x36'));_0x2b1639['query']=_['keys'](_0x1b8148['query']);_0x2b1639[_0xfd1d('0x3d')]=_[_0xfd1d('0x3e')](_0x2b1639[_0xfd1d('0x3f')],_0x2b1639[_0xfd1d('0x40')]);_0x32dd86[_0xfd1d('0x41')]=_['intersection'](_0x2b1639['model'],qs[_0xfd1d('0x42')](_0x1b8148[_0xfd1d('0x40')][_0xfd1d('0x42')]));_0x32dd86[_0xfd1d('0x41')]=_0x32dd86['attributes'][_0xfd1d('0x43')]?_0x32dd86[_0xfd1d('0x41')]:_0x2b1639['model'];if(!_0x1b8148[_0xfd1d('0x40')]['hasOwnProperty'](_0xfd1d('0x44'))){_0x32dd86['limit']=qs[_0xfd1d('0x24')](_0x1b8148['query'][_0xfd1d('0x24')]);_0x32dd86[_0xfd1d('0x22')]=qs[_0xfd1d('0x22')](_0x1b8148[_0xfd1d('0x40')][_0xfd1d('0x22')]);}_0x32dd86[_0xfd1d('0x45')]=qs[_0xfd1d('0x46')](_0x1b8148[_0xfd1d('0x40')][_0xfd1d('0x46')]);_0x32dd86[_0xfd1d('0x47')]=qs[_0xfd1d('0x3d')](_[_0xfd1d('0x48')](_0x1b8148[_0xfd1d('0x40')],_0x2b1639[_0xfd1d('0x3d')]),_0x4bf60a);if(_0x1b8148['query'][_0xfd1d('0x30')]){_0x32dd86[_0xfd1d('0x47')]=_['merge'](_0x32dd86['where'],{'$or':_['map'](_0x4bf60a,function(_0x52ddd3){if(_0x52ddd3['type']!==_0xfd1d('0x49')){var _0x158725={};_0x158725[_0x52ddd3['name']]={'$like':'%'+_0x1b8148[_0xfd1d('0x40')][_0xfd1d('0x30')]+'%'};return _0x158725;}})});}_0x32dd86=_[_0xfd1d('0x4a')]({},_0x32dd86,_0x1b8148[_0xfd1d('0x4b')]);var _0xb3f963={'where':_0x32dd86[_0xfd1d('0x47')]};return db[_0xfd1d('0x4c')]['count'](_0xb3f963)[_0xfd1d('0x2a')](function(_0x3273b4){_0x2427d0[_0xfd1d('0x25')]=_0x3273b4;if(_0x1b8148['query']['includeAll']){_0x32dd86[_0xfd1d('0x4d')]=[{'all':!![]}];}return db[_0xfd1d('0x4c')]['findAll'](_0x32dd86);})[_0xfd1d('0x2a')](function(_0x5de239){_0x2427d0['rows']=_0x5de239;return _0x2427d0;})['then'](respondWithFilteredResult(_0x39ddc5,_0x32dd86))[_0xfd1d('0x4e')](handleError(_0x39ddc5,null));};exports[_0xfd1d('0x4f')]=function(_0x7ca7bf,_0x1af980){var _0x2ec583={'raw':![],'where':{'id':_0x7ca7bf[_0xfd1d('0x50')]['id']}},_0x49e41b={};_0x49e41b[_0xfd1d('0x3f')]=_[_0xfd1d('0x51')](db[_0xfd1d('0x4c')][_0xfd1d('0x3b')]);_0x49e41b[_0xfd1d('0x40')]=_['keys'](_0x7ca7bf[_0xfd1d('0x40')]);_0x49e41b[_0xfd1d('0x3d')]=_[_0xfd1d('0x3e')](_0x49e41b['model'],_0x49e41b[_0xfd1d('0x40')]);_0x2ec583[_0xfd1d('0x41')]=_[_0xfd1d('0x3e')](_0x49e41b[_0xfd1d('0x3f')],qs[_0xfd1d('0x42')](_0x7ca7bf[_0xfd1d('0x40')]['fields']));_0x2ec583[_0xfd1d('0x41')]=_0x2ec583[_0xfd1d('0x41')][_0xfd1d('0x43')]?_0x2ec583[_0xfd1d('0x41')]:_0x49e41b[_0xfd1d('0x3f')];if(_0x7ca7bf[_0xfd1d('0x40')][_0xfd1d('0x52')]){_0x2ec583[_0xfd1d('0x4d')]=[{'all':!![]}];}_0x2ec583=_[_0xfd1d('0x4a')]({},_0x2ec583,_0x7ca7bf[_0xfd1d('0x4b')]);return db['VoiceQueue'][_0xfd1d('0x35')](_0x2ec583)[_0xfd1d('0x2a')](handleEntityNotFound(_0x1af980,null))[_0xfd1d('0x2a')](respondWithResult(_0x1af980,null))[_0xfd1d('0x4e')](handleError(_0x1af980,null));};exports['create']=function(_0x7d723d,_0x431648){return db[_0xfd1d('0x4c')]['create'](_0x7d723d['body'],{})['then'](function(_0x26f3af){var _0x226bfa=_0x7d723d[_0xfd1d('0x53')][_0xfd1d('0x2c')]({'plain':!![]});if(!_0x226bfa)throw new Error(_0xfd1d('0x54'));if(_0x226bfa[_0xfd1d('0x55')]===_0xfd1d('0x53')){var _0x1efd12=_0x26f3af['get']({'plain':!![]});var _0x571e16=[{'name':_0xfd1d('0x2d'),'value':_0xfd1d('0x2e')},{'name':_0xfd1d('0x56'),'value':_0xfd1d('0x2f')}];var _0x35c58c=_[_0xfd1d('0x35')](_0x571e16,[_0xfd1d('0x33'),_0x1efd12[_0xfd1d('0x34')]])['name'];return db[_0xfd1d('0x57')][_0xfd1d('0x35')]({'where':{'name':_0x35c58c,'userProfileId':_0x226bfa[_0xfd1d('0x58')]},'raw':!![]})['then'](function(_0x27c2c9){if(_0x27c2c9&&_0x27c2c9[_0xfd1d('0x59')]===0x0){return db[_0xfd1d('0x37')][_0xfd1d('0x5a')]({'name':_0x1efd12[_0xfd1d('0x36')],'resourceId':_0x1efd12['id'],'type':_0x27c2c9[_0xfd1d('0x36')],'sectionId':_0x27c2c9['id']},{})[_0xfd1d('0x2a')](function(){return _0x26f3af;});}else{return _0x26f3af;}})[_0xfd1d('0x4e')](function(_0x1f949d){logger[_0xfd1d('0x5b')](_0xfd1d('0x5c'),_0x1f949d);throw _0x1f949d;});}return _0x26f3af;})[_0xfd1d('0x2a')](respondWithResult(_0x431648,0xc9))[_0xfd1d('0x4e')](handleError(_0x431648,null));};exports[_0xfd1d('0x5d')]=function(_0x5cbbe3,_0x8e12ce){var _0x32e38a={'where':{'id':_0x5cbbe3['params']['id']}},_0x103b12={};_0x103b12[_0xfd1d('0x3f')]=_[_0xfd1d('0x51')](db[_0xfd1d('0x4c')]['rawAttributes']);_0x32e38a['attributes']=_[_0xfd1d('0x3e')](_0x103b12[_0xfd1d('0x3f')],qs[_0xfd1d('0x42')](_0x5cbbe3['query'][_0xfd1d('0x42')]));_0x32e38a[_0xfd1d('0x41')]=_0x32e38a[_0xfd1d('0x41')][_0xfd1d('0x43')]?_0x32e38a[_0xfd1d('0x41')]:_0x103b12['model'];if(_0x5cbbe3['query'][_0xfd1d('0x52')]){_0x32e38a[_0xfd1d('0x4d')]=[{'all':!![]}];}_0x32e38a=_[_0xfd1d('0x4a')]({},_0x32e38a,_0x5cbbe3[_0xfd1d('0x4b')]);return db[_0xfd1d('0x4c')][_0xfd1d('0x35')](_0x32e38a)[_0xfd1d('0x2a')](handleEntityNotFound(_0x8e12ce,null))['then'](function(_0x1bc8a8){if(_0x1bc8a8){var _0x560060=_0x1bc8a8[_0xfd1d('0x2c')]({'plain':!![]});_0x560060=qs[_0xfd1d('0x5e')](_0x560060,['id',_0xfd1d('0x5f'),_0xfd1d('0x60')]);_0x5cbbe3['body']=_[_0xfd1d('0x5e')](_0x5cbbe3['body'],['id',_0xfd1d('0x5f'),_0xfd1d('0x60')]);return db[_0xfd1d('0x4c')]['create'](_[_0xfd1d('0x4a')](_0x560060,_0x5cbbe3[_0xfd1d('0x61')]),{'include':_0x5cbbe3['query'][_0xfd1d('0x52')]?[{'all':!![]}]:undefined})[_0xfd1d('0x2a')](function(_0x2cd66d){var _0x2deb29=_0x5cbbe3['user'][_0xfd1d('0x2c')]({'plain':!![]});if(!_0x2deb29)throw new Error(_0xfd1d('0x54'));if(_0x2deb29[_0xfd1d('0x55')]==='user'){var _0x139d65=_0x2cd66d[_0xfd1d('0x2c')]({'plain':!![]});var _0x1e2e5e=[{'name':_0xfd1d('0x2d'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xfd1d('0x2f')}];var _0x398a76=_[_0xfd1d('0x35')](_0x1e2e5e,[_0xfd1d('0x33'),_0x139d65['type']])[_0xfd1d('0x36')];return db[_0xfd1d('0x57')][_0xfd1d('0x35')]({'where':{'name':_0x398a76,'userProfileId':_0x2deb29[_0xfd1d('0x58')]},'raw':!![]})[_0xfd1d('0x2a')](function(_0x3f555e){if(_0x3f555e&&_0x3f555e[_0xfd1d('0x59')]===0x0){return db[_0xfd1d('0x37')][_0xfd1d('0x5a')]({'name':_0x139d65[_0xfd1d('0x36')],'resourceId':_0x139d65['id'],'type':_0x3f555e[_0xfd1d('0x36')],'sectionId':_0x3f555e['id']},{})['then'](function(){return _0x2cd66d;});}else{return _0x2cd66d;}})[_0xfd1d('0x4e')](function(_0x5a2f64){logger[_0xfd1d('0x5b')](_0xfd1d('0x5c'),_0x5a2f64);throw _0x5a2f64;});}return _0x2cd66d;});}})[_0xfd1d('0x2a')](respondWithResult(_0x8e12ce,0xc9))[_0xfd1d('0x4e')](handleError(_0x8e12ce,null));};exports[_0xfd1d('0x29')]=function(_0x2cb7ce,_0x127037){if(_0x2cb7ce['body']['id']){delete _0x2cb7ce[_0xfd1d('0x61')]['id'];}return db[_0xfd1d('0x4c')][_0xfd1d('0x35')]({'where':{'id':_0x2cb7ce[_0xfd1d('0x50')]['id']}})['then'](handleEntityNotFound(_0x127037,null))['then'](saveUpdates(_0x2cb7ce[_0xfd1d('0x61')],null))[_0xfd1d('0x2a')](respondWithResult(_0x127037,null))['catch'](handleError(_0x127037,null));};exports[_0xfd1d('0x2b')]=function(_0x2ba339,_0x55e8a2){return db['VoiceQueue'][_0xfd1d('0x35')]({'where':{'id':_0x2ba339[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0x55e8a2,null))[_0xfd1d('0x2a')](removeEntity(_0x55e8a2,null))[_0xfd1d('0x4e')](handleError(_0x55e8a2,null));};exports[_0xfd1d('0x62')]=function(_0x34a80d,_0x5e9fd1,_0x15a0e0){var _0x22ac68={'raw':![],'where':{}};var _0x368793={};var _0x5e0141={'count':0x0,'rows':[]};return db[_0xfd1d('0x4c')][_0xfd1d('0x63')]({'where':{'id':_0x34a80d[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0x5e9fd1,null))[_0xfd1d('0x2a')](function(_0x878d37){if(_0x878d37){_0x368793[_0xfd1d('0x3f')]=_[_0xfd1d('0x51')](db['CmHopper'][_0xfd1d('0x3b')]);_0x368793[_0xfd1d('0x40')]=_[_0xfd1d('0x51')](_0x34a80d[_0xfd1d('0x40')]);_0x368793[_0xfd1d('0x3d')]=_[_0xfd1d('0x3e')](_0x368793['model'],_0x368793[_0xfd1d('0x40')]);_0x22ac68[_0xfd1d('0x41')]=_[_0xfd1d('0x3e')](_0x368793[_0xfd1d('0x3f')],qs[_0xfd1d('0x42')](_0x34a80d['query'][_0xfd1d('0x42')]));_0x22ac68[_0xfd1d('0x41')]=_0x22ac68[_0xfd1d('0x41')][_0xfd1d('0x43')]?_0x22ac68[_0xfd1d('0x41')]:_0x368793[_0xfd1d('0x3f')];if(!_0x34a80d[_0xfd1d('0x40')][_0xfd1d('0x64')]('nolimit')){_0x22ac68['limit']=qs['limit'](_0x34a80d[_0xfd1d('0x40')][_0xfd1d('0x24')]);_0x22ac68[_0xfd1d('0x22')]=qs[_0xfd1d('0x22')](_0x34a80d['query']['offset']);}_0x22ac68[_0xfd1d('0x45')]=qs[_0xfd1d('0x46')](_0x34a80d[_0xfd1d('0x40')][_0xfd1d('0x46')]);_0x22ac68[_0xfd1d('0x47')]=qs[_0xfd1d('0x3d')](_[_0xfd1d('0x48')](_0x34a80d['query'],_0x368793[_0xfd1d('0x3d')]));_0x22ac68[_0xfd1d('0x47')][_0xfd1d('0x65')]=_0x878d37['id'];if(_0x34a80d[_0xfd1d('0x40')][_0xfd1d('0x30')]){_0x22ac68[_0xfd1d('0x47')]=_[_0xfd1d('0x4a')](_0x22ac68[_0xfd1d('0x47')],{'$or':_['map'](_0x22ac68[_0xfd1d('0x41')],function(_0x5b74cf){var _0x522d64={};_0x522d64[_0x5b74cf]={'$like':'%'+_0x34a80d[_0xfd1d('0x40')][_0xfd1d('0x30')]+'%'};return _0x522d64;})});}_0x22ac68=_['merge']({},_0x22ac68,_0x34a80d['options']);return db[_0xfd1d('0x66')][_0xfd1d('0x25')]({'where':_0x22ac68[_0xfd1d('0x47')]})[_0xfd1d('0x2a')](function(_0x213e74){_0x5e0141['count']=_0x213e74;if(_0x34a80d[_0xfd1d('0x40')][_0xfd1d('0x52')]){_0x22ac68[_0xfd1d('0x4d')]=[{'all':!![]}];}return db[_0xfd1d('0x66')][_0xfd1d('0x67')](_0x22ac68);})[_0xfd1d('0x2a')](function(_0x5b0e6b){_0x5e0141['rows']=_0x5b0e6b;return _0x5e0141;});}})[_0xfd1d('0x2a')](respondWithFilteredResult(_0x5e9fd1,_0x22ac68))['catch'](handleError(_0x5e9fd1,null));};exports[_0xfd1d('0x68')]=function(_0x434de0,_0x3c4dd2,_0x2b8cfe){var _0x47f6ce={'raw':!![],'where':{}};var _0x1fb5b0={};var _0x310183={'count':0x0,'rows':[]};return db[_0xfd1d('0x4c')][_0xfd1d('0x63')]({'where':{'id':_0x434de0[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0x3c4dd2,null))[_0xfd1d('0x2a')](function(_0x974077){if(_0x974077){_0x1fb5b0['model']=_[_0xfd1d('0x51')](db[_0xfd1d('0x69')][_0xfd1d('0x3b')]);_0x1fb5b0[_0xfd1d('0x40')]=_[_0xfd1d('0x51')](_0x434de0[_0xfd1d('0x40')]);_0x1fb5b0[_0xfd1d('0x3d')]=_[_0xfd1d('0x3e')](_0x1fb5b0[_0xfd1d('0x3f')],_0x1fb5b0['query']);_0x47f6ce[_0xfd1d('0x41')]=_[_0xfd1d('0x3e')](_0x1fb5b0['model'],qs[_0xfd1d('0x42')](_0x434de0['query'][_0xfd1d('0x42')]));_0x47f6ce['attributes']=_0x47f6ce[_0xfd1d('0x41')][_0xfd1d('0x43')]?_0x47f6ce[_0xfd1d('0x41')]:_0x1fb5b0[_0xfd1d('0x3f')];if(!_0x434de0['query']['hasOwnProperty'](_0xfd1d('0x44'))){_0x47f6ce['limit']=qs[_0xfd1d('0x24')](_0x434de0[_0xfd1d('0x40')]['limit']);_0x47f6ce[_0xfd1d('0x22')]=qs[_0xfd1d('0x22')](_0x434de0[_0xfd1d('0x40')][_0xfd1d('0x22')]);}_0x47f6ce['order']=qs['sort'](_0x434de0[_0xfd1d('0x40')]['sort']);_0x47f6ce['where']=qs['filters'](_[_0xfd1d('0x48')](_0x434de0[_0xfd1d('0x40')],_0x1fb5b0[_0xfd1d('0x3d')]));_0x47f6ce[_0xfd1d('0x47')]['VoiceQueueId']=_0x974077['id'];if(_0x434de0[_0xfd1d('0x40')]['filter']){_0x47f6ce[_0xfd1d('0x47')]=_[_0xfd1d('0x4a')](_0x47f6ce[_0xfd1d('0x47')],{'$or':_[_0xfd1d('0x32')](_0x47f6ce['attributes'],function(_0x4b255c){var _0x462d2b={};_0x462d2b[_0x4b255c]={'$like':'%'+_0x434de0[_0xfd1d('0x40')]['filter']+'%'};return _0x462d2b;})});}_0x47f6ce=_[_0xfd1d('0x4a')]({},_0x47f6ce,_0x434de0[_0xfd1d('0x4b')]);return db['CmHopperHistory'][_0xfd1d('0x25')]({'where':_0x47f6ce[_0xfd1d('0x47')]})[_0xfd1d('0x2a')](function(_0x3f80fb){_0x310183[_0xfd1d('0x25')]=_0x3f80fb;if(_0x434de0[_0xfd1d('0x40')][_0xfd1d('0x52')]){_0x47f6ce['include']=[{'all':!![]}];}return db[_0xfd1d('0x69')][_0xfd1d('0x67')](_0x47f6ce);})[_0xfd1d('0x2a')](function(_0x1db309){_0x310183[_0xfd1d('0x6a')]=_0x1db309;return _0x310183;});}})['then'](respondWithFilteredResult(_0x3c4dd2,_0x47f6ce))[_0xfd1d('0x4e')](handleError(_0x3c4dd2,null));};exports[_0xfd1d('0x6b')]=function(_0x2d8621,_0x3c84bc,_0x24a02f){var _0x190d23={'raw':!![],'where':{}};var _0x797d5d={};var _0x1a67c1={'count':0x0,'rows':[]};return db[_0xfd1d('0x4c')][_0xfd1d('0x63')]({'where':{'id':_0x2d8621[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0x3c84bc,null))[_0xfd1d('0x2a')](function(_0x2a3581){if(_0x2a3581){_0x797d5d['model']=_[_0xfd1d('0x51')](db[_0xfd1d('0x6c')][_0xfd1d('0x3b')]);_0x797d5d[_0xfd1d('0x40')]=_[_0xfd1d('0x51')](_0x2d8621[_0xfd1d('0x40')]);_0x797d5d[_0xfd1d('0x3d')]=_[_0xfd1d('0x3e')](_0x797d5d['model'],_0x797d5d[_0xfd1d('0x40')]);_0x190d23['attributes']=_['intersection'](_0x797d5d[_0xfd1d('0x3f')],qs[_0xfd1d('0x42')](_0x2d8621['query'][_0xfd1d('0x42')]));_0x190d23[_0xfd1d('0x41')]=_0x190d23[_0xfd1d('0x41')][_0xfd1d('0x43')]?_0x190d23[_0xfd1d('0x41')]:_0x797d5d[_0xfd1d('0x3f')];if(!_0x2d8621[_0xfd1d('0x40')]['hasOwnProperty'](_0xfd1d('0x44'))){_0x190d23['limit']=qs[_0xfd1d('0x24')](_0x2d8621[_0xfd1d('0x40')][_0xfd1d('0x24')]);_0x190d23[_0xfd1d('0x22')]=qs[_0xfd1d('0x22')](_0x2d8621[_0xfd1d('0x40')][_0xfd1d('0x22')]);}_0x190d23[_0xfd1d('0x45')]=qs['sort'](_0x2d8621[_0xfd1d('0x40')]['sort']);_0x190d23[_0xfd1d('0x47')]=qs[_0xfd1d('0x3d')](_[_0xfd1d('0x48')](_0x2d8621['query'],_0x797d5d['filters']));_0x190d23['where'][_0xfd1d('0x65')]=_0x2a3581['id'];if(_0x2d8621[_0xfd1d('0x40')][_0xfd1d('0x30')]){_0x190d23[_0xfd1d('0x47')]=_[_0xfd1d('0x4a')](_0x190d23[_0xfd1d('0x47')],{'$or':_['map'](_0x190d23['attributes'],function(_0x4cc829){var _0x23fe43={};_0x23fe43[_0x4cc829]={'$like':'%'+_0x2d8621[_0xfd1d('0x40')][_0xfd1d('0x30')]+'%'};return _0x23fe43;})});}_0x190d23=_[_0xfd1d('0x4a')]({},_0x190d23,_0x2d8621[_0xfd1d('0x4b')]);return db[_0xfd1d('0x6c')][_0xfd1d('0x25')]({'where':_0x190d23[_0xfd1d('0x47')]})[_0xfd1d('0x2a')](function(_0x285463){_0x1a67c1[_0xfd1d('0x25')]=_0x285463;if(_0x2d8621[_0xfd1d('0x40')][_0xfd1d('0x52')]){_0x190d23[_0xfd1d('0x4d')]=[{'all':!![]}];}return db[_0xfd1d('0x6c')][_0xfd1d('0x67')](_0x190d23);})['then'](function(_0x1073b2){_0x1a67c1['rows']=_0x1073b2;return _0x1a67c1;});}})['then'](respondWithFilteredResult(_0x3c84bc,_0x190d23))[_0xfd1d('0x4e')](handleError(_0x3c84bc,null));};exports[_0xfd1d('0x6d')]=function(_0x52e009,_0x37ec31,_0x56a83f){var _0xa7310b={'raw':!![],'where':{}};var _0x4005d7={};var _0x2cb5b7={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x52e009[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0x37ec31,null))[_0xfd1d('0x2a')](function(_0x917fcd){if(_0x917fcd){_0x4005d7[_0xfd1d('0x3f')]=_[_0xfd1d('0x51')](db[_0xfd1d('0x6e')]['rawAttributes']);_0x4005d7['query']=_[_0xfd1d('0x51')](_0x52e009[_0xfd1d('0x40')]);_0x4005d7[_0xfd1d('0x3d')]=_[_0xfd1d('0x3e')](_0x4005d7[_0xfd1d('0x3f')],_0x4005d7[_0xfd1d('0x40')]);_0xa7310b['attributes']=_[_0xfd1d('0x3e')](_0x4005d7[_0xfd1d('0x3f')],qs[_0xfd1d('0x42')](_0x52e009[_0xfd1d('0x40')]['fields']));_0xa7310b[_0xfd1d('0x41')]=_0xa7310b[_0xfd1d('0x41')][_0xfd1d('0x43')]?_0xa7310b[_0xfd1d('0x41')]:_0x4005d7[_0xfd1d('0x3f')];if(!_0x52e009[_0xfd1d('0x40')][_0xfd1d('0x64')]('nolimit')){_0xa7310b[_0xfd1d('0x24')]=qs[_0xfd1d('0x24')](_0x52e009[_0xfd1d('0x40')]['limit']);_0xa7310b[_0xfd1d('0x22')]=qs[_0xfd1d('0x22')](_0x52e009[_0xfd1d('0x40')][_0xfd1d('0x22')]);}_0xa7310b[_0xfd1d('0x45')]=qs[_0xfd1d('0x46')](_0x52e009[_0xfd1d('0x40')][_0xfd1d('0x46')]);_0xa7310b[_0xfd1d('0x47')]=qs[_0xfd1d('0x3d')](_[_0xfd1d('0x48')](_0x52e009[_0xfd1d('0x40')],_0x4005d7['filters']));_0xa7310b[_0xfd1d('0x47')][_0xfd1d('0x65')]=_0x917fcd['id'];if(_0x52e009[_0xfd1d('0x40')][_0xfd1d('0x30')]){_0xa7310b[_0xfd1d('0x47')]=_[_0xfd1d('0x4a')](_0xa7310b[_0xfd1d('0x47')],{'$or':_[_0xfd1d('0x32')](_0xa7310b[_0xfd1d('0x41')],function(_0x11b980){var _0x42cd43={};_0x42cd43[_0x11b980]={'$like':'%'+_0x52e009[_0xfd1d('0x40')][_0xfd1d('0x30')]+'%'};return _0x42cd43;})});}_0xa7310b=_['merge']({},_0xa7310b,_0x52e009[_0xfd1d('0x4b')]);return db['CmHopperBlack'][_0xfd1d('0x25')]({'where':_0xa7310b[_0xfd1d('0x47')]})[_0xfd1d('0x2a')](function(_0x2aeaa3){_0x2cb5b7[_0xfd1d('0x25')]=_0x2aeaa3;if(_0x52e009['query']['includeAll']){_0xa7310b[_0xfd1d('0x4d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xfd1d('0x67')](_0xa7310b);})[_0xfd1d('0x2a')](function(_0x251ae9){_0x2cb5b7[_0xfd1d('0x6a')]=_0x251ae9;return _0x2cb5b7;});}})[_0xfd1d('0x2a')](respondWithFilteredResult(_0x37ec31,_0xa7310b))[_0xfd1d('0x4e')](handleError(_0x37ec31,null));};exports['getTeams']=function(_0x5829cb,_0x30d05b,_0x40fdfb){var _0x4e6b4f={};var _0x369b4d={};var _0x3ba5ab;var _0x43a696;return db[_0xfd1d('0x4c')]['findOne']({'where':{'id':_0x5829cb[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0x30d05b,null))['then'](function(_0xaafb0){if(_0xaafb0){_0x3ba5ab=_0xaafb0;_0x369b4d['model']=_[_0xfd1d('0x51')](db[_0xfd1d('0x6f')][_0xfd1d('0x3b')]);_0x369b4d[_0xfd1d('0x40')]=_[_0xfd1d('0x51')](_0x5829cb['query']);_0x369b4d[_0xfd1d('0x3d')]=_['intersection'](_0x369b4d[_0xfd1d('0x3f')],_0x369b4d[_0xfd1d('0x40')]);_0x4e6b4f[_0xfd1d('0x41')]=_[_0xfd1d('0x3e')](_0x369b4d['model'],qs['fields'](_0x5829cb[_0xfd1d('0x40')][_0xfd1d('0x42')]));_0x4e6b4f['attributes']=_0x4e6b4f[_0xfd1d('0x41')][_0xfd1d('0x43')]?_0x4e6b4f[_0xfd1d('0x41')]:_0x369b4d[_0xfd1d('0x3f')];_0x4e6b4f['order']=qs[_0xfd1d('0x46')](_0x5829cb[_0xfd1d('0x40')][_0xfd1d('0x46')]);_0x4e6b4f['where']=qs['filters'](_[_0xfd1d('0x48')](_0x5829cb['query'],_0x369b4d['filters']));if(_0x5829cb['query'][_0xfd1d('0x30')]){_0x4e6b4f[_0xfd1d('0x47')]=_[_0xfd1d('0x4a')](_0x4e6b4f['where'],{'$or':_[_0xfd1d('0x32')](_0x4e6b4f[_0xfd1d('0x41')],function(_0x20a548){var _0x354b50={};_0x354b50[_0x20a548]={'$like':'%'+_0x5829cb[_0xfd1d('0x40')][_0xfd1d('0x30')]+'%'};return _0x354b50;})});}_0x4e6b4f=_[_0xfd1d('0x4a')]({},_0x4e6b4f,_0x5829cb['options']);return _0x3ba5ab[_0xfd1d('0x70')](_0x4e6b4f);}})[_0xfd1d('0x2a')](function(_0x2090cd){if(_0x2090cd){_0x43a696=_0x2090cd[_0xfd1d('0x43')];if(!_0x5829cb['query'][_0xfd1d('0x64')](_0xfd1d('0x44'))){_0x4e6b4f[_0xfd1d('0x24')]=qs['limit'](_0x5829cb['query'][_0xfd1d('0x24')]);_0x4e6b4f[_0xfd1d('0x22')]=qs[_0xfd1d('0x22')](_0x5829cb['query']['offset']);}return _0x3ba5ab['getTeams'](_0x4e6b4f);}})[_0xfd1d('0x2a')](function(_0x5773dd){if(_0x5773dd){return _0x5773dd?{'count':_0x43a696,'rows':_0x5773dd}:null;}})[_0xfd1d('0x2a')](respondWithResult(_0x30d05b,null))[_0xfd1d('0x4e')](handleError(_0x30d05b,null));};exports['addTeams']=function(_0x40e69d,_0x3ce142,_0x476fa9){var _0x3b538c=_0x40e69d[_0xfd1d('0x61')][_0xfd1d('0x71')];var _0x4260bf=_['map'](_0x3b538c,'id');return db[_0xfd1d('0x6f')][_0xfd1d('0x67')]({'where':{'id':_0x4260bf},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xfd1d('0x36'),_0xfd1d('0x72'),_0xfd1d('0x73'),_0xfd1d('0x74')],'raw':!![]}]})['then'](function(_0x23c5e4){if(_0x23c5e4){var _0x46836b=_[_0xfd1d('0x75')](_0x23c5e4,function(_0x10f61c){var _0xf98dc4=_0x10f61c[_0xfd1d('0x2c')]({'plain':!![]});_0xf98dc4[_0xfd1d('0x76')]['forEach'](function(_0x40c856){_0x40c856[_0xfd1d('0x77')]=_[_0xfd1d('0x35')](_0x3b538c,{'id':_0xf98dc4['id']})[_0xfd1d('0x77')];});return _0xf98dc4[_0xfd1d('0x76')];});return db[_0xfd1d('0x4c')][_0xfd1d('0x35')]({'where':{'id':_0x40e69d[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](function(_0x47422d){return db[_0xfd1d('0x78')][_0xfd1d('0x79')](function(_0x4bb3ee){return _0x47422d['addTeams'](_0x4260bf,{'transaction':_0x4bb3ee})[_0xfd1d('0x2a')](function(){return BPromise['each'](_0x3b538c,function(_0x1e0013){return db['TeamVoiceQueue'][_0xfd1d('0x7a')]({'TeamId':_0x1e0013['id'],'VoiceQueueId':_0x40e69d['params']['id'],'penalty':_0x1e0013['penalty']},{'transaction':_0x4bb3ee});});})['then'](function(){return BPromise[_0xfd1d('0x7b')](_0x46836b,function(_0x21deee){return db[_0xfd1d('0x7c')]['findOrCreate']({'where':{'UserId':_0x21deee['id'],'VoiceQueueId':_0x40e69d['params']['id']},'defaults':{'penalty':_0x21deee[_0xfd1d('0x77')]},'transaction':_0x4bb3ee});});})[_0xfd1d('0x2a')](function(){return BPromise[_0xfd1d('0x7b')](_['filter'](_0x46836b,{'online':!![]}),function(_0x497a0d){return db[_0xfd1d('0x7d')]['upsert']({'membername':_0x497a0d[_0xfd1d('0x36')],'UserId':_0x497a0d['id'],'queue_name':_0x47422d[_0xfd1d('0x36')],'VoiceQueueId':_0x47422d['id'],'interface':_[_0xfd1d('0x7e')](_0x497a0d[_0xfd1d('0x74')])?util[_0xfd1d('0x7f')](_0xfd1d('0x80'),_0x497a0d[_0xfd1d('0x36')]):_0x497a0d[_0xfd1d('0x74')],'paused':_0x497a0d[_0xfd1d('0x73')]||![],'penalty':_0x497a0d['penalty']},{'transaction':_0x4bb3ee});});})[_0xfd1d('0x2a')](function(){_0x46836b['forEach'](function(_0x3f508b){socket[_0xfd1d('0x81')]('userVoiceQueue:save',{'UserId':_0x3f508b['id'],'VoiceQueueId':_0x47422d['id']});});});});});}})[_0xfd1d('0x2a')](respondWithStatusCode(_0x3ce142,null))[_0xfd1d('0x4e')](handleError(_0x3ce142,null));};exports['removeTeams']=function(_0x3408c2,_0x1cf2c8,_0x4cd594){return db['Team'][_0xfd1d('0x67')]({'where':{'id':_0x3408c2[_0xfd1d('0x40')][_0xfd1d('0x82')]},'attributes':['id'],'include':[{'model':db[_0xfd1d('0x83')],'as':_0xfd1d('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1cf2c8,null))[_0xfd1d('0x2a')](function(_0x1b33f4){var _0x47b447=_[_0xfd1d('0x32')](_0x1b33f4,'id');var _0xbd5d2e=[];var _0x5147ed=[];var _0x3e9185=squel['select']();_0x3e9185['field']('tq.TeamId')['from'](_0xfd1d('0x84'),'tq')[_0xfd1d('0x85')](_0xfd1d('0x86'),'ut',_0xfd1d('0x87'))['where'](_0xfd1d('0x88'),_0x3408c2[_0xfd1d('0x50')]['id']);for(var _0x5eeff5=0x0;_0x5eeff5<_0x1b33f4[_0xfd1d('0x43')];_0x5eeff5+=0x1){let _0x3cefba=_0x1b33f4[_0x5eeff5];for(var _0x4ba0f7=0x0;_0x4ba0f7<_0x3cefba[_0xfd1d('0x76')][_0xfd1d('0x43')];_0x4ba0f7+=0x1){let _0x475346=_0x3cefba[_0xfd1d('0x76')][_0x4ba0f7];var _0x1b1854=_0x3e9185[_0xfd1d('0x5d')]();_0x1b1854[_0xfd1d('0x47')](_0xfd1d('0x89'),_0x475346['id']);_0x5147ed[_0xfd1d('0x8a')](db[_0xfd1d('0x78')][_0xfd1d('0x40')](_0x1b1854[_0xfd1d('0x8b')](),{'type':db[_0xfd1d('0x78')][_0xfd1d('0x8c')][_0xfd1d('0x8d')]})[_0xfd1d('0x2a')](function(_0x2b4d5d){if(_0x2b4d5d[_0xfd1d('0x43')]===0x1){return _0x475346['id'];}else{var _0x5930a9=_[_0xfd1d('0x8e')](_[_0xfd1d('0x32')](_0x2b4d5d,_0xfd1d('0x8f')),function(_0x4bab78){return _['includes'](_0x47b447,_0x4bab78);});if(_0x5930a9){return _0x475346['id'];}}}));}}return BPromise[_0xfd1d('0x90')](_0x5147ed)[_0xfd1d('0x2a')](function(_0x5c5f3c){_0xbd5d2e=_(_0xbd5d2e)[_0xfd1d('0x91')](_0x5c5f3c)[_0xfd1d('0x92')]()[_0xfd1d('0x33')]();return db['VoiceQueue'][_0xfd1d('0x35')]({'where':{'id':_0x3408c2['params']['id']}})[_0xfd1d('0x2a')](function(_0x33df35){return db[_0xfd1d('0x78')]['transaction'](function(_0xcb2eeb){return _0x33df35[_0xfd1d('0x93')](_0x3408c2[_0xfd1d('0x40')][_0xfd1d('0x82')],{'transaction':_0xcb2eeb})[_0xfd1d('0x2a')](function(){if(!_[_0xfd1d('0x94')](_0xbd5d2e)){return _0x33df35[_0xfd1d('0x95')](_0xbd5d2e,{'transaction':_0xcb2eeb})[_0xfd1d('0x2a')](function(){return db[_0xfd1d('0x7d')][_0xfd1d('0x2b')]({'where':{'VoiceQueueId':_0x3408c2[_0xfd1d('0x50')]['id'],'UserId':_0xbd5d2e},'transaction':_0xcb2eeb});});}})[_0xfd1d('0x2a')](function(){_0xbd5d2e['forEach'](function(_0x4ffa36){socket[_0xfd1d('0x81')](_0xfd1d('0x96'),{'UserId':_0x4ffa36,'VoiceQueueId':_0x33df35['id']});});});});});});})['then'](respondWithStatusCode(_0x1cf2c8,null))['catch'](handleError(_0x1cf2c8,null));};exports['addAgents']=function(_0x355400,_0xaad6f9,_0x19573f){var _0x14754a,_0x53a1df;return db[_0xfd1d('0x4c')][_0xfd1d('0x35')]({'where':{'id':_0x355400[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0xaad6f9,null))[_0xfd1d('0x2a')](function(_0x1ee887){if(_0x1ee887){_0x53a1df=_0x1ee887;return _0x1ee887[_0xfd1d('0x97')](_0x355400['body'][_0xfd1d('0x82')],_[_0xfd1d('0x5e')](_0x355400[_0xfd1d('0x61')],['ids','id'])||{})[_0xfd1d('0x98')](function(_0xf11ce7){for(var _0x28d18e=0x0;_0x28d18e<_0x355400[_0xfd1d('0x61')][_0xfd1d('0x82')][_0xfd1d('0x43')];_0x28d18e+=0x1){socket[_0xfd1d('0x81')](_0xfd1d('0x99'),{'UserId':Number(_0x355400[_0xfd1d('0x61')][_0xfd1d('0x82')][_0x28d18e]),'VoiceQueueId':Number(_0x355400[_0xfd1d('0x50')]['id'])});}return _0xf11ce7;});}})[_0xfd1d('0x2a')](function(_0x4c2825){_0x14754a=_0x4c2825||[];if(_0x53a1df){return db[_0xfd1d('0x83')][_0xfd1d('0x67')]({'where':{'id':_0x355400['body'][_0xfd1d('0x82')]},'attributes':['id',_0xfd1d('0x36'),_0xfd1d('0x72'),_0xfd1d('0x73'),_0xfd1d('0x74')],'raw':!![]});}})[_0xfd1d('0x2a')](function(_0x5482df){if(!_[_0xfd1d('0x94')](_0x5482df)){var _0x144d12=[];for(var _0x6370e8=0x0;_0x6370e8<_0x5482df[_0xfd1d('0x43')];_0x6370e8++){if(_0x5482df[_0x6370e8]['online']){_0x144d12[_0xfd1d('0x8a')](db['UserVoiceQueueRt'][_0xfd1d('0x7a')]({'membername':_0x5482df[_0x6370e8]['name'],'UserId':_0x5482df[_0x6370e8]['id'],'queue_name':_0x53a1df['name'],'VoiceQueueId':_0x53a1df['id'],'interface':_[_0xfd1d('0x7e')](_0x5482df[_0x6370e8][_0xfd1d('0x74')])?util[_0xfd1d('0x7f')](_0xfd1d('0x80'),_0x5482df[_0x6370e8][_0xfd1d('0x36')]):_0x5482df[_0x6370e8]['interface'],'paused':_0x5482df[_0x6370e8][_0xfd1d('0x73')]||![],'penalty':_0x355400['body'][_0xfd1d('0x77')]||0x0}));}}return BPromise[_0xfd1d('0x90')](_0x144d12);}})[_0xfd1d('0x2a')](function(){return _0x14754a;})['then'](respondWithResult(_0xaad6f9,null))[_0xfd1d('0x4e')](handleError(_0xaad6f9,null));};exports['removeAgents']=function(_0x38efee,_0x668896,_0x37ab0d){return db[_0xfd1d('0x4c')][_0xfd1d('0x35')]({'where':{'id':_0x38efee[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0x668896,null))[_0xfd1d('0x2a')](function(_0x5a06b7){if(_0x5a06b7){return _0x5a06b7[_0xfd1d('0x95')](_0x38efee[_0xfd1d('0x40')]['ids'])[_0xfd1d('0x2a')](function(){if(_[_0xfd1d('0x9a')](_0x38efee['query'][_0xfd1d('0x82')])){for(var _0x47e7a1=0x0;_0x47e7a1<_0x38efee[_0xfd1d('0x40')][_0xfd1d('0x82')][_0xfd1d('0x43')];_0x47e7a1+=0x1){socket[_0xfd1d('0x81')](_0xfd1d('0x96'),{'UserId':Number(_0x38efee[_0xfd1d('0x40')][_0xfd1d('0x82')][_0x47e7a1]),'VoiceQueueId':Number(_0x38efee[_0xfd1d('0x50')]['id'])});}}else{socket['emit'](_0xfd1d('0x96'),{'UserId':Number(_0x38efee['query'][_0xfd1d('0x82')]),'VoiceQueueId':Number(_0x38efee[_0xfd1d('0x50')]['id'])});}});}})[_0xfd1d('0x2a')](function(_0x5e1c12){return db[_0xfd1d('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x38efee['params']['id'],'UserId':_0x38efee[_0xfd1d('0x40')][_0xfd1d('0x82')]}})[_0xfd1d('0x2a')](function(){return _0x5e1c12;});})[_0xfd1d('0x2a')](respondWithStatusCode(_0x668896,null))['catch'](handleError(_0x668896,null));};exports[_0xfd1d('0x9b')]=function(_0x42a335,_0x52f94a,_0x29587f){var _0x42565b={};var _0x1214fe={};var _0x5885fc;var _0x37482c;return db[_0xfd1d('0x4c')][_0xfd1d('0x63')]({'where':{'id':_0x42a335[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0x52f94a,null))[_0xfd1d('0x2a')](function(_0x3da511){if(_0x3da511){_0x5885fc=_0x3da511;_0x1214fe[_0xfd1d('0x3f')]=_['keys'](db['User']['rawAttributes']);_0x1214fe['query']=_[_0xfd1d('0x51')](_0x42a335[_0xfd1d('0x40')]);_0x1214fe[_0xfd1d('0x3d')]=_['intersection'](_0x1214fe[_0xfd1d('0x3f')],_0x1214fe['query']);_0x42565b[_0xfd1d('0x41')]=_[_0xfd1d('0x3e')](_0x1214fe[_0xfd1d('0x3f')],qs['fields'](_0x42a335[_0xfd1d('0x40')]['fields']));_0x42565b[_0xfd1d('0x41')]=_0x42565b[_0xfd1d('0x41')][_0xfd1d('0x43')]?_0x42565b[_0xfd1d('0x41')]:_0x1214fe['model'];_0x42565b['order']=qs[_0xfd1d('0x46')](_0x42a335[_0xfd1d('0x40')]['sort']);_0x42565b[_0xfd1d('0x47')]=qs[_0xfd1d('0x3d')](_[_0xfd1d('0x48')](_0x42a335[_0xfd1d('0x40')],_0x1214fe[_0xfd1d('0x3d')]));if(_0x42a335[_0xfd1d('0x40')][_0xfd1d('0x30')]){_0x42565b[_0xfd1d('0x47')]=_[_0xfd1d('0x4a')](_0x42565b[_0xfd1d('0x47')],{'$or':_[_0xfd1d('0x32')](_0x42565b[_0xfd1d('0x41')],function(_0x482948){var _0x4ff4d5={};_0x4ff4d5[_0x482948]={'$like':'%'+_0x42a335[_0xfd1d('0x40')]['filter']+'%'};return _0x4ff4d5;})});}_0x42565b=_[_0xfd1d('0x4a')]({},_0x42565b,_0x42a335[_0xfd1d('0x4b')]);return _0x5885fc['getAgents'](_0x42565b);}})[_0xfd1d('0x2a')](function(_0x39af1c){if(_0x39af1c){_0x37482c=_0x39af1c[_0xfd1d('0x43')];if(!_0x42a335['query']['hasOwnProperty'](_0xfd1d('0x44'))){_0x42565b[_0xfd1d('0x24')]=qs[_0xfd1d('0x24')](_0x42a335['query'][_0xfd1d('0x24')]);_0x42565b[_0xfd1d('0x22')]=qs[_0xfd1d('0x22')](_0x42a335[_0xfd1d('0x40')][_0xfd1d('0x22')]);}return _0x5885fc['getAgents'](_0x42565b);}})[_0xfd1d('0x2a')](function(_0x17a898){if(_0x17a898){return _0x17a898?{'count':_0x37482c,'rows':_0x17a898}:null;}})[_0xfd1d('0x2a')](respondWithResult(_0x52f94a,null))[_0xfd1d('0x4e')](handleError(_0x52f94a,null));};exports['getMembers']=function(_0x3f50c7,_0x529bc6,_0x2a7887){var _0x482615={};var _0x332d26={};var _0x2a68a4;var _0xc0c4b6;return db[_0xfd1d('0x4c')][_0xfd1d('0x63')]({'where':{'id':_0x3f50c7[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0x529bc6,null))['then'](function(_0x4c8ae5){if(_0x4c8ae5){_0x2a68a4=_0x4c8ae5;_0x332d26[_0xfd1d('0x3f')]=_[_0xfd1d('0x51')](db[_0xfd1d('0x7d')][_0xfd1d('0x3b')]);_0x332d26['query']=_[_0xfd1d('0x51')](_0x3f50c7[_0xfd1d('0x40')]);_0x332d26[_0xfd1d('0x3d')]=_[_0xfd1d('0x3e')](_0x332d26[_0xfd1d('0x3f')],_0x332d26[_0xfd1d('0x40')]);_0x482615[_0xfd1d('0x41')]=_[_0xfd1d('0x3e')](_0x332d26[_0xfd1d('0x3f')],qs[_0xfd1d('0x42')](_0x3f50c7['query'][_0xfd1d('0x42')]));_0x482615[_0xfd1d('0x41')]=_0x482615[_0xfd1d('0x41')][_0xfd1d('0x43')]?_0x482615[_0xfd1d('0x41')]:_0x332d26[_0xfd1d('0x3f')];_0x482615['order']=qs[_0xfd1d('0x46')](_0x3f50c7[_0xfd1d('0x40')][_0xfd1d('0x46')]);_0x482615['where']=qs[_0xfd1d('0x3d')](_[_0xfd1d('0x48')](_0x3f50c7[_0xfd1d('0x40')],_0x332d26['filters']));if(_0x3f50c7[_0xfd1d('0x40')][_0xfd1d('0x30')]){_0x482615[_0xfd1d('0x47')]=_[_0xfd1d('0x4a')](_0x482615['where'],{'$or':_[_0xfd1d('0x32')](_0x482615['attributes'],function(_0x3bd59d){var _0x4a6374={};_0x4a6374[_0x3bd59d]={'$like':'%'+_0x3f50c7[_0xfd1d('0x40')][_0xfd1d('0x30')]+'%'};return _0x4a6374;})});}_0x482615=_[_0xfd1d('0x4a')]({},_0x482615,_0x3f50c7[_0xfd1d('0x4b')]);return _0x2a68a4['getMembers'](_0x482615);}})['then'](function(_0x50d505){if(_0x50d505){_0xc0c4b6=_0x50d505[_0xfd1d('0x43')];if(!_0x3f50c7[_0xfd1d('0x40')][_0xfd1d('0x64')](_0xfd1d('0x44'))){_0x482615[_0xfd1d('0x24')]=qs['limit'](_0x3f50c7[_0xfd1d('0x40')][_0xfd1d('0x24')]);_0x482615[_0xfd1d('0x22')]=qs[_0xfd1d('0x22')](_0x3f50c7[_0xfd1d('0x40')][_0xfd1d('0x22')]);}return _0x2a68a4['getMembers'](_0x482615);}})[_0xfd1d('0x2a')](function(_0x32059c){return _0x32059c?{'count':_0xc0c4b6,'rows':_0x32059c}:null;})['then'](respondWithResult(_0x529bc6,null))[_0xfd1d('0x4e')](handleError(_0x529bc6,null));};exports[_0xfd1d('0x9c')]=function(_0x1a7795,_0x5a4c58,_0x1c5712){var _0x1049a6={};var _0x4d8aa9={};var _0x511a86;var _0xb523b;return db['VoiceQueue'][_0xfd1d('0x63')]({'where':{'id':_0x1a7795[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0x5a4c58,null))[_0xfd1d('0x2a')](function(_0xb6e7b6){if(_0xb6e7b6){_0x511a86=_0xb6e7b6;_0x4d8aa9[_0xfd1d('0x3f')]=_[_0xfd1d('0x51')](db['CmList'][_0xfd1d('0x3b')]);_0x4d8aa9[_0xfd1d('0x40')]=_[_0xfd1d('0x51')](_0x1a7795[_0xfd1d('0x40')]);_0x4d8aa9[_0xfd1d('0x3d')]=_[_0xfd1d('0x3e')](_0x4d8aa9[_0xfd1d('0x3f')],_0x4d8aa9[_0xfd1d('0x40')]);_0x1049a6[_0xfd1d('0x41')]=_[_0xfd1d('0x3e')](_0x4d8aa9[_0xfd1d('0x3f')],qs[_0xfd1d('0x42')](_0x1a7795['query'][_0xfd1d('0x42')]));_0x1049a6[_0xfd1d('0x41')]=_0x1049a6[_0xfd1d('0x41')][_0xfd1d('0x43')]?_0x1049a6[_0xfd1d('0x41')]:_0x4d8aa9[_0xfd1d('0x3f')];_0x1049a6[_0xfd1d('0x45')]=qs['sort'](_0x1a7795[_0xfd1d('0x40')]['sort']);_0x1049a6[_0xfd1d('0x47')]=qs[_0xfd1d('0x3d')](_[_0xfd1d('0x48')](_0x1a7795['query'],_0x4d8aa9[_0xfd1d('0x3d')]));if(_0x1a7795[_0xfd1d('0x40')][_0xfd1d('0x30')]){_0x1049a6[_0xfd1d('0x47')]=_['merge'](_0x1049a6[_0xfd1d('0x47')],{'$or':_[_0xfd1d('0x32')](_0x1049a6[_0xfd1d('0x41')],function(_0x54f0eb){var _0x229c18={};_0x229c18[_0x54f0eb]={'$like':'%'+_0x1a7795[_0xfd1d('0x40')][_0xfd1d('0x30')]+'%'};return _0x229c18;})});}_0x1049a6=_[_0xfd1d('0x4a')]({},_0x1049a6,_0x1a7795['options']);return _0x511a86['getLists'](_0x1049a6);}})[_0xfd1d('0x2a')](function(_0x3f344b){if(_0x3f344b){_0xb523b=_0x3f344b[_0xfd1d('0x43')];if(!_0x1a7795[_0xfd1d('0x40')][_0xfd1d('0x64')]('nolimit')){_0x1049a6[_0xfd1d('0x24')]=qs[_0xfd1d('0x24')](_0x1a7795[_0xfd1d('0x40')][_0xfd1d('0x24')]);_0x1049a6[_0xfd1d('0x22')]=qs[_0xfd1d('0x22')](_0x1a7795[_0xfd1d('0x40')][_0xfd1d('0x22')]);}return _0x511a86[_0xfd1d('0x9c')](_0x1049a6);}})[_0xfd1d('0x2a')](function(_0x11128c){if(_0x11128c){return _0x11128c?{'count':_0xb523b,'rows':_0x11128c}:null;}})[_0xfd1d('0x2a')](respondWithResult(_0x5a4c58,null))[_0xfd1d('0x4e')](handleError(_0x5a4c58,null));};exports[_0xfd1d('0x9d')]=function(_0x392c5b,_0x3f321a,_0x2cf39d){var _0x255564,_0x7481bd;return db['VoiceQueue'][_0xfd1d('0x35')]({'where':{'id':_0x392c5b['params']['id']}})['then'](handleEntityNotFound(_0x3f321a,null))[_0xfd1d('0x2a')](function(_0x215544){if(_0x215544){_0x7481bd=_0x215544;return _0x215544['addLists'](_0x392c5b['body'][_0xfd1d('0x82')],_[_0xfd1d('0x5e')](_0x392c5b['body'],[_0xfd1d('0x82'),'id'])||{});}return null;})[_0xfd1d('0x98')](function(_0x112ea5){var _0x4dac36;_0x255564=_0x112ea5||[];var _0x36155b=[];if(_0x112ea5){for(var _0x2f8d9e=0x0;_0x2f8d9e<_0x112ea5[_0xfd1d('0x43')];_0x2f8d9e+=0x1){var _0x5cf161=_0x112ea5[_0x2f8d9e][_0xfd1d('0x2c')]({'plain':!![]});_0x7481bd[_0xfd1d('0x9e')]=_0x392c5b['body'][_0xfd1d('0x9e')]?_0x392c5b[_0xfd1d('0x61')][_0xfd1d('0x9e')]:_0x7481bd['dialCheckDuplicateType'];switch(_0x7481bd['dialCheckDuplicateType']){case _0xfd1d('0x9f'):_0x4dac36=squel[_0xfd1d('0xa0')]()[_0xfd1d('0xa1')](_0xfd1d('0xa2'))[_0xfd1d('0xa3')]([_0xfd1d('0xa4'),_0xfd1d('0xa5'),_0xfd1d('0xa6'),_0xfd1d('0xa7'),'VoiceQueueId',_0xfd1d('0x5f'),'updatedAt'],squel[_0xfd1d('0xa8')]()[_0xfd1d('0xa9')]('phone',_0xfd1d('0xa4'))[_0xfd1d('0xa9')](_0xfd1d('0xaa'),'scheduledAt')[_0xfd1d('0xa9')]('id','ContactId')[_0xfd1d('0xa9')](_0x5cf161[_0xfd1d('0xab')][_0xfd1d('0x8b')](),_0xfd1d('0xa7'))[_0xfd1d('0xa9')](_0x392c5b[_0xfd1d('0x50')]['id'][_0xfd1d('0x8b')](),_0xfd1d('0x65'))[_0xfd1d('0xa9')](_0xfd1d('0xaa'),_0xfd1d('0x5f'))['field']('NOW()',_0xfd1d('0x60'))[_0xfd1d('0xac')](_0xfd1d('0xad'))['where'](_0xfd1d('0xae'))[_0xfd1d('0x47')]('ListId\x20=\x20?',_0x5cf161[_0xfd1d('0xab')]['toString']())[_0xfd1d('0x47')](_0xfd1d('0xaf'))[_0xfd1d('0x47')](_0xfd1d('0xb0'),squel[_0xfd1d('0xa8')]()['field'](_0xfd1d('0xb1'))[_0xfd1d('0xac')]('cm_hopper_final')[_0xfd1d('0x47')](_0xfd1d('0x88'),_0x392c5b[_0xfd1d('0x50')]['id'][_0xfd1d('0x8b')]()))[_0xfd1d('0x47')](_0xfd1d('0xb0'),squel[_0xfd1d('0xa8')]()[_0xfd1d('0xa9')]('COALESCE(phone,\x27\x27)')['from'](_0xfd1d('0xa2'))[_0xfd1d('0x47')](_0xfd1d('0x88'),_0x392c5b[_0xfd1d('0x50')]['id']['toString']())))['toString']();break;case'onlyIfOpen':_0x4dac36=squel['insert']()[_0xfd1d('0xa1')](_0xfd1d('0xa2'))['fromQuery'](['phone','scheduledAt',_0xfd1d('0xa6'),_0xfd1d('0xa7'),'VoiceQueueId',_0xfd1d('0x5f'),_0xfd1d('0x60')],squel[_0xfd1d('0xa8')]()[_0xfd1d('0xa9')](_0xfd1d('0xa4'),'phone')[_0xfd1d('0xa9')]('NOW()',_0xfd1d('0xa5'))[_0xfd1d('0xa9')]('id',_0xfd1d('0xa6'))['field'](_0x5cf161[_0xfd1d('0xab')][_0xfd1d('0x8b')](),_0xfd1d('0xa7'))[_0xfd1d('0xa9')](_0x392c5b['params']['id'][_0xfd1d('0x8b')](),_0xfd1d('0x65'))[_0xfd1d('0xa9')](_0xfd1d('0xaa'),_0xfd1d('0x5f'))[_0xfd1d('0xa9')](_0xfd1d('0xaa'),_0xfd1d('0x60'))[_0xfd1d('0xac')](_0xfd1d('0xad'))[_0xfd1d('0x47')]('deletedAt\x20IS\x20NULL')[_0xfd1d('0x47')]('ListId\x20=\x20?',_0x5cf161[_0xfd1d('0xab')]['toString']())[_0xfd1d('0x47')]('phone\x20IS\x20NOT\x20NULL')[_0xfd1d('0x47')](_0xfd1d('0xb0'),squel[_0xfd1d('0xa8')]()['field']('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xfd1d('0x47')]('VoiceQueueId\x20=\x20?',_0x392c5b[_0xfd1d('0x50')]['id']['toString']())))[_0xfd1d('0x8b')]();break;default:_0x4dac36=squel[_0xfd1d('0xa0')]()[_0xfd1d('0xa1')](_0xfd1d('0xa2'))['fromQuery']([_0xfd1d('0xa4'),_0xfd1d('0xa5'),_0xfd1d('0xa6'),_0xfd1d('0xa7'),_0xfd1d('0x65'),_0xfd1d('0x5f'),_0xfd1d('0x60')],squel['select']()[_0xfd1d('0xa9')]('phone',_0xfd1d('0xa4'))[_0xfd1d('0xa9')](_0xfd1d('0xaa'),'scheduledAt')[_0xfd1d('0xa9')]('id','ContactId')[_0xfd1d('0xa9')](_0x5cf161[_0xfd1d('0xab')][_0xfd1d('0x8b')](),_0xfd1d('0xa7'))['field'](_0x392c5b['params']['id']['toString'](),_0xfd1d('0x65'))['field'](_0xfd1d('0xaa'),_0xfd1d('0x5f'))[_0xfd1d('0xa9')](_0xfd1d('0xaa'),_0xfd1d('0x60'))[_0xfd1d('0xac')]('cm_contacts')['where'](_0xfd1d('0xae'))[_0xfd1d('0x47')]('ListId\x20=\x20?',_0x5cf161['CmListId'][_0xfd1d('0x8b')]())[_0xfd1d('0x47')](_0xfd1d('0xaf')))[_0xfd1d('0x8b')]();}_0x36155b[_0xfd1d('0x8a')](db[_0xfd1d('0x78')]['query'](_0x4dac36));}return BPromise[_0xfd1d('0x90')](_0x36155b);}})[_0xfd1d('0x2a')](function(){return _0x255564;})[_0xfd1d('0x2a')](respondWithResult(_0x3f321a,null))[_0xfd1d('0x4e')](handleError(_0x3f321a,null));};exports[_0xfd1d('0xb2')]=function(_0x44a493,_0x2c2c89,_0x27f3cb){return db[_0xfd1d('0x4c')][_0xfd1d('0x35')]({'where':{'id':_0x44a493[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0x2c2c89,null))[_0xfd1d('0x2a')](function(_0x58e0c3){if(_0x58e0c3){return _0x58e0c3[_0xfd1d('0xb2')](_0x44a493[_0xfd1d('0x40')]['ids']);}})['then'](function(_0x507d31){if(_0x507d31){return db[_0xfd1d('0x66')][_0xfd1d('0x2b')]({'where':{'ListId':_0x44a493[_0xfd1d('0x40')][_0xfd1d('0x82')],'VoiceQueueId':_0x44a493[_0xfd1d('0x50')]['id']}})['then'](function(){return _0x507d31;});}})[_0xfd1d('0x2a')](respondWithStatusCode(_0x2c2c89,null))[_0xfd1d('0x4e')](handleError(_0x2c2c89,null));};exports['getBlackLists']=function(_0x329cb6,_0xc0e5f3,_0xcc3463){var _0x2b1583={};var _0xc3f616={};var _0x1ddae0;var _0x5c6f44;return db[_0xfd1d('0x4c')][_0xfd1d('0x63')]({'where':{'id':_0x329cb6['params']['id']}})['then'](handleEntityNotFound(_0xc0e5f3,null))['then'](function(_0x44ca2d){if(_0x44ca2d){_0x1ddae0=_0x44ca2d;_0xc3f616['model']=_[_0xfd1d('0x51')](db[_0xfd1d('0xb3')][_0xfd1d('0x3b')]);_0xc3f616['query']=_[_0xfd1d('0x51')](_0x329cb6[_0xfd1d('0x40')]);_0xc3f616[_0xfd1d('0x3d')]=_['intersection'](_0xc3f616[_0xfd1d('0x3f')],_0xc3f616[_0xfd1d('0x40')]);_0x2b1583['attributes']=_[_0xfd1d('0x3e')](_0xc3f616['model'],qs[_0xfd1d('0x42')](_0x329cb6[_0xfd1d('0x40')][_0xfd1d('0x42')]));_0x2b1583[_0xfd1d('0x41')]=_0x2b1583[_0xfd1d('0x41')][_0xfd1d('0x43')]?_0x2b1583[_0xfd1d('0x41')]:_0xc3f616[_0xfd1d('0x3f')];_0x2b1583[_0xfd1d('0x45')]=qs[_0xfd1d('0x46')](_0x329cb6[_0xfd1d('0x40')][_0xfd1d('0x46')]);_0x2b1583[_0xfd1d('0x47')]=qs['filters'](_[_0xfd1d('0x48')](_0x329cb6['query'],_0xc3f616[_0xfd1d('0x3d')]));if(_0x329cb6[_0xfd1d('0x40')]['filter']){_0x2b1583[_0xfd1d('0x47')]=_[_0xfd1d('0x4a')](_0x2b1583[_0xfd1d('0x47')],{'$or':_[_0xfd1d('0x32')](_0x2b1583[_0xfd1d('0x41')],function(_0xc01f82){var _0x5b1011={};_0x5b1011[_0xc01f82]={'$like':'%'+_0x329cb6[_0xfd1d('0x40')]['filter']+'%'};return _0x5b1011;})});}_0x2b1583=_[_0xfd1d('0x4a')]({},_0x2b1583,_0x329cb6['options']);return _0x1ddae0[_0xfd1d('0xb4')](_0x2b1583);}})[_0xfd1d('0x2a')](function(_0xeab28b){if(_0xeab28b){_0x5c6f44=_0xeab28b[_0xfd1d('0x43')];if(!_0x329cb6[_0xfd1d('0x40')]['hasOwnProperty']('nolimit')){_0x2b1583[_0xfd1d('0x24')]=qs['limit'](_0x329cb6[_0xfd1d('0x40')][_0xfd1d('0x24')]);_0x2b1583[_0xfd1d('0x22')]=qs[_0xfd1d('0x22')](_0x329cb6[_0xfd1d('0x40')]['offset']);}return _0x1ddae0[_0xfd1d('0xb4')](_0x2b1583);}})[_0xfd1d('0x2a')](function(_0xd54282){if(_0xd54282){return _0xd54282?{'count':_0x5c6f44,'rows':_0xd54282}:null;}})[_0xfd1d('0x2a')](respondWithResult(_0xc0e5f3,null))['catch'](handleError(_0xc0e5f3,null));};exports['addBlackLists']=function(_0x223959,_0x14c076,_0x988900){var _0x276644,_0xf3172;return db[_0xfd1d('0x4c')][_0xfd1d('0x35')]({'where':{'id':_0x223959[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0x14c076,null))[_0xfd1d('0x2a')](function(_0x50f7a6){if(_0x50f7a6){_0xf3172=_0x50f7a6;return _0x50f7a6[_0xfd1d('0xb5')](_0x223959[_0xfd1d('0x61')][_0xfd1d('0x82')],_[_0xfd1d('0x5e')](_0x223959['body'],[_0xfd1d('0x82'),'id'])||{});}return null;})['spread'](function(_0xb5b95b){var _0x106705;_0x276644=_0xb5b95b||[];var _0x6cb898=[];if(_0xb5b95b){for(var _0x3afbcd=0x0;_0x3afbcd<_0xb5b95b[_0xfd1d('0x43')];_0x3afbcd+=0x1){var _0x4aedf5=_0xb5b95b[_0x3afbcd]['get']({'plain':!![]});_0x106705=squel[_0xfd1d('0xa0')]()[_0xfd1d('0xa1')](_0xfd1d('0xb6'))['fromQuery']([_0xfd1d('0xa4'),_0xfd1d('0xa6'),_0xfd1d('0xa7'),_0xfd1d('0x65'),'createdAt',_0xfd1d('0x60')],squel[_0xfd1d('0xa8')]()[_0xfd1d('0xa9')](_0xfd1d('0xa4'),_0xfd1d('0xa4'))['field']('id',_0xfd1d('0xa6'))[_0xfd1d('0xa9')](_0x4aedf5[_0xfd1d('0xab')][_0xfd1d('0x8b')](),_0xfd1d('0xa7'))['field'](_0x223959[_0xfd1d('0x50')]['id']['toString'](),_0xfd1d('0x65'))['field']('NOW()',_0xfd1d('0x5f'))[_0xfd1d('0xa9')](_0xfd1d('0xaa'),_0xfd1d('0x60'))[_0xfd1d('0xac')](_0xfd1d('0xad'))[_0xfd1d('0x47')](_0xfd1d('0xae'))[_0xfd1d('0x47')](_0xfd1d('0xb7'),_0x4aedf5[_0xfd1d('0xab')]['toString']())[_0xfd1d('0x47')](_0xfd1d('0xaf')))[_0xfd1d('0x8b')]();_0x6cb898[_0xfd1d('0x8a')](db[_0xfd1d('0x78')][_0xfd1d('0x40')](_0x106705));}return BPromise[_0xfd1d('0x90')](_0x6cb898);}})[_0xfd1d('0x2a')](function(){return _0x276644;})[_0xfd1d('0x2a')](respondWithResult(_0x14c076,null))['catch'](handleError(_0x14c076,null));};exports['removeBlackLists']=function(_0x57bf51,_0x4d3bbc,_0x284e90){return db[_0xfd1d('0x4c')]['find']({'where':{'id':_0x57bf51[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](handleEntityNotFound(_0x4d3bbc,null))[_0xfd1d('0x2a')](function(_0x54bc8e){if(_0x54bc8e){return _0x54bc8e[_0xfd1d('0xb8')](_0x57bf51['query'][_0xfd1d('0x82')]);}})[_0xfd1d('0x2a')](function(_0x1726b9){if(_0x1726b9){return db[_0xfd1d('0x6e')][_0xfd1d('0x2b')]({'where':{'ListId':_0x57bf51[_0xfd1d('0x40')][_0xfd1d('0x82')],'VoiceQueueId':_0x57bf51[_0xfd1d('0x50')]['id']}})[_0xfd1d('0x2a')](function(){return _0x1726b9;});}})[_0xfd1d('0x2a')](respondWithStatusCode(_0x4d3bbc,null))[_0xfd1d('0x4e')](handleError(_0x4d3bbc,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 2cd21de..0db3b34 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 _0x6be2=['emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove'];(function(_0x1c2f29,_0xd124c4){var _0x6d56aa=function(_0x444b72){while(--_0x444b72){_0x1c2f29['push'](_0x1c2f29['shift']());}};_0x6d56aa(++_0xd124c4);}(_0x6be2,0x107));var _0x26be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6be2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x26be('0x0'));var VoiceQueue=require(_0x26be('0x1'))['db'][_0x26be('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x26be('0x3')](0x0);var events={'afterCreate':_0x26be('0x4'),'afterUpdate':_0x26be('0x5'),'afterDestroy':_0x26be('0x6')};function emitEvent(_0x15ca55){return function(_0x39c1e6,_0x55fde5,_0xf5dc6b){VoiceQueueEvents[_0x26be('0x7')](_0x15ca55+':'+_0x39c1e6['id'],_0x39c1e6);VoiceQueueEvents[_0x26be('0x7')](_0x15ca55,_0x39c1e6);_0xf5dc6b(null);};}for(var e in events){if(events[_0x26be('0x8')](e)){var event=events[e];VoiceQueue[_0x26be('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x43ed=['exports','events','../../mysqldb','VoiceQueue','save','remove','emit','hasOwnProperty'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x43ed,0xe1));var _0xd43e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x43ed[_0x4243a3];return _0x1b2a33;};'use strict';var EventEmitter=require(_0xd43e('0x0'));var VoiceQueue=require(_0xd43e('0x1'))['db'][_0xd43e('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd43e('0x3'),'afterUpdate':'update','afterDestroy':_0xd43e('0x4')};function emitEvent(_0x3b2b4f){return function(_0x2b5de3,_0x280728,_0x198222){VoiceQueueEvents[_0xd43e('0x5')](_0x3b2b4f+':'+_0x2b5de3['id'],_0x2b5de3);VoiceQueueEvents[_0xd43e('0x5')](_0x3b2b4f,_0x2b5de3);_0x198222(null);};}for(var e in events){if(events[_0xd43e('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xd43e('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 1d6575e..ef448d8 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x582f7e,_0x4cd7ba){var _0x1ac226=function(_0x40b322){while(--_0x40b322){_0x582f7e['push'](_0x582f7e['shift']());}};_0x1ac226(++_0x4cd7ba);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0xf3b3e7,_0x1b2afc){var _0x4a22a2=function(_0x3987db){while(--_0x3987db){_0xf3b3e7['push'](_0xf3b3e7['shift']());}};_0x4a22a2(++_0x1b2afc);}(_0x3e74,0x175));var _0x43e7=function(_0x5e3020,_0x3da9bf){_0x5e3020=_0x5e3020-0x0;var _0x4f866f=_0x3e74[_0x5e3020];return _0x4f866f;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index bb11c8a..1c7187b 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 _0x97b7=['include','map','model','then','stringify','ShowVoiceQueue','find','raw','where','debug','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','./voiceQueue.socket','register','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','attributes'];(function(_0x1d2a77,_0x3bcfe5){var _0x5bab7d=function(_0xe3a05a){while(--_0xe3a05a){_0x1d2a77['push'](_0x1d2a77['shift']());}};_0x5bab7d(++_0x3bcfe5);}(_0x97b7,0xbe));var _0x797b=function(_0x4efc7a,_0x398453){_0x4efc7a=_0x4efc7a-0x0;var _0x15c38e=_0x97b7[_0x4efc7a];return _0x15c38e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x797b('0x0'));var rs=require(_0x797b('0x1'));var fs=require('fs');var Redis=require(_0x797b('0x2'));var db=require(_0x797b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x797b('0x4'))('rpc');var config=require(_0x797b('0x5'));var jayson=require(_0x797b('0x6'));var client=jayson[_0x797b('0x7')][_0x797b('0x8')]({'port':0x232a});config[_0x797b('0x9')]=_[_0x797b('0xa')](config[_0x797b('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x797b('0x9')]));require(_0x797b('0xb'))[_0x797b('0xc')](socket);function respondWithRpcPromise(_0x27c085,_0x211d0b,_0x524cf3){return new BPromise(function(_0x2ad199,_0xa073cf){return client['request'](_0x27c085,_0x524cf3)['then'](function(_0x4e0ee3){logger[_0x797b('0xd')](_0x797b('0xe'),_0x211d0b,_0x797b('0xf'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x211d0b,'request\x20sent',JSON['stringify'](_0x4e0ee3));if(_0x4e0ee3[_0x797b('0x10')]){if(_0x4e0ee3['error'][_0x797b('0x11')]===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x211d0b,_0x4e0ee3[_0x797b('0x10')][_0x797b('0x12')]);return _0xa073cf(_0x4e0ee3[_0x797b('0x10')][_0x797b('0x12')]);}logger[_0x797b('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x211d0b,_0x4e0ee3[_0x797b('0x10')][_0x797b('0x12')]);return _0x2ad199(_0x4e0ee3['error'][_0x797b('0x12')]);}else{logger['info'](_0x797b('0xe'),_0x211d0b,_0x797b('0xf'));_0x2ad199(_0x4e0ee3[_0x797b('0x13')]['message']);}})[_0x797b('0x14')](function(_0x518422){logger[_0x797b('0x10')](_0x797b('0xe'),_0x211d0b,_0x518422);_0xa073cf(_0x518422);});});}exports[_0x797b('0x15')]=function(_0x32b96c){var _0x53033e=this;return new Promise(function(_0xae6bdb,_0x2e77d1){return db[_0x797b('0x16')][_0x797b('0x17')]({'raw':_0x32b96c[_0x797b('0x18')]?_0x32b96c[_0x797b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x32b96c['options']?_0x32b96c['options']['where']||null:null,'attributes':_0x32b96c[_0x797b('0x18')]?_0x32b96c[_0x797b('0x18')][_0x797b('0x19')]||null:null,'limit':_0x32b96c[_0x797b('0x18')]?_0x32b96c[_0x797b('0x18')]['limit']||null:null,'include':_0x32b96c[_0x797b('0x18')]?_0x32b96c[_0x797b('0x18')][_0x797b('0x1a')]?_[_0x797b('0x1b')](_0x32b96c['options'][_0x797b('0x1a')],function(_0x966100){return{'model':db[_0x966100[_0x797b('0x1c')]],'as':_0x966100['as'],'attributes':_0x966100[_0x797b('0x19')],'include':_0x966100[_0x797b('0x1a')]?_[_0x797b('0x1b')](_0x966100[_0x797b('0x1a')],function(_0x3af530){return{'model':db[_0x3af530['model']],'as':_0x3af530['as'],'attributes':_0x3af530[_0x797b('0x19')],'include':_0x3af530['include']?_['map'](_0x3af530[_0x797b('0x1a')],function(_0x521e1b){return{'model':db[_0x521e1b[_0x797b('0x1c')]],'as':_0x521e1b['as'],'attributes':_0x521e1b['attributes']};}):[]};}):[]};}):[]:[]})[_0x797b('0x1d')](function(_0x3860d4){logger[_0x797b('0xd')](_0x797b('0x15'),_0x32b96c);logger['debug'](_0x797b('0x15'),_0x32b96c,JSON[_0x797b('0x1e')](_0x3860d4));_0xae6bdb(_0x3860d4);})[_0x797b('0x14')](function(_0x57e246){logger[_0x797b('0x10')]('GetVoiceQueue',_0x57e246[_0x797b('0x12')],_0x32b96c);_0x2e77d1(_0x53033e[_0x797b('0x10')](0x1f4,_0x57e246[_0x797b('0x12')]));});});};exports[_0x797b('0x1f')]=function(_0x542600){var _0x1169bb=this;return new Promise(function(_0x2078c2,_0x283708){return db['VoiceQueue'][_0x797b('0x20')]({'raw':_0x542600[_0x797b('0x18')]?_0x542600[_0x797b('0x18')][_0x797b('0x21')]===undefined?!![]:![]:!![],'where':_0x542600[_0x797b('0x18')]?_0x542600[_0x797b('0x18')][_0x797b('0x22')]||null:null,'attributes':_0x542600['options']?_0x542600[_0x797b('0x18')][_0x797b('0x19')]||null:null,'include':_0x542600[_0x797b('0x18')]?_0x542600['options']['include']?_[_0x797b('0x1b')](_0x542600['options'][_0x797b('0x1a')],function(_0x138832){return{'model':db[_0x138832[_0x797b('0x1c')]],'as':_0x138832['as'],'attributes':_0x138832['attributes'],'include':_0x138832[_0x797b('0x1a')]?_['map'](_0x138832['include'],function(_0x2b47f4){return{'model':db[_0x2b47f4[_0x797b('0x1c')]],'as':_0x2b47f4['as'],'attributes':_0x2b47f4[_0x797b('0x19')],'include':_0x2b47f4[_0x797b('0x1a')]?_['map'](_0x2b47f4[_0x797b('0x1a')],function(_0x15e83f){return{'model':db[_0x15e83f[_0x797b('0x1c')]],'as':_0x15e83f['as'],'attributes':_0x15e83f[_0x797b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x797b('0x1d')](function(_0x5a8bdf){logger[_0x797b('0xd')](_0x797b('0x1f'),_0x542600);logger[_0x797b('0x23')](_0x797b('0x1f'),_0x542600,JSON['stringify'](_0x5a8bdf));_0x2078c2(_0x5a8bdf);})['catch'](function(_0x3f2b6d){logger[_0x797b('0x10')](_0x797b('0x1f'),_0x3f2b6d[_0x797b('0x12')],_0x542600);_0x283708(_0x1169bb[_0x797b('0x10')](0x1f4,_0x3f2b6d[_0x797b('0x12')]));});});}; \ No newline at end of file +var _0xe012=['catch','VoiceQueue','findAll','options','raw','where','attributes','limit','map','include','model','then','GetVoiceQueue','ShowVoiceQueue','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./voiceQueue.socket','register','request','info','request\x20sent','debug','stringify','error','VoiceQueue,\x20%s,\x20%s','message','result'];(function(_0x34e4a0,_0x1fd446){var _0x3ead3e=function(_0x47adec){while(--_0x47adec){_0x34e4a0['push'](_0x34e4a0['shift']());}};_0x3ead3e(++_0x1fd446);}(_0xe012,0xcd));var _0x2e01=function(_0x4e51ce,_0x5ad901){_0x4e51ce=_0x4e51ce-0x0;var _0x48cfa7=_0xe012[_0x4e51ce];return _0x48cfa7;};'use strict';var _=require(_0x2e01('0x0'));var util=require(_0x2e01('0x1'));var moment=require('moment');var BPromise=require(_0x2e01('0x2'));var rs=require(_0x2e01('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e01('0x4'))['db'];var utils=require(_0x2e01('0x5'));var logger=require('../../config/logger')(_0x2e01('0x6'));var config=require(_0x2e01('0x7'));var jayson=require(_0x2e01('0x8'));var client=jayson[_0x2e01('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x2e01('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x2e01('0xb'))(new Redis(config[_0x2e01('0xa')]));require(_0x2e01('0xc'))[_0x2e01('0xd')](socket);function respondWithRpcPromise(_0xd90ddf,_0x126118,_0x580890){return new BPromise(function(_0xa21e02,_0x4f56f2){return client[_0x2e01('0xe')](_0xd90ddf,_0x580890)['then'](function(_0x2c109d){logger[_0x2e01('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x126118,_0x2e01('0x10'));logger[_0x2e01('0x11')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x126118,'request\x20sent',JSON[_0x2e01('0x12')](_0x2c109d));if(_0x2c109d[_0x2e01('0x13')]){if(_0x2c109d[_0x2e01('0x13')]['code']===0x1f4){logger[_0x2e01('0x13')](_0x2e01('0x14'),_0x126118,_0x2c109d[_0x2e01('0x13')]['message']);return _0x4f56f2(_0x2c109d[_0x2e01('0x13')][_0x2e01('0x15')]);}logger[_0x2e01('0x13')](_0x2e01('0x14'),_0x126118,_0x2c109d['error']['message']);return _0xa21e02(_0x2c109d[_0x2e01('0x13')]['message']);}else{logger['info'](_0x2e01('0x14'),_0x126118,_0x2e01('0x10'));_0xa21e02(_0x2c109d[_0x2e01('0x16')][_0x2e01('0x15')]);}})[_0x2e01('0x17')](function(_0x169766){logger[_0x2e01('0x13')](_0x2e01('0x14'),_0x126118,_0x169766);_0x4f56f2(_0x169766);});});}exports['GetVoiceQueue']=function(_0x1c1f8f){var _0x27a94e=this;return new Promise(function(_0x323138,_0x54bc75){return db[_0x2e01('0x18')][_0x2e01('0x19')]({'raw':_0x1c1f8f[_0x2e01('0x1a')]?_0x1c1f8f[_0x2e01('0x1a')][_0x2e01('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c1f8f[_0x2e01('0x1a')]?_0x1c1f8f[_0x2e01('0x1a')][_0x2e01('0x1c')]||null:null,'attributes':_0x1c1f8f[_0x2e01('0x1a')]?_0x1c1f8f[_0x2e01('0x1a')][_0x2e01('0x1d')]||null:null,'limit':_0x1c1f8f[_0x2e01('0x1a')]?_0x1c1f8f[_0x2e01('0x1a')][_0x2e01('0x1e')]||null:null,'include':_0x1c1f8f[_0x2e01('0x1a')]?_0x1c1f8f['options']['include']?_[_0x2e01('0x1f')](_0x1c1f8f[_0x2e01('0x1a')][_0x2e01('0x20')],function(_0x5e308d){return{'model':db[_0x5e308d[_0x2e01('0x21')]],'as':_0x5e308d['as'],'attributes':_0x5e308d[_0x2e01('0x1d')],'include':_0x5e308d[_0x2e01('0x20')]?_[_0x2e01('0x1f')](_0x5e308d['include'],function(_0x4263e6){return{'model':db[_0x4263e6[_0x2e01('0x21')]],'as':_0x4263e6['as'],'attributes':_0x4263e6[_0x2e01('0x1d')],'include':_0x4263e6[_0x2e01('0x20')]?_[_0x2e01('0x1f')](_0x4263e6['include'],function(_0xc434d9){return{'model':db[_0xc434d9[_0x2e01('0x21')]],'as':_0xc434d9['as'],'attributes':_0xc434d9[_0x2e01('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2e01('0x22')](function(_0x5c2bd3){logger[_0x2e01('0xf')](_0x2e01('0x23'),_0x1c1f8f);logger['debug'](_0x2e01('0x23'),_0x1c1f8f,JSON[_0x2e01('0x12')](_0x5c2bd3));_0x323138(_0x5c2bd3);})[_0x2e01('0x17')](function(_0x3837d7){logger[_0x2e01('0x13')](_0x2e01('0x23'),_0x3837d7[_0x2e01('0x15')],_0x1c1f8f);_0x54bc75(_0x27a94e[_0x2e01('0x13')](0x1f4,_0x3837d7[_0x2e01('0x15')]));});});};exports[_0x2e01('0x24')]=function(_0x1af9b9){var _0x32c97e=this;return new Promise(function(_0x2acc55,_0x3a04e0){return db[_0x2e01('0x18')][_0x2e01('0x25')]({'raw':_0x1af9b9[_0x2e01('0x1a')]?_0x1af9b9['options']['raw']===undefined?!![]:![]:!![],'where':_0x1af9b9[_0x2e01('0x1a')]?_0x1af9b9[_0x2e01('0x1a')][_0x2e01('0x1c')]||null:null,'attributes':_0x1af9b9[_0x2e01('0x1a')]?_0x1af9b9[_0x2e01('0x1a')][_0x2e01('0x1d')]||null:null,'include':_0x1af9b9[_0x2e01('0x1a')]?_0x1af9b9[_0x2e01('0x1a')][_0x2e01('0x20')]?_['map'](_0x1af9b9['options']['include'],function(_0x2ad55c){return{'model':db[_0x2ad55c[_0x2e01('0x21')]],'as':_0x2ad55c['as'],'attributes':_0x2ad55c[_0x2e01('0x1d')],'include':_0x2ad55c[_0x2e01('0x20')]?_[_0x2e01('0x1f')](_0x2ad55c[_0x2e01('0x20')],function(_0x19b80c){return{'model':db[_0x19b80c[_0x2e01('0x21')]],'as':_0x19b80c['as'],'attributes':_0x19b80c[_0x2e01('0x1d')],'include':_0x19b80c[_0x2e01('0x20')]?_[_0x2e01('0x1f')](_0x19b80c['include'],function(_0x1f4389){return{'model':db[_0x1f4389[_0x2e01('0x21')]],'as':_0x1f4389['as'],'attributes':_0x1f4389[_0x2e01('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12f7a0){logger[_0x2e01('0xf')](_0x2e01('0x24'),_0x1af9b9);logger[_0x2e01('0x11')](_0x2e01('0x24'),_0x1af9b9,JSON[_0x2e01('0x12')](_0x12f7a0));_0x2acc55(_0x12f7a0);})[_0x2e01('0x17')](function(_0x5a7453){logger[_0x2e01('0x13')](_0x2e01('0x24'),_0x5a7453['message'],_0x1af9b9);_0x3a04e0(_0x32c97e[_0x2e01('0x13')](0x1f4,_0x5a7453[_0x2e01('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 0452fd0..c27e105 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 _0x9712=['remove','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x2fed8b,_0x35601d){var _0x44819b=function(_0x480276){while(--_0x480276){_0x2fed8b['push'](_0x2fed8b['shift']());}};_0x44819b(++_0x35601d);}(_0x9712,0xf6));var _0x2971=function(_0x3a51f0,_0x84e1c7){_0x3a51f0=_0x3a51f0-0x0;var _0x11c7c8=_0x9712[_0x3a51f0];return _0x11c7c8;};'use strict';var VoiceQueueEvents=require(_0x2971('0x0'));var events=[_0x2971('0x1'),_0x2971('0x2'),'update'];function createListener(_0x14f2c0,_0x3ab9a5){return function(_0x5335ae){_0x3ab9a5[_0x2971('0x3')](_0x14f2c0,_0x5335ae);};}function removeListener(_0x32f833,_0xd60555){return function(){VoiceQueueEvents[_0x2971('0x4')](_0x32f833,_0xd60555);};}exports[_0x2971('0x5')]=function(_0x33c18b){for(var _0x176adc=0x0,_0x2a6f20=events[_0x2971('0x6')];_0x176adc<_0x2a6f20;_0x176adc++){var _0xbb4c2c=events[_0x176adc];var _0x267ebf=createListener(_0x2971('0x7')+_0xbb4c2c,_0x33c18b);VoiceQueueEvents['on'](_0xbb4c2c,_0x267ebf);}}; \ No newline at end of file +var _0xdb41=['removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x52e040,_0x583d2f){var _0x4cd278=function(_0xa844b5){while(--_0xa844b5){_0x52e040['push'](_0x52e040['shift']());}};_0x4cd278(++_0x583d2f);}(_0xdb41,0xac));var _0x1db4=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0xdb41[_0x31b9cf];return _0x357b8a;};'use strict';var VoiceQueueEvents=require(_0x1db4('0x0'));var events=[_0x1db4('0x1'),_0x1db4('0x2'),'update'];function createListener(_0x4255bb,_0x100e44){return function(_0x1cc53a){_0x100e44['emit'](_0x4255bb,_0x1cc53a);};}function removeListener(_0x5d39e5,_0x3da696){return function(){VoiceQueueEvents[_0x1db4('0x3')](_0x5d39e5,_0x3da696);};}exports[_0x1db4('0x4')]=function(_0x37f2ea){for(var _0x2ba515=0x0,_0x4d9599=events[_0x1db4('0x5')];_0x2ba515<_0x4d9599;_0x2ba515++){var _0x2324fb=events[_0x2ba515];var _0x14c51a=createListener(_0x1db4('0x6')+_0x2324fb,_0x37f2ea);VoiceQueueEvents['on'](_0x2324fb,_0x14c51a);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index e79cd54..9b4323b 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 _0xa4f9=['delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','./voiceQueueReport.controller','isAuthenticated','get','/describe','describe','/index','getVoiceQueuesReport','/:id','create','put','update'];(function(_0x2f8530,_0x5cbd67){var _0x5e814e=function(_0x490b29){while(--_0x490b29){_0x2f8530['push'](_0x2f8530['shift']());}};_0x5e814e(++_0x5cbd67);}(_0xa4f9,0x1cb));var _0x9a4f=function(_0x33a8b6,_0x277343){_0x33a8b6=_0x33a8b6-0x0;var _0x33959c=_0xa4f9[_0x33a8b6];return _0x33959c;};'use strict';var multer=require('multer');var util=require(_0x9a4f('0x0'));var path=require('path');var timeout=require(_0x9a4f('0x1'));var express=require(_0x9a4f('0x2'));var router=express[_0x9a4f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9a4f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9a4f('0x5'));router['get']('/',auth[_0x9a4f('0x6')](),controller['index']);router[_0x9a4f('0x7')](_0x9a4f('0x8'),auth[_0x9a4f('0x6')](),controller[_0x9a4f('0x9')]);router[_0x9a4f('0x7')](_0x9a4f('0xa'),auth[_0x9a4f('0x6')](),controller[_0x9a4f('0xb')]);router[_0x9a4f('0x7')](_0x9a4f('0xc'),auth[_0x9a4f('0x6')](),controller['show']);router['post']('/',auth[_0x9a4f('0x6')](),controller[_0x9a4f('0xd')]);router[_0x9a4f('0xe')](_0x9a4f('0xc'),auth[_0x9a4f('0x6')](),controller[_0x9a4f('0xf')]);router[_0x9a4f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9a4f('0x11')]);module[_0x9a4f('0x12')]=router; \ No newline at end of file +var _0xe86a=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','index','/describe','describe','/index','isAuthenticated','getVoiceQueuesReport','/:id','post','create','put','update','destroy'];(function(_0x305bd0,_0x41a0b7){var _0x40d5dd=function(_0x3c167e){while(--_0x3c167e){_0x305bd0['push'](_0x305bd0['shift']());}};_0x40d5dd(++_0x41a0b7);}(_0xe86a,0xb1));var _0xae86=function(_0x39dc1d,_0x1535d5){_0x39dc1d=_0x39dc1d-0x0;var _0x5e2f0c=_0xe86a[_0x39dc1d];return _0x5e2f0c;};'use strict';var multer=require('multer');var util=require(_0xae86('0x0'));var path=require(_0xae86('0x1'));var timeout=require(_0xae86('0x2'));var express=require(_0xae86('0x3'));var router=express['Router']();var fs_extra=require(_0xae86('0x4'));var auth=require(_0xae86('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xae86('0x6'));var controller=require(_0xae86('0x7'));router[_0xae86('0x8')]('/',auth['isAuthenticated'](),controller[_0xae86('0x9')]);router[_0xae86('0x8')](_0xae86('0xa'),auth['isAuthenticated'](),controller[_0xae86('0xb')]);router['get'](_0xae86('0xc'),auth[_0xae86('0xd')](),controller[_0xae86('0xe')]);router['get'](_0xae86('0xf'),auth[_0xae86('0xd')](),controller['show']);router[_0xae86('0x10')]('/',auth[_0xae86('0xd')](),controller[_0xae86('0x11')]);router[_0xae86('0x12')]('/:id',auth[_0xae86('0xd')](),controller[_0xae86('0x13')]);router['delete'](_0xae86('0xf'),auth['isAuthenticated'](),controller[_0xae86('0x14')]);module[_0xae86('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 2891c11..507c07a 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 _0x6ae4=['format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','DATE','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','moment','exports','STRING','getDataValue','queuecallerjoinAt'];(function(_0x10e3ce,_0x5a9272){var _0x2cf532=function(_0x29f052){while(--_0x29f052){_0x10e3ce['push'](_0x10e3ce['shift']());}};_0x2cf532(++_0x5a9272);}(_0x6ae4,0xeb));var _0x46ae=function(_0x129767,_0x1b8fa8){_0x129767=_0x129767-0x0;var _0xbc8b4b=_0x6ae4[_0x129767];return _0xbc8b4b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x46ae('0x0'));module[_0x46ae('0x1')]={'type':{'type':Sequelize[_0x46ae('0x2')]},'uniqueid':{'type':Sequelize[_0x46ae('0x2')]},'calleridnum':{'type':Sequelize[_0x46ae('0x2')]},'calleridname':{'type':Sequelize[_0x46ae('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x29447b){var _0x3d5921=moment(_0x29447b);var _0x271d19=moment(this[_0x46ae('0x3')](_0x46ae('0x4')))[_0x46ae('0x5')](_0x46ae('0x6'));var _0x53517e=_0x3d5921[_0x46ae('0x7')](_0x271d19,_0x46ae('0x8'));this[_0x46ae('0x9')](_0x46ae('0xa'),_0x29447b);this[_0x46ae('0x9')](_0x46ae('0xb'),_0x53517e||null);}},'position':{'type':Sequelize[_0x46ae('0xc')]},'count':{'type':Sequelize[_0x46ae('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x46ae('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x46ae('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x46ae('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x46ae('0xe')]},'queuecallerexitreason':{'type':Sequelize[_0x46ae('0x2')],'comment':_0x46ae('0xf')},'originalposition':{'type':Sequelize[_0x46ae('0xc')]},'channel':{'type':Sequelize[_0x46ae('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x46ae('0x2')]},'accountcode':{'type':Sequelize[_0x46ae('0x2')]},'context':{'type':Sequelize[_0x46ae('0x2')]},'exten':{'type':Sequelize[_0x46ae('0x2')]},'priority':{'type':Sequelize[_0x46ae('0x2')]},'holdtime':{'type':Sequelize[_0x46ae('0xc')]},'mohtime':{'type':Sequelize[_0x46ae('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x46ae('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x46ae('0x2')]},'transfer':{'type':Sequelize[_0x46ae('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x46ae('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x46ae('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x46ae('0x2')]},'secondDisposition':{'type':Sequelize[_0x46ae('0x2')]},'thirdDisposition':{'type':Sequelize[_0x46ae('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x46ae('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0xec33=['diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x307296,_0x49b881){var _0x32f975=function(_0x4ed150){while(--_0x4ed150){_0x307296['push'](_0x307296['shift']());}};_0x32f975(++_0x49b881);}(_0xec33,0xd9));var _0x3ec3=function(_0x1cb5af,_0x19ebf8){_0x1cb5af=_0x1cb5af-0x0;var _0x15c952=_0xec33[_0x1cb5af];return _0x15c952;};'use strict';var Sequelize=require(_0x3ec3('0x0'));var moment=require('moment');module[_0x3ec3('0x1')]={'type':{'type':Sequelize[_0x3ec3('0x2')]},'uniqueid':{'type':Sequelize[_0x3ec3('0x2')]},'calleridnum':{'type':Sequelize[_0x3ec3('0x2')]},'calleridname':{'type':Sequelize[_0x3ec3('0x2')]},'queue':{'type':Sequelize[_0x3ec3('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x3ec3('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x3ec3('0x3')],'set':function(_0x52f63c){var _0x3d175c=moment(_0x52f63c);var _0x3df60b=moment(this[_0x3ec3('0x4')](_0x3ec3('0x5')))[_0x3ec3('0x6')](_0x3ec3('0x7'));var _0x3b37f2=_0x3d175c[_0x3ec3('0x8')](_0x3df60b,'seconds');this[_0x3ec3('0x9')](_0x3ec3('0xa'),_0x52f63c);this[_0x3ec3('0x9')](_0x3ec3('0xb'),_0x3b37f2||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x3ec3('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x3ec3('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3ec3('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x3ec3('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x3ec3('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3ec3('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x3ec3('0x2')],'comment':_0x3ec3('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x3ec3('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3ec3('0x2')]},'connectedlinename':{'type':Sequelize[_0x3ec3('0x2')]},'accountcode':{'type':Sequelize[_0x3ec3('0x2')]},'context':{'type':Sequelize[_0x3ec3('0x2')]},'exten':{'type':Sequelize[_0x3ec3('0x2')]},'priority':{'type':Sequelize[_0x3ec3('0x2')]},'holdtime':{'type':Sequelize[_0x3ec3('0xc')]},'mohtime':{'type':Sequelize[_0x3ec3('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3ec3('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3ec3('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x3ec3('0x2')]},'disposition':{'type':Sequelize[_0x3ec3('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3ec3('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x3ec3('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index c015958..3d39c4e 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 _0x7aca=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','findAll','catch','show','rawAttributes','include','options','find','create','body','update','params','describe','getVoiceQueuesReport','includeAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','offset','undefined','count','limit','set','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceQueueReport','fieldName','type','key','model','query','keys'];(function(_0x3c7b07,_0x101171){var _0x2b1fde=function(_0x54b936){while(--_0x54b936){_0x3c7b07['push'](_0x3c7b07['shift']());}};_0x2b1fde(++_0x101171);}(_0x7aca,0x164));var _0xa7ac=function(_0x4c96dd,_0x2045d3){_0x4c96dd=_0x4c96dd-0x0;var _0x52a76e=_0x7aca[_0x4c96dd];return _0x52a76e;};'use strict';var emlformat=require(_0xa7ac('0x0'));var rimraf=require(_0xa7ac('0x1'));var zipdir=require(_0xa7ac('0x2'));var jsonpatch=require(_0xa7ac('0x3'));var rp=require(_0xa7ac('0x4'));var moment=require(_0xa7ac('0x5'));var BPromise=require(_0xa7ac('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa7ac('0x7'));var csv=require(_0xa7ac('0x8'));var ejs=require(_0xa7ac('0x9'));var fs=require('fs');var fs_extra=require(_0xa7ac('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa7ac('0xb'));var deskjs=require(_0xa7ac('0xc'));var toCsv=require(_0xa7ac('0x8'));var querystring=require(_0xa7ac('0xd'));var Papa=require(_0xa7ac('0xe'));var Redis=require(_0xa7ac('0xf'));var authService=require(_0xa7ac('0x10'));var qs=require(_0xa7ac('0x11'));var as=require(_0xa7ac('0x12'));var hardwareService=require(_0xa7ac('0x13'));var logger=require(_0xa7ac('0x14'))(_0xa7ac('0x15'));var utils=require(_0xa7ac('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa7ac('0x17'));var db=require(_0xa7ac('0x18'))['db'];config[_0xa7ac('0x19')]=_[_0xa7ac('0x1a')](config[_0xa7ac('0x19')],{'host':_0xa7ac('0x1b'),'port':0x18eb});var socket=require(_0xa7ac('0x1c'))(new Redis(config[_0xa7ac('0x19')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x25a529,_0x4146f4){_0x4146f4=_0x4146f4||0xcc;return function(_0x397d0c){if(_0x397d0c){return _0x25a529['sendStatus'](_0x4146f4);}return _0x25a529[_0xa7ac('0x1d')](_0x4146f4)[_0xa7ac('0x1e')]();};}function respondWithResult(_0x1f34cf,_0x2222e1){_0x2222e1=_0x2222e1||0xc8;return function(_0x1be731){if(_0x1be731){return _0x1f34cf[_0xa7ac('0x1d')](_0x2222e1)['json'](_0x1be731);}};}function respondWithFilteredResult(_0x93b49d,_0x39b5f4){return function(_0x32ace0){if(_0x32ace0){var _0x3c5cda=typeof _0x39b5f4[_0xa7ac('0x1f')]===_0xa7ac('0x20')&&typeof _0x39b5f4['limit']===_0xa7ac('0x20');var _0xe9159=_0x32ace0[_0xa7ac('0x21')];var _0x51db57=_0x3c5cda?0x0:_0x39b5f4['offset'];var _0x55a5d5=_0x3c5cda?_0x32ace0[_0xa7ac('0x21')]:_0x39b5f4['offset']+_0x39b5f4[_0xa7ac('0x22')];var _0x2007f7;if(_0x55a5d5>=_0xe9159){_0x55a5d5=_0xe9159;_0x2007f7=0xc8;}else{_0x2007f7=0xce;}_0x93b49d[_0xa7ac('0x1d')](_0x2007f7);return _0x93b49d[_0xa7ac('0x23')]('Content-Range',_0x51db57+'-'+_0x55a5d5+'/'+_0xe9159)['json'](_0x32ace0);}return null;};}function patchUpdates(_0xfff5b0){return function(_0x167fa0){try{jsonpatch[_0xa7ac('0x24')](_0x167fa0,_0xfff5b0,!![]);}catch(_0x380cea){return BPromise[_0xa7ac('0x25')](_0x380cea);}return _0x167fa0['save']();};}function saveUpdates(_0x42fbe5,_0x24b882){return function(_0x4e73d3){if(_0x4e73d3){return _0x4e73d3['update'](_0x42fbe5)[_0xa7ac('0x26')](function(_0xc2a332){return _0xc2a332;});}return null;};}function removeEntity(_0x33f165,_0x264942){return function(_0x9c9f26){if(_0x9c9f26){return _0x9c9f26[_0xa7ac('0x27')]()['then'](function(){_0x33f165[_0xa7ac('0x1d')](0xcc)[_0xa7ac('0x1e')]();});}};}function handleEntityNotFound(_0x21e8fb,_0x567398){return function(_0x394ff6){if(!_0x394ff6){_0x21e8fb[_0xa7ac('0x28')](0x194);}return _0x394ff6;};}function handleError(_0x3e4c02,_0x1c3422){_0x1c3422=_0x1c3422||0x1f4;return function(_0x4380a9){logger[_0xa7ac('0x29')](_0x4380a9[_0xa7ac('0x2a')]);if(_0x4380a9['name']){delete _0x4380a9[_0xa7ac('0x2b')];}_0x3e4c02[_0xa7ac('0x1d')](_0x1c3422)[_0xa7ac('0x2c')](_0x4380a9);};}exports[_0xa7ac('0x2d')]=function(_0x266841,_0x38e3bd){var _0x4bb081={},_0x107368={},_0x440a5b={'count':0x0,'rows':[]};var _0x1f375b=_[_0xa7ac('0x2e')](db[_0xa7ac('0x2f')]['rawAttributes'],function(_0x428339){return{'name':_0x428339[_0xa7ac('0x30')],'type':_0x428339[_0xa7ac('0x31')][_0xa7ac('0x32')]};});_0x107368[_0xa7ac('0x33')]=_[_0xa7ac('0x2e')](_0x1f375b,_0xa7ac('0x2b'));_0x107368[_0xa7ac('0x34')]=_[_0xa7ac('0x35')](_0x266841[_0xa7ac('0x34')]);_0x107368['filters']=_[_0xa7ac('0x36')](_0x107368[_0xa7ac('0x33')],_0x107368[_0xa7ac('0x34')]);_0x4bb081[_0xa7ac('0x37')]=_[_0xa7ac('0x36')](_0x107368[_0xa7ac('0x33')],qs[_0xa7ac('0x38')](_0x266841[_0xa7ac('0x34')][_0xa7ac('0x38')]));_0x4bb081[_0xa7ac('0x37')]=_0x4bb081['attributes'][_0xa7ac('0x39')]?_0x4bb081['attributes']:_0x107368[_0xa7ac('0x33')];if(!_0x266841[_0xa7ac('0x34')][_0xa7ac('0x3a')](_0xa7ac('0x3b'))){_0x4bb081[_0xa7ac('0x22')]=qs[_0xa7ac('0x22')](_0x266841['query'][_0xa7ac('0x22')]);_0x4bb081[_0xa7ac('0x1f')]=qs[_0xa7ac('0x1f')](_0x266841['query'][_0xa7ac('0x1f')]);}_0x4bb081[_0xa7ac('0x3c')]=qs[_0xa7ac('0x3d')](_0x266841[_0xa7ac('0x34')][_0xa7ac('0x3d')]);_0x4bb081[_0xa7ac('0x3e')]=qs[_0xa7ac('0x3f')](_[_0xa7ac('0x40')](_0x266841[_0xa7ac('0x34')],_0x107368[_0xa7ac('0x3f')]),_0x1f375b);if(_0x266841[_0xa7ac('0x34')][_0xa7ac('0x41')]){_0x4bb081[_0xa7ac('0x3e')]=_[_0xa7ac('0x42')](_0x4bb081['where'],{'$or':_[_0xa7ac('0x2e')](_0x1f375b,function(_0x55c22f){if(_0x55c22f[_0xa7ac('0x31')]!==_0xa7ac('0x43')){var _0x1f2f08={};_0x1f2f08[_0x55c22f[_0xa7ac('0x2b')]]={'$like':'%'+_0x266841[_0xa7ac('0x34')][_0xa7ac('0x41')]+'%'};return _0x1f2f08;}})});}_0x4bb081=_[_0xa7ac('0x42')]({},_0x4bb081,_0x266841['options']);var _0x1965f7={'where':_0x4bb081['where']};return db[_0xa7ac('0x2f')][_0xa7ac('0x21')](_0x1965f7)[_0xa7ac('0x26')](function(_0x47abfe){_0x440a5b['count']=_0x47abfe;if(_0x266841[_0xa7ac('0x34')]['includeAll']){_0x4bb081['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xa7ac('0x44')](_0x4bb081);})[_0xa7ac('0x26')](function(_0x23ad46){_0x440a5b['rows']=_0x23ad46;return _0x440a5b;})['then'](respondWithFilteredResult(_0x38e3bd,_0x4bb081))[_0xa7ac('0x45')](handleError(_0x38e3bd,null));};exports[_0xa7ac('0x46')]=function(_0x55b8a2,_0x5cb382){var _0x3f65ff={'raw':![],'where':{'id':_0x55b8a2['params']['id']}},_0x352373={};_0x352373[_0xa7ac('0x33')]=_['keys'](db['VoiceQueueReport'][_0xa7ac('0x47')]);_0x352373[_0xa7ac('0x34')]=_[_0xa7ac('0x35')](_0x55b8a2[_0xa7ac('0x34')]);_0x352373['filters']=_['intersection'](_0x352373['model'],_0x352373['query']);_0x3f65ff[_0xa7ac('0x37')]=_[_0xa7ac('0x36')](_0x352373[_0xa7ac('0x33')],qs['fields'](_0x55b8a2[_0xa7ac('0x34')][_0xa7ac('0x38')]));_0x3f65ff['attributes']=_0x3f65ff[_0xa7ac('0x37')][_0xa7ac('0x39')]?_0x3f65ff[_0xa7ac('0x37')]:_0x352373[_0xa7ac('0x33')];if(_0x55b8a2[_0xa7ac('0x34')]['includeAll']){_0x3f65ff[_0xa7ac('0x48')]=[{'all':!![]}];}_0x3f65ff=_[_0xa7ac('0x42')]({},_0x3f65ff,_0x55b8a2[_0xa7ac('0x49')]);return db[_0xa7ac('0x2f')][_0xa7ac('0x4a')](_0x3f65ff)[_0xa7ac('0x26')](handleEntityNotFound(_0x5cb382,null))[_0xa7ac('0x26')](respondWithResult(_0x5cb382,null))[_0xa7ac('0x45')](handleError(_0x5cb382,null));};exports[_0xa7ac('0x4b')]=function(_0x26bb0c,_0x443631){return db[_0xa7ac('0x2f')][_0xa7ac('0x4b')](_0x26bb0c[_0xa7ac('0x4c')],{})['then'](respondWithResult(_0x443631,0xc9))['catch'](handleError(_0x443631,null));};exports[_0xa7ac('0x4d')]=function(_0x199410,_0x2c2316){if(_0x199410[_0xa7ac('0x4c')]['id']){delete _0x199410['body']['id'];}return db[_0xa7ac('0x2f')][_0xa7ac('0x4a')]({'where':{'id':_0x199410[_0xa7ac('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2c2316,null))[_0xa7ac('0x26')](saveUpdates(_0x199410[_0xa7ac('0x4c')],null))[_0xa7ac('0x26')](respondWithResult(_0x2c2316,null))[_0xa7ac('0x45')](handleError(_0x2c2316,null));};exports['destroy']=function(_0x22cd57,_0x53efb5){return db[_0xa7ac('0x2f')][_0xa7ac('0x4a')]({'where':{'id':_0x22cd57[_0xa7ac('0x4e')]['id']}})[_0xa7ac('0x26')](handleEntityNotFound(_0x53efb5,null))['then'](removeEntity(_0x53efb5,null))[_0xa7ac('0x45')](handleError(_0x53efb5,null));};exports[_0xa7ac('0x4f')]=function(_0x1c067d,_0x53f9dd){return db[_0xa7ac('0x2f')][_0xa7ac('0x4f')]()[_0xa7ac('0x26')](respondWithResult(_0x53f9dd,null))[_0xa7ac('0x45')](handleError(_0x53f9dd,null));};exports[_0xa7ac('0x50')]=function(_0x100cfc,_0x4eea91){var _0x1b1c46={},_0x2fe2de={},_0x275428={'count':0x0,'rows':[]};_0x2fe2de[_0xa7ac('0x33')]=_[_0xa7ac('0x35')](db[_0xa7ac('0x2f')][_0xa7ac('0x47')]);_0x2fe2de[_0xa7ac('0x34')]=_[_0xa7ac('0x35')](_0x100cfc['query']);_0x2fe2de[_0xa7ac('0x3f')]=_['intersection'](_0x2fe2de[_0xa7ac('0x33')],_0x2fe2de['query']);_0x1b1c46[_0xa7ac('0x37')]=_[_0xa7ac('0x36')](_0x2fe2de[_0xa7ac('0x33')],qs[_0xa7ac('0x38')](_0x100cfc[_0xa7ac('0x34')][_0xa7ac('0x38')]));_0x1b1c46[_0xa7ac('0x37')]=_0x1b1c46['attributes'][_0xa7ac('0x39')]?_0x1b1c46[_0xa7ac('0x37')]:_0x2fe2de[_0xa7ac('0x33')];if(!_0x100cfc['query'][_0xa7ac('0x3a')](_0xa7ac('0x3b'))){_0x1b1c46[_0xa7ac('0x22')]=qs[_0xa7ac('0x22')](_0x100cfc[_0xa7ac('0x34')][_0xa7ac('0x22')]);_0x1b1c46[_0xa7ac('0x1f')]=qs[_0xa7ac('0x1f')](_0x100cfc[_0xa7ac('0x34')][_0xa7ac('0x1f')]);}_0x1b1c46[_0xa7ac('0x3c')]=qs['sort'](_0x100cfc['query'][_0xa7ac('0x3d')]);_0x1b1c46['where']=qs['filters'](_[_0xa7ac('0x40')](_0x100cfc[_0xa7ac('0x34')],_0x2fe2de['filters']));if(_0x100cfc[_0xa7ac('0x34')][_0xa7ac('0x41')]){_0x1b1c46[_0xa7ac('0x3e')]=_['merge'](_0x1b1c46[_0xa7ac('0x3e')],{'$or':_[_0xa7ac('0x2e')](_0x1b1c46[_0xa7ac('0x37')],function(_0x50764f){var _0x424cba={};_0x424cba[_0x50764f]={'$like':'%'+_0x100cfc[_0xa7ac('0x34')]['filter']+'%'};return _0x424cba;})});}_0x1b1c46=_['merge']({},_0x1b1c46,_0x100cfc[_0xa7ac('0x49')]);var _0xf2a37c={'where':_0x1b1c46[_0xa7ac('0x3e')]};return db[_0xa7ac('0x2f')][_0xa7ac('0x21')](_0xf2a37c)[_0xa7ac('0x26')](function(_0x3b46c6){_0x275428[_0xa7ac('0x21')]=_0x3b46c6;if(_0x100cfc[_0xa7ac('0x34')][_0xa7ac('0x51')]){_0x1b1c46['include']=[{'all':!![]}];}return db[_0xa7ac('0x2f')][_0xa7ac('0x44')](_0x1b1c46);})[_0xa7ac('0x26')](function(_0x2d08e8){_0x275428['rows']=_0x2d08e8;return _0x275428;})['then'](respondWithFilteredResult(_0x4eea91,_0x1b1c46,_0xa7ac('0x50')))[_0xa7ac('0x45')](handleError(_0x4eea91,null,_0xa7ac('0x50')));}; \ No newline at end of file +var _0x7698=['includeAll','show','include','merge','catch','body','find','params','describe','getVoiceQueuesReport','keys','rawAttributes','sort','map','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','index','VoiceQueueReport','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options'];(function(_0x5bd08a,_0x2c8596){var _0x599651=function(_0x364e09){while(--_0x364e09){_0x5bd08a['push'](_0x5bd08a['shift']());}};_0x599651(++_0x2c8596);}(_0x7698,0x109));var _0x8769=function(_0x4d65cf,_0x3b846b){_0x4d65cf=_0x4d65cf-0x0;var _0x7389b3=_0x7698[_0x4d65cf];return _0x7389b3;};'use strict';var emlformat=require(_0x8769('0x0'));var rimraf=require(_0x8769('0x1'));var zipdir=require(_0x8769('0x2'));var jsonpatch=require(_0x8769('0x3'));var rp=require('request-promise');var moment=require(_0x8769('0x4'));var BPromise=require(_0x8769('0x5'));var Mustache=require(_0x8769('0x6'));var util=require('util');var path=require(_0x8769('0x7'));var sox=require(_0x8769('0x8'));var csv=require(_0x8769('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8769('0xa'));var _=require(_0x8769('0xb'));var squel=require(_0x8769('0xc'));var crypto=require(_0x8769('0xd'));var jsforce=require(_0x8769('0xe'));var deskjs=require(_0x8769('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8769('0x10'));var Papa=require('papaparse');var Redis=require(_0x8769('0x11'));var authService=require(_0x8769('0x12'));var qs=require(_0x8769('0x13'));var as=require(_0x8769('0x14'));var hardwareService=require(_0x8769('0x15'));var logger=require(_0x8769('0x16'))('api');var utils=require(_0x8769('0x17'));var config=require(_0x8769('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8769('0x19'))['db'];config[_0x8769('0x1a')]=_[_0x8769('0x1b')](config[_0x8769('0x1a')],{'host':_0x8769('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8769('0x1a')]));require(_0x8769('0x1d'))[_0x8769('0x1e')](socket);function respondWithStatusCode(_0x22f70b,_0x52088d){_0x52088d=_0x52088d||0xcc;return function(_0x18feac){if(_0x18feac){return _0x22f70b[_0x8769('0x1f')](_0x52088d);}return _0x22f70b[_0x8769('0x20')](_0x52088d)[_0x8769('0x21')]();};}function respondWithResult(_0x4bea76,_0x58ea55){_0x58ea55=_0x58ea55||0xc8;return function(_0x59d55c){if(_0x59d55c){return _0x4bea76[_0x8769('0x20')](_0x58ea55)[_0x8769('0x22')](_0x59d55c);}};}function respondWithFilteredResult(_0x5ce42f,_0x5be69c){return function(_0x2d057d){if(_0x2d057d){var _0x41f1b0=typeof _0x5be69c['offset']===_0x8769('0x23')&&typeof _0x5be69c[_0x8769('0x24')]===_0x8769('0x23');var _0x540b54=_0x2d057d[_0x8769('0x25')];var _0x1ec4bd=_0x41f1b0?0x0:_0x5be69c[_0x8769('0x26')];var _0x3bbc3c=_0x41f1b0?_0x2d057d[_0x8769('0x25')]:_0x5be69c[_0x8769('0x26')]+_0x5be69c[_0x8769('0x24')];var _0x39cb5d;if(_0x3bbc3c>=_0x540b54){_0x3bbc3c=_0x540b54;_0x39cb5d=0xc8;}else{_0x39cb5d=0xce;}_0x5ce42f[_0x8769('0x20')](_0x39cb5d);return _0x5ce42f[_0x8769('0x27')](_0x8769('0x28'),_0x1ec4bd+'-'+_0x3bbc3c+'/'+_0x540b54)[_0x8769('0x22')](_0x2d057d);}return null;};}function patchUpdates(_0x2efbbd){return function(_0x2475cf){try{jsonpatch[_0x8769('0x29')](_0x2475cf,_0x2efbbd,!![]);}catch(_0x51e0f5){return BPromise[_0x8769('0x2a')](_0x51e0f5);}return _0x2475cf[_0x8769('0x2b')]();};}function saveUpdates(_0x37ee51,_0x35cf22){return function(_0x437613){if(_0x437613){return _0x437613[_0x8769('0x2c')](_0x37ee51)[_0x8769('0x2d')](function(_0x51315d){return _0x51315d;});}return null;};}function removeEntity(_0x20d2f7,_0x1b1eea){return function(_0x376516){if(_0x376516){return _0x376516[_0x8769('0x2e')]()[_0x8769('0x2d')](function(){_0x20d2f7[_0x8769('0x20')](0xcc)[_0x8769('0x21')]();});}};}function handleEntityNotFound(_0x3f07ca,_0x5ce25d){return function(_0x18d1ef){if(!_0x18d1ef){_0x3f07ca[_0x8769('0x1f')](0x194);}return _0x18d1ef;};}function handleError(_0xe23e4f,_0x5e97f7){_0x5e97f7=_0x5e97f7||0x1f4;return function(_0x49059a){logger['error'](_0x49059a['stack']);if(_0x49059a[_0x8769('0x2f')]){delete _0x49059a['name'];}_0xe23e4f['status'](_0x5e97f7)['send'](_0x49059a);};}exports[_0x8769('0x30')]=function(_0x398e3c,_0x106cc9){var _0x1bdfb6={},_0x22ed2e={},_0x15d893={'count':0x0,'rows':[]};var _0x2792eb=_['map'](db[_0x8769('0x31')]['rawAttributes'],function(_0x4b0aca){return{'name':_0x4b0aca['fieldName'],'type':_0x4b0aca[_0x8769('0x32')][_0x8769('0x33')]};});_0x22ed2e[_0x8769('0x34')]=_['map'](_0x2792eb,_0x8769('0x2f'));_0x22ed2e['query']=_['keys'](_0x398e3c[_0x8769('0x35')]);_0x22ed2e[_0x8769('0x36')]=_[_0x8769('0x37')](_0x22ed2e[_0x8769('0x34')],_0x22ed2e[_0x8769('0x35')]);_0x1bdfb6[_0x8769('0x38')]=_['intersection'](_0x22ed2e['model'],qs[_0x8769('0x39')](_0x398e3c[_0x8769('0x35')][_0x8769('0x39')]));_0x1bdfb6[_0x8769('0x38')]=_0x1bdfb6[_0x8769('0x38')][_0x8769('0x3a')]?_0x1bdfb6[_0x8769('0x38')]:_0x22ed2e[_0x8769('0x34')];if(!_0x398e3c['query'][_0x8769('0x3b')](_0x8769('0x3c'))){_0x1bdfb6[_0x8769('0x24')]=qs[_0x8769('0x24')](_0x398e3c[_0x8769('0x35')]['limit']);_0x1bdfb6[_0x8769('0x26')]=qs[_0x8769('0x26')](_0x398e3c[_0x8769('0x35')][_0x8769('0x26')]);}_0x1bdfb6[_0x8769('0x3d')]=qs['sort'](_0x398e3c[_0x8769('0x35')]['sort']);_0x1bdfb6[_0x8769('0x3e')]=qs[_0x8769('0x36')](_[_0x8769('0x3f')](_0x398e3c[_0x8769('0x35')],_0x22ed2e[_0x8769('0x36')]),_0x2792eb);if(_0x398e3c[_0x8769('0x35')][_0x8769('0x40')]){_0x1bdfb6['where']=_['merge'](_0x1bdfb6[_0x8769('0x3e')],{'$or':_['map'](_0x2792eb,function(_0xfc6c2){if(_0xfc6c2[_0x8769('0x32')]!==_0x8769('0x41')){var _0x1f3508={};_0x1f3508[_0xfc6c2['name']]={'$like':'%'+_0x398e3c[_0x8769('0x35')][_0x8769('0x40')]+'%'};return _0x1f3508;}})});}_0x1bdfb6=_['merge']({},_0x1bdfb6,_0x398e3c[_0x8769('0x42')]);var _0x1021c4={'where':_0x1bdfb6[_0x8769('0x3e')]};return db[_0x8769('0x31')][_0x8769('0x25')](_0x1021c4)[_0x8769('0x2d')](function(_0x1f69d0){_0x15d893[_0x8769('0x25')]=_0x1f69d0;if(_0x398e3c['query'][_0x8769('0x43')]){_0x1bdfb6['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x1bdfb6);})[_0x8769('0x2d')](function(_0x25269d){_0x15d893['rows']=_0x25269d;return _0x15d893;})[_0x8769('0x2d')](respondWithFilteredResult(_0x106cc9,_0x1bdfb6))['catch'](handleError(_0x106cc9,null));};exports[_0x8769('0x44')]=function(_0x5ece71,_0x9c55db){var _0x5798d6={'raw':![],'where':{'id':_0x5ece71['params']['id']}},_0x5c4a98={};_0x5c4a98[_0x8769('0x34')]=_['keys'](db[_0x8769('0x31')]['rawAttributes']);_0x5c4a98[_0x8769('0x35')]=_['keys'](_0x5ece71[_0x8769('0x35')]);_0x5c4a98['filters']=_[_0x8769('0x37')](_0x5c4a98[_0x8769('0x34')],_0x5c4a98[_0x8769('0x35')]);_0x5798d6['attributes']=_[_0x8769('0x37')](_0x5c4a98[_0x8769('0x34')],qs[_0x8769('0x39')](_0x5ece71[_0x8769('0x35')]['fields']));_0x5798d6[_0x8769('0x38')]=_0x5798d6[_0x8769('0x38')]['length']?_0x5798d6[_0x8769('0x38')]:_0x5c4a98[_0x8769('0x34')];if(_0x5ece71['query'][_0x8769('0x43')]){_0x5798d6[_0x8769('0x45')]=[{'all':!![]}];}_0x5798d6=_[_0x8769('0x46')]({},_0x5798d6,_0x5ece71['options']);return db[_0x8769('0x31')]['find'](_0x5798d6)['then'](handleEntityNotFound(_0x9c55db,null))[_0x8769('0x2d')](respondWithResult(_0x9c55db,null))[_0x8769('0x47')](handleError(_0x9c55db,null));};exports['create']=function(_0x2aa2f8,_0x5853d3){return db['VoiceQueueReport']['create'](_0x2aa2f8[_0x8769('0x48')],{})['then'](respondWithResult(_0x5853d3,0xc9))[_0x8769('0x47')](handleError(_0x5853d3,null));};exports[_0x8769('0x2c')]=function(_0x44c2eb,_0x369b53){if(_0x44c2eb[_0x8769('0x48')]['id']){delete _0x44c2eb['body']['id'];}return db[_0x8769('0x31')][_0x8769('0x49')]({'where':{'id':_0x44c2eb[_0x8769('0x4a')]['id']}})[_0x8769('0x2d')](handleEntityNotFound(_0x369b53,null))[_0x8769('0x2d')](saveUpdates(_0x44c2eb[_0x8769('0x48')],null))[_0x8769('0x2d')](respondWithResult(_0x369b53,null))[_0x8769('0x47')](handleError(_0x369b53,null));};exports['destroy']=function(_0xa1da36,_0x3307d6){return db[_0x8769('0x31')][_0x8769('0x49')]({'where':{'id':_0xa1da36['params']['id']}})[_0x8769('0x2d')](handleEntityNotFound(_0x3307d6,null))[_0x8769('0x2d')](removeEntity(_0x3307d6,null))[_0x8769('0x47')](handleError(_0x3307d6,null));};exports[_0x8769('0x4b')]=function(_0x15744a,_0x4bc2c2){return db[_0x8769('0x31')][_0x8769('0x4b')]()[_0x8769('0x2d')](respondWithResult(_0x4bc2c2,null))[_0x8769('0x47')](handleError(_0x4bc2c2,null));};exports[_0x8769('0x4c')]=function(_0x2b1dad,_0x182e37){var _0x18d791={},_0x617b55={},_0xe15ec0={'count':0x0,'rows':[]};_0x617b55[_0x8769('0x34')]=_[_0x8769('0x4d')](db[_0x8769('0x31')][_0x8769('0x4e')]);_0x617b55[_0x8769('0x35')]=_['keys'](_0x2b1dad['query']);_0x617b55[_0x8769('0x36')]=_[_0x8769('0x37')](_0x617b55[_0x8769('0x34')],_0x617b55[_0x8769('0x35')]);_0x18d791[_0x8769('0x38')]=_[_0x8769('0x37')](_0x617b55['model'],qs['fields'](_0x2b1dad[_0x8769('0x35')]['fields']));_0x18d791[_0x8769('0x38')]=_0x18d791[_0x8769('0x38')][_0x8769('0x3a')]?_0x18d791[_0x8769('0x38')]:_0x617b55[_0x8769('0x34')];if(!_0x2b1dad['query'][_0x8769('0x3b')](_0x8769('0x3c'))){_0x18d791[_0x8769('0x24')]=qs[_0x8769('0x24')](_0x2b1dad['query'][_0x8769('0x24')]);_0x18d791['offset']=qs['offset'](_0x2b1dad['query'][_0x8769('0x26')]);}_0x18d791[_0x8769('0x3d')]=qs[_0x8769('0x4f')](_0x2b1dad[_0x8769('0x35')][_0x8769('0x4f')]);_0x18d791[_0x8769('0x3e')]=qs['filters'](_[_0x8769('0x3f')](_0x2b1dad[_0x8769('0x35')],_0x617b55[_0x8769('0x36')]));if(_0x2b1dad[_0x8769('0x35')][_0x8769('0x40')]){_0x18d791['where']=_[_0x8769('0x46')](_0x18d791['where'],{'$or':_[_0x8769('0x50')](_0x18d791[_0x8769('0x38')],function(_0x503548){var _0x496106={};_0x496106[_0x503548]={'$like':'%'+_0x2b1dad[_0x8769('0x35')][_0x8769('0x40')]+'%'};return _0x496106;})});}_0x18d791=_[_0x8769('0x46')]({},_0x18d791,_0x2b1dad['options']);var _0x48a70d={'where':_0x18d791['where']};return db[_0x8769('0x31')][_0x8769('0x25')](_0x48a70d)['then'](function(_0x35037b){_0xe15ec0[_0x8769('0x25')]=_0x35037b;if(_0x2b1dad[_0x8769('0x35')][_0x8769('0x43')]){_0x18d791['include']=[{'all':!![]}];}return db[_0x8769('0x31')][_0x8769('0x51')](_0x18d791);})[_0x8769('0x2d')](function(_0x513cb7){_0xe15ec0[_0x8769('0x52')]=_0x513cb7;return _0xe15ec0;})[_0x8769('0x2d')](respondWithFilteredResult(_0x182e37,_0x18d791,'getVoiceQueuesReport'))['catch'](handleError(_0x182e37,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 eeda302..f4bfe0a 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 _0xe83e=['hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','emit'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0xe83e,0x7a));var _0xee83=function(_0x3f833e,_0x33f97d){_0x3f833e=_0x3f833e-0x0;var _0x58d70b=_0xe83e[_0x3f833e];return _0x58d70b;};'use strict';var EventEmitter=require(_0xee83('0x0'));var VoiceQueueReport=require(_0xee83('0x1'))['db'][_0xee83('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xee83('0x3')](0x0);var events={'afterCreate':_0xee83('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3d4d96){return function(_0x3dcec7,_0x10a536,_0x3e03a3){VoiceQueueReportEvents[_0xee83('0x5')](_0x3d4d96+':'+_0x3dcec7['id'],_0x3dcec7);VoiceQueueReportEvents[_0xee83('0x5')](_0x3d4d96,_0x3dcec7);_0x3e03a3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xee83('0x6')](e,emitEvent(event));}}module[_0xee83('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x6f31=['VoiceQueueReport','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x36ffe2,_0x2efeb5){var _0x30ba17=function(_0x2ca775){while(--_0x2ca775){_0x36ffe2['push'](_0x36ffe2['shift']());}};_0x30ba17(++_0x2efeb5);}(_0x6f31,0x12a));var _0x16f3=function(_0x3cadbb,_0x279253){_0x3cadbb=_0x3cadbb-0x0;var _0x1230a6=_0x6f31[_0x3cadbb];return _0x1230a6;};'use strict';var EventEmitter=require(_0x16f3('0x0'));var VoiceQueueReport=require(_0x16f3('0x1'))['db'][_0x16f3('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x16f3('0x3')](0x0);var events={'afterCreate':_0x16f3('0x4'),'afterUpdate':'update','afterDestroy':_0x16f3('0x5')};function emitEvent(_0x2deab9){return function(_0x20078e,_0x3feef9,_0x2d15c0){VoiceQueueReportEvents[_0x16f3('0x6')](_0x2deab9+':'+_0x20078e['id'],_0x20078e);VoiceQueueReportEvents[_0x16f3('0x6')](_0x2deab9,_0x20078e);_0x2d15c0(null);};}for(var e in events){if(events[_0x16f3('0x7')](e)){var event=events[e];VoiceQueueReport[_0x16f3('0x8')](e,emitEvent(event));}}module[_0x16f3('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 72e210e..b2a4d05 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 _0xe7fc=['path','rimraf','../../config/environment','exports','report_queue','calleridnum','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xe7fc,0xf6));var _0xce7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe7fc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xce7f('0x0'));var util=require('util');var logger=require(_0xce7f('0x1'))(_0xce7f('0x2'));var moment=require(_0xce7f('0x3'));var BPromise=require(_0xce7f('0x4'));var rp=require(_0xce7f('0x5'));var fs=require('fs');var path=require(_0xce7f('0x6'));var rimraf=require(_0xce7f('0x7'));var config=require(_0xce7f('0x8'));var attributes=require('./voiceQueueReport.attributes');module[_0xce7f('0x9')]=function(_0x5c571e,_0x994acf){return _0x5c571e['define']('VoiceQueueReport',attributes,{'tableName':_0xce7f('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xce7f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x99b1=['lodash','api','moment','request-promise','path','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum'];(function(_0x3f311c,_0x3aeb9b){var _0x1cb4cc=function(_0x2b80af){while(--_0x2b80af){_0x3f311c['push'](_0x3f311c['shift']());}};_0x1cb4cc(++_0x3aeb9b);}(_0x99b1,0x120));var _0x199b=function(_0xed81da,_0xf83f96){_0xed81da=_0xed81da-0x0;var _0x48e6f0=_0x99b1[_0xed81da];return _0x48e6f0;};'use strict';var _=require(_0x199b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x199b('0x1'));var moment=require(_0x199b('0x2'));var BPromise=require('bluebird');var rp=require(_0x199b('0x3'));var fs=require('fs');var path=require(_0x199b('0x4'));var rimraf=require('rimraf');var config=require(_0x199b('0x5'));var attributes=require(_0x199b('0x6'));module['exports']=function(_0x404660,_0x21d3c3){return _0x404660[_0x199b('0x7')](_0x199b('0x8'),attributes,{'tableName':_0x199b('0x9'),'paranoid':![],'indexes':[{'fields':[_0x199b('0xa')]},{'fields':[_0x199b('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 364e181..77b66c7 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 _0xf039=['result','GetVoiceQueueReport','VoiceQueueReport','options','raw','attributes','limit','include','map','model','info','debug','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xf039,0x91));var _0x9f03=function(_0x2b8722,_0x50d540){_0x2b8722=_0x2b8722-0x0;var _0x20c180=_0xf039[_0x2b8722];return _0x20c180;};'use strict';var _=require(_0x9f03('0x0'));var util=require(_0x9f03('0x1'));var moment=require(_0x9f03('0x2'));var BPromise=require(_0x9f03('0x3'));var rs=require(_0x9f03('0x4'));var fs=require('fs');var Redis=require(_0x9f03('0x5'));var db=require(_0x9f03('0x6'))['db'];var utils=require(_0x9f03('0x7'));var logger=require(_0x9f03('0x8'))(_0x9f03('0x9'));var config=require(_0x9f03('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x9f03('0xb')]=_['defaults'](config[_0x9f03('0xb')],{'host':_0x9f03('0xc'),'port':0x18eb});var socket=require(_0x9f03('0xd'))(new Redis(config[_0x9f03('0xb')]));require(_0x9f03('0xe'))[_0x9f03('0xf')](socket);function respondWithRpcPromise(_0x5e6cd4,_0x3f9702,_0x8aff5e){return new BPromise(function(_0x3de9fe,_0x3bacea){return client['request'](_0x5e6cd4,_0x8aff5e)[_0x9f03('0x10')](function(_0x2a57d7){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x3f9702,_0x9f03('0x11'));logger['debug'](_0x9f03('0x12'),_0x3f9702,'request\x20sent',JSON[_0x9f03('0x13')](_0x2a57d7));if(_0x2a57d7[_0x9f03('0x14')]){if(_0x2a57d7[_0x9f03('0x14')]['code']===0x1f4){logger[_0x9f03('0x14')](_0x9f03('0x15'),_0x3f9702,_0x2a57d7[_0x9f03('0x14')]['message']);return _0x3bacea(_0x2a57d7[_0x9f03('0x14')]['message']);}logger[_0x9f03('0x14')](_0x9f03('0x15'),_0x3f9702,_0x2a57d7[_0x9f03('0x14')][_0x9f03('0x16')]);return _0x3de9fe(_0x2a57d7[_0x9f03('0x14')][_0x9f03('0x16')]);}else{logger['info'](_0x9f03('0x15'),_0x3f9702,_0x9f03('0x11'));_0x3de9fe(_0x2a57d7[_0x9f03('0x17')]['message']);}})['catch'](function(_0x114133){logger['error'](_0x9f03('0x15'),_0x3f9702,_0x114133);_0x3bacea(_0x114133);});});}exports[_0x9f03('0x18')]=function(_0x175383){var _0x25adf1=this;return new Promise(function(_0x547409,_0x1f0a75){return db[_0x9f03('0x19')]['findAll']({'raw':_0x175383[_0x9f03('0x1a')]?_0x175383[_0x9f03('0x1a')][_0x9f03('0x1b')]===undefined?!![]:![]:!![],'where':_0x175383[_0x9f03('0x1a')]?_0x175383[_0x9f03('0x1a')]['where']||null:null,'attributes':_0x175383[_0x9f03('0x1a')]?_0x175383[_0x9f03('0x1a')][_0x9f03('0x1c')]||null:null,'limit':_0x175383[_0x9f03('0x1a')]?_0x175383[_0x9f03('0x1a')][_0x9f03('0x1d')]||null:null,'include':_0x175383['options']?_0x175383[_0x9f03('0x1a')][_0x9f03('0x1e')]?_[_0x9f03('0x1f')](_0x175383[_0x9f03('0x1a')][_0x9f03('0x1e')],function(_0x56cba0){return{'model':db[_0x56cba0[_0x9f03('0x20')]],'as':_0x56cba0['as'],'attributes':_0x56cba0[_0x9f03('0x1c')],'include':_0x56cba0[_0x9f03('0x1e')]?_[_0x9f03('0x1f')](_0x56cba0['include'],function(_0x3a7ea7){return{'model':db[_0x3a7ea7['model']],'as':_0x3a7ea7['as'],'attributes':_0x3a7ea7[_0x9f03('0x1c')],'include':_0x3a7ea7[_0x9f03('0x1e')]?_[_0x9f03('0x1f')](_0x3a7ea7['include'],function(_0x381942){return{'model':db[_0x381942[_0x9f03('0x20')]],'as':_0x381942['as'],'attributes':_0x381942[_0x9f03('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1da540){logger[_0x9f03('0x21')]('GetVoiceQueueReport',_0x175383);logger[_0x9f03('0x22')](_0x9f03('0x18'),_0x175383,JSON[_0x9f03('0x13')](_0x1da540));_0x547409(_0x1da540);})[_0x9f03('0x23')](function(_0x5e06f9){logger[_0x9f03('0x14')](_0x9f03('0x18'),_0x5e06f9[_0x9f03('0x16')],_0x175383);_0x1f0a75(_0x25adf1['error'](0x1f4,_0x5e06f9['message']));});});};exports[_0x9f03('0x24')]=function(_0x1dc8b6){var _0x397b88=this;return new Promise(function(_0xd949dc,_0x30092d){return db[_0x9f03('0x19')][_0x9f03('0x25')](_0x1dc8b6[_0x9f03('0x26')],{'raw':_0x1dc8b6['options']?_0x1dc8b6['options'][_0x9f03('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x22839f){logger[_0x9f03('0x21')](_0x9f03('0x24'),_0x1dc8b6);logger[_0x9f03('0x22')]('CreateVoiceQueueReport',_0x1dc8b6,JSON[_0x9f03('0x13')](_0x22839f));_0xd949dc(_0x22839f);})[_0x9f03('0x23')](function(_0xb3a17d){logger[_0x9f03('0x14')]('CreateVoiceQueueReport',_0xb3a17d[_0x9f03('0x16')],_0x1dc8b6);_0x30092d(_0x397b88[_0x9f03('0x14')](0x1f4,_0xb3a17d['message']));});});};exports[_0x9f03('0x27')]=function(_0x46829d){var _0x5d678c=this;return new Promise(function(_0x313c9a,_0x25a09a){return db[_0x9f03('0x19')][_0x9f03('0x28')](_0x46829d[_0x9f03('0x26')],{'raw':_0x46829d[_0x9f03('0x1a')]?_0x46829d[_0x9f03('0x1a')][_0x9f03('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46829d[_0x9f03('0x1a')]?_0x46829d['options'][_0x9f03('0x29')]||null:null,'attributes':_0x46829d[_0x9f03('0x1a')]?_0x46829d['options'][_0x9f03('0x1c')]||null:null,'limit':_0x46829d['options']?_0x46829d['options']['limit']||null:null})[_0x9f03('0x10')](function(_0x3931eb){logger[_0x9f03('0x21')](_0x9f03('0x27'),_0x46829d);logger['debug']('UpdateVoiceQueueReport',_0x46829d,JSON[_0x9f03('0x13')](_0x3931eb));_0x313c9a(_0x3931eb);})['catch'](function(_0x2a0417){logger[_0x9f03('0x14')]('UpdateVoiceQueueReport',_0x2a0417[_0x9f03('0x16')],_0x46829d);_0x25a09a(_0x5d678c[_0x9f03('0x14')](0x1f4,_0x2a0417[_0x9f03('0x16')]));});});}; \ No newline at end of file +var _0x8b67=['update','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','include','model','map','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport'];(function(_0x2d6812,_0x3c0006){var _0x1d605=function(_0x587a97){while(--_0x587a97){_0x2d6812['push'](_0x2d6812['shift']());}};_0x1d605(++_0x3c0006);}(_0x8b67,0x162));var _0x78b6=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0x8b67[_0x4eec9b];return _0x2e3849;};'use strict';var _=require(_0x78b6('0x0'));var util=require(_0x78b6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x78b6('0x2'));var fs=require('fs');var Redis=require(_0x78b6('0x3'));var db=require(_0x78b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x78b6('0x5'))(_0x78b6('0x6'));var config=require(_0x78b6('0x7'));var jayson=require(_0x78b6('0x8'));var client=jayson[_0x78b6('0x9')][_0x78b6('0xa')]({'port':0x232a});config[_0x78b6('0xb')]=_[_0x78b6('0xc')](config[_0x78b6('0xb')],{'host':_0x78b6('0xd'),'port':0x18eb});var socket=require(_0x78b6('0xe'))(new Redis(config[_0x78b6('0xb')]));require(_0x78b6('0xf'))['register'](socket);function respondWithRpcPromise(_0x5dfe46,_0x2c9415,_0x155c10){return new BPromise(function(_0x588cf1,_0x41a87a){return client[_0x78b6('0x10')](_0x5dfe46,_0x155c10)[_0x78b6('0x11')](function(_0x5dc748){logger[_0x78b6('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x2c9415,_0x78b6('0x13'));logger[_0x78b6('0x14')](_0x78b6('0x15'),_0x2c9415,_0x78b6('0x13'),JSON[_0x78b6('0x16')](_0x5dc748));if(_0x5dc748[_0x78b6('0x17')]){if(_0x5dc748['error'][_0x78b6('0x18')]===0x1f4){logger[_0x78b6('0x17')](_0x78b6('0x19'),_0x2c9415,_0x5dc748[_0x78b6('0x17')][_0x78b6('0x1a')]);return _0x41a87a(_0x5dc748['error'][_0x78b6('0x1a')]);}logger[_0x78b6('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x2c9415,_0x5dc748['error'][_0x78b6('0x1a')]);return _0x588cf1(_0x5dc748[_0x78b6('0x17')][_0x78b6('0x1a')]);}else{logger[_0x78b6('0x12')](_0x78b6('0x19'),_0x2c9415,_0x78b6('0x13'));_0x588cf1(_0x5dc748[_0x78b6('0x1b')]['message']);}})['catch'](function(_0xc7fb8c){logger[_0x78b6('0x17')](_0x78b6('0x19'),_0x2c9415,_0xc7fb8c);_0x41a87a(_0xc7fb8c);});});}exports[_0x78b6('0x1c')]=function(_0x4574ba){var _0xb1e766=this;return new Promise(function(_0x4d7c4b,_0x16c15d){return db[_0x78b6('0x1d')]['findAll']({'raw':_0x4574ba['options']?_0x4574ba[_0x78b6('0x1e')][_0x78b6('0x1f')]===undefined?!![]:![]:!![],'where':_0x4574ba[_0x78b6('0x1e')]?_0x4574ba[_0x78b6('0x1e')][_0x78b6('0x20')]||null:null,'attributes':_0x4574ba[_0x78b6('0x1e')]?_0x4574ba[_0x78b6('0x1e')][_0x78b6('0x21')]||null:null,'limit':_0x4574ba[_0x78b6('0x1e')]?_0x4574ba[_0x78b6('0x1e')]['limit']||null:null,'include':_0x4574ba[_0x78b6('0x1e')]?_0x4574ba['options'][_0x78b6('0x22')]?_['map'](_0x4574ba[_0x78b6('0x1e')]['include'],function(_0x2a8432){return{'model':db[_0x2a8432[_0x78b6('0x23')]],'as':_0x2a8432['as'],'attributes':_0x2a8432[_0x78b6('0x21')],'include':_0x2a8432['include']?_[_0x78b6('0x24')](_0x2a8432[_0x78b6('0x22')],function(_0x216f2c){return{'model':db[_0x216f2c[_0x78b6('0x23')]],'as':_0x216f2c['as'],'attributes':_0x216f2c[_0x78b6('0x21')],'include':_0x216f2c[_0x78b6('0x22')]?_[_0x78b6('0x24')](_0x216f2c[_0x78b6('0x22')],function(_0x4477e1){return{'model':db[_0x4477e1[_0x78b6('0x23')]],'as':_0x4477e1['as'],'attributes':_0x4477e1[_0x78b6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x78b6('0x11')](function(_0x3b0496){logger['info'](_0x78b6('0x1c'),_0x4574ba);logger[_0x78b6('0x14')](_0x78b6('0x1c'),_0x4574ba,JSON[_0x78b6('0x16')](_0x3b0496));_0x4d7c4b(_0x3b0496);})[_0x78b6('0x25')](function(_0x19c902){logger[_0x78b6('0x17')](_0x78b6('0x1c'),_0x19c902[_0x78b6('0x1a')],_0x4574ba);_0x16c15d(_0xb1e766[_0x78b6('0x17')](0x1f4,_0x19c902[_0x78b6('0x1a')]));});});};exports[_0x78b6('0x26')]=function(_0x452563){var _0x1d6ea9=this;return new Promise(function(_0xe6d18c,_0x4b9f11){return db[_0x78b6('0x1d')][_0x78b6('0x27')](_0x452563[_0x78b6('0x28')],{'raw':_0x452563['options']?_0x452563['options'][_0x78b6('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x1342cd){logger[_0x78b6('0x12')](_0x78b6('0x26'),_0x452563);logger[_0x78b6('0x14')]('CreateVoiceQueueReport',_0x452563,JSON[_0x78b6('0x16')](_0x1342cd));_0xe6d18c(_0x1342cd);})[_0x78b6('0x25')](function(_0x572d96){logger[_0x78b6('0x17')](_0x78b6('0x26'),_0x572d96['message'],_0x452563);_0x4b9f11(_0x1d6ea9[_0x78b6('0x17')](0x1f4,_0x572d96[_0x78b6('0x1a')]));});});};exports[_0x78b6('0x29')]=function(_0x5685a4){var _0x2131c0=this;return new Promise(function(_0x4bc53f,_0x4a09b6){return db['VoiceQueueReport'][_0x78b6('0x2a')](_0x5685a4[_0x78b6('0x28')],{'raw':_0x5685a4[_0x78b6('0x1e')]?_0x5685a4[_0x78b6('0x1e')][_0x78b6('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5685a4[_0x78b6('0x1e')]?_0x5685a4[_0x78b6('0x1e')][_0x78b6('0x20')]||null:null,'attributes':_0x5685a4[_0x78b6('0x1e')]?_0x5685a4[_0x78b6('0x1e')][_0x78b6('0x21')]||null:null,'limit':_0x5685a4[_0x78b6('0x1e')]?_0x5685a4['options'][_0x78b6('0x2b')]||null:null})['then'](function(_0x127128){logger[_0x78b6('0x12')]('UpdateVoiceQueueReport',_0x5685a4);logger[_0x78b6('0x14')](_0x78b6('0x29'),_0x5685a4,JSON[_0x78b6('0x16')](_0x127128));_0x4bc53f(_0x127128);})[_0x78b6('0x25')](function(_0x387e19){logger[_0x78b6('0x17')](_0x78b6('0x29'),_0x387e19['message'],_0x5685a4);_0x4a09b6(_0x2131c0[_0x78b6('0x17')](0x1f4,_0x387e19[_0x78b6('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 8479c3e..1c623c1 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 _0x9b2a=['length','./voiceQueueReport.events','remove','update','emit','removeListener','register'];(function(_0x1a21ff,_0x4a7550){var _0x25afc1=function(_0x4a66ec){while(--_0x4a66ec){_0x1a21ff['push'](_0x1a21ff['shift']());}};_0x25afc1(++_0x4a7550);}(_0x9b2a,0x127));var _0xa9b2=function(_0x3bfa52,_0x29b319){_0x3bfa52=_0x3bfa52-0x0;var _0xf08a3=_0x9b2a[_0x3bfa52];return _0xf08a3;};'use strict';var VoiceQueueReportEvents=require(_0xa9b2('0x0'));var events=['save',_0xa9b2('0x1'),_0xa9b2('0x2')];function createListener(_0x18ea12,_0x4c06c8){return function(_0x28dfe2){_0x4c06c8[_0xa9b2('0x3')](_0x18ea12,_0x28dfe2);};}function removeListener(_0x50f884,_0x524e4b){return function(){VoiceQueueReportEvents[_0xa9b2('0x4')](_0x50f884,_0x524e4b);};}exports[_0xa9b2('0x5')]=function(_0x181a8f){for(var _0xd7801e=0x0,_0x558267=events[_0xa9b2('0x6')];_0xd7801e<_0x558267;_0xd7801e++){var _0xce1b20=events[_0xd7801e];var _0x2d2560=createListener('voiceQueueReport:'+_0xce1b20,_0x181a8f);VoiceQueueReportEvents['on'](_0xce1b20,_0x2d2560);}}; \ No newline at end of file +var _0x85d0=['emit','register','length','voiceQueueReport:'];(function(_0x1b8f0b,_0x1315c0){var _0x17253a=function(_0x2b6b1d){while(--_0x2b6b1d){_0x1b8f0b['push'](_0x1b8f0b['shift']());}};_0x17253a(++_0x1315c0);}(_0x85d0,0x164));var _0x085d=function(_0x28b24d,_0x314d79){_0x28b24d=_0x28b24d-0x0;var _0x2f22ac=_0x85d0[_0x28b24d];return _0x2f22ac;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save','remove','update'];function createListener(_0x297001,_0x1716e5){return function(_0xfd8773){_0x1716e5[_0x085d('0x0')](_0x297001,_0xfd8773);};}function removeListener(_0x231765,_0x19ae4c){return function(){VoiceQueueReportEvents['removeListener'](_0x231765,_0x19ae4c);};}exports[_0x085d('0x1')]=function(_0x5c917f){for(var _0x364f09=0x0,_0x9acc97=events[_0x085d('0x2')];_0x364f09<_0x9acc97;_0x364f09++){var _0x4a12b7=events[_0x364f09];var _0xf65d01=createListener(_0x085d('0x3')+_0x4a12b7,_0x5c917f);VoiceQueueReportEvents['on'](_0x4a12b7,_0xf65d01);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 68645ab..cd35ecc 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 _0x6c2a=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x251fde,_0x384469){var _0x350af6=function(_0x15a6a3){while(--_0x15a6a3){_0x251fde['push'](_0x251fde['shift']());}};_0x350af6(++_0x384469);}(_0x6c2a,0x177));var _0xa6c2=function(_0x4b38f4,_0x97430c){_0x4b38f4=_0x4b38f4-0x0;var _0x529ae5=_0x6c2a[_0x4b38f4];return _0x529ae5;};'use strict';var multer=require(_0xa6c2('0x0'));var util=require(_0xa6c2('0x1'));var path=require(_0xa6c2('0x2'));var timeout=require(_0xa6c2('0x3'));var express=require(_0xa6c2('0x4'));var router=express['Router']();var fs_extra=require(_0xa6c2('0x5'));var auth=require(_0xa6c2('0x6'));var interaction=require(_0xa6c2('0x7'));var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router[_0xa6c2('0x8')]('/',auth[_0xa6c2('0x9')](),controller[_0xa6c2('0xa')]);router[_0xa6c2('0x8')](_0xa6c2('0xb'),auth[_0xa6c2('0x9')](),controller[_0xa6c2('0xc')]);router[_0xa6c2('0xd')]('/',auth[_0xa6c2('0x9')](),controller[_0xa6c2('0xe')]);router[_0xa6c2('0xf')](_0xa6c2('0xb'),auth[_0xa6c2('0x9')](),controller[_0xa6c2('0x10')]);router[_0xa6c2('0x11')](_0xa6c2('0xb'),auth[_0xa6c2('0x9')](),controller[_0xa6c2('0x12')]);module[_0xa6c2('0x13')]=router; \ No newline at end of file +var _0xf6a7=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xf6a7,0xa1));var _0x7f6a=function(_0x20dc68,_0x3f8502){_0x20dc68=_0x20dc68-0x0;var _0x1e25b9=_0xf6a7[_0x20dc68];return _0x1e25b9;};'use strict';var multer=require(_0x7f6a('0x0'));var util=require('util');var path=require(_0x7f6a('0x1'));var timeout=require(_0x7f6a('0x2'));var express=require(_0x7f6a('0x3'));var router=express[_0x7f6a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7f6a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7f6a('0x6'));var controller=require(_0x7f6a('0x7'));router[_0x7f6a('0x8')]('/',auth[_0x7f6a('0x9')](),controller['index']);router[_0x7f6a('0x8')](_0x7f6a('0xa'),auth[_0x7f6a('0x9')](),controller[_0x7f6a('0xb')]);router[_0x7f6a('0xc')]('/',auth[_0x7f6a('0x9')](),controller[_0x7f6a('0xd')]);router[_0x7f6a('0xe')](_0x7f6a('0xa'),auth[_0x7f6a('0x9')](),controller[_0x7f6a('0xf')]);router[_0x7f6a('0x10')](_0x7f6a('0xa'),auth['isAuthenticated'](),controller[_0x7f6a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 6ee8824..15ccb74 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 _0x73a8=['DATE','format','moment','STRING'];(function(_0x2b2e47,_0x354fb2){var _0x39d6f5=function(_0x155f0f){while(--_0x155f0f){_0x2b2e47['push'](_0x2b2e47['shift']());}};_0x39d6f5(++_0x354fb2);}(_0x73a8,0x12a));var _0x873a=function(_0x28d2d3,_0x3c9554){_0x28d2d3=_0x28d2d3-0x0;var _0x25e8e1=_0x73a8[_0x28d2d3];return _0x25e8e1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x873a('0x0'));module['exports']={'time':{'type':Sequelize[_0x873a('0x1')]},'callid':{'type':Sequelize[_0x873a('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x873a('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x873a('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x873a('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x873a('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x873a('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x873a('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x873a('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x873a('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x873a('0x2')],'allowNull':![],'defaultValue':moment()[_0x873a('0x3')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0xb018=['moment','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x5d00ee,_0x371980){var _0x4a3cbb=function(_0x2d0d2d){while(--_0x2d0d2d){_0x5d00ee['push'](_0x5d00ee['shift']());}};_0x4a3cbb(++_0x371980);}(_0xb018,0x6b));var _0x8b01=function(_0x3cef03,_0x1e3009){_0x3cef03=_0x3cef03-0x0;var _0x56e55a=_0xb018[_0x3cef03];return _0x56e55a;};'use strict';var Sequelize=require(_0x8b01('0x0'));var moment=require(_0x8b01('0x1'));module['exports']={'time':{'type':Sequelize[_0x8b01('0x2')]},'callid':{'type':Sequelize[_0x8b01('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x8b01('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x8b01('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x8b01('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x8b01('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x8b01('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x8b01('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x8b01('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x8b01('0x3')],'allowNull':![],'defaultValue':moment()[_0x8b01('0x4')](_0x8b01('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index a8f1ecb..2be8b47 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 _0x1b2c=['send','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','length','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','count','limit','set','Content-Range','apply','save','then','destroy','sendStatus','error','name'];(function(_0x1f98f3,_0x49cbfa){var _0x1b5c81=function(_0x2a761e){while(--_0x2a761e){_0x1f98f3['push'](_0x1f98f3['shift']());}};_0x1b5c81(++_0x49cbfa);}(_0x1b2c,0xc0));var _0xc1b2=function(_0x241595,_0x11afec){_0x241595=_0x241595-0x0;var _0x22db6e=_0x1b2c[_0x241595];return _0x22db6e;};'use strict';var emlformat=require(_0xc1b2('0x0'));var rimraf=require(_0xc1b2('0x1'));var zipdir=require(_0xc1b2('0x2'));var jsonpatch=require(_0xc1b2('0x3'));var rp=require(_0xc1b2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc1b2('0x5'));var util=require('util');var path=require(_0xc1b2('0x6'));var sox=require(_0xc1b2('0x7'));var csv=require(_0xc1b2('0x8'));var ejs=require(_0xc1b2('0x9'));var fs=require('fs');var fs_extra=require(_0xc1b2('0xa'));var _=require(_0xc1b2('0xb'));var squel=require(_0xc1b2('0xc'));var crypto=require(_0xc1b2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc1b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc1b2('0xf'));var Papa=require(_0xc1b2('0x10'));var Redis=require(_0xc1b2('0x11'));var authService=require(_0xc1b2('0x12'));var qs=require(_0xc1b2('0x13'));var as=require(_0xc1b2('0x14'));var hardwareService=require(_0xc1b2('0x15'));var logger=require(_0xc1b2('0x16'))(_0xc1b2('0x17'));var utils=require(_0xc1b2('0x18'));var config=require(_0xc1b2('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1b2('0x1a'))['db'];function respondWithStatusCode(_0x5623f9,_0x5d9b4c){_0x5d9b4c=_0x5d9b4c||0xcc;return function(_0x127b59){if(_0x127b59){return _0x5623f9['sendStatus'](_0x5d9b4c);}return _0x5623f9[_0xc1b2('0x1b')](_0x5d9b4c)[_0xc1b2('0x1c')]();};}function respondWithResult(_0x4a5341,_0x30ba15){_0x30ba15=_0x30ba15||0xc8;return function(_0xabc9e4){if(_0xabc9e4){return _0x4a5341[_0xc1b2('0x1b')](_0x30ba15)[_0xc1b2('0x1d')](_0xabc9e4);}};}function respondWithFilteredResult(_0x5a6b95,_0x4cf9b7){return function(_0x19ea6f){if(_0x19ea6f){var _0x5b908d=typeof _0x4cf9b7[_0xc1b2('0x1e')]==='undefined'&&typeof _0x4cf9b7['limit']==='undefined';var _0x2ad298=_0x19ea6f[_0xc1b2('0x1f')];var _0xe5987=_0x5b908d?0x0:_0x4cf9b7[_0xc1b2('0x1e')];var _0xae710e=_0x5b908d?_0x19ea6f[_0xc1b2('0x1f')]:_0x4cf9b7[_0xc1b2('0x1e')]+_0x4cf9b7[_0xc1b2('0x20')];var _0x3096d7;if(_0xae710e>=_0x2ad298){_0xae710e=_0x2ad298;_0x3096d7=0xc8;}else{_0x3096d7=0xce;}_0x5a6b95['status'](_0x3096d7);return _0x5a6b95[_0xc1b2('0x21')](_0xc1b2('0x22'),_0xe5987+'-'+_0xae710e+'/'+_0x2ad298)[_0xc1b2('0x1d')](_0x19ea6f);}return null;};}function patchUpdates(_0x5505ad){return function(_0x2c363d){try{jsonpatch[_0xc1b2('0x23')](_0x2c363d,_0x5505ad,!![]);}catch(_0x5935c3){return BPromise['reject'](_0x5935c3);}return _0x2c363d[_0xc1b2('0x24')]();};}function saveUpdates(_0x2a26c1,_0x51073d){return function(_0x15da87){if(_0x15da87){return _0x15da87['update'](_0x2a26c1)[_0xc1b2('0x25')](function(_0x5ae789){return _0x5ae789;});}return null;};}function removeEntity(_0x5c20ff,_0x322e64){return function(_0x238a87){if(_0x238a87){return _0x238a87[_0xc1b2('0x26')]()[_0xc1b2('0x25')](function(){_0x5c20ff['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x486054,_0x1dfdec){return function(_0x7adac4){if(!_0x7adac4){_0x486054[_0xc1b2('0x27')](0x194);}return _0x7adac4;};}function handleError(_0xf3c99,_0x4062c7){_0x4062c7=_0x4062c7||0x1f4;return function(_0x1d00f2){logger[_0xc1b2('0x28')](_0x1d00f2['stack']);if(_0x1d00f2[_0xc1b2('0x29')]){delete _0x1d00f2[_0xc1b2('0x29')];}_0xf3c99[_0xc1b2('0x1b')](_0x4062c7)[_0xc1b2('0x2a')](_0x1d00f2);};}exports[_0xc1b2('0x2b')]=function(_0x43aeef,_0x18fc5c){var _0x503d02={},_0x227243={},_0x2fa8fb={'count':0x0,'rows':[]};var _0x3866a0=_['map'](db[_0xc1b2('0x2c')][_0xc1b2('0x2d')],function(_0x1d222c){return{'name':_0x1d222c[_0xc1b2('0x2e')],'type':_0x1d222c[_0xc1b2('0x2f')][_0xc1b2('0x30')]};});_0x227243[_0xc1b2('0x31')]=_[_0xc1b2('0x32')](_0x3866a0,_0xc1b2('0x29'));_0x227243[_0xc1b2('0x33')]=_[_0xc1b2('0x34')](_0x43aeef[_0xc1b2('0x33')]);_0x227243[_0xc1b2('0x35')]=_[_0xc1b2('0x36')](_0x227243[_0xc1b2('0x31')],_0x227243[_0xc1b2('0x33')]);_0x503d02[_0xc1b2('0x37')]=_[_0xc1b2('0x36')](_0x227243[_0xc1b2('0x31')],qs['fields'](_0x43aeef[_0xc1b2('0x33')][_0xc1b2('0x38')]));_0x503d02[_0xc1b2('0x37')]=_0x503d02[_0xc1b2('0x37')]['length']?_0x503d02[_0xc1b2('0x37')]:_0x227243[_0xc1b2('0x31')];if(!_0x43aeef[_0xc1b2('0x33')][_0xc1b2('0x39')](_0xc1b2('0x3a'))){_0x503d02[_0xc1b2('0x20')]=qs['limit'](_0x43aeef[_0xc1b2('0x33')][_0xc1b2('0x20')]);_0x503d02[_0xc1b2('0x1e')]=qs['offset'](_0x43aeef[_0xc1b2('0x33')][_0xc1b2('0x1e')]);}_0x503d02[_0xc1b2('0x3b')]=qs[_0xc1b2('0x3c')](_0x43aeef[_0xc1b2('0x33')][_0xc1b2('0x3c')]);_0x503d02[_0xc1b2('0x3d')]=qs[_0xc1b2('0x35')](_[_0xc1b2('0x3e')](_0x43aeef[_0xc1b2('0x33')],_0x227243['filters']),_0x3866a0);if(_0x43aeef[_0xc1b2('0x33')]['filter']){_0x503d02[_0xc1b2('0x3d')]=_['merge'](_0x503d02[_0xc1b2('0x3d')],{'$or':_[_0xc1b2('0x32')](_0x3866a0,function(_0x30c06c){if(_0x30c06c[_0xc1b2('0x2f')]!==_0xc1b2('0x3f')){var _0x2f275f={};_0x2f275f[_0x30c06c[_0xc1b2('0x29')]]={'$like':'%'+_0x43aeef[_0xc1b2('0x33')][_0xc1b2('0x40')]+'%'};return _0x2f275f;}})});}_0x503d02=_[_0xc1b2('0x41')]({},_0x503d02,_0x43aeef[_0xc1b2('0x42')]);var _0x54ed79={'where':_0x503d02[_0xc1b2('0x3d')]};return db[_0xc1b2('0x2c')]['count'](_0x54ed79)[_0xc1b2('0x25')](function(_0x3f7d0b){_0x2fa8fb[_0xc1b2('0x1f')]=_0x3f7d0b;if(_0x43aeef[_0xc1b2('0x33')][_0xc1b2('0x43')]){_0x503d02['include']=[{'all':!![]}];}return db[_0xc1b2('0x2c')][_0xc1b2('0x44')](_0x503d02);})[_0xc1b2('0x25')](function(_0x1eb039){_0x2fa8fb['rows']=_0x1eb039;return _0x2fa8fb;})[_0xc1b2('0x25')](respondWithFilteredResult(_0x18fc5c,_0x503d02))[_0xc1b2('0x45')](handleError(_0x18fc5c,null));};exports[_0xc1b2('0x46')]=function(_0x5c13a2,_0x5a9827){var _0x3eb666={'raw':!![],'where':{'id':_0x5c13a2[_0xc1b2('0x47')]['id']}},_0x264931={};_0x264931[_0xc1b2('0x31')]=_[_0xc1b2('0x34')](db[_0xc1b2('0x2c')][_0xc1b2('0x2d')]);_0x264931[_0xc1b2('0x33')]=_[_0xc1b2('0x34')](_0x5c13a2[_0xc1b2('0x33')]);_0x264931[_0xc1b2('0x35')]=_[_0xc1b2('0x36')](_0x264931[_0xc1b2('0x31')],_0x264931[_0xc1b2('0x33')]);_0x3eb666[_0xc1b2('0x37')]=_[_0xc1b2('0x36')](_0x264931[_0xc1b2('0x31')],qs['fields'](_0x5c13a2[_0xc1b2('0x33')]['fields']));_0x3eb666['attributes']=_0x3eb666[_0xc1b2('0x37')][_0xc1b2('0x48')]?_0x3eb666[_0xc1b2('0x37')]:_0x264931[_0xc1b2('0x31')];if(_0x5c13a2[_0xc1b2('0x33')][_0xc1b2('0x43')]){_0x3eb666[_0xc1b2('0x49')]=[{'all':!![]}];}_0x3eb666=_[_0xc1b2('0x41')]({},_0x3eb666,_0x5c13a2[_0xc1b2('0x42')]);return db[_0xc1b2('0x2c')][_0xc1b2('0x4a')](_0x3eb666)['then'](handleEntityNotFound(_0x5a9827,null))[_0xc1b2('0x25')](respondWithResult(_0x5a9827,null))[_0xc1b2('0x45')](handleError(_0x5a9827,null));};exports[_0xc1b2('0x4b')]=function(_0x554cf4,_0x5d90fb){return db[_0xc1b2('0x2c')][_0xc1b2('0x4b')](_0x554cf4[_0xc1b2('0x4c')],{})[_0xc1b2('0x25')](respondWithResult(_0x5d90fb,0xc9))[_0xc1b2('0x45')](handleError(_0x5d90fb,null));};exports[_0xc1b2('0x4d')]=function(_0xb37ee8,_0x353640){if(_0xb37ee8[_0xc1b2('0x4c')]['id']){delete _0xb37ee8[_0xc1b2('0x4c')]['id'];}return db['VoiceQueuesLog'][_0xc1b2('0x4a')]({'where':{'id':_0xb37ee8['params']['id']}})[_0xc1b2('0x25')](handleEntityNotFound(_0x353640,null))[_0xc1b2('0x25')](saveUpdates(_0xb37ee8['body'],null))['then'](respondWithResult(_0x353640,null))['catch'](handleError(_0x353640,null));};exports[_0xc1b2('0x26')]=function(_0x3487ef,_0x11d82e){return db[_0xc1b2('0x2c')][_0xc1b2('0x4a')]({'where':{'id':_0x3487ef[_0xc1b2('0x47')]['id']}})[_0xc1b2('0x25')](handleEntityNotFound(_0x11d82e,null))[_0xc1b2('0x25')](removeEntity(_0x11d82e,null))[_0xc1b2('0x45')](handleError(_0x11d82e,null));}; \ No newline at end of file +var _0x89cf=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceQueuesLog','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','fields','find','create','params','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x27acd4,_0x2cb514){var _0xa64ff3=function(_0x156784){while(--_0x156784){_0x27acd4['push'](_0x27acd4['shift']());}};_0xa64ff3(++_0x2cb514);}(_0x89cf,0xbc));var _0xf89c=function(_0x244218,_0x431e5f){_0x244218=_0x244218-0x0;var _0x5e49af=_0x89cf[_0x244218];return _0x5e49af;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf89c('0x0'));var rp=require(_0xf89c('0x1'));var moment=require(_0xf89c('0x2'));var BPromise=require(_0xf89c('0x3'));var Mustache=require(_0xf89c('0x4'));var util=require(_0xf89c('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xf89c('0x6'));var ejs=require(_0xf89c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf89c('0x8'));var crypto=require('crypto');var jsforce=require(_0xf89c('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xf89c('0x6'));var querystring=require('querystring');var Papa=require(_0xf89c('0xa'));var Redis=require(_0xf89c('0xb'));var authService=require(_0xf89c('0xc'));var qs=require(_0xf89c('0xd'));var as=require(_0xf89c('0xe'));var hardwareService=require(_0xf89c('0xf'));var logger=require('../../config/logger')(_0xf89c('0x10'));var utils=require(_0xf89c('0x11'));var config=require(_0xf89c('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xf89c('0x13'))['db'];function respondWithStatusCode(_0x51b8df,_0x38e488){_0x38e488=_0x38e488||0xcc;return function(_0x262078){if(_0x262078){return _0x51b8df[_0xf89c('0x14')](_0x38e488);}return _0x51b8df['status'](_0x38e488)[_0xf89c('0x15')]();};}function respondWithResult(_0xf951f3,_0x2f75ef){_0x2f75ef=_0x2f75ef||0xc8;return function(_0x6feab4){if(_0x6feab4){return _0xf951f3[_0xf89c('0x16')](_0x2f75ef)[_0xf89c('0x17')](_0x6feab4);}};}function respondWithFilteredResult(_0xc59bb2,_0x3e24f1){return function(_0x12124b){if(_0x12124b){var _0x4b477f=typeof _0x3e24f1[_0xf89c('0x18')]===_0xf89c('0x19')&&typeof _0x3e24f1[_0xf89c('0x1a')]==='undefined';var _0x2ef675=_0x12124b[_0xf89c('0x1b')];var _0x15743b=_0x4b477f?0x0:_0x3e24f1['offset'];var _0x3f815e=_0x4b477f?_0x12124b[_0xf89c('0x1b')]:_0x3e24f1[_0xf89c('0x18')]+_0x3e24f1[_0xf89c('0x1a')];var _0x64c72e;if(_0x3f815e>=_0x2ef675){_0x3f815e=_0x2ef675;_0x64c72e=0xc8;}else{_0x64c72e=0xce;}_0xc59bb2[_0xf89c('0x16')](_0x64c72e);return _0xc59bb2['set']('Content-Range',_0x15743b+'-'+_0x3f815e+'/'+_0x2ef675)[_0xf89c('0x17')](_0x12124b);}return null;};}function patchUpdates(_0x31b678){return function(_0x5838d3){try{jsonpatch[_0xf89c('0x1c')](_0x5838d3,_0x31b678,!![]);}catch(_0x5e38b7){return BPromise[_0xf89c('0x1d')](_0x5e38b7);}return _0x5838d3[_0xf89c('0x1e')]();};}function saveUpdates(_0x5b6041,_0x2fa607){return function(_0x5df383){if(_0x5df383){return _0x5df383[_0xf89c('0x1f')](_0x5b6041)[_0xf89c('0x20')](function(_0x1e9fdd){return _0x1e9fdd;});}return null;};}function removeEntity(_0x5efbf9,_0x30dadb){return function(_0x5a5e85){if(_0x5a5e85){return _0x5a5e85[_0xf89c('0x21')]()[_0xf89c('0x20')](function(){_0x5efbf9[_0xf89c('0x16')](0xcc)[_0xf89c('0x15')]();});}};}function handleEntityNotFound(_0x4c0f37,_0x254785){return function(_0x1da228){if(!_0x1da228){_0x4c0f37[_0xf89c('0x14')](0x194);}return _0x1da228;};}function handleError(_0x53cddc,_0x4782d7){_0x4782d7=_0x4782d7||0x1f4;return function(_0x3555ce){logger[_0xf89c('0x22')](_0x3555ce['stack']);if(_0x3555ce[_0xf89c('0x23')]){delete _0x3555ce['name'];}_0x53cddc['status'](_0x4782d7)[_0xf89c('0x24')](_0x3555ce);};}exports[_0xf89c('0x25')]=function(_0x514596,_0x296996){var _0x2540f0={},_0x3ae3ba={},_0x804de9={'count':0x0,'rows':[]};var _0x5c0589=_[_0xf89c('0x26')](db[_0xf89c('0x27')]['rawAttributes'],function(_0x33599c){return{'name':_0x33599c[_0xf89c('0x28')],'type':_0x33599c[_0xf89c('0x29')][_0xf89c('0x2a')]};});_0x3ae3ba[_0xf89c('0x2b')]=_['map'](_0x5c0589,_0xf89c('0x23'));_0x3ae3ba['query']=_[_0xf89c('0x2c')](_0x514596[_0xf89c('0x2d')]);_0x3ae3ba[_0xf89c('0x2e')]=_[_0xf89c('0x2f')](_0x3ae3ba[_0xf89c('0x2b')],_0x3ae3ba[_0xf89c('0x2d')]);_0x2540f0[_0xf89c('0x30')]=_[_0xf89c('0x2f')](_0x3ae3ba[_0xf89c('0x2b')],qs['fields'](_0x514596[_0xf89c('0x2d')]['fields']));_0x2540f0[_0xf89c('0x30')]=_0x2540f0['attributes'][_0xf89c('0x31')]?_0x2540f0[_0xf89c('0x30')]:_0x3ae3ba[_0xf89c('0x2b')];if(!_0x514596['query']['hasOwnProperty'](_0xf89c('0x32'))){_0x2540f0[_0xf89c('0x1a')]=qs[_0xf89c('0x1a')](_0x514596[_0xf89c('0x2d')]['limit']);_0x2540f0[_0xf89c('0x18')]=qs[_0xf89c('0x18')](_0x514596[_0xf89c('0x2d')][_0xf89c('0x18')]);}_0x2540f0['order']=qs['sort'](_0x514596[_0xf89c('0x2d')][_0xf89c('0x33')]);_0x2540f0[_0xf89c('0x34')]=qs[_0xf89c('0x2e')](_[_0xf89c('0x35')](_0x514596['query'],_0x3ae3ba[_0xf89c('0x2e')]),_0x5c0589);if(_0x514596[_0xf89c('0x2d')]['filter']){_0x2540f0['where']=_[_0xf89c('0x36')](_0x2540f0[_0xf89c('0x34')],{'$or':_['map'](_0x5c0589,function(_0x490d8f){if(_0x490d8f[_0xf89c('0x29')]!==_0xf89c('0x37')){var _0x257253={};_0x257253[_0x490d8f['name']]={'$like':'%'+_0x514596[_0xf89c('0x2d')][_0xf89c('0x38')]+'%'};return _0x257253;}})});}_0x2540f0=_['merge']({},_0x2540f0,_0x514596[_0xf89c('0x39')]);var _0x315de8={'where':_0x2540f0[_0xf89c('0x34')]};return db[_0xf89c('0x27')][_0xf89c('0x1b')](_0x315de8)[_0xf89c('0x20')](function(_0x34b300){_0x804de9[_0xf89c('0x1b')]=_0x34b300;if(_0x514596['query'][_0xf89c('0x3a')]){_0x2540f0[_0xf89c('0x3b')]=[{'all':!![]}];}return db[_0xf89c('0x27')][_0xf89c('0x3c')](_0x2540f0);})[_0xf89c('0x20')](function(_0x17e63f){_0x804de9[_0xf89c('0x3d')]=_0x17e63f;return _0x804de9;})[_0xf89c('0x20')](respondWithFilteredResult(_0x296996,_0x2540f0))[_0xf89c('0x3e')](handleError(_0x296996,null));};exports[_0xf89c('0x3f')]=function(_0x374438,_0x1ad625){var _0x35d77e={'raw':!![],'where':{'id':_0x374438['params']['id']}},_0x3c617d={};_0x3c617d[_0xf89c('0x2b')]=_[_0xf89c('0x2c')](db[_0xf89c('0x27')]['rawAttributes']);_0x3c617d['query']=_[_0xf89c('0x2c')](_0x374438[_0xf89c('0x2d')]);_0x3c617d[_0xf89c('0x2e')]=_[_0xf89c('0x2f')](_0x3c617d[_0xf89c('0x2b')],_0x3c617d['query']);_0x35d77e[_0xf89c('0x30')]=_[_0xf89c('0x2f')](_0x3c617d['model'],qs['fields'](_0x374438[_0xf89c('0x2d')][_0xf89c('0x40')]));_0x35d77e[_0xf89c('0x30')]=_0x35d77e[_0xf89c('0x30')][_0xf89c('0x31')]?_0x35d77e['attributes']:_0x3c617d['model'];if(_0x374438[_0xf89c('0x2d')][_0xf89c('0x3a')]){_0x35d77e[_0xf89c('0x3b')]=[{'all':!![]}];}_0x35d77e=_[_0xf89c('0x36')]({},_0x35d77e,_0x374438[_0xf89c('0x39')]);return db[_0xf89c('0x27')][_0xf89c('0x41')](_0x35d77e)[_0xf89c('0x20')](handleEntityNotFound(_0x1ad625,null))[_0xf89c('0x20')](respondWithResult(_0x1ad625,null))['catch'](handleError(_0x1ad625,null));};exports['create']=function(_0x396245,_0x5e918e){return db['VoiceQueuesLog'][_0xf89c('0x42')](_0x396245['body'],{})['then'](respondWithResult(_0x5e918e,0xc9))[_0xf89c('0x3e')](handleError(_0x5e918e,null));};exports[_0xf89c('0x1f')]=function(_0x127c81,_0x30d853){if(_0x127c81['body']['id']){delete _0x127c81['body']['id'];}return db[_0xf89c('0x27')]['find']({'where':{'id':_0x127c81[_0xf89c('0x43')]['id']}})[_0xf89c('0x20')](handleEntityNotFound(_0x30d853,null))[_0xf89c('0x20')](saveUpdates(_0x127c81['body'],null))['then'](respondWithResult(_0x30d853,null))['catch'](handleError(_0x30d853,null));};exports[_0xf89c('0x21')]=function(_0x53a863,_0x49782b){return db['VoiceQueuesLog']['find']({'where':{'id':_0x53a863['params']['id']}})[_0xf89c('0x20')](handleEntityNotFound(_0x49782b,null))[_0xf89c('0x20')](removeEntity(_0x49782b,null))[_0xf89c('0x3e')](handleError(_0x49782b,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 79a3915..d7dd815 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 _0x2e14=['./voiceQueuesLog.attributes','define','VoiceQueuesLog','event_dtm','event','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x42342b,_0x1c2993){var _0x3f60b8=function(_0x291a60){while(--_0x291a60){_0x42342b['push'](_0x42342b['shift']());}};_0x3f60b8(++_0x1c2993);}(_0x2e14,0xae));var _0x42e1=function(_0x23ca3a,_0xe44c43){_0x23ca3a=_0x23ca3a-0x0;var _0x5c1aab=_0x2e14[_0x23ca3a];return _0x5c1aab;};'use strict';var _=require(_0x42e1('0x0'));var util=require(_0x42e1('0x1'));var logger=require('../../config/logger')(_0x42e1('0x2'));var moment=require('moment');var BPromise=require(_0x42e1('0x3'));var rp=require(_0x42e1('0x4'));var fs=require('fs');var path=require(_0x42e1('0x5'));var rimraf=require(_0x42e1('0x6'));var config=require(_0x42e1('0x7'));var attributes=require(_0x42e1('0x8'));module['exports']=function(_0xc604f,_0x42815d){return _0xc604f[_0x42e1('0x9')](_0x42e1('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x42e1('0xb'),'fields':[_0x42e1('0xc'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x3934=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','util'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x3934,0x10e));var _0x4393=function(_0x5cd962,_0x3507b8){_0x5cd962=_0x5cd962-0x0;var _0x860cff=_0x3934[_0x5cd962];return _0x860cff;};'use strict';var _=require(_0x4393('0x0'));var util=require(_0x4393('0x1'));var logger=require(_0x4393('0x2'))(_0x4393('0x3'));var moment=require(_0x4393('0x4'));var BPromise=require(_0x4393('0x5'));var rp=require(_0x4393('0x6'));var fs=require('fs');var path=require(_0x4393('0x7'));var rimraf=require(_0x4393('0x8'));var config=require(_0x4393('0x9'));var attributes=require('./voiceQueuesLog.attributes');module[_0x4393('0xa')]=function(_0x4ed5d7,_0x496326){return _0x4ed5d7[_0x4393('0xb')](_0x4393('0xc'),attributes,{'tableName':_0x4393('0xd'),'paranoid':![],'indexes':[{'name':_0x4393('0xe'),'fields':['event',_0x4393('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index b67fbee..a79b34b 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 _0xeca7=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','VoiceQueuesLog,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','catch','lodash','util','moment','randomstring'];(function(_0x258653,_0x46bf52){var _0x3df0e5=function(_0x3fb3ad){while(--_0x3fb3ad){_0x258653['push'](_0x258653['shift']());}};_0x3df0e5(++_0x46bf52);}(_0xeca7,0xba));var _0x7eca=function(_0x40d078,_0x210a77){_0x40d078=_0x40d078-0x0;var _0x46fc81=_0xeca7[_0x40d078];return _0x46fc81;};'use strict';var _=require(_0x7eca('0x0'));var util=require(_0x7eca('0x1'));var moment=require(_0x7eca('0x2'));var BPromise=require('bluebird');var rs=require(_0x7eca('0x3'));var fs=require('fs');var Redis=require(_0x7eca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7eca('0x5'));var logger=require(_0x7eca('0x6'))('rpc');var config=require(_0x7eca('0x7'));var jayson=require(_0x7eca('0x8'));var client=jayson[_0x7eca('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c0553,_0x3abbd5,_0x61f0f3){return new BPromise(function(_0x55b57a,_0x3d794a){return client['request'](_0x1c0553,_0x61f0f3)['then'](function(_0x1e3ff2){logger['info'](_0x7eca('0xa'),_0x3abbd5,'request\x20sent');logger[_0x7eca('0xb')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x3abbd5,'request\x20sent',JSON[_0x7eca('0xc')](_0x1e3ff2));if(_0x1e3ff2[_0x7eca('0xd')]){if(_0x1e3ff2[_0x7eca('0xd')]['code']===0x1f4){logger[_0x7eca('0xd')](_0x7eca('0xa'),_0x3abbd5,_0x1e3ff2['error']['message']);return _0x3d794a(_0x1e3ff2[_0x7eca('0xd')][_0x7eca('0xe')]);}logger[_0x7eca('0xd')](_0x7eca('0xa'),_0x3abbd5,_0x1e3ff2[_0x7eca('0xd')][_0x7eca('0xe')]);return _0x55b57a(_0x1e3ff2[_0x7eca('0xd')]['message']);}else{logger[_0x7eca('0xf')](_0x7eca('0xa'),_0x3abbd5,_0x7eca('0x10'));_0x55b57a(_0x1e3ff2[_0x7eca('0x11')][_0x7eca('0xe')]);}})[_0x7eca('0x12')](function(_0x357a93){logger[_0x7eca('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3abbd5,_0x357a93);_0x3d794a(_0x357a93);});});} \ No newline at end of file +var _0x5ff3=['message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x2bdae0,_0xb65b0a){var _0xd865a8=function(_0x380e9d){while(--_0x380e9d){_0x2bdae0['push'](_0x2bdae0['shift']());}};_0xd865a8(++_0xb65b0a);}(_0x5ff3,0x17d));var _0x35ff=function(_0x3cdb13,_0x1b6a7f){_0x3cdb13=_0x3cdb13-0x0;var _0x21f2b0=_0x5ff3[_0x3cdb13];return _0x21f2b0;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var moment=require('moment');var BPromise=require(_0x35ff('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ff('0x2'));var db=require(_0x35ff('0x3'))['db'];var utils=require(_0x35ff('0x4'));var logger=require(_0x35ff('0x5'))('rpc');var config=require(_0x35ff('0x6'));var jayson=require(_0x35ff('0x7'));var client=jayson[_0x35ff('0x8')][_0x35ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30c3ff,_0x495c31,_0x92b403){return new BPromise(function(_0x4c9fab,_0x2e7470){return client[_0x35ff('0xa')](_0x30c3ff,_0x92b403)[_0x35ff('0xb')](function(_0x51967a){logger[_0x35ff('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x495c31,_0x35ff('0xd'));logger[_0x35ff('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x495c31,'request\x20sent',JSON[_0x35ff('0xf')](_0x51967a));if(_0x51967a['error']){if(_0x51967a['error']['code']===0x1f4){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);return _0x2e7470(_0x51967a['error'][_0x35ff('0x12')]);}logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a['error'][_0x35ff('0x12')]);return _0x4c9fab(_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);}else{logger[_0x35ff('0xc')](_0x35ff('0x11'),_0x495c31,_0x35ff('0xd'));_0x4c9fab(_0x51967a[_0x35ff('0x13')][_0x35ff('0x12')]);}})[_0x35ff('0x14')](function(_0x2f3456){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x2f3456);_0x2e7470(_0x2f3456);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 2aa6754..a5accb3 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 _0xfb9f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xfb9f,0x108));var _0xffb9=function(_0x210b09,_0x43a0f2){_0x210b09=_0x210b09-0x0;var _0x579151=_0xfb9f[_0x210b09];return _0x579151;};'use strict';var multer=require(_0xffb9('0x0'));var util=require(_0xffb9('0x1'));var path=require(_0xffb9('0x2'));var timeout=require(_0xffb9('0x3'));var express=require(_0xffb9('0x4'));var router=express[_0xffb9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xffb9('0x6'));var interaction=require(_0xffb9('0x7'));var config=require(_0xffb9('0x8'));var controller=require(_0xffb9('0x9'));router[_0xffb9('0xa')]('/',auth[_0xffb9('0xb')](),controller[_0xffb9('0xc')]);router[_0xffb9('0xa')](_0xffb9('0xd'),auth['isAuthenticated'](),controller[_0xffb9('0xe')]);router[_0xffb9('0xa')](_0xffb9('0xf'),auth['isAuthenticated'](),controller[_0xffb9('0x10')]);router[_0xffb9('0xa')](_0xffb9('0x11'),auth['isAuthenticated'](),controller[_0xffb9('0x12')]);router[_0xffb9('0xa')](_0xffb9('0x13'),controller[_0xffb9('0x14')]);router['get'](_0xffb9('0x15'),auth[_0xffb9('0xb')](),controller[_0xffb9('0x16')]);router[_0xffb9('0x17')]('/',auth[_0xffb9('0xb')](),controller[_0xffb9('0x18')]);router['post'](_0xffb9('0x15'),auth['isAuthenticated'](),controller[_0xffb9('0x19')]);router[_0xffb9('0x1a')](_0xffb9('0xf'),auth['isAuthenticated'](),controller[_0xffb9('0x1b')]);router['delete'](_0xffb9('0xf'),auth[_0xffb9('0xb')](),controller[_0xffb9('0x1c')]);module[_0xffb9('0x1d')]=router; \ No newline at end of file +var _0xcb62=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','isAuthenticated','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put','/:id','update','delete'];(function(_0x393a7e,_0x413f4b){var _0x592b84=function(_0x3a357b){while(--_0x3a357b){_0x393a7e['push'](_0x393a7e['shift']());}};_0x592b84(++_0x413f4b);}(_0xcb62,0xc6));var _0x2cb6=function(_0x540152,_0x4e82f2){_0x540152=_0x540152-0x0;var _0x27899c=_0xcb62[_0x540152];return _0x27899c;};'use strict';var multer=require(_0x2cb6('0x0'));var util=require(_0x2cb6('0x1'));var path=require('path');var timeout=require(_0x2cb6('0x2'));var express=require(_0x2cb6('0x3'));var router=express[_0x2cb6('0x4')]();var fs_extra=require(_0x2cb6('0x5'));var auth=require(_0x2cb6('0x6'));var interaction=require(_0x2cb6('0x7'));var config=require(_0x2cb6('0x8'));var controller=require('./voiceRecording.controller');router[_0x2cb6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2cb6('0x9')](_0x2cb6('0xa'),auth['isAuthenticated'](),controller[_0x2cb6('0xb')]);router[_0x2cb6('0x9')]('/:id',auth[_0x2cb6('0xc')](),controller[_0x2cb6('0xd')]);router['get'](_0x2cb6('0xe'),auth[_0x2cb6('0xc')](),controller[_0x2cb6('0xf')]);router[_0x2cb6('0x9')](_0x2cb6('0x10'),controller[_0x2cb6('0x11')]);router['get'](_0x2cb6('0x12'),auth[_0x2cb6('0xc')](),controller['downloadTranscribe']);router[_0x2cb6('0x13')]('/',auth[_0x2cb6('0xc')](),controller[_0x2cb6('0x14')]);router[_0x2cb6('0x13')](_0x2cb6('0x12'),auth[_0x2cb6('0xc')](),controller[_0x2cb6('0x15')]);router[_0x2cb6('0x16')](_0x2cb6('0x17'),auth[_0x2cb6('0xc')](),controller[_0x2cb6('0x18')]);router[_0x2cb6('0x19')]('/:id',auth[_0x2cb6('0xc')](),controller[_0x2cb6('0x1a')]);module[_0x2cb6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 53181a9..de53585 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 d9ef3b5..a01cf02 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 _0x024d=['[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','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Sequelize','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','tempSentiment','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','TranscribeService'];(function(_0x254b3f,_0x1392e6){var _0x1ddbb4=function(_0x58dbac){while(--_0x58dbac){_0x254b3f['push'](_0x254b3f['shift']());}};_0x1ddbb4(++_0x1392e6);}(_0x024d,0xc2));var _0xd024=function(_0x3d7043,_0x59e1a8){_0x3d7043=_0x3d7043-0x0;var _0x4b9863=_0x024d[_0x3d7043];return _0x4b9863;};'use strict';var emlformat=require(_0xd024('0x0'));var rimraf=require(_0xd024('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd024('0x2'));var rp=require(_0xd024('0x3'));var moment=require(_0xd024('0x4'));var BPromise=require(_0xd024('0x5'));var Mustache=require(_0xd024('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd024('0x7'));var csv=require(_0xd024('0x8'));var ejs=require(_0xd024('0x9'));var fs=require('fs');var fs_extra=require(_0xd024('0xa'));var _=require('lodash');var squel=require(_0xd024('0xb'));var crypto=require(_0xd024('0xc'));var jsforce=require(_0xd024('0xd'));var deskjs=require(_0xd024('0xe'));var toCsv=require(_0xd024('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0xd024('0xf'));var Redis=require(_0xd024('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd024('0x11'));var as=require(_0xd024('0x12'));var hardwareService=require(_0xd024('0x13'));var logger=require(_0xd024('0x14'))(_0xd024('0x15'));var utils=require('../../config/utils');var config=require(_0xd024('0x16'));var licenseUtil=require(_0xd024('0x17'));var db=require(_0xd024('0x18'))['db'];function respondWithStatusCode(_0x23356e,_0x72fb){_0x72fb=_0x72fb||0xcc;return function(_0x6b43f0){if(_0x6b43f0){return _0x23356e[_0xd024('0x19')](_0x72fb);}return _0x23356e[_0xd024('0x1a')](_0x72fb)[_0xd024('0x1b')]();};}function respondWithResult(_0xeab791,_0x284e0b){_0x284e0b=_0x284e0b||0xc8;return function(_0xf1599){if(_0xf1599){return _0xeab791[_0xd024('0x1a')](_0x284e0b)['json'](_0xf1599);}};}function respondWithFilteredResult(_0x490c31,_0x363397){return function(_0x432910){if(_0x432910){var _0xe3eee2=typeof _0x363397[_0xd024('0x1c')]==='undefined'&&typeof _0x363397['limit']===_0xd024('0x1d');var _0x165967=_0x432910[_0xd024('0x1e')];var _0x56f671=_0xe3eee2?0x0:_0x363397['offset'];var _0xfb8885=_0xe3eee2?_0x432910[_0xd024('0x1e')]:_0x363397[_0xd024('0x1c')]+_0x363397[_0xd024('0x1f')];var _0x150e77;if(_0xfb8885>=_0x165967){_0xfb8885=_0x165967;_0x150e77=0xc8;}else{_0x150e77=0xce;}_0x490c31['status'](_0x150e77);return _0x490c31[_0xd024('0x20')](_0xd024('0x21'),_0x56f671+'-'+_0xfb8885+'/'+_0x165967)[_0xd024('0x22')](_0x432910);}return null;};}function patchUpdates(_0x1af02f){return function(_0x39274a){try{jsonpatch[_0xd024('0x23')](_0x39274a,_0x1af02f,!![]);}catch(_0x3bc9a9){return BPromise['reject'](_0x3bc9a9);}return _0x39274a[_0xd024('0x24')]();};}function saveUpdates(_0x5616cb,_0x22d2ad){return function(_0x540d9e){if(_0x540d9e){return _0x540d9e[_0xd024('0x25')](_0x5616cb)[_0xd024('0x26')](function(_0x2c8592){return _0x2c8592;});}return null;};}function removeEntity(_0x42eb8f,_0x52108c){return function(_0x531f56){if(_0x531f56){return _0x531f56[_0xd024('0x27')]()[_0xd024('0x26')](function(){_0x42eb8f[_0xd024('0x1a')](0xcc)[_0xd024('0x1b')]();});}};}function handleEntityNotFound(_0x25dea9,_0x216cc4){return function(_0x7a13f9){if(!_0x7a13f9){_0x25dea9[_0xd024('0x19')](0x194);}return _0x7a13f9;};}function handleError(_0x259ded,_0x143b4f){_0x143b4f=_0x143b4f||0x1f4;return function(_0x4c6fc8){logger[_0xd024('0x28')](_0x4c6fc8[_0xd024('0x29')]);if(_0x4c6fc8[_0xd024('0x2a')]){delete _0x4c6fc8[_0xd024('0x2a')];}_0x259ded['status'](_0x143b4f)[_0xd024('0x2b')](_0x4c6fc8);};}exports['index']=function(_0x35b8b7,_0x1f26e5){var _0x56a746={},_0x4ebf91={},_0x1a7d09={'count':0x0,'rows':[]};var _0x25ecde=_[_0xd024('0x2c')](db[_0xd024('0x2d')][_0xd024('0x2e')],function(_0x430101){return{'name':_0x430101[_0xd024('0x2f')],'type':_0x430101[_0xd024('0x30')]['key']};});_0x4ebf91[_0xd024('0x31')]=_[_0xd024('0x32')](_[_0xd024('0x2c')](_0x25ecde,_0xd024('0x2a')),[_0xd024('0x33')]);_0x4ebf91[_0xd024('0x34')]=_[_0xd024('0x35')](_0x35b8b7['query']);_0x4ebf91[_0xd024('0x36')]=_[_0xd024('0x37')](_0x4ebf91[_0xd024('0x31')],_0x4ebf91[_0xd024('0x34')]);_0x56a746[_0xd024('0x38')]=_[_0xd024('0x37')](_0x4ebf91[_0xd024('0x31')],qs['fields'](_0x35b8b7['query'][_0xd024('0x39')]));_0x56a746['attributes']=_0x56a746['attributes'][_0xd024('0x3a')]?_0x56a746[_0xd024('0x38')]:_0x4ebf91['model'];if(!_0x35b8b7[_0xd024('0x34')][_0xd024('0x3b')](_0xd024('0x3c'))){_0x56a746[_0xd024('0x1f')]=qs[_0xd024('0x1f')](_0x35b8b7[_0xd024('0x34')][_0xd024('0x1f')]);_0x56a746[_0xd024('0x1c')]=qs[_0xd024('0x1c')](_0x35b8b7[_0xd024('0x34')]['offset']);}_0x56a746['order']=qs[_0xd024('0x3d')](_0x35b8b7['query'][_0xd024('0x3d')]);_0x56a746[_0xd024('0x3e')]=qs[_0xd024('0x36')](_[_0xd024('0x3f')](_0x35b8b7['query'],_0x4ebf91[_0xd024('0x36')]),_0x25ecde);if(_0x35b8b7['query'][_0xd024('0x40')]){_0x56a746[_0xd024('0x3e')]=_[_0xd024('0x41')](_0x56a746[_0xd024('0x3e')],{'$or':_[_0xd024('0x2c')](_0x25ecde,function(_0x460de9){if(_0x460de9[_0xd024('0x30')]!=='VIRTUAL'){var _0x447255={};_0x447255[_0x460de9[_0xd024('0x2a')]]={'$like':'%'+_0x35b8b7['query'][_0xd024('0x40')]+'%'};return _0x447255;}})});}_0x56a746=_[_0xd024('0x41')]({},_0x56a746,_0x35b8b7[_0xd024('0x42')]);var _0x2350f0={'where':_0x56a746[_0xd024('0x3e')]};return db[_0xd024('0x2d')][_0xd024('0x1e')](_0x2350f0)[_0xd024('0x26')](function(_0x148c79){_0x1a7d09[_0xd024('0x1e')]=_0x148c79;if(_0x35b8b7[_0xd024('0x34')][_0xd024('0x43')]){_0x56a746[_0xd024('0x44')]=[{'all':!![]}];}return db[_0xd024('0x2d')][_0xd024('0x45')](_0x56a746);})[_0xd024('0x26')](function(_0x5ddbbe){_0x1a7d09[_0xd024('0x46')]=_0x5ddbbe;return _0x1a7d09;})['then'](respondWithFilteredResult(_0x1f26e5,_0x56a746))['catch'](handleError(_0x1f26e5,null));};exports[_0xd024('0x47')]=function(_0x3d5ec5,_0x4fb8cc){var _0x4df760={'raw':![],'where':{'id':_0x3d5ec5[_0xd024('0x48')]['id']}},_0x20eb2d={};_0x20eb2d['model']=_[_0xd024('0x35')](db['VoiceRecording'][_0xd024('0x2e')]);_0x20eb2d['query']=_[_0xd024('0x35')](_0x3d5ec5[_0xd024('0x34')]);_0x20eb2d[_0xd024('0x36')]=_['intersection'](_0x20eb2d['model'],_0x20eb2d['query']);_0x4df760[_0xd024('0x38')]=_[_0xd024('0x37')](_0x20eb2d[_0xd024('0x31')],qs[_0xd024('0x39')](_0x3d5ec5[_0xd024('0x34')]['fields']));_0x4df760[_0xd024('0x38')]=_0x4df760['attributes'][_0xd024('0x3a')]?_0x4df760[_0xd024('0x38')]:_0x20eb2d[_0xd024('0x31')];if(_0x3d5ec5['query']['includeAll']){_0x4df760[_0xd024('0x44')]=[{'all':!![]}];}_0x4df760=_[_0xd024('0x41')]({},_0x4df760,_0x3d5ec5[_0xd024('0x42')]);return db[_0xd024('0x2d')]['find'](_0x4df760)[_0xd024('0x26')](handleEntityNotFound(_0x4fb8cc,null))[_0xd024('0x26')](respondWithResult(_0x4fb8cc,null))[_0xd024('0x49')](handleError(_0x4fb8cc,null));};exports['create']=function(_0xdd8494,_0x3f8f32){return db[_0xd024('0x2d')][_0xd024('0x4a')](_0xdd8494[_0xd024('0x4b')],{})['then'](respondWithResult(_0x3f8f32,0xc9))[_0xd024('0x49')](handleError(_0x3f8f32,null));};exports[_0xd024('0x25')]=function(_0x190726,_0x2df050){if(_0x190726[_0xd024('0x4b')]['id']){delete _0x190726[_0xd024('0x4b')]['id'];}return db[_0xd024('0x2d')][_0xd024('0x4c')]({'where':{'id':_0x190726[_0xd024('0x48')]['id']}})[_0xd024('0x26')](handleEntityNotFound(_0x2df050,null))[_0xd024('0x26')](saveUpdates(_0x190726[_0xd024('0x4b')],null))[_0xd024('0x26')](respondWithResult(_0x2df050,null))[_0xd024('0x49')](handleError(_0x2df050,null));};exports[_0xd024('0x4d')]=function(_0x114158,_0x4353c8){return db[_0xd024('0x2d')][_0xd024('0x4d')]()['then'](respondWithResult(_0x4353c8,null))[_0xd024('0x49')](handleError(_0x4353c8,null));};exports[_0xd024('0x4e')]=function(_0x405728,_0x3721b7,_0x3f4202){var _0x4e3031=require(_0xd024('0x4f'));var _0x333381=![];var _0x2e4757={};if(_0x405728[_0xd024('0x34')][_0xd024('0x30')]&&_0x405728[_0xd024('0x34')][_0xd024('0x30')]===_0xd024('0x50')){_0x2e4757['uniqueid']=_0x405728['params']['id'];}else{_0x2e4757['id']=_0x405728[_0xd024('0x48')]['id'];}return db[_0xd024('0x2d')][_0xd024('0x4c')]({'where':_0x2e4757,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x3721b7,null))[_0xd024('0x26')](function(_0x213c51){if(_0x213c51){var _0x5096d4=_0x213c51[_0xd024('0x51')];var _0x58bae8=util['format'](_0xd024('0x52'),_0x5096d4);if(fs[_0xd024('0x53')](_0x58bae8)){_0x333381=!![];return _0x4e3031[_0xd024('0x54')](_0x58bae8,_0x5096d4,config[_0xd024('0x55')][_0xd024('0x56')])['then'](function(){return _0x213c51;});}return _0x213c51;}})['then'](function(_0x3de7e0){if(_0x3de7e0){var _0x5aeceb=_0x3de7e0[_0xd024('0x51')];if(!fs[_0xd024('0x53')](_0x5aeceb)){throw new db['Sequelize'][(_0xd024('0x57'))](_0xd024('0x58'));}if(_0x3de7e0['filename']){return _0x3721b7[_0xd024('0x4e')](_0x5aeceb,_0x3de7e0[_0xd024('0x59')]+path[_0xd024('0x5a')](_0x5aeceb),function(){if(_0x333381){fs[_0xd024('0x5b')](_0x5aeceb);}});}else{return _0x3721b7[_0xd024('0x4e')](_0x5aeceb,function(_0x5d79d4){if(_0x333381){fs[_0xd024('0x5b')](_0x5aeceb);}});}}})['catch'](function(_0x47cbdb){if(_0x47cbdb[_0xd024('0x5c')]===_0xd024('0x58')){_0x3721b7[_0xd024('0x1a')](0x194)[_0xd024('0x2b')](_0xd024('0x5d'));}else{return handleError(_0x3721b7,null);}});};exports[_0xd024('0x5e')]=function(_0x369509,_0x5d1c5a,_0x2a2d86){var _0x398871=require(_0xd024('0x4f'));var _0x263837=![];var _0x212215={'$and':[db[_0xd024('0x5f')][_0xd024('0x3e')](db[_0xd024('0x5f')]['fn'](_0xd024('0x60'),db[_0xd024('0x5f')][_0xd024('0x61')](_0xd024('0x50'))),_0x369509[_0xd024('0x34')][_0xd024('0x62')])]};if(_0x369509['query'][_0xd024('0x30')]&&_0x369509[_0xd024('0x34')][_0xd024('0x30')]===_0xd024('0x50')){_0x212215[_0xd024('0x63')][_0xd024('0x64')]({'uniqueid':_0x369509[_0xd024('0x48')]['id']});}else{_0x212215['$and'][_0xd024('0x64')]({'id':_0x369509['params']['id']});}return db[_0xd024('0x2d')][_0xd024('0x4c')]({'where':_0x212215,'attributes':['id',_0xd024('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x5d1c5a,null))[_0xd024('0x26')](function(_0x44b87e){if(_0x44b87e){var _0xf2da14=util[_0xd024('0x33')]('%s.cypher',_0x44b87e['value']);if(fs[_0xd024('0x53')](_0xf2da14)){_0x263837=!![];return _0x398871['decryptFile'](_0xf2da14,_0x44b87e[_0xd024('0x51')],config[_0xd024('0x55')]['recording'])[_0xd024('0x26')](function(){return _0x44b87e;});}return _0x44b87e;}})['then'](function(_0x544cbb){if(_0x544cbb){if(!fs[_0xd024('0x53')](_0x544cbb['value'])){throw new db['Sequelize'][(_0xd024('0x57'))](_0xd024('0x58'));}if(_0x544cbb[_0xd024('0x59')]){return _0x5d1c5a[_0xd024('0x4e')](_0x544cbb[_0xd024('0x51')],_0x544cbb[_0xd024('0x59')]+path[_0xd024('0x5a')](_0x544cbb[_0xd024('0x51')]),function(){if(_0x263837){fs[_0xd024('0x5b')](_0x544cbb[_0xd024('0x51')]);}});}else{return _0x5d1c5a[_0xd024('0x4e')](_0x544cbb[_0xd024('0x51')],function(_0x4e06a5){if(_0x263837){fs[_0xd024('0x5b')](_0x544cbb[_0xd024('0x51')]);}});}}})[_0xd024('0x49')](handleError(_0x5d1c5a,null));};exports[_0xd024('0x27')]=function(_0x4a05d8,_0x3afc77){return db[_0xd024('0x2d')]['find']({'where':{'id':_0x4a05d8['params']['id']}})[_0xd024('0x26')](function(_0x2423d9){if(_['isNil'](_0x2423d9)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2423d9;})[_0xd024('0x26')](function(_0x5c7bcd){var _0x77d7cb=_0x5c7bcd['value'];logger[_0xd024('0x65')](_0xd024('0x66'),_0x77d7cb);if(!_[_0xd024('0x67')](_0x5c7bcd['value'])&&fs[_0xd024('0x53')](_0x77d7cb)){logger['info']('File:\x20\x22'+_0x77d7cb+_0xd024('0x68'));fs[_0xd024('0x69')](_0x77d7cb);}_0x77d7cb=_0x77d7cb+_0xd024('0x6a');if(!_[_0xd024('0x67')](_0x5c7bcd[_0xd024('0x51')])&&fs[_0xd024('0x53')](_0x77d7cb)){logger[_0xd024('0x65')](_0xd024('0x6b')+_0x77d7cb+_0xd024('0x68'));fs['unlinkSync'](_0x77d7cb);}return _0x5c7bcd;})['then'](function(_0x16ed09){if(!_0x16ed09)throw new InternalError();return _0x16ed09['destroy']();})[_0xd024('0x26')](function(){_0x3afc77[_0xd024('0x1a')](0xcc)['end']();})[_0xd024('0x49')](handleError(_0x3afc77,null));};function getBucketslist(_0x25870f,_0x528940,_0x3d3df1){return new Promise(function(_0x2137ed,_0x502ba0){var _0x225ca5=new AWS['S3']({'accessKeyId':_0x528940,'secretAccessKey':_0x25870f,'region':_0x3d3df1});_0x225ca5[_0xd024('0x6c')]({},function(_0x4ecd69,_0xe66ddd){if(_0x4ecd69){return _0x502ba0(_0x4ecd69);}else{return _0x2137ed(_0xe66ddd);}});});}function createBucket(_0x1c2e08,_0x407247,_0x2cf44,_0x5b3c04){return new Promise(function(_0x43edce,_0x5abadb){var _0x27eec5=new AWS['S3']({'accessKeyId':_0x407247,'secretAccessKey':_0x1c2e08,'region':_0x2cf44});_0x27eec5['createBucket']({'Bucket':_0x5b3c04},function(_0x232530,_0x338ba5){if(_0x232530){return _0x5abadb(_0x232530);}else{return _0x43edce(_0x338ba5);}});});}function uploadFile(_0x49c1e6,_0x38123e,_0x2f965d,_0x43475c,_0x26d1f5,_0x131434){return new Promise(function(_0x5a186f,_0x3ff525){var _0x5b14a2=new AWS['S3']({'accessKeyId':_0x38123e,'secretAccessKey':_0x49c1e6,'region':_0x2f965d});_0x5b14a2['upload']({'Bucket':_0x43475c,'Key':_0x26d1f5,'Body':_0x131434},function(_0x47673c,_0x45551b){if(_0x47673c){return _0x3ff525(_0x47673c);}else{return _0x5a186f(_0x45551b);}});});}function startTranscribe(_0x56b285,_0x6ab438,_0x5dc23b,_0xf5e220,_0x1e4db7,_0x53ffba){return new Promise(function(_0x3d6de7,_0x263a71){var _0x54fb77=new AWS[(_0xd024('0x6d'))]({'accessKeyId':_0x6ab438,'secretAccessKey':_0x56b285,'region':_0x5dc23b});_0x54fb77['startTranscriptionJob']({'TranscriptionJobName':_0xf5e220,'LanguageCode':_0x1e4db7,'Media':{'MediaFileUri':_0x53ffba}},function(_0x472196,_0x284e49){if(_0x472196){return _0x263a71(_0x472196);}else{return _0x3d6de7(_0x284e49);}});});}function transcribe(_0x4d1e14,_0x2f0247,_0x500b8c,_0x20713b,_0x1caedd,_0x42685c,_0x3789bc){return new Promise(function(_0x44e46e,_0x4b3e23){var _0x348f69={};logger['info'](util[_0xd024('0x33')](_0xd024('0x6e'),_0x4d1e14,_0x1caedd));return uploadFile(_0x2f0247,_0x500b8c,_0x20713b,_0x1caedd,path[_0xd024('0x6f')](_0x42685c),fs[_0xd024('0x70')](_0x42685c))['then'](function(_0x3a691a){logger['info'](util[_0xd024('0x33')](_0xd024('0x71'),_0x4d1e14,_0x1caedd,_0x3a691a[_0xd024('0x72')]));_0x348f69['bucket']=_0x3a691a[_0xd024('0x73')];_0x348f69['location']=_0x3a691a[_0xd024('0x72')];logger['info'](util[_0xd024('0x33')](_0xd024('0x74'),_0x4d1e14));return startTranscribe(_0x2f0247,_0x500b8c,_0x20713b,uuidv4(),_0x3789bc,_0x3a691a[_0xd024('0x72')]);})['then'](function(_0x27a810){logger[_0xd024('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x4d1e14,_0x27a810[_0xd024('0x75')][_0xd024('0x76')]));_0x348f69[_0xd024('0x77')]=_0x27a810[_0xd024('0x75')][_0xd024('0x76')];_0x348f69['transcribeStatus']=_0x27a810['TranscriptionJob'][_0xd024('0x78')];return _0x44e46e(_0x348f69);})[_0xd024('0x49')](function(_0x4ca6f6){return _0x4b3e23(_0x4ca6f6);});});}exports[_0xd024('0x79')]=function(_0x1fe2f9,_0x13c8c8,_0x1d3355){var _0x36a8d3;var _0xf60fa2;var _0x42ab18;var _0xfabdf=require(_0xd024('0x4f'));return db[_0xd024('0x2d')][_0xd024('0x7a')]({'where':{'id':_0x1fe2f9[_0xd024('0x48')]['id']}})[_0xd024('0x26')](function(_0x3e2bef){if(_0x3e2bef){var _0x26280e=util[_0xd024('0x33')](_0xd024('0x52'),_0x3e2bef[_0xd024('0x51')]);if(fs['existsSync'](_0x26280e)){cypher=!![];return _0xfabdf[_0xd024('0x54')](_0x26280e,_0x3e2bef[_0xd024('0x51')],config[_0xd024('0x55')][_0xd024('0x56')])[_0xd024('0x26')](function(){return _0x3e2bef;});}return _0x3e2bef;}})[_0xd024('0x26')](function(_0x5ed7e2){if(!_0x5ed7e2){throw new db[(_0xd024('0x7b'))][(_0xd024('0x57'))](_0xd024('0x7c'));}_0xf60fa2=_0x5ed7e2;return db['Setting'][_0xd024('0x7a')]({'where':{'id':0x1}});})[_0xd024('0x26')](handleEntityNotFound(_0x13c8c8,null))['then'](function(_0x4606df){if(_0x4606df){_0x36a8d3=_0x4606df;if(!_0x36a8d3[_0xd024('0x7d')]||!_0x36a8d3[_0xd024('0x7e')]||!_0x36a8d3[_0xd024('0x7f')]||!_0x36a8d3[_0xd024('0x80')]||!_0x36a8d3[_0xd024('0x81')]){throw new db[(_0xd024('0x7b'))][(_0xd024('0x57'))](_0xd024('0x82'));}if(_0x1fe2f9['body']['runSentiment']&&(!_0x36a8d3['sentiment']||!_0x36a8d3[_0xd024('0x83')]||!_0x36a8d3[_0xd024('0x84')]||!_0x36a8d3[_0xd024('0x80')]||!_0x36a8d3[_0xd024('0x81')])){throw new db[(_0xd024('0x7b'))][(_0xd024('0x57'))](_0xd024('0x85'));}return db[_0xd024('0x86')][_0xd024('0x7a')]({'where':{'id':_0x36a8d3[_0xd024('0x7e')]}});}})[_0xd024('0x26')](function(_0x5a2e58){if(!_0x5a2e58){throw new db[(_0xd024('0x7b'))]['ValidationError'](_0xd024('0x87'));}if(!_0x5a2e58[_0xd024('0x88')]||!_0x5a2e58[_0xd024('0x89')]){throw new db[(_0xd024('0x7b'))][(_0xd024('0x57'))](_0xd024('0x8a'));}_0x42ab18=_0x5a2e58;return getBucketslist(_0x42ab18[_0xd024('0x88')],_0x42ab18[_0xd024('0x89')],_0x36a8d3[_0xd024('0x7f')]);})['then'](function(_0x1411da){if(_0x1411da&&_0x1411da['Buckets']){var _0x321d4f=_['find'](_0x1411da[_0xd024('0x8b')],function(_0x509e52){return _0x509e52[_0xd024('0x8c')]===_0x36a8d3[_0xd024('0x81')];});if(!_0x321d4f){logger[_0xd024('0x65')](util[_0xd024('0x33')](_0xd024('0x8d'),_0x1fe2f9['params']['id'],_0x36a8d3[_0xd024('0x81')]));return createBucket(_0x42ab18['data1'],_0x42ab18[_0xd024('0x89')],_0x36a8d3[_0xd024('0x7f')],_0x36a8d3[_0xd024('0x81')]);}logger['info'](util[_0xd024('0x33')](_0xd024('0x8e'),_0x1fe2f9[_0xd024('0x48')]['id'],_0x36a8d3[_0xd024('0x81')]));return;}})[_0xd024('0x26')](function(_0x23372b){if(_0xf60fa2[_0xd024('0x8f')]===_0xd024('0x90')){return transcribe(_0x1fe2f9[_0xd024('0x48')]['id'],_0x42ab18[_0xd024('0x88')],_0x42ab18['data2'],_0x36a8d3[_0xd024('0x7f')],_0x36a8d3['bucket'],_0xf60fa2[_0xd024('0x51')],_0x36a8d3[_0xd024('0x80')]);}else{logger['info'](util[_0xd024('0x33')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x1fe2f9[_0xd024('0x48')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xd024('0x26')](function(_0x4f2e0){if(_0x4f2e0){_0x4f2e0[_0xd024('0x91')]=_0x1fe2f9['body']['runSentiment'];return _0xf60fa2['updateAttributes'](_0x4f2e0);}})[_0xd024('0x26')](respondWithResult(_0x13c8c8,null))[_0xd024('0x49')](handleError(_0x13c8c8,null));};function writeFile(_0x4f331f,_0x54a722){return new Promise(function(_0x3d618f,_0x551ed1){fs[_0xd024('0x92')](_0x54a722,_0x4f331f,function(_0xd68378,_0x2cf66f){if(_0xd68378){return _0x551ed1(_0xd68378);}else{return _0x3d618f(_0x2cf66f);}});});}exports[_0xd024('0x93')]=function(_0x313a42,_0x175355,_0x1f38cd){return db[_0xd024('0x2d')][_0xd024('0x7a')]({'where':{'id':_0x313a42[_0xd024('0x48')]['id']}})['then'](handleEntityNotFound(_0x175355))[_0xd024('0x26')](function(_0x4aa98d){if(_0x4aa98d&&_0x4aa98d[_0xd024('0x94')]){var _0x2fdb5a=_0x4aa98d[_0xd024('0x94')];var _0x5ad5c0=config[_0xd024('0x95')]+'/server/files/transcribes/transcribe_'+_0x4aa98d['id']+_0xd024('0x96');if(fs['existsSync'](_0x5ad5c0)){return _0x5ad5c0;}return writeFile(_0x2fdb5a,_0x5ad5c0)[_0xd024('0x26')](function(){return _0x5ad5c0;});}else{throw new db[(_0xd024('0x7b'))]['ValidationError'](_0xd024('0x97'));}})[_0xd024('0x26')](function(_0x3e2024){return _0x175355['download'](_0x3e2024);})[_0xd024('0x49')](handleError(_0x175355));}; \ No newline at end of file +var _0x3604=['token','$and','push','recording','Sequelize','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','uuid/v4','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','update','then','destroy','end','error','stack','name','send','index','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','show','params','options','catch','create','body','describe','download','../../components/encryptor','uniqueid','find','value','format','%s.cypher','existsSync','decryptFile','secrets','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col'];(function(_0xcc6ce4,_0x2979cf){var _0x29566e=function(_0x4811bd){while(--_0x4811bd){_0xcc6ce4['push'](_0xcc6ce4['shift']());}};_0x29566e(++_0x2979cf);}(_0x3604,0xd0));var _0x4360=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x3604[_0x4fc9e6];return _0x551d28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4360('0x0'));var zipdir=require(_0x4360('0x1'));var jsonpatch=require(_0x4360('0x2'));var rp=require(_0x4360('0x3'));var moment=require(_0x4360('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4360('0x5'));var util=require('util');var path=require('path');var sox=require(_0x4360('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4360('0x7'));var _=require('lodash');var squel=require(_0x4360('0x8'));var crypto=require(_0x4360('0x9'));var jsforce=require(_0x4360('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4360('0xb'));var querystring=require(_0x4360('0xc'));var Papa=require(_0x4360('0xd'));var AWS=require('aws-sdk');var uuidv4=require(_0x4360('0xe'));var Redis=require(_0x4360('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4360('0x10'));var hardwareService=require(_0x4360('0x11'));var logger=require(_0x4360('0x12'))(_0x4360('0x13'));var utils=require('../../config/utils');var config=require(_0x4360('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4360('0x15'))['db'];function respondWithStatusCode(_0x52b8db,_0x254c66){_0x254c66=_0x254c66||0xcc;return function(_0x17e772){if(_0x17e772){return _0x52b8db[_0x4360('0x16')](_0x254c66);}return _0x52b8db[_0x4360('0x17')](_0x254c66)['end']();};}function respondWithResult(_0x5cc0ff,_0x4bbe25){_0x4bbe25=_0x4bbe25||0xc8;return function(_0x1349e2){if(_0x1349e2){return _0x5cc0ff['status'](_0x4bbe25)[_0x4360('0x18')](_0x1349e2);}};}function respondWithFilteredResult(_0x4067e5,_0x261a37){return function(_0x3c249d){if(_0x3c249d){var _0x586884=typeof _0x261a37[_0x4360('0x19')]===_0x4360('0x1a')&&typeof _0x261a37[_0x4360('0x1b')]===_0x4360('0x1a');var _0x1a60d6=_0x3c249d['count'];var _0x39bb0f=_0x586884?0x0:_0x261a37[_0x4360('0x19')];var _0x550746=_0x586884?_0x3c249d[_0x4360('0x1c')]:_0x261a37[_0x4360('0x19')]+_0x261a37[_0x4360('0x1b')];var _0x484132;if(_0x550746>=_0x1a60d6){_0x550746=_0x1a60d6;_0x484132=0xc8;}else{_0x484132=0xce;}_0x4067e5[_0x4360('0x17')](_0x484132);return _0x4067e5[_0x4360('0x1d')]('Content-Range',_0x39bb0f+'-'+_0x550746+'/'+_0x1a60d6)[_0x4360('0x18')](_0x3c249d);}return null;};}function patchUpdates(_0x1e8215){return function(_0x2d8655){try{jsonpatch['apply'](_0x2d8655,_0x1e8215,!![]);}catch(_0x57b60e){return BPromise['reject'](_0x57b60e);}return _0x2d8655['save']();};}function saveUpdates(_0x4e5330,_0x555d64){return function(_0x2a4623){if(_0x2a4623){return _0x2a4623[_0x4360('0x1e')](_0x4e5330)[_0x4360('0x1f')](function(_0x2a9b3b){return _0x2a9b3b;});}return null;};}function removeEntity(_0x2054aa,_0x15f54d){return function(_0x2eb928){if(_0x2eb928){return _0x2eb928[_0x4360('0x20')]()[_0x4360('0x1f')](function(){_0x2054aa[_0x4360('0x17')](0xcc)[_0x4360('0x21')]();});}};}function handleEntityNotFound(_0x2886fb,_0xa0c088){return function(_0x263967){if(!_0x263967){_0x2886fb[_0x4360('0x16')](0x194);}return _0x263967;};}function handleError(_0x7b77d4,_0x354671){_0x354671=_0x354671||0x1f4;return function(_0x3738f6){logger[_0x4360('0x22')](_0x3738f6[_0x4360('0x23')]);if(_0x3738f6[_0x4360('0x24')]){delete _0x3738f6['name'];}_0x7b77d4[_0x4360('0x17')](_0x354671)[_0x4360('0x25')](_0x3738f6);};}exports[_0x4360('0x26')]=function(_0x27a002,_0x25491b){var _0x46ee43={},_0x2ea2d6={},_0x9f37bc={'count':0x0,'rows':[]};var _0x159a2b=_['map'](db[_0x4360('0x27')][_0x4360('0x28')],function(_0x1b6eb4){return{'name':_0x1b6eb4[_0x4360('0x29')],'type':_0x1b6eb4[_0x4360('0x2a')][_0x4360('0x2b')]};});_0x2ea2d6[_0x4360('0x2c')]=_[_0x4360('0x2d')](_[_0x4360('0x2e')](_0x159a2b,'name'),['format']);_0x2ea2d6['query']=_[_0x4360('0x2f')](_0x27a002[_0x4360('0x30')]);_0x2ea2d6[_0x4360('0x31')]=_[_0x4360('0x32')](_0x2ea2d6[_0x4360('0x2c')],_0x2ea2d6[_0x4360('0x30')]);_0x46ee43[_0x4360('0x33')]=_['intersection'](_0x2ea2d6[_0x4360('0x2c')],qs[_0x4360('0x34')](_0x27a002['query'][_0x4360('0x34')]));_0x46ee43[_0x4360('0x33')]=_0x46ee43[_0x4360('0x33')][_0x4360('0x35')]?_0x46ee43[_0x4360('0x33')]:_0x2ea2d6['model'];if(!_0x27a002[_0x4360('0x30')][_0x4360('0x36')](_0x4360('0x37'))){_0x46ee43[_0x4360('0x1b')]=qs['limit'](_0x27a002['query']['limit']);_0x46ee43[_0x4360('0x19')]=qs['offset'](_0x27a002[_0x4360('0x30')][_0x4360('0x19')]);}_0x46ee43[_0x4360('0x38')]=qs[_0x4360('0x39')](_0x27a002['query'][_0x4360('0x39')]);_0x46ee43[_0x4360('0x3a')]=qs['filters'](_[_0x4360('0x3b')](_0x27a002[_0x4360('0x30')],_0x2ea2d6[_0x4360('0x31')]),_0x159a2b);if(_0x27a002[_0x4360('0x30')]['filter']){_0x46ee43[_0x4360('0x3a')]=_[_0x4360('0x3c')](_0x46ee43['where'],{'$or':_['map'](_0x159a2b,function(_0x4e62ff){if(_0x4e62ff[_0x4360('0x2a')]!==_0x4360('0x3d')){var _0x47228b={};_0x47228b[_0x4e62ff[_0x4360('0x24')]]={'$like':'%'+_0x27a002[_0x4360('0x30')][_0x4360('0x3e')]+'%'};return _0x47228b;}})});}_0x46ee43=_[_0x4360('0x3c')]({},_0x46ee43,_0x27a002['options']);var _0x2a38de={'where':_0x46ee43['where']};return db[_0x4360('0x27')][_0x4360('0x1c')](_0x2a38de)['then'](function(_0x36bac9){_0x9f37bc['count']=_0x36bac9;if(_0x27a002['query'][_0x4360('0x3f')]){_0x46ee43[_0x4360('0x40')]=[{'all':!![]}];}return db[_0x4360('0x27')][_0x4360('0x41')](_0x46ee43);})[_0x4360('0x1f')](function(_0x51e9bc){_0x9f37bc['rows']=_0x51e9bc;return _0x9f37bc;})[_0x4360('0x1f')](respondWithFilteredResult(_0x25491b,_0x46ee43))['catch'](handleError(_0x25491b,null));};exports[_0x4360('0x42')]=function(_0x522c28,_0x297fc9){var _0x2ef717={'raw':![],'where':{'id':_0x522c28[_0x4360('0x43')]['id']}},_0x1cdb84={};_0x1cdb84[_0x4360('0x2c')]=_[_0x4360('0x2f')](db[_0x4360('0x27')][_0x4360('0x28')]);_0x1cdb84[_0x4360('0x30')]=_[_0x4360('0x2f')](_0x522c28['query']);_0x1cdb84['filters']=_[_0x4360('0x32')](_0x1cdb84['model'],_0x1cdb84['query']);_0x2ef717[_0x4360('0x33')]=_[_0x4360('0x32')](_0x1cdb84['model'],qs[_0x4360('0x34')](_0x522c28[_0x4360('0x30')][_0x4360('0x34')]));_0x2ef717[_0x4360('0x33')]=_0x2ef717[_0x4360('0x33')]['length']?_0x2ef717[_0x4360('0x33')]:_0x1cdb84['model'];if(_0x522c28[_0x4360('0x30')][_0x4360('0x3f')]){_0x2ef717['include']=[{'all':!![]}];}_0x2ef717=_[_0x4360('0x3c')]({},_0x2ef717,_0x522c28[_0x4360('0x44')]);return db['VoiceRecording']['find'](_0x2ef717)[_0x4360('0x1f')](handleEntityNotFound(_0x297fc9,null))[_0x4360('0x1f')](respondWithResult(_0x297fc9,null))[_0x4360('0x45')](handleError(_0x297fc9,null));};exports[_0x4360('0x46')]=function(_0x342f41,_0x2eb000){return db[_0x4360('0x27')]['create'](_0x342f41[_0x4360('0x47')],{})[_0x4360('0x1f')](respondWithResult(_0x2eb000,0xc9))[_0x4360('0x45')](handleError(_0x2eb000,null));};exports[_0x4360('0x1e')]=function(_0x1e3047,_0x13a958){if(_0x1e3047['body']['id']){delete _0x1e3047[_0x4360('0x47')]['id'];}return db[_0x4360('0x27')]['find']({'where':{'id':_0x1e3047[_0x4360('0x43')]['id']}})[_0x4360('0x1f')](handleEntityNotFound(_0x13a958,null))['then'](saveUpdates(_0x1e3047[_0x4360('0x47')],null))[_0x4360('0x1f')](respondWithResult(_0x13a958,null))[_0x4360('0x45')](handleError(_0x13a958,null));};exports[_0x4360('0x48')]=function(_0x343db,_0x4b975e){return db['VoiceRecording'][_0x4360('0x48')]()[_0x4360('0x1f')](respondWithResult(_0x4b975e,null))[_0x4360('0x45')](handleError(_0x4b975e,null));};exports[_0x4360('0x49')]=function(_0x11434a,_0x28b4f6,_0x5ba94b){var _0x24143c=require(_0x4360('0x4a'));var _0x415771=![];var _0x549c07={};if(_0x11434a['query'][_0x4360('0x2a')]&&_0x11434a[_0x4360('0x30')][_0x4360('0x2a')]===_0x4360('0x4b')){_0x549c07['uniqueid']=_0x11434a[_0x4360('0x43')]['id'];}else{_0x549c07['id']=_0x11434a[_0x4360('0x43')]['id'];}return db[_0x4360('0x27')][_0x4360('0x4c')]({'where':_0x549c07,'attributes':['id',_0x4360('0x4d')],'raw':!![]})[_0x4360('0x1f')](handleEntityNotFound(_0x28b4f6,null))[_0x4360('0x1f')](function(_0x2ca697){if(_0x2ca697){var _0x4157ea=_0x2ca697[_0x4360('0x4d')];var _0x5479a0=util[_0x4360('0x4e')](_0x4360('0x4f'),_0x4157ea);if(fs[_0x4360('0x50')](_0x5479a0)){_0x415771=!![];return _0x24143c[_0x4360('0x51')](_0x5479a0,_0x4157ea,config[_0x4360('0x52')]['recording'])[_0x4360('0x1f')](function(){return _0x2ca697;});}return _0x2ca697;}})[_0x4360('0x1f')](function(_0x21ab8b){if(_0x21ab8b){var _0x574e17=_0x21ab8b[_0x4360('0x4d')];if(!fs['existsSync'](_0x574e17)){throw new db['Sequelize'][(_0x4360('0x53'))](_0x4360('0x54'));}if(_0x21ab8b[_0x4360('0x55')]){return _0x28b4f6[_0x4360('0x49')](_0x574e17,_0x21ab8b[_0x4360('0x55')]+path[_0x4360('0x56')](_0x574e17),function(){if(_0x415771){fs[_0x4360('0x57')](_0x574e17);}});}else{return _0x28b4f6[_0x4360('0x49')](_0x574e17,function(_0xcbcd28){if(_0x415771){fs['unlink'](_0x574e17);}});}}})[_0x4360('0x45')](function(_0x24793c){if(_0x24793c[_0x4360('0x58')]===_0x4360('0x54')){_0x28b4f6[_0x4360('0x17')](0x194)[_0x4360('0x25')](_0x4360('0x59'));}else{return handleError(_0x28b4f6,null);}});};exports[_0x4360('0x5a')]=function(_0xc2ca02,_0x33364f,_0x491a8c){var _0x362854=require(_0x4360('0x4a'));var _0x2f30b1=![];var _0x381f2c={'$and':[db['sequelize'][_0x4360('0x3a')](db[_0x4360('0x5b')]['fn'](_0x4360('0x5c'),db[_0x4360('0x5b')][_0x4360('0x5d')](_0x4360('0x4b'))),_0xc2ca02[_0x4360('0x30')][_0x4360('0x5e')])]};if(_0xc2ca02[_0x4360('0x30')][_0x4360('0x2a')]&&_0xc2ca02[_0x4360('0x30')]['type']===_0x4360('0x4b')){_0x381f2c[_0x4360('0x5f')][_0x4360('0x60')]({'uniqueid':_0xc2ca02['params']['id']});}else{_0x381f2c['$and']['push']({'id':_0xc2ca02[_0x4360('0x43')]['id']});}return db['VoiceRecording']['find']({'where':_0x381f2c,'attributes':['id',_0x4360('0x4d')],'raw':!![]})[_0x4360('0x1f')](handleEntityNotFound(_0x33364f,null))[_0x4360('0x1f')](function(_0x58a338){if(_0x58a338){var _0x219481=util['format'](_0x4360('0x4f'),_0x58a338['value']);if(fs[_0x4360('0x50')](_0x219481)){_0x2f30b1=!![];return _0x362854['decryptFile'](_0x219481,_0x58a338['value'],config['secrets'][_0x4360('0x61')])[_0x4360('0x1f')](function(){return _0x58a338;});}return _0x58a338;}})[_0x4360('0x1f')](function(_0xf77b47){if(_0xf77b47){if(!fs[_0x4360('0x50')](_0xf77b47['value'])){throw new db[(_0x4360('0x62'))][(_0x4360('0x53'))](_0x4360('0x54'));}if(_0xf77b47['filename']){return _0x33364f[_0x4360('0x49')](_0xf77b47[_0x4360('0x4d')],_0xf77b47['filename']+path['extname'](_0xf77b47['value']),function(){if(_0x2f30b1){fs['unlink'](_0xf77b47[_0x4360('0x4d')]);}});}else{return _0x33364f[_0x4360('0x49')](_0xf77b47[_0x4360('0x4d')],function(_0x47afb9){if(_0x2f30b1){fs[_0x4360('0x57')](_0xf77b47[_0x4360('0x4d')]);}});}}})[_0x4360('0x45')](handleError(_0x33364f,null));};exports[_0x4360('0x20')]=function(_0x2fab9c,_0x3a831a){return db[_0x4360('0x27')][_0x4360('0x4c')]({'where':{'id':_0x2fab9c['params']['id']}})[_0x4360('0x1f')](function(_0x30a1da){if(_[_0x4360('0x63')](_0x30a1da)){throw new ReferenceError('Entity\x20not\x20found');}return _0x30a1da;})[_0x4360('0x1f')](function(_0x17f198){var _0x5cd0a1=_0x17f198[_0x4360('0x4d')];logger[_0x4360('0x64')](_0x4360('0x65'),_0x5cd0a1);if(!_[_0x4360('0x63')](_0x17f198[_0x4360('0x4d')])&&fs[_0x4360('0x50')](_0x5cd0a1)){logger[_0x4360('0x64')](_0x4360('0x66')+_0x5cd0a1+_0x4360('0x67'));fs[_0x4360('0x68')](_0x5cd0a1);}_0x5cd0a1=_0x5cd0a1+'.cypher';if(!_[_0x4360('0x63')](_0x17f198[_0x4360('0x4d')])&&fs['existsSync'](_0x5cd0a1)){logger['info'](_0x4360('0x66')+_0x5cd0a1+_0x4360('0x67'));fs['unlinkSync'](_0x5cd0a1);}return _0x17f198;})['then'](function(_0x3df377){if(!_0x3df377)throw new InternalError();return _0x3df377['destroy']();})[_0x4360('0x1f')](function(){_0x3a831a[_0x4360('0x17')](0xcc)[_0x4360('0x21')]();})[_0x4360('0x45')](handleError(_0x3a831a,null));};function getBucketslist(_0xa1e874,_0x273de9,_0x159925){return new Promise(function(_0xcdea77,_0x41a35a){var _0x8819b9=new AWS['S3']({'accessKeyId':_0x273de9,'secretAccessKey':_0xa1e874,'region':_0x159925});_0x8819b9[_0x4360('0x69')]({},function(_0x2b3f6e,_0x5e1a97){if(_0x2b3f6e){return _0x41a35a(_0x2b3f6e);}else{return _0xcdea77(_0x5e1a97);}});});}function createBucket(_0x4a4bda,_0x17d08a,_0x5a359c,_0x39f6b1){return new Promise(function(_0x165460,_0x4530f8){var _0xcab732=new AWS['S3']({'accessKeyId':_0x17d08a,'secretAccessKey':_0x4a4bda,'region':_0x5a359c});_0xcab732[_0x4360('0x6a')]({'Bucket':_0x39f6b1},function(_0x2eed6d,_0x2d717c){if(_0x2eed6d){return _0x4530f8(_0x2eed6d);}else{return _0x165460(_0x2d717c);}});});}function uploadFile(_0xf81387,_0xa6bbb8,_0x246d91,_0x2bb71a,_0x79c36a,_0x691219){return new Promise(function(_0x4d51eb,_0x1c954e){var _0x445776=new AWS['S3']({'accessKeyId':_0xa6bbb8,'secretAccessKey':_0xf81387,'region':_0x246d91});_0x445776['upload']({'Bucket':_0x2bb71a,'Key':_0x79c36a,'Body':_0x691219},function(_0x11d311,_0xcf3e0e){if(_0x11d311){return _0x1c954e(_0x11d311);}else{return _0x4d51eb(_0xcf3e0e);}});});}function startTranscribe(_0x2aec53,_0x36dbea,_0x179ff9,_0x5d262c,_0x225bca,_0x127e4b){return new Promise(function(_0x46bfae,_0x532f85){var _0x144617=new AWS['TranscribeService']({'accessKeyId':_0x36dbea,'secretAccessKey':_0x2aec53,'region':_0x179ff9});_0x144617[_0x4360('0x6b')]({'TranscriptionJobName':_0x5d262c,'LanguageCode':_0x225bca,'Media':{'MediaFileUri':_0x127e4b}},function(_0x27e2f6,_0x3db4bb){if(_0x27e2f6){return _0x532f85(_0x27e2f6);}else{return _0x46bfae(_0x3db4bb);}});});}function transcribe(_0x6b6720,_0xe71a6b,_0x3469ff,_0x1e12cd,_0x4fe104,_0x2b9d63,_0x26ef9c){return new Promise(function(_0x5b7785,_0x1e6129){var _0x20563d={};logger['info'](util[_0x4360('0x4e')](_0x4360('0x6c'),_0x6b6720,_0x4fe104));return uploadFile(_0xe71a6b,_0x3469ff,_0x1e12cd,_0x4fe104,path[_0x4360('0x6d')](_0x2b9d63),fs['readFileSync'](_0x2b9d63))[_0x4360('0x1f')](function(_0x56c56c){logger['info'](util[_0x4360('0x4e')](_0x4360('0x6e'),_0x6b6720,_0x4fe104,_0x56c56c[_0x4360('0x6f')]));_0x20563d[_0x4360('0x70')]=_0x56c56c[_0x4360('0x71')];_0x20563d[_0x4360('0x72')]=_0x56c56c['Location'];logger[_0x4360('0x64')](util[_0x4360('0x4e')](_0x4360('0x73'),_0x6b6720));return startTranscribe(_0xe71a6b,_0x3469ff,_0x1e12cd,uuidv4(),_0x26ef9c,_0x56c56c['Location']);})[_0x4360('0x1f')](function(_0x29a025){logger[_0x4360('0x64')](util['format'](_0x4360('0x74'),_0x6b6720,_0x29a025[_0x4360('0x75')]['TranscriptionJobName']));_0x20563d[_0x4360('0x76')]=_0x29a025['TranscriptionJob'][_0x4360('0x77')];_0x20563d['transcribeStatus']=_0x29a025[_0x4360('0x75')][_0x4360('0x78')];return _0x5b7785(_0x20563d);})[_0x4360('0x45')](function(_0x217a84){return _0x1e6129(_0x217a84);});});}exports[_0x4360('0x79')]=function(_0x5801aa,_0x5168dc,_0x178f87){var _0x5100ec;var _0x5aeb5f;var _0x35791a;var _0x1664ce=require(_0x4360('0x4a'));return db[_0x4360('0x27')][_0x4360('0x7a')]({'where':{'id':_0x5801aa['params']['id']}})[_0x4360('0x1f')](function(_0xf40b30){if(_0xf40b30){var _0x91e14a=util[_0x4360('0x4e')]('%s.cypher',_0xf40b30[_0x4360('0x4d')]);if(fs[_0x4360('0x50')](_0x91e14a)){cypher=!![];return _0x1664ce[_0x4360('0x51')](_0x91e14a,_0xf40b30['value'],config['secrets'][_0x4360('0x61')])[_0x4360('0x1f')](function(){return _0xf40b30;});}return _0xf40b30;}})['then'](function(_0x179fcb){if(!_0x179fcb){throw new db[(_0x4360('0x62'))]['ValidationError'](_0x4360('0x7b'));}_0x5aeb5f=_0x179fcb;return db['Setting'][_0x4360('0x7a')]({'where':{'id':0x1}});})[_0x4360('0x1f')](handleEntityNotFound(_0x5168dc,null))[_0x4360('0x1f')](function(_0x5e6370){if(_0x5e6370){_0x5100ec=_0x5e6370;if(!_0x5100ec[_0x4360('0x7c')]||!_0x5100ec[_0x4360('0x7d')]||!_0x5100ec[_0x4360('0x7e')]||!_0x5100ec[_0x4360('0x7f')]||!_0x5100ec[_0x4360('0x70')]){throw new db['Sequelize'][(_0x4360('0x53'))](_0x4360('0x80'));}if(_0x5801aa[_0x4360('0x47')][_0x4360('0x81')]&&(!_0x5100ec['sentiment']||!_0x5100ec['sentimentAccountId']||!_0x5100ec[_0x4360('0x82')]||!_0x5100ec['language']||!_0x5100ec[_0x4360('0x70')])){throw new db[(_0x4360('0x62'))][(_0x4360('0x53'))](_0x4360('0x83'));}return db[_0x4360('0x84')][_0x4360('0x7a')]({'where':{'id':_0x5100ec[_0x4360('0x7d')]}});}})[_0x4360('0x1f')](function(_0x2ac442){if(!_0x2ac442){throw new db[(_0x4360('0x62'))][(_0x4360('0x53'))](_0x4360('0x85'));}if(!_0x2ac442[_0x4360('0x86')]||!_0x2ac442[_0x4360('0x87')]){throw new db[(_0x4360('0x62'))][(_0x4360('0x53'))]('Cloud\x20Provider\x20not\x20configured');}_0x35791a=_0x2ac442;return getBucketslist(_0x35791a['data1'],_0x35791a[_0x4360('0x87')],_0x5100ec[_0x4360('0x7e')]);})['then'](function(_0x4aea94){if(_0x4aea94&&_0x4aea94[_0x4360('0x88')]){var _0x547aac=_[_0x4360('0x4c')](_0x4aea94['Buckets'],function(_0x264c22){return _0x264c22['Name']===_0x5100ec[_0x4360('0x70')];});if(!_0x547aac){logger[_0x4360('0x64')](util[_0x4360('0x4e')](_0x4360('0x89'),_0x5801aa[_0x4360('0x43')]['id'],_0x5100ec[_0x4360('0x70')]));return createBucket(_0x35791a['data1'],_0x35791a[_0x4360('0x87')],_0x5100ec[_0x4360('0x7e')],_0x5100ec[_0x4360('0x70')]);}logger[_0x4360('0x64')](util[_0x4360('0x4e')](_0x4360('0x8a'),_0x5801aa[_0x4360('0x43')]['id'],_0x5100ec[_0x4360('0x70')]));return;}})[_0x4360('0x1f')](function(_0x56f3d0){if(_0x5aeb5f[_0x4360('0x8b')]===_0x4360('0x8c')){return transcribe(_0x5801aa[_0x4360('0x43')]['id'],_0x35791a[_0x4360('0x86')],_0x35791a[_0x4360('0x87')],_0x5100ec[_0x4360('0x7e')],_0x5100ec[_0x4360('0x70')],_0x5aeb5f[_0x4360('0x4d')],_0x5100ec[_0x4360('0x7f')]);}else{logger[_0x4360('0x64')](util['format'](_0x4360('0x8d'),_0x5801aa[_0x4360('0x43')]['id']));return{'transcribeStatus':_0x4360('0x8e')};}})[_0x4360('0x1f')](function(_0xf32a96){if(_0xf32a96){_0xf32a96['tempSentiment']=_0x5801aa[_0x4360('0x47')]['runSentiment'];return _0x5aeb5f[_0x4360('0x8f')](_0xf32a96);}})[_0x4360('0x1f')](respondWithResult(_0x5168dc,null))[_0x4360('0x45')](handleError(_0x5168dc,null));};function writeFile(_0x4d8f0b,_0x1d8255){return new Promise(function(_0x2dfe49,_0x92e730){fs[_0x4360('0x90')](_0x1d8255,_0x4d8f0b,function(_0x4fa2b6,_0x547163){if(_0x4fa2b6){return _0x92e730(_0x4fa2b6);}else{return _0x2dfe49(_0x547163);}});});}exports[_0x4360('0x91')]=function(_0x4e2707,_0x26c5c5,_0x2dfb4f){return db[_0x4360('0x27')]['findOne']({'where':{'id':_0x4e2707['params']['id']}})['then'](handleEntityNotFound(_0x26c5c5))[_0x4360('0x1f')](function(_0x9662cc){if(_0x9662cc&&_0x9662cc[_0x4360('0x92')]){var _0x548f1a=_0x9662cc['fileText'];var _0x5470aa=config[_0x4360('0x93')]+_0x4360('0x94')+_0x9662cc['id']+_0x4360('0x95');if(fs['existsSync'](_0x5470aa)){return _0x5470aa;}return writeFile(_0x548f1a,_0x5470aa)[_0x4360('0x1f')](function(){return _0x5470aa;});}else{throw new db[(_0x4360('0x62'))]['ValidationError'](_0x4360('0x96'));}})[_0x4360('0x1f')](function(_0x18064f){return _0x26c5c5[_0x4360('0x49')](_0x18064f);})[_0x4360('0x45')](handleError(_0x26c5c5));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 3d7d937..1673eb5 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 _0xadb5=['exports','define','VoiceRecording','voice_recordings','uniqueid','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x117c70,_0x241a36){var _0x3a5b78=function(_0x58bde6){while(--_0x58bde6){_0x117c70['push'](_0x117c70['shift']());}};_0x3a5b78(++_0x241a36);}(_0xadb5,0xad));var _0x5adb=function(_0x222b21,_0x5f1271){_0x222b21=_0x222b21-0x0;var _0x4f5146=_0xadb5[_0x222b21];return _0x4f5146;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./voiceRecording.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[{'name':_0x5adb('0xb'),'fields':[_0x5adb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d90=['../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x7d90,0x1ab));var _0x07d9=function(_0x5ce014,_0x46ce62){_0x5ce014=_0x5ce014-0x0;var _0x27ae4d=_0x7d90[_0x5ce014];return _0x27ae4d;};'use strict';var _=require(_0x07d9('0x0'));var util=require(_0x07d9('0x1'));var logger=require(_0x07d9('0x2'))('api');var moment=require(_0x07d9('0x3'));var BPromise=require(_0x07d9('0x4'));var rp=require(_0x07d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07d9('0x6'));var config=require(_0x07d9('0x7'));var attributes=require(_0x07d9('0x8'));module[_0x07d9('0x9')]=function(_0x10651e,_0x1ae9ac){return _0x10651e[_0x07d9('0xa')](_0x07d9('0xb'),attributes,{'tableName':_0x07d9('0xc'),'paranoid':![],'indexes':[{'name':_0x07d9('0xd'),'fields':[_0x07d9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 2b66d82..7970218 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 _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','where','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','format','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x14da3e,_0x245176){var _0x4a5348=function(_0x2c7766){while(--_0x2c7766){_0x14da3e['push'](_0x14da3e['shift']());}};_0x4a5348(++_0x245176);}(_0x1623,0xab));var _0x3162=function(_0x20ddd7,_0x341d12){_0x20ddd7=_0x20ddd7-0x0;var _0x44b5ac=_0x1623[_0x20ddd7];return _0x44b5ac;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('VoiceRecording,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});}exports[_0x3162('0x16')]=function(_0x1eed46){var _0x391d97=this;return new Promise(function(_0x4b2bf3,_0x42f283){return db[_0x3162('0x17')][_0x3162('0x18')](_0x1eed46[_0x3162('0x19')],{'raw':_0x1eed46['options']?_0x1eed46[_0x3162('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eed46['options']?_0x1eed46[_0x3162('0x1a')][_0x3162('0x1b')]||null:null,'attributes':_0x1eed46[_0x3162('0x1a')]?_0x1eed46['options']['attributes']||null:null,'limit':_0x1eed46[_0x3162('0x1a')]?_0x1eed46[_0x3162('0x1a')][_0x3162('0x1c')]||null:null})[_0x3162('0xa')](function(_0x31b27b){logger[_0x3162('0xb')](_0x3162('0x16'),_0x1eed46);logger[_0x3162('0xc')]('UpdateVoiceRecording',_0x1eed46,JSON[_0x3162('0xf')](_0x31b27b));_0x4b2bf3(_0x31b27b);})[_0x3162('0x15')](function(_0x3919e7){logger[_0x3162('0x10')](_0x3162('0x16'),_0x3919e7[_0x3162('0x13')],_0x1eed46);_0x42f283(_0x391d97[_0x3162('0x10')](0x1f4,_0x3919e7[_0x3162('0x13')]));});});};exports[_0x3162('0x1d')]=function(_0x356c5d){var _0x8fa09f=this;return new Promise(function(_0x2f62d7,_0x1c03a4){var _0x48de45=require(_0x3162('0x1e'));var _0x552469;return db[_0x3162('0x1f')][_0x3162('0x20')]({'attributes':['id',_0x3162('0x21')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x4903e7){_0x552469=_0x4903e7;return db[_0x3162('0x17')][_0x3162('0x22')](_0x356c5d[_0x3162('0x19')]);})[_0x3162('0xa')](function(_0x2f88ec){if(_0x552469['callRecordingEncryption']&&fs[_0x3162('0x23')](_0x2f88ec['value'])){var _0xf11765=util[_0x3162('0x24')](_0x3162('0x25'),_0x2f88ec[_0x3162('0x26')]);return _0x48de45[_0x3162('0x27')](_0x2f88ec[_0x3162('0x26')],_0xf11765,config[_0x3162('0x28')][_0x3162('0x29')])['then'](function(){fs[_0x3162('0x2a')](_0x2f88ec[_0x3162('0x26')]);logger['info'](_0x3162('0x2b'));return _0x2f88ec;});}return _0x2f88ec;})[_0x3162('0xa')](function(_0x528340){logger['info'](_0x3162('0x1d'),_0x356c5d);logger['debug'](_0x3162('0x1d'),_0x356c5d,JSON[_0x3162('0xf')](_0x528340));_0x2f62d7(_0x528340);})[_0x3162('0x15')](function(_0x551442){logger['error'](_0x3162('0x1d'),_0x551442[_0x3162('0x13')],_0x356c5d);_0x1c03a4(_0x8fa09f['error'](0x1f4,_0x551442[_0x3162('0x13')]));});});}; \ No newline at end of file +var _0x2a07=['body','options','raw','where','attributes','limit','UpdateVoiceRecording','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','VoiceRecording','update'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0x2a07,0x74));var _0x72a0=function(_0xfb6cef,_0x206adf){_0xfb6cef=_0xfb6cef-0x0;var _0x40eb07=_0x2a07[_0xfb6cef];return _0x40eb07;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});}exports['UpdateVoiceRecording']=function(_0x100d8f){var _0x42e9ec=this;return new Promise(function(_0x131b73,_0x5b63c8){return db[_0x72a0('0x17')][_0x72a0('0x18')](_0x100d8f[_0x72a0('0x19')],{'raw':_0x100d8f[_0x72a0('0x1a')]?_0x100d8f['options'][_0x72a0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x100d8f['options']?_0x100d8f[_0x72a0('0x1a')][_0x72a0('0x1c')]||null:null,'attributes':_0x100d8f[_0x72a0('0x1a')]?_0x100d8f['options'][_0x72a0('0x1d')]||null:null,'limit':_0x100d8f[_0x72a0('0x1a')]?_0x100d8f[_0x72a0('0x1a')][_0x72a0('0x1e')]||null:null})['then'](function(_0x38a7ba){logger[_0x72a0('0x15')](_0x72a0('0x1f'),_0x100d8f);logger[_0x72a0('0x20')](_0x72a0('0x1f'),_0x100d8f,JSON[_0x72a0('0x12')](_0x38a7ba));_0x131b73(_0x38a7ba);})['catch'](function(_0x4dd1a6){logger[_0x72a0('0x13')](_0x72a0('0x1f'),_0x4dd1a6[_0x72a0('0x14')],_0x100d8f);_0x5b63c8(_0x42e9ec[_0x72a0('0x13')](0x1f4,_0x4dd1a6[_0x72a0('0x14')]));});});};exports[_0x72a0('0x21')]=function(_0xa5bda0){var _0x15922a=this;return new Promise(function(_0xee99e2,_0x12dcc9){var _0x4f9718=require(_0x72a0('0x22'));var _0x553641;return db[_0x72a0('0x23')][_0x72a0('0x24')]({'attributes':['id',_0x72a0('0x25')],'where':{'id':0x1},'raw':!![]})[_0x72a0('0xe')](function(_0x432179){_0x553641=_0x432179;return db[_0x72a0('0x17')][_0x72a0('0x26')](_0xa5bda0[_0x72a0('0x19')]);})['then'](function(_0x41efc1){if(_0x553641[_0x72a0('0x25')]&&fs[_0x72a0('0x27')](_0x41efc1[_0x72a0('0x28')])){var _0x13c04=util[_0x72a0('0x29')](_0x72a0('0x2a'),_0x41efc1['value']);return _0x4f9718[_0x72a0('0x2b')](_0x41efc1[_0x72a0('0x28')],_0x13c04,config[_0x72a0('0x2c')][_0x72a0('0x2d')])[_0x72a0('0xe')](function(){fs[_0x72a0('0x2e')](_0x41efc1[_0x72a0('0x28')]);logger[_0x72a0('0x15')]('CreateVoiceRecording\x20file\x20encrypted');return _0x41efc1;});}return _0x41efc1;})[_0x72a0('0xe')](function(_0x1fb485){logger[_0x72a0('0x15')]('CreateVoiceRecording',_0xa5bda0);logger[_0x72a0('0x20')]('CreateVoiceRecording',_0xa5bda0,JSON[_0x72a0('0x12')](_0x1fb485));_0xee99e2(_0x1fb485);})[_0x72a0('0x16')](function(_0x1d02c4){logger[_0x72a0('0x13')](_0x72a0('0x21'),_0x1d02c4[_0x72a0('0x14')],_0xa5bda0);_0x12dcc9(_0x15922a[_0x72a0('0x13')](0x1f4,_0x1d02c4[_0x72a0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 639597e..20773ab 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 _0x8442=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','post','/:id','destroy'];(function(_0x5eb6f7,_0x46ed64){var _0x43c94d=function(_0x426b07){while(--_0x426b07){_0x5eb6f7['push'](_0x5eb6f7['shift']());}};_0x43c94d(++_0x46ed64);}(_0x8442,0x186));var _0x2844=function(_0x5a0f67,_0x1f9421){_0x5a0f67=_0x5a0f67-0x0;var _0x21a0db=_0x8442[_0x5a0f67];return _0x21a0db;};'use strict';var multer=require(_0x2844('0x0'));var util=require(_0x2844('0x1'));var path=require('path');var timeout=require(_0x2844('0x2'));var express=require(_0x2844('0x3'));var router=express[_0x2844('0x4')]();var fs_extra=require(_0x2844('0x5'));var auth=require(_0x2844('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2844('0x7'));var controller=require('./voiceTransferReport.controller');router[_0x2844('0x8')]('/',auth[_0x2844('0x9')](),controller[_0x2844('0xa')]);router[_0x2844('0x8')]('/describe',auth[_0x2844('0x9')](),controller[_0x2844('0xb')]);router[_0x2844('0x8')]('/:id',auth[_0x2844('0x9')](),controller['show']);router[_0x2844('0xc')]('/',auth[_0x2844('0x9')](),controller['create']);router['put'](_0x2844('0xd'),auth[_0x2844('0x9')](),controller['update']);router['delete']('/:id',auth[_0x2844('0x9')](),controller[_0x2844('0xe')]);module['exports']=router; \ No newline at end of file +var _0xc22b=['/:id','show','isAuthenticated','delete','destroy','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','index','get','/describe'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0xc22b,0xb9));var _0xbc22=function(_0x2a4a9b,_0x4600a8){_0x2a4a9b=_0x2a4a9b-0x0;var _0x175014=_0xc22b[_0x2a4a9b];return _0x175014;};'use strict';var multer=require(_0xbc22('0x0'));var util=require('util');var path=require(_0xbc22('0x1'));var timeout=require('connect-timeout');var express=require(_0xbc22('0x2'));var router=express['Router']();var fs_extra=require(_0xbc22('0x3'));var auth=require(_0xbc22('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbc22('0x5'));var controller=require(_0xbc22('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xbc22('0x7')]);router[_0xbc22('0x8')](_0xbc22('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xbc22('0x8')](_0xbc22('0xa'),auth['isAuthenticated'](),controller[_0xbc22('0xb')]);router['post']('/',auth[_0xbc22('0xc')](),controller['create']);router['put'](_0xbc22('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xbc22('0xd')](_0xbc22('0xa'),auth[_0xbc22('0xc')](),controller[_0xbc22('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 15d03b6..a2ee9d0 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 _0x2bf2=['STRING','ENUM','Yes','sequelize','exports','blind','attended'];(function(_0x55cb9f,_0x64654d){var _0x272a75=function(_0x2d4f90){while(--_0x2d4f90){_0x55cb9f['push'](_0x55cb9f['shift']());}};_0x272a75(++_0x64654d);}(_0x2bf2,0x1d1));var _0x22bf=function(_0x39e06f,_0x9a2555){_0x39e06f=_0x39e06f-0x0;var _0x389749=_0x2bf2[_0x39e06f];return _0x389749;};'use strict';var Sequelize=require(_0x22bf('0x0'));var moment=require('moment');module[_0x22bf('0x1')]={'type':{'type':Sequelize['ENUM'](_0x22bf('0x2'),_0x22bf('0x3'))},'result':{'type':Sequelize[_0x22bf('0x4')]},'transfererchannel':{'type':Sequelize[_0x22bf('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x22bf('0x4')]},'transferercalleridname':{'type':Sequelize[_0x22bf('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x22bf('0x4')]},'transfererexten':{'type':Sequelize[_0x22bf('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x22bf('0x4')]},'transfereechannel':{'type':Sequelize[_0x22bf('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x22bf('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x22bf('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x22bf('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x22bf('0x4')]},'transfereecontext':{'type':Sequelize[_0x22bf('0x4')]},'transfereeexten':{'type':Sequelize[_0x22bf('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x22bf('0x4')]},'isexternal':{'type':Sequelize[_0x22bf('0x5')](_0x22bf('0x6'),'No')},'context':{'type':Sequelize[_0x22bf('0x4')]},'extension':{'type':Sequelize[_0x22bf('0x4')]}}; \ No newline at end of file +var _0xc665=['ENUM','Yes','sequelize','moment','exports','blind','attended','STRING'];(function(_0x565c18,_0x354263){var _0x4f762d=function(_0x370040){while(--_0x370040){_0x565c18['push'](_0x565c18['shift']());}};_0x4f762d(++_0x354263);}(_0xc665,0x132));var _0x5c66=function(_0xc7ad44,_0x15a87d){_0xc7ad44=_0xc7ad44-0x0;var _0x537f9a=_0xc665[_0xc7ad44];return _0x537f9a;};'use strict';var Sequelize=require(_0x5c66('0x0'));var moment=require(_0x5c66('0x1'));module[_0x5c66('0x2')]={'type':{'type':Sequelize['ENUM'](_0x5c66('0x3'),_0x5c66('0x4'))},'result':{'type':Sequelize[_0x5c66('0x5')]},'transfererchannel':{'type':Sequelize[_0x5c66('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x5c66('0x5')]},'transferercalleridname':{'type':Sequelize[_0x5c66('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x5c66('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x5c66('0x5')]},'transfererexten':{'type':Sequelize[_0x5c66('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x5c66('0x5')]},'transfereechannel':{'type':Sequelize[_0x5c66('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x5c66('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x5c66('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x5c66('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x5c66('0x5')]},'transfereecontext':{'type':Sequelize[_0x5c66('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x5c66('0x6')](_0x5c66('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x5c66('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index c5410d8..1b9b628 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 _0xa5be=['name','send','index','map','VoiceTransferReport','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','include','findAll','rows','show','params','rawAttributes','includeAll','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error'];(function(_0x55dd60,_0x479fb7){var _0x505abb=function(_0x5429c9){while(--_0x5429c9){_0x55dd60['push'](_0x55dd60['shift']());}};_0x505abb(++_0x479fb7);}(_0xa5be,0x15a));var _0xea5b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa5be[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0xea5b('0x0'));var rimraf=require(_0xea5b('0x1'));var zipdir=require(_0xea5b('0x2'));var jsonpatch=require(_0xea5b('0x3'));var rp=require('request-promise');var moment=require(_0xea5b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xea5b('0x5'));var util=require(_0xea5b('0x6'));var path=require(_0xea5b('0x7'));var sox=require(_0xea5b('0x8'));var csv=require(_0xea5b('0x9'));var ejs=require(_0xea5b('0xa'));var fs=require('fs');var fs_extra=require(_0xea5b('0xb'));var _=require(_0xea5b('0xc'));var squel=require(_0xea5b('0xd'));var crypto=require(_0xea5b('0xe'));var jsforce=require(_0xea5b('0xf'));var deskjs=require(_0xea5b('0x10'));var toCsv=require(_0xea5b('0x9'));var querystring=require(_0xea5b('0x11'));var Papa=require(_0xea5b('0x12'));var Redis=require(_0xea5b('0x13'));var authService=require(_0xea5b('0x14'));var qs=require(_0xea5b('0x15'));var as=require(_0xea5b('0x16'));var hardwareService=require(_0xea5b('0x17'));var logger=require(_0xea5b('0x18'))(_0xea5b('0x19'));var utils=require('../../config/utils');var config=require(_0xea5b('0x1a'));var licenseUtil=require(_0xea5b('0x1b'));var db=require(_0xea5b('0x1c'))['db'];function respondWithStatusCode(_0x8ea1e6,_0x4e2299){_0x4e2299=_0x4e2299||0xcc;return function(_0xfb6be1){if(_0xfb6be1){return _0x8ea1e6[_0xea5b('0x1d')](_0x4e2299);}return _0x8ea1e6[_0xea5b('0x1e')](_0x4e2299)[_0xea5b('0x1f')]();};}function respondWithResult(_0x4e07aa,_0xb74bdd){_0xb74bdd=_0xb74bdd||0xc8;return function(_0x1eab86){if(_0x1eab86){return _0x4e07aa[_0xea5b('0x1e')](_0xb74bdd)[_0xea5b('0x20')](_0x1eab86);}};}function respondWithFilteredResult(_0x3a6f23,_0x5f4aed){return function(_0x364707){if(_0x364707){var _0x34c7cb=typeof _0x5f4aed[_0xea5b('0x21')]===_0xea5b('0x22')&&typeof _0x5f4aed[_0xea5b('0x23')]==='undefined';var _0x238a09=_0x364707[_0xea5b('0x24')];var _0x1f5ee0=_0x34c7cb?0x0:_0x5f4aed['offset'];var _0x16af5c=_0x34c7cb?_0x364707[_0xea5b('0x24')]:_0x5f4aed[_0xea5b('0x21')]+_0x5f4aed[_0xea5b('0x23')];var _0x1354a3;if(_0x16af5c>=_0x238a09){_0x16af5c=_0x238a09;_0x1354a3=0xc8;}else{_0x1354a3=0xce;}_0x3a6f23[_0xea5b('0x1e')](_0x1354a3);return _0x3a6f23['set'](_0xea5b('0x25'),_0x1f5ee0+'-'+_0x16af5c+'/'+_0x238a09)['json'](_0x364707);}return null;};}function patchUpdates(_0xa865f2){return function(_0x590ede){try{jsonpatch['apply'](_0x590ede,_0xa865f2,!![]);}catch(_0x5853ba){return BPromise[_0xea5b('0x26')](_0x5853ba);}return _0x590ede[_0xea5b('0x27')]();};}function saveUpdates(_0x3afd4d,_0x2e8cfb){return function(_0x37039d){if(_0x37039d){return _0x37039d[_0xea5b('0x28')](_0x3afd4d)[_0xea5b('0x29')](function(_0x4f3010){return _0x4f3010;});}return null;};}function removeEntity(_0x411624,_0x57f31e){return function(_0x310ad3){if(_0x310ad3){return _0x310ad3[_0xea5b('0x2a')]()[_0xea5b('0x29')](function(){_0x411624[_0xea5b('0x1e')](0xcc)[_0xea5b('0x1f')]();});}};}function handleEntityNotFound(_0x1a5b97,_0x2758ca){return function(_0x2eb960){if(!_0x2eb960){_0x1a5b97[_0xea5b('0x1d')](0x194);}return _0x2eb960;};}function handleError(_0x437b7b,_0x31698b){_0x31698b=_0x31698b||0x1f4;return function(_0x15f0ce){logger[_0xea5b('0x2b')](_0x15f0ce['stack']);if(_0x15f0ce[_0xea5b('0x2c')]){delete _0x15f0ce[_0xea5b('0x2c')];}_0x437b7b[_0xea5b('0x1e')](_0x31698b)[_0xea5b('0x2d')](_0x15f0ce);};}exports[_0xea5b('0x2e')]=function(_0xcebf45,_0x44e0d3){var _0x5b1827={},_0x574934={},_0x18199c={'count':0x0,'rows':[]};var _0x2692f0=_[_0xea5b('0x2f')](db[_0xea5b('0x30')]['rawAttributes'],function(_0x7b34b6){return{'name':_0x7b34b6['fieldName'],'type':_0x7b34b6['type']['key']};});_0x574934[_0xea5b('0x31')]=_[_0xea5b('0x2f')](_0x2692f0,'name');_0x574934[_0xea5b('0x32')]=_[_0xea5b('0x33')](_0xcebf45['query']);_0x574934[_0xea5b('0x34')]=_[_0xea5b('0x35')](_0x574934['model'],_0x574934[_0xea5b('0x32')]);_0x5b1827['attributes']=_[_0xea5b('0x35')](_0x574934['model'],qs[_0xea5b('0x36')](_0xcebf45[_0xea5b('0x32')][_0xea5b('0x36')]));_0x5b1827[_0xea5b('0x37')]=_0x5b1827['attributes'][_0xea5b('0x38')]?_0x5b1827[_0xea5b('0x37')]:_0x574934[_0xea5b('0x31')];if(!_0xcebf45[_0xea5b('0x32')][_0xea5b('0x39')](_0xea5b('0x3a'))){_0x5b1827[_0xea5b('0x23')]=qs[_0xea5b('0x23')](_0xcebf45[_0xea5b('0x32')][_0xea5b('0x23')]);_0x5b1827[_0xea5b('0x21')]=qs['offset'](_0xcebf45[_0xea5b('0x32')][_0xea5b('0x21')]);}_0x5b1827[_0xea5b('0x3b')]=qs['sort'](_0xcebf45['query'][_0xea5b('0x3c')]);_0x5b1827[_0xea5b('0x3d')]=qs[_0xea5b('0x34')](_[_0xea5b('0x3e')](_0xcebf45[_0xea5b('0x32')],_0x574934[_0xea5b('0x34')]),_0x2692f0);if(_0xcebf45[_0xea5b('0x32')]['filter']){_0x5b1827[_0xea5b('0x3d')]=_['merge'](_0x5b1827['where'],{'$or':_[_0xea5b('0x2f')](_0x2692f0,function(_0x5b6b9d){if(_0x5b6b9d['type']!==_0xea5b('0x3f')){var _0xeb079a={};_0xeb079a[_0x5b6b9d['name']]={'$like':'%'+_0xcebf45[_0xea5b('0x32')][_0xea5b('0x40')]+'%'};return _0xeb079a;}})});}_0x5b1827=_[_0xea5b('0x41')]({},_0x5b1827,_0xcebf45['options']);var _0x490c85={'where':_0x5b1827['where']};return db[_0xea5b('0x30')]['count'](_0x490c85)[_0xea5b('0x29')](function(_0x406996){_0x18199c[_0xea5b('0x24')]=_0x406996;if(_0xcebf45[_0xea5b('0x32')]['includeAll']){_0x5b1827[_0xea5b('0x42')]=[{'all':!![]}];}return db[_0xea5b('0x30')][_0xea5b('0x43')](_0x5b1827);})['then'](function(_0x21e9f2){_0x18199c[_0xea5b('0x44')]=_0x21e9f2;return _0x18199c;})[_0xea5b('0x29')](respondWithFilteredResult(_0x44e0d3,_0x5b1827))['catch'](handleError(_0x44e0d3,null));};exports[_0xea5b('0x45')]=function(_0x1d4705,_0x777a47){var _0x465ca6={'raw':!![],'where':{'id':_0x1d4705[_0xea5b('0x46')]['id']}},_0x36b503={};_0x36b503[_0xea5b('0x31')]=_[_0xea5b('0x33')](db[_0xea5b('0x30')][_0xea5b('0x47')]);_0x36b503[_0xea5b('0x32')]=_[_0xea5b('0x33')](_0x1d4705[_0xea5b('0x32')]);_0x36b503[_0xea5b('0x34')]=_[_0xea5b('0x35')](_0x36b503['model'],_0x36b503[_0xea5b('0x32')]);_0x465ca6[_0xea5b('0x37')]=_[_0xea5b('0x35')](_0x36b503['model'],qs[_0xea5b('0x36')](_0x1d4705[_0xea5b('0x32')][_0xea5b('0x36')]));_0x465ca6['attributes']=_0x465ca6['attributes']['length']?_0x465ca6[_0xea5b('0x37')]:_0x36b503['model'];if(_0x1d4705['query'][_0xea5b('0x48')]){_0x465ca6[_0xea5b('0x42')]=[{'all':!![]}];}_0x465ca6=_[_0xea5b('0x41')]({},_0x465ca6,_0x1d4705[_0xea5b('0x49')]);return db[_0xea5b('0x30')][_0xea5b('0x4a')](_0x465ca6)['then'](handleEntityNotFound(_0x777a47,null))[_0xea5b('0x29')](respondWithResult(_0x777a47,null))[_0xea5b('0x4b')](handleError(_0x777a47,null));};exports[_0xea5b('0x4c')]=function(_0x590103,_0xbf14f1){return db[_0xea5b('0x30')]['create'](_0x590103['body'],{})[_0xea5b('0x29')](respondWithResult(_0xbf14f1,0xc9))[_0xea5b('0x4b')](handleError(_0xbf14f1,null));};exports[_0xea5b('0x28')]=function(_0x51effa,_0xaf1ec7){if(_0x51effa[_0xea5b('0x4d')]['id']){delete _0x51effa[_0xea5b('0x4d')]['id'];}return db[_0xea5b('0x30')][_0xea5b('0x4a')]({'where':{'id':_0x51effa['params']['id']}})['then'](handleEntityNotFound(_0xaf1ec7,null))[_0xea5b('0x29')](saveUpdates(_0x51effa[_0xea5b('0x4d')],null))[_0xea5b('0x29')](respondWithResult(_0xaf1ec7,null))['catch'](handleError(_0xaf1ec7,null));};exports['destroy']=function(_0x10e1cb,_0x5990ea){return db[_0xea5b('0x30')][_0xea5b('0x4a')]({'where':{'id':_0x10e1cb[_0xea5b('0x46')]['id']}})[_0xea5b('0x29')](handleEntityNotFound(_0x5990ea,null))[_0xea5b('0x29')](removeEntity(_0x5990ea,null))['catch'](handleError(_0x5990ea,null));};exports['describe']=function(_0x2495e0,_0x16ba09){return db['VoiceTransferReport']['describe']()[_0xea5b('0x29')](respondWithResult(_0x16ba09,null))[_0xea5b('0x4b')](handleError(_0x16ba09,null));}; \ No newline at end of file +var _0x4e72=['destroy','error','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../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','limit','undefined','count','set','reject','save','update','then'];(function(_0x2f2f2c,_0x3e3126){var _0x240bee=function(_0x536ae9){while(--_0x536ae9){_0x2f2f2c['push'](_0x2f2f2c['shift']());}};_0x240bee(++_0x3e3126);}(_0x4e72,0x152));var _0x24e7=function(_0xbe62e9,_0x3937fd){_0xbe62e9=_0xbe62e9-0x0;var _0x39712d=_0x4e72[_0xbe62e9];return _0x39712d;};'use strict';var emlformat=require(_0x24e7('0x0'));var rimraf=require(_0x24e7('0x1'));var zipdir=require(_0x24e7('0x2'));var jsonpatch=require(_0x24e7('0x3'));var rp=require(_0x24e7('0x4'));var moment=require(_0x24e7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x24e7('0x6'));var path=require(_0x24e7('0x7'));var sox=require(_0x24e7('0x8'));var csv=require('to-csv');var ejs=require(_0x24e7('0x9'));var fs=require('fs');var fs_extra=require(_0x24e7('0xa'));var _=require(_0x24e7('0xb'));var squel=require(_0x24e7('0xc'));var crypto=require(_0x24e7('0xd'));var jsforce=require(_0x24e7('0xe'));var deskjs=require(_0x24e7('0xf'));var toCsv=require(_0x24e7('0x10'));var querystring=require(_0x24e7('0x11'));var Papa=require(_0x24e7('0x12'));var Redis=require(_0x24e7('0x13'));var authService=require(_0x24e7('0x14'));var qs=require(_0x24e7('0x15'));var as=require(_0x24e7('0x16'));var hardwareService=require(_0x24e7('0x17'));var logger=require(_0x24e7('0x18'))(_0x24e7('0x19'));var utils=require(_0x24e7('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x24e7('0x1b'));var db=require(_0x24e7('0x1c'))['db'];function respondWithStatusCode(_0x1b48b3,_0x519d9f){_0x519d9f=_0x519d9f||0xcc;return function(_0x15695e){if(_0x15695e){return _0x1b48b3[_0x24e7('0x1d')](_0x519d9f);}return _0x1b48b3['status'](_0x519d9f)[_0x24e7('0x1e')]();};}function respondWithResult(_0x5ba774,_0x3a922a){_0x3a922a=_0x3a922a||0xc8;return function(_0x544151){if(_0x544151){return _0x5ba774[_0x24e7('0x1f')](_0x3a922a)[_0x24e7('0x20')](_0x544151);}};}function respondWithFilteredResult(_0x5e0d6a,_0x573347){return function(_0x3f5da9){if(_0x3f5da9){var _0x553a81=typeof _0x573347[_0x24e7('0x21')]==='undefined'&&typeof _0x573347[_0x24e7('0x22')]===_0x24e7('0x23');var _0x869123=_0x3f5da9[_0x24e7('0x24')];var _0x49ebb1=_0x553a81?0x0:_0x573347[_0x24e7('0x21')];var _0x5c5db2=_0x553a81?_0x3f5da9[_0x24e7('0x24')]:_0x573347['offset']+_0x573347[_0x24e7('0x22')];var _0x370712;if(_0x5c5db2>=_0x869123){_0x5c5db2=_0x869123;_0x370712=0xc8;}else{_0x370712=0xce;}_0x5e0d6a[_0x24e7('0x1f')](_0x370712);return _0x5e0d6a[_0x24e7('0x25')]('Content-Range',_0x49ebb1+'-'+_0x5c5db2+'/'+_0x869123)[_0x24e7('0x20')](_0x3f5da9);}return null;};}function patchUpdates(_0x9e4f02){return function(_0x299761){try{jsonpatch['apply'](_0x299761,_0x9e4f02,!![]);}catch(_0x1eca2e){return BPromise[_0x24e7('0x26')](_0x1eca2e);}return _0x299761[_0x24e7('0x27')]();};}function saveUpdates(_0x1816d5,_0x27698d){return function(_0x2c35b0){if(_0x2c35b0){return _0x2c35b0[_0x24e7('0x28')](_0x1816d5)[_0x24e7('0x29')](function(_0x3c2bf5){return _0x3c2bf5;});}return null;};}function removeEntity(_0x5acb04,_0x4fe6a){return function(_0x5857c8){if(_0x5857c8){return _0x5857c8[_0x24e7('0x2a')]()[_0x24e7('0x29')](function(){_0x5acb04[_0x24e7('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ce12a,_0x44407e){return function(_0x37ed23){if(!_0x37ed23){_0x5ce12a[_0x24e7('0x1d')](0x194);}return _0x37ed23;};}function handleError(_0x3335b5,_0x1491b1){_0x1491b1=_0x1491b1||0x1f4;return function(_0x4b7375){logger[_0x24e7('0x2b')](_0x4b7375['stack']);if(_0x4b7375['name']){delete _0x4b7375[_0x24e7('0x2c')];}_0x3335b5[_0x24e7('0x1f')](_0x1491b1)[_0x24e7('0x2d')](_0x4b7375);};}exports[_0x24e7('0x2e')]=function(_0x3153f1,_0x3646ae){var _0xf6c948={},_0x121f40={},_0x5b98ea={'count':0x0,'rows':[]};var _0x443081=_[_0x24e7('0x2f')](db[_0x24e7('0x30')][_0x24e7('0x31')],function(_0x41b4ed){return{'name':_0x41b4ed[_0x24e7('0x32')],'type':_0x41b4ed['type'][_0x24e7('0x33')]};});_0x121f40['model']=_[_0x24e7('0x2f')](_0x443081,_0x24e7('0x2c'));_0x121f40[_0x24e7('0x34')]=_[_0x24e7('0x35')](_0x3153f1[_0x24e7('0x34')]);_0x121f40['filters']=_[_0x24e7('0x36')](_0x121f40[_0x24e7('0x37')],_0x121f40[_0x24e7('0x34')]);_0xf6c948[_0x24e7('0x38')]=_['intersection'](_0x121f40[_0x24e7('0x37')],qs[_0x24e7('0x39')](_0x3153f1[_0x24e7('0x34')][_0x24e7('0x39')]));_0xf6c948[_0x24e7('0x38')]=_0xf6c948['attributes'][_0x24e7('0x3a')]?_0xf6c948[_0x24e7('0x38')]:_0x121f40[_0x24e7('0x37')];if(!_0x3153f1[_0x24e7('0x34')]['hasOwnProperty']('nolimit')){_0xf6c948[_0x24e7('0x22')]=qs[_0x24e7('0x22')](_0x3153f1[_0x24e7('0x34')][_0x24e7('0x22')]);_0xf6c948['offset']=qs['offset'](_0x3153f1[_0x24e7('0x34')]['offset']);}_0xf6c948['order']=qs[_0x24e7('0x3b')](_0x3153f1[_0x24e7('0x34')][_0x24e7('0x3b')]);_0xf6c948[_0x24e7('0x3c')]=qs[_0x24e7('0x3d')](_['pick'](_0x3153f1[_0x24e7('0x34')],_0x121f40[_0x24e7('0x3d')]),_0x443081);if(_0x3153f1[_0x24e7('0x34')][_0x24e7('0x3e')]){_0xf6c948[_0x24e7('0x3c')]=_[_0x24e7('0x3f')](_0xf6c948[_0x24e7('0x3c')],{'$or':_[_0x24e7('0x2f')](_0x443081,function(_0x5a9235){if(_0x5a9235['type']!==_0x24e7('0x40')){var _0x150ea1={};_0x150ea1[_0x5a9235['name']]={'$like':'%'+_0x3153f1['query'][_0x24e7('0x3e')]+'%'};return _0x150ea1;}})});}_0xf6c948=_['merge']({},_0xf6c948,_0x3153f1[_0x24e7('0x41')]);var _0x36b923={'where':_0xf6c948[_0x24e7('0x3c')]};return db[_0x24e7('0x30')]['count'](_0x36b923)[_0x24e7('0x29')](function(_0x1bb5a7){_0x5b98ea[_0x24e7('0x24')]=_0x1bb5a7;if(_0x3153f1[_0x24e7('0x34')][_0x24e7('0x42')]){_0xf6c948[_0x24e7('0x43')]=[{'all':!![]}];}return db[_0x24e7('0x30')]['findAll'](_0xf6c948);})[_0x24e7('0x29')](function(_0x28409f){_0x5b98ea[_0x24e7('0x44')]=_0x28409f;return _0x5b98ea;})[_0x24e7('0x29')](respondWithFilteredResult(_0x3646ae,_0xf6c948))['catch'](handleError(_0x3646ae,null));};exports[_0x24e7('0x45')]=function(_0x2407b2,_0x2c137e){var _0x236225={'raw':!![],'where':{'id':_0x2407b2[_0x24e7('0x46')]['id']}},_0x3bcc36={};_0x3bcc36[_0x24e7('0x37')]=_[_0x24e7('0x35')](db[_0x24e7('0x30')][_0x24e7('0x31')]);_0x3bcc36['query']=_[_0x24e7('0x35')](_0x2407b2[_0x24e7('0x34')]);_0x3bcc36[_0x24e7('0x3d')]=_[_0x24e7('0x36')](_0x3bcc36[_0x24e7('0x37')],_0x3bcc36[_0x24e7('0x34')]);_0x236225[_0x24e7('0x38')]=_['intersection'](_0x3bcc36[_0x24e7('0x37')],qs[_0x24e7('0x39')](_0x2407b2[_0x24e7('0x34')][_0x24e7('0x39')]));_0x236225[_0x24e7('0x38')]=_0x236225[_0x24e7('0x38')][_0x24e7('0x3a')]?_0x236225['attributes']:_0x3bcc36[_0x24e7('0x37')];if(_0x2407b2[_0x24e7('0x34')]['includeAll']){_0x236225[_0x24e7('0x43')]=[{'all':!![]}];}_0x236225=_[_0x24e7('0x3f')]({},_0x236225,_0x2407b2[_0x24e7('0x41')]);return db['VoiceTransferReport'][_0x24e7('0x47')](_0x236225)[_0x24e7('0x29')](handleEntityNotFound(_0x2c137e,null))[_0x24e7('0x29')](respondWithResult(_0x2c137e,null))[_0x24e7('0x48')](handleError(_0x2c137e,null));};exports['create']=function(_0x20e7b6,_0x2b6af3){return db[_0x24e7('0x30')][_0x24e7('0x49')](_0x20e7b6['body'],{})[_0x24e7('0x29')](respondWithResult(_0x2b6af3,0xc9))[_0x24e7('0x48')](handleError(_0x2b6af3,null));};exports[_0x24e7('0x28')]=function(_0x2434ff,_0x103fd3){if(_0x2434ff[_0x24e7('0x4a')]['id']){delete _0x2434ff[_0x24e7('0x4a')]['id'];}return db[_0x24e7('0x30')][_0x24e7('0x47')]({'where':{'id':_0x2434ff[_0x24e7('0x46')]['id']}})[_0x24e7('0x29')](handleEntityNotFound(_0x103fd3,null))[_0x24e7('0x29')](saveUpdates(_0x2434ff['body'],null))[_0x24e7('0x29')](respondWithResult(_0x103fd3,null))[_0x24e7('0x48')](handleError(_0x103fd3,null));};exports[_0x24e7('0x2a')]=function(_0x3c3147,_0x9f657a){return db[_0x24e7('0x30')][_0x24e7('0x47')]({'where':{'id':_0x3c3147[_0x24e7('0x46')]['id']}})[_0x24e7('0x29')](handleEntityNotFound(_0x9f657a,null))[_0x24e7('0x29')](removeEntity(_0x9f657a,null))[_0x24e7('0x48')](handleError(_0x9f657a,null));};exports['describe']=function(_0x55c930,_0x168868){return db[_0x24e7('0x30')][_0x24e7('0x4b')]()[_0x24e7('0x29')](respondWithResult(_0x168868,null))[_0x24e7('0x48')](handleError(_0x168868,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 25868c3..d06a946 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 _0x27fc=['bluebird','request-promise','path','rimraf','../../config/environment','exports','report_call_transfer','lodash','../../config/logger','api','moment'];(function(_0x41a765,_0x4a1742){var _0x39dbd6=function(_0x527776){while(--_0x527776){_0x41a765['push'](_0x41a765['shift']());}};_0x39dbd6(++_0x4a1742);}(_0x27fc,0x1b4));var _0xc27f=function(_0x324e58,_0x5667bf){_0x324e58=_0x324e58-0x0;var _0x41bda1=_0x27fc[_0x324e58];return _0x41bda1;};'use strict';var _=require(_0xc27f('0x0'));var util=require('util');var logger=require(_0xc27f('0x1'))(_0xc27f('0x2'));var moment=require(_0xc27f('0x3'));var BPromise=require(_0xc27f('0x4'));var rp=require(_0xc27f('0x5'));var fs=require('fs');var path=require(_0xc27f('0x6'));var rimraf=require(_0xc27f('0x7'));var config=require(_0xc27f('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0xc27f('0x9')]=function(_0x120390,_0x21933){return _0x120390['define']('VoiceTransferReport',attributes,{'tableName':_0xc27f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb577=['../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3b6778,_0x57ddd4){var _0x4061de=function(_0x3c5060){while(--_0x3c5060){_0x3b6778['push'](_0x3b6778['shift']());}};_0x4061de(++_0x57ddd4);}(_0xb577,0x1f4));var _0x7b57=function(_0x14dde2,_0x3ec312){_0x14dde2=_0x14dde2-0x0;var _0x31418c=_0xb577[_0x14dde2];return _0x31418c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7b57('0x0'))('api');var moment=require(_0x7b57('0x1'));var BPromise=require(_0x7b57('0x2'));var rp=require(_0x7b57('0x3'));var fs=require('fs');var path=require(_0x7b57('0x4'));var rimraf=require(_0x7b57('0x5'));var config=require(_0x7b57('0x6'));var attributes=require(_0x7b57('0x7'));module[_0x7b57('0x8')]=function(_0x33c6bf,_0x3f16f4){return _0x33c6bf[_0x7b57('0x9')]('VoiceTransferReport',attributes,{'tableName':_0x7b57('0xa'),'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 73cbed2..e10b5c7 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 _0xb478=['info','request\x20sent','debug','stringify','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then'];(function(_0x3ff1a1,_0x209a5c){var _0x323cee=function(_0x293a3a){while(--_0x293a3a){_0x3ff1a1['push'](_0x3ff1a1['shift']());}};_0x323cee(++_0x209a5c);}(_0xb478,0x1b6));var _0x8b47=function(_0x4baac8,_0x5f1dc7){_0x4baac8=_0x4baac8-0x0;var _0x56ebc5=_0xb478[_0x4baac8];return _0x56ebc5;};'use strict';var _=require(_0x8b47('0x0'));var util=require(_0x8b47('0x1'));var moment=require(_0x8b47('0x2'));var BPromise=require('bluebird');var rs=require(_0x8b47('0x3'));var fs=require('fs');var Redis=require(_0x8b47('0x4'));var db=require(_0x8b47('0x5'))['db'];var utils=require(_0x8b47('0x6'));var logger=require(_0x8b47('0x7'))(_0x8b47('0x8'));var config=require(_0x8b47('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10b415,_0x5a73d3,_0x1027d6){return new BPromise(function(_0x110026,_0x4effcf){return client[_0x8b47('0xa')](_0x10b415,_0x1027d6)[_0x8b47('0xb')](function(_0x27d4cf){logger[_0x8b47('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x5a73d3,_0x8b47('0xd'));logger[_0x8b47('0xe')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x5a73d3,'request\x20sent',JSON[_0x8b47('0xf')](_0x27d4cf));if(_0x27d4cf['error']){if(_0x27d4cf[_0x8b47('0x10')]['code']===0x1f4){logger[_0x8b47('0x10')](_0x8b47('0x11'),_0x5a73d3,_0x27d4cf['error'][_0x8b47('0x12')]);return _0x4effcf(_0x27d4cf[_0x8b47('0x10')][_0x8b47('0x12')]);}logger[_0x8b47('0x10')](_0x8b47('0x11'),_0x5a73d3,_0x27d4cf[_0x8b47('0x10')][_0x8b47('0x12')]);return _0x110026(_0x27d4cf[_0x8b47('0x10')][_0x8b47('0x12')]);}else{logger[_0x8b47('0xc')](_0x8b47('0x11'),_0x5a73d3,_0x8b47('0xd'));_0x110026(_0x27d4cf[_0x8b47('0x13')][_0x8b47('0x12')]);}})[_0x8b47('0x14')](function(_0x2bc6b8){logger['error'](_0x8b47('0x11'),_0x5a73d3,_0x2bc6b8);_0x4effcf(_0x2bc6b8);});});}exports[_0x8b47('0x15')]=function(_0x39e1a1){var _0x8fde=this;return new Promise(function(_0x3e5800,_0x308590){return db[_0x8b47('0x16')][_0x8b47('0x17')](_0x39e1a1['body'],{'raw':_0x39e1a1[_0x8b47('0x18')]?_0x39e1a1[_0x8b47('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x8b47('0xb')](function(_0x48ee7f){logger[_0x8b47('0xc')](_0x8b47('0x15'),_0x39e1a1);logger[_0x8b47('0xe')]('CreateVoiceTransferReport',_0x39e1a1,JSON[_0x8b47('0xf')](_0x48ee7f));_0x3e5800(_0x48ee7f);})[_0x8b47('0x14')](function(_0x2d13ba){logger[_0x8b47('0x10')](_0x8b47('0x15'),_0x2d13ba[_0x8b47('0x12')],_0x39e1a1);_0x308590(_0x8fde[_0x8b47('0x10')](0x1f4,_0x2d13ba[_0x8b47('0x12')]));});});}; \ No newline at end of file +var _0x271d=['debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x37635e,_0x21b6f5){var _0x3c0965=function(_0xe9864c){while(--_0xe9864c){_0x37635e['push'](_0x37635e['shift']());}};_0x3c0965(++_0x21b6f5);}(_0x271d,0x113));var _0xd271=function(_0x111902,_0x38e6d4){_0x111902=_0x111902-0x0;var _0xb22d26=_0x271d[_0x111902];return _0xb22d26;};'use strict';var _=require('lodash');var util=require(_0xd271('0x0'));var moment=require(_0xd271('0x1'));var BPromise=require(_0xd271('0x2'));var rs=require(_0xd271('0x3'));var fs=require('fs');var Redis=require(_0xd271('0x4'));var db=require(_0xd271('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd271('0x6'));var config=require(_0xd271('0x7'));var jayson=require(_0xd271('0x8'));var client=jayson[_0xd271('0x9')][_0xd271('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x404892,_0x40592c,_0x3a5610){return new BPromise(function(_0x52f0de,_0x1e90c3){return client[_0xd271('0xb')](_0x404892,_0x3a5610)[_0xd271('0xc')](function(_0x30c5f1){logger[_0xd271('0xd')](_0xd271('0xe'),_0x40592c,'request\x20sent');logger[_0xd271('0xf')](_0xd271('0x10'),_0x40592c,_0xd271('0x11'),JSON[_0xd271('0x12')](_0x30c5f1));if(_0x30c5f1[_0xd271('0x13')]){if(_0x30c5f1[_0xd271('0x13')][_0xd271('0x14')]===0x1f4){logger[_0xd271('0x13')](_0xd271('0xe'),_0x40592c,_0x30c5f1[_0xd271('0x13')][_0xd271('0x15')]);return _0x1e90c3(_0x30c5f1[_0xd271('0x13')][_0xd271('0x15')]);}logger[_0xd271('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x40592c,_0x30c5f1[_0xd271('0x13')][_0xd271('0x15')]);return _0x52f0de(_0x30c5f1[_0xd271('0x13')]['message']);}else{logger[_0xd271('0xd')](_0xd271('0xe'),_0x40592c,_0xd271('0x11'));_0x52f0de(_0x30c5f1['result'][_0xd271('0x15')]);}})[_0xd271('0x16')](function(_0x4093ec){logger[_0xd271('0x13')](_0xd271('0xe'),_0x40592c,_0x4093ec);_0x1e90c3(_0x4093ec);});});}exports[_0xd271('0x17')]=function(_0x1f31d5){var _0x18eb54=this;return new Promise(function(_0x1fab79,_0x54963a){return db[_0xd271('0x18')][_0xd271('0x19')](_0x1f31d5[_0xd271('0x1a')],{'raw':_0x1f31d5[_0xd271('0x1b')]?_0x1f31d5[_0xd271('0x1b')][_0xd271('0x1c')]===undefined?!![]:![]:!![]})[_0xd271('0xc')](function(_0x1b64a0){logger[_0xd271('0xd')](_0xd271('0x17'),_0x1f31d5);logger[_0xd271('0xf')]('CreateVoiceTransferReport',_0x1f31d5,JSON[_0xd271('0x12')](_0x1b64a0));_0x1fab79(_0x1b64a0);})[_0xd271('0x16')](function(_0x5d3cc2){logger['error'](_0xd271('0x17'),_0x5d3cc2['message'],_0x1f31d5);_0x54963a(_0x18eb54[_0xd271('0x13')](0x1f4,_0x5d3cc2[_0xd271('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 6476767..adc1d2d 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 _0x9a19=['hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup'];(function(_0x4f0198,_0x4d5451){var _0x574720=function(_0x50793b){while(--_0x50793b){_0x4f0198['push'](_0x4f0198['shift']());}};_0x574720(++_0x4d5451);}(_0x9a19,0x114));var _0x99a1=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x9a19[_0x51020b];return _0x371e47;};'use strict';var express=require(_0x99a1('0x0'));var router=express[_0x99a1('0x1')]();var auth=require(_0x99a1('0x2'));var controller=require('./webbar.controller');router[_0x99a1('0x3')](_0x99a1('0x4'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0x7')]);router[_0x99a1('0x3')](_0x99a1('0x8'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0x9')]);router[_0x99a1('0x3')]('/answer',auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x99a1('0xa')]);router[_0x99a1('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x99a1('0x6')](),controller[_0x99a1('0xb')]);router[_0x99a1('0x3')](_0x99a1('0xc'),auth[_0x99a1('0x5')](),auth['isWebrtcLicence'](),controller[_0x99a1('0xd')]);router[_0x99a1('0x3')](_0x99a1('0xe'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0xf')]);router[_0x99a1('0x3')](_0x99a1('0x10'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0x11')]);module[_0x99a1('0x12')]=router; \ No newline at end of file +var _0x5b02=['Router','../../components/auth/service','./webbar.controller','isAuthenticated','originate','post','/hangup','isWebrtcLicence','/answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0xc63b4d,_0x367a3f){var _0x3c1f02=function(_0x339d82){while(--_0x339d82){_0xc63b4d['push'](_0xc63b4d['shift']());}};_0x3c1f02(++_0x367a3f);}(_0x5b02,0xe9));var _0x25b0=function(_0x3744e6,_0x8b7467){_0x3744e6=_0x3744e6-0x0;var _0xba1265=_0x5b02[_0x3744e6];return _0xba1265;};'use strict';var express=require(_0x25b0('0x0'));var router=express[_0x25b0('0x1')]();var auth=require(_0x25b0('0x2'));var controller=require(_0x25b0('0x3'));router['post']('/originate',auth[_0x25b0('0x4')](),auth['isWebrtcLicence'](),controller[_0x25b0('0x5')]);router[_0x25b0('0x6')](_0x25b0('0x7'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hangup']);router[_0x25b0('0x6')](_0x25b0('0x9'),auth['isAuthenticated'](),auth[_0x25b0('0x8')](),controller['answer']);router['post'](_0x25b0('0xa'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hold']);router[_0x25b0('0x6')](_0x25b0('0xb'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x6')](_0x25b0('0xd'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xe')]);router[_0x25b0('0x6')](_0x25b0('0xf'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0x10')]);module[_0x25b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 4bc371e..084e190 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 _0xad8a=['answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','user:%s','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','all','conference','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','error','name','status','send','request','then','code','message','result','catch','User','agent','VoiceChannels','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','hangup\x20executed!','answer'];(function(_0x34b8bc,_0x2cf4eb){var _0x9b1228=function(_0x27a542){while(--_0x27a542){_0x34b8bc['push'](_0x34b8bc['shift']());}};_0x9b1228(++_0x2cf4eb);}(_0xad8a,0xb0));var _0xaad8=function(_0x1cf68a,_0x2392b0){_0x1cf68a=_0x1cf68a-0x0;var _0x40193e=_0xad8a[_0x1cf68a];return _0x40193e;};'use strict';var path=require(_0xaad8('0x0'));var fs=require('fs');var _=require(_0xaad8('0x1'));var db=require(_0xaad8('0x2'))['db'];var config=require(_0xaad8('0x3'));var util=require(_0xaad8('0x4'));var BPromise=require('bluebird');var jayson=require(_0xaad8('0x5'));var amiClient=jayson[_0xaad8('0x6')][_0xaad8('0x7')]({'port':0x232a});var logger=require('../../config/logger')(_0xaad8('0x8'));var Redis=require(_0xaad8('0x9'));config[_0xaad8('0xa')]=_[_0xaad8('0xb')](config[_0xaad8('0xa')],{'host':_0xaad8('0xc'),'port':0x18eb});var io=require(_0xaad8('0xd'))(new Redis(config[_0xaad8('0xa')]));var Schema=require(_0xaad8('0xe'));var originateValidation=new Schema({'userId':{'type':_0xaad8('0xf'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0xaad8('0x10')]},'callerId':{'type':_0xaad8('0x11')},'callbackUrl':{'type':_0xaad8('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0xaad8('0xf'),'required':[!![],_0xaad8('0x12')]},'sessionId':{'type':_0xaad8('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xaad8('0xf'),'required':[!![],_0xaad8('0x12')]},'sessionId':{'type':_0xaad8('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xaad8('0x12')]},'sessionId':{'type':_0xaad8('0x11'),'required':[!![],_0xaad8('0x13')]},'transferNumber':{'type':_0xaad8('0x11'),'required':[!![],_0xaad8('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0xaad8('0xf'),'required':[!![],_0xaad8('0x12')]},'sessionId':{'type':_0xaad8('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xaad8('0xf'),'required':[!![],_0xaad8('0x12')]},'sessionId':{'type':_0xaad8('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xaad8('0xf'),'required':[!![],_0xaad8('0x12')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xaad8('0x12')]}});function emit(_0xb63cb3,_0x511344,_0x1749d5){logger[_0xaad8('0x15')](_0xb63cb3,_0x511344,JSON[_0xaad8('0x16')](_0x1749d5));io['to'](_0xb63cb3)[_0xaad8('0x17')](_0x511344,_0x1749d5);}function handleError(_0x19ae08){return function(_0x3895e2){console['log'](_0xaad8('0x18'),_0x3895e2,_0x3895e2 instanceof RangeError);logger[_0xaad8('0x19')](_0x3895e2['stack']);if(_0x3895e2 instanceof RangeError){if(_0x3895e2[_0xaad8('0x1a')]){delete _0x3895e2['name'];}_0x19ae08[_0xaad8('0x1b')](0x194)[_0xaad8('0x1c')](_0x3895e2);}else{if(_0x3895e2[_0xaad8('0x1a')]){delete _0x3895e2[_0xaad8('0x1a')];}_0x19ae08['status'](0x1f4)[_0xaad8('0x1c')](_0x3895e2);}};}function checkError(){return function(_0x2c8fd8){if(!_0x2c8fd8){throw new RangeError('NotFound');}return _0x2c8fd8;};}function respondWithRpcPromise(_0x8bc75,_0x61542a){return new BPromise(function(_0x262e57,_0x5b4b61){var _0x5ba0fb=amiClient;return _0x5ba0fb[_0xaad8('0x1d')](_0x8bc75,_0x61542a)[_0xaad8('0x1e')](function(_0x3930f0){if(_0x3930f0[_0xaad8('0x19')]){if(_0x3930f0[_0xaad8('0x19')][_0xaad8('0x1f')]===0x1f4){return _0x5b4b61(_0x3930f0[_0xaad8('0x19')][_0xaad8('0x20')]);}return _0x262e57(_0x3930f0[_0xaad8('0x19')][_0xaad8('0x20')]);}else{_0x262e57(_0x3930f0[_0xaad8('0x21')]);}})[_0xaad8('0x22')](function(_0x4193cb){_0x5b4b61(_0x4193cb);});});}function getAgent(_0x37c3f6){return db[_0xaad8('0x23')]['findOne']({'where':{'id':_0x37c3f6,'role':_0xaad8('0x24')}})[_0xaad8('0x1e')](checkError());}function getAgentCheckSession(_0x3f066f,_0x47b7a2){return new BPromise(function(_0x237c67,_0x37ca5c){var _0x36b180=respondWithRpcPromise(_0xaad8('0x25'));var _0x24c01d=getAgent(_0x3f066f);Promise['all']([_0x36b180,_0x24c01d])[_0xaad8('0x1e')](function(_0x43c489){var _0x1e253f=_0x43c489[0x0];var _0x31ad19=_0x43c489[0x1];var _0x151c26=_['filter'](_0x1e253f[_0xaad8('0x26')],function(_0x4030ea){return _0x4030ea[_0xaad8('0x27')]==_0x31ad19['id']&&_0x4030ea[_0xaad8('0x28')]==_0x47b7a2;});if(_0x151c26['length']==0x1){_0x237c67(_0x31ad19);}else{_0x37ca5c(new RangeError(_0xaad8('0x29')+_0x47b7a2+_0xaad8('0x2a')));}});});}exports[_0xaad8('0x2b')]=function(_0x1eaf8e,_0x254ee5){logger['info'](_0xaad8('0x2c'),_0x1eaf8e[_0xaad8('0x2d')]);var _0x4845a4=originateValidation['validate'](_0x1eaf8e[_0xaad8('0x2d')]);if(_0x4845a4[_0xaad8('0x2e')]>0x0){return _0x254ee5[_0xaad8('0x1b')](0x190)[_0xaad8('0x2f')](_0x4845a4);}var _0x501ce8=_0x1eaf8e[_0xaad8('0x2d')][_0xaad8('0x30')];var _0x4b6c1a=_0x1eaf8e['body'][_0xaad8('0x31')];var _0x3689cb=_0x1eaf8e['body'][_0xaad8('0x32')];var _0x4fb0ae=_0x1eaf8e['body'][_0xaad8('0x33')];return getAgent(_0x501ce8)[_0xaad8('0x1e')](function(_0x54ab34){logger[_0xaad8('0x15')](_0xaad8('0x34'),_0x54ab34[_0xaad8('0x1a')]);emit(util[_0xaad8('0x35')]('user:%s',_0x54ab34[_0xaad8('0x1a')]),_0xaad8('0x36'),{'callNumber':_0x4b6c1a,'callerId':_0x3689cb,'callbackUrl':_0x4fb0ae});return _0x254ee5[_0xaad8('0x1b')](0xc8)[_0xaad8('0x2f')]({'error':![],'message':_0xaad8('0x37')});})[_0xaad8('0x22')](handleError(_0x254ee5));};exports['hangup']=function(_0x2aea32,_0x3d0244){logger[_0xaad8('0x15')]('hangup\x20fired:',_0x2aea32[_0xaad8('0x2d')]);var _0x39374b=hangupValidation[_0xaad8('0xe')](_0x2aea32[_0xaad8('0x2d')]);if(_0x39374b[_0xaad8('0x2e')]>0x0){return _0x3d0244[_0xaad8('0x1b')](0x190)[_0xaad8('0x2f')](_0x39374b);}var _0x4d3a4f=_0x2aea32[_0xaad8('0x2d')][_0xaad8('0x30')];var _0x3e9af2=_0x2aea32[_0xaad8('0x2d')][_0xaad8('0x28')];return getAgent(_0x4d3a4f)[_0xaad8('0x1e')](function(_0x4e4081){logger[_0xaad8('0x15')](_0xaad8('0x34'),_0x4e4081[_0xaad8('0x1a')]);emit(util[_0xaad8('0x35')]('user:%s',_0x4e4081['name']),'webbar:hangup',{'sessionId':_0x3e9af2});return _0x3d0244[_0xaad8('0x1b')](0xc8)[_0xaad8('0x2f')]({'error':![],'message':_0xaad8('0x38')});})['catch'](handleError(_0x3d0244));};exports[_0xaad8('0x39')]=function(_0x355fc2,_0x4af930){logger[_0xaad8('0x15')](_0xaad8('0x3a'),_0x355fc2[_0xaad8('0x2d')]);var _0x292d4e=answerValidation[_0xaad8('0xe')](_0x355fc2[_0xaad8('0x2d')]);if(_0x292d4e[_0xaad8('0x2e')]>0x0){return _0x4af930[_0xaad8('0x1b')](0x190)[_0xaad8('0x2f')](_0x292d4e);}var _0xbd5191=_0x355fc2[_0xaad8('0x2d')][_0xaad8('0x30')];var _0x4b5b76=_0x355fc2['body']['sessionId'];return getAgent(_0xbd5191)[_0xaad8('0x1e')](function(_0x5b0ad2){logger[_0xaad8('0x15')]('entityFound:',_0x5b0ad2['name']);emit(util[_0xaad8('0x35')]('user:%s',_0x5b0ad2[_0xaad8('0x1a')]),_0xaad8('0x3b'),{'sessionId':_0x4b5b76});return _0x4af930[_0xaad8('0x1b')](0xc8)[_0xaad8('0x2f')]({'error':![],'message':_0xaad8('0x3c')});})[_0xaad8('0x22')](handleError(_0x4af930));};exports[_0xaad8('0x3d')]=function(_0x1f920b,_0x233fd2){logger[_0xaad8('0x15')](_0xaad8('0x3e'),_0x1f920b[_0xaad8('0x2d')]);var _0x14a837=holdValidation[_0xaad8('0xe')](_0x1f920b[_0xaad8('0x2d')]);if(_0x14a837['length']>0x0){return _0x233fd2['status'](0x190)[_0xaad8('0x2f')](_0x14a837);}var _0x42cfa4=_0x1f920b[_0xaad8('0x2d')]['userId'];var _0x5e2117=_0x1f920b[_0xaad8('0x2d')]['sessionId'];return getAgent(_0x42cfa4)[_0xaad8('0x1e')](function(_0x1560ef){logger[_0xaad8('0x15')](_0xaad8('0x34'),_0x1560ef[_0xaad8('0x1a')]);emit(util[_0xaad8('0x35')](_0xaad8('0x3f'),_0x1560ef[_0xaad8('0x1a')]),_0xaad8('0x40'),{'sessionId':_0x5e2117});return _0x233fd2['status'](0xc8)[_0xaad8('0x2f')]({'error':![],'message':_0xaad8('0x41')});})['catch'](handleError(_0x233fd2));};exports[_0xaad8('0x42')]=function(_0x5e5ef1,_0x2a2542){logger[_0xaad8('0x15')](_0xaad8('0x43'),_0x5e5ef1[_0xaad8('0x2d')]);var _0x4068ec=unholdValidation[_0xaad8('0xe')](_0x5e5ef1[_0xaad8('0x2d')]);if(_0x4068ec[_0xaad8('0x2e')]>0x0){return _0x2a2542[_0xaad8('0x1b')](0x190)['json'](_0x4068ec);}var _0x2461f7=_0x5e5ef1[_0xaad8('0x2d')][_0xaad8('0x30')];var _0x13f11d=_0x5e5ef1[_0xaad8('0x2d')][_0xaad8('0x28')];return getAgent(_0x2461f7)['then'](function(_0x1e5127){logger[_0xaad8('0x15')]('entityFound:',_0x1e5127['name']);emit(util[_0xaad8('0x35')](_0xaad8('0x3f'),_0x1e5127[_0xaad8('0x1a')]),_0xaad8('0x44'),{'sessionId':_0x13f11d});return _0x2a2542[_0xaad8('0x1b')](0xc8)[_0xaad8('0x2f')]({'error':![],'message':'unhold\x20executed!'});})[_0xaad8('0x22')](handleError(_0x2a2542));};exports[_0xaad8('0x45')]=function(_0x3e6f4a,_0x1db8c2){logger[_0xaad8('0x15')]('calls\x20fired:',_0x1db8c2['body']);var _0x48edf6=callsValidation[_0xaad8('0xe')](_0x3e6f4a[_0xaad8('0x2d')]);if(_0x48edf6['length']>0x0){return _0x1db8c2[_0xaad8('0x1b')](0x190)[_0xaad8('0x2f')](_0x48edf6);}var _0x78a183=_0x3e6f4a['body'][_0xaad8('0x30')];var _0x49865e=respondWithRpcPromise(_0xaad8('0x25'));var _0x437266=getAgent(_0x78a183);return Promise[_0xaad8('0x46')]([_0x49865e,_0x437266])[_0xaad8('0x1e')](function(_0x5bd83e){var _0x9bb038=_0x5bd83e[0x0];var _0x1fe921=_0x5bd83e[0x1];var _0x5cf106=_['filter'](_0x9bb038[_0xaad8('0x26')],function(_0x4e64f5){return _0x4e64f5[_0xaad8('0x27')]==_0x1fe921['id'];});return _0x1db8c2[_0xaad8('0x1b')](0xc8)[_0xaad8('0x2f')]({'count':_0x5cf106[_0xaad8('0x2e')],'rows':_0x5cf106});})[_0xaad8('0x22')](handleError(_0x1db8c2));};exports[_0xaad8('0x47')]=function(_0x1d55fa,_0x2aaa54){logger[_0xaad8('0x15')]('conference\x20fired:',_0x1d55fa[_0xaad8('0x2d')]);var _0x34044d=conferenceValidation[_0xaad8('0xe')](_0x1d55fa[_0xaad8('0x2d')]);if(_0x34044d[_0xaad8('0x2e')]>0x0){return _0x2aaa54[_0xaad8('0x1b')](0x190)['json'](_0x34044d);}var _0x2abbe7=_0x1d55fa[_0xaad8('0x2d')][_0xaad8('0x30')];return getAgent(_0x2abbe7)['then'](function(_0x585380){logger[_0xaad8('0x15')](_0xaad8('0x34'),_0x585380[_0xaad8('0x1a')]);emit(util[_0xaad8('0x35')]('user:%s',_0x585380[_0xaad8('0x1a')]),_0xaad8('0x48'));return _0x2aaa54[_0xaad8('0x1b')](0xc8)[_0xaad8('0x2f')]({'error':![],'message':_0xaad8('0x49')});})['catch'](handleError(_0x2aaa54));};exports['transfer']=function(_0x2bcb8d,_0xb71d6f){logger[_0xaad8('0x15')](_0xaad8('0x4a'),_0x2bcb8d[_0xaad8('0x2d')]);var _0x739b8=transferValidation['validate'](_0x2bcb8d[_0xaad8('0x2d')]);if(_0x739b8[_0xaad8('0x2e')]>0x0){return _0xb71d6f[_0xaad8('0x1b')](0x190)[_0xaad8('0x2f')](_0x739b8);}var _0x30514f=_0x2bcb8d['body']['userId'];var _0x586a15=_0x2bcb8d[_0xaad8('0x2d')][_0xaad8('0x28')];var _0x500df3=_0x2bcb8d[_0xaad8('0x2d')][_0xaad8('0x4b')];return getAgent(_0x30514f)[_0xaad8('0x1e')](function(_0xe96206){logger[_0xaad8('0x15')]('entityFound:',_0xe96206[_0xaad8('0x1a')]);emit(util[_0xaad8('0x35')](_0xaad8('0x3f'),_0xe96206['name']),_0xaad8('0x4c'),{'sessionId':_0x586a15,'transferNumber':_0x500df3});return _0xb71d6f['status'](0xc8)[_0xaad8('0x2f')]({'error':![],'message':_0xaad8('0x4d')});})['catch'](handleError(_0xb71d6f));}; \ No newline at end of file +var _0x780f=['callerId','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','format','webbar:hangup','hangup\x20executed!','catch','answer','answer\x20fired:','sessionId','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','webbar:conference','conference\x20executed!','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','client','http','../../config/logger','webbarapi','redis','localhost','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','NotFound','request','then','message','User','findOne','agent','VoiceChannels','filter','rows','UserId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber'];(function(_0x27b47a,_0x19127c){var _0x559270=function(_0x5d7c62){while(--_0x5d7c62){_0x27b47a['push'](_0x27b47a['shift']());}};_0x559270(++_0x19127c);}(_0x780f,0x6c));var _0xf780=function(_0x264d4d,_0x118fb5){_0x264d4d=_0x264d4d-0x0;var _0xc917e2=_0x780f[_0x264d4d];return _0xc917e2;};'use strict';var path=require(_0xf780('0x0'));var fs=require('fs');var _=require(_0xf780('0x1'));var db=require(_0xf780('0x2'))['db'];var config=require(_0xf780('0x3'));var util=require(_0xf780('0x4'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0xf780('0x5')][_0xf780('0x6')]({'port':0x232a});var logger=require(_0xf780('0x7'))(_0xf780('0x8'));var Redis=require('ioredis');config[_0xf780('0x9')]=_['defaults'](config[_0xf780('0x9')],{'host':_0xf780('0xa'),'port':0x18eb});var io=require(_0xf780('0xb'))(new Redis(config[_0xf780('0x9')]));var Schema=require(_0xf780('0xc'));var originateValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xf780('0xe'),'required':[!![],_0xf780('0xf')]},'callerId':{'type':_0xf780('0xe')},'callbackUrl':{'type':_0xf780('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],_0xf780('0x10')]},'sessionId':{'type':_0xf780('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf780('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],_0xf780('0x10')]},'sessionId':{'type':_0xf780('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xf780('0xe'),'required':[!![],_0xf780('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],_0xf780('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf780('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],_0xf780('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],_0xf780('0x10')]}});function emit(_0x335ba6,_0x422ef4,_0x51b096){logger[_0xf780('0x12')](_0x335ba6,_0x422ef4,JSON[_0xf780('0x13')](_0x51b096));io['to'](_0x335ba6)[_0xf780('0x14')](_0x422ef4,_0x51b096);}function handleError(_0x113834){return function(_0x5d5a81){console[_0xf780('0x15')]('handleError:',_0x5d5a81,_0x5d5a81 instanceof RangeError);logger[_0xf780('0x16')](_0x5d5a81[_0xf780('0x17')]);if(_0x5d5a81 instanceof RangeError){if(_0x5d5a81['name']){delete _0x5d5a81[_0xf780('0x18')];}_0x113834[_0xf780('0x19')](0x194)['send'](_0x5d5a81);}else{if(_0x5d5a81[_0xf780('0x18')]){delete _0x5d5a81[_0xf780('0x18')];}_0x113834[_0xf780('0x19')](0x1f4)[_0xf780('0x1a')](_0x5d5a81);}};}function checkError(){return function(_0x352cf1){if(!_0x352cf1){throw new RangeError(_0xf780('0x1b'));}return _0x352cf1;};}function respondWithRpcPromise(_0x504f6f,_0xef462a){return new BPromise(function(_0x4de546,_0x5853ea){var _0x45d80e=amiClient;return _0x45d80e[_0xf780('0x1c')](_0x504f6f,_0xef462a)[_0xf780('0x1d')](function(_0x58bb66){if(_0x58bb66[_0xf780('0x16')]){if(_0x58bb66[_0xf780('0x16')]['code']===0x1f4){return _0x5853ea(_0x58bb66[_0xf780('0x16')]['message']);}return _0x4de546(_0x58bb66[_0xf780('0x16')][_0xf780('0x1e')]);}else{_0x4de546(_0x58bb66['result']);}})['catch'](function(_0x3710bb){_0x5853ea(_0x3710bb);});});}function getAgent(_0x1ef4f1){return db[_0xf780('0x1f')][_0xf780('0x20')]({'where':{'id':_0x1ef4f1,'role':_0xf780('0x21')}})[_0xf780('0x1d')](checkError());}function getAgentCheckSession(_0x34d7b3,_0x57e5e8){return new BPromise(function(_0x5a3547,_0x5bd4df){var _0x3f5498=respondWithRpcPromise(_0xf780('0x22'));var _0x26452f=getAgent(_0x34d7b3);Promise['all']([_0x3f5498,_0x26452f])['then'](function(_0x36bc63){var _0x149190=_0x36bc63[0x0];var _0x2b832d=_0x36bc63[0x1];var _0x5e6b25=_[_0xf780('0x23')](_0x149190[_0xf780('0x24')],function(_0x2368e3){return _0x2368e3[_0xf780('0x25')]==_0x2b832d['id']&&_0x2368e3['sessionId']==_0x57e5e8;});if(_0x5e6b25[_0xf780('0x26')]==0x1){_0x5a3547(_0x2b832d);}else{_0x5bd4df(new RangeError('sessionId\x20'+_0x57e5e8+_0xf780('0x27')));}});});}exports[_0xf780('0x28')]=function(_0x244f97,_0x23a019){logger[_0xf780('0x12')](_0xf780('0x29'),_0x244f97[_0xf780('0x2a')]);var _0xc0cc66=originateValidation['validate'](_0x244f97[_0xf780('0x2a')]);if(_0xc0cc66[_0xf780('0x26')]>0x0){return _0x23a019[_0xf780('0x19')](0x190)[_0xf780('0x2b')](_0xc0cc66);}var _0x58bc24=_0x244f97['body'][_0xf780('0x2c')];var _0x49632f=_0x244f97[_0xf780('0x2a')][_0xf780('0x2d')];var _0x3a2a24=_0x244f97['body'][_0xf780('0x2e')];var _0x46893b=_0x244f97[_0xf780('0x2a')][_0xf780('0x2f')];return getAgent(_0x58bc24)['then'](function(_0x46b36a){logger['info'](_0xf780('0x30'),_0x46b36a['name']);emit(util['format'](_0xf780('0x31'),_0x46b36a['name']),_0xf780('0x32'),{'callNumber':_0x49632f,'callerId':_0x3a2a24,'callbackUrl':_0x46893b});return _0x23a019[_0xf780('0x19')](0xc8)[_0xf780('0x2b')]({'error':![],'message':_0xf780('0x33')});})['catch'](handleError(_0x23a019));};exports[_0xf780('0x34')]=function(_0x1765ac,_0x3482f2){logger[_0xf780('0x12')]('hangup\x20fired:',_0x1765ac[_0xf780('0x2a')]);var _0x160cb4=hangupValidation[_0xf780('0xc')](_0x1765ac[_0xf780('0x2a')]);if(_0x160cb4[_0xf780('0x26')]>0x0){return _0x3482f2['status'](0x190)['json'](_0x160cb4);}var _0x3297c9=_0x1765ac[_0xf780('0x2a')][_0xf780('0x2c')];var _0x3fe908=_0x1765ac[_0xf780('0x2a')]['sessionId'];return getAgent(_0x3297c9)[_0xf780('0x1d')](function(_0x511883){logger[_0xf780('0x12')](_0xf780('0x30'),_0x511883[_0xf780('0x18')]);emit(util[_0xf780('0x35')]('user:%s',_0x511883[_0xf780('0x18')]),_0xf780('0x36'),{'sessionId':_0x3fe908});return _0x3482f2[_0xf780('0x19')](0xc8)[_0xf780('0x2b')]({'error':![],'message':_0xf780('0x37')});})[_0xf780('0x38')](handleError(_0x3482f2));};exports[_0xf780('0x39')]=function(_0x1af20f,_0x343635){logger[_0xf780('0x12')](_0xf780('0x3a'),_0x1af20f[_0xf780('0x2a')]);var _0x406a9e=answerValidation[_0xf780('0xc')](_0x1af20f['body']);if(_0x406a9e[_0xf780('0x26')]>0x0){return _0x343635['status'](0x190)[_0xf780('0x2b')](_0x406a9e);}var _0x3bf697=_0x1af20f['body']['userId'];var _0x564c9a=_0x1af20f['body'][_0xf780('0x3b')];return getAgent(_0x3bf697)['then'](function(_0x2c831e){logger[_0xf780('0x12')](_0xf780('0x30'),_0x2c831e[_0xf780('0x18')]);emit(util[_0xf780('0x35')]('user:%s',_0x2c831e['name']),'webbar:answer',{'sessionId':_0x564c9a});return _0x343635['status'](0xc8)[_0xf780('0x2b')]({'error':![],'message':_0xf780('0x3c')});})[_0xf780('0x38')](handleError(_0x343635));};exports[_0xf780('0x3d')]=function(_0xcfee8e,_0x2608ed){logger['info'](_0xf780('0x3e'),_0xcfee8e[_0xf780('0x2a')]);var _0x2a5a7c=holdValidation[_0xf780('0xc')](_0xcfee8e[_0xf780('0x2a')]);if(_0x2a5a7c[_0xf780('0x26')]>0x0){return _0x2608ed['status'](0x190)[_0xf780('0x2b')](_0x2a5a7c);}var _0x5c4170=_0xcfee8e[_0xf780('0x2a')]['userId'];var _0x45fe02=_0xcfee8e['body']['sessionId'];return getAgent(_0x5c4170)[_0xf780('0x1d')](function(_0x72a225){logger[_0xf780('0x12')](_0xf780('0x30'),_0x72a225['name']);emit(util[_0xf780('0x35')](_0xf780('0x31'),_0x72a225[_0xf780('0x18')]),_0xf780('0x3f'),{'sessionId':_0x45fe02});return _0x2608ed[_0xf780('0x19')](0xc8)['json']({'error':![],'message':_0xf780('0x40')});})['catch'](handleError(_0x2608ed));};exports[_0xf780('0x41')]=function(_0x1b492a,_0x22c52d){logger[_0xf780('0x12')](_0xf780('0x42'),_0x1b492a['body']);var _0x48f696=unholdValidation[_0xf780('0xc')](_0x1b492a[_0xf780('0x2a')]);if(_0x48f696[_0xf780('0x26')]>0x0){return _0x22c52d[_0xf780('0x19')](0x190)['json'](_0x48f696);}var _0x4094d5=_0x1b492a[_0xf780('0x2a')][_0xf780('0x2c')];var _0x3f71d2=_0x1b492a[_0xf780('0x2a')][_0xf780('0x3b')];return getAgent(_0x4094d5)['then'](function(_0x2c9932){logger[_0xf780('0x12')]('entityFound:',_0x2c9932[_0xf780('0x18')]);emit(util[_0xf780('0x35')](_0xf780('0x31'),_0x2c9932[_0xf780('0x18')]),_0xf780('0x43'),{'sessionId':_0x3f71d2});return _0x22c52d[_0xf780('0x19')](0xc8)[_0xf780('0x2b')]({'error':![],'message':_0xf780('0x44')});})[_0xf780('0x38')](handleError(_0x22c52d));};exports[_0xf780('0x45')]=function(_0x390bf1,_0x324f74){logger['info'](_0xf780('0x46'),_0x324f74['body']);var _0x1815de=callsValidation[_0xf780('0xc')](_0x390bf1['body']);if(_0x1815de['length']>0x0){return _0x324f74['status'](0x190)[_0xf780('0x2b')](_0x1815de);}var _0x37df9e=_0x390bf1[_0xf780('0x2a')]['userId'];var _0x586ce6=respondWithRpcPromise('VoiceChannels');var _0x1d3cf1=getAgent(_0x37df9e);return Promise['all']([_0x586ce6,_0x1d3cf1])[_0xf780('0x1d')](function(_0xcffb55){var _0x141906=_0xcffb55[0x0];var _0x593c17=_0xcffb55[0x1];var _0x6da9ca=_['filter'](_0x141906[_0xf780('0x24')],function(_0x1aad3a){return _0x1aad3a['UserId']==_0x593c17['id'];});return _0x324f74[_0xf780('0x19')](0xc8)[_0xf780('0x2b')]({'count':_0x6da9ca[_0xf780('0x26')],'rows':_0x6da9ca});})[_0xf780('0x38')](handleError(_0x324f74));};exports[_0xf780('0x47')]=function(_0x308181,_0xd80251){logger['info']('conference\x20fired:',_0x308181[_0xf780('0x2a')]);var _0x3aaba0=conferenceValidation['validate'](_0x308181[_0xf780('0x2a')]);if(_0x3aaba0[_0xf780('0x26')]>0x0){return _0xd80251[_0xf780('0x19')](0x190)[_0xf780('0x2b')](_0x3aaba0);}var _0x4162a6=_0x308181['body']['userId'];return getAgent(_0x4162a6)[_0xf780('0x1d')](function(_0x5f052e){logger[_0xf780('0x12')]('entityFound:',_0x5f052e[_0xf780('0x18')]);emit(util[_0xf780('0x35')](_0xf780('0x31'),_0x5f052e[_0xf780('0x18')]),_0xf780('0x48'));return _0xd80251['status'](0xc8)[_0xf780('0x2b')]({'error':![],'message':_0xf780('0x49')});})[_0xf780('0x38')](handleError(_0xd80251));};exports['transfer']=function(_0x4a61fe,_0x356b63){logger[_0xf780('0x12')](_0xf780('0x4a'),_0x4a61fe['body']);var _0x49f751=transferValidation[_0xf780('0xc')](_0x4a61fe[_0xf780('0x2a')]);if(_0x49f751[_0xf780('0x26')]>0x0){return _0x356b63[_0xf780('0x19')](0x190)[_0xf780('0x2b')](_0x49f751);}var _0x31d999=_0x4a61fe['body'][_0xf780('0x2c')];var _0x33cdcc=_0x4a61fe[_0xf780('0x2a')]['sessionId'];var _0x58f573=_0x4a61fe[_0xf780('0x2a')]['transferNumber'];return getAgent(_0x31d999)[_0xf780('0x1d')](function(_0x18db9f){logger[_0xf780('0x12')](_0xf780('0x30'),_0x18db9f[_0xf780('0x18')]);emit(util[_0xf780('0x35')](_0xf780('0x31'),_0x18db9f[_0xf780('0x18')]),_0xf780('0x4b'),{'sessionId':_0x33cdcc,'transferNumber':_0x58f573});return _0x356b63[_0xf780('0x19')](0xc8)[_0xf780('0x2b')]({'error':![],'message':_0xf780('0x4c')});})[_0xf780('0x38')](handleError(_0x356b63));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 9136e8a..57d8944 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 _0x0b0e=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAgents','notify','put','update','delete','removeDispositions'];(function(_0x560ab6,_0x135692){var _0x5a2e2d=function(_0x271309){while(--_0x271309){_0x560ab6['push'](_0x560ab6['shift']());}};_0x5a2e2d(++_0x135692);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4ee881,_0x10ddc8){_0x4ee881=_0x4ee881-0x0;var _0x305f48=_0x0b0e[_0x4ee881];return _0x305f48;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x9')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x11')]);router[_0xe0b0('0x9')](_0xe0b0('0x12'),auth[_0xe0b0('0xa')](),controller['getApplications']);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x15')]);router['post'](_0xe0b0('0x16'),auth[_0xe0b0('0xa')](),controller['addAnswer']);router[_0xe0b0('0x13')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x17')]);router['post']('/:id/applications',auth[_0xe0b0('0xa')](),controller['addApplications']);router['post']('/:id/notify',controller[_0xe0b0('0x18')]);router['post']('/:id/send',auth[_0xe0b0('0xa')](),controller['send']);router[_0xe0b0('0x19')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1a')]);router[_0xe0b0('0x1b')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['destroy']);router['delete'](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x1c')]);router[_0xe0b0('0x1b')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller['removeAnswers']);router[_0xe0b0('0x1b')]('/:id/users',auth[_0xe0b0('0xa')](),controller['removeAgents']);module[_0xe0b0('0x1d')]=router; \ No newline at end of file +var _0x0b0e=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAgents','notify','put','update','delete','removeDispositions'];(function(_0x4c2875,_0x41aecf){var _0x42f9d3=function(_0x1eb79a){while(--_0x1eb79a){_0x4c2875['push'](_0x4c2875['shift']());}};_0x42f9d3(++_0x41aecf);}(_0x0b0e,0x187));var _0xe0b0=function(_0x27d8bc,_0x19e010){_0x27d8bc=_0x27d8bc-0x0;var _0x4b04cb=_0x0b0e[_0x27d8bc];return _0x4b04cb;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x9')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x11')]);router[_0xe0b0('0x9')](_0xe0b0('0x12'),auth[_0xe0b0('0xa')](),controller['getApplications']);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x15')]);router['post'](_0xe0b0('0x16'),auth[_0xe0b0('0xa')](),controller['addAnswer']);router[_0xe0b0('0x13')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x17')]);router['post']('/:id/applications',auth[_0xe0b0('0xa')](),controller['addApplications']);router['post']('/:id/notify',controller[_0xe0b0('0x18')]);router['post']('/:id/send',auth[_0xe0b0('0xa')](),controller['send']);router[_0xe0b0('0x19')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1a')]);router[_0xe0b0('0x1b')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['destroy']);router['delete'](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x1c')]);router[_0xe0b0('0x1b')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller['removeAnswers']);router[_0xe0b0('0x1b')]('/:id/users',auth[_0xe0b0('0xa')](),controller['removeAgents']);module[_0xe0b0('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index fc3a5ff..b208eb0 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 _0x2429=['name','generate','ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING'];(function(_0x530be0,_0x1a84c8){var _0x2ee1d3=function(_0x47ebe3){while(--_0x47ebe3){_0x530be0['push'](_0x530be0['shift']());}};_0x2ee1d3(++_0x1a84c8);}(_0x2429,0xd0));var _0x9242=function(_0x10bae6,_0x41d85f){_0x10bae6=_0x10bae6-0x0;var _0x251123=_0x2429[_0x10bae6];return _0x251123;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x9242('0x0')]={'name':{'type':Sequelize[_0x9242('0x1')],'unique':_0x9242('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x9242('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x9242('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9242('0x3')]();}},'phone':{'type':Sequelize[_0x9242('0x1')]},'type':{'type':Sequelize[_0x9242('0x4')](_0x9242('0x5'),_0x9242('0x6'))},'accountSid':{'type':Sequelize[_0x9242('0x1')]},'baseUrl':{'type':Sequelize[_0x9242('0x1')]},'authToken':{'type':Sequelize[_0x9242('0x1')]},'notificationTemplate':{'type':Sequelize[_0x9242('0x7')],'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[_0x9242('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9242('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9242('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9242('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9242('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9242('0x9')],'comment':_0x9242('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x9242('0x8')],'defaultValue':![],'comment':_0x9242('0xb'),'set':function(_0x22a7d0){if(!_0x22a7d0){this[_0x9242('0xc')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x9242('0xd'),_0x22a7d0);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x73f6=['twilio','sinch','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','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x352f73,_0x196591){var _0x4a32e0=function(_0x466187){while(--_0x466187){_0x352f73['push'](_0x352f73['shift']());}};_0x4a32e0(++_0x196591);}(_0x73f6,0x1a2));var _0x673f=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x73f6[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require(_0x673f('0x0'));var rs=require(_0x673f('0x1'));module[_0x673f('0x2')]={'name':{'type':Sequelize[_0x673f('0x3')],'unique':_0x673f('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x673f('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x673f('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x673f('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x673f('0x6')](_0x673f('0x7'),_0x673f('0x8'))},'accountSid':{'type':Sequelize[_0x673f('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x673f('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x673f('0x9');}},'notificationSound':{'type':Sequelize[_0x673f('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x673f('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x673f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x673f('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x673f('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x673f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x673f('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x673f('0xa')],'defaultValue':![],'comment':_0x673f('0xd'),'set':function(_0x1c9420){if(!_0x1c9420){this[_0x673f('0xe')](_0x673f('0xf'),null);}this[_0x673f('0xe')](_0x673f('0x10'),_0x1c9420);}},'description':{'type':Sequelize[_0x673f('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index fdc2b00..d54b7a4 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 _0x2d24=['stringify','error','message','result','catch','status','end','limit','undefined','count','offset','Content-Range','reject','update','then','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','name','send','Pause','map','WhatsappAccount','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','priority','stack','finally','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','Sequelize','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','CmList','ListId','Contacts','DESC','omit','contact','WhatsappInteraction','interaction','created','autoclose','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','waitForTheAssignedAgent','startRouting','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a','json','to\x20is\x20mandatory','List','out','Messages','spread','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1d88f8,_0x44bb38){var _0x49b17c=function(_0x215f58){while(--_0x215f58){_0x1d88f8['push'](_0x1d88f8['shift']());}};_0x49b17c(++_0x44bb38);}(_0x2d24,0xa1));var _0x42d2=function(_0x3d8fba,_0x24a47f){_0x3d8fba=_0x3d8fba-0x0;var _0x56103a=_0x2d24[_0x3d8fba];return _0x56103a;};'use strict';var emlformat=require(_0x42d2('0x0'));var rimraf=require(_0x42d2('0x1'));var zipdir=require(_0x42d2('0x2'));var jsonpatch=require(_0x42d2('0x3'));var rp=require(_0x42d2('0x4'));var moment=require('moment');var BPromise=require(_0x42d2('0x5'));var Mustache=require('mustache');var util=require(_0x42d2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x42d2('0x7'));var ejs=require(_0x42d2('0x8'));var fs=require('fs');var fs_extra=require(_0x42d2('0x9'));var _=require(_0x42d2('0xa'));var squel=require(_0x42d2('0xb'));var crypto=require(_0x42d2('0xc'));var jsforce=require(_0x42d2('0xd'));var deskjs=require(_0x42d2('0xe'));var toCsv=require(_0x42d2('0x7'));var querystring=require(_0x42d2('0xf'));var Papa=require(_0x42d2('0x10'));var Redis=require(_0x42d2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x42d2('0x12'));var as=require(_0x42d2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x42d2('0x14'));var config=require(_0x42d2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x42d2('0x16'))['db'];config[_0x42d2('0x17')]=_[_0x42d2('0x18')](config['redis'],{'host':_0x42d2('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x42d2('0x17')]));require(_0x42d2('0x1a'))[_0x42d2('0x1b')](socket);var jayson=require(_0x42d2('0x1c'));var client=jayson[_0x42d2('0x1d')][_0x42d2('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x5ecc27,_0x361a17,_0x460c72,_0x44b0dc){return new BPromise(function(_0xc349b5,_0x14b985){var _0x25074e=_0x44b0dc||client;return _0x25074e[_0x42d2('0x1f')](_0x5ecc27,_0x460c72)['then'](function(_0x149e23){logger[_0x42d2('0x20')](_0x42d2('0x21'),_0x361a17,_0x42d2('0x22'));logger[_0x42d2('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x361a17,_0x42d2('0x22'),JSON[_0x42d2('0x24')](_0x149e23));if(_0x149e23[_0x42d2('0x25')]){if(_0x149e23[_0x42d2('0x25')]['code']===0x1f4){logger[_0x42d2('0x25')](_0x42d2('0x21'),_0x361a17,_0x149e23[_0x42d2('0x25')][_0x42d2('0x26')]);return _0x14b985(_0x149e23[_0x42d2('0x25')][_0x42d2('0x26')]);}logger[_0x42d2('0x25')](_0x42d2('0x21'),_0x361a17,_0x149e23[_0x42d2('0x25')][_0x42d2('0x26')]);return _0xc349b5(_0x149e23[_0x42d2('0x25')][_0x42d2('0x26')]);}else{logger[_0x42d2('0x20')](_0x42d2('0x21'),_0x361a17,_0x42d2('0x22'));_0xc349b5(_0x149e23[_0x42d2('0x27')][_0x42d2('0x26')]);}})[_0x42d2('0x28')](function(_0x5beb6e){logger[_0x42d2('0x25')](_0x42d2('0x21'),_0x361a17,_0x5beb6e);_0x14b985(_0x5beb6e);});});}function respondWithStatusCode(_0x3d7205,_0x18455f){_0x18455f=_0x18455f||0xcc;return function(_0x133100){if(_0x133100){return _0x3d7205['sendStatus'](_0x18455f);}return _0x3d7205[_0x42d2('0x29')](_0x18455f)[_0x42d2('0x2a')]();};}function respondWithResult(_0x386851,_0x4adfbc){_0x4adfbc=_0x4adfbc||0xc8;return function(_0x3811db){if(_0x3811db){return _0x386851[_0x42d2('0x29')](_0x4adfbc)['json'](_0x3811db);}};}function respondWithFilteredResult(_0x3f6533,_0x547403){return function(_0x1850a2){if(_0x1850a2){var _0x8f85ad=typeof _0x547403['offset']==='undefined'&&typeof _0x547403[_0x42d2('0x2b')]===_0x42d2('0x2c');var _0x2f7a17=_0x1850a2[_0x42d2('0x2d')];var _0x129b43=_0x8f85ad?0x0:_0x547403[_0x42d2('0x2e')];var _0x45863e=_0x8f85ad?_0x1850a2[_0x42d2('0x2d')]:_0x547403[_0x42d2('0x2e')]+_0x547403['limit'];var _0x1152b6;if(_0x45863e>=_0x2f7a17){_0x45863e=_0x2f7a17;_0x1152b6=0xc8;}else{_0x1152b6=0xce;}_0x3f6533['status'](_0x1152b6);return _0x3f6533['set'](_0x42d2('0x2f'),_0x129b43+'-'+_0x45863e+'/'+_0x2f7a17)['json'](_0x1850a2);}return null;};}function patchUpdates(_0xc63ff9){return function(_0x37b132){try{jsonpatch['apply'](_0x37b132,_0xc63ff9,!![]);}catch(_0x13f9dd){return BPromise[_0x42d2('0x30')](_0x13f9dd);}return _0x37b132['save']();};}function saveUpdates(_0x19e30a,_0xeb58ed){return function(_0x42b2de){if(_0x42b2de){return _0x42b2de[_0x42d2('0x31')](_0x19e30a)[_0x42d2('0x32')](function(_0x4c3900){return _0x4c3900;});}return null;};}function removeEntity(_0x296465,_0x5f1c41){return function(_0x110e63){if(_0x110e63){return _0x110e63[_0x42d2('0x33')]()['then'](function(){var _0x3b667c=_0x110e63[_0x42d2('0x34')]({'plain':!![]});var _0x3aff9a=_0x42d2('0x35');return db[_0x42d2('0x36')][_0x42d2('0x33')]({'where':{'type':_0x3aff9a,'resourceId':_0x3b667c['id']}})['then'](function(){return _0x110e63;});})[_0x42d2('0x32')](function(){_0x296465[_0x42d2('0x29')](0xcc)[_0x42d2('0x2a')]();});}};}function handleEntityNotFound(_0x6ccb08,_0xa58752){return function(_0x8f9738){if(!_0x8f9738){_0x6ccb08[_0x42d2('0x37')](0x194);}return _0x8f9738;};}function handleError(_0x1202b7,_0x57a58e){_0x57a58e=_0x57a58e||0x1f4;return function(_0x302969){logger[_0x42d2('0x25')](_0x302969['stack']);if(_0x302969[_0x42d2('0x38')]){delete _0x302969[_0x42d2('0x38')];}_0x1202b7[_0x42d2('0x29')](_0x57a58e)[_0x42d2('0x39')](_0x302969);};}exports['index']=function(_0x892d7d,_0x213aa3){var _0x26328f={'include':[{'model':db[_0x42d2('0x3a')],'as':'mandatoryDispositionPause'}]},_0x3d1f99={},_0x516da9={'count':0x0,'rows':[]};var _0x368567=_[_0x42d2('0x3b')](db[_0x42d2('0x3c')][_0x42d2('0x3d')],function(_0x1addcc){return{'name':_0x1addcc['fieldName'],'type':_0x1addcc[_0x42d2('0x3e')]['key']};});_0x3d1f99[_0x42d2('0x3f')]=_[_0x42d2('0x3b')](_0x368567,_0x42d2('0x38'));_0x3d1f99[_0x42d2('0x40')]=_['keys'](_0x892d7d[_0x42d2('0x40')]);_0x3d1f99[_0x42d2('0x41')]=_[_0x42d2('0x42')](_0x3d1f99[_0x42d2('0x3f')],_0x3d1f99[_0x42d2('0x40')]);_0x26328f[_0x42d2('0x43')]=_['intersection'](_0x3d1f99[_0x42d2('0x3f')],qs[_0x42d2('0x44')](_0x892d7d[_0x42d2('0x40')][_0x42d2('0x44')]));_0x26328f['attributes']=_0x26328f[_0x42d2('0x43')][_0x42d2('0x45')]?_0x26328f[_0x42d2('0x43')]:_0x3d1f99[_0x42d2('0x3f')];if(!_0x892d7d[_0x42d2('0x40')][_0x42d2('0x46')](_0x42d2('0x47'))){_0x26328f[_0x42d2('0x2b')]=qs[_0x42d2('0x2b')](_0x892d7d[_0x42d2('0x40')][_0x42d2('0x2b')]);_0x26328f[_0x42d2('0x2e')]=qs[_0x42d2('0x2e')](_0x892d7d['query'][_0x42d2('0x2e')]);}_0x26328f[_0x42d2('0x48')]=qs[_0x42d2('0x49')](_0x892d7d[_0x42d2('0x40')]['sort']);_0x26328f[_0x42d2('0x4a')]=qs[_0x42d2('0x41')](_[_0x42d2('0x4b')](_0x892d7d[_0x42d2('0x40')],_0x3d1f99[_0x42d2('0x41')]),_0x368567);if(_0x892d7d['query'][_0x42d2('0x4c')]){_0x26328f[_0x42d2('0x4a')]=_[_0x42d2('0x4d')](_0x26328f['where'],{'$or':_[_0x42d2('0x3b')](_0x368567,function(_0x410ddd){if(_0x410ddd[_0x42d2('0x3e')]!==_0x42d2('0x4e')){var _0x13815e={};_0x13815e[_0x410ddd[_0x42d2('0x38')]]={'$like':'%'+_0x892d7d[_0x42d2('0x40')]['filter']+'%'};return _0x13815e;}})});}_0x26328f=_['merge']({},_0x26328f,_0x892d7d[_0x42d2('0x4f')]);var _0x1536a0={'where':_0x26328f[_0x42d2('0x4a')]};return db[_0x42d2('0x3c')][_0x42d2('0x2d')](_0x1536a0)[_0x42d2('0x32')](function(_0x109e90){_0x516da9[_0x42d2('0x2d')]=_0x109e90;if(_0x892d7d['query'][_0x42d2('0x50')]){_0x26328f[_0x42d2('0x51')]=[{'all':!![]}];}return db[_0x42d2('0x3c')][_0x42d2('0x52')](_0x26328f);})['then'](function(_0x1ed8e7){_0x516da9[_0x42d2('0x53')]=_0x1ed8e7;return _0x516da9;})[_0x42d2('0x32')](respondWithFilteredResult(_0x213aa3,_0x26328f))[_0x42d2('0x28')](handleError(_0x213aa3,null));};exports[_0x42d2('0x54')]=function(_0x2000d5,_0x435346){var _0x5d040f={'raw':![],'where':{'id':_0x2000d5[_0x42d2('0x55')]['id']},'include':[{'model':db[_0x42d2('0x3a')],'as':_0x42d2('0x56')}]},_0x566c60={};_0x566c60[_0x42d2('0x3f')]=_['keys'](db[_0x42d2('0x3c')][_0x42d2('0x3d')]);_0x566c60[_0x42d2('0x40')]=_[_0x42d2('0x57')](_0x2000d5['query']);_0x566c60[_0x42d2('0x41')]=_[_0x42d2('0x42')](_0x566c60['model'],_0x566c60[_0x42d2('0x40')]);_0x5d040f['attributes']=_[_0x42d2('0x42')](_0x566c60[_0x42d2('0x3f')],qs[_0x42d2('0x44')](_0x2000d5['query'][_0x42d2('0x44')]));_0x5d040f[_0x42d2('0x43')]=_0x5d040f[_0x42d2('0x43')][_0x42d2('0x45')]?_0x5d040f[_0x42d2('0x43')]:_0x566c60[_0x42d2('0x3f')];if(_0x2000d5['query'][_0x42d2('0x50')]){_0x5d040f[_0x42d2('0x51')]=[{'all':!![]}];}_0x5d040f=_[_0x42d2('0x4d')]({},_0x5d040f,_0x2000d5[_0x42d2('0x4f')]);return db[_0x42d2('0x3c')][_0x42d2('0x58')](_0x5d040f)[_0x42d2('0x32')](handleEntityNotFound(_0x435346,null))[_0x42d2('0x32')](respondWithResult(_0x435346,null))[_0x42d2('0x28')](handleError(_0x435346,null));};exports[_0x42d2('0x59')]=function(_0x5f2e4f,_0x1e2ed6){return db['WhatsappAccount'][_0x42d2('0x59')](_0x5f2e4f[_0x42d2('0x5a')],{})['then'](function(_0x5df633){var _0x15b06b=_0x5f2e4f[_0x42d2('0x5b')][_0x42d2('0x34')]({'plain':!![]});if(!_0x15b06b)throw new Error(_0x42d2('0x5c'));if(_0x15b06b['role']===_0x42d2('0x5b')){var _0x316618=_0x5df633[_0x42d2('0x34')]({'plain':!![]});var _0x34748c='WhatsappAccounts';return db[_0x42d2('0x5d')][_0x42d2('0x58')]({'where':{'name':_0x34748c,'userProfileId':_0x15b06b[_0x42d2('0x5e')]},'raw':!![]})[_0x42d2('0x32')](function(_0x3f9c88){if(_0x3f9c88&&_0x3f9c88[_0x42d2('0x5f')]===0x0){return db[_0x42d2('0x36')][_0x42d2('0x59')]({'name':_0x316618[_0x42d2('0x38')],'resourceId':_0x316618['id'],'type':_0x3f9c88[_0x42d2('0x38')],'sectionId':_0x3f9c88['id']},{})[_0x42d2('0x32')](function(){return _0x5df633;});}else{return _0x5df633;}})[_0x42d2('0x28')](function(_0x49841f){logger[_0x42d2('0x25')](_0x42d2('0x60'),_0x49841f);throw _0x49841f;});}return _0x5df633;})['then'](respondWithResult(_0x1e2ed6,0xc9))[_0x42d2('0x28')](handleError(_0x1e2ed6,null));};exports[_0x42d2('0x31')]=function(_0x2d1df3,_0x53c21a){if(_0x2d1df3[_0x42d2('0x5a')]['id']){delete _0x2d1df3[_0x42d2('0x5a')]['id'];}return db['WhatsappAccount'][_0x42d2('0x58')]({'where':{'id':_0x2d1df3['params']['id']},'include':[{'model':db[_0x42d2('0x3a')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x53c21a,null))[_0x42d2('0x32')](saveUpdates(_0x2d1df3[_0x42d2('0x5a')],null))[_0x42d2('0x32')](respondWithResult(_0x53c21a,null))[_0x42d2('0x28')](handleError(_0x53c21a,null));};exports[_0x42d2('0x33')]=function(_0x140118,_0x1ea6f1){return db[_0x42d2('0x3c')]['find']({'where':{'id':_0x140118[_0x42d2('0x55')]['id']}})['then'](handleEntityNotFound(_0x1ea6f1,null))[_0x42d2('0x32')](removeEntity(_0x1ea6f1,null))[_0x42d2('0x28')](handleError(_0x1ea6f1,null));};exports[_0x42d2('0x61')]=function(_0x57fedb,_0x44d54d){return db[_0x42d2('0x3c')]['describe']()['then'](respondWithResult(_0x44d54d,null))['catch'](handleError(_0x44d54d,null));};exports[_0x42d2('0x62')]=function(_0x11530d,_0x34a435,_0x13a287){if(_0x11530d['body']['id']){delete _0x11530d[_0x42d2('0x5a')]['id'];}return db['WhatsappAccount'][_0x42d2('0x58')]({'where':{'id':_0x11530d[_0x42d2('0x55')]['id']}})[_0x42d2('0x32')](handleEntityNotFound(_0x34a435,null))[_0x42d2('0x32')](function(_0x49aa3e){if(_0x49aa3e){_0x11530d[_0x42d2('0x5a')][_0x42d2('0x63')]=_0x49aa3e['id'];return db['Disposition'][_0x42d2('0x59')](_0x11530d['body']);}})['then'](respondWithResult(_0x34a435,null))['catch'](handleError(_0x34a435,null));};exports[_0x42d2('0x64')]=function(_0x5ca703,_0x34e78c,_0x2c0175){var _0x549ef3={'raw':![],'where':{}};var _0x21c35b={};var _0x104f58={'count':0x0,'rows':[]};return db[_0x42d2('0x3c')][_0x42d2('0x65')]({'where':{'id':_0x5ca703[_0x42d2('0x55')]['id']}})[_0x42d2('0x32')](handleEntityNotFound(_0x34e78c,null))['then'](function(_0x46c1a1){if(_0x46c1a1){_0x21c35b[_0x42d2('0x3f')]=_[_0x42d2('0x57')](db[_0x42d2('0x66')][_0x42d2('0x3d')]);_0x21c35b[_0x42d2('0x40')]=_['keys'](_0x5ca703['query']);_0x21c35b[_0x42d2('0x41')]=_[_0x42d2('0x42')](_0x21c35b[_0x42d2('0x3f')],_0x21c35b['query']);_0x549ef3[_0x42d2('0x43')]=_[_0x42d2('0x42')](_0x21c35b[_0x42d2('0x3f')],qs[_0x42d2('0x44')](_0x5ca703[_0x42d2('0x40')][_0x42d2('0x44')]));_0x549ef3[_0x42d2('0x43')]=_0x549ef3[_0x42d2('0x43')][_0x42d2('0x45')]?_0x549ef3[_0x42d2('0x43')]:_0x21c35b[_0x42d2('0x3f')];if(!_0x5ca703[_0x42d2('0x40')][_0x42d2('0x46')](_0x42d2('0x47'))){_0x549ef3[_0x42d2('0x2b')]=qs[_0x42d2('0x2b')](_0x5ca703[_0x42d2('0x40')][_0x42d2('0x2b')]);_0x549ef3[_0x42d2('0x2e')]=qs[_0x42d2('0x2e')](_0x5ca703['query'][_0x42d2('0x2e')]);}_0x549ef3['order']=qs[_0x42d2('0x49')](_0x5ca703[_0x42d2('0x40')][_0x42d2('0x49')]);_0x549ef3[_0x42d2('0x4a')]=qs[_0x42d2('0x41')](_['pick'](_0x5ca703[_0x42d2('0x40')],_0x21c35b[_0x42d2('0x41')]));_0x549ef3[_0x42d2('0x4a')][_0x42d2('0x63')]=_0x46c1a1['id'];if(_0x5ca703[_0x42d2('0x40')][_0x42d2('0x4c')]){_0x549ef3[_0x42d2('0x4a')]=_['merge'](_0x549ef3[_0x42d2('0x4a')],{'$or':_[_0x42d2('0x3b')](_0x549ef3[_0x42d2('0x43')],function(_0x4ae958){var _0x27aae1={};_0x27aae1[_0x4ae958]={'$like':'%'+_0x5ca703['query']['filter']+'%'};return _0x27aae1;})});}_0x549ef3=_['merge']({},_0x549ef3,_0x5ca703['options']);return db[_0x42d2('0x66')][_0x42d2('0x2d')]({'where':_0x549ef3['where']})['then'](function(_0x26dfaa){_0x104f58[_0x42d2('0x2d')]=_0x26dfaa;if(_0x5ca703[_0x42d2('0x40')]['includeAll']){_0x549ef3['include']=[{'all':!![]}];}return db['Disposition'][_0x42d2('0x52')](_0x549ef3);})[_0x42d2('0x32')](function(_0x36222f){_0x104f58[_0x42d2('0x53')]=_0x36222f;return _0x104f58;});}})[_0x42d2('0x32')](respondWithFilteredResult(_0x34e78c,_0x549ef3))[_0x42d2('0x28')](handleError(_0x34e78c,null));};exports[_0x42d2('0x67')]=function(_0x37117e,_0x387bd9,_0xf99690){return db[_0x42d2('0x3c')][_0x42d2('0x58')]({'where':{'id':_0x37117e[_0x42d2('0x55')]['id']}})['then'](handleEntityNotFound(_0x387bd9,null))[_0x42d2('0x32')](function(_0x24d2d4){if(_0x24d2d4){return _0x24d2d4['removeDispositions'](_0x37117e[_0x42d2('0x40')][_0x42d2('0x68')]);}})[_0x42d2('0x32')](respondWithStatusCode(_0x387bd9,null))[_0x42d2('0x28')](handleError(_0x387bd9,null));};exports[_0x42d2('0x69')]=function(_0x3db8d1,_0x4b413f,_0x2973a8){if(_0x3db8d1[_0x42d2('0x5a')]['id']){delete _0x3db8d1[_0x42d2('0x5a')]['id'];}return db['WhatsappAccount'][_0x42d2('0x58')]({'where':{'id':_0x3db8d1['params']['id']}})[_0x42d2('0x32')](handleEntityNotFound(_0x4b413f,null))['then'](function(_0x2f784c){if(_0x2f784c){_0x3db8d1[_0x42d2('0x5a')][_0x42d2('0x63')]=_0x2f784c['id'];return db[_0x42d2('0x6a')][_0x42d2('0x59')](_0x3db8d1[_0x42d2('0x5a')]);}})[_0x42d2('0x32')](respondWithResult(_0x4b413f,null))['catch'](handleError(_0x4b413f,null));};exports[_0x42d2('0x6b')]=function(_0x5a4257,_0x2440c8,_0x5761e5){var _0x42c35e={'raw':![],'where':{}};var _0x91b080={};var _0x97921c={'count':0x0,'rows':[]};return db[_0x42d2('0x3c')]['findOne']({'where':{'id':_0x5a4257['params']['id']}})[_0x42d2('0x32')](handleEntityNotFound(_0x2440c8,null))[_0x42d2('0x32')](function(_0x2f2c2b){if(_0x2f2c2b){_0x91b080[_0x42d2('0x3f')]=_[_0x42d2('0x57')](db['CannedAnswer'][_0x42d2('0x3d')]);_0x91b080['query']=_[_0x42d2('0x57')](_0x5a4257[_0x42d2('0x40')]);_0x91b080[_0x42d2('0x41')]=_['intersection'](_0x91b080[_0x42d2('0x3f')],_0x91b080[_0x42d2('0x40')]);_0x42c35e[_0x42d2('0x43')]=_[_0x42d2('0x42')](_0x91b080[_0x42d2('0x3f')],qs['fields'](_0x5a4257['query'][_0x42d2('0x44')]));_0x42c35e[_0x42d2('0x43')]=_0x42c35e['attributes'][_0x42d2('0x45')]?_0x42c35e[_0x42d2('0x43')]:_0x91b080[_0x42d2('0x3f')];if(!_0x5a4257[_0x42d2('0x40')][_0x42d2('0x46')]('nolimit')){_0x42c35e[_0x42d2('0x2b')]=qs[_0x42d2('0x2b')](_0x5a4257[_0x42d2('0x40')][_0x42d2('0x2b')]);_0x42c35e[_0x42d2('0x2e')]=qs[_0x42d2('0x2e')](_0x5a4257[_0x42d2('0x40')][_0x42d2('0x2e')]);}_0x42c35e[_0x42d2('0x48')]=qs['sort'](_0x5a4257['query'][_0x42d2('0x49')]);_0x42c35e['where']=qs[_0x42d2('0x41')](_[_0x42d2('0x4b')](_0x5a4257[_0x42d2('0x40')],_0x91b080[_0x42d2('0x41')]));_0x42c35e[_0x42d2('0x4a')][_0x42d2('0x63')]=_0x2f2c2b['id'];if(_0x5a4257[_0x42d2('0x40')][_0x42d2('0x4c')]){_0x42c35e[_0x42d2('0x4a')]=_[_0x42d2('0x4d')](_0x42c35e[_0x42d2('0x4a')],{'$or':_[_0x42d2('0x3b')](_0x42c35e[_0x42d2('0x43')],function(_0x4d0da0){var _0x264a69={};_0x264a69[_0x4d0da0]={'$like':'%'+_0x5a4257[_0x42d2('0x40')][_0x42d2('0x4c')]+'%'};return _0x264a69;})});}_0x42c35e=_[_0x42d2('0x4d')]({},_0x42c35e,_0x5a4257[_0x42d2('0x4f')]);return db[_0x42d2('0x6a')]['count']({'where':_0x42c35e[_0x42d2('0x4a')]})[_0x42d2('0x32')](function(_0x44ab9c){_0x97921c['count']=_0x44ab9c;if(_0x5a4257[_0x42d2('0x40')]['includeAll']){_0x42c35e['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x42d2('0x52')](_0x42c35e);})['then'](function(_0x5ef8b4){_0x97921c['rows']=_0x5ef8b4;return _0x97921c;});}})['then'](respondWithFilteredResult(_0x2440c8,_0x42c35e))[_0x42d2('0x28')](handleError(_0x2440c8,null));};exports[_0x42d2('0x6c')]=function(_0x2276f4,_0x2703b4,_0x553d47){return db[_0x42d2('0x3c')]['find']({'where':{'id':_0x2276f4[_0x42d2('0x55')]['id']}})[_0x42d2('0x32')](handleEntityNotFound(_0x2703b4,null))[_0x42d2('0x32')](function(_0x5bc133){if(_0x5bc133){return _0x5bc133[_0x42d2('0x6c')](_0x2276f4[_0x42d2('0x40')][_0x42d2('0x68')]);}})[_0x42d2('0x32')](respondWithStatusCode(_0x2703b4,null))[_0x42d2('0x28')](handleError(_0x2703b4,null));};exports['addAgents']=function(_0x2e9059,_0x1ea5bd,_0x5159f1){return db[_0x42d2('0x3c')][_0x42d2('0x58')]({'where':{'id':_0x2e9059[_0x42d2('0x55')]['id']}})[_0x42d2('0x32')](handleEntityNotFound(_0x1ea5bd,null))[_0x42d2('0x32')](function(_0x44de3b){if(_0x44de3b){return _0x44de3b[_0x42d2('0x6d')](_0x2e9059[_0x42d2('0x5a')][_0x42d2('0x68')],_['omit'](_0x2e9059[_0x42d2('0x5a')],[_0x42d2('0x68'),'id'])||{})['spread'](function(_0x382909){for(var _0x81e893=0x0;_0x81e893<_0x2e9059[_0x42d2('0x5a')]['ids'][_0x42d2('0x45')];_0x81e893+=0x1){socket[_0x42d2('0x6e')](_0x42d2('0x6f'),{'UserId':Number(_0x2e9059[_0x42d2('0x5a')][_0x42d2('0x68')][_0x81e893]),'WhatsappAccountId':Number(_0x2e9059[_0x42d2('0x55')]['id'])});}return _0x382909;});}})['then'](respondWithResult(_0x1ea5bd,null))['catch'](handleError(_0x1ea5bd,null));};exports[_0x42d2('0x70')]=function(_0x229c97,_0x434c07,_0x26dda7){return db[_0x42d2('0x3c')]['find']({'where':{'id':_0x229c97['params']['id']}})[_0x42d2('0x32')](handleEntityNotFound(_0x434c07,null))['then'](function(_0x3f134b){if(_0x3f134b){return _0x3f134b[_0x42d2('0x70')](_0x229c97[_0x42d2('0x40')][_0x42d2('0x68')])['then'](function(){if(_[_0x42d2('0x71')](_0x229c97[_0x42d2('0x40')][_0x42d2('0x68')])){for(var _0x27f0f9=0x0;_0x27f0f9<_0x229c97[_0x42d2('0x40')][_0x42d2('0x68')][_0x42d2('0x45')];_0x27f0f9+=0x1){socket[_0x42d2('0x6e')](_0x42d2('0x72'),{'UserId':Number(_0x229c97[_0x42d2('0x40')]['ids'][_0x27f0f9]),'WhatsappAccountId':Number(_0x229c97[_0x42d2('0x55')]['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x229c97[_0x42d2('0x40')][_0x42d2('0x68')]),'WhatsappAccountId':Number(_0x229c97['params']['id'])});}});}})['then'](respondWithStatusCode(_0x434c07,null))[_0x42d2('0x28')](handleError(_0x434c07,null));};exports[_0x42d2('0x73')]=function(_0x5da650,_0x31114e,_0x14245a){var _0x362d96={};var _0x19df25={};var _0x91b1e6;var _0x384b2d;return db[_0x42d2('0x3c')][_0x42d2('0x65')]({'where':{'id':_0x5da650[_0x42d2('0x55')]['id']}})[_0x42d2('0x32')](handleEntityNotFound(_0x31114e,null))[_0x42d2('0x32')](function(_0x2ff205){if(_0x2ff205){_0x91b1e6=_0x2ff205;_0x19df25[_0x42d2('0x3f')]=_[_0x42d2('0x57')](db[_0x42d2('0x74')][_0x42d2('0x3d')]);_0x19df25[_0x42d2('0x40')]=_[_0x42d2('0x57')](_0x5da650[_0x42d2('0x40')]);_0x19df25['filters']=_['intersection'](_0x19df25[_0x42d2('0x3f')],_0x19df25['query']);_0x362d96[_0x42d2('0x43')]=_['intersection'](_0x19df25['model'],qs[_0x42d2('0x44')](_0x5da650[_0x42d2('0x40')][_0x42d2('0x44')]));_0x362d96[_0x42d2('0x43')]=_0x362d96['attributes'][_0x42d2('0x45')]?_0x362d96['attributes']:_0x19df25[_0x42d2('0x3f')];_0x362d96[_0x42d2('0x48')]=qs['sort'](_0x5da650[_0x42d2('0x40')][_0x42d2('0x49')]);_0x362d96[_0x42d2('0x4a')]=qs['filters'](_[_0x42d2('0x4b')](_0x5da650[_0x42d2('0x40')],_0x19df25['filters']));if(_0x5da650[_0x42d2('0x40')][_0x42d2('0x4c')]){_0x362d96[_0x42d2('0x4a')]=_[_0x42d2('0x4d')](_0x362d96[_0x42d2('0x4a')],{'$or':_[_0x42d2('0x3b')](_0x362d96['attributes'],function(_0x58443c){var _0x50b9c9={};_0x50b9c9[_0x58443c]={'$like':'%'+_0x5da650[_0x42d2('0x40')][_0x42d2('0x4c')]+'%'};return _0x50b9c9;})});}_0x362d96=_['merge']({},_0x362d96,_0x5da650[_0x42d2('0x4f')]);return _0x91b1e6[_0x42d2('0x73')](_0x362d96);}})[_0x42d2('0x32')](function(_0x25bf1b){if(_0x25bf1b){_0x384b2d=_0x25bf1b[_0x42d2('0x45')];if(!_0x5da650[_0x42d2('0x40')][_0x42d2('0x46')](_0x42d2('0x47'))){_0x362d96[_0x42d2('0x2b')]=qs['limit'](_0x5da650[_0x42d2('0x40')][_0x42d2('0x2b')]);_0x362d96[_0x42d2('0x2e')]=qs[_0x42d2('0x2e')](_0x5da650['query'][_0x42d2('0x2e')]);}return _0x91b1e6['getAgents'](_0x362d96);}})[_0x42d2('0x32')](function(_0x49ffd4){if(_0x49ffd4){return _0x49ffd4?{'count':_0x384b2d,'rows':_0x49ffd4}:null;}})[_0x42d2('0x32')](respondWithResult(_0x31114e,null))[_0x42d2('0x28')](handleError(_0x31114e,null));};exports[_0x42d2('0x75')]=function(_0x1d2002,_0x40d467){var _0x5efb21=_0x1d2002['params']['id'];var _0x512616=_0x1d2002[_0x42d2('0x5a')];var _0x409e0b=0xc8;var _0x4e1b1b=null;return db[_0x42d2('0x76')][_0x42d2('0x77')]({'isolationLevel':db[_0x42d2('0x76')][_0x42d2('0x78')][_0x42d2('0x79')][_0x42d2('0x7a')]},function(_0x1a328c){return db[_0x42d2('0x3c')][_0x42d2('0x65')]({'where':{'id':_0x5efb21},'transaction':_0x1a328c})[_0x42d2('0x32')](function(_0xb55bf6){if(_0xb55bf6){return db[_0x42d2('0x7b')]['destroy']({'where':{'WhatsappAccountId':_0x5efb21},'transaction':_0x1a328c})[_0x42d2('0x32')](function(){var _0x101a9c=_[_0x42d2('0x3b')](_0x512616,function(_0x1749e7){_0x1749e7[_0x42d2('0x63')]=_0x5efb21;return _0x1749e7;});return db[_0x42d2('0x7b')]['bulkCreate'](_0x101a9c,{'transaction':_0x1a328c});});}else{_0x409e0b=0x194;_0x4e1b1b=[];}});})['then'](function(){if(_0x409e0b!==0x194){return db[_0x42d2('0x7b')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x5efb21},'order':_0x42d2('0x7c')})[_0x42d2('0x32')](function(_0x5c7172){_0x4e1b1b=_0x5c7172;});}})[_0x42d2('0x28')](function(_0x5c7062){_0x409e0b=0x1f4;logger['error'](_0x5c7062[_0x42d2('0x7d')]);if(_0x5c7062[_0x42d2('0x38')]){delete _0x5c7062[_0x42d2('0x38')];}_0x4e1b1b=_0x5c7062;})[_0x42d2('0x7e')](function(){if(_0x4e1b1b===null){_0x40d467[_0x42d2('0x37')](_0x409e0b);}else{if(_0x409e0b===0x1f4){_0x40d467[_0x42d2('0x29')](_0x409e0b)[_0x42d2('0x39')](_0x4e1b1b);}else{_0x40d467[_0x42d2('0x29')](_0x409e0b)['json'](_0x4e1b1b);}}});};exports['getApplications']=function(_0x3db2d7,_0x7be6b9,_0x2fecb1){var _0xbb914a={};var _0xcdb56e={};var _0x4f5c9a;var _0x34dcf2;return db['WhatsappAccount']['findOne']({'where':{'id':_0x3db2d7['params']['id']}})[_0x42d2('0x32')](handleEntityNotFound(_0x7be6b9,null))['then'](function(_0x3f95c4){if(_0x3f95c4){_0x4f5c9a=_0x3f95c4;_0xcdb56e['model']=_[_0x42d2('0x57')](db[_0x42d2('0x7b')][_0x42d2('0x3d')]);_0xcdb56e[_0x42d2('0x40')]=_[_0x42d2('0x57')](_0x3db2d7[_0x42d2('0x40')]);_0xcdb56e[_0x42d2('0x41')]=_[_0x42d2('0x42')](_0xcdb56e['model'],_0xcdb56e['query']);_0xbb914a[_0x42d2('0x43')]=_[_0x42d2('0x42')](_0xcdb56e[_0x42d2('0x3f')],qs['fields'](_0x3db2d7[_0x42d2('0x40')]['fields']));_0xbb914a[_0x42d2('0x43')]=_0xbb914a[_0x42d2('0x43')][_0x42d2('0x45')]?_0xbb914a[_0x42d2('0x43')]:_0xcdb56e[_0x42d2('0x3f')];_0xbb914a[_0x42d2('0x48')]=qs[_0x42d2('0x49')](_0x3db2d7[_0x42d2('0x40')]['sort']);_0xbb914a[_0x42d2('0x4a')]=qs[_0x42d2('0x41')](_[_0x42d2('0x4b')](_0x3db2d7[_0x42d2('0x40')],_0xcdb56e[_0x42d2('0x41')]));if(_0x3db2d7['query'][_0x42d2('0x4c')]){_0xbb914a[_0x42d2('0x4a')]=_[_0x42d2('0x4d')](_0xbb914a['where'],{'$or':_['map'](_0xbb914a['attributes'],function(_0x3570bb){var _0x3d4623={};_0x3d4623[_0x3570bb]={'$like':'%'+_0x3db2d7['query'][_0x42d2('0x4c')]+'%'};return _0x3d4623;})});}_0xbb914a=_[_0x42d2('0x4d')]({},_0xbb914a,_0x3db2d7[_0x42d2('0x4f')]);return _0x4f5c9a[_0x42d2('0x7f')](_0xbb914a);}})[_0x42d2('0x32')](function(_0x3b695b){if(_0x3b695b){_0x34dcf2=_0x3b695b[_0x42d2('0x45')];if(!_0x3db2d7[_0x42d2('0x40')]['hasOwnProperty'](_0x42d2('0x47'))){_0xbb914a['limit']=qs[_0x42d2('0x2b')](_0x3db2d7['query'][_0x42d2('0x2b')]);_0xbb914a[_0x42d2('0x2e')]=qs['offset'](_0x3db2d7['query'][_0x42d2('0x2e')]);}return _0x4f5c9a[_0x42d2('0x7f')](_0xbb914a);}})[_0x42d2('0x32')](function(_0x26ecc7){if(_0x26ecc7){return _0x26ecc7?{'count':_0x34dcf2,'rows':_0x26ecc7}:null;}})[_0x42d2('0x32')](respondWithResult(_0x7be6b9,null))[_0x42d2('0x28')](handleError(_0x7be6b9,null));};exports[_0x42d2('0x80')]=function(_0x30f45b,_0x4817a5,_0x586307){var _0x5013b3={'channel':'whatsapp'};var _0x4998dd=[];var _0x3d8cc3=[];var _0x3f971c={};return db[_0x42d2('0x3c')][_0x42d2('0x58')]({'where':{'id':_0x30f45b[_0x42d2('0x55')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x42d2('0x81')}]})[_0x42d2('0x32')](handleEntityNotFound(_0x4817a5,null))[_0x42d2('0x32')](function(_0x1f36d7){_0x5013b3[_0x42d2('0x82')]=_0x1f36d7;if(_0x5013b3['account']&&_0x5013b3[_0x42d2('0x82')][_0x42d2('0x3e')]===_0x42d2('0x83')&&_0x30f45b[_0x42d2('0x5a')][_0x42d2('0x84')]){if(_0x30f45b[_0x42d2('0x5a')][_0x42d2('0x84')][_0x42d2('0x45')]===0x0)return;if(_0x30f45b[_0x42d2('0x5a')][_0x42d2('0x84')][0x0][_0x42d2('0x85')]!==_0x42d2('0x86'))return;return db[_0x42d2('0x87')][_0x42d2('0x31')]({'read':!![],'readAt':_0x30f45b[_0x42d2('0x5a')]['statuses'][0x0][_0x42d2('0x88')]},{'where':{'messageId':_0x30f45b[_0x42d2('0x5a')][_0x42d2('0x84')][0x0][_0x42d2('0x89')]},'individualHooks':!![]})[_0x42d2('0x32')](function(_0x54286d){return _0x4817a5['status'](0xc8)['json'](_0x54286d);});}_0x5013b3[_0x42d2('0x8a')]=_['orderBy'](_0x1f36d7[_0x42d2('0x81')],[_0x42d2('0x7c')],[_0x42d2('0x8b')]);if(_0x5013b3[_0x42d2('0x82')][_0x42d2('0x81')]){delete _0x5013b3['account']['Applications'];}return db[_0x42d2('0x8c')][_0x42d2('0x61')]()[_0x42d2('0x32')](function(_0x1cf23f){if(!_0x1cf23f){throw new db['Sequelize'][(_0x42d2('0x8d'))](_0x42d2('0x8e'));}_0x4998dd=_[_0x42d2('0x8f')](_[_0x42d2('0x57')](_0x1cf23f),[_0x42d2('0x90'),_0x42d2('0x91')]);_0x3d8cc3=_[_0x42d2('0x8f')](_[_0x42d2('0x57')](_0x1cf23f),[_0x42d2('0x90'),_0x42d2('0x91'),_0x42d2('0x92'),'ListId']);_0x5013b3[_0x42d2('0x5a')]={'mapKey':_0x42d2('0x93')};if(_0x5013b3[_0x42d2('0x82')]&&_0x5013b3['account'][_0x42d2('0x3e')]===_0x42d2('0x94')){_0x5013b3[_0x42d2('0x5a')][_0x42d2('0x95')]=_0x30f45b[_0x42d2('0x5a')][_0x42d2('0x96')][_0x42d2('0x97')](_0x42d2('0x98'),'');_0x5013b3[_0x42d2('0x5a')][_0x42d2('0x5a')]=_0x30f45b[_0x42d2('0x5a')][_0x42d2('0x99')];_0x5013b3[_0x42d2('0x5a')][_0x42d2('0x9a')]=_0x30f45b[_0x42d2('0x5a')][_0x42d2('0x9b')];}if(_0x5013b3[_0x42d2('0x82')]&&_0x5013b3[_0x42d2('0x82')][_0x42d2('0x3e')]==='sinch'){_0x5013b3[_0x42d2('0x5a')][_0x42d2('0x95')]=_0x30f45b[_0x42d2('0x5a')][_0x42d2('0x9c')][0x0]['from'];_0x5013b3[_0x42d2('0x5a')][_0x42d2('0x5a')]=_0x30f45b[_0x42d2('0x5a')][_0x42d2('0x9c')][0x0][_0x42d2('0x26')][_0x42d2('0x5a')];_0x5013b3[_0x42d2('0x5a')][_0x42d2('0x9a')]=_0x30f45b[_0x42d2('0x5a')]['notifications'][0x0][_0x42d2('0x89')];}if(_0x5013b3[_0x42d2('0x5a')]['id']){delete _0x5013b3[_0x42d2('0x5a')]['id'];}if(_[_0x42d2('0x9d')](_0x5013b3[_0x42d2('0x5a')][_0x42d2('0x95')])){throw new db[(_0x42d2('0x9e'))][(_0x42d2('0x8d'))](_0x42d2('0x9f'));}if(_[_0x42d2('0x9d')](_0x5013b3['body'][_0x42d2('0x5a')])||_0x5013b3[_0x42d2('0x5a')][_0x42d2('0x5a')]===''){throw new db['Sequelize'][(_0x42d2('0x8d'))](_0x42d2('0xa0'));}if(_[_0x42d2('0x9d')](_0x5013b3['body'][_0x42d2('0xa1')])){throw new db[(_0x42d2('0x9e'))][(_0x42d2('0x8d'))](_0x42d2('0xa2')+_0x3d8cc3);}if(!_['includes'](_0x3d8cc3,_0x5013b3[_0x42d2('0x5a')][_0x42d2('0xa1')])){throw new db[(_0x42d2('0x9e'))][(_0x42d2('0x8d'))](_0x42d2('0xa3')+_0x3d8cc3);}_0x3f971c[_0x5013b3['body'][_0x42d2('0xa1')]]=_0x5013b3[_0x42d2('0x5a')][_0x42d2('0x95')];return db[_0x42d2('0xa4')][_0x42d2('0x58')]({'where':{'id':_0x5013b3[_0x42d2('0x82')][_0x42d2('0xa5')]},'include':[{'model':db[_0x42d2('0x8c')],'as':_0x42d2('0xa6'),'where':_0x3f971c,'limit':0x1,'order':[[_0x42d2('0x91'),_0x42d2('0xa7')]]}]});})['then'](handleEntityNotFound(_0x4817a5,null))[_0x42d2('0x32')](function(_0x49b998){if(_0x49b998){_0x5013b3['list']=_[_0x42d2('0xa8')](_0x49b998,[_0x42d2('0xa6')]);if(_0x49b998[_0x42d2('0xa6')][_0x42d2('0x45')]){return _0x49b998[_0x42d2('0xa6')][0x0];}var _0x425ee7=_[_0x42d2('0x18')](_0x5013b3[_0x42d2('0x5a')],{'firstName':_0x5013b3['body'][_0x42d2('0x95')],'ListId':_0x49b998['id']});_0x425ee7[_0x5013b3[_0x42d2('0x5a')][_0x42d2('0xa1')]]=_0x5013b3[_0x42d2('0x5a')]['from'];return db[_0x42d2('0x8c')]['create'](_0x425ee7,{'fields':_0x4998dd,'raw':!![]});}})['then'](handleEntityNotFound(_0x4817a5,null))['then'](function(_0x22c898){if(_0x22c898){_0x5013b3[_0x42d2('0xa9')]=_0x22c898;var _0x6c1e61={'ContactId':_0x22c898['id'],'phone':_0x5013b3['body']['from'],'WhatsappAccountId':_0x30f45b[_0x42d2('0x55')]['id']};var _0x19c0a6={'ContactId':_0x22c898['id'],'WhatsappAccountId':_0x30f45b[_0x42d2('0x55')]['id'],'closed':![]};return db[_0x42d2('0xaa')][_0x42d2('0x58')]({'where':_0x19c0a6})[_0x42d2('0x32')](function(_0xf46938){if(_0xf46938){return[_0xf46938,![]];}return db[_0x42d2('0xaa')][_0x42d2('0x59')](_0x6c1e61)[_0x42d2('0x32')](function(_0x5501e0){return[_0x5501e0,!![]];});});}})['spread'](function(_0x3a9aae,_0x3688b1){_0x5013b3[_0x42d2('0xab')]=_0x3a9aae[_0x42d2('0x34')]({'plain':!![]});_0x5013b3['interaction'][_0x42d2('0xac')]=![];if(_0x3688b1){if(_0x5013b3[_0x42d2('0x82')][_0x42d2('0xad')]){_0x5013b3[_0x42d2('0x8a')]['push']({'id':0x0,'priority':_0x5013b3[_0x42d2('0x8a')][_0x42d2('0x45')]+0x1,'app':'close','appdata':_0x42d2('0xae'),'interval':_0x42d2('0xaf')});}_0x5013b3[_0x42d2('0xab')][_0x42d2('0xac')]=!![];}return db['WhatsappMessage'][_0x42d2('0x59')]({'phone':_0x5013b3[_0x42d2('0x5a')]['from'],'messageId':_0x5013b3['body'][_0x42d2('0x9a')],'body':_0x5013b3[_0x42d2('0x5a')][_0x42d2('0x5a')],'WhatsappAccountId':_0x30f45b[_0x42d2('0x55')]['id'],'WhatsappInteractionId':_0x3a9aae['id'],'direction':'in','ContactId':_0x3a9aae[_0x42d2('0xb0')],'AttachmentId':_0x5013b3['body'][_0x42d2('0xb1')]});})[_0x42d2('0x32')](function(_0x4fa29c){_0x5013b3[_0x42d2('0x26')]=_0x4fa29c;if(_0x5013b3[_0x42d2('0xab')][_0x42d2('0xb2')]){return db[_0x42d2('0x74')]['find']({'attributes':['id',_0x42d2('0x38')],'where':{'id':_0x5013b3[_0x42d2('0xab')][_0x42d2('0xb2')]}})[_0x42d2('0x32')](function(_0x53950d){if(_0x53950d){_0x5013b3['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x53950d[_0x42d2('0x38')]+','+(_0x5013b3[_0x42d2('0x82')][_0x42d2('0xb3')]||0xa),'interval':_0x42d2('0xaf')});}return respondWithRpcPromise('Start',_0x42d2('0xb4'),_0x5013b3);});}return respondWithRpcPromise(_0x42d2('0xb5'),_0x42d2('0xb4'),_0x5013b3);})['then'](function(_0x2ff164){if(_0x2ff164){var _0x695831=0xc8;var _0x7e027d=_0x42d2('0xb6');logger[_0x42d2('0x20')](_0x42d2('0xb7'),_0x7e027d,_0x695831,_0x42d2('0xb8'));logger[_0x42d2('0x23')](_0x42d2('0xb9'),_0x7e027d,_0x695831,_0x42d2('0xb8'),JSON[_0x42d2('0x24')](_0x2ff164));if(_0x5013b3['account'][_0x42d2('0x3e')]===_0x42d2('0x94')){return _0x4817a5[_0x42d2('0x29')](_0x695831)[_0x42d2('0xba')](_0x42d2('0xbb'),'text/xml')[_0x42d2('0x39')](_0x42d2('0xbc'));}else{return _0x4817a5[_0x42d2('0x29')](_0x695831)[_0x42d2('0xbd')](_0x2ff164);}}});})[_0x42d2('0x28')](handleError(_0x4817a5,null));};exports[_0x42d2('0x39')]=function(_0x3fedf9,_0x2c98ea,_0x4fb92e){var _0x51e881,_0x2eee56,_0x37860a;if(_[_0x42d2('0x9d')](_0x3fedf9[_0x42d2('0x5a')]['body'])||_0x3fedf9[_0x42d2('0x5a')]['body']===''){throw new db['Sequelize'][(_0x42d2('0x8d'))](_0x42d2('0xa0'));}if(_[_0x42d2('0x9d')](_0x3fedf9[_0x42d2('0x5a')]['to'])){throw new db[(_0x42d2('0x9e'))][(_0x42d2('0x8d'))](_0x42d2('0xbe'));}_0x51e881=_0x3fedf9[_0x42d2('0x5a')]['to'];return db['WhatsappAccount'][_0x42d2('0x58')]({'where':{'id':_0x3fedf9[_0x42d2('0x55')]['id']},'include':[{'model':db[_0x42d2('0xa4')],'as':_0x42d2('0xbf'),'include':[{'model':db[_0x42d2('0x8c')],'as':_0x42d2('0xa6'),'where':{'mobile':_0x51e881},'limit':0x1,'order':[[_0x42d2('0x91'),_0x42d2('0xa7')]]}]}]})['then'](handleEntityNotFound(_0x2c98ea,null))[_0x42d2('0x32')](function(_0x3c6a41){if(_0x3c6a41&&_0x3c6a41['List']){_0x2eee56=_0x3c6a41[_0x42d2('0x34')]({'plain':!![]});if(_0x2eee56[_0x42d2('0xbf')]&&_0x2eee56[_0x42d2('0xbf')]['Contacts'][_0x42d2('0x45')]){return _0x2eee56[_0x42d2('0xbf')][_0x42d2('0xa6')][0x0];}return db[_0x42d2('0x8c')]['create'](_[_0x42d2('0x18')](_0x3fedf9[_0x42d2('0x5a')],{'firstName':_0x51e881,'mobile':_0x51e881,'phone':_0x51e881,'ListId':_0x2eee56[_0x42d2('0xa5')]}));}})[_0x42d2('0x32')](handleEntityNotFound(_0x2c98ea,null))[_0x42d2('0x32')](function(_0x32d0c6){if(_0x32d0c6){_0x37860a=_0x32d0c6;return db[_0x42d2('0xaa')][_0x42d2('0x58')]({'where':{'ContactId':_0x37860a['id'],'closed':![],'WhatsappAccountId':_0x2eee56['id']}})['then'](function(_0x53bb14){if(_0x53bb14){return[_0x53bb14,![]];}return db[_0x42d2('0xaa')][_0x42d2('0x59')]({'UserId':_0x3fedf9[_0x42d2('0x5b')]['id'],'ContactId':_0x37860a['id'],'WhatsappAccountId':_0x2eee56['id'],'phone':_0x51e881,'firstMsgDirection':_0x42d2('0xc0'),'Messages':[_['merge'](_0x3fedf9['body'],{'read':![],'body':_0x3fedf9[_0x42d2('0x5a')][_0x42d2('0x5a')],'phone':_0x51e881,'WhatsappAccountId':_0x2eee56['id'],'UserId':_0x3fedf9['user']['id'],'ContactId':_0x37860a['id']})]},{'include':[{'model':db[_0x42d2('0x87')],'as':_0x42d2('0xc1')}]})['then'](function(_0x117b46){return[_0x117b46,!![]];});});}})[_0x42d2('0xc2')](function(_0x652102,_0x1f7f09){if(_0x1f7f09){return _0x652102;}return db[_0x42d2('0x87')][_0x42d2('0x59')](_[_0x42d2('0x4d')](_0x3fedf9[_0x42d2('0x5a')],{'read':![],'body':_0x3fedf9[_0x42d2('0x5a')][_0x42d2('0x5a')],'phone':_0x51e881,'WhatsappAccountId':_0x2eee56['id'],'WhatsappInteractionId':_0x652102['id'],'UserId':_0x3fedf9[_0x42d2('0x5b')]['id'],'ContactId':_0x37860a['id']}))['then'](function(_0x2089a6){_0x652102[_0x42d2('0xc3')][_0x42d2('0xc1')]=[];_0x652102['dataValues'][_0x42d2('0xc1')][_0x42d2('0xc4')](_0x2089a6[_0x42d2('0xc3')]);return _0x652102;});})[_0x42d2('0x32')](respondWithResult(_0x2c98ea,null))['catch'](handleError(_0x2c98ea,null));}; \ No newline at end of file +var _0xcb78=['autoclose','close','*,*,*,*','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','CmList','List','defaults','out','Messages','dataValues','push','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','filter','options','includeAll','include','WhatsappAccount','findAll','rows','show','params','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','find','describe','addDisposition','Disposition','getDispositions','hasOwnProperty','where','WhatsappAccountId','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','addAgents','omit','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','Contacts','DESC','list','WhatsappInteraction','interaction','created'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xcb78,0xe0));var _0x8cb7=function(_0x414805,_0x4d6d35){_0x414805=_0x414805-0x0;var _0x46be75=_0xcb78[_0x414805];return _0x46be75;};'use strict';var emlformat=require(_0x8cb7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8cb7('0x1'));var jsonpatch=require(_0x8cb7('0x2'));var rp=require(_0x8cb7('0x3'));var moment=require('moment');var BPromise=require(_0x8cb7('0x4'));var Mustache=require(_0x8cb7('0x5'));var util=require(_0x8cb7('0x6'));var path=require(_0x8cb7('0x7'));var sox=require(_0x8cb7('0x8'));var csv=require(_0x8cb7('0x9'));var ejs=require(_0x8cb7('0xa'));var fs=require('fs');var fs_extra=require(_0x8cb7('0xb'));var _=require(_0x8cb7('0xc'));var squel=require(_0x8cb7('0xd'));var crypto=require('crypto');var jsforce=require(_0x8cb7('0xe'));var deskjs=require(_0x8cb7('0xf'));var toCsv=require(_0x8cb7('0x9'));var querystring=require('querystring');var Papa=require(_0x8cb7('0x10'));var Redis=require(_0x8cb7('0x11'));var authService=require(_0x8cb7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8cb7('0x13'));var hardwareService=require(_0x8cb7('0x14'));var logger=require(_0x8cb7('0x15'))('api');var utils=require(_0x8cb7('0x16'));var config=require(_0x8cb7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8cb7('0x18'))['db'];config[_0x8cb7('0x19')]=_['defaults'](config[_0x8cb7('0x19')],{'host':_0x8cb7('0x1a'),'port':0x18eb});var socket=require(_0x8cb7('0x1b'))(new Redis(config[_0x8cb7('0x19')]));require(_0x8cb7('0x1c'))[_0x8cb7('0x1d')](socket);var jayson=require(_0x8cb7('0x1e'));var client=jayson[_0x8cb7('0x1f')][_0x8cb7('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x5bde4b,_0x10b784,_0x4d7277,_0x136815){return new BPromise(function(_0x4a68a3,_0x2c7f3c){var _0x2840e0=_0x136815||client;return _0x2840e0['request'](_0x5bde4b,_0x4d7277)[_0x8cb7('0x21')](function(_0x22ac7b){logger[_0x8cb7('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x10b784,_0x8cb7('0x23'));logger[_0x8cb7('0x24')](_0x8cb7('0x25'),_0x10b784,_0x8cb7('0x23'),JSON[_0x8cb7('0x26')](_0x22ac7b));if(_0x22ac7b[_0x8cb7('0x27')]){if(_0x22ac7b[_0x8cb7('0x27')]['code']===0x1f4){logger[_0x8cb7('0x27')](_0x8cb7('0x28'),_0x10b784,_0x22ac7b[_0x8cb7('0x27')][_0x8cb7('0x29')]);return _0x2c7f3c(_0x22ac7b[_0x8cb7('0x27')][_0x8cb7('0x29')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x10b784,_0x22ac7b[_0x8cb7('0x27')][_0x8cb7('0x29')]);return _0x4a68a3(_0x22ac7b[_0x8cb7('0x27')]['message']);}else{logger[_0x8cb7('0x22')](_0x8cb7('0x28'),_0x10b784,_0x8cb7('0x23'));_0x4a68a3(_0x22ac7b[_0x8cb7('0x2a')]['message']);}})[_0x8cb7('0x2b')](function(_0x177570){logger[_0x8cb7('0x27')](_0x8cb7('0x28'),_0x10b784,_0x177570);_0x2c7f3c(_0x177570);});});}function respondWithStatusCode(_0x3fa081,_0x5bc99e){_0x5bc99e=_0x5bc99e||0xcc;return function(_0x5d6648){if(_0x5d6648){return _0x3fa081[_0x8cb7('0x2c')](_0x5bc99e);}return _0x3fa081[_0x8cb7('0x2d')](_0x5bc99e)[_0x8cb7('0x2e')]();};}function respondWithResult(_0xfb3ea0,_0x44e81c){_0x44e81c=_0x44e81c||0xc8;return function(_0x28bb79){if(_0x28bb79){return _0xfb3ea0['status'](_0x44e81c)['json'](_0x28bb79);}};}function respondWithFilteredResult(_0xae8aed,_0x2044a2){return function(_0x37c396){if(_0x37c396){var _0x3625ba=typeof _0x2044a2[_0x8cb7('0x2f')]===_0x8cb7('0x30')&&typeof _0x2044a2[_0x8cb7('0x31')]==='undefined';var _0x2ec717=_0x37c396[_0x8cb7('0x32')];var _0x2f000e=_0x3625ba?0x0:_0x2044a2['offset'];var _0x37c8f5=_0x3625ba?_0x37c396['count']:_0x2044a2['offset']+_0x2044a2[_0x8cb7('0x31')];var _0x5cb76f;if(_0x37c8f5>=_0x2ec717){_0x37c8f5=_0x2ec717;_0x5cb76f=0xc8;}else{_0x5cb76f=0xce;}_0xae8aed['status'](_0x5cb76f);return _0xae8aed[_0x8cb7('0x33')](_0x8cb7('0x34'),_0x2f000e+'-'+_0x37c8f5+'/'+_0x2ec717)[_0x8cb7('0x35')](_0x37c396);}return null;};}function patchUpdates(_0x185e0d){return function(_0x5e2110){try{jsonpatch[_0x8cb7('0x36')](_0x5e2110,_0x185e0d,!![]);}catch(_0x225b12){return BPromise[_0x8cb7('0x37')](_0x225b12);}return _0x5e2110[_0x8cb7('0x38')]();};}function saveUpdates(_0x30cff8,_0x5144cd){return function(_0x394963){if(_0x394963){return _0x394963[_0x8cb7('0x39')](_0x30cff8)['then'](function(_0x2a3f01){return _0x2a3f01;});}return null;};}function removeEntity(_0x5cadfa,_0x3f3f7a){return function(_0x3dfd62){if(_0x3dfd62){return _0x3dfd62[_0x8cb7('0x3a')]()[_0x8cb7('0x21')](function(){var _0x48e91d=_0x3dfd62[_0x8cb7('0x3b')]({'plain':!![]});var _0x3b31f4=_0x8cb7('0x3c');return db[_0x8cb7('0x3d')]['destroy']({'where':{'type':_0x3b31f4,'resourceId':_0x48e91d['id']}})[_0x8cb7('0x21')](function(){return _0x3dfd62;});})[_0x8cb7('0x21')](function(){_0x5cadfa[_0x8cb7('0x2d')](0xcc)[_0x8cb7('0x2e')]();});}};}function handleEntityNotFound(_0x521ffa,_0x5cac38){return function(_0x54e8e9){if(!_0x54e8e9){_0x521ffa[_0x8cb7('0x2c')](0x194);}return _0x54e8e9;};}function handleError(_0x3ecff1,_0x3ae294){_0x3ae294=_0x3ae294||0x1f4;return function(_0x3043e4){logger[_0x8cb7('0x27')](_0x3043e4['stack']);if(_0x3043e4[_0x8cb7('0x3e')]){delete _0x3043e4['name'];}_0x3ecff1[_0x8cb7('0x2d')](_0x3ae294)[_0x8cb7('0x3f')](_0x3043e4);};}exports[_0x8cb7('0x40')]=function(_0x37d9b1,_0x32e1ce){var _0x5e59aa={'include':[{'model':db[_0x8cb7('0x41')],'as':_0x8cb7('0x42')}]},_0x107740={},_0xcc0a31={'count':0x0,'rows':[]};var _0x263275=_['map'](db['WhatsappAccount'][_0x8cb7('0x43')],function(_0x39e0c2){return{'name':_0x39e0c2[_0x8cb7('0x44')],'type':_0x39e0c2[_0x8cb7('0x45')][_0x8cb7('0x46')]};});_0x107740[_0x8cb7('0x47')]=_[_0x8cb7('0x48')](_0x263275,_0x8cb7('0x3e'));_0x107740['query']=_[_0x8cb7('0x49')](_0x37d9b1['query']);_0x107740[_0x8cb7('0x4a')]=_[_0x8cb7('0x4b')](_0x107740[_0x8cb7('0x47')],_0x107740[_0x8cb7('0x4c')]);_0x5e59aa[_0x8cb7('0x4d')]=_['intersection'](_0x107740[_0x8cb7('0x47')],qs[_0x8cb7('0x4e')](_0x37d9b1['query'][_0x8cb7('0x4e')]));_0x5e59aa[_0x8cb7('0x4d')]=_0x5e59aa[_0x8cb7('0x4d')][_0x8cb7('0x4f')]?_0x5e59aa[_0x8cb7('0x4d')]:_0x107740[_0x8cb7('0x47')];if(!_0x37d9b1[_0x8cb7('0x4c')]['hasOwnProperty'](_0x8cb7('0x50'))){_0x5e59aa[_0x8cb7('0x31')]=qs[_0x8cb7('0x31')](_0x37d9b1[_0x8cb7('0x4c')][_0x8cb7('0x31')]);_0x5e59aa[_0x8cb7('0x2f')]=qs[_0x8cb7('0x2f')](_0x37d9b1[_0x8cb7('0x4c')][_0x8cb7('0x2f')]);}_0x5e59aa[_0x8cb7('0x51')]=qs[_0x8cb7('0x52')](_0x37d9b1[_0x8cb7('0x4c')]['sort']);_0x5e59aa['where']=qs[_0x8cb7('0x4a')](_[_0x8cb7('0x53')](_0x37d9b1[_0x8cb7('0x4c')],_0x107740[_0x8cb7('0x4a')]),_0x263275);if(_0x37d9b1[_0x8cb7('0x4c')][_0x8cb7('0x54')]){_0x5e59aa['where']=_['merge'](_0x5e59aa['where'],{'$or':_['map'](_0x263275,function(_0x2d9847){if(_0x2d9847[_0x8cb7('0x45')]!=='VIRTUAL'){var _0x33d6b1={};_0x33d6b1[_0x2d9847[_0x8cb7('0x3e')]]={'$like':'%'+_0x37d9b1[_0x8cb7('0x4c')][_0x8cb7('0x54')]+'%'};return _0x33d6b1;}})});}_0x5e59aa=_['merge']({},_0x5e59aa,_0x37d9b1[_0x8cb7('0x55')]);var _0x57aca9={'where':_0x5e59aa['where']};return db['WhatsappAccount'][_0x8cb7('0x32')](_0x57aca9)['then'](function(_0x302c56){_0xcc0a31[_0x8cb7('0x32')]=_0x302c56;if(_0x37d9b1[_0x8cb7('0x4c')][_0x8cb7('0x56')]){_0x5e59aa[_0x8cb7('0x57')]=[{'all':!![]}];}return db[_0x8cb7('0x58')][_0x8cb7('0x59')](_0x5e59aa);})[_0x8cb7('0x21')](function(_0x2c3a7c){_0xcc0a31[_0x8cb7('0x5a')]=_0x2c3a7c;return _0xcc0a31;})[_0x8cb7('0x21')](respondWithFilteredResult(_0x32e1ce,_0x5e59aa))[_0x8cb7('0x2b')](handleError(_0x32e1ce,null));};exports[_0x8cb7('0x5b')]=function(_0x268f6a,_0x1d2233){var _0x4b6644={'raw':![],'where':{'id':_0x268f6a[_0x8cb7('0x5c')]['id']},'include':[{'model':db[_0x8cb7('0x41')],'as':_0x8cb7('0x42')}]},_0x341c17={};_0x341c17['model']=_[_0x8cb7('0x49')](db[_0x8cb7('0x58')]['rawAttributes']);_0x341c17[_0x8cb7('0x4c')]=_['keys'](_0x268f6a[_0x8cb7('0x4c')]);_0x341c17[_0x8cb7('0x4a')]=_['intersection'](_0x341c17['model'],_0x341c17[_0x8cb7('0x4c')]);_0x4b6644[_0x8cb7('0x4d')]=_[_0x8cb7('0x4b')](_0x341c17[_0x8cb7('0x47')],qs[_0x8cb7('0x4e')](_0x268f6a[_0x8cb7('0x4c')]['fields']));_0x4b6644[_0x8cb7('0x4d')]=_0x4b6644[_0x8cb7('0x4d')][_0x8cb7('0x4f')]?_0x4b6644[_0x8cb7('0x4d')]:_0x341c17[_0x8cb7('0x47')];if(_0x268f6a['query']['includeAll']){_0x4b6644['include']=[{'all':!![]}];}_0x4b6644=_[_0x8cb7('0x5d')]({},_0x4b6644,_0x268f6a['options']);return db[_0x8cb7('0x58')]['find'](_0x4b6644)[_0x8cb7('0x21')](handleEntityNotFound(_0x1d2233,null))[_0x8cb7('0x21')](respondWithResult(_0x1d2233,null))[_0x8cb7('0x2b')](handleError(_0x1d2233,null));};exports['create']=function(_0x4a6ea6,_0x2a39a8){return db[_0x8cb7('0x58')][_0x8cb7('0x5e')](_0x4a6ea6[_0x8cb7('0x5f')],{})[_0x8cb7('0x21')](function(_0x32deab){var _0x4a1fa9=_0x4a6ea6[_0x8cb7('0x60')][_0x8cb7('0x3b')]({'plain':!![]});if(!_0x4a1fa9)throw new Error(_0x8cb7('0x61'));if(_0x4a1fa9[_0x8cb7('0x62')]==='user'){var _0x360684=_0x32deab['get']({'plain':!![]});var _0x2d0baf='WhatsappAccounts';return db[_0x8cb7('0x63')]['find']({'where':{'name':_0x2d0baf,'userProfileId':_0x4a1fa9[_0x8cb7('0x64')]},'raw':!![]})[_0x8cb7('0x21')](function(_0x177a95){if(_0x177a95&&_0x177a95[_0x8cb7('0x65')]===0x0){return db['UserProfileResource'][_0x8cb7('0x5e')]({'name':_0x360684['name'],'resourceId':_0x360684['id'],'type':_0x177a95['name'],'sectionId':_0x177a95['id']},{})['then'](function(){return _0x32deab;});}else{return _0x32deab;}})[_0x8cb7('0x2b')](function(_0x131b37){logger[_0x8cb7('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x131b37);throw _0x131b37;});}return _0x32deab;})[_0x8cb7('0x21')](respondWithResult(_0x2a39a8,0xc9))[_0x8cb7('0x2b')](handleError(_0x2a39a8,null));};exports['update']=function(_0xf209a2,_0x537a70){if(_0xf209a2[_0x8cb7('0x5f')]['id']){delete _0xf209a2[_0x8cb7('0x5f')]['id'];}return db[_0x8cb7('0x58')][_0x8cb7('0x66')]({'where':{'id':_0xf209a2[_0x8cb7('0x5c')]['id']},'include':[{'model':db[_0x8cb7('0x41')],'as':_0x8cb7('0x42')}]})['then'](handleEntityNotFound(_0x537a70,null))[_0x8cb7('0x21')](saveUpdates(_0xf209a2[_0x8cb7('0x5f')],null))['then'](respondWithResult(_0x537a70,null))[_0x8cb7('0x2b')](handleError(_0x537a70,null));};exports[_0x8cb7('0x3a')]=function(_0x174139,_0x552679){return db[_0x8cb7('0x58')][_0x8cb7('0x66')]({'where':{'id':_0x174139[_0x8cb7('0x5c')]['id']}})[_0x8cb7('0x21')](handleEntityNotFound(_0x552679,null))[_0x8cb7('0x21')](removeEntity(_0x552679,null))['catch'](handleError(_0x552679,null));};exports['describe']=function(_0x2d731b,_0x420b10){return db[_0x8cb7('0x58')][_0x8cb7('0x67')]()[_0x8cb7('0x21')](respondWithResult(_0x420b10,null))[_0x8cb7('0x2b')](handleError(_0x420b10,null));};exports[_0x8cb7('0x68')]=function(_0x5e4eef,_0x17d221,_0x4b43ad){if(_0x5e4eef[_0x8cb7('0x5f')]['id']){delete _0x5e4eef['body']['id'];}return db[_0x8cb7('0x58')][_0x8cb7('0x66')]({'where':{'id':_0x5e4eef['params']['id']}})[_0x8cb7('0x21')](handleEntityNotFound(_0x17d221,null))[_0x8cb7('0x21')](function(_0x55e467){if(_0x55e467){_0x5e4eef[_0x8cb7('0x5f')]['WhatsappAccountId']=_0x55e467['id'];return db[_0x8cb7('0x69')][_0x8cb7('0x5e')](_0x5e4eef[_0x8cb7('0x5f')]);}})['then'](respondWithResult(_0x17d221,null))[_0x8cb7('0x2b')](handleError(_0x17d221,null));};exports[_0x8cb7('0x6a')]=function(_0x4c66e4,_0x4f88dd,_0xac8d2f){var _0x30af7e={'raw':![],'where':{}};var _0x27f45b={};var _0x15bf99={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x4c66e4['params']['id']}})[_0x8cb7('0x21')](handleEntityNotFound(_0x4f88dd,null))[_0x8cb7('0x21')](function(_0xd5f10a){if(_0xd5f10a){_0x27f45b['model']=_[_0x8cb7('0x49')](db[_0x8cb7('0x69')][_0x8cb7('0x43')]);_0x27f45b['query']=_['keys'](_0x4c66e4[_0x8cb7('0x4c')]);_0x27f45b['filters']=_[_0x8cb7('0x4b')](_0x27f45b[_0x8cb7('0x47')],_0x27f45b['query']);_0x30af7e['attributes']=_[_0x8cb7('0x4b')](_0x27f45b[_0x8cb7('0x47')],qs[_0x8cb7('0x4e')](_0x4c66e4[_0x8cb7('0x4c')][_0x8cb7('0x4e')]));_0x30af7e[_0x8cb7('0x4d')]=_0x30af7e[_0x8cb7('0x4d')][_0x8cb7('0x4f')]?_0x30af7e[_0x8cb7('0x4d')]:_0x27f45b[_0x8cb7('0x47')];if(!_0x4c66e4['query'][_0x8cb7('0x6b')](_0x8cb7('0x50'))){_0x30af7e[_0x8cb7('0x31')]=qs[_0x8cb7('0x31')](_0x4c66e4[_0x8cb7('0x4c')][_0x8cb7('0x31')]);_0x30af7e[_0x8cb7('0x2f')]=qs[_0x8cb7('0x2f')](_0x4c66e4['query']['offset']);}_0x30af7e['order']=qs[_0x8cb7('0x52')](_0x4c66e4[_0x8cb7('0x4c')][_0x8cb7('0x52')]);_0x30af7e[_0x8cb7('0x6c')]=qs['filters'](_['pick'](_0x4c66e4[_0x8cb7('0x4c')],_0x27f45b[_0x8cb7('0x4a')]));_0x30af7e[_0x8cb7('0x6c')][_0x8cb7('0x6d')]=_0xd5f10a['id'];if(_0x4c66e4[_0x8cb7('0x4c')]['filter']){_0x30af7e[_0x8cb7('0x6c')]=_[_0x8cb7('0x5d')](_0x30af7e[_0x8cb7('0x6c')],{'$or':_[_0x8cb7('0x48')](_0x30af7e[_0x8cb7('0x4d')],function(_0x7a479f){var _0xb98979={};_0xb98979[_0x7a479f]={'$like':'%'+_0x4c66e4[_0x8cb7('0x4c')][_0x8cb7('0x54')]+'%'};return _0xb98979;})});}_0x30af7e=_[_0x8cb7('0x5d')]({},_0x30af7e,_0x4c66e4['options']);return db['Disposition'][_0x8cb7('0x32')]({'where':_0x30af7e[_0x8cb7('0x6c')]})[_0x8cb7('0x21')](function(_0x437d30){_0x15bf99[_0x8cb7('0x32')]=_0x437d30;if(_0x4c66e4['query'][_0x8cb7('0x56')]){_0x30af7e[_0x8cb7('0x57')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x30af7e);})[_0x8cb7('0x21')](function(_0x36daca){_0x15bf99['rows']=_0x36daca;return _0x15bf99;});}})[_0x8cb7('0x21')](respondWithFilteredResult(_0x4f88dd,_0x30af7e))[_0x8cb7('0x2b')](handleError(_0x4f88dd,null));};exports['removeDispositions']=function(_0x551f70,_0x432be2,_0x59cc57){return db[_0x8cb7('0x58')][_0x8cb7('0x66')]({'where':{'id':_0x551f70[_0x8cb7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x432be2,null))[_0x8cb7('0x21')](function(_0x286206){if(_0x286206){return _0x286206['removeDispositions'](_0x551f70[_0x8cb7('0x4c')]['ids']);}})[_0x8cb7('0x21')](respondWithStatusCode(_0x432be2,null))[_0x8cb7('0x2b')](handleError(_0x432be2,null));};exports[_0x8cb7('0x6e')]=function(_0x7595c2,_0x392d76,_0x2ce9b0){if(_0x7595c2['body']['id']){delete _0x7595c2['body']['id'];}return db[_0x8cb7('0x58')][_0x8cb7('0x66')]({'where':{'id':_0x7595c2[_0x8cb7('0x5c')]['id']}})[_0x8cb7('0x21')](handleEntityNotFound(_0x392d76,null))[_0x8cb7('0x21')](function(_0x5e1a33){if(_0x5e1a33){_0x7595c2[_0x8cb7('0x5f')][_0x8cb7('0x6d')]=_0x5e1a33['id'];return db[_0x8cb7('0x6f')]['create'](_0x7595c2[_0x8cb7('0x5f')]);}})[_0x8cb7('0x21')](respondWithResult(_0x392d76,null))[_0x8cb7('0x2b')](handleError(_0x392d76,null));};exports[_0x8cb7('0x70')]=function(_0x2b844c,_0x8f3a55,_0x2dc75b){var _0x22e17c={'raw':![],'where':{}};var _0x3344a6={};var _0x582112={'count':0x0,'rows':[]};return db[_0x8cb7('0x58')][_0x8cb7('0x71')]({'where':{'id':_0x2b844c[_0x8cb7('0x5c')]['id']}})[_0x8cb7('0x21')](handleEntityNotFound(_0x8f3a55,null))[_0x8cb7('0x21')](function(_0x56d51d){if(_0x56d51d){_0x3344a6['model']=_[_0x8cb7('0x49')](db['CannedAnswer']['rawAttributes']);_0x3344a6[_0x8cb7('0x4c')]=_[_0x8cb7('0x49')](_0x2b844c[_0x8cb7('0x4c')]);_0x3344a6['filters']=_[_0x8cb7('0x4b')](_0x3344a6['model'],_0x3344a6[_0x8cb7('0x4c')]);_0x22e17c['attributes']=_['intersection'](_0x3344a6[_0x8cb7('0x47')],qs[_0x8cb7('0x4e')](_0x2b844c[_0x8cb7('0x4c')]['fields']));_0x22e17c['attributes']=_0x22e17c[_0x8cb7('0x4d')]['length']?_0x22e17c[_0x8cb7('0x4d')]:_0x3344a6[_0x8cb7('0x47')];if(!_0x2b844c[_0x8cb7('0x4c')][_0x8cb7('0x6b')](_0x8cb7('0x50'))){_0x22e17c['limit']=qs[_0x8cb7('0x31')](_0x2b844c[_0x8cb7('0x4c')][_0x8cb7('0x31')]);_0x22e17c['offset']=qs[_0x8cb7('0x2f')](_0x2b844c[_0x8cb7('0x4c')][_0x8cb7('0x2f')]);}_0x22e17c[_0x8cb7('0x51')]=qs[_0x8cb7('0x52')](_0x2b844c[_0x8cb7('0x4c')][_0x8cb7('0x52')]);_0x22e17c['where']=qs[_0x8cb7('0x4a')](_[_0x8cb7('0x53')](_0x2b844c[_0x8cb7('0x4c')],_0x3344a6[_0x8cb7('0x4a')]));_0x22e17c[_0x8cb7('0x6c')]['WhatsappAccountId']=_0x56d51d['id'];if(_0x2b844c['query'][_0x8cb7('0x54')]){_0x22e17c['where']=_[_0x8cb7('0x5d')](_0x22e17c[_0x8cb7('0x6c')],{'$or':_[_0x8cb7('0x48')](_0x22e17c[_0x8cb7('0x4d')],function(_0x1bf687){var _0x2d49b8={};_0x2d49b8[_0x1bf687]={'$like':'%'+_0x2b844c[_0x8cb7('0x4c')][_0x8cb7('0x54')]+'%'};return _0x2d49b8;})});}_0x22e17c=_[_0x8cb7('0x5d')]({},_0x22e17c,_0x2b844c[_0x8cb7('0x55')]);return db[_0x8cb7('0x6f')][_0x8cb7('0x32')]({'where':_0x22e17c['where']})[_0x8cb7('0x21')](function(_0x4db000){_0x582112[_0x8cb7('0x32')]=_0x4db000;if(_0x2b844c['query'][_0x8cb7('0x56')]){_0x22e17c[_0x8cb7('0x57')]=[{'all':!![]}];}return db[_0x8cb7('0x6f')][_0x8cb7('0x59')](_0x22e17c);})[_0x8cb7('0x21')](function(_0x2d60f9){_0x582112[_0x8cb7('0x5a')]=_0x2d60f9;return _0x582112;});}})[_0x8cb7('0x21')](respondWithFilteredResult(_0x8f3a55,_0x22e17c))[_0x8cb7('0x2b')](handleError(_0x8f3a55,null));};exports['removeAnswers']=function(_0x4f9e7e,_0xa980a7,_0x1beb3e){return db[_0x8cb7('0x58')]['find']({'where':{'id':_0x4f9e7e[_0x8cb7('0x5c')]['id']}})['then'](handleEntityNotFound(_0xa980a7,null))['then'](function(_0x13342e){if(_0x13342e){return _0x13342e[_0x8cb7('0x72')](_0x4f9e7e[_0x8cb7('0x4c')][_0x8cb7('0x73')]);}})[_0x8cb7('0x21')](respondWithStatusCode(_0xa980a7,null))[_0x8cb7('0x2b')](handleError(_0xa980a7,null));};exports['addAgents']=function(_0x4f9ef7,_0x979b28,_0x2e6e79){return db[_0x8cb7('0x58')][_0x8cb7('0x66')]({'where':{'id':_0x4f9ef7[_0x8cb7('0x5c')]['id']}})[_0x8cb7('0x21')](handleEntityNotFound(_0x979b28,null))[_0x8cb7('0x21')](function(_0x544379){if(_0x544379){return _0x544379[_0x8cb7('0x74')](_0x4f9ef7[_0x8cb7('0x5f')][_0x8cb7('0x73')],_[_0x8cb7('0x75')](_0x4f9ef7[_0x8cb7('0x5f')],[_0x8cb7('0x73'),'id'])||{})[_0x8cb7('0x76')](function(_0x3fbe7d){for(var _0x5650b5=0x0;_0x5650b5<_0x4f9ef7[_0x8cb7('0x5f')]['ids'][_0x8cb7('0x4f')];_0x5650b5+=0x1){socket[_0x8cb7('0x77')]('userWhatsappAccount:save',{'UserId':Number(_0x4f9ef7[_0x8cb7('0x5f')][_0x8cb7('0x73')][_0x5650b5]),'WhatsappAccountId':Number(_0x4f9ef7[_0x8cb7('0x5c')]['id'])});}return _0x3fbe7d;});}})[_0x8cb7('0x21')](respondWithResult(_0x979b28,null))[_0x8cb7('0x2b')](handleError(_0x979b28,null));};exports[_0x8cb7('0x78')]=function(_0x48b3bb,_0x55e912,_0x4e7633){return db[_0x8cb7('0x58')]['find']({'where':{'id':_0x48b3bb[_0x8cb7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x55e912,null))[_0x8cb7('0x21')](function(_0x29893f){if(_0x29893f){return _0x29893f[_0x8cb7('0x78')](_0x48b3bb[_0x8cb7('0x4c')][_0x8cb7('0x73')])[_0x8cb7('0x21')](function(){if(_['isArray'](_0x48b3bb[_0x8cb7('0x4c')]['ids'])){for(var _0x1700f8=0x0;_0x1700f8<_0x48b3bb[_0x8cb7('0x4c')][_0x8cb7('0x73')][_0x8cb7('0x4f')];_0x1700f8+=0x1){socket[_0x8cb7('0x77')](_0x8cb7('0x79'),{'UserId':Number(_0x48b3bb['query'][_0x8cb7('0x73')][_0x1700f8]),'WhatsappAccountId':Number(_0x48b3bb['params']['id'])});}}else{socket['emit'](_0x8cb7('0x79'),{'UserId':Number(_0x48b3bb[_0x8cb7('0x4c')][_0x8cb7('0x73')]),'WhatsappAccountId':Number(_0x48b3bb[_0x8cb7('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x55e912,null))[_0x8cb7('0x2b')](handleError(_0x55e912,null));};exports[_0x8cb7('0x7a')]=function(_0x7b2606,_0x55661b,_0x36704c){var _0x1267c9={};var _0x320d5d={};var _0x2ed544;var _0x436983;return db['WhatsappAccount'][_0x8cb7('0x71')]({'where':{'id':_0x7b2606[_0x8cb7('0x5c')]['id']}})[_0x8cb7('0x21')](handleEntityNotFound(_0x55661b,null))[_0x8cb7('0x21')](function(_0x196e6d){if(_0x196e6d){_0x2ed544=_0x196e6d;_0x320d5d[_0x8cb7('0x47')]=_['keys'](db[_0x8cb7('0x7b')][_0x8cb7('0x43')]);_0x320d5d[_0x8cb7('0x4c')]=_[_0x8cb7('0x49')](_0x7b2606[_0x8cb7('0x4c')]);_0x320d5d[_0x8cb7('0x4a')]=_[_0x8cb7('0x4b')](_0x320d5d[_0x8cb7('0x47')],_0x320d5d[_0x8cb7('0x4c')]);_0x1267c9[_0x8cb7('0x4d')]=_['intersection'](_0x320d5d[_0x8cb7('0x47')],qs[_0x8cb7('0x4e')](_0x7b2606[_0x8cb7('0x4c')]['fields']));_0x1267c9[_0x8cb7('0x4d')]=_0x1267c9[_0x8cb7('0x4d')][_0x8cb7('0x4f')]?_0x1267c9[_0x8cb7('0x4d')]:_0x320d5d[_0x8cb7('0x47')];_0x1267c9[_0x8cb7('0x51')]=qs[_0x8cb7('0x52')](_0x7b2606[_0x8cb7('0x4c')]['sort']);_0x1267c9[_0x8cb7('0x6c')]=qs[_0x8cb7('0x4a')](_[_0x8cb7('0x53')](_0x7b2606[_0x8cb7('0x4c')],_0x320d5d[_0x8cb7('0x4a')]));if(_0x7b2606[_0x8cb7('0x4c')][_0x8cb7('0x54')]){_0x1267c9[_0x8cb7('0x6c')]=_[_0x8cb7('0x5d')](_0x1267c9['where'],{'$or':_[_0x8cb7('0x48')](_0x1267c9[_0x8cb7('0x4d')],function(_0x1ceb59){var _0x495704={};_0x495704[_0x1ceb59]={'$like':'%'+_0x7b2606['query'][_0x8cb7('0x54')]+'%'};return _0x495704;})});}_0x1267c9=_[_0x8cb7('0x5d')]({},_0x1267c9,_0x7b2606[_0x8cb7('0x55')]);return _0x2ed544[_0x8cb7('0x7a')](_0x1267c9);}})['then'](function(_0x201d07){if(_0x201d07){_0x436983=_0x201d07[_0x8cb7('0x4f')];if(!_0x7b2606['query'][_0x8cb7('0x6b')](_0x8cb7('0x50'))){_0x1267c9[_0x8cb7('0x31')]=qs[_0x8cb7('0x31')](_0x7b2606[_0x8cb7('0x4c')]['limit']);_0x1267c9['offset']=qs[_0x8cb7('0x2f')](_0x7b2606['query'][_0x8cb7('0x2f')]);}return _0x2ed544[_0x8cb7('0x7a')](_0x1267c9);}})['then'](function(_0x377597){if(_0x377597){return _0x377597?{'count':_0x436983,'rows':_0x377597}:null;}})[_0x8cb7('0x21')](respondWithResult(_0x55661b,null))['catch'](handleError(_0x55661b,null));};exports['addApplications']=function(_0x45bd24,_0x492a17){var _0x1c24ee=_0x45bd24['params']['id'];var _0x20f0c6=_0x45bd24['body'];var _0x156a8b=0xc8;var _0x46ef2a=null;return db[_0x8cb7('0x7c')][_0x8cb7('0x7d')]({'isolationLevel':db[_0x8cb7('0x7c')][_0x8cb7('0x7e')]['ISOLATION_LEVELS'][_0x8cb7('0x7f')]},function(_0x4241c3){return db['WhatsappAccount'][_0x8cb7('0x71')]({'where':{'id':_0x1c24ee},'transaction':_0x4241c3})[_0x8cb7('0x21')](function(_0x4bb514){if(_0x4bb514){return db[_0x8cb7('0x80')][_0x8cb7('0x3a')]({'where':{'WhatsappAccountId':_0x1c24ee},'transaction':_0x4241c3})[_0x8cb7('0x21')](function(){var _0x396d88=_[_0x8cb7('0x48')](_0x20f0c6,function(_0x218dd1){_0x218dd1['WhatsappAccountId']=_0x1c24ee;return _0x218dd1;});return db['WhatsappApplication'][_0x8cb7('0x81')](_0x396d88,{'transaction':_0x4241c3});});}else{_0x156a8b=0x194;_0x46ef2a=[];}});})[_0x8cb7('0x21')](function(){if(_0x156a8b!==0x194){return db[_0x8cb7('0x80')][_0x8cb7('0x82')]({'where':{'WhatsappAccountId':_0x1c24ee},'order':_0x8cb7('0x83')})[_0x8cb7('0x21')](function(_0x2bd019){_0x46ef2a=_0x2bd019;});}})[_0x8cb7('0x2b')](function(_0x2ee516){_0x156a8b=0x1f4;logger['error'](_0x2ee516['stack']);if(_0x2ee516['name']){delete _0x2ee516['name'];}_0x46ef2a=_0x2ee516;})[_0x8cb7('0x84')](function(){if(_0x46ef2a===null){_0x492a17[_0x8cb7('0x2c')](_0x156a8b);}else{if(_0x156a8b===0x1f4){_0x492a17[_0x8cb7('0x2d')](_0x156a8b)[_0x8cb7('0x3f')](_0x46ef2a);}else{_0x492a17[_0x8cb7('0x2d')](_0x156a8b)[_0x8cb7('0x35')](_0x46ef2a);}}});};exports[_0x8cb7('0x85')]=function(_0x3ddac1,_0x2989bf,_0x12a213){var _0x3b9f10={};var _0x512921={};var _0xcbb54d;var _0x1dd50e;return db[_0x8cb7('0x58')][_0x8cb7('0x71')]({'where':{'id':_0x3ddac1[_0x8cb7('0x5c')]['id']}})[_0x8cb7('0x21')](handleEntityNotFound(_0x2989bf,null))[_0x8cb7('0x21')](function(_0x4e0ac4){if(_0x4e0ac4){_0xcbb54d=_0x4e0ac4;_0x512921['model']=_[_0x8cb7('0x49')](db[_0x8cb7('0x80')]['rawAttributes']);_0x512921[_0x8cb7('0x4c')]=_[_0x8cb7('0x49')](_0x3ddac1[_0x8cb7('0x4c')]);_0x512921['filters']=_[_0x8cb7('0x4b')](_0x512921[_0x8cb7('0x47')],_0x512921[_0x8cb7('0x4c')]);_0x3b9f10[_0x8cb7('0x4d')]=_[_0x8cb7('0x4b')](_0x512921['model'],qs[_0x8cb7('0x4e')](_0x3ddac1['query'][_0x8cb7('0x4e')]));_0x3b9f10[_0x8cb7('0x4d')]=_0x3b9f10[_0x8cb7('0x4d')][_0x8cb7('0x4f')]?_0x3b9f10[_0x8cb7('0x4d')]:_0x512921[_0x8cb7('0x47')];_0x3b9f10[_0x8cb7('0x51')]=qs['sort'](_0x3ddac1['query'][_0x8cb7('0x52')]);_0x3b9f10[_0x8cb7('0x6c')]=qs[_0x8cb7('0x4a')](_[_0x8cb7('0x53')](_0x3ddac1[_0x8cb7('0x4c')],_0x512921['filters']));if(_0x3ddac1['query'][_0x8cb7('0x54')]){_0x3b9f10[_0x8cb7('0x6c')]=_[_0x8cb7('0x5d')](_0x3b9f10[_0x8cb7('0x6c')],{'$or':_[_0x8cb7('0x48')](_0x3b9f10[_0x8cb7('0x4d')],function(_0x5b21aa){var _0x45b1b9={};_0x45b1b9[_0x5b21aa]={'$like':'%'+_0x3ddac1[_0x8cb7('0x4c')][_0x8cb7('0x54')]+'%'};return _0x45b1b9;})});}_0x3b9f10=_[_0x8cb7('0x5d')]({},_0x3b9f10,_0x3ddac1[_0x8cb7('0x55')]);return _0xcbb54d['getApplications'](_0x3b9f10);}})[_0x8cb7('0x21')](function(_0x2b3565){if(_0x2b3565){_0x1dd50e=_0x2b3565[_0x8cb7('0x4f')];if(!_0x3ddac1[_0x8cb7('0x4c')]['hasOwnProperty'](_0x8cb7('0x50'))){_0x3b9f10[_0x8cb7('0x31')]=qs[_0x8cb7('0x31')](_0x3ddac1[_0x8cb7('0x4c')][_0x8cb7('0x31')]);_0x3b9f10['offset']=qs[_0x8cb7('0x2f')](_0x3ddac1[_0x8cb7('0x4c')][_0x8cb7('0x2f')]);}return _0xcbb54d[_0x8cb7('0x85')](_0x3b9f10);}})['then'](function(_0x4e1f5b){if(_0x4e1f5b){return _0x4e1f5b?{'count':_0x1dd50e,'rows':_0x4e1f5b}:null;}})[_0x8cb7('0x21')](respondWithResult(_0x2989bf,null))[_0x8cb7('0x2b')](handleError(_0x2989bf,null));};exports['notify']=function(_0x2dcdcf,_0x13b7b9,_0x494ccd){var _0x220659={'channel':_0x8cb7('0x86')};var _0x35b814=[];var _0x5763fb=[];var _0x2d6948={};return db[_0x8cb7('0x58')]['find']({'where':{'id':_0x2dcdcf[_0x8cb7('0x5c')]['id']},'include':[{'model':db[_0x8cb7('0x80')],'as':_0x8cb7('0x87')}]})[_0x8cb7('0x21')](handleEntityNotFound(_0x13b7b9,null))[_0x8cb7('0x21')](function(_0x505280){_0x220659[_0x8cb7('0x88')]=_0x505280;if(_0x220659['account']&&_0x220659[_0x8cb7('0x88')][_0x8cb7('0x45')]===_0x8cb7('0x89')&&_0x2dcdcf[_0x8cb7('0x5f')]['statuses']){if(_0x2dcdcf[_0x8cb7('0x5f')][_0x8cb7('0x8a')][_0x8cb7('0x4f')]===0x0)return;if(_0x2dcdcf['body']['statuses'][0x0][_0x8cb7('0x8b')]!==_0x8cb7('0x8c'))return;return db[_0x8cb7('0x8d')][_0x8cb7('0x39')]({'read':!![],'readAt':_0x2dcdcf[_0x8cb7('0x5f')][_0x8cb7('0x8a')][0x0][_0x8cb7('0x8e')]},{'where':{'messageId':_0x2dcdcf[_0x8cb7('0x5f')][_0x8cb7('0x8a')][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x4f3486){return _0x13b7b9[_0x8cb7('0x2d')](0xc8)[_0x8cb7('0x35')](_0x4f3486);});}_0x220659[_0x8cb7('0x8f')]=_[_0x8cb7('0x90')](_0x505280['Applications'],[_0x8cb7('0x83')],[_0x8cb7('0x91')]);if(_0x220659[_0x8cb7('0x88')][_0x8cb7('0x87')]){delete _0x220659['account']['Applications'];}return db[_0x8cb7('0x92')]['describe']()['then'](function(_0x1a848c){if(!_0x1a848c){throw new db[(_0x8cb7('0x93'))][(_0x8cb7('0x94'))](_0x8cb7('0x95'));}_0x35b814=_[_0x8cb7('0x96')](_[_0x8cb7('0x49')](_0x1a848c),['createdAt',_0x8cb7('0x97')]);_0x5763fb=_[_0x8cb7('0x96')](_[_0x8cb7('0x49')](_0x1a848c),[_0x8cb7('0x98'),_0x8cb7('0x97'),_0x8cb7('0x99'),_0x8cb7('0x9a')]);_0x220659['body']={'mapKey':'mobile'};if(_0x220659[_0x8cb7('0x88')]&&_0x220659['account'][_0x8cb7('0x45')]==='twilio'){_0x220659[_0x8cb7('0x5f')][_0x8cb7('0x9b')]=_0x2dcdcf['body'][_0x8cb7('0x9c')][_0x8cb7('0x9d')](_0x8cb7('0x9e'),'');_0x220659['body'][_0x8cb7('0x5f')]=_0x2dcdcf[_0x8cb7('0x5f')][_0x8cb7('0x9f')];_0x220659['body'][_0x8cb7('0xa0')]=_0x2dcdcf['body'][_0x8cb7('0xa1')];}if(_0x220659[_0x8cb7('0x88')]&&_0x220659['account'][_0x8cb7('0x45')]==='sinch'){_0x220659['body'][_0x8cb7('0x9b')]=_0x2dcdcf[_0x8cb7('0x5f')][_0x8cb7('0xa2')][0x0][_0x8cb7('0x9b')];_0x220659[_0x8cb7('0x5f')]['body']=_0x2dcdcf[_0x8cb7('0x5f')][_0x8cb7('0xa2')][0x0][_0x8cb7('0x29')][_0x8cb7('0x5f')];_0x220659[_0x8cb7('0x5f')][_0x8cb7('0xa0')]=_0x2dcdcf[_0x8cb7('0x5f')][_0x8cb7('0xa2')][0x0]['message_id'];}if(_0x220659['body']['id']){delete _0x220659['body']['id'];}if(_['isNil'](_0x220659[_0x8cb7('0x5f')][_0x8cb7('0x9b')])){throw new db[(_0x8cb7('0x93'))]['ValidationError'](_0x8cb7('0xa3'));}if(_[_0x8cb7('0xa4')](_0x220659[_0x8cb7('0x5f')][_0x8cb7('0x5f')])||_0x220659[_0x8cb7('0x5f')]['body']===''){throw new db['Sequelize'][(_0x8cb7('0x94'))](_0x8cb7('0xa5'));}if(_['isNil'](_0x220659[_0x8cb7('0x5f')]['mapKey'])){throw new db['Sequelize'][(_0x8cb7('0x94'))](_0x8cb7('0xa6')+_0x5763fb);}if(!_[_0x8cb7('0xa7')](_0x5763fb,_0x220659['body']['mapKey'])){throw new db[(_0x8cb7('0x93'))][(_0x8cb7('0x94'))](_0x8cb7('0xa8')+_0x5763fb);}_0x2d6948[_0x220659[_0x8cb7('0x5f')][_0x8cb7('0xa9')]]=_0x220659['body'][_0x8cb7('0x9b')];return db['CmList'][_0x8cb7('0x66')]({'where':{'id':_0x220659['account']['ListId']},'include':[{'model':db['CmContact'],'as':_0x8cb7('0xaa'),'where':_0x2d6948,'limit':0x1,'order':[['updatedAt',_0x8cb7('0xab')]]}]});})[_0x8cb7('0x21')](handleEntityNotFound(_0x13b7b9,null))[_0x8cb7('0x21')](function(_0x56f43b){if(_0x56f43b){_0x220659[_0x8cb7('0xac')]=_[_0x8cb7('0x75')](_0x56f43b,[_0x8cb7('0xaa')]);if(_0x56f43b['Contacts'][_0x8cb7('0x4f')]){return _0x56f43b['Contacts'][0x0];}var _0x3d3d19=_['defaults'](_0x220659[_0x8cb7('0x5f')],{'firstName':_0x220659['body'][_0x8cb7('0x9b')],'ListId':_0x56f43b['id']});_0x3d3d19[_0x220659[_0x8cb7('0x5f')]['mapKey']]=_0x220659[_0x8cb7('0x5f')]['from'];return db[_0x8cb7('0x92')]['create'](_0x3d3d19,{'fields':_0x35b814,'raw':!![]});}})[_0x8cb7('0x21')](handleEntityNotFound(_0x13b7b9,null))[_0x8cb7('0x21')](function(_0x5c054c){if(_0x5c054c){_0x220659['contact']=_0x5c054c;var _0xc7e5ed={'ContactId':_0x5c054c['id'],'phone':_0x220659['body']['from'],'WhatsappAccountId':_0x2dcdcf[_0x8cb7('0x5c')]['id']};var _0x2aa1ef={'ContactId':_0x5c054c['id'],'WhatsappAccountId':_0x2dcdcf[_0x8cb7('0x5c')]['id'],'closed':![]};return db[_0x8cb7('0xad')][_0x8cb7('0x66')]({'where':_0x2aa1ef})[_0x8cb7('0x21')](function(_0x3666a3){if(_0x3666a3){return[_0x3666a3,![]];}return db[_0x8cb7('0xad')][_0x8cb7('0x5e')](_0xc7e5ed)[_0x8cb7('0x21')](function(_0x2162d2){return[_0x2162d2,!![]];});});}})[_0x8cb7('0x76')](function(_0x5e47c5,_0x32aa96){_0x220659[_0x8cb7('0xae')]=_0x5e47c5[_0x8cb7('0x3b')]({'plain':!![]});_0x220659['interaction'][_0x8cb7('0xaf')]=![];if(_0x32aa96){if(_0x220659['account'][_0x8cb7('0xb0')]){_0x220659[_0x8cb7('0x8f')]['push']({'id':0x0,'priority':_0x220659[_0x8cb7('0x8f')][_0x8cb7('0x4f')]+0x1,'app':_0x8cb7('0xb1'),'appdata':'unmanaged','interval':_0x8cb7('0xb2')});}_0x220659['interaction'][_0x8cb7('0xaf')]=!![];}return db[_0x8cb7('0x8d')][_0x8cb7('0x5e')]({'phone':_0x220659['body'][_0x8cb7('0x9b')],'messageId':_0x220659[_0x8cb7('0x5f')][_0x8cb7('0xa0')],'body':_0x220659[_0x8cb7('0x5f')][_0x8cb7('0x5f')],'WhatsappAccountId':_0x2dcdcf[_0x8cb7('0x5c')]['id'],'WhatsappInteractionId':_0x5e47c5['id'],'direction':'in','ContactId':_0x5e47c5[_0x8cb7('0xb3')],'AttachmentId':_0x220659[_0x8cb7('0x5f')][_0x8cb7('0xb4')]});})[_0x8cb7('0x21')](function(_0x2c3a6c){_0x220659[_0x8cb7('0x29')]=_0x2c3a6c;if(_0x220659[_0x8cb7('0xae')]['UserId']){return db[_0x8cb7('0x7b')][_0x8cb7('0x66')]({'attributes':['id','name'],'where':{'id':_0x220659[_0x8cb7('0xae')][_0x8cb7('0xb5')]}})[_0x8cb7('0x21')](function(_0x5bebb){if(_0x5bebb){_0x220659[_0x8cb7('0x8f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x8cb7('0xb6'),'appdata':_0x5bebb[_0x8cb7('0x3e')]+','+(_0x220659[_0x8cb7('0x88')][_0x8cb7('0xb7')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x8cb7('0xb8'),_0x220659);});}return respondWithRpcPromise(_0x8cb7('0xb9'),_0x8cb7('0xb8'),_0x220659);})['then'](function(_0x295098){if(_0x295098){var _0x5bfb32=0xc8;var _0x21e27f=_0x8cb7('0xba');logger[_0x8cb7('0x22')](_0x8cb7('0x25'),_0x21e27f,_0x5bfb32,_0x8cb7('0xbb'));logger[_0x8cb7('0x24')](_0x8cb7('0xbc'),_0x21e27f,_0x5bfb32,'entity\x20found',JSON[_0x8cb7('0x26')](_0x295098));if(_0x220659[_0x8cb7('0x88')][_0x8cb7('0x45')]===_0x8cb7('0xbd')){return _0x13b7b9['status'](_0x5bfb32)[_0x8cb7('0x33')](_0x8cb7('0xbe'),_0x8cb7('0xbf'))['send'](_0x8cb7('0xc0'));}else{return _0x13b7b9[_0x8cb7('0x2d')](_0x5bfb32)[_0x8cb7('0x35')](_0x295098);}}});})[_0x8cb7('0x2b')](handleError(_0x13b7b9,null));};exports['send']=function(_0x1b132a,_0x20ed5f,_0x1f8c59){var _0x50f4be,_0x57fd5e,_0x483881;if(_[_0x8cb7('0xa4')](_0x1b132a[_0x8cb7('0x5f')][_0x8cb7('0x5f')])||_0x1b132a[_0x8cb7('0x5f')][_0x8cb7('0x5f')]===''){throw new db[(_0x8cb7('0x93'))][(_0x8cb7('0x94'))](_0x8cb7('0xa5'));}if(_[_0x8cb7('0xa4')](_0x1b132a[_0x8cb7('0x5f')]['to'])){throw new db[(_0x8cb7('0x93'))]['ValidationError']('to\x20is\x20mandatory');}_0x50f4be=_0x1b132a[_0x8cb7('0x5f')]['to'];return db[_0x8cb7('0x58')]['find']({'where':{'id':_0x1b132a['params']['id']},'include':[{'model':db[_0x8cb7('0xc1')],'as':_0x8cb7('0xc2'),'include':[{'model':db[_0x8cb7('0x92')],'as':_0x8cb7('0xaa'),'where':{'mobile':_0x50f4be},'limit':0x1,'order':[['updatedAt',_0x8cb7('0xab')]]}]}]})[_0x8cb7('0x21')](handleEntityNotFound(_0x20ed5f,null))['then'](function(_0xf3ad5e){if(_0xf3ad5e&&_0xf3ad5e[_0x8cb7('0xc2')]){_0x57fd5e=_0xf3ad5e[_0x8cb7('0x3b')]({'plain':!![]});if(_0x57fd5e[_0x8cb7('0xc2')]&&_0x57fd5e['List'][_0x8cb7('0xaa')][_0x8cb7('0x4f')]){return _0x57fd5e[_0x8cb7('0xc2')][_0x8cb7('0xaa')][0x0];}return db[_0x8cb7('0x92')][_0x8cb7('0x5e')](_[_0x8cb7('0xc3')](_0x1b132a[_0x8cb7('0x5f')],{'firstName':_0x50f4be,'mobile':_0x50f4be,'phone':_0x50f4be,'ListId':_0x57fd5e[_0x8cb7('0x9a')]}));}})['then'](handleEntityNotFound(_0x20ed5f,null))[_0x8cb7('0x21')](function(_0x545e7a){if(_0x545e7a){_0x483881=_0x545e7a;return db['WhatsappInteraction'][_0x8cb7('0x66')]({'where':{'ContactId':_0x483881['id'],'closed':![],'WhatsappAccountId':_0x57fd5e['id']}})['then'](function(_0x5bff33){if(_0x5bff33){return[_0x5bff33,![]];}return db[_0x8cb7('0xad')][_0x8cb7('0x5e')]({'UserId':_0x1b132a[_0x8cb7('0x60')]['id'],'ContactId':_0x483881['id'],'WhatsappAccountId':_0x57fd5e['id'],'phone':_0x50f4be,'firstMsgDirection':_0x8cb7('0xc4'),'Messages':[_[_0x8cb7('0x5d')](_0x1b132a[_0x8cb7('0x5f')],{'read':![],'body':_0x1b132a[_0x8cb7('0x5f')][_0x8cb7('0x5f')],'phone':_0x50f4be,'WhatsappAccountId':_0x57fd5e['id'],'UserId':_0x1b132a[_0x8cb7('0x60')]['id'],'ContactId':_0x483881['id']})]},{'include':[{'model':db[_0x8cb7('0x8d')],'as':_0x8cb7('0xc5')}]})[_0x8cb7('0x21')](function(_0x249f8f){return[_0x249f8f,!![]];});});}})[_0x8cb7('0x76')](function(_0x9b441f,_0x20913a){if(_0x20913a){return _0x9b441f;}return db['WhatsappMessage']['create'](_['merge'](_0x1b132a[_0x8cb7('0x5f')],{'read':![],'body':_0x1b132a[_0x8cb7('0x5f')][_0x8cb7('0x5f')],'phone':_0x50f4be,'WhatsappAccountId':_0x57fd5e['id'],'WhatsappInteractionId':_0x9b441f['id'],'UserId':_0x1b132a['user']['id'],'ContactId':_0x483881['id']}))[_0x8cb7('0x21')](function(_0x58377c){_0x9b441f[_0x8cb7('0xc6')][_0x8cb7('0xc5')]=[];_0x9b441f['dataValues'][_0x8cb7('0xc5')][_0x8cb7('0xc7')](_0x58377c[_0x8cb7('0xc6')]);return _0x9b441f;});})[_0x8cb7('0x21')](respondWithResult(_0x20ed5f,null))[_0x8cb7('0x2b')](handleError(_0x20ed5f,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 46644e1..408d439 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 _0x061f=['emit','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove'];(function(_0xf8935e,_0x2cf61f){var _0x458463=function(_0xc15fb4){while(--_0xc15fb4){_0xf8935e['push'](_0xf8935e['shift']());}};_0x458463(++_0x2cf61f);}(_0x061f,0x112));var _0xf061=function(_0x4b2801,_0x5895e5){_0x4b2801=_0x4b2801-0x0;var _0x346455=_0x061f[_0x4b2801];return _0x346455;};'use strict';var EventEmitter=require(_0xf061('0x0'));var WhatsappAccount=require(_0xf061('0x1'))['db'][_0xf061('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf061('0x3')](0x0);var events={'afterCreate':_0xf061('0x4'),'afterUpdate':'update','afterDestroy':_0xf061('0x5')};function emitEvent(_0x4735fd){return function(_0x34a78d,_0x37183c,_0x5348b4){WhatsappAccountEvents[_0xf061('0x6')](_0x4735fd+':'+_0x34a78d['id'],_0x34a78d);WhatsappAccountEvents[_0xf061('0x6')](_0x4735fd,_0x34a78d);_0x5348b4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xf061('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0xfe8c=['events','WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0xfe8c,0x1e0));var _0xcfe8=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xfe8c[_0x381589];return _0x2a075d;};'use strict';var EventEmitter=require(_0xcfe8('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xcfe8('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xcfe8('0x2')](0x0);var events={'afterCreate':_0xcfe8('0x3'),'afterUpdate':_0xcfe8('0x4'),'afterDestroy':_0xcfe8('0x5')};function emitEvent(_0x2a1452){return function(_0x5cbce8,_0xd39529,_0x548f77){WhatsappAccountEvents[_0xcfe8('0x6')](_0x2a1452+':'+_0x5cbce8['id'],_0x5cbce8);WhatsappAccountEvents[_0xcfe8('0x6')](_0x2a1452,_0x5cbce8);_0x548f77(null);};}for(var e in events){if(events[_0xcfe8('0x7')](e)){var event=events[e];WhatsappAccount[_0xcfe8('0x8')](e,emitEvent(event));}}module[_0xcfe8('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 8244247..5fa7a3a 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 _0xca98=['bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x2c4cee,_0xed54d6){var _0x4cad54=function(_0x5ee3bd){while(--_0x5ee3bd){_0x2c4cee['push'](_0x2c4cee['shift']());}};_0x4cad54(++_0xed54d6);}(_0xca98,0xa3));var _0x8ca9=function(_0x29c3b2,_0x3c12ac){_0x29c3b2=_0x29c3b2-0x0;var _0x4b3aa7=_0xca98[_0x29c3b2];return _0x4b3aa7;};'use strict';var _=require(_0x8ca9('0x0'));var util=require(_0x8ca9('0x1'));var logger=require(_0x8ca9('0x2'))(_0x8ca9('0x3'));var moment=require(_0x8ca9('0x4'));var BPromise=require(_0x8ca9('0x5'));var rp=require(_0x8ca9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ca9('0x7'));var config=require(_0x8ca9('0x8'));var attributes=require(_0x8ca9('0x9'));module[_0x8ca9('0xa')]=function(_0x47b314,_0x17acac){return _0x47b314[_0x8ca9('0xb')](_0x8ca9('0xc'),attributes,{'tableName':_0x8ca9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa231=['request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','moment','bluebird'];(function(_0x4babfa,_0x8c69e4){var _0x41b798=function(_0x2be0cd){while(--_0x2be0cd){_0x4babfa['push'](_0x4babfa['shift']());}};_0x41b798(++_0x8c69e4);}(_0xa231,0x132));var _0x1a23=function(_0x236cc0,_0xc76be8){_0x236cc0=_0x236cc0-0x0;var _0x509cc7=_0xa231[_0x236cc0];return _0x509cc7;};'use strict';var _=require(_0x1a23('0x0'));var util=require(_0x1a23('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1a23('0x2'));var BPromise=require(_0x1a23('0x3'));var rp=require(_0x1a23('0x4'));var fs=require('fs');var path=require(_0x1a23('0x5'));var rimraf=require(_0x1a23('0x6'));var config=require(_0x1a23('0x7'));var attributes=require('./whatsappAccount.attributes');module[_0x1a23('0x8')]=function(_0x26d068,_0xc7e8a9){return _0x26d068[_0x1a23('0x9')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 1327628..a996339 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 _0x7268=['model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowWhatsappAccount','find','raw','options','where','attributes','map','include'];(function(_0x31c6b6,_0xdd33b7){var _0x32b27b=function(_0x32f195){while(--_0x32f195){_0x31c6b6['push'](_0x31c6b6['shift']());}};_0x32b27b(++_0xdd33b7);}(_0x7268,0x146));var _0x8726=function(_0x5462d5,_0x484cf5){_0x5462d5=_0x5462d5-0x0;var _0x3d0fcb=_0x7268[_0x5462d5];return _0x3d0fcb;};'use strict';var _=require(_0x8726('0x0'));var util=require('util');var moment=require(_0x8726('0x1'));var BPromise=require(_0x8726('0x2'));var rs=require(_0x8726('0x3'));var fs=require('fs');var Redis=require(_0x8726('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8726('0x5'));var logger=require(_0x8726('0x6'))(_0x8726('0x7'));var config=require('../../config/environment');var jayson=require(_0x8726('0x8'));var client=jayson['client'][_0x8726('0x9')]({'port':0x232a});config[_0x8726('0xa')]=_[_0x8726('0xb')](config[_0x8726('0xa')],{'host':_0x8726('0xc'),'port':0x18eb});var socket=require(_0x8726('0xd'))(new Redis(config[_0x8726('0xa')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x208825,_0x2e2c8f,_0x535099){return new BPromise(function(_0x46e804,_0xe52c1){return client[_0x8726('0xe')](_0x208825,_0x535099)['then'](function(_0x594872){logger['info'](_0x8726('0xf'),_0x2e2c8f,_0x8726('0x10'));logger[_0x8726('0x11')](_0x8726('0x12'),_0x2e2c8f,_0x8726('0x10'),JSON[_0x8726('0x13')](_0x594872));if(_0x594872[_0x8726('0x14')]){if(_0x594872[_0x8726('0x14')][_0x8726('0x15')]===0x1f4){logger['error'](_0x8726('0xf'),_0x2e2c8f,_0x594872[_0x8726('0x14')][_0x8726('0x16')]);return _0xe52c1(_0x594872[_0x8726('0x14')][_0x8726('0x16')]);}logger[_0x8726('0x14')](_0x8726('0xf'),_0x2e2c8f,_0x594872[_0x8726('0x14')][_0x8726('0x16')]);return _0x46e804(_0x594872[_0x8726('0x14')]['message']);}else{logger[_0x8726('0x17')](_0x8726('0xf'),_0x2e2c8f,_0x8726('0x10'));_0x46e804(_0x594872[_0x8726('0x18')]['message']);}})[_0x8726('0x19')](function(_0x1cb35f){logger[_0x8726('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x2e2c8f,_0x1cb35f);_0xe52c1(_0x1cb35f);});});}exports[_0x8726('0x1a')]=function(_0x4524be){var _0xec568c=this;return new Promise(function(_0x42f1bf,_0x44d9bc){return db['WhatsappAccount'][_0x8726('0x1b')]({'raw':_0x4524be['options']?_0x4524be['options'][_0x8726('0x1c')]===undefined?!![]:![]:!![],'where':_0x4524be['options']?_0x4524be[_0x8726('0x1d')][_0x8726('0x1e')]||null:null,'attributes':_0x4524be[_0x8726('0x1d')]?_0x4524be[_0x8726('0x1d')][_0x8726('0x1f')]||null:null,'include':_0x4524be[_0x8726('0x1d')]?_0x4524be[_0x8726('0x1d')]['include']?_[_0x8726('0x20')](_0x4524be[_0x8726('0x1d')][_0x8726('0x21')],function(_0x552bd9){return{'model':db[_0x552bd9[_0x8726('0x22')]],'as':_0x552bd9['as'],'attributes':_0x552bd9[_0x8726('0x1f')],'include':_0x552bd9[_0x8726('0x21')]?_[_0x8726('0x20')](_0x552bd9[_0x8726('0x21')],function(_0x3b6cc1){return{'model':db[_0x3b6cc1[_0x8726('0x22')]],'as':_0x3b6cc1['as'],'attributes':_0x3b6cc1[_0x8726('0x1f')],'include':_0x3b6cc1['include']?_[_0x8726('0x20')](_0x3b6cc1[_0x8726('0x21')],function(_0x3779e3){return{'model':db[_0x3779e3[_0x8726('0x22')]],'as':_0x3779e3['as'],'attributes':_0x3779e3[_0x8726('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8726('0x23')](function(_0x247e09){logger[_0x8726('0x17')]('ShowWhatsappAccount',_0x4524be);logger[_0x8726('0x11')](_0x8726('0x1a'),_0x4524be,JSON[_0x8726('0x13')](_0x247e09));_0x42f1bf(_0x247e09);})[_0x8726('0x19')](function(_0x59fbbe){logger[_0x8726('0x14')](_0x8726('0x1a'),_0x59fbbe[_0x8726('0x16')],_0x4524be);_0x44d9bc(_0xec568c[_0x8726('0x14')](0x1f4,_0x59fbbe[_0x8726('0x16')]));});});}; \ No newline at end of file +var _0xec49=['../../config/environment','client','http','redis','defaults','localhost','./whatsappAccount.socket','register','request','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','ShowWhatsappAccount','find','options','raw','where','attributes','include','map','model','stringify','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x41d1f0,_0x2b7496){var _0x5c8508=function(_0x451424){while(--_0x451424){_0x41d1f0['push'](_0x41d1f0['shift']());}};_0x5c8508(++_0x2b7496);}(_0xec49,0x190));var _0x9ec4=function(_0x1f9e53,_0x58185b){_0x1f9e53=_0x1f9e53-0x0;var _0x477295=_0xec49[_0x1f9e53];return _0x477295;};'use strict';var _=require(_0x9ec4('0x0'));var util=require(_0x9ec4('0x1'));var moment=require('moment');var BPromise=require(_0x9ec4('0x2'));var rs=require(_0x9ec4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ec4('0x4'))['db'];var utils=require(_0x9ec4('0x5'));var logger=require(_0x9ec4('0x6'))(_0x9ec4('0x7'));var config=require(_0x9ec4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9ec4('0x9')][_0x9ec4('0xa')]({'port':0x232a});config[_0x9ec4('0xb')]=_[_0x9ec4('0xc')](config[_0x9ec4('0xb')],{'host':_0x9ec4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ec4('0xb')]));require(_0x9ec4('0xe'))[_0x9ec4('0xf')](socket);function respondWithRpcPromise(_0x1c11fe,_0x468c40,_0x230636){return new BPromise(function(_0x56398a,_0x44379e){return client[_0x9ec4('0x10')](_0x1c11fe,_0x230636)['then'](function(_0x303daf){logger['info'](_0x9ec4('0x11'),_0x468c40,_0x9ec4('0x12'));logger[_0x9ec4('0x13')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x468c40,_0x9ec4('0x12'),JSON['stringify'](_0x303daf));if(_0x303daf[_0x9ec4('0x14')]){if(_0x303daf['error']['code']===0x1f4){logger[_0x9ec4('0x14')](_0x9ec4('0x11'),_0x468c40,_0x303daf[_0x9ec4('0x14')]['message']);return _0x44379e(_0x303daf[_0x9ec4('0x14')][_0x9ec4('0x15')]);}logger[_0x9ec4('0x14')](_0x9ec4('0x11'),_0x468c40,_0x303daf[_0x9ec4('0x14')]['message']);return _0x56398a(_0x303daf[_0x9ec4('0x14')][_0x9ec4('0x15')]);}else{logger['info'](_0x9ec4('0x11'),_0x468c40,_0x9ec4('0x12'));_0x56398a(_0x303daf[_0x9ec4('0x16')]['message']);}})['catch'](function(_0x47f9d1){logger['error'](_0x9ec4('0x11'),_0x468c40,_0x47f9d1);_0x44379e(_0x47f9d1);});});}exports[_0x9ec4('0x17')]=function(_0x5a83f0){var _0x15ee6d=this;return new Promise(function(_0x19fd1f,_0x2b6ac9){return db['WhatsappAccount'][_0x9ec4('0x18')]({'raw':_0x5a83f0['options']?_0x5a83f0[_0x9ec4('0x19')][_0x9ec4('0x1a')]===undefined?!![]:![]:!![],'where':_0x5a83f0[_0x9ec4('0x19')]?_0x5a83f0[_0x9ec4('0x19')][_0x9ec4('0x1b')]||null:null,'attributes':_0x5a83f0['options']?_0x5a83f0[_0x9ec4('0x19')][_0x9ec4('0x1c')]||null:null,'include':_0x5a83f0[_0x9ec4('0x19')]?_0x5a83f0[_0x9ec4('0x19')][_0x9ec4('0x1d')]?_[_0x9ec4('0x1e')](_0x5a83f0[_0x9ec4('0x19')]['include'],function(_0x338526){return{'model':db[_0x338526[_0x9ec4('0x1f')]],'as':_0x338526['as'],'attributes':_0x338526[_0x9ec4('0x1c')],'include':_0x338526[_0x9ec4('0x1d')]?_[_0x9ec4('0x1e')](_0x338526['include'],function(_0x1f16c5){return{'model':db[_0x1f16c5[_0x9ec4('0x1f')]],'as':_0x1f16c5['as'],'attributes':_0x1f16c5[_0x9ec4('0x1c')],'include':_0x1f16c5[_0x9ec4('0x1d')]?_['map'](_0x1f16c5['include'],function(_0x3ad963){return{'model':db[_0x3ad963[_0x9ec4('0x1f')]],'as':_0x3ad963['as'],'attributes':_0x3ad963['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x411ed1){logger['info'](_0x9ec4('0x17'),_0x5a83f0);logger[_0x9ec4('0x13')](_0x9ec4('0x17'),_0x5a83f0,JSON[_0x9ec4('0x20')](_0x411ed1));_0x19fd1f(_0x411ed1);})[_0x9ec4('0x21')](function(_0x20da15){logger[_0x9ec4('0x14')](_0x9ec4('0x17'),_0x20da15['message'],_0x5a83f0);_0x2b6ac9(_0x15ee6d[_0x9ec4('0x14')](0x1f4,_0x20da15['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 835209b..bb05953 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 _0xe745=['removeListener','register','length','save','update','emit'];(function(_0x53ff05,_0x710e8){var _0x45159e=function(_0x14c180){while(--_0x14c180){_0x53ff05['push'](_0x53ff05['shift']());}};_0x45159e(++_0x710e8);}(_0xe745,0xf9));var _0x5e74=function(_0x4f9c9b,_0x647ec6){_0x4f9c9b=_0x4f9c9b-0x0;var _0x9ddc3e=_0xe745[_0x4f9c9b];return _0x9ddc3e;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x5e74('0x0'),'remove',_0x5e74('0x1')];function createListener(_0x17f78f,_0x140948){return function(_0x2e6364){_0x140948[_0x5e74('0x2')](_0x17f78f,_0x2e6364);};}function removeListener(_0x124890,_0x50771f){return function(){WhatsappAccountEvents[_0x5e74('0x3')](_0x124890,_0x50771f);};}exports[_0x5e74('0x4')]=function(_0x442a5f){for(var _0x14c398=0x0,_0x251de1=events[_0x5e74('0x5')];_0x14c398<_0x251de1;_0x14c398++){var _0x21ce91=events[_0x14c398];var _0x4beb47=createListener('whatsappAccount:'+_0x21ce91,_0x442a5f);WhatsappAccountEvents['on'](_0x21ce91,_0x4beb47);}}; \ No newline at end of file +var _0xea53=['emit','removeListener','length','whatsappAccount:','./whatsappAccount.events','save','update'];(function(_0x502dc2,_0x46ef5b){var _0x59b089=function(_0x2c0335){while(--_0x2c0335){_0x502dc2['push'](_0x502dc2['shift']());}};_0x59b089(++_0x46ef5b);}(_0xea53,0x107));var _0x3ea5=function(_0x450567,_0xf10a96){_0x450567=_0x450567-0x0;var _0x426215=_0xea53[_0x450567];return _0x426215;};'use strict';var WhatsappAccountEvents=require(_0x3ea5('0x0'));var events=[_0x3ea5('0x1'),'remove',_0x3ea5('0x2')];function createListener(_0x2792d8,_0x51539e){return function(_0x54abc2){_0x51539e[_0x3ea5('0x3')](_0x2792d8,_0x54abc2);};}function removeListener(_0x2e3940,_0xa161f5){return function(){WhatsappAccountEvents[_0x3ea5('0x4')](_0x2e3940,_0xa161f5);};}exports['register']=function(_0x39b9fd){for(var _0x5da511=0x0,_0x34c1de=events[_0x3ea5('0x5')];_0x5da511<_0x34c1de;_0x5da511++){var _0x3a831f=events[_0x5da511];var _0x234841=createListener(_0x3ea5('0x6')+_0x3a831f,_0x39b9fd);WhatsappAccountEvents['on'](_0x3a831f,_0x234841);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 73fdf30..0421aef 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 _0xb3cd=['exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','isAuthenticated','post','destroy'];(function(_0x243b9c,_0x5a499f){var _0x523a25=function(_0x2172ea){while(--_0x2172ea){_0x243b9c['push'](_0x243b9c['shift']());}};_0x523a25(++_0x5a499f);}(_0xb3cd,0x196));var _0xdb3c=function(_0x55fa03,_0xcb96c2){_0x55fa03=_0x55fa03-0x0;var _0x2cd7cd=_0xb3cd[_0x55fa03];return _0x2cd7cd;};'use strict';var multer=require('multer');var util=require(_0xdb3c('0x0'));var path=require('path');var timeout=require(_0xdb3c('0x1'));var express=require('express');var router=express[_0xdb3c('0x2')]();var fs_extra=require(_0xdb3c('0x3'));var auth=require(_0xdb3c('0x4'));var interaction=require(_0xdb3c('0x5'));var config=require(_0xdb3c('0x6'));var controller=require(_0xdb3c('0x7'));router[_0xdb3c('0x8')]('/',auth['isAuthenticated'](),controller[_0xdb3c('0x9')]);router[_0xdb3c('0x8')](_0xdb3c('0xa'),auth[_0xdb3c('0xb')](),controller['show']);router[_0xdb3c('0xc')]('/',auth[_0xdb3c('0xb')](),controller['create']);router['put'](_0xdb3c('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xdb3c('0xa'),auth['isAuthenticated'](),controller[_0xdb3c('0xd')]);module[_0xdb3c('0xe')]=router; \ No newline at end of file +var _0xacd3=['../../components/interaction/service','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x16edd2,_0x3060f5){var _0x2cc02e=function(_0x227162){while(--_0x227162){_0x16edd2['push'](_0x16edd2['shift']());}};_0x2cc02e(++_0x3060f5);}(_0xacd3,0x12a));var _0x3acd=function(_0x1e7620,_0x4ae24c){_0x1e7620=_0x1e7620-0x0;var _0x231e42=_0xacd3[_0x1e7620];return _0x231e42;};'use strict';var multer=require(_0x3acd('0x0'));var util=require(_0x3acd('0x1'));var path=require(_0x3acd('0x2'));var timeout=require(_0x3acd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3acd('0x4'));var auth=require(_0x3acd('0x5'));var interaction=require(_0x3acd('0x6'));var config=require('../../config/environment');var controller=require(_0x3acd('0x7'));router['get']('/',auth[_0x3acd('0x8')](),controller[_0x3acd('0x9')]);router[_0x3acd('0xa')](_0x3acd('0xb'),auth[_0x3acd('0x8')](),controller[_0x3acd('0xc')]);router[_0x3acd('0xd')]('/',auth[_0x3acd('0x8')](),controller[_0x3acd('0xe')]);router[_0x3acd('0xf')]('/:id',auth[_0x3acd('0x8')](),controller[_0x3acd('0x10')]);router[_0x3acd('0x11')](_0x3acd('0xb'),auth[_0x3acd('0x8')](),controller[_0x3acd('0x12')]);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 63f2f26..ef39db9 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 _0x5c94=['exports','INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0xf63384,_0x5c8d61){var _0x44a17a=function(_0x260205){while(--_0x260205){_0xf63384['push'](_0xf63384['shift']());}};_0x44a17a(++_0x5c8d61);}(_0x5c94,0x149));var _0x45c9=function(_0x28c732,_0x436f0a){_0x28c732=_0x28c732-0x0;var _0x55ab7e=_0x5c94[_0x28c732];return _0x55ab7e;};'use strict';var Sequelize=require(_0x45c9('0x0'));module[_0x45c9('0x1')]={'priority':{'type':Sequelize[_0x45c9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x45c9('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x45c9('0x4')]()},'description':{'type':Sequelize[_0x45c9('0x3')]},'interval':{'type':Sequelize[_0x45c9('0x3')],'defaultValue':_0x45c9('0x5')}}; \ No newline at end of file +var _0x1253=['STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1253,0x9f));var _0x3125=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1253[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x3125('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3125('0x1')],'allowNull':![],'defaultValue':_0x3125('0x2')},'appdata':{'type':Sequelize[_0x3125('0x3')]()},'description':{'type':Sequelize[_0x3125('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x3125('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index b557f77..5947463 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 _0x404d=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','send','map','WhatsappApplication','rawAttributes','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x404d,0x1e9));var _0xd404=function(_0xfd617,_0x41361f){_0xfd617=_0xfd617-0x0;var _0x1c0a28=_0x404d[_0xfd617];return _0x1c0a28;};'use strict';var emlformat=require(_0xd404('0x0'));var rimraf=require(_0xd404('0x1'));var zipdir=require(_0xd404('0x2'));var jsonpatch=require(_0xd404('0x3'));var rp=require(_0xd404('0x4'));var moment=require(_0xd404('0x5'));var BPromise=require(_0xd404('0x6'));var Mustache=require(_0xd404('0x7'));var util=require(_0xd404('0x8'));var path=require('path');var sox=require(_0xd404('0x9'));var csv=require(_0xd404('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd404('0xb'));var _=require(_0xd404('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd404('0xd'));var deskjs=require(_0xd404('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd404('0xf'));var Redis=require(_0xd404('0x10'));var authService=require(_0xd404('0x11'));var qs=require(_0xd404('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd404('0x13'))(_0xd404('0x14'));var utils=require('../../config/utils');var config=require(_0xd404('0x15'));var licenseUtil=require(_0xd404('0x16'));var db=require(_0xd404('0x17'))['db'];function respondWithStatusCode(_0x2cc1ec,_0x1d6071){_0x1d6071=_0x1d6071||0xcc;return function(_0x9f7667){if(_0x9f7667){return _0x2cc1ec[_0xd404('0x18')](_0x1d6071);}return _0x2cc1ec[_0xd404('0x19')](_0x1d6071)[_0xd404('0x1a')]();};}function respondWithResult(_0x31c8f8,_0x2516c2){_0x2516c2=_0x2516c2||0xc8;return function(_0x2ff703){if(_0x2ff703){return _0x31c8f8[_0xd404('0x19')](_0x2516c2)[_0xd404('0x1b')](_0x2ff703);}};}function respondWithFilteredResult(_0xaf965f,_0x424467){return function(_0x2051e8){if(_0x2051e8){var _0xa4d1b2=typeof _0x424467[_0xd404('0x1c')]===_0xd404('0x1d')&&typeof _0x424467[_0xd404('0x1e')]==='undefined';var _0x1ad1c4=_0x2051e8[_0xd404('0x1f')];var _0x5e19e4=_0xa4d1b2?0x0:_0x424467[_0xd404('0x1c')];var _0x149fa5=_0xa4d1b2?_0x2051e8['count']:_0x424467[_0xd404('0x1c')]+_0x424467[_0xd404('0x1e')];var _0x387d0b;if(_0x149fa5>=_0x1ad1c4){_0x149fa5=_0x1ad1c4;_0x387d0b=0xc8;}else{_0x387d0b=0xce;}_0xaf965f['status'](_0x387d0b);return _0xaf965f[_0xd404('0x20')](_0xd404('0x21'),_0x5e19e4+'-'+_0x149fa5+'/'+_0x1ad1c4)[_0xd404('0x1b')](_0x2051e8);}return null;};}function patchUpdates(_0x3e8183){return function(_0x1d89e0){try{jsonpatch[_0xd404('0x22')](_0x1d89e0,_0x3e8183,!![]);}catch(_0x458f6e){return BPromise['reject'](_0x458f6e);}return _0x1d89e0[_0xd404('0x23')]();};}function saveUpdates(_0xcc7bf1,_0x50c0e2){return function(_0x17d0e6){if(_0x17d0e6){return _0x17d0e6['update'](_0xcc7bf1)['then'](function(_0x1005d1){return _0x1005d1;});}return null;};}function removeEntity(_0x476731,_0x133232){return function(_0x32b5f8){if(_0x32b5f8){return _0x32b5f8['destroy']()[_0xd404('0x24')](function(){_0x476731[_0xd404('0x19')](0xcc)[_0xd404('0x1a')]();});}};}function handleEntityNotFound(_0x55cfde,_0x557d0e){return function(_0x3e706a){if(!_0x3e706a){_0x55cfde[_0xd404('0x18')](0x194);}return _0x3e706a;};}function handleError(_0x2d7af8,_0x36fdb6){_0x36fdb6=_0x36fdb6||0x1f4;return function(_0x1ddf0d){logger[_0xd404('0x25')](_0x1ddf0d[_0xd404('0x26')]);if(_0x1ddf0d[_0xd404('0x27')]){delete _0x1ddf0d['name'];}_0x2d7af8['status'](_0x36fdb6)[_0xd404('0x28')](_0x1ddf0d);};}exports['index']=function(_0x2b14ec,_0x4f210c){var _0x23525b={},_0x1e6341={},_0x3e746e={'count':0x0,'rows':[]};var _0x2268d2=_[_0xd404('0x29')](db[_0xd404('0x2a')][_0xd404('0x2b')],function(_0x4ece21){return{'name':_0x4ece21['fieldName'],'type':_0x4ece21[_0xd404('0x2c')]['key']};});_0x1e6341['model']=_[_0xd404('0x29')](_0x2268d2,_0xd404('0x27'));_0x1e6341[_0xd404('0x2d')]=_['keys'](_0x2b14ec[_0xd404('0x2d')]);_0x1e6341['filters']=_[_0xd404('0x2e')](_0x1e6341[_0xd404('0x2f')],_0x1e6341['query']);_0x23525b[_0xd404('0x30')]=_[_0xd404('0x2e')](_0x1e6341[_0xd404('0x2f')],qs[_0xd404('0x31')](_0x2b14ec[_0xd404('0x2d')]['fields']));_0x23525b[_0xd404('0x30')]=_0x23525b[_0xd404('0x30')][_0xd404('0x32')]?_0x23525b['attributes']:_0x1e6341[_0xd404('0x2f')];if(!_0x2b14ec[_0xd404('0x2d')][_0xd404('0x33')](_0xd404('0x34'))){_0x23525b['limit']=qs['limit'](_0x2b14ec[_0xd404('0x2d')][_0xd404('0x1e')]);_0x23525b[_0xd404('0x1c')]=qs[_0xd404('0x1c')](_0x2b14ec[_0xd404('0x2d')][_0xd404('0x1c')]);}_0x23525b['order']=qs[_0xd404('0x35')](_0x2b14ec[_0xd404('0x2d')][_0xd404('0x35')]);_0x23525b['where']=qs[_0xd404('0x36')](_[_0xd404('0x37')](_0x2b14ec[_0xd404('0x2d')],_0x1e6341['filters']),_0x2268d2);if(_0x2b14ec[_0xd404('0x2d')][_0xd404('0x38')]){_0x23525b[_0xd404('0x39')]=_['merge'](_0x23525b[_0xd404('0x39')],{'$or':_[_0xd404('0x29')](_0x2268d2,function(_0x47a108){if(_0x47a108[_0xd404('0x2c')]!==_0xd404('0x3a')){var _0x237592={};_0x237592[_0x47a108[_0xd404('0x27')]]={'$like':'%'+_0x2b14ec[_0xd404('0x2d')][_0xd404('0x38')]+'%'};return _0x237592;}})});}_0x23525b=_[_0xd404('0x3b')]({},_0x23525b,_0x2b14ec[_0xd404('0x3c')]);var _0x58f0ad={'where':_0x23525b[_0xd404('0x39')]};return db['WhatsappApplication'][_0xd404('0x1f')](_0x58f0ad)[_0xd404('0x24')](function(_0x598f08){_0x3e746e[_0xd404('0x1f')]=_0x598f08;if(_0x2b14ec['query'][_0xd404('0x3d')]){_0x23525b['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0xd404('0x3e')](_0x23525b);})[_0xd404('0x24')](function(_0x397f30){_0x3e746e[_0xd404('0x3f')]=_0x397f30;return _0x3e746e;})['then'](respondWithFilteredResult(_0x4f210c,_0x23525b))['catch'](handleError(_0x4f210c,null));};exports[_0xd404('0x40')]=function(_0x234876,_0x8c56bc){var _0x108cc3={'raw':!![],'where':{'id':_0x234876[_0xd404('0x41')]['id']}},_0x199d66={};_0x199d66[_0xd404('0x2f')]=_['keys'](db[_0xd404('0x2a')]['rawAttributes']);_0x199d66[_0xd404('0x2d')]=_['keys'](_0x234876[_0xd404('0x2d')]);_0x199d66[_0xd404('0x36')]=_[_0xd404('0x2e')](_0x199d66['model'],_0x199d66[_0xd404('0x2d')]);_0x108cc3[_0xd404('0x30')]=_[_0xd404('0x2e')](_0x199d66[_0xd404('0x2f')],qs['fields'](_0x234876[_0xd404('0x2d')][_0xd404('0x31')]));_0x108cc3[_0xd404('0x30')]=_0x108cc3[_0xd404('0x30')][_0xd404('0x32')]?_0x108cc3[_0xd404('0x30')]:_0x199d66[_0xd404('0x2f')];if(_0x234876[_0xd404('0x2d')][_0xd404('0x3d')]){_0x108cc3[_0xd404('0x42')]=[{'all':!![]}];}_0x108cc3=_[_0xd404('0x3b')]({},_0x108cc3,_0x234876['options']);return db[_0xd404('0x2a')][_0xd404('0x43')](_0x108cc3)[_0xd404('0x24')](handleEntityNotFound(_0x8c56bc,null))[_0xd404('0x24')](respondWithResult(_0x8c56bc,null))[_0xd404('0x44')](handleError(_0x8c56bc,null));};exports['create']=function(_0x175982,_0x30cc1c){return db['WhatsappApplication'][_0xd404('0x45')](_0x175982[_0xd404('0x46')],{})[_0xd404('0x24')](respondWithResult(_0x30cc1c,0xc9))[_0xd404('0x44')](handleError(_0x30cc1c,null));};exports[_0xd404('0x47')]=function(_0x169dc9,_0x21ff82){if(_0x169dc9[_0xd404('0x46')]['id']){delete _0x169dc9[_0xd404('0x46')]['id'];}return db['WhatsappApplication'][_0xd404('0x43')]({'where':{'id':_0x169dc9[_0xd404('0x41')]['id']}})['then'](handleEntityNotFound(_0x21ff82,null))[_0xd404('0x24')](saveUpdates(_0x169dc9[_0xd404('0x46')],null))[_0xd404('0x24')](respondWithResult(_0x21ff82,null))['catch'](handleError(_0x21ff82,null));};exports[_0xd404('0x48')]=function(_0x584a03,_0x16737a){return db[_0xd404('0x2a')][_0xd404('0x43')]({'where':{'id':_0x584a03[_0xd404('0x41')]['id']}})[_0xd404('0x24')](handleEntityNotFound(_0x16737a,null))['then'](removeEntity(_0x16737a,null))['catch'](handleError(_0x16737a,null));}; \ No newline at end of file +var _0x1ab1=['find','create','body','catch','eml-format','fast-json-patch','mustache','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','WhatsappApplication','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll'];(function(_0x4cd033,_0x16eb39){var _0x5e5f42=function(_0x3ed720){while(--_0x3ed720){_0x4cd033['push'](_0x4cd033['shift']());}};_0x5e5f42(++_0x16eb39);}(_0x1ab1,0x12c));var _0x11ab=function(_0xbb2d0f,_0x23bad7){_0xbb2d0f=_0xbb2d0f-0x0;var _0x15ff95=_0x1ab1[_0xbb2d0f];return _0x15ff95;};'use strict';var emlformat=require(_0x11ab('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x11ab('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x11ab('0x2'));var util=require('util');var path=require(_0x11ab('0x3'));var sox=require(_0x11ab('0x4'));var csv=require(_0x11ab('0x5'));var ejs=require(_0x11ab('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11ab('0x7'));var squel=require(_0x11ab('0x8'));var crypto=require(_0x11ab('0x9'));var jsforce=require(_0x11ab('0xa'));var deskjs=require(_0x11ab('0xb'));var toCsv=require(_0x11ab('0x5'));var querystring=require('querystring');var Papa=require(_0x11ab('0xc'));var Redis=require('ioredis');var authService=require(_0x11ab('0xd'));var qs=require(_0x11ab('0xe'));var as=require(_0x11ab('0xf'));var hardwareService=require(_0x11ab('0x10'));var logger=require('../../config/logger')(_0x11ab('0x11'));var utils=require(_0x11ab('0x12'));var config=require(_0x11ab('0x13'));var licenseUtil=require(_0x11ab('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49aaa8,_0x45202d){_0x45202d=_0x45202d||0xcc;return function(_0x2d772f){if(_0x2d772f){return _0x49aaa8[_0x11ab('0x15')](_0x45202d);}return _0x49aaa8[_0x11ab('0x16')](_0x45202d)[_0x11ab('0x17')]();};}function respondWithResult(_0x582630,_0x33b5a8){_0x33b5a8=_0x33b5a8||0xc8;return function(_0x43f5d6){if(_0x43f5d6){return _0x582630[_0x11ab('0x16')](_0x33b5a8)[_0x11ab('0x18')](_0x43f5d6);}};}function respondWithFilteredResult(_0x4bbcf1,_0x39277d){return function(_0x462486){if(_0x462486){var _0x2ab33d=typeof _0x39277d[_0x11ab('0x19')]===_0x11ab('0x1a')&&typeof _0x39277d[_0x11ab('0x1b')]===_0x11ab('0x1a');var _0x4f0ca2=_0x462486[_0x11ab('0x1c')];var _0x4786a7=_0x2ab33d?0x0:_0x39277d[_0x11ab('0x19')];var _0x2db61e=_0x2ab33d?_0x462486[_0x11ab('0x1c')]:_0x39277d[_0x11ab('0x19')]+_0x39277d[_0x11ab('0x1b')];var _0x513500;if(_0x2db61e>=_0x4f0ca2){_0x2db61e=_0x4f0ca2;_0x513500=0xc8;}else{_0x513500=0xce;}_0x4bbcf1[_0x11ab('0x16')](_0x513500);return _0x4bbcf1[_0x11ab('0x1d')](_0x11ab('0x1e'),_0x4786a7+'-'+_0x2db61e+'/'+_0x4f0ca2)[_0x11ab('0x18')](_0x462486);}return null;};}function patchUpdates(_0x31485c){return function(_0x4ace6f){try{jsonpatch['apply'](_0x4ace6f,_0x31485c,!![]);}catch(_0x25a57f){return BPromise[_0x11ab('0x1f')](_0x25a57f);}return _0x4ace6f[_0x11ab('0x20')]();};}function saveUpdates(_0x27fdfd,_0x22b406){return function(_0x333b18){if(_0x333b18){return _0x333b18[_0x11ab('0x21')](_0x27fdfd)['then'](function(_0x5d1c09){return _0x5d1c09;});}return null;};}function removeEntity(_0x3a6d34,_0x1ea334){return function(_0x1bae08){if(_0x1bae08){return _0x1bae08[_0x11ab('0x22')]()[_0x11ab('0x23')](function(){_0x3a6d34[_0x11ab('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x418271,_0x913abd){return function(_0x47cad2){if(!_0x47cad2){_0x418271[_0x11ab('0x15')](0x194);}return _0x47cad2;};}function handleError(_0x3aeaee,_0x572377){_0x572377=_0x572377||0x1f4;return function(_0x57fe61){logger[_0x11ab('0x24')](_0x57fe61[_0x11ab('0x25')]);if(_0x57fe61[_0x11ab('0x26')]){delete _0x57fe61[_0x11ab('0x26')];}_0x3aeaee[_0x11ab('0x16')](_0x572377)[_0x11ab('0x27')](_0x57fe61);};}exports[_0x11ab('0x28')]=function(_0x51aff0,_0x238aad){var _0x28aed6={},_0x2563d3={},_0x10a4f8={'count':0x0,'rows':[]};var _0x25fe55=_[_0x11ab('0x29')](db[_0x11ab('0x2a')]['rawAttributes'],function(_0x3689b9){return{'name':_0x3689b9[_0x11ab('0x2b')],'type':_0x3689b9[_0x11ab('0x2c')][_0x11ab('0x2d')]};});_0x2563d3[_0x11ab('0x2e')]=_[_0x11ab('0x29')](_0x25fe55,'name');_0x2563d3[_0x11ab('0x2f')]=_['keys'](_0x51aff0[_0x11ab('0x2f')]);_0x2563d3[_0x11ab('0x30')]=_[_0x11ab('0x31')](_0x2563d3[_0x11ab('0x2e')],_0x2563d3[_0x11ab('0x2f')]);_0x28aed6[_0x11ab('0x32')]=_['intersection'](_0x2563d3[_0x11ab('0x2e')],qs[_0x11ab('0x33')](_0x51aff0['query'][_0x11ab('0x33')]));_0x28aed6[_0x11ab('0x32')]=_0x28aed6[_0x11ab('0x32')][_0x11ab('0x34')]?_0x28aed6[_0x11ab('0x32')]:_0x2563d3['model'];if(!_0x51aff0[_0x11ab('0x2f')][_0x11ab('0x35')](_0x11ab('0x36'))){_0x28aed6[_0x11ab('0x1b')]=qs[_0x11ab('0x1b')](_0x51aff0[_0x11ab('0x2f')][_0x11ab('0x1b')]);_0x28aed6[_0x11ab('0x19')]=qs[_0x11ab('0x19')](_0x51aff0[_0x11ab('0x2f')]['offset']);}_0x28aed6[_0x11ab('0x37')]=qs['sort'](_0x51aff0[_0x11ab('0x2f')][_0x11ab('0x38')]);_0x28aed6['where']=qs[_0x11ab('0x30')](_[_0x11ab('0x39')](_0x51aff0['query'],_0x2563d3[_0x11ab('0x30')]),_0x25fe55);if(_0x51aff0[_0x11ab('0x2f')][_0x11ab('0x3a')]){_0x28aed6[_0x11ab('0x3b')]=_[_0x11ab('0x3c')](_0x28aed6[_0x11ab('0x3b')],{'$or':_[_0x11ab('0x29')](_0x25fe55,function(_0x339dbe){if(_0x339dbe[_0x11ab('0x2c')]!==_0x11ab('0x3d')){var _0x53e438={};_0x53e438[_0x339dbe[_0x11ab('0x26')]]={'$like':'%'+_0x51aff0[_0x11ab('0x2f')][_0x11ab('0x3a')]+'%'};return _0x53e438;}})});}_0x28aed6=_[_0x11ab('0x3c')]({},_0x28aed6,_0x51aff0[_0x11ab('0x3e')]);var _0x4fac78={'where':_0x28aed6[_0x11ab('0x3b')]};return db[_0x11ab('0x2a')]['count'](_0x4fac78)['then'](function(_0x3a3489){_0x10a4f8[_0x11ab('0x1c')]=_0x3a3489;if(_0x51aff0[_0x11ab('0x2f')]['includeAll']){_0x28aed6[_0x11ab('0x3f')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x11ab('0x40')](_0x28aed6);})[_0x11ab('0x23')](function(_0x5c06f2){_0x10a4f8[_0x11ab('0x41')]=_0x5c06f2;return _0x10a4f8;})[_0x11ab('0x23')](respondWithFilteredResult(_0x238aad,_0x28aed6))['catch'](handleError(_0x238aad,null));};exports[_0x11ab('0x42')]=function(_0x41e33c,_0x1e808e){var _0x38f585={'raw':!![],'where':{'id':_0x41e33c[_0x11ab('0x43')]['id']}},_0x3af1b3={};_0x3af1b3[_0x11ab('0x2e')]=_[_0x11ab('0x44')](db[_0x11ab('0x2a')]['rawAttributes']);_0x3af1b3[_0x11ab('0x2f')]=_['keys'](_0x41e33c[_0x11ab('0x2f')]);_0x3af1b3[_0x11ab('0x30')]=_[_0x11ab('0x31')](_0x3af1b3[_0x11ab('0x2e')],_0x3af1b3['query']);_0x38f585['attributes']=_['intersection'](_0x3af1b3[_0x11ab('0x2e')],qs['fields'](_0x41e33c['query'][_0x11ab('0x33')]));_0x38f585[_0x11ab('0x32')]=_0x38f585[_0x11ab('0x32')][_0x11ab('0x34')]?_0x38f585['attributes']:_0x3af1b3['model'];if(_0x41e33c[_0x11ab('0x2f')][_0x11ab('0x45')]){_0x38f585[_0x11ab('0x3f')]=[{'all':!![]}];}_0x38f585=_['merge']({},_0x38f585,_0x41e33c['options']);return db[_0x11ab('0x2a')][_0x11ab('0x46')](_0x38f585)[_0x11ab('0x23')](handleEntityNotFound(_0x1e808e,null))[_0x11ab('0x23')](respondWithResult(_0x1e808e,null))['catch'](handleError(_0x1e808e,null));};exports[_0x11ab('0x47')]=function(_0x6ccb66,_0x268d0e){return db['WhatsappApplication']['create'](_0x6ccb66['body'],{})[_0x11ab('0x23')](respondWithResult(_0x268d0e,0xc9))['catch'](handleError(_0x268d0e,null));};exports['update']=function(_0x2ef826,_0x3df075){if(_0x2ef826[_0x11ab('0x48')]['id']){delete _0x2ef826[_0x11ab('0x48')]['id'];}return db[_0x11ab('0x2a')]['find']({'where':{'id':_0x2ef826[_0x11ab('0x43')]['id']}})[_0x11ab('0x23')](handleEntityNotFound(_0x3df075,null))[_0x11ab('0x23')](saveUpdates(_0x2ef826['body'],null))[_0x11ab('0x23')](respondWithResult(_0x3df075,null))[_0x11ab('0x49')](handleError(_0x3df075,null));};exports[_0x11ab('0x22')]=function(_0x627714,_0x238de4){return db[_0x11ab('0x2a')][_0x11ab('0x46')]({'where':{'id':_0x627714['params']['id']}})['then'](handleEntityNotFound(_0x238de4,null))[_0x11ab('0x23')](removeEntity(_0x238de4,null))['catch'](handleError(_0x238de4,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index ab7bd32..5eec788 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 _0x9b9b=['path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise'];(function(_0x3e0ff0,_0x433f8a){var _0x3ba409=function(_0x30d5b4){while(--_0x30d5b4){_0x3e0ff0['push'](_0x3e0ff0['shift']());}};_0x3ba409(++_0x433f8a);}(_0x9b9b,0x114));var _0xb9b9=function(_0x184e69,_0x39af04){_0x184e69=_0x184e69-0x0;var _0x57d8ad=_0x9b9b[_0x184e69];return _0x57d8ad;};'use strict';var _=require('lodash');var util=require(_0xb9b9('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb9b9('0x1'));var BPromise=require(_0xb9b9('0x2'));var rp=require(_0xb9b9('0x3'));var fs=require('fs');var path=require(_0xb9b9('0x4'));var rimraf=require(_0xb9b9('0x5'));var config=require(_0xb9b9('0x6'));var attributes=require(_0xb9b9('0x7'));module[_0xb9b9('0x8')]=function(_0x79dd,_0x3d1a95){return _0x79dd[_0xb9b9('0x9')](_0xb9b9('0xa'),attributes,{'tableName':_0xb9b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9b9('0xc'),'collate':_0xb9b9('0xd')});}; \ No newline at end of file +var _0xe181=['./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x546728,_0xdeaddd){var _0x1bc577=function(_0x2940c5){while(--_0x2940c5){_0x546728['push'](_0x546728['shift']());}};_0x1bc577(++_0xdeaddd);}(_0xe181,0x68));var _0x1e18=function(_0x36a4f9,_0x3f5506){_0x36a4f9=_0x36a4f9-0x0;var _0x479588=_0xe181[_0x36a4f9];return _0x479588;};'use strict';var _=require(_0x1e18('0x0'));var util=require('util');var logger=require(_0x1e18('0x1'))(_0x1e18('0x2'));var moment=require(_0x1e18('0x3'));var BPromise=require(_0x1e18('0x4'));var rp=require(_0x1e18('0x5'));var fs=require('fs');var path=require(_0x1e18('0x6'));var rimraf=require(_0x1e18('0x7'));var config=require('../../config/environment');var attributes=require(_0x1e18('0x8'));module['exports']=function(_0x512343,_0x18fabb){return _0x512343[_0x1e18('0x9')](_0x1e18('0xa'),attributes,{'tableName':_0x1e18('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1e18('0xc'),'collate':_0x1e18('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index aaaf7d3..1f8773e 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 _0x9bde=['code','message','WhatsappApplication,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x167f78,_0x16de34){var _0x58ee9a=function(_0x2e9f24){while(--_0x2e9f24){_0x167f78['push'](_0x167f78['shift']());}};_0x58ee9a(++_0x16de34);}(_0x9bde,0xe1));var _0xe9bd=function(_0x8ea518,_0x38225f){_0x8ea518=_0x8ea518-0x0;var _0x5ef423=_0x9bde[_0x8ea518];return _0x5ef423;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file +var _0x8d0e=['info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then'];(function(_0x51b8a9,_0x118f0e){var _0x148dad=function(_0x3bb81d){while(--_0x3bb81d){_0x51b8a9['push'](_0x51b8a9['shift']());}};_0x148dad(++_0x118f0e);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x184a5e,_0x584cf9){_0x184a5e=_0x184a5e-0x0;var _0x4cd534=_0x8d0e[_0x184a5e];return _0x4cd534;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){return client[_0xe8d0('0xb')](_0x92483d,_0xcc03d0)[_0xe8d0('0xc')](function(_0x5605a0){logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,_0xe8d0('0xf'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x469d37,_0xe8d0('0xf'),JSON[_0xe8d0('0x10')](_0x5605a0));if(_0x5605a0[_0xe8d0('0x11')]){if(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x12')]===0x1f4){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x13aa63(_0x5605a0['error'][_0xe8d0('0x13')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x2b6dce(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);}else{logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,'request\x20sent');_0x2b6dce(_0x5605a0[_0xe8d0('0x14')]['message']);}})[_0xe8d0('0x15')](function(_0x3c526c){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x3c526c);_0x13aa63(_0x3c526c);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index cc03590..9a67735 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 _0x8375=['post','create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','delete','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x56e953,_0x42b5a1){var _0x1504d4=function(_0x1ffa33){while(--_0x1ffa33){_0x56e953['push'](_0x56e953['shift']());}};_0x1504d4(++_0x42b5a1);}(_0x8375,0xa8));var _0x5837=function(_0x5cc649,_0x29dd20){_0x5cc649=_0x5cc649-0x0;var _0x2cad3d=_0x8375[_0x5cc649];return _0x2cad3d;};'use strict';var multer=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var path=require(_0x5837('0x2'));var timeout=require('connect-timeout');var express=require(_0x5837('0x3'));var router=express[_0x5837('0x4')]();var fs_extra=require(_0x5837('0x5'));var auth=require(_0x5837('0x6'));var interaction=require(_0x5837('0x7'));var config=require(_0x5837('0x8'));var controller=require('./whatsappInteraction.controller');router[_0x5837('0x9')]('/',auth[_0x5837('0xa')](),controller[_0x5837('0xb')]);router[_0x5837('0x9')](_0x5837('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x5837('0x9')](_0x5837('0xd'),auth['isAuthenticated'](),controller[_0x5837('0xe')]);router['get'](_0x5837('0xf'),auth[_0x5837('0xa')](),controller[_0x5837('0x10')]);router[_0x5837('0x9')](_0x5837('0x11'),auth[_0x5837('0xa')](),controller['download']);router[_0x5837('0x12')]('/',auth[_0x5837('0xa')](),controller[_0x5837('0x13')]);router[_0x5837('0x12')](_0x5837('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x5837('0x14'),auth[_0x5837('0xa')](),interaction[_0x5837('0x15')](_0x5837('0x16'),_0x5837('0x17')),controller[_0x5837('0x18')]);router[_0x5837('0x19')](_0x5837('0xd'),auth[_0x5837('0xa')](),interaction['tracked'](_0x5837('0x16'),_0x5837('0x1a')),controller['update']);router[_0x5837('0x1b')](_0x5837('0xd'),auth[_0x5837('0xa')](),interaction['tracked']('whatsapp','whatsappinteraction:destroy'),controller[_0x5837('0x1c')]);router[_0x5837('0x1b')](_0x5837('0x14'),auth['isAuthenticated'](),controller[_0x5837('0x1d')]);module[_0x5837('0x1e')]=router; \ No newline at end of file +var _0xa751=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','create','post','/:id/tags','whatsapp','whatsappinteraction:addtags','put','/:id','update','delete','tracked','destroy','removeTags','multer','util','path','connect-timeout'];(function(_0x5ad3ac,_0x508462){var _0x55651f=function(_0x36d412){while(--_0x36d412){_0x5ad3ac['push'](_0x5ad3ac['shift']());}};_0x55651f(++_0x508462);}(_0xa751,0x175));var _0x1a75=function(_0x262b86,_0x24aeb0){_0x262b86=_0x262b86-0x0;var _0x1de5aa=_0xa751[_0x262b86];return _0x1de5aa;};'use strict';var multer=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var path=require(_0x1a75('0x2'));var timeout=require(_0x1a75('0x3'));var express=require('express');var router=express[_0x1a75('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a75('0x5'));var interaction=require(_0x1a75('0x6'));var config=require(_0x1a75('0x7'));var controller=require('./whatsappInteraction.controller');router[_0x1a75('0x8')]('/',auth[_0x1a75('0x9')](),controller[_0x1a75('0xa')]);router[_0x1a75('0x8')](_0x1a75('0xb'),auth[_0x1a75('0x9')](),controller[_0x1a75('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1a75('0xd')]);router[_0x1a75('0x8')](_0x1a75('0xe'),auth[_0x1a75('0x9')](),controller[_0x1a75('0xf')]);router[_0x1a75('0x8')](_0x1a75('0x10'),auth[_0x1a75('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x1a75('0x11')]);router[_0x1a75('0x12')](_0x1a75('0xe'),auth[_0x1a75('0x9')](),controller['addMessage']);router['post'](_0x1a75('0x13'),auth[_0x1a75('0x9')](),interaction['tracked'](_0x1a75('0x14'),_0x1a75('0x15')),controller['addTags']);router[_0x1a75('0x16')](_0x1a75('0x17'),auth[_0x1a75('0x9')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0x1a75('0x18')]);router[_0x1a75('0x19')](_0x1a75('0x17'),auth[_0x1a75('0x9')](),interaction[_0x1a75('0x1a')](_0x1a75('0x14'),'whatsappinteraction:destroy'),controller[_0x1a75('0x1b')]);router['delete']('/:id/tags',auth[_0x1a75('0x9')](),controller[_0x1a75('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index e90c3c1..f964cf5 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 _0xe314=['BOOLEAN','DATE','STRING','ENUM','out','moment','exports'];(function(_0x37993c,_0x3eb705){var _0xbf84c9=function(_0x38104d){while(--_0x38104d){_0x37993c['push'](_0x37993c['shift']());}};_0xbf84c9(++_0x3eb705);}(_0xe314,0x7c));var _0x4e31=function(_0x5834ff,_0x53f287){_0x5834ff=_0x5834ff-0x0;var _0x2ac1fd=_0xe314[_0x5834ff];return _0x2ac1fd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4e31('0x0'));module[_0x4e31('0x1')]={'closed':{'type':Sequelize[_0x4e31('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4e31('0x3')]},'disposition':{'type':Sequelize[_0x4e31('0x4')]},'secondDisposition':{'type':Sequelize[_0x4e31('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4e31('0x4')]},'note':{'type':Sequelize[_0x4e31('0x4')]},'phone':{'type':Sequelize[_0x4e31('0x4')]},'read1stAt':{'type':Sequelize[_0x4e31('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4e31('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4e31('0x5')]('in',_0x4e31('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4e31('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x326f=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x18a334,_0x30631c){var _0x13f1d0=function(_0x88bbd9){while(--_0x88bbd9){_0x18a334['push'](_0x18a334['shift']());}};_0x13f1d0(++_0x30631c);}(_0x326f,0xd1));var _0xf326=function(_0x2313f6,_0x13d246){_0x2313f6=_0x2313f6-0x0;var _0x209638=_0x326f[_0x2313f6];return _0x209638;};'use strict';var Sequelize=require(_0xf326('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0xf326('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf326('0x2')]},'disposition':{'type':Sequelize[_0xf326('0x3')]},'secondDisposition':{'type':Sequelize[_0xf326('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf326('0x3')]},'note':{'type':Sequelize[_0xf326('0x3')]},'phone':{'type':Sequelize[_0xf326('0x3')]},'read1stAt':{'type':Sequelize[_0xf326('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf326('0x4')]('in',_0xf326('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf326('0x4')]('in',_0xf326('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf326('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 93a86b7..ff0f425 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 _0x5204=['../../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','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','fullname','Tags','TagIds','split','forEach','push','answered','unmanaged','total','closed','UserId','waiting','talking','WhatsappInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','tools_tags','u.id','ui.WhatsappInteractionId','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\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','type','text','start','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','resolve','where','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','role','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','includeAll','include','options','catch','create','params','describe','addMessage','WhatsappMessage','ids','omit','findOne','findAll','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','Attachment','Messages','createdAt','direction','WhatsappAccount','Account','Owner','closedAt','existsSync','createReadStream','createWriteStream','basename','format','YYYY-MM-DD\x20HH:mm:ss','lastName','secret','renderFile','views','downloadInteraction.ejs','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x5204,0xdf));var _0x4520=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x5204[_0xd7b0a4];return _0x184e9e;};'use strict';var emlformat=require(_0x4520('0x0'));var rimraf=require(_0x4520('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4520('0x2'));var rp=require(_0x4520('0x3'));var moment=require(_0x4520('0x4'));var BPromise=require(_0x4520('0x5'));var Mustache=require(_0x4520('0x6'));var util=require('util');var path=require(_0x4520('0x7'));var sox=require('sox');var csv=require(_0x4520('0x8'));var ejs=require(_0x4520('0x9'));var fs=require('fs');var fs_extra=require(_0x4520('0xa'));var _=require(_0x4520('0xb'));var squel=require(_0x4520('0xc'));var crypto=require(_0x4520('0xd'));var jsforce=require(_0x4520('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4520('0x8'));var querystring=require('querystring');var Papa=require(_0x4520('0xf'));var Redis=require(_0x4520('0x10'));var authService=require(_0x4520('0x11'));var qs=require(_0x4520('0x12'));var as=require(_0x4520('0x13'));var pdf=require(_0x4520('0x14'));var hardwareService=require(_0x4520('0x15'));var logger=require(_0x4520('0x16'))(_0x4520('0x17'));var utils=require(_0x4520('0x18'));var config=require(_0x4520('0x19'));var licenseUtil=require(_0x4520('0x1a'));var db=require(_0x4520('0x1b'))['db'];config[_0x4520('0x1c')]=_[_0x4520('0x1d')](config[_0x4520('0x1c')],{'host':_0x4520('0x1e'),'port':0x18eb});var socket=require(_0x4520('0x1f'))(new Redis(config[_0x4520('0x1c')]));require(_0x4520('0x20'))[_0x4520('0x21')](socket);function respondWithStatusCode(_0x48b3e7,_0x3e53e5){_0x3e53e5=_0x3e53e5||0xcc;return function(_0x20de6b){if(_0x20de6b){return _0x48b3e7[_0x4520('0x22')](_0x3e53e5);}return _0x48b3e7[_0x4520('0x23')](_0x3e53e5)[_0x4520('0x24')]();};}function respondWithResult(_0x51d85f,_0x2c1805){_0x2c1805=_0x2c1805||0xc8;return function(_0x33ac29){if(_0x33ac29){return _0x51d85f[_0x4520('0x23')](_0x2c1805)[_0x4520('0x25')](_0x33ac29);}};}function respondWithFilteredResult(_0x1b8b0f,_0x2e00f4){return function(_0x1dcf51){if(_0x1dcf51){var _0x4ba69f=typeof _0x2e00f4[_0x4520('0x26')]===_0x4520('0x27')&&typeof _0x2e00f4[_0x4520('0x28')]===_0x4520('0x27');var _0x4ac41d=_0x1dcf51[_0x4520('0x29')];var _0x52ca8c=_0x4ba69f?0x0:_0x2e00f4['offset'];var _0x4c46c5=_0x4ba69f?_0x1dcf51[_0x4520('0x29')]:_0x2e00f4['offset']+_0x2e00f4[_0x4520('0x28')];var _0x270dc2;if(_0x4c46c5>=_0x4ac41d){_0x4c46c5=_0x4ac41d;_0x270dc2=0xc8;}else{_0x270dc2=0xce;}_0x1b8b0f[_0x4520('0x23')](_0x270dc2);return _0x1b8b0f['set'](_0x4520('0x2a'),_0x52ca8c+'-'+_0x4c46c5+'/'+_0x4ac41d)[_0x4520('0x25')](_0x1dcf51);}return null;};}function patchUpdates(_0x3b2ede){return function(_0x4b889a){try{jsonpatch[_0x4520('0x2b')](_0x4b889a,_0x3b2ede,!![]);}catch(_0x847d15){return BPromise[_0x4520('0x2c')](_0x847d15);}return _0x4b889a[_0x4520('0x2d')]();};}function saveUpdates(_0x2a8528,_0x552da1){return function(_0x3774bd){if(_0x3774bd){return _0x3774bd[_0x4520('0x2e')](_0x2a8528)[_0x4520('0x2f')](function(_0x3e2906){return _0x3e2906;});}return null;};}function removeEntity(_0x57306b,_0x336c63){return function(_0x4602a4){if(_0x4602a4){return _0x4602a4[_0x4520('0x30')]()[_0x4520('0x2f')](function(){_0x57306b[_0x4520('0x23')](0xcc)[_0x4520('0x24')]();});}};}function handleEntityNotFound(_0x2d6902,_0x195c58){return function(_0x180c44){if(!_0x180c44){_0x2d6902[_0x4520('0x22')](0x194);}return _0x180c44;};}function handleError(_0x58836d,_0x222dbd){_0x222dbd=_0x222dbd||0x1f4;return function(_0x5c1a0b){logger[_0x4520('0x31')](_0x5c1a0b[_0x4520('0x32')]);if(_0x5c1a0b[_0x4520('0x33')]){delete _0x5c1a0b[_0x4520('0x33')];}_0x58836d[_0x4520('0x23')](_0x222dbd)[_0x4520('0x34')](_0x5c1a0b);};}function getInteractionUsers(_0x5bb163,_0x2c32ce){return new BPromise(function(_0x508c05,_0x2585eb){try{if(_0x2c32ce[_0x5bb163['id']]){_0x5bb163['Users']=_[_0x4520('0x35')](_0x2c32ce[_0x5bb163['id']],function(_0x5c140c){return{'id':_0x5c140c['id'],'fullname':_0x5c140c[_0x4520('0x36')]};});}}catch(_0x4e6a5f){_0x2585eb(_0x4e6a5f);}_0x508c05(_0x5bb163);});}function getInteractionTags(_0x5087dc,_0x18d6e9){return new BPromise(function(_0x14cbb5,_0x24d5b9){try{if(_0x5087dc['TagIds']){_0x5087dc[_0x4520('0x37')]=[];_0x5087dc[_0x4520('0x38')][_0x4520('0x39')](',')[_0x4520('0x3a')](function(_0x59b4ff){_0x5087dc['Tags'][_0x4520('0x3b')](_0x18d6e9[_0x59b4ff]);});}delete _0x5087dc[_0x4520('0x38')];}catch(_0x4a57d3){_0x24d5b9(_0x4a57d3);}_0x14cbb5(_0x5087dc);});}function updateWhatsappInteraction(_0x779e94,_0x3ee94f,_0x1b61d6){return new BPromise(function(_0x345bdc,_0x1eb998){return getInteractionUsers(_0x779e94,_0x1b61d6)[_0x4520('0x2f')](function(_0x550a0f){return getInteractionTags(_0x550a0f,_0x3ee94f);})[_0x4520('0x2f')](function(_0x368644){return getStateInteraction(_0x368644);})['then'](function(_0x3acc82){_0x345bdc(_0x3acc82);})['catch'](function(_0x8bf557){_0x1eb998(_0x8bf557);});});}function getStateInteraction(_0x268c05){return new BPromise(function(_0x4f2dc4){_0x268c05['waiting']=0x0;_0x268c05['talking']=0x0;_0x268c05[_0x4520('0x3c')]=0x0;_0x268c05[_0x4520('0x3d')]=0x0;_0x268c05[_0x4520('0x3e')]=0x0;if(!_0x268c05[_0x4520('0x3f')]&&!_0x268c05[_0x4520('0x40')]){_0x268c05[_0x4520('0x41')]+=0x1;}if(!_0x268c05[_0x4520('0x3f')]&&_0x268c05['UserId']){_0x268c05[_0x4520('0x42')]+=0x1;if(_0x268c05[_0x4520('0x41')]){_0x268c05[_0x4520('0x41')]-=0x1;}}if(_0x268c05['closed']&&_0x268c05[_0x4520('0x40')]){_0x268c05[_0x4520('0x3c')]+=0x1;if(_0x268c05['talking']){_0x268c05['talking']-=0x1;}}if(_0x268c05[_0x4520('0x3f')]&&!_0x268c05[_0x4520('0x40')]){_0x268c05[_0x4520('0x3d')]+=0x1;if(_0x268c05[_0x4520('0x41')]){_0x268c05[_0x4520('0x41')]-=0x1;}}_0x268c05['total']+=0x1;_0x4f2dc4(_0x268c05);});}exports['index']=function(_0x4f5aa1,_0x57a165){var _0x516993={},_0x43dc36={},_0x54da7a={'count':0x0,'rows':[]};var _0x517fcb=_[_0x4520('0x35')](db[_0x4520('0x43')][_0x4520('0x44')],function(_0x214026){return{'name':_0x214026[_0x4520('0x45')],'type':_0x214026['type'][_0x4520('0x46')]};});_0x43dc36[_0x4520('0x47')]=_['map'](_0x517fcb,'name');_0x43dc36[_0x4520('0x48')]=_[_0x4520('0x49')](_0x4f5aa1['query']);_0x43dc36[_0x4520('0x4a')]=_[_0x4520('0x4b')](_0x43dc36[_0x4520('0x47')],_0x43dc36[_0x4520('0x48')]);_0x516993['attributes']=_[_0x4520('0x4b')](_0x43dc36[_0x4520('0x47')],qs[_0x4520('0x4c')](_0x4f5aa1[_0x4520('0x48')][_0x4520('0x4c')]));_0x516993[_0x4520('0x4d')]=_0x516993[_0x4520('0x4d')][_0x4520('0x4e')]?_0x516993[_0x4520('0x4d')]:_0x43dc36[_0x4520('0x47')];if(!_0x4f5aa1[_0x4520('0x48')][_0x4520('0x4f')](_0x4520('0x50'))){_0x516993[_0x4520('0x28')]=qs[_0x4520('0x28')](_0x4f5aa1[_0x4520('0x48')][_0x4520('0x28')]);_0x516993['offset']=qs[_0x4520('0x26')](_0x4f5aa1[_0x4520('0x48')]['offset']);}_0x516993['order']=qs['sort'](_0x4f5aa1['query'][_0x4520('0x51')]);_0x516993['where']=qs[_0x4520('0x4a')](_[_0x4520('0x52')](_0x4f5aa1[_0x4520('0x48')],_0x43dc36[_0x4520('0x4a')]),_0x517fcb);var _0x177c4e=[];var _0x5e3eef=squel[_0x4520('0x53')]()[_0x4520('0x54')]('id')[_0x4520('0x54')](_0x4520('0x33'))[_0x4520('0x54')](_0x4520('0x55'))[_0x4520('0x56')](_0x4520('0x57'));var _0x17e353=squel[_0x4520('0x53')]()[_0x4520('0x54')](_0x4520('0x58'))['field']('u.fullname')[_0x4520('0x54')](_0x4520('0x59'))[_0x4520('0x56')]('user_has_whatsapp_interactions','ui')[_0x4520('0x5a')](_0x4520('0x5b'),'u',_0x4520('0x5c'));var _0x5398c2=squel[_0x4520('0x53')]()[_0x4520('0x56')](_0x4520('0x5d'),'i')['left_join']('cm_contacts','c',_0x4520('0x5e'))[_0x4520('0x5a')](_0x4520('0x5b'),'o',_0x4520('0x5f'))[_0x4520('0x5a')](_0x4520('0x60'),'a',_0x4520('0x61'))[_0x4520('0x5a')]('whatsapp_messages','me',_0x4520('0x62'))[_0x4520('0x5a')](_0x4520('0x63'),'it',_0x4520('0x64'))[_0x4520('0x5a')](_0x4520('0x57'),'t',_0x4520('0x65'));var _0x1a9a2d=squel[_0x4520('0x66')]();var _0x4562c4=[];var _0x381e0b=squel[_0x4520('0x66')]();var _0x2f11d9;if(_0x4f5aa1[_0x4520('0x48')][_0x4520('0x67')]){_0x2f11d9=as[_0x4520('0x68')](_0x4f5aa1[_0x4520('0x48')]['search']);var _0x52bb6c=_0x2f11d9[_0x4520('0x69')];for(var _0x35defa=0x0;_0x35defa<_0x2f11d9[_0x4520('0x6a')][_0x4520('0x4e')];_0x35defa++){var _0x265bb4=_0x2f11d9[_0x4520('0x6a')][_0x35defa];var _0x54372b='i';var _0xdd3a69=_[_0x4520('0x6b')](_0x517fcb,['name',_0x265bb4[_0x4520('0x54')]]);if(!_0xdd3a69){switch(_0x265bb4[_0x4520('0x54')]){case _0x4520('0x6c'):if(_0x265bb4[_0x4520('0x6d')]==0x1){_0x5398c2['having']('`'+_0x265bb4[_0x4520('0x54')]+_0x4520('0x6e'));}else{_0x5398c2['having']('`'+_0x265bb4['field']+_0x4520('0x6f'));}break;case _0x4520('0x70'):if(_0x265bb4[_0x4520('0x71')]===_0x4520('0x72')){if(_0x265bb4[_0x4520('0x6d')][_0x4520('0x39')]('\x20')['length']>0x1){_0x1a9a2d[_0x52bb6c](_0x4520('0x73'),qs[_0x4520('0x74')](_0x265bb4[_0x4520('0x6d')]),null);}else{var _0x11966f='%'+_0x265bb4['value']+'%';_0x1a9a2d[_0x52bb6c](_0x4520('0x75'),_0x11966f,_0x11966f,_0x11966f);}}else{_0xdd3a69=_[_0x4520('0x6b')](_0x517fcb,['name',_0x4520('0x76')]);_0x265bb4['field']=_0x4520('0x76');_0x116328=as[_0x4520('0x77')](_0x54372b,_0xdd3a69[_0x4520('0x78')],_0x265bb4);_0x1a9a2d[_0x52bb6c](_0x116328[_0x4520('0x79')],_0x116328['value'][_0x4520('0x7a')],_0x116328[_0x4520('0x6d')][_0x4520('0x24')]);}break;case _0x4520('0x7b'):var _0x4b6f71=_0x265bb4[_0x4520('0x6d')][_0x4520('0x39')](',')[_0x4520('0x35')](function(_0x2d5bf6){return Number(_0x2d5bf6);});_0x4b6f71[_0x4520('0x3a')](function(_0x8d166){_0x381e0b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x8d166+',%');});_0x4562c4=_[_0x4520('0x7c')](_0x4562c4,_0x4b6f71);break;case'User':if(_0x265bb4[_0x4520('0x71')]===_0x4520('0x72')){_0x1a9a2d[_0x52bb6c](_0x4520('0x7d'),'%'+_0x265bb4[_0x4520('0x6d')]+'%',null);}else{_0xdd3a69=_[_0x4520('0x6b')](_0x517fcb,[_0x4520('0x33'),'UserId']);_0x265bb4['field']=_0x4520('0x40');_0x116328=as['buildExpression'](_0x54372b,_0xdd3a69[_0x4520('0x78')],_0x265bb4);_0x1a9a2d[_0x52bb6c](_0x116328[_0x4520('0x79')],_0x116328[_0x4520('0x6d')][_0x4520('0x7a')],_0x116328[_0x4520('0x6d')][_0x4520('0x24')]);}break;case _0x4520('0x7e'):_0x116328=as[_0x4520('0x77')]('me',null,_0x265bb4);_0x1a9a2d[_0x52bb6c](_0x116328[_0x4520('0x79')],_0x116328['value'][_0x4520('0x7a')],_0x116328['value'][_0x4520('0x24')]);break;}}else{var _0x116328=as[_0x4520('0x77')](_0x54372b,_0xdd3a69[_0x4520('0x78')],_0x265bb4);_0x1a9a2d[_0x52bb6c](_0x116328[_0x4520('0x79')],_0x116328['value'][_0x4520('0x7a')],_0x116328[_0x4520('0x6d')][_0x4520('0x24')]);}}}else{var _0x228973=_(_0x4f5aa1['query'])['keys']()['map'](function(_0x2bf316){return _[_0x4520('0x7f')](_0x517fcb,[_0x4520('0x33'),_0x2bf316])?_0x2bf316:undefined;})['compact']()[_0x4520('0x6d')]();if(!_[_0x4520('0x80')](_0x228973)){_0x228973[_0x4520('0x3a')](function(_0xc560a8){if(_0xc560a8===_0x4520('0x81')){_0x5398c2['where'](_0x4520('0x82'),[][_0x4520('0x83')](_0x4f5aa1[_0x4520('0x48')][_0xc560a8]));}else if(_0xc560a8==='createdAt'){var _0x3419bd=JSON[_0x4520('0x84')](_0x4f5aa1[_0x4520('0x48')][_0xc560a8])[_0x4520('0x85')];var _0x2e8474=JSON[_0x4520('0x84')](_0x4f5aa1[_0x4520('0x48')][_0xc560a8])[_0x4520('0x86')];_0x5398c2['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3419bd,_0x2e8474);}else{if(_0x4f5aa1[_0x4520('0x48')][_0xc560a8]===_0x4520('0x87')){_0x5398c2['where']('i.'+_0xc560a8+_0x4520('0x88'));}else{_0x5398c2['where']('i.'+_0xc560a8+_0x4520('0x89'),_0x4f5aa1[_0x4520('0x48')][_0xc560a8]);}}});}if(_0x4f5aa1['query'][_0x4520('0x8a')]){if(_0x4f5aa1[_0x4520('0x48')]['read']==0x1){_0x5398c2[_0x4520('0x8b')](_0x4520('0x8c'));}else{_0x5398c2['having'](_0x4520('0x8d'));}}if(_0x4f5aa1[_0x4520('0x48')][_0x4520('0x8e')]){_0x4562c4=_['isArray'](_0x4f5aa1[_0x4520('0x48')][_0x4520('0x8e')])?_0x4f5aa1[_0x4520('0x48')][_0x4520('0x8e')]:new Array(_0x4f5aa1[_0x4520('0x48')][_0x4520('0x8e')]);_0x4562c4[_0x4520('0x3a')](function(_0x2a1503){_0x381e0b['or'](_0x4520('0x8f'),'%,'+_0x2a1503+',%');});}if(_0x4f5aa1[_0x4520('0x48')][_0x4520('0x90')]){var _0x31676c=_0x4f5aa1['query']['filter'][_0x4520('0x91')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x4520('0x92')](_0x31676c)){_0x1a9a2d['or'](_0x4520('0x93'),_0x31676c+'%')['or'](_0x4520('0x94'),_0x31676c+'%');}else{_0x1a9a2d['or'](_0x4520('0x95'),qs[_0x4520('0x74')](_0x31676c))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x31676c+'%');}}}_0x5398c2['where'](_0x1a9a2d);_0x5398c2[_0x4520('0x96')](_0x4520('0x97'));var _0x415d7f={'type':db[_0x4520('0x98')][_0x4520('0x99')][_0x4520('0x9a')],'raw':!![]};var _0x4b60e2=_0x5398c2[_0x4520('0x9b')]();_0x4b60e2[_0x4520('0x54')]('i.id');_0x4b60e2[_0x4520('0x54')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x516993['order']){_0x516993[_0x4520('0x9c')][_0x4520('0x3a')](function(_0x74297e){var _0x454b8c=_0x74297e[0x0]===_0x4520('0x9d')?_0x74297e[0x0]:'i.'+_0x74297e[0x0];_0x5398c2['order'](_0x454b8c,_0x74297e[0x1]===_0x4520('0x9e')?![]:!![]);});}if(!_[_0x4520('0x80')](_0x4562c4)){_0x5398c2['having'](_0x381e0b);_0x4b60e2['where'](_0x4520('0x9f'),_0x4562c4);}BPromise[_0x4520('0xa0')]()[_0x4520('0x2f')](function(){if(!_0x2f11d9){if(_0x4f5aa1['query'][_0x4520('0x81')])return;_0x4b60e2[_0x4520('0xa1')](_0x4520('0xa2'));_0x5398c2['where'](_0x4520('0xa2'));return;}if(_0x4f5aa1[_0x4520('0xa3')]['role']!==_0x4520('0xa4'))return;return _0x4f5aa1['user'][_0x4520('0xa5')]({'attributes':['id'],'raw':!![]})[_0x4520('0x2f')](function(_0x3e53d7){if(_[_0x4520('0x80')](_0x3e53d7)){_0x4b60e2[_0x4520('0xa1')](_0x4520('0xa6'));_0x5398c2[_0x4520('0xa1')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x4b60e2[_0x4520('0xa1')]('i.WhatsappAccountId\x20IN\x20?',_[_0x4520('0x35')](_0x3e53d7,'id'));_0x5398c2[_0x4520('0xa1')]('i.WhatsappAccountId\x20IN\x20?',_[_0x4520('0x35')](_0x3e53d7,'id'));}});})[_0x4520('0x2f')](function(){if(_0x4f5aa1[_0x4520('0xa3')][_0x4520('0xa7')]===_0x4520('0xa4')&&!_0x2f11d9&&!_0x4f5aa1[_0x4520('0x48')][_0x4520('0x81')])return[];return db[_0x4520('0xa8')][_0x4520('0x48')](_0x4b60e2[_0x4520('0xa9')](),_0x415d7f);})[_0x4520('0x2f')](function(_0x5b86ad){_0x54da7a['count']=_0x5b86ad['length'];if(_0x54da7a['count']===0x0)return[];return db['sequelize'][_0x4520('0x48')](_0x5e3eef[_0x4520('0xa9')](),_0x415d7f)[_0x4520('0x2f')](function(_0x3896fc){_0x177c4e=_['keyBy'](_0x3896fc,'id');_0x415d7f=_[_0x4520('0xaa')](_0x415d7f,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f5aa1[_0x4520('0x48')]['fields']){_0x516993[_0x4520('0x4d')]['forEach'](function(_0x2b334a){_0x5398c2[_0x4520('0x54')]('i.'+_0x2b334a);});}else{_0x5398c2[_0x4520('0x54')](_0x4520('0xab'),'unreadMessages');_0x5398c2[_0x4520('0x54')]('a.key',_0x4520('0xac'));_0x5398c2[_0x4520('0x54')](_0x4520('0xad'),_0x4520('0xae'));_0x5398c2[_0x4520('0x54')]('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',_0x4520('0x9d'));_0x5398c2[_0x4520('0x54')]('i.*');_0x5398c2[_0x4520('0x54')](_0x4520('0xaf'),'Contact.firstName');_0x5398c2[_0x4520('0x54')]('c.lastName','Contact.lastName');_0x5398c2[_0x4520('0x54')](_0x4520('0xb0'),'Contact.email');_0x5398c2[_0x4520('0x54')]('c.phone',_0x4520('0xb1'));_0x5398c2[_0x4520('0x54')](_0x4520('0xb2'),_0x4520('0xb3'));_0x5398c2[_0x4520('0x54')](_0x4520('0xb4'),_0x4520('0xb5'));_0x5398c2[_0x4520('0x54')](_0x4520('0xb6'),_0x4520('0xb7'));_0x5398c2[_0x4520('0x54')](_0x4520('0xb8'),_0x4520('0xb9'));_0x5398c2[_0x4520('0x54')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4520('0x38'));}if(_0x516993[_0x4520('0x28')])_0x5398c2['limit'](_0x516993[_0x4520('0x28')]);if(_0x516993[_0x4520('0x26')])_0x5398c2['offset'](_0x516993[_0x4520('0x26')]);return db[_0x4520('0xa8')][_0x4520('0x48')](_0x5398c2[_0x4520('0xa9')](),_0x415d7f);})[_0x4520('0x2f')](function(_0xad6e88){if(_0xad6e88['length']>0x0)_0x17e353[_0x4520('0xa1')](_0x4520('0xba'),_[_0x4520('0x35')](_0xad6e88,'id'));return db[_0x4520('0xa8')][_0x4520('0x48')](_0x17e353['toString'](),_0x415d7f)['then'](function(_0x1f9fc1){var _0x3e46bd=_[_0x4520('0xbb')](_0x1f9fc1,_0x4520('0xbc'));var _0x28f486=[];_0xad6e88[_0x4520('0x3a')](function(_0x423c7e){_0x28f486[_0x4520('0x3b')](updateWhatsappInteraction(_0x423c7e,_0x177c4e,_0x3e46bd));});return BPromise[_0x4520('0xbd')](_0x28f486);});});})[_0x4520('0x2f')](function(_0x480939){_0x54da7a[_0x4520('0xbe')]=_0x480939;return _0x54da7a;})[_0x4520('0x2f')](respondWithFilteredResult(_0x57a165,_0x516993))['catch'](handleError(_0x57a165,null));};exports[_0x4520('0xbf')]=function(_0x572f6b,_0x54d969){var _0x14724f={'raw':![],'where':{'id':_0x572f6b['params']['id']}},_0x1823a2={};_0x1823a2['model']=_[_0x4520('0x49')](db[_0x4520('0x43')][_0x4520('0x44')]);_0x1823a2[_0x4520('0x48')]=_['keys'](_0x572f6b[_0x4520('0x48')]);_0x1823a2[_0x4520('0x4a')]=_[_0x4520('0x4b')](_0x1823a2[_0x4520('0x47')],_0x1823a2[_0x4520('0x48')]);_0x14724f[_0x4520('0x4d')]=_[_0x4520('0x4b')](_0x1823a2[_0x4520('0x47')],qs[_0x4520('0x4c')](_0x572f6b['query'][_0x4520('0x4c')]));_0x14724f[_0x4520('0x4d')]=_0x14724f[_0x4520('0x4d')]['length']?_0x14724f['attributes']:_0x1823a2[_0x4520('0x47')];if(_0x572f6b['query'][_0x4520('0xc0')]){_0x14724f[_0x4520('0xc1')]=[{'all':!![]}];}_0x14724f=_[_0x4520('0xaa')]({},_0x14724f,_0x572f6b[_0x4520('0xc2')]);return db[_0x4520('0x43')][_0x4520('0x6b')](_0x14724f)[_0x4520('0x2f')](handleEntityNotFound(_0x54d969,null))[_0x4520('0x2f')](respondWithResult(_0x54d969,null))[_0x4520('0xc3')](handleError(_0x54d969,null));};exports['create']=function(_0x309d14,_0x3cfb78){return db[_0x4520('0x43')][_0x4520('0xc4')](_0x309d14[_0x4520('0x7e')],{})[_0x4520('0x2f')](respondWithResult(_0x3cfb78,0xc9))[_0x4520('0xc3')](handleError(_0x3cfb78,null));};exports['update']=function(_0x666f9c,_0x249502){if(_0x666f9c[_0x4520('0x7e')]['id']){delete _0x666f9c[_0x4520('0x7e')]['id'];}return db[_0x4520('0x43')]['find']({'where':{'id':_0x666f9c['params']['id']}})[_0x4520('0x2f')](handleEntityNotFound(_0x249502,null))[_0x4520('0x2f')](saveUpdates(_0x666f9c[_0x4520('0x7e')],null))['then'](respondWithResult(_0x249502,null))['catch'](handleError(_0x249502,null));};exports[_0x4520('0x30')]=function(_0x904f4f,_0x3e99e3){return db['WhatsappInteraction'][_0x4520('0x6b')]({'where':{'id':_0x904f4f[_0x4520('0xc5')]['id']}})['then'](handleEntityNotFound(_0x3e99e3,null))[_0x4520('0x2f')](removeEntity(_0x3e99e3,null))[_0x4520('0xc3')](handleError(_0x3e99e3,null));};exports[_0x4520('0xc6')]=function(_0x3c5501,_0xea598f){return db[_0x4520('0x43')][_0x4520('0xc6')]()[_0x4520('0x2f')](respondWithResult(_0xea598f,null))[_0x4520('0xc3')](handleError(_0xea598f,null));};exports[_0x4520('0xc7')]=function(_0x5de8f9,_0x31b6f5,_0x4f8512){return db[_0x4520('0xc8')]['find']({'where':{'id':_0x5de8f9[_0x4520('0xc5')]['id']}})[_0x4520('0x2f')](handleEntityNotFound(_0x31b6f5,null))[_0x4520('0x2f')](function(_0x3639f1){if(_0x3639f1){return _0x3639f1['addMessage'](_0x5de8f9[_0x4520('0x7e')][_0x4520('0xc9')],_[_0x4520('0xca')](_0x5de8f9[_0x4520('0x7e')],[_0x4520('0xc9'),'id'])||{});}})[_0x4520('0x2f')](respondWithResult(_0x31b6f5,null))[_0x4520('0xc3')](handleError(_0x31b6f5,null));};exports['getMessages']=function(_0x39fa27,_0x56f398,_0x4ab423){var _0x320603={'raw':![],'where':{}};var _0x59d564={};var _0x9cbef9={'count':0x0,'rows':[]};return db[_0x4520('0x43')][_0x4520('0xcb')]({'where':{'id':_0x39fa27[_0x4520('0xc5')]['id']}})[_0x4520('0x2f')](handleEntityNotFound(_0x56f398,null))[_0x4520('0x2f')](function(_0x550969){if(_0x550969){_0x59d564[_0x4520('0x47')]=_[_0x4520('0x49')](db[_0x4520('0xc8')][_0x4520('0x44')]);_0x59d564['query']=_[_0x4520('0x49')](_0x39fa27['query']);_0x59d564[_0x4520('0x4a')]=_[_0x4520('0x4b')](_0x59d564['model'],_0x59d564[_0x4520('0x48')]);_0x320603[_0x4520('0x4d')]=_[_0x4520('0x4b')](_0x59d564['model'],qs[_0x4520('0x4c')](_0x39fa27[_0x4520('0x48')]['fields']));_0x320603[_0x4520('0x4d')]=_0x320603[_0x4520('0x4d')][_0x4520('0x4e')]?_0x320603[_0x4520('0x4d')]:_0x59d564[_0x4520('0x47')];if(!_0x39fa27['query'][_0x4520('0x4f')](_0x4520('0x50'))){_0x320603[_0x4520('0x28')]=qs['limit'](_0x39fa27[_0x4520('0x48')]['limit']);_0x320603[_0x4520('0x26')]=qs[_0x4520('0x26')](_0x39fa27[_0x4520('0x48')][_0x4520('0x26')]);}_0x320603[_0x4520('0x9c')]=qs[_0x4520('0x51')](_0x39fa27[_0x4520('0x48')][_0x4520('0x51')]);_0x320603[_0x4520('0xa1')]=qs['filters'](_[_0x4520('0x52')](_0x39fa27[_0x4520('0x48')],_0x59d564['filters']));_0x320603['where'][_0x4520('0xbc')]=_0x550969['id'];if(_0x39fa27[_0x4520('0x48')][_0x4520('0x90')]){_0x320603[_0x4520('0xa1')]=_[_0x4520('0xaa')](_0x320603[_0x4520('0xa1')],{'$or':_[_0x4520('0x35')](_0x320603[_0x4520('0x4d')],function(_0x1cea0e){var _0x156129={};_0x156129[_0x1cea0e]={'$like':'%'+_0x39fa27[_0x4520('0x48')]['filter']+'%'};return _0x156129;})});}if(_0x39fa27[_0x4520('0x48')][_0x4520('0x85')]){var _0x3847ca=_0x39fa27[_0x4520('0x48')][_0x4520('0x85')][_0x4520('0x39')](',');var _0x2d596d={};_0x2d596d[_0x3847ca[0x0]]={'$gte':moment(_0x3847ca[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x320603['where']=_[_0x4520('0xaa')](_0x320603[_0x4520('0xa1')],_0x2d596d);}_0x320603=_[_0x4520('0xaa')]({},_0x320603,_0x39fa27[_0x4520('0xc2')]);return db[_0x4520('0xc8')][_0x4520('0x29')]({'where':_0x320603[_0x4520('0xa1')]})[_0x4520('0x2f')](function(_0xdc61bd){_0x9cbef9[_0x4520('0x29')]=_0xdc61bd;if(_0x39fa27[_0x4520('0x48')][_0x4520('0xc0')]){_0x320603[_0x4520('0xc1')]=[{'all':!![]}];}return db[_0x4520('0xc8')][_0x4520('0xcc')](_0x320603);})[_0x4520('0x2f')](function(_0x45c3ad){_0x9cbef9['rows']=_0x45c3ad;return _0x9cbef9;});}})[_0x4520('0x2f')](respondWithFilteredResult(_0x56f398,_0x320603))[_0x4520('0xc3')](handleError(_0x56f398,null));};exports['addTags']=function(_0x49eaec,_0x5068cc,_0x574eb5){return db['WhatsappInteraction'][_0x4520('0x6b')]({'where':{'id':_0x49eaec[_0x4520('0xc5')]['id']}})[_0x4520('0x2f')](handleEntityNotFound(_0x5068cc,null))[_0x4520('0x2f')](function(_0x3427d8){if(_0x3427d8){return _0x3427d8[_0x4520('0xcd')](_0x49eaec[_0x4520('0x7e')][_0x4520('0xc9')],_[_0x4520('0xca')](_0x49eaec['body'],['ids','id'])||{})[_0x4520('0xce')](function(){return db[_0x4520('0x7b')][_0x4520('0xcc')]({'attributes':['id',_0x4520('0x33'),_0x4520('0x55')],'where':{'id':_0x49eaec['body']['ids']}});})['then'](function(_0x2751fe){socket[_0x4520('0xcf')](_0x4520('0xd0'),{'id':Number(_0x49eaec['params']['id']),'tags':_0x2751fe||[]});return{'id':Number(_0x49eaec[_0x4520('0xc5')]['id']),'tags':_0x2751fe||[]};});}})[_0x4520('0x2f')](respondWithResult(_0x5068cc,null))['catch'](handleError(_0x5068cc,null));};exports[_0x4520('0xd1')]=function(_0x5f3712,_0x75a51a,_0x444ecd){return db['WhatsappInteraction']['find']({'where':{'id':_0x5f3712[_0x4520('0xc5')]['id']}})['then'](handleEntityNotFound(_0x75a51a,null))[_0x4520('0x2f')](function(_0x15783d){if(_0x15783d){return _0x15783d[_0x4520('0xd1')](_0x5f3712[_0x4520('0x48')][_0x4520('0xc9')]);}})[_0x4520('0x2f')](respondWithStatusCode(_0x75a51a,null))[_0x4520('0xc3')](handleError(_0x75a51a,null));};exports[_0x4520('0xd2')]=function(_0xf9306d,_0x942005){var _0x1d62df=moment()['unix']()[_0x4520('0xa9')]();var _0x349912=path['join'](config[_0x4520('0xd3')],_0x4520('0xd4'),_0x4520('0xd5'),_0x4520('0xd6'));var _0x2199ac=path[_0x4520('0xd7')](config[_0x4520('0xd3')],'server',_0x4520('0xd5'),_0x4520('0xd8'));var _0x490ec8=path[_0x4520('0xd7')](_0x349912,_0x1d62df);var _0x4d7a3c=util['format'](_0x4520('0xd9'),_0xf9306d[_0x4520('0xc5')]['id'],_0x1d62df);var _0x2edd95=path[_0x4520('0xd7')](_0x349912,_0x4d7a3c);var _0x51f4da=[];_0x51f4da[_0x4520('0x3b')]({'model':db['User'],'as':_0x4520('0xda'),'attributes':['id',_0x4520('0x36')],'raw':!![]});_0x51f4da[_0x4520('0x3b')]({'model':db['CmContact'],'as':_0x4520('0x70'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0xf9306d[_0x4520('0x48')][_0x4520('0xd8')]){_0x51f4da[_0x4520('0x3b')]({'model':db[_0x4520('0xdb')],'as':_0x4520('0xdb'),'raw':!![]});}var _0x500f4b=[{'model':db[_0x4520('0xc8')],'as':_0x4520('0xdc'),'attributes':['id',_0x4520('0x7e'),_0x4520('0xdd'),_0x4520('0xde'),'secret',_0x4520('0x8a')],'include':_0x51f4da}];_0x500f4b[_0x4520('0x3b')]({'model':db[_0x4520('0xdf')],'as':_0x4520('0xe0'),'attributes':['id',_0x4520('0x33')]});_0x500f4b[_0x4520('0x3b')]({'model':db['User'],'as':_0x4520('0xe1'),'attributes':['id',_0x4520('0x36')]});return db['WhatsappInteraction']['find']({'where':{'id':_0xf9306d[_0x4520('0xc5')]['id']},'include':_0x500f4b})[_0x4520('0x2f')](handleEntityNotFound(_0x942005,null))[_0x4520('0x2f')](function(_0x522ba6){if(_0x522ba6){var _0x559ff3=_0x522ba6['get']({'plain':!![]});fs['mkdirSync'](_0x490ec8);var _0x117ec3={'channel':'Whatsapp','account':_0x559ff3[_0x4520('0xe0')][_0x4520('0x33')],'agent':_0x559ff3['Owner']?_0x559ff3[_0x4520('0xe1')]['fullname']:'N.A.','createdAt':moment(_0x559ff3[_0x4520('0xdd')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4520('0xa9')](),'closedAt':_0x559ff3[_0x4520('0x3f')]?moment(_0x559ff3[_0x4520('0xe2')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4520('0xa9')]():'','disposition':_0x559ff3['disposition'],'messages':_(_0x559ff3['Messages'])[_0x4520('0x90')]({'secret':![]})[_0x4520('0x35')](function(_0x5bdd2b){if(_0x5bdd2b[_0x4520('0xdb')]){var _0x5eb334=path[_0x4520('0xd7')](_0x2199ac,_0x5bdd2b[_0x4520('0xdb')]['basename']);if(fs[_0x4520('0xe3')](_0x5eb334)){fs[_0x4520('0xe4')](_0x5eb334)['pipe'](fs[_0x4520('0xe5')](path['join'](_0x490ec8,_0x5bdd2b['Attachment'][_0x4520('0xe6')])));}}return{'date':moment(_0x5bdd2b[_0x4520('0xdd')])[_0x4520('0xe7')](_0x4520('0xe8'))[_0x4520('0xa9')](),'sender':_0x5bdd2b[_0x4520('0xde')]==='out'?_0x5bdd2b[_0x4520('0xda')]?_0x5bdd2b[_0x4520('0xda')]['fullname']:'System':_0x5bdd2b['Contact']['firstName']+(_0x5bdd2b[_0x4520('0x70')][_0x4520('0xe9')]?'\x20'+_0x5bdd2b[_0x4520('0x70')]['lastName']:''),'body':_0x5bdd2b['Attachment']?_0x5bdd2b[_0x4520('0xdb')][_0x4520('0xe6')]:_0x5bdd2b[_0x4520('0x7e')],'direction':_0x5bdd2b['direction']==='out'?'A':'C','secret':_0x5bdd2b[_0x4520('0xea')],'read':_0x5bdd2b[_0x4520('0x8a')],'attachment':_0x5bdd2b[_0x4520('0xdb')]};})['value']()};return ejs[_0x4520('0xeb')](path[_0x4520('0xd7')](config[_0x4520('0xd3')],_0x4520('0xd4'),_0x4520('0xec'),_0x4520('0xed')),{'interaction':_0x117ec3})[_0x4520('0x2f')](function(_0x5be947){var _0xfac206=path[_0x4520('0xd7')](_0x490ec8,'transcript-'+_0x559ff3['id']+'-'+_0x1d62df+'.pdf');var _0x29b1af={'path':_0xfac206,'channel':'Whatsapp','interactionId':_0x559ff3['id']};return pdf['createPdfFromHTML'](_0x5be947,_0x29b1af);})[_0x4520('0x2f')](function(){return new BPromise(function(_0x13d892,_0x3b0c7a){zipdir(_0x490ec8,{'saveTo':_0x2edd95},function(_0x129f52,_0x7fb324){if(_0x129f52)return _0x3b0c7a(_0x129f52);return _0x13d892(_0x7fb324);});})[_0x4520('0x2f')](function(){return new BPromise(function(_0x347acf,_0x24a450){rimraf(_0x490ec8,function(_0x2096ed){if(_0x2096ed)_0x24a450(_0x2096ed);return _0x347acf();});});})[_0x4520('0x2f')](function(){return _0x942005[_0x4520('0xd2')](_0x2edd95,_0x4d7a3c,function(_0x492714){if(_0x492714){console[_0x4520('0xee')](_0x4520('0xef'),_0x492714);}else{fs[_0x4520('0xf0')](_0x2edd95);}});});});}else{return _0x942005[_0x4520('0x22')](0xc8);}})[_0x4520('0xc3')](handleError(_0x942005,null));}; \ No newline at end of file +var _0x4c99=['download','unix','join','tmp','root','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','Messages','direction','secret','Owner','mkdirSync','Whatsapp','Account','N.A.','closedAt','disposition','existsSync','pipe','basename','out','System','renderFile','views','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','bluebird','mustache','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','stack','name','send','Users','map','fullname','TagIds','split','forEach','push','waiting','talking','answered','total','closed','UserId','unmanaged','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','select','field','color','from','tools_tags','u.id','users','whatsapp_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','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)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','body','isEmpty','WhatsappAccountId','where','createdAt','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','contactName','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','user','sequelize','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','toString','groupBy','all','rows','show','params','intersection','include','create','catch','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','pick','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','spread','emit','whatsappInteractionTags:save','removeTags'];(function(_0x1ef7dc,_0x55d369){var _0x42b10d=function(_0x3ac459){while(--_0x3ac459){_0x1ef7dc['push'](_0x1ef7dc['shift']());}};_0x42b10d(++_0x55d369);}(_0x4c99,0x1ec));var _0x94c9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4c99[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x94c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x94c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x94c9('0x2'));var Mustache=require(_0x94c9('0x3'));var util=require('util');var path=require(_0x94c9('0x4'));var sox=require(_0x94c9('0x5'));var csv=require('to-csv');var ejs=require(_0x94c9('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x94c9('0x7'));var jsforce=require(_0x94c9('0x8'));var deskjs=require(_0x94c9('0x9'));var toCsv=require(_0x94c9('0xa'));var querystring=require(_0x94c9('0xb'));var Papa=require(_0x94c9('0xc'));var Redis=require(_0x94c9('0xd'));var authService=require(_0x94c9('0xe'));var qs=require(_0x94c9('0xf'));var as=require(_0x94c9('0x10'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x94c9('0x11'));var logger=require(_0x94c9('0x12'))(_0x94c9('0x13'));var utils=require('../../config/utils');var config=require(_0x94c9('0x14'));var licenseUtil=require(_0x94c9('0x15'));var db=require(_0x94c9('0x16'))['db'];config[_0x94c9('0x17')]=_[_0x94c9('0x18')](config[_0x94c9('0x17')],{'host':_0x94c9('0x19'),'port':0x18eb});var socket=require(_0x94c9('0x1a'))(new Redis(config['redis']));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x3afa3,_0x33b735){_0x33b735=_0x33b735||0xcc;return function(_0x5249d3){if(_0x5249d3){return _0x3afa3[_0x94c9('0x1b')](_0x33b735);}return _0x3afa3[_0x94c9('0x1c')](_0x33b735)[_0x94c9('0x1d')]();};}function respondWithResult(_0x56609d,_0x5db248){_0x5db248=_0x5db248||0xc8;return function(_0x447937){if(_0x447937){return _0x56609d[_0x94c9('0x1c')](_0x5db248)[_0x94c9('0x1e')](_0x447937);}};}function respondWithFilteredResult(_0x459e86,_0x5ab49f){return function(_0xb3d5d6){if(_0xb3d5d6){var _0x2bca02=typeof _0x5ab49f[_0x94c9('0x1f')]===_0x94c9('0x20')&&typeof _0x5ab49f[_0x94c9('0x21')]===_0x94c9('0x20');var _0x443d7d=_0xb3d5d6['count'];var _0x256614=_0x2bca02?0x0:_0x5ab49f[_0x94c9('0x1f')];var _0x4d7a9b=_0x2bca02?_0xb3d5d6[_0x94c9('0x22')]:_0x5ab49f[_0x94c9('0x1f')]+_0x5ab49f[_0x94c9('0x21')];var _0x1bb3f0;if(_0x4d7a9b>=_0x443d7d){_0x4d7a9b=_0x443d7d;_0x1bb3f0=0xc8;}else{_0x1bb3f0=0xce;}_0x459e86[_0x94c9('0x1c')](_0x1bb3f0);return _0x459e86[_0x94c9('0x23')](_0x94c9('0x24'),_0x256614+'-'+_0x4d7a9b+'/'+_0x443d7d)[_0x94c9('0x1e')](_0xb3d5d6);}return null;};}function patchUpdates(_0x24445d){return function(_0x39890b){try{jsonpatch['apply'](_0x39890b,_0x24445d,!![]);}catch(_0x2f20bd){return BPromise['reject'](_0x2f20bd);}return _0x39890b[_0x94c9('0x25')]();};}function saveUpdates(_0x497c31,_0x21ffd9){return function(_0x12b535){if(_0x12b535){return _0x12b535[_0x94c9('0x26')](_0x497c31)[_0x94c9('0x27')](function(_0x1821a2){return _0x1821a2;});}return null;};}function removeEntity(_0x158db9,_0x578ca5){return function(_0xeb9f1){if(_0xeb9f1){return _0xeb9f1[_0x94c9('0x28')]()[_0x94c9('0x27')](function(){_0x158db9['status'](0xcc)[_0x94c9('0x1d')]();});}};}function handleEntityNotFound(_0x514dc1,_0x586b40){return function(_0x79575e){if(!_0x79575e){_0x514dc1[_0x94c9('0x1b')](0x194);}return _0x79575e;};}function handleError(_0x37b09a,_0x299ad1){_0x299ad1=_0x299ad1||0x1f4;return function(_0x46a8fc){logger['error'](_0x46a8fc[_0x94c9('0x29')]);if(_0x46a8fc[_0x94c9('0x2a')]){delete _0x46a8fc[_0x94c9('0x2a')];}_0x37b09a['status'](_0x299ad1)[_0x94c9('0x2b')](_0x46a8fc);};}function getInteractionUsers(_0x1e7b25,_0x1337c9){return new BPromise(function(_0x942832,_0x569977){try{if(_0x1337c9[_0x1e7b25['id']]){_0x1e7b25[_0x94c9('0x2c')]=_[_0x94c9('0x2d')](_0x1337c9[_0x1e7b25['id']],function(_0x5db072){return{'id':_0x5db072['id'],'fullname':_0x5db072[_0x94c9('0x2e')]};});}}catch(_0x4b62ea){_0x569977(_0x4b62ea);}_0x942832(_0x1e7b25);});}function getInteractionTags(_0x2d20c6,_0x3a3347){return new BPromise(function(_0x1dc75a,_0x7c9188){try{if(_0x2d20c6[_0x94c9('0x2f')]){_0x2d20c6['Tags']=[];_0x2d20c6[_0x94c9('0x2f')][_0x94c9('0x30')](',')[_0x94c9('0x31')](function(_0x378db5){_0x2d20c6['Tags'][_0x94c9('0x32')](_0x3a3347[_0x378db5]);});}delete _0x2d20c6[_0x94c9('0x2f')];}catch(_0x50204a){_0x7c9188(_0x50204a);}_0x1dc75a(_0x2d20c6);});}function updateWhatsappInteraction(_0x122a62,_0xb47586,_0x28a0be){return new BPromise(function(_0x5399f9,_0x4bbaae){return getInteractionUsers(_0x122a62,_0x28a0be)[_0x94c9('0x27')](function(_0x54a5ce){return getInteractionTags(_0x54a5ce,_0xb47586);})[_0x94c9('0x27')](function(_0x577225){return getStateInteraction(_0x577225);})['then'](function(_0x149065){_0x5399f9(_0x149065);})['catch'](function(_0x353e0f){_0x4bbaae(_0x353e0f);});});}function getStateInteraction(_0xcbc4ff){return new BPromise(function(_0x3e9ef7){_0xcbc4ff[_0x94c9('0x33')]=0x0;_0xcbc4ff[_0x94c9('0x34')]=0x0;_0xcbc4ff[_0x94c9('0x35')]=0x0;_0xcbc4ff['unmanaged']=0x0;_0xcbc4ff[_0x94c9('0x36')]=0x0;if(!_0xcbc4ff[_0x94c9('0x37')]&&!_0xcbc4ff[_0x94c9('0x38')]){_0xcbc4ff[_0x94c9('0x33')]+=0x1;}if(!_0xcbc4ff['closed']&&_0xcbc4ff[_0x94c9('0x38')]){_0xcbc4ff[_0x94c9('0x34')]+=0x1;if(_0xcbc4ff[_0x94c9('0x33')]){_0xcbc4ff[_0x94c9('0x33')]-=0x1;}}if(_0xcbc4ff['closed']&&_0xcbc4ff[_0x94c9('0x38')]){_0xcbc4ff[_0x94c9('0x35')]+=0x1;if(_0xcbc4ff[_0x94c9('0x34')]){_0xcbc4ff['talking']-=0x1;}}if(_0xcbc4ff[_0x94c9('0x37')]&&!_0xcbc4ff[_0x94c9('0x38')]){_0xcbc4ff[_0x94c9('0x39')]+=0x1;if(_0xcbc4ff[_0x94c9('0x33')]){_0xcbc4ff[_0x94c9('0x33')]-=0x1;}}_0xcbc4ff[_0x94c9('0x36')]+=0x1;_0x3e9ef7(_0xcbc4ff);});}exports[_0x94c9('0x3a')]=function(_0x896723,_0x9e1f90){var _0x3dc269={},_0x62fa1e={},_0x3516b1={'count':0x0,'rows':[]};var _0x3cfcc3=_[_0x94c9('0x2d')](db[_0x94c9('0x3b')][_0x94c9('0x3c')],function(_0x1117cf){return{'name':_0x1117cf[_0x94c9('0x3d')],'type':_0x1117cf[_0x94c9('0x3e')][_0x94c9('0x3f')]};});_0x62fa1e[_0x94c9('0x40')]=_['map'](_0x3cfcc3,_0x94c9('0x2a'));_0x62fa1e[_0x94c9('0x41')]=_[_0x94c9('0x42')](_0x896723['query']);_0x62fa1e[_0x94c9('0x43')]=_['intersection'](_0x62fa1e[_0x94c9('0x40')],_0x62fa1e[_0x94c9('0x41')]);_0x3dc269[_0x94c9('0x44')]=_['intersection'](_0x62fa1e[_0x94c9('0x40')],qs['fields'](_0x896723[_0x94c9('0x41')][_0x94c9('0x45')]));_0x3dc269[_0x94c9('0x44')]=_0x3dc269[_0x94c9('0x44')][_0x94c9('0x46')]?_0x3dc269[_0x94c9('0x44')]:_0x62fa1e['model'];if(!_0x896723['query']['hasOwnProperty'](_0x94c9('0x47'))){_0x3dc269[_0x94c9('0x21')]=qs[_0x94c9('0x21')](_0x896723['query'][_0x94c9('0x21')]);_0x3dc269['offset']=qs[_0x94c9('0x1f')](_0x896723[_0x94c9('0x41')][_0x94c9('0x1f')]);}_0x3dc269[_0x94c9('0x48')]=qs[_0x94c9('0x49')](_0x896723[_0x94c9('0x41')][_0x94c9('0x49')]);_0x3dc269['where']=qs[_0x94c9('0x43')](_['pick'](_0x896723[_0x94c9('0x41')],_0x62fa1e[_0x94c9('0x43')]),_0x3cfcc3);var _0x9e0fb8=[];var _0x9db0af=squel[_0x94c9('0x4a')]()[_0x94c9('0x4b')]('id')[_0x94c9('0x4b')](_0x94c9('0x2a'))['field'](_0x94c9('0x4c'))[_0x94c9('0x4d')](_0x94c9('0x4e'));var _0x14f796=squel[_0x94c9('0x4a')]()['field'](_0x94c9('0x4f'))[_0x94c9('0x4b')]('u.fullname')[_0x94c9('0x4b')]('ui.WhatsappInteractionId')[_0x94c9('0x4d')]('user_has_whatsapp_interactions','ui')['left_join'](_0x94c9('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x3582b1=squel['select']()[_0x94c9('0x4d')](_0x94c9('0x51'),'i')[_0x94c9('0x52')]('cm_contacts','c',_0x94c9('0x53'))[_0x94c9('0x52')](_0x94c9('0x50'),'o',_0x94c9('0x54'))[_0x94c9('0x52')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0x94c9('0x52')](_0x94c9('0x55'),'me',_0x94c9('0x56'))['left_join'](_0x94c9('0x57'),'it',_0x94c9('0x58'))[_0x94c9('0x52')]('tools_tags','t',_0x94c9('0x59'));var _0x866e9b=squel[_0x94c9('0x5a')]();var _0x232f31=[];var _0x372163=squel[_0x94c9('0x5a')]();var _0x324340;if(_0x896723[_0x94c9('0x41')]['search']){_0x324340=as[_0x94c9('0x5b')](_0x896723[_0x94c9('0x41')][_0x94c9('0x5c')]);var _0x58fee3=_0x324340['sqlOperator'];for(var _0x5b7948=0x0;_0x5b7948<_0x324340['conditions']['length'];_0x5b7948++){var _0x1e36bc=_0x324340[_0x94c9('0x5d')][_0x5b7948];var _0x30c285='i';var _0x31cf2a=_[_0x94c9('0x5e')](_0x3cfcc3,['name',_0x1e36bc[_0x94c9('0x4b')]]);if(!_0x31cf2a){switch(_0x1e36bc[_0x94c9('0x4b')]){case _0x94c9('0x5f'):if(_0x1e36bc[_0x94c9('0x60')]==0x1){_0x3582b1[_0x94c9('0x61')]('`'+_0x1e36bc['field']+'`\x20=\x200');}else{_0x3582b1['having']('`'+_0x1e36bc[_0x94c9('0x4b')]+'`\x20>\x200');}break;case _0x94c9('0x62'):if(_0x1e36bc[_0x94c9('0x63')]===_0x94c9('0x64')){if(_0x1e36bc[_0x94c9('0x60')]['split']('\x20')[_0x94c9('0x46')]>0x1){_0x866e9b[_0x58fee3](_0x94c9('0x65'),qs[_0x94c9('0x66')](_0x1e36bc[_0x94c9('0x60')]),null);}else{var _0xbbed57='%'+_0x1e36bc[_0x94c9('0x60')]+'%';_0x866e9b[_0x58fee3](_0x94c9('0x67'),_0xbbed57,_0xbbed57,_0xbbed57);}}else{_0x31cf2a=_[_0x94c9('0x5e')](_0x3cfcc3,[_0x94c9('0x2a'),_0x94c9('0x68')]);_0x1e36bc[_0x94c9('0x4b')]=_0x94c9('0x68');_0x5d37ea=as[_0x94c9('0x69')](_0x30c285,_0x31cf2a[_0x94c9('0x3e')],_0x1e36bc);_0x866e9b[_0x58fee3](_0x5d37ea[_0x94c9('0x6a')],_0x5d37ea['value'][_0x94c9('0x6b')],_0x5d37ea[_0x94c9('0x60')][_0x94c9('0x1d')]);}break;case _0x94c9('0x6c'):var _0x4728c0=_0x1e36bc[_0x94c9('0x60')][_0x94c9('0x30')](',')[_0x94c9('0x2d')](function(_0x2208bc){return Number(_0x2208bc);});_0x4728c0[_0x94c9('0x31')](function(_0x38bea4){_0x372163['or'](_0x94c9('0x6d'),'%,'+_0x38bea4+',%');});_0x232f31=_[_0x94c9('0x6e')](_0x232f31,_0x4728c0);break;case _0x94c9('0x6f'):if(_0x1e36bc[_0x94c9('0x63')]===_0x94c9('0x64')){_0x866e9b[_0x58fee3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1e36bc[_0x94c9('0x60')]+'%',null);}else{_0x31cf2a=_[_0x94c9('0x5e')](_0x3cfcc3,[_0x94c9('0x2a'),_0x94c9('0x38')]);_0x1e36bc['field']='UserId';_0x5d37ea=as[_0x94c9('0x69')](_0x30c285,_0x31cf2a[_0x94c9('0x3e')],_0x1e36bc);_0x866e9b[_0x58fee3](_0x5d37ea[_0x94c9('0x6a')],_0x5d37ea[_0x94c9('0x60')]['start'],_0x5d37ea['value'][_0x94c9('0x1d')]);}break;case _0x94c9('0x70'):_0x5d37ea=as[_0x94c9('0x69')]('me',null,_0x1e36bc);_0x866e9b[_0x58fee3](_0x5d37ea[_0x94c9('0x6a')],_0x5d37ea[_0x94c9('0x60')][_0x94c9('0x6b')],_0x5d37ea[_0x94c9('0x60')]['end']);break;}}else{var _0x5d37ea=as[_0x94c9('0x69')](_0x30c285,_0x31cf2a[_0x94c9('0x3e')],_0x1e36bc);_0x866e9b[_0x58fee3](_0x5d37ea['text'],_0x5d37ea['value']['start'],_0x5d37ea['value']['end']);}}}else{var _0x5183f4=_(_0x896723[_0x94c9('0x41')])[_0x94c9('0x42')]()[_0x94c9('0x2d')](function(_0x26ac9d){return _['some'](_0x3cfcc3,[_0x94c9('0x2a'),_0x26ac9d])?_0x26ac9d:undefined;})['compact']()[_0x94c9('0x60')]();if(!_[_0x94c9('0x71')](_0x5183f4)){_0x5183f4['forEach'](function(_0x14b399){if(_0x14b399===_0x94c9('0x72')){_0x3582b1[_0x94c9('0x73')]('i.WhatsappAccountId\x20IN\x20?',[]['concat'](_0x896723[_0x94c9('0x41')][_0x14b399]));}else if(_0x14b399===_0x94c9('0x74')){var _0x1791fd=JSON['parse'](_0x896723['query'][_0x14b399])['$gte'];var _0x203ebd=JSON['parse'](_0x896723[_0x94c9('0x41')][_0x14b399])[_0x94c9('0x75')];_0x3582b1[_0x94c9('0x73')](_0x94c9('0x76'),_0x1791fd,_0x203ebd);}else{if(_0x896723[_0x94c9('0x41')][_0x14b399]===_0x94c9('0x77')){_0x3582b1[_0x94c9('0x73')]('i.'+_0x14b399+_0x94c9('0x78'));}else{_0x3582b1['where']('i.'+_0x14b399+'\x20=\x20?',_0x896723[_0x94c9('0x41')][_0x14b399]);}}});}if(_0x896723['query'][_0x94c9('0x79')]){if(_0x896723[_0x94c9('0x41')][_0x94c9('0x79')]==0x1){_0x3582b1[_0x94c9('0x61')]('`unreadMessages`\x20=\x200');}else{_0x3582b1['having'](_0x94c9('0x7a'));}}if(_0x896723[_0x94c9('0x41')][_0x94c9('0x7b')]){_0x232f31=_['isArray'](_0x896723[_0x94c9('0x41')][_0x94c9('0x7b')])?_0x896723['query'][_0x94c9('0x7b')]:new Array(_0x896723[_0x94c9('0x41')]['tag']);_0x232f31['forEach'](function(_0x9bcf11){_0x372163['or'](_0x94c9('0x6d'),'%,'+_0x9bcf11+',%');});}if(_0x896723[_0x94c9('0x41')][_0x94c9('0x7c')]){var _0x494581=_0x896723['query'][_0x94c9('0x7c')][_0x94c9('0x7d')]('\x5c','\x5c\x5c')[_0x94c9('0x7d')](/'/g,'\x27\x27');if(qs[_0x94c9('0x7e')](_0x494581)){_0x866e9b['or'](_0x94c9('0x7f'),_0x494581+'%')['or'](_0x94c9('0x80'),_0x494581+'%');}else{_0x866e9b['or'](_0x94c9('0x81'),qs['getFullTextValue'](_0x494581))['or'](_0x94c9('0x82'),_0x494581+'%');}}}_0x3582b1['where'](_0x866e9b);_0x3582b1[_0x94c9('0x83')](_0x94c9('0x84'));var _0x5955c7={'type':db[_0x94c9('0x85')]['QueryTypes'][_0x94c9('0x86')],'raw':!![]};var _0x303bc4=_0x3582b1['clone']();_0x303bc4[_0x94c9('0x4b')](_0x94c9('0x84'));_0x303bc4[_0x94c9('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x94c9('0x5f'));if(_0x3dc269[_0x94c9('0x48')]){_0x3dc269['order']['forEach'](function(_0x1933fe){var _0x1c75d3=_0x1933fe[0x0]===_0x94c9('0x87')?_0x1933fe[0x0]:'i.'+_0x1933fe[0x0];_0x3582b1[_0x94c9('0x48')](_0x1c75d3,_0x1933fe[0x1]===_0x94c9('0x88')?![]:!![]);});}if(!_['isEmpty'](_0x232f31)){_0x3582b1[_0x94c9('0x61')](_0x372163);_0x303bc4['where']('t.id\x20IN\x20?',_0x232f31);}BPromise[_0x94c9('0x89')]()[_0x94c9('0x27')](function(){if(!_0x324340){if(_0x896723[_0x94c9('0x41')]['WhatsappAccountId'])return;_0x303bc4['where'](_0x94c9('0x8a'));_0x3582b1[_0x94c9('0x73')](_0x94c9('0x8a'));return;}if(_0x896723['user'][_0x94c9('0x8b')]!==_0x94c9('0x8c'))return;return _0x896723['user'][_0x94c9('0x8d')]({'attributes':['id'],'raw':!![]})[_0x94c9('0x27')](function(_0x10257a){if(_[_0x94c9('0x71')](_0x10257a)){_0x303bc4[_0x94c9('0x73')](_0x94c9('0x8e'));_0x3582b1[_0x94c9('0x73')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x303bc4[_0x94c9('0x73')](_0x94c9('0x8f'),_['map'](_0x10257a,'id'));_0x3582b1['where']('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x10257a,'id'));}});})[_0x94c9('0x27')](function(){if(_0x896723[_0x94c9('0x90')]['role']===_0x94c9('0x8c')&&!_0x324340&&!_0x896723[_0x94c9('0x41')]['WhatsappAccountId'])return[];return db[_0x94c9('0x91')][_0x94c9('0x41')](_0x303bc4['toString'](),_0x5955c7);})['then'](function(_0x29a56c){_0x3516b1[_0x94c9('0x22')]=_0x29a56c[_0x94c9('0x46')];if(_0x3516b1[_0x94c9('0x22')]===0x0)return[];return db[_0x94c9('0x91')]['query'](_0x9db0af['toString'](),_0x5955c7)[_0x94c9('0x27')](function(_0x4fd736){_0x9e0fb8=_[_0x94c9('0x92')](_0x4fd736,'id');_0x5955c7=_[_0x94c9('0x93')](_0x5955c7,{'model':db[_0x94c9('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x896723['query']['fields']){_0x3dc269[_0x94c9('0x44')]['forEach'](function(_0x1d2118){_0x3582b1[_0x94c9('0x4b')]('i.'+_0x1d2118);});}else{_0x3582b1[_0x94c9('0x4b')](_0x94c9('0x94'),_0x94c9('0x5f'));_0x3582b1['field'](_0x94c9('0x95'),_0x94c9('0x96'));_0x3582b1[_0x94c9('0x4b')](_0x94c9('0x97'),'Account.mandatoryDisposition');_0x3582b1[_0x94c9('0x4b')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x3582b1[_0x94c9('0x4b')](_0x94c9('0x98'));_0x3582b1[_0x94c9('0x4b')](_0x94c9('0x99'),'Contact.firstName');_0x3582b1[_0x94c9('0x4b')](_0x94c9('0x9a'),_0x94c9('0x9b'));_0x3582b1[_0x94c9('0x4b')](_0x94c9('0x9c'),'Contact.email');_0x3582b1[_0x94c9('0x4b')](_0x94c9('0x9d'),'Contact.phone');_0x3582b1[_0x94c9('0x4b')](_0x94c9('0x9e'),_0x94c9('0x9f'));_0x3582b1[_0x94c9('0x4b')]('c.fax',_0x94c9('0xa0'));_0x3582b1[_0x94c9('0x4b')](_0x94c9('0xa1'),'Owner.fullname');_0x3582b1[_0x94c9('0x4b')](_0x94c9('0xa2'),_0x94c9('0xa3'));_0x3582b1[_0x94c9('0x4b')](_0x94c9('0xa4'),'TagIds');}if(_0x3dc269[_0x94c9('0x21')])_0x3582b1['limit'](_0x3dc269['limit']);if(_0x3dc269[_0x94c9('0x1f')])_0x3582b1['offset'](_0x3dc269[_0x94c9('0x1f')]);return db['sequelize'][_0x94c9('0x41')](_0x3582b1['toString'](),_0x5955c7);})[_0x94c9('0x27')](function(_0x1cc549){if(_0x1cc549[_0x94c9('0x46')]>0x0)_0x14f796[_0x94c9('0x73')](_0x94c9('0xa5'),_[_0x94c9('0x2d')](_0x1cc549,'id'));return db['sequelize'][_0x94c9('0x41')](_0x14f796[_0x94c9('0xa6')](),_0x5955c7)['then'](function(_0x17ef76){var _0x18c085=_[_0x94c9('0xa7')](_0x17ef76,'WhatsappInteractionId');var _0x3c73a7=[];_0x1cc549[_0x94c9('0x31')](function(_0x19209f){_0x3c73a7['push'](updateWhatsappInteraction(_0x19209f,_0x9e0fb8,_0x18c085));});return BPromise[_0x94c9('0xa8')](_0x3c73a7);});});})[_0x94c9('0x27')](function(_0x354042){_0x3516b1[_0x94c9('0xa9')]=_0x354042;return _0x3516b1;})[_0x94c9('0x27')](respondWithFilteredResult(_0x9e1f90,_0x3dc269))['catch'](handleError(_0x9e1f90,null));};exports[_0x94c9('0xaa')]=function(_0x37a331,_0x23f165){var _0x3eb1cd={'raw':![],'where':{'id':_0x37a331[_0x94c9('0xab')]['id']}},_0x4bc2eb={};_0x4bc2eb['model']=_[_0x94c9('0x42')](db[_0x94c9('0x3b')][_0x94c9('0x3c')]);_0x4bc2eb[_0x94c9('0x41')]=_[_0x94c9('0x42')](_0x37a331[_0x94c9('0x41')]);_0x4bc2eb[_0x94c9('0x43')]=_[_0x94c9('0xac')](_0x4bc2eb[_0x94c9('0x40')],_0x4bc2eb['query']);_0x3eb1cd['attributes']=_[_0x94c9('0xac')](_0x4bc2eb[_0x94c9('0x40')],qs[_0x94c9('0x45')](_0x37a331['query'][_0x94c9('0x45')]));_0x3eb1cd[_0x94c9('0x44')]=_0x3eb1cd[_0x94c9('0x44')][_0x94c9('0x46')]?_0x3eb1cd[_0x94c9('0x44')]:_0x4bc2eb['model'];if(_0x37a331['query']['includeAll']){_0x3eb1cd[_0x94c9('0xad')]=[{'all':!![]}];}_0x3eb1cd=_[_0x94c9('0x93')]({},_0x3eb1cd,_0x37a331['options']);return db[_0x94c9('0x3b')][_0x94c9('0x5e')](_0x3eb1cd)[_0x94c9('0x27')](handleEntityNotFound(_0x23f165,null))['then'](respondWithResult(_0x23f165,null))['catch'](handleError(_0x23f165,null));};exports[_0x94c9('0xae')]=function(_0x181581,_0x440b7b){return db[_0x94c9('0x3b')][_0x94c9('0xae')](_0x181581[_0x94c9('0x70')],{})[_0x94c9('0x27')](respondWithResult(_0x440b7b,0xc9))['catch'](handleError(_0x440b7b,null));};exports[_0x94c9('0x26')]=function(_0x28ecd3,_0x98b588){if(_0x28ecd3['body']['id']){delete _0x28ecd3[_0x94c9('0x70')]['id'];}return db[_0x94c9('0x3b')][_0x94c9('0x5e')]({'where':{'id':_0x28ecd3['params']['id']}})[_0x94c9('0x27')](handleEntityNotFound(_0x98b588,null))[_0x94c9('0x27')](saveUpdates(_0x28ecd3[_0x94c9('0x70')],null))['then'](respondWithResult(_0x98b588,null))[_0x94c9('0xaf')](handleError(_0x98b588,null));};exports['destroy']=function(_0x348b02,_0x173c88){return db['WhatsappInteraction'][_0x94c9('0x5e')]({'where':{'id':_0x348b02[_0x94c9('0xab')]['id']}})[_0x94c9('0x27')](handleEntityNotFound(_0x173c88,null))[_0x94c9('0x27')](removeEntity(_0x173c88,null))['catch'](handleError(_0x173c88,null));};exports['describe']=function(_0x1848e3,_0x4e16a4){return db['WhatsappInteraction'][_0x94c9('0xb0')]()[_0x94c9('0x27')](respondWithResult(_0x4e16a4,null))[_0x94c9('0xaf')](handleError(_0x4e16a4,null));};exports[_0x94c9('0xb1')]=function(_0x2d1253,_0x394959,_0x1b2e90){return db[_0x94c9('0xb2')]['find']({'where':{'id':_0x2d1253[_0x94c9('0xab')]['id']}})[_0x94c9('0x27')](handleEntityNotFound(_0x394959,null))[_0x94c9('0x27')](function(_0x274c62){if(_0x274c62){return _0x274c62[_0x94c9('0xb1')](_0x2d1253['body'][_0x94c9('0xb3')],_[_0x94c9('0xb4')](_0x2d1253[_0x94c9('0x70')],[_0x94c9('0xb3'),'id'])||{});}})[_0x94c9('0x27')](respondWithResult(_0x394959,null))[_0x94c9('0xaf')](handleError(_0x394959,null));};exports[_0x94c9('0xb5')]=function(_0x24be38,_0x59a341,_0x4a14f2){var _0x15f872={'raw':![],'where':{}};var _0x1efd48={};var _0x30c0d8={'count':0x0,'rows':[]};return db[_0x94c9('0x3b')][_0x94c9('0xb6')]({'where':{'id':_0x24be38[_0x94c9('0xab')]['id']}})[_0x94c9('0x27')](handleEntityNotFound(_0x59a341,null))[_0x94c9('0x27')](function(_0x5a17c9){if(_0x5a17c9){_0x1efd48[_0x94c9('0x40')]=_[_0x94c9('0x42')](db[_0x94c9('0xb2')]['rawAttributes']);_0x1efd48[_0x94c9('0x41')]=_[_0x94c9('0x42')](_0x24be38[_0x94c9('0x41')]);_0x1efd48['filters']=_['intersection'](_0x1efd48[_0x94c9('0x40')],_0x1efd48[_0x94c9('0x41')]);_0x15f872[_0x94c9('0x44')]=_[_0x94c9('0xac')](_0x1efd48['model'],qs[_0x94c9('0x45')](_0x24be38['query'][_0x94c9('0x45')]));_0x15f872[_0x94c9('0x44')]=_0x15f872['attributes'][_0x94c9('0x46')]?_0x15f872[_0x94c9('0x44')]:_0x1efd48[_0x94c9('0x40')];if(!_0x24be38[_0x94c9('0x41')][_0x94c9('0xb7')](_0x94c9('0x47'))){_0x15f872['limit']=qs[_0x94c9('0x21')](_0x24be38[_0x94c9('0x41')][_0x94c9('0x21')]);_0x15f872[_0x94c9('0x1f')]=qs['offset'](_0x24be38[_0x94c9('0x41')][_0x94c9('0x1f')]);}_0x15f872[_0x94c9('0x48')]=qs[_0x94c9('0x49')](_0x24be38[_0x94c9('0x41')][_0x94c9('0x49')]);_0x15f872[_0x94c9('0x73')]=qs[_0x94c9('0x43')](_[_0x94c9('0xb8')](_0x24be38['query'],_0x1efd48[_0x94c9('0x43')]));_0x15f872[_0x94c9('0x73')][_0x94c9('0xb9')]=_0x5a17c9['id'];if(_0x24be38[_0x94c9('0x41')]['filter']){_0x15f872[_0x94c9('0x73')]=_[_0x94c9('0x93')](_0x15f872[_0x94c9('0x73')],{'$or':_[_0x94c9('0x2d')](_0x15f872[_0x94c9('0x44')],function(_0x382316){var _0x523864={};_0x523864[_0x382316]={'$like':'%'+_0x24be38[_0x94c9('0x41')]['filter']+'%'};return _0x523864;})});}if(_0x24be38['query'][_0x94c9('0xba')]){var _0x2c1d18=_0x24be38['query'][_0x94c9('0xba')]['split'](',');var _0x9e2aae={};_0x9e2aae[_0x2c1d18[0x0]]={'$gte':moment(_0x2c1d18[0x1])[_0x94c9('0xbb')](_0x94c9('0xbc'))};_0x15f872[_0x94c9('0x73')]=_[_0x94c9('0x93')](_0x15f872[_0x94c9('0x73')],_0x9e2aae);}_0x15f872=_[_0x94c9('0x93')]({},_0x15f872,_0x24be38[_0x94c9('0xbd')]);return db[_0x94c9('0xb2')]['count']({'where':_0x15f872[_0x94c9('0x73')]})[_0x94c9('0x27')](function(_0x1b6a58){_0x30c0d8[_0x94c9('0x22')]=_0x1b6a58;if(_0x24be38[_0x94c9('0x41')]['includeAll']){_0x15f872[_0x94c9('0xad')]=[{'all':!![]}];}return db[_0x94c9('0xb2')][_0x94c9('0xbe')](_0x15f872);})[_0x94c9('0x27')](function(_0x21c864){_0x30c0d8[_0x94c9('0xa9')]=_0x21c864;return _0x30c0d8;});}})[_0x94c9('0x27')](respondWithFilteredResult(_0x59a341,_0x15f872))[_0x94c9('0xaf')](handleError(_0x59a341,null));};exports['addTags']=function(_0x229e13,_0x2ba89b,_0x4d6798){return db['WhatsappInteraction'][_0x94c9('0x5e')]({'where':{'id':_0x229e13[_0x94c9('0xab')]['id']}})[_0x94c9('0x27')](handleEntityNotFound(_0x2ba89b,null))[_0x94c9('0x27')](function(_0x155ad8){if(_0x155ad8){return _0x155ad8['setTags'](_0x229e13[_0x94c9('0x70')][_0x94c9('0xb3')],_['omit'](_0x229e13[_0x94c9('0x70')],[_0x94c9('0xb3'),'id'])||{})[_0x94c9('0xbf')](function(){return db[_0x94c9('0x6c')]['findAll']({'attributes':['id',_0x94c9('0x2a'),_0x94c9('0x4c')],'where':{'id':_0x229e13[_0x94c9('0x70')][_0x94c9('0xb3')]}});})[_0x94c9('0x27')](function(_0x178796){socket[_0x94c9('0xc0')](_0x94c9('0xc1'),{'id':Number(_0x229e13[_0x94c9('0xab')]['id']),'tags':_0x178796||[]});return{'id':Number(_0x229e13[_0x94c9('0xab')]['id']),'tags':_0x178796||[]};});}})['then'](respondWithResult(_0x2ba89b,null))[_0x94c9('0xaf')](handleError(_0x2ba89b,null));};exports[_0x94c9('0xc2')]=function(_0x4bead2,_0x10b846,_0x57cb98){return db[_0x94c9('0x3b')][_0x94c9('0x5e')]({'where':{'id':_0x4bead2[_0x94c9('0xab')]['id']}})['then'](handleEntityNotFound(_0x10b846,null))['then'](function(_0x5c52df){if(_0x5c52df){return _0x5c52df[_0x94c9('0xc2')](_0x4bead2[_0x94c9('0x41')][_0x94c9('0xb3')]);}})[_0x94c9('0x27')](respondWithStatusCode(_0x10b846,null))['catch'](handleError(_0x10b846,null));};exports[_0x94c9('0xc3')]=function(_0x2e7904,_0x4fd26f){var _0x42052e=moment()[_0x94c9('0xc4')]()['toString']();var _0x2c4d10=path[_0x94c9('0xc5')](config['root'],'server','files',_0x94c9('0xc6'));var _0x24b174=path[_0x94c9('0xc5')](config[_0x94c9('0xc7')],_0x94c9('0xc8'),_0x94c9('0xc9'),_0x94c9('0xca'));var _0x4233ff=path[_0x94c9('0xc5')](_0x2c4d10,_0x42052e);var _0x1cfa13=util[_0x94c9('0xbb')](_0x94c9('0xcb'),_0x2e7904[_0x94c9('0xab')]['id'],_0x42052e);var _0x33c4a0=path[_0x94c9('0xc5')](_0x2c4d10,_0x1cfa13);var _0x436c04=[];_0x436c04[_0x94c9('0x32')]({'model':db[_0x94c9('0x6f')],'as':_0x94c9('0x6f'),'attributes':['id',_0x94c9('0x2e')],'raw':!![]});_0x436c04[_0x94c9('0x32')]({'model':db['CmContact'],'as':_0x94c9('0x62'),'attributes':['id',_0x94c9('0xcc'),_0x94c9('0xcd')],'raw':!![]});if(_0x2e7904['query'][_0x94c9('0xca')]){_0x436c04[_0x94c9('0x32')]({'model':db[_0x94c9('0xce')],'as':_0x94c9('0xce'),'raw':!![]});}var _0x412d45=[{'model':db[_0x94c9('0xb2')],'as':_0x94c9('0xcf'),'attributes':['id',_0x94c9('0x70'),_0x94c9('0x74'),_0x94c9('0xd0'),_0x94c9('0xd1'),_0x94c9('0x79')],'include':_0x436c04}];_0x412d45[_0x94c9('0x32')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0x94c9('0x2a')]});_0x412d45[_0x94c9('0x32')]({'model':db[_0x94c9('0x6f')],'as':_0x94c9('0xd2'),'attributes':['id',_0x94c9('0x2e')]});return db[_0x94c9('0x3b')][_0x94c9('0x5e')]({'where':{'id':_0x2e7904[_0x94c9('0xab')]['id']},'include':_0x412d45})['then'](handleEntityNotFound(_0x4fd26f,null))[_0x94c9('0x27')](function(_0x8737d1){if(_0x8737d1){var _0x3eea6b=_0x8737d1['get']({'plain':!![]});fs[_0x94c9('0xd3')](_0x4233ff);var _0x4e02a1={'channel':_0x94c9('0xd4'),'account':_0x3eea6b[_0x94c9('0xd5')][_0x94c9('0x2a')],'agent':_0x3eea6b[_0x94c9('0xd2')]?_0x3eea6b['Owner'][_0x94c9('0x2e')]:_0x94c9('0xd6'),'createdAt':moment(_0x3eea6b[_0x94c9('0x74')])[_0x94c9('0xbb')](_0x94c9('0xbc'))[_0x94c9('0xa6')](),'closedAt':_0x3eea6b[_0x94c9('0x37')]?moment(_0x3eea6b[_0x94c9('0xd7')])[_0x94c9('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')[_0x94c9('0xa6')]():'','disposition':_0x3eea6b[_0x94c9('0xd8')],'messages':_(_0x3eea6b[_0x94c9('0xcf')])[_0x94c9('0x7c')]({'secret':![]})[_0x94c9('0x2d')](function(_0x2ce8fe){if(_0x2ce8fe[_0x94c9('0xce')]){var _0x4b29a1=path[_0x94c9('0xc5')](_0x24b174,_0x2ce8fe[_0x94c9('0xce')]['basename']);if(fs[_0x94c9('0xd9')](_0x4b29a1)){fs['createReadStream'](_0x4b29a1)[_0x94c9('0xda')](fs['createWriteStream'](path[_0x94c9('0xc5')](_0x4233ff,_0x2ce8fe[_0x94c9('0xce')][_0x94c9('0xdb')])));}}return{'date':moment(_0x2ce8fe[_0x94c9('0x74')])[_0x94c9('0xbb')](_0x94c9('0xbc'))[_0x94c9('0xa6')](),'sender':_0x2ce8fe['direction']===_0x94c9('0xdc')?_0x2ce8fe[_0x94c9('0x6f')]?_0x2ce8fe['User'][_0x94c9('0x2e')]:_0x94c9('0xdd'):_0x2ce8fe[_0x94c9('0x62')][_0x94c9('0xcc')]+(_0x2ce8fe['Contact'][_0x94c9('0xcd')]?'\x20'+_0x2ce8fe['Contact'][_0x94c9('0xcd')]:''),'body':_0x2ce8fe[_0x94c9('0xce')]?_0x2ce8fe[_0x94c9('0xce')]['basename']:_0x2ce8fe[_0x94c9('0x70')],'direction':_0x2ce8fe[_0x94c9('0xd0')]===_0x94c9('0xdc')?'A':'C','secret':_0x2ce8fe['secret'],'read':_0x2ce8fe[_0x94c9('0x79')],'attachment':_0x2ce8fe[_0x94c9('0xce')]};})[_0x94c9('0x60')]()};return ejs[_0x94c9('0xde')](path['join'](config['root'],_0x94c9('0xc8'),_0x94c9('0xdf'),'downloadInteraction.ejs'),{'interaction':_0x4e02a1})['then'](function(_0x3a5a21){var _0x445c2a=path[_0x94c9('0xc5')](_0x4233ff,_0x94c9('0xe0')+_0x3eea6b['id']+'-'+_0x42052e+'.pdf');var _0x655b47={'path':_0x445c2a,'channel':'Whatsapp','interactionId':_0x3eea6b['id']};return pdf[_0x94c9('0xe1')](_0x3a5a21,_0x655b47);})['then'](function(){return new BPromise(function(_0x4c7f83,_0x136d83){zipdir(_0x4233ff,{'saveTo':_0x33c4a0},function(_0x28e7ab,_0x44d779){if(_0x28e7ab)return _0x136d83(_0x28e7ab);return _0x4c7f83(_0x44d779);});})[_0x94c9('0x27')](function(){return new BPromise(function(_0x27983d,_0x8ffa6a){rimraf(_0x4233ff,function(_0x26c45c){if(_0x26c45c)_0x8ffa6a(_0x26c45c);return _0x27983d();});});})[_0x94c9('0x27')](function(){return _0x4fd26f[_0x94c9('0xc3')](_0x33c4a0,_0x1cfa13,function(_0x3890c6){if(_0x3890c6){console[_0x94c9('0xe2')](_0x94c9('0xe3'),_0x3890c6);}else{fs[_0x94c9('0xe4')](_0x33c4a0);}});});});}else{return _0x4fd26f[_0x94c9('0x1b')](0xc8);}})['catch'](handleError(_0x4fd26f,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 2c8b40d..b2bb2d7 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 _0xcbe1=['update','then','setDataValue','Users','map','findAll','length','emit','catch','hook','../../mysqldb','save'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xcbe1,0x1a2));var _0x1cbe=function(_0x2af3e1,_0xb5207f){_0x2af3e1=_0x2af3e1-0x0;var _0xfa27d=_0xcbe1[_0x2af3e1];return _0xfa27d;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x1cbe('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1cbe('0x1'),'afterUpdate':_0x1cbe('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1ba56c){return function(_0x563162,_0x940654,_0x168121){_0x563162['getUsers']({'attributes':['id'],'raw':!![]})[_0x1cbe('0x3')](function(_0x21342a){_0x563162[_0x1cbe('0x4')](_0x1cbe('0x5'),_0x21342a[_0x1cbe('0x6')](function(_0x3e72a0){return{'id':_0x3e72a0['id']};}));return WhatsappMessage[_0x1cbe('0x7')]({'where':{'WhatsappInteractionId':_0x563162['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1cbe('0x3')](function(_0x5af288){_0x563162[_0x1cbe('0x4')]('unreadMessages',_0x5af288[_0x1cbe('0x8')]);WhatsappInteractionEvents[_0x1cbe('0x9')](_0x1ba56c+':'+_0x563162['id'],_0x563162);WhatsappInteractionEvents[_0x1cbe('0x9')](_0x1ba56c,_0x563162);_0x168121(null);})[_0x1cbe('0xa')](_0x168121(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x1cbe('0xb')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0xea70=['length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','remove','then','Users','map','findAll','setDataValue'];(function(_0x183776,_0x3410a1){var _0x1bdf3f=function(_0x45414e){while(--_0x45414e){_0x183776['push'](_0x183776['shift']());}};_0x1bdf3f(++_0x3410a1);}(_0xea70,0x175));var _0x0ea7=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xea70[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0x0ea7('0x0'));var WhatsappInteraction=require(_0x0ea7('0x1'))['db'][_0x0ea7('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0x0ea7('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0ea7('0x4'),'afterUpdate':'update','afterDestroy':_0x0ea7('0x5')};function emitEvent(_0x3138eb){return function(_0x25ed37,_0x221ac8,_0x168372){_0x25ed37['getUsers']({'attributes':['id'],'raw':!![]})[_0x0ea7('0x6')](function(_0x1ebefe){_0x25ed37['setDataValue'](_0x0ea7('0x7'),_0x1ebefe[_0x0ea7('0x8')](function(_0x55e1c6){return{'id':_0x55e1c6['id']};}));return WhatsappMessage[_0x0ea7('0x9')]({'where':{'WhatsappInteractionId':_0x25ed37['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ea7('0x6')](function(_0xdef39){_0x25ed37[_0x0ea7('0xa')]('unreadMessages',_0xdef39[_0x0ea7('0xb')]);WhatsappInteractionEvents[_0x0ea7('0xc')](_0x3138eb+':'+_0x25ed37['id'],_0x25ed37);WhatsappInteractionEvents[_0x0ea7('0xc')](_0x3138eb,_0x25ed37);_0x168372(null);})[_0x0ea7('0xd')](_0x168372(null));};}for(var e in events){if(events[_0x0ea7('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x0ea7('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 5224bdf..5d93c3c 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 _0xa280=['../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0xb7f08,_0x523aa0){var _0x3474f5=function(_0x44d70c){while(--_0x44d70c){_0xb7f08['push'](_0xb7f08['shift']());}};_0x3474f5(++_0x523aa0);}(_0xa280,0x126));var _0x0a28=function(_0x1ca7e0,_0x1de683){_0x1ca7e0=_0x1ca7e0-0x0;var _0x360316=_0xa280[_0x1ca7e0];return _0x360316;};'use strict';var _=require('lodash');var util=require(_0x0a28('0x0'));var logger=require(_0x0a28('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0a28('0x2'));var rp=require(_0x0a28('0x3'));var fs=require('fs');var path=require(_0x0a28('0x4'));var rimraf=require(_0x0a28('0x5'));var config=require(_0x0a28('0x6'));var attributes=require(_0x0a28('0x7'));module[_0x0a28('0x8')]=function(_0x12faad,_0x1dae54){return _0x12faad['define'](_0x0a28('0x9'),attributes,{'tableName':_0x0a28('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e6ba7,_0x8c72df,_0x78beaa){if(_0x4e6ba7[_0x0a28('0xb')](_0x0a28('0xc'))){_0x4e6ba7[_0x0a28('0xd')]=moment()[_0x0a28('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x78beaa(null,_0x4e6ba7);}}});}; \ No newline at end of file +var _0x7cc5=['request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xe742f6,_0x4a7994){var _0xab554c=function(_0x31b7ca){while(--_0x31b7ca){_0xe742f6['push'](_0xe742f6['shift']());}};_0xab554c(++_0x4a7994);}(_0x7cc5,0x186));var _0x57cc=function(_0x2ed4c9,_0x243771){_0x2ed4c9=_0x2ed4c9-0x0;var _0x237f0a=_0x7cc5[_0x2ed4c9];return _0x237f0a;};'use strict';var _=require(_0x57cc('0x0'));var util=require(_0x57cc('0x1'));var logger=require(_0x57cc('0x2'))(_0x57cc('0x3'));var moment=require(_0x57cc('0x4'));var BPromise=require(_0x57cc('0x5'));var rp=require(_0x57cc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57cc('0x7'));var config=require(_0x57cc('0x8'));var attributes=require(_0x57cc('0x9'));module['exports']=function(_0x4ce1bf,_0x1caa15){return _0x4ce1bf[_0x57cc('0xa')](_0x57cc('0xb'),attributes,{'tableName':_0x57cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b45c4,_0x22fd4f,_0x2b97dd){if(_0x3b45c4[_0x57cc('0xd')](_0x57cc('0xe'))){_0x3b45c4[_0x57cc('0xf')]=moment()[_0x57cc('0x10')](_0x57cc('0x11'));}_0x2b97dd(null,_0x3b45c4);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index f9eeb46..e639945 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 _0xcb9b=['http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','omit','ids','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0xcb9b,0x11c));var _0xbcb9=function(_0x2d3030,_0x2daea2){_0x2d3030=_0x2d3030-0x0;var _0x247c7e=_0xcb9b[_0x2d3030];return _0x247c7e;};'use strict';var _=require(_0xbcb9('0x0'));var util=require('util');var moment=require(_0xbcb9('0x1'));var BPromise=require(_0xbcb9('0x2'));var rs=require(_0xbcb9('0x3'));var fs=require('fs');var Redis=require(_0xbcb9('0x4'));var db=require(_0xbcb9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcb9('0x6'))(_0xbcb9('0x7'));var config=require(_0xbcb9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbcb9('0x9')][_0xbcb9('0xa')]({'port':0x232a});config[_0xbcb9('0xb')]=_[_0xbcb9('0xc')](config[_0xbcb9('0xb')],{'host':_0xbcb9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbcb9('0xb')]));require(_0xbcb9('0xe'))[_0xbcb9('0xf')](socket);function respondWithRpcPromise(_0x5da8c1,_0x362c4c,_0x510015){return new BPromise(function(_0x5f15de,_0x517e9c){return client[_0xbcb9('0x10')](_0x5da8c1,_0x510015)[_0xbcb9('0x11')](function(_0x270c5c){logger[_0xbcb9('0x12')](_0xbcb9('0x13'),_0x362c4c,'request\x20sent');logger[_0xbcb9('0x14')](_0xbcb9('0x15'),_0x362c4c,_0xbcb9('0x16'),JSON[_0xbcb9('0x17')](_0x270c5c));if(_0x270c5c[_0xbcb9('0x18')]){if(_0x270c5c['error'][_0xbcb9('0x19')]===0x1f4){logger[_0xbcb9('0x18')](_0xbcb9('0x13'),_0x362c4c,_0x270c5c[_0xbcb9('0x18')][_0xbcb9('0x1a')]);return _0x517e9c(_0x270c5c[_0xbcb9('0x18')][_0xbcb9('0x1a')]);}logger[_0xbcb9('0x18')](_0xbcb9('0x13'),_0x362c4c,_0x270c5c[_0xbcb9('0x18')][_0xbcb9('0x1a')]);return _0x5f15de(_0x270c5c[_0xbcb9('0x18')][_0xbcb9('0x1a')]);}else{logger['info'](_0xbcb9('0x13'),_0x362c4c,'request\x20sent');_0x5f15de(_0x270c5c[_0xbcb9('0x1b')][_0xbcb9('0x1a')]);}})[_0xbcb9('0x1c')](function(_0x4ec398){logger['error'](_0xbcb9('0x13'),_0x362c4c,_0x4ec398);_0x517e9c(_0x4ec398);});});}exports[_0xbcb9('0x1d')]=function(_0x8571b){var _0x3fc4e0=this;return new Promise(function(_0x10f27d,_0x4a8ecd){return db[_0xbcb9('0x1e')]['update'](_0x8571b[_0xbcb9('0x1f')],{'raw':_0x8571b[_0xbcb9('0x20')]?_0x8571b[_0xbcb9('0x20')][_0xbcb9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8571b[_0xbcb9('0x20')]?_0x8571b[_0xbcb9('0x20')][_0xbcb9('0x22')]||null:null,'attributes':_0x8571b[_0xbcb9('0x20')]?_0x8571b[_0xbcb9('0x20')][_0xbcb9('0x23')]||null:null,'limit':_0x8571b[_0xbcb9('0x20')]?_0x8571b['options'][_0xbcb9('0x24')]||null:null})['then'](function(_0x336c0e){logger[_0xbcb9('0x12')](_0xbcb9('0x1d'),_0x8571b);logger['debug'](_0xbcb9('0x1d'),_0x8571b,JSON[_0xbcb9('0x17')](_0x336c0e));_0x10f27d(_0x336c0e);})[_0xbcb9('0x1c')](function(_0x570e52){logger[_0xbcb9('0x18')](_0xbcb9('0x1d'),_0x570e52[_0xbcb9('0x1a')],_0x8571b);_0x4a8ecd(_0x3fc4e0[_0xbcb9('0x18')](0x1f4,_0x570e52[_0xbcb9('0x1a')]));});});};exports[_0xbcb9('0x25')]=function(_0x46373f){return new Promise(function(_0x941641,_0x53bf00){return db[_0xbcb9('0x1e')][_0xbcb9('0x26')]({'where':_0x46373f[_0xbcb9('0x20')]?_0x46373f[_0xbcb9('0x20')]['where']||null:null})['then'](function(_0x161841){if(_0x161841){return _0x161841['addTags'](_0x46373f['body']['ids'],_[_0xbcb9('0x27')](_0x46373f[_0xbcb9('0x1f')],[_0xbcb9('0x28'),'id'])||{});}})['spread'](function(_0x5ca62d){logger[_0xbcb9('0x12')]('AddTags',_0x46373f);logger[_0xbcb9('0x14')](_0xbcb9('0x29'),_0x46373f,JSON[_0xbcb9('0x17')](_0x5ca62d));_0x941641(_0x5ca62d);})[_0xbcb9('0x1c')](function(_0x96a6ed){logger[_0xbcb9('0x18')](_0xbcb9('0x29'),_0x96a6ed[_0xbcb9('0x1a')],_0x46373f);_0x53bf00(_this[_0xbcb9('0x18')](0x1f4,_0x96a6ed[_0xbcb9('0x1a')]));});});}; \ No newline at end of file +var _0x1322=['update','body','options','raw','where','attributes','UpdateWhatsappInteraction','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappInteraction'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1322,0x19b));var _0x2132=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x1322[_0x26f702];return _0x11417d;};'use strict';var _=require('lodash');var util=require(_0x2132('0x0'));var moment=require(_0x2132('0x1'));var BPromise=require(_0x2132('0x2'));var rs=require(_0x2132('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2132('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2132('0x5'))('rpc');var config=require(_0x2132('0x6'));var jayson=require(_0x2132('0x7'));var client=jayson[_0x2132('0x8')][_0x2132('0x9')]({'port':0x232a});config[_0x2132('0xa')]=_[_0x2132('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2132('0xc'))(new Redis(config['redis']));require(_0x2132('0xd'))[_0x2132('0xe')](socket);function respondWithRpcPromise(_0xaf910b,_0x50f153,_0x1fefd2){return new BPromise(function(_0x49ba1a,_0x1e67cb){return client[_0x2132('0xf')](_0xaf910b,_0x1fefd2)[_0x2132('0x10')](function(_0x5c744d){logger[_0x2132('0x11')](_0x2132('0x12'),_0x50f153,_0x2132('0x13'));logger[_0x2132('0x14')](_0x2132('0x15'),_0x50f153,_0x2132('0x13'),JSON[_0x2132('0x16')](_0x5c744d));if(_0x5c744d[_0x2132('0x17')]){if(_0x5c744d['error'][_0x2132('0x18')]===0x1f4){logger[_0x2132('0x17')](_0x2132('0x12'),_0x50f153,_0x5c744d[_0x2132('0x17')][_0x2132('0x19')]);return _0x1e67cb(_0x5c744d[_0x2132('0x17')][_0x2132('0x19')]);}logger[_0x2132('0x17')](_0x2132('0x12'),_0x50f153,_0x5c744d[_0x2132('0x17')][_0x2132('0x19')]);return _0x49ba1a(_0x5c744d[_0x2132('0x17')][_0x2132('0x19')]);}else{logger[_0x2132('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x50f153,_0x2132('0x13'));_0x49ba1a(_0x5c744d[_0x2132('0x1a')][_0x2132('0x19')]);}})[_0x2132('0x1b')](function(_0x5eb9d9){logger[_0x2132('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x50f153,_0x5eb9d9);_0x1e67cb(_0x5eb9d9);});});}exports['UpdateWhatsappInteraction']=function(_0x591e91){var _0x5876d3=this;return new Promise(function(_0x51ffb0,_0x28ff2f){return db[_0x2132('0x1c')][_0x2132('0x1d')](_0x591e91[_0x2132('0x1e')],{'raw':_0x591e91[_0x2132('0x1f')]?_0x591e91[_0x2132('0x1f')][_0x2132('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x591e91['options']?_0x591e91[_0x2132('0x1f')][_0x2132('0x21')]||null:null,'attributes':_0x591e91['options']?_0x591e91['options'][_0x2132('0x22')]||null:null,'limit':_0x591e91[_0x2132('0x1f')]?_0x591e91[_0x2132('0x1f')]['limit']||null:null})['then'](function(_0x3f42d3){logger[_0x2132('0x11')](_0x2132('0x23'),_0x591e91);logger[_0x2132('0x14')](_0x2132('0x23'),_0x591e91,JSON[_0x2132('0x16')](_0x3f42d3));_0x51ffb0(_0x3f42d3);})[_0x2132('0x1b')](function(_0x495480){logger[_0x2132('0x17')]('UpdateWhatsappInteraction',_0x495480[_0x2132('0x19')],_0x591e91);_0x28ff2f(_0x5876d3[_0x2132('0x17')](0x1f4,_0x495480[_0x2132('0x19')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x43106a){return new Promise(function(_0x256270,_0x304a99){return db['WhatsappInteraction']['find']({'where':_0x43106a['options']?_0x43106a[_0x2132('0x1f')][_0x2132('0x21')]||null:null})[_0x2132('0x10')](function(_0x2da2cb){if(_0x2da2cb){return _0x2da2cb[_0x2132('0x24')](_0x43106a[_0x2132('0x1e')][_0x2132('0x25')],_['omit'](_0x43106a[_0x2132('0x1e')],[_0x2132('0x25'),'id'])||{});}})[_0x2132('0x26')](function(_0x3d24c4){logger[_0x2132('0x11')]('AddTags',_0x43106a);logger[_0x2132('0x14')](_0x2132('0x27'),_0x43106a,JSON[_0x2132('0x16')](_0x3d24c4));_0x256270(_0x3d24c4);})[_0x2132('0x1b')](function(_0x1771ae){logger['error']('AddTags',_0x1771ae['message'],_0x43106a);_0x304a99(_this['error'](0x1f4,_0x1771ae[_0x2132('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index bf0ca73..a41b16d 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 _0x7ad7=['register','length','whatsappInteraction:','remove','update','emit','removeListener'];(function(_0x552804,_0x3c3d1e){var _0x32be66=function(_0x14c213){while(--_0x14c213){_0x552804['push'](_0x552804['shift']());}};_0x32be66(++_0x3c3d1e);}(_0x7ad7,0x184));var _0x77ad=function(_0x2cdd25,_0x25b185){_0x2cdd25=_0x2cdd25-0x0;var _0x1f38c3=_0x7ad7[_0x2cdd25];return _0x1f38c3;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save',_0x77ad('0x0'),_0x77ad('0x1')];function createListener(_0x4a255c,_0x4babc9){return function(_0x503899){_0x4babc9[_0x77ad('0x2')](_0x4a255c,_0x503899);};}function removeListener(_0x56f034,_0x5d1362){return function(){WhatsappInteractionEvents[_0x77ad('0x3')](_0x56f034,_0x5d1362);};}exports[_0x77ad('0x4')]=function(_0x2ad013){for(var _0x15f539=0x0,_0x231c83=events[_0x77ad('0x5')];_0x15f539<_0x231c83;_0x15f539++){var _0x1c0ce7=events[_0x15f539];var _0x31fbc5=createListener(_0x77ad('0x6')+_0x1c0ce7,_0x2ad013);WhatsappInteractionEvents['on'](_0x1c0ce7,_0x31fbc5);}}; \ No newline at end of file +var _0x087f=['./whatsappInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x29f09d,_0x5684b4){var _0x34a6d9=function(_0x323a5f){while(--_0x323a5f){_0x29f09d['push'](_0x29f09d['shift']());}};_0x34a6d9(++_0x5684b4);}(_0x087f,0x1c0));var _0xf087=function(_0x3c1717,_0x44e0bb){_0x3c1717=_0x3c1717-0x0;var _0xf509bb=_0x087f[_0x3c1717];return _0xf509bb;};'use strict';var WhatsappInteractionEvents=require(_0xf087('0x0'));var events=[_0xf087('0x1'),_0xf087('0x2'),_0xf087('0x3')];function createListener(_0x46fca2,_0x48f804){return function(_0x5deadf){_0x48f804[_0xf087('0x4')](_0x46fca2,_0x5deadf);};}function removeListener(_0x50e4b0,_0x197822){return function(){WhatsappInteractionEvents[_0xf087('0x5')](_0x50e4b0,_0x197822);};}exports[_0xf087('0x6')]=function(_0xc45ea0){for(var _0x41f8c4=0x0,_0x154299=events[_0xf087('0x7')];_0x41f8c4<_0x154299;_0x41f8c4++){var _0x24b68c=events[_0x41f8c4];var _0x5ba4f9=createListener('whatsappInteraction:'+_0x24b68c,_0xc45ea0);WhatsappInteractionEvents['on'](_0x24b68c,_0x5ba4f9);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index acd4f61..86d671b 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 _0x45f6=['/:id/accept','accept','/:id/reject','reject','multer','util','path','connect-timeout','express','Router','fs-extra','get','index','/describe','isAuthenticated','describe','/:id','show','whatsapp','whatsappmessage:create','create','/:id/status','update','put'];(function(_0x4fc797,_0x30d6c6){var _0x24f9df=function(_0x40a9e1){while(--_0x40a9e1){_0x4fc797['push'](_0x4fc797['shift']());}};_0x24f9df(++_0x30d6c6);}(_0x45f6,0x10c));var _0x645f=function(_0x152999,_0x1dd83b){_0x152999=_0x152999-0x0;var _0x32ef67=_0x45f6[_0x152999];return _0x32ef67;};'use strict';var multer=require(_0x645f('0x0'));var util=require(_0x645f('0x1'));var path=require(_0x645f('0x2'));var timeout=require(_0x645f('0x3'));var express=require(_0x645f('0x4'));var router=express[_0x645f('0x5')]();var fs_extra=require(_0x645f('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0x645f('0x7')]('/',auth['isAuthenticated'](),controller[_0x645f('0x8')]);router[_0x645f('0x7')](_0x645f('0x9'),auth[_0x645f('0xa')](),controller[_0x645f('0xb')]);router['get'](_0x645f('0xc'),auth[_0x645f('0xa')](),controller[_0x645f('0xd')]);router['post']('/',auth[_0x645f('0xa')](),interaction['tracked'](_0x645f('0xe'),_0x645f('0xf')),controller[_0x645f('0x10')]);router['post'](_0x645f('0x11'),controller['status']);router['put'](_0x645f('0xc'),auth['isAuthenticated'](),controller[_0x645f('0x12')]);router[_0x645f('0x13')](_0x645f('0x14'),auth[_0x645f('0xa')](),controller[_0x645f('0x15')]);router['put'](_0x645f('0x16'),auth['isAuthenticated'](),controller[_0x645f('0x17')]);router['delete'](_0x645f('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xecc3=['/:id/reject','reject','delete','destroy','multer','path','express','Router','../../components/auth/service','./whatsappMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','whatsapp','whatsappmessage:create','create','status','update','put','accept'];(function(_0x5494b4,_0x5c3528){var _0x1fb474=function(_0x29a92e){while(--_0x29a92e){_0x5494b4['push'](_0x5494b4['shift']());}};_0x1fb474(++_0x5c3528);}(_0xecc3,0x124));var _0x3ecc=function(_0x4c9a5c,_0x5cd000){_0x4c9a5c=_0x4c9a5c-0x0;var _0x57eab0=_0xecc3[_0x4c9a5c];return _0x57eab0;};'use strict';var multer=require(_0x3ecc('0x0'));var util=require('util');var path=require(_0x3ecc('0x1'));var timeout=require('connect-timeout');var express=require(_0x3ecc('0x2'));var router=express[_0x3ecc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3ecc('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3ecc('0x5'));router[_0x3ecc('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3ecc('0x6')](_0x3ecc('0x7'),auth[_0x3ecc('0x8')](),controller[_0x3ecc('0x9')]);router[_0x3ecc('0x6')](_0x3ecc('0xa'),auth[_0x3ecc('0x8')](),controller[_0x3ecc('0xb')]);router[_0x3ecc('0xc')]('/',auth[_0x3ecc('0x8')](),interaction['tracked'](_0x3ecc('0xd'),_0x3ecc('0xe')),controller[_0x3ecc('0xf')]);router[_0x3ecc('0xc')]('/:id/status',controller[_0x3ecc('0x10')]);router['put'](_0x3ecc('0xa'),auth[_0x3ecc('0x8')](),controller[_0x3ecc('0x11')]);router[_0x3ecc('0x12')]('/:id/accept',auth[_0x3ecc('0x8')](),controller[_0x3ecc('0x13')]);router[_0x3ecc('0x12')](_0x3ecc('0x14'),auth['isAuthenticated'](),controller[_0x3ecc('0x15')]);router[_0x3ecc('0x16')]('/:id',auth[_0x3ecc('0x8')](),controller[_0x3ecc('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index cc72d83..ecce451 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 _0x81bb=['BOOLEAN','sequelize','TEXT','ENUM','STRING'];(function(_0x2236dc,_0x43c7f9){var _0x20583f=function(_0x293e36){while(--_0x293e36){_0x2236dc['push'](_0x2236dc['shift']());}};_0x20583f(++_0x43c7f9);}(_0x81bb,0x74));var _0xb81b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81bb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb81b('0x0'));module['exports']={'body':{'type':Sequelize[_0xb81b('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb81b('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xb81b('0x3')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xb81b('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb81b('0x3')]},'providerResponse':{'type':Sequelize[_0xb81b('0x1')]}}; \ No newline at end of file +var _0x12be=['TEXT','sequelize','exports','medium','ENUM','out','STRING','DATE'];(function(_0x35b14c,_0x224701){var _0x202017=function(_0x1a0dbe){while(--_0x1a0dbe){_0x35b14c['push'](_0x35b14c['shift']());}};_0x202017(++_0x224701);}(_0x12be,0x169));var _0xe12b=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0x12be[_0x5de532];return _0x4e9192;};'use strict';var Sequelize=require(_0xe12b('0x0'));module[_0xe12b('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe12b('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xe12b('0x3')]('in','out'),'defaultValue':_0xe12b('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe12b('0x5')](0xbe)},'phone':{'type':Sequelize[_0xe12b('0x5')]},'readAt':{'type':Sequelize[_0xe12b('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xe12b('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 89233bd..d5e7f71 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 _0x51fe=['twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','update','stack','send','index','map','WhatsappMessage','fieldName','type','key','model','filters','intersection','attributes','fields','length','hasOwnProperty','query','order','sort','where','filter','name','merge','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','include','find','create','body','destroy','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','fullname','email','internal','SIP/%s','channel','motionChannel','EventManager','acceptmessage','interface','event','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect'];(function(_0x1f88c5,_0x446d22){var _0x4552e8=function(_0xa09d8b){while(--_0xa09d8b){_0x1f88c5['push'](_0x1f88c5['shift']());}};_0x4552e8(++_0x446d22);}(_0x51fe,0x19a));var _0xe51f=function(_0x356660,_0x4c85a4){_0x356660=_0x356660-0x0;var _0x5d9860=_0x51fe[_0x356660];return _0x5d9860;};'use strict';var emlformat=require(_0xe51f('0x0'));var rimraf=require(_0xe51f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe51f('0x2'));var moment=require('moment');var BPromise=require(_0xe51f('0x3'));var Mustache=require(_0xe51f('0x4'));var util=require(_0xe51f('0x5'));var path=require(_0xe51f('0x6'));var sox=require(_0xe51f('0x7'));var csv=require('to-csv');var ejs=require(_0xe51f('0x8'));var fs=require('fs');var fs_extra=require(_0xe51f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe51f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe51f('0xb'));var querystring=require(_0xe51f('0xc'));var Papa=require(_0xe51f('0xd'));var Redis=require(_0xe51f('0xe'));var authService=require(_0xe51f('0xf'));var qs=require(_0xe51f('0x10'));var as=require(_0xe51f('0x11'));var hardwareService=require(_0xe51f('0x12'));var logger=require('../../config/logger')(_0xe51f('0x13'));var utils=require(_0xe51f('0x14'));var config=require(_0xe51f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe51f('0x16'))['db'];config[_0xe51f('0x17')]=_['defaults'](config['redis'],{'host':_0xe51f('0x18'),'port':0x18eb});var socket=require(_0xe51f('0x19'))(new Redis(config[_0xe51f('0x17')]));require(_0xe51f('0x1a'))[_0xe51f('0x1b')](socket);var jayson=require(_0xe51f('0x1c'));var client=jayson[_0xe51f('0x1d')][_0xe51f('0x1e')]({'port':0x232c});var client9002=jayson[_0xe51f('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x236ffe,_0x5d877f,_0x33e1fe,_0x576e30){return new BPromise(function(_0x42653c,_0x4766c2){var _0x25dd3b=_0x576e30||client;return _0x25dd3b['request'](_0x236ffe,_0x33e1fe)[_0xe51f('0x1f')](function(_0x51028e){logger[_0xe51f('0x20')](_0xe51f('0x21'),_0x5d877f,_0xe51f('0x22'));logger[_0xe51f('0x23')](_0xe51f('0x24'),_0x5d877f,'request\x20sent',JSON[_0xe51f('0x25')](_0x51028e));if(_0x51028e[_0xe51f('0x26')]){if(_0x51028e['error'][_0xe51f('0x27')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x5d877f,_0x51028e[_0xe51f('0x26')][_0xe51f('0x28')]);return _0x4766c2(_0x51028e[_0xe51f('0x26')]['message']);}logger[_0xe51f('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x5d877f,_0x51028e['error'][_0xe51f('0x28')]);return _0x42653c(_0x51028e[_0xe51f('0x26')][_0xe51f('0x28')]);}else{logger[_0xe51f('0x20')](_0xe51f('0x21'),_0x5d877f,_0xe51f('0x22'));_0x42653c(_0x51028e[_0xe51f('0x29')][_0xe51f('0x28')]);}})['catch'](function(_0xce9e9f){logger['error'](_0xe51f('0x21'),_0x5d877f,_0xce9e9f);_0x4766c2(_0xce9e9f);});});}function respondWithStatusCode(_0x57f2ab,_0x2a1e77){_0x2a1e77=_0x2a1e77||0xcc;return function(_0x2e08f3){if(_0x2e08f3){return _0x57f2ab[_0xe51f('0x2a')](_0x2a1e77);}return _0x57f2ab[_0xe51f('0x2b')](_0x2a1e77)[_0xe51f('0x2c')]();};}function respondWithResult(_0x44d716,_0x36ed16){_0x36ed16=_0x36ed16||0xc8;return function(_0x446366){if(_0x446366){return _0x44d716[_0xe51f('0x2b')](_0x36ed16)['json'](_0x446366);}};}function respondWithFilteredResult(_0x568051,_0x1838fd){return function(_0x1b2764){if(_0x1b2764){var _0x1ac05c=typeof _0x1838fd[_0xe51f('0x2d')]===_0xe51f('0x2e')&&typeof _0x1838fd[_0xe51f('0x2f')]==='undefined';var _0x3928f7=_0x1b2764[_0xe51f('0x30')];var _0x5468b2=_0x1ac05c?0x0:_0x1838fd['offset'];var _0x8a241=_0x1ac05c?_0x1b2764['count']:_0x1838fd['offset']+_0x1838fd[_0xe51f('0x2f')];var _0x4d83e4;if(_0x8a241>=_0x3928f7){_0x8a241=_0x3928f7;_0x4d83e4=0xc8;}else{_0x4d83e4=0xce;}_0x568051[_0xe51f('0x2b')](_0x4d83e4);return _0x568051['set'](_0xe51f('0x31'),_0x5468b2+'-'+_0x8a241+'/'+_0x3928f7)['json'](_0x1b2764);}return null;};}function patchUpdates(_0x35d502){return function(_0x3ba0da){try{jsonpatch['apply'](_0x3ba0da,_0x35d502,!![]);}catch(_0x217676){return BPromise[_0xe51f('0x32')](_0x217676);}return _0x3ba0da['save']();};}function saveUpdates(_0x4fe44c,_0x38758c){return function(_0x54f3ad){if(_0x54f3ad){return _0x54f3ad[_0xe51f('0x33')](_0x4fe44c)[_0xe51f('0x1f')](function(_0x5cfea6){return _0x5cfea6;});}return null;};}function removeEntity(_0x4f48e9,_0x156abf){return function(_0x469fc0){if(_0x469fc0){return _0x469fc0['destroy']()[_0xe51f('0x1f')](function(){_0x4f48e9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2140e0,_0x5dce9f){return function(_0x177b05){if(!_0x177b05){_0x2140e0[_0xe51f('0x2a')](0x194);}return _0x177b05;};}function handleError(_0xba77ea,_0x1e6282){_0x1e6282=_0x1e6282||0x1f4;return function(_0x28654d){logger[_0xe51f('0x26')](_0x28654d[_0xe51f('0x34')]);if(_0x28654d['name']){delete _0x28654d['name'];}_0xba77ea[_0xe51f('0x2b')](_0x1e6282)[_0xe51f('0x35')](_0x28654d);};}exports[_0xe51f('0x36')]=function(_0x4a7525,_0x5dfde0){var _0x361e9e={},_0x501690={},_0x406d4d={'count':0x0,'rows':[]};var _0x130eda=_[_0xe51f('0x37')](db[_0xe51f('0x38')]['rawAttributes'],function(_0xd767f3){return{'name':_0xd767f3[_0xe51f('0x39')],'type':_0xd767f3[_0xe51f('0x3a')][_0xe51f('0x3b')]};});_0x501690[_0xe51f('0x3c')]=_['map'](_0x130eda,'name');_0x501690['query']=_['keys'](_0x4a7525['query']);_0x501690[_0xe51f('0x3d')]=_[_0xe51f('0x3e')](_0x501690[_0xe51f('0x3c')],_0x501690['query']);_0x361e9e[_0xe51f('0x3f')]=_[_0xe51f('0x3e')](_0x501690[_0xe51f('0x3c')],qs[_0xe51f('0x40')](_0x4a7525['query'][_0xe51f('0x40')]));_0x361e9e[_0xe51f('0x3f')]=_0x361e9e[_0xe51f('0x3f')][_0xe51f('0x41')]?_0x361e9e[_0xe51f('0x3f')]:_0x501690[_0xe51f('0x3c')];if(!_0x4a7525['query'][_0xe51f('0x42')]('nolimit')){_0x361e9e[_0xe51f('0x2f')]=qs[_0xe51f('0x2f')](_0x4a7525[_0xe51f('0x43')]['limit']);_0x361e9e['offset']=qs[_0xe51f('0x2d')](_0x4a7525[_0xe51f('0x43')]['offset']);}_0x361e9e[_0xe51f('0x44')]=qs[_0xe51f('0x45')](_0x4a7525[_0xe51f('0x43')][_0xe51f('0x45')]);_0x361e9e[_0xe51f('0x46')]=qs[_0xe51f('0x3d')](_['pick'](_0x4a7525[_0xe51f('0x43')],_0x501690[_0xe51f('0x3d')]),_0x130eda);if(_0x4a7525['query'][_0xe51f('0x47')]){_0x361e9e[_0xe51f('0x46')]=_['merge'](_0x361e9e[_0xe51f('0x46')],{'$or':_[_0xe51f('0x37')](_0x130eda,function(_0x1efbe0){if(_0x1efbe0['type']!=='VIRTUAL'){var _0x355f19={};_0x355f19[_0x1efbe0[_0xe51f('0x48')]]={'$like':'%'+_0x4a7525[_0xe51f('0x43')][_0xe51f('0x47')]+'%'};return _0x355f19;}})});}_0x361e9e=_[_0xe51f('0x49')]({},_0x361e9e,_0x4a7525[_0xe51f('0x4a')]);var _0x14bff2={'where':_0x361e9e[_0xe51f('0x46')]};return db[_0xe51f('0x38')][_0xe51f('0x30')](_0x14bff2)[_0xe51f('0x1f')](function(_0x1ff148){_0x406d4d[_0xe51f('0x30')]=_0x1ff148;if(_0x4a7525[_0xe51f('0x43')][_0xe51f('0x4b')]){_0x361e9e['include']=[{'all':!![]}];}return db[_0xe51f('0x38')][_0xe51f('0x4c')](_0x361e9e);})[_0xe51f('0x1f')](function(_0x5dc836){_0x406d4d[_0xe51f('0x4d')]=_0x5dc836;return _0x406d4d;})[_0xe51f('0x1f')](respondWithFilteredResult(_0x5dfde0,_0x361e9e))[_0xe51f('0x4e')](handleError(_0x5dfde0,null));};exports['show']=function(_0x502a77,_0x3e696b){var _0x4f4944={'raw':!![],'where':{'id':_0x502a77[_0xe51f('0x4f')]['id']}},_0x1a7253={};_0x1a7253[_0xe51f('0x3c')]=_[_0xe51f('0x50')](db[_0xe51f('0x38')][_0xe51f('0x51')]);_0x1a7253[_0xe51f('0x43')]=_[_0xe51f('0x50')](_0x502a77['query']);_0x1a7253[_0xe51f('0x3d')]=_['intersection'](_0x1a7253[_0xe51f('0x3c')],_0x1a7253[_0xe51f('0x43')]);_0x4f4944[_0xe51f('0x3f')]=_[_0xe51f('0x3e')](_0x1a7253[_0xe51f('0x3c')],qs['fields'](_0x502a77[_0xe51f('0x43')][_0xe51f('0x40')]));_0x4f4944[_0xe51f('0x3f')]=_0x4f4944[_0xe51f('0x3f')][_0xe51f('0x41')]?_0x4f4944[_0xe51f('0x3f')]:_0x1a7253['model'];if(_0x502a77[_0xe51f('0x43')][_0xe51f('0x4b')]){_0x4f4944[_0xe51f('0x52')]=[{'all':!![]}];}_0x4f4944=_[_0xe51f('0x49')]({},_0x4f4944,_0x502a77[_0xe51f('0x4a')]);return db[_0xe51f('0x38')][_0xe51f('0x53')](_0x4f4944)['then'](handleEntityNotFound(_0x3e696b,null))[_0xe51f('0x1f')](respondWithResult(_0x3e696b,null))[_0xe51f('0x4e')](handleError(_0x3e696b,null));};exports['create']=function(_0x2d33f0,_0x58c580){return db['WhatsappMessage'][_0xe51f('0x54')](_0x2d33f0[_0xe51f('0x55')],{})['then'](respondWithResult(_0x58c580,0xc9))[_0xe51f('0x4e')](handleError(_0x58c580,null));};exports['update']=function(_0x479d5a,_0x326210){if(_0x479d5a[_0xe51f('0x55')]['id']){delete _0x479d5a[_0xe51f('0x55')]['id'];}return db[_0xe51f('0x38')][_0xe51f('0x53')]({'where':{'id':_0x479d5a[_0xe51f('0x4f')]['id']}})[_0xe51f('0x1f')](handleEntityNotFound(_0x326210,null))['then'](saveUpdates(_0x479d5a[_0xe51f('0x55')],null))[_0xe51f('0x1f')](respondWithResult(_0x326210,null))[_0xe51f('0x4e')](handleError(_0x326210,null));};exports[_0xe51f('0x56')]=function(_0x163d26,_0x5f0ab0){return db[_0xe51f('0x38')][_0xe51f('0x53')]({'where':{'id':_0x163d26[_0xe51f('0x4f')]['id']}})[_0xe51f('0x1f')](handleEntityNotFound(_0x5f0ab0,null))[_0xe51f('0x1f')](removeEntity(_0x5f0ab0,null))[_0xe51f('0x4e')](handleError(_0x5f0ab0,null));};exports[_0xe51f('0x57')]=function(_0x44c0df,_0x51149b){return db[_0xe51f('0x38')][_0xe51f('0x57')]()[_0xe51f('0x1f')](respondWithResult(_0x51149b,null))[_0xe51f('0x4e')](handleError(_0x51149b,null));};var interaction_log=require(_0xe51f('0x58'))(_0xe51f('0x59'));exports[_0xe51f('0x5a')]=function(_0x454ef4,_0x2ce835,_0x415f89){var _0x46d7e2={'agent':{},'channel':_0xe51f('0x5b')};if(_0x454ef4[_0xe51f('0x55')]['id']){delete _0x454ef4[_0xe51f('0x55')]['id'];}_0x454ef4[_0xe51f('0x55')][_0xe51f('0x5c')]=!![];_0x454ef4[_0xe51f('0x55')][_0xe51f('0x5d')]=moment()[_0xe51f('0x5e')](_0xe51f('0x5f'));_0x454ef4[_0xe51f('0x55')][_0xe51f('0x60')]=_0x454ef4[_0xe51f('0x55')][_0xe51f('0x60')]||_0x454ef4[_0xe51f('0x61')]['id'];_0x46d7e2[_0xe51f('0x62')]['id']=_0x454ef4['body'][_0xe51f('0x60')];return db[_0xe51f('0x38')][_0xe51f('0x53')]({'where':{'id':_0x454ef4[_0xe51f('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2ce835,null))[_0xe51f('0x1f')](saveUpdates(_0x454ef4['body'],null))[_0xe51f('0x1f')](function(_0x479f75){if(_0x479f75){_0x46d7e2[_0xe51f('0x28')]=_0x479f75[_0xe51f('0x63')]({'plain':!![]});return db[_0xe51f('0x64')][_0xe51f('0x53')]({'where':{'id':_0x479f75[_0xe51f('0x65')]}});}return null;})[_0xe51f('0x1f')](handleEntityNotFound(_0x2ce835,null))[_0xe51f('0x1f')](function(_0x4cadc0){if(_0x4cadc0){return _0x4cadc0[_0xe51f('0x33')]({'UserId':_0x454ef4['body']['UserId'],'read1stAt':_['isNil'](_0x4cadc0['read1stAt'])?moment()[_0xe51f('0x5e')](_0xe51f('0x5f')):undefined});}return null;})['then'](function(_0xfcde5f){if(_0xfcde5f){_0x46d7e2[_0xe51f('0x66')]=_0xfcde5f['get']({'plain':!![]});interaction_log[_0xe51f('0x20')](_0xe51f('0x67'),_0x454ef4[_0xe51f('0x61')]['id'],_0x454ef4['user'][_0xe51f('0x48')],_0x454ef4[_0xe51f('0x61')][_0xe51f('0x68')],_0x46d7e2[_0xe51f('0x66')]['id'],_0x454ef4[_0xe51f('0x55')]?JSON['stringify'](_0x454ef4[_0xe51f('0x55')]):_0xe51f('0x69'));return respondWithRpcPromise(_0xe51f('0x6a'),_0xe51f('0x6b'),_0x46d7e2);}return null;})[_0xe51f('0x1f')](function(_0x47e130){var _0x46a104=_0xe51f('0x6c')+_0x47e130['message'][_0xe51f('0x6d')];return db[_0xe51f('0x6e')]['query'](_0x46a104,{'type':db['Sequelize']['QueryTypes'][_0xe51f('0x6f')],'raw':!![]})[_0xe51f('0x1f')](function(_0x72c0ea){return _0x72c0ea;});})['then'](function(_0xdd6118){if(_0xdd6118){_0x46d7e2[_0xe51f('0x28')][_0xe51f('0x70')]=_0xdd6118[0x0];if(!_0x454ef4[_0xe51f('0x55')][_0xe51f('0x60')])return;return db[_0xe51f('0x71')][_0xe51f('0x53')]({'where':{'id':_0x454ef4[_0xe51f('0x55')][_0xe51f('0x60')],'role':_0xe51f('0x62')},'attributes':['id',_0xe51f('0x48'),_0xe51f('0x72'),_0xe51f('0x73'),_0xe51f('0x74')],'raw':!![]});}return null;})[_0xe51f('0x1f')](function(_0x7ed59e){if(!_0x7ed59e)return null;_0x46d7e2[_0xe51f('0x28')]['agent']=_0x7ed59e;return _0x46d7e2;})['then'](function(_0x16d5c8){if(_0x16d5c8){if(_0x454ef4[_0xe51f('0x55')]['manual']){_0x46d7e2[_0xe51f('0x28')]['interface']=util[_0xe51f('0x5e')](_0xe51f('0x75'),_0x454ef4[_0xe51f('0x61')][_0xe51f('0x48')]);_0x46d7e2['message'][_0xe51f('0x76')]=_0x46d7e2[_0xe51f('0x76')];_0x46d7e2[_0xe51f('0x28')][_0xe51f('0x77')]=_0x46d7e2[_0xe51f('0x76')];_0x46d7e2[_0xe51f('0x28')]['event']=_0xe51f('0x5a');return respondWithRpcPromise('EventManager',_0xe51f('0x78'),{'event':_0xe51f('0x79'),'message':_0x46d7e2[_0xe51f('0x28')]},client9002)[_0xe51f('0x1f')](function(){return _0x46d7e2;});}return _0x46d7e2;}return null;})[_0xe51f('0x1f')](respondWithResult(_0x2ce835,null))[_0xe51f('0x4e')](handleError(_0x2ce835,null));};var interaction_log=require(_0xe51f('0x58'))(_0xe51f('0x59'));exports['reject']=function(_0xd0963c,_0x4193e6,_0x2f8966){var _0x1f73a2={'agent':{},'channel':_0xe51f('0x5b')};if(_0xd0963c['body']['id']){delete _0xd0963c[_0xe51f('0x55')]['id'];}_0xd0963c[_0xe51f('0x55')][_0xe51f('0x60')]=_0xd0963c['body'][_0xe51f('0x60')]||_0xd0963c[_0xe51f('0x61')]['id'];_0x1f73a2[_0xe51f('0x62')]['id']=_0xd0963c[_0xe51f('0x55')][_0xe51f('0x60')];return db[_0xe51f('0x38')][_0xe51f('0x53')]({'where':{'id':_0xd0963c[_0xe51f('0x4f')]['id'],'UserId':null}})[_0xe51f('0x1f')](handleEntityNotFound(_0x4193e6,null))[_0xe51f('0x1f')](function(_0xf03396){if(_0xf03396){_0x1f73a2[_0xe51f('0x28')]=_0xf03396[_0xe51f('0x63')]({'plain':!![]});return db[_0xe51f('0x64')]['find']({'where':{'id':_0xf03396[_0xe51f('0x65')]}});}return null;})[_0xe51f('0x1f')](handleEntityNotFound(_0x4193e6,null))[_0xe51f('0x1f')](function(_0x37b9a4){if(_0x37b9a4){_0x1f73a2[_0xe51f('0x66')]=_0x37b9a4[_0xe51f('0x63')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xd0963c[_0xe51f('0x61')]['id'],_0xd0963c['user'][_0xe51f('0x48')],_0xd0963c['user'][_0xe51f('0x68')],_0x1f73a2[_0xe51f('0x66')]['id'],_0xd0963c[_0xe51f('0x55')]?JSON['stringify'](_0xd0963c[_0xe51f('0x55')]):_0xe51f('0x69'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x1f73a2);}return null;})[_0xe51f('0x1f')](function(_0x5053d7){var _0x3dcfe2=_0xe51f('0x6c')+_0x5053d7[_0xe51f('0x28')][_0xe51f('0x6d')];return db[_0xe51f('0x6e')]['query'](_0x3dcfe2,{'type':db['Sequelize']['QueryTypes'][_0xe51f('0x6f')],'raw':!![]})[_0xe51f('0x1f')](function(_0x4d9f7){return _0x4d9f7;});})['then'](function(_0x1f22a4){if(_0x1f22a4){_0x1f73a2[_0xe51f('0x28')][_0xe51f('0x70')]=_0x1f22a4[0x0];if(!_0xd0963c[_0xe51f('0x55')][_0xe51f('0x60')])return;return db[_0xe51f('0x71')][_0xe51f('0x53')]({'where':{'id':_0xd0963c[_0xe51f('0x55')]['UserId'],'role':_0xe51f('0x62')},'attributes':['id','name',_0xe51f('0x72'),_0xe51f('0x73'),_0xe51f('0x74')],'raw':!![]});}return null;})[_0xe51f('0x1f')](function(_0x41772f){if(!_0x41772f)return null;_0x1f73a2[_0xe51f('0x28')][_0xe51f('0x62')]=_0x41772f;return _0x1f73a2;})[_0xe51f('0x1f')](function(_0x5b88f2){if(_0x5b88f2){_0x5b88f2[_0xe51f('0x28')][_0xe51f('0x7a')]=util[_0xe51f('0x5e')]('SIP/%s',_0xd0963c[_0xe51f('0x61')][_0xe51f('0x48')]);_0x5b88f2['message']['channel']=_0x1f73a2[_0xe51f('0x76')];_0x5b88f2['message']['motionChannel']=_0x1f73a2[_0xe51f('0x76')];_0x5b88f2[_0xe51f('0x28')][_0xe51f('0x7b')]='reject';respondWithRpcPromise(_0xe51f('0x78'),'EventManager',{'event':_0xe51f('0x7c'),'message':_0x5b88f2[_0xe51f('0x28')]},client9002);return _0x1f73a2;}return null;})['then'](respondWithResult(_0x4193e6,null))[_0xe51f('0x4e')](handleError(_0x4193e6,null));};exports[_0xe51f('0x2b')]=function(_0x110ae3,_0x1991dc,_0x491ee1){if(_0x110ae3[_0xe51f('0x55')]['id']){delete _0x110ae3[_0xe51f('0x55')]['id'];}var _0x332c6e;return db[_0xe51f('0x38')][_0xe51f('0x53')]({'where':{'id':_0x110ae3['params']['id']}})[_0xe51f('0x1f')](handleEntityNotFound(_0x1991dc,null))[_0xe51f('0x1f')](function(_0x215fcb){if(_0x215fcb){_0x332c6e=_0x215fcb;return db[_0xe51f('0x7d')]['find']({'where':{'id':_0x215fcb[_0xe51f('0x7e')]}});}})[_0xe51f('0x1f')](handleEntityNotFound(_0x1991dc,null))[_0xe51f('0x1f')](function(_0x1c9420){if(_0x1c9420){logger[_0xe51f('0x23')](_0xe51f('0x7f'),_0xe51f('0x2b'),_0xe51f('0x80'),_0x1c9420['type'],util[_0xe51f('0x81')](_0x110ae3['body'],{'showHidden':![],'depth':null}));switch(_0x1c9420[_0xe51f('0x3a')]){case _0xe51f('0x82'):if(_0x110ae3[_0xe51f('0x55')][_0xe51f('0x83')]&&_0x110ae3[_0xe51f('0x55')][_0xe51f('0x83')]===_0x332c6e[_0xe51f('0x84')]&&_0x110ae3[_0xe51f('0x55')][_0xe51f('0x85')]&&_0x110ae3[_0xe51f('0x55')]['MessageStatus']===_0xe51f('0x5c')){return _0x332c6e[_0xe51f('0x33')]({'read':!![]});}else{logger[_0xe51f('0x26')](_0xe51f('0x86'),_0xe51f('0x2b'),_0xe51f('0x82'),util[_0xe51f('0x81')](_0x110ae3['body'],{'showHidden':![],'depth':null}));}break;}return _0x332c6e;}})[_0xe51f('0x1f')](respondWithResult(_0x1991dc,null))['catch'](handleError(_0x1991dc,null));}; \ No newline at end of file +var _0xf564=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','http','then','info','WhatsappMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappMessage','includeAll','include','rows','show','params','create','body','find','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','User','agent','fullname','email','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','Sequelize','QueryTypes','contact','internal','interface','reject','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','inspect'];(function(_0x383643,_0x153dff){var _0x154080=function(_0x52a8ff){while(--_0x52a8ff){_0x383643['push'](_0x383643['shift']());}};_0x154080(++_0x153dff);}(_0xf564,0x87));var _0x4f56=function(_0x57b236,_0x30614e){_0x57b236=_0x57b236-0x0;var _0x4feb29=_0xf564[_0x57b236];return _0x4feb29;};'use strict';var emlformat=require(_0x4f56('0x0'));var rimraf=require(_0x4f56('0x1'));var zipdir=require(_0x4f56('0x2'));var jsonpatch=require(_0x4f56('0x3'));var rp=require('request-promise');var moment=require(_0x4f56('0x4'));var BPromise=require(_0x4f56('0x5'));var Mustache=require(_0x4f56('0x6'));var util=require('util');var path=require(_0x4f56('0x7'));var sox=require('sox');var csv=require(_0x4f56('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4f56('0x9'));var _=require(_0x4f56('0xa'));var squel=require(_0x4f56('0xb'));var crypto=require(_0x4f56('0xc'));var jsforce=require(_0x4f56('0xd'));var deskjs=require(_0x4f56('0xe'));var toCsv=require(_0x4f56('0x8'));var querystring=require(_0x4f56('0xf'));var Papa=require(_0x4f56('0x10'));var Redis=require(_0x4f56('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4f56('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f56('0x13'));var logger=require(_0x4f56('0x14'))(_0x4f56('0x15'));var utils=require(_0x4f56('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4f56('0x17'));var db=require('../../mysqldb')['db'];config[_0x4f56('0x18')]=_[_0x4f56('0x19')](config[_0x4f56('0x18')],{'host':_0x4f56('0x1a'),'port':0x18eb});var socket=require(_0x4f56('0x1b'))(new Redis(config[_0x4f56('0x18')]));require('./whatsappMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x4f56('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x504a86,_0xe85059,_0x199234,_0x408fd3){return new BPromise(function(_0x113506,_0x275fcb){var _0x3495fb=_0x408fd3||client;return _0x3495fb['request'](_0x504a86,_0x199234)[_0x4f56('0x1d')](function(_0x536b76){logger[_0x4f56('0x1e')](_0x4f56('0x1f'),_0xe85059,'request\x20sent');logger[_0x4f56('0x20')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xe85059,'request\x20sent',JSON[_0x4f56('0x21')](_0x536b76));if(_0x536b76[_0x4f56('0x22')]){if(_0x536b76[_0x4f56('0x22')][_0x4f56('0x23')]===0x1f4){logger['error'](_0x4f56('0x1f'),_0xe85059,_0x536b76[_0x4f56('0x22')]['message']);return _0x275fcb(_0x536b76[_0x4f56('0x22')][_0x4f56('0x24')]);}logger['error'](_0x4f56('0x1f'),_0xe85059,_0x536b76[_0x4f56('0x22')][_0x4f56('0x24')]);return _0x113506(_0x536b76[_0x4f56('0x22')][_0x4f56('0x24')]);}else{logger[_0x4f56('0x1e')](_0x4f56('0x1f'),_0xe85059,_0x4f56('0x25'));_0x113506(_0x536b76[_0x4f56('0x26')]['message']);}})[_0x4f56('0x27')](function(_0x3e5b8c){logger[_0x4f56('0x22')](_0x4f56('0x1f'),_0xe85059,_0x3e5b8c);_0x275fcb(_0x3e5b8c);});});}function respondWithStatusCode(_0x5ac799,_0x4d4b54){_0x4d4b54=_0x4d4b54||0xcc;return function(_0x36ea74){if(_0x36ea74){return _0x5ac799[_0x4f56('0x28')](_0x4d4b54);}return _0x5ac799[_0x4f56('0x29')](_0x4d4b54)[_0x4f56('0x2a')]();};}function respondWithResult(_0x3ed1fa,_0x4c5418){_0x4c5418=_0x4c5418||0xc8;return function(_0x5b8115){if(_0x5b8115){return _0x3ed1fa[_0x4f56('0x29')](_0x4c5418)[_0x4f56('0x2b')](_0x5b8115);}};}function respondWithFilteredResult(_0x32b850,_0x11896f){return function(_0x12d0ca){if(_0x12d0ca){var _0x4ee4eb=typeof _0x11896f[_0x4f56('0x2c')]===_0x4f56('0x2d')&&typeof _0x11896f['limit']==='undefined';var _0x342de3=_0x12d0ca['count'];var _0x2bc0ab=_0x4ee4eb?0x0:_0x11896f[_0x4f56('0x2c')];var _0x8d64b5=_0x4ee4eb?_0x12d0ca[_0x4f56('0x2e')]:_0x11896f[_0x4f56('0x2c')]+_0x11896f[_0x4f56('0x2f')];var _0x358826;if(_0x8d64b5>=_0x342de3){_0x8d64b5=_0x342de3;_0x358826=0xc8;}else{_0x358826=0xce;}_0x32b850[_0x4f56('0x29')](_0x358826);return _0x32b850[_0x4f56('0x30')](_0x4f56('0x31'),_0x2bc0ab+'-'+_0x8d64b5+'/'+_0x342de3)[_0x4f56('0x2b')](_0x12d0ca);}return null;};}function patchUpdates(_0x5d3bcd){return function(_0x3fbca5){try{jsonpatch['apply'](_0x3fbca5,_0x5d3bcd,!![]);}catch(_0x268097){return BPromise['reject'](_0x268097);}return _0x3fbca5['save']();};}function saveUpdates(_0x7e0282,_0xa052aa){return function(_0x4e9594){if(_0x4e9594){return _0x4e9594[_0x4f56('0x32')](_0x7e0282)[_0x4f56('0x1d')](function(_0x1d1aef){return _0x1d1aef;});}return null;};}function removeEntity(_0x59bff8,_0x2e4b57){return function(_0x3045ae){if(_0x3045ae){return _0x3045ae[_0x4f56('0x33')]()['then'](function(){_0x59bff8[_0x4f56('0x29')](0xcc)[_0x4f56('0x2a')]();});}};}function handleEntityNotFound(_0x4951df,_0x553b6f){return function(_0x534b3e){if(!_0x534b3e){_0x4951df['sendStatus'](0x194);}return _0x534b3e;};}function handleError(_0x4aceba,_0x5dc2b){_0x5dc2b=_0x5dc2b||0x1f4;return function(_0x117c18){logger[_0x4f56('0x22')](_0x117c18[_0x4f56('0x34')]);if(_0x117c18[_0x4f56('0x35')]){delete _0x117c18[_0x4f56('0x35')];}_0x4aceba[_0x4f56('0x29')](_0x5dc2b)[_0x4f56('0x36')](_0x117c18);};}exports[_0x4f56('0x37')]=function(_0x5ad9ae,_0x47c07d){var _0x817230={},_0x3c8034={},_0x44f696={'count':0x0,'rows':[]};var _0x54e196=_[_0x4f56('0x38')](db['WhatsappMessage'][_0x4f56('0x39')],function(_0x417adb){return{'name':_0x417adb[_0x4f56('0x3a')],'type':_0x417adb[_0x4f56('0x3b')]['key']};});_0x3c8034[_0x4f56('0x3c')]=_['map'](_0x54e196,_0x4f56('0x35'));_0x3c8034[_0x4f56('0x3d')]=_[_0x4f56('0x3e')](_0x5ad9ae[_0x4f56('0x3d')]);_0x3c8034[_0x4f56('0x3f')]=_[_0x4f56('0x40')](_0x3c8034[_0x4f56('0x3c')],_0x3c8034[_0x4f56('0x3d')]);_0x817230[_0x4f56('0x41')]=_[_0x4f56('0x40')](_0x3c8034[_0x4f56('0x3c')],qs[_0x4f56('0x42')](_0x5ad9ae[_0x4f56('0x3d')][_0x4f56('0x42')]));_0x817230['attributes']=_0x817230[_0x4f56('0x41')][_0x4f56('0x43')]?_0x817230[_0x4f56('0x41')]:_0x3c8034[_0x4f56('0x3c')];if(!_0x5ad9ae[_0x4f56('0x3d')][_0x4f56('0x44')](_0x4f56('0x45'))){_0x817230['limit']=qs[_0x4f56('0x2f')](_0x5ad9ae['query'][_0x4f56('0x2f')]);_0x817230['offset']=qs[_0x4f56('0x2c')](_0x5ad9ae[_0x4f56('0x3d')]['offset']);}_0x817230['order']=qs[_0x4f56('0x46')](_0x5ad9ae[_0x4f56('0x3d')][_0x4f56('0x46')]);_0x817230[_0x4f56('0x47')]=qs[_0x4f56('0x3f')](_[_0x4f56('0x48')](_0x5ad9ae[_0x4f56('0x3d')],_0x3c8034[_0x4f56('0x3f')]),_0x54e196);if(_0x5ad9ae['query'][_0x4f56('0x49')]){_0x817230[_0x4f56('0x47')]=_[_0x4f56('0x4a')](_0x817230[_0x4f56('0x47')],{'$or':_[_0x4f56('0x38')](_0x54e196,function(_0x417de7){if(_0x417de7[_0x4f56('0x3b')]!==_0x4f56('0x4b')){var _0x530dca={};_0x530dca[_0x417de7[_0x4f56('0x35')]]={'$like':'%'+_0x5ad9ae[_0x4f56('0x3d')][_0x4f56('0x49')]+'%'};return _0x530dca;}})});}_0x817230=_[_0x4f56('0x4a')]({},_0x817230,_0x5ad9ae[_0x4f56('0x4c')]);var _0x1ff519={'where':_0x817230[_0x4f56('0x47')]};return db[_0x4f56('0x4d')][_0x4f56('0x2e')](_0x1ff519)[_0x4f56('0x1d')](function(_0x3b0571){_0x44f696[_0x4f56('0x2e')]=_0x3b0571;if(_0x5ad9ae['query'][_0x4f56('0x4e')]){_0x817230[_0x4f56('0x4f')]=[{'all':!![]}];}return db[_0x4f56('0x4d')]['findAll'](_0x817230);})[_0x4f56('0x1d')](function(_0x49255f){_0x44f696[_0x4f56('0x50')]=_0x49255f;return _0x44f696;})['then'](respondWithFilteredResult(_0x47c07d,_0x817230))[_0x4f56('0x27')](handleError(_0x47c07d,null));};exports[_0x4f56('0x51')]=function(_0x5c4f63,_0x56ce75){var _0x1f6b8c={'raw':!![],'where':{'id':_0x5c4f63[_0x4f56('0x52')]['id']}},_0x45dd5d={};_0x45dd5d[_0x4f56('0x3c')]=_[_0x4f56('0x3e')](db[_0x4f56('0x4d')][_0x4f56('0x39')]);_0x45dd5d[_0x4f56('0x3d')]=_['keys'](_0x5c4f63[_0x4f56('0x3d')]);_0x45dd5d[_0x4f56('0x3f')]=_[_0x4f56('0x40')](_0x45dd5d[_0x4f56('0x3c')],_0x45dd5d['query']);_0x1f6b8c[_0x4f56('0x41')]=_[_0x4f56('0x40')](_0x45dd5d[_0x4f56('0x3c')],qs[_0x4f56('0x42')](_0x5c4f63[_0x4f56('0x3d')]['fields']));_0x1f6b8c['attributes']=_0x1f6b8c['attributes'][_0x4f56('0x43')]?_0x1f6b8c[_0x4f56('0x41')]:_0x45dd5d[_0x4f56('0x3c')];if(_0x5c4f63[_0x4f56('0x3d')]['includeAll']){_0x1f6b8c[_0x4f56('0x4f')]=[{'all':!![]}];}_0x1f6b8c=_[_0x4f56('0x4a')]({},_0x1f6b8c,_0x5c4f63[_0x4f56('0x4c')]);return db[_0x4f56('0x4d')]['find'](_0x1f6b8c)['then'](handleEntityNotFound(_0x56ce75,null))[_0x4f56('0x1d')](respondWithResult(_0x56ce75,null))['catch'](handleError(_0x56ce75,null));};exports[_0x4f56('0x53')]=function(_0xe44617,_0x1568ba){return db['WhatsappMessage'][_0x4f56('0x53')](_0xe44617[_0x4f56('0x54')],{})[_0x4f56('0x1d')](respondWithResult(_0x1568ba,0xc9))[_0x4f56('0x27')](handleError(_0x1568ba,null));};exports[_0x4f56('0x32')]=function(_0x2f31e4,_0x5a8f3d){if(_0x2f31e4[_0x4f56('0x54')]['id']){delete _0x2f31e4[_0x4f56('0x54')]['id'];}return db[_0x4f56('0x4d')][_0x4f56('0x55')]({'where':{'id':_0x2f31e4['params']['id']}})[_0x4f56('0x1d')](handleEntityNotFound(_0x5a8f3d,null))['then'](saveUpdates(_0x2f31e4[_0x4f56('0x54')],null))[_0x4f56('0x1d')](respondWithResult(_0x5a8f3d,null))['catch'](handleError(_0x5a8f3d,null));};exports[_0x4f56('0x33')]=function(_0x552829,_0x4bc146){return db['WhatsappMessage'][_0x4f56('0x55')]({'where':{'id':_0x552829[_0x4f56('0x52')]['id']}})[_0x4f56('0x1d')](handleEntityNotFound(_0x4bc146,null))[_0x4f56('0x1d')](removeEntity(_0x4bc146,null))[_0x4f56('0x27')](handleError(_0x4bc146,null));};exports['describe']=function(_0x1b0f7f,_0x1e06a1){return db['WhatsappMessage']['describe']()[_0x4f56('0x1d')](respondWithResult(_0x1e06a1,null))[_0x4f56('0x27')](handleError(_0x1e06a1,null));};var interaction_log=require('../../config/logger')(_0x4f56('0x56'));exports[_0x4f56('0x57')]=function(_0x5e689a,_0x1e5702,_0x24eed0){var _0x391e34={'agent':{},'channel':_0x4f56('0x58')};if(_0x5e689a[_0x4f56('0x54')]['id']){delete _0x5e689a[_0x4f56('0x54')]['id'];}_0x5e689a[_0x4f56('0x54')][_0x4f56('0x59')]=!![];_0x5e689a[_0x4f56('0x54')][_0x4f56('0x5a')]=moment()[_0x4f56('0x5b')](_0x4f56('0x5c'));_0x5e689a[_0x4f56('0x54')][_0x4f56('0x5d')]=_0x5e689a[_0x4f56('0x54')]['UserId']||_0x5e689a[_0x4f56('0x5e')]['id'];_0x391e34['agent']['id']=_0x5e689a[_0x4f56('0x54')][_0x4f56('0x5d')];return db[_0x4f56('0x4d')][_0x4f56('0x55')]({'where':{'id':_0x5e689a[_0x4f56('0x52')]['id'],'UserId':null}})[_0x4f56('0x1d')](handleEntityNotFound(_0x1e5702,null))[_0x4f56('0x1d')](saveUpdates(_0x5e689a[_0x4f56('0x54')],null))['then'](function(_0x26b835){if(_0x26b835){_0x391e34[_0x4f56('0x24')]=_0x26b835[_0x4f56('0x5f')]({'plain':!![]});return db[_0x4f56('0x60')][_0x4f56('0x55')]({'where':{'id':_0x26b835[_0x4f56('0x61')]}});}return null;})[_0x4f56('0x1d')](handleEntityNotFound(_0x1e5702,null))[_0x4f56('0x1d')](function(_0x3497a9){if(_0x3497a9){return _0x3497a9[_0x4f56('0x32')]({'UserId':_0x5e689a[_0x4f56('0x54')]['UserId'],'read1stAt':_[_0x4f56('0x62')](_0x3497a9['read1stAt'])?moment()['format'](_0x4f56('0x5c')):undefined});}return null;})[_0x4f56('0x1d')](function(_0x4fc8c0){if(_0x4fc8c0){_0x391e34[_0x4f56('0x63')]=_0x4fc8c0[_0x4f56('0x5f')]({'plain':!![]});interaction_log[_0x4f56('0x1e')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e689a[_0x4f56('0x5e')]['id'],_0x5e689a[_0x4f56('0x5e')][_0x4f56('0x35')],_0x5e689a[_0x4f56('0x5e')][_0x4f56('0x64')],_0x391e34['interaction']['id'],_0x5e689a['body']?JSON[_0x4f56('0x21')](_0x5e689a[_0x4f56('0x54')]):_0x4f56('0x65'));return respondWithRpcPromise(_0x4f56('0x66'),_0x4f56('0x67'),_0x391e34);}return null;})[_0x4f56('0x1d')](function(_0x1e3e36){var _0x29ecba=_0x4f56('0x68')+_0x1e3e36[_0x4f56('0x24')][_0x4f56('0x69')];return db['sequelize'][_0x4f56('0x3d')](_0x29ecba,{'type':db['Sequelize']['QueryTypes'][_0x4f56('0x6a')],'raw':!![]})[_0x4f56('0x1d')](function(_0x4f7a0e){return _0x4f7a0e;});})[_0x4f56('0x1d')](function(_0x16a2ea){if(_0x16a2ea){_0x391e34[_0x4f56('0x24')]['contact']=_0x16a2ea[0x0];if(!_0x5e689a[_0x4f56('0x54')]['UserId'])return;return db[_0x4f56('0x6b')][_0x4f56('0x55')]({'where':{'id':_0x5e689a[_0x4f56('0x54')][_0x4f56('0x5d')],'role':_0x4f56('0x6c')},'attributes':['id','name',_0x4f56('0x6d'),_0x4f56('0x6e'),'internal'],'raw':!![]});}return null;})[_0x4f56('0x1d')](function(_0x1bf77d){if(!_0x1bf77d)return null;_0x391e34['message'][_0x4f56('0x6c')]=_0x1bf77d;return _0x391e34;})['then'](function(_0x5160b1){if(_0x5160b1){if(_0x5e689a[_0x4f56('0x54')]['manual']){_0x391e34[_0x4f56('0x24')]['interface']=util[_0x4f56('0x5b')](_0x4f56('0x6f'),_0x5e689a['user'][_0x4f56('0x35')]);_0x391e34[_0x4f56('0x24')][_0x4f56('0x70')]=_0x391e34['channel'];_0x391e34[_0x4f56('0x24')][_0x4f56('0x71')]=_0x391e34[_0x4f56('0x70')];_0x391e34[_0x4f56('0x24')][_0x4f56('0x72')]='accept';return respondWithRpcPromise(_0x4f56('0x73'),_0x4f56('0x73'),{'event':_0x4f56('0x74'),'message':_0x391e34['message']},client9002)[_0x4f56('0x1d')](function(){return _0x391e34;});}return _0x391e34;}return null;})[_0x4f56('0x1d')](respondWithResult(_0x1e5702,null))['catch'](handleError(_0x1e5702,null));};var interaction_log=require(_0x4f56('0x14'))('whatsapp-interactions');exports['reject']=function(_0x2cefc5,_0x11bb78,_0x5207c3){var _0x437313={'agent':{},'channel':_0x4f56('0x58')};if(_0x2cefc5[_0x4f56('0x54')]['id']){delete _0x2cefc5[_0x4f56('0x54')]['id'];}_0x2cefc5['body'][_0x4f56('0x5d')]=_0x2cefc5[_0x4f56('0x54')][_0x4f56('0x5d')]||_0x2cefc5[_0x4f56('0x5e')]['id'];_0x437313[_0x4f56('0x6c')]['id']=_0x2cefc5[_0x4f56('0x54')]['UserId'];return db[_0x4f56('0x4d')][_0x4f56('0x55')]({'where':{'id':_0x2cefc5[_0x4f56('0x52')]['id'],'UserId':null}})[_0x4f56('0x1d')](handleEntityNotFound(_0x11bb78,null))[_0x4f56('0x1d')](function(_0x35037a){if(_0x35037a){_0x437313[_0x4f56('0x24')]=_0x35037a[_0x4f56('0x5f')]({'plain':!![]});return db['WhatsappInteraction'][_0x4f56('0x55')]({'where':{'id':_0x35037a[_0x4f56('0x61')]}});}return null;})[_0x4f56('0x1d')](handleEntityNotFound(_0x11bb78,null))[_0x4f56('0x1d')](function(_0x3cbb76){if(_0x3cbb76){_0x437313[_0x4f56('0x63')]=_0x3cbb76[_0x4f56('0x5f')]({'plain':!![]});interaction_log[_0x4f56('0x1e')](_0x4f56('0x75'),_0x2cefc5[_0x4f56('0x5e')]['id'],_0x2cefc5[_0x4f56('0x5e')][_0x4f56('0x35')],_0x2cefc5[_0x4f56('0x5e')][_0x4f56('0x64')],_0x437313['interaction']['id'],_0x2cefc5[_0x4f56('0x54')]?JSON[_0x4f56('0x21')](_0x2cefc5[_0x4f56('0x54')]):_0x4f56('0x65'));return respondWithRpcPromise('RejectMessage',_0x4f56('0x76'),_0x437313);}return null;})[_0x4f56('0x1d')](function(_0x3c910a){var _0x1ddef3=_0x4f56('0x68')+_0x3c910a[_0x4f56('0x24')][_0x4f56('0x69')];return db[_0x4f56('0x77')]['query'](_0x1ddef3,{'type':db[_0x4f56('0x78')][_0x4f56('0x79')][_0x4f56('0x6a')],'raw':!![]})['then'](function(_0x4ba78f){return _0x4ba78f;});})[_0x4f56('0x1d')](function(_0x483d20){if(_0x483d20){_0x437313['message'][_0x4f56('0x7a')]=_0x483d20[0x0];if(!_0x2cefc5[_0x4f56('0x54')][_0x4f56('0x5d')])return;return db['User'][_0x4f56('0x55')]({'where':{'id':_0x2cefc5[_0x4f56('0x54')][_0x4f56('0x5d')],'role':_0x4f56('0x6c')},'attributes':['id',_0x4f56('0x35'),_0x4f56('0x6d'),_0x4f56('0x6e'),_0x4f56('0x7b')],'raw':!![]});}return null;})['then'](function(_0xe90dd2){if(!_0xe90dd2)return null;_0x437313[_0x4f56('0x24')][_0x4f56('0x6c')]=_0xe90dd2;return _0x437313;})['then'](function(_0x2939a3){if(_0x2939a3){_0x2939a3[_0x4f56('0x24')][_0x4f56('0x7c')]=util[_0x4f56('0x5b')](_0x4f56('0x6f'),_0x2cefc5[_0x4f56('0x5e')][_0x4f56('0x35')]);_0x2939a3[_0x4f56('0x24')][_0x4f56('0x70')]=_0x437313[_0x4f56('0x70')];_0x2939a3[_0x4f56('0x24')][_0x4f56('0x71')]=_0x437313['channel'];_0x2939a3['message'][_0x4f56('0x72')]=_0x4f56('0x7d');respondWithRpcPromise(_0x4f56('0x73'),_0x4f56('0x73'),{'event':'rejectmessage','message':_0x2939a3[_0x4f56('0x24')]},client9002);return _0x437313;}return null;})[_0x4f56('0x1d')](respondWithResult(_0x11bb78,null))[_0x4f56('0x27')](handleError(_0x11bb78,null));};exports[_0x4f56('0x29')]=function(_0x125478,_0x302d44,_0x54a0db){if(_0x125478[_0x4f56('0x54')]['id']){delete _0x125478[_0x4f56('0x54')]['id'];}var _0x3af80f;return db[_0x4f56('0x4d')]['find']({'where':{'id':_0x125478[_0x4f56('0x52')]['id']}})[_0x4f56('0x1d')](handleEntityNotFound(_0x302d44,null))['then'](function(_0x22c901){if(_0x22c901){_0x3af80f=_0x22c901;return db[_0x4f56('0x7e')][_0x4f56('0x55')]({'where':{'id':_0x22c901[_0x4f56('0x7f')]}});}})['then'](handleEntityNotFound(_0x302d44,null))[_0x4f56('0x1d')](function(_0x1a0e99){if(_0x1a0e99){logger[_0x4f56('0x20')](_0x4f56('0x80'),_0x4f56('0x29'),_0x4f56('0x81'),_0x1a0e99[_0x4f56('0x3b')],util['inspect'](_0x125478[_0x4f56('0x54')],{'showHidden':![],'depth':null}));switch(_0x1a0e99[_0x4f56('0x3b')]){case _0x4f56('0x82'):if(_0x125478[_0x4f56('0x54')][_0x4f56('0x83')]&&_0x125478[_0x4f56('0x54')][_0x4f56('0x83')]===_0x3af80f[_0x4f56('0x84')]&&_0x125478[_0x4f56('0x54')]['MessageStatus']&&_0x125478[_0x4f56('0x54')][_0x4f56('0x85')]==='read'){return _0x3af80f[_0x4f56('0x32')]({'read':!![]});}else{logger[_0x4f56('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x4f56('0x82'),util[_0x4f56('0x86')](_0x125478[_0x4f56('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x3af80f;}})[_0x4f56('0x1d')](respondWithResult(_0x302d44,null))[_0x4f56('0x27')](handleError(_0x302d44,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 33620fe..3bff576 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 _0x2504=['update','remove','emit','hasOwnProperty','events','../../mysqldb','WhatsappMessage','setMaxListeners','save'];(function(_0x37737b,_0x52df49){var _0x5c7cf0=function(_0xe53a50){while(--_0xe53a50){_0x37737b['push'](_0x37737b['shift']());}};_0x5c7cf0(++_0x52df49);}(_0x2504,0xee));var _0x4250=function(_0x1f49f8,_0xb17e9c){_0x1f49f8=_0x1f49f8-0x0;var _0x409c9b=_0x2504[_0x1f49f8];return _0x409c9b;};'use strict';var EventEmitter=require(_0x4250('0x0'));var WhatsappMessage=require(_0x4250('0x1'))['db'][_0x4250('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4250('0x3')](0x0);var events={'afterCreate':_0x4250('0x4'),'afterUpdate':_0x4250('0x5'),'afterDestroy':_0x4250('0x6')};function emitEvent(_0x320d79){return function(_0x17d2d8,_0xc31f3a,_0xe5986d){WhatsappMessageEvents[_0x4250('0x7')](_0x320d79+':'+_0x17d2d8['id'],_0x17d2d8);WhatsappMessageEvents['emit'](_0x320d79,_0x17d2d8);_0xe5986d(null);};}for(var e in events){if(events[_0x4250('0x8')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xf45e=['save','update','remove','emit','hasOwnProperty','hook','exports','events','WhatsappMessage'];(function(_0x4eee80,_0x4a0b9a){var _0x10d6f0=function(_0x1ac511){while(--_0x1ac511){_0x4eee80['push'](_0x4eee80['shift']());}};_0x10d6f0(++_0x4a0b9a);}(_0xf45e,0x115));var _0xef45=function(_0x21a242,_0x4ad60e){_0x21a242=_0x21a242-0x0;var _0x1e3c9e=_0xf45e[_0x21a242];return _0x1e3c9e;};'use strict';var EventEmitter=require(_0xef45('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xef45('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xef45('0x2'),'afterUpdate':_0xef45('0x3'),'afterDestroy':_0xef45('0x4')};function emitEvent(_0x1e94ee){return function(_0x37772f,_0x8b048c,_0x3cd579){WhatsappMessageEvents[_0xef45('0x5')](_0x1e94ee+':'+_0x37772f['id'],_0x37772f);WhatsappMessageEvents[_0xef45('0x5')](_0x1e94ee,_0x37772f);_0x3cd579(null);};}for(var e in events){if(events[_0xef45('0x6')](e)){var event=events[e];WhatsappMessage[_0xef45('0x7')](e,emitEvent(event));}}module[_0xef45('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 ac8b8ab..642bc21 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 _0x3733=['direction','toLowerCase','out','secret','isNil','findOne','then','catch','WhatsappAccount','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','inspect','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','POST','Bearer\x20','application/json','statuses','update','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','FULLTEXT','models','get'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0x3733,0x93));var _0x3373=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3733[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3373('0x0'));var util=require(_0x3373('0x1'));var logger=require(_0x3373('0x2'))(_0x3373('0x3'));var moment=require(_0x3373('0x4'));var BPromise=require('bluebird');var rp=require(_0x3373('0x5'));var fetch=require(_0x3373('0x6'));var fs=require('fs');var path=require(_0x3373('0x7'));var rimraf=require('rimraf');var config=require(_0x3373('0x8'));var attributes=require(_0x3373('0x9'));module[_0x3373('0xa')]=function(_0x1d49ae,_0xe1587c){return _0x1d49ae[_0x3373('0xb')](_0x3373('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x3373('0xd'),'fields':[_0x3373('0xd')]},{'name':_0x3373('0xe'),'fields':['body'],'type':_0x3373('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3daadf,_0x1d8508,_0x2693d4){var _0x10d4d1=_0x1d49ae[_0x3373('0x10')];var _0x4897a1=_0x3daadf[_0x3373('0x11')]({'plain':!![]});if(_0x4897a1[_0x3373('0x12')][_0x3373('0x13')]()==='in'||_0x4897a1['direction']['toLowerCase']()===_0x3373('0x14')&&!_0x4897a1[_0x3373('0x15')]&&!_[_0x3373('0x16')](_0x4897a1['UserId'])){_0x10d4d1['WhatsappInteraction'][_0x3373('0x17')]({'where':{'id':_0x4897a1['WhatsappInteractionId']}})[_0x3373('0x18')](function(_0x1b279d){if(_0x1b279d){_0x1b279d['update']({'lastMsgAt':_0x4897a1['createdAt'],'lastMsgDirection':_0x4897a1[_0x3373('0x12')][_0x3373('0x13')]()});}})[_0x3373('0x19')](function(_0x83353f){console['error'](_0x83353f);});}if(_0x4897a1[_0x3373('0x12')]===_0x3373('0x14')&&!_0x4897a1[_0x3373('0x15')]){var _0x2ad5b5;_0x10d4d1[_0x3373('0x1a')]['find']({'where':{'id':_0x4897a1['WhatsappAccountId']},'raw':!![]})[_0x3373('0x18')](function(_0x3d2507){_0x2ad5b5=_0x3d2507;if(_0x2ad5b5&&_0x2ad5b5['type']){switch(_0x2ad5b5['type']){case _0x3373('0x1b'):var _0x481829=require(_0x3373('0x1b'));if(_0x2ad5b5[_0x3373('0x1c')]&&_0x2ad5b5[_0x3373('0x1d')]&&_0x2ad5b5[_0x3373('0x1e')]){var _0x245c97=new _0x481829(_0x2ad5b5[_0x3373('0x1c')],_0x2ad5b5[_0x3373('0x1d')]);_0x245c97[_0x3373('0x1f')]['create']({'body':_0x4897a1['body'],'to':_0x3373('0x20')+_0x4897a1[_0x3373('0x1e')],'from':'whatsapp:'+_0x2ad5b5[_0x3373('0x1e')],'statusCallback':_0x2ad5b5[_0x3373('0x21')]+_0x3373('0x22')+_0x4897a1['id']+_0x3373('0x23')+_0x2ad5b5[_0x3373('0x24')]})['then'](function(_0x2e8a96){if(_0x2e8a96[_0x3373('0x25')]){return _0x3daadf['update']({'messageId':_0x2e8a96[_0x3373('0x25')]});}})['catch'](function(_0x25e772){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3373('0x1b'),util[_0x3373('0x26')](_0x25e772,{'showHidden':![],'depth':null}));});}else{logger[_0x3373('0x27')](_0x3373('0x28'),'afterCreate','twilio',_0x3373('0x29'));}break;case _0x3373('0x2a'):var _0x56a2a9=_0x2ad5b5[_0x3373('0x1c')];var _0x40d9c7=_0x2ad5b5[_0x3373('0x1d')];var _0x23b402=_0x2ad5b5[_0x3373('0x2b')]+'/whatsapp/v1/'+_0x56a2a9+_0x3373('0x2c');var _0x46d83c={'to':[_0x4897a1[_0x3373('0x1e')]],'message':{'type':'text','text':_0x4897a1['body']}};var _0x5be257={'method':_0x3373('0x2d'),'uri':_0x23b402,'headers':{'Authorization':_0x3373('0x2e')+_0x40d9c7,'Content-Type':_0x3373('0x2f')},'body':_0x46d83c,'json':!![]};rp(_0x5be257)[_0x3373('0x18')](function(_0x1626f4){if(_0x1626f4[_0x3373('0x30')][0x0]['message_id']){return _0x3daadf[_0x3373('0x31')]({'messageId':_0x1626f4[_0x3373('0x30')][0x0]['message_id']});}})[_0x3373('0x19')](function(_0x3f2440){logger[_0x3373('0x32')](_0x3373('0x33'),_0x3f2440);});break;}}})[_0x3373('0x34')](function(){_0x2693d4();});}else{_0x2693d4();}}},'charset':_0x3373('0x35'),'collate':_0x3373('0x36')});}; \ No newline at end of file +var _0x3eb1=['path','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','then','update','createdAt','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','accountSid','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','/messages/','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3eb1,0xb2));var _0x13eb=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0x3eb1[_0x4f4d19];return _0x27a258;};'use strict';var _=require(_0x13eb('0x0'));var util=require(_0x13eb('0x1'));var logger=require(_0x13eb('0x2'))(_0x13eb('0x3'));var moment=require(_0x13eb('0x4'));var BPromise=require(_0x13eb('0x5'));var rp=require(_0x13eb('0x6'));var fetch=require(_0x13eb('0x7'));var fs=require('fs');var path=require(_0x13eb('0x8'));var rimraf=require('rimraf');var config=require(_0x13eb('0x9'));var attributes=require(_0x13eb('0xa'));module[_0x13eb('0xb')]=function(_0x5edce3,_0x541dca){return _0x5edce3[_0x13eb('0xc')](_0x13eb('0xd'),attributes,{'tableName':_0x13eb('0xe'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x13eb('0xf')]},{'name':_0x13eb('0x10'),'fields':[_0x13eb('0x11')],'type':_0x13eb('0x12')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e67d2,_0x25154a,_0x49d4e0){var _0x5bf737=_0x5edce3[_0x13eb('0x13')];var _0x59e21f=_0x1e67d2['get']({'plain':!![]});if(_0x59e21f[_0x13eb('0x14')][_0x13eb('0x15')]()==='in'||_0x59e21f[_0x13eb('0x14')][_0x13eb('0x15')]()===_0x13eb('0x16')&&!_0x59e21f[_0x13eb('0x17')]&&!_[_0x13eb('0x18')](_0x59e21f[_0x13eb('0x19')])){_0x5bf737[_0x13eb('0x1a')][_0x13eb('0x1b')]({'where':{'id':_0x59e21f['WhatsappInteractionId']}})[_0x13eb('0x1c')](function(_0x405b03){if(_0x405b03){_0x405b03[_0x13eb('0x1d')]({'lastMsgAt':_0x59e21f[_0x13eb('0x1e')],'lastMsgDirection':_0x59e21f['direction'][_0x13eb('0x15')]()});}})['catch'](function(_0x40383f){console[_0x13eb('0x1f')](_0x40383f);});}if(_0x59e21f[_0x13eb('0x14')]===_0x13eb('0x16')&&!_0x59e21f[_0x13eb('0x17')]){var _0x2dc307;_0x5bf737[_0x13eb('0x20')][_0x13eb('0x21')]({'where':{'id':_0x59e21f[_0x13eb('0x22')]},'raw':!![]})[_0x13eb('0x1c')](function(_0x188798){_0x2dc307=_0x188798;if(_0x2dc307&&_0x2dc307[_0x13eb('0x23')]){switch(_0x2dc307[_0x13eb('0x23')]){case _0x13eb('0x24'):var _0x5468eb=require('twilio');if(_0x2dc307['accountSid']&&_0x2dc307[_0x13eb('0x25')]&&_0x2dc307[_0x13eb('0x26')]){var _0x2fc3cd=new _0x5468eb(_0x2dc307[_0x13eb('0x27')],_0x2dc307[_0x13eb('0x25')]);_0x2fc3cd[_0x13eb('0x28')][_0x13eb('0x29')]({'body':_0x59e21f['body'],'to':_0x13eb('0x2a')+_0x59e21f[_0x13eb('0x26')],'from':_0x13eb('0x2a')+_0x2dc307['phone'],'statusCallback':_0x2dc307[_0x13eb('0x2b')]+_0x13eb('0x2c')+_0x59e21f['id']+_0x13eb('0x2d')+_0x2dc307['token']})[_0x13eb('0x1c')](function(_0x4e9742){if(_0x4e9742['sid']){return _0x1e67d2['update']({'messageId':_0x4e9742['sid']});}})[_0x13eb('0x2e')](function(_0x2a48a0){logger['error'](_0x13eb('0x2f'),_0x13eb('0x30'),_0x13eb('0x24'),util[_0x13eb('0x31')](_0x2a48a0,{'showHidden':![],'depth':null}));});}else{logger[_0x13eb('0x1f')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x13eb('0x30'),_0x13eb('0x24'),_0x13eb('0x32'));}break;case'sinch':var _0x91da40=_0x2dc307[_0x13eb('0x27')];var _0x23186a=_0x2dc307[_0x13eb('0x25')];var _0x8a7634=_0x2dc307[_0x13eb('0x33')]+_0x13eb('0x34')+_0x91da40+_0x13eb('0x35');var _0x536ace={'to':[_0x59e21f[_0x13eb('0x26')]],'message':{'type':'text','text':_0x59e21f['body']}};var _0x1fca42={'method':'POST','uri':_0x8a7634,'headers':{'Authorization':'Bearer\x20'+_0x23186a,'Content-Type':_0x13eb('0x36')},'body':_0x536ace,'json':!![]};rp(_0x1fca42)['then'](function(_0x202da4){if(_0x202da4[_0x13eb('0x37')][0x0]['message_id']){return _0x1e67d2[_0x13eb('0x1d')]({'messageId':_0x202da4[_0x13eb('0x37')][0x0][_0x13eb('0x38')]});}})['catch'](function(_0x2dcfc9){logger[_0x13eb('0x39')](_0x13eb('0x3a'),_0x2dcfc9);});break;}}})[_0x13eb('0x3b')](function(){_0x49d4e0();});}else{_0x49d4e0();}}},'charset':_0x13eb('0x3c'),'collate':_0x13eb('0x3d')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 335e07d..17fff2f 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 _0x0388=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./whatsappMessage.socket','request','then','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateWhatsappMessage','body','options','raw','util','moment','bluebird','randomstring','ioredis'];(function(_0x2f87cd,_0xcaf299){var _0x5d7eda=function(_0x37ffb0){while(--_0x37ffb0){_0x2f87cd['push'](_0x2f87cd['shift']());}};_0x5d7eda(++_0xcaf299);}(_0x0388,0x16f));var _0x8038=function(_0x50f157,_0x280833){_0x50f157=_0x50f157-0x0;var _0x7e0178=_0x0388[_0x50f157];return _0x7e0178;};'use strict';var _=require('lodash');var util=require(_0x8038('0x0'));var moment=require(_0x8038('0x1'));var BPromise=require(_0x8038('0x2'));var rs=require(_0x8038('0x3'));var fs=require('fs');var Redis=require(_0x8038('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8038('0x5'));var logger=require(_0x8038('0x6'))(_0x8038('0x7'));var config=require(_0x8038('0x8'));var jayson=require(_0x8038('0x9'));var client=jayson['client'][_0x8038('0xa')]({'port':0x232a});config['redis']=_[_0x8038('0xb')](config[_0x8038('0xc')],{'host':_0x8038('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8038('0xe'))['register'](socket);function respondWithRpcPromise(_0x3d4707,_0x243a06,_0x38b1bc){return new BPromise(function(_0x19eaf5,_0x20d338){return client[_0x8038('0xf')](_0x3d4707,_0x38b1bc)[_0x8038('0x10')](function(_0x3ef0a0){logger[_0x8038('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x243a06,'request\x20sent');logger[_0x8038('0x12')](_0x8038('0x13'),_0x243a06,'request\x20sent',JSON[_0x8038('0x14')](_0x3ef0a0));if(_0x3ef0a0[_0x8038('0x15')]){if(_0x3ef0a0[_0x8038('0x15')]['code']===0x1f4){logger['error'](_0x8038('0x16'),_0x243a06,_0x3ef0a0['error'][_0x8038('0x17')]);return _0x20d338(_0x3ef0a0[_0x8038('0x15')]['message']);}logger['error'](_0x8038('0x16'),_0x243a06,_0x3ef0a0[_0x8038('0x15')]['message']);return _0x19eaf5(_0x3ef0a0[_0x8038('0x15')][_0x8038('0x17')]);}else{logger[_0x8038('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x243a06,_0x8038('0x18'));_0x19eaf5(_0x3ef0a0[_0x8038('0x19')][_0x8038('0x17')]);}})[_0x8038('0x1a')](function(_0x257973){logger[_0x8038('0x15')](_0x8038('0x16'),_0x243a06,_0x257973);_0x20d338(_0x257973);});});}exports[_0x8038('0x1b')]=function(_0x5c9825){var _0x2b6b23=this;return new Promise(function(_0x173fdd,_0x24f388){return db['WhatsappMessage']['create'](_0x5c9825[_0x8038('0x1c')],{'raw':_0x5c9825['options']?_0x5c9825[_0x8038('0x1d')][_0x8038('0x1e')]===undefined?!![]:![]:!![]})[_0x8038('0x10')](function(_0x345581){logger['info'](_0x8038('0x1b'),_0x5c9825);logger[_0x8038('0x12')](_0x8038('0x1b'),_0x5c9825,JSON[_0x8038('0x14')](_0x345581));_0x173fdd(_0x345581);})[_0x8038('0x1a')](function(_0x4c8649){logger[_0x8038('0x15')](_0x8038('0x1b'),_0x4c8649['message'],_0x5c9825);_0x24f388(_0x2b6b23[_0x8038('0x15')](0x1f4,_0x4c8649[_0x8038('0x17')]));});});}; \ No newline at end of file +var _0xbb43=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','CreateWhatsappMessage','WhatsappMessage','create','options','raw','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0xbb43,0x14c));var _0x3bb4=function(_0x4b13f0,_0x1273df){_0x4b13f0=_0x4b13f0-0x0;var _0x2a1955=_0xbb43[_0x4b13f0];return _0x2a1955;};'use strict';var _=require(_0x3bb4('0x0'));var util=require(_0x3bb4('0x1'));var moment=require(_0x3bb4('0x2'));var BPromise=require(_0x3bb4('0x3'));var rs=require(_0x3bb4('0x4'));var fs=require('fs');var Redis=require(_0x3bb4('0x5'));var db=require(_0x3bb4('0x6'))['db'];var utils=require(_0x3bb4('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3bb4('0x8'));var jayson=require(_0x3bb4('0x9'));var client=jayson[_0x3bb4('0xa')][_0x3bb4('0xb')]({'port':0x232a});config[_0x3bb4('0xc')]=_[_0x3bb4('0xd')](config['redis'],{'host':_0x3bb4('0xe'),'port':0x18eb});var socket=require(_0x3bb4('0xf'))(new Redis(config[_0x3bb4('0xc')]));require(_0x3bb4('0x10'))[_0x3bb4('0x11')](socket);function respondWithRpcPromise(_0x28b7d8,_0x54fb7a,_0xdcf5bc){return new BPromise(function(_0x584e22,_0x50738d){return client['request'](_0x28b7d8,_0xdcf5bc)[_0x3bb4('0x12')](function(_0xdc5a0b){logger['info'](_0x3bb4('0x13'),_0x54fb7a,_0x3bb4('0x14'));logger[_0x3bb4('0x15')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x54fb7a,_0x3bb4('0x14'),JSON['stringify'](_0xdc5a0b));if(_0xdc5a0b['error']){if(_0xdc5a0b[_0x3bb4('0x16')][_0x3bb4('0x17')]===0x1f4){logger['error'](_0x3bb4('0x13'),_0x54fb7a,_0xdc5a0b[_0x3bb4('0x16')][_0x3bb4('0x18')]);return _0x50738d(_0xdc5a0b['error'][_0x3bb4('0x18')]);}logger[_0x3bb4('0x16')](_0x3bb4('0x13'),_0x54fb7a,_0xdc5a0b[_0x3bb4('0x16')][_0x3bb4('0x18')]);return _0x584e22(_0xdc5a0b['error']['message']);}else{logger[_0x3bb4('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x54fb7a,_0x3bb4('0x14'));_0x584e22(_0xdc5a0b[_0x3bb4('0x1a')]['message']);}})['catch'](function(_0x229e2b){logger[_0x3bb4('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x54fb7a,_0x229e2b);_0x50738d(_0x229e2b);});});}exports[_0x3bb4('0x1b')]=function(_0x3a149c){var _0x551b41=this;return new Promise(function(_0xa8f068,_0x498013){return db[_0x3bb4('0x1c')][_0x3bb4('0x1d')](_0x3a149c['body'],{'raw':_0x3a149c[_0x3bb4('0x1e')]?_0x3a149c[_0x3bb4('0x1e')][_0x3bb4('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x5d929d){logger[_0x3bb4('0x19')](_0x3bb4('0x1b'),_0x3a149c);logger['debug'](_0x3bb4('0x1b'),_0x3a149c,JSON[_0x3bb4('0x20')](_0x5d929d));_0xa8f068(_0x5d929d);})[_0x3bb4('0x21')](function(_0xd94dd9){logger['error']('CreateWhatsappMessage',_0xd94dd9[_0x3bb4('0x18')],_0x3a149c);_0x498013(_0x551b41[_0x3bb4('0x16')](0x1f4,_0xd94dd9[_0x3bb4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 2a5f5ad..ffee945 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 _0x5ecf=['update','emit','removeListener','register','length','./whatsappMessage.events','save'];(function(_0x56f01f,_0x3e4bb5){var _0xf204db=function(_0x5254a7){while(--_0x5254a7){_0x56f01f['push'](_0x56f01f['shift']());}};_0xf204db(++_0x3e4bb5);}(_0x5ecf,0x16a));var _0xf5ec=function(_0x4e168e,_0x438fcb){_0x4e168e=_0x4e168e-0x0;var _0x4b6d5b=_0x5ecf[_0x4e168e];return _0x4b6d5b;};'use strict';var WhatsappMessageEvents=require(_0xf5ec('0x0'));var events=[_0xf5ec('0x1'),'remove',_0xf5ec('0x2')];function createListener(_0x5e200f,_0x53d7bb){return function(_0x236fdd){_0x53d7bb[_0xf5ec('0x3')](_0x5e200f,_0x236fdd);};}function removeListener(_0x594a2f,_0x52b8ee){return function(){WhatsappMessageEvents[_0xf5ec('0x4')](_0x594a2f,_0x52b8ee);};}exports[_0xf5ec('0x5')]=function(_0xd00777){for(var _0x4c51aa=0x0,_0x5285b4=events[_0xf5ec('0x6')];_0x4c51aa<_0x5285b4;_0x4c51aa++){var _0x153e6b=events[_0x4c51aa];var _0xedcaf5=createListener('whatsappMessage:'+_0x153e6b,_0xd00777);WhatsappMessageEvents['on'](_0x153e6b,_0xedcaf5);}}; \ No newline at end of file +var _0x57f9=['removeListener','length','whatsappMessage:','save','remove'];(function(_0x8b3680,_0x33e13e){var _0x56801c=function(_0xca60ca){while(--_0xca60ca){_0x8b3680['push'](_0x8b3680['shift']());}};_0x56801c(++_0x33e13e);}(_0x57f9,0x15c));var _0x957f=function(_0x3afef1,_0x129a73){_0x3afef1=_0x3afef1-0x0;var _0x5521c0=_0x57f9[_0x3afef1];return _0x5521c0;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x957f('0x0'),_0x957f('0x1'),'update'];function createListener(_0x3b31a1,_0x143622){return function(_0x5b6f6){_0x143622['emit'](_0x3b31a1,_0x5b6f6);};}function removeListener(_0x2d24ee,_0x50e4d7){return function(){WhatsappMessageEvents[_0x957f('0x2')](_0x2d24ee,_0x50e4d7);};}exports['register']=function(_0x5d0578){for(var _0x535c05=0x0,_0x937882=events[_0x957f('0x3')];_0x535c05<_0x937882;_0x535c05++){var _0x4126e8=events[_0x535c05];var _0x42ebf4=createListener(_0x957f('0x4')+_0x4126e8,_0x5d0578);WhatsappMessageEvents['on'](_0x4126e8,_0x42ebf4);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 7fb6fcc..e44502b 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 _0x89e3=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x547667,_0x110152){var _0x245b6d=function(_0x567a35){while(--_0x567a35){_0x547667['push'](_0x547667['shift']());}};_0x245b6d(++_0x110152);}(_0x89e3,0xc2));var _0x389e=function(_0x3cb5c4,_0x4dff8b){_0x3cb5c4=_0x3cb5c4-0x0;var _0x203787=_0x89e3[_0x3cb5c4];return _0x203787;};'use strict';var multer=require(_0x389e('0x0'));var util=require(_0x389e('0x1'));var path=require(_0x389e('0x2'));var timeout=require(_0x389e('0x3'));var express=require(_0x389e('0x4'));var router=express['Router']();var fs_extra=require(_0x389e('0x5'));var auth=require(_0x389e('0x6'));var interaction=require(_0x389e('0x7'));var config=require(_0x389e('0x8'));var controller=require(_0x389e('0x9'));router[_0x389e('0xa')]('/',auth[_0x389e('0xb')](),controller[_0x389e('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x389e('0xd')]);router['get'](_0x389e('0xe'),auth[_0x389e('0xb')](),controller[_0x389e('0xf')]);router[_0x389e('0xa')](_0x389e('0x10'),auth[_0x389e('0xb')](),controller[_0x389e('0x11')]);router[_0x389e('0xa')](_0x389e('0x12'),auth['isAuthenticated'](),controller[_0x389e('0x13')]);router[_0x389e('0xa')](_0x389e('0x14'),auth['isAuthenticated'](),controller[_0x389e('0x15')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x389e('0x16')](_0x389e('0x12'),auth[_0x389e('0xb')](),controller[_0x389e('0x17')]);router['post'](_0x389e('0x14'),auth['isAuthenticated'](),controller[_0x389e('0x18')]);router['put'](_0x389e('0xe'),auth[_0x389e('0xb')](),controller[_0x389e('0x19')]);router[_0x389e('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x389e('0x1b')]);router[_0x389e('0x1a')]('/:id/teams',auth[_0x389e('0xb')](),controller[_0x389e('0x1c')]);router[_0x389e('0x1a')]('/:id/users',auth[_0x389e('0xb')](),controller[_0x389e('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x0cff=['create','addTeams','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','/describe','isAuthenticated','describe','/:id','getMembers','getTeams','/:id/users','getAgents','post'];(function(_0x3ec9a4,_0x129ccd){var _0x4894f3=function(_0x5ab4d6){while(--_0x5ab4d6){_0x3ec9a4['push'](_0x3ec9a4['shift']());}};_0x4894f3(++_0x129ccd);}(_0x0cff,0x164));var _0xf0cf=function(_0x485201,_0x3c533a){_0x485201=_0x485201-0x0;var _0x9ca98a=_0x0cff[_0x485201];return _0x9ca98a;};'use strict';var multer=require(_0xf0cf('0x0'));var util=require(_0xf0cf('0x1'));var path=require(_0xf0cf('0x2'));var timeout=require(_0xf0cf('0x3'));var express=require(_0xf0cf('0x4'));var router=express[_0xf0cf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf0cf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf0cf('0x7'));var controller=require(_0xf0cf('0x8'));router[_0xf0cf('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf0cf('0x9')](_0xf0cf('0xa'),auth[_0xf0cf('0xb')](),controller[_0xf0cf('0xc')]);router[_0xf0cf('0x9')](_0xf0cf('0xd'),auth[_0xf0cf('0xb')](),controller['show']);router[_0xf0cf('0x9')]('/:id/members',auth[_0xf0cf('0xb')](),controller[_0xf0cf('0xe')]);router[_0xf0cf('0x9')]('/:id/teams',auth[_0xf0cf('0xb')](),controller[_0xf0cf('0xf')]);router[_0xf0cf('0x9')](_0xf0cf('0x10'),auth[_0xf0cf('0xb')](),controller[_0xf0cf('0x11')]);router[_0xf0cf('0x12')]('/',auth[_0xf0cf('0xb')](),controller[_0xf0cf('0x13')]);router[_0xf0cf('0x12')]('/:id/teams',auth[_0xf0cf('0xb')](),controller[_0xf0cf('0x14')]);router['post'](_0xf0cf('0x10'),auth[_0xf0cf('0xb')](),controller['addAgents']);router['put'](_0xf0cf('0xd'),auth[_0xf0cf('0xb')](),controller['update']);router['delete'](_0xf0cf('0xd'),auth[_0xf0cf('0xb')](),controller[_0xf0cf('0x15')]);router[_0xf0cf('0x16')]('/:id/teams',auth[_0xf0cf('0xb')](),controller['removeTeams']);router[_0xf0cf('0x16')](_0xf0cf('0x10'),auth[_0xf0cf('0xb')](),controller[_0xf0cf('0x17')]);module[_0xf0cf('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index b8002c9..9a2219a 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 _0x0b25=['STRING','name','INTEGER','ENUM','rrmemory','sequelize','exports'];(function(_0x4e9f46,_0x156642){var _0x12d150=function(_0x3633f0){while(--_0x3633f0){_0x4e9f46['push'](_0x4e9f46['shift']());}};_0x12d150(++_0x156642);}(_0x0b25,0x155));var _0x50b2=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x0b25[_0x189305];return _0xea3406;};'use strict';var Sequelize=require(_0x50b2('0x0'));module[_0x50b2('0x1')]={'name':{'type':Sequelize[_0x50b2('0x2')],'unique':_0x50b2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x50b2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x50b2('0x5')](_0x50b2('0x6'),'beepall','roundrobin')},'description':{'type':Sequelize[_0x50b2('0x2')]}}; \ No newline at end of file +var _0xbdb7=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x11e7d9,_0x466213){var _0x8ff332=function(_0x9a9990){while(--_0x9a9990){_0x11e7d9['push'](_0x11e7d9['shift']());}};_0x8ff332(++_0x466213);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xd75b98,_0x15ad99){_0xd75b98=_0xd75b98-0x0;var _0xdd720e=_0xbdb7[_0xd75b98];return _0xdd720e;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'name':{'type':Sequelize[_0x7bdb('0x2')],'unique':_0x7bdb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x7bdb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7bdb('0x5')](_0x7bdb('0x6'),_0x7bdb('0x7'),_0x7bdb('0x8'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index e5719a3..b149c61 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 _0x15ea=['util','sox','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','end','sendStatus','name','send','WhatsappQueue','rawAttributes','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','intersection','includeAll','find','catch','create','body','role','UserProfileSection','userProfileId','autoAssociation','error','describe','getMembers','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','agent','whatsappPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','WhatsappQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','includes','all','union','value','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x29fdd0,_0x4afcaf){var _0x4af6d4=function(_0x5311d4){while(--_0x5311d4){_0x29fdd0['push'](_0x29fdd0['shift']());}};_0x4af6d4(++_0x4afcaf);}(_0x15ea,0x108));var _0xa15e=function(_0x484b5d,_0x155128){_0x484b5d=_0x484b5d-0x0;var _0x36a0ed=_0x15ea[_0x484b5d];return _0x36a0ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa15e('0x0'));var zipdir=require(_0xa15e('0x1'));var jsonpatch=require(_0xa15e('0x2'));var rp=require(_0xa15e('0x3'));var moment=require(_0xa15e('0x4'));var BPromise=require(_0xa15e('0x5'));var Mustache=require('mustache');var util=require(_0xa15e('0x6'));var path=require('path');var sox=require(_0xa15e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa15e('0x8'));var _=require('lodash');var squel=require(_0xa15e('0x9'));var crypto=require(_0xa15e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa15e('0xb'));var toCsv=require(_0xa15e('0xc'));var querystring=require('querystring');var Papa=require(_0xa15e('0xd'));var Redis=require(_0xa15e('0xe'));var authService=require(_0xa15e('0xf'));var qs=require(_0xa15e('0x10'));var as=require(_0xa15e('0x11'));var hardwareService=require(_0xa15e('0x12'));var logger=require('../../config/logger')(_0xa15e('0x13'));var utils=require('../../config/utils');var config=require(_0xa15e('0x14'));var licenseUtil=require(_0xa15e('0x15'));var db=require(_0xa15e('0x16'))['db'];config[_0xa15e('0x17')]=_[_0xa15e('0x18')](config[_0xa15e('0x17')],{'host':_0xa15e('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa15e('0x17')]));require(_0xa15e('0x1a'))['register'](socket);function respondWithStatusCode(_0x5343fd,_0x520cca){_0x520cca=_0x520cca||0xcc;return function(_0x4eb338){if(_0x4eb338){return _0x5343fd['sendStatus'](_0x520cca);}return _0x5343fd[_0xa15e('0x1b')](_0x520cca)['end']();};}function respondWithResult(_0x9ed710,_0x47c327){_0x47c327=_0x47c327||0xc8;return function(_0x39e67a){if(_0x39e67a){return _0x9ed710['status'](_0x47c327)[_0xa15e('0x1c')](_0x39e67a);}};}function respondWithFilteredResult(_0x2ddccb,_0x17ee36){return function(_0x4eb87e){if(_0x4eb87e){var _0x431baa=typeof _0x17ee36[_0xa15e('0x1d')]==='undefined'&&typeof _0x17ee36[_0xa15e('0x1e')]===_0xa15e('0x1f');var _0x1a85f1=_0x4eb87e[_0xa15e('0x20')];var _0x3dd36a=_0x431baa?0x0:_0x17ee36['offset'];var _0x52047e=_0x431baa?_0x4eb87e[_0xa15e('0x20')]:_0x17ee36['offset']+_0x17ee36['limit'];var _0x133301;if(_0x52047e>=_0x1a85f1){_0x52047e=_0x1a85f1;_0x133301=0xc8;}else{_0x133301=0xce;}_0x2ddccb[_0xa15e('0x1b')](_0x133301);return _0x2ddccb[_0xa15e('0x21')]('Content-Range',_0x3dd36a+'-'+_0x52047e+'/'+_0x1a85f1)[_0xa15e('0x1c')](_0x4eb87e);}return null;};}function patchUpdates(_0x449bcd){return function(_0x755eaa){try{jsonpatch[_0xa15e('0x22')](_0x755eaa,_0x449bcd,!![]);}catch(_0x591acf){return BPromise[_0xa15e('0x23')](_0x591acf);}return _0x755eaa[_0xa15e('0x24')]();};}function saveUpdates(_0x3c9903,_0x5cd4d7){return function(_0x246caa){if(_0x246caa){return _0x246caa[_0xa15e('0x25')](_0x3c9903)[_0xa15e('0x26')](function(_0x1f572d){return _0x1f572d;});}return null;};}function removeEntity(_0x17ccd0,_0x5e2894){return function(_0x3e3073){if(_0x3e3073){return _0x3e3073[_0xa15e('0x27')]()[_0xa15e('0x26')](function(){var _0x39573e=_0x3e3073[_0xa15e('0x28')]({'plain':!![]});var _0x40873d=_0xa15e('0x29');return db[_0xa15e('0x2a')][_0xa15e('0x27')]({'where':{'type':_0x40873d,'resourceId':_0x39573e['id']}})[_0xa15e('0x26')](function(){return _0x3e3073;});})[_0xa15e('0x26')](function(){_0x17ccd0['status'](0xcc)[_0xa15e('0x2b')]();});}};}function handleEntityNotFound(_0x5d8be3,_0x24b0e3){return function(_0x159132){if(!_0x159132){_0x5d8be3[_0xa15e('0x2c')](0x194);}return _0x159132;};}function handleError(_0x300a17,_0x383b8f){_0x383b8f=_0x383b8f||0x1f4;return function(_0x492019){logger['error'](_0x492019['stack']);if(_0x492019[_0xa15e('0x2d')]){delete _0x492019[_0xa15e('0x2d')];}_0x300a17[_0xa15e('0x1b')](_0x383b8f)[_0xa15e('0x2e')](_0x492019);};}exports['index']=function(_0x435e4c,_0x21e6d0){var _0x5980c4={},_0xa988c={},_0x30c570={'count':0x0,'rows':[]};var _0x5a7ea5=_['map'](db[_0xa15e('0x2f')][_0xa15e('0x30')],function(_0x49cb42){return{'name':_0x49cb42['fieldName'],'type':_0x49cb42['type'][_0xa15e('0x31')]};});_0xa988c[_0xa15e('0x32')]=_[_0xa15e('0x33')](_0x5a7ea5,_0xa15e('0x2d'));_0xa988c[_0xa15e('0x34')]=_[_0xa15e('0x35')](_0x435e4c[_0xa15e('0x34')]);_0xa988c[_0xa15e('0x36')]=_['intersection'](_0xa988c[_0xa15e('0x32')],_0xa988c[_0xa15e('0x34')]);_0x5980c4[_0xa15e('0x37')]=_['intersection'](_0xa988c[_0xa15e('0x32')],qs['fields'](_0x435e4c[_0xa15e('0x34')][_0xa15e('0x38')]));_0x5980c4[_0xa15e('0x37')]=_0x5980c4['attributes'][_0xa15e('0x39')]?_0x5980c4['attributes']:_0xa988c['model'];if(!_0x435e4c[_0xa15e('0x34')][_0xa15e('0x3a')]('nolimit')){_0x5980c4[_0xa15e('0x1e')]=qs[_0xa15e('0x1e')](_0x435e4c[_0xa15e('0x34')][_0xa15e('0x1e')]);_0x5980c4[_0xa15e('0x1d')]=qs[_0xa15e('0x1d')](_0x435e4c['query'][_0xa15e('0x1d')]);}_0x5980c4[_0xa15e('0x3b')]=qs[_0xa15e('0x3c')](_0x435e4c[_0xa15e('0x34')][_0xa15e('0x3c')]);_0x5980c4['where']=qs[_0xa15e('0x36')](_[_0xa15e('0x3d')](_0x435e4c[_0xa15e('0x34')],_0xa988c[_0xa15e('0x36')]),_0x5a7ea5);if(_0x435e4c[_0xa15e('0x34')][_0xa15e('0x3e')]){_0x5980c4[_0xa15e('0x3f')]=_[_0xa15e('0x40')](_0x5980c4[_0xa15e('0x3f')],{'$or':_['map'](_0x5a7ea5,function(_0x571c7f){if(_0x571c7f['type']!==_0xa15e('0x41')){var _0xb66682={};_0xb66682[_0x571c7f['name']]={'$like':'%'+_0x435e4c['query'][_0xa15e('0x3e')]+'%'};return _0xb66682;}})});}_0x5980c4=_[_0xa15e('0x40')]({},_0x5980c4,_0x435e4c[_0xa15e('0x42')]);var _0x3c2ddf={'where':_0x5980c4[_0xa15e('0x3f')]};return db[_0xa15e('0x2f')][_0xa15e('0x20')](_0x3c2ddf)[_0xa15e('0x26')](function(_0x19fc6e){_0x30c570['count']=_0x19fc6e;if(_0x435e4c['query']['includeAll']){_0x5980c4[_0xa15e('0x43')]=[{'all':!![]}];}return db[_0xa15e('0x2f')][_0xa15e('0x44')](_0x5980c4);})[_0xa15e('0x26')](function(_0x3db5a4){_0x30c570[_0xa15e('0x45')]=_0x3db5a4;return _0x30c570;})[_0xa15e('0x26')](respondWithFilteredResult(_0x21e6d0,_0x5980c4))['catch'](handleError(_0x21e6d0,null));};exports['show']=function(_0x1941bb,_0x2cde86){var _0x2d4956={'raw':!![],'where':{'id':_0x1941bb[_0xa15e('0x46')]['id']}},_0x46ae3c={};_0x46ae3c[_0xa15e('0x32')]=_[_0xa15e('0x35')](db[_0xa15e('0x2f')][_0xa15e('0x30')]);_0x46ae3c[_0xa15e('0x34')]=_[_0xa15e('0x35')](_0x1941bb['query']);_0x46ae3c[_0xa15e('0x36')]=_['intersection'](_0x46ae3c[_0xa15e('0x32')],_0x46ae3c[_0xa15e('0x34')]);_0x2d4956['attributes']=_[_0xa15e('0x47')](_0x46ae3c['model'],qs[_0xa15e('0x38')](_0x1941bb[_0xa15e('0x34')]['fields']));_0x2d4956[_0xa15e('0x37')]=_0x2d4956['attributes'][_0xa15e('0x39')]?_0x2d4956['attributes']:_0x46ae3c[_0xa15e('0x32')];if(_0x1941bb[_0xa15e('0x34')][_0xa15e('0x48')]){_0x2d4956['include']=[{'all':!![]}];}_0x2d4956=_['merge']({},_0x2d4956,_0x1941bb['options']);return db[_0xa15e('0x2f')][_0xa15e('0x49')](_0x2d4956)[_0xa15e('0x26')](handleEntityNotFound(_0x2cde86,null))[_0xa15e('0x26')](respondWithResult(_0x2cde86,null))[_0xa15e('0x4a')](handleError(_0x2cde86,null));};exports[_0xa15e('0x4b')]=function(_0x54a703,_0x134aa6){return db[_0xa15e('0x2f')][_0xa15e('0x4b')](_0x54a703[_0xa15e('0x4c')],{})['then'](function(_0x19744b){var _0x478e34=_0x54a703['user']['get']({'plain':!![]});if(!_0x478e34)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x478e34[_0xa15e('0x4d')]==='user'){var _0x145b06=_0x19744b['get']({'plain':!![]});var _0x5d9743=_0xa15e('0x29');return db[_0xa15e('0x4e')][_0xa15e('0x49')]({'where':{'name':_0x5d9743,'userProfileId':_0x478e34[_0xa15e('0x4f')]},'raw':!![]})[_0xa15e('0x26')](function(_0x5326f7){if(_0x5326f7&&_0x5326f7[_0xa15e('0x50')]===0x0){return db[_0xa15e('0x2a')][_0xa15e('0x4b')]({'name':_0x145b06[_0xa15e('0x2d')],'resourceId':_0x145b06['id'],'type':_0x5326f7[_0xa15e('0x2d')],'sectionId':_0x5326f7['id']},{})[_0xa15e('0x26')](function(){return _0x19744b;});}else{return _0x19744b;}})[_0xa15e('0x4a')](function(_0x342a06){logger[_0xa15e('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x342a06);throw _0x342a06;});}return _0x19744b;})[_0xa15e('0x26')](respondWithResult(_0x134aa6,0xc9))[_0xa15e('0x4a')](handleError(_0x134aa6,null));};exports[_0xa15e('0x25')]=function(_0x3dac89,_0x2e78fa){if(_0x3dac89[_0xa15e('0x4c')]['id']){delete _0x3dac89[_0xa15e('0x4c')]['id'];}return db[_0xa15e('0x2f')][_0xa15e('0x49')]({'where':{'id':_0x3dac89[_0xa15e('0x46')]['id']}})[_0xa15e('0x26')](handleEntityNotFound(_0x2e78fa,null))['then'](saveUpdates(_0x3dac89[_0xa15e('0x4c')],null))['then'](respondWithResult(_0x2e78fa,null))[_0xa15e('0x4a')](handleError(_0x2e78fa,null));};exports[_0xa15e('0x27')]=function(_0x4deeda,_0x302c83){return db[_0xa15e('0x2f')][_0xa15e('0x49')]({'where':{'id':_0x4deeda[_0xa15e('0x46')]['id']}})['then'](handleEntityNotFound(_0x302c83,null))['then'](removeEntity(_0x302c83,null))['catch'](handleError(_0x302c83,null));};exports['describe']=function(_0xe90fde,_0x2cd18b){return db['WhatsappQueue'][_0xa15e('0x52')]()[_0xa15e('0x26')](respondWithResult(_0x2cd18b,null))[_0xa15e('0x4a')](handleError(_0x2cd18b,null));};exports[_0xa15e('0x53')]=function(_0x517121,_0x207649,_0x53fb5f){var _0x5091fe={'raw':!![],'where':{}},_0x105290={},_0x22ffc0;return db['WhatsappQueue'][_0xa15e('0x54')]({'where':{'id':_0x517121[_0xa15e('0x46')]['id']}})[_0xa15e('0x26')](handleEntityNotFound(_0x207649,null))[_0xa15e('0x26')](function(_0x27f77c){if(_0x27f77c){_0x22ffc0=_0x27f77c[_0xa15e('0x28')]({'plain':!![]});_0x105290['model']=_['keys'](db[_0xa15e('0x55')][_0xa15e('0x30')]);_0x105290['query']=_[_0xa15e('0x35')](_0x517121['query']);_0x105290['filters']=_['intersection'](_0x105290[_0xa15e('0x32')],_0x105290['query']);_0x5091fe[_0xa15e('0x37')]=_[_0xa15e('0x47')](_0x105290[_0xa15e('0x32')],qs[_0xa15e('0x38')](_0x517121[_0xa15e('0x34')]['fields']));_0x5091fe[_0xa15e('0x37')]=_0x5091fe[_0xa15e('0x37')]['length']?_0x5091fe[_0xa15e('0x37')]:_0x105290['model'];if(!_0x517121[_0xa15e('0x34')]['hasOwnProperty'](_0xa15e('0x56'))){_0x5091fe[_0xa15e('0x1e')]=qs[_0xa15e('0x1e')](_0x517121[_0xa15e('0x34')][_0xa15e('0x1e')]);_0x5091fe[_0xa15e('0x1d')]=qs['offset'](_0x517121[_0xa15e('0x34')]['offset']);}_0x5091fe['order']=qs[_0xa15e('0x3c')](_0x517121['query'][_0xa15e('0x3c')]);_0x5091fe[_0xa15e('0x3f')]=qs[_0xa15e('0x36')](_[_0xa15e('0x3d')](_0x517121['query'],_0x105290['filters']));_0x5091fe['where'][_0xa15e('0x57')]=_0x27f77c['id'];if(_0x517121[_0xa15e('0x34')][_0xa15e('0x3e')]){_0x5091fe[_0xa15e('0x3f')]=_[_0xa15e('0x40')](_0x5091fe[_0xa15e('0x3f')],{'$or':_[_0xa15e('0x33')](_0x5091fe[_0xa15e('0x37')],function(_0x8fece4){var _0x3f143d={};_0x3f143d[_0x8fece4]={'$like':'%'+_0x517121[_0xa15e('0x34')]['filter']+'%'};return _0x3f143d;})});}_0x5091fe=_[_0xa15e('0x40')]({},_0x5091fe,_0x517121[_0xa15e('0x42')]);return db[_0xa15e('0x55')]['findAll'](_0x5091fe);}})[_0xa15e('0x26')](function(_0x11d4e0){if(_0x11d4e0){return db[_0xa15e('0x58')][_0xa15e('0x59')]({'where':{'id':_[_0xa15e('0x33')](_0x11d4e0,'UserId'),'role':_0xa15e('0x5a')},'attributes':['id',_0xa15e('0x2d'),_0xa15e('0x5b'),_0xa15e('0x5c'),'createdAt']});}})['then'](function(_0xb9078a){if(_0xb9078a){return{'count':_0xb9078a[_0xa15e('0x20')],'rows':_['map'](_0xb9078a[_0xa15e('0x45')],function(_0x447d17){return{'membername':_0x447d17['name'],'UserId':_0x447d17['id'],'queue_name':_0x22ffc0[_0xa15e('0x2d')],'WhatsappQueueId':_0x22ffc0['id'],'interface':util[_0xa15e('0x5d')](_0xa15e('0x5e'),_0xa15e('0x5f'),_0x447d17[_0xa15e('0x2d')]),'penalty':0x0,'paused':_0x447d17[_0xa15e('0x5b')],'createdAt':_0x447d17[_0xa15e('0x60')],'updatedAt':_0x447d17[_0xa15e('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa15e('0x26')](respondWithFilteredResult(_0x207649,_0x5091fe))[_0xa15e('0x4a')](handleError(_0x207649,null));};exports[_0xa15e('0x61')]=function(_0x437460,_0x30cc44,_0x10c8fc){var _0x2a409b={};var _0x5f0482={};var _0x462dcf;var _0x2e2724;return db[_0xa15e('0x2f')][_0xa15e('0x54')]({'where':{'id':_0x437460[_0xa15e('0x46')]['id']}})['then'](handleEntityNotFound(_0x30cc44,null))[_0xa15e('0x26')](function(_0x485092){if(_0x485092){_0x462dcf=_0x485092;_0x5f0482[_0xa15e('0x32')]=_[_0xa15e('0x35')](db[_0xa15e('0x62')][_0xa15e('0x30')]);_0x5f0482['query']=_['keys'](_0x437460[_0xa15e('0x34')]);_0x5f0482[_0xa15e('0x36')]=_[_0xa15e('0x47')](_0x5f0482[_0xa15e('0x32')],_0x5f0482[_0xa15e('0x34')]);_0x2a409b[_0xa15e('0x37')]=_['intersection'](_0x5f0482[_0xa15e('0x32')],qs[_0xa15e('0x38')](_0x437460['query']['fields']));_0x2a409b['attributes']=_0x2a409b[_0xa15e('0x37')][_0xa15e('0x39')]?_0x2a409b[_0xa15e('0x37')]:_0x5f0482[_0xa15e('0x32')];_0x2a409b[_0xa15e('0x3b')]=qs[_0xa15e('0x3c')](_0x437460[_0xa15e('0x34')][_0xa15e('0x3c')]);_0x2a409b['where']=qs[_0xa15e('0x36')](_[_0xa15e('0x3d')](_0x437460[_0xa15e('0x34')],_0x5f0482[_0xa15e('0x36')]));if(_0x437460[_0xa15e('0x34')][_0xa15e('0x3e')]){_0x2a409b[_0xa15e('0x3f')]=_[_0xa15e('0x40')](_0x2a409b['where'],{'$or':_[_0xa15e('0x33')](_0x2a409b[_0xa15e('0x37')],function(_0x4946e4){var _0x348910={};_0x348910[_0x4946e4]={'$like':'%'+_0x437460[_0xa15e('0x34')]['filter']+'%'};return _0x348910;})});}_0x2a409b=_[_0xa15e('0x40')]({},_0x2a409b,_0x437460[_0xa15e('0x42')]);return _0x462dcf[_0xa15e('0x61')](_0x2a409b);}})[_0xa15e('0x26')](function(_0x2dee8e){if(_0x2dee8e){_0x2e2724=_0x2dee8e[_0xa15e('0x39')];if(!_0x437460[_0xa15e('0x34')][_0xa15e('0x3a')]('nolimit')){_0x2a409b[_0xa15e('0x1e')]=qs[_0xa15e('0x1e')](_0x437460[_0xa15e('0x34')][_0xa15e('0x1e')]);_0x2a409b[_0xa15e('0x1d')]=qs[_0xa15e('0x1d')](_0x437460[_0xa15e('0x34')][_0xa15e('0x1d')]);}return _0x462dcf[_0xa15e('0x61')](_0x2a409b);}})[_0xa15e('0x26')](function(_0x5aa75c){if(_0x5aa75c){return _0x5aa75c?{'count':_0x2e2724,'rows':_0x5aa75c}:null;}})[_0xa15e('0x26')](respondWithResult(_0x30cc44,null))[_0xa15e('0x4a')](handleError(_0x30cc44,null));};exports[_0xa15e('0x63')]=function(_0x298deb,_0x5f4fa9,_0x594142){var _0x3a6d33=_0x298deb[_0xa15e('0x4c')]['ids'];return db[_0xa15e('0x62')][_0xa15e('0x44')]({'where':{'id':_0x3a6d33},'attributes':['id'],'include':[{'model':db[_0xa15e('0x58')],'as':_0xa15e('0x64'),'attributes':['id','name',_0xa15e('0x65'),_0xa15e('0x66'),'interface'],'raw':!![]}]})[_0xa15e('0x26')](function(_0x18526c){if(_0x18526c){var _0x2f9a28=_[_0xa15e('0x67')](_0x18526c,function(_0x166606){var _0x117ea8=_0x166606['get']({'plain':!![]});return _0x117ea8['Agents'];});return db[_0xa15e('0x2f')][_0xa15e('0x49')]({'where':{'id':_0x298deb['params']['id']}})[_0xa15e('0x26')](function(_0x1035cf){return db[_0xa15e('0x68')][_0xa15e('0x69')](function(_0x1b4092){return _0x1035cf['addTeams'](_0x3a6d33,{'transaction':_0x1b4092})[_0xa15e('0x26')](function(){return BPromise['each'](_0x2f9a28,function(_0x596556){return db[_0xa15e('0x55')][_0xa15e('0x6a')]({'where':{'UserId':_0x596556['id'],'WhatsappQueueId':_0x298deb[_0xa15e('0x46')]['id']},'transaction':_0x1b4092});});})['then'](function(){_0x2f9a28[_0xa15e('0x6b')](function(_0x3cd8f5){socket[_0xa15e('0x6c')](_0xa15e('0x6d'),{'UserId':_0x3cd8f5['id'],'WhatsappQueueId':_0x1035cf['id']});});});});});}})[_0xa15e('0x26')](respondWithStatusCode(_0x5f4fa9,null))[_0xa15e('0x4a')](handleError(_0x5f4fa9,null));};exports[_0xa15e('0x6e')]=function(_0xc88eb5,_0x1ee8bf,_0xce15e5){return db[_0xa15e('0x62')][_0xa15e('0x44')]({'where':{'id':_0xc88eb5[_0xa15e('0x34')][_0xa15e('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xa15e('0x58')],'as':_0xa15e('0x64'),'attributes':['id'],'raw':!![]}]})[_0xa15e('0x26')](handleEntityNotFound(_0x1ee8bf,null))[_0xa15e('0x26')](function(_0x13f9b1){var _0x57e409=_[_0xa15e('0x33')](_0x13f9b1,'id');var _0xf97502=[];var _0x1a0dbc=[];var _0x2132ec=squel[_0xa15e('0x70')]();_0x2132ec[_0xa15e('0x71')](_0xa15e('0x72'))[_0xa15e('0x73')](_0xa15e('0x74'),'tq')[_0xa15e('0x75')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xa15e('0x76'),_0xc88eb5['params']['id']);for(var _0x4efcbd=0x0;_0x4efcbd<_0x13f9b1[_0xa15e('0x39')];_0x4efcbd+=0x1){let _0x40570e=_0x13f9b1[_0x4efcbd];for(var _0x367b70=0x0;_0x367b70<_0x40570e['Agents'][_0xa15e('0x39')];_0x367b70+=0x1){let _0x4e9da3=_0x40570e['Agents'][_0x367b70];var _0x2a56bd=_0x2132ec[_0xa15e('0x77')]();_0x2a56bd['where']('ut.UserId\x20=\x20?',_0x4e9da3['id']);_0x1a0dbc[_0xa15e('0x78')](db['sequelize'][_0xa15e('0x34')](_0x2a56bd['toString'](),{'type':db[_0xa15e('0x68')][_0xa15e('0x79')][_0xa15e('0x7a')]})[_0xa15e('0x26')](function(_0x299450){if(_0x299450['length']===0x1){return _0x4e9da3['id'];}else{var _0x3f215e=_[_0xa15e('0x7b')](_[_0xa15e('0x33')](_0x299450,'TeamId'),function(_0x3d6392){return _[_0xa15e('0x7c')](_0x57e409,_0x3d6392);});if(_0x3f215e){return _0x4e9da3['id'];}}}));}}return BPromise[_0xa15e('0x7d')](_0x1a0dbc)[_0xa15e('0x26')](function(_0x5a496f){_0xf97502=_(_0xf97502)[_0xa15e('0x7e')](_0x5a496f)['compact']()[_0xa15e('0x7f')]();return db['WhatsappQueue']['find']({'where':{'id':_0xc88eb5['params']['id']}})[_0xa15e('0x26')](function(_0xc3253){return db['sequelize']['transaction'](function(_0xc3b317){return _0xc3253[_0xa15e('0x6e')](_0xc88eb5[_0xa15e('0x34')][_0xa15e('0x6f')],{'transaction':_0xc3b317})[_0xa15e('0x26')](function(){if(!_['isEmpty'](_0xf97502)){return _0xc3253[_0xa15e('0x80')](_0xf97502,{'transaction':_0xc3b317});}})[_0xa15e('0x26')](function(){_0xf97502[_0xa15e('0x6b')](function(_0x432d65){socket[_0xa15e('0x6c')]('userWhatsappQueue:remove',{'UserId':_0x432d65,'WhatsappQueueId':_0xc3253['id']});});});});});});})['then'](respondWithStatusCode(_0x1ee8bf,null))[_0xa15e('0x4a')](handleError(_0x1ee8bf,null));};exports[_0xa15e('0x81')]=function(_0x28d330,_0x832db8,_0x166a46){return db[_0xa15e('0x2f')][_0xa15e('0x49')]({'where':{'id':_0x28d330[_0xa15e('0x46')]['id']}})[_0xa15e('0x26')](handleEntityNotFound(_0x832db8,null))[_0xa15e('0x26')](function(_0x3af131){if(_0x3af131){return _0x3af131[_0xa15e('0x81')](_0x28d330['body'][_0xa15e('0x6f')],_[_0xa15e('0x82')](_0x28d330[_0xa15e('0x4c')],[_0xa15e('0x6f'),'id'])||{})[_0xa15e('0x83')](function(_0x1dd9a8){for(var _0x181ebf=0x0;_0x181ebf<_0x28d330[_0xa15e('0x4c')][_0xa15e('0x6f')][_0xa15e('0x39')];_0x181ebf+=0x1){socket[_0xa15e('0x6c')](_0xa15e('0x6d'),{'UserId':Number(_0x28d330[_0xa15e('0x4c')]['ids'][_0x181ebf]),'WhatsappQueueId':Number(_0x28d330[_0xa15e('0x46')]['id'])});}return _0x1dd9a8;});}})[_0xa15e('0x26')](respondWithResult(_0x832db8,null))['catch'](handleError(_0x832db8,null));};exports[_0xa15e('0x80')]=function(_0x2a2208,_0x730eb0,_0x2316ac){return db['WhatsappQueue'][_0xa15e('0x49')]({'where':{'id':_0x2a2208[_0xa15e('0x46')]['id']}})[_0xa15e('0x26')](handleEntityNotFound(_0x730eb0,null))['then'](function(_0xe7eb90){if(_0xe7eb90){return _0xe7eb90['removeAgents'](_0x2a2208[_0xa15e('0x34')][_0xa15e('0x6f')])[_0xa15e('0x26')](function(){if(_[_0xa15e('0x84')](_0x2a2208[_0xa15e('0x34')][_0xa15e('0x6f')])){for(var _0x124bf7=0x0;_0x124bf7<_0x2a2208[_0xa15e('0x34')][_0xa15e('0x6f')][_0xa15e('0x39')];_0x124bf7+=0x1){socket[_0xa15e('0x6c')](_0xa15e('0x85'),{'UserId':Number(_0x2a2208[_0xa15e('0x34')]['ids'][_0x124bf7]),'WhatsappQueueId':Number(_0x2a2208[_0xa15e('0x46')]['id'])});}}else{socket[_0xa15e('0x6c')](_0xa15e('0x85'),{'UserId':Number(_0x2a2208[_0xa15e('0x34')][_0xa15e('0x6f')]),'WhatsappQueueId':Number(_0x2a2208[_0xa15e('0x46')]['id'])});}});}})[_0xa15e('0x26')](respondWithStatusCode(_0x730eb0,null))['catch'](handleError(_0x730eb0,null));};exports['getAgents']=function(_0x184c37,_0x26990,_0x5b1534){var _0x4d1a1d={};var _0x242b30={};var _0x18be05;var _0x15e19e;return db[_0xa15e('0x2f')][_0xa15e('0x54')]({'where':{'id':_0x184c37[_0xa15e('0x46')]['id']}})[_0xa15e('0x26')](handleEntityNotFound(_0x26990,null))[_0xa15e('0x26')](function(_0x2bbc6f){if(_0x2bbc6f){_0x18be05=_0x2bbc6f;_0x242b30['model']=_['keys'](db[_0xa15e('0x58')][_0xa15e('0x30')]);_0x242b30[_0xa15e('0x34')]=_['keys'](_0x184c37[_0xa15e('0x34')]);_0x242b30[_0xa15e('0x36')]=_['intersection'](_0x242b30[_0xa15e('0x32')],_0x242b30[_0xa15e('0x34')]);_0x4d1a1d['attributes']=_[_0xa15e('0x47')](_0x242b30['model'],qs['fields'](_0x184c37['query'][_0xa15e('0x38')]));_0x4d1a1d[_0xa15e('0x37')]=_0x4d1a1d[_0xa15e('0x37')]['length']?_0x4d1a1d['attributes']:_0x242b30['model'];_0x4d1a1d['order']=qs[_0xa15e('0x3c')](_0x184c37[_0xa15e('0x34')][_0xa15e('0x3c')]);_0x4d1a1d['where']=qs[_0xa15e('0x36')](_[_0xa15e('0x3d')](_0x184c37[_0xa15e('0x34')],_0x242b30[_0xa15e('0x36')]));if(_0x184c37['query'][_0xa15e('0x3e')]){_0x4d1a1d[_0xa15e('0x3f')]=_[_0xa15e('0x40')](_0x4d1a1d[_0xa15e('0x3f')],{'$or':_['map'](_0x4d1a1d[_0xa15e('0x37')],function(_0x1c4273){var _0x42d03b={};_0x42d03b[_0x1c4273]={'$like':'%'+_0x184c37['query'][_0xa15e('0x3e')]+'%'};return _0x42d03b;})});}_0x4d1a1d=_[_0xa15e('0x40')]({},_0x4d1a1d,_0x184c37[_0xa15e('0x42')]);return _0x18be05[_0xa15e('0x86')](_0x4d1a1d);}})[_0xa15e('0x26')](function(_0x40d887){if(_0x40d887){_0x15e19e=_0x40d887[_0xa15e('0x39')];if(!_0x184c37[_0xa15e('0x34')][_0xa15e('0x3a')](_0xa15e('0x56'))){_0x4d1a1d[_0xa15e('0x1e')]=qs[_0xa15e('0x1e')](_0x184c37[_0xa15e('0x34')][_0xa15e('0x1e')]);_0x4d1a1d[_0xa15e('0x1d')]=qs[_0xa15e('0x1d')](_0x184c37[_0xa15e('0x34')][_0xa15e('0x1d')]);}return _0x18be05[_0xa15e('0x86')](_0x4d1a1d);}})[_0xa15e('0x26')](function(_0x37f717){if(_0x37f717){return _0x37f717?{'count':_0x15e19e,'rows':_0x37f717}:null;}})[_0xa15e('0x26')](respondWithResult(_0x26990,null))[_0xa15e('0x4a')](handleError(_0x26990,null));}; \ No newline at end of file +var _0xdd21=['WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','includeAll','include','WhatsappQueue','findAll','rows','show','params','options','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','keys','UserWhatsappQueue','order','WhatsappQueueId','merge','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','whatsappPause','getTeams','addTeams','ids','Team','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','json','update','destroy','then'];(function(_0x1c1b22,_0xe6f01b){var _0x2c93f6=function(_0x308167){while(--_0x308167){_0x1c1b22['push'](_0x1c1b22['shift']());}};_0x2c93f6(++_0xe6f01b);}(_0xdd21,0x69));var _0x1dd2=function(_0x48652a,_0x357913){_0x48652a=_0x48652a-0x0;var _0x1b0201=_0xdd21[_0x48652a];return _0x1b0201;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1dd2('0x0'));var zipdir=require(_0x1dd2('0x1'));var jsonpatch=require(_0x1dd2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1dd2('0x3'));var Mustache=require(_0x1dd2('0x4'));var util=require(_0x1dd2('0x5'));var path=require('path');var sox=require(_0x1dd2('0x6'));var csv=require('to-csv');var ejs=require(_0x1dd2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1dd2('0x8'));var squel=require(_0x1dd2('0x9'));var crypto=require('crypto');var jsforce=require(_0x1dd2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1dd2('0xb'));var querystring=require('querystring');var Papa=require(_0x1dd2('0xc'));var Redis=require(_0x1dd2('0xd'));var authService=require(_0x1dd2('0xe'));var qs=require(_0x1dd2('0xf'));var as=require(_0x1dd2('0x10'));var hardwareService=require(_0x1dd2('0x11'));var logger=require(_0x1dd2('0x12'))(_0x1dd2('0x13'));var utils=require(_0x1dd2('0x14'));var config=require(_0x1dd2('0x15'));var licenseUtil=require(_0x1dd2('0x16'));var db=require(_0x1dd2('0x17'))['db'];config[_0x1dd2('0x18')]=_[_0x1dd2('0x19')](config[_0x1dd2('0x18')],{'host':_0x1dd2('0x1a'),'port':0x18eb});var socket=require(_0x1dd2('0x1b'))(new Redis(config[_0x1dd2('0x18')]));require('./whatsappQueue.socket')[_0x1dd2('0x1c')](socket);function respondWithStatusCode(_0xf746f4,_0x3df61c){_0x3df61c=_0x3df61c||0xcc;return function(_0x1da7ce){if(_0x1da7ce){return _0xf746f4[_0x1dd2('0x1d')](_0x3df61c);}return _0xf746f4[_0x1dd2('0x1e')](_0x3df61c)[_0x1dd2('0x1f')]();};}function respondWithResult(_0x108883,_0x39b7de){_0x39b7de=_0x39b7de||0xc8;return function(_0x1e9dcc){if(_0x1e9dcc){return _0x108883['status'](_0x39b7de)['json'](_0x1e9dcc);}};}function respondWithFilteredResult(_0x2f6e5a,_0x2fe76d){return function(_0x36601f){if(_0x36601f){var _0xdf8ce1=typeof _0x2fe76d[_0x1dd2('0x20')]===_0x1dd2('0x21')&&typeof _0x2fe76d[_0x1dd2('0x22')]===_0x1dd2('0x21');var _0x13abde=_0x36601f[_0x1dd2('0x23')];var _0x3094f9=_0xdf8ce1?0x0:_0x2fe76d[_0x1dd2('0x20')];var _0x45954d=_0xdf8ce1?_0x36601f[_0x1dd2('0x23')]:_0x2fe76d['offset']+_0x2fe76d['limit'];var _0x2e12d3;if(_0x45954d>=_0x13abde){_0x45954d=_0x13abde;_0x2e12d3=0xc8;}else{_0x2e12d3=0xce;}_0x2f6e5a[_0x1dd2('0x1e')](_0x2e12d3);return _0x2f6e5a['set']('Content-Range',_0x3094f9+'-'+_0x45954d+'/'+_0x13abde)[_0x1dd2('0x24')](_0x36601f);}return null;};}function patchUpdates(_0x5aa3b1){return function(_0x2a29b2){try{jsonpatch['apply'](_0x2a29b2,_0x5aa3b1,!![]);}catch(_0x174dbb){return BPromise['reject'](_0x174dbb);}return _0x2a29b2['save']();};}function saveUpdates(_0x32bce6,_0x4f293b){return function(_0x42ac2d){if(_0x42ac2d){return _0x42ac2d[_0x1dd2('0x25')](_0x32bce6)['then'](function(_0x41fc81){return _0x41fc81;});}return null;};}function removeEntity(_0x45ddbd,_0xdf69f0){return function(_0xdcf7c8){if(_0xdcf7c8){return _0xdcf7c8[_0x1dd2('0x26')]()[_0x1dd2('0x27')](function(){var _0x4c9d5e=_0xdcf7c8['get']({'plain':!![]});var _0x419e25=_0x1dd2('0x28');return db[_0x1dd2('0x29')][_0x1dd2('0x26')]({'where':{'type':_0x419e25,'resourceId':_0x4c9d5e['id']}})['then'](function(){return _0xdcf7c8;});})[_0x1dd2('0x27')](function(){_0x45ddbd['status'](0xcc)[_0x1dd2('0x1f')]();});}};}function handleEntityNotFound(_0x41eead,_0x4e1f1a){return function(_0x452096){if(!_0x452096){_0x41eead[_0x1dd2('0x1d')](0x194);}return _0x452096;};}function handleError(_0x285d42,_0x513f1d){_0x513f1d=_0x513f1d||0x1f4;return function(_0xe28e2){logger[_0x1dd2('0x2a')](_0xe28e2[_0x1dd2('0x2b')]);if(_0xe28e2['name']){delete _0xe28e2[_0x1dd2('0x2c')];}_0x285d42['status'](_0x513f1d)[_0x1dd2('0x2d')](_0xe28e2);};}exports[_0x1dd2('0x2e')]=function(_0x465dfc,_0x54d108){var _0x2722ef={},_0x467b3d={},_0x57a58b={'count':0x0,'rows':[]};var _0x171167=_[_0x1dd2('0x2f')](db['WhatsappQueue'][_0x1dd2('0x30')],function(_0x406cc3){return{'name':_0x406cc3[_0x1dd2('0x31')],'type':_0x406cc3[_0x1dd2('0x32')][_0x1dd2('0x33')]};});_0x467b3d[_0x1dd2('0x34')]=_[_0x1dd2('0x2f')](_0x171167,_0x1dd2('0x2c'));_0x467b3d['query']=_['keys'](_0x465dfc['query']);_0x467b3d[_0x1dd2('0x35')]=_[_0x1dd2('0x36')](_0x467b3d[_0x1dd2('0x34')],_0x467b3d[_0x1dd2('0x37')]);_0x2722ef['attributes']=_[_0x1dd2('0x36')](_0x467b3d[_0x1dd2('0x34')],qs[_0x1dd2('0x38')](_0x465dfc[_0x1dd2('0x37')][_0x1dd2('0x38')]));_0x2722ef[_0x1dd2('0x39')]=_0x2722ef[_0x1dd2('0x39')][_0x1dd2('0x3a')]?_0x2722ef[_0x1dd2('0x39')]:_0x467b3d[_0x1dd2('0x34')];if(!_0x465dfc['query'][_0x1dd2('0x3b')](_0x1dd2('0x3c'))){_0x2722ef[_0x1dd2('0x22')]=qs[_0x1dd2('0x22')](_0x465dfc[_0x1dd2('0x37')]['limit']);_0x2722ef[_0x1dd2('0x20')]=qs[_0x1dd2('0x20')](_0x465dfc[_0x1dd2('0x37')][_0x1dd2('0x20')]);}_0x2722ef['order']=qs[_0x1dd2('0x3d')](_0x465dfc[_0x1dd2('0x37')]['sort']);_0x2722ef['where']=qs[_0x1dd2('0x35')](_[_0x1dd2('0x3e')](_0x465dfc['query'],_0x467b3d['filters']),_0x171167);if(_0x465dfc[_0x1dd2('0x37')][_0x1dd2('0x3f')]){_0x2722ef[_0x1dd2('0x40')]=_['merge'](_0x2722ef[_0x1dd2('0x40')],{'$or':_[_0x1dd2('0x2f')](_0x171167,function(_0x27e7ad){if(_0x27e7ad[_0x1dd2('0x32')]!=='VIRTUAL'){var _0x459d8b={};_0x459d8b[_0x27e7ad[_0x1dd2('0x2c')]]={'$like':'%'+_0x465dfc[_0x1dd2('0x37')][_0x1dd2('0x3f')]+'%'};return _0x459d8b;}})});}_0x2722ef=_['merge']({},_0x2722ef,_0x465dfc['options']);var _0x41cb2b={'where':_0x2722ef['where']};return db['WhatsappQueue']['count'](_0x41cb2b)[_0x1dd2('0x27')](function(_0x11a63c){_0x57a58b['count']=_0x11a63c;if(_0x465dfc[_0x1dd2('0x37')][_0x1dd2('0x41')]){_0x2722ef[_0x1dd2('0x42')]=[{'all':!![]}];}return db[_0x1dd2('0x43')][_0x1dd2('0x44')](_0x2722ef);})['then'](function(_0x186fcd){_0x57a58b[_0x1dd2('0x45')]=_0x186fcd;return _0x57a58b;})['then'](respondWithFilteredResult(_0x54d108,_0x2722ef))['catch'](handleError(_0x54d108,null));};exports[_0x1dd2('0x46')]=function(_0x24f443,_0x1b1d9f){var _0x11e5fe={'raw':!![],'where':{'id':_0x24f443[_0x1dd2('0x47')]['id']}},_0x463dac={};_0x463dac[_0x1dd2('0x34')]=_['keys'](db['WhatsappQueue']['rawAttributes']);_0x463dac[_0x1dd2('0x37')]=_['keys'](_0x24f443[_0x1dd2('0x37')]);_0x463dac[_0x1dd2('0x35')]=_[_0x1dd2('0x36')](_0x463dac['model'],_0x463dac['query']);_0x11e5fe[_0x1dd2('0x39')]=_['intersection'](_0x463dac[_0x1dd2('0x34')],qs['fields'](_0x24f443['query'][_0x1dd2('0x38')]));_0x11e5fe[_0x1dd2('0x39')]=_0x11e5fe[_0x1dd2('0x39')][_0x1dd2('0x3a')]?_0x11e5fe[_0x1dd2('0x39')]:_0x463dac[_0x1dd2('0x34')];if(_0x24f443[_0x1dd2('0x37')][_0x1dd2('0x41')]){_0x11e5fe[_0x1dd2('0x42')]=[{'all':!![]}];}_0x11e5fe=_['merge']({},_0x11e5fe,_0x24f443[_0x1dd2('0x48')]);return db[_0x1dd2('0x43')][_0x1dd2('0x49')](_0x11e5fe)[_0x1dd2('0x27')](handleEntityNotFound(_0x1b1d9f,null))[_0x1dd2('0x27')](respondWithResult(_0x1b1d9f,null))[_0x1dd2('0x4a')](handleError(_0x1b1d9f,null));};exports['create']=function(_0x51d5f5,_0x4444a6){return db['WhatsappQueue'][_0x1dd2('0x4b')](_0x51d5f5['body'],{})[_0x1dd2('0x27')](function(_0x2291de){var _0x5ae152=_0x51d5f5[_0x1dd2('0x4c')][_0x1dd2('0x4d')]({'plain':!![]});if(!_0x5ae152)throw new Error(_0x1dd2('0x4e'));if(_0x5ae152[_0x1dd2('0x4f')]==='user'){var _0xf14365=_0x2291de[_0x1dd2('0x4d')]({'plain':!![]});var _0x3a1c2c=_0x1dd2('0x28');return db[_0x1dd2('0x50')][_0x1dd2('0x49')]({'where':{'name':_0x3a1c2c,'userProfileId':_0x5ae152[_0x1dd2('0x51')]},'raw':!![]})['then'](function(_0x16327b){if(_0x16327b&&_0x16327b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xf14365[_0x1dd2('0x2c')],'resourceId':_0xf14365['id'],'type':_0x16327b[_0x1dd2('0x2c')],'sectionId':_0x16327b['id']},{})[_0x1dd2('0x27')](function(){return _0x2291de;});}else{return _0x2291de;}})[_0x1dd2('0x4a')](function(_0x92517b){logger['error'](_0x1dd2('0x52'),_0x92517b);throw _0x92517b;});}return _0x2291de;})[_0x1dd2('0x27')](respondWithResult(_0x4444a6,0xc9))[_0x1dd2('0x4a')](handleError(_0x4444a6,null));};exports['update']=function(_0x2e294c,_0x39437c){if(_0x2e294c[_0x1dd2('0x53')]['id']){delete _0x2e294c[_0x1dd2('0x53')]['id'];}return db[_0x1dd2('0x43')][_0x1dd2('0x49')]({'where':{'id':_0x2e294c[_0x1dd2('0x47')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x39437c,null))[_0x1dd2('0x27')](saveUpdates(_0x2e294c[_0x1dd2('0x53')],null))['then'](respondWithResult(_0x39437c,null))[_0x1dd2('0x4a')](handleError(_0x39437c,null));};exports['destroy']=function(_0x4aaa49,_0xa5d472){return db[_0x1dd2('0x43')][_0x1dd2('0x49')]({'where':{'id':_0x4aaa49[_0x1dd2('0x47')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0xa5d472,null))[_0x1dd2('0x27')](removeEntity(_0xa5d472,null))[_0x1dd2('0x4a')](handleError(_0xa5d472,null));};exports[_0x1dd2('0x54')]=function(_0x367fca,_0x3024a0){return db[_0x1dd2('0x43')][_0x1dd2('0x54')]()[_0x1dd2('0x27')](respondWithResult(_0x3024a0,null))[_0x1dd2('0x4a')](handleError(_0x3024a0,null));};exports[_0x1dd2('0x55')]=function(_0x3bdcb9,_0x248deb,_0x4bba38){var _0x41a509={'raw':!![],'where':{}},_0x2bd96a={},_0x2da246;return db[_0x1dd2('0x43')][_0x1dd2('0x56')]({'where':{'id':_0x3bdcb9[_0x1dd2('0x47')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x248deb,null))[_0x1dd2('0x27')](function(_0x1ba3ee){if(_0x1ba3ee){_0x2da246=_0x1ba3ee['get']({'plain':!![]});_0x2bd96a[_0x1dd2('0x34')]=_[_0x1dd2('0x57')](db[_0x1dd2('0x58')][_0x1dd2('0x30')]);_0x2bd96a[_0x1dd2('0x37')]=_[_0x1dd2('0x57')](_0x3bdcb9[_0x1dd2('0x37')]);_0x2bd96a[_0x1dd2('0x35')]=_['intersection'](_0x2bd96a[_0x1dd2('0x34')],_0x2bd96a[_0x1dd2('0x37')]);_0x41a509[_0x1dd2('0x39')]=_[_0x1dd2('0x36')](_0x2bd96a['model'],qs[_0x1dd2('0x38')](_0x3bdcb9[_0x1dd2('0x37')][_0x1dd2('0x38')]));_0x41a509[_0x1dd2('0x39')]=_0x41a509[_0x1dd2('0x39')][_0x1dd2('0x3a')]?_0x41a509[_0x1dd2('0x39')]:_0x2bd96a[_0x1dd2('0x34')];if(!_0x3bdcb9[_0x1dd2('0x37')]['hasOwnProperty'](_0x1dd2('0x3c'))){_0x41a509[_0x1dd2('0x22')]=qs['limit'](_0x3bdcb9['query']['limit']);_0x41a509['offset']=qs[_0x1dd2('0x20')](_0x3bdcb9[_0x1dd2('0x37')][_0x1dd2('0x20')]);}_0x41a509[_0x1dd2('0x59')]=qs[_0x1dd2('0x3d')](_0x3bdcb9['query']['sort']);_0x41a509['where']=qs[_0x1dd2('0x35')](_[_0x1dd2('0x3e')](_0x3bdcb9[_0x1dd2('0x37')],_0x2bd96a[_0x1dd2('0x35')]));_0x41a509['where'][_0x1dd2('0x5a')]=_0x1ba3ee['id'];if(_0x3bdcb9[_0x1dd2('0x37')][_0x1dd2('0x3f')]){_0x41a509[_0x1dd2('0x40')]=_[_0x1dd2('0x5b')](_0x41a509['where'],{'$or':_[_0x1dd2('0x2f')](_0x41a509[_0x1dd2('0x39')],function(_0x14fac8){var _0xe99d0e={};_0xe99d0e[_0x14fac8]={'$like':'%'+_0x3bdcb9[_0x1dd2('0x37')]['filter']+'%'};return _0xe99d0e;})});}_0x41a509=_['merge']({},_0x41a509,_0x3bdcb9[_0x1dd2('0x48')]);return db[_0x1dd2('0x58')]['findAll'](_0x41a509);}})[_0x1dd2('0x27')](function(_0x5159fb){if(_0x5159fb){return db['User'][_0x1dd2('0x5c')]({'where':{'id':_['map'](_0x5159fb,_0x1dd2('0x5d')),'role':'agent'},'attributes':['id',_0x1dd2('0x2c'),'whatsappPause',_0x1dd2('0x5e'),_0x1dd2('0x5f')]});}})[_0x1dd2('0x27')](function(_0x2d35a2){if(_0x2d35a2){return{'count':_0x2d35a2[_0x1dd2('0x23')],'rows':_['map'](_0x2d35a2[_0x1dd2('0x45')],function(_0xa3184e){return{'membername':_0xa3184e['name'],'UserId':_0xa3184e['id'],'queue_name':_0x2da246[_0x1dd2('0x2c')],'WhatsappQueueId':_0x2da246['id'],'interface':util[_0x1dd2('0x60')](_0x1dd2('0x61'),_0x1dd2('0x62'),_0xa3184e[_0x1dd2('0x2c')]),'penalty':0x0,'paused':_0xa3184e[_0x1dd2('0x63')],'createdAt':_0xa3184e[_0x1dd2('0x5f')],'updatedAt':_0xa3184e[_0x1dd2('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1dd2('0x27')](respondWithFilteredResult(_0x248deb,_0x41a509))['catch'](handleError(_0x248deb,null));};exports[_0x1dd2('0x64')]=function(_0x147f5d,_0x3bda9a,_0x3ae24a){var _0x5494ac={};var _0x4fc131={};var _0x396a8d;var _0x2f463e;return db[_0x1dd2('0x43')][_0x1dd2('0x56')]({'where':{'id':_0x147f5d['params']['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x3bda9a,null))['then'](function(_0x302eeb){if(_0x302eeb){_0x396a8d=_0x302eeb;_0x4fc131[_0x1dd2('0x34')]=_[_0x1dd2('0x57')](db['Team'][_0x1dd2('0x30')]);_0x4fc131[_0x1dd2('0x37')]=_[_0x1dd2('0x57')](_0x147f5d[_0x1dd2('0x37')]);_0x4fc131[_0x1dd2('0x35')]=_[_0x1dd2('0x36')](_0x4fc131[_0x1dd2('0x34')],_0x4fc131[_0x1dd2('0x37')]);_0x5494ac['attributes']=_[_0x1dd2('0x36')](_0x4fc131[_0x1dd2('0x34')],qs['fields'](_0x147f5d[_0x1dd2('0x37')][_0x1dd2('0x38')]));_0x5494ac['attributes']=_0x5494ac[_0x1dd2('0x39')][_0x1dd2('0x3a')]?_0x5494ac[_0x1dd2('0x39')]:_0x4fc131[_0x1dd2('0x34')];_0x5494ac[_0x1dd2('0x59')]=qs[_0x1dd2('0x3d')](_0x147f5d['query'][_0x1dd2('0x3d')]);_0x5494ac['where']=qs['filters'](_[_0x1dd2('0x3e')](_0x147f5d[_0x1dd2('0x37')],_0x4fc131[_0x1dd2('0x35')]));if(_0x147f5d[_0x1dd2('0x37')][_0x1dd2('0x3f')]){_0x5494ac[_0x1dd2('0x40')]=_[_0x1dd2('0x5b')](_0x5494ac['where'],{'$or':_['map'](_0x5494ac[_0x1dd2('0x39')],function(_0x47c69c){var _0x2469f3={};_0x2469f3[_0x47c69c]={'$like':'%'+_0x147f5d[_0x1dd2('0x37')]['filter']+'%'};return _0x2469f3;})});}_0x5494ac=_['merge']({},_0x5494ac,_0x147f5d['options']);return _0x396a8d['getTeams'](_0x5494ac);}})[_0x1dd2('0x27')](function(_0x459e24){if(_0x459e24){_0x2f463e=_0x459e24[_0x1dd2('0x3a')];if(!_0x147f5d['query']['hasOwnProperty'](_0x1dd2('0x3c'))){_0x5494ac[_0x1dd2('0x22')]=qs['limit'](_0x147f5d[_0x1dd2('0x37')][_0x1dd2('0x22')]);_0x5494ac[_0x1dd2('0x20')]=qs['offset'](_0x147f5d['query'][_0x1dd2('0x20')]);}return _0x396a8d[_0x1dd2('0x64')](_0x5494ac);}})[_0x1dd2('0x27')](function(_0x427f93){if(_0x427f93){return _0x427f93?{'count':_0x2f463e,'rows':_0x427f93}:null;}})['then'](respondWithResult(_0x3bda9a,null))[_0x1dd2('0x4a')](handleError(_0x3bda9a,null));};exports[_0x1dd2('0x65')]=function(_0x45db51,_0x5929b6,_0x13d57c){var _0x5512a7=_0x45db51['body'][_0x1dd2('0x66')];return db[_0x1dd2('0x67')][_0x1dd2('0x44')]({'where':{'id':_0x5512a7},'attributes':['id'],'include':[{'model':db[_0x1dd2('0x68')],'as':_0x1dd2('0x69'),'attributes':['id','name',_0x1dd2('0x6a'),_0x1dd2('0x6b'),_0x1dd2('0x6c')],'raw':!![]}]})[_0x1dd2('0x27')](function(_0x44dd69){if(_0x44dd69){var _0x2fc874=_[_0x1dd2('0x6d')](_0x44dd69,function(_0x1de993){var _0x6bc413=_0x1de993[_0x1dd2('0x4d')]({'plain':!![]});return _0x6bc413['Agents'];});return db['WhatsappQueue'][_0x1dd2('0x49')]({'where':{'id':_0x45db51[_0x1dd2('0x47')]['id']}})['then'](function(_0x35cdf0){return db[_0x1dd2('0x6e')][_0x1dd2('0x6f')](function(_0xac2107){return _0x35cdf0[_0x1dd2('0x65')](_0x5512a7,{'transaction':_0xac2107})[_0x1dd2('0x27')](function(){return BPromise[_0x1dd2('0x70')](_0x2fc874,function(_0x3ca347){return db[_0x1dd2('0x58')][_0x1dd2('0x71')]({'where':{'UserId':_0x3ca347['id'],'WhatsappQueueId':_0x45db51['params']['id']},'transaction':_0xac2107});});})[_0x1dd2('0x27')](function(){_0x2fc874[_0x1dd2('0x72')](function(_0x42cac7){socket[_0x1dd2('0x73')](_0x1dd2('0x74'),{'UserId':_0x42cac7['id'],'WhatsappQueueId':_0x35cdf0['id']});});});});});}})[_0x1dd2('0x27')](respondWithStatusCode(_0x5929b6,null))[_0x1dd2('0x4a')](handleError(_0x5929b6,null));};exports[_0x1dd2('0x75')]=function(_0x4f8ee2,_0x1a98c9,_0xc6a5cd){return db[_0x1dd2('0x67')][_0x1dd2('0x44')]({'where':{'id':_0x4f8ee2[_0x1dd2('0x37')][_0x1dd2('0x66')]},'attributes':['id'],'include':[{'model':db[_0x1dd2('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1dd2('0x27')](handleEntityNotFound(_0x1a98c9,null))[_0x1dd2('0x27')](function(_0x549852){var _0x46a665=_[_0x1dd2('0x2f')](_0x549852,'id');var _0x3720c4=[];var _0x393b33=[];var _0x33a8b1=squel[_0x1dd2('0x76')]();_0x33a8b1[_0x1dd2('0x77')](_0x1dd2('0x78'))[_0x1dd2('0x79')](_0x1dd2('0x7a'),'tq')[_0x1dd2('0x7b')](_0x1dd2('0x7c'),'ut',_0x1dd2('0x7d'))[_0x1dd2('0x40')]('WhatsappQueueId\x20=\x20?',_0x4f8ee2[_0x1dd2('0x47')]['id']);for(var _0x3d78e0=0x0;_0x3d78e0<_0x549852[_0x1dd2('0x3a')];_0x3d78e0+=0x1){let _0x2e4f4d=_0x549852[_0x3d78e0];for(var _0x3a479e=0x0;_0x3a479e<_0x2e4f4d['Agents'][_0x1dd2('0x3a')];_0x3a479e+=0x1){let _0x21ed18=_0x2e4f4d[_0x1dd2('0x69')][_0x3a479e];var _0x1654ff=_0x33a8b1[_0x1dd2('0x7e')]();_0x1654ff[_0x1dd2('0x40')](_0x1dd2('0x7f'),_0x21ed18['id']);_0x393b33[_0x1dd2('0x80')](db[_0x1dd2('0x6e')][_0x1dd2('0x37')](_0x1654ff[_0x1dd2('0x81')](),{'type':db[_0x1dd2('0x6e')][_0x1dd2('0x82')]['SELECT']})[_0x1dd2('0x27')](function(_0x5264c3){if(_0x5264c3['length']===0x1){return _0x21ed18['id'];}else{var _0xf124f5=_[_0x1dd2('0x83')](_['map'](_0x5264c3,_0x1dd2('0x84')),function(_0x15f5e1){return _[_0x1dd2('0x85')](_0x46a665,_0x15f5e1);});if(_0xf124f5){return _0x21ed18['id'];}}}));}}return BPromise[_0x1dd2('0x86')](_0x393b33)[_0x1dd2('0x27')](function(_0x3108c4){_0x3720c4=_(_0x3720c4)[_0x1dd2('0x87')](_0x3108c4)[_0x1dd2('0x88')]()[_0x1dd2('0x89')]();return db[_0x1dd2('0x43')][_0x1dd2('0x49')]({'where':{'id':_0x4f8ee2[_0x1dd2('0x47')]['id']}})[_0x1dd2('0x27')](function(_0x146ed9){return db[_0x1dd2('0x6e')][_0x1dd2('0x6f')](function(_0x475c2f){return _0x146ed9[_0x1dd2('0x75')](_0x4f8ee2['query']['ids'],{'transaction':_0x475c2f})[_0x1dd2('0x27')](function(){if(!_['isEmpty'](_0x3720c4)){return _0x146ed9[_0x1dd2('0x8a')](_0x3720c4,{'transaction':_0x475c2f});}})['then'](function(){_0x3720c4[_0x1dd2('0x72')](function(_0x38b9b7){socket[_0x1dd2('0x73')](_0x1dd2('0x8b'),{'UserId':_0x38b9b7,'WhatsappQueueId':_0x146ed9['id']});});});});});});})[_0x1dd2('0x27')](respondWithStatusCode(_0x1a98c9,null))[_0x1dd2('0x4a')](handleError(_0x1a98c9,null));};exports[_0x1dd2('0x8c')]=function(_0x1d37eb,_0x35d682,_0x4104ea){return db[_0x1dd2('0x43')][_0x1dd2('0x49')]({'where':{'id':_0x1d37eb[_0x1dd2('0x47')]['id']}})['then'](handleEntityNotFound(_0x35d682,null))['then'](function(_0x1dd961){if(_0x1dd961){return _0x1dd961[_0x1dd2('0x8c')](_0x1d37eb[_0x1dd2('0x53')][_0x1dd2('0x66')],_[_0x1dd2('0x8d')](_0x1d37eb['body'],['ids','id'])||{})[_0x1dd2('0x8e')](function(_0x3081a8){for(var _0x5b69fa=0x0;_0x5b69fa<_0x1d37eb[_0x1dd2('0x53')][_0x1dd2('0x66')][_0x1dd2('0x3a')];_0x5b69fa+=0x1){socket[_0x1dd2('0x73')](_0x1dd2('0x74'),{'UserId':Number(_0x1d37eb['body'][_0x1dd2('0x66')][_0x5b69fa]),'WhatsappQueueId':Number(_0x1d37eb[_0x1dd2('0x47')]['id'])});}return _0x3081a8;});}})[_0x1dd2('0x27')](respondWithResult(_0x35d682,null))['catch'](handleError(_0x35d682,null));};exports[_0x1dd2('0x8a')]=function(_0x39fe91,_0x2e8edb,_0x5c856b){return db[_0x1dd2('0x43')][_0x1dd2('0x49')]({'where':{'id':_0x39fe91[_0x1dd2('0x47')]['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x2e8edb,null))[_0x1dd2('0x27')](function(_0x4a7cf3){if(_0x4a7cf3){return _0x4a7cf3[_0x1dd2('0x8a')](_0x39fe91['query'][_0x1dd2('0x66')])['then'](function(){if(_[_0x1dd2('0x8f')](_0x39fe91[_0x1dd2('0x37')][_0x1dd2('0x66')])){for(var _0x46bf4d=0x0;_0x46bf4d<_0x39fe91[_0x1dd2('0x37')]['ids'][_0x1dd2('0x3a')];_0x46bf4d+=0x1){socket[_0x1dd2('0x73')](_0x1dd2('0x8b'),{'UserId':Number(_0x39fe91[_0x1dd2('0x37')][_0x1dd2('0x66')][_0x46bf4d]),'WhatsappQueueId':Number(_0x39fe91[_0x1dd2('0x47')]['id'])});}}else{socket[_0x1dd2('0x73')]('userWhatsappQueue:remove',{'UserId':Number(_0x39fe91['query'][_0x1dd2('0x66')]),'WhatsappQueueId':Number(_0x39fe91['params']['id'])});}});}})[_0x1dd2('0x27')](respondWithStatusCode(_0x2e8edb,null))['catch'](handleError(_0x2e8edb,null));};exports[_0x1dd2('0x90')]=function(_0x50a180,_0x1c4316,_0x11ef71){var _0x3db67f={};var _0x200ab0={};var _0x5ee3f7;var _0x11b11c;return db[_0x1dd2('0x43')][_0x1dd2('0x56')]({'where':{'id':_0x50a180['params']['id']}})[_0x1dd2('0x27')](handleEntityNotFound(_0x1c4316,null))[_0x1dd2('0x27')](function(_0x3a0933){if(_0x3a0933){_0x5ee3f7=_0x3a0933;_0x200ab0['model']=_[_0x1dd2('0x57')](db[_0x1dd2('0x68')][_0x1dd2('0x30')]);_0x200ab0['query']=_[_0x1dd2('0x57')](_0x50a180[_0x1dd2('0x37')]);_0x200ab0[_0x1dd2('0x35')]=_[_0x1dd2('0x36')](_0x200ab0['model'],_0x200ab0[_0x1dd2('0x37')]);_0x3db67f['attributes']=_[_0x1dd2('0x36')](_0x200ab0[_0x1dd2('0x34')],qs[_0x1dd2('0x38')](_0x50a180[_0x1dd2('0x37')][_0x1dd2('0x38')]));_0x3db67f[_0x1dd2('0x39')]=_0x3db67f[_0x1dd2('0x39')][_0x1dd2('0x3a')]?_0x3db67f['attributes']:_0x200ab0['model'];_0x3db67f['order']=qs[_0x1dd2('0x3d')](_0x50a180[_0x1dd2('0x37')]['sort']);_0x3db67f[_0x1dd2('0x40')]=qs[_0x1dd2('0x35')](_[_0x1dd2('0x3e')](_0x50a180[_0x1dd2('0x37')],_0x200ab0[_0x1dd2('0x35')]));if(_0x50a180[_0x1dd2('0x37')][_0x1dd2('0x3f')]){_0x3db67f[_0x1dd2('0x40')]=_[_0x1dd2('0x5b')](_0x3db67f['where'],{'$or':_['map'](_0x3db67f[_0x1dd2('0x39')],function(_0x16b1ad){var _0x51b338={};_0x51b338[_0x16b1ad]={'$like':'%'+_0x50a180[_0x1dd2('0x37')]['filter']+'%'};return _0x51b338;})});}_0x3db67f=_[_0x1dd2('0x5b')]({},_0x3db67f,_0x50a180['options']);return _0x5ee3f7['getAgents'](_0x3db67f);}})[_0x1dd2('0x27')](function(_0x1d6126){if(_0x1d6126){_0x11b11c=_0x1d6126[_0x1dd2('0x3a')];if(!_0x50a180[_0x1dd2('0x37')][_0x1dd2('0x3b')](_0x1dd2('0x3c'))){_0x3db67f[_0x1dd2('0x22')]=qs[_0x1dd2('0x22')](_0x50a180[_0x1dd2('0x37')][_0x1dd2('0x22')]);_0x3db67f[_0x1dd2('0x20')]=qs['offset'](_0x50a180[_0x1dd2('0x37')]['offset']);}return _0x5ee3f7[_0x1dd2('0x90')](_0x3db67f);}})[_0x1dd2('0x27')](function(_0x2e2807){if(_0x2e2807){return _0x2e2807?{'count':_0x11b11c,'rows':_0x2e2807}:null;}})[_0x1dd2('0x27')](respondWithResult(_0x1c4316,null))['catch'](handleError(_0x1c4316,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index d0f8d62..d01126d 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 _0x6d32=['remove','emit','hasOwnProperty','hook','exports','events','WhatsappQueue','update'];(function(_0x3e7bd3,_0x581414){var _0x128a46=function(_0x147942){while(--_0x147942){_0x3e7bd3['push'](_0x3e7bd3['shift']());}};_0x128a46(++_0x581414);}(_0x6d32,0x1ed));var _0x26d3=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x6d32[_0x4fde08];return _0x12e725;};'use strict';var EventEmitter=require(_0x26d3('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x26d3('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x26d3('0x2'),'afterDestroy':_0x26d3('0x3')};function emitEvent(_0x2bc4b1){return function(_0xf84d55,_0xe78142,_0x261530){WhatsappQueueEvents[_0x26d3('0x4')](_0x2bc4b1+':'+_0xf84d55['id'],_0xf84d55);WhatsappQueueEvents[_0x26d3('0x4')](_0x2bc4b1,_0xf84d55);_0x261530(null);};}for(var e in events){if(events[_0x26d3('0x5')](e)){var event=events[e];WhatsappQueue[_0x26d3('0x6')](e,emitEvent(event));}}module[_0x26d3('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xbec6=['hook','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x30d0d5,_0x4bbb57){var _0x19706b=function(_0x37538f){while(--_0x37538f){_0x30d0d5['push'](_0x30d0d5['shift']());}};_0x19706b(++_0x4bbb57);}(_0xbec6,0x79));var _0x6bec=function(_0x27ddf5,_0x5a3e18){_0x27ddf5=_0x27ddf5-0x0;var _0x26e74a=_0xbec6[_0x27ddf5];return _0x26e74a;};'use strict';var EventEmitter=require(_0x6bec('0x0'));var WhatsappQueue=require(_0x6bec('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6bec('0x2'),'afterUpdate':_0x6bec('0x3'),'afterDestroy':_0x6bec('0x4')};function emitEvent(_0x44a2c4){return function(_0x1ffa08,_0x2e1d07,_0x251bde){WhatsappQueueEvents[_0x6bec('0x5')](_0x44a2c4+':'+_0x1ffa08['id'],_0x1ffa08);WhatsappQueueEvents[_0x6bec('0x5')](_0x44a2c4,_0x1ffa08);_0x251bde(null);};}for(var e in events){if(events[_0x6bec('0x6')](e)){var event=events[e];WhatsappQueue[_0x6bec('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 0d3261f..6048694 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 _0xe99c=['WhatsappQueue','whatsapp_queues','moment','bluebird','request-promise','rimraf','./whatsappQueue.attributes','exports','define'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xe99c,0x1d6));var _0xce99=function(_0x3c1b50,_0x1d2ee7){_0x3c1b50=_0x3c1b50-0x0;var _0x26634b=_0xe99c[_0x3c1b50];return _0x26634b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xce99('0x0'));var BPromise=require(_0xce99('0x1'));var rp=require(_0xce99('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce99('0x3'));var config=require('../../config/environment');var attributes=require(_0xce99('0x4'));module[_0xce99('0x5')]=function(_0xbbc1d0,_0x4f789f){return _0xbbc1d0[_0xce99('0x6')](_0xce99('0x7'),attributes,{'tableName':_0xce99('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe40=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','WhatsappQueue','whatsapp_queues'];(function(_0x6e4e3e,_0x14cd43){var _0x1d06d7=function(_0x27bb99){while(--_0x27bb99){_0x6e4e3e['push'](_0x6e4e3e['shift']());}};_0x1d06d7(++_0x14cd43);}(_0xbe40,0x1e0));var _0x0be4=function(_0x30abc0,_0x20c859){_0x30abc0=_0x30abc0-0x0;var _0x4fb249=_0xbe40[_0x30abc0];return _0x4fb249;};'use strict';var _=require(_0x0be4('0x0'));var util=require(_0x0be4('0x1'));var logger=require(_0x0be4('0x2'))(_0x0be4('0x3'));var moment=require(_0x0be4('0x4'));var BPromise=require('bluebird');var rp=require(_0x0be4('0x5'));var fs=require('fs');var path=require(_0x0be4('0x6'));var rimraf=require('rimraf');var config=require(_0x0be4('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0x0be4('0x8')]=function(_0x3a2159,_0xf4cf76){return _0x3a2159[_0x0be4('0x9')](_0x0be4('0xa'),attributes,{'tableName':_0x0be4('0xb'),'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 3332827..591fb89 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 _0xb008=['WhatsappQueue,\x20%s,\x20%s','info','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','model','map','attributes','then','ShowWhatsappQueue','debug','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','socket.io-emitter','./whatsappQueue.socket','request','request\x20sent','stringify','error','code','message'];(function(_0x53586d,_0x352407){var _0x398d39=function(_0x354d05){while(--_0x354d05){_0x53586d['push'](_0x53586d['shift']());}};_0x398d39(++_0x352407);}(_0xb008,0x132));var _0x8b00=function(_0x93b6a9,_0x347e85){_0x93b6a9=_0x93b6a9-0x0;var _0x18e14f=_0xb008[_0x93b6a9];return _0x18e14f;};'use strict';var _=require(_0x8b00('0x0'));var util=require('util');var moment=require(_0x8b00('0x1'));var BPromise=require('bluebird');var rs=require(_0x8b00('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b00('0x3'))['db'];var utils=require(_0x8b00('0x4'));var logger=require(_0x8b00('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8b00('0x6'));var client=jayson[_0x8b00('0x7')]['http']({'port':0x232a});config[_0x8b00('0x8')]=_[_0x8b00('0x9')](config[_0x8b00('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x8b00('0xa'))(new Redis(config[_0x8b00('0x8')]));require(_0x8b00('0xb'))['register'](socket);function respondWithRpcPromise(_0x508346,_0x49a5ce,_0x2fa661){return new BPromise(function(_0x53a67b,_0x2b03f6){return client[_0x8b00('0xc')](_0x508346,_0x2fa661)['then'](function(_0x3cfda7){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x49a5ce,_0x8b00('0xd'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x49a5ce,'request\x20sent',JSON[_0x8b00('0xe')](_0x3cfda7));if(_0x3cfda7['error']){if(_0x3cfda7[_0x8b00('0xf')][_0x8b00('0x10')]===0x1f4){logger[_0x8b00('0xf')]('WhatsappQueue,\x20%s,\x20%s',_0x49a5ce,_0x3cfda7[_0x8b00('0xf')][_0x8b00('0x11')]);return _0x2b03f6(_0x3cfda7['error'][_0x8b00('0x11')]);}logger[_0x8b00('0xf')](_0x8b00('0x12'),_0x49a5ce,_0x3cfda7[_0x8b00('0xf')][_0x8b00('0x11')]);return _0x53a67b(_0x3cfda7[_0x8b00('0xf')][_0x8b00('0x11')]);}else{logger[_0x8b00('0x13')](_0x8b00('0x12'),_0x49a5ce,_0x8b00('0xd'));_0x53a67b(_0x3cfda7[_0x8b00('0x14')][_0x8b00('0x11')]);}})[_0x8b00('0x15')](function(_0x43a346){logger[_0x8b00('0xf')](_0x8b00('0x12'),_0x49a5ce,_0x43a346);_0x2b03f6(_0x43a346);});});}exports[_0x8b00('0x16')]=function(_0x571c34){var _0x59b760=this;return new Promise(function(_0x21bdcf,_0x5c25f4){return db[_0x8b00('0x17')][_0x8b00('0x18')]({'raw':_0x571c34['options']?_0x571c34[_0x8b00('0x19')][_0x8b00('0x1a')]===undefined?!![]:![]:!![],'where':_0x571c34[_0x8b00('0x19')]?_0x571c34[_0x8b00('0x19')][_0x8b00('0x1b')]||null:null,'attributes':_0x571c34[_0x8b00('0x19')]?_0x571c34[_0x8b00('0x19')]['attributes']||null:null,'limit':_0x571c34[_0x8b00('0x19')]?_0x571c34[_0x8b00('0x19')][_0x8b00('0x1c')]||null:null,'include':_0x571c34[_0x8b00('0x19')]?_0x571c34[_0x8b00('0x19')][_0x8b00('0x1d')]?_['map'](_0x571c34[_0x8b00('0x19')][_0x8b00('0x1d')],function(_0x3a77c4){return{'model':db[_0x3a77c4[_0x8b00('0x1e')]],'as':_0x3a77c4['as'],'attributes':_0x3a77c4['attributes'],'include':_0x3a77c4['include']?_[_0x8b00('0x1f')](_0x3a77c4[_0x8b00('0x1d')],function(_0x44dd0f){return{'model':db[_0x44dd0f[_0x8b00('0x1e')]],'as':_0x44dd0f['as'],'attributes':_0x44dd0f[_0x8b00('0x20')],'include':_0x44dd0f['include']?_['map'](_0x44dd0f[_0x8b00('0x1d')],function(_0x4a5be2){return{'model':db[_0x4a5be2[_0x8b00('0x1e')]],'as':_0x4a5be2['as'],'attributes':_0x4a5be2[_0x8b00('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8b00('0x21')](function(_0x579baa){logger[_0x8b00('0x13')]('GetWhatsappQueue',_0x571c34);logger['debug'](_0x8b00('0x16'),_0x571c34,JSON[_0x8b00('0xe')](_0x579baa));_0x21bdcf(_0x579baa);})[_0x8b00('0x15')](function(_0x46006b){logger[_0x8b00('0xf')](_0x8b00('0x16'),_0x46006b['message'],_0x571c34);_0x5c25f4(_0x59b760[_0x8b00('0xf')](0x1f4,_0x46006b[_0x8b00('0x11')]));});});};exports[_0x8b00('0x22')]=function(_0x52d586){var _0x10d951=this;return new Promise(function(_0x2c8804,_0x3c45eb){return db['WhatsappQueue']['find']({'raw':_0x52d586[_0x8b00('0x19')]?_0x52d586['options'][_0x8b00('0x1a')]===undefined?!![]:![]:!![],'where':_0x52d586['options']?_0x52d586[_0x8b00('0x19')][_0x8b00('0x1b')]||null:null,'attributes':_0x52d586[_0x8b00('0x19')]?_0x52d586[_0x8b00('0x19')]['attributes']||null:null,'include':_0x52d586['options']?_0x52d586[_0x8b00('0x19')][_0x8b00('0x1d')]?_[_0x8b00('0x1f')](_0x52d586[_0x8b00('0x19')][_0x8b00('0x1d')],function(_0xd3ff2a){return{'model':db[_0xd3ff2a[_0x8b00('0x1e')]],'as':_0xd3ff2a['as'],'attributes':_0xd3ff2a[_0x8b00('0x20')],'include':_0xd3ff2a[_0x8b00('0x1d')]?_[_0x8b00('0x1f')](_0xd3ff2a['include'],function(_0xfd204e){return{'model':db[_0xfd204e[_0x8b00('0x1e')]],'as':_0xfd204e['as'],'attributes':_0xfd204e[_0x8b00('0x20')],'include':_0xfd204e[_0x8b00('0x1d')]?_[_0x8b00('0x1f')](_0xfd204e[_0x8b00('0x1d')],function(_0x2fe75e){return{'model':db[_0x2fe75e[_0x8b00('0x1e')]],'as':_0x2fe75e['as'],'attributes':_0x2fe75e[_0x8b00('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8b00('0x21')](function(_0x1841cf){logger[_0x8b00('0x13')](_0x8b00('0x22'),_0x52d586);logger[_0x8b00('0x23')]('ShowWhatsappQueue',_0x52d586,JSON['stringify'](_0x1841cf));_0x2c8804(_0x1841cf);})['catch'](function(_0x2f78dd){logger[_0x8b00('0xf')]('ShowWhatsappQueue',_0x2f78dd[_0x8b00('0x11')],_0x52d586);_0x3c45eb(_0x10d951[_0x8b00('0xf')](0x1f4,_0x2f78dd[_0x8b00('0x11')]));});});}; \ No newline at end of file +var _0xb986=['client','http','redis','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','include','map','model','attributes','then','ShowWhatsappQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xb986,0x14d));var _0x6b98=function(_0x3d9633,_0x3882a1){_0x3d9633=_0x3d9633-0x0;var _0x191485=_0xb986[_0x3d9633];return _0x191485;};'use strict';var _=require(_0x6b98('0x0'));var util=require(_0x6b98('0x1'));var moment=require(_0x6b98('0x2'));var BPromise=require(_0x6b98('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b98('0x4'));var db=require(_0x6b98('0x5'))['db'];var utils=require(_0x6b98('0x6'));var logger=require('../../config/logger')(_0x6b98('0x7'));var config=require('../../config/environment');var jayson=require(_0x6b98('0x8'));var client=jayson[_0x6b98('0x9')][_0x6b98('0xa')]({'port':0x232a});config[_0x6b98('0xb')]=_['defaults'](config[_0x6b98('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b98('0xb')]));require(_0x6b98('0xc'))[_0x6b98('0xd')](socket);function respondWithRpcPromise(_0x3076f1,_0x372fec,_0x1551d7){return new BPromise(function(_0x29aaf7,_0x1af32c){return client[_0x6b98('0xe')](_0x3076f1,_0x1551d7)['then'](function(_0x5d06d1){logger[_0x6b98('0xf')](_0x6b98('0x10'),_0x372fec,_0x6b98('0x11'));logger[_0x6b98('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x372fec,_0x6b98('0x11'),JSON[_0x6b98('0x13')](_0x5d06d1));if(_0x5d06d1[_0x6b98('0x14')]){if(_0x5d06d1[_0x6b98('0x14')][_0x6b98('0x15')]===0x1f4){logger[_0x6b98('0x14')](_0x6b98('0x10'),_0x372fec,_0x5d06d1[_0x6b98('0x14')][_0x6b98('0x16')]);return _0x1af32c(_0x5d06d1['error'][_0x6b98('0x16')]);}logger[_0x6b98('0x14')](_0x6b98('0x10'),_0x372fec,_0x5d06d1[_0x6b98('0x14')]['message']);return _0x29aaf7(_0x5d06d1[_0x6b98('0x14')][_0x6b98('0x16')]);}else{logger[_0x6b98('0xf')](_0x6b98('0x10'),_0x372fec,_0x6b98('0x11'));_0x29aaf7(_0x5d06d1[_0x6b98('0x17')][_0x6b98('0x16')]);}})[_0x6b98('0x18')](function(_0x25c49f){logger[_0x6b98('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x372fec,_0x25c49f);_0x1af32c(_0x25c49f);});});}exports[_0x6b98('0x19')]=function(_0x51be02){var _0x5e8958=this;return new Promise(function(_0x341435,_0x5e5e9a){return db[_0x6b98('0x1a')][_0x6b98('0x1b')]({'raw':_0x51be02[_0x6b98('0x1c')]?_0x51be02['options'][_0x6b98('0x1d')]===undefined?!![]:![]:!![],'where':_0x51be02[_0x6b98('0x1c')]?_0x51be02[_0x6b98('0x1c')][_0x6b98('0x1e')]||null:null,'attributes':_0x51be02['options']?_0x51be02[_0x6b98('0x1c')]['attributes']||null:null,'limit':_0x51be02[_0x6b98('0x1c')]?_0x51be02[_0x6b98('0x1c')]['limit']||null:null,'include':_0x51be02[_0x6b98('0x1c')]?_0x51be02[_0x6b98('0x1c')][_0x6b98('0x1f')]?_[_0x6b98('0x20')](_0x51be02[_0x6b98('0x1c')][_0x6b98('0x1f')],function(_0x992a81){return{'model':db[_0x992a81[_0x6b98('0x21')]],'as':_0x992a81['as'],'attributes':_0x992a81[_0x6b98('0x22')],'include':_0x992a81[_0x6b98('0x1f')]?_[_0x6b98('0x20')](_0x992a81[_0x6b98('0x1f')],function(_0x2ad223){return{'model':db[_0x2ad223[_0x6b98('0x21')]],'as':_0x2ad223['as'],'attributes':_0x2ad223[_0x6b98('0x22')],'include':_0x2ad223[_0x6b98('0x1f')]?_[_0x6b98('0x20')](_0x2ad223['include'],function(_0x40e408){return{'model':db[_0x40e408[_0x6b98('0x21')]],'as':_0x40e408['as'],'attributes':_0x40e408['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b98('0x23')](function(_0x2f841d){logger[_0x6b98('0xf')]('GetWhatsappQueue',_0x51be02);logger['debug'](_0x6b98('0x19'),_0x51be02,JSON[_0x6b98('0x13')](_0x2f841d));_0x341435(_0x2f841d);})[_0x6b98('0x18')](function(_0x26dc9c){logger['error'](_0x6b98('0x19'),_0x26dc9c[_0x6b98('0x16')],_0x51be02);_0x5e5e9a(_0x5e8958[_0x6b98('0x14')](0x1f4,_0x26dc9c[_0x6b98('0x16')]));});});};exports[_0x6b98('0x24')]=function(_0x8573b2){var _0x5d9e62=this;return new Promise(function(_0x63a5ee,_0x5b2883){return db[_0x6b98('0x1a')][_0x6b98('0x25')]({'raw':_0x8573b2[_0x6b98('0x1c')]?_0x8573b2[_0x6b98('0x1c')][_0x6b98('0x1d')]===undefined?!![]:![]:!![],'where':_0x8573b2['options']?_0x8573b2[_0x6b98('0x1c')]['where']||null:null,'attributes':_0x8573b2[_0x6b98('0x1c')]?_0x8573b2[_0x6b98('0x1c')][_0x6b98('0x22')]||null:null,'include':_0x8573b2[_0x6b98('0x1c')]?_0x8573b2['options'][_0x6b98('0x1f')]?_['map'](_0x8573b2['options']['include'],function(_0x2bd9ec){return{'model':db[_0x2bd9ec[_0x6b98('0x21')]],'as':_0x2bd9ec['as'],'attributes':_0x2bd9ec[_0x6b98('0x22')],'include':_0x2bd9ec['include']?_[_0x6b98('0x20')](_0x2bd9ec[_0x6b98('0x1f')],function(_0x56dc40){return{'model':db[_0x56dc40['model']],'as':_0x56dc40['as'],'attributes':_0x56dc40[_0x6b98('0x22')],'include':_0x56dc40[_0x6b98('0x1f')]?_[_0x6b98('0x20')](_0x56dc40[_0x6b98('0x1f')],function(_0x3cab94){return{'model':db[_0x3cab94['model']],'as':_0x3cab94['as'],'attributes':_0x3cab94[_0x6b98('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6b98('0x23')](function(_0x1fbd01){logger['info'](_0x6b98('0x24'),_0x8573b2);logger[_0x6b98('0x12')](_0x6b98('0x24'),_0x8573b2,JSON[_0x6b98('0x13')](_0x1fbd01));_0x63a5ee(_0x1fbd01);})[_0x6b98('0x18')](function(_0x4971cb){logger[_0x6b98('0x14')](_0x6b98('0x24'),_0x4971cb[_0x6b98('0x16')],_0x8573b2);_0x5b2883(_0x5d9e62[_0x6b98('0x14')](0x1f4,_0x4971cb[_0x6b98('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 49eb287..5cc950b 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 _0xdee9=['removeListener','register','length','whatsappQueue:','save','remove','update'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xdee9,0x146));var _0x9dee=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xdee9[_0x376b45];return _0x2341b3;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x9dee('0x0'),_0x9dee('0x1'),_0x9dee('0x2')];function createListener(_0x1a123f,_0x4e9997){return function(_0x4077b8){_0x4e9997['emit'](_0x1a123f,_0x4077b8);};}function removeListener(_0x312e3e,_0x307787){return function(){WhatsappQueueEvents[_0x9dee('0x3')](_0x312e3e,_0x307787);};}exports[_0x9dee('0x4')]=function(_0x26347c){for(var _0x6b9be1=0x0,_0x429c25=events[_0x9dee('0x5')];_0x6b9be1<_0x429c25;_0x6b9be1++){var _0x49b331=events[_0x6b9be1];var _0x44b2d2=createListener(_0x9dee('0x6')+_0x49b331,_0x26347c);WhatsappQueueEvents['on'](_0x49b331,_0x44b2d2);}}; \ No newline at end of file +var _0x46f5=['length','whatsappQueue:','./whatsappQueue.events','remove','update','emit','removeListener','register'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x46f5,0x6a));var _0x546f=function(_0x35cf45,_0xa3c88e){_0x35cf45=_0x35cf45-0x0;var _0x5435b0=_0x46f5[_0x35cf45];return _0x5435b0;};'use strict';var WhatsappQueueEvents=require(_0x546f('0x0'));var events=['save',_0x546f('0x1'),_0x546f('0x2')];function createListener(_0x5a367f,_0x29de75){return function(_0x3a376c){_0x29de75[_0x546f('0x3')](_0x5a367f,_0x3a376c);};}function removeListener(_0x1910b8,_0x50136a){return function(){WhatsappQueueEvents[_0x546f('0x4')](_0x1910b8,_0x50136a);};}exports[_0x546f('0x5')]=function(_0x42cfd3){for(var _0x50c378=0x0,_0x404884=events[_0x546f('0x6')];_0x50c378<_0x404884;_0x50c378++){var _0x3c4b4b=events[_0x50c378];var _0x51b2b5=createListener(_0x546f('0x7')+_0x3c4b4b,_0x42cfd3);WhatsappQueueEvents['on'](_0x3c4b4b,_0x51b2b5);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 199b7bf..d270109 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 _0x96ad=['destroy','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','create','put','update','delete'];(function(_0x17d6bc,_0x362d4f){var _0x5e1e2e=function(_0x535237){while(--_0x535237){_0x17d6bc['push'](_0x17d6bc['shift']());}};_0x5e1e2e(++_0x362d4f);}(_0x96ad,0xbc));var _0xd96a=function(_0x1c4409,_0x3b2e8f){_0x1c4409=_0x1c4409-0x0;var _0x356d8f=_0x96ad[_0x1c4409];return _0x356d8f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd96a('0x0'));var timeout=require(_0xd96a('0x1'));var express=require(_0xd96a('0x2'));var router=express['Router']();var fs_extra=require(_0xd96a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd96a('0x4'));var config=require(_0xd96a('0x5'));var controller=require(_0xd96a('0x6'));router['get']('/',auth[_0xd96a('0x7')](),controller['index']);router[_0xd96a('0x8')](_0xd96a('0x9'),auth[_0xd96a('0x7')](),controller[_0xd96a('0xa')]);router[_0xd96a('0x8')](_0xd96a('0xb'),auth[_0xd96a('0x7')](),controller['show']);router['post']('/',auth[_0xd96a('0x7')](),controller[_0xd96a('0xc')]);router[_0xd96a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xd96a('0xe')]);router[_0xd96a('0xf')](_0xd96a('0xb'),auth[_0xd96a('0x7')](),controller[_0xd96a('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa78e=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','util'];(function(_0x464bf8,_0x1af475){var _0x5e4ef7=function(_0x51d120){while(--_0x51d120){_0x464bf8['push'](_0x464bf8['shift']());}};_0x5e4ef7(++_0x1af475);}(_0xa78e,0xa6));var _0xea78=function(_0x32356d,_0x4db7c2){_0x32356d=_0x32356d-0x0;var _0x460815=_0xa78e[_0x32356d];return _0x460815;};'use strict';var multer=require(_0xea78('0x0'));var util=require(_0xea78('0x1'));var path=require(_0xea78('0x2'));var timeout=require('connect-timeout');var express=require(_0xea78('0x3'));var router=express[_0xea78('0x4')]();var fs_extra=require(_0xea78('0x5'));var auth=require(_0xea78('0x6'));var interaction=require(_0xea78('0x7'));var config=require('../../config/environment');var controller=require(_0xea78('0x8'));router[_0xea78('0x9')]('/',auth[_0xea78('0xa')](),controller[_0xea78('0xb')]);router[_0xea78('0x9')](_0xea78('0xc'),auth[_0xea78('0xa')](),controller[_0xea78('0xd')]);router[_0xea78('0x9')](_0xea78('0xe'),auth[_0xea78('0xa')](),controller[_0xea78('0xf')]);router['post']('/',auth[_0xea78('0xa')](),controller['create']);router[_0xea78('0x10')]('/:id',auth[_0xea78('0xa')](),controller[_0xea78('0x11')]);router[_0xea78('0x12')](_0xea78('0xe'),auth['isAuthenticated'](),controller[_0xea78('0x13')]);module[_0xea78('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 2965a15..3f8bfee 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x3daa80,_0xd015d1){var _0x43a641=function(_0x32bf98){while(--_0x32bf98){_0x3daa80['push'](_0x3daa80['shift']());}};_0x43a641(++_0xd015d1);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x39fc72,_0x22b0c8){var _0x16b0cf=function(_0x410c26){while(--_0x410c26){_0x39fc72['push'](_0x39fc72['shift']());}};_0x16b0cf(++_0x22b0c8);}(_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 14b0a3b..bf2a163 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 _0x36ee=['describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','WhatsappQueueReport','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];function respondWithStatusCode(_0x4fbdb2,_0x32981d){_0x32981d=_0x32981d||0xcc;return function(_0x27841e){if(_0x27841e){return _0x4fbdb2[_0xe36e('0x19')](_0x32981d);}return _0x4fbdb2[_0xe36e('0x1a')](_0x32981d)['end']();};}function respondWithResult(_0x3e264a,_0x521afa){_0x521afa=_0x521afa||0xc8;return function(_0x525155){if(_0x525155){return _0x3e264a[_0xe36e('0x1a')](_0x521afa)[_0xe36e('0x1b')](_0x525155);}};}function respondWithFilteredResult(_0x26fb37,_0x278135){return function(_0xd6828e){if(_0xd6828e){var _0x924cd5=typeof _0x278135[_0xe36e('0x1c')]===_0xe36e('0x1d')&&typeof _0x278135[_0xe36e('0x1e')]===_0xe36e('0x1d');var _0x5792e8=_0xd6828e[_0xe36e('0x1f')];var _0x2184ae=_0x924cd5?0x0:_0x278135['offset'];var _0x21d9a3=_0x924cd5?_0xd6828e['count']:_0x278135[_0xe36e('0x1c')]+_0x278135[_0xe36e('0x1e')];var _0x5e15f5;if(_0x21d9a3>=_0x5792e8){_0x21d9a3=_0x5792e8;_0x5e15f5=0xc8;}else{_0x5e15f5=0xce;}_0x26fb37[_0xe36e('0x1a')](_0x5e15f5);return _0x26fb37[_0xe36e('0x20')](_0xe36e('0x21'),_0x2184ae+'-'+_0x21d9a3+'/'+_0x5792e8)['json'](_0xd6828e);}return null;};}function patchUpdates(_0x21e95e){return function(_0x21bcf9){try{jsonpatch[_0xe36e('0x22')](_0x21bcf9,_0x21e95e,!![]);}catch(_0x3c4017){return BPromise[_0xe36e('0x23')](_0x3c4017);}return _0x21bcf9[_0xe36e('0x24')]();};}function saveUpdates(_0x4f438a,_0xd71137){return function(_0x4f214a){if(_0x4f214a){return _0x4f214a[_0xe36e('0x25')](_0x4f438a)[_0xe36e('0x26')](function(_0x437f3f){return _0x437f3f;});}return null;};}function removeEntity(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(_0x4749a8){return _0x4749a8[_0xe36e('0x27')]()[_0xe36e('0x26')](function(){_0x53e13a[_0xe36e('0x1a')](0xcc)[_0xe36e('0x28')]();});}};}function handleEntityNotFound(_0x1507f9,_0x1a045c){return function(_0x5ac484){if(!_0x5ac484){_0x1507f9[_0xe36e('0x19')](0x194);}return _0x5ac484;};}function handleError(_0x35f9e7,_0x10597f){_0x10597f=_0x10597f||0x1f4;return function(_0x262caa){logger['error'](_0x262caa[_0xe36e('0x29')]);if(_0x262caa['name']){delete _0x262caa[_0xe36e('0x2a')];}_0x35f9e7['status'](_0x10597f)[_0xe36e('0x2b')](_0x262caa);};}exports['index']=function(_0x410504,_0x4c5d98){var _0x3b1045={},_0x59548b={},_0x4bb75b={'count':0x0,'rows':[]};var _0x5d8fd8=_['map'](db[_0xe36e('0x2c')][_0xe36e('0x2d')],function(_0x4cf185){return{'name':_0x4cf185['fieldName'],'type':_0x4cf185[_0xe36e('0x2e')][_0xe36e('0x2f')]};});_0x59548b[_0xe36e('0x30')]=_[_0xe36e('0x31')](_0x5d8fd8,_0xe36e('0x2a'));_0x59548b[_0xe36e('0x32')]=_['keys'](_0x410504[_0xe36e('0x32')]);_0x59548b[_0xe36e('0x33')]=_['intersection'](_0x59548b[_0xe36e('0x30')],_0x59548b[_0xe36e('0x32')]);_0x3b1045[_0xe36e('0x34')]=_[_0xe36e('0x35')](_0x59548b[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x410504[_0xe36e('0x32')][_0xe36e('0x36')]));_0x3b1045[_0xe36e('0x34')]=_0x3b1045[_0xe36e('0x34')][_0xe36e('0x37')]?_0x3b1045['attributes']:_0x59548b[_0xe36e('0x30')];if(!_0x410504['query']['hasOwnProperty'](_0xe36e('0x38'))){_0x3b1045['limit']=qs[_0xe36e('0x1e')](_0x410504[_0xe36e('0x32')][_0xe36e('0x1e')]);_0x3b1045[_0xe36e('0x1c')]=qs['offset'](_0x410504['query'][_0xe36e('0x1c')]);}_0x3b1045[_0xe36e('0x39')]=qs[_0xe36e('0x3a')](_0x410504[_0xe36e('0x32')]['sort']);_0x3b1045[_0xe36e('0x3b')]=qs[_0xe36e('0x33')](_[_0xe36e('0x3c')](_0x410504['query'],_0x59548b[_0xe36e('0x33')]),_0x5d8fd8);if(_0x410504[_0xe36e('0x32')]['filter']){_0x3b1045[_0xe36e('0x3b')]=_[_0xe36e('0x3d')](_0x3b1045[_0xe36e('0x3b')],{'$or':_[_0xe36e('0x31')](_0x5d8fd8,function(_0xeadfa6){if(_0xeadfa6[_0xe36e('0x2e')]!==_0xe36e('0x3e')){var _0x20877d={};_0x20877d[_0xeadfa6[_0xe36e('0x2a')]]={'$like':'%'+_0x410504[_0xe36e('0x32')][_0xe36e('0x3f')]+'%'};return _0x20877d;}})});}_0x3b1045=_[_0xe36e('0x3d')]({},_0x3b1045,_0x410504[_0xe36e('0x40')]);var _0x5f396c={'where':_0x3b1045[_0xe36e('0x3b')]};return db[_0xe36e('0x2c')][_0xe36e('0x1f')](_0x5f396c)[_0xe36e('0x26')](function(_0x295feb){_0x4bb75b['count']=_0x295feb;if(_0x410504['query'][_0xe36e('0x41')]){_0x3b1045[_0xe36e('0x42')]=[{'all':!![]}];}return db[_0xe36e('0x2c')][_0xe36e('0x43')](_0x3b1045);})[_0xe36e('0x26')](function(_0x34a1ba){_0x4bb75b[_0xe36e('0x44')]=_0x34a1ba;return _0x4bb75b;})[_0xe36e('0x26')](respondWithFilteredResult(_0x4c5d98,_0x3b1045))['catch'](handleError(_0x4c5d98,null));};exports[_0xe36e('0x45')]=function(_0x2d392c,_0x4788a0){var _0x21dc35={'raw':!![],'where':{'id':_0x2d392c[_0xe36e('0x46')]['id']}},_0x5ef3e4={};_0x5ef3e4[_0xe36e('0x30')]=_[_0xe36e('0x47')](db[_0xe36e('0x2c')][_0xe36e('0x2d')]);_0x5ef3e4['query']=_[_0xe36e('0x47')](_0x2d392c[_0xe36e('0x32')]);_0x5ef3e4[_0xe36e('0x33')]=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],_0x5ef3e4[_0xe36e('0x32')]);_0x21dc35['attributes']=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x2d392c[_0xe36e('0x32')][_0xe36e('0x36')]));_0x21dc35['attributes']=_0x21dc35[_0xe36e('0x34')][_0xe36e('0x37')]?_0x21dc35[_0xe36e('0x34')]:_0x5ef3e4[_0xe36e('0x30')];if(_0x2d392c[_0xe36e('0x32')][_0xe36e('0x41')]){_0x21dc35[_0xe36e('0x42')]=[{'all':!![]}];}_0x21dc35=_[_0xe36e('0x3d')]({},_0x21dc35,_0x2d392c[_0xe36e('0x40')]);return db['WhatsappQueueReport']['find'](_0x21dc35)[_0xe36e('0x26')](handleEntityNotFound(_0x4788a0,null))['then'](respondWithResult(_0x4788a0,null))[_0xe36e('0x48')](handleError(_0x4788a0,null));};exports[_0xe36e('0x49')]=function(_0x38b93f,_0x25aa09){return db['WhatsappQueueReport'][_0xe36e('0x49')](_0x38b93f[_0xe36e('0x4a')],{})['then'](respondWithResult(_0x25aa09,0xc9))[_0xe36e('0x48')](handleError(_0x25aa09,null));};exports[_0xe36e('0x25')]=function(_0x2c26e6,_0x42eae5){if(_0x2c26e6[_0xe36e('0x4a')]['id']){delete _0x2c26e6[_0xe36e('0x4a')]['id'];}return db[_0xe36e('0x2c')][_0xe36e('0x4b')]({'where':{'id':_0x2c26e6[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x42eae5,null))[_0xe36e('0x26')](saveUpdates(_0x2c26e6[_0xe36e('0x4a')],null))[_0xe36e('0x26')](respondWithResult(_0x42eae5,null))[_0xe36e('0x48')](handleError(_0x42eae5,null));};exports[_0xe36e('0x27')]=function(_0x5678d3,_0x3262bf){return db['WhatsappQueueReport']['find']({'where':{'id':_0x5678d3[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x3262bf,null))['then'](removeEntity(_0x3262bf,null))[_0xe36e('0x48')](handleError(_0x3262bf,null));};exports[_0xe36e('0x4c')]=function(_0x8a767a,_0x1f4a5d){return db[_0xe36e('0x2c')][_0xe36e('0x4c')]()[_0xe36e('0x26')](respondWithResult(_0x1f4a5d,null))[_0xe36e('0x48')](handleError(_0x1f4a5d,null));}; \ No newline at end of file +var _0xb9a7=['include','rows','catch','show','params','rawAttributes','intersection','create','body','describe','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','stack','map','WhatsappQueueReport','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll'];(function(_0xebfd80,_0x515ccd){var _0x5c8367=function(_0x424089){while(--_0x424089){_0xebfd80['push'](_0xebfd80['shift']());}};_0x5c8367(++_0x515ccd);}(_0xb9a7,0x112));var _0x7b9a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xb9a7[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];function respondWithStatusCode(_0x5948ca,_0x32f616){_0x32f616=_0x32f616||0xcc;return function(_0xec5949){if(_0xec5949){return _0x5948ca['sendStatus'](_0x32f616);}return _0x5948ca[_0x7b9a('0x14')](_0x32f616)[_0x7b9a('0x15')]();};}function respondWithResult(_0x4b7ec0,_0xb157e5){_0xb157e5=_0xb157e5||0xc8;return function(_0xde180d){if(_0xde180d){return _0x4b7ec0[_0x7b9a('0x14')](_0xb157e5)[_0x7b9a('0x16')](_0xde180d);}};}function respondWithFilteredResult(_0x344fa7,_0x346daa){return function(_0x22a7e4){if(_0x22a7e4){var _0x35e602=typeof _0x346daa[_0x7b9a('0x17')]==='undefined'&&typeof _0x346daa[_0x7b9a('0x18')]==='undefined';var _0x123921=_0x22a7e4[_0x7b9a('0x19')];var _0x271263=_0x35e602?0x0:_0x346daa[_0x7b9a('0x17')];var _0x44a232=_0x35e602?_0x22a7e4[_0x7b9a('0x19')]:_0x346daa[_0x7b9a('0x17')]+_0x346daa[_0x7b9a('0x18')];var _0x2064a0;if(_0x44a232>=_0x123921){_0x44a232=_0x123921;_0x2064a0=0xc8;}else{_0x2064a0=0xce;}_0x344fa7[_0x7b9a('0x14')](_0x2064a0);return _0x344fa7[_0x7b9a('0x1a')](_0x7b9a('0x1b'),_0x271263+'-'+_0x44a232+'/'+_0x123921)[_0x7b9a('0x16')](_0x22a7e4);}return null;};}function patchUpdates(_0x58aed7){return function(_0x993048){try{jsonpatch['apply'](_0x993048,_0x58aed7,!![]);}catch(_0x1eacbc){return BPromise['reject'](_0x1eacbc);}return _0x993048[_0x7b9a('0x1c')]();};}function saveUpdates(_0x331ae6,_0x23d812){return function(_0x54fda7){if(_0x54fda7){return _0x54fda7[_0x7b9a('0x1d')](_0x331ae6)[_0x7b9a('0x1e')](function(_0x5705b2){return _0x5705b2;});}return null;};}function removeEntity(_0x35aca7,_0x374dca){return function(_0x269c07){if(_0x269c07){return _0x269c07[_0x7b9a('0x1f')]()[_0x7b9a('0x1e')](function(){_0x35aca7['status'](0xcc)[_0x7b9a('0x15')]();});}};}function handleEntityNotFound(_0x23219e,_0x5809f5){return function(_0x39b7ec){if(!_0x39b7ec){_0x23219e['sendStatus'](0x194);}return _0x39b7ec;};}function handleError(_0x31eb67,_0x3091ab){_0x3091ab=_0x3091ab||0x1f4;return function(_0x4c2271){logger['error'](_0x4c2271[_0x7b9a('0x20')]);if(_0x4c2271['name']){delete _0x4c2271['name'];}_0x31eb67[_0x7b9a('0x14')](_0x3091ab)['send'](_0x4c2271);};}exports['index']=function(_0x3847b4,_0x4d5880){var _0x5c89b6={},_0x314b6d={},_0x4fee38={'count':0x0,'rows':[]};var _0x1553ae=_[_0x7b9a('0x21')](db[_0x7b9a('0x22')]['rawAttributes'],function(_0x45ccf5){return{'name':_0x45ccf5[_0x7b9a('0x23')],'type':_0x45ccf5[_0x7b9a('0x24')][_0x7b9a('0x25')]};});_0x314b6d[_0x7b9a('0x26')]=_[_0x7b9a('0x21')](_0x1553ae,'name');_0x314b6d['query']=_[_0x7b9a('0x27')](_0x3847b4[_0x7b9a('0x28')]);_0x314b6d[_0x7b9a('0x29')]=_['intersection'](_0x314b6d[_0x7b9a('0x26')],_0x314b6d[_0x7b9a('0x28')]);_0x5c89b6['attributes']=_['intersection'](_0x314b6d[_0x7b9a('0x26')],qs[_0x7b9a('0x2a')](_0x3847b4['query'][_0x7b9a('0x2a')]));_0x5c89b6[_0x7b9a('0x2b')]=_0x5c89b6[_0x7b9a('0x2b')][_0x7b9a('0x2c')]?_0x5c89b6[_0x7b9a('0x2b')]:_0x314b6d['model'];if(!_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x2d')](_0x7b9a('0x2e'))){_0x5c89b6[_0x7b9a('0x18')]=qs[_0x7b9a('0x18')](_0x3847b4[_0x7b9a('0x28')]['limit']);_0x5c89b6['offset']=qs[_0x7b9a('0x17')](_0x3847b4[_0x7b9a('0x28')]['offset']);}_0x5c89b6[_0x7b9a('0x2f')]=qs[_0x7b9a('0x30')](_0x3847b4[_0x7b9a('0x28')]['sort']);_0x5c89b6[_0x7b9a('0x31')]=qs[_0x7b9a('0x29')](_['pick'](_0x3847b4['query'],_0x314b6d[_0x7b9a('0x29')]),_0x1553ae);if(_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x32')]){_0x5c89b6[_0x7b9a('0x31')]=_[_0x7b9a('0x33')](_0x5c89b6[_0x7b9a('0x31')],{'$or':_[_0x7b9a('0x21')](_0x1553ae,function(_0x380f4b){if(_0x380f4b['type']!==_0x7b9a('0x34')){var _0x5ac175={};_0x5ac175[_0x380f4b[_0x7b9a('0x35')]]={'$like':'%'+_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x32')]+'%'};return _0x5ac175;}})});}_0x5c89b6=_[_0x7b9a('0x33')]({},_0x5c89b6,_0x3847b4[_0x7b9a('0x36')]);var _0x89951b={'where':_0x5c89b6['where']};return db[_0x7b9a('0x22')][_0x7b9a('0x19')](_0x89951b)[_0x7b9a('0x1e')](function(_0x1bc1f0){_0x4fee38['count']=_0x1bc1f0;if(_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x37')]){_0x5c89b6[_0x7b9a('0x38')]=[{'all':!![]}];}return db[_0x7b9a('0x22')]['findAll'](_0x5c89b6);})[_0x7b9a('0x1e')](function(_0x53d89a){_0x4fee38[_0x7b9a('0x39')]=_0x53d89a;return _0x4fee38;})[_0x7b9a('0x1e')](respondWithFilteredResult(_0x4d5880,_0x5c89b6))[_0x7b9a('0x3a')](handleError(_0x4d5880,null));};exports[_0x7b9a('0x3b')]=function(_0x43fad0,_0x41f541){var _0x56e274={'raw':!![],'where':{'id':_0x43fad0[_0x7b9a('0x3c')]['id']}},_0x33edc6={};_0x33edc6[_0x7b9a('0x26')]=_['keys'](db['WhatsappQueueReport'][_0x7b9a('0x3d')]);_0x33edc6[_0x7b9a('0x28')]=_[_0x7b9a('0x27')](_0x43fad0[_0x7b9a('0x28')]);_0x33edc6[_0x7b9a('0x29')]=_[_0x7b9a('0x3e')](_0x33edc6['model'],_0x33edc6['query']);_0x56e274['attributes']=_[_0x7b9a('0x3e')](_0x33edc6[_0x7b9a('0x26')],qs['fields'](_0x43fad0[_0x7b9a('0x28')][_0x7b9a('0x2a')]));_0x56e274[_0x7b9a('0x2b')]=_0x56e274['attributes'][_0x7b9a('0x2c')]?_0x56e274['attributes']:_0x33edc6[_0x7b9a('0x26')];if(_0x43fad0[_0x7b9a('0x28')][_0x7b9a('0x37')]){_0x56e274[_0x7b9a('0x38')]=[{'all':!![]}];}_0x56e274=_[_0x7b9a('0x33')]({},_0x56e274,_0x43fad0['options']);return db[_0x7b9a('0x22')]['find'](_0x56e274)[_0x7b9a('0x1e')](handleEntityNotFound(_0x41f541,null))['then'](respondWithResult(_0x41f541,null))['catch'](handleError(_0x41f541,null));};exports[_0x7b9a('0x3f')]=function(_0x3727ef,_0x717d08){return db[_0x7b9a('0x22')][_0x7b9a('0x3f')](_0x3727ef[_0x7b9a('0x40')],{})[_0x7b9a('0x1e')](respondWithResult(_0x717d08,0xc9))[_0x7b9a('0x3a')](handleError(_0x717d08,null));};exports[_0x7b9a('0x1d')]=function(_0x5088c7,_0x1d7957){if(_0x5088c7[_0x7b9a('0x40')]['id']){delete _0x5088c7['body']['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x5088c7[_0x7b9a('0x3c')]['id']}})[_0x7b9a('0x1e')](handleEntityNotFound(_0x1d7957,null))[_0x7b9a('0x1e')](saveUpdates(_0x5088c7[_0x7b9a('0x40')],null))['then'](respondWithResult(_0x1d7957,null))[_0x7b9a('0x3a')](handleError(_0x1d7957,null));};exports[_0x7b9a('0x1f')]=function(_0x287dea,_0x33b200){return db[_0x7b9a('0x22')]['find']({'where':{'id':_0x287dea[_0x7b9a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x33b200,null))[_0x7b9a('0x1e')](removeEntity(_0x33b200,null))[_0x7b9a('0x3a')](handleError(_0x33b200,null));};exports[_0x7b9a('0x41')]=function(_0x3f42a2,_0x52f2ca){return db[_0x7b9a('0x22')][_0x7b9a('0x41')]()[_0x7b9a('0x1e')](respondWithResult(_0x52f2ca,null))[_0x7b9a('0x3a')](handleError(_0x52f2ca,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 458b549..de0f8b8 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 _0xb9ce=['exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x3e572e,_0x22e1ef){var _0x5b4da7=function(_0x47b514){while(--_0x47b514){_0x3e572e['push'](_0x3e572e['shift']());}};_0x5b4da7(++_0x22e1ef);}(_0xb9ce,0x163));var _0xeb9c=function(_0x375ae8,_0x2c5ff3){_0x375ae8=_0x375ae8-0x0;var _0x25513b=_0xb9ce[_0x375ae8];return _0x25513b;};'use strict';var _=require('lodash');var util=require(_0xeb9c('0x0'));var logger=require(_0xeb9c('0x1'))(_0xeb9c('0x2'));var moment=require(_0xeb9c('0x3'));var BPromise=require(_0xeb9c('0x4'));var rp=require(_0xeb9c('0x5'));var fs=require('fs');var path=require(_0xeb9c('0x6'));var rimraf=require('rimraf');var config=require(_0xeb9c('0x7'));var attributes=require(_0xeb9c('0x8'));module[_0xeb9c('0x9')]=function(_0x8e798d,_0x3771d6){return _0x8e798d[_0xeb9c('0xa')](_0xeb9c('0xb'),attributes,{'tableName':_0xeb9c('0xc'),'paranoid':![],'indexes':[{'name':_0xeb9c('0xd'),'fields':[_0xeb9c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad08=['./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xad08,0x1c6));var _0x8ad0=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xad08[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x8ad0('0x0'));var util=require(_0x8ad0('0x1'));var logger=require(_0x8ad0('0x2'))(_0x8ad0('0x3'));var moment=require(_0x8ad0('0x4'));var BPromise=require(_0x8ad0('0x5'));var rp=require(_0x8ad0('0x6'));var fs=require('fs');var path=require(_0x8ad0('0x7'));var rimraf=require(_0x8ad0('0x8'));var config=require(_0x8ad0('0x9'));var attributes=require(_0x8ad0('0xa'));module[_0x8ad0('0xb')]=function(_0x93471,_0x9faa4c){return _0x93471[_0x8ad0('0xc')](_0x8ad0('0xd'),attributes,{'tableName':_0x8ad0('0xe'),'paranoid':![],'indexes':[{'name':_0x8ad0('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 4db385e..317efbb 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 _0x8433=['WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch'];(function(_0x491ff4,_0x1c83fd){var _0x223621=function(_0x71f8b3){while(--_0x71f8b3){_0x491ff4['push'](_0x491ff4['shift']());}};_0x223621(++_0x1c83fd);}(_0x8433,0x1d8));var _0x3843=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0x8433[_0x151381];return _0x2afab6;};'use strict';var _=require(_0x3843('0x0'));var util=require(_0x3843('0x1'));var moment=require(_0x3843('0x2'));var BPromise=require(_0x3843('0x3'));var rs=require(_0x3843('0x4'));var fs=require('fs');var Redis=require(_0x3843('0x5'));var db=require(_0x3843('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3843('0x7'))('rpc');var config=require(_0x3843('0x8'));var jayson=require(_0x3843('0x9'));var client=jayson[_0x3843('0xa')][_0x3843('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15eb86,_0x46df13,_0x12d85a){return new BPromise(function(_0x7bcd82,_0x3694f2){return client[_0x3843('0xc')](_0x15eb86,_0x12d85a)[_0x3843('0xd')](function(_0x4ecd46){logger['info'](_0x3843('0xe'),_0x46df13,_0x3843('0xf'));logger[_0x3843('0x10')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x46df13,_0x3843('0xf'),JSON[_0x3843('0x11')](_0x4ecd46));if(_0x4ecd46[_0x3843('0x12')]){if(_0x4ecd46[_0x3843('0x12')]['code']===0x1f4){logger[_0x3843('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x46df13,_0x4ecd46[_0x3843('0x12')][_0x3843('0x13')]);return _0x3694f2(_0x4ecd46[_0x3843('0x12')][_0x3843('0x13')]);}logger[_0x3843('0x12')](_0x3843('0xe'),_0x46df13,_0x4ecd46[_0x3843('0x12')][_0x3843('0x13')]);return _0x7bcd82(_0x4ecd46[_0x3843('0x12')][_0x3843('0x13')]);}else{logger[_0x3843('0x14')](_0x3843('0xe'),_0x46df13,_0x3843('0xf'));_0x7bcd82(_0x4ecd46[_0x3843('0x15')][_0x3843('0x13')]);}})[_0x3843('0x16')](function(_0x1238b5){logger[_0x3843('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x46df13,_0x1238b5);_0x3694f2(_0x1238b5);});});}exports['CreateWhatsappQueueReport']=function(_0x44fcef){var _0x51ac44=this;return new Promise(function(_0x323f2c,_0x27d6a4){return db[_0x3843('0x17')][_0x3843('0x18')](_0x44fcef[_0x3843('0x19')],{'raw':_0x44fcef[_0x3843('0x1a')]?_0x44fcef[_0x3843('0x1a')][_0x3843('0x1b')]===undefined?!![]:![]:!![]})[_0x3843('0xd')](function(_0xa2da5){logger[_0x3843('0x14')](_0x3843('0x1c'),_0x44fcef);logger[_0x3843('0x10')](_0x3843('0x1c'),_0x44fcef,JSON[_0x3843('0x11')](_0xa2da5));_0x323f2c(_0xa2da5);})['catch'](function(_0x309c3f){logger[_0x3843('0x12')]('CreateWhatsappQueueReport',_0x309c3f[_0x3843('0x13')],_0x44fcef);_0x27d6a4(_0x51ac44['error'](0x1f4,_0x309c3f[_0x3843('0x13')]));});});};exports[_0x3843('0x1d')]=function(_0x4af4e1){var _0x19f8bd=this;return new Promise(function(_0x4219b7,_0x420a2a){return db[_0x3843('0x17')][_0x3843('0x1e')](_0x4af4e1['body'],{'raw':_0x4af4e1[_0x3843('0x1a')]?_0x4af4e1[_0x3843('0x1a')][_0x3843('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4af4e1['options']?_0x4af4e1[_0x3843('0x1a')][_0x3843('0x1f')]||null:null,'attributes':_0x4af4e1[_0x3843('0x1a')]?_0x4af4e1[_0x3843('0x1a')][_0x3843('0x20')]||null:null,'limit':_0x4af4e1['options']?_0x4af4e1[_0x3843('0x1a')]['limit']||null:null})[_0x3843('0xd')](function(_0x139304){logger[_0x3843('0x14')](_0x3843('0x1d'),_0x4af4e1);logger[_0x3843('0x10')](_0x3843('0x1d'),_0x4af4e1,JSON[_0x3843('0x11')](_0x139304));_0x4219b7(_0x139304);})[_0x3843('0x16')](function(_0x2e114e){logger[_0x3843('0x12')](_0x3843('0x1d'),_0x2e114e[_0x3843('0x13')],_0x4af4e1);_0x420a2a(_0x19f8bd[_0x3843('0x12')](0x1f4,_0x2e114e[_0x3843('0x13')]));});});}; \ No newline at end of file +var _0x2608=['update','body','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','UpdateWhatsappQueueReport'];(function(_0x278dba,_0x429ee3){var _0x207db9=function(_0x562531){while(--_0x562531){_0x278dba['push'](_0x278dba['shift']());}};_0x207db9(++_0x429ee3);}(_0x2608,0x1d4));var _0x8260=function(_0x6943f7,_0x498a1f){_0x6943f7=_0x6943f7-0x0;var _0x4e80b0=_0x2608[_0x6943f7];return _0x4e80b0;};'use strict';var _=require(_0x8260('0x0'));var util=require(_0x8260('0x1'));var moment=require(_0x8260('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8260('0x3'));var db=require(_0x8260('0x4'))['db'];var utils=require(_0x8260('0x5'));var logger=require(_0x8260('0x6'))('rpc');var config=require(_0x8260('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x255e35,_0x13f24d,_0x169131){return new BPromise(function(_0x114280,_0x350e5d){return client['request'](_0x255e35,_0x169131)[_0x8260('0x8')](function(_0x333961){logger[_0x8260('0x9')](_0x8260('0xa'),_0x13f24d,_0x8260('0xb'));logger[_0x8260('0xc')](_0x8260('0xd'),_0x13f24d,_0x8260('0xb'),JSON[_0x8260('0xe')](_0x333961));if(_0x333961[_0x8260('0xf')]){if(_0x333961[_0x8260('0xf')][_0x8260('0x10')]===0x1f4){logger[_0x8260('0xf')](_0x8260('0xa'),_0x13f24d,_0x333961['error'][_0x8260('0x11')]);return _0x350e5d(_0x333961[_0x8260('0xf')][_0x8260('0x11')]);}logger['error'](_0x8260('0xa'),_0x13f24d,_0x333961[_0x8260('0xf')][_0x8260('0x11')]);return _0x114280(_0x333961[_0x8260('0xf')]['message']);}else{logger['info'](_0x8260('0xa'),_0x13f24d,_0x8260('0xb'));_0x114280(_0x333961['result'][_0x8260('0x11')]);}})[_0x8260('0x12')](function(_0x9c68af){logger[_0x8260('0xf')](_0x8260('0xa'),_0x13f24d,_0x9c68af);_0x350e5d(_0x9c68af);});});}exports[_0x8260('0x13')]=function(_0x30d40a){var _0x5011aa=this;return new Promise(function(_0x109cfa,_0x32c8df){return db[_0x8260('0x14')][_0x8260('0x15')](_0x30d40a['body'],{'raw':_0x30d40a[_0x8260('0x16')]?_0x30d40a[_0x8260('0x16')][_0x8260('0x17')]===undefined?!![]:![]:!![]})[_0x8260('0x8')](function(_0x44da58){logger[_0x8260('0x9')]('CreateWhatsappQueueReport',_0x30d40a);logger['debug'](_0x8260('0x13'),_0x30d40a,JSON['stringify'](_0x44da58));_0x109cfa(_0x44da58);})[_0x8260('0x12')](function(_0x35d693){logger['error'](_0x8260('0x13'),_0x35d693[_0x8260('0x11')],_0x30d40a);_0x32c8df(_0x5011aa[_0x8260('0xf')](0x1f4,_0x35d693[_0x8260('0x11')]));});});};exports[_0x8260('0x18')]=function(_0x1ab74f){var _0x5b0edd=this;return new Promise(function(_0x512717,_0x2483aa){return db[_0x8260('0x14')][_0x8260('0x19')](_0x1ab74f[_0x8260('0x1a')],{'raw':_0x1ab74f['options']?_0x1ab74f[_0x8260('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ab74f[_0x8260('0x16')]?_0x1ab74f['options']['where']||null:null,'attributes':_0x1ab74f['options']?_0x1ab74f[_0x8260('0x16')][_0x8260('0x1b')]||null:null,'limit':_0x1ab74f[_0x8260('0x16')]?_0x1ab74f['options'][_0x8260('0x1c')]||null:null})[_0x8260('0x8')](function(_0xcf9d41){logger[_0x8260('0x9')]('UpdateWhatsappQueueReport',_0x1ab74f);logger[_0x8260('0xc')](_0x8260('0x18'),_0x1ab74f,JSON['stringify'](_0xcf9d41));_0x512717(_0xcf9d41);})['catch'](function(_0x3b8310){logger['error'](_0x8260('0x18'),_0x3b8310[_0x8260('0x11')],_0x1ab74f);_0x2483aa(_0x5b0edd[_0x8260('0xf')](0x1f4,_0x3b8310[_0x8260('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 224d5af..c320030 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 _0xa865=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./whatsappTransferReport.controller','get','isAuthenticated','describe','show','post','create','put','/:id','update'];(function(_0x1a099b,_0x1209e0){var _0x5ca45f=function(_0x3e0e73){while(--_0x3e0e73){_0x1a099b['push'](_0x1a099b['shift']());}};_0x5ca45f(++_0x1209e0);}(_0xa865,0x132));var _0x5a86=function(_0x1b56ac,_0x32127f){_0x1b56ac=_0x1b56ac-0x0;var _0x4eea86=_0xa865[_0x1b56ac];return _0x4eea86;};'use strict';var multer=require(_0x5a86('0x0'));var util=require(_0x5a86('0x1'));var path=require(_0x5a86('0x2'));var timeout=require(_0x5a86('0x3'));var express=require('express');var router=express[_0x5a86('0x4')]();var fs_extra=require(_0x5a86('0x5'));var auth=require(_0x5a86('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5a86('0x7'));router[_0x5a86('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5a86('0x8')]('/describe',auth[_0x5a86('0x9')](),controller[_0x5a86('0xa')]);router[_0x5a86('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x5a86('0xb')]);router[_0x5a86('0xc')]('/',auth[_0x5a86('0x9')](),controller[_0x5a86('0xd')]);router[_0x5a86('0xe')](_0x5a86('0xf'),auth[_0x5a86('0x9')](),controller[_0x5a86('0x10')]);router['delete'](_0x5a86('0xf'),auth['isAuthenticated'](),controller[_0x5a86('0x11')]);module[_0x5a86('0x12')]=router; \ No newline at end of file +var _0xf73a=['index','/describe','/:id','show','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x369cf2,_0x47e28c){var _0x5c7d3e=function(_0x4143d9){while(--_0x4143d9){_0x369cf2['push'](_0x369cf2['shift']());}};_0x5c7d3e(++_0x47e28c);}(_0xf73a,0x76));var _0xaf73=function(_0x46e9b4,_0x46b06c){_0x46e9b4=_0x46e9b4-0x0;var _0x129185=_0xf73a[_0x46e9b4];return _0x129185;};'use strict';var multer=require('multer');var util=require(_0xaf73('0x0'));var path=require(_0xaf73('0x1'));var timeout=require('connect-timeout');var express=require(_0xaf73('0x2'));var router=express[_0xaf73('0x3')]();var fs_extra=require(_0xaf73('0x4'));var auth=require(_0xaf73('0x5'));var interaction=require(_0xaf73('0x6'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0xaf73('0x7')](),controller[_0xaf73('0x8')]);router['get'](_0xaf73('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xaf73('0xa'),auth[_0xaf73('0x7')](),controller[_0xaf73('0xb')]);router['post']('/',auth[_0xaf73('0x7')](),controller[_0xaf73('0xc')]);router[_0xaf73('0xd')]('/:id',auth[_0xaf73('0x7')](),controller[_0xaf73('0xe')]);router[_0xaf73('0xf')](_0xaf73('0xa'),auth[_0xaf73('0x7')](),controller[_0xaf73('0x10')]);module[_0xaf73('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 36a7e7e..b9b384f 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 _0xb12d=['STRING','account','queue','DATE','sequelize','exports'];(function(_0x87667f,_0x2fa934){var _0x1c162b=function(_0x4da2ca){while(--_0x4da2ca){_0x87667f['push'](_0x87667f['shift']());}};_0x1c162b(++_0x2fa934);}(_0xb12d,0x124));var _0xdb12=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0xb12d[_0xf0bc07];return _0x1c50c2;};'use strict';var Sequelize=require(_0xdb12('0x0'));module[_0xdb12('0x1')]={'uniqueid':{'type':Sequelize[_0xdb12('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xdb12('0x3'),'agent',_0xdb12('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xdb12('0x5')]}}; \ No newline at end of file +var _0xc19f=['STRING','ENUM','queue','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc19f,0x164));var _0xfc19=function(_0x25958d,_0x19c086){_0x25958d=_0x25958d-0x0;var _0x414bad=_0xc19f[_0x25958d];return _0x414bad;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xfc19('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xfc19('0x1')]('account','agent',_0xfc19('0x2')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xfc19('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 95124b8..edc1cb2 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 _0x8ce2=['attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','map','VIRTUAL','filter','options','include','rows','catch','show','params','length','includeAll','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','save','then','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','fieldName','type','model','keys','query','filters'];(function(_0x11bd59,_0x4e54ca){var _0x515581=function(_0x59df62){while(--_0x59df62){_0x11bd59['push'](_0x11bd59['shift']());}};_0x515581(++_0x4e54ca);}(_0x8ce2,0x18b));var _0x28ce=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x8ce2[_0x334841];return _0x5beb4b;};'use strict';var emlformat=require(_0x28ce('0x0'));var rimraf=require(_0x28ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28ce('0x2'));var rp=require(_0x28ce('0x3'));var moment=require(_0x28ce('0x4'));var BPromise=require(_0x28ce('0x5'));var Mustache=require(_0x28ce('0x6'));var util=require(_0x28ce('0x7'));var path=require('path');var sox=require(_0x28ce('0x8'));var csv=require(_0x28ce('0x9'));var ejs=require(_0x28ce('0xa'));var fs=require('fs');var fs_extra=require(_0x28ce('0xb'));var _=require(_0x28ce('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x28ce('0xd'));var deskjs=require(_0x28ce('0xe'));var toCsv=require(_0x28ce('0x9'));var querystring=require(_0x28ce('0xf'));var Papa=require(_0x28ce('0x10'));var Redis=require(_0x28ce('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x28ce('0x12'));var as=require(_0x28ce('0x13'));var hardwareService=require(_0x28ce('0x14'));var logger=require(_0x28ce('0x15'))('api');var utils=require(_0x28ce('0x16'));var config=require(_0x28ce('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x28ce('0x18'))['db'];function respondWithStatusCode(_0x565301,_0x3f7a82){_0x3f7a82=_0x3f7a82||0xcc;return function(_0x14d096){if(_0x14d096){return _0x565301[_0x28ce('0x19')](_0x3f7a82);}return _0x565301['status'](_0x3f7a82)[_0x28ce('0x1a')]();};}function respondWithResult(_0x39f188,_0x2f08e2){_0x2f08e2=_0x2f08e2||0xc8;return function(_0x3d557f){if(_0x3d557f){return _0x39f188[_0x28ce('0x1b')](_0x2f08e2)[_0x28ce('0x1c')](_0x3d557f);}};}function respondWithFilteredResult(_0x46c874,_0x3e02de){return function(_0x44e3eb){if(_0x44e3eb){var _0x52a3e2=typeof _0x3e02de[_0x28ce('0x1d')]===_0x28ce('0x1e')&&typeof _0x3e02de[_0x28ce('0x1f')]===_0x28ce('0x1e');var _0x158b18=_0x44e3eb[_0x28ce('0x20')];var _0x1b1411=_0x52a3e2?0x0:_0x3e02de[_0x28ce('0x1d')];var _0x1e4eec=_0x52a3e2?_0x44e3eb[_0x28ce('0x20')]:_0x3e02de['offset']+_0x3e02de['limit'];var _0x2f1468;if(_0x1e4eec>=_0x158b18){_0x1e4eec=_0x158b18;_0x2f1468=0xc8;}else{_0x2f1468=0xce;}_0x46c874[_0x28ce('0x1b')](_0x2f1468);return _0x46c874[_0x28ce('0x21')]('Content-Range',_0x1b1411+'-'+_0x1e4eec+'/'+_0x158b18)[_0x28ce('0x1c')](_0x44e3eb);}return null;};}function patchUpdates(_0x2c9a64){return function(_0x1d2ebf){try{jsonpatch['apply'](_0x1d2ebf,_0x2c9a64,!![]);}catch(_0x4c6b9f){return BPromise['reject'](_0x4c6b9f);}return _0x1d2ebf[_0x28ce('0x22')]();};}function saveUpdates(_0xd1ced5,_0x22c6aa){return function(_0x2d4e8a){if(_0x2d4e8a){return _0x2d4e8a['update'](_0xd1ced5)['then'](function(_0x8ea2c9){return _0x8ea2c9;});}return null;};}function removeEntity(_0x58cc84,_0x6ff15c){return function(_0x5017c7){if(_0x5017c7){return _0x5017c7['destroy']()[_0x28ce('0x23')](function(){_0x58cc84[_0x28ce('0x1b')](0xcc)[_0x28ce('0x1a')]();});}};}function handleEntityNotFound(_0x1e71ca,_0x51a015){return function(_0x231b95){if(!_0x231b95){_0x1e71ca[_0x28ce('0x19')](0x194);}return _0x231b95;};}function handleError(_0x4667cd,_0x2ef379){_0x2ef379=_0x2ef379||0x1f4;return function(_0x2f21de){logger[_0x28ce('0x24')](_0x2f21de[_0x28ce('0x25')]);if(_0x2f21de[_0x28ce('0x26')]){delete _0x2f21de['name'];}_0x4667cd[_0x28ce('0x1b')](_0x2ef379)[_0x28ce('0x27')](_0x2f21de);};}exports[_0x28ce('0x28')]=function(_0x186639,_0x121a9a){var _0x37c4d4={},_0x9f5834={},_0x3f5c2b={'count':0x0,'rows':[]};var _0x12c91e=_['map'](db[_0x28ce('0x29')][_0x28ce('0x2a')],function(_0x89bc8c){return{'name':_0x89bc8c[_0x28ce('0x2b')],'type':_0x89bc8c[_0x28ce('0x2c')]['key']};});_0x9f5834[_0x28ce('0x2d')]=_['map'](_0x12c91e,_0x28ce('0x26'));_0x9f5834['query']=_[_0x28ce('0x2e')](_0x186639[_0x28ce('0x2f')]);_0x9f5834[_0x28ce('0x30')]=_['intersection'](_0x9f5834['model'],_0x9f5834[_0x28ce('0x2f')]);_0x37c4d4[_0x28ce('0x31')]=_[_0x28ce('0x32')](_0x9f5834[_0x28ce('0x2d')],qs[_0x28ce('0x33')](_0x186639[_0x28ce('0x2f')][_0x28ce('0x33')]));_0x37c4d4[_0x28ce('0x31')]=_0x37c4d4[_0x28ce('0x31')]['length']?_0x37c4d4[_0x28ce('0x31')]:_0x9f5834[_0x28ce('0x2d')];if(!_0x186639[_0x28ce('0x2f')][_0x28ce('0x34')](_0x28ce('0x35'))){_0x37c4d4[_0x28ce('0x1f')]=qs[_0x28ce('0x1f')](_0x186639['query'][_0x28ce('0x1f')]);_0x37c4d4['offset']=qs[_0x28ce('0x1d')](_0x186639['query'][_0x28ce('0x1d')]);}_0x37c4d4[_0x28ce('0x36')]=qs[_0x28ce('0x37')](_0x186639[_0x28ce('0x2f')][_0x28ce('0x37')]);_0x37c4d4['where']=qs[_0x28ce('0x30')](_['pick'](_0x186639['query'],_0x9f5834['filters']),_0x12c91e);if(_0x186639[_0x28ce('0x2f')]['filter']){_0x37c4d4[_0x28ce('0x38')]=_[_0x28ce('0x39')](_0x37c4d4[_0x28ce('0x38')],{'$or':_[_0x28ce('0x3a')](_0x12c91e,function(_0x2a506e){if(_0x2a506e[_0x28ce('0x2c')]!==_0x28ce('0x3b')){var _0x584f55={};_0x584f55[_0x2a506e[_0x28ce('0x26')]]={'$like':'%'+_0x186639[_0x28ce('0x2f')][_0x28ce('0x3c')]+'%'};return _0x584f55;}})});}_0x37c4d4=_[_0x28ce('0x39')]({},_0x37c4d4,_0x186639[_0x28ce('0x3d')]);var _0x4d0601={'where':_0x37c4d4[_0x28ce('0x38')]};return db[_0x28ce('0x29')][_0x28ce('0x20')](_0x4d0601)[_0x28ce('0x23')](function(_0x16e825){_0x3f5c2b[_0x28ce('0x20')]=_0x16e825;if(_0x186639['query']['includeAll']){_0x37c4d4[_0x28ce('0x3e')]=[{'all':!![]}];}return db[_0x28ce('0x29')]['findAll'](_0x37c4d4);})[_0x28ce('0x23')](function(_0xd54d31){_0x3f5c2b[_0x28ce('0x3f')]=_0xd54d31;return _0x3f5c2b;})[_0x28ce('0x23')](respondWithFilteredResult(_0x121a9a,_0x37c4d4))[_0x28ce('0x40')](handleError(_0x121a9a,null));};exports[_0x28ce('0x41')]=function(_0x2e2b84,_0x3afa17){var _0x480e11={'raw':!![],'where':{'id':_0x2e2b84[_0x28ce('0x42')]['id']}},_0x43f071={};_0x43f071[_0x28ce('0x2d')]=_[_0x28ce('0x2e')](db[_0x28ce('0x29')][_0x28ce('0x2a')]);_0x43f071[_0x28ce('0x2f')]=_[_0x28ce('0x2e')](_0x2e2b84[_0x28ce('0x2f')]);_0x43f071[_0x28ce('0x30')]=_[_0x28ce('0x32')](_0x43f071[_0x28ce('0x2d')],_0x43f071[_0x28ce('0x2f')]);_0x480e11[_0x28ce('0x31')]=_['intersection'](_0x43f071[_0x28ce('0x2d')],qs[_0x28ce('0x33')](_0x2e2b84[_0x28ce('0x2f')][_0x28ce('0x33')]));_0x480e11[_0x28ce('0x31')]=_0x480e11['attributes'][_0x28ce('0x43')]?_0x480e11[_0x28ce('0x31')]:_0x43f071['model'];if(_0x2e2b84[_0x28ce('0x2f')][_0x28ce('0x44')]){_0x480e11[_0x28ce('0x3e')]=[{'all':!![]}];}_0x480e11=_[_0x28ce('0x39')]({},_0x480e11,_0x2e2b84[_0x28ce('0x3d')]);return db[_0x28ce('0x29')][_0x28ce('0x45')](_0x480e11)[_0x28ce('0x23')](handleEntityNotFound(_0x3afa17,null))[_0x28ce('0x23')](respondWithResult(_0x3afa17,null))[_0x28ce('0x40')](handleError(_0x3afa17,null));};exports[_0x28ce('0x46')]=function(_0x33a648,_0x3b2af5){return db[_0x28ce('0x29')][_0x28ce('0x46')](_0x33a648[_0x28ce('0x47')],{})[_0x28ce('0x23')](respondWithResult(_0x3b2af5,0xc9))[_0x28ce('0x40')](handleError(_0x3b2af5,null));};exports[_0x28ce('0x48')]=function(_0x40a570,_0x37b092){if(_0x40a570[_0x28ce('0x47')]['id']){delete _0x40a570[_0x28ce('0x47')]['id'];}return db[_0x28ce('0x29')]['find']({'where':{'id':_0x40a570[_0x28ce('0x42')]['id']}})[_0x28ce('0x23')](handleEntityNotFound(_0x37b092,null))[_0x28ce('0x23')](saveUpdates(_0x40a570[_0x28ce('0x47')],null))[_0x28ce('0x23')](respondWithResult(_0x37b092,null))['catch'](handleError(_0x37b092,null));};exports['destroy']=function(_0x164638,_0x495ca4){return db['WhatsappTransferReport'][_0x28ce('0x45')]({'where':{'id':_0x164638['params']['id']}})[_0x28ce('0x23')](handleEntityNotFound(_0x495ca4,null))['then'](removeEntity(_0x495ca4,null))[_0x28ce('0x40')](handleError(_0x495ca4,null));};exports[_0x28ce('0x49')]=function(_0x33f0ca,_0x30989a){return db[_0x28ce('0x29')][_0x28ce('0x49')]()['then'](respondWithResult(_0x30989a,null))[_0x28ce('0x40')](handleError(_0x30989a,null));}; \ No newline at end of file +var _0x834b=['Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','findAll','catch','show','params','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x26a810,_0x247776){var _0x4758a3=function(_0xa1fbb9){while(--_0xa1fbb9){_0x26a810['push'](_0x26a810['shift']());}};_0x4758a3(++_0x247776);}(_0x834b,0x113));var _0xb834=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x834b[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xb834('0x0'));var rimraf=require(_0xb834('0x1'));var zipdir=require(_0xb834('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb834('0x3'));var moment=require(_0xb834('0x4'));var BPromise=require(_0xb834('0x5'));var Mustache=require(_0xb834('0x6'));var util=require(_0xb834('0x7'));var path=require(_0xb834('0x8'));var sox=require(_0xb834('0x9'));var csv=require(_0xb834('0xa'));var ejs=require(_0xb834('0xb'));var fs=require('fs');var fs_extra=require(_0xb834('0xc'));var _=require(_0xb834('0xd'));var squel=require(_0xb834('0xe'));var crypto=require(_0xb834('0xf'));var jsforce=require(_0xb834('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb834('0xa'));var querystring=require(_0xb834('0x11'));var Papa=require(_0xb834('0x12'));var Redis=require(_0xb834('0x13'));var authService=require(_0xb834('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb834('0x15'));var hardwareService=require(_0xb834('0x16'));var logger=require(_0xb834('0x17'))('api');var utils=require(_0xb834('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb834('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d1109,_0xe8f8fe){_0xe8f8fe=_0xe8f8fe||0xcc;return function(_0xdcf002){if(_0xdcf002){return _0x3d1109[_0xb834('0x1a')](_0xe8f8fe);}return _0x3d1109[_0xb834('0x1b')](_0xe8f8fe)['end']();};}function respondWithResult(_0x3aa2a1,_0x1c5123){_0x1c5123=_0x1c5123||0xc8;return function(_0x36038f){if(_0x36038f){return _0x3aa2a1['status'](_0x1c5123)[_0xb834('0x1c')](_0x36038f);}};}function respondWithFilteredResult(_0xf20520,_0x1e7f86){return function(_0x1dccd8){if(_0x1dccd8){var _0x45eb2c=typeof _0x1e7f86[_0xb834('0x1d')]===_0xb834('0x1e')&&typeof _0x1e7f86[_0xb834('0x1f')]===_0xb834('0x1e');var _0x3b7389=_0x1dccd8[_0xb834('0x20')];var _0x3a0db9=_0x45eb2c?0x0:_0x1e7f86['offset'];var _0x15e9ae=_0x45eb2c?_0x1dccd8[_0xb834('0x20')]:_0x1e7f86[_0xb834('0x1d')]+_0x1e7f86['limit'];var _0x38193f;if(_0x15e9ae>=_0x3b7389){_0x15e9ae=_0x3b7389;_0x38193f=0xc8;}else{_0x38193f=0xce;}_0xf20520[_0xb834('0x1b')](_0x38193f);return _0xf20520['set'](_0xb834('0x21'),_0x3a0db9+'-'+_0x15e9ae+'/'+_0x3b7389)[_0xb834('0x1c')](_0x1dccd8);}return null;};}function patchUpdates(_0x31f0e8){return function(_0x4eec03){try{jsonpatch['apply'](_0x4eec03,_0x31f0e8,!![]);}catch(_0x36600c){return BPromise[_0xb834('0x22')](_0x36600c);}return _0x4eec03[_0xb834('0x23')]();};}function saveUpdates(_0x286217,_0x256924){return function(_0x1c2bf1){if(_0x1c2bf1){return _0x1c2bf1[_0xb834('0x24')](_0x286217)[_0xb834('0x25')](function(_0x3a6a66){return _0x3a6a66;});}return null;};}function removeEntity(_0x4f8a35,_0x3954ab){return function(_0x531dae){if(_0x531dae){return _0x531dae[_0xb834('0x26')]()[_0xb834('0x25')](function(){_0x4f8a35['status'](0xcc)[_0xb834('0x27')]();});}};}function handleEntityNotFound(_0x15b04c,_0x414e67){return function(_0x1d03ea){if(!_0x1d03ea){_0x15b04c[_0xb834('0x1a')](0x194);}return _0x1d03ea;};}function handleError(_0x22f42c,_0xba9ed6){_0xba9ed6=_0xba9ed6||0x1f4;return function(_0x3750ce){logger[_0xb834('0x28')](_0x3750ce[_0xb834('0x29')]);if(_0x3750ce[_0xb834('0x2a')]){delete _0x3750ce[_0xb834('0x2a')];}_0x22f42c[_0xb834('0x1b')](_0xba9ed6)[_0xb834('0x2b')](_0x3750ce);};}exports['index']=function(_0x33fcc6,_0x4d33c6){var _0x3b277c={},_0x225733={},_0x2f0239={'count':0x0,'rows':[]};var _0x69d58f=_[_0xb834('0x2c')](db[_0xb834('0x2d')][_0xb834('0x2e')],function(_0x1e7214){return{'name':_0x1e7214[_0xb834('0x2f')],'type':_0x1e7214[_0xb834('0x30')][_0xb834('0x31')]};});_0x225733['model']=_[_0xb834('0x2c')](_0x69d58f,_0xb834('0x2a'));_0x225733[_0xb834('0x32')]=_[_0xb834('0x33')](_0x33fcc6[_0xb834('0x32')]);_0x225733[_0xb834('0x34')]=_[_0xb834('0x35')](_0x225733[_0xb834('0x36')],_0x225733[_0xb834('0x32')]);_0x3b277c['attributes']=_[_0xb834('0x35')](_0x225733[_0xb834('0x36')],qs[_0xb834('0x37')](_0x33fcc6['query']['fields']));_0x3b277c[_0xb834('0x38')]=_0x3b277c[_0xb834('0x38')]['length']?_0x3b277c[_0xb834('0x38')]:_0x225733['model'];if(!_0x33fcc6[_0xb834('0x32')][_0xb834('0x39')](_0xb834('0x3a'))){_0x3b277c[_0xb834('0x1f')]=qs[_0xb834('0x1f')](_0x33fcc6[_0xb834('0x32')][_0xb834('0x1f')]);_0x3b277c[_0xb834('0x1d')]=qs['offset'](_0x33fcc6['query'][_0xb834('0x1d')]);}_0x3b277c[_0xb834('0x3b')]=qs[_0xb834('0x3c')](_0x33fcc6[_0xb834('0x32')][_0xb834('0x3c')]);_0x3b277c['where']=qs[_0xb834('0x34')](_[_0xb834('0x3d')](_0x33fcc6[_0xb834('0x32')],_0x225733[_0xb834('0x34')]),_0x69d58f);if(_0x33fcc6['query'][_0xb834('0x3e')]){_0x3b277c['where']=_[_0xb834('0x3f')](_0x3b277c[_0xb834('0x40')],{'$or':_[_0xb834('0x2c')](_0x69d58f,function(_0x527f70){if(_0x527f70[_0xb834('0x30')]!=='VIRTUAL'){var _0x1cd502={};_0x1cd502[_0x527f70[_0xb834('0x2a')]]={'$like':'%'+_0x33fcc6['query']['filter']+'%'};return _0x1cd502;}})});}_0x3b277c=_[_0xb834('0x3f')]({},_0x3b277c,_0x33fcc6[_0xb834('0x41')]);var _0x421894={'where':_0x3b277c[_0xb834('0x40')]};return db['WhatsappTransferReport'][_0xb834('0x20')](_0x421894)[_0xb834('0x25')](function(_0x452fc3){_0x2f0239[_0xb834('0x20')]=_0x452fc3;if(_0x33fcc6[_0xb834('0x32')][_0xb834('0x42')]){_0x3b277c['include']=[{'all':!![]}];}return db[_0xb834('0x2d')][_0xb834('0x43')](_0x3b277c);})[_0xb834('0x25')](function(_0x56e688){_0x2f0239['rows']=_0x56e688;return _0x2f0239;})[_0xb834('0x25')](respondWithFilteredResult(_0x4d33c6,_0x3b277c))[_0xb834('0x44')](handleError(_0x4d33c6,null));};exports[_0xb834('0x45')]=function(_0x2270b3,_0x83383d){var _0x234fbf={'raw':!![],'where':{'id':_0x2270b3[_0xb834('0x46')]['id']}},_0x47d10a={};_0x47d10a['model']=_['keys'](db['WhatsappTransferReport'][_0xb834('0x2e')]);_0x47d10a[_0xb834('0x32')]=_[_0xb834('0x33')](_0x2270b3[_0xb834('0x32')]);_0x47d10a['filters']=_[_0xb834('0x35')](_0x47d10a[_0xb834('0x36')],_0x47d10a['query']);_0x234fbf['attributes']=_[_0xb834('0x35')](_0x47d10a[_0xb834('0x36')],qs[_0xb834('0x37')](_0x2270b3[_0xb834('0x32')]['fields']));_0x234fbf[_0xb834('0x38')]=_0x234fbf['attributes'][_0xb834('0x47')]?_0x234fbf[_0xb834('0x38')]:_0x47d10a[_0xb834('0x36')];if(_0x2270b3[_0xb834('0x32')][_0xb834('0x42')]){_0x234fbf[_0xb834('0x48')]=[{'all':!![]}];}_0x234fbf=_['merge']({},_0x234fbf,_0x2270b3[_0xb834('0x41')]);return db[_0xb834('0x2d')][_0xb834('0x49')](_0x234fbf)['then'](handleEntityNotFound(_0x83383d,null))[_0xb834('0x25')](respondWithResult(_0x83383d,null))[_0xb834('0x44')](handleError(_0x83383d,null));};exports[_0xb834('0x4a')]=function(_0x1bf536,_0x5e7d62){return db[_0xb834('0x2d')]['create'](_0x1bf536[_0xb834('0x4b')],{})[_0xb834('0x25')](respondWithResult(_0x5e7d62,0xc9))[_0xb834('0x44')](handleError(_0x5e7d62,null));};exports['update']=function(_0x186d64,_0x533020){if(_0x186d64[_0xb834('0x4b')]['id']){delete _0x186d64['body']['id'];}return db[_0xb834('0x2d')][_0xb834('0x49')]({'where':{'id':_0x186d64['params']['id']}})['then'](handleEntityNotFound(_0x533020,null))['then'](saveUpdates(_0x186d64[_0xb834('0x4b')],null))[_0xb834('0x25')](respondWithResult(_0x533020,null))[_0xb834('0x44')](handleError(_0x533020,null));};exports['destroy']=function(_0x123109,_0x251033){return db[_0xb834('0x2d')][_0xb834('0x49')]({'where':{'id':_0x123109['params']['id']}})[_0xb834('0x25')](handleEntityNotFound(_0x251033,null))[_0xb834('0x25')](removeEntity(_0x251033,null))[_0xb834('0x44')](handleError(_0x251033,null));};exports[_0xb834('0x4c')]=function(_0x2cd0f7,_0x1e2e1a){return db[_0xb834('0x2d')]['describe']()[_0xb834('0x25')](respondWithResult(_0x1e2e1a,null))[_0xb834('0x44')](handleError(_0x1e2e1a,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 2a0b974..8148a23 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 _0x67a6=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x67a6,0xee));var _0x667a=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x67a6[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x667a('0x0'));var util=require(_0x667a('0x1'));var logger=require(_0x667a('0x2'))(_0x667a('0x3'));var moment=require(_0x667a('0x4'));var BPromise=require(_0x667a('0x5'));var rp=require(_0x667a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x667a('0x7'));var config=require(_0x667a('0x8'));var attributes=require('./whatsappTransferReport.attributes');module[_0x667a('0x9')]=function(_0x4eda9e,_0x3c209d){return _0x4eda9e[_0x667a('0xa')](_0x667a('0xb'),attributes,{'tableName':_0x667a('0xc'),'paranoid':![],'indexes':[{'name':_0x667a('0xd'),'fields':[_0x667a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4bab=['../../config/environment','define','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x278844,_0x10e567){var _0x135555=function(_0x53263c){while(--_0x53263c){_0x278844['push'](_0x278844['shift']());}};_0x135555(++_0x10e567);}(_0x4bab,0x1bc));var _0xb4ba=function(_0x11c7c9,_0x3fd959){_0x11c7c9=_0x11c7c9-0x0;var _0x2133c0=_0x4bab[_0x11c7c9];return _0x2133c0;};'use strict';var _=require(_0xb4ba('0x0'));var util=require(_0xb4ba('0x1'));var logger=require(_0xb4ba('0x2'))('api');var moment=require(_0xb4ba('0x3'));var BPromise=require(_0xb4ba('0x4'));var rp=require(_0xb4ba('0x5'));var fs=require('fs');var path=require(_0xb4ba('0x6'));var rimraf=require('rimraf');var config=require(_0xb4ba('0x7'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x455f74,_0x3e8fc4){return _0x455f74[_0xb4ba('0x8')]('WhatsappTransferReport',attributes,{'tableName':_0xb4ba('0x9'),'paranoid':![],'indexes':[{'name':_0xb4ba('0xa'),'fields':[_0xb4ba('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index e17cf7b..05e567e 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 _0x9196=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','WhatsappTransferReport,\x20%s,\x20%s'];(function(_0x3b1e89,_0x2228f8){var _0x5ea335=function(_0x24b0a2){while(--_0x24b0a2){_0x3b1e89['push'](_0x3b1e89['shift']());}};_0x5ea335(++_0x2228f8);}(_0x9196,0xd1));var _0x6919=function(_0x8e9386,_0x3cc60f){_0x8e9386=_0x8e9386-0x0;var _0x4abf26=_0x9196[_0x8e9386];return _0x4abf26;};'use strict';var _=require(_0x6919('0x0'));var util=require(_0x6919('0x1'));var moment=require('moment');var BPromise=require(_0x6919('0x2'));var rs=require(_0x6919('0x3'));var fs=require('fs');var Redis=require(_0x6919('0x4'));var db=require(_0x6919('0x5'))['db'];var utils=require(_0x6919('0x6'));var logger=require(_0x6919('0x7'))('rpc');var config=require(_0x6919('0x8'));var jayson=require(_0x6919('0x9'));var client=jayson[_0x6919('0xa')][_0x6919('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106ea3,_0x2b42a0,_0x2ec378){return new BPromise(function(_0x36c25f,_0x5cb09f){return client[_0x6919('0xc')](_0x106ea3,_0x2ec378)[_0x6919('0xd')](function(_0x1b4bab){logger[_0x6919('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2b42a0,'request\x20sent');logger['debug'](_0x6919('0xf'),_0x2b42a0,_0x6919('0x10'),JSON[_0x6919('0x11')](_0x1b4bab));if(_0x1b4bab[_0x6919('0x12')]){if(_0x1b4bab[_0x6919('0x12')]['code']===0x1f4){logger[_0x6919('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2b42a0,_0x1b4bab[_0x6919('0x12')]['message']);return _0x5cb09f(_0x1b4bab[_0x6919('0x12')][_0x6919('0x13')]);}logger[_0x6919('0x12')](_0x6919('0x14'),_0x2b42a0,_0x1b4bab[_0x6919('0x12')]['message']);return _0x36c25f(_0x1b4bab[_0x6919('0x12')]['message']);}else{logger[_0x6919('0xe')](_0x6919('0x14'),_0x2b42a0,'request\x20sent');_0x36c25f(_0x1b4bab[_0x6919('0x15')][_0x6919('0x13')]);}})[_0x6919('0x16')](function(_0x4cbc5f){logger[_0x6919('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2b42a0,_0x4cbc5f);_0x5cb09f(_0x4cbc5f);});});} \ No newline at end of file +var _0xdc31=['bluebird','../../mysqldb','../../config/utils','jayson/promise','client','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','moment'];(function(_0x4035d5,_0x23241d){var _0x4f4766=function(_0x7755c2){while(--_0x7755c2){_0x4035d5['push'](_0x4035d5['shift']());}};_0x4f4766(++_0x23241d);}(_0xdc31,0x9e));var _0x1dc3=function(_0x22d5a6,_0x14a62e){_0x22d5a6=_0x22d5a6-0x0;var _0x29785a=_0xdc31[_0x22d5a6];return _0x29785a;};'use strict';var _=require(_0x1dc3('0x0'));var util=require('util');var moment=require(_0x1dc3('0x1'));var BPromise=require(_0x1dc3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc3('0x3'))['db'];var utils=require(_0x1dc3('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1dc3('0x5'));var client=jayson[_0x1dc3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7cf67,_0x1bcf2b,_0x79c863){return new BPromise(function(_0x371f4a,_0x4db7c2){return client['request'](_0x7cf67,_0x79c863)[_0x1dc3('0x7')](function(_0x1ce205){logger['info'](_0x1dc3('0x8'),_0x1bcf2b,_0x1dc3('0x9'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x1bcf2b,_0x1dc3('0x9'),JSON[_0x1dc3('0xa')](_0x1ce205));if(_0x1ce205['error']){if(_0x1ce205[_0x1dc3('0xb')]['code']===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x1bcf2b,_0x1ce205['error'][_0x1dc3('0xc')]);return _0x4db7c2(_0x1ce205[_0x1dc3('0xb')][_0x1dc3('0xc')]);}logger['error'](_0x1dc3('0x8'),_0x1bcf2b,_0x1ce205[_0x1dc3('0xb')][_0x1dc3('0xc')]);return _0x371f4a(_0x1ce205['error'][_0x1dc3('0xc')]);}else{logger[_0x1dc3('0xd')](_0x1dc3('0x8'),_0x1bcf2b,_0x1dc3('0x9'));_0x371f4a(_0x1ce205[_0x1dc3('0xe')][_0x1dc3('0xc')]);}})[_0x1dc3('0xf')](function(_0x349272){logger['error'](_0x1dc3('0x8'),_0x1bcf2b,_0x349272);_0x4db7c2(_0x349272);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index be73cd9..58dd746 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8784=['lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','name','map','online','join','Offline\x20apps:','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s'];(function(_0x416a98,_0xcec305){var _0x33e6a4=function(_0x39d2b0){while(--_0x39d2b0){_0x416a98['push'](_0x416a98['shift']());}};_0x33e6a4(++_0xcec305);}(_0x8784,0x172));var _0x4878=function(_0xb5fc3e,_0x234703){_0xb5fc3e=_0xb5fc3e-0x0;var _0x2efc3c=_0x8784[_0xb5fc3e];return _0x2efc3c;};'use strict';var _=require(_0x4878('0x0'));var db=require(_0x4878('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x4878('0x2'));var rpc=require(_0x4878('0x3'));var config=require(_0x4878('0x4'));var logger=require(_0x4878('0x5'))(_0x4878('0x6'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0x4878('0x7'));var chat=require(_0x4878('0x8'));var whatsapp=require(_0x4878('0x9'));var transcribe=require(_0x4878('0xa'));var provider=require(_0x4878('0xb'));function main(){return db[_0x4878('0xc')][_0x4878('0xd')]()[_0x4878('0xe')](function(){if(config[_0x4878('0xf')]){return seedDb['default']();}})[_0x4878('0xe')](function(){return checkLicense[_0x4878('0x10')]();})[_0x4878('0xe')](function(){return rpc[_0x4878('0x11')]();})[_0x4878('0xe')](function(_0x1febf2){logger[_0x4878('0x12')](_0x1febf2);return chat[_0x4878('0x13')]();})[_0x4878('0xe')](function(){return whatsapp[_0x4878('0x13')]();})[_0x4878('0xe')](function(){return schedule[_0x4878('0x13')]();})['then'](function(){return transcribe[_0x4878('0x13')]();})[_0x4878('0xe')](function(){return provider[_0x4878('0x13')]();})['then'](function(_0x13a0ef){logger[_0x4878('0x12')](_0x13a0ef);return pm2['start'](pm2Config);})[_0x4878('0xe')](function(_0x5e67cc){var _0x4ec9f8=_0x5e67cc[_0x4878('0x14')](function(_0x41fefd){return typeof _0x41fefd[_0x4878('0x15')]===_0x4878('0x16')&&_0x41fefd[_0x4878('0x15')]>=0x0;});if(_0x4ec9f8['length']>0x0){throw new Error(_0x4ec9f8[_0x4878('0x17')]+_0x4878('0x18')+_['map'](_0x4ec9f8,function(_0x4319a8){return'\x22'+_0x4319a8['pm2_env'][_0x4878('0x19')]+'\x22';}));}logger['info']('Online\x20apps:',_[_0x4878('0x1a')](_[_0x4878('0x14')](_0x5e67cc,{'status':_0x4878('0x1b')}),_0x4878('0x19'))[_0x4878('0x1c')]());logger['info'](_0x4878('0x1d'),_[_0x4878('0x1a')](_[_0x4878('0x14')](_0x5e67cc,function(_0x436f62){return _0x436f62[_0x4878('0x1e')]!==_0x4878('0x1b');}),'name')[_0x4878('0x1c')]()||_0x4878('0x1f'));console[_0x4878('0x20')]('App\x20Ready!');})[_0x4878('0x21')](function(_0x38bc49){console['log'](_0x4878('0x22'),_0x38bc49);logger[_0x4878('0x23')](_0x4878('0x24'),_0x38bc49);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x3468=['start','filter','exitCode','length','pm2_env','Online\x20apps:','map','online','name','join','Offline\x20apps:','status','App\x20Ready!','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','lodash','./config/license','./config/logger','app','./config/pm2','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info'];(function(_0x159a8a,_0xf5a412){var _0x51b661=function(_0x18cc8b){while(--_0x18cc8b){_0x159a8a['push'](_0x159a8a['shift']());}};_0x51b661(++_0xf5a412);}(_0x3468,0x8d));var _0x8346=function(_0x1b8905,_0xa9692b){_0x1b8905=_0x1b8905-0x0;var _0x588b34=_0x3468[_0x1b8905];return _0x588b34;};'use strict';var _=require(_0x8346('0x0'));var db=require('./mysqldb')['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x8346('0x1'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0x8346('0x2'))(_0x8346('0x3'));var pm2=require(_0x8346('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0x8346('0x5'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x8346('0x6'));function main(){return db[_0x8346('0x7')][_0x8346('0x8')]()[_0x8346('0x9')](function(){if(config[_0x8346('0xa')]){return seedDb[_0x8346('0xb')]();}})[_0x8346('0x9')](function(){return checkLicense[_0x8346('0xb')]();})[_0x8346('0x9')](function(){return rpc[_0x8346('0xc')]();})[_0x8346('0x9')](function(_0x3caac8){logger[_0x8346('0xd')](_0x3caac8);return chat['start']();})[_0x8346('0x9')](function(){return whatsapp[_0x8346('0xe')]();})[_0x8346('0x9')](function(){return schedule[_0x8346('0xe')]();})[_0x8346('0x9')](function(){return transcribe[_0x8346('0xe')]();})['then'](function(){return provider[_0x8346('0xe')]();})[_0x8346('0x9')](function(_0x1338a8){logger[_0x8346('0xd')](_0x1338a8);return pm2[_0x8346('0xe')](pm2Config);})[_0x8346('0x9')](function(_0xdacffc){var _0x59492e=_0xdacffc[_0x8346('0xf')](function(_0x5e0d82){return typeof _0x5e0d82[_0x8346('0x10')]==='number'&&_0x5e0d82[_0x8346('0x10')]>=0x0;});if(_0x59492e['length']>0x0){throw new Error(_0x59492e[_0x8346('0x11')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x59492e,function(_0x2909e3){return'\x22'+_0x2909e3[_0x8346('0x12')]['name']+'\x22';}));}logger[_0x8346('0xd')](_0x8346('0x13'),_[_0x8346('0x14')](_['filter'](_0xdacffc,{'status':_0x8346('0x15')}),_0x8346('0x16'))[_0x8346('0x17')]());logger['info'](_0x8346('0x18'),_[_0x8346('0x14')](_[_0x8346('0xf')](_0xdacffc,function(_0x496892){return _0x496892[_0x8346('0x19')]!==_0x8346('0x15');}),_0x8346('0x16'))[_0x8346('0x17')]()||'None');console['log'](_0x8346('0x1a'));})['catch'](function(_0x2715ce){console[_0x8346('0x1b')](_0x8346('0x1c'),_0x2715ce);logger[_0x8346('0x1d')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x2715ce);process[_0x8346('0x1e')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index acd9ae5..75c482e 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 _0x9bde=['whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','disposition','then','status','unmanaged','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','User','find','authenticate','pass','json','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','isNil','generateApiKey','regenerateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','sign','secret','payload','options','promisify','verify','randomBytes','toString','hex','floor','now','HS512','../../config/environment','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1a19ab,_0x1576ae){_0x1a19ab=_0x1a19ab-0x0;var _0x3c7d02=_0x9bde[_0x1a19ab];return _0x3c7d02;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xe9bd('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xe9bd('0x1'));var encryptor=require('../encryptor');var _=require(_0xe9bd('0x2'));var jwt=require(_0xe9bd('0x3'));var expressJwt=require(_0xe9bd('0x4'));var compose=require(_0xe9bd('0x5'));var basicAuth=require(_0xe9bd('0x6'));var crypto=require(_0xe9bd('0x7'));var BPromise=require(_0xe9bd('0x8'));var util=require('util');var moment=require(_0xe9bd('0x9'));var validateJwt=expressJwt({'secret':config[_0xe9bd('0xa')][_0xe9bd('0xb')]});var userAttributes=['id',_0xe9bd('0xc'),_0xe9bd('0xd'),_0xe9bd('0xe'),_0xe9bd('0xf'),_0xe9bd('0x10'),_0xe9bd('0x11'),_0xe9bd('0x12'),'md5secret','voicePause',_0xe9bd('0x13'),_0xe9bd('0x14'),_0xe9bd('0x15'),'smsPause',_0xe9bd('0x16'),_0xe9bd('0x17'),_0xe9bd('0x18'),_0xe9bd('0x19'),'lastPauseAt',_0xe9bd('0x1a'),'allowmessenger',_0xe9bd('0x1b'),_0xe9bd('0x1c'),_0xe9bd('0x1d'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0xe9bd('0x1e'),_0xe9bd('0x1f'),_0xe9bd('0x20'),_0xe9bd('0x21'),_0xe9bd('0x22'),_0xe9bd('0x23'),_0xe9bd('0x24'),'hotdesk',_0xe9bd('0x25'),_0xe9bd('0x26'),_0xe9bd('0x27'),'settingsEnabled',_0xe9bd('0x28'),_0xe9bd('0x29'),_0xe9bd('0x2a'),_0xe9bd('0x2b'),'ignorePauseForPreviewCalls',_0xe9bd('0x2c'),'chatAutoanswer',_0xe9bd('0x2d'),'emailAutoanswer',_0xe9bd('0x2e'),_0xe9bd('0x2f'),_0xe9bd('0x30'),_0xe9bd('0x31'),_0xe9bd('0x32'),_0xe9bd('0x33'),_0xe9bd('0x34'),'whatsappAutoanswer',_0xe9bd('0x35')];exports[_0xe9bd('0x36')]=function(){return this['isAuthenticated'](!![])[_0xe9bd('0x37')](function(_0x505c23,_0x238ab1,_0x1b9cc9){if(_0x505c23[_0xe9bd('0x38')]){_0x1b9cc9();}else{return db[_0xe9bd('0x39')]['findOne']({'where':{'id':_0x505c23[_0xe9bd('0x3a')]['id']},'attributes':['id',_0xe9bd('0x3b'),_0xe9bd('0x3c')],'raw':!![]})[_0xe9bd('0x3d')](function(_0x2641be){if(_0x2641be&&_0x2641be[_0xe9bd('0x3b')]){return _0x238ab1[_0xe9bd('0x3e')](_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?0x195:0x193)['json']({'message':_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?'Unmanaged.':_0xe9bd('0x40')});}else{_0x1b9cc9();}})[_0xe9bd('0x41')](function(_0x119672){_0x1b9cc9(_0x119672);});}});};exports[_0xe9bd('0x42')]=function isAuthenticated(_0x141b95){return compose()[_0xe9bd('0x37')](function(_0x519f48,_0x5b7f1d,_0x1de54c){var _0x56e409;if(_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')]){if(_[_0xe9bd('0x45')](_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')],'Basic')){var _0x4b7bc2=basicAuth(_0x519f48);db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'name':_0x4b7bc2[_0xe9bd('0xe')]}})[_0xe9bd('0x3d')](function(_0xe2436){if(!_0xe2436||!_0xe2436[_0xe9bd('0x48')](_0x4b7bc2[_0xe9bd('0x49')])){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':'Wrong\x20credentials.'});}_0x519f48[_0xe9bd('0x38')]={'id':_0xe2436['id']};_0x1de54c();})[_0xe9bd('0x41')](function(_0x390a43){_0x1de54c(_0x390a43);});}else if(_['startsWith'](_0x519f48['headers'][_0xe9bd('0x44')],_0xe9bd('0x4b'))){validateJwt(_0x519f48,_0x5b7f1d,_0x1de54c);}else{if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}}}else if(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')]){try{var _0x1c6173={'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};verifyJwt(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')],_0x1c6173)[_0xe9bd('0x3d')](function(_0x199477){return db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'id':_0x199477[_0xe9bd('0x50')]}})[_0xe9bd('0x3d')](function(_0x4c689d){_0x56e409=_0x4c689d;return db[_0xe9bd('0x51')][_0xe9bd('0x52')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe9bd('0x53')],'raw':!![]});})[_0xe9bd('0x3d')](function(_0x4c7d47){if(!_0x56e409||!_['isEqual'](_0x56e409[_0xe9bd('0x54')],_0x199477[_0xe9bd('0x55')])){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x56')});}if(_0x56e409[_0xe9bd('0x57')]){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x56e409[_0xe9bd('0x58')]){if(_0x4c7d47[_0xe9bd('0x53')]>0x0){if(moment(_0x56e409[_0xe9bd('0x59')])[_0xe9bd('0x5a')](_0x4c7d47['blockDuration'],_0xe9bd('0x5b'))>moment()){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}_0x519f48[_0xe9bd('0x38')]={'id':_0x56e409['id']};_0x1de54c();});})[_0xe9bd('0x41')](function(){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0xcf9a0c){_0x1de54c(_0xcf9a0c);}}else if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d['status'](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}})[_0xe9bd('0x37')](function(_0x480797,_0x1ba613,_0x2923cf){if(_0x480797[_0xe9bd('0x38')]){db['User'][_0xe9bd('0x47')]({'where':{'id':_0x480797[_0xe9bd('0x38')]['id']},'attributes':userAttributes})[_0xe9bd('0x3d')](function(_0x388132){if(!_0x388132){return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5d')});}_0x480797[_0xe9bd('0x38')]=_0x388132;_0x2923cf();})[_0xe9bd('0x41')](function(_0x300e07){_0x2923cf(_0x300e07);});}else if(_0x141b95){_0x2923cf();}else{return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5e')});}});};exports[_0xe9bd('0x5f')]=function canUpdate(){return compose()[_0xe9bd('0x37')](function(_0x5b70d3,_0x5a86fd,_0x283e67){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x58828b){if(_0x58828b['update']){_0x283e67();}else{return _0x5a86fd[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0x39fb61){_0x283e67(_0x39fb61);});});};exports[_0xe9bd('0x62')]=function isWebrtcLicence(){return compose()[_0xe9bd('0x37')](function(_0x512899,_0x1e45fc,_0x4cc146){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x33ba69){if(_0x33ba69[_0xe9bd('0x63')]){_0x4cc146();}else{return _0x1e45fc[_0xe9bd('0x3e')](0x193)['json']({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0xe14fa4){_0x4cc146(_0xe14fa4);});});};exports['isMiddleware']=function(_0xff4e14,_0x476f23,_0x34f787){_0xff4e14['isMiddleware']=!![];return _0x34f787();};exports[_0xe9bd('0x64')]=function signToken(_0x27e7b0){return signJwt(_0x27e7b0);};exports[_0xe9bd('0x65')]=function(_0x10ec29,_0x1ee09c){if(!_0x10ec29['user']){return _0x1ee09c[_0xe9bd('0x3e')](0x194)['json']({'message':_0xe9bd('0x66')});}var _0x239be9={'payload':{'id':_0x10ec29[_0xe9bd('0x38')]['id'],'role':_0x10ec29[_0xe9bd('0x38')][_0xe9bd('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x239be9)['then'](function(_0x15d1d0){_0x1ee09c['cookie'](_0xe9bd('0x67'),_0x15d1d0);_0x1ee09c[_0xe9bd('0x68')]('/dashboards/general');})['catch'](function(_0x1ce539){return _0x1ee09c['status'](0x1f4)[_0xe9bd('0x69')](_0x1ce539);});};exports['retrieveApiKey']=function(_0x26b25a){if(_[_0xe9bd('0x6a')](_0x26b25a['apiKeyNonce'])||_[_0xe9bd('0x6a')](_0x26b25a['apiKeyIat'])){return null;}else{return createJwt(_0x26b25a);}};exports[_0xe9bd('0x6b')]=function(_0x2d9a94){_0x2d9a94[_0xe9bd('0x54')]=generateNonce();_0x2d9a94['apiKeyIat']=generateIssuedAt();return createJwt(_0x2d9a94);};exports[_0xe9bd('0x6c')]=function(_0x1d703f,_0x45b69e){var _0x232a36=_0x1d703f['query']['apikey'];if(_0x232a36){var _0x441f89={'nonce':_0x45b69e['apiKeyNonce'],'iat':_0x45b69e[_0xe9bd('0x6d')],'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};return verifyJwt(_0x232a36,_0x441f89)[_0xe9bd('0x3d')](function(){return generateApiKey(_0x45b69e);});}else{throw{'message':_0xe9bd('0x6e')};}};exports[_0xe9bd('0x6f')]=function(_0x373057){var _0x3381ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3381ee[_0xe9bd('0x70')](_0x373057))throw new db[(_0xe9bd('0x71'))][(_0xe9bd('0x72'))](_0xe9bd('0x73'));return;};exports['validatePasswordHistory']=function(_0x596a7d,_0x566dd8,_0x10e685){var _0x5a516e=encryptor[_0xe9bd('0x74')](_0x566dd8)[_0xe9bd('0x75')](',');for(var _0x90db01=0x0;_0x90db01<_0x10e685;_0x90db01++){if(!_0x5a516e[_0x90db01])break;if(_0x596a7d[_0xe9bd('0x76')]()===_0x5a516e[_0x90db01][_0xe9bd('0x76')]()){var _0xaf6ffd=util[_0xe9bd('0x77')](_0xe9bd('0x78'),_0x10e685);if(_0x10e685===0x1){_0xaf6ffd=_0xe9bd('0x79');}throw new db['Sequelize'][(_0xe9bd('0x72'))](_0xaf6ffd);}}return;};exports[_0xe9bd('0x7a')]=function(_0x3d3e74,_0x3f848d){var _0x4d58c1=_0x3f848d?encryptor[_0xe9bd('0x74')](_0x3f848d)[_0xe9bd('0x75')](','):[];if(_0x4d58c1[_0xe9bd('0x7b')]===0x5){_0x4d58c1['splice'](-0x1,0x1);}_0x4d58c1[_0xe9bd('0x7c')](_0x3d3e74);return encryptor[_0xe9bd('0x7d')](_0x4d58c1[_0xe9bd('0x7e')](','));};function signJwt(_0xfe82f7){var _0x4ee26a=BPromise['promisify'](jwt[_0xe9bd('0x7f')],{'context':jwt});var _0x188891=_0xfe82f7[_0xe9bd('0x80')]||config[_0xe9bd('0xa')]['session'];return new BPromise(function(_0x49add9,_0x305efa){_0x4ee26a(_0xfe82f7[_0xe9bd('0x81')],_0x188891,_0xfe82f7[_0xe9bd('0x82')])[_0xe9bd('0x3d')](function(_0x1fd2b5){_0x49add9(_0x1fd2b5);})[_0xe9bd('0x41')](function(_0x4870f8){_0x305efa(_0x4870f8);});});}function verifyJwt(_0x179c8d,_0x5681ab,_0x27e07c){var _0x28dd03=BPromise[_0xe9bd('0x83')](jwt[_0xe9bd('0x84')],{'context':jwt});var _0x5bc1f8=_0x27e07c||config[_0xe9bd('0xa')][_0xe9bd('0xb')];return new BPromise(function(_0x3b0190,_0x4f35c4){_0x28dd03(_0x179c8d,_0x5bc1f8,_0x5681ab)[_0xe9bd('0x3d')](function(_0x1a9d0c){_0x3b0190(_0x1a9d0c);})[_0xe9bd('0x41')](function(_0x3e3e05){_0x4f35c4(_0x3e3e05);});});}function generateNonce(){return crypto[_0xe9bd('0x85')](0x10)[_0xe9bd('0x86')](_0xe9bd('0x87'));}function generateIssuedAt(){return Math[_0xe9bd('0x88')](Date[_0xe9bd('0x89')]()/0x3e8)[_0xe9bd('0x86')]();}function createJwt(_0x14c599){var _0x37d07a={'payload':{'iat':_0x14c599['apiKeyIat'],'nonce':_0x14c599[_0xe9bd('0x54')]},'options':{'algorithm':_0xe9bd('0x8a'),'subject':_0x14c599['id']['toString'](),'issuer':hardwareConf[_0xe9bd('0x4f')](),'audience':hardwareConf[_0xe9bd('0x4f')]()}};return signJwt(_0x37d07a)['then'](function(_0x561165){return{'iat':_0x14c599[_0xe9bd('0x6d')],'nonce':_0x14c599[_0xe9bd('0x54')],'token':_0x561165};});} \ No newline at end of file +var _0x55ca=['It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','splice','unshift','encryptString','join','promisify','payload','options','session','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','internal','email','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','isAuthenticated','use','user','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','headers','authorization','startsWith','User','find','name','authenticate','pass','Wrong\x20credentials.','catch','query','apikey','getUuid','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blockDuration','add','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','update','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken'];(function(_0x38ba09,_0x326607){var _0x2924ad=function(_0x16653d){while(--_0x16653d){_0x38ba09['push'](_0x38ba09['shift']());}};_0x2924ad(++_0x326607);}(_0x55ca,0x126));var _0xa55c=function(_0x56f604,_0x31e0fc){_0x56f604=_0x56f604-0x0;var _0x5c3f23=_0x55ca[_0x56f604];return _0x5c3f23;};'use strict';var db=require(_0xa55c('0x0'))['db'];var config=require(_0xa55c('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0xa55c('0x2'));var jwt=require(_0xa55c('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xa55c('0x4'));var basicAuth=require(_0xa55c('0x5'));var crypto=require(_0xa55c('0x6'));var BPromise=require(_0xa55c('0x7'));var util=require(_0xa55c('0x8'));var moment=require(_0xa55c('0x9'));var validateJwt=expressJwt({'secret':config[_0xa55c('0xa')]['session']});var userAttributes=['id',_0xa55c('0xb'),_0xa55c('0xc'),'name',_0xa55c('0xd'),_0xa55c('0xe'),'userpic','permissions',_0xa55c('0xf'),_0xa55c('0x10'),_0xa55c('0x11'),_0xa55c('0x12'),_0xa55c('0x13'),_0xa55c('0x14'),_0xa55c('0x15'),_0xa55c('0x16'),_0xa55c('0x17'),_0xa55c('0x18'),'lastPauseAt','crudPermissions',_0xa55c('0x19'),'passwordResetAt','alias','phoneBarAutoAnswer',_0xa55c('0x1a'),_0xa55c('0x1b'),_0xa55c('0x1c'),_0xa55c('0x1d'),_0xa55c('0x1e'),_0xa55c('0x1f'),'phoneBarPrefixRequired',_0xa55c('0x20'),_0xa55c('0x21'),_0xa55c('0x22'),_0xa55c('0x23'),_0xa55c('0x24'),_0xa55c('0x25'),_0xa55c('0x26'),_0xa55c('0x27'),_0xa55c('0x28'),'downloadOmnichannelInteractions',_0xa55c('0x29'),_0xa55c('0x2a'),_0xa55c('0x2b'),_0xa55c('0x2c'),_0xa55c('0x2d'),_0xa55c('0x2e'),'emailAutoanswerDelay','smsAutoanswer',_0xa55c('0x2f'),_0xa55c('0x30'),_0xa55c('0x31'),'faxAutoanswer',_0xa55c('0x32'),_0xa55c('0x33'),'whatsappAutoanswerDelay'];exports[_0xa55c('0x34')]=function(){return this[_0xa55c('0x35')](!![])[_0xa55c('0x36')](function(_0x1965f1,_0x234372,_0x49ed04){if(_0x1965f1[_0xa55c('0x37')]){_0x49ed04();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x1965f1['params']['id']},'attributes':['id',_0xa55c('0x38'),'disposition'],'raw':!![]})[_0xa55c('0x39')](function(_0x190757){if(_0x190757&&_0x190757[_0xa55c('0x38')]){return _0x234372[_0xa55c('0x3a')](_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?0x195:0x193)[_0xa55c('0x3d')]({'message':_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?_0xa55c('0x3e'):_0xa55c('0x3f')});}else{_0x49ed04();}})['catch'](function(_0x430d55){_0x49ed04(_0x430d55);});}});};exports[_0xa55c('0x35')]=function isAuthenticated(_0x1c9f6b){return compose()[_0xa55c('0x36')](function(_0x5d940d,_0x1377b0,_0x22f6b6){var _0x1b8388;if(_0x5d940d[_0xa55c('0x40')][_0xa55c('0x41')]){if(_[_0xa55c('0x42')](_0x5d940d['headers'][_0xa55c('0x41')],'Basic')){var _0x35c9c2=basicAuth(_0x5d940d);db[_0xa55c('0x43')][_0xa55c('0x44')]({'where':{'name':_0x35c9c2[_0xa55c('0x45')]}})['then'](function(_0x3d28fb){if(!_0x3d28fb||!_0x3d28fb[_0xa55c('0x46')](_0x35c9c2[_0xa55c('0x47')])){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x48')});}_0x5d940d[_0xa55c('0x37')]={'id':_0x3d28fb['id']};_0x22f6b6();})[_0xa55c('0x49')](function(_0x2808e9){_0x22f6b6(_0x2808e9);});}else if(_[_0xa55c('0x42')](_0x5d940d[_0xa55c('0x40')]['authorization'],'Bearer')){validateJwt(_0x5d940d,_0x1377b0,_0x22f6b6);}else{if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')]){try{var _0x2e9623={'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};verifyJwt(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')],_0x2e9623)[_0xa55c('0x39')](function(_0x3959e3){return db['User']['find']({'where':{'id':_0x3959e3['sub']}})[_0xa55c('0x39')](function(_0x18e00e){_0x1b8388=_0x18e00e;return db[_0xa55c('0x4d')]['findOne']({'where':{'id':0x1},'attributes':[_0xa55c('0x4e'),'blockDuration'],'raw':!![]});})[_0xa55c('0x39')](function(_0x4ad813){if(!_0x1b8388||!_[_0xa55c('0x4f')](_0x1b8388[_0xa55c('0x50')],_0x3959e3[_0xa55c('0x51')])){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x52')});}if(_0x1b8388['disabled']){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1b8388['blocked']){if(_0x4ad813[_0xa55c('0x53')]>0x0){if(moment(_0x1b8388['blockedAt'])[_0xa55c('0x54')](_0x4ad813[_0xa55c('0x53')],'minutes')>moment()){return _0x1377b0['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});}}_0x5d940d[_0xa55c('0x37')]={'id':_0x1b8388['id']};_0x22f6b6();});})[_0xa55c('0x49')](function(){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});});}catch(_0x77d623){_0x22f6b6(_0x77d623);}}else if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':_0xa55c('0x56')});}})['use'](function(_0x386e34,_0x5ee63d,_0x57a972){if(_0x386e34[_0xa55c('0x37')]){db[_0xa55c('0x43')]['find']({'where':{'id':_0x386e34[_0xa55c('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5f25f7){if(!_0x5f25f7){return _0x5ee63d[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x57')});}_0x386e34['user']=_0x5f25f7;_0x57a972();})[_0xa55c('0x49')](function(_0xd5a006){_0x57a972(_0xd5a006);});}else if(_0x1c9f6b){_0x57a972();}else{return _0x5ee63d['status'](0x194)[_0xa55c('0x3d')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xa55c('0x58')]=function canUpdate(){return compose()[_0xa55c('0x36')](function(_0x5be43f,_0x66d1de,_0x1dae70){return licenseUtil['getLicense']()[_0xa55c('0x39')](function(_0x187e09){if(_0x187e09[_0xa55c('0x59')]){_0x1dae70();}else{return _0x66d1de['status'](0x193)[_0xa55c('0x3d')]({'message':'Forbidden'});}})[_0xa55c('0x49')](function(_0x3a8af4){_0x1dae70(_0x3a8af4);});});};exports[_0xa55c('0x5a')]=function isWebrtcLicence(){return compose()['use'](function(_0x41eab1,_0x106adb,_0x592429){return licenseUtil[_0xa55c('0x5b')]()[_0xa55c('0x39')](function(_0x5d5cf6){if(_0x5d5cf6[_0xa55c('0x5c')]){_0x592429();}else{return _0x106adb[_0xa55c('0x3a')](0x193)['json']({'message':_0xa55c('0x5d')});}})[_0xa55c('0x49')](function(_0x219a68){_0x592429(_0x219a68);});});};exports[_0xa55c('0x5e')]=function(_0x564cb3,_0x143989,_0x58a7ea){_0x564cb3[_0xa55c('0x5e')]=!![];return _0x58a7ea();};exports[_0xa55c('0x5f')]=function signToken(_0x194a79){return signJwt(_0x194a79);};exports['setTokenCookie']=function(_0x39bd3d,_0x250b00){if(!_0x39bd3d['user']){return _0x250b00[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x60')});}var _0xcd78c5={'payload':{'id':_0x39bd3d[_0xa55c('0x37')]['id'],'role':_0x39bd3d[_0xa55c('0x37')][_0xa55c('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0xcd78c5)[_0xa55c('0x39')](function(_0x3c147b){_0x250b00[_0xa55c('0x61')]('motion.token',_0x3c147b);_0x250b00[_0xa55c('0x62')](_0xa55c('0x63'));})[_0xa55c('0x49')](function(_0x4f73b6){return _0x250b00[_0xa55c('0x3a')](0x1f4)[_0xa55c('0x64')](_0x4f73b6);});};exports['retrieveApiKey']=function(_0x21b760){if(_['isNil'](_0x21b760[_0xa55c('0x50')])||_[_0xa55c('0x65')](_0x21b760[_0xa55c('0x66')])){return null;}else{return createJwt(_0x21b760);}};exports[_0xa55c('0x67')]=function(_0x2ecf79){_0x2ecf79['apiKeyNonce']=generateNonce();_0x2ecf79[_0xa55c('0x66')]=generateIssuedAt();return createJwt(_0x2ecf79);};exports[_0xa55c('0x68')]=function(_0x4b85cc,_0x3929a6){var _0x2291e0=_0x4b85cc[_0xa55c('0x4a')][_0xa55c('0x4b')];if(_0x2291e0){var _0x50176b={'nonce':_0x3929a6['apiKeyNonce'],'iat':_0x3929a6[_0xa55c('0x66')],'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};return verifyJwt(_0x2291e0,_0x50176b)[_0xa55c('0x39')](function(){return generateApiKey(_0x3929a6);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xa55c('0x69')]=function(_0x5ce463){var _0x2742e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2742e4[_0xa55c('0x6a')](_0x5ce463))throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0xa55c('0x6d'));return;};exports['validatePasswordHistory']=function(_0x1cb73b,_0x54f776,_0x23f67f){var _0x157afe=encryptor[_0xa55c('0x6e')](_0x54f776)[_0xa55c('0x6f')](',');for(var _0x19aaf5=0x0;_0x19aaf5<_0x23f67f;_0x19aaf5++){if(!_0x157afe[_0x19aaf5])break;if(_0x1cb73b[_0xa55c('0x70')]()===_0x157afe[_0x19aaf5][_0xa55c('0x70')]()){var _0x53e2be=util[_0xa55c('0x71')](_0xa55c('0x72'),_0x23f67f);if(_0x23f67f===0x1){_0x53e2be=_0xa55c('0x73');}throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0x53e2be);}}return;};exports['updatePasswordsHistory']=function(_0xa72718,_0x3cd40d){var _0x28bac4=_0x3cd40d?encryptor[_0xa55c('0x6e')](_0x3cd40d)[_0xa55c('0x6f')](','):[];if(_0x28bac4['length']===0x5){_0x28bac4[_0xa55c('0x74')](-0x1,0x1);}_0x28bac4[_0xa55c('0x75')](_0xa72718);return encryptor[_0xa55c('0x76')](_0x28bac4[_0xa55c('0x77')](','));};function signJwt(_0x3ba56d){var _0x480dfc=BPromise[_0xa55c('0x78')](jwt['sign'],{'context':jwt});var _0x2e482a=_0x3ba56d['secret']||config[_0xa55c('0xa')]['session'];return new BPromise(function(_0x34edc5,_0x1333da){_0x480dfc(_0x3ba56d[_0xa55c('0x79')],_0x2e482a,_0x3ba56d[_0xa55c('0x7a')])[_0xa55c('0x39')](function(_0x3a5a52){_0x34edc5(_0x3a5a52);})[_0xa55c('0x49')](function(_0x2f2226){_0x1333da(_0x2f2226);});});}function verifyJwt(_0x14b515,_0x1acf50,_0x51c736){var _0x150a07=BPromise[_0xa55c('0x78')](jwt['verify'],{'context':jwt});var _0x18b928=_0x51c736||config[_0xa55c('0xa')][_0xa55c('0x7b')];return new BPromise(function(_0x9fe234,_0x1b8b06){_0x150a07(_0x14b515,_0x18b928,_0x1acf50)[_0xa55c('0x39')](function(_0x3cef1f){_0x9fe234(_0x3cef1f);})[_0xa55c('0x49')](function(_0x47de0a){_0x1b8b06(_0x47de0a);});});}function generateNonce(){return crypto[_0xa55c('0x7c')](0x10)[_0xa55c('0x7d')](_0xa55c('0x7e'));}function generateIssuedAt(){return Math[_0xa55c('0x7f')](Date[_0xa55c('0x80')]()/0x3e8)[_0xa55c('0x7d')]();}function createJwt(_0x2f1237){var _0x4249c1={'payload':{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237['apiKeyNonce']},'options':{'algorithm':_0xa55c('0x81'),'subject':_0x2f1237['id'][_0xa55c('0x7d')](),'issuer':hardwareConf[_0xa55c('0x4c')](),'audience':hardwareConf[_0xa55c('0x4c')]()}};return signJwt(_0x4249c1)[_0xa55c('0x39')](function(_0x10e711){return{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237[_0xa55c('0x50')],'token':_0x10e711};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index b350066..c492386 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 _0x5281=['binary','end','final','write','close','unlink','createWriteStream','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','update'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x5281,0x1bd));var _0x1528=function(_0x5d4840,_0x57db8b){_0x5d4840=_0x5d4840-0x0;var _0x83cd9f=_0x5281[_0x5d4840];return _0x83cd9f;};'use strict';var crypto=require(_0x1528('0x0'));var fs=require('fs');var BPromise=require(_0x1528('0x1'));var _=require(_0x1528('0x2'));var config=require(_0x1528('0x3'));var logger=require(_0x1528('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x1528('0x5')][_0x1528('0x6')],'algorithm':_0x1528('0x7')};const fileOptions={'algorithm':'aes192'};if(config[_0x1528('0x8')]&&config[_0x1528('0x8')][_0x1528('0x9')]){var isSupported=isAlgorithmSupported(config[_0x1528('0x8')][_0x1528('0x9')]);if(isSupported){fileOptions[_0x1528('0x9')]=config[_0x1528('0x8')][_0x1528('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x1528('0xa')](',\x20');logger[_0x1528('0xb')](config[_0x1528('0x8')][_0x1528('0x9')],_0x1528('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2a6e79){return AES_SUPPORTED_RX[_0x1528('0xd')](_0x2a6e79);}function getSupportedCiphers(){return crypto[_0x1528('0xe')]()[_0x1528('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x35802a){return getSupportedCiphers()[_0x1528('0x10')](_0x35802a)>-0x1;}function combineOptions(_0x47f339){var _0xd2570d={};for(var _0x373f86 in fileOptions){if(fileOptions[_0x1528('0x11')](_0x373f86)){_0xd2570d[_0x373f86]=fileOptions[_0x373f86];}}if(_0x47f339){for(var _0x524c4 in _0x47f339){if(_0x47f339['hasOwnProperty'](_0x524c4)){_0xd2570d[_0x524c4]=_0x47f339[_0x524c4];}}}return _0xd2570d;}exports[_0x1528('0x12')]=function(_0x397fc4,_0x1886bc,_0x516114,_0xae7f46){return new BPromise(function(_0x3673ea,_0x2a498e){_0xae7f46=combineOptions(_0xae7f46);var _0x46fa28=new Buffer(_0x516114);var _0xd9d199=fs[_0x1528('0x13')](_0x397fc4);var _0x39963a=fs['createWriteStream'](_0x1886bc);var _0x268bdf=crypto[_0x1528('0x14')](_0xae7f46[_0x1528('0x9')],_0x46fa28);_0xd9d199['on'](_0x1528('0x15'),function(_0x523bdd){var _0x2df4e9=new Buffer(_0x268bdf[_0x1528('0x16')](_0x523bdd),_0x1528('0x17'));_0x39963a['write'](_0x2df4e9);});_0xd9d199['on'](_0x1528('0x18'),function(){try{var _0x16f7fa=new Buffer(_0x268bdf[_0x1528('0x19')]('binary'),'binary');_0x39963a[_0x1528('0x1a')](_0x16f7fa);_0x39963a[_0x1528('0x18')]();_0x39963a['on'](_0x1528('0x1b'),function(){return _0x3673ea(_0x1886bc);});}catch(_0x27b03a){fs[_0x1528('0x1c')](_0x1886bc);return _0x2a498e(_0x27b03a);}});});};exports['decryptFile']=function(_0x1f6791,_0x17a1db,_0x152ff1,_0x490692){return new BPromise(function(_0x1ea28e,_0x30c97a){_0x490692=combineOptions(_0x490692);var _0x52c7a9=new Buffer(_0x152ff1);var _0x490feb=fs[_0x1528('0x13')](_0x1f6791);var _0x148a1c=fs[_0x1528('0x1d')](_0x17a1db);var _0x4aae51=crypto[_0x1528('0x1e')](_0x490692[_0x1528('0x9')],_0x52c7a9);_0x490feb['on'](_0x1528('0x15'),function(_0x30660b){var _0x3dcce1=new Buffer(_0x4aae51[_0x1528('0x16')](_0x30660b),_0x1528('0x17'));_0x148a1c[_0x1528('0x1a')](_0x3dcce1);});_0x490feb['on']('end',function(){try{var _0x55edb4=new Buffer(_0x4aae51[_0x1528('0x19')](_0x1528('0x17')),'binary');_0x148a1c['write'](_0x55edb4);_0x148a1c[_0x1528('0x18')]();_0x148a1c['on']('close',function(){return _0x1ea28e(_0x17a1db);});}catch(_0x377d2b){fs[_0x1528('0x1c')](_0x17a1db);return _0x30c97a(_0x377d2b);}});});};exports[_0x1528('0x1f')]=function(_0x3eea1f,_0x287315,_0x56331a){var _0x2f31a3=_0x56331a||stringOptions[_0x1528('0x9')];var _0xfe9822=_0x287315||stringOptions[_0x1528('0x20')];var _0x5516a8=crypto[_0x1528('0x14')](_0x2f31a3,_0xfe9822);var _0x5282dd=_0x5516a8['update'](_0x3eea1f,_0x1528('0x21'),_0x1528('0x22'));_0x5282dd+=_0x5516a8[_0x1528('0x19')](_0x1528('0x22'));return _0x5282dd;};exports[_0x1528('0x23')]=function(_0x425dd0,_0x41b490,_0x50ea0a){var _0x4a0a5e=_0x50ea0a||stringOptions[_0x1528('0x9')];var _0x12ad24=_0x41b490||stringOptions[_0x1528('0x20')];var _0xd09ff8=crypto[_0x1528('0x1e')](_0x4a0a5e,_0x12ad24);var _0x26836a=_0xd09ff8['update'](_0x425dd0,_0x1528('0x22'),_0x1528('0x21'));_0x26836a+=_0xd09ff8[_0x1528('0x19')]('utf8');return _0x26836a;}; \ No newline at end of file +var _0x0d51=['test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','write','end','final','binary','decryptFile','createDecipher','close','unlink','encryptString','secret','base64','decryptString','utf8','crypto','bluebird','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:'];(function(_0xe980b3,_0x26bd10){var _0x1f5fc0=function(_0x1fe1d6){while(--_0x1fe1d6){_0xe980b3['push'](_0xe980b3['shift']());}};_0x1f5fc0(++_0x26bd10);}(_0x0d51,0xa4));var _0x10d5=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0x0d51[_0x2d89ce];return _0x3fad10;};'use strict';var crypto=require(_0x10d5('0x0'));var fs=require('fs');var BPromise=require(_0x10d5('0x1'));var _=require('lodash');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x10d5('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x10d5('0x3')]['session'],'algorithm':_0x10d5('0x4')};const fileOptions={'algorithm':_0x10d5('0x5')};if(config['encrypt']&&config[_0x10d5('0x6')][_0x10d5('0x7')]){var isSupported=isAlgorithmSupported(config[_0x10d5('0x6')][_0x10d5('0x7')]);if(isSupported){fileOptions[_0x10d5('0x7')]=config[_0x10d5('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x10d5('0x8')](',\x20');logger[_0x10d5('0x9')](config[_0x10d5('0x6')][_0x10d5('0x7')],_0x10d5('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0xa09305){return AES_SUPPORTED_RX[_0x10d5('0xb')](_0xa09305);}function getSupportedCiphers(){return crypto[_0x10d5('0xc')]()[_0x10d5('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x296431){return getSupportedCiphers()[_0x10d5('0xe')](_0x296431)>-0x1;}function combineOptions(_0x446067){var _0x4a0774={};for(var _0x18bda7 in fileOptions){if(fileOptions['hasOwnProperty'](_0x18bda7)){_0x4a0774[_0x18bda7]=fileOptions[_0x18bda7];}}if(_0x446067){for(var _0x2005f7 in _0x446067){if(_0x446067[_0x10d5('0xf')](_0x2005f7)){_0x4a0774[_0x2005f7]=_0x446067[_0x2005f7];}}}return _0x4a0774;}exports[_0x10d5('0x10')]=function(_0x5dac36,_0x46c74b,_0x480c0e,_0x482184){return new BPromise(function(_0x441547,_0xcbb891){_0x482184=combineOptions(_0x482184);var _0x307496=new Buffer(_0x480c0e);var _0x5caebd=fs[_0x10d5('0x11')](_0x5dac36);var _0x4f3e02=fs[_0x10d5('0x12')](_0x46c74b);var _0x4ea426=crypto[_0x10d5('0x13')](_0x482184[_0x10d5('0x7')],_0x307496);_0x5caebd['on'](_0x10d5('0x14'),function(_0x3ac68e){var _0x6f7691=new Buffer(_0x4ea426[_0x10d5('0x15')](_0x3ac68e),'binary');_0x4f3e02[_0x10d5('0x16')](_0x6f7691);});_0x5caebd['on'](_0x10d5('0x17'),function(){try{var _0x3c27ab=new Buffer(_0x4ea426[_0x10d5('0x18')](_0x10d5('0x19')),_0x10d5('0x19'));_0x4f3e02[_0x10d5('0x16')](_0x3c27ab);_0x4f3e02['end']();_0x4f3e02['on']('close',function(){return _0x441547(_0x46c74b);});}catch(_0x486d13){fs['unlink'](_0x46c74b);return _0xcbb891(_0x486d13);}});});};exports[_0x10d5('0x1a')]=function(_0xa8b978,_0x1e2667,_0x1c163b,_0x22b668){return new BPromise(function(_0xc81e7e,_0x447cb2){_0x22b668=combineOptions(_0x22b668);var _0x2192c9=new Buffer(_0x1c163b);var _0x1ed65e=fs[_0x10d5('0x11')](_0xa8b978);var _0x2e777b=fs[_0x10d5('0x12')](_0x1e2667);var _0x5149b1=crypto[_0x10d5('0x1b')](_0x22b668[_0x10d5('0x7')],_0x2192c9);_0x1ed65e['on'](_0x10d5('0x14'),function(_0x17f2f3){var _0x33270c=new Buffer(_0x5149b1[_0x10d5('0x15')](_0x17f2f3),_0x10d5('0x19'));_0x2e777b[_0x10d5('0x16')](_0x33270c);});_0x1ed65e['on'](_0x10d5('0x17'),function(){try{var _0x3967c0=new Buffer(_0x5149b1[_0x10d5('0x18')](_0x10d5('0x19')),_0x10d5('0x19'));_0x2e777b['write'](_0x3967c0);_0x2e777b[_0x10d5('0x17')]();_0x2e777b['on'](_0x10d5('0x1c'),function(){return _0xc81e7e(_0x1e2667);});}catch(_0x5ee8eb){fs[_0x10d5('0x1d')](_0x1e2667);return _0x447cb2(_0x5ee8eb);}});});};exports[_0x10d5('0x1e')]=function(_0x3c7e5e,_0x11e0f4,_0x4b9bc8){var _0x2ace55=_0x4b9bc8||stringOptions[_0x10d5('0x7')];var _0x181720=_0x11e0f4||stringOptions[_0x10d5('0x1f')];var _0x3f34f1=crypto[_0x10d5('0x13')](_0x2ace55,_0x181720);var _0xea8a72=_0x3f34f1[_0x10d5('0x15')](_0x3c7e5e,'utf8',_0x10d5('0x20'));_0xea8a72+=_0x3f34f1[_0x10d5('0x18')](_0x10d5('0x20'));return _0xea8a72;};exports[_0x10d5('0x21')]=function(_0x2479e9,_0x34ac7f,_0x506d5d){var _0x38ac8f=_0x506d5d||stringOptions[_0x10d5('0x7')];var _0x33278c=_0x34ac7f||stringOptions[_0x10d5('0x1f')];var _0x23d740=crypto[_0x10d5('0x1b')](_0x38ac8f,_0x33278c);var _0xa24262=_0x23d740[_0x10d5('0x15')](_0x2479e9,_0x10d5('0x20'),'utf8');_0xa24262+=_0x23d740[_0x10d5('0x18')](_0x10d5('0x22'));return _0xa24262;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 8cadf44..5b1ca60 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 _0x59ac=['dirname','basename','.csv','length','existsSync','mkdirSync','join','each','%s%d.%s','%s.%s','csv','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','bluebird','zip-dir','rimraf','../../mysqldb','analytics','argv','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','range','push','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d'];(function(_0xd4627b,_0xff27fe){var _0x30e307=function(_0x4d3124){while(--_0x4d3124){_0xd4627b['push'](_0xd4627b['shift']());}};_0x30e307(++_0xff27fe);}(_0x59ac,0x156));var _0xc59a=function(_0x17100e,_0xa58af4){_0x17100e=_0x17100e-0x0;var _0x541fbd=_0x59ac[_0x17100e];return _0x541fbd;};'use strict';var util=require(_0xc59a('0x0'));var path=require(_0xc59a('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xc59a('0x2'));var zipdir=require(_0xc59a('0x3'));var rimraf=require(_0xc59a('0x4'));var db=require(_0xc59a('0x5'))['db'];var dbH=require(_0xc59a('0x5'))['dbH'];var logger=require('../../config/logger')(_0xc59a('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xc59a('0x7')][0x2]);var QUERY=process[_0xc59a('0x7')][0x3];var PATH=process[_0xc59a('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3136dd,_0x41bf56){var _0xb1f913={'status':_0x3136dd};var _0xffed30={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x41bf56){_0xb1f913['savename']=_0x41bf56;}return db['AnalyticExtractedReport']['update'](_0xb1f913,_0xffed30);}function main(){var _0x1f9111=0x1388;var _0x54bf9a;logger[_0xc59a('0x8')](util['format'](_0xc59a('0x9'),EXTRACTED_REPORT_ID,_0xc59a('0xa')));return db[_0xc59a('0xb')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc59a('0xc'),_0xc59a('0xd')]})['then'](function(_0x401132){if(_0x401132){_0x54bf9a=_0x401132;_0x1f9111=_0x54bf9a['splitSizeCsv']||0x1388;}})[_0xc59a('0xe')](function(){return dbH[_0xc59a('0xf')][_0xc59a('0x10')](util[_0xc59a('0x11')](_0xc59a('0x12'),QUERY),{'type':dbH[_0xc59a('0xf')][_0xc59a('0x13')]['SELECT']});})[_0xc59a('0xe')](function(_0x2d7057){if(!_0x2d7057[0x0][_0xc59a('0x14')]){return analyticExtractedReport(_0xc59a('0x15'));}var _0x593fe8=[];var _0x410ae7=0x0;if(_0x54bf9a['split']){if(_0x2d7057&&_0x2d7057['length']){var _0x556bc9=_[_0xc59a('0x16')](_0x2d7057[0x0][_0xc59a('0x14')]/_0x1f9111);var _0xcf177c=Number['isInteger'](_0x2d7057[0x0]['num']/_0x1f9111)?_0x2d7057[0x0]['num']%_0x1f9111:0x0;_0x556bc9['forEach'](function(_0x5a5aa8){if(_0x5a5aa8>0x0){_0x410ae7+=_0x1f9111;}_0x593fe8[_0xc59a('0x17')](dbH[_0xc59a('0xf')][_0xc59a('0x10')](util[_0xc59a('0x11')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1f9111,_0x410ae7),{'type':dbH[_0xc59a('0xf')]['QueryTypes'][_0xc59a('0x18')]}));});if(_0xcf177c>0x0){_0x410ae7+=_0x1f9111;_0x593fe8[_0xc59a('0x17')](dbH[_0xc59a('0xf')][_0xc59a('0x10')](util[_0xc59a('0x11')](_0xc59a('0x19'),QUERY,_0xcf177c,_0x410ae7),{'type':dbH['sequelize'][_0xc59a('0x13')][_0xc59a('0x18')]}));}}}else{_0x593fe8[_0xc59a('0x17')](dbH[_0xc59a('0xf')]['query'](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}var _0x292ebf=path[_0xc59a('0x1a')](PATH);var _0x50f4a5=path[_0xc59a('0x1b')](PATH,_0xc59a('0x1c'));var _0x1692c1=_0x54bf9a[_0xc59a('0xc')]&&_0x593fe8[_0xc59a('0x1d')]>0x1;var _0x1f94dc=[];if(!fs[_0xc59a('0x1e')](path['join'](_0x292ebf,_0x50f4a5))&&_0x1692c1){fs[_0xc59a('0x1f')](path[_0xc59a('0x20')](_0x292ebf,_0x50f4a5));}return BPromise[_0xc59a('0x21')](_0x593fe8,function(_0x5aadce){_0x1f94dc[_0xc59a('0x17')](_0x5aadce);})[_0xc59a('0xe')](function(){for(var _0x468da2=0x0;_0x468da2<_0x1f94dc[_0xc59a('0x1d')];_0x468da2+=0x1){var _0x981b32;var _0x287c3d=_0x1f94dc[_0x468da2];if(_0x1692c1){_0x981b32=path[_0xc59a('0x20')](_0x292ebf,_0x50f4a5,util['format'](_0xc59a('0x22'),_0x50f4a5,_0x468da2,'csv'));}else{_0x981b32=path[_0xc59a('0x20')](_0x292ebf,util[_0xc59a('0x11')](_0xc59a('0x23'),_0x50f4a5,_0xc59a('0x24')));}fs['writeFileSync'](_0x981b32,csv(_0x287c3d));}})[_0xc59a('0xe')](function(){if(_0x1692c1){return new Promise(function(_0x3db5e6){zipdir(path[_0xc59a('0x20')](_0x292ebf,_0x50f4a5),{'saveTo':path[_0xc59a('0x20')](_0x292ebf,util['format'](_0xc59a('0x23'),_0x50f4a5,_0xc59a('0x25')))},function(_0xa2fe20,_0x5dc1ae){rimraf(path['join'](_0x292ebf,_0x50f4a5),function(){});_0x3db5e6(_0xc59a('0x26'));});});}})[_0xc59a('0xe')](function(){logger[_0xc59a('0x8')](util[_0xc59a('0x11')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xc59a('0xa')));return analyticExtractedReport(_0xc59a('0x27'),_0x1692c1?util['format'](_0xc59a('0x23'),_0x50f4a5,_0x1692c1?_0xc59a('0x25'):_0xc59a('0x24')):null);});})[_0xc59a('0x28')](function(_0x279db4){logger[_0xc59a('0x8')](util[_0xc59a('0x11')](_0xc59a('0x29'),EXTRACTED_REPORT_ID,_0xc59a('0xa')),util[_0xc59a('0x2a')](_0x279db4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc59a('0x2b'));})[_0xc59a('0x2c')](function(){process[_0xc59a('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xdbee=['bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Setting','find','split','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','to-csv'];(function(_0x3e432c,_0x2bb010){var _0x29e59c=function(_0x3add94){while(--_0x3add94){_0x3e432c['push'](_0x3e432c['shift']());}};_0x29e59c(++_0x2bb010);}(_0xdbee,0x163));var _0xedbe=function(_0x27712f,_0x354d94){_0x27712f=_0x27712f-0x0;var _0x4b5d03=_0xdbee[_0x27712f];return _0x4b5d03;};'use strict';var util=require(_0xedbe('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0xedbe('0x1'));var fs=require('fs');var BPromise=require(_0xedbe('0x2'));var zipdir=require(_0xedbe('0x3'));var rimraf=require(_0xedbe('0x4'));var db=require(_0xedbe('0x5'))['db'];var dbH=require(_0xedbe('0x5'))[_0xedbe('0x6')];var logger=require(_0xedbe('0x7'))(_0xedbe('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xedbe('0x9')][0x2]);var QUERY=process[_0xedbe('0x9')][0x3];var PATH=process[_0xedbe('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xf76f06,_0x158144){var _0x20be22={'status':_0xf76f06};var _0x19d6a4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x158144){_0x20be22[_0xedbe('0xa')]=_0x158144;}return db[_0xedbe('0xb')]['update'](_0x20be22,_0x19d6a4);}function main(){var _0x5d846b=0x1388;var _0x1056fd;logger[_0xedbe('0xc')](util[_0xedbe('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xedbe('0xe')][_0xedbe('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xedbe('0x10'),_0xedbe('0x11')]})[_0xedbe('0x12')](function(_0x11b8cb){if(_0x11b8cb){_0x1056fd=_0x11b8cb;_0x5d846b=_0x1056fd['splitSizeCsv']||0x1388;}})[_0xedbe('0x12')](function(){return dbH[_0xedbe('0x13')][_0xedbe('0x14')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xedbe('0x13')][_0xedbe('0x15')][_0xedbe('0x16')]});})[_0xedbe('0x12')](function(_0x15769){if(!_0x15769[0x0]['num']){return analyticExtractedReport(_0xedbe('0x17'));}var _0x48a45c=[];var _0x5563ac=0x0;if(_0x1056fd['split']){if(_0x15769&&_0x15769[_0xedbe('0x18')]){var _0xc184cc=_[_0xedbe('0x19')](_0x15769[0x0][_0xedbe('0x1a')]/_0x5d846b);var _0x1619d0=Number[_0xedbe('0x1b')](_0x15769[0x0]['num']/_0x5d846b)?_0x15769[0x0][_0xedbe('0x1a')]%_0x5d846b:0x0;_0xc184cc[_0xedbe('0x1c')](function(_0x9b346e){if(_0x9b346e>0x0){_0x5563ac+=_0x5d846b;}_0x48a45c[_0xedbe('0x1d')](dbH[_0xedbe('0x13')][_0xedbe('0x14')](util[_0xedbe('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5d846b,_0x5563ac),{'type':dbH[_0xedbe('0x13')][_0xedbe('0x15')][_0xedbe('0x16')]}));});if(_0x1619d0>0x0){_0x5563ac+=_0x5d846b;_0x48a45c['push'](dbH[_0xedbe('0x13')][_0xedbe('0x14')](util[_0xedbe('0xd')](_0xedbe('0x1e'),QUERY,_0x1619d0,_0x5563ac),{'type':dbH[_0xedbe('0x13')][_0xedbe('0x15')][_0xedbe('0x16')]}));}}}else{_0x48a45c[_0xedbe('0x1d')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xedbe('0x13')][_0xedbe('0x15')]['SELECT']}));}var _0x2d60c2=path[_0xedbe('0x1f')](PATH);var _0x1afac6=path[_0xedbe('0x20')](PATH,_0xedbe('0x21'));var _0x3d0c32=_0x1056fd['split']&&_0x48a45c[_0xedbe('0x18')]>0x1;var _0x12b19a=[];if(!fs[_0xedbe('0x22')](path[_0xedbe('0x23')](_0x2d60c2,_0x1afac6))&&_0x3d0c32){fs[_0xedbe('0x24')](path['join'](_0x2d60c2,_0x1afac6));}return BPromise[_0xedbe('0x25')](_0x48a45c,function(_0xd4d604){_0x12b19a[_0xedbe('0x1d')](_0xd4d604);})[_0xedbe('0x12')](function(){for(var _0x14a0e8=0x0;_0x14a0e8<_0x12b19a['length'];_0x14a0e8+=0x1){var _0x2f4dac;var _0x2b9d47=_0x12b19a[_0x14a0e8];if(_0x3d0c32){_0x2f4dac=path[_0xedbe('0x23')](_0x2d60c2,_0x1afac6,util['format'](_0xedbe('0x26'),_0x1afac6,_0x14a0e8,_0xedbe('0x27')));}else{_0x2f4dac=path['join'](_0x2d60c2,util[_0xedbe('0xd')](_0xedbe('0x28'),_0x1afac6,'csv'));}fs[_0xedbe('0x29')](_0x2f4dac,csv(_0x2b9d47));}})['then'](function(){if(_0x3d0c32){return new Promise(function(_0xa7abbc){zipdir(path[_0xedbe('0x23')](_0x2d60c2,_0x1afac6),{'saveTo':path[_0xedbe('0x23')](_0x2d60c2,util[_0xedbe('0xd')](_0xedbe('0x28'),_0x1afac6,_0xedbe('0x2a')))},function(_0x4db877,_0x341be1){rimraf(path['join'](_0x2d60c2,_0x1afac6),function(){});_0xa7abbc(_0xedbe('0x2b'));});});}})[_0xedbe('0x12')](function(){logger[_0xedbe('0xc')](util['format'](_0xedbe('0x2c'),EXTRACTED_REPORT_ID,_0xedbe('0x2d')));return analyticExtractedReport(_0xedbe('0x2e'),_0x3d0c32?util[_0xedbe('0xd')](_0xedbe('0x28'),_0x1afac6,_0x3d0c32?_0xedbe('0x2a'):_0xedbe('0x27')):null);});})['catch'](function(_0x2665c7){logger['info'](util[_0xedbe('0xd')](_0xedbe('0x2f'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x2665c7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xedbe('0x30'));})[_0xedbe('0x31')](function(){process[_0xedbe('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index fb098cb..ffa0f91 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 _0x6b0d=['landscape','toString','\x20/\x20','footer','black','right','num','Setting','find','split','splitSizePdf','then','range','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','basename','.pdf','mkdirSync','flatten','createPdfKitDocument','join','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','Arial','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','JSDOM','window','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','value','fill','length','auto','body','push','concat','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','pageBreak','before','margin'];(function(_0x234ea9,_0x5e1f7d){var _0x471d20=function(_0x4d7c4c){while(--_0x4d7c4c){_0x234ea9['push'](_0x234ea9['shift']());}};_0x471d20(++_0x5e1f7d);}(_0x6b0d,0x150));var _0xd6b0=function(_0x3e257f,_0x3c0ae9){_0x3e257f=_0x3e257f-0x0;var _0x4a2fc4=_0x6b0d[_0x3e257f];return _0x4a2fc4;};'use strict';var _=require(_0xd6b0('0x0'));var fs=require('fs');var util=require(_0xd6b0('0x1'));var path=require(_0xd6b0('0x2'));var moment=require(_0xd6b0('0x3'));var htmlToPdfmake=require(_0xd6b0('0x4'));var PdfPrinter=require(_0xd6b0('0x5'));var zipdir=require(_0xd6b0('0x6'));var rimraf=require(_0xd6b0('0x7'));var JSDOM=require('jsdom')[_0xd6b0('0x8')];var window=new JSDOM('')[_0xd6b0('0x9')];var BPromise=require('bluebird');var db=require(_0xd6b0('0xa'))['db'];var dbH=require(_0xd6b0('0xa'))[_0xd6b0('0xb')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xd6b0('0xc')][0x2]);var QUERY=process[_0xd6b0('0xc')][0x3];var PATH=process[_0xd6b0('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xd6b0('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1174cd,_0x107197){var _0x187627={'status':_0x1174cd};var _0x13473b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x107197){_0x187627[_0xd6b0('0xe')]=_0x107197;}return db[_0xd6b0('0xf')][_0xd6b0('0x10')](_0x187627,_0x13473b);}function getHeaders(_0x3a36cb){return _[_0xd6b0('0x11')](_0x3a36cb,function(_0x3bb31b){return{'text':_0x3bb31b,'style':_0xd6b0('0x12')};});}function getRows(_0x397181,_0x56c9f4){return _[_0xd6b0('0x11')](_0x56c9f4,function(_0x2dd008){return _(_0x2dd008)[_0xd6b0('0x13')](_0x397181)[_0xd6b0('0x11')](function(_0x5785d7){return _0x5785d7?_['toString'](_0x5785d7):'';})[_0xd6b0('0x14')]();});}function createTable(_0x1a2b0d,_0x134687){var _0x4b9ed8={'widths':_[_0xd6b0('0x15')](Array(_0x1a2b0d[_0xd6b0('0x16')]),0x91),'heights':function(_0x166090){return _0x166090===0x0?_0xd6b0('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3ed0dc=getHeaders(_0x1a2b0d);_0x4b9ed8[_0xd6b0('0x18')][_0xd6b0('0x19')](_0x3ed0dc);var _0x533f3a=getRows(_0x1a2b0d,_0x134687);_0x4b9ed8[_0xd6b0('0x18')]=_0x4b9ed8[_0xd6b0('0x18')][_0xd6b0('0x1a')](_0x533f3a);return _0x4b9ed8;}function createTables(_0x2fa4e8){var _0x825945=[];var _0x2e72c8=_['chunk'](Object[_0xd6b0('0x1b')](_0x2fa4e8[0x0]),0x5);_0x2e72c8['forEach'](function(_0xf666d){_0x825945['push'](createTable(_0xf666d,_0x2fa4e8));});return _0x825945;}function getPDFDocDefinition(_0x3ab14c){var _0x333a1f=util[_0xd6b0('0x1c')](_0xd6b0('0x1d'),NAME,EXTRACTED_REPORT[_0xd6b0('0x1e')],moment(EXTRACTED_REPORT['startDate'])[_0xd6b0('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0xd6b0('0x1f')])['format'](FORMAT));var _0x9fbf78=[];for(var _0x3bd0e5=0x0;_0x3bd0e5<_0x3ab14c['length'];_0x3bd0e5++){var _0x21bf8a=[];if(_0x3bd0e5===0x0){_0x21bf8a['push']({'text':_0x333a1f,'style':_0xd6b0('0x20')});}var _0xa8b253={'table':_0x3ab14c[_0x3bd0e5]};if(_0x3bd0e5>0x0){_0xa8b253[_0xd6b0('0x21')]=_0xd6b0('0x22');_0xa8b253[_0xd6b0('0x23')]=[0x0,0x46,0x0,0x0];}_0x21bf8a[_0xd6b0('0x19')](_0xa8b253);_0x9fbf78[_0xd6b0('0x19')](_0x21bf8a);}return{'pageSize':'A4','pageOrientation':_0xd6b0('0x24'),'content':_0x9fbf78,'footer':function(_0x55f98e,_0x27a573){return{'text':_0x55f98e[_0xd6b0('0x25')]()+_0xd6b0('0x26')+_0x27a573,'style':_0xd6b0('0x27')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xd6b0('0x28')},'footer':{'alignment':_0xd6b0('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x241dc8){var _0x223837=0x1388;var _0x17a167;if(!_0x241dc8[0x0][_0xd6b0('0x2a')]){return analyticExtractedReport('Empty');}return db[_0xd6b0('0x2b')][_0xd6b0('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd6b0('0x2d'),_0xd6b0('0x2e')]})[_0xd6b0('0x2f')](function(_0x87eb80){if(_0x87eb80){_0x17a167=_0x87eb80;_0x223837=_0x17a167[_0xd6b0('0x2e')]||0x3e8;}})['then'](function(){var _0x1de0c0=[];var _0x5d8b4a=0x0;if(_0x17a167[_0xd6b0('0x2d')]){if(_0x241dc8&&_0x241dc8['length']){var _0x5880c5=_[_0xd6b0('0x30')](_0x241dc8[0x0][_0xd6b0('0x2a')]/_0x223837);var _0x4e8127=Number[_0xd6b0('0x31')](_0x241dc8[0x0]['num']/_0x223837)?_0x241dc8[0x0][_0xd6b0('0x2a')]%_0x223837:0x0;_0x5880c5[_0xd6b0('0x32')](function(_0x24ac35){if(_0x24ac35>0x0){_0x5d8b4a+=_0x223837;}_0x1de0c0[_0xd6b0('0x19')](dbH['sequelize'][_0xd6b0('0x33')](util['format'](_0xd6b0('0x34'),QUERY,_0x223837,_0x5d8b4a),{'type':dbH[_0xd6b0('0x35')][_0xd6b0('0x36')][_0xd6b0('0x37')]}));});if(_0x4e8127>0x0){_0x5d8b4a+=_0x223837;_0x1de0c0[_0xd6b0('0x19')](dbH[_0xd6b0('0x35')][_0xd6b0('0x33')](util[_0xd6b0('0x1c')](_0xd6b0('0x34'),QUERY,_0x4e8127,_0x5d8b4a),{'type':dbH[_0xd6b0('0x35')][_0xd6b0('0x36')][_0xd6b0('0x37')]}));}}}else{_0x1de0c0[_0xd6b0('0x19')](dbH[_0xd6b0('0x35')][_0xd6b0('0x33')](QUERY,{'type':dbH[_0xd6b0('0x35')][_0xd6b0('0x36')]['SELECT']}));}var _0x2d4d5c=path[_0xd6b0('0x38')](PATH);var _0x27fc71=path[_0xd6b0('0x39')](PATH,_0xd6b0('0x3a'));var _0x2bad56=_0x17a167['split']&&_0x1de0c0[_0xd6b0('0x16')]>0x1;var _0x222dbc=[];if(!fs['existsSync'](path['join'](_0x2d4d5c,_0x27fc71))&&_0x2bad56){fs[_0xd6b0('0x3b')](path['join'](_0x2d4d5c,_0x27fc71));}return BPromise['each'](_0x1de0c0,function(_0x18b3b3){_0x222dbc[_0xd6b0('0x19')](_0x18b3b3);})[_0xd6b0('0x2f')](function(){var _0x11295f=[];for(var _0x172de7=0x0;_0x172de7<_0x222dbc[_0xd6b0('0x16')];_0x172de7+=0x1){var _0x4903f7=_0x222dbc[_0x172de7];var _0x4dce0e=createTables(_[_0xd6b0('0x3c')](_0x4903f7));var _0x26bd1b;var _0x18510f=getPDFDocDefinition(_0x4dce0e);var _0x485dc7=getPDFPrinter();var _0x353023=_0x485dc7[_0xd6b0('0x3d')](_0x18510f);if(_0x2bad56){_0x26bd1b=path[_0xd6b0('0x3e')](_0x2d4d5c,_0x27fc71,util['format'](_0xd6b0('0x3f'),_0x27fc71,_0x172de7,_0xd6b0('0x40')));}else{_0x26bd1b=path[_0xd6b0('0x3e')](_0x2d4d5c,util[_0xd6b0('0x1c')](_0xd6b0('0x41'),_0x27fc71,_0xd6b0('0x40')));}_0x11295f[_0xd6b0('0x19')](writePDFDocument(_0x353023,_0x26bd1b));}return Promise['all'](_0x11295f);})[_0xd6b0('0x2f')](function(){if(_0x2bad56){return new Promise(function(_0xb2c8c7){zipdir(path[_0xd6b0('0x3e')](_0x2d4d5c,_0x27fc71),{'saveTo':path['join'](_0x2d4d5c,util[_0xd6b0('0x1c')](_0xd6b0('0x41'),_0x27fc71,_0xd6b0('0x42')))},function(){rimraf(path[_0xd6b0('0x3e')](_0x2d4d5c,_0x27fc71),function(){});_0xb2c8c7(_0xd6b0('0x43'));});});}})[_0xd6b0('0x2f')](function(){if(!_0x2bad56)return;rimraf(path['join'](_0x2d4d5c,_0x27fc71),function(){});})[_0xd6b0('0x2f')](function(){logger['info'](util['format'](_0xd6b0('0x44'),EXTRACTED_REPORT_ID,_0xd6b0('0x45')));return analyticExtractedReport('Completed',_0x2bad56?util[_0xd6b0('0x1c')]('%s.%s',_0x27fc71,_0x2bad56?'zip':_0xd6b0('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xd6b0('0x46')](util[_0xd6b0('0x1c')](_0xd6b0('0x47'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xd6b0('0xf')][_0xd6b0('0x48')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd6b0('0x2f')](function(_0x34af68){EXTRACTED_REPORT=_0x34af68;return dbH[_0xd6b0('0x35')][_0xd6b0('0x33')](util[_0xd6b0('0x1c')](_0xd6b0('0x49'),QUERY),{'type':dbH[_0xd6b0('0x35')][_0xd6b0('0x36')][_0xd6b0('0x37')]});})['then'](extractReport)[_0xd6b0('0x4a')](function(_0x3dbe1c){logger[_0xd6b0('0x46')](util['format'](_0xd6b0('0x4b'),EXTRACTED_REPORT_ID,_0xd6b0('0x45')),util[_0xd6b0('0x4c')](_0x3dbe1c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xd6b0('0x4d')](function(){process[_0xd6b0('0x4e')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2d2127=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xd6b0('0x4f'),'bolditalics':__dirname+_0xd6b0('0x50')}});return _0x2d2127;}function getPDFDocDefinitionFromHTML(_0x3b553f,_0x3c9e9d){var _0x235f71=util[_0xd6b0('0x1c')]('%s\x20#%d',_0x3c9e9d[_0xd6b0('0x51')],_0x3c9e9d[_0xd6b0('0x52')]);var _0x479a1=moment()[_0xd6b0('0x1c')](_0xd6b0('0x53'))[_0xd6b0('0x25')]();var _0x1a2d30=htmlToPdfmake(_0x3b553f,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1a2d30],'defaultStyle':{'font':_0xd6b0('0x54')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xd6b0('0x55'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xd6b0('0x55'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xd6b0('0x55')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x97e1e,_0x10fa52){return[{'text':util[_0xd6b0('0x1c')](_0xd6b0('0x56'),_0x235f71,_0x97e1e,_0x10fa52,_0x479a1),'style':'footer'}];}};}function writePDFDocument(_0x5dbfc2,_0x264e00){return new Promise(function(_0x5797c7,_0x384998){var _0x2e9423=_0x5dbfc2[_0xd6b0('0x57')](fs[_0xd6b0('0x58')](_0x264e00));_0x2e9423['on'](_0xd6b0('0x59'),function(){_0x5797c7('finish');});_0x2e9423['on'](_0xd6b0('0x5a'),function(_0x408adb){_0x384998(_0x408adb);});_0x5dbfc2[_0xd6b0('0x5b')]();});}exports[_0xd6b0('0x5c')]=function(_0x212a68,_0x2debbb){var _0x584b2c=getPDFPrinter();var _0x5b9a10=getPDFDocDefinitionFromHTML(_0x212a68,_0x2debbb);var _0x359e37=_0x584b2c[_0xd6b0('0x3d')](_0x5b9a10);return writePDFDocument(_0x359e37,_0x2debbb[_0xd6b0('0x2')])[_0xd6b0('0x4a')](function(_0x2b93a0){throw _0x2b93a0;});}; \ No newline at end of file +var _0xe149=['toString','fill','length','auto','body','concat','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','header','pageBreak','before','margin','\x20/\x20','footer','Arial','black','right','num','Setting','split','splitSizePdf','then','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.pdf','join','mkdirSync','each','flatten','%s%d.%s','pdf','all','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','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','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','map','pick'];(function(_0x28e69c,_0x14e5ad){var _0xd93a57=function(_0x35eb4f){while(--_0x35eb4f){_0x28e69c['push'](_0x28e69c['shift']());}};_0xd93a57(++_0x14e5ad);}(_0xe149,0x10a));var _0x9e14=function(_0x4c5af0,_0x47f4b3){_0x4c5af0=_0x4c5af0-0x0;var _0x575e34=_0xe149[_0x4c5af0];return _0x575e34;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x9e14('0x0'));var path=require(_0x9e14('0x1'));var moment=require(_0x9e14('0x2'));var htmlToPdfmake=require(_0x9e14('0x3'));var PdfPrinter=require(_0x9e14('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x9e14('0x5'));var JSDOM=require(_0x9e14('0x6'))[_0x9e14('0x7')];var window=new JSDOM('')[_0x9e14('0x8')];var BPromise=require(_0x9e14('0x9'));var db=require(_0x9e14('0xa'))['db'];var dbH=require(_0x9e14('0xa'))[_0x9e14('0xb')];var logger=require(_0x9e14('0xc'))(_0x9e14('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x9e14('0xe')][0x2]);var QUERY=process[_0x9e14('0xe')][0x3];var PATH=process[_0x9e14('0xe')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x9e14('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5b3439,_0x146ee7){var _0x52d6ad={'status':_0x5b3439};var _0x49af44={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x146ee7){_0x52d6ad[_0x9e14('0x10')]=_0x146ee7;}return db['AnalyticExtractedReport']['update'](_0x52d6ad,_0x49af44);}function getHeaders(_0x1f2c03){return _[_0x9e14('0x11')](_0x1f2c03,function(_0x3b3acf){return{'text':_0x3b3acf,'style':'tableHeader'};});}function getRows(_0x254682,_0x5ca8f5){return _[_0x9e14('0x11')](_0x5ca8f5,function(_0x5afa03){return _(_0x5afa03)[_0x9e14('0x12')](_0x254682)[_0x9e14('0x11')](function(_0x4a9969){return _0x4a9969?_[_0x9e14('0x13')](_0x4a9969):'';})['value']();});}function createTable(_0x566fef,_0x1351c5){var _0x46c2ff={'widths':_[_0x9e14('0x14')](Array(_0x566fef[_0x9e14('0x15')]),0x91),'heights':function(_0x429bae){return _0x429bae===0x0?_0x9e14('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3fe5fb=getHeaders(_0x566fef);_0x46c2ff[_0x9e14('0x17')]['push'](_0x3fe5fb);var _0x22cdd5=getRows(_0x566fef,_0x1351c5);_0x46c2ff['body']=_0x46c2ff['body'][_0x9e14('0x18')](_0x22cdd5);return _0x46c2ff;}function createTables(_0x1b5189){var _0x4af955=[];var _0x2ac7a7=_[_0x9e14('0x19')](Object[_0x9e14('0x1a')](_0x1b5189[0x0]),0x5);_0x2ac7a7[_0x9e14('0x1b')](function(_0x398ea1){_0x4af955[_0x9e14('0x1c')](createTable(_0x398ea1,_0x1b5189));});return _0x4af955;}function getPDFDocDefinition(_0x850487){var _0x21ea18=util[_0x9e14('0x1d')](_0x9e14('0x1e'),NAME,EXTRACTED_REPORT[_0x9e14('0x1f')],moment(EXTRACTED_REPORT[_0x9e14('0x20')])[_0x9e14('0x1d')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x9e14('0x1d')](FORMAT));var _0x185d94=[];for(var _0x16d00c=0x0;_0x16d00c<_0x850487[_0x9e14('0x15')];_0x16d00c++){var _0x1e283d=[];if(_0x16d00c===0x0){_0x1e283d[_0x9e14('0x1c')]({'text':_0x21ea18,'style':_0x9e14('0x21')});}var _0x3e813b={'table':_0x850487[_0x16d00c]};if(_0x16d00c>0x0){_0x3e813b[_0x9e14('0x22')]=_0x9e14('0x23');_0x3e813b[_0x9e14('0x24')]=[0x0,0x46,0x0,0x0];}_0x1e283d[_0x9e14('0x1c')](_0x3e813b);_0x185d94[_0x9e14('0x1c')](_0x1e283d);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x185d94,'footer':function(_0x2adb88,_0x236fff){return{'text':_0x2adb88[_0x9e14('0x13')]()+_0x9e14('0x25')+_0x236fff,'style':_0x9e14('0x26')};},'defaultStyle':{'font':_0x9e14('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9e14('0x28')},'footer':{'alignment':_0x9e14('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x59b321){var _0xf78c5d=0x1388;var _0x33986d;if(!_0x59b321[0x0][_0x9e14('0x2a')]){return analyticExtractedReport('Empty');}return db[_0x9e14('0x2b')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9e14('0x2c'),_0x9e14('0x2d')]})[_0x9e14('0x2e')](function(_0x4cdcea){if(_0x4cdcea){_0x33986d=_0x4cdcea;_0xf78c5d=_0x33986d[_0x9e14('0x2d')]||0x3e8;}})[_0x9e14('0x2e')](function(){var _0x1b2123=[];var _0x24568c=0x0;if(_0x33986d[_0x9e14('0x2c')]){if(_0x59b321&&_0x59b321[_0x9e14('0x15')]){var _0x1360ac=_[_0x9e14('0x2f')](_0x59b321[0x0][_0x9e14('0x2a')]/_0xf78c5d);var _0x479bbe=Number[_0x9e14('0x30')](_0x59b321[0x0][_0x9e14('0x2a')]/_0xf78c5d)?_0x59b321[0x0][_0x9e14('0x2a')]%_0xf78c5d:0x0;_0x1360ac[_0x9e14('0x1b')](function(_0x395eb8){if(_0x395eb8>0x0){_0x24568c+=_0xf78c5d;}_0x1b2123['push'](dbH[_0x9e14('0x31')]['query'](util[_0x9e14('0x1d')](_0x9e14('0x32'),QUERY,_0xf78c5d,_0x24568c),{'type':dbH['sequelize'][_0x9e14('0x33')][_0x9e14('0x34')]}));});if(_0x479bbe>0x0){_0x24568c+=_0xf78c5d;_0x1b2123[_0x9e14('0x1c')](dbH['sequelize']['query'](util[_0x9e14('0x1d')](_0x9e14('0x32'),QUERY,_0x479bbe,_0x24568c),{'type':dbH[_0x9e14('0x31')][_0x9e14('0x33')][_0x9e14('0x34')]}));}}}else{_0x1b2123['push'](dbH[_0x9e14('0x31')]['query'](QUERY,{'type':dbH[_0x9e14('0x31')][_0x9e14('0x33')][_0x9e14('0x34')]}));}var _0x1f546a=path[_0x9e14('0x35')](PATH);var _0x541011=path['basename'](PATH,_0x9e14('0x36'));var _0xcb7a25=_0x33986d['split']&&_0x1b2123[_0x9e14('0x15')]>0x1;var _0x12f37e=[];if(!fs['existsSync'](path[_0x9e14('0x37')](_0x1f546a,_0x541011))&&_0xcb7a25){fs[_0x9e14('0x38')](path[_0x9e14('0x37')](_0x1f546a,_0x541011));}return BPromise[_0x9e14('0x39')](_0x1b2123,function(_0x326f3e){_0x12f37e[_0x9e14('0x1c')](_0x326f3e);})[_0x9e14('0x2e')](function(){var _0x91ec18=[];for(var _0x58e9dd=0x0;_0x58e9dd<_0x12f37e[_0x9e14('0x15')];_0x58e9dd+=0x1){var _0x24c1e5=_0x12f37e[_0x58e9dd];var _0x323fb7=createTables(_[_0x9e14('0x3a')](_0x24c1e5));var _0x5e7179;var _0x4c41d4=getPDFDocDefinition(_0x323fb7);var _0x27d555=getPDFPrinter();var _0x58af92=_0x27d555['createPdfKitDocument'](_0x4c41d4);if(_0xcb7a25){_0x5e7179=path[_0x9e14('0x37')](_0x1f546a,_0x541011,util[_0x9e14('0x1d')](_0x9e14('0x3b'),_0x541011,_0x58e9dd,_0x9e14('0x3c')));}else{_0x5e7179=path['join'](_0x1f546a,util[_0x9e14('0x1d')]('%s.%s',_0x541011,_0x9e14('0x3c')));}_0x91ec18[_0x9e14('0x1c')](writePDFDocument(_0x58af92,_0x5e7179));}return Promise[_0x9e14('0x3d')](_0x91ec18);})[_0x9e14('0x2e')](function(){if(_0xcb7a25){return new Promise(function(_0x401767){zipdir(path[_0x9e14('0x37')](_0x1f546a,_0x541011),{'saveTo':path[_0x9e14('0x37')](_0x1f546a,util[_0x9e14('0x1d')](_0x9e14('0x3e'),_0x541011,'zip'))},function(){rimraf(path[_0x9e14('0x37')](_0x1f546a,_0x541011),function(){});_0x401767(_0x9e14('0x3f'));});});}})['then'](function(){if(!_0xcb7a25)return;rimraf(path['join'](_0x1f546a,_0x541011),function(){});})['then'](function(){logger[_0x9e14('0x40')](util[_0x9e14('0x1d')](_0x9e14('0x41'),EXTRACTED_REPORT_ID,_0x9e14('0x42')));return analyticExtractedReport('Completed',_0xcb7a25?util['format'](_0x9e14('0x3e'),_0x541011,_0xcb7a25?_0x9e14('0x43'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x9e14('0x40')](util[_0x9e14('0x1d')](_0x9e14('0x44'),EXTRACTED_REPORT_ID,_0x9e14('0x42')));return db[_0x9e14('0x45')][_0x9e14('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9e14('0x2e')](function(_0x3757d9){EXTRACTED_REPORT=_0x3757d9;return dbH[_0x9e14('0x31')][_0x9e14('0x47')](util[_0x9e14('0x1d')](_0x9e14('0x48'),QUERY),{'type':dbH[_0x9e14('0x31')][_0x9e14('0x33')]['SELECT']});})[_0x9e14('0x2e')](extractReport)['catch'](function(_0x2e0dfe){logger[_0x9e14('0x40')](util['format'](_0x9e14('0x49'),EXTRACTED_REPORT_ID,_0x9e14('0x42')),util[_0x9e14('0x4a')](_0x2e0dfe,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9e14('0x4b'));})[_0x9e14('0x4c')](function(){process[_0x9e14('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4b8873=new PdfPrinter({'Arial':{'normal':__dirname+_0x9e14('0x4e'),'bold':__dirname+_0x9e14('0x4f'),'italics':__dirname+_0x9e14('0x50'),'bolditalics':__dirname+_0x9e14('0x51')}});return _0x4b8873;}function getPDFDocDefinitionFromHTML(_0x2f0cb3,_0x28108d){var _0x19e6a7=util[_0x9e14('0x1d')](_0x9e14('0x52'),_0x28108d[_0x9e14('0x53')],_0x28108d[_0x9e14('0x54')]);var _0x4c3965=moment()['format'](_0x9e14('0x55'))[_0x9e14('0x13')]();var _0x226efb=htmlToPdfmake(_0x2f0cb3,{'window':window,'tableAutoSize':!![]});return{'content':[_0x226efb],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x9e14('0x56'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9e14('0x56')}},'header':function(){return[{'text':_0x9e14('0x57'),'style':_0x9e14('0x21')}];},'footer':function(_0x42b337,_0x3e13aa){return[{'text':util[_0x9e14('0x1d')](_0x9e14('0x58'),_0x19e6a7,_0x42b337,_0x3e13aa,_0x4c3965),'style':_0x9e14('0x26')}];}};}function writePDFDocument(_0x327d27,_0x6eb981){return new Promise(function(_0x1fb66b,_0x485671){var _0x2e856c=_0x327d27[_0x9e14('0x59')](fs[_0x9e14('0x5a')](_0x6eb981));_0x2e856c['on'](_0x9e14('0x5b'),function(){_0x1fb66b(_0x9e14('0x5b'));});_0x2e856c['on'](_0x9e14('0x5c'),function(_0x55f660){_0x485671(_0x55f660);});_0x327d27[_0x9e14('0x5d')]();});}exports[_0x9e14('0x5e')]=function(_0x1d64f5,_0x947755){var _0x176379=getPDFPrinter();var _0x5d3215=getPDFDocDefinitionFromHTML(_0x1d64f5,_0x947755);var _0x14671f=_0x176379['createPdfKitDocument'](_0x5d3215);return writePDFDocument(_0x14671f,_0x947755['path'])['catch'](function(_0x58434d){throw _0x58434d;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index e879ba5..88d22af 100644 --- a/server/components/export/xlsx.js +++ b/server/components/export/xlsx.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0924=['dirname','.xlsx','split','existsSync','join','each','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','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','finally','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','update','format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length','range','num','isInteger','forEach','push','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d'];(function(_0x1ccb95,_0x1b3be8){var _0x1a9725=function(_0x1a6bf7){while(--_0x1a6bf7){_0x1ccb95['push'](_0x1ccb95['shift']());}};_0x1a9725(++_0x1b3be8);}(_0x0924,0x77));var _0x4092=function(_0x525864,_0x1bb3ea){_0x525864=_0x525864-0x0;var _0x4f9964=_0x0924[_0x525864];return _0x4f9964;};'use strict';var util=require('util');var path=require(_0x4092('0x0'));var _=require(_0x4092('0x1'));var fs=require('fs');var json2xls=require(_0x4092('0x2'));var BPromise=require(_0x4092('0x3'));var zipdir=require(_0x4092('0x4'));var rimraf=require(_0x4092('0x5'));var db=require(_0x4092('0x6'))['db'];var dbH=require('../../mysqldb')[_0x4092('0x7')];var logger=require(_0x4092('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x4092('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x4092('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x238a93,_0x524f38){var _0x5f10ea={'status':_0x238a93};var _0x5f3135={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x524f38){_0x5f10ea[_0x4092('0xa')]=_0x524f38;}return db['AnalyticExtractedReport'][_0x4092('0xb')](_0x5f10ea,_0x5f3135);}function main(){var _0x5b37ff=0x1388;var _0xeecaff;logger['info'](util[_0x4092('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x4092('0xd')));return db[_0x4092('0xe')][_0x4092('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x4092('0x10')]})[_0x4092('0x11')](function(_0x2c10f1){if(_0x2c10f1){_0xeecaff=_0x2c10f1;_0x5b37ff=_0xeecaff['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0x4092('0x12')][_0x4092('0x13')](util[_0x4092('0xc')](_0x4092('0x14'),QUERY),{'type':dbH['sequelize'][_0x4092('0x15')]['SELECT']});})[_0x4092('0x11')](function(_0x5dd2f2){if(!_0x5dd2f2[0x0]['num']){return analyticExtractedReport(_0x4092('0x16'));}var _0x567364=[];var _0xe2057e=0x0;if(_0xeecaff['split']){if(_0x5dd2f2&&_0x5dd2f2[_0x4092('0x17')]){var _0x3b081d=_[_0x4092('0x18')](_0x5dd2f2[0x0][_0x4092('0x19')]/_0x5b37ff);var _0x49d3ee=Number[_0x4092('0x1a')](_0x5dd2f2[0x0][_0x4092('0x19')]/_0x5b37ff)?_0x5dd2f2[0x0][_0x4092('0x19')]%_0x5b37ff:0x0;_0x3b081d[_0x4092('0x1b')](function(_0x177aec){if(_0x177aec>0x0){_0xe2057e+=_0x5b37ff;}_0x567364[_0x4092('0x1c')](dbH[_0x4092('0x12')][_0x4092('0x13')](util[_0x4092('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5b37ff,_0xe2057e),{'type':dbH[_0x4092('0x12')][_0x4092('0x15')][_0x4092('0x1d')]}));});if(_0x49d3ee>0x0){_0xe2057e+=_0x5b37ff;_0x567364['push'](dbH[_0x4092('0x12')][_0x4092('0x13')](util[_0x4092('0xc')](_0x4092('0x1e'),QUERY,_0x49d3ee,_0xe2057e),{'type':dbH['sequelize'][_0x4092('0x15')][_0x4092('0x1d')]}));}}}else{_0x567364[_0x4092('0x1c')](dbH[_0x4092('0x12')]['query'](QUERY,{'type':dbH[_0x4092('0x12')][_0x4092('0x15')]['SELECT']}));}var _0x16d272=path[_0x4092('0x1f')](PATH);var _0x58e62d=path['basename'](PATH,_0x4092('0x20'));var _0x34257d=_0xeecaff[_0x4092('0x21')]&&_0x567364['length']>0x1;var _0x4a149f=[];if(!fs[_0x4092('0x22')](path[_0x4092('0x23')](_0x16d272,_0x58e62d))&&_0x34257d){fs['mkdirSync'](path[_0x4092('0x23')](_0x16d272,_0x58e62d));}return BPromise[_0x4092('0x24')](_0x567364,function(_0x4b9028){_0x4a149f['push'](_0x4b9028);})[_0x4092('0x11')](function(){for(var _0x2845fe=0x0;_0x2845fe<_0x4a149f['length'];_0x2845fe+=0x1){var _0x28f708;var _0x127a47=_0x4a149f[_0x2845fe];if(_0x34257d){_0x28f708=path[_0x4092('0x23')](_0x16d272,_0x58e62d,util[_0x4092('0xc')]('%s%d.%s',_0x58e62d,_0x2845fe,_0x4092('0x25')));}else{_0x28f708=path[_0x4092('0x23')](_0x16d272,util[_0x4092('0xc')](_0x4092('0x26'),_0x58e62d,_0x4092('0x25')));}fs[_0x4092('0x27')](_0x28f708,json2xls(_0x127a47),_0x4092('0x28'));}})[_0x4092('0x11')](function(){if(_0x34257d){return new Promise(function(_0x44058a){zipdir(path[_0x4092('0x23')](_0x16d272,_0x58e62d),{'saveTo':path['join'](_0x16d272,util[_0x4092('0xc')](_0x4092('0x26'),_0x58e62d,_0x4092('0x29')))},function(_0xb35c07,_0x450a4b){rimraf(path[_0x4092('0x23')](_0x16d272,_0x58e62d),function(){});_0x44058a(_0x4092('0x2a'));});});}})[_0x4092('0x11')](function(){logger[_0x4092('0x2b')](util[_0x4092('0xc')](_0x4092('0x2c'),EXTRACTED_REPORT_ID,_0x4092('0xd')));return analyticExtractedReport(_0x4092('0x2d'),_0x34257d?util[_0x4092('0xc')](_0x4092('0x26'),_0x58e62d,_0x34257d?_0x4092('0x29'):'xlsx'):null);});})[_0x4092('0x2e')](function(_0x36b3c3){logger[_0x4092('0x2b')](util[_0x4092('0xc')](_0x4092('0x2f'),EXTRACTED_REPORT_ID,_0x4092('0xd')),util[_0x4092('0x30')](_0x36b3c3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x4092('0x31')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd9ee=['%s.%s','xlsx','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','util','lodash','bluebird','zip-dir','rimraf','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','num','range','isInteger','forEach','push','SELECT','dirname','basename','.xlsx','join','each','length','%s%d.%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd9ee,0x9f));var _0xed9e=function(_0x54da20,_0x1f6a03){_0x54da20=_0x54da20-0x0;var _0x4af954=_0xd9ee[_0x54da20];return _0x4af954;};'use strict';var util=require(_0xed9e('0x0'));var path=require('path');var _=require(_0xed9e('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xed9e('0x2'));var zipdir=require(_0xed9e('0x3'));var rimraf=require(_0xed9e('0x4'));var db=require(_0xed9e('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0xed9e('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xed9e('0x7')][0x2]);var QUERY=process[_0xed9e('0x7')][0x3];var PATH=process[_0xed9e('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x12e175,_0x19413e){var _0x581399={'status':_0x12e175};var _0x4f84c5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x19413e){_0x581399[_0xed9e('0x8')]=_0x19413e;}return db[_0xed9e('0x9')][_0xed9e('0xa')](_0x581399,_0x4f84c5);}function main(){var _0x4e0e58=0x1388;var _0x327a54;logger[_0xed9e('0xb')](util[_0xed9e('0xc')](_0xed9e('0xd'),EXTRACTED_REPORT_ID,_0xed9e('0xe')));return db[_0xed9e('0xf')][_0xed9e('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xed9e('0x11'),_0xed9e('0x12')]})[_0xed9e('0x13')](function(_0x414702){if(_0x414702){_0x327a54=_0x414702;_0x4e0e58=_0x327a54[_0xed9e('0x12')]||0x1388;}})[_0xed9e('0x13')](function(){return dbH['sequelize'][_0xed9e('0x14')](util[_0xed9e('0xc')](_0xed9e('0x15'),QUERY),{'type':dbH[_0xed9e('0x16')][_0xed9e('0x17')]['SELECT']});})[_0xed9e('0x13')](function(_0x15544e){if(!_0x15544e[0x0][_0xed9e('0x18')]){return analyticExtractedReport('Empty');}var _0x2c67bf=[];var _0x26fa5d=0x0;if(_0x327a54[_0xed9e('0x11')]){if(_0x15544e&&_0x15544e['length']){var _0x56b124=_[_0xed9e('0x19')](_0x15544e[0x0][_0xed9e('0x18')]/_0x4e0e58);var _0x31a86f=Number[_0xed9e('0x1a')](_0x15544e[0x0][_0xed9e('0x18')]/_0x4e0e58)?_0x15544e[0x0][_0xed9e('0x18')]%_0x4e0e58:0x0;_0x56b124[_0xed9e('0x1b')](function(_0x13a86b){if(_0x13a86b>0x0){_0x26fa5d+=_0x4e0e58;}_0x2c67bf[_0xed9e('0x1c')](dbH['sequelize']['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4e0e58,_0x26fa5d),{'type':dbH[_0xed9e('0x16')][_0xed9e('0x17')][_0xed9e('0x1d')]}));});if(_0x31a86f>0x0){_0x26fa5d+=_0x4e0e58;_0x2c67bf[_0xed9e('0x1c')](dbH[_0xed9e('0x16')][_0xed9e('0x14')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x31a86f,_0x26fa5d),{'type':dbH[_0xed9e('0x16')][_0xed9e('0x17')][_0xed9e('0x1d')]}));}}}else{_0x2c67bf[_0xed9e('0x1c')](dbH[_0xed9e('0x16')][_0xed9e('0x14')](QUERY,{'type':dbH[_0xed9e('0x16')][_0xed9e('0x17')]['SELECT']}));}var _0xfc4f4a=path[_0xed9e('0x1e')](PATH);var _0xf9433b=path[_0xed9e('0x1f')](PATH,_0xed9e('0x20'));var _0xcd5f3c=_0x327a54[_0xed9e('0x11')]&&_0x2c67bf['length']>0x1;var _0x645de9=[];if(!fs['existsSync'](path[_0xed9e('0x21')](_0xfc4f4a,_0xf9433b))&&_0xcd5f3c){fs['mkdirSync'](path['join'](_0xfc4f4a,_0xf9433b));}return BPromise[_0xed9e('0x22')](_0x2c67bf,function(_0x557f17){_0x645de9[_0xed9e('0x1c')](_0x557f17);})[_0xed9e('0x13')](function(){for(var _0x25ce46=0x0;_0x25ce46<_0x645de9[_0xed9e('0x23')];_0x25ce46+=0x1){var _0x465d00;var _0x525844=_0x645de9[_0x25ce46];if(_0xcd5f3c){_0x465d00=path[_0xed9e('0x21')](_0xfc4f4a,_0xf9433b,util[_0xed9e('0xc')](_0xed9e('0x24'),_0xf9433b,_0x25ce46,'xlsx'));}else{_0x465d00=path[_0xed9e('0x21')](_0xfc4f4a,util[_0xed9e('0xc')](_0xed9e('0x25'),_0xf9433b,_0xed9e('0x26')));}fs[_0xed9e('0x27')](_0x465d00,json2xls(_0x525844),'binary');}})[_0xed9e('0x13')](function(){if(_0xcd5f3c){return new Promise(function(_0x53194d){zipdir(path[_0xed9e('0x21')](_0xfc4f4a,_0xf9433b),{'saveTo':path[_0xed9e('0x21')](_0xfc4f4a,util[_0xed9e('0xc')](_0xed9e('0x25'),_0xf9433b,_0xed9e('0x28')))},function(_0x6985de,_0x1a7d22){rimraf(path['join'](_0xfc4f4a,_0xf9433b),function(){});_0x53194d(_0xed9e('0x29'));});});}})[_0xed9e('0x13')](function(){logger[_0xed9e('0xb')](util[_0xed9e('0xc')](_0xed9e('0x2a'),EXTRACTED_REPORT_ID,_0xed9e('0xe')));return analyticExtractedReport(_0xed9e('0x2b'),_0xcd5f3c?util[_0xed9e('0xc')](_0xed9e('0x25'),_0xf9433b,_0xcd5f3c?_0xed9e('0x28'):_0xed9e('0x26')):null);});})[_0xed9e('0x2c')](function(_0x5ad2df){logger[_0xed9e('0xb')](util[_0xed9e('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xed9e('0xe')),util[_0xed9e('0x2d')](_0x5ad2df,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xed9e('0x2e'));})[_0xed9e('0x2f')](function(){process[_0xed9e('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 8cb0dbf..550183c 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 _0x959e=['recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','length','createdAt','updatedAt','*,*,*,*','intervals','interval','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','VoiceExtension','bulkCreate','catch','rewrite','lodash','models','Interval','findAll','then','IntervalId','map','exten','filter','queue','playback','hasOwnProperty','priority','extension','find','extensions','push','Set','format','CDR(type)=%s','context','VoiceExtensionId','type','inbound','CDR(routeid)=','outbound','CDR(destination)=','${EXTEN:','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','outboundrouteid='];(function(_0x3d3e03,_0x322473){var _0x2fb8a5=function(_0x4a0703){while(--_0x4a0703){_0x3d3e03['push'](_0x3d3e03['shift']());}};_0x2fb8a5(++_0x322473);}(_0x959e,0x17e));var _0xe959=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0x959e[_0x16dbfd];return _0x382254;};'use strict';var _=require(_0xe959('0x0'));var util=require('util');function rewrite(_0x4f993a,_0x4b3523){var _0x321be7=this;return _0x4f993a[_0xe959('0x1')][_0xe959('0x2')][_0xe959('0x3')]({'raw':!![]})[_0xe959('0x4')](function(_0x15df96){_0x321be7['intervals']=_0x15df96;return _0x4f993a[_0xe959('0x1')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x4b3523[_0xe959('0x5')]},'raw':!![]});})[_0xe959('0x4')](function(_0x33b5ac){return _0x4f993a['models']['VoiceExtension'][_0xe959('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0xe959('0x6')](_0x33b5ac,_0xe959('0x7')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x28bb6a){var _0x28b75f=_[_0xe959('0x8')](_0x28bb6a,{'priority':'1'});var _0x2ec3c2=_[_0xe959('0x8')](_0x28bb6a,{'isApp':0x1});var _0x90a519=_['groupBy'](_0x2ec3c2,_0xe959('0x7'));var _0x3ea59d=[_0xe959('0x9'),_0xe959('0xa')];var _0x45118e=[];var _0x51a903=[];for(var _0xa1a4b1 in _0x90a519){if(_0x90a519[_0xe959('0xb')](_0xa1a4b1)){_0x321be7[_0xe959('0xc')]=0x2;_0x321be7['extensions']=[];_0x321be7[_0xe959('0xd')]=_[_0xe959('0xe')](_0x28b75f,{'exten':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x7')]});_0x321be7[_0xe959('0xf')][_0xe959('0x10')]({'type':_0x90a519[_0xa1a4b1][0x0]['type'],'app':_0xe959('0x11'),'appdata':util[_0xe959('0x12')](_0xe959('0x13'),_0x90a519[_0xa1a4b1][0x0]['type']),'context':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x14')],'exten':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x7')],'priority':_0x321be7[_0xe959('0xc')]++,'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x15')]});if(_0x90a519[_0xa1a4b1][0x0][_0xe959('0x16')]===_0xe959('0x17')){_0x321be7['extensions'][_0xe959('0x10')]({'type':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x16')],'app':_0xe959('0x11'),'appdata':_0xe959('0x18')+_0x90a519[_0xa1a4b1][0x0][_0xe959('0x15')],'context':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x14')],'exten':_0x90a519[_0xa1a4b1][0x0]['exten'],'priority':_0x321be7[_0xe959('0xc')]++,'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x15')]});}else if(_0x90a519[_0xa1a4b1][0x0]['type']===_0xe959('0x19')){if(_0x321be7['extension']){_0x321be7[_0xe959('0xf')][_0xe959('0x10')]({'type':_0x90a519[_0xa1a4b1][0x0]['type'],'app':'Set','appdata':_0xe959('0x1a')+(_0x321be7[_0xe959('0xd')]['cutdigits']?_0xe959('0x1b')+_0x321be7[_0xe959('0xd')]['cutdigits']+'}':'${EXTEN}'),'context':_0x90a519[_0xa1a4b1][0x0]['context'],'exten':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x7')],'priority':_0x321be7[_0xe959('0xc')]++,'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0]['VoiceExtensionId']});}_0x321be7[_0xe959('0xf')][_0xe959('0x10')]({'type':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x16')],'app':'Set','appdata':_0xe959('0x18')+_0x90a519[_0xa1a4b1][0x0]['VoiceExtensionId'],'context':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x14')],'exten':_0x90a519[_0xa1a4b1][0x0]['exten'],'priority':_0x321be7['priority']++,'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x15')]});var _0x1798fc=_0x321be7[_0xe959('0xc')]++;_0x321be7[_0xe959('0xf')][_0xe959('0x10')]({'type':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x16')],'app':'ExecIf','appdata':_0xe959('0x1c')+(_0x1798fc+0x2)+'):Goto('+(_0x1798fc+0x1)+')','context':_0x90a519[_0xa1a4b1][0x0]['context'],'exten':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x7')],'priority':_0x1798fc,'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0]['VoiceExtensionId']});if(_0x321be7['extension']){_0x321be7[_0xe959('0xf')]['push']({'type':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x16')],'app':_0xe959('0x11'),'appdata':_0x321be7[_0xe959('0xd')][_0xe959('0x1d')]?_0xe959('0x1e')+_0x321be7[_0xe959('0xd')][_0xe959('0x1d')]+'}':'CDR(prefix)=noprefix','context':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x14')],'exten':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x7')],'priority':_0x321be7[_0xe959('0xc')]++,'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x15')]});}_0x321be7[_0xe959('0xf')][_0xe959('0x10')]({'type':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x16')],'app':_0xe959('0x11'),'appdata':_0xe959('0x1f')+_0x90a519[_0xa1a4b1][0x0][_0xe959('0x15')],'context':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x14')],'exten':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x7')],'priority':_0x321be7[_0xe959('0xc')]++,'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0]['VoiceExtensionId']});if(_0x321be7[_0xe959('0xd')]&&_0x321be7['extension'][_0xe959('0xb')](_0xe959('0x20'))&&_0x321be7[_0xe959('0xd')][_0xe959('0x20')]!==_0xe959('0x21')){_0x321be7[_0xe959('0xf')][_0xe959('0x10')]({'type':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x16')],'app':_0xe959('0x11'),'appdata':_0xe959('0x22'),'context':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x14')],'exten':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x7')],'priority':_0x321be7['priority']++,'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x15')]});_0x321be7['extensions'][_0xe959('0x10')]({'type':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x16')],'app':_0xe959('0x11'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x321be7[_0xe959('0xd')]['recordingFormat']||_0xe959('0x23'),'context':_0x90a519[_0xa1a4b1][0x0]['context'],'exten':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x7')],'priority':_0x321be7[_0xe959('0xc')]++,'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x15')]});}}_0x321be7[_0xe959('0xf')][_0xe959('0x10')]({'type':_0x90a519[_0xa1a4b1][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x14')],'exten':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x7')],'priority':_0x321be7[_0xe959('0xc')]++,'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x15')]});_0x321be7[_0xe959('0xf')][_0xe959('0x10')]({'type':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x16')],'app':_0xe959('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x14')],'exten':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x7')],'priority':_0x321be7[_0xe959('0xc')]++,'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0]['VoiceExtensionId']});_0x321be7['extensions'][_0xe959('0x10')]({'type':_0x90a519[_0xa1a4b1][0x0]['type'],'app':_0xe959('0x11'),'appdata':'MONITOR_OPTIONS=ab','context':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x14')],'exten':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x7')],'priority':_0x321be7['priority']++,'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x15')]});for(var _0x55334b=0x0,_0x3c123a=0x0;_0x55334b<_0x90a519[_0xa1a4b1][_0xe959('0x24')];_0x55334b+=0x1,_0x3c123a=0x0){var _0x567e44=_0x90a519[_0xa1a4b1][_0x55334b];if(_0x567e44['type']){_0x567e44['type']=_0x567e44['type']['toLowerCase']();}var _0x13250b=[];var _0x42c85d=[];delete _0x567e44['id'];delete _0x567e44[_0xe959('0x25')];delete _0x567e44[_0xe959('0x26')];var _0x51e78e=_0x567e44['interval']!==_0xe959('0x27')?[_0x567e44['interval']]:_0x567e44['IntervalId']?_[_0xe959('0x6')](_[_0xe959('0x8')](_0x321be7[_0xe959('0x28')],{'IntervalId':_0x567e44[_0xe959('0x5')]}),_0xe959('0x29')):[];if(_0x567e44[_0xe959('0xb')]('tag')){if(_0x567e44[_0xe959('0x2a')]&&_0x567e44[_0xe959('0x2a')]!=='--'){_0x13250b[_0xe959('0x10')]({'type':_0x567e44['type'],'app':_0xe959('0x11'),'appdata':_0xe959('0x2b')+_0x567e44[_0xe959('0x2a')],'context':_0x567e44['context'],'exten':_0x567e44[_0xe959('0x7')],'priority':_0x51e78e['length']+_0x321be7[_0xe959('0xc')]+_0x3c123a++,'VoiceExtensionId':_0x567e44[_0xe959('0x15')]});}}if(_0x567e44['type']===_0xe959('0x19')&&_0x567e44['hasOwnProperty'](_0xe959('0x2c'))){if(_0x567e44['callerID']){_0x13250b[_0xe959('0x10')]({'type':_0x567e44[_0xe959('0x16')],'app':_0xe959('0x2d'),'appdata':_0xe959('0x2e')+_0x567e44[_0xe959('0x2c')]+')','context':_0x567e44[_0xe959('0x14')],'exten':_0x567e44[_0xe959('0x7')],'priority':_0x51e78e[_0xe959('0x24')]+_0x321be7[_0xe959('0xc')]+_0x3c123a++,'VoiceExtensionId':_0x567e44[_0xe959('0x15')]});}else{_0x13250b[_0xe959('0x10')]({'type':_0x567e44[_0xe959('0x16')],'app':_0xe959('0x2d'),'appdata':_0xe959('0x2f'),'context':_0x567e44[_0xe959('0x14')],'exten':_0x567e44[_0xe959('0x7')],'priority':_0x51e78e[_0xe959('0x24')]+_0x321be7['priority']+_0x3c123a++,'VoiceExtensionId':_0x567e44[_0xe959('0x15')]});}}if(_0x567e44[_0xe959('0xb')](_0xe959('0x30'))){if(_0x3ea59d[_0xe959('0x31')](_0x567e44[_0xe959('0x32')][_0xe959('0x33')]())>=0x0&&_0x567e44[_0xe959('0x34')]!=='custom'){if(_0x567e44[_0xe959('0x30')]){_0x13250b[_0xe959('0x10')]({'type':_0x567e44['type'],'app':_0xe959('0x2d'),'appdata':_0xe959('0x35'),'context':_0x567e44[_0xe959('0x14')],'exten':_0x567e44[_0xe959('0x7')],'priority':_0x51e78e[_0xe959('0x24')]+_0x321be7[_0xe959('0xc')]+_0x3c123a++,'VoiceExtensionId':_0x567e44['VoiceExtensionId']});_0x13250b['push']({'type':_0x567e44[_0xe959('0x16')],'app':_0xe959('0x11'),'appdata':_0xe959('0x36'),'context':_0x567e44['context'],'exten':_0x567e44[_0xe959('0x7')],'priority':_0x51e78e['length']+_0x321be7['priority']+_0x3c123a++,'VoiceExtensionId':_0x567e44['VoiceExtensionId']});}else{_0x13250b[_0xe959('0x10')]({'type':_0x567e44[_0xe959('0x16')],'app':_0xe959('0x2d'),'appdata':_0xe959('0x37'),'context':_0x567e44[_0xe959('0x14')],'exten':_0x567e44['exten'],'priority':_0x51e78e[_0xe959('0x24')]+_0x321be7[_0xe959('0xc')]+_0x3c123a++,'VoiceExtensionId':_0x567e44[_0xe959('0x15')]});_0x13250b[_0xe959('0x10')]({'type':_0x567e44['type'],'app':_0xe959('0x11'),'appdata':_0xe959('0x38'),'context':_0x567e44[_0xe959('0x14')],'exten':_0x567e44[_0xe959('0x7')],'priority':_0x51e78e[_0xe959('0x24')]+_0x321be7[_0xe959('0xc')]+_0x3c123a++,'VoiceExtensionId':_0x567e44['VoiceExtensionId']});}}}for(var _0x3a9a44=0x0;_0x3a9a44<_0x51e78e['length'];_0x3a9a44+=0x1){var _0x599132=_0x321be7[_0xe959('0xc')]+_0x51e78e[_0xe959('0x24')];var _0x10aee0=_0x3a9a44===_0x51e78e['length']-0x1?_0x321be7[_0xe959('0xc')]+_0x13250b[_0xe959('0x24')]+_0x42c85d[_0xe959('0x24')]+0x2:_0x321be7['priority']+_0x3a9a44+0x1;_0x13250b[_0xe959('0x39')](_0x3a9a44,0x0,{'type':_0x567e44['type'],'app':_0xe959('0x3a'),'appdata':_0x51e78e[_0x3a9a44]+'?'+_0x567e44[_0xe959('0x14')]+_0xe959('0x3b')+_0x599132+':'+_0x567e44[_0xe959('0x14')]+_0xe959('0x3b')+_0x10aee0,'exten':_0x567e44['exten'],'context':_0x567e44[_0xe959('0x14')],'priority':_0x321be7[_0xe959('0xc')]+_0x3a9a44,'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0]['VoiceExtensionId']});}_0x567e44[_0xe959('0xc')]=_0x13250b[_0xe959('0x24')]?_[_0xe959('0x3c')](_0x13250b)[_0xe959('0xc')]+0x1:_0x321be7[_0xe959('0xc')];_0x321be7[_0xe959('0xc')]=(_0x42c85d[_0xe959('0x24')]?_[_0xe959('0x3c')](_0x42c85d)['priority']:_0x567e44[_0xe959('0xc')])+0x1;_0x321be7[_0xe959('0xf')]=_[_0xe959('0x3d')](_0x321be7[_0xe959('0xf')],_0x13250b,[_0x567e44],_0x42c85d);}_0x321be7[_0xe959('0xf')]['push']({'type':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x16')],'app':_0xe959('0x3e'),'exten':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x7')],'context':_0x90a519[_0xa1a4b1][0x0][_0xe959('0x14')],'priority':_0x321be7[_0xe959('0xc')],'VoiceExtensionId':_0x90a519[_0xa1a4b1][0x0]['VoiceExtensionId']});_0x45118e[_0xe959('0x10')](_0x90a519[_0xa1a4b1][0x0]['VoiceExtensionId']);_0x51a903=_[_0xe959('0x3d')](_0x51a903,_0x321be7['extensions']);}}return _0x4f993a[_0xe959('0x3f')](function(_0x44901c){return _0x4f993a[_0xe959('0x1')]['VoiceExtension'][_0xe959('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x45118e}},'transaction':_0x44901c})[_0xe959('0x4')](function(_0x598658){return _0x4f993a[_0xe959('0x1')][_0xe959('0x41')][_0xe959('0x42')](_['sortBy'](_0x51a903,_0xe959('0xc')),{'transaction':_0x44901c});});});})[_0xe959('0x43')](function(_0x4761b4){console['error'](_0x4761b4);});}exports[_0xe959('0x44')]=rewrite; \ No newline at end of file +var _0x157b=['VoiceExtension','IntervalId','models','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty','priority','extension','find','extensions','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','*,*,*,*','interval','intervals','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','bulkCreate','sortBy','catch','error','rewrite','util','Interval','findAll','then'];(function(_0x2df720,_0x4df7e8){var _0x20993d=function(_0x3f83e8){while(--_0x3f83e8){_0x2df720['push'](_0x2df720['shift']());}};_0x20993d(++_0x4df7e8);}(_0x157b,0x86));var _0xb157=function(_0x48e53c,_0x24baf7){_0x48e53c=_0x48e53c-0x0;var _0xb8dae2=_0x157b[_0x48e53c];return _0xb8dae2;};'use strict';var _=require('lodash');var util=require(_0xb157('0x0'));function rewrite(_0x4328dd,_0x145549){var _0x4b4aa1=this;return _0x4328dd['models'][_0xb157('0x1')][_0xb157('0x2')]({'raw':!![]})[_0xb157('0x3')](function(_0x313ee4){_0x4b4aa1['intervals']=_0x313ee4;return _0x4328dd['models'][_0xb157('0x4')][_0xb157('0x2')]({'where':{'IntervalId':_0x145549[_0xb157('0x5')]},'raw':!![]});})[_0xb157('0x3')](function(_0x29b7f5){return _0x4328dd[_0xb157('0x6')]['VoiceExtension'][_0xb157('0x2')]({'where':{'exten':{'$in':_[_0xb157('0x7')](_[_0xb157('0x8')](_0x29b7f5,_0xb157('0x9')))}},'order':[{'raw':_0xb157('0xa')}],'raw':!![]});})[_0xb157('0x3')](function(_0x4510fb){var _0x32d5ce=_[_0xb157('0xb')](_0x4510fb,{'priority':'1'});var _0x53b046=_[_0xb157('0xb')](_0x4510fb,{'isApp':0x1});var _0xeeed8=_[_0xb157('0xc')](_0x53b046,_0xb157('0x9'));var _0x1077e9=[_0xb157('0xd'),'playback'];var _0x3da786=[];var _0x430707=[];for(var _0x48d1bb in _0xeeed8){if(_0xeeed8[_0xb157('0xe')](_0x48d1bb)){_0x4b4aa1[_0xb157('0xf')]=0x2;_0x4b4aa1['extensions']=[];_0x4b4aa1[_0xb157('0x10')]=_[_0xb157('0x11')](_0x32d5ce,{'exten':_0xeeed8[_0x48d1bb][0x0]['exten']});_0x4b4aa1[_0xb157('0x12')][_0xb157('0x13')]({'type':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x14')],'app':_0xb157('0x15'),'appdata':util[_0xb157('0x16')](_0xb157('0x17'),_0xeeed8[_0x48d1bb][0x0]['type']),'context':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x18')],'exten':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x9')],'priority':_0x4b4aa1[_0xb157('0xf')]++,'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]});if(_0xeeed8[_0x48d1bb][0x0][_0xb157('0x14')]==='inbound'){_0x4b4aa1[_0xb157('0x12')][_0xb157('0x13')]({'type':_0xeeed8[_0x48d1bb][0x0]['type'],'app':'Set','appdata':'CDR(routeid)='+_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')],'context':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x18')],'exten':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x9')],'priority':_0x4b4aa1[_0xb157('0xf')]++,'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]});}else if(_0xeeed8[_0x48d1bb][0x0][_0xb157('0x14')]===_0xb157('0x1a')){if(_0x4b4aa1[_0xb157('0x10')]){_0x4b4aa1[_0xb157('0x12')][_0xb157('0x13')]({'type':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x14')],'app':'Set','appdata':_0xb157('0x1b')+(_0x4b4aa1[_0xb157('0x10')][_0xb157('0x1c')]?_0xb157('0x1d')+_0x4b4aa1['extension'][_0xb157('0x1c')]+'}':_0xb157('0x1e')),'context':_0xeeed8[_0x48d1bb][0x0]['context'],'exten':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x9')],'priority':_0x4b4aa1[_0xb157('0xf')]++,'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]});}_0x4b4aa1[_0xb157('0x12')][_0xb157('0x13')]({'type':_0xeeed8[_0x48d1bb][0x0]['type'],'app':_0xb157('0x15'),'appdata':_0xb157('0x1f')+_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')],'context':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x18')],'exten':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x9')],'priority':_0x4b4aa1[_0xb157('0xf')]++,'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]});var _0x5de1ab=_0x4b4aa1['priority']++;_0x4b4aa1[_0xb157('0x12')][_0xb157('0x13')]({'type':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x14')],'app':_0xb157('0x20'),'appdata':_0xb157('0x21')+(_0x5de1ab+0x2)+_0xb157('0x22')+(_0x5de1ab+0x1)+')','context':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x18')],'exten':_0xeeed8[_0x48d1bb][0x0]['exten'],'priority':_0x5de1ab,'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]});if(_0x4b4aa1[_0xb157('0x10')]){_0x4b4aa1[_0xb157('0x12')][_0xb157('0x13')]({'type':_0xeeed8[_0x48d1bb][0x0]['type'],'app':_0xb157('0x15'),'appdata':_0x4b4aa1['extension'][_0xb157('0x1c')]?_0xb157('0x23')+_0x4b4aa1[_0xb157('0x10')][_0xb157('0x1c')]+'}':'CDR(prefix)=noprefix','context':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x18')],'exten':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x9')],'priority':_0x4b4aa1['priority']++,'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]});}_0x4b4aa1[_0xb157('0x12')][_0xb157('0x13')]({'type':_0xeeed8[_0x48d1bb][0x0]['type'],'app':'Set','appdata':_0xb157('0x24')+_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')],'context':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x18')],'exten':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x9')],'priority':_0x4b4aa1[_0xb157('0xf')]++,'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0]['VoiceExtensionId']});if(_0x4b4aa1['extension']&&_0x4b4aa1[_0xb157('0x10')]['hasOwnProperty']('recordingFormat')&&_0x4b4aa1[_0xb157('0x10')][_0xb157('0x25')]!=='none'){_0x4b4aa1[_0xb157('0x12')][_0xb157('0x13')]({'type':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x14')],'app':_0xb157('0x15'),'appdata':_0xb157('0x26'),'context':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x18')],'exten':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x9')],'priority':_0x4b4aa1[_0xb157('0xf')]++,'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]});_0x4b4aa1[_0xb157('0x12')]['push']({'type':_0xeeed8[_0x48d1bb][0x0]['type'],'app':_0xb157('0x15'),'appdata':_0xb157('0x27')+_0x4b4aa1[_0xb157('0x10')]['recordingFormat']||'wav','context':_0xeeed8[_0x48d1bb][0x0]['context'],'exten':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x9')],'priority':_0x4b4aa1['priority']++,'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]});}}_0x4b4aa1['extensions'][_0xb157('0x13')]({'type':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x14')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x18')],'exten':_0xeeed8[_0x48d1bb][0x0]['exten'],'priority':_0x4b4aa1[_0xb157('0xf')]++,'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]});_0x4b4aa1[_0xb157('0x12')]['push']({'type':_0xeeed8[_0x48d1bb][0x0]['type'],'app':'Set','appdata':_0xb157('0x28'),'context':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x18')],'exten':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x9')],'priority':_0x4b4aa1[_0xb157('0xf')]++,'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]});_0x4b4aa1['extensions']['push']({'type':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x14')],'app':'Set','appdata':_0xb157('0x29'),'context':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x18')],'exten':_0xeeed8[_0x48d1bb][0x0]['exten'],'priority':_0x4b4aa1[_0xb157('0xf')]++,'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]});for(var _0x4fa71f=0x0,_0x5d320a=0x0;_0x4fa71f<_0xeeed8[_0x48d1bb][_0xb157('0x2a')];_0x4fa71f+=0x1,_0x5d320a=0x0){var _0x45abb3=_0xeeed8[_0x48d1bb][_0x4fa71f];if(_0x45abb3['type']){_0x45abb3['type']=_0x45abb3[_0xb157('0x14')]['toLowerCase']();}var _0x464c0b=[];var _0x577374=[];delete _0x45abb3['id'];delete _0x45abb3[_0xb157('0x2b')];delete _0x45abb3['updatedAt'];var _0x359362=_0x45abb3['interval']!==_0xb157('0x2c')?[_0x45abb3[_0xb157('0x2d')]]:_0x45abb3[_0xb157('0x5')]?_[_0xb157('0x8')](_[_0xb157('0xb')](_0x4b4aa1[_0xb157('0x2e')],{'IntervalId':_0x45abb3[_0xb157('0x5')]}),'interval'):[];if(_0x45abb3['hasOwnProperty']('tag')){if(_0x45abb3['tag']&&_0x45abb3['tag']!=='--'){_0x464c0b[_0xb157('0x13')]({'type':_0x45abb3[_0xb157('0x14')],'app':'Set','appdata':_0xb157('0x2f')+_0x45abb3['tag'],'context':_0x45abb3[_0xb157('0x18')],'exten':_0x45abb3[_0xb157('0x9')],'priority':_0x359362[_0xb157('0x2a')]+_0x4b4aa1[_0xb157('0xf')]+_0x5d320a++,'VoiceExtensionId':_0x45abb3[_0xb157('0x19')]});}}if(_0x45abb3['type']===_0xb157('0x1a')&&_0x45abb3['hasOwnProperty'](_0xb157('0x30'))){if(_0x45abb3['callerID']){_0x464c0b[_0xb157('0x13')]({'type':_0x45abb3[_0xb157('0x14')],'app':_0xb157('0x20'),'appdata':_0xb157('0x31')+_0x45abb3['callerID']+')','context':_0x45abb3[_0xb157('0x18')],'exten':_0x45abb3[_0xb157('0x9')],'priority':_0x359362[_0xb157('0x2a')]+_0x4b4aa1[_0xb157('0xf')]+_0x5d320a++,'VoiceExtensionId':_0x45abb3['VoiceExtensionId']});}else{_0x464c0b[_0xb157('0x13')]({'type':_0x45abb3[_0xb157('0x14')],'app':'ExecIf','appdata':_0xb157('0x32'),'context':_0x45abb3[_0xb157('0x18')],'exten':_0x45abb3['exten'],'priority':_0x359362[_0xb157('0x2a')]+_0x4b4aa1[_0xb157('0xf')]+_0x5d320a++,'VoiceExtensionId':_0x45abb3[_0xb157('0x19')]});}}if(_0x45abb3['hasOwnProperty'](_0xb157('0x33'))){if(_0x1077e9[_0xb157('0x34')](_0x45abb3[_0xb157('0x35')][_0xb157('0x36')]())>=0x0&&_0x45abb3[_0xb157('0x37')]!=='custom'){if(_0x45abb3[_0xb157('0x33')]){_0x464c0b[_0xb157('0x13')]({'type':_0x45abb3[_0xb157('0x14')],'app':_0xb157('0x20'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x45abb3['context'],'exten':_0x45abb3[_0xb157('0x9')],'priority':_0x359362[_0xb157('0x2a')]+_0x4b4aa1[_0xb157('0xf')]+_0x5d320a++,'VoiceExtensionId':_0x45abb3[_0xb157('0x19')]});_0x464c0b[_0xb157('0x13')]({'type':_0x45abb3[_0xb157('0x14')],'app':_0xb157('0x15'),'appdata':_0xb157('0x38'),'context':_0x45abb3['context'],'exten':_0x45abb3[_0xb157('0x9')],'priority':_0x359362['length']+_0x4b4aa1[_0xb157('0xf')]+_0x5d320a++,'VoiceExtensionId':_0x45abb3['VoiceExtensionId']});}else{_0x464c0b[_0xb157('0x13')]({'type':_0x45abb3['type'],'app':_0xb157('0x20'),'appdata':_0xb157('0x39'),'context':_0x45abb3['context'],'exten':_0x45abb3['exten'],'priority':_0x359362[_0xb157('0x2a')]+_0x4b4aa1[_0xb157('0xf')]+_0x5d320a++,'VoiceExtensionId':_0x45abb3[_0xb157('0x19')]});_0x464c0b[_0xb157('0x13')]({'type':_0x45abb3[_0xb157('0x14')],'app':_0xb157('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x45abb3['context'],'exten':_0x45abb3[_0xb157('0x9')],'priority':_0x359362[_0xb157('0x2a')]+_0x4b4aa1[_0xb157('0xf')]+_0x5d320a++,'VoiceExtensionId':_0x45abb3[_0xb157('0x19')]});}}}for(var _0x6d45ec=0x0;_0x6d45ec<_0x359362[_0xb157('0x2a')];_0x6d45ec+=0x1){var _0x54ec02=_0x4b4aa1[_0xb157('0xf')]+_0x359362[_0xb157('0x2a')];var _0x218923=_0x6d45ec===_0x359362['length']-0x1?_0x4b4aa1[_0xb157('0xf')]+_0x464c0b[_0xb157('0x2a')]+_0x577374[_0xb157('0x2a')]+0x2:_0x4b4aa1['priority']+_0x6d45ec+0x1;_0x464c0b['splice'](_0x6d45ec,0x0,{'type':_0x45abb3[_0xb157('0x14')],'app':_0xb157('0x3a'),'appdata':_0x359362[_0x6d45ec]+'?'+_0x45abb3[_0xb157('0x18')]+_0xb157('0x3b')+_0x54ec02+':'+_0x45abb3[_0xb157('0x18')]+',${EXTEN},'+_0x218923,'exten':_0x45abb3[_0xb157('0x9')],'context':_0x45abb3[_0xb157('0x18')],'priority':_0x4b4aa1[_0xb157('0xf')]+_0x6d45ec,'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]});}_0x45abb3[_0xb157('0xf')]=_0x464c0b['length']?_[_0xb157('0x3c')](_0x464c0b)[_0xb157('0xf')]+0x1:_0x4b4aa1[_0xb157('0xf')];_0x4b4aa1['priority']=(_0x577374[_0xb157('0x2a')]?_[_0xb157('0x3c')](_0x577374)['priority']:_0x45abb3['priority'])+0x1;_0x4b4aa1[_0xb157('0x12')]=_['concat'](_0x4b4aa1['extensions'],_0x464c0b,[_0x45abb3],_0x577374);}_0x4b4aa1[_0xb157('0x12')][_0xb157('0x13')]({'type':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x14')],'app':_0xb157('0x3d'),'exten':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x9')],'context':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x18')],'priority':_0x4b4aa1[_0xb157('0xf')],'VoiceExtensionId':_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]});_0x3da786[_0xb157('0x13')](_0xeeed8[_0x48d1bb][0x0][_0xb157('0x19')]);_0x430707=_[_0xb157('0x3e')](_0x430707,_0x4b4aa1[_0xb157('0x12')]);}}return _0x4328dd[_0xb157('0x3f')](function(_0x3aee55){return _0x4328dd['models'][_0xb157('0x4')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x3da786}},'transaction':_0x3aee55})[_0xb157('0x3')](function(_0x43b051){return _0x4328dd[_0xb157('0x6')][_0xb157('0x4')][_0xb157('0x40')](_[_0xb157('0x41')](_0x430707,_0xb157('0xf')),{'transaction':_0x3aee55});});});})[_0xb157('0x42')](function(_0x2c4683){console[_0xb157('0x43')](_0x2c4683);});}exports[_0xb157('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 6509798..3b38b7f 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 _0x94b3=['CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','util','lodash','squel','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','undefined','argv','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','join','hasOwnProperty','data','firstName','phone','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','Duplicate\x20Contact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','createdAt','updatedAt','field','ContactId','toString','NOW()','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','\x20=\x20?','into','scheduledAt','select','id\x20IN\x20?','str','cm_hopper_final','fromQuery','cm_hopper_black','phone\x20IS\x20NOT\x20NULL','VoiceQueue','findAll','outbound','dialCheckDuplicateType','sequelize','VoiceQueueId','all','CmList','get','query','Lists','always','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0x94b3,0x1a2));var _0x394b=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x94b3[_0x255d5b];return _0x3e141a;};'use strict';var BPromise=require('bluebird');var util=require(_0x394b('0x0'));var _=require(_0x394b('0x1'));var fs=require('fs');var squel=require(_0x394b('0x2'));var Papa=require('papaparse');var Redis=require(_0x394b('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x394b('0x4'));var logger=require(_0x394b('0x5'))('api');config[_0x394b('0x6')]=_[_0x394b('0x7')](config[_0x394b('0x6')],{'host':_0x394b('0x8'),'port':0x18eb});var socket=require(_0x394b('0x9'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x394b('0xa')||process[_0x394b('0xb')][0x2]===_0x394b('0xc')){throw new Error(_0x394b('0xd'));}var FILEPATH=process[_0x394b('0xb')][0x2];if(!process[_0x394b('0xb')][0x3]||process['argv'][0x3]==='undefined'||process['argv'][0x3]===_0x394b('0xc')||!process['argv'][0x4]||process[_0x394b('0xb')][0x4]==='undefined'||process['argv'][0x4]===_0x394b('0xc')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x394b('0xe')](process[_0x394b('0xb')][0x3][_0x394b('0xf')](','),process[_0x394b('0xb')][0x4][_0x394b('0xf')](','));if(!process[_0x394b('0xb')][0x5]||process[_0x394b('0xb')][0x5]===_0x394b('0xa')||process[_0x394b('0xb')][0x5]==='null'){throw new Error(_0x394b('0x10'));}var LISTID=process[_0x394b('0xb')][0x5];var COMPANYID=process[_0x394b('0xb')][0x6]&&process[_0x394b('0xb')][0x6]!==_0x394b('0xa')&&process[_0x394b('0xb')][0x6]!==_0x394b('0xc')?process[_0x394b('0xb')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x394b('0xb')][0x7]!==_0x394b('0xa')&&process[_0x394b('0xb')][0x7]!==_0x394b('0xc')?process[_0x394b('0xb')][0x7]:null;if(!process[_0x394b('0xb')][0x8]||process[_0x394b('0xb')][0x8]===_0x394b('0xa')||process['argv'][0x8]===_0x394b('0xc')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x394b('0xb')][0x8];}catch(_0x3700a0){logger['error'](_0x3700a0);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(_0x2ecf85,_0x3b20c6,_0x39f0d1,_0x3c71fb){var _0x3d8576={'message':_0x3b20c6};_0x3d8576[_0x2ecf85]=!![];if(_0x39f0d1){_0x3d8576[_0x394b('0x11')]=_0x39f0d1;}if(_0x3c71fb){_0x3d8576[_0x394b('0x12')]=_0x3c71fb;}return _0x3d8576;}function isEmail(_0x1140da){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))*$/[_0x394b('0x13')](_0x1140da);}function checkRow(_0x10e7a4,_0x205a9f,_0x2619b7){return new BPromise(function(_0x3a6ba8,_0x21c590){if(_[_0x394b('0x14')](_0x10e7a4)){return _0x21c590(handleCheckRowError(_0x394b('0x15'),_0x394b('0x16'),null,_0x2619b7));}if(_0x10e7a4[_0x394b('0x17')]&&_0x10e7a4[_0x394b('0x17')]['length']){var _0x5c574c=_['map'](_0x10e7a4['errors'],'message')[_0x394b('0x18')](';');return _0x21c590(handleCheckRowError('error',_0x5c574c,null,_0x2619b7));}var _0x56c138={};for(var _0x4902c9 in FIELDS){if(FIELDS[_0x394b('0x19')](_0x4902c9)&&FIELDS[_0x4902c9]){_0x56c138[_0x4902c9]=_0x10e7a4[_0x394b('0x1a')][0x0][FIELDS[_0x4902c9]]||_0x10e7a4[_0x394b('0x1a')][0x0]['\ufeff'+FIELDS[_0x4902c9]];}}if(!_0x56c138[_0x394b('0x1b')]){return _0x21c590(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x2619b7));}if(!_0x56c138[_0x394b('0x1c')]){return _0x21c590(handleCheckRowError(_0x394b('0x15'),'phone\x20not\x20specified!',null,_0x2619b7));}if(_0x56c138[_0x394b('0x1d')]){var _0x104bb9=moment(_0x56c138[_0x394b('0x1d')],_0x394b('0x1e'));if(!_0x104bb9['isValid']()){return _0x21c590(handleCheckRowError('error',_0x394b('0x1f'),null,_0x2619b7));}}if(_0x56c138[_0x394b('0x20')]){if(!isEmail(_0x56c138[_0x394b('0x20')])){return _0x21c590(handleCheckRowError(_0x394b('0x15'),_0x394b('0x21'),null,_0x2619b7));}}_0x56c138[_0x394b('0x22')]=LISTID;_0x56c138[_0x394b('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x394b('0x24')]&&_0x205a9f){var _0x3d87b3={};for(var _0xc43396=0x0,_0x51307c=DUPLICATES[_0x394b('0x24')];_0xc43396<_0x51307c;_0xc43396+=0x1){_0x3d87b3[DUPLICATES[_0xc43396]]=_0x56c138[DUPLICATES[_0xc43396]];}var _0x30b290=_['find'](_0x205a9f,_0x3d87b3);if(_0x30b290){return _0x21c590(handleCheckRowError('duplicate',_0x394b('0x25'),_0x30b290,_0x2619b7));}}return db['CmContact'][_0x394b('0x26')](_0x56c138,{'raw':!![],'hooks':![],'fields':_[_0x394b('0x27')](_0x56c138)})[_0x394b('0x28')](function(_0x2c21eb){if(DUPLICATES&&DUPLICATES[_0x394b('0x24')]&&_0x205a9f){_0x205a9f[_0x394b('0x29')](_[_0x394b('0x2a')](_0x56c138,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2c21eb['id'];return _0x3a6ba8();})[_0x394b('0x2b')](function(_0x17fcd6){return _0x21c590(handleCheckRowError(_0x394b('0x15'),_0x394b('0x2c')+(_0x17fcd6['message']||JSON[_0x394b('0x2d')](_0x17fcd6)),null,_0x2619b7));});});}function checkHopper(){function _0xea0da7(){return function(_0x1bca53){logger[_0x394b('0x15')]('cmContact',_0x394b('0x2e'),util[_0x394b('0x2f')](_0x1bca53,{'showHidden':![],'depth':null}));};}var _0x1974cf=function(_0x13bc85,_0x5ec901){var _0x57bc68=squel[_0x394b('0x30')]()['into']('cm_hopper')['fromQuery'](['phone','scheduledAt','ContactId',_0x394b('0x22'),_0x5ec901,_0x394b('0x31'),_0x394b('0x32')],squel['select']()[_0x394b('0x33')](_0x394b('0x1c'),_0x394b('0x1c'))[_0x394b('0x33')]('NOW()','scheduledAt')[_0x394b('0x33')]('id',_0x394b('0x34'))[_0x394b('0x33')](LISTID[_0x394b('0x35')](),'ListId')[_0x394b('0x33')](_0x13bc85['id']['toString'](),_0x5ec901)[_0x394b('0x33')](_0x394b('0x36'),'createdAt')[_0x394b('0x33')](_0x394b('0x36'),_0x394b('0x32'))['from'](_0x394b('0x37'))[_0x394b('0x38')](_0x394b('0x39'))[_0x394b('0x38')](_0x394b('0x3a'),LISTID['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x394b('0x38')](_0x394b('0x3b'),squel['select']()[_0x394b('0x33')](_0x394b('0x1c'))[_0x394b('0x3c')](_0x394b('0x3d'))[_0x394b('0x38')](_0x5ec901+_0x394b('0x3e'),_0x13bc85['id'][_0x394b('0x35')]())))[_0x394b('0x35')]();return _0x57bc68;};var _0xbf72c9=function(_0x125725,_0xe20b78){var _0x48ec6c=squel['insert']()[_0x394b('0x3f')]('cm_hopper')['fromQuery']([_0x394b('0x1c'),_0x394b('0x40'),'ContactId',_0x394b('0x22'),_0xe20b78,_0x394b('0x31'),_0x394b('0x32')],squel[_0x394b('0x41')]()['field'](_0x394b('0x1c'),_0x394b('0x1c'))[_0x394b('0x33')]('NOW()',_0x394b('0x40'))['field']('id',_0x394b('0x34'))[_0x394b('0x33')](LISTID[_0x394b('0x35')](),_0x394b('0x22'))[_0x394b('0x33')](_0x125725['id'][_0x394b('0x35')](),_0xe20b78)['field']('NOW()',_0x394b('0x31'))[_0x394b('0x33')](_0x394b('0x36'),_0x394b('0x32'))[_0x394b('0x3c')](_0x394b('0x37'))[_0x394b('0x38')]('deletedAt\x20IS\x20NULL')[_0x394b('0x38')]('ListId\x20=\x20?',LISTID[_0x394b('0x35')]())[_0x394b('0x38')](_0x394b('0x42'),squel[_0x394b('0x43')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0x394b('0x38')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x394b('0x33')]('calleridnum')[_0x394b('0x3c')](_0x394b('0x44'))[_0x394b('0x38')](_0xe20b78+_0x394b('0x3e'),_0x125725['id'][_0x394b('0x35')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x394b('0x41')]()[_0x394b('0x33')](_0x394b('0x1c'))[_0x394b('0x3c')](_0x394b('0x3d'))[_0x394b('0x38')](_0xe20b78+'\x20=\x20?',_0x125725['id']['toString']())))[_0x394b('0x35')]();return _0x48ec6c;};function _0x21f76e(_0x21f736,_0x338b0b){var _0x52a20b=squel[_0x394b('0x30')]()[_0x394b('0x3f')]('cm_hopper')[_0x394b('0x45')]([_0x394b('0x1c'),_0x394b('0x40'),_0x394b('0x34'),'ListId',_0x338b0b,'createdAt',_0x394b('0x32')],squel['select']()[_0x394b('0x33')](_0x394b('0x1c'),_0x394b('0x1c'))[_0x394b('0x33')](_0x394b('0x36'),_0x394b('0x40'))['field']('id','ContactId')['field'](LISTID['toString'](),'ListId')[_0x394b('0x33')](_0x21f736['id'][_0x394b('0x35')](),_0x338b0b)['field'](_0x394b('0x36'),_0x394b('0x31'))[_0x394b('0x33')]('NOW()',_0x394b('0x32'))['from'](_0x394b('0x37'))[_0x394b('0x38')](_0x394b('0x39'))['where'](_0x394b('0x3a'),LISTID[_0x394b('0x35')]())[_0x394b('0x38')](_0x394b('0x42'),squel[_0x394b('0x43')](hopperContacts))[_0x394b('0x38')]('phone\x20IS\x20NOT\x20NULL'))[_0x394b('0x35')]();return _0x52a20b;}function _0x3c3723(_0x9268f5,_0x1fdb48){var _0x5966c0=squel[_0x394b('0x30')]()[_0x394b('0x3f')](_0x394b('0x46'))['fromQuery'](['phone',_0x394b('0x34'),_0x394b('0x22'),_0x1fdb48,_0x394b('0x31'),'updatedAt'],squel[_0x394b('0x41')]()[_0x394b('0x33')](_0x394b('0x1c'),_0x394b('0x1c'))['field']('id',_0x394b('0x34'))['field'](LISTID[_0x394b('0x35')](),_0x394b('0x22'))['field'](_0x9268f5['id']['toString'](),_0x1fdb48)[_0x394b('0x33')](_0x394b('0x36'),_0x394b('0x31'))['field'](_0x394b('0x36'),_0x394b('0x32'))[_0x394b('0x3c')](_0x394b('0x37'))[_0x394b('0x38')](_0x394b('0x39'))['where'](_0x394b('0x3a'),LISTID[_0x394b('0x35')]())['where'](_0x394b('0x42'),squel[_0x394b('0x43')](hopperContacts))[_0x394b('0x38')](_0x394b('0x47')))['toString']();return _0x5966c0;}return db[_0x394b('0x48')][_0x394b('0x49')]({'where':{'type':_0x394b('0x4a')},'attributes':['id',_0x394b('0x4b')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x730bdf){var _0x69399a=[];if(_0x730bdf){var _0x6c5b5e;for(var _0x453f45=0x0,_0x334ccf;_0x453f45<_0x730bdf[_0x394b('0x24')];_0x453f45+=0x1){_0x334ccf=_0x730bdf[_0x453f45]['get']({'plain':!![]});switch(_0x334ccf[_0x394b('0x4b')]){case'always':_0x69399a[_0x394b('0x29')](db[_0x394b('0x4c')]['query'](_0xbf72c9(_0x334ccf,_0x394b('0x4d')))['then'](function(){})[_0x394b('0x2b')](_0xea0da7()));break;case'onlyIfOpen':_0x69399a[_0x394b('0x29')](db[_0x394b('0x4c')]['query'](_0x1974cf(_0x334ccf,_0x394b('0x4d')))[_0x394b('0x28')](function(){})[_0x394b('0x2b')](_0xea0da7()));break;default:_0x69399a[_0x394b('0x29')](db[_0x394b('0x4c')]['query'](_0x21f76e(_0x334ccf,_0x394b('0x4d')))['then'](function(){})[_0x394b('0x2b')](_0xea0da7()));}}}return _0x69399a;})[_0x394b('0x4e')]()['then'](function(){return db['VoiceQueue'][_0x394b('0x49')]({'where':{'type':_0x394b('0x4a')},'attributes':['id'],'include':[{'model':db[_0x394b('0x4f')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x394b('0x28')](function(_0x314a46){var _0x51c5d8=[];if(_0x314a46){var _0x4bdac1;for(var _0x4cd50d=0x0,_0x2aa1d9;_0x4cd50d<_0x314a46[_0x394b('0x24')];_0x4cd50d+=0x1){_0x2aa1d9=_0x314a46[_0x4cd50d][_0x394b('0x50')]({'plain':!![]});_0x51c5d8[_0x394b('0x29')](db[_0x394b('0x4c')][_0x394b('0x51')](_0x3c3723(_0x2aa1d9,'VoiceQueueId'))['then'](function(){})[_0x394b('0x2b')](_0xea0da7()));}}return _0x51c5d8;})['all']();})[_0x394b('0x28')](function(){return db['Campaign'][_0x394b('0x49')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x394b('0x52'),'where':{'id':LISTID}}]})[_0x394b('0x28')](function(_0x51586c){var _0x244300=[];if(_0x51586c){for(var _0x419fbb=0x0,_0x19af25;_0x419fbb<_0x51586c[_0x394b('0x24')];_0x419fbb+=0x1){_0x19af25=_0x51586c[_0x419fbb][_0x394b('0x50')]({'plain':!![]});switch(_0x19af25[_0x394b('0x4b')]){case _0x394b('0x53'):_0x244300[_0x394b('0x29')](db['sequelize']['query'](_0xbf72c9(_0x19af25,_0x394b('0x54')))[_0x394b('0x28')](function(){})[_0x394b('0x2b')](_0xea0da7()));break;case _0x394b('0x55'):_0x244300[_0x394b('0x29')](db[_0x394b('0x4c')][_0x394b('0x51')](_0x1974cf(_0x19af25,_0x394b('0x54')))[_0x394b('0x28')](function(){})[_0x394b('0x2b')](_0xea0da7()));break;default:_0x244300['push'](db['sequelize']['query'](_0x21f76e(_0x19af25,_0x394b('0x54')))[_0x394b('0x28')](function(){})['catch'](_0xea0da7()));}}}return _0x244300;})[_0x394b('0x4e')]();})[_0x394b('0x28')](function(){return db['Campaign'][_0x394b('0x49')]({'attributes':['id'],'include':[{'model':db[_0x394b('0x4f')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x394b('0x28')](function(_0xc61a80){var _0x28eae0=[];if(_0xc61a80){for(var _0x319f90=0x0,_0x5738f0;_0x319f90<_0xc61a80[_0x394b('0x24')];_0x319f90+=0x1){_0x5738f0=_0xc61a80[_0x319f90][_0x394b('0x50')]({'plain':!![]});_0x28eae0[_0x394b('0x29')](db[_0x394b('0x4c')][_0x394b('0x51')](_0x3c3723(_0x5738f0,_0x394b('0x54')))[_0x394b('0x28')](function(){})[_0x394b('0x2b')](_0xea0da7()));}}return _0x28eae0;})['all']();})[_0x394b('0x2b')](function(_0x226607){logger[_0x394b('0x15')](_0x394b('0x56'),_0x394b('0x57'),_0x226607['message']);});}var processPromises=function(_0x465c7e){return BPromise[_0x394b('0x4e')](promises)[_0x394b('0x28')](function(_0x1388ee){})[_0x394b('0x2b')](function(_0x3a97a0){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x394b('0x2d')](_0x3a97a0));})[_0x394b('0x58')](function(){socket[_0x394b('0x59')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x465c7e){return _0x465c7e[_0x394b('0x5a')]();}});};var endCsv=function(){return BPromise[_0x394b('0x5b')]()[_0x394b('0x28')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x394b('0x59')](_0x394b('0x5c')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x394b('0x5d')](FILEPATH);}catch(_0x1d3990){logger['error'](_0x394b('0x5e'),JSON[_0x394b('0x2d')](_0x1d3990));}finally{process['exit'](0x0);}});};process['on'](_0x394b('0x5f'),function(){logger[_0x394b('0x60')](_0x394b('0x61'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x394b('0x28')](function(_0x19364a){var _0xb0239b=fs[_0x394b('0x62')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x394b('0x63')](_0xb0239b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2ea9b9,_0x2d2b75){total+=0x1;var _0x2c94a6=total;promises[_0x394b('0x29')](checkRow(_0x2ea9b9,_0x19364a,_0x2c94a6)[_0x394b('0x28')](function(){success+=0x1;})[_0x394b('0x2b')](function(_0x613661){if(_0x613661[_0x394b('0x15')]){errors+=0x1;delete _0x613661[_0x394b('0x15')];}else if(_0x613661[_0x394b('0x64')]){duplicates+=0x1;delete _0x613661[_0x394b('0x64')];}rows[_0x394b('0x29')](_0x613661);}));if(total%0xc8===0x0){_0x2d2b75[_0x394b('0x65')]();return processPromises(_0x2d2b75);}},'complete':function(){return processPromises()[_0x394b('0x28')](function(){logger['info'](_0x394b('0x66'));endCsv();});},'error':function(_0x2f556f,_0x54796d){logger[_0x394b('0x60')](_0x394b('0x67'),JSON[_0x394b('0x2d')](_0x2f556f));endCsv();}});})[_0x394b('0x2b')](function(_0x426a24){logger[_0x394b('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x426a24));});}main(); \ No newline at end of file +var _0xc1f8=['then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','cm_hopper','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','fromQuery','id\x20IN\x20?','str','cm_hopper_final','insert','VoiceQueue','findAll','dialCheckDuplicateType','Lists','get','always','push','sequelize','VoiceQueueId','onlyIfOpen','query','all','outbound','CmList','BlackLists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','null','undefined','zipObject','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','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','Duplicate\x20Contact','CmContact','keys'];(function(_0x13639d,_0x3c996b){var _0x52ef14=function(_0x3faf51){while(--_0x3faf51){_0x13639d['push'](_0x13639d['shift']());}};_0x52ef14(++_0x3c996b);}(_0xc1f8,0x10d));var _0x8c1f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc1f8[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x8c1f('0x0'));var util=require(_0x8c1f('0x1'));var _=require(_0x8c1f('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x8c1f('0x3'));var Redis=require(_0x8c1f('0x4'));var db=require(_0x8c1f('0x5'))['db'];var config=require(_0x8c1f('0x6'));var logger=require(_0x8c1f('0x7'))('api');config[_0x8c1f('0x8')]=_['defaults'](config[_0x8c1f('0x8')],{'host':_0x8c1f('0x9'),'port':0x18eb});var socket=require(_0x8c1f('0xa'))(new Redis(config[_0x8c1f('0x8')]));require(_0x8c1f('0xb'))['register'](socket);try{if(!process[_0x8c1f('0xc')][0x2]||process[_0x8c1f('0xc')][0x2]==='undefined'||process[_0x8c1f('0xc')][0x2]===_0x8c1f('0xd')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x8c1f('0xc')][0x3]||process[_0x8c1f('0xc')][0x3]===_0x8c1f('0xe')||process[_0x8c1f('0xc')][0x3]===_0x8c1f('0xd')||!process['argv'][0x4]||process['argv'][0x4]===_0x8c1f('0xe')||process['argv'][0x4]===_0x8c1f('0xd')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x8c1f('0xf')](process[_0x8c1f('0xc')][0x3]['split'](','),process[_0x8c1f('0xc')][0x4][_0x8c1f('0x10')](','));if(!process[_0x8c1f('0xc')][0x5]||process['argv'][0x5]===_0x8c1f('0xe')||process['argv'][0x5]===_0x8c1f('0xd')){throw new Error(_0x8c1f('0x11'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x8c1f('0xc')][0x6]&&process[_0x8c1f('0xc')][0x6]!=='undefined'&&process[_0x8c1f('0xc')][0x6]!==_0x8c1f('0xd')?process[_0x8c1f('0xc')][0x6]:null;var DUPLICATES=process[_0x8c1f('0xc')][0x7]&&process[_0x8c1f('0xc')][0x7]!==_0x8c1f('0xe')&&process['argv'][0x7]!=='null'?process[_0x8c1f('0xc')][0x7]:null;if(!process[_0x8c1f('0xc')][0x8]||process[_0x8c1f('0xc')][0x8]===_0x8c1f('0xe')||process[_0x8c1f('0xc')][0x8]===_0x8c1f('0xd')){throw new Error(_0x8c1f('0x12'));}var SOCKET_TIMESTAMP=process[_0x8c1f('0xc')][0x8];}catch(_0x3f7b0c){logger['error'](_0x3f7b0c);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(_0x21e150,_0xd392e7,_0xb72d70,_0x5ad585){var _0x219139={'message':_0xd392e7};_0x219139[_0x21e150]=!![];if(_0xb72d70){_0x219139[_0x8c1f('0x13')]=_0xb72d70;}if(_0x5ad585){_0x219139[_0x8c1f('0x14')]=_0x5ad585;}return _0x219139;}function isEmail(_0x11d298){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))*$/[_0x8c1f('0x15')](_0x11d298);}function checkRow(_0x878b2c,_0x58be6b,_0x229574){return new BPromise(function(_0x660d42,_0x1274b9){if(_[_0x8c1f('0x16')](_0x878b2c)){return _0x1274b9(handleCheckRowError(_0x8c1f('0x17'),_0x8c1f('0x18'),null,_0x229574));}if(_0x878b2c[_0x8c1f('0x19')]&&_0x878b2c[_0x8c1f('0x19')][_0x8c1f('0x1a')]){var _0xde262f=_['map'](_0x878b2c[_0x8c1f('0x19')],_0x8c1f('0x1b'))[_0x8c1f('0x1c')](';');return _0x1274b9(handleCheckRowError(_0x8c1f('0x17'),_0xde262f,null,_0x229574));}var _0x185620={};for(var _0x738713 in FIELDS){if(FIELDS[_0x8c1f('0x1d')](_0x738713)&&FIELDS[_0x738713]){_0x185620[_0x738713]=_0x878b2c[_0x8c1f('0x1e')][0x0][FIELDS[_0x738713]]||_0x878b2c[_0x8c1f('0x1e')][0x0]['\ufeff'+FIELDS[_0x738713]];}}if(!_0x185620[_0x8c1f('0x1f')]){return _0x1274b9(handleCheckRowError('error',_0x8c1f('0x20'),null,_0x229574));}if(!_0x185620[_0x8c1f('0x21')]){return _0x1274b9(handleCheckRowError(_0x8c1f('0x17'),_0x8c1f('0x22'),null,_0x229574));}if(_0x185620[_0x8c1f('0x23')]){var _0x3f2b57=moment(_0x185620[_0x8c1f('0x23')],_0x8c1f('0x24'));if(!_0x3f2b57['isValid']()){return _0x1274b9(handleCheckRowError(_0x8c1f('0x17'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x229574));}}if(_0x185620['email']){if(!isEmail(_0x185620['email'])){return _0x1274b9(handleCheckRowError(_0x8c1f('0x17'),_0x8c1f('0x25'),null,_0x229574));}}_0x185620[_0x8c1f('0x26')]=LISTID;_0x185620[_0x8c1f('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x8c1f('0x1a')]&&_0x58be6b){var _0x384b1a={};for(var _0x2cce42=0x0,_0x1baff7=DUPLICATES[_0x8c1f('0x1a')];_0x2cce42<_0x1baff7;_0x2cce42+=0x1){_0x384b1a[DUPLICATES[_0x2cce42]]=_0x185620[DUPLICATES[_0x2cce42]];}var _0x1c90b4=_['find'](_0x58be6b,_0x384b1a);if(_0x1c90b4){return _0x1274b9(handleCheckRowError('duplicate',_0x8c1f('0x28'),_0x1c90b4,_0x229574));}}return db[_0x8c1f('0x29')]['create'](_0x185620,{'raw':!![],'hooks':![],'fields':_[_0x8c1f('0x2a')](_0x185620)})[_0x8c1f('0x2b')](function(_0x2eeba6){if(DUPLICATES&&DUPLICATES[_0x8c1f('0x1a')]&&_0x58be6b){_0x58be6b['push'](_[_0x8c1f('0x2c')](_0x185620,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2eeba6['id'];return _0x660d42();})[_0x8c1f('0x2d')](function(_0x1580d2){return _0x1274b9(handleCheckRowError(_0x8c1f('0x17'),_0x8c1f('0x2e')+(_0x1580d2[_0x8c1f('0x1b')]||JSON[_0x8c1f('0x2f')](_0x1580d2)),null,_0x229574));});});}function checkHopper(){function _0x41eb13(){return function(_0x2f61f4){logger[_0x8c1f('0x17')](_0x8c1f('0x30'),'checkHopper',util['inspect'](_0x2f61f4,{'showHidden':![],'depth':null}));};}var _0x386da6=function(_0x1e420a,_0x5b23d2){var _0x40a25c=squel['insert']()['into'](_0x8c1f('0x31'))['fromQuery']([_0x8c1f('0x21'),_0x8c1f('0x32'),_0x8c1f('0x33'),_0x8c1f('0x26'),_0x5b23d2,_0x8c1f('0x34'),_0x8c1f('0x35')],squel[_0x8c1f('0x36')]()[_0x8c1f('0x37')]('phone',_0x8c1f('0x21'))[_0x8c1f('0x37')](_0x8c1f('0x38'),'scheduledAt')[_0x8c1f('0x37')]('id',_0x8c1f('0x33'))['field'](LISTID[_0x8c1f('0x39')](),_0x8c1f('0x26'))[_0x8c1f('0x37')](_0x1e420a['id'][_0x8c1f('0x39')](),_0x5b23d2)[_0x8c1f('0x37')](_0x8c1f('0x38'),_0x8c1f('0x34'))[_0x8c1f('0x37')](_0x8c1f('0x38'),'updatedAt')[_0x8c1f('0x3a')](_0x8c1f('0x3b'))['where'](_0x8c1f('0x3c'))[_0x8c1f('0x3d')](_0x8c1f('0x3e'),LISTID['toString']())[_0x8c1f('0x3d')](_0x8c1f('0x3f'))[_0x8c1f('0x3d')](_0x8c1f('0x40'),squel[_0x8c1f('0x36')]()[_0x8c1f('0x37')](_0x8c1f('0x21'))[_0x8c1f('0x3a')](_0x8c1f('0x31'))[_0x8c1f('0x3d')](_0x5b23d2+_0x8c1f('0x41'),_0x1e420a['id']['toString']())))[_0x8c1f('0x39')]();return _0x40a25c;};var _0x5f1f2d=function(_0x3e7ded,_0x36475b){var _0x1af5e8=squel['insert']()[_0x8c1f('0x42')]('cm_hopper')[_0x8c1f('0x43')](['phone',_0x8c1f('0x32'),'ContactId',_0x8c1f('0x26'),_0x36475b,_0x8c1f('0x34'),_0x8c1f('0x35')],squel[_0x8c1f('0x36')]()[_0x8c1f('0x37')](_0x8c1f('0x21'),_0x8c1f('0x21'))[_0x8c1f('0x37')](_0x8c1f('0x38'),_0x8c1f('0x32'))[_0x8c1f('0x37')]('id','ContactId')[_0x8c1f('0x37')](LISTID[_0x8c1f('0x39')](),'ListId')['field'](_0x3e7ded['id'][_0x8c1f('0x39')](),_0x36475b)[_0x8c1f('0x37')](_0x8c1f('0x38'),_0x8c1f('0x34'))[_0x8c1f('0x37')](_0x8c1f('0x38'),_0x8c1f('0x35'))[_0x8c1f('0x3a')](_0x8c1f('0x3b'))[_0x8c1f('0x3d')](_0x8c1f('0x3c'))[_0x8c1f('0x3d')]('ListId\x20=\x20?',LISTID[_0x8c1f('0x39')]())[_0x8c1f('0x3d')](_0x8c1f('0x44'),squel[_0x8c1f('0x45')](hopperContacts))[_0x8c1f('0x3d')](_0x8c1f('0x3f'))[_0x8c1f('0x3d')](_0x8c1f('0x40'),squel[_0x8c1f('0x36')]()[_0x8c1f('0x37')]('calleridnum')[_0x8c1f('0x3a')](_0x8c1f('0x46'))['where'](_0x36475b+_0x8c1f('0x41'),_0x3e7ded['id'][_0x8c1f('0x39')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x8c1f('0x37')](_0x8c1f('0x21'))[_0x8c1f('0x3a')](_0x8c1f('0x31'))['where'](_0x36475b+_0x8c1f('0x41'),_0x3e7ded['id'][_0x8c1f('0x39')]())))['toString']();return _0x1af5e8;};function _0x2c145c(_0xef921f,_0x3384ad){var _0x12c162=squel[_0x8c1f('0x47')]()[_0x8c1f('0x42')](_0x8c1f('0x31'))[_0x8c1f('0x43')]([_0x8c1f('0x21'),_0x8c1f('0x32'),_0x8c1f('0x33'),_0x8c1f('0x26'),_0x3384ad,'createdAt','updatedAt'],squel[_0x8c1f('0x36')]()['field']('phone','phone')['field']('NOW()',_0x8c1f('0x32'))[_0x8c1f('0x37')]('id','ContactId')['field'](LISTID[_0x8c1f('0x39')](),_0x8c1f('0x26'))[_0x8c1f('0x37')](_0xef921f['id'][_0x8c1f('0x39')](),_0x3384ad)[_0x8c1f('0x37')](_0x8c1f('0x38'),_0x8c1f('0x34'))[_0x8c1f('0x37')](_0x8c1f('0x38'),_0x8c1f('0x35'))[_0x8c1f('0x3a')](_0x8c1f('0x3b'))[_0x8c1f('0x3d')](_0x8c1f('0x3c'))[_0x8c1f('0x3d')](_0x8c1f('0x3e'),LISTID[_0x8c1f('0x39')]())[_0x8c1f('0x3d')](_0x8c1f('0x44'),squel[_0x8c1f('0x45')](hopperContacts))[_0x8c1f('0x3d')](_0x8c1f('0x3f')))[_0x8c1f('0x39')]();return _0x12c162;}function _0x4fd82b(_0x471ad7,_0x1b9276){var _0x2ae03b=squel[_0x8c1f('0x47')]()[_0x8c1f('0x42')]('cm_hopper_black')[_0x8c1f('0x43')]([_0x8c1f('0x21'),_0x8c1f('0x33'),_0x8c1f('0x26'),_0x1b9276,'createdAt',_0x8c1f('0x35')],squel['select']()[_0x8c1f('0x37')]('phone',_0x8c1f('0x21'))[_0x8c1f('0x37')]('id',_0x8c1f('0x33'))[_0x8c1f('0x37')](LISTID['toString'](),'ListId')['field'](_0x471ad7['id'][_0x8c1f('0x39')](),_0x1b9276)['field'](_0x8c1f('0x38'),'createdAt')[_0x8c1f('0x37')](_0x8c1f('0x38'),_0x8c1f('0x35'))['from'](_0x8c1f('0x3b'))[_0x8c1f('0x3d')]('deletedAt\x20IS\x20NULL')[_0x8c1f('0x3d')]('ListId\x20=\x20?',LISTID[_0x8c1f('0x39')]())[_0x8c1f('0x3d')](_0x8c1f('0x44'),squel[_0x8c1f('0x45')](hopperContacts))['where'](_0x8c1f('0x3f')))[_0x8c1f('0x39')]();return _0x2ae03b;}return db[_0x8c1f('0x48')][_0x8c1f('0x49')]({'where':{'type':'outbound'},'attributes':['id',_0x8c1f('0x4a')],'include':[{'model':db['CmList'],'as':_0x8c1f('0x4b'),'where':{'id':LISTID}}]})[_0x8c1f('0x2b')](function(_0x282f0a){var _0x13fcc7=[];if(_0x282f0a){var _0x8bec65;for(var _0x10b411=0x0,_0x3e25d7;_0x10b411<_0x282f0a[_0x8c1f('0x1a')];_0x10b411+=0x1){_0x3e25d7=_0x282f0a[_0x10b411][_0x8c1f('0x4c')]({'plain':!![]});switch(_0x3e25d7[_0x8c1f('0x4a')]){case _0x8c1f('0x4d'):_0x13fcc7[_0x8c1f('0x4e')](db[_0x8c1f('0x4f')]['query'](_0x5f1f2d(_0x3e25d7,_0x8c1f('0x50')))[_0x8c1f('0x2b')](function(){})[_0x8c1f('0x2d')](_0x41eb13()));break;case _0x8c1f('0x51'):_0x13fcc7[_0x8c1f('0x4e')](db[_0x8c1f('0x4f')][_0x8c1f('0x52')](_0x386da6(_0x3e25d7,_0x8c1f('0x50')))['then'](function(){})[_0x8c1f('0x2d')](_0x41eb13()));break;default:_0x13fcc7[_0x8c1f('0x4e')](db['sequelize'][_0x8c1f('0x52')](_0x2c145c(_0x3e25d7,_0x8c1f('0x50')))[_0x8c1f('0x2b')](function(){})[_0x8c1f('0x2d')](_0x41eb13()));}}}return _0x13fcc7;})[_0x8c1f('0x53')]()[_0x8c1f('0x2b')](function(){return db[_0x8c1f('0x48')]['findAll']({'where':{'type':_0x8c1f('0x54')},'attributes':['id'],'include':[{'model':db[_0x8c1f('0x55')],'as':_0x8c1f('0x56'),'where':{'id':LISTID}}]})[_0x8c1f('0x2b')](function(_0x16cd35){var _0x2b9a66=[];if(_0x16cd35){var _0x355aa2;for(var _0x95ed53=0x0,_0x93b8eb;_0x95ed53<_0x16cd35[_0x8c1f('0x1a')];_0x95ed53+=0x1){_0x93b8eb=_0x16cd35[_0x95ed53][_0x8c1f('0x4c')]({'plain':!![]});_0x2b9a66[_0x8c1f('0x4e')](db[_0x8c1f('0x4f')]['query'](_0x4fd82b(_0x93b8eb,_0x8c1f('0x50')))[_0x8c1f('0x2b')](function(){})['catch'](_0x41eb13()));}}return _0x2b9a66;})['all']();})['then'](function(){return db['Campaign'][_0x8c1f('0x49')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x8c1f('0x55')],'as':'Lists','where':{'id':LISTID}}]})[_0x8c1f('0x2b')](function(_0x355752){var _0x3eee55=[];if(_0x355752){for(var _0x4e3d2e=0x0,_0xd263d4;_0x4e3d2e<_0x355752['length'];_0x4e3d2e+=0x1){_0xd263d4=_0x355752[_0x4e3d2e][_0x8c1f('0x4c')]({'plain':!![]});switch(_0xd263d4['dialCheckDuplicateType']){case'always':_0x3eee55[_0x8c1f('0x4e')](db[_0x8c1f('0x4f')][_0x8c1f('0x52')](_0x5f1f2d(_0xd263d4,_0x8c1f('0x57')))[_0x8c1f('0x2b')](function(){})[_0x8c1f('0x2d')](_0x41eb13()));break;case'onlyIfOpen':_0x3eee55[_0x8c1f('0x4e')](db[_0x8c1f('0x4f')][_0x8c1f('0x52')](_0x386da6(_0xd263d4,_0x8c1f('0x57')))[_0x8c1f('0x2b')](function(){})[_0x8c1f('0x2d')](_0x41eb13()));break;default:_0x3eee55[_0x8c1f('0x4e')](db['sequelize']['query'](_0x2c145c(_0xd263d4,_0x8c1f('0x57')))[_0x8c1f('0x2b')](function(){})[_0x8c1f('0x2d')](_0x41eb13()));}}}return _0x3eee55;})['all']();})[_0x8c1f('0x2b')](function(){return db[_0x8c1f('0x58')][_0x8c1f('0x49')]({'attributes':['id'],'include':[{'model':db[_0x8c1f('0x55')],'as':_0x8c1f('0x56'),'where':{'id':LISTID}}]})['then'](function(_0xc9a3fd){var _0x493b59=[];if(_0xc9a3fd){for(var _0x16d424=0x0,_0x2dba4;_0x16d424<_0xc9a3fd[_0x8c1f('0x1a')];_0x16d424+=0x1){_0x2dba4=_0xc9a3fd[_0x16d424][_0x8c1f('0x4c')]({'plain':!![]});_0x493b59[_0x8c1f('0x4e')](db[_0x8c1f('0x4f')]['query'](_0x4fd82b(_0x2dba4,'CampaignId'))[_0x8c1f('0x2b')](function(){})['catch'](_0x41eb13()));}}return _0x493b59;})[_0x8c1f('0x53')]();})[_0x8c1f('0x2d')](function(_0x1bcecf){logger[_0x8c1f('0x17')](_0x8c1f('0x59'),'generalCheckHopper',_0x1bcecf[_0x8c1f('0x1b')]);});}var processPromises=function(_0x45d289){return BPromise[_0x8c1f('0x53')](promises)[_0x8c1f('0x2b')](function(_0xd3a4bc){})[_0x8c1f('0x2d')](function(_0xb82fc8){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x8c1f('0x2f')](_0xb82fc8));})[_0x8c1f('0x5a')](function(){socket[_0x8c1f('0x5b')](_0x8c1f('0x5c')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x45d289){return _0x45d289[_0x8c1f('0x5d')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x8c1f('0x2b')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x8c1f('0x5e')](FILEPATH);}catch(_0xe5662e){logger[_0x8c1f('0x17')](_0x8c1f('0x5f'),JSON[_0x8c1f('0x2f')](_0xe5662e));}finally{process[_0x8c1f('0x60')](0x0);}});};process['on']('SIGINT',function(){logger[_0x8c1f('0x61')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x8c1f('0x10')](',');return db[_0x8c1f('0x29')][_0x8c1f('0x49')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x8c1f('0x2b')](function(_0x5e2987){var _0x11f8ae=fs[_0x8c1f('0x62')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x8c1f('0x63')](_0x11f8ae,{'header':!![],'skipEmptyLines':!![],'step':function(_0x50a34b,_0x15b1cf){total+=0x1;var _0x37bb09=total;promises[_0x8c1f('0x4e')](checkRow(_0x50a34b,_0x5e2987,_0x37bb09)[_0x8c1f('0x2b')](function(){success+=0x1;})[_0x8c1f('0x2d')](function(_0x3f2ecc){if(_0x3f2ecc[_0x8c1f('0x17')]){errors+=0x1;delete _0x3f2ecc[_0x8c1f('0x17')];}else if(_0x3f2ecc[_0x8c1f('0x64')]){duplicates+=0x1;delete _0x3f2ecc[_0x8c1f('0x64')];}rows[_0x8c1f('0x4e')](_0x3f2ecc);}));if(total%0xc8===0x0){_0x15b1cf[_0x8c1f('0x65')]();return processPromises(_0x15b1cf);}},'complete':function(){return processPromises()[_0x8c1f('0x2b')](function(){logger[_0x8c1f('0x61')](_0x8c1f('0x66'));endCsv();});},'error':function(_0x5de6d5,_0x5a9723){logger['info'](_0x8c1f('0x67'),JSON[_0x8c1f('0x2f')](_0x5de6d5));endCsv();}});})[_0x8c1f('0x2d')](function(_0x58e1a0){logger[_0x8c1f('0x17')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x8c1f('0x2f')](_0x58e1a0));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 14b7b3d..03b5340 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 _0x56ef=['cm_hopper_black','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','UserId','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','exit','code','message','sequelize','query','spread','push','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','all','then','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','timezones','dialTimezone','offset','set','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv',',utcOffset','writeFileSync','createReadStream','data','errors','scheduledat','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','\x20not\x20specified','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','existsSync','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','priority','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','where','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','ListId','fields'];(function(_0x12019a,_0x407485){var _0x49520a=function(_0x150fb6){while(--_0x150fb6){_0x12019a['push'](_0x12019a['shift']());}};_0x49520a(++_0x407485);}(_0x56ef,0x66));var _0xf56e=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x56ef[_0x5c4f6b];return _0x104c4e;};'use strict';var fs=require('fs');var path=require(_0xf56e('0x0'));var _=require('lodash');var Papa=require(_0xf56e('0x1'));var util=require(_0xf56e('0x2'));var BPromise=require(_0xf56e('0x3'));var moment=require(_0xf56e('0x4'));var squel=require(_0xf56e('0x5'));var Redis=require(_0xf56e('0x6'));var db=require(_0xf56e('0x7'))['db'];var config=require(_0xf56e('0x8'));var shared=require(_0xf56e('0x9'));var logger=require(_0xf56e('0xa'))(_0xf56e('0xb'));config[_0xf56e('0xc')]=_[_0xf56e('0xd')](config[_0xf56e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf56e('0xe'))(new Redis(config[_0xf56e('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xf56e('0xf')](_0xf56e('0x10'));function isEmail(_0x5021d0){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))*$/[_0xf56e('0x11')](_0x5021d0);}function selectNotIn(_0x26cb96,_0x3d29c3,_0x5ab137,_0x23e05e,_0x531847){return squel[_0xf56e('0x12')]()[_0xf56e('0x13')](_0xf56e('0x14'))[_0xf56e('0x15')](_0x23e05e)['join'](_0x3d29c3,null,_0x3d29c3+_0xf56e('0x16')+_0x23e05e+'.'+_0x5ab137)['where'](_0x23e05e+'.'+_0x5ab137+_0xf56e('0x17')+_0x26cb96+'.'+_0x5ab137)['where'](_0x3d29c3+_0xf56e('0x18')+_0x531847[_0xf56e('0x19')]()+')');}function insertCmHopper(_0xea1be3,_0x548bd5,_0x1ce843,_0x330fcc,_0x4903c8){var _0x2575a6=[_0xf56e('0x1a'),'cm_contacts.scheduledat',_0xf56e('0x1b'),_0xf56e('0x1c'),_0x548bd5+'.'+_0x330fcc,'cm_contacts.createdAt',_0xf56e('0x1d'),_0xf56e('0x1e'),_0xf56e('0x1f'),'\x22'+_0x4903c8+'\x22'];return squel[_0xf56e('0x20')]()[_0xf56e('0x21')](_0xf56e('0x22'))[_0xf56e('0x23')]([_0xf56e('0x14'),'scheduledat',_0xf56e('0x24'),'ListId',_0x330fcc,_0xf56e('0x25'),_0xf56e('0x26'),_0xf56e('0x27'),'UserId',_0xf56e('0x28')],squel['select']()['fields'](_0x2575a6)[_0xf56e('0x15')](_0x548bd5)['join'](_0xf56e('0x29'),null,_0xf56e('0x2a')+_0x548bd5+_0xf56e('0x2b'))[_0xf56e('0x19')](_0x1ce843,null,_0x1ce843+_0xf56e('0x16')+_0x548bd5+'.'+_0x330fcc)[_0xf56e('0x2c')](_0x548bd5+_0xf56e('0x2d'),_0xea1be3)[_0xf56e('0x2c')](_0xf56e('0x2e'),NOW)[_0xf56e('0x2c')](_0xf56e('0x2f'),selectNotIn(_0x548bd5,_0x1ce843,_0x330fcc,_0xf56e('0x22'),[_0xf56e('0x30'),_0xf56e('0x31')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x548bd5,_0x1ce843,_0x330fcc,'cm_hopper',['\x22always\x22'])))[_0xf56e('0x32')]();}function insertCmHopperBlack(_0x13e7f3,_0x4f83c0,_0x5cbbe9,_0x4029e6){var _0x50bd92=[_0xf56e('0x1a'),_0xf56e('0x1b'),'cm_contacts.ListId',_0x4f83c0+'.'+_0x4029e6,_0xf56e('0x33'),_0xf56e('0x1d')];return squel['insert']()['into']('cm_hopper_black')[_0xf56e('0x23')](['phone',_0xf56e('0x24'),_0xf56e('0x34'),_0x4029e6,_0xf56e('0x25'),_0xf56e('0x26')],squel[_0xf56e('0x12')]()[_0xf56e('0x35')](_0x50bd92)['from'](_0x4f83c0)['join'](_0xf56e('0x29'),null,'cm_contacts.ListId\x20=\x20'+_0x4f83c0+'.CmListId')['join'](_0x5cbbe9,null,_0x5cbbe9+'.id\x20=\x20'+_0x4f83c0+'.'+_0x4029e6)[_0xf56e('0x2c')](_0x4f83c0+_0xf56e('0x2d'),_0x13e7f3)[_0xf56e('0x2c')](_0xf56e('0x2e'),NOW)['where'](_0xf56e('0x2f'),squel[_0xf56e('0x12')]()[_0xf56e('0x13')](_0xf56e('0x14'))['from'](_0xf56e('0x36'))['where']('ListId\x20=\x20?',_0x13e7f3)[_0xf56e('0x2c')](_0x4029e6+_0xf56e('0x37'),_0x4f83c0+'.'+_0x4029e6)))['toString']();}function insertTzCmHopper(_0x3d6570,_0x15adb2,_0x5a46ee,_0x4f8032,_0x48efb3,_0xf1cfe){var _0x3874d4=[_0xf56e('0x1a'),_0xf56e('0x38')+_0xf1cfe+_0xf56e('0x39'),_0xf56e('0x1b'),_0xf56e('0x1c'),_0x15adb2+'.'+_0x4f8032,'cm_contacts.createdAt',_0xf56e('0x1d'),_0xf56e('0x1e'),'cm_contacts.UserId','\x22'+_0x48efb3+'\x22'];var _0x42823d=squel[_0xf56e('0x20')]()['into'](_0xf56e('0x22'))[_0xf56e('0x23')]([_0xf56e('0x14'),'scheduledat',_0xf56e('0x24'),_0xf56e('0x34'),_0x4f8032,_0xf56e('0x25'),_0xf56e('0x26'),_0xf56e('0x27'),_0xf56e('0x3a'),_0xf56e('0x28')],squel[_0xf56e('0x12')]()[_0xf56e('0x35')](_0x3874d4)[_0xf56e('0x15')](_0x15adb2)[_0xf56e('0x19')](_0xf56e('0x29'),null,_0xf56e('0x2a')+_0x15adb2+'.CmListId')[_0xf56e('0x19')](_0x5a46ee,null,_0x5a46ee+_0xf56e('0x16')+_0x15adb2+'.'+_0x4f8032)[_0xf56e('0x19')](_0xf1cfe,null,_0xf1cfe+_0xf56e('0x16')+_0x15adb2+'.'+_0x4f8032)[_0xf56e('0x2c')](_0x15adb2+'.CmListId\x20=\x20?',_0x3d6570)[_0xf56e('0x2c')](_0xf56e('0x2e'),NOW)[_0xf56e('0x2c')](_0xf56e('0x2f'),selectNotIn(_0x15adb2,_0x5a46ee,_0x4f8032,_0xf56e('0x22'),[_0xf56e('0x30'),_0xf56e('0x31')]))['where'](_0xf56e('0x2f'),selectNotIn(_0x15adb2,_0x5a46ee,_0x4f8032,'cm_hopper',['\x22always\x22'])))[_0xf56e('0x32')]();return _0x42823d;}function insertTzCmHopperBlack(_0x365787,_0x41a01f,_0xe721ab,_0x220971){var _0x5f445f=['cm_contacts.phone',_0xf56e('0x1b'),_0xf56e('0x1c'),_0x41a01f+'.'+_0x220971,_0xf56e('0x33'),_0xf56e('0x1d')];return squel['insert']()[_0xf56e('0x21')](_0xf56e('0x36'))[_0xf56e('0x23')]([_0xf56e('0x14'),_0xf56e('0x24'),_0xf56e('0x34'),_0x220971,'createdAt',_0xf56e('0x26')],squel[_0xf56e('0x12')]()['fields'](_0x5f445f)['from'](_0x41a01f)[_0xf56e('0x19')](_0xf56e('0x29'),null,_0xf56e('0x2a')+_0x41a01f+_0xf56e('0x2b'))['join'](_0xe721ab,null,_0xe721ab+'.id\x20=\x20'+_0x41a01f+'.'+_0x220971)['where'](_0x41a01f+_0xf56e('0x2d'),_0x365787)['where'](_0xf56e('0x2e'),NOW)[_0xf56e('0x2c')](_0xf56e('0x2f'),squel[_0xf56e('0x12')]()[_0xf56e('0x13')](_0xf56e('0x14'))[_0xf56e('0x15')](_0xf56e('0x36'))['where']('ListId\x20=\x20?',_0x365787)['where'](_0x220971+_0xf56e('0x37'),_0x41a01f+'.'+_0x220971)))[_0xf56e('0x32')]();}function insertCmContact(_0xcacb16,_0x192a36,_0x36b1c1,_0xe077c1){var _0x5b670b=_[_0xf56e('0x3b')](_[_0xf56e('0x3c')](_0xe077c1),[_0xf56e('0x34'),_0xf56e('0x3d'),_0xf56e('0x25'),'updatedAt']);return squel[_0xf56e('0x20')]()[_0xf56e('0x21')](_0xf56e('0x29'))['fromQuery'](_0x5b670b,squel[_0xf56e('0x12')]()[_0xf56e('0x35')](_0x5b670b)['from'](_0x192a36)['where']('('+_0x36b1c1[_0xf56e('0x19')](',')+_0xf56e('0x3e'),squel[_0xf56e('0x12')]()['fields'](_0x36b1c1)[_0xf56e('0x15')](_0xf56e('0x29'))[_0xf56e('0x2c')](_0xf56e('0x3f'),_0xcacb16)['where'](_0xf56e('0x40')))[_0xf56e('0x2c')](_0xf56e('0x41'),squel[_0xf56e('0x12')]()[_0xf56e('0x13')](_0xf56e('0x42'),_0xf56e('0x43'))[_0xf56e('0x15')](_0x192a36)['group'](_0x36b1c1[_0xf56e('0x19')](','))))[_0xf56e('0x32')]();}function handleStop(){logger[_0xf56e('0x44')](_0xf56e('0x45'));stopped=!![];}function handleUncaughtException(_0x36dd13){logger['error'](_0x36dd13['message']);process[_0xf56e('0x46')](0x1);}function handleError(_0xf27e2e,_0x594893){stats['errors']['push']({'name':_0x594893[_0xf56e('0x47')],'message':_0x594893[_0xf56e('0x48')],'row':_0xf27e2e});}function handleQuery(_0x3ef6e0){logger[_0xf56e('0x44')](_0x3ef6e0);return db[_0xf56e('0x49')][_0xf56e('0x4a')](_0x3ef6e0)[_0xf56e('0x4b')](function(_0x1bd827){results[_0xf56e('0x4c')](_0x1bd827);})[_0xf56e('0x4d')](function(_0x25cc5b){logger[_0xf56e('0x4e')](_0x25cc5b[_0xf56e('0x48')]);});}function updateTzCampaigns(_0x354440){return new Promise(function(_0x4c3a54,_0xf3ce28){var _0x13b3fa=squel[_0xf56e('0x12')]()[_0xf56e('0x35')]([_0xf56e('0x4f'),_0xf56e('0x50')])['from'](_0xf56e('0x51'))[_0xf56e('0x19')]('campaigns_has_cm_lists',null,_0xf56e('0x52'))[_0xf56e('0x2c')](_0xf56e('0x53')+_0x354440);db[_0xf56e('0x49')][_0xf56e('0x4a')](_0x13b3fa[_0xf56e('0x32')]())[_0xf56e('0x4b')](function(_0x194624){var _0x5b0224=[];for(var _0x12baba=0x0;_0x12baba<_0x194624[_0xf56e('0x54')];_0x12baba++){_0x5b0224[_0xf56e('0x4c')](getTimezoneData(_0x194624[_0x12baba],tmp_campaigns));}BPromise[_0xf56e('0x55')](_0x5b0224)[_0xf56e('0x56')](function(){_0x4c3a54({'val':0x1});});})[_0xf56e('0x4d')](function(_0x574aee){logger[_0xf56e('0x4e')](_0x574aee[_0xf56e('0x48')]);_0x4c3a54({'val':0x0});});});}function updateTzVoiceQueues(_0x17530d){return new Promise(function(_0x456320,_0x38e094){var _0x4ae402=squel['select']()['fields']([_0xf56e('0x57'),_0xf56e('0x58')])[_0xf56e('0x15')](_0xf56e('0x59'))[_0xf56e('0x19')](_0xf56e('0x5a'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')['where']('voice_queues_has_cm_lists.CmListId='+_0x17530d);db['sequelize'][_0xf56e('0x4a')](_0x4ae402[_0xf56e('0x32')]())[_0xf56e('0x4b')](function(_0x2119de){var _0x354fe2=[];for(var _0xf52ad9=0x0;_0xf52ad9<_0x2119de['length'];_0xf52ad9++){_0x354fe2[_0xf56e('0x4c')](getTimezoneData(_0x2119de[_0xf52ad9],tmp_voice_queues));}BPromise[_0xf56e('0x55')](_0x354fe2)['then'](function(){_0x456320({'val':0x1});});})[_0xf56e('0x4d')](function(_0x493a01){logger['error'](_0x493a01['message']);_0x456320({'val':0x0});});});}function getTimezoneData(_0x5ac807,_0x5953e0){return new Promise(function(_0x5441b0,_0x4b5da4){var _0x124572=shared[_0xf56e('0x5b')];var _0x22c4fb=_0x124572[_0x5ac807[_0xf56e('0x5c')]];if(_['isNil'](_0x22c4fb)){_0x5441b0({'ret':0x1});}else{var _0x3ff573=_0x22c4fb['utcOffset'];var _0x498f0a=squel[_0xf56e('0x20')]()[_0xf56e('0x21')](_0x5953e0)['set']('id',_0x5ac807['id'])['set'](_0xf56e('0x5d'),_0x3ff573)[_0xf56e('0x5e')]('dialTimezone',_0x5ac807[_0xf56e('0x5c')])[_0xf56e('0x32')]();return db['sequelize']['query'](_0x498f0a)[_0xf56e('0x4b')](function(_0x3f6ed1){_0x5441b0({'ret':0x1});})[_0xf56e('0x4d')](function(_0x32bfc0){logger[_0xf56e('0x4e')](_0x32bfc0[_0xf56e('0x48')]);_0x4b5da4({'ret':0x1});});}});}function handleTZQuery(_0xcb2c61){logger[_0xf56e('0x44')](_0xcb2c61);return db[_0xf56e('0x49')][_0xf56e('0x4a')](_0xcb2c61)['spread'](function(_0xb214df){})[_0xf56e('0x4d')](function(_0x361ca8){logger[_0xf56e('0x4e')](_0x361ca8[_0xf56e('0x48')]);});}function main(_0x1fc1e8,_0x4cd630,_0x2e7ea9,_0x87f736){logger[_0xf56e('0x44')](_0xf56e('0x5f'),_0x1fc1e8,JSON[_0xf56e('0x60')](_0x4cd630));process[_0xf56e('0x61')](_0xf56e('0x62'));var _0xd2c413=_0x4cd630[_0xf56e('0x63')];var _0x1c6964=_0x4cd630[_0xf56e('0x64')];var _0x4c48d3=path[_0xf56e('0x19')](config[_0xf56e('0x65')],_0xf56e('0x66'),_0x1c6964+_0xf56e('0x67'));hasTZ=_[_0xf56e('0x3c')](_0xd2c413)['includes'](_0xf56e('0x5c'));var _0x372ac4=_[_0xf56e('0x3c')](_0xd2c413)[_0xf56e('0x19')]();logger[_0xf56e('0x44')]('header',_0x372ac4);if(hasTZ)_0x372ac4+=_0xf56e('0x68');fs[_0xf56e('0x69')](_0x4c48d3,_0x372ac4+'\x0a');Papa['parse'](fs[_0xf56e('0x6a')](_0x1fc1e8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5e59e0,_0x910c2a){try{for(var _0x14c457=0x0,_0x10bdd3=[];_0x14c457<_0x5e59e0[_0xf56e('0x6b')][_0xf56e('0x54')];_0x14c457++){stats['rows']+=0x1;if(_0x5e59e0[_0xf56e('0x6c')][_0x14c457]){handleError(_0x5e59e0[_0xf56e('0x6b')][_0x14c457],_0x5e59e0[_0xf56e('0x6c')][_0x14c457]);}else{var _0x42d01f=[];for(var _0x378c0c in _0xd2c413){if(_0xd2c413['hasOwnProperty'](_0x378c0c)){if(_0x5e59e0[_0xf56e('0x6b')][_0x14c457][_0xd2c413[_0x378c0c]]){var _0x79f614=_['trim'](_0x5e59e0[_0xf56e('0x6b')][_0x14c457][_0xd2c413[_0x378c0c]]['replace'](/"/g,'\x27'));switch(_0x378c0c){case _0xf56e('0x6d'):var _0x2e496d=moment(_0x79f614,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x2e496d['isValid']()){_0x10bdd3[_0xf56e('0x4c')]('\x22'+_0x79f614+'\x22');}else{_0x42d01f[_0xf56e('0x4c')](_0xf56e('0x6e'));}break;case _0xf56e('0x27'):var _0x1b3637=parseInt(_0x79f614);_0x79f614=_[_0xf56e('0x6f')](_0x1b3637)||_0x1b3637<0x0||_0x1b3637>0x4?_0x87f736?0x3:0x2:_0x1b3637;_0x10bdd3[_0xf56e('0x4c')]('\x22'+_0x79f614+'\x22');break;case'UserId':var _0x1bcc10=parseInt(_0x79f614);if(_[_0xf56e('0x70')](_0x1bcc10)&&_[_0xf56e('0x71')](_0x2e7ea9,_0x1bcc10)){_0x10bdd3[_0xf56e('0x4c')]('\x22'+_0x1bcc10+'\x22');}else{_0x42d01f[_0xf56e('0x4c')](_0xf56e('0x72'));}break;case _0xf56e('0x73'):if(isEmail(_0x79f614)){_0x10bdd3[_0xf56e('0x4c')]('\x22'+_0x79f614+'\x22');}else{_0x42d01f[_0xf56e('0x4c')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x2cfe64=moment(_0x79f614,_0xf56e('0x74'),!![]);if(_0x2cfe64[_0xf56e('0x75')]()){_0x10bdd3['push']('\x22'+_0x79f614+'\x22');}else{_0x42d01f[_0xf56e('0x4c')](_0xf56e('0x76'));}break;case _0xf56e('0x5c'):var _0x554634=shared[_0xf56e('0x5b')];var _0x4d991e=_0x554634[_0x79f614];if(!_['isNil'](_0x4d991e)){var _0x223f03=_0x4d991e[_0xf56e('0x77')];_0x10bdd3[_0xf56e('0x4c')]('\x22'+_0x79f614+'\x22');_0x10bdd3[_0xf56e('0x4c')]('\x22'+_0x223f03+'\x22');}break;default:_0x10bdd3[_0xf56e('0x4c')]('\x22'+_0x79f614+'\x22');}}else{switch(_0x378c0c){case _0xf56e('0x78'):case _0xf56e('0x14'):_0x42d01f[_0xf56e('0x4c')](_0x378c0c+_0xf56e('0x79'));break;default:_0x10bdd3['push']('\x22\x22');}}}}if(_0x42d01f['length']){handleError(_0x5e59e0[_0xf56e('0x6b')][_0x14c457],{'code':'SystemRow','message':_0x42d01f[_0xf56e('0x19')]()});}else{fs[_0xf56e('0x7a')](_0x4c48d3,_0x10bdd3[_0xf56e('0x19')]()+'\x0a');}_0x10bdd3=[];}if(!(stats[_0xf56e('0x7b')]%0xc8)){socket[_0xf56e('0x7c')](_0xf56e('0x7d')+_0x1c6964,stats);stats[_0xf56e('0x6c')]=[];}}if(stopped){logger['info'](_0xf56e('0x7e'));_0x910c2a[_0xf56e('0x7f')]();}}catch(_0x4126e7){handleError(_0x5e59e0[_0xf56e('0x6b')][_0x14c457],{'code':'SystemError','message':_0x4126e7[_0xf56e('0x48')]});logger['error']('step',_0x4126e7[_0xf56e('0x48')]);}},'complete':function(){try{var _0x3fa9dc=[];var _0x5dfb40=[];var _0x2eedfc=_0xf56e('0x29');if(_0x4cd630[_0xf56e('0x80')]&&_0x4cd630[_0xf56e('0x80')][_0xf56e('0x54')]){_0x2eedfc=_0xf56e('0x81')+_0x1c6964;_0x3fa9dc[_0xf56e('0x4c')](_0xf56e('0x82')+_0x2eedfc+_0xf56e('0x83'));}tmp_campaigns=_0xf56e('0x84')+_0x1c6964;tmp_voice_queues='voice_queues_'+_0x1c6964;_0x5dfb40['push'](_0xf56e('0x82')+tmp_campaigns+_0xf56e('0x85'));_0x5dfb40[_0xf56e('0x4c')](_0xf56e('0x82')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xf56e('0x86')](_0x5dfb40,handleTZQuery)['then'](function(_0xef09b3){updateTzCampaigns(_0x4cd630[_0xf56e('0x34')])[_0xf56e('0x56')](function(_0x4b1e50){updateTzVoiceQueues(_0x4cd630[_0xf56e('0x34')])[_0xf56e('0x56')](function(_0x36b0a5){var _0x4a5f79=util[_0xf56e('0xf')](_0xf56e('0x87'),_0x4c48d3,_0x2eedfc,_0x372ac4,_0x4cd630[_0xf56e('0x34')],_0x4cd630[_0xf56e('0x3d')]||null,NOW,NOW);if(_['isNil'](_0xd2c413[_0xf56e('0x6d')])){_0x4a5f79+=_0xf56e('0x88');}_0x3fa9dc[_0xf56e('0x4c')](_0x4a5f79);if(_0x4cd630[_0xf56e('0x80')]&&_0x4cd630[_0xf56e('0x80')][_0xf56e('0x54')]){_0x3fa9dc[_0xf56e('0x4c')](insertCmContact(_0x4cd630[_0xf56e('0x34')],_0x2eedfc,_0x4cd630[_0xf56e('0x80')],_0xd2c413));_0x3fa9dc['push'](_0xf56e('0x89')+_0x2eedfc+';');}if(hasTZ){_0x3fa9dc[_0xf56e('0x4c')](insertTzCmHopper(_0x4cd630[_0xf56e('0x34')],_0xf56e('0x5a'),_0xf56e('0x59'),_0xf56e('0x8a'),_0x87f736,tmp_voice_queues));_0x3fa9dc[_0xf56e('0x4c')](insertTzCmHopperBlack(_0x4cd630[_0xf56e('0x34')],_0xf56e('0x8b'),_0xf56e('0x59'),'VoiceQueueId'));_0x3fa9dc['push'](insertTzCmHopper(_0x4cd630[_0xf56e('0x34')],_0xf56e('0x8c'),_0xf56e('0x51'),_0xf56e('0x8d'),_0x87f736,tmp_campaigns));_0x3fa9dc[_0xf56e('0x4c')](insertTzCmHopperBlack(_0x4cd630['ListId'],_0xf56e('0x8e'),_0xf56e('0x51'),'CampaignId'));}else{_0x3fa9dc['push'](insertCmHopper(_0x4cd630['ListId'],'voice_queues_has_cm_lists','voice_queues','VoiceQueueId',_0x87f736));_0x3fa9dc[_0xf56e('0x4c')](insertCmHopperBlack(_0x4cd630[_0xf56e('0x34')],_0xf56e('0x8b'),'voice_queues',_0xf56e('0x8a')));_0x3fa9dc[_0xf56e('0x4c')](insertCmHopper(_0x4cd630['ListId'],_0xf56e('0x8c'),_0xf56e('0x51'),_0xf56e('0x8d'),_0x87f736));_0x3fa9dc[_0xf56e('0x4c')](insertCmHopperBlack(_0x4cd630[_0xf56e('0x34')],'campaigns_has_cm_blacklists',_0xf56e('0x51'),_0xf56e('0x8d')));}_0x3fa9dc[_0xf56e('0x4c')]('DROP\x20TABLE\x20'+tmp_campaigns+';');_0x3fa9dc[_0xf56e('0x4c')](_0xf56e('0x89')+tmp_voice_queues+';');BPromise['each'](_0x3fa9dc,handleQuery)[_0xf56e('0x56')](function(_0x50b3c6){stats[_0xf56e('0x8f')]=!![];stats[_0xf56e('0x90')]=_0x4cd630['duplicates']&&_0x4cd630[_0xf56e('0x80')]['length']?results[0x2][_0xf56e('0x90')]:results[0x0]['affectedRows'];socket['emit'](_0xf56e('0x7d')+_0x1c6964,stats);fs[_0xf56e('0x91')](_0x1fc1e8);fs['unlink'](_0x4c48d3);process[_0xf56e('0x46')](0x0);})['catch'](function(_0xcf80b3){logger['error'](_0xcf80b3['message']);process[_0xf56e('0x46')](0x1);});});});});}catch(_0x52475b){logger['error']('complete',_0x52475b[_0xf56e('0x48')]);process['exit'](0x1);}},'error':function(_0x3b5e22,_0x50257a,_0x53d6f2,_0x1a65e5){throw new Error(_0x1a65e5);}});}function validate(){if(process[_0xf56e('0x92')]&&process['argv'][_0xf56e('0x54')]<0x4){throw new Error(_0xf56e('0x93'));}var _0x554b34=path[_0xf56e('0x19')](config[_0xf56e('0x65')],_0xf56e('0x66'),process['argv'][0x2]);if(!fs[_0xf56e('0x94')](_0x554b34)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x2ac77b={};try{_0x2ac77b=JSON[_0xf56e('0x95')](process[_0xf56e('0x92')][0x3]);if(!_0x2ac77b['binding']){throw new Error(_0xf56e('0x96'));}if(!_0x2ac77b[_0xf56e('0x63')][_0xf56e('0x14')]){throw new Error(_0xf56e('0x97'));}if(!_0x2ac77b['binding'][_0xf56e('0x78')]){throw new Error(_0xf56e('0x98'));}var _0x300b01=0x0;if(_0x2ac77b[_0xf56e('0x63')][_0xf56e('0x3a')]){_0x300b01=0x1;}if(!_0x2ac77b[_0xf56e('0x34')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x426bef){throw new Error(_0xf56e('0x99'));}var _0x3500d6=[];try{_0x3500d6=_['map'](JSON[_0xf56e('0x95')](process[_0xf56e('0x92')][0x4]),'id');}catch(_0x20183b){logger['info']('No\x20agent\x20available');}main(_0x554b34,_0x2ac77b,_0x3500d6,_0x300b01);}validate();process['on'](_0xf56e('0x9a'),handleStop);process['on'](_0xf56e('0x9b'),handleUncaughtException); \ No newline at end of file +var _0x7732=['voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','contact:import:','unlink','complete','argv','root','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','ioredis','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','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.priority','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','updatedAt','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_hopper_black','select','fields','.CmListId','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','createdAt','priority','UserId','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','Received\x20SIGINT','error','message','exit','info','query','spread','push','catch','campaigns.dialTimezone','campaigns_has_cm_lists','sequelize','length','all','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','then','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','start','socket_timestamp','server/files/tmp','.csv','includes','header',',utcOffset','parse','createReadStream','rows','errors','data','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','SystemRow','appendFileSync','emit','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20'];(function(_0x31c796,_0x2e3c7f){var _0x128356=function(_0x35534a){while(--_0x35534a){_0x31c796['push'](_0x31c796['shift']());}};_0x128356(++_0x2e3c7f);}(_0x7732,0x151));var _0x2773=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x7732[_0xaa0309];return _0x5de7ce;};'use strict';var fs=require('fs');var path=require(_0x2773('0x0'));var _=require(_0x2773('0x1'));var Papa=require(_0x2773('0x2'));var util=require(_0x2773('0x3'));var BPromise=require('bluebird');var moment=require(_0x2773('0x4'));var squel=require('squel');var Redis=require(_0x2773('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x2773('0x6'));var shared=require('../../../config/environment/shared');var logger=require(_0x2773('0x7'))(_0x2773('0x8'));config['redis']=_['defaults'](config[_0x2773('0x9')],{'host':_0x2773('0xa'),'port':0x18eb});var socket=require(_0x2773('0xb'))(new Redis(config[_0x2773('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x2773('0xc')](_0x2773('0xd'));function isEmail(_0x1682b0){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))*$/[_0x2773('0xe')](_0x1682b0);}function selectNotIn(_0x2c837d,_0x15aa23,_0x3eb23a,_0x1435dc,_0x5a994d){return squel['select']()[_0x2773('0xf')](_0x2773('0x10'))[_0x2773('0x11')](_0x1435dc)[_0x2773('0x12')](_0x15aa23,null,_0x15aa23+_0x2773('0x13')+_0x1435dc+'.'+_0x3eb23a)[_0x2773('0x14')](_0x1435dc+'.'+_0x3eb23a+_0x2773('0x15')+_0x2c837d+'.'+_0x3eb23a)[_0x2773('0x14')](_0x15aa23+_0x2773('0x16')+_0x5a994d[_0x2773('0x12')]()+')');}function insertCmHopper(_0x4952b9,_0x200742,_0x3f8fae,_0x36f6d8,_0x1858b7){var _0x998b53=[_0x2773('0x17'),_0x2773('0x18'),_0x2773('0x19'),_0x2773('0x1a'),_0x200742+'.'+_0x36f6d8,'cm_contacts.createdAt',_0x2773('0x1b'),_0x2773('0x1c'),'cm_contacts.UserId','\x22'+_0x1858b7+'\x22'];return squel[_0x2773('0x1d')]()[_0x2773('0x1e')](_0x2773('0x1f'))[_0x2773('0x20')]([_0x2773('0x10'),_0x2773('0x21'),_0x2773('0x22'),_0x2773('0x23'),_0x36f6d8,'createdAt',_0x2773('0x24'),'priority','UserId',_0x2773('0x25')],squel['select']()['fields'](_0x998b53)[_0x2773('0x11')](_0x200742)[_0x2773('0x12')](_0x2773('0x26'),null,_0x2773('0x27')+_0x200742+'.CmListId')['join'](_0x3f8fae,null,_0x3f8fae+_0x2773('0x13')+_0x200742+'.'+_0x36f6d8)[_0x2773('0x14')](_0x200742+_0x2773('0x28'),_0x4952b9)[_0x2773('0x14')](_0x2773('0x29'),NOW)['where'](_0x2773('0x2a'),selectNotIn(_0x200742,_0x3f8fae,_0x36f6d8,_0x2773('0x1f'),['\x22always\x22',_0x2773('0x2b')]))[_0x2773('0x14')](_0x2773('0x2a'),selectNotIn(_0x200742,_0x3f8fae,_0x36f6d8,'cm_hopper',['\x22always\x22'])))[_0x2773('0x2c')]();}function insertCmHopperBlack(_0x2867ce,_0x346c27,_0x2aeb9d,_0x41a1d6){var _0x3dcd57=[_0x2773('0x17'),_0x2773('0x19'),_0x2773('0x1a'),_0x346c27+'.'+_0x41a1d6,_0x2773('0x2d'),_0x2773('0x1b')];return squel[_0x2773('0x1d')]()['into'](_0x2773('0x2e'))['fromQuery']([_0x2773('0x10'),_0x2773('0x22'),_0x2773('0x23'),_0x41a1d6,'createdAt',_0x2773('0x24')],squel[_0x2773('0x2f')]()[_0x2773('0x30')](_0x3dcd57)['from'](_0x346c27)['join']('cm_contacts',null,_0x2773('0x27')+_0x346c27+_0x2773('0x31'))[_0x2773('0x12')](_0x2aeb9d,null,_0x2aeb9d+_0x2773('0x13')+_0x346c27+'.'+_0x41a1d6)['where'](_0x346c27+_0x2773('0x28'),_0x2867ce)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x2773('0x14')](_0x2773('0x2a'),squel[_0x2773('0x2f')]()['field'](_0x2773('0x10'))['from'](_0x2773('0x2e'))[_0x2773('0x14')](_0x2773('0x32'),_0x2867ce)[_0x2773('0x14')](_0x41a1d6+_0x2773('0x33'),_0x346c27+'.'+_0x41a1d6)))[_0x2773('0x2c')]();}function insertTzCmHopper(_0xe08e6c,_0x359766,_0x5d4897,_0x4daa7d,_0x5058ca,_0x35317f){var _0x55e271=[_0x2773('0x17'),_0x2773('0x34')+_0x35317f+_0x2773('0x35'),_0x2773('0x19'),_0x2773('0x1a'),_0x359766+'.'+_0x4daa7d,_0x2773('0x2d'),_0x2773('0x1b'),_0x2773('0x1c'),_0x2773('0x36'),'\x22'+_0x5058ca+'\x22'];var _0x1add01=squel[_0x2773('0x1d')]()[_0x2773('0x1e')]('cm_hopper')[_0x2773('0x20')]([_0x2773('0x10'),'scheduledat',_0x2773('0x22'),_0x2773('0x23'),_0x4daa7d,_0x2773('0x37'),_0x2773('0x24'),_0x2773('0x38'),_0x2773('0x39'),_0x2773('0x25')],squel['select']()[_0x2773('0x30')](_0x55e271)[_0x2773('0x11')](_0x359766)[_0x2773('0x12')](_0x2773('0x26'),null,_0x2773('0x27')+_0x359766+_0x2773('0x31'))[_0x2773('0x12')](_0x5d4897,null,_0x5d4897+'.id\x20=\x20'+_0x359766+'.'+_0x4daa7d)[_0x2773('0x12')](_0x35317f,null,_0x35317f+_0x2773('0x13')+_0x359766+'.'+_0x4daa7d)[_0x2773('0x14')](_0x359766+_0x2773('0x28'),_0xe08e6c)[_0x2773('0x14')](_0x2773('0x29'),NOW)[_0x2773('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x359766,_0x5d4897,_0x4daa7d,_0x2773('0x1f'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x2773('0x14')](_0x2773('0x2a'),selectNotIn(_0x359766,_0x5d4897,_0x4daa7d,'cm_hopper',['\x22always\x22'])))[_0x2773('0x2c')]();return _0x1add01;}function insertTzCmHopperBlack(_0x4956eb,_0x253185,_0x2b4d52,_0x3b71ed){var _0x1ecc8a=[_0x2773('0x17'),_0x2773('0x19'),'cm_contacts.ListId',_0x253185+'.'+_0x3b71ed,_0x2773('0x2d'),'cm_contacts.updatedAt'];return squel[_0x2773('0x1d')]()[_0x2773('0x1e')]('cm_hopper_black')['fromQuery']([_0x2773('0x10'),_0x2773('0x22'),_0x2773('0x23'),_0x3b71ed,_0x2773('0x37'),_0x2773('0x24')],squel[_0x2773('0x2f')]()[_0x2773('0x30')](_0x1ecc8a)['from'](_0x253185)[_0x2773('0x12')](_0x2773('0x26'),null,_0x2773('0x27')+_0x253185+'.CmListId')['join'](_0x2b4d52,null,_0x2b4d52+_0x2773('0x13')+_0x253185+'.'+_0x3b71ed)[_0x2773('0x14')](_0x253185+_0x2773('0x28'),_0x4956eb)[_0x2773('0x14')](_0x2773('0x29'),NOW)[_0x2773('0x14')](_0x2773('0x2a'),squel['select']()[_0x2773('0xf')]('phone')[_0x2773('0x11')](_0x2773('0x2e'))['where'](_0x2773('0x32'),_0x4956eb)[_0x2773('0x14')](_0x3b71ed+_0x2773('0x33'),_0x253185+'.'+_0x3b71ed)))[_0x2773('0x2c')]();}function insertCmContact(_0x1f731d,_0x28514f,_0x5a3b2f,_0x281b1a){var _0x454a47=_['concat'](_[_0x2773('0x3a')](_0x281b1a),['ListId','CompanyId',_0x2773('0x37'),_0x2773('0x24')]);return squel[_0x2773('0x1d')]()['into']('cm_contacts')['fromQuery'](_0x454a47,squel[_0x2773('0x2f')]()[_0x2773('0x30')](_0x454a47)[_0x2773('0x11')](_0x28514f)[_0x2773('0x14')]('('+_0x5a3b2f[_0x2773('0x12')](',')+_0x2773('0x3b'),squel[_0x2773('0x2f')]()[_0x2773('0x30')](_0x5a3b2f)[_0x2773('0x11')](_0x2773('0x26'))[_0x2773('0x14')](_0x2773('0x32'),_0x1f731d)[_0x2773('0x14')](_0x2773('0x3c')))[_0x2773('0x14')](_0x2773('0x3d'),squel[_0x2773('0x2f')]()['field']('MIN(id)',_0x2773('0x3e'))[_0x2773('0x11')](_0x28514f)[_0x2773('0x3f')](_0x5a3b2f[_0x2773('0x12')](','))))[_0x2773('0x2c')]();}function handleStop(){logger['info'](_0x2773('0x40'));stopped=!![];}function handleUncaughtException(_0x81638c){logger[_0x2773('0x41')](_0x81638c[_0x2773('0x42')]);process[_0x2773('0x43')](0x1);}function handleError(_0x10bbd2,_0x3cda45){stats['errors']['push']({'name':_0x3cda45['code'],'message':_0x3cda45[_0x2773('0x42')],'row':_0x10bbd2});}function handleQuery(_0x1fadc9){logger[_0x2773('0x44')](_0x1fadc9);return db['sequelize'][_0x2773('0x45')](_0x1fadc9)[_0x2773('0x46')](function(_0x49b1bb){results[_0x2773('0x47')](_0x49b1bb);})[_0x2773('0x48')](function(_0x5bfb28){logger['error'](_0x5bfb28['message']);});}function updateTzCampaigns(_0x40dc39){return new Promise(function(_0x3e4917,_0x3de4ed){var _0x299cfb=squel[_0x2773('0x2f')]()[_0x2773('0x30')](['campaigns.id',_0x2773('0x49')])[_0x2773('0x11')]('campaigns')[_0x2773('0x12')](_0x2773('0x4a'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x2773('0x14')]('campaigns_has_cm_lists.CmListId='+_0x40dc39);db[_0x2773('0x4b')][_0x2773('0x45')](_0x299cfb[_0x2773('0x2c')]())[_0x2773('0x46')](function(_0x419d1f){var _0x5e9c35=[];for(var _0x2e5f92=0x0;_0x2e5f92<_0x419d1f[_0x2773('0x4c')];_0x2e5f92++){_0x5e9c35[_0x2773('0x47')](getTimezoneData(_0x419d1f[_0x2e5f92],tmp_campaigns));}BPromise[_0x2773('0x4d')](_0x5e9c35)['then'](function(){_0x3e4917({'val':0x1});});})[_0x2773('0x48')](function(_0x490e8c){logger[_0x2773('0x41')](_0x490e8c[_0x2773('0x42')]);_0x3e4917({'val':0x0});});});}function updateTzVoiceQueues(_0x33c1d1){return new Promise(function(_0x3ebebe,_0x379c38){var _0x53f851=squel[_0x2773('0x2f')]()['fields']([_0x2773('0x4e'),_0x2773('0x4f')])['from']('voice_queues')[_0x2773('0x12')](_0x2773('0x50'),null,_0x2773('0x51'))[_0x2773('0x14')](_0x2773('0x52')+_0x33c1d1);db[_0x2773('0x4b')][_0x2773('0x45')](_0x53f851[_0x2773('0x2c')]())[_0x2773('0x46')](function(_0x3b3ee1){var _0x413427=[];for(var _0x5ddbc3=0x0;_0x5ddbc3<_0x3b3ee1[_0x2773('0x4c')];_0x5ddbc3++){_0x413427[_0x2773('0x47')](getTimezoneData(_0x3b3ee1[_0x5ddbc3],tmp_voice_queues));}BPromise[_0x2773('0x4d')](_0x413427)[_0x2773('0x53')](function(){_0x3ebebe({'val':0x1});});})[_0x2773('0x48')](function(_0x514156){logger[_0x2773('0x41')](_0x514156[_0x2773('0x42')]);_0x3ebebe({'val':0x0});});});}function getTimezoneData(_0x18c9ea,_0x5b326d){return new Promise(function(_0x3e8e89,_0x45452c){var _0x2d3d2b=shared['timezones'];var _0x9f953d=_0x2d3d2b[_0x18c9ea[_0x2773('0x54')]];if(_[_0x2773('0x55')](_0x9f953d)){_0x3e8e89({'ret':0x1});}else{var _0x43fc37=_0x9f953d[_0x2773('0x56')];var _0x592698=squel[_0x2773('0x1d')]()[_0x2773('0x1e')](_0x5b326d)[_0x2773('0x57')]('id',_0x18c9ea['id'])[_0x2773('0x57')](_0x2773('0x58'),_0x43fc37)[_0x2773('0x57')](_0x2773('0x54'),_0x18c9ea[_0x2773('0x54')])[_0x2773('0x2c')]();return db[_0x2773('0x4b')][_0x2773('0x45')](_0x592698)['spread'](function(_0x1a8d8a){_0x3e8e89({'ret':0x1});})[_0x2773('0x48')](function(_0x4fb4bf){logger[_0x2773('0x41')](_0x4fb4bf[_0x2773('0x42')]);_0x45452c({'ret':0x1});});}});}function handleTZQuery(_0x27193e){logger[_0x2773('0x44')](_0x27193e);return db[_0x2773('0x4b')]['query'](_0x27193e)['spread'](function(_0x4e9181){})[_0x2773('0x48')](function(_0x9c896c){logger[_0x2773('0x41')](_0x9c896c[_0x2773('0x42')]);});}function main(_0x363f45,_0x55418a,_0x7d5f40,_0x5dcfde){logger[_0x2773('0x44')](_0x2773('0x59'),_0x363f45,JSON[_0x2773('0x5a')](_0x55418a));process[_0x2773('0x5b')](_0x2773('0x5c'));var _0x26e082=_0x55418a['binding'];var _0x5e2826=_0x55418a[_0x2773('0x5d')];var _0x453c84=path[_0x2773('0x12')](config['root'],_0x2773('0x5e'),_0x5e2826+_0x2773('0x5f'));hasTZ=_[_0x2773('0x3a')](_0x26e082)[_0x2773('0x60')](_0x2773('0x54'));var _0x4e5e9f=_[_0x2773('0x3a')](_0x26e082)[_0x2773('0x12')]();logger['info'](_0x2773('0x61'),_0x4e5e9f);if(hasTZ)_0x4e5e9f+=_0x2773('0x62');fs['writeFileSync'](_0x453c84,_0x4e5e9f+'\x0a');Papa[_0x2773('0x63')](fs[_0x2773('0x64')](_0x363f45),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4f1af1,_0x2331bf){try{for(var _0x1fd287=0x0,_0x3170c1=[];_0x1fd287<_0x4f1af1['data'][_0x2773('0x4c')];_0x1fd287++){stats[_0x2773('0x65')]+=0x1;if(_0x4f1af1[_0x2773('0x66')][_0x1fd287]){handleError(_0x4f1af1[_0x2773('0x67')][_0x1fd287],_0x4f1af1[_0x2773('0x66')][_0x1fd287]);}else{var _0x17d1a3=[];for(var _0xd7f870 in _0x26e082){if(_0x26e082[_0x2773('0x68')](_0xd7f870)){if(_0x4f1af1['data'][_0x1fd287][_0x26e082[_0xd7f870]]){var _0x559665=_[_0x2773('0x69')](_0x4f1af1[_0x2773('0x67')][_0x1fd287][_0x26e082[_0xd7f870]][_0x2773('0x6a')](/"/g,'\x27'));switch(_0xd7f870){case _0x2773('0x21'):var _0xd48af5=moment(_0x559665,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xd48af5[_0x2773('0x6b')]()){_0x3170c1[_0x2773('0x47')]('\x22'+_0x559665+'\x22');}else{_0x17d1a3[_0x2773('0x47')](_0x2773('0x6c'));}break;case'priority':var _0x4972a6=parseInt(_0x559665);_0x559665=_[_0x2773('0x6d')](_0x4972a6)||_0x4972a6<0x0||_0x4972a6>0x4?_0x5dcfde?0x3:0x2:_0x4972a6;_0x3170c1[_0x2773('0x47')]('\x22'+_0x559665+'\x22');break;case _0x2773('0x39'):var _0x28bf4e=parseInt(_0x559665);if(_['isNumber'](_0x28bf4e)&&_[_0x2773('0x60')](_0x7d5f40,_0x28bf4e)){_0x3170c1[_0x2773('0x47')]('\x22'+_0x28bf4e+'\x22');}else{_0x17d1a3[_0x2773('0x47')]('agent\x20not\x20exists');}break;case _0x2773('0x6e'):if(isEmail(_0x559665)){_0x3170c1[_0x2773('0x47')]('\x22'+_0x559665+'\x22');}else{_0x17d1a3[_0x2773('0x47')](_0x2773('0x6f'));}break;case _0x2773('0x70'):var _0x5406c1=moment(_0x559665,_0x2773('0x71'),!![]);if(_0x5406c1[_0x2773('0x6b')]()){_0x3170c1['push']('\x22'+_0x559665+'\x22');}else{_0x17d1a3[_0x2773('0x47')](_0x2773('0x72'));}break;case'dialTimezone':var _0x15f4c3=shared[_0x2773('0x73')];var _0x36e502=_0x15f4c3[_0x559665];if(!_[_0x2773('0x55')](_0x36e502)){var _0x227f63=_0x36e502[_0x2773('0x56')];_0x3170c1[_0x2773('0x47')]('\x22'+_0x559665+'\x22');_0x3170c1[_0x2773('0x47')]('\x22'+_0x227f63+'\x22');}break;default:_0x3170c1['push']('\x22'+_0x559665+'\x22');}}else{switch(_0xd7f870){case _0x2773('0x74'):case _0x2773('0x10'):_0x17d1a3['push'](_0xd7f870+'\x20not\x20specified');break;default:_0x3170c1['push']('\x22\x22');}}}}if(_0x17d1a3[_0x2773('0x4c')]){handleError(_0x4f1af1[_0x2773('0x67')][_0x1fd287],{'code':_0x2773('0x75'),'message':_0x17d1a3[_0x2773('0x12')]()});}else{fs[_0x2773('0x76')](_0x453c84,_0x3170c1[_0x2773('0x12')]()+'\x0a');}_0x3170c1=[];}if(!(stats[_0x2773('0x65')]%0xc8)){socket[_0x2773('0x77')]('contact:import:'+_0x5e2826,stats);stats[_0x2773('0x66')]=[];}}if(stopped){logger[_0x2773('0x44')]('Abort\x20parser');_0x2331bf[_0x2773('0x78')]();}}catch(_0x202546){handleError(_0x4f1af1['data'][_0x1fd287],{'code':_0x2773('0x79'),'message':_0x202546[_0x2773('0x42')]});logger[_0x2773('0x41')](_0x2773('0x7a'),_0x202546[_0x2773('0x42')]);}},'complete':function(){try{var _0x7dda34=[];var _0x3b0946=[];var _0x2b49f3='cm_contacts';if(_0x55418a[_0x2773('0x7b')]&&_0x55418a[_0x2773('0x7b')][_0x2773('0x4c')]){_0x2b49f3=_0x2773('0x7c')+_0x5e2826;_0x7dda34[_0x2773('0x47')](_0x2773('0x7d')+_0x2b49f3+_0x2773('0x7e'));}tmp_campaigns='campaigns_'+_0x5e2826;tmp_voice_queues=_0x2773('0x7f')+_0x5e2826;_0x3b0946[_0x2773('0x47')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x3b0946['push']('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x2773('0x80'));BPromise[_0x2773('0x81')](_0x3b0946,handleTZQuery)[_0x2773('0x53')](function(_0x5e35e8){updateTzCampaigns(_0x55418a[_0x2773('0x23')])[_0x2773('0x53')](function(_0x5609f3){updateTzVoiceQueues(_0x55418a[_0x2773('0x23')])['then'](function(_0x25508d){var _0x1602e2=util['format'](_0x2773('0x82'),_0x453c84,_0x2b49f3,_0x4e5e9f,_0x55418a[_0x2773('0x23')],_0x55418a[_0x2773('0x83')]||null,NOW,NOW);if(_[_0x2773('0x55')](_0x26e082[_0x2773('0x21')])){_0x1602e2+=_0x2773('0x84');}_0x7dda34['push'](_0x1602e2);if(_0x55418a[_0x2773('0x7b')]&&_0x55418a[_0x2773('0x7b')][_0x2773('0x4c')]){_0x7dda34[_0x2773('0x47')](insertCmContact(_0x55418a['ListId'],_0x2b49f3,_0x55418a['duplicates'],_0x26e082));_0x7dda34['push'](_0x2773('0x85')+_0x2b49f3+';');}if(hasTZ){_0x7dda34[_0x2773('0x47')](insertTzCmHopper(_0x55418a['ListId'],_0x2773('0x50'),_0x2773('0x86'),'VoiceQueueId',_0x5dcfde,tmp_voice_queues));_0x7dda34[_0x2773('0x47')](insertTzCmHopperBlack(_0x55418a['ListId'],_0x2773('0x87'),'voice_queues',_0x2773('0x88')));_0x7dda34[_0x2773('0x47')](insertTzCmHopper(_0x55418a[_0x2773('0x23')],_0x2773('0x4a'),_0x2773('0x89'),_0x2773('0x8a'),_0x5dcfde,tmp_campaigns));_0x7dda34[_0x2773('0x47')](insertTzCmHopperBlack(_0x55418a[_0x2773('0x23')],_0x2773('0x8b'),_0x2773('0x89'),_0x2773('0x8a')));}else{_0x7dda34[_0x2773('0x47')](insertCmHopper(_0x55418a[_0x2773('0x23')],_0x2773('0x50'),_0x2773('0x86'),_0x2773('0x88'),_0x5dcfde));_0x7dda34[_0x2773('0x47')](insertCmHopperBlack(_0x55418a[_0x2773('0x23')],_0x2773('0x87'),_0x2773('0x86'),_0x2773('0x88')));_0x7dda34[_0x2773('0x47')](insertCmHopper(_0x55418a[_0x2773('0x23')],'campaigns_has_cm_lists',_0x2773('0x89'),_0x2773('0x8a'),_0x5dcfde));_0x7dda34[_0x2773('0x47')](insertCmHopperBlack(_0x55418a[_0x2773('0x23')],_0x2773('0x8b'),'campaigns','CampaignId'));}_0x7dda34['push']('DROP\x20TABLE\x20'+tmp_campaigns+';');_0x7dda34[_0x2773('0x47')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise['each'](_0x7dda34,handleQuery)[_0x2773('0x53')](function(_0x1f1e61){stats[_0x2773('0x8c')]=!![];stats[_0x2773('0x8d')]=_0x55418a[_0x2773('0x7b')]&&_0x55418a[_0x2773('0x7b')][_0x2773('0x4c')]?results[0x2][_0x2773('0x8d')]:results[0x0]['affectedRows'];socket['emit'](_0x2773('0x8e')+_0x5e2826,stats);fs[_0x2773('0x8f')](_0x363f45);fs[_0x2773('0x8f')](_0x453c84);process[_0x2773('0x43')](0x0);})[_0x2773('0x48')](function(_0x57ba74){logger[_0x2773('0x41')](_0x57ba74['message']);process['exit'](0x1);});});});});}catch(_0x541f00){logger[_0x2773('0x41')](_0x2773('0x90'),_0x541f00[_0x2773('0x42')]);process[_0x2773('0x43')](0x1);}},'error':function(_0x1ec3e3,_0x3c8966,_0x54ef73,_0x54d081){throw new Error(_0x54d081);}});}function validate(){if(process[_0x2773('0x91')]&&process[_0x2773('0x91')][_0x2773('0x4c')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x57da77=path[_0x2773('0x12')](config[_0x2773('0x92')],'server/files/tmp',process[_0x2773('0x91')][0x2]);if(!fs[_0x2773('0x93')](_0x57da77)){throw new Error(_0x2773('0x94'));}var _0x1fef10={};try{_0x1fef10=JSON[_0x2773('0x63')](process[_0x2773('0x91')][0x3]);if(!_0x1fef10[_0x2773('0x95')]){throw new Error(_0x2773('0x96'));}if(!_0x1fef10['binding'][_0x2773('0x10')]){throw new Error(_0x2773('0x97'));}if(!_0x1fef10[_0x2773('0x95')]['firstName']){throw new Error(_0x2773('0x98'));}var _0xc93122=0x0;if(_0x1fef10['binding'][_0x2773('0x39')]){_0xc93122=0x1;}if(!_0x1fef10[_0x2773('0x23')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x125cb){throw new Error(_0x2773('0x99'));}var _0x4f1b22=[];try{_0x4f1b22=_[_0x2773('0x9a')](JSON[_0x2773('0x63')](process['argv'][0x4]),'id');}catch(_0x208d1b){logger['info'](_0x2773('0x9b'));}main(_0x57da77,_0x1fef10,_0x4f1b22,_0xc93122);}validate();process['on'](_0x2773('0x9c'),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 c1cab4f..266aa52 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 _0x55a7=['Date','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','outbound','Called\x20Number','membername','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','push','variable','queue','calleridnum','destcalleridnum','getDescriptions','voice','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','Queue','UniqueId'];(function(_0x2a193f,_0x10ab8e){var _0x579e2c=function(_0x492111){while(--_0x492111){_0x2a193f['push'](_0x2a193f['shift']());}};_0x579e2c(++_0x10ab8e);}(_0x55a7,0x140));var _0x755a=function(_0x396d93,_0x48c4db){_0x396d93=_0x396d93-0x0;var _0x62af0a=_0x55a7[_0x396d93];return _0x62af0a;};'use strict';exports['getSubjects']=function(_0x2668a7,_0x495916){var _0x45430f=[{'type':_0x755a('0x0'),'content':_0x755a('0x1'),'variableName':null}];switch(_0x2668a7[_0x755a('0x2')]()){case'voice':switch(_0x495916['toLowerCase']()){case'inbound':_0x45430f[_0x755a('0x3')]({'type':_0x755a('0x4'),'content':'','variableName':_0x755a('0x5')});_0x45430f[_0x755a('0x3')]({'type':_0x755a('0x4'),'content':'','variableName':_0x755a('0x6')});break;case'outbound':_0x45430f['push']({'type':_0x755a('0x0'),'content':'Outbound\x20Call','variableName':null});_0x45430f['push']({'type':_0x755a('0x4'),'content':'','variableName':_0x755a('0x7')});break;}}return _0x45430f;};exports[_0x755a('0x8')]=function(_0x2a0afa,_0x443367){var _0x3c299b=[];switch(_0x2a0afa[_0x755a('0x2')]()){case _0x755a('0x9'):switch(_0x443367[_0x755a('0x2')]()){case'inbound':_0x3c299b=[{'type':_0x755a('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x755a('0xa'),'content':'','key':_0x755a('0xb'),'keyType':_0x755a('0x4'),'variableName':_0x755a('0x6')},{'type':'keyValue','content':'','key':_0x755a('0xc'),'keyType':_0x755a('0x4'),'variableName':'calleridname'},{'type':_0x755a('0xa'),'content':'','key':_0x755a('0xd'),'keyType':'variable','variableName':'destexten'},{'type':_0x755a('0xa'),'content':'','key':_0x755a('0xe'),'keyType':'variable','variableName':_0x755a('0x5')},{'type':_0x755a('0xa'),'content':'','key':_0x755a('0xf'),'keyType':_0x755a('0x4'),'variableName':'uniqueid'},{'type':_0x755a('0xa'),'content':'','key':_0x755a('0x10'),'keyType':_0x755a('0x4'),'variableName':'agentcalledAt'},{'type':_0x755a('0x0'),'content':_0x755a('0x11'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x755a('0x12'),'keyType':_0x755a('0x4'),'variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0x755a('0x13'),'keyType':_0x755a('0x4'),'variableName':_0x755a('0x7')},{'type':'string','content':_0x755a('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x755a('0xa'),'content':'','key':_0x755a('0x15'),'keyType':_0x755a('0x4'),'variableName':_0x755a('0x16')},{'type':_0x755a('0xa'),'content':'','key':'Agent\x20Connect','keyType':_0x755a('0x4'),'variableName':_0x755a('0x17')},{'type':_0x755a('0xa'),'content':'','key':_0x755a('0x18'),'keyType':_0x755a('0x4'),'variableName':_0x755a('0x19')},{'type':_0x755a('0xa'),'content':'','key':_0x755a('0x1a'),'keyType':_0x755a('0x4'),'variableName':_0x755a('0x1b')},{'type':_0x755a('0xa'),'content':'','key':_0x755a('0x1c'),'keyType':_0x755a('0x4'),'variableName':'talktime'}];break;case _0x755a('0x1d'):_0x3c299b=[{'type':_0x755a('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':_0x755a('0x1e'),'keyType':'variable','keyContent':'','variableName':_0x755a('0x7')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0x755a('0x4'),'keyContent':'','variableName':_0x755a('0x1f')},{'type':_0x755a('0xa'),'content':'','key':'UniqueId','keyType':_0x755a('0x4'),'keyContent':'','variableName':_0x755a('0x20')},{'type':_0x755a('0xa'),'content':'','key':_0x755a('0x10'),'keyType':_0x755a('0x4'),'keyContent':'','variableName':_0x755a('0x21')},{'type':'string','content':_0x755a('0x14')},{'type':_0x755a('0xa'),'content':'','key':_0x755a('0x22'),'keyType':_0x755a('0x4'),'keyContent':'','variableName':_0x755a('0x23')},{'type':_0x755a('0xa'),'content':'','key':_0x755a('0x24'),'keyType':'variable','keyContent':'','variableName':_0x755a('0x25')},{'type':'keyValue','content':'','key':_0x755a('0x26'),'keyType':_0x755a('0x4'),'keyContent':'','variableName':_0x755a('0x27')},{'type':_0x755a('0xa'),'content':'','key':_0x755a('0x28'),'keyType':'variable','keyContent':'','variableName':_0x755a('0x29')}];break;}}return _0x3c299b;}; \ No newline at end of file +var _0x80fc=['getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Caller\x20Name','Call\x20To','destexten','Queue','queue','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Member\x20Name','UniqueId','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','toLowerCase','voice','inbound','push','variable','calleridnum','outbound','destcalleridnum'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x80fc,0x12a));var _0xc80f=function(_0x43c36d,_0x16fe90){_0x43c36d=_0x43c36d-0x0;var _0x2eb51d=_0x80fc[_0x43c36d];return _0x2eb51d;};'use strict';exports[_0xc80f('0x0')]=function(_0x134912,_0x3370de){var _0x1dd5aa=[{'type':_0xc80f('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x134912[_0xc80f('0x2')]()){case _0xc80f('0x3'):switch(_0x3370de[_0xc80f('0x2')]()){case _0xc80f('0x4'):_0x1dd5aa[_0xc80f('0x5')]({'type':'variable','content':'','variableName':'queue'});_0x1dd5aa[_0xc80f('0x5')]({'type':_0xc80f('0x6'),'content':'','variableName':_0xc80f('0x7')});break;case _0xc80f('0x8'):_0x1dd5aa[_0xc80f('0x5')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0x1dd5aa[_0xc80f('0x5')]({'type':'variable','content':'','variableName':_0xc80f('0x9')});break;}}return _0x1dd5aa;};exports[_0xc80f('0xa')]=function(_0x7f87c0,_0x5646aa){var _0x55faf4=[];switch(_0x7f87c0[_0xc80f('0x2')]()){case _0xc80f('0x3'):switch(_0x5646aa[_0xc80f('0x2')]()){case _0xc80f('0x4'):_0x55faf4=[{'type':_0xc80f('0x1'),'content':_0xc80f('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xc80f('0xc'),'keyType':_0xc80f('0x6'),'variableName':_0xc80f('0x7')},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0xe'),'keyType':_0xc80f('0x6'),'variableName':'calleridname'},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0xf'),'keyType':_0xc80f('0x6'),'variableName':_0xc80f('0x10')},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0x11'),'keyType':_0xc80f('0x6'),'variableName':_0xc80f('0x12')},{'type':_0xc80f('0xd'),'content':'','key':'UniqueId','keyType':_0xc80f('0x6'),'variableName':_0xc80f('0x13')},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0x14'),'keyType':_0xc80f('0x6'),'variableName':'agentcalledAt'},{'type':_0xc80f('0x1'),'content':_0xc80f('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0x16'),'keyType':_0xc80f('0x6'),'variableName':_0xc80f('0x17')},{'type':_0xc80f('0xd'),'content':'','key':'Agent\x20Number','keyType':_0xc80f('0x6'),'variableName':'destcalleridnum'},{'type':_0xc80f('0x1'),'content':_0xc80f('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xc80f('0xd'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':'agentcalledAt'},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0x19'),'keyType':'variable','variableName':_0xc80f('0x1a')},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0x1b'),'keyType':_0xc80f('0x6'),'variableName':_0xc80f('0x1c')},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0x1d'),'keyType':'variable','variableName':_0xc80f('0x1e')},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0x1f'),'keyType':'variable','variableName':_0xc80f('0x20')}];break;case _0xc80f('0x8'):_0x55faf4=[{'type':_0xc80f('0x1'),'content':_0xc80f('0xb'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':_0xc80f('0x6'),'keyContent':'','variableName':_0xc80f('0x9')},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0x21'),'keyType':_0xc80f('0x6'),'keyContent':'','variableName':'membername'},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0x22'),'keyType':_0xc80f('0x6'),'keyContent':'','variableName':_0xc80f('0x13')},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0x14'),'keyType':_0xc80f('0x6'),'keyContent':'','variableName':_0xc80f('0x23')},{'type':'string','content':_0xc80f('0x18')},{'type':'keyValue','content':'','key':_0xc80f('0x24'),'keyType':_0xc80f('0x6'),'keyContent':'','variableName':_0xc80f('0x25')},{'type':'keyValue','content':'','key':_0xc80f('0x26'),'keyType':'variable','keyContent':'','variableName':_0xc80f('0x27')},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0x28'),'keyType':_0xc80f('0x6'),'keyContent':'','variableName':_0xc80f('0x29')},{'type':_0xc80f('0xd'),'content':'','key':_0xc80f('0x2a'),'keyType':'variable','keyContent':'','variableName':_0xc80f('0x2b')}];break;}}return _0x55faf4;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 431b5c5..d9a4d1b 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 _0xa140=['stringify','null','Interaction','findOne','then','update','info','error','user','query','clone','omit','body','fax','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toUpperCase','role'];(function(_0x129a32,_0x263de4){var _0x35a482=function(_0x1d61a4){while(--_0x1d61a4){_0x129a32['push'](_0x129a32['shift']());}};_0x35a482(++_0x263de4);}(_0xa140,0x9a));var _0x0a14=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xa140[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0x0a14('0x0'));var db=require(_0x0a14('0x1'))['db'];var loggers={'openchannel':require(_0x0a14('0x2'))(_0x0a14('0x3')),'mail':require(_0x0a14('0x2'))(_0x0a14('0x4')),'fax':require('../../config/logger')(_0x0a14('0x5')),'sms':require('../../config/logger')(_0x0a14('0x6')),'chat':require(_0x0a14('0x2'))(_0x0a14('0x7')),'whatsapp':require(_0x0a14('0x2'))(_0x0a14('0x8'))};function getInteractionId(_0x272159,_0x2b8697,_0x18496d){if(_0x272159&&_0x272159[_[_0x0a14('0x9')](_0x18496d)+_0x0a14('0xa')]){return _0x272159[_[_0x0a14('0x9')](_0x18496d)+'InteractionId'];}else if(_0x272159&&_0x272159['id']){return _0x272159['id'];}else if(_0x2b8697&&_0x2b8697['id']){return _0x2b8697['id'];}else{return _0x0a14('0xb');}}function log(_0x19375c,_0x521937,_0x28342d,_0x5c0bc4,_0x489814,_0x327d01){loggers[_0x489814['toLowerCase']()][_0x19375c]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x327d01[_0x0a14('0xc')](),_0x521937?_0x521937['id']:null,_0x521937?_0x521937['name']:null,_0x521937?_0x521937[_0x0a14('0xd')]:null,getInteractionId(_0x28342d,_0x5c0bc4,_0x489814),_0x28342d?JSON[_0x0a14('0xe')](_0x28342d):_0x0a14('0xf'));}function updateUser(_0x1f927a,_0x138d44,_0x3ce82d,_0x41c6ec,_0x3a1f1e){db[_[_0x0a14('0x9')](_0x41c6ec)+_0x0a14('0x10')][_0x0a14('0x11')]({'where':{'id':getInteractionId(_0x138d44,_0x3ce82d,_0x41c6ec)}})[_0x0a14('0x12')](function(_0x3c8969){if(_0x3c8969){return _0x3c8969[_0x0a14('0x13')]({'UserId':_0x1f927a?_0x1f927a['id']:null});}})[_0x0a14('0x12')](function(_0x38ae3f){if(_0x38ae3f){log(_0x0a14('0x14'),_0x1f927a,_0x138d44,_0x3ce82d,_0x41c6ec,_0x3a1f1e);}})['catch'](function(){log(_0x0a14('0x15'),_0x1f927a,_0x138d44,_0x3ce82d,_0x41c6ec,_0x3a1f1e);});}exports['tracked']=function(_0x5165d6,_0x57b671){return function(_0x5b8a1a,_0x303fb3,_0x583f07){var _0x2c492d=_0x5b8a1a[_0x0a14('0x16')];var _0x6a69fd={};var _0x39a6ae=_0x5b8a1a[_0x0a14('0x17')];if(_0x6a69fd){_0x6a69fd=_[_0x0a14('0x18')](_0x5b8a1a['body']);_0x6a69fd=_[_0x0a14('0x19')](_0x6a69fd,[_0x0a14('0x1a'),'html','phone',_0x0a14('0x1b'),'mobile']);}updateUser(_0x2c492d,_0x6a69fd,_0x39a6ae,_0x5165d6,_0x57b671);_0x583f07(null);};}; \ No newline at end of file +var _0xb4a9=['openchannel-interactions','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','then','update','catch','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','lodash'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb4a9,0x1c1));var _0x9b4a=function(_0x3a2016,_0x2823bd){_0x3a2016=_0x3a2016-0x0;var _0x37f13c=_0xb4a9[_0x3a2016];return _0x37f13c;};'use strict';var _=require(_0x9b4a('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0x9b4a('0x1')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0x9b4a('0x2'))('fax-interactions'),'sms':require('../../config/logger')(_0x9b4a('0x3')),'chat':require(_0x9b4a('0x2'))(_0x9b4a('0x4')),'whatsapp':require(_0x9b4a('0x2'))(_0x9b4a('0x5'))};function getInteractionId(_0x1072d9,_0x374276,_0x5c1658){if(_0x1072d9&&_0x1072d9[_[_0x9b4a('0x6')](_0x5c1658)+_0x9b4a('0x7')]){return _0x1072d9[_['upperFirst'](_0x5c1658)+_0x9b4a('0x7')];}else if(_0x1072d9&&_0x1072d9['id']){return _0x1072d9['id'];}else if(_0x374276&&_0x374276['id']){return _0x374276['id'];}else{return _0x9b4a('0x8');}}function log(_0xc8ff78,_0x1619b6,_0xe1a1bc,_0x3b380b,_0x506306,_0xcbe559){loggers[_0x506306['toLowerCase']()][_0xc8ff78](_0x9b4a('0x9'),_0xcbe559[_0x9b4a('0xa')](),_0x1619b6?_0x1619b6['id']:null,_0x1619b6?_0x1619b6[_0x9b4a('0xb')]:null,_0x1619b6?_0x1619b6['role']:null,getInteractionId(_0xe1a1bc,_0x3b380b,_0x506306),_0xe1a1bc?JSON[_0x9b4a('0xc')](_0xe1a1bc):_0x9b4a('0xd'));}function updateUser(_0x552d72,_0x5332b0,_0xfc4062,_0x3d3ac2,_0x2f540b){db[_[_0x9b4a('0x6')](_0x3d3ac2)+_0x9b4a('0xe')][_0x9b4a('0xf')]({'where':{'id':getInteractionId(_0x5332b0,_0xfc4062,_0x3d3ac2)}})[_0x9b4a('0x10')](function(_0x510029){if(_0x510029){return _0x510029[_0x9b4a('0x11')]({'UserId':_0x552d72?_0x552d72['id']:null});}})[_0x9b4a('0x10')](function(_0x539710){if(_0x539710){log('info',_0x552d72,_0x5332b0,_0xfc4062,_0x3d3ac2,_0x2f540b);}})[_0x9b4a('0x12')](function(){log(_0x9b4a('0x13'),_0x552d72,_0x5332b0,_0xfc4062,_0x3d3ac2,_0x2f540b);});}exports[_0x9b4a('0x14')]=function(_0x511361,_0x11760a){return function(_0x5a2755,_0x534d9e,_0x38129d){var _0x358465=_0x5a2755[_0x9b4a('0x15')];var _0x104e1d={};var _0x33c967=_0x5a2755[_0x9b4a('0x16')];if(_0x104e1d){_0x104e1d=_[_0x9b4a('0x17')](_0x5a2755[_0x9b4a('0x18')]);_0x104e1d=_[_0x9b4a('0x19')](_0x104e1d,[_0x9b4a('0x18'),_0x9b4a('0x1a'),_0x9b4a('0x1b'),_0x9b4a('0x1c'),_0x9b4a('0x1d')]);}updateUser(_0x358465,_0x104e1d,_0x33c967,_0x511361,_0x11760a);_0x38129d(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 0c0de98..f74f900 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 _0xbd47=['../../mysqldb','../../config/environment','license','createDecipher','format','%s:%s:%s','base64','final','hasOwnProperty','use','License','then','json','catch','users','User','admin','isUserLimit','crypto','util','composable-middleware'];(function(_0x30602a,_0x50926e){var _0x157554=function(_0x4e8258){while(--_0x4e8258){_0x30602a['push'](_0x30602a['shift']());}};_0x157554(++_0x50926e);}(_0xbd47,0x1a1));var _0x7bd4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xbd47[_0x32f7d7];return _0x133d09;};'use strict';var crypto=require(_0x7bd4('0x0'));var util=require(_0x7bd4('0x1'));var compose=require(_0x7bd4('0x2'));var db=require(_0x7bd4('0x3'))['db'];var config=require(_0x7bd4('0x4'));function getValueFromLicense(_0x31da1d,_0x4b8c97){if(_0x31da1d&&_0x4b8c97){if(_0x4b8c97['data1']&&_0x4b8c97[_0x7bd4('0x5')]){var _0x1d3501=_0x4b8c97['data1'];var _0x818e30=_0x4b8c97[_0x7bd4('0x5')];var _0x329094=_0x1d3501['split']('-')[0x4];var _0x5f69e1=_0x1d3501['split']('-')[0x0];var _0xbf86ff=crypto[_0x7bd4('0x6')]('aes-256-ctr',util[_0x7bd4('0x7')](_0x7bd4('0x8'),_0x329094,_0x1d3501,_0x5f69e1));var _0x3a9ef3=_0xbf86ff['update'](_0x818e30,_0x7bd4('0x9'),'utf8');_0x3a9ef3+=_0xbf86ff[_0x7bd4('0xa')]('utf8');var _0x4d3505=JSON['parse'](_0x3a9ef3);return _0x4d3505[_0x7bd4('0xb')](_0x31da1d)?_0x4d3505[_0x31da1d]:null;}}return null;}function isLimit(_0x86a5ee,_0x2100ec,_0x1a12dd,_0x423ca0){var _0x3ec961=_0x2100ec;return compose()[_0x7bd4('0xc')](function(_0x582ccc,_0x30f983,_0x331064){return db[_0x7bd4('0xd')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x7bd4('0xe')](function(_0x2c573e){var _0x23b899=getValueFromLicense(_0x86a5ee,_0x2c573e);return _0x23b899?_0x23b899:_0x3ec961;})[_0x7bd4('0xe')](function(_0x61b072){_0x3ec961=_0x61b072;return _0x1a12dd['count'](_0x423ca0);})[_0x7bd4('0xe')](function(_0x1a24b1){if(_0x1a24b1>=_0x3ec961){return _0x30f983['status'](0x193)[_0x7bd4('0xf')]({'message':util[_0x7bd4('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x86a5ee)});}_0x331064();})[_0x7bd4('0x10')](function(_0x26c43e){_0x331064(_0x26c43e);});});}function isUserLimit(){return isLimit(_0x7bd4('0x11'),0x1,db[_0x7bd4('0x12')],{'where':{'$or':[{'role':_0x7bd4('0x13')},{'role':'user'}]}});}exports[_0x7bd4('0x14')]=isUserLimit; \ No newline at end of file +var _0x7b20=['update','base64','utf8','final','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','user','isUserLimit','util','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format'];(function(_0x26bbd1,_0xb274f3){var _0x26b1eb=function(_0x4cf794){while(--_0x4cf794){_0x26bbd1['push'](_0x26bbd1['shift']());}};_0x26b1eb(++_0xb274f3);}(_0x7b20,0x190));var _0x07b2=function(_0x3d9914,_0x268b4e){_0x3d9914=_0x3d9914-0x0;var _0x299080=_0x7b20[_0x3d9914];return _0x299080;};'use strict';var crypto=require('crypto');var util=require(_0x07b2('0x0'));var compose=require('composable-middleware');var db=require(_0x07b2('0x1'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0xb0f855,_0x7619db){if(_0xb0f855&&_0x7619db){if(_0x7619db[_0x07b2('0x2')]&&_0x7619db[_0x07b2('0x3')]){var _0x1799c9=_0x7619db[_0x07b2('0x2')];var _0x3e8abb=_0x7619db[_0x07b2('0x3')];var _0x43dc2d=_0x1799c9[_0x07b2('0x4')]('-')[0x4];var _0x41d0cb=_0x1799c9[_0x07b2('0x4')]('-')[0x0];var _0x3ec876=crypto[_0x07b2('0x5')](_0x07b2('0x6'),util[_0x07b2('0x7')]('%s:%s:%s',_0x43dc2d,_0x1799c9,_0x41d0cb));var _0x4f804d=_0x3ec876[_0x07b2('0x8')](_0x3e8abb,_0x07b2('0x9'),_0x07b2('0xa'));_0x4f804d+=_0x3ec876[_0x07b2('0xb')](_0x07b2('0xa'));var _0x2a19f0=JSON['parse'](_0x4f804d);return _0x2a19f0['hasOwnProperty'](_0xb0f855)?_0x2a19f0[_0xb0f855]:null;}}return null;}function isLimit(_0x50f10b,_0x15a4b9,_0x104be7,_0x1b0b44){var _0x3f38a5=_0x15a4b9;return compose()[_0x07b2('0xc')](function(_0xbbc4a2,_0x560c3c,_0xd7208){return db[_0x07b2('0xd')][_0x07b2('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x07b2('0xf')](function(_0x4be509){var _0x4e887b=getValueFromLicense(_0x50f10b,_0x4be509);return _0x4e887b?_0x4e887b:_0x3f38a5;})[_0x07b2('0xf')](function(_0x3240b2){_0x3f38a5=_0x3240b2;return _0x104be7[_0x07b2('0x10')](_0x1b0b44);})[_0x07b2('0xf')](function(_0x150ab4){if(_0x150ab4>=_0x3f38a5){return _0x560c3c[_0x07b2('0x11')](0x193)[_0x07b2('0x12')]({'message':util[_0x07b2('0x7')](_0x07b2('0x13'),_0x50f10b)});}_0xd7208();})['catch'](function(_0x33f3eb){_0xd7208(_0x33f3eb);});});}function isUserLimit(){return isLimit(_0x07b2('0x14'),0x1,db[_0x07b2('0x15')],{'where':{'$or':[{'role':'admin'},{'role':_0x07b2('0x16')}]}});}exports[_0x07b2('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 4c1bc71..1f3f6e8 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 _0x6eed=['add','hours','minutes','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','forEach','shift','filter','indexOf','map','conditions','buildExpression','DATE','operator','$eq','$between','value','$gt','YYYY-MM-DD','castTo','text','field','$notIn','\x20OR\x20','$in','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','$gte','BETWEEN\x20?\x20AND\x20?','$substring','utcOffset','format'];(function(_0x3ee8fc,_0x25babf){var _0x525fb6=function(_0x14e4b2){while(--_0x14e4b2){_0x3ee8fc['push'](_0x3ee8fc['shift']());}};_0x525fb6(++_0x25babf);}(_0x6eed,0x11d));var _0xd6ee=function(_0x587c18,_0x2eb0db){_0x587c18=_0x587c18-0x0;var _0x390c77=_0x6eed[_0x587c18];return _0x390c77;};'use strict';var _=require(_0xd6ee('0x0'));var moment=require(_0xd6ee('0x1'));exports[_0xd6ee('0x2')]=function(_0x47501f){var _0x29730b={'conditions':[]};_0x29730b[_0xd6ee('0x3')]=_[_0xd6ee('0x4')](_0x47501f,_0xd6ee('0x5'))?'or':_0xd6ee('0x6');var _0x442b67=_0x47501f[_0xd6ee('0x7')]('[$and]','')[_0xd6ee('0x7')](_0xd6ee('0x5'),'')[_0xd6ee('0x8')]('||');for(var _0x17f696=0x0;_0x17f696<_0x442b67[_0xd6ee('0x9')];_0x17f696++){var _0x490e8d=_0x442b67[_0x17f696]['split'](':=');var _0x3f05f5=_0x490e8d[0x0];var _0x131423=_0x490e8d[_0xd6ee('0xa')](0x1);_0x131423[_0xd6ee('0xb')](function(_0x1ddd29){var _0x272de6=_0x1ddd29[_0xd6ee('0x8')]('[')[_0xd6ee('0xc')]();var _0x22b7ec=_0x1ddd29['match'](/\[(.*?)\]/g);_0x22b7ec[_0xd6ee('0xb')](function(_0x5343a1){var _0x141717=_0x5343a1[_0xd6ee('0x8')]('[')[_0xd6ee('0xd')](function(_0x5dfc12){return _0x5dfc12[_0xd6ee('0xe')](']')>-0x1;})[_0xd6ee('0xf')](function(_0x3b6c67){return _0x3b6c67['split'](']')[0x0];})[0x0];_0x29730b[_0xd6ee('0x10')]['push']({'field':_0x3f05f5,'operator':_0x272de6,'value':_0x141717});});});}return _0x29730b;};exports[_0xd6ee('0x11')]=function(_0x278f27,_0x5bd201,_0x5a5f2a){var _0xd0d479={};if(_0x5bd201===_0xd6ee('0x12')){if(_0x5a5f2a[_0xd6ee('0x13')]===_0xd6ee('0x14')){_0x5a5f2a[_0xd6ee('0x13')]=_0xd6ee('0x15');_0x5a5f2a[_0xd6ee('0x16')]+=','+_0x5a5f2a[_0xd6ee('0x16')];}else if(_['includes']([_0xd6ee('0x17'),'$lte'],_0x5a5f2a['operator'])){_0x5a5f2a[_0xd6ee('0x16')]=moment(_0x5a5f2a[_0xd6ee('0x16')])['add'](0x1,'days')['format'](_0xd6ee('0x18'));}}if(_0x5a5f2a[_0xd6ee('0x19')]){_0x5bd201=_0x5a5f2a[_0xd6ee('0x19')];_0xd0d479[_0xd6ee('0x1a')]='CAST('+_0x278f27+'.'+_0x5a5f2a[_0xd6ee('0x1b')]+'\x20AS\x20'+_0x5a5f2a['castTo']+')\x20'+parseOperator(_0x5a5f2a[_0xd6ee('0x13')]);}else{_0xd0d479[_0xd6ee('0x1a')]=_0x278f27+'.'+_0x5a5f2a['field']+'\x20'+parseOperator(_0x5a5f2a[_0xd6ee('0x13')]);}if(_['includes'](['$ne',_0xd6ee('0x1c')],_0x5a5f2a[_0xd6ee('0x13')]))_0xd0d479['text']='('+_0xd0d479[_0xd6ee('0x1a')]+_0xd6ee('0x1d')+_0x278f27+'.'+_0x5a5f2a[_0xd6ee('0x1b')]+'\x20IS\x20NULL)';_0xd0d479[_0xd6ee('0x16')]=parseValue(_0x5bd201,_0x5a5f2a[_0xd6ee('0x13')],_0x5a5f2a[_0xd6ee('0x16')]);return _0xd0d479;};function parseOperator(_0x2a196b){var _0x2338a6;switch(_0x2a196b){case _0xd6ee('0x1e'):_0x2338a6='IN\x20?';break;case _0xd6ee('0x1c'):_0x2338a6=_0xd6ee('0x1f');break;case _0xd6ee('0x14'):_0x2338a6=_0xd6ee('0x20');break;case'$ne':_0x2338a6=_0xd6ee('0x21');break;case'$substring':case _0xd6ee('0x22'):case _0xd6ee('0x23'):_0x2338a6=_0xd6ee('0x24');break;case _0xd6ee('0x25'):_0x2338a6='<\x20?';break;case _0xd6ee('0x17'):_0x2338a6=_0xd6ee('0x26');break;case'$lte':_0x2338a6='<=\x20?';break;case _0xd6ee('0x27'):_0x2338a6='>=\x20?';break;case _0xd6ee('0x15'):_0x2338a6=_0xd6ee('0x28');break;}return _0x2338a6;}function parseValue(_0x441327,_0x4f26e4,_0x4c6066){var _0x30fc78={'start':undefined,'end':undefined};switch(_0x4f26e4){case _0xd6ee('0x1e'):case _0xd6ee('0x1c'):_0x30fc78['start']=_0x4c6066[_0xd6ee('0x8')](',');break;case _0xd6ee('0x29'):_0x30fc78['start']='%'+_0x4c6066+'%';break;case _0xd6ee('0x22'):_0x30fc78['start']=_0x4c6066+'%';break;case _0xd6ee('0x23'):_0x30fc78['start']='%'+_0x4c6066;break;case _0xd6ee('0x15'):var _0x1e6480=_0x4c6066[_0xd6ee('0x8')](',');var _0x4c6066=_0x1e6480[_0xd6ee('0xc')]();var _0x1489a2=_0x1e6480['pop']();if(_0x441327===_0xd6ee('0x12')){_0x4c6066=moment(_0x4c6066)[_0xd6ee('0x2a')](0x0,!![])[_0xd6ee('0x2b')]();_0x1489a2=moment(_0x1489a2)[_0xd6ee('0x2a')](0x0,!![])[_0xd6ee('0x2c')](0x17,_0xd6ee('0x2d'))[_0xd6ee('0x2c')](0x3b,_0xd6ee('0x2e'))[_0xd6ee('0x2c')](0x3b,'seconds')[_0xd6ee('0x2b')]();}_0x30fc78={'start':_0x4c6066,'end':_0x1489a2};break;default:_0x30fc78['start']=_0x4c6066;break;}return _0x30fc78;} \ No newline at end of file +var _0xa4db=['$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','shift','pop','DATE','utcOffset','hours','minutes','lodash','moment','sqlOperator','startsWith','and','replace','[$or]','length','slice','split','filter','indexOf','map','conditions','buildExpression','operator','$between','value','$gt'];(function(_0xdb8fed,_0x99fbf1){var _0x81c22f=function(_0x457469){while(--_0x457469){_0xdb8fed['push'](_0xdb8fed['shift']());}};_0x81c22f(++_0x99fbf1);}(_0xa4db,0xc9));var _0xba4d=function(_0x19152a,_0x7d57f6){_0x19152a=_0x19152a-0x0;var _0xca90a2=_0xa4db[_0x19152a];return _0xca90a2;};'use strict';var _=require(_0xba4d('0x0'));var moment=require(_0xba4d('0x1'));exports['parseSearch']=function(_0x532a9a){var _0x313aa0={'conditions':[]};_0x313aa0[_0xba4d('0x2')]=_[_0xba4d('0x3')](_0x532a9a,'[$or]')?'or':_0xba4d('0x4');var _0x42991b=_0x532a9a[_0xba4d('0x5')]('[$and]','')['replace'](_0xba4d('0x6'),'')['split']('||');for(var _0x758ebb=0x0;_0x758ebb<_0x42991b[_0xba4d('0x7')];_0x758ebb++){var _0x321d76=_0x42991b[_0x758ebb]['split'](':=');var _0x4301dc=_0x321d76[0x0];var _0x29145e=_0x321d76[_0xba4d('0x8')](0x1);_0x29145e['forEach'](function(_0x419bd3){var _0x299be1=_0x419bd3[_0xba4d('0x9')]('[')['shift']();var _0x2f69fe=_0x419bd3['match'](/\[(.*?)\]/g);_0x2f69fe['forEach'](function(_0xdd1ced){var _0x8be115=_0xdd1ced[_0xba4d('0x9')]('[')[_0xba4d('0xa')](function(_0x1d9b6e){return _0x1d9b6e[_0xba4d('0xb')](']')>-0x1;})[_0xba4d('0xc')](function(_0x37fdf9){return _0x37fdf9[_0xba4d('0x9')](']')[0x0];})[0x0];_0x313aa0[_0xba4d('0xd')]['push']({'field':_0x4301dc,'operator':_0x299be1,'value':_0x8be115});});});}return _0x313aa0;};exports[_0xba4d('0xe')]=function(_0x3ec767,_0x4147de,_0x70ab94){var _0x1de7d9={};if(_0x4147de==='DATE'){if(_0x70ab94['operator']==='$eq'){_0x70ab94[_0xba4d('0xf')]=_0xba4d('0x10');_0x70ab94[_0xba4d('0x11')]+=','+_0x70ab94[_0xba4d('0x11')];}else if(_['includes']([_0xba4d('0x12'),_0xba4d('0x13')],_0x70ab94['operator'])){_0x70ab94[_0xba4d('0x11')]=moment(_0x70ab94[_0xba4d('0x11')])[_0xba4d('0x14')](0x1,_0xba4d('0x15'))[_0xba4d('0x16')](_0xba4d('0x17'));}}if(_0x70ab94['castTo']){_0x4147de=_0x70ab94[_0xba4d('0x18')];_0x1de7d9[_0xba4d('0x19')]=_0xba4d('0x1a')+_0x3ec767+'.'+_0x70ab94[_0xba4d('0x1b')]+'\x20AS\x20'+_0x70ab94['castTo']+')\x20'+parseOperator(_0x70ab94[_0xba4d('0xf')]);}else{_0x1de7d9['text']=_0x3ec767+'.'+_0x70ab94[_0xba4d('0x1b')]+'\x20'+parseOperator(_0x70ab94[_0xba4d('0xf')]);}if(_['includes']([_0xba4d('0x1c'),_0xba4d('0x1d')],_0x70ab94[_0xba4d('0xf')]))_0x1de7d9[_0xba4d('0x19')]='('+_0x1de7d9[_0xba4d('0x19')]+_0xba4d('0x1e')+_0x3ec767+'.'+_0x70ab94[_0xba4d('0x1b')]+_0xba4d('0x1f');_0x1de7d9['value']=parseValue(_0x4147de,_0x70ab94['operator'],_0x70ab94[_0xba4d('0x11')]);return _0x1de7d9;};function parseOperator(_0x2fda50){var _0x468afb;switch(_0x2fda50){case _0xba4d('0x20'):_0x468afb='IN\x20?';break;case _0xba4d('0x1d'):_0x468afb=_0xba4d('0x21');break;case _0xba4d('0x22'):_0x468afb=_0xba4d('0x23');break;case _0xba4d('0x1c'):_0x468afb=_0xba4d('0x24');break;case _0xba4d('0x25'):case _0xba4d('0x26'):case _0xba4d('0x27'):_0x468afb=_0xba4d('0x28');break;case _0xba4d('0x29'):_0x468afb=_0xba4d('0x2a');break;case _0xba4d('0x12'):_0x468afb=_0xba4d('0x2b');break;case _0xba4d('0x13'):_0x468afb=_0xba4d('0x2c');break;case _0xba4d('0x2d'):_0x468afb=_0xba4d('0x2e');break;case _0xba4d('0x10'):_0x468afb=_0xba4d('0x2f');break;}return _0x468afb;}function parseValue(_0x2e7759,_0x57f059,_0x10188f){var _0x4f0506={'start':undefined,'end':undefined};switch(_0x57f059){case _0xba4d('0x20'):case _0xba4d('0x1d'):_0x4f0506[_0xba4d('0x30')]=_0x10188f[_0xba4d('0x9')](',');break;case _0xba4d('0x25'):_0x4f0506['start']='%'+_0x10188f+'%';break;case _0xba4d('0x26'):_0x4f0506[_0xba4d('0x30')]=_0x10188f+'%';break;case _0xba4d('0x27'):_0x4f0506[_0xba4d('0x30')]='%'+_0x10188f;break;case'$between':var _0x32c90e=_0x10188f[_0xba4d('0x9')](',');var _0x10188f=_0x32c90e[_0xba4d('0x31')]();var _0x885a13=_0x32c90e[_0xba4d('0x32')]();if(_0x2e7759===_0xba4d('0x33')){_0x10188f=moment(_0x10188f)[_0xba4d('0x34')](0x0,!![])[_0xba4d('0x16')]();_0x885a13=moment(_0x885a13)[_0xba4d('0x34')](0x0,!![])[_0xba4d('0x14')](0x17,_0xba4d('0x35'))[_0xba4d('0x14')](0x3b,_0xba4d('0x36'))[_0xba4d('0x14')](0x3b,'seconds')[_0xba4d('0x16')]();}_0x4f0506={'start':_0x10188f,'end':_0x885a13};break;default:_0x4f0506[_0xba4d('0x30')]=_0x10188f;break;}return _0x4f0506;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 108183e..c786823 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 _0x5075=['subtract','name','uniqueid','isArray','split','limit','offset','sort','map','indexOf','priority','col','unsigned','substr','DESC','cast','ASC','omit','isEmpty','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','replace','push','getOptions','query','$id','model','attributes','intersection','length','hasOwnProperty','nolimit','order','where','pick','filter','object','columns','value','merge','type','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','filters','forOwn','find','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte'];(function(_0x2bd8fe,_0x3d3a95){var _0x31744c=function(_0x510d4b){while(--_0x510d4b){_0x2bd8fe['push'](_0x2bd8fe['shift']());}};_0x31744c(++_0x3d3a95);}(_0x5075,0x73));var _0x5507=function(_0x4c79aa,_0x456fcd){_0x4c79aa=_0x4c79aa-0x0;var _0x28e73a=_0x5075[_0x4c79aa];return _0x28e73a;};'use strict';var _=require(_0x5507('0x0'));var sequelize=require(_0x5507('0x1'));var moment=require(_0x5507('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1a552a){var _0x3ec62f=['ne'];try{var _0x2b444e=JSON[_0x5507('0x3')](_0x1a552a);var _0x518ca7=Object[_0x5507('0x4')](_0x2b444e)[0x0];return _0x3ec62f[_0x5507('0x5')](_0x518ca7);}catch(_0x8fb8a3){return![];}}function getOperatorValue(_0x54267f){var _0x5b6d7f=JSON[_0x5507('0x3')](_0x54267f);var _0x773559=Object['keys'](_0x5b6d7f)[0x0];var _0x42c232=_0x5b6d7f[_0x773559];return{['$'+_0x773559]:_0x42c232};}exports[_0x5507('0x6')]=function(_0xbf4b50){var _0x504e05=null;if(_0xbf4b50){_0x504e05=_0xbf4b50['split'](',');}return _0x504e05;};exports[_0x5507('0x7')]=function(_0x441bdc,_0xbbb0fc){var _0x36c9eb={};if(!_['isEmpty'](_0x441bdc)){_[_0x5507('0x8')](_0x441bdc,function(_0x1a6792,_0x55520e){try{if(_0xbbb0fc){var _0x18601c=_[_0x5507('0x9')](_0xbbb0fc,{'name':_0x55520e})||{};if(hasSequelizeOperator(_0x1a6792)){_0x36c9eb[_0x55520e]=getOperatorValue(_0x1a6792);}else if(_0x18601c['type']===_0x5507('0xa')&&_[_0x5507('0xb')](_0x1a6792)){var _0x32c872=JSON[_0x5507('0x3')](_0x1a6792);var _0x13b60a={'$gte':moment(moment(_0x32c872[_0x5507('0xc')])['format'](_0x5507('0xd')))[_0x5507('0xe')]()[_0x5507('0xf')](),'$lte':moment(moment(_0x32c872[_0x5507('0x10')])['format'](_0x5507('0xd')))[_0x5507('0xe')]()[_0x5507('0x11')](0x1,'s')[_0x5507('0xf')]()};_0x36c9eb[_0x55520e]=_0x13b60a;}else if(_0x18601c[_0x5507('0x12')]===_0x5507('0x13')){_0x36c9eb[_0x55520e]=_0x1a6792;}else{_0x36c9eb[_0x55520e]=_[_0x5507('0x14')](_0x1a6792)?_0x1a6792:JSON[_0x5507('0x3')](_0x1a6792);}}else{_0x36c9eb[_0x55520e]=_[_0x5507('0x14')](_0x1a6792)?_0x1a6792:JSON[_0x5507('0x3')](_0x1a6792);}}catch(_0x233b6a){_0x36c9eb[_0x55520e]=_0x1a6792[_0x5507('0x15')](',');}});}return _0x36c9eb;};exports[_0x5507('0x16')]=function(_0x5ad6d7){_0x5ad6d7=parseInt(_0x5ad6d7,0xa);if(!_0x5ad6d7||_0x5ad6d7<0x0){_0x5ad6d7=LIMIT_VALUE;}return _0x5ad6d7;};exports[_0x5507('0x17')]=function(_0x276a81){_0x276a81=parseInt(_0x276a81,0xa);if(!_0x276a81||_0x276a81<0x0){_0x276a81=0x0;}return _0x276a81;};exports[_0x5507('0x18')]=function(_0x193eda){var _0x54f473,_0x1dc53e=null;if(_0x193eda){_0x54f473=_0x193eda[_0x5507('0x15')](',');_0x1dc53e=_[_0x5507('0x19')](_0x54f473,function(_0x3ca1f7){if(_0x3ca1f7[_0x5507('0x1a')]('-')===0x0){return[_0x3ca1f7===_0x5507('0x1b')?sequelize['cast'](sequelize[_0x5507('0x1c')](_0x5507('0x1b')),_0x5507('0x1d')):_0x3ca1f7[_0x5507('0x1e')](0x1),_0x5507('0x1f')];}else{return[_0x3ca1f7===_0x5507('0x1b')?sequelize[_0x5507('0x20')](sequelize[_0x5507('0x1c')](_0x5507('0x1b')),_0x5507('0x1d')):_0x3ca1f7,_0x5507('0x21')];}});}return _0x1dc53e;};exports[_0x5507('0x22')]=function(_0x164ac7,_0x2ee6ed){if(_[_0x5507('0x23')](_0x164ac7)){return _0x164ac7;}if(_['isArray'](_0x164ac7)){for(var _0x4e8906=0x0;_0x4e8906<_0x164ac7['length'];_0x4e8906+=0x1){_0x164ac7[_0x4e8906]=this[_0x5507('0x22')](_0x164ac7[_0x4e8906],_0x2ee6ed);}return _0x164ac7;}if(!_['isObject'](_0x164ac7)){return _0x164ac7;}if(_[_0x5507('0x24')](_0x2ee6ed)){_0x2ee6ed=[_0x2ee6ed];}if(!_[_0x5507('0x14')](_0x2ee6ed)){return _0x164ac7;}for(var _0x4beb0a=0x0;_0x4beb0a<_0x2ee6ed['length'];_0x4beb0a+=0x1){_[_0x5507('0x25')](_0x164ac7,_0x2ee6ed[_0x4beb0a]);}for(var _0x1a18d0 in _0x164ac7){if(_0x164ac7['hasOwnProperty'](_0x1a18d0)){_0x164ac7[_0x1a18d0]=this[_0x5507('0x22')](_0x164ac7[_0x1a18d0],_0x2ee6ed);}}return _0x164ac7;};exports[_0x5507('0x26')]=function(_0x85d383){return _0x85d383[_0x5507('0x27')](RegExp(_0x5507('0x28')))?!![]:![];};exports[_0x5507('0x29')]=function(_0x55e889){return _0x55e889[_0x5507('0x27')](/^\S+@\S+$/)?!![]:![];};exports[_0x5507('0x2a')]=function(_0x106b11){var _0x38f0f5=[];_0x106b11[_0x5507('0x15')](/[ ,]+/)['forEach'](function(_0x51e692){_0x51e692=_0x51e692[_0x5507('0x2b')](/([^:]")"+/g,'$1');_0x51e692='+'+_0x51e692+'*';var _0x37c364=/[ `!@#$%^&*()_\-?~]/;if(_0x51e692[_0x5507('0x27')](_0x37c364))_0x51e692='\x22'+_0x51e692+'\x22';_0x38f0f5[_0x5507('0x2c')](_0x51e692);});return _0x38f0f5['join']('\x20');};exports[_0x5507('0x2d')]=function(_0x13b6e5,_0xab91bc,_0x3fe39a){var _0x3cf04d={},_0x2074a={};if(_0xab91bc[_0x5507('0x2e')][_0x5507('0x2f')]){_0xab91bc['query']['id']=_0xab91bc[_0x5507('0x2e')][_0x5507('0x2f')];delete _0xab91bc[_0x5507('0x2e')]['$id'];}_0x3cf04d['model']=_[_0x5507('0x19')](_0x13b6e5,_0x5507('0x12'));_0x3cf04d[_0x5507('0x2e')]=_[_0x5507('0x4')](_0xab91bc[_0x5507('0x2e')]);_0x3cf04d['filters']=_['intersection'](_0x3cf04d[_0x5507('0x30')],_0x3cf04d[_0x5507('0x2e')]);_0x2074a[_0x5507('0x31')]=_[_0x5507('0x32')](_0x3cf04d['model'],this['fields'](_0xab91bc[_0x5507('0x2e')]['fields']));_0x2074a[_0x5507('0x31')]=_0x2074a[_0x5507('0x31')][_0x5507('0x33')]?_0x2074a[_0x5507('0x31')]:_0x3cf04d[_0x5507('0x30')];if(!_0xab91bc[_0x5507('0x2e')][_0x5507('0x34')](_0x5507('0x35'))){_0x2074a[_0x5507('0x16')]=this[_0x5507('0x16')](_0xab91bc['query']['limit']);_0x2074a['offset']=this['offset'](_0xab91bc[_0x5507('0x2e')][_0x5507('0x17')]);}_0x2074a[_0x5507('0x36')]=this[_0x5507('0x18')](_0xab91bc[_0x5507('0x2e')][_0x5507('0x18')]);_0x2074a[_0x5507('0x37')]=this[_0x5507('0x7')](_[_0x5507('0x38')](_0xab91bc[_0x5507('0x2e')],_0x3cf04d[_0x5507('0x7')]),_0x13b6e5);if(_0xab91bc[_0x5507('0x2e')][_0x5507('0x39')]){var _0x4418de=_0x13b6e5;var _0x4fe79b=_0xab91bc['query']['filter'];if(typeof _0x4fe79b===_0x5507('0x3a')){_0x4418de=_[_0x5507('0x39')](_0x13b6e5,function(_0x417022){return _[_0x5507('0x5')](_0x4fe79b[_0x5507('0x3b')],_0x417022[_0x5507('0x12')]);});_0x4fe79b=_0x4fe79b[_0x5507('0x3c')];}_0x2074a[_0x5507('0x37')]=_[_0x5507('0x3d')](_0x2074a[_0x5507('0x37')],{'$or':_[_0x5507('0x19')](_0x4418de,function(_0x192a00){if(_0x192a00[_0x5507('0x3e')]!==_0x5507('0x3f')){if(_0x3fe39a){return sequelize[_0x5507('0x37')](sequelize['fn'](_0x5507('0x40'),sequelize[_0x5507('0x1c')](_0x192a00[_0x5507('0x12')])),{'$like':sequelize['fn'](_0x5507('0x40'),'%'+_0xab91bc['query'][_0x5507('0x39')]+'%')});}else{var _0x113f74={};_0x113f74[_0x192a00['name']]={'$like':'%'+_0xab91bc['query'][_0x5507('0x39')]+'%'};return _0x113f74;}}})});}_0x2074a=_[_0x5507('0x3d')]({},_0x2074a,_0xab91bc[_0x5507('0x41')]);return _0x2074a;}; \ No newline at end of file +var _0xd8fb=['priority','cast','col','unsigned','substr','DESC','omit','length','isString','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','replace','getOptions','query','$id','model','intersection','attributes','nolimit','limit','order','sort','where','pick','filter','includes','columns','value','merge','VIRTUAL','lower','options','lodash','sequelize','moment','keys','parse','fields','filters','isEmpty','forOwn','find','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','split','offset','map','indexOf'];(function(_0x32b4aa,_0x12eba6){var _0x473160=function(_0x4906b6){while(--_0x4906b6){_0x32b4aa['push'](_0x32b4aa['shift']());}};_0x473160(++_0x12eba6);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5e7c5a,_0x732143){_0x5e7c5a=_0x5e7c5a-0x0;var _0x561be8=_0xd8fb[_0x5e7c5a];return _0x561be8;};'use strict';var _=require(_0xbd8f('0x0'));var sequelize=require(_0xbd8f('0x1'));var moment=require(_0xbd8f('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2bd369){var _0x52724c=['ne'];try{var _0x5ea933=JSON['parse'](_0x2bd369);var _0x455a12=Object[_0xbd8f('0x3')](_0x5ea933)[0x0];return _0x52724c['includes'](_0x455a12);}catch(_0x400dfb){return![];}}function getOperatorValue(_0x2343bf){var _0x5543b2=JSON[_0xbd8f('0x4')](_0x2343bf);var _0x4e97cf=Object[_0xbd8f('0x3')](_0x5543b2)[0x0];var _0x578499=_0x5543b2[_0x4e97cf];return{['$'+_0x4e97cf]:_0x578499};}exports[_0xbd8f('0x5')]=function(_0x403edc){var _0x493298=null;if(_0x403edc){_0x493298=_0x403edc['split'](',');}return _0x493298;};exports[_0xbd8f('0x6')]=function(_0x2393a9,_0x2a55b5){var _0x53a2c6={};if(!_[_0xbd8f('0x7')](_0x2393a9)){_[_0xbd8f('0x8')](_0x2393a9,function(_0x5b834b,_0x4ac253){try{if(_0x2a55b5){var _0x342bcb=_[_0xbd8f('0x9')](_0x2a55b5,{'name':_0x4ac253})||{};if(hasSequelizeOperator(_0x5b834b)){_0x53a2c6[_0x4ac253]=getOperatorValue(_0x5b834b);}else if(_0x342bcb[_0xbd8f('0xa')]==='DATE'&&_[_0xbd8f('0xb')](_0x5b834b)){var _0x159f09=JSON[_0xbd8f('0x4')](_0x5b834b);var _0x43ca5d={'$gte':moment(moment(_0x159f09[_0xbd8f('0xc')])[_0xbd8f('0xd')](_0xbd8f('0xe')))[_0xbd8f('0xf')]()[_0xbd8f('0xd')](),'$lte':moment(moment(_0x159f09['$lte'])[_0xbd8f('0xd')](_0xbd8f('0xe')))[_0xbd8f('0xf')]()[_0xbd8f('0x10')](0x1,'s')['format']()};_0x53a2c6[_0x4ac253]=_0x43ca5d;}else if(_0x342bcb[_0xbd8f('0x11')]===_0xbd8f('0x12')){_0x53a2c6[_0x4ac253]=_0x5b834b;}else{_0x53a2c6[_0x4ac253]=_['isArray'](_0x5b834b)?_0x5b834b:JSON[_0xbd8f('0x4')](_0x5b834b);}}else{_0x53a2c6[_0x4ac253]=_[_0xbd8f('0x13')](_0x5b834b)?_0x5b834b:JSON['parse'](_0x5b834b);}}catch(_0x4435b9){_0x53a2c6[_0x4ac253]=_0x5b834b[_0xbd8f('0x14')](',');}});}return _0x53a2c6;};exports['limit']=function(_0x5a572b){_0x5a572b=parseInt(_0x5a572b,0xa);if(!_0x5a572b||_0x5a572b<0x0){_0x5a572b=LIMIT_VALUE;}return _0x5a572b;};exports[_0xbd8f('0x15')]=function(_0x5d2fdb){_0x5d2fdb=parseInt(_0x5d2fdb,0xa);if(!_0x5d2fdb||_0x5d2fdb<0x0){_0x5d2fdb=0x0;}return _0x5d2fdb;};exports['sort']=function(_0x159c7b){var _0x4b5fac,_0xd706bc=null;if(_0x159c7b){_0x4b5fac=_0x159c7b[_0xbd8f('0x14')](',');_0xd706bc=_[_0xbd8f('0x16')](_0x4b5fac,function(_0x897f25){if(_0x897f25[_0xbd8f('0x17')]('-')===0x0){return[_0x897f25===_0xbd8f('0x18')?sequelize[_0xbd8f('0x19')](sequelize[_0xbd8f('0x1a')](_0xbd8f('0x18')),_0xbd8f('0x1b')):_0x897f25[_0xbd8f('0x1c')](0x1),_0xbd8f('0x1d')];}else{return[_0x897f25===_0xbd8f('0x18')?sequelize[_0xbd8f('0x19')](sequelize[_0xbd8f('0x1a')](_0xbd8f('0x18')),_0xbd8f('0x1b')):_0x897f25,'ASC'];}});}return _0xd706bc;};exports[_0xbd8f('0x1e')]=function(_0x9fa3b1,_0x1f9fcc){if(_[_0xbd8f('0x7')](_0x9fa3b1)){return _0x9fa3b1;}if(_[_0xbd8f('0x13')](_0x9fa3b1)){for(var _0x2257fd=0x0;_0x2257fd<_0x9fa3b1[_0xbd8f('0x1f')];_0x2257fd+=0x1){_0x9fa3b1[_0x2257fd]=this[_0xbd8f('0x1e')](_0x9fa3b1[_0x2257fd],_0x1f9fcc);}return _0x9fa3b1;}if(!_['isObject'](_0x9fa3b1)){return _0x9fa3b1;}if(_[_0xbd8f('0x20')](_0x1f9fcc)){_0x1f9fcc=[_0x1f9fcc];}if(!_[_0xbd8f('0x13')](_0x1f9fcc)){return _0x9fa3b1;}for(var _0x5a3a8c=0x0;_0x5a3a8c<_0x1f9fcc[_0xbd8f('0x1f')];_0x5a3a8c+=0x1){_['unset'](_0x9fa3b1,_0x1f9fcc[_0x5a3a8c]);}for(var _0x41b2a6 in _0x9fa3b1){if(_0x9fa3b1[_0xbd8f('0x21')](_0x41b2a6)){_0x9fa3b1[_0x41b2a6]=this[_0xbd8f('0x1e')](_0x9fa3b1[_0x41b2a6],_0x1f9fcc);}}return _0x9fa3b1;};exports[_0xbd8f('0x22')]=function(_0x2aefa2){return _0x2aefa2[_0xbd8f('0x23')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xbd8f('0x24')]=function(_0x14f3cb){return _0x14f3cb[_0xbd8f('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0xbd8f('0x25')]=function(_0x3d2e1b){var _0x2ac26f=[];_0x3d2e1b[_0xbd8f('0x14')](/[ ,]+/)['forEach'](function(_0x6c7345){_0x6c7345=_0x6c7345[_0xbd8f('0x26')](/([^:]")"+/g,'$1');_0x6c7345='+'+_0x6c7345+'*';var _0xb9214c=/[ `!@#$%^&*()_\-?~]/;if(_0x6c7345[_0xbd8f('0x23')](_0xb9214c))_0x6c7345='\x22'+_0x6c7345+'\x22';_0x2ac26f['push'](_0x6c7345);});return _0x2ac26f['join']('\x20');};exports[_0xbd8f('0x27')]=function(_0x3cdec2,_0x2fd6f8,_0x349299){var _0x57c0cc={},_0xe9bcec={};if(_0x2fd6f8[_0xbd8f('0x28')][_0xbd8f('0x29')]){_0x2fd6f8[_0xbd8f('0x28')]['id']=_0x2fd6f8[_0xbd8f('0x28')]['$id'];delete _0x2fd6f8[_0xbd8f('0x28')][_0xbd8f('0x29')];}_0x57c0cc[_0xbd8f('0x2a')]=_[_0xbd8f('0x16')](_0x3cdec2,_0xbd8f('0x11'));_0x57c0cc['query']=_[_0xbd8f('0x3')](_0x2fd6f8['query']);_0x57c0cc[_0xbd8f('0x6')]=_[_0xbd8f('0x2b')](_0x57c0cc[_0xbd8f('0x2a')],_0x57c0cc[_0xbd8f('0x28')]);_0xe9bcec[_0xbd8f('0x2c')]=_[_0xbd8f('0x2b')](_0x57c0cc['model'],this['fields'](_0x2fd6f8['query'][_0xbd8f('0x5')]));_0xe9bcec[_0xbd8f('0x2c')]=_0xe9bcec[_0xbd8f('0x2c')][_0xbd8f('0x1f')]?_0xe9bcec[_0xbd8f('0x2c')]:_0x57c0cc[_0xbd8f('0x2a')];if(!_0x2fd6f8[_0xbd8f('0x28')][_0xbd8f('0x21')](_0xbd8f('0x2d'))){_0xe9bcec[_0xbd8f('0x2e')]=this[_0xbd8f('0x2e')](_0x2fd6f8[_0xbd8f('0x28')][_0xbd8f('0x2e')]);_0xe9bcec[_0xbd8f('0x15')]=this[_0xbd8f('0x15')](_0x2fd6f8['query'][_0xbd8f('0x15')]);}_0xe9bcec[_0xbd8f('0x2f')]=this['sort'](_0x2fd6f8[_0xbd8f('0x28')][_0xbd8f('0x30')]);_0xe9bcec[_0xbd8f('0x31')]=this['filters'](_[_0xbd8f('0x32')](_0x2fd6f8['query'],_0x57c0cc[_0xbd8f('0x6')]),_0x3cdec2);if(_0x2fd6f8[_0xbd8f('0x28')][_0xbd8f('0x33')]){var _0x4f2ebc=_0x3cdec2;var _0x25031d=_0x2fd6f8[_0xbd8f('0x28')][_0xbd8f('0x33')];if(typeof _0x25031d==='object'){_0x4f2ebc=_[_0xbd8f('0x33')](_0x3cdec2,function(_0x3d82ef){return _[_0xbd8f('0x34')](_0x25031d[_0xbd8f('0x35')],_0x3d82ef[_0xbd8f('0x11')]);});_0x25031d=_0x25031d[_0xbd8f('0x36')];}_0xe9bcec[_0xbd8f('0x31')]=_[_0xbd8f('0x37')](_0xe9bcec[_0xbd8f('0x31')],{'$or':_['map'](_0x4f2ebc,function(_0x52c62b){if(_0x52c62b[_0xbd8f('0xa')]!==_0xbd8f('0x38')){if(_0x349299){return sequelize[_0xbd8f('0x31')](sequelize['fn'](_0xbd8f('0x39'),sequelize['col'](_0x52c62b[_0xbd8f('0x11')])),{'$like':sequelize['fn'](_0xbd8f('0x39'),'%'+_0x2fd6f8[_0xbd8f('0x28')][_0xbd8f('0x33')]+'%')});}else{var _0x753f0={};_0x753f0[_0x52c62b['name']]={'$like':'%'+_0x2fd6f8['query'][_0xbd8f('0x33')]+'%'};return _0x753f0;}}})});}_0xe9bcec=_['merge']({},_0xe9bcec,_0x2fd6f8[_0xbd8f('0x3a')]);return _0xe9bcec;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index a90dbfa..dfc0328 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x502ca3,_0x36be36){var _0x27f42c=function(_0x1e3045){while(--_0x1e3045){_0x502ca3['push'](_0x502ca3['shift']());}};_0x27f42c(++_0x36be36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 5f2a448..1cf6f74 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 _0xfc25=['digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','substring','lodash','crypto','execSync','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','createHash','update'];(function(_0x3014ce,_0x155a5d){var _0x507649=function(_0x1f8c4d){while(--_0x1f8c4d){_0x3014ce['push'](_0x3014ce['shift']());}};_0x507649(++_0x155a5d);}(_0xfc25,0x156));var _0x5fc2=function(_0x2ecb25,_0x16bbfc){_0x2ecb25=_0x2ecb25-0x0;var _0x5afa71=_0xfc25[_0x2ecb25];return _0x5afa71;};'use strict';var _=require(_0x5fc2('0x0'));var os=require('os');var crypto=require(_0x5fc2('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0x5fc2('0x2')];var config=require('../environment');function getInterfaces(){var _0x210ed1=[];var _0x3b43de=os['networkInterfaces']();var _0xf8b94c=_['orderBy'](_['keys'](_0x3b43de));for(var _0x466a59=0x0;_0x466a59<_0xf8b94c[_0x5fc2('0x3')];_0x466a59++){var _0x4bf38d=_0x3b43de[_0xf8b94c[_0x466a59]][_0x5fc2('0x4')](function(_0x15d100){return _0x15d100[_0x5fc2('0x5')]===_0x5fc2('0x6')&&_0x15d100[_0x5fc2('0x7')]===![];});_0x210ed1=_0x210ed1[_0x5fc2('0x8')](_0x4bf38d);}return _0x210ed1;}function getFirstInterface(){var _0x2002ea=_['head'](getInterfaces());return{'macAddress':_0x2002ea&&_0x2002ea['mac']?_0x2002ea[_0x5fc2('0x9')]:_0x5fc2('0xa'),'ipAddress':_0x2002ea&&_0x2002ea[_0x5fc2('0xb')]?_0x2002ea['address']:_0x5fc2('0xc')};}exports[_0x5fc2('0xd')]=getFirstInterface;function getCPUhash(){var _0x3390eb=_[_0x5fc2('0xe')](os[_0x5fc2('0xf')]()[_0x5fc2('0x10')](function(_0x121aeb){return _0x121aeb[_0x5fc2('0x11')];}))[_0x5fc2('0x12')](':');return crypto[_0x5fc2('0x13')]('md5')[_0x5fc2('0x14')](_0x3390eb)[_0x5fc2('0x15')](_0x5fc2('0x16'));}exports[_0x5fc2('0x17')]=function(){var _0x37fbf4=os[_0x5fc2('0x18')]();var _0x288eb6=/[0-9a-f-]{36}/;if(config[_0x5fc2('0x19')]&&_0x288eb6['test'](config['licenseToken'])){return config[_0x5fc2('0x19')];}else if(_0x37fbf4===_0x5fc2('0x1a')){return exec(_0x5fc2('0x1b'),{'encoding':_0x5fc2('0x1c')})[_0x5fc2('0x1d')]('\x0d\x0a','');}else{var _0x1ff05c=getFirstInterface();var _0x8c0af5=getCPUhash();var _0x338077=_0x8c0af5+'|'+os[_0x5fc2('0x1e')]()+'|'+_0x1ff05c['macAddress']+'|'+_0x1ff05c[_0x5fc2('0x1f')];var _0x4e763d=crypto[_0x5fc2('0x13')]('md5')[_0x5fc2('0x14')](_0x338077)['digest'](_0x5fc2('0x16'));return _0x4e763d[_0x5fc2('0x20')](0x0,0x8)+'-'+_0x4e763d[_0x5fc2('0x20')](0x8,0xc)+'-'+_0x4e763d[_0x5fc2('0x20')](0xc,0x10)+'-'+_0x4e763d[_0x5fc2('0x20')](0x10,0x14)+'-'+_0x4e763d[_0x5fc2('0x20')](0x14);}}; \ No newline at end of file +var _0xc6ff=['join','createHash','md5','hex','getUuid','platform','licenseToken','test','win32','utf8','hostname','macAddress','ipAddress','update','digest','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','filter','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model'];(function(_0x442310,_0x478bc1){var _0x23a334=function(_0x596de7){while(--_0x596de7){_0x442310['push'](_0x442310['shift']());}};_0x23a334(++_0x478bc1);}(_0xc6ff,0x1f1));var _0xfc6f=function(_0x58e6c3,_0x275f84){_0x58e6c3=_0x58e6c3-0x0;var _0x41fbc1=_0xc6ff[_0x58e6c3];return _0x41fbc1;};'use strict';var _=require(_0xfc6f('0x0'));var os=require('os');var crypto=require(_0xfc6f('0x1'));var machine=require(_0xfc6f('0x2'));var exec=require(_0xfc6f('0x3'))[_0xfc6f('0x4')];var config=require(_0xfc6f('0x5'));function getInterfaces(){var _0x27ce6c=[];var _0x484742=os[_0xfc6f('0x6')]();var _0x219d6d=_[_0xfc6f('0x7')](_[_0xfc6f('0x8')](_0x484742));for(var _0x3b09d1=0x0;_0x3b09d1<_0x219d6d['length'];_0x3b09d1++){var _0x34b520=_0x484742[_0x219d6d[_0x3b09d1]][_0xfc6f('0x9')](function(_0x3ccbb9){return _0x3ccbb9['family']===_0xfc6f('0xa')&&_0x3ccbb9['internal']===![];});_0x27ce6c=_0x27ce6c[_0xfc6f('0xb')](_0x34b520);}return _0x27ce6c;}function getFirstInterface(){var _0x4d71e7=_[_0xfc6f('0xc')](getInterfaces());return{'macAddress':_0x4d71e7&&_0x4d71e7['mac']?_0x4d71e7[_0xfc6f('0xd')]:_0xfc6f('0xe'),'ipAddress':_0x4d71e7&&_0x4d71e7['address']?_0x4d71e7[_0xfc6f('0xf')]:_0xfc6f('0x10')};}exports[_0xfc6f('0x11')]=getFirstInterface;function getCPUhash(){var _0xa05666=_[_0xfc6f('0x7')](os[_0xfc6f('0x12')]()[_0xfc6f('0x13')](function(_0x1018f7){return _0x1018f7[_0xfc6f('0x14')];}))[_0xfc6f('0x15')](':');return crypto[_0xfc6f('0x16')](_0xfc6f('0x17'))['update'](_0xa05666)['digest'](_0xfc6f('0x18'));}exports[_0xfc6f('0x19')]=function(){var _0x374d69=os[_0xfc6f('0x1a')]();var _0x353307=/[0-9a-f-]{36}/;if(config[_0xfc6f('0x1b')]&&_0x353307[_0xfc6f('0x1c')](config[_0xfc6f('0x1b')])){return config[_0xfc6f('0x1b')];}else if(_0x374d69===_0xfc6f('0x1d')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xfc6f('0x1e')})['replace']('\x0d\x0a','');}else{var _0x338257=getFirstInterface();var _0x210755=getCPUhash();var _0x3af01d=_0x210755+'|'+os[_0xfc6f('0x1f')]()+'|'+_0x338257[_0xfc6f('0x20')]+'|'+_0x338257[_0xfc6f('0x21')];var _0x5b47ec=crypto[_0xfc6f('0x16')]('md5')[_0xfc6f('0x22')](_0x3af01d)[_0xfc6f('0x23')]('hex');return _0x5b47ec['substring'](0x0,0x8)+'-'+_0x5b47ec[_0xfc6f('0x24')](0x8,0xc)+'-'+_0x5b47ec[_0xfc6f('0x24')](0xc,0x10)+'-'+_0x5b47ec['substring'](0x10,0x14)+'-'+_0x5b47ec[_0xfc6f('0x24')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 255fc72..1bfc30d 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 _0x0fd1=['Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','diff','decryptString','days','YYYY-MM-DD\x20HH:mm','update','finally','getUuid','License','findOrCreate','spread','error','message','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data2','data1','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED'];(function(_0x525181,_0x21b1d3){var _0x213ac3=function(_0x1cc1e7){while(--_0x1cc1e7){_0x525181['push'](_0x525181['shift']());}};_0x213ac3(++_0x21b1d3);}(_0x0fd1,0x198));var _0x10fd=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0fd1[_0x17d9e3];return _0x14192d;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0x10fd('0x0'));var BPromise=require(_0x10fd('0x1'));var pkginfo=require(_0x10fd('0x2'))(module,_0x10fd('0x3'));var db=require(_0x10fd('0x4'))['db'];var encryptor=require(_0x10fd('0x5'));var hardware=require(_0x10fd('0x6'));var logger=require(_0x10fd('0x7'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1e6d68){return new BPromise(function(_0xd5a06e,_0x560d77){var _0xd722ab=util[_0x10fd('0x8')]('%s/api/servers/%s/check?version=%s',HOST,_0x1e6d68,module[_0x10fd('0x9')][_0x10fd('0x3')]);if(oldToken){_0xd722ab=util['format'](_0x10fd('0xa'),HOST,_0x1e6d68,module[_0x10fd('0x9')][_0x10fd('0x3')],oldToken);}var _0x28aa49={'uri':_0xd722ab,'method':_0x10fd('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x28aa49)[_0x10fd('0xc')](function(_0x3266c1){_0xd5a06e(_0x3266c1);})[_0x10fd('0xd')](function(_0x2fa2ce){_0x560d77(_0x2fa2ce);});});}function manageLicense(_0x4f4cd7,_0x28b42a){var _0xdf663d=_0x28b42a[_0x10fd('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0xdf663d['data1']!==_0x4f4cd7&&!_0xdf663d[_0x10fd('0xf')]){oldToken=_0xdf663d[_0x10fd('0x10')];}httpRequest(_0x4f4cd7)[_0x10fd('0xc')](function(_0x26d959){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x26d959['active']){isOldTokenSent=![];if(!_0xdf663d[_0x10fd('0x11')]&&_0xdf663d['license']!=_0x26d959[_0x10fd('0x11')]||_0xdf663d[_0x10fd('0x11')]&&_0xdf663d[_0x10fd('0xf')]){logger[_0x10fd('0x12')](_0x10fd('0x13'));}if(_0xdf663d[_0x10fd('0x11')]&&!_0xdf663d[_0x10fd('0xf')]&&_0xdf663d['license']!=_0x26d959[_0x10fd('0x11')]){logger[_0x10fd('0x12')](_0x10fd('0x14'));}if(_0xdf663d['license']&&!_0xdf663d['data2']&&_0xdf663d['license']==_0x26d959[_0x10fd('0x11')]){return _0x28b42a;}return _0x28b42a['update']({'data1':_0x4f4cd7,'data2':null,'license':_0x26d959[_0x10fd('0x11')]});}else{if(_0x26d959[_0x10fd('0x11')]||_0xdf663d[_0x10fd('0x11')]){if(!_0xdf663d[_0x10fd('0xf')]){if(_0xdf663d[_0x10fd('0x10')]==_0x4f4cd7){GRAY_PERIOD_REASON=_0x10fd('0x15');logger[_0x10fd('0x12')](_0x10fd('0x16'));}else{GRAY_PERIOD_REASON=_0x10fd('0x17');logger[_0x10fd('0x12')](_0x10fd('0x18'),_0xdf663d[_0x10fd('0x10')],_0x4f4cd7);}logger[_0x10fd('0x12')](_0x10fd('0x19'),GRAY_PERIOD_REASON[_0x10fd('0x1a')](),moment()[_0x10fd('0x8')]('YYYY-MM-DD\x20HH:mm'));return _0x28b42a['update']({'data2':encryptor['encryptString'](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x10fd('0x1b')](encryptor[_0x10fd('0x1c')](_0xdf663d[_0x10fd('0xf')]),_0x10fd('0x1d'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0x10fd('0x8')](_0x10fd('0x1e')));isOldTokenSent=![];return _0x28b42a[_0x10fd('0x1f')]({'data1':_0x4f4cd7,'data2':null,'license':null});}}}else{if(_0xdf663d[_0x10fd('0x10')]!=_0x4f4cd7){logger[_0x10fd('0x12')](_0x10fd('0x18'),_0xdf663d[_0x10fd('0x10')],_0x4f4cd7);return _0x28b42a['update']({'data1':_0x4f4cd7,'data2':null,'license':null});}}}return _0x28b42a;})[_0x10fd('0xc')](function(_0x3c139c){_0x28b42a=_0x3c139c;})[_0x10fd('0xd')](function(_0x1a12eb){logger['error'](_0x1a12eb['message']);})[_0x10fd('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x10fd('0x21')](),_0x28b42a);},TIME);});}function defaultLicense(){var _0x3dbe31=hardware[_0x10fd('0x21')]();if(_0x3dbe31){return db[_0x10fd('0x22')][_0x10fd('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x3dbe31}})[_0x10fd('0x24')](function(_0x357f5d,_0x593428){logger[_0x10fd('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x3dbe31);manageLicense(_0x3dbe31,_0x357f5d);})[_0x10fd('0xd')](function(_0x1255f6){logger[_0x10fd('0x25')](_0x1255f6[_0x10fd('0x26')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x7b91=['YYYY-MM-DD\x20HH:mm','diff','decryptString','data2','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','version','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','GET','catch','data1','then','active','info','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','format'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7b91,0xd1));var _0x17b9=function(_0x4035a8,_0x46f350){_0x4035a8=_0x4035a8-0x0;var _0xfe1213=_0x7b91[_0x4035a8];return _0xfe1213;};'use strict';var util=require(_0x17b9('0x0'));var moment=require(_0x17b9('0x1'));var rp=require(_0x17b9('0x2'));var BPromise=require(_0x17b9('0x3'));var pkginfo=require('pkginfo')(module,_0x17b9('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x17b9('0x5'));var hardware=require(_0x17b9('0x6'));var logger=require(_0x17b9('0x7'))(_0x17b9('0x8'));var HOST=_0x17b9('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x553438){return new BPromise(function(_0x46ce5d,_0x331a00){var _0x1841ec=util['format'](_0x17b9('0xa'),HOST,_0x553438,module['exports'][_0x17b9('0x4')]);if(oldToken){_0x1841ec=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x553438,module[_0x17b9('0xb')][_0x17b9('0x4')],oldToken);}var _0x43969b={'uri':_0x1841ec,'method':_0x17b9('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x43969b)['then'](function(_0x5d0ac1){_0x46ce5d(_0x5d0ac1);})[_0x17b9('0xd')](function(_0x25aade){_0x331a00(_0x25aade);});});}function manageLicense(_0x9cb18b,_0x464722){var _0x4561c8=_0x464722['get']({'plain':!![]});if(!isOldTokenSent&&_0x4561c8[_0x17b9('0xe')]!==_0x9cb18b&&!_0x4561c8['data2']){oldToken=_0x4561c8[_0x17b9('0xe')];}httpRequest(_0x9cb18b)[_0x17b9('0xf')](function(_0x1bc0fe){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1bc0fe[_0x17b9('0x10')]){isOldTokenSent=![];if(!_0x4561c8[_0x17b9('0x8')]&&_0x4561c8[_0x17b9('0x8')]!=_0x1bc0fe[_0x17b9('0x8')]||_0x4561c8[_0x17b9('0x8')]&&_0x4561c8['data2']){logger[_0x17b9('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x4561c8['license']&&!_0x4561c8['data2']&&_0x4561c8[_0x17b9('0x8')]!=_0x1bc0fe[_0x17b9('0x8')]){logger[_0x17b9('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x4561c8[_0x17b9('0x8')]&&!_0x4561c8['data2']&&_0x4561c8[_0x17b9('0x8')]==_0x1bc0fe[_0x17b9('0x8')]){return _0x464722;}return _0x464722[_0x17b9('0x12')]({'data1':_0x9cb18b,'data2':null,'license':_0x1bc0fe['license']});}else{if(_0x1bc0fe[_0x17b9('0x8')]||_0x4561c8[_0x17b9('0x8')]){if(!_0x4561c8['data2']){if(_0x4561c8[_0x17b9('0xe')]==_0x9cb18b){GRAY_PERIOD_REASON=_0x17b9('0x13');logger[_0x17b9('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x17b9('0x14');logger[_0x17b9('0x11')](_0x17b9('0x15'),_0x4561c8[_0x17b9('0xe')],_0x9cb18b);}logger[_0x17b9('0x11')](_0x17b9('0x16'),GRAY_PERIOD_REASON[_0x17b9('0x17')](),moment()[_0x17b9('0x18')]('YYYY-MM-DD\x20HH:mm'));return _0x464722[_0x17b9('0x12')]({'data2':encryptor['encryptString'](moment()['format'](_0x17b9('0x19')))});}else{if(moment()[_0x17b9('0x1a')](encryptor[_0x17b9('0x1b')](_0x4561c8[_0x17b9('0x1c')]),_0x17b9('0x1d'))>DAYS){logger[_0x17b9('0x11')](_0x17b9('0x1e'),moment()['format'](_0x17b9('0x19')));isOldTokenSent=![];return _0x464722[_0x17b9('0x12')]({'data1':_0x9cb18b,'data2':null,'license':null});}}}else{if(_0x4561c8[_0x17b9('0xe')]!=_0x9cb18b){logger[_0x17b9('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4561c8['data1'],_0x9cb18b);return _0x464722[_0x17b9('0x12')]({'data1':_0x9cb18b,'data2':null,'license':null});}}}return _0x464722;})['then'](function(_0x153cd2){_0x464722=_0x153cd2;})[_0x17b9('0xd')](function(_0x1e41e2){logger[_0x17b9('0x1f')](_0x1e41e2[_0x17b9('0x20')]);})[_0x17b9('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x17b9('0x22')](),_0x464722);},TIME);});}function defaultLicense(){var _0x3f1814=hardware[_0x17b9('0x22')]();if(_0x3f1814){return db[_0x17b9('0x23')][_0x17b9('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x3f1814}})[_0x17b9('0x25')](function(_0x26507f,_0x360f8d){logger[_0x17b9('0x11')](_0x17b9('0x26'),_0x3f1814);manageLicense(_0x3f1814,_0x26507f);})['catch'](function(_0x48bdc7){logger[_0x17b9('0x1f')](_0x48bdc7[_0x17b9('0x20')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 0d8913e..958249a 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 _0x3fcc=['disabled','User','sequelize','col','role','count','user','telephone','users','forEach','admin','countBy','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','split','decryptString','%s:%s:%s','parse','demo','machineUuid','deadline','add','days'];(function(_0x44898c,_0x13ce31){var _0x53ccf6=function(_0x422fec){while(--_0x422fec){_0x44898c['push'](_0x44898c['shift']());}};_0x53ccf6(++_0x13ce31);}(_0x3fcc,0xd5));var _0xc3fc=function(_0x3fe273,_0x4db627){_0x3fe273=_0x3fe273-0x0;var _0x3b0948=_0x3fcc[_0x3fe273];return _0x3b0948;};'use strict';var util=require('util');var _=require(_0xc3fc('0x0'));var moment=require(_0xc3fc('0x1'));var BPromise=require(_0xc3fc('0x2'));var hardware=require(_0xc3fc('0x3'));var encryptor=require(_0xc3fc('0x4'));var db=require(_0xc3fc('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc3fc('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xc3fc('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc3fc('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xc3fc('0x8'),'machineUuid':hardware[_0xc3fc('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4e3d19){return new BPromise(function(_0x86db82,_0x1cb4ac){return db[_0xc3fc('0x9')][_0xc3fc('0xa')](_[_0xc3fc('0xb')](_0x4e3d19,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x206f41){return checkLicense(_0x206f41,null);})[_0xc3fc('0xc')](function(_0x3dc791){_0x86db82(_0x3dc791);return;})[_0xc3fc('0xd')](function(_0x2aa6db){_0x1cb4ac(_0x2aa6db);});});}function checkLicense(_0x18dde5,_0x59bb21){if(!_0x18dde5){demoLicense[_0xc3fc('0xe')]=_0x18dde5[_0xc3fc('0xf')];return demoLicense;}try{var _0x494c25=_0x59bb21||_0x18dde5[_0xc3fc('0x10')];if(_[_0xc3fc('0x11')](_0x494c25)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x22af80=_0x18dde5[_0xc3fc('0xf')];var _0x1a0a23=_0x18dde5['data2'];var _0x5b6663=_0x22af80[_0xc3fc('0x12')]('-')[0x4];var _0x6a33bd=_0x22af80[_0xc3fc('0x12')]('-')[0x0];var _0x4b1f3c=encryptor[_0xc3fc('0x13')](_0x494c25,util['format'](_0xc3fc('0x14'),_0x5b6663,_0x22af80,_0x6a33bd));var _0x535f11=JSON[_0xc3fc('0x15')](_0x4b1f3c);_0x535f11[_0xc3fc('0x16')]=![];_0x535f11[_0xc3fc('0xe')]=_0x22af80;_0x535f11[_0xc3fc('0x17')]=hardware[_0xc3fc('0x7')]();if(_0x1a0a23){var _0x4fa624=encryptor[_0xc3fc('0x13')](_0x1a0a23);_0x535f11['gray']=_0x4fa624;_0x535f11[_0xc3fc('0x18')]=moment(_0x4fa624)[_0xc3fc('0x19')](0x7,_0xc3fc('0x1a'))['format']();_0x535f11['grayReason']=_0x535f11[_0xc3fc('0xe')]!=_0x535f11['machineUuid']?'changed':_0xc3fc('0x1b');}return _0x535f11;}catch(_0x457e2f){breakingLicense[_0xc3fc('0xe')]=_0x18dde5[_0xc3fc('0xf')];breakingLicense['message']=_0x457e2f['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x29faaa,_0x1c432f){getLicense()['then'](function(_0x30186a){return db[_0xc3fc('0x1c')]['findAll']({'attributes':['role',[db[_0xc3fc('0x1d')]['fn']('COUNT',db[_0xc3fc('0x1d')][_0xc3fc('0x1e')](_0xc3fc('0x1f'))),_0xc3fc('0x20')]],'group':_0xc3fc('0x1f'),'where':{'role':{'$or':['admin',_0xc3fc('0x21'),_0xc3fc('0x22')]}},'raw':!![]})[_0xc3fc('0xc')](function(_0x147141){var _0x4ef696={'user':_0x30186a[_0xc3fc('0x23')]||0x0,'telephone':_0x30186a['telephones']||0x0};_0x147141[_0xc3fc('0x24')](function(_0x4d9749){var _0x1f6d4e=_0x4d9749[_0xc3fc('0x1f')]===_0xc3fc('0x25')?_0xc3fc('0x21'):_0x4d9749['role'];_0x4ef696[_0x1f6d4e]-=_0x4d9749[_0xc3fc('0x20')];if(_0x4ef696[_0x1f6d4e]<0x0)_0x4ef696[_0x1f6d4e]=0x0;});_0x29faaa(_0x4ef696);return;});})[_0xc3fc('0xd')](function(_0x3fd3af){_0x1c432f(_0x3fd3af);});});}function checkUserLimits(_0x2c341a){return new BPromise(function(_0x5220ed,_0x5e318d){getLimits()[_0xc3fc('0xc')](function(_0x22cec6){var _0x2ed390=_['pick'](_[_0xc3fc('0x26')](_0x2c341a,_0xc3fc('0x1f')),['admin',_0xc3fc('0x21'),'telephone']);var _0x3b40c5=(_0x2ed390[_0xc3fc('0x25')]||0x0)+(_0x2ed390[_0xc3fc('0x21')]||0x0);var _0x5892ac=_0x2ed390[_0xc3fc('0x22')]||0x0;if(_0x3b40c5>_0x22cec6[_0xc3fc('0x21')])return _0x5e318d('License\x20limit\x20reached\x20for\x20users');if(_0x5892ac>_0x22cec6[_0xc3fc('0x22')])return _0x5e318d('License\x20limit\x20reached\x20for\x20telephones');return _0x5220ed();})[_0xc3fc('0xd')](function(_0xc26ca0){_0x5e318d(_0xc26ca0);});});}module[_0xc3fc('0x27')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x0178=['parse','machineUuid','add','grayReason','changed','disabled','message','User','findAll','role','sequelize','col','count','user','telephone','users','telephones','forEach','admin','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s'];(function(_0x557e55,_0x1782b3){var _0x216e7d=function(_0x170497){while(--_0x170497){_0x557e55['push'](_0x557e55['shift']());}};_0x216e7d(++_0x1782b3);}(_0x0178,0xfe));var _0x8017=function(_0x1844c7,_0x7ee203){_0x1844c7=_0x1844c7-0x0;var _0x646725=_0x0178[_0x1844c7];return _0x646725;};'use strict';var util=require('util');var _=require(_0x8017('0x0'));var moment=require('moment');var BPromise=require(_0x8017('0x1'));var hardware=require(_0x8017('0x2'));var encryptor=require(_0x8017('0x3'));var db=require(_0x8017('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8017('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x8017('0x6')](),'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':_0x8017('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5365d9){return new BPromise(function(_0x14b115,_0x1846c1){return db[_0x8017('0x8')][_0x8017('0x9')](_[_0x8017('0xa')](_0x5365d9,{'raw':!![],'where':{'id':0x1}}))[_0x8017('0xb')](function(_0x50ede5){return checkLicense(_0x50ede5,null);})[_0x8017('0xb')](function(_0xe9bb2d){_0x14b115(_0xe9bb2d);return;})[_0x8017('0xc')](function(_0x59708e){_0x1846c1(_0x59708e);});});}function checkLicense(_0x247b75,_0x373936){if(!_0x247b75){demoLicense[_0x8017('0xd')]=_0x247b75[_0x8017('0xe')];return demoLicense;}try{var _0xf3e18d=_0x373936||_0x247b75[_0x8017('0xf')];if(_['isEmpty'](_0xf3e18d)){throw new Error(_0x8017('0x10'));}var _0x4bf34f=_0x247b75['data1'];var _0x472b53=_0x247b75[_0x8017('0x11')];var _0x31b478=_0x4bf34f['split']('-')[0x4];var _0x505e41=_0x4bf34f[_0x8017('0x12')]('-')[0x0];var _0x5ecb2b=encryptor[_0x8017('0x13')](_0xf3e18d,util[_0x8017('0x14')](_0x8017('0x15'),_0x31b478,_0x4bf34f,_0x505e41));var _0x462646=JSON[_0x8017('0x16')](_0x5ecb2b);_0x462646['demo']=![];_0x462646[_0x8017('0xd')]=_0x4bf34f;_0x462646[_0x8017('0x17')]=hardware[_0x8017('0x6')]();if(_0x472b53){var _0x2e2473=encryptor[_0x8017('0x13')](_0x472b53);_0x462646['gray']=_0x2e2473;_0x462646['deadline']=moment(_0x2e2473)[_0x8017('0x18')](0x7,'days')[_0x8017('0x14')]();_0x462646[_0x8017('0x19')]=_0x462646['uuid']!=_0x462646[_0x8017('0x17')]?_0x8017('0x1a'):_0x8017('0x1b');}return _0x462646;}catch(_0x22d4ef){breakingLicense['uuid']=_0x247b75['data1'];breakingLicense[_0x8017('0x1c')]=_0x22d4ef[_0x8017('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x328dc7,_0x3fe66b){getLicense()[_0x8017('0xb')](function(_0x55e24e){return db[_0x8017('0x1d')][_0x8017('0x1e')]({'attributes':[_0x8017('0x1f'),[db[_0x8017('0x20')]['fn']('COUNT',db[_0x8017('0x20')][_0x8017('0x21')](_0x8017('0x1f'))),_0x8017('0x22')]],'group':_0x8017('0x1f'),'where':{'role':{'$or':['admin',_0x8017('0x23'),_0x8017('0x24')]}},'raw':!![]})[_0x8017('0xb')](function(_0x3b4226){var _0x5977b8={'user':_0x55e24e[_0x8017('0x25')]||0x0,'telephone':_0x55e24e[_0x8017('0x26')]||0x0};_0x3b4226[_0x8017('0x27')](function(_0x5d9504){var _0x1bc504=_0x5d9504[_0x8017('0x1f')]===_0x8017('0x28')?_0x8017('0x23'):_0x5d9504[_0x8017('0x1f')];_0x5977b8[_0x1bc504]-=_0x5d9504[_0x8017('0x22')];if(_0x5977b8[_0x1bc504]<0x0)_0x5977b8[_0x1bc504]=0x0;});_0x328dc7(_0x5977b8);return;});})[_0x8017('0xc')](function(_0x233f01){_0x3fe66b(_0x233f01);});});}function checkUserLimits(_0x4bd4c9){return new BPromise(function(_0x3acdac,_0x1b1423){getLimits()[_0x8017('0xb')](function(_0x21a3c4){var _0x18f106=_[_0x8017('0x29')](_[_0x8017('0x2a')](_0x4bd4c9,_0x8017('0x1f')),['admin','user',_0x8017('0x24')]);var _0x4fe1f4=(_0x18f106[_0x8017('0x28')]||0x0)+(_0x18f106[_0x8017('0x23')]||0x0);var _0xd4e3d1=_0x18f106[_0x8017('0x24')]||0x0;if(_0x4fe1f4>_0x21a3c4[_0x8017('0x23')])return _0x1b1423(_0x8017('0x2b'));if(_0xd4e3d1>_0x21a3c4[_0x8017('0x24')])return _0x1b1423(_0x8017('0x2c'));return _0x3acdac();})['catch'](function(_0xd6f19){_0x1b1423(_0xd6f19);});});}module[_0x8017('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 3e7dc1e..ff98dfe 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 _0x8f4c=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x8dba4d,_0x44f9c9){var _0x44a11d=function(_0x28da03){while(--_0x28da03){_0x8dba4d['push'](_0x8dba4d['shift']());}};_0x44a11d(++_0x44f9c9);}(_0x8f4c,0x113));var _0xc8f4=function(_0x5a2a75,_0xe3a29e){_0x5a2a75=_0x5a2a75-0x0;var _0x4109c3=_0x8f4c[_0x5a2a75];return _0x4109c3;};'use strict';module[_0xc8f4('0x0')]={'DOMAIN':_0xc8f4('0x1'),'SESSION_SECRET':_0xc8f4('0x2'),'GOOGLE_ID':_0xc8f4('0x3'),'GOOGLE_SECRET':_0xc8f4('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xcf2f=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcf2f,0xa7));var _0xfcf2=function(_0xf1c010,_0xeecc0a){_0xf1c010=_0xf1c010-0x0;var _0x45ddca=_0xcf2f[_0xf1c010];return _0x45ddca;};'use strict';module[_0xfcf2('0x0')]={'DOMAIN':_0xfcf2('0x1'),'SESSION_SECRET':_0xfcf2('0x2'),'GOOGLE_ID':_0xfcf2('0x3'),'GOOGLE_SECRET':_0xfcf2('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 7b435dc..751f93c 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8661=['fileLogger','exports','../utils/loggers'];(function(_0x5eee8f,_0x3c54c3){var _0x11e333=function(_0x3ec37c){while(--_0x3ec37c){_0x5eee8f['push'](_0x5eee8f['shift']());}};_0x11e333(++_0x3c54c3);}(_0x8661,0x1b8));var _0x1866=function(_0x3fad91,_0x35b014){_0x3fad91=_0x3fad91-0x0;var _0x18ff03=_0x8661[_0x3fad91];return _0x18ff03;};'use strict';var fileLogger=require(_0x1866('0x0'))[_0x1866('0x1')];module[_0x1866('0x2')]=fileLogger; \ No newline at end of file +var _0x952c=['exports','../utils/loggers','fileLogger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x952c,0x100));var _0xc952=function(_0x40ddc0,_0x41c082){_0x40ddc0=_0x40ddc0-0x0;var _0x1aebf1=_0x952c[_0x40ddc0];return _0x1aebf1;};'use strict';var fileLogger=require(_0xc952('0x0'))[_0xc952('0x1')];module[_0xc952('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index e41a0d2..d06c9ff 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 _0x743b=['../../services/ami/index.js','../../services/agi/index.js','email','routing','exports','path','express','join','ami'];(function(_0x510d99,_0x1d9113){var _0x242894=function(_0x4e8904){while(--_0x4e8904){_0x510d99['push'](_0x510d99['shift']());}};_0x242894(++_0x1d9113);}(_0x743b,0x164));var _0xb743=function(_0x4c15af,_0x21fe8b){_0x4c15af=_0x4c15af-0x0;var _0x585a8a=_0x743b[_0x4c15af];return _0x585a8a;};'use strict';var path=require(_0xb743('0x0'));var os=require('os');var config={'apps':[{'name':_0xb743('0x1'),'script':path[_0xb743('0x2')](__dirname,'../../services/express/index.js')},{'name':_0xb743('0x3'),'script':path[_0xb743('0x2')](__dirname,_0xb743('0x4'))},{'name':'agi','script':path['join'](__dirname,_0xb743('0x5'))},{'name':_0xb743('0x6'),'script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0xb743('0x7'),'script':path[_0xb743('0x2')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path[_0xb743('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0xb743('0x8')]=config; \ No newline at end of file +var _0x22e2=['../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','express','join','../../services/express/index.js'];(function(_0x1d1c39,_0x105711){var _0x48b478=function(_0x58c648){while(--_0x58c648){_0x1d1c39['push'](_0x1d1c39['shift']());}};_0x48b478(++_0x105711);}(_0x22e2,0x1b8));var _0x222e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x22e2[_0x138adb];return _0x1b27f2;};'use strict';var path=require(_0x222e('0x0'));var os=require('os');var config={'apps':[{'name':_0x222e('0x1'),'script':path[_0x222e('0x2')](__dirname,_0x222e('0x3'))},{'name':'ami','script':path[_0x222e('0x2')](__dirname,_0x222e('0x4'))},{'name':'agi','script':path[_0x222e('0x2')](__dirname,_0x222e('0x5'))},{'name':_0x222e('0x6'),'script':path['join'](__dirname,_0x222e('0x7'))},{'name':_0x222e('0x8'),'script':path['join'](__dirname,_0x222e('0x9'))},{'name':_0x222e('0xa'),'script':path[_0x222e('0x2')](__dirname,_0x222e('0xb'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index edacccd..90718d1 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 _0x2756=['stop','disconnect','list','describe','delete','dump','pm2','bluebird','connected','start','then'];(function(_0xdfbd47,_0x46bee4){var _0x55040a=function(_0x5aaeac){while(--_0x5aaeac){_0xdfbd47['push'](_0xdfbd47['shift']());}};_0x55040a(++_0x46bee4);}(_0x2756,0x1be));var _0x6275=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x2756[_0x3a78a0];return _0x48e917;};'use strict';var pm2=require(_0x6275('0x0'));var BPromise=require(_0x6275('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x461dba,_0x1bfbed){return pm2['connect'](function(_0x1a3966){if(_0x1a3966){return _0x1bfbed(_0x1a3966);}return _0x461dba(_0x6275('0x2'));});});};exports[_0x6275('0x3')]=function(_0x4e0034){return connect()[_0x6275('0x4')](function(){return new BPromise(function(_0x5bb598,_0x160710){return pm2[_0x6275('0x3')](_0x4e0034,function(_0x16ff2d,_0x58d33b){if(_0x16ff2d){return _0x160710(_0x16ff2d);}pm2['disconnect']();return _0x5bb598(_0x58d33b);});});});};exports[_0x6275('0x5')]=function(_0x371f89){return connect()[_0x6275('0x4')](function(){return new BPromise(function(_0x11e17e,_0x19bb33){return pm2['stop'](_0x371f89,function(_0x31b33a,_0x483bdf){if(_0x31b33a){return _0x19bb33(_0x31b33a);}pm2['disconnect']();return _0x11e17e(_0x483bdf);});});});};exports['restart']=function(_0x22cc28){return connect()['then'](function(){return new BPromise(function(_0x2b3abc,_0x2beb6a){return pm2['restart'](_0x22cc28,function(_0x3204a2,_0x101809){if(_0x3204a2){return _0x2beb6a(_0x3204a2);}pm2[_0x6275('0x6')]();return _0x2b3abc(_0x101809);});});});};exports[_0x6275('0x7')]=function(){return connect()[_0x6275('0x4')](function(){return new BPromise(function(_0xe3668b,_0x450541){return pm2[_0x6275('0x7')](function(_0x9bd850,_0x349366){if(_0x9bd850){return _0x450541(_0x9bd850);}pm2[_0x6275('0x6')]();return _0xe3668b(_0x349366);});});});};exports[_0x6275('0x8')]=function(_0x283051){return connect()[_0x6275('0x4')](function(){return new BPromise(function(_0xb3afc7,_0x4857fa){return pm2[_0x6275('0x8')](_0x283051,function(_0x27974c,_0x1abed0){if(_0x27974c){return _0x4857fa(_0x27974c);}pm2[_0x6275('0x6')]();return _0xb3afc7(_0x1abed0);});});});};exports['delete']=function(_0x29f91e){return connect()[_0x6275('0x4')](function(){return new BPromise(function(_0x3299fd,_0x21f43a){return pm2[_0x6275('0x9')](_0x29f91e,function(_0x5cab32,_0x567a7a){if(_0x5cab32){return _0x21f43a(_0x5cab32);}pm2[_0x6275('0x6')]();return _0x3299fd(_0x567a7a);});});});};exports[_0x6275('0xa')]=function(){return connect()[_0x6275('0x4')](function(){return new BPromise(function(_0x58e2e0,_0x288d5c){return pm2[_0x6275('0xa')](function(_0x39c995){if(_0x39c995){return _0x288d5c(_0x39c995);}return _0x58e2e0('saved');});});});}; \ No newline at end of file +var _0x1548=['pm2','./config','connect','start','disconnect','stop','then','list','describe','delete'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1548,0x1d6));var _0x8154=function(_0x1ac3e7,_0x5050c7){_0x1ac3e7=_0x1ac3e7-0x0;var _0x5f29dc=_0x1548[_0x1ac3e7];return _0x5f29dc;};'use strict';var pm2=require(_0x8154('0x0'));var BPromise=require('bluebird');var config=require(_0x8154('0x1'));function connect(){return new BPromise(function(_0x4fe393,_0x19e8e3){return pm2[_0x8154('0x2')](function(_0x2fb741){if(_0x2fb741){return _0x19e8e3(_0x2fb741);}return _0x4fe393('connected');});});};exports[_0x8154('0x3')]=function(_0x512257){return connect()['then'](function(){return new BPromise(function(_0x1b295e,_0x4d24f5){return pm2[_0x8154('0x3')](_0x512257,function(_0x4b5661,_0x399b82){if(_0x4b5661){return _0x4d24f5(_0x4b5661);}pm2[_0x8154('0x4')]();return _0x1b295e(_0x399b82);});});});};exports[_0x8154('0x5')]=function(_0x2ebf6b){return connect()[_0x8154('0x6')](function(){return new BPromise(function(_0x51195d,_0x3b4a02){return pm2['stop'](_0x2ebf6b,function(_0x1e6ba2,_0x1c4730){if(_0x1e6ba2){return _0x3b4a02(_0x1e6ba2);}pm2['disconnect']();return _0x51195d(_0x1c4730);});});});};exports['restart']=function(_0x15cae6){return connect()[_0x8154('0x6')](function(){return new BPromise(function(_0x55e53e,_0x254fb2){return pm2['restart'](_0x15cae6,function(_0xea4421,_0x13e16f){if(_0xea4421){return _0x254fb2(_0xea4421);}pm2['disconnect']();return _0x55e53e(_0x13e16f);});});});};exports[_0x8154('0x7')]=function(){return connect()[_0x8154('0x6')](function(){return new BPromise(function(_0x493bd8,_0xc65331){return pm2[_0x8154('0x7')](function(_0x45fdb6,_0x1b6f23){if(_0x45fdb6){return _0xc65331(_0x45fdb6);}pm2[_0x8154('0x4')]();return _0x493bd8(_0x1b6f23);});});});};exports[_0x8154('0x8')]=function(_0x5d3631){return connect()[_0x8154('0x6')](function(){return new BPromise(function(_0x248e18,_0x3b9bb6){return pm2['describe'](_0x5d3631,function(_0x43113b,_0x3452e2){if(_0x43113b){return _0x3b9bb6(_0x43113b);}pm2[_0x8154('0x4')]();return _0x248e18(_0x3452e2);});});});};exports[_0x8154('0x9')]=function(_0x501579){return connect()[_0x8154('0x6')](function(){return new BPromise(function(_0x41eaa7,_0x3de3e4){return pm2[_0x8154('0x9')](_0x501579,function(_0x41ea12,_0x22f0f8){if(_0x41ea12){return _0x3de3e4(_0x41ea12);}pm2[_0x8154('0x4')]();return _0x41eaa7(_0x22f0f8);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x5af234,_0x4524e7){return pm2['dump'](function(_0x2b4ad3){if(_0x2b4ad3){return _0x4524e7(_0x2b4ad3);}return _0x5af234('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 8229c60..43b77e9 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 _0x2b36=['lastMsgAt','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','length','emit','catch','error','inspect','start','ioredis','util','../../config/environment','../logger','schedule','localhost','socket.io-emitter','redis','Setting','find','chatTimeout','then','ChatInteraction','findAll'];(function(_0x3f15d0,_0x5a270d){var _0x3107fb=function(_0x122b78){while(--_0x122b78){_0x3f15d0['push'](_0x3f15d0['shift']());}};_0x3107fb(++_0x5a270d);}(_0x2b36,0x1df));var _0x62b3=function(_0xeeb4b7,_0x151e67){_0xeeb4b7=_0xeeb4b7-0x0;var _0x1da8f2=_0x2b36[_0xeeb4b7];return _0x1da8f2;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x62b3('0x0'));var util=require(_0x62b3('0x1'));var config=require(_0x62b3('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x62b3('0x3'))(_0x62b3('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x62b3('0x5'),'port':0x18eb});var io=require(_0x62b3('0x6'))(new Redis(config[_0x62b3('0x7')]));function closeInteractions(){var _0x107081=0x0;var _0x25352a=[];return db[_0x62b3('0x8')][_0x62b3('0x9')]({'raw':!![],'attributes':['id',_0x62b3('0xa')],'where':{'id':0x1}})[_0x62b3('0xb')](function(_0x3de75d){_0x107081=_0x3de75d[_0x62b3('0xa')];if(_0x107081){return db[_0x62b3('0xc')][_0x62b3('0xd')]({'raw':!![],'attributes':['id',_0x62b3('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x3de75d[_0x62b3('0xa')],_0x62b3('0xf'))}}});}else{return[];}})['then'](function(_0x23ec37){if(_0x23ec37&&_0x23ec37['length']){_0x25352a=_[_0x62b3('0x10')](_0x23ec37||[],'id');logger[_0x62b3('0x11')](_0x62b3('0x12'),_0x25352a[_0x62b3('0x13')]());return db[_0x62b3('0xc')][_0x62b3('0x14')]({'closeReason':_0x62b3('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x25352a}});}})[_0x62b3('0xb')](function(){if(_0x25352a&&_0x25352a['length']){logger['info'](_0x62b3('0x16'),_0x25352a[_0x62b3('0x13')]());for(var _0x295d9c=0x0;_0x295d9c<_0x25352a[_0x62b3('0x17')];_0x295d9c++){io[_0x62b3('0x18')]('chatInteraction:update',{'id':_0x25352a[_0x295d9c],'closed':!![]});}}})[_0x62b3('0x19')](function(_0x5a7408){logger[_0x62b3('0x1a')]('[CHAT]\x20Error\x20closing\x20interactions',_0x5a7408?util[_0x62b3('0x1b')](_0x5a7408,{'showHidden':![],'depth':null}):'');});}exports[_0x62b3('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xabda=['minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','system','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract'];(function(_0x5cdbb5,_0x167c87){var _0x3929f5=function(_0x44d6b8){while(--_0x44d6b8){_0x5cdbb5['push'](_0x5cdbb5['shift']());}};_0x3929f5(++_0x167c87);}(_0xabda,0x12f));var _0xaabd=function(_0x4bb593,_0x272ed0){_0x4bb593=_0x4bb593-0x0;var _0x2da2d8=_0xabda[_0x4bb593];return _0x2da2d8;};'use strict';var _=require(_0xaabd('0x0'));var moment=require(_0xaabd('0x1'));var Redis=require(_0xaabd('0x2'));var util=require(_0xaabd('0x3'));var config=require(_0xaabd('0x4'));var db=require(_0xaabd('0x5'))['db'];var logger=require(_0xaabd('0x6'))('schedule');config[_0xaabd('0x7')]=_['defaults'](config[_0xaabd('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x19add5=0x0;var _0x4ddac0=[];return db[_0xaabd('0x8')][_0xaabd('0x9')]({'raw':!![],'attributes':['id',_0xaabd('0xa')],'where':{'id':0x1}})[_0xaabd('0xb')](function(_0x2fba87){_0x19add5=_0x2fba87[_0xaabd('0xa')];if(_0x19add5){return db[_0xaabd('0xc')][_0xaabd('0xd')]({'raw':!![],'attributes':['id',_0xaabd('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xaabd('0xf')](_0x2fba87[_0xaabd('0xa')],_0xaabd('0x10'))}}});}else{return[];}})[_0xaabd('0xb')](function(_0x4170b2){if(_0x4170b2&&_0x4170b2[_0xaabd('0x11')]){_0x4ddac0=_[_0xaabd('0x12')](_0x4170b2||[],'id');logger['info'](_0xaabd('0x13'),_0x4ddac0[_0xaabd('0x14')]());return db['ChatInteraction']['update']({'closeReason':_0xaabd('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xaabd('0x16')](_0xaabd('0x17'))},{'where':{'id':_0x4ddac0}});}})[_0xaabd('0xb')](function(){if(_0x4ddac0&&_0x4ddac0['length']){logger[_0xaabd('0x18')](_0xaabd('0x19'),_0x4ddac0[_0xaabd('0x14')]());for(var _0x561e68=0x0;_0x561e68<_0x4ddac0['length'];_0x561e68++){io[_0xaabd('0x1a')](_0xaabd('0x1b'),{'id':_0x4ddac0[_0x561e68],'closed':!![]});}}})['catch'](function(_0x273300){logger[_0xaabd('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x273300?util['inspect'](_0x273300,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index caa3f7a..6613f17 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2123=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2123,0xec));var _0x3212=function(_0x5d9d91,_0x206c4e){_0x5d9d91=_0x5d9d91-0x0;var _0x525a7b=_0x2123[_0x5d9d91];return _0x525a7b;};'use strict';function start(){var _0x322812=require(_0x3212('0x0'));return _0x322812[_0x3212('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x14e8=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x4e8d75,_0x400022){var _0x3329d6=function(_0x11eb89){while(--_0x11eb89){_0x4e8d75['push'](_0x4e8d75['shift']());}};_0x3329d6(++_0x400022);}(_0x14e8,0xda));var _0x814e=function(_0x47e68c,_0x4d6cd5){_0x47e68c=_0x47e68c-0x0;var _0x5fade6=_0x14e8[_0x47e68c];return _0x5fade6;};'use strict';function start(){var _0x42c308=require(_0x814e('0x0'));return _0x42c308[_0x814e('0x1')]();}module[_0x814e('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 5dfa9db..d8c85e4 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 _0xf304=['active','endAt','update\x20cron','stop\x20cron','start','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','email','MailAccount','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','join','existsSync','status','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','Sent','message','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','CloudProvider','toString','difference','length','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','add\x20cron','stop','exists'];(function(_0x37a505,_0x319129){var _0x5d094e=function(_0x5b78ea){while(--_0x5b78ea){_0x37a505['push'](_0x37a505['shift']());}};_0x5d094e(++_0x319129);}(_0xf304,0x19f));var _0x4f30=function(_0x2ca892,_0x11af43){_0x2ca892=_0x2ca892-0x0;var _0x3d3f77=_0xf304[_0x2ca892];return _0x3d3f77;};'use strict';var fs=require('fs');var util=require(_0x4f30('0x0'));var path=require(_0x4f30('0x1'));var _=require(_0x4f30('0x2'));var moment=require(_0x4f30('0x3'));var CronJobManager=require(_0x4f30('0x4'));var jayson=require(_0x4f30('0x5'));var BPromise=require(_0x4f30('0x6'));var logger=require('../logger')('schedule');var db=require(_0x4f30('0x7'))['db'];var analyticCustomReportController=require(_0x4f30('0x8'));var analyticDefaultReportController=require(_0x4f30('0x9'));var client=jayson['client'][_0x4f30('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4d48f2,_0x51146c){return function(){logger[_0x4f30('0xb')](_0x4f30('0xc'),_0x4d48f2['email']);var _0x3ac159=!![];var _0x2abe93=_0x4d48f2['MailAccount'][_0x4f30('0xd')]();var _0x5ae5f7={'account':_0x2abe93,'message':{'from':util[_0x4f30('0xe')](_0x4f30('0xf'),_0x4d48f2['MailAccount'][_0x4f30('0x10')],_0x4d48f2['MailAccount'][_0x4f30('0x11')]||_0x4d48f2[_0x4f30('0x12')][_0x4f30('0x13')]['user']),'to':_0x4d48f2[_0x4f30('0x11')],'cc':_0x4d48f2['cc'],'bcc':_0x4d48f2[_0x4f30('0x14')],'subject':util['format'](_0x4f30('0x15'),_0x51146c[_0x4f30('0x10')],_0x4d48f2[_0x4f30('0x16')],_0x4d48f2[_0x4f30('0x17')])}};var _0x35abc5=path['join'](__dirname,_0x4f30('0x18'));var _0x4e0fbc=_0x51146c[_0x4f30('0x19')];var _0x2ccb1a=util['format'](_0x4f30('0x1a'),path[_0x4f30('0x1b')](_0x51146c[_0x4f30('0x19')],path[_0x4f30('0x1c')](_0x51146c[_0x4f30('0x19')])),'zip');var _0x2ade19=path['join'](_0x35abc5,_0x4e0fbc);var _0x42e750=path[_0x4f30('0x1d')](_0x35abc5,_0x2ccb1a);if(fs[_0x4f30('0x1e')](_0x2ade19)){_0x51146c[_0x4f30('0x1f')]='Sent';_0x5ae5f7['message']['attachments']=[{'filename':_0x4e0fbc,'path':_0x2ade19}];_0x5ae5f7['message'][_0x4f30('0x20')]=util[_0x4f30('0xe')](_0x4f30('0x21'),JSON[_0x4f30('0x22')](_0x51146c,null,0x2));}else if(fs[_0x4f30('0x1e')](_0x42e750)){_0x51146c[_0x4f30('0x1f')]=_0x4f30('0x23');_0x5ae5f7[_0x4f30('0x24')][_0x4f30('0x25')]=[{'filename':_0x2ccb1a,'path':_0x42e750}];}else{_0x5ae5f7[_0x4f30('0x24')][_0x4f30('0x20')]=_0x4f30('0x26');if(!_0x4d48f2[_0x4f30('0x27')]){_0x3ac159=![];logger['info'](_0x4f30('0x28'));}}if(_0x3ac159){return client[_0x4f30('0x29')](_0x4f30('0x2a'),_0x5ae5f7)[_0x4f30('0x2b')](function(_0x4ab7b4){if(_0x4ab7b4[_0x4f30('0x2c')]){return logger[_0x4f30('0x2c')](_0x4f30('0x2d'),JSON[_0x4f30('0x22')](_0x4ab7b4));}return logger[_0x4f30('0xb')]('email\x20sent');})[_0x4f30('0x2e')](function(_0x3ca528){return logger[_0x4f30('0x2c')]('error\x20mail',JSON['stringify'](_0x3ca528));});}};}function handleError(){return function(_0x124f90){return logger[_0x4f30('0x2c')](JSON[_0x4f30('0x22')](_0x124f90));};}function handleResult(_0x4724aa){return function(_0x57162e){logger['info'](_0x4f30('0x2f'),JSON['stringify'](_0x57162e));if(_0x4724aa[_0x4f30('0x12')]&&_0x4724aa[_0x4f30('0x12')]['Smtp']&&!_[_0x4f30('0x30')](_0x4724aa[_0x4f30('0x11')])){setTimeout(handleSendEmail(_0x4724aa,_0x57162e),0x3c*0x3e8);}};}function handleJob(_0x10119a){return function(){try{if(_[_0x4f30('0x30')](_0x10119a[_0x4f30('0x16')])){return logger[_0x4f30('0xb')](_0x4f30('0x31'));}if(_['isNil'](_0x10119a[_0x4f30('0x17')])){return logger[_0x4f30('0xb')](_0x4f30('0x32'));}var _0x34f1b2={'startDate':moment()['subtract'](_0x10119a[_0x4f30('0x16')],_0x10119a['subtractUnit'])[_0x4f30('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x4f30('0xe')](_0x4f30('0x33')),'type':'scheduled','output':_0x10119a[_0x4f30('0x34')],'name':_0x10119a[_0x4f30('0x10')]};if(!_[_0x4f30('0x30')](_0x10119a[_0x4f30('0x35')])){logger[_0x4f30('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x10119a['DefaultReportId']);return analyticDefaultReportController[_0x4f30('0x36')]({'id':_0x10119a[_0x4f30('0x35')]},_0x34f1b2)[_0x4f30('0x2b')](handleResult(_0x10119a))[_0x4f30('0x2e')](handleError());}if(!_['isNil'](_0x10119a[_0x4f30('0x37')])){logger['info'](_0x4f30('0x38'),_0x10119a['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x10119a[_0x4f30('0x37')]},_0x34f1b2)['then'](handleResult(_0x10119a))['catch'](handleError());}}catch(_0x2d6313){logger[_0x4f30('0x2c')](JSON[_0x4f30('0x22')](_0x2d6313));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x579fe9){var _0x1107e9={};if(_0x579fe9){_0x1107e9['id']=_0x579fe9;}return db[_0x4f30('0x39')][_0x4f30('0x3a')]({'where':_0x1107e9,'include':[{'model':db[_0x4f30('0x12')],'attributes':['id',_0x4f30('0x10'),_0x4f30('0x11')],'include':[{'model':db[_0x4f30('0x3b')],'as':_0x4f30('0x13'),'include':[{'model':db[_0x4f30('0x3c')],'as':_0x4f30('0x3c')}]}]}]})['then'](function(_0x332481){var _0x3a148c=_['keys'](manager['jobs']);var _0x4ca433=_['map'](_0x332481,function(_0x3103e5){return _0x3103e5['id']['toString']();});var _0x5bfb48=_['keyBy'](_0x332481,function(_0x15f468){return _0x15f468['id'][_0x4f30('0x3d')]();});var _0x408c0e=_0x579fe9?_0x4ca433:_[_0x4f30('0x3e')](_0x4ca433,_0x3a148c);var _0x14f766=_['intersection'](_0x4ca433,_0x3a148c);var _0x50ce15=_[_0x4f30('0x3e')](_0x3a148c,_0x4ca433);var _0x207dad;var _0x198b7a;for(_0x207dad=0x0;_0x207dad<_0x50ce15[_0x4f30('0x3f')]&&!_0x579fe9;_0x207dad+=0x1){_0x198b7a=_0x50ce15[_0x207dad]['toString']();if(manager['exists'](_0x198b7a)){manager['stop'](_0x198b7a);manager[_0x4f30('0x40')](_0x198b7a);logger[_0x4f30('0xb')](_0x4f30('0x41'),_0x198b7a);}}logger[_0x4f30('0xb')](_0x4f30('0x42'),JSON[_0x4f30('0x22')](_0x408c0e));for(_0x207dad=0x0;_0x207dad<_0x408c0e['length'];_0x207dad+=0x1){_0x198b7a=_0x408c0e[_0x207dad]['toString']();logger['info'](_0x4f30('0x43'),_0x198b7a);if(_0x579fe9){logger[_0x4f30('0xb')](_0x4f30('0x44'),_0x579fe9);logger[_0x4f30('0xb')](JSON[_0x4f30('0x22')](_0x5bfb48[_0x198b7a]));BPromise[_0x4f30('0x45')]()[_0x4f30('0x2b')](handleJob(_0x5bfb48[_0x198b7a]));logger['info'](_0x4f30('0x46'),_0x5bfb48[_0x198b7a][_0x4f30('0x10')],_0x5bfb48[_0x198b7a][_0x4f30('0x47')]);}else if(_0x5bfb48[_0x198b7a][_0x4f30('0x47')]&&_0x5bfb48[_0x198b7a]['active']&&moment()[_0x4f30('0x48')](_0x5bfb48[_0x198b7a][_0x4f30('0x49')],_0x5bfb48[_0x198b7a]['endAt'])){manager['add'](_0x198b7a,_0x5bfb48[_0x198b7a][_0x4f30('0x47')],handleJob(_0x5bfb48[_0x198b7a]));manager['start'](_0x198b7a);logger[_0x4f30('0xb')](_0x4f30('0x4a'),_0x5bfb48[_0x198b7a][_0x4f30('0x10')],_0x5bfb48[_0x198b7a][_0x4f30('0x47')]);}else if(manager['exists'](_0x198b7a)){manager[_0x4f30('0x4b')](_0x198b7a);manager[_0x4f30('0x40')](_0x198b7a);logger[_0x4f30('0xb')]('stop\x20cron',_0x5bfb48[_0x198b7a][_0x4f30('0x10')],_0x5bfb48[_0x198b7a][_0x4f30('0x47')]);}}for(_0x207dad=0x0,_0x198b7a;_0x207dad<_0x14f766['length']&&!_0x579fe9;_0x207dad+=0x1){_0x198b7a=_0x14f766[_0x207dad][_0x4f30('0x3d')]();if(manager[_0x4f30('0x4c')](_0x198b7a)){if(_0x5bfb48[_0x198b7a][_0x4f30('0x47')]&&_0x5bfb48[_0x198b7a][_0x4f30('0x4d')]&&moment()[_0x4f30('0x48')](_0x5bfb48[_0x198b7a]['startAt'],_0x5bfb48[_0x198b7a][_0x4f30('0x4e')])){manager['update'](_0x198b7a,_0x5bfb48[_0x198b7a][_0x4f30('0x47')],handleJob(_0x5bfb48[_0x198b7a]));logger[_0x4f30('0xb')](_0x4f30('0x4f'),_0x5bfb48[_0x198b7a][_0x4f30('0x10')],_0x5bfb48[_0x198b7a][_0x4f30('0x47')]);}else{manager['stop'](_0x198b7a);manager[_0x4f30('0x40')](_0x198b7a);logger[_0x4f30('0xb')](_0x4f30('0x50'),_0x5bfb48[_0x198b7a]['name'],_0x5bfb48[_0x198b7a][_0x4f30('0x47')]);}}}})[_0x4f30('0x2e')](function(_0x15698e){logger[_0x4f30('0x2c')](JSON[_0x4f30('0x22')](_0x15698e));});}exports['run']=function(_0x385806){return getJobs(_0x385806);};exports[_0x4f30('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xca67=['extname','zip','existsSync','status','message','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','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','email\x20sent','catch','error\x20mail','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keys','jobs','map','keyBy','toString','difference','intersection','exists','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','startAt','add','start','add\x20cron','stop','deleteJob','length','isBetween','endAt','update','stop\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','client','getSmtpOptions','format','name','MailAccount','user','email','bcc','subtractNumber','subtractUnit','join','../../files/reports','savename'];(function(_0x3f6929,_0x4e4cdd){var _0xb85424=function(_0x25c937){while(--_0x25c937){_0x3f6929['push'](_0x3f6929['shift']());}};_0xb85424(++_0x4e4cdd);}(_0xca67,0x197));var _0x7ca6=function(_0x5f004b,_0x52506f){_0x5f004b=_0x5f004b-0x0;var _0x3a6fcf=_0xca67[_0x5f004b];return _0x3a6fcf;};'use strict';var fs=require('fs');var util=require(_0x7ca6('0x0'));var path=require(_0x7ca6('0x1'));var _=require(_0x7ca6('0x2'));var moment=require(_0x7ca6('0x3'));var CronJobManager=require(_0x7ca6('0x4'));var jayson=require(_0x7ca6('0x5'));var BPromise=require(_0x7ca6('0x6'));var logger=require(_0x7ca6('0x7'))(_0x7ca6('0x8'));var db=require(_0x7ca6('0x9'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x7ca6('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2a8dd3,_0x3b9406){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x2a8dd3['email']);var _0x5147af=!![];var _0x205100=_0x2a8dd3['MailAccount'][_0x7ca6('0xb')]();var _0xa9d963={'account':_0x205100,'message':{'from':util[_0x7ca6('0xc')]('\x22%s\x22\x20<%s>',_0x2a8dd3['MailAccount'][_0x7ca6('0xd')],_0x2a8dd3[_0x7ca6('0xe')]['email']||_0x2a8dd3[_0x7ca6('0xe')]['Smtp'][_0x7ca6('0xf')]),'to':_0x2a8dd3[_0x7ca6('0x10')],'cc':_0x2a8dd3['cc'],'bcc':_0x2a8dd3[_0x7ca6('0x11')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x3b9406[_0x7ca6('0xd')],_0x2a8dd3[_0x7ca6('0x12')],_0x2a8dd3[_0x7ca6('0x13')])}};var _0x11d523=path[_0x7ca6('0x14')](__dirname,_0x7ca6('0x15'));var _0x3a0bb8=_0x3b9406[_0x7ca6('0x16')];var _0x148144=util[_0x7ca6('0xc')]('%s.%s',path['basename'](_0x3b9406[_0x7ca6('0x16')],path[_0x7ca6('0x17')](_0x3b9406[_0x7ca6('0x16')])),_0x7ca6('0x18'));var _0x59bf14=path[_0x7ca6('0x14')](_0x11d523,_0x3a0bb8);var _0x58cf26=path[_0x7ca6('0x14')](_0x11d523,_0x148144);if(fs[_0x7ca6('0x19')](_0x59bf14)){_0x3b9406[_0x7ca6('0x1a')]='Sent';_0xa9d963[_0x7ca6('0x1b')][_0x7ca6('0x1c')]=[{'filename':_0x3a0bb8,'path':_0x59bf14}];_0xa9d963[_0x7ca6('0x1b')][_0x7ca6('0x1d')]=util[_0x7ca6('0xc')](_0x7ca6('0x1e'),JSON[_0x7ca6('0x1f')](_0x3b9406,null,0x2));}else if(fs['existsSync'](_0x58cf26)){_0x3b9406[_0x7ca6('0x1a')]='Sent';_0xa9d963[_0x7ca6('0x1b')][_0x7ca6('0x1c')]=[{'filename':_0x148144,'path':_0x58cf26}];}else{_0xa9d963[_0x7ca6('0x1b')][_0x7ca6('0x1d')]=_0x7ca6('0x20');if(!_0x2a8dd3[_0x7ca6('0x21')]){_0x5147af=![];logger[_0x7ca6('0x22')](_0x7ca6('0x23'));}}if(_0x5147af){return client[_0x7ca6('0x24')](_0x7ca6('0x25'),_0xa9d963)[_0x7ca6('0x26')](function(_0x272998){if(_0x272998[_0x7ca6('0x27')]){return logger[_0x7ca6('0x27')]('error\x20mail',JSON[_0x7ca6('0x1f')](_0x272998));}return logger[_0x7ca6('0x22')](_0x7ca6('0x28'));})[_0x7ca6('0x29')](function(_0x3e0a02){return logger[_0x7ca6('0x27')](_0x7ca6('0x2a'),JSON['stringify'](_0x3e0a02));});}};}function handleError(){return function(_0x48cbc5){return logger[_0x7ca6('0x27')](JSON[_0x7ca6('0x1f')](_0x48cbc5));};}function handleResult(_0x520802){return function(_0x22e4d6){logger[_0x7ca6('0x22')]('data',JSON[_0x7ca6('0x1f')](_0x22e4d6));if(_0x520802['MailAccount']&&_0x520802[_0x7ca6('0xe')][_0x7ca6('0x2b')]&&!_[_0x7ca6('0x2c')](_0x520802['email'])){setTimeout(handleSendEmail(_0x520802,_0x22e4d6),0x3c*0x3e8);}};}function handleJob(_0x603659){return function(){try{if(_['isNil'](_0x603659[_0x7ca6('0x12')])){return logger[_0x7ca6('0x22')](_0x7ca6('0x2d'));}if(_['isNil'](_0x603659[_0x7ca6('0x13')])){return logger['info'](_0x7ca6('0x2e'));}var _0xa1eaa8={'startDate':moment()['subtract'](_0x603659[_0x7ca6('0x12')],_0x603659[_0x7ca6('0x13')])[_0x7ca6('0xc')](_0x7ca6('0x2f')),'endDate':moment()[_0x7ca6('0xc')](_0x7ca6('0x2f')),'type':_0x7ca6('0x30'),'output':_0x603659[_0x7ca6('0x31')],'name':_0x603659[_0x7ca6('0xd')]};if(!_[_0x7ca6('0x2c')](_0x603659[_0x7ca6('0x32')])){logger[_0x7ca6('0x22')](_0x7ca6('0x33'),_0x603659[_0x7ca6('0x32')]);return analyticDefaultReportController[_0x7ca6('0x34')]({'id':_0x603659[_0x7ca6('0x32')]},_0xa1eaa8)[_0x7ca6('0x26')](handleResult(_0x603659))[_0x7ca6('0x29')](handleError());}if(!_['isNil'](_0x603659[_0x7ca6('0x35')])){logger[_0x7ca6('0x22')]('exec\x20custom\x20report\x20id:%s',_0x603659['CustomReportId']);return analyticCustomReportController[_0x7ca6('0x34')]({'id':_0x603659['CustomReportId']},_0xa1eaa8)[_0x7ca6('0x26')](handleResult(_0x603659))[_0x7ca6('0x29')](handleError());}}catch(_0x9fd62d){logger[_0x7ca6('0x27')](JSON[_0x7ca6('0x1f')](_0x9fd62d));}return logger[_0x7ca6('0x22')](_0x7ca6('0x36'));};}function getJobs(_0x3372fa){var _0x1b748c={};if(_0x3372fa){_0x1b748c['id']=_0x3372fa;}return db['Schedule'][_0x7ca6('0x37')]({'where':_0x1b748c,'include':[{'model':db['MailAccount'],'attributes':['id',_0x7ca6('0xd'),_0x7ca6('0x10')],'include':[{'model':db[_0x7ca6('0x38')],'as':'Smtp','include':[{'model':db[_0x7ca6('0x39')],'as':_0x7ca6('0x39')}]}]}]})['then'](function(_0x55b547){var _0x581210=_[_0x7ca6('0x3a')](manager[_0x7ca6('0x3b')]);var _0xe4b065=_[_0x7ca6('0x3c')](_0x55b547,function(_0x461092){return _0x461092['id']['toString']();});var _0x129a58=_[_0x7ca6('0x3d')](_0x55b547,function(_0x15c2f1){return _0x15c2f1['id'][_0x7ca6('0x3e')]();});var _0x5c9ff7=_0x3372fa?_0xe4b065:_[_0x7ca6('0x3f')](_0xe4b065,_0x581210);var _0x1b4e58=_[_0x7ca6('0x40')](_0xe4b065,_0x581210);var _0x48cf71=_[_0x7ca6('0x3f')](_0x581210,_0xe4b065);var _0x1f9a53;var _0xc9441c;for(_0x1f9a53=0x0;_0x1f9a53<_0x48cf71['length']&&!_0x3372fa;_0x1f9a53+=0x1){_0xc9441c=_0x48cf71[_0x1f9a53]['toString']();if(manager[_0x7ca6('0x41')](_0xc9441c)){manager['stop'](_0xc9441c);manager['deleteJob'](_0xc9441c);logger[_0x7ca6('0x22')](_0x7ca6('0x42'),_0xc9441c);}}logger['info'](_0x7ca6('0x43'),JSON['stringify'](_0x5c9ff7));for(_0x1f9a53=0x0;_0x1f9a53<_0x5c9ff7['length'];_0x1f9a53+=0x1){_0xc9441c=_0x5c9ff7[_0x1f9a53][_0x7ca6('0x3e')]();logger['info'](_0x7ca6('0x44'),_0xc9441c);if(_0x3372fa){logger[_0x7ca6('0x22')](_0x7ca6('0x45'),_0x3372fa);logger[_0x7ca6('0x22')](JSON[_0x7ca6('0x1f')](_0x129a58[_0xc9441c]));BPromise[_0x7ca6('0x46')]()['then'](handleJob(_0x129a58[_0xc9441c]));logger[_0x7ca6('0x22')](_0x7ca6('0x47'),_0x129a58[_0xc9441c][_0x7ca6('0xd')],_0x129a58[_0xc9441c]['cron']);}else if(_0x129a58[_0xc9441c][_0x7ca6('0x48')]&&_0x129a58[_0xc9441c][_0x7ca6('0x49')]&&moment()['isBetween'](_0x129a58[_0xc9441c][_0x7ca6('0x4a')],_0x129a58[_0xc9441c]['endAt'])){manager[_0x7ca6('0x4b')](_0xc9441c,_0x129a58[_0xc9441c]['cron'],handleJob(_0x129a58[_0xc9441c]));manager[_0x7ca6('0x4c')](_0xc9441c);logger[_0x7ca6('0x22')](_0x7ca6('0x4d'),_0x129a58[_0xc9441c][_0x7ca6('0xd')],_0x129a58[_0xc9441c][_0x7ca6('0x48')]);}else if(manager[_0x7ca6('0x41')](_0xc9441c)){manager[_0x7ca6('0x4e')](_0xc9441c);manager[_0x7ca6('0x4f')](_0xc9441c);logger[_0x7ca6('0x22')]('stop\x20cron',_0x129a58[_0xc9441c][_0x7ca6('0xd')],_0x129a58[_0xc9441c][_0x7ca6('0x48')]);}}for(_0x1f9a53=0x0,_0xc9441c;_0x1f9a53<_0x1b4e58[_0x7ca6('0x50')]&&!_0x3372fa;_0x1f9a53+=0x1){_0xc9441c=_0x1b4e58[_0x1f9a53][_0x7ca6('0x3e')]();if(manager[_0x7ca6('0x41')](_0xc9441c)){if(_0x129a58[_0xc9441c]['cron']&&_0x129a58[_0xc9441c][_0x7ca6('0x49')]&&moment()[_0x7ca6('0x51')](_0x129a58[_0xc9441c][_0x7ca6('0x4a')],_0x129a58[_0xc9441c][_0x7ca6('0x52')])){manager[_0x7ca6('0x53')](_0xc9441c,_0x129a58[_0xc9441c][_0x7ca6('0x48')],handleJob(_0x129a58[_0xc9441c]));logger[_0x7ca6('0x22')]('update\x20cron',_0x129a58[_0xc9441c][_0x7ca6('0xd')],_0x129a58[_0xc9441c][_0x7ca6('0x48')]);}else{manager[_0x7ca6('0x4e')](_0xc9441c);manager[_0x7ca6('0x4f')](_0xc9441c);logger[_0x7ca6('0x22')](_0x7ca6('0x54'),_0x129a58[_0xc9441c][_0x7ca6('0xd')],_0x129a58[_0xc9441c]['cron']);}}}})['catch'](function(_0x447960){logger[_0x7ca6('0x27')](JSON[_0x7ca6('0x1f')](_0x447960));});}exports[_0x7ca6('0x55')]=function(_0x3b24e4){return getJobs(_0x3b24e4);};exports[_0x7ca6('0x4c')]=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 e372b60..501a40d 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 _0xb01a=['transcribeName','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','sentiment','language','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','SequelizeValidationError','inspect','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','substring','info','format','transcribeRegion','then'];(function(_0xb8acdd,_0x11b6bc){var _0x41ea5f=function(_0x32824d){while(--_0x32824d){_0xb8acdd['push'](_0xb8acdd['shift']());}};_0x41ea5f(++_0x11b6bc);}(_0xb01a,0x1a1));var _0xab01=function(_0xb6ca7d,_0x1fffc5){_0xb6ca7d=_0xb6ca7d-0x0;var _0x418d19=_0xb01a[_0xb6ca7d];return _0x418d19;};var _=require(_0xab01('0x0'));var AWS=require(_0xab01('0x1'));var rp=require(_0xab01('0x2'));var util=require(_0xab01('0x3'));var BPromise=require(_0xab01('0x4'));var db=require(_0xab01('0x5'))['db'];var logger=require(_0xab01('0x6'))(_0xab01('0x7'));function getTranscriptionJob(_0x472445,_0x3713b6,_0x257db6,_0x47103c){return new Promise(function(_0x22db85,_0x5d8dd9){var _0x13957f=new AWS[(_0xab01('0x8'))]({'accessKeyId':_0x3713b6,'secretAccessKey':_0x472445,'region':_0x257db6});_0x13957f['getTranscriptionJob']({'TranscriptionJobName':_0x47103c},function(_0x52146e,_0x71864b){if(_0x52146e){return _0x5d8dd9(_0x52146e);}else{return _0x22db85(_0x71864b);}});});}function sentiment(_0x13f309,_0x5bc6e9,_0x1a2b45,_0x48be78,_0x57b047){return new Promise(function(_0x434bf3,_0x5c0122){var _0x2bac1d=new AWS[(_0xab01('0x9'))]({'accessKeyId':_0x5bc6e9,'secretAccessKey':_0x13f309,'region':_0x1a2b45});_0x2bac1d['detectSentiment']({'Text':_0x48be78,'LanguageCode':_0x57b047[_0xab01('0xa')](0x0,0x2)},function(_0x515eda,_0x5d9bbd){if(_0x515eda){return _0x5c0122(_0x515eda);}else{return _0x434bf3(_0x5d9bbd);}});});}function checkTranscribeJob(_0x3410a1,_0x37088b,_0x1ededa){var _0xe9d23c;return new BPromise(function(_0x449402,_0x215a9e){logger[_0xab01('0xb')](util[_0xab01('0xc')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x3410a1['id'],_0x3410a1['transcribeName']));return getTranscriptionJob(_0x1ededa['data1'],_0x1ededa['data2'],_0x37088b[_0xab01('0xd')],_0x3410a1['transcribeName'])[_0xab01('0xe')](function(_0x2d9c23){logger[_0xab01('0xb')](util[_0xab01('0xc')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x3410a1['id'],_0x3410a1[_0xab01('0xf')],_0x2d9c23['TranscriptionJob'][_0xab01('0x10')]));if(!_0x3410a1[_0xab01('0x11')]){switch(_0x2d9c23['TranscriptionJob']['TranscriptionJobStatus']){case _0xab01('0x12'):var _0xcd917d={'transcribeStatus':_0x2d9c23[_0xab01('0x13')][_0xab01('0x10')],'fileUri':_0x2d9c23[_0xab01('0x13')][_0xab01('0x14')][_0xab01('0x15')]};logger[_0xab01('0xb')](util[_0xab01('0xc')](_0xab01('0x16'),_0x3410a1['id']));return rp({'uri':_0x2d9c23['TranscriptionJob'][_0xab01('0x14')][_0xab01('0x15')],'json':!![]})[_0xab01('0xe')](function(_0xac3a88){logger[_0xab01('0xb')](util[_0xab01('0xc')](_0xab01('0x17'),_0x3410a1['id']));if(_0xac3a88&&_0xac3a88[_0xab01('0x18')]&&_0xac3a88['results'][_0xab01('0x19')]&&_0xac3a88[_0xab01('0x18')][_0xab01('0x19')][_0xab01('0x1a')]){_0xcd917d[_0xab01('0x11')]='';for(var _0x1ebc65=0x0;_0x1ebc65<_0xac3a88[_0xab01('0x18')]['transcripts'][_0xab01('0x1a')];_0x1ebc65++){_0xcd917d[_0xab01('0x11')]+=_0xac3a88[_0xab01('0x18')][_0xab01('0x19')][_0x1ebc65][_0xab01('0x1b')]+'';}}return _0x3410a1[_0xab01('0x1c')](_0xcd917d);})[_0xab01('0xe')](function(){logger['info'](util[_0xab01('0xc')](_0xab01('0x1d'),_0x3410a1['id']));if(!_0x3410a1[_0xab01('0x1e')]){throw new db[(_0xab01('0x1f'))][(_0xab01('0x20'))](_0xab01('0x21'));}if(!_0x37088b['sentiment']||!_0x37088b[_0xab01('0x22')]||!_0x37088b[_0xab01('0x23')]||!_0x37088b['language']||!_0x37088b[_0xab01('0x24')]){throw new db[(_0xab01('0x1f'))][(_0xab01('0x20'))](_0xab01('0x25'));}if(!_0xcd917d[_0xab01('0x11')]){throw new Error(_0xab01('0x26'));}if(_0x37088b[_0xab01('0x22')]===_0x1ededa['id']){return _0x1ededa;}else{return db[_0xab01('0x27')]['findOne']({'where':{'id':_settings[_0xab01('0x22')]}});}})[_0xab01('0xe')](function(_0x51a120){if(!_0x51a120){throw new db[(_0xab01('0x1f'))][(_0xab01('0x20'))](_0xab01('0x28'));}if(!_0x51a120[_0xab01('0x29')]||!_0x51a120[_0xab01('0x2a')]){throw new db[(_0xab01('0x1f'))]['ValidationError'](_0xab01('0x2b'));}_0xe9d23c=_0x51a120;logger[_0xab01('0xb')](util[_0xab01('0xc')](_0xab01('0x2c'),_0x3410a1['id']));return sentiment(_0xe9d23c[_0xab01('0x29')],_0xe9d23c[_0xab01('0x2a')],_0x37088b[_0xab01('0x23')],_0xcd917d['fileText'],_0x37088b['language']);})['then'](function(_0x43594c){logger[_0xab01('0xb')](util[_0xab01('0xc')](_0xab01('0x2d'),_0x3410a1['id']));return _0x3410a1[_0xab01('0x1c')]({'sentiment':_0x43594c[_0xab01('0x2e')],'sPositive':_0x43594c[_0xab01('0x2f')][_0xab01('0x30')],'sNegative':_0x43594c[_0xab01('0x2f')][_0xab01('0x31')],'sMixed':_0x43594c[_0xab01('0x2f')][_0xab01('0x32')],'sNeutral':_0x43594c[_0xab01('0x2f')][_0xab01('0x33')]});})[_0xab01('0xe')](function(){logger[_0xab01('0xb')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3410a1['id']));_0x449402();});case _0xab01('0x34'):return _0x3410a1[_0xab01('0x1c')]({'transcribeStatus':'FAILED','failureReason':_0x2d9c23[_0xab01('0x13')][_0xab01('0x35')]})[_0xab01('0xe')](function(){logger['info'](util[_0xab01('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3410a1['id']));_0x449402();});default:logger['info'](util[_0xab01('0xc')](_0xab01('0x36'),_0x3410a1['id']));break;}}else{return BPromise['resolve']()[_0xab01('0xe')](function(){if(!_0x3410a1[_0xab01('0x1e')]){throw new db['Sequelize'][(_0xab01('0x20'))](_0xab01('0x21'));}if(!_0x37088b[_0xab01('0x37')]||!_0x37088b[_0xab01('0x22')]||!_0x37088b[_0xab01('0x23')]||!_0x37088b[_0xab01('0x38')]||!_0x37088b['bucket']){throw new db[(_0xab01('0x1f'))][(_0xab01('0x20'))](_0xab01('0x25'));}if(!_0x3410a1[_0xab01('0x11')]){throw new Error(_0xab01('0x26'));}if(_0x37088b['sentimentAccountId']===_0x1ededa['id']){return _0x1ededa;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0xab01('0x22')]}});}})[_0xab01('0xe')](function(_0x520182){if(!_0x520182){throw new db[(_0xab01('0x1f'))][(_0xab01('0x20'))](_0xab01('0x28'));}if(!_0x520182[_0xab01('0x29')]||!_0x520182[_0xab01('0x2a')]){throw new db[(_0xab01('0x1f'))][(_0xab01('0x20'))](_0xab01('0x2b'));}_0xe9d23c=_0x520182;logger[_0xab01('0xb')](util[_0xab01('0xc')](_0xab01('0x2c'),_0x3410a1['id']));return sentiment(_0xe9d23c[_0xab01('0x29')],_0xe9d23c[_0xab01('0x2a')],_0x37088b[_0xab01('0x23')],_0x3410a1[_0xab01('0x11')],_0x37088b[_0xab01('0x38')]);})[_0xab01('0xe')](function(_0x518c6b){logger['info'](util[_0xab01('0xc')](_0xab01('0x2d'),_0x3410a1['id']));return _0x3410a1[_0xab01('0x1c')]({'sentiment':_0x518c6b[_0xab01('0x2e')],'sPositive':_0x518c6b[_0xab01('0x2f')][_0xab01('0x30')],'sNegative':_0x518c6b['SentimentScore'][_0xab01('0x31')],'sMixed':_0x518c6b[_0xab01('0x2f')]['Mixed'],'sNeutral':_0x518c6b[_0xab01('0x2f')][_0xab01('0x33')],'transcribeStatus':_0xab01('0x12')});})['then'](function(){logger[_0xab01('0xb')](util[_0xab01('0xc')](_0xab01('0x1d'),_0x3410a1['id']));_0x449402();});}})[_0xab01('0x39')](function(_0x3fcd0f){if(_0x3fcd0f){if(!_0x3fcd0f['name']||_0x3fcd0f[_0xab01('0x3a')]!=='SequelizeValidationError'){logger[_0xab01('0x3b')](util[_0xab01('0xc')](_0xab01('0x3c'),_0x3410a1['id']),util['inspect'](_0x3fcd0f,{'showHidden':![],'depth':null}));}}_0x449402();});});}function checkTranscribe(){var _0xc3fe64;var _0x247261;var _0x46e255;return db[_0xab01('0x3d')]['findAll']({'where':{'transcribeStatus':_0xab01('0x3e')}})[_0xab01('0xe')](function(_0x13802e){if(!_0x13802e||!_0x13802e[_0xab01('0x1a')]){throw new db[(_0xab01('0x1f'))]['ValidationError'](_0xab01('0x3f'));}_0xc3fe64=_0x13802e;return db[_0xab01('0x40')]['findOne']({'where':{'id':0x1}});})[_0xab01('0xe')](function(_0x32fd3d){if(!_0x32fd3d){throw new db[(_0xab01('0x1f'))][(_0xab01('0x20'))](_0xab01('0x41'));}_0x247261=_0x32fd3d;if(!_0x247261[_0xab01('0x7')]||!_0x247261[_0xab01('0x42')]||!_0x247261['transcribeRegion']||!_0x247261['language']||!_0x247261[_0xab01('0x24')]){throw new db[(_0xab01('0x1f'))][(_0xab01('0x20'))](_0xab01('0x43'));}return db['CloudProvider']['findOne']({'where':{'id':_0x247261[_0xab01('0x42')]}});})[_0xab01('0xe')](function(_0x1f1b6f){if(!_0x1f1b6f){throw new db[(_0xab01('0x1f'))][(_0xab01('0x20'))](_0xab01('0x28'));}if(!_0x1f1b6f[_0xab01('0x29')]||!_0x1f1b6f['data2']){throw new db['Sequelize'][(_0xab01('0x20'))](_0xab01('0x2b'));}_0x46e255=_0x1f1b6f;var _0x384cc6=[];_0xc3fe64[_0xab01('0x44')](function(_0x3eba5e){_0x384cc6['push'](checkTranscribeJob(_0x3eba5e,_0x247261,_0x46e255));});return BPromise['all'](_0x384cc6);})['catch'](function(_0x6e55f4){if(_0x6e55f4){if(!_0x6e55f4[_0xab01('0x3a')]||_0x6e55f4[_0xab01('0x3a')]!==_0xab01('0x45')){logger[_0xab01('0x3b')](util[_0xab01('0x46')](_0x6e55f4,{'showHidden':![],'depth':null}));}}});}exports[_0xab01('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xdca3=['Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Cloud\x20Provider\x20not\x20available','catch','name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','error','start','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xdca3,0x64));var _0x3dca=function(_0x2f3afd,_0x316b2d){_0x2f3afd=_0x2f3afd-0x0;var _0x394ea6=_0xdca3[_0x2f3afd];return _0x394ea6;};var _=require(_0x3dca('0x0'));var AWS=require('aws-sdk');var rp=require(_0x3dca('0x1'));var util=require(_0x3dca('0x2'));var BPromise=require(_0x3dca('0x3'));var db=require(_0x3dca('0x4'))['db'];var logger=require(_0x3dca('0x5'))(_0x3dca('0x6'));function getTranscriptionJob(_0x3af6cf,_0x221ad8,_0x3887bd,_0x10c46f){return new Promise(function(_0x3e2811,_0x5cfa9a){var _0x4234a1=new AWS['TranscribeService']({'accessKeyId':_0x221ad8,'secretAccessKey':_0x3af6cf,'region':_0x3887bd});_0x4234a1['getTranscriptionJob']({'TranscriptionJobName':_0x10c46f},function(_0xdea879,_0x576218){if(_0xdea879){return _0x5cfa9a(_0xdea879);}else{return _0x3e2811(_0x576218);}});});}function sentiment(_0x32a125,_0x26832b,_0x123b66,_0x152aca,_0x56b6f8){return new Promise(function(_0x1f1228,_0x3f0000){var _0x43191e=new AWS[(_0x3dca('0x7'))]({'accessKeyId':_0x26832b,'secretAccessKey':_0x32a125,'region':_0x123b66});_0x43191e[_0x3dca('0x8')]({'Text':_0x152aca,'LanguageCode':_0x56b6f8[_0x3dca('0x9')](0x0,0x2)},function(_0x483a5c,_0x1a644c){if(_0x483a5c){return _0x3f0000(_0x483a5c);}else{return _0x1f1228(_0x1a644c);}});});}function checkTranscribeJob(_0x5d7f81,_0x5bfeda,_0x24c6c9){var _0x11f54e;return new BPromise(function(_0x24fcab,_0x2df2c5){logger[_0x3dca('0xa')](util[_0x3dca('0xb')](_0x3dca('0xc'),_0x5d7f81['id'],_0x5d7f81[_0x3dca('0xd')]));return getTranscriptionJob(_0x24c6c9[_0x3dca('0xe')],_0x24c6c9[_0x3dca('0xf')],_0x5bfeda[_0x3dca('0x10')],_0x5d7f81[_0x3dca('0xd')])[_0x3dca('0x11')](function(_0x5dc428){logger['info'](util[_0x3dca('0xb')](_0x3dca('0x12'),_0x5d7f81['id'],_0x5d7f81[_0x3dca('0xd')],_0x5dc428[_0x3dca('0x13')][_0x3dca('0x14')]));if(!_0x5d7f81[_0x3dca('0x15')]){switch(_0x5dc428['TranscriptionJob'][_0x3dca('0x14')]){case _0x3dca('0x16'):var _0x43c9e2={'transcribeStatus':_0x5dc428[_0x3dca('0x13')]['TranscriptionJobStatus'],'fileUri':_0x5dc428[_0x3dca('0x13')][_0x3dca('0x17')][_0x3dca('0x18')]};logger['info'](util['format'](_0x3dca('0x19'),_0x5d7f81['id']));return rp({'uri':_0x5dc428['TranscriptionJob'][_0x3dca('0x17')][_0x3dca('0x18')],'json':!![]})['then'](function(_0x4316b7){logger['info'](util[_0x3dca('0xb')](_0x3dca('0x1a'),_0x5d7f81['id']));if(_0x4316b7&&_0x4316b7[_0x3dca('0x1b')]&&_0x4316b7[_0x3dca('0x1b')][_0x3dca('0x1c')]&&_0x4316b7['results'][_0x3dca('0x1c')][_0x3dca('0x1d')]){_0x43c9e2[_0x3dca('0x15')]='';for(var _0x4ab095=0x0;_0x4ab095<_0x4316b7[_0x3dca('0x1b')][_0x3dca('0x1c')]['length'];_0x4ab095++){_0x43c9e2[_0x3dca('0x15')]+=_0x4316b7[_0x3dca('0x1b')][_0x3dca('0x1c')][_0x4ab095][_0x3dca('0x1e')]+'';}}return _0x5d7f81[_0x3dca('0x1f')](_0x43c9e2);})[_0x3dca('0x11')](function(){logger[_0x3dca('0xa')](util[_0x3dca('0xb')](_0x3dca('0x20'),_0x5d7f81['id']));if(!_0x5d7f81[_0x3dca('0x21')]){throw new db[(_0x3dca('0x22'))][(_0x3dca('0x23'))](_0x3dca('0x24'));}if(!_0x5bfeda[_0x3dca('0x25')]||!_0x5bfeda[_0x3dca('0x26')]||!_0x5bfeda[_0x3dca('0x27')]||!_0x5bfeda[_0x3dca('0x28')]||!_0x5bfeda[_0x3dca('0x29')]){throw new db[(_0x3dca('0x22'))]['ValidationError'](_0x3dca('0x2a'));}if(!_0x43c9e2[_0x3dca('0x15')]){throw new Error(_0x3dca('0x2b'));}if(_0x5bfeda[_0x3dca('0x26')]===_0x24c6c9['id']){return _0x24c6c9;}else{return db[_0x3dca('0x2c')][_0x3dca('0x2d')]({'where':{'id':_settings[_0x3dca('0x26')]}});}})['then'](function(_0x57bbea){if(!_0x57bbea){throw new db['Sequelize'][(_0x3dca('0x23'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x57bbea[_0x3dca('0xe')]||!_0x57bbea[_0x3dca('0xf')]){throw new db[(_0x3dca('0x22'))][(_0x3dca('0x23'))](_0x3dca('0x2e'));}_0x11f54e=_0x57bbea;logger[_0x3dca('0xa')](util[_0x3dca('0xb')](_0x3dca('0x2f'),_0x5d7f81['id']));return sentiment(_0x11f54e[_0x3dca('0xe')],_0x11f54e[_0x3dca('0xf')],_0x5bfeda[_0x3dca('0x27')],_0x43c9e2['fileText'],_0x5bfeda[_0x3dca('0x28')]);})[_0x3dca('0x11')](function(_0x1a4bea){logger[_0x3dca('0xa')](util['format'](_0x3dca('0x30'),_0x5d7f81['id']));return _0x5d7f81['update']({'sentiment':_0x1a4bea[_0x3dca('0x31')],'sPositive':_0x1a4bea[_0x3dca('0x32')][_0x3dca('0x33')],'sNegative':_0x1a4bea[_0x3dca('0x32')][_0x3dca('0x34')],'sMixed':_0x1a4bea[_0x3dca('0x32')][_0x3dca('0x35')],'sNeutral':_0x1a4bea['SentimentScore'][_0x3dca('0x36')]});})[_0x3dca('0x11')](function(){logger[_0x3dca('0xa')](util[_0x3dca('0xb')](_0x3dca('0x20'),_0x5d7f81['id']));_0x24fcab();});case _0x3dca('0x37'):return _0x5d7f81['update']({'transcribeStatus':_0x3dca('0x37'),'failureReason':_0x5dc428[_0x3dca('0x13')][_0x3dca('0x38')]})[_0x3dca('0x11')](function(){logger[_0x3dca('0xa')](util[_0x3dca('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5d7f81['id']));_0x24fcab();});default:logger[_0x3dca('0xa')](util[_0x3dca('0xb')](_0x3dca('0x39'),_0x5d7f81['id']));break;}}else{return BPromise[_0x3dca('0x3a')]()[_0x3dca('0x11')](function(){if(!_0x5d7f81[_0x3dca('0x21')]){throw new db[(_0x3dca('0x22'))][(_0x3dca('0x23'))](_0x3dca('0x24'));}if(!_0x5bfeda[_0x3dca('0x25')]||!_0x5bfeda[_0x3dca('0x26')]||!_0x5bfeda[_0x3dca('0x27')]||!_0x5bfeda[_0x3dca('0x28')]||!_0x5bfeda[_0x3dca('0x29')]){throw new db[(_0x3dca('0x22'))][(_0x3dca('0x23'))](_0x3dca('0x2a'));}if(!_0x5d7f81['fileText']){throw new Error(_0x3dca('0x2b'));}if(_0x5bfeda[_0x3dca('0x26')]===_0x24c6c9['id']){return _0x24c6c9;}else{return db['CloudProvider'][_0x3dca('0x2d')]({'where':{'id':_settings[_0x3dca('0x26')]}});}})[_0x3dca('0x11')](function(_0x3d4cd5){if(!_0x3d4cd5){throw new db[(_0x3dca('0x22'))][(_0x3dca('0x23'))](_0x3dca('0x3b'));}if(!_0x3d4cd5[_0x3dca('0xe')]||!_0x3d4cd5[_0x3dca('0xf')]){throw new db[(_0x3dca('0x22'))]['ValidationError'](_0x3dca('0x2e'));}_0x11f54e=_0x3d4cd5;logger[_0x3dca('0xa')](util[_0x3dca('0xb')](_0x3dca('0x2f'),_0x5d7f81['id']));return sentiment(_0x11f54e[_0x3dca('0xe')],_0x11f54e['data2'],_0x5bfeda[_0x3dca('0x27')],_0x5d7f81['fileText'],_0x5bfeda['language']);})['then'](function(_0x528bbe){logger[_0x3dca('0xa')](util[_0x3dca('0xb')](_0x3dca('0x30'),_0x5d7f81['id']));return _0x5d7f81[_0x3dca('0x1f')]({'sentiment':_0x528bbe['Sentiment'],'sPositive':_0x528bbe[_0x3dca('0x32')][_0x3dca('0x33')],'sNegative':_0x528bbe[_0x3dca('0x32')][_0x3dca('0x34')],'sMixed':_0x528bbe['SentimentScore'][_0x3dca('0x35')],'sNeutral':_0x528bbe[_0x3dca('0x32')][_0x3dca('0x36')],'transcribeStatus':'COMPLETED'});})[_0x3dca('0x11')](function(){logger[_0x3dca('0xa')](util[_0x3dca('0xb')](_0x3dca('0x20'),_0x5d7f81['id']));_0x24fcab();});}})[_0x3dca('0x3c')](function(_0x1ac182){if(_0x1ac182){if(!_0x1ac182[_0x3dca('0x3d')]||_0x1ac182['name']!=='SequelizeValidationError'){logger['error'](util['format'](_0x3dca('0x3e'),_0x5d7f81['id']),util[_0x3dca('0x3f')](_0x1ac182,{'showHidden':![],'depth':null}));}}_0x24fcab();});});}function checkTranscribe(){var _0x231300;var _0x3f8cc1;var _0x1ea5ac;return db['VoiceRecording'][_0x3dca('0x40')]({'where':{'transcribeStatus':_0x3dca('0x41')}})[_0x3dca('0x11')](function(_0x312c8b){if(!_0x312c8b||!_0x312c8b[_0x3dca('0x1d')]){throw new db[(_0x3dca('0x22'))][(_0x3dca('0x23'))](_0x3dca('0x42'));}_0x231300=_0x312c8b;return db[_0x3dca('0x43')][_0x3dca('0x2d')]({'where':{'id':0x1}});})['then'](function(_0x212544){if(!_0x212544){throw new db[(_0x3dca('0x22'))][(_0x3dca('0x23'))](_0x3dca('0x44'));}_0x3f8cc1=_0x212544;if(!_0x3f8cc1[_0x3dca('0x6')]||!_0x3f8cc1[_0x3dca('0x45')]||!_0x3f8cc1[_0x3dca('0x10')]||!_0x3f8cc1[_0x3dca('0x28')]||!_0x3f8cc1[_0x3dca('0x29')]){throw new db[(_0x3dca('0x22'))]['ValidationError'](_0x3dca('0x46'));}return db[_0x3dca('0x2c')][_0x3dca('0x2d')]({'where':{'id':_0x3f8cc1[_0x3dca('0x45')]}});})[_0x3dca('0x11')](function(_0x24d58f){if(!_0x24d58f){throw new db['Sequelize'][(_0x3dca('0x23'))](_0x3dca('0x3b'));}if(!_0x24d58f['data1']||!_0x24d58f[_0x3dca('0xf')]){throw new db[(_0x3dca('0x22'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x1ea5ac=_0x24d58f;var _0x5ad335=[];_0x231300[_0x3dca('0x47')](function(_0x454adc){_0x5ad335[_0x3dca('0x48')](checkTranscribeJob(_0x454adc,_0x3f8cc1,_0x1ea5ac));});return BPromise[_0x3dca('0x49')](_0x5ad335);})[_0x3dca('0x3c')](function(_0x458b92){if(_0x458b92){if(!_0x458b92[_0x3dca('0x3d')]||_0x458b92[_0x3dca('0x3d')]!=='SequelizeValidationError'){logger[_0x3dca('0x4a')](util[_0x3dca('0x3f')](_0x458b92,{'showHidden':![],'depth':null}));}}});}exports[_0x3dca('0x4b')]=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 877f4ca..8be8108 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 _0xea89=['ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment'];(function(_0x5634f7,_0x2154de){var _0x4a65aa=function(_0x20acfe){while(--_0x20acfe){_0x5634f7['push'](_0x5634f7['shift']());}};_0x4a65aa(++_0x2154de);}(_0xea89,0xfa));var _0x9ea8=function(_0x439403,_0x2c9db9){_0x439403=_0x439403-0x0;var _0x5d4cab=_0xea89[_0x439403];return _0x5d4cab;};'use strict';var _=require(_0x9ea8('0x0'));var moment=require(_0x9ea8('0x1'));var Redis=require(_0x9ea8('0x2'));var util=require(_0x9ea8('0x3'));var config=require(_0x9ea8('0x4'));var db=require(_0x9ea8('0x5'))['db'];var logger=require(_0x9ea8('0x6'))(_0x9ea8('0x7'));config['redis']=_[_0x9ea8('0x8')](config[_0x9ea8('0x9')],{'host':_0x9ea8('0xa'),'port':0x18eb});var io=require(_0x9ea8('0xb'))(new Redis(config[_0x9ea8('0x9')]));function closeInteractions(){var _0x2f7b38=[];return db[_0x9ea8('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x9ea8('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x9ea8('0xe'))}}})[_0x9ea8('0xf')](function(_0xd2435){if(_0xd2435&&_0xd2435[_0x9ea8('0x10')]){_0x2f7b38=_[_0x9ea8('0x11')](_0xd2435||[],'id');logger[_0x9ea8('0x12')](_0x9ea8('0x13'),_0x2f7b38['join']());return db[_0x9ea8('0xc')]['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x9ea8('0x14')](_0x9ea8('0x15'))},{'where':{'id':_0x2f7b38}});}})[_0x9ea8('0xf')](function(){if(_0x2f7b38&&_0x2f7b38[_0x9ea8('0x10')]){logger[_0x9ea8('0x12')](_0x9ea8('0x16'),_0x2f7b38['join']());for(var _0x427c7f=0x0;_0x427c7f<_0x2f7b38[_0x9ea8('0x10')];_0x427c7f++){io[_0x9ea8('0x17')]('whatsappInteraction:update',{'id':_0x2f7b38[_0x427c7f],'closed':!![]});}}})[_0x9ea8('0x18')](function(_0x3cfcee){logger[_0x9ea8('0x19')](_0x9ea8('0x1a'),_0x3cfcee?util[_0x9ea8('0x1b')](_0x3cfcee,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa54c=['system','format','YYYY-MM-DD\x20HH:mm:ss','then','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','ioredis','util','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','map','info','join','update'];(function(_0x491401,_0x2a0bac){var _0x42c2f8=function(_0x3273ea){while(--_0x3273ea){_0x491401['push'](_0x491401['shift']());}};_0x42c2f8(++_0x2a0bac);}(_0xa54c,0xcf));var _0xca54=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xa54c[_0x34843e];return _0x598f7f;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0xca54('0x0'));var util=require(_0xca54('0x1'));var config=require('../../config/environment');var db=require(_0xca54('0x2'))['db'];var logger=require(_0xca54('0x3'))('schedule');config[_0xca54('0x4')]=_[_0xca54('0x5')](config[_0xca54('0x4')],{'host':_0xca54('0x6'),'port':0x18eb});var io=require(_0xca54('0x7'))(new Redis(config[_0xca54('0x4')]));function closeInteractions(){var _0x4e5721=[];return db[_0xca54('0x8')][_0xca54('0x9')]({'raw':!![],'attributes':['id',_0xca54('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xca54('0xb')](0x18,_0xca54('0xc'))}}})['then'](function(_0x1e75e9){if(_0x1e75e9&&_0x1e75e9['length']){_0x4e5721=_[_0xca54('0xd')](_0x1e75e9||[],'id');logger[_0xca54('0xe')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x4e5721[_0xca54('0xf')]());return db[_0xca54('0x8')][_0xca54('0x10')]({'closeReason':_0xca54('0x11'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xca54('0x12')](_0xca54('0x13'))},{'where':{'id':_0x4e5721}});}})[_0xca54('0x14')](function(){if(_0x4e5721&&_0x4e5721[_0xca54('0x15')]){logger[_0xca54('0xe')](_0xca54('0x16'),_0x4e5721[_0xca54('0xf')]());for(var _0x359b52=0x0;_0x359b52<_0x4e5721['length'];_0x359b52++){io['emit'](_0xca54('0x17'),{'id':_0x4e5721[_0x359b52],'closed':!![]});}}})[_0xca54('0x18')](function(_0x2cda7c){logger[_0xca54('0x19')](_0xca54('0x1a'),_0x2cda7c?util[_0xca54('0x1b')](_0x2cda7c,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index f4c6a7b..eccac03 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4991=['util','../mysqldb','Innocenzo','innocenzo.biondo','now','Biondo','@xcally.com','push','destroy','then','CmContact','bulkCreate','finished\x20populating','CmHopper','hopper1','contacts2','log','hopper2','catch'];(function(_0x2591e0,_0xc78dbc){var _0x59f1ff=function(_0x433244){while(--_0x433244){_0x2591e0['push'](_0x2591e0['shift']());}};_0x59f1ff(++_0xc78dbc);}(_0x4991,0x72));var _0x1499=function(_0x2e1b00,_0x286b4e){_0x2e1b00=_0x2e1b00-0x0;var _0x545829=_0x4991[_0x2e1b00];return _0x545829;};'use strict';var util=require(_0x1499('0x0'));var db=require(_0x1499('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x1499('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x1499('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x1499('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1499('0x4')](),'updatedAt':Date[_0x1499('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x1499('0x2')+i,'lastName':_0x1499('0x5')+i,'phone':0xf879fb460+i,'email':_0x1499('0x3')+i+_0x1499('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1499('0x7')]({'id':i,'active':![],'scheduledat':Date[_0x1499('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1499('0x4')](),'updatedAt':Date[_0x1499('0x4')]()});}db['CmContact'][_0x1499('0x8')]({'where':{}})[_0x1499('0x9')](function(){return db[_0x1499('0xa')][_0x1499('0xb')](contacts);})[_0x1499('0x9')](function(){console['log'](_0x1499('0xc'),'contacts1');return db[_0x1499('0xd')]['destroy']({'where':{}});})['then'](function(){return db[_0x1499('0xd')][_0x1499('0xb')](hopper);})[_0x1499('0x9')](function(){console['log']('finished\x20populating',_0x1499('0xe'));return db['CmContact'][_0x1499('0xb')](contacts2);})[_0x1499('0x9')](function(){console['log'](_0x1499('0xc'),_0x1499('0xf'));return db[_0x1499('0xd')][_0x1499('0xb')](hopper2);})[_0x1499('0x9')](function(){console[_0x1499('0x10')](_0x1499('0xc'),_0x1499('0x11'));})[_0x1499('0x12')](function(_0x20e657){console[_0x1499('0x10')](_0x20e657);}); \ No newline at end of file +var _0xd210=['contacts1','log','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','CmContact','destroy','then','bulkCreate','finished\x20populating'];(function(_0x3bb120,_0x243686){var _0x208913=function(_0x5e579c){while(--_0x5e579c){_0x3bb120['push'](_0x3bb120['shift']());}};_0x208913(++_0x243686);}(_0xd210,0x125));var _0x0d21=function(_0x40822a,_0x582b60){_0x40822a=_0x40822a-0x0;var _0x357420=_0xd210[_0x40822a];return _0x357420;};'use strict';var util=require('util');var db=require(_0x0d21('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x0d21('0x1')]({'id':i,'firstName':_0x0d21('0x2')+i,'lastName':_0x0d21('0x3')+i,'phone':0xf879fb460+i,'email':_0x0d21('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x0d21('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x0d21('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x0d21('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x0d21('0x1')]({'id':i,'firstName':_0x0d21('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x0d21('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0d21('0x5')](),'updatedAt':Date[_0x0d21('0x5')]()});}db[_0x0d21('0x6')][_0x0d21('0x7')]({'where':{}})[_0x0d21('0x8')](function(){return db['CmContact'][_0x0d21('0x9')](contacts);})[_0x0d21('0x8')](function(){console['log'](_0x0d21('0xa'),_0x0d21('0xb'));return db['CmHopper'][_0x0d21('0x7')]({'where':{}});})[_0x0d21('0x8')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x0d21('0x8')](function(){console[_0x0d21('0xc')]('finished\x20populating','hopper1');return db[_0x0d21('0x6')][_0x0d21('0x9')](contacts2);})[_0x0d21('0x8')](function(){console['log'](_0x0d21('0xa'),_0x0d21('0xd'));return db['CmHopper'][_0x0d21('0x9')](hopper2);})[_0x0d21('0x8')](function(){console[_0x0d21('0xc')](_0x0d21('0xa'),_0x0d21('0xe'));})[_0x0d21('0xf')](function(_0x303d7a){console[_0x0d21('0xc')](_0x303d7a);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 1eba47f..46c3778 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e8=['yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','catch','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw'];(function(_0xdd4256,_0x332969){var _0x8b7475=function(_0x52834c){while(--_0x52834c){_0xdd4256['push'](_0xdd4256['shift']());}};_0x8b7475(++_0x332969);}(_0xa9e8,0xfb));var _0x8a9e=function(_0x19bb73,_0x103ad5){_0x19bb73=_0x19bb73-0x0;var _0x2ea3ba=_0xa9e8[_0x19bb73];return _0x2ea3ba;};'use strict';var util=require(_0x8a9e('0x0'));var db=require(_0x8a9e('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x8a9e('0x2')]({'name':util[_0x8a9e('0x3')](_0x8a9e('0x4'),'agent',i),'fullname':util[_0x8a9e('0x3')](_0x8a9e('0x4'),_0x8a9e('0x5'),i),'email':util[_0x8a9e('0x3')](_0x8a9e('0x6'),_0x8a9e('0x5'),i),'role':_0x8a9e('0x5'),'password':_0x8a9e('0x7'),'internal':0xfa0+i,'type':_0x8a9e('0x8'),'transport':[_0x8a9e('0x9'),'ws',_0x8a9e('0xa')],'disallow':[_0x8a9e('0xb')],'allow':[_0x8a9e('0xc')],'defaultuser':util[_0x8a9e('0x3')]('%s%s',_0x8a9e('0x5'),i),'encryption':'yes','avpf':_0x8a9e('0xd'),'force_avp':_0x8a9e('0xd'),'icesupport':_0x8a9e('0xd'),'dtlsenable':_0x8a9e('0xd'),'dtlsverify':'no','dtlscertfile':_0x8a9e('0xe'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x8a9e('0xf'),'callerid':util[_0x8a9e('0x3')](_0x8a9e('0x10'),util[_0x8a9e('0x3')](_0x8a9e('0x4'),'agent',i),0xfa0+i)});}db[_0x8a9e('0x11')][_0x8a9e('0x12')](users)[_0x8a9e('0x13')](function(){console['log']('add\x20user');})[_0x8a9e('0x14')](function(_0x4a179d){console[_0x8a9e('0x15')](_0x4a179d);}); \ No newline at end of file +var _0x8bb6=['ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','bulkCreate','log','add\x20user','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss'];(function(_0x1ca7c4,_0x1436c8){var _0x5399c7=function(_0x3fb321){while(--_0x3fb321){_0x1ca7c4['push'](_0x1ca7c4['shift']());}};_0x5399c7(++_0x1436c8);}(_0x8bb6,0x67));var _0x68bb=function(_0x4d6164,_0xf40bf1){_0x4d6164=_0x4d6164-0x0;var _0x2007db=_0x8bb6[_0x4d6164];return _0x2007db;};'use strict';var util=require(_0x68bb('0x0'));var db=require(_0x68bb('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x68bb('0x2')]({'name':util[_0x68bb('0x3')](_0x68bb('0x4'),_0x68bb('0x5'),i),'fullname':util['format']('%s%s','agent',i),'email':util[_0x68bb('0x3')](_0x68bb('0x6'),_0x68bb('0x5'),i),'role':_0x68bb('0x5'),'password':_0x68bb('0x7'),'internal':0xfa0+i,'type':_0x68bb('0x8'),'transport':[_0x68bb('0x9'),'ws',_0x68bb('0xa')],'disallow':['all'],'allow':[_0x68bb('0xb')],'defaultuser':util[_0x68bb('0x3')](_0x68bb('0x4'),_0x68bb('0x5'),i),'encryption':_0x68bb('0xc'),'avpf':_0x68bb('0xc'),'force_avp':'yes','icesupport':_0x68bb('0xc'),'dtlsenable':_0x68bb('0xc'),'dtlsverify':'no','dtlscertfile':_0x68bb('0xd'),'dtlsprivatekey':_0x68bb('0xe'),'dtlssetup':_0x68bb('0xf'),'callerid':util[_0x68bb('0x3')]('\x22%s\x22\x20<%s>',util[_0x68bb('0x3')]('%s%s',_0x68bb('0x5'),i),0xfa0+i)});}db['User'][_0x68bb('0x10')](users)['then'](function(){console[_0x68bb('0x11')](_0x68bb('0x12'));})['catch'](function(_0x51d904){console[_0x68bb('0x11')](_0x51d904);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 4c953ff..2d93b26 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9148=['MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','voice:outbound','FaxQueues','userProfileId','SmsQueues','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','where','length','format','user:%s','handshake','query','ChatInteraction','ChatInteractions','MailInteraction'];(function(_0x508c97,_0x409158){var _0x463d56=function(_0x53a92d){while(--_0x53a92d){_0x508c97['push'](_0x508c97['shift']());}};_0x463d56(++_0x409158);}(_0x9148,0x10d));var _0x8914=function(_0x152555,_0x41966a){_0x152555=_0x152555-0x0;var _0x2d81d3=_0x9148[_0x152555];return _0x2d81d3;};'use strict';var _=require(_0x8914('0x0'));var util=require(_0x8914('0x1'));var BPromise=require(_0x8914('0x2'));var db=require(_0x8914('0x3'))['db'];var config=require(_0x8914('0x4'));var queryQueues={'attributes':['id',_0x8914('0x5')],'include':[{'as':_0x8914('0x6'),'model':db[_0x8914('0x7')],'attributes':['id',_0x8914('0x5'),_0x8914('0x8')],'raw':!![],'where':{'role':_0x8914('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x8914('0xa')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x8914('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x8914('0x5'),_0x8914('0xb')],'where':{'type':_0x8914('0xc')}};function getAssociatedResources(_0x45febb,_0x50484a,_0x2e7aac){return db[_0x8914('0xd')][_0x8914('0xe')]({'where':{'name':_0x45febb,'userProfileId':_0x50484a},'raw':!![]})[_0x8914('0xf')](function(_0x3e8af9){if(_0x3e8af9){if(_0x3e8af9['autoAssociation']){switch(_0x45febb){case _0x8914('0x10'):case _0x8914('0x11'):case'FaxQueues':case'SmsQueues':case _0x8914('0x12'):case _0x8914('0x13'):case _0x8914('0x14'):return db[_0x2e7aac][_0x8914('0x15')](queryQueues);case _0x8914('0x16'):return db[_0x2e7aac][_0x8914('0x15')](queryTelephones);case'Trunks':return db[_0x2e7aac][_0x8914('0x15')](queryTrunks);case _0x8914('0x17'):return db[_0x2e7aac]['findAll'](queryCampaigns);}}else{return db[_0x8914('0x18')][_0x8914('0x15')]({'attributes':[_0x8914('0x19')],'where':{'sectionId':_0x3e8af9['id']},'raw':!![]})[_0x8914('0xf')](function(_0x1d9609){if(_0x1d9609){var _0x3aa515={'where':{'id':_[_0x8914('0x1a')](_0x1d9609,_0x8914('0x19'))},'raw':!![]};switch(_0x2e7aac){case _0x8914('0x7'):_0x3aa515['where'][_0x8914('0x8')]=_0x8914('0xa');break;case _0x8914('0x1b'):_0x3aa515[_0x8914('0x1c')][_0x8914('0xb')]=_0x8914('0xc');break;}return db[_0x2e7aac][_0x8914('0x15')](_0x3aa515);}else{return[];}});}}else{return[];}})['then'](function(_0x20eca1){return _0x20eca1;});}function joinOrLeaveQueues(_0x404632,_0x53163a,_0x5de618,_0x3e4dcc){_0x404632[_0x53163a](util['format']('%s:queue:%s',_0x5de618,_0x3e4dcc[_0x8914('0x5')]));if(_0x3e4dcc[_0x8914('0x6')]){for(var _0x2d60c2=0x0;_0x2d60c2<_0x3e4dcc[_0x8914('0x6')][_0x8914('0x1d')];_0x2d60c2+=0x1){_0x404632[_0x53163a](util[_0x8914('0x1e')](_0x8914('0x1f'),_0x3e4dcc[_0x8914('0x6')][_0x2d60c2][_0x8914('0x5')]));}}}function joinOrLeave(_0x182327,_0x179b66,_0x41a901){var _0x14db21;if(_0x182327[_0x8914('0x20')][_0x8914('0x21')]['id']){db['User']['find']({'attributes':['id',_0x8914('0x5'),'role','userProfileId'],'where':{'id':_0x182327['handshake'][_0x8914('0x21')]['id']},'include':[{'model':db[_0x8914('0x22')],'as':_0x8914('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x8914('0x24')],'as':_0x8914('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x8914('0x26')],'as':_0x8914('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x8914('0x28')],'as':_0x8914('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x8914('0x2a')],'as':_0x8914('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x8914('0x2c')],'as':_0x8914('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x8914('0xf')](function(_0x26db69){if(_0x26db69){_0x14db21=_0x26db69;_0x182327[_0x179b66](util[_0x8914('0x1e')](_0x8914('0x1f'),_0x26db69[_0x8914('0x5')]));var _0x217afa=[];switch(_0x26db69['role']){case'admin':_0x182327[_0x179b66](_0x8914('0x2e'));_0x182327[_0x179b66]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x8914('0x2f'))){delete queryQueues['include'];}_0x217afa[_0x8914('0x30')](db[_0x8914('0x31')][_0x8914('0x15')](queryQueues));_0x217afa[_0x8914('0x30')](db[_0x8914('0x32')][_0x8914('0x15')](queryQueues));_0x217afa[_0x8914('0x30')](db[_0x8914('0x33')]['findAll'](queryQueues));_0x217afa[_0x8914('0x30')](db[_0x8914('0x34')][_0x8914('0x15')](queryQueues));_0x217afa[_0x8914('0x30')](db[_0x8914('0x35')]['findAll'](queryQueues));_0x217afa['push'](db[_0x8914('0x36')][_0x8914('0x15')](queryQueues));_0x217afa[_0x8914('0x30')](db['WhatsappQueue']['findAll'](queryQueues));_0x217afa[_0x8914('0x30')](db[_0x8914('0x7')][_0x8914('0x15')](queryTelephones));_0x217afa['push'](db[_0x8914('0x37')][_0x8914('0x15')](queryTrunks));_0x217afa['push'](db['Campaign'][_0x8914('0x15')](queryCampaigns));_0x217afa[_0x8914('0x30')](db[_0x8914('0x7')][_0x8914('0x15')](queryAgents));break;case'user':_0x182327[_0x179b66]('voice:inbound');_0x182327[_0x179b66](_0x8914('0x38'));_0x217afa[_0x8914('0x30')](getAssociatedResources(_0x8914('0x10'),_0x26db69['userProfileId'],_0x8914('0x31')));_0x217afa['push'](getAssociatedResources(_0x8914('0x11'),_0x26db69['userProfileId'],_0x8914('0x32')));_0x217afa[_0x8914('0x30')](getAssociatedResources(_0x8914('0x39'),_0x26db69[_0x8914('0x3a')],_0x8914('0x33')));_0x217afa['push'](getAssociatedResources(_0x8914('0x3b'),_0x26db69[_0x8914('0x3a')],_0x8914('0x34')));_0x217afa[_0x8914('0x30')](getAssociatedResources('MailQueues',_0x26db69[_0x8914('0x3a')],_0x8914('0x35')));_0x217afa['push'](getAssociatedResources(_0x8914('0x13'),_0x26db69[_0x8914('0x3a')],_0x8914('0x36')));_0x217afa[_0x8914('0x30')](getAssociatedResources(_0x8914('0x14'),_0x26db69[_0x8914('0x3a')],_0x8914('0x3c')));_0x217afa[_0x8914('0x30')](getAssociatedResources(_0x8914('0x16'),_0x26db69[_0x8914('0x3a')],_0x8914('0x7')));_0x217afa[_0x8914('0x30')](getAssociatedResources('Trunks',_0x26db69[_0x8914('0x3a')],'Trunk'));_0x217afa[_0x8914('0x30')](getAssociatedResources(_0x8914('0x17'),_0x26db69[_0x8914('0x3a')],_0x8914('0x1b')));_0x217afa[_0x8914('0x30')](db[_0x8914('0x7')][_0x8914('0x15')](queryAgents));break;case _0x8914('0x9'):_0x182327[_0x179b66]('voice:inbound');_0x182327[_0x179b66](_0x8914('0x38'));_0x217afa['push'](_0x26db69[_0x8914('0x3d')]({'attributes':['id','name']}));_0x217afa[_0x8914('0x30')](_0x26db69[_0x8914('0x3e')]({'attributes':['id',_0x8914('0x5')]}));_0x217afa[_0x8914('0x30')](_0x26db69[_0x8914('0x3f')]({'attributes':['id',_0x8914('0x5')]}));_0x217afa[_0x8914('0x30')](_0x26db69['getSmsQueues']({'attributes':['id','name']}));_0x217afa[_0x8914('0x30')](_0x26db69[_0x8914('0x40')]({'attributes':['id',_0x8914('0x5')]}));_0x217afa['push'](_0x26db69[_0x8914('0x41')]({'attributes':['id',_0x8914('0x5')]}));_0x217afa[_0x8914('0x30')](_0x26db69[_0x8914('0x42')]({'attributes':['id','name']}));break;}return BPromise[_0x8914('0x43')](_0x217afa);}})[_0x8914('0xf')](function(_0x5c7f2c){if(_0x5c7f2c&&_0x5c7f2c['length']){for(var _0xa6a9c=0x0;_0xa6a9c<_0x5c7f2c[_0x8914('0x1d')];_0xa6a9c+=0x1){for(var _0x408190=0x0;_0x408190<_0x5c7f2c[_0xa6a9c]['length'];_0x408190+=0x1){switch(_0xa6a9c){case 0x0:joinOrLeaveQueues(_0x182327,_0x179b66,_0x8914('0x44'),_0x5c7f2c[_0xa6a9c][_0x408190]);break;case 0x1:joinOrLeaveQueues(_0x182327,_0x179b66,_0x8914('0x45'),_0x5c7f2c[_0xa6a9c][_0x408190]);break;case 0x2:joinOrLeaveQueues(_0x182327,_0x179b66,_0x8914('0x46'),_0x5c7f2c[_0xa6a9c][_0x408190]);break;case 0x3:joinOrLeaveQueues(_0x182327,_0x179b66,'sms',_0x5c7f2c[_0xa6a9c][_0x408190]);break;case 0x4:joinOrLeaveQueues(_0x182327,_0x179b66,_0x8914('0x47'),_0x5c7f2c[_0xa6a9c][_0x408190]);break;case 0x5:joinOrLeaveQueues(_0x182327,_0x179b66,_0x8914('0x48'),_0x5c7f2c[_0xa6a9c][_0x408190]);break;case 0x6:joinOrLeaveQueues(_0x182327,_0x179b66,_0x8914('0x49'),_0x5c7f2c[_0xa6a9c][_0x408190]);break;case 0x7:if(_0x14db21[_0x8914('0x8')]!==_0x8914('0x9'))_0x182327[_0x179b66](util['format'](_0x8914('0x4a'),_0x5c7f2c[_0xa6a9c][_0x408190]['name']));break;case 0x8:if(_0x14db21[_0x8914('0x8')]!=='agent')_0x182327[_0x179b66](util[_0x8914('0x1e')](_0x8914('0x4b'),_0x5c7f2c[_0xa6a9c][_0x408190][_0x8914('0x5')]));break;case 0x9:if(_0x14db21['role']!==_0x8914('0x9'))_0x182327[_0x179b66](util[_0x8914('0x1e')](_0x8914('0x4c'),_0x5c7f2c[_0xa6a9c][_0x408190][_0x8914('0xb')],_0x5c7f2c[_0xa6a9c][_0x408190]['name']));break;case 0xa:_0x182327[_0x179b66](util[_0x8914('0x1e')](_0x8914('0x1f'),_0x5c7f2c[_0xa6a9c][_0x408190][_0x8914('0x5')]));break;}}}}})[_0x8914('0xf')](function(){if(_0x179b66===_0x8914('0x4d')){var _0x371d66=_[_0x8914('0x1a')](_0x14db21[_0x8914('0x23')],'id');return _0x14db21[_0x8914('0x4e')](_0x371d66)['then'](function(){for(var _0x4c8c99=0x0;_0x4c8c99<_0x371d66[_0x8914('0x1d')];_0x4c8c99+=0x1){_0x41a901[_0x8914('0x4f')](_0x8914('0x50'),{'ChatInteractionId':Number(_0x371d66[_0x4c8c99]),'UserId':Number(_0x14db21['id'])});}});}})[_0x8914('0xf')](function(){if(_0x179b66==='leave'){var _0x25697d=_[_0x8914('0x1a')](_0x14db21['MailInteractions'],'id');return _0x14db21['removeMailInteractions'](_0x25697d)[_0x8914('0xf')](function(){for(var _0x20ee77=0x0;_0x20ee77<_0x25697d[_0x8914('0x1d')];_0x20ee77+=0x1){_0x41a901[_0x8914('0x4f')](_0x8914('0x51'),{'MailInteractionId':Number(_0x25697d[_0x20ee77]),'UserId':Number(_0x14db21['id'])});}});}})[_0x8914('0xf')](function(){if(_0x179b66===_0x8914('0x4d')){var _0x489632=_[_0x8914('0x1a')](_0x14db21[_0x8914('0x27')],'id');return _0x14db21[_0x8914('0x52')](_0x489632)[_0x8914('0xf')](function(){for(var _0x56b427=0x0;_0x56b427<_0x489632['length'];_0x56b427+=0x1){_0x41a901[_0x8914('0x4f')](_0x8914('0x53'),{'FaxInteractionId':Number(_0x489632[_0x56b427]),'UserId':Number(_0x14db21['id'])});}});}})['then'](function(){if(_0x179b66===_0x8914('0x4d')){var _0x3ddf3c=_['map'](_0x14db21[_0x8914('0x29')],'id');return _0x14db21[_0x8914('0x54')](_0x3ddf3c)[_0x8914('0xf')](function(){for(var _0xc9d6b3=0x0;_0xc9d6b3<_0x3ddf3c[_0x8914('0x1d')];_0xc9d6b3+=0x1){_0x41a901['emit'](_0x8914('0x55'),{'SmsInteractionId':Number(_0x3ddf3c[_0xc9d6b3]),'UserId':Number(_0x14db21['id'])});}});}})[_0x8914('0xf')](function(){if(_0x179b66===_0x8914('0x4d')){var _0x18dfbe=_[_0x8914('0x1a')](_0x14db21[_0x8914('0x2b')],'id');return _0x14db21[_0x8914('0x56')](_0x18dfbe)[_0x8914('0xf')](function(){for(var _0x23428f=0x0;_0x23428f<_0x18dfbe[_0x8914('0x1d')];_0x23428f+=0x1){_0x41a901[_0x8914('0x4f')](_0x8914('0x57'),{'OpenchannelInteractionId':Number(_0x18dfbe[_0x23428f]),'UserId':Number(_0x14db21['id'])});}});}})['then'](function(){if(_0x179b66===_0x8914('0x4d')){var _0x3608f0=_[_0x8914('0x1a')](_0x14db21[_0x8914('0x2d')],'id');return _0x14db21['removeWhatsappInteractions'](_0x3608f0)[_0x8914('0xf')](function(){for(var _0x40f4f4=0x0;_0x40f4f4<_0x3608f0[_0x8914('0x1d')];_0x40f4f4+=0x1){_0x41a901[_0x8914('0x4f')](_0x8914('0x58'),{'WhatsappInteractionId':Number(_0x3608f0[_0x40f4f4]),'UserId':Number(_0x14db21['id'])});}});}})[_0x8914('0x59')](function(_0x310926){_0x182327[_0x8914('0x5a')](_0x310926);});}}function onDisconnect(_0x5bd26a,_0x20a0bc){joinOrLeave(_0x5bd26a,_0x8914('0x4d'),_0x20a0bc);}function onConnect(_0x2417cd){joinOrLeave(_0x2417cd,_0x8914('0x5b'));}exports[_0x8914('0x5c')]=function(_0xc21762){_0xc21762['on']('connection',function(_0x3dc89b){_0x3dc89b[_0x8914('0x5d')](0x0);_0x3dc89b[_0x8914('0x5e')]=_0x3dc89b[_0x8914('0x5f')][_0x8914('0x60')][_0x8914('0x61')]+':'+_0x3dc89b['request'][_0x8914('0x60')][_0x8914('0x62')];_0x3dc89b['connectedAt']=new Date();_0x3dc89b[_0x8914('0x5a')]=function(_0x40309b){console[_0x8914('0x5a')]('SocketIO\x20'+_0x3dc89b['nsp'][_0x8914('0x5')]+'['+_0x3dc89b[_0x8914('0x5e')]+']',_0x40309b);};_0x3dc89b['on'](_0x8914('0x63'),function(){onDisconnect(_0x3dc89b,_0xc21762);_0x3dc89b[_0x8914('0x5a')](_0x8914('0x64'));});onConnect(_0x3dc89b);_0x3dc89b[_0x8914('0x5a')](_0x8914('0x65'));});}; \ No newline at end of file +var _0x9e6d=['ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','Telephones','IvrCampaigns','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','map','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','Agents','User','name','role','telephone','agent','type','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','resourceId','then','Campaign','where','ivr','format','%s:queue:%s','length','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9e6d,0x1d2));var _0xd9e6=function(_0xd1668c,_0x4a38df){_0xd1668c=_0xd1668c-0x0;var _0x408881=_0x9e6d[_0xd1668c];return _0x408881;};'use strict';var _=require(_0xd9e6('0x0'));var util=require('util');var BPromise=require(_0xd9e6('0x1'));var db=require(_0xd9e6('0x2'))['db'];var config=require(_0xd9e6('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xd9e6('0x4'),'model':db[_0xd9e6('0x5')],'attributes':['id',_0xd9e6('0x6'),_0xd9e6('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xd9e6('0x6')],'where':{'role':_0xd9e6('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xd9e6('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xd9e6('0x6'),_0xd9e6('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x3f6229,_0x3e88f8,_0x596895){return db[_0xd9e6('0xb')][_0xd9e6('0xc')]({'where':{'name':_0x3f6229,'userProfileId':_0x3e88f8},'raw':!![]})['then'](function(_0x48c82b){if(_0x48c82b){if(_0x48c82b[_0xd9e6('0xd')]){switch(_0x3f6229){case _0xd9e6('0xe'):case _0xd9e6('0xf'):case _0xd9e6('0x10'):case _0xd9e6('0x11'):case _0xd9e6('0x12'):case _0xd9e6('0x13'):case _0xd9e6('0x14'):return db[_0x596895][_0xd9e6('0x15')](queryQueues);case'Telephones':return db[_0x596895][_0xd9e6('0x15')](queryTelephones);case _0xd9e6('0x16'):return db[_0x596895]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x596895][_0xd9e6('0x15')](queryCampaigns);}}else{return db['UserProfileResource'][_0xd9e6('0x15')]({'attributes':[_0xd9e6('0x17')],'where':{'sectionId':_0x48c82b['id']},'raw':!![]})[_0xd9e6('0x18')](function(_0x1591d5){if(_0x1591d5){var _0x79ce6a={'where':{'id':_['map'](_0x1591d5,'resourceId')},'raw':!![]};switch(_0x596895){case _0xd9e6('0x5'):_0x79ce6a['where'][_0xd9e6('0x7')]=_0xd9e6('0x8');break;case _0xd9e6('0x19'):_0x79ce6a[_0xd9e6('0x1a')][_0xd9e6('0xa')]=_0xd9e6('0x1b');break;}return db[_0x596895][_0xd9e6('0x15')](_0x79ce6a);}else{return[];}});}}else{return[];}})[_0xd9e6('0x18')](function(_0x2a1bf5){return _0x2a1bf5;});}function joinOrLeaveQueues(_0x2604a0,_0x4a95b4,_0x4eb9b0,_0x44ae12){_0x2604a0[_0x4a95b4](util[_0xd9e6('0x1c')](_0xd9e6('0x1d'),_0x4eb9b0,_0x44ae12['name']));if(_0x44ae12[_0xd9e6('0x4')]){for(var _0x106026=0x0;_0x106026<_0x44ae12[_0xd9e6('0x4')][_0xd9e6('0x1e')];_0x106026+=0x1){_0x2604a0[_0x4a95b4](util['format']('user:%s',_0x44ae12[_0xd9e6('0x4')][_0x106026][_0xd9e6('0x6')]));}}}function joinOrLeave(_0x4143c0,_0x5dc0bd,_0x33158e){var _0x370c64;if(_0x4143c0[_0xd9e6('0x1f')][_0xd9e6('0x20')]['id']){db[_0xd9e6('0x5')][_0xd9e6('0x21')]({'attributes':['id',_0xd9e6('0x6'),'role',_0xd9e6('0x22')],'where':{'id':_0x4143c0[_0xd9e6('0x1f')][_0xd9e6('0x20')]['id']},'include':[{'model':db[_0xd9e6('0x23')],'as':_0xd9e6('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xd9e6('0x25')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd9e6('0x26')],'as':_0xd9e6('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xd9e6('0x28')],'as':_0xd9e6('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xd9e6('0x2a')],'as':_0xd9e6('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0xd9e6('0x2c')],'as':_0xd9e6('0x2d'),'attributes':['id'],'raw':!![]}]})[_0xd9e6('0x18')](function(_0x874243){if(_0x874243){_0x370c64=_0x874243;_0x4143c0[_0x5dc0bd](util[_0xd9e6('0x1c')](_0xd9e6('0x2e'),_0x874243[_0xd9e6('0x6')]));var _0x18d5f4=[];switch(_0x874243['role']){case _0xd9e6('0x2f'):_0x4143c0[_0x5dc0bd](_0xd9e6('0x30'));_0x4143c0[_0x5dc0bd](_0xd9e6('0x31'));if(queryQueues[_0xd9e6('0x32')](_0xd9e6('0x33'))){delete queryQueues[_0xd9e6('0x33')];}_0x18d5f4[_0xd9e6('0x34')](db[_0xd9e6('0x35')]['findAll'](queryQueues));_0x18d5f4[_0xd9e6('0x34')](db[_0xd9e6('0x36')][_0xd9e6('0x15')](queryQueues));_0x18d5f4['push'](db[_0xd9e6('0x37')]['findAll'](queryQueues));_0x18d5f4[_0xd9e6('0x34')](db[_0xd9e6('0x38')]['findAll'](queryQueues));_0x18d5f4['push'](db[_0xd9e6('0x39')][_0xd9e6('0x15')](queryQueues));_0x18d5f4['push'](db[_0xd9e6('0x3a')]['findAll'](queryQueues));_0x18d5f4[_0xd9e6('0x34')](db[_0xd9e6('0x3b')][_0xd9e6('0x15')](queryQueues));_0x18d5f4[_0xd9e6('0x34')](db[_0xd9e6('0x5')][_0xd9e6('0x15')](queryTelephones));_0x18d5f4[_0xd9e6('0x34')](db[_0xd9e6('0x3c')]['findAll'](queryTrunks));_0x18d5f4['push'](db[_0xd9e6('0x19')][_0xd9e6('0x15')](queryCampaigns));_0x18d5f4[_0xd9e6('0x34')](db[_0xd9e6('0x5')][_0xd9e6('0x15')](queryAgents));break;case _0xd9e6('0x3d'):_0x4143c0[_0x5dc0bd](_0xd9e6('0x30'));_0x4143c0[_0x5dc0bd](_0xd9e6('0x31'));_0x18d5f4['push'](getAssociatedResources(_0xd9e6('0xe'),_0x874243[_0xd9e6('0x22')],_0xd9e6('0x35')));_0x18d5f4['push'](getAssociatedResources(_0xd9e6('0xf'),_0x874243[_0xd9e6('0x22')],_0xd9e6('0x36')));_0x18d5f4[_0xd9e6('0x34')](getAssociatedResources(_0xd9e6('0x10'),_0x874243[_0xd9e6('0x22')],_0xd9e6('0x37')));_0x18d5f4['push'](getAssociatedResources('SmsQueues',_0x874243['userProfileId'],_0xd9e6('0x38')));_0x18d5f4['push'](getAssociatedResources('MailQueues',_0x874243[_0xd9e6('0x22')],_0xd9e6('0x39')));_0x18d5f4[_0xd9e6('0x34')](getAssociatedResources('OpenchannelQueues',_0x874243[_0xd9e6('0x22')],_0xd9e6('0x3a')));_0x18d5f4[_0xd9e6('0x34')](getAssociatedResources('WhatsappQueues',_0x874243[_0xd9e6('0x22')],_0xd9e6('0x3b')));_0x18d5f4[_0xd9e6('0x34')](getAssociatedResources(_0xd9e6('0x3e'),_0x874243[_0xd9e6('0x22')],'User'));_0x18d5f4[_0xd9e6('0x34')](getAssociatedResources('Trunks',_0x874243['userProfileId'],'Trunk'));_0x18d5f4[_0xd9e6('0x34')](getAssociatedResources(_0xd9e6('0x3f'),_0x874243['userProfileId'],_0xd9e6('0x19')));_0x18d5f4[_0xd9e6('0x34')](db[_0xd9e6('0x5')][_0xd9e6('0x15')](queryAgents));break;case _0xd9e6('0x9'):_0x4143c0[_0x5dc0bd](_0xd9e6('0x30'));_0x4143c0[_0x5dc0bd](_0xd9e6('0x31'));_0x18d5f4[_0xd9e6('0x34')](_0x874243['getVoiceQueues']({'attributes':['id',_0xd9e6('0x6')]}));_0x18d5f4[_0xd9e6('0x34')](_0x874243[_0xd9e6('0x40')]({'attributes':['id',_0xd9e6('0x6')]}));_0x18d5f4[_0xd9e6('0x34')](_0x874243[_0xd9e6('0x41')]({'attributes':['id',_0xd9e6('0x6')]}));_0x18d5f4[_0xd9e6('0x34')](_0x874243[_0xd9e6('0x42')]({'attributes':['id','name']}));_0x18d5f4[_0xd9e6('0x34')](_0x874243[_0xd9e6('0x43')]({'attributes':['id',_0xd9e6('0x6')]}));_0x18d5f4[_0xd9e6('0x34')](_0x874243[_0xd9e6('0x44')]({'attributes':['id',_0xd9e6('0x6')]}));_0x18d5f4[_0xd9e6('0x34')](_0x874243[_0xd9e6('0x45')]({'attributes':['id','name']}));break;}return BPromise[_0xd9e6('0x46')](_0x18d5f4);}})[_0xd9e6('0x18')](function(_0x175e68){if(_0x175e68&&_0x175e68[_0xd9e6('0x1e')]){for(var _0x17843e=0x0;_0x17843e<_0x175e68[_0xd9e6('0x1e')];_0x17843e+=0x1){for(var _0xd22c56=0x0;_0xd22c56<_0x175e68[_0x17843e][_0xd9e6('0x1e')];_0xd22c56+=0x1){switch(_0x17843e){case 0x0:joinOrLeaveQueues(_0x4143c0,_0x5dc0bd,_0xd9e6('0x47'),_0x175e68[_0x17843e][_0xd22c56]);break;case 0x1:joinOrLeaveQueues(_0x4143c0,_0x5dc0bd,'chat',_0x175e68[_0x17843e][_0xd22c56]);break;case 0x2:joinOrLeaveQueues(_0x4143c0,_0x5dc0bd,_0xd9e6('0x48'),_0x175e68[_0x17843e][_0xd22c56]);break;case 0x3:joinOrLeaveQueues(_0x4143c0,_0x5dc0bd,_0xd9e6('0x49'),_0x175e68[_0x17843e][_0xd22c56]);break;case 0x4:joinOrLeaveQueues(_0x4143c0,_0x5dc0bd,_0xd9e6('0x4a'),_0x175e68[_0x17843e][_0xd22c56]);break;case 0x5:joinOrLeaveQueues(_0x4143c0,_0x5dc0bd,'openchannel',_0x175e68[_0x17843e][_0xd22c56]);break;case 0x6:joinOrLeaveQueues(_0x4143c0,_0x5dc0bd,_0xd9e6('0x4b'),_0x175e68[_0x17843e][_0xd22c56]);break;case 0x7:if(_0x370c64[_0xd9e6('0x7')]!==_0xd9e6('0x9'))_0x4143c0[_0x5dc0bd](util[_0xd9e6('0x1c')](_0xd9e6('0x4c'),_0x175e68[_0x17843e][_0xd22c56][_0xd9e6('0x6')]));break;case 0x8:if(_0x370c64[_0xd9e6('0x7')]!==_0xd9e6('0x9'))_0x4143c0[_0x5dc0bd](util[_0xd9e6('0x1c')](_0xd9e6('0x4d'),_0x175e68[_0x17843e][_0xd22c56][_0xd9e6('0x6')]));break;case 0x9:if(_0x370c64['role']!=='agent')_0x4143c0[_0x5dc0bd](util[_0xd9e6('0x1c')](_0xd9e6('0x4e'),_0x175e68[_0x17843e][_0xd22c56][_0xd9e6('0xa')],_0x175e68[_0x17843e][_0xd22c56][_0xd9e6('0x6')]));break;case 0xa:_0x4143c0[_0x5dc0bd](util[_0xd9e6('0x1c')](_0xd9e6('0x2e'),_0x175e68[_0x17843e][_0xd22c56]['name']));break;}}}}})[_0xd9e6('0x18')](function(){if(_0x5dc0bd==='leave'){var _0x1fe723=_[_0xd9e6('0x4f')](_0x370c64[_0xd9e6('0x24')],'id');return _0x370c64[_0xd9e6('0x50')](_0x1fe723)[_0xd9e6('0x18')](function(){for(var _0x57c531=0x0;_0x57c531<_0x1fe723['length'];_0x57c531+=0x1){_0x33158e[_0xd9e6('0x51')](_0xd9e6('0x52'),{'ChatInteractionId':Number(_0x1fe723[_0x57c531]),'UserId':Number(_0x370c64['id'])});}});}})['then'](function(){if(_0x5dc0bd===_0xd9e6('0x53')){var _0x205c75=_[_0xd9e6('0x4f')](_0x370c64[_0xd9e6('0x54')],'id');return _0x370c64['removeMailInteractions'](_0x205c75)[_0xd9e6('0x18')](function(){for(var _0x5f16d5=0x0;_0x5f16d5<_0x205c75[_0xd9e6('0x1e')];_0x5f16d5+=0x1){_0x33158e[_0xd9e6('0x51')](_0xd9e6('0x55'),{'MailInteractionId':Number(_0x205c75[_0x5f16d5]),'UserId':Number(_0x370c64['id'])});}});}})[_0xd9e6('0x18')](function(){if(_0x5dc0bd===_0xd9e6('0x53')){var _0x13b13c=_[_0xd9e6('0x4f')](_0x370c64[_0xd9e6('0x27')],'id');return _0x370c64[_0xd9e6('0x56')](_0x13b13c)[_0xd9e6('0x18')](function(){for(var _0x3fd167=0x0;_0x3fd167<_0x13b13c[_0xd9e6('0x1e')];_0x3fd167+=0x1){_0x33158e[_0xd9e6('0x51')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x13b13c[_0x3fd167]),'UserId':Number(_0x370c64['id'])});}});}})[_0xd9e6('0x18')](function(){if(_0x5dc0bd===_0xd9e6('0x53')){var _0x479439=_[_0xd9e6('0x4f')](_0x370c64[_0xd9e6('0x29')],'id');return _0x370c64[_0xd9e6('0x57')](_0x479439)['then'](function(){for(var _0x254b8f=0x0;_0x254b8f<_0x479439['length'];_0x254b8f+=0x1){_0x33158e[_0xd9e6('0x51')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x479439[_0x254b8f]),'UserId':Number(_0x370c64['id'])});}});}})[_0xd9e6('0x18')](function(){if(_0x5dc0bd===_0xd9e6('0x53')){var _0x37c25d=_['map'](_0x370c64['OpenchannelInteractions'],'id');return _0x370c64['removeOpenchannelInteractions'](_0x37c25d)['then'](function(){for(var _0xb58033=0x0;_0xb58033<_0x37c25d[_0xd9e6('0x1e')];_0xb58033+=0x1){_0x33158e['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x37c25d[_0xb58033]),'UserId':Number(_0x370c64['id'])});}});}})[_0xd9e6('0x18')](function(){if(_0x5dc0bd===_0xd9e6('0x53')){var _0x63cb6=_[_0xd9e6('0x4f')](_0x370c64[_0xd9e6('0x2d')],'id');return _0x370c64['removeWhatsappInteractions'](_0x63cb6)[_0xd9e6('0x18')](function(){for(var _0xbca337=0x0;_0xbca337<_0x63cb6[_0xd9e6('0x1e')];_0xbca337+=0x1){_0x33158e[_0xd9e6('0x51')](_0xd9e6('0x58'),{'WhatsappInteractionId':Number(_0x63cb6[_0xbca337]),'UserId':Number(_0x370c64['id'])});}});}})['catch'](function(_0x5920dd){_0x4143c0[_0xd9e6('0x59')](_0x5920dd);});}}function onDisconnect(_0x17ef8e,_0x24e4f9){joinOrLeave(_0x17ef8e,_0xd9e6('0x53'),_0x24e4f9);}function onConnect(_0x18262d){joinOrLeave(_0x18262d,_0xd9e6('0x5a'));}exports[_0xd9e6('0x5b')]=function(_0x1baecc){_0x1baecc['on'](_0xd9e6('0x5c'),function(_0x2a1505){_0x2a1505[_0xd9e6('0x5d')](0x0);_0x2a1505[_0xd9e6('0x5e')]=_0x2a1505['request'][_0xd9e6('0x5c')][_0xd9e6('0x5f')]+':'+_0x2a1505[_0xd9e6('0x60')][_0xd9e6('0x5c')][_0xd9e6('0x61')];_0x2a1505[_0xd9e6('0x62')]=new Date();_0x2a1505[_0xd9e6('0x59')]=function(_0x158161){console[_0xd9e6('0x59')](_0xd9e6('0x63')+_0x2a1505[_0xd9e6('0x64')][_0xd9e6('0x6')]+'['+_0x2a1505[_0xd9e6('0x5e')]+']',_0x158161);};_0x2a1505['on'](_0xd9e6('0x65'),function(){onDisconnect(_0x2a1505,_0x1baecc);_0x2a1505[_0xd9e6('0x59')](_0xd9e6('0x66'));});onConnect(_0x2a1505);_0x2a1505[_0xd9e6('0x59')](_0xd9e6('0x67'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 7166309..3c64d0c 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 _0xa7ec=['ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','interface','agent','incomingmessage','outgoingmessage','AfterCreateMessage','get','event','offlineMessage','opened','contact','format','name','AfterCreate','changed','closed','substatus','query','SIP/%s','AfterUpdate','find','fullname','internal','default','length','hasOwnProperty','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','SmsInteraction','Sms','SmsMessage','Whatsapp','WhatsappInteraction','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','channel','motionChannel','resolve'];(function(_0x46f94a,_0xf9204){var _0xca7568=function(_0x2c7742){while(--_0x2c7742){_0x46f94a['push'](_0x46f94a['shift']());}};_0xca7568(++_0xf9204);}(_0xa7ec,0x73));var _0xca7e=function(_0x25448a,_0x165f38){_0x25448a=_0x25448a-0x0;var _0x5158cd=_0xa7ec[_0x25448a];return _0x5158cd;};'use strict';var util=require(_0xca7e('0x0'));var db=require(_0xca7e('0x1'))['db'];var jayson=require(_0xca7e('0x2'));var logger=require(_0xca7e('0x3'))(_0xca7e('0x4'));var client=jayson[_0xca7e('0x5')][_0xca7e('0x6')]({'port':0x232a});var triggers=[{'channel':_0xca7e('0x7'),'model':_0xca7e('0x8'),'event':_0xca7e('0x9'),'condition':_0xca7e('0xa'),'callback':afterCreate},{'channel':_0xca7e('0x7'),'model':_0xca7e('0x8'),'event':_0xca7e('0xb'),'condition':_0xca7e('0xc'),'callback':afterUpdate},{'channel':_0xca7e('0x7'),'model':_0xca7e('0xd'),'event':_0xca7e('0x9'),'condition':_0xca7e('0xe'),'callback':afterCreateMessage},{'channel':'Chat','model':_0xca7e('0xf'),'event':_0xca7e('0x9'),'condition':_0xca7e('0xe'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0xca7e('0x10'),'event':_0xca7e('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xca7e('0x11'),'model':_0xca7e('0x10'),'event':_0xca7e('0xb'),'condition':_0xca7e('0xc'),'callback':afterUpdate},{'channel':_0xca7e('0x11'),'model':_0xca7e('0x12'),'event':_0xca7e('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xca7e('0x13'),'model':_0xca7e('0x14'),'event':_0xca7e('0x9'),'condition':_0xca7e('0xa'),'callback':afterCreate},{'channel':'Whatsapp','model':_0xca7e('0x14'),'event':_0xca7e('0xb'),'condition':_0xca7e('0xc'),'callback':afterUpdate},{'channel':'Whatsapp','model':'WhatsappMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':_0xca7e('0x15'),'event':_0xca7e('0x9'),'condition':_0xca7e('0xa'),'callback':afterCreate},{'channel':_0xca7e('0x16'),'model':_0xca7e('0x15'),'event':'afterUpdate','condition':_0xca7e('0xc'),'callback':afterUpdate},{'channel':'Fax','model':_0xca7e('0x17'),'event':_0xca7e('0x9'),'condition':_0xca7e('0xe'),'callback':afterCreateMessage},{'channel':_0xca7e('0x18'),'model':_0xca7e('0x19'),'event':_0xca7e('0x9'),'condition':_0xca7e('0xa'),'callback':afterCreate},{'channel':_0xca7e('0x18'),'model':'MailInteraction','event':_0xca7e('0xb'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xca7e('0x18'),'model':_0xca7e('0x1a'),'event':_0xca7e('0x9'),'condition':_0xca7e('0xe'),'callback':afterCreateMessage},{'channel':_0xca7e('0x1b'),'model':'OpenchannelInteraction','event':_0xca7e('0x9'),'condition':_0xca7e('0xa'),'callback':afterCreate},{'channel':_0xca7e('0x1b'),'model':_0xca7e('0x1c'),'event':_0xca7e('0xb'),'condition':_0xca7e('0xc'),'callback':afterUpdate},{'channel':_0xca7e('0x1b'),'model':_0xca7e('0x1d'),'event':_0xca7e('0x9'),'condition':_0xca7e('0xe'),'callback':afterCreateMessage}];function request(_0x133112){return client[_0xca7e('0x1e')](_0xca7e('0x1f'),_0x133112)[_0xca7e('0x20')](function(_0x53c1b1){logger[_0xca7e('0x21')](_0xca7e('0x22'),_0xca7e('0x1f'),_0x53c1b1);if(_0x53c1b1[_0xca7e('0x23')]){if(_0x53c1b1[_0xca7e('0x23')][_0xca7e('0x24')]===0x1f4){logger[_0xca7e('0x23')](_0xca7e('0x22'),'EventManager',_0x53c1b1[_0xca7e('0x23')]);}}})[_0xca7e('0x25')](function(_0x3e9bb4){logger['error'](_0xca7e('0x22'),_0xca7e('0x1f'),_0x3e9bb4);});}function afterCreateMessage(_0x17025f){return function(_0x1be6a9){_0x1be6a9=_0x1be6a9['get']({'plain':!![]});_0x1be6a9[_0xca7e('0x26')]=_0x17025f;_0x1be6a9[_0xca7e('0x27')]=_0x17025f;_0x1be6a9['event']=_0x1be6a9['direction'];Promise[_0xca7e('0x28')]()['then'](function(){if(typeof _0x1be6a9[_0xca7e('0x29')]===_0xca7e('0x2a'))return null;var _0x4c09d6=_0xca7e('0x2b')+_0x1be6a9[_0xca7e('0x29')];return db[_0xca7e('0x2c')]['query'](_0x4c09d6,{'type':db[_0xca7e('0x2d')][_0xca7e('0x2e')][_0xca7e('0x2f')],'raw':!![]});})['then'](function(_0x5e61da){if(_0x5e61da){_0x1be6a9['contact']=_0x5e61da[0x0];}if(typeof _0x1be6a9[_0xca7e('0x30')]===_0xca7e('0x2a'))return;return getAgent(_0x1be6a9['UserId']);})[_0xca7e('0x20')](function(_0xf92e08){if(_0xf92e08){_0x1be6a9[_0xca7e('0x31')]=util['format']('SIP/%s',_0xf92e08['name']);_0x1be6a9[_0xca7e('0x32')]=_0xf92e08;_0x1be6a9['channel']=_0x17025f;return request({'event':_0xca7e('0x33'),'message':_0x1be6a9});}else{return request({'event':_0xca7e('0x34'),'message':_0x1be6a9});}})[_0xca7e('0x25')](function(_0xa32baf){logger['error'](_0xca7e('0x22'),_0xca7e('0x35'),_0xa32baf);});};}function afterCreateOfflineMessage(_0x3f2037){return function(_0x223459){_0x223459=_0x223459[_0xca7e('0x36')]({'plain':!![]});_0x223459[_0xca7e('0x26')]=_0x3f2037;_0x223459[_0xca7e('0x27')]=_0x3f2037;_0x223459[_0xca7e('0x37')]=_0xca7e('0x38');return request({'event':_0x223459[_0xca7e('0x37')],'message':_0x223459});};}function afterCreate(_0x32f585,_0x57fd73){return function(_0xc43f04){_0xc43f04=_0xc43f04['get']({'plain':!![]});_0xc43f04[_0xca7e('0x26')]=_0x32f585;_0xc43f04[_0xca7e('0x27')]=_0x32f585;_0xc43f04[_0xca7e('0x37')]=_0xca7e('0x39');Promise[_0xca7e('0x28')]()[_0xca7e('0x20')](function(){var _0x452fb7=_0xca7e('0x2b')+_0xc43f04[_0xca7e('0x29')];return db['sequelize']['query'](_0x452fb7,{'type':db[_0xca7e('0x2d')]['QueryTypes'][_0xca7e('0x2f')],'raw':!![]});})[_0xca7e('0x20')](function(_0x1dabab){if(_0x1dabab){_0xc43f04[_0xca7e('0x3a')]=_0x1dabab[0x0];}if(typeof _0xc43f04[_0xca7e('0x30')]===_0xca7e('0x2a'))return;return getAgent(_0xc43f04[_0xca7e('0x30')]);})[_0xca7e('0x20')](function(_0x1fbeb2){if(_0x1fbeb2){_0xc43f04[_0xca7e('0x31')]=util[_0xca7e('0x3b')]('SIP/%s',_0x1fbeb2[_0xca7e('0x3c')]);_0xc43f04[_0xca7e('0x32')]=_0x1fbeb2;}return request({'event':_0x57fd73,'message':_0xc43f04});})[_0xca7e('0x25')](function(_0x4dd82a){logger['error'](_0xca7e('0x22'),_0xca7e('0x3d'),_0x4dd82a);});};}function afterUpdate(_0x354a78){return function(_0x10fc5b){var _0x541624=_0x10fc5b[_0xca7e('0x3e')](_0xca7e('0x3f'))&&_0x10fc5b[_0xca7e('0x3f')];var _0x1ddac8=_0x10fc5b['changed'](_0xca7e('0x40'));if(_0x541624||_0x1ddac8){var _0x3157c5=_0x541624?_0xca7e('0xc'):_0xca7e('0x40');var _0x27ab9d=_0x10fc5b[_0xca7e('0x36')]({'plain':!![]});_0x27ab9d[_0xca7e('0x26')]=_0x354a78;_0x27ab9d[_0xca7e('0x27')]=_0x354a78;_0x27ab9d[_0xca7e('0x37')]=_0x541624?_0xca7e('0x3f'):_0xca7e('0x40');var _0x10e8d5=_0xca7e('0x2b')+_0x27ab9d[_0xca7e('0x29')];return db['sequelize'][_0xca7e('0x41')](_0x10e8d5,{'type':db[_0xca7e('0x2d')]['QueryTypes'][_0xca7e('0x2f')],'raw':!![]})[_0xca7e('0x20')](function(_0x3f2bd3){if(_0x3f2bd3){_0x27ab9d['contact']=_0x3f2bd3[0x0];}if(typeof _0x27ab9d[_0xca7e('0x30')]===_0xca7e('0x2a'))return;return getAgent(_0x27ab9d[_0xca7e('0x30')]);})['then'](function(_0x4e6d1c){if(_0x4e6d1c){_0x27ab9d['interface']=util[_0xca7e('0x3b')](_0xca7e('0x42'),_0x4e6d1c['name']);_0x27ab9d['agent']=_0x4e6d1c;}return request({'event':_0x3157c5,'message':_0x27ab9d});})['catch'](function(_0x3f7575){logger[_0xca7e('0x23')](_0xca7e('0x22'),_0xca7e('0x43'),_0x3f7575);});}};}function getAgent(_0x3eb832){return db['User'][_0xca7e('0x44')]({'where':{'id':_0x3eb832},'attributes':['id',_0xca7e('0x3c'),_0xca7e('0x45'),'email',_0xca7e('0x46')],'raw':!![]})[_0xca7e('0x20')](function(_0x4852b5){return _0x4852b5;});}exports[_0xca7e('0x47')]=function(){for(var _0x316e7d=0x0;_0x316e7d=_0xb6c729[_0xdb17('0x15')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x196ef9(_0x9ac1aa);})[_0xdb17('0x16')](function(_0x2baed1){_0x16f056(_0x2baed1);});});}; \ No newline at end of file +var _0xc416=['agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','whatsapp','openchannel','getChannels','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','count','agent'];(function(_0x2dd0d5,_0x2e8cf5){var _0x2e18ea=function(_0x18ec67){while(--_0x18ec67){_0x2dd0d5['push'](_0x2dd0d5['shift']());}};_0x2e18ea(++_0x2e8cf5);}(_0xc416,0x1e7));var _0x6c41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc416[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6c41('0x0'));var BPromise=require(_0x6c41('0x1'));var db=require(_0x6c41('0x2'))['db'];var util=require(_0x6c41('0x3'));var channels=[_0x6c41('0x4'),_0x6c41('0x5'),_0x6c41('0x6'),'fax','sms',_0x6c41('0x7'),_0x6c41('0x8')];exports[_0x6c41('0x9')]=function(){return channels;};exports[_0x6c41('0xa')]=function(_0x2cb58e){_0x2cb58e=_0x2cb58e['toLowerCase']();return _[_0x6c41('0xb')](channels,_0x2cb58e);};exports[_0x6c41('0xc')]=function(_0x161190,_0xb8b2bb,_0x2395ea,_0x203b71){var _0x385cb6={'loginAttempts':_0xb8b2bb,'blocked':_0x2395ea};if(!_[_0x6c41('0xd')](_0x203b71)){_0x385cb6[_0x6c41('0xe')]=_0x203b71;}return _0x161190[_0x6c41('0xf')](_0x385cb6);};exports[_0x6c41('0x10')]=function(_0x332c01){return new BPromise(function(_0x14f9c9,_0x4939f4){var _0x2bdf01=0x0;if(_0x332c01['role']!=='agent'){_0x14f9c9(_0x332c01);}db['User'][_0x6c41('0x11')]({'where':{'role':_0x6c41('0x12'),'online':!![],'id':{'$ne':_0x332c01['id']}}})['then'](function(_0x13a8b6){_0x2bdf01=_0x13a8b6;return util[_0x6c41('0x10')]();})['then'](function(_0x2eba90){if(_0x2eba90&&_0x2eba90['agents']&&_0x2bdf01>=_0x2eba90[_0x6c41('0x13')]){throw Error(_0x6c41('0x14'));}_0x14f9c9(_0x332c01);})[_0x6c41('0x15')](function(_0x20d0ad){_0x4939f4(_0x20d0ad);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 89ea2d8..ccad9ec 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc9d=['exports','404','status','render','json'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x58038b,_0x41a272){_0x58038b=_0x58038b-0x0;var _0x68986f=_0xbc9d[_0x58038b];return _0x68986f;};'use strict';module[_0xdbc9('0x0')][0x194]=function pageNotFound(_0xbca678,_0x8aa82b){var _0x434f6e=_0xdbc9('0x1');var _0x4d5f79=0x194;var _0x4d8228={'status':_0x4d5f79};_0x8aa82b['status'](_0x4d8228[_0xdbc9('0x2')]);_0x8aa82b[_0xdbc9('0x3')](_0x434f6e,{},function(_0x3e63f1,_0x4a32b4){if(_0x3e63f1){return _0x8aa82b[_0xdbc9('0x2')](_0x4d8228[_0xdbc9('0x2')])[_0xdbc9('0x4')](_0x4d8228);}_0x8aa82b['send'](_0x4a32b4);});}; \ No newline at end of file +var _0x7899=['exports','404','status','render','send'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x7899,0x168));var _0x9789=function(_0x178668,_0x1ec300){_0x178668=_0x178668-0x0;var _0x26107d=_0x7899[_0x178668];return _0x26107d;};'use strict';module[_0x9789('0x0')][0x194]=function pageNotFound(_0x244be8,_0x28f447){var _0x1dc7c6=_0x9789('0x1');var _0x2072a7=0x194;var _0x15ea0d={'status':_0x2072a7};_0x28f447[_0x9789('0x2')](_0x15ea0d['status']);_0x28f447[_0x9789('0x3')](_0x1dc7c6,{},function(_0x57c1b7,_0x1f5929){if(_0x57c1b7){return _0x28f447[_0x9789('0x2')](_0x15ea0d[_0x9789('0x2')])['json'](_0x15ea0d);}_0x28f447[_0x9789('0x4')](_0x1f5929);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 584cf5b..5678710 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2cb=['Account','Owner','mail_interaction_has_tags','Tags','Attachments','MailInteractionId','ChatWebsiteId','ChatOfflineMessageId','TagId','Items','Disposition','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','ThroughTags','Users','user_has_fax_interactions','Interaction','AttachmentId','SmsAccountId','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatMessage','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatInternalMessage','ChatGroupId','CmHopper','JscriptySessions','Company','CompanyId','cm_contact_has_tags','Campaign','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','Automation','Any','Actions','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','sms_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticCustomReport','Fields','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','SalesforceAccount','Description','Field','FieldId','SugarcrmAccount','SugarcrmConfiguration','Subject','VariableId','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskAccount','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerConfiguration','Dynamics365Field','ToId','SessionId','ProjectId','team_has_fax_queues','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToAgent','ToQueue','ToAccount','ChatTransferReport','FromAccount','ToChatQueueId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToUserId','ToSmsQueueId','ToSmsAccountId','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','user_has_whatsapp_interactions','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','team_has_whatsapp_queues','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','xcall','utf8mb4','database','password','options','username','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','../api/condition/condition.model','Interval','Pause','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','WhatsappAccount','WhatsappApplication','WhatsappInteraction','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','cascade','UserId','userSetting','hasMany','VoiceRecording','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','ReportAgentPreview','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteractions','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','VoiceQueues','VoicePrefixes','UserVoicePrefix','MailQueues','ChatQueues','FaxQueue','FaxQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','ChanSpyId','VoiceContext','Applications','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Teams','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','Contact','ContactId','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Interactions','List','ListId','mandatoryDispositionPauseId','Agents','team_has_mail_queues'];(function(_0x5d95be,_0x462e3c){var _0x1e5f22=function(_0x32707b){while(--_0x32707b){_0x5d95be['push'](_0x5d95be['shift']());}};_0x1e5f22(++_0x462e3c);}(_0xe2cb,0x90));var _0xbe2c=function(_0xbea377,_0x3af693){_0xbea377=_0xbea377-0x0;var _0x21785d=_0xe2cb[_0xbea377];return _0x21785d;};'use strict';var config=require(_0xbe2c('0x0'));var Sequelize=require(_0xbe2c('0x1'));var _=require(_0xbe2c('0x2'));var jstz=require(_0xbe2c('0x3'));var timezone=jstz['determine']();config[_0xbe2c('0x1')]=_[_0xbe2c('0x4')](config[_0xbe2c('0x1')],{'database':_0xbe2c('0x5'),'username':'xcall','password':_0xbe2c('0x6'),'options':{'host':_0xbe2c('0x7'),'port':0xcea,'dialect':_0xbe2c('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xbe2c('0x9')](),'define':{'charset':_0xbe2c('0xa'),'collate':_0xbe2c('0xb')}}});config[_0xbe2c('0xc')]=_[_0xbe2c('0x4')](config[_0xbe2c('0xc')],{'database':_0xbe2c('0x5'),'username':_0xbe2c('0xd'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xbe2c('0x8'),'dialectOptions':{'charset':_0xbe2c('0xe')},'logging':![],'timezone':timezone[_0xbe2c('0x9')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xbe2c('0x1')][_0xbe2c('0xf')],config[_0xbe2c('0x1')]['username'],config[_0xbe2c('0x1')][_0xbe2c('0x10')],config['sequelize'][_0xbe2c('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xbe2c('0xc')][_0xbe2c('0xf')],config[_0xbe2c('0xc')][_0xbe2c('0x12')],config[_0xbe2c('0xc')]['password'],config[_0xbe2c('0xc')][_0xbe2c('0x11')])};db['User']=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/user/user.model');db[_0xbe2c('0x14')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x15'));db['VoiceContext']=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x16'));db[_0xbe2c('0x17')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x18'));db[_0xbe2c('0x19')]=db['sequelize'][_0xbe2c('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xbe2c('0x1a')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x1b'));db['VoiceRecording']=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0xbe2c('0x1c')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/screenRecording/screenRecording.model');db[_0xbe2c('0x1d')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x1e'));db['VoiceMailMessage']=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x1f'));db[_0xbe2c('0x20')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x21'));db[_0xbe2c('0x22')]=db['sequelize']['import'](_0xbe2c('0x23'));db['VoiceAgentReport']=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xbe2c('0x24')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x25'));db[_0xbe2c('0x26')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/memberReport/memberReport.model');db[_0xbe2c('0x27')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x28'));db[_0xbe2c('0x29')]=db['sequelize'][_0xbe2c('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xbe2c('0x2a')]=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0x2b'));db[_0xbe2c('0x2c')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x2d'));db[_0xbe2c('0x2e')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x2f'));db[_0xbe2c('0x30')]=db[_0xbe2c('0x1')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0xbe2c('0x31')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x32'));db[_0xbe2c('0x33')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x34'));db[_0xbe2c('0x35')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xbe2c('0x36')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0xbe2c('0x37')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x38'));db[_0xbe2c('0x39')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x3a'));db[_0xbe2c('0x3b')]=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0x3c'));db[_0xbe2c('0x3d')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0xbe2c('0x3e')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0xbe2c('0x3f')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x40'));db[_0xbe2c('0x41')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x42'));db[_0xbe2c('0x43')]=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0x44'));db[_0xbe2c('0x45')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x46'));db[_0xbe2c('0x47')]=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0x48'));db[_0xbe2c('0x49')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x4a'));db[_0xbe2c('0x4b')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/faxApplication/faxApplication.model');db[_0xbe2c('0x4c')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x4d'));db[_0xbe2c('0x4e')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x4f'));db['FaxQueue']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x50'));db[_0xbe2c('0x51')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x52'));db[_0xbe2c('0x53')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x54'));db[_0xbe2c('0x55')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/smsApplication/smsApplication.model');db[_0xbe2c('0x56')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x57'));db[_0xbe2c('0x58')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/smsMessage/smsMessage.model');db[_0xbe2c('0x59')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/smsQueue/smsQueue.model');db[_0xbe2c('0x5a')]=db['sequelize']['import'](_0xbe2c('0x5b'));db['OpenchannelApplication']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x5c'));db[_0xbe2c('0x5d')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x5e'));db['OpenchannelMessage']=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x5f'));db[_0xbe2c('0x60')]=db[_0xbe2c('0x1')]['import']('../api/openchannelQueue/openchannelQueue.model');db[_0xbe2c('0x61')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x62'));db[_0xbe2c('0x63')]=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0x64'));db[_0xbe2c('0x65')]=db['sequelize']['import']('../api/chatApplication/chatApplication.model');db[_0xbe2c('0x66')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x67'));db['ChatMessage']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x68'));db[_0xbe2c('0x69')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x6a'));db[_0xbe2c('0x6b')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x6c'));db[_0xbe2c('0x6d')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/chatGroup/chatGroup.model');db[_0xbe2c('0x6e')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x6f'));db[_0xbe2c('0x70')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x71'));db[_0xbe2c('0x72')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x73'));db['CmHopper']=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0x74'));db[_0xbe2c('0x75')]=db['sequelize'][_0xbe2c('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xbe2c('0x76')]=db['sequelize'][_0xbe2c('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x77'));db['ReportAgentPreview']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x78'));db[_0xbe2c('0x79')]=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0x7a'));db[_0xbe2c('0x7b')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x7c'));db['Automation']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x7d'));db[_0xbe2c('0x7e')]=db['sequelize']['import'](_0xbe2c('0x7f'));db['Disposition']=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x80'));db['Condition']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x81'));db[_0xbe2c('0x82')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/interval/interval.model');db[_0xbe2c('0x83')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/pause/pause.model');db['Cdr']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x84'));db[_0xbe2c('0x85')]=db[_0xbe2c('0x1')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xbe2c('0x86')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x87'));db[_0xbe2c('0x88')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x89'));db[_0xbe2c('0x8a')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x8b'));db[_0xbe2c('0x8c')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x8d'));db[_0xbe2c('0x8e')]=db['sequelize'][_0xbe2c('0x13')]('../api/trigger/trigger.model');db[_0xbe2c('0x8f')]=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0x90'));db[_0xbe2c('0x91')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x92'));db[_0xbe2c('0x93')]=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0x94'));db['AnalyticCustomReport']=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0x95'));db['AnalyticDefaultReport']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x96'));db[_0xbe2c('0x97')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x98'));db['AnalyticMetric']=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0x99'));db[_0xbe2c('0x9a')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x9b'));db['SalesforceAccount']=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x9c'));db[_0xbe2c('0x9d')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xbe2c('0x9e')]=db['sequelize']['import'](_0xbe2c('0x9f'));db['SugarcrmAccount']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xa0'));db['SugarcrmConfiguration']=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0xa1'));db[_0xbe2c('0xa2')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xbe2c('0xa3')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/intDeskAccount/intDeskAccount.model');db[_0xbe2c('0xa4')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xa5'));db['DeskField']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xa6'));db[_0xbe2c('0xa7')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xa8'));db['ZohoConfiguration']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xa9'));db[_0xbe2c('0xaa')]=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0xab'));db['ZendeskAccount']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xac'));db[_0xbe2c('0xad')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xae'));db['ZendeskField']=db['sequelize']['import'](_0xbe2c('0xaf'));db[_0xbe2c('0xb0')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xb1'));db['FreshdeskConfiguration']=db[_0xbe2c('0x1')]['import'](_0xbe2c('0xb2'));db[_0xbe2c('0xb3')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xb4'));db['VtigerAccount']=db[_0xbe2c('0x1')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db['VtigerConfiguration']=db['sequelize'][_0xbe2c('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xbe2c('0xb5')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0xb6'));db[_0xbe2c('0xb7')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xb8'));db[_0xbe2c('0xb9')]=db[_0xbe2c('0x1')]['import']('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xbe2c('0xba')]=db['sequelize'][_0xbe2c('0x13')]('../api/intServicenowField/intServicenowField.model');db[_0xbe2c('0xbb')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xbc'));db[_0xbe2c('0xbd')]=db['sequelize']['import'](_0xbe2c('0xbe'));db['Dynamics365Field']=db[_0xbe2c('0x1')]['import'](_0xbe2c('0xbf'));db[_0xbe2c('0xc0')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xbe2c('0xc1')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xc2'));db[_0xbe2c('0xc3')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xc4'));db[_0xbe2c('0x91')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x92'));db[_0xbe2c('0xc5')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/network/network.model');db[_0xbe2c('0xc6')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xc7'));db['ChatInternalMessage']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xc8'));db[_0xbe2c('0xc9')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0xca'));db[_0xbe2c('0xcb')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xbe2c('0xcc')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xcd'));db[_0xbe2c('0xce')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/smsQueueReport/smsQueueReport.model');db[_0xbe2c('0xcf')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xd0'));db[_0xbe2c('0xd1')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0xbe2c('0xd2')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0xd3'));db[_0xbe2c('0xd4')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xd5'));db[_0xbe2c('0xd6')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xd7'));db[_0xbe2c('0xd8')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/squareProject/squareProject.model');db[_0xbe2c('0xd9')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xda'));db[_0xbe2c('0xdb')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xdc'));db[_0xbe2c('0xdd')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/team/team.model');db[_0xbe2c('0xde')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/license/license.model');db['Campaign']=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0xdf'));db[_0xbe2c('0xe0')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0xe1'));db[_0xbe2c('0xe2')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xe3'));db[_0xbe2c('0xe4')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0xe5'));db[_0xbe2c('0xe6')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0xe7'));db['ChatTransferReport']=db[_0xbe2c('0x1')]['import'](_0xbe2c('0xe8'));db['FaxTransferReport']=db['sequelize']['import']('../api/faxTransferReport/faxTransferReport.model');db[_0xbe2c('0xe9')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xea'));db[_0xbe2c('0xeb')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xec'));db[_0xbe2c('0xed')]=db[_0xbe2c('0x1')]['import']('../api/cmList/cmList.model');db[_0xbe2c('0xee')]=db['sequelize'][_0xbe2c('0x13')]('../api/voicePrefix/voicePrefix.model');db[_0xbe2c('0xef')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xf0'));db[_0xbe2c('0xf1')]=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0xf2'));db[_0xbe2c('0xf3')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xf4'));db['UserNotification']=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/userNotification/userNotification.model');db[_0xbe2c('0xf5')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/whatsappAccount/whatsappAccount.model');db[_0xbe2c('0xf6')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0xbe2c('0xf7')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0xf8'));db['WhatsappQueueReport']=db[_0xbe2c('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xbe2c('0xf9')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0xfa'));db[_0xbe2c('0xfb')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0xfc'));db['CloudProvider']=db['sequelize'][_0xbe2c('0x13')](_0xbe2c('0xfd'));db[_0xbe2c('0xfe')]=db[_0xbe2c('0x1')]['import'](_0xbe2c('0xff'));db['TeamVoicePrefix']=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x100'));db['UserVoicePrefix']=db[_0xbe2c('0x1')]['import'](_0xbe2c('0x101'));db[_0xbe2c('0x102')]=db[_0xbe2c('0x1')][_0xbe2c('0x13')](_0xbe2c('0x103'));db[_0xbe2c('0x104')][_0xbe2c('0x105')](db['VoiceMail'],{'as':_0xbe2c('0x1d'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x107')});db['User'][_0xbe2c('0x105')](db[_0xbe2c('0x102')],{'as':_0xbe2c('0x108'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x104')][_0xbe2c('0x109')](db[_0xbe2c('0x10a')],{'as':_0xbe2c('0x10b'),'foreignKey':'UserId'});db[_0xbe2c('0x104')][_0xbe2c('0x109')](db[_0xbe2c('0x10c')],{'as':_0xbe2c('0x10d'),'foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x104')][_0xbe2c('0x109')](db[_0xbe2c('0x17')],{'as':_0xbe2c('0x10e'),'onDelete':_0xbe2c('0x106'),'hooks':!![]});db[_0xbe2c('0x104')][_0xbe2c('0x109')](db['CmHopperFinal'],{'as':_0xbe2c('0x10f'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0xbe2c('0x110')],{'as':_0xbe2c('0x111'),'foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x104')][_0xbe2c('0x109')](db[_0xbe2c('0x112')],{'as':_0xbe2c('0x112'),'foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x104')][_0xbe2c('0x109')](db[_0xbe2c('0x5d')],{'as':_0xbe2c('0x113'),'foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x104')][_0xbe2c('0x109')](db[_0xbe2c('0x66')],{'as':'ChatInteractions','foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x104')][_0xbe2c('0x109')](db['SmsInteraction'],{'as':_0xbe2c('0x114'),'foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x104')][_0xbe2c('0x109')](db[_0xbe2c('0x4c')],{'as':_0xbe2c('0x115'),'foreignKey':_0xbe2c('0x107')});db['User']['hasMany'](db[_0xbe2c('0x3e')],{'as':_0xbe2c('0x116'),'foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x104')]['hasMany'](db[_0xbe2c('0xf7')],{'as':'WhatsappInteractions','foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x104')]['hasMany'](db['UserNotification'],{'as':'UserNotifications','foreignKey':'SenderId'});db['User'][_0xbe2c('0x117')](db[_0xbe2c('0xef')],{'as':'UserProfile','foreignKey':_0xbe2c('0x118')});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db['ChatGroup'],{'as':_0xbe2c('0x11a'),'through':_0xbe2c('0x11b')});db[_0xbe2c('0x104')]['belongsToMany'](db[_0xbe2c('0x72')],{'as':_0xbe2c('0x11c'),'through':_0xbe2c('0x11d')});db[_0xbe2c('0x104')]['belongsToMany'](db['CmList'],{'as':_0xbe2c('0x11e'),'through':_0xbe2c('0x11f')});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db['Team'],{'through':_0xbe2c('0x120')});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db[_0xbe2c('0x3e')],{'as':_0xbe2c('0x116'),'through':_0xbe2c('0x121')});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db['ChatInteraction'],{'as':_0xbe2c('0x122'),'through':_0xbe2c('0x123')});db[_0xbe2c('0x104')]['belongsToMany'](db[_0xbe2c('0x4c')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0xbe2c('0x104')]['belongsToMany'](db[_0xbe2c('0x56')],{'as':'SmsInteractions','through':_0xbe2c('0x124')});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db['OpenchannelInteraction'],{'as':_0xbe2c('0x113'),'through':_0xbe2c('0x125')});db['User'][_0xbe2c('0x119')](db[_0xbe2c('0xf7')],{'as':_0xbe2c('0x126'),'through':'user_has_whatsapp_interactions'});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db['VoiceQueue'],{'as':_0xbe2c('0x127'),'through':_0xbe2c('0x2a'),'required':![]});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db[_0xbe2c('0xee')],{'as':_0xbe2c('0x128'),'through':_0xbe2c('0x129'),'required':![]});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db[_0xbe2c('0x3b')],{'as':_0xbe2c('0x12a'),'through':_0xbe2c('0x2e'),'required':![]});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db[_0xbe2c('0x6b')],{'as':_0xbe2c('0x12b'),'through':_0xbe2c('0x2c'),'required':![],'hooks':!![]});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db[_0xbe2c('0x12c')],{'as':_0xbe2c('0x12d'),'through':'UserFaxQueue','required':![]});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db[_0xbe2c('0x59')],{'as':'SmsQueues','through':_0xbe2c('0x31'),'required':![]});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db[_0xbe2c('0x60')],{'as':_0xbe2c('0x12e'),'through':_0xbe2c('0x33'),'required':![]});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db[_0xbe2c('0xfb')],{'as':_0xbe2c('0x12f'),'through':'UserWhatsappQueue','required':![]});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db[_0xbe2c('0xed')],{'through':_0xbe2c('0x11f')});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db[_0xbe2c('0x61')],{'as':_0xbe2c('0x130'),'through':_0xbe2c('0x131')});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db[_0xbe2c('0x49')],{'as':_0xbe2c('0x132'),'through':_0xbe2c('0x133')});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db['MailAccount'],{'as':'MailAccounts','through':_0xbe2c('0x134')});db[_0xbe2c('0x104')][_0xbe2c('0x119')](db[_0xbe2c('0x5a')],{'as':'OpenchannelAccounts','through':_0xbe2c('0x135')});db['User'][_0xbe2c('0x119')](db['SmsAccount'],{'as':_0xbe2c('0x136'),'through':_0xbe2c('0x137')});db[_0xbe2c('0x104')]['belongsToMany'](db[_0xbe2c('0xf5')],{'as':_0xbe2c('0x138'),'through':_0xbe2c('0x139')});db['User'][_0xbe2c('0x119')](db[_0xbe2c('0xd8')],{'as':_0xbe2c('0x13a'),'through':_0xbe2c('0x13b')});db[_0xbe2c('0x14')][_0xbe2c('0x109')](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x13c')});db[_0xbe2c('0x13d')][_0xbe2c('0x109')](db['VoiceExtension'],{'onDelete':_0xbe2c('0x106')});db[_0xbe2c('0x17')][_0xbe2c('0x109')](db[_0xbe2c('0x17')],{'as':_0xbe2c('0x13e'),'onDelete':_0xbe2c('0x106')});db[_0xbe2c('0x19')][_0xbe2c('0x119')](db[_0xbe2c('0x88')],{'as':'Sounds','through':_0xbe2c('0x13f')});db['VoiceQueue'][_0xbe2c('0x109')](db[_0xbe2c('0x10c')],{'as':_0xbe2c('0x140'),'foreignKey':'VoiceQueueId'});db[_0xbe2c('0x1a')]['hasMany'](db['CmHopper'],{'as':_0xbe2c('0x141'),'foreignKey':_0xbe2c('0x142')});db[_0xbe2c('0x1a')][_0xbe2c('0x109')](db[_0xbe2c('0x76')],{'as':_0xbe2c('0x10f'),'foreignKey':_0xbe2c('0x142')});db[_0xbe2c('0x1a')][_0xbe2c('0x109')](db[_0xbe2c('0x110')],{'as':_0xbe2c('0x143'),'foreignKey':_0xbe2c('0x142')});db[_0xbe2c('0x1a')][_0xbe2c('0x109')](db[_0xbe2c('0x112')],{'as':_0xbe2c('0x112'),'foreignKey':'VoiceQueueId'});db[_0xbe2c('0x1a')][_0xbe2c('0x109')](db[_0xbe2c('0x75')],{'as':_0xbe2c('0x144'),'foreignKey':_0xbe2c('0x142')});db['VoiceQueue'][_0xbe2c('0x109')](db[_0xbe2c('0xcc')],{'as':'JscriptySessions','foreignKey':_0xbe2c('0x142')});db[_0xbe2c('0x1a')][_0xbe2c('0x117')](db['Trunk'],{'as':'Trunk','foreignKey':_0xbe2c('0x145')});db[_0xbe2c('0x1a')]['belongsTo'](db[_0xbe2c('0x27')],{'as':_0xbe2c('0x146'),'foreignKey':_0xbe2c('0x147')});db['VoiceQueue'][_0xbe2c('0x117')](db['Interval'],{'as':_0xbe2c('0x82'),'foreignKey':_0xbe2c('0x148')});db[_0xbe2c('0x1a')][_0xbe2c('0x117')](db[_0xbe2c('0x83')],{'as':_0xbe2c('0x149'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0xbe2c('0x119')](db[_0xbe2c('0xed')],{'as':_0xbe2c('0x11e'),'through':_0xbe2c('0x14a')});db[_0xbe2c('0x1a')][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':'Agents','through':_0xbe2c('0x2a')});db['VoiceQueue'][_0xbe2c('0x119')](db[_0xbe2c('0xdd')],{'as':_0xbe2c('0x14b'),'through':_0xbe2c('0xfe')});db[_0xbe2c('0x1a')]['belongsToMany'](db['CmList'],{'as':_0xbe2c('0x14c'),'through':'voice_queues_has_cm_blacklists'});db[_0xbe2c('0x10a')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x104'),'foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x1c')][_0xbe2c('0x117')](db['User'],{'as':'User','foreignKey':_0xbe2c('0x107')});db['VoiceMail'][_0xbe2c('0x109')](db['VoiceMailMessage'],{'as':_0xbe2c('0x14d'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x14e'),'sourceKey':_0xbe2c('0x14f')});db['VoiceMailMessage'][_0xbe2c('0x117')](db[_0xbe2c('0x1d')],{'foreignKey':_0xbe2c('0x14e'),'targetKey':_0xbe2c('0x14f')});db[_0xbe2c('0x20')][_0xbe2c('0x109')](db['VoiceQueueReport'],{'as':_0xbe2c('0x150'),'foreignKey':'uniqueid','constraints':![]});db[_0xbe2c('0x20')][_0xbe2c('0x109')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0xbe2c('0x20')]['belongsTo'](db['User'],{'as':_0xbe2c('0x104'),'foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x20')][_0xbe2c('0x117')](db[_0xbe2c('0x72')],{'as':_0xbe2c('0x151'),'foreignKey':_0xbe2c('0x152')});db[_0xbe2c('0x36')]['belongsTo'](db[_0xbe2c('0x39')],{'as':_0xbe2c('0x39'),'foreignKey':_0xbe2c('0x153')});db['MailServerIn'][_0xbe2c('0x117')](db[_0xbe2c('0x154')],{'as':_0xbe2c('0x154'),'foreignKey':_0xbe2c('0x155'),'onDelete':_0xbe2c('0x156')});db['MailServerOut'][_0xbe2c('0x117')](db[_0xbe2c('0x39')],{'as':_0xbe2c('0x39'),'foreignKey':_0xbe2c('0x153')});db[_0xbe2c('0x37')][_0xbe2c('0x117')](db[_0xbe2c('0x154')],{'as':_0xbe2c('0x154'),'foreignKey':'CloudProviderId','onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x39')][_0xbe2c('0x105')](db[_0xbe2c('0x36')],{'as':_0xbe2c('0x157'),'onDelete':_0xbe2c('0x106')});db[_0xbe2c('0x39')][_0xbe2c('0x105')](db['MailServerOut'],{'as':_0xbe2c('0x158'),'onDelete':'cascade'});db[_0xbe2c('0x39')][_0xbe2c('0x109')](db['Disposition'],{'as':_0xbe2c('0x159'),'foreignKey':'MailAccountId','onDelete':_0xbe2c('0x106')});db[_0xbe2c('0x39')]['hasMany'](db['CannedAnswer'],{'as':_0xbe2c('0x15a'),'foreignKey':_0xbe2c('0x153')});db[_0xbe2c('0x39')]['hasMany'](db['MailMessage'],{'as':_0xbe2c('0x14d'),'foreignKey':_0xbe2c('0x153')});db[_0xbe2c('0x39')][_0xbe2c('0x109')](db['MailInteraction'],{'as':_0xbe2c('0x15b')});db[_0xbe2c('0x39')][_0xbe2c('0x109')](db[_0xbe2c('0x41')],{'as':_0xbe2c('0x13e')});db[_0xbe2c('0x39')][_0xbe2c('0x117')](db[_0xbe2c('0xed')],{'as':_0xbe2c('0x15c'),'foreignKey':_0xbe2c('0x15d')});db[_0xbe2c('0x39')]['belongsTo'](db[_0xbe2c('0x8c')],{'as':_0xbe2c('0x8c'),'foreignKey':'TemplateId'});db[_0xbe2c('0x39')]['belongsTo'](db[_0xbe2c('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0xbe2c('0x15e')});db[_0xbe2c('0x39')][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x15f'),'through':_0xbe2c('0x134')});db[_0xbe2c('0x3b')][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x15f'),'through':_0xbe2c('0x2e')});db[_0xbe2c('0x3b')][_0xbe2c('0x119')](db[_0xbe2c('0xdd')],{'through':_0xbe2c('0x160'),'as':_0xbe2c('0x14b')});db[_0xbe2c('0x3e')]['hasMany'](db[_0xbe2c('0x3f')],{'as':'Messages','onDelete':'cascade','foreignKey':'MailInteractionId'});db['MailInteraction'][_0xbe2c('0x117')](db['MailAccount'],{'as':_0xbe2c('0x161'),'foreignKey':_0xbe2c('0x153')});db[_0xbe2c('0x3e')]['belongsTo'](db[_0xbe2c('0x72')],{'as':_0xbe2c('0x151'),'foreignKey':_0xbe2c('0x152')});db[_0xbe2c('0x3e')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x162'),'foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x3e')]['belongsToMany'](db[_0xbe2c('0x8a')],{'through':_0xbe2c('0x163'),'as':_0xbe2c('0x164')});db[_0xbe2c('0x3e')]['belongsToMany'](db[_0xbe2c('0x8a')],{'through':_0xbe2c('0x163'),'as':'ThroughTags'});db[_0xbe2c('0x3e')][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':'Users','through':_0xbe2c('0x121'),'foreignKey':'MailInteractionId'});db[_0xbe2c('0x3f')][_0xbe2c('0x109')](db[_0xbe2c('0xe2')],{'as':_0xbe2c('0x165'),'onDelete':'cascade'});db[_0xbe2c('0x3f')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x104')});db[_0xbe2c('0x3f')]['belongsTo'](db['CmContact'],{'onDelete':_0xbe2c('0x106'),'as':_0xbe2c('0x151')});db[_0xbe2c('0x3f')][_0xbe2c('0x117')](db['MailInteraction'],{'as':'Interaction','foreignKey':_0xbe2c('0x166')});db[_0xbe2c('0x3f')][_0xbe2c('0x117')](db[_0xbe2c('0x39')],{'as':_0xbe2c('0x161'),'foreignKey':_0xbe2c('0x153')});db[_0xbe2c('0x3f')][_0xbe2c('0x117')](db[_0xbe2c('0x61')],{'as':'ChatWebsite','foreignKey':_0xbe2c('0x167')});db[_0xbe2c('0x3f')][_0xbe2c('0x117')](db[_0xbe2c('0x69')],{'as':_0xbe2c('0x69'),'foreignKey':_0xbe2c('0x168')});db[_0xbe2c('0x41')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x41')][_0xbe2c('0x117')](db['MailQueue'],{'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x41')][_0xbe2c('0x117')](db[_0xbe2c('0x39')],{'onDelete':_0xbe2c('0x156')});db['MailApplication'][_0xbe2c('0x117')](db[_0xbe2c('0x82')],{'onDelete':_0xbe2c('0x156'),'foreignKey':_0xbe2c('0x148')});db[_0xbe2c('0x41')][_0xbe2c('0x117')](db[_0xbe2c('0x8a')],{'onDelete':_0xbe2c('0x156'),'foreignKey':_0xbe2c('0x169')});db['MailQueueReport'][_0xbe2c('0x117')](db[_0xbe2c('0x39')],{});db[_0xbe2c('0x43')][_0xbe2c('0x117')](db[_0xbe2c('0xed')],{'as':_0xbe2c('0x15c'),'foreignKey':_0xbe2c('0x15d')});db[_0xbe2c('0x43')][_0xbe2c('0x117')](db[_0xbe2c('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0xbe2c('0x43')][_0xbe2c('0x117')](db['MailInteraction'],{});db[_0xbe2c('0x43')][_0xbe2c('0x117')](db[_0xbe2c('0x3f')],{});db[_0xbe2c('0x43')]['belongsTo'](db[_0xbe2c('0x104')],{});db['MailQueueReport'][_0xbe2c('0x117')](db[_0xbe2c('0x3b')],{});db[_0xbe2c('0x45')]['hasMany'](db[_0xbe2c('0x47')],{'as':_0xbe2c('0x16a'),'onDelete':_0xbe2c('0x106')});db['FaxAccount'][_0xbe2c('0x109')](db[_0xbe2c('0x16b')],{'as':_0xbe2c('0x159'),'foreignKey':_0xbe2c('0x16c'),'onDelete':_0xbe2c('0x106')});db['FaxAccount'][_0xbe2c('0x109')](db['CannedAnswer'],{'as':_0xbe2c('0x15a'),'foreignKey':_0xbe2c('0x16c')});db[_0xbe2c('0x49')][_0xbe2c('0x109')](db[_0xbe2c('0x4c')],{'as':_0xbe2c('0x15b')});db[_0xbe2c('0x49')][_0xbe2c('0x109')](db[_0xbe2c('0x4b')],{'as':_0xbe2c('0x13e')});db[_0xbe2c('0x49')][_0xbe2c('0x109')](db['VoiceExtension'],{'as':_0xbe2c('0x16d'),'onDelete':_0xbe2c('0x106')});db[_0xbe2c('0x49')]['hasMany'](db['FaxMessage'],{'as':'Messages'});db[_0xbe2c('0x49')][_0xbe2c('0x117')](db[_0xbe2c('0x27')],{'as':_0xbe2c('0x27')});db[_0xbe2c('0x49')][_0xbe2c('0x117')](db['CmList'],{'as':_0xbe2c('0x15c'),'foreignKey':_0xbe2c('0x15d')});db['FaxAccount']['belongsTo'](db[_0xbe2c('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0xbe2c('0x15e')});db[_0xbe2c('0x49')][_0xbe2c('0x119')](db['User'],{'as':_0xbe2c('0x15f'),'through':'user_has_fax_accounts'});db['FaxApplication']['belongsTo'](db['User'],{'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x4b')][_0xbe2c('0x117')](db[_0xbe2c('0x12c')],{'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x4b')][_0xbe2c('0x117')](db[_0xbe2c('0x49')],{'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x4b')]['belongsTo'](db[_0xbe2c('0x8a')],{'onDelete':_0xbe2c('0x156'),'foreignKey':'TagId'});db['FaxInteraction'][_0xbe2c('0x109')](db[_0xbe2c('0x4e')],{'as':_0xbe2c('0x14d'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x16e')});db[_0xbe2c('0x4c')][_0xbe2c('0x117')](db[_0xbe2c('0x49')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xbe2c('0x4c')][_0xbe2c('0x117')](db[_0xbe2c('0x72')],{'as':_0xbe2c('0x151'),'foreignKey':_0xbe2c('0x152')});db[_0xbe2c('0x4c')][_0xbe2c('0x117')](db['User'],{'as':_0xbe2c('0x162'),'foreignKey':'UserId'});db[_0xbe2c('0x4c')]['belongsToMany'](db[_0xbe2c('0x8a')],{'through':_0xbe2c('0x16f'),'as':_0xbe2c('0x164')});db['FaxInteraction'][_0xbe2c('0x119')](db['Tag'],{'through':_0xbe2c('0x16f'),'as':_0xbe2c('0x170')});db[_0xbe2c('0x4c')][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x171'),'through':_0xbe2c('0x172'),'foreignKey':'FaxInteractionId'});db[_0xbe2c('0x4e')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'onDelete':_0xbe2c('0x106'),'as':_0xbe2c('0x104')});db[_0xbe2c('0x4e')][_0xbe2c('0x117')](db[_0xbe2c('0x4c')],{'as':_0xbe2c('0x173'),'foreignKey':_0xbe2c('0x16e')});db['FaxMessage']['belongsTo'](db[_0xbe2c('0x72')],{'onDelete':'cascade','as':_0xbe2c('0x151')});db[_0xbe2c('0x4e')]['belongsTo'](db[_0xbe2c('0xe2')],{'as':_0xbe2c('0xe2'),'foreignKey':_0xbe2c('0x174')});db[_0xbe2c('0x4e')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xbe2c('0x12c')][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x15f'),'through':_0xbe2c('0x30')});db['FaxQueue']['belongsToMany'](db['Team'],{'through':'team_has_fax_queues','as':'Teams'});db['FaxQueueReport']['belongsTo'](db['FaxAccount'],{});db[_0xbe2c('0x51')]['belongsTo'](db[_0xbe2c('0xed')],{'as':_0xbe2c('0x15c'),'foreignKey':_0xbe2c('0x15d')});db[_0xbe2c('0x51')]['belongsTo'](db[_0xbe2c('0x72')],{'as':_0xbe2c('0x151'),'foreignKey':_0xbe2c('0x152')});db['FaxQueueReport'][_0xbe2c('0x117')](db[_0xbe2c('0x4c')],{});db[_0xbe2c('0x51')][_0xbe2c('0x117')](db[_0xbe2c('0x4e')],{});db['FaxQueueReport'][_0xbe2c('0x117')](db['User'],{});db[_0xbe2c('0x51')][_0xbe2c('0x117')](db[_0xbe2c('0x12c')],{});db[_0xbe2c('0x53')][_0xbe2c('0x109')](db[_0xbe2c('0x16b')],{'as':_0xbe2c('0x159'),'foreignKey':_0xbe2c('0x175'),'onDelete':_0xbe2c('0x106')});db[_0xbe2c('0x53')]['hasMany'](db[_0xbe2c('0x7e')],{'as':_0xbe2c('0x15a'),'foreignKey':_0xbe2c('0x175')});db[_0xbe2c('0x53')][_0xbe2c('0x109')](db['SmsMessage'],{'as':_0xbe2c('0x14d'),'foreignKey':_0xbe2c('0x175')});db[_0xbe2c('0x53')][_0xbe2c('0x109')](db[_0xbe2c('0x56')],{'as':'Interactions'});db[_0xbe2c('0x53')][_0xbe2c('0x109')](db[_0xbe2c('0x55')],{'as':_0xbe2c('0x13e')});db[_0xbe2c('0x53')][_0xbe2c('0x117')](db[_0xbe2c('0xed')],{'as':_0xbe2c('0x15c'),'foreignKey':_0xbe2c('0x15d')});db['SmsAccount']['belongsTo'](db['Pause'],{'as':_0xbe2c('0x149'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xbe2c('0x53')][_0xbe2c('0x119')](db['User'],{'as':_0xbe2c('0x15f'),'through':_0xbe2c('0x137')});db[_0xbe2c('0x55')][_0xbe2c('0x117')](db['User'],{'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x55')]['belongsTo'](db[_0xbe2c('0x59')],{'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x55')]['belongsTo'](db[_0xbe2c('0x53')],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db[_0xbe2c('0x82')],{'onDelete':_0xbe2c('0x156'),'foreignKey':_0xbe2c('0x148')});db[_0xbe2c('0x55')][_0xbe2c('0x117')](db[_0xbe2c('0x8a')],{'onDelete':_0xbe2c('0x156'),'foreignKey':_0xbe2c('0x169')});db[_0xbe2c('0x56')][_0xbe2c('0x109')](db[_0xbe2c('0x58')],{'as':_0xbe2c('0x14d'),'onDelete':_0xbe2c('0x106'),'foreignKey':'SmsInteractionId'});db[_0xbe2c('0x56')][_0xbe2c('0x117')](db[_0xbe2c('0x53')],{'as':'Account','foreignKey':'SmsAccountId'});db['SmsInteraction']['belongsTo'](db[_0xbe2c('0x72')],{'as':_0xbe2c('0x151'),'foreignKey':_0xbe2c('0x152')});db[_0xbe2c('0x56')]['belongsTo'](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x162'),'foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x56')][_0xbe2c('0x119')](db[_0xbe2c('0x8a')],{'through':'sms_interaction_has_tags','as':_0xbe2c('0x164')});db[_0xbe2c('0x56')]['belongsToMany'](db[_0xbe2c('0x8a')],{'through':'sms_interaction_has_tags','as':_0xbe2c('0x170')});db['SmsInteraction'][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x171'),'through':_0xbe2c('0x124'),'foreignKey':_0xbe2c('0x176')});db[_0xbe2c('0x58')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x104')});db[_0xbe2c('0x58')][_0xbe2c('0x117')](db['CmContact'],{'onDelete':'cascade','as':_0xbe2c('0x151')});db['SmsMessage'][_0xbe2c('0x117')](db['SmsInteraction'],{'onDelete':_0xbe2c('0x106'),'as':_0xbe2c('0x173'),'foreignKey':_0xbe2c('0x176')});db[_0xbe2c('0x58')][_0xbe2c('0x117')](db[_0xbe2c('0x53')],{'as':_0xbe2c('0x161'),'foreignKey':_0xbe2c('0x175')});db['SmsQueue'][_0xbe2c('0x119')](db['User'],{'as':_0xbe2c('0x15f'),'through':_0xbe2c('0x31'),'foreignKey':_0xbe2c('0x177')});db['SmsQueue'][_0xbe2c('0x119')](db[_0xbe2c('0xdd')],{'through':_0xbe2c('0x178'),'as':_0xbe2c('0x14b')});db[_0xbe2c('0x5a')][_0xbe2c('0x109')](db[_0xbe2c('0x16b')],{'as':_0xbe2c('0x159'),'foreignKey':_0xbe2c('0x179'),'onDelete':_0xbe2c('0x106')});db['OpenchannelAccount'][_0xbe2c('0x109')](db['CannedAnswer'],{'as':_0xbe2c('0x15a'),'foreignKey':_0xbe2c('0x179')});db[_0xbe2c('0x5a')]['hasMany'](db[_0xbe2c('0x5d')],{'as':_0xbe2c('0x15b'),'foreignKey':_0xbe2c('0x179')});db[_0xbe2c('0x5a')][_0xbe2c('0x109')](db[_0xbe2c('0x17a')],{'as':_0xbe2c('0x14d'),'foreignKey':_0xbe2c('0x179')});db[_0xbe2c('0x5a')][_0xbe2c('0x109')](db[_0xbe2c('0x17b')],{'as':'Applications','foreignKey':'OpenchannelAccountId'});db[_0xbe2c('0x5a')]['belongsTo'](db[_0xbe2c('0xed')],{'as':_0xbe2c('0x15c'),'foreignKey':_0xbe2c('0x15d')});db[_0xbe2c('0x5a')][_0xbe2c('0x117')](db[_0xbe2c('0x83')],{'as':_0xbe2c('0x149'),'foreignKey':_0xbe2c('0x15e')});db['OpenchannelAccount'][_0xbe2c('0x119')](db['User'],{'as':_0xbe2c('0x15f'),'through':_0xbe2c('0x135')});db['OpenchannelApplication']['belongsTo'](db[_0xbe2c('0x104')],{'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x17b')]['belongsTo'](db[_0xbe2c('0x60')],{'onDelete':_0xbe2c('0x156'),'foreignKey':_0xbe2c('0x17c')});db[_0xbe2c('0x17b')][_0xbe2c('0x117')](db[_0xbe2c('0x5a')],{'onDelete':'restrict','foreignKey':_0xbe2c('0x179')});db['OpenchannelApplication'][_0xbe2c('0x117')](db[_0xbe2c('0x82')],{'onDelete':_0xbe2c('0x156'),'foreignKey':_0xbe2c('0x148')});db[_0xbe2c('0x17b')]['belongsTo'](db[_0xbe2c('0x8a')],{'onDelete':_0xbe2c('0x156'),'foreignKey':'TagId'});db[_0xbe2c('0x5d')][_0xbe2c('0x109')](db[_0xbe2c('0x17a')],{'as':_0xbe2c('0x14d'),'onDelete':_0xbe2c('0x106'),'foreignKey':'OpenchannelInteractionId'});db[_0xbe2c('0x5d')][_0xbe2c('0x117')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xbe2c('0x179')});db[_0xbe2c('0x5d')]['belongsTo'](db[_0xbe2c('0x72')],{'as':_0xbe2c('0x151'),'foreignKey':_0xbe2c('0x152')});db[_0xbe2c('0x5d')]['belongsTo'](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x162'),'foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x5d')]['belongsToMany'](db[_0xbe2c('0x8a')],{'through':_0xbe2c('0x17d'),'as':_0xbe2c('0x164')});db[_0xbe2c('0x5d')][_0xbe2c('0x119')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0xbe2c('0x5d')][_0xbe2c('0x119')](db['User'],{'as':_0xbe2c('0x171'),'through':_0xbe2c('0x125'),'foreignKey':_0xbe2c('0x17e')});db[_0xbe2c('0x17a')][_0xbe2c('0x117')](db['User'],{'onDelete':'cascade','as':_0xbe2c('0x104')});db[_0xbe2c('0x17a')][_0xbe2c('0x117')](db[_0xbe2c('0x72')],{'onDelete':_0xbe2c('0x106'),'as':_0xbe2c('0x151')});db[_0xbe2c('0x17a')][_0xbe2c('0x117')](db[_0xbe2c('0x5d')],{'onDelete':_0xbe2c('0x106'),'as':_0xbe2c('0x173'),'foreignKey':_0xbe2c('0x17e')});db[_0xbe2c('0x17a')][_0xbe2c('0x117')](db[_0xbe2c('0xe2')],{'as':_0xbe2c('0xe2'),'foreignKey':'AttachmentId'});db[_0xbe2c('0x17a')][_0xbe2c('0x117')](db[_0xbe2c('0x5a')],{'as':'Account','foreignKey':_0xbe2c('0x179')});db['OpenchannelQueue'][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x15f'),'through':_0xbe2c('0x33'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue']['belongsToMany'](db[_0xbe2c('0xdd')],{'through':_0xbe2c('0x17f'),'as':_0xbe2c('0x14b')});db[_0xbe2c('0x61')][_0xbe2c('0x109')](db[_0xbe2c('0x16b')],{'as':_0xbe2c('0x159'),'foreignKey':_0xbe2c('0x167'),'onDelete':_0xbe2c('0x106')});db[_0xbe2c('0x61')][_0xbe2c('0x109')](db['CannedAnswer'],{'as':_0xbe2c('0x15a'),'foreignKey':_0xbe2c('0x167')});db[_0xbe2c('0x61')][_0xbe2c('0x109')](db[_0xbe2c('0x6e')],{'as':_0xbe2c('0x180')});db['ChatWebsite']['hasMany'](db[_0xbe2c('0x66')],{'as':'Interactions'});db[_0xbe2c('0x61')][_0xbe2c('0x109')](db[_0xbe2c('0x65')],{'as':_0xbe2c('0x13e')});db[_0xbe2c('0x61')][_0xbe2c('0x109')](db['ChatMessage'],{'as':'Messages'});db['ChatWebsite'][_0xbe2c('0x117')](db[_0xbe2c('0xed')],{'as':'List','foreignKey':_0xbe2c('0x15d')});db['ChatWebsite']['belongsTo'](db[_0xbe2c('0x82')],{'as':'Interval','foreignKey':'IntervalId'});db[_0xbe2c('0x61')][_0xbe2c('0x117')](db[_0xbe2c('0x39')],{'as':_0xbe2c('0x39'),'foreignKey':_0xbe2c('0x153')});db[_0xbe2c('0x61')][_0xbe2c('0x117')](db[_0xbe2c('0x83')],{'as':_0xbe2c('0x149'),'foreignKey':_0xbe2c('0x15e')});db['ChatWebsite'][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x15f'),'through':_0xbe2c('0x131')});db['OpenchannelQueueReport']['belongsTo'](db[_0xbe2c('0x5a')],{});db[_0xbe2c('0x63')][_0xbe2c('0x117')](db[_0xbe2c('0xed')],{'as':'List','foreignKey':_0xbe2c('0x15d')});db[_0xbe2c('0x63')][_0xbe2c('0x117')](db[_0xbe2c('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0xbe2c('0x63')][_0xbe2c('0x117')](db[_0xbe2c('0x5d')],{});db[_0xbe2c('0x63')][_0xbe2c('0x117')](db[_0xbe2c('0x17a')],{});db[_0xbe2c('0x63')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{});db[_0xbe2c('0x63')][_0xbe2c('0x117')](db[_0xbe2c('0x60')],{});db[_0xbe2c('0x65')]['belongsTo'](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x181'),'foreignKey':_0xbe2c('0x107'),'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x65')][_0xbe2c('0x117')](db[_0xbe2c('0x6b')],{'as':_0xbe2c('0x182'),'foreignKey':_0xbe2c('0x183'),'onDelete':_0xbe2c('0x156')});db['ChatApplication'][_0xbe2c('0x117')](db[_0xbe2c('0x61')],{'as':_0xbe2c('0x184'),'foreignKey':_0xbe2c('0x167'),'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x65')]['belongsTo'](db[_0xbe2c('0x8a')],{'onDelete':'restrict','foreignKey':'TagId'});db['ChatInteraction'][_0xbe2c('0x109')](db[_0xbe2c('0x185')],{'as':_0xbe2c('0x14d'),'onDelete':_0xbe2c('0x106'),'foreignKey':'ChatInteractionId'});db['ChatInteraction'][_0xbe2c('0x117')](db[_0xbe2c('0x61')],{'as':_0xbe2c('0x161'),'foreignKey':_0xbe2c('0x167')});db['ChatInteraction'][_0xbe2c('0x117')](db[_0xbe2c('0x72')],{'as':_0xbe2c('0x151'),'foreignKey':_0xbe2c('0x152')});db[_0xbe2c('0x66')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x162'),'foreignKey':_0xbe2c('0x107')});db['ChatInteraction'][_0xbe2c('0x119')](db[_0xbe2c('0x8a')],{'through':_0xbe2c('0x186'),'as':'Tags'});db[_0xbe2c('0x66')][_0xbe2c('0x119')](db[_0xbe2c('0x8a')],{'through':_0xbe2c('0x186'),'as':_0xbe2c('0x170')});db[_0xbe2c('0x66')][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x171'),'through':_0xbe2c('0x123'),'foreignKey':_0xbe2c('0x187')});db[_0xbe2c('0x185')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'onDelete':_0xbe2c('0x106'),'as':_0xbe2c('0x104')});db[_0xbe2c('0x185')][_0xbe2c('0x117')](db['CmContact'],{'onDelete':_0xbe2c('0x106'),'as':_0xbe2c('0x151'),'foreignKey':'ContactId'});db['ChatMessage'][_0xbe2c('0x117')](db[_0xbe2c('0x66')],{'onDelete':_0xbe2c('0x106'),'as':_0xbe2c('0x173'),'foreignKey':_0xbe2c('0x187')});db['ChatMessage']['belongsTo'](db[_0xbe2c('0xe2')],{'as':_0xbe2c('0xe2'),'foreignKey':'AttachmentId'});db['ChatMessage'][_0xbe2c('0x117')](db[_0xbe2c('0x61')],{'as':_0xbe2c('0x161'),'foreignKey':_0xbe2c('0x167')});db[_0xbe2c('0x69')][_0xbe2c('0x109')](db['Attachment'],{'as':_0xbe2c('0x165'),'foreignKey':_0xbe2c('0x168'),'onDelete':_0xbe2c('0x106'),'hooks':!![]});db[_0xbe2c('0x69')]['belongsTo'](db[_0xbe2c('0x72')],{'onDelete':_0xbe2c('0x106'),'as':_0xbe2c('0x151'),'foreignKey':_0xbe2c('0x152')});db[_0xbe2c('0x69')][_0xbe2c('0x117')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xbe2c('0x6b')][_0xbe2c('0x119')](db['User'],{'as':_0xbe2c('0x15f'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue']['belongsToMany'](db['Team'],{'through':_0xbe2c('0x188'),'as':_0xbe2c('0x14b')});db[_0xbe2c('0x6d')][_0xbe2c('0x109')](db[_0xbe2c('0x189')],{'as':_0xbe2c('0x14d'),'foreignKey':_0xbe2c('0x18a'),'onDelete':_0xbe2c('0x106')});db[_0xbe2c('0x6d')][_0xbe2c('0x119')](db['User'],{'as':_0xbe2c('0x140'),'through':_0xbe2c('0x11b')});db[_0xbe2c('0x6e')][_0xbe2c('0x117')](db[_0xbe2c('0x61')],{'as':'Website','foreignKey':'ChatWebsiteId'});db['CmCompany'][_0xbe2c('0x109')](db[_0xbe2c('0x72')],{'as':_0xbe2c('0x11c'),'foreignKey':'CompanyId'});db[_0xbe2c('0x72')][_0xbe2c('0x109')](db[_0xbe2c('0x18b')],{'as':_0xbe2c('0x141'),'foreignKey':_0xbe2c('0x152')});db['CmContact'][_0xbe2c('0x109')](db[_0xbe2c('0x76')],{'as':'HopperFinals','foreignKey':_0xbe2c('0x152')});db[_0xbe2c('0x72')][_0xbe2c('0x109')](db[_0xbe2c('0x110')],{'as':'HopperHistories','foreignKey':_0xbe2c('0x152')});db[_0xbe2c('0x72')][_0xbe2c('0x109')](db[_0xbe2c('0x112')],{'as':_0xbe2c('0x112'),'foreignKey':_0xbe2c('0x152')});db[_0xbe2c('0x72')][_0xbe2c('0x109')](db[_0xbe2c('0xcc')],{'as':_0xbe2c('0x18c'),'foreignKey':_0xbe2c('0x152')});db['CmContact'][_0xbe2c('0x109')](db[_0xbe2c('0x5d')],{'as':'OpenchannelInteractions','foreignKey':_0xbe2c('0x152'),'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x72')][_0xbe2c('0x109')](db['ChatInteraction'],{'as':_0xbe2c('0x122'),'foreignKey':'ContactId','onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x72')][_0xbe2c('0x109')](db[_0xbe2c('0x56')],{'as':_0xbe2c('0x114'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xbe2c('0x72')][_0xbe2c('0x109')](db[_0xbe2c('0x4c')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0xbe2c('0x72')][_0xbe2c('0x109')](db['MailInteraction'],{'as':_0xbe2c('0x116'),'foreignKey':_0xbe2c('0x152'),'onDelete':'restrict'});db[_0xbe2c('0x72')][_0xbe2c('0x117')](db['CmCompany'],{'as':_0xbe2c('0x18d'),'foreignKey':_0xbe2c('0x18e')});db[_0xbe2c('0x72')][_0xbe2c('0x117')](db[_0xbe2c('0xed')],{'as':_0xbe2c('0x15c'),'foreignKey':_0xbe2c('0x15d'),'onDelete':_0xbe2c('0x106')});db[_0xbe2c('0x72')]['belongsToMany'](db['User'],{'as':_0xbe2c('0x171'),'through':_0xbe2c('0x11d')});db[_0xbe2c('0x72')][_0xbe2c('0x119')](db[_0xbe2c('0x8a')],{'as':_0xbe2c('0x164'),'through':_0xbe2c('0x18f')});db[_0xbe2c('0x72')]['belongsToMany'](db['Tag'],{'through':_0xbe2c('0x18f'),'as':_0xbe2c('0x170')});db[_0xbe2c('0x18b')][_0xbe2c('0x117')](db[_0xbe2c('0x72')],{'as':'Contact','foreignKey':_0xbe2c('0x152'),'onDelete':'cascade'});db[_0xbe2c('0x18b')][_0xbe2c('0x117')](db[_0xbe2c('0xed')],{'as':'List','foreignKey':_0xbe2c('0x15d'),'onDelete':'cascade'});db[_0xbe2c('0x18b')]['belongsTo'](db['User'],{'as':'Agent','foreignKey':_0xbe2c('0x107')});db[_0xbe2c('0x18b')][_0xbe2c('0x117')](db[_0xbe2c('0x1a')],{'as':_0xbe2c('0x182'),'foreignKey':_0xbe2c('0x142'),'onDelete':_0xbe2c('0x106')});db[_0xbe2c('0x18b')][_0xbe2c('0x117')](db['Campaign'],{'as':_0xbe2c('0x190'),'foreignKey':_0xbe2c('0x191'),'onDelete':_0xbe2c('0x106')});db[_0xbe2c('0x18b')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x162'),'foreignKey':_0xbe2c('0x192')});db['CmHopperBlack'][_0xbe2c('0x117')](db[_0xbe2c('0x72')],{'as':_0xbe2c('0x151'),'foreignKey':'ContactId','onDelete':_0xbe2c('0x106')});db[_0xbe2c('0x75')][_0xbe2c('0x117')](db[_0xbe2c('0xed')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0xbe2c('0x75')]['belongsTo'](db[_0xbe2c('0x1a')],{'as':_0xbe2c('0x182'),'foreignKey':_0xbe2c('0x142'),'onDelete':'cascade'});db['CmHopperBlack'][_0xbe2c('0x117')](db['Campaign'],{'as':_0xbe2c('0x190'),'foreignKey':_0xbe2c('0x191'),'onDelete':'cascade'});db['Automation']['hasMany'](db[_0xbe2c('0x193')],{'as':{'plural':_0xbe2c('0x194'),'singular':_0xbe2c('0x195')},'foreignKey':_0xbe2c('0x196'),'onDelete':_0xbe2c('0x106'),'hooks':!![]});db[_0xbe2c('0x197')][_0xbe2c('0x109')](db['Condition'],{'as':{'plural':_0xbe2c('0x198'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xbe2c('0x197')][_0xbe2c('0x109')](db[_0xbe2c('0x7b')],{'as':_0xbe2c('0x199'),'foreignKey':_0xbe2c('0x19a'),'onDelete':_0xbe2c('0x106'),'hooks':!![]});db[_0xbe2c('0x16b')][_0xbe2c('0x109')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xbe2c('0x19b'),'onDelete':_0xbe2c('0x106')});db[_0xbe2c('0x82')][_0xbe2c('0x109')](db[_0xbe2c('0x82')],{'as':_0xbe2c('0x19c'),'foreignKey':_0xbe2c('0x148'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xbe2c('0x82')][_0xbe2c('0x109')](db[_0xbe2c('0x17')],{'as':'Extensions','foreignKey':_0xbe2c('0x148'),'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x82')][_0xbe2c('0x109')](db[_0xbe2c('0x41')],{'as':_0xbe2c('0x19d'),'foreignKey':_0xbe2c('0x148')});db[_0xbe2c('0x82')][_0xbe2c('0x109')](db[_0xbe2c('0x65')],{'as':'ChatApplications','foreignKey':_0xbe2c('0x148')});db[_0xbe2c('0x82')][_0xbe2c('0x109')](db[_0xbe2c('0x4b')],{'as':_0xbe2c('0x19e'),'foreignKey':_0xbe2c('0x148')});db[_0xbe2c('0x82')]['hasMany'](db[_0xbe2c('0x55')],{'as':_0xbe2c('0x19f'),'foreignKey':_0xbe2c('0x148')});db[_0xbe2c('0x86')][_0xbe2c('0x117')](db[_0xbe2c('0x39')],{});db['Schedule'][_0xbe2c('0x117')](db[_0xbe2c('0x1a0')],{'foreignKey':_0xbe2c('0x1a1')});db[_0xbe2c('0x86')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0xbe2c('0x1a2')});db['Sound'][_0xbe2c('0x119')](db[_0xbe2c('0x19')],{'as':_0xbe2c('0x1a3'),'through':_0xbe2c('0x13f'),'onDelete':'restrict'});db[_0xbe2c('0x8a')][_0xbe2c('0x119')](db[_0xbe2c('0x72')],{'through':'cm_contact_has_tags'});db[_0xbe2c('0x8a')]['belongsToMany'](db[_0xbe2c('0x66')],{'through':_0xbe2c('0x186')});db['Tag'][_0xbe2c('0x119')](db[_0xbe2c('0x3e')],{'through':_0xbe2c('0x163')});db[_0xbe2c('0x8a')][_0xbe2c('0x119')](db[_0xbe2c('0x56')],{'through':_0xbe2c('0x1a4')});db['Tag'][_0xbe2c('0x119')](db[_0xbe2c('0x4c')],{'through':_0xbe2c('0x16f')});db[_0xbe2c('0x8a')][_0xbe2c('0x119')](db['OpenchannelInteraction'],{'through':_0xbe2c('0x17d')});db[_0xbe2c('0x8a')][_0xbe2c('0x119')](db['WhatsappInteraction'],{'through':_0xbe2c('0x1a5')});db[_0xbe2c('0x8e')]['hasMany'](db[_0xbe2c('0x193')],{'as':{'plural':_0xbe2c('0x1a6'),'singular':_0xbe2c('0x1a7')},'foreignKey':_0xbe2c('0x1a8'),'onDelete':_0xbe2c('0x106'),'hooks':!![]});db[_0xbe2c('0x8e')][_0xbe2c('0x109')](db[_0xbe2c('0x193')],{'as':{'plural':_0xbe2c('0x1a9'),'singular':_0xbe2c('0x1aa')},'foreignKey':_0xbe2c('0x1ab'),'onDelete':_0xbe2c('0x106'),'hooks':!![]});db[_0xbe2c('0x8e')]['hasMany'](db[_0xbe2c('0x7b')],{'as':'Actions','foreignKey':_0xbe2c('0x1ac'),'onDelete':_0xbe2c('0x106'),'hooks':!![]});db[_0xbe2c('0x1ad')][_0xbe2c('0x109')](db[_0xbe2c('0x9a')],{'as':_0xbe2c('0x1ae'),'onDelete':'cascade','foreignKey':_0xbe2c('0x1a2'),'hooks':!![]});db[_0xbe2c('0x1a0')][_0xbe2c('0x109')](db['AnalyticFieldReport'],{'as':_0xbe2c('0x1ae'),'onDelete':_0xbe2c('0x106'),'foreignKey':'DefaultReportId'});db[_0xbe2c('0x1af')][_0xbe2c('0x109')](db[_0xbe2c('0x9a')],{'as':_0xbe2c('0x1ae'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1b0')});db[_0xbe2c('0x9a')][_0xbe2c('0x117')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0xbe2c('0x109')](db[_0xbe2c('0x9d')],{'as':_0xbe2c('0x1b1'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1b2')});db[_0xbe2c('0x9d')][_0xbe2c('0x109')](db['SalesforceField'],{'as':_0xbe2c('0x1b3'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1b4')});db[_0xbe2c('0x9d')][_0xbe2c('0x109')](db[_0xbe2c('0x9e')],{'as':_0xbe2c('0x1b5'),'onDelete':'cascade','foreignKey':_0xbe2c('0x1b6')});db['SalesforceConfiguration'][_0xbe2c('0x109')](db[_0xbe2c('0x9e')],{'as':_0xbe2c('0x1ae'),'onDelete':'cascade','foreignKey':'FieldId'});db['SalesforceConfiguration'][_0xbe2c('0x117')](db[_0xbe2c('0x1b7')],{'as':_0xbe2c('0x161'),'foreignKey':_0xbe2c('0x1b2')});db['SalesforceField'][_0xbe2c('0x109')](db[_0xbe2c('0x9e')],{'as':'Subject','foreignKey':_0xbe2c('0x1b4')});db[_0xbe2c('0x9e')][_0xbe2c('0x109')](db[_0xbe2c('0x9e')],{'as':_0xbe2c('0x1b8'),'foreignKey':_0xbe2c('0x1b6')});db[_0xbe2c('0x9e')][_0xbe2c('0x109')](db[_0xbe2c('0x9e')],{'as':_0xbe2c('0x1b9'),'foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0x9e')][_0xbe2c('0x117')](db['Variable'],{'as':_0xbe2c('0x8f'),'foreignKey':'VariableId'});db[_0xbe2c('0x1bb')][_0xbe2c('0x109')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1b2')});db[_0xbe2c('0x1bc')][_0xbe2c('0x109')](db['SugarcrmField'],{'as':_0xbe2c('0x1b3'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1b4')});db['SugarcrmConfiguration'][_0xbe2c('0x109')](db[_0xbe2c('0xa2')],{'as':_0xbe2c('0x1b5'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1b6')});db[_0xbe2c('0x1bc')]['hasMany'](db[_0xbe2c('0xa2')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0x1bc')][_0xbe2c('0x117')](db[_0xbe2c('0x1bb')],{'as':_0xbe2c('0x161'),'foreignKey':'AccountId'});db[_0xbe2c('0xa2')]['hasMany'](db[_0xbe2c('0xa2')],{'as':_0xbe2c('0x1bd'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0xbe2c('0x109')](db[_0xbe2c('0xa2')],{'as':'Description','foreignKey':_0xbe2c('0x1b6')});db['SugarcrmField'][_0xbe2c('0x109')](db['SugarcrmField'],{'as':_0xbe2c('0x1b9'),'foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0xa2')][_0xbe2c('0x117')](db[_0xbe2c('0x8f')],{'as':'Variable','foreignKey':_0xbe2c('0x1be')});db[_0xbe2c('0xa3')][_0xbe2c('0x109')](db[_0xbe2c('0xa4')],{'as':_0xbe2c('0x1b1'),'onDelete':_0xbe2c('0x106'),'foreignKey':'AccountId'});db[_0xbe2c('0xa4')][_0xbe2c('0x109')](db[_0xbe2c('0x1bf')],{'as':_0xbe2c('0x1b3'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1b4')});db[_0xbe2c('0xa4')]['hasMany'](db[_0xbe2c('0x1bf')],{'as':'Descriptions','onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1b6')});db['DeskConfiguration'][_0xbe2c('0x109')](db['DeskField'],{'as':_0xbe2c('0x1ae'),'onDelete':'cascade','foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0xa4')][_0xbe2c('0x117')](db[_0xbe2c('0xa3')],{'as':'Account','foreignKey':_0xbe2c('0x1b2')});db[_0xbe2c('0xa4')]['belongsToMany'](db[_0xbe2c('0x8a')],{'through':_0xbe2c('0x1c0')});db[_0xbe2c('0x1bf')]['hasMany'](db[_0xbe2c('0x1bf')],{'as':'Subject','foreignKey':_0xbe2c('0x1b4')});db[_0xbe2c('0x1bf')]['hasMany'](db[_0xbe2c('0x1bf')],{'as':'Description','foreignKey':_0xbe2c('0x1b6')});db[_0xbe2c('0x1bf')][_0xbe2c('0x109')](db[_0xbe2c('0x1bf')],{'as':_0xbe2c('0x1b9'),'foreignKey':_0xbe2c('0x1ba')});db['DeskField'][_0xbe2c('0x117')](db[_0xbe2c('0x8f')],{'as':_0xbe2c('0x8f'),'foreignKey':_0xbe2c('0x1be')});db[_0xbe2c('0xa7')][_0xbe2c('0x109')](db[_0xbe2c('0x1c1')],{'as':_0xbe2c('0x1b1'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1b2')});db[_0xbe2c('0x1c1')][_0xbe2c('0x109')](db[_0xbe2c('0xaa')],{'as':_0xbe2c('0x1b3'),'onDelete':_0xbe2c('0x106'),'foreignKey':'SubjectId'});db[_0xbe2c('0x1c1')][_0xbe2c('0x109')](db[_0xbe2c('0xaa')],{'as':_0xbe2c('0x1b5'),'onDelete':_0xbe2c('0x106'),'foreignKey':'DescriptionId'});db[_0xbe2c('0x1c1')][_0xbe2c('0x109')](db[_0xbe2c('0xaa')],{'as':_0xbe2c('0x1ae'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0x1c1')][_0xbe2c('0x117')](db[_0xbe2c('0xa7')],{'as':_0xbe2c('0x161'),'foreignKey':_0xbe2c('0x1b2')});db[_0xbe2c('0xaa')][_0xbe2c('0x109')](db['ZohoField'],{'as':_0xbe2c('0x1bd'),'foreignKey':_0xbe2c('0x1b4')});db[_0xbe2c('0xaa')][_0xbe2c('0x109')](db[_0xbe2c('0xaa')],{'as':_0xbe2c('0x1b8'),'foreignKey':_0xbe2c('0x1b6')});db[_0xbe2c('0xaa')][_0xbe2c('0x109')](db['ZohoField'],{'as':_0xbe2c('0x1b9'),'foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0xaa')][_0xbe2c('0x117')](db[_0xbe2c('0x8f')],{'as':_0xbe2c('0x8f'),'foreignKey':_0xbe2c('0x1be')});db[_0xbe2c('0x1c2')][_0xbe2c('0x109')](db[_0xbe2c('0xad')],{'as':_0xbe2c('0x1b1'),'onDelete':_0xbe2c('0x106'),'foreignKey':'AccountId'});db['ZendeskConfiguration']['hasMany'](db[_0xbe2c('0x1c3')],{'as':_0xbe2c('0x1b3'),'foreignKey':_0xbe2c('0x1b4')});db[_0xbe2c('0xad')]['hasMany'](db[_0xbe2c('0x1c3')],{'as':_0xbe2c('0x1b5'),'foreignKey':_0xbe2c('0x1b6')});db[_0xbe2c('0xad')][_0xbe2c('0x109')](db['ZendeskField'],{'as':_0xbe2c('0x1ae'),'foreignKey':_0xbe2c('0x1ba')});db['ZendeskConfiguration'][_0xbe2c('0x117')](db['ZendeskAccount'],{'as':_0xbe2c('0x161'),'foreignKey':_0xbe2c('0x1b2')});db[_0xbe2c('0xad')][_0xbe2c('0x119')](db[_0xbe2c('0x8a')],{'through':_0xbe2c('0x1c4')});db[_0xbe2c('0x1c3')][_0xbe2c('0x109')](db[_0xbe2c('0x1c3')],{'as':_0xbe2c('0x1bd'),'foreignKey':'SubjectId'});db[_0xbe2c('0x1c3')][_0xbe2c('0x109')](db['ZendeskField'],{'as':'Description','foreignKey':_0xbe2c('0x1b6')});db[_0xbe2c('0x1c3')][_0xbe2c('0x109')](db[_0xbe2c('0x1c3')],{'as':_0xbe2c('0x1b9'),'foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0x1c3')]['belongsTo'](db[_0xbe2c('0x8f')],{'as':_0xbe2c('0x8f'),'foreignKey':_0xbe2c('0x1be')});db[_0xbe2c('0xb0')][_0xbe2c('0x109')](db[_0xbe2c('0x1c5')],{'as':_0xbe2c('0x1b1'),'onDelete':_0xbe2c('0x106'),'foreignKey':'AccountId'});db[_0xbe2c('0x1c5')][_0xbe2c('0x109')](db[_0xbe2c('0xb3')],{'as':'Subjects','onDelete':_0xbe2c('0x106'),'foreignKey':'SubjectId'});db[_0xbe2c('0x1c5')][_0xbe2c('0x109')](db[_0xbe2c('0xb3')],{'as':_0xbe2c('0x1b5'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xbe2c('0x1c5')][_0xbe2c('0x109')](db[_0xbe2c('0xb3')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0x1c5')][_0xbe2c('0x117')](db[_0xbe2c('0xb0')],{'as':'Account','foreignKey':_0xbe2c('0x1b2')});db[_0xbe2c('0x1c5')][_0xbe2c('0x119')](db[_0xbe2c('0x8a')],{'through':_0xbe2c('0x1c6')});db['FreshdeskField'][_0xbe2c('0x109')](db[_0xbe2c('0xb3')],{'as':_0xbe2c('0x1bd'),'foreignKey':_0xbe2c('0x1b4')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0xbe2c('0x1b8'),'foreignKey':_0xbe2c('0x1b6')});db[_0xbe2c('0xb3')][_0xbe2c('0x109')](db[_0xbe2c('0xb3')],{'as':_0xbe2c('0x1b9'),'foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0xb3')][_0xbe2c('0x117')](db['Variable'],{'as':_0xbe2c('0x8f'),'foreignKey':_0xbe2c('0x1be')});db['VtigerAccount'][_0xbe2c('0x109')](db[_0xbe2c('0x1c7')],{'as':_0xbe2c('0x1b1'),'onDelete':'cascade','foreignKey':_0xbe2c('0x1b2')});db[_0xbe2c('0x1c7')]['hasMany'](db[_0xbe2c('0xb5')],{'as':'Subjects','foreignKey':_0xbe2c('0x1b4')});db[_0xbe2c('0x1c7')]['hasMany'](db['VtigerField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xbe2c('0x1c7')][_0xbe2c('0x109')](db['VtigerField'],{'as':_0xbe2c('0x1ae'),'foreignKey':_0xbe2c('0x1ba')});db['VtigerConfiguration']['belongsTo'](db['VtigerAccount'],{'as':_0xbe2c('0x161'),'foreignKey':'AccountId'});db[_0xbe2c('0xb5')]['hasMany'](db['VtigerField'],{'as':_0xbe2c('0x1bd'),'foreignKey':_0xbe2c('0x1b4')});db[_0xbe2c('0xb5')][_0xbe2c('0x109')](db[_0xbe2c('0xb5')],{'as':_0xbe2c('0x1b8'),'foreignKey':_0xbe2c('0x1b6')});db['VtigerField'][_0xbe2c('0x109')](db['VtigerField'],{'as':'Field','foreignKey':'FieldId'});db[_0xbe2c('0xb5')][_0xbe2c('0x117')](db['Variable'],{'as':_0xbe2c('0x8f'),'foreignKey':_0xbe2c('0x1be')});db[_0xbe2c('0xb7')][_0xbe2c('0x109')](db[_0xbe2c('0xb9')],{'as':_0xbe2c('0x1b1'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1b2')});db[_0xbe2c('0xb9')]['hasMany'](db['ServicenowField'],{'as':_0xbe2c('0x1b3'),'foreignKey':_0xbe2c('0x1b4')});db['ServicenowConfiguration']['hasMany'](db[_0xbe2c('0xba')],{'as':'Descriptions','foreignKey':_0xbe2c('0x1b6')});db['ServicenowConfiguration']['hasMany'](db['ServicenowField'],{'as':'Fields','foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0xb9')]['belongsTo'](db['ServicenowAccount'],{'as':'Account','foreignKey':_0xbe2c('0x1b2')});db['ServicenowField'][_0xbe2c('0x109')](db[_0xbe2c('0xba')],{'as':_0xbe2c('0x1bd'),'foreignKey':_0xbe2c('0x1b4')});db[_0xbe2c('0xba')][_0xbe2c('0x109')](db[_0xbe2c('0xba')],{'as':_0xbe2c('0x1b8'),'foreignKey':_0xbe2c('0x1b6')});db['ServicenowField'][_0xbe2c('0x109')](db[_0xbe2c('0xba')],{'as':_0xbe2c('0x1b9'),'foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0xba')][_0xbe2c('0x117')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0xbe2c('0xbb')][_0xbe2c('0x109')](db[_0xbe2c('0xbd')],{'as':_0xbe2c('0x1b1'),'onDelete':_0xbe2c('0x106'),'foreignKey':'AccountId'});db[_0xbe2c('0xbb')][_0xbe2c('0x117')](db[_0xbe2c('0x154')],{'as':_0xbe2c('0x154'),'foreignKey':_0xbe2c('0x155')});db['Dynamics365Configuration']['hasMany'](db[_0xbe2c('0x1c8')],{'as':_0xbe2c('0x1b3'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1b4')});db[_0xbe2c('0xbd')][_0xbe2c('0x109')](db[_0xbe2c('0x1c8')],{'as':_0xbe2c('0x1b5'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1b6')});db[_0xbe2c('0xbd')][_0xbe2c('0x109')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0xbd')]['belongsTo'](db[_0xbe2c('0xbb')],{'as':'Account','foreignKey':_0xbe2c('0x1b2')});db[_0xbe2c('0x1c8')][_0xbe2c('0x109')](db[_0xbe2c('0x1c8')],{'as':_0xbe2c('0x1bd'),'foreignKey':_0xbe2c('0x1b4')});db[_0xbe2c('0x1c8')][_0xbe2c('0x109')](db[_0xbe2c('0x1c8')],{'as':_0xbe2c('0x1b8'),'foreignKey':'DescriptionId'});db[_0xbe2c('0x1c8')][_0xbe2c('0x109')](db[_0xbe2c('0x1c8')],{'as':_0xbe2c('0x1b9'),'foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0x1c8')]['belongsTo'](db['Variable'],{'as':_0xbe2c('0x8f'),'foreignKey':_0xbe2c('0x1be')});db[_0xbe2c('0xc0')][_0xbe2c('0x109')](db[_0xbe2c('0xc1')],{'as':'Configurations','onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1b2')});db[_0xbe2c('0xc1')]['hasMany'](db[_0xbe2c('0xc3')],{'as':_0xbe2c('0x1b3'),'foreignKey':_0xbe2c('0x1b4')});db[_0xbe2c('0xc1')]['hasMany'](db['FreshsalesField'],{'as':_0xbe2c('0x1b5'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':'Fields','foreignKey':_0xbe2c('0x1ba')});db['FreshsalesConfiguration'][_0xbe2c('0x117')](db['FreshsalesAccount'],{'as':_0xbe2c('0x161'),'foreignKey':_0xbe2c('0x1b2')});db[_0xbe2c('0xc3')][_0xbe2c('0x109')](db['FreshsalesField'],{'as':'Subject','foreignKey':_0xbe2c('0x1b4')});db[_0xbe2c('0xc3')][_0xbe2c('0x109')](db['FreshsalesField'],{'as':'Description','foreignKey':_0xbe2c('0x1b6')});db[_0xbe2c('0xc3')][_0xbe2c('0x109')](db['FreshsalesField'],{'as':_0xbe2c('0x1b9'),'foreignKey':_0xbe2c('0x1ba')});db[_0xbe2c('0xc3')][_0xbe2c('0x117')](db[_0xbe2c('0x8f')],{'as':'Variable','foreignKey':_0xbe2c('0x1be')});db[_0xbe2c('0xc6')][_0xbe2c('0x117')](db['ChatWebsite'],{});db[_0xbe2c('0xc6')][_0xbe2c('0x117')](db['CmList'],{'as':_0xbe2c('0x15c'),'foreignKey':_0xbe2c('0x15d')});db[_0xbe2c('0xc6')]['belongsTo'](db[_0xbe2c('0x72')],{'as':_0xbe2c('0x151'),'foreignKey':_0xbe2c('0x152')});db[_0xbe2c('0xc6')][_0xbe2c('0x117')](db[_0xbe2c('0x66')],{});db[_0xbe2c('0xc6')][_0xbe2c('0x117')](db[_0xbe2c('0x185')],{});db[_0xbe2c('0xc6')]['belongsTo'](db[_0xbe2c('0x104')],{});db[_0xbe2c('0xc6')][_0xbe2c('0x117')](db['ChatQueue'],{});db['ChatInternalMessage'][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0xbe2c('0x189')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1c9')});db[_0xbe2c('0xcc')][_0xbe2c('0x109')](db[_0xbe2c('0xcb')],{'foreignKey':'SessionId','onDelete':_0xbe2c('0x106')});db[_0xbe2c('0xcc')][_0xbe2c('0x109')](db['JscriptyAnswerReport'],{'foreignKey':_0xbe2c('0x1ca'),'onDelete':'cascade'});db[_0xbe2c('0xce')][_0xbe2c('0x117')](db['SmsAccount'],{});db[_0xbe2c('0xce')][_0xbe2c('0x117')](db['CmList'],{'as':_0xbe2c('0x15c'),'foreignKey':'ListId'});db['SmsQueueReport'][_0xbe2c('0x117')](db[_0xbe2c('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0xbe2c('0xce')]['belongsTo'](db[_0xbe2c('0x56')],{});db[_0xbe2c('0xce')]['belongsTo'](db[_0xbe2c('0x58')],{});db[_0xbe2c('0xce')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{});db[_0xbe2c('0xce')][_0xbe2c('0x117')](db[_0xbe2c('0x59')],{});db['JscriptyProject']['hasMany'](db[_0xbe2c('0xcc')],{'foreignKey':_0xbe2c('0x1cb')});db[_0xbe2c('0xd2')]['hasMany'](db[_0xbe2c('0xcb')],{'foreignKey':_0xbe2c('0x1cb')});db[_0xbe2c('0xd2')][_0xbe2c('0x109')](db[_0xbe2c('0xc9')],{'foreignKey':_0xbe2c('0x1cb')});db['SquareProject'][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':'Users','through':_0xbe2c('0x13b')});db[_0xbe2c('0xdd')][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x15f'),'through':_0xbe2c('0x120')});db['Team'][_0xbe2c('0x119')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0xbe2c('0x127')});db[_0xbe2c('0xdd')][_0xbe2c('0x119')](db[_0xbe2c('0x3b')],{'through':_0xbe2c('0x160'),'as':_0xbe2c('0x12a')});db[_0xbe2c('0xdd')][_0xbe2c('0x119')](db[_0xbe2c('0x6b')],{'through':_0xbe2c('0x188'),'as':_0xbe2c('0x12b')});db[_0xbe2c('0xdd')]['belongsToMany'](db[_0xbe2c('0x12c')],{'through':_0xbe2c('0x1cc'),'as':_0xbe2c('0x12d')});db[_0xbe2c('0xdd')][_0xbe2c('0x119')](db[_0xbe2c('0x59')],{'through':_0xbe2c('0x178'),'as':'SmsQueues'});db[_0xbe2c('0xdd')][_0xbe2c('0x119')](db[_0xbe2c('0x60')],{'through':'team_has_openchannel_queues','as':_0xbe2c('0x12e')});db['Team'][_0xbe2c('0x119')](db[_0xbe2c('0xfb')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0xbe2c('0xdd')][_0xbe2c('0x119')](db[_0xbe2c('0xee')],{'through':_0xbe2c('0x1cd'),'as':_0xbe2c('0x128')});db[_0xbe2c('0x190')][_0xbe2c('0x109')](db[_0xbe2c('0x18b')],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0xbe2c('0x190')][_0xbe2c('0x109')](db[_0xbe2c('0x76')],{'as':'HopperFinals','foreignKey':_0xbe2c('0x191')});db[_0xbe2c('0x190')][_0xbe2c('0x109')](db[_0xbe2c('0x110')],{'as':_0xbe2c('0x143'),'foreignKey':_0xbe2c('0x191')});db['Campaign'][_0xbe2c('0x109')](db[_0xbe2c('0x75')],{'as':'HopperBlacks','foreignKey':_0xbe2c('0x191')});db[_0xbe2c('0x190')][_0xbe2c('0x117')](db[_0xbe2c('0x27')],{'as':'Trunk','foreignKey':_0xbe2c('0x145')});db['Campaign'][_0xbe2c('0x117')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0xbe2c('0x147')});db[_0xbe2c('0x190')][_0xbe2c('0x117')](db[_0xbe2c('0x82')],{'as':_0xbe2c('0x82'),'foreignKey':_0xbe2c('0x148')});db[_0xbe2c('0x190')][_0xbe2c('0x117')](db[_0xbe2c('0xd8')],{'as':_0xbe2c('0xd8'),'foreignKey':_0xbe2c('0x1ce')});db[_0xbe2c('0x190')][_0xbe2c('0x119')](db[_0xbe2c('0xed')],{'as':_0xbe2c('0x11e'),'through':_0xbe2c('0x1cf')});db[_0xbe2c('0x190')][_0xbe2c('0x119')](db[_0xbe2c('0xed')],{'as':_0xbe2c('0x14c'),'through':_0xbe2c('0x1d0')});db[_0xbe2c('0xe2')][_0xbe2c('0x117')](db[_0xbe2c('0x69')],{'as':_0xbe2c('0x69'),'foreignKey':'ChatOfflineMessageId'});db[_0xbe2c('0xe6')][_0xbe2c('0x117')](db['MailMessage'],{});db['MailTransferReport'][_0xbe2c('0x117')](db[_0xbe2c('0x3e')],{});db[_0xbe2c('0xe6')][_0xbe2c('0x117')](db[_0xbe2c('0x39')],{'foreignKey':_0xbe2c('0x1d1'),'as':'FromAccount'});db[_0xbe2c('0xe6')]['belongsTo'](db[_0xbe2c('0x104')],{'foreignKey':_0xbe2c('0x1d2'),'as':_0xbe2c('0x1d3')});db[_0xbe2c('0xe6')]['belongsTo'](db[_0xbe2c('0x104')],{'foreignKey':'ToUserId','as':_0xbe2c('0x1d4')});db[_0xbe2c('0xe6')][_0xbe2c('0x117')](db[_0xbe2c('0x3b')],{'foreignKey':'ToMailQueueId','as':_0xbe2c('0x1d5')});db[_0xbe2c('0xe6')][_0xbe2c('0x117')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0xbe2c('0x1d6')});db[_0xbe2c('0x1d7')][_0xbe2c('0x117')](db[_0xbe2c('0x185')],{});db['ChatTransferReport'][_0xbe2c('0x117')](db[_0xbe2c('0x66')],{});db[_0xbe2c('0x1d7')]['belongsTo'](db[_0xbe2c('0x61')],{'foreignKey':'FromChatWebsiteId','as':_0xbe2c('0x1d8')});db[_0xbe2c('0x1d7')][_0xbe2c('0x117')](db['User'],{'foreignKey':_0xbe2c('0x1d2'),'as':_0xbe2c('0x1d3')});db['ChatTransferReport'][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'foreignKey':'ToUserId','as':_0xbe2c('0x1d4')});db['ChatTransferReport']['belongsTo'](db[_0xbe2c('0x6b')],{'foreignKey':_0xbe2c('0x1d9'),'as':_0xbe2c('0x1d5')});db[_0xbe2c('0x1d7')]['belongsTo'](db[_0xbe2c('0x61')],{'foreignKey':'ToChatWebsiteId','as':_0xbe2c('0x1d6')});db['FaxTransferReport'][_0xbe2c('0x117')](db[_0xbe2c('0x4e')],{});db[_0xbe2c('0x1da')][_0xbe2c('0x117')](db[_0xbe2c('0x4c')],{});db['FaxTransferReport'][_0xbe2c('0x117')](db[_0xbe2c('0x49')],{'foreignKey':_0xbe2c('0x1db'),'as':'FromAccount'});db[_0xbe2c('0x1da')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'foreignKey':_0xbe2c('0x1d2'),'as':_0xbe2c('0x1d3')});db[_0xbe2c('0x1da')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'foreignKey':'ToUserId','as':_0xbe2c('0x1d4')});db['FaxTransferReport']['belongsTo'](db[_0xbe2c('0x12c')],{'foreignKey':_0xbe2c('0x1dc'),'as':_0xbe2c('0x1d5')});db['FaxTransferReport'][_0xbe2c('0x117')](db[_0xbe2c('0x49')],{'foreignKey':'ToFaxAccountId','as':_0xbe2c('0x1d6')});db['OpenchannelTransferReport']['belongsTo'](db[_0xbe2c('0x17a')],{});db[_0xbe2c('0xe9')][_0xbe2c('0x117')](db[_0xbe2c('0x5d')],{});db['OpenchannelTransferReport'][_0xbe2c('0x117')](db[_0xbe2c('0x5a')],{'foreignKey':_0xbe2c('0x1dd'),'as':_0xbe2c('0x1d8')});db[_0xbe2c('0xe9')]['belongsTo'](db[_0xbe2c('0x104')],{'foreignKey':_0xbe2c('0x1d2'),'as':'FromAgent'});db[_0xbe2c('0xe9')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'foreignKey':'ToUserId','as':_0xbe2c('0x1d4')});db[_0xbe2c('0xe9')][_0xbe2c('0x117')](db[_0xbe2c('0x60')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0xbe2c('0xe9')][_0xbe2c('0x117')](db[_0xbe2c('0x5a')],{'foreignKey':_0xbe2c('0x1de'),'as':_0xbe2c('0x1d6')});db['SmsTransferReport'][_0xbe2c('0x117')](db[_0xbe2c('0x58')],{});db[_0xbe2c('0xeb')][_0xbe2c('0x117')](db[_0xbe2c('0x56')],{});db['SmsTransferReport'][_0xbe2c('0x117')](db['SmsAccount'],{'foreignKey':_0xbe2c('0x1df'),'as':_0xbe2c('0x1d8')});db['SmsTransferReport']['belongsTo'](db[_0xbe2c('0x104')],{'foreignKey':_0xbe2c('0x1d2'),'as':_0xbe2c('0x1d3')});db[_0xbe2c('0xeb')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'foreignKey':_0xbe2c('0x1e0'),'as':'ToAgent'});db['SmsTransferReport'][_0xbe2c('0x117')](db[_0xbe2c('0x59')],{'foreignKey':_0xbe2c('0x1e1'),'as':_0xbe2c('0x1d5')});db['SmsTransferReport']['belongsTo'](db['SmsAccount'],{'foreignKey':_0xbe2c('0x1e2'),'as':_0xbe2c('0x1d6')});db[_0xbe2c('0xed')]['hasMany'](db[_0xbe2c('0x16b')],{'as':_0xbe2c('0x159'),'foreignKey':_0xbe2c('0x15d'),'onDelete':_0xbe2c('0x106')});db[_0xbe2c('0xed')][_0xbe2c('0x109')](db[_0xbe2c('0x79')],{'as':'CustomFields','foreignKey':'ListId'});db[_0xbe2c('0xed')][_0xbe2c('0x109')](db['CmContact'],{'as':_0xbe2c('0x11c'),'onDelete':'cascade','foreignKey':_0xbe2c('0x15d')});db[_0xbe2c('0xed')][_0xbe2c('0x109')](db[_0xbe2c('0x76')],{'as':_0xbe2c('0x10f'),'foreignKey':_0xbe2c('0x15d')});db[_0xbe2c('0xed')][_0xbe2c('0x109')](db[_0xbe2c('0x110')],{'as':_0xbe2c('0x111'),'foreignKey':_0xbe2c('0x15d')});db[_0xbe2c('0xed')][_0xbe2c('0x109')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xbe2c('0x15d')});db[_0xbe2c('0xed')][_0xbe2c('0x119')](db[_0xbe2c('0x1a')],{'as':_0xbe2c('0x1e3'),'through':'voice_queues_has_cm_lists'});db['CmList']['belongsToMany'](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x15f'),'through':_0xbe2c('0x11f')});db[_0xbe2c('0xee')]['hasMany'](db[_0xbe2c('0x17')],{'as':_0xbe2c('0x10e'),'onDelete':_0xbe2c('0x106')});db[_0xbe2c('0xee')][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x15f'),'through':_0xbe2c('0x129')});db[_0xbe2c('0xee')][_0xbe2c('0x119')](db[_0xbe2c('0xdd')],{'through':_0xbe2c('0x1cd'),'as':_0xbe2c('0x14b')});db[_0xbe2c('0xef')]['hasMany'](db['User'],{'as':_0xbe2c('0x171'),'foreignKey':_0xbe2c('0x118')});db[_0xbe2c('0xef')]['hasMany'](db[_0xbe2c('0xf1')],{'as':_0xbe2c('0x1e4'),'foreignKey':_0xbe2c('0x118'),'onDelete':_0xbe2c('0x106')});db['UserProfileSection'][_0xbe2c('0x109')](db[_0xbe2c('0xf3')],{'as':_0xbe2c('0x1e5'),'foreignKey':_0xbe2c('0x1e6'),'onDelete':'cascade'});db[_0xbe2c('0xf5')][_0xbe2c('0x109')](db[_0xbe2c('0x16b')],{'as':_0xbe2c('0x159'),'foreignKey':_0xbe2c('0x1e7'),'onDelete':_0xbe2c('0x106')});db['WhatsappAccount'][_0xbe2c('0x109')](db['CannedAnswer'],{'as':_0xbe2c('0x15a'),'foreignKey':_0xbe2c('0x1e7')});db[_0xbe2c('0xf5')][_0xbe2c('0x109')](db[_0xbe2c('0x1e8')],{'as':_0xbe2c('0x14d'),'foreignKey':_0xbe2c('0x1e7')});db[_0xbe2c('0xf5')][_0xbe2c('0x109')](db[_0xbe2c('0xf7')],{'as':'Interactions'});db['WhatsappAccount'][_0xbe2c('0x109')](db['WhatsappApplication'],{'as':_0xbe2c('0x13e')});db[_0xbe2c('0xf5')][_0xbe2c('0x117')](db['CmList'],{'as':_0xbe2c('0x15c'),'foreignKey':_0xbe2c('0x15d')});db[_0xbe2c('0xf5')][_0xbe2c('0x117')](db[_0xbe2c('0x83')],{'as':_0xbe2c('0x149'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xbe2c('0xf5')][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x15f'),'through':'user_has_whatsapp_accounts'});db[_0xbe2c('0xf6')]['belongsTo'](db['User'],{'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0xf6')][_0xbe2c('0x117')](db['WhatsappQueue'],{'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0xf6')][_0xbe2c('0x117')](db[_0xbe2c('0xf5')],{'onDelete':'restrict'});db[_0xbe2c('0xf6')]['belongsTo'](db['Interval'],{'onDelete':_0xbe2c('0x156'),'foreignKey':_0xbe2c('0x148')});db[_0xbe2c('0xf6')][_0xbe2c('0x117')](db[_0xbe2c('0x8a')],{'onDelete':_0xbe2c('0x156'),'foreignKey':_0xbe2c('0x169')});db[_0xbe2c('0xf7')][_0xbe2c('0x109')](db[_0xbe2c('0x1e8')],{'as':_0xbe2c('0x14d'),'onDelete':_0xbe2c('0x106'),'foreignKey':_0xbe2c('0x1e9')});db['WhatsappInteraction'][_0xbe2c('0x117')](db[_0xbe2c('0xf5')],{'as':_0xbe2c('0x161'),'foreignKey':_0xbe2c('0x1e7')});db[_0xbe2c('0xf7')][_0xbe2c('0x117')](db[_0xbe2c('0x72')],{'as':_0xbe2c('0x151'),'foreignKey':_0xbe2c('0x152')});db[_0xbe2c('0xf7')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'as':'Owner','foreignKey':'UserId'});db[_0xbe2c('0xf7')][_0xbe2c('0x119')](db[_0xbe2c('0x8a')],{'through':_0xbe2c('0x1a5'),'as':_0xbe2c('0x164')});db[_0xbe2c('0xf7')][_0xbe2c('0x119')](db['Tag'],{'through':_0xbe2c('0x1a5'),'as':_0xbe2c('0x170')});db[_0xbe2c('0xf7')][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x171'),'through':_0xbe2c('0x1ea'),'foreignKey':_0xbe2c('0x1e9')});db[_0xbe2c('0x1e8')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'as':_0xbe2c('0x104')});db[_0xbe2c('0x1e8')][_0xbe2c('0x117')](db[_0xbe2c('0x72')],{'onDelete':_0xbe2c('0x106'),'as':_0xbe2c('0x151')});db[_0xbe2c('0x1e8')]['belongsTo'](db[_0xbe2c('0xf7')],{'onDelete':_0xbe2c('0x106'),'as':_0xbe2c('0x173'),'foreignKey':_0xbe2c('0x1e9')});db['WhatsappMessage'][_0xbe2c('0x117')](db[_0xbe2c('0xf5')],{'as':_0xbe2c('0x161'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0xbe2c('0x117')](db[_0xbe2c('0xf5')],{});db[_0xbe2c('0x1eb')][_0xbe2c('0x117')](db[_0xbe2c('0xed')],{'as':_0xbe2c('0x15c'),'foreignKey':_0xbe2c('0x15d')});db['WhatsappQueueReport'][_0xbe2c('0x117')](db[_0xbe2c('0x72')],{'as':'Contact','foreignKey':'ContactId'});db['WhatsappQueueReport'][_0xbe2c('0x117')](db['WhatsappInteraction'],{});db[_0xbe2c('0x1eb')]['belongsTo'](db[_0xbe2c('0xfb')],{});db[_0xbe2c('0x1eb')][_0xbe2c('0x117')](db[_0xbe2c('0x1e8')],{});db[_0xbe2c('0x1eb')]['belongsTo'](db[_0xbe2c('0x104')],{});db[_0xbe2c('0xf9')][_0xbe2c('0x117')](db[_0xbe2c('0x1e8')],{});db[_0xbe2c('0xf9')][_0xbe2c('0x117')](db[_0xbe2c('0xf7')],{});db[_0xbe2c('0xf9')][_0xbe2c('0x117')](db[_0xbe2c('0xf5')],{'foreignKey':_0xbe2c('0x1ec'),'as':'FromAccount'});db[_0xbe2c('0xf9')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0xbe2c('0x1ed'),'as':'ToAccount'});db['WhatsappTransferReport'][_0xbe2c('0x117')](db[_0xbe2c('0xfb')],{'foreignKey':_0xbe2c('0x1ee'),'as':'ToQueue'});db[_0xbe2c('0xf9')]['belongsTo'](db[_0xbe2c('0x104')],{'foreignKey':_0xbe2c('0x1d2'),'as':'FromAgent'});db[_0xbe2c('0xf9')]['belongsTo'](db[_0xbe2c('0x104')],{'foreignKey':_0xbe2c('0x1e0'),'as':_0xbe2c('0x1d4')});db[_0xbe2c('0xfb')][_0xbe2c('0x119')](db[_0xbe2c('0x104')],{'as':'Agents','through':_0xbe2c('0x35'),'foreignKey':'WhatsappQueueId'});db['WhatsappQueue'][_0xbe2c('0x119')](db[_0xbe2c('0xdd')],{'through':_0xbe2c('0x1ef'),'as':_0xbe2c('0x14b')});db[_0xbe2c('0x102')][_0xbe2c('0x117')](db[_0xbe2c('0x104')],{'as':'user','foreignKey':_0xbe2c('0x107'),'onDelete':_0xbe2c('0x106'),'hooks':!![]});db['CloudProvider'][_0xbe2c('0x105')](db['Dynamics365Account'],{'as':_0xbe2c('0xbb'),'onDelete':_0xbe2c('0x156')});db['CloudProvider']['hasOne'](db[_0xbe2c('0x36')],{'as':_0xbe2c('0x157'),'onDelete':_0xbe2c('0x156')});db[_0xbe2c('0x154')]['hasOne'](db[_0xbe2c('0x37')],{'as':_0xbe2c('0x158'),'onDelete':_0xbe2c('0x156')});module[_0xbe2c('0x1f0')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x8980=['ChatInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','belongsTo','Trunk','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','UserVoiceQueue','Teams','BlackLists','VoiceRecording','Messages','mailbox','mailboxuser','uniqueid','AgentReports','MailServerIn','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Answers','Agents','Team','team_has_mail_queues','Account','ContactId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Contact','Interaction','MailInteractionId','ChatWebsiteId','ChatOfflineMessageId','TagId','ListId','Dashboard','DashboardItem','Items','Disposition','Dispositions','FaxAccountId','Interactions','Exntensions','FaxMessage','List','FaxApplication','FaxInteractionId','AttachmentId','SmsAccountId','user_has_sms_accounts','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatApplication','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatInternalMessage','ChatGroupId','Website','CompanyId','Hoppers','JscriptySessions','cm_contact_has_tags','Agent','Campaign','CampaignId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Schedule','AnalyticCustomReport','CustomReportId','Mohs','fax_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','MetricId','Subjects','Descriptions','DescriptionId','AccountId','SubjectId','Description','Field','FieldId','Variable','VariableId','SugarcrmAccount','Configurations','DeskConfiguration','int_desk_configuration_has_tags','Subject','ZohoConfiguration','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowConfiguration','ServicenowField','Dynamics365Configuration','FreshsalesField','FromId','ToId','JscriptyQuestionReport','SessionId','JscriptyProject','ProjectId','team_has_chat_queues','team_has_fax_queues','team_has_sms_queues','team_has_openchannel_queues','team_has_whatsapp_queues','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToMailQueueId','ToQueue','ToMailAccountId','ChatTransferReport','FromAccount','ToAgent','ToChatWebsiteId','ToAccount','ToFaxAccountId','ToSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToUserId','user','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','127.0.0.1','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xC@LL1234','mysql','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/campaign/campaign.model','Migration','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions'];(function(_0x32baee,_0x9a316a){var _0x439de1=function(_0xf5bb90){while(--_0xf5bb90){_0x32baee['push'](_0x32baee['shift']());}};_0x439de1(++_0x9a316a);}(_0x8980,0xd0));var _0x0898=function(_0x338338,_0x782573){_0x338338=_0x338338-0x0;var _0x3cf852=_0x8980[_0x338338];return _0x3cf852;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x0898('0x0'));var _=require(_0x0898('0x1'));var jstz=require(_0x0898('0x2'));var timezone=jstz['determine']();config[_0x0898('0x0')]=_[_0x0898('0x3')](config[_0x0898('0x0')],{'database':_0x0898('0x4'),'username':_0x0898('0x5'),'password':'xC@LL1234','options':{'host':_0x0898('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0898('0x7')},'logging':![],'timezone':timezone[_0x0898('0x8')](),'define':{'charset':_0x0898('0x9'),'collate':_0x0898('0xa')}}});config[_0x0898('0xb')]=_[_0x0898('0x3')](config[_0x0898('0xb')],{'database':'motion2','username':_0x0898('0x5'),'password':_0x0898('0xc'),'options':{'host':_0x0898('0x6'),'port':0xcea,'dialect':_0x0898('0xd'),'dialectOptions':{'charset':_0x0898('0x7')},'logging':![],'timezone':timezone[_0x0898('0x8')](),'define':{'charset':_0x0898('0x9'),'collate':_0x0898('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0898('0x0')][_0x0898('0xe')],config[_0x0898('0x0')][_0x0898('0xf')],config[_0x0898('0x0')][_0x0898('0x10')],config[_0x0898('0x0')][_0x0898('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0898('0xb')][_0x0898('0xe')],config[_0x0898('0xb')][_0x0898('0xf')],config[_0x0898('0xb')][_0x0898('0x10')],config[_0x0898('0xb')]['options'])};db[_0x0898('0x12')]=db[_0x0898('0x0')]['import'](_0x0898('0x13'));db[_0x0898('0x14')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x16'));db[_0x0898('0x17')]=db[_0x0898('0x0')]['import'](_0x0898('0x18'));db[_0x0898('0x19')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x1a'));db[_0x0898('0x1b')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x1c'));db[_0x0898('0x1d')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x1e'));db['VoiceRecording']=db[_0x0898('0x0')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0898('0x1f')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x20'));db[_0x0898('0x21')]=db['sequelize'][_0x0898('0x15')]('../api/voiceMail/voiceMail.model');db[_0x0898('0x22')]=db[_0x0898('0x0')]['import'](_0x0898('0x23'));db[_0x0898('0x24')]=db[_0x0898('0x0')]['import'](_0x0898('0x25'));db[_0x0898('0x26')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/voiceDialReport/voiceDialReport.model');db[_0x0898('0x27')]=db['sequelize'][_0x0898('0x15')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x0898('0x28')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x29'));db[_0x0898('0x2a')]=db[_0x0898('0x0')]['import'](_0x0898('0x2b'));db['Trunk']=db['sequelize'][_0x0898('0x15')](_0x0898('0x2c'));db[_0x0898('0x2d')]=db[_0x0898('0x0')]['import'](_0x0898('0x2e'));db[_0x0898('0x2f')]=db[_0x0898('0x0')]['import'](_0x0898('0x30'));db['UserVoiceQueue']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x31'));db['UserChatQueue']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x32'));db[_0x0898('0x33')]=db['sequelize']['import'](_0x0898('0x34'));db[_0x0898('0x35')]=db[_0x0898('0x0')]['import'](_0x0898('0x36'));db[_0x0898('0x37')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x38'));db[_0x0898('0x39')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x3a'));db[_0x0898('0x3b')]=db[_0x0898('0x0')]['import'](_0x0898('0x3c'));db['MailServerIn']=db[_0x0898('0x0')]['import'](_0x0898('0x3d'));db[_0x0898('0x3e')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x3f'));db[_0x0898('0x40')]=db[_0x0898('0x0')]['import'](_0x0898('0x41'));db[_0x0898('0x42')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x43'));db[_0x0898('0x44')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x45'));db[_0x0898('0x46')]=db[_0x0898('0x0')]['import']('../api/mailInteraction/mailInteraction.model');db[_0x0898('0x47')]=db['sequelize']['import'](_0x0898('0x48'));db[_0x0898('0x49')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x4a'));db[_0x0898('0x4b')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x4c'));db['Dashboard']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x4d'));db['DashboardItem']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x4e'));db[_0x0898('0x4f')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x50'));db['FaxApplication']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x51'));db[_0x0898('0x52')]=db['sequelize'][_0x0898('0x15')]('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x53'));db[_0x0898('0x54')]=db['sequelize'][_0x0898('0x15')]('../api/faxQueue/faxQueue.model');db[_0x0898('0x55')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x56'));db[_0x0898('0x57')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x58'));db[_0x0898('0x59')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x5a'));db[_0x0898('0x5b')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x5c'));db[_0x0898('0x5d')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x5e'));db[_0x0898('0x5f')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x60'));db[_0x0898('0x61')]=db[_0x0898('0x0')]['import'](_0x0898('0x62'));db['OpenchannelApplication']=db[_0x0898('0x0')][_0x0898('0x15')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x63'));db[_0x0898('0x64')]=db['sequelize']['import'](_0x0898('0x65'));db[_0x0898('0x66')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x67'));db[_0x0898('0x68')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x69'));db[_0x0898('0x6a')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x6b'));db['ChatApplication']=db['sequelize']['import'](_0x0898('0x6c'));db[_0x0898('0x6d')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x6e'));db[_0x0898('0x6f')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x70'));db[_0x0898('0x71')]=db[_0x0898('0x0')]['import'](_0x0898('0x72'));db[_0x0898('0x73')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x74'));db[_0x0898('0x75')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x76'));db[_0x0898('0x77')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x78'));db[_0x0898('0x79')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x7a'));db[_0x0898('0x7b')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x7c'));db[_0x0898('0x7d')]=db[_0x0898('0x0')]['import'](_0x0898('0x7e'));db[_0x0898('0x7f')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x80'));db[_0x0898('0x81')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x82'));db[_0x0898('0x83')]=db[_0x0898('0x0')]['import'](_0x0898('0x84'));db[_0x0898('0x85')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0x0898('0x0')]['import'](_0x0898('0x86'));db[_0x0898('0x87')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x88'));db[_0x0898('0x89')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x8a'));db[_0x0898('0x8b')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db['sequelize'][_0x0898('0x15')](_0x0898('0x8c'));db[_0x0898('0x8d')]=db['sequelize']['import'](_0x0898('0x8e'));db[_0x0898('0x8f')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x90'));db['Pause']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x91'));db['Cdr']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x92'));db['VoiceQueuesLog']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x93'));db['Schedule']=db['sequelize'][_0x0898('0x15')](_0x0898('0x94'));db[_0x0898('0x95')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x96'));db[_0x0898('0x97')]=db[_0x0898('0x0')]['import'](_0x0898('0x98'));db[_0x0898('0x99')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x9a'));db[_0x0898('0x9b')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x9c'));db['Variable']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x9d'));db[_0x0898('0x9e')]=db[_0x0898('0x0')]['import'](_0x0898('0x9f'));db[_0x0898('0xa0')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xa1'));db['AnalyticCustomReport']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xa2'));db[_0x0898('0xa3')]=db[_0x0898('0x0')]['import'](_0x0898('0xa4'));db['AnalyticExtractedReport']=db[_0x0898('0x0')][_0x0898('0x15')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x0898('0xa5')]=db[_0x0898('0x0')]['import'](_0x0898('0xa6'));db[_0x0898('0xa7')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xa8'));db['AnalyticTreeReport']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xa9'));db[_0x0898('0xaa')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xab'));db[_0x0898('0xac')]=db['sequelize'][_0x0898('0x15')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x0898('0xad')]=db['sequelize']['import'](_0x0898('0xae'));db['SugarcrmAccount']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xaf'));db[_0x0898('0xb0')]=db[_0x0898('0x0')]['import'](_0x0898('0xb1'));db[_0x0898('0xb2')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x0898('0xb3')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xb4'));db[_0x0898('0xb5')]=db[_0x0898('0x0')]['import'](_0x0898('0xb6'));db[_0x0898('0xb7')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xb8'));db[_0x0898('0xb9')]=db['sequelize']['import'](_0x0898('0xba'));db[_0x0898('0xbb')]=db[_0x0898('0x0')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xbc'));db['ZendeskField']=db[_0x0898('0x0')]['import'](_0x0898('0xbd'));db['FreshdeskAccount']=db[_0x0898('0x0')]['import'](_0x0898('0xbe'));db[_0x0898('0xbf')]=db['sequelize'][_0x0898('0x15')](_0x0898('0xc0'));db[_0x0898('0xc1')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xc2'));db['VtigerAccount']=db['sequelize']['import'](_0x0898('0xc3'));db[_0x0898('0xc4')]=db['sequelize'][_0x0898('0x15')](_0x0898('0xc5'));db[_0x0898('0xc6')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xc7'));db[_0x0898('0xc8')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xc9'));db['ServicenowConfiguration']=db['sequelize']['import'](_0x0898('0xca'));db['ServicenowField']=db[_0x0898('0x0')]['import'](_0x0898('0xcb'));db[_0x0898('0xcc')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x0898('0x0')]['import'](_0x0898('0xcd'));db[_0x0898('0xce')]=db[_0x0898('0x0')]['import'](_0x0898('0xcf'));db[_0x0898('0xd0')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x0898('0xd1')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xd2'));db['FreshsalesField']=db[_0x0898('0x0')][_0x0898('0x15')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x0898('0x9e')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x9f'));db['Network']=db[_0x0898('0x0')][_0x0898('0x15')]('../api/network/network.model');db[_0x0898('0xd3')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xd4'));db['ChatInternalMessage']=db[_0x0898('0x0')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0898('0xd5')]=db['sequelize']['import'](_0x0898('0xd6'));db['JscriptyQuestionReport']=db['sequelize'][_0x0898('0x15')](_0x0898('0xd7'));db[_0x0898('0xd8')]=db[_0x0898('0x0')]['import'](_0x0898('0xd9'));db[_0x0898('0xda')]=db[_0x0898('0x0')]['import']('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xdb'));db[_0x0898('0xdc')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0x0898('0x0')]['import'](_0x0898('0xdd'));db[_0x0898('0xde')]=db['sequelize'][_0x0898('0x15')](_0x0898('0xdf'));db[_0x0898('0xe0')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db['sequelize']['import']('../api/squareProject/squareProject.model');db[_0x0898('0xe1')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xe2'));db[_0x0898('0xe3')]=db['sequelize']['import'](_0x0898('0xe4'));db['Team']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xe5'));db[_0x0898('0xe6')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/license/license.model');db['Campaign']=db['sequelize'][_0x0898('0x15')](_0x0898('0xe7'));db[_0x0898('0xe8')]=db['sequelize'][_0x0898('0x15')]('../api/migration/migration.model');db[_0x0898('0xe9')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/attachment/attachment.model');db[_0x0898('0xea')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xeb'));db[_0x0898('0xec')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xed'));db['ChatTransferReport']=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xee'));db[_0x0898('0xef')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xf0'));db[_0x0898('0xf1')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xf2'));db[_0x0898('0xf3')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xf4'));db[_0x0898('0xf5')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xf6'));db['VoicePrefix']=db['sequelize'][_0x0898('0x15')](_0x0898('0xf7'));db[_0x0898('0xf8')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/userProfile/userProfile.model');db[_0x0898('0xf9')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xfa'));db[_0x0898('0xfb')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xfc'));db[_0x0898('0xfd')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0xfe'));db[_0x0898('0xff')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x100'));db[_0x0898('0x101')]=db[_0x0898('0x0')]['import'](_0x0898('0x102'));db[_0x0898('0x103')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x104'));db[_0x0898('0x105')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x106'));db[_0x0898('0x107')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x108'));db['WhatsappTransferReport']=db[_0x0898('0x0')]['import'](_0x0898('0x109'));db[_0x0898('0x10a')]=db['sequelize']['import'](_0x0898('0x10b'));db[_0x0898('0x10c')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/cloudProvider/cloudProvider.model');db[_0x0898('0x10d')]=db[_0x0898('0x0')][_0x0898('0x15')](_0x0898('0x10e'));db[_0x0898('0x10f')]=db['sequelize'][_0x0898('0x15')](_0x0898('0x110'));db[_0x0898('0x111')]=db[_0x0898('0x0')][_0x0898('0x15')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x0898('0x112')]=db['sequelize']['import'](_0x0898('0x113'));db[_0x0898('0x12')][_0x0898('0x114')](db[_0x0898('0x21')],{'as':_0x0898('0x21'),'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x116')});db[_0x0898('0x12')]['hasOne'](db[_0x0898('0x112')],{'as':'userSetting','onDelete':'cascade','foreignKey':_0x0898('0x116')});db[_0x0898('0x12')][_0x0898('0x117')](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0x0898('0x116')});db[_0x0898('0x12')][_0x0898('0x117')](db[_0x0898('0x2f')],{'as':_0x0898('0x118'),'foreignKey':_0x0898('0x116')});db[_0x0898('0x12')][_0x0898('0x117')](db['VoiceExtension'],{'as':_0x0898('0x119'),'onDelete':_0x0898('0x115'),'hooks':!![]});db[_0x0898('0x12')]['hasMany'](db[_0x0898('0x81')],{'as':_0x0898('0x11a'),'foreignKey':_0x0898('0x116')});db[_0x0898('0x12')]['hasMany'](db[_0x0898('0x83')],{'as':_0x0898('0x11b'),'foreignKey':_0x0898('0x116')});db['User'][_0x0898('0x117')](db['ReportAgentPreview'],{'as':_0x0898('0x85'),'foreignKey':'UserId'});db[_0x0898('0x12')][_0x0898('0x117')](db[_0x0898('0x11c')],{'as':_0x0898('0x11d'),'foreignKey':_0x0898('0x116')});db[_0x0898('0x12')][_0x0898('0x117')](db[_0x0898('0x6d')],{'as':'ChatInteractions','foreignKey':_0x0898('0x116')});db[_0x0898('0x12')]['hasMany'](db[_0x0898('0x5b')],{'as':_0x0898('0x11e'),'foreignKey':_0x0898('0x116')});db[_0x0898('0x12')]['hasMany'](db['FaxInteraction'],{'as':_0x0898('0x11f'),'foreignKey':_0x0898('0x116')});db[_0x0898('0x12')][_0x0898('0x117')](db[_0x0898('0x46')],{'as':'MailInteractions','foreignKey':_0x0898('0x116')});db['User'][_0x0898('0x117')](db[_0x0898('0x103')],{'as':_0x0898('0x120'),'foreignKey':_0x0898('0x116')});db[_0x0898('0x12')][_0x0898('0x117')](db[_0x0898('0xfd')],{'as':_0x0898('0x121'),'foreignKey':'SenderId'});db[_0x0898('0x12')]['belongsTo'](db[_0x0898('0xf8')],{'as':_0x0898('0xf8'),'foreignKey':_0x0898('0x122')});db[_0x0898('0x12')][_0x0898('0x123')](db[_0x0898('0x75')],{'as':_0x0898('0x124'),'through':_0x0898('0x125')});db['User'][_0x0898('0x123')](db[_0x0898('0x7b')],{'as':_0x0898('0x126'),'through':_0x0898('0x127')});db[_0x0898('0x12')]['belongsToMany'](db['CmList'],{'as':_0x0898('0x128'),'through':_0x0898('0x129')});db['User'][_0x0898('0x123')](db['Team'],{'through':_0x0898('0x12a')});db[_0x0898('0x12')][_0x0898('0x123')](db[_0x0898('0x46')],{'as':_0x0898('0x12b'),'through':_0x0898('0x12c')});db[_0x0898('0x12')][_0x0898('0x123')](db['ChatInteraction'],{'as':_0x0898('0x12d'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0898('0x52')],{'as':_0x0898('0x11f'),'through':_0x0898('0x12e')});db['User'][_0x0898('0x123')](db[_0x0898('0x5b')],{'as':_0x0898('0x11e'),'through':_0x0898('0x12f')});db[_0x0898('0x12')][_0x0898('0x123')](db[_0x0898('0x11c')],{'as':'OpenchannelInteractions','through':_0x0898('0x130')});db['User']['belongsToMany'](db[_0x0898('0x103')],{'as':_0x0898('0x120'),'through':_0x0898('0x131')});db['User'][_0x0898('0x123')](db['VoiceQueue'],{'as':_0x0898('0x132'),'through':'UserVoiceQueue','required':![]});db[_0x0898('0x12')][_0x0898('0x123')](db[_0x0898('0x133')],{'as':_0x0898('0x134'),'through':'UserVoicePrefix','required':![]});db[_0x0898('0x12')][_0x0898('0x123')](db['MailQueue'],{'as':_0x0898('0x135'),'through':_0x0898('0x33'),'required':![]});db['User'][_0x0898('0x123')](db[_0x0898('0x73')],{'as':_0x0898('0x136'),'through':_0x0898('0x137'),'required':![],'hooks':!![]});db[_0x0898('0x12')]['belongsToMany'](db[_0x0898('0x54')],{'as':_0x0898('0x138'),'through':'UserFaxQueue','required':![]});db[_0x0898('0x12')][_0x0898('0x123')](db[_0x0898('0x5f')],{'as':_0x0898('0x139'),'through':_0x0898('0x37'),'required':![]});db[_0x0898('0x12')]['belongsToMany'](db[_0x0898('0x66')],{'as':_0x0898('0x13a'),'through':_0x0898('0x39'),'required':![]});db[_0x0898('0x12')]['belongsToMany'](db['WhatsappQueue'],{'as':_0x0898('0x13b'),'through':_0x0898('0x3b'),'required':![]});db[_0x0898('0x12')][_0x0898('0x123')](db[_0x0898('0xf5')],{'through':'cm_user_has_lists'});db[_0x0898('0x12')][_0x0898('0x123')](db['ChatWebsite'],{'as':_0x0898('0x13c'),'through':'user_has_chat_websites'});db[_0x0898('0x12')][_0x0898('0x123')](db[_0x0898('0x4f')],{'as':'FaxAccounts','through':_0x0898('0x13d')});db[_0x0898('0x12')]['belongsToMany'](db[_0x0898('0x40')],{'as':_0x0898('0x13e'),'through':_0x0898('0x13f')});db[_0x0898('0x12')][_0x0898('0x123')](db[_0x0898('0x61')],{'as':_0x0898('0x140'),'through':_0x0898('0x141')});db[_0x0898('0x12')][_0x0898('0x123')](db[_0x0898('0x57')],{'as':_0x0898('0x142'),'through':'user_has_sms_accounts'});db[_0x0898('0x12')][_0x0898('0x123')](db[_0x0898('0xff')],{'as':_0x0898('0x143'),'through':_0x0898('0x144')});db['User'][_0x0898('0x123')](db[_0x0898('0x145')],{'as':'SquareProjects','through':_0x0898('0x146')});db[_0x0898('0x14')][_0x0898('0x117')](db[_0x0898('0x19')],{'as':_0x0898('0x147'),'onDelete':'cascade','foreignKey':_0x0898('0x148')});db['VoiceContext']['hasMany'](db[_0x0898('0x19')],{'onDelete':_0x0898('0x115')});db['VoiceExtension'][_0x0898('0x117')](db[_0x0898('0x19')],{'as':_0x0898('0x149'),'onDelete':_0x0898('0x115')});db[_0x0898('0x1b')]['belongsToMany'](db[_0x0898('0x95')],{'as':_0x0898('0x14a'),'through':_0x0898('0x14b')});db[_0x0898('0x1d')][_0x0898('0x117')](db[_0x0898('0x2f')],{'as':_0x0898('0x14c'),'foreignKey':_0x0898('0x14d')});db['VoiceQueue'][_0x0898('0x117')](db[_0x0898('0x7d')],{'as':'Hoppers','foreignKey':_0x0898('0x14d')});db['VoiceQueue'][_0x0898('0x117')](db['CmHopperFinal'],{'as':_0x0898('0x11a'),'foreignKey':_0x0898('0x14d')});db[_0x0898('0x1d')][_0x0898('0x117')](db[_0x0898('0x83')],{'as':_0x0898('0x14e'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0x0898('0x85')],{'as':_0x0898('0x85'),'foreignKey':_0x0898('0x14d')});db[_0x0898('0x1d')][_0x0898('0x117')](db[_0x0898('0x7f')],{'as':_0x0898('0x14f'),'foreignKey':'VoiceQueueId'});db[_0x0898('0x1d')][_0x0898('0x117')](db[_0x0898('0xd8')],{'as':'JscriptySessions','foreignKey':_0x0898('0x14d')});db['VoiceQueue'][_0x0898('0x150')](db[_0x0898('0x151')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x0898('0x1d')][_0x0898('0x150')](db[_0x0898('0x151')],{'as':_0x0898('0x152'),'foreignKey':_0x0898('0x153')});db[_0x0898('0x1d')][_0x0898('0x150')](db[_0x0898('0x8f')],{'as':'Interval','foreignKey':_0x0898('0x154')});db[_0x0898('0x1d')]['belongsTo'](db[_0x0898('0x155')],{'as':_0x0898('0x156'),'foreignKey':_0x0898('0x157')});db[_0x0898('0x1d')][_0x0898('0x123')](db['CmList'],{'as':_0x0898('0x128'),'through':'voice_queues_has_cm_lists'});db[_0x0898('0x1d')][_0x0898('0x123')](db[_0x0898('0x12')],{'as':'Agents','through':_0x0898('0x158')});db[_0x0898('0x1d')][_0x0898('0x123')](db['Team'],{'as':_0x0898('0x159'),'through':_0x0898('0x10d')});db[_0x0898('0x1d')][_0x0898('0x123')](db[_0x0898('0xf5')],{'as':_0x0898('0x15a'),'through':'voice_queues_has_cm_blacklists'});db[_0x0898('0x15b')][_0x0898('0x150')](db[_0x0898('0x12')],{'as':_0x0898('0x12'),'foreignKey':_0x0898('0x116')});db[_0x0898('0x1f')]['belongsTo'](db['User'],{'as':_0x0898('0x12'),'foreignKey':_0x0898('0x116')});db[_0x0898('0x21')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0898('0x15c'),'onDelete':_0x0898('0x115'),'foreignKey':'mailboxuser','sourceKey':_0x0898('0x15d')});db[_0x0898('0x22')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0x0898('0x15e'),'targetKey':_0x0898('0x15d')});db[_0x0898('0x24')][_0x0898('0x117')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x0898('0x15f'),'constraints':![]});db[_0x0898('0x24')][_0x0898('0x117')](db[_0x0898('0x27')],{'as':_0x0898('0x160'),'foreignKey':_0x0898('0x15f'),'constraints':![]});db[_0x0898('0x24')][_0x0898('0x150')](db[_0x0898('0x12')],{'as':_0x0898('0x12'),'foreignKey':'UserId'});db[_0x0898('0x24')]['belongsTo'](db[_0x0898('0x7b')],{'as':'Contact','foreignKey':'ContactId'});db[_0x0898('0x161')][_0x0898('0x150')](db[_0x0898('0x40')],{'as':_0x0898('0x40'),'foreignKey':_0x0898('0x162')});db[_0x0898('0x161')][_0x0898('0x150')](db['CloudProvider'],{'as':_0x0898('0x10c'),'foreignKey':_0x0898('0x163'),'onDelete':'restrict'});db[_0x0898('0x3e')]['belongsTo'](db[_0x0898('0x40')],{'as':_0x0898('0x40'),'foreignKey':_0x0898('0x162')});db[_0x0898('0x3e')][_0x0898('0x150')](db[_0x0898('0x10c')],{'as':'CloudProvider','foreignKey':_0x0898('0x163'),'onDelete':_0x0898('0x164')});db[_0x0898('0x40')][_0x0898('0x114')](db['MailServerIn'],{'as':_0x0898('0x165'),'onDelete':_0x0898('0x115')});db[_0x0898('0x40')][_0x0898('0x114')](db['MailServerOut'],{'as':_0x0898('0x166'),'onDelete':_0x0898('0x115')});db[_0x0898('0x40')][_0x0898('0x117')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x0898('0x162'),'onDelete':_0x0898('0x115')});db[_0x0898('0x40')]['hasMany'](db[_0x0898('0x8b')],{'as':_0x0898('0x167'),'foreignKey':_0x0898('0x162')});db[_0x0898('0x40')]['hasMany'](db[_0x0898('0x47')],{'as':_0x0898('0x15c'),'foreignKey':_0x0898('0x162')});db['MailAccount'][_0x0898('0x117')](db['MailInteraction'],{'as':'Interactions'});db[_0x0898('0x40')][_0x0898('0x117')](db['MailApplication'],{'as':_0x0898('0x149')});db[_0x0898('0x40')][_0x0898('0x150')](db[_0x0898('0xf5')],{'as':'List','foreignKey':'ListId'});db[_0x0898('0x40')][_0x0898('0x150')](db[_0x0898('0x99')],{'as':'Template','foreignKey':'TemplateId'});db[_0x0898('0x40')]['belongsTo'](db[_0x0898('0x155')],{'as':_0x0898('0x156'),'foreignKey':_0x0898('0x157')});db[_0x0898('0x40')][_0x0898('0x123')](db[_0x0898('0x12')],{'as':_0x0898('0x168'),'through':_0x0898('0x13f')});db['MailQueue']['belongsToMany'](db[_0x0898('0x12')],{'as':_0x0898('0x168'),'through':_0x0898('0x33')});db['MailQueue'][_0x0898('0x123')](db[_0x0898('0x169')],{'through':_0x0898('0x16a'),'as':'Teams'});db[_0x0898('0x46')][_0x0898('0x117')](db[_0x0898('0x47')],{'as':_0x0898('0x15c'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db['MailInteraction']['belongsTo'](db[_0x0898('0x40')],{'as':_0x0898('0x16b'),'foreignKey':'MailAccountId'});db[_0x0898('0x46')]['belongsTo'](db[_0x0898('0x7b')],{'as':'Contact','foreignKey':_0x0898('0x16c')});db['MailInteraction'][_0x0898('0x150')](db[_0x0898('0x12')],{'as':_0x0898('0x16d'),'foreignKey':'UserId'});db[_0x0898('0x46')][_0x0898('0x123')](db['Tag'],{'through':_0x0898('0x16e'),'as':_0x0898('0x16f')});db[_0x0898('0x46')][_0x0898('0x123')](db['Tag'],{'through':_0x0898('0x16e'),'as':_0x0898('0x170')});db[_0x0898('0x46')][_0x0898('0x123')](db[_0x0898('0x12')],{'as':_0x0898('0x171'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0x0898('0x47')][_0x0898('0x117')](db[_0x0898('0xe9')],{'as':_0x0898('0x172'),'onDelete':_0x0898('0x115')});db['MailMessage'][_0x0898('0x150')](db[_0x0898('0x12')],{'as':'User'});db[_0x0898('0x47')][_0x0898('0x150')](db[_0x0898('0x7b')],{'onDelete':'cascade','as':_0x0898('0x173')});db['MailMessage']['belongsTo'](db[_0x0898('0x46')],{'as':_0x0898('0x174'),'foreignKey':_0x0898('0x175')});db[_0x0898('0x47')]['belongsTo'](db[_0x0898('0x40')],{'as':_0x0898('0x16b'),'foreignKey':_0x0898('0x162')});db[_0x0898('0x47')][_0x0898('0x150')](db[_0x0898('0x68')],{'as':_0x0898('0x68'),'foreignKey':_0x0898('0x176')});db[_0x0898('0x47')]['belongsTo'](db[_0x0898('0x71')],{'as':_0x0898('0x71'),'foreignKey':_0x0898('0x177')});db['MailApplication']['belongsTo'](db['User'],{'onDelete':'restrict'});db[_0x0898('0x49')][_0x0898('0x150')](db[_0x0898('0x42')],{'onDelete':_0x0898('0x164')});db[_0x0898('0x49')][_0x0898('0x150')](db[_0x0898('0x40')],{'onDelete':_0x0898('0x164')});db[_0x0898('0x49')][_0x0898('0x150')](db[_0x0898('0x8f')],{'onDelete':_0x0898('0x164'),'foreignKey':_0x0898('0x154')});db['MailApplication'][_0x0898('0x150')](db['Tag'],{'onDelete':_0x0898('0x164'),'foreignKey':_0x0898('0x178')});db[_0x0898('0x4b')][_0x0898('0x150')](db[_0x0898('0x40')],{});db[_0x0898('0x4b')][_0x0898('0x150')](db[_0x0898('0xf5')],{'as':'List','foreignKey':_0x0898('0x179')});db[_0x0898('0x4b')][_0x0898('0x150')](db[_0x0898('0x7b')],{'as':_0x0898('0x173'),'foreignKey':_0x0898('0x16c')});db[_0x0898('0x4b')][_0x0898('0x150')](db[_0x0898('0x46')],{});db[_0x0898('0x4b')]['belongsTo'](db['MailMessage'],{});db[_0x0898('0x4b')]['belongsTo'](db[_0x0898('0x12')],{});db[_0x0898('0x4b')][_0x0898('0x150')](db[_0x0898('0x42')],{});db[_0x0898('0x17a')][_0x0898('0x117')](db[_0x0898('0x17b')],{'as':_0x0898('0x17c'),'onDelete':_0x0898('0x115')});db[_0x0898('0x4f')][_0x0898('0x117')](db[_0x0898('0x17d')],{'as':_0x0898('0x17e'),'foreignKey':_0x0898('0x17f'),'onDelete':_0x0898('0x115')});db['FaxAccount'][_0x0898('0x117')](db[_0x0898('0x8b')],{'as':_0x0898('0x167'),'foreignKey':_0x0898('0x17f')});db['FaxAccount']['hasMany'](db[_0x0898('0x52')],{'as':_0x0898('0x180')});db[_0x0898('0x4f')]['hasMany'](db['FaxApplication'],{'as':_0x0898('0x149')});db[_0x0898('0x4f')][_0x0898('0x117')](db[_0x0898('0x19')],{'as':_0x0898('0x181'),'onDelete':_0x0898('0x115')});db['FaxAccount'][_0x0898('0x117')](db[_0x0898('0x182')],{'as':'Messages'});db[_0x0898('0x4f')][_0x0898('0x150')](db['Trunk'],{'as':'Trunk'});db[_0x0898('0x4f')][_0x0898('0x150')](db[_0x0898('0xf5')],{'as':_0x0898('0x183'),'foreignKey':_0x0898('0x179')});db['FaxAccount'][_0x0898('0x150')](db[_0x0898('0x155')],{'as':_0x0898('0x156'),'foreignKey':_0x0898('0x157')});db[_0x0898('0x4f')][_0x0898('0x123')](db['User'],{'as':_0x0898('0x168'),'through':'user_has_fax_accounts'});db[_0x0898('0x184')]['belongsTo'](db[_0x0898('0x12')],{'onDelete':_0x0898('0x164')});db['FaxApplication']['belongsTo'](db['FaxQueue'],{'onDelete':_0x0898('0x164')});db[_0x0898('0x184')][_0x0898('0x150')](db[_0x0898('0x4f')],{'onDelete':'restrict'});db[_0x0898('0x184')][_0x0898('0x150')](db[_0x0898('0x97')],{'onDelete':'restrict','foreignKey':_0x0898('0x178')});db[_0x0898('0x52')][_0x0898('0x117')](db[_0x0898('0x182')],{'as':_0x0898('0x15c'),'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x185')});db[_0x0898('0x52')]['belongsTo'](db[_0x0898('0x4f')],{'as':_0x0898('0x16b'),'foreignKey':'FaxAccountId'});db[_0x0898('0x52')][_0x0898('0x150')](db[_0x0898('0x7b')],{'as':_0x0898('0x173'),'foreignKey':'ContactId'});db[_0x0898('0x52')][_0x0898('0x150')](db[_0x0898('0x12')],{'as':'Owner','foreignKey':'UserId'});db['FaxInteraction'][_0x0898('0x123')](db[_0x0898('0x97')],{'through':'fax_interaction_has_tags','as':_0x0898('0x16f')});db[_0x0898('0x52')][_0x0898('0x123')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x0898('0x170')});db[_0x0898('0x52')][_0x0898('0x123')](db[_0x0898('0x12')],{'as':_0x0898('0x171'),'through':_0x0898('0x12e'),'foreignKey':_0x0898('0x185')});db[_0x0898('0x182')][_0x0898('0x150')](db[_0x0898('0x12')],{'onDelete':_0x0898('0x115'),'as':_0x0898('0x12')});db[_0x0898('0x182')][_0x0898('0x150')](db['FaxInteraction'],{'as':_0x0898('0x174'),'foreignKey':_0x0898('0x185')});db[_0x0898('0x182')]['belongsTo'](db['CmContact'],{'onDelete':_0x0898('0x115'),'as':_0x0898('0x173')});db[_0x0898('0x182')][_0x0898('0x150')](db[_0x0898('0xe9')],{'as':_0x0898('0xe9'),'foreignKey':_0x0898('0x186')});db[_0x0898('0x182')]['belongsTo'](db['FaxAccount'],{'as':_0x0898('0x16b'),'foreignKey':_0x0898('0x17f')});db['FaxQueue'][_0x0898('0x123')](db['User'],{'as':'Agents','through':'UserFaxQueue'});db[_0x0898('0x54')][_0x0898('0x123')](db['Team'],{'through':'team_has_fax_queues','as':_0x0898('0x159')});db[_0x0898('0x55')]['belongsTo'](db[_0x0898('0x4f')],{});db[_0x0898('0x55')][_0x0898('0x150')](db['CmList'],{'as':_0x0898('0x183'),'foreignKey':'ListId'});db['FaxQueueReport'][_0x0898('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0898('0x16c')});db['FaxQueueReport']['belongsTo'](db[_0x0898('0x52')],{});db['FaxQueueReport'][_0x0898('0x150')](db['FaxMessage'],{});db[_0x0898('0x55')][_0x0898('0x150')](db[_0x0898('0x12')],{});db[_0x0898('0x55')][_0x0898('0x150')](db[_0x0898('0x54')],{});db[_0x0898('0x57')]['hasMany'](db[_0x0898('0x17d')],{'as':_0x0898('0x17e'),'foreignKey':_0x0898('0x187'),'onDelete':_0x0898('0x115')});db['SmsAccount'][_0x0898('0x117')](db[_0x0898('0x8b')],{'as':'Answers','foreignKey':_0x0898('0x187')});db[_0x0898('0x57')][_0x0898('0x117')](db['SmsMessage'],{'as':'Messages','foreignKey':'SmsAccountId'});db[_0x0898('0x57')][_0x0898('0x117')](db[_0x0898('0x5b')],{'as':_0x0898('0x180')});db['SmsAccount']['hasMany'](db[_0x0898('0x59')],{'as':'Applications'});db['SmsAccount'][_0x0898('0x150')](db[_0x0898('0xf5')],{'as':_0x0898('0x183'),'foreignKey':_0x0898('0x179')});db[_0x0898('0x57')][_0x0898('0x150')](db[_0x0898('0x155')],{'as':_0x0898('0x156'),'foreignKey':_0x0898('0x157')});db[_0x0898('0x57')][_0x0898('0x123')](db[_0x0898('0x12')],{'as':_0x0898('0x168'),'through':_0x0898('0x188')});db[_0x0898('0x59')]['belongsTo'](db[_0x0898('0x12')],{'onDelete':_0x0898('0x164')});db[_0x0898('0x59')][_0x0898('0x150')](db[_0x0898('0x5f')],{'onDelete':'restrict'});db[_0x0898('0x59')][_0x0898('0x150')](db['SmsAccount'],{'onDelete':_0x0898('0x164')});db[_0x0898('0x59')][_0x0898('0x150')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x0898('0x154')});db[_0x0898('0x59')][_0x0898('0x150')](db[_0x0898('0x97')],{'onDelete':_0x0898('0x164'),'foreignKey':_0x0898('0x178')});db[_0x0898('0x5b')]['hasMany'](db[_0x0898('0x5d')],{'as':_0x0898('0x15c'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x0898('0x5b')][_0x0898('0x150')](db[_0x0898('0x57')],{'as':'Account','foreignKey':_0x0898('0x187')});db[_0x0898('0x5b')]['belongsTo'](db[_0x0898('0x7b')],{'as':_0x0898('0x173'),'foreignKey':_0x0898('0x16c')});db[_0x0898('0x5b')][_0x0898('0x150')](db[_0x0898('0x12')],{'as':_0x0898('0x16d'),'foreignKey':'UserId'});db[_0x0898('0x5b')]['belongsToMany'](db[_0x0898('0x97')],{'through':_0x0898('0x189'),'as':_0x0898('0x16f')});db[_0x0898('0x5b')]['belongsToMany'](db[_0x0898('0x97')],{'through':_0x0898('0x189'),'as':_0x0898('0x170')});db[_0x0898('0x5b')][_0x0898('0x123')](db['User'],{'as':_0x0898('0x171'),'through':_0x0898('0x12f'),'foreignKey':_0x0898('0x18a')});db[_0x0898('0x5d')]['belongsTo'](db[_0x0898('0x12')],{'as':_0x0898('0x12')});db[_0x0898('0x5d')][_0x0898('0x150')](db[_0x0898('0x7b')],{'onDelete':_0x0898('0x115'),'as':_0x0898('0x173')});db[_0x0898('0x5d')][_0x0898('0x150')](db[_0x0898('0x5b')],{'onDelete':_0x0898('0x115'),'as':'Interaction','foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x0898('0x150')](db[_0x0898('0x57')],{'as':_0x0898('0x16b'),'foreignKey':'SmsAccountId'});db[_0x0898('0x5f')][_0x0898('0x123')](db['User'],{'as':_0x0898('0x168'),'through':'UserSmsQueue','foreignKey':_0x0898('0x18b')});db[_0x0898('0x5f')][_0x0898('0x123')](db['Team'],{'through':'team_has_sms_queues','as':'Teams'});db['OpenchannelAccount']['hasMany'](db[_0x0898('0x17d')],{'as':_0x0898('0x17e'),'foreignKey':_0x0898('0x18c'),'onDelete':_0x0898('0x115')});db[_0x0898('0x61')][_0x0898('0x117')](db[_0x0898('0x8b')],{'as':_0x0898('0x167'),'foreignKey':_0x0898('0x18c')});db[_0x0898('0x61')]['hasMany'](db[_0x0898('0x11c')],{'as':'Interactions','foreignKey':_0x0898('0x18c')});db[_0x0898('0x61')][_0x0898('0x117')](db['OpenchannelMessage'],{'as':_0x0898('0x15c'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0898('0x117')](db[_0x0898('0x18d')],{'as':'Applications','foreignKey':_0x0898('0x18c')});db[_0x0898('0x61')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x0898('0x179')});db[_0x0898('0x61')][_0x0898('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0898('0x157')});db[_0x0898('0x61')][_0x0898('0x123')](db[_0x0898('0x12')],{'as':_0x0898('0x168'),'through':_0x0898('0x141')});db[_0x0898('0x18d')][_0x0898('0x150')](db[_0x0898('0x12')],{'onDelete':'restrict'});db[_0x0898('0x18d')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x0898('0x164'),'foreignKey':_0x0898('0x18e')});db[_0x0898('0x18d')][_0x0898('0x150')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x0898('0x18c')});db[_0x0898('0x18d')][_0x0898('0x150')](db[_0x0898('0x8f')],{'onDelete':_0x0898('0x164'),'foreignKey':_0x0898('0x154')});db[_0x0898('0x18d')][_0x0898('0x150')](db['Tag'],{'onDelete':_0x0898('0x164'),'foreignKey':_0x0898('0x178')});db[_0x0898('0x11c')][_0x0898('0x117')](db[_0x0898('0x64')],{'as':'Messages','onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x18f')});db[_0x0898('0x11c')]['belongsTo'](db[_0x0898('0x61')],{'as':_0x0898('0x16b'),'foreignKey':_0x0898('0x18c')});db[_0x0898('0x11c')]['belongsTo'](db[_0x0898('0x7b')],{'as':_0x0898('0x173'),'foreignKey':'ContactId'});db[_0x0898('0x11c')][_0x0898('0x150')](db[_0x0898('0x12')],{'as':'Owner','foreignKey':_0x0898('0x116')});db[_0x0898('0x11c')][_0x0898('0x123')](db['Tag'],{'through':_0x0898('0x190'),'as':_0x0898('0x16f')});db[_0x0898('0x11c')][_0x0898('0x123')](db['Tag'],{'through':_0x0898('0x190'),'as':_0x0898('0x170')});db['OpenchannelInteraction'][_0x0898('0x123')](db['User'],{'as':'Users','through':_0x0898('0x130'),'foreignKey':'OpenchannelInteractionId'});db[_0x0898('0x64')][_0x0898('0x150')](db[_0x0898('0x12')],{'onDelete':'cascade','as':_0x0898('0x12')});db[_0x0898('0x64')][_0x0898('0x150')](db[_0x0898('0x7b')],{'onDelete':_0x0898('0x115'),'as':_0x0898('0x173')});db['OpenchannelMessage']['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0x0898('0x115'),'as':_0x0898('0x174'),'foreignKey':_0x0898('0x18f')});db[_0x0898('0x64')][_0x0898('0x150')](db[_0x0898('0xe9')],{'as':_0x0898('0xe9'),'foreignKey':_0x0898('0x186')});db[_0x0898('0x64')][_0x0898('0x150')](db[_0x0898('0x61')],{'as':_0x0898('0x16b'),'foreignKey':_0x0898('0x18c')});db['OpenchannelQueue'][_0x0898('0x123')](db[_0x0898('0x12')],{'as':_0x0898('0x168'),'through':_0x0898('0x39'),'foreignKey':'OpenchannelQueueId'});db[_0x0898('0x66')][_0x0898('0x123')](db[_0x0898('0x169')],{'through':'team_has_openchannel_queues','as':_0x0898('0x159')});db['ChatWebsite'][_0x0898('0x117')](db[_0x0898('0x17d')],{'as':'Dispositions','foreignKey':_0x0898('0x176'),'onDelete':'cascade'});db[_0x0898('0x68')][_0x0898('0x117')](db[_0x0898('0x8b')],{'as':'Answers','foreignKey':_0x0898('0x176')});db[_0x0898('0x68')][_0x0898('0x117')](db[_0x0898('0x77')],{'as':'ProactiveActions'});db[_0x0898('0x68')][_0x0898('0x117')](db[_0x0898('0x6d')],{'as':_0x0898('0x180')});db[_0x0898('0x68')][_0x0898('0x117')](db[_0x0898('0x191')],{'as':_0x0898('0x149')});db['ChatWebsite'][_0x0898('0x117')](db['ChatMessage'],{'as':_0x0898('0x15c')});db[_0x0898('0x68')][_0x0898('0x150')](db['CmList'],{'as':_0x0898('0x183'),'foreignKey':'ListId'});db[_0x0898('0x68')]['belongsTo'](db[_0x0898('0x8f')],{'as':_0x0898('0x8f'),'foreignKey':_0x0898('0x154')});db[_0x0898('0x68')][_0x0898('0x150')](db[_0x0898('0x40')],{'as':_0x0898('0x40'),'foreignKey':_0x0898('0x162')});db['ChatWebsite'][_0x0898('0x150')](db[_0x0898('0x155')],{'as':'mandatoryDispositionPause','foreignKey':_0x0898('0x157')});db[_0x0898('0x68')]['belongsToMany'](db[_0x0898('0x12')],{'as':_0x0898('0x168'),'through':'user_has_chat_websites'});db[_0x0898('0x6a')]['belongsTo'](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0x0898('0x150')](db[_0x0898('0xf5')],{'as':_0x0898('0x183'),'foreignKey':'ListId'});db[_0x0898('0x6a')][_0x0898('0x150')](db[_0x0898('0x7b')],{'as':_0x0898('0x173'),'foreignKey':_0x0898('0x16c')});db['OpenchannelQueueReport'][_0x0898('0x150')](db[_0x0898('0x11c')],{});db[_0x0898('0x6a')][_0x0898('0x150')](db[_0x0898('0x64')],{});db[_0x0898('0x6a')][_0x0898('0x150')](db[_0x0898('0x12')],{});db['OpenchannelQueueReport'][_0x0898('0x150')](db['OpenchannelQueue'],{});db['ChatApplication'][_0x0898('0x150')](db[_0x0898('0x12')],{'as':'Agent','foreignKey':'UserId','onDelete':_0x0898('0x164')});db[_0x0898('0x191')][_0x0898('0x150')](db[_0x0898('0x73')],{'as':_0x0898('0x192'),'foreignKey':_0x0898('0x193'),'onDelete':_0x0898('0x164')});db['ChatApplication']['belongsTo'](db[_0x0898('0x68')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0x0898('0x164')});db[_0x0898('0x191')]['belongsTo'](db[_0x0898('0x97')],{'onDelete':_0x0898('0x164'),'foreignKey':_0x0898('0x178')});db[_0x0898('0x6d')][_0x0898('0x117')](db['ChatMessage'],{'as':'Messages','onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x194')});db[_0x0898('0x6d')][_0x0898('0x150')](db[_0x0898('0x68')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0898('0x6d')]['belongsTo'](db['CmContact'],{'as':_0x0898('0x173'),'foreignKey':_0x0898('0x16c')});db[_0x0898('0x6d')][_0x0898('0x150')](db[_0x0898('0x12')],{'as':_0x0898('0x16d'),'foreignKey':_0x0898('0x116')});db[_0x0898('0x6d')]['belongsToMany'](db[_0x0898('0x97')],{'through':_0x0898('0x195'),'as':_0x0898('0x16f')});db['ChatInteraction'][_0x0898('0x123')](db[_0x0898('0x97')],{'through':_0x0898('0x195'),'as':_0x0898('0x170')});db[_0x0898('0x6d')]['belongsToMany'](db[_0x0898('0x12')],{'as':_0x0898('0x171'),'through':_0x0898('0x196'),'foreignKey':_0x0898('0x194')});db[_0x0898('0x6f')]['belongsTo'](db[_0x0898('0x12')],{'onDelete':_0x0898('0x115'),'as':_0x0898('0x12')});db['ChatMessage'][_0x0898('0x150')](db[_0x0898('0x7b')],{'onDelete':_0x0898('0x115'),'as':_0x0898('0x173'),'foreignKey':_0x0898('0x16c')});db[_0x0898('0x6f')][_0x0898('0x150')](db[_0x0898('0x6d')],{'onDelete':'cascade','as':_0x0898('0x174'),'foreignKey':_0x0898('0x194')});db[_0x0898('0x6f')][_0x0898('0x150')](db[_0x0898('0xe9')],{'as':_0x0898('0xe9'),'foreignKey':_0x0898('0x186')});db[_0x0898('0x6f')][_0x0898('0x150')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0x0898('0x117')](db['Attachment'],{'as':_0x0898('0x172'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x0898('0x115'),'hooks':!![]});db[_0x0898('0x71')]['belongsTo'](db[_0x0898('0x7b')],{'onDelete':_0x0898('0x115'),'as':_0x0898('0x173'),'foreignKey':_0x0898('0x16c')});db[_0x0898('0x71')][_0x0898('0x150')](db['ChatWebsite'],{'as':_0x0898('0x16b'),'foreignKey':_0x0898('0x176')});db[_0x0898('0x73')][_0x0898('0x123')](db[_0x0898('0x12')],{'as':'Agents','through':_0x0898('0x137'),'hooks':!![]});db['ChatQueue'][_0x0898('0x123')](db[_0x0898('0x169')],{'through':'team_has_chat_queues','as':_0x0898('0x159')});db[_0x0898('0x75')]['hasMany'](db[_0x0898('0x197')],{'as':_0x0898('0x15c'),'foreignKey':_0x0898('0x198'),'onDelete':_0x0898('0x115')});db['ChatGroup']['belongsToMany'](db[_0x0898('0x12')],{'as':_0x0898('0x14c'),'through':_0x0898('0x125')});db[_0x0898('0x77')]['belongsTo'](db['ChatWebsite'],{'as':_0x0898('0x199'),'foreignKey':'ChatWebsiteId'});db[_0x0898('0x79')][_0x0898('0x117')](db[_0x0898('0x7b')],{'as':_0x0898('0x126'),'foreignKey':_0x0898('0x19a')});db[_0x0898('0x7b')][_0x0898('0x117')](db[_0x0898('0x7d')],{'as':_0x0898('0x19b'),'foreignKey':_0x0898('0x16c')});db[_0x0898('0x7b')][_0x0898('0x117')](db[_0x0898('0x81')],{'as':_0x0898('0x11a'),'foreignKey':_0x0898('0x16c')});db[_0x0898('0x7b')]['hasMany'](db[_0x0898('0x83')],{'as':_0x0898('0x14e'),'foreignKey':_0x0898('0x16c')});db[_0x0898('0x7b')][_0x0898('0x117')](db[_0x0898('0x85')],{'as':_0x0898('0x85'),'foreignKey':_0x0898('0x16c')});db[_0x0898('0x7b')][_0x0898('0x117')](db[_0x0898('0xd8')],{'as':_0x0898('0x19c'),'foreignKey':_0x0898('0x16c')});db[_0x0898('0x7b')][_0x0898('0x117')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0x0898('0x16c'),'onDelete':_0x0898('0x164')});db[_0x0898('0x7b')][_0x0898('0x117')](db[_0x0898('0x6d')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0x0898('0x117')](db[_0x0898('0x5b')],{'as':'SmsInteractions','foreignKey':_0x0898('0x16c'),'onDelete':_0x0898('0x164')});db[_0x0898('0x7b')][_0x0898('0x117')](db[_0x0898('0x52')],{'as':_0x0898('0x11f'),'foreignKey':_0x0898('0x16c'),'onDelete':_0x0898('0x164')});db[_0x0898('0x7b')][_0x0898('0x117')](db[_0x0898('0x46')],{'as':_0x0898('0x12b'),'foreignKey':_0x0898('0x16c'),'onDelete':_0x0898('0x164')});db[_0x0898('0x7b')][_0x0898('0x150')](db[_0x0898('0x79')],{'as':'Company','foreignKey':_0x0898('0x19a')});db['CmContact']['belongsTo'](db[_0x0898('0xf5')],{'as':_0x0898('0x183'),'foreignKey':_0x0898('0x179'),'onDelete':'cascade'});db[_0x0898('0x7b')][_0x0898('0x123')](db[_0x0898('0x12')],{'as':_0x0898('0x171'),'through':_0x0898('0x127')});db['CmContact']['belongsToMany'](db[_0x0898('0x97')],{'as':'Tags','through':_0x0898('0x19d')});db[_0x0898('0x7b')]['belongsToMany'](db['Tag'],{'through':'cm_contact_has_tags','as':_0x0898('0x170')});db['CmHopper'][_0x0898('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0898('0x16c'),'onDelete':_0x0898('0x115')});db[_0x0898('0x7d')][_0x0898('0x150')](db[_0x0898('0xf5')],{'as':_0x0898('0x183'),'foreignKey':_0x0898('0x179'),'onDelete':'cascade'});db[_0x0898('0x7d')][_0x0898('0x150')](db['User'],{'as':_0x0898('0x19e'),'foreignKey':_0x0898('0x116')});db['CmHopper'][_0x0898('0x150')](db[_0x0898('0x1d')],{'as':_0x0898('0x192'),'foreignKey':'VoiceQueueId','onDelete':_0x0898('0x115')});db['CmHopper'][_0x0898('0x150')](db['Campaign'],{'as':_0x0898('0x19f'),'foreignKey':_0x0898('0x1a0'),'onDelete':'cascade'});db[_0x0898('0x7d')][_0x0898('0x150')](db[_0x0898('0x12')],{'as':'Owner','foreignKey':'OwnerId'});db[_0x0898('0x7f')][_0x0898('0x150')](db['CmContact'],{'as':_0x0898('0x173'),'foreignKey':_0x0898('0x16c'),'onDelete':_0x0898('0x115')});db['CmHopperBlack'][_0x0898('0x150')](db[_0x0898('0xf5')],{'as':_0x0898('0x183'),'foreignKey':_0x0898('0x179'),'onDelete':_0x0898('0x115')});db[_0x0898('0x7f')][_0x0898('0x150')](db[_0x0898('0x1d')],{'as':_0x0898('0x192'),'foreignKey':'VoiceQueueId','onDelete':_0x0898('0x115')});db[_0x0898('0x7f')]['belongsTo'](db[_0x0898('0x19f')],{'as':_0x0898('0x19f'),'foreignKey':_0x0898('0x1a0'),'onDelete':_0x0898('0x115')});db[_0x0898('0x89')][_0x0898('0x117')](db[_0x0898('0x8d')],{'as':{'plural':'All','singular':_0x0898('0x1a1')},'foreignKey':_0x0898('0x1a2'),'onDelete':_0x0898('0x115'),'hooks':!![]});db[_0x0898('0x89')][_0x0898('0x117')](db[_0x0898('0x8d')],{'as':{'plural':_0x0898('0x1a3'),'singular':_0x0898('0x1a4')},'foreignKey':_0x0898('0x1a5'),'onDelete':_0x0898('0x115'),'hooks':!![]});db[_0x0898('0x89')][_0x0898('0x117')](db[_0x0898('0x87')],{'as':_0x0898('0x1a6'),'foreignKey':_0x0898('0x1a7'),'onDelete':_0x0898('0x115'),'hooks':!![]});db['Disposition'][_0x0898('0x117')](db[_0x0898('0x17d')],{'as':_0x0898('0x17e'),'foreignKey':_0x0898('0x1a8'),'onDelete':_0x0898('0x115')});db[_0x0898('0x8f')][_0x0898('0x117')](db[_0x0898('0x8f')],{'as':_0x0898('0x1a9'),'foreignKey':_0x0898('0x154'),'onDelete':_0x0898('0x115'),'hooks':!![],'required':![]});db[_0x0898('0x8f')][_0x0898('0x117')](db['VoiceExtension'],{'as':_0x0898('0x119'),'foreignKey':'IntervalId','onDelete':'restrict'});db['Interval'][_0x0898('0x117')](db[_0x0898('0x49')],{'as':_0x0898('0x1aa'),'foreignKey':'IntervalId'});db['Interval']['hasMany'](db[_0x0898('0x191')],{'as':_0x0898('0x1ab'),'foreignKey':_0x0898('0x154')});db[_0x0898('0x8f')][_0x0898('0x117')](db[_0x0898('0x184')],{'as':_0x0898('0x1ac'),'foreignKey':_0x0898('0x154')});db[_0x0898('0x8f')][_0x0898('0x117')](db[_0x0898('0x59')],{'as':_0x0898('0x1ad'),'foreignKey':_0x0898('0x154')});db['Schedule']['belongsTo'](db['MailAccount'],{});db['Schedule']['belongsTo'](db[_0x0898('0xa3')],{'foreignKey':_0x0898('0x1ae')});db[_0x0898('0x1af')][_0x0898('0x150')](db[_0x0898('0x1b0')],{'foreignKey':_0x0898('0x1b1')});db[_0x0898('0x95')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x0898('0x1b2'),'through':_0x0898('0x14b'),'onDelete':_0x0898('0x164')});db[_0x0898('0x97')][_0x0898('0x123')](db[_0x0898('0x7b')],{'through':_0x0898('0x19d')});db[_0x0898('0x97')][_0x0898('0x123')](db['ChatInteraction'],{'through':_0x0898('0x195')});db[_0x0898('0x97')][_0x0898('0x123')](db[_0x0898('0x46')],{'through':_0x0898('0x16e')});db[_0x0898('0x97')][_0x0898('0x123')](db[_0x0898('0x5b')],{'through':_0x0898('0x189')});db['Tag']['belongsToMany'](db[_0x0898('0x52')],{'through':_0x0898('0x1b3')});db[_0x0898('0x97')]['belongsToMany'](db[_0x0898('0x11c')],{'through':_0x0898('0x190')});db[_0x0898('0x97')][_0x0898('0x123')](db[_0x0898('0x103')],{'through':_0x0898('0x1b4')});db['Trigger'][_0x0898('0x117')](db[_0x0898('0x8d')],{'as':{'plural':_0x0898('0x1b5'),'singular':_0x0898('0x1b6')},'foreignKey':_0x0898('0x1b7'),'onDelete':_0x0898('0x115'),'hooks':!![]});db[_0x0898('0x9b')][_0x0898('0x117')](db[_0x0898('0x8d')],{'as':{'plural':_0x0898('0x1b8'),'singular':_0x0898('0x1b9')},'foreignKey':_0x0898('0x1ba'),'onDelete':_0x0898('0x115'),'hooks':!![]});db[_0x0898('0x9b')][_0x0898('0x117')](db['Action'],{'as':_0x0898('0x1a6'),'foreignKey':'TriggerId','onDelete':_0x0898('0x115'),'hooks':!![]});db[_0x0898('0x1b0')][_0x0898('0x117')](db['AnalyticFieldReport'],{'as':_0x0898('0x1bb'),'onDelete':'cascade','foreignKey':_0x0898('0x1b1'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0x0898('0xa7')],{'as':_0x0898('0x1bb'),'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1ae')});db[_0x0898('0xa5')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x0898('0x1bb'),'onDelete':_0x0898('0x115'),'foreignKey':'MetricId'});db[_0x0898('0xa7')][_0x0898('0x150')](db[_0x0898('0xa5')],{'foreignKey':_0x0898('0x1bc')});db[_0x0898('0xaa')][_0x0898('0x117')](db[_0x0898('0xac')],{'as':'Configurations','onDelete':_0x0898('0x115'),'foreignKey':'AccountId'});db[_0x0898('0xac')][_0x0898('0x117')](db[_0x0898('0xad')],{'as':_0x0898('0x1bd'),'onDelete':_0x0898('0x115'),'foreignKey':'SubjectId'});db[_0x0898('0xac')][_0x0898('0x117')](db[_0x0898('0xad')],{'as':_0x0898('0x1be'),'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1bf')});db['SalesforceConfiguration'][_0x0898('0x117')](db[_0x0898('0xad')],{'as':_0x0898('0x1bb'),'onDelete':_0x0898('0x115'),'foreignKey':'FieldId'});db[_0x0898('0xac')][_0x0898('0x150')](db[_0x0898('0xaa')],{'as':'Account','foreignKey':_0x0898('0x1c0')});db['SalesforceField']['hasMany'](db[_0x0898('0xad')],{'as':'Subject','foreignKey':_0x0898('0x1c1')});db['SalesforceField'][_0x0898('0x117')](db[_0x0898('0xad')],{'as':_0x0898('0x1c2'),'foreignKey':'DescriptionId'});db[_0x0898('0xad')][_0x0898('0x117')](db['SalesforceField'],{'as':_0x0898('0x1c3'),'foreignKey':_0x0898('0x1c4')});db[_0x0898('0xad')][_0x0898('0x150')](db[_0x0898('0x1c5')],{'as':'Variable','foreignKey':_0x0898('0x1c6')});db[_0x0898('0x1c7')][_0x0898('0x117')](db[_0x0898('0xb0')],{'as':'Configurations','onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1c0')});db['SugarcrmConfiguration'][_0x0898('0x117')](db[_0x0898('0xb2')],{'as':_0x0898('0x1bd'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0898('0xb0')]['hasMany'](db[_0x0898('0xb2')],{'as':'Descriptions','onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1bf')});db[_0x0898('0xb0')][_0x0898('0x117')](db[_0x0898('0xb2')],{'as':_0x0898('0x1bb'),'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1c4')});db[_0x0898('0xb0')][_0x0898('0x150')](db[_0x0898('0x1c7')],{'as':'Account','foreignKey':_0x0898('0x1c0')});db[_0x0898('0xb2')][_0x0898('0x117')](db['SugarcrmField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0898('0xb2')][_0x0898('0x117')](db[_0x0898('0xb2')],{'as':'Description','foreignKey':_0x0898('0x1bf')});db[_0x0898('0xb2')][_0x0898('0x117')](db[_0x0898('0xb2')],{'as':_0x0898('0x1c3'),'foreignKey':_0x0898('0x1c4')});db[_0x0898('0xb2')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x0898('0x1c6')});db[_0x0898('0xb3')][_0x0898('0x117')](db['DeskConfiguration'],{'as':_0x0898('0x1c8'),'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1c0')});db[_0x0898('0x1c9')][_0x0898('0x117')](db[_0x0898('0xb5')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x0898('0x1c1')});db[_0x0898('0x1c9')][_0x0898('0x117')](db[_0x0898('0xb5')],{'as':'Descriptions','onDelete':_0x0898('0x115'),'foreignKey':'DescriptionId'});db[_0x0898('0x1c9')][_0x0898('0x117')](db[_0x0898('0xb5')],{'as':'Fields','onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1c4')});db['DeskConfiguration'][_0x0898('0x150')](db[_0x0898('0xb3')],{'as':_0x0898('0x16b'),'foreignKey':_0x0898('0x1c0')});db['DeskConfiguration'][_0x0898('0x123')](db[_0x0898('0x97')],{'through':_0x0898('0x1ca')});db[_0x0898('0xb5')][_0x0898('0x117')](db[_0x0898('0xb5')],{'as':_0x0898('0x1cb'),'foreignKey':_0x0898('0x1c1')});db[_0x0898('0xb5')][_0x0898('0x117')](db[_0x0898('0xb5')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0898('0xb5')][_0x0898('0x117')](db[_0x0898('0xb5')],{'as':_0x0898('0x1c3'),'foreignKey':_0x0898('0x1c4')});db[_0x0898('0xb5')][_0x0898('0x150')](db[_0x0898('0x1c5')],{'as':_0x0898('0x1c5'),'foreignKey':_0x0898('0x1c6')});db[_0x0898('0xb7')][_0x0898('0x117')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1c0')});db[_0x0898('0x1cc')][_0x0898('0x117')](db[_0x0898('0xb9')],{'as':_0x0898('0x1bd'),'onDelete':'cascade','foreignKey':_0x0898('0x1c1')});db[_0x0898('0x1cc')]['hasMany'](db[_0x0898('0xb9')],{'as':_0x0898('0x1be'),'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1bf')});db[_0x0898('0x1cc')][_0x0898('0x117')](db[_0x0898('0xb9')],{'as':'Fields','onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1c4')});db[_0x0898('0x1cc')][_0x0898('0x150')](db[_0x0898('0xb7')],{'as':_0x0898('0x16b'),'foreignKey':_0x0898('0x1c0')});db['ZohoField']['hasMany'](db[_0x0898('0xb9')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0898('0xb9')]['hasMany'](db[_0x0898('0xb9')],{'as':_0x0898('0x1c2'),'foreignKey':_0x0898('0x1bf')});db['ZohoField']['hasMany'](db[_0x0898('0xb9')],{'as':_0x0898('0x1c3'),'foreignKey':'FieldId'});db[_0x0898('0xb9')][_0x0898('0x150')](db[_0x0898('0x1c5')],{'as':'Variable','foreignKey':_0x0898('0x1c6')});db['ZendeskAccount'][_0x0898('0x117')](db[_0x0898('0x1cd')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x0898('0x1c0')});db[_0x0898('0x1cd')][_0x0898('0x117')](db[_0x0898('0x1ce')],{'as':'Subjects','foreignKey':_0x0898('0x1c1')});db[_0x0898('0x1cd')][_0x0898('0x117')](db[_0x0898('0x1ce')],{'as':_0x0898('0x1be'),'foreignKey':'DescriptionId'});db[_0x0898('0x1cd')]['hasMany'](db[_0x0898('0x1ce')],{'as':_0x0898('0x1bb'),'foreignKey':'FieldId'});db[_0x0898('0x1cd')]['belongsTo'](db[_0x0898('0xbb')],{'as':'Account','foreignKey':_0x0898('0x1c0')});db[_0x0898('0x1cd')]['belongsToMany'](db[_0x0898('0x97')],{'through':_0x0898('0x1cf')});db[_0x0898('0x1ce')][_0x0898('0x117')](db[_0x0898('0x1ce')],{'as':_0x0898('0x1cb'),'foreignKey':_0x0898('0x1c1')});db['ZendeskField'][_0x0898('0x117')](db[_0x0898('0x1ce')],{'as':_0x0898('0x1c2'),'foreignKey':'DescriptionId'});db['ZendeskField']['hasMany'](db[_0x0898('0x1ce')],{'as':_0x0898('0x1c3'),'foreignKey':_0x0898('0x1c4')});db[_0x0898('0x1ce')][_0x0898('0x150')](db[_0x0898('0x1c5')],{'as':_0x0898('0x1c5'),'foreignKey':_0x0898('0x1c6')});db[_0x0898('0x1d0')][_0x0898('0x117')](db[_0x0898('0xbf')],{'as':_0x0898('0x1c8'),'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1c0')});db[_0x0898('0xbf')]['hasMany'](db[_0x0898('0xc1')],{'as':'Subjects','onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1c1')});db[_0x0898('0xbf')][_0x0898('0x117')](db[_0x0898('0xc1')],{'as':'Descriptions','onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1bf')});db[_0x0898('0xbf')][_0x0898('0x117')](db['FreshdeskField'],{'as':_0x0898('0x1bb'),'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1c4')});db['FreshdeskConfiguration'][_0x0898('0x150')](db['FreshdeskAccount'],{'as':_0x0898('0x16b'),'foreignKey':_0x0898('0x1c0')});db[_0x0898('0xbf')]['belongsToMany'](db['Tag'],{'through':_0x0898('0x1d1')});db['FreshdeskField'][_0x0898('0x117')](db[_0x0898('0xc1')],{'as':_0x0898('0x1cb'),'foreignKey':_0x0898('0x1c1')});db['FreshdeskField'][_0x0898('0x117')](db[_0x0898('0xc1')],{'as':'Description','foreignKey':_0x0898('0x1bf')});db[_0x0898('0xc1')]['hasMany'](db[_0x0898('0xc1')],{'as':_0x0898('0x1c3'),'foreignKey':_0x0898('0x1c4')});db[_0x0898('0xc1')]['belongsTo'](db['Variable'],{'as':_0x0898('0x1c5'),'foreignKey':_0x0898('0x1c6')});db[_0x0898('0x1d2')][_0x0898('0x117')](db[_0x0898('0xc4')],{'as':'Configurations','onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1c0')});db[_0x0898('0xc4')]['hasMany'](db[_0x0898('0xc6')],{'as':_0x0898('0x1bd'),'foreignKey':_0x0898('0x1c1')});db[_0x0898('0xc4')]['hasMany'](db[_0x0898('0xc6')],{'as':_0x0898('0x1be'),'foreignKey':_0x0898('0x1bf')});db['VtigerConfiguration'][_0x0898('0x117')](db[_0x0898('0xc6')],{'as':'Fields','foreignKey':_0x0898('0x1c4')});db[_0x0898('0xc4')][_0x0898('0x150')](db[_0x0898('0x1d2')],{'as':'Account','foreignKey':_0x0898('0x1c0')});db[_0x0898('0xc6')][_0x0898('0x117')](db[_0x0898('0xc6')],{'as':_0x0898('0x1cb'),'foreignKey':_0x0898('0x1c1')});db['VtigerField'][_0x0898('0x117')](db[_0x0898('0xc6')],{'as':_0x0898('0x1c2'),'foreignKey':_0x0898('0x1bf')});db[_0x0898('0xc6')]['hasMany'](db['VtigerField'],{'as':_0x0898('0x1c3'),'foreignKey':_0x0898('0x1c4')});db['VtigerField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x0898('0x1c6')});db['ServicenowAccount'][_0x0898('0x117')](db[_0x0898('0x1d3')],{'as':_0x0898('0x1c8'),'onDelete':_0x0898('0x115'),'foreignKey':'AccountId'});db[_0x0898('0x1d3')]['hasMany'](db[_0x0898('0x1d4')],{'as':_0x0898('0x1bd'),'foreignKey':_0x0898('0x1c1')});db[_0x0898('0x1d3')][_0x0898('0x117')](db[_0x0898('0x1d4')],{'as':_0x0898('0x1be'),'foreignKey':_0x0898('0x1bf')});db[_0x0898('0x1d3')][_0x0898('0x117')](db[_0x0898('0x1d4')],{'as':_0x0898('0x1bb'),'foreignKey':_0x0898('0x1c4')});db['ServicenowConfiguration'][_0x0898('0x150')](db[_0x0898('0xc8')],{'as':_0x0898('0x16b'),'foreignKey':_0x0898('0x1c0')});db[_0x0898('0x1d4')][_0x0898('0x117')](db['ServicenowField'],{'as':'Subject','foreignKey':_0x0898('0x1c1')});db['ServicenowField'][_0x0898('0x117')](db[_0x0898('0x1d4')],{'as':_0x0898('0x1c2'),'foreignKey':_0x0898('0x1bf')});db[_0x0898('0x1d4')][_0x0898('0x117')](db['ServicenowField'],{'as':_0x0898('0x1c3'),'foreignKey':'FieldId'});db['ServicenowField']['belongsTo'](db['Variable'],{'as':_0x0898('0x1c5'),'foreignKey':_0x0898('0x1c6')});db[_0x0898('0xcc')][_0x0898('0x117')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1c0')});db[_0x0898('0xcc')][_0x0898('0x150')](db[_0x0898('0x10c')],{'as':_0x0898('0x10c'),'foreignKey':_0x0898('0x163')});db[_0x0898('0x1d5')][_0x0898('0x117')](db[_0x0898('0xce')],{'as':'Subjects','onDelete':_0x0898('0x115'),'foreignKey':'SubjectId'});db[_0x0898('0x1d5')][_0x0898('0x117')](db[_0x0898('0xce')],{'as':_0x0898('0x1be'),'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1bf')});db[_0x0898('0x1d5')][_0x0898('0x117')](db[_0x0898('0xce')],{'as':_0x0898('0x1bb'),'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1c4')});db[_0x0898('0x1d5')][_0x0898('0x150')](db[_0x0898('0xcc')],{'as':_0x0898('0x16b'),'foreignKey':_0x0898('0x1c0')});db[_0x0898('0xce')][_0x0898('0x117')](db[_0x0898('0xce')],{'as':_0x0898('0x1cb'),'foreignKey':_0x0898('0x1c1')});db['Dynamics365Field']['hasMany'](db[_0x0898('0xce')],{'as':_0x0898('0x1c2'),'foreignKey':_0x0898('0x1bf')});db['Dynamics365Field'][_0x0898('0x117')](db['Dynamics365Field'],{'as':_0x0898('0x1c3'),'foreignKey':_0x0898('0x1c4')});db[_0x0898('0xce')]['belongsTo'](db[_0x0898('0x1c5')],{'as':_0x0898('0x1c5'),'foreignKey':_0x0898('0x1c6')});db['FreshsalesAccount'][_0x0898('0x117')](db[_0x0898('0xd1')],{'as':_0x0898('0x1c8'),'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1c0')});db[_0x0898('0xd1')][_0x0898('0x117')](db['FreshsalesField'],{'as':_0x0898('0x1bd'),'foreignKey':_0x0898('0x1c1')});db[_0x0898('0xd1')][_0x0898('0x117')](db[_0x0898('0x1d6')],{'as':'Descriptions','foreignKey':_0x0898('0x1bf')});db[_0x0898('0xd1')]['hasMany'](db[_0x0898('0x1d6')],{'as':_0x0898('0x1bb'),'foreignKey':_0x0898('0x1c4')});db[_0x0898('0xd1')][_0x0898('0x150')](db[_0x0898('0xd0')],{'as':_0x0898('0x16b'),'foreignKey':_0x0898('0x1c0')});db['FreshsalesField']['hasMany'](db[_0x0898('0x1d6')],{'as':'Subject','foreignKey':_0x0898('0x1c1')});db[_0x0898('0x1d6')]['hasMany'](db['FreshsalesField'],{'as':'Description','foreignKey':_0x0898('0x1bf')});db[_0x0898('0x1d6')][_0x0898('0x117')](db[_0x0898('0x1d6')],{'as':_0x0898('0x1c3'),'foreignKey':_0x0898('0x1c4')});db[_0x0898('0x1d6')]['belongsTo'](db[_0x0898('0x1c5')],{'as':_0x0898('0x1c5'),'foreignKey':_0x0898('0x1c6')});db[_0x0898('0xd3')][_0x0898('0x150')](db[_0x0898('0x68')],{});db[_0x0898('0xd3')][_0x0898('0x150')](db['CmList'],{'as':_0x0898('0x183'),'foreignKey':'ListId'});db['ChatQueueReport']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x0898('0x16c')});db[_0x0898('0xd3')][_0x0898('0x150')](db[_0x0898('0x6d')],{});db[_0x0898('0xd3')][_0x0898('0x150')](db['ChatMessage'],{});db[_0x0898('0xd3')][_0x0898('0x150')](db[_0x0898('0x12')],{});db['ChatQueueReport'][_0x0898('0x150')](db['ChatQueue'],{});db[_0x0898('0x197')][_0x0898('0x150')](db[_0x0898('0x12')],{'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1d7')});db[_0x0898('0x197')][_0x0898('0x150')](db['User'],{'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1d8')});db['JscriptySessionReport']['hasMany'](db[_0x0898('0x1d9')],{'foreignKey':_0x0898('0x1da'),'onDelete':_0x0898('0x115')});db[_0x0898('0xd8')][_0x0898('0x117')](db[_0x0898('0xd5')],{'foreignKey':'SessionId','onDelete':_0x0898('0x115')});db[_0x0898('0xda')]['belongsTo'](db[_0x0898('0x57')],{});db['SmsQueueReport'][_0x0898('0x150')](db['CmList'],{'as':_0x0898('0x183'),'foreignKey':_0x0898('0x179')});db['SmsQueueReport'][_0x0898('0x150')](db[_0x0898('0x7b')],{'as':_0x0898('0x173'),'foreignKey':'ContactId'});db[_0x0898('0xda')][_0x0898('0x150')](db[_0x0898('0x5b')],{});db[_0x0898('0xda')]['belongsTo'](db[_0x0898('0x5d')],{});db[_0x0898('0xda')]['belongsTo'](db[_0x0898('0x12')],{});db[_0x0898('0xda')][_0x0898('0x150')](db[_0x0898('0x5f')],{});db[_0x0898('0x1db')][_0x0898('0x117')](db[_0x0898('0xd8')],{'foreignKey':_0x0898('0x1dc')});db['JscriptyProject'][_0x0898('0x117')](db[_0x0898('0x1d9')],{'foreignKey':_0x0898('0x1dc')});db[_0x0898('0x1db')][_0x0898('0x117')](db[_0x0898('0xd5')],{'foreignKey':_0x0898('0x1dc')});db['SquareProject'][_0x0898('0x123')](db[_0x0898('0x12')],{'as':_0x0898('0x171'),'through':_0x0898('0x146')});db['Team'][_0x0898('0x123')](db[_0x0898('0x12')],{'as':_0x0898('0x168'),'through':_0x0898('0x12a')});db[_0x0898('0x169')][_0x0898('0x123')](db[_0x0898('0x1d')],{'through':_0x0898('0x10d'),'as':_0x0898('0x132')});db[_0x0898('0x169')][_0x0898('0x123')](db[_0x0898('0x42')],{'through':_0x0898('0x16a'),'as':_0x0898('0x135')});db[_0x0898('0x169')]['belongsToMany'](db[_0x0898('0x73')],{'through':_0x0898('0x1dd'),'as':_0x0898('0x136')});db[_0x0898('0x169')][_0x0898('0x123')](db['FaxQueue'],{'through':_0x0898('0x1de'),'as':_0x0898('0x138')});db[_0x0898('0x169')][_0x0898('0x123')](db[_0x0898('0x5f')],{'through':_0x0898('0x1df'),'as':_0x0898('0x139')});db[_0x0898('0x169')][_0x0898('0x123')](db['OpenchannelQueue'],{'through':_0x0898('0x1e0'),'as':_0x0898('0x13a')});db[_0x0898('0x169')][_0x0898('0x123')](db[_0x0898('0x10a')],{'through':_0x0898('0x1e1'),'as':_0x0898('0x13b')});db[_0x0898('0x169')][_0x0898('0x123')](db[_0x0898('0x133')],{'through':'TeamVoicePrefix','as':_0x0898('0x134')});db[_0x0898('0x19f')]['hasMany'](db[_0x0898('0x7d')],{'as':'Hoppers','foreignKey':_0x0898('0x1a0')});db[_0x0898('0x19f')][_0x0898('0x117')](db[_0x0898('0x81')],{'as':_0x0898('0x11a'),'foreignKey':'CampaignId'});db[_0x0898('0x19f')][_0x0898('0x117')](db[_0x0898('0x83')],{'as':'HopperHistories','foreignKey':_0x0898('0x1a0')});db[_0x0898('0x19f')][_0x0898('0x117')](db[_0x0898('0x7f')],{'as':_0x0898('0x14f'),'foreignKey':'CampaignId'});db['Campaign'][_0x0898('0x150')](db[_0x0898('0x151')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x0898('0x19f')][_0x0898('0x150')](db[_0x0898('0x151')],{'as':_0x0898('0x152'),'foreignKey':'TrunkBackupId'});db[_0x0898('0x19f')][_0x0898('0x150')](db[_0x0898('0x8f')],{'as':_0x0898('0x8f'),'foreignKey':_0x0898('0x154')});db[_0x0898('0x19f')][_0x0898('0x150')](db['SquareProject'],{'as':_0x0898('0x145'),'foreignKey':'SquareProjectId'});db['Campaign']['belongsToMany'](db[_0x0898('0xf5')],{'as':_0x0898('0x128'),'through':_0x0898('0x1e2')});db[_0x0898('0x19f')][_0x0898('0x123')](db[_0x0898('0xf5')],{'as':_0x0898('0x15a'),'through':_0x0898('0x1e3')});db['Attachment'][_0x0898('0x150')](db['ChatOfflineMessage'],{'as':_0x0898('0x71'),'foreignKey':_0x0898('0x177')});db[_0x0898('0xec')][_0x0898('0x150')](db[_0x0898('0x47')],{});db[_0x0898('0xec')][_0x0898('0x150')](db[_0x0898('0x46')],{});db[_0x0898('0xec')][_0x0898('0x150')](db[_0x0898('0x40')],{'foreignKey':_0x0898('0x1e4'),'as':'FromAccount'});db[_0x0898('0xec')][_0x0898('0x150')](db['User'],{'foreignKey':_0x0898('0x1e5'),'as':_0x0898('0x1e6')});db['MailTransferReport'][_0x0898('0x150')](db[_0x0898('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x0898('0xec')]['belongsTo'](db[_0x0898('0x42')],{'foreignKey':_0x0898('0x1e7'),'as':_0x0898('0x1e8')});db[_0x0898('0xec')][_0x0898('0x150')](db[_0x0898('0x40')],{'foreignKey':_0x0898('0x1e9'),'as':'ToAccount'});db[_0x0898('0x1ea')][_0x0898('0x150')](db[_0x0898('0x6f')],{});db[_0x0898('0x1ea')][_0x0898('0x150')](db[_0x0898('0x6d')],{});db[_0x0898('0x1ea')][_0x0898('0x150')](db[_0x0898('0x68')],{'foreignKey':'FromChatWebsiteId','as':_0x0898('0x1eb')});db[_0x0898('0x1ea')][_0x0898('0x150')](db['User'],{'foreignKey':_0x0898('0x1e5'),'as':'FromAgent'});db[_0x0898('0x1ea')]['belongsTo'](db[_0x0898('0x12')],{'foreignKey':'ToUserId','as':_0x0898('0x1ec')});db[_0x0898('0x1ea')][_0x0898('0x150')](db[_0x0898('0x73')],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db[_0x0898('0x1ea')][_0x0898('0x150')](db[_0x0898('0x68')],{'foreignKey':_0x0898('0x1ed'),'as':_0x0898('0x1ee')});db[_0x0898('0xef')][_0x0898('0x150')](db[_0x0898('0x182')],{});db[_0x0898('0xef')]['belongsTo'](db[_0x0898('0x52')],{});db[_0x0898('0xef')][_0x0898('0x150')](db[_0x0898('0x4f')],{'foreignKey':'FromFaxAccountId','as':_0x0898('0x1eb')});db['FaxTransferReport'][_0x0898('0x150')](db[_0x0898('0x12')],{'foreignKey':_0x0898('0x1e5'),'as':_0x0898('0x1e6')});db[_0x0898('0xef')][_0x0898('0x150')](db[_0x0898('0x12')],{'foreignKey':'ToUserId','as':_0x0898('0x1ec')});db[_0x0898('0xef')]['belongsTo'](db[_0x0898('0x54')],{'foreignKey':'ToFaxQueueId','as':_0x0898('0x1e8')});db[_0x0898('0xef')][_0x0898('0x150')](db[_0x0898('0x4f')],{'foreignKey':_0x0898('0x1ef'),'as':_0x0898('0x1ee')});db[_0x0898('0xf1')][_0x0898('0x150')](db[_0x0898('0x64')],{});db[_0x0898('0xf1')][_0x0898('0x150')](db[_0x0898('0x11c')],{});db['OpenchannelTransferReport'][_0x0898('0x150')](db[_0x0898('0x61')],{'foreignKey':'FromOpenchannelAccountId','as':_0x0898('0x1eb')});db['OpenchannelTransferReport']['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x0898('0xf1')][_0x0898('0x150')](db[_0x0898('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db['OpenchannelTransferReport'][_0x0898('0x150')](db[_0x0898('0x66')],{'foreignKey':'ToOpenchannelQueueId','as':_0x0898('0x1e8')});db[_0x0898('0xf1')]['belongsTo'](db[_0x0898('0x61')],{'foreignKey':'ToOpenchannelAccountId','as':_0x0898('0x1ee')});db[_0x0898('0xf3')]['belongsTo'](db[_0x0898('0x5d')],{});db[_0x0898('0xf3')][_0x0898('0x150')](db[_0x0898('0x5b')],{});db[_0x0898('0xf3')][_0x0898('0x150')](db[_0x0898('0x57')],{'foreignKey':'FromSmsAccountId','as':_0x0898('0x1eb')});db[_0x0898('0xf3')]['belongsTo'](db[_0x0898('0x12')],{'foreignKey':_0x0898('0x1e5'),'as':'FromAgent'});db['SmsTransferReport'][_0x0898('0x150')](db[_0x0898('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x0898('0xf3')][_0x0898('0x150')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db['SmsTransferReport'][_0x0898('0x150')](db[_0x0898('0x57')],{'foreignKey':_0x0898('0x1f0'),'as':_0x0898('0x1ee')});db[_0x0898('0xf5')][_0x0898('0x117')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x0898('0x179'),'onDelete':_0x0898('0x115')});db[_0x0898('0xf5')][_0x0898('0x117')](db[_0x0898('0x1f1')],{'as':_0x0898('0x1f2'),'foreignKey':_0x0898('0x179')});db[_0x0898('0xf5')]['hasMany'](db[_0x0898('0x7b')],{'as':'Contacts','onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x179')});db[_0x0898('0xf5')]['hasMany'](db[_0x0898('0x81')],{'as':'HopperFinals','foreignKey':_0x0898('0x179')});db[_0x0898('0xf5')][_0x0898('0x117')](db[_0x0898('0x83')],{'as':_0x0898('0x11b'),'foreignKey':_0x0898('0x179')});db[_0x0898('0xf5')][_0x0898('0x117')](db[_0x0898('0x85')],{'as':_0x0898('0x85'),'foreignKey':'ListId'});db[_0x0898('0xf5')]['belongsToMany'](db[_0x0898('0x1d')],{'as':'Queues','through':_0x0898('0x1f3')});db[_0x0898('0xf5')][_0x0898('0x123')](db['User'],{'as':_0x0898('0x168'),'through':_0x0898('0x129')});db[_0x0898('0x133')]['hasMany'](db[_0x0898('0x19')],{'as':_0x0898('0x119'),'onDelete':'cascade'});db[_0x0898('0x133')]['belongsToMany'](db[_0x0898('0x12')],{'as':_0x0898('0x168'),'through':_0x0898('0x111')});db[_0x0898('0x133')]['belongsToMany'](db[_0x0898('0x169')],{'through':_0x0898('0x10f'),'as':'Teams'});db['UserProfile'][_0x0898('0x117')](db[_0x0898('0x12')],{'as':_0x0898('0x171'),'foreignKey':_0x0898('0x122')});db['UserProfile'][_0x0898('0x117')](db[_0x0898('0xf9')],{'as':_0x0898('0x1f4'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0x0898('0xf9')][_0x0898('0x117')](db[_0x0898('0xfb')],{'as':_0x0898('0x1f5'),'foreignKey':_0x0898('0x1f6'),'onDelete':_0x0898('0x115')});db[_0x0898('0xff')]['hasMany'](db[_0x0898('0x17d')],{'as':_0x0898('0x17e'),'foreignKey':_0x0898('0x1f7'),'onDelete':_0x0898('0x115')});db[_0x0898('0xff')][_0x0898('0x117')](db[_0x0898('0x8b')],{'as':_0x0898('0x167'),'foreignKey':'WhatsappAccountId'});db[_0x0898('0xff')]['hasMany'](db[_0x0898('0x105')],{'as':_0x0898('0x15c'),'foreignKey':_0x0898('0x1f7')});db[_0x0898('0xff')]['hasMany'](db['WhatsappInteraction'],{'as':'Interactions'});db['WhatsappAccount'][_0x0898('0x117')](db[_0x0898('0x101')],{'as':'Applications'});db[_0x0898('0xff')][_0x0898('0x150')](db[_0x0898('0xf5')],{'as':'List','foreignKey':_0x0898('0x179')});db['WhatsappAccount']['belongsTo'](db[_0x0898('0x155')],{'as':_0x0898('0x156'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0898('0xff')][_0x0898('0x123')](db[_0x0898('0x12')],{'as':_0x0898('0x168'),'through':_0x0898('0x144')});db[_0x0898('0x101')][_0x0898('0x150')](db['User'],{'onDelete':_0x0898('0x164')});db['WhatsappApplication']['belongsTo'](db[_0x0898('0x10a')],{'onDelete':_0x0898('0x164')});db['WhatsappApplication'][_0x0898('0x150')](db[_0x0898('0xff')],{'onDelete':_0x0898('0x164')});db[_0x0898('0x101')][_0x0898('0x150')](db[_0x0898('0x8f')],{'onDelete':_0x0898('0x164'),'foreignKey':'IntervalId'});db[_0x0898('0x101')][_0x0898('0x150')](db[_0x0898('0x97')],{'onDelete':_0x0898('0x164'),'foreignKey':_0x0898('0x178')});db['WhatsappInteraction'][_0x0898('0x117')](db[_0x0898('0x105')],{'as':_0x0898('0x15c'),'onDelete':_0x0898('0x115'),'foreignKey':_0x0898('0x1f8')});db[_0x0898('0x103')][_0x0898('0x150')](db[_0x0898('0xff')],{'as':_0x0898('0x16b'),'foreignKey':_0x0898('0x1f7')});db['WhatsappInteraction'][_0x0898('0x150')](db[_0x0898('0x7b')],{'as':_0x0898('0x173'),'foreignKey':'ContactId'});db[_0x0898('0x103')][_0x0898('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0898('0x116')});db['WhatsappInteraction'][_0x0898('0x123')](db[_0x0898('0x97')],{'through':_0x0898('0x1b4'),'as':_0x0898('0x16f')});db[_0x0898('0x103')][_0x0898('0x123')](db[_0x0898('0x97')],{'through':'whatsapp_interaction_has_tags','as':_0x0898('0x170')});db[_0x0898('0x103')][_0x0898('0x123')](db[_0x0898('0x12')],{'as':_0x0898('0x171'),'through':_0x0898('0x131'),'foreignKey':_0x0898('0x1f8')});db[_0x0898('0x105')]['belongsTo'](db['User'],{'as':_0x0898('0x12')});db[_0x0898('0x105')]['belongsTo'](db[_0x0898('0x7b')],{'onDelete':'cascade','as':'Contact'});db[_0x0898('0x105')][_0x0898('0x150')](db[_0x0898('0x103')],{'onDelete':'cascade','as':_0x0898('0x174'),'foreignKey':'WhatsappInteractionId'});db[_0x0898('0x105')][_0x0898('0x150')](db[_0x0898('0xff')],{'as':_0x0898('0x16b'),'foreignKey':_0x0898('0x1f7')});db[_0x0898('0x107')][_0x0898('0x150')](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0x0898('0x150')](db[_0x0898('0xf5')],{'as':_0x0898('0x183'),'foreignKey':'ListId'});db[_0x0898('0x107')][_0x0898('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0898('0x16c')});db[_0x0898('0x107')][_0x0898('0x150')](db[_0x0898('0x103')],{});db['WhatsappQueueReport'][_0x0898('0x150')](db['WhatsappQueue'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0898('0x105')],{});db[_0x0898('0x107')][_0x0898('0x150')](db[_0x0898('0x12')],{});db[_0x0898('0x1f9')][_0x0898('0x150')](db[_0x0898('0x105')],{});db[_0x0898('0x1f9')][_0x0898('0x150')](db[_0x0898('0x103')],{});db['WhatsappTransferReport'][_0x0898('0x150')](db[_0x0898('0xff')],{'foreignKey':_0x0898('0x1fa'),'as':_0x0898('0x1eb')});db['WhatsappTransferReport']['belongsTo'](db[_0x0898('0xff')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x0898('0x1f9')][_0x0898('0x150')](db[_0x0898('0x10a')],{'foreignKey':'ToQueueId','as':_0x0898('0x1e8')});db[_0x0898('0x1f9')]['belongsTo'](db['User'],{'foreignKey':_0x0898('0x1e5'),'as':_0x0898('0x1e6')});db[_0x0898('0x1f9')]['belongsTo'](db[_0x0898('0x12')],{'foreignKey':_0x0898('0x1fb'),'as':'ToAgent'});db[_0x0898('0x10a')]['belongsToMany'](db[_0x0898('0x12')],{'as':_0x0898('0x168'),'through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db['WhatsappQueue'][_0x0898('0x123')](db[_0x0898('0x169')],{'through':_0x0898('0x1e1'),'as':_0x0898('0x159')});db['UserSetting'][_0x0898('0x150')](db[_0x0898('0x12')],{'as':_0x0898('0x1fc'),'foreignKey':_0x0898('0x116'),'onDelete':_0x0898('0x115'),'hooks':!![]});db['CloudProvider'][_0x0898('0x114')](db[_0x0898('0xcc')],{'as':_0x0898('0xcc'),'onDelete':_0x0898('0x164')});db[_0x0898('0x10c')][_0x0898('0x114')](db[_0x0898('0x161')],{'as':_0x0898('0x165'),'onDelete':_0x0898('0x164')});db[_0x0898('0x10c')][_0x0898('0x114')](db[_0x0898('0x3e')],{'as':_0x0898('0x166'),'onDelete':_0x0898('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 8115210..a29b73c 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2eb2=['/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','./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/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/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/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','root','/www','static','join','/snippet','snippet','3.0.0','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','./api/condition','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/tag','/api/templates','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x2eb2,0x19f));var _0x22eb=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x2eb2[_0x550d12];return _0x12103d;};'use strict';var path=require('path');var express=require(_0x22eb('0x0'));var errors=require(_0x22eb('0x1'));var config=require(_0x22eb('0x2'));var setupLoggers=require(_0x22eb('0x3'))[_0x22eb('0x4')];var clientSideLogs=require(_0x22eb('0x5'));exports['default']=function(_0x27732f){return setupLoggers(_0x27732f)['then'](function(){_0x27732f['use'](_0x22eb('0x6'),require(_0x22eb('0x7')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x9'),require(_0x22eb('0xa')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xb'),require(_0x22eb('0xc')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xd'),require(_0x22eb('0xe')));_0x27732f[_0x22eb('0x8')]('/api/voice/mohs',require(_0x22eb('0xf')));_0x27732f['use']('/api/voice/queues',require(_0x22eb('0x10')));_0x27732f['use'](_0x22eb('0x11'),require(_0x22eb('0x12')));_0x27732f['use']('/api/screen/recordings',require(_0x22eb('0x13')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x14'),require(_0x22eb('0x15')));_0x27732f[_0x22eb('0x8')]('/api/voice/mails/messages',require(_0x22eb('0x16')));_0x27732f['use'](_0x22eb('0x17'),require('./api/voiceCallReport'));_0x27732f[_0x22eb('0x8')](_0x22eb('0x18'),require('./api/voiceDialReport'));_0x27732f['use']('/api/voice/agents/reports',require(_0x22eb('0x19')));_0x27732f['use']('/api/voice/queues/reports',require(_0x22eb('0x1a')));_0x27732f['use']('/api/members/reports',require(_0x22eb('0x1b')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x1c'),require(_0x22eb('0x1d')));_0x27732f[_0x22eb('0x8')]('/api/voice/transfers/reports',require(_0x22eb('0x1e')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x1f'),require(_0x22eb('0x20')));_0x27732f[_0x22eb('0x8')]('/api/mail/accounts',require(_0x22eb('0x21')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x22'),require('./api/mailQueue'));_0x27732f['use'](_0x22eb('0x23'),require(_0x22eb('0x24')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x25'),require(_0x22eb('0x26')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x27'),require('./api/mailMessage'));_0x27732f[_0x22eb('0x8')](_0x22eb('0x28'),require(_0x22eb('0x29')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x2a'),require('./api/mailQueueReport'));_0x27732f[_0x22eb('0x8')](_0x22eb('0x2b'),require(_0x22eb('0x2c')));_0x27732f['use'](_0x22eb('0x2d'),require(_0x22eb('0x2e')));_0x27732f['use'](_0x22eb('0x2f'),require(_0x22eb('0x30')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x31'),require(_0x22eb('0x32')));_0x27732f['use']('/api/fax/interactions',require(_0x22eb('0x33')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x34'),require(_0x22eb('0x35')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x36'),require(_0x22eb('0x37')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x38'),require(_0x22eb('0x39')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x3a'),require('./api/smsAccount'));_0x27732f[_0x22eb('0x8')]('/api/sms/applications',require(_0x22eb('0x3b')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x3c'),require(_0x22eb('0x3d')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x3e'),require(_0x22eb('0x3f')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x40'),require(_0x22eb('0x41')));_0x27732f['use']('/api/openchannel/accounts',require(_0x22eb('0x42')));_0x27732f['use']('/api/openchannel/applications',require(_0x22eb('0x43')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x44'),require(_0x22eb('0x45')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x46'),require(_0x22eb('0x47')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x48'),require(_0x22eb('0x49')));_0x27732f['use'](_0x22eb('0x4a'),require('./api/chatWebsite'));_0x27732f['use'](_0x22eb('0x4b'),require(_0x22eb('0x4c')));_0x27732f['use'](_0x22eb('0x4d'),require(_0x22eb('0x4e')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x4f'),require(_0x22eb('0x50')));_0x27732f['use'](_0x22eb('0x51'),require(_0x22eb('0x52')));_0x27732f['use'](_0x22eb('0x53'),require(_0x22eb('0x54')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x55'),require(_0x22eb('0x56')));_0x27732f['use']('/api/chat/groups',require(_0x22eb('0x57')));_0x27732f[_0x22eb('0x8')]('/api/chat/proactive_actions',require(_0x22eb('0x58')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x59'),require('./api/cmCompany'));_0x27732f[_0x22eb('0x8')](_0x22eb('0x5a'),require(_0x22eb('0x5b')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x5c'),require(_0x22eb('0x5d')));_0x27732f['use'](_0x22eb('0x5e'),require(_0x22eb('0x5f')));_0x27732f['use'](_0x22eb('0x60'),require(_0x22eb('0x61')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x62'),require(_0x22eb('0x63')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x64'),require(_0x22eb('0x65')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x66'),require(_0x22eb('0x67')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x68'),require(_0x22eb('0x69')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x6a'),require(_0x22eb('0x6b')));_0x27732f[_0x22eb('0x8')]('/api/dispositions',require(_0x22eb('0x6c')));_0x27732f[_0x22eb('0x8')]('/api/conditions',require(_0x22eb('0x6d')));_0x27732f[_0x22eb('0x8')]('/api/intervals',require('./api/interval'));_0x27732f['use'](_0x22eb('0x6e'),require(_0x22eb('0x6f')));_0x27732f['use']('/api/cdr',require(_0x22eb('0x70')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x71'),require(_0x22eb('0x72')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x73'),require(_0x22eb('0x74')));_0x27732f[_0x22eb('0x8')]('/api/sounds',require('./api/sound'));_0x27732f[_0x22eb('0x8')]('/api/tags',require(_0x22eb('0x75')));_0x27732f['use'](_0x22eb('0x76'),require('./api/template'));_0x27732f['use']('/api/triggers',require('./api/trigger'));_0x27732f[_0x22eb('0x8')]('/api/variables',require(_0x22eb('0x77')));_0x27732f[_0x22eb('0x8')]('/api/integrations',require(_0x22eb('0x78')));_0x27732f['use'](_0x22eb('0x79'),require(_0x22eb('0x7a')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x7b'),require(_0x22eb('0x7c')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x7d'),require(_0x22eb('0x7e')));_0x27732f[_0x22eb('0x8')]('/api/analytics/extracted_reports',require(_0x22eb('0x7f')));_0x27732f[_0x22eb('0x8')]('/api/analytics/metrics',require(_0x22eb('0x80')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x81'),require(_0x22eb('0x82')));_0x27732f['use'](_0x22eb('0x83'),require(_0x22eb('0x84')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x85'),require(_0x22eb('0x86')));_0x27732f[_0x22eb('0x8')]('/api/integrations/salesforce/configurations',require(_0x22eb('0x87')));_0x27732f['use'](_0x22eb('0x88'),require('./api/intSalesforceField'));_0x27732f[_0x22eb('0x8')](_0x22eb('0x89'),require(_0x22eb('0x8a')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x8b'),require('./api/intSugarcrmConfiguration'));_0x27732f['use'](_0x22eb('0x8c'),require(_0x22eb('0x8d')));_0x27732f['use'](_0x22eb('0x8e'),require(_0x22eb('0x8f')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x90'),require(_0x22eb('0x91')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x92'),require(_0x22eb('0x93')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x94'),require(_0x22eb('0x95')));_0x27732f['use'](_0x22eb('0x96'),require(_0x22eb('0x97')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x98'),require(_0x22eb('0x99')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x9a'),require(_0x22eb('0x9b')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x9c'),require(_0x22eb('0x9d')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x9e'),require(_0x22eb('0x9f')));_0x27732f['use']('/api/integrations/freshdesk/accounts',require(_0x22eb('0xa0')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xa1'),require(_0x22eb('0xa2')));_0x27732f[_0x22eb('0x8')]('/api/integrations/freshdesk/fields',require(_0x22eb('0xa3')));_0x27732f[_0x22eb('0x8')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x27732f[_0x22eb('0x8')](_0x22eb('0xa4'),require(_0x22eb('0xa5')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xa6'),require(_0x22eb('0xa7')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xa8'),require(_0x22eb('0xa9')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xaa'),require(_0x22eb('0xab')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xac'),require('./api/intServicenowField'));_0x27732f[_0x22eb('0x8')](_0x22eb('0xad'),require(_0x22eb('0xae')));_0x27732f['use'](_0x22eb('0xaf'),require('./api/intDynamics365Configuration'));_0x27732f[_0x22eb('0x8')]('/api/integrations/dynamics365/fields',require(_0x22eb('0xb0')));_0x27732f[_0x22eb('0x8')]('/api/integrations/freshsales/accounts',require(_0x22eb('0xb1')));_0x27732f[_0x22eb('0x8')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x27732f[_0x22eb('0x8')](_0x22eb('0xb2'),require(_0x22eb('0xb3')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xb4'),require(_0x22eb('0xb5')));_0x27732f['use'](_0x22eb('0xb6'),require('./api/chatQueueReport'));_0x27732f['use'](_0x22eb('0xb7'),require(_0x22eb('0xb8')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xb9'),require(_0x22eb('0xba')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xbb'),require(_0x22eb('0xbc')));_0x27732f['use']('/api/jscripty/sessions/reports',require(_0x22eb('0xbd')));_0x27732f[_0x22eb('0x8')]('/api/sms/reports/queue',require(_0x22eb('0xbe')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xbf'),require(_0x22eb('0xc0')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xc1'),require('./api/squareReportDetail'));_0x27732f[_0x22eb('0x8')](_0x22eb('0xc2'),require(_0x22eb('0xc3')));_0x27732f['use']('/api/settings',require(_0x22eb('0xc4')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xc5'),require('./api/squareOdbc'));_0x27732f[_0x22eb('0x8')]('/api/square/projects',require(_0x22eb('0xc6')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xc7'),require(_0x22eb('0xc8')));_0x27732f['use'](_0x22eb('0xc9'),require(_0x22eb('0xca')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xcb'),require(_0x22eb('0xcc')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xcd'),require(_0x22eb('0xce')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xcf'),require(_0x22eb('0xd0')));_0x27732f['use'](_0x22eb('0xd1'),require(_0x22eb('0xd2')));_0x27732f['use']('/api/attachments',require('./api/attachment'));_0x27732f[_0x22eb('0x8')](_0x22eb('0xd3'),require('./api/plugin'));_0x27732f[_0x22eb('0x8')](_0x22eb('0xd4'),require(_0x22eb('0xd5')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xd6'),require('./api/chatTransferReport'));_0x27732f['use'](_0x22eb('0xd7'),require(_0x22eb('0xd8')));_0x27732f[_0x22eb('0x8')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x27732f[_0x22eb('0x8')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x27732f[_0x22eb('0x8')](_0x22eb('0xd9'),require('./api/cmList'));_0x27732f['use'](_0x22eb('0xda'),require(_0x22eb('0xdb')));_0x27732f['use'](_0x22eb('0xdc'),require(_0x22eb('0xdd')));_0x27732f[_0x22eb('0x8')]('/api/userProfile/sections',require(_0x22eb('0xde')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xdf'),require(_0x22eb('0xe0')));_0x27732f[_0x22eb('0x8')]('/api/userNotifications',require(_0x22eb('0xe1')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xe2'),require('./api/whatsappAccount'));_0x27732f['use'](_0x22eb('0xe3'),require(_0x22eb('0xe4')));_0x27732f[_0x22eb('0x8')]('/api/whatsapp/interactions',require(_0x22eb('0xe5')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xe6'),require('./api/whatsappMessage'));_0x27732f[_0x22eb('0x8')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x27732f[_0x22eb('0x8')](_0x22eb('0xe7'),require(_0x22eb('0xe8')));_0x27732f['use'](_0x22eb('0xe9'),require(_0x22eb('0xea')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xeb'),require(_0x22eb('0xec')));_0x27732f['use'](_0x22eb('0xed'),require('./api/realtime'));_0x27732f[_0x22eb('0x8')](_0x22eb('0xee'),require(_0x22eb('0xef')));_0x27732f['use'](_0x22eb('0xf0'),require(_0x22eb('0xf1')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xf2'),require(_0x22eb('0xf3')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xf4'),require(_0x22eb('0xf5')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xf6'),require(_0x22eb('0xf7')));_0x27732f['use'](_0x22eb('0xf8'),require(_0x22eb('0xf9')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xfa'),require('./api/version'));_0x27732f[_0x22eb('0x8')](_0x22eb('0xfb'),require('./api/system'));_0x27732f[_0x22eb('0x8')](_0x22eb('0xfc'),require(_0x22eb('0xfd')));_0x27732f[_0x22eb('0x8')](_0x22eb('0xfe'),require(_0x22eb('0xff')));_0x27732f[_0x22eb('0x8')]('/api/logs',clientSideLogs);_0x27732f[_0x22eb('0x8')](_0x22eb('0x100'),express['static'](path['join'](config[_0x22eb('0x101')],_0x22eb('0x100'))));_0x27732f[_0x22eb('0x8')](_0x22eb('0x102'),express[_0x22eb('0x103')](path['join'](config['root'],_0x22eb('0x102'))));_0x27732f[_0x22eb('0x8')]('/demo',express[_0x22eb('0x103')](path[_0x22eb('0x104')](config[_0x22eb('0x101')],'/demo')));_0x27732f[_0x22eb('0x8')](_0x22eb('0x105'),express[_0x22eb('0x103')](path[_0x22eb('0x104')](config[_0x22eb('0x101')],_0x22eb('0x106'),_0x22eb('0x107'))));_0x27732f[_0x22eb('0x8')]('/plugins',express['static'](path['join'](config[_0x22eb('0x101')],'/server/files/plugins')));_0x27732f['route'](_0x22eb('0x108'))[_0x22eb('0x109')](errors[0x194]);_0x27732f['route']('/*')[_0x22eb('0x109')](function(_0x5099fb,_0x210b08){_0x210b08[_0x22eb('0x10a')](path['resolve'](_0x27732f[_0x22eb('0x109')](_0x22eb('0x10b'))+_0x22eb('0x10c')));});return _0x27732f;});}; \ No newline at end of file +var _0xac31=['/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','get','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/fax/accounts','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue'];(function(_0x2861e4,_0x5c98dd){var _0x290df6=function(_0x15f92c){while(--_0x15f92c){_0x2861e4['push'](_0x2861e4['shift']());}};_0x290df6(++_0x5c98dd);}(_0xac31,0xca));var _0x1ac3=function(_0x3eea88,_0x146de0){_0x3eea88=_0x3eea88-0x0;var _0x4e1bdf=_0xac31[_0x3eea88];return _0x4e1bdf;};'use strict';var path=require(_0x1ac3('0x0'));var express=require(_0x1ac3('0x1'));var errors=require(_0x1ac3('0x2'));var config=require(_0x1ac3('0x3'));var setupLoggers=require(_0x1ac3('0x4'))[_0x1ac3('0x5')];var clientSideLogs=require(_0x1ac3('0x6'));exports['default']=function(_0x33b5ab){return setupLoggers(_0x33b5ab)[_0x1ac3('0x7')](function(){_0x33b5ab['use']('/api/users',require(_0x1ac3('0x8')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xa'),require(_0x1ac3('0xb')));_0x33b5ab[_0x1ac3('0x9')]('/api/voice/contexts',require(_0x1ac3('0xc')));_0x33b5ab['use'](_0x1ac3('0xd'),require(_0x1ac3('0xe')));_0x33b5ab[_0x1ac3('0x9')]('/api/voice/mohs',require(_0x1ac3('0xf')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x10'),require(_0x1ac3('0x11')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x12'),require('./api/voiceRecording'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x13'),require(_0x1ac3('0x14')));_0x33b5ab[_0x1ac3('0x9')]('/api/voice/mails',require(_0x1ac3('0x15')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x16'),require(_0x1ac3('0x17')));_0x33b5ab['use'](_0x1ac3('0x18'),require(_0x1ac3('0x19')));_0x33b5ab['use'](_0x1ac3('0x1a'),require(_0x1ac3('0x1b')));_0x33b5ab[_0x1ac3('0x9')]('/api/voice/agents/reports',require(_0x1ac3('0x1c')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x1d'),require('./api/voiceQueueReport'));_0x33b5ab[_0x1ac3('0x9')]('/api/members/reports',require(_0x1ac3('0x1e')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x1f'),require(_0x1ac3('0x20')));_0x33b5ab[_0x1ac3('0x9')]('/api/voice/transfers/reports',require(_0x1ac3('0x21')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x22'),require(_0x1ac3('0x23')));_0x33b5ab['use']('/api/mail/accounts',require(_0x1ac3('0x24')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x25'),require(_0x1ac3('0x26')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x27'),require(_0x1ac3('0x28')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x29'),require('./api/mailInteraction'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x2a'),require('./api/mailMessage'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x2b'),require('./api/mailApplication'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x2c'),require(_0x1ac3('0x2d')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x2e'),require('./api/dashboard'));_0x33b5ab['use']('/api/dashboards/items',require('./api/dashboardItem'));_0x33b5ab['use'](_0x1ac3('0x2f'),require('./api/faxAccount'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x30'),require(_0x1ac3('0x31')));_0x33b5ab[_0x1ac3('0x9')]('/api/fax/interactions',require(_0x1ac3('0x32')));_0x33b5ab['use'](_0x1ac3('0x33'),require(_0x1ac3('0x34')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x35'),require(_0x1ac3('0x36')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x37'),require('./api/faxQueueReport'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x38'),require(_0x1ac3('0x39')));_0x33b5ab[_0x1ac3('0x9')]('/api/sms/applications',require(_0x1ac3('0x3a')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x3b'),require(_0x1ac3('0x3c')));_0x33b5ab[_0x1ac3('0x9')]('/api/sms/messages',require(_0x1ac3('0x3d')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x3e'),require(_0x1ac3('0x3f')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x40'),require('./api/openchannelAccount'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x41'),require(_0x1ac3('0x42')));_0x33b5ab[_0x1ac3('0x9')]('/api/openchannel/interactions',require(_0x1ac3('0x43')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x44'),require(_0x1ac3('0x45')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x46'),require(_0x1ac3('0x47')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x48'),require('./api/chatWebsite'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x49'),require('./api/openchannelQueueReport'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x4a'),require(_0x1ac3('0x4b')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x4c'),require(_0x1ac3('0x4d')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x4e'),require('./api/chatMessage'));_0x33b5ab[_0x1ac3('0x9')]('/api/chat/offline_messages',require(_0x1ac3('0x4f')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x50'),require(_0x1ac3('0x51')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x52'),require('./api/chatGroup'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x53'),require(_0x1ac3('0x54')));_0x33b5ab['use'](_0x1ac3('0x55'),require(_0x1ac3('0x56')));_0x33b5ab['use'](_0x1ac3('0x57'),require(_0x1ac3('0x58')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x59'),require(_0x1ac3('0x5a')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x5b'),require(_0x1ac3('0x5c')));_0x33b5ab['use'](_0x1ac3('0x5d'),require(_0x1ac3('0x5e')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x5f'),require(_0x1ac3('0x60')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x61'),require('./api/cmCustomField'));_0x33b5ab['use'](_0x1ac3('0x62'),require(_0x1ac3('0x63')));_0x33b5ab['use'](_0x1ac3('0x64'),require(_0x1ac3('0x65')));_0x33b5ab['use'](_0x1ac3('0x66'),require('./api/cannedAnswer'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x67'),require(_0x1ac3('0x68')));_0x33b5ab[_0x1ac3('0x9')]('/api/conditions',require(_0x1ac3('0x69')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x6a'),require(_0x1ac3('0x6b')));_0x33b5ab[_0x1ac3('0x9')]('/api/pauses',require(_0x1ac3('0x6c')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x6d'),require(_0x1ac3('0x6e')));_0x33b5ab['use'](_0x1ac3('0x6f'),require(_0x1ac3('0x70')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x71'),require('./api/schedule'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x72'),require(_0x1ac3('0x73')));_0x33b5ab[_0x1ac3('0x9')]('/api/tags',require(_0x1ac3('0x74')));_0x33b5ab['use'](_0x1ac3('0x75'),require(_0x1ac3('0x76')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x77'),require(_0x1ac3('0x78')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x79'),require('./api/variable'));_0x33b5ab['use'](_0x1ac3('0x7a'),require(_0x1ac3('0x7b')));_0x33b5ab[_0x1ac3('0x9')]('/api/integrations/reports',require('./api/integrationReport'));_0x33b5ab['use'](_0x1ac3('0x7c'),require(_0x1ac3('0x7d')));_0x33b5ab['use'](_0x1ac3('0x7e'),require(_0x1ac3('0x7f')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x80'),require('./api/analyticExtractedReport'));_0x33b5ab['use'](_0x1ac3('0x81'),require(_0x1ac3('0x82')));_0x33b5ab['use'](_0x1ac3('0x83'),require('./api/analyticFieldReport'));_0x33b5ab['use'](_0x1ac3('0x84'),require(_0x1ac3('0x85')));_0x33b5ab['use'](_0x1ac3('0x86'),require('./api/intSalesforceAccount'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x87'),require(_0x1ac3('0x88')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x89'),require(_0x1ac3('0x8a')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x8b'),require(_0x1ac3('0x8c')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x8d'),require('./api/intSugarcrmConfiguration'));_0x33b5ab['use'](_0x1ac3('0x8e'),require(_0x1ac3('0x8f')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x90'),require(_0x1ac3('0x91')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x92'),require(_0x1ac3('0x93')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x94'),require('./api/intDeskField'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x95'),require(_0x1ac3('0x96')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x97'),require('./api/intZohoConfiguration'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x98'),require('./api/intZohoField'));_0x33b5ab['use']('/api/integrations/zendesk/accounts',require(_0x1ac3('0x99')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x9a'),require('./api/intZendeskConfiguration'));_0x33b5ab[_0x1ac3('0x9')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x33b5ab['use']('/api/integrations/freshdesk/accounts',require(_0x1ac3('0x9b')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x9c'),require(_0x1ac3('0x9d')));_0x33b5ab[_0x1ac3('0x9')]('/api/integrations/freshdesk/fields',require(_0x1ac3('0x9e')));_0x33b5ab[_0x1ac3('0x9')]('/api/integrations/vtiger/accounts',require(_0x1ac3('0x9f')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xa0'),require(_0x1ac3('0xa1')));_0x33b5ab[_0x1ac3('0x9')]('/api/integrations/vtiger/fields',require(_0x1ac3('0xa2')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xa3'),require(_0x1ac3('0xa4')));_0x33b5ab['use'](_0x1ac3('0xa5'),require(_0x1ac3('0xa6')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xa7'),require(_0x1ac3('0xa8')));_0x33b5ab[_0x1ac3('0x9')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x33b5ab['use']('/api/integrations/dynamics365/configurations',require(_0x1ac3('0xa9')));_0x33b5ab['use'](_0x1ac3('0xaa'),require(_0x1ac3('0xab')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xac'),require(_0x1ac3('0xad')));_0x33b5ab[_0x1ac3('0x9')]('/api/integrations/freshsales/configurations',require(_0x1ac3('0xae')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xaf'),require(_0x1ac3('0xb0')));_0x33b5ab['use'](_0x1ac3('0xb1'),require(_0x1ac3('0xb2')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xb3'),require(_0x1ac3('0xb4')));_0x33b5ab['use'](_0x1ac3('0xb5'),require('./api/chatInternalMessage'));_0x33b5ab['use'](_0x1ac3('0xb6'),require(_0x1ac3('0xb7')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xb8'),require(_0x1ac3('0xb9')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xba'),require(_0x1ac3('0xbb')));_0x33b5ab[_0x1ac3('0x9')]('/api/sms/reports/queue',require(_0x1ac3('0xbc')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xbd'),require('./api/squareReport'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xbe'),require(_0x1ac3('0xbf')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xc0'),require(_0x1ac3('0xc1')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xc2'),require(_0x1ac3('0xc3')));_0x33b5ab[_0x1ac3('0x9')]('/api/square/odbc',require(_0x1ac3('0xc4')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xc5'),require('./api/squareProject'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xc6'),require(_0x1ac3('0xc7')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xc8'),require('./api/squareMessage'));_0x33b5ab['use']('/api/teams',require(_0x1ac3('0xc9')));_0x33b5ab['use'](_0x1ac3('0xca'),require(_0x1ac3('0xcb')));_0x33b5ab[_0x1ac3('0x9')]('/api/campaigns',require(_0x1ac3('0xcc')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xcd'),require(_0x1ac3('0xce')));_0x33b5ab[_0x1ac3('0x9')]('/api/attachments',require('./api/attachment'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xcf'),require('./api/plugin'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xd0'),require(_0x1ac3('0xd1')));_0x33b5ab['use'](_0x1ac3('0xd2'),require(_0x1ac3('0xd3')));_0x33b5ab['use'](_0x1ac3('0xd4'),require('./api/faxTransferReport'));_0x33b5ab[_0x1ac3('0x9')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xd5'),require(_0x1ac3('0xd6')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xd7'),require(_0x1ac3('0xd8')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xd9'),require(_0x1ac3('0xda')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xdb'),require(_0x1ac3('0xdc')));_0x33b5ab['use']('/api/userProfile/sections',require('./api/userProfileSection'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xdd'),require('./api/userProfileResource'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xde'),require(_0x1ac3('0xdf')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xe0'),require('./api/whatsappAccount'));_0x33b5ab[_0x1ac3('0x9')]('/api/whatsapp/applications',require(_0x1ac3('0xe1')));_0x33b5ab['use'](_0x1ac3('0xe2'),require('./api/whatsappInteraction'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xe3'),require(_0x1ac3('0xe4')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xe5'),require('./api/whatsappQueueReport'));_0x33b5ab['use']('/api/whatsapp/reports/transfer',require(_0x1ac3('0xe6')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xe7'),require(_0x1ac3('0xe8')));_0x33b5ab['use'](_0x1ac3('0xe9'),require(_0x1ac3('0xea')));_0x33b5ab['use'](_0x1ac3('0xeb'),require('./api/realtime'));_0x33b5ab[_0x1ac3('0x9')]('/api/user-settings',require('./api/user-setting'));_0x33b5ab['use'](_0x1ac3('0xec'),require(_0x1ac3('0xed')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xee'),require(_0x1ac3('0xef')));_0x33b5ab['use'](_0x1ac3('0xf0'),require(_0x1ac3('0xf1')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xf2'),require('./api/jira'));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xf3'),require('./api/rpc'));_0x33b5ab['use']('/api/version',require(_0x1ac3('0xf4')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xf5'),require(_0x1ac3('0xf6')));_0x33b5ab['use'](_0x1ac3('0xf7'),require(_0x1ac3('0xf8')));_0x33b5ab['use'](_0x1ac3('0xf9'),require(_0x1ac3('0xfa')));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0xfb'),clientSideLogs);_0x33b5ab['use'](_0x1ac3('0xfc'),express[_0x1ac3('0xfd')](path[_0x1ac3('0xfe')](config[_0x1ac3('0xff')],_0x1ac3('0xfc'))));_0x33b5ab['use'](_0x1ac3('0x100'),express[_0x1ac3('0xfd')](path['join'](config['root'],_0x1ac3('0x100'))));_0x33b5ab[_0x1ac3('0x9')]('/demo',express['static'](path[_0x1ac3('0xfe')](config['root'],_0x1ac3('0x101'))));_0x33b5ab[_0x1ac3('0x9')]('/snippet',express['static'](path[_0x1ac3('0xfe')](config['root'],_0x1ac3('0x102'),_0x1ac3('0x103'))));_0x33b5ab[_0x1ac3('0x9')](_0x1ac3('0x104'),express[_0x1ac3('0xfd')](path[_0x1ac3('0xfe')](config[_0x1ac3('0xff')],_0x1ac3('0x105'))));_0x33b5ab[_0x1ac3('0x106')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x1ac3('0x107')](errors[0x194]);_0x33b5ab[_0x1ac3('0x106')]('/*')['get'](function(_0x400e18,_0x42a36d){_0x42a36d['sendFile'](path[_0x1ac3('0x108')](_0x33b5ab['get']('appPath')+_0x1ac3('0x109')));});return _0x33b5ab;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index bfb9a86..2f4ef8f 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfd3=['../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.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/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/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.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/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.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/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','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise'];(function(_0x3e68c3,_0x1b99c8){var _0xd2f2a=function(_0x57882a){while(--_0x57882a){_0x3e68c3['push'](_0x3e68c3['shift']());}};_0xd2f2a(++_0x1b99c8);}(_0xcfd3,0x16c));var _0x3cfd=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0xcfd3[_0x1064bc];return _0x5edc45;};'use strict';var jayson=require(_0x3cfd('0x0'));var _=require('lodash');var config=require(_0x3cfd('0x1'));exports[_0x3cfd('0x2')]=function(){return new Promise(function(_0x256724,_0x234810){var _0x4c5f55={};_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x3')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x5')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require('../api/voiceQueue/voiceQueue.rpc'));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x6')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x7')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x8')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x9')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0xa')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0xb')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0xc')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0xd')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0xe')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0xf')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x10')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x11')));_0x4c5f55=_['merge'](_0x4c5f55,require('../api/mailInteraction/mailInteraction.rpc'));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x12')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x13')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x14')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x15')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require('../api/faxApplication/faxApplication.rpc'));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x16')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x17')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x18')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x19')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x1a')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x1b')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x1c')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x1d')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x1e')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x1f')));_0x4c5f55=_['merge'](_0x4c5f55,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x20')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x21')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x22')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x23')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x24')));_0x4c5f55=_['merge'](_0x4c5f55,require('../api/cmHopper/cmHopper.rpc'));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x25')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x26')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x27')));_0x4c5f55=_['merge'](_0x4c5f55,require('../api/interval/interval.rpc'));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x28')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x29')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x2a')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x2b')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x2c')));_0x4c5f55=_['merge'](_0x4c5f55,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x2d')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x2e')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x2f')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x30')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x31')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x32')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x33')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x34')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require('../api/squareOdbc/squareOdbc.rpc'));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x35')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x36')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x37')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x38')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x39')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x3a')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x3b')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x3c')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x3d')));_0x4c5f55=_[_0x3cfd('0x4')](_0x4c5f55,require(_0x3cfd('0x3e')));_0x4c5f55=_['merge'](_0x4c5f55,require(_0x3cfd('0x3f')));var _0x2541ed=jayson['server'](_0x4c5f55)['http']();var _0x1274d1=config[_0x3cfd('0x40')][_0x3cfd('0x41')]||config[_0x3cfd('0x41')]+0x1;var _0x332aa5=config[_0x3cfd('0x40')]['ip']||_0x3cfd('0x42');_0x2541ed['on'](_0x3cfd('0x43'),function(_0x1bc29c){return _0x234810(_0x1bc29c);});_0x2541ed['listen'](_0x1274d1,_0x332aa5,function(){console[_0x3cfd('0x44')](_0x3cfd('0x45'),_0x332aa5,_0x1274d1);require(_0x3cfd('0x46'))[_0x3cfd('0x47')]();return _0x256724(_0x3cfd('0x48')+_0x332aa5+':'+_0x1274d1);});});}; \ No newline at end of file +var _0x1c51=['../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc'];(function(_0x1e105a,_0x390bb2){var _0x3e28f8=function(_0x469d94){while(--_0x469d94){_0x1e105a['push'](_0x1e105a['shift']());}};_0x3e28f8(++_0x390bb2);}(_0x1c51,0xdd));var _0x11c5=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x1c51[_0x2070da];return _0x4f9fe1;};'use strict';var jayson=require(_0x11c5('0x0'));var _=require(_0x11c5('0x1'));var config=require(_0x11c5('0x2'));exports[_0x11c5('0x3')]=function(){return new Promise(function(_0x55e2fe,_0x28a6db){var _0x5aad4a={};_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x5')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x6')));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0x7')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x8')));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0x9')));_0x5aad4a=_['merge'](_0x5aad4a,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0xa')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/memberReport/memberReport.rpc'));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0xb')));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0xc')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0xd')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0xe')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0xf')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/mailInteraction/mailInteraction.rpc'));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/mailMessage/mailMessage.rpc'));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x10')));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0x11')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x12')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x13')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x14')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/faxMessage/faxMessage.rpc'));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/faxQueue/faxQueue.rpc'));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0x15')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/smsAccount/smsAccount.rpc'));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0x16')));_0x5aad4a=_['merge'](_0x5aad4a,require('../api/smsMessage/smsMessage.rpc'));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x17')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x18')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x19')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x1a')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x1b')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x1c')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x1d')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x1e')));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0x1f')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x20')));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0x21')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x22')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x23')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x24')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x25')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x26')));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0x27')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/sound/sound.rpc'));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x28')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x29')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x2a')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x2b')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x2c')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x2d')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x2e')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x2f')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x30')));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0x31')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x32')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x33')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x34')));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0x35')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x36')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x37')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x38')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x39')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/campaign/campaign.rpc'));_0x5aad4a=_['merge'](_0x5aad4a,require(_0x11c5('0x3a')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x3b')));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x5aad4a=_['merge'](_0x5aad4a,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5aad4a=_[_0x11c5('0x4')](_0x5aad4a,require(_0x11c5('0x3c')));var _0x185bb8=jayson[_0x11c5('0x3d')](_0x5aad4a)[_0x11c5('0x3e')]();var _0x205385=config[_0x11c5('0x3f')]['port']||config[_0x11c5('0x40')]+0x1;var _0x1bc15e=config[_0x11c5('0x3f')]['ip']||'localhost';_0x185bb8['on'](_0x11c5('0x41'),function(_0xc5a387){return _0x28a6db(_0xc5a387);});_0x185bb8[_0x11c5('0x3')](_0x205385,_0x1bc15e,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1bc15e,_0x205385);require('../config/triggers')[_0x11c5('0x42')]();return _0x55e2fe(_0x11c5('0x43')+_0x1bc15e+':'+_0x205385);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index d36a044..9422b52 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 _0xf03a=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','lodash','events','EventEmitter','./reply','call','setEncoding','setTimeout','utf8','headers','emit','ready','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','replace','result=','indexOf','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','answer','ANSWER','getData'];(function(_0x5837b1,_0x54229a){var _0x490d8b=function(_0x3af82d){while(--_0x3af82d){_0x5837b1['push'](_0x5837b1['shift']());}};_0x490d8b(++_0x54229a);}(_0xf03a,0x1a0));var _0xaf03=function(_0x4c52a7,_0x202922){_0x4c52a7=_0x4c52a7-0x0;var _0x2c4023=_0xf03a[_0x4c52a7];return _0x2c4023;};'use strict';var util=require('util');var _=require(_0xaf03('0x0'));var EventEmitter=require(_0xaf03('0x1'))[_0xaf03('0x2')];var AGIReply=require(_0xaf03('0x3'));var AGIError=require('./error');function AGIChannel(_0x41924e){var _0xfe64f3=this,_0x4f13f3=new AGIReply(),_0x3aa47d=![],_0x10a6a5={};EventEmitter[_0xaf03('0x4')](_0xfe64f3);_0x41924e[_0xaf03('0x5')]('utf8');_0x41924e[_0xaf03('0x6')](0x8*0x3c*0x3c*0x3e8);_0x4f13f3['setEncoding'](_0xaf03('0x7'));_0x4f13f3['on'](_0xaf03('0x8'),function(_0x33a463){for(var _0x28127e in _0x33a463){_0xfe64f3[_0x28127e]=_0x33a463[_0x28127e];}_0xfe64f3[_0xaf03('0x9')](_0xaf03('0xa'));});_0x4f13f3['on']('line',function(_0x1f3a5c){if(_0x1f3a5c[_0xaf03('0xb')]()==_0xaf03('0xc')){_0xfe64f3[_0xaf03('0x9')](_0xaf03('0xc'));return;}if(_0x1f3a5c['substring'](0x0,0xb)==_0xaf03('0xd')){_0x3aa47d=!![];}if(_0x3aa47d){_0x10a6a5['rx']+=_0x1f3a5c+'\x0a';if(_0x1f3a5c[_0xaf03('0xe')](_0xaf03('0xf'))!=-0x1){_0x3aa47d=![];}}else{_0x10a6a5['rx']=_0x1f3a5c;}if(_0x3aa47d){return;}if(typeof _0x10a6a5['cb']==_0xaf03('0x10')){var _0x37156e=_0x10a6a5['rx']['substring'](0x0,0x3),_0x216ccd=null,_0x2b1ccf=null;_0x37156e=parseInt(_0x37156e);if(isNaN(_0x37156e)){_0x10a6a5['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x37156e!=0xc8){_0x10a6a5['cb'](null,{'code':_0x37156e,'result':-0x1,'extra':'KO'});return;}_0x216ccd=_0x10a6a5['rx'][_0xaf03('0x11')](0x4)[_0xaf03('0x12')](_0xaf03('0x13'),'');if(_0x216ccd['indexOf']('\x20')!=-0x1){_0x216ccd=_0x216ccd['substr'](0x0,_0x216ccd[_0xaf03('0x14')]('\x20'));}if(_[_0xaf03('0x15')](_0x216ccd,'-1')){_0x216ccd=parseInt(_0x216ccd);}_0x2b1ccf=_0x10a6a5['rx'][_0xaf03('0x16')]('\x20');if(_0x2b1ccf[_0xaf03('0x17')]==0x3){_0x2b1ccf=_0x2b1ccf[0x2][_0xaf03('0x11')](0x1,_0x2b1ccf[0x2][_0xaf03('0x17')]-0x1);}else if(_0x2b1ccf['length']>0x3){var _0xcdc24=/\((.+)\)/;var _0x136ad9=_0x10a6a5['rx'][_0xaf03('0x18')](_0xcdc24);if(_0x136ad9){_0x2b1ccf=_0x136ad9[0x1];}else{_0x2b1ccf=null;}}else{_0x2b1ccf=null;}_0x10a6a5['cb'](null,{'code':_0x37156e,'result':_0x216ccd,'extra':_0x2b1ccf});}});_0x41924e['on'](_0xaf03('0x19'),function(_0x24a074){_0xfe64f3[_0xaf03('0x9')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x24a074[_0xaf03('0x1a')]));});_0x41924e['on'](_0xaf03('0x1b'),function(){_0xfe64f3[_0xaf03('0x9')](_0xaf03('0x1b'),new AGIError(_0xaf03('0x1c')));});_0x41924e['on']('timeout',function(){_0xfe64f3[_0xaf03('0x9')]('timeout',new AGIError(_0xaf03('0x1d')));_0x41924e[_0xaf03('0x1e')]();});_0x41924e[_0xaf03('0x1f')](_0x4f13f3);this[_0xaf03('0x20')]=function(_0x2962f5,_0x3664b6){var _0x2962f5=_0x2962f5||'',_0x3664b6=typeof _0x3664b6==_0xaf03('0x10')?_0x3664b6:new Function();_0x10a6a5={'tx':_0x2962f5,'rx':'','cb':_0x3664b6};_0x41924e[_0xaf03('0x21')](_0x2962f5+'\x0a');},this[_0xaf03('0x1b')]=function(){_0x41924e['destroy']();};}util[_0xaf03('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xaf03('0x23')][_0xaf03('0x24')]=function(_0x21b865){return this['command']['sync'](this,_0x21b865);};AGIChannel[_0xaf03('0x23')][_0xaf03('0x25')]=function(){return this['sendRequest'](_0xaf03('0x26'));};AGIChannel[_0xaf03('0x23')][_0xaf03('0x27')]=function(_0x1b1ac8,_0x25115f,_0x148227){_0x1b1ac8=_0x1b1ac8===undefined?'beep':_0x1b1ac8;_0x25115f=_0x25115f===undefined?'5':_0x25115f;_0x148227=_0x148227===undefined?'1':_0x148227;return this['sendRequest'](util[_0xaf03('0x28')](_0xaf03('0x29'),_0x1b1ac8,_0x25115f*0x3e8,_0x148227));};AGIChannel[_0xaf03('0x23')][_0xaf03('0x2a')]=function(_0x416728){_0x416728=_0x416728||_0xaf03('0x2b');return this[_0xaf03('0x24')](util[_0xaf03('0x28')](_0xaf03('0x2c'),_0x416728));};AGIChannel[_0xaf03('0x23')][_0xaf03('0x2d')]=function(_0x1d75f5,_0xe05319){if(_['isArray'](_0xe05319)){return this[_0xaf03('0x24')](util[_0xaf03('0x28')]('EXEC\x20%s\x20%s',_0x1d75f5,_0xe05319[_0xaf03('0x2e')](',')));}return this['sendRequest'](util[_0xaf03('0x28')](_0xaf03('0x2f'),_0x1d75f5,_0xe05319));};AGIChannel[_0xaf03('0x23')][_0xaf03('0x30')]=function(_0xbe619e){return this[_0xaf03('0x24')](util['format'](_0xaf03('0x31'),_0xbe619e));};AGIChannel['prototype'][_0xaf03('0x32')]=function(_0x27c443){return this[_0xaf03('0x24')](util[_0xaf03('0x28')]('SET\x20EXTENSION\x20%s',_0x27c443));};AGIChannel['prototype']['setPriority']=function(_0x450238){return this[_0xaf03('0x24')](util[_0xaf03('0x28')](_0xaf03('0x33'),_0x450238));};AGIChannel['prototype'][_0xaf03('0xc')]=function(){return this[_0xaf03('0x24')](_0xaf03('0x34'));};AGIChannel[_0xaf03('0x23')]['setVariable']=function(_0x233f73,_0x5f17de){var _0x3eae73=_[_0xaf03('0x35')](_0x5f17de)||_[_0xaf03('0x36')](_0x5f17de)?_0x5f17de[_0xaf03('0x37')]():_0x5f17de;return this[_0xaf03('0x24')](util[_0xaf03('0x28')](_0xaf03('0x38'),_0x233f73,_0x3eae73?_0x3eae73[_0xaf03('0x37')]()[_0xaf03('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xaf03('0x39')]=function(_0x14a32f,_0x304c3f){return this[_0xaf03('0x24')](util[_0xaf03('0x28')]('SAY\x20NUMBER\x20%s\x20%s',_0x14a32f,_0x304c3f));};AGIChannel[_0xaf03('0x23')]['sayDigits']=function(_0xe5df11,_0x477b31){return this[_0xaf03('0x24')](util[_0xaf03('0x28')]('SAY\x20DIGITS\x20%s\x20%s',_0xe5df11,_0x477b31));};AGIChannel[_0xaf03('0x23')][_0xaf03('0x3a')]=function(_0x41a323,_0x4034b4){return this[_0xaf03('0x24')](util[_0xaf03('0x28')](_0xaf03('0x3b'),_0x41a323,_0x4034b4));};AGIChannel['prototype']['continueAt']=function(_0x2e5c2a,_0x4eaf92,_0xb5581d){_0x4eaf92=_0x4eaf92||this[_0xaf03('0x3c')];_0xb5581d=_0xb5581d||0x1;this[_0xaf03('0x30')](_0x2e5c2a);this[_0xaf03('0x32')](_0x4eaf92);this[_0xaf03('0x3d')](_0xb5581d);return this['noop'](util[_0xaf03('0x28')](_0xaf03('0x3e'),_0x2e5c2a,_0x4eaf92,_0xb5581d));};AGIChannel[_0xaf03('0x23')][_0xaf03('0x3f')]=function(_0x11c11e){return this[_0xaf03('0x24')](util[_0xaf03('0x28')](_0xaf03('0x40'),_0x11c11e));};AGIChannel['prototype'][_0xaf03('0x41')]=function(_0x196744,_0x1344d0,_0x41f6f1,_0x5dcd7b,_0x149706,_0x3d2e3){_0x1344d0=_0x1344d0||_0xaf03('0x42');_0x41f6f1=_0x41f6f1||'';_0x5dcd7b=_0x5dcd7b===undefined?-0x1:_0x5dcd7b==='-1'?-0x1:_0x5dcd7b*0x3e8;_0x149706=_0x149706===undefined?'':'s='+_0x149706;_0x3d2e3=_0x3d2e3?_0xaf03('0x43'):'';return this[_0xaf03('0x24')](util[_0xaf03('0x28')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x196744,_0x1344d0,_0x41f6f1,_0x5dcd7b,_0x3d2e3,_0x149706));};AGIChannel[_0xaf03('0x23')][_0xaf03('0x44')]=function(_0x747a09,_0x1d4a6e){_0x1d4a6e=_0x1d4a6e||'';return this['sendRequest'](util[_0xaf03('0x28')](_0xaf03('0x45'),_0x747a09,_0x1d4a6e));};AGIChannel[_0xaf03('0x23')][_0xaf03('0x46')]=function(_0x2ad042){return this[_0xaf03('0x2d')](_0xaf03('0x47'),_0x2ad042);};AGIChannel['prototype'][_0xaf03('0x48')]=function(_0x4466bc){return this[_0xaf03('0x2d')](_0xaf03('0x49'),_0x4466bc);};AGIChannel['prototype'][_0xaf03('0x19')]=function(_0x538fef,_0x5a073b){this[_0xaf03('0x2a')](util[_0xaf03('0x28')](_0xaf03('0x4a'),_0x538fef['id'],_0x538fef['label'],_0x5a073b));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xaf03('0x4b')]=AGIChannel; \ No newline at end of file +var _0xbc00=['setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./error','utf8','setTimeout','setEncoding','headers','emit','ready','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','result=','indexOf','substr','startsWith','split','length','match','error','code','close','timeout','destroy','pipe','command','function','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20EXTENSION\x20%s'];(function(_0x5d587,_0x5aeaf4){var _0x5b8b1e=function(_0x84b227){while(--_0x84b227){_0x5d587['push'](_0x5d587['shift']());}};_0x5b8b1e(++_0x5aeaf4);}(_0xbc00,0x107));var _0x0bc0=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0xbc00[_0x2becba];return _0x90b5dd;};'use strict';var util=require(_0x0bc0('0x0'));var _=require(_0x0bc0('0x1'));var EventEmitter=require('events')[_0x0bc0('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x0bc0('0x3'));function AGIChannel(_0x1d4ea5){var _0x4635b4=this,_0x5d2bba=new AGIReply(),_0x41c332=![],_0x81c327={};EventEmitter['call'](_0x4635b4);_0x1d4ea5['setEncoding'](_0x0bc0('0x4'));_0x1d4ea5[_0x0bc0('0x5')](0x8*0x3c*0x3c*0x3e8);_0x5d2bba[_0x0bc0('0x6')](_0x0bc0('0x4'));_0x5d2bba['on'](_0x0bc0('0x7'),function(_0x45c25e){for(var _0x3e77d4 in _0x45c25e){_0x4635b4[_0x3e77d4]=_0x45c25e[_0x3e77d4];}_0x4635b4[_0x0bc0('0x8')](_0x0bc0('0x9'));});_0x5d2bba['on']('line',function(_0xf20ed5){if(_0xf20ed5['toLowerCase']()==_0x0bc0('0xa')){_0x4635b4[_0x0bc0('0x8')](_0x0bc0('0xa'));return;}if(_0xf20ed5[_0x0bc0('0xb')](0x0,0xb)==_0x0bc0('0xc')){_0x41c332=!![];}if(_0x41c332){_0x81c327['rx']+=_0xf20ed5+'\x0a';if(_0xf20ed5[_0x0bc0('0xd')](_0x0bc0('0xe'))!=-0x1){_0x41c332=![];}}else{_0x81c327['rx']=_0xf20ed5;}if(_0x41c332){return;}if(typeof _0x81c327['cb']=='function'){var _0x10021d=_0x81c327['rx'][_0x0bc0('0xb')](0x0,0x3),_0x15afb2=null,_0x1ed38b=null;_0x10021d=parseInt(_0x10021d);if(isNaN(_0x10021d)){_0x81c327['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x10021d!=0xc8){_0x81c327['cb'](null,{'code':_0x10021d,'result':-0x1,'extra':'KO'});return;}_0x15afb2=_0x81c327['rx'][_0x0bc0('0xb')](0x4)['replace'](_0x0bc0('0xf'),'');if(_0x15afb2[_0x0bc0('0x10')]('\x20')!=-0x1){_0x15afb2=_0x15afb2[_0x0bc0('0x11')](0x0,_0x15afb2[_0x0bc0('0x10')]('\x20'));}if(_[_0x0bc0('0x12')](_0x15afb2,'-1')){_0x15afb2=parseInt(_0x15afb2);}_0x1ed38b=_0x81c327['rx'][_0x0bc0('0x13')]('\x20');if(_0x1ed38b['length']==0x3){_0x1ed38b=_0x1ed38b[0x2][_0x0bc0('0xb')](0x1,_0x1ed38b[0x2][_0x0bc0('0x14')]-0x1);}else if(_0x1ed38b['length']>0x3){var _0x3ee10b=/\((.+)\)/;var _0x1a8bd6=_0x81c327['rx'][_0x0bc0('0x15')](_0x3ee10b);if(_0x1a8bd6){_0x1ed38b=_0x1a8bd6[0x1];}else{_0x1ed38b=null;}}else{_0x1ed38b=null;}_0x81c327['cb'](null,{'code':_0x10021d,'result':_0x15afb2,'extra':_0x1ed38b});}});_0x1d4ea5['on'](_0x0bc0('0x16'),function(_0x286539){_0x4635b4[_0x0bc0('0x8')](_0x0bc0('0x16'),new AGIError('E_AGI_SOCKET_ERROR',_0x286539[_0x0bc0('0x17')]));});_0x1d4ea5['on'](_0x0bc0('0x18'),function(){_0x4635b4[_0x0bc0('0x8')](_0x0bc0('0x18'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x1d4ea5['on'](_0x0bc0('0x19'),function(){_0x4635b4[_0x0bc0('0x8')](_0x0bc0('0x19'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x1d4ea5[_0x0bc0('0x1a')]();});_0x1d4ea5[_0x0bc0('0x1b')](_0x5d2bba);this[_0x0bc0('0x1c')]=function(_0xa61eaf,_0x45cdc3){var _0xa61eaf=_0xa61eaf||'',_0x45cdc3=typeof _0x45cdc3==_0x0bc0('0x1d')?_0x45cdc3:new Function();_0x81c327={'tx':_0xa61eaf,'rx':'','cb':_0x45cdc3};_0x1d4ea5[_0x0bc0('0x1e')](_0xa61eaf+'\x0a');},this[_0x0bc0('0x18')]=function(){_0x1d4ea5[_0x0bc0('0x1a')]();};}util[_0x0bc0('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x21')]=function(_0xa94c49){return this[_0x0bc0('0x1c')][_0x0bc0('0x22')](this,_0xa94c49);};AGIChannel['prototype'][_0x0bc0('0x23')]=function(){return this['sendRequest'](_0x0bc0('0x24'));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x25')]=function(_0x382f2e,_0x40c5f5,_0x4cd7d1){_0x382f2e=_0x382f2e===undefined?_0x0bc0('0x26'):_0x382f2e;_0x40c5f5=_0x40c5f5===undefined?'5':_0x40c5f5;_0x4cd7d1=_0x4cd7d1===undefined?'1':_0x4cd7d1;return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x28'),_0x382f2e,_0x40c5f5*0x3e8,_0x4cd7d1));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x29')]=function(_0x3d9a3b){_0x3d9a3b=_0x3d9a3b||_0x0bc0('0x2a');return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x2b'),_0x3d9a3b));};AGIChannel['prototype'][_0x0bc0('0x2c')]=function(_0x389e30,_0x4624aa){if(_['isArray'](_0x4624aa)){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x2d'),_0x389e30,_0x4624aa[_0x0bc0('0x2e')](',')));}return this['sendRequest'](util[_0x0bc0('0x27')](_0x0bc0('0x2d'),_0x389e30,_0x4624aa));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x2f')]=function(_0x1733d6){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')]('SET\x20CONTEXT\x20%s',_0x1733d6));};AGIChannel['prototype']['setExtension']=function(_0x3fef87){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x30'),_0x3fef87));};AGIChannel['prototype'][_0x0bc0('0x31')]=function(_0x23d5ad){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x32'),_0x23d5ad));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0xa')]=function(){return this[_0x0bc0('0x21')](_0x0bc0('0x33'));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x34')]=function(_0x1659d3,_0x4ad72a){var _0x51d49e=_[_0x0bc0('0x35')](_0x4ad72a)||_['isNumber'](_0x4ad72a)?_0x4ad72a[_0x0bc0('0x36')]():_0x4ad72a;return this['sendRequest'](util['format'](_0x0bc0('0x37'),_0x1659d3,_0x51d49e?_0x51d49e[_0x0bc0('0x36')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x38')]=function(_0x50606a,_0x4013b1){return this['sendRequest'](util[_0x0bc0('0x27')](_0x0bc0('0x39'),_0x50606a,_0x4013b1));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x3a')]=function(_0x13b75e,_0xbe41c8){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x3b'),_0x13b75e,_0xbe41c8));};AGIChannel[_0x0bc0('0x20')]['sayPhonetic']=function(_0x5ed9ab,_0xd76926){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x3c'),_0x5ed9ab,_0xd76926));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x3d')]=function(_0x111cdc,_0x305c97,_0x12db1a){_0x305c97=_0x305c97||this[_0x0bc0('0x3e')];_0x12db1a=_0x12db1a||0x1;this['setContext'](_0x111cdc);this[_0x0bc0('0x3f')](_0x305c97);this[_0x0bc0('0x31')](_0x12db1a);return this[_0x0bc0('0x29')](util['format'](_0x0bc0('0x40'),_0x111cdc,_0x305c97,_0x12db1a));};AGIChannel['prototype']['getVariable']=function(_0x408f5b){return this[_0x0bc0('0x21')](util[_0x0bc0('0x27')](_0x0bc0('0x41'),_0x408f5b));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x42')]=function(_0x58dc11,_0x202c04,_0x3d1e7f,_0x279be2,_0x48616d,_0x6bfd68){_0x202c04=_0x202c04||_0x0bc0('0x43');_0x3d1e7f=_0x3d1e7f||'';_0x279be2=_0x279be2===undefined?-0x1:_0x279be2==='-1'?-0x1:_0x279be2*0x3e8;_0x48616d=_0x48616d===undefined?'':'s='+_0x48616d;_0x6bfd68=_0x6bfd68?_0x0bc0('0x44'):'';return this['sendRequest'](util[_0x0bc0('0x27')](_0x0bc0('0x45'),_0x58dc11,_0x202c04,_0x3d1e7f,_0x279be2,_0x6bfd68,_0x48616d));};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x46')]=function(_0x55d189,_0x6013f7){_0x6013f7=_0x6013f7||'';return this[_0x0bc0('0x21')](util['format'](_0x0bc0('0x47'),_0x55d189,_0x6013f7));};AGIChannel[_0x0bc0('0x20')]['agi']=function(_0x16425e){return this['exec'](_0x0bc0('0x48'),_0x16425e);};AGIChannel[_0x0bc0('0x20')][_0x0bc0('0x49')]=function(_0x28e497){return this[_0x0bc0('0x2c')](_0x0bc0('0x4a'),_0x28e497);};AGIChannel['prototype'][_0x0bc0('0x16')]=function(_0x95fa88,_0x55fbc1){this['noop'](util[_0x0bc0('0x27')](_0x0bc0('0x4b'),_0x95fa88['id'],_0x95fa88[_0x0bc0('0x4c')],_0x55fbc1));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0bc0('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index c44c1cf..2957d57 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 _0x4dd4=['format','apply','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\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push'];(function(_0x5b23ad,_0x44bc95){var _0x223d52=function(_0x1017d7){while(--_0x1017d7){_0x5b23ad['push'](_0x5b23ad['shift']());}};_0x223d52(++_0x44bc95);}(_0x4dd4,0x194));var _0x44dd=function(_0x33c8ea,_0x36f559){_0x33c8ea=_0x33c8ea-0x0;var _0x259834=_0x4dd4[_0x33c8ea];return _0x259834;};'use strict';var util=require(_0x44dd('0x0'));var error={'E_AGI_UNDEFINED':_0x44dd('0x1'),'E_AGI_ARGUMENT_PORT':_0x44dd('0x2'),'E_AGI_SERVER_ERROR':_0x44dd('0x3'),'E_AGI_SERVER_CLOSE':_0x44dd('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x44dd('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x44dd('0x6'),'E_AGI_SOCKET_ERROR':_0x44dd('0x7'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x44dd('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x44dd('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x722f38){var _0x722f38=_0x722f38||null,_0x257c20=_0x257c20||[],_0x4b1efb=0x1,_0x56254c='';if(!error[_0x722f38]){_0x722f38=_0x44dd('0xa');}_0x257c20[_0x44dd('0xb')](error[_0x722f38]);while(arguments[_0x4b1efb]){_0x257c20[_0x44dd('0xb')](arguments[_0x4b1efb]);_0x4b1efb++;}_0x56254c=util[_0x44dd('0xc')][_0x44dd('0xd')](util,_0x257c20);this['message']=_0x56254c;this[_0x44dd('0xe')]=_0x722f38;}module[_0x44dd('0xf')]=AGIError; \ No newline at end of file +var _0xef8c=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.'];(function(_0x4887ef,_0xf947c1){var _0x44dd61=function(_0x22e6e9){while(--_0x22e6e9){_0x4887ef['push'](_0x4887ef['shift']());}};_0x44dd61(++_0xf947c1);}(_0xef8c,0x18c));var _0xcef8=function(_0x298632,_0xfaac03){_0x298632=_0x298632-0x0;var _0xfa7deb=_0xef8c[_0x298632];return _0xfa7deb;};'use strict';var util=require(_0xcef8('0x0'));var error={'E_AGI_UNDEFINED':_0xcef8('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xcef8('0x2'),'E_AGI_SERVER_CLOSE':_0xcef8('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xcef8('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xcef8('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xcef8('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xcef8('0x7'),'E_AGI_IVR_ENTRY':_0xcef8('0x8')};function AGIError(_0x479cb6){var _0x479cb6=_0x479cb6||null,_0x4d6887=_0x4d6887||[],_0x5464a9=0x1,_0x5d9f79='';if(!error[_0x479cb6]){_0x479cb6=_0xcef8('0x9');}_0x4d6887[_0xcef8('0xa')](error[_0x479cb6]);while(arguments[_0x5464a9]){_0x4d6887[_0xcef8('0xa')](arguments[_0x5464a9]);_0x5464a9++;}_0x5d9f79=util[_0xcef8('0xb')][_0xcef8('0xc')](util,_0x4d6887);this[_0xcef8('0xd')]=_0x5d9f79;this[_0xcef8('0xe')]=_0x479cb6;}module[_0xcef8('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 c74470e..1da655c 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 _0x0b57=['getdigits','edges','numberOfEdges','prototype','vertices','addEdge','push','size','getVertex','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','agicommand','vswitch','target','default','menu','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi'];(function(_0x1edc03,_0x77eced){var _0x103106=function(_0x4851a3){while(--_0x4851a3){_0x1edc03['push'](_0x1edc03['shift']());}};_0x103106(++_0x77eced);}(_0x0b57,0xb1));var _0x70b5=function(_0x4e1b59,_0x4472c9){_0x4e1b59=_0x4e1b59-0x0;var _0x35efc5=_0x0b57[_0x4e1b59];return _0x35efc5;};'use strict';var _=require(_0x70b5('0x0'));var logger=require(_0x70b5('0x1'))(_0x70b5('0x2'));var verticesWithRetry=['menu',_0x70b5('0x3'),'getsecretdigits'];var Graph=function(){this['vertices']={};this[_0x70b5('0x4')]={};this[_0x70b5('0x5')]=0x0;};Graph[_0x70b5('0x6')]['addVertex']=function(_0x1a3c7a){this[_0x70b5('0x7')][_0x1a3c7a['id']]=_0x1a3c7a;this['edges'][_0x1a3c7a['id']]=[];};Graph[_0x70b5('0x6')][_0x70b5('0x8')]=function(_0x254197,_0x3cf830,_0x5220d0){this[_0x70b5('0x4')][_0x254197][_0x70b5('0x9')]({'target':_0x3cf830,'condition':_0x5220d0});this[_0x70b5('0x5')]+=0x1;};Graph[_0x70b5('0x6')][_0x70b5('0xa')]=function(){return _[_0x70b5('0xa')](this['vertices']);};Graph['prototype']['relations']=function(){return this['numberOfEdges'];};Graph['prototype'][_0x70b5('0xb')]=function(_0x2a2df2){return this['vertices'][_0x2a2df2];};Graph[_0x70b5('0x6')]['traverseBFS']=function(_0x174c00,_0x46596a){if(!this[_0x70b5('0x7')][_0x174c00]){return logger['info'](_0x70b5('0xc'));}var _0x5f58f4=_0x46596a(this[_0x70b5('0x7')][_0x174c00]);if(!_0x5f58f4){return logger[_0x70b5('0xd')](_0x70b5('0xe'));}if(this[_0x70b5('0x4')][_0x174c00][_0x70b5('0xf')]===0x0){return logger[_0x70b5('0xd')](_0x70b5('0x10'));}for(var _0x58804d=0x0,_0x1fb3b6=[],_0xe4a343=![];_0x58804d\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','substring','debug','variables','stringify','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','listening','close','projectUpdate','util','../../config/logger','agi','./rpc'];(function(_0x5e6c33,_0x4f157a){var _0x142bc9=function(_0x2d2415){while(--_0x2d2415){_0x5e6c33['push'](_0x5e6c33['shift']());}};_0x142bc9(++_0x4f157a);}(_0x12e9,0x66));var _0x912e=function(_0xc80177,_0x2f1a5c){_0xc80177=_0xc80177-0x0;var _0x4dd84e=_0x12e9[_0xc80177];return _0x4dd84e;};'use strict';var _=require('lodash');var syncho=require('syncho');var util=require(_0x912e('0x0'));var config=require('../../config/environment');var logger=require(_0x912e('0x1'))(_0x912e('0x2'));var utilLicense=require('../../config/license/util');var rpc=require(_0x912e('0x3'));var Project=require(_0x912e('0x4'));var projects=[];config['agi']=_[_0x912e('0x5')](config[_0x912e('0x2')],{'ip':_0x912e('0x6'),'port':0x11dd});function connectionHandler(_0x31622c){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x31622c);agiHandler(_0x31622c);}catch(_0x2e950a){logger[_0x912e('0x7')](_0x2e950a[_0x912e('0x8')]);}});});}function projectUpdateHandler(_0x7ac782){try{var _0x1d9857=_['findIndex'](projects,['id',_0x7ac782['id']]);if(_0x1d9857>-0x1){if(_0x7ac782['deleted']===!![]){projects['splice'](_0x1d9857,0x1);}else{projects[_0x1d9857]=_0x7ac782;}}else{projects[_0x912e('0x9')](_0x7ac782);}}catch(_0x2344a0){logger[_0x912e('0x7')](_0x2344a0[_0x912e('0x8')]);}}function listeningHandler(){console[_0x912e('0xa')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x912e('0x2')][_0x912e('0xb')]);logger[_0x912e('0xc')](util[_0x912e('0xd')](_0x912e('0xe'),config[_0x912e('0x2')]['ip'],config[_0x912e('0x2')][_0x912e('0xb')]));}function errorHandler(_0x3c153b){if(_0x3c153b&&_0x3c153b[_0x912e('0xf')]&&_0x3c153b[_0x912e('0x10')]){logger[_0x912e('0x7')](util['format'](_0x912e('0x11'),_0x3c153b['name'],_0x3c153b['message']));}else{logger[_0x912e('0x7')](util[_0x912e('0xd')](_0x912e('0x12'),_0x3c153b['stack']));}}function closeHandler(){logger['info'](util[_0x912e('0xd')](_0x912e('0x13'),this[_0x912e('0x14')],this['calleridname'],this[_0x912e('0x15')],this[_0x912e('0x16')],this[_0x912e('0x17')]));try{createSquareReport(this);}catch(_0x1d3345){logger[_0x912e('0x7')](_0x1d3345['stack']);}}function timeoutHandler(){logger[_0x912e('0xc')](util[_0x912e('0xd')](_0x912e('0x18'),this[_0x912e('0x14')],this[_0x912e('0x19')],this[_0x912e('0x15')],this[_0x912e('0x16')],this[_0x912e('0x17')]));}function hangupHandler(){logger[_0x912e('0xc')](util[_0x912e('0xd')](_0x912e('0x1a'),this['arg_1'],this[_0x912e('0x19')],this['callerid'],this[_0x912e('0x16')],this['uniqueid']));this[_0x912e('0x1b')]=!![];}function createSquareReport(_0x5e3562,_0x59feaa){rpc[_0x912e('0x1c')](_0x5e3562)[_0x912e('0x1d')](function(_0x892de0){if(_0x59feaa){_0x59feaa(null,_0x892de0);}})[_0x912e('0x1e')](function(_0x2bedf3){if(_0x59feaa){_0x59feaa(null,_0x2bedf3);}});}function setChannelVariables(_0x5ba003){for(var _0x92f64d in _0x5ba003){if(_0x5ba003[_0x912e('0x1f')](_0x92f64d)){if(_0x92f64d[_0x912e('0x20')]('agi_')===0x0){_0x5ba003[_0x92f64d[_0x912e('0x21')](0x4)]=_0x5ba003[_0x92f64d];delete _0x5ba003[_0x92f64d];}}}}function agiHandler(_0x52c388){logger[_0x912e('0x22')](_0x912e('0x23'),JSON[_0x912e('0x24')](_0x52c388,null,0x2));logger[_0x912e('0xc')](util[_0x912e('0xd')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x52c388[_0x912e('0x14')],_0x52c388[_0x912e('0x19')],_0x52c388[_0x912e('0x15')],_0x52c388['dnid'],_0x52c388[_0x912e('0x17')]));_0x52c388['on']('error',errorHandler);_0x52c388['on']('close',closeHandler);_0x52c388['on']('timeout',timeoutHandler);_0x52c388[_0x912e('0x1b')]=![];_0x52c388['on']('hangup',hangupHandler);var _0x4cbb33=_['find'](projects,[_0x912e('0xf'),_0x52c388[_0x912e('0x14')]]);if(!_0x4cbb33)return Project[_0x912e('0x25')](_0x52c388);if(!_0x4cbb33[_0x912e('0x26')])return Project[_0x912e('0x27')](_0x52c388);return Project[_0x912e('0x28')](_0x4cbb33,_0x52c388);}function main(){var _0x1d4294;return utilLicense[_0x912e('0x29')]()[_0x912e('0x1d')](function(_0x2c3993){if(!_0x2c3993)return;if(_0x2c3993[_0x912e('0x2a')]){if(_0x2c3993[_0x912e('0x2b')]&&_0x2c3993[_0x912e('0x2b')]>0x0){logger['info'](util['format'](_0x912e('0x2c'),_0x2c3993['callysquare']));_0x1d4294=_0x2c3993[_0x912e('0x2b')];}else{logger[_0x912e('0xc')](_0x912e('0x2d'));}}else{logger[_0x912e('0xc')](_0x912e('0x2e'));_0x1d4294=-0x1;}})[_0x912e('0x1d')](function(){return Project[_0x912e('0x2f')]();})[_0x912e('0x1d')](function(_0x7314f1){projects=_0x7314f1;return;})[_0x912e('0x1e')](function(_0x5dd9e9){logger[_0x912e('0x7')](_0x912e('0x30'),_0x5dd9e9[_0x912e('0x8')]);})[_0x912e('0x31')](function(){var _0xc8089b=require('./server')(config[_0x912e('0x2')]['port'],config[_0x912e('0x2')]['ip'],_0x1d4294);_0xc8089b['on'](_0x912e('0x7'),errorHandler);_0xc8089b['on'](_0x912e('0x32'),listeningHandler);_0xc8089b['on']('connection',connectionHandler);_0xc8089b['on'](_0x912e('0x33'),closeHandler);_0xc8089b['on'](_0x912e('0x34'),projectUpdateHandler);});}main(); \ No newline at end of file +var _0x38e4=['[%s]\x20%s','message','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','evtHangup','createSquareReport','catch','hasOwnProperty','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','production','handleUnpublished','initialize','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','projectUpdate','lodash','syncho','../../config/environment','../../config/logger','../../config/license/util','./rpc','./project','defaults','agi','127.0.0.1','nextTick','findIndex','deleted','splice','push','error','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name'];(function(_0x3fe99e,_0x5e3d2c){var _0xc50525=function(_0x4da8c9){while(--_0x4da8c9){_0x3fe99e['push'](_0x3fe99e['shift']());}};_0xc50525(++_0x5e3d2c);}(_0x38e4,0x9e));var _0x438e=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x38e4[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x438e('0x0'));var syncho=require(_0x438e('0x1'));var util=require('util');var config=require(_0x438e('0x2'));var logger=require(_0x438e('0x3'))('agi');var utilLicense=require(_0x438e('0x4'));var rpc=require(_0x438e('0x5'));var Project=require(_0x438e('0x6'));var projects=[];config['agi']=_[_0x438e('0x7')](config[_0x438e('0x8')],{'ip':_0x438e('0x9'),'port':0x11dd});function connectionHandler(_0x2c2a62){process[_0x438e('0xa')](function(){syncho(function(){try{setChannelVariables(_0x2c2a62);agiHandler(_0x2c2a62);}catch(_0x37a9ac){logger['error'](_0x37a9ac['stack']);}});});}function projectUpdateHandler(_0x4fd76e){try{var _0x4d5899=_[_0x438e('0xb')](projects,['id',_0x4fd76e['id']]);if(_0x4d5899>-0x1){if(_0x4fd76e[_0x438e('0xc')]===!![]){projects[_0x438e('0xd')](_0x4d5899,0x1);}else{projects[_0x4d5899]=_0x4fd76e;}}else{projects[_0x438e('0xe')](_0x4fd76e);}}catch(_0x4e4850){logger[_0x438e('0xf')](_0x4e4850['stack']);}}function listeningHandler(){console[_0x438e('0x10')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x438e('0x8')][_0x438e('0x11')]);logger[_0x438e('0x12')](util[_0x438e('0x13')](_0x438e('0x14'),config['agi']['ip'],config[_0x438e('0x8')][_0x438e('0x11')]));}function errorHandler(_0x3cf418){if(_0x3cf418&&_0x3cf418[_0x438e('0x15')]&&_0x3cf418['message']){logger['error'](util['format'](_0x438e('0x16'),_0x3cf418[_0x438e('0x15')],_0x3cf418[_0x438e('0x17')]));}else{logger[_0x438e('0xf')](util[_0x438e('0x13')](_0x438e('0x18'),_0x3cf418[_0x438e('0x19')]));}}function closeHandler(){logger['info'](util[_0x438e('0x13')](_0x438e('0x1a'),this[_0x438e('0x1b')],this[_0x438e('0x1c')],this[_0x438e('0x1d')],this[_0x438e('0x1e')],this['uniqueid']));try{createSquareReport(this);}catch(_0xb5d8f9){logger['error'](_0xb5d8f9['stack']);}}function timeoutHandler(){logger[_0x438e('0x12')](util[_0x438e('0x13')](_0x438e('0x1f'),this[_0x438e('0x1b')],this['calleridname'],this[_0x438e('0x1d')],this[_0x438e('0x1e')],this[_0x438e('0x20')]));}function hangupHandler(){logger[_0x438e('0x12')](util[_0x438e('0x13')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0x438e('0x1d')],this[_0x438e('0x1e')],this[_0x438e('0x20')]));this[_0x438e('0x21')]=!![];}function createSquareReport(_0x4270ff,_0x4b4785){rpc[_0x438e('0x22')](_0x4270ff)['then'](function(_0x243c16){if(_0x4b4785){_0x4b4785(null,_0x243c16);}})[_0x438e('0x23')](function(_0x2526f3){if(_0x4b4785){_0x4b4785(null,_0x2526f3);}});}function setChannelVariables(_0xa00035){for(var _0x3af05d in _0xa00035){if(_0xa00035[_0x438e('0x24')](_0x3af05d)){if(_0x3af05d['indexOf'](_0x438e('0x25'))===0x0){_0xa00035[_0x3af05d[_0x438e('0x26')](0x4)]=_0xa00035[_0x3af05d];delete _0xa00035[_0x3af05d];}}}}function agiHandler(_0x52f85c){logger[_0x438e('0x27')](_0x438e('0x28'),JSON[_0x438e('0x29')](_0x52f85c,null,0x2));logger['info'](util[_0x438e('0x13')](_0x438e('0x2a'),_0x52f85c[_0x438e('0x1b')],_0x52f85c[_0x438e('0x1c')],_0x52f85c['callerid'],_0x52f85c[_0x438e('0x1e')],_0x52f85c[_0x438e('0x20')]));_0x52f85c['on']('error',errorHandler);_0x52f85c['on']('close',closeHandler);_0x52f85c['on'](_0x438e('0x2b'),timeoutHandler);_0x52f85c[_0x438e('0x21')]=![];_0x52f85c['on'](_0x438e('0x2c'),hangupHandler);var _0x460fea=_['find'](projects,[_0x438e('0x15'),_0x52f85c[_0x438e('0x1b')]]);if(!_0x460fea)return Project['handleNotFound'](_0x52f85c);if(!_0x460fea[_0x438e('0x2d')])return Project[_0x438e('0x2e')](_0x52f85c);return Project[_0x438e('0x2f')](_0x460fea,_0x52f85c);}function main(){var _0x5c97af;return utilLicense[_0x438e('0x30')]()[_0x438e('0x31')](function(_0xa69def){if(!_0xa69def)return;if(_0xa69def[_0x438e('0x32')]){if(_0xa69def[_0x438e('0x33')]&&_0xa69def['callysquare']>0x0){logger[_0x438e('0x12')](util['format'](_0x438e('0x34'),_0xa69def['callysquare']));_0x5c97af=_0xa69def[_0x438e('0x33')];}else{logger[_0x438e('0x12')](_0x438e('0x35'));}}else{logger[_0x438e('0x12')](_0x438e('0x36'));_0x5c97af=-0x1;}})[_0x438e('0x31')](function(){return Project[_0x438e('0x37')]();})[_0x438e('0x31')](function(_0xf62c6b){projects=_0xf62c6b;return;})['catch'](function(_0x13f86f){logger[_0x438e('0xf')](_0x438e('0x38'),_0x13f86f[_0x438e('0x19')]);})[_0x438e('0x39')](function(){var _0x8fd1f1=require(_0x438e('0x3a'))(config[_0x438e('0x8')][_0x438e('0x11')],config[_0x438e('0x8')]['ip'],_0x5c97af);_0x8fd1f1['on'](_0x438e('0xf'),errorHandler);_0x8fd1f1['on']('listening',listeningHandler);_0x8fd1f1['on']('connection',connectionHandler);_0x8fd1f1['on']('close',closeHandler);_0x8fd1f1['on'](_0x438e('0x3b'),projectUpdateHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 32a791d..aed747c 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 _0x5f2b=['SendMail','bluebird','jayson/promise','client','http','request','then','error','message','result','catch'];(function(_0x40d8d7,_0x30dd5e){var _0x3454cc=function(_0x512c1b){while(--_0x512c1b){_0x40d8d7['push'](_0x40d8d7['shift']());}};_0x3454cc(++_0x30dd5e);}(_0x5f2b,0x198));var _0xb5f2=function(_0x333b16,_0xa82f1a){_0x333b16=_0x333b16-0x0;var _0x35d9ec=_0x5f2b[_0x333b16];return _0x35d9ec;};'use strict';var BPromise=require(_0xb5f2('0x0'));var jayson=require(_0xb5f2('0x1'));var client=jayson[_0xb5f2('0x2')][_0xb5f2('0x3')]({'port':0x232b});function request(_0x4cc158,_0x32a621){return new BPromise(function(_0x1c19c3,_0x2ee160){return client[_0xb5f2('0x4')](_0x4cc158,_0x32a621)[_0xb5f2('0x5')](function(_0x75e839){if(_0x75e839['error']){return _0x2ee160(_0x75e839[_0xb5f2('0x6')][_0xb5f2('0x7')]);}else{return _0x1c19c3(_0x75e839[_0xb5f2('0x8')]);}})[_0xb5f2('0x9')](function(_0x18d7ac){return _0x2ee160(_0x18d7ac);});});}exports['sendMailMessage']=function(_0x4e419f,_0x46cb24){return request(_0xb5f2('0xa'),{'account':_0x4e419f,'message':_0x46cb24});}; \ No newline at end of file +var _0xc34c=['sendMailMessage','SendMail','bluebird','jayson/promise','then','error','message','result','catch'];(function(_0x2dd834,_0x5c03ab){var _0x12f78d=function(_0x2855d9){while(--_0x2855d9){_0x2dd834['push'](_0x2dd834['shift']());}};_0x12f78d(++_0x5c03ab);}(_0xc34c,0x1bb));var _0xcc34=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc34c[_0x4a9fb1];return _0x348672;};'use strict';var BPromise=require(_0xcc34('0x0'));var jayson=require(_0xcc34('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x31fcbb,_0x27f233){return new BPromise(function(_0x22ac54,_0x51e726){return client['request'](_0x31fcbb,_0x27f233)[_0xcc34('0x2')](function(_0x35e2c4){if(_0x35e2c4['error']){return _0x51e726(_0x35e2c4[_0xcc34('0x3')][_0xcc34('0x4')]);}else{return _0x22ac54(_0x35e2c4[_0xcc34('0x5')]);}})[_0xcc34('0x6')](function(_0x418ab8){return _0x51e726(_0x418ab8);});});}exports[_0xcc34('0x7')]=function(_0x17e12b,_0x346fd2){return request(_0xcc34('0x8'),{'account':_0x17e12b,'message':_0x346fd2});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index cb210a5..8df0367 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e5b=['response','code','result','evtHangup','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','clear','vertex','isUndefined','agicommand\x20not\x20found','stack','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','close','Project\x20%s\x20not\x20published','lodash','moment','xml2json','util','../../config/logger','agi','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','value','toJson','root','inspect','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','arg_1','calleridname','callerid','uniqueid','traverseBFS','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x4e5b,0x158));var _0xb4e5=function(_0x2c09ee,_0x12794b){_0x2c09ee=_0x2c09ee-0x0;var _0x3a27a5=_0x4e5b[_0x2c09ee];return _0x3a27a5;};'use strict';var _=require(_0xb4e5('0x0'));var moment=require(_0xb4e5('0x1'));var parser=require(_0xb4e5('0x2'));var util=require(_0xb4e5('0x3'));var logger=require(_0xb4e5('0x4'))(_0xb4e5('0x5'));var rpc=require('./rpc');var mailRpc=require(_0xb4e5('0x6'));var Graph=require(_0xb4e5('0x7'));var Vertices=require(_0xb4e5('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xb4e5('0x9')]()[_0xb4e5('0xa')](function(_0x2792b2){logger[_0xb4e5('0xb')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x2792b2['stack']);return[];});}function addVertex(_0x2a8e91,_0x1daff3,_0xd489ae){_0x1daff3[_0xb4e5('0xc')]=_0xd489ae;if(_0x1daff3['hasOwnProperty'](_0xb4e5('0xd'))){_0x1daff3[_0xb4e5('0xe')]=parseInt(_0x1daff3['retry'],0xa);}_0x2a8e91[_0xb4e5('0xf')](_[_0xb4e5('0x10')](_0x1daff3,_0xb4e5('0x11')));}function initGraph(_0x337b26,_0x4db44e){var _0x57e1c8=new Graph();for(var _0x2d2451 in _0x337b26){if(_0x337b26[_0xb4e5('0x12')](_0x2d2451)){if(_[_0xb4e5('0x13')](_0x337b26[_0x2d2451])){for(var _0x38e7c4=0x0;_0x38e7c4<_0x337b26[_0x2d2451][_0xb4e5('0x14')];_0x38e7c4+=0x1){addVertex(_0x57e1c8,_0x337b26[_0x2d2451][_0x38e7c4],_0x2d2451);}}else{addVertex(_0x57e1c8,_0x337b26[_0x2d2451],_0x2d2451);}}}for(var _0x4e4efb=0x0;_0x4e4efb<_0x4db44e[_0xb4e5('0x14')];_0x4e4efb+=0x1){if(_0x4db44e[_0x4e4efb][_0xb4e5('0x15')]&&_0x4db44e[_0x4e4efb][_0xb4e5('0x16')]){_0x57e1c8[_0xb4e5('0x17')](_0x4db44e[_0x4e4efb][_0xb4e5('0x15')],_0x4db44e[_0x4e4efb][_0xb4e5('0x16')],_0x4db44e[_0x4e4efb][_0xb4e5('0x18')]);}}return _0x57e1c8;}function getRoot(_0x54ea3f){return parser[_0xb4e5('0x19')](_0x54ea3f,{'object':!![]})['mxGraphModel'][_0xb4e5('0x1a')];}function inspect(_0x4c0797){return util[_0xb4e5('0x1b')](_0x4c0797,{'showHidden':![],'depth':null});}function initialize(_0x205f7f,_0x55d36c){var _0x250ebb=getRoot(_0x205f7f[_0xb4e5('0x1c')]);if(!_0x250ebb||!_0x250ebb[_0xb4e5('0x1d')])return;var _0x49b3cd,_0x46f5f8,_0x391c20;logger[_0xb4e5('0x1e')](_0xb4e5('0x1a'),JSON[_0xb4e5('0x1f')](_0x250ebb,null,0x2));_0x55d36c[_0xb4e5('0x20')]=moment()[_0xb4e5('0x21')](_0xb4e5('0x22'));_0x49b3cd=initGraph(_[_0xb4e5('0x10')](_0x250ebb,_0xb4e5('0x11')),_0x250ebb[_0xb4e5('0x11')]);_0x46f5f8=new Vertices(_0x55d36c,rpc,mailRpc);logger[_0xb4e5('0x23')](util[_0xb4e5('0x21')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x55d36c[_0xb4e5('0x24')],_0x55d36c[_0xb4e5('0x25')],_0x55d36c[_0xb4e5('0x26')],_0x55d36c['dnid'],_0x55d36c[_0xb4e5('0x27')]));_0x49b3cd[_0xb4e5('0x28')](_0x250ebb[_0xb4e5('0x1d')]['id'],function(_0x89d726){try{_0x89d726=_0x46f5f8['clear'](_0x89d726);logger[_0xb4e5('0x1e')]('vertex',JSON[_0xb4e5('0x1f')](_0x89d726,null,0x2));if(_0x89d726['agicommand']===_0xb4e5('0x29')){logger[_0xb4e5('0x23')](_0xb4e5('0x2a'));_0x55d36c[_0xb4e5('0x2b')]=_0x89d726[_0xb4e5('0x2b')]||_0x55d36c[_0xb4e5('0x2b')];_0x55d36c[_0xb4e5('0x2c')]=_0x89d726[_0xb4e5('0x2c')];_0x55d36c[_0xb4e5('0x2d')]=_0x89d726['priority']?_0x89d726[_0xb4e5('0x2d')]-0x1:0x1;return null;}else if(_0x89d726&&_0x46f5f8[_0x89d726[_0xb4e5('0xc')]]){_0x391c20=_0x46f5f8[_0x89d726['agicommand']](_0x89d726);logger['info'](_0xb4e5('0x2e'),JSON[_0xb4e5('0x1f')](_0x391c20,null,0x2));if(_0x391c20&&_0x391c20[_0xb4e5('0x2f')]===AGI_CODE_SUCCESS&&_0x391c20[_0xb4e5('0x30')]!==AGI_RESULT_ERROR&&!_0x55d36c[_0xb4e5('0x31')]){logger[_0xb4e5('0x1e')](_0xb4e5('0x2e'),inspect(_0x391c20));return _['isUndefined'](_0x391c20[_0xb4e5('0x30')])?null:_0x391c20[_0xb4e5('0x30')][_0xb4e5('0x32')]();}else{logger['error']('response',inspect(_0x391c20));return null;}}else{logger[_0xb4e5('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x344c0d){logger[_0xb4e5('0xb')](_0x344c0d['stack']);return null;}});if(_0x250ebb[_0xb4e5('0x33')]){logger[_0xb4e5('0x23')](util[_0xb4e5('0x21')](_0xb4e5('0x34'),_0x55d36c[_0xb4e5('0x24')],_0x55d36c['calleridname'],_0x55d36c[_0xb4e5('0x26')],_0x55d36c[_0xb4e5('0x35')],_0x55d36c[_0xb4e5('0x27')]));_0x49b3cd[_0xb4e5('0x28')](_0x250ebb['finally']['id'],function(_0x2a7b0e){try{_0x2a7b0e=_0x46f5f8[_0xb4e5('0x36')](_0x2a7b0e);logger[_0xb4e5('0x1e')](_0xb4e5('0x37'),JSON[_0xb4e5('0x1f')](_0x2a7b0e,null,0x2));if(_0x2a7b0e&&_0x46f5f8[_0x2a7b0e[_0xb4e5('0xc')]]){_0x391c20=_0x46f5f8[_0x2a7b0e[_0xb4e5('0xc')]](_0x2a7b0e);if(_0x391c20){logger['debug'](_0xb4e5('0x2e'),inspect(_0x391c20));return _[_0xb4e5('0x38')](_0x391c20[_0xb4e5('0x30')])?null:_0x391c20['result']['toString']();}else{logger[_0xb4e5('0xb')](_0xb4e5('0x2e'),inspect(_0x391c20));return null;}}else{logger[_0xb4e5('0xb')](_0xb4e5('0x39'));return null;}}catch(_0x5d6191){logger[_0xb4e5('0xb')](_0x5d6191[_0xb4e5('0x3a')]);return null;}});}logger[_0xb4e5('0x23')](util['format'](_0xb4e5('0x3b'),_0x55d36c['arg_1'],_0x55d36c['calleridname'],_0x55d36c['callerid'],_0x55d36c[_0xb4e5('0x35')],_0x55d36c[_0xb4e5('0x27')]));logger[_0xb4e5('0x23')](util[_0xb4e5('0x21')](_0xb4e5('0x3c'),_0x55d36c[_0xb4e5('0x2b')],_0x55d36c['extension'],parseInt(_0x55d36c[_0xb4e5('0x2d')],0xa)+0x1));_0x55d36c[_0xb4e5('0x3d')](_0x55d36c[_0xb4e5('0x2b')],_0x55d36c[_0xb4e5('0x2c')],parseInt(_0x55d36c['priority'],0xa)+0x1);_0x55d36c['close']();}function handleNotFound(_0xc3d8c1){logger[_0xb4e5('0xb')](util[_0xb4e5('0x21')](_0xb4e5('0x3e'),_0xc3d8c1[_0xb4e5('0x24')]));_0xc3d8c1[_0xb4e5('0x3d')](_0xc3d8c1['context'],_0xc3d8c1['extension'],parseInt(_0xc3d8c1[_0xb4e5('0x2d')],0xa)+0x1);_0xc3d8c1[_0xb4e5('0x3f')]();}function handleUnpublished(_0x3e29c0){logger[_0xb4e5('0xb')](util[_0xb4e5('0x21')](_0xb4e5('0x40'),_0x3e29c0[_0xb4e5('0x24')]));_0x3e29c0[_0xb4e5('0x3d')](_0x3e29c0['context'],_0x3e29c0[_0xb4e5('0x2c')],parseInt(_0x3e29c0[_0xb4e5('0x2d')],0xa)+0x1);_0x3e29c0[_0xb4e5('0x3f')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x0550=['context','priority','code','result','evtHangup','isUndefined','toString','error','response','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','uniqueid','vertex','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','extension','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','catch','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','addEdge','toJson','root','inspect','production','debug','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','traverseBFS','clear','gotoc'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0550,0x8e));var _0x0055=function(_0x32497d,_0x2d305a){_0x32497d=_0x32497d-0x0;var _0x5e05aa=_0x0550[_0x32497d];return _0x5e05aa;};'use strict';var _=require('lodash');var moment=require('moment');var parser=require(_0x0055('0x0'));var util=require(_0x0055('0x1'));var logger=require(_0x0055('0x2'))(_0x0055('0x3'));var rpc=require(_0x0055('0x4'));var mailRpc=require(_0x0055('0x5'));var Graph=require(_0x0055('0x6'));var Vertices=require(_0x0055('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x0055('0x8')](function(_0x1cc429){logger['error']('Unable\x20to\x20download\x20CallySquare\x20projects',_0x1cc429[_0x0055('0x9')]);return[];});}function addVertex(_0x50a948,_0x51c434,_0x4cbe98){_0x51c434[_0x0055('0xa')]=_0x4cbe98;if(_0x51c434[_0x0055('0xb')](_0x0055('0xc'))){_0x51c434[_0x0055('0xd')]=parseInt(_0x51c434[_0x0055('0xc')],0xa);}_0x50a948[_0x0055('0xe')](_[_0x0055('0xf')](_0x51c434,_0x0055('0x10')));}function initGraph(_0x1957ec,_0xe8ae77){var _0x29c8bc=new Graph();for(var _0x4276e6 in _0x1957ec){if(_0x1957ec[_0x0055('0xb')](_0x4276e6)){if(_[_0x0055('0x11')](_0x1957ec[_0x4276e6])){for(var _0x54cd1b=0x0;_0x54cd1b<_0x1957ec[_0x4276e6]['length'];_0x54cd1b+=0x1){addVertex(_0x29c8bc,_0x1957ec[_0x4276e6][_0x54cd1b],_0x4276e6);}}else{addVertex(_0x29c8bc,_0x1957ec[_0x4276e6],_0x4276e6);}}}for(var _0xa900b3=0x0;_0xa900b3<_0xe8ae77[_0x0055('0x12')];_0xa900b3+=0x1){if(_0xe8ae77[_0xa900b3]['source']&&_0xe8ae77[_0xa900b3][_0x0055('0x13')]){_0x29c8bc[_0x0055('0x14')](_0xe8ae77[_0xa900b3]['source'],_0xe8ae77[_0xa900b3][_0x0055('0x13')],_0xe8ae77[_0xa900b3]['value']);}}return _0x29c8bc;}function getRoot(_0xaca59b){return parser[_0x0055('0x15')](_0xaca59b,{'object':!![]})['mxGraphModel'][_0x0055('0x16')];}function inspect(_0x30d837){return util[_0x0055('0x17')](_0x30d837,{'showHidden':![],'depth':null});}function initialize(_0x583c08,_0x4942f7){var _0x49a680=getRoot(_0x583c08[_0x0055('0x18')]);if(!_0x49a680||!_0x49a680['start'])return;var _0x4b631c,_0x114d05,_0x2dc570;logger[_0x0055('0x19')](_0x0055('0x16'),JSON[_0x0055('0x1a')](_0x49a680,null,0x2));_0x4942f7[_0x0055('0x1b')]=moment()['format'](_0x0055('0x1c'));_0x4b631c=initGraph(_[_0x0055('0xf')](_0x49a680,_0x0055('0x10')),_0x49a680[_0x0055('0x10')]);_0x114d05=new Vertices(_0x4942f7,rpc,mailRpc);logger[_0x0055('0x1d')](util[_0x0055('0x1e')](_0x0055('0x1f'),_0x4942f7[_0x0055('0x20')],_0x4942f7[_0x0055('0x21')],_0x4942f7['callerid'],_0x4942f7[_0x0055('0x22')],_0x4942f7['uniqueid']));_0x4b631c[_0x0055('0x23')](_0x49a680['start']['id'],function(_0x3cabec){try{_0x3cabec=_0x114d05[_0x0055('0x24')](_0x3cabec);logger[_0x0055('0x19')]('vertex',JSON['stringify'](_0x3cabec,null,0x2));if(_0x3cabec[_0x0055('0xa')]===_0x0055('0x25')){logger[_0x0055('0x1d')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x4942f7['context']=_0x3cabec[_0x0055('0x26')]||_0x4942f7['context'];_0x4942f7['extension']=_0x3cabec['extension'];_0x4942f7[_0x0055('0x27')]=_0x3cabec[_0x0055('0x27')]?_0x3cabec[_0x0055('0x27')]-0x1:0x1;return null;}else if(_0x3cabec&&_0x114d05[_0x3cabec[_0x0055('0xa')]]){_0x2dc570=_0x114d05[_0x3cabec['agicommand']](_0x3cabec);logger['info']('response',JSON[_0x0055('0x1a')](_0x2dc570,null,0x2));if(_0x2dc570&&_0x2dc570[_0x0055('0x28')]===AGI_CODE_SUCCESS&&_0x2dc570[_0x0055('0x29')]!==AGI_RESULT_ERROR&&!_0x4942f7[_0x0055('0x2a')]){logger[_0x0055('0x19')]('response',inspect(_0x2dc570));return _[_0x0055('0x2b')](_0x2dc570[_0x0055('0x29')])?null:_0x2dc570[_0x0055('0x29')][_0x0055('0x2c')]();}else{logger[_0x0055('0x2d')](_0x0055('0x2e'),inspect(_0x2dc570));return null;}}else{logger[_0x0055('0x2d')]('agicommand\x20not\x20found');return null;}}catch(_0x593394){logger[_0x0055('0x2d')](_0x593394[_0x0055('0x9')]);return null;}});if(_0x49a680[_0x0055('0x2f')]){logger[_0x0055('0x1d')](util[_0x0055('0x1e')](_0x0055('0x30'),_0x4942f7[_0x0055('0x20')],_0x4942f7['calleridname'],_0x4942f7[_0x0055('0x31')],_0x4942f7[_0x0055('0x22')],_0x4942f7[_0x0055('0x32')]));_0x4b631c[_0x0055('0x23')](_0x49a680[_0x0055('0x2f')]['id'],function(_0x3d3883){try{_0x3d3883=_0x114d05[_0x0055('0x24')](_0x3d3883);logger[_0x0055('0x19')](_0x0055('0x33'),JSON[_0x0055('0x1a')](_0x3d3883,null,0x2));if(_0x3d3883&&_0x114d05[_0x3d3883[_0x0055('0xa')]]){_0x2dc570=_0x114d05[_0x3d3883['agicommand']](_0x3d3883);if(_0x2dc570){logger[_0x0055('0x19')]('response',inspect(_0x2dc570));return _[_0x0055('0x2b')](_0x2dc570[_0x0055('0x29')])?null:_0x2dc570[_0x0055('0x29')][_0x0055('0x2c')]();}else{logger[_0x0055('0x2d')](_0x0055('0x2e'),inspect(_0x2dc570));return null;}}else{logger[_0x0055('0x2d')](_0x0055('0x34'));return null;}}catch(_0x511f94){logger['error'](_0x511f94[_0x0055('0x9')]);return null;}});}logger[_0x0055('0x1d')](util[_0x0055('0x1e')](_0x0055('0x35'),_0x4942f7[_0x0055('0x20')],_0x4942f7[_0x0055('0x21')],_0x4942f7[_0x0055('0x31')],_0x4942f7[_0x0055('0x22')],_0x4942f7[_0x0055('0x32')]));logger['info'](util[_0x0055('0x1e')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x4942f7['context'],_0x4942f7[_0x0055('0x36')],parseInt(_0x4942f7[_0x0055('0x27')],0xa)+0x1));_0x4942f7[_0x0055('0x37')](_0x4942f7[_0x0055('0x26')],_0x4942f7[_0x0055('0x36')],parseInt(_0x4942f7[_0x0055('0x27')],0xa)+0x1);_0x4942f7[_0x0055('0x38')]();}function handleNotFound(_0x14b2a9){logger['error'](util[_0x0055('0x1e')](_0x0055('0x39'),_0x14b2a9[_0x0055('0x20')]));_0x14b2a9[_0x0055('0x37')](_0x14b2a9['context'],_0x14b2a9[_0x0055('0x36')],parseInt(_0x14b2a9[_0x0055('0x27')],0xa)+0x1);_0x14b2a9[_0x0055('0x38')]();}function handleUnpublished(_0x282118){logger['error'](util[_0x0055('0x1e')](_0x0055('0x3a'),_0x282118['arg_1']));_0x282118['continueAt'](_0x282118[_0x0055('0x26')],_0x282118['extension'],parseInt(_0x282118[_0x0055('0x27')],0xa)+0x1);_0x282118[_0x0055('0x38')]();}module[_0x0055('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index cfd3913..b92c8ff 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 _0x03bc=['headers','_inBody','substring','exports','util','Transform','_localBuffer','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','length','split','indexOf','slice'];(function(_0x1a53c2,_0x4724a1){var _0x1b0d17=function(_0x3427c1){while(--_0x3427c1){_0x1a53c2['push'](_0x1a53c2['shift']());}};_0x1b0d17(++_0x4724a1);}(_0x03bc,0xb8));var _0xc03b=function(_0x44995,_0x420422){_0x44995=_0x44995-0x0;var _0xe8ee2b=_0x03bc[_0x44995];return _0xe8ee2b;};'use strict';var util=require(_0xc03b('0x0'));var Transform=require('stream')[_0xc03b('0x1')];function AGIReply(_0x1b04c7){Transform['call'](this,_0x1b04c7);this[_0xc03b('0x2')]='';this['_inBody']=![];}util[_0xc03b('0x3')](AGIReply,Transform);AGIReply[_0xc03b('0x4')][_0xc03b('0x5')]=function(_0x163bf3,_0x476e8e,_0x48e3de){var _0x31eda8='\x0a',_0x5982de=['\x0a\x0a',_0xc03b('0x6')],_0x4dd542=-0x1,_0xfccf77=-0x1,_0x64dd0a='',_0x2c9c10=0x0,_0x26cbb8='',_0x38ef04='';this[_0xc03b('0x2')]+=_0x163bf3['toString']();_0x26cbb8=this[_0xc03b('0x2')];if(!this['_inBody']){_0x2c9c10=0x0;while(_0x5982de[_0x2c9c10]){while((_0xfccf77=_0x26cbb8['indexOf'](_0x5982de[_0x2c9c10]))!=-0x1){_0x64dd0a=_0x5982de[_0x2c9c10];_0x38ef04=_0x26cbb8['substring'](0x0,_0xfccf77);_0x26cbb8=_0x26cbb8['substring'](_0xfccf77+_0x64dd0a[_0xc03b('0x7')]);var _0x5e1e2b=_0x38ef04[_0xc03b('0x8')](_0x31eda8),_0x4a3ed4=0x0,_0x4c90a5={},_0x5c0ef4='',_0x90a00a='',_0x410e9f=-0x1;while(_0x5e1e2b[_0x4a3ed4]){_0x410e9f=_0x5e1e2b[_0x4a3ed4][_0xc03b('0x9')](':');if(_0x410e9f!=-0x1){_0x5c0ef4=_0x5e1e2b[_0x4a3ed4][_0xc03b('0xa')](0x0,_0x410e9f)['trim']();_0x90a00a=_0x5e1e2b[_0x4a3ed4][_0xc03b('0xa')](_0x410e9f+0x1)['trim']();if(_0x5c0ef4['length']>0x0){_0x4c90a5[_0x5c0ef4]=_0x90a00a;}}else{}_0x4a3ed4++;}this['emit'](_0xc03b('0xb'),_0x4c90a5);this[_0xc03b('0xc')]=!![];}_0x2c9c10++;}this[_0xc03b('0x2')]=_0x26cbb8;}else{while((_0x4dd542=_0x26cbb8[_0xc03b('0x9')](_0x31eda8))!=-0x1){_0x38ef04=_0x26cbb8[_0xc03b('0xd')](0x0,_0x4dd542);this['emit']('line',_0x38ef04);_0x26cbb8=_0x26cbb8[_0xc03b('0xd')](_0x4dd542+_0x31eda8[_0xc03b('0x7')]);}this[_0xc03b('0x2')]=_0x26cbb8;}_0x48e3de();};module[_0xc03b('0xe')]=AGIReply; \ No newline at end of file +var _0xbc0a=['Transform','call','_localBuffer','_inBody','inherits','_transform','toString','substring','length','indexOf','slice','trim','headers','emit','line','util','stream'];(function(_0x1c60bd,_0x207c9b){var _0xc46ef9=function(_0x271c57){while(--_0x271c57){_0x1c60bd['push'](_0x1c60bd['shift']());}};_0xc46ef9(++_0x207c9b);}(_0xbc0a,0xdb));var _0xabc0=function(_0x57e8df,_0x4a9cea){_0x57e8df=_0x57e8df-0x0;var _0x6bbf55=_0xbc0a[_0x57e8df];return _0x6bbf55;};'use strict';var util=require(_0xabc0('0x0'));var Transform=require(_0xabc0('0x1'))[_0xabc0('0x2')];function AGIReply(_0x3c501f){Transform[_0xabc0('0x3')](this,_0x3c501f);this[_0xabc0('0x4')]='';this[_0xabc0('0x5')]=![];}util[_0xabc0('0x6')](AGIReply,Transform);AGIReply['prototype'][_0xabc0('0x7')]=function(_0x4e75d8,_0x456941,_0x198f4a){var _0x1e2109='\x0a',_0x4dc8b7=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x1159fb=-0x1,_0xa66990=-0x1,_0x1f079f='',_0x5d370a=0x0,_0x57fb02='',_0x4eb0cb='';this['_localBuffer']+=_0x4e75d8[_0xabc0('0x8')]();_0x57fb02=this['_localBuffer'];if(!this[_0xabc0('0x5')]){_0x5d370a=0x0;while(_0x4dc8b7[_0x5d370a]){while((_0xa66990=_0x57fb02['indexOf'](_0x4dc8b7[_0x5d370a]))!=-0x1){_0x1f079f=_0x4dc8b7[_0x5d370a];_0x4eb0cb=_0x57fb02[_0xabc0('0x9')](0x0,_0xa66990);_0x57fb02=_0x57fb02[_0xabc0('0x9')](_0xa66990+_0x1f079f[_0xabc0('0xa')]);var _0xeea61f=_0x4eb0cb['split'](_0x1e2109),_0x2b618f=0x0,_0x1c5693={},_0x25e907='',_0x557120='',_0x473fb2=-0x1;while(_0xeea61f[_0x2b618f]){_0x473fb2=_0xeea61f[_0x2b618f][_0xabc0('0xb')](':');if(_0x473fb2!=-0x1){_0x25e907=_0xeea61f[_0x2b618f][_0xabc0('0xc')](0x0,_0x473fb2)[_0xabc0('0xd')]();_0x557120=_0xeea61f[_0x2b618f][_0xabc0('0xc')](_0x473fb2+0x1)[_0xabc0('0xd')]();if(_0x25e907['length']>0x0){_0x1c5693[_0x25e907]=_0x557120;}}else{}_0x2b618f++;}this['emit'](_0xabc0('0xe'),_0x1c5693);this[_0xabc0('0x5')]=!![];}_0x5d370a++;}this[_0xabc0('0x4')]=_0x57fb02;}else{while((_0x1159fb=_0x57fb02[_0xabc0('0xb')](_0x1e2109))!=-0x1){_0x4eb0cb=_0x57fb02[_0xabc0('0x9')](0x0,_0x1159fb);this[_0xabc0('0xf')](_0xabc0('0x10'),_0x4eb0cb);_0x57fb02=_0x57fb02['substring'](_0x1159fb+_0x1e2109[_0xabc0('0xa')]);}this['_localBuffer']=_0x57fb02;}_0x198f4a();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index a080dd7..76cc735 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 _0x5ed2=['LogoutUser','lodash','jayson/promise','client','request','then','error','message','result','catch','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','CloudProvider','name','email','getSquareProjectById','getVoiceQueueById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','agentLogin','LoginUser','PauseUser','UnpauseUser','agentLogout'];(function(_0x243f66,_0x57833e){var _0x155018=function(_0x4786a1){while(--_0x4786a1){_0x243f66['push'](_0x243f66['shift']());}};_0x155018(++_0x57833e);}(_0x5ed2,0x114));var _0x25ed=function(_0x1be9ce,_0x27443d){_0x1be9ce=_0x1be9ce-0x0;var _0x164439=_0x5ed2[_0x1be9ce];return _0x164439;};'use strict';var _=require(_0x25ed('0x0'));var moment=require('moment');var jayson=require(_0x25ed('0x1'));var client=jayson[_0x25ed('0x2')]['http']({'port':0x2329});function request(_0x468494,_0xb12505){return new Promise(function(_0x591e52,_0x1ce8d8){return client[_0x25ed('0x3')](_0x468494,_0xb12505)[_0x25ed('0x4')](function(_0x36991f){if(_0x36991f['error']){return _0x1ce8d8(_0x36991f[_0x25ed('0x5')][_0x25ed('0x6')]);}else{return _0x591e52(_0x36991f[_0x25ed('0x7')]);}})[_0x25ed('0x8')](function(_0x5921bb){return _0x1ce8d8(_0x5921bb);});});}exports['getSquareProjects']=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name',_0x25ed('0x9')]}});};exports[_0x25ed('0xa')]=function(_0x3eef35){return request(_0x25ed('0xb'),{'options':{'raw':![],'where':{'name':_0x3eef35},'attributes':['production']}});};exports[_0x25ed('0xc')]=function(_0x252c54){return request(_0x25ed('0xd'),{'options':{'raw':![],'where':{'id':_0x252c54},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x25ed('0xe'),'as':_0x25ed('0xe')}]}],'attributes':['id',_0x25ed('0xf'),_0x25ed('0x10')],'smtp':!![]}});};exports[_0x25ed('0x11')]=function(_0x2c48c7){return request('ShowSquareProject',{'options':{'where':{'id':_0x2c48c7},'attributes':[_0x25ed('0xf')]}});};exports[_0x25ed('0x12')]=function(_0x4730c5){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x4730c5},'attributes':[_0x25ed('0xf')]}});};exports['getVariableById']=function(_0x3e9b5e){return request(_0x25ed('0x13'),{'options':{'where':{'id':_0x3e9b5e},'attributes':[_0x25ed('0xf')]}});};exports['getSquareOdbcById']=function(_0xfabdb){return request(_0x25ed('0x14'),{'options':{'where':{'id':_0xfabdb},'attributes':[_0x25ed('0x15')]}});};exports[_0x25ed('0x16')]=function(_0x405667){return request(_0x25ed('0x17'),{'options':{'where':{'id':_0x405667},'attributes':['name']}});};exports[_0x25ed('0x18')]=function(_0x3a86ae){return request('GetContactByPhone',{'options':{'where':{'phone':_0x3a86ae[_0x25ed('0x19')]},'attributes':['id']}});};exports[_0x25ed('0x1a')]=function(_0x3ec467){return request('ShowTrunk',{'options':{'where':{'id':_0x3ec467},'attributes':[_0x25ed('0xf')]}});};exports[_0x25ed('0x1b')]=function(_0x3ba174){return request(_0x25ed('0x1c'),{'options':{'where':{'id':_0x3ba174},'attributes':[_0x25ed('0x1d')]}});};exports[_0x25ed('0x1e')]=function(_0x257d6d){return request(_0x25ed('0x1f'),{'options':{'raw':![],'where':{'id':_0x257d6d},'include':[{'model':_0x25ed('0x20'),'as':_0x25ed('0x21')}]}});};exports[_0x25ed('0x22')]=function(_0x4a8135){return request(_0x25ed('0x23'),{'options':{'where':{'id':_0x4a8135},'attributes':['id',_0x25ed('0xf')]}});};exports[_0x25ed('0x24')]=function(_0x453181){return request(_0x25ed('0x25'),{'body':_0x453181});};exports['createSquareDetailsReport']=function(_0x2e0b7c){return request(_0x25ed('0x26'),{'body':_0x2e0b7c});};exports[_0x25ed('0x27')]=function(_0x18d8fb){return request('CreateSquareReport',{'body':_[_0x25ed('0x28')](_0x18d8fb,{'project_name':_0x18d8fb[_0x25ed('0x29')],'prev_project_name':_0x18d8fb[_0x25ed('0x2a')]||'','is_subproject':_0x18d8fb['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x25ed('0x2b'))})});};exports['createSquareRecording']=function(_0x2e7de5){return request(_0x25ed('0x2c'),{'body':_0x2e7de5});};exports['createSquareMessage']=function(_0x38d6e0){return request(_0x25ed('0x2d'),{'body':_0x38d6e0});};exports['createCmContact']=function(_0x26456f){return request(_0x25ed('0x2e'),{'options':{'raw':![],'where':{'phone':_0x26456f[_0x25ed('0x19')],'ListId':_0x26456f[_0x25ed('0x2f')]}}})[_0x25ed('0x4')](function(_0x1988a4){if(_0x1988a4){return _0x1988a4;}return request(_0x25ed('0x30'),{'body':_0x26456f});});};exports['getPauseById']=function(_0x10cd5e){return request('ShowPause',{'options':{'where':{'id':_0x10cd5e},'attributes':[_0x25ed('0xf')]}});};exports[_0x25ed('0x31')]=function(_0x12f751,_0x58a1e4){return request(_0x25ed('0x32'),{'body':{'interface':_0x58a1e4},'options':{'where':_0x12f751}});};exports['agentPause']=function(_0x2a24bc,_0x1ad655,_0x3cdf24){return request(_0x25ed('0x33'),{'body':{'type':_0x1ad655,'uniqueid':_0x3cdf24},'options':{'where':_0x2a24bc}});};exports['agentUnpause']=function(_0x2c7ccf){return request(_0x25ed('0x34'),{'body':{},'options':{'where':_0x2c7ccf}});};exports[_0x25ed('0x35')]=function(_0x3b2104){return request(_0x25ed('0x36'),{'body':{},'options':{'where':_0x3b2104}});}; \ No newline at end of file +var _0x61a1=['getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','email','getSquareProjectById','getVoiceQueueById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production'];(function(_0x509e09,_0x6baf30){var _0x5574f0=function(_0x31de08){while(--_0x31de08){_0x509e09['push'](_0x509e09['shift']());}};_0x5574f0(++_0x6baf30);}(_0x61a1,0x127));var _0x161a=function(_0x592d48,_0x23f1ba){_0x592d48=_0x592d48-0x0;var _0x5d789e=_0x61a1[_0x592d48];return _0x5d789e;};'use strict';var _=require(_0x161a('0x0'));var moment=require(_0x161a('0x1'));var jayson=require(_0x161a('0x2'));var client=jayson[_0x161a('0x3')][_0x161a('0x4')]({'port':0x2329});function request(_0x4fd537,_0x16162f){return new Promise(function(_0x912651,_0x52aadb){return client[_0x161a('0x5')](_0x4fd537,_0x16162f)[_0x161a('0x6')](function(_0x21eaaf){if(_0x21eaaf[_0x161a('0x7')]){return _0x52aadb(_0x21eaaf[_0x161a('0x7')][_0x161a('0x8')]);}else{return _0x912651(_0x21eaaf[_0x161a('0x9')]);}})[_0x161a('0xa')](function(_0x3e07e5){return _0x52aadb(_0x3e07e5);});});}exports[_0x161a('0xb')]=function(){return request(_0x161a('0xc'),{'options':{'raw':![],'attributes':['id',_0x161a('0xd'),_0x161a('0xe')]}});};exports[_0x161a('0xf')]=function(_0x46ee90){return request(_0x161a('0x10'),{'options':{'raw':![],'where':{'name':_0x46ee90},'attributes':[_0x161a('0xe')]}});};exports[_0x161a('0x11')]=function(_0x45245e){return request(_0x161a('0x12'),{'options':{'raw':![],'where':{'id':_0x45245e},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':'CloudProvider','as':'CloudProvider'}]}],'attributes':['id','name',_0x161a('0x13')],'smtp':!![]}});};exports[_0x161a('0x14')]=function(_0x38d210){return request(_0x161a('0x10'),{'options':{'where':{'id':_0x38d210},'attributes':[_0x161a('0xd')]}});};exports[_0x161a('0x15')]=function(_0x891d45){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x891d45},'attributes':['name']}});};exports['getVariableById']=function(_0x2b2a3e){return request(_0x161a('0x16'),{'options':{'where':{'id':_0x2b2a3e},'attributes':['name']}});};exports[_0x161a('0x17')]=function(_0x32b1a3){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x32b1a3},'attributes':[_0x161a('0x18')]}});};exports[_0x161a('0x19')]=function(_0x1dd836){return request(_0x161a('0x1a'),{'options':{'where':{'id':_0x1dd836},'attributes':[_0x161a('0xd')]}});};exports[_0x161a('0x1b')]=function(_0x25a286){return request(_0x161a('0x1c'),{'options':{'where':{'phone':_0x25a286[_0x161a('0x1d')]},'attributes':['id']}});};exports[_0x161a('0x1e')]=function(_0x4118fe){return request(_0x161a('0x1f'),{'options':{'where':{'id':_0x4118fe},'attributes':[_0x161a('0xd')]}});};exports['getSoundById']=function(_0x25b8ae){return request(_0x161a('0x20'),{'options':{'where':{'id':_0x25b8ae},'attributes':[_0x161a('0x21')]}});};exports[_0x161a('0x22')]=function(_0x1d14b0){return request(_0x161a('0x23'),{'options':{'raw':![],'where':{'id':_0x1d14b0},'include':[{'model':_0x161a('0x24'),'as':_0x161a('0x25')}]}});};exports[_0x161a('0x26')]=function(_0xa11a84){return request('ShowSmsAccount',{'options':{'where':{'id':_0xa11a84},'attributes':['id',_0x161a('0xd')]}});};exports['createSmsMessage']=function(_0x40aedb){return request(_0x161a('0x27'),{'body':_0x40aedb});};exports['createSquareDetailsReport']=function(_0x1b4937){return request(_0x161a('0x28'),{'body':_0x1b4937});};exports[_0x161a('0x29')]=function(_0x210bc7){return request(_0x161a('0x2a'),{'body':_[_0x161a('0x2b')](_0x210bc7,{'project_name':_0x210bc7[_0x161a('0x2c')],'prev_project_name':_0x210bc7[_0x161a('0x2d')]||'','is_subproject':_0x210bc7['arg_2']?!![]:![],'leaveAt':moment()[_0x161a('0x2e')](_0x161a('0x2f'))})});};exports['createSquareRecording']=function(_0x4be3ca){return request(_0x161a('0x30'),{'body':_0x4be3ca});};exports[_0x161a('0x31')]=function(_0x49f7a1){return request(_0x161a('0x32'),{'body':_0x49f7a1});};exports['createCmContact']=function(_0x5def9c){return request(_0x161a('0x33'),{'options':{'raw':![],'where':{'phone':_0x5def9c[_0x161a('0x1d')],'ListId':_0x5def9c[_0x161a('0x34')]}}})[_0x161a('0x6')](function(_0x1b66dc){if(_0x1b66dc){return _0x1b66dc;}return request(_0x161a('0x35'),{'body':_0x5def9c});});};exports[_0x161a('0x36')]=function(_0x4ecf5d){return request(_0x161a('0x37'),{'options':{'where':{'id':_0x4ecf5d},'attributes':[_0x161a('0xd')]}});};exports[_0x161a('0x38')]=function(_0x2d635c,_0x584732){return request('LoginUser',{'body':{'interface':_0x584732},'options':{'where':_0x2d635c}});};exports[_0x161a('0x39')]=function(_0x1aa77b,_0x828082,_0x234ccd){return request(_0x161a('0x3a'),{'body':{'type':_0x828082,'uniqueid':_0x234ccd},'options':{'where':_0x1aa77b}});};exports[_0x161a('0x3b')]=function(_0x42f699){return request(_0x161a('0x3c'),{'body':{},'options':{'where':_0x42f699}});};exports['agentLogout']=function(_0x1e0ae8){return request(_0x161a('0x3d'),{'body':{},'options':{'where':_0x1e0ae8}});}; \ 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 e9e368e..d809394 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 _0x2678=['exports','./lex'];(function(_0x5860e9,_0x380ea6){var _0xe97184=function(_0x43000e){while(--_0x43000e){_0x5860e9['push'](_0x5860e9['shift']());}};_0xe97184(++_0x380ea6);}(_0x2678,0x1bb));var _0x8267=function(_0x4f79a5,_0x438dd7){_0x4f79a5=_0x4f79a5-0x0;var _0x2ee2f1=_0x2678[_0x4f79a5];return _0x2ee2f1;};var polly=require('./polly');var lex=require(_0x8267('0x0'));module[_0x8267('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x687b=['./polly','./lex','exports'];(function(_0x48aaca,_0x140945){var _0xac5ed9=function(_0x180b19){while(--_0x180b19){_0x48aaca['push'](_0x48aaca['shift']());}};_0xac5ed9(++_0x140945);}(_0x687b,0x14a));var _0xb687=function(_0x14e4cf,_0x5ab1da){_0x14e4cf=_0x14e4cf-0x0;var _0x2770b=_0x687b[_0x14e4cf];return _0x2770b;};var polly=require(_0xb687('0x0'));var lex=require(_0xb687('0x1'));module[_0xb687('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 3e695b3..e1efe6d 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 _0x6f7a=['./lib/api','exports'];(function(_0x4f79e8,_0x13e19f){var _0x3a520a=function(_0x2dc79d){while(--_0x2dc79d){_0x4f79e8['push'](_0x4f79e8['shift']());}};_0x3a520a(++_0x13e19f);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x5c916f,_0x3b12d1){_0x5c916f=_0x5c916f-0x0;var _0x3102f9=_0x6f7a[_0x5c916f];return _0x3102f9;};'use strict';var lex=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]=function(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8){return lex(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8);}; \ No newline at end of file +var _0x2547=['exports'];(function(_0x47c958,_0x3cfe09){var _0x573eab=function(_0x380ec6){while(--_0x380ec6){_0x47c958['push'](_0x47c958['shift']());}};_0x573eab(++_0x3cfe09);}(_0x2547,0x1cd));var _0x7254=function(_0xa7e72d,_0x474d44){_0xa7e72d=_0xa7e72d-0x0;var _0x10c57a=_0x2547[_0xa7e72d];return _0x10c57a;};'use strict';var lex=require('./lib/api');module[_0x7254('0x0')]=function(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435){return lex(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 42ad279..f2415ef 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(_0x4d0212,_0x4d82b3){var _0xaeb9ac=function(_0x280f44){while(--_0x280f44){_0x4d0212['push'](_0x4d0212['shift']());}};_0xaeb9ac(++_0x4d82b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x167ba2,_0x50b594){var _0x98c7a2=function(_0x461f74){while(--_0x461f74){_0x167ba2['push'](_0x167ba2['shift']());}};_0x98c7a2(++_0x50b594);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 378c928..c54a92b 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 _0xbc6e=['exports'];(function(_0x5ebf9d,_0x392822){var _0xefbd7b=function(_0x412e96){while(--_0x412e96){_0x5ebf9d['push'](_0x5ebf9d['shift']());}};_0xefbd7b(++_0x392822);}(_0xbc6e,0x190));var _0xebc6=function(_0xe11ae3,_0x4bc71f){_0xe11ae3=_0xe11ae3-0x0;var _0x553424=_0xbc6e[_0xe11ae3];return _0x553424;};'use strict';var polly=require('./lib/api');module[_0xebc6('0x0')]=function(_0xca628d,_0x49953b,_0x43cb1a,_0x3a2b35,_0x13f93e,_0x32d43d,_0x412eac){return polly(_0xca628d,_0x49953b,_0x43cb1a,_0x3a2b35,_0x13f93e,_0x32d43d,_0x412eac);}; \ No newline at end of file +var _0xc6a6=['exports'];(function(_0x3dfa92,_0x3b4fba){var _0x441c55=function(_0x1d7781){while(--_0x1d7781){_0x3dfa92['push'](_0x3dfa92['shift']());}};_0x441c55(++_0x3b4fba);}(_0xc6a6,0xc0));var _0x6c6a=function(_0xd0b813,_0x11d1d6){_0xd0b813=_0xd0b813-0x0;var _0x29c623=_0xc6a6[_0xd0b813];return _0x29c623;};'use strict';var polly=require('./lib/api');module[_0x6c6a('0x0')]=function(_0x113c5d,_0x58e006,_0x4bbb90,_0x483261,_0x23347b,_0x2d2c5,_0x1d3c2c){return polly(_0x113c5d,_0x58e006,_0x4bbb90,_0x483261,_0x23347b,_0x2d2c5,_0x1d3c2c);}; \ 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 5a226dd..2af3501 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 _0xba7f=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','AudioStream'];(function(_0xef7f3b,_0x4f689f){var _0x5bc9e3=function(_0x247b0d){while(--_0x247b0d){_0xef7f3b['push'](_0xef7f3b['shift']());}};_0x5bc9e3(++_0x4f689f);}(_0xba7f,0x8c));var _0xfba7=function(_0x16bb57,_0x4c6da5){_0x16bb57=_0x16bb57-0x0;var _0x23e75c=_0xba7f[_0x16bb57];return _0x23e75c;};'use strict';var fs=require('fs');var path=require(_0xfba7('0x0'));var BPromise=require(_0xfba7('0x1'));var rs=require(_0xfba7('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x457c06,_0x5ad674,_0x778033){return new BPromise(function(_0x3cc49b,_0x49fc0a){_0x457c06['synthesizeSpeech'](_0x5ad674,function(_0x26c073,_0x1ea965){if(_0x26c073){_0x49fc0a(_0x26c073);}else if(_0x1ea965){if(_0x1ea965[_0xfba7('0x3')]instanceof Buffer){fs['writeFile'](_0x778033,_0x1ea965['AudioStream'],function(_0x155d48){if(_0x155d48){_0x49fc0a(_0x155d48);}else{_0x3cc49b();}});}else{_0x49fc0a(new Error(_0xfba7('0x4')));}}else{_0x49fc0a(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xfba7('0x5')]=function(_0x254b53,_0x7e10ae,_0x318cfb,_0x59e66d,_0x3d5d35,_0x2a1554,_0x197491){var _0x4a4ab4=new AWS[(_0xfba7('0x6'))]({'accessKeyId':_0x254b53,'secretAccessKey':_0x7e10ae,'region':_0x318cfb});var _0x34a225={'Text':_0x3d5d35,'TextType':_0x2a1554||_0xfba7('0x7'),'OutputFormat':_0xfba7('0x8'),'VoiceId':_0x59e66d};return pollyResult(_0x4a4ab4,_0x34a225,_0x197491);}; \ No newline at end of file +var _0x65dd=['Polly','mp3','path','bluebird','randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x636503,_0x17294f){var _0x1bd3a1=function(_0x164784){while(--_0x164784){_0x636503['push'](_0x636503['shift']());}};_0x1bd3a1(++_0x17294f);}(_0x65dd,0xff));var _0xd65d=function(_0x108883,_0x178371){_0x108883=_0x108883-0x0;var _0x182a86=_0x65dd[_0x108883];return _0x182a86;};'use strict';var fs=require('fs');var path=require(_0xd65d('0x0'));var BPromise=require(_0xd65d('0x1'));var rs=require(_0xd65d('0x2'));var AWS=require(_0xd65d('0x3'));function pollyResult(_0x3ae4da,_0x357774,_0x22f1c1){return new BPromise(function(_0x9f8510,_0x2ad4e0){_0x3ae4da['synthesizeSpeech'](_0x357774,function(_0x288cfa,_0x2b3985){if(_0x288cfa){_0x2ad4e0(_0x288cfa);}else if(_0x2b3985){if(_0x2b3985[_0xd65d('0x4')]instanceof Buffer){fs[_0xd65d('0x5')](_0x22f1c1,_0x2b3985[_0xd65d('0x4')],function(_0x131605){if(_0x131605){_0x2ad4e0(_0x131605);}else{_0x9f8510();}});}else{_0x2ad4e0(new Error(_0xd65d('0x6')));}}else{_0x2ad4e0(new Error(_0xd65d('0x7')));}});});}module[_0xd65d('0x8')]=function(_0x25f3f3,_0x1edc6d,_0x4cdf12,_0x49153e,_0x42124d,_0x545336,_0x688038){var _0x5814c5=new AWS[(_0xd65d('0x9'))]({'accessKeyId':_0x25f3f3,'secretAccessKey':_0x1edc6d,'region':_0x4cdf12});var _0x4e022e={'Text':_0x42124d,'TextType':_0x545336||'text','OutputFormat':_0xd65d('0xa'),'VoiceId':_0x49153e};return pollyResult(_0x5814c5,_0x4e022e,_0x688038);}; \ 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 6acb6c3..8f817a8 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 _0xd7f6=['exports','./lib/api'];(function(_0x50a77e,_0x1d91f5){var _0x315f38=function(_0x3068ad){while(--_0x3068ad){_0x50a77e['push'](_0x50a77e['shift']());}};_0x315f38(++_0x1d91f5);}(_0xd7f6,0x16b));var _0x6d7f=function(_0x4eeb45,_0x49543a){_0x4eeb45=_0x4eeb45-0x0;var _0x4a2a1f=_0xd7f6[_0x4eeb45];return _0x4a2a1f;};'use strict';var asr=require(_0x6d7f('0x0'));module[_0x6d7f('0x1')]=function(_0x2aea2e,_0x4fcb70,_0x39af98,_0x319ce7){return asr(_0x2aea2e,_0x4fcb70,_0x39af98);}; \ No newline at end of file +var _0x9ebf=['exports'];(function(_0xbfffe,_0x343bd2){var _0x5d0340=function(_0x416521){while(--_0x416521){_0xbfffe['push'](_0xbfffe['shift']());}};_0x5d0340(++_0x343bd2);}(_0x9ebf,0x144));var _0xf9eb=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9ebf[_0x4e676e];return _0x336a3c;};'use strict';var asr=require('./lib/api');module[_0xf9eb('0x0')]=function(_0x4c67db,_0x299370,_0x47b759,_0x11306e){return asr(_0x4c67db,_0x299370,_0x47b759);}; \ 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 28804e8..a152cb8 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 _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(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x78f0,0x15d));var _0x078f=function(_0x35f044,_0x52efe7){_0x35f044=_0x35f044-0x0;var _0x527190=_0x78f0[_0x35f044];return _0x527190;};'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 +var _0x0eec=['/v1/speech:recognize?key=','LINEAR16','8000','url','exports','length','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST'];(function(_0x291d3f,_0x3ef99f){var _0x242080=function(_0x257705){while(--_0x257705){_0x291d3f['push'](_0x291d3f['shift']());}};_0x242080(++_0x3ef99f);}(_0x0eec,0xac));var _0xc0ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0eec[_0x321bb2];return _0x9c12ed;};'use strict';var url=require(_0xc0ee('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0xc0ee('0x1')]=function(_0x1eb788,_0x460e72,_0x3890cf){return new BPromise(function(_0xf8033b,_0x1accbe){var _0x203b07;if(typeof _0x1eb788!=='string'||_0x1eb788[_0xc0ee('0x2')]===0x0){return _0x1accbe('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x460e72!==_0xc0ee('0x3')||_0x460e72[_0xc0ee('0x2')]===0x0){return _0x1accbe(_0xc0ee('0x4'));}if(typeof _0x3890cf!==_0xc0ee('0x5')&&(typeof _0x3890cf!==_0xc0ee('0x3')||_0x3890cf[_0xc0ee('0x2')]===0x0)){return _0x1accbe(_0xc0ee('0x6'));}try{_0x203b07=fs['readFileSync'](_0x1eb788)[_0xc0ee('0x7')](_0xc0ee('0x8'));}catch(_0x23d664){return _0x1accbe(_0x23d664);}return _0xf8033b({'method':_0xc0ee('0x9'),'uri':host+_0xc0ee('0xa')+_0x460e72,'body':{'config':{'encoding':_0xc0ee('0xb'),'sampleRateHertz':_0xc0ee('0xc'),'languageCode':_0x3890cf},'audio':{'content':_0x203b07}},'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 846495b..2aca683 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 _0x6dd7=['./asr','exports'];(function(_0x157314,_0x3904d8){var _0x222997=function(_0x27507f){while(--_0x27507f){_0x157314['push'](_0x157314['shift']());}};_0x222997(++_0x3904d8);}(_0x6dd7,0x110));var _0x76dd=function(_0x12c66e,_0xea7b4){_0x12c66e=_0x12c66e-0x0;var _0x19481a=_0x6dd7[_0x12c66e];return _0x19481a;};var asr=require(_0x76dd('0x0'));module[_0x76dd('0x1')]={'asr':asr}; \ No newline at end of file +var _0x3db9=['./asr','exports'];(function(_0x45e61d,_0xaca825){var _0x2f2471=function(_0x370914){while(--_0x370914){_0x45e61d['push'](_0x45e61d['shift']());}};_0x2f2471(++_0xaca825);}(_0x3db9,0x1ac));var _0x93db=function(_0x4e04ab,_0x34de92){_0x4e04ab=_0x4e04ab-0x0;var _0x5c5283=_0x3db9[_0x4e04ab];return _0x5c5283;};var asr=require(_0x93db('0x0'));module[_0x93db('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 f1638bf..239026f 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 _0xd83a=['transcode','error\x20convert','finish\x20to\x20convert','.wav','writeFileSync','base64','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','MP3','text:synthesize','POST','then','.mp3','from','audioContent','writeFile','chmodSync','resolve','tmp','generate','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','data','info','goggleTTS\x20path','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','dirName','bluebird','dialogflow','https','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','end','https:','get'];(function(_0x230a47,_0xa8a5e0){var _0x505fdd=function(_0x552c12){while(--_0x552c12){_0x230a47['push'](_0x230a47['shift']());}};_0x505fdd(++_0xa8a5e0);}(_0xd83a,0x6b));var _0xad83=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd83a[_0x14add3];return _0x4a174f;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xad83('0x0'));var dialogflow=require(_0xad83('0x1'));var fs=require('fs');var http=require('http');var https=require(_0xad83('0x2'));var md5=require('md5');var path=require(_0xad83('0x3'));var querystring=require(_0xad83('0x4'));var rp=require(_0xad83('0x5'));var rs=require(_0xad83('0x6'));var sox=require(_0xad83('0x7'));var tts=require(_0xad83('0x8'));var urlParse=require(_0xad83('0x9'))[_0xad83('0xa')];var util=require(_0xad83('0xb'));var aws=require('./aws');var google=require('./google');var sestek=require(_0xad83('0xc'));var tilde=require(_0xad83('0xd'));var logger=require(_0xad83('0xe'))(_0xad83('0xf'));var ISPEECH_API=_0xad83('0x10');function downloadFile(_0x160dc2,_0x2cce07){return new BPromise(function(_0x28013c,_0x594858){var _0x592e7d=urlParse(_0x160dc2);var _0x1931a4=_0x592e7d[_0xad83('0x11')]==='https:'?https:http;var _0x4ae83a={'host':_0x592e7d[_0xad83('0x12')],'path':_0x592e7d[_0xad83('0x3')],'headers':{'user-agent':_0xad83('0x13')}};_0x1931a4['get'](_0x4ae83a,function(_0x55c4ee){if(_0x55c4ee[_0xad83('0x14')]!==0xc8){logger[_0xad83('0x15')](_0xad83('0x16')+_0x160dc2+_0xad83('0x17')+_0x55c4ee[_0xad83('0x14')]+'\x20('+_0x55c4ee[_0xad83('0x18')]+')');_0x594858(new Error('request\x20to\x20'+_0x160dc2+_0xad83('0x17')+_0x55c4ee['statusCode']+'\x20('+_0x55c4ee[_0xad83('0x18')]+')'));return;}var _0x17a0c0=fs[_0xad83('0x19')](_0x2cce07);_0x17a0c0['on'](_0xad83('0x1a'),function(){logger['info'](_0xad83('0x1b'));_0x17a0c0[_0xad83('0x1c')](_0x28013c);});_0x17a0c0['on']('error',function(_0x180200){fs[_0xad83('0x1d')](_0x2cce07);logger['error'](_0xad83('0x1e'),_0x180200);_0x594858(_0x180200);});_0x55c4ee['pipe'](_0x17a0c0);})['on']('error',function(_0xd05085){logger['error'](_0xd05085);_0x594858(_0xd05085);})[_0xad83('0x1f')]();});}function uploadFile(_0x303cf9){return new BPromise(function(_0x50c39f,_0x28d835){var _0x1c4f46=urlParse(_0x303cf9);var _0x2a5750=_0x1c4f46[_0xad83('0x11')]===_0xad83('0x20')?https:http;var _0x2969e7={'host':_0x1c4f46['host'],'path':_0x1c4f46[_0xad83('0x3')],'headers':{'user-agent':_0xad83('0x13')}};_0x2a5750[_0xad83('0x21')](_0x2969e7,function(_0x207a29){if(_0x207a29[_0xad83('0x14')]!==0xc8){_0x28d835(new Error(_0xad83('0x16')+_0x303cf9+_0xad83('0x17')+_0x207a29[_0xad83('0x14')]+'\x20('+_0x207a29[_0xad83('0x18')]+')'));return;}var _0x341c0b='';_0x207a29['on']('data',function(_0x325c47){_0x341c0b+=_0x325c47;});_0x207a29['on'](_0xad83('0x1f'),function(){_0x50c39f(_0x341c0b);});})['on']('error',function(_0x364e86){_0x28d835(_0x364e86);})[_0xad83('0x1f')]();});}function convertFile(_0xde01f,_0x2e1d24){return new BPromise(function(_0x17c6da,_0x4bd51){var _0xfa809a=sox[_0xad83('0x22')](_0xde01f,_0x2e1d24,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xfa809a['on'](_0xad83('0x15'),function(_0xf446fe){logger['error'](_0xad83('0x23'),_0xf446fe);_0x4bd51(_0xf446fe);});_0xfa809a['on']('end',function(){logger['info'](_0xad83('0x24'));_0x17c6da();});_0xfa809a['start']();});}function base64Decode(_0x289465,_0x309987){var _0x2fb9a8=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xad83('0x25'));fs[_0xad83('0x26')](_0x2fb9a8,_0x289465,_0xad83('0x27'));return convertFile(_0x2fb9a8,_0x309987)['then'](function(){try{fs[_0xad83('0x1d')](_0x2fb9a8);fs['chmodSync'](_0x309987,_0xad83('0x28'));}catch(_0x3cb71c){logger[_0xad83('0x15')](_0x3cb71c);}return _0x309987[_0xad83('0x29')]('.')[0x0];});}function base64Encode(_0x8847cf){var _0x483f75=fs['readFileSync'](_0x8847cf);return new Buffer(_0x483f75)[_0xad83('0x2a')](_0xad83('0x27'));}exports[_0xad83('0x2b')]=function(_0x28a1b3,_0x1be657,_0x5b53c2,_0x8b497c,_0x4190c4,_0x362971){var _0x1af4ec,_0x508e7d;var _0x1dafa2=_0xad83('0x2c');var _0x588678=_0xad83('0x2d')+_0x28a1b3;var _0x279326={};if(_0x1be657==='ssml'){_0x279326['input']={'ssml':_0x5b53c2};}else{_0x279326[_0xad83('0x2e')]={'text':_0x5b53c2};};_0x279326[_0xad83('0x2f')]={'languageCode':_0x8b497c,'ssmlGender':_0x4190c4};_0x279326['audioConfig']={'audioEncoding':_0xad83('0x30'),'sampleRateHertz':0x1f40};var _0x3e0a92={'url':_0x1dafa2+_0xad83('0x31')+_0x588678,'method':_0xad83('0x32'),'json':!![],'body':_0x279326};return rp(_0x3e0a92)[_0xad83('0x33')](function(_0x7cf7dd){return new BPromise(function(_0x15a1e2,_0x5383fd){_0x1af4ec=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xad83('0x34'));var _0x37ae23=Buffer[_0xad83('0x35')](_0x7cf7dd[_0xad83('0x36')],_0xad83('0x27'));return fs[_0xad83('0x37')](_0x1af4ec,_0x37ae23,function(_0x50a02d){_0x5383fd(_0x50a02d);},function(_0x3cc5da){fs[_0xad83('0x38')](_0x1af4ec,_0xad83('0x28'));_0x15a1e2(_0x3cc5da);});});})[_0xad83('0x33')](function(_0x33e730){_0x508e7d=path[_0xad83('0x39')](__dirname,_0xad83('0x3a'),rs[_0xad83('0x3b')](0x4)+_0xad83('0x25'));return convertFile(_0x1af4ec,_0x508e7d);})['then'](function(){try{fs[_0xad83('0x1d')](_0x1af4ec);fs[_0xad83('0x38')](_0x508e7d,_0xad83('0x28'));}catch(_0x52ec03){logger[_0xad83('0x15')](_0x52ec03);}logger['info'](_0xad83('0x3c'),_0x508e7d[_0xad83('0x29')]('.')[0x0]);return _0x508e7d[_0xad83('0x29')]('.')[0x0];});};exports[_0xad83('0x3d')]=function(_0x5eb600,_0xe3dec6){var _0x54c6d2=_0xad83('0x3e');var _0x3f88fe,_0x460ec9;var _0x4b29b5;var _0x217a19={'encoding':_0xad83('0x3f'),'method':_0xad83('0x32'),'timeout':0x2710,'url':_0x54c6d2,'headers':{'Content-Type':_0xad83('0x40')},'body':_0xad83('0x41')+encodeURIComponent(JSON[_0xad83('0x42')]([[[_0xad83('0x43'),JSON[_0xad83('0x42')]([_0x5eb600,_0xe3dec6||'en',![],_0xad83('0x44')]),null,'generic']]]))};return rp(_0x217a19)[_0xad83('0x33')](function(_0x4e175b){try{_0x4b29b5=eval(_0x4e175b[_0xad83('0x45')](0x5))[0x0][0x2];}catch(_0x4d8f50){throw new Error(_0xad83('0x46')+_0x4e175b['data']);}if(!_0x4b29b5){if(_0x5eb600[_0xad83('0x47')]>0xc8){throw new Error(_0xad83('0x48'));}else{throw new Error(_0xad83('0x49')+_0xe3dec6+_0xad83('0x4a'));}}try{_0x4b29b5=eval(_0x4b29b5)[0x0];}catch(_0x2c4f0b){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xad83('0x4b')]);}const _0x1ead35=_0x4b29b5;_0x3f88fe=path[_0xad83('0x39')](__dirname,_0xad83('0x3a'),rs[_0xad83('0x3b')](0x4)+_0xad83('0x34'));fs[_0xad83('0x26')](_0x3f88fe,_0x4b29b5,{'encoding':_0xad83('0x27')});_0x460ec9=path[_0xad83('0x39')](__dirname,_0xad83('0x3a'),rs[_0xad83('0x3b')](0x4)+'.wav');return convertFile(_0x3f88fe,_0x460ec9);})[_0xad83('0x33')](function(){try{fs[_0xad83('0x1d')](_0x3f88fe);fs[_0xad83('0x38')](_0x460ec9,_0xad83('0x28'));}catch(_0x41d61c){logger['error'](_0x41d61c);}logger[_0xad83('0x4c')](_0xad83('0x4d'),_0x460ec9[_0xad83('0x29')]('.')[0x0]);return _0x460ec9[_0xad83('0x29')]('.')[0x0];});};exports['googleASR']=function(_0x37ed02,_0x2eae24,_0x404d83){return google[_0xad83('0x4e')](_0x37ed02,_0x2eae24,_0x404d83)[_0xad83('0x33')](function(_0x4af6ba){logger[_0xad83('0x4c')](_0x4af6ba[_0xad83('0x4f')]);return rp(_0x4af6ba);})[_0xad83('0x33')](function(_0x12f69f){var _0x37a417='';var _0x555f56=0x0;try{fs[_0xad83('0x1d')](_0x37ed02);}catch(_0x17e2f5){logger['error'](_0x17e2f5);}if(_0x12f69f&&_0x12f69f[_0xad83('0x50')]){_0x37a417=_0x12f69f['results']['map'](function(_0x432876){return _0x432876&&_0x432876[_0xad83('0x51')][0x0]&&_0x432876[_0xad83('0x51')][0x0]['transcript']?_0x432876[_0xad83('0x51')][0x0][_0xad83('0x52')]:'';})[_0xad83('0x53')]('\x0a');_0x555f56=_0x12f69f['results'][_0xad83('0x54')](function(_0x1741ac){return _0x1741ac&&_0x1741ac[_0xad83('0x51')][0x0]&&_0x1741ac[_0xad83('0x51')][0x0][_0xad83('0x55')]?_0x1741ac['alternatives'][0x0][_0xad83('0x55')]:0x0;})['join']('\x0a');}logger[_0xad83('0x4c')]('googleASR\x20transcription',_0x37a417);logger[_0xad83('0x4c')](_0xad83('0x56'),_0x555f56);return{'transcript':_0x37a417,'confidence':_0x555f56};})[_0xad83('0x57')](function(_0x5a1ac8){logger[_0xad83('0x15')](_0xad83('0x58'),_0x5a1ac8[_0xad83('0x14')],_0x5a1ac8[_0xad83('0x59')],_0x5a1ac8['message']);});};exports[_0xad83('0x5a')]=function(_0x36defa,_0xc3fa5e,_0x4b01a2,_0x4b5f12){var _0x12fec5=apiai(_0xc3fa5e,{'language':_0x4b5f12||'en'});return _0x12fec5[_0xad83('0x5b')](_0x4b01a2,{'sessionId':md5(_0x36defa)})['then'](function(_0x618c33){logger[_0xad83('0x4c')](JSON[_0xad83('0x42')](_0x618c33));return{'source':_0x618c33[_0xad83('0x5c')][_0xad83('0x5d')],'resolvedQuery':_0x618c33[_0xad83('0x5c')][_0xad83('0x5e')],'action':_0x618c33[_0xad83('0x5c')][_0xad83('0x5f')],'actionIncomplete':_0x618c33[_0xad83('0x5c')][_0xad83('0x60')],'speech':_0x618c33[_0xad83('0x5c')][_0xad83('0x61')][_0xad83('0x62')],'score':_0x618c33[_0xad83('0x5c')][_0xad83('0x63')],'statusCode':_0x618c33[_0xad83('0x64')][_0xad83('0x65')],'endConversation':_0x618c33['result'][_0xad83('0x66')][_0xad83('0x67')]||![],'isFallbackIntent':_0x618c33[_0xad83('0x5c')][_0xad83('0x66')][_0xad83('0x68')]};});};exports['googleDialogflowV2']=function(_0x45bd30,_0x170ed4,_0x1cf50a,_0x48775e,_0x1c760c,_0x1dd3ab){var _0x243618=_0x48775e[_0xad83('0x69')](/\\n/g,'\x0a');var _0x5a4eab={'credentials':{'private_key':_0x243618,'client_email':_0x1cf50a}};var _0x474d1a=new dialogflow[(_0xad83('0x6a'))](_0x5a4eab);var _0x3ad372=_0x474d1a['sessionPath'](_0x170ed4,md5(_0x45bd30));var _0x4bed2a={'session':_0x3ad372,'queryInput':{'text':{'text':_0x1c760c,'languageCode':_0x1dd3ab}}};return _0x474d1a[_0xad83('0x6b')](_0x4bed2a)[_0xad83('0x33')](function(_0x37a463){if(_0x37a463&&_0x37a463['length']){logger[_0xad83('0x4c')](_0xad83('0x6c'),JSON[_0xad83('0x42')](_0x37a463));var _0x1ddace=_0x37a463[0x0];if(_0x1ddace){var _0x484fe1={'action':_0x1ddace[_0xad83('0x6d')][_0xad83('0x5f')],'allRequiredParamsPresent':_0x1ddace[_0xad83('0x6d')]['allRequiredParamsPresent'],'endConversation':_0x1ddace['queryResult'][_0xad83('0x6e')]&&_0x1ddace['queryResult'][_0xad83('0x6e')]['fields']?_0x1ddace[_0xad83('0x6d')][_0xad83('0x6e')][_0xad83('0x6f')][_0xad83('0x70')][_0xad83('0x71')]:![],'fulfillmentText':_0x1ddace[_0xad83('0x6d')][_0xad83('0x72')],'intentName':_0x1ddace[_0xad83('0x6d')][_0xad83('0x73')][_0xad83('0x59')],'intentDisplayName':_0x1ddace[_0xad83('0x6d')][_0xad83('0x73')]['displayName'],'isFallbackIntent':_0x1ddace[_0xad83('0x6d')][_0xad83('0x73')][_0xad83('0x74')],'languageCode':_0x1ddace[_0xad83('0x6d')]['languageCode'],'queryText':_0x1ddace[_0xad83('0x6d')][_0xad83('0x75')],'responseId':_0x1ddace[_0xad83('0x76')],'score':_0x1ddace[_0xad83('0x6d')][_0xad83('0x77')],'speech':_0x1ddace[_0xad83('0x6d')][_0xad83('0x72')],'providerResponse':JSON[_0xad83('0x42')](_0x37a463)};return _0x484fe1;}}});};exports[_0xad83('0x78')]=function(_0x532bca,_0x2a7fc7,_0x5b403c,_0x289cda){return tilde['asr'](_0x532bca,_0x2a7fc7,_0x5b403c,_0x289cda)[_0xad83('0x33')](function(_0x1f3658){try{fs[_0xad83('0x1d')](_0x532bca);}catch(_0x3274c9){logger['error'](_0x3274c9);}logger[_0xad83('0x4c')](_0xad83('0x79'),_0x1f3658[_0xad83('0x52')]);logger[_0xad83('0x4c')](_0xad83('0x7a'),_0x1f3658[_0xad83('0x55')]);return _0x1f3658;});};exports[_0xad83('0x7b')]=function(_0x109d41,_0x2ebd09,_0x36966f,_0x28f76e,_0x3190a4,_0x1e40fa){var _0x365903=path['resolve'](__dirname,_0xad83('0x3a'),rs[_0xad83('0x3b')](0x4)+'.mp3');var _0x5285d9;return aws[_0xad83('0x7c')](_0x109d41,_0x2ebd09,_0x36966f,_0x28f76e,_0x3190a4,_0x1e40fa,_0x365903)[_0xad83('0x33')](function(){_0x5285d9=path[_0xad83('0x39')](__dirname,'tmp',rs[_0xad83('0x3b')](0x4)+_0xad83('0x25'));return convertFile(_0x365903,_0x5285d9);})['then'](function(){try{fs[_0xad83('0x1d')](_0x365903);fs[_0xad83('0x38')](_0x5285d9,_0xad83('0x28'));}catch(_0x2e2f0d){logger[_0xad83('0x15')](_0x2e2f0d);}return _0x5285d9['split']('.')[0x0];});};exports[_0xad83('0x7d')]=function(_0x3a97f4,_0x1c57e8,_0x405ab7,_0x591fb0,_0x51a83c,_0x5aadfb){return aws[_0xad83('0x7e')](_0x3a97f4,_0x1c57e8,_0x405ab7,_0x591fb0,_0x51a83c,_0x5aadfb)['then'](function(_0x2aed0c){logger['info'](JSON[_0xad83('0x42')](_0x2aed0c));return _0x2aed0c;});};exports[_0xad83('0x7f')]=function(_0x5a7132,_0x4bf119,_0x55c4d3,_0x1ad26a){var _0x3040ba=util[_0xad83('0x80')](_0xad83('0x81'),ISPEECH_API,_0x5a7132,encodeURIComponent(_0x4bf119),_0x55c4d3,_0x1ad26a);var _0x473ca8=path[_0xad83('0x39')](__dirname,_0xad83('0x3a'),rs[_0xad83('0x3b')](0x4)+_0xad83('0x34'));var _0x35bb97;return downloadFile(_0x3040ba,_0x473ca8)[_0xad83('0x33')](function(){_0x35bb97=path[_0xad83('0x39')](__dirname,'tmp',rs[_0xad83('0x3b')](0x4)+_0xad83('0x25'));return convertFile(_0x473ca8,_0x35bb97);})[_0xad83('0x33')](function(){try{fs[_0xad83('0x1d')](_0x473ca8);fs[_0xad83('0x38')](_0x35bb97,_0xad83('0x28'));}catch(_0x567fc4){logger[_0xad83('0x15')](_0x567fc4);}return _0x35bb97[_0xad83('0x29')]('.')[0x0];});};exports[_0xad83('0x82')]=function(_0xbb9a46,_0x44a906,_0x5f4095,_0x68d38d){var _0x28c512=util[_0xad83('0x80')](_0xad83('0x83'),ISPEECH_API,_0x44a906,_0x5f4095,base64Encode(_0xbb9a46),_0x68d38d?util[_0xad83('0x80')]('model=%s',encodeURIComponent(_0x68d38d)):_0xad83('0x84'));return uploadFile(_0x28c512)[_0xad83('0x33')](function(_0x4b05df){return querystring[_0xad83('0xa')](_0x4b05df);});};exports[_0xad83('0x85')]=function(_0x2d710e,_0x238747){return sestek[_0xad83('0x86')](_0x2d710e,_0x238747)[_0xad83('0x33')](function(_0x2bf074){logger[_0xad83('0x4c')](JSON[_0xad83('0x42')](_0x2bf074));var _0x4f01c8={'speech':_0x2bf074[_0xad83('0x87')],'action':_0x2bf074[_0xad83('0x88')]?_0x2bf074[_0xad83('0x88')][_0xad83('0x89')]:undefined,'actiondata':_0x2bf074['channelData']?_0x2bf074[_0xad83('0x88')][_0xad83('0x8a')]:undefined};if(_0x2bf074['channelData']&&_0x2bf074['channelData']['AudioFromTts']){return base64Decode(_0x2bf074['channelData'][_0xad83('0x8b')]['Data'],path[_0xad83('0x39')](__dirname,'tmp',rs[_0xad83('0x3b')](0x4)+_0xad83('0x25')))[_0xad83('0x33')](function(_0x4adc26){_0x4f01c8['audiofile']=_0x4adc26;return _0x4f01c8;});}return _0x4f01c8;});};exports[_0xad83('0x8c')]=function(){return __dirname;}; \ No newline at end of file +var _0xbe02=['statusCode','statusMessage','info','finish\x20download\x20file','close','download\x20error','pipe','end','data','transcode','wav','finish\x20to\x20convert','start','generate','.wav','writeFileSync','unlink','chmodSync','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','text:synthesize','POST','then','resolve','.mp3','from','audioContent','writeFile','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','tmp','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','action','actionIncomplete','speech','status','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','sox','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','agi','protocol','host','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20'];(function(_0x2bd68a,_0x3b1592){var _0x54846a=function(_0x3f15a7){while(--_0x3f15a7){_0x2bd68a['push'](_0x2bd68a['shift']());}};_0x54846a(++_0x3b1592);}(_0xbe02,0x189));var _0x2be0=function(_0x587b75,_0x4cca10){_0x587b75=_0x587b75-0x0;var _0x5e8818=_0xbe02[_0x587b75];return _0x5e8818;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x2be0('0x0'));var dialogflow=require(_0x2be0('0x1'));var fs=require('fs');var http=require(_0x2be0('0x2'));var https=require(_0x2be0('0x3'));var md5=require(_0x2be0('0x4'));var path=require(_0x2be0('0x5'));var querystring=require(_0x2be0('0x6'));var rp=require(_0x2be0('0x7'));var rs=require('randomstring');var sox=require(_0x2be0('0x8'));var tts=require('google-tts-api');var urlParse=require(_0x2be0('0x9'))[_0x2be0('0xa')];var util=require(_0x2be0('0xb'));var aws=require(_0x2be0('0xc'));var google=require('./google');var sestek=require(_0x2be0('0xd'));var tilde=require(_0x2be0('0xe'));var logger=require(_0x2be0('0xf'))(_0x2be0('0x10'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x301d14,_0x2011e7){return new BPromise(function(_0x386cdd,_0x4968a9){var _0x472153=urlParse(_0x301d14);var _0x3d3c8c=_0x472153[_0x2be0('0x11')]==='https:'?https:http;var _0xbe66bd={'host':_0x472153[_0x2be0('0x12')],'path':_0x472153['path'],'headers':{'user-agent':_0x2be0('0x13')}};_0x3d3c8c[_0x2be0('0x14')](_0xbe66bd,function(_0x45de36){if(_0x45de36['statusCode']!==0xc8){logger[_0x2be0('0x15')](_0x2be0('0x16')+_0x301d14+_0x2be0('0x17')+_0x45de36[_0x2be0('0x18')]+'\x20('+_0x45de36[_0x2be0('0x19')]+')');_0x4968a9(new Error(_0x2be0('0x16')+_0x301d14+_0x2be0('0x17')+_0x45de36['statusCode']+'\x20('+_0x45de36['statusMessage']+')'));return;}var _0x33a1dd=fs['createWriteStream'](_0x2011e7);_0x33a1dd['on']('finish',function(){logger[_0x2be0('0x1a')](_0x2be0('0x1b'));_0x33a1dd[_0x2be0('0x1c')](_0x386cdd);});_0x33a1dd['on'](_0x2be0('0x15'),function(_0x531bff){fs['unlink'](_0x2011e7);logger[_0x2be0('0x15')](_0x2be0('0x1d'),_0x531bff);_0x4968a9(_0x531bff);});_0x45de36[_0x2be0('0x1e')](_0x33a1dd);})['on']('error',function(_0x27d873){logger[_0x2be0('0x15')](_0x27d873);_0x4968a9(_0x27d873);})[_0x2be0('0x1f')]();});}function uploadFile(_0x236935){return new BPromise(function(_0xeca8ce,_0x260985){var _0x99ad4e=urlParse(_0x236935);var _0x1c7889=_0x99ad4e[_0x2be0('0x11')]==='https:'?https:http;var _0x562fb2={'host':_0x99ad4e[_0x2be0('0x12')],'path':_0x99ad4e['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x1c7889['get'](_0x562fb2,function(_0x35a5b7){if(_0x35a5b7['statusCode']!==0xc8){_0x260985(new Error(_0x2be0('0x16')+_0x236935+_0x2be0('0x17')+_0x35a5b7['statusCode']+'\x20('+_0x35a5b7[_0x2be0('0x19')]+')'));return;}var _0x36b438='';_0x35a5b7['on'](_0x2be0('0x20'),function(_0x57cbf5){_0x36b438+=_0x57cbf5;});_0x35a5b7['on']('end',function(){_0xeca8ce(_0x36b438);});})['on'](_0x2be0('0x15'),function(_0xeea2dc){_0x260985(_0xeea2dc);})[_0x2be0('0x1f')]();});}function convertFile(_0x138540,_0x1e09a5){return new BPromise(function(_0x2b75e8,_0x4e3f44){var _0x29be29=sox[_0x2be0('0x21')](_0x138540,_0x1e09a5,{'sampleRate':0x1f40,'format':_0x2be0('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x29be29['on'](_0x2be0('0x15'),function(_0x9c4578){logger[_0x2be0('0x15')]('error\x20convert',_0x9c4578);_0x4e3f44(_0x9c4578);});_0x29be29['on'](_0x2be0('0x1f'),function(){logger[_0x2be0('0x1a')](_0x2be0('0x23'));_0x2b75e8();});_0x29be29[_0x2be0('0x24')]();});}function base64Decode(_0x594ed5,_0x37c567){var _0xc3430d=path['resolve'](__dirname,'tmp',rs[_0x2be0('0x25')](0x4)+_0x2be0('0x26'));fs[_0x2be0('0x27')](_0xc3430d,_0x594ed5,'base64');return convertFile(_0xc3430d,_0x37c567)['then'](function(){try{fs[_0x2be0('0x28')](_0xc3430d);fs[_0x2be0('0x29')](_0x37c567,'777');}catch(_0x1e6f2d){logger[_0x2be0('0x15')](_0x1e6f2d);}return _0x37c567[_0x2be0('0x2a')]('.')[0x0];});}function base64Encode(_0x5e0239){var _0x3bcd57=fs[_0x2be0('0x2b')](_0x5e0239);return new Buffer(_0x3bcd57)[_0x2be0('0x2c')](_0x2be0('0x2d'));}exports[_0x2be0('0x2e')]=function(_0x22395,_0x291e49,_0x394b0f,_0x529be2,_0x2c678d,_0x4c4e2f){var _0x340114,_0x38142b;var _0x1414b3=_0x2be0('0x2f');var _0x3e87bc=_0x2be0('0x30')+_0x22395;var _0xc4a2f0={};if(_0x291e49===_0x2be0('0x31')){_0xc4a2f0[_0x2be0('0x32')]={'ssml':_0x394b0f};}else{_0xc4a2f0[_0x2be0('0x32')]={'text':_0x394b0f};};_0xc4a2f0[_0x2be0('0x33')]={'languageCode':_0x529be2,'ssmlGender':_0x2c678d};_0xc4a2f0['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x50ce29={'url':_0x1414b3+_0x2be0('0x34')+_0x3e87bc,'method':_0x2be0('0x35'),'json':!![],'body':_0xc4a2f0};return rp(_0x50ce29)[_0x2be0('0x36')](function(_0x1f08e9){return new BPromise(function(_0x337f10,_0xe21be8){_0x340114=path[_0x2be0('0x37')](__dirname,'tmp',rs[_0x2be0('0x25')](0x4)+_0x2be0('0x38'));var _0x3e8dae=Buffer[_0x2be0('0x39')](_0x1f08e9[_0x2be0('0x3a')],'base64');return fs[_0x2be0('0x3b')](_0x340114,_0x3e8dae,function(_0x4d235d){_0xe21be8(_0x4d235d);},function(_0x255327){fs[_0x2be0('0x29')](_0x340114,_0x2be0('0x3c'));_0x337f10(_0x255327);});});})[_0x2be0('0x36')](function(_0x5bbdd8){_0x38142b=path[_0x2be0('0x37')](__dirname,'tmp',rs[_0x2be0('0x25')](0x4)+_0x2be0('0x26'));return convertFile(_0x340114,_0x38142b);})[_0x2be0('0x36')](function(){try{fs[_0x2be0('0x28')](_0x340114);fs['chmodSync'](_0x38142b,'777');}catch(_0x1d2728){logger[_0x2be0('0x15')](_0x1d2728);}logger[_0x2be0('0x1a')](_0x2be0('0x3d'),_0x38142b[_0x2be0('0x2a')]('.')[0x0]);return _0x38142b[_0x2be0('0x2a')]('.')[0x0];});};exports[_0x2be0('0x3e')]=function(_0x5dcf74,_0x4288e2){var _0x387e8d=_0x2be0('0x3f');var _0x5f2464,_0xc588dc;var _0x69b9d8;var _0x490a42={'encoding':_0x2be0('0x40'),'method':_0x2be0('0x35'),'timeout':0x2710,'url':_0x387e8d,'headers':{'Content-Type':_0x2be0('0x41')},'body':'f.req='+encodeURIComponent(JSON[_0x2be0('0x42')]([[[_0x2be0('0x43'),JSON[_0x2be0('0x42')]([_0x5dcf74,_0x4288e2||'en',![],_0x2be0('0x44')]),null,_0x2be0('0x45')]]]))};return rp(_0x490a42)[_0x2be0('0x36')](function(_0x12aeaa){try{_0x69b9d8=eval(_0x12aeaa[_0x2be0('0x46')](0x5))[0x0][0x2];}catch(_0x5b3f30){throw new Error('parse\x20response\x20failed:\x0a'+_0x12aeaa[_0x2be0('0x20')]);}if(!_0x69b9d8){if(_0x5dcf74[_0x2be0('0x47')]>0xc8){throw new Error(_0x2be0('0x48'));}else{throw new Error('lang\x20\x22'+_0x4288e2+_0x2be0('0x49'));}}try{_0x69b9d8=eval(_0x69b9d8)[0x0];}catch(_0x32052a){throw new Error(_0x2be0('0x4a')+res[_0x2be0('0x20')]);}const _0x253fb7=_0x69b9d8;_0x5f2464=path[_0x2be0('0x37')](__dirname,_0x2be0('0x4b'),rs[_0x2be0('0x25')](0x4)+_0x2be0('0x38'));fs[_0x2be0('0x27')](_0x5f2464,_0x69b9d8,{'encoding':_0x2be0('0x2d')});_0xc588dc=path['resolve'](__dirname,_0x2be0('0x4b'),rs[_0x2be0('0x25')](0x4)+_0x2be0('0x26'));return convertFile(_0x5f2464,_0xc588dc);})[_0x2be0('0x36')](function(){try{fs[_0x2be0('0x28')](_0x5f2464);fs[_0x2be0('0x29')](_0xc588dc,'777');}catch(_0x2f528c){logger[_0x2be0('0x15')](_0x2f528c);}logger['info'](_0x2be0('0x4c'),_0xc588dc[_0x2be0('0x2a')]('.')[0x0]);return _0xc588dc[_0x2be0('0x2a')]('.')[0x0];});};exports[_0x2be0('0x4d')]=function(_0x34680b,_0x23578f,_0x531b1d){return google[_0x2be0('0x4e')](_0x34680b,_0x23578f,_0x531b1d)['then'](function(_0x59f461){logger['info'](_0x59f461[_0x2be0('0x4f')]);return rp(_0x59f461);})[_0x2be0('0x36')](function(_0x54a2c6){var _0x1d3827='';var _0x1a2d77=0x0;try{fs[_0x2be0('0x28')](_0x34680b);}catch(_0x4054d7){logger[_0x2be0('0x15')](_0x4054d7);}if(_0x54a2c6&&_0x54a2c6[_0x2be0('0x50')]){_0x1d3827=_0x54a2c6[_0x2be0('0x50')][_0x2be0('0x51')](function(_0x20473d){return _0x20473d&&_0x20473d[_0x2be0('0x52')][0x0]&&_0x20473d[_0x2be0('0x52')][0x0][_0x2be0('0x53')]?_0x20473d[_0x2be0('0x52')][0x0]['transcript']:'';})[_0x2be0('0x54')]('\x0a');_0x1a2d77=_0x54a2c6[_0x2be0('0x50')][_0x2be0('0x51')](function(_0xb7e8d2){return _0xb7e8d2&&_0xb7e8d2[_0x2be0('0x52')][0x0]&&_0xb7e8d2[_0x2be0('0x52')][0x0][_0x2be0('0x55')]?_0xb7e8d2[_0x2be0('0x52')][0x0][_0x2be0('0x55')]:0x0;})[_0x2be0('0x54')]('\x0a');}logger[_0x2be0('0x1a')]('googleASR\x20transcription',_0x1d3827);logger[_0x2be0('0x1a')](_0x2be0('0x56'),_0x1a2d77);return{'transcript':_0x1d3827,'confidence':_0x1a2d77};})['catch'](function(_0xbe2c92){logger[_0x2be0('0x15')](_0x2be0('0x57'),_0xbe2c92[_0x2be0('0x18')],_0xbe2c92[_0x2be0('0x58')],_0xbe2c92[_0x2be0('0x59')]);});};exports[_0x2be0('0x5a')]=function(_0x15d98c,_0x3e0fc3,_0x53377a,_0x15d10b){var _0x1b927e=apiai(_0x3e0fc3,{'language':_0x15d10b||'en'});return _0x1b927e[_0x2be0('0x5b')](_0x53377a,{'sessionId':md5(_0x15d98c)})['then'](function(_0x91e291){logger[_0x2be0('0x1a')](JSON[_0x2be0('0x42')](_0x91e291));return{'source':_0x91e291[_0x2be0('0x5c')][_0x2be0('0x5d')],'resolvedQuery':_0x91e291[_0x2be0('0x5c')]['resolvedQuery'],'action':_0x91e291['result'][_0x2be0('0x5e')],'actionIncomplete':_0x91e291[_0x2be0('0x5c')][_0x2be0('0x5f')],'speech':_0x91e291[_0x2be0('0x5c')]['fulfillment'][_0x2be0('0x60')],'score':_0x91e291[_0x2be0('0x5c')]['score'],'statusCode':_0x91e291[_0x2be0('0x61')][_0x2be0('0x62')],'endConversation':_0x91e291[_0x2be0('0x5c')]['metadata'][_0x2be0('0x63')]||![],'isFallbackIntent':_0x91e291[_0x2be0('0x5c')][_0x2be0('0x64')][_0x2be0('0x65')]};});};exports[_0x2be0('0x66')]=function(_0x5d43c9,_0x19222f,_0x5e2986,_0x4ba281,_0xe0ee68,_0x47ae8a){var _0x14f430=_0x4ba281[_0x2be0('0x67')](/\\n/g,'\x0a');var _0xcb4405={'credentials':{'private_key':_0x14f430,'client_email':_0x5e2986}};var _0x22eb50=new dialogflow['SessionsClient'](_0xcb4405);var _0x2fc44f=_0x22eb50[_0x2be0('0x68')](_0x19222f,md5(_0x5d43c9));var _0xc7f29b={'session':_0x2fc44f,'queryInput':{'text':{'text':_0xe0ee68,'languageCode':_0x47ae8a}}};return _0x22eb50['detectIntent'](_0xc7f29b)[_0x2be0('0x36')](function(_0x4a37a5){if(_0x4a37a5&&_0x4a37a5[_0x2be0('0x47')]){logger[_0x2be0('0x1a')](_0x2be0('0x69'),JSON['stringify'](_0x4a37a5));var _0x791aef=_0x4a37a5[0x0];if(_0x791aef){var _0x477539={'action':_0x791aef[_0x2be0('0x6a')]['action'],'allRequiredParamsPresent':_0x791aef['queryResult'][_0x2be0('0x6b')],'endConversation':_0x791aef[_0x2be0('0x6a')]['diagnosticInfo']&&_0x791aef['queryResult'][_0x2be0('0x6c')]['fields']?_0x791aef[_0x2be0('0x6a')][_0x2be0('0x6c')][_0x2be0('0x6d')][_0x2be0('0x6e')][_0x2be0('0x6f')]:![],'fulfillmentText':_0x791aef['queryResult']['fulfillmentText'],'intentName':_0x791aef[_0x2be0('0x6a')][_0x2be0('0x70')][_0x2be0('0x58')],'intentDisplayName':_0x791aef['queryResult'][_0x2be0('0x70')]['displayName'],'isFallbackIntent':_0x791aef[_0x2be0('0x6a')][_0x2be0('0x70')][_0x2be0('0x71')],'languageCode':_0x791aef[_0x2be0('0x6a')][_0x2be0('0x72')],'queryText':_0x791aef['queryResult'][_0x2be0('0x73')],'responseId':_0x791aef[_0x2be0('0x74')],'score':_0x791aef[_0x2be0('0x6a')][_0x2be0('0x75')],'speech':_0x791aef[_0x2be0('0x6a')][_0x2be0('0x76')],'providerResponse':JSON['stringify'](_0x4a37a5)};return _0x477539;}}});};exports[_0x2be0('0x77')]=function(_0x13d9a6,_0x11b49d,_0x1a8752,_0x50f19d){return tilde['asr'](_0x13d9a6,_0x11b49d,_0x1a8752,_0x50f19d)['then'](function(_0x52742b){try{fs['unlink'](_0x13d9a6);}catch(_0x132220){logger[_0x2be0('0x15')](_0x132220);}logger[_0x2be0('0x1a')](_0x2be0('0x78'),_0x52742b[_0x2be0('0x53')]);logger[_0x2be0('0x1a')]('Tilde\x20ASR\x20confidence',_0x52742b['confidence']);return _0x52742b;});};exports[_0x2be0('0x79')]=function(_0x2357b3,_0x5e15c0,_0xd45871,_0x1c9031,_0x47b1a8,_0x116a9c){var _0x5a3e23=path[_0x2be0('0x37')](__dirname,_0x2be0('0x4b'),rs[_0x2be0('0x25')](0x4)+_0x2be0('0x38'));var _0x10f354;return aws[_0x2be0('0x7a')](_0x2357b3,_0x5e15c0,_0xd45871,_0x1c9031,_0x47b1a8,_0x116a9c,_0x5a3e23)[_0x2be0('0x36')](function(){_0x10f354=path['resolve'](__dirname,_0x2be0('0x4b'),rs[_0x2be0('0x25')](0x4)+_0x2be0('0x26'));return convertFile(_0x5a3e23,_0x10f354);})[_0x2be0('0x36')](function(){try{fs['unlink'](_0x5a3e23);fs[_0x2be0('0x29')](_0x10f354,_0x2be0('0x3c'));}catch(_0x11c0bf){logger[_0x2be0('0x15')](_0x11c0bf);}return _0x10f354[_0x2be0('0x2a')]('.')[0x0];});};exports[_0x2be0('0x7b')]=function(_0x5a8208,_0x39ba78,_0x197476,_0x3cfb62,_0x65adcd,_0x3e78ed){return aws[_0x2be0('0x7c')](_0x5a8208,_0x39ba78,_0x197476,_0x3cfb62,_0x65adcd,_0x3e78ed)[_0x2be0('0x36')](function(_0x1f74b6){logger['info'](JSON[_0x2be0('0x42')](_0x1f74b6));return _0x1f74b6;});};exports[_0x2be0('0x7d')]=function(_0x30ebfe,_0xa43d1,_0x2e22d8,_0x1782ca){var _0x5429ff=util['format'](_0x2be0('0x7e'),ISPEECH_API,_0x30ebfe,encodeURIComponent(_0xa43d1),_0x2e22d8,_0x1782ca);var _0x3c4eda=path['resolve'](__dirname,_0x2be0('0x4b'),rs[_0x2be0('0x25')](0x4)+_0x2be0('0x38'));var _0x126d22;return downloadFile(_0x5429ff,_0x3c4eda)[_0x2be0('0x36')](function(){_0x126d22=path['resolve'](__dirname,_0x2be0('0x4b'),rs['generate'](0x4)+_0x2be0('0x26'));return convertFile(_0x3c4eda,_0x126d22);})[_0x2be0('0x36')](function(){try{fs[_0x2be0('0x28')](_0x3c4eda);fs['chmodSync'](_0x126d22,_0x2be0('0x3c'));}catch(_0x518739){logger[_0x2be0('0x15')](_0x518739);}return _0x126d22[_0x2be0('0x2a')]('.')[0x0];});};exports[_0x2be0('0x7f')]=function(_0x71b673,_0x78fb95,_0x3119fb,_0x3819ac){var _0x59343f=util[_0x2be0('0x80')](_0x2be0('0x81'),ISPEECH_API,_0x78fb95,_0x3119fb,base64Encode(_0x71b673),_0x3819ac?util[_0x2be0('0x80')](_0x2be0('0x82'),encodeURIComponent(_0x3819ac)):_0x2be0('0x83'));return uploadFile(_0x59343f)[_0x2be0('0x36')](function(_0x25d657){return querystring[_0x2be0('0xa')](_0x25d657);});};exports['sestekNDA']=function(_0x2d9c8c,_0x4c1ee1){return sestek['nda'](_0x2d9c8c,_0x4c1ee1)[_0x2be0('0x36')](function(_0x1fa9e7){logger[_0x2be0('0x1a')](JSON[_0x2be0('0x42')](_0x1fa9e7));var _0x495867={'speech':_0x1fa9e7[_0x2be0('0x84')],'action':_0x1fa9e7['channelData']?_0x1fa9e7[_0x2be0('0x85')]['CustomAction']:undefined,'actiondata':_0x1fa9e7[_0x2be0('0x85')]?_0x1fa9e7[_0x2be0('0x85')][_0x2be0('0x86')]:undefined};if(_0x1fa9e7['channelData']&&_0x1fa9e7[_0x2be0('0x85')][_0x2be0('0x87')]){return base64Decode(_0x1fa9e7[_0x2be0('0x85')][_0x2be0('0x87')][_0x2be0('0x88')],path[_0x2be0('0x37')](__dirname,_0x2be0('0x4b'),rs[_0x2be0('0x25')](0x4)+_0x2be0('0x26')))[_0x2be0('0x36')](function(_0x20577e){_0x495867[_0x2be0('0x89')]=_0x20577e;return _0x495867;});}return _0x495867;});};exports[_0x2be0('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 49af2b1..21bd122 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 _0xd9a5=['./nda','exports'];(function(_0x8db694,_0x19fefe){var _0x3c4564=function(_0xcb63d9){while(--_0xcb63d9){_0x8db694['push'](_0x8db694['shift']());}};_0x3c4564(++_0x19fefe);}(_0xd9a5,0x144));var _0x5d9a=function(_0x918e69,_0x1121cd){_0x918e69=_0x918e69-0x0;var _0x5002e9=_0xd9a5[_0x918e69];return _0x5002e9;};var nda=require(_0x5d9a('0x0'));module[_0x5d9a('0x1')]={'nda':nda}; \ No newline at end of file +var _0xb7fa=['./nda'];(function(_0x3188b5,_0x5a00ba){var _0xc21551=function(_0x5137c6){while(--_0x5137c6){_0x3188b5['push'](_0x3188b5['shift']());}};_0xc21551(++_0x5a00ba);}(_0xb7fa,0x66));var _0xab7f=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0xb7fa[_0x238671];return _0x474844;};var nda=require(_0xab7f('0x0'));module['exports']={'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 f6f2979..2219a2b 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 _0x5668=['project','body','channelData','ProjectName','custom_action','CustomAction','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','then','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','calleridname','dnid'];(function(_0x594a1c,_0x41c755){var _0x233378=function(_0x173a91){while(--_0x173a91){_0x594a1c['push'](_0x594a1c['shift']());}};_0x233378(++_0x41c755);}(_0x5668,0x8b));var _0x8566=function(_0x439ab3,_0x276d5b){_0x439ab3=_0x439ab3-0x0;var _0x439285=_0x5668[_0x439ab3];return _0x439285;};'use strict';var rp=require(_0x8566('0x0'));var url=require(_0x8566('0x1'));var logger=require(_0x8566('0x2'))(_0x8566('0x3'));module[_0x8566('0x4')]=function(_0x3b3cf3,_0x3c842a){var _0x198ca6={'method':_0x8566('0x5'),'uri':url[_0x8566('0x6')](_0x3c842a[_0x8566('0x7')],_0x8566('0x8')),'form':{'grant_type':_0x8566('0x9'),'username':_0x3c842a['username'],'password':_0x3c842a[_0x8566('0x9')]},'json':!![]};return rp(_0x198ca6)[_0x8566('0xa')](function(_0x49f55a){var _0x4aaf3f={'method':_0x8566('0x5'),'uri':url['resolve'](_0x3c842a['ndassistant_url'],_0x8566('0xb')),'body':{'type':_0x3c842a['ndaactivity_type']||_0x8566('0xc'),'channelId':_0x8566('0xd'),'conversation':{'id':_0x3b3cf3[_0x8566('0xe')]},'from':{'id':_0x3b3cf3['callerid'],'name':_0x3b3cf3[_0x8566('0xf')]},'recipient':{'id':_0x3b3cf3[_0x8566('0x10')],'name':_0x3b3cf3['extension']},'text':_0x3c842a['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x49f55a['access_token']},'json':!![]};if(_0x3c842a[_0x8566('0x11')]){_0x4aaf3f[_0x8566('0x12')][_0x8566('0x13')][_0x8566('0x14')]=_0x3c842a[_0x8566('0x11')];}if(_0x3c842a['ndagenerate_audio']=='1'){_0x4aaf3f['body']['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x3c842a[_0x8566('0x15')]){_0x4aaf3f[_0x8566('0x12')][_0x8566('0x13')][_0x8566('0x16')]=_0x3c842a[_0x8566('0x15')];if(_0x3c842a['custom_action_data']){_0x4aaf3f[_0x8566('0x12')][_0x8566('0x13')][_0x8566('0x17')]=_0x3c842a['custom_action_data'];}}logger[_0x8566('0x18')](JSON[_0x8566('0x19')](_0x4aaf3f));return rp(_0x4aaf3f);});}; \ No newline at end of file +var _0x76dc=['calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','POST','/token','password','username','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','callerid'];(function(_0x4f169b,_0x5222dc){var _0x3c213e=function(_0x5342d4){while(--_0x5342d4){_0x4f169b['push'](_0x4f169b['shift']());}};_0x3c213e(++_0x5222dc);}(_0x76dc,0x1f2));var _0xc76d=function(_0x39d2d8,_0x368ac8){_0x39d2d8=_0x39d2d8-0x0;var _0x24b81e=_0x76dc[_0x39d2d8];return _0x24b81e;};'use strict';var rp=require(_0xc76d('0x0'));var url=require(_0xc76d('0x1'));var logger=require(_0xc76d('0x2'))(_0xc76d('0x3'));module['exports']=function(_0x2a8b7d,_0x1ba6a1){var _0x5cff74={'method':_0xc76d('0x4'),'uri':url['resolve'](_0x1ba6a1['ndauth_url'],_0xc76d('0x5')),'form':{'grant_type':_0xc76d('0x6'),'username':_0x1ba6a1[_0xc76d('0x7')],'password':_0x1ba6a1['password']},'json':!![]};return rp(_0x5cff74)['then'](function(_0x119f38){var _0x114572={'method':_0xc76d('0x4'),'uri':url['resolve'](_0x1ba6a1['ndassistant_url'],_0xc76d('0x8')),'body':{'type':_0x1ba6a1[_0xc76d('0x9')]||'message','channelId':_0xc76d('0xa'),'conversation':{'id':_0x2a8b7d['uniqueid']},'from':{'id':_0x2a8b7d[_0xc76d('0xb')],'name':_0x2a8b7d[_0xc76d('0xc')]},'recipient':{'id':_0x2a8b7d[_0xc76d('0xd')],'name':_0x2a8b7d[_0xc76d('0xe')]},'text':_0x1ba6a1[_0xc76d('0xf')],'channelData':{}},'headers':{'Authorization':_0xc76d('0x10')+_0x119f38[_0xc76d('0x11')]},'json':!![]};if(_0x1ba6a1[_0xc76d('0x12')]){_0x114572[_0xc76d('0x13')][_0xc76d('0x14')][_0xc76d('0x15')]=_0x1ba6a1[_0xc76d('0x12')];}if(_0x1ba6a1[_0xc76d('0x16')]=='1'){_0x114572[_0xc76d('0x13')]['channelData'][_0xc76d('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xc76d('0x18')};}if(_0x1ba6a1['custom_action']){_0x114572[_0xc76d('0x13')][_0xc76d('0x14')][_0xc76d('0x19')]=_0x1ba6a1[_0xc76d('0x1a')];if(_0x1ba6a1['custom_action_data']){_0x114572[_0xc76d('0x13')]['channelData']['CustomActionData']=_0x1ba6a1[_0xc76d('0x1b')];}}logger[_0xc76d('0x1c')](JSON[_0xc76d('0x1d')](_0x114572));return rp(_0x114572);});}; \ 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 e54a039..46be746 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 _0x882e=['exports','./lib/api'];(function(_0x3020db,_0x349ebc){var _0x41abf9=function(_0x3ecb78){while(--_0x3ecb78){_0x3020db['push'](_0x3020db['shift']());}};_0x41abf9(++_0x349ebc);}(_0x882e,0x189));var _0xe882=function(_0x55951d,_0x54e104){_0x55951d=_0x55951d-0x0;var _0x3213cb=_0x882e[_0x55951d];return _0x3213cb;};'use strict';var asr=require(_0xe882('0x0'));module[_0xe882('0x1')]=function(_0xe935d9,_0x3e90b8,_0x4380e8,_0x40d6e4){return asr(_0xe935d9,_0x3e90b8,_0x4380e8,_0x40d6e4);}; \ No newline at end of file +var _0x44ac=['exports'];(function(_0x21e6cb,_0x1e97e9){var _0x1fe413=function(_0x4406ab){while(--_0x4406ab){_0x21e6cb['push'](_0x21e6cb['shift']());}};_0x1fe413(++_0x1e97e9);}(_0x44ac,0xc5));var _0xc44a=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x44ac[_0x55f8b4];return _0x2475f9;};'use strict';var asr=require('./lib/api');module[_0xc44a('0x0')]=function(_0x3dddb5,_0x196770,_0x27a3d2,_0x458903){return asr(_0x3dddb5,_0x196770,_0x27a3d2,_0x458903);}; \ 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 bb27ff8..87dc03f 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 _0x7860=['isNil','open','message','lodash','moment','crypto','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x7860,0xb7));var _0x0786=function(_0x1b0293,_0x585d4b){_0x1b0293=_0x1b0293-0x0;var _0x25b73a=_0x7860[_0x1b0293];return _0x25b73a;};'use strict';var BPromise=require('bluebird');var _=require(_0x0786('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x0786('0x1'));var crypto=require(_0x0786('0x2'));var logger=require('../../../../../../config/logger')('agi');module[_0x0786('0x3')]=function(_0x30f696,_0x23618c,_0xf95aed,_0x10e3e3){return new BPromise(function(_0x2d701e,_0x4b2a57){logger[_0x0786('0x4')](_0x0786('0x5'),_0x10e3e3||_0x0786('0x6'));var _0x505966=new WebSocket(_0x10e3e3||_0x0786('0x6'),{'perMessageDeflate':![]});var _0x5be239='';var _0x13a9ad='0';var _0x597ff2='1';var _0x290808=_0x0786('0x7');function _0x71fb71(_0x36472c){var _0x47131e=crypto[_0x0786('0x8')]('sha1');_0x47131e[_0x0786('0x9')](_0x36472c);return _0x47131e[_0x0786('0xa')](_0x0786('0xb'));}function _0x1e7cd5(){try{logger[_0x0786('0x4')](_0x0786('0xc'));var _0x4b57ca=moment()['unix']();var _0x426ab5=_0x71fb71(_0x4b57ca+_0x23618c+_0xf95aed);_0x505966[_0x0786('0xd')](JSON[_0x0786('0xe')]({'appID':_0x23618c,'timestamp':_0x4b57ca,'appKey':_0x426ab5}));var _0x2b1f33=fs['createReadStream'](_0x30f696);_0x2b1f33['on'](_0x0786('0xf'),function(_0x48cd21){_0x505966[_0x0786('0xd')](_0x48cd21);});_0x2b1f33['on'](_0x0786('0x10'),function(){_0x505966['send'](_0x0786('0x11'));});}catch(_0x553732){logger[_0x0786('0x12')](_0x0786('0x13'),JSON[_0x0786('0xe')](_0x553732));_0x505966[_0x0786('0x14')]();}}function _0x327692(_0x26d7fe){try{if(_0x26d7fe){var _0x53d91d=JSON[_0x0786('0x15')](_0x26d7fe);switch(_0x53d91d['status']){case 0x0:if(_0x53d91d[_0x0786('0x16')]){if(_0x53d91d[_0x0786('0x16')][_0x0786('0x17')]){logger['info'](_0x0786('0x18'),JSON['stringify'](_0x53d91d[_0x0786('0x16')][_0x0786('0x19')]));_0x5be239=_0x53d91d[_0x0786('0x16')]['hypotheses'][0x0]['transcript'];_0x13a9ad=_0x53d91d[_0x0786('0x16')][_0x0786('0x19')][0x0]['likelihood'];_0x597ff2='0';_0x290808=_0x0786('0x1a');_0x505966['terminate']();}}break;case 0x1:logger[_0x0786('0x4')](_0x0786('0x7'));_0x597ff2='1';_0x290808='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x0786('0x4')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x597ff2='2';_0x290808=_0x0786('0x1b');break;case 0x9:logger[_0x0786('0x4')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x597ff2='9';_0x290808='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x0786('0x4')](_0x0786('0x1c'));_0x597ff2='10';_0x290808=_0x0786('0x1c');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x597ff2='11';_0x290808=_0x0786('0x1d');}}}catch(_0x5232a6){logger[_0x0786('0x12')](_0x0786('0x1e'),JSON[_0x0786('0xe')](_0x5232a6));_0x505966[_0x0786('0x14')]();}}function _0x5e8aa7(){logger[_0x0786('0x4')](_0x0786('0x1f'));_0x2d701e({'transcript':_0x5be239,'confidence':_0x13a9ad,'status':_0x597ff2,'status_message':_0x290808});}function _0x460e6b(_0x7d3ea5){logger['error'](_0x0786('0x20'));if(!_[_0x0786('0x21')](_0x7d3ea5)){logger[_0x0786('0x12')](_['isObject'](_0x7d3ea5)?JSON[_0x0786('0xe')](_0x7d3ea5):_0x7d3ea5);}}_0x505966['on'](_0x0786('0x22'),_0x1e7cd5);_0x505966['on'](_0x0786('0x23'),_0x327692);_0x505966['on'](_0x0786('0x10'),_0x5e8aa7);_0x505966['on'](_0x0786('0x12'),_0x460e6b);});}; \ No newline at end of file +var _0x4337=['likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','moment','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x4337,0x11b));var _0x7433=function(_0x251deb,_0x1ce160){_0x251deb=_0x251deb-0x0;var _0x5a4eaf=_0x4337[_0x251deb];return _0x5a4eaf;};'use strict';var BPromise=require(_0x7433('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7433('0x1'));var crypto=require(_0x7433('0x2'));var logger=require('../../../../../../config/logger')(_0x7433('0x3'));module[_0x7433('0x4')]=function(_0x1a3a65,_0x55cdad,_0x1a143b,_0x4da978){return new BPromise(function(_0x6f4de2,_0x620c03){logger[_0x7433('0x5')](_0x7433('0x6'),_0x4da978||_0x7433('0x7'));var _0x3da39d=new WebSocket(_0x4da978||_0x7433('0x7'),{'perMessageDeflate':![]});var _0x4609e9='';var _0x5143f4='0';var _0x543fb5='1';var _0x4811be=_0x7433('0x8');function _0xb08d8e(_0x5ddeef){var _0xb34f5b=crypto[_0x7433('0x9')]('sha1');_0xb34f5b[_0x7433('0xa')](_0x5ddeef);return _0xb34f5b[_0x7433('0xb')](_0x7433('0xc'));}function _0x42edde(){try{logger[_0x7433('0x5')](_0x7433('0xd'));var _0x1bf4b1=moment()[_0x7433('0xe')]();var _0x4e47da=_0xb08d8e(_0x1bf4b1+_0x55cdad+_0x1a143b);_0x3da39d['send'](JSON[_0x7433('0xf')]({'appID':_0x55cdad,'timestamp':_0x1bf4b1,'appKey':_0x4e47da}));var _0x20f226=fs[_0x7433('0x10')](_0x1a3a65);_0x20f226['on']('data',function(_0x39cf8e){_0x3da39d[_0x7433('0x11')](_0x39cf8e);});_0x20f226['on'](_0x7433('0x12'),function(){_0x3da39d['send'](_0x7433('0x13'));});}catch(_0x1d5183){logger[_0x7433('0x14')](_0x7433('0x15'),JSON['stringify'](_0x1d5183));_0x3da39d[_0x7433('0x16')]();}}function _0x37a133(_0x4a1cc2){try{if(_0x4a1cc2){var _0x39d9ed=JSON[_0x7433('0x17')](_0x4a1cc2);switch(_0x39d9ed[_0x7433('0x18')]){case 0x0:if(_0x39d9ed[_0x7433('0x19')]){if(_0x39d9ed[_0x7433('0x19')]['final']){logger['info'](_0x7433('0x1a'),JSON[_0x7433('0xf')](_0x39d9ed[_0x7433('0x19')][_0x7433('0x1b')]));_0x4609e9=_0x39d9ed['result']['hypotheses'][0x0][_0x7433('0x1c')];_0x5143f4=_0x39d9ed[_0x7433('0x19')][_0x7433('0x1b')][0x0][_0x7433('0x1d')];_0x543fb5='0';_0x4811be='Success.';_0x3da39d[_0x7433('0x16')]();}}break;case 0x1:logger[_0x7433('0x5')](_0x7433('0x8'));_0x543fb5='1';_0x4811be=_0x7433('0x8');break;case 0x2:logger['info'](_0x7433('0x1e'));_0x543fb5='2';_0x4811be='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0x7433('0x1f'));_0x543fb5='9';_0x4811be=_0x7433('0x1f');break;case 0xa:logger[_0x7433('0x5')](_0x7433('0x20'));_0x543fb5='10';_0x4811be=_0x7433('0x20');break;case 0xb:logger[_0x7433('0x5')](_0x7433('0x21'));_0x543fb5='11';_0x4811be=_0x7433('0x21');}}}catch(_0x35baa9){logger[_0x7433('0x14')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x7433('0xf')](_0x35baa9));_0x3da39d[_0x7433('0x16')]();}}function _0x457b8c(){logger[_0x7433('0x5')](_0x7433('0x22'));_0x6f4de2({'transcript':_0x4609e9,'confidence':_0x5143f4,'status':_0x543fb5,'status_message':_0x4811be});}function _0x114f56(_0x425947){logger[_0x7433('0x14')](_0x7433('0x23'));if(!_[_0x7433('0x24')](_0x425947)){logger['error'](_[_0x7433('0x25')](_0x425947)?JSON[_0x7433('0xf')](_0x425947):_0x425947);}}_0x3da39d['on']('open',_0x42edde);_0x3da39d['on'](_0x7433('0x26'),_0x37a133);_0x3da39d['on'](_0x7433('0x12'),_0x457b8c);_0x3da39d['on'](_0x7433('0x14'),_0x114f56);});}; \ 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 40c45c2..a397eb4 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 _0x5936=['./asr'];(function(_0x41df4b,_0x31a3f6){var _0x98e2db=function(_0x722627){while(--_0x722627){_0x41df4b['push'](_0x41df4b['shift']());}};_0x98e2db(++_0x31a3f6);}(_0x5936,0xf8));var _0x6593=function(_0x340cfd,_0x1f50f5){_0x340cfd=_0x340cfd-0x0;var _0x19aebc=_0x5936[_0x340cfd];return _0x19aebc;};var asr=require(_0x6593('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xdc1b=['./asr','exports'];(function(_0x4d63cc,_0x33110b){var _0x11248b=function(_0x3f324b){while(--_0x3f324b){_0x4d63cc['push'](_0x4d63cc['shift']());}};_0x11248b(++_0x33110b);}(_0xdc1b,0x1e8));var _0xbdc1=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0xdc1b[_0x54edc9];return _0x2ae7a9;};var asr=require(_0xbdc1('0x0'));module[_0xbdc1('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 1c7c606..c47a492 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 _0x3c77=['projectUpdate','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','ready','connection','code','close','nextTick','inherits','exports','util','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','data','parse'];(function(_0x350c87,_0x2b44ef){var _0x163800=function(_0xb99c9){while(--_0xb99c9){_0x350c87['push'](_0x350c87['shift']());}};_0x163800(++_0x2b44ef);}(_0x3c77,0x9d));var _0x73c7=function(_0x52e674,_0x399620){_0x52e674=_0x52e674-0x0;var _0x2ca255=_0x3c77[_0x52e674];return _0x2ca255;};'use strict';var util=require(_0x73c7('0x0'));var net=require('net');var EventEmitter=require('events')['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x73c7('0x1'));var AGIServer=function(_0x3530b3,_0xe1113a,_0x254499){var _0xd30d84=this;var _0x21b22b=null;var _0x552f1c=0x0;if(!_0x3530b3)_0x3530b3=0x11dd;if(!_0xe1113a)_0xe1113a=_0x73c7('0x2');EventEmitter[_0x73c7('0x3')](_0xd30d84);function _0x2641fa(){if(!_0x3530b3){_0xd30d84[_0x73c7('0x4')](_0x73c7('0x5'),new AGIError(_0x73c7('0x6')));return![];}_0x21b22b=net['createServer']();_0x21b22b[_0x73c7('0x7')](_0x3530b3,_0xe1113a);_0x21b22b['on'](_0x73c7('0x8'),function(){_0xd30d84[_0x73c7('0x4')](_0x73c7('0x8'));});_0x21b22b['on']('connection',function(_0x1a057e){_0x1a057e['on'](_0x73c7('0x9'),function(_0x3d2ea4){try{var _0x2287ff=JSON[_0x73c7('0xa')](_0x3d2ea4);_0xd30d84[_0x73c7('0x4')](_0x73c7('0xb'),_0x2287ff);}catch(_0xe2a590){return;}});_0x21b22b[_0x73c7('0xc')](function(_0x139b45,_0x41f57d){if(_0x139b45){_0xd30d84[_0x73c7('0x4')]('error',new AGIError(_0x73c7('0xd'),_0x139b45));}else if(_0x254499&&_0x254499<0x0){_0xd30d84['emit']('error',new AGIError(_0x73c7('0xe')));_0x1a057e['destroy']();}else if(_0x254499&&_0x254499>0x0&&_0x254499<_0x41f57d){_0x552f1c+=0x1;_0xd30d84[_0x73c7('0x4')]('error',new AGIError(_0x73c7('0xf'),_0x552f1c));_0x1a057e[_0x73c7('0x10')]();}else{var _0x566687=new AGIChannel(_0x1a057e);_0x566687['on'](_0x73c7('0x11'),function(){_0xd30d84[_0x73c7('0x4')](_0x73c7('0x12'),_0x566687);});}});});_0x21b22b['on']('error',function(_0x52d76c){_0xd30d84[_0x73c7('0x4')](_0x73c7('0x5'),new AGIError(_0x73c7('0xd'),_0x52d76c[_0x73c7('0x13')]));});_0x21b22b['on'](_0x73c7('0x14'),function(){_0xd30d84[_0x73c7('0x4')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x73c7('0x15')](function(){_0x2641fa();});};util[_0x73c7('0x16')](AGIServer,EventEmitter);module[_0x73c7('0x17')]=function(_0x26e9f0,_0xb3f5dc,_0x214657){return new AGIServer(_0x26e9f0,_0xb3f5dc,_0x214657);}; \ No newline at end of file +var _0x1649=['inherits','util','net','events','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listening','connection','data','parse','projectUpdate','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','E_AGI_SERVER_CLOSE','nextTick'];(function(_0x233fb7,_0x58ae1a){var _0x4d165f=function(_0x3d7e8f){while(--_0x3d7e8f){_0x233fb7['push'](_0x233fb7['shift']());}};_0x4d165f(++_0x58ae1a);}(_0x1649,0x1cd));var _0x9164=function(_0x310e8f,_0x22bed2){_0x310e8f=_0x310e8f-0x0;var _0x1c4346=_0x1649[_0x310e8f];return _0x1c4346;};'use strict';var util=require(_0x9164('0x0'));var net=require(_0x9164('0x1'));var EventEmitter=require(_0x9164('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require('./channel');var AGIServer=function(_0x325133,_0x10e711,_0x583d5b){var _0x582a43=this;var _0x5504cc=null;var _0x296677=0x0;if(!_0x325133)_0x325133=0x11dd;if(!_0x10e711)_0x10e711=_0x9164('0x3');EventEmitter[_0x9164('0x4')](_0x582a43);function _0x525334(){if(!_0x325133){_0x582a43[_0x9164('0x5')]('error',new AGIError(_0x9164('0x6')));return![];}_0x5504cc=net[_0x9164('0x7')]();_0x5504cc['listen'](_0x325133,_0x10e711);_0x5504cc['on'](_0x9164('0x8'),function(){_0x582a43[_0x9164('0x5')]('listening');});_0x5504cc['on'](_0x9164('0x9'),function(_0x1e1681){_0x1e1681['on'](_0x9164('0xa'),function(_0xc3368d){try{var _0x25b61d=JSON[_0x9164('0xb')](_0xc3368d);_0x582a43[_0x9164('0x5')](_0x9164('0xc'),_0x25b61d);}catch(_0x1e3291){return;}});_0x5504cc[_0x9164('0xd')](function(_0x104f9a,_0x1504d8){if(_0x104f9a){_0x582a43[_0x9164('0x5')](_0x9164('0xe'),new AGIError(_0x9164('0xf'),_0x104f9a));}else if(_0x583d5b&&_0x583d5b<0x0){_0x582a43[_0x9164('0x5')](_0x9164('0xe'),new AGIError(_0x9164('0x10')));_0x1e1681[_0x9164('0x11')]();}else if(_0x583d5b&&_0x583d5b>0x0&&_0x583d5b<_0x1504d8){_0x296677+=0x1;_0x582a43[_0x9164('0x5')](_0x9164('0xe'),new AGIError(_0x9164('0x12'),_0x296677));_0x1e1681[_0x9164('0x11')]();}else{var _0x575a3f=new AGIChannel(_0x1e1681);_0x575a3f['on']('ready',function(){_0x582a43[_0x9164('0x5')](_0x9164('0x9'),_0x575a3f);});}});});_0x5504cc['on'](_0x9164('0xe'),function(_0x474e50){_0x582a43[_0x9164('0x5')](_0x9164('0xe'),new AGIError('E_AGI_SERVER_ERROR',_0x474e50['code']));});_0x5504cc['on'](_0x9164('0x13'),function(){_0x582a43[_0x9164('0x5')](_0x9164('0x13'),new AGIError(_0x9164('0x14')));});}process[_0x9164('0x15')](function(){_0x525334();});};util[_0x9164('0x16')](AGIServer,EventEmitter);module['exports']=function(_0x1db22f,_0x6cd63b,_0x376384){return new AGIServer(_0x1db22f,_0x6cd63b,_0x376384);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index a94833a..ef8e100 100644 --- a/server/services/agi/vertices.js +++ b/server/services/agi/vertices.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x67da=['map','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','text','en-US','ssmlGender','MALE','MP3','google_tts_language','url','method','number','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','uri','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','isPlainObject','%s.%s','setVariable','split','replaceAll','extra','result','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','command','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','add','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','sestektts','no\x20grammar\x20configured','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','SIP/%s','opts','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20is\x20unreachable','sesteknda','no\x20ndauth\x20url\x20configured','username','password','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','hiddendigitsnum','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','message','Amazon\x20Lex\x20is\x20unreachable','googleasr','no\x20key\x20configured','wav','%s/recordings/%s','generate','beep','NOBEEP','google\x20%s\x20file\x20created','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appsecret','no\x20appsecret\x20configured','intKey','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','recordFile','ispeech\x20%s\x20file\x20created','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','forEach','variable\x20%s[key]\x20set','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','saveRestApiResult','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','sendMail\x20message','account_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','then','getVoiceQueue','getVoiceQueueById','name','catch','prototype','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x67da,0x192));var _0xa67d=function(_0x5853ba,_0xcf1932){_0x5853ba=_0x5853ba-0x0;var _0x2c6aef=_0x67da[_0x5853ba];return _0x2c6aef;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0xa67d('0x0'));var sh=require(_0xa67d('0x1'));var odbc=require(_0xa67d('0x2'))();var rs=require(_0xa67d('0x3'));var moment=require(_0xa67d('0x4'));var Mustache=require(_0xa67d('0x5'));var rp=require(_0xa67d('0x6'));var logger=require(_0xa67d('0x7'))(_0xa67d('0x8'));var config=require(_0xa67d('0x9'));var shared=require('../../config/environment/shared');var scripts=require('./scripts');var FILES_PATH=_0xa67d('0xa');var recursiveMapAttributes=['rawHeaders',_0xa67d('0xb')];var verticesWithRetry=[_0xa67d('0xc'),_0xa67d('0xd'),_0xa67d('0xe')];var AGIVertices=function(_0x23cbc5,_0x285e16,_0x330a9f){this[_0xa67d('0xf')]=_0x23cbc5;this[_0xa67d('0x10')]=_0x285e16;this[_0xa67d('0x11')]=_0x330a9f;};AGIVertices['prototype'][_0xa67d('0x12')]=function(_0x3edd8d,_0x386665){this[_0xa67d('0x10')]['getVariableById'](_0x3edd8d)[_0xa67d('0x13')](function(_0x431f21){_0x386665(null,_0x431f21?_0x431f21['name']:![]);})['catch'](function(_0x304ee2){_0x386665(_0x304ee2);});};AGIVertices['prototype'][_0xa67d('0x14')]=function(_0x5c4cc3,_0x5d757b){this[_0xa67d('0x10')][_0xa67d('0x15')](_0x5c4cc3)['then'](function(_0x3f24cd){_0x5d757b(null,_0x3f24cd?_0x3f24cd[_0xa67d('0x16')]:![]);})[_0xa67d('0x17')](function(_0x288e5f){_0x5d757b(_0x288e5f);});};AGIVertices['prototype']['getSquareProject']=function(_0x4f443b,_0x4fa50f){this[_0xa67d('0x10')]['getSquareProjectById'](_0x4f443b)[_0xa67d('0x13')](function(_0xf8422c){_0x4fa50f(null,_0xf8422c?_0xf8422c[_0xa67d('0x16')]:![]);})[_0xa67d('0x17')](function(_0x273788){_0x4fa50f(_0x273788);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x19')]=function(_0x5538a5,_0x2c769a){this[_0xa67d('0x10')][_0xa67d('0x1a')](_0x5538a5)[_0xa67d('0x13')](function(_0x28f38b){_0x2c769a(null,_0x28f38b?_0x28f38b[_0xa67d('0x1b')]:![]);})['catch'](function(_0x3f1898){_0x2c769a(_0x3f1898);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x1c')]=function(_0xed6c3e,_0x48f240){this[_0xa67d('0x10')]['getUserById'](_0xed6c3e)[_0xa67d('0x13')](function(_0x415141){_0x48f240(null,_0x415141?_0x415141[_0xa67d('0x16')]:![]);})[_0xa67d('0x17')](function(_0x559009){_0x48f240(_0x559009);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x1d')]=function(_0x5ed92a,_0x321003){this[_0xa67d('0x10')][_0xa67d('0x1e')](_0x5ed92a)[_0xa67d('0x13')](function(_0x18ea95){_0x321003(null,_0x18ea95?_0x18ea95[_0xa67d('0x16')]:![]);})['catch'](function(_0x435e56){_0x321003(_0x435e56);});};AGIVertices[_0xa67d('0x18')]['getSound']=function(_0x2ac61a,_0x83b547){var _0x12d324=this;this[_0xa67d('0x10')][_0xa67d('0x1f')](_0x2ac61a)[_0xa67d('0x13')](function(_0x42c858){_0x83b547(null,_0x42c858?_0x12d324[_0xa67d('0x20')](_0x42c858[_0xa67d('0x21')]):![]);})[_0xa67d('0x17')](function(_0x2d0ce5){_0x83b547(_0x2d0ce5);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x22')]=function(_0x393269,_0x5e4f04){this[_0xa67d('0x10')][_0xa67d('0x23')](_0x393269)[_0xa67d('0x13')](function(_0x2703f5){_0x5e4f04(null,_0x2703f5?_0x2703f5:![]);})[_0xa67d('0x17')](function(_0x531343){_0x5e4f04(_0x531343);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x24')]=function(_0x3f57ed,_0x318090,_0x39faa1){this[_0xa67d('0x11')][_0xa67d('0x24')](_0x3f57ed,_0x318090)[_0xa67d('0x13')](function(){_0x39faa1(null);})[_0xa67d('0x17')](function(_0x2aa9c3){_0x39faa1(_0x2aa9c3);});};AGIVertices['prototype'][_0xa67d('0x25')]=function(_0x5ee31e,_0x26d827){this[_0xa67d('0x10')][_0xa67d('0x26')](_0x5ee31e)['then'](function(_0x22e032){if(_0x22e032){if(_0x22e032[_0xa67d('0x27')]){_0x26d827(null,[_0x22e032[_0xa67d('0x28')]]);}else{_0x26d827(null,_[_0xa67d('0x29')](_0x22e032[_0xa67d('0x2a')],_0xa67d('0x28')));}}else{_0x26d827(null,![]);}})['catch'](function(_0x20f178){_0x26d827(_0x20f178);});};AGIVertices[_0xa67d('0x18')]['getSoundPath']=function(_0x48f968){return util['format'](_0xa67d('0x2b'),FILES_PATH,_0x48f968);};AGIVertices['prototype'][_0xa67d('0x2c')]=function(_0x219652,_0x323f66,_0x37ad23){odbc[_0xa67d('0x2d')](_0x219652,function(_0x44310e){if(_0x44310e){logger[_0xa67d('0x2e')](_0xa67d('0x2f'),_0x44310e);_0x37ad23(_0x44310e);}else{logger[_0xa67d('0x30')](_0xa67d('0x31'));odbc[_0xa67d('0x32')](_0x323f66,function(_0x392447,_0x1427f1){if(_0x392447){logger['info']('Error\x20executing\x20query\x20%s',_0x323f66);_0x37ad23(_0x392447);}else{logger['info'](_0xa67d('0x33'),_0x323f66);odbc['close'](function(_0x1c6fee){if(_0x1c6fee){logger[_0xa67d('0x2e')](_0xa67d('0x34'),_0x1c6fee);}_0x37ad23(null,_0x1427f1);});}});}});};AGIVertices[_0xa67d('0x18')]['getSmsAccount']=function(_0xffa987,_0x46669f){this[_0xa67d('0x10')][_0xa67d('0x35')](_0xffa987)[_0xa67d('0x13')](function(_0x2d1457){_0x46669f(null,_0x2d1457?_0x2d1457:![]);})[_0xa67d('0x17')](function(_0x5b51dc){_0x46669f(_0x5b51dc);});};AGIVertices['prototype'][_0xa67d('0x36')]=function(_0x46ed8b,_0x32b70c){this[_0xa67d('0x10')][_0xa67d('0x36')](_0x46ed8b)[_0xa67d('0x13')](function(_0x57a27d){_0x32b70c(null,_0x57a27d);})[_0xa67d('0x17')](function(_0x4e3bf7){_0x32b70c(_0x4e3bf7);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x37')]=function(_0x2f698c,_0x5c88fb,_0x372085){this[_0xa67d('0x10')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0xa67d('0x38')],'node':_0x2f698c['label'],'application':_0x2f698c[_0xa67d('0x39')],'data':_0x5c88fb||null,'project_name':this[_0xa67d('0xf')][_0xa67d('0x3a')],'callerid':this['channel'][_0xa67d('0x3b')]})['then'](function(_0x214c7a){if(_0x372085){_0x372085(null,_0x214c7a);}})[_0xa67d('0x17')](function(_0x572ff0){if(_0x372085){_0x372085(_0x572ff0);}});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x3c')]=function(_0x43687e,_0x2f4fb2,_0x2a4b13,_0x213645){this[_0xa67d('0x10')][_0xa67d('0x3c')]({'uniqueid':this['channel'][_0xa67d('0x38')],'callerid':this[_0xa67d('0xf')][_0xa67d('0x3b')],'calleridname':this[_0xa67d('0xf')][_0xa67d('0x3d')],'context':this['channel']['context'],'extension':this[_0xa67d('0xf')][_0xa67d('0x3e')],'priority':this[_0xa67d('0xf')][_0xa67d('0x3f')],'accountcode':this[_0xa67d('0xf')]['accountcode'],'dnid':this[_0xa67d('0xf')]['dnid'],'projectName':this[_0xa67d('0xf')][_0xa67d('0x3a')],'saveName':_0x2f4fb2,'filename':_0x43687e[_0xa67d('0x40')]||_0x2f4fb2,'savePath':_0x2a4b13})[_0xa67d('0x13')](function(_0x21e38d){_0x213645(null,_0x21e38d);})['catch'](function(_0x38b76e){_0x213645(_0x38b76e);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x41')]=function(_0x5833c2,_0x256251,_0x3d544a,_0x4e455b,_0x43bedb){this[_0xa67d('0x10')]['createSquareMessage']({'uniqueid':this['channel'][_0xa67d('0x38')],'body':_0x5833c2,'direction':_0x256251,'providerName':_0x3d544a,'providerResponse':_0x4e455b})[_0xa67d('0x13')](function(_0x905bfe){if(_0x43bedb){_0x43bedb(null,_0x905bfe);}})[_0xa67d('0x17')](function(_0xffce3f){if(_0x43bedb){_0x43bedb(_0xffce3f);}});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x42')]=function(_0x3eb819,_0x242a01){this['rpc'][_0xa67d('0x42')]({'firstName':_[_0xa67d('0x43')](_0x3eb819['name'])||_[_0xa67d('0x44')](_0x3eb819[_0xa67d('0x16')])?'callback_'+Math[_0xa67d('0x45')]():_0x3eb819['name'],'lastName':_[_0xa67d('0x43')](_0x3eb819[_0xa67d('0x46')])||_[_0xa67d('0x44')](_0x3eb819[_0xa67d('0x46')])?null:_0x3eb819[_0xa67d('0x46')],'phone':_0x3eb819[_0xa67d('0x47')],'ListId':_0x3eb819[_0xa67d('0x48')],'scheduledat':_0x3eb819[_0xa67d('0x49')],'callbackUniqueid':this[_0xa67d('0xf')][_0xa67d('0x38')],'tags':_0xa67d('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x3eb819[_0xa67d('0x49')][_0xa67d('0x4b')](),'priority':_0x3eb819[_0xa67d('0x4c')]})[_0xa67d('0x13')](function(_0x539307){_0x242a01(null,_0x539307);})[_0xa67d('0x17')](function(_0x260e92){_0x242a01(_0x260e92);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x4d')]=function(_0x34e35f,_0x1639fe){this[_0xa67d('0x10')][_0xa67d('0x4e')](_0x34e35f)['then'](function(_0x569521){_0x1639fe(null,_0x569521?_0x569521['name']:![]);})[_0xa67d('0x17')](function(_0x5d4b5c){_0x1639fe(_0x5d4b5c);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x4f')]=function(_0x295a3c,_0x5e9e68,_0x4278f0){var _0x472b28={'role':_0xa67d('0x50')};_0x472b28[_0x295a3c]=this[_0xa67d('0xf')]['callerid'];this['rpc'][_0xa67d('0x4f')](_0x472b28,_0x5e9e68,this[_0xa67d('0xf')][_0xa67d('0x38')])[_0xa67d('0x13')](function(_0x32200d){_0x4278f0(null,_[_0xa67d('0x44')](_0x32200d)?![]:!![]);})[_0xa67d('0x17')](function(_0x5af704){logger[_0xa67d('0x2e')](_0x5af704);_0x4278f0(null,![]);});};AGIVertices[_0xa67d('0x18')]['agentUnpause']=function(_0x1a8574,_0x3d6d59){var _0x467c46={'role':'agent'};_0x467c46[_0x1a8574]=this[_0xa67d('0xf')][_0xa67d('0x3b')];this['rpc'][_0xa67d('0x51')](_0x467c46)[_0xa67d('0x13')](function(_0xb96936){_0x3d6d59(null,_['isNil'](_0xb96936)?![]:!![]);})[_0xa67d('0x17')](function(_0x17a89e){logger[_0xa67d('0x2e')](_0x17a89e);_0x3d6d59(null,![]);});};AGIVertices['prototype'][_0xa67d('0x52')]=function(_0x4ed172,_0x3e368f){var _0x4a2e2f={'role':_0xa67d('0x50')};_0x4a2e2f[_0x4ed172]=this[_0xa67d('0xf')][_0xa67d('0x3b')];this[_0xa67d('0x10')][_0xa67d('0x52')](_0x4a2e2f)['then'](function(_0x175028){_0x3e368f(null,_['isNil'](_0x175028)?![]:!![]);})[_0xa67d('0x17')](function(_0x24fa84){logger[_0xa67d('0x2e')](_0x24fa84);_0x3e368f(null,![]);});};AGIVertices['prototype'][_0xa67d('0x53')]=function(_0xaaf8cf,_0x192e62){var _0x3856ef={'role':_0xa67d('0x50')};_0x3856ef[_0xaaf8cf]=this[_0xa67d('0xf')][_0xa67d('0x3b')];var _0x50dfac=_0xaaf8cf!=_0xa67d('0x54')?util[_0xa67d('0x55')](_0xa67d('0x56'),_0xa67d('0x57'),this[_0xa67d('0xf')][_0xa67d('0x3b')]):undefined;this[_0xa67d('0x10')][_0xa67d('0x53')](_0x3856ef,_0x50dfac)[_0xa67d('0x13')](function(_0x59dd9e){_0x192e62(null,_[_0xa67d('0x44')](_0x59dd9e)?![]:!![]);})[_0xa67d('0x17')](function(_0x2a21c5){logger['error'](_0x2a21c5);_0x192e62(null,![]);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x58')]=function(_0x41ca15,_0x3c44fd){sh[_0xa67d('0x59')](_['trim'](_0x41ca15),function(_0x544929,_0x275bd6){var _0x2f80b4=_0x275bd6[_0xa67d('0x5a')](/(\r\n|\n|\r)/gm,'');_0x3c44fd(null,_0x2f80b4);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x5b')]=function(_0x189dd6,_0x28441d){scripts['googleCloudTTS'](_0x189dd6[_0xa67d('0x5c')],_0x189dd6['google_cloud_tts_text_type']||_0xa67d('0x5d'),_0x189dd6[_0xa67d('0x5d')],_0x189dd6['languageCode']||_0xa67d('0x5e'),_0x189dd6[_0xa67d('0x5f')]||_0xa67d('0x60'),_0x189dd6['audioEncoding']||_0xa67d('0x61'))[_0xa67d('0x13')](function(_0x3a7c2e){_0x28441d(null,_0x3a7c2e);})[_0xa67d('0x17')](function(_0x1032c2){_0x28441d(_0x1032c2);});};AGIVertices[_0xa67d('0x18')]['googleTTS']=function(_0x3cc975,_0x4cb621){scripts['googleTTS'](_0x3cc975[_0xa67d('0x5d')],_0x3cc975[_0xa67d('0x62')]||'en',0x1)['then'](function(_0x2997b4){_0x4cb621(null,_0x2997b4);})['catch'](function(_0x356ae5){_0x4cb621(_0x356ae5);});};AGIVertices[_0xa67d('0x18')]['restAPI']=function(_0xbe51dc,_0x16e9ff){var _0x19d8f7={'uri':_0xbe51dc[_0xa67d('0x63')],'method':_0xbe51dc[_0xa67d('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xbe51dc['timeout'])===_0xa67d('0x65')&&parseInt(_0xbe51dc[_0xa67d('0x66')])>=0x1?parseInt(_0xbe51dc['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xa67d('0x67')]([_0xa67d('0x68'),_0xa67d('0x69')],_0x19d8f7[_0xa67d('0x64')][_0xa67d('0x6a')]())){try{_0x19d8f7[_0xa67d('0x6b')]=_0xbe51dc[_0xa67d('0xb')]?JSON[_0xa67d('0x6c')](_0xbe51dc[_0xa67d('0xb')]):{};}catch(_0x144a49){logger[_0xa67d('0x2e')](_0xa67d('0x6d'),_0x144a49);}}try{_0x19d8f7[_0xa67d('0x6e')]=_0xbe51dc[_0xa67d('0x6f')]?JSON[_0xa67d('0x6c')](_0xbe51dc[_0xa67d('0x6f')]):{};}catch(_0x572877){logger[_0xa67d('0x2e')](_0xa67d('0x70'),_0x572877);}if(_0xbe51dc[_0xa67d('0x71')]){try{var _0x3adf5f=require(_0xbe51dc[_0xa67d('0x71')])[_0xa67d('0x72')](this,_0x19d8f7);_0x19d8f7['uri']=Mustache[_0xa67d('0x73')](_0xbe51dc['url'],_0x3adf5f,{},['$$','$$']);if(_0x19d8f7[_0xa67d('0x6e')]){_0x19d8f7[_0xa67d('0x6e')]=JSON['parse'](Mustache[_0xa67d('0x73')](JSON[_0xa67d('0x74')](_0x19d8f7['headers']),_0x3adf5f,{},['$$','$$']));}if(_0x19d8f7[_0xa67d('0x6b')]){_0x19d8f7[_0xa67d('0x6b')]=JSON[_0xa67d('0x6c')](Mustache[_0xa67d('0x73')](JSON[_0xa67d('0x74')](_0x19d8f7[_0xa67d('0x6b')]),_0x3adf5f,{},['$$','$$']));}}catch(_0x386ec5){logger[_0xa67d('0x2e')](_0xa67d('0x75'),_0x386ec5);}}rp(_0x19d8f7)['then'](function(_0x17e18f){var _0x48b888={'statusCode':_0x17e18f[_0xa67d('0x76')]||0xc8,'statusMessage':_0x17e18f[_0xa67d('0x77')]||'OK','headers':_0x17e18f[_0xa67d('0x6e')]||{},'body':_0x17e18f[_0xa67d('0x6b')]||{}};_0x16e9ff(null,_0x48b888);})[_0xa67d('0x17')](function(_0x1a01b1){var _0x4a6a81={'statusCode':_0x1a01b1[_0xa67d('0x76')]||0x1f4,'statusMessage':_0x1a01b1['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x1a01b1[_0xa67d('0x78')]['headers']||{},'body':_0x1a01b1[_0xa67d('0x78')][_0xa67d('0x6b')]||{}};_0x16e9ff(null,_0x4a6a81);});};AGIVertices[_0xa67d('0x18')]['googleDialogflow']=function(_0x26ecf9,_0x43e41b){scripts[_0xa67d('0x79')](this[_0xa67d('0xf')][_0xa67d('0x38')],_0x26ecf9[_0xa67d('0x7a')],_0x26ecf9[_0xa67d('0x5d')],_0x26ecf9[_0xa67d('0x7b')]||'en')[_0xa67d('0x13')](function(_0x135227){_0x43e41b(null,_0x135227);})[_0xa67d('0x17')](function(_0x41464c){_0x43e41b(_0x41464c);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x7c')]=function(_0x3db95b,_0x3de989){scripts['googleDialogflowV2'](this[_0xa67d('0xf')]['uniqueid'],_0x3db95b[_0xa67d('0x7d')],_0x3db95b[_0xa67d('0x7e')],_0x3db95b[_0xa67d('0x7f')],_0x3db95b[_0xa67d('0x5d')],_0x3db95b[_0xa67d('0x80')]||'en')['then'](function(_0x4ad826){_0x3de989(null,_0x4ad826);})[_0xa67d('0x17')](function(_0x325183){_0x3de989(_0x325183);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x81')]=function(_0x5d16c2,_0x1f79ca){scripts['sestekNDA'](this['channel'],_0x5d16c2)['then'](function(_0x21581a){_0x1f79ca(null,_0x21581a);})[_0xa67d('0x17')](function(_0x20ca67){_0x1f79ca(_0x20ca67);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x82')]=function(_0x26358f,_0x521c89){scripts[_0xa67d('0x82')](_0x26358f[_0xa67d('0x7a')],_0x26358f[_0xa67d('0x5d')],_0x26358f['ispeech_tts_language']||'en-US',_0x26358f[_0xa67d('0x83')])['then'](function(_0x5be0ed){_0x521c89(null,_0x5be0ed);})['catch'](function(_0x174b7a){_0x521c89(_0x174b7a);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x84')]=function(_0x348061,_0x1c5301,_0x2669c0){scripts['ispeechASR'](_0x1c5301,_0x348061[_0xa67d('0x7a')],_0x348061[_0xa67d('0x85')]||_0xa67d('0x5e'),this[_0xa67d('0x86')](_0x348061[_0xa67d('0x87')])?_0x348061['model']:undefined)[_0xa67d('0x13')](function(_0x2a36cd){_0x2669c0(null,_0x2a36cd);})[_0xa67d('0x17')](function(_0x40c9d3){_0x2669c0(_0x40c9d3);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x88')]=function(_0x376a29,_0x32facb){scripts[_0xa67d('0x88')](_0x376a29['aws_access_key_id'],_0x376a29[_0xa67d('0x89')],_0x376a29[_0xa67d('0x8a')],_0x376a29[_0xa67d('0x8b')]||'Amy',_0x376a29[_0xa67d('0x5d')],_0x376a29[_0xa67d('0x8c')]||_0xa67d('0x5d'))[_0xa67d('0x13')](function(_0x190084){_0x32facb(null,_0x190084);})[_0xa67d('0x17')](function(_0x54a775){_0x32facb(_0x54a775);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x8d')]=function(_0x51dbf5,_0x2911dc){scripts[_0xa67d('0x8d')](this[_0xa67d('0xf')][_0xa67d('0x38')],_0x51dbf5[_0xa67d('0x8e')],_0x51dbf5['aws_secret_access_key'],_0x51dbf5[_0xa67d('0x8f')],_0x51dbf5['text'],_0x51dbf5[_0xa67d('0x90')])['then'](function(_0x256e0e){_0x2911dc(null,_0x256e0e);})[_0xa67d('0x17')](function(_0x1d8a39){_0x2911dc(_0x1d8a39);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x91')]=function(_0x9633ba,_0x514e5a,_0x2d0a39){scripts[_0xa67d('0x91')](_0x514e5a,_0x9633ba['key'],_0x9633ba[_0xa67d('0x92')]||_0xa67d('0x5e'))['then'](function(_0x4107fe){_0x2d0a39(null,_0x4107fe);})[_0xa67d('0x17')](function(_0x1f2a42){_0x2d0a39(_0x1f2a42);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x93')]=function(_0x2ae823,_0xb54c2f,_0x4761c0){scripts['tildeASR'](_0xb54c2f,_0x2ae823[_0xa67d('0x94')],_0x2ae823['appsecret'],_0x2ae823[_0xa67d('0x95')])['then'](function(_0x4cda74){_0x4761c0(null,_0x4cda74);})[_0xa67d('0x17')](function(_0x14d65a){_0x4761c0(_0x14d65a);});};AGIVertices['prototype']['clear']=function(_0x32acda){var _0x5781ae=_[_0xa67d('0x67')](verticesWithRetry,_0x32acda[_0xa67d('0x39')])?_0x32acda:_[_0xa67d('0x96')](_0x32acda);for(var _0x1c9908 in _0x5781ae){if(_0x5781ae[_0xa67d('0x97')](_0x1c9908)){if(_0x5781ae[_0x1c9908]&&_[_0xa67d('0x98')](_0x5781ae[_0x1c9908])){if(_[_0xa67d('0x67')](recursiveMapAttributes,_0x1c9908)){_0x5781ae[_0x1c9908]=this[_0xa67d('0x99')](_0x5781ae[_0x1c9908]);}else{_0x5781ae[_0x1c9908]=this[_0xa67d('0x9a')](_0x5781ae[_0x1c9908]);}}}}return _0x5781ae;};AGIVertices[_0xa67d('0x18')][_0xa67d('0x9b')]=function(_0x128622){for(var _0xdc3296 in _0x128622){if(_0x128622[_0xa67d('0x97')](_0xdc3296)){if(_['isPlainObject'](_0x128622[_0xdc3296])){this[_0xa67d('0x9b')](_0x128622[_0xdc3296]);}else if(_[_0xa67d('0x9c')](_0x128622[_0xdc3296])){for(var _0x4e0c0e=0x0;_0x4e0c0e<_0x128622[_0xdc3296][_0xa67d('0x9d')];_0x4e0c0e++){this[_0xa67d('0x9b')](_0x128622[_0xdc3296][_0x4e0c0e]);}}else if(_[_0xa67d('0x98')](_0x128622[_0xdc3296])){_0x128622[_0xdc3296]=this[_0xa67d('0x9a')](_0x128622[_0xdc3296]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x360fd8,_0x330826){for(var _0x31792b in _0x360fd8){if(_0x360fd8[_0xa67d('0x97')](_0x31792b)){if(_[_0xa67d('0x9e')](_0x360fd8[_0x31792b])){if(!_[_0xa67d('0x43')](_0x360fd8[_0x31792b])){this['saveRestApiResult'](_0x360fd8[_0x31792b],util[_0xa67d('0x55')](_0xa67d('0x9f'),_0x330826,_0x31792b));}}else if(_['isArray'](_0x360fd8[_0x31792b])){for(var _0x148e42=0x0;_0x148e42<_0x360fd8[_0x31792b][_0xa67d('0x9d')];_0x148e42++){this['saveRestApiResult'](_0x360fd8[_0x31792b][_0x148e42],util['format'](_0xa67d('0x9f'),_0x330826,_0x31792b+'['+_0x148e42+']'));}}else{if(!_[_0xa67d('0x44')](_0x360fd8[_0x31792b])){this['channel'][_0xa67d('0xa0')](util[_0xa67d('0x55')](_0xa67d('0x9f'),_0x330826,_0x31792b),_0x360fd8[_0x31792b]);}}}}};AGIVertices[_0xa67d('0x18')][_0xa67d('0x99')]=function(_0x17334d){try{var _0x3c64ec=JSON[_0xa67d('0x6c')](_0x17334d);this[_0xa67d('0x9b')](_0x3c64ec);return JSON['stringify'](_0x3c64ec);}catch(_0x2340d){return this['replaceAllVariables'](_0x17334d);}};AGIVertices[_0xa67d('0x18')]['replaceAllVariables']=function(_0x4f0a06){var _0x5a80c8=_0x4f0a06[_0xa67d('0xa1')]('{');for(var _0x3fcc23=0x1;_0x3fcc23<_0x5a80c8[_0xa67d('0x9d')];_0x3fcc23+=0x1){var _0x4638d9=_0x5a80c8[_0x3fcc23]['split']('}');if(_0x4638d9['length']>0x1){_0x4f0a06=_0x4f0a06[_0xa67d('0xa2')]('{'+_0x4638d9[0x0]+'}',this['channel'][_0xa67d('0x12')](_0x4638d9[0x0])[_0xa67d('0xa3')]||_0x4638d9[0x0]);}}if(_0x5a80c8[_0xa67d('0x9d')]===0x1){return _0x4f0a06['toString']();}return this[_0xa67d('0x9a')](_0x4f0a06);};AGIVertices[_0xa67d('0x18')]['getAndSetVariable']=function(_0x24ada4,_0x452974){var _0x2a25d8=this[_0xa67d('0xf')][_0xa67d('0x12')](_0x24ada4);if(_0x2a25d8[_0xa67d('0xa4')]===-0x1){return _0x2a25d8;}logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x452974,_0x2a25d8[_0xa67d('0xa3')]));return this[_0xa67d('0xf')]['setVariable'](_0x452974,_0x2a25d8['extra']);};AGIVertices[_0xa67d('0x18')]['isConfigured']=function(_0x3c6885){return _0x3c6885&&_0x3c6885!=='0'&&_0x3c6885!=='-1'&&_0x3c6885!=='';};AGIVertices[_0xa67d('0x18')][_0xa67d('0xa5')]=function(_0x21c36a){this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x21c36a,'-');_0x21c36a[_0xa67d('0xa6')]=_0x21c36a['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa67d('0x18')]['mrcpsynth']=function(_0x2aae23){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xa7'),_0x2aae23['label']));if(!this['isConfigured'](_0x2aae23[_0xa67d('0x5d')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xa9'));}var _0x3aeb16='\x22'+_0x2aae23[_0xa67d('0x5d')]+'\x22';if(this[_0xa67d('0x86')](_0x2aae23[_0xa67d('0x78')])){_0x3aeb16+=','+_0x2aae23[_0xa67d('0x78')];}var _0xc2dd13=this['channel'][_0xa67d('0x59')](_0xa67d('0xaa'),_0x3aeb16);if(_0xc2dd13['result']===-0x1){return _0xc2dd13;}return this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xab'),_0x3aeb16));};AGIVertices[_0xa67d('0x18')][_0xa67d('0xac')]=function(_0x41cd5b){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xad'),_0x41cd5b[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x41cd5b[_0xa67d('0xaf')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')]('no\x20grammar\x20configured');}var _0x4d58ec=_0x41cd5b[_0xa67d('0xaf')];if(this[_0xa67d('0x86')](_0x41cd5b[_0xa67d('0x78')])){_0x4d58ec+=','+_0x41cd5b['options'];}var _0x2d297e=this['channel'][_0xa67d('0x59')](_0xa67d('0xb0'),_0x4d58ec);if(_0x2d297e[_0xa67d('0xa4')]===-0x1){return _0x2d297e;}var _0x348b13=this[_0xa67d('0xb1')](_0xa67d('0xb2'),_0xa67d('0xb3'));if(_0x348b13[_0xa67d('0xa4')]===-0x1){return _0x348b13;}var _0x2527c7=this[_0xa67d('0xb1')]('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x2527c7[_0xa67d('0xa4')]===-0x1){return _0x2527c7;}var _0x18f3f3=this[_0xa67d('0xb1')](_0xa67d('0xb4'),'MRCP_RECOG_INSTANCE');if(_0x18f3f3[_0xa67d('0xa4')]===-0x1){return _0x18f3f3;}return this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')](_0xa67d('0xb5'),_0x4d58ec));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x8')]=function(_0x3cca2a){logger['info'](util[_0xa67d('0x55')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x3cca2a[_0xa67d('0xae')]));return this[_0xa67d('0xf')][_0xa67d('0x8')]([_0x3cca2a[_0xa67d('0xb6')],_0x3cca2a['args']]);};AGIVertices[_0xa67d('0x18')]['answer']=function(_0x392109){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x392109[_0xa67d('0xae')]));if(this[_0xa67d('0x86')](_0x392109[_0xa67d('0x66')])){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x392109['timeout']));var _0xdeccac=this['channel'][_0xa67d('0xb7')](_0x392109[_0xa67d('0x66')]);if(_0xdeccac[_0xa67d('0xa4')]===-0x1){return _0xdeccac;}}return this[_0xa67d('0xf')][_0xa67d('0xb8')]();};AGIVertices[_0xa67d('0x18')][_0xa67d('0x4a')]=function(_0x146e13){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xb9'),_0x146e13[_0xa67d('0xae')]));if(!this['isConfigured'](_0x146e13['list_id'])){return this[_0xa67d('0xf')]['error'](_0x146e13,'no\x20list\x20selected');}_0x146e13[_0xa67d('0x49')]=moment();if(this[_0xa67d('0x86')](_0x146e13['delay'])){_0x146e13['scheduledAt']=moment()[_0xa67d('0xba')](_0x146e13['delay'],'minutes');}if(!this[_0xa67d('0x86')](_0x146e13[_0xa67d('0x4c')])){_0x146e13[_0xa67d('0x4c')]=0x2;}this[_0xa67d('0x42')][_0xa67d('0x72')](this,_0x146e13);return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x146e13[_0xa67d('0x47')],_0x146e13[_0xa67d('0x48')],_0x146e13[_0xa67d('0x49')]));};AGIVertices[_0xa67d('0x18')][_0xa67d('0xbb')]=function(_0x2a970c){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xbc'),_0x2a970c[_0xa67d('0xae')]));var _0x29c181=this['channel'][_0xa67d('0x59')](_0x2a970c[_0xa67d('0xbd')],_0x2a970c[_0xa67d('0x78')]);if(_0x29c181[_0xa67d('0xa4')]===-0x1){return _0x29c181;}return this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xbe'),_0x2a970c[_0xa67d('0xbd')],_0x2a970c[_0xa67d('0x78')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0x2c63f3){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x2c63f3[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x2c63f3[_0xa67d('0x5d')])){return this['channel']['noop'](_0xa67d('0xa9'));}var _0x53d53e='\x22'+_0x2c63f3[_0xa67d('0x5d')]+'\x22';if(this[_0xa67d('0x86')](_0x2c63f3[_0xa67d('0x78')])){_0x53d53e+=','+_0x2c63f3[_0xa67d('0x78')];}var _0x21a8d4=this[_0xa67d('0xf')][_0xa67d('0x59')](_0xa67d('0xaa'),_0x53d53e);if(_0x21a8d4['result']===-0x1){return _0x21a8d4;}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xab'),_0x53d53e));};AGIVertices[_0xa67d('0x18')][_0xa67d('0xbf')]=function(_0x4ad0cd){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x4ad0cd[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x4ad0cd[_0xa67d('0x5d')])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xa9'));}var _0xe03c01='\x22'+_0x4ad0cd['text']+'\x22';if(this[_0xa67d('0x86')](_0x4ad0cd[_0xa67d('0x78')])){_0xe03c01+=','+_0x4ad0cd[_0xa67d('0x78')];}var _0x274673=this['channel'][_0xa67d('0x59')](_0xa67d('0xaa'),_0xe03c01);if(_0x274673['result']===-0x1){return _0x274673;}return this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')]('Executed\x20command\x20MRCPSynth\x20%s',_0xe03c01));};AGIVertices[_0xa67d('0x18')]['lumenvoxasr']=function(_0x35b06d){logger[_0xa67d('0x30')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x35b06d[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x35b06d['grammar'])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xc0'));}var _0xc4e703=_0x35b06d[_0xa67d('0xaf')];if(this[_0xa67d('0x86')](_0x35b06d[_0xa67d('0x78')])){_0xc4e703+=','+_0x35b06d[_0xa67d('0x78')];}var _0x5e56a5=this[_0xa67d('0xf')][_0xa67d('0x59')](_0xa67d('0xb0'),_0xc4e703);if(_0x5e56a5[_0xa67d('0xa4')]===-0x1){return _0x5e56a5;}var _0x31830c=this[_0xa67d('0xb1')](_0xa67d('0xb2'),'LUMENVOX_ASR_CONFIDENCE');if(_0x31830c[_0xa67d('0xa4')]===-0x1){return _0x31830c;}var _0x48b13e=this[_0xa67d('0xb1')](_0xa67d('0xc1'),_0xa67d('0xc2'));if(_0x48b13e[_0xa67d('0xa4')]===-0x1){return _0x48b13e;}var _0x386b6e=this[_0xa67d('0xb1')](_0xa67d('0xb4'),_0xa67d('0xc3'));if(_0x386b6e[_0xa67d('0xa4')]===-0x1){return _0x386b6e;}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format'](_0xa67d('0xb5'),_0xc4e703));};AGIVertices[_0xa67d('0x18')]['sestekasr']=function(_0x1f4e0f){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xc4'),_0x1f4e0f[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x1f4e0f[_0xa67d('0xaf')])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xc0'));}var _0x40c3a4=_0x1f4e0f[_0xa67d('0xaf')];if(this[_0xa67d('0x86')](_0x1f4e0f['options'])){_0x40c3a4+=','+_0x1f4e0f[_0xa67d('0x78')];}var _0x7f01e6=this[_0xa67d('0xf')][_0xa67d('0x59')]('MRCPRecog',_0x40c3a4);if(_0x7f01e6[_0xa67d('0xa4')]===-0x1){return _0x7f01e6;}var _0x22c799=this[_0xa67d('0xb1')](_0xa67d('0xb2'),_0xa67d('0xc5'));if(_0x22c799['result']===-0x1){return _0x22c799;}var _0x5c4f2c=this['getAndSetVariable'](_0xa67d('0xc1'),_0xa67d('0xc6'));if(_0x5c4f2c[_0xa67d('0xa4')]===-0x1){return _0x5c4f2c;}var _0x1339df=this['getAndSetVariable'](_0xa67d('0xb4'),_0xa67d('0xc7'));if(_0x1339df[_0xa67d('0xa4')]===-0x1){return _0x1339df;}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format'](_0xa67d('0xb5'),_0x40c3a4));};AGIVertices['prototype'][_0xa67d('0xc8')]=function(_0x2af58b){logger['info'](util[_0xa67d('0x55')](_0xa67d('0xc9'),_0x2af58b[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x2af58b[_0xa67d('0xca')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x2af58b,_0xa67d('0xcb'));}var _0x1beeac=this[_0xa67d('0x19')][_0xa67d('0x72')](this,_0x2af58b[_0xa67d('0xca')]);if(!_0x1beeac){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x2af58b,'no\x20odbc\x20database\x20found');}if(!this[_0xa67d('0x86')](_0x2af58b[_0xa67d('0x32')])){return this['channel'][_0xa67d('0x2e')](_0x2af58b,_0xa67d('0xcc'));}var _0x5a36b6=_0x2af58b[_0xa67d('0x32')][_0xa67d('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xcd'),_0x5a36b6));var _0x3bfab1=this[_0xa67d('0x2c')][_0xa67d('0x72')](this,_0x1beeac,_0x5a36b6);this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x2af58b,_0x5a36b6);if(!this[_0xa67d('0x86')](_0x2af58b[_0xa67d('0xce')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xcf'));}var _0x57e43c=this[_0xa67d('0x12')][_0xa67d('0x72')](this,_0x2af58b[_0xa67d('0xce')]);if(!_0x57e43c){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x2af58b,_0xa67d('0xd0'));}var _0x3975bd=this;_0x3bfab1['forEach'](function(_0x46ba20,_0x54500a){Object[_0xa67d('0xd1')](_0x46ba20)['forEach'](function(_0x26b304){_0x3975bd[_0xa67d('0xf')][_0xa67d('0xa0')](util['format'](_0xa67d('0xd2'),_0x57e43c,_0x54500a,_0x26b304),_0x46ba20[_0x26b304]);});});this[_0xa67d('0xf')][_0xa67d('0xa0')](util[_0xa67d('0x55')](_0xa67d('0xd3'),_0x57e43c),_0x3bfab1[_0xa67d('0x9d')]);return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xd4'),_0x57e43c));};AGIVertices['prototype'][_0xa67d('0xd5')]=function(_0x147196){logger[_0xa67d('0xd6')](util[_0xa67d('0x55')](_0xa67d('0xd7'),_0x147196[_0xa67d('0xae')]));if(!this['isConfigured'](_0x147196['sip_id'])){return this[_0xa67d('0xf')]['error'](_0x147196,_0xa67d('0xd8'));}var _0x2899cb=this['getUser'][_0xa67d('0x72')](this,_0x147196[_0xa67d('0xd9')]);if(!_0x2899cb){return this['channel'][_0xa67d('0x2e')](_0x147196,'no\x20user\x20found');}var _0xd7958b=this[_0xa67d('0xf')]['exec']('DIAL',[util[_0xa67d('0x55')](_0xa67d('0xda'),_0x2899cb),_0x147196['timeout'],_0x147196[_0xa67d('0xdb')],_0x147196['url']]);if(_0xd7958b[_0xa67d('0xa4')]===-0x1){return _0xd7958b;}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('Executed\x20command\x20%s',_0xa67d('0xdc')));};AGIVertices['prototype'][_0xa67d('0xdd')]=function(_0x8ad00e){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xde'),_0x8ad00e[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x8ad00e[_0xa67d('0x7a')])){return this['channel'][_0xa67d('0xa8')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x8ad00e[_0xa67d('0x5d')])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xa9'));}this[_0xa67d('0xf')]['bot']=!![];this['createSquareDetailsReport'](_0x8ad00e);this[_0xa67d('0x41')](_0x8ad00e[_0xa67d('0x5d')],'in','','');this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('Trying\x20Dialogflow:\x20%s',_0x8ad00e[_0xa67d('0x5d')]));var _0x52c266=this['googleDialogflow'][_0xa67d('0x72')](this,_0x8ad00e);if(_0x52c266){for(var _0x55dc94 in _0x52c266){if(_0x52c266[_0xa67d('0x97')](_0x55dc94)){this[_0xa67d('0xf')][_0xa67d('0xa0')](util['format'](_0xa67d('0xdf'),_0x55dc94[_0xa67d('0x6a')]()),_0x52c266[_0x55dc94]);}}this[_0xa67d('0x41')](_0x52c266[_0xa67d('0xe0')],_0xa67d('0xe1'),_0xa67d('0xdd'),'');return this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xe2'),_0x52c266[_0xa67d('0xe0')]));}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x8ad00e,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xa67d('0x18')]['dialogflowV2']=function(_0x23df5a){logger['info'](util['format'](_0xa67d('0xe3'),_0x23df5a[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x23df5a[_0xa67d('0x7d')])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xe4'));}if(!this[_0xa67d('0x86')](_0x23df5a['client_email'])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xe5'));}if(!this[_0xa67d('0x86')](_0x23df5a[_0xa67d('0x7f')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xe6'));}if(!this[_0xa67d('0x86')](_0x23df5a['dialogflowV2_language'])){return this[_0xa67d('0xf')][_0xa67d('0xa8')]('no\x20anguage\x20configured');}if(!this['isConfigured'](_0x23df5a['text'])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xa9'));}this[_0xa67d('0xf')]['bot']=!![];this[_0xa67d('0x37')](_0x23df5a);this[_0xa67d('0x41')](_0x23df5a['text'],'in','','');this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xe7'),_0x23df5a[_0xa67d('0x5d')]));var _0x501572=this[_0xa67d('0x7c')][_0xa67d('0x72')](this,_0x23df5a);if(_0x501572){for(var _0x362ad8 in _0x501572){if(_0x501572[_0xa67d('0x97')](_0x362ad8)){if(_0x362ad8!==_0xa67d('0xe8')){this[_0xa67d('0xf')][_0xa67d('0xa0')](util['format']('DIALOGFLOW_%s',_0x362ad8['toUpperCase']()),_0x501572[_0x362ad8]);}}}this[_0xa67d('0x41')](_0x501572['speech'],'out',_0xa67d('0xe9'),_0x501572[_0xa67d('0xe8')]);return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('DialogflowV2\x20Result\x20%s',_0x501572[_0xa67d('0xe0')]));}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x23df5a,_0xa67d('0xea'));};AGIVertices[_0xa67d('0x18')][_0xa67d('0xeb')]=function(_0xda8e9d){logger[_0xa67d('0x30')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0xda8e9d[_0xa67d('0xae')]));if(!this['isConfigured'](_0xda8e9d['ndauth_url'])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xec'));}if(!this[_0xa67d('0x86')](_0xda8e9d[_0xa67d('0xed')])){return this['channel'][_0xa67d('0xa8')]('no\x20username\x20configured');}if(!this[_0xa67d('0x86')](_0xda8e9d[_0xa67d('0xee')])){return this[_0xa67d('0xf')]['noop']('no\x20password\x20configured');}if(!this[_0xa67d('0x86')](_0xda8e9d[_0xa67d('0xef')])){return this['channel']['noop'](_0xa67d('0xa9'));}this[_0xa67d('0xf')][_0xa67d('0xf0')]=!![];this[_0xa67d('0x37')](_0xda8e9d);this[_0xa67d('0x41')](_0xda8e9d[_0xa67d('0x5d')],'in','','');this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xf1'),_0xda8e9d[_0xa67d('0x5d')]));var _0x1a240a=this[_0xa67d('0x81')][_0xa67d('0x72')](this,_0xda8e9d);if(_0x1a240a){for(var _0x43ef9d in _0x1a240a){if(_0x1a240a[_0xa67d('0x97')](_0x43ef9d)){this[_0xa67d('0xf')]['setVariable'](util[_0xa67d('0x55')]('SESTEK_NDA_%s',_0x43ef9d[_0xa67d('0x6a')]()),_0x1a240a[_0x43ef9d]);}}this['createSquareMessage'](_0x1a240a[_0xa67d('0xe0')],_0xa67d('0xe1'),'sesteknda','');if(_0x1a240a[_0xa67d('0xf2')]){this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xf3'),_0x1a240a[_0xa67d('0xf2')]));var _0x138d9e=this['channel']['streamFile'](_0x1a240a[_0xa67d('0xf2')]);try{fs['unlink'](_0x1a240a['audiofile']+_0xa67d('0xf4'));}catch(_0x1a4777){logger[_0xa67d('0x2e')](_0x1a4777);}return _0x138d9e;}else{return this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xf5'),_0x1a240a[_0xa67d('0xe0')]));}}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0xda8e9d,_0xa67d('0xf6'));};AGIVertices[_0xa67d('0x18')]['end']=function(_0x38fa89){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xf7'),_0x38fa89[_0xa67d('0xae')]));return this[_0xa67d('0xf')]['noop']('end');};AGIVertices[_0xa67d('0x18')][_0xa67d('0xf8')]=function(_0x5539dc){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xf9'),_0x5539dc['label']));var _0x263b33='';if(_0x5539dc[_0xa67d('0xfa')]){if(!this[_0xa67d('0x86')](_0x5539dc[_0xa67d('0xfa')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5539dc,'no\x20trunk\x20selected');}else{var _0x2cbc3a=parseInt(_0x5539dc['trunk_id'],0xa);if(isNaN(_0x2cbc3a)){_0x263b33=_0x5539dc['trunk_id'];}else{_0x263b33=this[_0xa67d('0x1d')][_0xa67d('0x72')](this,_0x5539dc['trunk_id']);if(!_0x263b33){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5539dc,_0xa67d('0xfb'));}}}}else if(_0x5539dc[_0xa67d('0xfc')]){_0x263b33=_0x5539dc['trunk_name'];}else{return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5539dc,_0xa67d('0xfd'));}var _0x5b416f=this[_0xa67d('0xf')]['exec'](_0xa67d('0xdc'),[util[_0xa67d('0x55')](_0xa67d('0xfe'),_0x263b33,_0x5539dc[_0xa67d('0x47')]),_0x5539dc[_0xa67d('0x66')],_0x5539dc[_0xa67d('0xdb')],_0x5539dc[_0xa67d('0x63')]]);if(_0x5b416f[_0xa67d('0xa4')]===-0x1){return _0x5b416f;}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xff'),_0xa67d('0xdc')));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x100')]=function(_0x1748d4){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x1748d4[_0xa67d('0xae')]));return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x100'));};AGIVertices[_0xa67d('0x18')]['getdigits']=function(_0x33718c){logger[_0xa67d('0x30')](util['format'](_0xa67d('0x101'),_0x33718c[_0xa67d('0xae')]));if(_0x33718c[_0xa67d('0xa6')]===0x0){return this[_0xa67d('0xa5')](_0x33718c);}_0x33718c[_0xa67d('0xa6')]-=0x1;if(!this[_0xa67d('0x86')](_0x33718c[_0xa67d('0x102')])){return this['channel']['error'](_0x33718c,_0xa67d('0x103'));}var _0x53dcb3=this[_0xa67d('0x104')][_0xa67d('0x72')](this,_0x33718c[_0xa67d('0x102')]);if(!_0x53dcb3){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x33718c,_0xa67d('0x105'));}if(!this[_0xa67d('0x86')](_0x33718c[_0xa67d('0xce')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0xa67d('0xcf'));}var _0x36ed18=this[_0xa67d('0xf')][_0xa67d('0x106')](_0x53dcb3,_0x33718c['response'],_0x33718c[_0xa67d('0x107')]);var _0x165d8d=_0x36ed18[_0xa67d('0xa4')]?_0x36ed18[_0xa67d('0xa4')][_0xa67d('0x4b')]():'';logger[_0xa67d('0x30')](_0xa67d('0x108'),JSON[_0xa67d('0x74')](_0x36ed18));if(_0x36ed18['result']===-0x1){this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x33718c,_0x165d8d);return _0x36ed18;}else if(_0x36ed18['extra']==='timeout'){_0x36ed18[_0xa67d('0xa4')]=_0x165d8d[_0xa67d('0x9d')]>=parseInt(_0x33718c[_0xa67d('0x109')])?'x':'i';}else{_0x36ed18['result']=_0x165d8d['length']>=parseInt(_0x33718c['mindigit'])&&_0x165d8d[_0xa67d('0x9d')]<=parseInt(_0x33718c[_0xa67d('0x107')])?'x':'i';}var _0x510987=this['getVariable'][_0xa67d('0x72')](this,_0x33718c[_0xa67d('0xce')]);if(!_0x510987){return this['channel'][_0xa67d('0x2e')](_0x33718c,_0xa67d('0xd0'));}this[_0xa67d('0xf')]['setVariable'](_0x510987,_0x165d8d);if(this['isConfigured'](_0x33718c[_0xa67d('0x10a')])){var _0x3be0ea=parseInt(_0x33718c[_0xa67d('0x10a')],0xa);var _0x17e4b=rs['generate']({'charset':'*','length':_0x3be0ea});var _0x1e03d1=_0x165d8d[_0xa67d('0x9d')];if(_0x1e03d1>0x0){if(_0x1e03d1>_0x3be0ea){this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x33718c,_0x33718c['hiddendigitspos']===_0xa67d('0x10b')?_0x17e4b+_0x165d8d[_0xa67d('0x10c')](_0x3be0ea):_0x165d8d[_0xa67d('0x10c')](0x0,_0x1e03d1-_0x3be0ea)+_0x17e4b);}else{this['createSquareDetailsReport'][_0xa67d('0x72')](this,_0x33718c,rs['generate']({'charset':'*','length':_0x1e03d1}));}}else{this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x33718c,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x33718c,_0x165d8d);}return _0x36ed18;};AGIVertices['prototype'][_0xa67d('0xe')]=function(_0x5d0372){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x5d0372[_0xa67d('0xae')]));return this[_0xa67d('0xd')](_0x5d0372);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x10d')]=function(_0x225215){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x10e'),_0x225215[_0xa67d('0xae')]));this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x225215,_0x225215[_0xa67d('0x10f')]);return this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x110'),_0x225215[_0xa67d('0x10f')]));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x111')]=function(_0x42c7c0){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x112'),_0x42c7c0['label']));if(!this[_0xa67d('0x86')](_0x42c7c0['aws_access_key_id'])||!this['isConfigured'](_0x42c7c0[_0xa67d('0x89')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x113'));}if(!this[_0xa67d('0x86')](_0x42c7c0[_0xa67d('0x5d')])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xa9'));}this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format']('Trying\x20aws\x20Polly\x20%s',_0x42c7c0[_0xa67d('0x5d')]));var _0x2c7142=this[_0xa67d('0x88')]['sync'](this,_0x42c7c0);if(_0x2c7142){this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')]('aws\x20Polly\x20%s\x20file\x20created',_0x2c7142));var _0x337cf7=this[_0xa67d('0xf')]['streamFile'](_0x2c7142);try{fs[_0xa67d('0x114')](_0x2c7142+'.wav');}catch(_0x13988c){logger[_0xa67d('0x2e')](_0x13988c);}return _0x337cf7;}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x42c7c0,_0xa67d('0x115'));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x116')]=function(_0x500f0b){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x117'),_0x500f0b[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x500f0b[_0xa67d('0x8e')])||!this[_0xa67d('0x86')](_0x500f0b[_0xa67d('0x89')])){return this['channel'][_0xa67d('0xa8')](_0xa67d('0x113'));}if(!this['isConfigured'](_0x500f0b[_0xa67d('0x90')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x500f0b[_0xa67d('0x5d')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xa9'));}this[_0xa67d('0xf')]['bot']=!![];this[_0xa67d('0x37')](_0x500f0b);this[_0xa67d('0x41')](_0x500f0b['text'],'in','','');this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x118'),_0x500f0b[_0xa67d('0x5d')]));var _0x16812e=this['awsLex'][_0xa67d('0x72')](this,_0x500f0b);if(_0x16812e){for(var _0x29c37d in _0x16812e){if(_0x16812e['hasOwnProperty'](_0x29c37d)&&_[_0xa67d('0x98')](_0x16812e[_0x29c37d])){this[_0xa67d('0xf')][_0xa67d('0xa0')](util[_0xa67d('0x55')]('AWS_LEX_%s',_0x29c37d[_0xa67d('0x6a')]()),_0x16812e[_0x29c37d]);}}if(_['isNil'](_0x16812e['message'])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x119'));}else{this[_0xa67d('0x41')](_0x16812e['message'],'out',_0xa67d('0x11a'),'');return this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format'](_0xa67d('0x11b'),_0x16812e[_0xa67d('0x11c')]));}}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x500f0b,_0xa67d('0x11d'));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x11e')]=function(_0x41172c){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x41172c[_0xa67d('0xae')],_0x41172c[_0xa67d('0x66')]));if(!this[_0xa67d('0x86')](_0x41172c[_0xa67d('0x7a')])){return this['channel'][_0xa67d('0xa8')](_0xa67d('0x11f'));}var _0x6820=_0xa67d('0x120');var _0x1d2d55=util['format'](_0xa67d('0x121'),FILES_PATH,rs[_0xa67d('0x122')](0x4));var _0x4b8e2a=util[_0xa67d('0x55')](_0xa67d('0x9f'),_0x1d2d55,_0x6820);var _0x40575c=!![];if(_0x41172c[_0xa67d('0x123')]===_0xa67d('0x124')){_0x40575c=![];}var _0x2cf23a=this[_0xa67d('0xf')]['recordFile'](_0x1d2d55,_0x6820,_0x41172c['intKey'],_0x41172c[_0xa67d('0x66')],undefined,_0x40575c);if(_0x2cf23a[_0xa67d('0xa4')]!==-0x1){this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x125'),_0x4b8e2a));var _0x3dbfda=this[_0xa67d('0x91')][_0xa67d('0x72')](this,_0x41172c,_0x4b8e2a);if(_0x3dbfda){for(var _0x3ce8a1 in _0x3dbfda){if(_0x3dbfda[_0xa67d('0x97')](_0x3ce8a1)){this[_0xa67d('0xf')][_0xa67d('0xa0')](util[_0xa67d('0x55')]('GOOGLE_ASR_%s',_0x3ce8a1[_0xa67d('0x6a')]()),_0x3dbfda[_0x3ce8a1]);}}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x3dbfda)));}}return _0x2cf23a;};AGIVertices[_0xa67d('0x18')][_0xa67d('0x126')]=function(_0x19da4b){logger['info'](util['format'](_0xa67d('0x127'),_0x19da4b['label']));if(!this[_0xa67d('0x86')](_0x19da4b['appid'])){return this[_0xa67d('0xf')][_0xa67d('0xa8')]('no\x20appid\x20configured');}if(!this[_0xa67d('0x86')](_0x19da4b[_0xa67d('0x128')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x129'));}var _0x1b631c=_0xa67d('0x120');var _0x2f1a1a=util[_0xa67d('0x55')]('%s/recordings/%s',FILES_PATH,rs[_0xa67d('0x122')](0x4));var _0x3d0300=util[_0xa67d('0x55')](_0xa67d('0x9f'),_0x2f1a1a,_0x1b631c);var _0x443c35=!![];if(_0x19da4b[_0xa67d('0x123')]===_0xa67d('0x124')){_0x443c35=![];}var _0x5076f0=this[_0xa67d('0xf')]['recordFile'](_0x2f1a1a,_0x1b631c,_0x19da4b[_0xa67d('0x12a')],_0x19da4b[_0xa67d('0x66')],undefined,_0x443c35);if(_0x5076f0['result']!==-0x1){this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')]('tilde\x20%s\x20file\x20created',_0x3d0300));var _0x403e32=this['tildeASR']['sync'](this,_0x19da4b,_0x3d0300);if(_0x403e32){for(var _0x4e4a3a in _0x403e32){if(_0x403e32[_0xa67d('0x97')](_0x4e4a3a)){this[_0xa67d('0xf')][_0xa67d('0xa0')](util['format'](_0xa67d('0x12b'),_0x4e4a3a[_0xa67d('0x6a')]()),_0x403e32[_0x4e4a3a]);}}return this['channel'][_0xa67d('0xa8')](util['format']('TildeASR\x20Result\x20%s',JSON[_0xa67d('0x74')](_0x403e32)));}}return _0x5076f0;};AGIVertices[_0xa67d('0x18')][_0xa67d('0x12c')]=function(_0x4e3e46){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x12d'),_0x4e3e46[_0xa67d('0xae')]));return this[_0xa67d('0xf')]['continueAt'](_0x4e3e46[_0xa67d('0x12e')],_0x4e3e46['extension'],_0x4e3e46['priority']);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x12f')]=function(_0x3ae555){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x3ae555[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x3ae555['condition'])){return this['channel']['error'](_0x3ae555,_0xa67d('0x130'));}try{var _0x3011d1=eval(_0x3ae555[_0xa67d('0x131')])?_0xa67d('0x132'):_0xa67d('0x133');this['channel']['noop'](util['format'](_0xa67d('0x134'),_0x3ae555[_0xa67d('0x131')],_0x3011d1));return{'code':0xc8,'result':_0x3011d1};}catch(_0x44ebea){return{'code':0xc8,'result':_0xa67d('0x133')};}};AGIVertices[_0xa67d('0x18')]['gotoiftime']=function(_0x4f26cd){logger[_0xa67d('0x30')](util['format'](_0xa67d('0x135'),_0x4f26cd[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x4f26cd[_0xa67d('0x136')])){return this[_0xa67d('0xf')]['error'](_0x4f26cd,_0xa67d('0x137'));}var _0x46c467=this[_0xa67d('0x25')]['sync'](this,_0x4f26cd[_0xa67d('0x136')]);if(!_0x46c467){return this[_0xa67d('0xf')]['error'](_0x4f26cd,_0xa67d('0x138'));}for(var _0x204e15=0x0;_0x204e15<_0x46c467[_0xa67d('0x9d')];_0x204e15+=0x1){var _0x50d5f8=this[_0xa67d('0xf')][_0xa67d('0x12')](util[_0xa67d('0x55')]('IFTIME(%s?true:false)',_0x46c467[_0x204e15]));if(_0x50d5f8[_0xa67d('0xa4')]===-0x1){return _0x50d5f8;}logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x139'),_0x46c467[_0x204e15],_0x50d5f8[_0xa67d('0xa3')]));if(_0x50d5f8[_0xa67d('0xa3')]===_0xa67d('0x132')){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x139'),_0x46c467[_0x204e15],_0xa67d('0x132')));this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format'](_0xa67d('0x139'),_0x46c467[_0x204e15],_0xa67d('0x132')));return{'code':0xc8,'result':'true'};}else{logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('IFTIME\x20%s\x20%s',_0x46c467[_0x204e15],_0xa67d('0x133')));this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('IFTIME\x20%s\x20%s',_0x46c467[_0x204e15],_0xa67d('0x133')));}}return{'code':0xc8,'result':_0xa67d('0x133')};};AGIVertices['prototype']['hangup']=function(_0x43e92b){logger['info'](util['format'](_0xa67d('0x13a'),_0x43e92b[_0xa67d('0xae')]));return this['channel']['hangup']();};AGIVertices['prototype'][_0xa67d('0x13b')]=function(_0x62b5c1){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x13c'),_0x62b5c1[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x62b5c1[_0xa67d('0x7a')])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0x11f'));}var _0x5bf004=_0xa67d('0x120');var _0x5ea2fd=util[_0xa67d('0x55')](_0xa67d('0x121'),FILES_PATH,rs[_0xa67d('0x122')](0x4));var _0x4ee367=util['format'](_0xa67d('0x9f'),_0x5ea2fd,_0x5bf004);var _0x2e3b51=!![];if(_0x62b5c1['beep']===_0xa67d('0x124')){_0x2e3b51=![];}var _0xde8c6e=this[_0xa67d('0xf')][_0xa67d('0x13d')](_0x5ea2fd,_0x5bf004,_0x62b5c1[_0xa67d('0x12a')],_0x62b5c1[_0xa67d('0x66')],undefined,_0x2e3b51);if(_0xde8c6e['result']!==-0x1){this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')](_0xa67d('0x13e'),_0x4ee367));var _0x1da847=this[_0xa67d('0x84')][_0xa67d('0x72')](this,_0x62b5c1,_0x4ee367);if(_0x1da847){for(var _0x4c33a6 in _0x1da847){if(_0x1da847[_0xa67d('0x97')](_0x4c33a6)){this[_0xa67d('0xf')][_0xa67d('0xa0')](util[_0xa67d('0x55')]('ISPEECH_ASR_%s',_0x4c33a6['toUpperCase']()),_0x1da847[_0x4c33a6]);}}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format']('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x1da847)));}}return _0xde8c6e;};AGIVertices['prototype'][_0xa67d('0x13f')]=function(_0x587a6a){logger['info'](util['format'](_0xa67d('0x140'),_0x587a6a['label']));if(!this[_0xa67d('0x86')](_0x587a6a[_0xa67d('0x7a')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')]('no\x20key\x20configured');}if(!this[_0xa67d('0x86')](_0x587a6a[_0xa67d('0x5d')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xa9'));}this[_0xa67d('0xf')]['noop'](util['format'](_0xa67d('0x141'),_0x587a6a[_0xa67d('0x5d')]));var _0x4439cb=this[_0xa67d('0x82')][_0xa67d('0x72')](this,_0x587a6a);if(_0x4439cb){this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x13e'),_0x4439cb));var _0x2eedf8=this[_0xa67d('0xf')][_0xa67d('0x142')](_0x4439cb,_0x587a6a[_0xa67d('0x12a')]);try{fs[_0xa67d('0x114')](_0x4439cb+_0xa67d('0xf4'));}catch(_0x3db40f){logger[_0xa67d('0x2e')](_0x3db40f);}return _0x2eedf8;}return this[_0xa67d('0xf')]['error'](_0x587a6a,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xa67d('0x18')][_0xa67d('0x143')]=function(_0x5b9ba4){logger[_0xa67d('0x30')](util['format'](_0xa67d('0x144'),_0x5b9ba4[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x5b9ba4[_0xa67d('0x145')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5b9ba4,'no\x20find\x20by\x20configured');}logger['info'](util[_0xa67d('0x55')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x5b9ba4[_0xa67d('0x145')]));var _0x1013e8=this[_0xa67d('0x53')][_0xa67d('0x72')](this,_0x5b9ba4['findBy']);if(_0x1013e8){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x146'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x5b9ba4[_0xa67d('0x145')]));this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x146'),this[_0xa67d('0xf')]['callerid'],_0x5b9ba4[_0xa67d('0x145')]));return{'code':0xc8,'result':_0xa67d('0x147')};}else{logger['info'](util[_0xa67d('0x55')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x5b9ba4[_0xa67d('0x145')]));this['channel']['noop'](util['format'](_0xa67d('0x148'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x5b9ba4['findBy']));return{'code':0xc8,'result':_0xa67d('0x149')};}};AGIVertices['prototype']['logout']=function(_0x561aaa){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x561aaa[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x561aaa[_0xa67d('0x145')])){return this['channel'][_0xa67d('0x2e')](_0x561aaa,'no\x20find\x20by\x20configured');}logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x14a'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x561aaa[_0xa67d('0x145')]));var _0xfcdffc=this[_0xa67d('0x52')]['sync'](this,_0x561aaa[_0xa67d('0x145')]);if(_0xfcdffc){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x146'),this['channel']['callerid'],_0x561aaa[_0xa67d('0x145')]));this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x146'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x561aaa[_0xa67d('0x145')]));return{'code':0xc8,'result':_0xa67d('0x147')};}else{logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x148'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x561aaa[_0xa67d('0x145')]));this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')](_0xa67d('0x148'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x561aaa[_0xa67d('0x145')]));return{'code':0xc8,'result':_0xa67d('0x149')};}};AGIVertices[_0xa67d('0x18')][_0xa67d('0x14b')]=function(_0x147974){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x14c'),_0x147974[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x147974[_0xa67d('0x14d')])){return this[_0xa67d('0xf')]['error'](_0x147974,_0xa67d('0x14e'));}this['channel']['noop'](util[_0xa67d('0x55')]('math\x20%s',_0x147974[_0xa67d('0x14d')]));var _0x5e7e10=eval(_0x147974[_0xa67d('0x14d')]);if(!this[_0xa67d('0x86')](_0x147974[_0xa67d('0xce')])){return this['channel'][_0xa67d('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4c67a0=this[_0xa67d('0x12')][_0xa67d('0x72')](this,_0x147974[_0xa67d('0xce')]);if(!_0x4c67a0){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x147974,_0xa67d('0xd0'));}if(_[_0xa67d('0x9c')](_0x5e7e10)){var _0x3a9bd2=this;_0x5e7e10[_0xa67d('0x14f')](function(_0x40456e,_0x4e9b27){_0x3a9bd2['channel'][_0xa67d('0xa0')](util['format']('%s[%s]',_0x4c67a0,_0x4e9b27),_0x40456e);});return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x150'),_0x4c67a0));}else{return this[_0xa67d('0xf')][_0xa67d('0xa0')](_0x4c67a0,_0x5e7e10);}};AGIVertices[_0xa67d('0x18')][_0xa67d('0xc')]=function(_0x5d64a8){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x5d64a8[_0xa67d('0xae')]));if(_0x5d64a8['retry']===0x0){return this['maxRetry'](_0x5d64a8);}_0x5d64a8[_0xa67d('0xa6')]-=0x1;if(!this[_0xa67d('0x86')](_0x5d64a8[_0xa67d('0x102')])){return this[_0xa67d('0xf')]['error'](_0x5d64a8,_0xa67d('0x103'));}var _0x22074b=this['getSound'][_0xa67d('0x72')](this,_0x5d64a8['file_id']);if(!_0x22074b){return this['channel']['error'](_0x5d64a8,_0xa67d('0x105'));}var _0x166c01=this[_0xa67d('0xf')]['getData'](_0x22074b,_0x5d64a8[_0xa67d('0x151')],_0x5d64a8['digit']);var _0x3ae2af=_0x166c01[_0xa67d('0xa4')];if(_0x166c01[_0xa67d('0xa4')]===-0x1){this[_0xa67d('0x37')]['sync'](this,_0x5d64a8,'-1');return _0x166c01;}else if(_0x166c01[_0xa67d('0xa3')]===_0xa67d('0x66')){_0x166c01[_0xa67d('0xa4')]=_0x166c01[_0xa67d('0xa4')][_0xa67d('0x9d')]>0x0?_0x166c01[_0xa67d('0xa4')]:'t';}else if(_[_0xa67d('0x43')](_0x166c01[_0xa67d('0xa4')])){_0x166c01[_0xa67d('0xa4')]='#';_0x3ae2af='#';}if(!this[_0xa67d('0x86')](_0x5d64a8[_0xa67d('0xce')])){this[_0xa67d('0xf')][_0xa67d('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x130f9a=this[_0xa67d('0x12')][_0xa67d('0x72')](this,_0x5d64a8[_0xa67d('0xce')]);if(!_0x130f9a){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5d64a8,_0xa67d('0xd0'));}this[_0xa67d('0xf')]['setVariable'](_0x130f9a,_0x3ae2af);}this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x5d64a8,_0x3ae2af);return _0x166c01;};AGIVertices[_0xa67d('0x18')][_0xa67d('0xa8')]=function(_0x48e85e){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x152'),_0x48e85e[_0xa67d('0xae')]));return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0x48e85e[_0xa67d('0x153')]||_0x48e85e[_0xa67d('0xae')]);};AGIVertices['prototype'][_0xa67d('0x154')]=function(_0x186de5){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x155'),_0x186de5[_0xa67d('0xae')]));if(!this['isConfigured'](_0x186de5['findBy'])){return this[_0xa67d('0xf')]['error'](_0x186de5,'no\x20find\x20by\x20configured');}logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x14a'),this[_0xa67d('0xf')]['callerid'],_0x186de5[_0xa67d('0x145')]));var _0x48ad65=this[_0xa67d('0x4d')][_0xa67d('0x72')](this,_0x186de5[_0xa67d('0x156')]);var _0x1435c7=this[_0xa67d('0x4f')][_0xa67d('0x72')](this,_0x186de5[_0xa67d('0x145')],_0x48ad65);if(_0x1435c7){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x186de5[_0xa67d('0x145')]));this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x146'),this[_0xa67d('0xf')]['callerid'],_0x186de5[_0xa67d('0x145')]));return{'code':0xc8,'result':'success'};}else{logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x148'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x186de5[_0xa67d('0x145')]));this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x146'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x186de5[_0xa67d('0x145')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xa67d('0x18')][_0xa67d('0x157')]=function(_0x30316b){logger['info'](util[_0xa67d('0x55')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x30316b[_0xa67d('0xae')]));if(!this['isConfigured'](_0x30316b[_0xa67d('0x102')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x30316b,_0xa67d('0x103'));}var _0x310d58=this[_0xa67d('0x104')][_0xa67d('0x72')](this,_0x30316b[_0xa67d('0x102')]);if(!_0x310d58){return this['channel'][_0xa67d('0x2e')](_0x30316b,_0xa67d('0x105'));}var _0x113879=this[_0xa67d('0xf')][_0xa67d('0x59')](_0xa67d('0x158'),[_0x310d58,_0x30316b[_0xa67d('0xdb')]]);if(_0x113879[_0xa67d('0xa4')]===-0x1){return _0x113879;}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xbe'),_0xa67d('0x158'),_0x310d58));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x159')]=function(_0x41216a){logger[_0xa67d('0x30')](util['format'](_0xa67d('0x15a'),_0x41216a[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x41216a['queue_id'])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x41216a,'no\x20queue\x20selected');}var _0x231423='';var _0x1e7e14=parseInt(_0x41216a['queue_id'],0xa);if(isNaN(_0x1e7e14)){_0x231423=_0x41216a[_0xa67d('0x15b')];}else{_0x231423=this[_0xa67d('0x14')][_0xa67d('0x72')](this,_0x41216a[_0xa67d('0x15b')]);if(!_0x231423){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x41216a,_0xa67d('0x15c'));}}var _0x40a0f7='';if(this['isConfigured'](_0x41216a[_0xa67d('0x102')])){var _0x4cc7a6=this[_0xa67d('0x104')][_0xa67d('0x72')](this,_0x41216a[_0xa67d('0x102')]);if(_0x4cc7a6){_0x40a0f7=_0x4cc7a6;}}this[_0xa67d('0x37')]['sync'](this,_0x41216a,_0x231423);if(_0x41216a['opts'][_0xa67d('0x15d')]('x')<0x0){_0x41216a[_0xa67d('0xdb')]+='x';}if(_0x41216a['opts']['indexOf']('X')<0x0){_0x41216a[_0xa67d('0xdb')]+='X';}this['channel'][_0xa67d('0xa0')](_0xa67d('0x15e'),_0x231423?_0x231423[_0xa67d('0x15f')]():'');var _0x34bef5=this['channel'][_0xa67d('0x59')](_0xa67d('0x160'),[_0x231423,_0x41216a[_0xa67d('0xdb')],_0x41216a[_0xa67d('0x63')],_0x40a0f7,_0x41216a[_0xa67d('0x66')],_0x41216a[_0xa67d('0x8')],_0x41216a[_0xa67d('0x161')],_0x41216a[_0xa67d('0x162')],'',_0x41216a[_0xa67d('0x163')]]);if(_0x34bef5['result']===-0x1){return _0x34bef5;}return this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')](_0xa67d('0xbe'),_0xa67d('0x160'),_0x231423));};AGIVertices['prototype']['record']=function(_0xdec7b9){logger[_0xa67d('0x30')](util['format'](_0xa67d('0x164'),_0xdec7b9[_0xa67d('0xae')]));var _0xe8cc85=_0xdec7b9['recordingFormat']||_0xa67d('0x120');var _0x163849=util[_0xa67d('0x55')](_0xa67d('0x165'),this[_0xa67d('0xf')][_0xa67d('0x38')],rs[_0xa67d('0x122')](0x5));var _0x1902bf=util['format'](_0xa67d('0x166'),FILES_PATH,_0x163849,_0xe8cc85);var _0x550a25=util[_0xa67d('0x55')](_0xa67d('0x121'),FILES_PATH,_0x163849);this['createSquareRecording'][_0xa67d('0x72')](this,_0xdec7b9,_0x163849,_0x1902bf);this[_0xa67d('0xf')][_0xa67d('0xa0')](_0xa67d('0x167'),_0x163849);logger[_0xa67d('0x30')](_0xa67d('0x168'),_0x550a25,_0xe8cc85,_0xdec7b9[_0xa67d('0x169')],_0xdec7b9[_0xa67d('0x66')]);return this['channel'][_0xa67d('0x13d')](_0x550a25,_0xe8cc85,_0xdec7b9[_0xa67d('0x169')],_0xdec7b9[_0xa67d('0x66')],undefined,!![]);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x16a')]=function(_0x38ac8c){logger['info'](util[_0xa67d('0x55')](_0xa67d('0x16b'),_0x38ac8c[_0xa67d('0xae')]));if(!this['isConfigured'](_0x38ac8c[_0xa67d('0x63')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x16c'));}var _0x551ffb=this[_0xa67d('0x16d')][_0xa67d('0x72')](this,_0x38ac8c);logger[_0xa67d('0x30')](util['format'](_0xa67d('0x16e'),util[_0xa67d('0x16f')](_0x551ffb,{'showHidden':![],'depth':null})));if(!this[_0xa67d('0x86')](_0x38ac8c[_0xa67d('0xce')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x170'));}var _0x208aa2=this['getVariable'][_0xa67d('0x72')](this,_0x38ac8c['variable_id']);if(!_0x208aa2){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x38ac8c,'no\x20variable\x20found');}this[_0xa67d('0xf')]['setVariable'](util[_0xa67d('0x55')](_0xa67d('0x171'),_0x208aa2),_0x551ffb[_0xa67d('0x76')]?_0x551ffb[_0xa67d('0x76')]:'200');this[_0xa67d('0xf')][_0xa67d('0xa0')](util[_0xa67d('0x55')]('%s_STATUS_MESSAGE',_0x208aa2),_0x551ffb['statusMessage']?_0x551ffb[_0xa67d('0x77')]:'OK');if(_0x551ffb[_0xa67d('0x6b')]){try{this[_0xa67d('0x172')](_0x551ffb['body'],_0x208aa2);}catch(_0x3a99db){logger['error'](util[_0xa67d('0x55')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x208aa2));}}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xd4'),_0x208aa2));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x173')]=function(_0x56ad54){logger['info'](util[_0xa67d('0x55')](_0xa67d('0x174'),_0x56ad54[_0xa67d('0xae')]));return this[_0xa67d('0xf')]['sayDigits'](_0x56ad54['digits'][_0xa67d('0x5a')](/\s+/g,''),_0x56ad54[_0xa67d('0x169')]);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x175')]=function(_0x4aa48f){logger['info'](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x4aa48f[_0xa67d('0xae')]));return this['channel'][_0xa67d('0x176')](_0x4aa48f[_0xa67d('0x65')][_0xa67d('0x5a')](/\s+/g,''),_0x4aa48f[_0xa67d('0x169')]);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x177')]=function(_0x2d6bb5){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x178'),_0x2d6bb5[_0xa67d('0xae')]));return this[_0xa67d('0xf')][_0xa67d('0x179')](_0x2d6bb5[_0xa67d('0x5d')],_0x2d6bb5[_0xa67d('0x169')]);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x17a')]=function(_0x152115){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x17b'),_0x152115['label']));if(!this['isConfigured'](_0x152115['account_id'])){return this['channel'][_0xa67d('0xa8')](_0xa67d('0x17c'));}var _0x8909b5=this[_0xa67d('0x22')][_0xa67d('0x72')](this,_0x152115['account_id']);if(!_0x8909b5||!_0x8909b5[_0xa67d('0x17d')]){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x152115,_0xa67d('0x17e'));}var _0x3038e1={'from':util['format'](_0xa67d('0x17f'),_0x8909b5['name'],_0x8909b5[_0xa67d('0x180')]||_0x8909b5[_0xa67d('0x17d')][_0xa67d('0x181')]),'to':_0x152115['to']||'','cc':_0x152115['cc']||'','bcc':_0x152115[_0xa67d('0x182')]||'','subject':_0x152115[_0xa67d('0x183')],'html':_0x152115[_0xa67d('0x5d')],'text':_0x152115[_0xa67d('0x5d')]};if(this[_0xa67d('0x86')](_0x152115[_0xa67d('0x184')])){}logger['debug'](_0xa67d('0x185'),JSON[_0xa67d('0x74')](_0x3038e1));this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x152115,_0x152115[_0xa67d('0x186')]);this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x187'),_0x8909b5[_0xa67d('0x16')]));this[_0xa67d('0x24')][_0xa67d('0x72')](this,_0x8909b5[_0xa67d('0x188')],_0x3038e1);return this[_0xa67d('0xf')][_0xa67d('0xa8')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xa67d('0x18')]['sendFax']=function(_0x23fc96){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x189'),_0x23fc96[_0xa67d('0xae')]));return this[_0xa67d('0xf')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xa67d('0x18')][_0xa67d('0x18a')]=function(_0x10e651){logger['info'](util[_0xa67d('0x55')](_0xa67d('0x18b'),_0x10e651[_0xa67d('0xae')]));if(!this['isConfigured'](_0x10e651[_0xa67d('0x18c')])){return this['channel'][_0xa67d('0xa8')](_0xa67d('0x18d'));}var _0x21ba72=this[_0xa67d('0x18e')][_0xa67d('0x72')](this,_0x10e651[_0xa67d('0x18c')]);if(!_0x21ba72){return this['channel'][_0xa67d('0x2e')](_0x10e651,_0xa67d('0x18f'));}var _0x5c8789={'body':_0x10e651[_0xa67d('0x190')],'phone':_0x10e651['to']||'','SmsAccountId':_0x21ba72['id']};logger['debug'](_0xa67d('0x191'),JSON['stringify'](_0x5c8789));this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x10e651,_0x10e651['sms_account_id']);this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x192'),_0x21ba72['name']));this['createSmsMessage'][_0xa67d('0x72')](this,_0x5c8789);return this[_0xa67d('0xf')]['noop'](_0xa67d('0x193'));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x194')]=function(_0xb9b514){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x195'),_0xb9b514['label']));if(!this['isConfigured'](_0xb9b514[_0xa67d('0xce')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0xb9b514,_0xa67d('0x196'));}var _0x4f03d9=this[_0xa67d('0x12')][_0xa67d('0x72')](this,_0xb9b514[_0xa67d('0xce')]);if(!_0x4f03d9){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0xb9b514,_0xa67d('0xd0'));}return this['channel'][_0xa67d('0xa0')](_0x4f03d9,_0xb9b514[_0xa67d('0x197')]);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x198')]=function(_0x235cb1){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20START\x20(%s)\x20block',_0x235cb1['label']));this['channel']['noop'](_0xa67d('0x199'));if(_0x235cb1[_0xa67d('0xb8')]===_0xa67d('0x19a')){this[_0xa67d('0xf')][_0xa67d('0xa8')]('Answer');return this[_0xa67d('0xf')][_0xa67d('0xb8')]();}return this['channel']['noop'](_0xa67d('0x19b'));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x19c')]=function(_0x5d4e94){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x19d'),_0x5d4e94[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x5d4e94[_0xa67d('0x19e')])){return this['channel'][_0xa67d('0x2e')](_0x5d4e94,'no\x20subproject\x20selected');}var _0x31a9c0=this[_0xa67d('0x19f')][_0xa67d('0x72')](this,_0x5d4e94['project_id']);if(!this[_0xa67d('0x86')](_0x31a9c0)){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5d4e94,util['format'](_0xa67d('0x1a0'),_0x5d4e94['project_id']));}if(_0x31a9c0===this[_0xa67d('0xf')][_0xa67d('0x3a')]){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5d4e94,_0xa67d('0x1a1'));}this[_0xa67d('0x37')]['sync'](this,_0x5d4e94,_0x31a9c0);var _0x2bbbd2=this[_0xa67d('0xf')][_0xa67d('0x59')](_0xa67d('0x1a2'),util['format'](_0xa67d('0x1a3'),config[_0xa67d('0x8')][_0xa67d('0x1a4')]||_0xa67d('0x1a5'),_0x31a9c0,this[_0xa67d('0xf')]['arg_1']));if(_0x2bbbd2[_0xa67d('0xa4')]===-0x1){return _0x2bbbd2;}return this['channel']['noop'](util[_0xa67d('0x55')]('Executed\x20command\x20%s\x20%s','AGI',_0x31a9c0));};AGIVertices['prototype'][_0xa67d('0x1a6')]=function(_0x5d6984){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x1a7'),_0x5d6984['label']));var _0x5698a8=this[_0xa67d('0x58')][_0xa67d('0x72')](this,_0x5d6984[_0xa67d('0xb6')]);this[_0xa67d('0x37')]['sync'](this,_0x5d6984,_0x5d6984[_0xa67d('0xb6')]);if(this[_0xa67d('0x86')](_0x5d6984[_0xa67d('0xce')])){var _0x45dd11=this[_0xa67d('0x12')][_0xa67d('0x72')](this,_0x5d6984[_0xa67d('0xce')]);if(_0x45dd11){this[_0xa67d('0xf')][_0xa67d('0xa0')](_0x45dd11,_0x5698a8);return this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format'](_0xa67d('0x1a8'),_0x5d6984[_0xa67d('0xb6')],_0x45dd11));}}return this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')](_0xa67d('0x1a9'),_0x5d6984['command']));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x1aa')]=function(_0x4fb85f){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x1ab'),_0x4fb85f[_0xa67d('0xae')]));_0x4fb85f[_0xa67d('0x5d')]=_0x4fb85f[_0xa67d('0x5d')][_0xa67d('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa67d('0x86')](_0x4fb85f[_0xa67d('0x5c')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x1ac'));}if(!this[_0xa67d('0x86')](_0x4fb85f[_0xa67d('0x5d')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xa9'));}this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x4fb85f[_0xa67d('0x5d')]));var _0x2b0c3c=this['googleCloudTTS'][_0xa67d('0x72')](this,_0x4fb85f);if(_0x2b0c3c){this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2b0c3c));var _0x38c919=this['channel']['streamFile'](_0x2b0c3c);try{fs['unlink'](_0x2b0c3c+_0xa67d('0xf4'));}catch(_0x1fc06a){logger[_0xa67d('0x2e')](_0x1fc06a);}return _0x38c919;}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x4fb85f,_0xa67d('0x1ad'));};AGIVertices['prototype']['tts']=function(_0x55a82e){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x1ae'),_0x55a82e[_0xa67d('0xae')]));_0x55a82e['text']=_0x55a82e[_0xa67d('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa67d('0x86')](_0x55a82e[_0xa67d('0x5d')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xa9'));}this[_0xa67d('0xf')]['noop'](util['format'](_0xa67d('0x1af'),_0x55a82e[_0xa67d('0x5d')]));var _0x52374b=this[_0xa67d('0x1b0')]['sync'](this,_0x55a82e);if(_0x52374b){this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format'](_0xa67d('0x1b1'),_0x52374b));var _0x22a1ab=this[_0xa67d('0xf')][_0xa67d('0x142')](_0x52374b);try{fs[_0xa67d('0x114')](_0x52374b+'.wav');}catch(_0x4bdc33){logger['error'](_0x4bdc33);}return _0x22a1ab;}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x55a82e,_0xa67d('0x1b2'));};AGIVertices['prototype'][_0xa67d('0x1b3')]=function(_0x35ee19){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x1b4'),_0x35ee19['label']));if(!this['isConfigured'](_0x35ee19[_0xa67d('0x145')])){return this['channel'][_0xa67d('0x2e')](_0x35ee19,'no\x20find\x20by\x20configured');}logger['info'](util[_0xa67d('0x55')](_0xa67d('0x14a'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x35ee19['findBy']));var _0x26daad=this[_0xa67d('0x51')]['sync'](this,_0x35ee19['findBy']);if(_0x26daad){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x35ee19[_0xa67d('0x145')]));this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')](_0xa67d('0x146'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x35ee19[_0xa67d('0x145')]));return{'code':0xc8,'result':'success'};}else{logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x148'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x35ee19[_0xa67d('0x145')]));this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x148'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x35ee19[_0xa67d('0x145')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xa67d('0x18')][_0xa67d('0x1b5')]=function(_0x465026){logger['info'](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x465026['label']));var _0x3df284=this['channel'][_0xa67d('0x59')](_0xa67d('0x1b6'),[_0x465026['mailbox'],_0x465026[_0xa67d('0x78')]]);if(_0x3df284['result']===-0x1){return _0x3df284;}return this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x465026['mailbox']));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x1b7')]=function(_0x13e2d6){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x1b8'),_0x13e2d6['label']));if(!this[_0xa67d('0x86')](_0x13e2d6[_0xa67d('0xce')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x13e2d6,_0xa67d('0x196'));}var _0x4c8241=this[_0xa67d('0x12')][_0xa67d('0x72')](this,_0x13e2d6[_0xa67d('0xce')]);if(!_0x4c8241){return this['channel'][_0xa67d('0x2e')](_0x13e2d6,_0xa67d('0xd0'));}var _0xec49ad=this[_0xa67d('0xf')][_0xa67d('0x12')](_0x4c8241);return{'code':0xc8,'result':_0xec49ad[_0xa67d('0xa3')]?_0xec49ad['extra']:'-'};};String['prototype'][_0xa67d('0xa2')]=function(_0x34e25d,_0x54352c){return this[_0xa67d('0xa1')](_0x34e25d)[_0xa67d('0x1b9')](_0x54352c);};module[_0xa67d('0x1ba')]=AGIVertices; \ No newline at end of file +var _0xbb35=['no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','mailRpc','getVariable','rpc','getVariableById','name','catch','prototype','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getTrunk','getSound','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','callback_','random','isNil','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','text','languageCode','MALE','audioEncoding','MP3','method','timeout','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','sync','uri','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','sestekNDA','ispeechTTS','key','speed','ispeechASR','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','googleASR','google_asr_language','en-US','tildeASR','appid','appsecret','clear','includes','agicommand','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isArray','length','isEmpty','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','result','extra','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','callback','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','%s[%s][%s]','variable\x20%s\x20set','dial','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','client_email','no\x20private_key\x20configured','dialogflowV2_language','Trying\x20DialogflowV2:\x20%s','out','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','response','maxdigit','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','beep','NOBEEP','recordFile','intKey','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','wav','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','menu','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','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','macro','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','restAPI','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','sayNumber','number','sayphonetic','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','subject','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','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','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts'];(function(_0x5928f5,_0x17cc13){var _0x4fa39c=function(_0x1e4405){while(--_0x1e4405){_0x5928f5['push'](_0x5928f5['shift']());}};_0x4fa39c(++_0x17cc13);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x2811b3,_0x2b5372){_0x2811b3=_0x2811b3-0x0;var _0x952e20=_0xbb35[_0x2811b3];return _0x952e20;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x5bb3('0x0'));var sh=require(_0x5bb3('0x1'));var odbc=require(_0x5bb3('0x2'))();var rs=require(_0x5bb3('0x3'));var moment=require(_0x5bb3('0x4'));var Mustache=require('mustache');var rp=require(_0x5bb3('0x5'));var logger=require(_0x5bb3('0x6'))(_0x5bb3('0x7'));var config=require(_0x5bb3('0x8'));var shared=require(_0x5bb3('0x9'));var scripts=require(_0x5bb3('0xa'));var FILES_PATH=_0x5bb3('0xb');var recursiveMapAttributes=[_0x5bb3('0xc'),_0x5bb3('0xd')];var verticesWithRetry=['menu',_0x5bb3('0xe'),_0x5bb3('0xf')];var AGIVertices=function(_0x182c0f,_0x383d1b,_0x534872){this[_0x5bb3('0x10')]=_0x182c0f;this['rpc']=_0x383d1b;this[_0x5bb3('0x11')]=_0x534872;};AGIVertices['prototype'][_0x5bb3('0x12')]=function(_0x25a643,_0xf8e37d){this[_0x5bb3('0x13')][_0x5bb3('0x14')](_0x25a643)['then'](function(_0x10e5ee){_0xf8e37d(null,_0x10e5ee?_0x10e5ee[_0x5bb3('0x15')]:![]);})[_0x5bb3('0x16')](function(_0x5a1040){_0xf8e37d(_0x5a1040);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x18')]=function(_0x40e31f,_0xf09aa){this[_0x5bb3('0x13')][_0x5bb3('0x19')](_0x40e31f)[_0x5bb3('0x1a')](function(_0x171369){_0xf09aa(null,_0x171369?_0x171369['name']:![]);})['catch'](function(_0x4aec89){_0xf09aa(_0x4aec89);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x1b')]=function(_0x388802,_0x1092df){this[_0x5bb3('0x13')][_0x5bb3('0x1c')](_0x388802)[_0x5bb3('0x1a')](function(_0xbbaf0){_0x1092df(null,_0xbbaf0?_0xbbaf0[_0x5bb3('0x15')]:![]);})[_0x5bb3('0x16')](function(_0x563bce){_0x1092df(_0x563bce);});};AGIVertices['prototype'][_0x5bb3('0x1d')]=function(_0x41c9a5,_0x3b87c8){this[_0x5bb3('0x13')][_0x5bb3('0x1e')](_0x41c9a5)[_0x5bb3('0x1a')](function(_0x2630b4){_0x3b87c8(null,_0x2630b4?_0x2630b4['dsn']:![]);})[_0x5bb3('0x16')](function(_0x3b1325){_0x3b87c8(_0x3b1325);});};AGIVertices[_0x5bb3('0x17')]['getUser']=function(_0x30c982,_0x4e2770){this[_0x5bb3('0x13')]['getUserById'](_0x30c982)[_0x5bb3('0x1a')](function(_0x384f57){_0x4e2770(null,_0x384f57?_0x384f57[_0x5bb3('0x15')]:![]);})[_0x5bb3('0x16')](function(_0x2f9ca3){_0x4e2770(_0x2f9ca3);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x1f')]=function(_0x4977df,_0x3701d5){this[_0x5bb3('0x13')]['getTrunkById'](_0x4977df)[_0x5bb3('0x1a')](function(_0x256a5f){_0x3701d5(null,_0x256a5f?_0x256a5f[_0x5bb3('0x15')]:![]);})[_0x5bb3('0x16')](function(_0x21da73){_0x3701d5(_0x21da73);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x20')]=function(_0x242ff8,_0x49f764){var _0x5c1243=this;this[_0x5bb3('0x13')]['getSoundById'](_0x242ff8)[_0x5bb3('0x1a')](function(_0x4ce15a){_0x49f764(null,_0x4ce15a?_0x5c1243[_0x5bb3('0x21')](_0x4ce15a[_0x5bb3('0x22')]):![]);})[_0x5bb3('0x16')](function(_0x55beda){_0x49f764(_0x55beda);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x23')]=function(_0x461109,_0x2cd20c){this['rpc']['getMailAccountById'](_0x461109)[_0x5bb3('0x1a')](function(_0x4f0ca6){_0x2cd20c(null,_0x4f0ca6?_0x4f0ca6:![]);})[_0x5bb3('0x16')](function(_0x33489e){_0x2cd20c(_0x33489e);});};AGIVertices['prototype'][_0x5bb3('0x24')]=function(_0xd935a7,_0x3d7115,_0xe5981a){this[_0x5bb3('0x11')][_0x5bb3('0x24')](_0xd935a7,_0x3d7115)[_0x5bb3('0x1a')](function(){_0xe5981a(null);})['catch'](function(_0x554fc0){_0xe5981a(_0x554fc0);});};AGIVertices['prototype'][_0x5bb3('0x25')]=function(_0x2e6122,_0x361dc9){this[_0x5bb3('0x13')]['getIntervalById'](_0x2e6122)['then'](function(_0x25708d){if(_0x25708d){if(_0x25708d[_0x5bb3('0x26')]){_0x361dc9(null,[_0x25708d[_0x5bb3('0x27')]]);}else{_0x361dc9(null,_[_0x5bb3('0x28')](_0x25708d[_0x5bb3('0x29')],_0x5bb3('0x27')));}}else{_0x361dc9(null,![]);}})['catch'](function(_0x3db671){_0x361dc9(_0x3db671);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x21')]=function(_0x139977){return util[_0x5bb3('0x2a')]('%s/sounds/converted/%s',FILES_PATH,_0x139977);};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x2b')]=function(_0x40f790,_0x12c9fb,_0x2a985e){odbc[_0x5bb3('0x2c')](_0x40f790,function(_0x35b769){if(_0x35b769){logger[_0x5bb3('0x2d')](_0x5bb3('0x2e'),_0x35b769);_0x2a985e(_0x35b769);}else{logger[_0x5bb3('0x2f')]('ODBC\x20connection\x20successfully');odbc[_0x5bb3('0x30')](_0x12c9fb,function(_0x3f4579,_0x26cea9){if(_0x3f4579){logger[_0x5bb3('0x2f')](_0x5bb3('0x31'),_0x12c9fb);_0x2a985e(_0x3f4579);}else{logger[_0x5bb3('0x2f')](_0x5bb3('0x32'),_0x12c9fb);odbc[_0x5bb3('0x33')](function(_0x3e569a){if(_0x3e569a){logger[_0x5bb3('0x2d')](_0x5bb3('0x34'),_0x3e569a);}_0x2a985e(null,_0x26cea9);});}});}});};AGIVertices['prototype'][_0x5bb3('0x35')]=function(_0x294f6a,_0x4f0612){this[_0x5bb3('0x13')][_0x5bb3('0x36')](_0x294f6a)[_0x5bb3('0x1a')](function(_0x390bfb){_0x4f0612(null,_0x390bfb?_0x390bfb:![]);})[_0x5bb3('0x16')](function(_0x489d66){_0x4f0612(_0x489d66);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x37')]=function(_0x2330fe,_0x597d4b){this[_0x5bb3('0x13')][_0x5bb3('0x37')](_0x2330fe)['then'](function(_0x6d6c39){_0x597d4b(null,_0x6d6c39);})['catch'](function(_0x1db2c9){_0x597d4b(_0x1db2c9);});};AGIVertices[_0x5bb3('0x17')]['createSquareDetailsReport']=function(_0x2f20c7,_0x4d43da,_0x29bc08){this[_0x5bb3('0x13')][_0x5bb3('0x38')]({'uniqueid':this[_0x5bb3('0x10')][_0x5bb3('0x39')],'node':_0x2f20c7[_0x5bb3('0x3a')],'application':_0x2f20c7['agicommand'],'data':_0x4d43da||null,'project_name':this[_0x5bb3('0x10')][_0x5bb3('0x3b')],'callerid':this[_0x5bb3('0x10')][_0x5bb3('0x3c')]})['then'](function(_0x29f54f){if(_0x29bc08){_0x29bc08(null,_0x29f54f);}})[_0x5bb3('0x16')](function(_0x3f46c8){if(_0x29bc08){_0x29bc08(_0x3f46c8);}});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x3d')]=function(_0x1ee6f7,_0x408bd4,_0x3bc8aa,_0x3ffc7b){this['rpc'][_0x5bb3('0x3d')]({'uniqueid':this[_0x5bb3('0x10')][_0x5bb3('0x39')],'callerid':this[_0x5bb3('0x10')][_0x5bb3('0x3c')],'calleridname':this[_0x5bb3('0x10')][_0x5bb3('0x3e')],'context':this[_0x5bb3('0x10')][_0x5bb3('0x3f')],'extension':this[_0x5bb3('0x10')][_0x5bb3('0x40')],'priority':this[_0x5bb3('0x10')][_0x5bb3('0x41')],'accountcode':this[_0x5bb3('0x10')][_0x5bb3('0x42')],'dnid':this[_0x5bb3('0x10')][_0x5bb3('0x43')],'projectName':this[_0x5bb3('0x10')][_0x5bb3('0x3b')],'saveName':_0x408bd4,'filename':_0x1ee6f7[_0x5bb3('0x44')]||_0x408bd4,'savePath':_0x3bc8aa})[_0x5bb3('0x1a')](function(_0x207bb6){_0x3ffc7b(null,_0x207bb6);})[_0x5bb3('0x16')](function(_0x14f8ad){_0x3ffc7b(_0x14f8ad);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x45')]=function(_0xca906f,_0x444733,_0x24756a,_0x204cba,_0x1a5746){this['rpc'][_0x5bb3('0x45')]({'uniqueid':this[_0x5bb3('0x10')]['uniqueid'],'body':_0xca906f,'direction':_0x444733,'providerName':_0x24756a,'providerResponse':_0x204cba})[_0x5bb3('0x1a')](function(_0xa2fc6e){if(_0x1a5746){_0x1a5746(null,_0xa2fc6e);}})[_0x5bb3('0x16')](function(_0x49f73a){if(_0x1a5746){_0x1a5746(_0x49f73a);}});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x46')]=function(_0x163147,_0x44e6df){this[_0x5bb3('0x13')][_0x5bb3('0x46')]({'firstName':_['isEmpty'](_0x163147[_0x5bb3('0x15')])||_['isNil'](_0x163147[_0x5bb3('0x15')])?_0x5bb3('0x47')+Math[_0x5bb3('0x48')]():_0x163147[_0x5bb3('0x15')],'lastName':_['isEmpty'](_0x163147['lastName'])||_[_0x5bb3('0x49')](_0x163147[_0x5bb3('0x4a')])?null:_0x163147['lastName'],'phone':_0x163147['phone'],'ListId':_0x163147[_0x5bb3('0x4b')],'scheduledat':_0x163147[_0x5bb3('0x4c')],'callbackUniqueid':this[_0x5bb3('0x10')][_0x5bb3('0x39')],'tags':'callback','description':_0x5bb3('0x4d')+_0x163147[_0x5bb3('0x4c')][_0x5bb3('0x4e')](),'priority':_0x163147[_0x5bb3('0x4f')]})['then'](function(_0x339c79){_0x44e6df(null,_0x339c79);})[_0x5bb3('0x16')](function(_0x30d6a6){_0x44e6df(_0x30d6a6);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x50')]=function(_0x4eb322,_0x5e0b9d){this['rpc'][_0x5bb3('0x51')](_0x4eb322)['then'](function(_0x216d74){_0x5e0b9d(null,_0x216d74?_0x216d74[_0x5bb3('0x15')]:![]);})['catch'](function(_0x31eba1){_0x5e0b9d(_0x31eba1);});};AGIVertices[_0x5bb3('0x17')]['agentPause']=function(_0x5be32c,_0x431cb9,_0x357bfe){var _0x207a02={'role':_0x5bb3('0x52')};_0x207a02[_0x5be32c]=this[_0x5bb3('0x10')][_0x5bb3('0x3c')];this['rpc'][_0x5bb3('0x53')](_0x207a02,_0x431cb9,this[_0x5bb3('0x10')][_0x5bb3('0x39')])[_0x5bb3('0x1a')](function(_0x153341){_0x357bfe(null,_[_0x5bb3('0x49')](_0x153341)?![]:!![]);})[_0x5bb3('0x16')](function(_0x23d799){logger['error'](_0x23d799);_0x357bfe(null,![]);});};AGIVertices[_0x5bb3('0x17')]['agentUnpause']=function(_0xf3a144,_0x420f80){var _0x318327={'role':_0x5bb3('0x52')};_0x318327[_0xf3a144]=this['channel'][_0x5bb3('0x3c')];this['rpc'][_0x5bb3('0x54')](_0x318327)[_0x5bb3('0x1a')](function(_0x5dc615){_0x420f80(null,_[_0x5bb3('0x49')](_0x5dc615)?![]:!![]);})[_0x5bb3('0x16')](function(_0x146043){logger[_0x5bb3('0x2d')](_0x146043);_0x420f80(null,![]);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x55')]=function(_0x23bf9f,_0x2338d7){var _0x48c3c6={'role':'agent'};_0x48c3c6[_0x23bf9f]=this[_0x5bb3('0x10')][_0x5bb3('0x3c')];this[_0x5bb3('0x13')]['agentLogout'](_0x48c3c6)[_0x5bb3('0x1a')](function(_0x30be44){_0x2338d7(null,_[_0x5bb3('0x49')](_0x30be44)?![]:!![]);})[_0x5bb3('0x16')](function(_0x37dbd5){logger['error'](_0x37dbd5);_0x2338d7(null,![]);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x56')]=function(_0x4e8ed7,_0x38fcc6){var _0x400f8b={'role':_0x5bb3('0x52')};_0x400f8b[_0x4e8ed7]=this[_0x5bb3('0x10')]['callerid'];var _0x2b320d=_0x4e8ed7!=_0x5bb3('0x57')?util[_0x5bb3('0x2a')](_0x5bb3('0x58'),_0x5bb3('0x59'),this[_0x5bb3('0x10')][_0x5bb3('0x3c')]):undefined;this['rpc'][_0x5bb3('0x56')](_0x400f8b,_0x2b320d)[_0x5bb3('0x1a')](function(_0xf89c58){_0x38fcc6(null,_[_0x5bb3('0x49')](_0xf89c58)?![]:!![]);})[_0x5bb3('0x16')](function(_0x11e8b2){logger[_0x5bb3('0x2d')](_0x11e8b2);_0x38fcc6(null,![]);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x5a')]=function(_0x1749b3,_0x6ac10a){sh[_0x5bb3('0x5b')](_['trim'](_0x1749b3),function(_0x20ade7,_0x993b79){var _0x2c3616=_0x993b79[_0x5bb3('0x5c')](/(\r\n|\n|\r)/gm,'');_0x6ac10a(null,_0x2c3616);});};AGIVertices['prototype'][_0x5bb3('0x5d')]=function(_0x42819f,_0x424dca){scripts[_0x5bb3('0x5d')](_0x42819f[_0x5bb3('0x5e')],_0x42819f['google_cloud_tts_text_type']||_0x5bb3('0x5f'),_0x42819f[_0x5bb3('0x5f')],_0x42819f[_0x5bb3('0x60')]||'en-US',_0x42819f['ssmlGender']||_0x5bb3('0x61'),_0x42819f[_0x5bb3('0x62')]||_0x5bb3('0x63'))[_0x5bb3('0x1a')](function(_0x502a34){_0x424dca(null,_0x502a34);})[_0x5bb3('0x16')](function(_0x30a3fc){_0x424dca(_0x30a3fc);});};AGIVertices[_0x5bb3('0x17')]['googleTTS']=function(_0x45a8c3,_0x479615){scripts['googleTTS'](_0x45a8c3[_0x5bb3('0x5f')],_0x45a8c3['google_tts_language']||'en',0x1)[_0x5bb3('0x1a')](function(_0x39ce15){_0x479615(null,_0x39ce15);})['catch'](function(_0x4f66fb){_0x479615(_0x4f66fb);});};AGIVertices['prototype']['restAPI']=function(_0x4f21c2,_0x434419){var _0x295cd1={'uri':_0x4f21c2['url'],'method':_0x4f21c2[_0x5bb3('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4f21c2[_0x5bb3('0x65')])==='number'&&parseInt(_0x4f21c2[_0x5bb3('0x65')])>=0x1?parseInt(_0x4f21c2[_0x5bb3('0x65')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x5bb3('0x66'),'PUT'],_0x295cd1[_0x5bb3('0x64')][_0x5bb3('0x67')]())){try{_0x295cd1[_0x5bb3('0x68')]=_0x4f21c2[_0x5bb3('0xd')]?JSON[_0x5bb3('0x69')](_0x4f21c2[_0x5bb3('0xd')]):{};}catch(_0xa6d6ad){logger[_0x5bb3('0x2d')](_0x5bb3('0x6a'),_0xa6d6ad);}}try{_0x295cd1[_0x5bb3('0x6b')]=_0x4f21c2[_0x5bb3('0xc')]?JSON[_0x5bb3('0x69')](_0x4f21c2[_0x5bb3('0xc')]):{};}catch(_0x5dae8a){logger['error'](_0x5bb3('0x6c'),_0x5dae8a);}if(_0x4f21c2[_0x5bb3('0x6d')]){try{var _0x3829b8=require(_0x4f21c2[_0x5bb3('0x6d')])[_0x5bb3('0x6e')](this,_0x295cd1);_0x295cd1[_0x5bb3('0x6f')]=Mustache[_0x5bb3('0x70')](_0x4f21c2[_0x5bb3('0x71')],_0x3829b8,{},['$$','$$']);if(_0x295cd1[_0x5bb3('0x6b')]){_0x295cd1[_0x5bb3('0x6b')]=JSON[_0x5bb3('0x69')](Mustache[_0x5bb3('0x70')](JSON[_0x5bb3('0x72')](_0x295cd1[_0x5bb3('0x6b')]),_0x3829b8,{},['$$','$$']));}if(_0x295cd1[_0x5bb3('0x68')]){_0x295cd1['body']=JSON[_0x5bb3('0x69')](Mustache['render'](JSON[_0x5bb3('0x72')](_0x295cd1[_0x5bb3('0x68')]),_0x3829b8,{},['$$','$$']));}}catch(_0x278b67){logger[_0x5bb3('0x2d')](_0x5bb3('0x73'),_0x278b67);}}rp(_0x295cd1)['then'](function(_0x3c7f46){var _0x547c8f={'statusCode':_0x3c7f46[_0x5bb3('0x74')]||0xc8,'statusMessage':_0x3c7f46[_0x5bb3('0x75')]||'OK','headers':_0x3c7f46[_0x5bb3('0x6b')]||{},'body':_0x3c7f46[_0x5bb3('0x68')]||{}};_0x434419(null,_0x547c8f);})[_0x5bb3('0x16')](function(_0x3a23b6){var _0x4984c4={'statusCode':_0x3a23b6[_0x5bb3('0x74')]||0x1f4,'statusMessage':_0x3a23b6[_0x5bb3('0x76')]||_0x5bb3('0x77'),'headers':_0x3a23b6[_0x5bb3('0x78')][_0x5bb3('0x6b')]||{},'body':_0x3a23b6['options'][_0x5bb3('0x68')]||{}};_0x434419(null,_0x4984c4);});};AGIVertices[_0x5bb3('0x17')]['googleDialogflow']=function(_0x218d17,_0x1d5045){scripts[_0x5bb3('0x79')](this[_0x5bb3('0x10')][_0x5bb3('0x39')],_0x218d17['key'],_0x218d17[_0x5bb3('0x5f')],_0x218d17[_0x5bb3('0x7a')]||'en')[_0x5bb3('0x1a')](function(_0x872da){_0x1d5045(null,_0x872da);})['catch'](function(_0x4cecbd){_0x1d5045(_0x4cecbd);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x7b')]=function(_0x8cb7bb,_0x950492){scripts[_0x5bb3('0x7b')](this['channel'][_0x5bb3('0x39')],_0x8cb7bb[_0x5bb3('0x7c')],_0x8cb7bb['client_email'],_0x8cb7bb[_0x5bb3('0x7d')],_0x8cb7bb['text'],_0x8cb7bb['dialogflowV2_language']||'en')[_0x5bb3('0x1a')](function(_0x363174){_0x950492(null,_0x363174);})[_0x5bb3('0x16')](function(_0x3afabc){_0x950492(_0x3afabc);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x7e')]=function(_0x34c83c,_0x1ff89c){scripts[_0x5bb3('0x7e')](this[_0x5bb3('0x10')],_0x34c83c)[_0x5bb3('0x1a')](function(_0xce4bd){_0x1ff89c(null,_0xce4bd);})[_0x5bb3('0x16')](function(_0x4ef767){_0x1ff89c(_0x4ef767);});};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x7f')]=function(_0xa125b1,_0x5b714c){scripts[_0x5bb3('0x7f')](_0xa125b1[_0x5bb3('0x80')],_0xa125b1[_0x5bb3('0x5f')],_0xa125b1['ispeech_tts_language']||'en-US',_0xa125b1[_0x5bb3('0x81')])[_0x5bb3('0x1a')](function(_0xb50e40){_0x5b714c(null,_0xb50e40);})[_0x5bb3('0x16')](function(_0x198df4){_0x5b714c(_0x198df4);});};AGIVertices['prototype'][_0x5bb3('0x82')]=function(_0x25dea5,_0x5c0ea4,_0x1565c6){scripts[_0x5bb3('0x82')](_0x5c0ea4,_0x25dea5['key'],_0x25dea5['ispeech_asr_language']||'en-US',this['isConfigured'](_0x25dea5[_0x5bb3('0x83')])?_0x25dea5['model']:undefined)[_0x5bb3('0x1a')](function(_0x408751){_0x1565c6(null,_0x408751);})[_0x5bb3('0x16')](function(_0x593999){_0x1565c6(_0x593999);});};AGIVertices['prototype'][_0x5bb3('0x84')]=function(_0x1c4c4f,_0x542d34){scripts[_0x5bb3('0x84')](_0x1c4c4f[_0x5bb3('0x85')],_0x1c4c4f['aws_secret_access_key'],_0x1c4c4f[_0x5bb3('0x86')],_0x1c4c4f[_0x5bb3('0x87')]||_0x5bb3('0x88'),_0x1c4c4f[_0x5bb3('0x5f')],_0x1c4c4f[_0x5bb3('0x89')]||_0x5bb3('0x5f'))[_0x5bb3('0x1a')](function(_0x588b7e){_0x542d34(null,_0x588b7e);})[_0x5bb3('0x16')](function(_0x3b20a3){_0x542d34(_0x3b20a3);});};AGIVertices['prototype'][_0x5bb3('0x8a')]=function(_0x541ff6,_0x45607c){scripts[_0x5bb3('0x8a')](this[_0x5bb3('0x10')][_0x5bb3('0x39')],_0x541ff6['aws_access_key_id'],_0x541ff6[_0x5bb3('0x8b')],_0x541ff6[_0x5bb3('0x8c')],_0x541ff6['text'],_0x541ff6['aws_bot_name'])['then'](function(_0x4d8683){_0x45607c(null,_0x4d8683);})['catch'](function(_0x311dd4){_0x45607c(_0x311dd4);});};AGIVertices['prototype'][_0x5bb3('0x8d')]=function(_0x3d258b,_0x37da50,_0x10ce52){scripts[_0x5bb3('0x8d')](_0x37da50,_0x3d258b[_0x5bb3('0x80')],_0x3d258b[_0x5bb3('0x8e')]||_0x5bb3('0x8f'))[_0x5bb3('0x1a')](function(_0x58eb92){_0x10ce52(null,_0x58eb92);})[_0x5bb3('0x16')](function(_0x1a6ac2){_0x10ce52(_0x1a6ac2);});};AGIVertices[_0x5bb3('0x17')]['tildeASR']=function(_0x3a5b84,_0x45bd9d,_0x12f005){scripts[_0x5bb3('0x90')](_0x45bd9d,_0x3a5b84[_0x5bb3('0x91')],_0x3a5b84[_0x5bb3('0x92')],_0x3a5b84[_0x5bb3('0x6f')])[_0x5bb3('0x1a')](function(_0x48548a){_0x12f005(null,_0x48548a);})[_0x5bb3('0x16')](function(_0x156351){_0x12f005(_0x156351);});};AGIVertices['prototype'][_0x5bb3('0x93')]=function(_0x364c8e){var _0x42b0f4=_[_0x5bb3('0x94')](verticesWithRetry,_0x364c8e[_0x5bb3('0x95')])?_0x364c8e:_[_0x5bb3('0x96')](_0x364c8e);for(var _0x320afc in _0x42b0f4){if(_0x42b0f4[_0x5bb3('0x97')](_0x320afc)){if(_0x42b0f4[_0x320afc]&&_[_0x5bb3('0x98')](_0x42b0f4[_0x320afc])){if(_['includes'](recursiveMapAttributes,_0x320afc)){_0x42b0f4[_0x320afc]=this['replaceObjectAllVariables'](_0x42b0f4[_0x320afc]);}else{_0x42b0f4[_0x320afc]=this[_0x5bb3('0x99')](_0x42b0f4[_0x320afc]);}}}}return _0x42b0f4;};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x9a')]=function(_0x4429b){for(var _0x39924f in _0x4429b){if(_0x4429b[_0x5bb3('0x97')](_0x39924f)){if(_['isPlainObject'](_0x4429b[_0x39924f])){this[_0x5bb3('0x9a')](_0x4429b[_0x39924f]);}else if(_[_0x5bb3('0x9b')](_0x4429b[_0x39924f])){for(var _0x3ce8cd=0x0;_0x3ce8cd<_0x4429b[_0x39924f][_0x5bb3('0x9c')];_0x3ce8cd++){this['recursiveNodeIndex'](_0x4429b[_0x39924f][_0x3ce8cd]);}}else if(_[_0x5bb3('0x98')](_0x4429b[_0x39924f])){_0x4429b[_0x39924f]=this[_0x5bb3('0x99')](_0x4429b[_0x39924f]);}}}};AGIVertices[_0x5bb3('0x17')]['saveRestApiResult']=function(_0x18f430,_0x39f77a){for(var _0x7ebe20 in _0x18f430){if(_0x18f430[_0x5bb3('0x97')](_0x7ebe20)){if(_['isPlainObject'](_0x18f430[_0x7ebe20])){if(!_[_0x5bb3('0x9d')](_0x18f430[_0x7ebe20])){this[_0x5bb3('0x9e')](_0x18f430[_0x7ebe20],util[_0x5bb3('0x2a')](_0x5bb3('0x9f'),_0x39f77a,_0x7ebe20));}}else if(_['isArray'](_0x18f430[_0x7ebe20])){for(var _0x1a9f85=0x0;_0x1a9f85<_0x18f430[_0x7ebe20]['length'];_0x1a9f85++){this[_0x5bb3('0x9e')](_0x18f430[_0x7ebe20][_0x1a9f85],util[_0x5bb3('0x2a')]('%s.%s',_0x39f77a,_0x7ebe20+'['+_0x1a9f85+']'));}}else{if(!_[_0x5bb3('0x49')](_0x18f430[_0x7ebe20])){this[_0x5bb3('0x10')][_0x5bb3('0xa0')](util['format']('%s.%s',_0x39f77a,_0x7ebe20),_0x18f430[_0x7ebe20]);}}}}};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0xa1')]=function(_0x21f45c){try{var _0xa4b12e=JSON[_0x5bb3('0x69')](_0x21f45c);this[_0x5bb3('0x9a')](_0xa4b12e);return JSON['stringify'](_0xa4b12e);}catch(_0x223685){return this[_0x5bb3('0x99')](_0x21f45c);}};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x99')]=function(_0x367eda){var _0x3392ec=_0x367eda[_0x5bb3('0xa2')]('{');for(var _0x42367f=0x1;_0x42367f<_0x3392ec[_0x5bb3('0x9c')];_0x42367f+=0x1){var _0x515f42=_0x3392ec[_0x42367f][_0x5bb3('0xa2')]('}');if(_0x515f42[_0x5bb3('0x9c')]>0x1){_0x367eda=_0x367eda[_0x5bb3('0xa3')]('{'+_0x515f42[0x0]+'}',this[_0x5bb3('0x10')][_0x5bb3('0x12')](_0x515f42[0x0])['extra']||_0x515f42[0x0]);}}if(_0x3392ec[_0x5bb3('0x9c')]===0x1){return _0x367eda['toString']();}return this[_0x5bb3('0x99')](_0x367eda);};AGIVertices['prototype']['getAndSetVariable']=function(_0x4a3687,_0x5d0f50){var _0x558ad0=this[_0x5bb3('0x10')]['getVariable'](_0x4a3687);if(_0x558ad0[_0x5bb3('0xa4')]===-0x1){return _0x558ad0;}logger['info'](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5d0f50,_0x558ad0[_0x5bb3('0xa5')]));return this['channel'][_0x5bb3('0xa0')](_0x5d0f50,_0x558ad0[_0x5bb3('0xa5')]);};AGIVertices[_0x5bb3('0x17')]['isConfigured']=function(_0x204885){return _0x204885&&_0x204885!=='0'&&_0x204885!=='-1'&&_0x204885!=='';};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0xa6')]=function(_0x1cc84a){this[_0x5bb3('0x38')][_0x5bb3('0x6e')](this,_0x1cc84a,'-');_0x1cc84a['retry']=_0x1cc84a[_0x5bb3('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0xa7')]=function(_0x339ee8){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0xa8'),_0x339ee8[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x339ee8[_0x5bb3('0x5f')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xab'));}var _0xaf4680='\x22'+_0x339ee8[_0x5bb3('0x5f')]+'\x22';if(this[_0x5bb3('0xa9')](_0x339ee8[_0x5bb3('0x78')])){_0xaf4680+=','+_0x339ee8[_0x5bb3('0x78')];}var _0x12bde7=this[_0x5bb3('0x10')][_0x5bb3('0x5b')](_0x5bb3('0xac'),_0xaf4680);if(_0x12bde7['result']===-0x1){return _0x12bde7;}return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0xad'),_0xaf4680));};AGIVertices[_0x5bb3('0x17')]['mrcprecog']=function(_0x2dd8a3){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x2dd8a3[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x2dd8a3[_0x5bb3('0xae')])){return this['channel'][_0x5bb3('0xaa')]('no\x20grammar\x20configured');}var _0x12e29b=_0x2dd8a3[_0x5bb3('0xae')];if(this['isConfigured'](_0x2dd8a3[_0x5bb3('0x78')])){_0x12e29b+=','+_0x2dd8a3['options'];}var _0x50d61d=this['channel'][_0x5bb3('0x5b')](_0x5bb3('0xaf'),_0x12e29b);if(_0x50d61d[_0x5bb3('0xa4')]===-0x1){return _0x50d61d;}var _0x2da111=this['getAndSetVariable'](_0x5bb3('0xb0'),_0x5bb3('0xb1'));if(_0x2da111[_0x5bb3('0xa4')]===-0x1){return _0x2da111;}var _0x24cc3d=this[_0x5bb3('0xb2')](_0x5bb3('0xb3'),_0x5bb3('0xb4'));if(_0x24cc3d[_0x5bb3('0xa4')]===-0x1){return _0x24cc3d;}var _0x4cf715=this[_0x5bb3('0xb2')](_0x5bb3('0xb5'),'MRCP_RECOG_INSTANCE');if(_0x4cf715[_0x5bb3('0xa4')]===-0x1){return _0x4cf715;}return this['channel']['noop'](util[_0x5bb3('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x12e29b));};AGIVertices['prototype'][_0x5bb3('0x7')]=function(_0xe1fa48){logger['info'](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0xe1fa48[_0x5bb3('0x3a')]));return this[_0x5bb3('0x10')][_0x5bb3('0x7')]([_0xe1fa48[_0x5bb3('0xb6')],_0xe1fa48[_0x5bb3('0xb7')]]);};AGIVertices[_0x5bb3('0x17')]['answer']=function(_0x357464){logger['info'](util[_0x5bb3('0x2a')](_0x5bb3('0xb8'),_0x357464['label']));if(this[_0x5bb3('0xa9')](_0x357464[_0x5bb3('0x65')])){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0xb9'),_0x357464[_0x5bb3('0x65')]));var _0x5836de=this[_0x5bb3('0x10')][_0x5bb3('0xba')](_0x357464[_0x5bb3('0x65')]);if(_0x5836de['result']===-0x1){return _0x5836de;}}return this['channel'][_0x5bb3('0xbb')]();};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0xbc')]=function(_0x44c135){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x44c135['label']));if(!this['isConfigured'](_0x44c135[_0x5bb3('0x4b')])){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x44c135,'no\x20list\x20selected');}_0x44c135[_0x5bb3('0x4c')]=moment();if(this['isConfigured'](_0x44c135[_0x5bb3('0xbd')])){_0x44c135[_0x5bb3('0x4c')]=moment()[_0x5bb3('0xbe')](_0x44c135[_0x5bb3('0xbd')],'minutes');}if(!this['isConfigured'](_0x44c135[_0x5bb3('0x4f')])){_0x44c135[_0x5bb3('0x4f')]=0x2;}this[_0x5bb3('0x46')][_0x5bb3('0x6e')](this,_0x44c135);return this['channel'][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0xbf'),_0x44c135[_0x5bb3('0xc0')],_0x44c135[_0x5bb3('0x4b')],_0x44c135['scheduledAt']));};AGIVertices['prototype'][_0x5bb3('0xc1')]=function(_0xb08ff0){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0xc2'),_0xb08ff0['label']));var _0x253809=this[_0x5bb3('0x10')][_0x5bb3('0x5b')](_0xb08ff0['application'],_0xb08ff0[_0x5bb3('0x78')]);if(_0x253809[_0x5bb3('0xa4')]===-0x1){return _0x253809;}return this[_0x5bb3('0x10')]['noop'](util[_0x5bb3('0x2a')](_0x5bb3('0xc3'),_0xb08ff0['application'],_0xb08ff0[_0x5bb3('0x78')]));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0xc4')]=function(_0x2a48c2){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0xc5'),_0x2a48c2['label']));if(!this['isConfigured'](_0x2a48c2['text'])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xab'));}var _0x1b6cf2='\x22'+_0x2a48c2[_0x5bb3('0x5f')]+'\x22';if(this[_0x5bb3('0xa9')](_0x2a48c2['options'])){_0x1b6cf2+=','+_0x2a48c2[_0x5bb3('0x78')];}var _0x110e98=this['channel']['exec']('MRCPSynth',_0x1b6cf2);if(_0x110e98[_0x5bb3('0xa4')]===-0x1){return _0x110e98;}return this[_0x5bb3('0x10')]['noop'](util[_0x5bb3('0x2a')](_0x5bb3('0xad'),_0x1b6cf2));};AGIVertices[_0x5bb3('0x17')]['sestektts']=function(_0x1f34bf){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0xc6'),_0x1f34bf['label']));if(!this['isConfigured'](_0x1f34bf[_0x5bb3('0x5f')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xab'));}var _0x3a7a03='\x22'+_0x1f34bf[_0x5bb3('0x5f')]+'\x22';if(this[_0x5bb3('0xa9')](_0x1f34bf['options'])){_0x3a7a03+=','+_0x1f34bf['options'];}var _0x2859f8=this[_0x5bb3('0x10')][_0x5bb3('0x5b')](_0x5bb3('0xac'),_0x3a7a03);if(_0x2859f8['result']===-0x1){return _0x2859f8;}return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3a7a03));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0xc7')]=function(_0x18029){logger['info'](util[_0x5bb3('0x2a')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x18029['label']));if(!this['isConfigured'](_0x18029[_0x5bb3('0xae')])){return this[_0x5bb3('0x10')]['noop'](_0x5bb3('0xc8'));}var _0x115a27=_0x18029['grammar'];if(this['isConfigured'](_0x18029['options'])){_0x115a27+=','+_0x18029[_0x5bb3('0x78')];}var _0x2e533f=this['channel'][_0x5bb3('0x5b')](_0x5bb3('0xaf'),_0x115a27);if(_0x2e533f[_0x5bb3('0xa4')]===-0x1){return _0x2e533f;}var _0x4e95e2=this[_0x5bb3('0xb2')]('RECOG_CONFIDENCE()',_0x5bb3('0xc9'));if(_0x4e95e2['result']===-0x1){return _0x4e95e2;}var _0xaf079d=this['getAndSetVariable'](_0x5bb3('0xb3'),'LUMENVOX_ASR_TRANSCRIPT');if(_0xaf079d[_0x5bb3('0xa4')]===-0x1){return _0xaf079d;}var _0x37e423=this['getAndSetVariable'](_0x5bb3('0xb5'),_0x5bb3('0xca'));if(_0x37e423['result']===-0x1){return _0x37e423;}return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0xcb'),_0x115a27));};AGIVertices[_0x5bb3('0x17')]['sestekasr']=function(_0x53ae16){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0xcc'),_0x53ae16[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x53ae16[_0x5bb3('0xae')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xc8'));}var _0x5a2729=_0x53ae16['grammar'];if(this[_0x5bb3('0xa9')](_0x53ae16['options'])){_0x5a2729+=','+_0x53ae16['options'];}var _0x3149af=this[_0x5bb3('0x10')][_0x5bb3('0x5b')](_0x5bb3('0xaf'),_0x5a2729);if(_0x3149af[_0x5bb3('0xa4')]===-0x1){return _0x3149af;}var _0x97f923=this[_0x5bb3('0xb2')](_0x5bb3('0xb0'),_0x5bb3('0xcd'));if(_0x97f923['result']===-0x1){return _0x97f923;}var _0x316422=this[_0x5bb3('0xb2')](_0x5bb3('0xb3'),'SESTEK_ASR_TRANSCRIPT');if(_0x316422[_0x5bb3('0xa4')]===-0x1){return _0x316422;}var _0x429ea3=this[_0x5bb3('0xb2')](_0x5bb3('0xb5'),_0x5bb3('0xce'));if(_0x429ea3['result']===-0x1){return _0x429ea3;}return this['channel'][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0xcb'),_0x5a2729));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0xcf')]=function(_0x2d25d2){logger[_0x5bb3('0x2f')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x2d25d2[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x2d25d2[_0x5bb3('0xd0')])){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x2d25d2,'no\x20database\x20selected');}var _0x4d15cb=this[_0x5bb3('0x1d')][_0x5bb3('0x6e')](this,_0x2d25d2[_0x5bb3('0xd0')]);if(!_0x4d15cb){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x2d25d2,_0x5bb3('0xd1'));}if(!this[_0x5bb3('0xa9')](_0x2d25d2[_0x5bb3('0x30')])){return this[_0x5bb3('0x10')]['error'](_0x2d25d2,_0x5bb3('0xd2'));}var _0x5096d3=_0x2d25d2[_0x5bb3('0x30')][_0x5bb3('0x5c')](/(\r\n|\n|\r)/gm,'\x20');this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0xd3'),_0x5096d3));var _0x2f125b=this[_0x5bb3('0x2b')][_0x5bb3('0x6e')](this,_0x4d15cb,_0x5096d3);this[_0x5bb3('0x38')][_0x5bb3('0x6e')](this,_0x2d25d2,_0x5096d3);if(!this[_0x5bb3('0xa9')](_0x2d25d2['variable_id'])){return this[_0x5bb3('0x10')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5c8493=this['getVariable']['sync'](this,_0x2d25d2[_0x5bb3('0xd4')]);if(!_0x5c8493){return this['channel'][_0x5bb3('0x2d')](_0x2d25d2,_0x5bb3('0xd5'));}var _0x342245=this;_0x2f125b[_0x5bb3('0xd6')](function(_0x42724e,_0xc0950c){Object['keys'](_0x42724e)['forEach'](function(_0x99359f){_0x342245[_0x5bb3('0x10')][_0x5bb3('0xa0')](util[_0x5bb3('0x2a')](_0x5bb3('0xd7'),_0x5c8493,_0xc0950c,_0x99359f),_0x42724e[_0x99359f]);});});this[_0x5bb3('0x10')][_0x5bb3('0xa0')](util['format']('%s_ROWS_COUNT',_0x5c8493),_0x2f125b[_0x5bb3('0x9c')]);return this['channel']['noop'](util['format'](_0x5bb3('0xd8'),_0x5c8493));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0xd9')]=function(_0x9b8485){logger['debug'](util[_0x5bb3('0x2a')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x9b8485[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x9b8485[_0x5bb3('0xda')])){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x9b8485,_0x5bb3('0xdb'));}var _0x333ecc=this[_0x5bb3('0xdc')][_0x5bb3('0x6e')](this,_0x9b8485['sip_id']);if(!_0x333ecc){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x9b8485,_0x5bb3('0xdd'));}var _0x528bb0=this['channel'][_0x5bb3('0x5b')](_0x5bb3('0xde'),[util[_0x5bb3('0x2a')](_0x5bb3('0xdf'),_0x333ecc),_0x9b8485[_0x5bb3('0x65')],_0x9b8485[_0x5bb3('0xe0')],_0x9b8485['url']]);if(_0x528bb0[_0x5bb3('0xa4')]===-0x1){return _0x528bb0;}return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0xe1'),'DIAL'));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0xe2')]=function(_0x12ab3c){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0xe3'),_0x12ab3c['label']));if(!this[_0x5bb3('0xa9')](_0x12ab3c[_0x5bb3('0x80')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xe4'));}if(!this[_0x5bb3('0xa9')](_0x12ab3c[_0x5bb3('0x5f')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xab'));}this[_0x5bb3('0x10')][_0x5bb3('0xe5')]=!![];this[_0x5bb3('0x38')](_0x12ab3c);this['createSquareMessage'](_0x12ab3c['text'],'in','','');this['channel'][_0x5bb3('0xaa')](util['format'](_0x5bb3('0xe6'),_0x12ab3c[_0x5bb3('0x5f')]));var _0x30294e=this['googleDialogflow'][_0x5bb3('0x6e')](this,_0x12ab3c);if(_0x30294e){for(var _0x1e9611 in _0x30294e){if(_0x30294e[_0x5bb3('0x97')](_0x1e9611)){this['channel']['setVariable'](util[_0x5bb3('0x2a')](_0x5bb3('0xe7'),_0x1e9611['toUpperCase']()),_0x30294e[_0x1e9611]);}}this['createSquareMessage'](_0x30294e[_0x5bb3('0xe8')],'out',_0x5bb3('0xe2'),'');return this['channel'][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')]('Dialogflow\x20Result\x20%s',_0x30294e[_0x5bb3('0xe8')]));}return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x12ab3c,_0x5bb3('0xe9'));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0xea')]=function(_0x2006fe){logger[_0x5bb3('0x2f')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x2006fe[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x2006fe[_0x5bb3('0x7c')])){return this[_0x5bb3('0x10')]['noop']('no\x20project_id\x20configured');}if(!this[_0x5bb3('0xa9')](_0x2006fe[_0x5bb3('0xeb')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')]('no\x20client_email\x20configured');}if(!this[_0x5bb3('0xa9')](_0x2006fe[_0x5bb3('0x7d')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xec'));}if(!this[_0x5bb3('0xa9')](_0x2006fe[_0x5bb3('0xed')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')]('no\x20anguage\x20configured');}if(!this[_0x5bb3('0xa9')](_0x2006fe[_0x5bb3('0x5f')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xab'));}this[_0x5bb3('0x10')][_0x5bb3('0xe5')]=!![];this[_0x5bb3('0x38')](_0x2006fe);this[_0x5bb3('0x45')](_0x2006fe[_0x5bb3('0x5f')],'in','','');this['channel']['noop'](util[_0x5bb3('0x2a')](_0x5bb3('0xee'),_0x2006fe['text']));var _0x3e5cf5=this[_0x5bb3('0x7b')]['sync'](this,_0x2006fe);if(_0x3e5cf5){for(var _0x17854b in _0x3e5cf5){if(_0x3e5cf5['hasOwnProperty'](_0x17854b)){if(_0x17854b!=='providerResponse'){this[_0x5bb3('0x10')][_0x5bb3('0xa0')](util['format']('DIALOGFLOW_%s',_0x17854b[_0x5bb3('0x67')]()),_0x3e5cf5[_0x17854b]);}}}this['createSquareMessage'](_0x3e5cf5[_0x5bb3('0xe8')],_0x5bb3('0xef'),_0x5bb3('0xea'),_0x3e5cf5[_0x5bb3('0xf0')]);return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')]('DialogflowV2\x20Result\x20%s',_0x3e5cf5['speech']));}return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x2006fe,_0x5bb3('0xf1'));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0xf2')]=function(_0x3e0893){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0xf3'),_0x3e0893[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x3e0893[_0x5bb3('0xf4')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xf5'));}if(!this[_0x5bb3('0xa9')](_0x3e0893[_0x5bb3('0xf6')])){return this[_0x5bb3('0x10')]['noop'](_0x5bb3('0xf7'));}if(!this[_0x5bb3('0xa9')](_0x3e0893[_0x5bb3('0xf8')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xf9'));}if(!this[_0x5bb3('0xa9')](_0x3e0893[_0x5bb3('0xfa')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xab'));}this[_0x5bb3('0x10')][_0x5bb3('0xe5')]=!![];this[_0x5bb3('0x38')](_0x3e0893);this[_0x5bb3('0x45')](_0x3e0893[_0x5bb3('0x5f')],'in','','');this['channel'][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0xfb'),_0x3e0893[_0x5bb3('0x5f')]));var _0x177b60=this['sestekNDA'][_0x5bb3('0x6e')](this,_0x3e0893);if(_0x177b60){for(var _0x5ea2ea in _0x177b60){if(_0x177b60[_0x5bb3('0x97')](_0x5ea2ea)){this[_0x5bb3('0x10')][_0x5bb3('0xa0')](util[_0x5bb3('0x2a')](_0x5bb3('0xfc'),_0x5ea2ea[_0x5bb3('0x67')]()),_0x177b60[_0x5ea2ea]);}}this[_0x5bb3('0x45')](_0x177b60[_0x5bb3('0xe8')],_0x5bb3('0xef'),_0x5bb3('0xf2'),'');if(_0x177b60[_0x5bb3('0xfd')]){this[_0x5bb3('0x10')]['noop'](util['format'](_0x5bb3('0xfe'),_0x177b60['audiofile']));var _0x333fd0=this[_0x5bb3('0x10')][_0x5bb3('0xff')](_0x177b60['audiofile']);try{fs[_0x5bb3('0x100')](_0x177b60[_0x5bb3('0xfd')]+_0x5bb3('0x101'));}catch(_0x4fec71){logger[_0x5bb3('0x2d')](_0x4fec71);}return _0x333fd0;}else{return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util['format'](_0x5bb3('0x102'),_0x177b60[_0x5bb3('0xe8')]));}}return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x3e0893,_0x5bb3('0x103'));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x104')]=function(_0x511da6){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')]('Enter\x20in\x20END\x20(%s)\x20block',_0x511da6[_0x5bb3('0x3a')]));return this[_0x5bb3('0x10')]['noop'](_0x5bb3('0x104'));};AGIVertices['prototype']['ext_dial']=function(_0x39abfe){logger['info'](util[_0x5bb3('0x2a')](_0x5bb3('0x105'),_0x39abfe['label']));var _0x313c88='';if(_0x39abfe[_0x5bb3('0x106')]){if(!this[_0x5bb3('0xa9')](_0x39abfe['trunk_id'])){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x39abfe,'no\x20trunk\x20selected');}else{var _0x5346be=parseInt(_0x39abfe[_0x5bb3('0x106')],0xa);if(isNaN(_0x5346be)){_0x313c88=_0x39abfe[_0x5bb3('0x106')];}else{_0x313c88=this[_0x5bb3('0x1f')][_0x5bb3('0x6e')](this,_0x39abfe[_0x5bb3('0x106')]);if(!_0x313c88){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x39abfe,_0x5bb3('0x107'));}}}}else if(_0x39abfe[_0x5bb3('0x108')]){_0x313c88=_0x39abfe[_0x5bb3('0x108')];}else{return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x39abfe,_0x5bb3('0x109'));}var _0x338906=this[_0x5bb3('0x10')][_0x5bb3('0x5b')](_0x5bb3('0xde'),[util['format'](_0x5bb3('0x10a'),_0x313c88,_0x39abfe['phone']),_0x39abfe['timeout'],_0x39abfe[_0x5bb3('0xe0')],_0x39abfe[_0x5bb3('0x71')]]);if(_0x338906[_0x5bb3('0xa4')]===-0x1){return _0x338906;}return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util['format'](_0x5bb3('0xe1'),_0x5bb3('0xde')));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x10b')]=function(_0x18f446){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x10c'),_0x18f446[_0x5bb3('0x3a')]));return this['channel'][_0x5bb3('0xaa')](_0x5bb3('0x10b'));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0xe')]=function(_0x2b712a){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x2b712a['label']));if(_0x2b712a[_0x5bb3('0x10d')]===0x0){return this['maxRetry'](_0x2b712a);}_0x2b712a[_0x5bb3('0x10d')]-=0x1;if(!this[_0x5bb3('0xa9')](_0x2b712a['file_id'])){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x2b712a,_0x5bb3('0x10e'));}var _0x276363=this[_0x5bb3('0x20')][_0x5bb3('0x6e')](this,_0x2b712a[_0x5bb3('0x10f')]);if(!_0x276363){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x2b712a,_0x5bb3('0x110'));}if(!this['isConfigured'](_0x2b712a['variable_id'])){return this[_0x5bb3('0x10')]['error'](_0x5bb3('0x111'));}var _0x42fce=this[_0x5bb3('0x10')]['getData'](_0x276363,_0x2b712a[_0x5bb3('0x112')],_0x2b712a[_0x5bb3('0x113')]);var _0x5a2654=_0x42fce['result']?_0x42fce[_0x5bb3('0xa4')]['toString']():'';logger[_0x5bb3('0x2f')]('test',JSON[_0x5bb3('0x72')](_0x42fce));if(_0x42fce[_0x5bb3('0xa4')]===-0x1){this['createSquareDetailsReport'][_0x5bb3('0x6e')](this,_0x2b712a,_0x5a2654);return _0x42fce;}else if(_0x42fce['extra']===_0x5bb3('0x65')){_0x42fce[_0x5bb3('0xa4')]=_0x5a2654[_0x5bb3('0x9c')]>=parseInt(_0x2b712a[_0x5bb3('0x114')])?'x':'i';}else{_0x42fce[_0x5bb3('0xa4')]=_0x5a2654[_0x5bb3('0x9c')]>=parseInt(_0x2b712a[_0x5bb3('0x114')])&&_0x5a2654['length']<=parseInt(_0x2b712a[_0x5bb3('0x113')])?'x':'i';}var _0x44c303=this[_0x5bb3('0x12')][_0x5bb3('0x6e')](this,_0x2b712a['variable_id']);if(!_0x44c303){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x2b712a,_0x5bb3('0xd5'));}this[_0x5bb3('0x10')]['setVariable'](_0x44c303,_0x5a2654);if(this[_0x5bb3('0xa9')](_0x2b712a[_0x5bb3('0x115')])){var _0x5e579f=parseInt(_0x2b712a[_0x5bb3('0x115')],0xa);var _0x42f82b=rs['generate']({'charset':'*','length':_0x5e579f});var _0x2e3fe6=_0x5a2654[_0x5bb3('0x9c')];if(_0x2e3fe6>0x0){if(_0x2e3fe6>_0x5e579f){this[_0x5bb3('0x38')][_0x5bb3('0x6e')](this,_0x2b712a,_0x2b712a[_0x5bb3('0x116')]===_0x5bb3('0x117')?_0x42f82b+_0x5a2654['substr'](_0x5e579f):_0x5a2654[_0x5bb3('0x118')](0x0,_0x2e3fe6-_0x5e579f)+_0x42f82b);}else{this[_0x5bb3('0x38')]['sync'](this,_0x2b712a,rs[_0x5bb3('0x119')]({'charset':'*','length':_0x2e3fe6}));}}else{this[_0x5bb3('0x38')]['sync'](this,_0x2b712a,'');}}else{this[_0x5bb3('0x38')]['sync'](this,_0x2b712a,_0x5a2654);}return _0x42fce;};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0xf')]=function(_0x41ad87){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x41ad87[_0x5bb3('0x3a')]));return this[_0x5bb3('0xe')](_0x41ad87);};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x11a')]=function(_0x506570){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x506570[_0x5bb3('0x3a')]));this[_0x5bb3('0x38')][_0x5bb3('0x6e')](this,_0x506570,_0x506570[_0x5bb3('0x11b')]);return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util['format'](_0x5bb3('0x11c'),_0x506570[_0x5bb3('0x11b')]));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x11d')]=function(_0x284bed){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x11e'),_0x284bed['label']));if(!this['isConfigured'](_0x284bed[_0x5bb3('0x85')])||!this['isConfigured'](_0x284bed[_0x5bb3('0x8b')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0x11f'));}if(!this[_0x5bb3('0xa9')](_0x284bed[_0x5bb3('0x5f')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xab'));}this['channel']['noop'](util[_0x5bb3('0x2a')]('Trying\x20aws\x20Polly\x20%s',_0x284bed[_0x5bb3('0x5f')]));var _0x10a4bc=this['awsPolly'][_0x5bb3('0x6e')](this,_0x284bed);if(_0x10a4bc){this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x120'),_0x10a4bc));var _0x25410c=this[_0x5bb3('0x10')][_0x5bb3('0xff')](_0x10a4bc);try{fs[_0x5bb3('0x100')](_0x10a4bc+_0x5bb3('0x101'));}catch(_0x438526){logger[_0x5bb3('0x2d')](_0x438526);}return _0x25410c;}return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x284bed,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x5bb3('0x17')]['awslex']=function(_0x1eda73){logger[_0x5bb3('0x2f')](util['format'](_0x5bb3('0x121'),_0x1eda73[_0x5bb3('0x3a')]));if(!this['isConfigured'](_0x1eda73[_0x5bb3('0x85')])||!this[_0x5bb3('0xa9')](_0x1eda73[_0x5bb3('0x8b')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x5bb3('0xa9')](_0x1eda73[_0x5bb3('0x122')])){return this['channel'][_0x5bb3('0xaa')](_0x5bb3('0x123'));}if(!this['isConfigured'](_0x1eda73['text'])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xab'));}this[_0x5bb3('0x10')][_0x5bb3('0xe5')]=!![];this[_0x5bb3('0x38')](_0x1eda73);this[_0x5bb3('0x45')](_0x1eda73['text'],'in','','');this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x124'),_0x1eda73[_0x5bb3('0x5f')]));var _0x15003a=this[_0x5bb3('0x8a')]['sync'](this,_0x1eda73);if(_0x15003a){for(var _0x51bd62 in _0x15003a){if(_0x15003a['hasOwnProperty'](_0x51bd62)&&_[_0x5bb3('0x98')](_0x15003a[_0x51bd62])){this[_0x5bb3('0x10')][_0x5bb3('0xa0')](util['format'](_0x5bb3('0x125'),_0x51bd62[_0x5bb3('0x67')]()),_0x15003a[_0x51bd62]);}}if(_[_0x5bb3('0x49')](_0x15003a[_0x5bb3('0x76')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0x126'));}else{this[_0x5bb3('0x45')](_0x15003a['message'],_0x5bb3('0xef'),_0x5bb3('0x127'),'');return this[_0x5bb3('0x10')]['noop'](util[_0x5bb3('0x2a')](_0x5bb3('0x128'),_0x15003a['message']));}}return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x1eda73,_0x5bb3('0x129'));};AGIVertices['prototype'][_0x5bb3('0x12a')]=function(_0x22cea6){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x12b'),_0x22cea6[_0x5bb3('0x3a')],_0x22cea6[_0x5bb3('0x65')]));if(!this[_0x5bb3('0xa9')](_0x22cea6[_0x5bb3('0x80')])){return this['channel'][_0x5bb3('0xaa')](_0x5bb3('0xe4'));}var _0x25d782='wav';var _0x48700c=util[_0x5bb3('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0x5bb3('0x119')](0x4));var _0x43a404=util[_0x5bb3('0x2a')]('%s.%s',_0x48700c,_0x25d782);var _0x29a4cb=!![];if(_0x22cea6[_0x5bb3('0x12c')]===_0x5bb3('0x12d')){_0x29a4cb=![];}var _0x3848cd=this[_0x5bb3('0x10')][_0x5bb3('0x12e')](_0x48700c,_0x25d782,_0x22cea6[_0x5bb3('0x12f')],_0x22cea6[_0x5bb3('0x65')],undefined,_0x29a4cb);if(_0x3848cd[_0x5bb3('0xa4')]!==-0x1){this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')]('google\x20%s\x20file\x20created',_0x43a404));var _0xef12fd=this['googleASR'][_0x5bb3('0x6e')](this,_0x22cea6,_0x43a404);if(_0xef12fd){for(var _0x4ff8ad in _0xef12fd){if(_0xef12fd[_0x5bb3('0x97')](_0x4ff8ad)){this[_0x5bb3('0x10')][_0x5bb3('0xa0')](util['format']('GOOGLE_ASR_%s',_0x4ff8ad[_0x5bb3('0x67')]()),_0xef12fd[_0x4ff8ad]);}}return this['channel'][_0x5bb3('0xaa')](util['format'](_0x5bb3('0x130'),JSON[_0x5bb3('0x72')](_0xef12fd)));}}return _0x3848cd;};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x131')]=function(_0x35b87e){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x132'),_0x35b87e[_0x5bb3('0x3a')]));if(!this['isConfigured'](_0x35b87e[_0x5bb3('0x91')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x35b87e[_0x5bb3('0x92')])){return this['channel']['noop']('no\x20appsecret\x20configured');}var _0x322f53=_0x5bb3('0x133');var _0x49a617=util['format'](_0x5bb3('0x134'),FILES_PATH,rs[_0x5bb3('0x119')](0x4));var _0x377d9c=util[_0x5bb3('0x2a')]('%s.%s',_0x49a617,_0x322f53);var _0x5cb2ac=!![];if(_0x35b87e[_0x5bb3('0x12c')]==='NOBEEP'){_0x5cb2ac=![];}var _0x37f65f=this[_0x5bb3('0x10')][_0x5bb3('0x12e')](_0x49a617,_0x322f53,_0x35b87e[_0x5bb3('0x12f')],_0x35b87e['timeout'],undefined,_0x5cb2ac);if(_0x37f65f['result']!==-0x1){this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util['format'](_0x5bb3('0x135'),_0x377d9c));var _0x1335cc=this[_0x5bb3('0x90')][_0x5bb3('0x6e')](this,_0x35b87e,_0x377d9c);if(_0x1335cc){for(var _0x21058d in _0x1335cc){if(_0x1335cc[_0x5bb3('0x97')](_0x21058d)){this[_0x5bb3('0x10')]['setVariable'](util[_0x5bb3('0x2a')](_0x5bb3('0x136'),_0x21058d[_0x5bb3('0x67')]()),_0x1335cc[_0x21058d]);}}return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x137'),JSON['stringify'](_0x1335cc)));}}return _0x37f65f;};AGIVertices[_0x5bb3('0x17')]['gotoc']=function(_0x439b57){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x439b57[_0x5bb3('0x3a')]));return this[_0x5bb3('0x10')][_0x5bb3('0x138')](_0x439b57['context'],_0x439b57['extension'],_0x439b57['priority']);};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x139')]=function(_0x22f69f){logger[_0x5bb3('0x2f')](util['format'](_0x5bb3('0x13a'),_0x22f69f['label']));if(!this[_0x5bb3('0xa9')](_0x22f69f[_0x5bb3('0x13b')])){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x22f69f,_0x5bb3('0x13c'));}try{var _0xd89f09=eval(_0x22f69f[_0x5bb3('0x13b')])?'true':_0x5bb3('0x13d');this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util['format'](_0x5bb3('0x13e'),_0x22f69f['condition'],_0xd89f09));return{'code':0xc8,'result':_0xd89f09};}catch(_0x577538){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x13f')]=function(_0x4ca8e5){logger['info'](util[_0x5bb3('0x2a')](_0x5bb3('0x140'),_0x4ca8e5['label']));if(!this[_0x5bb3('0xa9')](_0x4ca8e5[_0x5bb3('0x141')])){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x4ca8e5,_0x5bb3('0x142'));}var _0x63bd=this[_0x5bb3('0x25')][_0x5bb3('0x6e')](this,_0x4ca8e5['interval_id']);if(!_0x63bd){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x4ca8e5,'no\x20intervals\x20found');}for(var _0x327113=0x0;_0x327113<_0x63bd['length'];_0x327113+=0x1){var _0x417d94=this[_0x5bb3('0x10')][_0x5bb3('0x12')](util['format'](_0x5bb3('0x143'),_0x63bd[_0x327113]));if(_0x417d94['result']===-0x1){return _0x417d94;}logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x144'),_0x63bd[_0x327113],_0x417d94['extra']));if(_0x417d94[_0x5bb3('0xa5')]==='true'){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x144'),_0x63bd[_0x327113],_0x5bb3('0x145')));this['channel'][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')]('IFTIME\x20%s\x20%s',_0x63bd[_0x327113],_0x5bb3('0x145')));return{'code':0xc8,'result':_0x5bb3('0x145')};}else{logger[_0x5bb3('0x2f')](util['format']('IFTIME\x20%s\x20%s',_0x63bd[_0x327113],'false'));this[_0x5bb3('0x10')]['noop'](util['format'](_0x5bb3('0x144'),_0x63bd[_0x327113],_0x5bb3('0x13d')));}}return{'code':0xc8,'result':_0x5bb3('0x13d')};};AGIVertices[_0x5bb3('0x17')]['hangup']=function(_0x133094){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x146'),_0x133094[_0x5bb3('0x3a')]));return this[_0x5bb3('0x10')][_0x5bb3('0x147')]();};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x148')]=function(_0x4a0680){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x149'),_0x4a0680[_0x5bb3('0x3a')]));if(!this['isConfigured'](_0x4a0680['key'])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xe4'));}var _0x265ccd=_0x5bb3('0x133');var _0x4e9989=util[_0x5bb3('0x2a')](_0x5bb3('0x134'),FILES_PATH,rs[_0x5bb3('0x119')](0x4));var _0x356b7b=util[_0x5bb3('0x2a')]('%s.%s',_0x4e9989,_0x265ccd);var _0x462e12=!![];if(_0x4a0680[_0x5bb3('0x12c')]==='NOBEEP'){_0x462e12=![];}var _0x34a62a=this['channel'][_0x5bb3('0x12e')](_0x4e9989,_0x265ccd,_0x4a0680[_0x5bb3('0x12f')],_0x4a0680[_0x5bb3('0x65')],undefined,_0x462e12);if(_0x34a62a['result']!==-0x1){this['channel'][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x14a'),_0x356b7b));var _0x1a95b2=this['ispeechASR'][_0x5bb3('0x6e')](this,_0x4a0680,_0x356b7b);if(_0x1a95b2){for(var _0x2f695d in _0x1a95b2){if(_0x1a95b2[_0x5bb3('0x97')](_0x2f695d)){this[_0x5bb3('0x10')][_0x5bb3('0xa0')](util[_0x5bb3('0x2a')](_0x5bb3('0x14b'),_0x2f695d['toUpperCase']()),_0x1a95b2[_0x2f695d]);}}return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x1a95b2)));}}return _0x34a62a;};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x14c')]=function(_0x75fdab){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x14d'),_0x75fdab[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x75fdab[_0x5bb3('0x80')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xe4'));}if(!this['isConfigured'](_0x75fdab['text'])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xab'));}this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util['format'](_0x5bb3('0x14e'),_0x75fdab['text']));var _0xf9af14=this[_0x5bb3('0x7f')][_0x5bb3('0x6e')](this,_0x75fdab);if(_0xf9af14){this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')]('ispeech\x20%s\x20file\x20created',_0xf9af14));var _0x3a6971=this[_0x5bb3('0x10')]['streamFile'](_0xf9af14,_0x75fdab['intKey']);try{fs[_0x5bb3('0x100')](_0xf9af14+_0x5bb3('0x101'));}catch(_0x58991e){logger[_0x5bb3('0x2d')](_0x58991e);}return _0x3a6971;}return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x75fdab,_0x5bb3('0x14f'));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x150')]=function(_0x2c2a18){logger['info'](util[_0x5bb3('0x2a')](_0x5bb3('0x151'),_0x2c2a18[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x2c2a18[_0x5bb3('0x152')])){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x2c2a18,_0x5bb3('0x153'));}logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x5bb3('0x10')][_0x5bb3('0x3c')],_0x2c2a18[_0x5bb3('0x152')]));var _0x164cec=this[_0x5bb3('0x56')]['sync'](this,_0x2c2a18['findBy']);if(_0x164cec){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x154'),this[_0x5bb3('0x10')]['callerid'],_0x2c2a18[_0x5bb3('0x152')]));this['channel'][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x154'),this[_0x5bb3('0x10')][_0x5bb3('0x3c')],_0x2c2a18[_0x5bb3('0x152')]));return{'code':0xc8,'result':_0x5bb3('0x155')};}else{logger['info'](util[_0x5bb3('0x2a')](_0x5bb3('0x156'),this['channel'][_0x5bb3('0x3c')],_0x2c2a18['findBy']));this[_0x5bb3('0x10')]['noop'](util[_0x5bb3('0x2a')](_0x5bb3('0x156'),this[_0x5bb3('0x10')][_0x5bb3('0x3c')],_0x2c2a18[_0x5bb3('0x152')]));return{'code':0xc8,'result':_0x5bb3('0x157')};}};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x158')]=function(_0x3e8e77){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3e8e77[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x3e8e77[_0x5bb3('0x152')])){return this['channel'][_0x5bb3('0x2d')](_0x3e8e77,_0x5bb3('0x153'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x5bb3('0x10')][_0x5bb3('0x3c')],_0x3e8e77['findBy']));var _0x3523ce=this[_0x5bb3('0x55')][_0x5bb3('0x6e')](this,_0x3e8e77[_0x5bb3('0x152')]);if(_0x3523ce){logger['info'](util[_0x5bb3('0x2a')](_0x5bb3('0x154'),this[_0x5bb3('0x10')][_0x5bb3('0x3c')],_0x3e8e77[_0x5bb3('0x152')]));this['channel'][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x154'),this[_0x5bb3('0x10')][_0x5bb3('0x3c')],_0x3e8e77[_0x5bb3('0x152')]));return{'code':0xc8,'result':_0x5bb3('0x155')};}else{logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x156'),this[_0x5bb3('0x10')]['callerid'],_0x3e8e77[_0x5bb3('0x152')]));this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x156'),this[_0x5bb3('0x10')]['callerid'],_0x3e8e77['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x159')]=function(_0x171443){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x15a'),_0x171443[_0x5bb3('0x3a')]));if(!this['isConfigured'](_0x171443['operation'])){return this['channel'][_0x5bb3('0x2d')](_0x171443,_0x5bb3('0x15b'));}this['channel'][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x15c'),_0x171443[_0x5bb3('0x15d')]));var _0x5db4f4=eval(_0x171443[_0x5bb3('0x15d')]);if(!this[_0x5bb3('0xa9')](_0x171443[_0x5bb3('0xd4')])){return this['channel'][_0x5bb3('0xaa')](_0x5bb3('0x111'));}var _0x2d773d=this[_0x5bb3('0x12')][_0x5bb3('0x6e')](this,_0x171443['variable_id']);if(!_0x2d773d){return this[_0x5bb3('0x10')]['error'](_0x171443,'no\x20variable\x20found');}if(_[_0x5bb3('0x9b')](_0x5db4f4)){var _0x4cb477=this;_0x5db4f4[_0x5bb3('0xd6')](function(_0x1b9215,_0x3f7b4f){_0x4cb477[_0x5bb3('0x10')][_0x5bb3('0xa0')](util[_0x5bb3('0x2a')]('%s[%s]',_0x2d773d,_0x3f7b4f),_0x1b9215);});return this['channel'][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')]('variable\x20%s[key]\x20set',_0x2d773d));}else{return this[_0x5bb3('0x10')][_0x5bb3('0xa0')](_0x2d773d,_0x5db4f4);}};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x15e')]=function(_0x5d9972){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x15f'),_0x5d9972[_0x5bb3('0x3a')]));if(_0x5d9972['retry']===0x0){return this[_0x5bb3('0xa6')](_0x5d9972);}_0x5d9972[_0x5bb3('0x10d')]-=0x1;if(!this['isConfigured'](_0x5d9972[_0x5bb3('0x10f')])){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x5d9972,_0x5bb3('0x10e'));}var _0xf70f71=this['getSound'][_0x5bb3('0x6e')](this,_0x5d9972[_0x5bb3('0x10f')]);if(!_0xf70f71){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x5d9972,_0x5bb3('0x110'));}var _0x2b3c20=this['channel']['getData'](_0xf70f71,_0x5d9972[_0x5bb3('0x112')],_0x5d9972[_0x5bb3('0x160')]);var _0x3de97f=_0x2b3c20[_0x5bb3('0xa4')];if(_0x2b3c20[_0x5bb3('0xa4')]===-0x1){this[_0x5bb3('0x38')][_0x5bb3('0x6e')](this,_0x5d9972,'-1');return _0x2b3c20;}else if(_0x2b3c20['extra']===_0x5bb3('0x65')){_0x2b3c20['result']=_0x2b3c20['result'][_0x5bb3('0x9c')]>0x0?_0x2b3c20[_0x5bb3('0xa4')]:'t';}else if(_['isEmpty'](_0x2b3c20[_0x5bb3('0xa4')])){_0x2b3c20[_0x5bb3('0xa4')]='#';_0x3de97f='#';}if(!this[_0x5bb3('0xa9')](_0x5d9972[_0x5bb3('0xd4')])){this[_0x5bb3('0x10')]['noop'](_0x5bb3('0x111'));}else{var _0x2a46d3=this[_0x5bb3('0x12')][_0x5bb3('0x6e')](this,_0x5d9972[_0x5bb3('0xd4')]);if(!_0x2a46d3){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x5d9972,'no\x20variable\x20found');}this[_0x5bb3('0x10')]['setVariable'](_0x2a46d3,_0x3de97f);}this[_0x5bb3('0x38')]['sync'](this,_0x5d9972,_0x3de97f);return _0x2b3c20;};AGIVertices['prototype']['noop']=function(_0x2a6561){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x161'),_0x2a6561[_0x5bb3('0x3a')]));return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x2a6561[_0x5bb3('0x162')]||_0x2a6561['label']);};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x163')]=function(_0x5b9cfe){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x164'),_0x5b9cfe[_0x5bb3('0x3a')]));if(!this['isConfigured'](_0x5b9cfe[_0x5bb3('0x152')])){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x5b9cfe,'no\x20find\x20by\x20configured');}logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x165'),this['channel'][_0x5bb3('0x3c')],_0x5b9cfe[_0x5bb3('0x152')]));var _0x35c29c=this[_0x5bb3('0x50')][_0x5bb3('0x6e')](this,_0x5b9cfe[_0x5bb3('0x166')]);var _0x4c0942=this['agentPause'][_0x5bb3('0x6e')](this,_0x5b9cfe[_0x5bb3('0x152')],_0x35c29c);if(_0x4c0942){logger[_0x5bb3('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x5bb3('0x10')]['callerid'],_0x5b9cfe[_0x5bb3('0x152')]));this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5bb3('0x10')][_0x5bb3('0x3c')],_0x5b9cfe[_0x5bb3('0x152')]));return{'code':0xc8,'result':_0x5bb3('0x155')};}else{logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x156'),this[_0x5bb3('0x10')][_0x5bb3('0x3c')],_0x5b9cfe[_0x5bb3('0x152')]));this[_0x5bb3('0x10')]['noop'](util[_0x5bb3('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5bb3('0x10')][_0x5bb3('0x3c')],_0x5b9cfe[_0x5bb3('0x152')]));return{'code':0xc8,'result':_0x5bb3('0x157')};}};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x167')]=function(_0x348a99){logger[_0x5bb3('0x2f')](util['format'](_0x5bb3('0x168'),_0x348a99[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x348a99[_0x5bb3('0x10f')])){return this[_0x5bb3('0x10')]['error'](_0x348a99,'no\x20file\x20audio\x20selected');}var _0x3f9f9f=this[_0x5bb3('0x20')][_0x5bb3('0x6e')](this,_0x348a99[_0x5bb3('0x10f')]);if(!_0x3f9f9f){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x348a99,_0x5bb3('0x110'));}var _0x3f7f00=this['channel'][_0x5bb3('0x5b')]('PLAYBACK',[_0x3f9f9f,_0x348a99[_0x5bb3('0xe0')]]);if(_0x3f7f00['result']===-0x1){return _0x3f7f00;}return this['channel']['noop'](util[_0x5bb3('0x2a')](_0x5bb3('0xc3'),_0x5bb3('0x169'),_0x3f9f9f));};AGIVertices[_0x5bb3('0x17')]['queue']=function(_0xa44732){logger[_0x5bb3('0x2f')](util['format'](_0x5bb3('0x16a'),_0xa44732[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0xa44732[_0x5bb3('0x16b')])){return this['channel'][_0x5bb3('0x2d')](_0xa44732,_0x5bb3('0x16c'));}var _0x4404c1='';var _0x3e925a=parseInt(_0xa44732[_0x5bb3('0x16b')],0xa);if(isNaN(_0x3e925a)){_0x4404c1=_0xa44732[_0x5bb3('0x16b')];}else{_0x4404c1=this[_0x5bb3('0x18')][_0x5bb3('0x6e')](this,_0xa44732[_0x5bb3('0x16b')]);if(!_0x4404c1){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0xa44732,_0x5bb3('0x16d'));}}var _0x6be117='';if(this[_0x5bb3('0xa9')](_0xa44732[_0x5bb3('0x10f')])){var _0x3779cb=this[_0x5bb3('0x20')][_0x5bb3('0x6e')](this,_0xa44732[_0x5bb3('0x10f')]);if(_0x3779cb){_0x6be117=_0x3779cb;}}this[_0x5bb3('0x38')][_0x5bb3('0x6e')](this,_0xa44732,_0x4404c1);if(_0xa44732[_0x5bb3('0xe0')][_0x5bb3('0x16e')]('x')<0x0){_0xa44732[_0x5bb3('0xe0')]+='x';}if(_0xa44732['opts']['indexOf']('X')<0x0){_0xa44732[_0x5bb3('0xe0')]+='X';}this['channel']['setVariable'](_0x5bb3('0x16f'),_0x4404c1?_0x4404c1[_0x5bb3('0x170')]():'');var _0x581e9c=this[_0x5bb3('0x10')][_0x5bb3('0x5b')]('QUEUE',[_0x4404c1,_0xa44732['opts'],_0xa44732['url'],_0x6be117,_0xa44732[_0x5bb3('0x65')],_0xa44732[_0x5bb3('0x7')],_0xa44732[_0x5bb3('0x171')],_0xa44732['gosub'],'',_0xa44732[_0x5bb3('0x172')]]);if(_0x581e9c[_0x5bb3('0xa4')]===-0x1){return _0x581e9c;}return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')]('Executed\x20command\x20%s\x20%s',_0x5bb3('0x173'),_0x4404c1));};AGIVertices[_0x5bb3('0x17')]['record']=function(_0x2cd72d){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x174'),_0x2cd72d['label']));var _0x40ae0d=_0x2cd72d[_0x5bb3('0x175')]||_0x5bb3('0x133');var _0x3f563e=util[_0x5bb3('0x2a')](_0x5bb3('0x176'),this['channel'][_0x5bb3('0x39')],rs[_0x5bb3('0x119')](0x5));var _0x26c2ab=util[_0x5bb3('0x2a')]('%s/recordings/%s.%s',FILES_PATH,_0x3f563e,_0x40ae0d);var _0x31dbe0=util[_0x5bb3('0x2a')]('%s/recordings/%s',FILES_PATH,_0x3f563e);this[_0x5bb3('0x3d')]['sync'](this,_0x2cd72d,_0x3f563e,_0x26c2ab);this[_0x5bb3('0x10')][_0x5bb3('0xa0')](_0x5bb3('0x177'),_0x3f563e);logger['info'](_0x5bb3('0x178'),_0x31dbe0,_0x40ae0d,_0x2cd72d[_0x5bb3('0x179')],_0x2cd72d[_0x5bb3('0x65')]);return this[_0x5bb3('0x10')][_0x5bb3('0x12e')](_0x31dbe0,_0x40ae0d,_0x2cd72d[_0x5bb3('0x179')],_0x2cd72d[_0x5bb3('0x65')],undefined,!![]);};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x17a')]=function(_0x1122eb){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x17b'),_0x1122eb[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x1122eb[_0x5bb3('0x71')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')]('no\x20url\x20configured');}var _0x441a3b=this[_0x5bb3('0x17c')][_0x5bb3('0x6e')](this,_0x1122eb);logger['info'](util[_0x5bb3('0x2a')](_0x5bb3('0x17d'),util['inspect'](_0x441a3b,{'showHidden':![],'depth':null})));if(!this[_0x5bb3('0xa9')](_0x1122eb[_0x5bb3('0xd4')])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0x17e'));}var _0x18ec20=this[_0x5bb3('0x12')][_0x5bb3('0x6e')](this,_0x1122eb[_0x5bb3('0xd4')]);if(!_0x18ec20){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x1122eb,_0x5bb3('0xd5'));}this[_0x5bb3('0x10')][_0x5bb3('0xa0')](util[_0x5bb3('0x2a')]('%s_STATUS_CODE',_0x18ec20),_0x441a3b[_0x5bb3('0x74')]?_0x441a3b[_0x5bb3('0x74')]:'200');this[_0x5bb3('0x10')][_0x5bb3('0xa0')](util['format'](_0x5bb3('0x17f'),_0x18ec20),_0x441a3b[_0x5bb3('0x75')]?_0x441a3b['statusMessage']:'OK');if(_0x441a3b[_0x5bb3('0x68')]){try{this[_0x5bb3('0x9e')](_0x441a3b['body'],_0x18ec20);}catch(_0x1d52e7){logger[_0x5bb3('0x2d')](util['format'](_0x5bb3('0x180'),_0x18ec20));}}return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0xd8'),_0x18ec20));};AGIVertices[_0x5bb3('0x17')]['saydigits']=function(_0x2099a3){logger[_0x5bb3('0x2f')](util['format'](_0x5bb3('0x181'),_0x2099a3[_0x5bb3('0x3a')]));return this['channel'][_0x5bb3('0x182')](_0x2099a3['digits'][_0x5bb3('0x5c')](/\s+/g,''),_0x2099a3[_0x5bb3('0x179')]);};AGIVertices[_0x5bb3('0x17')]['saynumber']=function(_0x59f688){logger['info'](util[_0x5bb3('0x2a')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x59f688[_0x5bb3('0x3a')]));return this[_0x5bb3('0x10')][_0x5bb3('0x183')](_0x59f688[_0x5bb3('0x184')][_0x5bb3('0x5c')](/\s+/g,''),_0x59f688[_0x5bb3('0x179')]);};AGIVertices['prototype'][_0x5bb3('0x185')]=function(_0x2bd97a){logger[_0x5bb3('0x2f')](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x2bd97a[_0x5bb3('0x3a')]));return this[_0x5bb3('0x10')][_0x5bb3('0x186')](_0x2bd97a[_0x5bb3('0x5f')],_0x2bd97a['escape_digits']);};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x187')]=function(_0x4d7bf9){logger['info'](util[_0x5bb3('0x2a')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x4d7bf9[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x4d7bf9['account_id'])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0x188'));}var _0x1086a0=this[_0x5bb3('0x23')][_0x5bb3('0x6e')](this,_0x4d7bf9[_0x5bb3('0x189')]);if(!_0x1086a0||!_0x1086a0[_0x5bb3('0x18a')]){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x4d7bf9,_0x5bb3('0x18b'));}var _0x31be7a={'from':util[_0x5bb3('0x2a')](_0x5bb3('0x18c'),_0x1086a0[_0x5bb3('0x15')],_0x1086a0[_0x5bb3('0x18d')]||_0x1086a0[_0x5bb3('0x18a')]['user']),'to':_0x4d7bf9['to']||'','cc':_0x4d7bf9['cc']||'','bcc':_0x4d7bf9['bcc']||'','subject':_0x4d7bf9[_0x5bb3('0x18e')],'html':_0x4d7bf9['text'],'text':_0x4d7bf9[_0x5bb3('0x5f')]};if(this[_0x5bb3('0xa9')](_0x4d7bf9['template_id'])){}logger[_0x5bb3('0x18f')](_0x5bb3('0x190'),JSON[_0x5bb3('0x72')](_0x31be7a));this['createSquareDetailsReport'][_0x5bb3('0x6e')](this,_0x4d7bf9,_0x4d7bf9[_0x5bb3('0x189')]);this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x191'),_0x1086a0[_0x5bb3('0x15')]));this[_0x5bb3('0x24')][_0x5bb3('0x6e')](this,_0x1086a0[_0x5bb3('0x192')],_0x31be7a);return this['channel'][_0x5bb3('0xaa')](_0x5bb3('0x193'));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x194')]=function(_0x261d0d){logger[_0x5bb3('0x2f')](util['format'](_0x5bb3('0x195'),_0x261d0d['label']));return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0x196'));};AGIVertices[_0x5bb3('0x17')]['sendSMS']=function(_0x4afebc){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x197'),_0x4afebc[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x4afebc[_0x5bb3('0x198')])){return this['channel'][_0x5bb3('0xaa')](_0x5bb3('0x199'));}var _0x33159f=this[_0x5bb3('0x35')][_0x5bb3('0x6e')](this,_0x4afebc[_0x5bb3('0x198')]);if(!_0x33159f){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x4afebc,_0x5bb3('0x19a'));}var _0x19a42a={'body':_0x4afebc[_0x5bb3('0x19b')],'phone':_0x4afebc['to']||'','SmsAccountId':_0x33159f['id']};logger[_0x5bb3('0x18f')](_0x5bb3('0x19c'),JSON[_0x5bb3('0x72')](_0x19a42a));this[_0x5bb3('0x38')]['sync'](this,_0x4afebc,_0x4afebc[_0x5bb3('0x198')]);this[_0x5bb3('0x10')]['noop'](util[_0x5bb3('0x2a')](_0x5bb3('0x19d'),_0x33159f[_0x5bb3('0x15')]));this[_0x5bb3('0x37')][_0x5bb3('0x6e')](this,_0x19a42a);return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0x19e'));};AGIVertices[_0x5bb3('0x17')]['set']=function(_0x1121db){logger['info'](util[_0x5bb3('0x2a')](_0x5bb3('0x19f'),_0x1121db[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x1121db[_0x5bb3('0xd4')])){return this[_0x5bb3('0x10')]['error'](_0x1121db,_0x5bb3('0x1a0'));}var _0x57c01b=this[_0x5bb3('0x12')]['sync'](this,_0x1121db[_0x5bb3('0xd4')]);if(!_0x57c01b){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x1121db,_0x5bb3('0xd5'));}return this['channel'][_0x5bb3('0xa0')](_0x57c01b,_0x1121db[_0x5bb3('0x1a1')]);};AGIVertices[_0x5bb3('0x17')]['start']=function(_0x50f167){logger[_0x5bb3('0x2f')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x50f167[_0x5bb3('0x3a')]));this[_0x5bb3('0x10')][_0x5bb3('0xaa')]('START\x20CALLY\x20SQUARE');if(_0x50f167['answer']===_0x5bb3('0x1a2')){this[_0x5bb3('0x10')]['noop'](_0x5bb3('0x1a3'));return this[_0x5bb3('0x10')]['answer']();}return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0x1a4'));};AGIVertices['prototype']['subproject']=function(_0x25c17e){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x1a5'),_0x25c17e[_0x5bb3('0x3a')]));if(!this['isConfigured'](_0x25c17e['project_id'])){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x25c17e,_0x5bb3('0x1a6'));}var _0xc92fa0=this[_0x5bb3('0x1b')]['sync'](this,_0x25c17e[_0x5bb3('0x1a7')]);if(!this[_0x5bb3('0xa9')](_0xc92fa0)){return this[_0x5bb3('0x10')]['error'](_0x25c17e,util[_0x5bb3('0x2a')](_0x5bb3('0x1a8'),_0x25c17e[_0x5bb3('0x1a7')]));}if(_0xc92fa0===this[_0x5bb3('0x10')]['arg_1']){return this['channel'][_0x5bb3('0x2d')](_0x25c17e,_0x5bb3('0x1a9'));}this[_0x5bb3('0x38')][_0x5bb3('0x6e')](this,_0x25c17e,_0xc92fa0);var _0x473281=this['channel'][_0x5bb3('0x5b')](_0x5bb3('0x1aa'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x5bb3('0x1ab')]||_0x5bb3('0x1ac'),_0xc92fa0,this[_0x5bb3('0x10')][_0x5bb3('0x3b')]));if(_0x473281[_0x5bb3('0xa4')]===-0x1){return _0x473281;}return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0xc3'),_0x5bb3('0x1aa'),_0xc92fa0));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x1ad')]=function(_0x1ac18d){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x1ae'),_0x1ac18d[_0x5bb3('0x3a')]));var _0x21e5a4=this[_0x5bb3('0x5a')][_0x5bb3('0x6e')](this,_0x1ac18d['command']);this['createSquareDetailsReport'][_0x5bb3('0x6e')](this,_0x1ac18d,_0x1ac18d['command']);if(this['isConfigured'](_0x1ac18d[_0x5bb3('0xd4')])){var _0x2c1767=this[_0x5bb3('0x12')][_0x5bb3('0x6e')](this,_0x1ac18d[_0x5bb3('0xd4')]);if(_0x2c1767){this[_0x5bb3('0x10')]['setVariable'](_0x2c1767,_0x21e5a4);return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x1af'),_0x1ac18d[_0x5bb3('0xb6')],_0x2c1767));}}return this['channel'][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1ac18d[_0x5bb3('0xb6')]));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x1b0')]=function(_0x209f91){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x209f91[_0x5bb3('0x3a')]));_0x209f91[_0x5bb3('0x5f')]=_0x209f91[_0x5bb3('0x5f')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x209f91['apiKey'])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0x1b1'));}if(!this[_0x5bb3('0xa9')](_0x209f91['text'])){return this[_0x5bb3('0x10')][_0x5bb3('0xaa')](_0x5bb3('0xab'));}this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x1b2'),_0x209f91[_0x5bb3('0x5f')]));var _0x3f6087=this['googleCloudTTS'][_0x5bb3('0x6e')](this,_0x209f91);if(_0x3f6087){this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x1b3'),_0x3f6087));var _0x432881=this[_0x5bb3('0x10')][_0x5bb3('0xff')](_0x3f6087);try{fs[_0x5bb3('0x100')](_0x3f6087+'.wav');}catch(_0x5e6a75){logger['error'](_0x5e6a75);}return _0x432881;}return this['channel'][_0x5bb3('0x2d')](_0x209f91,_0x5bb3('0x1b4'));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x1b5')]=function(_0x2b2cf2){logger['info'](util[_0x5bb3('0x2a')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x2b2cf2[_0x5bb3('0x3a')]));_0x2b2cf2[_0x5bb3('0x5f')]=_0x2b2cf2[_0x5bb3('0x5f')][_0x5bb3('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5bb3('0xa9')](_0x2b2cf2[_0x5bb3('0x5f')])){return this[_0x5bb3('0x10')]['noop']('no\x20text\x20configured');}this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x1b6'),_0x2b2cf2[_0x5bb3('0x5f')]));var _0x13fe75=this[_0x5bb3('0x1b7')][_0x5bb3('0x6e')](this,_0x2b2cf2);if(_0x13fe75){this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x1b8'),_0x13fe75));var _0x141f40=this[_0x5bb3('0x10')][_0x5bb3('0xff')](_0x13fe75);try{fs[_0x5bb3('0x100')](_0x13fe75+_0x5bb3('0x101'));}catch(_0x26d9fb){logger[_0x5bb3('0x2d')](_0x26d9fb);}return _0x141f40;}return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x2b2cf2,_0x5bb3('0x1b9'));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x1ba')]=function(_0x3c37d5){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x1bb'),_0x3c37d5[_0x5bb3('0x3a')]));if(!this[_0x5bb3('0xa9')](_0x3c37d5[_0x5bb3('0x152')])){return this['channel'][_0x5bb3('0x2d')](_0x3c37d5,'no\x20find\x20by\x20configured');}logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x3c37d5[_0x5bb3('0x152')]));var _0xb75158=this[_0x5bb3('0x54')][_0x5bb3('0x6e')](this,_0x3c37d5[_0x5bb3('0x152')]);if(_0xb75158){logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x154'),this['channel'][_0x5bb3('0x3c')],_0x3c37d5[_0x5bb3('0x152')]));this[_0x5bb3('0x10')][_0x5bb3('0xaa')](util[_0x5bb3('0x2a')](_0x5bb3('0x154'),this[_0x5bb3('0x10')][_0x5bb3('0x3c')],_0x3c37d5['findBy']));return{'code':0xc8,'result':_0x5bb3('0x155')};}else{logger[_0x5bb3('0x2f')](util[_0x5bb3('0x2a')](_0x5bb3('0x156'),this[_0x5bb3('0x10')][_0x5bb3('0x3c')],_0x3c37d5[_0x5bb3('0x152')]));this[_0x5bb3('0x10')]['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5bb3('0x10')][_0x5bb3('0x3c')],_0x3c37d5['findBy']));return{'code':0xc8,'result':_0x5bb3('0x157')};}};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x1bc')]=function(_0x4f6a5f){logger[_0x5bb3('0x2f')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4f6a5f['label']));var _0x8d6742=this['channel']['exec'](_0x5bb3('0x1bd'),[_0x4f6a5f[_0x5bb3('0x1be')],_0x4f6a5f[_0x5bb3('0x78')]]);if(_0x8d6742[_0x5bb3('0xa4')]===-0x1){return _0x8d6742;}return this['channel'][_0x5bb3('0xaa')](util['format'](_0x5bb3('0xc3'),_0x5bb3('0x1bd'),_0x4f6a5f[_0x5bb3('0x1be')]));};AGIVertices[_0x5bb3('0x17')][_0x5bb3('0x1bf')]=function(_0x198ca7){logger[_0x5bb3('0x2f')](util['format'](_0x5bb3('0x1c0'),_0x198ca7['label']));if(!this[_0x5bb3('0xa9')](_0x198ca7[_0x5bb3('0xd4')])){return this['channel'][_0x5bb3('0x2d')](_0x198ca7,_0x5bb3('0x1a0'));}var _0x1aefca=this[_0x5bb3('0x12')]['sync'](this,_0x198ca7[_0x5bb3('0xd4')]);if(!_0x1aefca){return this[_0x5bb3('0x10')][_0x5bb3('0x2d')](_0x198ca7,_0x5bb3('0xd5'));}var _0x395232=this[_0x5bb3('0x10')][_0x5bb3('0x12')](_0x1aefca);return{'code':0xc8,'result':_0x395232[_0x5bb3('0xa5')]?_0x395232[_0x5bb3('0xa5')]:'-'};};String['prototype'][_0x5bb3('0xa3')]=function(_0x5cb88c,_0x1eeb49){return this[_0x5bb3('0xa2')](_0x5cb88c)[_0x5bb3('0x1c1')](_0x1eeb49);};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 6a7e8cc..94b1624 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 _0x7ca5=['startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','attended','destlinkedid','savePause','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','info','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','exports','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype'];(function(_0x37fff5,_0x2e32a4){var _0x51c788=function(_0x3738bd){while(--_0x3738bd){_0x37fff5['push'](_0x37fff5['shift']());}};_0x51c788(++_0x2e32a4);}(_0x7ca5,0x191));var _0x57ca=function(_0x4b931e,_0x23ea4a){_0x4b931e=_0x4b931e-0x0;var _0x4124d1=_0x7ca5[_0x4b931e];return _0x4124d1;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x57ca('0x0'));var ami=require(_0x57ca('0x1'));var logger=require(_0x57ca('0x2'))('acw');var RpcUser=require(_0x57ca('0x3'));var RpcVoiceAgentReport=require(_0x57ca('0x4'));function Acw(_0x4800bf){this[_0x57ca('0x5')]=_0x4800bf[_0x57ca('0x5')];this[_0x57ca('0x6')]=_0x4800bf['agents'];this[_0x57ca('0x7')]=_0x4800bf['timers'];this[_0x57ca('0x8')]={};ami['on'](_0x57ca('0x9'),this[_0x57ca('0xa')][_0x57ca('0xb')](this));ami['on'](_0x57ca('0xc'),this['syncHangupRequest'][_0x57ca('0xb')](this));ami['on'](_0x57ca('0xd'),this[_0x57ca('0xe')][_0x57ca('0xb')](this));ami['on'](_0x57ca('0xf'),this[_0x57ca('0x10')][_0x57ca('0xb')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x57ca('0xb')](this));ami['on'](_0x57ca('0x11'),this['syncBlindTransfer'][_0x57ca('0xb')](this));ami['on'](_0x57ca('0x12'),this[_0x57ca('0x13')]['bind'](this));}function getDiff(_0x3bd84a){var _0x29f5ea=moment()[_0x57ca('0x14')](0x0);var _0x475f0e=moment(_0x3bd84a)[_0x57ca('0x14')](0x0);return _0x29f5ea[_0x57ca('0x15')](_0x475f0e,_0x57ca('0x16'));}Acw[_0x57ca('0x17')][_0x57ca('0x18')]=function(_0x21ffdc){try{var _0xf2345=this;var _0x190a51=this['channels'][_0x21ffdc][_0x57ca('0x19')];var _0x1e3448=this[_0x57ca('0x8')][_0x21ffdc][_0x57ca('0x1a')];var _0x5d790e=this[_0x57ca('0x5')][_0x1e3448];var _0x53cac3=![];var _0x47f8b8=_0x57ca('0x1b');if(_0x5d790e[_0x57ca('0x1c')]){if(_0x5d790e[_0x57ca('0x1d')][_0x57ca('0x1e')]){_0x53cac3=!![];_0x47f8b8=_0x5d790e['mandatoryDispositionPause'][_0x57ca('0x1e')];}}ami[_0x57ca('0x1f')]({'action':_0x57ca('0x20'),'interface':_0x190a51,'paused':!![],'reason':_0x47f8b8})['then'](function(_0x1d4915){if(_0xf2345['agents'][_0x190a51]){return RpcUser[_0x57ca('0x21')](_0xf2345[_0x57ca('0x6')][_0x190a51]['id'])[_0x57ca('0x22')](function(_0x2b3ff8){if(_0x2b3ff8&&!_0x2b3ff8[_0x57ca('0x23')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x21ffdc,_0x190a51,_0x1e3448);var _0x530aa3=_0xf2345[_0x57ca('0x8')][_0x21ffdc][_0x57ca('0x24')]&&_0xf2345[_0x57ca('0x8')][_0x21ffdc][_0x57ca('0x25')]?_0xf2345[_0x57ca('0x8')][_0x21ffdc][_0x57ca('0x25')]:_0x21ffdc;return RpcUser[_0x57ca('0x26')](_0xf2345[_0x57ca('0x6')][_0x190a51],_0x47f8b8,_0x530aa3)[_0x57ca('0x22')](function(_0x4af3c1){if(!_0x53cac3){_0xf2345[_0x57ca('0x7')][_0x190a51]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x21ffdc,_0xf2345[_0x57ca('0x5')][_0x1e3448][_0x57ca('0x27')],_0x190a51,_0x1e3448);_0xf2345[_0x57ca('0x7')][_0x190a51]['timer']=setTimeout(_0xf2345['stopAcw'][_0x57ca('0xb')](_0xf2345,_0x190a51),_0xf2345[_0x57ca('0x5')][_0x1e3448][_0x57ca('0x27')]*0x3e8);_0xf2345['timers'][_0x190a51][_0x57ca('0x28')]=moment()[_0x57ca('0x29')](_0x57ca('0x2a'));_0xf2345['timers'][_0x190a51][_0x57ca('0x2b')]=_0x21ffdc;_0xf2345[_0x57ca('0x7')][_0x190a51][_0x57ca('0x1a')]=_0x1e3448;_0xf2345[_0x57ca('0x7')][_0x190a51][_0x57ca('0x2c')]=function(){var _0x2fa6b6=getDiff(_0xf2345[_0x57ca('0x7')][_0x190a51]['lastPauseAt']);clearTimeout(_0xf2345[_0x57ca('0x7')][_0x190a51][_0x57ca('0x2d')]);_0xf2345[_0x57ca('0x7')][_0x190a51][_0x57ca('0x2d')]=![];RpcVoiceAgentReport[_0x57ca('0x2e')]({'acwtime':_0x2fa6b6},_0xf2345['timers'][_0x190a51][_0x57ca('0x2b')],_0x190a51)['then'](function(_0x226479){logger[_0x57ca('0x2f')](_0x57ca('0x30'),_0x21ffdc,_0x2fa6b6,_0x226479);})[_0x57ca('0x31')](function(_0x31f976){logger['error'](_0x57ca('0x32'),_0x21ffdc,_0x31f976);});delete _0xf2345['timers'][_0x190a51];};}});}else{logger[_0x57ca('0x2f')](_0x57ca('0x33'),_0x21ffdc,_0x190a51,_0x1e3448);}});}})[_0x57ca('0x31')](function(_0x40ddd1){logger[_0x57ca('0x34')](_0x57ca('0x35'),_0x21ffdc,_0xf2345[_0x57ca('0x5')][_0x1e3448][_0x57ca('0x27')],_0x190a51,_0x1e3448);})[_0x57ca('0x36')](function(){delete _0xf2345[_0x57ca('0x8')][_0x21ffdc];});}catch(_0x4ec4c2){logger[_0x57ca('0x34')]('[ACW][START]\x20%s',_0x4ec4c2[_0x57ca('0x37')]);}};Acw[_0x57ca('0x17')][_0x57ca('0x38')]=function(_0x43de59){try{var _0x22dee1=this;if(_0x22dee1[_0x57ca('0x7')][_0x43de59]){_0x22dee1['timers'][_0x43de59][_0x57ca('0x2d')]=![];var _0x4ec414=_0x22dee1[_0x57ca('0x7')][_0x43de59][_0x57ca('0x2b')];var _0x5b70de=_0x22dee1['timers'][_0x43de59]['queue'];var _0x4d0a6e=_0x22dee1[_0x57ca('0x5')][_0x5b70de][_0x57ca('0x27')];logger[_0x57ca('0x2f')](_0x57ca('0x39'),_0x4ec414,_0x43de59);RpcUser[_0x57ca('0x3a')](this[_0x57ca('0x6')][_0x43de59]);RpcVoiceAgentReport[_0x57ca('0x2e')]({'acwtime':_0x4d0a6e,'agentacw':!![]},_0x4ec414,_0x43de59)[_0x57ca('0x22')](function(_0x10b953){logger[_0x57ca('0x2f')](_0x57ca('0x30'),_0x4ec414,_0x4d0a6e,_0x10b953);})[_0x57ca('0x31')](function(_0x18cfcb){logger[_0x57ca('0x34')](_0x57ca('0x32'),_0x4ec414,_0x18cfcb);});}else{logger['error'](_0x57ca('0x3b'),_0x43de59);if(_0x22dee1[_0x57ca('0x7')]){logger[_0x57ca('0x2f')](_0x57ca('0x3c'),JSON[_0x57ca('0x3d')](_0x22dee1[_0x57ca('0x7')]));}}}catch(_0xd4d43c){logger[_0x57ca('0x34')](_0x57ca('0x3e'),_0xd4d43c[_0x57ca('0x37')]);}};Acw[_0x57ca('0x17')][_0x57ca('0xa')]=function(_0x2f6ea5){try{if(this[_0x57ca('0x5')][_0x2f6ea5['queue']]&&(this['voiceQueues'][_0x2f6ea5[_0x57ca('0x1a')]]['acw']||this[_0x57ca('0x5')][_0x2f6ea5[_0x57ca('0x1a')]][_0x57ca('0x1c')])){if(this[_0x57ca('0x6')][_0x2f6ea5['interface']]){this[_0x57ca('0x8')][_0x2f6ea5[_0x57ca('0x2b')]]={'queue':_0x2f6ea5[_0x57ca('0x1a')],'interface':_0x2f6ea5[_0x57ca('0x19')],'destlinkedid':_0x2f6ea5[_0x57ca('0x25')]};}}}catch(_0x35ca15){logger[_0x57ca('0x34')]('[ACW][syncAgentConnect]\x20%s',_0x35ca15[_0x57ca('0x37')]);}};Acw[_0x57ca('0x17')]['syncAgentConnectPreview']=function(_0x3bb317){try{if(this['voiceQueues'][_0x3bb317['queue']]&&(this[_0x57ca('0x5')][_0x3bb317['queue']][_0x57ca('0x3f')]||this[_0x57ca('0x5')][_0x3bb317['queue']]['mandatoryDisposition'])){if(this[_0x57ca('0x6')][_0x3bb317[_0x57ca('0x19')]]){this[_0x57ca('0x8')][_0x3bb317[_0x57ca('0x2b')]]={'queue':_0x3bb317[_0x57ca('0x1a')],'interface':_0x3bb317['interface']};}}}catch(_0x3a1d81){logger[_0x57ca('0x34')](_0x57ca('0x40'),_0x3a1d81[_0x57ca('0x37')]);}};Acw[_0x57ca('0x17')][_0x57ca('0x41')]=function(_0x28a358){try{if(this[_0x57ca('0x8')][_0x28a358[_0x57ca('0x2b')]]&&_[_0x57ca('0x42')](this[_0x57ca('0x8')][_0x28a358[_0x57ca('0x2b')]][_0x57ca('0x24')])){logger[_0x57ca('0x2f')](_0x57ca('0x43'),_0x28a358['uniqueid']);this[_0x57ca('0x18')](_0x28a358[_0x57ca('0x2b')]);}else if(this[_0x57ca('0x8')][_0x28a358['linkedid']]&&_[_0x57ca('0x42')](this[_0x57ca('0x8')][_0x28a358[_0x57ca('0x44')]]['attended'])){logger[_0x57ca('0x2f')]('[%s][HANGUP:LINKEDID]',_0x28a358['linkedid']);this[_0x57ca('0x18')](_0x28a358[_0x57ca('0x44')]);}}catch(_0x1da139){logger[_0x57ca('0x34')](_0x57ca('0x45'),_0x1da139[_0x57ca('0x37')]);}};Acw[_0x57ca('0x17')][_0x57ca('0xe')]=function(_0x127d31){try{if(this['channels'][_0x127d31[_0x57ca('0x2b')]]&&this['channels'][_0x127d31['uniqueid']]['attended']){logger['info'](_0x57ca('0x46'),_0x127d31[_0x57ca('0x2b')]);this[_0x57ca('0x18')](_0x127d31[_0x57ca('0x2b')]);}else if(this[_0x57ca('0x8')][_0x127d31[_0x57ca('0x44')]]&&this[_0x57ca('0x8')][_0x127d31[_0x57ca('0x44')]][_0x57ca('0x24')]){logger[_0x57ca('0x2f')](_0x57ca('0x47'),_0x127d31['linkedid']);this[_0x57ca('0x18')](_0x127d31[_0x57ca('0x44')]);}}catch(_0x9404e4){logger[_0x57ca('0x34')]('[ACW][syncHangup]\x20%s',_0x9404e4['message']);}};Acw[_0x57ca('0x17')]['syncAttendedTransfer']=function(_0x3ec133){try{if(!_[_0x57ca('0x48')](this['channels'][_0x3ec133[_0x57ca('0x49')]])){this[_0x57ca('0x18')](_0x3ec133[_0x57ca('0x49')]);if(this[_0x57ca('0x8')][_0x3ec133[_0x57ca('0x4a')]]){this[_0x57ca('0x8')][_0x3ec133[_0x57ca('0x4a')]]['attended']=!![];this['channels'][_0x3ec133[_0x57ca('0x4b')]]=this[_0x57ca('0x8')][_0x3ec133[_0x57ca('0x4a')]];delete this[_0x57ca('0x8')][_0x3ec133[_0x57ca('0x4a')]];}}else if(!_[_0x57ca('0x48')](this[_0x57ca('0x8')][_0x3ec133[_0x57ca('0x4b')]])){this[_0x57ca('0x18')](_0x3ec133[_0x57ca('0x4b')]);if(this[_0x57ca('0x8')][_0x3ec133[_0x57ca('0x4c')]]){this[_0x57ca('0x8')][_0x3ec133['origtransfereruniqueid']][_0x57ca('0x24')]=!![];this[_0x57ca('0x8')][_0x3ec133[_0x57ca('0x49')]]=this[_0x57ca('0x8')][_0x3ec133[_0x57ca('0x4c')]];delete this['channels'][_0x3ec133[_0x57ca('0x4c')]];}}}catch(_0x325781){logger['error'](_0x57ca('0x4d'),_0x325781['message']);}};Acw[_0x57ca('0x17')]['syncBlindTransfer']=function(_0x4fc5fe){try{if(this['channels'][_0x4fc5fe['transfereruniqueid']]){logger[_0x57ca('0x2f')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x57ca('0x3d')](_0x4fc5fe[_0x57ca('0x4e')]));this[_0x57ca('0x18')](_0x4fc5fe['transfereruniqueid']);}else if(this['channels'][_0x4fc5fe[_0x57ca('0x4f')]]){logger[_0x57ca('0x2f')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x57ca('0x3d')](_0x4fc5fe[_0x57ca('0x4f')]));this[_0x57ca('0x18')](_0x4fc5fe['transfererlinkedid']);}}catch(_0x30bb7e){logger['error'](_0x57ca('0x50'),_0x30bb7e[_0x57ca('0x37')]);}};Acw[_0x57ca('0x17')][_0x57ca('0x10')]=function(_0x242a6c){try{if(this['voiceQueues'][_0x242a6c[_0x57ca('0x1a')]]&&this[_0x57ca('0x5')][_0x242a6c[_0x57ca('0x1a')]][_0x57ca('0x51')]===_0x57ca('0x52')){if(this['agents'][_0x242a6c[_0x57ca('0x19')]]){logger[_0x57ca('0x2f')](_0x57ca('0x53'),_0x242a6c[_0x57ca('0x2b')],_0x242a6c[_0x57ca('0x19')],_0x242a6c[_0x57ca('0x1a')]);return RpcUser[_0x57ca('0x26')](this['agents'][_0x242a6c['interface']],'Auto-Pause',_0x242a6c[_0x57ca('0x2b')]);}}}catch(_0x5f228e){logger[_0x57ca('0x34')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x5f228e['message']);}};module[_0x57ca('0x54')]=Acw; \ No newline at end of file +var _0x2aaa=['mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition'];(function(_0x34bc94,_0x74f0fd){var _0xee41e7=function(_0x424111){while(--_0x424111){_0x34bc94['push'](_0x34bc94['shift']());}};_0xee41e7(++_0x74f0fd);}(_0x2aaa,0x19d));var _0xa2aa=function(_0x5a4937,_0x559869){_0x5a4937=_0x5a4937-0x0;var _0x33c997=_0x2aaa[_0x5a4937];return _0x33c997;};'use strict';var util=require(_0xa2aa('0x0'));var _=require(_0xa2aa('0x1'));var moment=require(_0xa2aa('0x2'));var ami=require(_0xa2aa('0x3'));var logger=require(_0xa2aa('0x4'))(_0xa2aa('0x5'));var RpcUser=require(_0xa2aa('0x6'));var RpcVoiceAgentReport=require(_0xa2aa('0x7'));function Acw(_0x180997){this[_0xa2aa('0x8')]=_0x180997[_0xa2aa('0x8')];this['agents']=_0x180997[_0xa2aa('0x9')];this[_0xa2aa('0xa')]=_0x180997[_0xa2aa('0xa')];this[_0xa2aa('0xb')]={};ami['on'](_0xa2aa('0xc'),this['syncAgentConnect'][_0xa2aa('0xd')](this));ami['on'](_0xa2aa('0xe'),this[_0xa2aa('0xf')]['bind'](this));ami['on'](_0xa2aa('0x10'),this['syncHangup'][_0xa2aa('0xd')](this));ami['on']('agentringnoanswer',this[_0xa2aa('0x11')]['bind'](this));ami['on'](_0xa2aa('0x12'),this[_0xa2aa('0x13')]['bind'](this));ami['on']('blindtransfer',this[_0xa2aa('0x14')][_0xa2aa('0xd')](this));ami['on'](_0xa2aa('0x15'),this[_0xa2aa('0x16')]['bind'](this));}function getDiff(_0x24464c){var _0x28437b=moment()[_0xa2aa('0x17')](0x0);var _0x4c1eed=moment(_0x24464c)[_0xa2aa('0x17')](0x0);return _0x28437b[_0xa2aa('0x18')](_0x4c1eed,_0xa2aa('0x19'));}Acw[_0xa2aa('0x1a')][_0xa2aa('0x1b')]=function(_0x47b427){try{var _0x3a0e3a=this;var _0x3fce1a=this[_0xa2aa('0xb')][_0x47b427][_0xa2aa('0x1c')];var _0xa7e84c=this[_0xa2aa('0xb')][_0x47b427][_0xa2aa('0x1d')];var _0x361778=this[_0xa2aa('0x8')][_0xa7e84c];var _0x2dc566=![];var _0x31c4b8=_0xa2aa('0x1e');if(_0x361778[_0xa2aa('0x1f')]){if(_0x361778[_0xa2aa('0x20')]['name']){_0x2dc566=!![];_0x31c4b8=_0x361778[_0xa2aa('0x20')][_0xa2aa('0x21')];}}ami[_0xa2aa('0x22')]({'action':_0xa2aa('0x23'),'interface':_0x3fce1a,'paused':!![],'reason':_0x31c4b8})[_0xa2aa('0x24')](function(_0x4691c8){if(_0x3a0e3a['agents'][_0x3fce1a]){return RpcUser[_0xa2aa('0x25')](_0x3a0e3a['agents'][_0x3fce1a]['id'])['then'](function(_0x5d1fe5){if(_0x5d1fe5&&!_0x5d1fe5[_0xa2aa('0x26')]){logger[_0xa2aa('0x27')](_0xa2aa('0x28'),_0x47b427,_0x3fce1a,_0xa7e84c);var _0xc9ea54=_0x3a0e3a[_0xa2aa('0xb')][_0x47b427][_0xa2aa('0x29')]&&_0x3a0e3a[_0xa2aa('0xb')][_0x47b427][_0xa2aa('0x2a')]?_0x3a0e3a[_0xa2aa('0xb')][_0x47b427][_0xa2aa('0x2a')]:_0x47b427;return RpcUser[_0xa2aa('0x2b')](_0x3a0e3a['agents'][_0x3fce1a],_0x31c4b8,_0xc9ea54)[_0xa2aa('0x24')](function(_0x7a287b){if(!_0x2dc566){_0x3a0e3a[_0xa2aa('0xa')][_0x3fce1a]={};logger[_0xa2aa('0x27')](_0xa2aa('0x2c'),_0x47b427,_0x3a0e3a[_0xa2aa('0x8')][_0xa7e84c]['acwTimeout'],_0x3fce1a,_0xa7e84c);_0x3a0e3a[_0xa2aa('0xa')][_0x3fce1a]['timer']=setTimeout(_0x3a0e3a[_0xa2aa('0x2d')][_0xa2aa('0xd')](_0x3a0e3a,_0x3fce1a),_0x3a0e3a[_0xa2aa('0x8')][_0xa7e84c][_0xa2aa('0x2e')]*0x3e8);_0x3a0e3a[_0xa2aa('0xa')][_0x3fce1a][_0xa2aa('0x2f')]=moment()['format'](_0xa2aa('0x30'));_0x3a0e3a['timers'][_0x3fce1a][_0xa2aa('0x31')]=_0x47b427;_0x3a0e3a['timers'][_0x3fce1a][_0xa2aa('0x1d')]=_0xa7e84c;_0x3a0e3a[_0xa2aa('0xa')][_0x3fce1a][_0xa2aa('0x32')]=function(){var _0xc4396d=getDiff(_0x3a0e3a['timers'][_0x3fce1a][_0xa2aa('0x2f')]);clearTimeout(_0x3a0e3a[_0xa2aa('0xa')][_0x3fce1a][_0xa2aa('0x33')]);_0x3a0e3a['timers'][_0x3fce1a][_0xa2aa('0x33')]=![];RpcVoiceAgentReport[_0xa2aa('0x34')]({'acwtime':_0xc4396d},_0x3a0e3a[_0xa2aa('0xa')][_0x3fce1a][_0xa2aa('0x31')],_0x3fce1a)[_0xa2aa('0x24')](function(_0x21e895){logger[_0xa2aa('0x27')](_0xa2aa('0x35'),_0x47b427,_0xc4396d,_0x21e895);})[_0xa2aa('0x36')](function(_0x29a2e7){logger['error'](_0xa2aa('0x37'),_0x47b427,_0x29a2e7);});delete _0x3a0e3a[_0xa2aa('0xa')][_0x3fce1a];};}});}else{logger[_0xa2aa('0x27')](_0xa2aa('0x38'),_0x47b427,_0x3fce1a,_0xa7e84c);}});}})[_0xa2aa('0x36')](function(_0x16ba94){logger[_0xa2aa('0x39')](_0xa2aa('0x2c'),_0x47b427,_0x3a0e3a[_0xa2aa('0x8')][_0xa7e84c]['acwTimeout'],_0x3fce1a,_0xa7e84c);})['finally'](function(){delete _0x3a0e3a[_0xa2aa('0xb')][_0x47b427];});}catch(_0x16f39f){logger['error'](_0xa2aa('0x3a'),_0x16f39f[_0xa2aa('0x3b')]);}};Acw['prototype']['stopAcw']=function(_0xfe6b65){try{var _0x1b2eb1=this;if(_0x1b2eb1[_0xa2aa('0xa')][_0xfe6b65]){_0x1b2eb1['timers'][_0xfe6b65][_0xa2aa('0x33')]=![];var _0xfe5de2=_0x1b2eb1[_0xa2aa('0xa')][_0xfe6b65]['uniqueid'];var _0x6d1f11=_0x1b2eb1[_0xa2aa('0xa')][_0xfe6b65][_0xa2aa('0x1d')];var _0x3504a0=_0x1b2eb1[_0xa2aa('0x8')][_0x6d1f11][_0xa2aa('0x2e')];logger[_0xa2aa('0x27')](_0xa2aa('0x3c'),_0xfe5de2,_0xfe6b65);RpcUser['saveUnpause'](this['agents'][_0xfe6b65]);RpcVoiceAgentReport[_0xa2aa('0x34')]({'acwtime':_0x3504a0,'agentacw':!![]},_0xfe5de2,_0xfe6b65)[_0xa2aa('0x24')](function(_0x46cfb2){logger['info'](_0xa2aa('0x35'),_0xfe5de2,_0x3504a0,_0x46cfb2);})[_0xa2aa('0x36')](function(_0x5764e7){logger['error'](_0xa2aa('0x37'),_0xfe5de2,_0x5764e7);});}else{logger[_0xa2aa('0x39')](_0xa2aa('0x3d'),_0xfe6b65);if(_0x1b2eb1[_0xa2aa('0xa')]){logger[_0xa2aa('0x27')](_0xa2aa('0x3e'),JSON[_0xa2aa('0x3f')](_0x1b2eb1[_0xa2aa('0xa')]));}}}catch(_0x132b93){logger[_0xa2aa('0x39')]('[ACW][STOP]\x20%s',_0x132b93[_0xa2aa('0x3b')]);}};Acw[_0xa2aa('0x1a')][_0xa2aa('0x40')]=function(_0x4ff70e){try{if(this['voiceQueues'][_0x4ff70e[_0xa2aa('0x1d')]]&&(this[_0xa2aa('0x8')][_0x4ff70e['queue']][_0xa2aa('0x5')]||this[_0xa2aa('0x8')][_0x4ff70e[_0xa2aa('0x1d')]][_0xa2aa('0x1f')])){if(this[_0xa2aa('0x9')][_0x4ff70e[_0xa2aa('0x1c')]]){this[_0xa2aa('0xb')][_0x4ff70e['uniqueid']]={'queue':_0x4ff70e[_0xa2aa('0x1d')],'interface':_0x4ff70e['interface'],'destlinkedid':_0x4ff70e['destlinkedid']};}}}catch(_0x454a95){logger[_0xa2aa('0x39')](_0xa2aa('0x41'),_0x454a95['message']);}};Acw[_0xa2aa('0x1a')]['syncAgentConnectPreview']=function(_0x554816){try{if(this[_0xa2aa('0x8')][_0x554816[_0xa2aa('0x1d')]]&&(this[_0xa2aa('0x8')][_0x554816['queue']][_0xa2aa('0x5')]||this[_0xa2aa('0x8')][_0x554816[_0xa2aa('0x1d')]][_0xa2aa('0x1f')])){if(this[_0xa2aa('0x9')][_0x554816['interface']]){this[_0xa2aa('0xb')][_0x554816[_0xa2aa('0x31')]]={'queue':_0x554816[_0xa2aa('0x1d')],'interface':_0x554816[_0xa2aa('0x1c')]};}}}catch(_0x3887a5){logger[_0xa2aa('0x39')](_0xa2aa('0x42'),_0x3887a5[_0xa2aa('0x3b')]);}};Acw[_0xa2aa('0x1a')][_0xa2aa('0xf')]=function(_0x12fc66){try{if(this[_0xa2aa('0xb')][_0x12fc66[_0xa2aa('0x31')]]&&_[_0xa2aa('0x43')](this['channels'][_0x12fc66[_0xa2aa('0x31')]]['attended'])){logger[_0xa2aa('0x27')](_0xa2aa('0x44'),_0x12fc66['uniqueid']);this['startAcw'](_0x12fc66[_0xa2aa('0x31')]);}else if(this[_0xa2aa('0xb')][_0x12fc66[_0xa2aa('0x45')]]&&_['isUndefined'](this['channels'][_0x12fc66[_0xa2aa('0x45')]]['attended'])){logger[_0xa2aa('0x27')](_0xa2aa('0x46'),_0x12fc66['linkedid']);this[_0xa2aa('0x1b')](_0x12fc66[_0xa2aa('0x45')]);}}catch(_0x5f0f83){logger[_0xa2aa('0x39')]('[ACW][syncHangupRequest]\x20%s',_0x5f0f83['message']);}};Acw[_0xa2aa('0x1a')]['syncHangup']=function(_0x468c9d){try{if(this[_0xa2aa('0xb')][_0x468c9d['uniqueid']]&&this[_0xa2aa('0xb')][_0x468c9d[_0xa2aa('0x31')]][_0xa2aa('0x29')]){logger[_0xa2aa('0x27')](_0xa2aa('0x47'),_0x468c9d[_0xa2aa('0x31')]);this[_0xa2aa('0x1b')](_0x468c9d[_0xa2aa('0x31')]);}else if(this[_0xa2aa('0xb')][_0x468c9d[_0xa2aa('0x45')]]&&this[_0xa2aa('0xb')][_0x468c9d[_0xa2aa('0x45')]][_0xa2aa('0x29')]){logger[_0xa2aa('0x27')](_0xa2aa('0x48'),_0x468c9d[_0xa2aa('0x45')]);this['startAcw'](_0x468c9d[_0xa2aa('0x45')]);}}catch(_0x4b9291){logger[_0xa2aa('0x39')](_0xa2aa('0x49'),_0x4b9291[_0xa2aa('0x3b')]);}};Acw[_0xa2aa('0x1a')][_0xa2aa('0x13')]=function(_0x5b813b){try{if(!_[_0xa2aa('0x4a')](this[_0xa2aa('0xb')][_0x5b813b[_0xa2aa('0x4b')]])){this[_0xa2aa('0x1b')](_0x5b813b['transfereeuniqueid']);if(this[_0xa2aa('0xb')][_0x5b813b['secondtransfereruniqueid']]){this[_0xa2aa('0xb')][_0x5b813b['secondtransfereruniqueid']]['attended']=!![];this[_0xa2aa('0xb')][_0x5b813b['transfertargetuniqueid']]=this[_0xa2aa('0xb')][_0x5b813b[_0xa2aa('0x4c')]];delete this[_0xa2aa('0xb')][_0x5b813b[_0xa2aa('0x4c')]];}}else if(!_[_0xa2aa('0x4a')](this[_0xa2aa('0xb')][_0x5b813b[_0xa2aa('0x4d')]])){this['startAcw'](_0x5b813b[_0xa2aa('0x4d')]);if(this[_0xa2aa('0xb')][_0x5b813b[_0xa2aa('0x4e')]]){this[_0xa2aa('0xb')][_0x5b813b['origtransfereruniqueid']]['attended']=!![];this[_0xa2aa('0xb')][_0x5b813b[_0xa2aa('0x4b')]]=this[_0xa2aa('0xb')][_0x5b813b['origtransfereruniqueid']];delete this[_0xa2aa('0xb')][_0x5b813b[_0xa2aa('0x4e')]];}}}catch(_0x1952fa){logger[_0xa2aa('0x39')](_0xa2aa('0x4f'),_0x1952fa[_0xa2aa('0x3b')]);}};Acw[_0xa2aa('0x1a')][_0xa2aa('0x14')]=function(_0x53854d){try{if(this['channels'][_0x53854d['transfereruniqueid']]){logger[_0xa2aa('0x27')](_0xa2aa('0x50'),JSON['stringify'](_0x53854d['transfereruniqueid']));this[_0xa2aa('0x1b')](_0x53854d['transfereruniqueid']);}else if(this[_0xa2aa('0xb')][_0x53854d['transfererlinkedid']]){logger['info'](_0xa2aa('0x51'),JSON[_0xa2aa('0x3f')](_0x53854d[_0xa2aa('0x52')]));this[_0xa2aa('0x1b')](_0x53854d['transfererlinkedid']);}}catch(_0x3af3dc){logger[_0xa2aa('0x39')](_0xa2aa('0x53'),_0x3af3dc[_0xa2aa('0x3b')]);}};Acw[_0xa2aa('0x1a')][_0xa2aa('0x11')]=function(_0x3a690c){try{if(this[_0xa2aa('0x8')][_0x3a690c[_0xa2aa('0x1d')]]&&this[_0xa2aa('0x8')][_0x3a690c[_0xa2aa('0x1d')]][_0xa2aa('0x54')]==='all'){if(this[_0xa2aa('0x9')][_0x3a690c[_0xa2aa('0x1c')]]){logger[_0xa2aa('0x27')](_0xa2aa('0x55'),_0x3a690c[_0xa2aa('0x31')],_0x3a690c[_0xa2aa('0x1c')],_0x3a690c[_0xa2aa('0x1d')]);return RpcUser[_0xa2aa('0x2b')](this[_0xa2aa('0x9')][_0x3a690c[_0xa2aa('0x1c')]],_0xa2aa('0x56'),_0x3a690c[_0xa2aa('0x31')]);}}}catch(_0x4a5027){logger[_0xa2aa('0x39')](_0xa2aa('0x57'),_0x4a5027['message']);}};module[_0xa2aa('0x58')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 66880c9..e996f4c 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['username','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','moment','lodash','ami','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x370306,_0x775ab){var _0x1f2888=function(_0x40e87a){while(--_0x40e87a){_0x370306['push'](_0x370306['shift']());}};_0x1f2888(++_0x775ab);}(_0xb7e7,0x121));var _0x7b7e=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xb7e7[_0x122096];return _0x3d1966;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file +var _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x19c2b9,_0x24dd54){var _0x11f335=function(_0x430fcf){while(--_0x430fcf){_0x19c2b9['push'](_0x19c2b9['shift']());}};_0x11f335(++_0x24dd54);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 5808026..8a23a92 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 _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x3c5924,_0x4d295f){var _0x576958=function(_0x4a3e2d){while(--_0x4a3e2d){_0x3c5924['push'](_0x3c5924['shift']());}};_0x576958(++_0x4d295f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 +var _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0xaf2b45,_0xbf8faf){var _0x1ff901=function(_0x117cec){while(--_0x117cec){_0xaf2b45['push'](_0xaf2b45['shift']());}};_0x1ff901(++_0xbf8faf);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 36f397a..20351f5 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 _0xb406=['countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number','queue','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x4c8108,_0x210dd5){var _0x1dced0=function(_0x16674f){while(--_0x16674f){_0x4c8108['push'](_0x4c8108['shift']());}};_0x1dced0(++_0x210dd5);}(_0xb406,0x1dc));var _0x6b40=function(_0x2b41ab,_0x3d7915){_0x2b41ab=_0x2b41ab-0x0;var _0x16ec4f=_0xb406[_0x2b41ab];return _0x16ec4f;};'use strict';var util=require(_0x6b40('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x418eca,_0x469d05,_0x24041a){var _0x440c3d='';if(!_[_0x6b40('0x1')](_0x469d05)&&_0x6b40('0x2')===typeof _0x469d05){_0x440c3d+=_0x469d05;}if(!_[_0x6b40('0x1')](_0x24041a)&&_0x6b40('0x2')===typeof _0x24041a){_0x440c3d+='\x20'+_0x24041a;}if(_0x440c3d!==''){return _0x440c3d;}return _0x418eca;}function Action(_0x2e6cc9,_0x96472,_0x5ad8ad){this[_0x6b40('0x3')]=_0x2e6cc9;this[_0x6b40('0x4')]=_0x5ad8ad||undefined;this[_0x6b40('0x5')]=checkNameSurname(_0x96472[_0x6b40('0x6')][_0x6b40('0x7')],_0x96472['Contact'][_0x6b40('0x8')],_0x96472['Contact']['lastName']);this[_0x6b40('0x9')]=_0x96472['Contact'][_0x6b40('0x7')];this[_0x6b40('0xa')]=_0x2e6cc9[_0x6b40('0x5')];this['active']=_0x96472['active']||![];this[_0x6b40('0xb')]=_0x2e6cc9[_0x6b40('0xb')];this[_0x6b40('0xc')]=_0x2e6cc9['dialQueueTimeout']||0x3;this['scheduledat']=_0x96472[_0x6b40('0xd')];this[_0x6b40('0xe')]=_0x96472['countbusyretry'];this['countcongestionretry']=_0x96472[_0x6b40('0xf')];this[_0x6b40('0x10')]=_0x96472[_0x6b40('0x10')];this[_0x6b40('0x11')]=_0x96472[_0x6b40('0x11')];this[_0x6b40('0x12')]=_0x96472['countdropretry'];this[_0x6b40('0x13')]=_0x96472[_0x6b40('0x13')];this[_0x6b40('0x14')]=_0x96472[_0x6b40('0x14')];this['countagentrejectretry']=_0x96472['countagentrejectretry'];this[_0x6b40('0x15')]=_0x96472[_0x6b40('0x15')];this['ListId']=_0x96472[_0x6b40('0x16')];this[_0x6b40('0x17')]=_0x96472[_0x6b40('0x17')];this[_0x6b40('0x18')]=_0x96472['VoiceQueueId'];this['CampaignId']=_0x96472['CampaignId'];this[_0x6b40('0x19')]=_0x96472['id'];this['ContactFirstName']=_0x96472[_0x6b40('0x6')]['firstName']||'';this['starttime']=moment()['format'](_0x6b40('0x1a'));this['callback']=_0x96472['callback'];this['callbackuniqueid']=_0x96472[_0x6b40('0x1b')];this['callbackat']=_0x96472['callbackat'];this['recallme']=_0x96472[_0x6b40('0x1c')];this[_0x6b40('0x1d')]='';this[_0x6b40('0x1e')]='';}Action[_0x6b40('0x1f')][_0x6b40('0x20')]=function(){return util[_0x6b40('0x21')](_0x6b40('0x22'),this['name'],this['voiceQueue'][_0x6b40('0x23')]>0x0?this['number']['substring'](this[_0x6b40('0x3')]['dialCutDigit']):this[_0x6b40('0x9')]);};Action['prototype'][_0x6b40('0x24')]=function(){return this[_0x6b40('0xa')];};module[_0x6b40('0x25')]=Action; \ No newline at end of file +var _0xfbeb=['lastName','number','phone','queue','name','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','dialCutDigit','substring','getQueue','exports','util','isNil','string','voiceQueue','Contact','firstName'];(function(_0x8fee0f,_0x118ab0){var _0xa5e569=function(_0x3d5a70){while(--_0x3d5a70){_0x8fee0f['push'](_0x8fee0f['shift']());}};_0xa5e569(++_0x118ab0);}(_0xfbeb,0x174));var _0xbfbe=function(_0x5b4c44,_0x2e495e){_0x5b4c44=_0x5b4c44-0x0;var _0x58485a=_0xfbeb[_0x5b4c44];return _0x58485a;};'use strict';var util=require(_0xbfbe('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x2ca631,_0x15bf10,_0x3574fa){var _0x2d80c2='';if(!_[_0xbfbe('0x1')](_0x15bf10)&&_0xbfbe('0x2')===typeof _0x15bf10){_0x2d80c2+=_0x15bf10;}if(!_[_0xbfbe('0x1')](_0x3574fa)&&_0xbfbe('0x2')===typeof _0x3574fa){_0x2d80c2+='\x20'+_0x3574fa;}if(_0x2d80c2!==''){return _0x2d80c2;}return _0x2ca631;}function Action(_0xda8255,_0x5d1ce0,_0x3cb730){this[_0xbfbe('0x3')]=_0xda8255;this['uniqueid']=_0x3cb730||undefined;this['name']=checkNameSurname(_0x5d1ce0[_0xbfbe('0x4')]['phone'],_0x5d1ce0['Contact'][_0xbfbe('0x5')],_0x5d1ce0[_0xbfbe('0x4')][_0xbfbe('0x6')]);this[_0xbfbe('0x7')]=_0x5d1ce0[_0xbfbe('0x4')][_0xbfbe('0x8')];this[_0xbfbe('0x9')]=_0xda8255[_0xbfbe('0xa')];this[_0xbfbe('0xb')]=_0x5d1ce0[_0xbfbe('0xb')]||![];this['type']=_0xda8255['type'];this['dialQueueTimeout']=_0xda8255[_0xbfbe('0xc')]||0x3;this['scheduledat']=_0x5d1ce0[_0xbfbe('0xd')];this[_0xbfbe('0xe')]=_0x5d1ce0[_0xbfbe('0xe')];this['countcongestionretry']=_0x5d1ce0[_0xbfbe('0xf')];this['countnoanswerretry']=_0x5d1ce0[_0xbfbe('0x10')];this[_0xbfbe('0x11')]=_0x5d1ce0[_0xbfbe('0x11')];this[_0xbfbe('0x12')]=_0x5d1ce0[_0xbfbe('0x12')];this[_0xbfbe('0x13')]=_0x5d1ce0[_0xbfbe('0x13')];this[_0xbfbe('0x14')]=_0x5d1ce0[_0xbfbe('0x14')];this[_0xbfbe('0x15')]=_0x5d1ce0[_0xbfbe('0x15')];this[_0xbfbe('0x16')]=_0x5d1ce0[_0xbfbe('0x16')];this[_0xbfbe('0x17')]=_0x5d1ce0[_0xbfbe('0x17')];this[_0xbfbe('0x18')]=_0x5d1ce0[_0xbfbe('0x18')];this[_0xbfbe('0x19')]=_0x5d1ce0['VoiceQueueId'];this[_0xbfbe('0x1a')]=_0x5d1ce0[_0xbfbe('0x1a')];this[_0xbfbe('0x1b')]=_0x5d1ce0['id'];this[_0xbfbe('0x1c')]=_0x5d1ce0[_0xbfbe('0x4')]['firstName']||'';this[_0xbfbe('0x1d')]=moment()[_0xbfbe('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x5d1ce0['callback'];this[_0xbfbe('0x1f')]=_0x5d1ce0[_0xbfbe('0x1f')];this[_0xbfbe('0x20')]=_0x5d1ce0[_0xbfbe('0x20')];this[_0xbfbe('0x21')]=_0x5d1ce0[_0xbfbe('0x21')];this[_0xbfbe('0x22')]='';this[_0xbfbe('0x23')]='';}Action[_0xbfbe('0x24')][_0xbfbe('0x25')]=function(){return util[_0xbfbe('0x1e')]('\x22%s\x22\x20<%s>',this[_0xbfbe('0xa')],this[_0xbfbe('0x3')][_0xbfbe('0x26')]>0x0?this['number'][_0xbfbe('0x27')](this[_0xbfbe('0x3')][_0xbfbe('0x26')]):this[_0xbfbe('0x7')]);};Action[_0xbfbe('0x24')][_0xbfbe('0x28')]=function(){return this[_0xbfbe('0x9')];};module[_0xbfbe('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index b047b33..c0b9885 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 _0x653c=['moment','seconds','state','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','calleridname','name','starttime','responsetime','answertime','endtime','format','holdtime','queue','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x653c,0x199));var _0xc653=function(_0x2bea1b,_0x3960e9){_0x2bea1b=_0x2bea1b-0x0;var _0x1665b1=_0x653c[_0x2bea1b];return _0x1665b1;};'use strict';var util=require('util');var _=require(_0xc653('0x0'));var moment=require(_0xc653('0x1'));function getSeconds(_0x4e1878,_0x5d25ad){var _0x12d0fd=moment(_0x4e1878)['milliseconds'](0x0);var _0x231f4a=moment(_0x5d25ad)['milliseconds'](0x0);return _0x12d0fd['diff'](_0x231f4a,_0xc653('0x2'));}function AgentComplete(_0xa17874,_0x2ac472){this[_0xc653('0x3')]=0x4;this['statedesc']=_0xc653('0x4');this[_0xc653('0x5')]=_0xa17874['scheduledat'];this['type']=_0xa17874[_0xc653('0x6')];this[_0xc653('0x7')]=_0xa17874[_0xc653('0x6')]===_0xc653('0x8')?'queue':_0xa17874[_0xc653('0x6')];this[_0xc653('0x9')]=_0xa17874[_0xc653('0x9')];this[_0xc653('0xa')]=_0xa17874['countcongestionretry'];this['countnoanswerretry']=_0xa17874['countnoanswerretry'];this[_0xc653('0xb')]=_0xa17874[_0xc653('0x9')]+_0xa17874['countcongestionretry']+_0xa17874[_0xc653('0xc')]+_0xa17874['countnosuchnumberretry']+_0xa17874['countdropretry']+_0xa17874[_0xc653('0xd')]+_0xa17874[_0xc653('0xe')]+_0xa17874[_0xc653('0xf')];this[_0xc653('0x10')]=_0xa17874[_0xc653('0x10')];this['countdropretry']=_0xa17874[_0xc653('0x11')];this[_0xc653('0xd')]=_0xa17874['countabandonedretry'];this[_0xc653('0xe')]=_0xa17874[_0xc653('0xe')];this['countagentrejectretry']=_0xa17874[_0xc653('0xf')];this[_0xc653('0x12')]=_0x2ac472['uniqueid'];this[_0xc653('0x13')]=_0xa17874[_0xc653('0x14')];this['calleridnum']=_0xa17874['number'];this[_0xc653('0x15')]=_0xa17874['starttime'];this[_0xc653('0x16')]=_0xa17874[_0xc653('0x16')];this[_0xc653('0x17')]=_0xa17874[_0xc653('0x17')];this[_0xc653('0x18')]=moment()[_0xc653('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0xa17874[_0xc653('0x16')],_0xa17874[_0xc653('0x15')]);this[_0xc653('0x1a')]=getSeconds(_0xa17874[_0xc653('0x17')],_0xa17874[_0xc653('0x16')]);this['talktime']=getSeconds(this['endtime'],_0xa17874[_0xc653('0x17')]);this[_0xc653('0x1b')]=_0x2ac472[_0xc653('0x1b')];this[_0xc653('0x1c')]=_0x2ac472[_0xc653('0x1c')];this[_0xc653('0x1d')]=_0x2ac472[_0xc653('0x1d')];this[_0xc653('0x1e')]=_0xa17874[_0xc653('0x1e')];this[_0xc653('0x1f')]=_0xa17874[_0xc653('0x1f')];this['callbackat']=_0xa17874['callbackat'];this['recallme']=_0xa17874[_0xc653('0x20')];this[_0xc653('0x21')]=_0xa17874[_0xc653('0x21')];this[_0xc653('0x22')]=_0xa17874[_0xc653('0x22')];this[_0xc653('0x23')]=_0xa17874[_0xc653('0x23')];this['VoiceQueueId']=_0xa17874[_0xc653('0x24')];this[_0xc653('0x25')]=_0xa17874[_0xc653('0x25')];this[_0xc653('0x26')]=_0xa17874[_0xc653('0x26')]||'';this[_0xc653('0x27')]=_0xa17874['originatecalleridname']||'';}module[_0xc653('0x28')]=AgentComplete; \ No newline at end of file +var _0x21a6=['statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds'];(function(_0x77fa8d,_0xb40367){var _0x4ad362=function(_0x90273e){while(--_0x90273e){_0x77fa8d['push'](_0x77fa8d['shift']());}};_0x4ad362(++_0xb40367);}(_0x21a6,0x114));var _0x621a=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x21a6[_0x28d18d];return _0x470640;};'use strict';var util=require(_0x621a('0x0'));var _=require(_0x621a('0x1'));var moment=require(_0x621a('0x2'));function getSeconds(_0x59f907,_0x35dc40){var _0x1ca8e2=moment(_0x59f907)[_0x621a('0x3')](0x0);var _0x25d6ff=moment(_0x35dc40)[_0x621a('0x3')](0x0);return _0x1ca8e2[_0x621a('0x4')](_0x25d6ff,_0x621a('0x5'));}function AgentComplete(_0x68eb72,_0x20a08b){this['state']=0x4;this[_0x621a('0x6')]=_0x621a('0x7');this[_0x621a('0x8')]=_0x68eb72['scheduledat'];this[_0x621a('0x9')]=_0x68eb72['type'];this['campaigntype']=_0x68eb72[_0x621a('0x9')]===_0x621a('0xa')?_0x621a('0xb'):_0x68eb72[_0x621a('0x9')];this['countbusyretry']=_0x68eb72[_0x621a('0xc')];this['countcongestionretry']=_0x68eb72[_0x621a('0xd')];this[_0x621a('0xe')]=_0x68eb72['countnoanswerretry'];this[_0x621a('0xf')]=_0x68eb72['countbusyretry']+_0x68eb72[_0x621a('0xd')]+_0x68eb72[_0x621a('0xe')]+_0x68eb72['countnosuchnumberretry']+_0x68eb72[_0x621a('0x10')]+_0x68eb72[_0x621a('0x11')]+_0x68eb72[_0x621a('0x12')]+_0x68eb72['countagentrejectretry'];this[_0x621a('0x13')]=_0x68eb72[_0x621a('0x13')];this[_0x621a('0x10')]=_0x68eb72[_0x621a('0x10')];this['countabandonedretry']=_0x68eb72[_0x621a('0x11')];this[_0x621a('0x12')]=_0x68eb72['countmachineretry'];this[_0x621a('0x14')]=_0x68eb72[_0x621a('0x14')];this[_0x621a('0x15')]=_0x20a08b[_0x621a('0x15')];this[_0x621a('0x16')]=_0x68eb72[_0x621a('0x17')];this['calleridnum']=_0x68eb72[_0x621a('0x18')];this[_0x621a('0x19')]=_0x68eb72[_0x621a('0x19')];this[_0x621a('0x1a')]=_0x68eb72['responsetime'];this['answertime']=_0x68eb72[_0x621a('0x1b')];this[_0x621a('0x1c')]=moment()[_0x621a('0x1d')](_0x621a('0x1e'));this['ringtime']=getSeconds(_0x68eb72[_0x621a('0x1a')],_0x68eb72['starttime']);this[_0x621a('0x1f')]=getSeconds(_0x68eb72[_0x621a('0x1b')],_0x68eb72[_0x621a('0x1a')]);this[_0x621a('0x20')]=getSeconds(this[_0x621a('0x1c')],_0x68eb72[_0x621a('0x1b')]);this[_0x621a('0xb')]=_0x20a08b['queue'];this[_0x621a('0x21')]=_0x20a08b[_0x621a('0x21')];this['reason']=_0x20a08b[_0x621a('0x22')];this[_0x621a('0x23')]=_0x68eb72['callback'];this[_0x621a('0x24')]=_0x68eb72[_0x621a('0x24')];this[_0x621a('0x25')]=_0x68eb72['callbackat'];this[_0x621a('0x26')]=_0x68eb72['recallme'];this[_0x621a('0x27')]=_0x68eb72[_0x621a('0x27')];this[_0x621a('0x28')]=_0x68eb72['ListId'];this[_0x621a('0x29')]=_0x68eb72[_0x621a('0x29')];this[_0x621a('0x2a')]=_0x68eb72['VoiceQueueId'];this[_0x621a('0x2b')]=_0x68eb72[_0x621a('0x2b')];this[_0x621a('0x2c')]=_0x68eb72[_0x621a('0x2c')]||'';this[_0x621a('0x2d')]=_0x68eb72['originatecalleridname']||'';}module[_0x621a('0x2e')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 12d6f03..a63a33d 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 _0x9b67=['countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x57b443,_0x5145b4){var _0x1a763d=function(_0x513b90){while(--_0x513b90){_0x57b443['push'](_0x57b443['shift']());}};_0x1a763d(++_0x5145b4);}(_0x9b67,0xf6));var _0x79b6=function(_0x2c3e1a,_0x327d57){_0x2c3e1a=_0x2c3e1a-0x0;var _0x191573=_0x9b67[_0x2c3e1a];return _0x191573;};'use strict';var util=require(_0x79b6('0x0'));var _=require(_0x79b6('0x1'));var moment=require(_0x79b6('0x2'));function getSeconds(_0x1f4b0b,_0x29728d){var _0x5523a1=moment(_0x1f4b0b)[_0x79b6('0x3')](0x0);var _0x1aeb24=moment(_0x29728d)['milliseconds'](0x0);return _0x5523a1['diff'](_0x1aeb24,_0x79b6('0x4'));}function Final(_0x174768){this[_0x79b6('0x5')]=_0x174768[_0x79b6('0x5')];this[_0x79b6('0x6')]=_0x174768[_0x79b6('0x6')];this[_0x79b6('0x7')]=_0x174768['type'];this[_0x79b6('0x8')]=_0x174768[_0x79b6('0x7')]===_0x79b6('0x9')?_0x79b6('0xa'):_0x174768[_0x79b6('0x7')];this['countbusyretry']=_0x174768[_0x79b6('0xb')];this[_0x79b6('0xc')]=_0x174768[_0x79b6('0xc')];this[_0x79b6('0xd')]=_0x174768['countnoanswerretry'];this['countglobal']=_0x174768[_0x79b6('0xb')]+_0x174768[_0x79b6('0xc')]+_0x174768[_0x79b6('0xd')]+_0x174768['countnosuchnumberretry']+_0x174768[_0x79b6('0xe')]+_0x174768[_0x79b6('0xf')]+_0x174768[_0x79b6('0x10')]+_0x174768[_0x79b6('0x11')];this[_0x79b6('0x12')]=_0x174768[_0x79b6('0x12')];this[_0x79b6('0xe')]=_0x174768[_0x79b6('0xe')];this[_0x79b6('0xf')]=_0x174768[_0x79b6('0xf')];this[_0x79b6('0x10')]=_0x174768[_0x79b6('0x10')];this[_0x79b6('0x11')]=_0x174768['countagentrejectretry'];this[_0x79b6('0xa')]=_0x174768[_0x79b6('0xa')];this[_0x79b6('0x13')]=_0x174768[_0x79b6('0x13')];this[_0x79b6('0x14')]=_0x174768[_0x79b6('0x14')];this[_0x79b6('0x15')]=_0x174768[_0x79b6('0x15')];this[_0x79b6('0x16')]=_0x174768[_0x79b6('0x16')];this[_0x79b6('0x17')]=_0x174768[_0x79b6('0x16')];this[_0x79b6('0x18')]=_0x174768['ringtime']||0x0;this[_0x79b6('0x19')]=_0x174768['holdtime']||0x0;this[_0x79b6('0x1a')]=_0x174768['talktime']||0x0;this[_0x79b6('0x1b')]=_0x174768[_0x79b6('0x1b')];this[_0x79b6('0x1c')]=_0x174768['callbackuniqueid'];this[_0x79b6('0x1d')]=_0x174768[_0x79b6('0x1d')];this['recallme']=_0x174768['recallme'];this[_0x79b6('0x1e')]=_0x174768[_0x79b6('0x1e')];this[_0x79b6('0x1f')]=_0x174768[_0x79b6('0x1f')];this[_0x79b6('0x20')]=_0x174768['UserId'];this[_0x79b6('0x21')]=_0x174768[_0x79b6('0x21')];this[_0x79b6('0x22')]=_0x174768[_0x79b6('0x22')];this['originatecalleridnum']=_0x174768['originatecalleridnum']||'';this[_0x79b6('0x23')]=_0x174768[_0x79b6('0x23')]||'';}module[_0x79b6('0x24')]=Final; \ No newline at end of file +var _0xe5d5=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x4055a0,_0x15c564){var _0x4d83ca=function(_0x526888){while(--_0x526888){_0x4055a0['push'](_0x4055a0['shift']());}};_0x4d83ca(++_0x15c564);}(_0xe5d5,0x156));var _0x5e5d=function(_0x1546a7,_0x3706d9){_0x1546a7=_0x1546a7-0x0;var _0x2ada0e=_0xe5d5[_0x1546a7];return _0x2ada0e;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x5e5d('0x0'));function getSeconds(_0x4f6845,_0x9f47d6){var _0x4b8ae9=moment(_0x4f6845)[_0x5e5d('0x1')](0x0);var _0x5127ee=moment(_0x9f47d6)[_0x5e5d('0x1')](0x0);return _0x4b8ae9[_0x5e5d('0x2')](_0x5127ee,_0x5e5d('0x3'));}function Final(_0x3d014f){this[_0x5e5d('0x4')]=_0x3d014f[_0x5e5d('0x4')];this[_0x5e5d('0x5')]=_0x3d014f[_0x5e5d('0x5')];this[_0x5e5d('0x6')]=_0x3d014f[_0x5e5d('0x6')];this[_0x5e5d('0x7')]=_0x3d014f[_0x5e5d('0x6')]===_0x5e5d('0x8')?_0x5e5d('0x9'):_0x3d014f['type'];this[_0x5e5d('0xa')]=_0x3d014f['countbusyretry'];this[_0x5e5d('0xb')]=_0x3d014f[_0x5e5d('0xb')];this['countnoanswerretry']=_0x3d014f[_0x5e5d('0xc')];this[_0x5e5d('0xd')]=_0x3d014f[_0x5e5d('0xa')]+_0x3d014f[_0x5e5d('0xb')]+_0x3d014f['countnoanswerretry']+_0x3d014f['countnosuchnumberretry']+_0x3d014f[_0x5e5d('0xe')]+_0x3d014f[_0x5e5d('0xf')]+_0x3d014f['countmachineretry']+_0x3d014f[_0x5e5d('0x10')];this[_0x5e5d('0x11')]=_0x3d014f['countnosuchnumberretry'];this[_0x5e5d('0xe')]=_0x3d014f[_0x5e5d('0xe')];this['countabandonedretry']=_0x3d014f['countabandonedretry'];this['countmachineretry']=_0x3d014f[_0x5e5d('0x12')];this[_0x5e5d('0x10')]=_0x3d014f[_0x5e5d('0x10')];this[_0x5e5d('0x9')]=_0x3d014f['queue'];this[_0x5e5d('0x13')]=_0x3d014f[_0x5e5d('0x13')];this[_0x5e5d('0x14')]=_0x3d014f[_0x5e5d('0x14')];this[_0x5e5d('0x15')]=_0x3d014f[_0x5e5d('0x15')];this[_0x5e5d('0x16')]=_0x3d014f[_0x5e5d('0x16')];this['endtime']=_0x3d014f[_0x5e5d('0x16')];this[_0x5e5d('0x17')]=_0x3d014f[_0x5e5d('0x17')]||0x0;this[_0x5e5d('0x18')]=_0x3d014f[_0x5e5d('0x18')]||0x0;this[_0x5e5d('0x19')]=_0x3d014f['talktime']||0x0;this[_0x5e5d('0x1a')]=_0x3d014f['callback'];this[_0x5e5d('0x1b')]=_0x3d014f[_0x5e5d('0x1b')];this[_0x5e5d('0x1c')]=_0x3d014f['callbackat'];this[_0x5e5d('0x1d')]=_0x3d014f['recallme'];this[_0x5e5d('0x1e')]=_0x3d014f[_0x5e5d('0x1e')];this[_0x5e5d('0x1f')]=_0x3d014f['ListId'];this['UserId']=_0x3d014f[_0x5e5d('0x20')];this[_0x5e5d('0x21')]=_0x3d014f['VoiceQueueId'];this['CampaignId']=_0x3d014f[_0x5e5d('0x22')];this[_0x5e5d('0x23')]=_0x3d014f[_0x5e5d('0x23')]||'';this['originatecalleridname']=_0x3d014f[_0x5e5d('0x24')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 87bc0c0..7aaac08 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 _0x684c=['seconds','state','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','milliseconds','diff'];(function(_0x256198,_0x1d03e6){var _0x285a83=function(_0x264167){while(--_0x264167){_0x256198['push'](_0x256198['shift']());}};_0x285a83(++_0x1d03e6);}(_0x684c,0x14c));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xc684('0x0'));var _=require(_0xc684('0x1'));var moment=require('moment');function getSeconds(_0x4f57d7,_0x1dd192){var _0x1984a6=moment(_0x4f57d7)['milliseconds'](0x0);var _0x15ebfe=moment(_0x1dd192)[_0xc684('0x2')](0x0);return _0x1984a6[_0xc684('0x3')](_0x15ebfe,_0xc684('0x4'));}function Hangup(_0x7e03c0,_0x2b8d37){this[_0xc684('0x5')]=0x4;this['statedesc']=_0xc684('0x6');this[_0xc684('0x7')]=_0x7e03c0[_0xc684('0x7')];this[_0xc684('0x8')]=_0x7e03c0[_0xc684('0x8')];this['campaigntype']=_0x7e03c0[_0xc684('0x8')]===_0xc684('0x9')?_0xc684('0xa'):_0x7e03c0[_0xc684('0x8')];this[_0xc684('0xb')]=_0x7e03c0[_0xc684('0xb')];this[_0xc684('0xc')]=_0x7e03c0[_0xc684('0xc')];this[_0xc684('0xd')]=_0x7e03c0[_0xc684('0xd')];this[_0xc684('0xe')]=_0x7e03c0[_0xc684('0xb')]+_0x7e03c0[_0xc684('0xc')]+_0x7e03c0['countnoanswerretry']+_0x7e03c0[_0xc684('0xf')]+_0x7e03c0[_0xc684('0x10')]+_0x7e03c0[_0xc684('0x11')]+_0x7e03c0[_0xc684('0x12')]+_0x7e03c0['countagentrejectretry'];this[_0xc684('0xf')]=_0x7e03c0[_0xc684('0xf')];this[_0xc684('0x10')]=_0x7e03c0[_0xc684('0x10')];this['countabandonedretry']=_0x7e03c0[_0xc684('0x11')];this[_0xc684('0x12')]=_0x7e03c0['countmachineretry'];this[_0xc684('0x13')]=_0x7e03c0[_0xc684('0x13')];this[_0xc684('0x14')]=_0x2b8d37['uniqueid'];this['calleridname']=_0x7e03c0[_0xc684('0x15')];this[_0xc684('0x16')]=_0x7e03c0[_0xc684('0x17')];this[_0xc684('0x18')]=_0x7e03c0['starttime'];this[_0xc684('0x19')]=_0x7e03c0[_0xc684('0x19')];this[_0xc684('0x1a')]=moment()[_0xc684('0x1b')](_0xc684('0x1c'));this[_0xc684('0x1d')]=getSeconds(_0x7e03c0[_0xc684('0x19')],_0x7e03c0[_0xc684('0x18')]);this[_0xc684('0x1e')]=0x0;this['talktime']=getSeconds(this[_0xc684('0x1a')],_0x7e03c0['responsetime']);this[_0xc684('0xa')]=_0x7e03c0['queue'];this['membername']=_0xc684('0x1f');this['reason']=_0x2b8d37[_0xc684('0x20')];this[_0xc684('0x21')]=_0x7e03c0[_0xc684('0x21')];this[_0xc684('0x22')]=_0x7e03c0[_0xc684('0x22')];this[_0xc684('0x23')]=_0x7e03c0[_0xc684('0x23')];this[_0xc684('0x24')]=_0x7e03c0[_0xc684('0x24')];this[_0xc684('0x25')]=_0x7e03c0[_0xc684('0x25')];this['ListId']=_0x7e03c0[_0xc684('0x26')];this['UserId']=_0x7e03c0[_0xc684('0x27')];this[_0xc684('0x28')]=_0x7e03c0[_0xc684('0x28')];this[_0xc684('0x29')]=_0x7e03c0['CampaignId'];}module['exports']=Hangup; \ No newline at end of file +var _0xba86=['outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','statedesc','scheduledat','type','campaigntype'];(function(_0xa64f83,_0xd41ffa){var _0x4f091f=function(_0x3a57b3){while(--_0x3a57b3){_0xa64f83['push'](_0xa64f83['shift']());}};_0x4f091f(++_0xd41ffa);}(_0xba86,0x15e));var _0x6ba8=function(_0x51f3d6,_0x572b62){_0x51f3d6=_0x51f3d6-0x0;var _0x2f0dfa=_0xba86[_0x51f3d6];return _0x2f0dfa;};'use strict';var util=require(_0x6ba8('0x0'));var _=require(_0x6ba8('0x1'));var moment=require(_0x6ba8('0x2'));function getSeconds(_0x4b22d3,_0x23eba5){var _0x440f34=moment(_0x4b22d3)[_0x6ba8('0x3')](0x0);var _0x12b599=moment(_0x23eba5)[_0x6ba8('0x3')](0x0);return _0x440f34[_0x6ba8('0x4')](_0x12b599,_0x6ba8('0x5'));}function Hangup(_0x30779f,_0x315904){this['state']=0x4;this[_0x6ba8('0x6')]='Answer';this[_0x6ba8('0x7')]=_0x30779f['scheduledat'];this[_0x6ba8('0x8')]=_0x30779f[_0x6ba8('0x8')];this[_0x6ba8('0x9')]=_0x30779f[_0x6ba8('0x8')]===_0x6ba8('0xa')?_0x6ba8('0xb'):_0x30779f[_0x6ba8('0x8')];this[_0x6ba8('0xc')]=_0x30779f[_0x6ba8('0xc')];this[_0x6ba8('0xd')]=_0x30779f[_0x6ba8('0xd')];this[_0x6ba8('0xe')]=_0x30779f[_0x6ba8('0xe')];this[_0x6ba8('0xf')]=_0x30779f['countbusyretry']+_0x30779f[_0x6ba8('0xd')]+_0x30779f[_0x6ba8('0xe')]+_0x30779f[_0x6ba8('0x10')]+_0x30779f['countdropretry']+_0x30779f[_0x6ba8('0x11')]+_0x30779f[_0x6ba8('0x12')]+_0x30779f[_0x6ba8('0x13')];this['countnosuchnumberretry']=_0x30779f['countnosuchnumberretry'];this['countdropretry']=_0x30779f[_0x6ba8('0x14')];this[_0x6ba8('0x11')]=_0x30779f[_0x6ba8('0x11')];this[_0x6ba8('0x12')]=_0x30779f[_0x6ba8('0x12')];this['countagentrejectretry']=_0x30779f[_0x6ba8('0x13')];this[_0x6ba8('0x15')]=_0x315904[_0x6ba8('0x15')];this[_0x6ba8('0x16')]=_0x30779f[_0x6ba8('0x17')];this[_0x6ba8('0x18')]=_0x30779f[_0x6ba8('0x19')];this[_0x6ba8('0x1a')]=_0x30779f[_0x6ba8('0x1a')];this['responsetime']=_0x30779f[_0x6ba8('0x1b')];this[_0x6ba8('0x1c')]=moment()[_0x6ba8('0x1d')](_0x6ba8('0x1e'));this[_0x6ba8('0x1f')]=getSeconds(_0x30779f[_0x6ba8('0x1b')],_0x30779f[_0x6ba8('0x1a')]);this[_0x6ba8('0x20')]=0x0;this[_0x6ba8('0x21')]=getSeconds(this[_0x6ba8('0x1c')],_0x30779f[_0x6ba8('0x1b')]);this['queue']=_0x30779f[_0x6ba8('0xb')];this['membername']=_0x6ba8('0x22');this[_0x6ba8('0x23')]=_0x315904[_0x6ba8('0x24')];this[_0x6ba8('0x25')]=_0x30779f[_0x6ba8('0x25')];this['callbackuniqueid']=_0x30779f[_0x6ba8('0x26')];this[_0x6ba8('0x27')]=_0x30779f[_0x6ba8('0x27')];this[_0x6ba8('0x28')]=_0x30779f[_0x6ba8('0x28')];this['ContactId']=_0x30779f['ContactId'];this[_0x6ba8('0x29')]=_0x30779f[_0x6ba8('0x29')];this[_0x6ba8('0x2a')]=_0x30779f[_0x6ba8('0x2a')];this[_0x6ba8('0x2b')]=_0x30779f[_0x6ba8('0x2b')];this[_0x6ba8('0x2c')]=_0x30779f[_0x6ba8('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 321da7b..a927968 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 _0x3328=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','calleridnum','starttime','responsetime','endtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId'];(function(_0x79b4c7,_0x3fc453){var _0x1b741a=function(_0x50b085){while(--_0x50b085){_0x79b4c7['push'](_0x79b4c7['shift']());}};_0x1b741a(++_0x3fc453);}(_0x3328,0x8e));var _0x8332=function(_0x869ded,_0x311134){_0x869ded=_0x869ded-0x0;var _0x4a168=_0x3328[_0x869ded];return _0x4a168;};'use strict';var util=require('util');var _=require(_0x8332('0x0'));var moment=require(_0x8332('0x1'));function getSeconds(_0x151241,_0xb53888){var _0x1d9001=moment(_0x151241)[_0x8332('0x2')](0x0);var _0x44646c=moment(_0xb53888)[_0x8332('0x2')](0x0);return _0x1d9001[_0x8332('0x3')](_0x44646c,_0x8332('0x4'));}function History(_0x22ea00){this[_0x8332('0x5')]=_0x22ea00[_0x8332('0x5')];this[_0x8332('0x6')]=_0x22ea00[_0x8332('0x6')]||undefined;this[_0x8332('0x7')]=_0x22ea00[_0x8332('0x7')];this['campaigntype']=_0x22ea00[_0x8332('0x7')]===_0x8332('0x8')?_0x8332('0x9'):_0x22ea00[_0x8332('0x7')];this[_0x8332('0xa')]=_0x22ea00[_0x8332('0xa')];this[_0x8332('0xb')]=_0x22ea00[_0x8332('0xb')];this['countnoanswerretry']=_0x22ea00[_0x8332('0xc')];this[_0x8332('0xd')]=_0x22ea00[_0x8332('0xa')]+_0x22ea00[_0x8332('0xb')]+_0x22ea00['countnoanswerretry']+_0x22ea00[_0x8332('0xe')]+_0x22ea00[_0x8332('0xf')]+_0x22ea00['countabandonedretry']+_0x22ea00[_0x8332('0x10')]+_0x22ea00[_0x8332('0x11')];this[_0x8332('0xe')]=_0x22ea00[_0x8332('0xe')];this[_0x8332('0xf')]=_0x22ea00['countdropretry'];this['countabandonedretry']=_0x22ea00['countabandonedretry'];this['countmachineretry']=_0x22ea00[_0x8332('0x10')];this[_0x8332('0x11')]=_0x22ea00[_0x8332('0x11')];this['queue']=_0x22ea00[_0x8332('0x9')];this['calleridname']=_0x22ea00['name'];this[_0x8332('0x12')]=_0x22ea00['number'];this['starttime']=_0x22ea00[_0x8332('0x13')];this[_0x8332('0x14')]=_0x22ea00[_0x8332('0x14')];this[_0x8332('0x15')]=_0x22ea00[_0x8332('0x14')];this['ringtime']=getSeconds(_0x22ea00[_0x8332('0x14')],_0x22ea00['starttime']);this['holdtime']=0x0;this[_0x8332('0x16')]=0x0;this['callback']=_0x22ea00[_0x8332('0x17')];this[_0x8332('0x18')]=_0x22ea00[_0x8332('0x18')];this['callbackat']=_0x22ea00['callbackat'];this[_0x8332('0x19')]=_0x22ea00[_0x8332('0x19')];this[_0x8332('0x1a')]=_0x22ea00[_0x8332('0x1a')];this[_0x8332('0x1b')]=_0x22ea00[_0x8332('0x1b')];this[_0x8332('0x1c')]=_0x22ea00[_0x8332('0x1c')];this['VoiceQueueId']=_0x22ea00[_0x8332('0x1d')];this[_0x8332('0x1e')]=_0x22ea00[_0x8332('0x1e')];this[_0x8332('0x1f')]=_0x22ea00[_0x8332('0x1f')]||'';this[_0x8332('0x20')]=_0x22ea00[_0x8332('0x20')]||'';}module[_0x8332('0x21')]=History; \ No newline at end of file +var _0xec56=['countagentrejectretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x41ee9d,_0x57f077){var _0x44f67a=function(_0x532676){while(--_0x532676){_0x41ee9d['push'](_0x41ee9d['shift']());}};_0x44f67a(++_0x57f077);}(_0xec56,0x84));var _0x6ec5=function(_0x37cb30,_0x203933){_0x37cb30=_0x37cb30-0x0;var _0x23ca02=_0xec56[_0x37cb30];return _0x23ca02;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x6ec5('0x0'));function getSeconds(_0x448565,_0x5d70ed){var _0x204fa0=moment(_0x448565)[_0x6ec5('0x1')](0x0);var _0x29371e=moment(_0x5d70ed)[_0x6ec5('0x1')](0x0);return _0x204fa0[_0x6ec5('0x2')](_0x29371e,_0x6ec5('0x3'));}function History(_0xa7f9bd){this[_0x6ec5('0x4')]=_0xa7f9bd[_0x6ec5('0x4')];this[_0x6ec5('0x5')]=_0xa7f9bd[_0x6ec5('0x5')]||undefined;this[_0x6ec5('0x6')]=_0xa7f9bd[_0x6ec5('0x6')];this[_0x6ec5('0x7')]=_0xa7f9bd[_0x6ec5('0x6')]===_0x6ec5('0x8')?'queue':_0xa7f9bd[_0x6ec5('0x6')];this['countbusyretry']=_0xa7f9bd['countbusyretry'];this[_0x6ec5('0x9')]=_0xa7f9bd['countcongestionretry'];this[_0x6ec5('0xa')]=_0xa7f9bd[_0x6ec5('0xa')];this[_0x6ec5('0xb')]=_0xa7f9bd['countbusyretry']+_0xa7f9bd['countcongestionretry']+_0xa7f9bd['countnoanswerretry']+_0xa7f9bd[_0x6ec5('0xc')]+_0xa7f9bd[_0x6ec5('0xd')]+_0xa7f9bd[_0x6ec5('0xe')]+_0xa7f9bd[_0x6ec5('0xf')]+_0xa7f9bd[_0x6ec5('0x10')];this[_0x6ec5('0xc')]=_0xa7f9bd[_0x6ec5('0xc')];this[_0x6ec5('0xd')]=_0xa7f9bd[_0x6ec5('0xd')];this[_0x6ec5('0xe')]=_0xa7f9bd[_0x6ec5('0xe')];this[_0x6ec5('0xf')]=_0xa7f9bd['countmachineretry'];this[_0x6ec5('0x10')]=_0xa7f9bd[_0x6ec5('0x10')];this[_0x6ec5('0x11')]=_0xa7f9bd[_0x6ec5('0x11')];this[_0x6ec5('0x12')]=_0xa7f9bd[_0x6ec5('0x13')];this[_0x6ec5('0x14')]=_0xa7f9bd[_0x6ec5('0x15')];this[_0x6ec5('0x16')]=_0xa7f9bd[_0x6ec5('0x16')];this[_0x6ec5('0x17')]=_0xa7f9bd['responsetime'];this[_0x6ec5('0x18')]=_0xa7f9bd[_0x6ec5('0x17')];this[_0x6ec5('0x19')]=getSeconds(_0xa7f9bd[_0x6ec5('0x17')],_0xa7f9bd[_0x6ec5('0x16')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x6ec5('0x1a')]=_0xa7f9bd['callback'];this[_0x6ec5('0x1b')]=_0xa7f9bd['callbackuniqueid'];this[_0x6ec5('0x1c')]=_0xa7f9bd[_0x6ec5('0x1c')];this[_0x6ec5('0x1d')]=_0xa7f9bd[_0x6ec5('0x1d')];this[_0x6ec5('0x1e')]=_0xa7f9bd[_0x6ec5('0x1e')];this[_0x6ec5('0x1f')]=_0xa7f9bd[_0x6ec5('0x1f')];this[_0x6ec5('0x20')]=_0xa7f9bd[_0x6ec5('0x20')];this[_0x6ec5('0x21')]=_0xa7f9bd[_0x6ec5('0x21')];this[_0x6ec5('0x22')]=_0xa7f9bd['CampaignId'];this[_0x6ec5('0x23')]=_0xa7f9bd[_0x6ec5('0x23')]||'';this['originatecalleridname']=_0xa7f9bd['originatecalleridname']||'';}module[_0x6ec5('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 4ad33b2..9d146a0 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 _0xe892=['campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','Action','channel','catch','No\x20such\x20channel','voiceQueues','[Dialer][checkChannel]','queue','updateOriginated','countReScheduled','resolve','checkIsBlackList','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','Success','isTrunkReachable','active','status','reachable','SIP/%s','saveInDb','createHistory','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','HangupInAMD','membername','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','AMD','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','countnoanswerretry','countagentrejectretry','reason\x2019\x20machine....','add','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','starttime','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','resetActiveCalls','syncCampaigns','TrunkBackup','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','isArray','command','iftime\x20%s,%s','interval','true','content','indexOf','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','handlePreviewRecallNotifications','Agent','user:%s','handleIvr','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','dialPreviewRecallmeReminder','launchHandleIvr','pow','random','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','updatedAt','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','dialAbandonedMaxRetry','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','check\x20failure','startMethodPredictive','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','voicePause','run','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','not_inuse','[countReScheduled]\x20','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','[busyFactor]','m\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','predictive','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/setting','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncOriginateResponse','hangup','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','seconds','type','outbound','strategy','answered','available','pTalking','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangAbandonmentRate','erlangBusyFactor','Trunk','format','ivr','campaign:ivr:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe892,0x19c));var _0x2e89=function(_0x50085b,_0x3c2827){_0x50085b=_0x50085b-0x0;var _0x426b50=_0xe892[_0x50085b];return _0x426b50;};'use strict';var util=require(_0x2e89('0x0'));var _=require(_0x2e89('0x1'));var BPromise=require(_0x2e89('0x2'));var uuid=require(_0x2e89('0x3'));var moment=require(_0x2e89('0x4'));var rr=require('rr');var md5=require(_0x2e89('0x5'));var Redis=require(_0x2e89('0x6'));var ut=require('../preview/util/util');var config=require(_0x2e89('0x7'));var logger=require(_0x2e89('0x8'))(_0x2e89('0x9'));var loggerBooked=require(_0x2e89('0x8'))('booked');var loggerPredictive=require(_0x2e89('0x8'))(_0x2e89('0xa'));var loggerPredictiveCalls=require(_0x2e89('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x2e89('0x8'))(_0x2e89('0xb'));var ami=require('../ami');config[_0x2e89('0xc')]=_[_0x2e89('0xd')](config[_0x2e89('0xc')],{'host':_0x2e89('0xe'),'port':0x18eb});var io=require(_0x2e89('0xf'))(new Redis(config['redis']));var cmHopper=require(_0x2e89('0x10'));var cmHopperHistory=require(_0x2e89('0x11'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x2e89('0x12'));var Action=require(_0x2e89('0x13'));var History=require(_0x2e89('0x14'));var Final=require('./final');var AgentComplete=require(_0x2e89('0x15'));var QueueCallerAbandon=require(_0x2e89('0x16'));var Hangup=require(_0x2e89('0x17'));var ipAgi=process['env'][_0x2e89('0x18')]||_0x2e89('0x19');var strategy={'rrmemory':_0x2e89('0x1a'),'roundrobin':_0x2e89('0x1b')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x2e89('0x1c')][_0x2e89('0x1d')]=function(_0x48e8a6){this[_0x2e89('0x1e')]=this['tail']?this[_0x2e89('0x1e')][_0x2e89('0x1f')](_0x48e8a6):_0x48e8a6();};function Dialer(_0x40cffd,_0x2c9c9a){this[_0x2e89('0x20')]=new Sequence();this[_0x2e89('0x21')]=_0x2c9c9a;this['voiceQueues']=_0x40cffd['voiceQueues'];this[_0x2e89('0x22')]=_0x40cffd[_0x2e89('0x22')];this[_0x2e89('0x23')]=_0x40cffd[_0x2e89('0x23')];this[_0x2e89('0x24')]=_0x40cffd[_0x2e89('0x24')];this[_0x2e89('0x25')]=config[_0x2e89('0x25')]||0x2;this['channels']={};this[_0x2e89('0x26')]={};this[_0x2e89('0x27')]={};this['uniqueId']={};this['optionPredictive']={};this[_0x2e89('0x28')]={};this[_0x2e89('0x29')]={};this[_0x2e89('0x2a')]={};this[_0x2e89('0x2b')]={};this[_0x2e89('0x2c')]={};ami['on'](_0x2e89('0x2d'),this[_0x2e89('0x2e')][_0x2e89('0x2f')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x2e89('0x2f')](this));ami['on']('originateresponse',this[_0x2e89('0x30')][_0x2e89('0x2f')](this));ami['on']('agentcomplete',this['syncAgentComplete']['bind'](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x2e89('0x2f')](this));ami['on'](_0x2e89('0x31'),this['syncHangup'][_0x2e89('0x2f')](this));ami['on']('newexten',this['syncNewExten'][_0x2e89('0x2f')](this));ami['on'](_0x2e89('0x32'),this[_0x2e89('0x33')][_0x2e89('0x2f')](this));ami['on'](_0x2e89('0x34'),this[_0x2e89('0x35')][_0x2e89('0x2f')](this));ami['on'](_0x2e89('0x36'),this['syncQueueStatusComplete'][_0x2e89('0x2f')](this));this[_0x2e89('0x37')]();this[_0x2e89('0x38')]();RpcSetting[_0x2e89('0x39')]()[_0x2e89('0x3a')](function(_0x890cbf){previewRecallmeReminderInterval=_0x890cbf[_0x2e89('0x3b')];});}function isNotNull(_0x1fe9ab){return _0x1fe9ab!==null&&!_[_0x2e89('0x3c')](_0x1fe9ab);}function checkIsLoggedIn(_0x191ad4,_0x3afe55){return function(){if(_0x3afe55<=0x0){_0x191ad4[_0x2e89('0x3d')]='AGENTS_NOT_LOGGED';throw _0x191ad4[_0x2e89('0x3e')]+_0x2e89('0x3f');}};}function isActive(_0x5ecf95){return _0x5ecf95;}function checkIsActive(_0x1c3153,_0x599180){return function(){if(!isActive(_0x599180)){_0x1c3153[_0x2e89('0x3d')]=_0x2e89('0x40');throw _0x1c3153['name']+_0x2e89('0x41');}};}function checkInterval(_0x3a3a75){return function(){if(!isNotNull(_0x3a3a75[_0x2e89('0x42')])){_0x3a3a75['message']=_0x2e89('0x43');throw _0x3a3a75[_0x2e89('0x3e')]+_0x2e89('0x44');}if(!isNotNull(_0x3a3a75[_0x2e89('0x42')][_0x2e89('0x45')])){_0x3a3a75[_0x2e89('0x3d')]='INTERVAL_IS_NULL';throw _0x3a3a75[_0x2e89('0x3e')]+_0x2e89('0x44');}if(!isNotNull(_[_0x2e89('0x46')](_0x3a3a75[_0x2e89('0x42')][_0x2e89('0x45')]))){_0x3a3a75[_0x2e89('0x3d')]=_0x2e89('0x43');throw _0x3a3a75['name']+_0x2e89('0x44');}};}function msgResponse(_0x5e0020,_0x526d04,_0x278200){return{'action':_0x5e0020,'response':_0x526d04,'message':_0x278200,'stack':_0x278200};}function myreject(_0x54a3a8){return function(_0x3c76da){return _0x54a3a8(msgResponse(_0x2e89('0x47'),_0x2e89('0x48'),JSON[_0x2e89('0x49')](_0x3c76da)));};}function getSeconds(_0x53d7c2,_0x27c882){var _0x3bcfaa=moment(_0x53d7c2)[_0x2e89('0x4a')](0x0);var _0x489de9=moment(_0x27c882)[_0x2e89('0x4a')](0x0);return _0x3bcfaa['diff'](_0x489de9,_0x2e89('0x4b'));}function emit(_0x3777ce,_0x3842e5,_0x52ee8c){io['to'](_0x3777ce)['emit'](_0x3842e5,_0x52ee8c);}function emitVoiceQueueSummary(_0x44269d){if(_0x44269d[_0x2e89('0x4c')]===_0x2e89('0x4d')){var _0x22f838={'id':_0x44269d['id'],'name':_0x44269d[_0x2e89('0x3e')],'strategy':_0x44269d[_0x2e89('0x4e')],'answered':_0x44269d[_0x2e89('0x4f')],'available':_0x44269d[_0x2e89('0x50')],'loggedIn':_0x44269d['loggedIn'],'pTalking':_0x44269d[_0x2e89('0x51')],'sumBillable':_0x44269d['sumBillable'],'sumDuration':_0x44269d['sumDuration'],'sumHoldTime':_0x44269d[_0x2e89('0x52')]||0x0,'talking':_0x44269d[_0x2e89('0x53')],'total':_0x44269d[_0x2e89('0x54')],'type':_0x44269d[_0x2e89('0x4c')],'unmanaged':_0x44269d[_0x2e89('0x55')],'abandoned':_0x44269d[_0x2e89('0x56')],'waiting':_0x44269d[_0x2e89('0x57')],'loggedInDb':_0x44269d[_0x2e89('0x58')],'dialActive':_0x44269d[_0x2e89('0x59')],'dialMethod':_0x44269d[_0x2e89('0x5a')],'dialOriginateCallerIdName':_0x44269d[_0x2e89('0x5b')],'dialOriginateCallerIdNumber':_0x44269d['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x44269d['dialOriginateTimeout'],'dialPrefix':_0x44269d[_0x2e89('0x5c')],'outboundAnswerAgiCallsDay':_0x44269d[_0x2e89('0x5d')],'outboundAnswerCallsDay':_0x44269d[_0x2e89('0x5e')],'outboundBlacklistCallsDay':_0x44269d['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x44269d[_0x2e89('0x5f')],'outboundCongestionCallsDay':_0x44269d[_0x2e89('0x60')],'outboundDropCallsDayACS':_0x44269d[_0x2e89('0x61')],'outboundDropCallsDayCallersExit':_0x44269d[_0x2e89('0x62')],'outboundDropCallsDayTimeout':_0x44269d['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x44269d[_0x2e89('0x63')],'outboundNoSuchCallsDay':_0x44269d[_0x2e89('0x64')],'outboundOriginateFailureCallsDay':_0x44269d['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x44269d[_0x2e89('0x65')],'outboundRejectCallsDay':_0x44269d[_0x2e89('0x66')],'outboundUnknownCallsDay':_0x44269d[_0x2e89('0x67')],'predictiveIntervalAnsweredCalls':_0x44269d[_0x2e89('0x68')],'predictiveIntervalAvgHoldtime':_0x44269d['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x44269d[_0x2e89('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x44269d[_0x2e89('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x44269d[_0x2e89('0x6b')],'predictiveIntervalErlangCalls':_0x44269d[_0x2e89('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x44269d[_0x2e89('0x6d')],'predictiveIntervalHitRate':_0x44269d[_0x2e89('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x44269d[_0x2e89('0x6f')],'predictiveIntervalPauses':_0x44269d[_0x2e89('0x70')],'predictiveIntervalAvailable':_0x44269d[_0x2e89('0x71')],'predictiveIntervalTotalCalls':_0x44269d[_0x2e89('0x72')],'message':_0x44269d['message'],'originated':_0x44269d[_0x2e89('0x73')],'erlangCalls':_0x44269d['erlangCalls'],'erlangCallToSecond':_0x44269d['erlangCallToSecond'],'erlangAbandonmentRate':_0x44269d[_0x2e89('0x74')],'erlangBusyFactor':_0x44269d[_0x2e89('0x75')],'startPredictive':_0x44269d[_0x2e89('0x28')],'startProgressive':_0x44269d['startProgressive']};if(_0x44269d[_0x2e89('0x76')]){_0x22f838['Trunk']={'id':_0x44269d['Trunk']['id'],'name':_0x44269d[_0x2e89('0x76')][_0x2e89('0x3e')],'active':_0x44269d['Trunk']['active'],'callerid':_0x44269d[_0x2e89('0x76')]['callerid']};}if(_0x44269d['Interval']){_0x22f838[_0x2e89('0x42')]={'id':_0x44269d[_0x2e89('0x42')]['id'],'name':_0x44269d[_0x2e89('0x42')][_0x2e89('0x3e')]};}var _0x35116a=md5(JSON[_0x2e89('0x49')](_0x22f838));if(_0x44269d['md5']!==_0x35116a){_0x44269d[_0x2e89('0x5')]=_0x35116a;emit(util[_0x2e89('0x77')]('voice:queue:%s',_0x22f838[_0x2e89('0x3e')]),'voice_queue:save',_0x22f838);}}}function emitCampaignSummary(_0x11b073){if(_0x11b073[_0x2e89('0x4c')]===_0x2e89('0x78')){emit(util[_0x2e89('0x77')](_0x2e89('0x79'),_0x11b073[_0x2e89('0x3e')]),_0x2e89('0x7a'),_0x11b073);}}function checkGetDataPredictive(_0x213a52){if(isNotNull(_0x213a52)&&!_[_0x2e89('0x46')](_0x213a52)){loggerPredictive[_0x2e89('0x7b')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x7c'),_0x213a52[_0x2e89('0x72')]);loggerPredictive[_0x2e89('0x7b')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x213a52[_0x2e89('0x68')]);loggerPredictive[_0x2e89('0x7b')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x213a52[_0x2e89('0x6b')]);loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x7d'),_0x213a52[_0x2e89('0x6a')]);loggerPredictive['info'](_0x2e89('0x7e'),_0x213a52[_0x2e89('0x7f')]);loggerPredictive[_0x2e89('0x7b')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x213a52['predictiveIntervalAvgTalktime']);loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x80'));if(_0x213a52[_0x2e89('0x72')]>0x0){if(!_[_0x2e89('0x3c')](_0x213a52[_0x2e89('0x69')])&&_0x213a52['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x81'));if(!_[_0x2e89('0x3c')](_0x213a52[_0x2e89('0x7f')])&&_0x213a52['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x82'));}else{loggerPredictive['info'](_0x2e89('0x83'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x57b8ba){return function(_0x4faad4){loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x84'));loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x85'),_0x4faad4[_0x2e89('0x86')]);loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x87'),_0x4faad4['erlangCallToSecond']);loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x88'),_0x4faad4[_0x2e89('0x74')]);loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x89'),_0x4faad4['erlangBusyFactor']);loggerPredictive['info'](_0x2e89('0x88'),_0x4faad4['erlangAbandonmentRate']);loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x80'));_[_0x2e89('0x8a')](_0x57b8ba,_0x4faad4);};}function getDiff(_0x37bfa0){var _0x4df179=moment()[_0x2e89('0x4a')](0x0);var _0x7c8da5=moment(_0x37bfa0)[_0x2e89('0x4a')](0x0);return _0x4df179[_0x2e89('0x8b')](_0x7c8da5,_0x2e89('0x4b'));}function ifInterval(_0x180335,_0x3bf0d3){if(_[_0x2e89('0x3c')](_0x3bf0d3)){return![];}return getDiff(_0x3bf0d3)<_0x180335*0x3c;}function freeVariablesPredictive(_0x485e70){if(isNotNull(_0x485e70)){if(!_['isUndefined'](_0x485e70['startProgressive'])){_0x485e70[_0x2e89('0x29')]=undefined;loggerPredictive[_0x2e89('0x7b')](_0x485e70['name'],_0x2e89('0x8c'));}if(!_[_0x2e89('0x3c')](_0x485e70[_0x2e89('0x28')])){_0x485e70[_0x2e89('0x28')]=undefined;loggerPredictive[_0x2e89('0x7b')](_0x485e70['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x2e89('0x3c')](_0x485e70[_0x2e89('0x8d')])){clearInterval(_0x485e70[_0x2e89('0x8d')]);_0x485e70[_0x2e89('0x8d')]=undefined;loggerPredictive[_0x2e89('0x7b')](_0x485e70[_0x2e89('0x3e')],_0x2e89('0x8e'));}}}function erlangb(_0x1e3dba,_0xf7a69e){if(_0xf7a69e===0x0){return 0x0;}var _0x5b0b23=0x1;for(var _0x14dcc3=0x1;_0x14dcc3<=_0xf7a69e;_0x14dcc3+=0x1){_0x5b0b23=0x1+_0x5b0b23*_0x14dcc3/_0x1e3dba;}return 0x1/_0x5b0b23;}function isVoiceQueueOutbound(_0x2c3cdf){return _0x2c3cdf===_0x2e89('0x4d');}function isNotPreview(_0x4e0344){return _0x4e0344!==_0x2e89('0x21');}function isCampaignIvr(_0x27821a){return _0x27821a===_0x2e89('0x78');}function getCallerId(_0x1cb167,_0x3ab511,_0x407bcb){if(!_[_0x2e89('0x3c')](_0x407bcb)&&typeof _0x407bcb===_0x2e89('0x8f')&&!_[_0x2e89('0x46')](_0x407bcb)){if(!_[_0x2e89('0x3c')](_0x3ab511)&&typeof _0x3ab511===_0x2e89('0x8f')&&!_[_0x2e89('0x46')](_0x3ab511)){return util[_0x2e89('0x77')](_0x2e89('0x90'),_0x3ab511,_0x407bcb);}return util[_0x2e89('0x77')](_0x2e89('0x90'),_0x407bcb,_0x407bcb);}if(!_[_0x2e89('0x3c')](_0x1cb167)&&typeof _0x1cb167===_0x2e89('0x8f')&&!_[_0x2e89('0x46')](_0x1cb167)){return _0x1cb167;}return _0x2e89('0x91');}function loggerCatchQueueSummary(_0x5ba16e,_0x3944dd){return function(_0x4255b5){freeVariablesPredictive(_0x3944dd);emitVoiceQueueSummary(_0x3944dd);emitCampaignSummary(_0x3944dd);loggerSyncQueueSummary['error'](_0x5ba16e,util[_0x2e89('0x92')](_0x4255b5,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xa847ec,_0x3078d3){return function(_0x385844){loggerPredictive[_0x2e89('0x93')](_0x3078d3[_0x2e89('0x3e')],_0xa847ec);loggerPredictive[_0x2e89('0x93')](_0x385844[_0x2e89('0x94')]);freeVariablesPredictive(_0x3078d3);};}function loggerCatch(_0x37f884){return function(_0x40502e){logger[_0x2e89('0x93')](_0x37f884,util[_0x2e89('0x92')](_0x40502e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4d38e2){return _0x4d38e2&&!_[_0x2e89('0x3c')](_0x4d38e2)&&_0x4d38e2[_0x2e89('0x95')]>0x0;}function decremetOriginate(_0x30de9a){if(!_[_0x2e89('0x3c')](_0x30de9a)&&_0x30de9a!==null){if(typeof _0x30de9a['originated']!==_0x2e89('0x96')){if(_0x30de9a[_0x2e89('0x73')]>0x0){_0x30de9a[_0x2e89('0x73')]-=0x1;}else{logger['error'](_0x2e89('0x97'));}}}else{logger[_0x2e89('0x93')](_0x2e89('0x98'));}}function checkContactLowerLimitOriginate(_0x1faf7a,_0x4b21d4,_0x3e7eb6){if(_0x4b21d4>_0x3e7eb6){for(var _0x5adc98=0x0;_0x5adc98<_0x4b21d4-_0x3e7eb6;_0x5adc98+=0x1){decremetOriginate(_0x1faf7a);}}}function loggerGetContactDialer(_0x2aa820,_0x421513,_0x40c752){return function(_0x258985){checkContactLowerLimitOriginate(_0x421513,_0x40c752,0x0);logger[_0x2e89('0x93')](_0x2aa820,util[_0x2e89('0x92')](_0x258985,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3eccc4){return function(_0x7124a6){if(isNotNull(_0x7124a6)&&isNotNull(_0x7124a6[0x0])){if(_0x7124a6[0x0][_0x2e89('0x99')]>0x0){_0x3eccc4[_0x2e89('0x3d')]='RESCHEDULED_CONTACTS';logger[_0x2e89('0x7b')]('[getContactDialer2][ReScheduled]'+_0x3eccc4[_0x2e89('0x3e')],_0x7124a6[0x0][_0x2e89('0x99')],_0x2e89('0x9a'));}else{_0x3eccc4['message']=_0x2e89('0x9b');logger[_0x2e89('0x7b')](_0x2e89('0x9c')+_0x3eccc4['name']);}}};}function notSendMessagesQueue(_0x5a61b3){if(_0x5a61b3['sendMessageOneNotActive']){freeVariablesPredictive(_0x5a61b3);if(_0x5a61b3[_0x2e89('0x73')]===0x0&&_0x5a61b3[_0x2e89('0x53')]===0x0&&_0x5a61b3[_0x2e89('0x57')]===0x0&&(_0x5a61b3[_0x2e89('0x51')]||0x0)===0x0){_0x5a61b3[_0x2e89('0x9d')]=![];_0x5a61b3[_0x2e89('0x50')]=0x0;_0x5a61b3['message']=_0x2e89('0x40');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x5a61b3['name'],_0x2e89('0x9e'));}else{_0x5a61b3['message']=_0x2e89('0x9f');loggerSyncQueueSummary[_0x2e89('0x93')](_0x2e89('0xa0'),_0x5a61b3[_0x2e89('0x3e')],_0x2e89('0xa1'));}emitVoiceQueueSummary(_0x5a61b3);}}function notSendMessagesCampaign(_0x5323d4){if(_0x5323d4[_0x2e89('0x9d')]){if(_0x5323d4[_0x2e89('0x73')]===0x0){_0x5323d4[_0x2e89('0x9d')]=![];_0x5323d4[_0x2e89('0x3d')]=_0x2e89('0x40');loggerSyncQueueSummary[_0x2e89('0x93')](_0x2e89('0xa2'),_0x5323d4[_0x2e89('0x3e')],'is\x20not\x20active');}else{_0x5323d4[_0x2e89('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x2e89('0x93')](_0x2e89('0xa2'),_0x5323d4[_0x2e89('0x3e')],'is\x20disactive');}emitCampaignSummary(_0x5323d4);}}function createObjHistory(_0x3598f9,_0x21243e,_0x3629f8,_0x100743,_0x5cb559){_0x3598f9[_0x2e89('0x3d')]=_0x3629f8;var _0x4cb502=new Action(_0x3598f9,_0x21243e);var _0x4744e3=new History(_0x4cb502);_0x4744e3[_0x2e89('0xa3')]=_0x100743;_0x4744e3[_0x2e89('0xa4')]=_0x5cb559;_0x4744e3[_0x2e89('0xa5')]=_0x4cb502['starttime'];return _0x4744e3;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x25e741=this;setInterval(function(){_0x25e741[_0x2e89('0xa6')](_0x25e741[_0x2e89('0xa7')],_0x2e89('0xa8'));_0x25e741[_0x2e89('0xa6')](_0x25e741['actions'],_0x2e89('0xa9'));},0x32c8);};Dialer[_0x2e89('0x1c')]['clearZombieChannels']=function(_0x2899f9,_0x43ea46){var _0x1cb1c0=this;for(var _0x1c7052 in _0x2899f9){if(typeof _0x2899f9[_0x1c7052]!==_0x2e89('0x96')){this['sequence']['enqueue'](function(){if(!_['isNil'](_0x2899f9[_0x1c7052])){return ami[_0x2e89('0xaa')]({'action':'status','channel':_0x2899f9[_0x1c7052][_0x2e89('0xab')]})[_0x2e89('0xac')](function(_0xb344f1){if(_0xb344f1[_0x2e89('0x3d')]===_0x2e89('0xad')){setTimeout(function(){if(_0x2899f9[_0x1c7052]&&_0x2899f9[_0x1c7052][_0x2e89('0x4c')]!=='ivr'){_0x1cb1c0['updateOriginated'](_0x1cb1c0[_0x2e89('0xae')][_0x2899f9[_0x1c7052]['queue']]);logger[_0x2e89('0x93')](_0x2e89('0xaf'),_0x43ea46,_0x1c7052,_0x2899f9[_0x1c7052][_0x2e89('0xb0')]);delete _0x2899f9[_0x1c7052];}if(_0x2899f9[_0x1c7052]&&_0x2899f9[_0x1c7052][_0x2e89('0x4c')]===_0x2e89('0x78')){_0x1cb1c0[_0x2e89('0xb1')](_0x1cb1c0['campaigns'][_0x2899f9[_0x1c7052][_0x2e89('0xb0')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x43ea46,_0x1c7052,_0x2899f9[_0x1c7052][_0x2e89('0xb0')]);delete _0x2899f9[_0x1c7052];}},0x2328);}});}});}}};Dialer[_0x2e89('0x1c')][_0x2e89('0xb2')]=function(_0x5db95d){return BPromise[_0x2e89('0xb3')]()[_0x2e89('0x3a')](cmHopper[_0x2e89('0xb2')](_0x5db95d))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x2e89('0x1c')][_0x2e89('0xb4')]=function(_0x16fa4b){return BPromise[_0x2e89('0xb3')]()[_0x2e89('0x3a')](cmHopperBlack[_0x2e89('0xb4')](_0x16fa4b))[_0x2e89('0xac')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x2e89('0x1c')][_0x2e89('0xb5')]=function(_0x2f623f){return BPromise[_0x2e89('0xb3')]()[_0x2e89('0x3a')](cmHopperBlack[_0x2e89('0xb5')](_0x2f623f))[_0x2e89('0xac')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0x2e89('0xb6')]=function(_0x79132c){return BPromise[_0x2e89('0xb3')]()['then'](cmHopperHistory[_0x2e89('0xb7')](_0x79132c))['catch'](loggerCatch(_0x2e89('0xb8')));};Dialer['prototype'][_0x2e89('0xb9')]=function(_0x6c92da){return BPromise[_0x2e89('0xb3')]()[_0x2e89('0x3a')](cmHopper[_0x2e89('0xb9')](_0x6c92da))[_0x2e89('0xac')](loggerCatch(_0x2e89('0xba')));};Dialer['prototype'][_0x2e89('0xbb')]=function(_0x5749bd,_0x57649f,_0x293718){return BPromise['resolve']()[_0x2e89('0x3a')](cmHopper[_0x2e89('0xbb')](_0x5749bd,_0x57649f,_0x293718))[_0x2e89('0xac')](loggerCatch(_0x2e89('0xbc')));};Dialer['prototype'][_0x2e89('0xbd')]=function(_0x6dc26d,_0x41ada7,_0x4a3489,_0x3027dc,_0x595779){return BPromise[_0x2e89('0xb3')]()[_0x2e89('0x3a')](cmHopper[_0x2e89('0xbd')](_0x6dc26d,_0x41ada7,_0x4a3489,_0x3027dc))[_0x2e89('0xac')](function(_0x158c8c){_0x595779[_0x2e89('0xbe')]-=_0x4a3489;_0x595779[_0x2e89('0xbe')]=_0x595779[_0x2e89('0xbe')]>0x0?_0x595779[_0x2e89('0xbe')]:0x0;loggerCatch(_0x2e89('0xbf'))(_0x158c8c);});};Dialer[_0x2e89('0x1c')]['getContactDialerIvr']=function(_0x1f1a23,_0x2b015b,_0x4321b3,_0x57d141){return BPromise[_0x2e89('0xb3')]()[_0x2e89('0x3a')](cmHopper['getContactDialerIvr'](_0x1f1a23,_0x2b015b,_0x4321b3))[_0x2e89('0xac')](function(_0x105fab){_0x57d141[_0x2e89('0xbe')]-=_0x2b015b;_0x57d141[_0x2e89('0xbe')]=_0x57d141[_0x2e89('0xbe')]>0x0?_0x57d141[_0x2e89('0xbe')]:0x0;loggerCatch(_0x2e89('0xc0'))(_0x105fab);});};Dialer[_0x2e89('0x1c')][_0x2e89('0xc1')]=function(_0x1acab8){return BPromise[_0x2e89('0xb3')]()['then'](voiceQueueRt[_0x2e89('0xc1')](_0x1acab8))[_0x2e89('0xac')](loggerCatch(_0x2e89('0xc2')));};Dialer[_0x2e89('0x1c')][_0x2e89('0xc3')]=function(_0x5a84cf){return BPromise['resolve']()[_0x2e89('0x3a')](cmHopper[_0x2e89('0xc3')](_0x5a84cf))[_0x2e89('0xac')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x2e89('0x1c')]['createHistory']=function(_0x1e51c7){return BPromise[_0x2e89('0xb3')]()[_0x2e89('0x3a')](cmHopperHistory['createHistory'](_0x1e51c7))['catch'](loggerCatch(_0x2e89('0xc4')));};Dialer[_0x2e89('0x1c')][_0x2e89('0xb1')]=function(_0x408f19){if(!_['isUndefined'](_0x408f19)&&_0x408f19!==null){if(typeof _0x408f19[_0x2e89('0x73')]!=='undefined'){if(_0x408f19['originated']>0x0){_0x408f19[_0x2e89('0x73')]-=0x1;}else{logger[_0x2e89('0x93')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x2e89('0x93')](_0x2e89('0xc5'));}};Dialer[_0x2e89('0x1c')][_0x2e89('0xc6')]=function(_0x29abc9,_0x54e601){var _0x1856c1=this;return function(_0x3118e7){_0x1856c1[_0x2e89('0xb1')](_0x54e601);logger[_0x2e89('0x93')](_0x29abc9,util[_0x2e89('0x92')](_0x3118e7,{'showHidden':![],'depth':null}));};};Dialer[_0x2e89('0x1c')][_0x2e89('0xc7')]=function(_0x4fc1e0,_0x3df300,_0x388f0e){var _0x5a161d={'state':0x19,'statedesc':_0x2e89('0xc8')};this[_0x2e89('0xb1')](_0x3df300);this['saveInDb'](_[_0x2e89('0x8a')](_0x5a161d,_[_0x2e89('0xc9')](_0x388f0e,['ContactId',_0x2e89('0xca'),_0x2e89('0xcb'),_0x2e89('0xcc'),_0x2e89('0xcd')])),_0x2e89('0xce'),'[emptyContact]');logger[_0x2e89('0x93')](_0x4fc1e0);};Dialer[_0x2e89('0x1c')]['isSuccess']=function(_0x341b09){return _0x341b09===_0x2e89('0xcf');};Dialer[_0x2e89('0x1c')][_0x2e89('0xd0')]=function(_0x3c5678){return!_['isUndefined'](_0x3c5678)&&_0x3c5678&&!_['isUndefined'](_0x3c5678[_0x2e89('0x3e')])&&!_[_0x2e89('0x3c')](_0x3c5678[_0x2e89('0xd1')])&&_0x3c5678[_0x2e89('0xd1')]&&(this[_0x2e89('0x24')][util['format']('SIP/%s',_0x3c5678[_0x2e89('0x3e')])][_0x2e89('0xd2')]===_0x2e89('0xd3')||this['trunks'][util['format'](_0x2e89('0xd4'),_0x3c5678['name'])][_0x2e89('0xd2')]==='unmonitored');};Dialer[_0x2e89('0x1c')][_0x2e89('0xd5')]=function(_0x1e4b12,_0x32553b,_0x4a8d84){this[_0x2e89('0xd6')](_0x1e4b12)[_0x2e89('0xac')](loggerCatch(_0x32553b));this[_0x2e89('0xc3')](_0x1e4b12)['catch'](loggerCatch(_0x4a8d84));};Dialer[_0x2e89('0x1c')][_0x2e89('0x33')]=function(_0x5ba5ea){var _0x3be75b=this[_0x2e89('0xa7')][_0x5ba5ea[_0x2e89('0xd7')]];var _0xe44e39;if(!_[_0x2e89('0xd8')](_0x5ba5ea)&&!_[_0x2e89('0xd8')](_0x5ba5ea[_0x2e89('0xd9')])&&!_[_0x2e89('0xd8')](_0x5ba5ea['variable'][_0x2e89('0xda')])&&_0x5ba5ea[_0x2e89('0xdb')]===_0x2e89('0xdc')&&_0x3be75b){if(_0x3be75b[_0x2e89('0x4c')]!==_0x2e89('0x78')&&this[_0x2e89('0xae')][_0x3be75b[_0x2e89('0xb0')]]['dialAMDActive']&&_0x5ba5ea[_0x2e89('0xdd')]===_0x2e89('0xde')){delete this[_0x2e89('0xa7')][_0x5ba5ea[_0x2e89('0xd7')]];this[_0x2e89('0xb1')](this[_0x2e89('0xae')][_0x3be75b[_0x2e89('0xb0')]]);this[_0x2e89('0xae')][_0x3be75b['queue']][_0x2e89('0x5e')]+=0x1;this['voiceQueues'][_0x3be75b[_0x2e89('0xb0')]][_0x2e89('0x5d')]+=0x1;_0xe44e39=new Hangup(_0x3be75b,_0x5ba5ea);_0xe44e39[_0x2e89('0xa3')]=0x12;_0xe44e39[_0x2e89('0xa4')]=_0x2e89('0xdf');_0xe44e39[_0x2e89('0xe0')]='AMD';ami[_0x2e89('0xe1')](_0x2e89('0xe2'),ut[_0x2e89('0xe3')](_0xe44e39,_0x2e89('0xe4')));this[_0x2e89('0xd5')](_0xe44e39,_0x2e89('0xe5'),_0x2e89('0xe6'));}if(_0x3be75b['type']!==_0x2e89('0x78')&&this['voiceQueues'][_0x3be75b[_0x2e89('0xb0')]][_0x2e89('0xe7')]&&_0x5ba5ea[_0x2e89('0xdd')]===_0x2e89('0xe8')){var _0x479803=this;return new BPromise(function(_0x3718db,_0xff30b2){delete _0x479803[_0x2e89('0xa7')][_0x5ba5ea[_0x2e89('0xd7')]];_0x479803[_0x2e89('0xb1')](_0x479803['voiceQueues'][_0x3be75b[_0x2e89('0xb0')]]);_0x479803['voiceQueues'][_0x3be75b[_0x2e89('0xb0')]][_0x2e89('0x5e')]+=0x1;_0x479803[_0x2e89('0xae')][_0x3be75b[_0x2e89('0xb0')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x13e0f6=_0x479803[_0x2e89('0xae')][_0x3be75b[_0x2e89('0xb0')]];var _0x3e65e1=new Hangup(_0x3be75b,_0x5ba5ea);_0x3e65e1[_0x2e89('0xa3')]=0x13;_0x3e65e1[_0x2e89('0xa4')]=_0x2e89('0xe9');_0x3e65e1[_0x2e89('0xe0')]=_0x2e89('0xea');_0x3e65e1[_0x2e89('0xeb')]+=0x1;_0x3e65e1[_0x2e89('0xec')]+=0x1;_0x3e65e1['amd']=!![];ami[_0x2e89('0xe1')](_0x2e89('0xe2'),ut['buildObj'](_0x3e65e1,'amd'));_0x479803['createHistory'](_0x3e65e1)[_0x2e89('0xac')](loggerCatch(_0x2e89('0xed')));if(_0x3e65e1[_0x2e89('0xee')]+_0x3e65e1[_0x2e89('0xef')]+_0x3e65e1['countnoanswerretry']+_0x3e65e1[_0x2e89('0xf0')]+_0x3e65e1[_0x2e89('0xf1')]+_0x3e65e1['countabandonedretry']+_0x3e65e1[_0x2e89('0xeb')]+_0x3e65e1['countagentrejectretry']>=_0x13e0f6[_0x2e89('0xf2')]){_0x479803[_0x2e89('0xf3')](_0x3e65e1,_0x3718db,_0xff30b2,_0x2e89('0xf4'));}else{if(_0x3e65e1[_0x2e89('0xeb')]>=_0x13e0f6[_0x2e89('0xf5')]){_0x479803[_0x2e89('0xf6')](_0x3e65e1,_0x3718db,_0xff30b2,'reason\x2019\x20machine....');}else{_0x479803[_0x2e89('0xb9')]({'active':![],'countmachineretry':_0x3e65e1[_0x2e89('0xeb')],'scheduledat':moment()['add'](_0x13e0f6[_0x2e89('0xf7')],_0x2e89('0xf8'))[_0x2e89('0x77')](_0x2e89('0xf9')),'ContactId':_0x3e65e1[_0x2e89('0xfa')],'ListId':_0x3e65e1['ListId'],'VoiceQueueId':_0x3e65e1[_0x2e89('0xcc')]||undefined,'CampaignId':_0x3e65e1[_0x2e89('0xcd')]||undefined})[_0x2e89('0xac')](loggerCatch(_0x2e89('0xfb')));_0x3718db({'reschedule':0x1});}}});}if(_0x3be75b[_0x2e89('0x4c')]===_0x2e89('0x78')&&this[_0x2e89('0x22')][_0x3be75b['queue']]['dialAMDActive']&&_0x5ba5ea['value']==='HANGUP'){delete this[_0x2e89('0xa7')][_0x5ba5ea[_0x2e89('0xd7')]];this[_0x2e89('0xb1')](this['campaigns'][_0x3be75b['queue']]);_0xe44e39=new Hangup(_0x3be75b,_0x5ba5ea);_0xe44e39[_0x2e89('0xa3')]=0x12;_0xe44e39['statedesc']=_0x2e89('0xdf');_0xe44e39[_0x2e89('0xe0')]=_0x2e89('0xea');ami[_0x2e89('0xe1')](_0x2e89('0xe2'),ut[_0x2e89('0xe3')](_0xe44e39,'amd'));this[_0x2e89('0xd5')](_0xe44e39,'[syncHangupInAMDIvr][createHistory]',_0x2e89('0xfc'));}if(_0x3be75b[_0x2e89('0x4c')]==='ivr'&&this[_0x2e89('0x22')][_0x3be75b[_0x2e89('0xb0')]][_0x2e89('0xe7')]&&_0x5ba5ea[_0x2e89('0xdd')]==='MACHINE'){var _0x479803=this;return new BPromise(function(_0x2e3063,_0x495488){delete _0x479803[_0x2e89('0xa7')][_0x5ba5ea['uniqueid']];_0x479803['updateOriginated'](_0x479803['campaigns'][_0x3be75b['queue']]);_0x479803[_0x2e89('0x22')][_0x3be75b[_0x2e89('0xb0')]][_0x2e89('0x5e')]+=0x1;_0x479803['campaigns'][_0x3be75b[_0x2e89('0xb0')]][_0x2e89('0x5d')]+=0x1;var _0x4d506a=_0x479803['campaigns'][_0x3be75b[_0x2e89('0xb0')]];var _0x4272ca=new Hangup(_0x3be75b,_0x5ba5ea);_0x4272ca['state']=0x13;_0x4272ca[_0x2e89('0xa4')]='Machine';_0x4272ca['membername']=_0x2e89('0xea');_0x4272ca['countmachineretry']+=0x1;_0x4272ca['countglobal']+=0x1;_0x4272ca[_0x2e89('0xe4')]=!![];ami[_0x2e89('0xe1')](_0x2e89('0xe2'),ut['buildObj'](_0x4272ca,'amd'));_0x479803[_0x2e89('0xd6')](_0x4272ca)[_0x2e89('0xac')](loggerCatch(_0x2e89('0xed')));if(_0x4272ca[_0x2e89('0xee')]+_0x4272ca['countcongestionretry']+_0x4272ca[_0x2e89('0xfd')]+_0x4272ca[_0x2e89('0xf0')]+_0x4272ca[_0x2e89('0xf1')]+_0x4272ca['countabandonedretry']+_0x4272ca[_0x2e89('0xeb')]+_0x4272ca[_0x2e89('0xfe')]>=_0x4d506a[_0x2e89('0xf2')]){_0x479803[_0x2e89('0xf3')](_0x4272ca,_0x2e3063,_0x495488,_0x2e89('0xf4'));}else{if(_0x4272ca[_0x2e89('0xeb')]>=_0x4d506a['dialMachineMaxRetry']){_0x479803['createStateFinal'](_0x4272ca,_0x2e3063,_0x495488,_0x2e89('0xff'));}else{_0x479803[_0x2e89('0xb9')]({'active':![],'countmachineretry':_0x4272ca[_0x2e89('0xeb')],'scheduledat':moment()[_0x2e89('0x100')](_0x4d506a['dialMachineRetryFrequency'],_0x2e89('0xf8'))[_0x2e89('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4272ca[_0x2e89('0xfa')],'ListId':_0x4272ca[_0x2e89('0xca')],'VoiceQueueId':_0x4272ca['VoiceQueueId']||undefined,'CampaignId':_0x4272ca[_0x2e89('0xcd')]||undefined})[_0x2e89('0xac')](loggerCatch('[rescheduleContact][Machine]'));_0x2e3063({'reschedule':0x1});}}});}}};Dialer[_0x2e89('0x1c')]['syncHangup']=function(_0x17da9a){var _0x23cadf=this[_0x2e89('0xa7')][_0x17da9a[_0x2e89('0xd7')]];var _0x139ad9=this;var _0x4320b4;if(_0x23cadf&&_0x23cadf[_0x2e89('0x4c')]===_0x2e89('0x78')){delete this[_0x2e89('0xa7')][_0x17da9a[_0x2e89('0xd7')]];this['updateOriginated'](this[_0x2e89('0x22')][_0x23cadf[_0x2e89('0xb0')]]);this['campaigns'][_0x23cadf[_0x2e89('0xb0')]][_0x2e89('0x101')]+=0x1;_0x4320b4=new Hangup(_0x23cadf,_0x17da9a);this[_0x2e89('0xd6')](_0x4320b4)[_0x2e89('0xac')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x2e89('0xc3')](_0x4320b4)['catch'](loggerCatch(_0x2e89('0x102')));}if(_0x23cadf&&_0x23cadf['type']!==_0x2e89('0x78')&&isNotNull(this[_0x2e89('0xae')][_0x23cadf[_0x2e89('0xb0')]][_0x2e89('0x103')])){delete this[_0x2e89('0xa7')][_0x17da9a['uniqueid']];this['updateOriginated'](this[_0x2e89('0xae')][_0x23cadf[_0x2e89('0xb0')]]);this[_0x2e89('0xae')][_0x23cadf[_0x2e89('0xb0')]][_0x2e89('0x5e')]+=0x1;this[_0x2e89('0xae')][_0x23cadf[_0x2e89('0xb0')]][_0x2e89('0x5d')]+=0x1;_0x4320b4=new Hangup(_0x23cadf,_0x17da9a);_0x4320b4[_0x2e89('0xa3')]=0x10;_0x4320b4[_0x2e89('0xa4')]=_0x2e89('0x104');_0x4320b4[_0x2e89('0xe0')]=_0x2e89('0x105');this['createHistory'](_0x4320b4)['catch'](loggerCatch(_0x2e89('0x106')));this[_0x2e89('0xc3')](_0x4320b4)[_0x2e89('0xac')](loggerCatch(_0x2e89('0x102')));}if(_0x23cadf&&_0x23cadf[_0x2e89('0x4c')]!=='ivr'&&!isNotNull(this[_0x2e89('0xae')][_0x23cadf[_0x2e89('0xb0')]][_0x2e89('0x103')])){delete this['uniqueId'][_0x17da9a[_0x2e89('0xd7')]];this[_0x2e89('0xb1')](this[_0x2e89('0xae')][_0x23cadf['queue']]);this['voiceQueues'][_0x23cadf['queue']]['outboundUnknownCallsDay']+=0x1;_0x4320b4=new Hangup(_0x23cadf,_0x17da9a);_0x4320b4['state']=0xc;_0x4320b4[_0x2e89('0xa4')]=_0x17da9a[_0x2e89('0x107')];_0x4320b4[_0x2e89('0xe0')]=_0x2e89('0x108');this[_0x2e89('0xd6')](_0x4320b4)[_0x2e89('0xac')](loggerCatch(_0x2e89('0x106')));this[_0x2e89('0xc3')](_0x4320b4)[_0x2e89('0xac')](loggerCatch(_0x2e89('0x102')));}};Dialer[_0x2e89('0x1c')][_0x2e89('0x109')]=function(_0x418f34){var _0x184c93=this[_0x2e89('0xa7')][_0x418f34[_0x2e89('0xd7')]];var _0x215e5a=this;if(this[_0x2e89('0xae')][_0x418f34[_0x2e89('0xb0')]]){if(_0x184c93&&_0x184c93['type']!==_0x2e89('0x78')){delete this[_0x2e89('0xa7')][_0x418f34[_0x2e89('0xd7')]];this[_0x2e89('0xae')][_0x418f34[_0x2e89('0xb0')]][_0x2e89('0x5e')]+=0x1;var _0x35f590=new AgentComplete(_0x184c93,_0x418f34);if(_0x418f34[_0x2e89('0x10a')]===_0x2e89('0x10b')){_0x35f590[_0x2e89('0x10c')]=this[_0x2e89('0xae')][_0x418f34[_0x2e89('0xb0')]][_0x2e89('0x10d')]&&this[_0x2e89('0xae')][_0x418f34[_0x2e89('0xb0')]]['dialAgiAfterHangupAgent']?moment()[_0x2e89('0x77')](_0x2e89('0xf9')):undefined;}this[_0x2e89('0xd6')](_0x35f590)['catch'](loggerCatch(_0x2e89('0x10e')));this[_0x2e89('0xc3')](_0x35f590)[_0x2e89('0xac')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0x2e89('0x2e')]=function(_0x4307dd){if(this['voiceQueues'][_0x4307dd['queue']]){if(this[_0x2e89('0xa7')][_0x4307dd[_0x2e89('0xd7')]]&&this['uniqueId'][_0x4307dd['uniqueid']][_0x2e89('0x4c')]!=='ivr'){this['updateOriginated'](this[_0x2e89('0xae')][_0x4307dd[_0x2e89('0xb0')]]);this[_0x2e89('0xa7')][_0x4307dd[_0x2e89('0xd7')]][_0x2e89('0x10f')]=moment()['format'](_0x2e89('0xf9'));}}};Dialer[_0x2e89('0x1c')][_0x2e89('0x110')]=function(_0x3d5f6b){this['createHistory'](_0x3d5f6b)[_0x2e89('0xac')](loggerCatch(_0x2e89('0x10e')));this['moveContactManagedDialer'](_0x3d5f6b)[_0x2e89('0xac')](loggerCatch(_0x2e89('0x111')));};Dialer[_0x2e89('0x1c')][_0x2e89('0x112')]=function(_0x37bc10){var _0x693b5d=this['uniqueId'][_0x37bc10['uniqueid']];var _0x17c335=this;if(this[_0x2e89('0xae')][_0x37bc10[_0x2e89('0xb0')]]){if(_0x693b5d&&_0x693b5d[_0x2e89('0x4c')]!==_0x2e89('0x78')){delete this['uniqueId'][_0x37bc10['uniqueid']];this[_0x2e89('0xb1')](this[_0x2e89('0xae')][_0x37bc10[_0x2e89('0xb0')]]);_0x693b5d[_0x2e89('0x113')]=moment()[_0x2e89('0x77')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1156ef=new QueueCallerAbandon(_0x693b5d,_0x37bc10);if(getSeconds(_0x693b5d['droptime'],_0x693b5d[_0x2e89('0x114')])>=_0x693b5d[_0x2e89('0x115')]){this['voiceQueues'][_0x37bc10['queue']][_0x2e89('0x6b')]+=0x1;this[_0x2e89('0xae')][_0x37bc10[_0x2e89('0xb0')]][_0x2e89('0x116')]+=0x1;this[_0x2e89('0xae')][_0x37bc10[_0x2e89('0xb0')]][_0x2e89('0x6d')]+=0x1;_0x1156ef[_0x2e89('0xa3')]=0xa;_0x1156ef[_0x2e89('0xa4')]='Drop';_0x1156ef[_0x2e89('0x117')]=_0x2e89('0x118');_0x1156ef[_0x2e89('0x10c')]=this[_0x2e89('0xae')][_0x37bc10['queue']][_0x2e89('0x10d')]?moment()[_0x2e89('0x77')](_0x2e89('0xf9')):undefined;_0x1156ef[_0x2e89('0xf1')]+=0x1;_0x1156ef[_0x2e89('0xec')]+=0x1;if(_0x1156ef['countdropretry']>=this['voiceQueues'][_0x37bc10[_0x2e89('0xb0')]][_0x2e89('0x119')]){this[_0x2e89('0x110')](_0x1156ef);}else{this[_0x2e89('0xb9')]({'active':![],'countdropretry':_0x1156ef['countdropretry'],'scheduledat':moment()[_0x2e89('0x100')](this[_0x2e89('0xae')][_0x37bc10[_0x2e89('0xb0')]][_0x2e89('0x11a')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x693b5d[_0x2e89('0xfa')],'ListId':_0x693b5d['ListId'],'VoiceQueueId':_0x693b5d[_0x2e89('0xcc')]||undefined,'CampaignId':_0x693b5d[_0x2e89('0xcd')]||undefined})['catch'](loggerCatch(_0x2e89('0x11b')));var _0x288de1=new History(_0x1156ef);_0x288de1[_0x2e89('0xa3')]=0xa;_0x288de1['statedesc']='Drop';_0x288de1['starttime']=moment()[_0x2e89('0x77')](_0x2e89('0xf9'));_0x288de1['endtime']=_0x288de1['starttime'];_0x288de1[_0x2e89('0x11c')]=_0x1156ef['calleridname'];_0x288de1[_0x2e89('0x11d')]=_0x1156ef[_0x2e89('0x11d')];this['createHistory'](_0x288de1)[_0x2e89('0xac')](loggerCatch(_0x2e89('0x11e')));}}else{this['voiceQueues'][_0x37bc10['queue']][_0x2e89('0x6a')]+=0x1;this[_0x2e89('0xae')][_0x37bc10['queue']][_0x2e89('0x62')]+=0x1;_0x1156ef[_0x2e89('0xa3')]=0xb;_0x1156ef[_0x2e89('0xa4')]=_0x2e89('0x11f');_0x1156ef[_0x2e89('0x117')]=_0x2e89('0x120');_0x1156ef[_0x2e89('0x121')]+=0x1;_0x1156ef[_0x2e89('0xec')]+=0x1;if(_0x1156ef[_0x2e89('0x121')]>=this[_0x2e89('0xae')][_0x37bc10[_0x2e89('0xb0')]]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x1156ef);}else{this[_0x2e89('0xb9')]({'active':![],'countabandonedretry':_0x1156ef[_0x2e89('0x121')],'scheduledat':moment()[_0x2e89('0x100')](this[_0x2e89('0xae')][_0x37bc10[_0x2e89('0xb0')]][_0x2e89('0x122')],_0x2e89('0xf8'))[_0x2e89('0x77')](_0x2e89('0xf9')),'ContactId':_0x693b5d[_0x2e89('0xfa')],'ListId':_0x693b5d['ListId'],'VoiceQueueId':_0x693b5d[_0x2e89('0xcc')]||undefined,'CampaignId':_0x693b5d[_0x2e89('0xcd')]||undefined})[_0x2e89('0xac')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x288de1=new History(_0x1156ef);_0x288de1[_0x2e89('0xa3')]=0xb;_0x288de1[_0x2e89('0xa4')]=_0x2e89('0x11f');_0x288de1[_0x2e89('0x123')]=moment()[_0x2e89('0x77')](_0x2e89('0xf9'));_0x288de1[_0x2e89('0xa5')]=_0x288de1['starttime'];_0x288de1[_0x2e89('0x11c')]=_0x1156ef[_0x2e89('0x11c')];_0x288de1['calleridnum']=_0x1156ef[_0x2e89('0x11d')];this[_0x2e89('0xd6')](_0x288de1)[_0x2e89('0xac')](loggerCatch(_0x2e89('0x124')));}}}}};Dialer[_0x2e89('0x1c')][_0x2e89('0x125')]=function(_0x43a0ef){if(this[_0x2e89('0x26')][_0x43a0ef['uniqueid']]){this[_0x2e89('0x26')][_0x43a0ef['uniqueid']][_0x2e89('0xab')]=_0x43a0ef['channel'];}if(this['uniqueId'][_0x43a0ef['uniqueid']]){this['uniqueId'][_0x43a0ef[_0x2e89('0xd7')]]['channel']=_0x43a0ef[_0x2e89('0xab')];}};Dialer[_0x2e89('0x1c')]['syncQueueMember']=function(_0x1b12c0){if(strategy[this[_0x2e89('0xae')][this[_0x2e89('0x26')][_0x1b12c0['actionid']]['queue']]['strategy']]===_0x2e89('0x1b')){if(this[_0x2e89('0x26')][_0x1b12c0[_0x2e89('0x126')]]&&_[_0x2e89('0xd8')](this[_0x2e89('0x26')][_0x1b12c0[_0x2e89('0x126')]][_0x2e89('0x127')])&&_0x1b12c0[_0x2e89('0xd2')]==='1'&&_0x1b12c0[_0x2e89('0x128')]==='0'){if(this[_0x2e89('0x23')][_0x1b12c0['stateinterface']]){if(!this['agents'][_0x1b12c0[_0x2e89('0x129')]]['locked']){this['agents'][_0x1b12c0['stateinterface']][_0x2e89('0x127')]=!![];this[_0x2e89('0x26')][_0x1b12c0[_0x2e89('0x126')]][_0x2e89('0x127')]=!![];this['actions'][_0x1b12c0['actionid']]['stateinterface']=_0x1b12c0[_0x2e89('0x129')];}}}}else if((strategy[this[_0x2e89('0xae')][this[_0x2e89('0x26')][_0x1b12c0['actionid']][_0x2e89('0xb0')]][_0x2e89('0x4e')]]||'rrmemory')===_0x2e89('0x1a')){if(this[_0x2e89('0x26')][_0x1b12c0[_0x2e89('0x126')]]){if(this['agents'][_0x1b12c0['stateinterface']]){this[_0x2e89('0x26')][_0x1b12c0[_0x2e89('0x126')]][_0x2e89('0x129')]=_0x1b12c0[_0x2e89('0x129')];if(_['isNil'](this[_0x2e89('0x2b')][this[_0x2e89('0x26')][_0x1b12c0[_0x2e89('0x126')]][_0x2e89('0xb0')]])){this[_0x2e89('0x2b')][this[_0x2e89('0x26')][_0x1b12c0['actionid']][_0x2e89('0xb0')]]=[];}this['queueBooked'][this['actions'][_0x1b12c0[_0x2e89('0x126')]][_0x2e89('0xb0')]][_0x2e89('0x12a')](_[_0x2e89('0x8a')](_[_0x2e89('0xc9')](this[_0x2e89('0x26')][_0x1b12c0[_0x2e89('0x126')]],[_0x2e89('0x12b'),_0x2e89('0x129')]),{'status':_0x1b12c0[_0x2e89('0xd2')],'paused':_0x1b12c0[_0x2e89('0x128')]}));}}}};function unlockQueueStatus(_0x110012,_0x34dbd5){setTimeout(function(){if(_['isUndefined'](_0x110012[_0x2e89('0x12c')])){loggerBooked[_0x2e89('0x93')](_0x2e89('0x12d'),_0x34dbd5);}_0x110012[_0x2e89('0x12c')]=!![];loggerBooked[_0x2e89('0x7b')](_0x2e89('0x12e'),_0x34dbd5,JSON[_0x2e89('0x49')](_[_0x2e89('0xc9')](_0x110012,[_0x2e89('0x3e'),_0x2e89('0x12c')])));},0x1f3);}Dialer[_0x2e89('0x1c')]['syncQueueStatusComplete']=function(_0x1e04b6){var _0x366e04=this;var _0x4dd8c3=_0x366e04[_0x2e89('0xae')][_0x366e04[_0x2e89('0x26')][_0x1e04b6['actionid']]['queue']];if(strategy[this[_0x2e89('0xae')][this['actions'][_0x1e04b6[_0x2e89('0x126')]][_0x2e89('0xb0')]][_0x2e89('0x4e')]]==='roundrobin'){if(this[_0x2e89('0x26')][_0x1e04b6['actionid']]&&this['actions'][_0x1e04b6[_0x2e89('0x126')]]['stateinterface']){this['preview']['run'](this[_0x2e89('0x26')][_0x1e04b6[_0x2e89('0x126')]][_0x2e89('0x12b')],this[_0x2e89('0x26')][_0x1e04b6[_0x2e89('0x126')]][_0x2e89('0x129')])[_0x2e89('0xac')](function(_0x5e1196){logger[_0x2e89('0x93')](_0x2e89('0x12f'),util['inspect'](_0x5e1196,{'showHidden':![],'depth':null}));})[_0x2e89('0x1f')](function(){_0x366e04[_0x2e89('0xb1')](_0x366e04[_0x2e89('0xae')][_0x366e04[_0x2e89('0x26')][_0x1e04b6['actionid']][_0x2e89('0xb0')]]);_0x366e04[_0x2e89('0x23')][_0x366e04['actions'][_0x1e04b6[_0x2e89('0x126')]]['stateinterface']][_0x2e89('0x127')]=![];delete _0x366e04[_0x2e89('0x26')][_0x1e04b6['actionid']];unlockQueueStatus(_0x4dd8c3);});}else{this[_0x2e89('0xb1')](this[_0x2e89('0xae')][this[_0x2e89('0x26')][_0x1e04b6['actionid']][_0x2e89('0xb0')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x2e89('0x26')][_0x1e04b6[_0x2e89('0x126')]]['ContactId'],'ListId':this[_0x2e89('0x26')][_0x1e04b6['actionid']][_0x2e89('0xca')],'VoiceQueueId':this[_0x2e89('0x26')][_0x1e04b6[_0x2e89('0x126')]][_0x2e89('0xcc')]||undefined,'CampaignId':this[_0x2e89('0x26')][_0x1e04b6[_0x2e89('0x126')]][_0x2e89('0xcd')]||undefined})[_0x2e89('0xac')](loggerCatch(_0x2e89('0x130')));delete this[_0x2e89('0x26')][_0x1e04b6['actionid']];unlockQueueStatus(_0x4dd8c3);}}else if((strategy[this[_0x2e89('0xae')][this[_0x2e89('0x26')][_0x1e04b6['actionid']][_0x2e89('0xb0')]][_0x2e89('0x4e')]]||_0x2e89('0x1a'))==='rrmemory'){var _0x569c2e;if(this['actions'][_0x1e04b6[_0x2e89('0x126')]]&&!_[_0x2e89('0x46')](this[_0x2e89('0x2b')][this[_0x2e89('0x26')][_0x1e04b6[_0x2e89('0x126')]]['queue']])){if(this[_0x2e89('0x2c')][_0x366e04[_0x2e89('0x26')][_0x1e04b6[_0x2e89('0x126')]][_0x2e89('0xb0')]]){this[_0x2e89('0x2c')][_0x366e04[_0x2e89('0x26')][_0x1e04b6[_0x2e89('0x126')]][_0x2e89('0xb0')]]=this[_0x2e89('0x2c')][this['actions'][_0x1e04b6[_0x2e89('0x126')]][_0x2e89('0xb0')]]?this[_0x2e89('0x2c')][this['actions'][_0x1e04b6[_0x2e89('0x126')]][_0x2e89('0xb0')]]:this[_0x2e89('0x2b')][this['actions'][_0x1e04b6[_0x2e89('0x126')]][_0x2e89('0xb0')]]?this[_0x2e89('0x2b')][this[_0x2e89('0x26')][_0x1e04b6[_0x2e89('0x126')]][_0x2e89('0xb0')]][_0x2e89('0x131')]||0x0:0x0;}this[_0x2e89('0x2b')][this[_0x2e89('0x26')][_0x1e04b6[_0x2e89('0x126')]][_0x2e89('0xb0')]][_0x2e89('0x131')]=this['queueBookedRR'][this[_0x2e89('0x26')][_0x1e04b6['actionid']]['queue']];for(var _0x3c6d30=0x0;_0x3c6d30=0x0;})[_0x2e89('0xac')](myreject(_0x5e3cfe)));}}else{_0x4b0f42[_0x2e89('0x12a')](ami['Action']({'action':_0x2e89('0x149'),'command':util[_0x2e89('0x77')](_0x2e89('0x14a'),_0x4ce66a,!_['isUndefined'](config[_0x2e89('0x146')][_0x3555c5])?_0x3555c5:'')})[_0x2e89('0x3a')](function(_0x50258e){return _0x50258e[_0x2e89('0x14d')][_0x2e89('0x14e')](_0x2e89('0x14c'))>=0x0;})['catch'](myreject(_0x5e3cfe)));}BPromise[_0x2e89('0x14f')](_0x4b0f42)[_0x2e89('0x3a')](function(_0x41b096){var _0x16f453=_['some'](_0x41b096);if(_0x16f453){return _0x25e3dc(_0x16f453);}else{_0x102a9f[_0x2e89('0x3d')]=_0x5797d8?_0x2e89('0x150'):_0x2e89('0x151');return _0x5e3cfe(msgResponse('[ifTime][promiseAll]','Failure',_0x2e89('0x152')+_0x5797d8+'\x20'+_0x98e795+_0x2e89('0x153')+util[_0x2e89('0x92')](_0x4ce66a,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x3555c5));}})[_0x2e89('0xac')](function(_0x4a03b0){return _0x5e3cfe(msgResponse('ifTime',_0x2e89('0x142'),JSON[_0x2e89('0x49')](_0x4a03b0)));});});};Dialer[_0x2e89('0x1c')][_0x2e89('0x154')]=function(_0x1dd7f4){var _0x1e1230=this;return function(){switch(_0x1dd7f4[_0x2e89('0x5a')]){case _0x2e89('0x155'):freeVariablesPredictive(_0x1dd7f4);_0x1e1230[_0x2e89('0x156')](_0x1dd7f4,0x1);break;case _0x2e89('0x157'):freeVariablesPredictive(_0x1dd7f4);_0x1e1230[_0x2e89('0x156')](_0x1dd7f4,_0x1dd7f4[_0x2e89('0x158')]);break;case _0x2e89('0xa'):_0x1e1230['predictive'](_0x1dd7f4);break;case'booked':freeVariablesPredictive(_0x1dd7f4);_0x1e1230[_0x2e89('0x156')](_0x1dd7f4,0x1);break;default:freeVariablesPredictive(_0x1dd7f4);logger['error'](_0x2e89('0x159'),_0x1dd7f4['name'],_0x2e89('0x15a'));}};};Dialer['prototype']['checkPreviewRecallReminder']=function(_0x1f31fa){return BPromise[_0x2e89('0xb3')]()[_0x2e89('0x3a')](cmHopper[_0x2e89('0x15b')](_0x1f31fa['id'],previewRecallmeReminderInterval))['then'](function(_0x8546f4){for(var _0x22749f=0x0;_0x22749f<_0x8546f4[_0x2e89('0x95')];_0x22749f++){var _0x29d7c1=_0x8546f4[_0x22749f][_0x2e89('0x15c')][_0x2e89('0x3e')];if(_0x29d7c1)io['to'](util[_0x2e89('0x77')](_0x2e89('0x15d'),_0x29d7c1))[_0x2e89('0xe1')]('user:dialPreviewRecallReminder',{'hopper':_0x8546f4[_0x22749f]});}})[_0x2e89('0xac')](function(_0x51c12c){});};Dialer[_0x2e89('0x1c')]['launchHandleIvr']=function(_0x12ac60){var _0x5f11d8=this;return function(){_0x5f11d8[_0x2e89('0x15e')](_0x12ac60);};};Dialer[_0x2e89('0x1c')][_0x2e89('0xb')]=function(_0x235c7d){var _0xf1a601=this;if(isNotPreview(_0x235c7d['dialMethod'])){if(isVoiceQueueOutbound(_0x235c7d[_0x2e89('0x4c')])&&isActive(_0x235c7d[_0x2e89('0x59')])){_0x235c7d[_0x2e89('0x9d')]=!![];BPromise['resolve']()[_0x2e89('0x3a')](checkIsLoggedIn(_0x235c7d,_0x235c7d[_0x2e89('0x15f')]))[_0x2e89('0x3a')](checkIsActive(_0x235c7d,_0x235c7d[_0x2e89('0x59')]))['then'](checkInterval(_0x235c7d))['then'](_0xf1a601[_0x2e89('0x160')](_0x235c7d))[_0x2e89('0x3a')](_0xf1a601[_0x2e89('0x13f')](_0x235c7d[_0x2e89('0x161')],_0x235c7d[_0x2e89('0x162')],_0x235c7d['name'],_0x235c7d))[_0x2e89('0x3a')](_0xf1a601[_0x2e89('0x141')](_0x235c7d[_0x2e89('0x42')],_0x235c7d['dialTimezone'],_0x235c7d[_0x2e89('0x3e')],_0x235c7d))[_0x2e89('0x3a')](_0xf1a601[_0x2e89('0x154')](_0x235c7d))[_0x2e89('0xac')](loggerCatchQueueSummary('[syncQueueSummary]',_0x235c7d));}else{notSendMessagesQueue(_0x235c7d);}}else{freeVariablesPredictive(_0x235c7d);if(_0x235c7d[_0x2e89('0x163')]){_0xf1a601['checkPreviewRecallReminder'](_0x235c7d);}}};Dialer[_0x2e89('0x1c')][_0x2e89('0x13b')]=function(){var _0x16d1cb=this;var _0x2063d8;for(var _0x429169 in this[_0x2e89('0x22')]){if(typeof this[_0x2e89('0x22')][_0x429169]!==_0x2e89('0x96')){_0x2063d8=this['campaigns'][_0x429169];if(isCampaignIvr(_0x2063d8[_0x2e89('0x4c')])&&isActive(_0x2063d8['active'])){_0x2063d8[_0x2e89('0x9d')]=!![];BPromise[_0x2e89('0xb3')]()[_0x2e89('0x3a')](checkIsActive(_0x2063d8,_0x2063d8[_0x2e89('0xd1')]))['then'](checkInterval(_0x2063d8))[_0x2e89('0x3a')](_0x16d1cb[_0x2e89('0x160')](_0x2063d8))[_0x2e89('0x3a')](_0x16d1cb[_0x2e89('0x13f')](_0x2063d8['dialGlobalInterval'],_0x2063d8['dialTimezone'],_0x2063d8['name'],_0x2063d8))[_0x2e89('0x3a')](_0x16d1cb['checkIfTimeIntervals'](_0x2063d8[_0x2e89('0x42')],_0x2063d8['dialTimezone'],_0x2063d8[_0x2e89('0x3e')],_0x2063d8))['then'](_0x16d1cb[_0x2e89('0x164')](_0x2063d8))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x2063d8));}else{notSendMessagesCampaign(_0x2063d8);}}}};function getCallerIdRandom(_0x389ca5,_0x54bccf){var _0x59b6ce;var _0x30fad9;var _0x355f74;if(_0x54bccf<=0x0){_0x54bccf=0x1;}_0x59b6ce=new RegExp('\x5cw{0,'+_0x54bccf+'}$');_0x30fad9=Math[_0x2e89('0x165')](0xa,_0x54bccf-0x1);_0x355f74=Math[_0x2e89('0x165')](0xa,_0x54bccf)-0x1;return util[_0x2e89('0x77')]('%s',_['replace'](_0x389ca5,_0x59b6ce,_[_0x2e89('0x166')](_0x30fad9,_0x355f74)));}function extractCalleridName(_0x520390){var _0x558446=_0x520390['match'](/"(.*?)"/);return _0x558446?_0x558446[0x1]:_0x520390;}function extractCalleridNumber(_0x1d910a){var _0x397535=_0x1d910a['match'](/<(.*?)>/);return _0x397535?_0x397535[0x1]:_0x1d910a;}Dialer[_0x2e89('0x1c')]['actionOriginate']=function(_0x2db539,_0x317116){var _0x120568=this;var _0x27e371=uuid['v4']();this['actions'][_0x27e371]=new Action(_0x2db539,_0x317116,_0x27e371);return new BPromise(function(_0x6cd37d,_0x1d1d7d){if(_['isUndefined'](_0x2db539)&&typeof _0x2db539!=='object'){return _0x1d1d7d(msgResponse(_0x2e89('0x167'),_0x2e89('0x142'),'voiceQueue\x20is\x20undefine'));}if(_[_0x2e89('0x3c')](_0x317116[_0x2e89('0x168')][_0x2e89('0x169')])||_0x317116['Contact'][_0x2e89('0x169')]===null){return _0x1d1d7d(msgResponse(_0x2e89('0x167'),'Failure',_0x2e89('0x16a')));}var _0x30c0ad={'XMD-CALLERID':_0x120568[_0x2e89('0x26')][_0x27e371][_0x2e89('0x16b')](),'XMD-AGI':_0x2db539[_0x2e89('0x103')]?util[_0x2e89('0x77')](_0x2e89('0x16c'),ipAgi,_0x2db539[_0x2e89('0x103')]):'NONE','XMD-AGIAFTER':_0x2db539[_0x2e89('0x10d')]?util[_0x2e89('0x77')](_0x2e89('0x16c'),ipAgi,_0x2db539[_0x2e89('0x10d')]):_0x2e89('0x16d'),'XMD-QUEUE':_0x2db539['type']==='outbound'?util[_0x2e89('0x77')]('\x22%s,%s%s,,,%s\x22',_0x2db539[_0x2e89('0x3e')],_0x2db539[_0x2e89('0x16e')]||'',_0x2db539[_0x2e89('0x16f')]?'c':'',_0x2db539[_0x2e89('0x115')]||0x3):_0x2e89('0x16d'),'XMD-CONTACTID':_0x317116[_0x2e89('0xfa')],'XMD-CDRTYPE':_0x2e89('0x9'),'CALLERID(all)':_0x120568[_0x2e89('0x26')][_0x27e371]['getCaller'](),'XMD-AMD':_0x2db539['dialAMDActive']?_0x2e89('0x170'):_0x2e89('0x16d'),'XMD-DESTINATION':_0x2e89('0xdc')};if(_0x2db539['dialAMDActive']){_0x30c0ad['XMD-AMDINITIALSILENCE']=_0x2db539['dialAMDInitialSilence']||0x9c4;_0x30c0ad[_0x2e89('0x171')]=_0x2db539['dialAMDGreeting']||0x5dc;_0x30c0ad[_0x2e89('0x172')]=_0x2db539[_0x2e89('0x173')]||0x320;_0x30c0ad[_0x2e89('0x174')]=_0x2db539[_0x2e89('0x175')]||0x1388;_0x30c0ad['XMD-AMDMINWORDLENGTH']=_0x2db539[_0x2e89('0x176')]||0x64;_0x30c0ad['XMD-AMDBETWEENWORDSSILENCE']=_0x2db539[_0x2e89('0x177')]||0x32;_0x30c0ad[_0x2e89('0x178')]=_0x2db539['dialAMDMaximumNumberOfWords']||0x3;_0x30c0ad['XMD-AMDSILENCETHRESHOLD']=_0x2db539[_0x2e89('0x179')]||0x100;_0x30c0ad[_0x2e89('0x17a')]=_0x2db539[_0x2e89('0x17b')]||0x1388;}if(_0x2db539[_0x2e89('0x4c')]===_0x2e89('0x4d')){_0x30c0ad['XMD-VOICEQUEUEID']=_0x317116[_0x2e89('0xcc')];}else{_0x30c0ad[_0x2e89('0x17c')]=_0x317116[_0x2e89('0xcd')];}for(var _0x345785 in _0x317116[_0x2e89('0x168')]){if(typeof _0x317116[_0x2e89('0x168')][_0x345785]!==_0x2e89('0x96')){if(isNotNull(_0x317116[_0x2e89('0x168')][_0x345785])&&_0x345785!=='id'&&_0x345785!==_0x2e89('0x17d')&&_0x345785!==_0x2e89('0x17e')&&_0x345785!==_0x2e89('0x17f')){_0x30c0ad[util[_0x2e89('0x77')]('%s%s','XMD-',_['toUpper'](_0x345785))]=_0x317116[_0x2e89('0x168')][_0x345785];}}}var _0x523fdc=_0x120568[_0x2e89('0xd0')](_0x2db539[_0x2e89('0x76')])?getCallerId(_0x2db539[_0x2e89('0x76')][_0x2e89('0x180')],_0x2db539['dialOriginateCallerIdName'],_0x2db539[_0x2e89('0x181')]>0x0?getCallerIdRandom(_0x2db539[_0x2e89('0x182')],_0x2db539[_0x2e89('0x181')]):_0x2db539[_0x2e89('0x182')]):getCallerId(_[_0x2e89('0xd8')](_0x2db539[_0x2e89('0x13c')])?_0x2db539[_0x2e89('0x76')][_0x2e89('0x180')]:_0x2db539[_0x2e89('0x13c')][_0x2e89('0x180')],_0x2db539[_0x2e89('0x5b')],_0x2db539[_0x2e89('0x181')]>0x0?getCallerIdRandom(_0x2db539['dialOriginateCallerIdNumber'],_0x2db539[_0x2e89('0x181')]):_0x2db539[_0x2e89('0x182')]);if(_0x523fdc){_0x30c0ad['XMD-ORIGINATECALLERIDNAME']=_0x120568[_0x2e89('0x26')][_0x27e371][_0x2e89('0x183')]=extractCalleridName(_0x523fdc);_0x30c0ad[_0x2e89('0x184')]=_0x120568[_0x2e89('0x26')][_0x27e371][_0x2e89('0x185')]=extractCalleridNumber(_0x523fdc);}return ami['Action']({'actionid':_0x27e371,'action':_0x2e89('0x167'),'channel':_0x120568[_0x2e89('0xd0')](_0x2db539[_0x2e89('0x76')])?util[_0x2e89('0x77')](_0x2e89('0x186'),_0x2db539[_0x2e89('0x76')][_0x2e89('0x3e')],isNotNull(_0x2db539['dialPrefix'])?_0x2db539['dialPrefix'][_0x2e89('0x187')]()||'':'',_0x2db539['dialCutDigit']>0x0?_0x317116[_0x2e89('0x168')]['phone']['substring'](_0x2db539[_0x2e89('0x188')]):_0x317116[_0x2e89('0x168')][_0x2e89('0x169')]):util[_0x2e89('0x77')](_0x2e89('0x186'),_[_0x2e89('0xd8')](_0x2db539[_0x2e89('0x13c')])?_0x2db539[_0x2e89('0x76')][_0x2e89('0x3e')]:_0x2db539[_0x2e89('0x13c')][_0x2e89('0x3e')],isNotNull(_0x2db539['dialPrefix'])?_0x2db539[_0x2e89('0x5c')][_0x2e89('0x187')]()||'':'',_0x2db539['dialCutDigit']>0x0?_0x317116[_0x2e89('0x168')][_0x2e89('0x169')][_0x2e89('0x189')](_0x2db539[_0x2e89('0x188')]):_0x317116[_0x2e89('0x168')]['phone']),'callerid':_0x523fdc,'Exten':_0x2e89('0xdc'),'Context':'from-sip','Priority':'1','variable':_0x30c0ad,'timeout':(_0x2db539[_0x2e89('0x18a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x27e371})['then'](function(_0x1966de){return _0x6cd37d(_0x1966de);})[_0x2e89('0xac')](function(_0x5e136e){_0x2db539[_0x2e89('0x18b')]+=0x1;var _0x352055=new History(_0x120568[_0x2e89('0x26')][_0x27e371]);logger[_0x2e89('0x93')](util[_0x2e89('0x77')](_0x2e89('0x18c'),JSON['stringify'](_0x5e136e)));_0x352055[_0x2e89('0xa3')]=0xe;_0x352055[_0x2e89('0xa4')]=_0x2e89('0x18d');_0x352055['starttime']=moment()['format'](_0x2e89('0xf9'));_0x352055['endtime']=_0x352055['starttime'];_0x120568[_0x2e89('0xd6')](_0x352055)[_0x2e89('0xac')](loggerCatch(_0x2e89('0x18e')));_0x120568[_0x2e89('0xc3')](_0x352055)[_0x2e89('0xac')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x120568['actions'][_0x27e371];return _0x1d1d7d(msgResponse('originate',_0x2e89('0x48'),_0x2e89('0x18f')));});});});};Dialer['prototype'][_0x2e89('0x30')]=function(_0x5b16df){var _0x1de955=this[_0x2e89('0x26')][_0x5b16df[_0x2e89('0x126')]];if(_0x1de955){delete this[_0x2e89('0x26')][_0x5b16df[_0x2e89('0x126')]];_0x1de955[_0x2e89('0x114')]=moment()[_0x2e89('0x77')]('YYYY-MM-DD\x20HH:mm:ss');var _0x436e30=_0x1de955[_0x2e89('0x4c')]==='ivr'?this[_0x2e89('0x22')][_0x1de955[_0x2e89('0xb0')]]:this[_0x2e89('0xae')][_0x1de955[_0x2e89('0x190')]()];if(!this['isSuccess'](_0x5b16df[_0x2e89('0x191')])){this['updateOriginated'](_0x436e30);return this[_0x2e89('0x192')](_0x1de955,_0x436e30,_0x5b16df)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x5b16df[_0x2e89('0xd7')]]=_0x1de955;}};Dialer[_0x2e89('0x1c')][_0x2e89('0x193')]=function(_0x3e20e0,_0x542727,_0x375f79){var _0x609abd=new History(_0x542727);if(_0x609abd[_0x2e89('0xee')]+_0x609abd['countcongestionretry']+_0x609abd[_0x2e89('0xfd')]+_0x609abd[_0x2e89('0xf0')]+_0x609abd[_0x2e89('0xf1')]+_0x609abd[_0x2e89('0x121')]+_0x609abd[_0x2e89('0xeb')]+_0x609abd['countagentrejectretry']>=_0x375f79[_0x2e89('0xf2')]-0x1){return!![];}switch(_0x3e20e0){case 0x3:if(_0x609abd[_0x2e89('0xfd')]>=_0x375f79[_0x2e89('0x194')]-0x1){return!![];}this[_0x2e89('0xb9')]({'active':![],'countnoanswerretry':_0x609abd[_0x2e89('0xfd')]+=0x1,'scheduledat':moment()[_0x2e89('0x100')](_0x375f79[_0x2e89('0x195')],'minutes')[_0x2e89('0x77')](_0x2e89('0xf9')),'ContactId':_0x609abd[_0x2e89('0xfa')],'ListId':_0x609abd[_0x2e89('0xca')],'VoiceQueueId':_0x609abd[_0x2e89('0xcc')]||undefined,'CampaignId':_0x609abd['CampaignId']||undefined})[_0x2e89('0xac')](loggerCatch(_0x2e89('0x196')));break;case 0x5:if(_0x609abd[_0x2e89('0xee')]>=_0x375f79[_0x2e89('0x197')]-0x1){return!![];}this[_0x2e89('0xb9')]({'active':![],'countbusyretry':_0x609abd[_0x2e89('0xee')]+=0x1,'scheduledat':moment()[_0x2e89('0x100')](_0x375f79[_0x2e89('0x198')],'minutes')['format'](_0x2e89('0xf9')),'ContactId':_0x609abd[_0x2e89('0xfa')],'ListId':_0x609abd[_0x2e89('0xca')],'VoiceQueueId':_0x609abd[_0x2e89('0xcc')]||undefined,'CampaignId':_0x609abd['CampaignId']||undefined})['catch'](loggerCatch(_0x2e89('0x199')));break;case 0x8:if(_0x609abd['countcongestionretry']>=_0x375f79[_0x2e89('0x19a')]-0x1){return!![];}this[_0x2e89('0xb9')]({'active':![],'countcongestionretry':_0x609abd[_0x2e89('0xef')]+=0x1,'scheduledat':moment()['add'](_0x375f79['dialCongestionRetryFrequency'],'minutes')[_0x2e89('0x77')](_0x2e89('0xf9')),'ContactId':_0x609abd['ContactId'],'ListId':_0x609abd[_0x2e89('0xca')],'VoiceQueueId':_0x609abd[_0x2e89('0xcc')]||undefined,'CampaignId':_0x609abd[_0x2e89('0xcd')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x609abd[_0x2e89('0xf0')]>=_0x375f79[_0x2e89('0x19b')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x609abd['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x2e89('0x100')](_0x375f79[_0x2e89('0x19c')],_0x2e89('0xf8'))[_0x2e89('0x77')](_0x2e89('0xf9')),'ContactId':_0x609abd['ContactId'],'ListId':_0x609abd[_0x2e89('0xca')],'VoiceQueueId':_0x609abd[_0x2e89('0xcc')]||undefined,'CampaignId':_0x609abd[_0x2e89('0xcd')]||undefined})[_0x2e89('0xac')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x609abd[_0x2e89('0xf1')]>=_0x375f79[_0x2e89('0x119')]-0x1){return!![];}this[_0x2e89('0xb9')]({'active':![],'countdropretry':_0x609abd[_0x2e89('0xf1')]+=0x1,'scheduledat':moment()[_0x2e89('0x100')](_0x375f79[_0x2e89('0x11a')],_0x2e89('0xf8'))[_0x2e89('0x77')](_0x2e89('0xf9')),'ContactId':_0x609abd[_0x2e89('0xfa')],'ListId':_0x609abd[_0x2e89('0xca')],'VoiceQueueId':_0x609abd[_0x2e89('0xcc')]||undefined,'CampaignId':_0x609abd[_0x2e89('0xcd')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x609abd[_0x2e89('0x121')]>=_0x375f79['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x2e89('0xb9')]({'active':![],'countabandonedretry':_0x609abd['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x375f79[_0x2e89('0x122')],_0x2e89('0xf8'))[_0x2e89('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x609abd[_0x2e89('0xfa')],'ListId':_0x609abd[_0x2e89('0xca')],'VoiceQueueId':_0x609abd['VoiceQueueId']||undefined,'CampaignId':_0x609abd[_0x2e89('0xcd')]||undefined})[_0x2e89('0xac')](loggerCatch(_0x2e89('0x19d')));break;case 0x13:if(_0x609abd[_0x2e89('0xeb')]>=_0x375f79['dialMachineMaxRetry']-0x1){return!![];}this[_0x2e89('0xb9')]({'active':![],'countmachineretry':_0x609abd[_0x2e89('0xeb')]+=0x1,'scheduledat':moment()[_0x2e89('0x100')](_0x375f79[_0x2e89('0xf7')],_0x2e89('0xf8'))[_0x2e89('0x77')](_0x2e89('0xf9')),'ContactId':_0x609abd[_0x2e89('0xfa')],'ListId':_0x609abd['ListId'],'VoiceQueueId':_0x609abd[_0x2e89('0xcc')]||undefined,'CampaignId':_0x609abd[_0x2e89('0xcd')]||undefined})['catch'](loggerCatch(_0x2e89('0xfb')));break;case 0x14:if(_0x609abd[_0x2e89('0xfe')]>=_0x375f79[_0x2e89('0x19e')]-0x1){return!![];}this[_0x2e89('0xb9')]({'active':![],'countagentrejectretry':_0x609abd[_0x2e89('0xfe')]+=0x1,'scheduledat':moment()['add'](_0x375f79[_0x2e89('0x19f')],_0x2e89('0xf8'))['format'](_0x2e89('0xf9')),'ContactId':_0x609abd[_0x2e89('0xfa')],'ListId':_0x609abd[_0x2e89('0xca')],'VoiceQueueId':_0x609abd[_0x2e89('0xcc')]||undefined,'CampaignId':_0x609abd[_0x2e89('0xcd')]||undefined})[_0x2e89('0xac')](loggerCatch(_0x2e89('0x1a0')));break;default:return!![];}};Dialer[_0x2e89('0x1c')]['callProgressDetecting']=function(_0x3dceb5,_0xb2132e,_0x26bf6e){var _0x37a4e3=this;var _0xb83e48=new History(_0x3dceb5);return new BPromise(function(_0x22f853,_0x619a5c){if(_[_0x2e89('0x3c')](_0xb2132e)&&typeof _0xb2132e!=='object'){return _0x619a5c(msgResponse(_0x2e89('0x1a1'),_0x2e89('0x142'),'entity\x20is\x20undefine'));}if(_[_0x2e89('0x3c')](_0x26bf6e)&&typeof _0x26bf6e!=='object'){return _0x619a5c(msgResponse(_0x2e89('0x1a1'),_0x2e89('0x142'),_0x2e89('0x1a2')));}switch(_0x26bf6e['reason']){case'0':_0xb2132e['outboundNoSuchCallsDay']+=0x1;_0xb83e48[_0x2e89('0xa3')]=0x0;_0xb83e48['statedesc']=_0x2e89('0x1a3');_0xb83e48[_0x2e89('0xf0')]+=0x1;_0xb83e48[_0x2e89('0xec')]+=0x1;ami[_0x2e89('0xe1')](_0x2e89('0x1a4'),ut[_0x2e89('0xe3')](_0x3dceb5,_0x2e89('0x1a5')));_0x37a4e3[_0x2e89('0xd6')](_0xb83e48)[_0x2e89('0xac')](loggerCatch(_0x2e89('0xed')));if(_0x37a4e3['checkRetriveMax'](0x0,_0x3dceb5,_0xb2132e)){if(_0xb83e48[_0x2e89('0xf0')]>=_0xb2132e['dialNoSuchNumberMaxRetry']){_0x37a4e3[_0x2e89('0xf6')](_0xb83e48,_0x22f853,_0x619a5c,'reason\x200\x20no\x20such\x20number....');}else{_0x37a4e3[_0x2e89('0xf3')](_0xb83e48,_0x22f853,_0x619a5c,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0xb2132e[_0x2e89('0x63')]+=0x1;_0xb83e48[_0x2e89('0xa3')]=0x3;_0xb83e48[_0x2e89('0xa4')]=_0x2e89('0x1a6');_0xb83e48[_0x2e89('0xfd')]+=0x1;_0xb83e48[_0x2e89('0xec')]+=0x1;ami[_0x2e89('0xe1')](_0x2e89('0x1a7'),ut[_0x2e89('0xe3')](_0x3dceb5,'noanswer'));_0x37a4e3[_0x2e89('0xd6')](_0xb83e48)[_0x2e89('0xac')](loggerCatch(_0x2e89('0x1a8')));if(_0x37a4e3[_0x2e89('0x193')](0x3,_0x3dceb5,_0xb2132e)){if(_0xb83e48[_0x2e89('0xfd')]>=_0xb2132e['dialNoAnswerMaxRetry']){_0x37a4e3['createStateFinal'](_0xb83e48,_0x22f853,_0x619a5c,_0x2e89('0x1a9'));}else{_0x37a4e3['stateGlobal'](_0xb83e48,_0x22f853,_0x619a5c,_0x2e89('0x1a9'));}}break;case'5':_0xb2132e[_0x2e89('0x5f')]+=0x1;_0xb83e48[_0x2e89('0xa3')]=0x5;_0xb83e48[_0x2e89('0xa4')]=_0x2e89('0x1aa');_0xb83e48[_0x2e89('0xee')]+=0x1;_0xb83e48['countglobal']+=0x1;ami[_0x2e89('0xe1')]('custom:agentbusy',ut[_0x2e89('0xe3')](_0x3dceb5,_0x2e89('0x1ab')));_0x37a4e3['createHistory'](_0xb83e48)['catch'](loggerCatch(_0x2e89('0x1ac')));if(_0x37a4e3[_0x2e89('0x193')](0x5,_0x3dceb5,_0xb2132e)){if(_0xb83e48[_0x2e89('0xee')]>=_0xb2132e[_0x2e89('0x197')]){_0x37a4e3[_0x2e89('0xf6')](_0xb83e48,_0x22f853,_0x619a5c,_0x2e89('0x1ad'));}else{_0x37a4e3[_0x2e89('0xf3')](_0xb83e48,_0x22f853,_0x619a5c,'reason\x205\x20busy');}}break;case'8':_0xb2132e['outboundCongestionCallsDay']+=0x1;_0xb83e48[_0x2e89('0xa3')]=0x8;_0xb83e48[_0x2e89('0xa4')]='Congestion';_0xb83e48[_0x2e89('0xef')]+=0x1;_0xb83e48[_0x2e89('0xec')]+=0x1;ami['emit'](_0x2e89('0x1ae'),ut[_0x2e89('0xe3')](_0x3dceb5,_0x2e89('0x1af')));_0x37a4e3[_0x2e89('0xd6')](_0xb83e48)[_0x2e89('0xac')](loggerCatch(_0x2e89('0x1b0')));if(_0x37a4e3[_0x2e89('0x193')](0x8,_0x3dceb5,_0xb2132e)){if(_0xb83e48[_0x2e89('0xef')]>=_0xb2132e[_0x2e89('0x19a')]){_0x37a4e3[_0x2e89('0xf6')](_0xb83e48,_0x22f853,_0x619a5c,_0x2e89('0x1b1'));}else{_0x37a4e3[_0x2e89('0xf3')](_0xb83e48,_0x22f853,_0x619a5c,_0x2e89('0x1b1'));}}break;case'11':_0xb2132e['outboundAbandonedCallsDay']+=0x1;_0xb83e48[_0x2e89('0xa3')]=0xb;_0xb83e48[_0x2e89('0xa4')]='Abandoned';_0xb83e48[_0x2e89('0x121')]+=0x1;_0xb83e48[_0x2e89('0xec')]+=0x1;_0x37a4e3[_0x2e89('0xd6')](_0xb83e48)[_0x2e89('0xac')](loggerCatch(_0x2e89('0x124')));if(_0x37a4e3[_0x2e89('0x193')](0xb,_0x3dceb5,_0xb2132e)){if(_0xb83e48[_0x2e89('0x121')]>=_0xb2132e[_0x2e89('0x1b2')]){_0x37a4e3[_0x2e89('0xf6')](_0xb83e48,_0x22f853,_0x619a5c,_0x2e89('0x1b3'));}else{_0x37a4e3['stateGlobal'](_0xb83e48,_0x22f853,_0x619a5c,'reason\x2011\x20abandoned');}}break;case'20':_0xb2132e[_0x2e89('0x66')]+=0x1;_0xb83e48[_0x2e89('0xa3')]=0x14;_0xb83e48[_0x2e89('0xa4')]=_0x2e89('0x1b4');_0xb83e48[_0x2e89('0xfe')]+=0x1;_0xb83e48[_0x2e89('0xec')]+=0x1;ami[_0x2e89('0xe1')](_0x2e89('0x1b5'),ut[_0x2e89('0xe3')](_0x3dceb5,_0x2e89('0x1b6')));_0x37a4e3[_0x2e89('0xd6')](_0xb83e48)[_0x2e89('0xac')](loggerCatch(_0x2e89('0x1b7')));if(_0x37a4e3['checkRetriveMax'](0x14,_0x3dceb5,_0xb2132e)){if(_0xb83e48[_0x2e89('0xfe')]>=_0xb2132e['dialAgentRejectMaxRetry']){_0x37a4e3['createStateFinal'](_0xb83e48,_0x22f853,_0x619a5c,_0x2e89('0x1b8'));}else{_0x37a4e3[_0x2e89('0xf3')](_0xb83e48,_0x22f853,_0x619a5c,_0x2e89('0x1b8'));}}break;default:_0xb2132e['outboundUnknownCallsDay']+=0x1;_0xb83e48[_0x2e89('0xa3')]=0xc;_0xb83e48[_0x2e89('0xa4')]=_0x26bf6e['reason'];_0x37a4e3[_0x2e89('0xd6')](_0xb83e48)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x37a4e3['checkRetriveMax'](_0x26bf6e['reason'],_0x3dceb5,_0xb2132e)){if(_0xb83e48['countbusyretry']+_0xb83e48['countcongestionretry']+_0xb83e48['countnoanswerretry']+_0xb83e48[_0x2e89('0xf0')]+_0xb83e48[_0x2e89('0xf1')]+_0xb83e48['countabandonedretry']+_0xb83e48[_0x2e89('0xeb')]+_0xb83e48[_0x2e89('0xfe')]>=_0xb2132e[_0x2e89('0xf2')]){_0x37a4e3[_0x2e89('0xf3')](_0xb83e48,_0x22f853,_0x619a5c,_0x26bf6e['reason']);}else{_0x37a4e3[_0x2e89('0xf6')](_0xb83e48,_0x22f853,_0x619a5c,_0x26bf6e[_0x2e89('0x10a')]);}}}});};Dialer[_0x2e89('0x1c')]['stateGlobal']=function(_0x4bcc34,_0x584945,_0x2b618a,_0x529195){var _0xe8746=new Final(_0x4bcc34);_0xe8746[_0x2e89('0xa3')]=0xf;_0xe8746['statedesc']=_0x2e89('0x1b9');this[_0x2e89('0xf6')](_0xe8746,_0x584945,_0x2b618a,_0x529195);};Dialer[_0x2e89('0x1c')]['createStateFinal']=function(_0x252d40,_0x3c58a0,_0x44be01,_0x5c9225){this[_0x2e89('0xc3')](_0x252d40)[_0x2e89('0x3a')](function(){return _0x3c58a0(msgResponse('[callProgressDetecting]',_0x2e89('0xcf'),_0x5c9225));})['catch'](function(){return _0x44be01(msgResponse('[moveContactManagedDialer][0]',_0x2e89('0x142'),_0x2e89('0x1ba')));});};Dialer['prototype'][_0x2e89('0xa')]=function(_0x515df2){var _0x380b24=_0x515df2[_0x2e89('0x1bb')]/0x64;var _0x34e2d2=_0x515df2[_0x2e89('0x116')]/(_0x515df2[_0x2e89('0x116')]+_0x515df2[_0x2e89('0x5e')]);var _0x5dc1ff=Math[_0x2e89('0x1bc')](_0x515df2[_0x2e89('0x71')]*(_0x515df2[_0x2e89('0x1bd')]/0x64));var _0x4d63c6=Math['round'](_0x515df2[_0x2e89('0x71')]*(_0x515df2[_0x2e89('0x1be')]/0x64));var _0x38c27c=_0x515df2['available']+_0x515df2[_0x2e89('0x53')];var _0xeb5809=Math[_0x2e89('0x1bf')](_0x515df2['erlangCalls']*_0x515df2[_0x2e89('0x74')]*_0x515df2[_0x2e89('0x6e')]*_0x515df2[_0x2e89('0x6f')]);if(_[_0x2e89('0x3c')](_0x515df2[_0x2e89('0x29')])){if(!_[_0x2e89('0x3c')](_0x515df2[_0x2e89('0x28')])){_0x515df2[_0x2e89('0x28')]=undefined;loggerPredictive['error'](_0x2e89('0x1c0'),_0x2e89('0x1c1'));}if(!_[_0x2e89('0x3c')](_0x515df2['handlePredictive'])){loggerPredictive[_0x2e89('0x93')](_0x2e89('0x1c0'),_0x2e89('0x1c2'));clearInterval(_0x515df2['handlePredictive']);_0x515df2[_0x2e89('0x8d')]=undefined;}_0x515df2[_0x2e89('0x29')]=moment()[_0x2e89('0x77')](_0x2e89('0xf9'));loggerPredictive[_0x2e89('0x7b')](_0x515df2[_0x2e89('0x3e')],_0x2e89('0x1c3'),_0x515df2[_0x2e89('0x29')]);this[_0x2e89('0x156')](_0x515df2,0x1);}else if(ifInterval(_0x515df2[_0x2e89('0x1c4')],_0x515df2[_0x2e89('0x29')])){this[_0x2e89('0x156')](_0x515df2,0x1);loggerPredictiveCalls[_0x2e89('0x7b')](_0x2e89('0x1c5'),_0x515df2[_0x2e89('0x29')],_0x515df2[_0x2e89('0x3e')]);_0x515df2[_0x2e89('0x86')]=0x0;_0x515df2[_0x2e89('0x6d')]=0x0;}else if(_0x380b24<_0x34e2d2&&_0x515df2[_0x2e89('0x1c6')]===_0x2e89('0x1c7')){freeVariablesPredictive(_0x515df2);loggerPredictive['info'](_0x2e89('0x1c8'),_0x2e89('0x1c9'),_0x34e2d2,_0x2e89('0x29'),_0x515df2[_0x2e89('0x3e')]);}else if(_0xeb5809<_0x515df2[_0x2e89('0x6d')]&&_0x515df2['dialPredictiveOptimization']===_0x2e89('0x1c7')){freeVariablesPredictive(_0x515df2);loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x1ca'),_0x2e89('0x1cb'),_0xeb5809,_0x2e89('0x1cc'),_0x515df2[_0x2e89('0x6d')],_0x2e89('0x29'),_0x515df2[_0x2e89('0x3e')]);}else if(!ifInterval(_0x515df2[_0x2e89('0x1c4')],_0x515df2[_0x2e89('0x29')])&&_[_0x2e89('0x3c')](_0x515df2[_0x2e89('0x28')])&&!_[_0x2e89('0x3c')](_0x515df2[_0x2e89('0x29')])){_0x515df2[_0x2e89('0x28')]=moment()[_0x2e89('0x77')](_0x2e89('0xf9'));loggerPredictive[_0x2e89('0x7b')](_0x515df2[_0x2e89('0x3e')],_0x2e89('0x1cd'),_0x515df2[_0x2e89('0x28')]);this['averageHandleTime'](_0x515df2[_0x2e89('0x1c4')])['then'](this[_0x2e89('0x1ce')](_0x515df2))[_0x2e89('0x3a')](mergeDataErlangB(_0x515df2))[_0x2e89('0x3a')](this['startMethodPredictive'](_0x515df2))[_0x2e89('0xac')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x515df2));}else if(!ifInterval(_0x515df2[_0x2e89('0x1c4')],_0x515df2[_0x2e89('0x28')])){_0x515df2[_0x2e89('0x6d')]=0x0;_0x515df2[_0x2e89('0x28')]=moment()[_0x2e89('0x77')](_0x2e89('0xf9'));loggerPredictive[_0x2e89('0x7b')](_0x515df2['name'],_0x2e89('0x1cf'),_0x515df2[_0x2e89('0x28')]);clearInterval(_0x515df2[_0x2e89('0x8d')]);_0x515df2[_0x2e89('0x8d')]=undefined;this[_0x2e89('0xb6')](_0x515df2[_0x2e89('0x1c4')])['then'](this[_0x2e89('0x1ce')](_0x515df2))[_0x2e89('0x3a')](mergeDataErlangB(_0x515df2))['then'](this['startMethodPredictive'](_0x515df2))['catch'](loggerCatchPredictive(_0x2e89('0x1d0'),_0x515df2));}else if(_0x515df2[_0x2e89('0x71')]&&_0x38c27c<_0x515df2[_0x2e89('0x71')]-_0x4d63c6){freeVariablesPredictive(_0x515df2);loggerPredictive[_0x2e89('0x7b')](_0x515df2[_0x2e89('0x3e')],_0x2e89('0x1d1'),_0x38c27c,')\x20are\x20less\x20than\x20threshold\x20(',_0x515df2['predictiveIntervalAvailable'],'-',_0x4d63c6,'=',_0x515df2['predictiveIntervalAvailable']-_0x4d63c6,')');}else if(_0x515df2['predictiveIntervalAvailable']&&_0x38c27c>_0x515df2[_0x2e89('0x71')]+_0x5dc1ff){freeVariablesPredictive(_0x515df2);loggerPredictive[_0x2e89('0x7b')](_0x515df2['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x38c27c,_0x2e89('0x1d2'),_0x515df2['predictiveIntervalAvailable'],'+',_0x5dc1ff,'=',_0x515df2[_0x2e89('0x71')]+_0x5dc1ff,')');}};Dialer[_0x2e89('0x1c')][_0x2e89('0x1ce')]=function(_0x14e59c){var _0x315060=this;return function(_0x2b64b1){return new BPromise(function(_0x46bae8,_0x265adc){_[_0x2e89('0x8a')](_0x14e59c,_0x2b64b1[0x0]);if(checkGetDataPredictive(_0x2b64b1[0x0])){var _0x11a8ff=_0x14e59c['predictiveIntervalAvailable']=_0x14e59c[_0x2e89('0x53')]+_0x14e59c[_0x2e89('0x50')];var _0x4fb75c=_0x14e59c[_0x2e89('0x1c4')]*0x3c;var _0x140854=_0x2b64b1[0x0][_0x2e89('0x69')]+_0x2b64b1[0x0][_0x2e89('0x7f')];var _0x433dff=(_0x2b64b1[0x0][_0x2e89('0x68')]+_0x2b64b1[0x0][_0x2e89('0x6b')]+_0x2b64b1[0x0][_0x2e89('0x6a')])/_0x2b64b1[0x0][_0x2e89('0x72')];_0x14e59c['predictiveIntervalHitRate']=_0x433dff>0x0?_0x433dff:0x1;switch(_0x14e59c[_0x2e89('0x1c6')]){case'dropRate':var _0xd9c878=_0x14e59c['dialPredictiveOptimizationPercentage']/0x64;return _0x315060[_0x2e89('0x1d3')](_0x11a8ff,_0x4fb75c,_0x140854,_0x433dff,_0xd9c878)[_0x2e89('0x3a')](function(_0xce5b90){return _0x46bae8(_0xce5b90);});case'agentBusyFactor':var _0x20d242=_0x14e59c[_0x2e89('0x1bb')]/0x64;return _0x315060[_0x2e89('0x1d4')](_0x11a8ff,_0x4fb75c,_0x140854,_0x433dff,_0x20d242)[_0x2e89('0x3a')](function(_0x43dba4){return _0x46bae8(_0x43dba4);});default:return _0x265adc(msgResponse(_0x2e89('0x1d5'),'Failure',_0x2e89('0x1d6')));}}else{return _0x265adc(msgResponse('[getDataPredictive]',_0x2e89('0x142'),'check\x20failure'));}});};};Dialer[_0x2e89('0x1c')][_0x2e89('0x1d7')]=function(_0x5ae85a){var _0x4e4b2a=this;return function(_0x31d1fa){return new BPromise(function(_0x17f6d5,_0x5ea560){_[_0x2e89('0x8a')](_0x5ae85a,_0x31d1fa[0x0]);if(checkGetDataPredictive(_0x31d1fa[0x0])){loggerPredictive[_0x2e89('0x7b')](JSON[_0x2e89('0x49')](_0x31d1fa[0x0]));if(_0x5ae85a[_0x2e89('0x1c6')]===_0x2e89('0x1c7')){return _0x4e4b2a[_0x2e89('0xc1')](_0x5ae85a['id'])[_0x2e89('0x3a')](function(_0x7a405){var _0x10caa0=_0x5ae85a[_0x2e89('0x15f')]-_0x7a405[0x0][_0x2e89('0x1d8')];var _0x4ae42a=_0x5ae85a[_0x2e89('0x1c4')]*0x3c;var _0x16aae1=_0x31d1fa[0x0][_0x2e89('0x69')]+_0x31d1fa[0x0][_0x2e89('0x7f')];var _0x287f81=(_0x31d1fa[0x0][_0x2e89('0x68')]+_0x31d1fa[0x0][_0x2e89('0x6b')]+_0x31d1fa[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x31d1fa[0x0][_0x2e89('0x72')];var _0x4f4027=_0x5ae85a['dialPredictiveOptimizationPercentage']/0x64;_0x5ae85a[_0x2e89('0x70')]=_0x7a405[0x0]['outboundQueuePauses']||0x0;_0x5ae85a[_0x2e89('0x6e')]=_0x287f81>0x0?_0x287f81:0x1;return _0x4e4b2a[_0x2e89('0x1d3')](_0x10caa0,_0x4ae42a,_0x16aae1,_0x287f81,_0x4f4027);})[_0x2e89('0x3a')](function(_0x1aeef1){return _0x17f6d5(_0x1aeef1);})['catch'](function(_0x504df7){return _0x5ea560(msgResponse(_0x2e89('0x1d9'),_0x2e89('0x142'),JSON[_0x2e89('0x49')](_0x504df7)));});}if(_0x5ae85a[_0x2e89('0x1c6')]==='agentBusyFactor'){return _0x4e4b2a[_0x2e89('0xc1')](_0x5ae85a['id'])[_0x2e89('0x3a')](function(_0x209063){var _0x3a620a=_0x5ae85a[_0x2e89('0x15f')]-_0x209063[0x0][_0x2e89('0x1d8')];var _0x52f95e=_0x5ae85a['dialPredictiveInterval']*0x3c;var _0x1e25a7=_0x31d1fa[0x0][_0x2e89('0x69')]+_0x31d1fa[0x0]['predictiveIntervalAvgHoldtime'];var _0x309bbf=(_0x31d1fa[0x0][_0x2e89('0x68')]+_0x31d1fa[0x0][_0x2e89('0x6b')]+_0x31d1fa[0x0][_0x2e89('0x6a')])/_0x31d1fa[0x0][_0x2e89('0x72')];var _0x30abc3=_0x5ae85a[_0x2e89('0x1bb')]/0x64;_0x5ae85a['predictiveIntervalPauses']=_0x209063[0x0][_0x2e89('0x1d8')]||0x0;_0x5ae85a[_0x2e89('0x6e')]=_0x309bbf>0x0?_0x309bbf:0x1;return _0x4e4b2a[_0x2e89('0x1d4')](_0x3a620a,_0x52f95e,_0x1e25a7,_0x309bbf,_0x30abc3);})[_0x2e89('0x3a')](function(_0x6d0be6){return _0x17f6d5(_0x6d0be6);})[_0x2e89('0xac')](function(_0x30dcbd){return _0x5ea560(msgResponse('[CatchErlangB]',_0x2e89('0x142'),JSON[_0x2e89('0x49')](_0x30dcbd)));});}}else{return _0x5ea560(msgResponse(_0x2e89('0x1d5'),_0x2e89('0x142'),_0x2e89('0x1da')));}});};};Dialer[_0x2e89('0x1c')][_0x2e89('0x1db')]=function(_0x2dae0b){var _0xd27685=this;return function(){var _0xb5e6a6=0x0;var _0x3deef8=Math[_0x2e89('0x1bf')](_0x2dae0b[_0x2e89('0x1dc')]*0x3e8);if(_0x3deef8>0x0){_0x3deef8=_0x3deef8<0x64?0x64:_0x3deef8;loggerPredictive['info'](_0x2dae0b[_0x2e89('0x3e')],_0x2e89('0x1dd'),_0x3deef8,'milliseconds');_0x2dae0b[_0x2e89('0x8d')]=setInterval(function(){_0xd27685[_0x2e89('0x8d')](_0x2dae0b);loggerPredictiveCalls[_0x2e89('0x7b')](_0x2e89('0x1de'),_0xb5e6a6+=0x1);},_0x3deef8);}else{loggerPredictive[_0x2e89('0x7b')](_0x2dae0b[_0x2e89('0x3e')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x2e89('0x1c')][_0x2e89('0x1df')]=function(_0x22e60a,_0x3db306){var _0x48ebad=this;return function(_0x19339f){if(_[_0x2e89('0x46')](_0x19339f)){if(_[_0x2e89('0xd8')](_0x3db306['UserId'])||!_0x3db306[_0x2e89('0x1e0')]){if(_0x22e60a['dialMethod']===_0x2e89('0x1e1')){_0x22e60a[_0x2e89('0x12c')]=_['isUndefined'](_0x22e60a[_0x2e89('0x12c')])?!![]:_0x22e60a[_0x2e89('0x12c')];var _0x1d73f7=uuid['v4']();_0x48ebad[_0x2e89('0x26')][_0x1d73f7]=new Action(_0x22e60a,_0x3db306,_0x1d73f7);loggerBooked[_0x2e89('0x7b')](_0x2e89('0x1e2'),_0x1d73f7,_0x2e89('0x1e3'),JSON[_0x2e89('0x49')](_0x22e60a['queueStatusComplete']),_0x2e89('0x1e4'),_0x22e60a[_0x2e89('0x3e')]);if(_0x22e60a[_0x2e89('0x12c')]){_0x22e60a[_0x2e89('0x12c')]=![];_0x48ebad[_0x2e89('0x2b')][_0x48ebad['actions'][_0x1d73f7][_0x2e89('0xb0')]]=[];ami[_0x2e89('0xaa')]({'actionid':_0x1d73f7,'action':_0x2e89('0x1e5'),'queue':_0x22e60a['name']})[_0x2e89('0xac')](function(){_0x48ebad[_0x2e89('0xb1')](_0x22e60a);_0x48ebad['rescheduleContact']({'active':![],'ContactId':_0x48ebad[_0x2e89('0x26')][_0x1d73f7]['ContactId'],'ListId':_0x48ebad[_0x2e89('0x26')][_0x1d73f7][_0x2e89('0xca')],'VoiceQueueId':_0x48ebad[_0x2e89('0x26')][_0x1d73f7][_0x2e89('0xcc')]||undefined,'CampaignId':_0x48ebad[_0x2e89('0x26')][_0x1d73f7]['CampaignId']||undefined})[_0x2e89('0xac')](loggerCatch(_0x2e89('0x1e6')));delete _0x48ebad[_0x2e89('0x26')][_0x1d73f7];});}else{loggerBooked[_0x2e89('0x7b')](_0x2e89('0x1e7'),JSON['stringify'](_0x22e60a[_0x2e89('0x12c')]),_0x2e89('0x1e4'),_0x22e60a['name']);_0x48ebad[_0x2e89('0xb1')](_0x22e60a);_0x48ebad['rescheduleContact']({'active':![],'ContactId':_0x48ebad[_0x2e89('0x26')][_0x1d73f7]['ContactId'],'ListId':_0x48ebad[_0x2e89('0x26')][_0x1d73f7][_0x2e89('0xca')],'VoiceQueueId':_0x48ebad[_0x2e89('0x26')][_0x1d73f7][_0x2e89('0xcc')]||undefined,'CampaignId':_0x48ebad[_0x2e89('0x26')][_0x1d73f7]['CampaignId']||undefined})[_0x2e89('0xac')](loggerCatch(_0x2e89('0x1e6')));delete _0x48ebad[_0x2e89('0x26')][_0x1d73f7];}}else{return _0x48ebad[_0x2e89('0x1e8')](_0x22e60a,_0x3db306);}}else{if(getDiff(_0x3db306['scheduledat'])<_0x22e60a['dialRecallMeTimeout']*0x3c){if(_0x3db306['Agent']&&!_0x3db306[_0x2e89('0x15c')][_0x2e89('0x1e9')]){_0x48ebad['preview'][_0x2e89('0x1ea')](_0x3db306['id'])['finally'](function(){_0x48ebad[_0x2e89('0xb1')](_0x22e60a);});}else{_0x48ebad[_0x2e89('0xbb')]({'active':![]},_0x3db306['id'],0x1)['finally'](function(){_0x48ebad[_0x2e89('0xb1')](_0x22e60a);});}}else{_0x22e60a[_0x2e89('0x65')]+=0x1;_0x48ebad[_0x2e89('0xb1')](_0x22e60a);if(_0x22e60a['dialRecallInQueue']){_0x48ebad[_0x2e89('0xb9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3db306[_0x2e89('0xfa')],'ListId':_0x3db306['ListId'],'VoiceQueueId':_0x3db306[_0x2e89('0xcc')]||undefined,'CampaignId':_0x3db306['CampaignId']||undefined})[_0x2e89('0xac')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x48ebad[_0x2e89('0xd6')](createObjHistory(_0x22e60a,_0x3db306,_0x2e89('0x1eb'),0x17,_0x2e89('0x1ec')))[_0x2e89('0xac')](loggerCatch(_0x2e89('0x1ed')));}else{_0x48ebad[_0x2e89('0xd5')](createObjHistory(_0x22e60a,_0x3db306,_0x2e89('0x1ee'),0x16,_0x2e89('0x1ef')),'[Originate][HistoryRecallClose][historyCatch]',_0x2e89('0x1f0'));}}}}else{_0x22e60a[_0x2e89('0x1f1')]+=0x1;_0x48ebad['saveInDb'](createObjHistory(_0x22e60a,_0x3db306,_0x2e89('0x1f2'),0xd,_0x2e89('0x1f3')),_0x2e89('0x1f4'),_0x2e89('0x1f5'));throw _0x2e89('0x1f6');}};};Dialer[_0x2e89('0x1c')][_0x2e89('0x15e')]=function(_0x28c7e8){var _0x525e11=this;var _0x28dc87=_0x28c7e8[_0x2e89('0x1f7')]-_0x28c7e8[_0x2e89('0x73')]-_0x28c7e8['temp'];emitCampaignSummary(_0x28c7e8);if(_0x28dc87>0x0){if(_0x28dc87>this['maxNumberOriginate']){_0x28dc87=this[_0x2e89('0x25')];}_0x28c7e8['temp']+=_0x28dc87;this[_0x2e89('0x1f8')](_0x28c7e8['id'],_0x28dc87,_0x28c7e8[_0x2e89('0x1f9')],_0x28c7e8)['then'](function(_0x32abce){_0x28c7e8[_0x2e89('0xbe')]-=_0x28dc87;_0x28c7e8['temp']=_0x28c7e8[_0x2e89('0xbe')]>0x0?_0x28c7e8['temp']:0x0;if(!checkContactEmpty(_0x32abce)){_0x28c7e8['message']=_0x2e89('0x9b');logger[_0x2e89('0x7b')]('[getContactCampaign2][Empty]'+_0x28c7e8['name']);}else{_0x28c7e8[_0x2e89('0x73')]+=_0x32abce[_0x2e89('0x95')];_0x28c7e8[_0x2e89('0x3d')]=_0x2e89('0x1fa');for(var _0x342f69=0x0;_0x342f69<_0x32abce[_0x2e89('0x95')];_0x342f69+=0x1){_0x28c7e8[_0x2e89('0x1fb')]+=0x1;if(_[_0x2e89('0xd8')](_0x32abce[_0x342f69])||_[_0x2e89('0xd8')](_0x32abce[_0x342f69]['Contact'])||_[_0x2e89('0xd8')](_0x32abce[_0x342f69][_0x2e89('0x168')]['phone'])){_0x525e11[_0x2e89('0xc7')](_0x2e89('0x1fc'),_0x28c7e8,_0x32abce[_0x342f69]);}else{_0x525e11[_0x2e89('0xb5')](_[_0x2e89('0xc9')](_0x32abce[_0x342f69],[_0x2e89('0xcd'),_0x2e89('0x1fd')]))[_0x2e89('0x3a')](_0x525e11[_0x2e89('0x1df')](_0x28c7e8,_0x32abce[_0x342f69]))[_0x2e89('0xac')](_0x525e11[_0x2e89('0xc6')](_0x2e89('0x1fe'),_0x28c7e8));}}}})['catch'](loggerGetContactDialer(_0x2e89('0x1ff'),_0x28c7e8,_0x28dc87));}};Dialer[_0x2e89('0x1c')][_0x2e89('0x156')]=function(_0x4ecb86,_0x2951da){var _0x2a7e8e=this;var _0x521dcd=[];var _0x10b3ed=_0x2951da>=0x1?_0x2951da:0x1;if(_0x4ecb86['dialMethod']===_0x2e89('0x1e1')){_0x10b3ed=0x1;}var _0x2aae69=Math['floor'](_0x4ecb86[_0x2e89('0x50')]*_0x10b3ed)-_0x4ecb86[_0x2e89('0x73')]-_0x4ecb86['temp'];emitVoiceQueueSummary(_0x4ecb86);if(_0x4ecb86['dialLimitQueue']>0x0){var _0xe70d5a=_0x4ecb86['dialLimitQueue']-_0x4ecb86['originated']-_0x4ecb86['talking']-_0x4ecb86[_0x2e89('0xbe')]-_0x4ecb86[_0x2e89('0x51')];if(_0x2aae69>_0xe70d5a){_0x2aae69=_0xe70d5a;}}if(_0x2aae69>0x0){if(_0x4ecb86[_0x2e89('0x5a')]==='booked'){_0x2aae69=0x1;}if(_0x2aae69>this[_0x2e89('0x25')]){_0x2aae69=this['maxNumberOriginate'];}_0x4ecb86[_0x2e89('0xbe')]+=_0x2aae69;for(var _0x41d383 in this[_0x2e89('0x23')]){if(typeof this[_0x2e89('0x23')][_0x41d383]!==_0x2e89('0x96')){if(this['agents'][_0x41d383][_0x2e89('0xa3')]===_0x2e89('0x200')&&this[_0x2e89('0x23')][_0x41d383][_0x2e89('0xd2')]==='reachable'){_0x521dcd[_0x2e89('0x12a')](this[_0x2e89('0x23')][_0x41d383]['id']);}}}this['getContactDialer'](_0x4ecb86['id'],_0x521dcd,_0x2aae69,_0x4ecb86['dialOrderByScheduledAt'],_0x4ecb86)[_0x2e89('0x3a')](function(_0x578c8c){_0x4ecb86['temp']-=_0x2aae69;_0x4ecb86[_0x2e89('0xbe')]=_0x4ecb86[_0x2e89('0xbe')]>0x0?_0x4ecb86[_0x2e89('0xbe')]:0x0;if(!checkContactEmpty(_0x578c8c)){_0x2a7e8e[_0x2e89('0xb2')](_0x4ecb86)['then'](sendMessageReschedule(_0x4ecb86))[_0x2e89('0xac')](loggerCatch(_0x2e89('0x201')));}else{_0x4ecb86[_0x2e89('0x73')]+=_0x578c8c[_0x2e89('0x95')];_0x4ecb86[_0x2e89('0x3d')]=_0x4ecb86[_0x2e89('0x5a')]==='booked'?_0x2e89('0x170'):'RUNNING';for(var _0x3b65e5=0x0;_0x3b65e5<_0x578c8c[_0x2e89('0x95')];_0x3b65e5+=0x1){if(_[_0x2e89('0xd8')](_0x578c8c[_0x3b65e5])||_['isNil'](_0x578c8c[_0x3b65e5][_0x2e89('0x168')])||_[_0x2e89('0xd8')](_0x578c8c[_0x3b65e5][_0x2e89('0x168')][_0x2e89('0x169')])){_0x2a7e8e[_0x2e89('0xc7')](_0x2e89('0x1fc'),_0x4ecb86,_0x578c8c[_0x3b65e5]);}else{_0x2a7e8e[_0x2e89('0xb4')](_[_0x2e89('0xc9')](_0x578c8c[_0x3b65e5],['VoiceQueueId',_0x2e89('0x1fd')]))[_0x2e89('0x3a')](_0x2a7e8e[_0x2e89('0x1df')](_0x4ecb86,_0x578c8c[_0x3b65e5]))[_0x2e89('0xac')](_0x2a7e8e[_0x2e89('0xc6')](_0x2e89('0x1fc'),_0x4ecb86));}}}})[_0x2e89('0xac')](loggerGetContactDialer('[getContactDialer2]',_0x4ecb86,_0x2aae69));}};Dialer[_0x2e89('0x1c')][_0x2e89('0x8d')]=function(_0x5dbf6e){if(_0x5dbf6e['dialLimitQueue']>0x0){var _0x1dede5=_0x5dbf6e[_0x2e89('0x202')]-_0x5dbf6e[_0x2e89('0x73')]-_0x5dbf6e['talking'];if(_0x1dede5>0x0){this[_0x2e89('0x203')](_0x5dbf6e);}else{loggerPredictiveCalls[_0x2e89('0x7b')](_0x2e89('0x204'));}}else{this[_0x2e89('0x203')](_0x5dbf6e);}};Dialer[_0x2e89('0x1c')]['tryOriginatePredictive']=function(_0x4f6fe5){var _0x1921f3=this;var _0x5ac21d=[];_0x4f6fe5[_0x2e89('0x73')]+=0x1;for(var _0x40a3af in this[_0x2e89('0x23')]){if(typeof this[_0x2e89('0x23')][_0x40a3af]!=='undefined'){if(this['agents'][_0x40a3af][_0x2e89('0xa3')]===_0x2e89('0x200')&&this[_0x2e89('0x23')][_0x40a3af][_0x2e89('0xd2')]===_0x2e89('0xd3')){_0x5ac21d['push'](this[_0x2e89('0x23')][_0x40a3af]['id']);}}}this[_0x2e89('0xbd')](_0x4f6fe5['id'],_0x5ac21d,0x1,_0x4f6fe5[_0x2e89('0x1f9')],_0x4f6fe5)[_0x2e89('0x3a')](function(_0x3b3ac5){if(!checkContactEmpty(_0x3b3ac5)){checkContactLowerLimitOriginate(_0x4f6fe5,0x1,0x0);_0x1921f3[_0x2e89('0xb2')](_0x4f6fe5)[_0x2e89('0x3a')](sendMessageReschedule(_0x4f6fe5))[_0x2e89('0xac')](loggerCatch(_0x2e89('0x201')));}else{_0x4f6fe5[_0x2e89('0x3d')]=_0x2e89('0x1fa');if(_['isNil'](_0x3b3ac5[0x0])||_[_0x2e89('0xd8')](_0x3b3ac5[0x0]['Contact'])||_[_0x2e89('0xd8')](_0x3b3ac5[0x0][_0x2e89('0x168')][_0x2e89('0x169')])){_0x1921f3['emptyContact'](_0x2e89('0x1fc'),_0x4f6fe5,_0x3b3ac5[0x0]);}else{_0x1921f3[_0x2e89('0xb4')](_[_0x2e89('0xc9')](_0x3b3ac5[0x0],['VoiceQueueId',_0x2e89('0x1fd')]))[_0x2e89('0x3a')](_0x1921f3[_0x2e89('0x1df')](_0x4f6fe5,_0x3b3ac5[0x0]))[_0x2e89('0xac')](_0x1921f3['loggerHandler'](_0x2e89('0x205'),_0x4f6fe5));}}})['catch'](loggerGetContactDialer(_0x2e89('0x206'),_0x4f6fe5,0x1));emitVoiceQueueSummary(_0x4f6fe5);};Dialer[_0x2e89('0x1c')][_0x2e89('0x1d3')]=function(_0x498c50,_0x3a4d19,_0x4bc409,_0x3664c8,_0x256f7a,_0x1ba464){loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x207'));loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x208'),_0x498c50);loggerPredictive[_0x2e89('0x7b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a4d19);loggerPredictive['info']('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',_0x4bc409);loggerPredictive[_0x2e89('0x7b')]('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',_0x3664c8);loggerPredictive['info'](_0x2e89('0x209'),_0x256f7a);loggerPredictive['info'](_0x2e89('0x80'));return new BPromise(function(_0x3bcd4d,_0x2b5af0){if(_0x498c50<=0x0||isNaN(_0x498c50)){return _0x2b5af0(msgResponse(_0x2e89('0x20a'),_0x2e89('0x48'),'m\x20=\x20'+_0x498c50));}if(_0x4bc409<=0x0||isNaN(_0x4bc409)){return _0x2b5af0(msgResponse(_0x2e89('0x20a'),'Error',_0x2e89('0x20b')+_0x4bc409));}if(_0x3664c8<=0x0||isNaN(_0x3664c8)){return _0x2b5af0(msgResponse(_0x2e89('0x20a'),'Error',_0x2e89('0x20c')+_0x3664c8));}if(_0x3a4d19<=0x0||isNaN(_0x3a4d19)){return _0x2b5af0(msgResponse(_0x2e89('0x20a'),_0x2e89('0x48'),_0x2e89('0x20d')+_0x3a4d19));}if(_0x256f7a<=0x0||isNaN(_0x256f7a)){return _0x2b5af0(msgResponse(_0x2e89('0x20a'),'Error',_0x2e89('0x20e')+_0x256f7a));}_0x1ba464=_0x1ba464||0x0;var _0x50599e=0x1/_0x4bc409;var _0x3cae82=0x0;var _0x2e8f2d=0x0;var _0x48e03a=0x0;var _0x365b63=0x0;for(var _0x3ea914=0x0;_0x48e03a<_0x256f7a;_0x3ea914+=0x1){_0x2e8f2d=_0x3ea914/_0x3a4d19;_0x3cae82=(_0x3664c8*_0x2e8f2d+_0x1ba464)/_0x50599e;_0x48e03a=erlangb(_0x3cae82,_0x498c50);_0x365b63=_0x3cae82/_0x498c50*(0x1-erlangb(_0x3cae82,_0x498c50));}return _0x3bcd4d({'erlangCalls':_0x3ea914,'erlangCallToSecond':_0x3a4d19/_0x3ea914,'erlangAbandonmentRate':_0x48e03a,'erlangBusyFactor':_0x365b63});});};Dialer[_0x2e89('0x1c')][_0x2e89('0x1d4')]=function(_0x46d76f,_0x1ba25a,_0x4fff6c,_0x443985,_0x48d196,_0x38dee0){loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x20f'));loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x208'),_0x46d76f);loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x210'),_0x1ba25a);loggerPredictive['info'](_0x2e89('0x211'),_0x4fff6c);loggerPredictive['info'](_0x2e89('0x212'),_0x443985);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x48d196);loggerPredictive[_0x2e89('0x7b')](_0x2e89('0x80'));return new BPromise(function(_0x50af44,_0x247421){if(_0x46d76f<=0x0||isNaN(_0x46d76f)){return _0x247421(msgResponse(_0x2e89('0x213'),_0x2e89('0x48'),_0x2e89('0x214')+_0x46d76f));}if(_0x4fff6c<=0x0||isNaN(_0x4fff6c)){return _0x247421(msgResponse(_0x2e89('0x213'),_0x2e89('0x48'),_0x2e89('0x20b')+_0x4fff6c));}if(_0x443985<=0x0||isNaN(_0x443985)){return _0x247421(msgResponse(_0x2e89('0x213'),_0x2e89('0x48'),_0x2e89('0x20c')+_0x443985));}if(_0x1ba25a<=0x0||isNaN(_0x1ba25a)){return _0x247421(msgResponse(_0x2e89('0x213'),_0x2e89('0x48'),_0x2e89('0x20d')+_0x1ba25a));}if(_0x48d196<=0x0||isNaN(_0x48d196)){return _0x247421(msgResponse(_0x2e89('0x213'),'Error','Umin\x20=\x20'+_0x48d196));}_0x38dee0=_0x38dee0||0x0;var _0x236998=0x1/_0x4fff6c;var _0x28fae5=0x0;var _0x5adef9=0x0;var _0x547b0e=0x0;var _0x6da4c7=0x0;for(var _0x1fb1aa=0x0;_0x6da4c7<_0x48d196;_0x1fb1aa+=0x1){_0x5adef9=_0x1fb1aa/_0x1ba25a;_0x28fae5=(_0x443985*_0x5adef9+_0x38dee0)/_0x236998;_0x547b0e=erlangb(_0x28fae5,_0x46d76f);_0x6da4c7=_0x28fae5/_0x46d76f*(0x1-erlangb(_0x28fae5,_0x46d76f));}return _0x50af44({'erlangCalls':_0x1fb1aa,'erlangCallToSecond':_0x1ba25a/_0x1fb1aa,'erlangAbandonmentRate':_0x547b0e,'erlangBusyFactor':_0x6da4c7});});};module[_0x2e89('0x215')]=Dialer; \ No newline at end of file +var _0xd3f7=['newexten','syncNewExten','varset','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','stringify','milliseconds','seconds','type','outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangBusyFactor','Trunk','active','callerid','format','campaign:ivr:%s','campaign:save','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','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','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','is\x20not\x20active','state','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','channel','catch','No\x20such\x20channel','ivr','updateOriginated','voiceQueues','queue','[Dialer][checkChannel]','resolve','countReScheduled','checkIsBlackList','checkIsBlackListIvr','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','[createHistory]\x20','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','SIP/%s','status','createHistory','syncVarSet','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','emit','buildObj','[syncHangupInAMD]','Machine','countmachineretry','countglobal','custom:amd','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','add','dialMachineRetryFrequency','ListId','VoiceQueueId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countdropretry','dialGlobalMaxRetry','dialMachineMaxRetry','minutes','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AGI','[syncHangupIvr]','outboundUnknownCallsDay','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','roundrobin','paused','stateinterface','locked','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','idHopper','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','run','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','Action','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','power','dialPowerLevel','predictive','booked','checkPreviewRecallReminder','handlePreviewRecallNotifications','user:dialPreviewRecallReminder','handleIvr','dialGlobalInterval','[syncQueueSummary]','dialTimezone','launchHandleIvr','pow','replace','random','match','actionOriginate','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originate][error]','originate\x20action\x20Error','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','createStateFinal','reason\x200\x20no\x20such\x20number....','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','dialAbandonedMaxRetry','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','dialPredictiveInterval','started\x20in\x20predictive\x20at','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','getDataPredictive','predictiveIntervalHitRate','dialPredictiveOptimizationPercentage','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Error','m\x20=\x20','Ts\x20=\x20','Amax\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','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/logger','dialer','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','rrmemory','prototype','enqueue','tail','finally','sequence','campaigns','agents','trunks','maxNumberOriginate','channels','actions','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','bind','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup'];(function(_0x146034,_0x22816a){var _0x4b21a5=function(_0x115021){while(--_0x115021){_0x146034['push'](_0x146034['shift']());}};_0x4b21a5(++_0x22816a);}(_0xd3f7,0x1e9));var _0x7d3f=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xd3f7[_0x55e08b];return _0xd1a7ff;};'use strict';var util=require(_0x7d3f('0x0'));var _=require(_0x7d3f('0x1'));var BPromise=require('bluebird');var uuid=require(_0x7d3f('0x2'));var moment=require(_0x7d3f('0x3'));var rr=require('rr');var md5=require(_0x7d3f('0x4'));var Redis=require(_0x7d3f('0x5'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x7d3f('0x6'))(_0x7d3f('0x7'));var loggerBooked=require(_0x7d3f('0x6'))('booked');var loggerPredictive=require(_0x7d3f('0x6'))('predictive');var loggerPredictiveCalls=require(_0x7d3f('0x6'))(_0x7d3f('0x8'));var loggerSyncQueueSummary=require(_0x7d3f('0x6'))(_0x7d3f('0x9'));var ami=require(_0x7d3f('0xa'));config['redis']=_['defaults'](config[_0x7d3f('0xb')],{'host':_0x7d3f('0xc'),'port':0x18eb});var io=require(_0x7d3f('0xd'))(new Redis(config[_0x7d3f('0xb')]));var cmHopper=require(_0x7d3f('0xe'));var cmHopperHistory=require(_0x7d3f('0xf'));var cmHopperBlack=require(_0x7d3f('0x10'));var voiceQueueRt=require(_0x7d3f('0x11'));var RpcSetting=require(_0x7d3f('0x12'));var Action=require(_0x7d3f('0x13'));var History=require(_0x7d3f('0x14'));var Final=require(_0x7d3f('0x15'));var AgentComplete=require(_0x7d3f('0x16'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x7d3f('0x17'));var ipAgi=process[_0x7d3f('0x18')][_0x7d3f('0x19')]||'127.0.0.1';var strategy={'rrmemory':_0x7d3f('0x1a'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x7d3f('0x1b')][_0x7d3f('0x1c')]=function(_0x557ab9){this[_0x7d3f('0x1d')]=this[_0x7d3f('0x1d')]?this[_0x7d3f('0x1d')][_0x7d3f('0x1e')](_0x557ab9):_0x557ab9();};function Dialer(_0x43dae2,_0xdfa04){this[_0x7d3f('0x1f')]=new Sequence();this['preview']=_0xdfa04;this['voiceQueues']=_0x43dae2['voiceQueues'];this[_0x7d3f('0x20')]=_0x43dae2[_0x7d3f('0x20')];this[_0x7d3f('0x21')]=_0x43dae2[_0x7d3f('0x21')];this[_0x7d3f('0x22')]=_0x43dae2['trunks'];this['maxNumberOriginate']=config[_0x7d3f('0x23')]||0x2;this[_0x7d3f('0x24')]={};this[_0x7d3f('0x25')]={};this['contactsId']={};this['uniqueId']={};this[_0x7d3f('0x26')]={};this[_0x7d3f('0x27')]={};this[_0x7d3f('0x28')]={};this['ivrOriginated']={};this[_0x7d3f('0x29')]={};this[_0x7d3f('0x2a')]={};ami['on'](_0x7d3f('0x2b'),this['syncAgentConnect'][_0x7d3f('0x2c')](this));ami['on']('queuecallerabandon',this[_0x7d3f('0x2d')][_0x7d3f('0x2c')](this));ami['on']('originateresponse',this[_0x7d3f('0x2e')][_0x7d3f('0x2c')](this));ami['on'](_0x7d3f('0x2f'),this[_0x7d3f('0x30')][_0x7d3f('0x2c')](this));ami['on'](_0x7d3f('0x31'),this[_0x7d3f('0x9')][_0x7d3f('0x2c')](this));ami['on']('hangup',this[_0x7d3f('0x32')][_0x7d3f('0x2c')](this));ami['on'](_0x7d3f('0x33'),this[_0x7d3f('0x34')][_0x7d3f('0x2c')](this));ami['on'](_0x7d3f('0x35'),this['syncVarSet'][_0x7d3f('0x2c')](this));ami['on']('queuemember',this[_0x7d3f('0x36')][_0x7d3f('0x2c')](this));ami['on'](_0x7d3f('0x37'),this['syncQueueStatusComplete'][_0x7d3f('0x2c')](this));this[_0x7d3f('0x38')]();this[_0x7d3f('0x39')]();RpcSetting[_0x7d3f('0x3a')]()[_0x7d3f('0x3b')](function(_0x4bd466){previewRecallmeReminderInterval=_0x4bd466[_0x7d3f('0x3c')];});}function isNotNull(_0x165ffd){return _0x165ffd!==null&&!_[_0x7d3f('0x3d')](_0x165ffd);}function checkIsLoggedIn(_0x1030cf,_0x450188){return function(){if(_0x450188<=0x0){_0x1030cf[_0x7d3f('0x3e')]=_0x7d3f('0x3f');throw _0x1030cf[_0x7d3f('0x40')]+_0x7d3f('0x41');}};}function isActive(_0x2e2e30){return _0x2e2e30;}function checkIsActive(_0x53648f,_0x1b5a76){return function(){if(!isActive(_0x1b5a76)){_0x53648f[_0x7d3f('0x3e')]='NOT_ACTIVE';throw _0x53648f[_0x7d3f('0x40')]+'\x20NOT\x20Active';}};}function checkInterval(_0x53069f){return function(){if(!isNotNull(_0x53069f[_0x7d3f('0x42')])){_0x53069f[_0x7d3f('0x3e')]=_0x7d3f('0x43');throw _0x53069f[_0x7d3f('0x40')]+_0x7d3f('0x44');}if(!isNotNull(_0x53069f[_0x7d3f('0x42')][_0x7d3f('0x45')])){_0x53069f[_0x7d3f('0x3e')]=_0x7d3f('0x43');throw _0x53069f[_0x7d3f('0x40')]+_0x7d3f('0x44');}if(!isNotNull(_[_0x7d3f('0x46')](_0x53069f[_0x7d3f('0x42')][_0x7d3f('0x45')]))){_0x53069f[_0x7d3f('0x3e')]=_0x7d3f('0x43');throw _0x53069f[_0x7d3f('0x40')]+_0x7d3f('0x44');}};}function msgResponse(_0xe64dbb,_0x47653d,_0x3f5cb2){return{'action':_0xe64dbb,'response':_0x47653d,'message':_0x3f5cb2,'stack':_0x3f5cb2};}function myreject(_0x167751){return function(_0x46b852){return _0x167751(msgResponse('[ifTime][Action]','Error',JSON[_0x7d3f('0x47')](_0x46b852)));};}function getSeconds(_0x523114,_0xe04d62){var _0x4d2736=moment(_0x523114)[_0x7d3f('0x48')](0x0);var _0x228f3c=moment(_0xe04d62)[_0x7d3f('0x48')](0x0);return _0x4d2736['diff'](_0x228f3c,_0x7d3f('0x49'));}function emit(_0x303faa,_0x4d930a,_0x273692){io['to'](_0x303faa)['emit'](_0x4d930a,_0x273692);}function emitVoiceQueueSummary(_0x5364b8){if(_0x5364b8[_0x7d3f('0x4a')]===_0x7d3f('0x4b')){var _0x2e56e3={'id':_0x5364b8['id'],'name':_0x5364b8[_0x7d3f('0x40')],'strategy':_0x5364b8[_0x7d3f('0x4c')],'answered':_0x5364b8[_0x7d3f('0x4d')],'available':_0x5364b8['available'],'loggedIn':_0x5364b8[_0x7d3f('0x4e')],'pTalking':_0x5364b8[_0x7d3f('0x4f')],'sumBillable':_0x5364b8[_0x7d3f('0x50')],'sumDuration':_0x5364b8[_0x7d3f('0x51')],'sumHoldTime':_0x5364b8[_0x7d3f('0x52')]||0x0,'talking':_0x5364b8[_0x7d3f('0x53')],'total':_0x5364b8[_0x7d3f('0x54')],'type':_0x5364b8[_0x7d3f('0x4a')],'unmanaged':_0x5364b8[_0x7d3f('0x55')],'abandoned':_0x5364b8['abandoned'],'waiting':_0x5364b8['waiting'],'loggedInDb':_0x5364b8[_0x7d3f('0x56')],'dialActive':_0x5364b8[_0x7d3f('0x57')],'dialMethod':_0x5364b8[_0x7d3f('0x58')],'dialOriginateCallerIdName':_0x5364b8[_0x7d3f('0x59')],'dialOriginateCallerIdNumber':_0x5364b8[_0x7d3f('0x5a')],'dialOriginateTimeout':_0x5364b8[_0x7d3f('0x5b')],'dialPrefix':_0x5364b8[_0x7d3f('0x5c')],'outboundAnswerAgiCallsDay':_0x5364b8[_0x7d3f('0x5d')],'outboundAnswerCallsDay':_0x5364b8[_0x7d3f('0x5e')],'outboundBlacklistCallsDay':_0x5364b8['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x5364b8[_0x7d3f('0x5f')],'outboundCongestionCallsDay':_0x5364b8[_0x7d3f('0x60')],'outboundDropCallsDayACS':_0x5364b8['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x5364b8[_0x7d3f('0x61')],'outboundDropCallsDayTimeout':_0x5364b8[_0x7d3f('0x62')],'outboundNoAnswerCallsDay':_0x5364b8[_0x7d3f('0x63')],'outboundNoSuchCallsDay':_0x5364b8[_0x7d3f('0x64')],'outboundOriginateFailureCallsDay':_0x5364b8['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5364b8[_0x7d3f('0x65')],'outboundRejectCallsDay':_0x5364b8[_0x7d3f('0x66')],'outboundUnknownCallsDay':_0x5364b8['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x5364b8[_0x7d3f('0x67')],'predictiveIntervalAvgHoldtime':_0x5364b8['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x5364b8['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x5364b8['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x5364b8[_0x7d3f('0x68')],'predictiveIntervalErlangCalls':_0x5364b8[_0x7d3f('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0x5364b8[_0x7d3f('0x6a')],'predictiveIntervalHitRate':_0x5364b8['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x5364b8[_0x7d3f('0x6b')],'predictiveIntervalPauses':_0x5364b8[_0x7d3f('0x6c')],'predictiveIntervalAvailable':_0x5364b8[_0x7d3f('0x6d')],'predictiveIntervalTotalCalls':_0x5364b8[_0x7d3f('0x6e')],'message':_0x5364b8[_0x7d3f('0x3e')],'originated':_0x5364b8[_0x7d3f('0x6f')],'erlangCalls':_0x5364b8[_0x7d3f('0x70')],'erlangCallToSecond':_0x5364b8['erlangCallToSecond'],'erlangAbandonmentRate':_0x5364b8['erlangAbandonmentRate'],'erlangBusyFactor':_0x5364b8[_0x7d3f('0x71')],'startPredictive':_0x5364b8[_0x7d3f('0x27')],'startProgressive':_0x5364b8[_0x7d3f('0x28')]};if(_0x5364b8[_0x7d3f('0x72')]){_0x2e56e3[_0x7d3f('0x72')]={'id':_0x5364b8['Trunk']['id'],'name':_0x5364b8[_0x7d3f('0x72')][_0x7d3f('0x40')],'active':_0x5364b8[_0x7d3f('0x72')][_0x7d3f('0x73')],'callerid':_0x5364b8['Trunk'][_0x7d3f('0x74')]};}if(_0x5364b8['Interval']){_0x2e56e3[_0x7d3f('0x42')]={'id':_0x5364b8[_0x7d3f('0x42')]['id'],'name':_0x5364b8[_0x7d3f('0x42')]['name']};}var _0x53cf05=md5(JSON[_0x7d3f('0x47')](_0x2e56e3));if(_0x5364b8[_0x7d3f('0x4')]!==_0x53cf05){_0x5364b8[_0x7d3f('0x4')]=_0x53cf05;emit(util[_0x7d3f('0x75')]('voice:queue:%s',_0x2e56e3[_0x7d3f('0x40')]),'voice_queue:save',_0x2e56e3);}}}function emitCampaignSummary(_0x35ba75){if(_0x35ba75[_0x7d3f('0x4a')]==='ivr'){emit(util['format'](_0x7d3f('0x76'),_0x35ba75[_0x7d3f('0x40')]),_0x7d3f('0x77'),_0x35ba75);}}function checkGetDataPredictive(_0x3c47c1){if(isNotNull(_0x3c47c1)&&!_['isEmpty'](_0x3c47c1)){loggerPredictive[_0x7d3f('0x78')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x7d3f('0x78')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c47c1[_0x7d3f('0x6e')]);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x79'),_0x3c47c1[_0x7d3f('0x67')]);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x7a'),_0x3c47c1[_0x7d3f('0x68')]);loggerPredictive[_0x7d3f('0x78')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c47c1[_0x7d3f('0x7b')]);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x7c'),_0x3c47c1[_0x7d3f('0x7d')]);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x7e'),_0x3c47c1[_0x7d3f('0x7f')]);loggerPredictive[_0x7d3f('0x78')]('---------------------------');if(_0x3c47c1['predictiveIntervalTotalCalls']>0x0){if(!_[_0x7d3f('0x3d')](_0x3c47c1['predictiveIntervalAvgTalktime'])&&_0x3c47c1[_0x7d3f('0x7f')]>0x0){return!![];}loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x80'));if(!_['isUndefined'](_0x3c47c1['predictiveIntervalAvgHoldtime'])&&_0x3c47c1[_0x7d3f('0x7d')]>0x0){return!![];}loggerPredictive[_0x7d3f('0x78')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x81'));}}else{loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x82'));}return![];}function mergeDataErlangB(_0x36dcd8){return function(_0x5c3555){loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x83'));loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x84'),_0x5c3555[_0x7d3f('0x70')]);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x85'),_0x5c3555['erlangCallToSecond']);loggerPredictive[_0x7d3f('0x78')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c3555[_0x7d3f('0x86')]);loggerPredictive[_0x7d3f('0x78')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c3555[_0x7d3f('0x71')]);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x87'),_0x5c3555[_0x7d3f('0x86')]);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x88'));_[_0x7d3f('0x89')](_0x36dcd8,_0x5c3555);};}function getDiff(_0xe6f9b5){var _0x4e4fcc=moment()[_0x7d3f('0x48')](0x0);var _0x5c4717=moment(_0xe6f9b5)[_0x7d3f('0x48')](0x0);return _0x4e4fcc['diff'](_0x5c4717,_0x7d3f('0x49'));}function ifInterval(_0x551b6c,_0x5db58e){if(_[_0x7d3f('0x3d')](_0x5db58e)){return![];}return getDiff(_0x5db58e)<_0x551b6c*0x3c;}function freeVariablesPredictive(_0x52d62e){if(isNotNull(_0x52d62e)){if(!_['isUndefined'](_0x52d62e[_0x7d3f('0x28')])){_0x52d62e[_0x7d3f('0x28')]=undefined;loggerPredictive[_0x7d3f('0x78')](_0x52d62e[_0x7d3f('0x40')],_0x7d3f('0x8a'));}if(!_[_0x7d3f('0x3d')](_0x52d62e['startPredictive'])){_0x52d62e[_0x7d3f('0x27')]=undefined;loggerPredictive[_0x7d3f('0x78')](_0x52d62e[_0x7d3f('0x40')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x7d3f('0x3d')](_0x52d62e[_0x7d3f('0x8b')])){clearInterval(_0x52d62e[_0x7d3f('0x8b')]);_0x52d62e[_0x7d3f('0x8b')]=undefined;loggerPredictive['info'](_0x52d62e[_0x7d3f('0x40')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x726fab,_0x1ddc4a){if(_0x1ddc4a===0x0){return 0x0;}var _0x316661=0x1;for(var _0x13b3dc=0x1;_0x13b3dc<=_0x1ddc4a;_0x13b3dc+=0x1){_0x316661=0x1+_0x316661*_0x13b3dc/_0x726fab;}return 0x1/_0x316661;}function isVoiceQueueOutbound(_0x5c786c){return _0x5c786c===_0x7d3f('0x4b');}function isNotPreview(_0x37e3b1){return _0x37e3b1!==_0x7d3f('0x8c');}function isCampaignIvr(_0x24c882){return _0x24c882==='ivr';}function getCallerId(_0x39c32d,_0x6d1fa9,_0x4a2687){if(!_[_0x7d3f('0x3d')](_0x4a2687)&&typeof _0x4a2687===_0x7d3f('0x8d')&&!_[_0x7d3f('0x46')](_0x4a2687)){if(!_[_0x7d3f('0x3d')](_0x6d1fa9)&&typeof _0x6d1fa9===_0x7d3f('0x8d')&&!_['isEmpty'](_0x6d1fa9)){return util[_0x7d3f('0x75')]('\x22%s\x22\x20<%s>',_0x6d1fa9,_0x4a2687);}return util[_0x7d3f('0x75')](_0x7d3f('0x8e'),_0x4a2687,_0x4a2687);}if(!_['isUndefined'](_0x39c32d)&&typeof _0x39c32d==='string'&&!_[_0x7d3f('0x46')](_0x39c32d)){return _0x39c32d;}return _0x7d3f('0x8f');}function loggerCatchQueueSummary(_0x4b0b52,_0x53d927){return function(_0x262945){freeVariablesPredictive(_0x53d927);emitVoiceQueueSummary(_0x53d927);emitCampaignSummary(_0x53d927);loggerSyncQueueSummary[_0x7d3f('0x90')](_0x4b0b52,util[_0x7d3f('0x91')](_0x262945,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x162b4e,_0xd76c72){return function(_0xc703ba){loggerPredictive[_0x7d3f('0x90')](_0xd76c72['name'],_0x162b4e);loggerPredictive[_0x7d3f('0x90')](_0xc703ba[_0x7d3f('0x92')]);freeVariablesPredictive(_0xd76c72);};}function loggerCatch(_0x45f205){return function(_0x3bdd50){logger['error'](_0x45f205,util['inspect'](_0x3bdd50,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x236873){return _0x236873&&!_[_0x7d3f('0x3d')](_0x236873)&&_0x236873[_0x7d3f('0x93')]>0x0;}function decremetOriginate(_0x21df2f){if(!_[_0x7d3f('0x3d')](_0x21df2f)&&_0x21df2f!==null){if(typeof _0x21df2f['originated']!==_0x7d3f('0x94')){if(_0x21df2f[_0x7d3f('0x6f')]>0x0){_0x21df2f[_0x7d3f('0x6f')]-=0x1;}else{logger['error'](_0x7d3f('0x95'));}}}else{logger[_0x7d3f('0x90')](_0x7d3f('0x96'));}}function checkContactLowerLimitOriginate(_0x403906,_0x4609b9,_0x1700d2){if(_0x4609b9>_0x1700d2){for(var _0x1ed421=0x0;_0x1ed421<_0x4609b9-_0x1700d2;_0x1ed421+=0x1){decremetOriginate(_0x403906);}}}function loggerGetContactDialer(_0x427c10,_0x41cee5,_0x45e555){return function(_0x3f1527){checkContactLowerLimitOriginate(_0x41cee5,_0x45e555,0x0);logger[_0x7d3f('0x90')](_0x427c10,util[_0x7d3f('0x91')](_0x3f1527,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3aa1f2){return function(_0x30f935){if(isNotNull(_0x30f935)&&isNotNull(_0x30f935[0x0])){if(_0x30f935[0x0][_0x7d3f('0x97')]>0x0){_0x3aa1f2['message']=_0x7d3f('0x98');logger[_0x7d3f('0x78')](_0x7d3f('0x99')+_0x3aa1f2['name'],_0x30f935[0x0][_0x7d3f('0x97')],_0x7d3f('0x9a'));}else{_0x3aa1f2[_0x7d3f('0x3e')]=_0x7d3f('0x9b');logger[_0x7d3f('0x78')](_0x7d3f('0x9c')+_0x3aa1f2['name']);}}};}function notSendMessagesQueue(_0x272b23){if(_0x272b23[_0x7d3f('0x9d')]){freeVariablesPredictive(_0x272b23);if(_0x272b23['originated']===0x0&&_0x272b23[_0x7d3f('0x53')]===0x0&&_0x272b23[_0x7d3f('0x9e')]===0x0&&(_0x272b23[_0x7d3f('0x4f')]||0x0)===0x0){_0x272b23[_0x7d3f('0x9d')]=![];_0x272b23['available']=0x0;_0x272b23[_0x7d3f('0x3e')]=_0x7d3f('0x9f');loggerSyncQueueSummary[_0x7d3f('0x90')](_0x7d3f('0xa0'),_0x272b23[_0x7d3f('0x40')],'is\x20not\x20active');}else{_0x272b23[_0x7d3f('0x3e')]=_0x7d3f('0xa1');loggerSyncQueueSummary[_0x7d3f('0x90')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x272b23[_0x7d3f('0x40')],_0x7d3f('0xa2'));}emitVoiceQueueSummary(_0x272b23);}}function notSendMessagesCampaign(_0x48922c){if(_0x48922c[_0x7d3f('0x9d')]){if(_0x48922c[_0x7d3f('0x6f')]===0x0){_0x48922c[_0x7d3f('0x9d')]=![];_0x48922c['message']=_0x7d3f('0x9f');loggerSyncQueueSummary[_0x7d3f('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x48922c['name'],_0x7d3f('0xa3'));}else{_0x48922c[_0x7d3f('0x3e')]=_0x7d3f('0xa1');loggerSyncQueueSummary[_0x7d3f('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x48922c[_0x7d3f('0x40')],'is\x20disactive');}emitCampaignSummary(_0x48922c);}}function createObjHistory(_0x120bed,_0x52f95d,_0x314dae,_0x2ca8f4,_0x73f60d){_0x120bed[_0x7d3f('0x3e')]=_0x314dae;var _0x2f75db=new Action(_0x120bed,_0x52f95d);var _0x5d3521=new History(_0x2f75db);_0x5d3521[_0x7d3f('0xa4')]=_0x2ca8f4;_0x5d3521[_0x7d3f('0xa5')]=_0x73f60d;_0x5d3521[_0x7d3f('0xa6')]=_0x2f75db[_0x7d3f('0xa7')];return _0x5d3521;}Dialer[_0x7d3f('0x1b')][_0x7d3f('0x39')]=function(){var _0x18a079=this;setInterval(function(){_0x18a079[_0x7d3f('0xa8')](_0x18a079[_0x7d3f('0xa9')],_0x7d3f('0xaa'));_0x18a079[_0x7d3f('0xa8')](_0x18a079['actions'],_0x7d3f('0xab'));},0x32c8);};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xa8')]=function(_0x2b65e3,_0x94ff99){var _0x146a7e=this;for(var _0x2e32d0 in _0x2b65e3){if(typeof _0x2b65e3[_0x2e32d0]!==_0x7d3f('0x94')){this[_0x7d3f('0x1f')][_0x7d3f('0x1c')](function(){if(!_['isNil'](_0x2b65e3[_0x2e32d0])){return ami['Action']({'action':'status','channel':_0x2b65e3[_0x2e32d0][_0x7d3f('0xac')]})[_0x7d3f('0xad')](function(_0x97dc9d){if(_0x97dc9d[_0x7d3f('0x3e')]===_0x7d3f('0xae')){setTimeout(function(){if(_0x2b65e3[_0x2e32d0]&&_0x2b65e3[_0x2e32d0][_0x7d3f('0x4a')]!==_0x7d3f('0xaf')){_0x146a7e[_0x7d3f('0xb0')](_0x146a7e[_0x7d3f('0xb1')][_0x2b65e3[_0x2e32d0][_0x7d3f('0xb2')]]);logger[_0x7d3f('0x90')](_0x7d3f('0xb3'),_0x94ff99,_0x2e32d0,_0x2b65e3[_0x2e32d0]['queue']);delete _0x2b65e3[_0x2e32d0];}if(_0x2b65e3[_0x2e32d0]&&_0x2b65e3[_0x2e32d0][_0x7d3f('0x4a')]===_0x7d3f('0xaf')){_0x146a7e['updateOriginated'](_0x146a7e[_0x7d3f('0x20')][_0x2b65e3[_0x2e32d0][_0x7d3f('0xb2')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x94ff99,_0x2e32d0,_0x2b65e3[_0x2e32d0][_0x7d3f('0xb2')]);delete _0x2b65e3[_0x2e32d0];}},0x2328);}});}});}}};Dialer[_0x7d3f('0x1b')]['countReScheduled']=function(_0xe979df){return BPromise[_0x7d3f('0xb4')]()[_0x7d3f('0x3b')](cmHopper[_0x7d3f('0xb5')](_0xe979df))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype']['checkIsBlackList']=function(_0x2a575d){return BPromise[_0x7d3f('0xb4')]()[_0x7d3f('0x3b')](cmHopperBlack[_0x7d3f('0xb6')](_0x2a575d))[_0x7d3f('0xad')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xb7')]=function(_0x214235){return BPromise['resolve']()[_0x7d3f('0x3b')](cmHopperBlack['checkIsBlackListIvr'](_0x214235))[_0x7d3f('0xad')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xb8')]=function(_0x3f6a00){return BPromise[_0x7d3f('0xb4')]()[_0x7d3f('0x3b')](cmHopperHistory[_0x7d3f('0xb9')](_0x3f6a00))[_0x7d3f('0xad')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0x7d3f('0xba')]=function(_0x309017){return BPromise['resolve']()[_0x7d3f('0x3b')](cmHopper['rescheduleContact'](_0x309017))[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0xbb')));};Dialer['prototype']['unlockContact']=function(_0x3480a1,_0x4fcf36,_0x461cbb){return BPromise[_0x7d3f('0xb4')]()[_0x7d3f('0x3b')](cmHopper['unlockContact'](_0x3480a1,_0x4fcf36,_0x461cbb))[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0xbc')));};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xbd')]=function(_0xb836d9,_0x19c634,_0x4a2470,_0x27a9e6,_0x10b4a5){return BPromise[_0x7d3f('0xb4')]()[_0x7d3f('0x3b')](cmHopper[_0x7d3f('0xbd')](_0xb836d9,_0x19c634,_0x4a2470,_0x27a9e6))[_0x7d3f('0xad')](function(_0x2af641){_0x10b4a5[_0x7d3f('0xbe')]-=_0x4a2470;_0x10b4a5['temp']=_0x10b4a5[_0x7d3f('0xbe')]>0x0?_0x10b4a5[_0x7d3f('0xbe')]:0x0;loggerCatch(_0x7d3f('0xbf'))(_0x2af641);});};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xc0')]=function(_0x27fab2,_0x5478a8,_0x336ee3,_0x20d51f){return BPromise[_0x7d3f('0xb4')]()[_0x7d3f('0x3b')](cmHopper[_0x7d3f('0xc0')](_0x27fab2,_0x5478a8,_0x336ee3))[_0x7d3f('0xad')](function(_0x4b51d5){_0x20d51f[_0x7d3f('0xbe')]-=_0x5478a8;_0x20d51f[_0x7d3f('0xbe')]=_0x20d51f['temp']>0x0?_0x20d51f[_0x7d3f('0xbe')]:0x0;loggerCatch(_0x7d3f('0xc1'))(_0x4b51d5);});};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xc2')]=function(_0x3abd3a){return BPromise[_0x7d3f('0xb4')]()[_0x7d3f('0x3b')](voiceQueueRt[_0x7d3f('0xc2')](_0x3abd3a))['catch'](loggerCatch(_0x7d3f('0xc3')));};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xc4')]=function(_0x2497a4){return BPromise[_0x7d3f('0xb4')]()[_0x7d3f('0x3b')](cmHopper[_0x7d3f('0xc4')](_0x2497a4))[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0xc5')));};Dialer[_0x7d3f('0x1b')]['createHistory']=function(_0x3eacde){return BPromise[_0x7d3f('0xb4')]()[_0x7d3f('0x3b')](cmHopperHistory['createHistory'](_0x3eacde))[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0xc6')));};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xb0')]=function(_0x13b65a){if(!_['isUndefined'](_0x13b65a)&&_0x13b65a!==null){if(typeof _0x13b65a[_0x7d3f('0x6f')]!==_0x7d3f('0x94')){if(_0x13b65a[_0x7d3f('0x6f')]>0x0){_0x13b65a['originated']-=0x1;}else{logger[_0x7d3f('0x90')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x7d3f('0x90')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xc7')]=function(_0x51d26e,_0x22da84){var _0x53df8c=this;return function(_0x522a43){_0x53df8c[_0x7d3f('0xb0')](_0x22da84);logger['error'](_0x51d26e,util[_0x7d3f('0x91')](_0x522a43,{'showHidden':![],'depth':null}));};};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xc8')]=function(_0x5976f9,_0x245644,_0x3a187c){var _0xa5b93e={'state':0x19,'statedesc':_0x7d3f('0xc9')};this[_0x7d3f('0xb0')](_0x245644);this[_0x7d3f('0xca')](_[_0x7d3f('0x89')](_0xa5b93e,_[_0x7d3f('0xcb')](_0x3a187c,[_0x7d3f('0xcc'),'ListId',_0x7d3f('0xcd'),'VoiceQueueId',_0x7d3f('0xce')])),_0x7d3f('0xcf'),_0x7d3f('0xd0'));logger[_0x7d3f('0x90')](_0x5976f9);};Dialer[_0x7d3f('0x1b')]['isSuccess']=function(_0x246e06){return _0x246e06===_0x7d3f('0xd1');};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xd2')]=function(_0x5ba5c3){return!_[_0x7d3f('0x3d')](_0x5ba5c3)&&_0x5ba5c3&&!_[_0x7d3f('0x3d')](_0x5ba5c3[_0x7d3f('0x40')])&&!_[_0x7d3f('0x3d')](_0x5ba5c3['active'])&&_0x5ba5c3[_0x7d3f('0x73')]&&(this[_0x7d3f('0x22')][util['format'](_0x7d3f('0xd3'),_0x5ba5c3[_0x7d3f('0x40')])][_0x7d3f('0xd4')]==='reachable'||this[_0x7d3f('0x22')][util[_0x7d3f('0x75')]('SIP/%s',_0x5ba5c3['name'])]['status']==='unmonitored');};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xca')]=function(_0x598480,_0x1a85fe,_0x213183){this[_0x7d3f('0xd5')](_0x598480)['catch'](loggerCatch(_0x1a85fe));this[_0x7d3f('0xc4')](_0x598480)[_0x7d3f('0xad')](loggerCatch(_0x213183));};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xd6')]=function(_0x3fdf30){var _0x52692e=this[_0x7d3f('0xa9')][_0x3fdf30[_0x7d3f('0xd7')]];var _0x500948;if(!_[_0x7d3f('0xd8')](_0x3fdf30)&&!_[_0x7d3f('0xd8')](_0x3fdf30[_0x7d3f('0xd9')])&&!_[_0x7d3f('0xd8')](_0x3fdf30[_0x7d3f('0xd9')][_0x7d3f('0xda')])&&_0x3fdf30[_0x7d3f('0xdb')]===_0x7d3f('0xdc')&&_0x52692e){if(_0x52692e[_0x7d3f('0x4a')]!==_0x7d3f('0xaf')&&this[_0x7d3f('0xb1')][_0x52692e['queue']][_0x7d3f('0xdd')]&&_0x3fdf30[_0x7d3f('0xde')]===_0x7d3f('0xdf')){delete this[_0x7d3f('0xa9')][_0x3fdf30[_0x7d3f('0xd7')]];this[_0x7d3f('0xb0')](this[_0x7d3f('0xb1')][_0x52692e['queue']]);this[_0x7d3f('0xb1')][_0x52692e[_0x7d3f('0xb2')]][_0x7d3f('0x5e')]+=0x1;this['voiceQueues'][_0x52692e[_0x7d3f('0xb2')]][_0x7d3f('0x5d')]+=0x1;_0x500948=new Hangup(_0x52692e,_0x3fdf30);_0x500948['state']=0x12;_0x500948['statedesc']=_0x7d3f('0xe0');_0x500948[_0x7d3f('0xe1')]=_0x7d3f('0xe2');ami[_0x7d3f('0xe3')]('custom:amd',ut[_0x7d3f('0xe4')](_0x500948,'amd'));this[_0x7d3f('0xca')](_0x500948,'[syncHangupInAMD][createHistory]',_0x7d3f('0xe5'));}if(_0x52692e[_0x7d3f('0x4a')]!==_0x7d3f('0xaf')&&this[_0x7d3f('0xb1')][_0x52692e[_0x7d3f('0xb2')]][_0x7d3f('0xdd')]&&_0x3fdf30['value']==='MACHINE'){var _0x5757be=this;return new BPromise(function(_0x218a14,_0x322f00){delete _0x5757be[_0x7d3f('0xa9')][_0x3fdf30[_0x7d3f('0xd7')]];_0x5757be[_0x7d3f('0xb0')](_0x5757be['voiceQueues'][_0x52692e['queue']]);_0x5757be[_0x7d3f('0xb1')][_0x52692e[_0x7d3f('0xb2')]][_0x7d3f('0x5e')]+=0x1;_0x5757be[_0x7d3f('0xb1')][_0x52692e[_0x7d3f('0xb2')]][_0x7d3f('0x5d')]+=0x1;var _0xa102e3=_0x5757be[_0x7d3f('0xb1')][_0x52692e[_0x7d3f('0xb2')]];var _0x4a1306=new Hangup(_0x52692e,_0x3fdf30);_0x4a1306[_0x7d3f('0xa4')]=0x13;_0x4a1306[_0x7d3f('0xa5')]=_0x7d3f('0xe6');_0x4a1306[_0x7d3f('0xe1')]=_0x7d3f('0xe2');_0x4a1306[_0x7d3f('0xe7')]+=0x1;_0x4a1306[_0x7d3f('0xe8')]+=0x1;_0x4a1306['amd']=!![];ami[_0x7d3f('0xe3')](_0x7d3f('0xe9'),ut[_0x7d3f('0xe4')](_0x4a1306,_0x7d3f('0xea')));_0x5757be['createHistory'](_0x4a1306)[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0xeb')));if(_0x4a1306[_0x7d3f('0xec')]+_0x4a1306[_0x7d3f('0xed')]+_0x4a1306[_0x7d3f('0xee')]+_0x4a1306[_0x7d3f('0xef')]+_0x4a1306['countdropretry']+_0x4a1306[_0x7d3f('0xf0')]+_0x4a1306[_0x7d3f('0xe7')]+_0x4a1306[_0x7d3f('0xf1')]>=_0xa102e3['dialGlobalMaxRetry']){_0x5757be[_0x7d3f('0xf2')](_0x4a1306,_0x218a14,_0x322f00,_0x7d3f('0xf3'));}else{if(_0x4a1306[_0x7d3f('0xe7')]>=_0xa102e3['dialMachineMaxRetry']){_0x5757be['createStateFinal'](_0x4a1306,_0x218a14,_0x322f00,_0x7d3f('0xf4'));}else{_0x5757be[_0x7d3f('0xba')]({'active':![],'countmachineretry':_0x4a1306[_0x7d3f('0xe7')],'scheduledat':moment()[_0x7d3f('0xf5')](_0xa102e3[_0x7d3f('0xf6')],'minutes')[_0x7d3f('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4a1306[_0x7d3f('0xcc')],'ListId':_0x4a1306[_0x7d3f('0xf7')],'VoiceQueueId':_0x4a1306[_0x7d3f('0xf8')]||undefined,'CampaignId':_0x4a1306[_0x7d3f('0xce')]||undefined})['catch'](loggerCatch(_0x7d3f('0xf9')));_0x218a14({'reschedule':0x1});}}});}if(_0x52692e['type']===_0x7d3f('0xaf')&&this[_0x7d3f('0x20')][_0x52692e[_0x7d3f('0xb2')]][_0x7d3f('0xdd')]&&_0x3fdf30[_0x7d3f('0xde')]===_0x7d3f('0xdf')){delete this[_0x7d3f('0xa9')][_0x3fdf30[_0x7d3f('0xd7')]];this[_0x7d3f('0xb0')](this['campaigns'][_0x52692e[_0x7d3f('0xb2')]]);_0x500948=new Hangup(_0x52692e,_0x3fdf30);_0x500948[_0x7d3f('0xa4')]=0x12;_0x500948[_0x7d3f('0xa5')]='HangupInAMD';_0x500948[_0x7d3f('0xe1')]=_0x7d3f('0xe2');ami[_0x7d3f('0xe3')](_0x7d3f('0xe9'),ut[_0x7d3f('0xe4')](_0x500948,_0x7d3f('0xea')));this[_0x7d3f('0xca')](_0x500948,_0x7d3f('0xfa'),_0x7d3f('0xfb'));}if(_0x52692e[_0x7d3f('0x4a')]===_0x7d3f('0xaf')&&this[_0x7d3f('0x20')][_0x52692e[_0x7d3f('0xb2')]][_0x7d3f('0xdd')]&&_0x3fdf30[_0x7d3f('0xde')]==='MACHINE'){var _0x5757be=this;return new BPromise(function(_0x37e280,_0x5141d9){delete _0x5757be[_0x7d3f('0xa9')][_0x3fdf30['uniqueid']];_0x5757be[_0x7d3f('0xb0')](_0x5757be[_0x7d3f('0x20')][_0x52692e[_0x7d3f('0xb2')]]);_0x5757be[_0x7d3f('0x20')][_0x52692e[_0x7d3f('0xb2')]][_0x7d3f('0x5e')]+=0x1;_0x5757be[_0x7d3f('0x20')][_0x52692e['queue']][_0x7d3f('0x5d')]+=0x1;var _0x4ecd96=_0x5757be[_0x7d3f('0x20')][_0x52692e['queue']];var _0x561bdf=new Hangup(_0x52692e,_0x3fdf30);_0x561bdf['state']=0x13;_0x561bdf[_0x7d3f('0xa5')]=_0x7d3f('0xe6');_0x561bdf[_0x7d3f('0xe1')]=_0x7d3f('0xe2');_0x561bdf[_0x7d3f('0xe7')]+=0x1;_0x561bdf[_0x7d3f('0xe8')]+=0x1;_0x561bdf[_0x7d3f('0xea')]=!![];ami[_0x7d3f('0xe3')](_0x7d3f('0xe9'),ut[_0x7d3f('0xe4')](_0x561bdf,_0x7d3f('0xea')));_0x5757be[_0x7d3f('0xd5')](_0x561bdf)[_0x7d3f('0xad')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x561bdf[_0x7d3f('0xec')]+_0x561bdf[_0x7d3f('0xed')]+_0x561bdf[_0x7d3f('0xee')]+_0x561bdf['countnosuchnumberretry']+_0x561bdf[_0x7d3f('0xfc')]+_0x561bdf['countabandonedretry']+_0x561bdf[_0x7d3f('0xe7')]+_0x561bdf[_0x7d3f('0xf1')]>=_0x4ecd96[_0x7d3f('0xfd')]){_0x5757be['stateGlobal'](_0x561bdf,_0x37e280,_0x5141d9,_0x7d3f('0xf3'));}else{if(_0x561bdf[_0x7d3f('0xe7')]>=_0x4ecd96[_0x7d3f('0xfe')]){_0x5757be['createStateFinal'](_0x561bdf,_0x37e280,_0x5141d9,_0x7d3f('0xf4'));}else{_0x5757be[_0x7d3f('0xba')]({'active':![],'countmachineretry':_0x561bdf['countmachineretry'],'scheduledat':moment()[_0x7d3f('0xf5')](_0x4ecd96[_0x7d3f('0xf6')],_0x7d3f('0xff'))[_0x7d3f('0x75')](_0x7d3f('0x100')),'ContactId':_0x561bdf[_0x7d3f('0xcc')],'ListId':_0x561bdf[_0x7d3f('0xf7')],'VoiceQueueId':_0x561bdf[_0x7d3f('0xf8')]||undefined,'CampaignId':_0x561bdf['CampaignId']||undefined})[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0xf9')));_0x37e280({'reschedule':0x1});}}});}}};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x32')]=function(_0x5d7f89){var _0x1e7e2e=this[_0x7d3f('0xa9')][_0x5d7f89[_0x7d3f('0xd7')]];var _0x250899=this;var _0xb5aac1;if(_0x1e7e2e&&_0x1e7e2e[_0x7d3f('0x4a')]===_0x7d3f('0xaf')){delete this['uniqueId'][_0x5d7f89['uniqueid']];this['updateOriginated'](this['campaigns'][_0x1e7e2e[_0x7d3f('0xb2')]]);this['campaigns'][_0x1e7e2e[_0x7d3f('0xb2')]][_0x7d3f('0x101')]+=0x1;_0xb5aac1=new Hangup(_0x1e7e2e,_0x5d7f89);this[_0x7d3f('0xd5')](_0xb5aac1)[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x102')));this['moveContactManagedDialer'](_0xb5aac1)[_0x7d3f('0xad')](loggerCatch('[syncHangupIvr]'));}if(_0x1e7e2e&&_0x1e7e2e[_0x7d3f('0x4a')]!==_0x7d3f('0xaf')&&isNotNull(this[_0x7d3f('0xb1')][_0x1e7e2e[_0x7d3f('0xb2')]][_0x7d3f('0x103')])){delete this[_0x7d3f('0xa9')][_0x5d7f89[_0x7d3f('0xd7')]];this[_0x7d3f('0xb0')](this[_0x7d3f('0xb1')][_0x1e7e2e[_0x7d3f('0xb2')]]);this['voiceQueues'][_0x1e7e2e['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x7d3f('0xb1')][_0x1e7e2e[_0x7d3f('0xb2')]][_0x7d3f('0x5d')]+=0x1;_0xb5aac1=new Hangup(_0x1e7e2e,_0x5d7f89);_0xb5aac1[_0x7d3f('0xa4')]=0x10;_0xb5aac1[_0x7d3f('0xa5')]='AnswerAGI';_0xb5aac1[_0x7d3f('0xe1')]=_0x7d3f('0x104');this[_0x7d3f('0xd5')](_0xb5aac1)[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x102')));this[_0x7d3f('0xc4')](_0xb5aac1)[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x105')));}if(_0x1e7e2e&&_0x1e7e2e[_0x7d3f('0x4a')]!==_0x7d3f('0xaf')&&!isNotNull(this[_0x7d3f('0xb1')][_0x1e7e2e[_0x7d3f('0xb2')]][_0x7d3f('0x103')])){delete this['uniqueId'][_0x5d7f89[_0x7d3f('0xd7')]];this[_0x7d3f('0xb0')](this[_0x7d3f('0xb1')][_0x1e7e2e[_0x7d3f('0xb2')]]);this[_0x7d3f('0xb1')][_0x1e7e2e[_0x7d3f('0xb2')]][_0x7d3f('0x106')]+=0x1;_0xb5aac1=new Hangup(_0x1e7e2e,_0x5d7f89);_0xb5aac1[_0x7d3f('0xa4')]=0xc;_0xb5aac1[_0x7d3f('0xa5')]=_0x5d7f89[_0x7d3f('0x107')];_0xb5aac1['membername']='Unknow';this[_0x7d3f('0xd5')](_0xb5aac1)['catch'](loggerCatch(_0x7d3f('0x102')));this[_0x7d3f('0xc4')](_0xb5aac1)[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x105')));}};Dialer['prototype'][_0x7d3f('0x30')]=function(_0x188bc4){var _0x59ed04=this[_0x7d3f('0xa9')][_0x188bc4[_0x7d3f('0xd7')]];var _0x1fc737=this;if(this[_0x7d3f('0xb1')][_0x188bc4[_0x7d3f('0xb2')]]){if(_0x59ed04&&_0x59ed04[_0x7d3f('0x4a')]!=='ivr'){delete this[_0x7d3f('0xa9')][_0x188bc4[_0x7d3f('0xd7')]];this['voiceQueues'][_0x188bc4[_0x7d3f('0xb2')]]['outboundAnswerCallsDay']+=0x1;var _0xc5bcc3=new AgentComplete(_0x59ed04,_0x188bc4);if(_0x188bc4[_0x7d3f('0x108')]===_0x7d3f('0x109')){_0xc5bcc3[_0x7d3f('0x10a')]=this[_0x7d3f('0xb1')][_0x188bc4[_0x7d3f('0xb2')]][_0x7d3f('0x10b')]&&this[_0x7d3f('0xb1')][_0x188bc4[_0x7d3f('0xb2')]][_0x7d3f('0x10c')]?moment()[_0x7d3f('0x75')](_0x7d3f('0x100')):undefined;}this[_0x7d3f('0xd5')](_0xc5bcc3)[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x10d')));this['moveContactManagedDialer'](_0xc5bcc3)[_0x7d3f('0xad')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype']['syncAgentConnect']=function(_0x35e4a9){if(this[_0x7d3f('0xb1')][_0x35e4a9[_0x7d3f('0xb2')]]){if(this[_0x7d3f('0xa9')][_0x35e4a9[_0x7d3f('0xd7')]]&&this[_0x7d3f('0xa9')][_0x35e4a9[_0x7d3f('0xd7')]][_0x7d3f('0x4a')]!==_0x7d3f('0xaf')){this['updateOriginated'](this[_0x7d3f('0xb1')][_0x35e4a9[_0x7d3f('0xb2')]]);this['uniqueId'][_0x35e4a9['uniqueid']]['answertime']=moment()[_0x7d3f('0x75')](_0x7d3f('0x100'));}}};Dialer[_0x7d3f('0x1b')]['queueCallerAbandonCreateState']=function(_0x3c4106){this[_0x7d3f('0xd5')](_0x3c4106)[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x10d')));this[_0x7d3f('0xc4')](_0x3c4106)[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x10e')));};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x2d')]=function(_0x3dbdf7){var _0x3a34d0=this['uniqueId'][_0x3dbdf7[_0x7d3f('0xd7')]];var _0x3b16a0=this;if(this[_0x7d3f('0xb1')][_0x3dbdf7[_0x7d3f('0xb2')]]){if(_0x3a34d0&&_0x3a34d0['type']!==_0x7d3f('0xaf')){delete this[_0x7d3f('0xa9')][_0x3dbdf7[_0x7d3f('0xd7')]];this[_0x7d3f('0xb0')](this[_0x7d3f('0xb1')][_0x3dbdf7['queue']]);_0x3a34d0['droptime']=moment()[_0x7d3f('0x75')](_0x7d3f('0x100'));var _0x10da96=new QueueCallerAbandon(_0x3a34d0,_0x3dbdf7);if(getSeconds(_0x3a34d0[_0x7d3f('0x10f')],_0x3a34d0['responsetime'])>=_0x3a34d0[_0x7d3f('0x110')]){this[_0x7d3f('0xb1')][_0x3dbdf7[_0x7d3f('0xb2')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x7d3f('0xb1')][_0x3dbdf7['queue']][_0x7d3f('0x62')]+=0x1;this[_0x7d3f('0xb1')][_0x3dbdf7[_0x7d3f('0xb2')]][_0x7d3f('0x6a')]+=0x1;_0x10da96['state']=0xa;_0x10da96[_0x7d3f('0xa5')]=_0x7d3f('0x111');_0x10da96[_0x7d3f('0x112')]=_0x7d3f('0x113');_0x10da96[_0x7d3f('0x10a')]=this[_0x7d3f('0xb1')][_0x3dbdf7[_0x7d3f('0xb2')]][_0x7d3f('0x10b')]?moment()[_0x7d3f('0x75')](_0x7d3f('0x100')):undefined;_0x10da96[_0x7d3f('0xfc')]+=0x1;_0x10da96['countglobal']+=0x1;if(_0x10da96[_0x7d3f('0xfc')]>=this[_0x7d3f('0xb1')][_0x3dbdf7[_0x7d3f('0xb2')]][_0x7d3f('0x114')]){this[_0x7d3f('0x115')](_0x10da96);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x10da96['countdropretry'],'scheduledat':moment()[_0x7d3f('0xf5')](this[_0x7d3f('0xb1')][_0x3dbdf7['queue']][_0x7d3f('0x116')],_0x7d3f('0xff'))[_0x7d3f('0x75')](_0x7d3f('0x100')),'ContactId':_0x3a34d0[_0x7d3f('0xcc')],'ListId':_0x3a34d0[_0x7d3f('0xf7')],'VoiceQueueId':_0x3a34d0[_0x7d3f('0xf8')]||undefined,'CampaignId':_0x3a34d0[_0x7d3f('0xce')]||undefined})[_0x7d3f('0xad')](loggerCatch('[rescheduleContact][Drop]'));var _0x5e6559=new History(_0x10da96);_0x5e6559['state']=0xa;_0x5e6559[_0x7d3f('0xa5')]=_0x7d3f('0x111');_0x5e6559[_0x7d3f('0xa7')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5e6559['endtime']=_0x5e6559[_0x7d3f('0xa7')];_0x5e6559[_0x7d3f('0x117')]=_0x10da96[_0x7d3f('0x117')];_0x5e6559[_0x7d3f('0x118')]=_0x10da96[_0x7d3f('0x118')];this[_0x7d3f('0xd5')](_0x5e6559)['catch'](loggerCatch(_0x7d3f('0x119')));}}else{this[_0x7d3f('0xb1')][_0x3dbdf7[_0x7d3f('0xb2')]][_0x7d3f('0x7b')]+=0x1;this[_0x7d3f('0xb1')][_0x3dbdf7['queue']][_0x7d3f('0x61')]+=0x1;_0x10da96[_0x7d3f('0xa4')]=0xb;_0x10da96[_0x7d3f('0xa5')]=_0x7d3f('0x11a');_0x10da96[_0x7d3f('0x112')]=_0x7d3f('0x11b');_0x10da96[_0x7d3f('0xf0')]+=0x1;_0x10da96['countglobal']+=0x1;if(_0x10da96['countabandonedretry']>=this[_0x7d3f('0xb1')][_0x3dbdf7['queue']]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x10da96);}else{this[_0x7d3f('0xba')]({'active':![],'countabandonedretry':_0x10da96[_0x7d3f('0xf0')],'scheduledat':moment()['add'](this[_0x7d3f('0xb1')][_0x3dbdf7[_0x7d3f('0xb2')]][_0x7d3f('0x11c')],'minutes')['format'](_0x7d3f('0x100')),'ContactId':_0x3a34d0[_0x7d3f('0xcc')],'ListId':_0x3a34d0[_0x7d3f('0xf7')],'VoiceQueueId':_0x3a34d0[_0x7d3f('0xf8')]||undefined,'CampaignId':_0x3a34d0[_0x7d3f('0xce')]||undefined})[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x11d')));var _0x5e6559=new History(_0x10da96);_0x5e6559[_0x7d3f('0xa4')]=0xb;_0x5e6559[_0x7d3f('0xa5')]='Abandoned';_0x5e6559['starttime']=moment()[_0x7d3f('0x75')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e6559[_0x7d3f('0xa6')]=_0x5e6559[_0x7d3f('0xa7')];_0x5e6559['calleridname']=_0x10da96['calleridname'];_0x5e6559['calleridnum']=_0x10da96[_0x7d3f('0x118')];this['createHistory'](_0x5e6559)['catch'](loggerCatch(_0x7d3f('0x11e')));}}}}};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x34')]=function(_0x11d223){if(this[_0x7d3f('0x25')][_0x11d223['uniqueid']]){this[_0x7d3f('0x25')][_0x11d223[_0x7d3f('0xd7')]][_0x7d3f('0xac')]=_0x11d223[_0x7d3f('0xac')];}if(this[_0x7d3f('0xa9')][_0x11d223[_0x7d3f('0xd7')]]){this[_0x7d3f('0xa9')][_0x11d223[_0x7d3f('0xd7')]][_0x7d3f('0xac')]=_0x11d223['channel'];}};Dialer[_0x7d3f('0x1b')]['syncQueueMember']=function(_0x2e78c9){if(strategy[this[_0x7d3f('0xb1')][this[_0x7d3f('0x25')][_0x2e78c9[_0x7d3f('0x11f')]][_0x7d3f('0xb2')]][_0x7d3f('0x4c')]]===_0x7d3f('0x120')){if(this[_0x7d3f('0x25')][_0x2e78c9[_0x7d3f('0x11f')]]&&_[_0x7d3f('0xd8')](this[_0x7d3f('0x25')][_0x2e78c9[_0x7d3f('0x11f')]]['locked'])&&_0x2e78c9['status']==='1'&&_0x2e78c9[_0x7d3f('0x121')]==='0'){if(this['agents'][_0x2e78c9[_0x7d3f('0x122')]]){if(!this['agents'][_0x2e78c9[_0x7d3f('0x122')]][_0x7d3f('0x123')]){this[_0x7d3f('0x21')][_0x2e78c9[_0x7d3f('0x122')]][_0x7d3f('0x123')]=!![];this[_0x7d3f('0x25')][_0x2e78c9[_0x7d3f('0x11f')]][_0x7d3f('0x123')]=!![];this['actions'][_0x2e78c9['actionid']]['stateinterface']=_0x2e78c9['stateinterface'];}}}}else if((strategy[this[_0x7d3f('0xb1')][this[_0x7d3f('0x25')][_0x2e78c9['actionid']][_0x7d3f('0xb2')]][_0x7d3f('0x4c')]]||'rrmemory')==='rrmemory'){if(this[_0x7d3f('0x25')][_0x2e78c9[_0x7d3f('0x11f')]]){if(this[_0x7d3f('0x21')][_0x2e78c9[_0x7d3f('0x122')]]){this['actions'][_0x2e78c9[_0x7d3f('0x11f')]]['stateinterface']=_0x2e78c9['stateinterface'];if(_[_0x7d3f('0xd8')](this[_0x7d3f('0x29')][this[_0x7d3f('0x25')][_0x2e78c9[_0x7d3f('0x11f')]][_0x7d3f('0xb2')]])){this['queueBooked'][this['actions'][_0x2e78c9[_0x7d3f('0x11f')]][_0x7d3f('0xb2')]]=[];}this[_0x7d3f('0x29')][this[_0x7d3f('0x25')][_0x2e78c9[_0x7d3f('0x11f')]][_0x7d3f('0xb2')]][_0x7d3f('0x124')](_[_0x7d3f('0x89')](_[_0x7d3f('0xcb')](this[_0x7d3f('0x25')][_0x2e78c9['actionid']],['idHopper','stateinterface']),{'status':_0x2e78c9[_0x7d3f('0xd4')],'paused':_0x2e78c9['paused']}));}}}};function unlockQueueStatus(_0x5c77df,_0x5147a1){setTimeout(function(){if(_[_0x7d3f('0x3d')](_0x5c77df[_0x7d3f('0x125')])){loggerBooked[_0x7d3f('0x90')](_0x7d3f('0x126'),_0x5147a1);}_0x5c77df[_0x7d3f('0x125')]=!![];loggerBooked[_0x7d3f('0x78')](_0x7d3f('0x127'),_0x5147a1,JSON[_0x7d3f('0x47')](_[_0x7d3f('0xcb')](_0x5c77df,[_0x7d3f('0x40'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x7d3f('0x1b')][_0x7d3f('0x128')]=function(_0x5a39bc){var _0xa6bbf1=this;var _0x10f429=_0xa6bbf1[_0x7d3f('0xb1')][_0xa6bbf1[_0x7d3f('0x25')][_0x5a39bc['actionid']]['queue']];if(strategy[this[_0x7d3f('0xb1')][this['actions'][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0xb2')]]['strategy']]==='roundrobin'){if(this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]]&&this['actions'][_0x5a39bc['actionid']][_0x7d3f('0x122')]){this['preview']['run'](this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0x129')],this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0x122')])[_0x7d3f('0xad')](function(_0x5af16b){logger['error'](_0x7d3f('0x12a'),util[_0x7d3f('0x91')](_0x5af16b,{'showHidden':![],'depth':null}));})[_0x7d3f('0x1e')](function(){_0xa6bbf1['updateOriginated'](_0xa6bbf1[_0x7d3f('0xb1')][_0xa6bbf1[_0x7d3f('0x25')][_0x5a39bc['actionid']][_0x7d3f('0xb2')]]);_0xa6bbf1[_0x7d3f('0x21')][_0xa6bbf1[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]]['stateinterface']]['locked']=![];delete _0xa6bbf1[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]];unlockQueueStatus(_0x10f429);});}else{this[_0x7d3f('0xb0')](this['voiceQueues'][this[_0x7d3f('0x25')][_0x5a39bc['actionid']][_0x7d3f('0xb2')]]);this[_0x7d3f('0xba')]({'active':![],'ContactId':this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0xcc')],'ListId':this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0xf7')],'VoiceQueueId':this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0xf8')]||undefined,'CampaignId':this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0xce')]||undefined})[_0x7d3f('0xad')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]];unlockQueueStatus(_0x10f429);}}else if((strategy[this[_0x7d3f('0xb1')][this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0xb2')]][_0x7d3f('0x4c')]]||_0x7d3f('0x1a'))==='rrmemory'){var _0x1e4522;if(this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]]&&!_[_0x7d3f('0x46')](this[_0x7d3f('0x29')][this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0xb2')]])){if(this[_0x7d3f('0x2a')][_0xa6bbf1[_0x7d3f('0x25')][_0x5a39bc['actionid']]['queue']]){this[_0x7d3f('0x2a')][_0xa6bbf1[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]]['queue']]=this[_0x7d3f('0x2a')][this[_0x7d3f('0x25')][_0x5a39bc['actionid']][_0x7d3f('0xb2')]]?this[_0x7d3f('0x2a')][this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0xb2')]]:this[_0x7d3f('0x29')][this['actions'][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0xb2')]]?this[_0x7d3f('0x29')][this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0xb2')]][_0x7d3f('0x12b')]||0x0:0x0;}this[_0x7d3f('0x29')][this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0xb2')]][_0x7d3f('0x12b')]=this[_0x7d3f('0x2a')][this[_0x7d3f('0x25')][_0x5a39bc[_0x7d3f('0x11f')]][_0x7d3f('0xb2')]];for(var _0x54921=0x0;_0x54921=0x0;})[_0x7d3f('0xad')](myreject(_0x345e45)));}}else{_0x193976[_0x7d3f('0x124')](ami[_0x7d3f('0x142')]({'action':_0x7d3f('0x143'),'command':util[_0x7d3f('0x75')](_0x7d3f('0x144'),_0x582434,!_['isUndefined'](config[_0x7d3f('0x146')][_0x231ac3])?_0x231ac3:'')})[_0x7d3f('0x3b')](function(_0x26cc53){return _0x26cc53['content'][_0x7d3f('0x148')](_0x7d3f('0x149'))>=0x0;})[_0x7d3f('0xad')](myreject(_0x345e45)));}BPromise[_0x7d3f('0x14a')](_0x193976)[_0x7d3f('0x3b')](function(_0x236b1f){var _0xf3470e=_[_0x7d3f('0x14b')](_0x236b1f);if(_0xf3470e){return _0x24d080(_0xf3470e);}else{_0x52e286['message']=_0x4da3fa?_0x7d3f('0x14c'):_0x7d3f('0x14d');return _0x345e45(msgResponse('[ifTime][promiseAll]',_0x7d3f('0x13d'),'Global:\x20'+_0x4da3fa+'\x20'+_0x4cff1e+_0x7d3f('0x14e')+util[_0x7d3f('0x91')](_0x582434,{'showHidden':![],'depth':null})+_0x7d3f('0x14f')+_0x231ac3));}})['catch'](function(_0x26946b){return _0x345e45(msgResponse(_0x7d3f('0x13b'),'Failure',JSON['stringify'](_0x26946b)));});});};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x150')]=function(_0x4fcdb9){var _0x19ab47=this;return function(){switch(_0x4fcdb9[_0x7d3f('0x58')]){case'progressive':freeVariablesPredictive(_0x4fcdb9);_0x19ab47[_0x7d3f('0x151')](_0x4fcdb9,0x1);break;case _0x7d3f('0x152'):freeVariablesPredictive(_0x4fcdb9);_0x19ab47[_0x7d3f('0x151')](_0x4fcdb9,_0x4fcdb9[_0x7d3f('0x153')]);break;case _0x7d3f('0x154'):_0x19ab47[_0x7d3f('0x154')](_0x4fcdb9);break;case _0x7d3f('0x155'):freeVariablesPredictive(_0x4fcdb9);_0x19ab47[_0x7d3f('0x151')](_0x4fcdb9,0x1);break;default:freeVariablesPredictive(_0x4fcdb9);logger[_0x7d3f('0x90')]('Queue',_0x4fcdb9[_0x7d3f('0x40')],'method\x20not\x20recognized');}};};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x156')]=function(_0x90aef9){return BPromise['resolve']()[_0x7d3f('0x3b')](cmHopper[_0x7d3f('0x157')](_0x90aef9['id'],previewRecallmeReminderInterval))[_0x7d3f('0x3b')](function(_0x433c36){for(var _0xae8016=0x0;_0xae8016<_0x433c36[_0x7d3f('0x93')];_0xae8016++){var _0xa16898=_0x433c36[_0xae8016]['Agent'][_0x7d3f('0x40')];if(_0xa16898)io['to'](util[_0x7d3f('0x75')]('user:%s',_0xa16898))[_0x7d3f('0xe3')](_0x7d3f('0x158'),{'hopper':_0x433c36[_0xae8016]});}})['catch'](function(_0x51001a){});};Dialer[_0x7d3f('0x1b')]['launchHandleIvr']=function(_0x1a7e8e){var _0x291c83=this;return function(){_0x291c83[_0x7d3f('0x159')](_0x1a7e8e);};};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x9')]=function(_0x4538f0){var _0x4c8a08=this;if(isNotPreview(_0x4538f0['dialMethod'])){if(isVoiceQueueOutbound(_0x4538f0[_0x7d3f('0x4a')])&&isActive(_0x4538f0[_0x7d3f('0x57')])){_0x4538f0[_0x7d3f('0x9d')]=!![];BPromise[_0x7d3f('0xb4')]()[_0x7d3f('0x3b')](checkIsLoggedIn(_0x4538f0,_0x4538f0[_0x7d3f('0x4e')]))[_0x7d3f('0x3b')](checkIsActive(_0x4538f0,_0x4538f0[_0x7d3f('0x57')]))[_0x7d3f('0x3b')](checkInterval(_0x4538f0))[_0x7d3f('0x3b')](_0x4c8a08[_0x7d3f('0x138')](_0x4538f0))[_0x7d3f('0x3b')](_0x4c8a08[_0x7d3f('0x13a')](_0x4538f0[_0x7d3f('0x15a')],_0x4538f0['dialTimezone'],_0x4538f0[_0x7d3f('0x40')],_0x4538f0))[_0x7d3f('0x3b')](_0x4c8a08[_0x7d3f('0x13c')](_0x4538f0['Interval'],_0x4538f0['dialTimezone'],_0x4538f0[_0x7d3f('0x40')],_0x4538f0))['then'](_0x4c8a08[_0x7d3f('0x150')](_0x4538f0))[_0x7d3f('0xad')](loggerCatchQueueSummary(_0x7d3f('0x15b'),_0x4538f0));}else{notSendMessagesQueue(_0x4538f0);}}else{freeVariablesPredictive(_0x4538f0);if(_0x4538f0['dialPreviewRecallmeReminder']){_0x4c8a08[_0x7d3f('0x156')](_0x4538f0);}}};Dialer[_0x7d3f('0x1b')]['syncCampaigns']=function(){var _0x5c6e64=this;var _0x1a2b41;for(var _0x523775 in this[_0x7d3f('0x20')]){if(typeof this['campaigns'][_0x523775]!==_0x7d3f('0x94')){_0x1a2b41=this['campaigns'][_0x523775];if(isCampaignIvr(_0x1a2b41[_0x7d3f('0x4a')])&&isActive(_0x1a2b41[_0x7d3f('0x73')])){_0x1a2b41[_0x7d3f('0x9d')]=!![];BPromise[_0x7d3f('0xb4')]()[_0x7d3f('0x3b')](checkIsActive(_0x1a2b41,_0x1a2b41[_0x7d3f('0x73')]))[_0x7d3f('0x3b')](checkInterval(_0x1a2b41))[_0x7d3f('0x3b')](_0x5c6e64[_0x7d3f('0x138')](_0x1a2b41))['then'](_0x5c6e64['checkIfTime'](_0x1a2b41[_0x7d3f('0x15a')],_0x1a2b41[_0x7d3f('0x15c')],_0x1a2b41['name'],_0x1a2b41))[_0x7d3f('0x3b')](_0x5c6e64[_0x7d3f('0x13c')](_0x1a2b41[_0x7d3f('0x42')],_0x1a2b41[_0x7d3f('0x15c')],_0x1a2b41[_0x7d3f('0x40')],_0x1a2b41))[_0x7d3f('0x3b')](_0x5c6e64[_0x7d3f('0x15d')](_0x1a2b41))[_0x7d3f('0xad')](loggerCatchQueueSummary('[syncCampaigns]',_0x1a2b41));}else{notSendMessagesCampaign(_0x1a2b41);}}}};function getCallerIdRandom(_0x58b358,_0x740060){var _0x189c9b;var _0x4f1b0e;var _0x4689ff;if(_0x740060<=0x0){_0x740060=0x1;}_0x189c9b=new RegExp('\x5cw{0,'+_0x740060+'}$');_0x4f1b0e=Math['pow'](0xa,_0x740060-0x1);_0x4689ff=Math[_0x7d3f('0x15e')](0xa,_0x740060)-0x1;return util[_0x7d3f('0x75')]('%s',_[_0x7d3f('0x15f')](_0x58b358,_0x189c9b,_[_0x7d3f('0x160')](_0x4f1b0e,_0x4689ff)));}function extractCalleridName(_0x3c1f0d){var _0x1029c4=_0x3c1f0d[_0x7d3f('0x161')](/"(.*?)"/);return _0x1029c4?_0x1029c4[0x1]:_0x3c1f0d;}function extractCalleridNumber(_0x3b005c){var _0x3f30f3=_0x3b005c[_0x7d3f('0x161')](/<(.*?)>/);return _0x3f30f3?_0x3f30f3[0x1]:_0x3b005c;}Dialer[_0x7d3f('0x1b')][_0x7d3f('0x162')]=function(_0x1c57af,_0x5c4b94){var _0x2c0de2=this;var _0x17ef78=uuid['v4']();this[_0x7d3f('0x25')][_0x17ef78]=new Action(_0x1c57af,_0x5c4b94,_0x17ef78);return new BPromise(function(_0x567c37,_0x20c95c){if(_[_0x7d3f('0x3d')](_0x1c57af)&&typeof _0x1c57af!=='object'){return _0x20c95c(msgResponse(_0x7d3f('0x163'),_0x7d3f('0x13d'),'voiceQueue\x20is\x20undefine'));}if(_[_0x7d3f('0x3d')](_0x5c4b94[_0x7d3f('0x164')][_0x7d3f('0x165')])||_0x5c4b94[_0x7d3f('0x164')][_0x7d3f('0x165')]===null){return _0x20c95c(msgResponse(_0x7d3f('0x163'),'Failure',_0x7d3f('0x166')));}var _0x181e3e={'XMD-CALLERID':_0x2c0de2['actions'][_0x17ef78][_0x7d3f('0x167')](),'XMD-AGI':_0x1c57af['dialQueueProject']?util[_0x7d3f('0x75')](_0x7d3f('0x168'),ipAgi,_0x1c57af[_0x7d3f('0x103')]):_0x7d3f('0x169'),'XMD-AGIAFTER':_0x1c57af[_0x7d3f('0x10b')]?util[_0x7d3f('0x75')](_0x7d3f('0x168'),ipAgi,_0x1c57af['dialQueueProject2']):_0x7d3f('0x169'),'XMD-QUEUE':_0x1c57af[_0x7d3f('0x4a')]==='outbound'?util[_0x7d3f('0x75')]('\x22%s,%s%s,,,%s\x22',_0x1c57af['name'],_0x1c57af['dialQueueOptions']||'',_0x1c57af[_0x7d3f('0x10c')]?'c':'',_0x1c57af[_0x7d3f('0x110')]||0x3):_0x7d3f('0x169'),'XMD-CONTACTID':_0x5c4b94[_0x7d3f('0xcc')],'XMD-CDRTYPE':_0x7d3f('0x7'),'CALLERID(all)':_0x2c0de2['actions'][_0x17ef78][_0x7d3f('0x167')](),'XMD-AMD':_0x1c57af[_0x7d3f('0xdd')]?_0x7d3f('0x16a'):_0x7d3f('0x169'),'XMD-DESTINATION':_0x7d3f('0xdc')};if(_0x1c57af['dialAMDActive']){_0x181e3e['XMD-AMDINITIALSILENCE']=_0x1c57af[_0x7d3f('0x16b')]||0x9c4;_0x181e3e[_0x7d3f('0x16c')]=_0x1c57af[_0x7d3f('0x16d')]||0x5dc;_0x181e3e[_0x7d3f('0x16e')]=_0x1c57af[_0x7d3f('0x16f')]||0x320;_0x181e3e['XMD-AMDTOTALANALYSISTIME']=_0x1c57af[_0x7d3f('0x170')]||0x1388;_0x181e3e[_0x7d3f('0x171')]=_0x1c57af[_0x7d3f('0x172')]||0x64;_0x181e3e[_0x7d3f('0x173')]=_0x1c57af['dialAMDBetweenWordsSilence']||0x32;_0x181e3e[_0x7d3f('0x174')]=_0x1c57af[_0x7d3f('0x175')]||0x3;_0x181e3e[_0x7d3f('0x176')]=_0x1c57af[_0x7d3f('0x177')]||0x100;_0x181e3e['XMD-AMDMAXIMUMWORDLENGTH']=_0x1c57af[_0x7d3f('0x178')]||0x1388;}if(_0x1c57af['type']==='outbound'){_0x181e3e[_0x7d3f('0x179')]=_0x5c4b94[_0x7d3f('0xf8')];}else{_0x181e3e[_0x7d3f('0x17a')]=_0x5c4b94[_0x7d3f('0xce')];}for(var _0x2a8eb1 in _0x5c4b94['Contact']){if(typeof _0x5c4b94[_0x7d3f('0x164')][_0x2a8eb1]!==_0x7d3f('0x94')){if(isNotNull(_0x5c4b94[_0x7d3f('0x164')][_0x2a8eb1])&&_0x2a8eb1!=='id'&&_0x2a8eb1!==_0x7d3f('0x17b')&&_0x2a8eb1!==_0x7d3f('0x17c')&&_0x2a8eb1!=='updatedAt'){_0x181e3e[util[_0x7d3f('0x75')](_0x7d3f('0x17d'),_0x7d3f('0x17e'),_[_0x7d3f('0x17f')](_0x2a8eb1))]=_0x5c4b94[_0x7d3f('0x164')][_0x2a8eb1];}}}var _0x3194de=_0x2c0de2[_0x7d3f('0xd2')](_0x1c57af[_0x7d3f('0x72')])?getCallerId(_0x1c57af[_0x7d3f('0x72')][_0x7d3f('0x74')],_0x1c57af[_0x7d3f('0x59')],_0x1c57af['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x1c57af[_0x7d3f('0x5a')],_0x1c57af[_0x7d3f('0x180')]):_0x1c57af['dialOriginateCallerIdNumber']):getCallerId(_[_0x7d3f('0xd8')](_0x1c57af[_0x7d3f('0x181')])?_0x1c57af[_0x7d3f('0x72')][_0x7d3f('0x74')]:_0x1c57af[_0x7d3f('0x181')][_0x7d3f('0x74')],_0x1c57af[_0x7d3f('0x59')],_0x1c57af[_0x7d3f('0x180')]>0x0?getCallerIdRandom(_0x1c57af['dialOriginateCallerIdNumber'],_0x1c57af['dialRandomLastDigitCallerIdNumber']):_0x1c57af['dialOriginateCallerIdNumber']);if(_0x3194de){_0x181e3e[_0x7d3f('0x182')]=_0x2c0de2[_0x7d3f('0x25')][_0x17ef78][_0x7d3f('0x183')]=extractCalleridName(_0x3194de);_0x181e3e[_0x7d3f('0x184')]=_0x2c0de2['actions'][_0x17ef78][_0x7d3f('0x185')]=extractCalleridNumber(_0x3194de);}return ami[_0x7d3f('0x142')]({'actionid':_0x17ef78,'action':_0x7d3f('0x163'),'channel':_0x2c0de2['isTrunkReachable'](_0x1c57af[_0x7d3f('0x72')])?util['format'](_0x7d3f('0x186'),_0x1c57af['Trunk'][_0x7d3f('0x40')],isNotNull(_0x1c57af[_0x7d3f('0x5c')])?_0x1c57af['dialPrefix'][_0x7d3f('0x187')]()||'':'',_0x1c57af[_0x7d3f('0x188')]>0x0?_0x5c4b94[_0x7d3f('0x164')][_0x7d3f('0x165')][_0x7d3f('0x189')](_0x1c57af[_0x7d3f('0x188')]):_0x5c4b94[_0x7d3f('0x164')][_0x7d3f('0x165')]):util[_0x7d3f('0x75')](_0x7d3f('0x186'),_[_0x7d3f('0xd8')](_0x1c57af[_0x7d3f('0x181')])?_0x1c57af[_0x7d3f('0x72')][_0x7d3f('0x40')]:_0x1c57af['TrunkBackup'][_0x7d3f('0x40')],isNotNull(_0x1c57af[_0x7d3f('0x5c')])?_0x1c57af['dialPrefix'][_0x7d3f('0x187')]()||'':'',_0x1c57af[_0x7d3f('0x188')]>0x0?_0x5c4b94[_0x7d3f('0x164')][_0x7d3f('0x165')]['substring'](_0x1c57af['dialCutDigit']):_0x5c4b94['Contact']['phone']),'callerid':_0x3194de,'Exten':'xcally-motion-dialer','Context':_0x7d3f('0x18a'),'Priority':'1','variable':_0x181e3e,'timeout':(_0x1c57af[_0x7d3f('0x5b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x17ef78})[_0x7d3f('0x3b')](function(_0x47694e){return _0x567c37(_0x47694e);})['catch'](function(_0x54f7bc){_0x1c57af[_0x7d3f('0x18b')]+=0x1;var _0x22f051=new History(_0x2c0de2['actions'][_0x17ef78]);logger['error'](util['format']('[originateError]:\x20%s',JSON['stringify'](_0x54f7bc)));_0x22f051[_0x7d3f('0xa4')]=0xe;_0x22f051[_0x7d3f('0xa5')]='OriginateError';_0x22f051[_0x7d3f('0xa7')]=moment()[_0x7d3f('0x75')](_0x7d3f('0x100'));_0x22f051['endtime']=_0x22f051[_0x7d3f('0xa7')];_0x2c0de2['createHistory'](_0x22f051)[_0x7d3f('0xad')](loggerCatch('[originate][error]'));_0x2c0de2[_0x7d3f('0xc4')](_0x22f051)['catch'](loggerCatch(_0x7d3f('0x18c')))[_0x7d3f('0x1e')](function(){delete _0x2c0de2[_0x7d3f('0x25')][_0x17ef78];return _0x20c95c(msgResponse('originate','Error',_0x7d3f('0x18d')));});});});};Dialer[_0x7d3f('0x1b')]['syncOriginateResponse']=function(_0x23e244){var _0x20a40d=this[_0x7d3f('0x25')][_0x23e244['actionid']];if(_0x20a40d){delete this['actions'][_0x23e244[_0x7d3f('0x11f')]];_0x20a40d['responsetime']=moment()['format'](_0x7d3f('0x100'));var _0x124d4d=_0x20a40d['type']==='ivr'?this['campaigns'][_0x20a40d['queue']]:this[_0x7d3f('0xb1')][_0x20a40d['getQueue']()];if(!this[_0x7d3f('0x18e')](_0x23e244[_0x7d3f('0x18f')])){this['updateOriginated'](_0x124d4d);return this[_0x7d3f('0x190')](_0x20a40d,_0x124d4d,_0x23e244)[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x191')));}this[_0x7d3f('0xa9')][_0x23e244[_0x7d3f('0xd7')]]=_0x20a40d;}};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x192')]=function(_0x9971a,_0x16090c,_0x5f1e17){var _0x40f7b=new History(_0x16090c);if(_0x40f7b[_0x7d3f('0xec')]+_0x40f7b['countcongestionretry']+_0x40f7b[_0x7d3f('0xee')]+_0x40f7b[_0x7d3f('0xef')]+_0x40f7b['countdropretry']+_0x40f7b['countabandonedretry']+_0x40f7b[_0x7d3f('0xe7')]+_0x40f7b[_0x7d3f('0xf1')]>=_0x5f1e17[_0x7d3f('0xfd')]-0x1){return!![];}switch(_0x9971a){case 0x3:if(_0x40f7b['countnoanswerretry']>=_0x5f1e17['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x7d3f('0xba')]({'active':![],'countnoanswerretry':_0x40f7b[_0x7d3f('0xee')]+=0x1,'scheduledat':moment()[_0x7d3f('0xf5')](_0x5f1e17[_0x7d3f('0x193')],_0x7d3f('0xff'))['format'](_0x7d3f('0x100')),'ContactId':_0x40f7b[_0x7d3f('0xcc')],'ListId':_0x40f7b['ListId'],'VoiceQueueId':_0x40f7b[_0x7d3f('0xf8')]||undefined,'CampaignId':_0x40f7b['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x40f7b[_0x7d3f('0xec')]>=_0x5f1e17[_0x7d3f('0x194')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x40f7b[_0x7d3f('0xec')]+=0x1,'scheduledat':moment()['add'](_0x5f1e17['dialBusyRetryFrequency'],'minutes')[_0x7d3f('0x75')](_0x7d3f('0x100')),'ContactId':_0x40f7b[_0x7d3f('0xcc')],'ListId':_0x40f7b[_0x7d3f('0xf7')],'VoiceQueueId':_0x40f7b['VoiceQueueId']||undefined,'CampaignId':_0x40f7b[_0x7d3f('0xce')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x40f7b[_0x7d3f('0xed')]>=_0x5f1e17[_0x7d3f('0x195')]-0x1){return!![];}this[_0x7d3f('0xba')]({'active':![],'countcongestionretry':_0x40f7b[_0x7d3f('0xed')]+=0x1,'scheduledat':moment()[_0x7d3f('0xf5')](_0x5f1e17[_0x7d3f('0x196')],_0x7d3f('0xff'))[_0x7d3f('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40f7b['ContactId'],'ListId':_0x40f7b[_0x7d3f('0xf7')],'VoiceQueueId':_0x40f7b[_0x7d3f('0xf8')]||undefined,'CampaignId':_0x40f7b[_0x7d3f('0xce')]||undefined})[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x197')));break;case 0x0:if(_0x40f7b['countnosuchnumberretry']>=_0x5f1e17[_0x7d3f('0x198')]-0x1){return!![];}else{this[_0x7d3f('0xba')]({'active':![],'countnosuchnumberretry':_0x40f7b['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x7d3f('0xf5')](_0x5f1e17[_0x7d3f('0x199')],'minutes')[_0x7d3f('0x75')](_0x7d3f('0x100')),'ContactId':_0x40f7b[_0x7d3f('0xcc')],'ListId':_0x40f7b[_0x7d3f('0xf7')],'VoiceQueueId':_0x40f7b[_0x7d3f('0xf8')]||undefined,'CampaignId':_0x40f7b[_0x7d3f('0xce')]||undefined})[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x19a')));}break;case 0xa:if(_0x40f7b[_0x7d3f('0xfc')]>=_0x5f1e17[_0x7d3f('0x114')]-0x1){return!![];}this[_0x7d3f('0xba')]({'active':![],'countdropretry':_0x40f7b[_0x7d3f('0xfc')]+=0x1,'scheduledat':moment()[_0x7d3f('0xf5')](_0x5f1e17[_0x7d3f('0x116')],_0x7d3f('0xff'))[_0x7d3f('0x75')](_0x7d3f('0x100')),'ContactId':_0x40f7b['ContactId'],'ListId':_0x40f7b[_0x7d3f('0xf7')],'VoiceQueueId':_0x40f7b[_0x7d3f('0xf8')]||undefined,'CampaignId':_0x40f7b['CampaignId']||undefined})['catch'](loggerCatch(_0x7d3f('0x19b')));break;case 0xb:if(_0x40f7b[_0x7d3f('0xf0')]>=_0x5f1e17['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x7d3f('0xba')]({'active':![],'countabandonedretry':_0x40f7b['countabandonedretry']+=0x1,'scheduledat':moment()[_0x7d3f('0xf5')](_0x5f1e17[_0x7d3f('0x11c')],_0x7d3f('0xff'))[_0x7d3f('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40f7b[_0x7d3f('0xcc')],'ListId':_0x40f7b[_0x7d3f('0xf7')],'VoiceQueueId':_0x40f7b['VoiceQueueId']||undefined,'CampaignId':_0x40f7b[_0x7d3f('0xce')]||undefined})[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x11d')));break;case 0x13:if(_0x40f7b[_0x7d3f('0xe7')]>=_0x5f1e17[_0x7d3f('0xfe')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x40f7b['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x5f1e17['dialMachineRetryFrequency'],_0x7d3f('0xff'))['format'](_0x7d3f('0x100')),'ContactId':_0x40f7b[_0x7d3f('0xcc')],'ListId':_0x40f7b['ListId'],'VoiceQueueId':_0x40f7b['VoiceQueueId']||undefined,'CampaignId':_0x40f7b[_0x7d3f('0xce')]||undefined})['catch'](loggerCatch(_0x7d3f('0xf9')));break;case 0x14:if(_0x40f7b['countagentrejectretry']>=_0x5f1e17[_0x7d3f('0x19c')]-0x1){return!![];}this[_0x7d3f('0xba')]({'active':![],'countagentrejectretry':_0x40f7b[_0x7d3f('0xf1')]+=0x1,'scheduledat':moment()[_0x7d3f('0xf5')](_0x5f1e17[_0x7d3f('0x19d')],_0x7d3f('0xff'))[_0x7d3f('0x75')](_0x7d3f('0x100')),'ContactId':_0x40f7b[_0x7d3f('0xcc')],'ListId':_0x40f7b[_0x7d3f('0xf7')],'VoiceQueueId':_0x40f7b['VoiceQueueId']||undefined,'CampaignId':_0x40f7b[_0x7d3f('0xce')]||undefined})['catch'](loggerCatch(_0x7d3f('0x19e')));break;default:return!![];}};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x190')]=function(_0x2b5ea,_0x2d8e7d,_0x53c39f){var _0x2cca0a=this;var _0x1d3eab=new History(_0x2b5ea);return new BPromise(function(_0x1bdfce,_0x16b5e3){if(_[_0x7d3f('0x3d')](_0x2d8e7d)&&typeof _0x2d8e7d!==_0x7d3f('0x19f')){return _0x16b5e3(msgResponse(_0x7d3f('0x1a0'),'Failure','entity\x20is\x20undefine'));}if(_[_0x7d3f('0x3d')](_0x53c39f)&&typeof _0x53c39f!==_0x7d3f('0x19f')){return _0x16b5e3(msgResponse(_0x7d3f('0x1a0'),_0x7d3f('0x13d'),_0x7d3f('0x1a1')));}switch(_0x53c39f['reason']){case'0':_0x2d8e7d['outboundNoSuchCallsDay']+=0x1;_0x1d3eab['state']=0x0;_0x1d3eab[_0x7d3f('0xa5')]='NoSuchNumber';_0x1d3eab[_0x7d3f('0xef')]+=0x1;_0x1d3eab[_0x7d3f('0xe8')]+=0x1;ami['emit'](_0x7d3f('0x1a2'),ut[_0x7d3f('0xe4')](_0x2b5ea,_0x7d3f('0x1a3')));_0x2cca0a[_0x7d3f('0xd5')](_0x1d3eab)[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0xeb')));if(_0x2cca0a['checkRetriveMax'](0x0,_0x2b5ea,_0x2d8e7d)){if(_0x1d3eab['countnosuchnumberretry']>=_0x2d8e7d['dialNoSuchNumberMaxRetry']){_0x2cca0a[_0x7d3f('0x1a4')](_0x1d3eab,_0x1bdfce,_0x16b5e3,'reason\x200\x20no\x20such\x20number....');}else{_0x2cca0a[_0x7d3f('0xf2')](_0x1d3eab,_0x1bdfce,_0x16b5e3,_0x7d3f('0x1a5'));}}break;case'3':_0x2d8e7d[_0x7d3f('0x63')]+=0x1;_0x1d3eab[_0x7d3f('0xa4')]=0x3;_0x1d3eab[_0x7d3f('0xa5')]=_0x7d3f('0x1a6');_0x1d3eab[_0x7d3f('0xee')]+=0x1;_0x1d3eab[_0x7d3f('0xe8')]+=0x1;ami[_0x7d3f('0xe3')](_0x7d3f('0x1a7'),ut['buildObj'](_0x2b5ea,_0x7d3f('0x1a8')));_0x2cca0a[_0x7d3f('0xd5')](_0x1d3eab)[_0x7d3f('0xad')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x2cca0a[_0x7d3f('0x192')](0x3,_0x2b5ea,_0x2d8e7d)){if(_0x1d3eab[_0x7d3f('0xee')]>=_0x2d8e7d['dialNoAnswerMaxRetry']){_0x2cca0a[_0x7d3f('0x1a4')](_0x1d3eab,_0x1bdfce,_0x16b5e3,_0x7d3f('0x1a9'));}else{_0x2cca0a['stateGlobal'](_0x1d3eab,_0x1bdfce,_0x16b5e3,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x2d8e7d[_0x7d3f('0x5f')]+=0x1;_0x1d3eab[_0x7d3f('0xa4')]=0x5;_0x1d3eab[_0x7d3f('0xa5')]=_0x7d3f('0x1aa');_0x1d3eab['countbusyretry']+=0x1;_0x1d3eab[_0x7d3f('0xe8')]+=0x1;ami[_0x7d3f('0xe3')](_0x7d3f('0x1ab'),ut[_0x7d3f('0xe4')](_0x2b5ea,_0x7d3f('0x1ac')));_0x2cca0a[_0x7d3f('0xd5')](_0x1d3eab)['catch'](loggerCatch(_0x7d3f('0x1ad')));if(_0x2cca0a['checkRetriveMax'](0x5,_0x2b5ea,_0x2d8e7d)){if(_0x1d3eab[_0x7d3f('0xec')]>=_0x2d8e7d[_0x7d3f('0x194')]){_0x2cca0a[_0x7d3f('0x1a4')](_0x1d3eab,_0x1bdfce,_0x16b5e3,'reason\x205\x20busy');}else{_0x2cca0a[_0x7d3f('0xf2')](_0x1d3eab,_0x1bdfce,_0x16b5e3,_0x7d3f('0x1ae'));}}break;case'8':_0x2d8e7d['outboundCongestionCallsDay']+=0x1;_0x1d3eab['state']=0x8;_0x1d3eab[_0x7d3f('0xa5')]=_0x7d3f('0x1af');_0x1d3eab[_0x7d3f('0xed')]+=0x1;_0x1d3eab[_0x7d3f('0xe8')]+=0x1;ami['emit'](_0x7d3f('0x1b0'),ut[_0x7d3f('0xe4')](_0x2b5ea,_0x7d3f('0x1b1')));_0x2cca0a[_0x7d3f('0xd5')](_0x1d3eab)[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x1b2')));if(_0x2cca0a[_0x7d3f('0x192')](0x8,_0x2b5ea,_0x2d8e7d)){if(_0x1d3eab[_0x7d3f('0xed')]>=_0x2d8e7d[_0x7d3f('0x195')]){_0x2cca0a[_0x7d3f('0x1a4')](_0x1d3eab,_0x1bdfce,_0x16b5e3,_0x7d3f('0x1b3'));}else{_0x2cca0a[_0x7d3f('0xf2')](_0x1d3eab,_0x1bdfce,_0x16b5e3,_0x7d3f('0x1b3'));}}break;case'11':_0x2d8e7d[_0x7d3f('0x1b4')]+=0x1;_0x1d3eab[_0x7d3f('0xa4')]=0xb;_0x1d3eab['statedesc']='Abandoned';_0x1d3eab[_0x7d3f('0xf0')]+=0x1;_0x1d3eab[_0x7d3f('0xe8')]+=0x1;_0x2cca0a['createHistory'](_0x1d3eab)[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x11e')));if(_0x2cca0a[_0x7d3f('0x192')](0xb,_0x2b5ea,_0x2d8e7d)){if(_0x1d3eab['countabandonedretry']>=_0x2d8e7d[_0x7d3f('0x1b5')]){_0x2cca0a[_0x7d3f('0x1a4')](_0x1d3eab,_0x1bdfce,_0x16b5e3,'reason\x2011\x20abandoned');}else{_0x2cca0a[_0x7d3f('0xf2')](_0x1d3eab,_0x1bdfce,_0x16b5e3,_0x7d3f('0x1b6'));}}break;case'20':_0x2d8e7d[_0x7d3f('0x66')]+=0x1;_0x1d3eab['state']=0x14;_0x1d3eab[_0x7d3f('0xa5')]=_0x7d3f('0x1b7');_0x1d3eab['countagentrejectretry']+=0x1;_0x1d3eab[_0x7d3f('0xe8')]+=0x1;ami['emit'](_0x7d3f('0x1b8'),ut[_0x7d3f('0xe4')](_0x2b5ea,_0x7d3f('0x1b9')));_0x2cca0a[_0x7d3f('0xd5')](_0x1d3eab)['catch'](loggerCatch(_0x7d3f('0x1ba')));if(_0x2cca0a[_0x7d3f('0x192')](0x14,_0x2b5ea,_0x2d8e7d)){if(_0x1d3eab['countagentrejectretry']>=_0x2d8e7d[_0x7d3f('0x19c')]){_0x2cca0a[_0x7d3f('0x1a4')](_0x1d3eab,_0x1bdfce,_0x16b5e3,_0x7d3f('0x1bb'));}else{_0x2cca0a[_0x7d3f('0xf2')](_0x1d3eab,_0x1bdfce,_0x16b5e3,'reason\x2020\x20agentreject');}}break;default:_0x2d8e7d['outboundUnknownCallsDay']+=0x1;_0x1d3eab[_0x7d3f('0xa4')]=0xc;_0x1d3eab[_0x7d3f('0xa5')]=_0x53c39f[_0x7d3f('0x108')];_0x2cca0a['createHistory'](_0x1d3eab)[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x1bc')));if(_0x2cca0a[_0x7d3f('0x192')](_0x53c39f[_0x7d3f('0x108')],_0x2b5ea,_0x2d8e7d)){if(_0x1d3eab['countbusyretry']+_0x1d3eab['countcongestionretry']+_0x1d3eab[_0x7d3f('0xee')]+_0x1d3eab[_0x7d3f('0xef')]+_0x1d3eab['countdropretry']+_0x1d3eab[_0x7d3f('0xf0')]+_0x1d3eab['countmachineretry']+_0x1d3eab[_0x7d3f('0xf1')]>=_0x2d8e7d[_0x7d3f('0xfd')]){_0x2cca0a[_0x7d3f('0xf2')](_0x1d3eab,_0x1bdfce,_0x16b5e3,_0x53c39f[_0x7d3f('0x108')]);}else{_0x2cca0a[_0x7d3f('0x1a4')](_0x1d3eab,_0x1bdfce,_0x16b5e3,_0x53c39f[_0x7d3f('0x108')]);}}}});};Dialer[_0x7d3f('0x1b')][_0x7d3f('0xf2')]=function(_0xbd051b,_0x1d7d1c,_0x90d33f,_0x4a65b0){var _0x1a63a9=new Final(_0xbd051b);_0x1a63a9[_0x7d3f('0xa4')]=0xf;_0x1a63a9[_0x7d3f('0xa5')]=_0x7d3f('0x1bd');this[_0x7d3f('0x1a4')](_0x1a63a9,_0x1d7d1c,_0x90d33f,_0x4a65b0);};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x1a4')]=function(_0x4b3293,_0x4d96c4,_0xcfee27,_0x3721a2){this[_0x7d3f('0xc4')](_0x4b3293)['then'](function(){return _0x4d96c4(msgResponse(_0x7d3f('0x1a0'),_0x7d3f('0xd1'),_0x3721a2));})['catch'](function(){return _0xcfee27(msgResponse(_0x7d3f('0x1be'),'Failure',_0x7d3f('0x1bf')));});};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x154')]=function(_0x3270dc){var _0x4f6941=_0x3270dc['dialPredictiveOptimizationPercentage']/0x64;var _0x4ba774=_0x3270dc[_0x7d3f('0x62')]/(_0x3270dc[_0x7d3f('0x62')]+_0x3270dc[_0x7d3f('0x5e')]);var _0x3a2842=Math[_0x7d3f('0x1c0')](_0x3270dc[_0x7d3f('0x6d')]*(_0x3270dc[_0x7d3f('0x1c1')]/0x64));var _0x1e28f6=Math[_0x7d3f('0x1c0')](_0x3270dc[_0x7d3f('0x6d')]*(_0x3270dc[_0x7d3f('0x1c2')]/0x64));var _0x77f98f=_0x3270dc[_0x7d3f('0x1c3')]+_0x3270dc['talking'];var _0x4b3472=Math[_0x7d3f('0x1c4')](_0x3270dc['erlangCalls']*_0x3270dc[_0x7d3f('0x86')]*_0x3270dc['predictiveIntervalHitRate']*_0x3270dc['predictiveIntervalMultiplicativeFactor']);if(_[_0x7d3f('0x3d')](_0x3270dc[_0x7d3f('0x28')])){if(!_[_0x7d3f('0x3d')](_0x3270dc[_0x7d3f('0x27')])){_0x3270dc[_0x7d3f('0x27')]=undefined;loggerPredictive[_0x7d3f('0x90')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x7d3f('0x3d')](_0x3270dc[_0x7d3f('0x8b')])){loggerPredictive[_0x7d3f('0x90')](_0x7d3f('0x1c5'),_0x7d3f('0x1c6'));clearInterval(_0x3270dc[_0x7d3f('0x8b')]);_0x3270dc[_0x7d3f('0x8b')]=undefined;}_0x3270dc[_0x7d3f('0x28')]=moment()[_0x7d3f('0x75')](_0x7d3f('0x100'));loggerPredictive[_0x7d3f('0x78')](_0x3270dc['name'],_0x7d3f('0x1c7'),_0x3270dc['startProgressive']);this[_0x7d3f('0x151')](_0x3270dc,0x1);}else if(ifInterval(_0x3270dc['dialPredictiveInterval'],_0x3270dc[_0x7d3f('0x28')])){this[_0x7d3f('0x151')](_0x3270dc,0x1);loggerPredictiveCalls[_0x7d3f('0x78')](_0x7d3f('0x1c8'),_0x3270dc[_0x7d3f('0x28')],_0x3270dc[_0x7d3f('0x40')]);_0x3270dc['erlangCalls']=0x0;_0x3270dc[_0x7d3f('0x6a')]=0x0;}else if(_0x4f6941<_0x4ba774&&_0x3270dc['dialPredictiveOptimization']===_0x7d3f('0x1c9')){freeVariablesPredictive(_0x3270dc);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x1ca'),_0x7d3f('0x1cb'),_0x4ba774,'startProgressive',_0x3270dc[_0x7d3f('0x40')]);}else if(_0x4b3472<_0x3270dc[_0x7d3f('0x6a')]&&_0x3270dc[_0x7d3f('0x1cc')]===_0x7d3f('0x1c9')){freeVariablesPredictive(_0x3270dc);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x1cd'),_0x7d3f('0x1ce'),_0x4b3472,'Drop\x20in\x20this\x20interval',_0x3270dc[_0x7d3f('0x6a')],'startProgressive',_0x3270dc[_0x7d3f('0x40')]);}else if(!ifInterval(_0x3270dc[_0x7d3f('0x1cf')],_0x3270dc[_0x7d3f('0x28')])&&_[_0x7d3f('0x3d')](_0x3270dc['startPredictive'])&&!_['isUndefined'](_0x3270dc[_0x7d3f('0x28')])){_0x3270dc[_0x7d3f('0x27')]=moment()[_0x7d3f('0x75')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x7d3f('0x78')](_0x3270dc[_0x7d3f('0x40')],_0x7d3f('0x1d0'),_0x3270dc[_0x7d3f('0x27')]);this[_0x7d3f('0xb8')](_0x3270dc[_0x7d3f('0x1cf')])[_0x7d3f('0x3b')](this['getDataPredictive'](_0x3270dc))['then'](mergeDataErlangB(_0x3270dc))[_0x7d3f('0x3b')](this[_0x7d3f('0x1d1')](_0x3270dc))[_0x7d3f('0xad')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x3270dc));}else if(!ifInterval(_0x3270dc['dialPredictiveInterval'],_0x3270dc[_0x7d3f('0x27')])){_0x3270dc[_0x7d3f('0x6a')]=0x0;_0x3270dc['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x7d3f('0x78')](_0x3270dc['name'],_0x7d3f('0x1d2'),_0x3270dc[_0x7d3f('0x27')]);clearInterval(_0x3270dc[_0x7d3f('0x8b')]);_0x3270dc[_0x7d3f('0x8b')]=undefined;this[_0x7d3f('0xb8')](_0x3270dc['dialPredictiveInterval'])[_0x7d3f('0x3b')](this['getDataPredictive'](_0x3270dc))['then'](mergeDataErlangB(_0x3270dc))[_0x7d3f('0x3b')](this[_0x7d3f('0x1d1')](_0x3270dc))[_0x7d3f('0xad')](loggerCatchPredictive(_0x7d3f('0x1d3'),_0x3270dc));}else if(_0x3270dc[_0x7d3f('0x6d')]&&_0x77f98f<_0x3270dc[_0x7d3f('0x6d')]-_0x1e28f6){freeVariablesPredictive(_0x3270dc);loggerPredictive[_0x7d3f('0x78')](_0x3270dc[_0x7d3f('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x77f98f,_0x7d3f('0x1d4'),_0x3270dc[_0x7d3f('0x6d')],'-',_0x1e28f6,'=',_0x3270dc['predictiveIntervalAvailable']-_0x1e28f6,')');}else if(_0x3270dc['predictiveIntervalAvailable']&&_0x77f98f>_0x3270dc[_0x7d3f('0x6d')]+_0x3a2842){freeVariablesPredictive(_0x3270dc);loggerPredictive[_0x7d3f('0x78')](_0x3270dc[_0x7d3f('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x77f98f,_0x7d3f('0x1d5'),_0x3270dc[_0x7d3f('0x6d')],'+',_0x3a2842,'=',_0x3270dc[_0x7d3f('0x6d')]+_0x3a2842,')');}};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x1d6')]=function(_0x1169e1){var _0x1bb1d4=this;return function(_0x4ee0b0){return new BPromise(function(_0x1b5b6f,_0x1d0063){_[_0x7d3f('0x89')](_0x1169e1,_0x4ee0b0[0x0]);if(checkGetDataPredictive(_0x4ee0b0[0x0])){var _0x40504d=_0x1169e1[_0x7d3f('0x6d')]=_0x1169e1[_0x7d3f('0x53')]+_0x1169e1[_0x7d3f('0x1c3')];var _0x18f50d=_0x1169e1[_0x7d3f('0x1cf')]*0x3c;var _0x40e3e1=_0x4ee0b0[0x0][_0x7d3f('0x7f')]+_0x4ee0b0[0x0][_0x7d3f('0x7d')];var _0x299a1d=(_0x4ee0b0[0x0][_0x7d3f('0x67')]+_0x4ee0b0[0x0][_0x7d3f('0x68')]+_0x4ee0b0[0x0][_0x7d3f('0x7b')])/_0x4ee0b0[0x0][_0x7d3f('0x6e')];_0x1169e1[_0x7d3f('0x1d7')]=_0x299a1d>0x0?_0x299a1d:0x1;switch(_0x1169e1['dialPredictiveOptimization']){case _0x7d3f('0x1c9'):var _0x166155=_0x1169e1[_0x7d3f('0x1d8')]/0x64;return _0x1bb1d4['abandonmentRate'](_0x40504d,_0x18f50d,_0x40e3e1,_0x299a1d,_0x166155)['then'](function(_0x1510d9){return _0x1b5b6f(_0x1510d9);});case _0x7d3f('0x1d9'):var _0x41caf6=_0x1169e1[_0x7d3f('0x1d8')]/0x64;return _0x1bb1d4[_0x7d3f('0x1da')](_0x40504d,_0x18f50d,_0x40e3e1,_0x299a1d,_0x41caf6)[_0x7d3f('0x3b')](function(_0x4b924d){return _0x1b5b6f(_0x4b924d);});default:return _0x1d0063(msgResponse(_0x7d3f('0x1db'),_0x7d3f('0x13d'),_0x7d3f('0x1dc')));}}else{return _0x1d0063(msgResponse(_0x7d3f('0x1db'),_0x7d3f('0x13d'),_0x7d3f('0x1dd')));}});};};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x1de')]=function(_0x401fb2){var _0x19421c=this;return function(_0x1c87d9){return new BPromise(function(_0x3baf29,_0x357229){_[_0x7d3f('0x89')](_0x401fb2,_0x1c87d9[0x0]);if(checkGetDataPredictive(_0x1c87d9[0x0])){loggerPredictive[_0x7d3f('0x78')](JSON[_0x7d3f('0x47')](_0x1c87d9[0x0]));if(_0x401fb2[_0x7d3f('0x1cc')]===_0x7d3f('0x1c9')){return _0x19421c['getVoiceQueueRtPauses'](_0x401fb2['id'])['then'](function(_0x216e52){var _0x38f0f3=_0x401fb2['loggedIn']-_0x216e52[0x0][_0x7d3f('0x1df')];var _0x274fcc=_0x401fb2['dialPredictiveInterval']*0x3c;var _0x318640=_0x1c87d9[0x0][_0x7d3f('0x7f')]+_0x1c87d9[0x0][_0x7d3f('0x7d')];var _0x427d32=(_0x1c87d9[0x0][_0x7d3f('0x67')]+_0x1c87d9[0x0][_0x7d3f('0x68')]+_0x1c87d9[0x0][_0x7d3f('0x7b')])/_0x1c87d9[0x0][_0x7d3f('0x6e')];var _0x1c08da=_0x401fb2['dialPredictiveOptimizationPercentage']/0x64;_0x401fb2[_0x7d3f('0x6c')]=_0x216e52[0x0]['outboundQueuePauses']||0x0;_0x401fb2['predictiveIntervalHitRate']=_0x427d32>0x0?_0x427d32:0x1;return _0x19421c[_0x7d3f('0x1e0')](_0x38f0f3,_0x274fcc,_0x318640,_0x427d32,_0x1c08da);})[_0x7d3f('0x3b')](function(_0xb353bc){return _0x3baf29(_0xb353bc);})[_0x7d3f('0xad')](function(_0x3a136f){return _0x357229(msgResponse('[CatchErlangB]',_0x7d3f('0x13d'),JSON[_0x7d3f('0x47')](_0x3a136f)));});}if(_0x401fb2['dialPredictiveOptimization']===_0x7d3f('0x1d9')){return _0x19421c[_0x7d3f('0xc2')](_0x401fb2['id'])[_0x7d3f('0x3b')](function(_0x2ae35b){var _0xcc8c87=_0x401fb2[_0x7d3f('0x4e')]-_0x2ae35b[0x0]['outboundQueuePauses'];var _0x55a66d=_0x401fb2[_0x7d3f('0x1cf')]*0x3c;var _0x2e1585=_0x1c87d9[0x0][_0x7d3f('0x7f')]+_0x1c87d9[0x0][_0x7d3f('0x7d')];var _0x3f89d8=(_0x1c87d9[0x0]['predictiveIntervalAnsweredCalls']+_0x1c87d9[0x0][_0x7d3f('0x68')]+_0x1c87d9[0x0][_0x7d3f('0x7b')])/_0x1c87d9[0x0][_0x7d3f('0x6e')];var _0x422680=_0x401fb2['dialPredictiveOptimizationPercentage']/0x64;_0x401fb2[_0x7d3f('0x6c')]=_0x2ae35b[0x0][_0x7d3f('0x1df')]||0x0;_0x401fb2[_0x7d3f('0x1d7')]=_0x3f89d8>0x0?_0x3f89d8:0x1;return _0x19421c[_0x7d3f('0x1da')](_0xcc8c87,_0x55a66d,_0x2e1585,_0x3f89d8,_0x422680);})[_0x7d3f('0x3b')](function(_0x80275c){return _0x3baf29(_0x80275c);})[_0x7d3f('0xad')](function(_0xd0d8bb){return _0x357229(msgResponse(_0x7d3f('0x1e1'),_0x7d3f('0x13d'),JSON['stringify'](_0xd0d8bb)));});}}else{return _0x357229(msgResponse(_0x7d3f('0x1db'),'Failure',_0x7d3f('0x1dd')));}});};};Dialer[_0x7d3f('0x1b')]['startMethodPredictive']=function(_0x52ef77){var _0x5e3a7f=this;return function(){var _0x1c5d3d=0x0;var _0x37468d=Math[_0x7d3f('0x1c4')](_0x52ef77[_0x7d3f('0x1e2')]*0x3e8);if(_0x37468d>0x0){_0x37468d=_0x37468d<0x64?0x64:_0x37468d;loggerPredictive[_0x7d3f('0x78')](_0x52ef77['name'],_0x7d3f('0x1e3'),_0x37468d,_0x7d3f('0x48'));_0x52ef77[_0x7d3f('0x8b')]=setInterval(function(){_0x5e3a7f[_0x7d3f('0x8b')](_0x52ef77);loggerPredictiveCalls['info']('[handlePredictive]',_0x1c5d3d+=0x1);},_0x37468d);}else{loggerPredictive[_0x7d3f('0x78')](_0x52ef77[_0x7d3f('0x40')],_0x7d3f('0x1e4'));}};};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x1e5')]=function(_0x4562b6,_0x5b2297){var _0x3a5a8d=this;return function(_0x2365a5){if(_[_0x7d3f('0x46')](_0x2365a5)){if(_['isNil'](_0x5b2297[_0x7d3f('0xcd')])||!_0x5b2297['recallme']){if(_0x4562b6['dialMethod']===_0x7d3f('0x155')){_0x4562b6[_0x7d3f('0x125')]=_['isUndefined'](_0x4562b6[_0x7d3f('0x125')])?!![]:_0x4562b6[_0x7d3f('0x125')];var _0x1beabe=uuid['v4']();_0x3a5a8d[_0x7d3f('0x25')][_0x1beabe]=new Action(_0x4562b6,_0x5b2297,_0x1beabe);loggerBooked[_0x7d3f('0x78')](_0x7d3f('0x1e6'),_0x1beabe,_0x7d3f('0x1e7'),JSON[_0x7d3f('0x47')](_0x4562b6['queueStatusComplete']),_0x7d3f('0x1e8'),_0x4562b6[_0x7d3f('0x40')]);if(_0x4562b6[_0x7d3f('0x125')]){_0x4562b6['queueStatusComplete']=![];_0x3a5a8d[_0x7d3f('0x29')][_0x3a5a8d[_0x7d3f('0x25')][_0x1beabe][_0x7d3f('0xb2')]]=[];ami[_0x7d3f('0x142')]({'actionid':_0x1beabe,'action':'queuestatus','queue':_0x4562b6[_0x7d3f('0x40')]})[_0x7d3f('0xad')](function(){_0x3a5a8d[_0x7d3f('0xb0')](_0x4562b6);_0x3a5a8d['rescheduleContact']({'active':![],'ContactId':_0x3a5a8d[_0x7d3f('0x25')][_0x1beabe][_0x7d3f('0xcc')],'ListId':_0x3a5a8d[_0x7d3f('0x25')][_0x1beabe]['ListId'],'VoiceQueueId':_0x3a5a8d[_0x7d3f('0x25')][_0x1beabe]['VoiceQueueId']||undefined,'CampaignId':_0x3a5a8d[_0x7d3f('0x25')][_0x1beabe][_0x7d3f('0xce')]||undefined})[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x1e9')));delete _0x3a5a8d['actions'][_0x1beabe];});}else{loggerBooked[_0x7d3f('0x78')]('[booked][checkContactBlack][else]',JSON[_0x7d3f('0x47')](_0x4562b6[_0x7d3f('0x125')]),_0x7d3f('0x1e8'),_0x4562b6[_0x7d3f('0x40')]);_0x3a5a8d[_0x7d3f('0xb0')](_0x4562b6);_0x3a5a8d[_0x7d3f('0xba')]({'active':![],'ContactId':_0x3a5a8d['actions'][_0x1beabe][_0x7d3f('0xcc')],'ListId':_0x3a5a8d[_0x7d3f('0x25')][_0x1beabe][_0x7d3f('0xf7')],'VoiceQueueId':_0x3a5a8d['actions'][_0x1beabe][_0x7d3f('0xf8')]||undefined,'CampaignId':_0x3a5a8d['actions'][_0x1beabe][_0x7d3f('0xce')]||undefined})[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x1e9')));delete _0x3a5a8d['actions'][_0x1beabe];}}else{return _0x3a5a8d[_0x7d3f('0x162')](_0x4562b6,_0x5b2297);}}else{if(getDiff(_0x5b2297[_0x7d3f('0x1ea')])<_0x4562b6[_0x7d3f('0x1eb')]*0x3c){if(_0x5b2297[_0x7d3f('0x1ec')]&&!_0x5b2297[_0x7d3f('0x1ec')]['voicePause']){_0x3a5a8d[_0x7d3f('0x8c')][_0x7d3f('0x12f')](_0x5b2297['id'])[_0x7d3f('0x1e')](function(){_0x3a5a8d[_0x7d3f('0xb0')](_0x4562b6);});}else{_0x3a5a8d[_0x7d3f('0x1ed')]({'active':![]},_0x5b2297['id'],0x1)[_0x7d3f('0x1e')](function(){_0x3a5a8d['updateOriginated'](_0x4562b6);});}}else{_0x4562b6[_0x7d3f('0x65')]+=0x1;_0x3a5a8d[_0x7d3f('0xb0')](_0x4562b6);if(_0x4562b6[_0x7d3f('0x1ee')]){_0x3a5a8d[_0x7d3f('0xba')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5b2297['ContactId'],'ListId':_0x5b2297[_0x7d3f('0xf7')],'VoiceQueueId':_0x5b2297[_0x7d3f('0xf8')]||undefined,'CampaignId':_0x5b2297['CampaignId']||undefined})[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x1ef')));_0x3a5a8d[_0x7d3f('0xd5')](createObjHistory(_0x4562b6,_0x5b2297,_0x7d3f('0x1f0'),0x17,_0x7d3f('0x1f1')))[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x1f2')));}else{_0x3a5a8d[_0x7d3f('0xca')](createObjHistory(_0x4562b6,_0x5b2297,_0x7d3f('0x1f3'),0x16,_0x7d3f('0x1f4')),_0x7d3f('0x1f5'),'[Originate][HistoryRecallClose]');}}}}else{_0x4562b6['outboundBlacklistCallsDay']+=0x1;_0x3a5a8d['saveInDb'](createObjHistory(_0x4562b6,_0x5b2297,_0x7d3f('0x1f6'),0xd,'Blacklist'),_0x7d3f('0x1f7'),_0x7d3f('0x1f8'));throw _0x7d3f('0x1f9');}};};Dialer[_0x7d3f('0x1b')]['handleIvr']=function(_0x4c656f){var _0x59744=this;var _0x531cc6=_0x4c656f[_0x7d3f('0x1fa')]-_0x4c656f[_0x7d3f('0x6f')]-_0x4c656f[_0x7d3f('0xbe')];emitCampaignSummary(_0x4c656f);if(_0x531cc6>0x0){if(_0x531cc6>this['maxNumberOriginate']){_0x531cc6=this['maxNumberOriginate'];}_0x4c656f[_0x7d3f('0xbe')]+=_0x531cc6;this[_0x7d3f('0xc0')](_0x4c656f['id'],_0x531cc6,_0x4c656f[_0x7d3f('0x1fb')],_0x4c656f)[_0x7d3f('0x3b')](function(_0x3a0d88){_0x4c656f[_0x7d3f('0xbe')]-=_0x531cc6;_0x4c656f[_0x7d3f('0xbe')]=_0x4c656f[_0x7d3f('0xbe')]>0x0?_0x4c656f['temp']:0x0;if(!checkContactEmpty(_0x3a0d88)){_0x4c656f[_0x7d3f('0x3e')]=_0x7d3f('0x9b');logger[_0x7d3f('0x78')](_0x7d3f('0x1fc')+_0x4c656f[_0x7d3f('0x40')]);}else{_0x4c656f['originated']+=_0x3a0d88[_0x7d3f('0x93')];_0x4c656f[_0x7d3f('0x3e')]=_0x7d3f('0x1fd');for(var _0xabdcb0=0x0;_0xabdcb0<_0x3a0d88['length'];_0xabdcb0+=0x1){_0x4c656f[_0x7d3f('0x1fe')]+=0x1;if(_[_0x7d3f('0xd8')](_0x3a0d88[_0xabdcb0])||_[_0x7d3f('0xd8')](_0x3a0d88[_0xabdcb0][_0x7d3f('0x164')])||_[_0x7d3f('0xd8')](_0x3a0d88[_0xabdcb0][_0x7d3f('0x164')][_0x7d3f('0x165')])){_0x59744['emptyContact'](_0x7d3f('0x1ff'),_0x4c656f,_0x3a0d88[_0xabdcb0]);}else{_0x59744[_0x7d3f('0xb7')](_[_0x7d3f('0xcb')](_0x3a0d88[_0xabdcb0],[_0x7d3f('0xce'),_0x7d3f('0x200')]))[_0x7d3f('0x3b')](_0x59744[_0x7d3f('0x1e5')](_0x4c656f,_0x3a0d88[_0xabdcb0]))[_0x7d3f('0xad')](_0x59744[_0x7d3f('0xc7')]('[actionOriginateIvr]\x20',_0x4c656f));}}}})[_0x7d3f('0xad')](loggerGetContactDialer(_0x7d3f('0x201'),_0x4c656f,_0x531cc6));}};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x151')]=function(_0x831bc2,_0x2a42cf){var _0x1d9cf9=this;var _0x473c37=[];var _0x2f1f4e=_0x2a42cf>=0x1?_0x2a42cf:0x1;if(_0x831bc2['dialMethod']===_0x7d3f('0x155')){_0x2f1f4e=0x1;}var _0x5200fb=Math['floor'](_0x831bc2[_0x7d3f('0x1c3')]*_0x2f1f4e)-_0x831bc2[_0x7d3f('0x6f')]-_0x831bc2['temp'];emitVoiceQueueSummary(_0x831bc2);if(_0x831bc2[_0x7d3f('0x202')]>0x0){var _0x2566c2=_0x831bc2[_0x7d3f('0x202')]-_0x831bc2[_0x7d3f('0x6f')]-_0x831bc2[_0x7d3f('0x53')]-_0x831bc2[_0x7d3f('0xbe')]-_0x831bc2['pTalking'];if(_0x5200fb>_0x2566c2){_0x5200fb=_0x2566c2;}}if(_0x5200fb>0x0){if(_0x831bc2[_0x7d3f('0x58')]==='booked'){_0x5200fb=0x1;}if(_0x5200fb>this[_0x7d3f('0x23')]){_0x5200fb=this[_0x7d3f('0x23')];}_0x831bc2['temp']+=_0x5200fb;for(var _0x34e005 in this[_0x7d3f('0x21')]){if(typeof this[_0x7d3f('0x21')][_0x34e005]!==_0x7d3f('0x94')){if(this[_0x7d3f('0x21')][_0x34e005][_0x7d3f('0xa4')]===_0x7d3f('0x203')&&this[_0x7d3f('0x21')][_0x34e005][_0x7d3f('0xd4')]===_0x7d3f('0x204')){_0x473c37['push'](this['agents'][_0x34e005]['id']);}}}this[_0x7d3f('0xbd')](_0x831bc2['id'],_0x473c37,_0x5200fb,_0x831bc2['dialOrderByScheduledAt'],_0x831bc2)[_0x7d3f('0x3b')](function(_0x456826){_0x831bc2[_0x7d3f('0xbe')]-=_0x5200fb;_0x831bc2['temp']=_0x831bc2['temp']>0x0?_0x831bc2[_0x7d3f('0xbe')]:0x0;if(!checkContactEmpty(_0x456826)){_0x1d9cf9[_0x7d3f('0xb5')](_0x831bc2)[_0x7d3f('0x3b')](sendMessageReschedule(_0x831bc2))[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x205')));}else{_0x831bc2['originated']+=_0x456826[_0x7d3f('0x93')];_0x831bc2[_0x7d3f('0x3e')]=_0x831bc2[_0x7d3f('0x58')]==='booked'?_0x7d3f('0x16a'):_0x7d3f('0x1fd');for(var _0x43e46a=0x0;_0x43e46a<_0x456826[_0x7d3f('0x93')];_0x43e46a+=0x1){if(_[_0x7d3f('0xd8')](_0x456826[_0x43e46a])||_[_0x7d3f('0xd8')](_0x456826[_0x43e46a][_0x7d3f('0x164')])||_[_0x7d3f('0xd8')](_0x456826[_0x43e46a][_0x7d3f('0x164')][_0x7d3f('0x165')])){_0x1d9cf9[_0x7d3f('0xc8')]('[actionOriginate]\x20',_0x831bc2,_0x456826[_0x43e46a]);}else{_0x1d9cf9[_0x7d3f('0xb6')](_[_0x7d3f('0xcb')](_0x456826[_0x43e46a],[_0x7d3f('0xf8'),_0x7d3f('0x200')]))[_0x7d3f('0x3b')](_0x1d9cf9[_0x7d3f('0x1e5')](_0x831bc2,_0x456826[_0x43e46a]))[_0x7d3f('0xad')](_0x1d9cf9[_0x7d3f('0xc7')](_0x7d3f('0x1ff'),_0x831bc2));}}}})[_0x7d3f('0xad')](loggerGetContactDialer(_0x7d3f('0x206'),_0x831bc2,_0x5200fb));}};Dialer['prototype'][_0x7d3f('0x8b')]=function(_0x5afcb6){if(_0x5afcb6[_0x7d3f('0x202')]>0x0){var _0x595454=_0x5afcb6[_0x7d3f('0x202')]-_0x5afcb6[_0x7d3f('0x6f')]-_0x5afcb6[_0x7d3f('0x53')];if(_0x595454>0x0){this[_0x7d3f('0x207')](_0x5afcb6);}else{loggerPredictiveCalls[_0x7d3f('0x78')](_0x7d3f('0x208'));}}else{this['tryOriginatePredictive'](_0x5afcb6);}};Dialer[_0x7d3f('0x1b')][_0x7d3f('0x207')]=function(_0x1a42a1){var _0x3b11cf=this;var _0x2e3331=[];_0x1a42a1['originated']+=0x1;for(var _0xc6779c in this[_0x7d3f('0x21')]){if(typeof this[_0x7d3f('0x21')][_0xc6779c]!==_0x7d3f('0x94')){if(this[_0x7d3f('0x21')][_0xc6779c][_0x7d3f('0xa4')]===_0x7d3f('0x203')&&this[_0x7d3f('0x21')][_0xc6779c][_0x7d3f('0xd4')]===_0x7d3f('0x204')){_0x2e3331[_0x7d3f('0x124')](this[_0x7d3f('0x21')][_0xc6779c]['id']);}}}this[_0x7d3f('0xbd')](_0x1a42a1['id'],_0x2e3331,0x1,_0x1a42a1[_0x7d3f('0x1fb')],_0x1a42a1)['then'](function(_0x35fb82){if(!checkContactEmpty(_0x35fb82)){checkContactLowerLimitOriginate(_0x1a42a1,0x1,0x0);_0x3b11cf['countReScheduled'](_0x1a42a1)['then'](sendMessageReschedule(_0x1a42a1))[_0x7d3f('0xad')](loggerCatch(_0x7d3f('0x205')));}else{_0x1a42a1[_0x7d3f('0x3e')]=_0x7d3f('0x1fd');if(_['isNil'](_0x35fb82[0x0])||_[_0x7d3f('0xd8')](_0x35fb82[0x0]['Contact'])||_[_0x7d3f('0xd8')](_0x35fb82[0x0]['Contact'][_0x7d3f('0x165')])){_0x3b11cf['emptyContact'](_0x7d3f('0x1ff'),_0x1a42a1,_0x35fb82[0x0]);}else{_0x3b11cf[_0x7d3f('0xb6')](_['pick'](_0x35fb82[0x0],[_0x7d3f('0xf8'),_0x7d3f('0x200')]))[_0x7d3f('0x3b')](_0x3b11cf[_0x7d3f('0x1e5')](_0x1a42a1,_0x35fb82[0x0]))[_0x7d3f('0xad')](_0x3b11cf[_0x7d3f('0xc7')](_0x7d3f('0x209'),_0x1a42a1));}}})[_0x7d3f('0xad')](loggerGetContactDialer(_0x7d3f('0x20a'),_0x1a42a1,0x1));emitVoiceQueueSummary(_0x1a42a1);};Dialer[_0x7d3f('0x1b')]['abandonmentRate']=function(_0x1267ac,_0x5d3008,_0x3dfaa4,_0xc97598,_0x22e910,_0x1601c1){loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x20b'));loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x20c'),_0x1267ac);loggerPredictive['info'](_0x7d3f('0x20d'),_0x5d3008);loggerPredictive['info']('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',_0x3dfaa4);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x20e'),_0xc97598);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x20f'),_0x22e910);loggerPredictive['info'](_0x7d3f('0x88'));return new BPromise(function(_0x11a6b9,_0x2a2ae8){if(_0x1267ac<=0x0||isNaN(_0x1267ac)){return _0x2a2ae8(msgResponse(_0x7d3f('0x210'),_0x7d3f('0x211'),_0x7d3f('0x212')+_0x1267ac));}if(_0x3dfaa4<=0x0||isNaN(_0x3dfaa4)){return _0x2a2ae8(msgResponse(_0x7d3f('0x210'),_0x7d3f('0x211'),_0x7d3f('0x213')+_0x3dfaa4));}if(_0xc97598<=0x0||isNaN(_0xc97598)){return _0x2a2ae8(msgResponse(_0x7d3f('0x210'),_0x7d3f('0x211'),'p\x20=\x20'+_0xc97598));}if(_0x5d3008<=0x0||isNaN(_0x5d3008)){return _0x2a2ae8(msgResponse('[abandonmentRate]','Error','interval\x20=\x20'+_0x5d3008));}if(_0x22e910<=0x0||isNaN(_0x22e910)){return _0x2a2ae8(msgResponse(_0x7d3f('0x210'),_0x7d3f('0x211'),_0x7d3f('0x214')+_0x22e910));}_0x1601c1=_0x1601c1||0x0;var _0x4ee036=0x1/_0x3dfaa4;var _0x87d6e2=0x0;var _0x21bd68=0x0;var _0x3dc90d=0x0;var _0x59c26c=0x0;for(var _0x539cf2=0x0;_0x3dc90d<_0x22e910;_0x539cf2+=0x1){_0x21bd68=_0x539cf2/_0x5d3008;_0x87d6e2=(_0xc97598*_0x21bd68+_0x1601c1)/_0x4ee036;_0x3dc90d=erlangb(_0x87d6e2,_0x1267ac);_0x59c26c=_0x87d6e2/_0x1267ac*(0x1-erlangb(_0x87d6e2,_0x1267ac));}return _0x11a6b9({'erlangCalls':_0x539cf2,'erlangCallToSecond':_0x5d3008/_0x539cf2,'erlangAbandonmentRate':_0x3dc90d,'erlangBusyFactor':_0x59c26c});});};Dialer['prototype']['busyFactor']=function(_0x11874e,_0x496e51,_0x13575a,_0x50b7e0,_0x3338ea,_0x165af9){loggerPredictive[_0x7d3f('0x78')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x20c'),_0x11874e);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x20d'),_0x496e51);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x215'),_0x13575a);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x20e'),_0x50b7e0);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x216'),_0x3338ea);loggerPredictive[_0x7d3f('0x78')](_0x7d3f('0x88'));return new BPromise(function(_0x146312,_0x377bba){if(_0x11874e<=0x0||isNaN(_0x11874e)){return _0x377bba(msgResponse(_0x7d3f('0x217'),_0x7d3f('0x211'),'m\x20=\x20'+_0x11874e));}if(_0x13575a<=0x0||isNaN(_0x13575a)){return _0x377bba(msgResponse(_0x7d3f('0x217'),_0x7d3f('0x211'),_0x7d3f('0x213')+_0x13575a));}if(_0x50b7e0<=0x0||isNaN(_0x50b7e0)){return _0x377bba(msgResponse(_0x7d3f('0x217'),'Error',_0x7d3f('0x218')+_0x50b7e0));}if(_0x496e51<=0x0||isNaN(_0x496e51)){return _0x377bba(msgResponse(_0x7d3f('0x217'),_0x7d3f('0x211'),_0x7d3f('0x219')+_0x496e51));}if(_0x3338ea<=0x0||isNaN(_0x3338ea)){return _0x377bba(msgResponse(_0x7d3f('0x217'),'Error',_0x7d3f('0x21a')+_0x3338ea));}_0x165af9=_0x165af9||0x0;var _0xd18d42=0x1/_0x13575a;var _0x12d7f3=0x0;var _0x521770=0x0;var _0x4f02ac=0x0;var _0x4312f9=0x0;for(var _0x59794f=0x0;_0x4312f9<_0x3338ea;_0x59794f+=0x1){_0x521770=_0x59794f/_0x496e51;_0x12d7f3=(_0x50b7e0*_0x521770+_0x165af9)/_0xd18d42;_0x4f02ac=erlangb(_0x12d7f3,_0x11874e);_0x4312f9=_0x12d7f3/_0x11874e*(0x1-erlangb(_0x12d7f3,_0x11874e));}return _0x146312({'erlangCalls':_0x59794f,'erlangCallToSecond':_0x496e51/_0x59794f,'erlangAbandonmentRate':_0x4f02ac,'erlangBusyFactor':_0x4312f9});});};module[_0x7d3f('0x21b')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index d6516e3..552dc80 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 _0x98ae=['campaigntype','outbound','queue','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat'];(function(_0x5b7191,_0x4f3672){var _0xb52e1=function(_0x25c28a){while(--_0x25c28a){_0x5b7191['push'](_0x5b7191['shift']());}};_0xb52e1(++_0x4f3672);}(_0x98ae,0x142));var _0xe98a=function(_0x3726f5,_0x1e7c3b){_0x3726f5=_0x3726f5-0x0;var _0x16c259=_0x98ae[_0x3726f5];return _0x16c259;};'use strict';var util=require(_0xe98a('0x0'));var _=require(_0xe98a('0x1'));var moment=require(_0xe98a('0x2'));function getSeconds(_0x515b67,_0x511368){var _0x2d028d=moment(_0x515b67)[_0xe98a('0x3')](0x0);var _0x45a2fa=moment(_0x511368)['milliseconds'](0x0);return _0x2d028d[_0xe98a('0x4')](_0x45a2fa,_0xe98a('0x5'));}function QueueCallerAbandon(_0x56e86c,_0x1cc98d){this[_0xe98a('0x6')]=_0x56e86c[_0xe98a('0x6')];this['type']=_0x56e86c['type'];this[_0xe98a('0x7')]=_0x56e86c['type']===_0xe98a('0x8')?_0xe98a('0x9'):_0x56e86c[_0xe98a('0xa')];this[_0xe98a('0xb')]=_0x56e86c[_0xe98a('0xb')];this[_0xe98a('0xc')]=_0x56e86c[_0xe98a('0xc')];this[_0xe98a('0xd')]=_0x56e86c['countnoanswerretry'];this[_0xe98a('0xe')]=_0x56e86c[_0xe98a('0xb')]+_0x56e86c[_0xe98a('0xc')]+_0x56e86c[_0xe98a('0xd')]+_0x56e86c[_0xe98a('0xf')]+_0x56e86c[_0xe98a('0x10')]+_0x56e86c[_0xe98a('0x11')]+_0x56e86c[_0xe98a('0x12')]+_0x56e86c['countagentrejectretry'];this['countnosuchnumberretry']=_0x56e86c['countnosuchnumberretry'];this[_0xe98a('0x10')]=_0x56e86c['countdropretry'];this[_0xe98a('0x11')]=_0x56e86c[_0xe98a('0x11')];this['countmachineretry']=_0x56e86c['countmachineretry'];this['countagentrejectretry']=_0x56e86c[_0xe98a('0x13')];this[_0xe98a('0x14')]=_0x1cc98d[_0xe98a('0x14')];this[_0xe98a('0x15')]=_0x56e86c[_0xe98a('0x16')];this[_0xe98a('0x17')]=_0x56e86c[_0xe98a('0x18')];this[_0xe98a('0x19')]=_0x56e86c[_0xe98a('0x19')];this[_0xe98a('0x1a')]=_0x56e86c[_0xe98a('0x1a')];this['droptime']=_0x56e86c[_0xe98a('0x1b')];this[_0xe98a('0x1c')]=this[_0xe98a('0x1b')];this[_0xe98a('0x1d')]=getSeconds(_0x56e86c[_0xe98a('0x1a')],_0x56e86c[_0xe98a('0x19')]);this[_0xe98a('0x1e')]=getSeconds(this['droptime'],_0x56e86c[_0xe98a('0x1a')]);this[_0xe98a('0x1f')]=0x0;this[_0xe98a('0x9')]=_0x1cc98d[_0xe98a('0x9')];this[_0xe98a('0x20')]=_0x1cc98d[_0xe98a('0x21')];this[_0xe98a('0x22')]=_0x1cc98d[_0xe98a('0x22')];this[_0xe98a('0x23')]=_0x56e86c[_0xe98a('0x23')];this['callbackuniqueid']=_0x56e86c[_0xe98a('0x24')];this[_0xe98a('0x25')]=_0x56e86c[_0xe98a('0x25')];this[_0xe98a('0x26')]=_0x56e86c[_0xe98a('0x26')];this[_0xe98a('0x27')]=_0x56e86c[_0xe98a('0x27')];this['ListId']=_0x56e86c[_0xe98a('0x28')];this[_0xe98a('0x29')]=_0x56e86c['UserId'];this['VoiceQueueId']=_0x56e86c[_0xe98a('0x2a')];this[_0xe98a('0x2b')]=_0x56e86c['CampaignId'];this['originatecalleridnum']=_0x56e86c[_0xe98a('0x2c')]||'';this[_0xe98a('0x2d')]=_0x56e86c[_0xe98a('0x2d')]||'';}module[_0xe98a('0x2e')]=QueueCallerAbandon; \ No newline at end of file +var _0x4cd7=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x110230,_0x9327b4){var _0xef860f=function(_0x146037){while(--_0x146037){_0x110230['push'](_0x110230['shift']());}};_0xef860f(++_0x9327b4);}(_0x4cd7,0x1de));var _0x74cd=function(_0x186c63,_0x174f6c){_0x186c63=_0x186c63-0x0;var _0x333e8a=_0x4cd7[_0x186c63];return _0x333e8a;};'use strict';var util=require('util');var _=require(_0x74cd('0x0'));var moment=require(_0x74cd('0x1'));function getSeconds(_0xa57854,_0x3f1734){var _0x63a4d7=moment(_0xa57854)[_0x74cd('0x2')](0x0);var _0x5357c1=moment(_0x3f1734)[_0x74cd('0x2')](0x0);return _0x63a4d7['diff'](_0x5357c1,_0x74cd('0x3'));}function QueueCallerAbandon(_0x7f9dcc,_0x181907){this[_0x74cd('0x4')]=_0x7f9dcc['scheduledat'];this[_0x74cd('0x5')]=_0x7f9dcc[_0x74cd('0x5')];this[_0x74cd('0x6')]=_0x7f9dcc[_0x74cd('0x5')]==='outbound'?_0x74cd('0x7'):_0x7f9dcc[_0x74cd('0x5')];this[_0x74cd('0x8')]=_0x7f9dcc[_0x74cd('0x8')];this[_0x74cd('0x9')]=_0x7f9dcc['countcongestionretry'];this[_0x74cd('0xa')]=_0x7f9dcc[_0x74cd('0xa')];this[_0x74cd('0xb')]=_0x7f9dcc[_0x74cd('0x8')]+_0x7f9dcc[_0x74cd('0x9')]+_0x7f9dcc['countnoanswerretry']+_0x7f9dcc['countnosuchnumberretry']+_0x7f9dcc[_0x74cd('0xc')]+_0x7f9dcc[_0x74cd('0xd')]+_0x7f9dcc[_0x74cd('0xe')]+_0x7f9dcc['countagentrejectretry'];this[_0x74cd('0xf')]=_0x7f9dcc['countnosuchnumberretry'];this[_0x74cd('0xc')]=_0x7f9dcc['countdropretry'];this[_0x74cd('0xd')]=_0x7f9dcc[_0x74cd('0xd')];this[_0x74cd('0xe')]=_0x7f9dcc[_0x74cd('0xe')];this[_0x74cd('0x10')]=_0x7f9dcc[_0x74cd('0x10')];this[_0x74cd('0x11')]=_0x181907['uniqueid'];this[_0x74cd('0x12')]=_0x7f9dcc[_0x74cd('0x13')];this[_0x74cd('0x14')]=_0x7f9dcc[_0x74cd('0x15')];this[_0x74cd('0x16')]=_0x7f9dcc[_0x74cd('0x16')];this[_0x74cd('0x17')]=_0x7f9dcc['responsetime'];this['droptime']=_0x7f9dcc[_0x74cd('0x18')];this[_0x74cd('0x19')]=this[_0x74cd('0x18')];this[_0x74cd('0x1a')]=getSeconds(_0x7f9dcc[_0x74cd('0x17')],_0x7f9dcc['starttime']);this[_0x74cd('0x1b')]=getSeconds(this[_0x74cd('0x18')],_0x7f9dcc[_0x74cd('0x17')]);this[_0x74cd('0x1c')]=0x0;this['queue']=_0x181907[_0x74cd('0x7')];this[_0x74cd('0x1d')]=_0x181907[_0x74cd('0x1e')];this[_0x74cd('0x1f')]=_0x181907[_0x74cd('0x1f')];this[_0x74cd('0x20')]=_0x7f9dcc['callback'];this[_0x74cd('0x21')]=_0x7f9dcc['callbackuniqueid'];this[_0x74cd('0x22')]=_0x7f9dcc[_0x74cd('0x22')];this[_0x74cd('0x23')]=_0x7f9dcc[_0x74cd('0x23')];this[_0x74cd('0x24')]=_0x7f9dcc[_0x74cd('0x24')];this['ListId']=_0x7f9dcc[_0x74cd('0x25')];this[_0x74cd('0x26')]=_0x7f9dcc[_0x74cd('0x26')];this[_0x74cd('0x27')]=_0x7f9dcc[_0x74cd('0x27')];this[_0x74cd('0x28')]=_0x7f9dcc[_0x74cd('0x28')];this[_0x74cd('0x29')]=_0x7f9dcc[_0x74cd('0x29')]||'';this['originatecalleridname']=_0x7f9dcc[_0x74cd('0x2a')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 0177e4f..84945ed 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(_0x2a87c4,_0x255a21){var _0x2f2ee4=function(_0x2c6d35){while(--_0x2c6d35){_0x2a87c4['push'](_0x2a87c4['shift']());}};_0x2f2ee4(++_0x255a21);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x32dc73,_0x1ba3d0){var _0x2fcf75=function(_0x17fc82){while(--_0x17fc82){_0x32dc73['push'](_0x32dc73['shift']());}};_0x2fcf75(++_0x1ba3d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index c68c578..f48c49f 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 _0x02ce=['operation','status','filename','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatus','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','isValid','Trunk\x20Reachable','format','path','execute','%s/%s.tif','XMF-PATH','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncReceiveFax','hangup','originateresponse','prototype','context','hasOwnProperty','exten','localstationid','channel','name','info','uniqueid','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncFaxStatus'];(function(_0x4b596b,_0x40c78){var _0x4abbad=function(_0x4741c4){while(--_0x4741c4){_0x4b596b['push'](_0x4b596b['shift']());}};_0x4abbad(++_0x40c78);}(_0x02ce,0x1ac));var _0xe02c=function(_0x41db6a,_0x2096f3){_0x41db6a=_0x41db6a-0x0;var _0x289183=_0x02ce[_0x41db6a];return _0x289183;};'use strict';var util=require(_0xe02c('0x0'));var _=require(_0xe02c('0x1'));var BPromise=require(_0xe02c('0x2'));var uuid=require('uuid');var moment=require(_0xe02c('0x3'));var path=require('path');var tiff2pdf=require(_0xe02c('0x4'));var gs=require(_0xe02c('0x5'));var logger=require(_0xe02c('0x6'))(_0xe02c('0x7'));var ami=require(_0xe02c('0x8'));var rpcDb=require(_0xe02c('0x9'));var Channel=require(_0xe02c('0xa'));var ut=require(_0xe02c('0xb'));var Action=require(_0xe02c('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0xe02c('0xd'));function Fax(_0x2d85d7){this[_0xe02c('0xe')]={};this[_0xe02c('0xf')]=_0x2d85d7[_0xe02c('0xf')];this[_0xe02c('0x10')]=_0x2d85d7[_0xe02c('0x10')];this[_0xe02c('0x11')]={};ami['on'](_0xe02c('0x12'),this[_0xe02c('0x13')][_0xe02c('0x14')](this));ami['on'](_0xe02c('0x15'),this[_0xe02c('0x16')][_0xe02c('0x14')](this));ami['on'](_0xe02c('0x17'),this[_0xe02c('0x18')][_0xe02c('0x14')](this));ami['on'](_0xe02c('0x19'),this['syncNewExten'][_0xe02c('0x14')](this));ami['on']('faxstatus',this['syncFaxStatus'][_0xe02c('0x14')](this));ami['on']('receivefax',this[_0xe02c('0x1a')]['bind'](this));ami['on'](_0xe02c('0x1b'),this['syncHangup'][_0xe02c('0x14')](this));ami['on'](_0xe02c('0x1c'),this['syncOriginateResponse'][_0xe02c('0x14')](this));}Fax[_0xe02c('0x1d')]['syncNewchannel']=function(_0x12a564){if(_0x12a564[_0xe02c('0x1e')]==='from-voip-provider'){for(var _0x52917f in this[_0xe02c('0xf')]){if(this['faxAccounts'][_0xe02c('0x1f')](_0x52917f)){if(_0x12a564[_0xe02c('0x20')]===this[_0xe02c('0xf')][_0x52917f][_0xe02c('0x21')]){this[_0xe02c('0xe')][_0x12a564['uniqueid']]={};this[_0xe02c('0xe')][_0x12a564['uniqueid']]['channel']=_0x12a564[_0xe02c('0x22')];this[_0xe02c('0xe')][_0x12a564['uniqueid']]['id']=this[_0xe02c('0xf')][_0x52917f]['id'];this[_0xe02c('0xe')][_0x12a564['uniqueid']][_0xe02c('0x23')]=this[_0xe02c('0xf')][_0x52917f][_0xe02c('0x23')];logger[_0xe02c('0x24')](_0x12a564[_0xe02c('0x25')],_0xe02c('0x26'));}}}}if(this[_0xe02c('0x11')][_0x12a564[_0xe02c('0x25')]]){this[_0xe02c('0xe')][_0x12a564[_0xe02c('0x25')]]={};this[_0xe02c('0xe')][_0x12a564['uniqueid']][_0xe02c('0x22')]=_0x12a564[_0xe02c('0x22')];logger[_0xe02c('0x24')](_0x12a564[_0xe02c('0x25')],_0xe02c('0x26'));}};Fax[_0xe02c('0x1d')][_0xe02c('0x16')]=function(_0x1c14d6){if(this['channels'][_0x1c14d6[_0xe02c('0x25')]]){for(var _0x3790eb in _0x1c14d6[_0xe02c('0x27')]){if(_0x1c14d6['variable'][_0xe02c('0x1f')](_0x3790eb)){this[_0xe02c('0xe')][_0x1c14d6[_0xe02c('0x25')]][_0x3790eb]=_0x1c14d6[_0xe02c('0x28')];}}}};Fax[_0xe02c('0x1d')][_0xe02c('0x18')]=function(_0x22a285){if(this[_0xe02c('0xe')][_0x22a285[_0xe02c('0x25')]]){this[_0xe02c('0xe')][_0x22a285[_0xe02c('0x25')]]['channelstate']=_0x22a285[_0xe02c('0x29')];this[_0xe02c('0xe')][_0x22a285[_0xe02c('0x25')]][_0xe02c('0x2a')]=_0x22a285[_0xe02c('0x2a')];}};Fax[_0xe02c('0x1d')]['syncNewExten']=function(_0x436bcc){if(this[_0xe02c('0xe')][_0x436bcc['uniqueid']]){for(var _0x1ce34c in _0x436bcc[_0xe02c('0x27')]){if(_0x436bcc[_0xe02c('0x27')][_0xe02c('0x1f')](_0x1ce34c)){this[_0xe02c('0xe')][_0x436bcc['uniqueid']][_0x1ce34c]=_0x436bcc['value'];}}}};Fax[_0xe02c('0x1d')][_0xe02c('0x2b')]=function(_0x57928e){if(this[_0xe02c('0xe')][_0x57928e['uniqueid']]){this[_0xe02c('0xe')][_0x57928e[_0xe02c('0x25')]][_0xe02c('0x2c')]=_0x57928e[_0xe02c('0x2c')];this[_0xe02c('0xe')][_0x57928e['uniqueid']][_0xe02c('0x2d')]=_0x57928e['status'];this[_0xe02c('0xe')][_0x57928e[_0xe02c('0x25')]][_0xe02c('0x21')]=_0x57928e[_0xe02c('0x21')];this[_0xe02c('0xe')][_0x57928e[_0xe02c('0x25')]]['filename']=_0x57928e[_0xe02c('0x2e')];logger[_0xe02c('0x24')](_0x57928e['uniqueid'],_0xe02c('0x2f'));}};Fax[_0xe02c('0x1d')]['syncReceiveFax']=function(_0x396a06){var _0x4e4df6=this;if(this[_0xe02c('0xe')][_0x396a06[_0xe02c('0x25')]]){var _0x5b05e1=this[_0xe02c('0xe')][_0x396a06[_0xe02c('0x25')]]['id'];this[_0xe02c('0xe')][_0x396a06[_0xe02c('0x25')]][_0xe02c('0x30')]=_0x396a06[_0xe02c('0x30')];this['channels'][_0x396a06[_0xe02c('0x25')]]['pagestransferred']=_0x396a06['pagestransferred'];this[_0xe02c('0xe')][_0x396a06[_0xe02c('0x25')]][_0xe02c('0x21')]=_0x396a06[_0xe02c('0x21')];this['channels'][_0x396a06[_0xe02c('0x25')]][_0xe02c('0x31')]=_0x396a06[_0xe02c('0x31')];this['channels'][_0x396a06['uniqueid']][_0xe02c('0x32')]=_0x396a06[_0xe02c('0x32')];this[_0xe02c('0xe')][_0x396a06[_0xe02c('0x25')]][_0xe02c('0x2e')]=_0x396a06[_0xe02c('0x2e')];this[_0xe02c('0xe')][_0x396a06[_0xe02c('0x25')]][_0xe02c('0x33')]=_0x396a06['calleridnum'];if(this[_0xe02c('0xe')][_0x396a06['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x396a06[_0xe02c('0x2e')],_0xe02c('0x34'),function(_0x958cbc){logger[_0xe02c('0x24')](_0x396a06[_0xe02c('0x25')],_0xe02c('0x35'),_0x958cbc[_0xe02c('0x36')]);attachment[_0xe02c('0x37')]({'name':path['parse'](_0x396a06['filename'])[_0xe02c('0x23')],'basename':path[_0xe02c('0x38')](_0x396a06[_0xe02c('0x2e')])['name']+_0xe02c('0x39'),'type':_0xe02c('0x3a')})[_0xe02c('0x3b')](function(_0x1fb73c){faxAccount[_0xe02c('0x3c')](_0x5b05e1,{'from':_0x396a06[_0xe02c('0x33')],'mapKey':_0xe02c('0x7'),'body':path[_0xe02c('0x38')](_0x396a06[_0xe02c('0x2e')])[_0xe02c('0x23')]+'.pdf','AttachmentId':_0x1fb73c['id']})[_0xe02c('0x3d')](function(_0x18895e){logger[_0xe02c('0x3e')](_0x396a06[_0xe02c('0x25')],_0xe02c('0x3f'),JSON[_0xe02c('0x40')](_0x18895e));});})[_0xe02c('0x3d')](function(_0x3502a5){logger[_0xe02c('0x3e')](_0x396a06[_0xe02c('0x25')],_0xe02c('0x41'),JSON[_0xe02c('0x40')](_0x3502a5));});});}logger[_0xe02c('0x24')](_0x396a06['uniqueid'],_0xe02c('0x41'));}};Fax['prototype'][_0xe02c('0x42')]=function(_0x324911){if(this[_0xe02c('0x11')][_0x324911[_0xe02c('0x25')]]){_[_0xe02c('0x43')](this[_0xe02c('0xe')][_0x324911[_0xe02c('0x25')]],_[_0xe02c('0x44')](_0x324911,[_0xe02c('0x45'),_0xe02c('0x46')]));}};function updateStatus(_0x4f2a6e){if(_0x4f2a6e[_0xe02c('0x47')]){faxMessage[_0xe02c('0x48')](_0x4f2a6e[_0xe02c('0x47')],{'failMessage':'SENDING\x20FAILED\x20'})[_0xe02c('0x3b')](function(_0x5ab97d){ut[_0xe02c('0x49')]('[Fax][Message][Error][Updated]',_0x5ab97d);})['catch'](function(_0x5b66f4){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x5b66f4);});}else{ut['logger'](_0xe02c('0x4a'));}}Fax[_0xe02c('0x1d')][_0xe02c('0x4b')]=function(_0x35fbe2,_0x5d963d,_0x274beb){var _0x133f3a=this;var _0x4d2bff={};if(_0x5d963d){_0x4d2bff={'read':_0x5d963d};}else{_0x4d2bff={'failMessage':_0x274beb};}if(this[_0xe02c('0x11')][_0x35fbe2][_0xe02c('0x47')]){faxMessage[_0xe02c('0x48')](this['actions'][_0x35fbe2]['AttachmentId'],_0x4d2bff)[_0xe02c('0x3b')](function(_0x44a9f3){ut[_0xe02c('0x49')]('[Fax][Message][Updated]',_0x44a9f3);})[_0xe02c('0x3d')](function(_0x53765c){ut['logger'](_0xe02c('0x4c'),_0x53765c);})[_0xe02c('0x4d')](function(){delete _0x133f3a['channels'][_0x35fbe2];delete _0x133f3a[_0xe02c('0x11')][_0x35fbe2];});}else{ut[_0xe02c('0x49')](_0xe02c('0x4e'));delete this['channels'][_0x35fbe2];delete this[_0xe02c('0x11')][_0x35fbe2];}};Fax[_0xe02c('0x1d')]['syncHangup']=function(_0x3788e8){var _0x31ba51=this;if(this[_0xe02c('0xe')][_0x3788e8[_0xe02c('0x25')]]){if(this[_0xe02c('0x11')][_0x3788e8[_0xe02c('0x25')]]){this[_0xe02c('0xe')][_0x3788e8[_0xe02c('0x25')]]['id']=this[_0xe02c('0x11')][_0x3788e8['uniqueid']]['id'];this['channels'][_0x3788e8['uniqueid']][_0xe02c('0x23')]=this[_0xe02c('0x11')][_0x3788e8[_0xe02c('0x25')]]['name'];}logger['info'](_0x3788e8[_0xe02c('0x25')],this[_0xe02c('0x11')][_0x3788e8[_0xe02c('0x25')]]?_0xe02c('0x4f'):_0xe02c('0x50'),JSON['stringify'](this[_0xe02c('0xe')][_0x3788e8[_0xe02c('0x25')]]));if(this['actions'][_0x3788e8['uniqueid']]){if(this[_0xe02c('0xe')][_0x3788e8['uniqueid']]['faxpages']>0x0&&this['channels'][_0x3788e8[_0xe02c('0x25')]][_0xe02c('0x51')]===_0xe02c('0x52')){this[_0xe02c('0x4b')](_0x3788e8[_0xe02c('0x25')],!![]);}else{this[_0xe02c('0x4b')](_0x3788e8['uniqueid'],![],this[_0xe02c('0xe')][_0x3788e8['uniqueid']]['faxstatusstring']?_0xe02c('0x53')+this[_0xe02c('0xe')][_0x3788e8[_0xe02c('0x25')]][_0xe02c('0x54')]:'SENDING\x20FAILED');}}}};Fax[_0xe02c('0x1d')][_0xe02c('0x55')]=function(_0x5d2119){var _0xa7133f=this;return new BPromise(function(_0x44bfd0,_0x4cc74d){_0xa7133f[_0xe02c('0x56')](_0x5d2119,_0xa7133f[_0xe02c('0xf')][_0x5d2119[_0xe02c('0x57')]])[_0xe02c('0x3b')](function(_0x323f3b){ut[_0xe02c('0x49')](_0xe02c('0x58'),_0x323f3b);_0x44bfd0(ut['message'](_0xe02c('0x59')));})['catch'](function(_0x558344){ut['logger'](_0xe02c('0x5a'),_0x558344);updateStatus(_0x5d2119);_0x4cc74d(ut[_0xe02c('0x36')](_0xe02c('0x5b')));});});};Fax[_0xe02c('0x1d')]['checkAfterSend']=function(_0x32e149){var _0x327777=this;return new BPromise(function(_0x503bb3,_0x597a64){var _0x4b0ec3=_0x327777[_0xe02c('0x5c')](_0x327777[_0xe02c('0xf')][_0x32e149['FaxAccountId']]['Trunk'],_0x32e149);if(_0x4b0ec3[_0xe02c('0x5d')]){_0x503bb3(ut[_0xe02c('0x36')](_0xe02c('0x5e')));}else{_0x597a64(ut[_0xe02c('0x36')](_0x4b0ec3[_0xe02c('0x36')]));}});};function originate(_0x5bb01d,_0x39c7db,_0x12ac9f){return new BPromise(function(_0x3f277b,_0x2776c0){if(_0x12ac9f){var _0x11c506=util[_0xe02c('0x5f')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xe02c('0x38')](_0x5bb01d[_0xe02c('0x60')])['name'],_0x5bb01d[_0xe02c('0x60')]);gs[_0xe02c('0x61')](_0x11c506)[_0xe02c('0x3b')](function(){_0x5bb01d[_0xe02c('0x60')]=util['format'](_0xe02c('0x62'),path[_0xe02c('0x38')](_0x5bb01d['path'])['dir'],path['parse'](_0x5bb01d[_0xe02c('0x60')])[_0xe02c('0x23')]);_0x39c7db[_0xe02c('0x63')]=_0x5bb01d[_0xe02c('0x60')];ut[_0xe02c('0x49')]('Convert\x20pdf\x20to\x20tif','');ami[_0xe02c('0x64')](ut[_0xe02c('0x65')](_0x5bb01d,_0x39c7db))[_0xe02c('0x3b')](function(_0x4cc653){_0x3f277b(_0x4cc653);})['catch'](function(_0x4c3c91){_0x2776c0(_0x4c3c91);});})[_0xe02c('0x3d')](function(_0x43d7f7){_0x2776c0(_0x43d7f7);});}else{ami[_0xe02c('0x64')](ut[_0xe02c('0x65')](_0x5bb01d,_0x39c7db))['then'](function(_0x182805){_0x3f277b(_0x182805);})['catch'](function(_0x5a5dba){_0x2776c0(_0x5a5dba);});}});}Fax[_0xe02c('0x1d')][_0xe02c('0x56')]=function(_0x331061,_0x1bbf6a){var _0xea4547=this;return new BPromise(function(_0x2d132e,_0x748217){var _0x12aaea=uuid['v4']();var _0x5ead59=ut[_0xe02c('0x66')](_0x331061,_0x1bbf6a);_0xea4547[_0xe02c('0x11')][_0x12aaea]=new Action(_0x12aaea,_0x1bbf6a,_0x331061);var _0x2386cf=_0xea4547[_0xe02c('0x11')][_0x12aaea];if(path[_0xe02c('0x38')](_0x331061[_0xe02c('0x60')])[_0xe02c('0x67')]===_0xe02c('0x39')){originate(_0x2386cf,_0x5ead59,!![])[_0xe02c('0x3b')](function(_0x411cd5){_0x2d132e(_0x411cd5);})['catch'](function(_0x58acfd){_0x748217(_0x58acfd);});}else{originate(_0x2386cf,_0x5ead59,![])[_0xe02c('0x3b')](function(_0x2a5d54){_0x2d132e(_0x2a5d54);})[_0xe02c('0x3d')](function(_0x76fb21){_0x748217(_0x76fb21);});}});};Fax[_0xe02c('0x1d')]['isTrunkReachable']=function(_0x405b16){return!_[_0xe02c('0x68')](_0x405b16)&&!_[_0xe02c('0x68')](_0x405b16[_0xe02c('0x23')])&&!_[_0xe02c('0x68')](_0x405b16[_0xe02c('0x69')])&&_0x405b16[_0xe02c('0x69')]&&!_[_0xe02c('0x68')](this[_0xe02c('0x10')][util[_0xe02c('0x5f')](_0xe02c('0x6a'),_0x405b16[_0xe02c('0x23')])])&&!_['isNil'](this['trunks'][util[_0xe02c('0x5f')](_0xe02c('0x6a'),_0x405b16['name'])][_0xe02c('0x2d')])&&(this['trunks'][util[_0xe02c('0x5f')]('SIP/%s',_0x405b16[_0xe02c('0x23')])][_0xe02c('0x2d')]===_0xe02c('0x6b')||this[_0xe02c('0x10')][util[_0xe02c('0x5f')](_0xe02c('0x6a'),_0x405b16[_0xe02c('0x23')])][_0xe02c('0x2d')]===_0xe02c('0x6c'));};Fax[_0xe02c('0x1d')]['checkTrunk']=function(_0x5a118f,_0x4d6753){if(!this[_0xe02c('0x6d')](_0x5a118f)){ut[_0xe02c('0x49')](_0xe02c('0x6e'),_[_0xe02c('0x68')](_0x5a118f)?'':_0x5a118f[_0xe02c('0x23')]+_0xe02c('0x6f'));return{'isValid':![],'message':_0xe02c('0x70')};}if(_[_0xe02c('0x68')](_0x4d6753[_0xe02c('0x7')])){ut[_0xe02c('0x49')](_0xe02c('0x71'),JSON[_0xe02c('0x40')](_0x4d6753));return{'isValid':![],'message':_0xe02c('0x72')};}if(_['isNil'](_0x4d6753['path'])){ut[_0xe02c('0x49')](_0xe02c('0x73'),JSON[_0xe02c('0x40')](_0x4d6753));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xe02c('0x74')};};module[_0xe02c('0x75')]=Fax; \ No newline at end of file +var _0xf4f4=['./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','syncHangup','prototype','context','from-voip-provider','hasOwnProperty','exten','channels','uniqueid','channel','name','info','syncVarSet','variable','channelstate','channelstatedesc','value','syncFaxStatus','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','error','stringify','catch','\x20receiveFax\x20','syncOriginateResponse','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','variablesAction','Action','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','fax','./rpcDb','./channel','./util/util'];(function(_0x397ab1,_0x467b66){var _0x4c92f1=function(_0x44a27a){while(--_0x44a27a){_0x397ab1['push'](_0x397ab1['shift']());}};_0x4c92f1(++_0x467b66);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x26db26,_0x38f53a){_0x26db26=_0x26db26-0x0;var _0x51e877=_0xf4f4[_0x26db26];return _0x51e877;};'use strict';var util=require(_0x4f4f('0x0'));var _=require(_0x4f4f('0x1'));var BPromise=require('bluebird');var uuid=require(_0x4f4f('0x2'));var moment=require(_0x4f4f('0x3'));var path=require(_0x4f4f('0x4'));var tiff2pdf=require(_0x4f4f('0x5'));var gs=require(_0x4f4f('0x6'));var logger=require('../../../config/logger')(_0x4f4f('0x7'));var ami=require('../ami');var rpcDb=require(_0x4f4f('0x8'));var Channel=require(_0x4f4f('0x9'));var ut=require(_0x4f4f('0xa'));var Action=require(_0x4f4f('0xb'));var faxAccount=require(_0x4f4f('0xc'));var attachment=require(_0x4f4f('0xd'));var faxMessage=require(_0x4f4f('0xe'));function Fax(_0x3768d7){this['channels']={};this[_0x4f4f('0xf')]=_0x3768d7[_0x4f4f('0xf')];this[_0x4f4f('0x10')]=_0x3768d7[_0x4f4f('0x10')];this[_0x4f4f('0x11')]={};ami['on'](_0x4f4f('0x12'),this[_0x4f4f('0x13')][_0x4f4f('0x14')](this));ami['on']('varset',this['syncVarSet'][_0x4f4f('0x14')](this));ami['on'](_0x4f4f('0x15'),this[_0x4f4f('0x16')][_0x4f4f('0x14')](this));ami['on'](_0x4f4f('0x17'),this[_0x4f4f('0x18')]['bind'](this));ami['on'](_0x4f4f('0x19'),this['syncFaxStatus'][_0x4f4f('0x14')](this));ami['on'](_0x4f4f('0x1a'),this[_0x4f4f('0x1b')][_0x4f4f('0x14')](this));ami['on']('hangup',this[_0x4f4f('0x1c')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x4f4f('0x14')](this));}Fax[_0x4f4f('0x1d')][_0x4f4f('0x13')]=function(_0x1af189){if(_0x1af189[_0x4f4f('0x1e')]===_0x4f4f('0x1f')){for(var _0x1245c4 in this[_0x4f4f('0xf')]){if(this[_0x4f4f('0xf')][_0x4f4f('0x20')](_0x1245c4)){if(_0x1af189[_0x4f4f('0x21')]===this[_0x4f4f('0xf')][_0x1245c4]['localstationid']){this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]]={};this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]][_0x4f4f('0x24')]=_0x1af189[_0x4f4f('0x24')];this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]]['id']=this[_0x4f4f('0xf')][_0x1245c4]['id'];this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]][_0x4f4f('0x25')]=this[_0x4f4f('0xf')][_0x1245c4][_0x4f4f('0x25')];logger['info'](_0x1af189['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x4f4f('0x11')][_0x1af189[_0x4f4f('0x23')]]){this['channels'][_0x1af189[_0x4f4f('0x23')]]={};this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]][_0x4f4f('0x24')]=_0x1af189[_0x4f4f('0x24')];logger[_0x4f4f('0x26')](_0x1af189[_0x4f4f('0x23')],'\x20syncNewchannel\x20');}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x27')]=function(_0x18e718){if(this[_0x4f4f('0x22')][_0x18e718[_0x4f4f('0x23')]]){for(var _0x4ad33d in _0x18e718[_0x4f4f('0x28')]){if(_0x18e718[_0x4f4f('0x28')][_0x4f4f('0x20')](_0x4ad33d)){this['channels'][_0x18e718['uniqueid']][_0x4ad33d]=_0x18e718['value'];}}}};Fax[_0x4f4f('0x1d')]['syncNewState']=function(_0x354266){if(this[_0x4f4f('0x22')][_0x354266[_0x4f4f('0x23')]]){this['channels'][_0x354266[_0x4f4f('0x23')]][_0x4f4f('0x29')]=_0x354266['channelstate'];this[_0x4f4f('0x22')][_0x354266[_0x4f4f('0x23')]][_0x4f4f('0x2a')]=_0x354266['channelstatedesc'];}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x18')]=function(_0x59bdb0){if(this['channels'][_0x59bdb0[_0x4f4f('0x23')]]){for(var _0x305bf7 in _0x59bdb0[_0x4f4f('0x28')]){if(_0x59bdb0[_0x4f4f('0x28')][_0x4f4f('0x20')](_0x305bf7)){this[_0x4f4f('0x22')][_0x59bdb0[_0x4f4f('0x23')]][_0x305bf7]=_0x59bdb0[_0x4f4f('0x2b')];}}}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x2c')]=function(_0x54c095){if(this['channels'][_0x54c095[_0x4f4f('0x23')]]){this['channels'][_0x54c095[_0x4f4f('0x23')]][_0x4f4f('0x2d')]=_0x54c095[_0x4f4f('0x2d')];this[_0x4f4f('0x22')][_0x54c095[_0x4f4f('0x23')]][_0x4f4f('0x2e')]=_0x54c095[_0x4f4f('0x2e')];this[_0x4f4f('0x22')][_0x54c095[_0x4f4f('0x23')]][_0x4f4f('0x2f')]=_0x54c095[_0x4f4f('0x2f')];this[_0x4f4f('0x22')][_0x54c095['uniqueid']][_0x4f4f('0x30')]=_0x54c095[_0x4f4f('0x30')];logger[_0x4f4f('0x26')](_0x54c095[_0x4f4f('0x23')],_0x4f4f('0x31'));}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x1b')]=function(_0x32b077){var _0x1d1f4c=this;if(this['channels'][_0x32b077[_0x4f4f('0x23')]]){var _0x17dceb=this[_0x4f4f('0x22')][_0x32b077['uniqueid']]['id'];this['channels'][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x32')]=_0x32b077[_0x4f4f('0x32')];this[_0x4f4f('0x22')][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x33')]=_0x32b077[_0x4f4f('0x33')];this[_0x4f4f('0x22')][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x2f')]=_0x32b077[_0x4f4f('0x2f')];this[_0x4f4f('0x22')][_0x32b077['uniqueid']][_0x4f4f('0x34')]=_0x32b077[_0x4f4f('0x34')];this[_0x4f4f('0x22')][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x35')]=_0x32b077['transferrate'];this['channels'][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x30')]=_0x32b077[_0x4f4f('0x30')];this[_0x4f4f('0x22')][_0x32b077['uniqueid']][_0x4f4f('0x36')]=_0x32b077['calleridnum'];if(this[_0x4f4f('0x22')][_0x32b077['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x32b077[_0x4f4f('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x27303d){logger[_0x4f4f('0x26')](_0x32b077['uniqueid'],_0x4f4f('0x37'),_0x27303d[_0x4f4f('0x38')]);attachment['create']({'name':path[_0x4f4f('0x39')](_0x32b077[_0x4f4f('0x30')])[_0x4f4f('0x25')],'basename':path[_0x4f4f('0x39')](_0x32b077[_0x4f4f('0x30')])[_0x4f4f('0x25')]+_0x4f4f('0x3a'),'type':_0x4f4f('0x3b')})[_0x4f4f('0x3c')](function(_0x1c029a){faxAccount[_0x4f4f('0x3d')](_0x17dceb,{'from':_0x32b077[_0x4f4f('0x36')],'mapKey':_0x4f4f('0x7'),'body':path[_0x4f4f('0x39')](_0x32b077[_0x4f4f('0x30')])['name']+_0x4f4f('0x3a'),'AttachmentId':_0x1c029a['id']})['catch'](function(_0x5a0063){logger[_0x4f4f('0x3e')](_0x32b077[_0x4f4f('0x23')],'\x20notify\x20',JSON[_0x4f4f('0x3f')](_0x5a0063));});})[_0x4f4f('0x40')](function(_0xea9617){logger[_0x4f4f('0x3e')](_0x32b077[_0x4f4f('0x23')],'\x20receiveFax\x20',JSON[_0x4f4f('0x3f')](_0xea9617));});});}logger[_0x4f4f('0x26')](_0x32b077[_0x4f4f('0x23')],_0x4f4f('0x41'));}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x42')]=function(_0x29314b){if(this[_0x4f4f('0x11')][_0x29314b[_0x4f4f('0x23')]]){_['merge'](this[_0x4f4f('0x22')][_0x29314b[_0x4f4f('0x23')]],_['pick'](_0x29314b,['response','reason']));}};function updateStatus(_0x146126){if(_0x146126[_0x4f4f('0x43')]){faxMessage[_0x4f4f('0x44')](_0x146126['AttachmentId'],{'failMessage':_0x4f4f('0x45')})['then'](function(_0xf13a0){ut[_0x4f4f('0x46')](_0x4f4f('0x47'),_0xf13a0);})[_0x4f4f('0x40')](function(_0xe03548){ut[_0x4f4f('0x46')](_0x4f4f('0x48'),_0xe03548);});}else{ut[_0x4f4f('0x46')](_0x4f4f('0x49'));}}Fax['prototype']['updateStatus']=function(_0x36cfcf,_0x8edee4,_0x4c04eb){var _0x557ba3=this;var _0x31058a={};if(_0x8edee4){_0x31058a={'read':_0x8edee4};}else{_0x31058a={'failMessage':_0x4c04eb};}if(this[_0x4f4f('0x11')][_0x36cfcf][_0x4f4f('0x43')]){faxMessage['update'](this['actions'][_0x36cfcf][_0x4f4f('0x43')],_0x31058a)[_0x4f4f('0x3c')](function(_0x179998){ut[_0x4f4f('0x46')](_0x4f4f('0x4a'),_0x179998);})[_0x4f4f('0x40')](function(_0xe66fc){ut[_0x4f4f('0x46')](_0x4f4f('0x4b'),_0xe66fc);})[_0x4f4f('0x4c')](function(){delete _0x557ba3[_0x4f4f('0x22')][_0x36cfcf];delete _0x557ba3['actions'][_0x36cfcf];});}else{ut['logger'](_0x4f4f('0x4d'));delete this[_0x4f4f('0x22')][_0x36cfcf];delete this[_0x4f4f('0x11')][_0x36cfcf];}};Fax[_0x4f4f('0x1d')]['syncHangup']=function(_0x1bef77){var _0x57a11f=this;if(this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]]){if(this[_0x4f4f('0x11')][_0x1bef77['uniqueid']]){this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]]['id']=this[_0x4f4f('0x11')][_0x1bef77['uniqueid']]['id'];this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]][_0x4f4f('0x25')]=this['actions'][_0x1bef77[_0x4f4f('0x23')]][_0x4f4f('0x25')];}logger[_0x4f4f('0x26')](_0x1bef77['uniqueid'],this[_0x4f4f('0x11')][_0x1bef77['uniqueid']]?_0x4f4f('0x4e'):_0x4f4f('0x4f'),JSON[_0x4f4f('0x3f')](this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]]));if(this[_0x4f4f('0x11')][_0x1bef77[_0x4f4f('0x23')]]){if(this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]][_0x4f4f('0x50')]>0x0&&this[_0x4f4f('0x22')][_0x1bef77['uniqueid']][_0x4f4f('0x19')]===_0x4f4f('0x51')){this[_0x4f4f('0x52')](_0x1bef77['uniqueid'],!![]);}else{this[_0x4f4f('0x52')](_0x1bef77[_0x4f4f('0x23')],![],this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]]['faxstatusstring']?_0x4f4f('0x53')+this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]][_0x4f4f('0x54')]:_0x4f4f('0x55'));}}}};Fax['prototype'][_0x4f4f('0x56')]=function(_0x484ae2){var _0x19f927=this;return new BPromise(function(_0x320fd3,_0x2da4ea){_0x19f927[_0x4f4f('0x57')](_0x484ae2,_0x19f927[_0x4f4f('0xf')][_0x484ae2[_0x4f4f('0x58')]])['then'](function(_0x50590c){ut[_0x4f4f('0x46')]('[Fax][execOriginate][success]',_0x50590c);_0x320fd3(ut[_0x4f4f('0x38')](_0x4f4f('0x59')));})[_0x4f4f('0x40')](function(_0x1156f9){ut[_0x4f4f('0x46')](_0x4f4f('0x5a'),_0x1156f9);updateStatus(_0x484ae2);_0x2da4ea(ut[_0x4f4f('0x38')](_0x4f4f('0x5b')));});});};Fax[_0x4f4f('0x1d')][_0x4f4f('0x5c')]=function(_0x1f1599){var _0x4fb751=this;return new BPromise(function(_0x5bb03d,_0x533ab2){var _0x3849ee=_0x4fb751[_0x4f4f('0x5d')](_0x4fb751['faxAccounts'][_0x1f1599[_0x4f4f('0x58')]][_0x4f4f('0x5e')],_0x1f1599);if(_0x3849ee[_0x4f4f('0x5f')]){_0x5bb03d(ut[_0x4f4f('0x38')](_0x4f4f('0x60')));}else{_0x533ab2(ut[_0x4f4f('0x38')](_0x3849ee['message']));}});};function originate(_0x3961e8,_0x12597f,_0x434bcd){return new BPromise(function(_0x24ed71,_0x33f4fd){if(_0x434bcd){var _0x36299e=util[_0x4f4f('0x61')](_0x4f4f('0x62'),path['parse'](_0x3961e8[_0x4f4f('0x4')])[_0x4f4f('0x25')],_0x3961e8[_0x4f4f('0x4')]);gs[_0x4f4f('0x63')](_0x36299e)['then'](function(){_0x3961e8[_0x4f4f('0x4')]=util['format'](_0x4f4f('0x64'),path['parse'](_0x3961e8['path'])[_0x4f4f('0x65')],path[_0x4f4f('0x39')](_0x3961e8[_0x4f4f('0x4')])[_0x4f4f('0x25')]);_0x12597f['XMF-PATH']=_0x3961e8[_0x4f4f('0x4')];ut['logger'](_0x4f4f('0x66'),'');ami['Action'](ut[_0x4f4f('0x67')](_0x3961e8,_0x12597f))[_0x4f4f('0x3c')](function(_0x27eb97){_0x24ed71(_0x27eb97);})['catch'](function(_0x41c31c){_0x33f4fd(_0x41c31c);});})['catch'](function(_0x34b4ca){_0x33f4fd(_0x34b4ca);});}else{ami[_0x4f4f('0x68')](ut[_0x4f4f('0x67')](_0x3961e8,_0x12597f))[_0x4f4f('0x3c')](function(_0x2594ce){_0x24ed71(_0x2594ce);})[_0x4f4f('0x40')](function(_0x2525a0){_0x33f4fd(_0x2525a0);});}});}Fax[_0x4f4f('0x1d')][_0x4f4f('0x57')]=function(_0x4b06ff,_0x6e7ab6){var _0x2fa3ae=this;return new BPromise(function(_0x3cf675,_0x14e4f3){var _0x42c638=uuid['v4']();var _0x383d09=ut['addVariables'](_0x4b06ff,_0x6e7ab6);_0x2fa3ae[_0x4f4f('0x11')][_0x42c638]=new Action(_0x42c638,_0x6e7ab6,_0x4b06ff);var _0x18332b=_0x2fa3ae[_0x4f4f('0x11')][_0x42c638];if(path[_0x4f4f('0x39')](_0x4b06ff['path'])[_0x4f4f('0x69')]===_0x4f4f('0x3a')){originate(_0x18332b,_0x383d09,!![])[_0x4f4f('0x3c')](function(_0x563465){_0x3cf675(_0x563465);})[_0x4f4f('0x40')](function(_0x40bab8){_0x14e4f3(_0x40bab8);});}else{originate(_0x18332b,_0x383d09,![])['then'](function(_0x43694b){_0x3cf675(_0x43694b);})[_0x4f4f('0x40')](function(_0x41a715){_0x14e4f3(_0x41a715);});}});};Fax[_0x4f4f('0x1d')][_0x4f4f('0x6a')]=function(_0x25cd1c){return!_['isNil'](_0x25cd1c)&&!_[_0x4f4f('0x6b')](_0x25cd1c[_0x4f4f('0x25')])&&!_[_0x4f4f('0x6b')](_0x25cd1c[_0x4f4f('0x6c')])&&_0x25cd1c[_0x4f4f('0x6c')]&&!_[_0x4f4f('0x6b')](this['trunks'][util[_0x4f4f('0x61')](_0x4f4f('0x6d'),_0x25cd1c[_0x4f4f('0x25')])])&&!_['isNil'](this[_0x4f4f('0x10')][util[_0x4f4f('0x61')](_0x4f4f('0x6d'),_0x25cd1c[_0x4f4f('0x25')])][_0x4f4f('0x2e')])&&(this['trunks'][util[_0x4f4f('0x61')]('SIP/%s',_0x25cd1c['name'])][_0x4f4f('0x2e')]===_0x4f4f('0x6e')||this[_0x4f4f('0x10')][util[_0x4f4f('0x61')](_0x4f4f('0x6d'),_0x25cd1c[_0x4f4f('0x25')])][_0x4f4f('0x2e')]===_0x4f4f('0x6f'));};Fax[_0x4f4f('0x1d')]['checkTrunk']=function(_0x1104b4,_0x4b95f1){if(!this[_0x4f4f('0x6a')](_0x1104b4)){ut[_0x4f4f('0x46')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x4f4f('0x6b')](_0x1104b4)?'':_0x1104b4[_0x4f4f('0x25')]+_0x4f4f('0x70'));return{'isValid':![],'message':_0x4f4f('0x71')};}if(_[_0x4f4f('0x6b')](_0x4b95f1[_0x4f4f('0x7')])){ut[_0x4f4f('0x46')](_0x4f4f('0x72'),JSON['stringify'](_0x4b95f1));return{'isValid':![],'message':_0x4f4f('0x73')};}if(_[_0x4f4f('0x6b')](_0x4b95f1[_0x4f4f('0x4')])){ut['logger'](_0x4f4f('0x74'),JSON['stringify'](_0x4b95f1));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x4f4f('0x75')};};module[_0x4f4f('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index b7b0aed..c1e3437 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 _0xc2fd=['notify','catch','util','bluebird','../../../config/logger','preview','../rpc/faxAccount','error','inspect','resolve','then'];(function(_0x473052,_0x36de92){var _0x3982ca=function(_0x17a192){while(--_0x17a192){_0x473052['push'](_0x473052['shift']());}};_0x3982ca(++_0x36de92);}(_0xc2fd,0x65));var _0xdc2f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc2fd[_0x3ab51d];return _0x29a04e;};'use strict';var util=require(_0xdc2f('0x0'));var BPromise=require(_0xdc2f('0x1'));var logger=require(_0xdc2f('0x2'))(_0xdc2f('0x3'));var _=require('lodash');var faxAccount=require(_0xdc2f('0x4'));function loggerCatch(_0xfa38de){return function(_0x30de62){logger[_0xdc2f('0x5')](_0xfa38de,util[_0xdc2f('0x6')](_0x30de62,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x49b923,_0xa890b6){return BPromise[_0xdc2f('0x7')]()[_0xdc2f('0x8')](faxAccount[_0xdc2f('0x9')](_0x49b923,_0xa890b6))[_0xdc2f('0xa')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xc7c5=['resolve','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify'];(function(_0x4c4579,_0x434943){var _0x59a2a5=function(_0x5624e4){while(--_0x5624e4){_0x4c4579['push'](_0x4c4579['shift']());}};_0x59a2a5(++_0x434943);}(_0xc7c5,0x7b));var _0x5c7c=function(_0x51a146,_0x103c99){_0x51a146=_0x51a146-0x0;var _0x5ba35e=_0xc7c5[_0x51a146];return _0x5ba35e;};'use strict';var util=require(_0x5c7c('0x0'));var BPromise=require(_0x5c7c('0x1'));var logger=require(_0x5c7c('0x2'))(_0x5c7c('0x3'));var _=require(_0x5c7c('0x4'));var faxAccount=require(_0x5c7c('0x5'));function loggerCatch(_0x2dd558){return function(_0x1097e5){logger[_0x5c7c('0x6')](_0x2dd558,util[_0x5c7c('0x7')](_0x1097e5,{'showHidden':![],'depth':null}));};}exports[_0x5c7c('0x8')]=function(_0x1cf197,_0x4a078f){return BPromise[_0x5c7c('0x9')]()['then'](faxAccount[_0x5c7c('0x8')](_0x1cf197,_0x4a078f))[_0x5c7c('0xa')](loggerCatch(_0x5c7c('0xb')));}; \ 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 b667823..18e8397 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 _0x0848=['fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0848,0xdb));var _0x8084=function(_0x929dab,_0x5b26e5){_0x929dab=_0x929dab-0x0;var _0x24f366=_0x0848[_0x929dab];return _0x24f366;};'use strict';var util=require(_0x8084('0x0'));var logger=require('../../../../config/logger')(_0x8084('0x1'));var BPromise=require(_0x8084('0x2'));var exec=require(_0x8084('0x3'))[_0x8084('0x4')];exports[_0x8084('0x5')]=function(_0x38744e){return new BPromise(function(_0x517d8b,_0x3f7453){exec(_0x38744e,function(_0x3b8e64,_0x422fb4,_0x52ecb3){logger[_0x8084('0x6')]('Exec\x20gs',_0x422fb4);if(_0x3b8e64){logger['info'](_0x8084('0x7'),_0x8084('0x8'),util[_0x8084('0x9')](_0x3b8e64,{'showHidden':![],'depth':null}),_0x422fb4,_0x52ecb3);_0x3f7453(_0x3b8e64);}_0x517d8b(_0x422fb4);});});}; \ No newline at end of file +var _0xa3a7=['util','../../../../config/logger','fax','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa3a7,0xc6));var _0x7a3a=function(_0x512cbf,_0x1dddd9){_0x512cbf=_0x512cbf-0x0;var _0x4df92d=_0xa3a7[_0x512cbf];return _0x4df92d;};'use strict';var util=require(_0x7a3a('0x0'));var logger=require(_0x7a3a('0x1'))(_0x7a3a('0x2'));var BPromise=require('bluebird');var exec=require('child_process')[_0x7a3a('0x3')];exports[_0x7a3a('0x4')]=function(_0x1272d1){return new BPromise(function(_0x626594,_0x5da1cc){exec(_0x1272d1,function(_0x399cf1,_0xc60d77,_0x96fdb2){logger[_0x7a3a('0x5')]('Exec\x20gs',_0xc60d77);if(_0x399cf1){logger[_0x7a3a('0x5')](_0x7a3a('0x6'),_0x7a3a('0x7'),util[_0x7a3a('0x8')](_0x399cf1,{'showHidden':![],'depth':null}),_0xc60d77,_0x96fdb2);_0x5da1cc(_0x399cf1);}_0x626594(_0xc60d77);});});}; \ 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 917cf49..e8409c5 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 _0xed51=['maxrate','modem','gateway','faxdetect','t38timeout','uniqueid','format','\x22%s\x22\x20<%s>','headerinfo','localstationid','lodash','fax','message','info','inspect','ecm','minrate'];(function(_0x3cb98e,_0x2ce8ad){var _0x22eb26=function(_0x396cb6){while(--_0x396cb6){_0x3cb98e['push'](_0x3cb98e['shift']());}};_0x22eb26(++_0x2ce8ad);}(_0xed51,0x1d5));var _0x1ed5=function(_0x31e2cb,_0x56ab33){_0x31e2cb=_0x31e2cb-0x0;var _0x2da091=_0xed51[_0x31e2cb];return _0x2da091;};'use strict';var util=require('util');var _=require(_0x1ed5('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x1ed5('0x1'));exports[_0x1ed5('0x2')]=function(_0x41d5ed){return{'message':_0x41d5ed};};exports['logger']=function(_0x41518d,_0x61e3de){logger[_0x1ed5('0x3')](_0x41518d,util[_0x1ed5('0x4')](_0x61e3de,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x39f90d,_0x3b5627){var _0x28b986={'XMF-ECM':_0x3b5627[_0x1ed5('0x5')],'XMF-HEADERINFO':_0x3b5627['headerinfo'],'XMF-MINRATE':_0x3b5627[_0x1ed5('0x6')],'XMF-MAXRATE':_0x3b5627[_0x1ed5('0x7')],'XMF-MODEM':util['format']('\x22%s\x22',_0x3b5627[_0x1ed5('0x8')]),'XMF-GATEWAY':_0x3b5627[_0x1ed5('0x9')],'XMF-FAXDETECT':_0x3b5627[_0x1ed5('0xa')],'XMF-T38TIMEOUT':_0x3b5627[_0x1ed5('0xb')],'XMF-LOCALSTATIONID':_0x3b5627['localstationid'],'XMF-PATH':_0x39f90d['path']};return _0x28b986;};exports['variablesAction']=function(_0x59c889,_0x3bf612){return{'actionid':_0x59c889[_0x1ed5('0xc')],'action':'originate','channel':_0x59c889['channel'],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0x1ed5('0xd')](_0x1ed5('0xe'),_0x59c889['headerinfo']?_0x59c889[_0x1ed5('0xf')]:'',_0x59c889[_0x1ed5('0x10')]),'variable':_0x3bf612,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x59c889[_0x1ed5('0xc')]};}; \ No newline at end of file +var _0x6d66=['util','lodash','moment','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','format','uniqueid'];(function(_0x1a1b93,_0x377b53){var _0x41dbbb=function(_0x3105d7){while(--_0x3105d7){_0x1a1b93['push'](_0x1a1b93['shift']());}};_0x41dbbb(++_0x377b53);}(_0x6d66,0x9c));var _0x66d6=function(_0x1af25e,_0x35c029){_0x1af25e=_0x1af25e-0x0;var _0x15318e=_0x6d66[_0x1af25e];return _0x15318e;};'use strict';var util=require(_0x66d6('0x0'));var _=require(_0x66d6('0x1'));var moment=require(_0x66d6('0x2'));var logger=require(_0x66d6('0x3'))('fax');exports[_0x66d6('0x4')]=function(_0x5e4cc0){return{'message':_0x5e4cc0};};exports[_0x66d6('0x5')]=function(_0x56277e,_0x592f76){logger[_0x66d6('0x6')](_0x56277e,util[_0x66d6('0x7')](_0x592f76,{'showHidden':![],'depth':null}));};exports[_0x66d6('0x8')]=function(_0xc5da3c,_0x321e35){var _0x507ea3={'XMF-ECM':_0x321e35[_0x66d6('0x9')],'XMF-HEADERINFO':_0x321e35[_0x66d6('0xa')],'XMF-MINRATE':_0x321e35[_0x66d6('0xb')],'XMF-MAXRATE':_0x321e35['maxrate'],'XMF-MODEM':util['format'](_0x66d6('0xc'),_0x321e35[_0x66d6('0xd')]),'XMF-GATEWAY':_0x321e35[_0x66d6('0xe')],'XMF-FAXDETECT':_0x321e35[_0x66d6('0xf')],'XMF-T38TIMEOUT':_0x321e35[_0x66d6('0x10')],'XMF-LOCALSTATIONID':_0x321e35[_0x66d6('0x11')],'XMF-PATH':_0xc5da3c[_0x66d6('0x12')]};return _0x507ea3;};exports[_0x66d6('0x13')]=function(_0x29ea20,_0x3d4819){return{'actionid':_0x29ea20['uniqueid'],'action':_0x66d6('0x14'),'channel':_0x29ea20[_0x66d6('0x15')],'Exten':_0x66d6('0x16'),'Context':_0x66d6('0x17'),'Priority':'1','callerid':util[_0x66d6('0x18')]('\x22%s\x22\x20<%s>',_0x29ea20[_0x66d6('0xa')]?_0x29ea20[_0x66d6('0xa')]:'',_0x29ea20[_0x66d6('0x11')]),'variable':_0x3d4819,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x29ea20[_0x66d6('0x19')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index d4d1fe1..939138c 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 _0x9849=['listen','sync','catch','[index.js][main]','inspect','util','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','../../config/logger','ami','hour','get','resolve','getAgents','then','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','error'];(function(_0x963390,_0x445fd2){var _0xc1da02=function(_0x2e958d){while(--_0x2e958d){_0x963390['push'](_0x963390['shift']());}};_0xc1da02(++_0x445fd2);}(_0x9849,0x8d));var _0x9984=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9849[_0x1facfa];return _0x9ec701;};'use strict';var BPromise=require('bluebird');var util=require(_0x9984('0x0'));var moment=require('moment');var server=require(_0x9984('0x1'));var Realtime=require(_0x9984('0x2'));var Report=require(_0x9984('0x3'));var Acw=require(_0x9984('0x4'));var Trigger=require(_0x9984('0x5'));var Dialer=require(_0x9984('0x6'));var Preview=require(_0x9984('0x7'));var Fax=require(_0x9984('0x8'));var user=require(_0x9984('0x9'));var voiceQueue=require(_0x9984('0xa'));var voiceQueueReport=require(_0x9984('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x9984('0xc'));var trigger=require(_0x9984('0xd'));var template=require(_0x9984('0xe'));var cmHopperHistory=require(_0x9984('0xf'));var campaign=require(_0x9984('0x10'));var voiceExtension=require(_0x9984('0x11'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x9984('0x12'));var salesforce=require(_0x9984('0x13'));var sugarcrm=require(_0x9984('0x14'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x9984('0x15'));var zoho=require(_0x9984('0x16'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x9984('0x17'))(_0x9984('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x9984('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x9984('0x1a')](_0x9984('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x9984('0x1b')]()['then'](user[_0x9984('0x1c')]())['then'](realtime['initAgents']())[_0x9984('0x1d')](user[_0x9984('0x1e')]())[_0x9984('0x1d')](realtime[_0x9984('0x1f')]())[_0x9984('0x1d')](trunk[_0x9984('0x20')]())[_0x9984('0x1d')](realtime[_0x9984('0x21')]())[_0x9984('0x1d')](voiceQueue[_0x9984('0x22')]())[_0x9984('0x1d')](realtime['initVoiceQueues']())[_0x9984('0x1d')](trigger[_0x9984('0x23')]())[_0x9984('0x1d')](realtime[_0x9984('0x24')]())[_0x9984('0x1d')](template['getTemplates']())[_0x9984('0x1d')](realtime[_0x9984('0x25')]())['then'](zendesk[_0x9984('0x26')]())['then'](realtime[_0x9984('0x27')]())[_0x9984('0x1d')](salesforce[_0x9984('0x28')]())['then'](realtime['initSalesforceAccounts']())[_0x9984('0x1d')](sugarcrm[_0x9984('0x29')]())[_0x9984('0x1d')](realtime['initSugarcrmAccounts']())[_0x9984('0x1d')](freshdesk[_0x9984('0x2a')]())[_0x9984('0x1d')](realtime[_0x9984('0x2b')]())[_0x9984('0x1d')](desk['getDeskAccounts']())[_0x9984('0x1d')](realtime[_0x9984('0x2c')]())[_0x9984('0x1d')](zoho[_0x9984('0x2d')]())[_0x9984('0x1d')](realtime['initZohoAccounts']())['then'](vtiger[_0x9984('0x2e')]())[_0x9984('0x1d')](realtime[_0x9984('0x2f')]())['then'](freshsales['getFreshsalesAccounts']())[_0x9984('0x1d')](realtime[_0x9984('0x30')]())[_0x9984('0x1d')](servicenow[_0x9984('0x31')]())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0x9984('0x32')]())[_0x9984('0x1d')](realtime[_0x9984('0x33')]())[_0x9984('0x1d')](campaign[_0x9984('0x34')]())[_0x9984('0x1d')](realtime[_0x9984('0x35')]())[_0x9984('0x1d')](voiceExtension[_0x9984('0x36')]())[_0x9984('0x1d')](realtime['initVoiceExtensions']())[_0x9984('0x1d')](faxAccount[_0x9984('0x37')]())[_0x9984('0x1d')](realtime[_0x9984('0x38')]())[_0x9984('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x9984('0x1b')]()[_0x9984('0x1d')](voiceQueueReport['getVoiceQueueReports']())[_0x9984('0x1d')](realtime[_0x9984('0x39')]())[_0x9984('0x1d')](cmHopperHistory[_0x9984('0x3a')]())[_0x9984('0x1d')](realtime[_0x9984('0x3b')]())['then'](cmHopperHistory[_0x9984('0x3c')]())['then'](realtime['initCampaignHopperHistory']())[_0x9984('0x1d')](voiceCallReport[_0x9984('0x3d')]())[_0x9984('0x1d')](realtime['initVoiceCallReports']())['catch'](function(_0x335df2){logger[_0x9984('0x3e')]('[index.js][initParams]',util['inspect'](_0x335df2,{'showHidden':![],'depth':null}));});}function main(){return server[_0x9984('0x3f')](realtime,preview,fax)[_0x9984('0x1d')](function(_0x60aeec){return initRealtime();})[_0x9984('0x1d')](function(){return initParams();})[_0x9984('0x1d')](function(){report[_0x9984('0x40')]();setInterval(initRealtime,0x1388);})[_0x9984('0x41')](function(_0x464b07){logger['error'](_0x9984('0x42'),util[_0x9984('0x43')](_0x464b07,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xdb51=['ami','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','error','[index.js][initParams]','sync','catch','[index.js][main]','inspect','bluebird','./realtime','./report','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger'];(function(_0x1566f3,_0x249fbe){var _0x49f4c6=function(_0x3d1de4){while(--_0x3d1de4){_0x1566f3['push'](_0x1566f3['shift']());}};_0x49f4c6(++_0x249fbe);}(_0xdb51,0x140));var _0x1db5=function(_0x152f4f,_0x57799d){_0x152f4f=_0x152f4f-0x0;var _0x2c3699=_0xdb51[_0x152f4f];return _0x2c3699;};'use strict';var BPromise=require(_0x1db5('0x0'));var util=require('util');var moment=require('moment');var server=require('./server');var Realtime=require(_0x1db5('0x1'));var Report=require(_0x1db5('0x2'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0x1db5('0x3'));var Preview=require('./preview');var Fax=require(_0x1db5('0x4'));var user=require(_0x1db5('0x5'));var voiceQueue=require(_0x1db5('0x6'));var voiceQueueReport=require(_0x1db5('0x7'));var voiceCallReport=require(_0x1db5('0x8'));var trunk=require(_0x1db5('0x9'));var trigger=require(_0x1db5('0xa'));var template=require(_0x1db5('0xb'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x1db5('0xc'));var voiceExtension=require(_0x1db5('0xd'));var faxAccount=require(_0x1db5('0xe'));var zendesk=require(_0x1db5('0xf'));var salesforce=require(_0x1db5('0x10'));var sugarcrm=require(_0x1db5('0x11'));var freshdesk=require(_0x1db5('0x12'));var desk=require(_0x1db5('0x13'));var zoho=require(_0x1db5('0x14'));var vtiger=require(_0x1db5('0x15'));var freshsales=require(_0x1db5('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x1db5('0x17'));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(_0x1db5('0x18'))(_0x1db5('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x1db5('0x1a')](_0x1db5('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1db5('0x1a')](_0x1db5('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x1db5('0x1c')]()[_0x1db5('0x1d')](user['getAgents']())['then'](realtime[_0x1db5('0x1e')]())[_0x1db5('0x1d')](user[_0x1db5('0x1f')]())['then'](realtime[_0x1db5('0x20')]())[_0x1db5('0x1d')](trunk['getTrunks']())[_0x1db5('0x1d')](realtime['initTrunks']())[_0x1db5('0x1d')](voiceQueue[_0x1db5('0x21')]())[_0x1db5('0x1d')](realtime['initVoiceQueues']())['then'](trigger[_0x1db5('0x22')]())[_0x1db5('0x1d')](realtime[_0x1db5('0x23')]())[_0x1db5('0x1d')](template[_0x1db5('0x24')]())[_0x1db5('0x1d')](realtime['initTemplates']())['then'](zendesk[_0x1db5('0x25')]())[_0x1db5('0x1d')](realtime['initZendeskAccounts']())[_0x1db5('0x1d')](salesforce[_0x1db5('0x26')]())['then'](realtime[_0x1db5('0x27')]())['then'](sugarcrm[_0x1db5('0x28')]())['then'](realtime[_0x1db5('0x29')]())['then'](freshdesk[_0x1db5('0x2a')]())[_0x1db5('0x1d')](realtime[_0x1db5('0x2b')]())[_0x1db5('0x1d')](desk[_0x1db5('0x2c')]())[_0x1db5('0x1d')](realtime[_0x1db5('0x2d')]())[_0x1db5('0x1d')](zoho[_0x1db5('0x2e')]())[_0x1db5('0x1d')](realtime['initZohoAccounts']())[_0x1db5('0x1d')](vtiger['getVtigerAccounts']())[_0x1db5('0x1d')](realtime[_0x1db5('0x2f')]())[_0x1db5('0x1d')](freshsales[_0x1db5('0x30')]())[_0x1db5('0x1d')](realtime[_0x1db5('0x31')]())[_0x1db5('0x1d')](servicenow[_0x1db5('0x32')]())[_0x1db5('0x1d')](realtime[_0x1db5('0x33')]())['then'](dynamics365[_0x1db5('0x34')]())[_0x1db5('0x1d')](realtime['initDynamics365Accounts']())[_0x1db5('0x1d')](campaign[_0x1db5('0x35')]())[_0x1db5('0x1d')](realtime[_0x1db5('0x36')]())[_0x1db5('0x1d')](voiceExtension[_0x1db5('0x37')]())['then'](realtime['initVoiceExtensions']())[_0x1db5('0x1d')](faxAccount['getFaxAccounts']())[_0x1db5('0x1d')](realtime[_0x1db5('0x38')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x1db5('0x1c')]()[_0x1db5('0x1d')](voiceQueueReport[_0x1db5('0x39')]())[_0x1db5('0x1d')](realtime[_0x1db5('0x3a')]())[_0x1db5('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x1db5('0x1d')](realtime[_0x1db5('0x3b')]())[_0x1db5('0x1d')](cmHopperHistory[_0x1db5('0x3c')]())[_0x1db5('0x1d')](realtime[_0x1db5('0x3d')]())[_0x1db5('0x1d')](voiceCallReport['getVoiceCallReports']())[_0x1db5('0x1d')](realtime[_0x1db5('0x3e')]())['catch'](function(_0x3745a6){logger[_0x1db5('0x3f')](_0x1db5('0x40'),util['inspect'](_0x3745a6,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x1db5('0x1d')](function(_0xb6278e){return initRealtime();})['then'](function(){return initParams();})[_0x1db5('0x1d')](function(){report[_0x1db5('0x41')]();setInterval(initRealtime,0x1388);})[_0x1db5('0x42')](function(_0x28bb89){logger['error'](_0x1db5('0x43'),util[_0x1db5('0x44')](_0x28bb89,{'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 33dd7fa..4ddc302 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x1b8625,_0x3b940c){var _0xeb3257=function(_0xb417cb){while(--_0xb417cb){_0x1b8625['push'](_0x1b8625['shift']());}};_0xeb3257(++_0x3b940c);}(_0x70e0,0x17b));var _0x070e=function(_0x34882e,_0x297c11){_0x34882e=_0x34882e-0x0;var _0x1b5c4a=_0x70e0[_0x34882e];return _0x1b5c4a;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x483e4a,_0x32aa45){var _0x31fba5=function(_0x345bc9){while(--_0x345bc9){_0x483e4a['push'](_0x483e4a['shift']());}};_0x31fba5(++_0x32aa45);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index ba43281..679a681 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 _0x27da=['dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x27da,0xf5));var _0xa27d=function(_0x3eaf00,_0x9ded0f){_0x3eaf00=_0x3eaf00-0x0;var _0x825c50=_0x27da[_0x3eaf00];return _0x825c50;};'use strict';function Campaign(_0x29e707){this['id']=_0x29e707['id']||0x0;this[_0xa27d('0x0')]=_0x29e707[_0xa27d('0x0')]||'';this[_0xa27d('0x1')]=_0x29e707['type']||_0xa27d('0x2');this[_0xa27d('0x3')]=0x0;this['temp']=0x0;this[_0xa27d('0x4')]=0x0;this[_0xa27d('0x5')]=0x0;this[_0xa27d('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0xa27d('0x7')]=_0x29e707[_0xa27d('0x7')];this['limitCalls']=_0x29e707[_0xa27d('0x8')];this[_0xa27d('0x9')]=_0x29e707[_0xa27d('0x9')]||null;this[_0xa27d('0xa')]=_0x29e707[_0xa27d('0xa')]?_0x29e707[_0xa27d('0xa')]:null;this['dialOriginateCallerIdName']=_0x29e707[_0xa27d('0xb')];this[_0xa27d('0xc')]=_0x29e707[_0xa27d('0xc')];this['dialOriginateTimeout']=_0x29e707[_0xa27d('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x29e707[_0xa27d('0xe')];this[_0xa27d('0xf')]=_0x29e707[_0xa27d('0xf')];this['dialBusyMaxRetry']=_0x29e707[_0xa27d('0x10')];this['dialBusyRetryFrequency']=_0x29e707[_0xa27d('0x11')];this[_0xa27d('0x12')]=_0x29e707['dialNoAnswerMaxRetry'];this[_0xa27d('0x13')]=_0x29e707[_0xa27d('0x13')];this['dialGlobalMaxRetry']=_0x29e707[_0xa27d('0x14')];this[_0xa27d('0x15')]=_0x29e707[_0xa27d('0x15')]||0x3;this[_0xa27d('0x16')]=_0x29e707[_0xa27d('0x16')]||0x96;this[_0xa27d('0x17')]=_0x29e707[_0xa27d('0x17')]||0x3;this[_0xa27d('0x18')]=_0x29e707[_0xa27d('0x18')]||0x96;this[_0xa27d('0x19')]=_0x29e707[_0xa27d('0x19')]||0x3;this[_0xa27d('0x1a')]=_0x29e707[_0xa27d('0x1a')]||0x96;this[_0xa27d('0x1b')]=_0x29e707[_0xa27d('0x1b')]||0x3;this[_0xa27d('0x1c')]=_0x29e707[_0xa27d('0x1c')]||0x96;this['dialAgentRejectMaxRetry']=_0x29e707[_0xa27d('0x1d')]||0x3;this[_0xa27d('0x1e')]=_0x29e707[_0xa27d('0x1e')]||0x96;this['dialOrderByScheduledAt']=_0x29e707[_0xa27d('0x1f')]||_0xa27d('0x20');this[_0xa27d('0x21')]=_0x29e707[_0xa27d('0x21')]||undefined;this[_0xa27d('0x22')]=_0x29e707['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xa27d('0x23')]=_0x29e707[_0xa27d('0x23')]||undefined;this[_0xa27d('0x24')]=_0x29e707['TrunkBackup']?_0x29e707[_0xa27d('0x24')]:undefined;this['Trunk']=_0x29e707['Trunk']?_0x29e707['Trunk']:undefined;this[_0xa27d('0x25')]=_0x29e707[_0xa27d('0x25')]?_0x29e707[_0xa27d('0x25')]:undefined;this['SquareProject']=_0x29e707[_0xa27d('0x26')]?_0x29e707[_0xa27d('0x26')]:undefined;this[_0xa27d('0x27')]=_0x29e707[_0xa27d('0x26')]?_0x29e707['SquareProject'][_0xa27d('0x0')]:undefined;this[_0xa27d('0x28')]=_0x29e707[_0xa27d('0x28')]||![];this['dialAMDInitialSilence']=_0x29e707[_0xa27d('0x29')];this[_0xa27d('0x2a')]=_0x29e707[_0xa27d('0x2a')];this[_0xa27d('0x2b')]=_0x29e707[_0xa27d('0x2b')];this[_0xa27d('0x2c')]=_0x29e707['dialAMDTotalAnalysisTime'];this[_0xa27d('0x2d')]=_0x29e707[_0xa27d('0x2d')];this[_0xa27d('0x2e')]=_0x29e707[_0xa27d('0x2e')];this['dialAMDMaximumNumberOfWords']=_0x29e707[_0xa27d('0x2f')];this[_0xa27d('0x30')]=_0x29e707[_0xa27d('0x30')];this[_0xa27d('0x31')]=_0x29e707[_0xa27d('0x31')];}module[_0xa27d('0x32')]=Campaign; \ No newline at end of file +var _0x371a=['dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix'];(function(_0x4a667c,_0x4bffc5){var _0x359012=function(_0x58177c){while(--_0x58177c){_0x4a667c['push'](_0x4a667c['shift']());}};_0x359012(++_0x4bffc5);}(_0x371a,0x10b));var _0xa371=function(_0x512435,_0x39e0a0){_0x512435=_0x512435-0x0;var _0xb269e2=_0x371a[_0x512435];return _0xb269e2;};'use strict';function Campaign(_0x1e3029){this['id']=_0x1e3029['id']||0x0;this[_0xa371('0x0')]=_0x1e3029['name']||'';this[_0xa371('0x1')]=_0x1e3029['type']||'campaign';this['originated']=0x0;this[_0xa371('0x2')]=0x0;this[_0xa371('0x3')]=0x0;this[_0xa371('0x4')]=0x0;this[_0xa371('0x5')]='';this[_0xa371('0x6')]=!![];this['active']=_0x1e3029[_0xa371('0x7')];this['limitCalls']=_0x1e3029[_0xa371('0x8')];this['dialTimezone']=_0x1e3029[_0xa371('0x9')]||null;this[_0xa371('0xa')]=_0x1e3029[_0xa371('0xa')]?_0x1e3029[_0xa371('0xa')]:null;this[_0xa371('0xb')]=_0x1e3029[_0xa371('0xb')];this[_0xa371('0xc')]=_0x1e3029[_0xa371('0xc')];this['dialOriginateTimeout']=_0x1e3029[_0xa371('0xd')]||0x1e;this[_0xa371('0xe')]=_0x1e3029[_0xa371('0xe')];this[_0xa371('0xf')]=_0x1e3029[_0xa371('0xf')];this[_0xa371('0x10')]=_0x1e3029[_0xa371('0x10')];this['dialBusyRetryFrequency']=_0x1e3029[_0xa371('0x11')];this[_0xa371('0x12')]=_0x1e3029[_0xa371('0x12')];this[_0xa371('0x13')]=_0x1e3029['dialNoAnswerRetryFrequency'];this[_0xa371('0x14')]=_0x1e3029[_0xa371('0x14')];this[_0xa371('0x15')]=_0x1e3029[_0xa371('0x15')]||0x3;this[_0xa371('0x16')]=_0x1e3029['dialNoSuchNumberRetryFrequency']||0x96;this[_0xa371('0x17')]=_0x1e3029['dialDropMaxRetry']||0x3;this[_0xa371('0x18')]=_0x1e3029[_0xa371('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x1e3029[_0xa371('0x19')]||0x3;this[_0xa371('0x1a')]=_0x1e3029['dialAbandonedRetryFrequency']||0x96;this[_0xa371('0x1b')]=_0x1e3029[_0xa371('0x1b')]||0x3;this[_0xa371('0x1c')]=_0x1e3029[_0xa371('0x1c')]||0x96;this['dialAgentRejectMaxRetry']=_0x1e3029['dialAgentRejectMaxRetry']||0x3;this[_0xa371('0x1d')]=_0x1e3029[_0xa371('0x1d')]||0x96;this[_0xa371('0x1e')]=_0x1e3029[_0xa371('0x1e')]||_0xa371('0x1f');this[_0xa371('0x20')]=_0x1e3029[_0xa371('0x20')]||undefined;this[_0xa371('0x21')]=_0x1e3029['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xa371('0x22')]=_0x1e3029['dialCutDigit']||undefined;this['TrunkBackup']=_0x1e3029[_0xa371('0x23')]?_0x1e3029['TrunkBackup']:undefined;this[_0xa371('0x24')]=_0x1e3029[_0xa371('0x24')]?_0x1e3029['Trunk']:undefined;this['Interval']=_0x1e3029[_0xa371('0x25')]?_0x1e3029[_0xa371('0x25')]:undefined;this['SquareProject']=_0x1e3029[_0xa371('0x26')]?_0x1e3029[_0xa371('0x26')]:undefined;this[_0xa371('0x27')]=_0x1e3029['SquareProject']?_0x1e3029[_0xa371('0x26')][_0xa371('0x0')]:undefined;this[_0xa371('0x28')]=_0x1e3029[_0xa371('0x28')]||![];this[_0xa371('0x29')]=_0x1e3029[_0xa371('0x29')];this['dialAMDGreeting']=_0x1e3029['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x1e3029[_0xa371('0x2a')];this[_0xa371('0x2b')]=_0x1e3029[_0xa371('0x2b')];this[_0xa371('0x2c')]=_0x1e3029[_0xa371('0x2c')];this[_0xa371('0x2d')]=_0x1e3029[_0xa371('0x2d')];this[_0xa371('0x2e')]=_0x1e3029['dialAMDMaximumNumberOfWords'];this[_0xa371('0x2f')]=_0x1e3029[_0xa371('0x2f')];this['dialAMDMaximumWordLength']=_0x1e3029[_0xa371('0x30')];}module[_0xa371('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 83b122b..f1b110a 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 _0xdbc6=['transfercalleridnum','transferconnectedlinenum','exports','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answered','endtime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','holdtime','tag','disposition','monitorFilename','queue','monitors'];(function(_0x285115,_0x22f186){var _0x3b00a5=function(_0x433817){while(--_0x433817){_0x285115['push'](_0x285115['shift']());}};_0x3b00a5(++_0x22f186);}(_0xdbc6,0x13b));var _0x6dbc=function(_0x2eac59,_0x2a5b64){_0x2eac59=_0x2eac59-0x0;var _0x268bd9=_0xdbc6[_0x2eac59];return _0x268bd9;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0x6dbc('0x0')]='';this['calleridnum']=0x0;this[_0x6dbc('0x1')]='';this[_0x6dbc('0x2')]=undefined;this[_0x6dbc('0x3')]=undefined;this[_0x6dbc('0x4')]=0x0;this[_0x6dbc('0x5')]='';this[_0x6dbc('0x6')]=0x0;this['linkedid']=0x0;this[_0x6dbc('0x7')]=0x0;this[_0x6dbc('0x8')]=![];this['answertime']=null;this[_0x6dbc('0x9')]=null;this[_0x6dbc('0xa')]=![];this[_0x6dbc('0xb')]=![];this[_0x6dbc('0xc')]='';this[_0x6dbc('0xd')]='';this['duration']=0x0;this[_0x6dbc('0xe')]=0x0;this[_0x6dbc('0xf')]=0x0;this['type']=null;this[_0x6dbc('0x10')]=null;this[_0x6dbc('0x11')]=null;this['monitor']=![];this[_0x6dbc('0x12')]=null;this[_0x6dbc('0x13')]=null;this[_0x6dbc('0x14')]=[];this[_0x6dbc('0x15')]=undefined;this[_0x6dbc('0x16')]=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0x6dbc('0x17')]=Channel; \ No newline at end of file +var _0xc931=['unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime','type','disposition','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answertime','endtime'];(function(_0x4c7264,_0x17a8df){var _0x33b4fb=function(_0xb2c0cd){while(--_0xb2c0cd){_0x4c7264['push'](_0x4c7264['shift']());}};_0x33b4fb(++_0x17a8df);}(_0xc931,0x19c));var _0x1c93=function(_0x1db483,_0x47898a){_0x1db483=_0x1db483-0x0;var _0x509b51=_0xc931[_0x1db483];return _0x509b51;};'use strict';function Channel(){this[_0x1c93('0x0')]=null;this[_0x1c93('0x1')]='';this['destinationchannel']='';this[_0x1c93('0x2')]=0x0;this[_0x1c93('0x3')]='';this[_0x1c93('0x4')]=undefined;this[_0x1c93('0x5')]=undefined;this[_0x1c93('0x6')]=0x0;this[_0x1c93('0x7')]='';this[_0x1c93('0x8')]=0x0;this[_0x1c93('0x9')]=0x0;this[_0x1c93('0xa')]=0x0;this['answered']=![];this[_0x1c93('0xb')]=null;this[_0x1c93('0xc')]=null;this[_0x1c93('0xd')]=![];this['abandoned']=![];this[_0x1c93('0xe')]='';this[_0x1c93('0xf')]='';this[_0x1c93('0x10')]=0x0;this[_0x1c93('0x11')]=0x0;this[_0x1c93('0x12')]=0x0;this[_0x1c93('0x13')]=null;this['tag']=null;this[_0x1c93('0x14')]=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this['monitors']=[];this[_0x1c93('0x15')]=undefined;this[_0x1c93('0x16')]=undefined;this[_0x1c93('0x17')]=undefined;this[_0x1c93('0x18')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 1db50a1..5b6a0b0 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 _0x86c6=['token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x86c6,0x1b5));var _0x686c=function(_0x495898,_0x4417db){_0x495898=_0x495898-0x0;var _0x29117a=_0x86c6[_0x495898];return _0x29117a;};'use strict';function DeskAccount(_0x304160){this['id']=_0x304160['id']||0x0;this[_0x686c('0x0')]=_0x304160[_0x686c('0x0')]||'';this[_0x686c('0x1')]=_0x304160[_0x686c('0x1')]||'';this[_0x686c('0x2')]=_0x304160['remoteUri']||'';this['authType']=_0x304160[_0x686c('0x3')]||'';this[_0x686c('0x4')]=_0x304160[_0x686c('0x4')]||'';this[_0x686c('0x5')]=_0x304160[_0x686c('0x5')]||'';this[_0x686c('0x6')]=_0x304160[_0x686c('0x6')]||'';this[_0x686c('0x7')]=_0x304160[_0x686c('0x7')]||'';this[_0x686c('0x8')]=_0x304160['tokenSecret']||'';this[_0x686c('0x9')]=_0x304160[_0x686c('0x9')]||'';this[_0x686c('0xa')]=_0x304160[_0x686c('0xa')]||'';this[_0x686c('0xb')]=_0x304160[_0x686c('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x022e=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x21bb2f,_0x4199b9){var _0x279b0e=function(_0x4014b5){while(--_0x4014b5){_0x21bb2f['push'](_0x21bb2f['shift']());}};_0x279b0e(++_0x4199b9);}(_0x022e,0x12a));var _0xe022=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x022e[_0x8c43de];return _0xa6591b;};'use strict';function DeskAccount(_0x26752b){this['id']=_0x26752b['id']||0x0;this[_0xe022('0x0')]=_0x26752b['name']||'';this[_0xe022('0x1')]=_0x26752b['username']||'';this[_0xe022('0x2')]=_0x26752b[_0xe022('0x2')]||'';this['authType']=_0x26752b[_0xe022('0x3')]||'';this[_0xe022('0x4')]=_0x26752b[_0xe022('0x4')]||'';this[_0xe022('0x5')]=_0x26752b['consumerKey']||'';this[_0xe022('0x6')]=_0x26752b[_0xe022('0x6')]||'';this[_0xe022('0x7')]=_0x26752b['token']||'';this[_0xe022('0x8')]=_0x26752b['tokenSecret']||'';this[_0xe022('0x9')]=_0x26752b[_0xe022('0x9')]||'';this[_0xe022('0xa')]=_0x26752b[_0xe022('0xa')]||'';this[_0xe022('0xb')]=_0x26752b[_0xe022('0xb')]||{};}module[_0xe022('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 7de8046..bcabd4d 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 _0xb494=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x392288,_0x54ee4f){var _0x3e1eb9=function(_0x24188c){while(--_0x24188c){_0x392288['push'](_0x392288['shift']());}};_0x3e1eb9(++_0x54ee4f);}(_0xb494,0x1ea));var _0x4b49=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xb494[_0xef8146];return _0x5a6cb0;};'use strict';function Dynamics365Account(_0x5f4e7e){this['id']=_0x5f4e7e['id']||0x0;this[_0x4b49('0x0')]=_0x5f4e7e['name']||'';this[_0x4b49('0x1')]=_0x5f4e7e[_0x4b49('0x1')]||'';this['password']=_0x5f4e7e[_0x4b49('0x2')]||'';this[_0x4b49('0x3')]=_0x5f4e7e[_0x4b49('0x3')]||'';this[_0x4b49('0x4')]=_0x5f4e7e[_0x4b49('0x4')]||'';this['clientId']=_0x5f4e7e[_0x4b49('0x5')]||'';this[_0x4b49('0x6')]=_0x5f4e7e[_0x4b49('0x6')]||{};this[_0x4b49('0x7')]=_0x5f4e7e['serverUrl']||'';this[_0x4b49('0x8')]=_0x5f4e7e['modernAuthentication']||![];this[_0x4b49('0x9')]=_0x5f4e7e[_0x4b49('0x9')]||{};this['CloudProvider']=_0x5f4e7e['CloudProvider']||{};}module[_0x4b49('0xa')]=Dynamics365Account; \ No newline at end of file +var _0xd274=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','password','remoteUri','tenantId'];(function(_0x35b5fb,_0x175955){var _0xb76d8c=function(_0xebf80c){while(--_0xebf80c){_0x35b5fb['push'](_0x35b5fb['shift']());}};_0xb76d8c(++_0x175955);}(_0xd274,0xc2));var _0x4d27=function(_0x472a82,_0x25189b){_0x472a82=_0x472a82-0x0;var _0x44131d=_0xd274[_0x472a82];return _0x44131d;};'use strict';function Dynamics365Account(_0x56f8f1){this['id']=_0x56f8f1['id']||0x0;this['name']=_0x56f8f1[_0x4d27('0x0')]||'';this['username']=_0x56f8f1['username']||'';this[_0x4d27('0x1')]=_0x56f8f1[_0x4d27('0x1')]||'';this['remoteUri']=_0x56f8f1[_0x4d27('0x2')]||'';this[_0x4d27('0x3')]=_0x56f8f1['tenantId']||'';this[_0x4d27('0x4')]=_0x56f8f1['clientId']||'';this[_0x4d27('0x5')]=_0x56f8f1[_0x4d27('0x5')]||{};this['serverUrl']=_0x56f8f1[_0x4d27('0x6')]||'';this[_0x4d27('0x7')]=_0x56f8f1[_0x4d27('0x7')]||![];this[_0x4d27('0x8')]=_0x56f8f1['Configurations']||{};this[_0x4d27('0x9')]=_0x56f8f1[_0x4d27('0x9')]||{};}module[_0x4d27('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 4171549..8cde978 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 _0x85d0=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','t38timeout','tech','Trunk','ListId','key'];(function(_0x17882c,_0x4b964b){var _0x355a59=function(_0x534b5b){while(--_0x534b5b){_0x17882c['push'](_0x17882c['shift']());}};_0x355a59(++_0x4b964b);}(_0x85d0,0x97));var _0x085d=function(_0x1bd405,_0x471909){_0x1bd405=_0x1bd405-0x0;var _0x48af49=_0x85d0[_0x1bd405];return _0x48af49;};'use strict';function FaxAccount(_0x38512f){this['id']=_0x38512f['id']||0x0;this[_0x085d('0x0')]=_0x38512f['name']||'';this['description']=_0x38512f[_0x085d('0x1')];this[_0x085d('0x2')]=_0x38512f[_0x085d('0x2')];this[_0x085d('0x3')]=_0x38512f[_0x085d('0x3')];this['localstationid']=_0x38512f[_0x085d('0x4')];this['minrate']=_0x38512f[_0x085d('0x5')]||0x960;this[_0x085d('0x6')]=_0x38512f[_0x085d('0x6')]||0x3840;this['modem']=_0x38512f[_0x085d('0x7')]||'v17,v27,v29';this[_0x085d('0x8')]=_0x38512f[_0x085d('0x8')]||'no';this['faxdetect']=_0x38512f['faxdetect']||'no';this[_0x085d('0x9')]=_0x38512f[_0x085d('0x9')]||0x1388;this[_0x085d('0xa')]=_0x38512f[_0x085d('0xa')]||'SIP';this[_0x085d('0xb')]=_0x38512f[_0x085d('0xb')]?_0x38512f[_0x085d('0xb')]:undefined;this['ListId']=_0x38512f[_0x085d('0xc')];this[_0x085d('0xd')]=_0x38512f[_0x085d('0xd')];}module[_0x085d('0xe')]=FaxAccount; \ No newline at end of file +var _0x6412=['SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x1654f5,_0x5e1214){var _0x37cd7d=function(_0x9d544e){while(--_0x9d544e){_0x1654f5['push'](_0x1654f5['shift']());}};_0x37cd7d(++_0x5e1214);}(_0x6412,0x169));var _0x2641=function(_0x5bf82d,_0x290676){_0x5bf82d=_0x5bf82d-0x0;var _0x35122d=_0x6412[_0x5bf82d];return _0x35122d;};'use strict';function FaxAccount(_0xd407){this['id']=_0xd407['id']||0x0;this['name']=_0xd407[_0x2641('0x0')]||'';this['description']=_0xd407[_0x2641('0x1')];this[_0x2641('0x2')]=_0xd407[_0x2641('0x2')];this[_0x2641('0x3')]=_0xd407[_0x2641('0x3')];this[_0x2641('0x4')]=_0xd407[_0x2641('0x4')];this[_0x2641('0x5')]=_0xd407[_0x2641('0x5')]||0x960;this[_0x2641('0x6')]=_0xd407[_0x2641('0x6')]||0x3840;this[_0x2641('0x7')]=_0xd407[_0x2641('0x7')]||_0x2641('0x8');this['gateway']=_0xd407[_0x2641('0x9')]||'no';this['faxdetect']=_0xd407[_0x2641('0xa')]||'no';this[_0x2641('0xb')]=_0xd407[_0x2641('0xb')]||0x1388;this[_0x2641('0xc')]=_0xd407[_0x2641('0xc')]||_0x2641('0xd');this[_0x2641('0xe')]=_0xd407[_0x2641('0xe')]?_0xd407['Trunk']:undefined;this[_0x2641('0xf')]=_0xd407['ListId'];this[_0x2641('0x10')]=_0xd407[_0x2641('0x10')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 7785383..fa2d7ac 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 _0x5817=['serverUrl','name','username','apiKey','token','remoteUri'];(function(_0x4ee092,_0x5e9420){var _0x15d06b=function(_0x42d1d1){while(--_0x42d1d1){_0x4ee092['push'](_0x4ee092['shift']());}};_0x15d06b(++_0x5e9420);}(_0x5817,0x145));var _0x7581=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5817[_0x3b380d];return _0x54502b;};'use strict';function FreshdeskAccount(_0x444df1){this['id']=_0x444df1['id']||0x0;this[_0x7581('0x0')]=_0x444df1[_0x7581('0x0')]||'';this[_0x7581('0x1')]=_0x444df1[_0x7581('0x1')]||'';this[_0x7581('0x2')]=_0x444df1[_0x7581('0x3')]||'';this[_0x7581('0x4')]=_0x444df1[_0x7581('0x4')]||'';this[_0x7581('0x5')]=_0x444df1[_0x7581('0x5')]||'';this['Configurations']=_0x444df1['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xe2ca=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x7b6f59,_0x7cc38d){var _0x278caf=function(_0x242c5b){while(--_0x242c5b){_0x7b6f59['push'](_0x7b6f59['shift']());}};_0x278caf(++_0x7cc38d);}(_0xe2ca,0x6c));var _0xae2c=function(_0x5826c1,_0x180538){_0x5826c1=_0x5826c1-0x0;var _0x42cfe8=_0xe2ca[_0x5826c1];return _0x42cfe8;};'use strict';function FreshdeskAccount(_0x1f73c2){this['id']=_0x1f73c2['id']||0x0;this[_0xae2c('0x0')]=_0x1f73c2[_0xae2c('0x0')]||'';this[_0xae2c('0x1')]=_0x1f73c2[_0xae2c('0x1')]||'';this[_0xae2c('0x2')]=_0x1f73c2[_0xae2c('0x3')]||'';this[_0xae2c('0x4')]=_0x1f73c2[_0xae2c('0x4')]||'';this[_0xae2c('0x5')]=_0x1f73c2[_0xae2c('0x5')]||'';this[_0xae2c('0x6')]=_0x1f73c2[_0xae2c('0x6')]||{};}module[_0xae2c('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 4c9ae7d..ee793fd 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 _0x0309=['name','username','apiKey','token','remoteUri','serverUrl','exports'];(function(_0x2cad46,_0x37b1ea){var _0x5b0245=function(_0x9e64eb){while(--_0x9e64eb){_0x2cad46['push'](_0x2cad46['shift']());}};_0x5b0245(++_0x37b1ea);}(_0x0309,0x165));var _0x9030=function(_0xcad719,_0x4bc600){_0xcad719=_0xcad719-0x0;var _0x4e9e5b=_0x0309[_0xcad719];return _0x4e9e5b;};'use strict';function FreshsalesAccount(_0x15c656){this['id']=_0x15c656['id']||0x0;this['name']=_0x15c656[_0x9030('0x0')]||'';this['username']=_0x15c656[_0x9030('0x1')]||'';this[_0x9030('0x2')]=_0x15c656[_0x9030('0x3')]||'';this[_0x9030('0x4')]=_0x15c656[_0x9030('0x4')]||'';this[_0x9030('0x5')]=_0x15c656[_0x9030('0x5')]||'';this['Configurations']=_0x15c656['Configurations']||{};}module[_0x9030('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x04f1=['exports','name','apiKey','token','remoteUri'];(function(_0x222f67,_0x317376){var _0x19db56=function(_0xe49d8a){while(--_0xe49d8a){_0x222f67['push'](_0x222f67['shift']());}};_0x19db56(++_0x317376);}(_0x04f1,0x92));var _0x104f=function(_0x328130,_0x212624){_0x328130=_0x328130-0x0;var _0x446025=_0x04f1[_0x328130];return _0x446025;};'use strict';function FreshsalesAccount(_0x2550ff){this['id']=_0x2550ff['id']||0x0;this[_0x104f('0x0')]=_0x2550ff[_0x104f('0x0')]||'';this['username']=_0x2550ff['username']||'';this[_0x104f('0x1')]=_0x2550ff[_0x104f('0x2')]||'';this[_0x104f('0x3')]=_0x2550ff['remoteUri']||'';this['serverUrl']=_0x2550ff['serverUrl']||'';this['Configurations']=_0x2550ff['Configurations']||{};}module[_0x104f('0x4')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 9e3a783..728f57a 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 _0xb077=['queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname'];(function(_0x39872b,_0x343e6b){var _0x55fa18=function(_0x217c7f){while(--_0x217c7f){_0x39872b['push'](_0x39872b['shift']());}};_0x55fa18(++_0x343e6b);}(_0xb077,0x1c6));var _0x7b07=function(_0x13db71,_0xea8a3b){_0x13db71=_0x13db71-0x0;var _0x300282=_0xb077[_0x13db71];return _0x300282;};'use strict';function QueueReport(){this[_0x7b07('0x0')]=_0x7b07('0x1');this[_0x7b07('0x2')]='';this[_0x7b07('0x3')]='';this[_0x7b07('0x4')]='';this[_0x7b07('0x5')]='';this[_0x7b07('0x6')]=null;this[_0x7b07('0x7')]=null;this[_0x7b07('0x8')]=0x1;this[_0x7b07('0x9')]=0x1;this['queuecallerabandon']=![];this[_0x7b07('0xa')]=null;this['queuecallercomplete']=![];this[_0x7b07('0xb')]=null;this[_0x7b07('0xc')]=![];this[_0x7b07('0xd')]=null;this[_0x7b07('0xe')]=0x1;this[_0x7b07('0xf')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x7b07('0x10')]='';this[_0x7b07('0x11')]='';this[_0x7b07('0x12')]='';this[_0x7b07('0x13')]='';this[_0x7b07('0x14')]=0x0;this[_0x7b07('0x15')]=![];this[_0x7b07('0x16')]='';this[_0x7b07('0x17')]='voice';this[_0x7b07('0x18')]=0x0;this[_0x7b07('0x19')]={};}module[_0x7b07('0x1a')]=QueueReport; \ No newline at end of file +var _0xda64=['queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','accountcode','context','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','inbound','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon'];(function(_0x599c44,_0x2fb16e){var _0x1d6cf6=function(_0x43f375){while(--_0x43f375){_0x599c44['push'](_0x599c44['shift']());}};_0x1d6cf6(++_0x2fb16e);}(_0xda64,0x124));var _0x4da6=function(_0x28ea58,_0x4b7281){_0x28ea58=_0x28ea58-0x0;var _0x591708=_0xda64[_0x28ea58];return _0x591708;};'use strict';function QueueReport(){this['type']=_0x4da6('0x0');this['uniqueid']='';this[_0x4da6('0x1')]='';this[_0x4da6('0x2')]='';this['queue']='';this[_0x4da6('0x3')]=null;this[_0x4da6('0x4')]=null;this[_0x4da6('0x5')]=0x1;this[_0x4da6('0x6')]=0x1;this[_0x4da6('0x7')]=![];this[_0x4da6('0x8')]=null;this[_0x4da6('0x9')]=![];this[_0x4da6('0xa')]=null;this[_0x4da6('0xb')]=![];this[_0x4da6('0xc')]=null;this[_0x4da6('0xd')]=0x1;this[_0x4da6('0xe')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x4da6('0xf')]='';this[_0x4da6('0x10')]='';this['exten']='';this[_0x4da6('0x11')]='';this[_0x4da6('0x12')]=0x0;this[_0x4da6('0x13')]=![];this[_0x4da6('0x14')]='';this[_0x4da6('0x15')]=_0x4da6('0x16');this[_0x4da6('0x17')]=0x0;this[_0x4da6('0x18')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 20526e6..80af594 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 _0xb49b=['serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb49b,0x1ba));var _0xbb49=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xb49b[_0x5ddb1c];return _0x354adc;};'use strict';function SalesforceAccount(_0x3c32a7){this['id']=_0x3c32a7['id']||0x0;this[_0xbb49('0x0')]=_0x3c32a7[_0xbb49('0x0')]||'';this[_0xbb49('0x1')]=_0x3c32a7[_0xbb49('0x1')]||'';this[_0xbb49('0x2')]=_0x3c32a7['remoteUri']||'';this['password']=_0x3c32a7[_0xbb49('0x3')]||'';this[_0xbb49('0x4')]=_0x3c32a7[_0xbb49('0x4')]||'';this[_0xbb49('0x5')]=_0x3c32a7['clientSecret']||'';this[_0xbb49('0x6')]=_0x3c32a7['securityToken']||'';this[_0xbb49('0x7')]=_0x3c32a7[_0xbb49('0x7')]||_0xbb49('0x8');this[_0xbb49('0x9')]=_0x3c32a7[_0xbb49('0x9')]||'';this[_0xbb49('0xa')]=_0x3c32a7[_0xbb49('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x789f=['integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x789f,0x10c));var _0xf789=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x789f[_0x1bc0ae];return _0x501104;};'use strict';function SalesforceAccount(_0x98b2f1){this['id']=_0x98b2f1['id']||0x0;this['name']=_0x98b2f1[_0xf789('0x0')]||'';this[_0xf789('0x1')]=_0x98b2f1[_0xf789('0x1')]||'';this[_0xf789('0x2')]=_0x98b2f1['remoteUri']||'';this[_0xf789('0x3')]=_0x98b2f1[_0xf789('0x3')]||'';this[_0xf789('0x4')]=_0x98b2f1[_0xf789('0x4')]||'';this['clientSecret']=_0x98b2f1[_0xf789('0x5')]||'';this[_0xf789('0x6')]=_0x98b2f1['securityToken']||'';this[_0xf789('0x7')]=_0x98b2f1[_0xf789('0x7')]||_0xf789('0x8');this[_0xf789('0x9')]=_0x98b2f1[_0xf789('0x9')]||'';this[_0xf789('0xa')]=_0x98b2f1[_0xf789('0xa')]||{};}module[_0xf789('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 23b27fc..f80f558 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 _0xc591=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x396101,_0x2d5b6c){var _0x4006c0=function(_0x365cec){while(--_0x365cec){_0x396101['push'](_0x396101['shift']());}};_0x4006c0(++_0x2d5b6c);}(_0xc591,0x12b));var _0x1c59=function(_0x50af9c,_0xf03b1e){_0x50af9c=_0x50af9c-0x0;var _0x5b5e5a=_0xc591[_0x50af9c];return _0x5b5e5a;};'use strict';function ServicenowAccount(_0x38b348){this['id']=_0x38b348['id']||0x0;this[_0x1c59('0x0')]=_0x38b348[_0x1c59('0x0')]||'';this['username']=_0x38b348[_0x1c59('0x1')]||'';this[_0x1c59('0x2')]=_0x38b348['password']||'';this[_0x1c59('0x3')]=_0x38b348[_0x1c59('0x3')]||'';this[_0x1c59('0x4')]=_0x38b348['serverUrl']||'';this[_0x1c59('0x5')]=_0x38b348[_0x1c59('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x4aee=['remoteUri','serverUrl','name','username','password'];(function(_0x207a02,_0x278c56){var _0xd995c3=function(_0x24e415){while(--_0x24e415){_0x207a02['push'](_0x207a02['shift']());}};_0xd995c3(++_0x278c56);}(_0x4aee,0x7f));var _0xe4ae=function(_0x2d06ef,_0x2b609d){_0x2d06ef=_0x2d06ef-0x0;var _0x5ea499=_0x4aee[_0x2d06ef];return _0x5ea499;};'use strict';function ServicenowAccount(_0x303ad3){this['id']=_0x303ad3['id']||0x0;this[_0xe4ae('0x0')]=_0x303ad3[_0xe4ae('0x0')]||'';this[_0xe4ae('0x1')]=_0x303ad3[_0xe4ae('0x1')]||'';this['password']=_0x303ad3[_0xe4ae('0x2')]||'';this[_0xe4ae('0x3')]=_0x303ad3[_0xe4ae('0x3')]||'';this[_0xe4ae('0x4')]=_0x303ad3[_0xe4ae('0x4')]||'';this['Configurations']=_0x303ad3['Configurations']||{};}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 5cdc2bb..f9ff658 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 _0x78e7=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x13aa0a,_0x55079e){var _0xf05be=function(_0xb9541f){while(--_0xb9541f){_0x13aa0a['push'](_0x13aa0a['shift']());}};_0xf05be(++_0x55079e);}(_0x78e7,0xb0));var _0x778e=function(_0x19ef95,_0x2b55f6){_0x19ef95=_0x19ef95-0x0;var _0x21093c=_0x78e7[_0x19ef95];return _0x21093c;};'use strict';function SugarcrmAccount(_0x5cdcc7){this['id']=_0x5cdcc7['id']||0x0;this[_0x778e('0x0')]=_0x5cdcc7[_0x778e('0x0')]||'';this[_0x778e('0x1')]=_0x5cdcc7[_0x778e('0x1')]||'';this[_0x778e('0x2')]=_0x5cdcc7[_0x778e('0x2')]||'';this[_0x778e('0x3')]=_0x5cdcc7[_0x778e('0x3')]||'';this[_0x778e('0x4')]=_0x5cdcc7[_0x778e('0x4')]||'';this['Configurations']=_0x5cdcc7[_0x778e('0x5')]||{};}module[_0x778e('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xefe4=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xefe4,0x11a));var _0x4efe=function(_0x6b16e8,_0x33b4aa){_0x6b16e8=_0x6b16e8-0x0;var _0x21fcf1=_0xefe4[_0x6b16e8];return _0x21fcf1;};'use strict';function SugarcrmAccount(_0xf2f624){this['id']=_0xf2f624['id']||0x0;this['name']=_0xf2f624[_0x4efe('0x0')]||'';this[_0x4efe('0x1')]=_0xf2f624['username']||'';this[_0x4efe('0x2')]=_0xf2f624[_0x4efe('0x2')]||'';this[_0x4efe('0x3')]=_0xf2f624[_0x4efe('0x3')]||'';this[_0x4efe('0x4')]=_0xf2f624[_0x4efe('0x4')]||'';this['Configurations']=_0xf2f624[_0x4efe('0x5')]||{};}module[_0x4efe('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 0126c6e..423cd6e 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 _0x52ed=['name','accountcode','unknown','stateTime','status','address'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x52ed,0x132));var _0xd52e=function(_0x4c0658,_0x833e86){_0x4c0658=_0x4c0658-0x0;var _0x1ebcd7=_0x52ed[_0x4c0658];return _0x1ebcd7;};'use strict';function Telephone(_0xcb9b8){this['id']=_0xcb9b8['id']||0x0;this[_0xd52e('0x0')]=_0xcb9b8[_0xd52e('0x0')]||'';this[_0xd52e('0x1')]=_0xcb9b8[_0xd52e('0x1')]||'';this['state']=_0xd52e('0x2');this[_0xd52e('0x3')]=0x0;this[_0xd52e('0x4')]=_0xd52e('0x2');this[_0xd52e('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x36e1=['accountcode','state','unknown','stateTime','status','exports','name'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x36e1,0x187));var _0x136e=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0x36e1[_0x58eec7];return _0x25c5d3;};'use strict';function Telephone(_0x5355e6){this['id']=_0x5355e6['id']||0x0;this[_0x136e('0x0')]=_0x5355e6[_0x136e('0x0')]||'';this['accountcode']=_0x5355e6[_0x136e('0x1')]||'';this[_0x136e('0x2')]=_0x136e('0x3');this[_0x136e('0x4')]=0x0;this[_0x136e('0x5')]='unknown';this['address']='';}module[_0x136e('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index a21f5a1..64a4348 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(_0x40a056,_0x2f2dba){var _0x5d4130=function(_0x6b226f){while(--_0x6b226f){_0x40a056['push'](_0x40a056['shift']());}};_0x5d4130(++_0x2f2dba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x1d9d70,_0x53c77f){var _0x49d03b=function(_0x17b6b8){while(--_0x17b6b8){_0x1d9d70['push'](_0x1d9d70['shift']());}};_0x49d03b(++_0x53c77f);}(_0xb10b,0x12a));var _0xbb10=function(_0x743701,_0x3e67bb){_0x743701=_0x743701-0x0;var _0x5a141d=_0xb10b[_0x743701];return _0x5a141d;};'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 9a34136..b0521a2 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 _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x296f8e,_0x37ae0b){var _0x4a3c35=function(_0xfad256){while(--_0xfad256){_0x296f8e['push'](_0x296f8e['shift']());}};_0x4a3c35(++_0x37ae0b);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a5a53,_0x598a8c){_0x1a5a53=_0x1a5a53-0x0;var _0xf75355=_0xb10b[_0x1a5a53];return _0xf75355;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file +var _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x37b0da,_0x42982f){_0x37b0da=_0x37b0da-0x0;var _0x18c5b6=_0x0b0e[_0x37b0da];return _0x18c5b6;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 2ae6b7f..ba8bb33 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 _0x5285=['unknown','stateTime','status','registry','indexOf','split','host','domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','name','state'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x5285,0x16e));var _0x5528=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x5285[_0x521929];return _0x632436;};'use strict';function Trunk(_0x2e6eb2){this['id']=_0x2e6eb2['id']||0x0;this['active']=_0x2e6eb2['active']||![];this[_0x5528('0x0')]=_0x2e6eb2[_0x5528('0x0')]||'';this[_0x5528('0x1')]=_0x5528('0x2');this[_0x5528('0x3')]=0x0;this[_0x5528('0x4')]='unknown';this[_0x5528('0x5')]=_0x2e6eb2[_0x5528('0x5')]&&_0x2e6eb2['registry'][_0x5528('0x6')](':')?_0x2e6eb2[_0x5528('0x5')][_0x5528('0x7')](':')[0x0]:'';this[_0x5528('0x8')]='';this['port']='';this[_0x5528('0x9')]='';this[_0x5528('0xa')]='';this[_0x5528('0xb')]='';this[_0x5528('0xc')]=_0x5528('0x2');this[_0x5528('0xd')]='';this['address']='';this['defaultuser']=_0x2e6eb2[_0x5528('0xe')]||'';}module[_0x5528('0xf')]=Trunk; \ No newline at end of file +var _0x8e6f=['domain','domainport','stateRegistry','registrationtime','address','defaultuser','exports','active','name','unknown','status','registry','indexOf','split','port'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8e6f,0x19c));var _0xf8e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e6f[_0x3dd15e];return _0x231fd0;};'use strict';function Trunk(_0x3cd9c2){this['id']=_0x3cd9c2['id']||0x0;this[_0xf8e6('0x0')]=_0x3cd9c2[_0xf8e6('0x0')]||![];this[_0xf8e6('0x1')]=_0x3cd9c2[_0xf8e6('0x1')]||'';this['state']=_0xf8e6('0x2');this['stateTime']=0x0;this[_0xf8e6('0x3')]=_0xf8e6('0x2');this['registry']=_0x3cd9c2[_0xf8e6('0x4')]&&_0x3cd9c2[_0xf8e6('0x4')][_0xf8e6('0x5')](':')?_0x3cd9c2[_0xf8e6('0x4')][_0xf8e6('0x6')](':')[0x0]:'';this['host']='';this[_0xf8e6('0x7')]='';this[_0xf8e6('0x8')]='';this[_0xf8e6('0x9')]='';this['refresh']='';this[_0xf8e6('0xa')]='unknown';this[_0xf8e6('0xb')]='';this[_0xf8e6('0xc')]='';this[_0xf8e6('0xd')]=_0x3cd9c2[_0xf8e6('0xd')]||'';}module[_0xf8e6('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 6bccd48..cb93e41 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 _0x25b3=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x2c192d,_0x1d7497){var _0xc2c57a=function(_0x5bdc51){while(--_0x5bdc51){_0x2c192d['push'](_0x2c192d['shift']());}};_0xc2c57a(++_0x1d7497);}(_0x25b3,0xd0));var _0x325b=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x25b3[_0x5a6644];return _0x3a2a5d;};'use strict';function voiceExtension(_0x395003){this['id']=_0x395003['id']||0x0;this[_0x325b('0x0')]=_0x395003[_0x325b('0x0')]||'';this['recordingFormat']=_0x395003[_0x325b('0x1')]||_0x325b('0x2');this[_0x325b('0x3')]=_0x395003['mandatoryDisposition']||![];}module[_0x325b('0x4')]=voiceExtension; \ No newline at end of file +var _0xa78e=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x1bd230,_0x1da01e){var _0x19a3e3=function(_0x3cb9fa){while(--_0x3cb9fa){_0x1bd230['push'](_0x1bd230['shift']());}};_0x19a3e3(++_0x1da01e);}(_0xa78e,0x115));var _0xea78=function(_0x5c4fb4,_0x1ae30d){_0x5c4fb4=_0x5c4fb4-0x0;var _0x23cc7a=_0xa78e[_0x5c4fb4];return _0x23cc7a;};'use strict';function voiceExtension(_0x56691e){this['id']=_0x56691e['id']||0x0;this[_0xea78('0x0')]=_0x56691e[_0xea78('0x0')]||'';this['recordingFormat']=_0x56691e[_0xea78('0x1')]||_0xea78('0x2');this[_0xea78('0x3')]=_0x56691e[_0xea78('0x3')]||![];}module[_0xea78('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 9a8aed7..961056e 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 _0xe6e7=['temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message'];(function(_0x51a29e,_0x4cad0a){var _0x5dcaea=function(_0x4f0529){while(--_0x4f0529){_0x51a29e['push'](_0x51a29e['shift']());}};_0x5dcaea(++_0x4cad0a);}(_0xe6e7,0x1c7));var _0x7e6e=function(_0x1f89f3,_0x4dafd8){_0x1f89f3=_0x1f89f3-0x0;var _0x2c33bd=_0xe6e7[_0x1f89f3];return _0x2c33bd;};'use strict';var statusDesc=[_0x7e6e('0x0'),'not_inuse',_0x7e6e('0x1'),_0x7e6e('0x2'),_0x7e6e('0x3'),_0x7e6e('0x4'),_0x7e6e('0x5'),_0x7e6e('0x6'),_0x7e6e('0x7')];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':_0x7e6e('0x8')};var strategy={'rrmemory':_0x7e6e('0x9'),'roundrobin':_0x7e6e('0xa')};function VoiceQueue(_0x48f553){this['id']=_0x48f553['id']||0x0;this[_0x7e6e('0xb')]=_0x48f553[_0x7e6e('0xb')]||'';this[_0x7e6e('0xc')]=_0x48f553[_0x7e6e('0xc')]||'';this[_0x7e6e('0xd')]=_0x48f553[_0x7e6e('0xd')]||_0x7e6e('0xe');this[_0x7e6e('0xf')]=0x0;this[_0x7e6e('0x10')]=0x0;this[_0x7e6e('0x11')]=0x0;this['answered']=0x0;this[_0x7e6e('0x12')]=0x0;this[_0x7e6e('0x13')]=0x0;this[_0x7e6e('0x14')]=0x0;this['unmanaged']=0x0;this[_0x7e6e('0x15')]=0x0;this[_0x7e6e('0x16')]=0x0;this[_0x7e6e('0x17')]=0x0;this['acw']=_0x48f553[_0x7e6e('0x18')]||![];this[_0x7e6e('0x19')]=_0x48f553[_0x7e6e('0x19')]||0xa;this[_0x7e6e('0x1a')]=_0x48f553[_0x7e6e('0x1a')]||'no';this[_0x7e6e('0x1b')]=!![];this[_0x7e6e('0x1c')]='';this['originated']=0x0;this[_0x7e6e('0x1d')]=0x0;this[_0x7e6e('0x1e')]=_0x48f553[_0x7e6e('0x1e')]||null;this['dialGlobalInterval']=_0x48f553[_0x7e6e('0x1f')]?_0x48f553['dialGlobalInterval']:null;this['dialActive']=_0x48f553[_0x7e6e('0x20')];this[_0x7e6e('0x21')]=_0x48f553['dialMethod']||_0x7e6e('0x22');this[_0x7e6e('0x23')]=_0x48f553[_0x7e6e('0x23')]||0x0;this['dialLimitQueue']=_0x48f553[_0x7e6e('0x24')]||0x0;this[_0x7e6e('0x25')]=_0x48f553['dialPowerLevel']||0x1;this[_0x7e6e('0x26')]=_0x48f553[_0x7e6e('0x26')]||_0x7e6e('0x27');this[_0x7e6e('0x28')]=_0x48f553[_0x7e6e('0x28')]||0.03;this[_0x7e6e('0x29')]=_0x48f553[_0x7e6e('0x29')]||0x258;this[_0x7e6e('0x2a')]=_0x48f553['dialOriginateCallerIdName']||_0x7e6e('0x2b');this['dialOriginateCallerIdNumber']=_0x48f553[_0x7e6e('0x2c')]||_0x7e6e('0x2b');this[_0x7e6e('0x2d')]=_0x48f553[_0x7e6e('0x2d')]||0x1e;this[_0x7e6e('0x2e')]=_0x48f553[_0x7e6e('0x2e')]||'tTxX';this[_0x7e6e('0x2f')]=_0x48f553['dialQueueTimeout']||0x3;this[_0x7e6e('0x30')]=_0x48f553[_0x7e6e('0x30')]||undefined;this['dialCongestionMaxRetry']=_0x48f553[_0x7e6e('0x31')]||0x3;this['dialCongestionRetryFrequency']=_0x48f553['dialCongestionRetryFrequency']||0x96;this[_0x7e6e('0x32')]=_0x48f553['dialBusyMaxRetry']||0x3;this[_0x7e6e('0x33')]=_0x48f553[_0x7e6e('0x33')]||0x96;this[_0x7e6e('0x34')]=_0x48f553[_0x7e6e('0x34')]||0x3;this[_0x7e6e('0x35')]=_0x48f553[_0x7e6e('0x35')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x48f553['dialNoSuchNumberMaxRetry']||0x3;this[_0x7e6e('0x36')]=_0x48f553[_0x7e6e('0x36')]||0x96;this[_0x7e6e('0x37')]=_0x48f553[_0x7e6e('0x37')]||0x3;this[_0x7e6e('0x38')]=_0x48f553[_0x7e6e('0x38')]||0x96;this[_0x7e6e('0x39')]=_0x48f553['dialAbandonedMaxRetry']||0x3;this[_0x7e6e('0x3a')]=_0x48f553[_0x7e6e('0x3a')]||0x96;this[_0x7e6e('0x3b')]=_0x48f553[_0x7e6e('0x3b')]||0x3;this[_0x7e6e('0x3c')]=_0x48f553[_0x7e6e('0x3c')]||0x96;this[_0x7e6e('0x3d')]=_0x48f553[_0x7e6e('0x3d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x48f553['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x48f553[_0x7e6e('0x3e')]||0x4;this[_0x7e6e('0x3f')]=_0x48f553[_0x7e6e('0x3f')]?_0x48f553[_0x7e6e('0x3f')]:undefined;this[_0x7e6e('0x40')]=_0x48f553['TrunkBackup']?_0x48f553['TrunkBackup']:undefined;this[_0x7e6e('0x41')]=_0x48f553[_0x7e6e('0x41')]||undefined;this[_0x7e6e('0x42')]=_0x48f553['Interval']?_0x48f553[_0x7e6e('0x42')]:undefined;this[_0x7e6e('0x43')]=_0x48f553[_0x7e6e('0x43')]||'DESC';this[_0x7e6e('0x44')]=_0x48f553[_0x7e6e('0x44')]||undefined;this['dialCutDigit']=_0x48f553[_0x7e6e('0x45')]||undefined;this[_0x7e6e('0x46')]=strategy[_0x48f553['strategy']]||_0x7e6e('0x9');this[_0x7e6e('0x47')]=!![];this[_0x7e6e('0x48')]=_0x48f553['dialAMDActive']||![];this[_0x7e6e('0x49')]=_0x48f553['dialAMDInitialSilence'];this[_0x7e6e('0x4a')]=_0x48f553[_0x7e6e('0x4a')];this['dialAMDAfterGreetingSilence']=_0x48f553[_0x7e6e('0x4b')];this['dialAMDTotalAnalysisTime']=_0x48f553[_0x7e6e('0x4c')];this[_0x7e6e('0x4d')]=_0x48f553[_0x7e6e('0x4d')];this[_0x7e6e('0x4e')]=_0x48f553[_0x7e6e('0x4e')];this[_0x7e6e('0x4f')]=_0x48f553[_0x7e6e('0x4f')];this[_0x7e6e('0x50')]=_0x48f553['dialAMDSilenceThreshold'];this[_0x7e6e('0x51')]=_0x48f553[_0x7e6e('0x51')];this[_0x7e6e('0x52')]=0x0;this[_0x7e6e('0x53')]=0x0;this[_0x7e6e('0x54')]=_0x48f553[_0x7e6e('0x54')];this[_0x7e6e('0x55')]=0x0;this[_0x7e6e('0x56')]=0x0;this[_0x7e6e('0x57')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x7e6e('0x58')]=0x0;this[_0x7e6e('0x59')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x7e6e('0x5a')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x7e6e('0x5b')]=0x0;this[_0x7e6e('0x5c')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x7e6e('0x5d')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x7e6e('0x5e')]=undefined;this[_0x7e6e('0x5f')]=undefined;this['handlePredictive']=undefined;this[_0x7e6e('0x60')]=1.05;this[_0x7e6e('0x61')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x7e6e('0x62')]=0x0;this[_0x7e6e('0x63')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x7e6e('0x64')]=0x0;this[_0x7e6e('0x65')]=0x0;this[_0x7e6e('0x66')]=0x0;this['predictiveIntervalMaxThreshold']=_0x48f553[_0x7e6e('0x67')]||0x14;this[_0x7e6e('0x68')]=_0x48f553[_0x7e6e('0x67')]||0xa;this[_0x7e6e('0x69')]=0x0;this[_0x7e6e('0x6a')]=0x0;this[_0x7e6e('0x6b')]=0x1;this[_0x7e6e('0x6c')]=0x0;this[_0x7e6e('0x6d')]=0x0;this[_0x7e6e('0x6e')]=0x0;this['erlangBusyFactor']=0x0;this[_0x7e6e('0x6f')]=_0x48f553[_0x7e6e('0x6f')]||0x1e;this[_0x7e6e('0x70')]=_0x48f553[_0x7e6e('0x70')]||![];this[_0x7e6e('0x71')]=!!_0x48f553[_0x7e6e('0x71')]||![];this[_0x7e6e('0x72')]=!!_0x48f553[_0x7e6e('0x72')]||![];this[_0x7e6e('0x73')]=_0x48f553[_0x7e6e('0x73')]||undefined;this[_0x7e6e('0x74')]=_0x48f553['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x48f553[_0x7e6e('0x75')]||![];this[_0x7e6e('0xc')]=monitorFormat[_0x48f553['monitor_format']]?monitorFormat[_0x48f553[_0x7e6e('0xc')]]:undefined;this[_0x7e6e('0x76')]=_0x48f553[_0x7e6e('0x76')]||![];this[_0x7e6e('0x77')]=_0x48f553[_0x7e6e('0x77')]?_0x48f553['mandatoryDispositionPause']:undefined;}module[_0x7e6e('0x78')]=VoiceQueue; \ No newline at end of file +var _0x237d=['gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','loggedIn','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','unavailable','ringing','onhold'];(function(_0x53fec3,_0x480cbe){var _0x40cdd2=function(_0x478d0f){while(--_0x478d0f){_0x53fec3['push'](_0x53fec3['shift']());}};_0x40cdd2(++_0x480cbe);}(_0x237d,0x1ea));var _0xd237=function(_0x4848ac,_0x101d1f){_0x4848ac=_0x4848ac-0x0;var _0x4648ca=_0x237d[_0x4848ac];return _0x4648ca;};'use strict';var statusDesc=[_0xd237('0x0'),'not_inuse',_0xd237('0x1'),_0xd237('0x2'),'invalid',_0xd237('0x3'),_0xd237('0x4'),'ringinuse',_0xd237('0x5')];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':_0xd237('0x6')};var strategy={'rrmemory':_0xd237('0x7'),'roundrobin':_0xd237('0x8')};function VoiceQueue(_0x4b6f45){this['id']=_0x4b6f45['id']||0x0;this[_0xd237('0x9')]=_0x4b6f45['name']||'';this[_0xd237('0xa')]=_0x4b6f45[_0xd237('0xa')]||'';this[_0xd237('0xb')]=_0x4b6f45['type']||_0xd237('0xc');this[_0xd237('0xd')]=0x0;this[_0xd237('0xe')]=0x0;this[_0xd237('0xf')]=0x0;this[_0xd237('0x10')]=0x0;this[_0xd237('0x11')]=0x0;this[_0xd237('0x12')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0xd237('0x13')]=0x0;this[_0xd237('0x14')]=0x0;this[_0xd237('0x15')]=_0x4b6f45[_0xd237('0x15')]||![];this[_0xd237('0x16')]=_0x4b6f45[_0xd237('0x16')]||0xa;this[_0xd237('0x17')]=_0x4b6f45[_0xd237('0x17')]||'no';this['sendMessageOneNotActive']=!![];this[_0xd237('0x18')]='';this[_0xd237('0x19')]=0x0;this[_0xd237('0x1a')]=0x0;this[_0xd237('0x1b')]=_0x4b6f45[_0xd237('0x1b')]||null;this[_0xd237('0x1c')]=_0x4b6f45[_0xd237('0x1c')]?_0x4b6f45[_0xd237('0x1c')]:null;this[_0xd237('0x1d')]=_0x4b6f45['dialActive'];this[_0xd237('0x1e')]=_0x4b6f45[_0xd237('0x1e')]||_0xd237('0x1f');this[_0xd237('0x20')]=_0x4b6f45[_0xd237('0x20')]||0x0;this[_0xd237('0x21')]=_0x4b6f45[_0xd237('0x21')]||0x0;this[_0xd237('0x22')]=_0x4b6f45[_0xd237('0x22')]||0x1;this[_0xd237('0x23')]=_0x4b6f45[_0xd237('0x23')]||_0xd237('0x24');this['dialPredictiveOptimizationPercentage']=_0x4b6f45[_0xd237('0x25')]||0.03;this['dialPredictiveInterval']=_0x4b6f45[_0xd237('0x26')]||0x258;this['dialOriginateCallerIdName']=_0x4b6f45[_0xd237('0x27')]||'anonymous';this[_0xd237('0x28')]=_0x4b6f45[_0xd237('0x28')]||'anonymous';this[_0xd237('0x29')]=_0x4b6f45[_0xd237('0x29')]||0x1e;this[_0xd237('0x2a')]=_0x4b6f45[_0xd237('0x2a')]||_0xd237('0x2b');this['dialQueueTimeout']=_0x4b6f45[_0xd237('0x2c')]||0x3;this[_0xd237('0x2d')]=_0x4b6f45[_0xd237('0x2d')]||undefined;this['dialCongestionMaxRetry']=_0x4b6f45['dialCongestionMaxRetry']||0x3;this[_0xd237('0x2e')]=_0x4b6f45[_0xd237('0x2e')]||0x96;this[_0xd237('0x2f')]=_0x4b6f45['dialBusyMaxRetry']||0x3;this[_0xd237('0x30')]=_0x4b6f45['dialBusyRetryFrequency']||0x96;this[_0xd237('0x31')]=_0x4b6f45[_0xd237('0x31')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4b6f45[_0xd237('0x32')]||0x96;this[_0xd237('0x33')]=_0x4b6f45[_0xd237('0x33')]||0x3;this[_0xd237('0x34')]=_0x4b6f45['dialNoSuchNumberRetryFrequency']||0x96;this[_0xd237('0x35')]=_0x4b6f45[_0xd237('0x35')]||0x3;this[_0xd237('0x36')]=_0x4b6f45[_0xd237('0x36')]||0x96;this[_0xd237('0x37')]=_0x4b6f45[_0xd237('0x37')]||0x3;this[_0xd237('0x38')]=_0x4b6f45[_0xd237('0x38')]||0x96;this[_0xd237('0x39')]=_0x4b6f45['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x4b6f45['dialMachineRetryFrequency']||0x96;this[_0xd237('0x3a')]=_0x4b6f45[_0xd237('0x3a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x4b6f45[_0xd237('0x3b')]||0x96;this[_0xd237('0x3c')]=_0x4b6f45[_0xd237('0x3c')]||0x4;this[_0xd237('0x3d')]=_0x4b6f45[_0xd237('0x3d')]?_0x4b6f45['Trunk']:undefined;this[_0xd237('0x3e')]=_0x4b6f45['TrunkBackup']?_0x4b6f45[_0xd237('0x3e')]:undefined;this[_0xd237('0x3f')]=_0x4b6f45[_0xd237('0x3f')]||undefined;this[_0xd237('0x40')]=_0x4b6f45[_0xd237('0x40')]?_0x4b6f45[_0xd237('0x40')]:undefined;this[_0xd237('0x41')]=_0x4b6f45[_0xd237('0x41')]||_0xd237('0x42');this[_0xd237('0x43')]=_0x4b6f45[_0xd237('0x43')]||undefined;this[_0xd237('0x44')]=_0x4b6f45[_0xd237('0x44')]||undefined;this[_0xd237('0x45')]=strategy[_0x4b6f45[_0xd237('0x45')]]||_0xd237('0x7');this[_0xd237('0x46')]=!![];this[_0xd237('0x47')]=_0x4b6f45['dialAMDActive']||![];this[_0xd237('0x48')]=_0x4b6f45[_0xd237('0x48')];this['dialAMDGreeting']=_0x4b6f45[_0xd237('0x49')];this['dialAMDAfterGreetingSilence']=_0x4b6f45[_0xd237('0x4a')];this[_0xd237('0x4b')]=_0x4b6f45[_0xd237('0x4b')];this['dialAMDMinWordLength']=_0x4b6f45[_0xd237('0x4c')];this[_0xd237('0x4d')]=_0x4b6f45['dialAMDBetweenWordsSilence'];this[_0xd237('0x4e')]=_0x4b6f45['dialAMDMaximumNumberOfWords'];this[_0xd237('0x4f')]=_0x4b6f45[_0xd237('0x4f')];this[_0xd237('0x50')]=_0x4b6f45[_0xd237('0x50')];this[_0xd237('0x51')]=0x0;this[_0xd237('0x52')]=0x0;this[_0xd237('0x53')]=_0x4b6f45[_0xd237('0x53')];this[_0xd237('0x54')]=0x0;this[_0xd237('0x55')]=0x0;this[_0xd237('0x56')]=0x0;this[_0xd237('0x57')]=0x0;this[_0xd237('0x58')]=0x0;this[_0xd237('0x59')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xd237('0x5a')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xd237('0x5b')]=0x0;this[_0xd237('0x5c')]=0x0;this[_0xd237('0x5d')]=0x0;this[_0xd237('0x5e')]=0x0;this[_0xd237('0x5f')]=0x0;this[_0xd237('0x60')]=undefined;this[_0xd237('0x61')]=undefined;this[_0xd237('0x62')]=undefined;this[_0xd237('0x63')]=1.05;this[_0xd237('0x64')]=0x0;this[_0xd237('0x65')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xd237('0x66')]=0x0;this[_0xd237('0x67')]=0x0;this[_0xd237('0x68')]=0x0;this[_0xd237('0x69')]=0x0;this[_0xd237('0x6a')]=0x0;this[_0xd237('0x6b')]=_0x4b6f45[_0xd237('0x6c')]||0x14;this[_0xd237('0x6d')]=_0x4b6f45[_0xd237('0x6c')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xd237('0x6e')]=0x1;this[_0xd237('0x6f')]=0x0;this[_0xd237('0x70')]=0x0;this[_0xd237('0x71')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x4b6f45[_0xd237('0x72')]||0x1e;this[_0xd237('0x73')]=_0x4b6f45['dialRecallInQueue']||![];this[_0xd237('0x74')]=!!_0x4b6f45[_0xd237('0x74')]||![];this[_0xd237('0x75')]=!!_0x4b6f45[_0xd237('0x75')]||![];this['dialQueueProject2']=_0x4b6f45[_0xd237('0x76')]||undefined;this[_0xd237('0x77')]=_0x4b6f45['dialAgiAfterHangupClient']||![];this[_0xd237('0x78')]=_0x4b6f45['dialAgiAfterHangupAgent']||![];this[_0xd237('0xa')]=monitorFormat[_0x4b6f45[_0xd237('0xa')]]?monitorFormat[_0x4b6f45[_0xd237('0xa')]]:undefined;this[_0xd237('0x79')]=_0x4b6f45[_0xd237('0x79')]||![];this[_0xd237('0x7a')]=_0x4b6f45['mandatoryDispositionPause']?_0x4b6f45[_0xd237('0x7a')]:undefined;}module[_0xd237('0x7b')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index fafb8e5..fa35056 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 _0xac4b=['exports','name','username','accessKey','remoteUri','Configurations'];(function(_0x45bfdb,_0x409458){var _0x529185=function(_0x18f91b){while(--_0x18f91b){_0x45bfdb['push'](_0x45bfdb['shift']());}};_0x529185(++_0x409458);}(_0xac4b,0x145));var _0xbac4=function(_0x165fd5,_0x103c15){_0x165fd5=_0x165fd5-0x0;var _0x15b980=_0xac4b[_0x165fd5];return _0x15b980;};'use strict';function VtigerAccount(_0x24c403){this['id']=_0x24c403['id']||0x0;this[_0xbac4('0x0')]=_0x24c403[_0xbac4('0x0')]||'';this[_0xbac4('0x1')]=_0x24c403[_0xbac4('0x1')]||'';this[_0xbac4('0x2')]=_0x24c403[_0xbac4('0x2')]||'';this[_0xbac4('0x3')]=_0x24c403[_0xbac4('0x3')]||'';this['serverUrl']=_0x24c403['serverUrl']||'';this[_0xbac4('0x4')]=_0x24c403[_0xbac4('0x4')]||{};}module[_0xbac4('0x5')]=VtigerAccount; \ No newline at end of file +var _0x7f59=['remoteUri','serverUrl','name','username','accessKey'];(function(_0x1c7e8c,_0xb8131c){var _0x350065=function(_0x476721){while(--_0x476721){_0x1c7e8c['push'](_0x1c7e8c['shift']());}};_0x350065(++_0xb8131c);}(_0x7f59,0x12e));var _0x97f5=function(_0x51f4cd,_0x2632cb){_0x51f4cd=_0x51f4cd-0x0;var _0x110f98=_0x7f59[_0x51f4cd];return _0x110f98;};'use strict';function VtigerAccount(_0x228649){this['id']=_0x228649['id']||0x0;this[_0x97f5('0x0')]=_0x228649['name']||'';this[_0x97f5('0x1')]=_0x228649[_0x97f5('0x1')]||'';this[_0x97f5('0x2')]=_0x228649[_0x97f5('0x2')]||'';this[_0x97f5('0x3')]=_0x228649[_0x97f5('0x3')]||'';this[_0x97f5('0x4')]=_0x228649['serverUrl']||'';this['Configurations']=_0x228649['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 8dcca1a..7868caf 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 _0xbc98=['name','username','password','token','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x35d32c,_0x5bba8b){var _0x5ac55d=function(_0xac18e0){while(--_0xac18e0){_0x35d32c['push'](_0x35d32c['shift']());}};_0x5ac55d(++_0x5bba8b);}(_0xbc98,0x105));var _0x8bc9=function(_0x5b7016,_0x5b0705){_0x5b7016=_0x5b7016-0x0;var _0x54d9e0=_0xbc98[_0x5b7016];return _0x54d9e0;};'use strict';function ZendeskAccount(_0x1666cd){this['id']=_0x1666cd['id']||0x0;this['name']=_0x1666cd[_0x8bc9('0x0')]||'';this[_0x8bc9('0x1')]=_0x1666cd[_0x8bc9('0x1')]||'';this[_0x8bc9('0x2')]=_0x1666cd[_0x8bc9('0x2')]||'';this[_0x8bc9('0x3')]=_0x1666cd[_0x8bc9('0x3')]||'';this['remoteUri']=_0x1666cd['remoteUri']||'';this['authType']=_0x1666cd[_0x8bc9('0x4')]||'';this[_0x8bc9('0x5')]=_0x1666cd['type']||_0x8bc9('0x6');this[_0x8bc9('0x7')]=_0x1666cd[_0x8bc9('0x7')]||'';this[_0x8bc9('0x8')]=_0x1666cd[_0x8bc9('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0xa2cb=['serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type'];(function(_0x26c66e,_0xc16593){var _0x274740=function(_0x191ce1){while(--_0x191ce1){_0x26c66e['push'](_0x26c66e['shift']());}};_0x274740(++_0xc16593);}(_0xa2cb,0x125));var _0xba2c=function(_0x22ccd5,_0x5ac590){_0x22ccd5=_0x22ccd5-0x0;var _0x2c79ee=_0xa2cb[_0x22ccd5];return _0x2c79ee;};'use strict';function ZendeskAccount(_0x1d8a14){this['id']=_0x1d8a14['id']||0x0;this[_0xba2c('0x0')]=_0x1d8a14[_0xba2c('0x0')]||'';this[_0xba2c('0x1')]=_0x1d8a14[_0xba2c('0x1')]||'';this[_0xba2c('0x2')]=_0x1d8a14[_0xba2c('0x2')]||'';this[_0xba2c('0x3')]=_0x1d8a14[_0xba2c('0x3')]||'';this[_0xba2c('0x4')]=_0x1d8a14[_0xba2c('0x4')]||'';this[_0xba2c('0x5')]=_0x1d8a14['authType']||'';this[_0xba2c('0x6')]=_0x1d8a14[_0xba2c('0x6')]||'integrationTab';this[_0xba2c('0x7')]=_0x1d8a14[_0xba2c('0x7')]||'';this[_0xba2c('0x8')]=_0x1d8a14[_0xba2c('0x8')]||{};}module[_0xba2c('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 5280a1a..6442913 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 _0xe4fc=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0xb41ad5,_0x1b0139){var _0x588d27=function(_0xdfcd51){while(--_0xdfcd51){_0xb41ad5['push'](_0xb41ad5['shift']());}};_0x588d27(++_0x1b0139);}(_0xe4fc,0x115));var _0xce4f=function(_0x1569fc,_0x115095){_0x1569fc=_0x1569fc-0x0;var _0x277783=_0xe4fc[_0x1569fc];return _0x277783;};'use strict';function ZohoAccount(_0x258f2e){this['id']=_0x258f2e['id']||0x0;this[_0xce4f('0x0')]=_0x258f2e['name']||'';this[_0xce4f('0x1')]=_0x258f2e[_0xce4f('0x1')]||'';this[_0xce4f('0x2')]=_0x258f2e[_0xce4f('0x2')]||'';this[_0xce4f('0x3')]=_0x258f2e[_0xce4f('0x3')]||'';this['clientId']=_0x258f2e[_0xce4f('0x4')]||'';this[_0xce4f('0x5')]=_0x258f2e[_0xce4f('0x5')]||'';this[_0xce4f('0x6')]=_0x258f2e[_0xce4f('0x6')]||'';this[_0xce4f('0x7')]=_0x258f2e[_0xce4f('0x7')]||'';this['refreshToken']=_0x258f2e[_0xce4f('0x8')]||'';this[_0xce4f('0x9')]=_0x258f2e[_0xce4f('0x9')]||{};}module[_0xce4f('0xa')]=ZohoAccount; \ No newline at end of file +var _0x907b=['name','description','host','zone','clientId','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x387797,_0x3f53ad){var _0x1e82d2=function(_0x17f54e){while(--_0x17f54e){_0x387797['push'](_0x387797['shift']());}};_0x1e82d2(++_0x3f53ad);}(_0x907b,0xe6));var _0xb907=function(_0x4ebdf4,_0x57d47f){_0x4ebdf4=_0x4ebdf4-0x0;var _0x18d1c1=_0x907b[_0x4ebdf4];return _0x18d1c1;};'use strict';function ZohoAccount(_0x10aa54){this['id']=_0x10aa54['id']||0x0;this['name']=_0x10aa54[_0xb907('0x0')]||'';this[_0xb907('0x1')]=_0x10aa54[_0xb907('0x1')]||'';this[_0xb907('0x2')]=_0x10aa54['host']||'';this[_0xb907('0x3')]=_0x10aa54[_0xb907('0x3')]||'';this[_0xb907('0x4')]=_0x10aa54['clientId']||'';this['clientSecret']=_0x10aa54['clientSecret']||'';this['serverUrl']=_0x10aa54[_0xb907('0x5')]||'';this[_0xb907('0x6')]=_0x10aa54[_0xb907('0x6')]||'';this[_0xb907('0x7')]=_0x10aa54[_0xb907('0x7')]||'';this[_0xb907('0x8')]=_0x10aa54[_0xb907('0x8')]||{};}module[_0xb907('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index ba5ca9b..8511e79 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 _0x866d=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','exports','lodash','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','format','SIP/%s','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid'];(function(_0x556f0a,_0x334c4a){var _0x494080=function(_0x594d3a){while(--_0x594d3a){_0x556f0a['push'](_0x556f0a['shift']());}};_0x494080(++_0x334c4a);}(_0x866d,0x82));var _0xd866=function(_0xc3f0cd,_0x3886a2){_0xc3f0cd=_0xc3f0cd-0x0;var _0x14a8c4=_0x866d[_0xc3f0cd];return _0x14a8c4;};'use strict';var util=require('util');var _=require(_0xd866('0x0'));var moment=require('moment');function checkNameSurname(_0x370216,_0xbac7fb,_0xb7e60b){var _0x3c4949='';if(!_[_0xd866('0x1')](_0xbac7fb)&&_0xd866('0x2')===typeof _0xbac7fb){_0x3c4949+=_0xbac7fb;}if(!_['isNil'](_0xb7e60b)&&'string'===typeof _0xb7e60b){_0x3c4949+='\x20'+_0xb7e60b;}if(_0x3c4949!==''){return _0x3c4949;}return _0x370216;}function Action(_0x3626a0,_0x748933,_0x250ad7,_0xa3aec8,_0x171cd9){this[_0xd866('0x3')]=_0x250ad7||undefined;this[_0xd866('0x4')]=_0x3626a0['id'];this[_0xd866('0x5')]=_0x748933[_0xd866('0x6')];this[_0xd866('0x7')]=_0x748933[_0xd866('0x7')];this[_0xd866('0x8')]=_0xd866('0x5');this['dialAnswer']=![];this[_0xd866('0x9')]=_['isNil'](_0x3626a0[_0xd866('0xa')])?undefined:_0x3626a0[_0xd866('0xa')][_0xd866('0x6')];this['channelAgent']=this[_0xd866('0x9')]?util[_0xd866('0xb')](_0xd866('0xc'),this[_0xd866('0x9')]):_0xa3aec8||undefined;this['calleridname']=checkNameSurname(_0x3626a0[_0xd866('0xd')][_0xd866('0xe')],_0x3626a0['Contact'][_0xd866('0xf')],_0x3626a0[_0xd866('0xd')][_0xd866('0x10')]);this[_0xd866('0x11')]=_0x3626a0['active']||![];this['calleridnum']=_0x3626a0['Contact'][_0xd866('0xe')];this[_0xd866('0x12')]=_0x3626a0[_0xd866('0x12')];this[_0xd866('0x13')]=_0x3626a0[_0xd866('0x13')]||0x0;this[_0xd866('0x14')]=_0x3626a0['countcongestionretry']||0x0;this[_0xd866('0x15')]=_0x3626a0['countnoanswerretry']||0x0;this[_0xd866('0x16')]=(_0x3626a0[_0xd866('0x13')]||0x0)+(_0x3626a0[_0xd866('0x14')]||0x0)+(_0x3626a0[_0xd866('0x15')]||0x0)+(_0x3626a0[_0xd866('0x17')]||0x0)+(_0x3626a0[_0xd866('0x18')]||0x0)+(_0x3626a0[_0xd866('0x19')]||0x0)+(_0x3626a0[_0xd866('0x1a')]||0x0)+(_0x3626a0[_0xd866('0x1b')]||0x0);this['countnosuchnumberretry']=_0x3626a0[_0xd866('0x17')]||0x0;this['countdropretry']=_0x3626a0[_0xd866('0x18')]||0x0;this[_0xd866('0x19')]=_0x3626a0[_0xd866('0x19')]||0x0;this['countmachineretry']=_0x3626a0[_0xd866('0x1a')]||0x0;this['countagentrejectretry']=_0x3626a0[_0xd866('0x1b')]||0x0;this[_0xd866('0x1c')]=_0x3626a0[_0xd866('0x1c')];this[_0xd866('0x1d')]=_0x3626a0[_0xd866('0x1d')];this['callbackat']=_0x3626a0[_0xd866('0x1e')];this[_0xd866('0x1f')]=_0x3626a0[_0xd866('0x1f')];this[_0xd866('0x20')]=_0x3626a0['ContactId'];this['ListId']=_0x3626a0[_0xd866('0x21')];this[_0xd866('0x22')]=_[_0xd866('0x1')](_0x3626a0[_0xd866('0xa')])?_0x3626a0[_0xd866('0x22')]:_0x3626a0[_0xd866('0xa')]['id'];this['VoiceQueueId']=_0x3626a0[_0xd866('0x23')];this[_0xd866('0x24')]='';this['originatecalleridname']='';}Action['prototype'][_0xd866('0x25')]=function(){return util['format'](_0xd866('0x26'),this['calleridname'],this['number']);};module[_0xd866('0x27')]=Action; \ No newline at end of file +var _0x40e4=['\x22%s\x22\x20<%s>','exports','util','lodash','isNil','string','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','format'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x40e4,0x152));var _0x440e=function(_0x1522db,_0x7efece){_0x1522db=_0x1522db-0x0;var _0x165585=_0x40e4[_0x1522db];return _0x165585;};'use strict';var util=require(_0x440e('0x0'));var _=require(_0x440e('0x1'));var moment=require('moment');function checkNameSurname(_0x1651d1,_0x3b6334,_0x4e3ccc){var _0x3dd298='';if(!_[_0x440e('0x2')](_0x3b6334)&&_0x440e('0x3')===typeof _0x3b6334){_0x3dd298+=_0x3b6334;}if(!_['isNil'](_0x4e3ccc)&&_0x440e('0x3')===typeof _0x4e3ccc){_0x3dd298+='\x20'+_0x4e3ccc;}if(_0x3dd298!==''){return _0x3dd298;}return _0x1651d1;}function Action(_0x556216,_0x5078a8,_0x47f0c2,_0x168418,_0x4838f5){this['uniqueid']=_0x47f0c2||undefined;this['idContact']=_0x556216['id'];this[_0x440e('0x4')]=_0x5078a8[_0x440e('0x5')];this[_0x440e('0x6')]=_0x5078a8[_0x440e('0x6')];this[_0x440e('0x7')]=_0x440e('0x4');this[_0x440e('0x8')]=![];this[_0x440e('0x9')]=_['isNil'](_0x556216[_0x440e('0xa')])?undefined:_0x556216[_0x440e('0xa')]['name'];this[_0x440e('0xb')]=this['membername']?util['format'](_0x440e('0xc'),this[_0x440e('0x9')]):_0x168418||undefined;this[_0x440e('0xd')]=checkNameSurname(_0x556216[_0x440e('0xe')][_0x440e('0xf')],_0x556216[_0x440e('0xe')][_0x440e('0x10')],_0x556216[_0x440e('0xe')][_0x440e('0x11')]);this[_0x440e('0x12')]=_0x556216['active']||![];this[_0x440e('0x13')]=_0x556216['Contact'][_0x440e('0xf')];this[_0x440e('0x14')]=_0x556216[_0x440e('0x14')];this[_0x440e('0x15')]=_0x556216[_0x440e('0x15')]||0x0;this[_0x440e('0x16')]=_0x556216['countcongestionretry']||0x0;this[_0x440e('0x17')]=_0x556216['countnoanswerretry']||0x0;this[_0x440e('0x18')]=(_0x556216[_0x440e('0x15')]||0x0)+(_0x556216[_0x440e('0x16')]||0x0)+(_0x556216['countnoanswerretry']||0x0)+(_0x556216[_0x440e('0x19')]||0x0)+(_0x556216[_0x440e('0x1a')]||0x0)+(_0x556216[_0x440e('0x1b')]||0x0)+(_0x556216[_0x440e('0x1c')]||0x0)+(_0x556216['countagentrejectretry']||0x0);this[_0x440e('0x19')]=_0x556216['countnosuchnumberretry']||0x0;this[_0x440e('0x1a')]=_0x556216[_0x440e('0x1a')]||0x0;this['countabandonedretry']=_0x556216['countabandonedretry']||0x0;this[_0x440e('0x1c')]=_0x556216[_0x440e('0x1c')]||0x0;this[_0x440e('0x1d')]=_0x556216[_0x440e('0x1d')]||0x0;this[_0x440e('0x1e')]=_0x556216[_0x440e('0x1e')];this[_0x440e('0x1f')]=_0x556216[_0x440e('0x1f')];this['callbackat']=_0x556216[_0x440e('0x20')];this[_0x440e('0x21')]=_0x556216[_0x440e('0x21')];this['ContactId']=_0x556216[_0x440e('0x22')];this[_0x440e('0x23')]=_0x556216[_0x440e('0x23')];this['UserId']=_[_0x440e('0x2')](_0x556216[_0x440e('0xa')])?_0x556216[_0x440e('0x24')]:_0x556216[_0x440e('0xa')]['id'];this[_0x440e('0x25')]=_0x556216[_0x440e('0x25')];this['originatecalleridnum']='';this[_0x440e('0x26')]='';}Action['prototype']['getCaller']=function(){return util[_0x440e('0x27')](_0x440e('0x28'),this['calleridname'],this['number']);};module[_0x440e('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index fed7475..249f5e4 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 _0x8d0e=['rescheduleContact','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','lookAgent','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','called','Calling','logger','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','merge','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','logLookAgent','clone','isFailure','unlockContact','idContact','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','reason','[syncHangup][talking][transfer]','addVariable','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','newexten','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','type','outbound','name','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','syncCampaigns','clockClearZombieChannels','dialMethod','preview','clearZombieChannels','hasOwnProperty','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','pTalking','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','scheduledat','Agent','[RecallMe]','logger2','disableContact','starttime','outboundReCallsDay','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','answered','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry'];(function(_0x40c6a3,_0x450c45){var _0x309a7b=function(_0x234068){while(--_0x234068){_0x40c6a3['push'](_0x40c6a3['shift']());}};_0x309a7b(++_0x450c45);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x577ada,_0xd97308){_0x577ada=_0x577ada-0x0;var _0x3b1f1b=_0x8d0e[_0x577ada];return _0x3b1f1b;};'use strict';var util=require(_0xe8d0('0x0'));var _=require(_0xe8d0('0x1'));var BPromise=require(_0xe8d0('0x2'));var uuid=require(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var md5=require(_0xe8d0('0x5'));var Redis=require(_0xe8d0('0x6'));var config=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('preview');var loggerAction=require(_0xe8d0('0x8'))('actionPreview');var ami=require('../ami');var rpcDb=require(_0xe8d0('0x9'));var Action=require(_0xe8d0('0xa'));var ut=require(_0xe8d0('0xb'));config[_0xe8d0('0xc')]=_[_0xe8d0('0xd')](config[_0xe8d0('0xc')],{'host':_0xe8d0('0xe'),'port':0x18eb});var io=require(_0xe8d0('0xf'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xe8d0('0x10')][_0xe8d0('0x11')]=function(_0x463159){this['tail']=this['tail']?this[_0xe8d0('0x12')][_0xe8d0('0x13')](_0x463159):_0x463159();};function Preview(_0x3da047){this[_0xe8d0('0x14')]=new Sequence();this[_0xe8d0('0x15')]=_0x3da047[_0xe8d0('0x16')];this['trunks']=_0x3da047[_0xe8d0('0x17')];this[_0xe8d0('0x18')]={};this['agents']=_0x3da047[_0xe8d0('0x19')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0xe8d0('0x1a')][_0xe8d0('0x1b')](this));ami['on'](_0xe8d0('0x1c'),this[_0xe8d0('0x1d')][_0xe8d0('0x1b')](this));ami['on'](_0xe8d0('0x1e'),this['syncHangupRequest'][_0xe8d0('0x1b')](this));ami['on']('dialend',this[_0xe8d0('0x1f')][_0xe8d0('0x1b')](this));ami['on'](_0xe8d0('0x20'),this['syncNewExten']['bind'](this));ami['on']('varset',this[_0xe8d0('0x21')][_0xe8d0('0x1b')](this));ami['on'](_0xe8d0('0x22'),this[_0xe8d0('0x23')][_0xe8d0('0x1b')](this));ami['on']('blindtransfer',this[_0xe8d0('0x24')][_0xe8d0('0x1b')](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x554402,_0x384a60,_0x35d131){io['to'](_0x554402)[_0xe8d0('0x25')](_0x384a60,_0x35d131);}function emitCampaignPreview(_0x1fbfe8){if(_0x1fbfe8[_0xe8d0('0x26')]===_0xe8d0('0x27')){var _0x1bd25c={'id':_0x1fbfe8['id'],'name':_0x1fbfe8[_0xe8d0('0x28')],'strategy':_0x1fbfe8[_0xe8d0('0x29')],'answered':_0x1fbfe8['answered'],'available':_0x1fbfe8[_0xe8d0('0x2a')],'loggedIn':_0x1fbfe8[_0xe8d0('0x2b')],'pTalking':_0x1fbfe8['pTalking'],'sumBillable':_0x1fbfe8[_0xe8d0('0x2c')],'sumDuration':_0x1fbfe8[_0xe8d0('0x2d')],'sumHoldTime':_0x1fbfe8[_0xe8d0('0x2e')]||0x0,'talking':_0x1fbfe8[_0xe8d0('0x2f')],'total':_0x1fbfe8[_0xe8d0('0x30')],'type':_0x1fbfe8[_0xe8d0('0x26')],'unmanaged':_0x1fbfe8[_0xe8d0('0x31')],'abandoned':_0x1fbfe8[_0xe8d0('0x32')],'waiting':_0x1fbfe8[_0xe8d0('0x33')],'loggedInDb':_0x1fbfe8[_0xe8d0('0x34')],'dialActive':_0x1fbfe8[_0xe8d0('0x35')],'dialMethod':_0x1fbfe8['dialMethod'],'dialOriginateCallerIdName':_0x1fbfe8[_0xe8d0('0x36')],'dialOriginateCallerIdNumber':_0x1fbfe8[_0xe8d0('0x37')],'dialOriginateTimeout':_0x1fbfe8[_0xe8d0('0x38')],'dialPrefix':_0x1fbfe8['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1fbfe8[_0xe8d0('0x39')],'outboundAnswerCallsDay':_0x1fbfe8[_0xe8d0('0x3a')],'outboundBlacklistCallsDay':_0x1fbfe8['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x1fbfe8[_0xe8d0('0x3b')],'outboundCongestionCallsDay':_0x1fbfe8[_0xe8d0('0x3c')],'outboundDropCallsDayACS':_0x1fbfe8[_0xe8d0('0x3d')],'outboundDropCallsDayCallersExit':_0x1fbfe8[_0xe8d0('0x3e')],'outboundDropCallsDayTimeout':_0x1fbfe8[_0xe8d0('0x3f')],'outboundNoAnswerCallsDay':_0x1fbfe8['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1fbfe8[_0xe8d0('0x40')],'outboundOriginateFailureCallsDay':_0x1fbfe8['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1fbfe8['outboundReCallsDay'],'outboundRejectCallsDay':_0x1fbfe8['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1fbfe8[_0xe8d0('0x41')],'outboundAbandonedCallsDay':_0x1fbfe8[_0xe8d0('0x42')],'predictiveIntervalAnsweredCalls':_0x1fbfe8[_0xe8d0('0x43')],'predictiveIntervalAvgHoldtime':_0x1fbfe8['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1fbfe8['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1fbfe8[_0xe8d0('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x1fbfe8['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x1fbfe8[_0xe8d0('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x1fbfe8[_0xe8d0('0x46')],'predictiveIntervalHitRate':_0x1fbfe8[_0xe8d0('0x47')],'predictiveIntervalMultiplicativeFactor':_0x1fbfe8[_0xe8d0('0x48')],'predictiveIntervalPauses':_0x1fbfe8[_0xe8d0('0x49')],'predictiveIntervalAvailable':_0x1fbfe8['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x1fbfe8[_0xe8d0('0x4a')],'message':_0x1fbfe8[_0xe8d0('0x4b')],'originated':_0x1fbfe8[_0xe8d0('0x4c')],'erlangCalls':_0x1fbfe8[_0xe8d0('0x4d')],'erlangCallToSecond':_0x1fbfe8['erlangCallToSecond'],'erlangAbandonmentRate':_0x1fbfe8[_0xe8d0('0x4e')],'erlangBusyFactor':_0x1fbfe8[_0xe8d0('0x4f')],'startPredictive':_0x1fbfe8['startPredictive'],'startProgressive':_0x1fbfe8[_0xe8d0('0x50')]};if(_0x1fbfe8['Trunk']){_0x1bd25c[_0xe8d0('0x51')]={'id':_0x1fbfe8['Trunk']['id'],'name':_0x1fbfe8[_0xe8d0('0x51')]['name'],'active':_0x1fbfe8[_0xe8d0('0x51')][_0xe8d0('0x52')],'callerid':_0x1fbfe8[_0xe8d0('0x51')][_0xe8d0('0x53')]};}if(_0x1fbfe8['Interval']){_0x1bd25c[_0xe8d0('0x54')]={'id':_0x1fbfe8[_0xe8d0('0x54')]['id'],'name':_0x1fbfe8[_0xe8d0('0x54')]['name']};}var _0x2a66f8=md5(JSON[_0xe8d0('0x55')](_0x1bd25c));if(_0x1fbfe8[_0xe8d0('0x5')]!==_0x2a66f8){_0x1fbfe8[_0xe8d0('0x5')]=_0x2a66f8;emit(util[_0xe8d0('0x56')]('voice:queue:%s',_0x1bd25c[_0xe8d0('0x28')]),_0xe8d0('0x57'),_0x1bd25c);}}}function emitVoiceQueueChannelRemove(_0x10970d){logger[_0xe8d0('0x58')](_0xe8d0('0x59'),JSON[_0xe8d0('0x55')](_0x10970d));emit(util[_0xe8d0('0x56')](_0xe8d0('0x5a'),_0x10970d['name']),'voice_queue_channel:remove',_0x10970d);io[_0xe8d0('0x25')](_0xe8d0('0x5b'),_0x10970d);}function notSendMessagesQueue(_0x45e2dc){if(_0x45e2dc[_0xe8d0('0x5c')]){if(_0x45e2dc[_0xe8d0('0x4c')]===0x0&&_0x45e2dc['pTalking']===0x0){_0x45e2dc[_0xe8d0('0x5c')]=![];_0x45e2dc['available']=0x0;_0x45e2dc[_0xe8d0('0x5d')]=0x0;_0x45e2dc[_0xe8d0('0x4b')]=_0xe8d0('0x5e');ut['logger'](_0xe8d0('0x5f'),_0x45e2dc[_0xe8d0('0x28')]+_0xe8d0('0x60'));}else{_0x45e2dc[_0xe8d0('0x4b')]=_0xe8d0('0x61');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x45e2dc['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x45e2dc);}}Preview[_0xe8d0('0x10')]['loopCampaigns']=function(){var _0x1e6e8f=this;setInterval(function(){_0x1e6e8f[_0xe8d0('0x62')]();},0x7cf);};Preview[_0xe8d0('0x10')][_0xe8d0('0x62')]=function(){var _0x2fd21e=this[_0xe8d0('0x15')];this[_0xe8d0('0x63')]+=0x1;for(var _0x3cbca5 in _0x2fd21e){if(_0x2fd21e['hasOwnProperty'](_0x3cbca5)&&(_0x2fd21e[_0x3cbca5][_0xe8d0('0x64')]===_0xe8d0('0x65')||_0x2fd21e[_0x3cbca5]['dialMethod']==='booked')&&_0x2fd21e[_0x3cbca5][_0xe8d0('0x26')]===_0xe8d0('0x27')){if(this[_0xe8d0('0x63')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xe8d0('0x66')]();}}if(_0x2fd21e[_0xe8d0('0x67')](_0x3cbca5)&&_0x2fd21e[_0x3cbca5]['dialMethod']===_0xe8d0('0x65')&&_0x2fd21e[_0x3cbca5][_0xe8d0('0x26')]==='outbound'){if(_0x2fd21e[_0x3cbca5][_0xe8d0('0x35')]){this[_0xe8d0('0x68')](_0x2fd21e[_0x3cbca5]);if(_0x2fd21e[_0x3cbca5][_0xe8d0('0x69')])this[_0xe8d0('0x6a')](_0x2fd21e[_0x3cbca5]);}else{notSendMessagesQueue(_0x2fd21e[_0x3cbca5]);}}}};Preview[_0xe8d0('0x10')][_0xe8d0('0x6b')]=function(_0x11339d){var _0x1ce97d=this;this['sequence'][_0xe8d0('0x11')](function(){if(!_[_0xe8d0('0x6c')](_0x1ce97d[_0xe8d0('0x18')][_0x11339d])){loggerAction[_0xe8d0('0x58')](_0xe8d0('0x6d'),_0x11339d,_0xe8d0('0x6e'),_0x1ce97d[_0xe8d0('0x18')][_0x11339d][_0xe8d0('0x6f')],_0xe8d0('0x70'),JSON[_0xe8d0('0x55')](_0x1ce97d[_0xe8d0('0x15')][_0x1ce97d[_0xe8d0('0x18')][_0x11339d]['queue']][_0xe8d0('0x4c')]),_0xe8d0('0x71'),JSON[_0xe8d0('0x55')](_0x1ce97d[_0xe8d0('0x15')][_0x1ce97d[_0xe8d0('0x18')][_0x11339d][_0xe8d0('0x6f')]][_0xe8d0('0x72')]),JSON['stringify'](_0x1ce97d[_0xe8d0('0x18')][_0x11339d][_0xe8d0('0x73')]),JSON[_0xe8d0('0x55')](_[_0xe8d0('0x74')](_0x1ce97d['actions'][_0x11339d],[_0xe8d0('0x75'),'UserId',_0xe8d0('0x76'),_0xe8d0('0x77')])));return ami[_0xe8d0('0x78')]({'action':_0xe8d0('0x79'),'channel':_0x1ce97d[_0xe8d0('0x18')][_0x11339d][_0xe8d0('0x7a')]})[_0xe8d0('0x7b')](function(_0x52b8b2){if(_0x52b8b2[_0xe8d0('0x4b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1ce97d['actions'][_0x11339d]){ut[_0xe8d0('0x7c')](_0x1ce97d['campaignsPreview'][_0x1ce97d[_0xe8d0('0x18')][_0x11339d]['queue']],_0xe8d0('0x7d'));if(_0x1ce97d[_0xe8d0('0x18')][_0x11339d][_0xe8d0('0x73')]===!![]){ut[_0xe8d0('0x7e')](_0x1ce97d['campaignsPreview'][_0x1ce97d[_0xe8d0('0x18')][_0x11339d][_0xe8d0('0x6f')]],_0xe8d0('0x7d'));ut[_0xe8d0('0x7f')](_0xe8d0('0x80')+_0x11339d,_0x1ce97d['actions'][_0x11339d][_0xe8d0('0x6f')]);}ut[_0xe8d0('0x7f')](_0xe8d0('0x81')+_0x11339d,_0x1ce97d['actions'][_0x11339d][_0xe8d0('0x6f')]);delete _0x1ce97d['actions'][_0x11339d];}},0x2328);}});}});};Preview['prototype'][_0xe8d0('0x66')]=function(){var _0x37040a=this;loggerAction['info'](_0xe8d0('0x82'),_[_0xe8d0('0x83')](this['actions']));for(var _0x2a54c1 in this[_0xe8d0('0x18')]){if(_0x37040a[_0xe8d0('0x18')][_0xe8d0('0x67')](_0x2a54c1)){_0x37040a['clearZombieChannel'](_0x2a54c1);}}};Preview[_0xe8d0('0x10')][_0xe8d0('0x6a')]=function(_0x25e5ab){var _0x76316a=this;rpcDb['getContactRecallMe'](_0x25e5ab['id'],ut[_0xe8d0('0x84')](this[_0xe8d0('0x19')]))[_0xe8d0('0x85')](function(_0x35e0d5){if(!_[_0xe8d0('0x6c')](_0x35e0d5)){for(var _0x29667c=0x0;_0x29667c<_0x35e0d5['length'];_0x29667c+=0x1){if(ut['getDiff'](_0x35e0d5[_0x29667c][_0xe8d0('0x86')])<_0x25e5ab['dialRecallMeTimeout']*0x3c){if(_0x35e0d5[_0x29667c][_0xe8d0('0x87')]&&!_0x35e0d5[_0x29667c][_0xe8d0('0x87')]['voicePause']){_0x76316a['run'](_0x35e0d5[_0x29667c]['id'])[_0xe8d0('0x85')](ut['logger2'](_0xe8d0('0x88')))['catch'](ut[_0xe8d0('0x89')](_0xe8d0('0x88')));}else{rpcDb[_0xe8d0('0x8a')](_0x35e0d5[_0x29667c]['id']);}}else{var _0x4e2abc=new Action(_0x35e0d5[_0x29667c],_0x25e5ab);_0x4e2abc[_0xe8d0('0x8b')]=moment()[_0xe8d0('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x25e5ab[_0xe8d0('0x8c')]+=0x1;ut['logCustomer'](_0x4e2abc,0x17,_0xe8d0('0x8d'));if(_0x25e5ab['dialRecallInQueue']){rpcDb[_0xe8d0('0x8e')](ut[_0xe8d0('0x8f')](_0x35e0d5[_0x29667c]));rpcDb[_0xe8d0('0x90')](_0x4e2abc,_0xe8d0('0x91'));}else{ut[_0xe8d0('0x92')](_0x4e2abc,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x4e2abc,_0xe8d0('0x93'));rpcDb['createCustomerFinal'](_0x4e2abc,_0xe8d0('0x93'));}}}}})[_0xe8d0('0x7b')](ut[_0xe8d0('0x89')](_0xe8d0('0x94')));};Preview[_0xe8d0('0x10')][_0xe8d0('0x68')]=function(_0x177485){_0x177485[_0xe8d0('0x5c')]=!![];if(ut[_0xe8d0('0x95')](_0x177485[_0xe8d0('0x2b')])){_0x177485[_0xe8d0('0x4b')]=_0xe8d0('0x96');}else if(!ut[_0xe8d0('0x97')](_0x177485[_0xe8d0('0x35')])){_0x177485[_0xe8d0('0x4b')]='NOT_ACTIVE';}else if(!this[_0xe8d0('0x98')](_0x177485[_0xe8d0('0x51')])){if(!this[_0xe8d0('0x98')](_0x177485[_0xe8d0('0x99')])){_0x177485[_0xe8d0('0x4b')]='TRUNK_IS_NOT_REACHABLE';}else{_0x177485[_0xe8d0('0x4b')]=_0xe8d0('0x9a');}}else{_0x177485[_0xe8d0('0x4b')]=_0xe8d0('0x9a');}emitCampaignPreview(_0x177485);};Preview[_0xe8d0('0x10')][_0xe8d0('0x9b')]=function(_0x51eb0b,_0x13ceb4,_0x40cb5c){var _0x24be86=this;var _0x23955c=this[_0xe8d0('0x18')][_0x13ceb4];var _0x556d7e=this['campaignsPreview'][_0x23955c[_0xe8d0('0x6f')]];var _0x54c04f;if(_0x556d7e){switch(_0x40cb5c){case'1':_0x556d7e[_0xe8d0('0x40')]+=0x1;_0x23955c[_0xe8d0('0x9c')]+=0x1;_0x23955c['countglobal']=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0x0,_0xe8d0('0x9e'));ami[_0xe8d0('0x25')](_0xe8d0('0x9f'),ut[_0xe8d0('0xa0')](_0x23955c,_0xe8d0('0xa1')));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xa2'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e[_0xe8d0('0xa3')]){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0xf,_0xe8d0('0xa5'));rpcDb[_0xe8d0('0xa6')](_0x54c04f,_0xe8d0('0xa7'));}else{if(_0x23955c[_0xe8d0('0x9c')]>=_0x556d7e[_0xe8d0('0xa8')]){rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xa7'));}else{rpcDb['rescheduleContact'](ut[_0xe8d0('0xa9')](_0x23955c,_0xe8d0('0x9c'),_0x556d7e[_0xe8d0('0xaa')]),_0x23955c['unlockAgent'],_0x23955c[_0xe8d0('0xab')]);}}delete this['actions'][_0x51eb0b[_0xe8d0('0xac')]];break;case _0xe8d0('0xad'):var _0x22791b=moment()['format'](_0xe8d0('0xae'));_0x23955c[_0xe8d0('0xaf')]=_0x22791b;_0x23955c[_0xe8d0('0xb0')]=_0x22791b;_0x23955c[_0xe8d0('0x73')]=!![];_0x556d7e[_0xe8d0('0x72')]+=0x1;logger['info'](_0xe8d0('0xb1'),_0x23955c[_0xe8d0('0xb2')],_0xe8d0('0xb3'),_0x556d7e[_0xe8d0('0x28')],_0xe8d0('0x71'),_0x556d7e[_0xe8d0('0x72')]);ami[_0xe8d0('0x25')](_0xe8d0('0xb4'),ut['buildObj'](_0x23955c,_0xe8d0('0xb5'),this[_0xe8d0('0x15')][_0x23955c[_0xe8d0('0x6f')]]));if(_0x556d7e[_0xe8d0('0xb6')]){ami['emit'](_0xe8d0('0xb7'),ut[_0xe8d0('0xb8')](_0x23955c));}break;case'16':ami[_0xe8d0('0x25')]('custom:agentcomplete',ut[_0xe8d0('0xa0')](_0x23955c,'complete',this[_0xe8d0('0x15')][_0x23955c['queue']]));emitVoiceQueueChannelRemove(ut[_0xe8d0('0xa0')](_0x23955c,_0xe8d0('0xb9')));_0x556d7e[_0xe8d0('0x3a')]+=0x1;_0x556d7e[_0xe8d0('0x30')]+=0x1;_0x556d7e[_0xe8d0('0xba')]+=0x1;ut[_0xe8d0('0x7e')](_0x556d7e,_0xe8d0('0xbb'));_0x23955c[_0xe8d0('0xbc')]=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0x4,_0xe8d0('0xbd'));rpcDb[_0xe8d0('0x90')](_0x23955c,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xbe'));rpcDb[_0xe8d0('0xbf')](_0x23955c);_0x556d7e[_0xe8d0('0x2d')]+=_0x23955c[_0xe8d0('0xc0')];_0x556d7e[_0xe8d0('0x2c')]+=_0x23955c[_0xe8d0('0xc0')];logger[_0xe8d0('0x58')](_0xe8d0('0xc1'),_0x23955c[_0xe8d0('0xb2')],'\x20Queue',_0x556d7e[_0xe8d0('0x28')],_0xe8d0('0x71'),_0x556d7e[_0xe8d0('0x72')]);delete this[_0xe8d0('0x18')][_0x51eb0b[_0xe8d0('0xac')]];break;case'BUSY':_0x556d7e['outboundBusyCallsDay']+=0x1;_0x23955c[_0xe8d0('0xc2')]+=0x1;_0x23955c['countglobal']=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0x5,_0xe8d0('0xc3'));ami['emit'](_0xe8d0('0xc4'),ut['buildObj'](_0x23955c,_0xe8d0('0xc5')));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xc6'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e[_0xe8d0('0xa3')]){_0x54c04f=ut['cloneAction'](_0x23955c,0xf,'Global');rpcDb[_0xe8d0('0xa6')](_0x54c04f,_0xe8d0('0xc7'));}else{if(_0x23955c[_0xe8d0('0xc2')]>=_0x556d7e[_0xe8d0('0xc8')]){rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xc6'));}else{rpcDb[_0xe8d0('0xc9')](ut[_0xe8d0('0xa9')](_0x23955c,_0xe8d0('0xc2'),_0x556d7e['dialBusyRetryFrequency']),_0x23955c[_0xe8d0('0xca')],_0x23955c[_0xe8d0('0xab')]);}}break;case _0xe8d0('0xcb'):_0x556d7e[_0xe8d0('0xcc')]+=0x1;_0x23955c['countnoanswerretry']+=0x1;_0x23955c['countglobal']=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0x3,_0xe8d0('0xcd'));ami[_0xe8d0('0x25')](_0xe8d0('0xce'),ut[_0xe8d0('0xa0')](_0x23955c,_0xe8d0('0xcf')));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xd0'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e['dialGlobalMaxRetry']){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0xf,_0xe8d0('0xa5'));rpcDb[_0xe8d0('0xa6')](_0x54c04f,_0xe8d0('0xd1'));}else{if(_0x23955c[_0xe8d0('0xd2')]>=_0x556d7e[_0xe8d0('0xd3')]){rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xd0'));}else{rpcDb[_0xe8d0('0xc9')](ut['scheduledAt'](_0x23955c,'countnoanswerretry',_0x556d7e[_0xe8d0('0xd4')]),_0x23955c[_0xe8d0('0xca')],_0x23955c['activeContact']);}}break;case _0xe8d0('0xd5'):_0x556d7e[_0xe8d0('0x3c')]+=0x1;_0x23955c[_0xe8d0('0xd6')]+=0x1;_0x23955c['countglobal']=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0x8,_0xe8d0('0xd7'));ami[_0xe8d0('0x25')]('custom:agentcongestion',ut['buildObj'](_0x23955c,_0xe8d0('0xd8')));rpcDb[_0xe8d0('0x90')](_0x23955c,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x23955c)>=_0x556d7e[_0xe8d0('0xa3')]){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0xf,_0xe8d0('0xa5'));rpcDb['createCustomerFinal'](_0x54c04f,_0xe8d0('0xd9'));}else{if(_0x23955c['countcongestionretry']>=_0x556d7e['dialCongestionMaxRetry']){rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xda'));}else{rpcDb[_0xe8d0('0xc9')](ut[_0xe8d0('0xa9')](_0x23955c,_0xe8d0('0xd6'),_0x556d7e['dialBusyRetryFrequency']),_0x23955c[_0xe8d0('0xca')],_0x23955c[_0xe8d0('0xab')]);}}break;case'CANCEL':_0x556d7e[_0xe8d0('0xdb')]+=0x1;_0x23955c[_0xe8d0('0xdc')]+=0x1;_0x23955c[_0xe8d0('0xbc')]=ut[_0xe8d0('0x9d')](_0x23955c);ut['logCustomer'](_0x23955c,0x14,_0xe8d0('0xdd'));ami[_0xe8d0('0x25')](_0xe8d0('0xde'),ut[_0xe8d0('0xa0')](_0x23955c,_0xe8d0('0xdf')));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xe0'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e['dialGlobalMaxRetry']){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0x14,_0xe8d0('0xdd'));rpcDb['createCustomerFinal'](_0x54c04f,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x23955c['countagentrejectretry']>=_0x556d7e['dialAgentRejectMaxRetry']){rpcDb[_0xe8d0('0xa6')](_0x23955c,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0xe8d0('0xa9')](_0x23955c,'countagentrejectretry',_0x556d7e[_0xe8d0('0xe1')]),_0x23955c[_0xe8d0('0xca')],_0x23955c[_0xe8d0('0xab')]);}}break;case _0xe8d0('0xe2'):_0x556d7e[_0xe8d0('0x42')]+=0x1;_0x23955c[_0xe8d0('0xe3')]+=0x1;_0x23955c[_0xe8d0('0xbc')]=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0xb,_0xe8d0('0xe4'));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xe5'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e[_0xe8d0('0xa3')]){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0xf,'Global');rpcDb[_0xe8d0('0xa6')](_0x54c04f,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x23955c[_0xe8d0('0xe6')]>=_0x556d7e[_0xe8d0('0xe7')]){rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xe5'));}else{rpcDb[_0xe8d0('0xc9')](ut[_0xe8d0('0xa9')](_0x23955c,_0xe8d0('0xe3'),_0x556d7e[_0xe8d0('0xe8')]),_0x23955c['unlockAgent'],_0x23955c[_0xe8d0('0xab')]);}}break;case'18':_0x556d7e[_0xe8d0('0x41')]+=0x1;_0x23955c[_0xe8d0('0xe9')]+=0x1;_0x23955c[_0xe8d0('0xbc')]=ut[_0xe8d0('0x9d')](_0x23955c);ut['logCustomer'](_0x23955c,0x12,_0x51eb0b['cause-txt']||_0x51eb0b[_0xe8d0('0xea')]);ami[_0xe8d0('0x25')](_0xe8d0('0xeb'),ut[_0xe8d0('0xa0')](_0x23955c,_0xe8d0('0xec')));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xed'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e[_0xe8d0('0xa3')]){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0xf,_0xe8d0('0xa5'));rpcDb[_0xe8d0('0xa6')](_0x54c04f,_0xe8d0('0xed'));}else{rpcDb['createCustomerFinal'](_0x23955c,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xe8d0('0x18')][_0x51eb0b[_0xe8d0('0xac')]];break;case'19':_0x556d7e[_0xe8d0('0x41')]+=0x1;_0x23955c[_0xe8d0('0xbc')]=ut[_0xe8d0('0x9d')](_0x23955c);ut['logCustomer'](_0x23955c,0x13,_0x51eb0b['cause-txt']||_0x51eb0b[_0xe8d0('0xea')]);ami['emit'](_0xe8d0('0xeb'),ut[_0xe8d0('0xa0')](_0x23955c,_0xe8d0('0xec')));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xee'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e[_0xe8d0('0xa3')]){_0x54c04f=ut['cloneAction'](_0x23955c,0xf,_0xe8d0('0xa5'));rpcDb[_0xe8d0('0xa6')](_0x54c04f,_0xe8d0('0xee'));}else{rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xee'));}delete this['actions'][_0x51eb0b['linkedid']];break;default:if(_0x23955c[_0xe8d0('0x73')]){ut['decrementTalkink'](_0x556d7e,_0xe8d0('0xef'));ut['loggerError'](_0xe8d0('0xf0')+_0x556d7e[_0xe8d0('0x28')],_0x51eb0b);}_0x556d7e[_0xe8d0('0x41')]+=0x1;_0x23955c['countglobal']=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0xc,_0x51eb0b['cause-txt']||_0x51eb0b[_0xe8d0('0xea')]);rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xf1'));if(ut['totalGlobal'](_0x23955c)>=_0x556d7e['dialGlobalMaxRetry']){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0xf,_0xe8d0('0xa5'));rpcDb[_0xe8d0('0xa6')](_0x54c04f,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xe8d0('0xa6')](_0x23955c,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xe8d0('0x18')][_0x51eb0b['linkedid']];}if(!(_0x23955c['dialAnswer']&&_0x40cb5c==='16')){ut['updateOriginated'](_0x556d7e,_0xe8d0('0xf2'));logger['info'](_0xe8d0('0xf3'),_0x23955c['uniqueid'],_0xe8d0('0xb3'),_0x556d7e['name'],'originated:\x20',_0x556d7e[_0xe8d0('0x4c')]);}if(_0x40cb5c!=='ANSWER'){delete this[_0xe8d0('0x18')][_0x51eb0b[_0xe8d0('0xac')]];delete this[_0xe8d0('0x18')][_0x51eb0b[_0xe8d0('0xf4')]];}}};Preview[_0xe8d0('0x10')][_0xe8d0('0xf5')]=function(_0x57c5ae,_0x43062c,_0x5c7a76){if(_[_0xe8d0('0xf6')](_0x43062c)&&_0xe8d0('0xf7')!==typeof _0x43062c){return;}if(_[_0xe8d0('0xf6')](_0x5c7a76)&&_0xe8d0('0xf7')!==typeof _0x5c7a76){return;}switch(_0x5c7a76['reason']){case'0':ut[_0xe8d0('0xf8')](_0x57c5ae,0x0,_0xe8d0('0x9e'));rpcDb[_0xe8d0('0xf9')](_0x57c5ae,_0xe8d0('0xfa'));break;case'3':ut[_0xe8d0('0xf8')](_0x57c5ae,0x3,_0xe8d0('0xcd'));rpcDb[_0xe8d0('0xf9')](_0x57c5ae,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xe8d0('0xf8')](_0x57c5ae,0x5,_0xe8d0('0xc3'));rpcDb[_0xe8d0('0xf9')](_0x57c5ae,_0xe8d0('0xfb'));break;case'8':ut[_0xe8d0('0xf8')](_0x57c5ae,0x8,_0xe8d0('0xd7'));rpcDb[_0xe8d0('0xf9')](_0x57c5ae,_0xe8d0('0xfc'));break;case'22':ut['logAgent'](_0x57c5ae,0x16,_0xe8d0('0xfd'));rpcDb[_0xe8d0('0xf9')](_0x57c5ae,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x57c5ae,0xc,_0x5c7a76['reason']);rpcDb[_0xe8d0('0xf9')](_0x57c5ae,_0xe8d0('0xfc'));}ut[_0xe8d0('0x7c')](_0x43062c,_0xe8d0('0xfe'));logger['info'](_0xe8d0('0xff'),_0x57c5ae['uniqueid'],'\x20Queue',_0x43062c[_0xe8d0('0x28')],'originated:\x20',_0x43062c['originated']);delete this[_0xe8d0('0x18')][_0x57c5ae['uniqueid']];};Preview[_0xe8d0('0x10')][_0xe8d0('0x100')]=function(_0x57d57f,_0xc9a56d,_0xc6fd9a,_0x5dbf91,_0x436574){var _0x729c89=this;return new BPromise(function(_0x33f42e,_0x30fee6){if(_[_0xe8d0('0x6c')](_0xc9a56d)||_[_0xe8d0('0x6c')](_0xc9a56d[_0xe8d0('0x101')])||_[_0xe8d0('0x6c')](_0xc9a56d[_0xe8d0('0x101')][_0xe8d0('0x102')])||_[_0xe8d0('0x6c')](_0xc9a56d[_0xe8d0('0x76')])){_0x30fee6(ut[_0xe8d0('0x4b')]('Contact\x20is\x20undefined',_0x5dbf91,_0x436574));return;}var _0x2dd9b5=uuid['v4']();var _0x3ccf5d=_0x729c89[_0xe8d0('0x15')][_0xc9a56d[_0xe8d0('0x6e')][_0xe8d0('0x28')]];var _0x2f7371=_0xc6fd9a?_0x729c89[_0xe8d0('0x19')][_0xc6fd9a]['id']:undefined;_0x729c89[_0xe8d0('0x18')][_0x2dd9b5]=new Action(_0xc9a56d,_0x3ccf5d,_0x2dd9b5,_0xc6fd9a,_0x2f7371);var _0x4c073=_0x729c89[_0xe8d0('0x18')][_0x2dd9b5];_0x4c073[_0xe8d0('0xca')]=_0x5dbf91;_0x4c073[_0xe8d0('0xab')]=_0x436574;_0x4c073[_0xe8d0('0x103')]=_0xc6fd9a;if(_[_0xe8d0('0x104')](_0x57d57f)){_0x729c89[_0xe8d0('0x105')](_0x4c073,_0x3ccf5d,_0xc9a56d,_0xc6fd9a)[_0xe8d0('0x85')](function(_0x35b681){logger[_0xe8d0('0x58')](_0xe8d0('0x106'),'Queue:\x20'+_0x4c073[_0xe8d0('0x6f')]+_0xe8d0('0x107')+_0x4c073['idContact'],JSON['stringify'](_0x35b681));ami[_0xe8d0('0x25')]('custom:agentcalled',ut['buildObj'](_0x4c073,_0xe8d0('0x108'),_0x729c89[_0xe8d0('0x15')][_0x4c073['queue']]));_0x33f42e(ut['message'](_0xe8d0('0x109')));})[_0xe8d0('0x7b')](function(_0x57db94){ut[_0xe8d0('0x10a')](_0xe8d0('0x10b'),_0x57db94);_0x30fee6(ut['message']('Call\x20failed',_0x5dbf91,_0x436574));});}else{_0x3ccf5d[_0xe8d0('0x10c')]+=0x1;ut[_0xe8d0('0x10d')](_0x4c073);rpcDb[_0xe8d0('0x10e')](_0x4c073,_0xe8d0('0x10f'));delete _0x729c89[_0xe8d0('0x18')][_0x2dd9b5];_0x30fee6(ut['message'](_0xe8d0('0x110'),_0x5dbf91,_0x436574));}});};Preview[_0xe8d0('0x10')]['isTrunkReachable']=function(_0x5a5253){return!_[_0xe8d0('0x6c')](_0x5a5253)&&!_[_0xe8d0('0x6c')](_0x5a5253['name'])&&!_[_0xe8d0('0x6c')](_0x5a5253[_0xe8d0('0x52')])&&_0x5a5253['active']&&!_['isNil'](this[_0xe8d0('0x17')][util['format'](_0xe8d0('0x111'),_0x5a5253[_0xe8d0('0x28')])])&&!_[_0xe8d0('0x6c')](this[_0xe8d0('0x17')][util['format'](_0xe8d0('0x111'),_0x5a5253[_0xe8d0('0x28')])][_0xe8d0('0x79')])&&(this['trunks'][util['format'](_0xe8d0('0x111'),_0x5a5253[_0xe8d0('0x28')])][_0xe8d0('0x79')]===_0xe8d0('0x112')||this[_0xe8d0('0x17')][util[_0xe8d0('0x56')]('SIP/%s',_0x5a5253[_0xe8d0('0x28')])][_0xe8d0('0x79')]===_0xe8d0('0x113'));};Preview[_0xe8d0('0x10')]['run']=function(_0x29a256,_0x31d174){var _0x5f0a2f=this;return new BPromise(function(_0x183c1f,_0x4a520d){_0x5f0a2f[_0xe8d0('0x114')](_0x29a256,_0x31d174)[_0xe8d0('0x85')](function(_0x44816a){_0x183c1f(_['pick'](_0x44816a,[_0xe8d0('0x4b')]));})[_0xe8d0('0x7b')](function(_0x24b26f){if(_0x24b26f[_0xe8d0('0x115')]){rpcDb['unlockContact'](_0x29a256);}if(_0x24b26f[_0xe8d0('0x52')]){rpcDb[_0xe8d0('0x8a')](_0x29a256);}_0x4a520d(_[_0xe8d0('0x74')](_0x24b26f,['message']));});});};Preview[_0xe8d0('0x10')]['execRun']=function(_0xa57cb9,_0x48cae3){var _0x1e3993=this;return new BPromise(function(_0x52c05c,_0x4a667f){var _0x596011,_0x3e1c17;rpcDb[_0xe8d0('0x116')](_0xa57cb9)[_0xe8d0('0x85')](function(_0xd82505){if(!_[_0xe8d0('0x6c')](_0xd82505[0x0])){_0x3e1c17=_0xd82505[0x0]['recallme']?![]:!![];_0x596011=_0xd82505[0x0][_0xe8d0('0x117')]?!![]:![];_0x596011=_0x48cae3?!![]:_0x596011;}var _0x1ac76c=_0x1e3993[_0xe8d0('0x118')](_0xd82505);if(_0x1ac76c[_0xe8d0('0x119')]){rpcDb[_0xe8d0('0x11a')](_[_0xe8d0('0x74')](_0xd82505[0x0],[_0xe8d0('0x76'),_0xe8d0('0x11b')]))[_0xe8d0('0x85')](function(_0x598287){_0x1e3993[_0xe8d0('0x100')](_0x598287,_0xd82505[0x0],_0x48cae3,_0x3e1c17,_0x596011)['then'](function(_0xa3b334){_0x52c05c(_0xa3b334);})['catch'](function(_0x36efb3){_0x4a667f(_0x36efb3);});})[_0xe8d0('0x7b')](function(_0xa51da){ut[_0xe8d0('0x10a')](_0xe8d0('0x11c'),_0xa51da);_0x4a667f(ut['message'](_0xe8d0('0x11d'),_0x3e1c17,_0x596011));});}else{_0x4a667f(ut[_0xe8d0('0x4b')](_0x1ac76c[_0xe8d0('0x4b')],_0x3e1c17,_0x596011));}})['catch'](function(_0x21d2f7){ut[_0xe8d0('0x10a')](_0xe8d0('0x11e'),_0x21d2f7);_0x4a667f(ut[_0xe8d0('0x4b')](_0xe8d0('0x11d'),![],!![]));});});};Preview['prototype']['validateContact']=function(_0x1b3a0d){if(_['isNil'](_0x1b3a0d)||_[_0xe8d0('0x104')](_0x1b3a0d)||!_[_0xe8d0('0x6c')](_0x1b3a0d[0x0][_0xe8d0('0x87')])&&_[_0xe8d0('0x6c')](_0x1b3a0d[0x0]['Agent'][_0xe8d0('0x28')])){ut[_0xe8d0('0x10a')](_0xe8d0('0x11f'),_0x1b3a0d);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x2e35ef=this['campaignsPreview'][_0x1b3a0d[0x0][_0xe8d0('0x6e')][_0xe8d0('0x28')]];_0x2e35ef[_0xe8d0('0x4b')]=_0xe8d0('0x9a');if(_[_0xe8d0('0x6c')](_0x2e35ef)){ut[_0xe8d0('0x10a')](_0xe8d0('0x120'),_0x2e35ef);return{'isValid':![],'message':_0xe8d0('0x121')};}if(!this[_0xe8d0('0x98')](_0x2e35ef[_0xe8d0('0x51')])){ut['logger'](_0xe8d0('0x122'),_0xe8d0('0x123')+_0x2e35ef[_0xe8d0('0x28')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x2e35ef[_0xe8d0('0x99')])){ut[_0xe8d0('0x10a')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x2e35ef[_0xe8d0('0x28')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xe8d0('0x124')};}}if(!ut[_0xe8d0('0x97')](_0x2e35ef[_0xe8d0('0x35')])){ut[_0xe8d0('0x10a')](_0xe8d0('0x125'),_0x2e35ef['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0xe8d0('0x123')+_0x2e35ef[_0xe8d0('0x28')]+_0xe8d0('0x126')};}return{'isValid':!![],'message':_0xe8d0('0x127')};};Preview[_0xe8d0('0x10')]['execCall']=function(_0x110b6a,_0x951308,_0x235ccf,_0x5bda3a){var _0x31bfe=this;return new BPromise(function(_0x5cc742,_0x3e6b07){var _0x5a40c2=_0x110b6a[_0xe8d0('0xb2')];var _0x48bad4=_0x31bfe[_0xe8d0('0x98')](_0x951308[_0xe8d0('0x51')])?util[_0xe8d0('0x56')]('SIP/%s/%s%s',_0x951308['Trunk'][_0xe8d0('0x28')],_[_0xe8d0('0x6c')](_0x951308[_0xe8d0('0x128')])?'':_0x951308[_0xe8d0('0x128')][_0xe8d0('0x129')]()||'',_0x951308[_0xe8d0('0x12a')]>0x0?_0x235ccf[_0xe8d0('0x101')]['phone']['substring'](_0x951308[_0xe8d0('0x12a')]):_0x235ccf[_0xe8d0('0x101')]['phone']):util[_0xe8d0('0x56')]('SIP/%s/%s%s',_[_0xe8d0('0x6c')](_0x951308['TrunkBackup'])?_0x951308['Trunk'][_0xe8d0('0x28')]:_0x951308[_0xe8d0('0x99')]['name'],_['isNil'](_0x951308[_0xe8d0('0x128')])?'':_0x951308['dialPrefix'][_0xe8d0('0x129')]()||'',_0x951308['dialCutDigit']>0x0?_0x235ccf[_0xe8d0('0x101')][_0xe8d0('0x102')][_0xe8d0('0x12b')](_0x951308['dialCutDigit']):_0x235ccf[_0xe8d0('0x101')][_0xe8d0('0x102')]);var _0x5e7090=_0x31bfe[_0xe8d0('0x98')](_0x951308[_0xe8d0('0x51')])?ut[_0xe8d0('0x12c')](_0x951308[_0xe8d0('0x51')][_0xe8d0('0x53')],_0x951308[_0xe8d0('0x36')],_0x951308[_0xe8d0('0x12d')]>0x0?ut[_0xe8d0('0x12e')](_0x951308[_0xe8d0('0x37')],_0x951308['dialRandomLastDigitCallerIdNumber']):_0x951308[_0xe8d0('0x37')]):ut[_0xe8d0('0x12c')](_[_0xe8d0('0x6c')](_0x951308['TrunkBackup'])?_0x951308[_0xe8d0('0x51')][_0xe8d0('0x53')]:_0x951308['TrunkBackup'][_0xe8d0('0x53')],_0x951308[_0xe8d0('0x36')],_0x951308[_0xe8d0('0x12d')]>0x0?ut['getCallerIdRandom'](_0x951308['dialOriginateCallerIdNumber'],_0x951308['dialRandomLastDigitCallerIdNumber']):_0x951308['dialOriginateCallerIdNumber']);if(_0x5e7090){_0x110b6a[_0xe8d0('0x12f')]=ut['extractCalleridName'](_0x5e7090);_0x110b6a[_0xe8d0('0x130')]=ut['extractCalleridNumber'](_0x5e7090);}var _0x226957=ut['addVariables'](_0x951308,_0x235ccf,_0x48bad4,_0x5e7090,_0x5a40c2,_0x110b6a);_[_0xe8d0('0x131')](_0x110b6a,ut['toLowerVariables'](_0x226957));_0x110b6a[_0xe8d0('0x8b')]=moment()[_0xe8d0('0x56')](_0xe8d0('0xae'));ami[_0xe8d0('0x78')](ut[_0xe8d0('0x132')](_0x110b6a,_0x951308,_0x226957,_0x110b6a['activeContact'],_0x5bda3a))['then'](function(_0x21e895){_0x951308[_0xe8d0('0x4c')]+=0x1;logger['info']('[originated][increment]',_0x5a40c2,'\x20Queue',_0x951308[_0xe8d0('0x28')],_0xe8d0('0x70'),_0x951308['originated']);_0x5cc742(_0x21e895);})[_0xe8d0('0x7b')](function(_0x657240){ut[_0xe8d0('0xf8')](_0x110b6a,0xe,_0xe8d0('0x133'));rpcDb[_0xe8d0('0xf9')](_0x110b6a,_0xe8d0('0x134'));_0x3e6b07(_0x657240);});});};Preview[_0xe8d0('0x10')][_0xe8d0('0x135')]=function(_0x342d25){if(this['actions'][_0x342d25[_0xe8d0('0xac')]]){this['actions'][_0x342d25[_0xe8d0('0xac')]][_0xe8d0('0x7a')]=_0x342d25['channel'];}};Preview['prototype']['syncOriginateResponse']=function(_0x11533f){var _0x50ff29=this;var _0x2ed64c=this[_0xe8d0('0x18')][_0x11533f['actionid']];if(_0x2ed64c){if(_0x2ed64c['lookAgent']&&this[_0xe8d0('0x19')][_0x2ed64c['lookAgent']]){ut[_0xe8d0('0x136')](_0x2ed64c,this[_0xe8d0('0x19')][_0x2ed64c['lookAgent']][_0xe8d0('0x28')],this['agents'][_0x2ed64c[_0xe8d0('0x103')]]['id']);}var _0x262bdc=_[_0xe8d0('0x137')](_0x2ed64c);_0x262bdc['responsetime']=moment()[_0xe8d0('0x56')](_0xe8d0('0xae'));var _0x1abe4d=_0x50ff29['campaignsPreview'][_0x2ed64c['queue']];if(ut[_0xe8d0('0x138')](_0x11533f['response'])){if(_0x2ed64c[_0xe8d0('0xca')]){rpcDb[_0xe8d0('0x139')](_0x2ed64c[_0xe8d0('0x13a')]);}if(_0x2ed64c[_0xe8d0('0xab')]){rpcDb['disableContact'](_0x2ed64c[_0xe8d0('0x13a')]);}ami['emit']('custom:agentringnoanswer',ut['buildObj'](_0x2ed64c,_0xe8d0('0x13b'),this[_0xe8d0('0x15')][_0x2ed64c[_0xe8d0('0x6f')]]));this[_0xe8d0('0xf5')](_0x262bdc,_0x1abe4d,_0x11533f);}else{_0x2ed64c[_0xe8d0('0x8b')]=moment()['format'](_0xe8d0('0xae'));ut['logAgent'](_0x262bdc,0x4,'Answer');rpcDb[_0xe8d0('0xf9')](_0x262bdc,_0xe8d0('0x13c'));}}};Preview[_0xe8d0('0x10')]['syncHangup']=function(_0x18d5d8){var _0x2f5242=this;var _0x391eb7=this[_0xe8d0('0x18')][_0x18d5d8[_0xe8d0('0xac')]];var _0x527668;if(_0x391eb7){_0x527668=this[_0xe8d0('0x15')][_0x391eb7[_0xe8d0('0x6f')]];logger[_0xe8d0('0x58')](_0xe8d0('0x13d'),_0x18d5d8[_0xe8d0('0xac')],_0xe8d0('0xb3'),_0x527668[_0xe8d0('0x28')],_0xe8d0('0x71'),_0x527668[_0xe8d0('0x72')]);}if(this[_0xe8d0('0x18')][_0x18d5d8[_0xe8d0('0xac')]]&&_0x18d5d8['linkedid']!==_0x18d5d8[_0xe8d0('0xb2')]){if(_0x18d5d8['cause']==='16'&&this['actions'][_0x18d5d8[_0xe8d0('0xac')]][_0xe8d0('0x73')]){this[_0xe8d0('0x9b')](_0x18d5d8,_0x18d5d8['linkedid'],_0x18d5d8[_0xe8d0('0x13e')]);}else if(this[_0xe8d0('0x18')][_0x18d5d8[_0xe8d0('0xac')]][_0xe8d0('0x73')]){logger[_0xe8d0('0x58')](_0xe8d0('0x13f'),_0x18d5d8['linkedid'],_0x18d5d8[_0xe8d0('0x13e')],_0xe8d0('0xb3'),_0x527668[_0xe8d0('0x28')],_0xe8d0('0x71'),_0x527668[_0xe8d0('0x72')]);this[_0xe8d0('0x9b')](_0x18d5d8,_0x18d5d8['linkedid'],_0x18d5d8['cause']);}}else if(_0x391eb7&&_[_0xe8d0('0x6c')](_0x391eb7[_0xe8d0('0x140')])&&_0x527668[_0xe8d0('0x141')]&&_0x18d5d8[_0xe8d0('0xac')]===_0x18d5d8[_0xe8d0('0xb2')]&&_[_0xe8d0('0x6c')](_0x18d5d8['reason'])&&_0x18d5d8[_0xe8d0('0x13e')]==='16'&&_0x18d5d8[_0xe8d0('0x142')]==='6'&&_[_0xe8d0('0xf6')](_0x391eb7[_0xe8d0('0x143')])){if(_0x391eb7[_0xe8d0('0xca')]){rpcDb['unlockContact'](_0x391eb7[_0xe8d0('0x13a')]);}if(_0x391eb7[_0xe8d0('0xab')]){rpcDb[_0xe8d0('0x8a')](_0x391eb7['idContact']);}_0x18d5d8[_0xe8d0('0x144')]='22';this[_0xe8d0('0xf5')](_0x391eb7,_0x527668,_0x18d5d8);}else if(_0x391eb7&&_0x391eb7[_0xe8d0('0x143')]){if(_0x18d5d8[_0xe8d0('0x13e')]==='16'&&this['actions'][_0x18d5d8[_0xe8d0('0xac')]][_0xe8d0('0x73')]){logger[_0xe8d0('0x58')](_0xe8d0('0x145'),_0x18d5d8[_0xe8d0('0xac')],_0x18d5d8['cause'],_0xe8d0('0xb3'),_0x527668[_0xe8d0('0x28')],_0xe8d0('0x71'),_0x527668[_0xe8d0('0x72')]);this[_0xe8d0('0x9b')](_0x18d5d8,_0x18d5d8[_0xe8d0('0xac')],_0x18d5d8[_0xe8d0('0x13e')]);}else if(this['actions'][_0x18d5d8[_0xe8d0('0xac')]]['dialAnswer']){logger[_0xe8d0('0x58')](_0xe8d0('0x13f'),_0x18d5d8[_0xe8d0('0xac')],_0x18d5d8['cause'],_0xe8d0('0xb3'),_0x527668[_0xe8d0('0x28')],'pTalking:\x20',_0x527668[_0xe8d0('0x72')]);this[_0xe8d0('0x9b')](_0x18d5d8,_0x18d5d8[_0xe8d0('0xac')],_0x18d5d8[_0xe8d0('0x13e')]);}}};Preview[_0xe8d0('0x10')]['syncDialEnd']=function(_0x37ab7c){if(this[_0xe8d0('0x18')][_0x37ab7c['destlinkedid']]&&_0x37ab7c[_0xe8d0('0xf4')]!==_0x37ab7c['destuniqueid']){this['callProgressDetectingCustomer'](_0x37ab7c,_0x37ab7c[_0xe8d0('0xf4')],_0x37ab7c[_0xe8d0('0xea')]);}};Preview[_0xe8d0('0x10')]['syncHangupRequest']=function(_0x3eaa1f){if(this[_0xe8d0('0x18')][_0x3eaa1f['linkedid']]&&_0x3eaa1f[_0xe8d0('0xac')]!==_0x3eaa1f['uniqueid']&&!this[_0xe8d0('0x18')][_0x3eaa1f[_0xe8d0('0xac')]][_0xe8d0('0x73')]){if(_0x3eaa1f['cause']==='1'){this[_0xe8d0('0x9b')](_0x3eaa1f,_0x3eaa1f[_0xe8d0('0xac')],_0x3eaa1f[_0xe8d0('0x13e')]);}}};Preview[_0xe8d0('0x10')][_0xe8d0('0x146')]=function(_0x28d34f,_0xf323b4,_0x783fa){if(this['actions'][_0x28d34f]){if(_[_0xe8d0('0x6c')](this[_0xe8d0('0x18')][_0x28d34f][_0xe8d0('0x147')])){this[_0xe8d0('0x18')][_0x28d34f][_0xe8d0('0x147')]={};}this[_0xe8d0('0x18')][_0x28d34f]['variables'][_0xf323b4]=_0x783fa;}};Preview[_0xe8d0('0x10')][_0xe8d0('0x21')]=function(_0x1fa83e){try{if(!_[_0xe8d0('0x6c')](_0x1fa83e)){if(ut[_0xe8d0('0x148')](_[_0xe8d0('0x149')](_0x1fa83e[_0xe8d0('0x14a')])[0x0])){this[_0xe8d0('0x146')](_0x1fa83e[_0xe8d0('0xb2')],_[_0xe8d0('0x149')](_0x1fa83e[_0xe8d0('0x14a')])[0x0],_0x1fa83e['value']);}}}catch(_0x475248){logger[_0xe8d0('0x14b')](_0xe8d0('0x14c'),util[_0xe8d0('0x14d')](_0x475248,{'showHidden':![],'depth':null}));}};Preview[_0xe8d0('0x10')]['syncAttendedTransfer']=function(_0x564361){if(_0x564361){if(this[_0xe8d0('0x18')][_0x564361[_0xe8d0('0x14e')]]){this[_0xe8d0('0x18')][_0x564361['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0xe8d0('0x10')][_0xe8d0('0x24')]=function(_0xb5f1b3){if(_0xb5f1b3){if(this[_0xe8d0('0x18')][_0xb5f1b3[_0xe8d0('0x14f')]]){this[_0xe8d0('0x18')][_0xb5f1b3['transfererlinkedid']]['transfer']=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xaba6=['Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','size','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','catch','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','activeContact','linkedid','ANSWER','responsetime','answertime','uniqueid','\x20Queue','acw','custom:agentConnectPreview','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','outboundBusyCallsDay','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','Congestion','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','Contact\x20is\x20undefined','lookAgent','execCall','Queue:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','active','SIP/%s','status','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','trim','phone','substring','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','clone','idContact','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','addVariable','variables','filterKey','variable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','ioredis','../../../config/environment','preview','../../../config/logger','./action','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','callerid','Interval','stringify','md5','format','voice:queue:%s','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','info','[clearZombieChannels][talking]'];(function(_0x5ce4f1,_0x1eb7c6){var _0x3aaa2f=function(_0x3462b0){while(--_0x3462b0){_0x5ce4f1['push'](_0x5ce4f1['shift']());}};_0x3aaa2f(++_0x1eb7c6);}(_0xaba6,0xe2));var _0x6aba=function(_0x2e0dca,_0x45a901){_0x2e0dca=_0x2e0dca-0x0;var _0x31605b=_0xaba6[_0x2e0dca];return _0x31605b;};'use strict';var util=require(_0x6aba('0x0'));var _=require(_0x6aba('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var md5=require('md5');var Redis=require(_0x6aba('0x2'));var config=require(_0x6aba('0x3'));var logger=require('../../../config/logger')(_0x6aba('0x4'));var loggerAction=require(_0x6aba('0x5'))('actionPreview');var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0x6aba('0x6'));var ut=require('./util/util');config[_0x6aba('0x7')]=_[_0x6aba('0x8')](config['redis'],{'host':_0x6aba('0x9'),'port':0x18eb});var io=require(_0x6aba('0xa'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x6aba('0xb')][_0x6aba('0xc')]=function(_0x1a2dcc){this[_0x6aba('0xd')]=this[_0x6aba('0xd')]?this[_0x6aba('0xd')][_0x6aba('0xe')](_0x1a2dcc):_0x1a2dcc();};function Preview(_0x55b1b6){this[_0x6aba('0xf')]=new Sequence();this[_0x6aba('0x10')]=_0x55b1b6[_0x6aba('0x11')];this[_0x6aba('0x12')]=_0x55b1b6['trunks'];this[_0x6aba('0x13')]={};this[_0x6aba('0x14')]=_0x55b1b6['agents'];this[_0x6aba('0x15')]=0x0;ami['on'](_0x6aba('0x16'),this[_0x6aba('0x17')]['bind'](this));ami['on'](_0x6aba('0x18'),this[_0x6aba('0x19')][_0x6aba('0x1a')](this));ami['on']('hanguprequest',this[_0x6aba('0x1b')][_0x6aba('0x1a')](this));ami['on'](_0x6aba('0x1c'),this[_0x6aba('0x1d')][_0x6aba('0x1a')](this));ami['on'](_0x6aba('0x1e'),this[_0x6aba('0x1f')]['bind'](this));ami['on'](_0x6aba('0x20'),this[_0x6aba('0x21')][_0x6aba('0x1a')](this));ami['on']('attendedtransfer',this[_0x6aba('0x22')]['bind'](this));ami['on']('blindtransfer',this[_0x6aba('0x23')]['bind'](this));this[_0x6aba('0x24')](this[_0x6aba('0x10')]);}function emit(_0x37b275,_0xb2f624,_0x110be5){io['to'](_0x37b275)[_0x6aba('0x25')](_0xb2f624,_0x110be5);}function emitCampaignPreview(_0x362a10){if(_0x362a10['type']===_0x6aba('0x26')){var _0x41464f={'id':_0x362a10['id'],'name':_0x362a10[_0x6aba('0x27')],'strategy':_0x362a10[_0x6aba('0x28')],'answered':_0x362a10[_0x6aba('0x29')],'available':_0x362a10[_0x6aba('0x2a')],'loggedIn':_0x362a10[_0x6aba('0x2b')],'pTalking':_0x362a10[_0x6aba('0x2c')],'sumBillable':_0x362a10[_0x6aba('0x2d')],'sumDuration':_0x362a10[_0x6aba('0x2e')],'sumHoldTime':_0x362a10[_0x6aba('0x2f')]||0x0,'talking':_0x362a10[_0x6aba('0x30')],'total':_0x362a10[_0x6aba('0x31')],'type':_0x362a10[_0x6aba('0x32')],'unmanaged':_0x362a10[_0x6aba('0x33')],'abandoned':_0x362a10[_0x6aba('0x34')],'waiting':_0x362a10[_0x6aba('0x35')],'loggedInDb':_0x362a10[_0x6aba('0x36')],'dialActive':_0x362a10[_0x6aba('0x37')],'dialMethod':_0x362a10['dialMethod'],'dialOriginateCallerIdName':_0x362a10['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x362a10[_0x6aba('0x38')],'dialOriginateTimeout':_0x362a10['dialOriginateTimeout'],'dialPrefix':_0x362a10[_0x6aba('0x39')],'outboundAnswerAgiCallsDay':_0x362a10[_0x6aba('0x3a')],'outboundAnswerCallsDay':_0x362a10[_0x6aba('0x3b')],'outboundBlacklistCallsDay':_0x362a10[_0x6aba('0x3c')],'outboundBusyCallsDay':_0x362a10['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x362a10[_0x6aba('0x3d')],'outboundDropCallsDayACS':_0x362a10[_0x6aba('0x3e')],'outboundDropCallsDayCallersExit':_0x362a10[_0x6aba('0x3f')],'outboundDropCallsDayTimeout':_0x362a10[_0x6aba('0x40')],'outboundNoAnswerCallsDay':_0x362a10[_0x6aba('0x41')],'outboundNoSuchCallsDay':_0x362a10['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x362a10[_0x6aba('0x42')],'outboundReCallsDay':_0x362a10['outboundReCallsDay'],'outboundRejectCallsDay':_0x362a10[_0x6aba('0x43')],'outboundUnknownCallsDay':_0x362a10[_0x6aba('0x44')],'outboundAbandonedCallsDay':_0x362a10['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x362a10['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x362a10[_0x6aba('0x45')],'predictiveIntervalAvgTalktime':_0x362a10[_0x6aba('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x362a10[_0x6aba('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x362a10[_0x6aba('0x48')],'predictiveIntervalErlangCalls':_0x362a10[_0x6aba('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x362a10[_0x6aba('0x4a')],'predictiveIntervalHitRate':_0x362a10[_0x6aba('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x362a10['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x362a10[_0x6aba('0x4c')],'predictiveIntervalAvailable':_0x362a10[_0x6aba('0x4d')],'predictiveIntervalTotalCalls':_0x362a10[_0x6aba('0x4e')],'message':_0x362a10['message'],'originated':_0x362a10[_0x6aba('0x4f')],'erlangCalls':_0x362a10[_0x6aba('0x50')],'erlangCallToSecond':_0x362a10[_0x6aba('0x51')],'erlangAbandonmentRate':_0x362a10['erlangAbandonmentRate'],'erlangBusyFactor':_0x362a10[_0x6aba('0x52')],'startPredictive':_0x362a10[_0x6aba('0x53')],'startProgressive':_0x362a10['startProgressive']};if(_0x362a10[_0x6aba('0x54')]){_0x41464f['Trunk']={'id':_0x362a10[_0x6aba('0x54')]['id'],'name':_0x362a10['Trunk'][_0x6aba('0x27')],'active':_0x362a10[_0x6aba('0x54')]['active'],'callerid':_0x362a10['Trunk'][_0x6aba('0x55')]};}if(_0x362a10['Interval']){_0x41464f[_0x6aba('0x56')]={'id':_0x362a10[_0x6aba('0x56')]['id'],'name':_0x362a10['Interval'][_0x6aba('0x27')]};}var _0x46d695=md5(JSON[_0x6aba('0x57')](_0x41464f));if(_0x362a10[_0x6aba('0x58')]!==_0x46d695){_0x362a10[_0x6aba('0x58')]=_0x46d695;emit(util[_0x6aba('0x59')](_0x6aba('0x5a'),_0x41464f['name']),'voice_queue:save',_0x41464f);}}}function emitVoiceQueueChannelRemove(_0x3250a5){logger['info'](_0x6aba('0x5b'),JSON[_0x6aba('0x57')](_0x3250a5));emit(util[_0x6aba('0x59')]('voice:queue:%s',_0x3250a5[_0x6aba('0x27')]),_0x6aba('0x5c'),_0x3250a5);io[_0x6aba('0x25')](_0x6aba('0x5d'),_0x3250a5);}function notSendMessagesQueue(_0x1bd3f3){if(_0x1bd3f3[_0x6aba('0x5e')]){if(_0x1bd3f3[_0x6aba('0x4f')]===0x0&&_0x1bd3f3[_0x6aba('0x2c')]===0x0){_0x1bd3f3[_0x6aba('0x5e')]=![];_0x1bd3f3['available']=0x0;_0x1bd3f3[_0x6aba('0x5f')]=0x0;_0x1bd3f3[_0x6aba('0x60')]=_0x6aba('0x61');ut[_0x6aba('0x62')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x1bd3f3[_0x6aba('0x27')]+'\x20is\x20not\x20active');}else{_0x1bd3f3[_0x6aba('0x60')]='IS_DISACTIVED';ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x1bd3f3[_0x6aba('0x27')]+'\x20is\x20disactive');}emitCampaignPreview(_0x1bd3f3);}}Preview[_0x6aba('0xb')][_0x6aba('0x24')]=function(){var _0x291983=this;setInterval(function(){_0x291983[_0x6aba('0x63')]();},0x7cf);};Preview[_0x6aba('0xb')][_0x6aba('0x63')]=function(){var _0x29aaa7=this['campaignsPreview'];this[_0x6aba('0x15')]+=0x1;for(var _0xe75150 in _0x29aaa7){if(_0x29aaa7[_0x6aba('0x64')](_0xe75150)&&(_0x29aaa7[_0xe75150]['dialMethod']==='preview'||_0x29aaa7[_0xe75150][_0x6aba('0x65')]===_0x6aba('0x66'))&&_0x29aaa7[_0xe75150][_0x6aba('0x32')]===_0x6aba('0x26')){if(this[_0x6aba('0x15')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x6aba('0x67')]();}}if(_0x29aaa7[_0x6aba('0x64')](_0xe75150)&&_0x29aaa7[_0xe75150][_0x6aba('0x65')]===_0x6aba('0x4')&&_0x29aaa7[_0xe75150][_0x6aba('0x32')]===_0x6aba('0x26')){if(_0x29aaa7[_0xe75150][_0x6aba('0x37')]){this['setMessage'](_0x29aaa7[_0xe75150]);if(_0x29aaa7[_0xe75150][_0x6aba('0x68')])this[_0x6aba('0x69')](_0x29aaa7[_0xe75150]);}else{notSendMessagesQueue(_0x29aaa7[_0xe75150]);}}}};Preview[_0x6aba('0xb')][_0x6aba('0x6a')]=function(_0x44af23){var _0x33f1bb=this;this['sequence'][_0x6aba('0xc')](function(){if(!_['isNil'](_0x33f1bb['actions'][_0x44af23])){loggerAction[_0x6aba('0x6b')](_0x6aba('0x6c'),_0x44af23,_0x6aba('0x6d'),_0x33f1bb[_0x6aba('0x13')][_0x44af23][_0x6aba('0x6e')],_0x6aba('0x6f'),JSON[_0x6aba('0x57')](_0x33f1bb[_0x6aba('0x10')][_0x33f1bb[_0x6aba('0x13')][_0x44af23][_0x6aba('0x6e')]]['originated']),_0x6aba('0x70'),JSON[_0x6aba('0x57')](_0x33f1bb[_0x6aba('0x10')][_0x33f1bb[_0x6aba('0x13')][_0x44af23][_0x6aba('0x6e')]][_0x6aba('0x2c')]),JSON[_0x6aba('0x57')](_0x33f1bb[_0x6aba('0x13')][_0x44af23][_0x6aba('0x71')]),JSON[_0x6aba('0x57')](_[_0x6aba('0x72')](_0x33f1bb[_0x6aba('0x13')][_0x44af23],[_0x6aba('0x73'),'UserId',_0x6aba('0x74'),_0x6aba('0x75')])));return ami[_0x6aba('0x76')]({'action':'status','channel':_0x33f1bb[_0x6aba('0x13')][_0x44af23]['channel']})['catch'](function(_0x24f0c3){if(_0x24f0c3[_0x6aba('0x60')]===_0x6aba('0x77')){setTimeout(function(){if(_0x33f1bb['actions'][_0x44af23]){ut[_0x6aba('0x78')](_0x33f1bb[_0x6aba('0x10')][_0x33f1bb[_0x6aba('0x13')][_0x44af23][_0x6aba('0x6e')]],_0x6aba('0x79'));if(_0x33f1bb[_0x6aba('0x13')][_0x44af23]['dialAnswer']===!![]){ut[_0x6aba('0x7a')](_0x33f1bb[_0x6aba('0x10')][_0x33f1bb['actions'][_0x44af23][_0x6aba('0x6e')]],_0x6aba('0x79'));ut[_0x6aba('0x7b')](_0x6aba('0x7c')+_0x44af23,_0x33f1bb[_0x6aba('0x13')][_0x44af23][_0x6aba('0x6e')]);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x44af23,_0x33f1bb[_0x6aba('0x13')][_0x44af23][_0x6aba('0x6e')]);delete _0x33f1bb['actions'][_0x44af23];}},0x2328);}});}});};Preview[_0x6aba('0xb')][_0x6aba('0x67')]=function(){var _0x4d07d9=this;loggerAction[_0x6aba('0x6b')]('[action]',_[_0x6aba('0x7d')](this[_0x6aba('0x13')]));for(var _0x395a8e in this['actions']){if(_0x4d07d9[_0x6aba('0x13')][_0x6aba('0x64')](_0x395a8e)){_0x4d07d9[_0x6aba('0x6a')](_0x395a8e);}}};Preview[_0x6aba('0xb')][_0x6aba('0x69')]=function(_0x560d5a){var _0x4ed26c=this;rpcDb[_0x6aba('0x7e')](_0x560d5a['id'],ut[_0x6aba('0x7f')](this['agents']))[_0x6aba('0x80')](function(_0x145903){if(!_[_0x6aba('0x81')](_0x145903)){for(var _0x19bcfb=0x0;_0x19bcfb<_0x145903[_0x6aba('0x82')];_0x19bcfb+=0x1){if(ut[_0x6aba('0x83')](_0x145903[_0x19bcfb]['scheduledat'])<_0x560d5a[_0x6aba('0x84')]*0x3c){if(_0x145903[_0x19bcfb][_0x6aba('0x85')]&&!_0x145903[_0x19bcfb][_0x6aba('0x85')][_0x6aba('0x86')]){_0x4ed26c[_0x6aba('0x87')](_0x145903[_0x19bcfb]['id'])[_0x6aba('0x80')](ut[_0x6aba('0x88')](_0x6aba('0x89')))[_0x6aba('0x8a')](ut[_0x6aba('0x88')](_0x6aba('0x89')));}else{rpcDb[_0x6aba('0x8b')](_0x145903[_0x19bcfb]['id']);}}else{var _0x21a576=new Action(_0x145903[_0x19bcfb],_0x560d5a);_0x21a576[_0x6aba('0x8c')]=moment()[_0x6aba('0x59')](_0x6aba('0x8d'));_0x560d5a[_0x6aba('0x8e')]+=0x1;ut[_0x6aba('0x8f')](_0x21a576,0x17,'RecallInQueue');if(_0x560d5a['dialRecallInQueue']){rpcDb[_0x6aba('0x90')](ut['createBody'](_0x145903[_0x19bcfb]));rpcDb[_0x6aba('0x91')](_0x21a576,_0x6aba('0x92'));}else{ut[_0x6aba('0x8f')](_0x21a576,0x16,_0x6aba('0x93'));rpcDb[_0x6aba('0x91')](_0x21a576,_0x6aba('0x94'));rpcDb[_0x6aba('0x95')](_0x21a576,_0x6aba('0x94'));}}}}})[_0x6aba('0x8a')](ut['logger2'](_0x6aba('0x96')));};Preview[_0x6aba('0xb')][_0x6aba('0x97')]=function(_0x57e289){_0x57e289[_0x6aba('0x5e')]=!![];if(ut[_0x6aba('0x98')](_0x57e289['loggedIn'])){_0x57e289[_0x6aba('0x60')]=_0x6aba('0x99');}else if(!ut[_0x6aba('0x9a')](_0x57e289[_0x6aba('0x37')])){_0x57e289[_0x6aba('0x60')]=_0x6aba('0x61');}else if(!this['isTrunkReachable'](_0x57e289[_0x6aba('0x54')])){if(!this[_0x6aba('0x9b')](_0x57e289['TrunkBackup'])){_0x57e289[_0x6aba('0x60')]=_0x6aba('0x9c');}else{_0x57e289['message']=_0x6aba('0x9d');}}else{_0x57e289[_0x6aba('0x60')]='ACTIVE';}emitCampaignPreview(_0x57e289);};Preview[_0x6aba('0xb')][_0x6aba('0x9e')]=function(_0x59567f,_0x226b75,_0x346d05){var _0x12caa8=this;var _0x12a7d9=this[_0x6aba('0x13')][_0x226b75];var _0x2de430=this[_0x6aba('0x10')][_0x12a7d9[_0x6aba('0x6e')]];var _0x58e2e9;if(_0x2de430){switch(_0x346d05){case'1':_0x2de430['outboundNoSuchCallsDay']+=0x1;_0x12a7d9[_0x6aba('0x9f')]+=0x1;_0x12a7d9[_0x6aba('0xa0')]=ut[_0x6aba('0xa1')](_0x12a7d9);ut[_0x6aba('0x8f')](_0x12a7d9,0x0,_0x6aba('0xa2'));ami[_0x6aba('0x25')](_0x6aba('0xa3'),ut[_0x6aba('0xa4')](_0x12a7d9,_0x6aba('0xa5')));rpcDb[_0x6aba('0x91')](_0x12a7d9,_0x6aba('0xa6'));if(ut['totalGlobal'](_0x12a7d9)>=_0x2de430[_0x6aba('0xa7')]){_0x58e2e9=ut[_0x6aba('0xa8')](_0x12a7d9,0xf,_0x6aba('0xa9'));rpcDb[_0x6aba('0x95')](_0x58e2e9,_0x6aba('0xaa'));}else{if(_0x12a7d9[_0x6aba('0x9f')]>=_0x2de430[_0x6aba('0xab')]){rpcDb[_0x6aba('0x95')](_0x12a7d9,_0x6aba('0xaa'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x12a7d9,_0x6aba('0x9f'),_0x2de430['dialNoSuchNumberRetryFrequency']),_0x12a7d9['unlockAgent'],_0x12a7d9[_0x6aba('0xac')]);}}delete this[_0x6aba('0x13')][_0x59567f[_0x6aba('0xad')]];break;case _0x6aba('0xae'):var _0x27fbde=moment()[_0x6aba('0x59')](_0x6aba('0x8d'));_0x12a7d9[_0x6aba('0xaf')]=_0x27fbde;_0x12a7d9[_0x6aba('0xb0')]=_0x27fbde;_0x12a7d9[_0x6aba('0x71')]=!![];_0x2de430[_0x6aba('0x2c')]+=0x1;logger[_0x6aba('0x6b')]('[syncHangup][talking][increment]',_0x12a7d9[_0x6aba('0xb1')],_0x6aba('0xb2'),_0x2de430['name'],_0x6aba('0x70'),_0x2de430[_0x6aba('0x2c')]);ami[_0x6aba('0x25')]('custom:agentconnect',ut[_0x6aba('0xa4')](_0x12a7d9,'connect',this['campaignsPreview'][_0x12a7d9['queue']]));if(_0x2de430[_0x6aba('0xb3')]){ami[_0x6aba('0x25')](_0x6aba('0xb4'),ut['buildAcw'](_0x12a7d9));}break;case'16':ami[_0x6aba('0x25')](_0x6aba('0xb5'),ut[_0x6aba('0xa4')](_0x12a7d9,_0x6aba('0xb6'),this[_0x6aba('0x10')][_0x12a7d9['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x12a7d9,_0x6aba('0xb6')));_0x2de430['outboundAnswerCallsDay']+=0x1;_0x2de430[_0x6aba('0x31')]+=0x1;_0x2de430[_0x6aba('0x29')]+=0x1;ut[_0x6aba('0x7a')](_0x2de430,_0x6aba('0xb7'));_0x12a7d9[_0x6aba('0xa0')]=ut[_0x6aba('0xa1')](_0x12a7d9);ut[_0x6aba('0x8f')](_0x12a7d9,0x4,_0x6aba('0xb8'));rpcDb[_0x6aba('0x91')](_0x12a7d9,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x6aba('0x95')](_0x12a7d9,_0x6aba('0xb9'));rpcDb[_0x6aba('0xba')](_0x12a7d9);_0x2de430['sumDuration']+=_0x12a7d9[_0x6aba('0xbb')];_0x2de430['sumBillable']+=_0x12a7d9[_0x6aba('0xbb')];logger[_0x6aba('0x6b')]('[syncHangup][talking][decrement]',_0x12a7d9[_0x6aba('0xb1')],_0x6aba('0xb2'),_0x2de430[_0x6aba('0x27')],_0x6aba('0x70'),_0x2de430[_0x6aba('0x2c')]);delete this['actions'][_0x59567f[_0x6aba('0xad')]];break;case _0x6aba('0xbc'):_0x2de430[_0x6aba('0xbd')]+=0x1;_0x12a7d9[_0x6aba('0xbe')]+=0x1;_0x12a7d9['countglobal']=ut[_0x6aba('0xa1')](_0x12a7d9);ut[_0x6aba('0x8f')](_0x12a7d9,0x5,'Busy');ami[_0x6aba('0x25')](_0x6aba('0xbf'),ut[_0x6aba('0xa4')](_0x12a7d9,_0x6aba('0xc0')));rpcDb[_0x6aba('0x91')](_0x12a7d9,_0x6aba('0xc1'));if(ut['totalGlobal'](_0x12a7d9)>=_0x2de430[_0x6aba('0xa7')]){_0x58e2e9=ut[_0x6aba('0xa8')](_0x12a7d9,0xf,_0x6aba('0xa9'));rpcDb[_0x6aba('0x95')](_0x58e2e9,_0x6aba('0xc2'));}else{if(_0x12a7d9['countbusyretry']>=_0x2de430[_0x6aba('0xc3')]){rpcDb[_0x6aba('0x95')](_0x12a7d9,_0x6aba('0xc1'));}else{rpcDb[_0x6aba('0xc4')](ut[_0x6aba('0xc5')](_0x12a7d9,_0x6aba('0xbe'),_0x2de430[_0x6aba('0xc6')]),_0x12a7d9[_0x6aba('0xc7')],_0x12a7d9[_0x6aba('0xac')]);}}break;case'NOANSWER':_0x2de430[_0x6aba('0x41')]+=0x1;_0x12a7d9[_0x6aba('0xc8')]+=0x1;_0x12a7d9[_0x6aba('0xa0')]=ut[_0x6aba('0xa1')](_0x12a7d9);ut[_0x6aba('0x8f')](_0x12a7d9,0x3,_0x6aba('0xc9'));ami[_0x6aba('0x25')]('custom:agentnoanswer',ut['buildObj'](_0x12a7d9,_0x6aba('0xca')));rpcDb[_0x6aba('0x91')](_0x12a7d9,_0x6aba('0xcb'));if(ut[_0x6aba('0xa1')](_0x12a7d9)>=_0x2de430[_0x6aba('0xa7')]){_0x58e2e9=ut[_0x6aba('0xa8')](_0x12a7d9,0xf,_0x6aba('0xa9'));rpcDb[_0x6aba('0x95')](_0x58e2e9,_0x6aba('0xcc'));}else{if(_0x12a7d9[_0x6aba('0xc8')]>=_0x2de430[_0x6aba('0xcd')]){rpcDb[_0x6aba('0x95')](_0x12a7d9,_0x6aba('0xcb'));}else{rpcDb[_0x6aba('0xc4')](ut[_0x6aba('0xc5')](_0x12a7d9,_0x6aba('0xc8'),_0x2de430[_0x6aba('0xce')]),_0x12a7d9[_0x6aba('0xc7')],_0x12a7d9['activeContact']);}}break;case _0x6aba('0xcf'):_0x2de430[_0x6aba('0x3d')]+=0x1;_0x12a7d9[_0x6aba('0xd0')]+=0x1;_0x12a7d9[_0x6aba('0xa0')]=ut['totalGlobal'](_0x12a7d9);ut[_0x6aba('0x8f')](_0x12a7d9,0x8,'Congestion');ami[_0x6aba('0x25')](_0x6aba('0xd1'),ut[_0x6aba('0xa4')](_0x12a7d9,'congestion'));rpcDb[_0x6aba('0x91')](_0x12a7d9,_0x6aba('0xd2'));if(ut[_0x6aba('0xa1')](_0x12a7d9)>=_0x2de430['dialGlobalMaxRetry']){_0x58e2e9=ut[_0x6aba('0xa8')](_0x12a7d9,0xf,_0x6aba('0xa9'));rpcDb['createCustomerFinal'](_0x58e2e9,_0x6aba('0xd3'));}else{if(_0x12a7d9[_0x6aba('0xd0')]>=_0x2de430[_0x6aba('0xd4')]){rpcDb[_0x6aba('0x95')](_0x12a7d9,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x6aba('0xc4')](ut['scheduledAt'](_0x12a7d9,'countcongestionretry',_0x2de430[_0x6aba('0xc6')]),_0x12a7d9[_0x6aba('0xc7')],_0x12a7d9['activeContact']);}}break;case _0x6aba('0xd5'):_0x2de430['outboundRejectCallsDay']+=0x1;_0x12a7d9['countagentrejectretry']+=0x1;_0x12a7d9[_0x6aba('0xa0')]=ut['totalGlobal'](_0x12a7d9);ut[_0x6aba('0x8f')](_0x12a7d9,0x14,_0x6aba('0xd6'));ami[_0x6aba('0x25')](_0x6aba('0xd7'),ut['buildObj'](_0x12a7d9,'agentreject'));rpcDb[_0x6aba('0x91')](_0x12a7d9,_0x6aba('0xd8'));if(ut[_0x6aba('0xa1')](_0x12a7d9)>=_0x2de430['dialGlobalMaxRetry']){_0x58e2e9=ut[_0x6aba('0xa8')](_0x12a7d9,0x14,_0x6aba('0xd6'));rpcDb[_0x6aba('0x95')](_0x58e2e9,_0x6aba('0xd9'));}else{if(_0x12a7d9['countagentrejectretry']>=_0x2de430['dialAgentRejectMaxRetry']){rpcDb[_0x6aba('0x95')](_0x12a7d9,_0x6aba('0xd9'));}else{rpcDb[_0x6aba('0xc4')](ut[_0x6aba('0xc5')](_0x12a7d9,_0x6aba('0xda'),_0x2de430[_0x6aba('0xdb')]),_0x12a7d9[_0x6aba('0xc7')],_0x12a7d9['activeContact']);}}break;case _0x6aba('0xdc'):_0x2de430[_0x6aba('0xdd')]+=0x1;_0x12a7d9['countabandonedretry']+=0x1;_0x12a7d9['countglobal']=ut['totalGlobal'](_0x12a7d9);ut[_0x6aba('0x8f')](_0x12a7d9,0xb,_0x6aba('0xde'));rpcDb[_0x6aba('0x91')](_0x12a7d9,_0x6aba('0xdf'));if(ut['totalGlobal'](_0x12a7d9)>=_0x2de430['dialGlobalMaxRetry']){_0x58e2e9=ut[_0x6aba('0xa8')](_0x12a7d9,0xf,_0x6aba('0xa9'));rpcDb[_0x6aba('0x95')](_0x58e2e9,_0x6aba('0xdf'));}else{if(_0x12a7d9[_0x6aba('0xe0')]>=_0x2de430[_0x6aba('0xe1')]){rpcDb[_0x6aba('0x95')](_0x12a7d9,_0x6aba('0xdf'));}else{rpcDb[_0x6aba('0xc4')](ut[_0x6aba('0xc5')](_0x12a7d9,_0x6aba('0xe2'),_0x2de430[_0x6aba('0xe3')]),_0x12a7d9['unlockAgent'],_0x12a7d9[_0x6aba('0xac')]);}}break;case'18':_0x2de430['outboundUnknownCallsDay']+=0x1;_0x12a7d9[_0x6aba('0xe4')]+=0x1;_0x12a7d9[_0x6aba('0xa0')]=ut[_0x6aba('0xa1')](_0x12a7d9);ut['logCustomer'](_0x12a7d9,0x12,_0x59567f[_0x6aba('0xe5')]||_0x59567f[_0x6aba('0xe6')]);ami[_0x6aba('0x25')]('custom:amd',ut[_0x6aba('0xa4')](_0x12a7d9,_0x6aba('0xe7')));rpcDb[_0x6aba('0x91')](_0x12a7d9,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0x6aba('0xa1')](_0x12a7d9)>=_0x2de430[_0x6aba('0xa7')]){_0x58e2e9=ut[_0x6aba('0xa8')](_0x12a7d9,0xf,_0x6aba('0xa9'));rpcDb[_0x6aba('0x95')](_0x58e2e9,_0x6aba('0xe8'));}else{rpcDb[_0x6aba('0x95')](_0x12a7d9,_0x6aba('0xe8'));}delete this['actions'][_0x59567f[_0x6aba('0xad')]];break;case'19':_0x2de430['outboundUnknownCallsDay']+=0x1;_0x12a7d9[_0x6aba('0xa0')]=ut[_0x6aba('0xa1')](_0x12a7d9);ut[_0x6aba('0x8f')](_0x12a7d9,0x13,_0x59567f[_0x6aba('0xe5')]||_0x59567f[_0x6aba('0xe6')]);ami[_0x6aba('0x25')](_0x6aba('0xe9'),ut[_0x6aba('0xa4')](_0x12a7d9,_0x6aba('0xe7')));rpcDb[_0x6aba('0x91')](_0x12a7d9,_0x6aba('0xea'));if(ut['totalGlobal'](_0x12a7d9)>=_0x2de430[_0x6aba('0xa7')]){_0x58e2e9=ut[_0x6aba('0xa8')](_0x12a7d9,0xf,_0x6aba('0xa9'));rpcDb[_0x6aba('0x95')](_0x58e2e9,_0x6aba('0xea'));}else{rpcDb[_0x6aba('0x95')](_0x12a7d9,_0x6aba('0xea'));}delete this[_0x6aba('0x13')][_0x59567f[_0x6aba('0xad')]];break;default:if(_0x12a7d9[_0x6aba('0x71')]){ut[_0x6aba('0x7a')](_0x2de430,_0x6aba('0xeb'));ut[_0x6aba('0x7b')](_0x6aba('0xec')+_0x2de430[_0x6aba('0x27')],_0x59567f);}_0x2de430[_0x6aba('0x44')]+=0x1;_0x12a7d9[_0x6aba('0xa0')]=ut[_0x6aba('0xa1')](_0x12a7d9);ut['logCustomer'](_0x12a7d9,0xc,_0x59567f[_0x6aba('0xe5')]||_0x59567f[_0x6aba('0xe6')]);rpcDb[_0x6aba('0x91')](_0x12a7d9,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x6aba('0xa1')](_0x12a7d9)>=_0x2de430['dialGlobalMaxRetry']){_0x58e2e9=ut[_0x6aba('0xa8')](_0x12a7d9,0xf,'Global');rpcDb[_0x6aba('0x95')](_0x58e2e9,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x12a7d9,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x6aba('0x13')][_0x59567f['linkedid']];}if(!(_0x12a7d9['dialAnswer']&&_0x346d05==='16')){ut[_0x6aba('0x78')](_0x2de430,'[callProgressDetectingCustomer]');logger[_0x6aba('0x6b')](_0x6aba('0xed'),_0x12a7d9['uniqueid'],_0x6aba('0xb2'),_0x2de430[_0x6aba('0x27')],'originated:\x20',_0x2de430[_0x6aba('0x4f')]);}if(_0x346d05!=='ANSWER'){delete this[_0x6aba('0x13')][_0x59567f['linkedid']];delete this['actions'][_0x59567f[_0x6aba('0xee')]];}}};Preview[_0x6aba('0xb')]['callProgressDetectingAgent']=function(_0x21b17b,_0x3063d0,_0x18cec6){if(_['isUndefined'](_0x3063d0)&&_0x6aba('0xef')!==typeof _0x3063d0){return;}if(_[_0x6aba('0xf0')](_0x18cec6)&&_0x6aba('0xef')!==typeof _0x18cec6){return;}switch(_0x18cec6[_0x6aba('0xf1')]){case'0':ut[_0x6aba('0xf2')](_0x21b17b,0x0,_0x6aba('0xa2'));rpcDb[_0x6aba('0xf3')](_0x21b17b,_0x6aba('0xf4'));break;case'3':ut[_0x6aba('0xf2')](_0x21b17b,0x3,_0x6aba('0xc9'));rpcDb[_0x6aba('0xf3')](_0x21b17b,_0x6aba('0xf5'));break;case'5':ut['logAgent'](_0x21b17b,0x5,_0x6aba('0xf6'));rpcDb[_0x6aba('0xf3')](_0x21b17b,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x6aba('0xf2')](_0x21b17b,0x8,_0x6aba('0xf7'));rpcDb[_0x6aba('0xf3')](_0x21b17b,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x21b17b,0x16,_0x6aba('0xf8'));rpcDb[_0x6aba('0xf3')](_0x21b17b,_0x6aba('0xf9'));break;default:ut[_0x6aba('0xf2')](_0x21b17b,0xc,_0x18cec6[_0x6aba('0xf1')]);rpcDb[_0x6aba('0xf3')](_0x21b17b,_0x6aba('0xfa'));}ut[_0x6aba('0x78')](_0x3063d0,_0x6aba('0xfb'));logger[_0x6aba('0x6b')](_0x6aba('0xfc'),_0x21b17b[_0x6aba('0xb1')],_0x6aba('0xb2'),_0x3063d0['name'],_0x6aba('0x6f'),_0x3063d0[_0x6aba('0x4f')]);delete this[_0x6aba('0x13')][_0x21b17b['uniqueid']];};Preview['prototype']['checkInBlack']=function(_0x2c238b,_0x43a4a6,_0x3e2521,_0x2b3afb,_0x1d7add){var _0x4f34a5=this;return new BPromise(function(_0x5cb70f,_0x175b45){if(_['isNil'](_0x43a4a6)||_[_0x6aba('0x81')](_0x43a4a6['Contact'])||_[_0x6aba('0x81')](_0x43a4a6[_0x6aba('0xfd')]['phone'])||_['isNil'](_0x43a4a6[_0x6aba('0x74')])){_0x175b45(ut[_0x6aba('0x60')](_0x6aba('0xfe'),_0x2b3afb,_0x1d7add));return;}var _0x3895a6=uuid['v4']();var _0x47dfe6=_0x4f34a5[_0x6aba('0x10')][_0x43a4a6[_0x6aba('0x6d')]['name']];var _0x162073=_0x3e2521?_0x4f34a5[_0x6aba('0x14')][_0x3e2521]['id']:undefined;_0x4f34a5[_0x6aba('0x13')][_0x3895a6]=new Action(_0x43a4a6,_0x47dfe6,_0x3895a6,_0x3e2521,_0x162073);var _0x43574d=_0x4f34a5[_0x6aba('0x13')][_0x3895a6];_0x43574d[_0x6aba('0xc7')]=_0x2b3afb;_0x43574d[_0x6aba('0xac')]=_0x1d7add;_0x43574d[_0x6aba('0xff')]=_0x3e2521;if(_['isEmpty'](_0x2c238b)){_0x4f34a5[_0x6aba('0x100')](_0x43574d,_0x47dfe6,_0x43a4a6,_0x3e2521)[_0x6aba('0x80')](function(_0x2e68ed){logger[_0x6aba('0x6b')]('[Preview][execCall][success]',_0x6aba('0x101')+_0x43574d[_0x6aba('0x6e')]+'\x20IdHopper:\x20'+_0x43574d['idContact'],JSON[_0x6aba('0x57')](_0x2e68ed));ami[_0x6aba('0x25')](_0x6aba('0x102'),ut[_0x6aba('0xa4')](_0x43574d,_0x6aba('0x103'),_0x4f34a5[_0x6aba('0x10')][_0x43574d[_0x6aba('0x6e')]]));_0x5cb70f(ut[_0x6aba('0x60')]('Calling'));})['catch'](function(_0x1bc11c){ut[_0x6aba('0x62')](_0x6aba('0x104'),_0x1bc11c);_0x175b45(ut['message'](_0x6aba('0x105'),_0x2b3afb,_0x1d7add));});}else{_0x47dfe6[_0x6aba('0x3c')]+=0x1;ut[_0x6aba('0x106')](_0x43574d);rpcDb[_0x6aba('0x107')](_0x43574d,'[Blacklist][error]');delete _0x4f34a5[_0x6aba('0x13')][_0x3895a6];_0x175b45(ut[_0x6aba('0x60')](_0x6aba('0x108'),_0x2b3afb,_0x1d7add));}});};Preview[_0x6aba('0xb')][_0x6aba('0x9b')]=function(_0x3f0971){return!_['isNil'](_0x3f0971)&&!_[_0x6aba('0x81')](_0x3f0971['name'])&&!_[_0x6aba('0x81')](_0x3f0971['active'])&&_0x3f0971[_0x6aba('0x109')]&&!_[_0x6aba('0x81')](this[_0x6aba('0x12')][util[_0x6aba('0x59')](_0x6aba('0x10a'),_0x3f0971[_0x6aba('0x27')])])&&!_[_0x6aba('0x81')](this[_0x6aba('0x12')][util[_0x6aba('0x59')](_0x6aba('0x10a'),_0x3f0971[_0x6aba('0x27')])]['status'])&&(this[_0x6aba('0x12')][util[_0x6aba('0x59')](_0x6aba('0x10a'),_0x3f0971[_0x6aba('0x27')])][_0x6aba('0x10b')]==='reachable'||this['trunks'][util[_0x6aba('0x59')](_0x6aba('0x10a'),_0x3f0971[_0x6aba('0x27')])][_0x6aba('0x10b')]===_0x6aba('0x10c'));};Preview[_0x6aba('0xb')][_0x6aba('0x87')]=function(_0x4c941d,_0x63aff){var _0x45d923=this;return new BPromise(function(_0x4634ef,_0xc788f){_0x45d923[_0x6aba('0x10d')](_0x4c941d,_0x63aff)[_0x6aba('0x80')](function(_0xf16575){_0x4634ef(_[_0x6aba('0x72')](_0xf16575,[_0x6aba('0x60')]));})[_0x6aba('0x8a')](function(_0xe58f47){if(_0xe58f47[_0x6aba('0x10e')]){rpcDb[_0x6aba('0x10f')](_0x4c941d);}if(_0xe58f47[_0x6aba('0x109')]){rpcDb[_0x6aba('0x8b')](_0x4c941d);}_0xc788f(_[_0x6aba('0x72')](_0xe58f47,[_0x6aba('0x60')]));});});};Preview[_0x6aba('0xb')][_0x6aba('0x10d')]=function(_0x17999b,_0x19e667){var _0x5d770b=this;return new BPromise(function(_0x558567,_0x4cc914){var _0x21f712,_0x312038;rpcDb[_0x6aba('0x110')](_0x17999b)['then'](function(_0x5e6ce2){if(!_['isNil'](_0x5e6ce2[0x0])){_0x312038=_0x5e6ce2[0x0][_0x6aba('0x111')]?![]:!![];_0x21f712=_0x5e6ce2[0x0][_0x6aba('0x111')]?!![]:![];_0x21f712=_0x19e667?!![]:_0x21f712;}var _0x178b10=_0x5d770b[_0x6aba('0x112')](_0x5e6ce2);if(_0x178b10[_0x6aba('0x113')]){rpcDb[_0x6aba('0x114')](_[_0x6aba('0x72')](_0x5e6ce2[0x0],['VoiceQueueId','Contact.phone']))[_0x6aba('0x80')](function(_0x257d1a){_0x5d770b[_0x6aba('0x115')](_0x257d1a,_0x5e6ce2[0x0],_0x19e667,_0x312038,_0x21f712)[_0x6aba('0x80')](function(_0x174874){_0x558567(_0x174874);})['catch'](function(_0x319d62){_0x4cc914(_0x319d62);});})[_0x6aba('0x8a')](function(_0xb73c68){ut[_0x6aba('0x62')](_0x6aba('0x116'),_0xb73c68);_0x4cc914(ut[_0x6aba('0x60')]('Call\x20unsuccessful',_0x312038,_0x21f712));});}else{_0x4cc914(ut['message'](_0x178b10[_0x6aba('0x60')],_0x312038,_0x21f712));}})[_0x6aba('0x8a')](function(_0x59d4f1){ut[_0x6aba('0x62')]('[Preview][getContactPreview]',_0x59d4f1);_0x4cc914(ut[_0x6aba('0x60')](_0x6aba('0x117'),![],!![]));});});};Preview[_0x6aba('0xb')][_0x6aba('0x112')]=function(_0x53594f){if(_['isNil'](_0x53594f)||_[_0x6aba('0x118')](_0x53594f)||!_[_0x6aba('0x81')](_0x53594f[0x0][_0x6aba('0x85')])&&_['isNil'](_0x53594f[0x0][_0x6aba('0x85')][_0x6aba('0x27')])){ut[_0x6aba('0x62')](_0x6aba('0x119'),_0x53594f);return{'isValid':![],'message':_0x6aba('0x11a')};}var _0x3ce42b=this['campaignsPreview'][_0x53594f[0x0]['Queue']['name']];_0x3ce42b['message']='ACTIVE';if(_[_0x6aba('0x81')](_0x3ce42b)){ut[_0x6aba('0x62')](_0x6aba('0x11b'),_0x3ce42b);return{'isValid':![],'message':_0x6aba('0x11c')};}if(!this[_0x6aba('0x9b')](_0x3ce42b['Trunk'])){ut['logger'](_0x6aba('0x11d'),_0x6aba('0x11e')+_0x3ce42b[_0x6aba('0x27')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x6aba('0x9b')](_0x3ce42b[_0x6aba('0x11f')])){ut['logger'](_0x6aba('0x11d'),_0x3ce42b[_0x6aba('0x27')]+_0x6aba('0x120'));return{'isValid':![],'message':_0x6aba('0x121')};}}if(!ut[_0x6aba('0x9a')](_0x3ce42b['dialActive'])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x3ce42b[_0x6aba('0x27')]+_0x6aba('0x122'));return{'isValid':![],'message':_0x6aba('0x11e')+_0x3ce42b[_0x6aba('0x27')]+_0x6aba('0x122')};}return{'isValid':!![],'message':_0x6aba('0x123')};};Preview[_0x6aba('0xb')][_0x6aba('0x100')]=function(_0x1d8842,_0x508dd9,_0x13ef19,_0x34e43e){var _0x533aef=this;return new BPromise(function(_0x34035b,_0x292e07){var _0x31ff0f=_0x1d8842[_0x6aba('0xb1')];var _0x4e3202=_0x533aef['isTrunkReachable'](_0x508dd9[_0x6aba('0x54')])?util[_0x6aba('0x59')]('SIP/%s/%s%s',_0x508dd9[_0x6aba('0x54')]['name'],_[_0x6aba('0x81')](_0x508dd9[_0x6aba('0x39')])?'':_0x508dd9[_0x6aba('0x39')][_0x6aba('0x124')]()||'',_0x508dd9['dialCutDigit']>0x0?_0x13ef19[_0x6aba('0xfd')][_0x6aba('0x125')][_0x6aba('0x126')](_0x508dd9[_0x6aba('0x127')]):_0x13ef19[_0x6aba('0xfd')]['phone']):util[_0x6aba('0x59')]('SIP/%s/%s%s',_[_0x6aba('0x81')](_0x508dd9[_0x6aba('0x11f')])?_0x508dd9['Trunk']['name']:_0x508dd9['TrunkBackup'][_0x6aba('0x27')],_['isNil'](_0x508dd9[_0x6aba('0x39')])?'':_0x508dd9[_0x6aba('0x39')][_0x6aba('0x124')]()||'',_0x508dd9['dialCutDigit']>0x0?_0x13ef19[_0x6aba('0xfd')][_0x6aba('0x125')][_0x6aba('0x126')](_0x508dd9[_0x6aba('0x127')]):_0x13ef19[_0x6aba('0xfd')]['phone']);var _0x5ca17f=_0x533aef['isTrunkReachable'](_0x508dd9['Trunk'])?ut[_0x6aba('0x128')](_0x508dd9[_0x6aba('0x54')]['callerid'],_0x508dd9['dialOriginateCallerIdName'],_0x508dd9[_0x6aba('0x129')]>0x0?ut[_0x6aba('0x12a')](_0x508dd9[_0x6aba('0x38')],_0x508dd9[_0x6aba('0x129')]):_0x508dd9[_0x6aba('0x38')]):ut[_0x6aba('0x128')](_[_0x6aba('0x81')](_0x508dd9[_0x6aba('0x11f')])?_0x508dd9[_0x6aba('0x54')][_0x6aba('0x55')]:_0x508dd9[_0x6aba('0x11f')][_0x6aba('0x55')],_0x508dd9[_0x6aba('0x12b')],_0x508dd9['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x6aba('0x12a')](_0x508dd9[_0x6aba('0x38')],_0x508dd9[_0x6aba('0x129')]):_0x508dd9['dialOriginateCallerIdNumber']);if(_0x5ca17f){_0x1d8842[_0x6aba('0x12c')]=ut[_0x6aba('0x12d')](_0x5ca17f);_0x1d8842[_0x6aba('0x12e')]=ut[_0x6aba('0x12f')](_0x5ca17f);}var _0x1b6aa0=ut[_0x6aba('0x130')](_0x508dd9,_0x13ef19,_0x4e3202,_0x5ca17f,_0x31ff0f,_0x1d8842);_[_0x6aba('0x131')](_0x1d8842,ut[_0x6aba('0x132')](_0x1b6aa0));_0x1d8842[_0x6aba('0x8c')]=moment()[_0x6aba('0x59')](_0x6aba('0x8d'));ami[_0x6aba('0x76')](ut[_0x6aba('0x133')](_0x1d8842,_0x508dd9,_0x1b6aa0,_0x1d8842[_0x6aba('0xac')],_0x34e43e))[_0x6aba('0x80')](function(_0x47cc81){_0x508dd9[_0x6aba('0x4f')]+=0x1;logger[_0x6aba('0x6b')](_0x6aba('0x134'),_0x31ff0f,_0x6aba('0xb2'),_0x508dd9['name'],'originated:\x20',_0x508dd9[_0x6aba('0x4f')]);_0x34035b(_0x47cc81);})[_0x6aba('0x8a')](function(_0x8a67a6){ut['logAgent'](_0x1d8842,0xe,_0x6aba('0x135'));rpcDb[_0x6aba('0xf3')](_0x1d8842,_0x6aba('0x136'));_0x292e07(_0x8a67a6);});});};Preview[_0x6aba('0xb')][_0x6aba('0x1f')]=function(_0x436d62){if(this[_0x6aba('0x13')][_0x436d62[_0x6aba('0xad')]]){this[_0x6aba('0x13')][_0x436d62[_0x6aba('0xad')]]['channel']=_0x436d62['channel'];}};Preview[_0x6aba('0xb')][_0x6aba('0x17')]=function(_0x100207){var _0x4e107d=this;var _0x166e2e=this['actions'][_0x100207[_0x6aba('0x137')]];if(_0x166e2e){if(_0x166e2e[_0x6aba('0xff')]&&this[_0x6aba('0x14')][_0x166e2e[_0x6aba('0xff')]]){ut['logLookAgent'](_0x166e2e,this[_0x6aba('0x14')][_0x166e2e[_0x6aba('0xff')]]['name'],this[_0x6aba('0x14')][_0x166e2e['lookAgent']]['id']);}var _0x43fa08=_[_0x6aba('0x138')](_0x166e2e);_0x43fa08[_0x6aba('0xaf')]=moment()[_0x6aba('0x59')](_0x6aba('0x8d'));var _0x3961cf=_0x4e107d[_0x6aba('0x10')][_0x166e2e[_0x6aba('0x6e')]];if(ut['isFailure'](_0x100207['response'])){if(_0x166e2e[_0x6aba('0xc7')]){rpcDb['unlockContact'](_0x166e2e[_0x6aba('0x139')]);}if(_0x166e2e[_0x6aba('0xac')]){rpcDb[_0x6aba('0x8b')](_0x166e2e[_0x6aba('0x139')]);}ami[_0x6aba('0x25')](_0x6aba('0x13a'),ut[_0x6aba('0xa4')](_0x166e2e,_0x6aba('0x13b'),this[_0x6aba('0x10')][_0x166e2e[_0x6aba('0x6e')]]));this[_0x6aba('0x13c')](_0x43fa08,_0x3961cf,_0x100207);}else{_0x166e2e[_0x6aba('0x8c')]=moment()[_0x6aba('0x59')](_0x6aba('0x8d'));ut[_0x6aba('0xf2')](_0x43fa08,0x4,_0x6aba('0xb8'));rpcDb[_0x6aba('0xf3')](_0x43fa08,_0x6aba('0x13d'));}}};Preview[_0x6aba('0xb')][_0x6aba('0x19')]=function(_0x2a6853){var _0x18ae23=this;var _0x5200cd=this[_0x6aba('0x13')][_0x2a6853[_0x6aba('0xad')]];var _0x2c8212;if(_0x5200cd){_0x2c8212=this[_0x6aba('0x10')][_0x5200cd['queue']];logger[_0x6aba('0x6b')]('[syncHangup][talking]',_0x2a6853['linkedid'],_0x6aba('0xb2'),_0x2c8212[_0x6aba('0x27')],_0x6aba('0x70'),_0x2c8212[_0x6aba('0x2c')]);}if(this[_0x6aba('0x13')][_0x2a6853[_0x6aba('0xad')]]&&_0x2a6853[_0x6aba('0xad')]!==_0x2a6853[_0x6aba('0xb1')]){if(_0x2a6853[_0x6aba('0x13e')]==='16'&&this[_0x6aba('0x13')][_0x2a6853['linkedid']][_0x6aba('0x71')]){this[_0x6aba('0x9e')](_0x2a6853,_0x2a6853[_0x6aba('0xad')],_0x2a6853[_0x6aba('0x13e')]);}else if(this[_0x6aba('0x13')][_0x2a6853['linkedid']][_0x6aba('0x71')]){logger[_0x6aba('0x6b')](_0x6aba('0x13f'),_0x2a6853[_0x6aba('0xad')],_0x2a6853[_0x6aba('0x13e')],'\x20Queue',_0x2c8212[_0x6aba('0x27')],'pTalking:\x20',_0x2c8212[_0x6aba('0x2c')]);this[_0x6aba('0x9e')](_0x2a6853,_0x2a6853[_0x6aba('0xad')],_0x2a6853[_0x6aba('0x13e')]);}}else if(_0x5200cd&&_[_0x6aba('0x81')](_0x5200cd['statedesc'])&&_0x2c8212[_0x6aba('0x140')]&&_0x2a6853['linkedid']===_0x2a6853[_0x6aba('0xb1')]&&_[_0x6aba('0x81')](_0x2a6853['reason'])&&_0x2a6853[_0x6aba('0x13e')]==='16'&&_0x2a6853[_0x6aba('0x141')]==='6'&&_[_0x6aba('0xf0')](_0x5200cd[_0x6aba('0x142')])){if(_0x5200cd[_0x6aba('0xc7')]){rpcDb[_0x6aba('0x10f')](_0x5200cd[_0x6aba('0x139')]);}if(_0x5200cd[_0x6aba('0xac')]){rpcDb['disableContact'](_0x5200cd[_0x6aba('0x139')]);}_0x2a6853[_0x6aba('0xf1')]='22';this[_0x6aba('0x13c')](_0x5200cd,_0x2c8212,_0x2a6853);}else if(_0x5200cd&&_0x5200cd[_0x6aba('0x142')]){if(_0x2a6853[_0x6aba('0x13e')]==='16'&&this['actions'][_0x2a6853['linkedid']]['dialAnswer']){logger[_0x6aba('0x6b')](_0x6aba('0x143'),_0x2a6853[_0x6aba('0xad')],_0x2a6853[_0x6aba('0x13e')],_0x6aba('0xb2'),_0x2c8212[_0x6aba('0x27')],_0x6aba('0x70'),_0x2c8212[_0x6aba('0x2c')]);this['callProgressDetectingCustomer'](_0x2a6853,_0x2a6853[_0x6aba('0xad')],_0x2a6853[_0x6aba('0x13e')]);}else if(this[_0x6aba('0x13')][_0x2a6853[_0x6aba('0xad')]][_0x6aba('0x71')]){logger[_0x6aba('0x6b')]('[syncHangup][talking][cause]',_0x2a6853[_0x6aba('0xad')],_0x2a6853[_0x6aba('0x13e')],_0x6aba('0xb2'),_0x2c8212[_0x6aba('0x27')],_0x6aba('0x70'),_0x2c8212['pTalking']);this[_0x6aba('0x9e')](_0x2a6853,_0x2a6853[_0x6aba('0xad')],_0x2a6853[_0x6aba('0x13e')]);}}};Preview[_0x6aba('0xb')][_0x6aba('0x1d')]=function(_0x1fc668){if(this[_0x6aba('0x13')][_0x1fc668[_0x6aba('0xee')]]&&_0x1fc668[_0x6aba('0xee')]!==_0x1fc668['destuniqueid']){this[_0x6aba('0x9e')](_0x1fc668,_0x1fc668[_0x6aba('0xee')],_0x1fc668[_0x6aba('0xe6')]);}};Preview[_0x6aba('0xb')][_0x6aba('0x1b')]=function(_0x40843e){if(this[_0x6aba('0x13')][_0x40843e['linkedid']]&&_0x40843e[_0x6aba('0xad')]!==_0x40843e[_0x6aba('0xb1')]&&!this[_0x6aba('0x13')][_0x40843e['linkedid']]['dialAnswer']){if(_0x40843e[_0x6aba('0x13e')]==='1'){this[_0x6aba('0x9e')](_0x40843e,_0x40843e['linkedid'],_0x40843e[_0x6aba('0x13e')]);}}};Preview[_0x6aba('0xb')][_0x6aba('0x144')]=function(_0x5a9e80,_0xecfb67,_0x29fe2f){if(this[_0x6aba('0x13')][_0x5a9e80]){if(_['isNil'](this[_0x6aba('0x13')][_0x5a9e80]['variables'])){this['actions'][_0x5a9e80][_0x6aba('0x145')]={};}this['actions'][_0x5a9e80][_0x6aba('0x145')][_0xecfb67]=_0x29fe2f;}};Preview[_0x6aba('0xb')][_0x6aba('0x21')]=function(_0x1ace81){try{if(!_[_0x6aba('0x81')](_0x1ace81)){if(ut[_0x6aba('0x146')](_['keys'](_0x1ace81[_0x6aba('0x147')])[0x0])){this['addVariable'](_0x1ace81[_0x6aba('0xb1')],_[_0x6aba('0x148')](_0x1ace81['variable'])[0x0],_0x1ace81[_0x6aba('0x149')]);}}}catch(_0x4cac61){logger[_0x6aba('0x14a')](_0x6aba('0x14b'),util[_0x6aba('0x14c')](_0x4cac61,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x1bb521){if(_0x1bb521){if(this[_0x6aba('0x13')][_0x1bb521['transfertargetlinkedid']]){this[_0x6aba('0x13')][_0x1bb521[_0x6aba('0x14d')]][_0x6aba('0x142')]=!![];}}};Preview[_0x6aba('0xb')][_0x6aba('0x23')]=function(_0x13c229){if(_0x13c229){if(this[_0x6aba('0x13')][_0x13c229[_0x6aba('0x14e')]]){this['actions'][_0x13c229[_0x6aba('0x14e')]]['transfer']=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 20a40ee..567e8e1 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 _0xdb31=['lastAssignedTo','membername','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','then','createHistory','catch','[createHistory]\x20','resolve','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','endtime','context','exten','xcally-motion-preview','holdtime','assigned'];(function(_0x163cb0,_0x304949){var _0x30cc1b=function(_0x162f19){while(--_0x162f19){_0x163cb0['push'](_0x163cb0['shift']());}};_0x30cc1b(++_0x304949);}(_0xdb31,0x16d));var _0x1db3=function(_0x32e264,_0x41cee8){_0x32e264=_0x32e264-0x0;var _0x1d7175=_0xdb31[_0x32e264];return _0x1d7175;};'use strict';var util=require(_0x1db3('0x0'));var BPromise=require(_0x1db3('0x1'));var logger=require('../../../config/logger')(_0x1db3('0x2'));var _=require(_0x1db3('0x3'));var cmHopper=require(_0x1db3('0x4'));var cmHopperFinal=require(_0x1db3('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x1db3('0x6'));var agentReportPreview=require(_0x1db3('0x7'));var voiceQueueReport=require(_0x1db3('0x8'));function loggerCatch(_0x4a8685){return function(_0x513c08){logger[_0x1db3('0x9')](_0x4a8685,util['inspect'](_0x513c08,{'showHidden':![],'depth':null}));};}function create(_0x378175){return BPromise['resolve']()[_0x1db3('0xa')](cmHopperHistory[_0x1db3('0xb')](_0x378175))[_0x1db3('0xc')](loggerCatch(_0x1db3('0xd')));}function createAgent(_0x2bf0a8){return BPromise[_0x1db3('0xe')]()['then'](agentReportPreview[_0x1db3('0xb')](_0x2bf0a8))[_0x1db3('0xc')](loggerCatch(_0x1db3('0xd')));}function moveContact(_0x2b445f){return BPromise[_0x1db3('0xe')]()[_0x1db3('0xa')](cmHopper['moveContactManagedDialer'](_0x2b445f,!![]))[_0x1db3('0xc')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x1db3('0xf')]=function(_0x20820e){return BPromise[_0x1db3('0xe')]()[_0x1db3('0xa')](cmHopperBlack[_0x1db3('0xf')](_0x20820e))[_0x1db3('0xc')](loggerCatch(_0x1db3('0x10')));};exports[_0x1db3('0x11')]=function(_0x1d7920){return BPromise[_0x1db3('0xe')]()['then'](cmHopper['getContactPreview'](_0x1d7920))[_0x1db3('0xc')](loggerCatch(_0x1db3('0x12')));};exports['createHistory']=function(_0x4ef718,_0x51f29d){create(_0x4ef718)[_0x1db3('0xc')](loggerCatch(_0x51f29d));moveContact(_0x4ef718)['catch'](loggerCatch(_0x51f29d));};exports[_0x1db3('0x13')]=function(_0x4a2556,_0x43058e){createAgent(_0x4a2556)['catch'](loggerCatch(_0x43058e));};exports[_0x1db3('0x14')]=function(_0x36eea7,_0x21dc76){create(_0x36eea7)[_0x1db3('0xc')](loggerCatch(_0x21dc76));};exports[_0x1db3('0x15')]=function(_0x4a2bc6,_0x1668a5){moveContact(_0x4a2bc6)['catch'](loggerCatch(_0x1668a5));};exports['rescheduleContact']=function(_0x2dad8d,_0x396943,_0x11ce8c){if(_0x396943){_0x2dad8d['UserId']=null;}if(_0x11ce8c){_0x2dad8d[_0x1db3('0x16')]=![];}return BPromise['resolve']()[_0x1db3('0xa')](cmHopper[_0x1db3('0x17')](_0x2dad8d))[_0x1db3('0xc')](loggerCatch(_0x1db3('0x18')));};exports[_0x1db3('0x19')]=function(_0x2a05cd){return BPromise[_0x1db3('0xe')]()[_0x1db3('0xa')](cmHopper[_0x1db3('0x19')](_0x2a05cd))[_0x1db3('0xc')](loggerCatch(_0x1db3('0x1a')));};exports[_0x1db3('0x1b')]=function(_0x45d429){return BPromise[_0x1db3('0xe')]()[_0x1db3('0xa')](cmHopper[_0x1db3('0x1b')]({'UserId':null},_0x45d429,0x1))[_0x1db3('0xc')](loggerCatch(_0x1db3('0x1c')));};exports['disableContact']=function(_0x28b5d9){return BPromise['resolve']()[_0x1db3('0xa')](cmHopper['unlockContact']({'active':![]},_0x28b5d9,0x1))[_0x1db3('0xc')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x4cb5f5){var _0x57c359={};_0x57c359[_0x1db3('0x1d')]=_0x4cb5f5[_0x1db3('0x1d')];_0x57c359[_0x1db3('0x1e')]=_0x4cb5f5[_0x1db3('0x1e')];_0x57c359[_0x1db3('0x1f')]=_0x4cb5f5['calleridnum'];_0x57c359[_0x1db3('0x20')]=_0x4cb5f5['calleridname'];_0x57c359[_0x1db3('0x21')]=_0x4cb5f5[_0x1db3('0x21')];_0x57c359[_0x1db3('0x22')]=_0x4cb5f5[_0x1db3('0x23')];_0x57c359[_0x1db3('0x24')]=_0x4cb5f5[_0x1db3('0x23')];_0x57c359['queuecallercomplete']=0x1;_0x57c359['queuecallercompleteAt']=_0x4cb5f5[_0x1db3('0x25')];_0x57c359['connectedlinename']=_0x4cb5f5['membername'];_0x57c359[_0x1db3('0x26')]='from-sip';_0x57c359[_0x1db3('0x27')]=_0x1db3('0x28');_0x57c359[_0x1db3('0x29')]=0x0;_0x57c359[_0x1db3('0x2a')]=0x1;_0x57c359[_0x1db3('0x2b')]=_0x4cb5f5[_0x1db3('0x2c')];_0x57c359[_0x1db3('0x2d')]=_0x1db3('0x2e');return BPromise[_0x1db3('0xe')]()['then'](voiceQueueReport['create'](_0x57c359))[_0x1db3('0xc')](loggerCatch(_0x1db3('0x2f')));};exports['getContactRecallMe']=function(_0x5c46e2,_0x162903){return BPromise[_0x1db3('0xe')]()[_0x1db3('0xa')](cmHopper[_0x1db3('0x30')](_0x5c46e2,_0x162903))[_0x1db3('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x1db3('0x31')]=function(_0x10e291){return BPromise[_0x1db3('0xe')]()['then'](cmHopper[_0x1db3('0x17')](_0x10e291,!![],!![]))[_0x1db3('0xc')](loggerCatch(_0x1db3('0x32')));}; \ No newline at end of file +var _0xd82a=['type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','inspect','then','createHistory','catch','resolve','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue'];(function(_0x177cc9,_0x3f6fdd){var _0x2fe577=function(_0xa98e83){while(--_0xa98e83){_0x177cc9['push'](_0x177cc9['shift']());}};_0x2fe577(++_0x3f6fdd);}(_0xd82a,0x1f1));var _0xad82=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xd82a[_0x88cd7b];return _0x56fcc8;};'use strict';var util=require(_0xad82('0x0'));var BPromise=require('bluebird');var logger=require(_0xad82('0x1'))(_0xad82('0x2'));var _=require(_0xad82('0x3'));var cmHopper=require(_0xad82('0x4'));var cmHopperFinal=require(_0xad82('0x5'));var cmHopperHistory=require(_0xad82('0x6'));var cmHopperBlack=require(_0xad82('0x7'));var voiceQueueRt=require(_0xad82('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xad82('0x9'));function loggerCatch(_0x41e172){return function(_0x370bb9){logger['error'](_0x41e172,util[_0xad82('0xa')](_0x370bb9,{'showHidden':![],'depth':null}));};}function create(_0x30dbe2){return BPromise['resolve']()[_0xad82('0xb')](cmHopperHistory[_0xad82('0xc')](_0x30dbe2))[_0xad82('0xd')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x208d57){return BPromise[_0xad82('0xe')]()[_0xad82('0xb')](agentReportPreview[_0xad82('0xc')](_0x208d57))[_0xad82('0xd')](loggerCatch(_0xad82('0xf')));}function moveContact(_0x17550f){return BPromise[_0xad82('0xe')]()[_0xad82('0xb')](cmHopper['moveContactManagedDialer'](_0x17550f,!![]))[_0xad82('0xd')](loggerCatch(_0xad82('0x10')));}exports[_0xad82('0x11')]=function(_0x8c344e){return BPromise[_0xad82('0xe')]()[_0xad82('0xb')](cmHopperBlack[_0xad82('0x11')](_0x8c344e))[_0xad82('0xd')](loggerCatch(_0xad82('0x12')));};exports[_0xad82('0x13')]=function(_0x3439e8){return BPromise[_0xad82('0xe')]()[_0xad82('0xb')](cmHopper['getContactPreview'](_0x3439e8))[_0xad82('0xd')](loggerCatch(_0xad82('0x14')));};exports[_0xad82('0xc')]=function(_0x17ef35,_0x2555b9){create(_0x17ef35)[_0xad82('0xd')](loggerCatch(_0x2555b9));moveContact(_0x17ef35)['catch'](loggerCatch(_0x2555b9));};exports[_0xad82('0x15')]=function(_0x2f826a,_0x3d78a9){createAgent(_0x2f826a)[_0xad82('0xd')](loggerCatch(_0x3d78a9));};exports[_0xad82('0x16')]=function(_0x4f3aa5,_0x5875d5){create(_0x4f3aa5)[_0xad82('0xd')](loggerCatch(_0x5875d5));};exports[_0xad82('0x17')]=function(_0x17006e,_0x4228fd){moveContact(_0x17006e)['catch'](loggerCatch(_0x4228fd));};exports[_0xad82('0x18')]=function(_0x2bc906,_0x19097c,_0x29102d){if(_0x19097c){_0x2bc906[_0xad82('0x19')]=null;}if(_0x29102d){_0x2bc906[_0xad82('0x1a')]=![];}return BPromise['resolve']()[_0xad82('0xb')](cmHopper[_0xad82('0x18')](_0x2bc906))[_0xad82('0xd')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xad82('0x1b')]=function(_0x35e1f4){return BPromise[_0xad82('0xe')]()['then'](cmHopper[_0xad82('0x1b')](_0x35e1f4))[_0xad82('0xd')](loggerCatch(_0xad82('0x1c')));};exports[_0xad82('0x1d')]=function(_0x4488cf){return BPromise[_0xad82('0xe')]()[_0xad82('0xb')](cmHopper[_0xad82('0x1d')]({'UserId':null},_0x4488cf,0x1))[_0xad82('0xd')](loggerCatch(_0xad82('0x1e')));};exports[_0xad82('0x1f')]=function(_0xd1f2fa){return BPromise['resolve']()[_0xad82('0xb')](cmHopper['unlockContact']({'active':![]},_0xd1f2fa,0x1))[_0xad82('0xd')](loggerCatch(_0xad82('0x20')));};exports[_0xad82('0x21')]=function(_0x46878f){var _0xbd3131={};_0xbd3131[_0xad82('0x22')]=_0x46878f['type'];_0xbd3131[_0xad82('0x23')]=_0x46878f[_0xad82('0x23')];_0xbd3131[_0xad82('0x24')]=_0x46878f[_0xad82('0x24')];_0xbd3131[_0xad82('0x25')]=_0x46878f[_0xad82('0x25')];_0xbd3131[_0xad82('0x26')]=_0x46878f[_0xad82('0x26')];_0xbd3131['queuecallerjoinAt']=_0x46878f[_0xad82('0x27')];_0xbd3131[_0xad82('0x28')]=_0x46878f[_0xad82('0x27')];_0xbd3131[_0xad82('0x29')]=0x1;_0xbd3131[_0xad82('0x2a')]=_0x46878f[_0xad82('0x2b')];_0xbd3131[_0xad82('0x2c')]=_0x46878f[_0xad82('0x2d')];_0xbd3131[_0xad82('0x2e')]=_0xad82('0x2f');_0xbd3131[_0xad82('0x30')]=_0xad82('0x31');_0xbd3131[_0xad82('0x32')]=0x0;_0xbd3131[_0xad82('0x33')]=0x1;_0xbd3131['lastAssignedTo']=_0x46878f['membername'];_0xbd3131[_0xad82('0x34')]=_0xad82('0x35');return BPromise[_0xad82('0xe')]()[_0xad82('0xb')](voiceQueueReport[_0xad82('0x36')](_0xbd3131))['catch'](loggerCatch(_0xad82('0x37')));};exports[_0xad82('0x38')]=function(_0x46d3df,_0x3b746a){return BPromise['resolve']()['then'](cmHopper[_0xad82('0x38')](_0x46d3df,_0x3b746a))[_0xad82('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xad82('0x39')]=function(_0xdbedd7){return BPromise[_0xad82('0xe')]()[_0xad82('0xb')](cmHopper['rescheduleContact'](_0xdbedd7,!![],!![]))[_0xad82('0xd')](loggerCatch(_0xad82('0x3a')));}; \ 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 c67eb93..917b49b 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 _0x9bc4=['isNil','addVariables','Queue','name','\x22%s\x22\x20<%s>','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','%s%s','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','endtime','talktime','answertime','isFailure','variablesAction','calleridname','BOOKED','originate','channelAgent','from-sip','timeout','uniqueid','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','statedesc','Global','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','agentReadyId','not_inuse','status','push','getDiff','createBody','CampaignId','idContact','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','lodash','moment','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','loggerError','logger2','info','message','isUndefined','string','isEmpty','format','\x22\x22\x20<>','isActive'];(function(_0x70ad66,_0x8dce7f){var _0x45585d=function(_0x343348){while(--_0x343348){_0x70ad66['push'](_0x70ad66['shift']());}};_0x45585d(++_0x8dce7f);}(_0x9bc4,0xf9));var _0x49bc=function(_0x394892,_0x5c7ee3){_0x394892=_0x394892-0x0;var _0x4e9f53=_0x9bc4[_0x394892];return _0x4e9f53;};'use strict';var util=require('util');var _=require(_0x49bc('0x0'));var moment=require(_0x49bc('0x1'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0x49bc('0x2')][_0x49bc('0x3')]||'127.0.0.1';function getSeconds(_0xb52a53,_0x70dbe7){var _0x59a82d=moment(_0xb52a53)[_0x49bc('0x4')](0x0);var _0x1e0725=moment(_0x70dbe7)[_0x49bc('0x4')](0x0);return _0x59a82d[_0x49bc('0x5')](_0x1e0725,_0x49bc('0x6'));}exports[_0x49bc('0x7')]=function(_0x1d032f){return function(_0x238753){logger[_0x49bc('0x8')](_0x1d032f,util[_0x49bc('0x9')](_0x238753,{'showHidden':![],'depth':null}));};};exports[_0x49bc('0xa')]=function(_0x1aad85,_0x403f25){logger['info'](_0x1aad85,util[_0x49bc('0x9')](_0x403f25,{'showHidden':![],'depth':null}));};exports[_0x49bc('0xb')]=function(_0x330ad0,_0x2e78f9){logger['error'](_0x330ad0,util[_0x49bc('0x9')](_0x2e78f9,{'showHidden':![],'depth':null}));};exports[_0x49bc('0xc')]=function(_0x538a8c){return function(_0x12a1bc){logger[_0x49bc('0xd')](_0x538a8c,util[_0x49bc('0x9')](_0x12a1bc,{'showHidden':![],'depth':null}));};};exports[_0x49bc('0xe')]=function(_0x3ad038,_0x8abb0,_0x17cf4e){return{'message':_0x3ad038,'unlock':_0x8abb0,'active':_0x17cf4e};};exports['getCallerId']=function(_0x36aa5c,_0x417b82,_0x384937){if(!_[_0x49bc('0xf')](_0x384937)&&_0x49bc('0x10')===typeof _0x384937&&!_['isEmpty'](_0x384937)){if(!_[_0x49bc('0xf')](_0x417b82)&&_0x49bc('0x10')===typeof _0x417b82&&!_[_0x49bc('0x11')](_0x417b82)){return util[_0x49bc('0x12')]('\x22%s\x22\x20<%s>',_0x417b82,_0x384937);}return util[_0x49bc('0x12')]('\x22%s\x22\x20<%s>',_0x384937,_0x384937);}if(!_[_0x49bc('0xf')](_0x36aa5c)&&'string'===typeof _0x36aa5c&&!_[_0x49bc('0x11')](_0x36aa5c)){return _0x36aa5c;}return _0x49bc('0x13');};exports[_0x49bc('0x14')]=function(_0x5cec4e){if(_[_0x49bc('0x15')](_0x5cec4e)){return![];}return _0x5cec4e;};exports[_0x49bc('0x16')]=function(_0x532e3a,_0x381ee3,_0x440820,_0x524fbb,_0x2ea0f8,_0x3896e7){var _0x366dbe={'XMD-QUEUE':_0x381ee3[_0x49bc('0x17')]?_0x381ee3[_0x49bc('0x17')][_0x49bc('0x18')]:'','XMD-CALLERID':_0x524fbb,'XMD-CALLERID-PREVIEW':_0x3896e7?util[_0x49bc('0x12')](_0x49bc('0x19'),_0x3896e7['calleridname'],_0x3896e7[_0x49bc('0x1a')]):_0x524fbb,'XMD-DIALID':_0x2ea0f8,'XMD-CONTACTID':_0x381ee3[_0x49bc('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x524fbb,'XMD-VOICEQUEUEID':_0x381ee3[_0x49bc('0x1c')],'XMD-DIALCHANNEL':_0x440820,'XMD-DIALTIMEOUT':_0x532e3a[_0x49bc('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x49bc('0x12')]('\x22rtTxX%s%s\x22',_0x532e3a[_0x49bc('0x1e')]?'g':'',_[_0x49bc('0x11')](_0x532e3a[_0x49bc('0x1f')])?'':_0x49bc('0x20')),'XMD-DIALURL':_0x532e3a[_0x49bc('0x21')]||'','XMD-AGI':_0x532e3a['dialQueueProject']?util[_0x49bc('0x12')](_0x49bc('0x22'),ipAgi,_0x532e3a[_0x49bc('0x23')]):_0x49bc('0x24'),'XMD-AGIAFTER':_0x532e3a['dialQueueProject2']?util[_0x49bc('0x12')](_0x49bc('0x22'),ipAgi,_0x532e3a[_0x49bc('0x1e')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x3896e7?_0x3896e7[_0x49bc('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x3896e7?_0x3896e7[_0x49bc('0x26')]:'','XMD-DESTINATION':_0x49bc('0x27'),'SIPADDHEADER':_0x49bc('0x28')};if(!_[_0x49bc('0x11')](_0x532e3a[_0x49bc('0x1f')])){_0x366dbe[util['format']('%s',_0x49bc('0x29'))]=_0x532e3a[_0x49bc('0x1f')];_0x366dbe[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x2ea0f8;}if(_0x381ee3&&_0x381ee3[_0x49bc('0x2a')]){for(var _0x5b96fb in _0x381ee3[_0x49bc('0x2a')]){if(_0x381ee3['Contact'][_0x49bc('0x2b')](_0x5b96fb)){if(!_[_0x49bc('0x15')](_0x381ee3['Contact'][_0x5b96fb])&&_0x5b96fb!=='id'&&_0x5b96fb!==_0x49bc('0x2c')&&_0x5b96fb!==_0x49bc('0x2d')&&_0x5b96fb!=='updatedAt'){_0x366dbe[util[_0x49bc('0x12')](_0x49bc('0x2e'),'XMD-',_['toUpper'](_0x5b96fb))]=_0x381ee3[_0x49bc('0x2a')][_0x5b96fb];}}}}return _0x366dbe;};exports['toLowerVariables']=function(_0x3a5be8){var _0x4b331b={};for(var _0x360dae in _0x3a5be8){if(_0x3a5be8['hasOwnProperty'](_0x360dae)){_0x4b331b[util[_0x49bc('0x12')]('%s',_[_0x49bc('0x2f')](_0x360dae))]=_0x3a5be8[_0x360dae];}}return{'variables':_0x4b331b};};exports['updateOriginated']=function(_0x5f4dc0,_0x82af1){if(!_['isNil'](_0x5f4dc0)){if(_0x5f4dc0[_0x49bc('0x2b')](_0x49bc('0x30'))){if(_0x5f4dc0['originated']>0x0){_0x5f4dc0[_0x49bc('0x30')]-=0x1;}else{logger['error'](_0x49bc('0x31'),_0x82af1);}}}else{logger[_0x49bc('0x8')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x82af1);}};exports['logBlacklist']=function(_0x401cba){var _0x1dc314=moment()[_0x49bc('0x12')](_0x49bc('0x32'));_0x401cba[_0x49bc('0x33')]=0xd;_0x401cba['statedesc']=_0x49bc('0x34');_0x401cba[_0x49bc('0x35')]=_0x1dc314;_0x401cba[_0x49bc('0x36')]=_0x1dc314;_0x401cba['endtime']=_0x1dc314;};exports[_0x49bc('0x37')]=function(_0x437049,_0x2b50a0,_0x54d984){var _0xc9fdbe=moment()['format'](_0x49bc('0x32'));_0x437049['state']=_0x2b50a0;_0x437049['statedesc']=_0x54d984;_0x437049['responsetime']=_0xc9fdbe;_0x437049[_0x49bc('0x38')]=getSeconds(_0x437049[_0x49bc('0x36')],_0x437049[_0x49bc('0x35')]);};exports[_0x49bc('0x39')]=function(_0x3ae3f2,_0x39e01f,_0x33949a){_0x3ae3f2[_0x49bc('0x3a')]=_0x39e01f;_0x3ae3f2[_0x49bc('0x3b')]=_0x33949a;};exports[_0x49bc('0x3c')]=function(_0x2fef66,_0x36c0bd,_0x2aaeac){var _0x242fd0=moment()[_0x49bc('0x12')](_0x49bc('0x32'));_0x2fef66['state']=_0x36c0bd;_0x2fef66['statedesc']=_0x2aaeac;_0x2fef66['responsetime']=_0x2fef66[_0x49bc('0x36')]?_0x2fef66['responsetime']:_0x242fd0;_0x2fef66[_0x49bc('0x3d')]=_0x2fef66[_0x49bc('0x3d')]?_0x2fef66[_0x49bc('0x3d')]:_0x242fd0;_0x2fef66[_0x49bc('0x38')]=getSeconds(_0x2fef66[_0x49bc('0x36')]||0x0,_0x2fef66[_0x49bc('0x35')]||0x0);_0x2fef66[_0x49bc('0x3e')]=_0x2fef66[_0x49bc('0x3f')]?getSeconds(_0x2fef66['endtime'],_0x2fef66[_0x49bc('0x3f')]):0x0;};exports[_0x49bc('0x40')]=function(_0x2467b0){return _0x2467b0==='Failure';};exports[_0x49bc('0x41')]=function(_0x4dd469,_0x541e52,_0x27ccb1,_0x5af2ad,_0x4904ab){var _0x378464=_0x5af2ad?'RECALL':_0x4dd469[_0x49bc('0x42')];_0x378464=_0x4904ab?_0x49bc('0x43'):_0x378464;return{'actionid':_0x4dd469['uniqueid'],'action':_0x49bc('0x44'),'channel':_0x4dd469[_0x49bc('0x45')],'callerid':util[_0x49bc('0x12')](_0x49bc('0x19'),_0x378464,_0x4dd469[_0x49bc('0x1a')]),'Exten':'xcally-motion-preview','Context':_0x49bc('0x46'),'Priority':'1','variable':_0x27ccb1,'timeout':(_0x541e52[_0x49bc('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4dd469[_0x49bc('0x48')]};};exports['totalGlobal']=function(_0x12029d){return _0x12029d[_0x49bc('0x49')]+_0x12029d[_0x49bc('0x4a')]+_0x12029d[_0x49bc('0x4b')]+_0x12029d[_0x49bc('0x4c')]+_0x12029d['countnosuchnumberretry'];};exports['cloneAction']=function(_0x10573a){var _0xfbaa75=_['clone'](_0x10573a);_0xfbaa75[_0x49bc('0x33')]=0xf;_0xfbaa75[_0x49bc('0x4d')]=_0x49bc('0x4e');return _0xfbaa75;};exports['scheduledAt']=function(_0x4947f3,_0x5e41b3,_0x174b10){var _0x59408a={};_0x59408a[_0x5e41b3]=_0x4947f3[_0x5e41b3];_0x59408a[_0x49bc('0x4f')]=![];_0x59408a[_0x49bc('0x50')]=moment()[_0x49bc('0x51')](_0x174b10,'minutes')[_0x49bc('0x12')](_0x49bc('0x32'));_0x59408a[_0x49bc('0x1b')]=_0x4947f3[_0x49bc('0x1b')];_0x59408a['ListId']=_0x4947f3[_0x49bc('0x52')];_0x59408a[_0x49bc('0x1c')]=_0x4947f3['VoiceQueueId']||undefined;return _0x59408a;};exports[_0x49bc('0x53')]=function(_0x366fa8,_0x804737){if(!_['isNil'](_0x366fa8)){if(_0x366fa8['pTalking']>0x0){_0x366fa8[_0x49bc('0x54')]-=0x1;}else{logger['error'](_0x804737,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x804737,_0x49bc('0x55'));}};exports[_0x49bc('0x56')]=function(_0x4dea57){if(_0x4dea57<=0x0){return!![];}return![];};exports['buildObj']=function(_0x1460c9,_0xe5638,_0x110a3c){_0x1460c9[_0x49bc('0x57')]=_0xe5638;_0x1460c9[_0x49bc('0x18')]=_0x1460c9[_0x49bc('0x58')];_0x1460c9[_0x49bc('0x59')]=_0x1460c9['channelAgent'];_0x1460c9[_0x49bc('0x5a')]=_0x49bc('0x5b');if(_0x110a3c){_0x1460c9[_0x49bc('0x5c')]=_0x110a3c[_0x49bc('0x5c')];}return _0x1460c9;};exports['buildAcw']=function(_0x3e2d65){var _0x4204f1={};_0x4204f1[_0x49bc('0x58')]=_0x3e2d65['queue'];_0x4204f1['interface']=_0x3e2d65[_0x49bc('0x45')];_0x4204f1[_0x49bc('0x48')]=_0x3e2d65[_0x49bc('0x48')];return _0x4204f1;};exports[_0x49bc('0x5d')]=function(_0x53499f){var _0x206b84=[];for(var _0x211015 in _0x53499f){if(_0x53499f[_0x49bc('0x2b')](_0x211015)){if(!_[_0x49bc('0x15')](_0x53499f[_0x211015])&&_0x53499f[_0x211015][_0x49bc('0x33')]===_0x49bc('0x5e')&&_0x53499f[_0x211015][_0x49bc('0x5f')]==='reachable'){_0x206b84[_0x49bc('0x60')](_0x53499f[_0x211015]['id']);}}}return _0x206b84;};exports[_0x49bc('0x61')]=function(_0x11d5ed){var _0x41e5ab=moment()[_0x49bc('0x4')](0x0);var _0x4dbd5f=moment(_0x11d5ed)['milliseconds'](0x0);return _0x41e5ab[_0x49bc('0x5')](_0x4dbd5f,_0x49bc('0x6'));};exports[_0x49bc('0x62')]=function(_0x644e32){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x644e32[_0x49bc('0x1b')],'ListId':_0x644e32['ListId'],'VoiceQueueId':_0x644e32[_0x49bc('0x1c')]||undefined,'CampaignId':_0x644e32[_0x49bc('0x63')]||undefined};};exports['filterKey']=function(_0x10e068){if(_0x10e068===_0x49bc('0x48')||_0x10e068===_0x49bc('0x64')||_0x10e068==='queue'||_0x10e068===_0x49bc('0x65')||_0x10e068===_0x49bc('0x66')||_0x10e068===_0x49bc('0x67')||_0x10e068===_0x49bc('0x3a')||_0x10e068===_0x49bc('0x45')||_0x10e068===_0x49bc('0x42')||_0x10e068===_0x49bc('0x4f')||_0x10e068===_0x49bc('0x1a')||_0x10e068==='scheduledat'||_0x10e068===_0x49bc('0x49')||_0x10e068===_0x49bc('0x4a')||_0x10e068==='countnoanswerretry'||_0x10e068===_0x49bc('0x68')||_0x10e068===_0x49bc('0x69')||_0x10e068===_0x49bc('0x6a')||_0x10e068===_0x49bc('0x6b')||_0x10e068===_0x49bc('0x6c')||_0x10e068===_0x49bc('0x1b')||_0x10e068==='ListId'||_0x10e068===_0x49bc('0x3b')||_0x10e068===_0x49bc('0x1c')||_0x10e068===_0x49bc('0x6d')||_0x10e068===_0x49bc('0x6e')||_0x10e068===_0x49bc('0x6f')||_0x10e068===_0x49bc('0x70')||_0x10e068===_0x49bc('0x71')||_0x10e068==='xmd-dialurl'||_0x10e068==='xmd-dialtimeout'||_0x10e068==='xmd-dialoptions'||_0x10e068===_0x49bc('0x72')||_0x10e068===_0x49bc('0x73')||_0x10e068===_0x49bc('0x74')||_0x10e068===_0x49bc('0x75')||_0x10e068===_0x49bc('0x76')||_0x10e068===_0x49bc('0x77')||_0x10e068==='xmd-agi'||_0x10e068===_0x49bc('0x78')||_0x10e068===_0x49bc('0x79')||_0x10e068===_0x49bc('0x7a')||_0x10e068===_0x49bc('0x7b')||_0x10e068==='rtpaudioqosloss'||_0x10e068==='rtpaudioqoslossbridged'||_0x10e068==='rtpaudioqosrtt'||_0x10e068==='rtpaudioqosrttbridged'||_0x10e068===_0x49bc('0x78')||_0x10e068==='rtpaudioqosbridged'||_0x10e068===_0x49bc('0x7a')||_0x10e068===_0x49bc('0x7b')||_0x10e068==='rtpaudioqosloss'||_0x10e068===_0x49bc('0x7c')||_0x10e068===_0x49bc('0x7d')||_0x10e068===_0x49bc('0x7e')||_0x10e068===_0x49bc('0x7f')||_0x10e068==='bridgepvtcallid'||_0x10e068===_0x49bc('0x33')||_0x10e068===_0x49bc('0x4d')){return![];}return!![];};exports[_0x49bc('0x80')]=function(_0x4800d9,_0x36fa0b){var _0x535540,_0x2362e3,_0x5f094f;if(_0x36fa0b<=0x0){_0x36fa0b=0x1;}_0x535540=new RegExp('\x5cw{0,'+_0x36fa0b+'}$');_0x2362e3=Math[_0x49bc('0x81')](0xa,_0x36fa0b-0x1);_0x5f094f=Math[_0x49bc('0x81')](0xa,_0x36fa0b)-0x1;return util[_0x49bc('0x12')]('%s',_[_0x49bc('0x82')](_0x4800d9,_0x535540,_[_0x49bc('0x83')](_0x2362e3,_0x5f094f)));};exports[_0x49bc('0x84')]=function(_0x7ea47f){var _0x1202a9=_0x7ea47f[_0x49bc('0x85')](/"(.*?)"/);return _0x1202a9?_0x1202a9[0x1]:_0x7ea47f;};exports[_0x49bc('0x86')]=function(_0x47d450){var _0x2bd3fb=_0x47d450[_0x49bc('0x85')](/<(.*?)>/);return _0x2bd3fb?_0x2bd3fb[0x1]:_0x47d450;}; \ No newline at end of file +var _0x06a7=['isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','statedesc','ringtime','logLookAgent','membername','UserId','endtime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','from-sip','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','add','ListId','VoiceQueueId','pTalking','IsNotLoggedIn','lastevent','interface','motionChannel','voice','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','status','reachable','push','getDiff','seconds','createBody','CampaignId','filterKey','idContact','type','dialAnswer','scheduledat','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','error','logger','info','inspect','logger2','message','getCallerId','isUndefined','string'];(function(_0x384481,_0x163e55){var _0x4993a0=function(_0x252ccc){while(--_0x252ccc){_0x384481['push'](_0x384481['shift']());}};_0x4993a0(++_0x163e55);}(_0x06a7,0x7b));var _0x706a=function(_0x232456,_0x1ff422){_0x232456=_0x232456-0x0;var _0x5c0763=_0x06a7[_0x232456];return _0x5c0763;};'use strict';var util=require(_0x706a('0x0'));var _=require(_0x706a('0x1'));var moment=require(_0x706a('0x2'));var logger=require(_0x706a('0x3'))(_0x706a('0x4'));var ipAgi=process[_0x706a('0x5')][_0x706a('0x6')]||_0x706a('0x7');function getSeconds(_0x46c066,_0x48a87a){var _0x33e9cd=moment(_0x46c066)['milliseconds'](0x0);var _0x4f8fbf=moment(_0x48a87a)[_0x706a('0x8')](0x0);return _0x33e9cd[_0x706a('0x9')](_0x4f8fbf,'seconds');}exports[_0x706a('0xa')]=function(_0x54e6b1){return function(_0x21e101){logger[_0x706a('0xb')](_0x54e6b1,util['inspect'](_0x21e101,{'showHidden':![],'depth':null}));};};exports[_0x706a('0xc')]=function(_0x481525,_0x278a09){logger[_0x706a('0xd')](_0x481525,util[_0x706a('0xe')](_0x278a09,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x9993ba,_0x57c27b){logger[_0x706a('0xb')](_0x9993ba,util[_0x706a('0xe')](_0x57c27b,{'showHidden':![],'depth':null}));};exports[_0x706a('0xf')]=function(_0x461096){return function(_0x49a836){logger[_0x706a('0xd')](_0x461096,util[_0x706a('0xe')](_0x49a836,{'showHidden':![],'depth':null}));};};exports[_0x706a('0x10')]=function(_0x418d,_0x3ec675,_0x49ccab){return{'message':_0x418d,'unlock':_0x3ec675,'active':_0x49ccab};};exports[_0x706a('0x11')]=function(_0x29f5fe,_0x1f0514,_0x2258db){if(!_[_0x706a('0x12')](_0x2258db)&&_0x706a('0x13')===typeof _0x2258db&&!_[_0x706a('0x14')](_0x2258db)){if(!_[_0x706a('0x12')](_0x1f0514)&&'string'===typeof _0x1f0514&&!_[_0x706a('0x14')](_0x1f0514)){return util[_0x706a('0x15')]('\x22%s\x22\x20<%s>',_0x1f0514,_0x2258db);}return util[_0x706a('0x15')](_0x706a('0x16'),_0x2258db,_0x2258db);}if(!_['isUndefined'](_0x29f5fe)&&_0x706a('0x13')===typeof _0x29f5fe&&!_[_0x706a('0x14')](_0x29f5fe)){return _0x29f5fe;}return'\x22\x22\x20<>';};exports[_0x706a('0x17')]=function(_0x48a672){if(_[_0x706a('0x18')](_0x48a672)){return![];}return _0x48a672;};exports[_0x706a('0x19')]=function(_0x4b6d81,_0x54f8c2,_0x5de1a8,_0x451df8,_0x12e584,_0x442c13){var _0x57860a={'XMD-QUEUE':_0x54f8c2[_0x706a('0x1a')]?_0x54f8c2[_0x706a('0x1a')][_0x706a('0x1b')]:'','XMD-CALLERID':_0x451df8,'XMD-CALLERID-PREVIEW':_0x442c13?util[_0x706a('0x15')](_0x706a('0x16'),_0x442c13[_0x706a('0x1c')],_0x442c13[_0x706a('0x1d')]):_0x451df8,'XMD-DIALID':_0x12e584,'XMD-CONTACTID':_0x54f8c2[_0x706a('0x1e')],'XMD-CDRTYPE':_0x706a('0x1f'),'CALLERID(all)':_0x451df8,'XMD-VOICEQUEUEID':_0x54f8c2['VoiceQueueId'],'XMD-DIALCHANNEL':_0x5de1a8,'XMD-DIALTIMEOUT':_0x4b6d81[_0x706a('0x20')]||0x1e,'XMD-DIALOPTIONS':util[_0x706a('0x15')](_0x706a('0x21'),_0x4b6d81[_0x706a('0x22')]?'g':'',_['isEmpty'](_0x4b6d81[_0x706a('0x23')])?'':_0x706a('0x24')),'XMD-DIALURL':_0x4b6d81['dialPreviewUrl']||'','XMD-AGI':_0x4b6d81[_0x706a('0x25')]?util[_0x706a('0x15')](_0x706a('0x26'),ipAgi,_0x4b6d81[_0x706a('0x25')]):_0x706a('0x27'),'XMD-AGIAFTER':_0x4b6d81[_0x706a('0x22')]?util[_0x706a('0x15')](_0x706a('0x26'),ipAgi,_0x4b6d81[_0x706a('0x22')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x442c13?_0x442c13[_0x706a('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x442c13?_0x442c13[_0x706a('0x29')]:'','XMD-DESTINATION':_0x706a('0x2a'),'SIPADDHEADER':_0x706a('0x2b')};if(!_['isEmpty'](_0x4b6d81['monitor_format'])){_0x57860a[util['format']('%s',_0x706a('0x2c'))]=_0x4b6d81[_0x706a('0x23')];_0x57860a[util[_0x706a('0x15')]('%s',_0x706a('0x2d'))]=_0x12e584;}if(_0x54f8c2&&_0x54f8c2[_0x706a('0x2e')]){for(var _0x418193 in _0x54f8c2[_0x706a('0x2e')]){if(_0x54f8c2[_0x706a('0x2e')]['hasOwnProperty'](_0x418193)){if(!_[_0x706a('0x18')](_0x54f8c2[_0x706a('0x2e')][_0x418193])&&_0x418193!=='id'&&_0x418193!==_0x706a('0x2f')&&_0x418193!==_0x706a('0x30')&&_0x418193!==_0x706a('0x31')){_0x57860a[util[_0x706a('0x15')](_0x706a('0x32'),_0x706a('0x33'),_['toUpper'](_0x418193))]=_0x54f8c2[_0x706a('0x2e')][_0x418193];}}}}return _0x57860a;};exports[_0x706a('0x34')]=function(_0x3a6383){var _0x389ca3={};for(var _0x2a3f31 in _0x3a6383){if(_0x3a6383[_0x706a('0x35')](_0x2a3f31)){_0x389ca3[util[_0x706a('0x15')]('%s',_[_0x706a('0x36')](_0x2a3f31))]=_0x3a6383[_0x2a3f31];}}return{'variables':_0x389ca3};};exports['updateOriginated']=function(_0x55ba41,_0x1ee99c){if(!_['isNil'](_0x55ba41)){if(_0x55ba41[_0x706a('0x35')](_0x706a('0x37'))){if(_0x55ba41[_0x706a('0x37')]>0x0){_0x55ba41['originated']-=0x1;}else{logger['error'](_0x706a('0x38'),_0x1ee99c);}}}else{logger['error'](_0x706a('0x39'),_0x1ee99c);}};exports[_0x706a('0x3a')]=function(_0x18f810){var _0x583aa4=moment()[_0x706a('0x15')](_0x706a('0x3b'));_0x18f810[_0x706a('0x3c')]=0xd;_0x18f810['statedesc']=_0x706a('0x3d');_0x18f810[_0x706a('0x3e')]=_0x583aa4;_0x18f810[_0x706a('0x3f')]=_0x583aa4;_0x18f810['endtime']=_0x583aa4;};exports['logAgent']=function(_0x4aa933,_0x52f008,_0x324d4e){var _0x2d84f0=moment()[_0x706a('0x15')](_0x706a('0x3b'));_0x4aa933[_0x706a('0x3c')]=_0x52f008;_0x4aa933[_0x706a('0x40')]=_0x324d4e;_0x4aa933[_0x706a('0x3f')]=_0x2d84f0;_0x4aa933[_0x706a('0x41')]=getSeconds(_0x4aa933[_0x706a('0x3f')],_0x4aa933[_0x706a('0x3e')]);};exports[_0x706a('0x42')]=function(_0x28c756,_0x3e3c5b,_0x38f50c){_0x28c756[_0x706a('0x43')]=_0x3e3c5b;_0x28c756[_0x706a('0x44')]=_0x38f50c;};exports['logCustomer']=function(_0x19734a,_0x10a427,_0x44a1a6){var _0x218ad2=moment()[_0x706a('0x15')](_0x706a('0x3b'));_0x19734a['state']=_0x10a427;_0x19734a[_0x706a('0x40')]=_0x44a1a6;_0x19734a[_0x706a('0x3f')]=_0x19734a[_0x706a('0x3f')]?_0x19734a[_0x706a('0x3f')]:_0x218ad2;_0x19734a[_0x706a('0x45')]=_0x19734a[_0x706a('0x45')]?_0x19734a[_0x706a('0x45')]:_0x218ad2;_0x19734a['ringtime']=getSeconds(_0x19734a[_0x706a('0x3f')]||0x0,_0x19734a['starttime']||0x0);_0x19734a['talktime']=_0x19734a[_0x706a('0x46')]?getSeconds(_0x19734a[_0x706a('0x45')],_0x19734a[_0x706a('0x46')]):0x0;};exports['isFailure']=function(_0x3ba022){return _0x3ba022===_0x706a('0x47');};exports[_0x706a('0x48')]=function(_0x349de2,_0x2b9b41,_0x81b63,_0x5a62d5,_0x3bb24f){var _0x18a7c3=_0x5a62d5?_0x706a('0x49'):_0x349de2[_0x706a('0x1c')];_0x18a7c3=_0x3bb24f?_0x706a('0x4a'):_0x18a7c3;return{'actionid':_0x349de2[_0x706a('0x4b')],'action':'originate','channel':_0x349de2[_0x706a('0x4c')],'callerid':util[_0x706a('0x15')](_0x706a('0x16'),_0x18a7c3,_0x349de2['calleridnum']),'Exten':_0x706a('0x2a'),'Context':_0x706a('0x4d'),'Priority':'1','variable':_0x81b63,'timeout':(_0x2b9b41['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x349de2['uniqueid']};};exports['totalGlobal']=function(_0x4f9119){return _0x4f9119[_0x706a('0x4e')]+_0x4f9119[_0x706a('0x4f')]+_0x4f9119[_0x706a('0x50')]+_0x4f9119['countagentrejectretry']+_0x4f9119['countnosuchnumberretry'];};exports[_0x706a('0x51')]=function(_0x22d4c5){var _0x369cb8=_[_0x706a('0x52')](_0x22d4c5);_0x369cb8[_0x706a('0x3c')]=0xf;_0x369cb8[_0x706a('0x40')]=_0x706a('0x53');return _0x369cb8;};exports[_0x706a('0x54')]=function(_0x2a9d02,_0x2f8a53,_0x47f525){var _0x3c3f41={};_0x3c3f41[_0x2f8a53]=_0x2a9d02[_0x2f8a53];_0x3c3f41[_0x706a('0x55')]=![];_0x3c3f41['scheduledat']=moment()[_0x706a('0x56')](_0x47f525,'minutes')[_0x706a('0x15')](_0x706a('0x3b'));_0x3c3f41[_0x706a('0x1e')]=_0x2a9d02[_0x706a('0x1e')];_0x3c3f41[_0x706a('0x57')]=_0x2a9d02[_0x706a('0x57')];_0x3c3f41[_0x706a('0x58')]=_0x2a9d02['VoiceQueueId']||undefined;return _0x3c3f41;};exports['decrementTalkink']=function(_0x4f1fae,_0x8e3d93){if(!_[_0x706a('0x18')](_0x4f1fae)){if(_0x4f1fae[_0x706a('0x59')]>0x0){_0x4f1fae[_0x706a('0x59')]-=0x1;}else{logger[_0x706a('0xb')](_0x8e3d93,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x8e3d93,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x706a('0x5a')]=function(_0x4c5f55){if(_0x4c5f55<=0x0){return!![];}return![];};exports['buildObj']=function(_0x3f4293,_0x1e7b56,_0x50beb1){_0x3f4293[_0x706a('0x5b')]=_0x1e7b56;_0x3f4293[_0x706a('0x1b')]=_0x3f4293['queue'];_0x3f4293[_0x706a('0x5c')]=_0x3f4293[_0x706a('0x4c')];_0x3f4293[_0x706a('0x5d')]=_0x706a('0x5e');if(_0x50beb1){_0x3f4293[_0x706a('0x5f')]=_0x50beb1[_0x706a('0x5f')];}return _0x3f4293;};exports[_0x706a('0x60')]=function(_0x5a0316){var _0xe34012={};_0xe34012[_0x706a('0x61')]=_0x5a0316[_0x706a('0x61')];_0xe34012[_0x706a('0x5c')]=_0x5a0316['channelAgent'];_0xe34012['uniqueid']=_0x5a0316[_0x706a('0x4b')];return _0xe34012;};exports[_0x706a('0x62')]=function(_0x6bc83d){var _0x1109b1=[];for(var _0x496557 in _0x6bc83d){if(_0x6bc83d['hasOwnProperty'](_0x496557)){if(!_[_0x706a('0x18')](_0x6bc83d[_0x496557])&&_0x6bc83d[_0x496557][_0x706a('0x3c')]===_0x706a('0x63')&&_0x6bc83d[_0x496557][_0x706a('0x64')]===_0x706a('0x65')){_0x1109b1[_0x706a('0x66')](_0x6bc83d[_0x496557]['id']);}}}return _0x1109b1;};exports[_0x706a('0x67')]=function(_0x1c288f){var _0xe8fa5f=moment()[_0x706a('0x8')](0x0);var _0x4a996c=moment(_0x1c288f)[_0x706a('0x8')](0x0);return _0xe8fa5f[_0x706a('0x9')](_0x4a996c,_0x706a('0x68'));};exports[_0x706a('0x69')]=function(_0x28fd1a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x28fd1a[_0x706a('0x1e')],'ListId':_0x28fd1a[_0x706a('0x57')],'VoiceQueueId':_0x28fd1a[_0x706a('0x58')]||undefined,'CampaignId':_0x28fd1a[_0x706a('0x6a')]||undefined};};exports[_0x706a('0x6b')]=function(_0x1b95dd){if(_0x1b95dd===_0x706a('0x4b')||_0x1b95dd===_0x706a('0x6c')||_0x1b95dd===_0x706a('0x61')||_0x1b95dd===_0x706a('0x6d')||_0x1b95dd==='campaigntype'||_0x1b95dd===_0x706a('0x6e')||_0x1b95dd===_0x706a('0x43')||_0x1b95dd===_0x706a('0x4c')||_0x1b95dd===_0x706a('0x1c')||_0x1b95dd===_0x706a('0x55')||_0x1b95dd===_0x706a('0x1d')||_0x1b95dd===_0x706a('0x6f')||_0x1b95dd===_0x706a('0x4e')||_0x1b95dd===_0x706a('0x4f')||_0x1b95dd==='countnoanswerretry'||_0x1b95dd==='countglobal'||_0x1b95dd==='callback'||_0x1b95dd===_0x706a('0x70')||_0x1b95dd===_0x706a('0x71')||_0x1b95dd===_0x706a('0x72')||_0x1b95dd===_0x706a('0x1e')||_0x1b95dd===_0x706a('0x57')||_0x1b95dd===_0x706a('0x44')||_0x1b95dd===_0x706a('0x58')||_0x1b95dd==='sipcallid'||_0x1b95dd===_0x706a('0x73')||_0x1b95dd===_0x706a('0x74')||_0x1b95dd===_0x706a('0x75')||_0x1b95dd==='xmd-listid'||_0x1b95dd===_0x706a('0x76')||_0x1b95dd===_0x706a('0x77')||_0x1b95dd===_0x706a('0x78')||_0x1b95dd==='xmd-dialid'||_0x1b95dd===_0x706a('0x79')||_0x1b95dd===_0x706a('0x7a')||_0x1b95dd===_0x706a('0x7b')||_0x1b95dd===_0x706a('0x7c')||_0x1b95dd===_0x706a('0x7d')||_0x1b95dd==='xmd-agi'||_0x1b95dd===_0x706a('0x7e')||_0x1b95dd===_0x706a('0x7f')||_0x1b95dd===_0x706a('0x80')||_0x1b95dd===_0x706a('0x81')||_0x1b95dd===_0x706a('0x82')||_0x1b95dd===_0x706a('0x83')||_0x1b95dd===_0x706a('0x84')||_0x1b95dd===_0x706a('0x85')||_0x1b95dd===_0x706a('0x7e')||_0x1b95dd==='rtpaudioqosbridged'||_0x1b95dd===_0x706a('0x80')||_0x1b95dd===_0x706a('0x81')||_0x1b95dd==='rtpaudioqosloss'||_0x1b95dd===_0x706a('0x83')||_0x1b95dd===_0x706a('0x84')||_0x1b95dd===_0x706a('0x85')||_0x1b95dd===_0x706a('0x86')||_0x1b95dd===_0x706a('0x87')||_0x1b95dd===_0x706a('0x3c')||_0x1b95dd==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x422618,_0x5d50e3){var _0x447630,_0x4a2d5e,_0x1dedd9;if(_0x5d50e3<=0x0){_0x5d50e3=0x1;}_0x447630=new RegExp(_0x706a('0x88')+_0x5d50e3+'}$');_0x4a2d5e=Math[_0x706a('0x89')](0xa,_0x5d50e3-0x1);_0x1dedd9=Math['pow'](0xa,_0x5d50e3)-0x1;return util[_0x706a('0x15')]('%s',_[_0x706a('0x8a')](_0x422618,_0x447630,_[_0x706a('0x8b')](_0x4a2d5e,_0x1dedd9)));};exports[_0x706a('0x8c')]=function(_0x28bd93){var _0x29ea38=_0x28bd93[_0x706a('0x8d')](/"(.*?)"/);return _0x29ea38?_0x29ea38[0x1]:_0x28bd93;};exports[_0x706a('0x8e')]=function(_0x523e8f){var _0x36bd2d=_0x523e8f['match'](/<(.*?)>/);return _0x36bd2d?_0x36bd2d[0x1]:_0x523e8f;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 72ff7eb..642a604 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 _0xd8f8=['voicequeuechannelhangup','queueadd','string','number','boolean','reload'];(function(_0x5c0315,_0x32c4ee){var _0x4c4b6a=function(_0x1e7dbf){while(--_0x1e7dbf){_0x5c0315['push'](_0x5c0315['shift']());}};_0x4c4b6a(++_0x32c4ee);}(_0xd8f8,0xd3));var _0x8d8f=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xd8f8[_0x29d915];return _0x160f86;};'use strict';exports[_0x8d8f('0x0')]={'queue':{'type':_0x8d8f('0x1'),'required':!![]},'interface':{'type':_0x8d8f('0x1'),'required':!![]},'membername':{'type':_0x8d8f('0x1'),'required':!![]},'penalty':{'type':_0x8d8f('0x2'),'required':![]},'paused':{'type':_0x8d8f('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x8d8f('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x8d8f('0x1'),'required':!![]},'paused':{'type':_0x8d8f('0x3')},'reason':{'type':_0x8d8f('0x1'),'required':![]}};exports[_0x8d8f('0x4')]={'module':{'type':_0x8d8f('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x8d8f('0x1'),'required':!![]},'filename':{'type':_0x8d8f('0x1')},'format':{'type':_0x8d8f('0x1')},'mixmonitorid':{'type':_0x8d8f('0x1')}};exports[_0x8d8f('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x8d8f('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x8d8f('0x1')}}; \ No newline at end of file +var _0x9f63=['voicequeuechannel','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9f63,0x161));var _0x39f6=function(_0x4887cb,_0x5d8f4c){_0x4887cb=_0x4887cb-0x0;var _0x384c5b=_0x9f63[_0x4887cb];return _0x384c5b;};'use strict';exports[_0x39f6('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x39f6('0x1'),'required':!![]},'penalty':{'type':_0x39f6('0x2'),'required':![]},'paused':{'type':_0x39f6('0x3'),'required':![]}};exports[_0x39f6('0x4')]={'queue':{'type':_0x39f6('0x1'),'required':!![]},'interface':{'type':_0x39f6('0x1'),'required':!![]}};exports[_0x39f6('0x5')]={'interface':{'type':_0x39f6('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x39f6('0x1'),'required':![]}};exports[_0x39f6('0x6')]={'module':{'type':_0x39f6('0x1'),'required':![]}};exports[_0x39f6('0x7')]={'uniqueid':{'type':_0x39f6('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x39f6('0x1'),'required':!![]},'filename':{'type':_0x39f6('0x1')},'format':{'type':_0x39f6('0x1')},'mixmonitorid':{'type':_0x39f6('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x39f6('0x1'),'required':!![]}};exports[_0x39f6('0x8')]={'uniqueid':{'type':_0x39f6('0x1'),'required':!![]},'exten':{'type':_0x39f6('0x1'),'required':!![]},'context':{'type':_0x39f6('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index ffb25b4..c047de9 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 _0x9bf3=['initTrunks','isUndefined','initTriggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','dynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','sumBillable','duration','disposition','ANSWERED','billableseconds','dialQueueProject','SquareProject','initFaxAccounts','faxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','trunks','voiceQueues','triggers','campaigns','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','length','initTelephones','telephones'];(function(_0x30bd19,_0x20705f){var _0x1eae32=function(_0x309205){while(--_0x309205){_0x30bd19['push'](_0x30bd19['shift']());}};_0x1eae32(++_0x20705f);}(_0x9bf3,0xf6));var _0x39bf=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0x9bf3[_0x333714];return _0x4c211e;};'use strict';var BPromise=require(_0x39bf('0x0'));var util=require('util');var _=require(_0x39bf('0x1'));var moment=require(_0x39bf('0x2'));var Agent=require(_0x39bf('0x3'));var Telephone=require(_0x39bf('0x4'));var Trunk=require(_0x39bf('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x39bf('0x6'));var Template=require('../model/template');var Campaign=require(_0x39bf('0x7'));var VoiceExtension=require(_0x39bf('0x8'));var ZendeskAccount=require(_0x39bf('0x9'));var SalesforceAccount=require(_0x39bf('0xa'));var FreshdeskAccount=require(_0x39bf('0xb'));var SugarcrmAccount=require(_0x39bf('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x39bf('0xd'));var VtigerAccount=require(_0x39bf('0xe'));var ServicenowAccount=require(_0x39bf('0xf'));var Dynamics365Account=require(_0x39bf('0x10'));var FreshsalesAccount=require(_0x39bf('0x11'));var FaxAccount=require(_0x39bf('0x12'));var Realtime=function(){this[_0x39bf('0x13')]={};this['telephones']={};this[_0x39bf('0x14')]={};this[_0x39bf('0x15')]={};this[_0x39bf('0x16')]={};this[_0x39bf('0x17')]={};this['templates']={};this[_0x39bf('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x39bf('0x19')]={};this[_0x39bf('0x1a')]={};this[_0x39bf('0x1b')]={};this[_0x39bf('0x1c')]={};this[_0x39bf('0x1d')]={};this[_0x39bf('0x1e')]={};this['zendeskAccounts']={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this[_0x39bf('0x1f')]={};this[_0x39bf('0x20')]={};this[_0x39bf('0x21')]={};this['vtigerAccounts']={};this[_0x39bf('0x22')]={};this['dynamics365Accounts']={};this[_0x39bf('0x23')]={};this['faxAccounts']={};};function freeIsNotKey(_0x510161,_0x5c84b9,_0x4dd38b){var _0x14e1fe=_[_0x39bf('0x24')](_0x510161,function(_0x4cdcd3,_0x20fa9d){return _0x4cdcd3[_0x4dd38b];});for(var _0x3af9d9 in _0x5c84b9){if(_0x5c84b9[_0x39bf('0x25')](_0x3af9d9)){if(!_0x14e1fe[_0x3af9d9]){delete _0x5c84b9[_0x3af9d9];}}}}function freeIsNotKeySip(_0x39d31c,_0x1e176b){var _0x42f428=_[_0x39bf('0x24')](_0x39d31c,function(_0x3a9133,_0x4becac){return util[_0x39bf('0x26')](_0x39bf('0x27'),_0x3a9133[_0x39bf('0x28')]);});for(var _0x4550b8 in _0x1e176b){if(_0x1e176b[_0x39bf('0x25')](_0x4550b8)){if(!_0x42f428[_0x4550b8]){delete _0x1e176b[_0x4550b8];}}}}function freeIsNotKeyAgent(_0x16bca8,_0x30dbab){var _0x13d2f9=_[_0x39bf('0x24')](_0x16bca8,function(_0x1e8f74,_0x8b8e5a){var _0x2721b6=_[_0x39bf('0x29')](_0x1e8f74[_0x39bf('0x2a')])?util[_0x39bf('0x26')](_0x39bf('0x27'),_0x1e8f74['name']):_0x1e8f74[_0x39bf('0x2a')];return _0x2721b6;});for(var _0x1948b6 in _0x30dbab){if(_0x30dbab[_0x39bf('0x25')](_0x1948b6)){if(!_0x13d2f9[_0x1948b6]){delete _0x30dbab[_0x1948b6];}}}}function clearVoiceCallReports(_0x3dac56){_0x3dac56[_0x39bf('0x2b')]=0x0;_0x3dac56[_0x39bf('0x2c')]=0x0;_0x3dac56[_0x39bf('0x2d')]=0x0;_0x3dac56[_0x39bf('0x2e')]=0x0;_0x3dac56['sumBillable']=0x0;}function clearCampaigns(_0x4f0636){if(!_['isEmpty'](_0x4f0636)){for(var _0x83e8b8 in _0x4f0636){if(_0x4f0636[_0x39bf('0x25')](_0x83e8b8)){_0x4f0636[_0x83e8b8][_0x39bf('0x2f')]=0x0;_0x4f0636[_0x83e8b8]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xa2e5da){if(!_[_0x39bf('0x30')](_0xa2e5da)){for(var _0x7c3ce9 in _0xa2e5da){if(_0xa2e5da['hasOwnProperty'](_0x7c3ce9)){_0xa2e5da[_0x7c3ce9]['total']=0x0;_0xa2e5da[_0x7c3ce9]['answered']=0x0;_0xa2e5da[_0x7c3ce9][_0x39bf('0x31')]=0x0;_0xa2e5da[_0x7c3ce9]['abandoned']=0x0;_0xa2e5da[_0x7c3ce9][_0x39bf('0x2d')]=0x0;_0xa2e5da[_0x7c3ce9]['sumDuration']=0x0;_0xa2e5da[_0x7c3ce9]['sumBillable']=0x0;_0xa2e5da[_0x7c3ce9]['outboundAnswerAgiCallsDay']=0x0;_0xa2e5da[_0x7c3ce9]['outboundNoAnswerCallsDay']=0x0;_0xa2e5da[_0x7c3ce9]['outboundBusyCallsDay']=0x0;_0xa2e5da[_0x7c3ce9][_0x39bf('0x32')]=0x0;_0xa2e5da[_0x7c3ce9][_0x39bf('0x33')]=0x0;_0xa2e5da[_0x7c3ce9][_0x39bf('0x34')]=0x0;_0xa2e5da[_0x7c3ce9][_0x39bf('0x35')]=0x0;_0xa2e5da[_0x7c3ce9][_0x39bf('0x36')]=0x0;_0xa2e5da[_0x7c3ce9][_0x39bf('0x37')]=0x0;_0xa2e5da[_0x7c3ce9]['outboundOriginateFailureCallsDay']=0x0;_0xa2e5da[_0x7c3ce9]['outboundRejectCallsDay']=0x0;_0xa2e5da[_0x7c3ce9][_0x39bf('0x38')]=0x0;_0xa2e5da[_0x7c3ce9]['outboundAnswerAgiCallsDay']=0x0;_0xa2e5da[_0x7c3ce9][_0x39bf('0x39')]=0x0;_0xa2e5da[_0x7c3ce9]['queueStatusComplete']=!![];}}}}Realtime[_0x39bf('0x3a')][_0x39bf('0x3b')]=function(_0x54685a,_0x1f8e3c){for(var _0x1c3ef2 in _0x1f8e3c){if(_0x54685a[_0x39bf('0x25')](_0x1c3ef2)){_0x54685a[_0x1c3ef2]=_0x1f8e3c[_0x1c3ef2];}}};Realtime[_0x39bf('0x3a')]['initAgents']=function(){var _0x54d0de=this;return function(_0x39f25f){if(_0x39f25f){freeIsNotKeyAgent(_0x39f25f,_0x54d0de['agents']);for(var _0x30abfd=0x0,_0x30c035={},_0x3c0874={};_0x30abfd<_0x39f25f[_0x39bf('0x3c')];_0x30abfd+=0x1){_0x30c035=_0x39f25f[_0x30abfd];var _0x54f0d6=_[_0x39bf('0x29')](_0x30c035[_0x39bf('0x2a')])?util[_0x39bf('0x26')](_0x39bf('0x27'),_0x30c035[_0x39bf('0x28')]):_0x30c035[_0x39bf('0x2a')];if(_['isUndefined'](_0x54d0de[_0x39bf('0x13')][_0x54f0d6])){_0x54d0de[_0x39bf('0x13')][_0x54f0d6]=new Agent(_0x30c035);}else{_0x54d0de[_0x39bf('0x3b')](_0x54d0de[_0x39bf('0x13')][_0x54f0d6],_0x30c035);}}}return _0x54d0de[_0x39bf('0x13')];};};Realtime['prototype'][_0x39bf('0x3d')]=function(){var _0x1a24f5=this;return function(_0x4b854b){if(_0x4b854b){freeIsNotKeySip(_0x4b854b,_0x1a24f5[_0x39bf('0x3e')]);for(var _0x3d6c2a=0x0,_0x5d3d80={},_0x54a7da={};_0x3d6c2a<_0x4b854b['length'];_0x3d6c2a+=0x1){_0x5d3d80=_0x4b854b[_0x3d6c2a];if(_['isUndefined'](_0x1a24f5['telephones'][util[_0x39bf('0x26')](_0x39bf('0x27'),_0x5d3d80[_0x39bf('0x28')])])){_0x1a24f5[_0x39bf('0x3e')][util[_0x39bf('0x26')](_0x39bf('0x27'),_0x5d3d80[_0x39bf('0x28')])]=new Telephone(_0x5d3d80);}else{_0x1a24f5[_0x39bf('0x3b')](_0x1a24f5[_0x39bf('0x3e')][util[_0x39bf('0x26')](_0x39bf('0x27'),_0x5d3d80[_0x39bf('0x28')])],_0x5d3d80);}}}return _0x1a24f5['telephones'];};};Realtime[_0x39bf('0x3a')][_0x39bf('0x3f')]=function(){var _0x54122f=this;return function(_0x47681a){if(_0x47681a){freeIsNotKeySip(_0x47681a,_0x54122f['trunks']);for(var _0xfeb34e=0x0,_0x40a594={},_0xbf4638={};_0xfeb34e<_0x47681a['length'];_0xfeb34e+=0x1){_0x40a594=_0x47681a[_0xfeb34e];if(_['isUndefined'](_0x54122f[_0x39bf('0x14')][util[_0x39bf('0x26')](_0x39bf('0x27'),_0x40a594[_0x39bf('0x28')])])){_0x54122f[_0x39bf('0x14')][util[_0x39bf('0x26')](_0x39bf('0x27'),_0x40a594[_0x39bf('0x28')])]=new Trunk(_0x40a594);}else{_0x54122f[_0x39bf('0x3b')](_0x54122f['trunks'][util[_0x39bf('0x26')]('SIP/%s',_0x40a594[_0x39bf('0x28')])],_0x40a594);}}}return _0x54122f[_0x39bf('0x14')];};};Realtime[_0x39bf('0x3a')]['initVoiceQueues']=function(){var _0x3791b4=this;return function(_0x13c317){if(_0x13c317){freeIsNotKey(_0x13c317,_0x3791b4[_0x39bf('0x15')],_0x39bf('0x28'));for(var _0x4cd837=0x0,_0x2c9854={},_0x249ed4={};_0x4cd837<_0x13c317[_0x39bf('0x3c')];_0x4cd837+=0x1){_0x2c9854=_0x13c317[_0x4cd837];if(_[_0x39bf('0x40')](_0x3791b4[_0x39bf('0x15')][_0x2c9854[_0x39bf('0x28')]])){_0x3791b4['voiceQueues'][_0x2c9854[_0x39bf('0x28')]]=new VoiceQueue(_0x2c9854);}else{_0x3791b4[_0x39bf('0x3b')](_0x3791b4['voiceQueues'][_0x2c9854[_0x39bf('0x28')]],_0x2c9854);}}}return _0x3791b4['voiceQueues'];};};Realtime[_0x39bf('0x3a')][_0x39bf('0x41')]=function(){var _0x262181=this;return function(_0x222994){if(_0x222994){freeIsNotKey(_0x222994,_0x262181[_0x39bf('0x16')],'id');for(var _0x2f5b11=0x0,_0x316e77={},_0x2fe145={};_0x2f5b11<_0x222994[_0x39bf('0x3c')];_0x2f5b11+=0x1){_0x316e77=_0x222994[_0x2f5b11];if(_[_0x39bf('0x40')](_0x262181[_0x39bf('0x16')][_0x316e77['id']])){_0x262181[_0x39bf('0x16')][_0x316e77['id']]=new Trigger(_0x316e77);}else{_0x262181['mergeFromDatabase'](_0x262181[_0x39bf('0x16')][_0x316e77['id']],_0x316e77);}}}return _0x262181[_0x39bf('0x16')];};};Realtime['prototype'][_0x39bf('0x42')]=function(){var _0x2dea8f=this;return function(_0x1a18e1){if(_0x1a18e1){freeIsNotKey(_0x1a18e1,_0x2dea8f[_0x39bf('0x43')],'id');for(var _0xa00806=0x0,_0x143a67={},_0x4512d7={};_0xa00806<_0x1a18e1['length'];_0xa00806+=0x1){_0x143a67=_0x1a18e1[_0xa00806];if(_[_0x39bf('0x40')](_0x2dea8f[_0x39bf('0x43')][_0x143a67['id']])){_0x2dea8f[_0x39bf('0x43')][_0x143a67['id']]=new Template(_0x143a67);}else{_0x2dea8f['mergeFromDatabase'](_0x2dea8f['templates'][_0x143a67['id']],_0x143a67);}}}return _0x2dea8f['templates'];};};Realtime[_0x39bf('0x3a')][_0x39bf('0x44')]=function(){var _0x2055d8=this;return function(_0x450948){if(_0x450948){freeIsNotKey(_0x450948,_0x2055d8['zendeskAccounts'],'id');for(var _0x3e7917=0x0,_0x2590cd={},_0x35b70c={};_0x3e7917<_0x450948[_0x39bf('0x3c')];_0x3e7917+=0x1){_0x2590cd=_0x450948[_0x3e7917];if(_[_0x39bf('0x40')](_0x2055d8[_0x39bf('0x45')][_0x2590cd['id']])){_0x2055d8[_0x39bf('0x45')][_0x2590cd['id']]=new ZendeskAccount(_0x2590cd);}else{_0x2055d8[_0x39bf('0x3b')](_0x2055d8[_0x39bf('0x45')][_0x2590cd['id']],_0x2590cd);}}}return _0x2055d8[_0x39bf('0x45')];};};Realtime['prototype'][_0x39bf('0x46')]=function(){var _0x4fb7b7=this;return function(_0x26231f){if(_0x26231f){freeIsNotKey(_0x26231f,_0x4fb7b7[_0x39bf('0x47')],'id');for(var _0x1d71ad=0x0,_0x10a900={},_0x357aa8={};_0x1d71ad<_0x26231f['length'];_0x1d71ad+=0x1){_0x10a900=_0x26231f[_0x1d71ad];if(_[_0x39bf('0x40')](_0x4fb7b7[_0x39bf('0x47')][_0x10a900['id']])){_0x4fb7b7[_0x39bf('0x47')][_0x10a900['id']]=new SalesforceAccount(_0x10a900);}else{_0x4fb7b7[_0x39bf('0x3b')](_0x4fb7b7[_0x39bf('0x47')][_0x10a900['id']],_0x10a900);}}}return _0x4fb7b7['salesforceAccounts'];};};Realtime[_0x39bf('0x3a')]['initFreshdeskAccounts']=function(){var _0x27dc6e=this;return function(_0xe85576){if(_0xe85576){freeIsNotKey(_0xe85576,_0x27dc6e[_0x39bf('0x1f')],'id');for(var _0x4b5022=0x0,_0x5b6778={},_0x31742d={};_0x4b5022<_0xe85576[_0x39bf('0x3c')];_0x4b5022+=0x1){_0x5b6778=_0xe85576[_0x4b5022];if(_[_0x39bf('0x40')](_0x27dc6e['freshdeskAccounts'][_0x5b6778['id']])){_0x27dc6e[_0x39bf('0x1f')][_0x5b6778['id']]=new FreshdeskAccount(_0x5b6778);}else{_0x27dc6e['mergeFromDatabase'](_0x27dc6e['freshdeskAccounts'][_0x5b6778['id']],_0x5b6778);}}}return _0x27dc6e['freshdeskAccounts'];};};Realtime[_0x39bf('0x3a')][_0x39bf('0x48')]=function(){var _0x3020e3=this;return function(_0x5cf43b){if(_0x5cf43b){freeIsNotKey(_0x5cf43b,_0x3020e3[_0x39bf('0x20')],'id');for(var _0x1055c9=0x0,_0x4f75d5={},_0x40db48={};_0x1055c9<_0x5cf43b[_0x39bf('0x3c')];_0x1055c9+=0x1){_0x4f75d5=_0x5cf43b[_0x1055c9];if(_[_0x39bf('0x40')](_0x3020e3[_0x39bf('0x20')][_0x4f75d5['id']])){_0x3020e3[_0x39bf('0x20')][_0x4f75d5['id']]=new ZohoAccount(_0x4f75d5);}else{_0x3020e3[_0x39bf('0x3b')](_0x3020e3['zohoAccounts'][_0x4f75d5['id']],_0x4f75d5);}}}return _0x3020e3[_0x39bf('0x20')];};};Realtime[_0x39bf('0x3a')][_0x39bf('0x49')]=function(){var _0x3473e7=this;return function(_0x2d3915){if(_0x2d3915){freeIsNotKey(_0x2d3915,_0x3473e7['deskAccounts'],'id');for(var _0x2b536c=0x0,_0x3f63ca={},_0x1432ce={};_0x2b536c<_0x2d3915[_0x39bf('0x3c')];_0x2b536c+=0x1){_0x3f63ca=_0x2d3915[_0x2b536c];if(_[_0x39bf('0x40')](_0x3473e7[_0x39bf('0x21')][_0x3f63ca['id']])){_0x3473e7['deskAccounts'][_0x3f63ca['id']]=new DeskAccount(_0x3f63ca);}else{_0x3473e7[_0x39bf('0x3b')](_0x3473e7[_0x39bf('0x21')][_0x3f63ca['id']],_0x3f63ca);}}}return _0x3473e7[_0x39bf('0x21')];};};Realtime[_0x39bf('0x3a')][_0x39bf('0x4a')]=function(){var _0x394b1f=this;return function(_0x351336){if(_0x351336){freeIsNotKey(_0x351336,_0x394b1f[_0x39bf('0x4b')],'id');for(var _0x5654c4=0x0,_0x5f3d11={},_0x5183bb={};_0x5654c4<_0x351336[_0x39bf('0x3c')];_0x5654c4+=0x1){_0x5f3d11=_0x351336[_0x5654c4];if(_[_0x39bf('0x40')](_0x394b1f['sugarcrmAccounts'][_0x5f3d11['id']])){_0x394b1f[_0x39bf('0x4b')][_0x5f3d11['id']]=new SugarcrmAccount(_0x5f3d11);}else{_0x394b1f[_0x39bf('0x3b')](_0x394b1f[_0x39bf('0x4b')][_0x5f3d11['id']],_0x5f3d11);}}}return _0x394b1f[_0x39bf('0x4b')];};};Realtime[_0x39bf('0x3a')][_0x39bf('0x4c')]=function(){var _0x5112c6=this;return function(_0x49bf6b){if(_0x49bf6b){freeIsNotKey(_0x49bf6b,_0x5112c6[_0x39bf('0x4d')],'id');for(var _0x42974b=0x0,_0xfabf59={},_0x2bcb0a={};_0x42974b<_0x49bf6b[_0x39bf('0x3c')];_0x42974b+=0x1){_0xfabf59=_0x49bf6b[_0x42974b];if(_[_0x39bf('0x40')](_0x5112c6['vtigerAccounts'][_0xfabf59['id']])){_0x5112c6[_0x39bf('0x4d')][_0xfabf59['id']]=new VtigerAccount(_0xfabf59);}else{_0x5112c6[_0x39bf('0x3b')](_0x5112c6['vtigerAccounts'][_0xfabf59['id']],_0xfabf59);}}}return _0x5112c6[_0x39bf('0x4d')];};};Realtime[_0x39bf('0x3a')]['initServicenowAccounts']=function(){var _0x1fb121=this;return function(_0x5e56d8){if(_0x5e56d8){freeIsNotKey(_0x5e56d8,_0x1fb121[_0x39bf('0x22')],'id');for(var _0x516da=0x0,_0x5f0036={},_0x44f868={};_0x516da<_0x5e56d8[_0x39bf('0x3c')];_0x516da+=0x1){_0x5f0036=_0x5e56d8[_0x516da];if(_[_0x39bf('0x40')](_0x1fb121[_0x39bf('0x22')][_0x5f0036['id']])){_0x1fb121[_0x39bf('0x22')][_0x5f0036['id']]=new ServicenowAccount(_0x5f0036);}else{_0x1fb121[_0x39bf('0x3b')](_0x1fb121[_0x39bf('0x22')][_0x5f0036['id']],_0x5f0036);}}}return _0x1fb121[_0x39bf('0x22')];};};Realtime[_0x39bf('0x3a')]['initDynamics365Accounts']=function(){var _0x2172b3=this;return function(_0x15fd8b){if(_0x15fd8b){freeIsNotKey(_0x15fd8b,_0x2172b3[_0x39bf('0x4e')],'id');for(var _0x58bd74=0x0,_0x925854={},_0x583232={};_0x58bd74<_0x15fd8b[_0x39bf('0x3c')];_0x58bd74+=0x1){_0x925854=_0x15fd8b[_0x58bd74];if(_['isUndefined'](_0x2172b3[_0x39bf('0x4e')][_0x925854['id']])){_0x2172b3[_0x39bf('0x4e')][_0x925854['id']]=new Dynamics365Account(_0x925854);}else{_0x2172b3['mergeFromDatabase'](_0x2172b3[_0x39bf('0x4e')][_0x925854['id']],_0x925854);}}}return _0x2172b3[_0x39bf('0x4e')];};};Realtime['prototype'][_0x39bf('0x4f')]=function(){var _0x14b0e0=this;return function(_0x575a07){if(_0x575a07){freeIsNotKey(_0x575a07,_0x14b0e0[_0x39bf('0x23')],'id');for(var _0xa0bcc8=0x0,_0x3b243d={},_0x446c0e={};_0xa0bcc8<_0x575a07[_0x39bf('0x3c')];_0xa0bcc8+=0x1){_0x3b243d=_0x575a07[_0xa0bcc8];if(_[_0x39bf('0x40')](_0x14b0e0['freshsalesAccounts'][_0x3b243d['id']])){_0x14b0e0[_0x39bf('0x23')][_0x3b243d['id']]=new FreshsalesAccount(_0x3b243d);}else{_0x14b0e0[_0x39bf('0x3b')](_0x14b0e0['freshsalesAccounts'][_0x3b243d['id']],_0x3b243d);}}}return _0x14b0e0[_0x39bf('0x23')];};};Realtime[_0x39bf('0x3a')]['initVoiceQueueHopperHistory']=function(){var _0x1277ac=this;return function(_0xc30cb9){for(var _0x153bd7=0x0;_0x153bd7<_0xc30cb9[_0x39bf('0x3c')];_0x153bd7+=0x1){_[_0x39bf('0x50')](_0x1277ac[_0x39bf('0x15')][_0xc30cb9[_0x153bd7][_0x39bf('0x28')]],_0xc30cb9[_0x153bd7]);}return _0x1277ac[_0x39bf('0x15')];};};Realtime['prototype'][_0x39bf('0x51')]=function(){var _0x1d4b69=this;return function(_0x32e6af){clearVoiceQueues(_0x1d4b69['voiceQueues']);if(_0x32e6af){_0x32e6af=_['groupBy'](_0x32e6af,_0x39bf('0x52'));for(var _0x4f331f in _0x32e6af){if(_0x32e6af[_0x39bf('0x25')](_0x4f331f)){var _0x11741c={};for(var _0x14effa=0x0;_0x14effa<_0x32e6af[_0x4f331f][_0x39bf('0x3c')];_0x14effa+=0x1){var _0x25c943=_0x32e6af[_0x4f331f][_0x14effa][_0x39bf('0x53')];if(_0x1d4b69[_0x39bf('0x15')][_0x25c943]){if(_0x32e6af[_0x4f331f][_0x14effa][_0x39bf('0x54')]){_0x1d4b69[_0x39bf('0x15')][_0x25c943]['unmanaged']+=0x1;}if(_0x32e6af[_0x4f331f][_0x14effa][_0x39bf('0x55')]){_0x1d4b69[_0x39bf('0x15')][_0x25c943]['abandoned']+=0x1;}_0x1d4b69[_0x39bf('0x15')][_0x25c943][_0x39bf('0x2d')]+=moment(_0x32e6af[_0x4f331f][_0x14effa][_0x39bf('0x56')])['diff'](moment(_0x32e6af[_0x4f331f][_0x14effa][_0x39bf('0x57')]),_0x39bf('0x58'))||0x0;if(_0x14effa===_0x32e6af[_0x4f331f][_0x39bf('0x3c')]-0x1){_0x1d4b69[_0x39bf('0x15')][_0x25c943][_0x39bf('0x2e')]+=moment(_0x32e6af[_0x4f331f][_0x14effa][_0x39bf('0x59')]||_0x32e6af[_0x4f331f][_0x14effa][_0x39bf('0x5a')]||_0x32e6af[_0x4f331f][_0x14effa][_0x39bf('0x5b')])[_0x39bf('0x5c')](moment(_0x32e6af[_0x4f331f][_0x14effa][_0x39bf('0x57')]),_0x39bf('0x58'))||0x0;_0x1d4b69[_0x39bf('0x15')][_0x25c943][_0x39bf('0x2b')]+=0x1;if(_0x32e6af[_0x4f331f][_0x14effa]['queuecallercomplete']){_0x1d4b69[_0x39bf('0x15')][_0x25c943][_0x39bf('0x2c')]+=0x1;_0x1d4b69[_0x39bf('0x15')][_0x25c943][_0x39bf('0x5d')]+=moment(_0x32e6af[_0x4f331f][_0x14effa]['queuecallercompleteAt'])[_0x39bf('0x5c')](moment(_0x32e6af[_0x4f331f][_0x14effa]['queuecallerleaveAt']),_0x39bf('0x58'))||0x0;}}else{_0x1d4b69[_0x39bf('0x15')][_0x25c943][_0x39bf('0x2e')]+=_0x1d4b69[_0x39bf('0x15')][_0x25c943][_0x39bf('0x2d')]||0x0;}}}}}}return _0x1d4b69[_0x39bf('0x15')];};};Realtime[_0x39bf('0x3a')]['initVoiceCallReports']=function(){var _0x1ce8dc=this;return function(_0x26e838){clearVoiceCallReports(_0x1ce8dc['outbound']);if(_0x26e838){for(var _0x205126=0x0;_0x205126<_0x26e838[_0x39bf('0x3c')];_0x205126+=0x1){_0x1ce8dc[_0x39bf('0x18')]['total']+=0x1;_0x1ce8dc[_0x39bf('0x18')]['sumDuration']+=_0x26e838[_0x205126][_0x39bf('0x5e')];if(_0x26e838[_0x205126][_0x39bf('0x5f')]===_0x39bf('0x60')){_0x1ce8dc[_0x39bf('0x18')]['answered']+=0x1;_0x1ce8dc[_0x39bf('0x18')][_0x39bf('0x2d')]+=_0x26e838[_0x205126]['duration']-_0x26e838[_0x205126]['billableseconds']||0x0;_0x1ce8dc[_0x39bf('0x18')][_0x39bf('0x5d')]+=_0x26e838[_0x205126][_0x39bf('0x61')];}}}return _0x1ce8dc[_0x39bf('0x18')];};};Realtime[_0x39bf('0x3a')]['initCampaigns']=function(){var _0x2b1429=this;return function(_0xfabbe){if(_0xfabbe){freeIsNotKey(_0xfabbe,_0x2b1429[_0x39bf('0x17')],_0x39bf('0x28'));for(var _0x2899ae=0x0,_0x425d7a={};_0x2899ae<_0xfabbe[_0x39bf('0x3c')];_0x2899ae+=0x1){_0x425d7a=_0xfabbe[_0x2899ae];if(_[_0x39bf('0x40')](_0x2b1429[_0x39bf('0x17')][_0x425d7a[_0x39bf('0x28')]])){_0x2b1429['campaigns'][_0x425d7a[_0x39bf('0x28')]]=new Campaign(_0x425d7a);}else{_0x2b1429[_0x39bf('0x3b')](_0x2b1429[_0x39bf('0x17')][_0x425d7a['name']],_0x425d7a);_0x2b1429[_0x39bf('0x17')][_0x425d7a[_0x39bf('0x28')]][_0x39bf('0x62')]=_0x425d7a[_0x39bf('0x63')]?_0x425d7a[_0x39bf('0x63')][_0x39bf('0x28')]:undefined;}}}return _0x2b1429[_0x39bf('0x17')];};};Realtime[_0x39bf('0x3a')]['initVoiceExtensions']=function(){var _0x2bf2fe=this;return function(_0x441afb){if(_0x441afb){freeIsNotKey(_0x441afb,_0x2bf2fe[_0x39bf('0x19')],'id');for(var _0x3342c2=0x0,_0x297f7a={};_0x3342c2<_0x441afb[_0x39bf('0x3c')];_0x3342c2+=0x1){_0x297f7a=_0x441afb[_0x3342c2];if(_[_0x39bf('0x40')](_0x2bf2fe[_0x39bf('0x19')][_0x297f7a['id']])){_0x2bf2fe[_0x39bf('0x19')][_0x297f7a['id']]=new VoiceExtension(_0x297f7a);}else{_0x2bf2fe[_0x39bf('0x3b')](_0x2bf2fe['voiceExtensions'][_0x297f7a['id']],_0x297f7a);}}}return _0x2bf2fe['voiceExtensions'];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x49100c=this;return function(_0x467e5d){clearCampaigns(_0x49100c[_0x39bf('0x17')]);for(var _0x2734eb=0x0;_0x2734eb<_0x467e5d[_0x39bf('0x3c')];_0x2734eb+=0x1){_[_0x39bf('0x50')](_0x49100c[_0x39bf('0x17')][_0x467e5d[_0x2734eb]['name']],_0x467e5d[_0x2734eb]);}return _0x49100c[_0x39bf('0x17')];};};Realtime['prototype'][_0x39bf('0x64')]=function(){var _0x712440=this;return function(_0x28f8ab){if(_0x28f8ab){freeIsNotKey(_0x28f8ab,_0x712440['faxAccounts'],'id');for(var _0x2ea332=0x0,_0x366479={},_0x8d18d7={};_0x2ea332<_0x28f8ab[_0x39bf('0x3c')];_0x2ea332+=0x1){_0x366479=_0x28f8ab[_0x2ea332];if(_['isUndefined'](_0x712440[_0x39bf('0x65')][_0x366479['id']])){_0x712440[_0x39bf('0x65')][_0x366479['id']]=new FaxAccount(_0x366479);}else{_0x712440[_0x39bf('0x3b')](_0x712440['faxAccounts'][_0x366479['id']],_0x366479);}}}return _0x712440[_0x39bf('0x65')];};};module[_0x39bf('0x66')]=Realtime; \ No newline at end of file +var _0x102f=['initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','util','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/template','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','name','interface','SIP/%s','total','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','isUndefined','initTelephones','initTrunks','length','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','merge','initVoiceQueueReports','uniqueid','queuecallerexit','unmanaged','queuecallerabandon','abandoned','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds'];(function(_0x2e442e,_0xc1270d){var _0x4c92b9=function(_0x2df3d2){while(--_0x2df3d2){_0x2e442e['push'](_0x2e442e['shift']());}};_0x4c92b9(++_0xc1270d);}(_0x102f,0x14b));var _0xf102=function(_0x4b8212,_0x37d755){_0x4b8212=_0x4b8212-0x0;var _0x54de6e=_0x102f[_0x4b8212];return _0x54de6e;};'use strict';var BPromise=require('bluebird');var util=require(_0xf102('0x0'));var _=require('lodash');var moment=require(_0xf102('0x1'));var Agent=require(_0xf102('0x2'));var Telephone=require(_0xf102('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xf102('0x4'));var Trigger=require('../model/trigger');var Template=require(_0xf102('0x5'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf102('0x6'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xf102('0x7'));var FreshdeskAccount=require(_0xf102('0x8'));var SugarcrmAccount=require(_0xf102('0x9'));var ZohoAccount=require(_0xf102('0xa'));var DeskAccount=require(_0xf102('0xb'));var VtigerAccount=require(_0xf102('0xc'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xf102('0xd'));var FreshsalesAccount=require(_0xf102('0xe'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xf102('0xf')]={};this[_0xf102('0x10')]={};this[_0xf102('0x11')]={};this['voiceQueues']={};this[_0xf102('0x12')]={};this[_0xf102('0x13')]={};this[_0xf102('0x14')]={};this[_0xf102('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xf102('0x16')]={};this[_0xf102('0x17')]={};this[_0xf102('0x18')]={};this[_0xf102('0x19')]={};this[_0xf102('0x1a')]={};this[_0xf102('0x1b')]={};this['zendeskAccounts']={};this[_0xf102('0x1c')]={};this[_0xf102('0x1d')]={};this['freshdeskAccounts']={};this[_0xf102('0x1e')]={};this['deskAccounts']={};this[_0xf102('0x1f')]={};this['servicenowAccounts']={};this[_0xf102('0x20')]={};this[_0xf102('0x21')]={};this['faxAccounts']={};};function freeIsNotKey(_0x69c3b1,_0x20c336,_0x6be0b7){var _0x3a8900=_[_0xf102('0x22')](_0x69c3b1,function(_0x4e2284,_0x23259e){return _0x4e2284[_0x6be0b7];});for(var _0x53fcd2 in _0x20c336){if(_0x20c336[_0xf102('0x23')](_0x53fcd2)){if(!_0x3a8900[_0x53fcd2]){delete _0x20c336[_0x53fcd2];}}}}function freeIsNotKeySip(_0x3ebe01,_0x2f5f34){var _0x2326ae=_['mapKeys'](_0x3ebe01,function(_0x28d9c4,_0x4da383){return util[_0xf102('0x24')]('SIP/%s',_0x28d9c4[_0xf102('0x25')]);});for(var _0x10855a in _0x2f5f34){if(_0x2f5f34[_0xf102('0x23')](_0x10855a)){if(!_0x2326ae[_0x10855a]){delete _0x2f5f34[_0x10855a];}}}}function freeIsNotKeyAgent(_0x369822,_0x105483){var _0x5289ff=_['mapKeys'](_0x369822,function(_0x5ad4cb,_0x34f56d){var _0x125976=_['isNil'](_0x5ad4cb[_0xf102('0x26')])?util[_0xf102('0x24')](_0xf102('0x27'),_0x5ad4cb[_0xf102('0x25')]):_0x5ad4cb[_0xf102('0x26')];return _0x125976;});for(var _0x5f0b2f in _0x105483){if(_0x105483['hasOwnProperty'](_0x5f0b2f)){if(!_0x5289ff[_0x5f0b2f]){delete _0x105483[_0x5f0b2f];}}}}function clearVoiceCallReports(_0x3b8570){_0x3b8570[_0xf102('0x28')]=0x0;_0x3b8570['answered']=0x0;_0x3b8570[_0xf102('0x29')]=0x0;_0x3b8570[_0xf102('0x2a')]=0x0;_0x3b8570['sumBillable']=0x0;}function clearCampaigns(_0x3417e0){if(!_[_0xf102('0x2b')](_0x3417e0)){for(var _0x5c7170 in _0x3417e0){if(_0x3417e0['hasOwnProperty'](_0x5c7170)){_0x3417e0[_0x5c7170][_0xf102('0x2c')]=0x0;_0x3417e0[_0x5c7170][_0xf102('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x44cb34){if(!_[_0xf102('0x2b')](_0x44cb34)){for(var _0xaa41b4 in _0x44cb34){if(_0x44cb34[_0xf102('0x23')](_0xaa41b4)){_0x44cb34[_0xaa41b4]['total']=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x2e')]=0x0;_0x44cb34[_0xaa41b4]['unmanaged']=0x0;_0x44cb34[_0xaa41b4]['abandoned']=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x29')]=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x2a')]=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x2f')]=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x30')]=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x31')]=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x32')]=0x0;_0x44cb34[_0xaa41b4]['outboundCongestionCallsDay']=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x33')]=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x34')]=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x35')]=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x36')]=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x37')]=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x38')]=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x39')]=0x0;_0x44cb34[_0xaa41b4]['outboundReCallsDay']=0x0;_0x44cb34[_0xaa41b4]['outboundAnswerAgiCallsDay']=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x3a')]=0x0;_0x44cb34[_0xaa41b4][_0xf102('0x3b')]=!![];}}}}Realtime[_0xf102('0x3c')][_0xf102('0x3d')]=function(_0x1487fa,_0x155bcc){for(var _0x4f394c in _0x155bcc){if(_0x1487fa[_0xf102('0x23')](_0x4f394c)){_0x1487fa[_0x4f394c]=_0x155bcc[_0x4f394c];}}};Realtime[_0xf102('0x3c')][_0xf102('0x3e')]=function(){var _0x24ff73=this;return function(_0x24990f){if(_0x24990f){freeIsNotKeyAgent(_0x24990f,_0x24ff73['agents']);for(var _0x27e63d=0x0,_0x121331={},_0xa6fd73={};_0x27e63d<_0x24990f['length'];_0x27e63d+=0x1){_0x121331=_0x24990f[_0x27e63d];var _0x373c39=_['isNil'](_0x121331[_0xf102('0x26')])?util['format'](_0xf102('0x27'),_0x121331[_0xf102('0x25')]):_0x121331[_0xf102('0x26')];if(_[_0xf102('0x3f')](_0x24ff73['agents'][_0x373c39])){_0x24ff73['agents'][_0x373c39]=new Agent(_0x121331);}else{_0x24ff73[_0xf102('0x3d')](_0x24ff73[_0xf102('0xf')][_0x373c39],_0x121331);}}}return _0x24ff73[_0xf102('0xf')];};};Realtime[_0xf102('0x3c')][_0xf102('0x40')]=function(){var _0x2f046b=this;return function(_0x23421d){if(_0x23421d){freeIsNotKeySip(_0x23421d,_0x2f046b[_0xf102('0x10')]);for(var _0x111fcc=0x0,_0x48bab0={},_0x11e39d={};_0x111fcc<_0x23421d['length'];_0x111fcc+=0x1){_0x48bab0=_0x23421d[_0x111fcc];if(_[_0xf102('0x3f')](_0x2f046b['telephones'][util[_0xf102('0x24')]('SIP/%s',_0x48bab0[_0xf102('0x25')])])){_0x2f046b['telephones'][util[_0xf102('0x24')](_0xf102('0x27'),_0x48bab0['name'])]=new Telephone(_0x48bab0);}else{_0x2f046b['mergeFromDatabase'](_0x2f046b[_0xf102('0x10')][util['format'](_0xf102('0x27'),_0x48bab0['name'])],_0x48bab0);}}}return _0x2f046b[_0xf102('0x10')];};};Realtime[_0xf102('0x3c')][_0xf102('0x41')]=function(){var _0x277c2f=this;return function(_0x373fe0){if(_0x373fe0){freeIsNotKeySip(_0x373fe0,_0x277c2f[_0xf102('0x11')]);for(var _0x669a3b=0x0,_0xb9187f={},_0x45af55={};_0x669a3b<_0x373fe0[_0xf102('0x42')];_0x669a3b+=0x1){_0xb9187f=_0x373fe0[_0x669a3b];if(_[_0xf102('0x3f')](_0x277c2f[_0xf102('0x11')][util[_0xf102('0x24')](_0xf102('0x27'),_0xb9187f[_0xf102('0x25')])])){_0x277c2f[_0xf102('0x11')][util[_0xf102('0x24')]('SIP/%s',_0xb9187f['name'])]=new Trunk(_0xb9187f);}else{_0x277c2f[_0xf102('0x3d')](_0x277c2f[_0xf102('0x11')][util[_0xf102('0x24')](_0xf102('0x27'),_0xb9187f['name'])],_0xb9187f);}}}return _0x277c2f[_0xf102('0x11')];};};Realtime[_0xf102('0x3c')]['initVoiceQueues']=function(){var _0x4be878=this;return function(_0x1c2955){if(_0x1c2955){freeIsNotKey(_0x1c2955,_0x4be878[_0xf102('0x43')],_0xf102('0x25'));for(var _0x1b6b29=0x0,_0xd25ad3={},_0x1c04b8={};_0x1b6b29<_0x1c2955[_0xf102('0x42')];_0x1b6b29+=0x1){_0xd25ad3=_0x1c2955[_0x1b6b29];if(_[_0xf102('0x3f')](_0x4be878[_0xf102('0x43')][_0xd25ad3[_0xf102('0x25')]])){_0x4be878[_0xf102('0x43')][_0xd25ad3[_0xf102('0x25')]]=new VoiceQueue(_0xd25ad3);}else{_0x4be878['mergeFromDatabase'](_0x4be878[_0xf102('0x43')][_0xd25ad3[_0xf102('0x25')]],_0xd25ad3);}}}return _0x4be878[_0xf102('0x43')];};};Realtime[_0xf102('0x3c')][_0xf102('0x44')]=function(){var _0x157ccd=this;return function(_0x5417bd){if(_0x5417bd){freeIsNotKey(_0x5417bd,_0x157ccd[_0xf102('0x12')],'id');for(var _0x49ceff=0x0,_0x51425d={},_0x4ff6a2={};_0x49ceff<_0x5417bd[_0xf102('0x42')];_0x49ceff+=0x1){_0x51425d=_0x5417bd[_0x49ceff];if(_[_0xf102('0x3f')](_0x157ccd[_0xf102('0x12')][_0x51425d['id']])){_0x157ccd[_0xf102('0x12')][_0x51425d['id']]=new Trigger(_0x51425d);}else{_0x157ccd[_0xf102('0x3d')](_0x157ccd[_0xf102('0x12')][_0x51425d['id']],_0x51425d);}}}return _0x157ccd['triggers'];};};Realtime[_0xf102('0x3c')][_0xf102('0x45')]=function(){var _0x81070d=this;return function(_0x174609){if(_0x174609){freeIsNotKey(_0x174609,_0x81070d['templates'],'id');for(var _0x1659d1=0x0,_0x80fa38={},_0x56b5ff={};_0x1659d1<_0x174609[_0xf102('0x42')];_0x1659d1+=0x1){_0x80fa38=_0x174609[_0x1659d1];if(_[_0xf102('0x3f')](_0x81070d[_0xf102('0x14')][_0x80fa38['id']])){_0x81070d[_0xf102('0x14')][_0x80fa38['id']]=new Template(_0x80fa38);}else{_0x81070d[_0xf102('0x3d')](_0x81070d[_0xf102('0x14')][_0x80fa38['id']],_0x80fa38);}}}return _0x81070d[_0xf102('0x14')];};};Realtime[_0xf102('0x3c')][_0xf102('0x46')]=function(){var _0xa571b1=this;return function(_0x63327e){if(_0x63327e){freeIsNotKey(_0x63327e,_0xa571b1[_0xf102('0x47')],'id');for(var _0x53a258=0x0,_0x1bf512={},_0x36eb37={};_0x53a258<_0x63327e[_0xf102('0x42')];_0x53a258+=0x1){_0x1bf512=_0x63327e[_0x53a258];if(_[_0xf102('0x3f')](_0xa571b1[_0xf102('0x47')][_0x1bf512['id']])){_0xa571b1[_0xf102('0x47')][_0x1bf512['id']]=new ZendeskAccount(_0x1bf512);}else{_0xa571b1[_0xf102('0x3d')](_0xa571b1[_0xf102('0x47')][_0x1bf512['id']],_0x1bf512);}}}return _0xa571b1[_0xf102('0x47')];};};Realtime[_0xf102('0x3c')][_0xf102('0x48')]=function(){var _0x4232f6=this;return function(_0xa35823){if(_0xa35823){freeIsNotKey(_0xa35823,_0x4232f6['salesforceAccounts'],'id');for(var _0x1a61c6=0x0,_0x7af3f7={},_0x571e78={};_0x1a61c6<_0xa35823[_0xf102('0x42')];_0x1a61c6+=0x1){_0x7af3f7=_0xa35823[_0x1a61c6];if(_[_0xf102('0x3f')](_0x4232f6['salesforceAccounts'][_0x7af3f7['id']])){_0x4232f6['salesforceAccounts'][_0x7af3f7['id']]=new SalesforceAccount(_0x7af3f7);}else{_0x4232f6['mergeFromDatabase'](_0x4232f6['salesforceAccounts'][_0x7af3f7['id']],_0x7af3f7);}}}return _0x4232f6['salesforceAccounts'];};};Realtime[_0xf102('0x3c')][_0xf102('0x49')]=function(){var _0x3ea69d=this;return function(_0x3f10b7){if(_0x3f10b7){freeIsNotKey(_0x3f10b7,_0x3ea69d[_0xf102('0x4a')],'id');for(var _0x1e5d07=0x0,_0x3a3249={},_0x374db5={};_0x1e5d07<_0x3f10b7[_0xf102('0x42')];_0x1e5d07+=0x1){_0x3a3249=_0x3f10b7[_0x1e5d07];if(_['isUndefined'](_0x3ea69d['freshdeskAccounts'][_0x3a3249['id']])){_0x3ea69d[_0xf102('0x4a')][_0x3a3249['id']]=new FreshdeskAccount(_0x3a3249);}else{_0x3ea69d[_0xf102('0x3d')](_0x3ea69d['freshdeskAccounts'][_0x3a3249['id']],_0x3a3249);}}}return _0x3ea69d[_0xf102('0x4a')];};};Realtime[_0xf102('0x3c')][_0xf102('0x4b')]=function(){var _0x2a5462=this;return function(_0x5c2263){if(_0x5c2263){freeIsNotKey(_0x5c2263,_0x2a5462[_0xf102('0x1e')],'id');for(var _0x463234=0x0,_0x5160b3={},_0x456ef1={};_0x463234<_0x5c2263[_0xf102('0x42')];_0x463234+=0x1){_0x5160b3=_0x5c2263[_0x463234];if(_[_0xf102('0x3f')](_0x2a5462[_0xf102('0x1e')][_0x5160b3['id']])){_0x2a5462[_0xf102('0x1e')][_0x5160b3['id']]=new ZohoAccount(_0x5160b3);}else{_0x2a5462['mergeFromDatabase'](_0x2a5462[_0xf102('0x1e')][_0x5160b3['id']],_0x5160b3);}}}return _0x2a5462[_0xf102('0x1e')];};};Realtime['prototype'][_0xf102('0x4c')]=function(){var _0x37076b=this;return function(_0x1b31ea){if(_0x1b31ea){freeIsNotKey(_0x1b31ea,_0x37076b[_0xf102('0x4d')],'id');for(var _0x352a67=0x0,_0x2bec83={},_0xadf733={};_0x352a67<_0x1b31ea[_0xf102('0x42')];_0x352a67+=0x1){_0x2bec83=_0x1b31ea[_0x352a67];if(_[_0xf102('0x3f')](_0x37076b[_0xf102('0x4d')][_0x2bec83['id']])){_0x37076b['deskAccounts'][_0x2bec83['id']]=new DeskAccount(_0x2bec83);}else{_0x37076b['mergeFromDatabase'](_0x37076b[_0xf102('0x4d')][_0x2bec83['id']],_0x2bec83);}}}return _0x37076b[_0xf102('0x4d')];};};Realtime[_0xf102('0x3c')][_0xf102('0x4e')]=function(){var _0x46e962=this;return function(_0x3de4f9){if(_0x3de4f9){freeIsNotKey(_0x3de4f9,_0x46e962[_0xf102('0x1d')],'id');for(var _0xf13b56=0x0,_0x3099ac={},_0x18d0a6={};_0xf13b56<_0x3de4f9['length'];_0xf13b56+=0x1){_0x3099ac=_0x3de4f9[_0xf13b56];if(_['isUndefined'](_0x46e962[_0xf102('0x1d')][_0x3099ac['id']])){_0x46e962[_0xf102('0x1d')][_0x3099ac['id']]=new SugarcrmAccount(_0x3099ac);}else{_0x46e962[_0xf102('0x3d')](_0x46e962[_0xf102('0x1d')][_0x3099ac['id']],_0x3099ac);}}}return _0x46e962['sugarcrmAccounts'];};};Realtime[_0xf102('0x3c')][_0xf102('0x4f')]=function(){var _0x15dfe2=this;return function(_0x4bf5ba){if(_0x4bf5ba){freeIsNotKey(_0x4bf5ba,_0x15dfe2[_0xf102('0x1f')],'id');for(var _0x36de7a=0x0,_0x39a524={},_0x1e3310={};_0x36de7a<_0x4bf5ba['length'];_0x36de7a+=0x1){_0x39a524=_0x4bf5ba[_0x36de7a];if(_[_0xf102('0x3f')](_0x15dfe2['vtigerAccounts'][_0x39a524['id']])){_0x15dfe2[_0xf102('0x1f')][_0x39a524['id']]=new VtigerAccount(_0x39a524);}else{_0x15dfe2['mergeFromDatabase'](_0x15dfe2[_0xf102('0x1f')][_0x39a524['id']],_0x39a524);}}}return _0x15dfe2[_0xf102('0x1f')];};};Realtime['prototype'][_0xf102('0x50')]=function(){var _0x16a651=this;return function(_0x2e75d2){if(_0x2e75d2){freeIsNotKey(_0x2e75d2,_0x16a651[_0xf102('0x51')],'id');for(var _0x615ce7=0x0,_0x5d80ff={},_0x19c013={};_0x615ce7<_0x2e75d2[_0xf102('0x42')];_0x615ce7+=0x1){_0x5d80ff=_0x2e75d2[_0x615ce7];if(_[_0xf102('0x3f')](_0x16a651[_0xf102('0x51')][_0x5d80ff['id']])){_0x16a651['servicenowAccounts'][_0x5d80ff['id']]=new ServicenowAccount(_0x5d80ff);}else{_0x16a651['mergeFromDatabase'](_0x16a651[_0xf102('0x51')][_0x5d80ff['id']],_0x5d80ff);}}}return _0x16a651[_0xf102('0x51')];};};Realtime['prototype'][_0xf102('0x52')]=function(){var _0x17b243=this;return function(_0x374b24){if(_0x374b24){freeIsNotKey(_0x374b24,_0x17b243['dynamics365Accounts'],'id');for(var _0x45e8c4=0x0,_0x587c04={},_0xf9cc70={};_0x45e8c4<_0x374b24['length'];_0x45e8c4+=0x1){_0x587c04=_0x374b24[_0x45e8c4];if(_[_0xf102('0x3f')](_0x17b243[_0xf102('0x20')][_0x587c04['id']])){_0x17b243[_0xf102('0x20')][_0x587c04['id']]=new Dynamics365Account(_0x587c04);}else{_0x17b243['mergeFromDatabase'](_0x17b243['dynamics365Accounts'][_0x587c04['id']],_0x587c04);}}}return _0x17b243[_0xf102('0x20')];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x72fec=this;return function(_0x119714){if(_0x119714){freeIsNotKey(_0x119714,_0x72fec[_0xf102('0x21')],'id');for(var _0x53d7c8=0x0,_0x4070f7={},_0x14355c={};_0x53d7c8<_0x119714[_0xf102('0x42')];_0x53d7c8+=0x1){_0x4070f7=_0x119714[_0x53d7c8];if(_['isUndefined'](_0x72fec[_0xf102('0x21')][_0x4070f7['id']])){_0x72fec[_0xf102('0x21')][_0x4070f7['id']]=new FreshsalesAccount(_0x4070f7);}else{_0x72fec['mergeFromDatabase'](_0x72fec[_0xf102('0x21')][_0x4070f7['id']],_0x4070f7);}}}return _0x72fec['freshsalesAccounts'];};};Realtime[_0xf102('0x3c')]['initVoiceQueueHopperHistory']=function(){var _0x1e5c2a=this;return function(_0x2aea7a){for(var _0x4200fd=0x0;_0x4200fd<_0x2aea7a[_0xf102('0x42')];_0x4200fd+=0x1){_[_0xf102('0x53')](_0x1e5c2a['voiceQueues'][_0x2aea7a[_0x4200fd][_0xf102('0x25')]],_0x2aea7a[_0x4200fd]);}return _0x1e5c2a[_0xf102('0x43')];};};Realtime[_0xf102('0x3c')][_0xf102('0x54')]=function(){var _0x308bc1=this;return function(_0x154f87){clearVoiceQueues(_0x308bc1[_0xf102('0x43')]);if(_0x154f87){_0x154f87=_['groupBy'](_0x154f87,_0xf102('0x55'));for(var _0x49d559 in _0x154f87){if(_0x154f87['hasOwnProperty'](_0x49d559)){var _0x342df2={};for(var _0x255f9e=0x0;_0x255f9e<_0x154f87[_0x49d559][_0xf102('0x42')];_0x255f9e+=0x1){var _0x15eee9=_0x154f87[_0x49d559][_0x255f9e]['queue'];if(_0x308bc1[_0xf102('0x43')][_0x15eee9]){if(_0x154f87[_0x49d559][_0x255f9e][_0xf102('0x56')]){_0x308bc1['voiceQueues'][_0x15eee9][_0xf102('0x57')]+=0x1;}if(_0x154f87[_0x49d559][_0x255f9e][_0xf102('0x58')]){_0x308bc1[_0xf102('0x43')][_0x15eee9][_0xf102('0x59')]+=0x1;}_0x308bc1[_0xf102('0x43')][_0x15eee9]['sumHoldTime']+=moment(_0x154f87[_0x49d559][_0x255f9e][_0xf102('0x5a')])['diff'](moment(_0x154f87[_0x49d559][_0x255f9e][_0xf102('0x5b')]),_0xf102('0x5c'))||0x0;if(_0x255f9e===_0x154f87[_0x49d559][_0xf102('0x42')]-0x1){_0x308bc1[_0xf102('0x43')][_0x15eee9][_0xf102('0x2a')]+=moment(_0x154f87[_0x49d559][_0x255f9e][_0xf102('0x5d')]||_0x154f87[_0x49d559][_0x255f9e][_0xf102('0x5e')]||_0x154f87[_0x49d559][_0x255f9e]['queuecallerexitAt'])[_0xf102('0x5f')](moment(_0x154f87[_0x49d559][_0x255f9e][_0xf102('0x5b')]),'seconds')||0x0;_0x308bc1[_0xf102('0x43')][_0x15eee9][_0xf102('0x28')]+=0x1;if(_0x154f87[_0x49d559][_0x255f9e][_0xf102('0x60')]){_0x308bc1[_0xf102('0x43')][_0x15eee9]['answered']+=0x1;_0x308bc1['voiceQueues'][_0x15eee9][_0xf102('0x2f')]+=moment(_0x154f87[_0x49d559][_0x255f9e]['queuecallercompleteAt'])[_0xf102('0x5f')](moment(_0x154f87[_0x49d559][_0x255f9e][_0xf102('0x5a')]),_0xf102('0x5c'))||0x0;}}else{_0x308bc1[_0xf102('0x43')][_0x15eee9]['sumDuration']+=_0x308bc1[_0xf102('0x43')][_0x15eee9]['sumHoldTime']||0x0;}}}}}}return _0x308bc1['voiceQueues'];};};Realtime[_0xf102('0x3c')][_0xf102('0x61')]=function(){var _0x1af92d=this;return function(_0x38f802){clearVoiceCallReports(_0x1af92d['outbound']);if(_0x38f802){for(var _0x25fa34=0x0;_0x25fa34<_0x38f802[_0xf102('0x42')];_0x25fa34+=0x1){_0x1af92d[_0xf102('0x15')][_0xf102('0x28')]+=0x1;_0x1af92d[_0xf102('0x15')][_0xf102('0x2a')]+=_0x38f802[_0x25fa34][_0xf102('0x62')];if(_0x38f802[_0x25fa34]['disposition']===_0xf102('0x63')){_0x1af92d[_0xf102('0x15')][_0xf102('0x2e')]+=0x1;_0x1af92d[_0xf102('0x15')][_0xf102('0x29')]+=_0x38f802[_0x25fa34][_0xf102('0x62')]-_0x38f802[_0x25fa34][_0xf102('0x64')]||0x0;_0x1af92d['outbound'][_0xf102('0x2f')]+=_0x38f802[_0x25fa34][_0xf102('0x64')];}}}return _0x1af92d[_0xf102('0x15')];};};Realtime[_0xf102('0x3c')][_0xf102('0x65')]=function(){var _0x5cb86d=this;return function(_0x41f04d){if(_0x41f04d){freeIsNotKey(_0x41f04d,_0x5cb86d[_0xf102('0x13')],_0xf102('0x25'));for(var _0x43fb1d=0x0,_0x1e227c={};_0x43fb1d<_0x41f04d[_0xf102('0x42')];_0x43fb1d+=0x1){_0x1e227c=_0x41f04d[_0x43fb1d];if(_[_0xf102('0x3f')](_0x5cb86d[_0xf102('0x13')][_0x1e227c[_0xf102('0x25')]])){_0x5cb86d[_0xf102('0x13')][_0x1e227c['name']]=new Campaign(_0x1e227c);}else{_0x5cb86d[_0xf102('0x3d')](_0x5cb86d[_0xf102('0x13')][_0x1e227c[_0xf102('0x25')]],_0x1e227c);_0x5cb86d[_0xf102('0x13')][_0x1e227c[_0xf102('0x25')]][_0xf102('0x66')]=_0x1e227c[_0xf102('0x67')]?_0x1e227c[_0xf102('0x67')][_0xf102('0x25')]:undefined;}}}return _0x5cb86d[_0xf102('0x13')];};};Realtime[_0xf102('0x3c')]['initVoiceExtensions']=function(){var _0x3ba04e=this;return function(_0x4a2908){if(_0x4a2908){freeIsNotKey(_0x4a2908,_0x3ba04e['voiceExtensions'],'id');for(var _0x343fa6=0x0,_0x3e458b={};_0x343fa6<_0x4a2908[_0xf102('0x42')];_0x343fa6+=0x1){_0x3e458b=_0x4a2908[_0x343fa6];if(_[_0xf102('0x3f')](_0x3ba04e['voiceExtensions'][_0x3e458b['id']])){_0x3ba04e[_0xf102('0x16')][_0x3e458b['id']]=new VoiceExtension(_0x3e458b);}else{_0x3ba04e[_0xf102('0x3d')](_0x3ba04e[_0xf102('0x16')][_0x3e458b['id']],_0x3e458b);}}}return _0x3ba04e[_0xf102('0x16')];};};Realtime[_0xf102('0x3c')][_0xf102('0x68')]=function(){var _0x5df459=this;return function(_0x9d999e){clearCampaigns(_0x5df459['campaigns']);for(var _0x624a58=0x0;_0x624a58<_0x9d999e['length'];_0x624a58+=0x1){_[_0xf102('0x53')](_0x5df459[_0xf102('0x13')][_0x9d999e[_0x624a58][_0xf102('0x25')]],_0x9d999e[_0x624a58]);}return _0x5df459[_0xf102('0x13')];};};Realtime[_0xf102('0x3c')][_0xf102('0x69')]=function(){var _0x1e4d28=this;return function(_0x4cb614){if(_0x4cb614){freeIsNotKey(_0x4cb614,_0x1e4d28[_0xf102('0x6a')],'id');for(var _0x510746=0x0,_0x2c0c81={},_0x185e89={};_0x510746<_0x4cb614[_0xf102('0x42')];_0x510746+=0x1){_0x2c0c81=_0x4cb614[_0x510746];if(_['isUndefined'](_0x1e4d28[_0xf102('0x6a')][_0x2c0c81['id']])){_0x1e4d28[_0xf102('0x6a')][_0x2c0c81['id']]=new FaxAccount(_0x2c0c81);}else{_0x1e4d28[_0xf102('0x3d')](_0x1e4d28['faxAccounts'][_0x2c0c81['id']],_0x2c0c81);}}}return _0x1e4d28[_0xf102('0x6a')];};};module[_0xf102('0x6b')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 067abf2..919b01f 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 _0x8f8b=['name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','isNil','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','outbound','internal','destination','type','dialer','lastapplication','queue','lastdata','from-voip-provider','context','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','substring','indexOf','mobile','phone','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode'];(function(_0x92194b,_0x4ab522){var _0xc29e4e=function(_0x2ead75){while(--_0x2ead75){_0x92194b['push'](_0x92194b['shift']());}};_0xc29e4e(++_0x4ab522);}(_0x8f8b,0x150));var _0xb8f8=function(_0x386fcb,_0x5c5136){_0x386fcb=_0x386fcb-0x0;var _0x43c8f1=_0x8f8b[_0x386fcb];return _0x43c8f1;};'use strict';var _=require('lodash');var moment=require(_0xb8f8('0x0'));var util=require('util');var config=require(_0xb8f8('0x1'));var ami=require(_0xb8f8('0x2'));var RpcVoiceAgentReport=require(_0xb8f8('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xb8f8('0x4'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xb8f8('0x5'));var VoiceQueueReport=require(_0xb8f8('0x6'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xb8f8('0x7'));var VoiceDialReport=require(_0xb8f8('0x8'));var UserReport=require(_0xb8f8('0x9'));function Report(_0x284939){this['realtime']=_0x284939;this[_0xb8f8('0xa')]=_0x284939[_0xb8f8('0xa')];this[_0xb8f8('0xb')]=_0x284939[_0xb8f8('0xb')];}Report[_0xb8f8('0xc')][_0xb8f8('0xd')]=function(_0x1ea37e){var _0x120742=new VoiceQueueReport(this['realtime']);var _0x5cad52=new VoiceAgentReport(this['realtime']);var _0x14e321=new VoiceDialReport(this[_0xb8f8('0xe')]);var _0x148300=new VoiceCallReport(this[_0xb8f8('0xe')]);var _0x5cc1fc=new UserReport(this[_0xb8f8('0xe')]);if(config['xdr']&&config['xdr'][_0xb8f8('0xf')]){ami['on'](_0xb8f8('0x10'),this[_0xb8f8('0x11')][_0xb8f8('0x12')](this));ami['on'](_0xb8f8('0x13'),this[_0xb8f8('0x14')][_0xb8f8('0x12')](this));ami['on'](_0xb8f8('0x15'),this[_0xb8f8('0x16')][_0xb8f8('0x12')](this));ami['on'](_0xb8f8('0x17'),this[_0xb8f8('0x18')][_0xb8f8('0x12')](this));ami['on'](_0xb8f8('0x19'),this[_0xb8f8('0x1a')][_0xb8f8('0x12')](this));ami['on'](_0xb8f8('0x1b'),this[_0xb8f8('0x1c')][_0xb8f8('0x12')](this));}};Report[_0xb8f8('0xc')][_0xb8f8('0x1d')]=function(_0x14232c){var _0x808ddb;_0x808ddb=_[_0xb8f8('0x1e')](this[_0xb8f8('0xa')],function(_0x3783ff){return _0x3783ff[_0xb8f8('0x1f')]==_0x14232c||_0x3783ff[_0xb8f8('0x20')]==_0x14232c;});if(_['isNil'](_0x808ddb)){var _0x2794ea=_[_0xb8f8('0x1e')](this['telephones'],function(_0x2cc2c3){return _0x2cc2c3[_0xb8f8('0x1f')]==_0x14232c||_0x2cc2c3['name']==_0x14232c;});if(_0x2794ea){_0x808ddb=_[_0xb8f8('0x1e')](this['agents'],function(_0x778372){return _0x778372[_0xb8f8('0x21')]==util[_0xb8f8('0x22')](_0xb8f8('0x23'),_0x2794ea['name']);});}}return _0x808ddb;};Report[_0xb8f8('0xc')]['voiceQueueReport']=function(_0x169937){for(var _0x4af6d0=0x0;_0x4af6d0<_0x169937[_0xb8f8('0x24')];_0x4af6d0+=0x1){var _0xf95c7e=this[_0xb8f8('0x1d')](_0x169937[_0x4af6d0][_0xb8f8('0x25')]);if(_0xf95c7e){_0x169937[_0x4af6d0][_0xb8f8('0x1f')]=_0xf95c7e[_0xb8f8('0x1f')];_0x169937[_0x4af6d0][_0xb8f8('0x26')]=!![];_0x169937[_0x4af6d0][_0xb8f8('0x27')]=_0xf95c7e[_0xb8f8('0x20')];_0x169937[_0x4af6d0]['interface']=_[_0xb8f8('0x28')](_0xf95c7e[_0xb8f8('0x21')])?util[_0xb8f8('0x22')](_0xb8f8('0x23'),_0xf95c7e[_0xb8f8('0x20')]):_0xf95c7e[_0xb8f8('0x21')];if(_0x169937[_0x4af6d0][_0xb8f8('0x29')]){_0x169937[_0x4af6d0]['queuecallercompleteAt']=moment()[_0xb8f8('0x22')](_0xb8f8('0x2a'));}if(_0x169937[_0x4af6d0][_0xb8f8('0x2b')]){_0x169937[_0x4af6d0][_0xb8f8('0x2c')]=moment()['format'](_0xb8f8('0x2a'));}RpcMemberReport[_0xb8f8('0x11')](_0x169937[_0x4af6d0]);}RpcVoiceQueueReport[_0xb8f8('0x2d')](_0x169937[_0x4af6d0]);}};function extractCalleridNumber(_0x5ae60a){var _0x1c7306=_0x5ae60a[_0xb8f8('0x2e')](/<(.*?)>/);return _0x1c7306?_0x1c7306[0x1]:_0x5ae60a;}Report[_0xb8f8('0xc')][_0xb8f8('0x2f')]=function(_0x5cc1d5){for(var _0x1fc93b=0x0;_0x1fc93b','calleridname','transfers','linkedid','UserId','getAgentByInternal','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','isArray','startsWith','substring','mobile','phone','indexOf','transfererlinkedid','exports','lodash','moment','util','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','agents','telephones','prototype','sync','realtime','xdr','disabled','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','SIP/%s','voiceQueueReport'];(function(_0xf1d80e,_0x3ca18b){var _0x5eefc2=function(_0x5d1726){while(--_0x5d1726){_0xf1d80e['push'](_0xf1d80e['shift']());}};_0x5eefc2(++_0x3ca18b);}(_0xa1bd,0x91));var _0xda1b=function(_0x570daa,_0xf2a520){_0x570daa=_0x570daa-0x0;var _0x1cee3b=_0xa1bd[_0x570daa];return _0x1cee3b;};'use strict';var _=require(_0xda1b('0x0'));var moment=require(_0xda1b('0x1'));var util=require(_0xda1b('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0xda1b('0x3'));var RpcVoiceCallReport=require(_0xda1b('0x4'));var RpcVoiceDialReport=require(_0xda1b('0x5'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xda1b('0x6'));var RpcVoiceRecording=require(_0xda1b('0x7'));var RpcVoiceTransferReport=require(_0xda1b('0x8'));var VoiceQueueReport=require(_0xda1b('0x9'));var VoiceCallReport=require(_0xda1b('0xa'));var VoiceAgentReport=require(_0xda1b('0xb'));var VoiceDialReport=require(_0xda1b('0xc'));var UserReport=require('./userReport');function Report(_0x302f97){this['realtime']=_0x302f97;this[_0xda1b('0xd')]=_0x302f97[_0xda1b('0xd')];this[_0xda1b('0xe')]=_0x302f97[_0xda1b('0xe')];}Report[_0xda1b('0xf')][_0xda1b('0x10')]=function(_0x48e441){var _0x42d6f0=new VoiceQueueReport(this[_0xda1b('0x11')]);var _0x586a7f=new VoiceAgentReport(this['realtime']);var _0x412a8a=new VoiceDialReport(this['realtime']);var _0x416005=new VoiceCallReport(this[_0xda1b('0x11')]);var _0x5180f5=new UserReport(this['realtime']);if(config[_0xda1b('0x12')]&&config[_0xda1b('0x12')][_0xda1b('0x13')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0xda1b('0x14')](this));ami['on'](_0xda1b('0x15'),this[_0xda1b('0x16')][_0xda1b('0x14')](this));ami['on'](_0xda1b('0x17'),this[_0xda1b('0x18')][_0xda1b('0x14')](this));ami['on'](_0xda1b('0x19'),this[_0xda1b('0x1a')][_0xda1b('0x14')](this));ami['on'](_0xda1b('0x1b'),this[_0xda1b('0x1c')][_0xda1b('0x14')](this));ami['on']('attendedtransfer',this[_0xda1b('0x1d')][_0xda1b('0x14')](this));}};Report[_0xda1b('0xf')][_0xda1b('0x1e')]=function(_0x2511da){var _0x7dd822;_0x7dd822=_[_0xda1b('0x1f')](this['agents'],function(_0x2c1e57){return _0x2c1e57[_0xda1b('0x20')]==_0x2511da||_0x2c1e57[_0xda1b('0x21')]==_0x2511da;});if(_[_0xda1b('0x22')](_0x7dd822)){var _0xa6b93a=_['find'](this[_0xda1b('0xe')],function(_0x3b9586){return _0x3b9586[_0xda1b('0x20')]==_0x2511da||_0x3b9586[_0xda1b('0x21')]==_0x2511da;});if(_0xa6b93a){_0x7dd822=_[_0xda1b('0x1f')](this[_0xda1b('0xd')],function(_0x3817e2){return _0x3817e2['interface']==util['format'](_0xda1b('0x23'),_0xa6b93a[_0xda1b('0x21')]);});}}return _0x7dd822;};Report['prototype'][_0xda1b('0x24')]=function(_0x584ec4){for(var _0x20a160=0x0;_0x20a160<_0x584ec4['length'];_0x20a160+=0x1){var _0x37f731=this['findAgent'](_0x584ec4[_0x20a160][_0xda1b('0x25')]);if(_0x37f731){_0x584ec4[_0x20a160][_0xda1b('0x20')]=_0x37f731[_0xda1b('0x20')];_0x584ec4[_0x20a160]['assigned']=!![];_0x584ec4[_0x20a160][_0xda1b('0x26')]=_0x37f731[_0xda1b('0x21')];_0x584ec4[_0x20a160][_0xda1b('0x27')]=_[_0xda1b('0x22')](_0x37f731['interface'])?util['format'](_0xda1b('0x23'),_0x37f731['name']):_0x37f731['interface'];if(_0x584ec4[_0x20a160][_0xda1b('0x28')]){_0x584ec4[_0x20a160]['queuecallercompleteAt']=moment()['format'](_0xda1b('0x29'));}if(_0x584ec4[_0x20a160][_0xda1b('0x2a')]){_0x584ec4[_0x20a160]['queuecallerexitAt']=moment()[_0xda1b('0x2b')](_0xda1b('0x29'));}RpcMemberReport[_0xda1b('0x24')](_0x584ec4[_0x20a160]);}RpcVoiceQueueReport[_0xda1b('0x2c')](_0x584ec4[_0x20a160]);}};function extractCalleridNumber(_0x5e98f1){var _0x268ba0=_0x5e98f1[_0xda1b('0x2d')](/<(.*?)>/);return _0x268ba0?_0x268ba0[0x1]:_0x5e98f1;}Report['prototype']['getAgentByInternal']=function(_0x1f8a8d){for(var _0x3a7673=0x0;_0x3a76730x0?_0x302696:0x0;this['voiceQueues'][_0x3a8974[_0x98c0('0x62')]][_0x98c0('0x2b')]=this[_0x98c0('0x11')][_0x3a8974['queue']]['talking']>_[_0x98c0('0x66')](_0x3a8974[_0x98c0('0x67')])?_['toNumber'](_0x3a8974[_0x98c0('0x67')]):this['voiceQueues'][_0x3a8974['queue']][_0x98c0('0x2b')];this[_0x98c0('0x4a')](this[_0x98c0('0x11')][_0x3a8974['queue']],'queuesummary');}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x98c0('0x36')](this[_0x98c0('0x11')][_0x3a8974[_0x98c0('0x62')]],{'showHidden':![],'depth':null}));ami[_0x98c0('0x3c')](_0x98c0('0x69'),this['voiceQueues'][_0x3a8974[_0x98c0('0x62')]]);}}}catch(_0x554da0){logger[_0x98c0('0x34')](_0x98c0('0x61'),util[_0x98c0('0x36')](_0x554da0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x98c0('0x9')]['syncQueueSummaryComplete']=function(_0x3524e5){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x98c0('0x36')](_0x3524e5,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x98c0('0x17')]=function(_0x3c462d){try{if(this[_0x98c0('0x5b')](_0x3c462d)){logger[_0x98c0('0x3e')](_0x98c0('0x6a'),_0x3c462d[_0x98c0('0x41')],util[_0x98c0('0x36')](_0x3c462d,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x98c0('0x37')][_0x3c462d[_0x98c0('0x41')]]))this[_0x98c0('0x37')][_0x3c462d[_0x98c0('0x41')]]=[];if(_[_0x98c0('0x5c')](this[_0x98c0('0xf')][_0x3c462d['uniqueid']]))this[_0x98c0('0xf')][_0x3c462d[_0x98c0('0x41')]]={};var _0x46049c=new QueueReport();_0x46049c[_0x98c0('0x44')]=_0x3c462d['queue'];_0x46049c['type']=this[_0x98c0('0x11')][_0x46049c[_0x98c0('0x44')]]&&this[_0x98c0('0x11')][_0x46049c['name']][_0x98c0('0x53')]?this['voiceQueues'][_0x46049c[_0x98c0('0x44')]][_0x98c0('0x53')]||_0x98c0('0x4b'):'inbound';_0x46049c[_0x98c0('0x62')]=_0x3c462d['queue'];_0x46049c[_0x98c0('0x6b')]=moment()[_0x98c0('0x42')](_0x98c0('0x6c'));_0x46049c[_0x98c0('0x6d')]=_0x3c462d['position'];_0x46049c[_0x98c0('0x6e')]=_0x3c462d[_0x98c0('0x6e')];_0x46049c[_0x98c0('0x41')]=_0x3c462d[_0x98c0('0x41')];_0x46049c[_0x98c0('0x6f')]=this['channels'][_0x3c462d[_0x98c0('0x41')]][_0x98c0('0x6f')];logger[_0x98c0('0x64')](_0x98c0('0x70'),_0x46049c[_0x98c0('0x44')],_0x46049c[_0x98c0('0x53')]);_['merge'](_0x46049c,_[_0x98c0('0x71')](_0x3c462d,_[_0x98c0('0x72')](_0x46049c)));this[_0x98c0('0x37')][_0x3c462d[_0x98c0('0x41')]]['push'](_0x46049c);this['channels'][_0x3c462d['uniqueid']]=_0x46049c;this[_0x98c0('0x3d')](_0x46049c,'queuecallerjoin');}}catch(_0x2b38a2){logger[_0x98c0('0x34')]('[%s][voiceQueueReport][queuecallerjoin]',_0x3c462d[_0x98c0('0x41')],util[_0x98c0('0x36')](_0x2b38a2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x98c0('0x9')]['syncQueueCallerAbandon']=function(_0x23a7c1){try{if(this[_0x98c0('0x5b')](_0x23a7c1)){logger[_0x98c0('0x3e')](_0x98c0('0x73'),_0x23a7c1[_0x98c0('0x41')],util[_0x98c0('0x36')](_0x23a7c1,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x23a7c1[_0x98c0('0x41')]]){var _0x1a4320=_[_0x98c0('0x74')](this['queueReports'][_0x23a7c1[_0x98c0('0x41')]]);_0x1a4320[_0x98c0('0x75')]=![];_0x1a4320['queuecallercompleteAt']=null;_0x1a4320['holdtime']=_0x23a7c1[_0x98c0('0x76')];_0x1a4320[_0x98c0('0x77')]=_0x23a7c1['originalposition'];_0x1a4320[_0x98c0('0x19')]=!![];_0x1a4320['queuecallerabandonAt']=moment()[_0x98c0('0x42')](_0x98c0('0x6c'));_0x1a4320[_0x98c0('0x48')]=_0x98c0('0x78');_0x1a4320['lastAssignedTo']=null;logger[_0x98c0('0x64')](_0x98c0('0x79'),_0x1a4320['name'],_0x1a4320['type']);this[_0x98c0('0xf')][_0x23a7c1['uniqueid']]=_0x1a4320;this[_0x98c0('0x3b')](_0x1a4320,_0x98c0('0x19'));}}}catch(_0x2eb66c){logger[_0x98c0('0x34')](_0x98c0('0x73'),_0x23a7c1['uniqueid'],util[_0x98c0('0x36')](_0x2eb66c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x98c0('0x1b')]=function(_0x1393cb){try{if(this[_0x98c0('0x5b')](_0x1393cb)){logger[_0x98c0('0x3e')]('[%s][voiceQueueReport][queuecallerleave]',_0x1393cb[_0x98c0('0x41')],util[_0x98c0('0x36')](_0x1393cb,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1393cb[_0x98c0('0x41')]]){var _0x36dd3e=_[_0x98c0('0x74')](this[_0x98c0('0x37')][_0x1393cb[_0x98c0('0x41')]]);_0x36dd3e[_0x98c0('0x7a')]=moment()[_0x98c0('0x42')]('YYYY-MM-DD\x20HH:mm:ss');_0x36dd3e[_0x98c0('0x7b')]=_0x1393cb[_0x98c0('0x7b')];_0x36dd3e[_0x98c0('0x7c')]=_0x1393cb[_0x98c0('0x7c')];logger[_0x98c0('0x64')](_0x98c0('0x7d'),_0x36dd3e[_0x98c0('0x44')],_0x36dd3e[_0x98c0('0x53')],_0x1393cb[_0x98c0('0x7b')],_0x1393cb[_0x98c0('0x7c')]);this[_0x98c0('0xf')][_0x1393cb['uniqueid']]=_0x36dd3e;this[_0x98c0('0x3d')](_0x36dd3e,'queuecallerleave');}}}catch(_0x3504cf){logger[_0x98c0('0x34')](_0x98c0('0x7e'),_0x1393cb[_0x98c0('0x41')],util[_0x98c0('0x36')](_0x3504cf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x98c0('0x9')][_0x98c0('0x7f')]=function(_0x1d6613){try{if(this[_0x98c0('0x5b')](_0x1d6613)){logger[_0x98c0('0x3e')](_0x98c0('0x80'),_0x1d6613[_0x98c0('0x41')],util[_0x98c0('0x36')](_0x1d6613,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1d6613[_0x98c0('0x41')]]){var _0x550342=_[_0x98c0('0x74')](this[_0x98c0('0x37')][_0x1d6613['uniqueid']]);_0x550342[_0x98c0('0x75')]=!![];_0x550342[_0x98c0('0x48')]=_0x98c0('0x81');logger['info'](_0x98c0('0x82'),_0x550342[_0x98c0('0x44')],_0x550342[_0x98c0('0x53')]);}}}catch(_0x1d2d0a){logger[_0x98c0('0x34')]('[%s][voiceQueueReport][agentconnect]',_0x1d6613[_0x98c0('0x41')],util[_0x98c0('0x36')](_0x1d2d0a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x98c0('0x9')][_0x98c0('0x1c')]=function(_0x43c3fa){try{if(this[_0x98c0('0x5b')](_0x43c3fa)){logger[_0x98c0('0x3e')]('[%s][voiceQueueReport][agentcomplete]',_0x43c3fa[_0x98c0('0x41')],util[_0x98c0('0x36')](_0x43c3fa,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x43c3fa['uniqueid']]){var _0x17372b=_['last'](this[_0x98c0('0x37')][_0x43c3fa[_0x98c0('0x41')]]);_0x17372b[_0x98c0('0x19')]=![];_0x17372b[_0x98c0('0x83')]=null;_0x17372b[_0x98c0('0x84')]=!![];_0x17372b[_0x98c0('0x85')]=_0x43c3fa['membername'];_0x17372b[_0x98c0('0x76')]=_0x43c3fa['holdtime'];_0x17372b[_0x98c0('0x75')]=!![];_0x17372b[_0x98c0('0x86')]=![];_0x17372b[_0x98c0('0x87')]=null;if(!_0x17372b[_0x98c0('0x88')]){if(_0x43c3fa[_0x98c0('0x89')]==_0x98c0('0x88')){_0x17372b[_0x98c0('0x48')]='COMPLETED';logger[_0x98c0('0x64')](_0x98c0('0x8a'),_0x17372b[_0x98c0('0x44')],_0x17372b[_0x98c0('0x53')]);}else{if(_['startsWith'](_0x43c3fa[_0x98c0('0x32')][_0x98c0('0x8b')](),'local/')){if(this['queueReports'][_0x43c3fa[_0x98c0('0x8c')]]){var _0x595510=_[_0x98c0('0x74')](this['queueReports'][_0x43c3fa[_0x98c0('0x8c')]]);_0x595510[_0x98c0('0x75')]=![];_0x595510[_0x98c0('0x86')]=!![];_0x595510['queuecallerexitAt']=moment(_0x17372b['queuecallerjoinAt'])[_0x98c0('0x8d')](_0x43c3fa[_0x98c0('0x76')],'seconds')[_0x98c0('0x42')](_0x98c0('0x6c'));_0x595510[_0x98c0('0x48')]=_0x98c0('0x8e');_0x595510[_0x98c0('0x88')]=!![];_0x595510[_0x98c0('0x8f')]=_0x98c0('0x90');_0x595510[_0x98c0('0x91')]=_0x43c3fa[_0x98c0('0x92')];_0x595510[_0x98c0('0x93')]=_0x43c3fa['uniqueid'];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x595510['name'],_0x595510['type']);var _0x2d2797=this[_0x98c0('0x37')][_0x43c3fa[_0x98c0('0x8c')]];this['queueReports'][_0x43c3fa[_0x98c0('0x8c')]]=this['queueReports'][_0x43c3fa[_0x98c0('0x41')]];this['queueReports'][_0x43c3fa[_0x98c0('0x41')]]=_0x2d2797;}}else{_0x17372b[_0x98c0('0x48')]=_0x98c0('0x94')+_0x43c3fa['reason'][_0x98c0('0x95')]();logger[_0x98c0('0x64')](_0x98c0('0x96'),_0x17372b[_0x98c0('0x44')],_0x17372b[_0x98c0('0x53')],_0x17372b[_0x98c0('0x48')]);}}}this[_0x98c0('0xf')][_0x43c3fa['uniqueid']]=_0x17372b;this[_0x98c0('0x3b')](_0x17372b,'agentcomplete');}}}catch(_0x5ec82a){logger[_0x98c0('0x34')](_0x98c0('0x97'),_0x43c3fa[_0x98c0('0x41')],util[_0x98c0('0x36')](_0x5ec82a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x3bbc42){try{if(this[_0x98c0('0x5b')](_0x3bbc42)){logger['debug'](_0x98c0('0x98'),_0x3bbc42[_0x98c0('0x41')],util[_0x98c0('0x36')](_0x3bbc42,{'showHidden':![],'depth':null}));this[_0x98c0('0x99')](_0x3bbc42[_0x98c0('0x41')],_[_0x98c0('0x72')](_0x3bbc42[_0x98c0('0x9a')])[0x0],_0x3bbc42['value']);if(this[_0x98c0('0x37')][_0x3bbc42[_0x98c0('0x41')]]){var _0x49f2c1=_[_0x98c0('0x74')](this[_0x98c0('0x37')][_0x3bbc42[_0x98c0('0x41')]]);if(_0x49f2c1){if(this[_0x98c0('0x5b')](_0x3bbc42['variable'])&&this[_0x98c0('0x5b')](_0x3bbc42[_0x98c0('0x9a')][_0x98c0('0x9b')])){switch(_0x3bbc42[_0x98c0('0x9c')]){case _0x98c0('0x9d'):_0x49f2c1['queuecallerexit']=![];_0x49f2c1[_0x98c0('0x87')]=null;break;case _0x98c0('0x9e'):_0x49f2c1['lastevent']=_0x98c0('0x9f');_0x49f2c1['queuecallerexit']=!![];_0x49f2c1[_0x98c0('0x87')]=moment()['format'](_0x98c0('0x6c'));_0x49f2c1[_0x98c0('0x7a')]=moment()[_0x98c0('0x42')](_0x98c0('0x6c'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x3bbc42['uniqueid'],util['inspect'](_0x49f2c1,{'showHidden':![],'depth':null}));ami['emit'](_0x98c0('0xa0'),_0x49f2c1);break;default:_0x49f2c1[_0x98c0('0x86')]=!![];_0x49f2c1[_0x98c0('0x87')]=moment()['format'](_0x98c0('0x6c'));_0x49f2c1[_0x98c0('0x7a')]=moment()[_0x98c0('0x42')](_0x98c0('0x6c'));}_0x49f2c1[_0x98c0('0x19')]=![];_0x49f2c1[_0x98c0('0x83')]=null;_0x49f2c1[_0x98c0('0x48')]=_0x3bbc42[_0x98c0('0x9c')];this['channels'][_0x3bbc42[_0x98c0('0x41')]]=_0x49f2c1;this[_0x98c0('0x3b')](_0x49f2c1,_0x98c0('0x1e'));}else if(this[_0x98c0('0x5b')](_0x3bbc42[_0x98c0('0x9a')])&&this[_0x98c0('0x5b')](_0x3bbc42[_0x98c0('0x9a')]['queueposition'])){if(!_0x49f2c1['queuecallerabandon']){_0x49f2c1[_0x98c0('0x86')]=!![];_0x49f2c1[_0x98c0('0x87')]=moment()[_0x98c0('0x42')](_0x98c0('0x6c'));_0x49f2c1[_0x98c0('0x48')]=_0x98c0('0xa1');_0x49f2c1[_0x98c0('0x7a')]=moment()[_0x98c0('0x42')](_0x98c0('0x6c'));this[_0x98c0('0xf')][_0x3bbc42[_0x98c0('0x41')]]=_0x49f2c1;}}logger['info'](_0x98c0('0xa2'),_0x3bbc42[_0x98c0('0x41')],_0x49f2c1['name'],_0x49f2c1[_0x98c0('0x53')],_[_0x98c0('0x72')](_0x3bbc42[_0x98c0('0x9a')])[0x0],_0x3bbc42[_0x98c0('0x9c')]);_0x49f2c1[_0x98c0('0x14')]=this[_0x98c0('0x14')][_0x3bbc42[_0x98c0('0x41')]];}}}}catch(_0x1864a7){logger['error']('[%s][voiceQueueReport][varset]',_0x3bbc42[_0x98c0('0x41')],util[_0x98c0('0x36')](_0x1864a7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x98c0('0x9')][_0x98c0('0x99')]=function(_0x34d2cf,_0x24ad7d,_0x137d6d){var _0x290463=['rtpaudioqos','rtpaudioqosbridged',_0x98c0('0xa3'),_0x98c0('0xa4'),'rtpaudioqosloss',_0x98c0('0xa5'),_0x98c0('0xa6'),_0x98c0('0xa7'),_0x98c0('0xa8'),_0x98c0('0xa9'),_0x98c0('0xaa'),_0x98c0('0xab'),_0x98c0('0xac'),_0x98c0('0xad'),_0x98c0('0xae'),_0x98c0('0xaf'),_0x98c0('0xb0'),_0x98c0('0xb1'),_0x98c0('0xb2')];if(!_[_0x98c0('0x30')](_0x24ad7d)&&!_[_0x98c0('0xb3')](_0x290463,_0x24ad7d)){if(_['isUndefined'](this[_0x98c0('0x14')][_0x34d2cf])){this[_0x98c0('0x14')][_0x34d2cf]={};}this[_0x98c0('0x14')][_0x34d2cf][_0x24ad7d]=_0x137d6d;}};VoiceQueueReport[_0x98c0('0x9')][_0x98c0('0x20')]=function(_0x3315ed){try{if(this[_0x98c0('0x5b')](_0x3315ed)){logger['debug'](_0x98c0('0xb4'),_0x3315ed[_0x98c0('0x41')],util['inspect'](_0x3315ed,{'showHidden':![],'depth':null}));if(this[_0x98c0('0x37')][_0x3315ed[_0x98c0('0x41')]]){for(var _0x475c97=0x0,_0x3d3352={};_0x475c970x0?_0x465ad0:0x0;this[_0x5fc2('0x14')][_0x4e87bf['queue']][_0x5fc2('0x2f')]=this[_0x5fc2('0x14')][_0x4e87bf['queue']][_0x5fc2('0x2f')]>_[_0x5fc2('0x6a')](_0x4e87bf['loggedin'])?_[_0x5fc2('0x6a')](_0x4e87bf[_0x5fc2('0x6c')]):this[_0x5fc2('0x14')][_0x4e87bf['queue']][_0x5fc2('0x2f')];this[_0x5fc2('0x51')](this[_0x5fc2('0x14')][_0x4e87bf['queue']],_0x5fc2('0x6d'));}logger['debug'](_0x5fc2('0x6e'),util['inspect'](this[_0x5fc2('0x14')][_0x4e87bf[_0x5fc2('0x66')]],{'showHidden':![],'depth':null}));ami['emit'](_0x5fc2('0x6f'),this[_0x5fc2('0x14')][_0x4e87bf['queue']]);}}}catch(_0x7be7d0){logger[_0x5fc2('0x3e')](_0x5fc2('0x64'),util['inspect'](_0x7be7d0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5fc2('0xd')][_0x5fc2('0x18')]=function(_0x1a6e96){logger[_0x5fc2('0x4a')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x5fc2('0x3b')](_0x1a6e96,{'showHidden':![],'depth':null}));this[_0x5fc2('0x15')]=!![];};VoiceQueueReport[_0x5fc2('0xd')][_0x5fc2('0x1a')]=function(_0x2f4b0e){try{if(this[_0x5fc2('0x5e')](_0x2f4b0e)){logger[_0x5fc2('0x4a')](_0x5fc2('0x70'),_0x2f4b0e[_0x5fc2('0x47')],util['inspect'](_0x2f4b0e,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x2f4b0e[_0x5fc2('0x47')]]))this[_0x5fc2('0x3c')][_0x2f4b0e[_0x5fc2('0x47')]]=[];if(_[_0x5fc2('0x5f')](this[_0x5fc2('0x12')][_0x2f4b0e['uniqueid']]))this[_0x5fc2('0x12')][_0x2f4b0e[_0x5fc2('0x47')]]={};var _0x3f7f26=new QueueReport();_0x3f7f26['name']=_0x2f4b0e[_0x5fc2('0x66')];_0x3f7f26[_0x5fc2('0x58')]=this[_0x5fc2('0x14')][_0x3f7f26[_0x5fc2('0x4e')]]&&this['voiceQueues'][_0x3f7f26[_0x5fc2('0x4e')]]['type']?this[_0x5fc2('0x14')][_0x3f7f26[_0x5fc2('0x4e')]]['type']||_0x5fc2('0x52'):_0x5fc2('0x52');_0x3f7f26[_0x5fc2('0x66')]=_0x2f4b0e['queue'];_0x3f7f26[_0x5fc2('0x71')]=moment()['format'](_0x5fc2('0x72'));_0x3f7f26[_0x5fc2('0x73')]=_0x2f4b0e[_0x5fc2('0x73')];_0x3f7f26['count']=_0x2f4b0e[_0x5fc2('0x74')];_0x3f7f26[_0x5fc2('0x47')]=_0x2f4b0e[_0x5fc2('0x47')];_0x3f7f26[_0x5fc2('0x75')]=this[_0x5fc2('0x12')][_0x2f4b0e[_0x5fc2('0x47')]]['routealias'];logger['info'](_0x5fc2('0x76'),_0x3f7f26[_0x5fc2('0x4e')],_0x3f7f26['type']);_['merge'](_0x3f7f26,_['pick'](_0x2f4b0e,_[_0x5fc2('0x77')](_0x3f7f26)));this['queueReports'][_0x2f4b0e[_0x5fc2('0x47')]][_0x5fc2('0x78')](_0x3f7f26);this[_0x5fc2('0x12')][_0x2f4b0e[_0x5fc2('0x47')]]=_0x3f7f26;this['emitVoiceQueueChannelSave'](_0x3f7f26,_0x5fc2('0x79'));}}catch(_0x4f7038){logger[_0x5fc2('0x3e')]('[%s][voiceQueueReport][queuecallerjoin]',_0x2f4b0e['uniqueid'],util[_0x5fc2('0x3b')](_0x4f7038,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5fc2('0x1c')]=function(_0x55e6fd){try{if(this[_0x5fc2('0x5e')](_0x55e6fd)){logger[_0x5fc2('0x4a')](_0x5fc2('0x7a'),_0x55e6fd[_0x5fc2('0x47')],util[_0x5fc2('0x3b')](_0x55e6fd,{'showHidden':![],'depth':null}));if(this[_0x5fc2('0x3c')][_0x55e6fd[_0x5fc2('0x47')]]){var _0x3ee35d=_[_0x5fc2('0x7b')](this['queueReports'][_0x55e6fd[_0x5fc2('0x47')]]);_0x3ee35d[_0x5fc2('0x7c')]=![];_0x3ee35d[_0x5fc2('0x7d')]=null;_0x3ee35d[_0x5fc2('0x7e')]=_0x55e6fd['holdtime'];_0x3ee35d[_0x5fc2('0x7f')]=_0x55e6fd['originalposition'];_0x3ee35d['queuecallerabandon']=!![];_0x3ee35d[_0x5fc2('0x80')]=moment()[_0x5fc2('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x3ee35d[_0x5fc2('0x81')]=_0x5fc2('0x82');_0x3ee35d[_0x5fc2('0x83')]=null;logger[_0x5fc2('0x67')](_0x5fc2('0x84'),_0x3ee35d['name'],_0x3ee35d[_0x5fc2('0x58')]);this[_0x5fc2('0x12')][_0x55e6fd[_0x5fc2('0x47')]]=_0x3ee35d;this[_0x5fc2('0x85')](_0x3ee35d,'queuecallerabandon');}}}catch(_0x290e66){logger[_0x5fc2('0x3e')]('[%s][voiceQueueReport][queuecallerabandon]',_0x55e6fd[_0x5fc2('0x47')],util[_0x5fc2('0x3b')](_0x290e66,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5fc2('0xd')]['syncQueueCallerLeave']=function(_0xd718a){try{if(this[_0x5fc2('0x5e')](_0xd718a)){logger['debug'](_0x5fc2('0x86'),_0xd718a['uniqueid'],util[_0x5fc2('0x3b')](_0xd718a,{'showHidden':![],'depth':null}));if(this[_0x5fc2('0x3c')][_0xd718a[_0x5fc2('0x47')]]){var _0x432248=_[_0x5fc2('0x7b')](this[_0x5fc2('0x3c')][_0xd718a[_0x5fc2('0x47')]]);_0x432248[_0x5fc2('0x87')]=moment()[_0x5fc2('0x4d')](_0x5fc2('0x72'));_0x432248[_0x5fc2('0x88')]=_0xd718a['connectedlinenum'];_0x432248[_0x5fc2('0x89')]=_0xd718a[_0x5fc2('0x89')];logger[_0x5fc2('0x67')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x432248[_0x5fc2('0x4e')],_0x432248['type'],_0xd718a['connectedlinenum'],_0xd718a[_0x5fc2('0x89')]);this['channels'][_0xd718a['uniqueid']]=_0x432248;this['emitVoiceQueueChannelSave'](_0x432248,_0x5fc2('0x1d'));}}}catch(_0x4f37bd){logger['error'](_0x5fc2('0x86'),_0xd718a[_0x5fc2('0x47')],util[_0x5fc2('0x3b')](_0x4f37bd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5fc2('0xd')][_0x5fc2('0x21')]=function(_0x294c36){try{if(this[_0x5fc2('0x5e')](_0x294c36)){logger[_0x5fc2('0x4a')](_0x5fc2('0x8a'),_0x294c36[_0x5fc2('0x47')],util[_0x5fc2('0x3b')](_0x294c36,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x294c36[_0x5fc2('0x47')]]){var _0x5b4c3f=_[_0x5fc2('0x7b')](this[_0x5fc2('0x3c')][_0x294c36['uniqueid']]);_0x5b4c3f[_0x5fc2('0x7c')]=!![];_0x5b4c3f[_0x5fc2('0x81')]='COMPLETEDBYAGENT';logger[_0x5fc2('0x67')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x5b4c3f['name'],_0x5b4c3f[_0x5fc2('0x58')]);}}}catch(_0x9123b3){logger[_0x5fc2('0x3e')]('[%s][voiceQueueReport][agentconnect]',_0x294c36['uniqueid'],util[_0x5fc2('0x3b')](_0x9123b3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5fc2('0xd')][_0x5fc2('0x1f')]=function(_0x2b64ac){try{if(this[_0x5fc2('0x5e')](_0x2b64ac)){logger[_0x5fc2('0x4a')](_0x5fc2('0x8b'),_0x2b64ac[_0x5fc2('0x47')],util[_0x5fc2('0x3b')](_0x2b64ac,{'showHidden':![],'depth':null}));if(this[_0x5fc2('0x3c')][_0x2b64ac['uniqueid']]){var _0x137982=_[_0x5fc2('0x7b')](this[_0x5fc2('0x3c')][_0x2b64ac[_0x5fc2('0x47')]]);_0x137982[_0x5fc2('0x1b')]=![];_0x137982[_0x5fc2('0x80')]=null;_0x137982['assigned']=!![];_0x137982[_0x5fc2('0x83')]=_0x2b64ac[_0x5fc2('0x8c')];_0x137982[_0x5fc2('0x7e')]=_0x2b64ac[_0x5fc2('0x7e')];_0x137982[_0x5fc2('0x7c')]=!![];_0x137982['queuecallerexit']=![];_0x137982[_0x5fc2('0x8d')]=null;if(!_0x137982['transfer']){if(_0x2b64ac['reason']=='transfer'){_0x137982['queuecallerexitreason']=_0x5fc2('0x8e');logger[_0x5fc2('0x67')](_0x5fc2('0x8f'),_0x137982['name'],_0x137982[_0x5fc2('0x58')]);}else{if(_[_0x5fc2('0x90')](_0x2b64ac[_0x5fc2('0x38')][_0x5fc2('0x91')](),'local/')){if(this['queueReports'][_0x2b64ac[_0x5fc2('0x92')]]){var _0x455629=_[_0x5fc2('0x7b')](this[_0x5fc2('0x3c')][_0x2b64ac[_0x5fc2('0x92')]]);_0x455629[_0x5fc2('0x7c')]=![];_0x455629[_0x5fc2('0x93')]=!![];_0x455629[_0x5fc2('0x8d')]=moment(_0x137982[_0x5fc2('0x71')])[_0x5fc2('0x94')](_0x2b64ac['holdtime'],_0x5fc2('0x95'))[_0x5fc2('0x4d')](_0x5fc2('0x72'));_0x455629[_0x5fc2('0x81')]=_0x5fc2('0x96');_0x455629[_0x5fc2('0x97')]=!![];_0x455629[_0x5fc2('0x98')]=_0x5fc2('0x99');_0x455629[_0x5fc2('0x9a')]=_0x2b64ac[_0x5fc2('0x9b')];_0x455629[_0x5fc2('0x9c')]=_0x2b64ac[_0x5fc2('0x47')];logger['info'](_0x5fc2('0x9d'),_0x455629['name'],_0x455629[_0x5fc2('0x58')]);var _0x1f3656=this[_0x5fc2('0x3c')][_0x2b64ac[_0x5fc2('0x92')]];this['queueReports'][_0x2b64ac[_0x5fc2('0x92')]]=this[_0x5fc2('0x3c')][_0x2b64ac[_0x5fc2('0x47')]];this['queueReports'][_0x2b64ac[_0x5fc2('0x47')]]=_0x1f3656;}}else{_0x137982['queuecallerexitreason']=_0x5fc2('0x9e')+_0x2b64ac[_0x5fc2('0x9f')][_0x5fc2('0xa0')]();logger[_0x5fc2('0x67')](_0x5fc2('0xa1'),_0x137982[_0x5fc2('0x4e')],_0x137982['type'],_0x137982['queuecallerexitreason']);}}}this[_0x5fc2('0x12')][_0x2b64ac[_0x5fc2('0x47')]]=_0x137982;this['emitVoiceQueueChannelRemove'](_0x137982,_0x5fc2('0x1e'));}}}catch(_0x497cc3){logger[_0x5fc2('0x3e')](_0x5fc2('0x8b'),_0x2b64ac[_0x5fc2('0x47')],util[_0x5fc2('0x3b')](_0x497cc3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5fc2('0xd')][_0x5fc2('0xa2')]=function(_0x286816){try{if(this[_0x5fc2('0x5e')](_0x286816)){logger[_0x5fc2('0x4a')](_0x5fc2('0xa3'),_0x286816[_0x5fc2('0x47')],util['inspect'](_0x286816,{'showHidden':![],'depth':null}));this[_0x5fc2('0xa4')](_0x286816[_0x5fc2('0x47')],_[_0x5fc2('0x77')](_0x286816['variable'])[0x0],_0x286816[_0x5fc2('0xa5')]);if(this[_0x5fc2('0x3c')][_0x286816[_0x5fc2('0x47')]]){var _0x2a944d=_['last'](this['queueReports'][_0x286816[_0x5fc2('0x47')]]);if(_0x2a944d){if(this[_0x5fc2('0x5e')](_0x286816[_0x5fc2('0xa6')])&&this[_0x5fc2('0x5e')](_0x286816[_0x5fc2('0xa6')][_0x5fc2('0xa7')])){switch(_0x286816[_0x5fc2('0xa5')]){case'CONTINUE':_0x2a944d[_0x5fc2('0x93')]=![];_0x2a944d[_0x5fc2('0x8d')]=null;break;case _0x5fc2('0xa8'):_0x2a944d['lastevent']=_0x5fc2('0xa9');_0x2a944d[_0x5fc2('0x93')]=!![];_0x2a944d[_0x5fc2('0x8d')]=moment()[_0x5fc2('0x4d')](_0x5fc2('0x72'));_0x2a944d['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x5fc2('0x4a')](_0x5fc2('0xaa'),_0x286816['uniqueid'],util[_0x5fc2('0x3b')](_0x2a944d,{'showHidden':![],'depth':null}));ami[_0x5fc2('0x43')](_0x5fc2('0xab'),_0x2a944d);break;default:_0x2a944d['queuecallerexit']=!![];_0x2a944d[_0x5fc2('0x8d')]=moment()[_0x5fc2('0x4d')](_0x5fc2('0x72'));_0x2a944d[_0x5fc2('0x87')]=moment()[_0x5fc2('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2a944d[_0x5fc2('0x1b')]=![];_0x2a944d[_0x5fc2('0x80')]=null;_0x2a944d['queuecallerexitreason']=_0x286816[_0x5fc2('0xa5')];this[_0x5fc2('0x12')][_0x286816['uniqueid']]=_0x2a944d;this[_0x5fc2('0x85')](_0x2a944d,_0x5fc2('0x22'));}else if(this[_0x5fc2('0x5e')](_0x286816[_0x5fc2('0xa6')])&&this[_0x5fc2('0x5e')](_0x286816[_0x5fc2('0xa6')][_0x5fc2('0xac')])){if(!_0x2a944d[_0x5fc2('0x1b')]){_0x2a944d['queuecallerexit']=!![];_0x2a944d[_0x5fc2('0x8d')]=moment()[_0x5fc2('0x4d')](_0x5fc2('0x72'));_0x2a944d[_0x5fc2('0x81')]=_0x5fc2('0xad');_0x2a944d[_0x5fc2('0x87')]=moment()['format'](_0x5fc2('0x72'));this[_0x5fc2('0x12')][_0x286816[_0x5fc2('0x47')]]=_0x2a944d;}}logger[_0x5fc2('0x67')](_0x5fc2('0xae'),_0x286816[_0x5fc2('0x47')],_0x2a944d['name'],_0x2a944d['type'],_['keys'](_0x286816[_0x5fc2('0xa6')])[0x0],_0x286816[_0x5fc2('0xa5')]);_0x2a944d[_0x5fc2('0x3d')]=this[_0x5fc2('0x3d')][_0x286816[_0x5fc2('0x47')]];}}}}catch(_0x2fbb30){logger[_0x5fc2('0x3e')]('[%s][voiceQueueReport][varset]',_0x286816['uniqueid'],util[_0x5fc2('0x3b')](_0x2fbb30,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5fc2('0xd')][_0x5fc2('0xa4')]=function(_0x3dfe34,_0x331ebb,_0x2c4dac){var _0x497398=[_0x5fc2('0xaf'),_0x5fc2('0xb0'),'rtpaudioqosjitter',_0x5fc2('0xb1'),'rtpaudioqosloss',_0x5fc2('0xb2'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x5fc2('0xb3'),_0x5fc2('0xb4'),'bridgepeer',_0x5fc2('0xb5'),_0x5fc2('0xb6'),'memberdynamic',_0x5fc2('0xb7'),_0x5fc2('0xb8'),_0x5fc2('0x8c'),_0x5fc2('0xb9'),_0x5fc2('0xba')];if(!_[_0x5fc2('0x35')](_0x331ebb)&&!_[_0x5fc2('0xbb')](_0x497398,_0x331ebb)){if(_[_0x5fc2('0x5f')](this[_0x5fc2('0x3d')][_0x3dfe34])){this[_0x5fc2('0x3d')][_0x3dfe34]={};}this['variables'][_0x3dfe34][_0x331ebb]=_0x2c4dac;}};VoiceQueueReport[_0x5fc2('0xd')][_0x5fc2('0x24')]=function(_0x2792d3){try{if(this[_0x5fc2('0x5e')](_0x2792d3)){logger[_0x5fc2('0x4a')](_0x5fc2('0xbc'),_0x2792d3[_0x5fc2('0x47')],util[_0x5fc2('0x3b')](_0x2792d3,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2792d3['uniqueid']]){for(var _0x19cc85=0x0,_0x1af407={};_0x19cc85=0x0?moment(_0x5f3d20[_0xe234('0x16')])[_0xe234('0x17')](_0x5f3d20['starttime'],_0xe234('0x18')):null,'data1':'outbound','data2':_0x5f3d20['accountcode'],'data3':_0x5f3d20[_0xe234('0xd')],'data4':_0x5f3d20[_0xe234('0x19')]||null,'role':'agent','internal':_0x5f3d20[_0xe234('0x10')]?_['toNumber'](_0x5f3d20[_0xe234('0x10')]):undefined,'uniqueid':_0x5f3d20[_0xe234('0x11')]},'log':_0xe234('0x3')});}; \ No newline at end of file +var _0x9737=['Request','CreateMemberReport','voice','lastAssignedTo','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','calleridnum','exten','queue','agent','accountcode','toNumber','voiceDialReport','membername','starttime','endtime','seconds','outbound','dialstring','uniqueid','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9737,0x14e));var _0x7973=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9737[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x7973('0x0'));var _=require(_0x7973('0x1'));var util=require(_0x7973('0x2'));var client=require(_0x7973('0x3'));exports[_0x7973('0x4')]=function(_0x4ec99d){var _0x4f30d7=_0x4ec99d[_0x7973('0x5')]||_0x4ec99d[_0x7973('0x6')];return client[_0x7973('0x7')](_0x7973('0x8'),{'body':{'channel':_0x7973('0x9'),'membername':_0x4ec99d[_0x7973('0xa')],'interface':_['isNil'](_0x4ec99d[_0x7973('0xb')])?util[_0x7973('0xc')](_0x7973('0xd'),_0x4ec99d[_0x7973('0xa')]):_0x4ec99d[_0x7973('0xb')],'type':_0x7973('0xe'),'enterAt':_0x4ec99d[_0x7973('0xf')],'exitAt':_0x4f30d7,'duration':moment(_0x4f30d7)[_0x7973('0x10')](_0x4ec99d[_0x7973('0xf')],'seconds'),'data1':'inbound','data2':_0x4ec99d[_0x7973('0x11')],'data3':_0x4ec99d[_0x7973('0x12')],'data4':null,'data5':_0x4ec99d[_0x7973('0x13')],'role':_0x7973('0x14'),'internal':_0x4ec99d[_0x7973('0x15')]?_[_0x7973('0x16')](_0x4ec99d[_0x7973('0x15')]):undefined,'uniqueid':_0x4ec99d['uniqueid']},'log':'CreateMemberReport'});};exports[_0x7973('0x17')]=function(_0x385710){return client[_0x7973('0x7')](_0x7973('0x8'),{'body':{'channel':_0x7973('0x9'),'membername':_0x385710[_0x7973('0x18')],'interface':_0x385710[_0x7973('0xb')],'type':_0x7973('0xe'),'enterAt':_0x385710[_0x7973('0x19')],'exitAt':_0x385710['endtime'],'duration':moment(_0x385710[_0x7973('0x1a')])[_0x7973('0x10')](_0x385710[_0x7973('0x19')],_0x7973('0x1b'))>=0x0?moment(_0x385710[_0x7973('0x1a')])[_0x7973('0x10')](_0x385710[_0x7973('0x19')],_0x7973('0x1b')):null,'data1':_0x7973('0x1c'),'data2':_0x385710[_0x7973('0x15')],'data3':_0x385710[_0x7973('0x12')],'data4':_0x385710[_0x7973('0x1d')]||null,'role':'agent','internal':_0x385710[_0x7973('0x15')]?_[_0x7973('0x16')](_0x385710[_0x7973('0x15')]):undefined,'uniqueid':_0x385710[_0x7973('0x1e')]},'log':_0x7973('0x8')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index c74f296..1b310fe 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 _0x1339=['getSettings','ShowSetting','stopRecordingOnTransfer','../client'];(function(_0x1e354d,_0x4cdd11){var _0x25445d=function(_0x2536d4){while(--_0x2536d4){_0x1e354d['push'](_0x1e354d['shift']());}};_0x25445d(++_0x4cdd11);}(_0x1339,0x1bf));var _0x9133=function(_0x388e13,_0x39724e){_0x388e13=_0x388e13-0x0;var _0x453c62=_0x1339[_0x388e13];return _0x453c62;};'use strict';var client=require(_0x9133('0x0'));exports[_0x9133('0x1')]=function(){return client['Request'](_0x9133('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9133('0x3'),'previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file +var _0x7b08=['../client','Request','ShowSetting','stopRecordingOnTransfer','GetSettings'];(function(_0x2162d7,_0x33a32a){var _0x57ca24=function(_0x2960b9){while(--_0x2960b9){_0x2162d7['push'](_0x2162d7['shift']());}};_0x57ca24(++_0x33a32a);}(_0x7b08,0x163));var _0x87b0=function(_0x39c092,_0x56afbf){_0x39c092=_0x39c092-0x0;var _0x13e386=_0x7b08[_0x39c092];return _0x13e386;};'use strict';var client=require(_0x87b0('0x0'));exports['getSettings']=function(){return client[_0x87b0('0x1')](_0x87b0('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x87b0('0x3'),'previewRecallmeReminderInterval']},'log':_0x87b0('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 2b7b555..f78c6d4 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 _0x5853=['getTemplates','Request','name','html','GetTemplate','../client'];(function(_0xd57f5d,_0x48a273){var _0x2131da=function(_0x1d776b){while(--_0x1d776b){_0xd57f5d['push'](_0xd57f5d['shift']());}};_0x2131da(++_0x48a273);}(_0x5853,0x113));var _0x3585=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0x5853[_0x4f3c9b];return _0x84e58a;};'use strict';var client=require(_0x3585('0x0'));exports[_0x3585('0x1')]=function(_0x11a3e4){return function(_0x3f15f9){return client[_0x3585('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x3585('0x3'),_0x3585('0x4')]},'log':_0x3585('0x5')});};}; \ No newline at end of file +var _0x1dab=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1dab,0x143));var _0xb1da=function(_0x32efc7,_0x59650a){_0x32efc7=_0x32efc7-0x0;var _0x5b188d=_0x1dab[_0x32efc7];return _0x5b188d;};'use strict';var client=require(_0xb1da('0x0'));exports[_0xb1da('0x1')]=function(_0x5e6a60){return function(_0x9cf6b6){return client[_0xb1da('0x2')](_0xb1da('0x3'),{'options':{'raw':!![],'attributes':['id',_0xb1da('0x4'),_0xb1da('0x5')]},'log':_0xb1da('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index f136b21..55e2104 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 _0x76c8=['Condition','AllConditions','field','operator','Action','Actions','action','data2','data3','data4','data6','data7','../client','getTriggers','GetTrigger','name','channel','status'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x76c8,0x1aa));var _0x876c=function(_0x5dc27f,_0x135634){_0x5dc27f=_0x5dc27f-0x0;var _0x21933b=_0x76c8[_0x5dc27f];return _0x21933b;};'use strict';var client=require(_0x876c('0x0'));exports[_0x876c('0x1')]=function(_0x132441){return function(_0x29dbf1){return client['Request'](_0x876c('0x2'),{'options':{'raw':![],'attributes':['id',_0x876c('0x3'),_0x876c('0x4'),_0x876c('0x5')],'include':[{'model':_0x876c('0x6'),'as':_0x876c('0x7'),'attributes':['id',_0x876c('0x8'),_0x876c('0x9'),'value']},{'model':_0x876c('0x6'),'as':'AnyConditions','attributes':['id',_0x876c('0x8'),_0x876c('0x9'),'value']},{'model':_0x876c('0xa'),'as':_0x876c('0xb'),'attributes':['id',_0x876c('0xc'),'data1',_0x876c('0xd'),_0x876c('0xe'),_0x876c('0xf'),'data5',_0x876c('0x10'),_0x876c('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x2da3=['data6','GetTrigger','name','channel','status','operator','Condition','field','value','Actions','data2'];(function(_0x143cc6,_0xf94536){var _0x2cedba=function(_0x15a2ad){while(--_0x15a2ad){_0x143cc6['push'](_0x143cc6['shift']());}};_0x2cedba(++_0xf94536);}(_0x2da3,0x1f0));var _0x32da=function(_0x18b4da,_0xc16cca){_0x18b4da=_0x18b4da-0x0;var _0x13e740=_0x2da3[_0x18b4da];return _0x13e740;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x1bfe9b){return function(_0x3b32bd){return client['Request'](_0x32da('0x0'),{'options':{'raw':![],'attributes':['id',_0x32da('0x1'),_0x32da('0x2'),_0x32da('0x3')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id','field',_0x32da('0x4'),'value']},{'model':_0x32da('0x5'),'as':'AnyConditions','attributes':['id',_0x32da('0x6'),_0x32da('0x4'),_0x32da('0x7')]},{'model':'Action','as':_0x32da('0x8'),'attributes':['id','action','data1',_0x32da('0x9'),'data3','data4','data5',_0x32da('0xa'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 8bf2db7..a8ab4ae 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 _0x3d68=['getTrunks','Request','GetTrunk','name','defaultuser','../client'];(function(_0xa89a2,_0x14cc1e){var _0x27279e=function(_0x4a49f5){while(--_0x4a49f5){_0xa89a2['push'](_0xa89a2['shift']());}};_0x27279e(++_0x14cc1e);}(_0x3d68,0x107));var _0x83d6=function(_0x50d5b1,_0x271e11){_0x50d5b1=_0x50d5b1-0x0;var _0x23ec2c=_0x3d68[_0x50d5b1];return _0x23ec2c;};'use strict';var client=require(_0x83d6('0x0'));exports[_0x83d6('0x1')]=function(_0x181956){return function(_0x11676f){return client[_0x83d6('0x2')](_0x83d6('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x83d6('0x4'),'registry',_0x83d6('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x5455=['name','registry','getTrunks','Request','GetTrunk'];(function(_0x372527,_0xb7e61){var _0x288a89=function(_0x1f3e6a){while(--_0x1f3e6a){_0x372527['push'](_0x372527['shift']());}};_0x288a89(++_0xb7e61);}(_0x5455,0x197));var _0x5545=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5455[_0x19950b];return _0x3c6b41;};'use strict';var client=require('../client');exports[_0x5545('0x0')]=function(_0x29df31){return function(_0xb66561){return client[_0x5545('0x1')](_0x5545('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x5545('0x3'),_0x5545('0x4'),'defaultuser']},'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 d7a5b7d..f4d9483 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(_0x31a5d4,_0x273328){var _0x4e7af0=function(_0x119012){while(--_0x119012){_0x31a5d4['push'](_0x31a5d4['shift']());}};_0x4e7af0(++_0x273328);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22e9fe,_0x3d019f){_0x22e9fe=_0x22e9fe-0x0;var _0x47cd19=_0xcb91[_0x22e9fe];return _0x47cd19;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x4f7500,_0x29ad82){var _0x525f29=function(_0x2b5706){while(--_0x2b5706){_0x4f7500['push'](_0x4f7500['shift']());}};_0x525f29(++_0x29ad82);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index c1cf4fe..a31cab5 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 _0xfb77=['update','Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport'];(function(_0x53632c,_0x4a2c15){var _0x284fb2=function(_0x2f3808){while(--_0x2f3808){_0x53632c['push'](_0x53632c['shift']());}};_0x284fb2(++_0x4a2c15);}(_0xfb77,0xd5));var _0x7fb7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfb77[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x7fb7('0x0'));exports[_0x7fb7('0x1')]=function(_0x4ce92b){return client['Request'](_0x7fb7('0x2'),{'body':_0x4ce92b,'log':_0x7fb7('0x2')});};exports[_0x7fb7('0x3')]=function(_0x5c6e66,_0xfb73fe,_0x4585e4){return client[_0x7fb7('0x4')](_0x7fb7('0x5'),{'body':_0x5c6e66,'options':{'where':{'uniqueid':_0xfb73fe,'interface':_0x4585e4,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x20ab=['UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update','Request'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x20ab,0x1e1));var _0xb20a=function(_0x4fce48,_0x188ce1){_0x4fce48=_0x4fce48-0x0;var _0x2609c4=_0x20ab[_0x4fce48];return _0x2609c4;};'use strict';var client=require(_0xb20a('0x0'));exports[_0xb20a('0x1')]=function(_0x12044a){return client['Request'](_0xb20a('0x2'),{'body':_0x12044a,'log':_0xb20a('0x2')});};exports[_0xb20a('0x3')]=function(_0x3bbfac,_0x342357,_0x2d794a){return client[_0xb20a('0x4')](_0xb20a('0x5'),{'body':_0x3bbfac,'options':{'where':{'uniqueid':_0x342357,'interface':_0x2d794a,'agentcomplete':!![]}},'log':_0xb20a('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 06cefc3..55bcebb 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 _0xf6fe=['context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','duration','billableseconds','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge'];(function(_0x3833b1,_0x39a37e){var _0x29fd05=function(_0x2fe5d4){while(--_0x2fe5d4){_0x3833b1['push'](_0x3833b1['shift']());}};_0x29fd05(++_0x39a37e);}(_0xf6fe,0xcb));var _0xef6f=function(_0x3d3404,_0x2a8e40){_0x3d3404=_0x3d3404-0x0;var _0x5e9cae=_0xf6fe[_0x3d3404];return _0x5e9cae;};'use strict';var moment=require(_0xef6f('0x0'));var util=require('util');var _=require(_0xef6f('0x1'));var client=require(_0xef6f('0x2'));exports[_0xef6f('0x3')]=function(_0x370311){return client[_0xef6f('0x4')](_0xef6f('0x5'),{'body':_[_0xef6f('0x6')](_0x370311,{'source':_0x370311['calleridnum'],'destinationcontext':_0x370311[_0xef6f('0x7')],'callerid':_0x370311[_0xef6f('0x8')],'amaflags':_0xef6f('0x9')}),'log':_0xef6f('0x5')});};exports[_0xef6f('0xa')]=function(){return function(){return client[_0xef6f('0x4')](_0xef6f('0xb'),{'options':{'where':{'type':[_0xef6f('0xc')],'createdAt':{'$between':[moment()[_0xef6f('0xd')](_0xef6f('0xe'))[_0xef6f('0xf')](_0xef6f('0x10')),moment()[_0xef6f('0x11')](_0xef6f('0xe'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0xef6f('0x12'),_0xef6f('0x13')]},'log':_0xef6f('0x14')});};}; \ No newline at end of file +var _0xb854=['disposition','duration','billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type'];(function(_0x291ee7,_0x2e2669){var _0x20c743=function(_0x59d3ef){while(--_0x59d3ef){_0x291ee7['push'](_0x291ee7['shift']());}};_0x20c743(++_0x2e2669);}(_0xb854,0x17f));var _0x4b85=function(_0x4af070,_0x2deb61){_0x4af070=_0x4af070-0x0;var _0x30af72=_0xb854[_0x4af070];return _0x30af72;};'use strict';var moment=require(_0x4b85('0x0'));var util=require(_0x4b85('0x1'));var _=require(_0x4b85('0x2'));var client=require(_0x4b85('0x3'));exports[_0x4b85('0x4')]=function(_0x26d63f){return client[_0x4b85('0x5')](_0x4b85('0x6'),{'body':_[_0x4b85('0x7')](_0x26d63f,{'source':_0x26d63f[_0x4b85('0x8')],'destinationcontext':_0x26d63f['context'],'callerid':_0x26d63f['callerid'],'amaflags':_0x4b85('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x4b85('0xa')]=function(){return function(){return client['Request'](_0x4b85('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x4b85('0xc')](_0x4b85('0xd'))[_0x4b85('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x4b85('0xd'))[_0x4b85('0xe')](_0x4b85('0xf'))]}},'attributes':[_0x4b85('0x10'),_0x4b85('0x11'),_0x4b85('0x12'),_0x4b85('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 894da11..709016b 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 _0x93a0=['CreateVoiceDialReport','../client','create','Request'];(function(_0x6caa3e,_0x434951){var _0x22bc05=function(_0x36ba4f){while(--_0x36ba4f){_0x6caa3e['push'](_0x6caa3e['shift']());}};_0x22bc05(++_0x434951);}(_0x93a0,0x1c5));var _0x093a=function(_0x145bee,_0x58c5b9){_0x145bee=_0x145bee-0x0;var _0x3cb268=_0x93a0[_0x145bee];return _0x3cb268;};'use strict';var client=require(_0x093a('0x0'));exports[_0x093a('0x1')]=function(_0xe47d2c){return client[_0x093a('0x2')](_0x093a('0x3'),{'body':_0xe47d2c,'log':_0x093a('0x3')});}; \ No newline at end of file +var _0x6e09=['CreateVoiceDialReport','create'];(function(_0x3eb54a,_0x26cfcf){var _0x2413ec=function(_0x2cd9dc){while(--_0x2cd9dc){_0x3eb54a['push'](_0x3eb54a['shift']());}};_0x2413ec(++_0x26cfcf);}(_0x6e09,0x16d));var _0x96e0=function(_0x6505c,_0x5329a7){_0x6505c=_0x6505c-0x0;var _0x1a7a96=_0x6e09[_0x6505c];return _0x1a7a96;};'use strict';var client=require('../client');exports[_0x96e0('0x0')]=function(_0x34c98c){return client['Request'](_0x96e0('0x1'),{'body':_0x34c98c,'log':_0x96e0('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 1542c69..ca79cf1 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 _0x803f=['../client','Request','GetVoiceExtension','recordingFormat','getVoiceExtensions'];(function(_0x2850a7,_0x4dfe65){var _0x3ed454=function(_0x451c42){while(--_0x451c42){_0x2850a7['push'](_0x2850a7['shift']());}};_0x3ed454(++_0x4dfe65);}(_0x803f,0x64));var _0xf803=function(_0x1c07ff,_0x362a3b){_0x1c07ff=_0x1c07ff-0x0;var _0x27a762=_0x803f[_0x1c07ff];return _0x27a762;};'use strict';var client=require(_0xf803('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xf803('0x1')](_0xf803('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0xf803('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xf803('0x4')});};}; \ No newline at end of file +var _0x0e9f=['getVoiceExtensions','exten','../client'];(function(_0x9a5093,_0x2ba7ce){var _0x374933=function(_0x51e1ca){while(--_0x51e1ca){_0x9a5093['push'](_0x9a5093['shift']());}};_0x374933(++_0x2ba7ce);}(_0x0e9f,0x116));var _0xf0e9=function(_0x5111b5,_0x277433){_0x5111b5=_0x5111b5-0x0;var _0x225a40=_0x0e9f[_0x5111b5];return _0x225a40;};'use strict';var client=require(_0xf0e9('0x0'));exports[_0xf0e9('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xf0e9('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 6516def..c75032a 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 _0x1d0d=['dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting'];(function(_0x2e609d,_0x470f5f){var _0x28c179=function(_0x17969e){while(--_0x17969e){_0x2e609d['push'](_0x2e609d['shift']());}};_0x28c179(++_0x470f5f);}(_0x1d0d,0x9d));var _0xd1d0=function(_0x48aa37,_0x5e741d){_0x48aa37=_0x48aa37-0x0;var _0x31ea93=_0x1d0d[_0x48aa37];return _0x31ea93;};'use strict';var client=require(_0xd1d0('0x0'));exports[_0xd1d0('0x1')]=function(){return function(){return client[_0xd1d0('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xd1d0('0x3'),'acw','acwTimeout',_0xd1d0('0x4'),_0xd1d0('0x5'),_0xd1d0('0x6'),_0xd1d0('0x7'),_0xd1d0('0x8'),_0xd1d0('0x9'),_0xd1d0('0xa'),_0xd1d0('0xb'),_0xd1d0('0xc'),_0xd1d0('0xd'),'dialPredictiveInterval',_0xd1d0('0xe'),_0xd1d0('0xf'),_0xd1d0('0x10'),'dialQueueOptions',_0xd1d0('0x11'),_0xd1d0('0x12'),_0xd1d0('0x13'),_0xd1d0('0x14'),_0xd1d0('0x15'),_0xd1d0('0x16'),'dialNoAnswerMaxRetry',_0xd1d0('0x17'),_0xd1d0('0x18'),'dialTimezone','dialGlobalInterval',_0xd1d0('0x19'),_0xd1d0('0x1a'),_0xd1d0('0x1b'),'dialAMDInitialSilence',_0xd1d0('0x1c'),_0xd1d0('0x1d'),_0xd1d0('0x1e'),'dialAMDMinWordLength',_0xd1d0('0x1f'),_0xd1d0('0x20'),'dialAMDSilenceThreshold',_0xd1d0('0x21'),_0xd1d0('0x22'),_0xd1d0('0x23'),_0xd1d0('0x24'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0xd1d0('0x25'),'dialQueueProject2',_0xd1d0('0x5'),_0xd1d0('0x26'),_0xd1d0('0x27'),_0xd1d0('0x28'),_0xd1d0('0x29'),_0xd1d0('0x2a'),_0xd1d0('0x2b'),_0xd1d0('0x2c'),_0xd1d0('0x2d'),_0xd1d0('0x2e'),_0xd1d0('0x2f'),'dialMachineRetryFrequency',_0xd1d0('0x30'),_0xd1d0('0x31'),'mandatoryDisposition',_0xd1d0('0x32'),'dialPredictiveIntervalMinThreshold',_0xd1d0('0x33'),_0xd1d0('0x34')],'include':[{'model':_0xd1d0('0x35'),'as':'Trunk','attributes':['id',_0xd1d0('0x3'),_0xd1d0('0x36'),'active']},{'model':_0xd1d0('0x37'),'as':_0xd1d0('0x38'),'attributes':['id',_0xd1d0('0x3')]},{'model':'Trunk','as':_0xd1d0('0x39'),'attributes':['id',_0xd1d0('0x3'),'callerid',_0xd1d0('0x3a')]},{'model':_0xd1d0('0x3b'),'as':_0xd1d0('0x3b'),'attributes':['id','name'],'include':[{'model':_0xd1d0('0x3b'),'as':_0xd1d0('0x3c'),'attributes':['id','name',_0xd1d0('0x3d')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0xe0ef=['name','callerid','active','TrunkBackup','Interval','Intervals','getVoiceQueues','../client','Request','acwTimeout','autopause','type','dialMethod','dialLimitQueue','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk'];(function(_0x25e01f,_0x12a364){var _0x41b248=function(_0x491ab2){while(--_0x491ab2){_0x25e01f['push'](_0x25e01f['shift']());}};_0x41b248(++_0x12a364);}(_0xe0ef,0x175));var _0xfe0e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0ef[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xfe0e('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xfe0e('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name','acw',_0xfe0e('0x2'),_0xfe0e('0x3'),'monitor_format',_0xfe0e('0x4'),'dialActive',_0xfe0e('0x5'),'dialLimitChannel',_0xfe0e('0x6'),'dialPowerLevel','dialPredictiveOptimization',_0xfe0e('0x7'),_0xfe0e('0x8'),_0xfe0e('0x9'),_0xfe0e('0xa'),_0xfe0e('0xb'),_0xfe0e('0xc'),_0xfe0e('0xd'),_0xfe0e('0xe'),_0xfe0e('0xf'),_0xfe0e('0x10'),_0xfe0e('0x11'),_0xfe0e('0x12'),_0xfe0e('0x13'),_0xfe0e('0x14'),_0xfe0e('0x15'),_0xfe0e('0x16'),_0xfe0e('0x17'),_0xfe0e('0x18'),_0xfe0e('0x19'),_0xfe0e('0x1a'),_0xfe0e('0x1b'),_0xfe0e('0x1c'),_0xfe0e('0x1d'),_0xfe0e('0x1e'),_0xfe0e('0x1f'),_0xfe0e('0x20'),'dialAMDMaximumNumberOfWords',_0xfe0e('0x21'),_0xfe0e('0x22'),_0xfe0e('0x23'),_0xfe0e('0x24'),_0xfe0e('0x25'),_0xfe0e('0x26'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format',_0xfe0e('0x27'),_0xfe0e('0x28'),'dialCutDigit',_0xfe0e('0x29'),'dialNoSuchNumberRetryFrequency',_0xfe0e('0x2a'),_0xfe0e('0x2b'),_0xfe0e('0x2c'),_0xfe0e('0x2d'),_0xfe0e('0x2e'),_0xfe0e('0x2f'),_0xfe0e('0x30'),'dialAgentRejectRetryFrequency',_0xfe0e('0x31'),'dialPredictiveIntervalMaxThreshold',_0xfe0e('0x32'),_0xfe0e('0x33'),_0xfe0e('0x34')],'include':[{'model':_0xfe0e('0x35'),'as':_0xfe0e('0x35'),'attributes':['id',_0xfe0e('0x36'),_0xfe0e('0x37'),_0xfe0e('0x38')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0xfe0e('0x36')]},{'model':_0xfe0e('0x35'),'as':_0xfe0e('0x39'),'attributes':['id',_0xfe0e('0x36'),_0xfe0e('0x37'),'active']},{'model':_0xfe0e('0x3a'),'as':_0xfe0e('0x3a'),'attributes':['id',_0xfe0e('0x36')],'include':[{'model':_0xfe0e('0x3a'),'as':_0xfe0e('0x3b'),'attributes':['id','name','interval']}]}]},'log':_0xfe0e('0x3c')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 62c6ad2..c8fe8de 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(_0x37e979,_0x375a31){var _0x597754=function(_0x1d516e){while(--_0x1d516e){_0x37e979['push'](_0x37e979['shift']());}};_0x597754(++_0x375a31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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(_0x8991f7,_0x10aa79){var _0x377e16=function(_0x19955a){while(--_0x19955a){_0x8991f7['push'](_0x8991f7['shift']());}};_0x377e16(++_0x10aa79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 8976d22..983709e 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 _0xf689=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xf689,0x9d));var _0x9f68=function(_0x414ffa,_0x1ea7a5){_0x414ffa=_0x414ffa-0x0;var _0x55a8fb=_0xf689[_0x414ffa];return _0x55a8fb;};'use strict';var client=require('../client');exports[_0x9f68('0x0')]=function(_0x370786){return function(){return client['Request'](_0x9f68('0x1'),{'options':{'where':{'VoiceQueueId':_0x370786,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xfd1a=['../client','getVoiceQueueRtPauses'];(function(_0x516f81,_0x2d74ea){var _0x1b119b=function(_0x31335f){while(--_0x31335f){_0x516f81['push'](_0x516f81['shift']());}};_0x1b119b(++_0x2d74ea);}(_0xfd1a,0x112));var _0xafd1=function(_0x51b5b2,_0xf47ed){_0x51b5b2=_0x51b5b2-0x0;var _0x4ce4f2=_0xfd1a[_0x51b5b2];return _0x4ce4f2;};'use strict';var client=require(_0xafd1('0x0'));exports[_0xafd1('0x1')]=function(_0xfaf805){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0xfaf805,'paused':!![]},'raw':!![]},'log':_0xafd1('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 83a2114..4c35b15 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x5e07bd,_0x346a93){var _0x283810=function(_0x3493de){while(--_0x3493de){_0x5e07bd['push'](_0x5e07bd['shift']());}};_0x283810(++_0x346a93);}(_0x7a54,0x106));var _0x47a5=function(_0x2a7283,_0x12d1ec){_0x2a7283=_0x2a7283-0x0;var _0x7f286d=_0x7a54[_0x2a7283];return _0x7f286d;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x359204,_0x5443d1){var _0x272521=function(_0x44d72b){while(--_0x44d72b){_0x359204['push'](_0x359204['shift']());}};_0x272521(++_0x5443d1);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 ba752ac..47262b3 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 _0x7939=['context','extension','blind','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','attended','../client','transfers','blindTransfer','Request','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7939,0x18e));var _0x9793=function(_0x1a8db2,_0x3494e6){_0x1a8db2=_0x1a8db2-0x0;var _0x58b389=_0x7939[_0x1a8db2];return _0x58b389;};'use strict';var client=require(_0x9793('0x0'));exports[_0x9793('0x1')]={};exports[_0x9793('0x2')]=function(_0x5689ec){return client[_0x9793('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x5689ec[_0x9793('0x4')],'transfererchannel':_0x5689ec[_0x9793('0x5')],'transferercalleridnum':_0x5689ec['transferercalleridnum'],'transferercalleridname':_0x5689ec[_0x9793('0x6')],'transfererconnectedlinenum':_0x5689ec[_0x9793('0x7')],'transfererconnectedlinename':_0x5689ec[_0x9793('0x8')],'transfereraccountcode':_0x5689ec[_0x9793('0x9')],'transferercontext':_0x5689ec[_0x9793('0xa')],'transfererexten':_0x5689ec['transfererexten'],'transfererlinkedid':_0x5689ec[_0x9793('0xb')],'transfereechannel':_0x5689ec[_0x9793('0xc')],'transfereecalleridnum':_0x5689ec[_0x9793('0xd')],'transfereecalleridname':_0x5689ec[_0x9793('0xe')],'transfereeconnectedlinenum':_0x5689ec[_0x9793('0xf')],'transfereeconnectedlinename':_0x5689ec[_0x9793('0x10')],'transfereeaccountcode':_0x5689ec[_0x9793('0x11')],'transfereecontext':_0x5689ec[_0x9793('0x12')],'transfereeexten':_0x5689ec[_0x9793('0x13')],'transfereelinkedid':_0x5689ec[_0x9793('0x14')],'isexternal':_0x5689ec[_0x9793('0x15')],'context':_0x5689ec[_0x9793('0x16')],'extension':_0x5689ec[_0x9793('0x17')],'type':_0x9793('0x18')},'log':_0x9793('0x19')});};exports['attendedTransfer']=function(_0x5b1a31){return client[_0x9793('0x3')](_0x9793('0x19'),{'body':{'result':_0x5b1a31[_0x9793('0x4')],'transfererchannel':_0x5b1a31[_0x9793('0x1a')],'transferercalleridnum':_0x5b1a31[_0x9793('0x1b')],'transferercalleridname':_0x5b1a31[_0x9793('0x1c')],'transfererconnectedlinenum':_0x5b1a31[_0x9793('0x1d')],'transfererconnectedlinename':_0x5b1a31[_0x9793('0x1e')],'transfereraccountcode':_0x5b1a31[_0x9793('0x1f')],'transferercontext':_0x5b1a31[_0x9793('0x20')],'transfererexten':_0x5b1a31['secondtransfererexten'],'transfererlinkedid':_0x5b1a31['origtransfererlinkedid'],'transfereechannel':_0x5b1a31[_0x9793('0x21')],'transfereecalleridnum':_0x5b1a31[_0x9793('0x22')],'transfereecalleridname':_0x5b1a31[_0x9793('0x23')],'transfereeconnectedlinenum':_0x5b1a31[_0x9793('0x24')],'transfereeconnectedlinename':_0x5b1a31[_0x9793('0x25')],'transfereeaccountcode':_0x5b1a31[_0x9793('0x26')],'transfereecontext':_0x5b1a31[_0x9793('0x27')],'transfereeexten':_0x5b1a31[_0x9793('0x28')],'transfereelinkedid':_0x5b1a31['transfertargetlinkedid'],'isexternal':_0x5b1a31[_0x9793('0x15')],'context':_0x5b1a31['origtransferercontext'],'extension':_0x5b1a31['origtransfererexten'],'type':_0x9793('0x29')},'log':_0x9793('0x19')});}; \ No newline at end of file +var _0x557e=['blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfers'];(function(_0x43249a,_0x958fd0){var _0xaaa02c=function(_0x414039){while(--_0x414039){_0x43249a['push'](_0x43249a['shift']());}};_0xaaa02c(++_0x958fd0);}(_0x557e,0xd0));var _0xe557=function(_0x14c4c1,_0x1432d9){_0x14c4c1=_0x14c4c1-0x0;var _0x5dcc91=_0x557e[_0x14c4c1];return _0x5dcc91;};'use strict';var client=require(_0xe557('0x0'));exports[_0xe557('0x1')]={};exports[_0xe557('0x2')]=function(_0x1025af){return client['Request'](_0xe557('0x3'),{'body':{'result':_0x1025af[_0xe557('0x4')],'transfererchannel':_0x1025af[_0xe557('0x5')],'transferercalleridnum':_0x1025af[_0xe557('0x6')],'transferercalleridname':_0x1025af[_0xe557('0x7')],'transfererconnectedlinenum':_0x1025af[_0xe557('0x8')],'transfererconnectedlinename':_0x1025af['transfererconnectedlinename'],'transfereraccountcode':_0x1025af['transfereraccountcode'],'transferercontext':_0x1025af['transferercontext'],'transfererexten':_0x1025af[_0xe557('0x9')],'transfererlinkedid':_0x1025af['transfererlinkedid'],'transfereechannel':_0x1025af[_0xe557('0xa')],'transfereecalleridnum':_0x1025af[_0xe557('0xb')],'transfereecalleridname':_0x1025af[_0xe557('0xc')],'transfereeconnectedlinenum':_0x1025af['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1025af['transfereeconnectedlinename'],'transfereeaccountcode':_0x1025af[_0xe557('0xd')],'transfereecontext':_0x1025af[_0xe557('0xe')],'transfereeexten':_0x1025af[_0xe557('0xf')],'transfereelinkedid':_0x1025af[_0xe557('0x10')],'isexternal':_0x1025af[_0xe557('0x11')],'context':_0x1025af['context'],'extension':_0x1025af[_0xe557('0x12')],'type':'blind'},'log':_0xe557('0x3')});};exports['attendedTransfer']=function(_0x207cec){return client[_0xe557('0x13')](_0xe557('0x3'),{'body':{'result':_0x207cec[_0xe557('0x4')],'transfererchannel':_0x207cec[_0xe557('0x14')],'transferercalleridnum':_0x207cec[_0xe557('0x15')],'transferercalleridname':_0x207cec[_0xe557('0x16')],'transfererconnectedlinenum':_0x207cec[_0xe557('0x17')],'transfererconnectedlinename':_0x207cec['secondtransfererconnectedlinename'],'transfereraccountcode':_0x207cec[_0xe557('0x18')],'transferercontext':_0x207cec['secondtransferercontext'],'transfererexten':_0x207cec['secondtransfererexten'],'transfererlinkedid':_0x207cec[_0xe557('0x19')],'transfereechannel':_0x207cec['transfertargetchannel'],'transfereecalleridnum':_0x207cec[_0xe557('0x1a')],'transfereecalleridname':_0x207cec['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x207cec[_0xe557('0x1b')],'transfereeconnectedlinename':_0x207cec[_0xe557('0x1c')],'transfereeaccountcode':_0x207cec[_0xe557('0x1d')],'transfereecontext':_0x207cec[_0xe557('0x1e')],'transfereeexten':_0x207cec[_0xe557('0x1f')],'transfereelinkedid':_0x207cec[_0xe557('0x20')],'isexternal':_0x207cec[_0xe557('0x11')],'context':_0x207cec['origtransferercontext'],'extension':_0x207cec[_0xe557('0x21')],'type':_0xe557('0x22')},'log':_0xe557('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 0aae861..cfa55f6 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 _0x6363=['filename','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','StopMixMonitor','stop','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','Redirect','context','outboundChannels','campaigns','run','event','emit','faxAccounts','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','Reload','Action','message','command','action','Command','then','catch','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','%s.%s'];(function(_0x111c18,_0xd53027){var _0x2fdb4b=function(_0xc5bacd){while(--_0xc5bacd){_0x111c18['push'](_0x111c18['shift']());}};_0x2fdb4b(++_0xd53027);}(_0x6363,0x13a));var _0x3636=function(_0x1648c2,_0x217aac){_0x1648c2=_0x1648c2-0x0;var _0x400f26=_0x6363[_0x1648c2];return _0x400f26;};'use strict';var _=require(_0x3636('0x0'));var util=require('util');var jayson=require(_0x3636('0x1'));var schema=require(_0x3636('0x2'));var BPromise=require(_0x3636('0x3'));var moment=require(_0x3636('0x4'));var config=require(_0x3636('0x5'));var properties=require(_0x3636('0x6'));var ami=require(_0x3636('0x7'));exports[_0x3636('0x8')]=function(_0x1e62e9,_0x3d616f,_0x15728f){return new BPromise(function(_0x1f94ef,_0xdc928c){var _0x17b2a4={'QueuePause':function(_0x583dec){return new Promise(function(_0x19f917,_0x47f84e){var _0x25a0ac=util[_0x3636('0x9')](_0x3636('0xa'),_0x3636('0xb'),_0x583dec[_0x3636('0xc')]);if(_0x1e62e9[_0x3636('0xd')]&&_0x1e62e9[_0x3636('0xd')][_0x25a0ac]&&_0x1e62e9[_0x3636('0xd')][_0x25a0ac][_0x3636('0xe')]){_0x1e62e9['timers'][_0x25a0ac]['updateAcw']();}if(_0x1e62e9[_0x3636('0xf')][_0x25a0ac]){_0x1e62e9['agents'][_0x25a0ac][_0x3636('0x10')]({'statePause':_0x583dec[_0x3636('0x11')]?!![]:![]});}_0x19f917({'code':0xc8,'message':_0x3636('0x12')});});},'Reload':function(_0x13ca35){var _0xfcfee7=this;return new Promise(function(_0x319cd7,_0x2088fc){if(ami[_0x3636('0x13')]()==![]){return _0x2088fc(_0xfcfee7[_0x3636('0x14')](0x1f4,[config[_0x3636('0x15')]['ip'],config[_0x3636('0x15')][_0x3636('0x16')],_0x3636('0x17')][_0x3636('0x18')]('\x20')));}_0x13ca35=_[_0x3636('0x19')](_0x13ca35,_[_0x3636('0x1a')](properties[_0x3636('0x1b')]));_0x13ca35['action']=_0x3636('0x1c');return ami[_0x3636('0x1d')](_0x13ca35)['then'](function(_0xe3be56){_0x319cd7({'code':0xc8,'message':_0xe3be56['message']});})['catch'](function(_0xae6469){_0x2088fc(_0xfcfee7[_0x3636('0x14')](0x1f5,_0xae6469[_0x3636('0x1e')]));});});},'Command':function(_0xc1c96d){var _0xe0e633=this;return new Promise(function(_0x39e367,_0xa2b8fe){if(ami[_0x3636('0x13')]()==![]){return _0xa2b8fe(_0xe0e633['error'](0x1f4,[config['asterisk']['ip'],config[_0x3636('0x15')][_0x3636('0x16')],_0x3636('0x17')]['join']('\x20')));}_0xc1c96d=_[_0x3636('0x19')](_0xc1c96d,_0x3636('0x1f'));_0xc1c96d[_0x3636('0x20')]=_0x3636('0x21');return ami[_0x3636('0x1d')](_0xc1c96d)[_0x3636('0x22')](function(_0x4f5b0e){_0x39e367({'code':0xc8,'message':_0x4f5b0e['content']});})[_0x3636('0x23')](function(_0x4ee098){_0xa2b8fe(_0xe0e633['error'](0x1f5,_0x4ee098[_0x3636('0x1e')]));});});},'VoiceQueues':function(_0x57f7c6){return new Promise(function(_0x4182b7,_0x4c24cf){var _0x36f4c5=[];for(var _0x477c34 in _0x1e62e9[_0x3636('0x24')]){if(_0x1e62e9[_0x3636('0x24')][_0x3636('0x25')](_0x477c34)){var _0x20ca8b=_0x1e62e9[_0x3636('0x24')][_0x477c34];var _0x3c3d45={'id':_0x20ca8b['id'],'name':_0x20ca8b[_0x3636('0xc')],'strategy':_0x20ca8b[_0x3636('0x26')],'answered':_0x20ca8b[_0x3636('0x27')],'available':_0x20ca8b['available'],'loggedIn':_0x20ca8b[_0x3636('0x28')],'pTalking':_0x20ca8b[_0x3636('0x29')],'sumBillable':_0x20ca8b[_0x3636('0x2a')],'sumDuration':_0x20ca8b[_0x3636('0x2b')],'sumHoldTime':_0x20ca8b[_0x3636('0x2c')]||0x0,'talking':_0x20ca8b[_0x3636('0x2d')],'total':_0x20ca8b['total'],'type':_0x20ca8b[_0x3636('0x2e')],'unmanaged':_0x20ca8b[_0x3636('0x2f')],'abandoned':_0x20ca8b['abandoned'],'waiting':_0x20ca8b[_0x3636('0x30')],'loggedInDb':_0x20ca8b[_0x3636('0x31')]};if(_0x20ca8b[_0x3636('0x2e')]===_0x3636('0x32')){_0x3c3d45[_0x3636('0x33')]=_0x20ca8b['dialActive'];_0x3c3d45[_0x3636('0x34')]=_0x20ca8b[_0x3636('0x34')];_0x3c3d45[_0x3636('0x35')]=_0x20ca8b[_0x3636('0x35')];_0x3c3d45[_0x3636('0x36')]=_0x20ca8b[_0x3636('0x36')];_0x3c3d45[_0x3636('0x37')]=_0x20ca8b[_0x3636('0x37')];_0x3c3d45[_0x3636('0x38')]=_0x20ca8b['dialPrefix'];_0x3c3d45['temp']=_0x20ca8b[_0x3636('0x39')];_0x3c3d45['outboundAnswerAgiCallsDay']=_0x20ca8b['outboundAnswerAgiCallsDay'];_0x3c3d45[_0x3636('0x3a')]=_0x20ca8b[_0x3636('0x3a')];_0x3c3d45[_0x3636('0x3b')]=_0x20ca8b['outboundBlacklistCallsDay'];_0x3c3d45[_0x3636('0x3c')]=_0x20ca8b[_0x3636('0x3c')];_0x3c3d45[_0x3636('0x3d')]=_0x20ca8b[_0x3636('0x3d')];_0x3c3d45[_0x3636('0x3e')]=_0x20ca8b[_0x3636('0x3e')];_0x3c3d45[_0x3636('0x3f')]=_0x20ca8b[_0x3636('0x3f')];_0x3c3d45[_0x3636('0x40')]=_0x20ca8b[_0x3636('0x40')];_0x3c3d45[_0x3636('0x41')]=_0x20ca8b[_0x3636('0x41')];_0x3c3d45[_0x3636('0x42')]=_0x20ca8b['outboundNoSuchCallsDay'];_0x3c3d45[_0x3636('0x43')]=_0x20ca8b[_0x3636('0x43')];_0x3c3d45[_0x3636('0x44')]=_0x20ca8b[_0x3636('0x44')];_0x3c3d45['outboundRejectCallsDay']=_0x20ca8b['outboundRejectCallsDay'];_0x3c3d45[_0x3636('0x45')]=_0x20ca8b[_0x3636('0x45')];_0x3c3d45[_0x3636('0x46')]=_0x20ca8b['predictiveIntervalAnsweredCalls'];_0x3c3d45[_0x3636('0x47')]=_0x20ca8b[_0x3636('0x47')];_0x3c3d45['predictiveIntervalAvgTalktime']=_0x20ca8b['predictiveIntervalAvgTalktime'];_0x3c3d45[_0x3636('0x48')]=_0x20ca8b['predictiveIntervalDroppedCallsCallersExit'];_0x3c3d45[_0x3636('0x49')]=_0x20ca8b[_0x3636('0x49')];_0x3c3d45[_0x3636('0x4a')]=_0x20ca8b[_0x3636('0x4a')];_0x3c3d45[_0x3636('0x4b')]=_0x20ca8b[_0x3636('0x4b')];_0x3c3d45[_0x3636('0x4c')]=_0x20ca8b[_0x3636('0x4c')];_0x3c3d45[_0x3636('0x4d')]=_0x20ca8b['predictiveIntervalMultiplicativeFactor'];_0x3c3d45[_0x3636('0x4e')]=_0x20ca8b[_0x3636('0x4e')];_0x3c3d45[_0x3636('0x4f')]=_0x20ca8b[_0x3636('0x4f')];_0x3c3d45[_0x3636('0x50')]=_0x20ca8b[_0x3636('0x50')];_0x3c3d45[_0x3636('0x1e')]=_0x20ca8b[_0x3636('0x1e')];_0x3c3d45[_0x3636('0x51')]=_0x20ca8b['originated'];_0x3c3d45[_0x3636('0x52')]=_0x20ca8b[_0x3636('0x52')];_0x3c3d45[_0x3636('0x53')]=_0x20ca8b[_0x3636('0x53')];_0x3c3d45[_0x3636('0x54')]=_0x20ca8b[_0x3636('0x54')];_0x3c3d45[_0x3636('0x55')]=_0x20ca8b[_0x3636('0x55')];_0x3c3d45[_0x3636('0x56')]=_0x20ca8b[_0x3636('0x56')];_0x3c3d45[_0x3636('0x57')]=_0x20ca8b[_0x3636('0x57')];}if(_0x20ca8b[_0x3636('0x58')]){_0x3c3d45[_0x3636('0x58')]={'id':_0x20ca8b[_0x3636('0x58')]['id'],'name':_0x20ca8b['Trunk'][_0x3636('0xc')],'active':_0x20ca8b[_0x3636('0x58')][_0x3636('0x59')],'callerid':_0x20ca8b[_0x3636('0x58')][_0x3636('0x5a')]};}if(_0x20ca8b[_0x3636('0x5b')]){_0x3c3d45[_0x3636('0x5b')]={'id':_0x20ca8b[_0x3636('0x5b')]['id'],'name':_0x20ca8b[_0x3636('0x5b')][_0x3636('0xc')]};}_0x36f4c5[_0x3636('0x5c')](_0x3c3d45);}}_0x4182b7({'count':_0x36f4c5[_0x3636('0x5d')],'rows':_0x36f4c5});});},'UpdateVoiceQueue':function(_0x38b7fc){return new Promise(function(_0x594906,_0x4ed1d7){var _0x5b54f9=_[_0x3636('0x5e')](_0x1e62e9['voiceQueues'],{'id':parseInt(_0x38b7fc['id'])});var _0x5863a9=_[_0x3636('0x5f')](_0x38b7fc,['id']);if(_0x5b54f9){for(var _0xb39a2a in _0x5863a9){if(typeof _0x5863a9[_0xb39a2a]!==_0x3636('0x60')&&typeof _0x5b54f9[_0xb39a2a]!=='undefined'){_0x5b54f9[_0xb39a2a]=_0x5863a9[_0xb39a2a];}}_0x594906(_0x5b54f9);}else{_0x4ed1d7();}});},'VoiceChannels':function(_0x2683ea){return new Promise(function(_0x268080,_0x349349){var _0x179410=_[_0x3636('0x61')](_0x1e62e9[_0x3636('0x62')]);_0x268080({'count':_0x179410[_0x3636('0x5d')],'rows':_0x179410});});},'VoiceChannelMixMonitor':function(_0x3a350d){var _0xc929c7=this;return new Promise(function(_0x5ac865,_0x2276bb){if(ami[_0x3636('0x13')]()==![]){return _0x2276bb(_0xc929c7[_0x3636('0x14')](0x1f4,[config[_0x3636('0x15')]['ip'],config[_0x3636('0x15')][_0x3636('0x16')],'ami\x20disconnected'][_0x3636('0x18')]('\x20')));}var _0xf79c81=schema(properties[_0x3636('0x63')])[_0x3636('0x2')](_0x3a350d);if(_0xf79c81[_0x3636('0x5d')]>0x0){return _0x2276bb(_0xc929c7['error'](0x1f4,_[_0x3636('0x64')](_0xf79c81,_0x3636('0x1e'))[_0x3636('0x18')](',\x20')));}var _0x61522d=_[_0x3636('0x5e')](_0x1e62e9['channels'],{'uniqueid':_0x3a350d[_0x3636('0x65')]});if(_0x61522d&&_0x61522d['channel']){var _0x54deca=util[_0x3636('0x9')](_0x3636('0x66'),_0x3a350d[_0x3636('0x67')]||_0x3a350d[_0x3636('0x65')],_0x3a350d['format']||'wav');return ami[_0x3636('0x1d')]({'action':_0x3636('0x68'),'channel':_0x61522d[_0x3636('0x69')],'file':_0x54deca,'options':_0x3636('0x6a')})[_0x3636('0x22')](function(_0x3f342e){var _0x545e6f=_[_0x3636('0x5e')](_0x61522d[_0x3636('0x6b')],{'filename':_0x3636('0x6c')+_0x54deca[_0x3636('0x6d')]()});if(_[_0x3636('0x6e')](_0x545e6f)){_0x61522d[_0x3636('0x6b')][_0x3636('0x5c')]({'filename':_0x3636('0x6c')+_0x54deca['toLowerCase'](),'createdAt':moment()[_0x3636('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x3f342e[_0x3636('0x6f')],'status':'rec'});}else{_0x545e6f[_0x3636('0x6f')]=_0x3f342e[_0x3636('0x6f')];_0x545e6f[_0x3636('0x70')]=_0x3636('0x71');}_0x5ac865({'code':0xc8,'message':[_0x3a350d[_0x3636('0x65')],_0x3636('0x72'),_0x3f342e['mixmonitorid']][_0x3636('0x18')]('\x20'),'mixmonitorid':_0x3f342e['mixmonitorid']});})[_0x3636('0x23')](function(_0x449657){_0x2276bb(_0xc929c7[_0x3636('0x14')](0x1f5,[_0x3a350d[_0x3636('0x65')],_0x449657['message'][_0x3636('0x6d')]()][_0x3636('0x18')]('\x20')));});}else{return _0x2276bb(_0xc929c7[_0x3636('0x14')](0x1f5,_0x3636('0x73')));}});},'VoiceChannelStopMixMonitor':function(_0x315c62){var _0x25b5cc=this;return new Promise(function(_0x802ea9,_0x11ec51){if(ami[_0x3636('0x13')]()==![]){return _0x11ec51(_0x25b5cc['error'](0x1f4,[config[_0x3636('0x15')]['ip'],config[_0x3636('0x15')][_0x3636('0x16')],_0x3636('0x17')][_0x3636('0x18')]('\x20')));}var _0xbeddf8=schema(properties[_0x3636('0x63')])[_0x3636('0x2')](_0x315c62);if(_0xbeddf8[_0x3636('0x5d')]>0x0){return _0x11ec51(_0x25b5cc[_0x3636('0x14')](0x1f4,_[_0x3636('0x64')](_0xbeddf8,_0x3636('0x1e'))[_0x3636('0x18')](',\x20')));}var _0x55d388=_[_0x3636('0x5e')](_0x1e62e9[_0x3636('0x62')],{'uniqueid':_0x315c62[_0x3636('0x65')]});if(_0x55d388){return BPromise[_0x3636('0x74')]()[_0x3636('0x22')](function(){if(_0x55d388[_0x3636('0x69')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x55d388[_0x3636('0x69')],'mixmonitorid':_0x315c62[_0x3636('0x6f')]})[_0x3636('0x23')](function(_0x477cae){});}})[_0x3636('0x22')](function(){if(_0x55d388[_0x3636('0x75')]){return ami[_0x3636('0x1d')]({'action':_0x3636('0x76'),'channel':_0x55d388['destinationchannel'],'mixmonitorid':_0x315c62[_0x3636('0x6f')]})['catch'](function(_0x2a461b){});}})[_0x3636('0x22')](function(_0x228716){var _0x4893ee=_[_0x3636('0x5e')](_0x55d388['monitors'],{'mixmonitorid':_0x315c62[_0x3636('0x6f')]});if(_0x4893ee){_0x4893ee[_0x3636('0x70')]=_0x3636('0x77');}})[_0x3636('0x22')](function(){var _0x951778=util[_0x3636('0x9')](_0x3636('0x66'),_0x315c62[_0x3636('0x67')]||_0x315c62[_0x3636('0x65')],_0x315c62[_0x3636('0x9')]||'wav');var _0x580b9d=_['find'](_0x55d388[_0x3636('0x6b')],{'filename':'/var/spool/asterisk/monitor/'+_0x951778[_0x3636('0x6d')]()});if(_0x580b9d){_0x580b9d[_0x3636('0x70')]=_0x3636('0x77');}})['then'](function(){_0x802ea9({'code':0xc8,'message':[_0x315c62[_0x3636('0x65')],_0x3636('0x78')][_0x3636('0x18')]('\x20')});})[_0x3636('0x23')](function(_0x595515){_0x11ec51(_0x25b5cc[_0x3636('0x14')](0x1f5,[_0x315c62['uniqueid'],_0x595515[_0x3636('0x1e')]['toLowerCase']()]['join']('\x20')));});}else{return _0x11ec51(_0x25b5cc[_0x3636('0x14')](0x1f5,_0x3636('0x73')));}});},'VoiceQueuesChannels':function(_0x7facfb){return new Promise(function(_0x3a980e,_0x323e43){var _0x44c747=_['values'](_0x1e62e9['queueChannels']);_0x3a980e({'count':_0x44c747[_0x3636('0x5d')],'rows':_0x44c747});});},'VoiceQueuesChannel':function(_0x561a43){var _0xf3ce3c=this;return new Promise(function(_0x2cae42,_0x329cef){var _0x1ed156=schema(properties[_0x3636('0x79')])[_0x3636('0x2')](_0x561a43);if(_0x1ed156[_0x3636('0x5d')]>0x0){return _0x329cef(_0xf3ce3c[_0x3636('0x14')](0x1f4,_['map'](_0x1ed156,_0x3636('0x1e'))['join'](',\x20')));}var _0x5d62a6=_[_0x3636('0x5e')](_0x1e62e9[_0x3636('0x7a')],{'uniqueid':_0x561a43[_0x3636('0x65')]});if(_0x5d62a6){_0x2cae42(_0x5d62a6);}else{return _0x329cef(_0xf3ce3c[_0x3636('0x14')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x29a8dc){var _0x4b9974=this;return new Promise(function(_0x534419,_0x292369){if(ami[_0x3636('0x13')]()==![]){return _0x292369(_0x4b9974[_0x3636('0x14')](0x1f4,[config[_0x3636('0x15')]['ip'],config[_0x3636('0x15')]['username'],_0x3636('0x17')][_0x3636('0x18')]('\x20')));}var _0x38df4d=schema(properties[_0x3636('0x7b')])[_0x3636('0x2')](_0x29a8dc);if(_0x38df4d[_0x3636('0x5d')]>0x0){return _0x292369(_0x4b9974[_0x3636('0x14')](0x1f4,_[_0x3636('0x64')](_0x38df4d,_0x3636('0x1e'))[_0x3636('0x18')](',\x20')));}var _0x41c3ef=_[_0x3636('0x5e')](_0x1e62e9['queueChannels'],{'uniqueid':_0x29a8dc['uniqueid']});if(_0x41c3ef&&_0x41c3ef['channel']){return ami[_0x3636('0x1d')]({'action':_0x3636('0x7c'),'channel':_0x41c3ef[_0x3636('0x69')]})['then'](function(_0x188b5c){_0x534419({'code':0xc8,'message':[_0x29a8dc['uniqueid'],_0x188b5c[_0x3636('0x1e')]['toLowerCase']()][_0x3636('0x18')]('\x20')});})['catch'](function(_0xcc4aec){_0x292369(_0x4b9974[_0x3636('0x14')](0x1f5,[_0x29a8dc['uniqueid'],_0xcc4aec[_0x3636('0x1e')]['toLowerCase']()]['join']('\x20')));});}else{return _0x292369(_0x4b9974[_0x3636('0x14')](0x1f5,_0x3636('0x73')));}});},'VoiceQueuesChannelRedirect':function(_0x3ff4db){var _0x30bdad=this;return new Promise(function(_0x3e0723,_0x3ef376){if(ami[_0x3636('0x13')]()==![]){return _0x3ef376(_0x30bdad[_0x3636('0x14')](0x1f4,[config[_0x3636('0x15')]['ip'],config[_0x3636('0x15')]['username'],_0x3636('0x17')][_0x3636('0x18')]('\x20')));}var _0x709ffc=schema(properties['voicequeuechannelredirect'])[_0x3636('0x2')](_0x3ff4db);if(_0x709ffc[_0x3636('0x5d')]>0x0){return _0x3ef376(_0x30bdad[_0x3636('0x14')](0x1f4,_['map'](_0x709ffc,_0x3636('0x1e'))[_0x3636('0x18')](',\x20')));}var _0x573dba=_['find'](_0x1e62e9[_0x3636('0x7a')],{'uniqueid':_0x3ff4db[_0x3636('0x65')]});if(_0x573dba&&_0x573dba['channel']){return ami[_0x3636('0x1d')]({'action':_0x3636('0x7d'),'channel':_0x573dba['channel'],'exten':_0x3ff4db['exten'],'context':_0x3ff4db[_0x3636('0x7e')]||_0x573dba[_0x3636('0x7e')],'priority':0x1})['then'](function(_0x1ffdd4){_0x3e0723({'code':0xc8,'message':[_0x3ff4db[_0x3636('0x65')],_0x1ffdd4['message'][_0x3636('0x6d')]()][_0x3636('0x18')]('\x20')});})[_0x3636('0x23')](function(_0x403604){_0x3ef376(_0x30bdad[_0x3636('0x14')](0x1f5,[_0x3ff4db[_0x3636('0x65')],_0x403604[_0x3636('0x1e')][_0x3636('0x6d')]()][_0x3636('0x18')]('\x20')));});}else{return _0x3ef376(_0x30bdad[_0x3636('0x14')](0x1f5,_0x3636('0x73')));}});},'Agents':function(_0x18d5a6){return new Promise(function(_0x331b59,_0x3d4c7f){var _0x56c9c1=_[_0x3636('0x61')](_0x1e62e9[_0x3636('0xf')]);_0x331b59({'count':_0x56c9c1[_0x3636('0x5d')],'rows':_0x56c9c1});});},'Telephones':function(_0x2645e5){return new Promise(function(_0x487ef2,_0xbbd8a2){var _0x270ddf=_[_0x3636('0x61')](_0x1e62e9['telephones']);_0x487ef2({'count':_0x270ddf[_0x3636('0x5d')],'rows':_0x270ddf});});},'Trunks':function(_0x3e823e){return new Promise(function(_0x58c9f7,_0x3fa861){var _0x28aa3f=_[_0x3636('0x61')](_0x1e62e9['trunks']);_0x58c9f7({'count':_0x28aa3f[_0x3636('0x5d')],'rows':_0x28aa3f});});},'OutboundChannels':function(_0x2acc4d){return new Promise(function(_0x2dcbf0,_0x1a47d1){var _0x12d9f4=_[_0x3636('0x61')](_0x1e62e9[_0x3636('0x7f')]);_0x2dcbf0({'count':_0x12d9f4[_0x3636('0x5d')],'rows':_0x12d9f4});});},'Outbound':function(_0x156879){return new Promise(function(_0x31aa2d,_0x55ba76){_0x31aa2d(_0x1e62e9['outbound']);});},'Campaigns':function(_0x1791eb){return new Promise(function(_0x3d517c,_0x4ae28b){var _0x2f597c=_[_0x3636('0x61')](_0x1e62e9[_0x3636('0x80')]);_0x3d517c({'count':_0x2f597c[_0x3636('0x5d')],'rows':_0x2f597c});});},'VoiceQueuesPreview':function(_0x48b60a){var _0xb8082a=this;return new Promise(function(_0x18e951,_0xf21ea7){_0x3d616f[_0x3636('0x81')](_0x48b60a['id'])['then'](function(_0x450d6b){_0x18e951({'code':0xc8,'message':_0x450d6b['message']});})['catch'](function(_0x4cbf20){_0xf21ea7(_0xb8082a['error'](0x1f4,_0x4cbf20[_0x3636('0x1e')]));});});},'EventManager':function(_0x32b521){var _0x25beb5=this;return new Promise(function(_0x14b59e,_0x30b5d3){if(!_0x32b521[_0x3636('0x82')]){return _0x30b5d3(_0x25beb5['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x3636('0x83')]('custom:'+_0x32b521['event'],_0x32b521[_0x3636('0x1e')]);_0x14b59e({'code':0xc8,'message':_0x32b521});});},'FaxAccounts':function(_0x3b10f8){return new Promise(function(_0x1ab5f9,_0x2974db){var _0x2b36ad=_[_0x3636('0x61')](_0x1e62e9[_0x3636('0x84')]);_0x1ab5f9({'count':_0x2b36ad[_0x3636('0x5d')],'rows':_0x2b36ad});});},'SendFax':function(_0x3f1699){var _0x565220=this;return new Promise(function(_0x408a3e,_0x2d2ef5){_0x15728f['send'](_0x3f1699)[_0x3636('0x22')](function(_0x477792){_0x408a3e({'code':0xc8,'message':_0x477792[_0x3636('0x1e')]});})[_0x3636('0x23')](function(_0x1459f9){_0x2d2ef5(_0x565220[_0x3636('0x14')](0x1f4,_0x1459f9[_0x3636('0x1e')]));});});},'CheckAfterSend':function(_0x2bbbeb){var _0x32768e=this;return new Promise(function(_0x12366b,_0xbabc14){_0x15728f['checkAfterSend'](_0x2bbbeb)['then'](function(_0x3f8192){_0x12366b({'code':0xc8,'message':_0x3f8192[_0x3636('0x1e')]});})[_0x3636('0x23')](function(_0x16c543){_0xbabc14(_0x32768e[_0x3636('0x14')](0x1f4,_0x16c543['message']));});});}};var _0x2c0769=jayson[_0x3636('0x85')](_0x17b2a4)[_0x3636('0x86')]();_0x2c0769['on']('error',function(_0x2a61db){return _0xdc928c(_0x2a61db);});_0x2c0769[_0x3636('0x8')](0x232a,_0x3636('0x87'),function(){console[_0x3636('0x88')](_0x3636('0x89'),0x232a);return _0x1f94ef(_0x3636('0x8a')+0x232a);});});}; \ No newline at end of file +var _0xed1c=['outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','find','omit','undefined','channels','validate','length','map','channel','%s.%s','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','status','catch','uniqueid','voicechannel','resolve','StopMixMonitor','destinationchannel','monitors','stop','filename','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','Channel\x20doesn\x27t\x20exist','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','emit','custom:','faxAccounts','send','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','../../../config/environment','../properties','../ami','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','module','action','Reload','Action','then','message','pick','Command','content','voiceQueues','name','strategy','answered','available','pTalking','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay'];(function(_0x277c10,_0x3fc7b3){var _0x517a39=function(_0x51f378){while(--_0x51f378){_0x277c10['push'](_0x277c10['shift']());}};_0x517a39(++_0x3fc7b3);}(_0xed1c,0xe4));var _0xced1=function(_0x47d6b2,_0x374239){_0x47d6b2=_0x47d6b2-0x0;var _0x3367af=_0xed1c[_0x47d6b2];return _0x3367af;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require('bluebird');var moment=require('moment');var config=require(_0xced1('0x2'));var properties=require(_0xced1('0x3'));var ami=require(_0xced1('0x4'));exports['listen']=function(_0x1e23a9,_0x445160,_0x466657){return new BPromise(function(_0x37b22b,_0x59399e){var _0x2bcf42={'QueuePause':function(_0x38bca8){return new Promise(function(_0x39d5df,_0x1fb40b){var _0x354203=util[_0xced1('0x5')](_0xced1('0x6'),_0xced1('0x7'),_0x38bca8['name']);if(_0x1e23a9[_0xced1('0x8')]&&_0x1e23a9['timers'][_0x354203]&&_0x1e23a9[_0xced1('0x8')][_0x354203][_0xced1('0x9')]){_0x1e23a9[_0xced1('0x8')][_0x354203][_0xced1('0xa')]();}if(_0x1e23a9[_0xced1('0xb')][_0x354203]){_0x1e23a9[_0xced1('0xb')][_0x354203][_0xced1('0xc')]({'statePause':_0x38bca8['pause']?!![]:![]});}_0x39d5df({'code':0xc8,'message':_0xced1('0xd')});});},'Reload':function(_0x2a5cd6){var _0x1b7a33=this;return new Promise(function(_0x52d96a,_0x564e17){if(ami[_0xced1('0xe')]()==![]){return _0x564e17(_0x1b7a33[_0xced1('0xf')](0x1f4,[config['asterisk']['ip'],config[_0xced1('0x10')][_0xced1('0x11')],_0xced1('0x12')][_0xced1('0x13')]('\x20')));}_0x2a5cd6=_['pick'](_0x2a5cd6,_['keys'](properties[_0xced1('0x14')]));_0x2a5cd6[_0xced1('0x15')]=_0xced1('0x16');return ami[_0xced1('0x17')](_0x2a5cd6)[_0xced1('0x18')](function(_0x292997){_0x52d96a({'code':0xc8,'message':_0x292997['message']});})['catch'](function(_0x2a92c8){_0x564e17(_0x1b7a33[_0xced1('0xf')](0x1f5,_0x2a92c8[_0xced1('0x19')]));});});},'Command':function(_0x5257e7){var _0x1eac14=this;return new Promise(function(_0x25f0df,_0x3e51e4){if(ami['isConnected']()==![]){return _0x3e51e4(_0x1eac14[_0xced1('0xf')](0x1f4,[config[_0xced1('0x10')]['ip'],config[_0xced1('0x10')]['username'],_0xced1('0x12')][_0xced1('0x13')]('\x20')));}_0x5257e7=_[_0xced1('0x1a')](_0x5257e7,'command');_0x5257e7['action']=_0xced1('0x1b');return ami[_0xced1('0x17')](_0x5257e7)[_0xced1('0x18')](function(_0x20dcb4){_0x25f0df({'code':0xc8,'message':_0x20dcb4[_0xced1('0x1c')]});})['catch'](function(_0x14f47e){_0x3e51e4(_0x1eac14[_0xced1('0xf')](0x1f5,_0x14f47e['message']));});});},'VoiceQueues':function(_0x5f2018){return new Promise(function(_0x38f738,_0x258c9a){var _0x3af9c0=[];for(var _0x3912fe in _0x1e23a9[_0xced1('0x1d')]){if(_0x1e23a9[_0xced1('0x1d')]['hasOwnProperty'](_0x3912fe)){var _0x181f6e=_0x1e23a9[_0xced1('0x1d')][_0x3912fe];var _0x43cdec={'id':_0x181f6e['id'],'name':_0x181f6e[_0xced1('0x1e')],'strategy':_0x181f6e[_0xced1('0x1f')],'answered':_0x181f6e[_0xced1('0x20')],'available':_0x181f6e[_0xced1('0x21')],'loggedIn':_0x181f6e['loggedIn'],'pTalking':_0x181f6e[_0xced1('0x22')],'sumBillable':_0x181f6e['sumBillable'],'sumDuration':_0x181f6e[_0xced1('0x23')],'sumHoldTime':_0x181f6e[_0xced1('0x24')]||0x0,'talking':_0x181f6e[_0xced1('0x25')],'total':_0x181f6e[_0xced1('0x26')],'type':_0x181f6e['type'],'unmanaged':_0x181f6e['unmanaged'],'abandoned':_0x181f6e[_0xced1('0x27')],'waiting':_0x181f6e[_0xced1('0x28')],'loggedInDb':_0x181f6e[_0xced1('0x29')]};if(_0x181f6e['type']==='outbound'){_0x43cdec['dialActive']=_0x181f6e[_0xced1('0x2a')];_0x43cdec[_0xced1('0x2b')]=_0x181f6e[_0xced1('0x2b')];_0x43cdec[_0xced1('0x2c')]=_0x181f6e['dialOriginateCallerIdName'];_0x43cdec[_0xced1('0x2d')]=_0x181f6e[_0xced1('0x2d')];_0x43cdec[_0xced1('0x2e')]=_0x181f6e[_0xced1('0x2e')];_0x43cdec[_0xced1('0x2f')]=_0x181f6e[_0xced1('0x2f')];_0x43cdec[_0xced1('0x30')]=_0x181f6e['temp'];_0x43cdec['outboundAnswerAgiCallsDay']=_0x181f6e[_0xced1('0x31')];_0x43cdec[_0xced1('0x32')]=_0x181f6e[_0xced1('0x32')];_0x43cdec[_0xced1('0x33')]=_0x181f6e[_0xced1('0x33')];_0x43cdec[_0xced1('0x34')]=_0x181f6e['outboundBusyCallsDay'];_0x43cdec['outboundCongestionCallsDay']=_0x181f6e['outboundCongestionCallsDay'];_0x43cdec['outboundDropCallsDayACS']=_0x181f6e[_0xced1('0x35')];_0x43cdec[_0xced1('0x36')]=_0x181f6e[_0xced1('0x36')];_0x43cdec[_0xced1('0x37')]=_0x181f6e[_0xced1('0x37')];_0x43cdec[_0xced1('0x38')]=_0x181f6e[_0xced1('0x38')];_0x43cdec[_0xced1('0x39')]=_0x181f6e[_0xced1('0x39')];_0x43cdec[_0xced1('0x3a')]=_0x181f6e[_0xced1('0x3a')];_0x43cdec[_0xced1('0x3b')]=_0x181f6e[_0xced1('0x3b')];_0x43cdec['outboundRejectCallsDay']=_0x181f6e[_0xced1('0x3c')];_0x43cdec[_0xced1('0x3d')]=_0x181f6e[_0xced1('0x3d')];_0x43cdec[_0xced1('0x3e')]=_0x181f6e[_0xced1('0x3e')];_0x43cdec[_0xced1('0x3f')]=_0x181f6e['predictiveIntervalAvgHoldtime'];_0x43cdec[_0xced1('0x40')]=_0x181f6e[_0xced1('0x40')];_0x43cdec[_0xced1('0x41')]=_0x181f6e[_0xced1('0x41')];_0x43cdec[_0xced1('0x42')]=_0x181f6e[_0xced1('0x42')];_0x43cdec[_0xced1('0x43')]=_0x181f6e[_0xced1('0x43')];_0x43cdec[_0xced1('0x44')]=_0x181f6e[_0xced1('0x44')];_0x43cdec[_0xced1('0x45')]=_0x181f6e['predictiveIntervalHitRate'];_0x43cdec['predictiveIntervalMultiplicativeFactor']=_0x181f6e[_0xced1('0x46')];_0x43cdec[_0xced1('0x47')]=_0x181f6e[_0xced1('0x47')];_0x43cdec['predictiveIntervalAvailable']=_0x181f6e[_0xced1('0x48')];_0x43cdec[_0xced1('0x49')]=_0x181f6e[_0xced1('0x49')];_0x43cdec['message']=_0x181f6e[_0xced1('0x19')];_0x43cdec[_0xced1('0x4a')]=_0x181f6e['originated'];_0x43cdec[_0xced1('0x4b')]=_0x181f6e['erlangCalls'];_0x43cdec[_0xced1('0x4c')]=_0x181f6e[_0xced1('0x4c')];_0x43cdec['erlangAbandonmentRate']=_0x181f6e[_0xced1('0x4d')];_0x43cdec[_0xced1('0x4e')]=_0x181f6e[_0xced1('0x4e')];_0x43cdec['startPredictive']=_0x181f6e[_0xced1('0x4f')];_0x43cdec[_0xced1('0x50')]=_0x181f6e['startProgressive'];}if(_0x181f6e[_0xced1('0x51')]){_0x43cdec['Trunk']={'id':_0x181f6e['Trunk']['id'],'name':_0x181f6e[_0xced1('0x51')]['name'],'active':_0x181f6e[_0xced1('0x51')][_0xced1('0x52')],'callerid':_0x181f6e[_0xced1('0x51')]['callerid']};}if(_0x181f6e[_0xced1('0x53')]){_0x43cdec['Interval']={'id':_0x181f6e[_0xced1('0x53')]['id'],'name':_0x181f6e[_0xced1('0x53')][_0xced1('0x1e')]};}_0x3af9c0[_0xced1('0x54')](_0x43cdec);}}_0x38f738({'count':_0x3af9c0['length'],'rows':_0x3af9c0});});},'UpdateVoiceQueue':function(_0x19906c){return new Promise(function(_0x1d5034,_0x54c62c){var _0x4733f0=_[_0xced1('0x55')](_0x1e23a9['voiceQueues'],{'id':parseInt(_0x19906c['id'])});var _0x1800c8=_[_0xced1('0x56')](_0x19906c,['id']);if(_0x4733f0){for(var _0x1646df in _0x1800c8){if(typeof _0x1800c8[_0x1646df]!=='undefined'&&typeof _0x4733f0[_0x1646df]!==_0xced1('0x57')){_0x4733f0[_0x1646df]=_0x1800c8[_0x1646df];}}_0x1d5034(_0x4733f0);}else{_0x54c62c();}});},'VoiceChannels':function(_0xcfbed8){return new Promise(function(_0x39fc4a,_0x3333e6){var _0x376619=_['values'](_0x1e23a9[_0xced1('0x58')]);_0x39fc4a({'count':_0x376619['length'],'rows':_0x376619});});},'VoiceChannelMixMonitor':function(_0x31fb76){var _0x646987=this;return new Promise(function(_0xf06f87,_0x24cce1){if(ami[_0xced1('0xe')]()==![]){return _0x24cce1(_0x646987[_0xced1('0xf')](0x1f4,[config['asterisk']['ip'],config[_0xced1('0x10')][_0xced1('0x11')],'ami\x20disconnected'][_0xced1('0x13')]('\x20')));}var _0x5a717a=schema(properties['voicechannel'])[_0xced1('0x59')](_0x31fb76);if(_0x5a717a[_0xced1('0x5a')]>0x0){return _0x24cce1(_0x646987[_0xced1('0xf')](0x1f4,_[_0xced1('0x5b')](_0x5a717a,'message')[_0xced1('0x13')](',\x20')));}var _0x33a8a6=_[_0xced1('0x55')](_0x1e23a9['channels'],{'uniqueid':_0x31fb76['uniqueid']});if(_0x33a8a6&&_0x33a8a6[_0xced1('0x5c')]){var _0x1c51a6=util[_0xced1('0x5')](_0xced1('0x5d'),_0x31fb76['filename']||_0x31fb76['uniqueid'],_0x31fb76['format']||_0xced1('0x5e'));return ami[_0xced1('0x17')]({'action':_0xced1('0x5f'),'channel':_0x33a8a6[_0xced1('0x5c')],'file':_0x1c51a6,'options':_0xced1('0x60')})[_0xced1('0x18')](function(_0x211fd0){var _0x323b32=_[_0xced1('0x55')](_0x33a8a6['monitors'],{'filename':_0xced1('0x61')+_0x1c51a6[_0xced1('0x62')]()});if(_[_0xced1('0x63')](_0x323b32)){_0x33a8a6['monitors'][_0xced1('0x54')]({'filename':_0xced1('0x61')+_0x1c51a6[_0xced1('0x62')](),'createdAt':moment()[_0xced1('0x5')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x211fd0[_0xced1('0x64')],'status':'rec'});}else{_0x323b32['mixmonitorid']=_0x211fd0[_0xced1('0x64')];_0x323b32[_0xced1('0x65')]='rec';}_0xf06f87({'code':0xc8,'message':[_0x31fb76['uniqueid'],'MixMonitor\x20Success',_0x211fd0[_0xced1('0x64')]]['join']('\x20'),'mixmonitorid':_0x211fd0[_0xced1('0x64')]});})[_0xced1('0x66')](function(_0x12241d){_0x24cce1(_0x646987[_0xced1('0xf')](0x1f5,[_0x31fb76[_0xced1('0x67')],_0x12241d[_0xced1('0x19')][_0xced1('0x62')]()][_0xced1('0x13')]('\x20')));});}else{return _0x24cce1(_0x646987['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x4832d2){var _0x45e587=this;return new Promise(function(_0x235651,_0x34262e){if(ami['isConnected']()==![]){return _0x34262e(_0x45e587[_0xced1('0xf')](0x1f4,[config[_0xced1('0x10')]['ip'],config[_0xced1('0x10')][_0xced1('0x11')],'ami\x20disconnected'][_0xced1('0x13')]('\x20')));}var _0x2abd02=schema(properties[_0xced1('0x68')])[_0xced1('0x59')](_0x4832d2);if(_0x2abd02[_0xced1('0x5a')]>0x0){return _0x34262e(_0x45e587[_0xced1('0xf')](0x1f4,_[_0xced1('0x5b')](_0x2abd02,_0xced1('0x19'))['join'](',\x20')));}var _0x4bebc8=_['find'](_0x1e23a9[_0xced1('0x58')],{'uniqueid':_0x4832d2['uniqueid']});if(_0x4bebc8){return BPromise[_0xced1('0x69')]()['then'](function(){if(_0x4bebc8['channel']){return ami[_0xced1('0x17')]({'action':_0xced1('0x6a'),'channel':_0x4bebc8[_0xced1('0x5c')],'mixmonitorid':_0x4832d2[_0xced1('0x64')]})[_0xced1('0x66')](function(_0x466da1){});}})[_0xced1('0x18')](function(){if(_0x4bebc8[_0xced1('0x6b')]){return ami[_0xced1('0x17')]({'action':_0xced1('0x6a'),'channel':_0x4bebc8[_0xced1('0x6b')],'mixmonitorid':_0x4832d2['mixmonitorid']})[_0xced1('0x66')](function(_0x168e5b){});}})['then'](function(_0x8b38ce){var _0x26f154=_['find'](_0x4bebc8[_0xced1('0x6c')],{'mixmonitorid':_0x4832d2[_0xced1('0x64')]});if(_0x26f154){_0x26f154[_0xced1('0x65')]=_0xced1('0x6d');}})[_0xced1('0x18')](function(){var _0x5c9a6d=util['format']('%s.%s',_0x4832d2[_0xced1('0x6e')]||_0x4832d2[_0xced1('0x67')],_0x4832d2['format']||_0xced1('0x5e'));var _0x10447b=_[_0xced1('0x55')](_0x4bebc8['monitors'],{'filename':_0xced1('0x61')+_0x5c9a6d[_0xced1('0x62')]()});if(_0x10447b){_0x10447b['status']=_0xced1('0x6d');}})['then'](function(){_0x235651({'code':0xc8,'message':[_0x4832d2[_0xced1('0x67')],_0xced1('0x6f')][_0xced1('0x13')]('\x20')});})[_0xced1('0x66')](function(_0x286695){_0x34262e(_0x45e587[_0xced1('0xf')](0x1f5,[_0x4832d2[_0xced1('0x67')],_0x286695['message'][_0xced1('0x62')]()][_0xced1('0x13')]('\x20')));});}else{return _0x34262e(_0x45e587[_0xced1('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x5c2567){return new Promise(function(_0x27f1f1,_0x1fdf2c){var _0x552de8=_[_0xced1('0x70')](_0x1e23a9[_0xced1('0x71')]);_0x27f1f1({'count':_0x552de8[_0xced1('0x5a')],'rows':_0x552de8});});},'VoiceQueuesChannel':function(_0x51c879){var _0x57107b=this;return new Promise(function(_0x13689f,_0x4f9981){var _0x76f5df=schema(properties[_0xced1('0x72')])[_0xced1('0x59')](_0x51c879);if(_0x76f5df[_0xced1('0x5a')]>0x0){return _0x4f9981(_0x57107b['error'](0x1f4,_[_0xced1('0x5b')](_0x76f5df,'message')['join'](',\x20')));}var _0x5973e4=_['find'](_0x1e23a9[_0xced1('0x71')],{'uniqueid':_0x51c879[_0xced1('0x67')]});if(_0x5973e4){_0x13689f(_0x5973e4);}else{return _0x4f9981(_0x57107b['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x334928){var _0x1e9956=this;return new Promise(function(_0x4eefea,_0x591f11){if(ami[_0xced1('0xe')]()==![]){return _0x591f11(_0x1e9956[_0xced1('0xf')](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0xced1('0x13')]('\x20')));}var _0x135f0f=schema(properties[_0xced1('0x73')])[_0xced1('0x59')](_0x334928);if(_0x135f0f[_0xced1('0x5a')]>0x0){return _0x591f11(_0x1e9956[_0xced1('0xf')](0x1f4,_['map'](_0x135f0f,_0xced1('0x19'))[_0xced1('0x13')](',\x20')));}var _0x2d5b26=_[_0xced1('0x55')](_0x1e23a9[_0xced1('0x71')],{'uniqueid':_0x334928[_0xced1('0x67')]});if(_0x2d5b26&&_0x2d5b26[_0xced1('0x5c')]){return ami[_0xced1('0x17')]({'action':_0xced1('0x74'),'channel':_0x2d5b26['channel']})['then'](function(_0x607728){_0x4eefea({'code':0xc8,'message':[_0x334928['uniqueid'],_0x607728[_0xced1('0x19')]['toLowerCase']()][_0xced1('0x13')]('\x20')});})[_0xced1('0x66')](function(_0x70bc63){_0x591f11(_0x1e9956[_0xced1('0xf')](0x1f5,[_0x334928[_0xced1('0x67')],_0x70bc63[_0xced1('0x19')]['toLowerCase']()][_0xced1('0x13')]('\x20')));});}else{return _0x591f11(_0x1e9956[_0xced1('0xf')](0x1f5,_0xced1('0x75')));}});},'VoiceQueuesChannelRedirect':function(_0x3e7070){var _0x137460=this;return new Promise(function(_0x2ec441,_0x4fc259){if(ami['isConnected']()==![]){return _0x4fc259(_0x137460[_0xced1('0xf')](0x1f4,[config[_0xced1('0x10')]['ip'],config[_0xced1('0x10')][_0xced1('0x11')],_0xced1('0x12')]['join']('\x20')));}var _0x73ba9a=schema(properties[_0xced1('0x76')])[_0xced1('0x59')](_0x3e7070);if(_0x73ba9a[_0xced1('0x5a')]>0x0){return _0x4fc259(_0x137460['error'](0x1f4,_[_0xced1('0x5b')](_0x73ba9a,_0xced1('0x19'))['join'](',\x20')));}var _0x470053=_['find'](_0x1e23a9[_0xced1('0x71')],{'uniqueid':_0x3e7070[_0xced1('0x67')]});if(_0x470053&&_0x470053[_0xced1('0x5c')]){return ami[_0xced1('0x17')]({'action':_0xced1('0x77'),'channel':_0x470053[_0xced1('0x5c')],'exten':_0x3e7070[_0xced1('0x78')],'context':_0x3e7070[_0xced1('0x79')]||_0x470053[_0xced1('0x79')],'priority':0x1})[_0xced1('0x18')](function(_0x525e46){_0x2ec441({'code':0xc8,'message':[_0x3e7070[_0xced1('0x67')],_0x525e46[_0xced1('0x19')][_0xced1('0x62')]()][_0xced1('0x13')]('\x20')});})['catch'](function(_0x35ff8d){_0x4fc259(_0x137460[_0xced1('0xf')](0x1f5,[_0x3e7070[_0xced1('0x67')],_0x35ff8d[_0xced1('0x19')]['toLowerCase']()][_0xced1('0x13')]('\x20')));});}else{return _0x4fc259(_0x137460[_0xced1('0xf')](0x1f5,_0xced1('0x75')));}});},'Agents':function(_0x265b76){return new Promise(function(_0x3beefd,_0x4fa469){var _0x5d9a97=_['values'](_0x1e23a9[_0xced1('0xb')]);_0x3beefd({'count':_0x5d9a97[_0xced1('0x5a')],'rows':_0x5d9a97});});},'Telephones':function(_0x1abc72){return new Promise(function(_0x4dde74,_0x41d724){var _0x328079=_['values'](_0x1e23a9[_0xced1('0x7a')]);_0x4dde74({'count':_0x328079['length'],'rows':_0x328079});});},'Trunks':function(_0xc4a5c8){return new Promise(function(_0x16bcaa,_0x2b8d1b){var _0x5aeea4=_['values'](_0x1e23a9[_0xced1('0x7b')]);_0x16bcaa({'count':_0x5aeea4[_0xced1('0x5a')],'rows':_0x5aeea4});});},'OutboundChannels':function(_0x3a4bd6){return new Promise(function(_0x20e68a,_0x1f539f){var _0x5f3a8d=_['values'](_0x1e23a9[_0xced1('0x7c')]);_0x20e68a({'count':_0x5f3a8d[_0xced1('0x5a')],'rows':_0x5f3a8d});});},'Outbound':function(_0x410c40){return new Promise(function(_0x4cf606,_0x25fabe){_0x4cf606(_0x1e23a9['outbound']);});},'Campaigns':function(_0x535aaf){return new Promise(function(_0xd54ed3,_0x5a63bf){var _0x18a6a9=_['values'](_0x1e23a9[_0xced1('0x7d')]);_0xd54ed3({'count':_0x18a6a9[_0xced1('0x5a')],'rows':_0x18a6a9});});},'VoiceQueuesPreview':function(_0xb153dc){var _0x19bfcf=this;return new Promise(function(_0x1eac74,_0x4536df){_0x445160[_0xced1('0x7e')](_0xb153dc['id'])['then'](function(_0x4b3511){_0x1eac74({'code':0xc8,'message':_0x4b3511[_0xced1('0x19')]});})[_0xced1('0x66')](function(_0x23d0d4){_0x4536df(_0x19bfcf[_0xced1('0xf')](0x1f4,_0x23d0d4['message']));});});},'EventManager':function(_0x51107f){var _0x36358b=this;return new Promise(function(_0x4f61bb,_0x1f13af){if(!_0x51107f[_0xced1('0x7f')]){return _0x1f13af(_0x36358b[_0xced1('0xf')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xced1('0x80')](_0xced1('0x81')+_0x51107f['event'],_0x51107f[_0xced1('0x19')]);_0x4f61bb({'code':0xc8,'message':_0x51107f});});},'FaxAccounts':function(_0x25128f){return new Promise(function(_0x3173cc,_0x5e3a52){var _0x2f4f7a=_[_0xced1('0x70')](_0x1e23a9[_0xced1('0x82')]);_0x3173cc({'count':_0x2f4f7a[_0xced1('0x5a')],'rows':_0x2f4f7a});});},'SendFax':function(_0xce8b5){var _0x4725eb=this;return new Promise(function(_0x53fca5,_0x5126d2){_0x466657[_0xced1('0x83')](_0xce8b5)[_0xced1('0x18')](function(_0x455b4e){_0x53fca5({'code':0xc8,'message':_0x455b4e[_0xced1('0x19')]});})[_0xced1('0x66')](function(_0xd997a5){_0x5126d2(_0x4725eb[_0xced1('0xf')](0x1f4,_0xd997a5[_0xced1('0x19')]));});});},'CheckAfterSend':function(_0x401ed5){var _0x43b907=this;return new Promise(function(_0x7b033d,_0x4f22eb){_0x466657['checkAfterSend'](_0x401ed5)[_0xced1('0x18')](function(_0x3a0044){_0x7b033d({'code':0xc8,'message':_0x3a0044[_0xced1('0x19')]});})[_0xced1('0x66')](function(_0x128817){_0x4f22eb(_0x43b907[_0xced1('0xf')](0x1f4,_0x128817[_0xced1('0x19')]));});});}};var _0x14cbf1=jayson[_0xced1('0x84')](_0x2bcf42)[_0xced1('0x85')]();_0x14cbf1['on'](_0xced1('0xf'),function(_0xd39989){return _0x59399e(_0xd39989);});_0x14cbf1[_0xced1('0x86')](0x232a,_0xced1('0x87'),function(){console[_0xced1('0x88')](_0xced1('0x89'),0x232a);return _0x37b22b(_0xced1('0x8a')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index aca9ac4..8578c39 100644 --- a/server/services/ami/trigger/cmContact/index.js +++ b/server/services/ami/trigger/cmContact/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bae=['data5','xmd-contactid','ListId','data3','map','firstName','lastName','phone','mobile','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridnum','routeId','','calleridname','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','destcalleridnum','format','user:%s','trigger:%s','action','toLowerCase','merge','ioredis','util','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','isNil'];(function(_0x155eef,_0x394e3d){var _0xd9afcd=function(_0x5b52bc){while(--_0x5b52bc){_0x155eef['push'](_0x155eef['shift']());}};_0xd9afcd(++_0x394e3d);}(_0x7bae,0x13b));var _0xe7ba=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x7bae[_0x3826ad];return _0x17b900;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0xe7ba('0x0'));var util=require(_0xe7ba('0x1'));var config=require('../../../../config/environment');var logger=require(_0xe7ba('0x2'))('trigger');var cmContactRpc=require(_0xe7ba('0x3'));config[_0xe7ba('0x4')]=_[_0xe7ba('0x5')](config[_0xe7ba('0x4')],{'host':_0xe7ba('0x6'),'port':0x18eb});var io=require(_0xe7ba('0x7'))(new Redis(config[_0xe7ba('0x4')]));function emit(_0x3c5e59,_0x10b307,_0x34fb18,_0x160565,_0x27b1d5){logger[_0xe7ba('0x8')](_0xe7ba('0x9'),_0x3c5e59,_0x10b307['id'],_0x34fb18,_0x160565,JSON['stringify'](_0x27b1d5));io['to'](_0x34fb18)[_0xe7ba('0xa')](_0x160565,_0x27b1d5);}exports[_0xe7ba('0xb')]=function(_0x375ebb,_0x276bc3,_0x15083a,_0x1672f0){var _0x99a86f,_0x448bcc;var _0x194447={};var _0x4b6597=Number(_0x15083a[_0xe7ba('0xc')]);var _0x588c8b=_0x15083a[_0xe7ba('0xd')]?Boolean(Number(_0x15083a[_0xe7ba('0xd')])):![];var _0x390596;var _0x17e4e6=![];if(!_[_0xe7ba('0xe')](_0x15083a[_0xe7ba('0xf')])){if(_0x15083a['data5']=='1')_0x17e4e6=!![];}if(!_0x17e4e6){if(_0x1672f0['xmd-contactid']){_0x194447['id']=_0x1672f0[_0xe7ba('0x10')];}}if(!_0x194447['id']){_0x194447[_0xe7ba('0x11')]=_0x4b6597;_0x390596=_0x15083a[_0xe7ba('0x12')]&&_0x15083a['data3']!=='0'?_0x15083a[_0xe7ba('0x12')]['split'](','):['phone'];_0x194447['$or']=_[_0xe7ba('0x13')](_0x390596,function(_0x4e87f5){var _0x41a773={};_0x41a773[_0x4e87f5]=_0x1672f0['routeId']?_0x1672f0['destcalleridnum']:_0x1672f0['calleridnum'];return _0x41a773;});}var _0x3f326a=['id',_0xe7ba('0x14'),_0xe7ba('0x15'),_0xe7ba('0x16'),_0xe7ba('0x17'),'fax',_0xe7ba('0x11'),_0xe7ba('0x18'),_0xe7ba('0x19'),_0xe7ba('0x1a')];var _0x4aaf35=_[_0xe7ba('0x1b')](_0x3f326a,_0x390596);BPromise[_0xe7ba('0x1c')]()['then'](cmContactRpc[_0xe7ba('0x1d')]({'attributes':_0x4aaf35,'where':_0x194447}))[_0xe7ba('0x1e')](function(_0x27c882){_0x448bcc=_0x27c882;if(!_[_0xe7ba('0x1f')](_0x448bcc)){if(_0x448bcc[_0xe7ba('0x20')]===0x1){_0x99a86f=_0x448bcc[0x0];logger[_0xe7ba('0x8')](_0xe7ba('0x21'),_0x1672f0[_0xe7ba('0x22')],_0x276bc3['id'],_0x99a86f['id']);}else{logger[_0xe7ba('0x8')](_0xe7ba('0x23'),_0x1672f0['uniqueid'],_0x276bc3['id'],_['map'](_0x448bcc,'id')['join'](','));}return;}else{logger['info'](_0xe7ba('0x24'),_0x1672f0['uniqueid'],_0x276bc3['id']);var _0x4ecc0d={'ListId':_0x4b6597};var _0x5ece11=_0x15083a[_0xe7ba('0x25')]&&_0x15083a[_0xe7ba('0x25')]!=='0'?_0x15083a[_0xe7ba('0x25')]:_0xe7ba('0x16');if(_0x588c8b){logger[_0xe7ba('0x8')](_0xe7ba('0x26'),_0x1672f0[_0xe7ba('0x22')],_0x276bc3['id']);_0x4ecc0d[_0x5ece11]=_[_0xe7ba('0xe')](_0x1672f0['routeId'])?_0x1672f0[_0xe7ba('0x27')]:_0x1672f0['destcalleridnum'];if(_[_0xe7ba('0xe')](_0x1672f0[_0xe7ba('0x28')])){_0x4ecc0d[_0xe7ba('0x14')]=_0x1672f0['calleridname']&&_0x1672f0['calleridname']!==_0xe7ba('0x29')?_0x1672f0[_0xe7ba('0x2a')]:_0xe7ba('0x2b');}else{_0x4ecc0d[_0xe7ba('0x14')]=_0x1672f0[_0xe7ba('0x2c')]&&_0x1672f0['destcalleridname']!==_0xe7ba('0x29')?_0x1672f0[_0xe7ba('0x2c')]:'Unknown';}return BPromise[_0xe7ba('0x1c')]()['then'](cmContactRpc['createContact'](_0x4ecc0d))[_0xe7ba('0x1e')](function(_0x134f21){_0x99a86f=_0x134f21;_0x448bcc[_0xe7ba('0x2d')](_0x134f21);if(_0x99a86f){logger['info'](_0xe7ba('0x2e'),_0x1672f0['uniqueid'],_0x276bc3['id'],_0x99a86f['id']);}return;});}else{logger[_0xe7ba('0x8')](_0xe7ba('0x2f'),_0x1672f0[_0xe7ba('0x22')],_0x276bc3['id']);_0x4ecc0d[_0x5ece11]=_[_0xe7ba('0xe')](_0x1672f0[_0xe7ba('0x28')])?_0x1672f0['calleridnum']:_0x1672f0[_0xe7ba('0x30')];if(_[_0xe7ba('0xe')](_0x1672f0['routeId'])){_0x4ecc0d[_0xe7ba('0x14')]=_0x1672f0[_0xe7ba('0x2a')]&&_0x1672f0[_0xe7ba('0x2a')]!==''?_0x1672f0[_0xe7ba('0x2a')]:_0xe7ba('0x2b');}else{_0x4ecc0d['firstName']=_0x1672f0[_0xe7ba('0x2c')]&&_0x1672f0[_0xe7ba('0x2c')]!==_0xe7ba('0x29')?_0x1672f0['destcalleridname']:_0xe7ba('0x2b');}_0x99a86f=_0x4ecc0d;_0x448bcc[_0xe7ba('0x2d')](_0x4ecc0d);return;}}})['then'](function(){if(_0x375ebb){emit(_0x1672f0[_0xe7ba('0x22')],_0x276bc3,util[_0xe7ba('0x31')](_0xe7ba('0x32'),_0x375ebb['name']),util['format'](_0xe7ba('0x33'),_0x15083a[_0xe7ba('0x34')][_0xe7ba('0x35')]()),{'evt':_[_0xe7ba('0x36')](_0x1672f0,{'autoCreate':_0x588c8b}),'contact':_0x99a86f===undefined?{}:_0x99a86f,'contacts':_0x448bcc[_0xe7ba('0x20')]===0x0?undefined:_0x448bcc});}});}; \ No newline at end of file +var _0x9c44=['','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','destcalleridnum','push','format','name','trigger:%s','action','merge','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','firstName','lastName','mobile','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridnum','calleridname'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0x49c4('0x0'));var util=require(_0x49c4('0x1'));var config=require(_0x49c4('0x2'));var logger=require(_0x49c4('0x3'))(_0x49c4('0x4'));var cmContactRpc=require(_0x49c4('0x5'));config['redis']=_['defaults'](config[_0x49c4('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x7'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x69bc41,_0x2c4e2e,_0x436234,_0x511d53,_0x11c586){logger[_0x49c4('0x8')](_0x49c4('0x9'),_0x69bc41,_0x2c4e2e['id'],_0x436234,_0x511d53,JSON[_0x49c4('0xa')](_0x11c586));io['to'](_0x436234)['emit'](_0x511d53,_0x11c586);}exports['exec']=function(_0x451ea6,_0x313e73,_0x58cad7,_0xb611a1){var _0x459d09,_0x4adb3c;var _0x536d42={};var _0x1d19bf=Number(_0x58cad7[_0x49c4('0xb')]);var _0x5487cd=_0x58cad7[_0x49c4('0xc')]?Boolean(Number(_0x58cad7[_0x49c4('0xc')])):![];var _0x5f2fd9;var _0x1909fe=![];if(!_[_0x49c4('0xd')](_0x58cad7[_0x49c4('0xe')])){if(_0x58cad7[_0x49c4('0xe')]=='1')_0x1909fe=!![];}if(!_0x1909fe){if(_0xb611a1[_0x49c4('0xf')]){_0x536d42['id']=_0xb611a1[_0x49c4('0xf')];}}if(!_0x536d42['id']){_0x536d42[_0x49c4('0x10')]=_0x1d19bf;_0x5f2fd9=_0x58cad7[_0x49c4('0x11')]&&_0x58cad7['data3']!=='0'?_0x58cad7[_0x49c4('0x11')][_0x49c4('0x12')](','):[_0x49c4('0x13')];_0x536d42[_0x49c4('0x14')]=_[_0x49c4('0x15')](_0x5f2fd9,function(_0x53e3a2){var _0x44e607={};_0x44e607[_0x53e3a2]=_0xb611a1[_0x49c4('0x16')]?_0xb611a1['destcalleridnum']:_0xb611a1['calleridnum'];return _0x44e607;});}var _0x3c782d=['id',_0x49c4('0x17'),_0x49c4('0x18'),'phone',_0x49c4('0x19'),'fax',_0x49c4('0x10'),_0x49c4('0x1a'),_0x49c4('0x1b'),_0x49c4('0x1c')];var _0x382040=_[_0x49c4('0x1d')](_0x3c782d,_0x5f2fd9);BPromise[_0x49c4('0x1e')]()[_0x49c4('0x1f')](cmContactRpc[_0x49c4('0x20')]({'attributes':_0x382040,'where':_0x536d42}))['then'](function(_0x527126){_0x4adb3c=_0x527126;if(!_['isEmpty'](_0x4adb3c)){if(_0x4adb3c[_0x49c4('0x21')]===0x1){_0x459d09=_0x4adb3c[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0xb611a1[_0x49c4('0x22')],_0x313e73['id'],_0x459d09['id']);}else{logger[_0x49c4('0x8')](_0x49c4('0x23'),_0xb611a1[_0x49c4('0x22')],_0x313e73['id'],_['map'](_0x4adb3c,'id')['join'](','));}return;}else{logger[_0x49c4('0x8')](_0x49c4('0x24'),_0xb611a1['uniqueid'],_0x313e73['id']);var _0x207358={'ListId':_0x1d19bf};var _0x43e014=_0x58cad7[_0x49c4('0x25')]&&_0x58cad7[_0x49c4('0x25')]!=='0'?_0x58cad7['data4']:'phone';if(_0x5487cd){logger[_0x49c4('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0xb611a1[_0x49c4('0x22')],_0x313e73['id']);_0x207358[_0x43e014]=_[_0x49c4('0xd')](_0xb611a1[_0x49c4('0x16')])?_0xb611a1[_0x49c4('0x26')]:_0xb611a1['destcalleridnum'];if(_[_0x49c4('0xd')](_0xb611a1[_0x49c4('0x16')])){_0x207358[_0x49c4('0x17')]=_0xb611a1[_0x49c4('0x27')]&&_0xb611a1[_0x49c4('0x27')]!==_0x49c4('0x28')?_0xb611a1[_0x49c4('0x27')]:_0x49c4('0x29');}else{_0x207358[_0x49c4('0x17')]=_0xb611a1[_0x49c4('0x2a')]&&_0xb611a1[_0x49c4('0x2a')]!==''?_0xb611a1['destcalleridname']:'Unknown';}return BPromise[_0x49c4('0x1e')]()[_0x49c4('0x1f')](cmContactRpc[_0x49c4('0x2b')](_0x207358))[_0x49c4('0x1f')](function(_0x28eb47){_0x459d09=_0x28eb47;_0x4adb3c['push'](_0x28eb47);if(_0x459d09){logger[_0x49c4('0x8')](_0x49c4('0x2c'),_0xb611a1[_0x49c4('0x22')],_0x313e73['id'],_0x459d09['id']);}return;});}else{logger[_0x49c4('0x8')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0xb611a1['uniqueid'],_0x313e73['id']);_0x207358[_0x43e014]=_[_0x49c4('0xd')](_0xb611a1[_0x49c4('0x16')])?_0xb611a1[_0x49c4('0x26')]:_0xb611a1[_0x49c4('0x2d')];if(_[_0x49c4('0xd')](_0xb611a1['routeId'])){_0x207358[_0x49c4('0x17')]=_0xb611a1[_0x49c4('0x27')]&&_0xb611a1[_0x49c4('0x27')]!==''?_0xb611a1['calleridname']:_0x49c4('0x29');}else{_0x207358[_0x49c4('0x17')]=_0xb611a1[_0x49c4('0x2a')]&&_0xb611a1[_0x49c4('0x2a')]!==_0x49c4('0x28')?_0xb611a1[_0x49c4('0x2a')]:_0x49c4('0x29');}_0x459d09=_0x207358;_0x4adb3c[_0x49c4('0x2e')](_0x207358);return;}}})[_0x49c4('0x1f')](function(){if(_0x451ea6){emit(_0xb611a1['uniqueid'],_0x313e73,util[_0x49c4('0x2f')]('user:%s',_0x451ea6[_0x49c4('0x30')]),util[_0x49c4('0x2f')](_0x49c4('0x31'),_0x58cad7[_0x49c4('0x32')]['toLowerCase']()),{'evt':_[_0x49c4('0x33')](_0xb611a1,{'autoCreate':_0x5487cd}),'contact':_0x459d09===undefined?{}:_0x459d09,'contacts':_0x4adb3c[_0x49c4('0x21')]===0x0?undefined:_0x4adb3c});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 5849e9e..42871d9 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 _0xda1e=['voiceQueues','templates','voiceExtensions','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshdeskAccounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','voice','checkTriggers','interface','hasOwnProperty','status','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','popup','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','uriLocation','data4','windowWidth','data5','data6','600','winApplication','name','format','trigger:%s:%s','user:%s','merge','trigger:%s','exec','accounts','queue','urlforward','script','parse','query','checkTrigger','channel','motionChannel','every','checkConditions','some','AnyConditions','field','account','chat','ChatWebsiteId','operator','value','AccountId','interaction','message','event','agent','membername','lastevent','routeId','null','substatus','offlineMessage','created','equals','exports','util','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','winapp','triggers','agents'];(function(_0x49fb69,_0x526fa1){var _0xf76cc3=function(_0x2d3253){while(--_0x2d3253){_0x49fb69['push'](_0x49fb69['shift']());}};_0xf76cc3(++_0x526fa1);}(_0xda1e,0xeb));var _0xeda1=function(_0x1966f3,_0x210ea3){_0x1966f3=_0x1966f3-0x0;var _0x17575f=_0xda1e[_0x1966f3];return _0x17575f;};'use strict';var util=require(_0xeda1('0x0'));var _=require('lodash');var url=require(_0xeda1('0x1'));var Mustache=require(_0xeda1('0x2'));var Redis=require(_0xeda1('0x3'));var urlforward=require(_0xeda1('0x4'));var integration=require(_0xeda1('0x5'));var cmContact=require(_0xeda1('0x6'));var script=require(_0xeda1('0x7'));var config=require(_0xeda1('0x8'));var logger=require(_0xeda1('0x9'))('trigger');var ami=require(_0xeda1('0xa'));config[_0xeda1('0xb')]=_[_0xeda1('0xc')](config[_0xeda1('0xb')],{'host':_0xeda1('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var operators={'equals':function(_0x546115,_0x124267){return _0x546115==_0x124267;},'not_equals':function(_0x129da9,_0x1f6708){return _0x129da9!=_0x1f6708;}};var barAndWebActions=['popup',_0xeda1('0x1'),_0xeda1('0xe')];function Trigger(_0x1161e6){this[_0xeda1('0xf')]=_0x1161e6[_0xeda1('0xf')];this[_0xeda1('0x10')]=_0x1161e6['agents'];this['voiceQueues']=_0x1161e6[_0xeda1('0x11')];this[_0xeda1('0x12')]=_0x1161e6[_0xeda1('0x12')];this[_0xeda1('0x13')]=_0x1161e6['voiceExtensions'];this['zendeskAccounts']=_0x1161e6[_0xeda1('0x14')];this['freshdeskAccounts']=_0x1161e6['freshdeskAccounts'];this[_0xeda1('0x15')]=_0x1161e6[_0xeda1('0x15')];this[_0xeda1('0x16')]=_0x1161e6[_0xeda1('0x16')];this['zohoAccounts']=_0x1161e6[_0xeda1('0x17')];this[_0xeda1('0x18')]=_0x1161e6[_0xeda1('0x18')];this[_0xeda1('0x19')]=_0x1161e6[_0xeda1('0x19')];this[_0xeda1('0x1a')]=_0x1161e6[_0xeda1('0x1a')];this[_0xeda1('0x1b')]=_0x1161e6[_0xeda1('0x1b')];this['freshsalesAccounts']=_0x1161e6['freshsalesAccounts'];this['accounts']={'zendesk':this[_0xeda1('0x14')],'salesforce':this[_0xeda1('0x15')],'freshdesk':this[_0xeda1('0x1c')],'sugarcrm':this[_0xeda1('0x16')],'zoho':this[_0xeda1('0x17')],'desk':this[_0xeda1('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xeda1('0x1d')],'servicenow':this[_0xeda1('0x1a')]};ami['on'](_0xeda1('0x1e'),this[_0xeda1('0x1f')][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x21'),this[_0xeda1('0x1f')]['bind'](this));ami['on'](_0xeda1('0x22'),this['syncCustomEvent'][_0xeda1('0x20')](this));ami['on']('custom:agentcomplete',this[_0xeda1('0x1f')]['bind'](this));ami['on']('custom:agentnosuchnumber',this['syncCustomEvent'][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x23'),this[_0xeda1('0x1f')][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x24'),this[_0xeda1('0x1f')][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x25'),this[_0xeda1('0x1f')]['bind'](this));ami['on']('custom:agentreject',this[_0xeda1('0x1f')]['bind'](this));ami['on'](_0xeda1('0x26'),this[_0xeda1('0x1f')][_0xeda1('0x20')](this));ami['on']('custom:queuecallerabandon',this[_0xeda1('0x1f')][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x27'),this[_0xeda1('0x1f')][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x28'),this['syncAgentDial']['bind'](this));ami['on'](_0xeda1('0x29'),this[_0xeda1('0x2a')][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x2b'),this[_0xeda1('0x2a')][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x2c'),this[_0xeda1('0x1f')][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x2d'),this['syncCustomEvent']['bind'](this));ami['on'](_0xeda1('0x2e'),this[_0xeda1('0x1f')][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x2f'),this[_0xeda1('0x1f')][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x30'),this[_0xeda1('0x1f')][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x31'),this['syncCustomEvent'][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x32'),this[_0xeda1('0x1f')][_0xeda1('0x20')](this));ami['on'](_0xeda1('0x33'),this[_0xeda1('0x1f')]['bind'](this));}Trigger[_0xeda1('0x34')][_0xeda1('0x35')]=function(_0xd73e3,_0x3630f2,_0x1ffcbe){logger[_0xeda1('0x36')](_0xd73e3,_0x3630f2,JSON[_0xeda1('0x37')](_0x1ffcbe));io['to'](_0xd73e3)['emit'](_0x3630f2,_0x1ffcbe);};Trigger[_0xeda1('0x34')][_0xeda1('0x1f')]=function(_0x8e5d4f){var _0x3b9413=_['clone'](_0x8e5d4f);if(typeof _0x3b9413['motionChannel']==='undefined'){_0x3b9413['motionChannel']=_0xeda1('0x38');}this[_0xeda1('0x39')](_0x3b9413);};Trigger[_0xeda1('0x34')][_0xeda1('0x2a')]=function(_0x48fa8b){if(this[_0xeda1('0x10')][_0x48fa8b[_0xeda1('0x3a')]]){this['syncCustomEvent'](_0x48fa8b);}};Trigger[_0xeda1('0x34')][_0xeda1('0x39')]=function(_0x24583c){var _0x556867;for(var _0x513fb4 in this[_0xeda1('0xf')]){if(this[_0xeda1('0xf')][_0xeda1('0x3b')](_0x513fb4)){if(this[_0xeda1('0xf')][_0x513fb4][_0xeda1('0x3c')]){_0x556867=this['checkTrigger'](this[_0xeda1('0xf')][_0x513fb4],_0x24583c);if(_0x556867){_['merge'](_0x24583c,_0x24583c['variables']);for(var _0x162841=0x0,_0x44f2db,_0x326f8c,_0x5859e7;_0x1628410x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','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','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x55b5de,_0x31eb84){var _0x4c6377=function(_0xcadced){while(--_0xcadced){_0x55b5de['push'](_0x55b5de['shift']());}};_0x4c6377(++_0x31eb84);}(_0x814b,0x1a2));var _0xb814=function(_0x158e3b,_0x4534b){_0x158e3b=_0x158e3b-0x0;var _0x551a1d=_0x814b[_0x158e3b];return _0x551a1d;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ 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 309d99f..fd8e641 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 _0xa0db=[']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','util','./util','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','tenantId','CloudProvider','data2','resolve','data5','POST','clientId','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','info','toUpperCase',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','outbound','calleridnum','contacts','/systemusers(','substring','lastIndexOf','enduserId','destcalleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','nothing',']\x20Enduser\x20created!','forEach','string','type','nameField','customField','idField','toLowerCase','indexOf','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','callDirection','queue','phonecalls','Subjects','headers','odata-entityid','ticketId','format','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','data7','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!'];(function(_0x2e4082,_0x599105){var _0x3f82f1=function(_0x5f3029){while(--_0x5f3029){_0x2e4082['push'](_0x2e4082['shift']());}};_0x3f82f1(++_0x599105);}(_0xa0db,0x1a1));var _0xba0d=function(_0x183823,_0x322610){_0x183823=_0x183823-0x0;var _0x566bd1=_0xa0db[_0x183823];return _0x566bd1;};'use strict';var _=require(_0xba0d('0x0'));var rp=require(_0xba0d('0x1'));var util=require(_0xba0d('0x2'));var intUtil=require(_0xba0d('0x3'));var md5=require('md5');var Redis=require('ioredis');var logger=require(_0xba0d('0x4'))(_0xba0d('0x5'));var config=require(_0xba0d('0x6'));config['redis']=_[_0xba0d('0x7')](config[_0xba0d('0x8')],{'host':_0xba0d('0x9'),'port':0x18eb});var io=require(_0xba0d('0xa'))(new Redis(config[_0xba0d('0x8')]));function getAuthToken(_0x3769a6,_0x51be4e,_0x1976f2){if(_0x3769a6[_0xba0d('0xb')]){_0x3769a6[_0xba0d('0xc')]=_0x3769a6['CloudProvider']['data7'];_0x3769a6[_0xba0d('0xd')]=_0x3769a6[_0xba0d('0xe')][_0xba0d('0xf')];return Promise[_0xba0d('0x10')](_0x3769a6['CloudProvider'][_0xba0d('0x11')]);}var _0x5ebf18={'method':_0xba0d('0x12'),'uri':_0x51be4e,'form':{'client_id':_0x3769a6[_0xba0d('0x13')],'resource':_0x3769a6[_0xba0d('0xc')],'username':_0x3769a6[_0xba0d('0x14')],'password':_0x3769a6['password'],'grant_type':_0xba0d('0x15'),'client_secret':_0x3769a6[_0xba0d('0x16')]},'json':!![]};return rp(_0x5ebf18)[_0xba0d('0x17')](function(_0x4c5ce0){return _0x4c5ce0[_0xba0d('0x18')];})[_0xba0d('0x19')](function(_0x1eceb3){logger[_0xba0d('0x1a')]('['+[_0x1976f2['toUpperCase']()]+_0xba0d('0x1b'));return _0x1eceb3[_0xba0d('0x1c')];});}function getUser(_0x5b7bca,_0xdc3b13,_0x58263f,_0x1863c2,_0x385716,_0x4a3a86){return new Promise(function(_0x49f2c7,_0x2d26b4){return getAuthToken(_0xdc3b13,_0x1863c2,_0x4a3a86)['then'](function(_0x3ffddf){var _0x3212e4={'method':_0xba0d('0x1d'),'uri':_0x385716+_0xba0d('0x1e'),'headers':{'Authorization':_0xba0d('0x1f')+_0x3ffddf,'OData-Version':_0xba0d('0x20')},'json':!![]};return rp(_0x3212e4);})[_0xba0d('0x17')](function(_0xf96c20){var _0x70ec2b=_0xf96c20[_0xba0d('0x21')];var _0x574e59=![];var _0x34d4ad=null;if(!_[_0xba0d('0x22')](_0x58263f)){if(intUtil[_0xba0d('0x23')](_0x58263f[_0xba0d('0x24')])){_0x5b7bca[_0xba0d('0x25')]=_0x58263f['email'];for(_0x34d4ad=0x0;_0x34d4ad<_0x70ec2b[_0xba0d('0x26')];_0x34d4ad++){if(_0x70ec2b[_0x34d4ad][_0xba0d('0x27')]===_0x58263f[_0xba0d('0x24')]&&!_0x70ec2b[_0x34d4ad]['isdisabled']){_0x574e59=!![];logger[_0xba0d('0x28')]('['+[_0x4a3a86[_0xba0d('0x29')]()]+_0xba0d('0x2a')+_0x70ec2b[_0x34d4ad]['systemuserid']+'!');_0x5b7bca[_0xba0d('0x2b')]=_0x70ec2b[_0x34d4ad][_0xba0d('0x2c')];}}}}if(!_0x574e59){logger[_0xba0d('0x28')]('['+[_0x4a3a86[_0xba0d('0x29')]()]+_0xba0d('0x2d'));_0x5b7bca[_0xba0d('0x25')]=_0xdc3b13[_0xba0d('0x14')];for(_0x34d4ad=0x0;_0x34d4ad<_0x70ec2b[_0xba0d('0x26')];_0x34d4ad++){if(_0x70ec2b[_0x34d4ad][_0xba0d('0x27')]===_0xdc3b13[_0xba0d('0x14')]){_0x5b7bca[_0xba0d('0x2b')]=_0x70ec2b[_0x34d4ad][_0xba0d('0x2c')];}}}_0x49f2c7(_0x5b7bca);})[_0xba0d('0x19')](function(_0x189817){_0x2d26b4(_0x189817[_0xba0d('0x1c')]);});});}function createEndUser(_0x356e5a,_0x247968,_0x24159c,_0x515030,_0x517335,_0x53bf86){return new Promise(function(_0x2ac24b,_0x162d5e){return getAuthToken(_0x247968,_0x24159c,_0x53bf86)[_0xba0d('0x17')](function(_0x5728e2){var _0x4a596a=_0x53bf86['toLowerCase']()===_0xba0d('0x2e')?_0x517335['destcalleridnum']:_0x517335[_0xba0d('0x2f')];var _0x57a14d={'method':_0xba0d('0x12'),'uri':_0x515030+_0xba0d('0x30'),'body':{'telephone1':_0x4a596a,'fullname':_0x4a596a,'firstname':_0x4a596a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xba0d('0x31')+_0x356e5a[_0xba0d('0x2b')]+')'},'headers':{'Authorization':_0xba0d('0x1f')+_0x5728e2,'OData-Version':_0xba0d('0x20')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x57a14d);})[_0xba0d('0x17')](function(_0x2b4e72){var _0x36a418=_0x2b4e72['headers']['odata-entityid'];var _0x3641b6=_0x36a418[_0xba0d('0x32')](_0x36a418[_0xba0d('0x33')]('(')+0x1,_0x36a418[_0xba0d('0x33')](')'));_0x356e5a[_0xba0d('0x34')]=_0x3641b6;_0x2ac24b(_0x356e5a);})[_0xba0d('0x19')](function(_0x191fee){_0x162d5e(_0x191fee[_0xba0d('0x1c')]);});});}function getEndUser(_0x33428f,_0xa1c733,_0xf97ddb,_0x251a03,_0x492a93,_0x24ed41,_0x4ec46c){var _0x413ed1=_0x24ed41['toLowerCase']()===_0xba0d('0x2e')?_0x492a93[_0xba0d('0x35')]:_0x492a93[_0xba0d('0x2f')];return getAuthToken(_0xa1c733,_0xf97ddb,_0x24ed41)[_0xba0d('0x17')](function(_0x31cad3){var _0x2a7918={'method':_0xba0d('0x1d'),'uri':_0x251a03+_0xba0d('0x36')+_0x413ed1[_0xba0d('0x37')]('+',_0xba0d('0x38'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x31cad3,'If-None-Match':null,'OData-Version':_0xba0d('0x20')},'json':!![]};return rp(_0x2a7918);})['then'](function(_0x4453ac){var _0x597d80=![];if(!_0x4453ac)return _0x597d80;var _0x4ac081=_0x4453ac[_0xba0d('0x21')];for(var _0x578410=0x0;_0x578410<_0x4ac081['length'];_0x578410++){if(_0x4ac081[_0x578410]['telephone1']===_0x413ed1){_0x597d80=!![];_0x33428f[_0xba0d('0x34')]=_0x4ac081[_0x578410]['contactid'];}}return _0x597d80;})[_0xba0d('0x17')](function(_0x4aec4d){if(_0x4aec4d)return _0x33428f;if(_0x4ec46c===_0xba0d('0x39')){logger[_0xba0d('0x28')]('['+[_0x24ed41['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x33428f;}return createEndUser(_0x33428f,_0xa1c733,_0xf97ddb,_0x251a03,_0x492a93,_0x24ed41)['then'](function(_0x59d2a3){logger[_0xba0d('0x28')]('['+[_0x24ed41[_0xba0d('0x29')]()]+_0xba0d('0x3a'),_0x59d2a3[_0xba0d('0x34')]);return _0x59d2a3;});});}function getCustomFields(_0x122251,_0x75668d,_0x529a34){var _0x1e4122={};if(_0x122251[_0xba0d('0x26')]>0x0){_[_0xba0d('0x3b')](_0x122251,function(_0x3b7ac7){if(_['includes']([_0xba0d('0x3c'),'picklist'],_0x3b7ac7[_0xba0d('0x3d')])&&_0x3b7ac7[_0xba0d('0x3e')]&&!_0x3b7ac7[_0xba0d('0x3f')]){var _0x250bf8=_0x3b7ac7[_0xba0d('0x40')][_0xba0d('0x41')]();var _0xa2da59=_0x250bf8[_0xba0d('0x32')](0x0,_0x250bf8[_0xba0d('0x42')]('_'));var _0x2c9fa4=_0x250bf8['substring'](_0x250bf8[_0xba0d('0x42')]('_')+0x1);if(_0xa2da59===_0x529a34){_0x1e4122[_0x2c9fa4]=_0x3b7ac7['content'];}}});}return _0x1e4122;}function getTicket(_0x13f77d,_0x157d44,_0x5c4ad5,_0x3deeb4,_0x1933f8,_0x4d3f70,_0x7867c6){return new Promise(function(_0x42e20a,_0x24b2ff){var _0x48cbd8;return getAuthToken(_0x157d44,_0x5c4ad5,_0x7867c6)[_0xba0d('0x17')](function(_0x370adc){if(_0x4d3f70[_0xba0d('0x43')]===_0xba0d('0x44')){_0x48cbd8={'method':'POST','uri':_0x3deeb4+_0xba0d('0x45'),'body':Object[_0xba0d('0x46')]({},{'title':intUtil[_0xba0d('0x47')](_0x4d3f70['Subjects'],_0x1933f8,'\x20'),'description':intUtil[_0xba0d('0x47')](_0x4d3f70[_0xba0d('0x48')],_0x1933f8,'\x0a'),'customerid_contact@odata.bind':_0x13f77d[_0xba0d('0x34')]?_0xba0d('0x49')+_0x13f77d[_0xba0d('0x34')]+')':undefined,'ownerid@odata.bind':_0xba0d('0x31')+_0x13f77d['userId']+')','caseorigincode':'1'},getCustomFields(_0x4d3f70[_0xba0d('0x4a')],_0x1933f8,_0x4d3f70[_0xba0d('0x43')])),'headers':{'Authorization':_0xba0d('0x1f')+_0x370adc,'OData-Version':_0xba0d('0x20')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4d3f70[_0xba0d('0x43')]==='phonecall'){var _0x534c9f=_0x13f77d[_0xba0d('0x34')]?[{'partyid_systemuser@odata.bind':_0xba0d('0x31')+_0x13f77d[_0xba0d('0x2b')]+')','participationtypemask':_0x13f77d[_0xba0d('0x4b')]===_0xba0d('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0xba0d('0x49')+_0x13f77d[_0xba0d('0x34')]+')','participationtypemask':_0x13f77d[_0xba0d('0x4b')]===_0xba0d('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xba0d('0x31')+_0x13f77d['userId']+')','participationtypemask':_0x13f77d[_0xba0d('0x4b')]===_0xba0d('0x4c')?0x2:0x1}];_0x48cbd8={'method':_0xba0d('0x12'),'uri':_0x3deeb4+_0xba0d('0x4d'),'body':Object['assign']({},{'subject':intUtil[_0xba0d('0x47')](_0x4d3f70[_0xba0d('0x4e')],_0x1933f8,'\x20'),'phonenumber':String(_0x1933f8['calleridnum']),'description':intUtil[_0xba0d('0x47')](_0x4d3f70[_0xba0d('0x48')],_0x1933f8,'\x0a'),'regardingobjectid_contact@odata.bind':_0x13f77d[_0xba0d('0x34')]?_0xba0d('0x49')+_0x13f77d[_0xba0d('0x34')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x13f77d['userId']+')','directioncode':_0x13f77d['callDirection']===_0xba0d('0x4c')?![]:!![],'phonecall_activity_parties':_0x534c9f},getCustomFields(_0x4d3f70[_0xba0d('0x4a')],_0x1933f8,_0x4d3f70[_0xba0d('0x43')])),'headers':{'Authorization':_0xba0d('0x1f')+_0x370adc,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x48cbd8);})[_0xba0d('0x17')](function(_0x37e838){var _0x382e74=_0x37e838[_0xba0d('0x4f')][_0xba0d('0x50')];var _0x1dbaa2=_0x382e74[_0xba0d('0x32')](_0x382e74[_0xba0d('0x33')]('(')+0x1,_0x382e74[_0xba0d('0x33')](')'));_0x13f77d[_0xba0d('0x51')]=_0x1dbaa2;_0x42e20a(_0x13f77d);})[_0xba0d('0x19')](function(_0x39c918){_0x24b2ff(_0x39c918[_0xba0d('0x1c')]);});});}function emit(_0x333eeb,_0x45c17c,_0x545811,_0x580d98){var _0x158118={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x333eeb,_0x545811,_0x580d98)};io['to'](util[_0xba0d('0x52')]('user:%s',_0x45c17c))[_0xba0d('0x53')](_0xba0d('0x54'),_0x158118);}exports['cs']=function(_0x216aa7,_0x6602f,_0xfc119d,_0x1d5cce,_0x17f860,_0x5ee3ba,_0x8e230c,_0x1a48b8){var _0x3c570e={};_0x5ee3ba['remoteUri']=_0x5ee3ba[_0xba0d('0xb')]?intUtil[_0xba0d('0x55')](_0x5ee3ba[_0xba0d('0xe')]['data7']):intUtil[_0xba0d('0x55')](_0x5ee3ba[_0xba0d('0xc')]);_0x5ee3ba[_0xba0d('0x56')]=intUtil[_0xba0d('0x55')](_0x5ee3ba[_0xba0d('0x56')]);_0x3c570e[_0xba0d('0x4b')]=_0x1a48b8===_0xba0d('0x4c')||_0x1a48b8===_0xba0d('0x57')?_0xba0d('0x4c'):_0xba0d('0x2e');var _0x35723b=_0x5ee3ba[_0xba0d('0xb')]?util[_0xba0d('0x52')](_0xba0d('0x58'),_0x5ee3ba[_0xba0d('0xe')][_0xba0d('0x59')]):util[_0xba0d('0x52')](_0xba0d('0x58'),_0x5ee3ba[_0xba0d('0xc')]);var _0x4a619a=util[_0xba0d('0x52')]('https://login.microsoftonline.com/%s/oauth2/token',_0x5ee3ba[_0xba0d('0xd')]);var _0x5c26dc=util[_0xba0d('0x52')](_0xba0d('0x5a'),_0x5ee3ba[_0xba0d('0x56')],_0x6602f[_0xba0d('0x5b')],md5(_0x6602f[_0xba0d('0x5b')]));if(_0x17f860&&_0x17f860[_0xba0d('0x5c')]){logger[_0xba0d('0x28')]('[QUEUE]','Recording\x20is\x20enabled!');_0x6602f[_0xba0d('0x5d')]=_0x5c26dc;}else if(_0x8e230c&&_0x8e230c[_0xba0d('0x5e')]&&_0x8e230c[_0xba0d('0x5e')]!==_0xba0d('0x5f')){logger['info'](_0xba0d('0x60'),_0xba0d('0x61'));_0x6602f[_0xba0d('0x5d')]=_0x5c26dc;}else{_0x6602f[_0xba0d('0x5d')]='';}return getUser(_0x3c570e,_0x5ee3ba,_0x1d5cce,_0x4a619a,_0x35723b,_0x1a48b8)[_0xba0d('0x17')](function(_0x26ef4b){logger[_0xba0d('0x28')]('['+_0x1a48b8['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x26ef4b['userId']);logger[_0xba0d('0x28')]('['+_0x1a48b8[_0xba0d('0x29')]()+_0xba0d('0x62'),_0x26ef4b[_0xba0d('0x25')]);return getEndUser(_0x26ef4b,_0x5ee3ba,_0x4a619a,_0x35723b,_0x6602f,_0x1a48b8,_0xfc119d[_0xba0d('0x63')]);})[_0xba0d('0x17')](function(_0x212d77){logger['info']('['+_0x1a48b8[_0xba0d('0x29')]()+_0xba0d('0x64'),_0x212d77[_0xba0d('0x34')]);logger[_0xba0d('0x28')]('['+_0x1a48b8[_0xba0d('0x29')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x6602f[_0xba0d('0x2f')]);return getTicket(_0x212d77,_0x5ee3ba,_0x4a619a,_0x35723b,_0x6602f,_0xfc119d,_0x1a48b8);})[_0xba0d('0x17')](function(_0x49755d){logger['info'](util[_0xba0d('0x52')]('['+_0x1a48b8[_0xba0d('0x29')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0xfc119d[_0xba0d('0x43')],_0x49755d[_0xba0d('0x51')]));logger[_0xba0d('0x28')](util[_0xba0d('0x52')]('['+_0x1a48b8[_0xba0d('0x29')]()+']\x20Call\x20direction:\x20%s',_0x1a48b8));if(_0x1a48b8!=='unmanaged'){logger[_0xba0d('0x28')]('['+_0x1a48b8['toUpperCase']()+']',_0xba0d('0x65'));emit(_0x5ee3ba[_0xba0d('0xc')],_0x1d5cce[_0xba0d('0x66')],_0xfc119d[_0xba0d('0x43')],_0x49755d['ticketId']);}})[_0xba0d('0x19')](function(_0x3ac343){logger[_0xba0d('0x1a')]('['+_0x1a48b8[_0xba0d('0x29')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x3ac343[_0xba0d('0x1c')]);});}; \ No newline at end of file +var _0x7072=['odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','telephone1','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','ticketType','assign','getString','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','Subjects','format','emit','trigger:browser:url','stripTrailingSlash','unmanaged','outbound','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','then','access_token','catch','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','systemuserid','destcalleridnum','calleridnum','contacts','/systemusers(','4.0','headers'];(function(_0x2d3ab3,_0x47d90b){var _0x321f9e=function(_0x50a53d){while(--_0x50a53d){_0x2d3ab3['push'](_0x2d3ab3['shift']());}};_0x321f9e(++_0x47d90b);}(_0x7072,0x1e7));var _0x2707=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x7072[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0x2707('0x0'));var rp=require(_0x2707('0x1'));var util=require(_0x2707('0x2'));var intUtil=require(_0x2707('0x3'));var md5=require(_0x2707('0x4'));var Redis=require(_0x2707('0x5'));var logger=require(_0x2707('0x6'))(_0x2707('0x7'));var config=require(_0x2707('0x8'));config[_0x2707('0x9')]=_[_0x2707('0xa')](config['redis'],{'host':_0x2707('0xb'),'port':0x18eb});var io=require(_0x2707('0xc'))(new Redis(config[_0x2707('0x9')]));function getAuthToken(_0xd00934,_0x45da2f,_0x12f7ef){if(_0xd00934[_0x2707('0xd')]){_0xd00934[_0x2707('0xe')]=_0xd00934[_0x2707('0xf')][_0x2707('0x10')];_0xd00934[_0x2707('0x11')]=_0xd00934[_0x2707('0xf')][_0x2707('0x12')];return Promise[_0x2707('0x13')](_0xd00934[_0x2707('0xf')][_0x2707('0x14')]);}var _0x23d954={'method':_0x2707('0x15'),'uri':_0x45da2f,'form':{'client_id':_0xd00934[_0x2707('0x16')],'resource':_0xd00934['remoteUri'],'username':_0xd00934[_0x2707('0x17')],'password':_0xd00934[_0x2707('0x18')],'grant_type':_0x2707('0x18'),'client_secret':_0xd00934['clientSecret']},'json':!![]};return rp(_0x23d954)[_0x2707('0x19')](function(_0xbb7f5f){return _0xbb7f5f[_0x2707('0x1a')];})[_0x2707('0x1b')](function(_0x5caeb4){logger[_0x2707('0x1c')]('['+[_0x12f7ef[_0x2707('0x1d')]()]+']\x20Wrong\x20credentials!');return _0x5caeb4[_0x2707('0x1e')];});}function getUser(_0xfbc2ca,_0x28fa3f,_0x22d3a8,_0x8fb988,_0x350d79,_0x2e925e){return new Promise(function(_0x38ec74,_0x1c19ab){return getAuthToken(_0x28fa3f,_0x8fb988,_0x2e925e)[_0x2707('0x19')](function(_0xd6b27a){var _0x18fffd={'method':_0x2707('0x1f'),'uri':_0x350d79+_0x2707('0x20'),'headers':{'Authorization':_0x2707('0x21')+_0xd6b27a,'OData-Version':'4.0'},'json':!![]};return rp(_0x18fffd);})[_0x2707('0x19')](function(_0x15dc9a){var _0x227355=_0x15dc9a[_0x2707('0x22')];var _0x53beb4=![];var _0x4c4590=null;if(!_[_0x2707('0x23')](_0x22d3a8)){if(intUtil[_0x2707('0x24')](_0x22d3a8[_0x2707('0x25')])){_0xfbc2ca[_0x2707('0x26')]=_0x22d3a8[_0x2707('0x25')];for(_0x4c4590=0x0;_0x4c4590<_0x227355['length'];_0x4c4590++){if(_0x227355[_0x4c4590][_0x2707('0x27')]===_0x22d3a8['email']&&!_0x227355[_0x4c4590][_0x2707('0x28')]){_0x53beb4=!![];logger[_0x2707('0x29')]('['+[_0x2e925e[_0x2707('0x1d')]()]+_0x2707('0x2a')+_0x227355[_0x4c4590]['systemuserid']+'!');_0xfbc2ca[_0x2707('0x2b')]=_0x227355[_0x4c4590]['systemuserid'];}}}}if(!_0x53beb4){logger[_0x2707('0x29')]('['+[_0x2e925e[_0x2707('0x1d')]()]+_0x2707('0x2c'));_0xfbc2ca[_0x2707('0x26')]=_0x28fa3f[_0x2707('0x17')];for(_0x4c4590=0x0;_0x4c4590<_0x227355[_0x2707('0x2d')];_0x4c4590++){if(_0x227355[_0x4c4590][_0x2707('0x27')]===_0x28fa3f[_0x2707('0x17')]){_0xfbc2ca[_0x2707('0x2b')]=_0x227355[_0x4c4590][_0x2707('0x2e')];}}}_0x38ec74(_0xfbc2ca);})['catch'](function(_0x5386da){_0x1c19ab(_0x5386da[_0x2707('0x1e')]);});});}function createEndUser(_0x2318c9,_0x176404,_0x2c8014,_0x2b63a0,_0x1c69eb,_0x2645cc){return new Promise(function(_0x444ab2,_0x1f0110){return getAuthToken(_0x176404,_0x2c8014,_0x2645cc)['then'](function(_0x51de14){var _0x3826eb=_0x2645cc['toLowerCase']()==='outbound'?_0x1c69eb[_0x2707('0x2f')]:_0x1c69eb[_0x2707('0x30')];var _0x2f3c68={'method':_0x2707('0x15'),'uri':_0x2b63a0+_0x2707('0x31'),'body':{'telephone1':_0x3826eb,'fullname':_0x3826eb,'firstname':_0x3826eb,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2707('0x32')+_0x2318c9['userId']+')'},'headers':{'Authorization':_0x2707('0x21')+_0x51de14,'OData-Version':_0x2707('0x33')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2f3c68);})[_0x2707('0x19')](function(_0x4ffbb2){var _0x3b3d1e=_0x4ffbb2[_0x2707('0x34')][_0x2707('0x35')];var _0x2272e2=_0x3b3d1e[_0x2707('0x36')](_0x3b3d1e[_0x2707('0x37')]('(')+0x1,_0x3b3d1e[_0x2707('0x37')](')'));_0x2318c9[_0x2707('0x38')]=_0x2272e2;_0x444ab2(_0x2318c9);})[_0x2707('0x1b')](function(_0x12d0bc){_0x1f0110(_0x12d0bc[_0x2707('0x1e')]);});});}function getEndUser(_0x1610cd,_0x325a35,_0x48010a,_0x273382,_0x3a8a1b,_0x343c0d,_0x4a9aad){var _0x5e2e7b=_0x343c0d[_0x2707('0x39')]()==='outbound'?_0x3a8a1b[_0x2707('0x2f')]:_0x3a8a1b[_0x2707('0x30')];return getAuthToken(_0x325a35,_0x48010a,_0x343c0d)[_0x2707('0x19')](function(_0x51114e){var _0x415e35={'method':'GET','uri':_0x273382+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x5e2e7b['replace']('+','%2b')+'\x27','headers':{'Authorization':_0x2707('0x21')+_0x51114e,'If-None-Match':null,'OData-Version':_0x2707('0x33')},'json':!![]};return rp(_0x415e35);})[_0x2707('0x19')](function(_0x2bd644){var _0x3713e8=![];if(!_0x2bd644)return _0x3713e8;var _0x5a6e8a=_0x2bd644[_0x2707('0x22')];for(var _0x22bea1=0x0;_0x22bea1<_0x5a6e8a[_0x2707('0x2d')];_0x22bea1++){if(_0x5a6e8a[_0x22bea1][_0x2707('0x3a')]===_0x5e2e7b){_0x3713e8=!![];_0x1610cd[_0x2707('0x38')]=_0x5a6e8a[_0x22bea1][_0x2707('0x3b')];}}return _0x3713e8;})[_0x2707('0x19')](function(_0x21012c){if(_0x21012c)return _0x1610cd;if(_0x4a9aad==='nothing'){logger['info']('['+[_0x343c0d[_0x2707('0x1d')]()]+_0x2707('0x3c'));return _0x1610cd;}return createEndUser(_0x1610cd,_0x325a35,_0x48010a,_0x273382,_0x3a8a1b,_0x343c0d)[_0x2707('0x19')](function(_0x1ca540){logger[_0x2707('0x29')]('['+[_0x343c0d[_0x2707('0x1d')]()]+_0x2707('0x3d'),_0x1ca540[_0x2707('0x38')]);return _0x1ca540;});});}function getCustomFields(_0x439d1c,_0x1e36ca,_0x2a1b8a){var _0x17d48d={};if(_0x439d1c[_0x2707('0x2d')]>0x0){_[_0x2707('0x3e')](_0x439d1c,function(_0x432bf0){if(_[_0x2707('0x3f')]([_0x2707('0x40'),_0x2707('0x41')],_0x432bf0[_0x2707('0x42')])&&_0x432bf0[_0x2707('0x43')]&&!_0x432bf0[_0x2707('0x44')]){var _0x3b4d53=_0x432bf0[_0x2707('0x45')][_0x2707('0x39')]();var _0x5a078b=_0x3b4d53[_0x2707('0x36')](0x0,_0x3b4d53[_0x2707('0x46')]('_'));var _0x232400=_0x3b4d53[_0x2707('0x36')](_0x3b4d53[_0x2707('0x46')]('_')+0x1);if(_0x5a078b===_0x2a1b8a){_0x17d48d[_0x232400]=_0x432bf0['content'];}}});}return _0x17d48d;}function getTicket(_0x3c0225,_0x23876a,_0x30b85b,_0x430771,_0x494c3e,_0x4a8d34,_0x47ba36){return new Promise(function(_0x5e1512,_0x93b00f){var _0x536f6b;return getAuthToken(_0x23876a,_0x30b85b,_0x47ba36)['then'](function(_0x2325db){if(_0x4a8d34[_0x2707('0x47')]==='incident'){_0x536f6b={'method':'POST','uri':_0x430771+'incidents','body':Object[_0x2707('0x48')]({},{'title':intUtil[_0x2707('0x49')](_0x4a8d34['Subjects'],_0x494c3e,'\x20'),'description':intUtil[_0x2707('0x49')](_0x4a8d34[_0x2707('0x4a')],_0x494c3e,'\x0a'),'customerid_contact@odata.bind':_0x3c0225[_0x2707('0x38')]?_0x2707('0x4b')+_0x3c0225['enduserId']+')':undefined,'ownerid@odata.bind':_0x2707('0x32')+_0x3c0225[_0x2707('0x2b')]+')','caseorigincode':'1'},getCustomFields(_0x4a8d34[_0x2707('0x4c')],_0x494c3e,_0x4a8d34[_0x2707('0x47')])),'headers':{'Authorization':'Bearer\x20'+_0x2325db,'OData-Version':_0x2707('0x33')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4a8d34['ticketType']===_0x2707('0x4d')){var _0x2a1f50=_0x3c0225['enduserId']?[{'partyid_systemuser@odata.bind':_0x2707('0x32')+_0x3c0225[_0x2707('0x2b')]+')','participationtypemask':_0x3c0225[_0x2707('0x4e')]===_0x2707('0x4f')?0x2:0x1},{'partyid_contact@odata.bind':_0x2707('0x4b')+_0x3c0225[_0x2707('0x38')]+')','participationtypemask':_0x3c0225['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x3c0225[_0x2707('0x2b')]+')','participationtypemask':_0x3c0225['callDirection']===_0x2707('0x4f')?0x2:0x1}];_0x536f6b={'method':_0x2707('0x15'),'uri':_0x430771+_0x2707('0x50'),'body':Object[_0x2707('0x48')]({},{'subject':intUtil[_0x2707('0x49')](_0x4a8d34[_0x2707('0x51')],_0x494c3e,'\x20'),'phonenumber':String(_0x494c3e[_0x2707('0x30')]),'description':intUtil['getString'](_0x4a8d34['Descriptions'],_0x494c3e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3c0225[_0x2707('0x38')]?_0x2707('0x4b')+_0x3c0225[_0x2707('0x38')]+')':undefined,'ownerid@odata.bind':_0x2707('0x32')+_0x3c0225[_0x2707('0x2b')]+')','directioncode':_0x3c0225[_0x2707('0x4e')]===_0x2707('0x4f')?![]:!![],'phonecall_activity_parties':_0x2a1f50},getCustomFields(_0x4a8d34[_0x2707('0x4c')],_0x494c3e,_0x4a8d34[_0x2707('0x47')])),'headers':{'Authorization':_0x2707('0x21')+_0x2325db,'OData-Version':_0x2707('0x33')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x536f6b);})[_0x2707('0x19')](function(_0x1bce41){var _0x409a85=_0x1bce41['headers']['odata-entityid'];var _0x157c20=_0x409a85[_0x2707('0x36')](_0x409a85['lastIndexOf']('(')+0x1,_0x409a85[_0x2707('0x37')](')'));_0x3c0225['ticketId']=_0x157c20;_0x5e1512(_0x3c0225);})[_0x2707('0x1b')](function(_0x1909b2){_0x93b00f(_0x1909b2[_0x2707('0x1e')]);});});}function emit(_0x504366,_0x234a94,_0x26e5ec,_0x1fa643){var _0x32782d={'uri':util[_0x2707('0x52')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x504366,_0x26e5ec,_0x1fa643)};io['to'](util[_0x2707('0x52')]('user:%s',_0x234a94))[_0x2707('0x53')](_0x2707('0x54'),_0x32782d);}exports['cs']=function(_0x23fb1f,_0x553a45,_0x5d0645,_0x278037,_0x1ba90f,_0x249dae,_0x5de673,_0x2e3133){var _0xf8c2af={};_0x249dae[_0x2707('0xe')]=_0x249dae[_0x2707('0xd')]?intUtil[_0x2707('0x55')](_0x249dae[_0x2707('0xf')]['data7']):intUtil[_0x2707('0x55')](_0x249dae[_0x2707('0xe')]);_0x249dae['serverUrl']=intUtil[_0x2707('0x55')](_0x249dae['serverUrl']);_0xf8c2af[_0x2707('0x4e')]=_0x2e3133===_0x2707('0x4f')||_0x2e3133===_0x2707('0x56')?'queue':_0x2707('0x57');var _0x1def4e=_0x249dae[_0x2707('0xd')]?util['format'](_0x2707('0x58'),_0x249dae[_0x2707('0xf')][_0x2707('0x10')]):util[_0x2707('0x52')](_0x2707('0x58'),_0x249dae[_0x2707('0xe')]);var _0x5d68fb=util[_0x2707('0x52')]('https://login.microsoftonline.com/%s/oauth2/token',_0x249dae['tenantId']);var _0x38670b=util[_0x2707('0x52')](_0x2707('0x59'),_0x249dae[_0x2707('0x5a')],_0x553a45[_0x2707('0x5b')],md5(_0x553a45[_0x2707('0x5b')]));if(_0x1ba90f&&_0x1ba90f[_0x2707('0x5c')]){logger[_0x2707('0x29')]('[QUEUE]',_0x2707('0x5d'));_0x553a45[_0x2707('0x5e')]=_0x38670b;}else if(_0x5de673&&_0x5de673['recordingFormat']&&_0x5de673[_0x2707('0x5f')]!==_0x2707('0x60')){logger[_0x2707('0x29')](_0x2707('0x61'),_0x2707('0x5d'));_0x553a45[_0x2707('0x5e')]=_0x38670b;}else{_0x553a45['recordingURL']='';}return getUser(_0xf8c2af,_0x249dae,_0x278037,_0x5d68fb,_0x1def4e,_0x2e3133)['then'](function(_0x47c25d){logger[_0x2707('0x29')]('['+_0x2e3133['toUpperCase']()+_0x2707('0x62'),_0x47c25d[_0x2707('0x2b')]);logger['info']('['+_0x2e3133[_0x2707('0x1d')]()+_0x2707('0x63'),_0x47c25d['userEmail']);return getEndUser(_0x47c25d,_0x249dae,_0x5d68fb,_0x1def4e,_0x553a45,_0x2e3133,_0x5d0645[_0x2707('0x64')]);})[_0x2707('0x19')](function(_0x2c7601){logger['info']('['+_0x2e3133[_0x2707('0x1d')]()+_0x2707('0x65'),_0x2c7601[_0x2707('0x38')]);logger[_0x2707('0x29')]('['+_0x2e3133[_0x2707('0x1d')]()+_0x2707('0x66'),_0x553a45[_0x2707('0x30')]);return getTicket(_0x2c7601,_0x249dae,_0x5d68fb,_0x1def4e,_0x553a45,_0x5d0645,_0x2e3133);})[_0x2707('0x19')](function(_0x141640){logger[_0x2707('0x29')](util[_0x2707('0x52')]('['+_0x2e3133[_0x2707('0x1d')]()+_0x2707('0x67'),_0x5d0645[_0x2707('0x47')],_0x141640[_0x2707('0x68')]));logger[_0x2707('0x29')](util['format']('['+_0x2e3133[_0x2707('0x1d')]()+_0x2707('0x69'),_0x2e3133));if(_0x2e3133!==_0x2707('0x56')){logger[_0x2707('0x29')]('['+_0x2e3133[_0x2707('0x1d')]()+']',_0x2707('0x6a'));emit(_0x249dae[_0x2707('0xe')],_0x278037[_0x2707('0x6b')],_0x5d0645[_0x2707('0x47')],_0x141640['ticketId']);}})['catch'](function(_0x2e708b){logger[_0x2707('0x1c')]('['+_0x2e3133[_0x2707('0x1d')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x2e708b[_0x2707('0x1e')]);});}; \ 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 f2b34ba..04b7028 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 _0x8d47=['user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','catch','error','unmanaged','toUpperCase','Authorization','request-promise','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','
','Tags','custom_fields','mapValues','value','%s/api/v2/tickets','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','remoteUri','Enduser\x20found!','find','POST','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','push','variable','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x30be39,_0xfb49ad){var _0x4d99d6=function(_0x1e7665){while(--_0x1e7665){_0x30be39['push'](_0x30be39['shift']());}};_0x4d99d6(++_0xfb49ad);}(_0x8d47,0x184));var _0x78d4=function(_0x3f6281,_0x12d41d){_0x3f6281=_0x3f6281-0x0;var _0x58a481=_0x8d47[_0x3f6281];return _0x58a481;};'use strict';var _=require('lodash');var rp=require(_0x78d4('0x0'));var md5=require('md5');var util=require(_0x78d4('0x1'));var Redis=require(_0x78d4('0x2'));var intUtil=require(_0x78d4('0x3'));var config=require(_0x78d4('0x4'));var logger=require('../../../../config/logger')(_0x78d4('0x5'));config[_0x78d4('0x6')]=_[_0x78d4('0x7')](config['redis'],{'host':_0x78d4('0x8'),'port':0x18eb});var io=require(_0x78d4('0x9'))(new Redis(config[_0x78d4('0x6')]));var headers={'Content-Type':_0x78d4('0xa'),'Accept':'application/json'};function emit(_0x482a7d,_0x41a091,_0x1a164d){io['to'](_0x482a7d)[_0x78d4('0xb')](_0x41a091,_0x1a164d);}function getTicket(_0x5b504c,_0x37223a,_0x351896,_0x2f782f,_0x383810){logger[_0x78d4('0xc')](_0x78d4('0xd'));var _0x3bbb47=_[_0x78d4('0xe')]({'responder_id':_0x37223a['id'],'requester_id':_0x351896['id'],'name':util[_0x78d4('0xf')](_0x78d4('0x10'),_0x383810[_0x78d4('0x11')]),'phone':_0x383810[_0x78d4('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x78d4('0x13')](_0x2f782f[_0x78d4('0x14')],_0x383810,'\x20'),'description':intUtil[_0x78d4('0x13')](_0x2f782f['Descriptions'],_0x383810,_0x78d4('0x15')),'tags':getTags(_0x2f782f[_0x78d4('0x16')],'name')},getCustomFields(_0x2f782f['Fields'],_0x383810));_0x3bbb47[_0x78d4('0x17')]=_[_0x78d4('0x18')](_['keyBy'](_0x3bbb47[_0x78d4('0x17')],'id'),_0x78d4('0x19'));return request({'uri':util['format'](_0x78d4('0x1a'),_0x5b504c['remoteUri']),'method':'POST','body':_0x3bbb47})[_0x78d4('0x1b')](function(_0x34ff78){logger[_0x78d4('0xc')](_0x78d4('0x1c'));return _0x34ff78;});}function getUser(_0x1aff9a,_0x13838c){if(intUtil['validateEmail'](_0x13838c)){return request({'uri':util[_0x78d4('0xf')](_0x78d4('0x1d'),_0x1aff9a['remoteUri']),'qs':{'email':_0x13838c}})[_0x78d4('0x1b')](function(_0x3e1753){if(_0x3e1753[_0x78d4('0x1e')]){logger[_0x78d4('0xc')](_0x78d4('0x1f'));return _['find'](_0x3e1753,function(_0x2fd197){return _0x2fd197[_0x78d4('0x20')][_0x78d4('0x21')]===_0x13838c;});}else{logger['info'](_0x78d4('0x22'));return request({'uri':util[_0x78d4('0xf')](_0x78d4('0x23'),_0x1aff9a['remoteUri'])})[_0x78d4('0x1b')](function(_0x106667){logger[_0x78d4('0xc')](_0x78d4('0x24'));return _0x106667;});}});}else{logger[_0x78d4('0xc')](_0x78d4('0x25'));return request({'uri':util[_0x78d4('0xf')]('%s/api/v2/agents/me',_0x1aff9a[_0x78d4('0x26')])})['then'](function(_0x145a93){logger[_0x78d4('0xc')](_0x78d4('0x24'));return _0x145a93;});}}function getEndUser(_0x2eb9b3,_0x216782,_0x5ef13f){logger[_0x78d4('0xc')]('Searching\x20enduser\x20with\x20phone',_0x5ef13f);return request({'uri':util['format']('%s/api/v2/contacts',_0x2eb9b3['remoteUri']),'qs':{'phone':_0x5ef13f}})[_0x78d4('0x1b')](function(_0x5573da){if(_0x5573da[_0x78d4('0x1e')]){logger[_0x78d4('0xc')](_0x78d4('0x27'));return _[_0x78d4('0x28')](_0x5573da,{'phone':_0x5ef13f});}else{logger[_0x78d4('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x78d4('0xf')]('%s/api/v2/contacts',_0x2eb9b3[_0x78d4('0x26')]),'method':_0x78d4('0x29'),'body':{'name':_0x216782,'phone':_0x5ef13f}})[_0x78d4('0x1b')](function(_0x4f53d1){logger[_0x78d4('0xc')](_0x78d4('0x2a'));return _0x4f53d1;});}});}function getAuth(_0x687c48){return util[_0x78d4('0xf')](_0x78d4('0x2b'),new Buffer(_0x687c48[_0x78d4('0x2c')]+':X')['toString'](_0x78d4('0x2d')));}function request(_0x54fc18){logger[_0x78d4('0x2e')](_0x78d4('0x2f'),JSON[_0x78d4('0x30')](_0x54fc18));return rp(_[_0x78d4('0x7')](_0x54fc18,{'method':_0x78d4('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x5cd1ba,_0x35d39b){var _0x4b85e2=[];if(_0x5cd1ba&&_0x5cd1ba[_0x78d4('0x1e')]>0x0){_0x4b85e2=_[_0x78d4('0x32')](_0x5cd1ba,_0x35d39b);}return _0x4b85e2;}function getCustomFields(_0x285e7c,_0x593d37){var _0x3e6335=[];var _0x391ed1={'custom_fields':[]};if(_0x285e7c[_0x78d4('0x1e')]>0x0){_['forEach'](_0x285e7c,function(_0x2ea0b6){if(_[_0x78d4('0x33')]([_0x78d4('0x34'),_0x78d4('0x35')],_0x2ea0b6[_0x78d4('0x36')])&&_0x2ea0b6[_0x78d4('0x37')]&&!_0x2ea0b6[_0x78d4('0x38')]){_0x391ed1[_0x2ea0b6['nameField'][_0x78d4('0x39')]()]=_0x2ea0b6[_0x78d4('0x3a')][_0x78d4('0x3b')]();}else if(_[_0x78d4('0x33')]([_0x78d4('0x34'),_0x78d4('0x35')],_0x2ea0b6[_0x78d4('0x36')])&&_0x2ea0b6[_0x78d4('0x3c')]&&_0x2ea0b6[_0x78d4('0x38')]){_0x391ed1[_0x78d4('0x17')][_0x78d4('0x3d')]({'id':_0x2ea0b6[_0x78d4('0x3c')],'value':_0x2ea0b6[_0x78d4('0x3a')]['toString']()});}else if(_0x2ea0b6[_0x78d4('0x36')]===_0x78d4('0x3e')&&_0x2ea0b6[_0x78d4('0x3f')]&&_0x2ea0b6[_0x78d4('0x3c')]&&_0x2ea0b6['customField']){_0x593d37[_0x2ea0b6['variableName']]&&_0x391ed1[_0x78d4('0x17')][_0x78d4('0x3d')]({'id':_0x2ea0b6[_0x78d4('0x3c')],'value':_0x593d37[_0x2ea0b6[_0x78d4('0x3f')]][_0x78d4('0x3b')]()});}else if(_0x2ea0b6['type']==='customVariable'&&_0x2ea0b6[_0x78d4('0x40')]&&_0x2ea0b6[_0x78d4('0x40')][_0x78d4('0x41')]&&_0x2ea0b6[_0x78d4('0x3c')]&&_0x2ea0b6[_0x78d4('0x38')]){_0x593d37[_0x2ea0b6['Variable'][_0x78d4('0x41')]['toLowerCase']()]&&_0x391ed1[_0x78d4('0x17')][_0x78d4('0x3d')]({'id':_0x2ea0b6[_0x78d4('0x3c')],'value':_0x593d37[_0x2ea0b6[_0x78d4('0x40')][_0x78d4('0x41')]['toLowerCase']()][_0x78d4('0x3b')]()});}});}return _0x391ed1;}exports[_0x78d4('0x42')]=function(_0x1215fb,_0x1b1749,_0x587792,_0x288aed,_0xef6e45,_0x1cca72){var _0x5d99e1,_0x43ec1b;_0x1cca72[_0x78d4('0x26')]=intUtil[_0x78d4('0x43')](_0x1cca72[_0x78d4('0x26')]);_0x1cca72[_0x78d4('0x44')]=intUtil[_0x78d4('0x43')](_0x1cca72[_0x78d4('0x44')]);if(_0xef6e45&&_0xef6e45[_0x78d4('0x45')]){logger[_0x78d4('0xc')]('[QUEUE]',_0x78d4('0x46'));_0x1b1749[_0x78d4('0x47')]=util['format'](_0x78d4('0x48'),_0x1cca72[_0x78d4('0x44')],_0x1b1749['uniqueid'],md5(_0x1b1749['uniqueid']));}else{_0x1b1749[_0x78d4('0x47')]='';}headers['Authorization']=getAuth(_0x1cca72);return getUser(_0x1cca72,_0x288aed[_0x78d4('0x21')])[_0x78d4('0x1b')](function(_0x440672){_0x5d99e1=_0x440672;logger[_0x78d4('0xc')](_0x78d4('0x49'),_0x5d99e1['id']);return getEndUser(_0x1cca72,_0x1b1749[_0x78d4('0x11')],_0x1b1749[_0x78d4('0x12')]);})[_0x78d4('0x1b')](function(_0x184451){_0x43ec1b=_0x184451;logger['info'](_0x78d4('0x4a'),_0x43ec1b['id']);return getTicket(_0x1cca72,_0x5d99e1,_0x43ec1b,_0x587792,_0x1b1749);})[_0x78d4('0x1b')](function(_0x7bb972){if(_0x7bb972&&_0x7bb972['id']){logger[_0x78d4('0xc')](_0x78d4('0x1c'));logger[_0x78d4('0xc')]('The\x20Ticket\x20ID\x20is:',_0x7bb972['id']);logger[_0x78d4('0xc')](_0x78d4('0x4b'),_0x78d4('0x4c'));emit(util[_0x78d4('0xf')](_0x78d4('0x4d'),_0x288aed[_0x78d4('0x41')]),_0x78d4('0x4e'),{'uri':util[_0x78d4('0xf')](_0x78d4('0x4f'),_0x1cca72[_0x78d4('0x26')],_0x7bb972['id'])});}})['catch'](function(_0x157755){logger['error'](_0x78d4('0x4b'),JSON[_0x78d4('0x30')](_0x157755));});};exports[_0x78d4('0x50')]=function(_0x4277bb,_0x34ea76,_0x13f33b,_0x454dba,_0x350235,_0x457572,_0x488d14){var _0x44cead,_0x4f3934;_0x457572[_0x78d4('0x26')]=intUtil[_0x78d4('0x43')](_0x457572[_0x78d4('0x26')]);_0x457572['serverUrl']=intUtil[_0x78d4('0x43')](_0x457572['serverUrl']);if(_0x488d14&&_0x488d14['recordingFormat']&&_0x488d14[_0x78d4('0x51')]!==_0x78d4('0x52')){logger[_0x78d4('0xc')](_0x78d4('0x53'),_0x78d4('0x46'));_0x34ea76[_0x78d4('0x47')]=util[_0x78d4('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x457572[_0x78d4('0x44')],_0x34ea76[_0x78d4('0x54')],md5(_0x34ea76[_0x78d4('0x54')]));}headers['Authorization']=getAuth(_0x457572);return getUser(_0x457572,_0x454dba[_0x78d4('0x21')])[_0x78d4('0x1b')](function(_0x55b695){_0x44cead=_0x55b695;logger[_0x78d4('0xc')](_0x78d4('0x49'),_0x44cead['id']);return getEndUser(_0x457572,_0x34ea76[_0x78d4('0x55')],_0x34ea76[_0x78d4('0x56')]);})[_0x78d4('0x1b')](function(_0x24f1f3){_0x4f3934=_0x24f1f3;logger['info'](_0x78d4('0x4a'),_0x4f3934['id']);return getTicket(_0x457572,_0x44cead,_0x4f3934,_0x13f33b,_0x34ea76);})['then'](function(_0x63fc74){if(_0x63fc74&&_0x63fc74['id']){logger[_0x78d4('0xc')](_0x78d4('0x1c'));logger[_0x78d4('0xc')](_0x78d4('0x57'),_0x63fc74['id']);logger[_0x78d4('0xc')](_0x78d4('0x53'),_0x78d4('0x4c'));emit(util[_0x78d4('0xf')]('user:%s',_0x454dba['name']),_0x78d4('0x4e'),{'uri':util[_0x78d4('0xf')]('%s/helpdesk/tickets/%d',_0x457572[_0x78d4('0x26')],_0x63fc74['id'])});}})[_0x78d4('0x58')](function(_0x17edad){logger[_0x78d4('0x59')](_0x78d4('0x53'),JSON[_0x78d4('0x30')](_0x17edad));});};exports[_0x78d4('0x5a')]=function(_0x226578,_0x425859,_0x5859d3,_0x2c9c4b,_0x2df144,_0x1a9b0b){var _0x179ea9,_0x484ed2;_0x1a9b0b[_0x78d4('0x26')]=intUtil[_0x78d4('0x43')](_0x1a9b0b[_0x78d4('0x26')]);_0x1a9b0b[_0x78d4('0x44')]=intUtil[_0x78d4('0x43')](_0x1a9b0b[_0x78d4('0x44')]);if(_0x2df144&&_0x2df144[_0x78d4('0x45')]){logger['info']('['+_0x425859['lastevent'][_0x78d4('0x5b')]()+']','Recording\x20is\x20enabled!');_0x425859[_0x78d4('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1a9b0b[_0x78d4('0x44')],_0x425859[_0x78d4('0x54')],md5(_0x425859['uniqueid']));}else{_0x425859[_0x78d4('0x47')]='';}headers[_0x78d4('0x5c')]=getAuth(_0x1a9b0b);return getUser(_0x1a9b0b,'')[_0x78d4('0x1b')](function(_0x304355){_0x179ea9=_0x304355;logger['info'](_0x78d4('0x49'),_0x179ea9['id']);return getEndUser(_0x1a9b0b,_0x425859[_0x78d4('0x11')],_0x425859[_0x78d4('0x12')]);})[_0x78d4('0x1b')](function(_0x32b9a3){_0x484ed2=_0x32b9a3;logger[_0x78d4('0xc')](_0x78d4('0x4a'),_0x484ed2['id']);return getTicket(_0x1a9b0b,_0x179ea9,_0x484ed2,_0x5859d3,_0x425859);})['then'](function(_0x5e9176){if(_0x5e9176){logger[_0x78d4('0xc')](_0x78d4('0x1c'));logger['info'](_0x78d4('0x57'),_0x5e9176['id']);}})[_0x78d4('0x58')](function(_0x39e58a){logger['error']('['+_0x425859['lastevent'][_0x78d4('0x5b')]()+']',JSON[_0x78d4('0x30')](_0x39e58a));});}; \ No newline at end of file +var _0xb5b9=['
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','GET','map','forEach','includes','picklist','type','nameField','toLowerCase','content','string','idField','customField','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','lodash','request-promise','md5','ioredis','../../../../config/logger','redis','defaults','localhost','emit','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions'];(function(_0x3f4aa4,_0x5e70ea){var _0x575ac0=function(_0x53536e){while(--_0x53536e){_0x3f4aa4['push'](_0x3f4aa4['shift']());}};_0x575ac0(++_0x5e70ea);}(_0xb5b9,0x160));var _0x9b5b=function(_0xc9a138,_0x143d98){_0xc9a138=_0xc9a138-0x0;var _0x40a8e8=_0xb5b9[_0xc9a138];return _0x40a8e8;};'use strict';var _=require(_0x9b5b('0x0'));var rp=require(_0x9b5b('0x1'));var md5=require(_0x9b5b('0x2'));var util=require('util');var Redis=require(_0x9b5b('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x9b5b('0x4'))('freshdesk');config[_0x9b5b('0x5')]=_[_0x9b5b('0x6')](config[_0x9b5b('0x5')],{'host':_0x9b5b('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9b5b('0x5')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x3eefd0,_0x2f2326,_0x132812){io['to'](_0x3eefd0)[_0x9b5b('0x8')](_0x2f2326,_0x132812);}function getTicket(_0x4a5e2c,_0x4e660f,_0x4e0e31,_0x1a3d5d,_0xa0b700){logger[_0x9b5b('0x9')](_0x9b5b('0xa'));var _0x23abce=_['merge']({'responder_id':_0x4e660f['id'],'requester_id':_0x4e0e31['id'],'name':util['format'](_0x9b5b('0xb'),_0xa0b700['calleridname']),'phone':_0xa0b700[_0x9b5b('0xc')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x9b5b('0xd')](_0x1a3d5d[_0x9b5b('0xe')],_0xa0b700,'\x20'),'description':intUtil[_0x9b5b('0xd')](_0x1a3d5d[_0x9b5b('0xf')],_0xa0b700,_0x9b5b('0x10')),'tags':getTags(_0x1a3d5d[_0x9b5b('0x11')],_0x9b5b('0x12'))},getCustomFields(_0x1a3d5d[_0x9b5b('0x13')],_0xa0b700));_0x23abce[_0x9b5b('0x14')]=_[_0x9b5b('0x15')](_[_0x9b5b('0x16')](_0x23abce[_0x9b5b('0x14')],'id'),_0x9b5b('0x17'));return request({'uri':util[_0x9b5b('0x18')](_0x9b5b('0x19'),_0x4a5e2c[_0x9b5b('0x1a')]),'method':'POST','body':_0x23abce})[_0x9b5b('0x1b')](function(_0x2d6325){logger[_0x9b5b('0x9')](_0x9b5b('0x1c'));return _0x2d6325;});}function getUser(_0x1498b7,_0x5e2745){if(intUtil['validateEmail'](_0x5e2745)){return request({'uri':util[_0x9b5b('0x18')](_0x9b5b('0x1d'),_0x1498b7[_0x9b5b('0x1a')]),'qs':{'email':_0x5e2745}})[_0x9b5b('0x1b')](function(_0x345d20){if(_0x345d20[_0x9b5b('0x1e')]){logger[_0x9b5b('0x9')](_0x9b5b('0x1f'));return _[_0x9b5b('0x20')](_0x345d20,function(_0x171dab){return _0x171dab[_0x9b5b('0x21')][_0x9b5b('0x22')]===_0x5e2745;});}else{logger['info'](_0x9b5b('0x23'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x1498b7[_0x9b5b('0x1a')])})[_0x9b5b('0x1b')](function(_0x540931){logger[_0x9b5b('0x9')](_0x9b5b('0x24'));return _0x540931;});}});}else{logger[_0x9b5b('0x9')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x9b5b('0x25'),_0x1498b7[_0x9b5b('0x1a')])})['then'](function(_0x453c03){logger[_0x9b5b('0x9')](_0x9b5b('0x24'));return _0x453c03;});}}function getEndUser(_0x14d5f8,_0x1c84d2,_0x598c47){logger[_0x9b5b('0x9')](_0x9b5b('0x26'),_0x598c47);return request({'uri':util[_0x9b5b('0x18')](_0x9b5b('0x27'),_0x14d5f8[_0x9b5b('0x1a')]),'qs':{'phone':_0x598c47}})[_0x9b5b('0x1b')](function(_0x23627e){if(_0x23627e[_0x9b5b('0x1e')]){logger[_0x9b5b('0x9')]('Enduser\x20found!');return _[_0x9b5b('0x20')](_0x23627e,{'phone':_0x598c47});}else{logger[_0x9b5b('0x9')](_0x9b5b('0x28'));return request({'uri':util[_0x9b5b('0x18')](_0x9b5b('0x27'),_0x14d5f8[_0x9b5b('0x1a')]),'method':'POST','body':{'name':_0x1c84d2,'phone':_0x598c47}})['then'](function(_0x15fa4a){logger[_0x9b5b('0x9')](_0x9b5b('0x29'));return _0x15fa4a;});}});}function getAuth(_0x36093e){return util[_0x9b5b('0x18')]('Basic\x20%s',new Buffer(_0x36093e[_0x9b5b('0x2a')]+':X')[_0x9b5b('0x2b')](_0x9b5b('0x2c')));}function request(_0x567b72){logger[_0x9b5b('0x2d')](_0x9b5b('0x2e'),JSON['stringify'](_0x567b72));return rp(_[_0x9b5b('0x6')](_0x567b72,{'method':_0x9b5b('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x2b76a0,_0x37c5db){var _0x1d88b=[];if(_0x2b76a0&&_0x2b76a0['length']>0x0){_0x1d88b=_[_0x9b5b('0x30')](_0x2b76a0,_0x37c5db);}return _0x1d88b;}function getCustomFields(_0x355002,_0x3d32c5){var _0x194d5f=[];var _0x4df844={'custom_fields':[]};if(_0x355002[_0x9b5b('0x1e')]>0x0){_[_0x9b5b('0x31')](_0x355002,function(_0x41628c){if(_[_0x9b5b('0x32')](['string',_0x9b5b('0x33')],_0x41628c[_0x9b5b('0x34')])&&_0x41628c[_0x9b5b('0x35')]&&!_0x41628c['customField']){_0x4df844[_0x41628c[_0x9b5b('0x35')][_0x9b5b('0x36')]()]=_0x41628c[_0x9b5b('0x37')][_0x9b5b('0x2b')]();}else if(_[_0x9b5b('0x32')]([_0x9b5b('0x38'),_0x9b5b('0x33')],_0x41628c['type'])&&_0x41628c[_0x9b5b('0x39')]&&_0x41628c[_0x9b5b('0x3a')]){_0x4df844[_0x9b5b('0x14')][_0x9b5b('0x3b')]({'id':_0x41628c['idField'],'value':_0x41628c['content']['toString']()});}else if(_0x41628c[_0x9b5b('0x34')]===_0x9b5b('0x3c')&&_0x41628c[_0x9b5b('0x3d')]&&_0x41628c[_0x9b5b('0x39')]&&_0x41628c[_0x9b5b('0x3a')]){_0x3d32c5[_0x41628c[_0x9b5b('0x3d')]]&&_0x4df844[_0x9b5b('0x14')][_0x9b5b('0x3b')]({'id':_0x41628c[_0x9b5b('0x39')],'value':_0x3d32c5[_0x41628c[_0x9b5b('0x3d')]]['toString']()});}else if(_0x41628c[_0x9b5b('0x34')]===_0x9b5b('0x3e')&&_0x41628c[_0x9b5b('0x3f')]&&_0x41628c['Variable'][_0x9b5b('0x12')]&&_0x41628c[_0x9b5b('0x39')]&&_0x41628c['customField']){_0x3d32c5[_0x41628c[_0x9b5b('0x3f')]['name'][_0x9b5b('0x36')]()]&&_0x4df844['custom_fields']['push']({'id':_0x41628c[_0x9b5b('0x39')],'value':_0x3d32c5[_0x41628c[_0x9b5b('0x3f')][_0x9b5b('0x12')][_0x9b5b('0x36')]()][_0x9b5b('0x2b')]()});}});}return _0x4df844;}exports['queue']=function(_0x2b07f4,_0x4d3407,_0x1b283a,_0x1445a2,_0x8c6d7b,_0x790e0b){var _0x203113,_0x12562e;_0x790e0b[_0x9b5b('0x1a')]=intUtil[_0x9b5b('0x40')](_0x790e0b[_0x9b5b('0x1a')]);_0x790e0b[_0x9b5b('0x41')]=intUtil[_0x9b5b('0x40')](_0x790e0b[_0x9b5b('0x41')]);if(_0x8c6d7b&&_0x8c6d7b[_0x9b5b('0x42')]){logger[_0x9b5b('0x9')](_0x9b5b('0x43'),_0x9b5b('0x44'));_0x4d3407[_0x9b5b('0x45')]=util[_0x9b5b('0x18')](_0x9b5b('0x46'),_0x790e0b[_0x9b5b('0x41')],_0x4d3407[_0x9b5b('0x47')],md5(_0x4d3407['uniqueid']));}else{_0x4d3407[_0x9b5b('0x45')]='';}headers[_0x9b5b('0x48')]=getAuth(_0x790e0b);return getUser(_0x790e0b,_0x1445a2[_0x9b5b('0x22')])[_0x9b5b('0x1b')](function(_0x333e80){_0x203113=_0x333e80;logger[_0x9b5b('0x9')]('The\x20User\x20ID\x20is:',_0x203113['id']);return getEndUser(_0x790e0b,_0x4d3407[_0x9b5b('0x49')],_0x4d3407[_0x9b5b('0xc')]);})[_0x9b5b('0x1b')](function(_0x2e7998){_0x12562e=_0x2e7998;logger['info']('The\x20Enduser\x20ID\x20is:',_0x12562e['id']);return getTicket(_0x790e0b,_0x203113,_0x12562e,_0x1b283a,_0x4d3407);})[_0x9b5b('0x1b')](function(_0xa9cc87){if(_0xa9cc87&&_0xa9cc87['id']){logger[_0x9b5b('0x9')](_0x9b5b('0x1c'));logger['info'](_0x9b5b('0x4a'),_0xa9cc87['id']);logger[_0x9b5b('0x9')](_0x9b5b('0x43'),_0x9b5b('0x4b'));emit(util['format'](_0x9b5b('0x4c'),_0x1445a2[_0x9b5b('0x12')]),_0x9b5b('0x4d'),{'uri':util[_0x9b5b('0x18')](_0x9b5b('0x4e'),_0x790e0b[_0x9b5b('0x1a')],_0xa9cc87['id'])});}})[_0x9b5b('0x4f')](function(_0x4e3802){logger[_0x9b5b('0x50')](_0x9b5b('0x43'),JSON[_0x9b5b('0x51')](_0x4e3802));});};exports[_0x9b5b('0x52')]=function(_0x5ad5f1,_0xb79a74,_0xe6e9b7,_0x5a8053,_0x12a5e3,_0x4c64fb,_0x5bf530){var _0x246759,_0x3ee264;_0x4c64fb[_0x9b5b('0x1a')]=intUtil['stripTrailingSlash'](_0x4c64fb[_0x9b5b('0x1a')]);_0x4c64fb[_0x9b5b('0x41')]=intUtil[_0x9b5b('0x40')](_0x4c64fb[_0x9b5b('0x41')]);if(_0x5bf530&&_0x5bf530[_0x9b5b('0x53')]&&_0x5bf530[_0x9b5b('0x53')]!==_0x9b5b('0x54')){logger[_0x9b5b('0x9')]('[OUTBOUND]',_0x9b5b('0x44'));_0xb79a74['recordingURL']=util[_0x9b5b('0x18')](_0x9b5b('0x46'),_0x4c64fb[_0x9b5b('0x41')],_0xb79a74[_0x9b5b('0x47')],md5(_0xb79a74[_0x9b5b('0x47')]));}headers[_0x9b5b('0x48')]=getAuth(_0x4c64fb);return getUser(_0x4c64fb,_0x5a8053['email'])['then'](function(_0x3fc3ee){_0x246759=_0x3fc3ee;logger[_0x9b5b('0x9')](_0x9b5b('0x55'),_0x246759['id']);return getEndUser(_0x4c64fb,_0xb79a74[_0x9b5b('0x56')],_0xb79a74[_0x9b5b('0x57')]);})['then'](function(_0x1397ef){_0x3ee264=_0x1397ef;logger[_0x9b5b('0x9')]('The\x20Enduser\x20ID\x20is:',_0x3ee264['id']);return getTicket(_0x4c64fb,_0x246759,_0x3ee264,_0xe6e9b7,_0xb79a74);})[_0x9b5b('0x1b')](function(_0x326814){if(_0x326814&&_0x326814['id']){logger[_0x9b5b('0x9')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x326814['id']);logger[_0x9b5b('0x9')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9b5b('0x18')](_0x9b5b('0x4c'),_0x5a8053[_0x9b5b('0x12')]),'trigger:browser:url',{'uri':util[_0x9b5b('0x18')](_0x9b5b('0x4e'),_0x4c64fb[_0x9b5b('0x1a')],_0x326814['id'])});}})[_0x9b5b('0x4f')](function(_0x1affd2){logger[_0x9b5b('0x50')](_0x9b5b('0x58'),JSON[_0x9b5b('0x51')](_0x1affd2));});};exports['unmanaged']=function(_0x3ce27a,_0x41318d,_0x1649c8,_0x35e6e2,_0x2118c9,_0x5c05b0){var _0x35b64e,_0x2a1c73;_0x5c05b0[_0x9b5b('0x1a')]=intUtil[_0x9b5b('0x40')](_0x5c05b0['remoteUri']);_0x5c05b0[_0x9b5b('0x41')]=intUtil['stripTrailingSlash'](_0x5c05b0[_0x9b5b('0x41')]);if(_0x2118c9&&_0x2118c9['monitor_format']){logger['info']('['+_0x41318d[_0x9b5b('0x59')][_0x9b5b('0x5a')]()+']',_0x9b5b('0x44'));_0x41318d[_0x9b5b('0x45')]=util[_0x9b5b('0x18')](_0x9b5b('0x46'),_0x5c05b0[_0x9b5b('0x41')],_0x41318d[_0x9b5b('0x47')],md5(_0x41318d[_0x9b5b('0x47')]));}else{_0x41318d[_0x9b5b('0x45')]='';}headers[_0x9b5b('0x48')]=getAuth(_0x5c05b0);return getUser(_0x5c05b0,'')[_0x9b5b('0x1b')](function(_0x2dd320){_0x35b64e=_0x2dd320;logger[_0x9b5b('0x9')]('The\x20User\x20ID\x20is:',_0x35b64e['id']);return getEndUser(_0x5c05b0,_0x41318d[_0x9b5b('0x49')],_0x41318d[_0x9b5b('0xc')]);})[_0x9b5b('0x1b')](function(_0x4562fd){_0x2a1c73=_0x4562fd;logger[_0x9b5b('0x9')](_0x9b5b('0x5b'),_0x2a1c73['id']);return getTicket(_0x5c05b0,_0x35b64e,_0x2a1c73,_0x1649c8,_0x41318d);})['then'](function(_0x3948a8){if(_0x3948a8){logger['info'](_0x9b5b('0x1c'));logger[_0x9b5b('0x9')](_0x9b5b('0x4a'),_0x3948a8['id']);}})['catch'](function(_0xfee7fb){logger['error']('['+_0x41318d[_0x9b5b('0x59')]['toUpperCase']()+']',JSON[_0x9b5b('0x51')](_0xfee7fb));});}; \ 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 12ba987..00dfb9a 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 _0x967d=[']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','Getting\x20admin\x20information','then','users','length','email','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','GET','/api/selector/owners','headers','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','adminEmail','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Subjects','Descriptions','adminId','Contact','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name'];(function(_0x7b60fc,_0x4a6208){var _0x351cf9=function(_0x57efb3){while(--_0x57efb3){_0x7b60fc['push'](_0x7b60fc['shift']());}};_0x351cf9(++_0x4a6208);}(_0x967d,0x15a));var _0xd967=function(_0x95655b,_0x3e1048){_0x95655b=_0x95655b-0x0;var _0x3aa956=_0x967d[_0x95655b];return _0x3aa956;};'use strict';var _=require(_0xd967('0x0'));var rp=require(_0xd967('0x1'));var md5=require(_0xd967('0x2'));var util=require(_0xd967('0x3'));var moment=require('moment');var Promise=require(_0xd967('0x4'));var Redis=require(_0xd967('0x5'));var intUtil=require(_0xd967('0x6'));var config=require(_0xd967('0x7'));var logger=require(_0xd967('0x8'))(_0xd967('0x9'));config['redis']=_[_0xd967('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd967('0xb')]));function getAdminId(_0x339d6e,_0x29ec32,_0x3ae5f6,_0x5c0678){return new Promise(function(_0x90f033,_0x33d322){var _0x1fc4da=![];var _0x17cf9a={'method':'GET','uri':_0x5c0678+'/api/selector/owners','json':!![]};_0x17cf9a['headers']=_0x3ae5f6;logger['info'](_0xd967('0xc'));return rp(_0x17cf9a)[_0xd967('0xd')](function(_0x11ca72){if(_0x11ca72){var _0x41bbbd=_0x11ca72[_0xd967('0xe')];var _0x2194de=null;for(_0x2194de=0x0;_0x2194de<_0x41bbbd[_0xd967('0xf')];_0x2194de++){if(_0x41bbbd[_0x2194de][_0xd967('0x10')]===_0x339d6e['adminEmail']){_0x339d6e['adminId']=_0x41bbbd[_0x2194de]['id'];_0x1fc4da=!![];}}if(_0x1fc4da){logger[_0xd967('0x11')](_0xd967('0x12'),_0x339d6e['adminId']);_0x90f033(_0x339d6e);}else{_0x33d322({'statusCode':0x194,'message':_0xd967('0x13')});}}else{_0x33d322({'statusCode':0x194,'message':_0xd967('0x13')});}})[_0xd967('0x14')](function(_0x287bb2){logger[_0xd967('0x15')]('['+[_0x29ec32[_0xd967('0x16')]()]+']',_0x287bb2[_0xd967('0x17')]);_0x33d322(_0x287bb2);});});}function getUser(_0x540394,_0x13b66d,_0x3d4f19){return function(_0xbc1bea){return new Promise(function(_0x16b3ee,_0x12cd8a){var _0x285850={'method':_0xd967('0x18'),'uri':_0x3d4f19+_0xd967('0x19'),'json':!![]};_0x285850[_0xd967('0x1a')]=_0x13b66d;logger['info']('Getting\x20user\x20list');return rp(_0x285850)[_0xd967('0xd')](function(_0x51cea8){if(_0x51cea8){var _0x38a569=_0x51cea8['users'];var _0x2dc6e9=![];var _0x4c9551=null;if(_0xbc1bea[_0xd967('0x1b')]!==null){logger['info'](_0xd967('0x1c'),_0xbc1bea[_0xd967('0x1b')]);_0xbc1bea['userEmail']=_0xbc1bea[_0xd967('0x1b')];for(_0x4c9551=0x0;_0x4c9551<_0x38a569[_0xd967('0xf')];_0x4c9551++){if(_0x38a569[_0x4c9551]['email']===_0xbc1bea[_0xd967('0x1b')]){_0x2dc6e9=!![];_0xbc1bea[_0xd967('0x1d')]=_0x38a569[_0x4c9551]['id'];logger[_0xd967('0x11')](_0xd967('0x1e'),_0xbc1bea[_0xd967('0x1d')]);}}}if(!_0x2dc6e9){logger['info'](_0xd967('0x1f'));_0xbc1bea['userEmail']=_0xbc1bea[_0xd967('0x20')];_0xbc1bea[_0xd967('0x1d')]=_0xbc1bea['adminId'];_0x2dc6e9=!![];}if(_0x2dc6e9){_0x16b3ee(_0xbc1bea);}else{_0x12cd8a({'statusCode':0x194,'message':_0xd967('0x13')});}}else{_0x12cd8a({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x1eb00c){logger[_0xd967('0x15')]('['+[_0x540394['toUpperCase']()]+']',_0x1eb00c['message']);_0x12cd8a(_0x1eb00c);});});};}function searchContact(_0x181104,_0x167b5e,_0x4290af,_0x2853cf){return new Promise(function(_0x3d3be7,_0x43b716){var _0x2b86b7={'method':_0xd967('0x18'),'headers':_0x167b5e,'uri':_0x181104+_0xd967('0x21')+_0x2853cf+_0xd967('0x22')+_0x4290af+'&entities=contact','json':!![]};rp(_0x2b86b7)[_0xd967('0xd')](function(_0x361df9){var _0x42cdb7=_[_0xd967('0x23')](_0x361df9[_0xd967('0x24')][_0xd967('0x24')],[_0x4290af,_0x2853cf]);_0x3d3be7(_0x42cdb7);})[_0xd967('0x14')](function(_0x140668){_0x43b716(_0x140668);});});}function getEndUser(_0x12eae1,_0x2e87bf,_0x350cb8){return function(_0x4ef19d){return new Promise(function(_0x4cecf2,_0x2b940f){logger[_0xd967('0x11')](util[_0xd967('0x25')](_0xd967('0x26'),_0x4ef19d[_0xd967('0x27')]));searchContact(_0x350cb8,_0x2e87bf,'mobile_number',_0x4ef19d[_0xd967('0x27')])[_0xd967('0xd')](function(_0x148825){if(_0x148825){_0x4ef19d[_0xd967('0x28')]=_0x148825['id'];logger[_0xd967('0x11')](_0xd967('0x29'),_0x4ef19d['endUserId']);return _0x4cecf2(_0x4ef19d);}searchContact(_0x350cb8,_0x2e87bf,_0xd967('0x2a'),_0x4ef19d[_0xd967('0x27')])[_0xd967('0xd')](function(_0x1bf397){if(_0x1bf397){_0x4ef19d[_0xd967('0x28')]=_0x1bf397['id'];logger[_0xd967('0x11')]('Contact\x20found\x20work_number:',_0x4ef19d['endUserId']);return _0x4cecf2(_0x4ef19d);}createEndUser(_0x4ef19d,_0x12eae1,_0x2e87bf,_0x350cb8)['then'](function(_0x53e76e){logger[_0xd967('0x11')](_0xd967('0x2b'),_0x53e76e[_0xd967('0x28')]);return _0x4cecf2(_0x53e76e);});});})[_0xd967('0x14')](function(_0x945a15){_0x2b940f(_0x945a15);});});};}function createEndUser(_0x4771a6,_0x546c5d,_0x5bbdda,_0x2ff8e5){return new Promise(function(_0x5fb019,_0x2c5a4c){var _0x5e135f=moment();var _0x13a64b={'method':_0xd967('0x2c'),'uri':_0x2ff8e5+'/api/contacts','body':{'contact':{'last_name':_0x4771a6[_0xd967('0x27')],'work_number':_0x4771a6[_0xd967('0x27')],'mobile_number':_0x4771a6[_0xd967('0x27')],'owner_id':_0x4771a6[_0xd967('0x1d')],'created_at':_0x5e135f[_0xd967('0x25')](_0xd967('0x2d'))}},'json':!![]};_0x13a64b[_0xd967('0x1a')]=_0x5bbdda;logger[_0xd967('0x11')](_0xd967('0x2e'));return rp(_0x13a64b)['then'](function(_0x370e15){_0x4771a6['endUserId']=_0x370e15[_0xd967('0x2f')]['id'];_0x5fb019(_0x4771a6);})[_0xd967('0x14')](function(_0x5ca783){logger[_0xd967('0x15')]('['+[_0x546c5d[_0xd967('0x16')]()]+']',_0x5ca783['message']);_0x2c5a4c(_0x5ca783[_0xd967('0x17')]);});});}function getTicket(_0x401053,_0x411877,_0x165f1f,_0x5ca6f7,_0x258c6e){return function(_0x430f8b){logger[_0xd967('0x11')](_0xd967('0x30'));return new Promise(function(_0x3f8c19,_0x631be){var _0x1fa78a=moment();var _0x37e08e={'method':_0xd967('0x2c'),'uri':_0x165f1f+'/api/tasks','body':{'title':intUtil[_0xd967('0x31')](_0x5ca6f7[_0xd967('0x32')],_0x258c6e,'\x20'),'description':intUtil[_0xd967('0x31')](_0x5ca6f7[_0xd967('0x33')],_0x258c6e,'\x0a'),'owner_id':_0x430f8b[_0xd967('0x1d')],'creater_id':_0x430f8b[_0xd967('0x34')],'targetable_id':_0x430f8b[_0xd967('0x28')],'targetable_type':_0xd967('0x35'),'created_at':_0x1fa78a['format'](_0xd967('0x2d')),'due_date':_0x1fa78a['add'](0x1e,'m')[_0xd967('0x25')](_0xd967('0x2d'))},'json':!![]};_0x37e08e['headers']=_0x411877;return rp(_0x37e08e)[_0xd967('0xd')](function(_0x50dbf5){_0x430f8b[_0xd967('0x36')]=_0x50dbf5[_0xd967('0x37')]['id'];logger[_0xd967('0x11')](_0xd967('0x38'),_0x430f8b[_0xd967('0x36')]);_0x3f8c19(_0x430f8b);})[_0xd967('0x14')](function(_0x3df494){logger[_0xd967('0x15')]('['+[_0x401053['toUpperCase']()]+']',_0x3df494[_0xd967('0x17')]);_0x631be(_0x3df494['message']);});});};}function emit(_0x17e95c,_0x3af50a,_0x2ae8c6){var _0x5bc628={'uri':_0x17e95c+_0xd967('0x39')+_0x2ae8c6};io['to'](util[_0xd967('0x25')]('user:%s',_0x3af50a))[_0xd967('0x3a')](_0xd967('0x3b'),_0x5bc628);}exports['cs']=function(_0x1836be,_0x1c0791,_0x302ebd,_0x37c58c,_0x116fa8,_0x2d3d1a,_0x3a158b,_0x5080b7){var _0x3816b6={};var _0x35bd55={'Authorization':_0xd967('0x3c')+_0x2d3d1a[_0xd967('0x3d')]};_0x2d3d1a[_0xd967('0x3e')]=intUtil[_0xd967('0x3f')](_0x2d3d1a['remoteUri']);_0x2d3d1a[_0xd967('0x40')]=intUtil[_0xd967('0x3f')](_0x2d3d1a[_0xd967('0x40')]);var _0x393bb3=_0x2d3d1a[_0xd967('0x3e')];_0x3816b6[_0xd967('0x20')]=_0x2d3d1a[_0xd967('0x41')];_0x3816b6['contactNumber']=_0x5080b7[_0xd967('0x42')]()===_0xd967('0x43')?_0x1c0791[_0xd967('0x44')]:_0x1c0791[_0xd967('0x45')];_0x3816b6[_0xd967('0x46')]=_0x5080b7==='queue'||_0x5080b7==='unmanaged'?_0xd967('0x47'):_0xd967('0x43');if(_0x37c58c){_0x3816b6[_0xd967('0x1b')]=_0x37c58c[_0xd967('0x10')];}var _0x681a0c=util['format'](_0xd967('0x48'),_0x2d3d1a['serverUrl'],_0x1c0791[_0xd967('0x49')],md5(_0x1c0791[_0xd967('0x49')]));if(_0x116fa8&&_0x116fa8['monitor_format']){logger[_0xd967('0x11')](_0xd967('0x4a'),_0xd967('0x4b'));_0x1c0791[_0xd967('0x4c')]=_0x681a0c;}else if(_0x3a158b&&_0x3a158b[_0xd967('0x4d')]&&_0x3a158b[_0xd967('0x4d')]!==_0xd967('0x4e')){logger['info'](_0xd967('0x4f'),'Recording\x20is\x20enabled!');_0x1c0791[_0xd967('0x4c')]=_0x681a0c;}else{_0x1c0791[_0xd967('0x4c')]='';}return getAdminId(_0x3816b6,_0x5080b7,_0x35bd55,_0x393bb3)[_0xd967('0xd')](getUser(_0x5080b7,_0x35bd55,_0x393bb3))[_0xd967('0xd')](getEndUser(_0x5080b7,_0x35bd55,_0x393bb3))['then'](getTicket(_0x5080b7,_0x35bd55,_0x393bb3,_0x302ebd,_0x1c0791))[_0xd967('0xd')](function(_0x3abaee){logger[_0xd967('0x11')](util[_0xd967('0x25')](_0xd967('0x50'),_0x3abaee[_0xd967('0x36')]));if(_0x5080b7!==_0xd967('0x51')){logger[_0xd967('0x11')]('['+[_0x5080b7[_0xd967('0x16')]()]+']',_0xd967('0x52'));emit(_0x393bb3,_0x37c58c[_0xd967('0x53')],_0x3abaee[_0xd967('0x28')]);}})[_0xd967('0x14')](function(_0x49cf22){logger[_0xd967('0x15')]('['+[_0x5080b7[_0xd967('0x16')]()]+_0xd967('0x54'),util[_0xd967('0x55')](_0x49cf22,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xee1d=['stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','outbound','destcalleridnum','callDirection','queue','unmanaged','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name','lodash','request-promise','util','moment','bluebird','ioredis','./util','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','then','users','length','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','User\x20found:','Admin\x20selected','adminEmail','catch','&f=','find','contacts','format','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','contactNumber','Contact\x20found\x20work_number:','Contact\x20created:','POST','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','message','Creating\x20new\x20task','/api/tasks','Subjects','Contact','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey'];(function(_0x49d1b8,_0x17facf){var _0xb7e5e0=function(_0x2f5e99){while(--_0x2f5e99){_0x49d1b8['push'](_0x49d1b8['shift']());}};_0xb7e5e0(++_0x17facf);}(_0xee1d,0x1db));var _0xdee1=function(_0x5ab9cf,_0x1dfc04){_0x5ab9cf=_0x5ab9cf-0x0;var _0x37ac99=_0xee1d[_0x5ab9cf];return _0x37ac99;};'use strict';var _=require(_0xdee1('0x0'));var rp=require(_0xdee1('0x1'));var md5=require('md5');var util=require(_0xdee1('0x2'));var moment=require(_0xdee1('0x3'));var Promise=require(_0xdee1('0x4'));var Redis=require(_0xdee1('0x5'));var intUtil=require(_0xdee1('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xdee1('0x7'));config[_0xdee1('0x8')]=_['defaults'](config[_0xdee1('0x8')],{'host':_0xdee1('0x9'),'port':0x18eb});var io=require(_0xdee1('0xa'))(new Redis(config[_0xdee1('0x8')]));function getAdminId(_0x3ad5af,_0x28000a,_0x4a1ad4,_0x230efe){return new Promise(function(_0x3b29e0,_0x35a347){var _0x213c50=![];var _0x2d3ef3={'method':_0xdee1('0xb'),'uri':_0x230efe+_0xdee1('0xc'),'json':!![]};_0x2d3ef3[_0xdee1('0xd')]=_0x4a1ad4;logger[_0xdee1('0xe')]('Getting\x20admin\x20information');return rp(_0x2d3ef3)[_0xdee1('0xf')](function(_0x5ed256){if(_0x5ed256){var _0x157864=_0x5ed256[_0xdee1('0x10')];var _0x3ec73a=null;for(_0x3ec73a=0x0;_0x3ec73a<_0x157864[_0xdee1('0x11')];_0x3ec73a++){if(_0x157864[_0x3ec73a]['email']===_0x3ad5af['adminEmail']){_0x3ad5af[_0xdee1('0x12')]=_0x157864[_0x3ec73a]['id'];_0x213c50=!![];}}if(_0x213c50){logger['info'](_0xdee1('0x13'),_0x3ad5af['adminId']);_0x3b29e0(_0x3ad5af);}else{_0x35a347({'statusCode':0x194,'message':_0xdee1('0x14')});}}else{_0x35a347({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x137db4){logger[_0xdee1('0x15')]('['+[_0x28000a[_0xdee1('0x16')]()]+']',_0x137db4['message']);_0x35a347(_0x137db4);});});}function getUser(_0xb1fb8d,_0x3e3f07,_0x226308){return function(_0x2ecf6e){return new Promise(function(_0x483eae,_0xae3729){var _0x526657={'method':'GET','uri':_0x226308+'/api/selector/owners','json':!![]};_0x526657[_0xdee1('0xd')]=_0x3e3f07;logger[_0xdee1('0xe')]('Getting\x20user\x20list');return rp(_0x526657)[_0xdee1('0xf')](function(_0x65860c){if(_0x65860c){var _0x206749=_0x65860c[_0xdee1('0x10')];var _0x25e19f=![];var _0x99c328=null;if(_0x2ecf6e[_0xdee1('0x17')]!==null){logger[_0xdee1('0xe')](_0xdee1('0x18'),_0x2ecf6e[_0xdee1('0x17')]);_0x2ecf6e[_0xdee1('0x19')]=_0x2ecf6e[_0xdee1('0x17')];for(_0x99c328=0x0;_0x99c328<_0x206749[_0xdee1('0x11')];_0x99c328++){if(_0x206749[_0x99c328][_0xdee1('0x1a')]===_0x2ecf6e[_0xdee1('0x17')]){_0x25e19f=!![];_0x2ecf6e[_0xdee1('0x1b')]=_0x206749[_0x99c328]['id'];logger[_0xdee1('0xe')](_0xdee1('0x1c'),_0x2ecf6e[_0xdee1('0x1b')]);}}}if(!_0x25e19f){logger[_0xdee1('0xe')](_0xdee1('0x1d'));_0x2ecf6e['userEmail']=_0x2ecf6e[_0xdee1('0x1e')];_0x2ecf6e['userId']=_0x2ecf6e[_0xdee1('0x12')];_0x25e19f=!![];}if(_0x25e19f){_0x483eae(_0x2ecf6e);}else{_0xae3729({'statusCode':0x194,'message':_0xdee1('0x14')});}}else{_0xae3729({'statusCode':0x194,'message':_0xdee1('0x14')});}})[_0xdee1('0x1f')](function(_0x84d825){logger['error']('['+[_0xb1fb8d[_0xdee1('0x16')]()]+']',_0x84d825['message']);_0xae3729(_0x84d825);});});};}function searchContact(_0x1f39b6,_0x212e24,_0x3a75c0,_0xd3b3e2){return new Promise(function(_0x2bb5c4,_0x458425){var _0x4e36e1={'method':_0xdee1('0xb'),'headers':_0x212e24,'uri':_0x1f39b6+'/api/lookup?q='+_0xd3b3e2+_0xdee1('0x20')+_0x3a75c0+'&entities=contact','json':!![]};rp(_0x4e36e1)[_0xdee1('0xf')](function(_0x18ce8e){var _0x4c2793=_[_0xdee1('0x21')](_0x18ce8e[_0xdee1('0x22')][_0xdee1('0x22')],[_0x3a75c0,_0xd3b3e2]);_0x2bb5c4(_0x4c2793);})[_0xdee1('0x1f')](function(_0x491c9a){_0x458425(_0x491c9a);});});}function getEndUser(_0x3bfeaa,_0x414760,_0x323f0d){return function(_0x194b39){return new Promise(function(_0x1ea65a,_0x2ba333){logger['info'](util[_0xdee1('0x23')]('Searching\x20contact\x20with\x20phone\x20%s',_0x194b39['contactNumber']));searchContact(_0x323f0d,_0x414760,_0xdee1('0x24'),_0x194b39['contactNumber'])[_0xdee1('0xf')](function(_0x1eaa82){if(_0x1eaa82){_0x194b39[_0xdee1('0x25')]=_0x1eaa82['id'];logger[_0xdee1('0xe')](_0xdee1('0x26'),_0x194b39[_0xdee1('0x25')]);return _0x1ea65a(_0x194b39);}searchContact(_0x323f0d,_0x414760,_0xdee1('0x27'),_0x194b39[_0xdee1('0x28')])[_0xdee1('0xf')](function(_0x2ee27d){if(_0x2ee27d){_0x194b39[_0xdee1('0x25')]=_0x2ee27d['id'];logger[_0xdee1('0xe')](_0xdee1('0x29'),_0x194b39['endUserId']);return _0x1ea65a(_0x194b39);}createEndUser(_0x194b39,_0x3bfeaa,_0x414760,_0x323f0d)[_0xdee1('0xf')](function(_0x7f31d6){logger['info'](_0xdee1('0x2a'),_0x7f31d6[_0xdee1('0x25')]);return _0x1ea65a(_0x7f31d6);});});})['catch'](function(_0x758bc3){_0x2ba333(_0x758bc3);});});};}function createEndUser(_0x1a9a64,_0x57e121,_0x45c897,_0x5aa337){return new Promise(function(_0x388063,_0x109009){var _0xd8b45a=moment();var _0x55e851={'method':_0xdee1('0x2b'),'uri':_0x5aa337+'/api/contacts','body':{'contact':{'last_name':_0x1a9a64['contactNumber'],'work_number':_0x1a9a64['contactNumber'],'mobile_number':_0x1a9a64[_0xdee1('0x28')],'owner_id':_0x1a9a64[_0xdee1('0x1b')],'created_at':_0xd8b45a[_0xdee1('0x23')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x55e851['headers']=_0x45c897;logger[_0xdee1('0xe')](_0xdee1('0x2c'));return rp(_0x55e851)[_0xdee1('0xf')](function(_0x5c0b3b){_0x1a9a64[_0xdee1('0x25')]=_0x5c0b3b['contact']['id'];_0x388063(_0x1a9a64);})[_0xdee1('0x1f')](function(_0x4e73ab){logger[_0xdee1('0x15')]('['+[_0x57e121[_0xdee1('0x16')]()]+']',_0x4e73ab['message']);_0x109009(_0x4e73ab[_0xdee1('0x2d')]);});});}function getTicket(_0x1cd395,_0x42a5c7,_0x1eae94,_0x7d12f0,_0x1b972b){return function(_0x5d51a9){logger[_0xdee1('0xe')](_0xdee1('0x2e'));return new Promise(function(_0x532768,_0x530508){var _0xecab04=moment();var _0x50b34d={'method':_0xdee1('0x2b'),'uri':_0x1eae94+_0xdee1('0x2f'),'body':{'title':intUtil['getString'](_0x7d12f0[_0xdee1('0x30')],_0x1b972b,'\x20'),'description':intUtil['getString'](_0x7d12f0['Descriptions'],_0x1b972b,'\x0a'),'owner_id':_0x5d51a9[_0xdee1('0x1b')],'creater_id':_0x5d51a9[_0xdee1('0x12')],'targetable_id':_0x5d51a9[_0xdee1('0x25')],'targetable_type':_0xdee1('0x31'),'created_at':_0xecab04[_0xdee1('0x23')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0xecab04['add'](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x50b34d[_0xdee1('0xd')]=_0x42a5c7;return rp(_0x50b34d)[_0xdee1('0xf')](function(_0x5bc154){_0x5d51a9['ticketId']=_0x5bc154['task']['id'];logger[_0xdee1('0xe')]('Task\x20created:',_0x5d51a9[_0xdee1('0x32')]);_0x532768(_0x5d51a9);})[_0xdee1('0x1f')](function(_0x5757bd){logger[_0xdee1('0x15')]('['+[_0x1cd395[_0xdee1('0x16')]()]+']',_0x5757bd[_0xdee1('0x2d')]);_0x530508(_0x5757bd['message']);});});};}function emit(_0x2be3c5,_0x43001b,_0x43ed54){var _0x47a06c={'uri':_0x2be3c5+_0xdee1('0x33')+_0x43ed54};io['to'](util[_0xdee1('0x23')](_0xdee1('0x34'),_0x43001b))[_0xdee1('0x35')](_0xdee1('0x36'),_0x47a06c);}exports['cs']=function(_0x27c19c,_0x515bcd,_0x22ec08,_0xb2aeee,_0x49da63,_0x179cee,_0x520508,_0x3244c0){var _0x2cc644={};var _0x8020a0={'Authorization':_0xdee1('0x37')+_0x179cee[_0xdee1('0x38')]};_0x179cee['remoteUri']=intUtil[_0xdee1('0x39')](_0x179cee[_0xdee1('0x3a')]);_0x179cee[_0xdee1('0x3b')]=intUtil[_0xdee1('0x39')](_0x179cee['serverUrl']);var _0x1e9625=_0x179cee['remoteUri'];_0x2cc644[_0xdee1('0x1e')]=_0x179cee[_0xdee1('0x3c')];_0x2cc644[_0xdee1('0x28')]=_0x3244c0[_0xdee1('0x3d')]()===_0xdee1('0x3e')?_0x515bcd[_0xdee1('0x3f')]:_0x515bcd['calleridnum'];_0x2cc644[_0xdee1('0x40')]=_0x3244c0===_0xdee1('0x41')||_0x3244c0===_0xdee1('0x42')?_0xdee1('0x41'):_0xdee1('0x3e');if(_0xb2aeee){_0x2cc644[_0xdee1('0x17')]=_0xb2aeee[_0xdee1('0x1a')];}var _0x46cb3b=util[_0xdee1('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x179cee[_0xdee1('0x3b')],_0x515bcd['uniqueid'],md5(_0x515bcd['uniqueid']));if(_0x49da63&&_0x49da63[_0xdee1('0x43')]){logger[_0xdee1('0xe')](_0xdee1('0x44'),_0xdee1('0x45'));_0x515bcd[_0xdee1('0x46')]=_0x46cb3b;}else if(_0x520508&&_0x520508['recordingFormat']&&_0x520508[_0xdee1('0x47')]!==_0xdee1('0x48')){logger[_0xdee1('0xe')](_0xdee1('0x49'),_0xdee1('0x45'));_0x515bcd['recordingURL']=_0x46cb3b;}else{_0x515bcd[_0xdee1('0x46')]='';}return getAdminId(_0x2cc644,_0x3244c0,_0x8020a0,_0x1e9625)[_0xdee1('0xf')](getUser(_0x3244c0,_0x8020a0,_0x1e9625))[_0xdee1('0xf')](getEndUser(_0x3244c0,_0x8020a0,_0x1e9625))[_0xdee1('0xf')](getTicket(_0x3244c0,_0x8020a0,_0x1e9625,_0x22ec08,_0x515bcd))[_0xdee1('0xf')](function(_0x366d55){logger[_0xdee1('0xe')](util['format'](_0xdee1('0x4a'),_0x366d55[_0xdee1('0x32')]));if(_0x3244c0!==_0xdee1('0x42')){logger[_0xdee1('0xe')]('['+[_0x3244c0['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x1e9625,_0xb2aeee[_0xdee1('0x4b')],_0x366d55[_0xdee1('0x25')]);}})[_0xdee1('0x1f')](function(_0x3d3c3e){logger['error']('['+[_0x3244c0[_0xdee1('0x16')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x3d3c3e,{'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 c150e3b..7bc55b6 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 _0x0e3f=['dynamics365','servicenow','exec','data1','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','toLowerCase','zendesk','salesforce','zoho','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm','freshdesk','desk'];(function(_0x4cba56,_0x5b2c44){var _0x3cc9f3=function(_0x5bb80a){while(--_0x5bb80a){_0x4cba56['push'](_0x4cba56['shift']());}};_0x3cc9f3(++_0x5b2c44);}(_0x0e3f,0x7f));var _0xf0e3=function(_0x579da9,_0x4e98f7){_0x579da9=_0x579da9-0x0;var _0x3fcafb=_0x0e3f[_0x579da9];return _0x3fcafb;};'use strict';var _=require('lodash');var util=require(_0xf0e3('0x0'));var zendesk=require(_0xf0e3('0x1'));var salesforce=require(_0xf0e3('0x2'));var sugarcrm=require(_0xf0e3('0x3'));var freshdesk=require(_0xf0e3('0x4'));var zoho=require(_0xf0e3('0x5'));var desk=require('./desk');var vtiger=require(_0xf0e3('0x6'));var servicenow=require(_0xf0e3('0x7'));var dynamics365=require(_0xf0e3('0x8'));var freshsales=require(_0xf0e3('0x9'));var integrations=['zendesk','salesforce',_0xf0e3('0xa'),_0xf0e3('0xb'),'zoho',_0xf0e3('0xc'),'vtiger',_0xf0e3('0xd'),'freshsales',_0xf0e3('0xe')];exports[_0xf0e3('0xf')]=function(_0x3cd310,_0x521460,_0x368608,_0x23f241,_0x3f0261,_0x52ffbf){if(_0x368608){if(_['includes'](integrations,_0x3cd310[_0xf0e3('0x10')]['toLowerCase']())){try{var _0x356000=null;var _0x169a03='';var _0x58d146=_0x368608[_0x3cd310[_0xf0e3('0x10')]['toLowerCase']()];if(_0x58d146){var _0x198632=_0x58d146[_0x3cd310['data2']];if(_0x198632){var _0x328e60=_[_0xf0e3('0x11')](_0x198632[_0xf0e3('0x12')],{'id':parseInt(_0x3cd310[_0xf0e3('0x13')],0xa)});if(_0x328e60){if(_0x23f241){if(_0x3f0261&&_0x521460[_0xf0e3('0x14')]){_0x169a03=_0xf0e3('0x14');}else if(_0x521460['routeId']){_0x169a03=_0xf0e3('0x15');}else{console[_0xf0e3('0x16')](_0xf0e3('0x17'),_0x521460);}}else{_0x169a03=_0xf0e3('0x18');}switch(_0x3cd310[_0xf0e3('0x10')][_0xf0e3('0x19')]()){case _0xf0e3('0x1a'):zendesk[_0x169a03](_0x3cd310,_0x521460,_0x328e60,_0x23f241,_0x3f0261,_0x198632,_0x52ffbf);break;case _0xf0e3('0x1b'):salesforce[_0x169a03](_0x3cd310,_0x521460,_0x328e60,_0x23f241,_0x3f0261,_0x198632,_0x52ffbf);break;case'sugarcrm':sugarcrm[_0x169a03](_0x3cd310,_0x521460,_0x328e60,_0x23f241,_0x3f0261,_0x198632,_0x52ffbf);break;case _0xf0e3('0xb'):freshdesk[_0x169a03](_0x3cd310,_0x521460,_0x328e60,_0x23f241,_0x3f0261,_0x198632,_0x52ffbf);break;case _0xf0e3('0x1c'):zoho[_0x169a03](_0x3cd310,_0x521460,_0x328e60,_0x23f241,_0x3f0261,_0x198632,_0x52ffbf);break;case _0xf0e3('0xc'):desk[_0x169a03](_0x3cd310,_0x521460,_0x328e60,_0x23f241,_0x3f0261,_0x198632,_0x52ffbf);break;case'vtiger':vtiger[_0x169a03](_0x3cd310,_0x521460,_0x328e60,_0x23f241,_0x3f0261,_0x198632,_0x52ffbf);break;case'freshsales':freshsales['cs'](_0x3cd310,_0x521460,_0x328e60,_0x23f241,_0x3f0261,_0x198632,_0x52ffbf,_0x169a03);break;case'servicenow':servicenow['cs'](_0x3cd310,_0x521460,_0x328e60,_0x23f241,_0x3f0261,_0x198632,_0x52ffbf,_0x169a03);break;case _0xf0e3('0xd'):dynamics365['cs'](_0x3cd310,_0x521460,_0x328e60,_0x23f241,_0x3f0261,_0x198632,_0x52ffbf,_0x169a03);break;default:console['log']('unknown\x20integration');}}else{_0x356000=require(_0xf0e3('0x1d'))(_0x3cd310['data1'][_0xf0e3('0x19')]());_0x356000[_0xf0e3('0x1e')](_0xf0e3('0x1f'),util[_0xf0e3('0x20')](_0xf0e3('0x21'),_0x3cd310[_0xf0e3('0x10')]['toLowerCase'](),_0x3cd310[_0xf0e3('0x13')]));}}else{_0x356000=require(_0xf0e3('0x1d'))(_0x3cd310['data1'][_0xf0e3('0x19')]());_0x356000[_0xf0e3('0x1e')](_0xf0e3('0x1f'),util[_0xf0e3('0x20')](_0xf0e3('0x22'),_0x3cd310[_0xf0e3('0x10')][_0xf0e3('0x19')](),_0x3cd310['data2']));}}else{}}catch(_0x17ef61){console[_0xf0e3('0x1e')](_0x17ef61);}}}}; \ No newline at end of file +var _0xf5e6=['./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','freshsales','unknown\x20integration','error','[EXEC]','format','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./freshdesk','./zoho','./desk'];(function(_0x2e5f1e,_0x212c36){var _0x519a18=function(_0x9871d0){while(--_0x9871d0){_0x2e5f1e['push'](_0x2e5f1e['shift']());}};_0x519a18(++_0x212c36);}(_0xf5e6,0x132));var _0x6f5e=function(_0x1f4295,_0x5d0590){_0x1f4295=_0x1f4295-0x0;var _0x39070e=_0xf5e6[_0x1f4295];return _0x39070e;};'use strict';var _=require(_0x6f5e('0x0'));var util=require(_0x6f5e('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x6f5e('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x6f5e('0x3'));var zoho=require(_0x6f5e('0x4'));var desk=require(_0x6f5e('0x5'));var vtiger=require(_0x6f5e('0x6'));var servicenow=require(_0x6f5e('0x7'));var dynamics365=require(_0x6f5e('0x8'));var freshsales=require(_0x6f5e('0x9'));var integrations=[_0x6f5e('0xa'),_0x6f5e('0xb'),_0x6f5e('0xc'),_0x6f5e('0xd'),_0x6f5e('0xe'),_0x6f5e('0xf'),_0x6f5e('0x10'),_0x6f5e('0x11'),'freshsales',_0x6f5e('0x12')];exports[_0x6f5e('0x13')]=function(_0x21bcfb,_0x451ddc,_0x543d7a,_0x2d8a4f,_0x4c026e,_0x1c417f){if(_0x543d7a){if(_[_0x6f5e('0x14')](integrations,_0x21bcfb[_0x6f5e('0x15')][_0x6f5e('0x16')]())){try{var _0xe08c07=null;var _0x1a11e8='';var _0x111907=_0x543d7a[_0x21bcfb[_0x6f5e('0x15')][_0x6f5e('0x16')]()];if(_0x111907){var _0x29ac47=_0x111907[_0x21bcfb[_0x6f5e('0x17')]];if(_0x29ac47){var _0x546c71=_[_0x6f5e('0x18')](_0x29ac47[_0x6f5e('0x19')],{'id':parseInt(_0x21bcfb[_0x6f5e('0x1a')],0xa)});if(_0x546c71){if(_0x2d8a4f){if(_0x4c026e&&_0x451ddc[_0x6f5e('0x1b')]){_0x1a11e8=_0x6f5e('0x1b');}else if(_0x451ddc[_0x6f5e('0x1c')]){_0x1a11e8='outbound';}else{console[_0x6f5e('0x1d')](_0x6f5e('0x1e'),_0x451ddc);}}else{_0x1a11e8=_0x6f5e('0x1f');}switch(_0x21bcfb['data1'][_0x6f5e('0x16')]()){case _0x6f5e('0xa'):zendesk[_0x1a11e8](_0x21bcfb,_0x451ddc,_0x546c71,_0x2d8a4f,_0x4c026e,_0x29ac47,_0x1c417f);break;case _0x6f5e('0xb'):salesforce[_0x1a11e8](_0x21bcfb,_0x451ddc,_0x546c71,_0x2d8a4f,_0x4c026e,_0x29ac47,_0x1c417f);break;case'sugarcrm':sugarcrm[_0x1a11e8](_0x21bcfb,_0x451ddc,_0x546c71,_0x2d8a4f,_0x4c026e,_0x29ac47,_0x1c417f);break;case _0x6f5e('0xd'):freshdesk[_0x1a11e8](_0x21bcfb,_0x451ddc,_0x546c71,_0x2d8a4f,_0x4c026e,_0x29ac47,_0x1c417f);break;case'zoho':zoho[_0x1a11e8](_0x21bcfb,_0x451ddc,_0x546c71,_0x2d8a4f,_0x4c026e,_0x29ac47,_0x1c417f);break;case _0x6f5e('0xf'):desk[_0x1a11e8](_0x21bcfb,_0x451ddc,_0x546c71,_0x2d8a4f,_0x4c026e,_0x29ac47,_0x1c417f);break;case _0x6f5e('0x10'):vtiger[_0x1a11e8](_0x21bcfb,_0x451ddc,_0x546c71,_0x2d8a4f,_0x4c026e,_0x29ac47,_0x1c417f);break;case _0x6f5e('0x20'):freshsales['cs'](_0x21bcfb,_0x451ddc,_0x546c71,_0x2d8a4f,_0x4c026e,_0x29ac47,_0x1c417f,_0x1a11e8);break;case _0x6f5e('0x12'):servicenow['cs'](_0x21bcfb,_0x451ddc,_0x546c71,_0x2d8a4f,_0x4c026e,_0x29ac47,_0x1c417f,_0x1a11e8);break;case _0x6f5e('0x11'):dynamics365['cs'](_0x21bcfb,_0x451ddc,_0x546c71,_0x2d8a4f,_0x4c026e,_0x29ac47,_0x1c417f,_0x1a11e8);break;default:console[_0x6f5e('0x1d')](_0x6f5e('0x21'));}}else{_0xe08c07=require('../../../../config/logger')(_0x21bcfb['data1'][_0x6f5e('0x16')]());_0xe08c07[_0x6f5e('0x22')](_0x6f5e('0x23'),util[_0x6f5e('0x24')]('%s\x20configuration\x20#%s\x20not\x20found',_0x21bcfb[_0x6f5e('0x15')]['toLowerCase'](),_0x21bcfb[_0x6f5e('0x1a')]));}}else{_0xe08c07=require(_0x6f5e('0x25'))(_0x21bcfb[_0x6f5e('0x15')][_0x6f5e('0x16')]());_0xe08c07['error'](_0x6f5e('0x23'),util[_0x6f5e('0x24')](_0x6f5e('0x26'),_0x21bcfb[_0x6f5e('0x15')][_0x6f5e('0x16')](),_0x21bcfb[_0x6f5e('0x17')]));}}else{}}catch(_0x1978d6){console[_0x6f5e('0x22')](_0x1978d6);}}}}; \ 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 00c1587..6270a98 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 _0xa567=['serverUrl','stripTrailingSlash','monitor_format','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','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Descriptions','Task','ActivityDate','utc','IsReminderSet','contact','endUserType','WhoId','account','ticketType','Case','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','Email','info','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','additionalSearchLead','$or','account_contact_lead','additionalSearchAccount','Account','length','Lead','first','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','No\x20Company','upperFirst','forEach','string','picklist','type','idField','content','toString','variable','variableName','Variable','name','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','queue'];(function(_0x141ecf,_0x3509b9){var _0x279462=function(_0x3ed681){while(--_0x3ed681){_0x141ecf['push'](_0x141ecf['shift']());}};_0x279462(++_0x3509b9);}(_0xa567,0xa5));var _0x7a56=function(_0x5d4e45,_0x3ee978){_0x5d4e45=_0x5d4e45-0x0;var _0x39d238=_0xa567[_0x5d4e45];return _0x39d238;};'use strict';var _=require(_0x7a56('0x0'));var rp=require(_0x7a56('0x1'));var moment=require(_0x7a56('0x2'));var BPromise=require(_0x7a56('0x3'));var md5=require(_0x7a56('0x4'));var jsforce=require(_0x7a56('0x5'));var util=require('util');var Redis=require(_0x7a56('0x6'));var intUtil=require(_0x7a56('0x7'));var config=require('../../../../config/environment');var logger=require(_0x7a56('0x8'))('salesforce');config[_0x7a56('0x9')]=_[_0x7a56('0xa')](config[_0x7a56('0x9')],{'host':_0x7a56('0xb'),'port':0x18eb});var io=require(_0x7a56('0xc'))(new Redis(config['redis']));function emit(_0xb375e7,_0x2a51e8,_0x4d4f4b){io['to'](_0xb375e7)[_0x7a56('0xd')](_0x2a51e8,_0x4d4f4b);}function getTicket(_0x5de559,_0x1b23b4,_0x491e5d,_0x35375c,_0x540620,_0x341e51,_0x21fe18,_0xb86f2e){var _0x56dbf9=Object[_0x7a56('0xe')]({},{'OwnerId':_0x1b23b4['id'],'Subject':intUtil[_0x7a56('0xf')](_0x35375c['Subjects'],_0x540620,'\x20'),'Description':intUtil['getString'](_0x35375c[_0x7a56('0x10')],_0x540620,'\x0a')},getCustomFields(_0x341e51,_0x540620));if(_0x491e5d){if(_0x35375c['ticketType']===_0x7a56('0x11')){_0x56dbf9[_0x7a56('0x12')]=moment[_0x7a56('0x13')]();_0x56dbf9[_0x7a56('0x14')]=![];_0x56dbf9['IsRecurrence']=![];if(_0x491e5d['endUserType']===_0x7a56('0x15')||_0x491e5d[_0x7a56('0x16')]==='lead'){_0x56dbf9[_0x7a56('0x17')]=_0x491e5d['id'];}else if(_0x491e5d['endUserType']===_0x7a56('0x18')){_0x56dbf9['WhatId']=_0x491e5d['id'];}}else if(_0x35375c[_0x7a56('0x19')]===_0x7a56('0x1a')){if(_0x491e5d[_0x7a56('0x16')]==='contact'){_0x56dbf9['ContactId']=_0x491e5d['id'];}else if(_0x491e5d[_0x7a56('0x16')]===_0x7a56('0x18')){_0x56dbf9['AccountId']=_0x491e5d['id'];}else if(_0x491e5d['endUserType']===_0x7a56('0x1b')&&_0x35375c[_0x7a56('0x1c')]){_0x56dbf9[_0x35375c[_0x7a56('0x1c')]]=_0x491e5d['id'];}else{logger['info'](_0x7a56('0x1d'));}}}return _0x21fe18[_0x7a56('0x1e')](_0x35375c[_0x7a56('0x19')])[_0x7a56('0x1f')](_0x56dbf9);}function getUser(_0x10eec6,_0x279d6f,_0x191176){if(!_[_0x7a56('0x20')](_0x279d6f)&&intUtil[_0x7a56('0x21')](_0x279d6f)){var _0x4afe0d={'Email':_0x279d6f};var _0x36fd4f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x191176[_0x7a56('0x1e')](_0x7a56('0x22'))[_0x7a56('0x23')](_0x4afe0d,_0x36fd4f)[_0x7a56('0x24')]()[_0x7a56('0x25')](function(_0x8daae5){if(_0x8daae5['length']){var _0x44e796=_[_0x7a56('0x23')](_0x8daae5,function(_0x1596a4){return _0x1596a4[_0x7a56('0x26')]===_0x279d6f;});if(_0x44e796){logger[_0x7a56('0x27')](_0x7a56('0x28'),_0x279d6f);return BPromise['resolve']({'id':_0x44e796['Id'],'name':_0x44e796[_0x7a56('0x29')]});}}else{logger[_0x7a56('0x27')](_0x7a56('0x2a'),_0x279d6f);return _0x191176['identity']()[_0x7a56('0x25')](function(_0x504c72){return BPromise[_0x7a56('0x2b')]({'id':_0x504c72[_0x7a56('0x2c')],'name':_0x504c72[_0x7a56('0x2d')]});});}});}else{logger[_0x7a56('0x27')](_0x7a56('0x2a'),_0x279d6f);return _0x191176[_0x7a56('0x2e')]()[_0x7a56('0x25')](function(_0x35668e){return BPromise[_0x7a56('0x2b')]({'id':_0x35668e['user_id'],'name':_0x35668e[_0x7a56('0x2d')]});});}}function getEndUser(_0x2be52c,_0x15c788,_0x4b5218,_0x42a699,_0x3c9760){var _0x28b8e1={'$or':{'Phone':_0x42a699}};var _0x201825={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7a56('0x2b')]()[_0x7a56('0x25')](function(){logger[_0x7a56('0x27')](_0x7a56('0x2f'),_0x42a699,_0x15c788['moduleSearch']);switch(_0x15c788[_0x7a56('0x30')]){case _0x7a56('0x31'):var _0x2f8a00=_[_0x7a56('0x32')](_0x28b8e1);if(_0x15c788['additionalSearchContact']){var _0x268a40={};_0x268a40[_0x15c788[_0x7a56('0x33')]]=_0x42a699;_[_0x7a56('0x34')](_0x2f8a00['$or'],_0x268a40);}return _0x3c9760[_0x7a56('0x1e')](_0x7a56('0x35'))[_0x7a56('0x23')](_0x2f8a00,_0x201825)[_0x7a56('0x24')]()[_0x7a56('0x25')](function(_0x3b9c3d){if(_0x3b9c3d&&_0x3b9c3d['length']){return _0x3b9c3d;}else{var _0x430e84=_['cloneDeep'](_0x28b8e1);if(_0x15c788['additionalSearchLead']){var _0x5d5a19={};_0x5d5a19[_0x15c788[_0x7a56('0x36')]]=_0x42a699;_[_0x7a56('0x34')](_0x430e84[_0x7a56('0x37')],_0x5d5a19);}return _0x3c9760[_0x7a56('0x1e')]('Lead')[_0x7a56('0x23')](_0x430e84,_0x201825);}});case _0x7a56('0x38'):var _0x43a77a=_[_0x7a56('0x32')](_0x28b8e1);if(_0x15c788['additionalSearchAccount']){var _0x268a40={};_0x268a40[_0x15c788[_0x7a56('0x39')]]=_0x42a699;_[_0x7a56('0x34')](_0x43a77a[_0x7a56('0x37')],_0x268a40);}return _0x3c9760[_0x7a56('0x1e')](_0x7a56('0x3a'))[_0x7a56('0x23')](_0x43a77a,_0x201825)['execute']()['then'](function(_0x54e2dc){if(_0x54e2dc&&_0x54e2dc[_0x7a56('0x3b')]){return _0x54e2dc;}else{var _0x20ae86=_[_0x7a56('0x32')](_0x28b8e1);if(_0x15c788[_0x7a56('0x33')]){var _0x4ca92a={};_0x4ca92a[_0x15c788['additionalSearchContact']]=_0x42a699;_['merge'](_0x20ae86['$or'],_0x4ca92a);}return _0x3c9760[_0x7a56('0x1e')]('Contact')[_0x7a56('0x23')](_0x20ae86,_0x201825)[_0x7a56('0x25')](function(_0x6b093){if(_0x6b093&&_0x6b093[_0x7a56('0x3b')]){return _0x6b093;}else{var _0x4bcc8e=_[_0x7a56('0x32')](_0x28b8e1);if(_0x15c788[_0x7a56('0x36')]){var _0x123150={};_0x123150[_0x15c788[_0x7a56('0x36')]]=_0x42a699;_[_0x7a56('0x34')](_0x4bcc8e[_0x7a56('0x37')],_0x123150);}return _0x3c9760['sobject'](_0x7a56('0x3c'))[_0x7a56('0x23')](_0x4bcc8e,_0x201825);}});}});case _0x7a56('0x15'):var _0x2f8a00=_[_0x7a56('0x32')](_0x28b8e1);if(_0x15c788[_0x7a56('0x33')]){var _0x268a40={};_0x268a40[_0x15c788['additionalSearchContact']]=_0x42a699;_[_0x7a56('0x34')](_0x2f8a00[_0x7a56('0x37')],_0x268a40);}return _0x3c9760[_0x7a56('0x1e')](_0x7a56('0x35'))[_0x7a56('0x23')](_0x2f8a00,_0x201825)[_0x7a56('0x24')]();case _0x7a56('0x1b'):var _0x250bb0=_[_0x7a56('0x32')](_0x28b8e1);if(_0x15c788[_0x7a56('0x36')]){var _0x268a40={};_0x268a40[_0x15c788[_0x7a56('0x36')]]=_0x42a699;_[_0x7a56('0x34')](_0x250bb0[_0x7a56('0x37')],_0x268a40);}return _0x3c9760[_0x7a56('0x1e')](_0x7a56('0x3c'))[_0x7a56('0x23')](_0x250bb0,_0x201825);case _0x7a56('0x18'):var _0x43a77a=_[_0x7a56('0x32')](_0x28b8e1);if(_0x15c788[_0x7a56('0x39')]){var _0x268a40={};_0x268a40[_0x15c788[_0x7a56('0x39')]]=_0x42a699;_[_0x7a56('0x34')](_0x43a77a[_0x7a56('0x37')],_0x268a40);}return _0x3c9760['sobject'](_0x7a56('0x3a'))['find'](_0x43a77a,_0x201825);default:return null;}})[_0x7a56('0x25')](function(_0x8074bd){if(_0x8074bd&&_0x8074bd['length']){var _0x76c38e=_[_0x7a56('0x3d')](_0x8074bd);if(_0x76c38e){return BPromise['resolve']({'id':_0x76c38e['Id'],'name':_0x76c38e[_0x7a56('0x29')],'phone':_0x76c38e[_0x7a56('0x3e')],'endUserType':_0x76c38e[_0x7a56('0x3f')]['type'][_0x7a56('0x40')]()});}}})['then'](function(_0x3a2549){if(_0x3a2549){logger[_0x7a56('0x27')](_0x7a56('0x41'),_0x3a2549[_0x7a56('0x16')],_0x42a699);return BPromise['resolve'](_0x3a2549);}else{logger[_0x7a56('0x27')](_0x7a56('0x42'),_0x42a699);var _0xecdd28={'Phone':_0x42a699};if(_0x15c788[_0x7a56('0x43')]){if(_0x15c788[_0x7a56('0x43')]===_0x7a56('0x15')){logger[_0x7a56('0x27')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x42a699,_0x15c788['moduleCreate']);_0xecdd28[_0x7a56('0x44')]=_0x4b5218!==_0x7a56('0x45')?_0x4b5218:util[_0x7a56('0x46')](_0x7a56('0x47'),_0x42a699);}else if(_0x15c788[_0x7a56('0x43')]===_0x7a56('0x1b')){logger[_0x7a56('0x27')](_0x7a56('0x48'),_0x42a699,_0x15c788['moduleCreate']);_0xecdd28[_0x7a56('0x44')]=_0x4b5218!==_0x7a56('0x45')?_0x4b5218:util['format'](_0x7a56('0x47'),_0x42a699);_0xecdd28['Company']=_0x7a56('0x49');}else if(_0x15c788[_0x7a56('0x43')]===_0x7a56('0x18')){logger[_0x7a56('0x27')](_0x7a56('0x48'),_0x42a699,_0x15c788['moduleCreate']);_0xecdd28['Name']=_0x4b5218!==_0x7a56('0x45')?_0x4b5218:util['format'](_0x7a56('0x47'),_0x42a699);}else{return null;}}return _0x3c9760[_0x7a56('0x1e')](_[_0x7a56('0x4a')](_0x15c788[_0x7a56('0x43')]))[_0x7a56('0x1f')](_0xecdd28)[_0x7a56('0x25')](function(_0x2533bc){return BPromise[_0x7a56('0x2b')]({'id':_0x2533bc['id'],'endUserType':_0x15c788[_0x7a56('0x43')]});});}});}function getCustomFields(_0x4903bd,_0x47296e){var _0xb649a2={};if(_0x4903bd[_0x7a56('0x3b')]>0x0){_[_0x7a56('0x4b')](_0x4903bd,function(_0x2a9237){if(_['includes']([_0x7a56('0x4c'),_0x7a56('0x4d')],_0x2a9237[_0x7a56('0x4e')])&&_0x2a9237['idField']){_0xb649a2[_0x2a9237[_0x7a56('0x4f')]]=_0x2a9237[_0x7a56('0x50')][_0x7a56('0x51')]();}else if(_0x2a9237['type']===_0x7a56('0x52')&&_0x2a9237['variableName']&&_0x2a9237['idField']){_0x47296e[_0x2a9237['variableName']]&&(_0xb649a2[_0x2a9237[_0x7a56('0x4f')]]=_0x47296e[_0x2a9237[_0x7a56('0x53')]][_0x7a56('0x51')]());}else if(_0x2a9237[_0x7a56('0x4e')]==='customVariable'&&_0x2a9237['Variable']&&_0x2a9237[_0x7a56('0x54')][_0x7a56('0x55')]&&_0x2a9237['idField']){_0x47296e[_0x2a9237[_0x7a56('0x54')][_0x7a56('0x55')]['toLowerCase']()]&&(_0xb649a2[_0x2a9237['idField']]=_0x47296e[_0x2a9237[_0x7a56('0x54')][_0x7a56('0x55')][_0x7a56('0x40')]()][_0x7a56('0x51')]());}});}return _0xb649a2;}function getConnection(_0x1f7f71){var _0x23fdab=_0x1f7f71['password']['concat'](_0x1f7f71[_0x7a56('0x56')]);var _0x2bd8da=new jsforce[(_0x7a56('0x57'))]({'oauth2':{'loginUrl':_0x1f7f71[_0x7a56('0x58')]||_0x7a56('0x59'),'clientId':_0x1f7f71['clientId'],'clientSecret':_0x1f7f71[_0x7a56('0x5a')]}});return _0x2bd8da[_0x7a56('0x5b')](_0x1f7f71[_0x7a56('0x5c')],_0x23fdab)[_0x7a56('0x25')](function(){logger['info'](_0x7a56('0x5d'));return _0x2bd8da;});}exports[_0x7a56('0x5e')]=function(_0x3ac1a7,_0x2e39fd,_0x36ccb1,_0x407f50,_0xdbc33c,_0x3ad11d){var _0x8d3e9f,_0x367d5d,_0x102878,_0x46dc2d;_0x3ad11d[_0x7a56('0x5f')]=intUtil['stripTrailingSlash'](_0x3ad11d[_0x7a56('0x5f')]);_0x3ad11d[_0x7a56('0x58')]=intUtil[_0x7a56('0x60')](_0x3ad11d['remoteUri']);if(_0xdbc33c&&_0xdbc33c[_0x7a56('0x61')]){logger['info']('[QUEUE]',_0x7a56('0x62'));_0x2e39fd[_0x7a56('0x63')]=util['format'](_0x7a56('0x64'),_0x3ad11d[_0x7a56('0x5f')],_0x2e39fd[_0x7a56('0x65')],md5(_0x2e39fd[_0x7a56('0x65')]));}else{_0x2e39fd['recordingURL']='';}return getConnection(_0x3ad11d)[_0x7a56('0x25')](function(_0x513d74){_0x46dc2d=_0x513d74;return getUser(_0x3ad11d,_0x407f50[_0x7a56('0x66')],_0x46dc2d);})[_0x7a56('0x25')](function(_0x33e6f6){_0x8d3e9f=_0x33e6f6;return getEndUser(_0x3ad11d,_0x36ccb1,_0x2e39fd[_0x7a56('0x67')],_0x2e39fd[_0x7a56('0x68')],_0x46dc2d);})[_0x7a56('0x25')](function(_0x2c306c){_0x367d5d=_0x2c306c;return getTicket(_0x3ad11d,_0x8d3e9f,_0x367d5d,_0x36ccb1,_0x2e39fd,_0x36ccb1[_0x7a56('0x69')],_0x46dc2d,_0x7a56('0x5e'));})[_0x7a56('0x25')](function(_0x53a794){_0x102878=_0x53a794;logger[_0x7a56('0x27')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x102878['id']);logger[_0x7a56('0x27')](_0x7a56('0x6a'),_0x102878['id'],_0x407f50[_0x7a56('0x55')],_0x3ad11d[_0x7a56('0x4e')]);switch(_0x3ad11d[_0x7a56('0x4e')]){case _0x7a56('0x6b'):emit(util[_0x7a56('0x46')](_0x7a56('0x6c'),_0x407f50[_0x7a56('0x55')]),_0x7a56('0x6d'),{'recordId':_0x102878['id']});break;case _0x7a56('0x6e'):emit(util[_0x7a56('0x46')](_0x7a56('0x6c'),_0x407f50[_0x7a56('0x55')]),_0x7a56('0x6f'),{'uri':util['format'](_0x7a56('0x70'),_0x46dc2d[_0x7a56('0x71')],_0x102878['id'])});break;default:logger[_0x7a56('0x72')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x7a56('0x73')](function(_0x4d6f89){logger[_0x7a56('0x72')](_0x7a56('0x74'),_0x4d6f89);});};exports[_0x7a56('0x75')]=function(_0xa06791,_0x1e8392,_0x29be77,_0x51c598,_0x2fee64,_0x51d0bb,_0x2272f7){var _0x642494,_0x704fd3,_0x2da0b5,_0x48bfd9;_0x51d0bb[_0x7a56('0x5f')]=intUtil[_0x7a56('0x60')](_0x51d0bb[_0x7a56('0x5f')]);_0x51d0bb[_0x7a56('0x58')]=intUtil[_0x7a56('0x60')](_0x51d0bb[_0x7a56('0x58')]);if(_0x2272f7&&_0x2272f7['recordingFormat']&&_0x2272f7[_0x7a56('0x76')]!==_0x7a56('0x77')){logger[_0x7a56('0x27')](_0x7a56('0x78'),'Recording\x20is\x20enabled!');_0x1e8392[_0x7a56('0x63')]=util[_0x7a56('0x46')](_0x7a56('0x64'),_0x51d0bb['serverUrl'],_0x1e8392['uniqueid'],md5(_0x1e8392[_0x7a56('0x65')]));}return getConnection(_0x51d0bb)[_0x7a56('0x25')](function(_0x4327a1){_0x48bfd9=_0x4327a1;return getUser(_0x51d0bb,_0x51c598[_0x7a56('0x66')],_0x48bfd9);})['then'](function(_0x32c68a){_0x642494=_0x32c68a;return getEndUser(_0x51d0bb,_0x29be77,_0x1e8392['destcalleridname'],_0x1e8392[_0x7a56('0x79')],_0x48bfd9);})[_0x7a56('0x25')](function(_0x1034b8){_0x704fd3=_0x1034b8;return getTicket(_0x51d0bb,_0x642494,_0x704fd3,_0x29be77,_0x1e8392,_0x29be77[_0x7a56('0x69')],_0x48bfd9,_0x7a56('0x75'));})[_0x7a56('0x25')](function(_0x8fb6d1){_0x2da0b5=_0x8fb6d1;logger['info'](_0x7a56('0x7a'),_0x2da0b5['id']);logger[_0x7a56('0x27')](_0x7a56('0x7b'),_0x2da0b5['id'],_0x51c598[_0x7a56('0x55')],_0x51d0bb[_0x7a56('0x4e')]);switch(_0x51d0bb[_0x7a56('0x4e')]){case _0x7a56('0x6b'):emit(util[_0x7a56('0x46')](_0x7a56('0x6c'),_0x51c598['name']),_0x7a56('0x6d'),{'recordId':_0x2da0b5['id']});break;case _0x7a56('0x6e'):emit(util[_0x7a56('0x46')](_0x7a56('0x6c'),_0x51c598[_0x7a56('0x55')]),_0x7a56('0x6f'),{'uri':util[_0x7a56('0x46')](_0x7a56('0x70'),_0x48bfd9[_0x7a56('0x71')],_0x2da0b5['id'])});break;default:logger[_0x7a56('0x72')]('[OUTBOUND]',_0x7a56('0x7c'));}})[_0x7a56('0x73')](function(_0x2bcb3a){logger[_0x7a56('0x72')](_0x7a56('0x78'),_0x2bcb3a);});};exports[_0x7a56('0x7d')]=function(_0x5bf078,_0x5967ad,_0x2eb405,_0x402c79,_0x31e7da,_0xa224f){var _0x4079e1,_0x48886b,_0x4bddd5,_0x42d429;_0xa224f['serverUrl']=intUtil['stripTrailingSlash'](_0xa224f[_0x7a56('0x5f')]);_0xa224f[_0x7a56('0x58')]=intUtil[_0x7a56('0x60')](_0xa224f[_0x7a56('0x58')]);if(_0x31e7da&&_0x31e7da[_0x7a56('0x61')]){logger[_0x7a56('0x27')]('['+_0x5967ad[_0x7a56('0x7e')]['toUpperCase']()+']',_0x7a56('0x62'));_0x5967ad[_0x7a56('0x63')]=util[_0x7a56('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xa224f[_0x7a56('0x5f')],_0x5967ad[_0x7a56('0x65')],md5(_0x5967ad[_0x7a56('0x65')]));}else{_0x5967ad[_0x7a56('0x63')]='';}return getConnection(_0xa224f)['then'](function(_0x46be30){_0x42d429=_0x46be30;if(!_[_0x7a56('0x20')](_0x402c79)){return getUser(_0xa224f,_0x402c79[_0x7a56('0x55')],_0x42d429);}else{return getUser(_0xa224f,null,_0x42d429);}})[_0x7a56('0x25')](function(_0x11c090){_0x4079e1=_0x11c090;return getEndUser(_0xa224f,_0x2eb405,_0x5967ad[_0x7a56('0x67')],_0x5967ad[_0x7a56('0x68')],_0x42d429);})[_0x7a56('0x25')](function(_0xcd3c9){_0x48886b=_0xcd3c9;return getTicket(_0xa224f,_0x4079e1,_0x48886b,_0x2eb405,_0x5967ad,_0x2eb405[_0x7a56('0x69')],_0x42d429);})['then'](function(_0x3a561f){_0x4bddd5=_0x3a561f;logger[_0x7a56('0x27')]('['+_0x5967ad[_0x7a56('0x7e')]['toUpperCase']()+_0x7a56('0x7f'),_0x4bddd5['id']);logger['info']('['+_0x5967ad[_0x7a56('0x7e')][_0x7a56('0x80')]()+_0x7a56('0x81'),_0xa224f['type']);})['catch'](function(_0x3bb35e){logger[_0x7a56('0x72')]('['+_0x5967ad['lastevent']['toUpperCase']()+']',_0x3bb35e);});}; \ No newline at end of file +var _0x3481=['concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','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]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','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.','integrationTab','toUpperCase',']\x20Ticket\x20%s\x20created.','lastevent','request-promise','bluebird','jsforce','util','ioredis','./util','salesforce','socket.io-emitter','redis','assign','getString','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','Email','Agent\x20%s\x20found.','Name','info','identity','resolve','user_id','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','LastName','','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','Company','No\x20Company','forEach','includes','picklist','idField','content','variable','variableName','toString','customVariable','Variable','name'];(function(_0x48b8eb,_0x47bf2e){var _0x5b72d2=function(_0x481a2b){while(--_0x481a2b){_0x48b8eb['push'](_0x48b8eb['shift']());}};_0x5b72d2(++_0x47bf2e);}(_0x3481,0x1ab));var _0x1348=function(_0x3208ba,_0xd73376){_0x3208ba=_0x3208ba-0x0;var _0xb7a6fc=_0x3481[_0x3208ba];return _0xb7a6fc;};'use strict';var _=require('lodash');var rp=require(_0x1348('0x0'));var moment=require('moment');var BPromise=require(_0x1348('0x1'));var md5=require('md5');var jsforce=require(_0x1348('0x2'));var util=require(_0x1348('0x3'));var Redis=require(_0x1348('0x4'));var intUtil=require(_0x1348('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x1348('0x6'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1348('0x7'))(new Redis(config[_0x1348('0x8')]));function emit(_0x5f1a88,_0x3fe6a0,_0xd46568){io['to'](_0x5f1a88)['emit'](_0x3fe6a0,_0xd46568);}function getTicket(_0x1d6767,_0x590d9c,_0x46e388,_0x2f7334,_0x5a6f07,_0x56d0b5,_0x2fbead,_0x4970c9){var _0x2a8d12=Object[_0x1348('0x9')]({},{'OwnerId':_0x590d9c['id'],'Subject':intUtil[_0x1348('0xa')](_0x2f7334[_0x1348('0xb')],_0x5a6f07,'\x20'),'Description':intUtil['getString'](_0x2f7334[_0x1348('0xc')],_0x5a6f07,'\x0a')},getCustomFields(_0x56d0b5,_0x5a6f07));if(_0x46e388){if(_0x2f7334[_0x1348('0xd')]===_0x1348('0xe')){_0x2a8d12['ActivityDate']=moment[_0x1348('0xf')]();_0x2a8d12[_0x1348('0x10')]=![];_0x2a8d12[_0x1348('0x11')]=![];if(_0x46e388[_0x1348('0x12')]===_0x1348('0x13')||_0x46e388[_0x1348('0x12')]===_0x1348('0x14')){_0x2a8d12[_0x1348('0x15')]=_0x46e388['id'];}else if(_0x46e388[_0x1348('0x12')]===_0x1348('0x16')){_0x2a8d12[_0x1348('0x17')]=_0x46e388['id'];}}else if(_0x2f7334[_0x1348('0xd')]===_0x1348('0x18')){if(_0x46e388[_0x1348('0x12')]===_0x1348('0x13')){_0x2a8d12[_0x1348('0x19')]=_0x46e388['id'];}else if(_0x46e388['endUserType']===_0x1348('0x16')){_0x2a8d12[_0x1348('0x1a')]=_0x46e388['id'];}else if(_0x46e388[_0x1348('0x12')]===_0x1348('0x14')&&_0x2f7334[_0x1348('0x1b')]){_0x2a8d12[_0x2f7334[_0x1348('0x1b')]]=_0x46e388['id'];}else{logger['info'](_0x1348('0x1c'));}}}return _0x2fbead[_0x1348('0x1d')](_0x2f7334[_0x1348('0xd')])[_0x1348('0x1e')](_0x2a8d12);}function getUser(_0x4baf53,_0x2995e0,_0x40dcf6){if(!_[_0x1348('0x1f')](_0x2995e0)&&intUtil[_0x1348('0x20')](_0x2995e0)){var _0x1fc9cb={'Email':_0x2995e0};var _0x4620ef={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x40dcf6[_0x1348('0x1d')](_0x1348('0x21'))[_0x1348('0x22')](_0x1fc9cb,_0x4620ef)[_0x1348('0x23')]()[_0x1348('0x24')](function(_0x23a1b0){if(_0x23a1b0['length']){var _0x728cc2=_[_0x1348('0x22')](_0x23a1b0,function(_0x428ebc){return _0x428ebc[_0x1348('0x25')]===_0x2995e0;});if(_0x728cc2){logger['info'](_0x1348('0x26'),_0x2995e0);return BPromise['resolve']({'id':_0x728cc2['Id'],'name':_0x728cc2[_0x1348('0x27')]});}}else{logger[_0x1348('0x28')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2995e0);return _0x40dcf6[_0x1348('0x29')]()[_0x1348('0x24')](function(_0x38aafb){return BPromise[_0x1348('0x2a')]({'id':_0x38aafb[_0x1348('0x2b')],'name':_0x38aafb['display_name']});});}});}else{logger['info'](_0x1348('0x2c'),_0x2995e0);return _0x40dcf6[_0x1348('0x29')]()[_0x1348('0x24')](function(_0x4f4c2f){return BPromise[_0x1348('0x2a')]({'id':_0x4f4c2f[_0x1348('0x2b')],'name':_0x4f4c2f[_0x1348('0x2d')]});});}}function getEndUser(_0x59b40f,_0x2a483d,_0x590e28,_0x57ca65,_0x5ce2e6){var _0x45c1e4={'$or':{'Phone':_0x57ca65}};var _0x2c0633={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1348('0x2a')]()['then'](function(){logger[_0x1348('0x28')](_0x1348('0x2e'),_0x57ca65,_0x2a483d[_0x1348('0x2f')]);switch(_0x2a483d[_0x1348('0x2f')]){case _0x1348('0x30'):var _0x1a1dff=_[_0x1348('0x31')](_0x45c1e4);if(_0x2a483d[_0x1348('0x32')]){var _0x45c6ab={};_0x45c6ab[_0x2a483d['additionalSearchContact']]=_0x57ca65;_[_0x1348('0x33')](_0x1a1dff[_0x1348('0x34')],_0x45c6ab);}return _0x5ce2e6[_0x1348('0x1d')](_0x1348('0x35'))[_0x1348('0x22')](_0x1a1dff,_0x2c0633)[_0x1348('0x23')]()[_0x1348('0x24')](function(_0x8925f){if(_0x8925f&&_0x8925f[_0x1348('0x36')]){return _0x8925f;}else{var _0xa0b8ce=_[_0x1348('0x31')](_0x45c1e4);if(_0x2a483d[_0x1348('0x37')]){var _0x2ebcdc={};_0x2ebcdc[_0x2a483d[_0x1348('0x37')]]=_0x57ca65;_[_0x1348('0x33')](_0xa0b8ce[_0x1348('0x34')],_0x2ebcdc);}return _0x5ce2e6[_0x1348('0x1d')](_0x1348('0x38'))[_0x1348('0x22')](_0xa0b8ce,_0x2c0633);}});case _0x1348('0x39'):var _0x14410d=_[_0x1348('0x31')](_0x45c1e4);if(_0x2a483d[_0x1348('0x3a')]){var _0x45c6ab={};_0x45c6ab[_0x2a483d[_0x1348('0x3a')]]=_0x57ca65;_[_0x1348('0x33')](_0x14410d[_0x1348('0x34')],_0x45c6ab);}return _0x5ce2e6['sobject'](_0x1348('0x3b'))['find'](_0x14410d,_0x2c0633)[_0x1348('0x23')]()[_0x1348('0x24')](function(_0x1752e6){if(_0x1752e6&&_0x1752e6[_0x1348('0x36')]){return _0x1752e6;}else{var _0x5f4117=_['cloneDeep'](_0x45c1e4);if(_0x2a483d[_0x1348('0x32')]){var _0x15a4f6={};_0x15a4f6[_0x2a483d[_0x1348('0x32')]]=_0x57ca65;_[_0x1348('0x33')](_0x5f4117['$or'],_0x15a4f6);}return _0x5ce2e6[_0x1348('0x1d')](_0x1348('0x35'))[_0x1348('0x22')](_0x5f4117,_0x2c0633)[_0x1348('0x24')](function(_0x1b4761){if(_0x1b4761&&_0x1b4761[_0x1348('0x36')]){return _0x1b4761;}else{var _0x404b25=_['cloneDeep'](_0x45c1e4);if(_0x2a483d[_0x1348('0x37')]){var _0x495d62={};_0x495d62[_0x2a483d[_0x1348('0x37')]]=_0x57ca65;_[_0x1348('0x33')](_0x404b25[_0x1348('0x34')],_0x495d62);}return _0x5ce2e6[_0x1348('0x1d')](_0x1348('0x38'))[_0x1348('0x22')](_0x404b25,_0x2c0633);}});}});case'contact':var _0x1a1dff=_[_0x1348('0x31')](_0x45c1e4);if(_0x2a483d['additionalSearchContact']){var _0x45c6ab={};_0x45c6ab[_0x2a483d[_0x1348('0x32')]]=_0x57ca65;_['merge'](_0x1a1dff[_0x1348('0x34')],_0x45c6ab);}return _0x5ce2e6[_0x1348('0x1d')]('Contact')['find'](_0x1a1dff,_0x2c0633)[_0x1348('0x23')]();case _0x1348('0x14'):var _0x51b5a4=_[_0x1348('0x31')](_0x45c1e4);if(_0x2a483d[_0x1348('0x37')]){var _0x45c6ab={};_0x45c6ab[_0x2a483d[_0x1348('0x37')]]=_0x57ca65;_[_0x1348('0x33')](_0x51b5a4[_0x1348('0x34')],_0x45c6ab);}return _0x5ce2e6[_0x1348('0x1d')]('Lead')[_0x1348('0x22')](_0x51b5a4,_0x2c0633);case _0x1348('0x16'):var _0x14410d=_[_0x1348('0x31')](_0x45c1e4);if(_0x2a483d['additionalSearchAccount']){var _0x45c6ab={};_0x45c6ab[_0x2a483d[_0x1348('0x3a')]]=_0x57ca65;_[_0x1348('0x33')](_0x14410d[_0x1348('0x34')],_0x45c6ab);}return _0x5ce2e6[_0x1348('0x1d')](_0x1348('0x3b'))['find'](_0x14410d,_0x2c0633);default:return null;}})['then'](function(_0x14e7e3){if(_0x14e7e3&&_0x14e7e3['length']){var _0x1c7ef8=_[_0x1348('0x3c')](_0x14e7e3);if(_0x1c7ef8){return BPromise[_0x1348('0x2a')]({'id':_0x1c7ef8['Id'],'name':_0x1c7ef8[_0x1348('0x27')],'phone':_0x1c7ef8[_0x1348('0x3d')],'endUserType':_0x1c7ef8[_0x1348('0x3e')][_0x1348('0x3f')][_0x1348('0x40')]()});}}})['then'](function(_0x192e98){if(_0x192e98){logger[_0x1348('0x28')](_0x1348('0x41'),_0x192e98[_0x1348('0x12')],_0x57ca65);return BPromise[_0x1348('0x2a')](_0x192e98);}else{logger[_0x1348('0x28')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x57ca65);var _0x46b0e5={'Phone':_0x57ca65};if(_0x2a483d[_0x1348('0x42')]){if(_0x2a483d[_0x1348('0x42')]===_0x1348('0x13')){logger[_0x1348('0x28')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x57ca65,_0x2a483d[_0x1348('0x42')]);_0x46b0e5[_0x1348('0x43')]=_0x590e28!==_0x1348('0x44')?_0x590e28:util['format'](_0x1348('0x45'),_0x57ca65);}else if(_0x2a483d[_0x1348('0x42')]===_0x1348('0x14')){logger[_0x1348('0x28')](_0x1348('0x46'),_0x57ca65,_0x2a483d['moduleCreate']);_0x46b0e5[_0x1348('0x43')]=_0x590e28!==_0x1348('0x44')?_0x590e28:util[_0x1348('0x47')](_0x1348('0x45'),_0x57ca65);_0x46b0e5[_0x1348('0x48')]=_0x1348('0x49');}else if(_0x2a483d[_0x1348('0x42')]===_0x1348('0x16')){logger[_0x1348('0x28')](_0x1348('0x46'),_0x57ca65,_0x2a483d[_0x1348('0x42')]);_0x46b0e5[_0x1348('0x27')]=_0x590e28!==_0x1348('0x44')?_0x590e28:util[_0x1348('0x47')](_0x1348('0x45'),_0x57ca65);}else{return null;}}return _0x5ce2e6['sobject'](_['upperFirst'](_0x2a483d[_0x1348('0x42')]))[_0x1348('0x1e')](_0x46b0e5)[_0x1348('0x24')](function(_0x940f07){return BPromise[_0x1348('0x2a')]({'id':_0x940f07['id'],'endUserType':_0x2a483d[_0x1348('0x42')]});});}});}function getCustomFields(_0x38e0df,_0xdd5efd){var _0x568308={};if(_0x38e0df[_0x1348('0x36')]>0x0){_[_0x1348('0x4a')](_0x38e0df,function(_0x194270){if(_[_0x1348('0x4b')](['string',_0x1348('0x4c')],_0x194270['type'])&&_0x194270[_0x1348('0x4d')]){_0x568308[_0x194270[_0x1348('0x4d')]]=_0x194270[_0x1348('0x4e')]['toString']();}else if(_0x194270[_0x1348('0x3f')]===_0x1348('0x4f')&&_0x194270[_0x1348('0x50')]&&_0x194270[_0x1348('0x4d')]){_0xdd5efd[_0x194270[_0x1348('0x50')]]&&(_0x568308[_0x194270[_0x1348('0x4d')]]=_0xdd5efd[_0x194270[_0x1348('0x50')]][_0x1348('0x51')]());}else if(_0x194270[_0x1348('0x3f')]===_0x1348('0x52')&&_0x194270[_0x1348('0x53')]&&_0x194270[_0x1348('0x53')]['name']&&_0x194270[_0x1348('0x4d')]){_0xdd5efd[_0x194270['Variable'][_0x1348('0x54')][_0x1348('0x40')]()]&&(_0x568308[_0x194270[_0x1348('0x4d')]]=_0xdd5efd[_0x194270[_0x1348('0x53')][_0x1348('0x54')][_0x1348('0x40')]()]['toString']());}});}return _0x568308;}function getConnection(_0x2f9b39){var _0x3d2145=_0x2f9b39['password'][_0x1348('0x55')](_0x2f9b39[_0x1348('0x56')]);var _0x291f1f=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2f9b39[_0x1348('0x57')]||_0x1348('0x58'),'clientId':_0x2f9b39[_0x1348('0x59')],'clientSecret':_0x2f9b39[_0x1348('0x5a')]}});return _0x291f1f[_0x1348('0x5b')](_0x2f9b39['username'],_0x3d2145)[_0x1348('0x24')](function(){logger[_0x1348('0x28')](_0x1348('0x5c'));return _0x291f1f;});}exports[_0x1348('0x5d')]=function(_0x279980,_0x578b4a,_0x55fdd8,_0x2613b8,_0x3d460e,_0x4a6094){var _0x31adb2,_0x540308,_0x10b5bc,_0x487c48;_0x4a6094[_0x1348('0x5e')]=intUtil[_0x1348('0x5f')](_0x4a6094[_0x1348('0x5e')]);_0x4a6094[_0x1348('0x57')]=intUtil['stripTrailingSlash'](_0x4a6094[_0x1348('0x57')]);if(_0x3d460e&&_0x3d460e[_0x1348('0x60')]){logger['info'](_0x1348('0x61'),_0x1348('0x62'));_0x578b4a[_0x1348('0x63')]=util[_0x1348('0x47')](_0x1348('0x64'),_0x4a6094['serverUrl'],_0x578b4a[_0x1348('0x65')],md5(_0x578b4a[_0x1348('0x65')]));}else{_0x578b4a[_0x1348('0x63')]='';}return getConnection(_0x4a6094)[_0x1348('0x24')](function(_0x452755){_0x487c48=_0x452755;return getUser(_0x4a6094,_0x2613b8[_0x1348('0x66')],_0x487c48);})[_0x1348('0x24')](function(_0x5ab616){_0x31adb2=_0x5ab616;return getEndUser(_0x4a6094,_0x55fdd8,_0x578b4a[_0x1348('0x67')],_0x578b4a[_0x1348('0x68')],_0x487c48);})[_0x1348('0x24')](function(_0x55b372){_0x540308=_0x55b372;return getTicket(_0x4a6094,_0x31adb2,_0x540308,_0x55fdd8,_0x578b4a,_0x55fdd8[_0x1348('0x69')],_0x487c48,_0x1348('0x5d'));})[_0x1348('0x24')](function(_0x39c27b){_0x10b5bc=_0x39c27b;logger[_0x1348('0x28')](_0x1348('0x6a'),_0x10b5bc['id']);logger[_0x1348('0x28')](_0x1348('0x6b'),_0x10b5bc['id'],_0x2613b8[_0x1348('0x54')],_0x4a6094[_0x1348('0x3f')]);switch(_0x4a6094[_0x1348('0x3f')]){case'integrationTab':emit(util[_0x1348('0x47')](_0x1348('0x6c'),_0x2613b8[_0x1348('0x54')]),_0x1348('0x6d'),{'recordId':_0x10b5bc['id']});break;case'newTab':emit(util[_0x1348('0x47')](_0x1348('0x6c'),_0x2613b8[_0x1348('0x54')]),_0x1348('0x6e'),{'uri':util['format'](_0x1348('0x6f'),_0x487c48[_0x1348('0x70')],_0x10b5bc['id'])});break;default:logger['error'](_0x1348('0x71'));}})[_0x1348('0x72')](function(_0x597063){logger[_0x1348('0x73')](_0x1348('0x61'),_0x597063);});};exports[_0x1348('0x74')]=function(_0xac95c,_0x548596,_0x262ad1,_0x4567a5,_0x161d6c,_0x5454c5,_0x155897){var _0x59c8f5,_0x5e3a2c,_0x12dbc3,_0x294517;_0x5454c5[_0x1348('0x5e')]=intUtil[_0x1348('0x5f')](_0x5454c5[_0x1348('0x5e')]);_0x5454c5[_0x1348('0x57')]=intUtil[_0x1348('0x5f')](_0x5454c5[_0x1348('0x57')]);if(_0x155897&&_0x155897[_0x1348('0x75')]&&_0x155897[_0x1348('0x75')]!==_0x1348('0x76')){logger['info'](_0x1348('0x77'),_0x1348('0x62'));_0x548596[_0x1348('0x63')]=util[_0x1348('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5454c5[_0x1348('0x5e')],_0x548596[_0x1348('0x65')],md5(_0x548596['uniqueid']));}return getConnection(_0x5454c5)[_0x1348('0x24')](function(_0x1c4fc0){_0x294517=_0x1c4fc0;return getUser(_0x5454c5,_0x4567a5[_0x1348('0x66')],_0x294517);})[_0x1348('0x24')](function(_0x3a927a){_0x59c8f5=_0x3a927a;return getEndUser(_0x5454c5,_0x262ad1,_0x548596[_0x1348('0x78')],_0x548596[_0x1348('0x79')],_0x294517);})[_0x1348('0x24')](function(_0x1f9bd1){_0x5e3a2c=_0x1f9bd1;return getTicket(_0x5454c5,_0x59c8f5,_0x5e3a2c,_0x262ad1,_0x548596,_0x262ad1[_0x1348('0x69')],_0x294517,_0x1348('0x74'));})[_0x1348('0x24')](function(_0x34d1ce){_0x12dbc3=_0x34d1ce;logger[_0x1348('0x28')](_0x1348('0x7a'),_0x12dbc3['id']);logger['info'](_0x1348('0x7b'),_0x12dbc3['id'],_0x4567a5[_0x1348('0x54')],_0x5454c5[_0x1348('0x3f')]);switch(_0x5454c5[_0x1348('0x3f')]){case _0x1348('0x7c'):emit(util[_0x1348('0x47')](_0x1348('0x6c'),_0x4567a5[_0x1348('0x54')]),_0x1348('0x6d'),{'recordId':_0x12dbc3['id']});break;case'newTab':emit(util[_0x1348('0x47')](_0x1348('0x6c'),_0x4567a5[_0x1348('0x54')]),_0x1348('0x6e'),{'uri':util[_0x1348('0x47')](_0x1348('0x6f'),_0x294517[_0x1348('0x70')],_0x12dbc3['id'])});break;default:logger[_0x1348('0x73')]('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x1348('0x72')](function(_0x4ddb31){logger[_0x1348('0x73')](_0x1348('0x77'),_0x4ddb31);});};exports['unmanaged']=function(_0x59e85e,_0x2732a4,_0x53d84a,_0x2305c5,_0x57f0ba,_0x7c931c){var _0xd29446,_0x48d0fd,_0x272a73,_0x3c03d8;_0x7c931c['serverUrl']=intUtil[_0x1348('0x5f')](_0x7c931c[_0x1348('0x5e')]);_0x7c931c[_0x1348('0x57')]=intUtil[_0x1348('0x5f')](_0x7c931c[_0x1348('0x57')]);if(_0x57f0ba&&_0x57f0ba['monitor_format']){logger[_0x1348('0x28')]('['+_0x2732a4['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x2732a4['recordingURL']=util[_0x1348('0x47')](_0x1348('0x64'),_0x7c931c[_0x1348('0x5e')],_0x2732a4[_0x1348('0x65')],md5(_0x2732a4[_0x1348('0x65')]));}else{_0x2732a4[_0x1348('0x63')]='';}return getConnection(_0x7c931c)[_0x1348('0x24')](function(_0x17e3e8){_0x3c03d8=_0x17e3e8;if(!_[_0x1348('0x1f')](_0x2305c5)){return getUser(_0x7c931c,_0x2305c5[_0x1348('0x54')],_0x3c03d8);}else{return getUser(_0x7c931c,null,_0x3c03d8);}})[_0x1348('0x24')](function(_0x23dfc9){_0xd29446=_0x23dfc9;return getEndUser(_0x7c931c,_0x53d84a,_0x2732a4['calleridname'],_0x2732a4[_0x1348('0x68')],_0x3c03d8);})[_0x1348('0x24')](function(_0x385963){_0x48d0fd=_0x385963;return getTicket(_0x7c931c,_0xd29446,_0x48d0fd,_0x53d84a,_0x2732a4,_0x53d84a[_0x1348('0x69')],_0x3c03d8);})['then'](function(_0x5b25f6){_0x272a73=_0x5b25f6;logger[_0x1348('0x28')]('['+_0x2732a4['lastevent'][_0x1348('0x7d')]()+_0x1348('0x7e'),_0x272a73['id']);logger['info']('['+_0x2732a4['lastevent'][_0x1348('0x7d')]()+']\x20Integration\x20account\x20type\x20%s.',_0x7c931c[_0x1348('0x3f')]);})[_0x1348('0x72')](function(_0x51e74b){logger[_0x1348('0x73')]('['+_0x2732a4[_0x1348('0x7f')]['toUpperCase']()+']',_0x51e74b);});}; \ 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 97379cc..6274249 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 _0xd52a=['Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','forEach','string','type','customField','nameField','toLowerCase','content','includes','picklist','idField','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','Descriptions','Fields','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','incident','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','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0xd52a,0x75));var _0xad52=function(_0x3a0c83,_0x5d1a26){_0x3a0c83=_0x3a0c83-0x0;var _0x1e200a=_0xd52a[_0x3a0c83];return _0x1e200a;};'use strict';var _=require(_0xad52('0x0'));var Promise=require('bluebird');var rp=require(_0xad52('0x1'));var util=require(_0xad52('0x2'));var md5=require(_0xad52('0x3'));var Redis=require(_0xad52('0x4'));var intUtil=require(_0xad52('0x5'));var config=require(_0xad52('0x6'));var logger=require(_0xad52('0x7'))('servicenow');config['redis']=_[_0xad52('0x8')](config['redis'],{'host':_0xad52('0x9'),'port':0x18eb});var io=require(_0xad52('0xa'))(new Redis(config['redis']));function getAdminUser(_0x28e21e,_0x39c7e3,_0x354412,_0x4a4137,_0x234a68,_0x9bddfa){return new Promise(function(_0x2e8e47,_0x21e276){var _0x2d2b28={'method':_0xad52('0xb'),'uri':_0x4a4137+_0xad52('0xc')+'&'+_0x234a68+'&'+_0x9bddfa,'auth':_0x39c7e3,'json':!![]};return rp(_0x2d2b28)[_0xad52('0xd')](function(_0x237938){if(_0x237938[_0xad52('0xe')][_0xad52('0xf')]>0x0){_0x354412[_0xad52('0x10')]=_0x237938[_0xad52('0xe')][0x0][_0xad52('0x11')];}logger[_0xad52('0x12')]('['+[_0x28e21e['toUpperCase']()]+_0xad52('0x13'),_0x354412);_0x2e8e47(_0x354412);})[_0xad52('0x14')](function(_0xfdd05a){logger[_0xad52('0x15')]('['+[_0x28e21e[_0xad52('0x16')]()]+']',_0xfdd05a[_0xad52('0x17')]);_0x21e276(_0xfdd05a[_0xad52('0x17')]);});});}function getUser(_0x467729,_0x5fe05e,_0x5a7380,_0x4c060a,_0x1d6c2e){return function(_0x303fc4){logger[_0xad52('0x12')]('['+[_0x467729['toUpperCase']()]+_0xad52('0x18'),_0x303fc4);return new Promise(function(_0x3b8190,_0x48345d){if(intUtil['validateEmail'](_0x303fc4['userEmail'])){var _0x262b75={'method':_0xad52('0xb'),'uri':_0x5a7380+_0xad52('0x19')+_0x303fc4[_0xad52('0x1a')]+'&'+_0x4c060a+'&'+_0x1d6c2e,'auth':_0x5fe05e,'json':!![]};logger['info']('['+[_0x467729[_0xad52('0x16')]()]+'],\x20getUser\x20rp\x20obj',_0x262b75);return rp(_0x262b75)[_0xad52('0xd')](function(_0x34d23f){logger[_0xad52('0x12')]('['+[_0x467729[_0xad52('0x16')]()]+_0xad52('0x1b'),_0x34d23f);if(_0x34d23f[_0xad52('0xe')][_0xad52('0xf')]>0x0&&String(_0x34d23f[_0xad52('0xe')][0x0][_0xad52('0x1c')])===_0xad52('0x1d')){_0x303fc4[_0xad52('0x1e')]=_0x34d23f[_0xad52('0xe')][0x0][_0xad52('0x11')];}else{_0x303fc4[_0xad52('0x1e')]=_0x303fc4[_0xad52('0x10')];_0x303fc4[_0xad52('0x1a')]=_0x303fc4[_0xad52('0x1f')];}logger[_0xad52('0x12')]('['+[_0x467729['toUpperCase']()]+_0xad52('0x20'),_0x303fc4);_0x3b8190(_0x303fc4);})[_0xad52('0x14')](function(_0x428489){logger['error']('['+[_0x467729['toUpperCase']()]+']',_0x428489['message']);_0x48345d(_0x428489[_0xad52('0x17')]);});}else{logger[_0xad52('0x12')]('['+[_0x467729[_0xad52('0x16')]()]+']\x20using\x20admin\x20profile');_0x303fc4['userId']=_0x303fc4[_0xad52('0x10')];_0x303fc4[_0xad52('0x1a')]=_0x303fc4[_0xad52('0x1f')];_0x3b8190(_0x303fc4);}});};}function createEndUser(_0x33cb98,_0x2357f4,_0x261c3b,_0x186416,_0x274ef7){logger[_0xad52('0x12')]('['+[_0x33cb98['toUpperCase']()]+_0xad52('0x21'),_0x261c3b);return new Promise(function(_0x2ae212,_0x431577){var _0x4f378a={'method':_0xad52('0x22'),'uri':_0x186416+_0xad52('0x23')+_0x274ef7,'body':{'user_name':_0x261c3b[_0xad52('0x24')],'roles':'user','first_name':_0x261c3b[_0xad52('0x24')],'active':_0xad52('0x1d'),'date_format':'System','phone':_0x261c3b[_0xad52('0x24')]},'auth':_0x2357f4,'json':!![]};return rp(_0x4f378a)[_0xad52('0xd')](function(_0x2d0fe0){logger['info']('['+[_0x33cb98[_0xad52('0x16')]()]+_0xad52('0x25'),_0x2d0fe0[_0xad52('0xe')]);_0x261c3b[_0xad52('0x26')]=_0x2d0fe0[_0xad52('0xe')][_0xad52('0x11')];_0x2ae212(_0x261c3b);})['catch'](function(_0x16b230){logger[_0xad52('0x15')]('['+[_0x33cb98['toUpperCase']()]+']',_0x16b230[_0xad52('0x17')]);_0x431577(_0x16b230['message']);});});}function getEndUser(_0xfc8616,_0x13bcb5,_0x6ad173,_0x17ac1d,_0x1d79f5){return function(_0x10923c){logger[_0xad52('0x12')]('['+[_0xfc8616[_0xad52('0x16')]()]+'],\x20getEndUser\x20input\x20crm',_0x10923c);return new Promise(function(_0x2d33c5,_0x59b4bb){var _0x2b0e2d={'method':_0xad52('0xb'),'uri':_0x6ad173+'sys_user?sysparm_query=phone%3D'+_0x10923c[_0xad52('0x24')]+'&'+_0x17ac1d+'&'+_0x1d79f5,'auth':_0x13bcb5,'json':!![]};return rp(_0x2b0e2d)[_0xad52('0xd')](function(_0x47f42e){if(_0x47f42e[_0xad52('0xe')]['length']>0x0){_0x10923c[_0xad52('0x26')]=_0x47f42e[_0xad52('0xe')][0x0][_0xad52('0x11')];logger[_0xad52('0x12')]('['+[_0xfc8616[_0xad52('0x16')]()]+_0xad52('0x27'),_0x10923c);_0x2d33c5(_0x10923c);}else{return createEndUser(_0xfc8616,_0x13bcb5,_0x10923c,_0x6ad173,_0x17ac1d)[_0xad52('0xd')](function(_0x12eec1){logger[_0xad52('0x12')]('['+[_0xfc8616[_0xad52('0x16')]()]+'],\x20createEndUser\x20crm',_0x12eec1);_0x2d33c5(_0x12eec1);});}})[_0xad52('0x14')](function(_0x3dd2ed){logger[_0xad52('0x15')]('['+[_0xfc8616[_0xad52('0x16')]()]+']',_0x3dd2ed[_0xad52('0x17')]);_0x59b4bb(_0x3dd2ed[_0xad52('0x17')]);});});};}function getCustomFields(_0xe886d6,_0x277869){var _0x1f7dfb={};if(_0xe886d6['length']>0x0){_[_0xad52('0x28')](_0xe886d6,function(_0x4815b4){if(_['includes']([_0xad52('0x29'),'picklist'],_0x4815b4[_0xad52('0x2a')])&&_0x4815b4['nameField']&&!_0x4815b4[_0xad52('0x2b')]){_0x1f7dfb[_0x4815b4[_0xad52('0x2c')][_0xad52('0x2d')]()]=_0x4815b4[_0xad52('0x2e')]['toString']();}else if(_[_0xad52('0x2f')]([_0xad52('0x29'),_0xad52('0x30')],_0x4815b4['type'])&&_0x4815b4[_0xad52('0x31')]&&_0x4815b4[_0xad52('0x2b')]){_0x1f7dfb[_0x4815b4[_0xad52('0x31')][_0xad52('0x2d')]()]=_0x4815b4[_0xad52('0x2e')][_0xad52('0x32')]();}else if(_0x4815b4[_0xad52('0x2a')]===_0xad52('0x33')&&_0x4815b4[_0xad52('0x34')]&&_0x4815b4[_0xad52('0x31')]&&_0x4815b4[_0xad52('0x2b')]){_0x1f7dfb[_0x4815b4[_0xad52('0x31')][_0xad52('0x2d')]()]=_0x277869[_0x4815b4[_0xad52('0x34')]][_0xad52('0x32')]();}else if(_0x4815b4[_0xad52('0x2a')]===_0xad52('0x35')&&_0x4815b4[_0xad52('0x36')]&&_0x4815b4['Variable'][_0xad52('0x37')]&&_0x4815b4[_0xad52('0x31')]&&_0x4815b4['customField']){_0x1f7dfb[_0x4815b4[_0xad52('0x31')][_0xad52('0x2d')]()]=_0x277869[_0x4815b4[_0xad52('0x36')][_0xad52('0x37')]['toLowerCase']()]['toString']();}});}return _0x1f7dfb;}function getTicket(_0x489b52,_0x1c59b8,_0x2d5654,_0x79a69d,_0x12a672,_0x1d1728){return function(_0x2aa12a){logger[_0xad52('0x12')]('['+[_0x489b52[_0xad52('0x16')]()]+_0xad52('0x38'),_0x2aa12a);return new Promise(function(_0x4638ad,_0x8546ab){var _0x4fb71a=_0x489b52[_0xad52('0x2d')]()===_0xad52('0x39')?_0x2aa12a[_0xad52('0x1e')]:_0x2aa12a[_0xad52('0x26')];var _0x115ae3={'method':_0xad52('0x22'),'uri':_0x2d5654+'incident'+'?'+_0x1d1728,'body':Object[_0xad52('0x3a')]({},{'active':_0xad52('0x1d'),'caller_id':_0x4fb71a,'assigned_to':_0x2aa12a[_0xad52('0x1e')],'short_description':intUtil['getString'](_0x79a69d['Subjects'],_0x12a672,'\x20'),'description':intUtil['getString'](_0x79a69d[_0xad52('0x3b')],_0x12a672,'\x0a')},getCustomFields(_0x79a69d[_0xad52('0x3c')],_0x12a672)),'auth':_0x1c59b8,'json':!![]};return rp(_0x115ae3)[_0xad52('0xd')](function(_0x125f4d){logger[_0xad52('0x12')]('['+[_0x489b52[_0xad52('0x16')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x125f4d[_0xad52('0xe')]);_0x2aa12a[_0xad52('0x3d')]=_0x125f4d[_0xad52('0xe')]['sys_id'];_0x2aa12a[_0xad52('0x3e')]=_0x125f4d[_0xad52('0xe')][_0xad52('0x3f')];logger[_0xad52('0x12')]('['+[_0x489b52[_0xad52('0x16')]()]+']\x20getTicket\x20crm',_0x2aa12a);_0x4638ad(_0x2aa12a);})[_0xad52('0x14')](function(_0x354cd5){logger[_0xad52('0x15')]('['+[_0x489b52[_0xad52('0x16')]()]+']',_0x354cd5[_0xad52('0x17')]);_0x8546ab(_0x354cd5[_0xad52('0x17')]);});});};}function createRemoteTag(_0xa37e20,_0x55b3ab,_0x59ba12,_0x26912a){return new Promise(function(_0x4908f3,_0x138785){var _0x36d71f={'method':_0xad52('0x22'),'uri':_0x59ba12+'label'+'?'+_0x26912a,'body':{'short_description':_0xa37e20,'global':!![],'active':!![],'name':_0xa37e20},'auth':_0x55b3ab,'json':!![]};return rp(_0x36d71f)[_0xad52('0xd')](function(_0x57f28c){var _0xc26bb3=_0x57f28c[_0xad52('0xe')][_0xad52('0x11')];_0x4908f3(_0xc26bb3);});});}function getRemoteTag(_0x4bfbd0,_0x56f976,_0x366ae6,_0x1caa25,_0x34a12e){return new Promise(function(_0x36d692,_0x500f69){var _0x2f3817={'method':_0xad52('0xb'),'uri':_0x366ae6+_0xad52('0x40')+_0xad52('0x41')+_0x4bfbd0+'&'+_0x1caa25,'auth':_0x56f976,'json':!![]};return rp(_0x2f3817)[_0xad52('0xd')](function(_0x148512){if(_0x148512[_0xad52('0xe')]['length']>0x0){var _0x456c8f=_0x148512[_0xad52('0xe')][0x0][_0xad52('0x11')];_0x36d692(_0x456c8f);}else{return createRemoteTag(_0x4bfbd0,_0x56f976,_0x366ae6,_0x1caa25)[_0xad52('0xd')](function(_0x3c74b5){_0x36d692(_0x3c74b5);});}});});}function assignTagToIncident(_0x2ac743,_0x3cc218,_0x22a13d,_0x2f9c9d,_0x560dd4){return new Promise(function(_0x18ef05,_0x38f9e0){var _0x7192f3={'method':_0xad52('0x22'),'uri':_0x22a13d+'label_entry'+'?'+_0x560dd4,'body':{'label':_0x2ac743,'table':_0xad52('0x42'),'id_type':_0xad52('0x43'),'table_key':_0x2f9c9d[_0xad52('0x3d')],'title':_0xad52('0x44')+_0x2f9c9d[_0xad52('0x3e')],'id_display':_0x2f9c9d[_0xad52('0x3e')]},'auth':_0x3cc218,'json':!![]};return rp(_0x7192f3)[_0xad52('0xd')](function(_0x156944){_0x18ef05();})['catch'](function(){_0x18ef05();});});}function manageTags(_0x21f297,_0xcc6c8a,_0x500c0e,_0x163eb7,_0x41ae92,_0x3811b3,_0x16100e){return new Promise(function(_0x4a605d,_0x1db5c3){var _0x42f472=[];_0xcc6c8a[_0xad52('0x28')](function(_0x1685dc){_0x42f472['push'](getRemoteTag(_0x1685dc,_0x500c0e,_0x163eb7,_0x3811b3,_0x16100e));});return Promise[_0xad52('0x45')](_0x42f472)[_0xad52('0xd')](function(_0x1d659d){if(_0x1d659d[_0xad52('0xf')]){logger[_0xad52('0x12')]('['+[_0x21f297['toUpperCase']()]+_0xad52('0x46'),_0x1d659d);var _0x30d8df=[];_0x1d659d['forEach'](function(_0x3d521f){_0x30d8df[_0xad52('0x47')](assignTagToIncident(_0x3d521f,_0x500c0e,_0x163eb7,_0x41ae92,_0x3811b3));});return Promise[_0xad52('0x45')](_0x30d8df)['then'](function(){_0x4a605d();})['catch'](function(){_0x4a605d();});}else{_0x4a605d();}});});}function getTags(_0x416601,_0x30b710,_0x17c476,_0x1dc8b1,_0x5bd2b7,_0x159212){return function(_0x37d443){return new Promise(function(_0x44fa7b,_0x318f83){var _0x259191=[];var _0x159cf8=_0x1dc8b1[_0xad52('0x48')];if(_0x159cf8&&_0x159cf8[_0xad52('0xf')]>0x0){_0x259191=_[_0xad52('0x49')](_0x159cf8,_0xad52('0x37'));}if(_0x259191[_0xad52('0xf')]>0x0){return manageTags(_0x416601,_0x259191,_0x30b710,_0x17c476,_0x37d443,_0x5bd2b7,_0x159212)[_0xad52('0xd')](function(){_0x44fa7b(_0x37d443);});}else{_0x44fa7b(_0x37d443);}});};}function emit(_0x161314,_0x5867a9,_0xb355c1){var _0x5092b5=_0xad52('0x4a')+_0xad52('0x4b')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xad52('0x4c');var _0xabaa55={'uri':_0x161314+_0xad52('0x4d')+_0xb355c1+_0x5092b5};io['to'](util[_0xad52('0x4e')]('user:%s',_0x5867a9))['emit'](_0xad52('0x4f'),_0xabaa55);}exports['cs']=function(_0x1146a5,_0x5bfae0,_0x3ad6bd,_0x1e11c4,_0x3c70a4,_0x260561,_0x3e645b,_0x329ca7){var _0x2fcfed={};var _0x30d914={'user':_0x260561[_0xad52('0x50')],'pass':_0x260561[_0xad52('0x51')]};var _0x29b21e='sysparm_limit=1';var _0x3facae=_0xad52('0x52');_0x260561[_0xad52('0x53')]=intUtil[_0xad52('0x54')](_0x260561['remoteUri']);_0x260561[_0xad52('0x55')]=intUtil[_0xad52('0x54')](_0x260561[_0xad52('0x55')]);var _0x521d9e=util['format'](_0xad52('0x56'),_0x260561[_0xad52('0x53')]);_0x2fcfed[_0xad52('0x1a')]=!_[_0xad52('0x57')](_0x1e11c4)?_0x1e11c4[_0xad52('0x58')]:null;_0x2fcfed[_0xad52('0x1f')]=_0x260561[_0xad52('0x58')];_0x2fcfed[_0xad52('0x24')]=_0x329ca7['toLowerCase']()==='outbound'?_0x5bfae0[_0xad52('0x59')]:_0x5bfae0[_0xad52('0x5a')];_0x2fcfed[_0xad52('0x5b')]=_0x329ca7==='queue'||_0x329ca7==='unmanaged'?_0xad52('0x5c'):_0xad52('0x39');var _0x1c0bcd=util[_0xad52('0x4e')](_0xad52('0x5d'),_0x260561[_0xad52('0x55')],_0x5bfae0[_0xad52('0x5e')],md5(_0x5bfae0['uniqueid']));if(_0x3c70a4&&_0x3c70a4[_0xad52('0x5f')]){logger[_0xad52('0x12')](_0xad52('0x60'),_0xad52('0x61'));_0x5bfae0[_0xad52('0x62')]=_0x1c0bcd;}else if(_0x3e645b&&_0x3e645b['recordingFormat']&&_0x3e645b[_0xad52('0x63')]!==_0xad52('0x64')){logger[_0xad52('0x12')](_0xad52('0x65'),'Recording\x20is\x20enabled!');_0x5bfae0[_0xad52('0x62')]=_0x1c0bcd;}else{_0x5bfae0[_0xad52('0x62')]='';}return getAdminUser(_0x329ca7,_0x30d914,_0x2fcfed,_0x521d9e,_0x3facae,_0x29b21e)[_0xad52('0xd')](getUser(_0x329ca7,_0x30d914,_0x521d9e,_0x3facae,_0x29b21e))[_0xad52('0xd')](getEndUser(_0x329ca7,_0x30d914,_0x521d9e,_0x3facae,_0x29b21e))[_0xad52('0xd')](getTicket(_0x329ca7,_0x30d914,_0x521d9e,_0x3ad6bd,_0x5bfae0,_0x3facae))[_0xad52('0xd')](function(_0x2a91d8){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x2a91d8[_0xad52('0x3d')]));logger['info'](util[_0xad52('0x4e')](_0xad52('0x66'),_0x329ca7));if(_0x329ca7!==_0xad52('0x67')){logger[_0xad52('0x12')]('['+[_0x329ca7[_0xad52('0x16')]()]+']',_0xad52('0x68'));emit(_0x260561['remoteUri'],_0x1e11c4[_0xad52('0x37')],_0x2a91d8[_0xad52('0x3d')]);}})[_0xad52('0x14')](function(_0x43179a){logger['error']('['+[_0x329ca7[_0xad52('0x16')]()]+_0xad52('0x69'),util[_0xad52('0x6a')](_0x43179a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6785=['push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','trigger:browser:url','username','password','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','catch','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','customField','idField','content','toString','variable','variableName','Variable','name','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','?sysparm_query=name%3D','label_entry','incident','ticketId','Incident\x20-\x20'];(function(_0x15eee2,_0x4fd9b4){var _0x568a6b=function(_0x2db6ba){while(--_0x2db6ba){_0x15eee2['push'](_0x15eee2['shift']());}};_0x568a6b(++_0x4fd9b4);}(_0x6785,0x1c8));var _0x5678=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6785[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x5678('0x0'));var Promise=require(_0x5678('0x1'));var rp=require(_0x5678('0x2'));var util=require('util');var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0x5678('0x3'));var config=require(_0x5678('0x4'));var logger=require(_0x5678('0x5'))(_0x5678('0x6'));config[_0x5678('0x7')]=_[_0x5678('0x8')](config[_0x5678('0x7')],{'host':_0x5678('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5678('0x7')]));function getAdminUser(_0x500f8c,_0x5af4b1,_0x1b46f7,_0x57142c,_0x492753,_0x19eb41){return new Promise(function(_0x4b69e0,_0x3b7082){var _0x2b5df9={'method':_0x5678('0xa'),'uri':_0x57142c+_0x5678('0xb')+'&'+_0x492753+'&'+_0x19eb41,'auth':_0x5af4b1,'json':!![]};return rp(_0x2b5df9)[_0x5678('0xc')](function(_0x3cdd8b){if(_0x3cdd8b[_0x5678('0xd')][_0x5678('0xe')]>0x0){_0x1b46f7[_0x5678('0xf')]=_0x3cdd8b['result'][0x0][_0x5678('0x10')];}logger[_0x5678('0x11')]('['+[_0x500f8c[_0x5678('0x12')]()]+'],\x20getAdminUser\x20crm',_0x1b46f7);_0x4b69e0(_0x1b46f7);})['catch'](function(_0x42408e){logger['error']('['+[_0x500f8c[_0x5678('0x12')]()]+']',_0x42408e['message']);_0x3b7082(_0x42408e[_0x5678('0x13')]);});});}function getUser(_0x4b5fd2,_0x1695da,_0x15ba43,_0x397ef9,_0x49372a){return function(_0x1f6aad){logger[_0x5678('0x11')]('['+[_0x4b5fd2[_0x5678('0x12')]()]+_0x5678('0x14'),_0x1f6aad);return new Promise(function(_0x4b6cfc,_0x3a0178){if(intUtil[_0x5678('0x15')](_0x1f6aad[_0x5678('0x16')])){var _0x49edbb={'method':'GET','uri':_0x15ba43+_0x5678('0x17')+_0x1f6aad[_0x5678('0x16')]+'&'+_0x397ef9+'&'+_0x49372a,'auth':_0x1695da,'json':!![]};logger[_0x5678('0x11')]('['+[_0x4b5fd2[_0x5678('0x12')]()]+_0x5678('0x18'),_0x49edbb);return rp(_0x49edbb)[_0x5678('0xc')](function(_0x1fa57e){logger[_0x5678('0x11')]('['+[_0x4b5fd2[_0x5678('0x12')]()]+'],\x20getUser\x20entity',_0x1fa57e);if(_0x1fa57e[_0x5678('0xd')][_0x5678('0xe')]>0x0&&String(_0x1fa57e[_0x5678('0xd')][0x0][_0x5678('0x19')])===_0x5678('0x1a')){_0x1f6aad[_0x5678('0x1b')]=_0x1fa57e[_0x5678('0xd')][0x0][_0x5678('0x10')];}else{_0x1f6aad[_0x5678('0x1b')]=_0x1f6aad['adminId'];_0x1f6aad[_0x5678('0x16')]=_0x1f6aad[_0x5678('0x1c')];}logger['info']('['+[_0x4b5fd2[_0x5678('0x12')]()]+'],\x20getUser\x20crm',_0x1f6aad);_0x4b6cfc(_0x1f6aad);})[_0x5678('0x1d')](function(_0x57e318){logger[_0x5678('0x1e')]('['+[_0x4b5fd2[_0x5678('0x12')]()]+']',_0x57e318['message']);_0x3a0178(_0x57e318[_0x5678('0x13')]);});}else{logger[_0x5678('0x11')]('['+[_0x4b5fd2['toUpperCase']()]+_0x5678('0x1f'));_0x1f6aad[_0x5678('0x1b')]=_0x1f6aad['adminId'];_0x1f6aad[_0x5678('0x16')]=_0x1f6aad[_0x5678('0x1c')];_0x4b6cfc(_0x1f6aad);}});};}function createEndUser(_0x50051a,_0x2a353a,_0x5b354a,_0xe81e15,_0x59889a){logger['info']('['+[_0x50051a[_0x5678('0x12')]()]+_0x5678('0x20'),_0x5b354a);return new Promise(function(_0x55b281,_0x1ab884){var _0x56c91a={'method':_0x5678('0x21'),'uri':_0xe81e15+_0x5678('0x22')+_0x59889a,'body':{'user_name':_0x5b354a['endUserNumber'],'roles':'user','first_name':_0x5b354a['endUserNumber'],'active':_0x5678('0x1a'),'date_format':'System','phone':_0x5b354a[_0x5678('0x23')]},'auth':_0x2a353a,'json':!![]};return rp(_0x56c91a)[_0x5678('0xc')](function(_0x5beeff){logger[_0x5678('0x11')]('['+[_0x50051a[_0x5678('0x12')]()]+_0x5678('0x24'),_0x5beeff['result']);_0x5b354a[_0x5678('0x25')]=_0x5beeff[_0x5678('0xd')][_0x5678('0x10')];_0x55b281(_0x5b354a);})[_0x5678('0x1d')](function(_0x4be695){logger[_0x5678('0x1e')]('['+[_0x50051a[_0x5678('0x12')]()]+']',_0x4be695['message']);_0x1ab884(_0x4be695['message']);});});}function getEndUser(_0x1849f0,_0x477d50,_0x53c4d7,_0x1b2730,_0xd4b590){return function(_0x3e9bec){logger['info']('['+[_0x1849f0[_0x5678('0x12')]()]+_0x5678('0x26'),_0x3e9bec);return new Promise(function(_0xcd2f61,_0x148067){var _0x9666c8={'method':_0x5678('0xa'),'uri':_0x53c4d7+_0x5678('0x27')+_0x3e9bec[_0x5678('0x23')]+'&'+_0x1b2730+'&'+_0xd4b590,'auth':_0x477d50,'json':!![]};return rp(_0x9666c8)[_0x5678('0xc')](function(_0xac01fb){if(_0xac01fb[_0x5678('0xd')][_0x5678('0xe')]>0x0){_0x3e9bec[_0x5678('0x25')]=_0xac01fb[_0x5678('0xd')][0x0]['sys_id'];logger[_0x5678('0x11')]('['+[_0x1849f0[_0x5678('0x12')]()]+_0x5678('0x28'),_0x3e9bec);_0xcd2f61(_0x3e9bec);}else{return createEndUser(_0x1849f0,_0x477d50,_0x3e9bec,_0x53c4d7,_0x1b2730)['then'](function(_0x41471c){logger['info']('['+[_0x1849f0[_0x5678('0x12')]()]+'],\x20createEndUser\x20crm',_0x41471c);_0xcd2f61(_0x41471c);});}})['catch'](function(_0x8792a9){logger['error']('['+[_0x1849f0[_0x5678('0x12')]()]+']',_0x8792a9[_0x5678('0x13')]);_0x148067(_0x8792a9['message']);});});};}function getCustomFields(_0x2bf7cc,_0x4d6c24){var _0x1bcfcc={};if(_0x2bf7cc[_0x5678('0xe')]>0x0){_[_0x5678('0x29')](_0x2bf7cc,function(_0x1ec415){if(_[_0x5678('0x2a')]([_0x5678('0x2b'),_0x5678('0x2c')],_0x1ec415[_0x5678('0x2d')])&&_0x1ec415[_0x5678('0x2e')]&&!_0x1ec415['customField']){_0x1bcfcc[_0x1ec415[_0x5678('0x2e')][_0x5678('0x2f')]()]=_0x1ec415['content']['toString']();}else if(_[_0x5678('0x2a')]([_0x5678('0x2b'),'picklist'],_0x1ec415[_0x5678('0x2d')])&&_0x1ec415['idField']&&_0x1ec415[_0x5678('0x30')]){_0x1bcfcc[_0x1ec415[_0x5678('0x31')][_0x5678('0x2f')]()]=_0x1ec415[_0x5678('0x32')][_0x5678('0x33')]();}else if(_0x1ec415['type']===_0x5678('0x34')&&_0x1ec415[_0x5678('0x35')]&&_0x1ec415[_0x5678('0x31')]&&_0x1ec415[_0x5678('0x30')]){_0x1bcfcc[_0x1ec415['idField'][_0x5678('0x2f')]()]=_0x4d6c24[_0x1ec415[_0x5678('0x35')]][_0x5678('0x33')]();}else if(_0x1ec415[_0x5678('0x2d')]==='customVariable'&&_0x1ec415[_0x5678('0x36')]&&_0x1ec415[_0x5678('0x36')][_0x5678('0x37')]&&_0x1ec415[_0x5678('0x31')]&&_0x1ec415[_0x5678('0x30')]){_0x1bcfcc[_0x1ec415[_0x5678('0x31')][_0x5678('0x2f')]()]=_0x4d6c24[_0x1ec415['Variable']['name'][_0x5678('0x2f')]()][_0x5678('0x33')]();}});}return _0x1bcfcc;}function getTicket(_0x39ae76,_0x9602df,_0x1c7a7a,_0xfe1c33,_0x50e4ca,_0x55a105){return function(_0x5d4a72){logger[_0x5678('0x11')]('['+[_0x39ae76[_0x5678('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x5d4a72);return new Promise(function(_0x264494,_0x4aa4c8){var _0x294535=_0x39ae76['toLowerCase']()==='outbound'?_0x5d4a72[_0x5678('0x1b')]:_0x5d4a72[_0x5678('0x25')];var _0x2e5f16={'method':'POST','uri':_0x1c7a7a+'incident'+'?'+_0x55a105,'body':Object[_0x5678('0x38')]({},{'active':_0x5678('0x1a'),'caller_id':_0x294535,'assigned_to':_0x5d4a72[_0x5678('0x1b')],'short_description':intUtil[_0x5678('0x39')](_0xfe1c33[_0x5678('0x3a')],_0x50e4ca,'\x20'),'description':intUtil[_0x5678('0x39')](_0xfe1c33['Descriptions'],_0x50e4ca,'\x0a')},getCustomFields(_0xfe1c33[_0x5678('0x3b')],_0x50e4ca)),'auth':_0x9602df,'json':!![]};return rp(_0x2e5f16)[_0x5678('0xc')](function(_0x262ea5){logger[_0x5678('0x11')]('['+[_0x39ae76['toUpperCase']()]+_0x5678('0x3c'),_0x262ea5[_0x5678('0xd')]);_0x5d4a72['ticketId']=_0x262ea5['result'][_0x5678('0x10')];_0x5d4a72[_0x5678('0x3d')]=_0x262ea5['result'][_0x5678('0x3e')];logger['info']('['+[_0x39ae76['toUpperCase']()]+_0x5678('0x3f'),_0x5d4a72);_0x264494(_0x5d4a72);})[_0x5678('0x1d')](function(_0x4f42fd){logger[_0x5678('0x1e')]('['+[_0x39ae76[_0x5678('0x12')]()]+']',_0x4f42fd['message']);_0x4aa4c8(_0x4f42fd[_0x5678('0x13')]);});});};}function createRemoteTag(_0x46b9bd,_0xe9677e,_0x4e7cf5,_0x2d4804){return new Promise(function(_0xa760d3,_0x4c41da){var _0x16c083={'method':'POST','uri':_0x4e7cf5+'label'+'?'+_0x2d4804,'body':{'short_description':_0x46b9bd,'global':!![],'active':!![],'name':_0x46b9bd},'auth':_0xe9677e,'json':!![]};return rp(_0x16c083)[_0x5678('0xc')](function(_0x1d08ef){var _0x19a4f9=_0x1d08ef[_0x5678('0xd')][_0x5678('0x10')];_0xa760d3(_0x19a4f9);});});}function getRemoteTag(_0x30f860,_0x3374a4,_0x274c76,_0x709e00,_0x1c1c32){return new Promise(function(_0x19b0e3,_0x5230f8){var _0x1d8040={'method':_0x5678('0xa'),'uri':_0x274c76+'label'+_0x5678('0x40')+_0x30f860+'&'+_0x709e00,'auth':_0x3374a4,'json':!![]};return rp(_0x1d8040)[_0x5678('0xc')](function(_0xd0e473){if(_0xd0e473[_0x5678('0xd')][_0x5678('0xe')]>0x0){var _0x2c66e6=_0xd0e473[_0x5678('0xd')][0x0]['sys_id'];_0x19b0e3(_0x2c66e6);}else{return createRemoteTag(_0x30f860,_0x3374a4,_0x274c76,_0x709e00)[_0x5678('0xc')](function(_0xa4277){_0x19b0e3(_0xa4277);});}});});}function assignTagToIncident(_0x123ded,_0x16bbf6,_0x1e26c4,_0x5b1949,_0x511a56){return new Promise(function(_0x3952b5,_0x328066){var _0x452c32={'method':_0x5678('0x21'),'uri':_0x1e26c4+_0x5678('0x41')+'?'+_0x511a56,'body':{'label':_0x123ded,'table':_0x5678('0x42'),'id_type':'Incident','table_key':_0x5b1949[_0x5678('0x43')],'title':_0x5678('0x44')+_0x5b1949[_0x5678('0x3d')],'id_display':_0x5b1949['ticketNumber']},'auth':_0x16bbf6,'json':!![]};return rp(_0x452c32)[_0x5678('0xc')](function(_0x559318){_0x3952b5();})[_0x5678('0x1d')](function(){_0x3952b5();});});}function manageTags(_0x4943fa,_0x30ff2f,_0x142914,_0x56784b,_0x58b408,_0x34d774,_0x4204d2){return new Promise(function(_0x19f910,_0x2be096){var _0x38de6c=[];_0x30ff2f[_0x5678('0x29')](function(_0x556fda){_0x38de6c[_0x5678('0x45')](getRemoteTag(_0x556fda,_0x142914,_0x56784b,_0x34d774,_0x4204d2));});return Promise[_0x5678('0x46')](_0x38de6c)[_0x5678('0xc')](function(_0x337e1c){if(_0x337e1c[_0x5678('0xe')]){logger[_0x5678('0x11')]('['+[_0x4943fa[_0x5678('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x337e1c);var _0x2eda1d=[];_0x337e1c[_0x5678('0x29')](function(_0x24975f){_0x2eda1d[_0x5678('0x45')](assignTagToIncident(_0x24975f,_0x142914,_0x56784b,_0x58b408,_0x34d774));});return Promise[_0x5678('0x46')](_0x2eda1d)[_0x5678('0xc')](function(){_0x19f910();})[_0x5678('0x1d')](function(){_0x19f910();});}else{_0x19f910();}});});}function getTags(_0x4c3e40,_0xd497b0,_0xa7533b,_0x3b8706,_0x2b9373,_0x275e40){return function(_0x19dde1){return new Promise(function(_0x315fcd,_0x66cc99){var _0x3b2710=[];var _0x36dd03=_0x3b8706[_0x5678('0x47')];if(_0x36dd03&&_0x36dd03['length']>0x0){_0x3b2710=_[_0x5678('0x48')](_0x36dd03,_0x5678('0x37'));}if(_0x3b2710[_0x5678('0xe')]>0x0){return manageTags(_0x4c3e40,_0x3b2710,_0xd497b0,_0xa7533b,_0x19dde1,_0x2b9373,_0x275e40)[_0x5678('0xc')](function(){_0x315fcd(_0x19dde1);});}else{_0x315fcd(_0x19dde1);}});};}function emit(_0x3e21e2,_0x1ea128,_0x5b263c){var _0x34eb61=_0x5678('0x49')+_0x5678('0x4a')+_0x5678('0x4b')+_0x5678('0x4c');var _0x4a5b5a={'uri':_0x3e21e2+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x5b263c+_0x34eb61};io['to'](util[_0x5678('0x4d')](_0x5678('0x4e'),_0x1ea128))['emit'](_0x5678('0x4f'),_0x4a5b5a);}exports['cs']=function(_0x3856c5,_0x1e2475,_0x487582,_0x505d7e,_0x3dc5eb,_0x25c09a,_0x33c35b,_0x17af27){var _0x7bbead={};var _0x17b55f={'user':_0x25c09a[_0x5678('0x50')],'pass':_0x25c09a[_0x5678('0x51')]};var _0x463f08='sysparm_limit=1';var _0x2ab869='sysparm_display_value=true';_0x25c09a[_0x5678('0x52')]=intUtil[_0x5678('0x53')](_0x25c09a[_0x5678('0x52')]);_0x25c09a[_0x5678('0x54')]=intUtil['stripTrailingSlash'](_0x25c09a['serverUrl']);var _0xb5173e=util['format'](_0x5678('0x55'),_0x25c09a[_0x5678('0x52')]);_0x7bbead[_0x5678('0x16')]=!_[_0x5678('0x56')](_0x505d7e)?_0x505d7e[_0x5678('0x57')]:null;_0x7bbead[_0x5678('0x1c')]=_0x25c09a[_0x5678('0x57')];_0x7bbead[_0x5678('0x23')]=_0x17af27[_0x5678('0x2f')]()===_0x5678('0x58')?_0x1e2475[_0x5678('0x59')]:_0x1e2475[_0x5678('0x5a')];_0x7bbead[_0x5678('0x5b')]=_0x17af27===_0x5678('0x5c')||_0x17af27===_0x5678('0x5d')?_0x5678('0x5c'):_0x5678('0x58');var _0x3b1bf7=util[_0x5678('0x4d')](_0x5678('0x5e'),_0x25c09a[_0x5678('0x54')],_0x1e2475['uniqueid'],md5(_0x1e2475[_0x5678('0x5f')]));if(_0x3dc5eb&&_0x3dc5eb['monitor_format']){logger['info'](_0x5678('0x60'),'Recording\x20is\x20enabled!');_0x1e2475[_0x5678('0x61')]=_0x3b1bf7;}else if(_0x33c35b&&_0x33c35b[_0x5678('0x62')]&&_0x33c35b[_0x5678('0x62')]!==_0x5678('0x63')){logger[_0x5678('0x11')](_0x5678('0x64'),'Recording\x20is\x20enabled!');_0x1e2475[_0x5678('0x61')]=_0x3b1bf7;}else{_0x1e2475[_0x5678('0x61')]='';}return getAdminUser(_0x17af27,_0x17b55f,_0x7bbead,_0xb5173e,_0x2ab869,_0x463f08)['then'](getUser(_0x17af27,_0x17b55f,_0xb5173e,_0x2ab869,_0x463f08))[_0x5678('0xc')](getEndUser(_0x17af27,_0x17b55f,_0xb5173e,_0x2ab869,_0x463f08))['then'](getTicket(_0x17af27,_0x17b55f,_0xb5173e,_0x487582,_0x1e2475,_0x2ab869))[_0x5678('0xc')](function(_0x5a24a6){logger[_0x5678('0x11')](util[_0x5678('0x4d')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5a24a6[_0x5678('0x43')]));logger['info'](util['format'](_0x5678('0x65'),_0x17af27));if(_0x17af27!==_0x5678('0x5d')){logger['info']('['+[_0x17af27[_0x5678('0x12')]()]+']',_0x5678('0x66'));emit(_0x25c09a[_0x5678('0x52')],_0x505d7e['name'],_0x5a24a6[_0x5678('0x43')]);}})[_0x5678('0x1d')](function(_0x6fcebb){logger[_0x5678('0x1e')]('['+[_0x17af27[_0x5678('0x12')]()]+_0x5678('0x67'),util[_0x5678('0x68')](_0x6fcebb,{'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 711308e..99be805 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 _0x9f07=['remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','Outbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','isNil','calleridname','calleridnum','Inbound','lastevent','toUpperCase','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','defaults','socket.io-emitter','redis','POST','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','direction','length','variableName','push','set_entry','JSON','stringify','Calls','apiKey','toString','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','idField','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue'];(function(_0x30c50c,_0x4c486d){var _0x528c67=function(_0x35ee0d){while(--_0x35ee0d){_0x30c50c['push'](_0x30c50c['shift']());}};_0x528c67(++_0x4c486d);}(_0x9f07,0x118));var _0x79f0=function(_0x415262,_0xacc412){_0x415262=_0x415262-0x0;var _0x5ad2b7=_0x9f07[_0x415262];return _0x5ad2b7;};'use strict';var _=require(_0x79f0('0x0'));var rp=require(_0x79f0('0x1'));var BPromise=require('bluebird');var md5=require(_0x79f0('0x2'));var util=require('util');var Redis=require(_0x79f0('0x3'));var intUtil=require('./util');var config=require(_0x79f0('0x4'));var logger=require(_0x79f0('0x5'))('sugarcrm');config['redis']=_[_0x79f0('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x79f0('0x7'))(new Redis(config[_0x79f0('0x8')]));var def={'method':_0x79f0('0x9'),'json':!![]};function emit(_0x4c8cf8,_0x46d371,_0x2aea15){io['to'](_0x4c8cf8)[_0x79f0('0xa')](_0x46d371,_0x2aea15);}function getTicket(_0x3945b8,_0x461362,_0x2dc465,_0x218490,_0x285e5c,_0x572255,_0x3f2b9f,_0xa77af7){logger[_0x79f0('0xb')](_0x79f0('0xc'));var _0x5a4fb0=new Date();var _0x4e6495=[{'name':_0x79f0('0xd'),'value':intUtil[_0x79f0('0xe')](_0x218490['Subjects'],_0x285e5c,'\x20')},{'name':_0x79f0('0xf'),'value':_0x461362['id']},{'name':_0x79f0('0x10'),'value':_0x461362['id']},{'name':_0x79f0('0x11'),'value':intUtil[_0x79f0('0xe')](_0x218490[_0x79f0('0x12')],_0x285e5c,'\x0a')},{'name':_0x79f0('0x13'),'value':_0x5a4fb0[_0x79f0('0x14')]()[_0x79f0('0x15')](0x0,0x13)[_0x79f0('0x16')]('T','\x20')},{'name':_0x79f0('0x17'),'value':'0'},{'name':_0x79f0('0x18'),'value':'15'},{'name':_0x79f0('0x19'),'value':_0x2dc465['id']},{'name':'parent_type','value':_0x79f0('0x1a')},{'name':'parent_name','value':_0x2dc465[_0x79f0('0xd')]},{'name':_0x79f0('0x1b'),'value':_0xa77af7}];if(_0x572255[_0x79f0('0x1c')]){_['forEach'](_0x572255,function(_0x42117a){if(_0x285e5c[_0x42117a[_0x79f0('0x1d')]]){_0x4e6495[_0x79f0('0x1e')]({'name':_0x42117a['idField'],'value':_0x285e5c[_0x42117a[_0x79f0('0x1d')]]});}});}return request({'form':{'method':_0x79f0('0x1f'),'input_type':'JSON','response_type':_0x79f0('0x20'),'rest_data':JSON[_0x79f0('0x21')]({'session':_0x3f2b9f['id'],'module_name':_0x79f0('0x22'),'name_value_list':_0x4e6495})}});}function getAuth(_0x244dc6){return util['format']('Basic\x20%s',new Buffer(_0x244dc6[_0x79f0('0x23')]+':X')[_0x79f0('0x24')]('base64'));}function getServerInfo(_0x1724c8){return request({'form':{'method':'get_server_info','input_type':_0x79f0('0x20'),'response_type':_0x79f0('0x20'),'rest_data':JSON[_0x79f0('0x21')]({'session':_0x1724c8['id']})}});}function getUser(_0xb4be01,_0x16b9b4,_0x4f5e61){if(!_['isNil'](_0x16b9b4)){logger['info'](_0x79f0('0x25'),_0x16b9b4);return request({'form':{'method':_0x79f0('0x26'),'input_type':'JSON','response_type':_0x79f0('0x20'),'rest_data':JSON[_0x79f0('0x21')]({'session':_0x4f5e61['id'],'module_name':_0x79f0('0x27'),'query':util['format'](_0x79f0('0x28'),_0x16b9b4),'order_by':'','offset':'0','select_fields':['id',_0x79f0('0xd'),_0x79f0('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x79f0('0x2a')](function(_0x19c57e){if(_0x19c57e['entry_list'][_0x79f0('0x1c')]){var _0xdaca68=_[_0x79f0('0x2b')](_0x19c57e[_0x79f0('0x2c')],function(_0x1bcf07){return _0x1bcf07['name_value_list'][_0x79f0('0x29')][_0x79f0('0x2d')]===_0x16b9b4;});if(_0xdaca68){logger[_0x79f0('0xb')](_0x79f0('0x2e'));return BPromise[_0x79f0('0x2f')]({'id':_0xdaca68[_0x79f0('0x30')]['id'][_0x79f0('0x2d')],'name':_0xdaca68['name_value_list'][_0x79f0('0xd')]['value']});}}logger['info'](_0x79f0('0x31'));return BPromise[_0x79f0('0x2f')]({'id':_0x4f5e61['name_value_list'][_0x79f0('0x32')][_0x79f0('0x2d')],'name':_0x4f5e61[_0x79f0('0x30')][_0x79f0('0x29')][_0x79f0('0x2d')]});});}else{logger[_0x79f0('0xb')](_0x79f0('0x33'));return BPromise[_0x79f0('0x2f')]({'id':_0x4f5e61[_0x79f0('0x30')]['user_id']['value'],'name':_0x4f5e61['name_value_list']['user_name']['value']});}}function getEndUser(_0x5c6b22,_0x2a11a8,_0x46ec4d,_0x5ea6c4){logger[_0x79f0('0xb')]('Searching\x20enduser\x20with\x20phone',_0x46ec4d);return request({'form':{'method':_0x79f0('0x26'),'input_type':_0x79f0('0x20'),'response_type':_0x79f0('0x20'),'rest_data':JSON[_0x79f0('0x21')]({'session':_0x5ea6c4['id'],'module_name':'Contacts','query':util[_0x79f0('0x34')](_0x79f0('0x35'),_0x46ec4d),'order_by':'','offset':'0','select_fields':['id',_0x79f0('0xd'),_0x79f0('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x79f0('0x2a')](function(_0x6785bd){if(_0x6785bd[_0x79f0('0x2c')][_0x79f0('0x1c')]){var _0xeea842=_[_0x79f0('0x2b')](_0x6785bd['entry_list'],function(_0x25b939){return _0x25b939[_0x79f0('0x30')][_0x79f0('0x36')][_0x79f0('0x2d')]===_0x46ec4d;});if(_0xeea842){logger[_0x79f0('0xb')]('Enduser\x20found!');return BPromise[_0x79f0('0x2f')]({'id':_0xeea842['name_value_list']['id'][_0x79f0('0x2d')],'name':_0xeea842['name_value_list'][_0x79f0('0xd')][_0x79f0('0x2d')],'phone':_0xeea842[_0x79f0('0x30')][_0x79f0('0x36')][_0x79f0('0x2d')]});}}else{logger[_0x79f0('0xb')](_0x79f0('0x37'));return request({'form':{'method':_0x79f0('0x1f'),'input_type':'JSON','response_type':_0x79f0('0x20'),'rest_data':JSON[_0x79f0('0x21')]({'session':_0x5ea6c4['id'],'module_name':_0x79f0('0x1a'),'name_value_list':[{'name':_0x79f0('0x38'),'value':_0x2a11a8!==_0x79f0('0x39')?_0x2a11a8:util['format'](_0x79f0('0x3a'),_0x46ec4d)},{'name':'phone_home','value':_0x46ec4d}]})}})[_0x79f0('0x2a')](function(_0x2179e6){logger['info']('Enduser\x20created.');return BPromise[_0x79f0('0x2f')]({'id':_0x2179e6['id'],'name':_0x2179e6[_0x79f0('0x2c')][_0x79f0('0x38')]['value'],'phone':_0x2179e6[_0x79f0('0x2c')][_0x79f0('0x36')][_0x79f0('0x2d')]});});}});}function request(_0x2fcb83){logger[_0x79f0('0x3b')](_0x79f0('0x3c'),JSON[_0x79f0('0x21')](_0x2fcb83));return rp(_[_0x79f0('0x3d')](def,_0x2fcb83));}function getTags(_0x58508b,_0x3170f7){var _0x3b08f1=[];if(_0x58508b&&_0x58508b[_0x79f0('0x1c')]>0x0){_0x3b08f1=_[_0x79f0('0x3e')](_0x58508b,_0x3170f7);}return _0x3b08f1;}function getCustomFields(_0x223cfc,_0x5e87ca){var _0x75211b=[];var _0x2daa1c={'custom_fields':[]};if(_0x223cfc[_0x79f0('0x1c')]>0x0){_[_0x79f0('0x3f')](_0x223cfc,function(_0x17c6d2){if(_0x17c6d2[_0x79f0('0x40')]===_0x79f0('0x41')&&_0x17c6d2[_0x79f0('0x42')]&&!_0x17c6d2[_0x79f0('0x43')]){_0x2daa1c[_0x17c6d2[_0x79f0('0x42')][_0x79f0('0x44')]()]=_0x17c6d2[_0x79f0('0x45')]['toString']();}else if(_0x17c6d2['type']==='string'&&_0x17c6d2['idField']&&_0x17c6d2['customField']){_0x2daa1c[_0x79f0('0x46')][_0x79f0('0x1e')]({'id':_0x17c6d2['idField'],'value':_0x17c6d2[_0x79f0('0x45')][_0x79f0('0x24')]()});}else if(_0x17c6d2[_0x79f0('0x40')]===_0x79f0('0x47')&&_0x17c6d2[_0x79f0('0x1d')]&&_0x17c6d2[_0x79f0('0x48')]&&_0x17c6d2['customField']){_0x5e87ca[_0x17c6d2['variableName']]&&_0x2daa1c['custom_fields'][_0x79f0('0x1e')]({'id':_0x17c6d2['idField'],'value':_0x5e87ca[_0x17c6d2[_0x79f0('0x1d')]][_0x79f0('0x24')]()});}else if(_0x17c6d2[_0x79f0('0x40')]===_0x79f0('0x49')&&_0x17c6d2['Variable']&&_0x17c6d2[_0x79f0('0x4a')][_0x79f0('0xd')]&&_0x17c6d2['idField']&&_0x17c6d2[_0x79f0('0x43')]){_0x5e87ca[_0x17c6d2['Variable'][_0x79f0('0xd')]['toLowerCase']()]&&_0x2daa1c[_0x79f0('0x46')][_0x79f0('0x1e')]({'id':_0x17c6d2[_0x79f0('0x48')],'value':_0x5e87ca[_0x17c6d2[_0x79f0('0x4a')]['name']['toLowerCase']()][_0x79f0('0x24')]()});}});}return _0x2daa1c;}function getConnection(_0x5f4ba1){return request({'method':'POST','form':{'method':_0x79f0('0x4b'),'input_type':_0x79f0('0x20'),'response_type':_0x79f0('0x20'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5f4ba1[_0x79f0('0x4c')],'password':_0x5f4ba1[_0x79f0('0x4d')],'encryption':_0x79f0('0x4e')},'application':_0x79f0('0x4f')})}})['then'](function(_0x3b8552){var _0x5ed2ea=_0x3b8552;if(_0x5ed2ea['id']){def[_0x79f0('0x50')]=_0x5ed2ea['id'];return BPromise[_0x79f0('0x2f')](_0x5ed2ea);}else{throw new Error(util[_0x79f0('0x34')]('Account\x20%d\x20is\x20not\x20valid',_0x5f4ba1['id']));}});}function setRelationship(_0x1c5e1b,_0x3f59dc,_0x337999,_0x24c671){return request({'form':{'method':_0x79f0('0x51'),'input_type':_0x79f0('0x20'),'response_type':_0x79f0('0x20'),'rest_data':JSON[_0x79f0('0x21')]({'session':_0x1c5e1b['id'],'module_name':_0x79f0('0x22'),'module_id':_0x337999['id'],'link_field_name':_0x24c671,'related_ids':[_0x3f59dc['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x79f0('0x52')]=function(_0x2dcca1,_0x3d1be7,_0x5d6122,_0x34b863,_0x1dcf35,_0xa2eeab){var _0x487fe6,_0x72103c,_0x592f7e,_0x2d78d8;_0xa2eeab[_0x79f0('0x53')]=intUtil[_0x79f0('0x54')](_0xa2eeab[_0x79f0('0x53')]);_0xa2eeab[_0x79f0('0x55')]=intUtil[_0x79f0('0x54')](_0xa2eeab['serverUrl']);def[_0x79f0('0x56')]=util[_0x79f0('0x34')](_0x79f0('0x57'),_0xa2eeab['remoteUri']);if(_0x1dcf35&&_0x1dcf35[_0x79f0('0x58')]){logger[_0x79f0('0xb')](_0x79f0('0x59'),'Recording\x20is\x20enabled!');_0x3d1be7[_0x79f0('0x5a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xa2eeab[_0x79f0('0x55')],_0x3d1be7['uniqueid'],md5(_0x3d1be7[_0x79f0('0x5b')]));}else{_0x3d1be7[_0x79f0('0x5a')]='';}return getConnection(_0xa2eeab)[_0x79f0('0x2a')](function(_0x2c3b04){_0x2d78d8=_0x2c3b04;return getUser(_0xa2eeab,_0x34b863[_0x79f0('0xd')],_0x2d78d8);})['then'](function(_0x1f0d7f){_0x487fe6=_0x1f0d7f;logger[_0x79f0('0xb')](_0x79f0('0x5c'),_0x487fe6['id']);return getEndUser(_0xa2eeab,_0x3d1be7['calleridname'],_0x3d1be7['calleridnum'],_0x2d78d8);})[_0x79f0('0x2a')](function(_0x3ef7d5){_0x72103c=_0x3ef7d5;logger[_0x79f0('0xb')](_0x79f0('0x5d'),_0x72103c['id']);return getTicket(_0xa2eeab,_0x487fe6,_0x72103c,_0x5d6122,_0x3d1be7,_0x5d6122[_0x79f0('0x5e')],_0x2d78d8,'Inbound');})[_0x79f0('0x2a')](function(_0x4b8eee){_0x592f7e=_0x4b8eee;logger[_0x79f0('0xb')]('Ticket\x20created!');logger[_0x79f0('0xb')]('The\x20Ticket\x20ID\x20is:',_0x592f7e['id']);return setRelationship(_0x2d78d8,_0x487fe6,_0x592f7e,_0x79f0('0x5f'));})[_0x79f0('0x2a')](function(){return setRelationship(_0x2d78d8,_0x72103c,_0x592f7e,_0x79f0('0x60'));})['then'](function(){return getServerInfo(_0x2d78d8);})[_0x79f0('0x2a')](function(_0x1a022f){var _0x133d39=parseInt(_0x1a022f[_0x79f0('0x61')][_0x79f0('0x62')](0x0));var _0x21d951=util[_0x79f0('0x34')](_0x79f0('0x63'),_0xa2eeab['remoteUri'],_0x592f7e['id']);if(_0x133d39>0x6){_0x21d951=util[_0x79f0('0x34')](_0x79f0('0x64'),_0xa2eeab[_0x79f0('0x53')],_0x592f7e['id']);}logger[_0x79f0('0xb')](_0x79f0('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x79f0('0x34')](_0x79f0('0x65'),_0x34b863[_0x79f0('0xd')]),_0x79f0('0x66'),{'uri':_0x21d951});})[_0x79f0('0x67')](function(_0x47c303){logger[_0x79f0('0x68')](_0x79f0('0x59'),JSON[_0x79f0('0x21')](_0x47c303));});};exports['outbound']=function(_0xd5b1c,_0x897f30,_0x4430cb,_0x34e029,_0x12b204,_0x205a2b,_0x4cc1fe){var _0x290355,_0x37042f,_0x4b2031,_0x27a98e;_0x205a2b[_0x79f0('0x53')]=intUtil[_0x79f0('0x54')](_0x205a2b[_0x79f0('0x53')]);_0x205a2b[_0x79f0('0x55')]=intUtil['stripTrailingSlash'](_0x205a2b[_0x79f0('0x55')]);def[_0x79f0('0x56')]=util[_0x79f0('0x34')](_0x79f0('0x57'),_0x205a2b[_0x79f0('0x53')]);if(_0x4cc1fe&&_0x4cc1fe[_0x79f0('0x69')]&&_0x4cc1fe[_0x79f0('0x69')]!==_0x79f0('0x6a')){logger[_0x79f0('0xb')](_0x79f0('0x6b'),_0x79f0('0x6c'));_0x897f30[_0x79f0('0x5a')]=util[_0x79f0('0x34')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x205a2b[_0x79f0('0x55')],_0x897f30[_0x79f0('0x5b')],md5(_0x897f30['uniqueid']));}return getConnection(_0x205a2b)[_0x79f0('0x2a')](function(_0x1277f5){_0x27a98e=_0x1277f5;return getUser(_0x205a2b,_0x34e029['name'],_0x27a98e);})[_0x79f0('0x2a')](function(_0x241c1f){_0x290355=_0x241c1f;logger[_0x79f0('0xb')](_0x79f0('0x5c'),_0x290355['id']);return getEndUser(_0x205a2b,_0x897f30['destcalleridname'],_0x897f30[_0x79f0('0x6d')],_0x27a98e);})['then'](function(_0x19b972){_0x37042f=_0x19b972;logger[_0x79f0('0xb')](_0x79f0('0x5d'),_0x37042f['id']);return getTicket(_0x205a2b,_0x290355,_0x37042f,_0x4430cb,_0x897f30,_0x4430cb[_0x79f0('0x5e')],_0x27a98e,_0x79f0('0x6e'));})['then'](function(_0x58b496){_0x4b2031=_0x58b496;logger['info'](_0x79f0('0x6f'));logger[_0x79f0('0xb')](_0x79f0('0x70'),_0x4b2031['id']);return setRelationship(_0x27a98e,_0x290355,_0x4b2031,_0x79f0('0x5f'));})[_0x79f0('0x2a')](function(){return setRelationship(_0x27a98e,_0x37042f,_0x4b2031,'contacts');})[_0x79f0('0x2a')](function(){return getServerInfo(_0x27a98e);})[_0x79f0('0x2a')](function(_0x37fe6a){var _0x4ff468=parseInt(_0x37fe6a[_0x79f0('0x61')]['charAt'](0x0));var _0x177649=util[_0x79f0('0x34')](_0x79f0('0x63'),_0x205a2b[_0x79f0('0x53')],_0x4b2031['id']);if(_0x4ff468>0x6){_0x177649=util[_0x79f0('0x34')](_0x79f0('0x64'),_0x205a2b['remoteUri'],_0x4b2031['id']);}logger[_0x79f0('0xb')](_0x79f0('0x6b'),_0x79f0('0x71'));emit(util['format'](_0x79f0('0x65'),_0x34e029[_0x79f0('0xd')]),'trigger:browser:url',{'uri':_0x177649});})['catch'](function(_0x3e4639){logger['error'](_0x79f0('0x6b'),JSON['stringify'](_0x3e4639));});};exports['unmanaged']=function(_0x545553,_0x45328f,_0x57d7f0,_0x16164f,_0xdea567,_0x5ee45f){var _0x51bfa8,_0x265c7b,_0x489a1a,_0x4b9ed5;_0x5ee45f[_0x79f0('0x53')]=intUtil['stripTrailingSlash'](_0x5ee45f['remoteUri']);_0x5ee45f[_0x79f0('0x55')]=intUtil[_0x79f0('0x54')](_0x5ee45f[_0x79f0('0x55')]);def['uri']=util[_0x79f0('0x34')](_0x79f0('0x57'),_0x5ee45f[_0x79f0('0x53')]);if(_0xdea567&&_0xdea567[_0x79f0('0x58')]){logger[_0x79f0('0xb')]('['+_0x45328f['lastevent']['toUpperCase']()+']',_0x79f0('0x6c'));_0x45328f['recordingURL']=util[_0x79f0('0x34')](_0x79f0('0x72'),_0x5ee45f[_0x79f0('0x55')],_0x45328f['uniqueid'],md5(_0x45328f[_0x79f0('0x5b')]));}else{_0x45328f['recordingURL']='';}return getConnection(_0x5ee45f)[_0x79f0('0x2a')](function(_0x523311){_0x4b9ed5=_0x523311;if(!_[_0x79f0('0x73')](_0x16164f)){return getUser(_0x5ee45f,_0x16164f[_0x79f0('0xd')],_0x4b9ed5);}else{return getUser(_0x5ee45f,null,_0x4b9ed5);}})[_0x79f0('0x2a')](function(_0x5d31c1){_0x51bfa8=_0x5d31c1;logger['info'](_0x79f0('0x5c'),_0x51bfa8['id']);return getEndUser(_0x5ee45f,_0x45328f[_0x79f0('0x74')],_0x45328f[_0x79f0('0x75')],_0x4b9ed5);})[_0x79f0('0x2a')](function(_0x50d1fb){_0x265c7b=_0x50d1fb;logger[_0x79f0('0xb')](_0x79f0('0x5d'),_0x265c7b['id']);return getTicket(_0x5ee45f,_0x51bfa8,_0x265c7b,_0x57d7f0,_0x45328f,_0x57d7f0[_0x79f0('0x5e')],_0x4b9ed5,_0x79f0('0x76'));})['then'](function(_0x386fb6){_0x489a1a=_0x386fb6;logger[_0x79f0('0xb')](_0x79f0('0x6f'));logger[_0x79f0('0xb')](_0x79f0('0x70'),_0x489a1a['id']);return setRelationship(_0x4b9ed5,_0x51bfa8,_0x489a1a,'users');})[_0x79f0('0x2a')](function(){return setRelationship(_0x4b9ed5,_0x265c7b,_0x489a1a,'contacts');})['then'](function(){return getServerInfo(_0x4b9ed5);})[_0x79f0('0x67')](function(_0x22ebd4){logger['error']('['+_0x45328f[_0x79f0('0x77')][_0x79f0('0x78')]()+']',JSON[_0x79f0('0x21')](_0x22ebd4));});}; \ No newline at end of file +var _0x1693=['destcalleridnum','Outbound','charAt','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','name','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','slice','duration_hours','duration_minutes','Contacts','parent_name','direction','length','variableName','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','string','nameField','customField','toLowerCase','content','type','variable','custom_fields','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','catch','error','outbound','uri','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','recordingURL','uniqueid','destcalleridname'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1693,0x103));var _0x3169=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0x1693[_0x28f1de];return _0x5b5dad;};'use strict';var _=require(_0x3169('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x3169('0x1'));var util=require(_0x3169('0x2'));var Redis=require(_0x3169('0x3'));var intUtil=require(_0x3169('0x4'));var config=require(_0x3169('0x5'));var logger=require(_0x3169('0x6'))(_0x3169('0x7'));config['redis']=_['defaults'](config[_0x3169('0x8')],{'host':_0x3169('0x9'),'port':0x18eb});var io=require(_0x3169('0xa'))(new Redis(config['redis']));var def={'method':_0x3169('0xb'),'json':!![]};function emit(_0x4d5d84,_0x11067b,_0xc33d67){io['to'](_0x4d5d84)[_0x3169('0xc')](_0x11067b,_0xc33d67);}function getTicket(_0x57d6b5,_0x2a598b,_0x39f44a,_0x8cd3f2,_0x1b0818,_0x421c06,_0x301030,_0x2691f5){logger[_0x3169('0xd')]('Creating\x20new\x20ticket...');var _0x2bd869=new Date();var _0x108f19=[{'name':_0x3169('0xe'),'value':intUtil[_0x3169('0xf')](_0x8cd3f2[_0x3169('0x10')],_0x1b0818,'\x20')},{'name':_0x3169('0x11'),'value':_0x2a598b['id']},{'name':_0x3169('0x12'),'value':_0x2a598b['id']},{'name':_0x3169('0x13'),'value':intUtil[_0x3169('0xf')](_0x8cd3f2['Descriptions'],_0x1b0818,'\x0a')},{'name':_0x3169('0x14'),'value':_0x2bd869[_0x3169('0x15')]()[_0x3169('0x16')](0x0,0x13)['replace']('T','\x20')},{'name':_0x3169('0x17'),'value':'0'},{'name':_0x3169('0x18'),'value':'15'},{'name':'parent_id','value':_0x39f44a['id']},{'name':'parent_type','value':_0x3169('0x19')},{'name':_0x3169('0x1a'),'value':_0x39f44a[_0x3169('0xe')]},{'name':_0x3169('0x1b'),'value':_0x2691f5}];if(_0x421c06[_0x3169('0x1c')]){_['forEach'](_0x421c06,function(_0x3a9471){if(_0x1b0818[_0x3a9471[_0x3169('0x1d')]]){_0x108f19[_0x3169('0x1e')]({'name':_0x3a9471[_0x3169('0x1f')],'value':_0x1b0818[_0x3a9471[_0x3169('0x1d')]]});}});}return request({'form':{'method':_0x3169('0x20'),'input_type':_0x3169('0x21'),'response_type':_0x3169('0x21'),'rest_data':JSON[_0x3169('0x22')]({'session':_0x301030['id'],'module_name':_0x3169('0x23'),'name_value_list':_0x108f19})}});}function getAuth(_0x16038d){return util['format'](_0x3169('0x24'),new Buffer(_0x16038d[_0x3169('0x25')]+':X')[_0x3169('0x26')](_0x3169('0x27')));}function getServerInfo(_0x40bea5){return request({'form':{'method':_0x3169('0x28'),'input_type':_0x3169('0x21'),'response_type':_0x3169('0x21'),'rest_data':JSON['stringify']({'session':_0x40bea5['id']})}});}function getUser(_0x5e9a93,_0x4ef285,_0x3f51a){if(!_[_0x3169('0x29')](_0x4ef285)){logger[_0x3169('0xd')](_0x3169('0x2a'),_0x4ef285);return request({'form':{'method':_0x3169('0x2b'),'input_type':_0x3169('0x21'),'response_type':_0x3169('0x21'),'rest_data':JSON['stringify']({'session':_0x3f51a['id'],'module_name':'Employees','query':util[_0x3169('0x2c')](_0x3169('0x2d'),_0x4ef285),'order_by':'','offset':'0','select_fields':['id',_0x3169('0xe'),_0x3169('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5b59e1){if(_0x5b59e1[_0x3169('0x2f')]['length']){var _0x24237b=_[_0x3169('0x30')](_0x5b59e1[_0x3169('0x2f')],function(_0x22739d){return _0x22739d[_0x3169('0x31')]['user_name'][_0x3169('0x32')]===_0x4ef285;});if(_0x24237b){logger['info'](_0x3169('0x33'));return BPromise['resolve']({'id':_0x24237b[_0x3169('0x31')]['id']['value'],'name':_0x24237b[_0x3169('0x31')][_0x3169('0xe')][_0x3169('0x32')]});}}logger[_0x3169('0xd')](_0x3169('0x34'));return BPromise[_0x3169('0x35')]({'id':_0x3f51a['name_value_list'][_0x3169('0x36')][_0x3169('0x32')],'name':_0x3f51a['name_value_list'][_0x3169('0x2e')][_0x3169('0x32')]});});}else{logger[_0x3169('0xd')](_0x3169('0x37'));return BPromise[_0x3169('0x35')]({'id':_0x3f51a[_0x3169('0x31')][_0x3169('0x36')][_0x3169('0x32')],'name':_0x3f51a[_0x3169('0x31')][_0x3169('0x2e')][_0x3169('0x32')]});}}function getEndUser(_0x47c881,_0x32ae58,_0x3be2c7,_0x4f3363){logger[_0x3169('0xd')](_0x3169('0x38'),_0x3be2c7);return request({'form':{'method':_0x3169('0x2b'),'input_type':_0x3169('0x21'),'response_type':_0x3169('0x21'),'rest_data':JSON[_0x3169('0x22')]({'session':_0x4f3363['id'],'module_name':_0x3169('0x19'),'query':util[_0x3169('0x2c')](_0x3169('0x39'),_0x3be2c7),'order_by':'','offset':'0','select_fields':['id','name',_0x3169('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3169('0x3b')](function(_0x5f0370){if(_0x5f0370[_0x3169('0x2f')][_0x3169('0x1c')]){var _0x4eb2e8=_[_0x3169('0x30')](_0x5f0370[_0x3169('0x2f')],function(_0x155427){return _0x155427['name_value_list'][_0x3169('0x3a')][_0x3169('0x32')]===_0x3be2c7;});if(_0x4eb2e8){logger['info'](_0x3169('0x3c'));return BPromise[_0x3169('0x35')]({'id':_0x4eb2e8['name_value_list']['id'][_0x3169('0x32')],'name':_0x4eb2e8[_0x3169('0x31')][_0x3169('0xe')][_0x3169('0x32')],'phone':_0x4eb2e8[_0x3169('0x31')]['phone_home']['value']});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x3169('0x20'),'input_type':_0x3169('0x21'),'response_type':_0x3169('0x21'),'rest_data':JSON['stringify']({'session':_0x4f3363['id'],'module_name':_0x3169('0x19'),'name_value_list':[{'name':'first_name','value':_0x32ae58!==_0x3169('0x3d')?_0x32ae58:util[_0x3169('0x2c')](_0x3169('0x3e'),_0x3be2c7)},{'name':_0x3169('0x3a'),'value':_0x3be2c7}]})}})[_0x3169('0x3b')](function(_0x47742e){logger[_0x3169('0xd')](_0x3169('0x3f'));return BPromise[_0x3169('0x35')]({'id':_0x47742e['id'],'name':_0x47742e[_0x3169('0x2f')]['first_name'][_0x3169('0x32')],'phone':_0x47742e[_0x3169('0x2f')][_0x3169('0x3a')]['value']});});}});}function request(_0x16e234){logger[_0x3169('0x40')](_0x3169('0x41'),JSON[_0x3169('0x22')](_0x16e234));return rp(_[_0x3169('0x42')](def,_0x16e234));}function getTags(_0x267396,_0x2ebc1e){var _0xd5edd8=[];if(_0x267396&&_0x267396[_0x3169('0x1c')]>0x0){_0xd5edd8=_[_0x3169('0x43')](_0x267396,_0x2ebc1e);}return _0xd5edd8;}function getCustomFields(_0x219299,_0x18fd0d){var _0x1d9708=[];var _0x599c30={'custom_fields':[]};if(_0x219299[_0x3169('0x1c')]>0x0){_[_0x3169('0x44')](_0x219299,function(_0x3bd6f1){if(_0x3bd6f1['type']===_0x3169('0x45')&&_0x3bd6f1[_0x3169('0x46')]&&!_0x3bd6f1[_0x3169('0x47')]){_0x599c30[_0x3bd6f1[_0x3169('0x46')][_0x3169('0x48')]()]=_0x3bd6f1[_0x3169('0x49')][_0x3169('0x26')]();}else if(_0x3bd6f1[_0x3169('0x4a')]===_0x3169('0x45')&&_0x3bd6f1[_0x3169('0x1f')]&&_0x3bd6f1[_0x3169('0x47')]){_0x599c30['custom_fields'][_0x3169('0x1e')]({'id':_0x3bd6f1[_0x3169('0x1f')],'value':_0x3bd6f1[_0x3169('0x49')]['toString']()});}else if(_0x3bd6f1[_0x3169('0x4a')]===_0x3169('0x4b')&&_0x3bd6f1[_0x3169('0x1d')]&&_0x3bd6f1[_0x3169('0x1f')]&&_0x3bd6f1['customField']){_0x18fd0d[_0x3bd6f1[_0x3169('0x1d')]]&&_0x599c30[_0x3169('0x4c')][_0x3169('0x1e')]({'id':_0x3bd6f1[_0x3169('0x1f')],'value':_0x18fd0d[_0x3bd6f1[_0x3169('0x1d')]][_0x3169('0x26')]()});}else if(_0x3bd6f1[_0x3169('0x4a')]===_0x3169('0x4d')&&_0x3bd6f1['Variable']&&_0x3bd6f1[_0x3169('0x4e')]['name']&&_0x3bd6f1['idField']&&_0x3bd6f1[_0x3169('0x47')]){_0x18fd0d[_0x3bd6f1[_0x3169('0x4e')]['name'][_0x3169('0x48')]()]&&_0x599c30[_0x3169('0x4c')][_0x3169('0x1e')]({'id':_0x3bd6f1[_0x3169('0x1f')],'value':_0x18fd0d[_0x3bd6f1['Variable'][_0x3169('0xe')][_0x3169('0x48')]()][_0x3169('0x26')]()});}});}return _0x599c30;}function getConnection(_0x5c676d){return request({'method':'POST','form':{'method':'login','input_type':_0x3169('0x21'),'response_type':_0x3169('0x21'),'rest_data':JSON[_0x3169('0x22')]({'user_auth':{'user_name':_0x5c676d[_0x3169('0x4f')],'password':_0x5c676d[_0x3169('0x50')],'encryption':_0x3169('0x51')},'application':_0x3169('0x52')})}})[_0x3169('0x3b')](function(_0x513e9f){var _0x2b0e82=_0x513e9f;if(_0x2b0e82['id']){def[_0x3169('0x53')]=_0x2b0e82['id'];return BPromise[_0x3169('0x35')](_0x2b0e82);}else{throw new Error(util[_0x3169('0x2c')](_0x3169('0x54'),_0x5c676d['id']));}});}function setRelationship(_0x20fe5d,_0x46d347,_0x3ca7a7,_0x20b1b4){return request({'form':{'method':_0x3169('0x55'),'input_type':_0x3169('0x21'),'response_type':_0x3169('0x21'),'rest_data':JSON[_0x3169('0x22')]({'session':_0x20fe5d['id'],'module_name':_0x3169('0x23'),'module_id':_0x3ca7a7['id'],'link_field_name':_0x20b1b4,'related_ids':[_0x46d347['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x3169('0x56')]=function(_0x1d7fd2,_0x18ce8d,_0x31274b,_0x38af12,_0x2e2e88,_0x2a0862){var _0x1c4a0b,_0x357404,_0xaeff44,_0x446ecf;_0x2a0862['remoteUri']=intUtil[_0x3169('0x57')](_0x2a0862[_0x3169('0x58')]);_0x2a0862[_0x3169('0x59')]=intUtil[_0x3169('0x57')](_0x2a0862['serverUrl']);def['uri']=util[_0x3169('0x2c')]('%s/service/v4_1/rest.php',_0x2a0862[_0x3169('0x58')]);if(_0x2e2e88&&_0x2e2e88[_0x3169('0x5a')]){logger['info'](_0x3169('0x5b'),_0x3169('0x5c'));_0x18ce8d['recordingURL']=util[_0x3169('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a0862[_0x3169('0x59')],_0x18ce8d['uniqueid'],md5(_0x18ce8d['uniqueid']));}else{_0x18ce8d['recordingURL']='';}return getConnection(_0x2a0862)[_0x3169('0x3b')](function(_0x541e72){_0x446ecf=_0x541e72;return getUser(_0x2a0862,_0x38af12[_0x3169('0xe')],_0x446ecf);})[_0x3169('0x3b')](function(_0x5098e7){_0x1c4a0b=_0x5098e7;logger['info'](_0x3169('0x5d'),_0x1c4a0b['id']);return getEndUser(_0x2a0862,_0x18ce8d['calleridname'],_0x18ce8d[_0x3169('0x5e')],_0x446ecf);})[_0x3169('0x3b')](function(_0x440302){_0x357404=_0x440302;logger[_0x3169('0xd')](_0x3169('0x5f'),_0x357404['id']);return getTicket(_0x2a0862,_0x1c4a0b,_0x357404,_0x31274b,_0x18ce8d,_0x31274b[_0x3169('0x60')],_0x446ecf,_0x3169('0x61'));})[_0x3169('0x3b')](function(_0x82c339){_0xaeff44=_0x82c339;logger[_0x3169('0xd')]('Ticket\x20created!');logger[_0x3169('0xd')](_0x3169('0x62'),_0xaeff44['id']);return setRelationship(_0x446ecf,_0x1c4a0b,_0xaeff44,_0x3169('0x63'));})[_0x3169('0x3b')](function(){return setRelationship(_0x446ecf,_0x357404,_0xaeff44,_0x3169('0x64'));})[_0x3169('0x3b')](function(){return getServerInfo(_0x446ecf);})[_0x3169('0x3b')](function(_0x35dde4){var _0xfd0267=parseInt(_0x35dde4[_0x3169('0x65')]['charAt'](0x0));var _0x1bf2a8=util[_0x3169('0x2c')](_0x3169('0x66'),_0x2a0862[_0x3169('0x58')],_0xaeff44['id']);if(_0xfd0267>0x6){_0x1bf2a8=util[_0x3169('0x2c')](_0x3169('0x67'),_0x2a0862[_0x3169('0x58')],_0xaeff44['id']);}logger['info'](_0x3169('0x5b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3169('0x2c')](_0x3169('0x68'),_0x38af12[_0x3169('0xe')]),'trigger:browser:url',{'uri':_0x1bf2a8});})[_0x3169('0x69')](function(_0x19210a){logger[_0x3169('0x6a')]('[QUEUE]',JSON[_0x3169('0x22')](_0x19210a));});};exports[_0x3169('0x6b')]=function(_0x11ec90,_0x4cbdcc,_0x28ccca,_0x49ce29,_0x3c91a1,_0x53404f,_0x22a453){var _0x2e417e,_0x542f44,_0x27ab0c,_0xeec372;_0x53404f[_0x3169('0x58')]=intUtil[_0x3169('0x57')](_0x53404f[_0x3169('0x58')]);_0x53404f['serverUrl']=intUtil[_0x3169('0x57')](_0x53404f[_0x3169('0x59')]);def[_0x3169('0x6c')]=util['format'](_0x3169('0x6d'),_0x53404f['remoteUri']);if(_0x22a453&&_0x22a453['recordingFormat']&&_0x22a453[_0x3169('0x6e')]!==_0x3169('0x6f')){logger[_0x3169('0xd')](_0x3169('0x70'),_0x3169('0x5c'));_0x4cbdcc[_0x3169('0x71')]=util[_0x3169('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x53404f[_0x3169('0x59')],_0x4cbdcc[_0x3169('0x72')],md5(_0x4cbdcc[_0x3169('0x72')]));}return getConnection(_0x53404f)['then'](function(_0x3d3e5d){_0xeec372=_0x3d3e5d;return getUser(_0x53404f,_0x49ce29[_0x3169('0xe')],_0xeec372);})['then'](function(_0x1b759e){_0x2e417e=_0x1b759e;logger['info']('The\x20User\x20ID\x20is:',_0x2e417e['id']);return getEndUser(_0x53404f,_0x4cbdcc[_0x3169('0x73')],_0x4cbdcc[_0x3169('0x74')],_0xeec372);})['then'](function(_0x386ec0){_0x542f44=_0x386ec0;logger[_0x3169('0xd')](_0x3169('0x5f'),_0x542f44['id']);return getTicket(_0x53404f,_0x2e417e,_0x542f44,_0x28ccca,_0x4cbdcc,_0x28ccca['Fields'],_0xeec372,_0x3169('0x75'));})[_0x3169('0x3b')](function(_0x356301){_0x27ab0c=_0x356301;logger[_0x3169('0xd')]('Ticket\x20created!');logger[_0x3169('0xd')]('The\x20Ticket\x20ID\x20is:',_0x27ab0c['id']);return setRelationship(_0xeec372,_0x2e417e,_0x27ab0c,_0x3169('0x63'));})[_0x3169('0x3b')](function(){return setRelationship(_0xeec372,_0x542f44,_0x27ab0c,_0x3169('0x64'));})[_0x3169('0x3b')](function(){return getServerInfo(_0xeec372);})[_0x3169('0x3b')](function(_0x1aa4c6){var _0x1bc331=parseInt(_0x1aa4c6['version'][_0x3169('0x76')](0x0));var _0x5eb7c3=util[_0x3169('0x2c')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x53404f[_0x3169('0x58')],_0x27ab0c['id']);if(_0x1bc331>0x6){_0x5eb7c3=util[_0x3169('0x2c')](_0x3169('0x67'),_0x53404f[_0x3169('0x58')],_0x27ab0c['id']);}logger['info'](_0x3169('0x70'),_0x3169('0x77'));emit(util[_0x3169('0x2c')](_0x3169('0x68'),_0x49ce29[_0x3169('0xe')]),'trigger:browser:url',{'uri':_0x5eb7c3});})[_0x3169('0x69')](function(_0x553667){logger[_0x3169('0x6a')](_0x3169('0x70'),JSON[_0x3169('0x22')](_0x553667));});};exports[_0x3169('0x78')]=function(_0xbd8439,_0xd25fc,_0x2f5e90,_0x24d916,_0x50f9e1,_0x42afa1){var _0x101ebf,_0x4fc02a,_0x29afb6,_0x2bc379;_0x42afa1[_0x3169('0x58')]=intUtil[_0x3169('0x57')](_0x42afa1['remoteUri']);_0x42afa1[_0x3169('0x59')]=intUtil[_0x3169('0x57')](_0x42afa1[_0x3169('0x59')]);def[_0x3169('0x6c')]=util[_0x3169('0x2c')]('%s/service/v4_1/rest.php',_0x42afa1['remoteUri']);if(_0x50f9e1&&_0x50f9e1['monitor_format']){logger['info']('['+_0xd25fc[_0x3169('0x79')][_0x3169('0x7a')]()+']',_0x3169('0x5c'));_0xd25fc['recordingURL']=util[_0x3169('0x2c')](_0x3169('0x7b'),_0x42afa1[_0x3169('0x59')],_0xd25fc[_0x3169('0x72')],md5(_0xd25fc[_0x3169('0x72')]));}else{_0xd25fc[_0x3169('0x71')]='';}return getConnection(_0x42afa1)[_0x3169('0x3b')](function(_0xdd468c){_0x2bc379=_0xdd468c;if(!_[_0x3169('0x29')](_0x24d916)){return getUser(_0x42afa1,_0x24d916[_0x3169('0xe')],_0x2bc379);}else{return getUser(_0x42afa1,null,_0x2bc379);}})[_0x3169('0x3b')](function(_0x5587a2){_0x101ebf=_0x5587a2;logger['info']('The\x20User\x20ID\x20is:',_0x101ebf['id']);return getEndUser(_0x42afa1,_0xd25fc[_0x3169('0x7c')],_0xd25fc[_0x3169('0x5e')],_0x2bc379);})[_0x3169('0x3b')](function(_0x8c6989){_0x4fc02a=_0x8c6989;logger[_0x3169('0xd')](_0x3169('0x5f'),_0x4fc02a['id']);return getTicket(_0x42afa1,_0x101ebf,_0x4fc02a,_0x2f5e90,_0xd25fc,_0x2f5e90[_0x3169('0x60')],_0x2bc379,_0x3169('0x61'));})['then'](function(_0x2ef8c7){_0x29afb6=_0x2ef8c7;logger[_0x3169('0xd')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x29afb6['id']);return setRelationship(_0x2bc379,_0x101ebf,_0x29afb6,_0x3169('0x63'));})[_0x3169('0x3b')](function(){return setRelationship(_0x2bc379,_0x4fc02a,_0x29afb6,_0x3169('0x64'));})[_0x3169('0x3b')](function(){return getServerInfo(_0x2bc379);})[_0x3169('0x69')](function(_0x2adf06){logger[_0x3169('0x6a')]('['+_0xd25fc['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x2adf06));});}; \ 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 259dc1e..b87aeeb 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 _0x6a06=['substring','lastIndexOf','validateEmail','lodash','getString','length','sortBy','string','content','type','variableName','push','customVariable','Variable','name','toLowerCase','keyValue','key','keyContent','keyType','format','%s:\x20%s','stripTrailingSlash'];(function(_0x1cc4b5,_0x3726c0){var _0x5e8b98=function(_0xd9c42){while(--_0xd9c42){_0x1cc4b5['push'](_0x1cc4b5['shift']());}};_0x5e8b98(++_0x3726c0);}(_0x6a06,0x173));var _0x66a0=function(_0x35d06a,_0x81abc0){_0x35d06a=_0x35d06a-0x0;var _0x3cf8a5=_0x6a06[_0x35d06a];return _0x3cf8a5;};'use strict';var _=require(_0x66a0('0x0'));var util=require('util');exports[_0x66a0('0x1')]=function(_0x44e3ab,_0x5adc3f,_0xb3e9cc){var _0x531581=[];if(_0x44e3ab[_0x66a0('0x2')]>0x0){var _0x5dacc4=_[_0x66a0('0x3')](_0x44e3ab,['id']);for(var _0x193365=0x0;_0x193365<_0x5dacc4['length'];_0x193365++){var _0x176d83=_0x5dacc4[_0x193365];if(_0x176d83['type']===_0x66a0('0x4')){_0x531581['push'](_0x176d83[_0x66a0('0x5')]);}else if(_0x176d83[_0x66a0('0x6')]==='variable'&&_0x176d83[_0x66a0('0x7')]){_0x5adc3f[_0x176d83[_0x66a0('0x7')]]&&_0x531581[_0x66a0('0x8')](_0x5adc3f[_0x176d83[_0x66a0('0x7')]]['toString']());}else if(_0x176d83[_0x66a0('0x6')]===_0x66a0('0x9')&&_0x176d83[_0x66a0('0xa')]&&_0x176d83['Variable'][_0x66a0('0xb')]){_0x5adc3f[_0x176d83[_0x66a0('0xa')][_0x66a0('0xb')][_0x66a0('0xc')]()]&&_0x531581[_0x66a0('0x8')](_0x5adc3f[_0x176d83[_0x66a0('0xa')][_0x66a0('0xb')]['toLowerCase']()]['toString']());}else if(_0x176d83[_0x66a0('0x6')]===_0x66a0('0xd')){if(_0x176d83['keyType']==='string'&&_0x176d83['key']){_0x531581[_0x66a0('0x8')](util['format']('%s:\x20%s',_0x176d83[_0x66a0('0xe')],_0x176d83[_0x66a0('0xf')]));}else if(_0x176d83[_0x66a0('0x10')]==='variable'&&_0x176d83[_0x66a0('0x7')]&&_0x176d83[_0x66a0('0xe')]){_0x5adc3f[_0x176d83['variableName']]&&_0x531581[_0x66a0('0x8')](util[_0x66a0('0x11')]('%s:\x20%s',_0x176d83[_0x66a0('0xe')],_0x5adc3f[_0x176d83[_0x66a0('0x7')]]));}else if(_0x176d83[_0x66a0('0x10')]==='customVariable'&&_0x176d83['Variable']&&_0x176d83[_0x66a0('0xa')][_0x66a0('0xb')]&&_0x176d83[_0x66a0('0xe')]){_0x5adc3f[_0x176d83['Variable']['name'][_0x66a0('0xc')]()]&&_0x531581[_0x66a0('0x8')](util['format'](_0x66a0('0x12'),_0x176d83[_0x66a0('0xe')],_0x5adc3f[_0x176d83['Variable']['name'][_0x66a0('0xc')]()]));}}}}return _0x531581['join'](_0xb3e9cc);};exports[_0x66a0('0x13')]=function(_0x2f0067){var _0x3097c7=_0x2f0067['slice'](-0x1);if(_0x3097c7==='/'){_0x2f0067=_0x2f0067[_0x66a0('0x14')](0x0,_0x2f0067[_0x66a0('0x15')](_0x3097c7));}return _0x2f0067;};exports[_0x66a0('0x16')]=function(_0x5962bc){if(!_['isNil'](_0x5962bc)&&_0x5962bc!==''){var _0x8ad44b=/^(([^<>()\[\]\\.,;:\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 _0x8ad44b['test'](String(_0x5962bc)[_0x66a0('0xc')]());}else{return![];}}; \ No newline at end of file +var _0xd13a=['keyContent','%s:\x20%s','stripTrailingSlash','slice','substring','lastIndexOf','isNil','util','length','string','push','content','type','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','key','format'];(function(_0x515aa4,_0x1dcdd5){var _0x2b530d=function(_0x145c31){while(--_0x145c31){_0x515aa4['push'](_0x515aa4['shift']());}};_0x2b530d(++_0x1dcdd5);}(_0xd13a,0xf7));var _0xad13=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xd13a[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require(_0xad13('0x0'));exports['getString']=function(_0x4785ce,_0x2c2937,_0x55d2ae){var _0x22833=[];if(_0x4785ce[_0xad13('0x1')]>0x0){var _0x408765=_['sortBy'](_0x4785ce,['id']);for(var _0x9f8d2=0x0;_0x9f8d2<_0x408765[_0xad13('0x1')];_0x9f8d2++){var _0x1ad8b4=_0x408765[_0x9f8d2];if(_0x1ad8b4['type']===_0xad13('0x2')){_0x22833[_0xad13('0x3')](_0x1ad8b4[_0xad13('0x4')]);}else if(_0x1ad8b4[_0xad13('0x5')]===_0xad13('0x6')&&_0x1ad8b4[_0xad13('0x7')]){_0x2c2937[_0x1ad8b4[_0xad13('0x7')]]&&_0x22833[_0xad13('0x3')](_0x2c2937[_0x1ad8b4[_0xad13('0x7')]]['toString']());}else if(_0x1ad8b4[_0xad13('0x5')]===_0xad13('0x8')&&_0x1ad8b4[_0xad13('0x9')]&&_0x1ad8b4[_0xad13('0x9')][_0xad13('0xa')]){_0x2c2937[_0x1ad8b4[_0xad13('0x9')][_0xad13('0xa')]['toLowerCase']()]&&_0x22833['push'](_0x2c2937[_0x1ad8b4[_0xad13('0x9')][_0xad13('0xa')][_0xad13('0xb')]()][_0xad13('0xc')]());}else if(_0x1ad8b4['type']===_0xad13('0xd')){if(_0x1ad8b4[_0xad13('0xe')]===_0xad13('0x2')&&_0x1ad8b4[_0xad13('0xf')]){_0x22833['push'](util[_0xad13('0x10')]('%s:\x20%s',_0x1ad8b4[_0xad13('0xf')],_0x1ad8b4[_0xad13('0x11')]));}else if(_0x1ad8b4['keyType']===_0xad13('0x6')&&_0x1ad8b4['variableName']&&_0x1ad8b4[_0xad13('0xf')]){_0x2c2937[_0x1ad8b4[_0xad13('0x7')]]&&_0x22833[_0xad13('0x3')](util[_0xad13('0x10')](_0xad13('0x12'),_0x1ad8b4[_0xad13('0xf')],_0x2c2937[_0x1ad8b4[_0xad13('0x7')]]));}else if(_0x1ad8b4['keyType']===_0xad13('0x8')&&_0x1ad8b4[_0xad13('0x9')]&&_0x1ad8b4[_0xad13('0x9')][_0xad13('0xa')]&&_0x1ad8b4[_0xad13('0xf')]){_0x2c2937[_0x1ad8b4[_0xad13('0x9')]['name'][_0xad13('0xb')]()]&&_0x22833[_0xad13('0x3')](util[_0xad13('0x10')](_0xad13('0x12'),_0x1ad8b4[_0xad13('0xf')],_0x2c2937[_0x1ad8b4[_0xad13('0x9')][_0xad13('0xa')]['toLowerCase']()]));}}}}return _0x22833['join'](_0x55d2ae);};exports[_0xad13('0x13')]=function(_0x5a74a4){var _0x5b3577=_0x5a74a4[_0xad13('0x14')](-0x1);if(_0x5b3577==='/'){_0x5a74a4=_0x5a74a4[_0xad13('0x15')](0x0,_0x5a74a4[_0xad13('0x16')](_0x5b3577));}return _0x5a74a4;};exports['validateEmail']=function(_0x5a56a7){if(!_[_0xad13('0x17')](_0x5a56a7)&&_0x5a56a7!==''){var _0x54f08c=/^(([^<>()\[\]\\.,;:\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 _0x54f08c['test'](String(_0x5a56a7)[_0xad13('0xb')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index f345451..191aab8 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x31bf07,_0x283387){var _0x59c9ab=function(_0xe944fd){while(--_0xe944fd){_0x31bf07['push'](_0x31bf07['shift']());}};_0x59c9ab(++_0x283387);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x532589,_0x3c90dc){var _0x33b8c2=function(_0x3f1f81){while(--_0x3f1f81){_0x532589['push'](_0x532589['shift']());}};_0x33b8c2(++_0x3c90dc);}(_0xe706,0xa3));var _0x6e70=function(_0x53ad5f,_0x165793){_0x53ad5f=_0x53ad5f-0x0;var _0x61e1da=_0xe706[_0x53ad5f];return _0x61e1da;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 4768dea..5d4657e 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 _0x45b3=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','email','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','util','./util','../../../../config/environment','../../../../config/logger','redis','localhost','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','results','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','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','defaults','GET','map','includes','picklist','type','nameField','content','string','push','variable','variableName','idField','customField','custom_fields','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0x45b3,0x161));var _0x345b=function(_0x8cdc3c,_0x10a3c8){_0x8cdc3c=_0x8cdc3c-0x0;var _0x401b4b=_0x45b3[_0x8cdc3c];return _0x401b4b;};'use strict';var _=require(_0x345b('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x345b('0x1'));var Redis=require('ioredis');var intUtil=require(_0x345b('0x2'));var config=require(_0x345b('0x3'));var logger=require(_0x345b('0x4'))('zendesk');config[_0x345b('0x5')]=_['defaults'](config['redis'],{'host':_0x345b('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x345b('0x5')]));function emit(_0x13df4e,_0x233d5e,_0x4d0772){io['to'](_0x13df4e)['emit'](_0x233d5e,_0x4d0772);}var headers={'Content-Type':_0x345b('0x7'),'Accept':_0x345b('0x7')};function getTicket(_0x55f466,_0xd3a8a7,_0x39ee16,_0x175c1f,_0x2becad){logger[_0x345b('0x8')](_0x345b('0x9'));return request({'uri':util[_0x345b('0xa')]('%s/tickets.json',_0x55f466[_0x345b('0xb')]),'method':_0x345b('0xc'),'body':{'ticket':_[_0x345b('0xd')]({'requester_id':_0x39ee16['id'],'submitter_id':_0xd3a8a7?_0xd3a8a7['id']:undefined,'assignee_id':_0xd3a8a7?_0xd3a8a7['id']:undefined,'tags':getTags(_0x175c1f[_0x345b('0xe')],_0x345b('0xf')),'subject':intUtil[_0x345b('0x10')](_0x175c1f[_0x345b('0x11')],_0x2becad,'\x20'),'description':intUtil[_0x345b('0x10')](_0x175c1f['Descriptions'],_0x2becad,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x175c1f[_0x345b('0x12')],_0x2becad,'\x0a')}},getCustomFields(_0x175c1f[_0x345b('0x13')],_0x2becad))}})[_0x345b('0x14')](function(_0x1ca822){logger['info']('Ticket\x20created!');return _0x1ca822[_0x345b('0x15')];});}function getUser(_0x235628,_0x2d7bd3){if(intUtil[_0x345b('0x16')](_0x2d7bd3)){logger[_0x345b('0x8')](_0x345b('0x17'),_0x2d7bd3);return request({'uri':util[_0x345b('0xa')](_0x345b('0x18'),_0x235628[_0x345b('0xb')]),'qs':{'query':util[_0x345b('0xa')](_0x345b('0x19'),_0x2d7bd3)}})['then'](function(_0x434906){if(_0x434906['count']){logger['info'](_0x345b('0x1a'));return _['find'](_0x434906[_0x345b('0x1b')],{'email':_0x2d7bd3,'role':'agent'});}else{logger[_0x345b('0x8')](_0x345b('0x1c'));return request({'uri':util[_0x345b('0xa')](_0x345b('0x1d'),_0x235628['remoteUri'])})[_0x345b('0x14')](function(_0x541cab){logger[_0x345b('0x8')](_0x345b('0x1e'));return _0x541cab[_0x345b('0x1f')];});}});}else{logger[_0x345b('0x8')](_0x345b('0x1c'));return request({'uri':util[_0x345b('0xa')](_0x345b('0x1d'),_0x235628[_0x345b('0xb')])})['then'](function(_0x3dac94){logger[_0x345b('0x8')](_0x345b('0x1e'));return _0x3dac94[_0x345b('0x1f')];});}}function getEndUser(_0x3f3b7c,_0x5c9c40,_0x22e492){logger['info'](_0x345b('0x20'),_0x22e492);return request({'uri':util[_0x345b('0xa')](_0x345b('0x18'),_0x3f3b7c[_0x345b('0xb')]),'qs':{'query':util['format'](_0x345b('0x21'),_0x22e492)}})[_0x345b('0x14')](function(_0x4c959d){var _0x42e720;if(_0x4c959d['results'][_0x345b('0x22')]){_0x4c959d[_0x345b('0x1b')]=_[_0x345b('0x23')](_0x4c959d[_0x345b('0x1b')],{'suspended':![],'role':_0x345b('0x24')});if(_0x4c959d['results'][_0x345b('0x22')]){_0x42e720=_[_0x345b('0x25')](_0x4c959d[_0x345b('0x1b')]);}}if(_0x42e720){logger[_0x345b('0x8')]('Enduser\x20found!');return _0x42e720;}else{logger[_0x345b('0x8')](_0x345b('0x26'));return request({'uri':util['format'](_0x345b('0x27'),_0x3f3b7c[_0x345b('0xb')]),'method':_0x345b('0xc'),'body':{'user':{'role':'end-user','name':util['format'](_0x345b('0x28'),_0x5c9c40||_0x22e492),'phone':_0x22e492}}})[_0x345b('0x14')](function(_0x1c3753){logger[_0x345b('0x8')]('Enduser\x20created.');return _0x1c3753[_0x345b('0x1f')];});}});}function getAuth(_0x11ff9e){var _0x2386af;if(_0x11ff9e[_0x345b('0x29')]==='password'){_0x2386af=util[_0x345b('0xa')]('%s:%s',_0x11ff9e[_0x345b('0x2a')],_0x11ff9e[_0x345b('0x2b')]);}else if(_0x11ff9e[_0x345b('0x29')]===_0x345b('0x2c')){_0x2386af=util[_0x345b('0xa')](_0x345b('0x2d'),_0x11ff9e[_0x345b('0x2a')],_0x11ff9e['token']);}return util[_0x345b('0xa')](_0x345b('0x2e'),new Buffer(_0x2386af)[_0x345b('0x2f')](_0x345b('0x30')));}function request(_0x4ebc40){logger[_0x345b('0x31')]('[HTTP]',JSON[_0x345b('0x32')](_0x4ebc40));return rp(_[_0x345b('0x33')](_0x4ebc40,{'method':_0x345b('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x5d9eff,_0x100c2c){var _0x15e6e8=[];if(_0x5d9eff&&_0x5d9eff['length']>0x0){_0x15e6e8=_[_0x345b('0x35')](_0x5d9eff,_0x100c2c);}return _0x15e6e8;}function getCustomFields(_0x31dce1,_0x5b5bb2){var _0x25edd7=[];var _0xe20e6f={'custom_fields':[]};if(_0x31dce1['length']>0x0){_['forEach'](_0x31dce1,function(_0x19a127){if(_[_0x345b('0x36')](['string',_0x345b('0x37')],_0x19a127[_0x345b('0x38')])&&_0x19a127[_0x345b('0x39')]&&!_0x19a127['customField']){_0xe20e6f[_0x19a127[_0x345b('0x39')]['toLowerCase']()]=_0x19a127[_0x345b('0x3a')][_0x345b('0x2f')]();}else if(_[_0x345b('0x36')]([_0x345b('0x3b'),_0x345b('0x37')],_0x19a127[_0x345b('0x38')])&&_0x19a127['idField']&&_0x19a127['customField']){_0xe20e6f['custom_fields'][_0x345b('0x3c')]({'id':_0x19a127['idField'],'value':_0x19a127['content'][_0x345b('0x2f')]()});}else if(_0x19a127['type']===_0x345b('0x3d')&&_0x19a127[_0x345b('0x3e')]&&_0x19a127[_0x345b('0x3f')]&&_0x19a127[_0x345b('0x40')]){_0x5b5bb2[_0x19a127['variableName']]&&_0xe20e6f[_0x345b('0x41')][_0x345b('0x3c')]({'id':_0x19a127[_0x345b('0x3f')],'value':_0x5b5bb2[_0x19a127[_0x345b('0x3e')]][_0x345b('0x2f')]()});}else if(_0x19a127[_0x345b('0x38')]===_0x345b('0x42')&&_0x19a127[_0x345b('0x43')]&&_0x19a127[_0x345b('0x43')][_0x345b('0xf')]&&_0x19a127['idField']&&_0x19a127[_0x345b('0x40')]){_0x5b5bb2[_0x19a127[_0x345b('0x43')][_0x345b('0xf')][_0x345b('0x44')]()]&&_0xe20e6f[_0x345b('0x41')][_0x345b('0x3c')]({'id':_0x19a127[_0x345b('0x3f')],'value':_0x5b5bb2[_0x19a127['Variable'][_0x345b('0xf')]['toLowerCase']()][_0x345b('0x2f')]()});}});}return _0xe20e6f;}exports[_0x345b('0x45')]=function(_0x493a3b,_0x1e2ead,_0x226480,_0x3d7187,_0xa8a4f4,_0x4b932b){var _0xc7e7a,_0x4e9b2a;_0x4b932b[_0x345b('0xb')]=intUtil[_0x345b('0x46')](_0x4b932b[_0x345b('0xb')]);_0x4b932b[_0x345b('0x47')]=intUtil['stripTrailingSlash'](_0x4b932b[_0x345b('0x47')]);if(_0xa8a4f4&&_0xa8a4f4['monitor_format']){logger[_0x345b('0x8')](_0x345b('0x48'),_0x345b('0x49'));_0x1e2ead[_0x345b('0x4a')]=util[_0x345b('0xa')](_0x345b('0x4b'),_0x4b932b[_0x345b('0x47')],_0x1e2ead[_0x345b('0x4c')],md5(_0x1e2ead[_0x345b('0x4c')]));}else{_0x1e2ead[_0x345b('0x4a')]='';}headers[_0x345b('0x4d')]=getAuth(_0x4b932b);return getUser(_0x4b932b,_0x3d7187['email'])['then'](function(_0xb05b8e){_0xc7e7a=_0xb05b8e;logger['info'](_0x345b('0x4e'),_0xc7e7a['id']);return getEndUser(_0x4b932b,_0x1e2ead[_0x345b('0x4f')],_0x1e2ead['calleridnum']);})[_0x345b('0x14')](function(_0x4874d9){_0x4e9b2a=_0x4874d9;logger[_0x345b('0x8')](_0x345b('0x50'),_0x4e9b2a['id']);return getTicket(_0x4b932b,_0xc7e7a,_0x4e9b2a,_0x226480,_0x1e2ead);})[_0x345b('0x14')](function(_0x585472){if(_0x585472){logger[_0x345b('0x8')](_0x345b('0x51'),_0x585472['id']);switch(_0x4b932b[_0x345b('0x38')]){case _0x345b('0x52'):logger['info'](_0x345b('0x48'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x345b('0xa')](_0x345b('0x53'),_0x4b932b[_0x345b('0xb')],_0xc7e7a['id'],_0x585472['id']),'method':'POST'});case _0x345b('0x54'):logger[_0x345b('0x8')](_0x345b('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x345b('0xa')]('user:%s',_0x3d7187[_0x345b('0xf')]),_0x345b('0x55'),{'uri':util['format'](_0x345b('0x56'),_0x4b932b[_0x345b('0xb')][_0x345b('0x57')](_0x345b('0x58'),''),_0x585472['id'])});break;default:logger[_0x345b('0x59')]('[QUEUE]',_0x345b('0x5a'));}}})[_0x345b('0x5b')](function(_0x453a34){logger['error'](_0x345b('0x5c'),util[_0x345b('0x5d')](_0x453a34,{'showHidden':!![],'depth':null}));});};exports[_0x345b('0x5e')]=function(_0x448ec7,_0x59d90d,_0x320743,_0x465423,_0xf154c1,_0x5df3ca,_0x15dea1){var _0x29f057,_0x677556;_0x5df3ca['remoteUri']=intUtil[_0x345b('0x46')](_0x5df3ca[_0x345b('0xb')]);_0x5df3ca['serverUrl']=intUtil[_0x345b('0x46')](_0x5df3ca[_0x345b('0x47')]);if(_0x15dea1&&_0x15dea1['recordingFormat']&&_0x15dea1[_0x345b('0x5f')]!=='none'){logger[_0x345b('0x8')](_0x345b('0x60'),_0x345b('0x49'));_0x59d90d[_0x345b('0x4a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5df3ca[_0x345b('0x47')],_0x59d90d['uniqueid'],md5(_0x59d90d[_0x345b('0x4c')]));}headers[_0x345b('0x4d')]=getAuth(_0x5df3ca);return getUser(_0x5df3ca,_0x465423[_0x345b('0x61')])[_0x345b('0x14')](function(_0x3e1024){_0x29f057=_0x3e1024;logger[_0x345b('0x8')](_0x345b('0x4e'),_0x29f057['id']);return getEndUser(_0x5df3ca,_0x59d90d[_0x345b('0x62')],_0x59d90d[_0x345b('0x63')]);})[_0x345b('0x14')](function(_0x96d830){_0x677556=_0x96d830;logger['info']('The\x20Enduser\x20ID\x20is:',_0x677556['id']);return getTicket(_0x5df3ca,_0x29f057,_0x677556,_0x320743,_0x59d90d);})[_0x345b('0x14')](function(_0x24f9cb){if(_0x24f9cb){logger['info'](_0x345b('0x51'),_0x24f9cb['id']);switch(_0x5df3ca[_0x345b('0x38')]){case _0x345b('0x52'):logger[_0x345b('0x8')](_0x345b('0x60'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x345b('0x53'),_0x5df3ca[_0x345b('0xb')],_0x29f057['id'],_0x24f9cb['id']),'method':_0x345b('0xc')});case _0x345b('0x54'):logger[_0x345b('0x8')](_0x345b('0x60'),_0x345b('0x64'));emit(util[_0x345b('0xa')](_0x345b('0x65'),_0x465423[_0x345b('0xf')]),_0x345b('0x55'),{'uri':util[_0x345b('0xa')]('%s/agent/tickets/%s',_0x5df3ca[_0x345b('0xb')][_0x345b('0x57')](_0x345b('0x58'),''),_0x24f9cb['id'])});break;default:logger[_0x345b('0x59')](_0x345b('0x60'),_0x345b('0x5a'));}}})['catch'](function(_0x4f1f50){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x4f1f50,{'showHidden':!![],'depth':null}));});};exports[_0x345b('0x66')]=function(_0x1d6ad0,_0x10df59,_0x323bfb,_0x5e2fb9,_0x4aa94e,_0x37cdbe){var _0x3267c5,_0x9bcd89;_0x37cdbe[_0x345b('0xb')]=intUtil[_0x345b('0x46')](_0x37cdbe['remoteUri']);_0x37cdbe['serverUrl']=intUtil['stripTrailingSlash'](_0x37cdbe[_0x345b('0x47')]);if(_0x4aa94e&&_0x4aa94e[_0x345b('0x67')]){logger['info']('['+_0x10df59[_0x345b('0x68')][_0x345b('0x69')]()+']',_0x345b('0x49'));_0x10df59[_0x345b('0x4a')]=util[_0x345b('0xa')](_0x345b('0x4b'),_0x37cdbe['serverUrl'],_0x10df59['uniqueid'],md5(_0x10df59[_0x345b('0x4c')]));}else{_0x10df59[_0x345b('0x4a')]='';}headers['Authorization']=getAuth(_0x37cdbe);return getUser(_0x37cdbe)[_0x345b('0x14')](function(_0x3f9cdc){_0x3267c5=_0x3f9cdc;logger[_0x345b('0x8')](_0x345b('0x4e'),_0x3267c5['id']);return getEndUser(_0x37cdbe,_0x10df59[_0x345b('0x4f')],_0x10df59[_0x345b('0x6a')]);})['then'](function(_0x5dc254){_0x9bcd89=_0x5dc254;logger[_0x345b('0x8')]('The\x20Enduser\x20ID\x20is:',_0x9bcd89['id']);return getTicket(_0x37cdbe,_0x3267c5,_0x9bcd89,_0x323bfb,_0x10df59);})['then'](function(_0x3402d7){if(_0x3402d7){logger['info'](_0x345b('0x51'),_0x3402d7['id']);}})[_0x345b('0x5b')](function(_0x1e298f){logger[_0x345b('0x59')]('['+_0x10df59[_0x345b('0x68')][_0x345b('0x69')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x345b('0x5d')](_0x1e298f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc393=['stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','inspect','outbound','recordingFormat','destcalleridname','destcalleridnum','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','replace','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','../../../../config/logger','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','Agent\x20found!','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','token','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','toString','idField','push','type','variableName','customVariable','Variable','custom_fields','queue'];(function(_0x54a9b9,_0x31352f){var _0x2a34ef=function(_0x50f592){while(--_0x50f592){_0x54a9b9['push'](_0x54a9b9['shift']());}};_0x2a34ef(++_0x31352f);}(_0xc393,0x169));var _0x3c39=function(_0xa56b53,_0x53dbb7){_0xa56b53=_0xa56b53-0x0;var _0x19849f=_0xc393[_0xa56b53];return _0x19849f;};'use strict';var _=require(_0x3c39('0x0'));var rp=require(_0x3c39('0x1'));var md5=require(_0x3c39('0x2'));var util=require('util');var Redis=require(_0x3c39('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x3c39('0x4'))('zendesk');config[_0x3c39('0x5')]=_['defaults'](config[_0x3c39('0x5')],{'host':_0x3c39('0x6'),'port':0x18eb});var io=require(_0x3c39('0x7'))(new Redis(config[_0x3c39('0x5')]));function emit(_0x3762e9,_0x3079fe,_0x4a9974){io['to'](_0x3762e9)[_0x3c39('0x8')](_0x3079fe,_0x4a9974);}var headers={'Content-Type':_0x3c39('0x9'),'Accept':'application/json'};function getTicket(_0x1822c7,_0x1558ea,_0x50689e,_0x380541,_0x5b0dcd){logger[_0x3c39('0xa')](_0x3c39('0xb'));return request({'uri':util[_0x3c39('0xc')]('%s/tickets.json',_0x1822c7[_0x3c39('0xd')]),'method':_0x3c39('0xe'),'body':{'ticket':_['merge']({'requester_id':_0x50689e['id'],'submitter_id':_0x1558ea?_0x1558ea['id']:undefined,'assignee_id':_0x1558ea?_0x1558ea['id']:undefined,'tags':getTags(_0x380541[_0x3c39('0xf')],_0x3c39('0x10')),'subject':intUtil[_0x3c39('0x11')](_0x380541[_0x3c39('0x12')],_0x5b0dcd,'\x20'),'description':intUtil[_0x3c39('0x11')](_0x380541[_0x3c39('0x13')],_0x5b0dcd,'\x0a'),'comment':{'public':![],'body':intUtil[_0x3c39('0x11')](_0x380541[_0x3c39('0x13')],_0x5b0dcd,'\x0a')}},getCustomFields(_0x380541[_0x3c39('0x14')],_0x5b0dcd))}})[_0x3c39('0x15')](function(_0x299c26){logger[_0x3c39('0xa')](_0x3c39('0x16'));return _0x299c26[_0x3c39('0x17')];});}function getUser(_0xba18f5,_0x58e112){if(intUtil[_0x3c39('0x18')](_0x58e112)){logger[_0x3c39('0xa')](_0x3c39('0x19'),_0x58e112);return request({'uri':util[_0x3c39('0xc')](_0x3c39('0x1a'),_0xba18f5[_0x3c39('0xd')]),'qs':{'query':util[_0x3c39('0xc')]('type:user\x20role:agent\x20email:%s',_0x58e112)}})['then'](function(_0x2bf58b){if(_0x2bf58b['count']){logger[_0x3c39('0xa')](_0x3c39('0x1b'));return _['find'](_0x2bf58b['results'],{'email':_0x58e112,'role':_0x3c39('0x1c')});}else{logger['info'](_0x3c39('0x1d'));return request({'uri':util['format']('%s/users/me.json',_0xba18f5[_0x3c39('0xd')])})[_0x3c39('0x15')](function(_0x47b0dd){logger['info'](_0x3c39('0x1e'));return _0x47b0dd[_0x3c39('0x1f')];});}});}else{logger[_0x3c39('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x3c39('0x20'),_0xba18f5[_0x3c39('0xd')])})[_0x3c39('0x15')](function(_0x62589a){logger[_0x3c39('0xa')](_0x3c39('0x1e'));return _0x62589a[_0x3c39('0x1f')];});}}function getEndUser(_0x1e6af7,_0x327ebe,_0x2635e7){logger['info']('Searching\x20enduser\x20with\x20phone',_0x2635e7);return request({'uri':util[_0x3c39('0xc')]('%s/search.json',_0x1e6af7[_0x3c39('0xd')]),'qs':{'query':util[_0x3c39('0xc')](_0x3c39('0x21'),_0x2635e7)}})[_0x3c39('0x15')](function(_0x5551d0){var _0x3fec09;if(_0x5551d0[_0x3c39('0x22')][_0x3c39('0x23')]){_0x5551d0[_0x3c39('0x22')]=_[_0x3c39('0x24')](_0x5551d0[_0x3c39('0x22')],{'suspended':![],'role':_0x3c39('0x25')});if(_0x5551d0['results'][_0x3c39('0x23')]){_0x3fec09=_[_0x3c39('0x26')](_0x5551d0[_0x3c39('0x22')]);}}if(_0x3fec09){logger[_0x3c39('0xa')]('Enduser\x20found!');return _0x3fec09;}else{logger[_0x3c39('0xa')](_0x3c39('0x27'));return request({'uri':util[_0x3c39('0xc')](_0x3c39('0x28'),_0x1e6af7[_0x3c39('0xd')]),'method':'POST','body':{'user':{'role':_0x3c39('0x25'),'name':util[_0x3c39('0xc')](_0x3c39('0x29'),_0x327ebe||_0x2635e7),'phone':_0x2635e7}}})['then'](function(_0x2c7b00){logger['info'](_0x3c39('0x2a'));return _0x2c7b00['user'];});}});}function getAuth(_0x2d35da){var _0x2b5ef5;if(_0x2d35da[_0x3c39('0x2b')]==='password'){_0x2b5ef5=util['format'](_0x3c39('0x2c'),_0x2d35da[_0x3c39('0x2d')],_0x2d35da['password']);}else if(_0x2d35da[_0x3c39('0x2b')]===_0x3c39('0x2e')){_0x2b5ef5=util[_0x3c39('0xc')]('%s/token:%s',_0x2d35da[_0x3c39('0x2d')],_0x2d35da['token']);}return util[_0x3c39('0xc')](_0x3c39('0x2f'),new Buffer(_0x2b5ef5)['toString'](_0x3c39('0x30')));}function request(_0x1471f6){logger[_0x3c39('0x31')](_0x3c39('0x32'),JSON[_0x3c39('0x33')](_0x1471f6));return rp(_['defaults'](_0x1471f6,{'method':_0x3c39('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x4d9e0c,_0x1fff94){var _0x26f477=[];if(_0x4d9e0c&&_0x4d9e0c[_0x3c39('0x23')]>0x0){_0x26f477=_[_0x3c39('0x35')](_0x4d9e0c,_0x1fff94);}return _0x26f477;}function getCustomFields(_0x1e2b68,_0x3f8500){var _0x47829a=[];var _0x2768f2={'custom_fields':[]};if(_0x1e2b68[_0x3c39('0x23')]>0x0){_[_0x3c39('0x36')](_0x1e2b68,function(_0xd7df27){if(_[_0x3c39('0x37')]([_0x3c39('0x38'),_0x3c39('0x39')],_0xd7df27['type'])&&_0xd7df27[_0x3c39('0x3a')]&&!_0xd7df27[_0x3c39('0x3b')]){_0x2768f2[_0xd7df27[_0x3c39('0x3a')][_0x3c39('0x3c')]()]=_0xd7df27[_0x3c39('0x3d')][_0x3c39('0x3e')]();}else if(_[_0x3c39('0x37')](['string',_0x3c39('0x39')],_0xd7df27['type'])&&_0xd7df27[_0x3c39('0x3f')]&&_0xd7df27[_0x3c39('0x3b')]){_0x2768f2['custom_fields'][_0x3c39('0x40')]({'id':_0xd7df27[_0x3c39('0x3f')],'value':_0xd7df27[_0x3c39('0x3d')]['toString']()});}else if(_0xd7df27[_0x3c39('0x41')]==='variable'&&_0xd7df27['variableName']&&_0xd7df27[_0x3c39('0x3f')]&&_0xd7df27[_0x3c39('0x3b')]){_0x3f8500[_0xd7df27[_0x3c39('0x42')]]&&_0x2768f2['custom_fields'][_0x3c39('0x40')]({'id':_0xd7df27[_0x3c39('0x3f')],'value':_0x3f8500[_0xd7df27[_0x3c39('0x42')]][_0x3c39('0x3e')]()});}else if(_0xd7df27['type']===_0x3c39('0x43')&&_0xd7df27[_0x3c39('0x44')]&&_0xd7df27[_0x3c39('0x44')][_0x3c39('0x10')]&&_0xd7df27[_0x3c39('0x3f')]&&_0xd7df27[_0x3c39('0x3b')]){_0x3f8500[_0xd7df27[_0x3c39('0x44')][_0x3c39('0x10')][_0x3c39('0x3c')]()]&&_0x2768f2[_0x3c39('0x45')][_0x3c39('0x40')]({'id':_0xd7df27[_0x3c39('0x3f')],'value':_0x3f8500[_0xd7df27[_0x3c39('0x44')][_0x3c39('0x10')][_0x3c39('0x3c')]()][_0x3c39('0x3e')]()});}});}return _0x2768f2;}exports[_0x3c39('0x46')]=function(_0x5978ff,_0x2701d9,_0x27d03a,_0x188dbb,_0x582edc,_0x55358a){var _0x1d3dad,_0x51ed2e;_0x55358a[_0x3c39('0xd')]=intUtil[_0x3c39('0x47')](_0x55358a[_0x3c39('0xd')]);_0x55358a[_0x3c39('0x48')]=intUtil['stripTrailingSlash'](_0x55358a['serverUrl']);if(_0x582edc&&_0x582edc[_0x3c39('0x49')]){logger[_0x3c39('0xa')](_0x3c39('0x4a'),'Recording\x20is\x20enabled!');_0x2701d9[_0x3c39('0x4b')]=util['format'](_0x3c39('0x4c'),_0x55358a[_0x3c39('0x48')],_0x2701d9[_0x3c39('0x4d')],md5(_0x2701d9['uniqueid']));}else{_0x2701d9[_0x3c39('0x4b')]='';}headers[_0x3c39('0x4e')]=getAuth(_0x55358a);return getUser(_0x55358a,_0x188dbb[_0x3c39('0x4f')])['then'](function(_0x589d97){_0x1d3dad=_0x589d97;logger[_0x3c39('0xa')](_0x3c39('0x50'),_0x1d3dad['id']);return getEndUser(_0x55358a,_0x2701d9[_0x3c39('0x51')],_0x2701d9[_0x3c39('0x52')]);})[_0x3c39('0x15')](function(_0x46fe74){_0x51ed2e=_0x46fe74;logger['info'](_0x3c39('0x53'),_0x51ed2e['id']);return getTicket(_0x55358a,_0x1d3dad,_0x51ed2e,_0x27d03a,_0x2701d9);})[_0x3c39('0x15')](function(_0x177718){if(_0x177718){logger[_0x3c39('0xa')](_0x3c39('0x54'),_0x177718['id']);switch(_0x55358a[_0x3c39('0x41')]){case _0x3c39('0x55'):logger[_0x3c39('0xa')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x3c39('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x55358a[_0x3c39('0xd')],_0x1d3dad['id'],_0x177718['id']),'method':_0x3c39('0xe')});case _0x3c39('0x56'):logger[_0x3c39('0xa')]('[QUEUE]',_0x3c39('0x57'));emit(util['format'](_0x3c39('0x58'),_0x188dbb[_0x3c39('0x10')]),_0x3c39('0x59'),{'uri':util[_0x3c39('0xc')](_0x3c39('0x5a'),_0x55358a[_0x3c39('0xd')]['replace'](_0x3c39('0x5b'),''),_0x177718['id'])});break;default:logger[_0x3c39('0x5c')](_0x3c39('0x4a'),_0x3c39('0x5d'));}}})['catch'](function(_0x154555){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x3c39('0x5e')](_0x154555,{'showHidden':!![],'depth':null}));});};exports[_0x3c39('0x5f')]=function(_0x516a2e,_0x20d950,_0x2bedc1,_0x3b71e9,_0x5ae606,_0x246598,_0x22f487){var _0x15c681,_0x21433e;_0x246598['remoteUri']=intUtil[_0x3c39('0x47')](_0x246598[_0x3c39('0xd')]);_0x246598['serverUrl']=intUtil[_0x3c39('0x47')](_0x246598['serverUrl']);if(_0x22f487&&_0x22f487[_0x3c39('0x60')]&&_0x22f487[_0x3c39('0x60')]!=='none'){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x20d950[_0x3c39('0x4b')]=util['format'](_0x3c39('0x4c'),_0x246598['serverUrl'],_0x20d950[_0x3c39('0x4d')],md5(_0x20d950[_0x3c39('0x4d')]));}headers[_0x3c39('0x4e')]=getAuth(_0x246598);return getUser(_0x246598,_0x3b71e9[_0x3c39('0x4f')])[_0x3c39('0x15')](function(_0x4d7f3d){_0x15c681=_0x4d7f3d;logger[_0x3c39('0xa')]('The\x20User\x20ID\x20is:',_0x15c681['id']);return getEndUser(_0x246598,_0x20d950[_0x3c39('0x61')],_0x20d950[_0x3c39('0x62')]);})[_0x3c39('0x15')](function(_0x4c5389){_0x21433e=_0x4c5389;logger['info'](_0x3c39('0x53'),_0x21433e['id']);return getTicket(_0x246598,_0x15c681,_0x21433e,_0x2bedc1,_0x20d950);})[_0x3c39('0x15')](function(_0x528da2){if(_0x528da2){logger[_0x3c39('0xa')]('The\x20Ticket\x20ID\x20is:',_0x528da2['id']);switch(_0x246598[_0x3c39('0x41')]){case'integrationTab':logger[_0x3c39('0xa')](_0x3c39('0x63'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x3c39('0xc')](_0x3c39('0x64'),_0x246598[_0x3c39('0xd')],_0x15c681['id'],_0x528da2['id']),'method':_0x3c39('0xe')});case _0x3c39('0x56'):logger[_0x3c39('0xa')](_0x3c39('0x63'),_0x3c39('0x57'));emit(util['format'](_0x3c39('0x58'),_0x3b71e9[_0x3c39('0x10')]),_0x3c39('0x59'),{'uri':util[_0x3c39('0xc')]('%s/agent/tickets/%s',_0x246598['remoteUri'][_0x3c39('0x65')](_0x3c39('0x5b'),''),_0x528da2['id'])});break;default:logger[_0x3c39('0x5c')](_0x3c39('0x63'),_0x3c39('0x5d'));}}})[_0x3c39('0x66')](function(_0x3f2f3a){logger[_0x3c39('0x5c')](_0x3c39('0x67'),util[_0x3c39('0x5e')](_0x3f2f3a,{'showHidden':!![],'depth':null}));});};exports[_0x3c39('0x68')]=function(_0x44009a,_0x4a4ae1,_0x414d0e,_0x3a2ab5,_0x42faf8,_0xdef0b){var _0x4f4ff5,_0x2eecce;_0xdef0b[_0x3c39('0xd')]=intUtil[_0x3c39('0x47')](_0xdef0b[_0x3c39('0xd')]);_0xdef0b[_0x3c39('0x48')]=intUtil[_0x3c39('0x47')](_0xdef0b['serverUrl']);if(_0x42faf8&&_0x42faf8['monitor_format']){logger[_0x3c39('0xa')]('['+_0x4a4ae1[_0x3c39('0x69')][_0x3c39('0x6a')]()+']','Recording\x20is\x20enabled!');_0x4a4ae1['recordingURL']=util[_0x3c39('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xdef0b[_0x3c39('0x48')],_0x4a4ae1['uniqueid'],md5(_0x4a4ae1['uniqueid']));}else{_0x4a4ae1[_0x3c39('0x4b')]='';}headers[_0x3c39('0x4e')]=getAuth(_0xdef0b);return getUser(_0xdef0b)[_0x3c39('0x15')](function(_0x635fed){_0x4f4ff5=_0x635fed;logger['info'](_0x3c39('0x50'),_0x4f4ff5['id']);return getEndUser(_0xdef0b,_0x4a4ae1[_0x3c39('0x51')],_0x4a4ae1[_0x3c39('0x52')]);})['then'](function(_0x20ca9a){_0x2eecce=_0x20ca9a;logger[_0x3c39('0xa')](_0x3c39('0x53'),_0x2eecce['id']);return getTicket(_0xdef0b,_0x4f4ff5,_0x2eecce,_0x414d0e,_0x4a4ae1);})[_0x3c39('0x15')](function(_0x50e766){if(_0x50e766){logger['info'](_0x3c39('0x54'),_0x50e766['id']);}})[_0x3c39('0x66')](function(_0x21f7f8){logger[_0x3c39('0x5c')]('['+_0x4a4ae1['lastevent'][_0x3c39('0x6a')]()+']'+_0x3c39('0x6b'),util[_0x3c39('0x5e')](_0x21f7f8,{'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 2fa159e..3452f18 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 _0xcb04=['split','isNil','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','refreshToken','clientId','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','startCase','moduleCreate','first_name','last_name','SUCCESS','details','enduserType','Error:\x20','moduleSearch','Contacts','uri','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Creating\x20new\x20call...','Owner','role','administrator','Subjects','Description','getString','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls','code','Call\x20created!','err','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','serverUrl','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','host','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','trigger:browser:url','toUpperCase','calleridname','lodash','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/logger','zoho','redis','defaults','localhost','emit','[HTTP]','length','includes','string','picklist','idField','content','toString','variableName','type','customVariable','Variable','toLowerCase','name','indexOf'];(function(_0x2a27d2,_0x1194e5){var _0x18f683=function(_0x553e0d){while(--_0x553e0d){_0x2a27d2['push'](_0x2a27d2['shift']());}};_0x18f683(++_0x1194e5);}(_0xcb04,0x7c));var _0x4cb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb04[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4cb0('0x0'));var rp=require(_0x4cb0('0x1'));var md5=require('md5');var util=require(_0x4cb0('0x2'));var intUtil=require(_0x4cb0('0x3'));var moment=require(_0x4cb0('0x4'));var Redis=require(_0x4cb0('0x5'));var BPromise=require(_0x4cb0('0x6'));var config=require('../../../../config/environment');var logger=require(_0x4cb0('0x7'))(_0x4cb0('0x8'));config[_0x4cb0('0x9')]=_[_0x4cb0('0xa')](config[_0x4cb0('0x9')],{'host':_0x4cb0('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5dbaa7,_0x1870ae,_0x520a70){io['to'](_0x5dbaa7)[_0x4cb0('0xc')](_0x1870ae,_0x520a70);}function request(_0x49e46e){logger['debug'](_0x4cb0('0xd'),JSON['stringify'](_0x49e46e));return rp(_0x49e46e);}function getCustomFields(_0x33c6f7,_0x58fd56){var _0x51b863={};if(_0x33c6f7[_0x4cb0('0xe')]>0x0){_['forEach'](_0x33c6f7,function(_0x4385b2){if(_[_0x4cb0('0xf')]([_0x4cb0('0x10'),_0x4cb0('0x11')],_0x4385b2['type'])&&_0x4385b2[_0x4cb0('0x12')]){_0x51b863[_0x4385b2[_0x4cb0('0x12')]]=_0x4385b2[_0x4cb0('0x13')][_0x4cb0('0x14')]();}else if(_0x4385b2['type']==='variable'&&_0x4385b2[_0x4cb0('0x15')]&&_0x4385b2[_0x4cb0('0x12')]&&_0x58fd56[_0x4385b2[_0x4cb0('0x15')]]){_0x51b863[_0x4385b2[_0x4cb0('0x12')]]=_0x58fd56[_0x4385b2['variableName']][_0x4cb0('0x14')]();}else if(_0x4385b2[_0x4cb0('0x16')]===_0x4cb0('0x17')&&_0x4385b2[_0x4cb0('0x18')]&&_0x4385b2[_0x4cb0('0x18')]['name']&&_0x4385b2[_0x4cb0('0x12')]&&_0x58fd56[_0x4385b2[_0x4cb0('0x18')]['name'][_0x4cb0('0x19')]()]){_0x51b863[_0x4385b2[_0x4cb0('0x12')]]=_0x58fd56[_0x4385b2['Variable'][_0x4cb0('0x1a')][_0x4cb0('0x19')]()][_0x4cb0('0x14')]();}});}return _0x51b863;}function getName(_0x3bf528){if(_0x3bf528[_0x4cb0('0x1b')]('\x20')>0x0){var _0x3ef2f5=_0x3bf528[_0x4cb0('0x1c')](/ (.+)/);if(_0x3ef2f5[0x1]){return _0x3ef2f5;}}return[_0x3bf528,_0x3bf528];}var accountsTokens={};function getAccessToken(_0x44c763){return new Promise(function(_0x3c8978,_0x544180){if(!_[_0x4cb0('0x1d')](accountsTokens[_0x44c763['id']])&&!_[_0x4cb0('0x1d')](accountsTokens[_0x44c763['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x44c763['id']][_0x4cb0('0x1e')])){_0x3c8978(accountsTokens[_0x44c763['id']]['access_token']);}}var _0x2790e1;switch(_0x44c763['zone']){case'US':_0x2790e1=_0x4cb0('0x1f');break;case'AU':_0x2790e1=_0x4cb0('0x20');break;case'EU':_0x2790e1='https://accounts.zoho.eu';break;case'IN':_0x2790e1=_0x4cb0('0x21');break;case'CN':_0x2790e1=_0x4cb0('0x22');break;default:_0x2790e1=_0x4cb0('0x23');break;}var _0x296bc2={'method':_0x4cb0('0x24'),'uri':_0x2790e1+'/oauth/v2/token','qs':{'refresh_token':_0x44c763[_0x4cb0('0x25')],'client_id':_0x44c763[_0x4cb0('0x26')],'client_secret':_0x44c763['clientSecret'],'grant_type':_0x4cb0('0x27')},'json':!![]};return rp(_0x296bc2)[_0x4cb0('0x28')](function(_0x17951f){accountsTokens[_0x44c763['id']]={'access_token':_0x17951f['access_token'],'expires_in':moment()[_0x4cb0('0x29')](_0x17951f[_0x4cb0('0x1e')],_0x4cb0('0x2a'))};_0x3c8978(_0x17951f['access_token']);})[_0x4cb0('0x2b')](function(_0x4f7ce6){logger[_0x4cb0('0x2c')](_0x4cb0('0x2d'),_0x4f7ce6[_0x4cb0('0x2e')]);_0x544180(_0x4f7ce6);});});}function getUser(_0x8a572c,_0x5860c8,_0xce53be,_0x15dea8){logger[_0x4cb0('0x2f')](_0x4cb0('0x30'));return request({'method':_0x4cb0('0x31'),'uri':util[_0x4cb0('0x32')](_0x4cb0('0x33'),_0x5860c8),'qs':{'type':_0x4cb0('0x34')},'headers':{'Authorization':_0x4cb0('0x35')+_0x8a572c},'json':!![]})[_0x4cb0('0x28')](function(_0x1029e3){if(_0x1029e3[_0x4cb0('0x36')]){var _0x178dea=-0x1;if(_[_0x4cb0('0x37')](_0x1029e3[_0x4cb0('0x36')])){if(!_[_0x4cb0('0x1d')](_0x15dea8)){_0x178dea=_[_0x4cb0('0x38')](_0x1029e3['users'],function(_0x339b09){return _0x339b09[_0x4cb0('0x39')]===_0x15dea8;});}if(_0x178dea>=0x0){logger[_0x4cb0('0x2f')](_0x4cb0('0x3a'));}else{logger['info'](_0x4cb0('0x3b'));_0x178dea=_['findIndex'](_0x1029e3[_0x4cb0('0x36')],function(_0x3e2ebd){return _0x3e2ebd[_0x4cb0('0x3c')][_0x4cb0('0x1a')]===_0x4cb0('0x3d');});}return _0x1029e3[_0x4cb0('0x36')][_0x178dea];}else{if(_0x1029e3[_0x4cb0('0x3e')][_0x4cb0('0x3c')][_0x4cb0('0x1a')]==='Administrator'){logger['info'](_0x4cb0('0x3b'));user=_0x1029e3[_0x4cb0('0x3e')];return user;}else{logger[_0x4cb0('0x2c')](_0x4cb0('0x3f'),JSON[_0x4cb0('0x40')](_0x1029e3));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x4cb0('0x40')](_0x1029e3));}}}else{logger[_0x4cb0('0x2c')](_0x4cb0('0x3f'),JSON[_0x4cb0('0x40')](_0x1029e3));throw new Error(_0x4cb0('0x41')+JSON[_0x4cb0('0x40')](_0x1029e3));}})[_0x4cb0('0x2b')](function(_0x1fe5fe){console[_0x4cb0('0x2c')](_0x1fe5fe);});}function getZohoUser(_0x398870,_0xc132aa){return new BPromise(function(_0x2ac068,_0x4fa651){request(_0x398870)[_0x4cb0('0x28')](function(_0x4d6b8f){var _0x29b060=null;if(_0x4d6b8f){_0x29b060=_0x4d6b8f[_0x4cb0('0x42')][0x0];_0x29b060['enduserType']=_0xc132aa;}_0x2ac068(_0x29b060);})[_0x4cb0('0x2b')](function(_0x35e673){_0x4fa651(_0x35e673);});});}function createEndUser(_0x4ce129,_0x1b6603,_0x3f8326,_0x1acf23,_0x41d45a,_0xb87515){var _0x3f8326=getName(_0x3f8326);return request({'method':_0x4cb0('0x24'),'uri':_0x4cb0('0x43')+_0x1b6603+'/crm/v2/'+_[_0x4cb0('0x44')](_0xb87515[_0x4cb0('0x45')])+'s','body':{'data':[{'Last_Name':_0x3f8326[0x1],'First_Name':_0x3f8326[0x0],'Phone':_0x1acf23,'Owner':{'name':!_[_0x4cb0('0x1d')](_0x41d45a['role'][_0x4cb0('0x1a')])?_0x41d45a['role'][_0x4cb0('0x1a')]:!_['isNil'](_0x41d45a['first_name'])?_0x41d45a[_0x4cb0('0x46')]+'\x20'+_0x41d45a[_0x4cb0('0x47')]:_0x41d45a[_0x4cb0('0x47')],'id':_0x41d45a['id']}}]},'headers':{'Authorization':_0x4cb0('0x35')+_0x4ce129},'json':!![]})['then'](function(_0x32eaa8){if(_0x32eaa8&&_0x32eaa8['data'][0x0]['code']===_0x4cb0('0x48')){var _0xac50ec=_0x32eaa8['data'][0x0][_0x4cb0('0x49')];_0xac50ec[_0x4cb0('0x4a')]=_[_0x4cb0('0x44')](_0xb87515[_0x4cb0('0x45')])+'s';return _0xac50ec;}logger[_0x4cb0('0x2c')](_0x4cb0('0x3f'),JSON[_0x4cb0('0x40')](data));throw new Error(_0x4cb0('0x4b')+JSON[_0x4cb0('0x40')](data));})['catch'](function(_0xe128a8){console['log']('CREATE\x20ERROR',_0xe128a8);});}function getEndUser(_0x29fe9c,_0x358833,_0x18a3f8,_0x46656b,_0x3f48f8,_0xaec213,_0x503626){var _0x7a3456={'method':'GET','uri':'','headers':{'Authorization':_0x4cb0('0x35')+_0x29fe9c},'json':!![]};switch(_0x503626[_0x4cb0('0x4c')]){case'contact_lead':_0x7a3456['uri']='https://www.zohoapis.'+_0x358833+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3f48f8+'))';return getZohoUser(_0x7a3456,_0x4cb0('0x4d'))['then'](function(_0xefd856){if(_0xefd856)return _0xefd856;_0x7a3456[_0x4cb0('0x4e')]=_0x4cb0('0x43')+_0x358833+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3f48f8+'))';return getZohoUser(_0x7a3456,'Leads')[_0x4cb0('0x28')](function(_0x2919ab){if(_0x2919ab)return _0x2919ab;if(_0x503626[_0x4cb0('0x45')]!=_0x4cb0('0x4f')){return createEndUser(_0x29fe9c,_0x358833,_0x46656b,_0x3f48f8,_0xaec213,_0x503626);}else{return{};}});});break;case _0x4cb0('0x50'):_0x7a3456[_0x4cb0('0x4e')]=_0x4cb0('0x43')+_0x358833+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3f48f8+'))';return getZohoUser(_0x7a3456,'Contacts')[_0x4cb0('0x28')](function(_0x154fe8){if(_0x154fe8)return _0x154fe8;if(_0x503626[_0x4cb0('0x45')]!=_0x4cb0('0x4f')){return createEndUser(_0x29fe9c,_0x358833,_0x46656b,_0x3f48f8,_0xaec213,_0x503626);}else{return{};}});break;case _0x4cb0('0x51'):_0x7a3456[_0x4cb0('0x4e')]=_0x4cb0('0x43')+_0x358833+_0x4cb0('0x52')+_0x3f48f8+'))';return getZohoUser(_0x7a3456,_0x4cb0('0x53'))[_0x4cb0('0x28')](function(_0x2d8dfd){if(_0x2d8dfd)return _0x2d8dfd;if(_0x503626[_0x4cb0('0x45')]!='nothing'){return createEndUser(_0x29fe9c,_0x358833,_0x46656b,_0x3f48f8,_0xaec213,_0x503626);}else{return{};}});break;}}function getCall(_0x560d7d,_0x5aaa62,_0x1e50c3,_0x21a168,_0x4394ea,_0x37b816,_0x22de6c,_0x20c7f0){logger[_0x4cb0('0x2f')](_0x4cb0('0x54'));var _0x4039a7={};_0x4039a7[_0x4cb0('0x55')]={'name':!_['isNil'](_0x21a168[_0x4cb0('0x56')][_0x4cb0('0x1a')])&&!_[_0x4cb0('0x1d')](_0x21a168[_0x4cb0('0x3c')][_0x4cb0('0x1a')])&&_0x21a168['profile'][_0x4cb0('0x1a')]===_0x4cb0('0x57')?_0x21a168[_0x4cb0('0x56')][_0x4cb0('0x1a')]:!_['isNil'](_0x21a168['first_name'])?_0x21a168['first_name']+'\x20'+_0x21a168[_0x4cb0('0x47')]:_0x21a168['last_name'],'id':_0x21a168['id']};_0x4039a7['Subject']=intUtil['getString'](_0x37b816[_0x4cb0('0x58')],_0x22de6c,'\x20');_0x4039a7[_0x4cb0('0x59')]=intUtil[_0x4cb0('0x5a')](_0x37b816['Descriptions'],_0x22de6c,'\x0a');if(_0x4394ea[_0x4cb0('0x4a')]===_0x4cb0('0x4d')){_0x4039a7[_0x4cb0('0x5b')]={'name':!_['isNil'](_0x4394ea[_0x4cb0('0x5c')])?_0x4394ea[_0x4cb0('0x5c')]:!_[_0x4cb0('0x1d')](_0x4394ea[_0x4cb0('0x5d')])?_0x4394ea[_0x4cb0('0x5d')]+'\x20'+_0x4394ea[_0x4cb0('0x5e')]:_0x4394ea[_0x4cb0('0x5e')],'id':_0x4394ea['id']};}if(_0x4394ea['enduserType']===_0x4cb0('0x53')){_0x4039a7['What_Id']={'name':!_[_0x4cb0('0x1d')](_0x4394ea[_0x4cb0('0x5c')])?_0x4394ea[_0x4cb0('0x5c')]:!_[_0x4cb0('0x1d')](_0x4394ea[_0x4cb0('0x5d')])?_0x4394ea[_0x4cb0('0x5d')]+'\x20'+_0x4394ea[_0x4cb0('0x5e')]:_0x4394ea['Last_Name'],'id':_0x4394ea['id']};_0x4039a7[_0x4cb0('0x5f')]=_[_0x4cb0('0x44')](_0x4394ea[_0x4cb0('0x4a')]);}if(_0x22de6c[_0x4cb0('0x60')]){_0x4039a7[_0x4cb0('0x61')]=moment[_0x4cb0('0x62')](parseInt(_0x22de6c[_0x4cb0('0x60')])*0x3e8)['format'](_0x4cb0('0x63'));}else if(_0x22de6c[_0x4cb0('0x64')]&&_0x22de6c[_0x4cb0('0x65')]){_0x4039a7['Call_Duration']=moment['utc'](moment(_0x22de6c[_0x4cb0('0x65')],_0x4cb0('0x66'))['diff'](moment(_0x22de6c[_0x4cb0('0x67')],_0x4cb0('0x66'))))[_0x4cb0('0x32')](_0x4cb0('0x63'));}switch(_0x22de6c[_0x4cb0('0x68')]){case _0x4cb0('0x69'):_0x4039a7[_0x4cb0('0x6a')]=_0x4cb0('0x6b');break;case _0x4cb0('0x6c'):case _0x4cb0('0x6d'):_0x4039a7['Call_Result']=_0x4cb0('0x6e');break;case _0x4cb0('0x6f'):_0x4039a7[_0x4cb0('0x6a')]='Rejected';break;case _0x4cb0('0x70'):_0x4039a7[_0x4cb0('0x6a')]='Abandoned';break;case _0x4cb0('0x71'):_0x4039a7['Call_Result']=_0x4cb0('0x72');default:}_0x4039a7[_0x4cb0('0x73')]=(_0x20c7f0===_0x4cb0('0x74')?moment(_0x22de6c[_0x4cb0('0x67')])['format'](_0x4cb0('0x66')):moment(_0x22de6c[_0x4cb0('0x75')])[_0x4cb0('0x32')](_0x4cb0('0x66')))||moment()[_0x4cb0('0x32')](_0x4cb0('0x66'));_0x4039a7[_0x4cb0('0x76')]=_0x20c7f0||'Inbound';_0x4039a7=_[_0x4cb0('0x77')](_0x4039a7,getCustomFields(_0x37b816[_0x4cb0('0x78')],_0x22de6c));return request({'method':_0x4cb0('0x24'),'uri':_0x4cb0('0x43')+_0x5aaa62+_0x4cb0('0x79'),'headers':{'Authorization':_0x4cb0('0x35')+_0x560d7d},'body':{'data':[_0x4039a7]},'json':!![]})[_0x4cb0('0x28')](function(_0x50bbb2){if(_0x50bbb2&&_0x50bbb2[_0x4cb0('0x42')][0x0][_0x4cb0('0x7a')]==='SUCCESS'){logger[_0x4cb0('0x2f')](_0x4cb0('0x7b'));return{'id':_0x50bbb2[_0x4cb0('0x42')][0x0][_0x4cb0('0x49')]['id']};}})[_0x4cb0('0x2b')](function(_0x12497d){logger[_0x4cb0('0x2f')]('err',_0x12497d[_0x4cb0('0x2e')]);console['log'](_0x4cb0('0x7c'),_0x12497d);});}exports[_0x4cb0('0x7d')]=function(_0x39edbc,_0x2de196,_0xe95e10,_0x396161,_0x4487df,_0x4b9eea){var _0x1694df,_0x5b3899,_0x5bbf98;_0x4b9eea['host']=intUtil[_0x4cb0('0x7e')](_0x4b9eea['host']);_0x4b9eea['serverUrl']=intUtil[_0x4cb0('0x7e')](_0x4b9eea['serverUrl']);if(_0x4487df&&_0x4487df[_0x4cb0('0x7f')]){logger[_0x4cb0('0x2f')](_0x4cb0('0x80'),_0x4cb0('0x81'));_0x2de196['recordingURL']=_0x4b9eea[_0x4cb0('0x82')]+_0x4cb0('0x83')+_0x2de196[_0x4cb0('0x84')]+_0x4cb0('0x85')+md5(_0x2de196[_0x4cb0('0x84')]);}else{_0x2de196[_0x4cb0('0x86')]='';}var _0x48b88c=_0x4b9eea[_0x4cb0('0x87')]===_0x4cb0('0x88')?'eu':_0x4cb0('0x89');return getAccessToken(_0x4b9eea)[_0x4cb0('0x28')](function(_0x18921c){_0x5bbf98=_0x18921c;return getUser(_0x5bbf98,_0x48b88c,_0x4b9eea,_0x396161[_0x4cb0('0x39')]);})['then'](function(_0x1fafd9){_0x1694df=_0x1fafd9;logger[_0x4cb0('0x2f')](_0x4cb0('0x8a'),_0x1694df['id']);return getEndUser(_0x5bbf98,_0x48b88c,_0x4b9eea,_0x2de196['calleridname'],_0x2de196[_0x4cb0('0x8b')],_0x1694df,_0xe95e10);})[_0x4cb0('0x28')](function(_0x12bf5a){_0x5b3899=_0x12bf5a;return getCall(_0x5bbf98,_0x48b88c,_0x4b9eea,_0x1694df,_0x5b3899,_0xe95e10,_0x2de196,'Inbound');})[_0x4cb0('0x28')](function(_0x3f1956){if(_0x3f1956){logger[_0x4cb0('0x2f')](_0x4cb0('0x8c'),_0x3f1956['id']);logger['info'](_0x4cb0('0x80'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4cb0('0x32')](_0x4cb0('0x8d'),_0x396161['name']),'trigger:browser:url',{'uri':_0x4cb0('0x8e')+_0x4b9eea[_0x4cb0('0x87')]+_0x4cb0('0x8f')+_0x3f1956['id']});}})[_0x4cb0('0x2b')](function(_0x34fd83){logger['error'](_0x4cb0('0x80'),JSON[_0x4cb0('0x40')](_0x34fd83));});};exports[_0x4cb0('0x74')]=function(_0x54c293,_0x4c154c,_0x56a58f,_0x3d679a,_0x13f52f,_0x26080d,_0x13901f){var _0xa9e644,_0x3474a8,_0x6bdaf3;_0x26080d['host']=intUtil[_0x4cb0('0x7e')](_0x26080d['host']);_0x26080d[_0x4cb0('0x82')]=intUtil[_0x4cb0('0x7e')](_0x26080d[_0x4cb0('0x82')]);if(_0x13901f&&_0x13901f[_0x4cb0('0x90')]&&_0x13901f[_0x4cb0('0x90')]!==_0x4cb0('0x91')){logger['info'](_0x4cb0('0x92'),_0x4cb0('0x81'));_0x4c154c[_0x4cb0('0x86')]=_0x26080d['serverUrl']+'/api/voice/recordings/'+_0x4c154c['uniqueid']+_0x4cb0('0x85')+md5(_0x4c154c[_0x4cb0('0x84')]);}var _0x4db1ed=_0x26080d[_0x4cb0('0x87')]===_0x4cb0('0x88')?'eu':_0x4cb0('0x89');return getAccessToken(_0x26080d)['then'](function(_0x44f0bf){_0x6bdaf3=_0x44f0bf;return getUser(_0x6bdaf3,_0x4db1ed,_0x26080d,_0x3d679a['email']);})[_0x4cb0('0x28')](function(_0x55831b){_0xa9e644=_0x55831b;logger[_0x4cb0('0x2f')]('The\x20User\x20ID\x20is:',_0xa9e644['id']);return getEndUser(_0x6bdaf3,_0x4db1ed,_0x26080d,_0x4c154c['destcalleridname'],_0x4c154c[_0x4cb0('0x93')],_0xa9e644,_0x56a58f);})['then'](function(_0x5f4ffc){_0x3474a8=_0x5f4ffc;return getCall(_0x6bdaf3,_0x4db1ed,_0x26080d,_0xa9e644,_0x3474a8,_0x56a58f,_0x4c154c,_0x4cb0('0x94'));})['then'](function(_0x38ccaf){if(_0x38ccaf){logger['info'](_0x4cb0('0x8c'),_0x38ccaf['id']);logger[_0x4cb0('0x2f')](_0x4cb0('0x92'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4cb0('0x32')]('user:%s',_0x3d679a[_0x4cb0('0x1a')]),_0x4cb0('0x95'),{'uri':'https://crm.'+_0x26080d[_0x4cb0('0x87')]+'/crm/EntityInfo.do?module=Calls&id='+_0x38ccaf['id']});}})['catch'](function(_0x179008){logger[_0x4cb0('0x2c')](_0x4cb0('0x92'),JSON[_0x4cb0('0x40')](_0x179008));});};exports['unmanaged']=function(_0x40a8b2,_0x54c6a3,_0x52e993,_0x25cc77,_0x4cd5aa,_0x58f9bd){var _0x4664ba,_0x55be63,_0x37f18d;_0x58f9bd['host']=intUtil[_0x4cb0('0x7e')](_0x58f9bd['host']);_0x58f9bd[_0x4cb0('0x82')]=intUtil[_0x4cb0('0x7e')](_0x58f9bd[_0x4cb0('0x82')]);if(_0x4cd5aa&&_0x4cd5aa['monitor_format']){logger['info']('['+_0x54c6a3[_0x4cb0('0x68')][_0x4cb0('0x96')]()+']','Recording\x20is\x20enabled!');_0x54c6a3[_0x4cb0('0x86')]=_0x58f9bd[_0x4cb0('0x82')]+_0x4cb0('0x83')+_0x54c6a3['uniqueid']+_0x4cb0('0x85')+md5(_0x54c6a3[_0x4cb0('0x84')]);}else{_0x54c6a3['recordingURL']='';}var _0x4d75d4=_0x58f9bd[_0x4cb0('0x87')]===_0x4cb0('0x88')?'eu':_0x4cb0('0x89');return getAccessToken(_0x58f9bd)['then'](function(_0x3ef2f8){_0x37f18d=_0x3ef2f8;return getUser(_0x37f18d,_0x4d75d4,_0x58f9bd);})[_0x4cb0('0x28')](function(_0x2e1f8c){_0x4664ba=_0x2e1f8c;logger[_0x4cb0('0x2f')](_0x4cb0('0x8a'),_0x4664ba['id']);return getEndUser(_0x37f18d,_0x4d75d4,_0x58f9bd,_0x54c6a3[_0x4cb0('0x97')],_0x54c6a3[_0x4cb0('0x8b')],_0x4664ba,_0x52e993);})['then'](function(_0xeec14a){_0x55be63=_0xeec14a;return getCall(_0x37f18d,_0x4d75d4,_0x58f9bd,_0x4664ba,_0x55be63,_0x52e993,_0x54c6a3,'Inbound');})[_0x4cb0('0x28')](function(_0x6bd143){if(_0x6bd143){logger['info'](_0x4cb0('0x8c'),_0x6bd143['id']);}})[_0x4cb0('0x2b')](function(_0x428396){logger[_0x4cb0('0x2c')]('['+_0x54c6a3[_0x4cb0('0x68')][_0x4cb0('0x96')]()+']',JSON['stringify'](_0x428396));});}; \ No newline at end of file +var _0xc682=['details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Descriptions','Last_Name','Full_Name','First_Name','$se_module','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','stack','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','unmanaged','toUpperCase','calleridname','The\x20Call\x20ID\x20is:','lodash','request-promise','md5','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','debug','[HTTP]','length','forEach','includes','string','picklist','type','idField','content','variable','variableName','toString','Variable','name','toLowerCase','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','refresh_token','then','catch','Failing\x20creating\x20the\x20access_token','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','info','Agent\x20found!','profile','Administrator','Using\x20the\x20admin\x20account!','user','error','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','data'];(function(_0x1d6cea,_0x1a51ba){var _0x521c30=function(_0x13d9d8){while(--_0x13d9d8){_0x1d6cea['push'](_0x1d6cea['shift']());}};_0x521c30(++_0x1a51ba);}(_0xc682,0xed));var _0x2c68=function(_0x40dfa5,_0x8fbfe8){_0x40dfa5=_0x40dfa5-0x0;var _0x1ce667=_0xc682[_0x40dfa5];return _0x1ce667;};'use strict';var _=require(_0x2c68('0x0'));var rp=require(_0x2c68('0x1'));var md5=require(_0x2c68('0x2'));var util=require(_0x2c68('0x3'));var intUtil=require(_0x2c68('0x4'));var moment=require(_0x2c68('0x5'));var Redis=require(_0x2c68('0x6'));var BPromise=require('bluebird');var config=require(_0x2c68('0x7'));var logger=require(_0x2c68('0x8'))('zoho');config[_0x2c68('0x9')]=_['defaults'](config[_0x2c68('0x9')],{'host':_0x2c68('0xa'),'port':0x18eb});var io=require(_0x2c68('0xb'))(new Redis(config[_0x2c68('0x9')]));function emit(_0x1b27c7,_0x5ab85e,_0x2ab29e){io['to'](_0x1b27c7)['emit'](_0x5ab85e,_0x2ab29e);}function request(_0xc34ae0){logger[_0x2c68('0xc')](_0x2c68('0xd'),JSON['stringify'](_0xc34ae0));return rp(_0xc34ae0);}function getCustomFields(_0x2e4a74,_0x3b0564){var _0x4ab5dd={};if(_0x2e4a74[_0x2c68('0xe')]>0x0){_[_0x2c68('0xf')](_0x2e4a74,function(_0x3dc76a){if(_[_0x2c68('0x10')]([_0x2c68('0x11'),_0x2c68('0x12')],_0x3dc76a[_0x2c68('0x13')])&&_0x3dc76a[_0x2c68('0x14')]){_0x4ab5dd[_0x3dc76a[_0x2c68('0x14')]]=_0x3dc76a[_0x2c68('0x15')]['toString']();}else if(_0x3dc76a['type']===_0x2c68('0x16')&&_0x3dc76a[_0x2c68('0x17')]&&_0x3dc76a[_0x2c68('0x14')]&&_0x3b0564[_0x3dc76a[_0x2c68('0x17')]]){_0x4ab5dd[_0x3dc76a['idField']]=_0x3b0564[_0x3dc76a[_0x2c68('0x17')]][_0x2c68('0x18')]();}else if(_0x3dc76a[_0x2c68('0x13')]==='customVariable'&&_0x3dc76a[_0x2c68('0x19')]&&_0x3dc76a[_0x2c68('0x19')][_0x2c68('0x1a')]&&_0x3dc76a[_0x2c68('0x14')]&&_0x3b0564[_0x3dc76a[_0x2c68('0x19')][_0x2c68('0x1a')][_0x2c68('0x1b')]()]){_0x4ab5dd[_0x3dc76a[_0x2c68('0x14')]]=_0x3b0564[_0x3dc76a[_0x2c68('0x19')][_0x2c68('0x1a')][_0x2c68('0x1b')]()][_0x2c68('0x18')]();}});}return _0x4ab5dd;}function getName(_0x317215){if(_0x317215['indexOf']('\x20')>0x0){var _0x2a2fb6=_0x317215['split'](/ (.+)/);if(_0x2a2fb6[0x1]){return _0x2a2fb6;}}return[_0x317215,_0x317215];}var accountsTokens={};function getAccessToken(_0x26592d){return new Promise(function(_0x555710,_0x176a8c){if(!_['isNil'](accountsTokens[_0x26592d['id']])&&!_[_0x2c68('0x1c')](accountsTokens[_0x26592d['id']][_0x2c68('0x1d')])){if(moment()[_0x2c68('0x1e')](accountsTokens[_0x26592d['id']][_0x2c68('0x1f')])){_0x555710(accountsTokens[_0x26592d['id']][_0x2c68('0x1d')]);}}var _0x52a50a;switch(_0x26592d['zone']){case'US':_0x52a50a=_0x2c68('0x20');break;case'AU':_0x52a50a=_0x2c68('0x21');break;case'EU':_0x52a50a=_0x2c68('0x22');break;case'IN':_0x52a50a=_0x2c68('0x23');break;case'CN':_0x52a50a=_0x2c68('0x24');break;default:_0x52a50a=_0x2c68('0x22');break;}var _0x18c29e={'method':_0x2c68('0x25'),'uri':_0x52a50a+_0x2c68('0x26'),'qs':{'refresh_token':_0x26592d['refreshToken'],'client_id':_0x26592d[_0x2c68('0x27')],'client_secret':_0x26592d['clientSecret'],'grant_type':_0x2c68('0x28')},'json':!![]};return rp(_0x18c29e)[_0x2c68('0x29')](function(_0x4aee95){accountsTokens[_0x26592d['id']]={'access_token':_0x4aee95[_0x2c68('0x1d')],'expires_in':moment()['add'](_0x4aee95[_0x2c68('0x1f')],'seconds')};_0x555710(_0x4aee95[_0x2c68('0x1d')]);})[_0x2c68('0x2a')](function(_0x230d9f){logger['error'](_0x2c68('0x2b'),_0x230d9f['stack']);_0x176a8c(_0x230d9f);});});}function getUser(_0x2578e7,_0x5df10a,_0x2dc733,_0xf322cc){logger['info'](_0x2c68('0x2c'));return request({'method':_0x2c68('0x2d'),'uri':util[_0x2c68('0x2e')](_0x2c68('0x2f'),_0x5df10a),'qs':{'type':_0x2c68('0x30')},'headers':{'Authorization':_0x2c68('0x31')+_0x2578e7},'json':!![]})[_0x2c68('0x29')](function(_0x2c9560){if(_0x2c9560[_0x2c68('0x32')]){var _0x3ebc82=-0x1;if(_['isArrayLikeObject'](_0x2c9560['users'])){if(!_[_0x2c68('0x1c')](_0xf322cc)){_0x3ebc82=_[_0x2c68('0x33')](_0x2c9560['users'],function(_0x14c812){return _0x14c812[_0x2c68('0x34')]===_0xf322cc;});}if(_0x3ebc82>=0x0){logger[_0x2c68('0x35')](_0x2c68('0x36'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x3ebc82=_[_0x2c68('0x33')](_0x2c9560[_0x2c68('0x32')],function(_0x3f6750){return _0x3f6750[_0x2c68('0x37')]['name']===_0x2c68('0x38');});}return _0x2c9560[_0x2c68('0x32')][_0x3ebc82];}else{if(_0x2c9560['user'][_0x2c68('0x37')]['name']===_0x2c68('0x38')){logger[_0x2c68('0x35')](_0x2c68('0x39'));user=_0x2c9560[_0x2c68('0x3a')];return user;}else{logger[_0x2c68('0x3b')]('The\x20failing\x20result\x20is',JSON[_0x2c68('0x3c')](_0x2c9560));throw new Error(_0x2c68('0x3d')+JSON['stringify'](_0x2c9560));}}}else{logger[_0x2c68('0x3b')](_0x2c68('0x3e'),JSON[_0x2c68('0x3c')](_0x2c9560));throw new Error(_0x2c68('0x3d')+JSON[_0x2c68('0x3c')](_0x2c9560));}})[_0x2c68('0x2a')](function(_0x3a844e){console[_0x2c68('0x3b')](_0x3a844e);});}function getZohoUser(_0x11d42c,_0x30e98b){return new BPromise(function(_0x226f81,_0x3616ce){request(_0x11d42c)[_0x2c68('0x29')](function(_0x11689c){var _0x239650=null;if(_0x11689c){_0x239650=_0x11689c['data'][0x0];_0x239650[_0x2c68('0x3f')]=_0x30e98b;}_0x226f81(_0x239650);})[_0x2c68('0x2a')](function(_0x2adbc9){_0x3616ce(_0x2adbc9);});});}function createEndUser(_0x277f8d,_0x316117,_0x2e6eb5,_0x5436af,_0x4fda64,_0x4a9d0b){var _0x2e6eb5=getName(_0x2e6eb5);return request({'method':_0x2c68('0x25'),'uri':'https://www.zohoapis.'+_0x316117+_0x2c68('0x40')+_[_0x2c68('0x41')](_0x4a9d0b[_0x2c68('0x42')])+'s','body':{'data':[{'Last_Name':_0x2e6eb5[0x1],'First_Name':_0x2e6eb5[0x0],'Phone':_0x5436af,'Owner':{'name':!_[_0x2c68('0x1c')](_0x4fda64[_0x2c68('0x43')][_0x2c68('0x1a')])?_0x4fda64['role'][_0x2c68('0x1a')]:!_[_0x2c68('0x1c')](_0x4fda64[_0x2c68('0x44')])?_0x4fda64[_0x2c68('0x44')]+'\x20'+_0x4fda64['last_name']:_0x4fda64[_0x2c68('0x45')],'id':_0x4fda64['id']}}]},'headers':{'Authorization':_0x2c68('0x31')+_0x277f8d},'json':!![]})[_0x2c68('0x29')](function(_0x239a6f){if(_0x239a6f&&_0x239a6f['data'][0x0][_0x2c68('0x46')]===_0x2c68('0x47')){var _0x53aa8f=_0x239a6f[_0x2c68('0x48')][0x0][_0x2c68('0x49')];_0x53aa8f[_0x2c68('0x3f')]=_[_0x2c68('0x41')](_0x4a9d0b['moduleCreate'])+'s';return _0x53aa8f;}logger[_0x2c68('0x3b')](_0x2c68('0x3e'),JSON[_0x2c68('0x3c')](data));throw new Error(_0x2c68('0x4a')+JSON['stringify'](data));})[_0x2c68('0x2a')](function(_0x2502ee){console[_0x2c68('0x4b')](_0x2c68('0x4c'),_0x2502ee);});}function getEndUser(_0x2258e9,_0x46d46b,_0x1d8e0a,_0x310636,_0x4e1941,_0x24d014,_0x43c74b){var _0x4c4bfb={'method':_0x2c68('0x2d'),'uri':'','headers':{'Authorization':_0x2c68('0x31')+_0x2258e9},'json':!![]};switch(_0x43c74b[_0x2c68('0x4d')]){case _0x2c68('0x4e'):_0x4c4bfb[_0x2c68('0x4f')]=_0x2c68('0x50')+_0x46d46b+_0x2c68('0x51')+_0x4e1941+'))';return getZohoUser(_0x4c4bfb,_0x2c68('0x52'))['then'](function(_0x2b28cd){if(_0x2b28cd)return _0x2b28cd;_0x4c4bfb['uri']=_0x2c68('0x50')+_0x46d46b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4e1941+'))';return getZohoUser(_0x4c4bfb,_0x2c68('0x53'))[_0x2c68('0x29')](function(_0x4b580d){if(_0x4b580d)return _0x4b580d;if(_0x43c74b[_0x2c68('0x42')]!=_0x2c68('0x54')){return createEndUser(_0x2258e9,_0x46d46b,_0x310636,_0x4e1941,_0x24d014,_0x43c74b);}else{return{};}});});break;case _0x2c68('0x55'):_0x4c4bfb[_0x2c68('0x4f')]=_0x2c68('0x50')+_0x46d46b+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4e1941+'))';return getZohoUser(_0x4c4bfb,_0x2c68('0x52'))[_0x2c68('0x29')](function(_0x17b7d0){if(_0x17b7d0)return _0x17b7d0;if(_0x43c74b[_0x2c68('0x42')]!=_0x2c68('0x54')){return createEndUser(_0x2258e9,_0x46d46b,_0x310636,_0x4e1941,_0x24d014,_0x43c74b);}else{return{};}});break;case _0x2c68('0x56'):_0x4c4bfb[_0x2c68('0x4f')]='https://www.zohoapis.'+_0x46d46b+_0x2c68('0x57')+_0x4e1941+'))';return getZohoUser(_0x4c4bfb,_0x2c68('0x53'))['then'](function(_0xb3e27d){if(_0xb3e27d)return _0xb3e27d;if(_0x43c74b[_0x2c68('0x42')]!=_0x2c68('0x54')){return createEndUser(_0x2258e9,_0x46d46b,_0x310636,_0x4e1941,_0x24d014,_0x43c74b);}else{return{};}});break;}}function getCall(_0xf346cc,_0x44d132,_0x3e5bf2,_0x15b960,_0x55d733,_0x498f47,_0x3b7e2a,_0xea14cd){logger[_0x2c68('0x35')](_0x2c68('0x58'));var _0x482704={};_0x482704[_0x2c68('0x59')]={'name':!_[_0x2c68('0x1c')](_0x15b960[_0x2c68('0x43')][_0x2c68('0x1a')])&&!_[_0x2c68('0x1c')](_0x15b960[_0x2c68('0x37')][_0x2c68('0x1a')])&&_0x15b960[_0x2c68('0x37')][_0x2c68('0x1a')]===_0x2c68('0x5a')?_0x15b960[_0x2c68('0x43')][_0x2c68('0x1a')]:!_['isNil'](_0x15b960[_0x2c68('0x44')])?_0x15b960[_0x2c68('0x44')]+'\x20'+_0x15b960['last_name']:_0x15b960[_0x2c68('0x45')],'id':_0x15b960['id']};_0x482704['Subject']=intUtil[_0x2c68('0x5b')](_0x498f47[_0x2c68('0x5c')],_0x3b7e2a,'\x20');_0x482704['Description']=intUtil[_0x2c68('0x5b')](_0x498f47[_0x2c68('0x5d')],_0x3b7e2a,'\x0a');if(_0x55d733[_0x2c68('0x3f')]===_0x2c68('0x52')){_0x482704['Who_Id']={'name':!_['isNil'](_0x55d733['Full_Name'])?_0x55d733['Full_Name']:!_[_0x2c68('0x1c')](_0x55d733['First_Name'])?_0x55d733['First_Name']+'\x20'+_0x55d733[_0x2c68('0x5e')]:_0x55d733[_0x2c68('0x5e')],'id':_0x55d733['id']};}if(_0x55d733[_0x2c68('0x3f')]===_0x2c68('0x53')){_0x482704['What_Id']={'name':!_['isNil'](_0x55d733[_0x2c68('0x5f')])?_0x55d733[_0x2c68('0x5f')]:!_['isNil'](_0x55d733[_0x2c68('0x60')])?_0x55d733[_0x2c68('0x60')]+'\x20'+_0x55d733[_0x2c68('0x5e')]:_0x55d733['Last_Name'],'id':_0x55d733['id']};_0x482704[_0x2c68('0x61')]=_['startCase'](_0x55d733[_0x2c68('0x3f')]);}if(_0x3b7e2a[_0x2c68('0x62')]){_0x482704[_0x2c68('0x63')]=moment[_0x2c68('0x64')](parseInt(_0x3b7e2a[_0x2c68('0x62')])*0x3e8)[_0x2c68('0x2e')](_0x2c68('0x65'));}else if(_0x3b7e2a['answertime']&&_0x3b7e2a[_0x2c68('0x66')]){_0x482704['Call_Duration']=moment['utc'](moment(_0x3b7e2a['endtime'],_0x2c68('0x67'))['diff'](moment(_0x3b7e2a[_0x2c68('0x68')],_0x2c68('0x67'))))[_0x2c68('0x2e')]('mm:ss');}switch(_0x3b7e2a[_0x2c68('0x69')]){case _0x2c68('0x6a'):_0x482704[_0x2c68('0x6b')]=_0x2c68('0x6c');break;case _0x2c68('0x6d'):case _0x2c68('0x6e'):_0x482704['Call_Result']=_0x2c68('0x6f');break;case _0x2c68('0x70'):_0x482704[_0x2c68('0x6b')]=_0x2c68('0x71');break;case'abandoned':_0x482704['Call_Result']=_0x2c68('0x72');break;case _0x2c68('0x73'):_0x482704[_0x2c68('0x6b')]=_0x2c68('0x74');default:}_0x482704[_0x2c68('0x75')]=(_0xea14cd===_0x2c68('0x76')?moment(_0x3b7e2a['starttime'])[_0x2c68('0x2e')](_0x2c68('0x67')):moment(_0x3b7e2a[_0x2c68('0x77')])[_0x2c68('0x2e')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x2c68('0x2e')](_0x2c68('0x67'));_0x482704[_0x2c68('0x78')]=_0xea14cd||_0x2c68('0x79');_0x482704=_[_0x2c68('0x7a')](_0x482704,getCustomFields(_0x498f47[_0x2c68('0x7b')],_0x3b7e2a));return request({'method':'POST','uri':_0x2c68('0x50')+_0x44d132+_0x2c68('0x7c'),'headers':{'Authorization':_0x2c68('0x31')+_0xf346cc},'body':{'data':[_0x482704]},'json':!![]})[_0x2c68('0x29')](function(_0x2c2a9a){if(_0x2c2a9a&&_0x2c2a9a[_0x2c68('0x48')][0x0][_0x2c68('0x46')]===_0x2c68('0x47')){logger[_0x2c68('0x35')](_0x2c68('0x7d'));return{'id':_0x2c2a9a[_0x2c68('0x48')][0x0][_0x2c68('0x49')]['id']};}})[_0x2c68('0x2a')](function(_0x172efe){logger[_0x2c68('0x35')](_0x2c68('0x7e'),_0x172efe[_0x2c68('0x7f')]);console[_0x2c68('0x4b')](_0x2c68('0x7e'),_0x172efe);});}exports[_0x2c68('0x80')]=function(_0x4f6be2,_0x6a2115,_0x147bb5,_0x3e8845,_0x15b39d,_0x19c031){var _0x500afd,_0x10917c,_0xc02a00;_0x19c031[_0x2c68('0x81')]=intUtil[_0x2c68('0x82')](_0x19c031[_0x2c68('0x81')]);_0x19c031['serverUrl']=intUtil[_0x2c68('0x82')](_0x19c031[_0x2c68('0x83')]);if(_0x15b39d&&_0x15b39d['monitor_format']){logger['info'](_0x2c68('0x84'),_0x2c68('0x85'));_0x6a2115[_0x2c68('0x86')]=_0x19c031['serverUrl']+_0x2c68('0x87')+_0x6a2115[_0x2c68('0x88')]+_0x2c68('0x89')+md5(_0x6a2115[_0x2c68('0x88')]);}else{_0x6a2115[_0x2c68('0x86')]='';}var _0x3de0d5=_0x19c031[_0x2c68('0x81')]===_0x2c68('0x8a')?'eu':_0x2c68('0x8b');return getAccessToken(_0x19c031)[_0x2c68('0x29')](function(_0x3b6e37){_0xc02a00=_0x3b6e37;return getUser(_0xc02a00,_0x3de0d5,_0x19c031,_0x3e8845[_0x2c68('0x34')]);})['then'](function(_0x77c3f0){_0x500afd=_0x77c3f0;logger[_0x2c68('0x35')]('The\x20User\x20ID\x20is:',_0x500afd['id']);return getEndUser(_0xc02a00,_0x3de0d5,_0x19c031,_0x6a2115['calleridname'],_0x6a2115[_0x2c68('0x8c')],_0x500afd,_0x147bb5);})[_0x2c68('0x29')](function(_0x201e57){_0x10917c=_0x201e57;return getCall(_0xc02a00,_0x3de0d5,_0x19c031,_0x500afd,_0x10917c,_0x147bb5,_0x6a2115,_0x2c68('0x79'));})[_0x2c68('0x29')](function(_0x1430fe){if(_0x1430fe){logger[_0x2c68('0x35')]('The\x20Call\x20ID\x20is:',_0x1430fe['id']);logger[_0x2c68('0x35')](_0x2c68('0x84'),_0x2c68('0x8d'));emit(util[_0x2c68('0x2e')](_0x2c68('0x8e'),_0x3e8845[_0x2c68('0x1a')]),_0x2c68('0x8f'),{'uri':'https://crm.'+_0x19c031[_0x2c68('0x81')]+_0x2c68('0x90')+_0x1430fe['id']});}})[_0x2c68('0x2a')](function(_0x4d65bb){logger[_0x2c68('0x3b')](_0x2c68('0x84'),JSON['stringify'](_0x4d65bb));});};exports[_0x2c68('0x76')]=function(_0x2ec604,_0x13b042,_0x3f20c8,_0x5d852e,_0x58ff5c,_0x5c6ae6,_0x2cdb7b){var _0x4617fd,_0xc6da23,_0x29ffb4;_0x5c6ae6[_0x2c68('0x81')]=intUtil[_0x2c68('0x82')](_0x5c6ae6['host']);_0x5c6ae6[_0x2c68('0x83')]=intUtil[_0x2c68('0x82')](_0x5c6ae6[_0x2c68('0x83')]);if(_0x2cdb7b&&_0x2cdb7b['recordingFormat']&&_0x2cdb7b[_0x2c68('0x91')]!==_0x2c68('0x92')){logger[_0x2c68('0x35')](_0x2c68('0x93'),_0x2c68('0x85'));_0x13b042['recordingURL']=_0x5c6ae6[_0x2c68('0x83')]+_0x2c68('0x87')+_0x13b042[_0x2c68('0x88')]+_0x2c68('0x89')+md5(_0x13b042['uniqueid']);}var _0x4235ee=_0x5c6ae6[_0x2c68('0x81')]===_0x2c68('0x8a')?'eu':'com';return getAccessToken(_0x5c6ae6)[_0x2c68('0x29')](function(_0x3d122f){_0x29ffb4=_0x3d122f;return getUser(_0x29ffb4,_0x4235ee,_0x5c6ae6,_0x5d852e[_0x2c68('0x34')]);})['then'](function(_0x209ca5){_0x4617fd=_0x209ca5;logger[_0x2c68('0x35')](_0x2c68('0x94'),_0x4617fd['id']);return getEndUser(_0x29ffb4,_0x4235ee,_0x5c6ae6,_0x13b042[_0x2c68('0x95')],_0x13b042[_0x2c68('0x96')],_0x4617fd,_0x3f20c8);})[_0x2c68('0x29')](function(_0x1650e7){_0xc6da23=_0x1650e7;return getCall(_0x29ffb4,_0x4235ee,_0x5c6ae6,_0x4617fd,_0xc6da23,_0x3f20c8,_0x13b042,'Outbound');})['then'](function(_0x1ef487){if(_0x1ef487){logger[_0x2c68('0x35')]('The\x20Call\x20ID\x20is:',_0x1ef487['id']);logger[_0x2c68('0x35')]('[OUTBOUND]',_0x2c68('0x8d'));emit(util[_0x2c68('0x2e')](_0x2c68('0x8e'),_0x5d852e['name']),_0x2c68('0x8f'),{'uri':'https://crm.'+_0x5c6ae6[_0x2c68('0x81')]+'/crm/EntityInfo.do?module=Calls&id='+_0x1ef487['id']});}})['catch'](function(_0x49bf59){logger[_0x2c68('0x3b')]('[OUTBOUND]',JSON[_0x2c68('0x3c')](_0x49bf59));});};exports[_0x2c68('0x97')]=function(_0x2c3473,_0x57f6fd,_0x20f3be,_0x59875b,_0x576ce4,_0x4fe849){var _0x1125ad,_0x40393d,_0x593643;_0x4fe849[_0x2c68('0x81')]=intUtil[_0x2c68('0x82')](_0x4fe849[_0x2c68('0x81')]);_0x4fe849[_0x2c68('0x83')]=intUtil[_0x2c68('0x82')](_0x4fe849[_0x2c68('0x83')]);if(_0x576ce4&&_0x576ce4['monitor_format']){logger[_0x2c68('0x35')]('['+_0x57f6fd['lastevent'][_0x2c68('0x98')]()+']',_0x2c68('0x85'));_0x57f6fd[_0x2c68('0x86')]=_0x4fe849[_0x2c68('0x83')]+'/api/voice/recordings/'+_0x57f6fd[_0x2c68('0x88')]+'/downloads?type=uniqueid&token='+md5(_0x57f6fd[_0x2c68('0x88')]);}else{_0x57f6fd[_0x2c68('0x86')]='';}var _0x4de612=_0x4fe849[_0x2c68('0x81')]===_0x2c68('0x8a')?'eu':_0x2c68('0x8b');return getAccessToken(_0x4fe849)['then'](function(_0x59cece){_0x593643=_0x59cece;return getUser(_0x593643,_0x4de612,_0x4fe849);})[_0x2c68('0x29')](function(_0x2eb9db){_0x1125ad=_0x2eb9db;logger[_0x2c68('0x35')](_0x2c68('0x94'),_0x1125ad['id']);return getEndUser(_0x593643,_0x4de612,_0x4fe849,_0x57f6fd[_0x2c68('0x99')],_0x57f6fd['calleridnum'],_0x1125ad,_0x20f3be);})[_0x2c68('0x29')](function(_0x1854c2){_0x40393d=_0x1854c2;return getCall(_0x593643,_0x4de612,_0x4fe849,_0x1125ad,_0x40393d,_0x20f3be,_0x57f6fd,'Inbound');})[_0x2c68('0x29')](function(_0x39783d){if(_0x39783d){logger[_0x2c68('0x35')](_0x2c68('0x9a'),_0x39783d['id']);}})[_0x2c68('0x2a')](function(_0x4e40eb){logger[_0x2c68('0x3b')]('['+_0x57f6fd[_0x2c68('0x69')][_0x2c68('0x98')]()+']',JSON[_0x2c68('0x3c')](_0x4e40eb));});}; \ 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 a60d92b..b036fa2 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 _0x013b=['shelljs','mustache','../../../../config/logger','exec','data2','data3','render','error','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0x3b348f,_0x55dd28){var _0x2ae8af=function(_0x4d94e3){while(--_0x4d94e3){_0x3b348f['push'](_0x3b348f['shift']());}};_0x2ae8af(++_0x55dd28);}(_0x013b,0xe3));var _0xb013=function(_0x572438,_0x1b94fe){_0x572438=_0x572438-0x0;var _0xc6e9a7=_0x013b[_0x572438];return _0xc6e9a7;};'use strict';var util=require(_0xb013('0x0'));var sh=require(_0xb013('0x1'));var Mustache=require(_0xb013('0x2'));var logger=require(_0xb013('0x3'))('trigger');exports[_0xb013('0x4')]=function(_0x4d45c1,_0x1b76a0){var _0x1a3abe=_0x4d45c1[_0xb013('0x5')]?_0x4d45c1['data2']:'Script';var _0x456b60=_0x4d45c1[_0xb013('0x6')]?Mustache[_0xb013('0x7')](_0x4d45c1[_0xb013('0x6')],_0x1b76a0):_0x1b76a0;sh[_0xb013('0x4')](_0x456b60,function(_0x7c8a,_0x16b5f1,_0x5e0920){if(_0x7c8a!==0x0){logger[_0xb013('0x8')](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x1a3abe,_0x456b60,_0x7c8a,_0x5e0920));}else{logger[_0xb013('0x9')](util[_0xb013('0xa')](_0xb013('0xb'),_0x1a3abe,_0x456b60,_0x16b5f1));}});}; \ No newline at end of file +var _0x192c=['info','util','shelljs','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','format'];(function(_0x2ac8ae,_0x274179){var _0x42a495=function(_0x16a2d3){while(--_0x16a2d3){_0x2ac8ae['push'](_0x2ac8ae['shift']());}};_0x42a495(++_0x274179);}(_0x192c,0x199));var _0xc192=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0x192c[_0x5466ab];return _0x40751a;};'use strict';var util=require(_0xc192('0x0'));var sh=require(_0xc192('0x1'));var Mustache=require('mustache');var logger=require(_0xc192('0x2'))(_0xc192('0x3'));exports[_0xc192('0x4')]=function(_0x170ff6,_0x588b7b){var _0x3874f2=_0x170ff6[_0xc192('0x5')]?_0x170ff6['data2']:_0xc192('0x6');var _0x5f5d26=_0x170ff6[_0xc192('0x7')]?Mustache[_0xc192('0x8')](_0x170ff6['data3'],_0x588b7b):_0x588b7b;sh['exec'](_0x5f5d26,function(_0x3be3d6,_0x440e3c,_0x31144b){if(_0x3be3d6!==0x0){logger[_0xc192('0x9')](util[_0xc192('0xa')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x3874f2,_0x5f5d26,_0x3be3d6,_0x31144b));}else{logger[_0xc192('0xb')](util[_0xc192('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x3874f2,_0x5f5d26,_0x440e3c));}});}; \ 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 318c366..7311d86 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 _0x69c0=[',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','render','data2','data5','number','headers','parse','data6','error','stack','toUpperCase','GET','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','data1','stringify','isNil'];(function(_0x136628,_0xdd3206){var _0x35aad7=function(_0x542332){while(--_0x542332){_0x136628['push'](_0x136628['shift']());}};_0x35aad7(++_0xdd3206);}(_0x69c0,0x6c));var _0x069c=function(_0x1f1a97,_0xadfc15){_0x1f1a97=_0x1f1a97-0x0;var _0x29fc6a=_0x69c0[_0x1f1a97];return _0x29fc6a;};'use strict';var rp=require(_0x069c('0x0'));var util=require(_0x069c('0x1'));var _=require(_0x069c('0x2'));var Mustache=require(_0x069c('0x3'));var logger=require(_0x069c('0x4'))(_0x069c('0x5'));exports[_0x069c('0x6')]=function(_0x3a7d01,_0x284f03){var _0x1ce77c,_0x2fd4b6;var _0x217c02={'method':_0x3a7d01['data1']['toUpperCase'](),'uri':Mustache[_0x069c('0x7')](_0x3a7d01[_0x069c('0x8')],_0x284f03),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3a7d01[_0x069c('0x9')])===_0x069c('0xa')&&parseInt(_0x3a7d01[_0x069c('0x9')])>=0x1&&parseInt(_0x3a7d01[_0x069c('0x9')])<=0xa?parseInt(_0x3a7d01['data5'])*0x3e8:0x5*0x3e8};try{_0x217c02[_0x069c('0xb')]=_0x3a7d01['data6']?JSON[_0x069c('0xc')](Mustache[_0x069c('0x7')](_0x3a7d01[_0x069c('0xd')],_0x284f03)):{};}catch(_0xe5e870){logger[_0x069c('0xe')](_0xe5e870[_0x069c('0xf')]);}switch(_0x3a7d01['data1'][_0x069c('0x10')]()){case _0x069c('0x11'):case'DELETE':_0x1ce77c=null;_0x217c02['qs']=_0x284f03;break;case _0x069c('0x12'):case _0x069c('0x13'):if(_0x3a7d01[_0x069c('0x14')]){try{_0x1ce77c=JSON['parse'](Mustache['render'](_0x3a7d01[_0x069c('0x14')],_0x284f03));_0x217c02[_0x069c('0x15')]=_0x1ce77c;}catch(_0x43bcc2){logger[_0x069c('0xe')](_0x43bcc2[_0x069c('0xf')]);logger[_0x069c('0xe')](_0x069c('0x16'));}}else{_0x1ce77c=_0x284f03;_0x217c02[_0x069c('0x15')]=_0x1ce77c;}break;}logger[_0x069c('0x17')](util[_0x069c('0x18')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x3a7d01[_0x069c('0x19')],_0x3a7d01['data2'],JSON[_0x069c('0x1a')](_0x217c02)));rp(_0x217c02)['then'](function(_0x4a2935){_0x1ce77c=!_[_0x069c('0x1b')](_0x1ce77c)?_0x069c('0x1c')+_0x1ce77c:'';_0x2fd4b6=typeof _0x4a2935['body']===_0x069c('0x1d')?JSON[_0x069c('0x1a')](_0x4a2935['body']):_0x4a2935[_0x069c('0x15')];logger[_0x069c('0x17')](util[_0x069c('0x18')](_0x069c('0x1e'),_0x3a7d01['data1'],_0x3a7d01[_0x069c('0x8')],_0x4a2935[_0x069c('0x1f')],_0x2fd4b6));})[_0x069c('0x20')](function(_0x3e6765){logger['error'](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x3a7d01[_0x069c('0x19')],_0x3a7d01[_0x069c('0x8')],_0x3e6765[_0x069c('0x1f')],_0x3e6765[_0x069c('0x21')],_0x3e6765['message']));});}; \ No newline at end of file +var _0x54ab=['%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','util','lodash','mustache','data1','toUpperCase','render','data2','data5','number','headers','data6','error','stack','GET','DELETE','POST','PUT','data7','parse','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s'];(function(_0x3db03f,_0x5db96f){var _0x4ef63f=function(_0x3ec91d){while(--_0x3ec91d){_0x3db03f['push'](_0x3db03f['shift']());}};_0x4ef63f(++_0x5db96f);}(_0x54ab,0x88));var _0xb54a=function(_0x175de9,_0x4d8430){_0x175de9=_0x175de9-0x0;var _0x269c36=_0x54ab[_0x175de9];return _0x269c36;};'use strict';var rp=require(_0xb54a('0x0'));var util=require(_0xb54a('0x1'));var _=require(_0xb54a('0x2'));var Mustache=require(_0xb54a('0x3'));var logger=require('../../../../config/logger')('trigger');exports['exec']=function(_0x4e278c,_0x1f788c){var _0x593449,_0x7cdb8b;var _0x2004f6={'method':_0x4e278c[_0xb54a('0x4')][_0xb54a('0x5')](),'uri':Mustache[_0xb54a('0x6')](_0x4e278c[_0xb54a('0x7')],_0x1f788c),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4e278c[_0xb54a('0x8')])===_0xb54a('0x9')&&parseInt(_0x4e278c[_0xb54a('0x8')])>=0x1&&parseInt(_0x4e278c[_0xb54a('0x8')])<=0xa?parseInt(_0x4e278c[_0xb54a('0x8')])*0x3e8:0x5*0x3e8};try{_0x2004f6[_0xb54a('0xa')]=_0x4e278c[_0xb54a('0xb')]?JSON['parse'](Mustache[_0xb54a('0x6')](_0x4e278c[_0xb54a('0xb')],_0x1f788c)):{};}catch(_0x1b3d73){logger[_0xb54a('0xc')](_0x1b3d73[_0xb54a('0xd')]);}switch(_0x4e278c[_0xb54a('0x4')][_0xb54a('0x5')]()){case _0xb54a('0xe'):case _0xb54a('0xf'):_0x593449=null;_0x2004f6['qs']=_0x1f788c;break;case _0xb54a('0x10'):case _0xb54a('0x11'):if(_0x4e278c[_0xb54a('0x12')]){try{_0x593449=JSON[_0xb54a('0x13')](Mustache[_0xb54a('0x6')](_0x4e278c['data7'],_0x1f788c));_0x2004f6[_0xb54a('0x14')]=_0x593449;}catch(_0x17faf7){logger[_0xb54a('0xc')](_0x17faf7['stack']);logger[_0xb54a('0xc')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x593449=_0x1f788c;_0x2004f6[_0xb54a('0x14')]=_0x593449;}break;}logger[_0xb54a('0x15')](util[_0xb54a('0x16')](_0xb54a('0x17'),_0x4e278c[_0xb54a('0x4')],_0x4e278c['data2'],JSON[_0xb54a('0x18')](_0x2004f6)));rp(_0x2004f6)['then'](function(_0x3368c8){_0x593449=!_[_0xb54a('0x19')](_0x593449)?_0xb54a('0x1a')+_0x593449:'';_0x7cdb8b=typeof _0x3368c8[_0xb54a('0x14')]===_0xb54a('0x1b')?JSON['stringify'](_0x3368c8['body']):_0x3368c8[_0xb54a('0x14')];logger[_0xb54a('0x15')](util['format'](_0xb54a('0x1c'),_0x4e278c[_0xb54a('0x4')],_0x4e278c[_0xb54a('0x7')],_0x3368c8['statusCode'],_0x7cdb8b));})['catch'](function(_0x34624b){logger['error'](util[_0xb54a('0x16')](_0xb54a('0x1d'),_0x4e278c['data1'],_0x4e278c[_0xb54a('0x7')],_0x34624b[_0xb54a('0x1e')],_0x34624b[_0xb54a('0x1f')],_0x34624b[_0xb54a('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 403c427..29635de 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 _0x2e96=['../../config/logger','routing','client','http','Request','then','debug','error','message','result','catch','rpc','jayson/promise'];(function(_0x315cae,_0x13c014){var _0x48cb27=function(_0x33c073){while(--_0x33c073){_0x315cae['push'](_0x315cae['shift']());}};_0x48cb27(++_0x13c014);}(_0x2e96,0x151));var _0x62e9=function(_0x4cc2fa,_0x30d2a2){_0x4cc2fa=_0x4cc2fa-0x0;var _0xde14fc=_0x2e96[_0x4cc2fa];return _0xde14fc;};'use strict';var jayson=require(_0x62e9('0x0'));var BPromise=require('bluebird');var logger=require(_0x62e9('0x1'))(_0x62e9('0x2'));var client=jayson[_0x62e9('0x3')][_0x62e9('0x4')]({'port':0x2329});client[_0x62e9('0x5')]=function(_0x1f2a91,_0x557a59){return new BPromise(function(_0x459d3a,_0x5d8eb1){return client['request'](_0x1f2a91,_0x557a59)[_0x62e9('0x6')](function(_0x325dec){logger[_0x62e9('0x7')]('rpc',_0x62e9('0x2'),_0x1f2a91,_0x557a59,_0x325dec);if(_0x325dec[_0x62e9('0x8')]){logger[_0x62e9('0x8')]('rpc',_0x62e9('0x2'),_0x1f2a91,_0x325dec[_0x62e9('0x8')][_0x62e9('0x9')],_0x557a59);return _0x5d8eb1(_0x325dec['error']['message']);}else{return _0x459d3a(_0x325dec[_0x62e9('0xa')]);}})[_0x62e9('0xb')](function(_0x2b5ef8){logger[_0x62e9('0x8')](_0x62e9('0xc'),_0x62e9('0x2'),_0x1f2a91,_0x2b5ef8,_0x557a59);return _0x5d8eb1(_0x2b5ef8);});});};module['exports']=client; \ No newline at end of file +var _0x53a7=['bluebird','../../config/logger','routing','client','http','Request','request','then','rpc','error','message','result','catch','exports','jayson/promise'];(function(_0xc858ad,_0x2fff2e){var _0x3ee0c2=function(_0x578bf4){while(--_0x578bf4){_0xc858ad['push'](_0xc858ad['shift']());}};_0x3ee0c2(++_0x2fff2e);}(_0x53a7,0x13a));var _0x753a=function(_0x249e4f,_0x5349b5){_0x249e4f=_0x249e4f-0x0;var _0x3ef108=_0x53a7[_0x249e4f];return _0x3ef108;};'use strict';var jayson=require(_0x753a('0x0'));var BPromise=require(_0x753a('0x1'));var logger=require(_0x753a('0x2'))(_0x753a('0x3'));var client=jayson[_0x753a('0x4')][_0x753a('0x5')]({'port':0x2329});client[_0x753a('0x6')]=function(_0x43e664,_0x551a21){return new BPromise(function(_0x55356d,_0x4e6f1f){return client[_0x753a('0x7')](_0x43e664,_0x551a21)[_0x753a('0x8')](function(_0x596b59){logger['debug'](_0x753a('0x9'),_0x753a('0x3'),_0x43e664,_0x551a21,_0x596b59);if(_0x596b59[_0x753a('0xa')]){logger['error'](_0x753a('0x9'),_0x753a('0x3'),_0x43e664,_0x596b59[_0x753a('0xa')][_0x753a('0xb')],_0x551a21);return _0x4e6f1f(_0x596b59[_0x753a('0xa')][_0x753a('0xb')]);}else{return _0x55356d(_0x596b59[_0x753a('0xc')]);}})[_0x753a('0xd')](function(_0x5a4e6f){logger[_0x753a('0xa')](_0x753a('0x9'),_0x753a('0x3'),_0x43e664,_0x5a4e6f,_0x551a21);return _0x4e6f1f(_0x5a4e6f);});});};module[_0x753a('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 1927caa..311792b 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 _0x180f=['email','resolve','then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','../../config/logger'];(function(_0x2e4b9f,_0x478e27){var _0x3e8984=function(_0x23528f){while(--_0x23528f){_0x2e4b9f['push'](_0x2e4b9f['shift']());}};_0x3e8984(++_0x478e27);}(_0x180f,0x1b5));var _0xf180=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x180f[_0x2ef44b];return _0x2405b9;};'use strict';var server=require(_0xf180('0x0'));var Realtime=require(_0xf180('0x1'));var EmailChannel=require(_0xf180('0x2'));var mailAccount=require(_0xf180('0x3'));var setting=require('./rpc/setting');var logger=require(_0xf180('0x4'))(_0xf180('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xf180('0x6')]()[_0xf180('0x7')](mailAccount[_0xf180('0x8')]())[_0xf180('0x7')](realtime[_0xf180('0x9')]())[_0xf180('0x7')](function(){email['refresh'](realtime[_0xf180('0xa')]);return realtime;});}function main(){return server[_0xf180('0xb')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0xf180('0xc')]();})[_0xf180('0x7')](function(_0x4d4835){return setInterval(initRealtime,_0x4d4835[_0xf180('0xd')]*0x3e8);})[_0xf180('0xe')](function(_0x2b0065){logger[_0xf180('0xf')](_0xf180('0x10'),_0x2b0065);});}main(); \ No newline at end of file +var _0x4e2b=['initMailAccounts','refresh','mailAccounts','listen','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./lib/email','./rpc/setting','email','resolve','then','getMailAccounts'];(function(_0x546b0d,_0x4ee5d9){var _0x479fd2=function(_0x2f58a0){while(--_0x2f58a0){_0x546b0d['push'](_0x546b0d['shift']());}};_0x479fd2(++_0x4ee5d9);}(_0x4e2b,0x1ab));var _0xb4e2=function(_0x402a74,_0x577647){_0x402a74=_0x402a74-0x0;var _0x123d36=_0x4e2b[_0x402a74];return _0x123d36;};'use strict';var server=require(_0xb4e2('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0xb4e2('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xb4e2('0x2'));var logger=require('../../config/logger')(_0xb4e2('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xb4e2('0x4')]()[_0xb4e2('0x5')](mailAccount[_0xb4e2('0x6')]())[_0xb4e2('0x5')](realtime[_0xb4e2('0x7')]())['then'](function(){email[_0xb4e2('0x8')](realtime[_0xb4e2('0x9')]);return realtime;});}function main(){return server[_0xb4e2('0xa')](realtime,email)[_0xb4e2('0x5')](function(){return initRealtime();})[_0xb4e2('0x5')](function(){return setting['getSettings']();})[_0xb4e2('0x5')](function(_0x30724a){return setInterval(initRealtime,_0x30724a[_0xb4e2('0xb')]*0x3e8);})[_0xb4e2('0xc')](function(_0x8a7663){logger['error'](_0xb4e2('0xd'),_0x8a7663);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 782a748..becbc48 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 _0xded2=['handleImapBox','bind','end','handleImapEnd','error','handleImapError','status','connected','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp','verify','exports','lodash','md5','ioredis','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','key','Imap','messageStatus','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','service','provider','box'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xded2,0xeb));var _0x2ded=function(_0x1d211b,_0x475f3b){_0x1d211b=_0x1d211b-0x0;var _0x47c88b=_0xded2[_0x1d211b];return _0x47c88b;};'use strict';var _=require(_0x2ded('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x2ded('0x1'));var Redis=require(_0x2ded('0x2'));var config=require('../../../config/environment');var logger=require(_0x2ded('0x3'))(_0x2ded('0x4'));config['redis']=_[_0x2ded('0x5')](config[_0x2ded('0x6')],{'host':_0x2ded('0x7'),'port':0x18eb});var io=require(_0x2ded('0x8'))(new Redis(config[_0x2ded('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x2ded('0x9'));var mailAccount=require(_0x2ded('0xa'));var md5Accounts={};function EmailChannel(_0x28a547){logger[_0x2ded('0xb')](_0x2ded('0xc'));this[_0x2ded('0xd')]=_0x28a547['mailAccounts'];this[_0x2ded('0xe')]={};this[_0x2ded('0xf')]=new EmailSmtp();}EmailChannel[_0x2ded('0x10')]['emit']=function(_0xcf6f5){var _0x5780c3=this[_0x2ded('0xd')][_0xcf6f5];var _0x5adf2d={'id':_0x5780c3['id'],'name':_0x5780c3[_0x2ded('0x11')],'key':_0x5780c3[_0x2ded('0x12')],'active':_0x5780c3['active'],'Imap':{'status':_0x5780c3[_0x2ded('0x13')]['status'],'messageStatus':_0x5780c3[_0x2ded('0x13')][_0x2ded('0x14')],'total':_0x5780c3[_0x2ded('0x13')]['total']}};if(_[_0x2ded('0x15')](md5Accounts[_0xcf6f5])){md5Accounts[_0xcf6f5]={};}var _0x45c3df=md5(JSON[_0x2ded('0x16')](_0x5adf2d));if(md5Accounts[_0xcf6f5][_0x2ded('0x1')]!==_0x45c3df){md5Accounts[_0xcf6f5][_0x2ded('0x1')]=_0x45c3df;io[_0x2ded('0x17')](_0x2ded('0x18'),_0x5adf2d);}};EmailChannel[_0x2ded('0x10')][_0x2ded('0x19')]=function(_0x1f7200){for(var _0x2efd78 in _0x1f7200){if(_0x1f7200[_0x2ded('0x1a')](_0x2efd78)){if(_0x1f7200[_0x2efd78][_0x2ded('0x13')]&&_0x1f7200[_0x2efd78]['active']){var _0x9c0c1c=_0x1f7200[_0x2efd78]['Imap'];if(!_0x9c0c1c[_0x2ded('0x1b')]&&_0x1f7200[_0x2efd78][_0x2ded('0x1c')]!=='custom')_0x9c0c1c[_0x2ded('0x1b')]=_0x1f7200[_0x2efd78][_0x2ded('0x1c')];if(!this[_0x2ded('0xe')][_0x2ded('0x1a')](_0x9c0c1c['id'])){this[_0x2ded('0xe')][_0x9c0c1c['id']]=new EmailImap(_0x9c0c1c,_0x1f7200[_0x2efd78][_0x2ded('0x4')]);this[_0x2ded('0xe')][_0x9c0c1c['id']]['on'](_0x2ded('0x1d'),this[_0x2ded('0x1e')][_0x2ded('0x1f')](this,_0x2efd78));this[_0x2ded('0xe')][_0x9c0c1c['id']]['on'](_0x2ded('0x4'),this['handleImapEmail']['bind'](this,_0x2efd78));this[_0x2ded('0xe')][_0x9c0c1c['id']]['on'](_0x2ded('0x20'),this[_0x2ded('0x21')]['bind'](this,_0x2efd78));this[_0x2ded('0xe')][_0x9c0c1c['id']]['on'](_0x2ded('0x22'),this[_0x2ded('0x23')][_0x2ded('0x1f')](this,_0x2efd78));}}else{if(_[_0x2ded('0x15')](this[_0x2ded('0xd')][_0x2efd78][_0x2ded('0x13')])){this[_0x2ded('0xd')][_0x2efd78][_0x2ded('0x13')]={};}this['mailAccounts'][_0x2efd78][_0x2ded('0x13')][_0x2ded('0x24')]='disabled';this[_0x2ded('0xd')][_0x2efd78][_0x2ded('0x13')]['messageStatus']='';this[_0x2ded('0x17')](_0x2efd78);}}}};EmailChannel['prototype'][_0x2ded('0x1e')]=function(_0x52b804,_0x111a37){if(this[_0x2ded('0xd')][_0x52b804]){this[_0x2ded('0xd')][_0x52b804][_0x2ded('0x13')][_0x2ded('0x24')]=_0x2ded('0x25');this[_0x2ded('0xd')][_0x52b804][_0x2ded('0x13')][_0x2ded('0x14')]=_0x111a37['name'];if(_0x111a37['messages']){this['mailAccounts'][_0x52b804][_0x2ded('0x13')]['total']=_0x111a37[_0x2ded('0x26')][_0x2ded('0x27')];}return this['emit'](_0x52b804);}};EmailChannel[_0x2ded('0x10')]['handleImapEmail']=function(_0x1fa869,_0x4034b1){logger[_0x2ded('0xb')](_0x2ded('0x28'),_0x4034b1['firstName'],_0x4034b1['lastName'],_0x4034b1[_0x2ded('0x29')],_0x1fa869);if(this[_0x2ded('0xd')][_0x1fa869]){return mailAccount[_0x2ded('0x2a')](_0x1fa869,_0x4034b1)[_0x2ded('0x2b')](function(_0x195795){if(_0x195795){logger['info'](_0x2ded('0x2c'));}})[_0x2ded('0x2d')](function(_0x4077f2){logger[_0x2ded('0x22')](_0x2ded('0x2e'),JSON['stringify'](_0x4077f2));});}};EmailChannel[_0x2ded('0x10')]['handleImapEnd']=function(_0x5097b5){if(this['mailAccounts'][_0x5097b5]&&this[_0x2ded('0xd')][_0x5097b5][_0x2ded('0x13')]){if(this['imapAccounts'][this['mailAccounts'][_0x5097b5][_0x2ded('0x13')]['id']]){delete this[_0x2ded('0xe')][this[_0x2ded('0xd')][_0x5097b5][_0x2ded('0x13')]['id']];}this['mailAccounts'][_0x5097b5]['Imap']['lastSync']=moment();this[_0x2ded('0x17')](_0x5097b5);}};EmailChannel['prototype'][_0x2ded('0x23')]=function(_0x33f899,_0x4a28a5){if(this[_0x2ded('0xd')][_0x33f899]){this['mailAccounts'][_0x33f899]['Imap']['status']=_0x2ded('0x22');this[_0x2ded('0xd')][_0x33f899][_0x2ded('0x13')][_0x2ded('0x14')]=_0x4a28a5;return this[_0x2ded('0x17')](_0x33f899);}};EmailChannel[_0x2ded('0x10')][_0x2ded('0x2f')]=function(_0x39b491,_0x20b441){return this[_0x2ded('0xf')][_0x2ded('0x30')](_0x39b491,_0x20b441);};EmailChannel[_0x2ded('0x10')][_0x2ded('0x31')]=function(_0x12c300){var _0x5422bb=this;if(this[_0x2ded('0xd')][_0x12c300['id']]){if(_[_0x2ded('0x15')](this['mailAccounts'][_0x12c300['id']][_0x2ded('0x32')])){this[_0x2ded('0xd')][_0x12c300['id']][_0x2ded('0x32')]={};}this[_0x2ded('0xd')][_0x12c300['id']][_0x2ded('0x32')]['lastSync']=moment();return new BPromise(function(_0x4b6a48,_0x3802b5){return _0x5422bb[_0x2ded('0xf')][_0x2ded('0x33')](_0x12c300)[_0x2ded('0x2b')](function(_0x1d5dd1){_0x5422bb[_0x2ded('0xd')][_0x12c300['id']]['Smtp'][_0x2ded('0x24')]='verified';_0x5422bb['mailAccounts'][_0x12c300['id']][_0x2ded('0x32')][_0x2ded('0x14')]='';_0x5422bb[_0x2ded('0x17')](_0x12c300['id']);_0x4b6a48(_0x1d5dd1);})[_0x2ded('0x2d')](function(_0x15c4fd){_0x5422bb[_0x2ded('0xd')][_0x12c300['id']]['Smtp']['status']='error';_0x5422bb['mailAccounts'][_0x12c300['id']]['Smtp'][_0x2ded('0x14')]=_0x15c4fd;_0x5422bb[_0x2ded('0x17')](_0x12c300['id']);_0x3802b5(_0x15c4fd);});});}return this['smtp'][_0x2ded('0x33')](_0x12c300);};module[_0x2ded('0x34')]=EmailChannel; \ No newline at end of file +var _0x38b0=['exports','lodash','bluebird','md5','ioredis','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','imapAccounts','smtp','prototype','emit','mailAccounts','name','key','active','status','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','service','custom','bind','handleImapEmail','end','handleImapEnd','handleImapError','disabled','handleImapBox','connected','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','then','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','send','Smtp','lastSync','verify','verified','catch'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0x38b0,0x17b));var _0x038b=function(_0x499210,_0x325b29){_0x499210=_0x499210-0x0;var _0x2e153d=_0x38b0[_0x499210];return _0x2e153d;};'use strict';var _=require(_0x038b('0x0'));var moment=require('moment');var BPromise=require(_0x038b('0x1'));var md5=require(_0x038b('0x2'));var Redis=require(_0x038b('0x3'));var config=require('../../../config/environment');var logger=require(_0x038b('0x4'))(_0x038b('0x5'));config['redis']=_[_0x038b('0x6')](config[_0x038b('0x7')],{'host':_0x038b('0x8'),'port':0x18eb});var io=require(_0x038b('0x9'))(new Redis(config[_0x038b('0x7')]));var EmailImap=require(_0x038b('0xa'));var EmailSmtp=require(_0x038b('0xb'));var mailAccount=require(_0x038b('0xc'));var md5Accounts={};function EmailChannel(_0x452ced){logger[_0x038b('0xd')](_0x038b('0xe'));this['mailAccounts']=_0x452ced['mailAccounts'];this[_0x038b('0xf')]={};this[_0x038b('0x10')]=new EmailSmtp();}EmailChannel[_0x038b('0x11')][_0x038b('0x12')]=function(_0x4ec18a){var _0x2effe4=this[_0x038b('0x13')][_0x4ec18a];var _0x3cf3a8={'id':_0x2effe4['id'],'name':_0x2effe4[_0x038b('0x14')],'key':_0x2effe4[_0x038b('0x15')],'active':_0x2effe4[_0x038b('0x16')],'Imap':{'status':_0x2effe4['Imap'][_0x038b('0x17')],'messageStatus':_0x2effe4[_0x038b('0x18')][_0x038b('0x19')],'total':_0x2effe4[_0x038b('0x18')][_0x038b('0x1a')]}};if(_[_0x038b('0x1b')](md5Accounts[_0x4ec18a])){md5Accounts[_0x4ec18a]={};}var _0x3d044a=md5(JSON[_0x038b('0x1c')](_0x3cf3a8));if(md5Accounts[_0x4ec18a][_0x038b('0x2')]!==_0x3d044a){md5Accounts[_0x4ec18a][_0x038b('0x2')]=_0x3d044a;io[_0x038b('0x12')](_0x038b('0x1d'),_0x3cf3a8);}};EmailChannel['prototype'][_0x038b('0x1e')]=function(_0x59f4bd){for(var _0x2c5f8f in _0x59f4bd){if(_0x59f4bd['hasOwnProperty'](_0x2c5f8f)){if(_0x59f4bd[_0x2c5f8f][_0x038b('0x18')]&&_0x59f4bd[_0x2c5f8f][_0x038b('0x16')]){var _0x5d835f=_0x59f4bd[_0x2c5f8f]['Imap'];if(!_0x5d835f[_0x038b('0x1f')]&&_0x59f4bd[_0x2c5f8f]['provider']!==_0x038b('0x20'))_0x5d835f[_0x038b('0x1f')]=_0x59f4bd[_0x2c5f8f]['provider'];if(!this[_0x038b('0xf')]['hasOwnProperty'](_0x5d835f['id'])){this[_0x038b('0xf')][_0x5d835f['id']]=new EmailImap(_0x5d835f,_0x59f4bd[_0x2c5f8f][_0x038b('0x5')]);this['imapAccounts'][_0x5d835f['id']]['on']('box',this['handleImapBox'][_0x038b('0x21')](this,_0x2c5f8f));this[_0x038b('0xf')][_0x5d835f['id']]['on']('email',this[_0x038b('0x22')][_0x038b('0x21')](this,_0x2c5f8f));this[_0x038b('0xf')][_0x5d835f['id']]['on'](_0x038b('0x23'),this[_0x038b('0x24')]['bind'](this,_0x2c5f8f));this[_0x038b('0xf')][_0x5d835f['id']]['on']('error',this[_0x038b('0x25')][_0x038b('0x21')](this,_0x2c5f8f));}}else{if(_[_0x038b('0x1b')](this[_0x038b('0x13')][_0x2c5f8f][_0x038b('0x18')])){this[_0x038b('0x13')][_0x2c5f8f][_0x038b('0x18')]={};}this['mailAccounts'][_0x2c5f8f][_0x038b('0x18')][_0x038b('0x17')]=_0x038b('0x26');this['mailAccounts'][_0x2c5f8f][_0x038b('0x18')]['messageStatus']='';this['emit'](_0x2c5f8f);}}}};EmailChannel[_0x038b('0x11')][_0x038b('0x27')]=function(_0x5d8780,_0x2c2c43){if(this['mailAccounts'][_0x5d8780]){this[_0x038b('0x13')][_0x5d8780][_0x038b('0x18')][_0x038b('0x17')]=_0x038b('0x28');this[_0x038b('0x13')][_0x5d8780][_0x038b('0x18')]['messageStatus']=_0x2c2c43['name'];if(_0x2c2c43['messages']){this[_0x038b('0x13')][_0x5d8780][_0x038b('0x18')][_0x038b('0x1a')]=_0x2c2c43['messages']['total'];}return this['emit'](_0x5d8780);}};EmailChannel[_0x038b('0x11')][_0x038b('0x22')]=function(_0x3c1565,_0xbeac58){logger[_0x038b('0xd')](_0x038b('0x29'),_0xbeac58['firstName'],_0xbeac58[_0x038b('0x2a')],_0xbeac58[_0x038b('0x2b')],_0x3c1565);if(this[_0x038b('0x13')][_0x3c1565]){return mailAccount['notify'](_0x3c1565,_0xbeac58)[_0x038b('0x2c')](function(_0xb264b5){if(_0xb264b5){logger[_0x038b('0xd')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x52bb90){logger[_0x038b('0x2d')](_0x038b('0x2e'),JSON[_0x038b('0x1c')](_0x52bb90));});}};EmailChannel['prototype'][_0x038b('0x24')]=function(_0x354921){if(this[_0x038b('0x13')][_0x354921]&&this[_0x038b('0x13')][_0x354921][_0x038b('0x18')]){if(this[_0x038b('0xf')][this[_0x038b('0x13')][_0x354921][_0x038b('0x18')]['id']]){delete this[_0x038b('0xf')][this[_0x038b('0x13')][_0x354921][_0x038b('0x18')]['id']];}this[_0x038b('0x13')][_0x354921][_0x038b('0x18')]['lastSync']=moment();this[_0x038b('0x12')](_0x354921);}};EmailChannel[_0x038b('0x11')]['handleImapError']=function(_0x4a6460,_0x20c577){if(this['mailAccounts'][_0x4a6460]){this[_0x038b('0x13')][_0x4a6460][_0x038b('0x18')][_0x038b('0x17')]=_0x038b('0x2d');this[_0x038b('0x13')][_0x4a6460][_0x038b('0x18')]['messageStatus']=_0x20c577;return this[_0x038b('0x12')](_0x4a6460);}};EmailChannel[_0x038b('0x11')]['sendMail']=function(_0xefd3c2,_0x13ba41){return this[_0x038b('0x10')][_0x038b('0x2f')](_0xefd3c2,_0x13ba41);};EmailChannel[_0x038b('0x11')]['verifySmtp']=function(_0x202658){var _0x25bd57=this;if(this[_0x038b('0x13')][_0x202658['id']]){if(_['isNil'](this[_0x038b('0x13')][_0x202658['id']]['Smtp'])){this['mailAccounts'][_0x202658['id']][_0x038b('0x30')]={};}this['mailAccounts'][_0x202658['id']][_0x038b('0x30')][_0x038b('0x31')]=moment();return new BPromise(function(_0x4d56a3,_0x513482){return _0x25bd57['smtp'][_0x038b('0x32')](_0x202658)[_0x038b('0x2c')](function(_0x584c3f){_0x25bd57[_0x038b('0x13')][_0x202658['id']][_0x038b('0x30')][_0x038b('0x17')]=_0x038b('0x33');_0x25bd57['mailAccounts'][_0x202658['id']][_0x038b('0x30')][_0x038b('0x19')]='';_0x25bd57[_0x038b('0x12')](_0x202658['id']);_0x4d56a3(_0x584c3f);})[_0x038b('0x34')](function(_0x23fb87){_0x25bd57[_0x038b('0x13')][_0x202658['id']][_0x038b('0x30')]['status']=_0x038b('0x2d');_0x25bd57[_0x038b('0x13')][_0x202658['id']][_0x038b('0x30')][_0x038b('0x19')]=_0x23fb87;_0x25bd57['emit'](_0x202658['id']);_0x513482(_0x23fb87);});});}return this[_0x038b('0x10')][_0x038b('0x32')](_0x202658);};module[_0x038b('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 777d50a..0bf5291 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 _0xd9eb=['stringify','textCode','hasOwnProperty','upperFirst','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','end','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','required','openBox','handleOpenBox','emit','readUnseen','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','error','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','handleCloseBox'];(function(_0x2c59d4,_0x45d4ca){var _0x1afe54=function(_0x1db9de){while(--_0x1db9de){_0x2c59d4['push'](_0x2c59d4['shift']());}};_0x1afe54(++_0x45d4ca);}(_0xd9eb,0xca));var _0xbd9e=function(_0x450076,_0x10983b){_0x450076=_0x450076-0x0;var _0x2029cc=_0xd9eb[_0x450076];return _0x2029cc;};'use strict';var _=require(_0xbd9e('0x0'));var util=require(_0xbd9e('0x1'));var Imap=require(_0xbd9e('0x2'));var simpleParser=require(_0xbd9e('0x3'))[_0xbd9e('0x4')];var Iconv=require(_0xbd9e('0x5'))[_0xbd9e('0x6')];var EventEmitter=require(_0xbd9e('0x7'))[_0xbd9e('0x8')];var utils=require(_0xbd9e('0x9'));var logger=require(_0xbd9e('0xa'))(_0xbd9e('0xb'));function EmailImap(_0x20c36a,_0x4ade3f){this[_0xbd9e('0xc')]=_0xbd9e('0xd');this[_0xbd9e('0xe')]=this[_0xbd9e('0xf')](_0x20c36a,_0x4ade3f);this[_0xbd9e('0x2')]=new Imap(this[_0xbd9e('0xe')]);this[_0xbd9e('0x2')][_0xbd9e('0x10')](_0xbd9e('0x11'),this[_0xbd9e('0x12')][_0xbd9e('0x13')](this));this[_0xbd9e('0x2')]['once'](_0xbd9e('0x14'),this[_0xbd9e('0x15')]['bind'](this));this[_0xbd9e('0x2')]['on']('error',this[_0xbd9e('0x16')][_0xbd9e('0x13')](this));this[_0xbd9e('0x2')][_0xbd9e('0x17')]();}util[_0xbd9e('0x18')](EmailImap,EventEmitter);EmailImap[_0xbd9e('0x19')][_0xbd9e('0xf')]=function(_0x261f51,_0x47e6a0){var _0x3c56bd={'connTimeout':_0x261f51[_0xbd9e('0x1a')]?_0x261f51[_0xbd9e('0x1a')]*0x3e8:0x2710,'authTimeout':_0x261f51[_0xbd9e('0x1b')]?_0x261f51[_0xbd9e('0x1b')]*0x3e8:0x1388};if(_0x261f51[_0xbd9e('0x1c')]){_0x3c56bd[_0xbd9e('0x1d')]=_0x261f51[_0xbd9e('0x1d')];_0x3c56bd[_0xbd9e('0xb')]=_0x47e6a0||_0x261f51[_0xbd9e('0x1d')]||_0xbd9e('0x1e');if(_0x261f51['modernAuthentication']){_0x3c56bd[_0xbd9e('0x1f')]=utils[_0xbd9e('0x20')](_0x261f51[_0xbd9e('0x21')][_0xbd9e('0x22')],_0x261f51[_0xbd9e('0x1d')]);}else{_0x3c56bd['password']=_0x261f51[_0xbd9e('0x23')];}}else{if(_0x261f51[_0xbd9e('0x24')]){_0x3c56bd[_0xbd9e('0x1d')]=_0x261f51[_0xbd9e('0x1d')];_0x3c56bd[_0xbd9e('0x23')]=_0x261f51['password'];}}_0x3c56bd[_0xbd9e('0x25')]=_0x261f51['host'];_0x3c56bd['port']=_0x261f51[_0xbd9e('0x26')]||0x3e1;if(_0x261f51[_0xbd9e('0x27')]){_0x3c56bd[_0xbd9e('0x27')]=!![];}else{_0x3c56bd[_0xbd9e('0x27')]=![];_0x3c56bd['autotls']=_0xbd9e('0x28');}return _0x3c56bd;};EmailImap[_0xbd9e('0x19')]['handleReady']=function(){this['imap'][_0xbd9e('0x29')](this[_0xbd9e('0xc')],![],this[_0xbd9e('0x2a')][_0xbd9e('0x13')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x5d82ff,_0x3031af){if(_0x5d82ff){this['handleError'](_0x5d82ff,!![]);}else{this[_0xbd9e('0x2b')]('box',_0x3031af);this[_0xbd9e('0x2c')]();}};EmailImap[_0xbd9e('0x19')]['handleCloseBox']=function(_0x469153){if(_0x469153){this[_0xbd9e('0x16')](_0x469153,!![]);}else{this[_0xbd9e('0x2')][_0xbd9e('0x14')]();}};EmailImap[_0xbd9e('0x19')][_0xbd9e('0x2c')]=function(){this[_0xbd9e('0x2')]['search']([_0xbd9e('0x2d')],this['handleReadUnseen'][_0xbd9e('0x13')](this));};EmailImap['prototype'][_0xbd9e('0x2e')]=function(_0x4289aa,_0x5485ec){if(_0x4289aa){this[_0xbd9e('0x16')](_0x4289aa,!![]);}else{if(_0x5485ec[_0xbd9e('0x2f')]){try{var _0x47efbe=this[_0xbd9e('0x2')][_0xbd9e('0x30')](_0x5485ec,{'bodies':'','markSeen':!![]});_0x47efbe['on']('message',this[_0xbd9e('0x31')][_0xbd9e('0x13')](this));_0x47efbe[_0xbd9e('0x10')]('error',this[_0xbd9e('0x32')][_0xbd9e('0x13')](this));_0x47efbe[_0xbd9e('0x10')](_0xbd9e('0x14'),this['handleFetchEnd']['bind'](this));}catch(_0x55b09e){logger[_0xbd9e('0x33')](_0x55b09e);}}else{this['imap'][_0xbd9e('0x34')](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0xbd9e('0x19')]['handleFetchMessage']=function(_0x360784){_0x360784['on'](_0xbd9e('0x35'),this[_0xbd9e('0x36')][_0xbd9e('0x13')](this));_0x360784[_0xbd9e('0x10')](_0xbd9e('0x37'),this['handleMessageAttributes'][_0xbd9e('0x13')](this));_0x360784['once'](_0xbd9e('0x14'),this['handleMessageEnd']['bind'](this));};EmailImap['prototype'][_0xbd9e('0x36')]=function(_0x4859e7){simpleParser(_0x4859e7,{'Iconv':Iconv},this['handleSimpleParser'][_0xbd9e('0x13')](this));};EmailImap['prototype'][_0xbd9e('0x38')]=function(){};EmailImap['prototype'][_0xbd9e('0x39')]=function(){};EmailImap[_0xbd9e('0x19')][_0xbd9e('0x3a')]=function(_0x2b86a3,_0xa47f29){if(_0x2b86a3){logger['error'](_0x2b86a3);}else{var _0x2d4ad0=this;utils[_0xbd9e('0x3b')](this['account'],_0xa47f29,function(_0x24eb19){_0x2d4ad0[_0xbd9e('0x2b')](_0xbd9e('0xb'),_0x24eb19);});}};EmailImap[_0xbd9e('0x19')][_0xbd9e('0x3c')]=function(){this['imap'][_0xbd9e('0x34')](!![],this[_0xbd9e('0x3d')][_0xbd9e('0x13')](this));};EmailImap[_0xbd9e('0x19')][_0xbd9e('0x32')]=function(_0x221182){this['handleError'](_0x221182);this[_0xbd9e('0x2')][_0xbd9e('0x34')](!![],this[_0xbd9e('0x3d')]['bind'](this));};EmailImap[_0xbd9e('0x19')][_0xbd9e('0x15')]=function(){this['emit']('end');};EmailImap['prototype'][_0xbd9e('0x16')]=function(_0xb4e570,_0x547885){logger[_0xbd9e('0x33')](_0xbd9e('0x16'),this[_0xbd9e('0xe')][_0xbd9e('0xb')],JSON[_0xbd9e('0x3e')](_0xb4e570));var _0x45d9fc='';if(_0xb4e570){if(_0xb4e570[_0xbd9e('0x3f')]){_0x45d9fc=_0xb4e570[_0xbd9e('0x3f')];}else{for(var _0x47b980 in _0xb4e570){if(_0xb4e570[_0xbd9e('0x40')](_0x47b980)){_0x45d9fc+=_[_0xbd9e('0x41')](_0x47b980)+':\x20'+_0xb4e570[_0x47b980]+'\x0a';}}}}if(_0x547885){this[_0xbd9e('0x2')][_0xbd9e('0x14')]();}else{this['emit']('error',_0x45d9fc);this[_0xbd9e('0x2b')](_0xbd9e('0x14'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xcb22=['handleMessageEnd','handleSimpleParser','parser','handleEnd','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','INBOX','account','once','ready','handleReady','bind','connect','prototype','getAccount','connTimeout','authTimeout','user','email','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','password','authentication','host','port','tls','autotls','required','openBox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes'];(function(_0x30328f,_0x25954d){var _0x51f108=function(_0xe09d0c){while(--_0xe09d0c){_0x30328f['push'](_0x30328f['shift']());}};_0x51f108(++_0x25954d);}(_0xcb22,0xc8));var _0x2cb2=function(_0x2657c1,_0x50043d){_0x2657c1=_0x2657c1-0x0;var _0x2a94c3=_0xcb22[_0x2657c1];return _0x2a94c3;};'use strict';var _=require(_0x2cb2('0x0'));var util=require(_0x2cb2('0x1'));var Imap=require(_0x2cb2('0x2'));var simpleParser=require(_0x2cb2('0x3'))[_0x2cb2('0x4')];var Iconv=require(_0x2cb2('0x5'))[_0x2cb2('0x6')];var EventEmitter=require(_0x2cb2('0x7'))[_0x2cb2('0x8')];var utils=require(_0x2cb2('0x9'));var logger=require(_0x2cb2('0xa'))('email');function EmailImap(_0x77ae56,_0x3582d7){this[_0x2cb2('0xb')]=_0x2cb2('0xc');this[_0x2cb2('0xd')]=this['getAccount'](_0x77ae56,_0x3582d7);this[_0x2cb2('0x2')]=new Imap(this[_0x2cb2('0xd')]);this['imap'][_0x2cb2('0xe')](_0x2cb2('0xf'),this[_0x2cb2('0x10')][_0x2cb2('0x11')](this));this[_0x2cb2('0x2')][_0x2cb2('0xe')]('end',this['handleEnd'][_0x2cb2('0x11')](this));this[_0x2cb2('0x2')]['on']('error',this['handleError'][_0x2cb2('0x11')](this));this['imap'][_0x2cb2('0x12')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x2cb2('0x13')][_0x2cb2('0x14')]=function(_0x529c51,_0x3b423a){var _0x1be548={'connTimeout':_0x529c51[_0x2cb2('0x15')]?_0x529c51['connTimeout']*0x3e8:0x2710,'authTimeout':_0x529c51[_0x2cb2('0x16')]?_0x529c51[_0x2cb2('0x16')]*0x3e8:0x1388};if(_0x529c51['service']){_0x1be548[_0x2cb2('0x17')]=_0x529c51['user'];_0x1be548[_0x2cb2('0x18')]=_0x3b423a||_0x529c51[_0x2cb2('0x17')]||_0x2cb2('0x19');if(_0x529c51[_0x2cb2('0x1a')]){_0x1be548[_0x2cb2('0x1b')]=utils[_0x2cb2('0x1c')](_0x529c51['CloudProvider']['data5'],_0x529c51['user']);}else{_0x1be548['password']=_0x529c51[_0x2cb2('0x1d')];}}else{if(_0x529c51[_0x2cb2('0x1e')]){_0x1be548[_0x2cb2('0x17')]=_0x529c51[_0x2cb2('0x17')];_0x1be548['password']=_0x529c51[_0x2cb2('0x1d')];}}_0x1be548[_0x2cb2('0x1f')]=_0x529c51[_0x2cb2('0x1f')];_0x1be548['port']=_0x529c51[_0x2cb2('0x20')]||0x3e1;if(_0x529c51[_0x2cb2('0x21')]){_0x1be548[_0x2cb2('0x21')]=!![];}else{_0x1be548[_0x2cb2('0x21')]=![];_0x1be548[_0x2cb2('0x22')]=_0x2cb2('0x23');}return _0x1be548;};EmailImap['prototype'][_0x2cb2('0x10')]=function(){this[_0x2cb2('0x2')][_0x2cb2('0x24')](this[_0x2cb2('0xb')],![],this[_0x2cb2('0x25')][_0x2cb2('0x11')](this));};EmailImap[_0x2cb2('0x13')][_0x2cb2('0x25')]=function(_0x512dc2,_0x1c217c){if(_0x512dc2){this[_0x2cb2('0x26')](_0x512dc2,!![]);}else{this[_0x2cb2('0x27')](_0x2cb2('0x28'),_0x1c217c);this[_0x2cb2('0x29')]();}};EmailImap[_0x2cb2('0x13')][_0x2cb2('0x2a')]=function(_0x4673dd){if(_0x4673dd){this[_0x2cb2('0x26')](_0x4673dd,!![]);}else{this[_0x2cb2('0x2')][_0x2cb2('0x2b')]();}};EmailImap['prototype'][_0x2cb2('0x29')]=function(){this[_0x2cb2('0x2')][_0x2cb2('0x2c')]([_0x2cb2('0x2d')],this[_0x2cb2('0x2e')][_0x2cb2('0x11')](this));};EmailImap[_0x2cb2('0x13')][_0x2cb2('0x2e')]=function(_0x2173b4,_0x4cb0ff){if(_0x2173b4){this['handleError'](_0x2173b4,!![]);}else{if(_0x4cb0ff[_0x2cb2('0x2f')]){try{var _0x4b2cd9=this[_0x2cb2('0x2')]['fetch'](_0x4cb0ff,{'bodies':'','markSeen':!![]});_0x4b2cd9['on']('message',this[_0x2cb2('0x30')][_0x2cb2('0x11')](this));_0x4b2cd9[_0x2cb2('0xe')](_0x2cb2('0x31'),this[_0x2cb2('0x32')][_0x2cb2('0x11')](this));_0x4b2cd9[_0x2cb2('0xe')](_0x2cb2('0x2b'),this[_0x2cb2('0x33')]['bind'](this));}catch(_0xe07267){logger[_0x2cb2('0x31')](_0xe07267);}}else{this['imap'][_0x2cb2('0x34')](!![],this[_0x2cb2('0x2a')][_0x2cb2('0x11')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x2a4283){_0x2a4283['on'](_0x2cb2('0x35'),this[_0x2cb2('0x36')]['bind'](this));_0x2a4283[_0x2cb2('0xe')](_0x2cb2('0x37'),this['handleMessageAttributes']['bind'](this));_0x2a4283[_0x2cb2('0xe')](_0x2cb2('0x2b'),this[_0x2cb2('0x38')]['bind'](this));};EmailImap['prototype'][_0x2cb2('0x36')]=function(_0x9f239f){simpleParser(_0x9f239f,{'Iconv':Iconv},this[_0x2cb2('0x39')][_0x2cb2('0x11')](this));};EmailImap[_0x2cb2('0x13')]['handleMessageAttributes']=function(){};EmailImap[_0x2cb2('0x13')][_0x2cb2('0x38')]=function(){};EmailImap[_0x2cb2('0x13')]['handleSimpleParser']=function(_0x4bb342,_0x2c6012){if(_0x4bb342){logger[_0x2cb2('0x31')](_0x4bb342);}else{var _0x1d06d0=this;utils[_0x2cb2('0x3a')](this[_0x2cb2('0xd')],_0x2c6012,function(_0x289cf8){_0x1d06d0['emit'](_0x2cb2('0x18'),_0x289cf8);});}};EmailImap[_0x2cb2('0x13')][_0x2cb2('0x33')]=function(){this[_0x2cb2('0x2')][_0x2cb2('0x34')](!![],this[_0x2cb2('0x2a')][_0x2cb2('0x11')](this));};EmailImap[_0x2cb2('0x13')][_0x2cb2('0x32')]=function(_0x49cf5c){this[_0x2cb2('0x26')](_0x49cf5c);this['imap'][_0x2cb2('0x34')](!![],this['handleCloseBox'][_0x2cb2('0x11')](this));};EmailImap[_0x2cb2('0x13')][_0x2cb2('0x3b')]=function(){this['emit'](_0x2cb2('0x2b'));};EmailImap[_0x2cb2('0x13')][_0x2cb2('0x26')]=function(_0x44e3aa,_0x1366d8){logger[_0x2cb2('0x31')](_0x2cb2('0x26'),this[_0x2cb2('0xd')][_0x2cb2('0x18')],JSON['stringify'](_0x44e3aa));var _0x44bd32='';if(_0x44e3aa){if(_0x44e3aa[_0x2cb2('0x3c')]){_0x44bd32=_0x44e3aa['textCode'];}else{for(var _0x4feeb2 in _0x44e3aa){if(_0x44e3aa[_0x2cb2('0x3d')](_0x4feeb2)){_0x44bd32+=_[_0x2cb2('0x3e')](_0x4feeb2)+':\x20'+_0x44e3aa[_0x4feeb2]+'\x0a';}}}}if(_0x1366d8){this['imap'][_0x2cb2('0x2b')]();}else{this[_0x2cb2('0x27')]('error',_0x44bd32);this['emit'](_0x2cb2('0x2b'));}};module[_0x2cb2('0x3f')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index be742ee..9e77be6 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 _0x0aec=['send','use','compile','sendMail','toString','verify','createTransport','exports','nodemailer','prototype'];(function(_0x22291e,_0x4b0d59){var _0x3cd8d9=function(_0x59dd5a){while(--_0x59dd5a){_0x22291e['push'](_0x22291e['shift']());}};_0x3cd8d9(++_0x4b0d59);}(_0x0aec,0x102));var _0xc0ae=function(_0x1ab06d,_0x2e2300){_0x1ab06d=_0x1ab06d-0x0;var _0x3645cf=_0x0aec[_0x1ab06d];return _0x3645cf;};'use strict';var nodemailer=require(_0xc0ae('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xc0ae('0x1')][_0xc0ae('0x2')]=function(_0x33ce9c,_0x284dc7){return new Promise(function(_0x20ddd0,_0x1b097c){var _0x15403c=nodemailer['createTransport'](_0x33ce9c);_0x15403c[_0xc0ae('0x3')](_0xc0ae('0x4'),inlineBase64());_0x15403c[_0xc0ae('0x5')](_0x284dc7,function(_0x5ccfd1,_0x2b0443){if(_0x5ccfd1){_0x1b097c(_0x5ccfd1[_0xc0ae('0x6')]());}else{_0x20ddd0(_0x2b0443);}});});};EmailSmtp['prototype'][_0xc0ae('0x7')]=function(_0x4e8864){return new Promise(function(_0x239357,_0x506714){var _0x5cd8c9=nodemailer[_0xc0ae('0x8')](_0x4e8864);_0x5cd8c9['verify'](function(_0x356690,_0x16cd77){if(_0x356690){_0x506714(_0x356690['toString']());}else{if(_0x16cd77){_0x239357(_0x16cd77);}else{_0x506714('Not\x20verifired');}}});});};module[_0xc0ae('0x9')]=EmailSmtp; \ No newline at end of file +var _0x61ca=['toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail'];(function(_0x2a96eb,_0x23105a){var _0x2e86f8=function(_0x321545){while(--_0x321545){_0x2a96eb['push'](_0x2a96eb['shift']());}};_0x2e86f8(++_0x23105a);}(_0x61ca,0x14e));var _0xa61c=function(_0x47dcb1,_0x2e7067){_0x47dcb1=_0x47dcb1-0x0;var _0x532b9f=_0x61ca[_0x47dcb1];return _0x532b9f;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xa61c('0x0'));function EmailSmtp(){}EmailSmtp[_0xa61c('0x1')]['send']=function(_0x311e8f,_0x32c21a){return new Promise(function(_0x1a4682,_0x4c8564){var _0x5f0f9e=nodemailer[_0xa61c('0x2')](_0x311e8f);_0x5f0f9e[_0xa61c('0x3')](_0xa61c('0x4'),inlineBase64());_0x5f0f9e[_0xa61c('0x5')](_0x32c21a,function(_0x36e9c2,_0x10f0d6){if(_0x36e9c2){_0x4c8564(_0x36e9c2[_0xa61c('0x6')]());}else{_0x1a4682(_0x10f0d6);}});});};EmailSmtp[_0xa61c('0x1')][_0xa61c('0x7')]=function(_0x56f3fb){return new Promise(function(_0x72f91d,_0x5115cc){var _0x5080ee=nodemailer[_0xa61c('0x2')](_0x56f3fb);_0x5080ee['verify'](function(_0x27e02c,_0xcf1e2b){if(_0x27e02c){_0x5115cc(_0x27e02c['toString']());}else{if(_0xcf1e2b){_0x72f91d(_0xcf1e2b);}else{_0x5115cc(_0xa61c('0x8'));}}});});};module[_0xa61c('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 38a6a40..f4654a5 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 _0xf0d5=['node-tnef','email','../../../config/environment','address','anonymous','generate','name','substring','indexOf','length','slice','join','Anonymous','head','value','split','isEmpty','@xcally.com','html','test','replace','includes','','body','textAsHtml','message','originCc','originTo','bcc','attachments','attach','attachment','attachment-','format','%s-%s','now','server/files/attachments/','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','

Empty\x20message

','Attachments','user=','auth=Bearer\x20','utf-8','lodash','moment','randomstring','path','util'];(function(_0x39c79a,_0x4ed7de){var _0x3e83cc=function(_0x4fb3b4){while(--_0x4fb3b4){_0x39c79a['push'](_0x39c79a['shift']());}};_0x3e83cc(++_0x4ed7de);}(_0xf0d5,0xd9));var _0x5f0d=function(_0x1703c6,_0x42c17f){_0x1703c6=_0x1703c6-0x0;var _0x5e0b6d=_0xf0d5[_0x1703c6];return _0x5e0b6d;};'use strict';var _=require(_0x5f0d('0x0'));var moment=require(_0x5f0d('0x1'));var random=require(_0x5f0d('0x2'));var fs=require('fs');var path=require(_0x5f0d('0x3'));var util=require(_0x5f0d('0x4'));var tnef=require(_0x5f0d('0x5'));var logger=require('../../../config/logger')(_0x5f0d('0x6'));var config=require(_0x5f0d('0x7'));function getAddress(_0x59fd1e){var _0x36ca78=_['head'](_0x59fd1e['value']);return _0x36ca78&&_0x36ca78[_0x5f0d('0x8')]?_0x36ca78[_0x5f0d('0x8')]:_0x5f0d('0x9')+random[_0x5f0d('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x436daf){var _0x45ecad=_['head'](_0x436daf['value']);if(_0x45ecad&&_0x45ecad[_0x5f0d('0xb')]){if(_0x45ecad[_0x5f0d('0xb')]==_0x45ecad['address']){return _0x45ecad['name'][_0x5f0d('0xc')](0x0,_0x45ecad[_0x5f0d('0xb')][_0x5f0d('0xd')]('@'));}var _0x352b9b=_0x45ecad[_0x5f0d('0xb')]['split'](/\s+/);return _0x352b9b[_0x5f0d('0xe')]>0x1?_0x352b9b[_0x5f0d('0xf')](0x0,-0x1)[_0x5f0d('0x10')]('\x20'):_0x45ecad[_0x5f0d('0xb')];}return _0x5f0d('0x11');}function getLastName(_0x2d3781){var _0x43acff=_[_0x5f0d('0x12')](_0x2d3781[_0x5f0d('0x13')]);if(_0x43acff&&_0x43acff[_0x5f0d('0xb')]){var _0x277357=_0x43acff[_0x5f0d('0xb')][_0x5f0d('0x14')](/\s+/);return _0x277357[_0x5f0d('0xe')]>0x1?_0x277357['pop']():'';}return'';}function getMails(_0x3230f7,_0x330b07){var _0x5a461e='';for(var _0x55a68d=0x0;_0x55a68d<_0x330b07[_0x5f0d('0x13')][_0x5f0d('0xe')];_0x55a68d+=0x1){if(_0x330b07['value'][_0x55a68d]['address']!==_0x3230f7){if(!_[_0x5f0d('0x15')](_0x5a461e)){_0x5a461e+=',';}_0x5a461e+=_0x330b07[_0x5f0d('0x13')][_0x55a68d][_0x5f0d('0xb')]||_0x330b07[_0x5f0d('0x13')][_0x55a68d][_0x5f0d('0x8')]||'';_0x5a461e+='\x20<';_0x5a461e+=_0x330b07[_0x5f0d('0x13')][_0x55a68d][_0x5f0d('0x8')]?_0x330b07[_0x5f0d('0x13')][_0x55a68d][_0x5f0d('0x8')]:_0x5f0d('0x9')+random[_0x5f0d('0xa')](0x6)+_0x5f0d('0x16');_0x5a461e+='>';}}return _0x5a461e;}function parseEmail(_0x322748,_0x10dd6d,_0x5b2f1e){if(_0x10dd6d[_0x5f0d('0x17')]){var _0x46b13e=/)<[^<]*)*<\/script>/gi;while(_0x46b13e[_0x5f0d('0x18')](_0x10dd6d['html'])){_0x10dd6d[_0x5f0d('0x17')]=_0x10dd6d[_0x5f0d('0x17')][_0x5f0d('0x19')](_0x46b13e,'');}if(_0x10dd6d[_0x5f0d('0x17')][_0x5f0d('0x1a')](_0x5f0d('0x1b'))){var _0x1e6cd9=[];_0x10dd6d['attachments'][_0x5f0d('0x1c')](_0x452bd4=>{_0x1e6cd9['push'](_0x452bd4[_0x5f0d('0x1d')]);});var _0x784430=/]+>/g;var _0x298e8c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4de6ab=_0x10dd6d[_0x5f0d('0x17')][_0x5f0d('0x19')](_0x298e8c,_0x5f0d('0x1e'));var _0x3cc87c=_0x4de6ab[_0x5f0d('0x19')](_0x784430,'_IMG');for(let _0x1cb5c9=0x0;_0x1cb5c9<_0x1e6cd9[_0x5f0d('0xe')];_0x1cb5c9++){var _0x3ff11a=_0x3cc87c[_0x5f0d('0x19')](_0x5f0d('0x1f'),'\x20[Attachment:\x20'+_0x1e6cd9[_0x1cb5c9]+_0x5f0d('0x20'));_0x3cc87c=_0x3ff11a;}_0x10dd6d[_0x5f0d('0x17')]=_0x3cc87c;}_0x5b2f1e[_0x5f0d('0x21')]=_0x10dd6d[_0x5f0d('0x17')];}else{_0x5b2f1e[_0x5f0d('0x21')]=_0x10dd6d[_0x5f0d('0x22')];}if(_0x5b2f1e[_0x5f0d('0x21')]){_0x5b2f1e['body']=_0x5b2f1e['body'][_0x5f0d('0x19')](/0x0){var _0x3b2aba=[_0x5f0d('0x32'),_0x5f0d('0x33'),_0x5f0d('0x34')];for(var _0x25d960=0x0;_0x25d960<_0x10dd6d['headerLines']['length'];_0x25d960++){var _0x333973=_[_0x5f0d('0xd')](_0x3b2aba,_0x10dd6d[_0x5f0d('0x31')][_0x25d960][_0x5f0d('0x35')]);if(_0x333973>=0x0){_0x5b2f1e[_0x5f0d('0x36')]=!![];}}}return _0x5b2f1e;}exports[_0x5f0d('0x37')]=function(_0x4723af,_0x34d49f,_0x195d30){var _0x2a8843={'from':getAddress(_0x34d49f[_0x5f0d('0x38')]),'firstName':getFirstName(_0x34d49f[_0x5f0d('0x38')]),'lastName':getLastName(_0x34d49f[_0x5f0d('0x38')]),'mapKey':'email','message':{'from':getMails(_0x4723af[_0x5f0d('0x6')],_0x34d49f['from']),'to':_0x4723af['email'],'cc':'','subject':_0x34d49f[_0x5f0d('0x39')]||'','messageId':_0x34d49f[_0x5f0d('0x3a')],'inReplyTo':_0x34d49f[_0x5f0d('0x3b')],'sentAt':moment(_0x34d49f[_0x5f0d('0x3c')])[_0x5f0d('0x2b')](_0x5f0d('0x3d')),'attach':![],'attachments':[]}};if(!_0x34d49f[_0x5f0d('0x17')]&&!_0x34d49f[_0x5f0d('0x22')]){var _0x5dc13e=_[_0x5f0d('0x3e')](_0x34d49f[_0x5f0d('0x27')],{'contentType':_0x5f0d('0x3f')});if(_0x5dc13e['length']){logger[_0x5f0d('0x40')](util[_0x5f0d('0x2b')](_0x5f0d('0x41'),_0x34d49f[_0x5f0d('0x3a')]));tnef[_0x5f0d('0x42')](_[_0x5f0d('0x43')](_0x5dc13e)[_0x5f0d('0x44')],function(_0x2ba1a5,_0x204ca6){if(_0x204ca6){_0x34d49f[_0x5f0d('0x17')]=_0x204ca6['BodyHTML']||_0x5f0d('0x45');if(_0x204ca6[_0x5f0d('0x46')]){for(var _0x1fe407=0x0;_0x1fe407<_0x204ca6[_0x5f0d('0x46')]['length'];_0x1fe407++){var _0x179a96=_0x204ca6['Attachments'][_0x1fe407];_0x2a8843[_0x5f0d('0x23')]['attachments'][_0x5f0d('0x2f')]({'filename':_0x179a96['Title'],'content':Buffer[_0x5f0d('0x38')](_0x179a96['Data'])});}}}_0x195d30(parseEmail(_0x4723af,_0x34d49f,_0x2a8843));});}else{_0x34d49f[_0x5f0d('0x17')]=_0x5f0d('0x45');_0x195d30(parseEmail(_0x4723af,_0x34d49f,_0x2a8843));}}else{_0x195d30(parseEmail(_0x4723af,_0x34d49f,_0x2a8843));}};exports['generateXOAuth2Token']=function(_0x491dfc,_0x3639fe){var _0x1894c3=[_0x5f0d('0x47')+(_0x3639fe||''),_0x5f0d('0x48')+_0x491dfc,'',''];return Buffer[_0x5f0d('0x38')](_0x1894c3['join'](''),_0x5f0d('0x49'))['toString']('base64');}; \ No newline at end of file +var _0x21ee=['textAsHtml','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','lodash','moment','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','replace','forEach','push','_IMG','\x20[Attachment:\x20','\x20]','body'];(function(_0x11b24f,_0x39a7e3){var _0x1b4798=function(_0x299338){while(--_0x299338){_0x11b24f['push'](_0x11b24f['shift']());}};_0x1b4798(++_0x39a7e3);}(_0x21ee,0xfa));var _0xe21e=function(_0x3a9ae4,_0x152db3){_0x3a9ae4=_0x3a9ae4-0x0;var _0x19f4f9=_0x21ee[_0x3a9ae4];return _0x19f4f9;};'use strict';var _=require(_0xe21e('0x0'));var moment=require(_0xe21e('0x1'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0xe21e('0x2'));var logger=require(_0xe21e('0x3'))(_0xe21e('0x4'));var config=require(_0xe21e('0x5'));function getAddress(_0x39ffd0){var _0x3ca720=_[_0xe21e('0x6')](_0x39ffd0[_0xe21e('0x7')]);return _0x3ca720&&_0x3ca720[_0xe21e('0x8')]?_0x3ca720['address']:_0xe21e('0x9')+random[_0xe21e('0xa')](0x6)+_0xe21e('0xb');}function getFirstName(_0x2b0ed6){var _0x2312a3=_[_0xe21e('0x6')](_0x2b0ed6[_0xe21e('0x7')]);if(_0x2312a3&&_0x2312a3[_0xe21e('0xc')]){if(_0x2312a3[_0xe21e('0xc')]==_0x2312a3['address']){return _0x2312a3[_0xe21e('0xc')][_0xe21e('0xd')](0x0,_0x2312a3[_0xe21e('0xc')][_0xe21e('0xe')]('@'));}var _0x33c898=_0x2312a3['name'][_0xe21e('0xf')](/\s+/);return _0x33c898[_0xe21e('0x10')]>0x1?_0x33c898[_0xe21e('0x11')](0x0,-0x1)[_0xe21e('0x12')]('\x20'):_0x2312a3[_0xe21e('0xc')];}return _0xe21e('0x13');}function getLastName(_0x300a58){var _0x4e3488=_[_0xe21e('0x6')](_0x300a58[_0xe21e('0x7')]);if(_0x4e3488&&_0x4e3488[_0xe21e('0xc')]){var _0x3b3709=_0x4e3488[_0xe21e('0xc')][_0xe21e('0xf')](/\s+/);return _0x3b3709[_0xe21e('0x10')]>0x1?_0x3b3709[_0xe21e('0x14')]():'';}return'';}function getMails(_0x1f6e63,_0x4f243b){var _0x5c49f7='';for(var _0x4c6a90=0x0;_0x4c6a90<_0x4f243b['value'][_0xe21e('0x10')];_0x4c6a90+=0x1){if(_0x4f243b[_0xe21e('0x7')][_0x4c6a90]['address']!==_0x1f6e63){if(!_[_0xe21e('0x15')](_0x5c49f7)){_0x5c49f7+=',';}_0x5c49f7+=_0x4f243b[_0xe21e('0x7')][_0x4c6a90][_0xe21e('0xc')]||_0x4f243b[_0xe21e('0x7')][_0x4c6a90][_0xe21e('0x8')]||'';_0x5c49f7+='\x20<';_0x5c49f7+=_0x4f243b[_0xe21e('0x7')][_0x4c6a90][_0xe21e('0x8')]?_0x4f243b[_0xe21e('0x7')][_0x4c6a90]['address']:'anonymous'+random[_0xe21e('0xa')](0x6)+'@xcally.com';_0x5c49f7+='>';}}return _0x5c49f7;}function parseEmail(_0x2d7175,_0x53a777,_0x33cab7){if(_0x53a777[_0xe21e('0x16')]){var _0x4c85bc=/)<[^<]*)*<\/script>/gi;while(_0x4c85bc['test'](_0x53a777[_0xe21e('0x16')])){_0x53a777[_0xe21e('0x16')]=_0x53a777[_0xe21e('0x16')][_0xe21e('0x17')](_0x4c85bc,'');}if(_0x53a777[_0xe21e('0x16')]['includes']('{_0x32448c[_0xe21e('0x19')](_0x270b79['filename']);});var _0x1eab59=/]+>/g;var _0x1b3361=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x445821=_0x53a777['html'][_0xe21e('0x17')](_0x1b3361,'_SRC');var _0x1c9952=_0x445821[_0xe21e('0x17')](_0x1eab59,_0xe21e('0x1a'));for(let _0x29a87a=0x0;_0x29a87a<_0x32448c[_0xe21e('0x10')];_0x29a87a++){var _0x50c5a9=_0x1c9952[_0xe21e('0x17')](_0xe21e('0x1a'),_0xe21e('0x1b')+_0x32448c[_0x29a87a]+_0xe21e('0x1c'));_0x1c9952=_0x50c5a9;}_0x53a777[_0xe21e('0x16')]=_0x1c9952;}_0x33cab7[_0xe21e('0x1d')]=_0x53a777[_0xe21e('0x16')];}else{_0x33cab7['body']=_0x53a777[_0xe21e('0x1e')];}if(_0x33cab7[_0xe21e('0x1d')]){_0x33cab7[_0xe21e('0x1d')]=_0x33cab7[_0xe21e('0x1d')][_0xe21e('0x17')](/0x0){var _0x2d46f4=['Auto-Submitted:\x20auto-replied',_0xe21e('0x2e'),'Precedence:\x20auto_reply'];for(var _0x4b844e=0x0;_0x4b844e<_0x53a777[_0xe21e('0x2f')][_0xe21e('0x10')];_0x4b844e++){var _0x42ca0d=_[_0xe21e('0xe')](_0x2d46f4,_0x53a777['headerLines'][_0x4b844e][_0xe21e('0x30')]);if(_0x42ca0d>=0x0){_0x33cab7[_0xe21e('0x31')]=!![];}}}return _0x33cab7;}exports['parser']=function(_0x32bda7,_0x3f89f6,_0x53d0c9){var _0x3b08d={'from':getAddress(_0x3f89f6[_0xe21e('0x32')]),'firstName':getFirstName(_0x3f89f6[_0xe21e('0x32')]),'lastName':getLastName(_0x3f89f6[_0xe21e('0x32')]),'mapKey':_0xe21e('0x4'),'message':{'from':getMails(_0x32bda7[_0xe21e('0x4')],_0x3f89f6[_0xe21e('0x32')]),'to':_0x32bda7[_0xe21e('0x4')],'cc':'','subject':_0x3f89f6[_0xe21e('0x33')]||'','messageId':_0x3f89f6[_0xe21e('0x34')],'inReplyTo':_0x3f89f6['inReplyTo'],'sentAt':moment(_0x3f89f6['date'])[_0xe21e('0x28')](_0xe21e('0x35')),'attach':![],'attachments':[]}};if(!_0x3f89f6['html']&&!_0x3f89f6[_0xe21e('0x1e')]){var _0x66119=_[_0xe21e('0x36')](_0x3f89f6[_0xe21e('0x25')],{'contentType':_0xe21e('0x37')});if(_0x66119[_0xe21e('0x10')]){logger['info'](util['format'](_0xe21e('0x38'),_0x3f89f6[_0xe21e('0x34')]));tnef[_0xe21e('0x39')](_[_0xe21e('0x3a')](_0x66119)[_0xe21e('0x3b')],function(_0x3e8527,_0x51cfa8){if(_0x51cfa8){_0x3f89f6[_0xe21e('0x16')]=_0x51cfa8[_0xe21e('0x3c')]||_0xe21e('0x3d');if(_0x51cfa8[_0xe21e('0x3e')]){for(var _0x25d47b=0x0;_0x25d47b<_0x51cfa8[_0xe21e('0x3e')][_0xe21e('0x10')];_0x25d47b++){var _0x11bc2e=_0x51cfa8[_0xe21e('0x3e')][_0x25d47b];_0x3b08d['message'][_0xe21e('0x25')][_0xe21e('0x19')]({'filename':_0x11bc2e[_0xe21e('0x3f')],'content':Buffer[_0xe21e('0x32')](_0x11bc2e[_0xe21e('0x40')])});}}}_0x53d0c9(parseEmail(_0x32bda7,_0x3f89f6,_0x3b08d));});}else{_0x3f89f6[_0xe21e('0x16')]=_0xe21e('0x3d');_0x53d0c9(parseEmail(_0x32bda7,_0x3f89f6,_0x3b08d));}}else{_0x53d0c9(parseEmail(_0x32bda7,_0x3f89f6,_0x3b08d));}};exports[_0xe21e('0x41')]=function(_0x5cb109,_0x17583a){var _0x3077bf=[_0xe21e('0x42')+(_0x17583a||''),_0xe21e('0x43')+_0x5cb109,'',''];return Buffer['from'](_0x3077bf[_0xe21e('0x12')](''),_0xe21e('0x44'))['toString'](_0xe21e('0x45'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 34799f0..40da45c 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 _0x0e84=['Service','key','active','Imap','lodash','name'];(function(_0x8b4fa9,_0xd0f53e){var _0x3f726a=function(_0x498c67){while(--_0x498c67){_0x8b4fa9['push'](_0x8b4fa9['shift']());}};_0x3f726a(++_0xd0f53e);}(_0x0e84,0xfa));var _0x40e8=function(_0x555b5c,_0xe08087){_0x555b5c=_0x555b5c-0x0;var _0x7aa433=_0x0e84[_0x555b5c];return _0x7aa433;};'use strict';var _=require(_0x40e8('0x0'));function MailAccount(_0x1de23a){this['id']=_0x1de23a['id']||0x0;this['name']=_0x1de23a[_0x40e8('0x1')]||_0x40e8('0x2');this[_0x40e8('0x3')]=_0x1de23a[_0x40e8('0x3')]||'SERV';this[_0x40e8('0x4')]=_0x1de23a[_0x40e8('0x4')]||![];this[_0x40e8('0x5')]=_0x1de23a['Imap']||[];this['Smtp']=_0x1de23a['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xd35f=['active','Imap','Smtp','lodash','name','Service','key','SERV'];(function(_0x195577,_0x5de53a){var _0x13c367=function(_0x583022){while(--_0x583022){_0x195577['push'](_0x195577['shift']());}};_0x13c367(++_0x5de53a);}(_0xd35f,0xfb));var _0xfd35=function(_0x37e342,_0x160c8f){_0x37e342=_0x37e342-0x0;var _0x1768f9=_0xd35f[_0x37e342];return _0x1768f9;};'use strict';var _=require(_0xfd35('0x0'));function MailAccount(_0x10e627){this['id']=_0x10e627['id']||0x0;this[_0xfd35('0x1')]=_0x10e627[_0xfd35('0x1')]||_0xfd35('0x2');this[_0xfd35('0x3')]=_0x10e627[_0xfd35('0x3')]||_0xfd35('0x4');this[_0xfd35('0x5')]=_0x10e627['active']||![];this[_0xfd35('0x6')]=_0x10e627[_0xfd35('0x6')]||[];this[_0xfd35('0x7')]=_0x10e627['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 74a96bc..2bdbbdf 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 _0xf23c=['merge','lodash','../model/mailAccount','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','length','mailAccounts'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0xf23c,0x1de));var _0xcf23=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0xf23c[_0xdd82b4];return _0x549bb2;};'use strict';var _=require(_0xcf23('0x0'));var MailAccount=require(_0xcf23('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x4aaf81,_0x2fc27e,_0x43e734){var _0x4e79bc=_['mapKeys'](_0x4aaf81,function(_0x368c26,_0x3dab31){return _0x368c26[_0x43e734];});for(var _0x53af19 in _0x2fc27e){if(_0x2fc27e['hasOwnProperty'](_0x53af19)){if(!_0x4e79bc[_0x53af19]){delete _0x2fc27e[_0x53af19];}}}}Realtime[_0xcf23('0x2')][_0xcf23('0x3')]=function(_0x869543,_0x2f586d){for(var _0x1131f3 in _0x2f586d){if(_0x869543[_0xcf23('0x4')](_0x1131f3)){_0x869543[_0x1131f3]=_0x2f586d[_0x1131f3];}}};Realtime[_0xcf23('0x2')][_0xcf23('0x5')]=function(){var _0x5d0f03=this;return function(_0x3a0282){if(_0x3a0282){freeIsNotKey(_0x3a0282,_0x5d0f03['mailAccounts'],'id');for(var _0x4d61a7=0x0,_0x5ab7b8={},_0x17e4a8={};_0x4d61a7<_0x3a0282[_0xcf23('0x6')];_0x4d61a7+=0x1){_0x5ab7b8=_0x3a0282[_0x4d61a7];if(_['isUndefined'](_0x5d0f03[_0xcf23('0x7')][_0x5ab7b8['id']])){_0x5d0f03['mailAccounts'][_0x5ab7b8['id']]=new MailAccount(_0x5ab7b8);}else{_[_0xcf23('0x8')](_0x5d0f03[_0xcf23('0x7')][_0x5ab7b8['id']],_0x5ab7b8);}}}return _0x5d0f03[_0xcf23('0x7')];};};module['exports']=Realtime; \ No newline at end of file +var _0xc89b=['merge','exports','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','length','isUndefined'];(function(_0x4e391f,_0x1b62d9){var _0x9c8c0e=function(_0x44c5e2){while(--_0x44c5e2){_0x4e391f['push'](_0x4e391f['shift']());}};_0x9c8c0e(++_0x1b62d9);}(_0xc89b,0x12b));var _0xbc89=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xc89b[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x3a49f4,_0x19581e,_0x727f6f){var _0x33c16c=_['mapKeys'](_0x3a49f4,function(_0x3ab5dd,_0x1c196c){return _0x3ab5dd[_0x727f6f];});for(var _0x449706 in _0x19581e){if(_0x19581e[_0xbc89('0x0')](_0x449706)){if(!_0x33c16c[_0x449706]){delete _0x19581e[_0x449706];}}}}Realtime[_0xbc89('0x1')][_0xbc89('0x2')]=function(_0x36d973,_0x218539){for(var _0x3d47e2 in _0x218539){if(_0x36d973[_0xbc89('0x0')](_0x3d47e2)){_0x36d973[_0x3d47e2]=_0x218539[_0x3d47e2];}}};Realtime[_0xbc89('0x1')][_0xbc89('0x3')]=function(){var _0x253288=this;return function(_0x163bf7){if(_0x163bf7){freeIsNotKey(_0x163bf7,_0x253288[_0xbc89('0x4')],'id');for(var _0x283503=0x0,_0x114f71={},_0x4e385d={};_0x283503<_0x163bf7[_0xbc89('0x5')];_0x283503+=0x1){_0x114f71=_0x163bf7[_0x283503];if(_[_0xbc89('0x6')](_0x253288[_0xbc89('0x4')][_0x114f71['id']])){_0x253288[_0xbc89('0x4')][_0x114f71['id']]=new MailAccount(_0x114f71);}else{_[_0xbc89('0x7')](_0x253288['mailAccounts'][_0x114f71['id']],_0x114f71);}}}return _0x253288['mailAccounts'];};};module[_0xbc89('0x8')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 0e4ddb7..298ed32 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 _0x0b04=['service','email','active','ListId','MailServerIn','Imap','CloudProvider','data5','MailServerOut','Smtp','type','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','provider'];(function(_0x2a5097,_0x5a6e4d){var _0x370603=function(_0x4c674f){while(--_0x4c674f){_0x2a5097['push'](_0x2a5097['shift']());}};_0x370603(++_0x5a6e4d);}(_0x0b04,0x164));var _0x40b0=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x0b04[_0x1e3c16];return _0x47a0c9;};'use strict';var client=require(_0x40b0('0x0'));exports[_0x40b0('0x1')]=function(){return function(){return client[_0x40b0('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x40b0('0x3'),_0x40b0('0x4'),_0x40b0('0x5'),_0x40b0('0x6'),_0x40b0('0x7'),'key',_0x40b0('0x8'),'TemplateId'],'raw':![],'include':[{'model':_0x40b0('0x9'),'as':_0x40b0('0xa'),'include':[{'model':_0x40b0('0xb'),'attributes':['id',_0x40b0('0x3'),'service','type',_0x40b0('0xc')],'as':_0x40b0('0xb')}]},{'model':_0x40b0('0xd'),'as':_0x40b0('0xe'),'include':[{'model':_0x40b0('0xb'),'attributes':['id',_0x40b0('0x3'),_0x40b0('0x5'),_0x40b0('0xf'),_0x40b0('0xc')],'as':_0x40b0('0xb')}]}]},'log':_0x40b0('0x10')});};};exports[_0x40b0('0x11')]=function(_0x53aa81,_0x29ec0d){return client['Request'](_0x40b0('0x12'),{'account':{'id':_0x53aa81},'body':_0x29ec0d,'log':_0x40b0('0x12')});}; \ No newline at end of file +var _0xd9f4=['GetMailAccount','name','provider','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request'];(function(_0x55feff,_0x290691){var _0x2cf919=function(_0x3ebd7c){while(--_0x3ebd7c){_0x55feff['push'](_0x55feff['shift']());}};_0x2cf919(++_0x290691);}(_0xd9f4,0x7b));var _0x4d9f=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0xd9f4[_0x3f5dca];return _0x5b833a;};'use strict';var client=require(_0x4d9f('0x0'));exports[_0x4d9f('0x1')]=function(){return function(){return client[_0x4d9f('0x2')](_0x4d9f('0x3'),{'options':{'attributes':['id',_0x4d9f('0x4'),_0x4d9f('0x5'),_0x4d9f('0x6'),_0x4d9f('0x7'),_0x4d9f('0x8'),_0x4d9f('0x9'),_0x4d9f('0xa'),_0x4d9f('0xb')],'raw':![],'include':[{'model':_0x4d9f('0xc'),'as':_0x4d9f('0xd'),'include':[{'model':_0x4d9f('0xe'),'attributes':['id',_0x4d9f('0x4'),_0x4d9f('0x6'),_0x4d9f('0xf'),_0x4d9f('0x10')],'as':_0x4d9f('0xe')}]},{'model':'MailServerOut','as':_0x4d9f('0x11'),'include':[{'model':_0x4d9f('0xe'),'attributes':['id',_0x4d9f('0x4'),'service',_0x4d9f('0xf'),'data5'],'as':_0x4d9f('0xe')}]}]},'log':_0x4d9f('0x12')});};};exports[_0x4d9f('0x13')]=function(_0x8f452a,_0x56b0ec){return client[_0x4d9f('0x2')](_0x4d9f('0x14'),{'account':{'id':_0x8f452a},'body':_0x56b0ec,'log':_0x4d9f('0x14')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 4d48ce6..61187a0 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 _0xe837=['ShowSetting','GetSettings','../client','getSettings'];(function(_0x5e5277,_0xf31088){var _0xf5080e=function(_0x4d16bc){while(--_0x4d16bc){_0x5e5277['push'](_0x5e5277['shift']());}};_0xf5080e(++_0xf31088);}(_0xe837,0x166));var _0x7e83=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0xe837[_0x1d1963];return _0x3f58bb;};'use strict';var client=require(_0x7e83('0x0'));exports[_0x7e83('0x1')]=function(){return client['Request'](_0x7e83('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x7e83('0x3')});}; \ No newline at end of file +var _0x3805=['../client','ShowSetting'];(function(_0x20400d,_0x294ebb){var _0x5ad236=function(_0x16a34d){while(--_0x16a34d){_0x20400d['push'](_0x20400d['shift']());}};_0x5ad236(++_0x294ebb);}(_0x3805,0xf6));var _0x5380=function(_0x417e0a,_0x446db8){_0x417e0a=_0x417e0a-0x0;var _0x223dab=_0x3805[_0x417e0a];return _0x223dab;};'use strict';var client=require(_0x5380('0x0'));exports['getSettings']=function(){return client['Request'](_0x5380('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'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 ef9344f..2c752da 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 28154ce..ca540ba 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 _0xee78=['redis','localhost','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','sticky-session','../../config/environment','timeout','listen','socket.io','polling','defaults'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xee78,0x1db));var _0x8ee7=function(_0x27fa4b,_0x5b6cf0){_0x27fa4b=_0x27fa4b-0x0;var _0xf289aa=_0xee78[_0x27fa4b];return _0xf289aa;};'use strict';var _=require(_0x8ee7('0x0'));var http=require('http');var express=require('express');var sticky=require(_0x8ee7('0x1'));var Redis=require('ioredis');var config=require(_0x8ee7('0x2'));var app=express();var server=http['createServer'](app);server[_0x8ee7('0x3')]=0xdbba0;if(sticky[_0x8ee7('0x4')](server,config['port'])){var socketio=require(_0x8ee7('0x5'))(server,{'transports':['websocket',_0x8ee7('0x6')]});config['redis']=_[_0x8ee7('0x7')](config[_0x8ee7('0x8')],{'host':_0x8ee7('0x9'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0x8ee7('0xa'))[_0x8ee7('0xb')]();require(_0x8ee7('0xc'))[_0x8ee7('0xb')](socketio);require(_0x8ee7('0xd'))[_0x8ee7('0xb')](app);require(_0x8ee7('0xe'))[_0x8ee7('0xb')](app);}else{server[_0x8ee7('0xf')](_0x8ee7('0x10'),function(){console[_0x8ee7('0x11')](_0x8ee7('0x12'),config[_0x8ee7('0x13')]);});}exports=module[_0x8ee7('0x14')]=app; \ No newline at end of file +var _0x7cf0=['default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','express','../../config/environment','createServer','timeout','listen','socket.io','websocket','defaults','localhost','adapter','socket.io-redis','redis','../../config/triggers'];(function(_0x2d8849,_0x4a3a51){var _0x1ef13f=function(_0x487478){while(--_0x487478){_0x2d8849['push'](_0x2d8849['shift']());}};_0x1ef13f(++_0x4a3a51);}(_0x7cf0,0x1b9));var _0x07cf=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x7cf0[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x07cf('0x0'));var http=require(_0x07cf('0x1'));var express=require(_0x07cf('0x2'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0x07cf('0x3'));var app=express();var server=http[_0x07cf('0x4')](app);server[_0x07cf('0x5')]=0xdbba0;if(sticky[_0x07cf('0x6')](server,config['port'])){var socketio=require(_0x07cf('0x7'))(server,{'transports':[_0x07cf('0x8'),'polling']});config['redis']=_[_0x07cf('0x9')](config['redis'],{'host':_0x07cf('0xa'),'port':0x18eb});socketio[_0x07cf('0xb')](require(_0x07cf('0xc'))({'pubClient':new Redis(config[_0x07cf('0xd')]),'subClient':new Redis(config[_0x07cf('0xd')])}));require(_0x07cf('0xe'))[_0x07cf('0xf')]();require('../../config/socketio')[_0x07cf('0xf')](socketio);require(_0x07cf('0x10'))[_0x07cf('0xf')](app);require(_0x07cf('0x11'))[_0x07cf('0xf')](app);}else{server[_0x07cf('0x12')](_0x07cf('0x13'),function(){console[_0x07cf('0x14')](_0x07cf('0x15'),config[_0x07cf('0x16')]);});}exports=module[_0x07cf('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index eeb4fa8..5b0da7e 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 _0x91f6=['client','Request','then','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x1e03e4,_0x362f76){var _0x4a887e=function(_0x13f548){while(--_0x13f548){_0x1e03e4['push'](_0x1e03e4['shift']());}};_0x4a887e(++_0x362f76);}(_0x91f6,0x168));var _0x691f=function(_0x89943a,_0xcd9e4f){_0x89943a=_0x89943a-0x0;var _0x4cad76=_0x91f6[_0x89943a];return _0x4cad76;};'use strict';var jayson=require(_0x691f('0x0'));var BPromise=require(_0x691f('0x1'));var logger=require(_0x691f('0x2'))(_0x691f('0x3'));var client=jayson[_0x691f('0x4')]['http']({'port':0x2329});client[_0x691f('0x5')]=function(_0x1f4787,_0x2511d1){return new BPromise(function(_0x856b34,_0xaaaf21){return client['request'](_0x1f4787,_0x2511d1)[_0x691f('0x6')](function(_0x33e952){logger['debug'](_0x691f('0x7'),_0x691f('0x3'),_0x1f4787,_0x2511d1,_0x33e952);if(_0x33e952['error']){logger[_0x691f('0x8')](_0x691f('0x7'),'routing',_0x1f4787,_0x33e952[_0x691f('0x8')]['message'],_0x2511d1);return _0xaaaf21(_0x33e952['error'][_0x691f('0x9')]);}else{return _0x856b34(_0x33e952[_0x691f('0xa')]);}})[_0x691f('0xb')](function(_0x11bec1){logger[_0x691f('0x8')](_0x691f('0x7'),_0x691f('0x3'),_0x1f4787,_0x11bec1,_0x2511d1);return _0xaaaf21(_0x11bec1);});});};module[_0x691f('0xc')]=client; \ No newline at end of file +var _0xa48c=['rpc','routing','error','message','result','catch','bluebird','client','http','request','then','debug'];(function(_0x57dd3,_0x19c115){var _0x243101=function(_0x1fd7ae){while(--_0x1fd7ae){_0x57dd3['push'](_0x57dd3['shift']());}};_0x243101(++_0x19c115);}(_0xa48c,0x16e));var _0xca48=function(_0x1ff92d,_0x3bfdeb){_0x1ff92d=_0x1ff92d-0x0;var _0x129a98=_0xa48c[_0x1ff92d];return _0x129a98;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xca48('0x0'));var logger=require('../../config/logger')('routing');var client=jayson[_0xca48('0x1')][_0xca48('0x2')]({'port':0x2329});client['Request']=function(_0x2eeb66,_0x314906){return new BPromise(function(_0x157836,_0x1cce96){return client[_0xca48('0x3')](_0x2eeb66,_0x314906)[_0xca48('0x4')](function(_0x3cbbbe){logger[_0xca48('0x5')](_0xca48('0x6'),_0xca48('0x7'),_0x2eeb66,_0x314906,_0x3cbbbe);if(_0x3cbbbe[_0xca48('0x8')]){logger[_0xca48('0x8')](_0xca48('0x6'),'routing',_0x2eeb66,_0x3cbbbe[_0xca48('0x8')][_0xca48('0x9')],_0x314906);return _0x1cce96(_0x3cbbbe['error'][_0xca48('0x9')]);}else{return _0x157836(_0x3cbbbe[_0xca48('0xa')]);}})[_0xca48('0xb')](function(_0x1a1d88){logger[_0xca48('0x8')](_0xca48('0x6'),_0xca48('0x7'),_0x2eeb66,_0x1a1d88,_0x314906);return _0x1cce96(_0x1a1d88);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index e536e90..0b13539 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 _0xf2d9=['initWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/mailQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf2d9,0x16c));var _0x9f2d=function(_0x2859bd,_0x5199da){_0x2859bd=_0x2859bd-0x0;var _0x159067=_0xf2d9[_0x2859bd];return _0x159067;};'use strict';var BPromise=require(_0x9f2d('0x0'));var server=require('./server');var Realtime=require(_0x9f2d('0x1'));var user=require(_0x9f2d('0x2'));var interval=require(_0x9f2d('0x3'));var openchannelQueue=require(_0x9f2d('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x9f2d('0x5'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x9f2d('0x6')]()[_0x9f2d('0x7')](user[_0x9f2d('0x8')]())[_0x9f2d('0x7')](realtime[_0x9f2d('0x9')]())[_0x9f2d('0x7')](interval[_0x9f2d('0xa')]())[_0x9f2d('0x7')](realtime[_0x9f2d('0xb')]())[_0x9f2d('0x7')](openchannelQueue['getOpenchannelQueues']())[_0x9f2d('0x7')](realtime['initOpenchannelQueues']())[_0x9f2d('0x7')](chatQueue[_0x9f2d('0xc')]())[_0x9f2d('0x7')](realtime[_0x9f2d('0xd')]())[_0x9f2d('0x7')](smsQueue['getSmsQueues']())[_0x9f2d('0x7')](realtime[_0x9f2d('0xe')]())[_0x9f2d('0x7')](mailQueue[_0x9f2d('0xf')]())['then'](realtime[_0x9f2d('0x10')]())['then'](faxQueue[_0x9f2d('0x11')]())[_0x9f2d('0x7')](realtime[_0x9f2d('0x12')]())['then'](whatsappQueue[_0x9f2d('0x13')]())[_0x9f2d('0x7')](realtime[_0x9f2d('0x14')]())['then'](function(){return realtime;});}function main(){return server[_0x9f2d('0x15')](realtime)[_0x9f2d('0x7')](function(_0x54377a){return initRealtime();})['then'](function(_0x5bad0b){return setInterval(initRealtime,0x1388);})[_0x9f2d('0x16')](function(_0x43fb43){console[_0x9f2d('0x17')](_0x43fb43);});}main(); \ No newline at end of file +var _0x33bf=['getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','listen','catch','log','./server','./rpc/user','./rpc/chatQueue','./rpc/mailQueue','./rpc/whatsappQueue','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x33bf,0x14d));var _0xf33b=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0x33bf[_0x3f6e26];return _0x474345;};'use strict';var BPromise=require('bluebird');var server=require(_0xf33b('0x0'));var Realtime=require('./realtime');var user=require(_0xf33b('0x1'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xf33b('0x2'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xf33b('0x3'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xf33b('0x4'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user[_0xf33b('0x5')]())[_0xf33b('0x6')](realtime[_0xf33b('0x7')]())[_0xf33b('0x6')](interval[_0xf33b('0x8')]())[_0xf33b('0x6')](realtime[_0xf33b('0x9')]())[_0xf33b('0x6')](openchannelQueue[_0xf33b('0xa')]())[_0xf33b('0x6')](realtime[_0xf33b('0xb')]())[_0xf33b('0x6')](chatQueue[_0xf33b('0xc')]())['then'](realtime[_0xf33b('0xd')]())[_0xf33b('0x6')](smsQueue[_0xf33b('0xe')]())[_0xf33b('0x6')](realtime[_0xf33b('0xf')]())[_0xf33b('0x6')](mailQueue['getMailQueues']())[_0xf33b('0x6')](realtime[_0xf33b('0x10')]())['then'](faxQueue[_0xf33b('0x11')]())[_0xf33b('0x6')](realtime[_0xf33b('0x12')]())['then'](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0xf33b('0x13')]())[_0xf33b('0x6')](function(){return realtime;});}function main(){return server[_0xf33b('0x14')](realtime)[_0xf33b('0x6')](function(_0x1d2e0e){return initRealtime();})[_0xf33b('0x6')](function(_0x2af39e){return setInterval(initRealtime,0x1388);})[_0xf33b('0x15')](function(_0x530674){console[_0xf33b('0x16')](_0x530674);});}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 2d4a506..04246f4 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x4fa0e8,_0x26b636){var _0x19cadd=function(_0x4cda62){while(--_0x4cda62){_0x4fa0e8['push'](_0x4fa0e8['shift']());}};_0x19cadd(++_0x26b636);}(_0x326f,0xd1));var _0xf326=function(_0x5a17cd,_0x347150){_0x5a17cd=_0x5a17cd-0x0;var _0x22da41=_0x326f[_0x5a17cd];return _0x22da41;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file +var _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(_0x28e96c,_0x2d75ed){var _0x1db3d5=function(_0x101ebd){while(--_0x101ebd){_0x28e96c['push'](_0x28e96c['shift']());}};_0x1db3d5(++_0x2d75ed);}(_0x814b,0x1a2));var _0xb814=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x814b[_0x29d915];return _0x160f86;};'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 eb59d2a..c3826f2 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 _0x7f80=['http','error','message','result','catch','bluebird','jayson/promise','client'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7f80,0x1dd));var _0x07f8=function(_0x11265d,_0xbf6c85){_0x11265d=_0x11265d-0x0;var _0x15199c=_0x7f80[_0x11265d];return _0x15199c;};'use strict';var BPromise=require(_0x07f8('0x0'));var jayson=require(_0x07f8('0x1'));var client=jayson[_0x07f8('0x2')][_0x07f8('0x3')]({'port':0x232b});function request(_0x32dbf0,_0x457605){return new BPromise(function(_0x1bc200,_0x18fb2f){return client['request'](_0x32dbf0,_0x457605)['then'](function(_0x3298e8){if(_0x3298e8[_0x07f8('0x4')]){return _0x18fb2f(_0x3298e8[_0x07f8('0x4')][_0x07f8('0x5')]);}else{return _0x1bc200(_0x3298e8[_0x07f8('0x6')]);}})[_0x07f8('0x7')](function(_0x4f9850){return _0x18fb2f(_0x4f9850);});});}exports['sendMailMessage']=function(_0x1cffe3,_0x13f56f){return request('SendMail',{'account':_0x1cffe3,'message':_0x13f56f});}; \ No newline at end of file +var _0x0fcf=['error','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x18b5ab,_0x5371f3){var _0x4b8aa8=function(_0x278e2d){while(--_0x278e2d){_0x18b5ab['push'](_0x18b5ab['shift']());}};_0x4b8aa8(++_0x5371f3);}(_0x0fcf,0x139));var _0xf0fc=function(_0x162424,_0x5812b1){_0x162424=_0x162424-0x0;var _0x510e45=_0x0fcf[_0x162424];return _0x510e45;};'use strict';var BPromise=require(_0xf0fc('0x0'));var jayson=require(_0xf0fc('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x3b868b,_0x2b03c2){return new BPromise(function(_0x11460a,_0x1f06ea){return client['request'](_0x3b868b,_0x2b03c2)['then'](function(_0x13c899){if(_0x13c899[_0xf0fc('0x2')]){return _0x1f06ea(_0x13c899[_0xf0fc('0x2')]['message']);}else{return _0x11460a(_0x13c899[_0xf0fc('0x3')]);}})[_0xf0fc('0x4')](function(_0x26333e){return _0x1f06ea(_0x26333e);});});}exports[_0xf0fc('0x5')]=function(_0x17c8b6,_0x2a729f){return request(_0xf0fc('0x6'),{'account':_0x17c8b6,'message':_0x2a729f});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 0acb467..6d2f6b1 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 _0xbc78=['faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','updateRealtime','mail','openchannel','fax','sms','whatsapp','Status','StatusTime','toNumber','faxStatus','smsCurrentCapacity','whatsappCurrentCapacity','stringify','emit','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxCapacity'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xbc78,0x191));var _0x8bc7=function(_0x2e50c3,_0x372431){_0x2e50c3=_0x2e50c3-0x0;var _0x3d94f9=_0xbc78[_0x2e50c3];return _0x3d94f9;};'use strict';var _=require(_0x8bc7('0x0'));var moment=require(_0x8bc7('0x1'));var md5=require(_0x8bc7('0x2'));var Redis=require(_0x8bc7('0x3'));var config=require(_0x8bc7('0x4'));config[_0x8bc7('0x5')]=_[_0x8bc7('0x6')](config[_0x8bc7('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x8bc7('0x7'))(new Redis(config['redis']));function Agent(_0x5267ba){this['id']=_0x5267ba['id']||0x0;this['name']=_0x5267ba[_0x8bc7('0x8')]||'';this[_0x8bc7('0x9')]=_0x5267ba[_0x8bc7('0x9')]||!![];this[_0x8bc7('0xa')]=_0x5267ba[_0x8bc7('0xa')]||![];this[_0x8bc7('0xb')]=_0x5267ba[_0x8bc7('0xb')]||![];this['mailPause']=_0x5267ba[_0x8bc7('0xc')]||![];this[_0x8bc7('0xd')]=_0x5267ba['faxPause']||![];this[_0x8bc7('0xe')]=_0x5267ba[_0x8bc7('0xe')]||![];this[_0x8bc7('0xf')]=_0x5267ba[_0x8bc7('0xf')]||![];this[_0x8bc7('0x10')]=_0x8bc7('0x11');this[_0x8bc7('0x12')]=0x0;this[_0x8bc7('0x13')]=_0x5267ba[_0x8bc7('0x13')]||0x0;this[_0x8bc7('0x14')]=0x0;this[_0x8bc7('0x15')]=_0x8bc7('0x11');this[_0x8bc7('0x16')]=0x0;this[_0x8bc7('0x17')]=_0x5267ba['mailCapacity']||0x0;this[_0x8bc7('0x18')]=0x0;this['faxStatus']=_0x8bc7('0x11');this['faxStatusTime']=0x0;this[_0x8bc7('0x19')]=_0x5267ba[_0x8bc7('0x19')]||0x0;this[_0x8bc7('0x1a')]=0x0;this[_0x8bc7('0x1b')]=_0x8bc7('0x11');this[_0x8bc7('0x1c')]=0x0;this[_0x8bc7('0x1d')]=_0x5267ba['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0x8bc7('0x1e')]=_0x8bc7('0x11');this[_0x8bc7('0x1f')]=0x0;this['whatsappCapacity']=_0x5267ba[_0x8bc7('0x20')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x8bc7('0x21')]=_0x8bc7('0x11');this[_0x8bc7('0x22')]=0x0;this[_0x8bc7('0x23')]=_0x5267ba['openchannelCapacity']||0x0;this[_0x8bc7('0x24')]=0x0;this[_0x8bc7('0x25')]=![];this[_0x8bc7('0x26')]=undefined;this[_0x8bc7('0x2')]='';this['updateRealtime']();}Agent[_0x8bc7('0x27')][_0x8bc7('0x28')]=function(_0x334a8){if(this[_0x334a8+_0x8bc7('0x29')]>0x0){if(this[_0x334a8+_0x8bc7('0x2a')]>0x0&&this[_0x334a8+_0x8bc7('0x29')]>=this[_0x334a8+_0x8bc7('0x2a')]){return _0x8bc7('0x2b');}else{return _0x8bc7('0x2c');}}else{return _0x8bc7('0x2d');}};Agent[_0x8bc7('0x27')][_0x8bc7('0x2e')]=function(){var _0x3ba431=[_0x8bc7('0x2f'),'chat',_0x8bc7('0x30'),_0x8bc7('0x31'),_0x8bc7('0x32'),_0x8bc7('0x33')];for(var _0x110bec=0x0;_0x110bec<_0x3ba431['length'];_0x110bec+=0x1){var _0x527440=this[_0x8bc7('0x28')](_0x3ba431[_0x110bec]);if(this[_0x3ba431[_0x110bec]+_0x8bc7('0x34')]!==_0x527440){this[_0x3ba431[_0x110bec]+_0x8bc7('0x35')]=_[_0x8bc7('0x36')](moment()['format']('x'));}this[_0x3ba431[_0x110bec]+_0x8bc7('0x34')]=_0x527440;}var _0x2f0c46={'id':this['id'],'name':this[_0x8bc7('0x8')],'online':this[_0x8bc7('0x9')],'voicePause':this[_0x8bc7('0xa')],'chatPause':this[_0x8bc7('0xb')],'mailPause':this[_0x8bc7('0xc')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0x8bc7('0xf')],'chatStatus':this[_0x8bc7('0x10')],'chatStatusTime':this[_0x8bc7('0x12')],'chatCapacity':this[_0x8bc7('0x13')],'chatCurrentCapacity':this[_0x8bc7('0x14')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x8bc7('0x16')],'mailCapacity':this[_0x8bc7('0x17')],'mailCurrentCapacity':this[_0x8bc7('0x18')],'faxStatus':this[_0x8bc7('0x37')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x8bc7('0x1a')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x8bc7('0x1c')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x8bc7('0x38')],'whatsappStatus':this[_0x8bc7('0x1e')],'whatsappStatusTime':this[_0x8bc7('0x1f')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x8bc7('0x39')],'openchannelStatus':this[_0x8bc7('0x21')],'openchannelStatusTime':this[_0x8bc7('0x22')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x8bc7('0x24')],'busy':this['busy'],'busyQueue':this[_0x8bc7('0x26')]};var _0x14bba7=md5(JSON[_0x8bc7('0x3a')](_0x2f0c46));if(this[_0x8bc7('0x2')]!==_0x14bba7){this[_0x8bc7('0x2')]=_0x14bba7;io[_0x8bc7('0x3b')]('user:save',_0x2f0c46);}};module[_0x8bc7('0x3c')]=Agent; \ No newline at end of file +var _0xa02f=['sms','whatsapp','length','StatusTime','toNumber','Status','openchannelStatus','stringify','emit','user:save','exports','moment','md5','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','prototype','mail','chat','openchannel','fax'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa02f,0xce));var _0xfa02=function(_0x2fd624,_0x10d3ad){_0x2fd624=_0x2fd624-0x0;var _0x3e204a=_0xa02f[_0x2fd624];return _0x3e204a;};'use strict';var _=require('lodash');var moment=require(_0xfa02('0x0'));var md5=require(_0xfa02('0x1'));var Redis=require(_0xfa02('0x2'));var config=require(_0xfa02('0x3'));config['redis']=_[_0xfa02('0x4')](config['redis'],{'host':_0xfa02('0x5'),'port':0x18eb});var io=require(_0xfa02('0x6'))(new Redis(config[_0xfa02('0x7')]));function Agent(_0x400ac2){this['id']=_0x400ac2['id']||0x0;this[_0xfa02('0x8')]=_0x400ac2['name']||'';this[_0xfa02('0x9')]=_0x400ac2[_0xfa02('0x9')]||!![];this[_0xfa02('0xa')]=_0x400ac2[_0xfa02('0xa')]||![];this['chatPause']=_0x400ac2[_0xfa02('0xb')]||![];this[_0xfa02('0xc')]=_0x400ac2[_0xfa02('0xc')]||![];this['faxPause']=_0x400ac2[_0xfa02('0xd')]||![];this[_0xfa02('0xe')]=_0x400ac2[_0xfa02('0xe')]||![];this['openchannelPause']=_0x400ac2[_0xfa02('0xf')]||![];this[_0xfa02('0x10')]=_0xfa02('0x11');this[_0xfa02('0x12')]=0x0;this[_0xfa02('0x13')]=_0x400ac2[_0xfa02('0x13')]||0x0;this[_0xfa02('0x14')]=0x0;this[_0xfa02('0x15')]=_0xfa02('0x11');this[_0xfa02('0x16')]=0x0;this[_0xfa02('0x17')]=_0x400ac2[_0xfa02('0x17')]||0x0;this[_0xfa02('0x18')]=0x0;this[_0xfa02('0x19')]=_0xfa02('0x11');this[_0xfa02('0x1a')]=0x0;this[_0xfa02('0x1b')]=_0x400ac2[_0xfa02('0x1b')]||0x0;this[_0xfa02('0x1c')]=0x0;this[_0xfa02('0x1d')]=_0xfa02('0x11');this[_0xfa02('0x1e')]=0x0;this[_0xfa02('0x1f')]=_0x400ac2[_0xfa02('0x1f')]||0x0;this[_0xfa02('0x20')]=0x0;this[_0xfa02('0x21')]='unknown';this[_0xfa02('0x22')]=0x0;this['whatsappCapacity']=_0x400ac2[_0xfa02('0x23')]||0x0;this[_0xfa02('0x24')]=0x0;this['openchannelStatus']=_0xfa02('0x11');this[_0xfa02('0x25')]=0x0;this[_0xfa02('0x26')]=_0x400ac2[_0xfa02('0x26')]||0x0;this[_0xfa02('0x27')]=0x0;this[_0xfa02('0x28')]=![];this[_0xfa02('0x29')]=undefined;this[_0xfa02('0x1')]='';this[_0xfa02('0x2a')]();}Agent['prototype'][_0xfa02('0x2b')]=function(_0x5536da){if(this[_0x5536da+'CurrentCapacity']>0x0){if(this[_0x5536da+_0xfa02('0x2c')]>0x0&&this[_0x5536da+_0xfa02('0x2d')]>=this[_0x5536da+_0xfa02('0x2c')]){return _0xfa02('0x2e');}else{return _0xfa02('0x2f');}}else{return _0xfa02('0x30');}};Agent[_0xfa02('0x31')]['updateRealtime']=function(){var _0x32e7f8=[_0xfa02('0x32'),_0xfa02('0x33'),_0xfa02('0x34'),_0xfa02('0x35'),_0xfa02('0x36'),_0xfa02('0x37')];for(var _0x31c07e=0x0;_0x31c07e<_0x32e7f8[_0xfa02('0x38')];_0x31c07e+=0x1){var _0x1ab0a9=this['getChannelStatus'](_0x32e7f8[_0x31c07e]);if(this[_0x32e7f8[_0x31c07e]+'Status']!==_0x1ab0a9){this[_0x32e7f8[_0x31c07e]+_0xfa02('0x39')]=_[_0xfa02('0x3a')](moment()['format']('x'));}this[_0x32e7f8[_0x31c07e]+_0xfa02('0x3b')]=_0x1ab0a9;}var _0x2a2f46={'id':this['id'],'name':this[_0xfa02('0x8')],'online':this[_0xfa02('0x9')],'voicePause':this[_0xfa02('0xa')],'chatPause':this[_0xfa02('0xb')],'mailPause':this[_0xfa02('0xc')],'smsPause':this[_0xfa02('0xe')],'faxPause':this[_0xfa02('0xd')],'openchannelPause':this[_0xfa02('0xf')],'chatStatus':this[_0xfa02('0x10')],'chatStatusTime':this[_0xfa02('0x12')],'chatCapacity':this[_0xfa02('0x13')],'chatCurrentCapacity':this[_0xfa02('0x14')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xfa02('0x16')],'mailCapacity':this[_0xfa02('0x17')],'mailCurrentCapacity':this[_0xfa02('0x18')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xfa02('0x1a')],'faxCapacity':this[_0xfa02('0x1b')],'faxCurrentCapacity':this[_0xfa02('0x1c')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xfa02('0x1e')],'smsCapacity':this[_0xfa02('0x1f')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xfa02('0x21')],'whatsappStatusTime':this[_0xfa02('0x22')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xfa02('0x24')],'openchannelStatus':this[_0xfa02('0x3c')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xfa02('0x26')],'openchannelCurrentCapacity':this[_0xfa02('0x27')],'busy':this['busy'],'busyQueue':this[_0xfa02('0x29')]};var _0x3b0e1e=md5(JSON[_0xfa02('0x3d')](_0x2a2f46));if(this[_0xfa02('0x1')]!==_0x3b0e1e){this[_0xfa02('0x1')]=_0x3b0e1e;io[_0xfa02('0x3e')](_0xfa02('0x3f'),_0x2a2f46);}};module[_0xfa02('0x40')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index c69476e..8b2f28a 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 _0xee49=['md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','map','Agents','prototype','loggedIn','length','online','chatPause','paused','available','stringify','emit','lodash'];(function(_0x17968b,_0xd64399){var _0x4eabd9=function(_0x33d186){while(--_0x33d186){_0x17968b['push'](_0x17968b['shift']());}};_0x4eabd9(++_0xd64399);}(_0xee49,0x117));var _0x9ee4=function(_0xaedc8f,_0x2487db){_0xaedc8f=_0xaedc8f-0x0;var _0x2e1d6f=_0xee49[_0xaedc8f];return _0x2e1d6f;};'use strict';var _=require(_0x9ee4('0x0'));var md5=require(_0x9ee4('0x1'));var util=require(_0x9ee4('0x2'));var Redis=require(_0x9ee4('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x9ee4('0x4')](config[_0x9ee4('0x5')],{'host':_0x9ee4('0x6'),'port':0x18eb});var io=require(_0x9ee4('0x7'))(new Redis(config['redis']));function ChatQueue(_0x20c249){this['id']=_0x20c249['id']||0x0;this[_0x9ee4('0x8')]=_0x20c249['name']||'';this[_0x9ee4('0x9')]=_0x20c249[_0x9ee4('0x9')]||0xa;this[_0x9ee4('0xa')]=_0x20c249[_0x9ee4('0xa')]||_0x9ee4('0xb');this['Agents']=_0x20c249['Agents'];this[_0x9ee4('0xc')]={};this[_0x9ee4('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0x9ee4('0xe')]();}ChatQueue['prototype'][_0x9ee4('0xf')]=function(){var _0x4b90a=this['mapAgentsId'][_0x9ee4('0x10')];this[_0x9ee4('0xc')]=_[_0x9ee4('0x11')](this[_0x9ee4('0x12')],'id');this[_0x9ee4('0xc')][_0x9ee4('0x10')]=_0x4b90a;};ChatQueue[_0x9ee4('0x13')][_0x9ee4('0xe')]=function(){this[_0x9ee4('0x14')]=0x0;this['paused']=0x0;for(var _0x392978=0x0;_0x392978=0x0?this['available']:0x0;var _0x328de0={'id':this['id'],'available':this[_0x9ee4('0x19')],'loggedIn':this[_0x9ee4('0x14')],'name':this[_0x9ee4('0x8')],'paused':this[_0x9ee4('0x18')],'waiting':this['waiting']};var _0x15d3a5=md5(JSON[_0x9ee4('0x1a')](_0x328de0));if(this[_0x9ee4('0x1')]!==_0x15d3a5){this['md5']=_0x15d3a5;io['to'](util['format']('chat:queue:%s',_0x328de0[_0x9ee4('0x8')]))[_0x9ee4('0x1b')]('chat_queue:save',_0x328de0);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x216f=['util','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','emit','lodash','md5'];(function(_0xda74f1,_0x4a8f23){var _0x3dc77c=function(_0x45449f){while(--_0x45449f){_0xda74f1['push'](_0xda74f1['shift']());}};_0x3dc77c(++_0x4a8f23);}(_0x216f,0x142));var _0xf216=function(_0x852450,_0x23120c){_0x852450=_0x852450-0x0;var _0x2d4b20=_0x216f[_0x852450];return _0x2d4b20;};'use strict';var _=require(_0xf216('0x0'));var md5=require(_0xf216('0x1'));var util=require(_0xf216('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xf216('0x3')]=_[_0xf216('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf216('0x5'))(new Redis(config[_0xf216('0x3')]));function ChatQueue(_0x3b3280){this['id']=_0x3b3280['id']||0x0;this[_0xf216('0x6')]=_0x3b3280['name']||'';this[_0xf216('0x7')]=_0x3b3280[_0xf216('0x7')]||0xa;this[_0xf216('0x8')]=_0x3b3280[_0xf216('0x8')]||_0xf216('0x9');this[_0xf216('0xa')]=_0x3b3280[_0xf216('0xa')];this[_0xf216('0xb')]={};this['waiting']=0x0;this[_0xf216('0x1')]='';this[_0xf216('0xc')]();this[_0xf216('0xd')]();}ChatQueue['prototype'][_0xf216('0xc')]=function(){var _0x4444dc=this[_0xf216('0xb')][_0xf216('0xe')];this['mapAgentsId']=_[_0xf216('0xf')](this[_0xf216('0xa')],'id');this[_0xf216('0xb')]['_rr']=_0x4444dc;};ChatQueue[_0xf216('0x10')][_0xf216('0xd')]=function(){this[_0xf216('0x11')]=0x0;this[_0xf216('0x12')]=0x0;for(var _0x2c0b09=0x0;_0x2c0b09=0x0?this[_0xf216('0x16')]:0x0;var _0x26765a={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf216('0x11')],'name':this[_0xf216('0x6')],'paused':this[_0xf216('0x12')],'waiting':this['waiting']};var _0x1f1f15=md5(JSON[_0xf216('0x17')](_0x26765a));if(this[_0xf216('0x1')]!==_0x1f1f15){this[_0xf216('0x1')]=_0x1f1f15;io['to'](util[_0xf216('0x18')](_0xf216('0x19'),_0x26765a['name']))[_0xf216('0x1a')]('chat_queue:save',_0x26765a);}};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 568d59d..b868a91 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 _0xff98=['_rr','map','loggedIn','paused','length','faxPause','available','stringify','format','fax:queue:%s','emit','exports','lodash','md5','../../../config/environment','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting'];(function(_0x478963,_0x539bd8){var _0x33797d=function(_0x13db26){while(--_0x13db26){_0x478963['push'](_0x478963['shift']());}};_0x33797d(++_0x539bd8);}(_0xff98,0x138));var _0x8ff9=function(_0x141e55,_0x25d0d9){_0x141e55=_0x141e55-0x0;var _0x5a869a=_0xff98[_0x141e55];return _0x5a869a;};'use strict';var _=require(_0x8ff9('0x0'));var md5=require(_0x8ff9('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x8ff9('0x2'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8ff9('0x3'))(new Redis(config[_0x8ff9('0x4')]));function FaxQueue(_0x47c4c0){this['id']=_0x47c4c0['id']||0x0;this[_0x8ff9('0x5')]=_0x47c4c0['name']||'';this['timeout']=_0x47c4c0[_0x8ff9('0x6')]||0xa;this['strategy']=_0x47c4c0[_0x8ff9('0x7')]||_0x8ff9('0x8');this[_0x8ff9('0x9')]=_0x47c4c0[_0x8ff9('0x9')];this[_0x8ff9('0xa')]={};this[_0x8ff9('0xb')]=0x0;this[_0x8ff9('0x1')]='';this[_0x8ff9('0xc')]();this['updateRealtime']();}FaxQueue['prototype'][_0x8ff9('0xc')]=function(){var _0x5f1c29=this[_0x8ff9('0xa')][_0x8ff9('0xd')];this[_0x8ff9('0xa')]=_[_0x8ff9('0xe')](this['Agents'],'id');this[_0x8ff9('0xa')][_0x8ff9('0xd')]=_0x5f1c29;};FaxQueue['prototype']['updateRealtime']=function(){this[_0x8ff9('0xf')]=0x0;this[_0x8ff9('0x10')]=0x0;for(var _0x5c2659=0x0;_0x5c2659=0x0?this[_0x8ff9('0x13')]:0x0;var _0x35dd8b={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8ff9('0xf')],'name':this[_0x8ff9('0x5')],'paused':this[_0x8ff9('0x10')],'waiting':this[_0x8ff9('0xb')]};var _0x409b4e=md5(JSON[_0x8ff9('0x14')](_0x35dd8b));if(this[_0x8ff9('0x1')]!==_0x409b4e){this[_0x8ff9('0x1')]=_0x409b4e;io['to'](util[_0x8ff9('0x15')](_0x8ff9('0x16'),_0x35dd8b[_0x8ff9('0x5')]))[_0x8ff9('0x17')]('fax_queue:save',_0x35dd8b);}};module[_0x8ff9('0x18')]=FaxQueue; \ No newline at end of file +var _0xe82d=['strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','map','loggedIn','paused','online','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','md5','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xe82d,0xf3));var _0xde82=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xe82d[_0xaa0309];return _0x5de7ce;};'use strict';var _=require('lodash');var md5=require(_0xde82('0x0'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xde82('0x1')]=_[_0xde82('0x2')](config[_0xde82('0x1')],{'host':_0xde82('0x3'),'port':0x18eb});var io=require(_0xde82('0x4'))(new Redis(config[_0xde82('0x1')]));function FaxQueue(_0x8efac4){this['id']=_0x8efac4['id']||0x0;this[_0xde82('0x5')]=_0x8efac4[_0xde82('0x5')]||'';this[_0xde82('0x6')]=_0x8efac4[_0xde82('0x6')]||0xa;this[_0xde82('0x7')]=_0x8efac4['strategy']||_0xde82('0x8');this[_0xde82('0x9')]=_0x8efac4['Agents'];this[_0xde82('0xa')]={};this[_0xde82('0xb')]=0x0;this[_0xde82('0x0')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0xde82('0xc')][_0xde82('0xd')]=function(){var _0x3a916d=this['mapAgentsId'][_0xde82('0xe')];this['mapAgentsId']=_[_0xde82('0xf')](this[_0xde82('0x9')],'id');this[_0xde82('0xa')][_0xde82('0xe')]=_0x3a916d;};FaxQueue['prototype']['updateRealtime']=function(){this[_0xde82('0x10')]=0x0;this[_0xde82('0x11')]=0x0;for(var _0x353e66=0x0;_0x353e66=0x0?this[_0xde82('0x14')]:0x0;var _0xf85a46={'id':this['id'],'available':this[_0xde82('0x14')],'loggedIn':this[_0xde82('0x10')],'name':this['name'],'paused':this[_0xde82('0x11')],'waiting':this[_0xde82('0xb')]};var _0x3ba782=md5(JSON[_0xde82('0x15')](_0xf85a46));if(this[_0xde82('0x0')]!==_0x3ba782){this['md5']=_0x3ba782;io['to'](util['format'](_0xde82('0x16'),_0xf85a46[_0xde82('0x5')]))[_0xde82('0x17')](_0xde82('0x18'),_0xf85a46);}};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 874ad45..20930f8 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 _0x40a7=['name','Intervals'];(function(_0xa4b84e,_0x3ae254){var _0x36e2fe=function(_0x2d0907){while(--_0x2d0907){_0xa4b84e['push'](_0xa4b84e['shift']());}};_0x36e2fe(++_0x3ae254);}(_0x40a7,0x1ee));var _0x740a=function(_0x55e01d,_0x5caada){_0x55e01d=_0x55e01d-0x0;var _0x3137fa=_0x40a7[_0x55e01d];return _0x3137fa;};'use strict';function Interval(_0x208dc0){this['id']=_0x208dc0['id']||0x0;this[_0x740a('0x0')]=_0x208dc0['name']||'';this[_0x740a('0x1')]=_0x208dc0[_0x740a('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0xe0e0=['name','Intervals','exports'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xe0e0,0x1bc));var _0x0e0e=function(_0x266d0c,_0x5d5881){_0x266d0c=_0x266d0c-0x0;var _0x3e177f=_0xe0e0[_0x266d0c];return _0x3e177f;};'use strict';function Interval(_0x9268b6){this['id']=_0x9268b6['id']||0x0;this[_0x0e0e('0x0')]=_0x9268b6[_0x0e0e('0x0')]||'';this[_0x0e0e('0x1')]=_0x9268b6[_0x0e0e('0x1')]||{};}module[_0x0e0e('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 a190c61..954e697 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 _0xf38d=['updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','online','available','waiting','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x1af5b2,_0x1b82fe){var _0xf1aa2d=function(_0x2ceae2){while(--_0x2ceae2){_0x1af5b2['push'](_0x1af5b2['shift']());}};_0xf1aa2d(++_0x1b82fe);}(_0xf38d,0x160));var _0xdf38=function(_0xea136a,_0x3e53b8){_0xea136a=_0xea136a-0x0;var _0x39591b=_0xf38d[_0xea136a];return _0x39591b;};'use strict';var _=require(_0xdf38('0x0'));var md5=require(_0xdf38('0x1'));var util=require(_0xdf38('0x2'));var Redis=require(_0xdf38('0x3'));var config=require(_0xdf38('0x4'));config[_0xdf38('0x5')]=_['defaults'](config[_0xdf38('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xdf38('0x6'))(new Redis(config[_0xdf38('0x5')]));function MailQueue(_0x22f7d6){this['id']=_0x22f7d6['id']||0x0;this[_0xdf38('0x7')]=_0x22f7d6[_0xdf38('0x7')]||'';this[_0xdf38('0x8')]=_0x22f7d6[_0xdf38('0x8')]||0xa;this[_0xdf38('0x9')]=_0x22f7d6[_0xdf38('0x9')]||'beepall';this[_0xdf38('0xa')]=_0x22f7d6['Agents'];this[_0xdf38('0xb')]={};this['waiting']=0x0;this[_0xdf38('0x1')]='';this[_0xdf38('0xc')]();this['updateRealtime']();}MailQueue[_0xdf38('0xd')][_0xdf38('0xc')]=function(){var _0xb1c1fe=this[_0xdf38('0xb')][_0xdf38('0xe')];this[_0xdf38('0xb')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0xdf38('0xe')]=_0xb1c1fe;};MailQueue[_0xdf38('0xd')][_0xdf38('0xf')]=function(){this[_0xdf38('0x10')]=0x0;this[_0xdf38('0x11')]=0x0;for(var _0x227d5c=0x0;_0x227d5c=0x0?this[_0xdf38('0x14')]:0x0;var _0x2d048a={'id':this['id'],'available':this[_0xdf38('0x14')],'loggedIn':this[_0xdf38('0x10')],'name':this[_0xdf38('0x7')],'paused':this[_0xdf38('0x11')],'waiting':this[_0xdf38('0x15')]};var _0x59ef70=md5(JSON[_0xdf38('0x16')](_0x2d048a));if(this[_0xdf38('0x1')]!==_0x59ef70){this['md5']=_0x59ef70;io['to'](util[_0xdf38('0x17')](_0xdf38('0x18'),_0x2d048a['name']))[_0xdf38('0x19')](_0xdf38('0x1a'),_0x2d048a);}};module[_0xdf38('0x1b')]=MailQueue; \ No newline at end of file +var _0xd05d=['strategy','beepall','Agents','mapAgentsId','updateRealtime','updateRouting','map','prototype','loggedIn','paused','length','online','mailPause','available','waiting','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x3eea50,_0x54d651){var _0x3f1f0e=function(_0x1f50f7){while(--_0x1f50f7){_0x3eea50['push'](_0x3eea50['shift']());}};_0x3f1f0e(++_0x54d651);}(_0xd05d,0x1ef));var _0xdd05=function(_0x54d2c2,_0x394de9){_0x54d2c2=_0x54d2c2-0x0;var _0x866a4d=_0xd05d[_0x54d2c2];return _0x866a4d;};'use strict';var _=require(_0xdd05('0x0'));var md5=require(_0xdd05('0x1'));var util=require('util');var Redis=require(_0xdd05('0x2'));var config=require(_0xdd05('0x3'));config[_0xdd05('0x4')]=_['defaults'](config[_0xdd05('0x4')],{'host':_0xdd05('0x5'),'port':0x18eb});var io=require(_0xdd05('0x6'))(new Redis(config[_0xdd05('0x4')]));function MailQueue(_0x31abc6){this['id']=_0x31abc6['id']||0x0;this['name']=_0x31abc6[_0xdd05('0x7')]||'';this[_0xdd05('0x8')]=_0x31abc6[_0xdd05('0x8')]||0xa;this[_0xdd05('0x9')]=_0x31abc6[_0xdd05('0x9')]||_0xdd05('0xa');this[_0xdd05('0xb')]=_0x31abc6[_0xdd05('0xb')];this[_0xdd05('0xc')]={};this['waiting']=0x0;this[_0xdd05('0x1')]='';this['updateRouting']();this[_0xdd05('0xd')]();}MailQueue['prototype'][_0xdd05('0xe')]=function(){var _0x40f50c=this[_0xdd05('0xc')]['_rr'];this['mapAgentsId']=_[_0xdd05('0xf')](this['Agents'],'id');this[_0xdd05('0xc')]['_rr']=_0x40f50c;};MailQueue[_0xdd05('0x10')][_0xdd05('0xd')]=function(){this[_0xdd05('0x11')]=0x0;this[_0xdd05('0x12')]=0x0;for(var _0x55eaba=0x0;_0x55eaba=0x0?this['available']:0x0;var _0x3ef95e={'id':this['id'],'available':this[_0xdd05('0x16')],'loggedIn':this[_0xdd05('0x11')],'name':this[_0xdd05('0x7')],'paused':this['paused'],'waiting':this[_0xdd05('0x17')]};var _0x55f3f5=md5(JSON['stringify'](_0x3ef95e));if(this[_0xdd05('0x1')]!==_0x55f3f5){this[_0xdd05('0x1')]=_0x55f3f5;io['to'](util['format'](_0xdd05('0x18'),_0x3ef95e['name']))[_0xdd05('0x19')](_0xdd05('0x1a'),_0x3ef95e);}};module[_0xdd05('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index f32ee3c..cc62740 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 _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x21b706,_0x1022f4){var _0x13b94a=function(_0x3116da){while(--_0x3116da){_0x21b706['push'](_0x21b706['shift']());}};_0x13b94a(++_0x1022f4);}(_0x2ef3,0xba));var _0x32ef=function(_0x384c77,_0x38fb50){_0x384c77=_0x384c77-0x0;var _0x318c7a=_0x2ef3[_0x384c77];return _0x318c7a;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=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(_0x35dba7,_0x2fe2a5){var _0x67f30f=function(_0x106910){while(--_0x106910){_0x35dba7['push'](_0x35dba7['shift']());}};_0x67f30f(++_0x2fe2a5);}(_0x814b,0x1a2));var _0xb814=function(_0x4d2263,_0x3fbf0d){_0x4d2263=_0x4d2263-0x0;var _0x24aba0=_0x814b[_0x4d2263];return _0x24aba0;};'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 d6cf68f..db8b495 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 _0x4b1f=['waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','paused','available','loggedIn','stringify','format','emit','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents'];(function(_0x2f7270,_0x307af1){var _0xe1d89a=function(_0x1ba203){while(--_0x1ba203){_0x2f7270['push'](_0x2f7270['shift']());}};_0xe1d89a(++_0x307af1);}(_0x4b1f,0x195));var _0xf4b1=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x4b1f[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0xf4b1('0x0'));var md5=require(_0xf4b1('0x1'));var util=require('util');var Redis=require(_0xf4b1('0x2'));var config=require(_0xf4b1('0x3'));config[_0xf4b1('0x4')]=_['defaults'](config[_0xf4b1('0x4')],{'host':_0xf4b1('0x5'),'port':0x18eb});var io=require(_0xf4b1('0x6'))(new Redis(config['redis']));function SmsQueue(_0x5f26a3){this['id']=_0x5f26a3['id']||0x0;this[_0xf4b1('0x7')]=_0x5f26a3[_0xf4b1('0x7')]||'';this[_0xf4b1('0x8')]=_0x5f26a3[_0xf4b1('0x8')]||0xa;this[_0xf4b1('0x9')]=_0x5f26a3['strategy']||'beepall';this['Agents']=_0x5f26a3[_0xf4b1('0xa')];this['mapAgentsId']={};this[_0xf4b1('0xb')]=0x0;this['md5']='';this['updateRouting']();this[_0xf4b1('0xc')]();}SmsQueue[_0xf4b1('0xd')][_0xf4b1('0xe')]=function(){var _0x253fa8=this[_0xf4b1('0xf')][_0xf4b1('0x10')];this[_0xf4b1('0xf')]=_[_0xf4b1('0x11')](this[_0xf4b1('0xa')],'id');this[_0xf4b1('0xf')][_0xf4b1('0x10')]=_0x253fa8;};SmsQueue[_0xf4b1('0xd')][_0xf4b1('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x3ea6f3=0x0;_0x3ea6f3=0x0?this[_0xf4b1('0x13')]:0x0;var _0x420f9e={'id':this['id'],'available':this[_0xf4b1('0x13')],'loggedIn':this[_0xf4b1('0x14')],'name':this[_0xf4b1('0x7')],'paused':this[_0xf4b1('0x12')],'waiting':this['waiting']};var _0x220cad=md5(JSON[_0xf4b1('0x15')](_0x420f9e));if(this['md5']!==_0x220cad){this[_0xf4b1('0x1')]=_0x220cad;io['to'](util[_0xf4b1('0x16')]('sms:queue:%s',_0x420f9e[_0xf4b1('0x7')]))[_0xf4b1('0x17')](_0xf4b1('0x18'),_0x420f9e);}};module[_0xf4b1('0x19')]=SmsQueue; \ No newline at end of file +var _0xdab2=['sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','mapAgentsId','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','format'];(function(_0x7c38a9,_0x192f0e){var _0x16a8a4=function(_0x198ec0){while(--_0x198ec0){_0x7c38a9['push'](_0x7c38a9['shift']());}};_0x16a8a4(++_0x192f0e);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var md5=require(_0x2dab('0x1'));var util=require('util');var Redis=require(_0x2dab('0x2'));var config=require(_0x2dab('0x3'));config[_0x2dab('0x4')]=_[_0x2dab('0x5')](config['redis'],{'host':_0x2dab('0x6'),'port':0x18eb});var io=require(_0x2dab('0x7'))(new Redis(config[_0x2dab('0x4')]));function SmsQueue(_0x203350){this['id']=_0x203350['id']||0x0;this[_0x2dab('0x8')]=_0x203350[_0x2dab('0x8')]||'';this[_0x2dab('0x9')]=_0x203350[_0x2dab('0x9')]||0xa;this[_0x2dab('0xa')]=_0x203350[_0x2dab('0xa')]||_0x2dab('0xb');this[_0x2dab('0xc')]=_0x203350[_0x2dab('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x2dab('0x1')]='';this[_0x2dab('0xd')]();this[_0x2dab('0xe')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x29e96b=this[_0x2dab('0xf')][_0x2dab('0x10')];this[_0x2dab('0xf')]=_[_0x2dab('0x11')](this['Agents'],'id');this[_0x2dab('0xf')][_0x2dab('0x10')]=_0x29e96b;};SmsQueue['prototype'][_0x2dab('0xe')]=function(){this[_0x2dab('0x12')]=0x0;this[_0x2dab('0x13')]=0x0;for(var _0x597a6e=0x0;_0x597a6e=0x0?this[_0x2dab('0x17')]:0x0;var _0x2a86b5={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2dab('0x12')],'name':this[_0x2dab('0x8')],'paused':this[_0x2dab('0x13')],'waiting':this['waiting']};var _0x3340fd=md5(JSON[_0x2dab('0x18')](_0x2a86b5));if(this[_0x2dab('0x1')]!==_0x3340fd){this['md5']=_0x3340fd;io['to'](util[_0x2dab('0x19')](_0x2dab('0x1a'),_0x2a86b5[_0x2dab('0x8')]))[_0x2dab('0x1b')](_0x2dab('0x1c'),_0x2a86b5);}};module[_0x2dab('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 741e065..2a64a67 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 _0xee11=['whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','paused','length','online','loggedIn','whatsappPause','available','stringify','format'];(function(_0x40ec7c,_0x3a29c3){var _0x2a8161=function(_0x34520d){while(--_0x34520d){_0x40ec7c['push'](_0x40ec7c['shift']());}};_0x2a8161(++_0x3a29c3);}(_0xee11,0x1d4));var _0x1ee1=function(_0x519de3,_0xe7c04e){_0x519de3=_0x519de3-0x0;var _0x3e21d9=_0xee11[_0x519de3];return _0x3e21d9;};'use strict';var _=require(_0x1ee1('0x0'));var md5=require(_0x1ee1('0x1'));var util=require('util');var Redis=require(_0x1ee1('0x2'));var config=require(_0x1ee1('0x3'));config[_0x1ee1('0x4')]=_[_0x1ee1('0x5')](config[_0x1ee1('0x4')],{'host':_0x1ee1('0x6'),'port':0x18eb});var io=require(_0x1ee1('0x7'))(new Redis(config[_0x1ee1('0x4')]));function WhatsappQueue(_0x405c9f){this['id']=_0x405c9f['id']||0x0;this[_0x1ee1('0x8')]=_0x405c9f[_0x1ee1('0x8')]||'';this[_0x1ee1('0x9')]=_0x405c9f['timeout']||0xa;this[_0x1ee1('0xa')]=_0x405c9f[_0x1ee1('0xa')]||_0x1ee1('0xb');this[_0x1ee1('0xc')]=_0x405c9f[_0x1ee1('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x1ee1('0x1')]='';this[_0x1ee1('0xd')]();this[_0x1ee1('0xe')]();}WhatsappQueue[_0x1ee1('0xf')][_0x1ee1('0xd')]=function(){var _0x4edcbb=this[_0x1ee1('0x10')]['_rr'];this['mapAgentsId']=_['map'](this[_0x1ee1('0xc')],'id');this[_0x1ee1('0x10')]['_rr']=_0x4edcbb;};WhatsappQueue[_0x1ee1('0xf')][_0x1ee1('0xe')]=function(){this['loggedIn']=0x0;this[_0x1ee1('0x11')]=0x0;for(var _0x25c3fb=0x0;_0x25c3fb=0x0?this[_0x1ee1('0x16')]:0x0;var _0x3a4754={'id':this['id'],'available':this[_0x1ee1('0x16')],'loggedIn':this[_0x1ee1('0x14')],'name':this[_0x1ee1('0x8')],'paused':this[_0x1ee1('0x11')],'waiting':this['waiting']};var _0x12e083=md5(JSON[_0x1ee1('0x17')](_0x3a4754));if(this[_0x1ee1('0x1')]!==_0x12e083){this[_0x1ee1('0x1')]=_0x12e083;io['to'](util[_0x1ee1('0x18')](_0x1ee1('0x19'),_0x3a4754['name']))[_0x1ee1('0x1a')](_0x1ee1('0x1b'),_0x3a4754);}};module[_0x1ee1('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0x3909=['length','online','loggedIn','paused','available','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','ioredis','../../../config/environment','redis','localhost','name','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x4b71de,_0x308adc){var _0x3b56ad=function(_0x51fda3){while(--_0x51fda3){_0x4b71de['push'](_0x4b71de['shift']());}};_0x3b56ad(++_0x308adc);}(_0x3909,0x10e));var _0x9390=function(_0xc1a4cf,_0x17141b){_0xc1a4cf=_0xc1a4cf-0x0;var _0x2930d1=_0x3909[_0xc1a4cf];return _0x2930d1;};'use strict';var _=require(_0x9390('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x9390('0x1'));var config=require(_0x9390('0x2'));config[_0x9390('0x3')]=_['defaults'](config[_0x9390('0x3')],{'host':_0x9390('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9390('0x3')]));function WhatsappQueue(_0x19f9e5){this['id']=_0x19f9e5['id']||0x0;this['name']=_0x19f9e5[_0x9390('0x5')]||'';this['timeout']=_0x19f9e5['timeout']||0xa;this[_0x9390('0x6')]=_0x19f9e5[_0x9390('0x6')]||'beepall';this[_0x9390('0x7')]=_0x19f9e5['Agents'];this[_0x9390('0x8')]={};this[_0x9390('0x9')]=0x0;this[_0x9390('0xa')]='';this[_0x9390('0xb')]();this[_0x9390('0xc')]();}WhatsappQueue[_0x9390('0xd')]['updateRouting']=function(){var _0x5ba00a=this[_0x9390('0x8')][_0x9390('0xe')];this[_0x9390('0x8')]=_[_0x9390('0xf')](this[_0x9390('0x7')],'id');this[_0x9390('0x8')]['_rr']=_0x5ba00a;};WhatsappQueue[_0x9390('0xd')][_0x9390('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x4f7fae=0x0;_0x4f7fae=0x0?this[_0x9390('0x14')]:0x0;var _0x211780={'id':this['id'],'available':this[_0x9390('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x9390('0x5')],'paused':this[_0x9390('0x13')],'waiting':this[_0x9390('0x9')]};var _0x1f7f77=md5(JSON[_0x9390('0x15')](_0x211780));if(this[_0x9390('0xa')]!==_0x1f7f77){this[_0x9390('0xa')]=_0x1f7f77;io['to'](util[_0x9390('0x16')](_0x9390('0x17'),_0x211780[_0x9390('0x5')]))['emit'](_0x9390('0x18'),_0x211780);}};module[_0x9390('0x19')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 3f8b727..21c082a 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(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 73c56a4..cd8675b 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 _0xdc17=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x2a43fc,_0x3f309f){var _0x3c5022=function(_0x257102){while(--_0x257102){_0x2a43fc['push'](_0x2a43fc['shift']());}};_0x3c5022(++_0x3f309f);}(_0xdc17,0x11f));var _0x7dc1=function(_0x4d3abe,_0x4e4459){_0x4d3abe=_0x4d3abe-0x0;var _0x2df124=_0xdc17[_0x4d3abe];return _0x2df124;};'use strict';var client=require(_0x7dc1('0x0'));exports[_0x7dc1('0x1')]=function(_0x5953ed,_0x3f6c3c){return client[_0x7dc1('0x2')](_0x7dc1('0x3'),{'body':_0x3f6c3c,'options':{'where':{'id':_0x5953ed}},'log':_0x7dc1('0x4')});};exports[_0x7dc1('0x5')]=function(_0x509ff0,_0x4a5ac7){return client[_0x7dc1('0x2')](_0x7dc1('0x6'),{'body':_0x4a5ac7,'options':{'where':{'id':_0x509ff0}},'log':_0x7dc1('0x7')});}; \ No newline at end of file +var _0x6302=['../client','update','UpdateChatInteraction','updateChatInteraction','addTags','Request','addTagsToChatInteraction'];(function(_0x1fbf60,_0x5201d8){var _0x52a136=function(_0x24ebd4){while(--_0x24ebd4){_0x1fbf60['push'](_0x1fbf60['shift']());}};_0x52a136(++_0x5201d8);}(_0x6302,0x150));var _0x2630=function(_0x323cda,_0x1352e3){_0x323cda=_0x323cda-0x0;var _0x5288de=_0x6302[_0x323cda];return _0x5288de;};'use strict';var client=require(_0x2630('0x0'));exports[_0x2630('0x1')]=function(_0x2a3062,_0x3cbeae){return client['Request'](_0x2630('0x2'),{'body':_0x3cbeae,'options':{'where':{'id':_0x2a3062}},'log':_0x2630('0x3')});};exports[_0x2630('0x4')]=function(_0xe70fb4,_0x280709){return client[_0x2630('0x5')]('AddTagsToChatInteraction',{'body':_0x280709,'options':{'where':{'id':_0xe70fb4}},'log':_0x2630('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 3896ff5..89fcac1 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 _0x9090=['createChatMessage','create'];(function(_0x18e2b6,_0x5e188b){var _0x1b34b0=function(_0x207e53){while(--_0x207e53){_0x18e2b6['push'](_0x18e2b6['shift']());}};_0x1b34b0(++_0x5e188b);}(_0x9090,0x1db));var _0x0909=function(_0x7f03be,_0x155bb3){_0x7f03be=_0x7f03be-0x0;var _0x28da01=_0x9090[_0x7f03be];return _0x28da01;};'use strict';var client=require('../client');exports[_0x0909('0x0')]=function(_0x26e9b8){return client['Request']('CreateChatMessage',{'body':_0x26e9b8,'log':_0x0909('0x1')});}; \ No newline at end of file +var _0xada1=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x5d9a85,_0x55221e){var _0x1ef8aa=function(_0x5241be){while(--_0x5241be){_0x5d9a85['push'](_0x5d9a85['shift']());}};_0x1ef8aa(++_0x55221e);}(_0xada1,0xb6));var _0x1ada=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xada1[_0x4b7895];return _0x264180;};'use strict';var client=require(_0x1ada('0x0'));exports[_0x1ada('0x1')]=function(_0x3f3216){return client[_0x1ada('0x2')](_0x1ada('0x3'),{'body':_0x3f3216,'log':_0x1ada('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 057fd24..697cbe0 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 _0x06f4=['online','chatPause','../client','getChatQueues','GetChatQueue','name','User'];(function(_0x21380b,_0x263c7a){var _0x2c8ea0=function(_0x35ddd4){while(--_0x35ddd4){_0x21380b['push'](_0x21380b['shift']());}};_0x2c8ea0(++_0x263c7a);}(_0x06f4,0x136));var _0x406f=function(_0x4443b4,_0x1e0450){_0x4443b4=_0x4443b4-0x0;var _0x29b364=_0x06f4[_0x4443b4];return _0x29b364;};'use strict';var client=require(_0x406f('0x0'));exports[_0x406f('0x1')]=function(){return function(){return client['Request'](_0x406f('0x2'),{'options':{'raw':![],'attributes':['id',_0x406f('0x3'),'timeout','strategy'],'include':[{'model':_0x406f('0x4'),'as':'Agents','attributes':['id',_0x406f('0x3'),_0x406f('0x5'),_0x406f('0x6')]}]},'log':_0x406f('0x1')});};}; \ No newline at end of file +var _0x9576=['strategy','User','Agents','name','online','chatPause','../client','getChatQueues','Request','GetChatQueue'];(function(_0x4c2033,_0x30fc36){var _0x1290c8=function(_0x3fda4f){while(--_0x3fda4f){_0x4c2033['push'](_0x4c2033['shift']());}};_0x1290c8(++_0x30fc36);}(_0x9576,0x182));var _0x6957=function(_0x390d62,_0x3a478d){_0x390d62=_0x390d62-0x0;var _0x41a46f=_0x9576[_0x390d62];return _0x41a46f;};'use strict';var client=require(_0x6957('0x0'));exports[_0x6957('0x1')]=function(){return function(){return client[_0x6957('0x2')](_0x6957('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x6957('0x4')],'include':[{'model':_0x6957('0x5'),'as':_0x6957('0x6'),'attributes':['id',_0x6957('0x7'),_0x6957('0x8'),_0x6957('0x9')]}]},'log':_0x6957('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 3ec1b26..ba908b2 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 _0xc874=['../client','Request','update','UpdateChatQueueReport','DESC'];(function(_0x266539,_0x2511fe){var _0x4c8cf1=function(_0x3c9014){while(--_0x3c9014){_0x266539['push'](_0x266539['shift']());}};_0x4c8cf1(++_0x2511fe);}(_0xc874,0x154));var _0x4c87=function(_0x343e44,_0x519af9){_0x343e44=_0x343e44-0x0;var _0xa5130e=_0xc874[_0x343e44];return _0xa5130e;};'use strict';var client=require(_0x4c87('0x0'));exports['create']=function(_0x24f552){return client[_0x4c87('0x1')]('CreateChatQueueReport',{'body':_0x24f552,'log':'CreateChatQueueReport'});};exports[_0x4c87('0x2')]=function(_0x13c057,_0x1c3dbc){return client['Request'](_0x4c87('0x3'),{'body':_0x1c3dbc,'options':{'where':{'uniqueid':_0x13c057},'order':[['id',_0x4c87('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x25b5=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x4b6ad6,_0x106115){var _0x45422d=function(_0x504087){while(--_0x504087){_0x4b6ad6['push'](_0x4b6ad6['shift']());}};_0x45422d(++_0x106115);}(_0x25b5,0x198));var _0x525b=function(_0x18ce36,_0x15a276){_0x18ce36=_0x18ce36-0x0;var _0x430b70=_0x25b5[_0x18ce36];return _0x430b70;};'use strict';var client=require(_0x525b('0x0'));exports[_0x525b('0x1')]=function(_0x1c1c9b){return client[_0x525b('0x2')](_0x525b('0x3'),{'body':_0x1c1c9b,'log':'CreateChatQueueReport'});};exports[_0x525b('0x4')]=function(_0x59aba3,_0xae34c2){return client[_0x525b('0x2')](_0x525b('0x5'),{'body':_0xae34c2,'options':{'where':{'uniqueid':_0x59aba3},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 523f68c..0a5255e 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(_0x46c3d7,_0x45bf58){var _0x121592=function(_0x3b549a){while(--_0x3b549a){_0x46c3d7['push'](_0x46c3d7['shift']());}};_0x121592(++_0x45bf58);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3d2d10,_0x53d6c6){var _0x5a2231=function(_0x142a77){while(--_0x142a77){_0x3d2d10['push'](_0x3d2d10['shift']());}};_0x5a2231(++_0x53d6c6);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index bcac2cd..26e15b5 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 _0x48e7=['createFaxMessage','../client','Request'];(function(_0x3304c4,_0x3e555a){var _0x30730c=function(_0xfbef1b){while(--_0xfbef1b){_0x3304c4['push'](_0x3304c4['shift']());}};_0x30730c(++_0x3e555a);}(_0x48e7,0x1cf));var _0x748e=function(_0x4f746d,_0x5c0073){_0x4f746d=_0x4f746d-0x0;var _0xce1322=_0x48e7[_0x4f746d];return _0xce1322;};'use strict';var client=require(_0x748e('0x0'));exports['create']=function(_0x20bd6e){return client[_0x748e('0x1')]('CreateFaxMessage',{'body':_0x20bd6e,'log':_0x748e('0x2')});}; \ No newline at end of file +var _0xbba6=['CreateFaxMessage','create','Request'];(function(_0x37991c,_0x459b50){var _0x2b3918=function(_0x44629a){while(--_0x44629a){_0x37991c['push'](_0x37991c['shift']());}};_0x2b3918(++_0x459b50);}(_0xbba6,0xd0));var _0x6bba=function(_0x3c5e63,_0xafbd3f){_0x3c5e63=_0x3c5e63-0x0;var _0x4bef08=_0xbba6[_0x3c5e63];return _0x4bef08;};'use strict';var client=require('../client');exports[_0x6bba('0x0')]=function(_0x29e0c1){return client[_0x6bba('0x1')](_0x6bba('0x2'),{'body':_0x29e0c1,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 5d15736..09e178f 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 _0x59f9=['faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','online'];(function(_0x49ca69,_0x55157c){var _0x3d2e97=function(_0x12ff23){while(--_0x12ff23){_0x49ca69['push'](_0x49ca69['shift']());}};_0x3d2e97(++_0x55157c);}(_0x59f9,0x119));var _0x959f=function(_0x31cc0e,_0x24ba4c){_0x31cc0e=_0x31cc0e-0x0;var _0x144862=_0x59f9[_0x31cc0e];return _0x144862;};'use strict';var client=require(_0x959f('0x0'));exports[_0x959f('0x1')]=function(){return function(){return client[_0x959f('0x2')](_0x959f('0x3'),{'options':{'raw':![],'attributes':['id',_0x959f('0x4'),_0x959f('0x5'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x959f('0x4'),_0x959f('0x6'),_0x959f('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xd133=['timeout','strategy','User','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue'];(function(_0x430466,_0x560071){var _0x38eb1e=function(_0x202088){while(--_0x202088){_0x430466['push'](_0x430466['shift']());}};_0x38eb1e(++_0x560071);}(_0xd133,0x15b));var _0x3d13=function(_0x54fbcb,_0x21a10f){_0x54fbcb=_0x54fbcb-0x0;var _0x58e047=_0xd133[_0x54fbcb];return _0x58e047;};'use strict';var client=require(_0x3d13('0x0'));exports[_0x3d13('0x1')]=function(){return function(){return client[_0x3d13('0x2')](_0x3d13('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x3d13('0x4'),_0x3d13('0x5')],'include':[{'model':_0x3d13('0x6'),'as':'Agents','attributes':['id','name',_0x3d13('0x7'),_0x3d13('0x8')]}]},'log':_0x3d13('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 8d5bb7e..0c6c2b8 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 _0xb444=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x1826d0,_0x32a217){var _0xa7a757=function(_0x30574b){while(--_0x30574b){_0x1826d0['push'](_0x1826d0['shift']());}};_0xa7a757(++_0x32a217);}(_0xb444,0xcc));var _0x4b44=function(_0x5ce6dc,_0x16cdec){_0x5ce6dc=_0x5ce6dc-0x0;var _0x128837=_0xb444[_0x5ce6dc];return _0x128837;};'use strict';var client=require('../client');exports[_0x4b44('0x0')]=function(_0x3df092){return client[_0x4b44('0x1')](_0x4b44('0x2'),{'body':_0x3df092,'log':_0x4b44('0x2')});};exports[_0x4b44('0x3')]=function(_0x4e3797,_0x292511){return client['Request'](_0x4b44('0x4'),{'body':_0x292511,'options':{'where':{'uniqueid':_0x4e3797},'order':[['id',_0x4b44('0x5')]],'limit':0x1},'log':_0x4b44('0x4')});}; \ No newline at end of file +var _0x737d=['update','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x21a731,_0x292baf){var _0x17556b=function(_0x14a3f9){while(--_0x14a3f9){_0x21a731['push'](_0x21a731['shift']());}};_0x17556b(++_0x292baf);}(_0x737d,0xbc));var _0xd737=function(_0x162ad6,_0x4e0c2e){_0x162ad6=_0x162ad6-0x0;var _0x5e1067=_0x737d[_0x162ad6];return _0x5e1067;};'use strict';var client=require(_0xd737('0x0'));exports[_0xd737('0x1')]=function(_0x5afff2){return client['Request']('CreateFaxQueueReport',{'body':_0x5afff2,'log':'CreateFaxQueueReport'});};exports[_0xd737('0x2')]=function(_0x5ce3d6,_0x2f8396){return client['Request'](_0xd737('0x3'),{'body':_0x2f8396,'options':{'where':{'uniqueid':_0x5ce3d6},'order':[['id',_0xd737('0x4')]],'limit':0x1},'log':_0xd737('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 1b09625..25945ee 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 _0x605a=['Intervals','interval','getIntervals','../client','Request','GetInterval','name'];(function(_0x3be951,_0x9d9eed){var _0x53e527=function(_0x483a9f){while(--_0x483a9f){_0x3be951['push'](_0x3be951['shift']());}};_0x53e527(++_0x9d9eed);}(_0x605a,0x168));var _0xa605=function(_0x33c449,_0x3be818){_0x33c449=_0x33c449-0x0;var _0x3b8c80=_0x605a[_0x33c449];return _0x3b8c80;};'use strict';var client=require(_0xa605('0x0'));exports['getIntervals']=function(){return function(){return client[_0xa605('0x1')](_0xa605('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xa605('0x3')],'include':[{'model':'Interval','as':_0xa605('0x4'),'attributes':['id','name',_0xa605('0x5')]}]},'log':_0xa605('0x6')});};}; \ No newline at end of file +var _0xf51c=['getIntervals','../client','GetInterval','Intervals','name'];(function(_0x58f555,_0x552ef2){var _0x4eb99b=function(_0x110a86){while(--_0x110a86){_0x58f555['push'](_0x58f555['shift']());}};_0x4eb99b(++_0x552ef2);}(_0xf51c,0x13c));var _0xcf51=function(_0x238805,_0x6f2a8b){_0x238805=_0x238805-0x0;var _0x4f7022=_0xf51c[_0x238805];return _0x4f7022;};'use strict';var client=require(_0xcf51('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0xcf51('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0xcf51('0x2'),'attributes':['id',_0xcf51('0x3'),'interval']}]},'log':_0xcf51('0x4')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index f9fd40b..8e31275 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 _0xaebd=['updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','../client','Request','UpdateMailInteraction'];(function(_0x50b5f1,_0x23557a){var _0x49f7f7=function(_0x515671){while(--_0x515671){_0x50b5f1['push'](_0x50b5f1['shift']());}};_0x49f7f7(++_0x23557a);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x1d9457,_0x15049c){_0x1d9457=_0x1d9457-0x0;var _0xdc14d1=_0xaebd[_0x1d9457];return _0xdc14d1;};'use strict';var client=require(_0xdaeb('0x0'));exports['update']=function(_0x2e2d0c,_0xac84fd){return client[_0xdaeb('0x1')](_0xdaeb('0x2'),{'body':_0xac84fd,'options':{'where':{'id':_0x2e2d0c}},'log':_0xdaeb('0x3')});};exports['addTags']=function(_0x44e982,_0x1c617a){return client[_0xdaeb('0x1')](_0xdaeb('0x4'),{'body':_0x1c617a,'options':{'where':{'id':_0x44e982}},'log':_0xdaeb('0x5')});}; \ No newline at end of file +var _0x33af=['addTags','AddTagsToMailInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0x33af,0xec));var _0xf33a=function(_0x23ca4d,_0x5c2a32){_0x23ca4d=_0x23ca4d-0x0;var _0x435432=_0x33af[_0x23ca4d];return _0x435432;};'use strict';var client=require('../client');exports[_0xf33a('0x0')]=function(_0x54b114,_0x2137be){return client[_0xf33a('0x1')](_0xf33a('0x2'),{'body':_0x2137be,'options':{'where':{'id':_0x54b114}},'log':_0xf33a('0x3')});};exports[_0xf33a('0x4')]=function(_0x25f156,_0x4c734e){return client[_0xf33a('0x1')](_0xf33a('0x5'),{'body':_0x4c734e,'options':{'where':{'id':_0x25f156}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index aca8af8..33f4efc 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 _0xc202=['CreateMailMessage','createMailMessage','../client','Request'];(function(_0x3f88bc,_0xe38cf5){var _0x4df1c4=function(_0x111de1){while(--_0x111de1){_0x3f88bc['push'](_0x3f88bc['shift']());}};_0x4df1c4(++_0xe38cf5);}(_0xc202,0x1ae));var _0x2c20=function(_0x586794,_0x42c594){_0x586794=_0x586794-0x0;var _0x20fa81=_0xc202[_0x586794];return _0x20fa81;};'use strict';var client=require(_0x2c20('0x0'));exports['create']=function(_0x21c359){return client[_0x2c20('0x1')](_0x2c20('0x2'),{'body':_0x21c359,'log':_0x2c20('0x3')});}; \ No newline at end of file +var _0xc5d9=['../client','create'];(function(_0x499b78,_0x4ed368){var _0x5e4e9e=function(_0x19a0c6){while(--_0x19a0c6){_0x499b78['push'](_0x499b78['shift']());}};_0x5e4e9e(++_0x4ed368);}(_0xc5d9,0x1a0));var _0x9c5d=function(_0xc9ee72,_0x3fa61e){_0xc9ee72=_0xc9ee72-0x0;var _0x5eab12=_0xc5d9[_0xc9ee72];return _0x5eab12;};'use strict';var client=require(_0x9c5d('0x0'));exports[_0x9c5d('0x1')]=function(_0x581ed0){return client['Request']('CreateMailMessage',{'body':_0x581ed0,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index f23cbf4..004f3d9 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 _0x6d5c=['GetMailQueue','timeout','strategy','Agents','name','online','mailPause','../client','getMailQueues','Request'];(function(_0x162d70,_0x3192e8){var _0x3fd813=function(_0xf81745){while(--_0xf81745){_0x162d70['push'](_0x162d70['shift']());}};_0x3fd813(++_0x3192e8);}(_0x6d5c,0x179));var _0xc6d5=function(_0x2948fd,_0x427606){_0x2948fd=_0x2948fd-0x0;var _0x1bf851=_0x6d5c[_0x2948fd];return _0x1bf851;};'use strict';var client=require(_0xc6d5('0x0'));exports[_0xc6d5('0x1')]=function(){return function(){return client[_0xc6d5('0x2')](_0xc6d5('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xc6d5('0x4'),_0xc6d5('0x5')],'include':[{'model':'User','as':_0xc6d5('0x6'),'attributes':['id',_0xc6d5('0x7'),_0xc6d5('0x8'),_0xc6d5('0x9')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x6b96=['name','timeout','strategy','Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x34c02e,_0x496b1f){var _0x132dca=function(_0x5b857c){while(--_0x5b857c){_0x34c02e['push'](_0x34c02e['shift']());}};_0x132dca(++_0x496b1f);}(_0x6b96,0x1f0));var _0x66b9=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x6b96[_0x138adb];return _0x1b27f2;};'use strict';var client=require(_0x66b9('0x0'));exports[_0x66b9('0x1')]=function(){return function(){return client[_0x66b9('0x2')](_0x66b9('0x3'),{'options':{'raw':![],'attributes':['id',_0x66b9('0x4'),_0x66b9('0x5'),_0x66b9('0x6')],'include':[{'model':'User','as':_0x66b9('0x7'),'attributes':['id',_0x66b9('0x4'),_0x66b9('0x8'),_0x66b9('0x9')]}]},'log':_0x66b9('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 6476e69..b3f28d9 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 _0xfcff=['CreateMailQueueReport','UpdateMailQueueReport','DESC','create','Request'];(function(_0x39fd11,_0x5d7883){var _0x302799=function(_0x4a0615){while(--_0x4a0615){_0x39fd11['push'](_0x39fd11['shift']());}};_0x302799(++_0x5d7883);}(_0xfcff,0x10c));var _0xffcf=function(_0x5c451d,_0x5c76cf){_0x5c451d=_0x5c451d-0x0;var _0x10edfd=_0xfcff[_0x5c451d];return _0x10edfd;};'use strict';var client=require('../client');exports[_0xffcf('0x0')]=function(_0x949e16){return client[_0xffcf('0x1')](_0xffcf('0x2'),{'body':_0x949e16,'log':'CreateMailQueueReport'});};exports['update']=function(_0x24be8e,_0x32005b){return client[_0xffcf('0x1')](_0xffcf('0x3'),{'body':_0x32005b,'options':{'where':{'uniqueid':_0x24be8e},'order':[['id',_0xffcf('0x4')]],'limit':0x1},'log':_0xffcf('0x3')});}; \ No newline at end of file +var _0xad7d=['../client','create','Request','CreateMailQueueReport','UpdateMailQueueReport','DESC'];(function(_0x569054,_0x121f1e){var _0x22a321=function(_0x24086f){while(--_0x24086f){_0x569054['push'](_0x569054['shift']());}};_0x22a321(++_0x121f1e);}(_0xad7d,0x108));var _0xdad7=function(_0x2b5b96,_0x2bea13){_0x2b5b96=_0x2b5b96-0x0;var _0x9021d0=_0xad7d[_0x2b5b96];return _0x9021d0;};'use strict';var client=require(_0xdad7('0x0'));exports[_0xdad7('0x1')]=function(_0x454412){return client[_0xdad7('0x2')]('CreateMailQueueReport',{'body':_0x454412,'log':_0xdad7('0x3')});};exports['update']=function(_0x36787c,_0x5322ff){return client['Request'](_0xdad7('0x4'),{'body':_0x5322ff,'options':{'where':{'uniqueid':_0x36787c},'order':[['id',_0xdad7('0x5')]],'limit':0x1},'log':_0xdad7('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 100e0d1..ae1b250 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 _0x507e=['AddTagsToOpenchannelInteraction','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request'];(function(_0x4aaacb,_0x266135){var _0x361416=function(_0x55c26f){while(--_0x55c26f){_0x4aaacb['push'](_0x4aaacb['shift']());}};_0x361416(++_0x266135);}(_0x507e,0x11b));var _0xe507=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0x507e[_0x4e697a];return _0x88850c;};'use strict';var client=require('../client');exports[_0xe507('0x0')]=function(_0x4f9c56,_0x3fba3c){return client['Request'](_0xe507('0x1'),{'body':_0x3fba3c,'options':{'where':{'id':_0x4f9c56}},'log':_0xe507('0x2')});};exports[_0xe507('0x3')]=function(_0x106c05,_0x5c511e){return client[_0xe507('0x4')](_0xe507('0x5'),{'body':_0x5c511e,'options':{'where':{'id':_0x106c05}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xcbd8=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x159dac,_0x20124d){var _0x78d236=function(_0x562209){while(--_0x562209){_0x159dac['push'](_0x159dac['shift']());}};_0x78d236(++_0x20124d);}(_0xcbd8,0x7c));var _0x8cbd=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xcbd8[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0x8cbd('0x0'));exports[_0x8cbd('0x1')]=function(_0x2cb5fa,_0x598eed){return client[_0x8cbd('0x2')](_0x8cbd('0x3'),{'body':_0x598eed,'options':{'where':{'id':_0x2cb5fa}},'log':_0x8cbd('0x4')});};exports[_0x8cbd('0x5')]=function(_0x9ab88c,_0x290eda){return client[_0x8cbd('0x2')](_0x8cbd('0x6'),{'body':_0x290eda,'options':{'where':{'id':_0x9ab88c}},'log':_0x8cbd('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 1edaea4..3bd909b 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 _0x46d5=['CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x507d5a,_0x5f48bc){var _0x36572a=function(_0x35f020){while(--_0x35f020){_0x507d5a['push'](_0x507d5a['shift']());}};_0x36572a(++_0x5f48bc);}(_0x46d5,0x16a));var _0x546d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x46d5[_0x167cc1];return _0x10bc4b;};'use strict';var client=require('../client');exports[_0x546d('0x0')]=function(_0xcbbae5){return client['Request'](_0x546d('0x1'),{'body':_0xcbbae5,'log':_0x546d('0x2')});}; \ No newline at end of file +var _0xb0f2=['CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x3dd3b2,_0x39a5e4){var _0x3d8675=function(_0x5bc81b){while(--_0x5bc81b){_0x3dd3b2['push'](_0x3dd3b2['shift']());}};_0x3d8675(++_0x39a5e4);}(_0xb0f2,0x149));var _0x2b0f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb0f2[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x2b0f('0x0'));exports['create']=function(_0x43d03e){return client['Request'](_0x2b0f('0x1'),{'body':_0x43d03e,'log':_0x2b0f('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 546722b..027b1a2 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 _0x7ea8=['GetOpenchannelQueue','name','strategy','User','Agents','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0xb6cfbd,_0xad6da9){var _0x46e0fb=function(_0x29a353){while(--_0x29a353){_0xb6cfbd['push'](_0xb6cfbd['shift']());}};_0x46e0fb(++_0xad6da9);}(_0x7ea8,0x1d1));var _0x87ea=function(_0x1dd4d8,_0x1cef07){_0x1dd4d8=_0x1dd4d8-0x0;var _0x1a7273=_0x7ea8[_0x1dd4d8];return _0x1a7273;};'use strict';var client=require(_0x87ea('0x0'));exports[_0x87ea('0x1')]=function(){return function(){return client[_0x87ea('0x2')](_0x87ea('0x3'),{'options':{'raw':![],'attributes':['id',_0x87ea('0x4'),'timeout',_0x87ea('0x5')],'include':[{'model':_0x87ea('0x6'),'as':_0x87ea('0x7'),'attributes':['id','name','online',_0x87ea('0x8')]}]},'log':_0x87ea('0x1')});};}; \ No newline at end of file +var _0x2b5b=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','User','Agents','online','openchannelPause'];(function(_0x564654,_0x16d56a){var _0x55dd44=function(_0x11c8b3){while(--_0x11c8b3){_0x564654['push'](_0x564654['shift']());}};_0x55dd44(++_0x16d56a);}(_0x2b5b,0x196));var _0xb2b5=function(_0x3b0265,_0x54c4b6){_0x3b0265=_0x3b0265-0x0;var _0x4d6215=_0x2b5b[_0x3b0265];return _0x4d6215;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0xb2b5('0x0')](_0xb2b5('0x1'),{'options':{'raw':![],'attributes':['id',_0xb2b5('0x2'),_0xb2b5('0x3'),'strategy'],'include':[{'model':_0xb2b5('0x4'),'as':_0xb2b5('0x5'),'attributes':['id',_0xb2b5('0x2'),_0xb2b5('0x6'),_0xb2b5('0x7')]}]},'log':_0xb2b5('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index a883c42..b3d49e5 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 _0x9055=['DESC','../client','create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport'];(function(_0x1fcc1e,_0x39efee){var _0x13497a=function(_0x56d1fe){while(--_0x56d1fe){_0x1fcc1e['push'](_0x1fcc1e['shift']());}};_0x13497a(++_0x39efee);}(_0x9055,0xa2));var _0x5905=function(_0x28fe92,_0x403572){_0x28fe92=_0x28fe92-0x0;var _0x3ff255=_0x9055[_0x28fe92];return _0x3ff255;};'use strict';var client=require(_0x5905('0x0'));exports[_0x5905('0x1')]=function(_0x5e069f){return client['Request'](_0x5905('0x2'),{'body':_0x5e069f,'log':_0x5905('0x2')});};exports[_0x5905('0x3')]=function(_0x115bc2,_0x3667e8){return client[_0x5905('0x4')](_0x5905('0x5'),{'body':_0x3667e8,'options':{'where':{'uniqueid':_0x115bc2},'order':[['id',_0x5905('0x6')]],'limit':0x1},'log':_0x5905('0x5')});}; \ No newline at end of file +var _0x5b00=['Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','create'];(function(_0x4f5033,_0x289213){var _0x14a669=function(_0x42f50a){while(--_0x42f50a){_0x4f5033['push'](_0x4f5033['shift']());}};_0x14a669(++_0x289213);}(_0x5b00,0x113));var _0x05b0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5b00[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0x05b0('0x0')]=function(_0x52e305){return client[_0x05b0('0x1')](_0x05b0('0x2'),{'body':_0x52e305,'log':'CreateOpenchannelQueueReport'});};exports[_0x05b0('0x3')]=function(_0x40c575,_0x2321e0){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x2321e0,'options':{'where':{'uniqueid':_0x40c575},'order':[['id',_0x05b0('0x4')]],'limit':0x1},'log':_0x05b0('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index d73ec68..02566ec 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 _0xb7cf=['update','Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x49c541,_0x2db112){var _0x488f8d=function(_0x309d6c){while(--_0x309d6c){_0x49c541['push'](_0x49c541['shift']());}};_0x488f8d(++_0x2db112);}(_0xb7cf,0xca));var _0xfb7c=function(_0x486c22,_0x306c6d){_0x486c22=_0x486c22-0x0;var _0xbad918=_0xb7cf[_0x486c22];return _0xbad918;};'use strict';var client=require(_0xfb7c('0x0'));exports[_0xfb7c('0x1')]=function(_0x3baed3,_0x2c52ed){return client[_0xfb7c('0x2')]('UpdateSmsInteraction',{'body':_0x2c52ed,'options':{'where':{'id':_0x3baed3}},'log':_0xfb7c('0x3')});};exports[_0xfb7c('0x4')]=function(_0xf6b92f,_0xf47c1d){return client[_0xfb7c('0x2')](_0xfb7c('0x5'),{'body':_0xf47c1d,'options':{'where':{'id':_0xf6b92f}},'log':_0xfb7c('0x6')});}; \ No newline at end of file +var _0xc090=['AddTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x4299dd,_0x2ac483){var _0x1078c5=function(_0x179b78){while(--_0x179b78){_0x4299dd['push'](_0x4299dd['shift']());}};_0x1078c5(++_0x2ac483);}(_0xc090,0x112));var _0x0c09=function(_0x26878b,_0x1fdf2a){_0x26878b=_0x26878b-0x0;var _0x11acba=_0xc090[_0x26878b];return _0x11acba;};'use strict';var client=require(_0x0c09('0x0'));exports[_0x0c09('0x1')]=function(_0x29ed0e,_0xb5d246){return client[_0x0c09('0x2')](_0x0c09('0x3'),{'body':_0xb5d246,'options':{'where':{'id':_0x29ed0e}},'log':_0x0c09('0x4')});};exports[_0x0c09('0x5')]=function(_0x11984f,_0x487f03){return client[_0x0c09('0x2')](_0x0c09('0x6'),{'body':_0x487f03,'options':{'where':{'id':_0x11984f}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 70686ac..483a138 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 _0xedae=['createSmsMessage'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xedae,0xa4));var _0xeeda=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xedae[_0x2f3848];return _0x102668;};'use strict';var client=require('../client');exports['create']=function(_0x505560){return client['Request']('CreateSmsMessage',{'body':_0x505560,'log':_0xeeda('0x0')});}; \ No newline at end of file +var _0xb393=['CreateSmsMessage','../client','create','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb393,0x95));var _0x3b39=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb393[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x3b39('0x0'));exports[_0x3b39('0x1')]=function(_0x59d88a){return client[_0x3b39('0x2')](_0x3b39('0x3'),{'body':_0x59d88a,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 669183f..6792609 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 _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0xe4a6bf,_0x1aa34b){var _0x2702a7=function(_0x103f96){while(--_0x103f96){_0xe4a6bf['push'](_0xe4a6bf['shift']());}};_0x2702a7(++_0x1aa34b);}(_0xe706,0xa3));var _0x6e70=function(_0x5ecaab,_0x2f3053){_0x5ecaab=_0x5ecaab-0x0;var _0x3db1a8=_0xe706[_0x5ecaab];return _0x3db1a8;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x47c59c,_0x187686){var _0x4f8172=function(_0x2fe937){while(--_0x2fe937){_0x47c59c['push'](_0x47c59c['shift']());}};_0x4f8172(++_0x187686);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 2017802..b461dc6 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 _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x5864a4,_0x121187){var _0x391d49=function(_0x6caeae){while(--_0x6caeae){_0x5864a4['push'](_0x5864a4['shift']());}};_0x391d49(++_0x121187);}(_0x55ca,0x126));var _0xa55c=function(_0x8d8f23,_0x8c1961){_0x8d8f23=_0x8d8f23-0x0;var _0x22bf54=_0x55ca[_0x8d8f23];return _0x22bf54;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x399338,_0x11496b){var _0x3c4485=function(_0x17e385){while(--_0x17e385){_0x399338['push'](_0x399338['shift']());}};_0x3c4485(++_0x11496b);}(_0x008c,0x188));var _0xc008=function(_0x509b2a,_0xf91802){_0x509b2a=_0x509b2a-0x0;var _0x59ff9e=_0x008c[_0x509b2a];return _0x59ff9e;};'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 d1caca8..690bcd6 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(_0x10ef29,_0x246697){var _0x329848=function(_0x2f387b){while(--_0x2f387b){_0x10ef29['push'](_0x10ef29['shift']());}};_0x329848(++_0x246697);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0x39aee8,_0x4d77bf){var _0x29e23d=function(_0x4dfb0a){while(--_0x4dfb0a){_0x39aee8['push'](_0x39aee8['shift']());}};_0x29e23d(++_0x4d77bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 70da5e9..19b1b19 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 _0xa6ce=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','updateWhatsappInteraction','Request'];(function(_0x454820,_0x45f473){var _0x1a57c1=function(_0x537da1){while(--_0x537da1){_0x454820['push'](_0x454820['shift']());}};_0x1a57c1(++_0x45f473);}(_0xa6ce,0x15e));var _0xea6c=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0xa6ce[_0x86b219];return _0x1f320c;};'use strict';var client=require(_0xea6c('0x0'));exports['update']=function(_0x325367,_0x37bf44){return client['Request'](_0xea6c('0x1'),{'body':_0x37bf44,'options':{'where':{'id':_0x325367}},'log':_0xea6c('0x2')});};exports['addTags']=function(_0x5620a1,_0x2ac723){return client[_0xea6c('0x3')](_0xea6c('0x4'),{'body':_0x2ac723,'options':{'where':{'id':_0x5620a1}},'log':_0xea6c('0x5')});}; \ No newline at end of file +var _0x6363=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x207cd5,_0xbe974){var _0x3f690f=function(_0x2721dc){while(--_0x2721dc){_0x207cd5['push'](_0x207cd5['shift']());}};_0x3f690f(++_0xbe974);}(_0x6363,0x13a));var _0x3636=function(_0xc2a963,_0xe3799){_0xc2a963=_0xc2a963-0x0;var _0x494a75=_0x6363[_0xc2a963];return _0x494a75;};'use strict';var client=require(_0x3636('0x0'));exports['update']=function(_0x225b8a,_0x16d6df){return client[_0x3636('0x1')](_0x3636('0x2'),{'body':_0x16d6df,'options':{'where':{'id':_0x225b8a}},'log':_0x3636('0x3')});};exports[_0x3636('0x4')]=function(_0x1335a2,_0xdf836f){return client[_0x3636('0x1')](_0x3636('0x5'),{'body':_0xdf836f,'options':{'where':{'id':_0x1335a2}},'log':_0x3636('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 883843c..2f73971 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 _0x718e=['CreateWhatsappMessage','createWhatsappMessage','create','Request'];(function(_0x5b083b,_0x145a9b){var _0x6c2225=function(_0xcc6435){while(--_0xcc6435){_0x5b083b['push'](_0x5b083b['shift']());}};_0x6c2225(++_0x145a9b);}(_0x718e,0x11e));var _0xe718=function(_0x4941c6,_0x3ca9f8){_0x4941c6=_0x4941c6-0x0;var _0x4d3654=_0x718e[_0x4941c6];return _0x4d3654;};'use strict';var client=require('../client');exports[_0xe718('0x0')]=function(_0x2f88b6){return client[_0xe718('0x1')](_0xe718('0x2'),{'body':_0x2f88b6,'log':_0xe718('0x3')});}; \ No newline at end of file +var _0xf97c=['createWhatsappMessage','Request','CreateWhatsappMessage'];(function(_0x18066e,_0x4d3cdd){var _0x19ee91=function(_0x444cc0){while(--_0x444cc0){_0x18066e['push'](_0x18066e['shift']());}};_0x19ee91(++_0x4d3cdd);}(_0xf97c,0xc7));var _0xcf97=function(_0x332597,_0x33648e){_0x332597=_0x332597-0x0;var _0x70870e=_0xf97c[_0x332597];return _0x70870e;};'use strict';var client=require('../client');exports['create']=function(_0x182ab4){return client[_0xcf97('0x0')](_0xcf97('0x1'),{'body':_0x182ab4,'log':_0xcf97('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index d42e55e..ad6d2b7 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 _0xb00d=['Agents','online','whatsappPause','getWhatsappQueues','../client','GetWhatsappQueue','name','timeout','strategy','User'];(function(_0x5b26cb,_0x527ab0){var _0x563d12=function(_0x472b38){while(--_0x472b38){_0x5b26cb['push'](_0x5b26cb['shift']());}};_0x563d12(++_0x527ab0);}(_0xb00d,0xfe));var _0xdb00=function(_0x47b7c9,_0x3848b2){_0x47b7c9=_0x47b7c9-0x0;var _0x435aaf=_0xb00d[_0x47b7c9];return _0x435aaf;};'use strict';var client=require(_0xdb00('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0xdb00('0x1'),{'options':{'raw':![],'attributes':['id',_0xdb00('0x2'),_0xdb00('0x3'),_0xdb00('0x4')],'include':[{'model':_0xdb00('0x5'),'as':_0xdb00('0x6'),'attributes':['id','name',_0xdb00('0x7'),_0xdb00('0x8')]}]},'log':_0xdb00('0x9')});};}; \ No newline at end of file +var _0x2bb5=['name','timeout','User','Agents','online','whatsappPause','getWhatsappQueues','../client','Request','GetWhatsappQueue'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0x2bb5,0x179));var _0x52bb=function(_0x2a6490,_0x1adf0f){_0x2a6490=_0x2a6490-0x0;var _0x1b31df=_0x2bb5[_0x2a6490];return _0x1b31df;};'use strict';var client=require(_0x52bb('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x52bb('0x1')](_0x52bb('0x2'),{'options':{'raw':![],'attributes':['id',_0x52bb('0x3'),_0x52bb('0x4'),'strategy'],'include':[{'model':_0x52bb('0x5'),'as':_0x52bb('0x6'),'attributes':['id',_0x52bb('0x3'),_0x52bb('0x7'),_0x52bb('0x8')]}]},'log':_0x52bb('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index fe6a3c8..ab64721 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 _0xc15a=['update','DESC','UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0xc15a,0x16f));var _0xac15=function(_0x4592c1,_0x42da6c){_0x4592c1=_0x4592c1-0x0;var _0x207a18=_0xc15a[_0x4592c1];return _0x207a18;};'use strict';var client=require(_0xac15('0x0'));exports[_0xac15('0x1')]=function(_0x341eea){return client[_0xac15('0x2')]('CreateWhatsappQueueReport',{'body':_0x341eea,'log':_0xac15('0x3')});};exports[_0xac15('0x4')]=function(_0x5f2e58,_0x1b2a1e){return client[_0xac15('0x2')]('UpdateWhatsappQueueReport',{'body':_0x1b2a1e,'options':{'where':{'uniqueid':_0x5f2e58},'order':[['id',_0xac15('0x5')]],'limit':0x1},'log':_0xac15('0x6')});}; \ No newline at end of file +var _0x606d=['Request','update','UpdateWhatsappQueueReport','DESC','../client','create'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x606d,0x1ea));var _0xd606=function(_0x41c7bb,_0x5355bc){_0x41c7bb=_0x41c7bb-0x0;var _0x3611ab=_0x606d[_0x41c7bb];return _0x3611ab;};'use strict';var client=require(_0xd606('0x0'));exports[_0xd606('0x1')]=function(_0x43bc2b){return client[_0xd606('0x2')]('CreateWhatsappQueueReport',{'body':_0x43bc2b,'log':'CreateWhatsappQueueReport'});};exports[_0xd606('0x3')]=function(_0x3ed977,_0x205667){return client[_0xd606('0x2')](_0xd606('0x4'),{'body':_0x205667,'options':{'where':{'uniqueid':_0x3ed977},'order':[['id',_0xd606('0x5')]],'limit':0x1},'log':_0xd606('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 4fd90c4..fbc87f1 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 _0xebcd=['end','info','close','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','string','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','map','message','join','stop','agents','timeout','createQueue','channel','START:%s','rules'];(function(_0x4db010,_0x2a8951){var _0x4e25ab=function(_0x5a3b4c){while(--_0x5a3b4c){_0x4db010['push'](_0x4db010['shift']());}};_0x4e25ab(++_0x2a8951);}(_0xebcd,0x1c9));var _0xdebc=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0xebcd[_0x506d83];return _0x335e8b;};'use strict';var schema=require(_0xdebc('0x0'));var _=require(_0xdebc('0x1'));var util=require('util');var seqqueue=require(_0xdebc('0x2'));var logger=require('../../../../config/logger')('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0xdebc('0x3'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xdebc('0x4'),'message':_0xdebc('0x5')}});function writeLog(_0x3c5b29,_0x2c7104,_0x10e875){return logger['info'](util[_0xdebc('0x6')](_0xdebc('0x7'),_0x3c5b29,_0x2c7104[_0xdebc('0x8')],_0x10e875));}function handleFindAgent(_0x261f5f){return function(_0x320a24){return _0x320a24[_0xdebc('0x8')][_0xdebc('0x9')]()===_0x261f5f['toLowerCase']();};}exports['consequence']=function(_0x5928ef,_0x150d77,_0x4e87c7,_0x321ed0){return function(_0x151a4c){try{var _0x1fe963={'name':_0x150d77[0x0],'timeout':_0x150d77[0x1]};var _0x31680a=queue[_0xdebc('0x0')](_0x1fe963,{'typecast':!![]});if(_0x31680a[_0xdebc('0xa')]){logger[_0xdebc('0xb')](_0xdebc('0xc'),_0x5928ef,_[_0xdebc('0xd')](_0x31680a,_0xdebc('0xe'))[_0xdebc('0xf')](',\x20'));_0x151a4c[_0xdebc('0x10')]();}else{var _0x2eee15=_['find'](_0x4e87c7[_0xdebc('0x11')],handleFindAgent(_0x1fe963[_0xdebc('0x8')]));if(_0x2eee15){var _0xfa1ed6=(_0x1fe963[_0xdebc('0x12')]||0xa)*0x3e8;var _0x29d7ab,_0x3819b1;var _0xeadc9=seqqueue[_0xdebc('0x13')](_0xfa1ed6);_0xeadc9['id']=_0x5928ef;_0xeadc9['atimeout']=_0xfa1ed6;_0xeadc9[_0xdebc('0x14')]=_0x321ed0[_0xdebc('0x14')];writeLog(_0x5928ef,_0x2eee15,util[_0xdebc('0x6')](_0xdebc('0x15'),_0xfa1ed6));_0x4e87c7[_0xdebc('0x16')][_0x5928ef]['on'](_0xdebc('0x17'),function(){logger[_0xdebc('0x18')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x5928ef);clearTimeout(_0x3819b1);_0x3819b1=undefined;_0xeadc9[_0xdebc('0x19')]();if(_0x4e87c7[_0xdebc('0x16')][_0x5928ef]){delete _0x4e87c7[_0xdebc('0x16')][_0x5928ef];}_0x151a4c[_0xdebc('0x10')]();});_0x4e87c7[_0xdebc('0x16')][_0x5928ef]['on']('complete',function(){if(_0x4e87c7[_0xdebc('0x16')][_0x5928ef]){delete _0x4e87c7[_0xdebc('0x16')][_0x5928ef];}});_0x3819b1=setTimeout(function(){logger['info'](_0xdebc('0x1a'),_0x5928ef);clearTimeout(_0x3819b1);_0xeadc9[_0xdebc('0x19')]();_0x151a4c['next']();},_0xfa1ed6);strategy[_0xdebc('0x1b')](_0xeadc9,_0x2eee15,_0x4e87c7,_0x321ed0);}else{logger['error'](_0xdebc('0x1c'),_0x5928ef,_0x1fe963[_0xdebc('0x8')]);_0x151a4c['stop']();}}}catch(_0x672c44){console[_0xdebc('0x1d')](_0x672c44);logger[_0xdebc('0xb')](_0xdebc('0x1e'),_0x5928ef,_0x672c44[_0xdebc('0x1f')]);_0x151a4c['stop']();}};}; \ No newline at end of file +var _0x88b9=['[%s][AGENT]\x20%s','map','stop','agents','name','timeout','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','lodash','util','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','validate','length','error'];(function(_0x555026,_0x47a7cb){var _0x4961a6=function(_0x2c6461){while(--_0x2c6461){_0x555026['push'](_0x555026['shift']());}};_0x4961a6(++_0x47a7cb);}(_0x88b9,0x166));var _0x988b=function(_0x59ddc5,_0x34a0da){_0x59ddc5=_0x59ddc5-0x0;var _0x1a9c27=_0x88b9[_0x59ddc5];return _0x1a9c27;};'use strict';var schema=require('validate');var _=require(_0x988b('0x0'));var util=require(_0x988b('0x1'));var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')(_0x988b('0x2'));var strategy=require(_0x988b('0x3'));var queue=schema({'name':{'type':_0x988b('0x4'),'required':!![],'message':_0x988b('0x5')},'timeout':{'type':_0x988b('0x6'),'message':_0x988b('0x7')}});function writeLog(_0x2e1f4c,_0x41ec13,_0x23eb0b){return logger[_0x988b('0x8')](util[_0x988b('0x9')](_0x988b('0xa'),_0x2e1f4c,_0x41ec13['name'],_0x23eb0b));}function handleFindAgent(_0x3c4d8e){return function(_0x1ac7d7){return _0x1ac7d7['name'][_0x988b('0xb')]()===_0x3c4d8e[_0x988b('0xb')]();};}exports[_0x988b('0xc')]=function(_0x1e6796,_0x2fde8d,_0x18d9bd,_0x4dc710){return function(_0x11750e){try{var _0x13eadd={'name':_0x2fde8d[0x0],'timeout':_0x2fde8d[0x1]};var _0x440720=queue[_0x988b('0xd')](_0x13eadd,{'typecast':!![]});if(_0x440720[_0x988b('0xe')]){logger[_0x988b('0xf')](_0x988b('0x10'),_0x1e6796,_[_0x988b('0x11')](_0x440720,'message')['join'](',\x20'));_0x11750e[_0x988b('0x12')]();}else{var _0x350183=_['find'](_0x18d9bd[_0x988b('0x13')],handleFindAgent(_0x13eadd[_0x988b('0x14')]));if(_0x350183){var _0x5669b9=(_0x13eadd[_0x988b('0x15')]||0xa)*0x3e8;var _0x2856ed,_0x19565f;var _0x293b16=seqqueue['createQueue'](_0x5669b9);_0x293b16['id']=_0x1e6796;_0x293b16[_0x988b('0x16')]=_0x5669b9;_0x293b16[_0x988b('0x17')]=_0x4dc710['channel'];writeLog(_0x1e6796,_0x350183,util[_0x988b('0x9')](_0x988b('0x18'),_0x5669b9));_0x18d9bd[_0x988b('0x19')][_0x1e6796]['on'](_0x988b('0x1a'),function(){logger[_0x988b('0x8')](_0x988b('0x1b'),_0x1e6796);clearTimeout(_0x19565f);_0x19565f=undefined;_0x293b16[_0x988b('0x1c')]();if(_0x18d9bd[_0x988b('0x19')][_0x1e6796]){delete _0x18d9bd['rules'][_0x1e6796];}_0x11750e['stop']();});_0x18d9bd[_0x988b('0x19')][_0x1e6796]['on'](_0x988b('0x1d'),function(){if(_0x18d9bd[_0x988b('0x19')][_0x1e6796]){delete _0x18d9bd['rules'][_0x1e6796];}});_0x19565f=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x1e6796);clearTimeout(_0x19565f);_0x293b16[_0x988b('0x1c')]();_0x11750e[_0x988b('0x1e')]();},_0x5669b9);strategy[_0x988b('0x1f')](_0x293b16,_0x350183,_0x18d9bd,_0x4dc710);}else{logger['error'](_0x988b('0x20'),_0x1e6796,_0x13eadd[_0x988b('0x14')]);_0x11750e[_0x988b('0x12')]();}}}catch(_0x1408f7){console['log'](_0x1408f7);logger[_0x988b('0xf')](_0x988b('0x21'),_0x1e6796,_0x1408f7['stack']);_0x11750e[_0x988b('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 8ecd90c..54b5ecc 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 _0x2834=['Message','then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerResponse','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','sms','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender'];(function(_0x3c6616,_0x13bc5c){var _0x3faf7a=function(_0x5610b4){while(--_0x5610b4){_0x3c6616['push'](_0x3c6616['shift']());}};_0x3faf7a(++_0x13bc5c);}(_0x2834,0x10a));var _0x4283=function(_0x51a153,_0x154509){_0x51a153=_0x51a153-0x0;var _0x1aabd5=_0x2834[_0x51a153];return _0x1aabd5;};'use strict';var _=require(_0x4283('0x0'));var moment=require(_0x4283('0x1'));var AWS=require(_0x4283('0x2'));var utils=require(_0x4283('0x3'));var logger=require(_0x4283('0x4'))(_0x4283('0x5'));var rpc={'chatMessage':require(_0x4283('0x6')),'openchannelMessage':require(_0x4283('0x7')),'mailMessage':require(_0x4283('0x8')),'smsMessage':require(_0x4283('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x4283('0xa'))};exports[_0x4283('0xb')]=function(_0x24c6c2,_0x23750a){return function(_0xaf58e2){try{if(!_['isNil'](this['interaction'][_0x4283('0xc')])){logger[_0x4283('0xd')](_0x4283('0xe'),_0x24c6c2,_0x4283('0xf'));return _0xaf58e2[_0x4283('0x10')]();}var _0xa10808={'ContactId':this[_0x4283('0x11')]['id'],'sentAt':moment()[_0x4283('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x4283('0x13')};if(this['channel']===_0x4283('0x14')||this[_0x4283('0x15')]===_0x4283('0x16')){_0xa10808[_0x4283('0x17')]=this[_0x4283('0x18')]['phone'];}var _0x14f22a=this[_0x4283('0x15')];if(_0x14f22a===_0x4283('0x19')){_0xa10808[_0x4283('0x1a')]=this['account']['id'];}else{_0xa10808[_[_0x4283('0x1b')](_0x14f22a)+_0x4283('0x1c')]=this[_0x4283('0x1d')]['id'];}_0xa10808[_[_0x4283('0x1b')](_0x14f22a)+_0x4283('0x1e')]=this[_0x4283('0x18')]['id'];if(this[_0x4283('0x18')][_0x4283('0x1f')]){var _0x1ea1ef=_0x23750a[0x4];if(!_[_0x4283('0x20')](_0x1ea1ef)){_0xa10808['body']=utils[_0x4283('0x21')](_0x1ea1ef,this);return rpc[_0x14f22a+_0x4283('0x22')]['create'](_0xa10808)[_0x4283('0x23')](function(_0x1c996d){logger[_0x4283('0xd')]('[%s][AMAZONLEX]\x20%s',_0x24c6c2,_0xa10808[_0x4283('0x24')]);})[_0x4283('0x25')](function(_0xbfa2aa){logger[_0x4283('0x26')]('[%s][AMAZONLEX]\x20%s',_0x24c6c2,JSON[_0x4283('0x27')](_0xbfa2aa));})[_0x4283('0x28')](function(){logger[_0x4283('0xd')](_0x4283('0x29'),_0x24c6c2);_0xaf58e2[_0x4283('0x2a')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x24c6c2);_0xaf58e2[_0x4283('0x2a')]();}}else{var _0x25f603=this;var _0x2edc56=new AWS[(_0x4283('0x2b'))]({'accessKeyId':_0x23750a[0x0],'secretAccessKey':_0x23750a[0x1],'region':_0x23750a[0x2]});var _0x4f8d1c={'botAlias':_0x4283('0x2c'),'botName':_0x23750a[0x3],'inputText':this[_0x4283('0x2d')][_0x4283('0x24')],'userId':this['channel']+':'+this['interaction']['id'][_0x4283('0x2e')]()};_0x2edc56[_0x4283('0x2f')](_0x4f8d1c,function(_0x21c483,_0x14d394){if(_0x21c483){logger['error'](_0x4283('0xe'),_0x24c6c2,_0x21c483[_0x4283('0x2d')]);_0xaf58e2[_0x4283('0x10')]();}else if(_0x14d394&&_0x14d394[_0x4283('0x2d')]){_0x25f603[_0x4283('0x24')]['amazonlex']=_0x14d394;_0xa10808[_0x4283('0x24')]=_0x14d394[_0x4283('0x2d')];_0xa10808['providerName']=_0x4283('0x30');_0xa10808[_0x4283('0x31')]=JSON[_0x4283('0x27')](_0x14d394);return rpc[_0x14f22a+_0x4283('0x22')]['create'](_0xa10808)[_0x4283('0x23')](function(_0x46a435){logger[_0x4283('0xd')](_0x4283('0xe'),_0x24c6c2,_0xa10808[_0x4283('0x24')]);if(_0x14d394['dialogState']=='Failed'){_0xaf58e2['next']();}else{_0xaf58e2[_0x4283('0x2a')]();}})[_0x4283('0x25')](function(_0x9194c7){logger['error'](_0x4283('0xe'),_0x24c6c2,JSON['stringify'](_0x9194c7));_0xaf58e2[_0x4283('0x10')]();});}else{_0xaf58e2[_0x4283('0x10')]();}});}}catch(_0x27d149){logger[_0x4283('0x26')](_0x4283('0xe'),_0x24c6c2,JSON[_0x4283('0x27')](_0x27d149));_0xaf58e2[_0x4283('0x2a')]();}};}; \ No newline at end of file +var _0xf122=['aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','next','contact','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','upperFirst','AccountId','account','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','info','[%s][AMAZONLEX]\x20%s','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','error','amazonlex','providerName','Failed','lodash','moment'];(function(_0x6cbe6d,_0x37bba3){var _0x25e1c9=function(_0x2f8868){while(--_0x2f8868){_0x6cbe6d['push'](_0x6cbe6d['shift']());}};_0x25e1c9(++_0x37bba3);}(_0xf122,0x11e));var _0x2f12=function(_0x714597,_0x596490){_0x714597=_0x714597-0x0;var _0x3229be=_0xf122[_0x714597];return _0x3229be;};'use strict';var _=require(_0x2f12('0x0'));var moment=require(_0x2f12('0x1'));var AWS=require(_0x2f12('0x2'));var utils=require(_0x2f12('0x3'));var logger=require(_0x2f12('0x4'))('routing');var rpc={'chatMessage':require(_0x2f12('0x5')),'openchannelMessage':require(_0x2f12('0x6')),'mailMessage':require(_0x2f12('0x7')),'smsMessage':require(_0x2f12('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x2f12('0x9'))};exports[_0x2f12('0xa')]=function(_0x34a1a7,_0x2f88a4){return function(_0x45932c){try{if(!_[_0x2f12('0xb')](this[_0x2f12('0xc')][_0x2f12('0xd')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x34a1a7,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x45932c[_0x2f12('0xe')]();}var _0x32debf={'ContactId':this[_0x2f12('0xf')]['id'],'sentAt':moment()['format'](_0x2f12('0x10')),'direction':'out'};if(this['channel']===_0x2f12('0x11')||this[_0x2f12('0x12')]===_0x2f12('0x13')){_0x32debf[_0x2f12('0x14')]=this['interaction']['phone'];}var _0x3d0aa0=this['channel'];if(_0x3d0aa0==='chat'){_0x32debf['ChatWebsiteId']=this['account']['id'];}else{_0x32debf[_[_0x2f12('0x15')](_0x3d0aa0)+_0x2f12('0x16')]=this[_0x2f12('0x17')]['id'];}_0x32debf[_['upperFirst'](_0x3d0aa0)+_0x2f12('0x18')]=this['interaction']['id'];if(this[_0x2f12('0xc')]['created']){var _0x16a07b=_0x2f88a4[0x4];if(!_[_0x2f12('0x19')](_0x16a07b)){_0x32debf[_0x2f12('0x1a')]=utils[_0x2f12('0x1b')](_0x16a07b,this);return rpc[_0x3d0aa0+_0x2f12('0x1c')][_0x2f12('0x1d')](_0x32debf)[_0x2f12('0x1e')](function(_0x580d74){logger[_0x2f12('0x1f')](_0x2f12('0x20'),_0x34a1a7,_0x32debf[_0x2f12('0x1a')]);})[_0x2f12('0x21')](function(_0x409adb){logger['error'](_0x2f12('0x20'),_0x34a1a7,JSON[_0x2f12('0x22')](_0x409adb));})[_0x2f12('0x23')](function(){logger[_0x2f12('0x1f')](_0x2f12('0x24'),_0x34a1a7);_0x45932c[_0x2f12('0x25')]();});}else{logger[_0x2f12('0x1f')](_0x2f12('0x26'),_0x34a1a7);_0x45932c[_0x2f12('0x25')]();}}else{var _0x9efa4=this;var _0x26fcaf=new AWS[(_0x2f12('0x27'))]({'accessKeyId':_0x2f88a4[0x0],'secretAccessKey':_0x2f88a4[0x1],'region':_0x2f88a4[0x2]});var _0xfe79e0={'botAlias':_0x2f12('0x28'),'botName':_0x2f88a4[0x3],'inputText':this[_0x2f12('0x29')][_0x2f12('0x1a')],'userId':this[_0x2f12('0x12')]+':'+this['interaction']['id'][_0x2f12('0x2a')]()};_0x26fcaf[_0x2f12('0x2b')](_0xfe79e0,function(_0x11cf53,_0x434716){if(_0x11cf53){logger[_0x2f12('0x2c')](_0x2f12('0x20'),_0x34a1a7,_0x11cf53['message']);_0x45932c[_0x2f12('0xe')]();}else if(_0x434716&&_0x434716['message']){_0x9efa4[_0x2f12('0x1a')][_0x2f12('0x2d')]=_0x434716;_0x32debf[_0x2f12('0x1a')]=_0x434716[_0x2f12('0x29')];_0x32debf[_0x2f12('0x2e')]=_0x2f12('0x2d');_0x32debf['providerResponse']=JSON[_0x2f12('0x22')](_0x434716);return rpc[_0x3d0aa0+_0x2f12('0x1c')][_0x2f12('0x1d')](_0x32debf)[_0x2f12('0x1e')](function(_0x39bffe){logger[_0x2f12('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x34a1a7,_0x32debf[_0x2f12('0x1a')]);if(_0x434716['dialogState']==_0x2f12('0x2f')){_0x45932c[_0x2f12('0xe')]();}else{_0x45932c['stop']();}})[_0x2f12('0x21')](function(_0xde4f7f){logger[_0x2f12('0x2c')](_0x2f12('0x20'),_0x34a1a7,JSON[_0x2f12('0x22')](_0xde4f7f));_0x45932c[_0x2f12('0xe')]();});}else{_0x45932c['next']();}});}}catch(_0x585c59){logger['error'](_0x2f12('0x20'),_0x34a1a7,JSON[_0x2f12('0x22')](_0x585c59));_0x45932c[_0x2f12('0x25')]();}};}; \ 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 8852439..4e43569 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 _0xdc2a=[''];(function(_0x22431e,_0x5af0a3){var _0xd978e9=function(_0x2bbdd7){while(--_0x2bbdd7){_0x22431e['push'](_0x22431e['shift']());}};_0xd978e9(++_0x5af0a3);}(_0xdc2a,0x166));var _0xadc2=function(_0x4fb667,_0x54bca8){_0x4fb667=_0x4fb667-0x0;var _0x18a9f2=_0xdc2a[_0x4fb667];return _0x18a9f2;};'use strict';var _=require(_0xadc2('0x0'));var moment=require(_0xadc2('0x1'));var utils=require('./utils');var logger=require(_0xadc2('0x2'))(_0xadc2('0x3'));var rpc={'chatMessage':require(_0xadc2('0x4')),'openchannelMessage':require(_0xadc2('0x5')),'mailMessage':require(_0xadc2('0x6')),'smsMessage':require(_0xadc2('0x7')),'faxMessage':require(_0xadc2('0x8')),'whatsappMessage':require(_0xadc2('0x9')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xadc2('0xa')),'mailInteraction':require(_0xadc2('0xb')),'smsInteraction':require(_0xadc2('0xc')),'faxInteraction':require(_0xadc2('0xd')),'whatsappInteraction':require(_0xadc2('0xe'))};var mailRpc=require('../../mailRpc');exports[_0xadc2('0xf')]=function(_0x3d34e0,_0x529914,_0x243025,_0x586bb4){return function(_0x333598){try{var _0x52c01a=this[_0xadc2('0x10')];if(_0x52c01a===_0xadc2('0x11')&&_0x586bb4[_0xadc2('0x12')][_0xadc2('0x13')]){logger['info'](_0xadc2('0x14'),_0x3d34e0,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x333598[_0xadc2('0x15')]();}if(_0x529914[0x0]==='1'&&(_[_0xadc2('0x16')](this[_0xadc2('0x17')][_0xadc2('0x18')])||!this[_0xadc2('0x17')][_0xadc2('0x18')])){logger['info'](_0xadc2('0x14'),_0x3d34e0,'Autoreply\x20already\x20sent');return _0x333598[_0xadc2('0x15')]();}if(_0x529914[0x0]==='2'&&this['interaction'][_0xadc2('0x19')]){logger[_0xadc2('0x1a')](_0xadc2('0x1b'),_0x3d34e0,_0xadc2('0x1c'));return _0x333598[_0xadc2('0x15')]();}var _0xf1c3f={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xadc2('0x1d')),'direction':_0xadc2('0x1e')};if(this[_0xadc2('0x10')]===_0xadc2('0x11')){_0xf1c3f[_0xadc2('0x12')]=utils['getMustacheRender'](_0x529914[0x2],this);}else{_0xf1c3f[_0xadc2('0x12')]=utils[_0xadc2('0x1f')](_0x529914[0x1],this);}if(this[_0xadc2('0x20')]){_0xf1c3f['to']=this[_0xadc2('0x20')]['from']||'';if(this[_0xadc2('0x10')]===_0xadc2('0x11')&&_0x529914[0x1]==='1'){_0xf1c3f['cc']=this['message']['cc']||'';}_0xf1c3f[_0xadc2('0x21')]=this[_0xadc2('0x20')]['to']||'';_0xf1c3f[_0xadc2('0x22')]=this[_0xadc2('0x20')][_0xadc2('0x22')]||'';_0xf1c3f[_0xadc2('0x23')]=!![];if(this[_0xadc2('0x20')][_0xadc2('0x24')]){_0xf1c3f['subject']='';_0xf1c3f[_0xadc2('0x24')]+=_[_0xadc2('0x25')](this['message'][_0xadc2('0x24')],_0xadc2('0x26'))?'':_0xadc2('0x27');_0xf1c3f[_0xadc2('0x24')]+=this['message']['subject'];}}if(this['channel']===_0xadc2('0x28')){_0xf1c3f[_0xadc2('0x29')]=this[_0xadc2('0x2a')]['id'];}else{_0xf1c3f[_[_0xadc2('0x2b')](this[_0xadc2('0x10')])+_0xadc2('0x2c')]=this[_0xadc2('0x2a')]['id'];}_0xf1c3f[_[_0xadc2('0x2b')](this[_0xadc2('0x10')])+_0xadc2('0x2d')]=this['interaction']['id'];var _0x5d7dfa=this[_0xadc2('0x17')];if(rpc[this[_0xadc2('0x10')]+_0xadc2('0x2e')]){if(this[_0xadc2('0x10')]===_0xadc2('0x11')){_0xf1c3f[_0xadc2('0x2f')]=this[_0xadc2('0x20')][_0xadc2('0x30')];_0xf1c3f['html']=_0xadc2('0x31')+_['replace'](_0xf1c3f[_0xadc2('0x12')],_0xadc2('0x32'),_0xadc2('0x33'))+'';_0xf1c3f[_0xadc2('0x34')]={'Auto-Submitted':_0xadc2('0x35'),'X-Auto-Response-Suppress':_0xadc2('0x36'),'Precedence':_0xadc2('0x37')};return mailRpc[_0xadc2('0x38')](this[_0xadc2('0x2a')]['smtpOptions'],_0xf1c3f)[_0xadc2('0x39')](function(_0x449af0){logger[_0xadc2('0x1a')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3d34e0);_0xf1c3f[_0xadc2('0x30')]=_0x449af0['message'][_0xadc2('0x30')];return rpc[_0x52c01a+'Message'][_0xadc2('0x3a')](_0xf1c3f);})[_0xadc2('0x39')](function(_0x59bb10){logger[_0xadc2('0x1a')](_0xadc2('0x14'),_0x3d34e0,JSON['stringify'](_0x59bb10));})[_0xadc2('0x3b')](function(_0x70aad0){logger[_0xadc2('0x3c')](_0xadc2('0x3d'),_0x3d34e0,JSON[_0xadc2('0x3e')](_0x70aad0));})[_0xadc2('0x3f')](function(){Promise['resolve']()[_0xadc2('0x39')](function(){if(_0x529914[0x0]!=='2'||_0x5d7dfa[_0xadc2('0x19')])return;return rpc[_0x52c01a+'Interaction'][_0xadc2('0x40')](_0x5d7dfa['id'],{'autoreplyExecuted':!![]})[_0xadc2('0x39')](function(_0x1d7eaf){logger['info'](_0xadc2('0x1b'),_0x3d34e0,JSON['stringify'](_0x1d7eaf));})[_0xadc2('0x3b')](function(_0xc5177){logger[_0xadc2('0x3c')](_0xadc2('0x41'),_0x3d34e0,JSON[_0xadc2('0x3e')](_0xc5177));});})[_0xadc2('0x39')](function(){_0x333598[_0xadc2('0x15')]();});});}else{return rpc[this['channel']+_0xadc2('0x2e')]['create'](_0xf1c3f)[_0xadc2('0x39')](function(){logger[_0xadc2('0x1a')](_0xadc2('0x14'),_0x3d34e0,_0xf1c3f[_0xadc2('0x12')]);})[_0xadc2('0x3b')](function(_0x4ca404){logger[_0xadc2('0x3c')](_0xadc2('0x14'),_0x3d34e0,JSON['stringify'](_0x4ca404));})[_0xadc2('0x3f')](function(){Promise[_0xadc2('0x42')]()['then'](function(){if(_0x529914[0x0]!=='2'||_0x5d7dfa[_0xadc2('0x19')])return;return rpc[_0x52c01a+_0xadc2('0x43')][_0xadc2('0x40')](_0x5d7dfa['id'],{'autoreplyExecuted':!![]})[_0xadc2('0x39')](function(_0x5840d1){logger['info'](_0xadc2('0x1b'),_0x3d34e0,JSON[_0xadc2('0x3e')](_0x5840d1));})['catch'](function(_0x39da12){logger[_0xadc2('0x3c')](_0xadc2('0x41'),_0x3d34e0,JSON[_0xadc2('0x3e')](_0x39da12));});})[_0xadc2('0x39')](function(){_0x333598[_0xadc2('0x15')]();});});}}}catch(_0x730173){logger[_0xadc2('0x3c')](_0xadc2('0x14'),_0x3d34e0,JSON[_0xadc2('0x3e')](_0x730173));_0x333598['stop']();}};}; \ No newline at end of file +var _0xc031=['[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','Message','create','stringify','catch','error','finally','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','format','out','channel','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','inReplyTo','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','then'];(function(_0x121562,_0x433c53){var _0x19e699=function(_0x22ee90){while(--_0x22ee90){_0x121562['push'](_0x121562['shift']());}};_0x19e699(++_0x433c53);}(_0xc031,0xdd));var _0x1c03=function(_0x435dde,_0x2a2fa3){_0x435dde=_0x435dde-0x0;var _0x4aca2d=_0xc031[_0x435dde];return _0x4aca2d;};'use strict';var _=require(_0x1c03('0x0'));var moment=require('moment');var utils=require(_0x1c03('0x1'));var logger=require('../../../../config/logger')(_0x1c03('0x2'));var rpc={'chatMessage':require(_0x1c03('0x3')),'openchannelMessage':require(_0x1c03('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1c03('0x5')),'faxMessage':require(_0x1c03('0x6')),'whatsappMessage':require(_0x1c03('0x7')),'chatInteraction':require(_0x1c03('0x8')),'openchannelInteraction':require(_0x1c03('0x9')),'mailInteraction':require(_0x1c03('0xa')),'smsInteraction':require(_0x1c03('0xb')),'faxInteraction':require(_0x1c03('0xc')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x1c03('0xd'));exports['consequence']=function(_0x4009c4,_0x100a6f,_0x233c9d,_0x4adfff){return function(_0x15897e){try{var _0x76596d=this['channel'];if(_0x76596d===_0x1c03('0xe')&&_0x4adfff[_0x1c03('0xf')][_0x1c03('0x10')]){logger[_0x1c03('0x11')](_0x1c03('0x12'),_0x4009c4,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x15897e[_0x1c03('0x13')]();}if(_0x100a6f[0x0]==='1'&&(_[_0x1c03('0x14')](this[_0x1c03('0x15')][_0x1c03('0x16')])||!this['interaction'][_0x1c03('0x16')])){logger[_0x1c03('0x11')](_0x1c03('0x12'),_0x4009c4,_0x1c03('0x17'));return _0x15897e['next']();}if(_0x100a6f[0x0]==='2'&&this[_0x1c03('0x15')][_0x1c03('0x18')]){logger[_0x1c03('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4009c4,_0x1c03('0x19'));return _0x15897e[_0x1c03('0x13')]();}var _0x4aacfb={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1c03('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x1c03('0x1b')};if(this[_0x1c03('0x1c')]===_0x1c03('0xe')){_0x4aacfb['body']=utils[_0x1c03('0x1d')](_0x100a6f[0x2],this);}else{_0x4aacfb[_0x1c03('0xf')]=utils[_0x1c03('0x1d')](_0x100a6f[0x1],this);}if(this[_0x1c03('0x1e')]){_0x4aacfb['to']=this[_0x1c03('0x1e')][_0x1c03('0x1f')]||'';if(this[_0x1c03('0x1c')]===_0x1c03('0xe')&&_0x100a6f[0x1]==='1'){_0x4aacfb['cc']=this['message']['cc']||'';}_0x4aacfb[_0x1c03('0x1f')]=this[_0x1c03('0x1e')]['to']||'';_0x4aacfb['phone']=this[_0x1c03('0x1e')][_0x1c03('0x20')]||'';_0x4aacfb[_0x1c03('0x21')]=!![];if(this['message']['subject']){_0x4aacfb[_0x1c03('0x22')]='';_0x4aacfb[_0x1c03('0x22')]+=_[_0x1c03('0x23')](this[_0x1c03('0x1e')][_0x1c03('0x22')],_0x1c03('0x24'))?'':_0x1c03('0x25');_0x4aacfb[_0x1c03('0x22')]+=this[_0x1c03('0x1e')][_0x1c03('0x22')];}}if(this[_0x1c03('0x1c')]===_0x1c03('0x26')){_0x4aacfb[_0x1c03('0x27')]=this[_0x1c03('0x28')]['id'];}else{_0x4aacfb[_[_0x1c03('0x29')](this[_0x1c03('0x1c')])+_0x1c03('0x2a')]=this['account']['id'];}_0x4aacfb[_[_0x1c03('0x29')](this[_0x1c03('0x1c')])+_0x1c03('0x2b')]=this[_0x1c03('0x15')]['id'];var _0x206fc9=this[_0x1c03('0x15')];if(rpc[this[_0x1c03('0x1c')]+'Message']){if(this['channel']===_0x1c03('0xe')){_0x4aacfb[_0x1c03('0x2c')]=this[_0x1c03('0x1e')]['messageId'];_0x4aacfb['html']=_0x1c03('0x2d')+_[_0x1c03('0x2e')](_0x4aacfb['body'],_0x1c03('0x2f'),']+(>|$)/g,''),'priorityTrue':_0x1e4d4f[0x1],'priorityFalse':_0x1e4d4f[0x2]};var _0x4f58d3=gotoif[_0x0bfe('0x0')](_0x2f7da0,{'typecast':!![]});if(_0x4f58d3[_0x0bfe('0xc')]){logger[_0x0bfe('0xd')](_0x0bfe('0xe'),_0x259bb8,_[_0x0bfe('0xf')](_0x4f58d3,_0x0bfe('0x10'))[_0x0bfe('0x11')](',\x20'));_0x5b8d1e[_0x0bfe('0x12')]();}else{try{var _0x1f318a=eval('('+_0x2f7da0[_0x0bfe('0x13')]+')');var _0x168caa=_0x1f318a?_0x2f7da0['priorityTrue']:_0x2f7da0[_0x0bfe('0x14')];logger[_0x0bfe('0x15')](_0x0bfe('0x16'),_0x259bb8,_0x2f7da0[_0x0bfe('0x13')],_0x1f318a,_0x168caa||_0x0bfe('0x17'));if(_0x168caa){var _0x2892ad=_[_0x0bfe('0x18')](_0x5b8d1e[_0x0bfe('0x19')](),{'p':_0x168caa});if(_0x2892ad>=0x0){logger['info'](_0x0bfe('0x1a'),_0x259bb8,_0x168caa||_0x0bfe('0x17'),_0x2892ad);_0x5b8d1e['next'](_0x2892ad);}else{logger[_0x0bfe('0x15')](_0x0bfe('0x1b'),_0x259bb8,_0x168caa||_0x0bfe('0x17'));_0x5b8d1e[_0x0bfe('0x12')]();}}else{_0x5b8d1e[_0x0bfe('0x17')]();}}catch(_0x24f06f){logger[_0x0bfe('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x259bb8,_0x24f06f[_0x0bfe('0x10')]);_0x5b8d1e[_0x0bfe('0x12')]();}}}catch(_0x29159d){logger['error'](_0x0bfe('0xe'),_0x259bb8,JSON[_0x0bfe('0x1c')](_0x29159d));_0x5b8d1e[_0x0bfe('0x12')]();}};}; \ No newline at end of file +var _0x9481=['priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','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','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','message','stop'];(function(_0x5dd3b1,_0x2e259b){var _0x2af759=function(_0x52e638){while(--_0x52e638){_0x5dd3b1['push'](_0x5dd3b1['shift']());}};_0x2af759(++_0x2e259b);}(_0x9481,0x1db));var _0x1948=function(_0x4b0a34,_0x126bd8){_0x4b0a34=_0x4b0a34-0x0;var _0x5733af=_0x9481[_0x4b0a34];return _0x5733af;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0x1948('0x0'));var utils=require(_0x1948('0x1'));var logger=require(_0x1948('0x2'))(_0x1948('0x3'));var gotoif=schema({'condition':{'type':_0x1948('0x4'),'required':!![],'message':_0x1948('0x5')},'priorityTrue':{'type':_0x1948('0x6'),'message':_0x1948('0x7')},'priorityFalse':{'type':_0x1948('0x6'),'message':_0x1948('0x8')}});exports[_0x1948('0x9')]=function(_0x4bce2c,_0x4bb41e){return function(_0x36a5bb){try{var _0x25e55f={'condition':htmlToText[_0x1948('0xa')](utils[_0x1948('0xb')](_0x4bb41e[0x0],this),{'wordwrap':![]})[_0x1948('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4bb41e[0x1],'priorityFalse':_0x4bb41e[0x2]};var _0x2f8397=gotoif['validate'](_0x25e55f,{'typecast':!![]});if(_0x2f8397[_0x1948('0xd')]){logger[_0x1948('0xe')](_0x1948('0xf'),_0x4bce2c,_['map'](_0x2f8397,_0x1948('0x10'))['join'](',\x20'));_0x36a5bb[_0x1948('0x11')]();}else{try{var _0x4bce27=eval('('+_0x25e55f['condition']+')');var _0x5e1c9b=_0x4bce27?_0x25e55f[_0x1948('0x12')]:_0x25e55f['priorityFalse'];logger[_0x1948('0x13')](_0x1948('0x14'),_0x4bce2c,_0x25e55f[_0x1948('0x15')],_0x4bce27,_0x5e1c9b||_0x1948('0x16'));if(_0x5e1c9b){var _0x54c188=_[_0x1948('0x17')](_0x36a5bb[_0x1948('0x18')](),{'p':_0x5e1c9b});if(_0x54c188>=0x0){logger['info'](_0x1948('0x19'),_0x4bce2c,_0x5e1c9b||_0x1948('0x16'),_0x54c188);_0x36a5bb['next'](_0x54c188);}else{logger[_0x1948('0x13')](_0x1948('0x1a'),_0x4bce2c,_0x5e1c9b||_0x1948('0x16'));_0x36a5bb[_0x1948('0x11')]();}}else{_0x36a5bb[_0x1948('0x16')]();}}catch(_0xca11ba){logger[_0x1948('0xe')](_0x1948('0x1b'),_0x4bce2c,_0xca11ba[_0x1948('0x10')]);_0x36a5bb[_0x1948('0x11')]();}}}catch(_0xbe7598){logger[_0x1948('0xe')](_0x1948('0xf'),_0x4bce2c,JSON[_0x1948('0x1c')](_0xbe7598));_0x36a5bb[_0x1948('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 f73b432..5afc089 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 _0x2b7e=['validate','lodash','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','stop'];(function(_0xf02ce1,_0x515949){var _0x370f1d=function(_0x22e882){while(--_0x22e882){_0xf02ce1['push'](_0xf02ce1['shift']());}};_0x370f1d(++_0x515949);}(_0x2b7e,0x98));var _0xe2b7=function(_0x6939c2,_0x21592c){_0x6939c2=_0x6939c2-0x0;var _0xc07023=_0x2b7e[_0x6939c2];return _0xc07023;};'use strict';var schema=require(_0xe2b7('0x0'));var _=require(_0xe2b7('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0xe2b7('0x2'),'required':!![],'message':_0xe2b7('0x3')}});exports[_0xe2b7('0x4')]=function(_0x330d95,_0x15f3eb){return function(_0x1e7436){try{var _0x2effce={'priority':_0x15f3eb[0x0]};var _0x2a069d=gotop[_0xe2b7('0x0')](_0x2effce,{'typecast':!![]});if(_0x2a069d[_0xe2b7('0x5')]){logger[_0xe2b7('0x6')](_0xe2b7('0x7'),_0x330d95,_[_0xe2b7('0x8')](_0x2a069d,_0xe2b7('0x9'))[_0xe2b7('0xa')](',\x20'));_0x1e7436['stop']();}else{logger[_0xe2b7('0xb')](_0xe2b7('0xc'),_0x330d95,_0x2effce[_0xe2b7('0xd')]);if(_0x2effce['priority']){var _0x2ba585=_[_0xe2b7('0xe')](_0x1e7436['rules'](),{'p':_0x2effce[_0xe2b7('0xd')]});if(_0x2ba585>=0x0){logger[_0xe2b7('0xb')](_0xe2b7('0xf'),_0x330d95,_0x2effce[_0xe2b7('0xd')]||_0xe2b7('0x10'),_0x2ba585);_0x1e7436[_0xe2b7('0x10')](_0x2ba585);}else{logger[_0xe2b7('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x330d95,_0x2effce['priority']||_0xe2b7('0x10'));_0x1e7436['stop']();}}else{_0x1e7436[_0xe2b7('0x10')]();}}}catch(_0x1a93b0){logger[_0xe2b7('0x6')](_0xe2b7('0x7'),_0x330d95,JSON[_0xe2b7('0x11')](_0x1a93b0));_0x1e7436[_0xe2b7('0x12')]();}};}; \ No newline at end of file +var _0x1a8d=['error','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','map','join','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info'];(function(_0x3eee78,_0x5acc63){var _0x53a5e5=function(_0x472fb6){while(--_0x472fb6){_0x3eee78['push'](_0x3eee78['shift']());}};_0x53a5e5(++_0x5acc63);}(_0x1a8d,0x1ca));var _0xd1a8=function(_0x459ab1,_0x1b0e7b){_0x459ab1=_0x459ab1-0x0;var _0x2ac4a1=_0x1a8d[_0x459ab1];return _0x2ac4a1;};'use strict';var schema=require(_0xd1a8('0x0'));var _=require(_0xd1a8('0x1'));var logger=require(_0xd1a8('0x2'))(_0xd1a8('0x3'));var gotop=schema({'priority':{'type':_0xd1a8('0x4'),'required':!![],'message':_0xd1a8('0x5')}});exports[_0xd1a8('0x6')]=function(_0x22a8e6,_0x57ad9a){return function(_0x3d31c5){try{var _0x4d09a6={'priority':_0x57ad9a[0x0]};var _0x3cac2a=gotop['validate'](_0x4d09a6,{'typecast':!![]});if(_0x3cac2a[_0xd1a8('0x7')]){logger['error'](_0xd1a8('0x8'),_0x22a8e6,_[_0xd1a8('0x9')](_0x3cac2a,'message')[_0xd1a8('0xa')](',\x20'));_0x3d31c5['stop']();}else{logger['info'](_0xd1a8('0xb'),_0x22a8e6,_0x4d09a6[_0xd1a8('0xc')]);if(_0x4d09a6[_0xd1a8('0xc')]){var _0x226410=_['findIndex'](_0x3d31c5[_0xd1a8('0xd')](),{'p':_0x4d09a6[_0xd1a8('0xc')]});if(_0x226410>=0x0){logger['info'](_0xd1a8('0xe'),_0x22a8e6,_0x4d09a6[_0xd1a8('0xc')]||_0xd1a8('0xf'),_0x226410);_0x3d31c5[_0xd1a8('0xf')](_0x226410);}else{logger[_0xd1a8('0x10')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x22a8e6,_0x4d09a6[_0xd1a8('0xc')]||_0xd1a8('0xf'));_0x3d31c5['stop']();}}else{_0x3d31c5[_0xd1a8('0xf')]();}}}catch(_0x7041d9){logger[_0xd1a8('0x11')](_0xd1a8('0x8'),_0x22a8e6,JSON[_0xd1a8('0x12')](_0x7041d9));_0x3d31c5['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index f67d992..4c9ba25 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 _0xbac0=['lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xbac0,0x8c));var _0x0bac=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0xbac0[_0x555b2f];return _0x81c0a6;};'use strict';var _=require(_0x0bac('0x0'));var utils=require('./utils');var logger=require(_0x0bac('0x1'))(_0x0bac('0x2'));var rpc={'chatMessage':require(_0x0bac('0x3')),'openchannelMessage':require(_0x0bac('0x4')),'mailMessage':require(_0x0bac('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x0bac('0x6')),'whatsappMessage':require(_0x0bac('0x7'))};exports[_0x0bac('0x8')]=function(_0x9b156c,_0x19619c){return function(_0x4654e9){try{var _0x2ad9ce={'body':utils[_0x0bac('0x9')](_0x19619c[0x0],this),'ContactId':this[_0x0bac('0xa')]['id']};if(this[_0x0bac('0xb')]===_0x0bac('0xc')){_0x2ad9ce[_0x0bac('0xd')]=this[_0x0bac('0xe')]['id'];}else{_0x2ad9ce[_[_0x0bac('0xf')](this['channel'])+'AccountId']=this[_0x0bac('0xe')]['id'];}_0x2ad9ce[_[_0x0bac('0xf')](this['channel'])+_0x0bac('0x10')]=this[_0x0bac('0x11')]['id'];if(rpc[this[_0x0bac('0xb')]+_0x0bac('0x12')]){return rpc[this['channel']+_0x0bac('0x12')][_0x0bac('0x13')](_0x2ad9ce)[_0x0bac('0x14')](function(_0x108e02){logger[_0x0bac('0x15')](_0x0bac('0x16'),_0x9b156c,_0x2ad9ce[_0x0bac('0x17')]);_0x4654e9[_0x0bac('0x18')]();})[_0x0bac('0x19')](function(_0x5b9089){logger[_0x0bac('0x1a')](_0x0bac('0x16'),_0x9b156c,JSON[_0x0bac('0x1b')](_0x5b9089));_0x4654e9['stop']();});}}catch(_0x36b2d3){logger[_0x0bac('0x1a')](_0x0bac('0x16'),_0x9b156c,JSON[_0x0bac('0x1b')](_0x36b2d3));_0x4654e9['stop']();}};}; \ No newline at end of file +var _0xce9e=['channel','AccountId','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','chat','ChatWebsiteId','account','upperFirst'];(function(_0x1ec65c,_0x354923){var _0x5249c2=function(_0x451341){while(--_0x451341){_0x1ec65c['push'](_0x1ec65c['shift']());}};_0x5249c2(++_0x354923);}(_0xce9e,0x1c8));var _0xece9=function(_0x1e4e22,_0x567aad){_0x1e4e22=_0x1e4e22-0x0;var _0x5a26ea=_0xce9e[_0x1e4e22];return _0x5a26ea;};'use strict';var _=require(_0xece9('0x0'));var utils=require(_0xece9('0x1'));var logger=require(_0xece9('0x2'))('routing');var rpc={'chatMessage':require(_0xece9('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xece9('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xece9('0x5'))};exports[_0xece9('0x6')]=function(_0x318e48,_0x27c0c0){return function(_0x139aaf){try{var _0xa03386={'body':utils[_0xece9('0x7')](_0x27c0c0[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0xece9('0x8')){_0xa03386[_0xece9('0x9')]=this[_0xece9('0xa')]['id'];}else{_0xa03386[_[_0xece9('0xb')](this[_0xece9('0xc')])+_0xece9('0xd')]=this[_0xece9('0xa')]['id'];}_0xa03386[_[_0xece9('0xb')](this[_0xece9('0xc')])+_0xece9('0xe')]=this[_0xece9('0xf')]['id'];if(rpc[this[_0xece9('0xc')]+_0xece9('0x10')]){return rpc[this[_0xece9('0xc')]+_0xece9('0x10')][_0xece9('0x11')](_0xa03386)[_0xece9('0x12')](function(_0x426864){logger['info'](_0xece9('0x13'),_0x318e48,_0xa03386[_0xece9('0x14')]);_0x139aaf[_0xece9('0x15')]();})[_0xece9('0x16')](function(_0x2f8a35){logger[_0xece9('0x17')](_0xece9('0x13'),_0x318e48,JSON[_0xece9('0x18')](_0x2f8a35));_0x139aaf[_0xece9('0x19')]();});}}catch(_0x3a0071){logger[_0xece9('0x17')](_0xece9('0x13'),_0x318e48,JSON[_0xece9('0x18')](_0x3a0071));_0x139aaf[_0xece9('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 852ab4e..97d1b32 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 _0x991b=['../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stop','./utils'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x991b,0x185));var _0xb991=function(_0x31d53f,_0x4c8826){_0x31d53f=_0x31d53f-0x0;var _0x438d91=_0x991b[_0x31d53f];return _0x438d91;};'use strict';var utils=require(_0xb991('0x0'));var logger=require(_0xb991('0x1'))(_0xb991('0x2'));exports[_0xb991('0x3')]=function(_0x9b3809,_0x1bb374){return function(_0x15b633){try{logger[_0xb991('0x4')](_0xb991('0x5'),_0x9b3809,utils[_0xb991('0x6')](_0x1bb374[0x0],this));_0x15b633[_0xb991('0x7')]();}catch(_0x4a5bd5){logger[_0xb991('0x8')]('[%s][NOOP]\x20%s',_0x9b3809,JSON['stringify'](_0x4a5bd5));_0x15b633[_0xb991('0x9')]();}};}; \ No newline at end of file +var _0x054e=['next','error','stringify','stop','./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x054e,0x7c));var _0xe054=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0x054e[_0x2cde0a];return _0x260610;};'use strict';var utils=require(_0xe054('0x0'));var logger=require(_0xe054('0x1'))(_0xe054('0x2'));exports[_0xe054('0x3')]=function(_0x2f1f66,_0x45366d){return function(_0x401297){try{logger['info'](_0xe054('0x4'),_0x2f1f66,utils[_0xe054('0x5')](_0x45366d[0x0],this));_0x401297[_0xe054('0x6')]();}catch(_0x1cbccc){logger[_0xe054('0x7')](_0xe054('0x4'),_0x2f1f66,JSON[_0xe054('0x8')](_0x1cbccc));_0x401297[_0xe054('0x9')]();}};}; \ 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 61bd620..fbe2a1e 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 _0x52e1=['close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','log','stack','validate','lodash','util','moment','../../../../config/environment','../../../../config/logger','routing','redis','defaults','queue_id','queue','from','joinAt','emit','account','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','MessageId','message','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','accepted','error','update\x20queue\x20report','timeout','info','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','find','Queues','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED'];(function(_0x4b01b7,_0x183b04){var _0x2ed185=function(_0x4a1222){while(--_0x4a1222){_0x4b01b7['push'](_0x4b01b7['shift']());}};_0x2ed185(++_0x183b04);}(_0x52e1,0x175));var _0x152e=function(_0x2aeb58,_0x575b09){_0x2aeb58=_0x2aeb58-0x0;var _0x1f5acc=_0x52e1[_0x2aeb58];return _0x1f5acc;};'use strict';var schema=require(_0x152e('0x0'));var _=require(_0x152e('0x1'));var util=require(_0x152e('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x152e('0x3'));var Redis=require('ioredis');var config=require(_0x152e('0x4'));var logger=require(_0x152e('0x5'))(_0x152e('0x6'));var strategy=require('./strategy');config[_0x152e('0x7')]=_[_0x152e('0x8')](config[_0x152e('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x152e('0x7')]));var attributes=['id',_0x152e('0x9'),'account',_0x152e('0xa'),_0x152e('0xb'),_0x152e('0xc')];function emit(_0x6de60e,_0x2c4ecc,_0x55762f){io['to'](_0x6de60e)[_0x152e('0xd')](_0x2c4ecc,_0x55762f);}function emitChannelQueueInteraction(_0x409740,_0x2b77b6,_0x1f9ea6,_0x1f72d1,_0x232c15,_0x427da8,_0xe9454a,_0x53c899){var _0x5e2cb3=_['clone'](_0x1f9ea6);_0x5e2cb3['queue_id']=_0x53c899;_0x5e2cb3[_0x152e('0xa')]=_0x2b77b6;_0x5e2cb3[_0x152e('0xe')]=_0x1f72d1;_0x5e2cb3['id']=_0x232c15;if(_0x427da8){_0xe9454a[util[_0x152e('0xf')](_0x152e('0x10'),_0x409740)][_0x232c15]=_['pick'](_0x5e2cb3,attributes);}else{delete _0xe9454a[util[_0x152e('0xf')]('%sQueuesWaitingInteractions',_0x409740)][_0x232c15];}emit(util[_0x152e('0xf')](_0x152e('0x11'),_0x409740,_0x2b77b6),util[_0x152e('0xf')](_0x152e('0x12'),_0x409740,_0x427da8?_0x152e('0x13'):_0x152e('0x14')),_['pick'](_0x5e2cb3,attributes));}var rpc={'openchannelQueueReport':require(_0x152e('0x15')),'mailQueueReport':require(_0x152e('0x16')),'chatQueueReport':require(_0x152e('0x17')),'smsQueueReport':require(_0x152e('0x18')),'faxQueueReport':require(_0x152e('0x19')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x152e('0x1a'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x152e('0x1b'),'message':_0x152e('0x1c')}});function startRouting(_0x30ecb5,_0x788b66,_0x16528d,_0x6115ee){if(_0x30ecb5&&_0x788b66&&_0x16528d){_0x788b66[_0x152e('0x1d')]+=0x1;var _0x4e924c={'uniqueid':_0x30ecb5,'from':_0x16528d[_0x152e('0x1e')]?_0x16528d[_0x152e('0x1e')][_0x152e('0xb')]:'','joinAt':moment()[_0x152e('0xf')](_0x152e('0x1f')),'ContactId':_0x16528d[_0x152e('0x20')]?_0x16528d[_0x152e('0x20')]['id']:null,'ListId':_0x16528d[_0x152e('0x21')]?_0x16528d[_0x152e('0x21')]['id']:null};_0x4e924c[_[_0x152e('0x22')](_0x16528d[_0x152e('0x23')])+_0x152e('0x24')]=_0x788b66['id']||null;_0x4e924c[_[_0x152e('0x22')](_0x16528d[_0x152e('0x23')])+_0x152e('0x25')]=_0x16528d['interaction']?_0x16528d['interaction']['id']:null;_0x4e924c[_['upperFirst'](_0x16528d[_0x152e('0x23')])+_0x152e('0x26')]=_0x16528d[_0x152e('0x27')]?_0x16528d[_0x152e('0x27')]['id']:null;_0x4e924c[_[_0x152e('0x22')](_0x16528d[_0x152e('0x23')])+(_0x16528d[_0x152e('0x23')]!=='chat'?_0x152e('0x28'):_0x152e('0x29'))]=_0x16528d[_0x152e('0xe')]?_0x16528d[_0x152e('0xe')]['id']:null;logger['info'](util['format'](_0x152e('0x2a'),_0x30ecb5,_0x788b66[_0x152e('0x2b')]));emitChannelQueueInteraction(_0x16528d[_0x152e('0x23')],_0x788b66['name'],_0x4e924c,_0x16528d[_0x152e('0xe')][_0x152e('0x2b')],_0x16528d['message']['id'],!![],_0x6115ee,_0x788b66['id']);if(rpc[_0x16528d[_0x152e('0x23')]+_0x152e('0x2c')]){return rpc[_0x16528d['channel']+_0x152e('0x2c')][_0x152e('0x2d')](_0x4e924c)[_0x152e('0x2e')](function(_0x51e4b3){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x4e8f80,_0x131343,_0x130ddd,_0x280ef3){if(_0x4e8f80&&_0x131343){_0x131343[_0x152e('0x1d')]-=0x1;var _0x57f913={'leaveAt':moment()[_0x152e('0xf')](_0x152e('0x1f')),'acceptAt':moment()[_0x152e('0xf')](_0x152e('0x1f')),'reason':_0x152e('0x2f')};logger['info'](util[_0x152e('0xf')]('[%s][STOP:QUEUE][NAME:%s]',_0x4e8f80,_0x131343[_0x152e('0x2b')]));emitChannelQueueInteraction(_0x130ddd['channel'],_0x131343[_0x152e('0x2b')],_0x130ddd[_0x152e('0x1e')],_0x130ddd[_0x152e('0xe')][_0x152e('0x2b')],_0x130ddd[_0x152e('0x27')]['id'],![],_0x280ef3,_0x131343['id']);if(rpc[_0x130ddd['channel']+_0x152e('0x2c')]){return rpc[_0x130ddd[_0x152e('0x23')]+'QueueReport']['update'](_0x4e8f80,_0x57f913)[_0x152e('0x2e')](function(_0x4141b9){logger[_0x152e('0x30')](_0x152e('0x31'));});}}}function endRouting(_0x1e4ef5,_0x203495,_0x12ca82,_0x5adb11){if(_0x1e4ef5&&_0x203495){_0x203495[_0x152e('0x1d')]-=0x1;var _0x164569={'leaveAt':moment()[_0x152e('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x152e('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x152e('0x32')};logger[_0x152e('0x33')](util[_0x152e('0xf')](_0x152e('0x34'),_0x1e4ef5,_0x203495[_0x152e('0x2b')]));emitChannelQueueInteraction(_0x12ca82[_0x152e('0x23')],_0x203495[_0x152e('0x2b')],_0x12ca82[_0x152e('0x1e')],_0x12ca82[_0x152e('0xe')][_0x152e('0x2b')],_0x12ca82[_0x152e('0x27')]['id'],![],_0x5adb11);if(rpc[_0x12ca82[_0x152e('0x23')]+_0x152e('0x2c')]){return rpc[_0x12ca82[_0x152e('0x23')]+_0x152e('0x2c')]['update'](_0x1e4ef5,_0x164569)[_0x152e('0x2e')](function(_0x4ba71d){logger[_0x152e('0x30')](_0x152e('0x31'));});}}}function handleFindQueue(_0x5e5607){return function(_0x3bfd52){return _0x3bfd52[_0x152e('0x2b')][_0x152e('0x35')]()===_0x5e5607[_0x152e('0x35')]();};}exports[_0x152e('0x36')]=function(_0x1f32d7,_0x4ea09a,_0x3f3658,_0x40eadb){return function(_0x254d05){try{var _0x4016ff={'name':_0x4ea09a[0x0],'timeout':_0x4ea09a[0x1]};var _0x1b8d8d=queue[_0x152e('0x0')](_0x4016ff,{'typecast':!![]});if(_0x1b8d8d[_0x152e('0x37')]){logger[_0x152e('0x30')](_0x152e('0x38'),_0x1f32d7,_[_0x152e('0x39')](_0x1b8d8d,_0x152e('0x27'))['join'](',\x20'));_0x254d05['stop']();}else{var _0x226206=_[_0x152e('0x3a')](_0x3f3658[_0x40eadb[_0x152e('0x23')]+_0x152e('0x3b')],handleFindQueue(_0x4016ff['name']));if(_0x226206){startRouting(_0x1f32d7,_0x226206,_0x40eadb,_0x3f3658);var _0x504885=(_0x226206[_0x152e('0x32')]||0xa)*0x3e8;var _0x5b3fdf=(_0x4016ff[_0x152e('0x32')]||0x14)*0x3e8;var _0x42271d,_0x3ab9f6;if(_0x504885>_0x5b3fdf){_0x5b3fdf=_0x504885;}var _0x37bb14=seqqueue['createQueue'](_0x504885);_0x37bb14['id']=_0x1f32d7;_0x37bb14[_0x152e('0x3c')]=_0x504885;_0x37bb14[_0x152e('0x3d')]=_0x5b3fdf;_0x37bb14[_0x152e('0x23')]=_0x40eadb[_0x152e('0x23')];_0x3f3658[_0x152e('0x3e')][_0x1f32d7]['on'](_0x152e('0x3f'),function(){logger['info'](_0x152e('0x40'),_0x1f32d7);stopRouting(_0x1f32d7,_0x226206,_0x40eadb,_0x3f3658);clearTimeout(_0x42271d);_0x42271d=undefined;_0x37bb14[_0x152e('0x41')](!![]);if(_0x3f3658[_0x152e('0x3e')][_0x1f32d7]){delete _0x3f3658[_0x152e('0x3e')][_0x1f32d7];}_0x254d05[_0x152e('0x42')]();});_0x3f3658[_0x152e('0x3e')][_0x1f32d7]['on'](_0x152e('0x43'),function(){if(_0x3f3658[_0x152e('0x3e')][_0x1f32d7]){delete _0x3f3658[_0x152e('0x3e')][_0x1f32d7];}});_0x42271d=setTimeout(function(){logger['info'](_0x152e('0x44'),_0x1f32d7);endRouting(_0x1f32d7,_0x226206,_0x40eadb,_0x3f3658);clearTimeout(_0x42271d);_0x37bb14[_0x152e('0x41')](!![]);_0x254d05['next']();},_0x5b3fdf);switch(_0x226206[_0x152e('0x45')]){case _0x152e('0x46'):strategy['rrmemory'](_0x37bb14,_0x226206,_0x3f3658,_0x40eadb);break;default:strategy['beepall'](_0x37bb14,_0x226206,_0x3f3658,_0x40eadb);}}else{logger[_0x152e('0x30')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x1f32d7,_0x4016ff['name']);_0x254d05[_0x152e('0x42')]();}}}catch(_0x38c8b6){console[_0x152e('0x47')](_0x38c8b6);logger[_0x152e('0x30')](_0x152e('0x38'),_0x1f32d7,_0x38c8b6[_0x152e('0x48')]);_0x254d05[_0x152e('0x42')]();}};}; \ No newline at end of file +var _0x037d=['timeout\x20is\x20a\x20number','from','contact','upperFirst','InteractionId','interaction','channel','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','body','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','end','close','rules','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','validate','util','moment','../../../../config/logger','redis','defaults','socket.io-emitter','account','queue','joinAt','emit','clone','queue_id','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x533897,_0x34e7c8){var _0x340bbd=function(_0xf9c99){while(--_0xf9c99){_0x533897['push'](_0x533897['shift']());}};_0x340bbd(++_0x34e7c8);}(_0x037d,0x1d8));var _0xd037=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x037d[_0x599f41];return _0x2e4d58;};'use strict';var schema=require(_0xd037('0x0'));var _=require('lodash');var util=require(_0xd037('0x1'));var seqqueue=require('seq-queue');var moment=require(_0xd037('0x2'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0xd037('0x3'))('routing');var strategy=require('./strategy');config[_0xd037('0x4')]=_[_0xd037('0x5')](config[_0xd037('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xd037('0x6'))(new Redis(config[_0xd037('0x4')]));var attributes=['id','queue_id',_0xd037('0x7'),_0xd037('0x8'),'from',_0xd037('0x9')];function emit(_0x3c62bd,_0x4de027,_0xe7743c){io['to'](_0x3c62bd)[_0xd037('0xa')](_0x4de027,_0xe7743c);}function emitChannelQueueInteraction(_0x3ee965,_0x2d2545,_0x2ada2b,_0x555b03,_0x1a8952,_0x16c13b,_0x8bdb33,_0x4160ce){var _0x420c3c=_[_0xd037('0xb')](_0x2ada2b);_0x420c3c[_0xd037('0xc')]=_0x4160ce;_0x420c3c['queue']=_0x2d2545;_0x420c3c[_0xd037('0x7')]=_0x555b03;_0x420c3c['id']=_0x1a8952;if(_0x16c13b){_0x8bdb33[util[_0xd037('0xd')]('%sQueuesWaitingInteractions',_0x3ee965)][_0x1a8952]=_[_0xd037('0xe')](_0x420c3c,attributes);}else{delete _0x8bdb33[util[_0xd037('0xd')](_0xd037('0xf'),_0x3ee965)][_0x1a8952];}emit(util['format'](_0xd037('0x10'),_0x3ee965,_0x2d2545),util['format'](_0xd037('0x11'),_0x3ee965,_0x16c13b?'save':'remove'),_[_0xd037('0xe')](_0x420c3c,attributes));}var rpc={'openchannelQueueReport':require(_0xd037('0x12')),'mailQueueReport':require(_0xd037('0x13')),'chatQueueReport':require(_0xd037('0x14')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xd037('0x15'))};var queue=schema({'name':{'type':_0xd037('0x16'),'required':!![],'message':_0xd037('0x17')},'timeout':{'type':_0xd037('0x18'),'message':_0xd037('0x19')}});function startRouting(_0x1fdee7,_0x424e4,_0x34a3fd,_0x1e2400){if(_0x1fdee7&&_0x424e4&&_0x34a3fd){_0x424e4['waiting']+=0x1;var _0x5ad736={'uniqueid':_0x1fdee7,'from':_0x34a3fd['body']?_0x34a3fd['body'][_0xd037('0x1a')]:'','joinAt':moment()[_0xd037('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x34a3fd[_0xd037('0x1b')]?_0x34a3fd['contact']['id']:null,'ListId':_0x34a3fd['list']?_0x34a3fd['list']['id']:null};_0x5ad736[_['upperFirst'](_0x34a3fd['channel'])+'QueueId']=_0x424e4['id']||null;_0x5ad736[_[_0xd037('0x1c')](_0x34a3fd['channel'])+_0xd037('0x1d')]=_0x34a3fd[_0xd037('0x1e')]?_0x34a3fd[_0xd037('0x1e')]['id']:null;_0x5ad736[_[_0xd037('0x1c')](_0x34a3fd[_0xd037('0x1f')])+_0xd037('0x20')]=_0x34a3fd[_0xd037('0x21')]?_0x34a3fd[_0xd037('0x21')]['id']:null;_0x5ad736[_[_0xd037('0x1c')](_0x34a3fd[_0xd037('0x1f')])+(_0x34a3fd[_0xd037('0x1f')]!==_0xd037('0x22')?_0xd037('0x23'):_0xd037('0x24'))]=_0x34a3fd[_0xd037('0x7')]?_0x34a3fd[_0xd037('0x7')]['id']:null;logger[_0xd037('0x25')](util[_0xd037('0xd')](_0xd037('0x26'),_0x1fdee7,_0x424e4[_0xd037('0x27')]));emitChannelQueueInteraction(_0x34a3fd[_0xd037('0x1f')],_0x424e4['name'],_0x5ad736,_0x34a3fd['account'][_0xd037('0x27')],_0x34a3fd[_0xd037('0x21')]['id'],!![],_0x1e2400,_0x424e4['id']);if(rpc[_0x34a3fd[_0xd037('0x1f')]+_0xd037('0x28')]){return rpc[_0x34a3fd[_0xd037('0x1f')]+_0xd037('0x28')][_0xd037('0x29')](_0x5ad736)[_0xd037('0x2a')](function(_0x4a8c74){logger[_0xd037('0x2b')]('create\x20queue\x20report');});}}}function stopRouting(_0x321d42,_0x397a6f,_0x1548a5,_0x1b657a){if(_0x321d42&&_0x397a6f){_0x397a6f[_0xd037('0x2c')]-=0x1;var _0x4a598b={'leaveAt':moment()[_0xd037('0xd')](_0xd037('0x2d')),'acceptAt':moment()[_0xd037('0xd')](_0xd037('0x2d')),'reason':_0xd037('0x2e')};logger[_0xd037('0x25')](util[_0xd037('0xd')](_0xd037('0x2f'),_0x321d42,_0x397a6f[_0xd037('0x27')]));emitChannelQueueInteraction(_0x1548a5[_0xd037('0x1f')],_0x397a6f[_0xd037('0x27')],_0x1548a5[_0xd037('0x30')],_0x1548a5[_0xd037('0x7')]['name'],_0x1548a5[_0xd037('0x21')]['id'],![],_0x1b657a,_0x397a6f['id']);if(rpc[_0x1548a5[_0xd037('0x1f')]+_0xd037('0x28')]){return rpc[_0x1548a5[_0xd037('0x1f')]+'QueueReport'][_0xd037('0x31')](_0x321d42,_0x4a598b)[_0xd037('0x2a')](function(_0x46c69f){logger[_0xd037('0x2b')](_0xd037('0x32'));});}}}function endRouting(_0x4c7135,_0x4affdd,_0x4cd84d,_0x537fd8){if(_0x4c7135&&_0x4affdd){_0x4affdd[_0xd037('0x2c')]-=0x1;var _0x5953b0={'leaveAt':moment()[_0xd037('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xd037('0xd')](_0xd037('0x2d')),'reason':_0xd037('0x33')};logger['info'](util[_0xd037('0xd')](_0xd037('0x34'),_0x4c7135,_0x4affdd[_0xd037('0x27')]));emitChannelQueueInteraction(_0x4cd84d[_0xd037('0x1f')],_0x4affdd[_0xd037('0x27')],_0x4cd84d[_0xd037('0x30')],_0x4cd84d[_0xd037('0x7')][_0xd037('0x27')],_0x4cd84d[_0xd037('0x21')]['id'],![],_0x537fd8);if(rpc[_0x4cd84d[_0xd037('0x1f')]+_0xd037('0x28')]){return rpc[_0x4cd84d['channel']+_0xd037('0x28')][_0xd037('0x31')](_0x4c7135,_0x5953b0)[_0xd037('0x2a')](function(_0x370387){logger['error'](_0xd037('0x32'));});}}}function handleFindQueue(_0x1f2028){return function(_0x5b6080){return _0x5b6080[_0xd037('0x27')][_0xd037('0x35')]()===_0x1f2028[_0xd037('0x35')]();};}exports[_0xd037('0x36')]=function(_0x1fcdf3,_0x1e3310,_0x407822,_0x23a96a){return function(_0x2d5adf){try{var _0x9bd541={'name':_0x1e3310[0x0],'timeout':_0x1e3310[0x1]};var _0xae3d37=queue['validate'](_0x9bd541,{'typecast':!![]});if(_0xae3d37[_0xd037('0x37')]){logger['error'](_0xd037('0x38'),_0x1fcdf3,_[_0xd037('0x39')](_0xae3d37,'message')[_0xd037('0x3a')](',\x20'));_0x2d5adf[_0xd037('0x3b')]();}else{var _0x36edc4=_[_0xd037('0x3c')](_0x407822[_0x23a96a[_0xd037('0x1f')]+_0xd037('0x3d')],handleFindQueue(_0x9bd541['name']));if(_0x36edc4){startRouting(_0x1fcdf3,_0x36edc4,_0x23a96a,_0x407822);var _0x51f20b=(_0x36edc4['timeout']||0xa)*0x3e8;var _0x25164d=(_0x9bd541[_0xd037('0x33')]||0x14)*0x3e8;var _0x3ab813,_0x19384e;if(_0x51f20b>_0x25164d){_0x25164d=_0x51f20b;}var _0x2ffa68=seqqueue[_0xd037('0x3e')](_0x51f20b);_0x2ffa68['id']=_0x1fcdf3;_0x2ffa68[_0xd037('0x3f')]=_0x51f20b;_0x2ffa68[_0xd037('0x40')]=_0x25164d;_0x2ffa68['channel']=_0x23a96a[_0xd037('0x1f')];_0x407822['rules'][_0x1fcdf3]['on'](_0xd037('0x41'),function(){logger[_0xd037('0x25')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x1fcdf3);stopRouting(_0x1fcdf3,_0x36edc4,_0x23a96a,_0x407822);clearTimeout(_0x3ab813);_0x3ab813=undefined;_0x2ffa68[_0xd037('0x42')](!![]);if(_0x407822[_0xd037('0x43')][_0x1fcdf3]){delete _0x407822[_0xd037('0x43')][_0x1fcdf3];}_0x2d5adf[_0xd037('0x3b')]();});_0x407822[_0xd037('0x43')][_0x1fcdf3]['on']('complete',function(){if(_0x407822[_0xd037('0x43')][_0x1fcdf3]){delete _0x407822[_0xd037('0x43')][_0x1fcdf3];}});_0x3ab813=setTimeout(function(){logger[_0xd037('0x25')](_0xd037('0x44'),_0x1fcdf3);endRouting(_0x1fcdf3,_0x36edc4,_0x23a96a,_0x407822);clearTimeout(_0x3ab813);_0x2ffa68[_0xd037('0x42')](!![]);_0x2d5adf['next']();},_0x25164d);switch(_0x36edc4[_0xd037('0x45')]){case _0xd037('0x46'):strategy[_0xd037('0x46')](_0x2ffa68,_0x36edc4,_0x407822,_0x23a96a);break;default:strategy['beepall'](_0x2ffa68,_0x36edc4,_0x407822,_0x23a96a);}}else{logger[_0xd037('0x2b')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x1fcdf3,_0x9bd541[_0xd037('0x27')]);_0x2d5adf[_0xd037('0x3b')]();}}}catch(_0x5c86ca){console['log'](_0x5c86ca);logger['error'](_0xd037('0x38'),_0x1fcdf3,_0x5c86ca['stack']);_0x2d5adf['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 578821b..d54ba8f 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 _0xfcd5=['channel','busy','busyQueue','showNotification','notificationId','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','exports','uuid','../../../../../config/logger','routing','squeue','agent','realtime','push','handleRun','handleTimeout','bind','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0xfcd5,0x7f));var _0x5fcd=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0xfcd5[_0xb833b1];return _0x1ab87a;};'use strict';var _=require('lodash');var uuid=require(_0x5fcd('0x0'));var util=require('./util');var logger=require(_0x5fcd('0x1'))(_0x5fcd('0x2'));var Agent=function(_0x381044,_0x4c92bc,_0x29af6a,_0x33c7bc){this['notificationId']=uuid['v4']();this[_0x5fcd('0x3')]=_0x381044;this[_0x5fcd('0x4')]=_0x4c92bc;this[_0x5fcd('0x5')]=_0x29af6a;this[_0x5fcd('0x2')]=_0x33c7bc;this[_0x5fcd('0x3')][_0x5fcd('0x6')](this[_0x5fcd('0x7')]['bind'](this),this[_0x5fcd('0x8')][_0x5fcd('0x9')](this));this[_0x5fcd('0x3')]['on']('timeout',this[_0x5fcd('0x8')]['bind'](this));this['squeue']['on']('drained',this[_0x5fcd('0xa')][_0x5fcd('0x9')](this));};Agent[_0x5fcd('0xb')][_0x5fcd('0x6')]=function(){this[_0x5fcd('0x3')]['push'](this['handleRun'][_0x5fcd('0x9')](this),this[_0x5fcd('0x8')][_0x5fcd('0x9')](this));};Agent[_0x5fcd('0xb')]['handleDrained']=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x5fcd('0x7')]=function(_0x5395a7){logger['info'](_0x5fcd('0xc'),this[_0x5fcd('0x3')]['id'],this[_0x5fcd('0x4')]['id']);if(_[_0x5fcd('0xd')](this['realtime'][_0x5fcd('0xe')][this[_0x5fcd('0x4')]['id']])){logger[_0x5fcd('0xf')](_0x5fcd('0x10'),this['squeue']['id'],this[_0x5fcd('0x4')]['id']);setTimeout(this[_0x5fcd('0x6')][_0x5fcd('0x9')](this),0x3e8);}else{if(this[_0x5fcd('0x2')][_0x5fcd('0x11')]||util['isAgentAvailable'](this['squeue']['id'],this['realtime'][_0x5fcd('0xe')][this[_0x5fcd('0x4')]['id']],this[_0x5fcd('0x3')][_0x5fcd('0x12')],![])){this[_0x5fcd('0x5')][_0x5fcd('0xe')][this[_0x5fcd('0x4')]['id']][_0x5fcd('0x13')]=!![];this[_0x5fcd('0x5')]['agents'][this['agent']['id']][_0x5fcd('0x14')]=undefined;util[_0x5fcd('0x15')](this[_0x5fcd('0x16')],this['squeue']['id'],this[_0x5fcd('0x5')][_0x5fcd('0xe')][this['agent']['id']],null,this[_0x5fcd('0x2')]);util[_0x5fcd('0x17')](this[_0x5fcd('0x3')]['id'],this['realtime'][_0x5fcd('0xe')][this[_0x5fcd('0x4')]['id']],_0x5fcd('0x18')+(this[_0x5fcd('0x2')]['forcedOwnership']?':FORCED':''));}else{logger['info'](_0x5fcd('0x19'),this[_0x5fcd('0x3')]['id'],this['agent']['id']);setTimeout(this['push'][_0x5fcd('0x9')](this),0x3e8);}}};Agent['prototype'][_0x5fcd('0x8')]=function(_0x48c54f){if(_['isNil'](this[_0x5fcd('0x5')][_0x5fcd('0xe')][this[_0x5fcd('0x4')]['id']])){return logger[_0x5fcd('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x5fcd('0x4')]['id']);}else{logger[_0x5fcd('0xf')](_0x5fcd('0x1a'),this[_0x5fcd('0x3')]['id'],this[_0x5fcd('0x4')]['id']);util[_0x5fcd('0x1b')](this[_0x5fcd('0x16')],this[_0x5fcd('0x3')]['id'],this[_0x5fcd('0x5')]['agents'][this['agent']['id']],null,this[_0x5fcd('0x2')]);this[_0x5fcd('0x5')]['agents'][this['agent']['id']][_0x5fcd('0x13')]=![];this[_0x5fcd('0x5')][_0x5fcd('0xe')][this[_0x5fcd('0x4')]['id']]['busyQueue']=undefined;util[_0x5fcd('0x17')](this[_0x5fcd('0x3')]['id'],this[_0x5fcd('0x5')][_0x5fcd('0xe')][this[_0x5fcd('0x4')]['id']],_0x48c54f?'STOP':'TIMEOUT');}if(!_0x48c54f){setTimeout(this[_0x5fcd('0x6')]['bind'](this),0x3e8);}};function agent(_0x125e6a,_0x5acc9f,_0x20a750,_0xeccf3d){return new Agent(_0x125e6a,_0x5acc9f,_0x20a750,_0xeccf3d);}module[_0x5fcd('0x1c')]=agent; \ No newline at end of file +var _0x7623=['busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','notificationId','squeue','agent','realtime','push','handleRun','timeout','handleTimeout','handleDrained','prototype','bind','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','forcedOwnership','isAgentAvailable','channel'];(function(_0x3a0da5,_0x5f4974){var _0x4abcf2=function(_0x53504c){while(--_0x53504c){_0x3a0da5['push'](_0x3a0da5['shift']());}};_0x4abcf2(++_0x5f4974);}(_0x7623,0x1c5));var _0x3762=function(_0x1599ae,_0x50ac2b){_0x1599ae=_0x1599ae-0x0;var _0x5c97cc=_0x7623[_0x1599ae];return _0x5c97cc;};'use strict';var _=require('lodash');var uuid=require(_0x3762('0x0'));var util=require(_0x3762('0x1'));var logger=require(_0x3762('0x2'))('routing');var Agent=function(_0xd569bb,_0x1bc534,_0x5bfaab,_0x23970d){this[_0x3762('0x3')]=uuid['v4']();this[_0x3762('0x4')]=_0xd569bb;this[_0x3762('0x5')]=_0x1bc534;this[_0x3762('0x6')]=_0x5bfaab;this['routing']=_0x23970d;this[_0x3762('0x4')][_0x3762('0x7')](this[_0x3762('0x8')]['bind'](this),this['handleTimeout']['bind'](this));this[_0x3762('0x4')]['on'](_0x3762('0x9'),this[_0x3762('0xa')]['bind'](this));this[_0x3762('0x4')]['on']('drained',this[_0x3762('0xb')]['bind'](this));};Agent[_0x3762('0xc')]['push']=function(){this['squeue'][_0x3762('0x7')](this[_0x3762('0x8')][_0x3762('0xd')](this),this['handleTimeout'][_0x3762('0xd')](this));};Agent[_0x3762('0xc')][_0x3762('0xb')]=function(){this[_0x3762('0xa')](!![]);};Agent[_0x3762('0xc')][_0x3762('0x8')]=function(_0x54ea09){logger[_0x3762('0xe')](_0x3762('0xf'),this[_0x3762('0x4')]['id'],this[_0x3762('0x5')]['id']);if(_[_0x3762('0x10')](this[_0x3762('0x6')][_0x3762('0x11')][this[_0x3762('0x5')]['id']])){logger[_0x3762('0xe')](_0x3762('0x12'),this[_0x3762('0x4')]['id'],this[_0x3762('0x5')]['id']);setTimeout(this[_0x3762('0x7')][_0x3762('0xd')](this),0x3e8);}else{if(this[_0x3762('0x13')][_0x3762('0x14')]||util[_0x3762('0x15')](this[_0x3762('0x4')]['id'],this[_0x3762('0x6')]['agents'][this[_0x3762('0x5')]['id']],this[_0x3762('0x4')][_0x3762('0x16')],![])){this[_0x3762('0x6')]['agents'][this[_0x3762('0x5')]['id']]['busy']=!![];this[_0x3762('0x6')]['agents'][this[_0x3762('0x5')]['id']][_0x3762('0x17')]=undefined;util['showNotification'](this[_0x3762('0x3')],this['squeue']['id'],this[_0x3762('0x6')]['agents'][this['agent']['id']],null,this[_0x3762('0x13')]);util[_0x3762('0x18')](this[_0x3762('0x4')]['id'],this[_0x3762('0x6')][_0x3762('0x11')][this[_0x3762('0x5')]['id']],_0x3762('0x19')+(this[_0x3762('0x13')][_0x3762('0x14')]?_0x3762('0x1a'):''));}else{logger[_0x3762('0xe')](_0x3762('0x1b'),this[_0x3762('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x3762('0x7')][_0x3762('0xd')](this),0x3e8);}}};Agent['prototype'][_0x3762('0xa')]=function(_0x2d3c5d){if(_['isNil'](this[_0x3762('0x6')]['agents'][this['agent']['id']])){return logger[_0x3762('0xe')](_0x3762('0x12'),this[_0x3762('0x4')]['id'],this[_0x3762('0x5')]['id']);}else{logger[_0x3762('0xe')](_0x3762('0x1c'),this[_0x3762('0x4')]['id'],this['agent']['id']);util[_0x3762('0x1d')](this[_0x3762('0x3')],this[_0x3762('0x4')]['id'],this[_0x3762('0x6')]['agents'][this[_0x3762('0x5')]['id']],null,this[_0x3762('0x13')]);this[_0x3762('0x6')]['agents'][this[_0x3762('0x5')]['id']][_0x3762('0x1e')]=![];this[_0x3762('0x6')][_0x3762('0x11')][this[_0x3762('0x5')]['id']][_0x3762('0x17')]=undefined;util[_0x3762('0x18')](this[_0x3762('0x4')]['id'],this['realtime'][_0x3762('0x11')][this[_0x3762('0x5')]['id']],_0x2d3c5d?_0x3762('0x1f'):_0x3762('0x20'));}if(!_0x2d3c5d){setTimeout(this[_0x3762('0x7')][_0x3762('0xd')](this),0x3e8);}};function agent(_0x520778,_0xdcb4b6,_0x55e7bc,_0x153beb){return new Agent(_0x520778,_0xdcb4b6,_0x55e7bc,_0x153beb);}module[_0x3762('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 b46e865..fdfbb06 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 _0xab86=['timeout','handleDrained','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','writeLog','RINGING','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','STOP','TIMEOUT','busy','busyQueue','lodash','uuid','./util','notificationId','squeue','queue','realtime','routing','push','handleRun','bind','handleTimeout'];(function(_0x23bf39,_0x540ef1){var _0x313151=function(_0x189246){while(--_0x189246){_0x23bf39['push'](_0x23bf39['shift']());}};_0x313151(++_0x540ef1);}(_0xab86,0x13e));var _0x6ab8=function(_0xdeea17,_0x2d08b7){_0xdeea17=_0xdeea17-0x0;var _0x467a89=_0xab86[_0xdeea17];return _0x467a89;};'use strict';var _=require(_0x6ab8('0x0'));var uuid=require(_0x6ab8('0x1'));var util=require(_0x6ab8('0x2'));var logger=require('../../../../../config/logger')('routing');var Beepall=function(_0xfa522f,_0x4bcc45,_0x1193a1,_0x48cb6a){this[_0x6ab8('0x3')]=uuid['v4']();this[_0x6ab8('0x4')]=_0xfa522f;this[_0x6ab8('0x5')]=_0x4bcc45;this[_0x6ab8('0x6')]=_0x1193a1;this[_0x6ab8('0x7')]=_0x48cb6a;this[_0x6ab8('0x4')][_0x6ab8('0x8')](this[_0x6ab8('0x9')][_0x6ab8('0xa')](this),this[_0x6ab8('0xb')][_0x6ab8('0xa')](this));this[_0x6ab8('0x4')]['on'](_0x6ab8('0xc'),this['handleTimeout']['bind'](this));this[_0x6ab8('0x4')]['on']('drained',this[_0x6ab8('0xd')][_0x6ab8('0xa')](this));};Beepall[_0x6ab8('0xe')]['push']=function(){this[_0x6ab8('0x4')][_0x6ab8('0x8')](this['handleRun'][_0x6ab8('0xa')](this),this[_0x6ab8('0xb')][_0x6ab8('0xa')](this));};Beepall['prototype'][_0x6ab8('0xd')]=function(_0x42b74e){this[_0x6ab8('0xb')](!![]);};Beepall[_0x6ab8('0xe')][_0x6ab8('0x9')]=function(_0x1f560c){var _0x1c6402=!![];if(!_[_0x6ab8('0xf')](this[_0x6ab8('0x5')])&&!_['isNil'](this[_0x6ab8('0x5')][_0x6ab8('0x10')])&&this[_0x6ab8('0x5')]['Agents'][_0x6ab8('0x11')]>0x0){for(var _0x35b790=0x0,_0x50cd9f;_0x35b7900x0){for(var _0x3ceb6a=0x0,_0x431076;_0x3ceb6a0x0&&_0x34d154[_0x433b7a+'CurrentCapacity']>=_0x34d154[_0x433b7a+'Capacity']){writeLog(_0x3b26ac,_0x34d154,_0x433b7a[_0x4acf('0x24')]()+_0x4acf('0x25'));return![];}}return!![];};exports[_0x4acf('0x26')]=function(_0x42c90c,_0x14086c,_0x1b4da6,_0xb83274,_0x7a1e79){return sendNotification(!![],_0x42c90c,_0x14086c,_0x1b4da6,_0xb83274,_0x7a1e79);};exports[_0x4acf('0x27')]=function(_0x2a3830,_0x57989e,_0x3521c2,_0x3f5614,_0xd027c7){return sendNotification(![],_0x2a3830,_0x57989e,_0x3521c2,_0x3f5614,_0xd027c7);};exports[_0x4acf('0x28')]=writeLog; \ No newline at end of file +var _0x8ace=['\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','format','user:%s','name','user:save','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','emit','notification:%s','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x188edb,_0x19fed6){_0x188edb=_0x188edb-0x0;var _0x669a3d=_0x8ace[_0x188edb];return _0x669a3d;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var utils=require(_0xe8ac('0x2'));var Mustache=require(_0xe8ac('0x3'));var Redis=require(_0xe8ac('0x4'));var config=require(_0xe8ac('0x5'));var logger=require(_0xe8ac('0x6'))(_0xe8ac('0x7'));config[_0xe8ac('0x8')]=_[_0xe8ac('0x9')](config[_0xe8ac('0x8')],{'host':_0xe8ac('0xa'),'port':0x18eb});var io=require(_0xe8ac('0xb'))(new Redis(config[_0xe8ac('0x8')]));function emit(_0x4eb087,_0x2d56f0,_0x1357ed){io['to'](_0x4eb087)['emit'](_0x2d56f0,_0x1357ed);}function sendNotification(_0x5c83e1,_0x4644ef,_0x513793,_0x1b5467,_0x271fdb,_0x19d9c8){io['to'](util[_0xe8ac('0xc')](_0xe8ac('0xd'),_0x1b5467[_0xe8ac('0xe')]))['emit'](_0xe8ac('0xf'),_0x1b5467);var _0x2e3b25=_0x19d9c8||{};var _0x1f71ff=_0x513793['split']('.');var _0x15b0cf={'uniqueid':_0x4644ef,'channel':_0x1f71ff[0x0],'id':_0x1f71ff[0x1],'title':_0x1f71ff[0x0]+_0xe8ac('0x10'),'interactionId':_0x1f71ff[0x2],'queue':_0x271fdb?_0x271fdb['name']:null,'sound':_0x2e3b25[_0xe8ac('0x11')][_0xe8ac('0x12')],'shake':_0x2e3b25[_0xe8ac('0x11')][_0xe8ac('0x13')]};try{if(!_0x2e3b25[_0xe8ac('0x14')]){_0x2e3b25[_0xe8ac('0x14')]={};}if(_0x271fdb){_0x2e3b25[_0xe8ac('0x14')][_0xe8ac('0x15')]=_0x271fdb;}else if(_0x2e3b25[_0xe8ac('0x14')][_0xe8ac('0x15')]){delete _0x2e3b25['body'][_0xe8ac('0x15')];}_0x15b0cf[_0xe8ac('0x16')]=utils['getMustacheRender'](_0x2e3b25[_0xe8ac('0x11')][_0xe8ac('0x17')],_0x2e3b25);}catch(_0x1421df){_0x15b0cf[_0xe8ac('0x16')]=_0xe8ac('0x18');logger[_0xe8ac('0x19')](util['format']('[%s][QUEUE]\x20%s',_0x4644ef,_0x1421df['message']));}io['to'](util[_0xe8ac('0xc')](_0xe8ac('0xd'),_0x1b5467['name']))[_0xe8ac('0x1a')](util['format'](_0xe8ac('0x1b'),_0x5c83e1?_0xe8ac('0x1c'):'remove'),_0x15b0cf);}function writeLog(_0x6258f8,_0x169929,_0x13aa7c){return logger[_0xe8ac('0x1d')](util['format'](_0xe8ac('0x1e'),_0x6258f8,_0x169929['name'],_0x13aa7c));}exports[_0xe8ac('0x1f')]=function(_0x3933d2,_0x3c3a78,_0x252440,_0x36108c){if(_0x3c3a78[_0xe8ac('0x20')]){writeLog(_0x3933d2,_0x3c3a78,_0xe8ac('0x21'));return![];}if(!_0x3c3a78['online']){writeLog(_0x3933d2,_0x3c3a78,_0xe8ac('0x22'));return![];}if(_0x3c3a78[_0x252440+_0xe8ac('0x23')]){writeLog(_0x3933d2,_0x3c3a78,_0xe8ac('0x24'));return![];}if(_0x36108c&&_0x3c3a78[_0xe8ac('0x25')](_0x252440+_0xe8ac('0x26'))&&_0x3c3a78[_0xe8ac('0x25')](_0x252440+_0xe8ac('0x27'))){if(_0x3c3a78[_0x252440+_0xe8ac('0x26')]>0x0&&_0x3c3a78[_0x252440+_0xe8ac('0x27')]>=_0x3c3a78[_0x252440+'Capacity']){writeLog(_0x3933d2,_0x3c3a78,_0x252440['toUpperCase']()+_0xe8ac('0x28'));return![];}}return!![];};exports[_0xe8ac('0x29')]=function(_0x59512c,_0x2a78c6,_0x5948aa,_0x54f94c,_0x4c1d08){return sendNotification(!![],_0x59512c,_0x2a78c6,_0x5948aa,_0x54f94c,_0x4c1d08);};exports[_0xe8ac('0x2a')]=function(_0x41294e,_0x3798c5,_0x5d7562,_0x156550,_0x41ffe8){return sendNotification(![],_0x41294e,_0x3798c5,_0x5d7562,_0x156550,_0x41ffe8);};exports[_0xe8ac('0x2b')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 68aa41d..7f85e6e 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 _0x36da=['lodash','./utils','../../../../config/logger','routing','string','consequence','validate','length','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify','shelljs'];(function(_0x8146b9,_0x584040){var _0x2208c8=function(_0x591541){while(--_0x591541){_0x8146b9['push'](_0x8146b9['shift']());}};_0x2208c8(++_0x584040);}(_0x36da,0xd7));var _0xa36d=function(_0x38e5f0,_0x4fedd8){_0x38e5f0=_0x38e5f0-0x0;var _0x5b08dc=_0x36da[_0x38e5f0];return _0x5b08dc;};'use strict';var schema=require('validate');var sh=require(_0xa36d('0x0'));var _=require(_0xa36d('0x1'));var utils=require(_0xa36d('0x2'));var logger=require(_0xa36d('0x3'))(_0xa36d('0x4'));var system=schema({'command':{'type':_0xa36d('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xa36d('0x6')]=function(_0x1ba311,_0x45973e){return function(_0x203abe){try{var _0x2fafad={'command':_0x45973e[0x0]};var _0x1af58d=system[_0xa36d('0x7')](_0x2fafad,{'typecast':!![]});if(_0x1af58d[_0xa36d('0x8')]){logger['error'](_0xa36d('0x9'),_0x1ba311,_[_0xa36d('0xa')](_0x1af58d,_0xa36d('0xb'))['join'](',\x20'));logger[_0xa36d('0xc')](_0xa36d('0xd'),_0x1ba311);_0x203abe[_0xa36d('0xe')]();}else{var _0x32ae43=this;var _0x3d0097=utils[_0xa36d('0xf')](_0x45973e[0x0],this);logger['info'](_0xa36d('0x10'),_0x1ba311,_0x3d0097);sh[_0xa36d('0x11')](_[_0xa36d('0x12')](_0x3d0097),function(_0x4db8e9,_0x55fe18){logger[_0xa36d('0xc')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x1ba311,_0x4db8e9);if(_0x4db8e9==0x0){var _0x5c23a3=_0x55fe18[_0xa36d('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xa36d('0x14')](_0x45973e[0x1])||_['isEmpty'](_0x45973e[0x1])){logger[_0xa36d('0xc')](_0xa36d('0x15'),_0x1ba311);_0x32ae43[_0xa36d('0x16')][_0x45973e[0x1]]=_0x5c23a3;}else{logger['info'](_0xa36d('0x17'),_0x1ba311,_0x45973e[0x1],_0x5c23a3);_0x32ae43['body'][_0x45973e[0x1]]=_0x5c23a3;}}_0x203abe[_0xa36d('0xe')]();});}}catch(_0x2a514c){logger[_0xa36d('0x18')](_0xa36d('0x9'),_0x1ba311,_[_0xa36d('0x19')](_0x2a514c)?JSON[_0xa36d('0x1a')](_0x2a514c):_0x2a514c);logger[_0xa36d('0xc')](_0xa36d('0xd'),_0x1ba311);_0x203abe[_0xa36d('0xe')]();}};}; \ No newline at end of file +var _0x3613=['[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','consequence','error','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3613,0x198));var _0x3361=function(_0xa0f0fd,_0x2a5d50){_0xa0f0fd=_0xa0f0fd-0x0;var _0x529fbe=_0x3613[_0xa0f0fd];return _0x529fbe;};'use strict';var schema=require(_0x3361('0x0'));var sh=require(_0x3361('0x1'));var _=require(_0x3361('0x2'));var utils=require(_0x3361('0x3'));var logger=require(_0x3361('0x4'))(_0x3361('0x5'));var system=schema({'command':{'type':_0x3361('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x3361('0x7')]=function(_0x585bf7,_0x21cd23){return function(_0x3221e2){try{var _0xa1bc1b={'command':_0x21cd23[0x0]};var _0x2e2d6c=system[_0x3361('0x0')](_0xa1bc1b,{'typecast':!![]});if(_0x2e2d6c['length']){logger[_0x3361('0x8')]('[%s][SYSTEM]\x20%s',_0x585bf7,_[_0x3361('0x9')](_0x2e2d6c,_0x3361('0xa'))[_0x3361('0xb')](',\x20'));logger[_0x3361('0xc')](_0x3361('0xd'),_0x585bf7);_0x3221e2['next']();}else{var _0x5c63b9=this;var _0x4abfd6=utils['getMustacheRender'](_0x21cd23[0x0],this);logger['info'](_0x3361('0xe'),_0x585bf7,_0x4abfd6);sh[_0x3361('0xf')](_[_0x3361('0x10')](_0x4abfd6),function(_0x2f1940,_0x956a83){logger['info'](_0x3361('0x11'),_0x585bf7,_0x2f1940);if(_0x2f1940==0x0){var _0x769cfa=_0x956a83[_0x3361('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x21cd23[0x1])||_[_0x3361('0x13')](_0x21cd23[0x1])){logger[_0x3361('0xc')](_0x3361('0x14'),_0x585bf7);_0x5c63b9[_0x3361('0x15')][_0x21cd23[0x1]]=_0x769cfa;}else{logger[_0x3361('0xc')](_0x3361('0x16'),_0x585bf7,_0x21cd23[0x1],_0x769cfa);_0x5c63b9['body'][_0x21cd23[0x1]]=_0x769cfa;}}_0x3221e2[_0x3361('0x17')]();});}}catch(_0x2dc467){logger[_0x3361('0x8')](_0x3361('0x18'),_0x585bf7,_[_0x3361('0x19')](_0x2dc467)?JSON[_0x3361('0x1a')](_0x2dc467):_0x2dc467);logger[_0x3361('0xc')](_0x3361('0xd'),_0x585bf7);_0x3221e2[_0x3361('0x17')]();}};}; \ 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 e215f7e..c570f9b 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 _0xcce4=['TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','addTags','then','catch','error','next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xcce4,0x1c3));var _0x4cce=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0xcce4[_0x171fdc];return _0x3782ea;};'use strict';var schema=require(_0x4cce('0x0'));var _=require(_0x4cce('0x1'));var rpc={'chatInteraction':require(_0x4cce('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x4cce('0x3')),'mailInteraction':require(_0x4cce('0x4')),'faxInteraction':require(_0x4cce('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x4cce('0x6'))(_0x4cce('0x7'));var tag=schema({'tag':{'type':_0x4cce('0x8'),'required':!![],'message':_0x4cce('0x9')}});exports['consequence']=function(_0x58ca93,_0x4f4545,_0x489a9e,_0x257295){return function(_0x3a907a){try{var _0x4593b1={'tag':_0x4f4545[0x0]};var _0x59cc50=tag[_0x4cce('0x0')](_0x4593b1,{'typecast':!![]});if(_0x59cc50['length']){logger['error'](_0x4cce('0xa'),_0x58ca93,_[_0x4cce('0xb')](_0x59cc50,_0x4cce('0xc'))[_0x4cce('0xd')](',\x20'));logger[_0x4cce('0xe')](_0x4cce('0xf'),_0x58ca93);_0x3a907a['next']();}else{var _0x13d67e={'ids':[_0x4f4545[0x0]]};if(rpc[_0x257295[_0x4cce('0x10')]+'Interaction']){rpc[_0x257295[_0x4cce('0x10')]+'Interaction'][_0x4cce('0x11')](_0x257295['interaction']['id'],_0x13d67e)[_0x4cce('0x12')](function(_0x27019b){logger[_0x4cce('0xe')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x58ca93,_0x4f4545[0x1],_0x257295[_0x4cce('0x10')],_0x257295['interaction']['id']);})[_0x4cce('0x13')](function(_0x12abac){logger[_0x4cce('0x14')](_0x4cce('0xa'),_0x58ca93,JSON['stringify'](_0x12abac));logger[_0x4cce('0xe')](_0x4cce('0xf'),_0x58ca93);})['finally'](function(){_0x3a907a[_0x4cce('0x15')]();});}}}catch(_0x1dd147){logger[_0x4cce('0x14')](_0x4cce('0xa'),_0x58ca93,_[_0x4cce('0x16')](_0x1dd147)?JSON['stringify'](_0x1dd147):_0x1dd147);logger[_0x4cce('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x58ca93);_0x3a907a[_0x4cce('0x15')]();}};}; \ No newline at end of file +var _0xccfc=['Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','isObject','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','message','info','channel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xccfc,0xfd));var _0xcccf=function(_0x98cbcf,_0x517f7c){_0x98cbcf=_0x98cbcf-0x0;var _0x2028c4=_0xccfc[_0x98cbcf];return _0x2028c4;};'use strict';var schema=require('validate');var _=require(_0xcccf('0x0'));var rpc={'chatInteraction':require(_0xcccf('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xcccf('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xcccf('0x3')),'whatsappInteraction':require(_0xcccf('0x4'))};var logger=require(_0xcccf('0x5'))(_0xcccf('0x6'));var tag=schema({'tag':{'type':_0xcccf('0x7'),'required':!![],'message':_0xcccf('0x8')}});exports[_0xcccf('0x9')]=function(_0x1404df,_0x466dc9,_0x3bfc3d,_0x3e8b14){return function(_0x1f9e0a){try{var _0x6ff7d9={'tag':_0x466dc9[0x0]};var _0x48490e=tag[_0xcccf('0xa')](_0x6ff7d9,{'typecast':!![]});if(_0x48490e[_0xcccf('0xb')]){logger[_0xcccf('0xc')](_0xcccf('0xd'),_0x1404df,_['map'](_0x48490e,_0xcccf('0xe'))['join'](',\x20'));logger[_0xcccf('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1404df);_0x1f9e0a['next']();}else{var _0x5ae11f={'ids':[_0x466dc9[0x0]]};if(rpc[_0x3e8b14[_0xcccf('0x10')]+_0xcccf('0x11')]){rpc[_0x3e8b14[_0xcccf('0x10')]+_0xcccf('0x11')]['addTags'](_0x3e8b14[_0xcccf('0x12')]['id'],_0x5ae11f)[_0xcccf('0x13')](function(_0x53436c){logger[_0xcccf('0xf')](_0xcccf('0x14'),_0x1404df,_0x466dc9[0x1],_0x3e8b14[_0xcccf('0x10')],_0x3e8b14['interaction']['id']);})[_0xcccf('0x15')](function(_0x336c2f){logger[_0xcccf('0xc')]('[%s][TAG]\x20%s',_0x1404df,JSON[_0xcccf('0x16')](_0x336c2f));logger[_0xcccf('0xf')](_0xcccf('0x17'),_0x1404df);})[_0xcccf('0x18')](function(){_0x1f9e0a[_0xcccf('0x19')]();});}}}catch(_0x458593){logger[_0xcccf('0xc')](_0xcccf('0xd'),_0x1404df,_[_0xcccf('0x1a')](_0x458593)?JSON[_0xcccf('0x16')](_0x458593):_0x458593);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1404df);_0x1f9e0a[_0xcccf('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 6c6bdce..5c5ce53 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 _0x387d=['urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','stringify','utf8','POST','application/json-rpc','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','info','stop','[%s][TVOX]\x20%s','isObject','next','request-promise','../../../../config/logger','replace','\x20-\x20','includes','push'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x387d,0xc5));var _0xd387=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x387d[_0x17d9e3];return _0x14192d;};'use strict';var rp=require(_0xd387('0x0'));var logger=require(_0xd387('0x1'))('routing');var _=require('lodash');var arr=[];exports['consequence']=function(_0x436b62,_0x145ea7){return function(_0x442217){var _0x4cff5b=_0x145ea7[0xa];var _0x493736=_0x145ea7[0xb];var _0x18efe8=_0x145ea7[0xc];var _0x334184=_0x145ea7[0xd];var _0x5d9e6c=_0x145ea7[0xe];var _0x2339de=_0x145ea7[0xf][_0xd387('0x2')](/\n/g,_0xd387('0x3'));var _0x11a697=_0x145ea7[0x10][_0xd387('0x2')](/\n/g,'\x20');if(!arr[_0xd387('0x4')](_0x493736)){arr[_0xd387('0x5')](_0x493736);var _0x49900c=_0x145ea7[0x3];var _0x3f2d65=_0x145ea7[0x4];var _0x595865=_0x145ea7[0x1];var _0x34bdf4=_0x145ea7[0x0];var _0x30a39b={};_0x30a39b[_0xd387('0x6')]=_0x145ea7[0x8]+_0xd387('0x7')+_0x18efe8+'|'+_0x4cff5b+'|'+_0x334184+'|'+_0x493736+'|'+_0x5d9e6c;_0x30a39b[_0xd387('0x8')]=_0x145ea7[0x7]+_0xd387('0x7')+_0x18efe8+'|'+_0x4cff5b+'|'+_0x334184+'|'+_0x493736+'|'+_0x5d9e6c+'|'+_0x2339de+'|'+_0x11a697;_0x30a39b[_0xd387('0x9')]=_0x145ea7[0x9];var _0x10a326={};_0x10a326[_0xd387('0xa')]=_0xd387('0xb');_0x10a326[_0xd387('0xc')]='login';var _0x501efc=[];_0x501efc['push'](_0x145ea7[0x2]);_0x501efc[_0xd387('0x5')](_0x145ea7[0x5]);_0x501efc[_0xd387('0x5')](_0x145ea7[0x6]);_0x10a326['params']=_0x501efc;_0x10a326['id']=0x1;var _0x249840=JSON[_0xd387('0xd')](_0x10a326);var _0x166150={'encoding':_0xd387('0xe'),'method':_0xd387('0xf'),'timeout':0x2710,'url':_0x49900c,'headers':{'Content-Type':_0xd387('0x10')},'body':_0x249840};return rp(_0x166150)[_0xd387('0x11')](function(_0x49d374){const _0x101a6c=JSON['parse'](_0x49d374);if(!_0x101a6c[_0xd387('0x12')][_0xd387('0x13')]){throw new Error(_0xd387('0x14'));}var _0x1dfec3=_0x493736;var _0x3325b5=_0xd387('0x15')+_0x595865+_0xd387('0x16')+_0x34bdf4+'&sessionId='+_0x1dfec3+_0xd387('0x17')+JSON[_0xd387('0xd')](_0x30a39b);var _0x3325d1=_0x3f2d65+'?'+_0x3325b5;return rp(_0x3325d1);})[_0xd387('0x11')](function(_0x4c5fd6){logger[_0xd387('0x18')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x436b62,_0x4c5fd6);_0x442217[_0xd387('0x19')]();})['catch'](function(_0x1fe1ec){logger['error'](_0xd387('0x1a'),_0x436b62,_[_0xd387('0x1b')](_0x1fe1ec)?JSON[_0xd387('0xd')](_0x1fe1ec):_0x1fe1ec);_0x442217[_0xd387('0x19')]();});}else{logger[_0xd387('0x18')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x436b62);_0x442217[_0xd387('0x1c')]();}};}; \ No newline at end of file +var _0xc4f3=['stringify','utf8','application/json-rpc','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','\x20-\x20','replace','includes','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','push','params'];(function(_0x3f7c88,_0x31d9cf){var _0x503b3b=function(_0x11c75c){while(--_0x11c75c){_0x3f7c88['push'](_0x3f7c88['shift']());}};_0x503b3b(++_0x31d9cf);}(_0xc4f3,0x1c2));var _0x3c4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4f3[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x3c4f('0x0'));var logger=require(_0x3c4f('0x1'))(_0x3c4f('0x2'));var _=require(_0x3c4f('0x3'));var arr=[];exports[_0x3c4f('0x4')]=function(_0x355350,_0x160215){return function(_0x3c2fb7){var _0x503932=_0x160215[0xa];var _0x259d37=_0x160215[0xb];var _0x45cf32=_0x160215[0xc];var _0x38ec0e=_0x160215[0xd];var _0x3eb46e=_0x160215[0xe];var _0x5b20f7=_0x160215[0xf]['replace'](/\n/g,_0x3c4f('0x5'));var _0x3ec564=_0x160215[0x10][_0x3c4f('0x6')](/\n/g,'\x20');if(!arr[_0x3c4f('0x7')](_0x259d37)){arr['push'](_0x259d37);var _0x1991e4=_0x160215[0x3];var _0x2cbedc=_0x160215[0x4];var _0x52d239=_0x160215[0x1];var _0x275867=_0x160215[0x0];var _0x4f83b8={};_0x4f83b8[_0x3c4f('0x8')]=_0x160215[0x8]+_0x3c4f('0x9')+_0x45cf32+'|'+_0x503932+'|'+_0x38ec0e+'|'+_0x259d37+'|'+_0x3eb46e;_0x4f83b8[_0x3c4f('0xa')]=_0x160215[0x7]+_0x3c4f('0x9')+_0x45cf32+'|'+_0x503932+'|'+_0x38ec0e+'|'+_0x259d37+'|'+_0x3eb46e+'|'+_0x5b20f7+'|'+_0x3ec564;_0x4f83b8[_0x3c4f('0xb')]=_0x160215[0x9];var _0x465496={};_0x465496[_0x3c4f('0xc')]=_0x3c4f('0xd');_0x465496[_0x3c4f('0xe')]=_0x3c4f('0xf');var _0x546ada=[];_0x546ada[_0x3c4f('0x10')](_0x160215[0x2]);_0x546ada[_0x3c4f('0x10')](_0x160215[0x5]);_0x546ada[_0x3c4f('0x10')](_0x160215[0x6]);_0x465496[_0x3c4f('0x11')]=_0x546ada;_0x465496['id']=0x1;var _0x4ef255=JSON[_0x3c4f('0x12')](_0x465496);var _0x3d06ed={'encoding':_0x3c4f('0x13'),'method':'POST','timeout':0x2710,'url':_0x1991e4,'headers':{'Content-Type':_0x3c4f('0x14')},'body':_0x4ef255};return rp(_0x3d06ed)[_0x3c4f('0x15')](function(_0x34802e){const _0x3b414d=JSON[_0x3c4f('0x16')](_0x34802e);if(!_0x3b414d['result'][_0x3c4f('0x17')]){throw new Error(_0x3c4f('0x18'));}var _0x1b1fe4=_0x259d37;var _0x128182='channelId='+_0x52d239+'&serviceId='+_0x275867+_0x3c4f('0x19')+_0x1b1fe4+_0x3c4f('0x1a')+JSON[_0x3c4f('0x12')](_0x4f83b8);var _0x1a24ad=_0x2cbedc+'?'+_0x128182;return rp(_0x1a24ad);})[_0x3c4f('0x15')](function(_0x4388e3){logger[_0x3c4f('0x1b')](_0x3c4f('0x1c'),_0x355350,_0x4388e3);_0x3c2fb7[_0x3c4f('0x1d')]();})[_0x3c4f('0x1e')](function(_0x260229){logger[_0x3c4f('0x1f')](_0x3c4f('0x20'),_0x355350,_[_0x3c4f('0x21')](_0x260229)?JSON[_0x3c4f('0x12')](_0x260229):_0x260229);_0x3c2fb7[_0x3c4f('0x1d')]();});}else{logger['info'](_0x3c4f('0x22'),_0x355350);_0x3c2fb7[_0x3c4f('0x23')]();}};}; \ 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 c774fd3..9a99930 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x575637,_0x145780){var _0x203d00=function(_0x23a65b){while(--_0x23a65b){_0x575637['push'](_0x575637['shift']());}};_0x203d00(++_0x145780);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x3f45db,_0xab4ef){var _0x5911db=function(_0x525dfa){while(--_0x525dfa){_0x3f45db['push'](_0x3f45db['shift']());}};_0x5911db(++_0xab4ef);}(_0xe706,0xa3));var _0x6e70=function(_0x48b4f9,_0xbbe897){_0x48b4f9=_0x48b4f9-0x0;var _0x30dda9=_0xe706[_0x48b4f9];return _0x30dda9;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 2cfa27d..a702cc3 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 _0x4e81=['push','slice','dialogflow','appdata','amazonlex','tag','TagId','tvox','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','matchPath','complete','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','stack','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','waiting','mailQueues','available','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','isArray','applications','length','join','app','.js','toLowerCase','split'];(function(_0x2abfa8,_0x449711){var _0x315c11=function(_0x18dd05){while(--_0x18dd05){_0x2abfa8['push'](_0x2abfa8['shift']());}};_0x315c11(++_0x449711);}(_0x4e81,0x1bc));var _0x14e8=function(_0x2e655a,_0x6d5799){_0x2e655a=_0x2e655a-0x0;var _0x26f13b=_0x4e81[_0x2e655a];return _0x26f13b;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var path=require(_0x14e8('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var uuid=require('uuid');var utils=require(_0x14e8('0x3'));var config=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var rpc={'openchannelQueueReport':require(_0x14e8('0x7')),'mailQueueReport':require(_0x14e8('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x14e8('0x9')),'whatsappQueueReport':require(_0x14e8('0xa'))};var RuleEngine=require(_0x14e8('0xb'));function getId(_0x3c1b93,_0x11ec3b,_0x20f053){return util[_0x14e8('0xc')](_0x14e8('0xd'),_0x3c1b93,_0x11ec3b||0x0,_0x20f053||0x0);}function getIntervals(_0x294b39,_0x5602cc){var _0xbd3b87=[];if(!_[_0x14e8('0xe')](_0x5602cc[_0x14e8('0xf')])&&!_[_0x14e8('0xe')](_0x294b39[_0x5602cc[_0x14e8('0xf')]])&&!_[_0x14e8('0xe')](_0x294b39[_0x5602cc[_0x14e8('0xf')]][_0x14e8('0x10')])){_0xbd3b87=_['map'](_0x294b39[_0x5602cc[_0x14e8('0xf')]]['Intervals'],_0x14e8('0x11'));}else if(!_[_0x14e8('0xe')](_0x5602cc[_0x14e8('0x11')])){_0xbd3b87=[_0x5602cc['interval']];}return _0xbd3b87;}exports[_0x14e8('0x12')]=function(_0x4e1064){_0x4e1064[_0x14e8('0x13')]={};return new BPromise(function(_0x58d26e,_0x347216){var _0x3761a1={'Start':function(_0xc6101f){var _0x135996=this;return new Promise(function(_0x52e64f,_0x10c4a9){if(_0xc6101f){try{var _0x3793a0=[];var _0x30581=getId(_0xc6101f[_0x14e8('0x14')],_0xc6101f[_0x14e8('0x15')]?_0xc6101f[_0x14e8('0x15')]['id']:0x0,_0xc6101f[_0x14e8('0x16')]?_0xc6101f[_0x14e8('0x16')]['id']:0x0);if(_0xc6101f['applications']&&_[_0x14e8('0x17')](_0xc6101f[_0x14e8('0x18')])&&_0xc6101f[_0x14e8('0x18')][_0x14e8('0x19')]){for(var _0x246c5d=0x0;_0x246c5d<_0xc6101f['applications'][_0x14e8('0x19')];_0x246c5d+=0x1){var _0x1cefdc=_0xc6101f[_0x14e8('0x18')][_0x246c5d];if(fs['existsSync'](path[_0x14e8('0x1a')](__dirname,'applications',_0x1cefdc[_0x14e8('0x1b')]+_0x14e8('0x1c')))){var _0x3e8d5c=[];switch(_0x1cefdc[_0x14e8('0x1b')][_0x14e8('0x1d')]()){case'autoreply':var _0xf6bbdc=_0x1cefdc['appdata'][_0x14e8('0x1e')](',');if(_0xc6101f[_0x14e8('0x14')]==='mail'){_0x3e8d5c['push'](_0xf6bbdc[0x0]);_0x3e8d5c['push'](_0xf6bbdc[0x1]);_0x3e8d5c[_0x14e8('0x1f')](_0xf6bbdc[_0x14e8('0x20')](0x2,_0xf6bbdc[_0x14e8('0x19')])[_0x14e8('0x1a')](','));}else{_0x3e8d5c[_0x14e8('0x1f')](_0xf6bbdc[0x0]);_0x3e8d5c['push'](_0xf6bbdc[_0x14e8('0x20')](0x1,_0xf6bbdc[_0x14e8('0x19')])[_0x14e8('0x1a')](','));}break;case _0x14e8('0x21'):var _0x28035a=_0x1cefdc[_0x14e8('0x22')][_0x14e8('0x1e')](',');_0x3e8d5c['push'](_0x28035a[0x0]);_0x3e8d5c[_0x14e8('0x1f')](_0x28035a[0x1]);_0x3e8d5c[_0x14e8('0x1f')](_0x28035a[_0x14e8('0x20')](0x2,_0x28035a['length'])['join'](','));break;case'dialogflowv2':var _0x8fe0e2=_0x1cefdc[_0x14e8('0x22')]['split'](',');_0x3e8d5c[_0x14e8('0x1f')](_0x8fe0e2[0x0]);_0x3e8d5c[_0x14e8('0x1f')](_0x8fe0e2[0x1]);_0x3e8d5c[_0x14e8('0x1f')](_0x8fe0e2[0x2]);_0x3e8d5c[_0x14e8('0x1f')](_0x8fe0e2[0x3]);_0x3e8d5c['push'](_0x8fe0e2[_0x14e8('0x20')](0x4,_0x8fe0e2[_0x14e8('0x19')])[_0x14e8('0x1a')](','));break;case _0x14e8('0x23'):var _0x2d0246=_0x1cefdc['appdata'][_0x14e8('0x1e')](',');_0x3e8d5c[_0x14e8('0x1f')](_0x2d0246[0x0]);_0x3e8d5c[_0x14e8('0x1f')](_0x2d0246[0x1]);_0x3e8d5c[_0x14e8('0x1f')](_0x2d0246[0x2]);_0x3e8d5c['push'](_0x2d0246[0x3]);_0x3e8d5c[_0x14e8('0x1f')](_0x2d0246['slice'](0x4,_0x2d0246[_0x14e8('0x19')])[_0x14e8('0x1a')](','));break;case _0x14e8('0x15'):_0x3e8d5c[_0x14e8('0x1f')](_0x1cefdc[_0x14e8('0x22')]);break;case _0x14e8('0x24'):_0x3e8d5c[_0x14e8('0x1f')](_0x1cefdc[_0x14e8('0x25')]);_0x3e8d5c[_0x14e8('0x1f')](_0x1cefdc[_0x14e8('0x22')]);break;case _0x14e8('0x26'):var _0x4411e9=utils['getMustacheRender'](_0xc6101f['account']['notificationTemplate'],_0xc6101f);var _0x16ff09=_0x1cefdc['appdata'][_0x14e8('0x1e')](',');_0x3e8d5c['push'](_0x16ff09[0x0]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x1]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x2]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x3]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x4]);_0x3e8d5c['push'](_0x16ff09[0x5]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x6]);_0x3e8d5c['push'](_0x16ff09[0x7]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x8]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x9]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0xa]);_0x3e8d5c[_0x14e8('0x1f')](_0xc6101f[_0x14e8('0x16')]['id']);_0x3e8d5c[_0x14e8('0x1f')](_0xc6101f['message']['id']);_0x3e8d5c[_0x14e8('0x1f')](_0x1cefdc['ChatWebsiteId']);_0x3e8d5c[_0x14e8('0x1f')](_0xc6101f[_0x14e8('0x16')][_0x14e8('0x27')]);_0x3e8d5c['push'](_0xc6101f[_0x14e8('0x28')][_0x14e8('0x28')]);_0x3e8d5c['push'](_0x4411e9);break;default:_0x3e8d5c=_[_0x14e8('0xe')](_0x1cefdc[_0x14e8('0x22')])?[]:_0x1cefdc[_0x14e8('0x22')][_0x14e8('0x1e')](',');}var _0x77e8a0={'id':util[_0x14e8('0xc')](_0x14e8('0x29'),_0x30581,_0x1cefdc['id'],_0x1cefdc[_0x14e8('0x1b')]),'condition':require(_0x14e8('0x2a'))[_0x14e8('0x2b')](_0x30581,getIntervals(_0x4e1064[_0x14e8('0x2c')],_0x1cefdc),_0x4e1064),'consequence':require(_0x14e8('0x2d')+_0x1cefdc[_0x14e8('0x1b')])[_0x14e8('0x2e')](_0x30581,_0x3e8d5c,_0x4e1064,_0xc6101f),'p':_0x1cefdc[_0x14e8('0x2f')]||0x0};logger['info'](_0x14e8('0x30'),_0x77e8a0['id'],'on\x20interval',getIntervals(_0x4e1064['intervals'],_0x1cefdc)['join'](_0x14e8('0x31')));_0x3793a0['push'](_0x77e8a0);}else{logger[_0x14e8('0x32')](_0x14e8('0x33'),path[_0x14e8('0x1a')](__dirname,_0x14e8('0x18'),_0x1cefdc[_0x14e8('0x1b')]+_0x14e8('0x1c')));}}_0x4e1064[_0x14e8('0x13')][_0x30581]=new RuleEngine(_0x3793a0);_0x4e1064[_0x14e8('0x13')][_0x30581][_0x14e8('0x34')](_0xc6101f,function(_0x3f9da0){logger[_0x14e8('0x35')]('Applications\x20executed',JSON[_0x14e8('0x36')](_0x3f9da0[_0x14e8('0x37')]));if(_0x4e1064[_0x14e8('0x13')][_0x30581]){_0x4e1064[_0x14e8('0x13')][_0x30581]['emit'](_0x14e8('0x38'));}});return _0x52e64f({'code':0xc8,'message':_0xc6101f});}else{logger[_0x14e8('0x35')]('No\x20applications\x20to\x20execute');return _0x52e64f({'code':0xc8,'message':_0xc6101f});}}catch(_0x553002){logger[_0x14e8('0x32')](_0x553002['stack']);return _0x10c4a9(_0x135996['error'](0x1f4,_0x553002));}}return _0x10c4a9(_0x14e8('0x39'));});},'AcceptMessage':function(_0xce1e17){var _0x578d48=this;return new Promise(function(_0x31fd95,_0x11455b){if(_0xce1e17['agent']&&_0xce1e17[_0x14e8('0x3a')]['id']){if(_0x4e1064[_0x14e8('0x3b')][_0xce1e17[_0x14e8('0x3a')]['id']]){_0x4e1064[_0x14e8('0x3b')][_0xce1e17[_0x14e8('0x3a')]['id']][_0x14e8('0x3c')]=![];_0x4e1064[_0x14e8('0x3b')][_0xce1e17[_0x14e8('0x3a')]['id']][_0x14e8('0x3d')]=undefined;}}if(_0xce1e17[_0x14e8('0x15')]&&_0xce1e17[_0x14e8('0x15')]['id']){try{var _0x4083b8=getId(_0xce1e17[_0x14e8('0x14')],_0xce1e17[_0x14e8('0x15')]?_0xce1e17[_0x14e8('0x15')]['id']:0x0,_0xce1e17[_0x14e8('0x16')]?_0xce1e17['interaction']['id']:0x0);if(_0x4e1064[_0x14e8('0x13')][_0x4083b8]){_0x4e1064['rules'][_0x4083b8][_0x14e8('0x3e')](_0x14e8('0x3f'));if(rpc[_0xce1e17[_0x14e8('0x14')]+_0x14e8('0x40')]){rpc[_0xce1e17['channel']+'QueueReport']['update'](_0x4083b8,{'UserId':_0xce1e17[_0x14e8('0x15')]['UserId']})['catch'](function(_0xd2b281){logger[_0x14e8('0x32')]('error\x20update\x20queue\x20report');});}}return _0x31fd95({'code':0xc8,'message':_0xce1e17});}catch(_0x15058e){logger[_0x14e8('0x32')](_0x15058e[_0x14e8('0x41')]);return _0x11455b(_0x578d48[_0x14e8('0x32')](0x1f4,_0x15058e));}}logger['error']('message\x20is\x20empty');return _0x11455b(_0x578d48[_0x14e8('0x32')](0x1f4,_0x14e8('0x42')));});},'RejectMessage':function(_0x15464a){var _0x3a09b7=this;return new Promise(function(_0x41b5ab,_0x2fbac7){if(_0x15464a['agent']&&_0x15464a[_0x14e8('0x3a')]['id']){try{if(_0x4e1064[_0x14e8('0x3b')][_0x15464a[_0x14e8('0x3a')]['id']]){_0x4e1064[_0x14e8('0x3b')][_0x15464a['agent']['id']][_0x14e8('0x3c')]=![];_0x4e1064[_0x14e8('0x3b')][_0x15464a[_0x14e8('0x3a')]['id']][_0x14e8('0x3d')]=undefined;}return _0x41b5ab({'code':0xc8,'message':_0x15464a});}catch(_0x5d7e49){logger[_0x14e8('0x32')](_0x5d7e49[_0x14e8('0x41')]);return _0x2fbac7(_0x3a09b7[_0x14e8('0x32')](0x1f4,_0x5d7e49));}}logger[_0x14e8('0x32')](_0x14e8('0x42'));return _0x2fbac7(_0x3a09b7[_0x14e8('0x32')](0x1f4,_0x14e8('0x42')));});},'AbandonInteraction':function(_0x168b8a){var _0x5ab659=this;return new Promise(function(_0x5a1f22,_0x2fcc63){if(_0x168b8a[_0x14e8('0x14')]&&_0x168b8a[_0x14e8('0x16')]&&_0x168b8a[_0x14e8('0x16')]['id']){try{var _0x3f0b2a=getId(_0x168b8a['channel'],_0x168b8a['message']?_0x168b8a['message']['id']:0x0,_0x168b8a[_0x14e8('0x16')]?_0x168b8a[_0x14e8('0x16')]['id']:0x0);if(_0x4e1064[_0x14e8('0x13')][_0x3f0b2a]){_0x4e1064['rules'][_0x3f0b2a][_0x14e8('0x3e')](_0x14e8('0x3f'));}return _0x5a1f22({'code':0xc8,'message':_0x168b8a});}catch(_0x1d6683){logger['error'](_0x1d6683[_0x14e8('0x41')]);return _0x2fcc63(_0x5ab659[_0x14e8('0x32')](0x1f4,_0x1d6683));}}logger[_0x14e8('0x32')](_0x14e8('0x42'));return _0x2fcc63(_0x5ab659[_0x14e8('0x32')](0x1f4,_0x14e8('0x42')));});},'AgentCapacity':function(_0x3a157c){var _0x12a2b3=this;return new Promise(function(_0x2da07b,_0x455764){if(_0x4e1064[_0x14e8('0x3b')]['hasOwnProperty'](_0x3a157c['id'])){for(var _0x35e1ea in _0x3a157c[_0x14e8('0x43')]){if(_0x3a157c[_0x14e8('0x43')][_0x14e8('0x44')](_0x35e1ea)){if(_0x4e1064[_0x14e8('0x3b')][_0x3a157c['id']][_0x14e8('0x44')](_0x35e1ea+_0x14e8('0x45'))){_0x4e1064[_0x14e8('0x3b')][_0x3a157c['id']][_0x35e1ea+_0x14e8('0x45')]=parseInt(_0x3a157c[_0x14e8('0x43')][_0x35e1ea],0xa);}}}_0x4e1064[_0x14e8('0x3b')][_0x3a157c['id']][_0x14e8('0x46')]();return _0x2da07b({'code':0xc8,'message':_0x4e1064['agents'][_0x3a157c['id']]});}else{return _0x455764(_0x12a2b3[_0x14e8('0x32')](0x1f4,_0x14e8('0x47')));}});},'Agents':function(_0x5a35a0){return new Promise(function(_0x27315f,_0x2c2630){var _0x31e785=_[_0x14e8('0x48')](_0x4e1064[_0x14e8('0x3b')]);_0x27315f({'count':_0x31e785[_0x14e8('0x19')],'rows':_0x31e785});});},'ChatQueues':function(_0x139405){return new Promise(function(_0x5b6e28,_0x4c30dd){var _0x5c1609=[];for(var _0x17cded in _0x4e1064[_0x14e8('0x49')]){if(_0x4e1064[_0x14e8('0x49')][_0x14e8('0x44')](_0x17cded)){var _0x39de9d=_0x4e1064[_0x14e8('0x49')][_0x17cded];var _0x402956={'id':_0x39de9d['id'],'available':_0x39de9d['available'],'loggedIn':_0x39de9d[_0x14e8('0x4a')],'name':_0x39de9d[_0x14e8('0x4b')],'paused':_0x39de9d['paused'],'waiting':_0x39de9d[_0x14e8('0x4c')]};_0x5c1609[_0x14e8('0x1f')](_0x402956);}}_0x5b6e28({'count':_0x5c1609['length'],'rows':_0x5c1609});});},'MailQueues':function(_0x58fa2e){return new Promise(function(_0x5efe1b,_0x379734){var _0xf0cae3=[];for(var _0x1109d3 in _0x4e1064[_0x14e8('0x4d')]){if(_0x4e1064['mailQueues'][_0x14e8('0x44')](_0x1109d3)){var _0x62a69c=_0x4e1064[_0x14e8('0x4d')][_0x1109d3];var _0x2e7956={'id':_0x62a69c['id'],'available':_0x62a69c[_0x14e8('0x4e')],'loggedIn':_0x62a69c[_0x14e8('0x4a')],'name':_0x62a69c['name'],'paused':_0x62a69c[_0x14e8('0x4f')],'waiting':_0x62a69c[_0x14e8('0x4c')]};_0xf0cae3[_0x14e8('0x1f')](_0x2e7956);}}_0x5efe1b({'count':_0xf0cae3['length'],'rows':_0xf0cae3});});},'OpenchannelQueues':function(_0x5add74){return new Promise(function(_0x20a598,_0x53d0c8){var _0x25f63c=[];for(var _0x5cbce8 in _0x4e1064[_0x14e8('0x50')]){if(_0x4e1064['openchannelQueues'][_0x14e8('0x44')](_0x5cbce8)){var _0x362bda=_0x4e1064['openchannelQueues'][_0x5cbce8];var _0x1daa74={'id':_0x362bda['id'],'available':_0x362bda[_0x14e8('0x4e')],'loggedIn':_0x362bda[_0x14e8('0x4a')],'name':_0x362bda[_0x14e8('0x4b')],'paused':_0x362bda[_0x14e8('0x4f')],'waiting':_0x362bda[_0x14e8('0x4c')]};_0x25f63c[_0x14e8('0x1f')](_0x1daa74);}}_0x20a598({'count':_0x25f63c[_0x14e8('0x19')],'rows':_0x25f63c});});},'SmsQueues':function(_0x24ad58){return new Promise(function(_0x3858cf,_0x1bc9c1){var _0x2e0e7d=[];for(var _0x316a7e in _0x4e1064['smsQueues']){if(_0x4e1064['smsQueues']['hasOwnProperty'](_0x316a7e)){var _0xd7427f=_0x4e1064[_0x14e8('0x51')][_0x316a7e];var _0x10e994={'id':_0xd7427f['id'],'available':_0xd7427f['available'],'loggedIn':_0xd7427f[_0x14e8('0x4a')],'name':_0xd7427f['name'],'paused':_0xd7427f['paused'],'waiting':_0xd7427f['waiting']};_0x2e0e7d[_0x14e8('0x1f')](_0x10e994);}}_0x3858cf({'count':_0x2e0e7d[_0x14e8('0x19')],'rows':_0x2e0e7d});});},'FaxQueues':function(_0x17f546){return new Promise(function(_0x4d29e3,_0xfc647b){var _0x4f83e9=[];for(var _0x36a4e0 in _0x4e1064[_0x14e8('0x52')]){if(_0x4e1064[_0x14e8('0x52')][_0x14e8('0x44')](_0x36a4e0)){var _0x3ab99d=_0x4e1064[_0x14e8('0x52')][_0x36a4e0];var _0x1918bb={'id':_0x3ab99d['id'],'available':_0x3ab99d[_0x14e8('0x4e')],'loggedIn':_0x3ab99d[_0x14e8('0x4a')],'name':_0x3ab99d['name'],'paused':_0x3ab99d[_0x14e8('0x4f')],'waiting':_0x3ab99d['waiting']};_0x4f83e9[_0x14e8('0x1f')](_0x1918bb);}}_0x4d29e3({'count':_0x4f83e9[_0x14e8('0x19')],'rows':_0x4f83e9});});},'WhatsappQueues':function(_0x53b143){return new Promise(function(_0x33552f,_0x168397){var _0x1ba2a7=[];for(var _0x3b5131 in _0x4e1064[_0x14e8('0x53')]){if(_0x4e1064[_0x14e8('0x53')]['hasOwnProperty'](_0x3b5131)){var _0x33abe5=_0x4e1064[_0x14e8('0x53')][_0x3b5131];var _0xc8b6c1={'id':_0x33abe5['id'],'available':_0x33abe5[_0x14e8('0x4e')],'loggedIn':_0x33abe5['loggedIn'],'name':_0x33abe5[_0x14e8('0x4b')],'paused':_0x33abe5[_0x14e8('0x4f')],'waiting':_0x33abe5[_0x14e8('0x4c')]};_0x1ba2a7[_0x14e8('0x1f')](_0xc8b6c1);}}_0x33552f({'count':_0x1ba2a7['length'],'rows':_0x1ba2a7});});},'ChatQueuesWaitingInteractions':function(_0x23c21f){return new Promise(function(_0x5b7f09,_0x1e8886){var _0x4bbfe3=_['values'](_0x4e1064[_0x14e8('0x54')]);_0x5b7f09({'count':_0x4bbfe3[_0x14e8('0x19')],'rows':_0x4bbfe3});});},'MailQueuesWaitingInteractions':function(_0x392bd1){return new Promise(function(_0x11b496,_0xe8425f){var _0xfa52f=_[_0x14e8('0x48')](_0x4e1064[_0x14e8('0x55')]);_0x11b496({'count':_0xfa52f[_0x14e8('0x19')],'rows':_0xfa52f});});},'OpenchannelQueuesWaitingInteractions':function(_0x280a8c){return new Promise(function(_0x2ae8aa,_0x4f6c35){var _0x43dbee=_[_0x14e8('0x48')](_0x4e1064[_0x14e8('0x56')]);_0x2ae8aa({'count':_0x43dbee['length'],'rows':_0x43dbee});});},'SmsQueuesWaitingInteractions':function(_0x5a9e57){return new Promise(function(_0x2e24fa,_0x368292){var _0xc3ebbc=_[_0x14e8('0x48')](_0x4e1064[_0x14e8('0x57')]);_0x2e24fa({'count':_0xc3ebbc[_0x14e8('0x19')],'rows':_0xc3ebbc});});},'FaxQueuesWaitingInteractions':function(_0x7ad347){return new Promise(function(_0x196815,_0xe0027d){var _0x2cd26c=_[_0x14e8('0x48')](_0x4e1064[_0x14e8('0x58')]);_0x196815({'count':_0x2cd26c[_0x14e8('0x19')],'rows':_0x2cd26c});});},'WhatsappQueuesWaitingInteractions':function(_0x13ffd2){return new Promise(function(_0x5c6fcb,_0x37e95e){var _0x5ba06e=_[_0x14e8('0x48')](_0x4e1064[_0x14e8('0x59')]);_0x5c6fcb({'count':_0x5ba06e[_0x14e8('0x19')],'rows':_0x5ba06e});});}};var _0x177d9c=jayson[_0x14e8('0x5a')](_0x3761a1)[_0x14e8('0x5b')]();_0x177d9c['on']('error',function(_0x755ab8){logger[_0x14e8('0x32')](JSON['stringify'](_0x755ab8));return _0x347216(_0x755ab8);});_0x177d9c[_0x14e8('0x12')](0x232c,_0x14e8('0x5c'),function(){console[_0x14e8('0x5d')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x58d26e(_0x14e8('0x5e')+0x232c);});});}; \ No newline at end of file +var _0x9e5e=['stringify','127.0.0.1','lodash','util','jayson/promise','bluebird','uuid','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','map','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','TagId','tvox','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','intervals','consequence','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','matchPath','emit','complete','No\x20applications\x20to\x20execute','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','stack','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http'];(function(_0x18fd1a,_0x5e328a){var _0xc6dc88=function(_0x370ae6){while(--_0x370ae6){_0x18fd1a['push'](_0x18fd1a['shift']());}};_0xc6dc88(++_0x5e328a);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x9e5e[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xe9e5('0x0'));var util=require(_0xe9e5('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0xe9e5('0x2'));var BPromise=require(_0xe9e5('0x3'));var uuid=require(_0xe9e5('0x4'));var utils=require('./applications/utils');var config=require(_0xe9e5('0x5'));var logger=require('../../../config/logger')(_0xe9e5('0x6'));var rpc={'openchannelQueueReport':require(_0xe9e5('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xe9e5('0x8')),'faxQueueReport':require(_0xe9e5('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0xe9e5('0xa'));function getId(_0x2533d8,_0x3c5c1b,_0x6325f0){return util[_0xe9e5('0xb')](_0xe9e5('0xc'),_0x2533d8,_0x3c5c1b||0x0,_0x6325f0||0x0);}function getIntervals(_0x18d1ee,_0x28a123){var _0x2a58fb=[];if(!_['isNil'](_0x28a123[_0xe9e5('0xd')])&&!_[_0xe9e5('0xe')](_0x18d1ee[_0x28a123['IntervalId']])&&!_['isNil'](_0x18d1ee[_0x28a123['IntervalId']]['Intervals'])){_0x2a58fb=_[_0xe9e5('0xf')](_0x18d1ee[_0x28a123[_0xe9e5('0xd')]][_0xe9e5('0x10')],_0xe9e5('0x11'));}else if(!_[_0xe9e5('0xe')](_0x28a123[_0xe9e5('0x11')])){_0x2a58fb=[_0x28a123[_0xe9e5('0x11')]];}return _0x2a58fb;}exports[_0xe9e5('0x12')]=function(_0x3097da){_0x3097da[_0xe9e5('0x13')]={};return new BPromise(function(_0x5c901a,_0x2787c3){var _0xd07ceb={'Start':function(_0x35c830){var _0x3f0990=this;return new Promise(function(_0x17990d,_0x695c52){if(_0x35c830){try{var _0xf81b58=[];var _0x293c5b=getId(_0x35c830[_0xe9e5('0x14')],_0x35c830[_0xe9e5('0x15')]?_0x35c830['message']['id']:0x0,_0x35c830[_0xe9e5('0x16')]?_0x35c830[_0xe9e5('0x16')]['id']:0x0);if(_0x35c830[_0xe9e5('0x17')]&&_[_0xe9e5('0x18')](_0x35c830[_0xe9e5('0x17')])&&_0x35c830[_0xe9e5('0x17')][_0xe9e5('0x19')]){for(var _0x44e60d=0x0;_0x44e60d<_0x35c830[_0xe9e5('0x17')][_0xe9e5('0x19')];_0x44e60d+=0x1){var _0x5621f9=_0x35c830['applications'][_0x44e60d];if(fs['existsSync'](path[_0xe9e5('0x1a')](__dirname,_0xe9e5('0x17'),_0x5621f9[_0xe9e5('0x1b')]+_0xe9e5('0x1c')))){var _0x4143dc=[];switch(_0x5621f9[_0xe9e5('0x1b')][_0xe9e5('0x1d')]()){case _0xe9e5('0x1e'):var _0xa7fa64=_0x5621f9[_0xe9e5('0x1f')][_0xe9e5('0x20')](',');if(_0x35c830['channel']===_0xe9e5('0x21')){_0x4143dc['push'](_0xa7fa64[0x0]);_0x4143dc[_0xe9e5('0x22')](_0xa7fa64[0x1]);_0x4143dc['push'](_0xa7fa64[_0xe9e5('0x23')](0x2,_0xa7fa64['length'])['join'](','));}else{_0x4143dc['push'](_0xa7fa64[0x0]);_0x4143dc[_0xe9e5('0x22')](_0xa7fa64[_0xe9e5('0x23')](0x1,_0xa7fa64[_0xe9e5('0x19')])[_0xe9e5('0x1a')](','));}break;case _0xe9e5('0x24'):var _0x396202=_0x5621f9[_0xe9e5('0x1f')][_0xe9e5('0x20')](',');_0x4143dc[_0xe9e5('0x22')](_0x396202[0x0]);_0x4143dc[_0xe9e5('0x22')](_0x396202[0x1]);_0x4143dc['push'](_0x396202[_0xe9e5('0x23')](0x2,_0x396202['length'])[_0xe9e5('0x1a')](','));break;case _0xe9e5('0x25'):var _0x554bcb=_0x5621f9[_0xe9e5('0x1f')][_0xe9e5('0x20')](',');_0x4143dc[_0xe9e5('0x22')](_0x554bcb[0x0]);_0x4143dc['push'](_0x554bcb[0x1]);_0x4143dc[_0xe9e5('0x22')](_0x554bcb[0x2]);_0x4143dc['push'](_0x554bcb[0x3]);_0x4143dc[_0xe9e5('0x22')](_0x554bcb[_0xe9e5('0x23')](0x4,_0x554bcb['length'])[_0xe9e5('0x1a')](','));break;case _0xe9e5('0x26'):var _0x50cf20=_0x5621f9[_0xe9e5('0x1f')][_0xe9e5('0x20')](',');_0x4143dc[_0xe9e5('0x22')](_0x50cf20[0x0]);_0x4143dc[_0xe9e5('0x22')](_0x50cf20[0x1]);_0x4143dc[_0xe9e5('0x22')](_0x50cf20[0x2]);_0x4143dc[_0xe9e5('0x22')](_0x50cf20[0x3]);_0x4143dc['push'](_0x50cf20['slice'](0x4,_0x50cf20[_0xe9e5('0x19')])[_0xe9e5('0x1a')](','));break;case'message':_0x4143dc[_0xe9e5('0x22')](_0x5621f9[_0xe9e5('0x1f')]);break;case'tag':_0x4143dc['push'](_0x5621f9[_0xe9e5('0x27')]);_0x4143dc['push'](_0x5621f9['appdata']);break;case _0xe9e5('0x28'):var _0x21159b=utils[_0xe9e5('0x29')](_0x35c830[_0xe9e5('0x2a')][_0xe9e5('0x2b')],_0x35c830);var _0x152f74=_0x5621f9[_0xe9e5('0x1f')][_0xe9e5('0x20')](',');_0x4143dc[_0xe9e5('0x22')](_0x152f74[0x0]);_0x4143dc[_0xe9e5('0x22')](_0x152f74[0x1]);_0x4143dc[_0xe9e5('0x22')](_0x152f74[0x2]);_0x4143dc[_0xe9e5('0x22')](_0x152f74[0x3]);_0x4143dc[_0xe9e5('0x22')](_0x152f74[0x4]);_0x4143dc['push'](_0x152f74[0x5]);_0x4143dc[_0xe9e5('0x22')](_0x152f74[0x6]);_0x4143dc[_0xe9e5('0x22')](_0x152f74[0x7]);_0x4143dc[_0xe9e5('0x22')](_0x152f74[0x8]);_0x4143dc[_0xe9e5('0x22')](_0x152f74[0x9]);_0x4143dc[_0xe9e5('0x22')](_0x152f74[0xa]);_0x4143dc[_0xe9e5('0x22')](_0x35c830['interaction']['id']);_0x4143dc[_0xe9e5('0x22')](_0x35c830[_0xe9e5('0x15')]['id']);_0x4143dc[_0xe9e5('0x22')](_0x5621f9['ChatWebsiteId']);_0x4143dc[_0xe9e5('0x22')](_0x35c830[_0xe9e5('0x16')][_0xe9e5('0x2c')]);_0x4143dc[_0xe9e5('0x22')](_0x35c830[_0xe9e5('0x2d')][_0xe9e5('0x2d')]);_0x4143dc[_0xe9e5('0x22')](_0x21159b);break;default:_0x4143dc=_['isNil'](_0x5621f9['appdata'])?[]:_0x5621f9[_0xe9e5('0x1f')][_0xe9e5('0x20')](',');}var _0x39e091={'id':util[_0xe9e5('0xb')](_0xe9e5('0x2e'),_0x293c5b,_0x5621f9['id'],_0x5621f9['app']),'condition':require(_0xe9e5('0x2f'))['condition'](_0x293c5b,getIntervals(_0x3097da[_0xe9e5('0x30')],_0x5621f9),_0x3097da),'consequence':require('./applications/'+_0x5621f9[_0xe9e5('0x1b')])[_0xe9e5('0x31')](_0x293c5b,_0x4143dc,_0x3097da,_0x35c830),'p':_0x5621f9['priority']||0x0};logger[_0xe9e5('0x32')]('Push\x20new\x20rule',_0x39e091['id'],_0xe9e5('0x33'),getIntervals(_0x3097da[_0xe9e5('0x30')],_0x5621f9)[_0xe9e5('0x1a')](_0xe9e5('0x34')));_0xf81b58[_0xe9e5('0x22')](_0x39e091);}else{logger[_0xe9e5('0x35')](_0xe9e5('0x36'),path[_0xe9e5('0x1a')](__dirname,_0xe9e5('0x17'),_0x5621f9[_0xe9e5('0x1b')]+_0xe9e5('0x1c')));}}_0x3097da['rules'][_0x293c5b]=new RuleEngine(_0xf81b58);_0x3097da[_0xe9e5('0x13')][_0x293c5b][_0xe9e5('0x37')](_0x35c830,function(_0x2e1872){logger[_0xe9e5('0x32')]('Applications\x20executed',JSON['stringify'](_0x2e1872[_0xe9e5('0x38')]));if(_0x3097da['rules'][_0x293c5b]){_0x3097da[_0xe9e5('0x13')][_0x293c5b][_0xe9e5('0x39')](_0xe9e5('0x3a'));}});return _0x17990d({'code':0xc8,'message':_0x35c830});}else{logger[_0xe9e5('0x32')](_0xe9e5('0x3b'));return _0x17990d({'code':0xc8,'message':_0x35c830});}}catch(_0x5e75da){logger[_0xe9e5('0x35')](_0x5e75da['stack']);return _0x695c52(_0x3f0990['error'](0x1f4,_0x5e75da));}}return _0x695c52('routing\x20is\x20empty');});},'AcceptMessage':function(_0x3bd78a){var _0x4e92d1=this;return new Promise(function(_0x2fc6b7,_0x11c853){if(_0x3bd78a[_0xe9e5('0x3c')]&&_0x3bd78a[_0xe9e5('0x3c')]['id']){if(_0x3097da[_0xe9e5('0x3d')][_0x3bd78a[_0xe9e5('0x3c')]['id']]){_0x3097da['agents'][_0x3bd78a[_0xe9e5('0x3c')]['id']][_0xe9e5('0x3e')]=![];_0x3097da[_0xe9e5('0x3d')][_0x3bd78a[_0xe9e5('0x3c')]['id']][_0xe9e5('0x3f')]=undefined;}}if(_0x3bd78a[_0xe9e5('0x15')]&&_0x3bd78a[_0xe9e5('0x15')]['id']){try{var _0x5aa117=getId(_0x3bd78a['channel'],_0x3bd78a[_0xe9e5('0x15')]?_0x3bd78a['message']['id']:0x0,_0x3bd78a[_0xe9e5('0x16')]?_0x3bd78a[_0xe9e5('0x16')]['id']:0x0);if(_0x3097da[_0xe9e5('0x13')][_0x5aa117]){_0x3097da['rules'][_0x5aa117][_0xe9e5('0x39')](_0xe9e5('0x40'));if(rpc[_0x3bd78a[_0xe9e5('0x14')]+_0xe9e5('0x41')]){rpc[_0x3bd78a['channel']+_0xe9e5('0x41')][_0xe9e5('0x42')](_0x5aa117,{'UserId':_0x3bd78a[_0xe9e5('0x15')][_0xe9e5('0x43')]})[_0xe9e5('0x44')](function(_0x23cee5){logger[_0xe9e5('0x35')](_0xe9e5('0x45'));});}}return _0x2fc6b7({'code':0xc8,'message':_0x3bd78a});}catch(_0x44ca93){logger['error'](_0x44ca93['stack']);return _0x11c853(_0x4e92d1[_0xe9e5('0x35')](0x1f4,_0x44ca93));}}logger[_0xe9e5('0x35')](_0xe9e5('0x46'));return _0x11c853(_0x4e92d1[_0xe9e5('0x35')](0x1f4,_0xe9e5('0x46')));});},'RejectMessage':function(_0x19ad88){var _0x42ce27=this;return new Promise(function(_0x28439f,_0x47d74b){if(_0x19ad88['agent']&&_0x19ad88['agent']['id']){try{if(_0x3097da[_0xe9e5('0x3d')][_0x19ad88[_0xe9e5('0x3c')]['id']]){_0x3097da[_0xe9e5('0x3d')][_0x19ad88[_0xe9e5('0x3c')]['id']][_0xe9e5('0x3e')]=![];_0x3097da[_0xe9e5('0x3d')][_0x19ad88[_0xe9e5('0x3c')]['id']]['busyQueue']=undefined;}return _0x28439f({'code':0xc8,'message':_0x19ad88});}catch(_0xd6b0ed){logger['error'](_0xd6b0ed[_0xe9e5('0x47')]);return _0x47d74b(_0x42ce27[_0xe9e5('0x35')](0x1f4,_0xd6b0ed));}}logger[_0xe9e5('0x35')]('message\x20is\x20empty');return _0x47d74b(_0x42ce27[_0xe9e5('0x35')](0x1f4,_0xe9e5('0x46')));});},'AbandonInteraction':function(_0x4c6890){var _0x497f99=this;return new Promise(function(_0xea4d62,_0x30586f){if(_0x4c6890[_0xe9e5('0x14')]&&_0x4c6890[_0xe9e5('0x16')]&&_0x4c6890[_0xe9e5('0x16')]['id']){try{var _0x3fec01=getId(_0x4c6890[_0xe9e5('0x14')],_0x4c6890['message']?_0x4c6890[_0xe9e5('0x15')]['id']:0x0,_0x4c6890[_0xe9e5('0x16')]?_0x4c6890[_0xe9e5('0x16')]['id']:0x0);if(_0x3097da['rules'][_0x3fec01]){_0x3097da[_0xe9e5('0x13')][_0x3fec01][_0xe9e5('0x39')]('end');}return _0xea4d62({'code':0xc8,'message':_0x4c6890});}catch(_0x3749e2){logger[_0xe9e5('0x35')](_0x3749e2[_0xe9e5('0x47')]);return _0x30586f(_0x497f99['error'](0x1f4,_0x3749e2));}}logger[_0xe9e5('0x35')](_0xe9e5('0x46'));return _0x30586f(_0x497f99[_0xe9e5('0x35')](0x1f4,_0xe9e5('0x46')));});},'AgentCapacity':function(_0x2cacd8){var _0x33ea59=this;return new Promise(function(_0x10b48b,_0x19e244){if(_0x3097da['agents']['hasOwnProperty'](_0x2cacd8['id'])){for(var _0x3312fc in _0x2cacd8[_0xe9e5('0x48')]){if(_0x2cacd8[_0xe9e5('0x48')][_0xe9e5('0x49')](_0x3312fc)){if(_0x3097da[_0xe9e5('0x3d')][_0x2cacd8['id']][_0xe9e5('0x49')](_0x3312fc+_0xe9e5('0x4a'))){_0x3097da['agents'][_0x2cacd8['id']][_0x3312fc+_0xe9e5('0x4a')]=parseInt(_0x2cacd8[_0xe9e5('0x48')][_0x3312fc],0xa);}}}_0x3097da[_0xe9e5('0x3d')][_0x2cacd8['id']][_0xe9e5('0x4b')]();return _0x10b48b({'code':0xc8,'message':_0x3097da['agents'][_0x2cacd8['id']]});}else{return _0x19e244(_0x33ea59['error'](0x1f4,_0xe9e5('0x4c')));}});},'Agents':function(_0x28aac2){return new Promise(function(_0x392011,_0x504d47){var _0x49d6bb=_['values'](_0x3097da[_0xe9e5('0x3d')]);_0x392011({'count':_0x49d6bb[_0xe9e5('0x19')],'rows':_0x49d6bb});});},'ChatQueues':function(_0x335685){return new Promise(function(_0x19bcd6,_0x2da8ad){var _0x1b4661=[];for(var _0xd51f88 in _0x3097da['chatQueues']){if(_0x3097da[_0xe9e5('0x4d')]['hasOwnProperty'](_0xd51f88)){var _0x5eddd1=_0x3097da[_0xe9e5('0x4d')][_0xd51f88];var _0x1e3373={'id':_0x5eddd1['id'],'available':_0x5eddd1[_0xe9e5('0x4e')],'loggedIn':_0x5eddd1[_0xe9e5('0x4f')],'name':_0x5eddd1[_0xe9e5('0x50')],'paused':_0x5eddd1[_0xe9e5('0x51')],'waiting':_0x5eddd1[_0xe9e5('0x52')]};_0x1b4661[_0xe9e5('0x22')](_0x1e3373);}}_0x19bcd6({'count':_0x1b4661[_0xe9e5('0x19')],'rows':_0x1b4661});});},'MailQueues':function(_0x5b2b52){return new Promise(function(_0xb7373a,_0x5a573e){var _0x59a804=[];for(var _0x5e0208 in _0x3097da[_0xe9e5('0x53')]){if(_0x3097da[_0xe9e5('0x53')][_0xe9e5('0x49')](_0x5e0208)){var _0x2ef04e=_0x3097da[_0xe9e5('0x53')][_0x5e0208];var _0x112e9e={'id':_0x2ef04e['id'],'available':_0x2ef04e[_0xe9e5('0x4e')],'loggedIn':_0x2ef04e['loggedIn'],'name':_0x2ef04e[_0xe9e5('0x50')],'paused':_0x2ef04e[_0xe9e5('0x51')],'waiting':_0x2ef04e[_0xe9e5('0x52')]};_0x59a804[_0xe9e5('0x22')](_0x112e9e);}}_0xb7373a({'count':_0x59a804[_0xe9e5('0x19')],'rows':_0x59a804});});},'OpenchannelQueues':function(_0x358dbd){return new Promise(function(_0x15d799,_0x17dcb9){var _0x3f655c=[];for(var _0x54ba7e in _0x3097da[_0xe9e5('0x54')]){if(_0x3097da['openchannelQueues']['hasOwnProperty'](_0x54ba7e)){var _0xdceeb2=_0x3097da['openchannelQueues'][_0x54ba7e];var _0x41b3d2={'id':_0xdceeb2['id'],'available':_0xdceeb2[_0xe9e5('0x4e')],'loggedIn':_0xdceeb2['loggedIn'],'name':_0xdceeb2[_0xe9e5('0x50')],'paused':_0xdceeb2['paused'],'waiting':_0xdceeb2[_0xe9e5('0x52')]};_0x3f655c[_0xe9e5('0x22')](_0x41b3d2);}}_0x15d799({'count':_0x3f655c[_0xe9e5('0x19')],'rows':_0x3f655c});});},'SmsQueues':function(_0x132769){return new Promise(function(_0x4a2b1e,_0x18e1b8){var _0x4112c5=[];for(var _0x33cff4 in _0x3097da[_0xe9e5('0x55')]){if(_0x3097da['smsQueues'][_0xe9e5('0x49')](_0x33cff4)){var _0x3c77e6=_0x3097da[_0xe9e5('0x55')][_0x33cff4];var _0x5ef707={'id':_0x3c77e6['id'],'available':_0x3c77e6[_0xe9e5('0x4e')],'loggedIn':_0x3c77e6[_0xe9e5('0x4f')],'name':_0x3c77e6['name'],'paused':_0x3c77e6['paused'],'waiting':_0x3c77e6['waiting']};_0x4112c5[_0xe9e5('0x22')](_0x5ef707);}}_0x4a2b1e({'count':_0x4112c5[_0xe9e5('0x19')],'rows':_0x4112c5});});},'FaxQueues':function(_0x489509){return new Promise(function(_0xb5b709,_0x4d1172){var _0x32bebe=[];for(var _0x7cbfe2 in _0x3097da[_0xe9e5('0x56')]){if(_0x3097da['faxQueues'][_0xe9e5('0x49')](_0x7cbfe2)){var _0x500f14=_0x3097da[_0xe9e5('0x56')][_0x7cbfe2];var _0x1e360c={'id':_0x500f14['id'],'available':_0x500f14[_0xe9e5('0x4e')],'loggedIn':_0x500f14[_0xe9e5('0x4f')],'name':_0x500f14['name'],'paused':_0x500f14[_0xe9e5('0x51')],'waiting':_0x500f14[_0xe9e5('0x52')]};_0x32bebe['push'](_0x1e360c);}}_0xb5b709({'count':_0x32bebe['length'],'rows':_0x32bebe});});},'WhatsappQueues':function(_0x272f6d){return new Promise(function(_0x1160ec,_0xd37be2){var _0x416bdc=[];for(var _0x487963 in _0x3097da[_0xe9e5('0x57')]){if(_0x3097da[_0xe9e5('0x57')][_0xe9e5('0x49')](_0x487963)){var _0xb4b127=_0x3097da[_0xe9e5('0x57')][_0x487963];var _0x2f1808={'id':_0xb4b127['id'],'available':_0xb4b127[_0xe9e5('0x4e')],'loggedIn':_0xb4b127['loggedIn'],'name':_0xb4b127[_0xe9e5('0x50')],'paused':_0xb4b127['paused'],'waiting':_0xb4b127[_0xe9e5('0x52')]};_0x416bdc['push'](_0x2f1808);}}_0x1160ec({'count':_0x416bdc[_0xe9e5('0x19')],'rows':_0x416bdc});});},'ChatQueuesWaitingInteractions':function(_0x13e161){return new Promise(function(_0x55baea,_0x20d4fc){var _0x2a5a1a=_[_0xe9e5('0x58')](_0x3097da['chatQueuesWaitingInteractions']);_0x55baea({'count':_0x2a5a1a[_0xe9e5('0x19')],'rows':_0x2a5a1a});});},'MailQueuesWaitingInteractions':function(_0x31f650){return new Promise(function(_0x25f69e,_0x1f72ce){var _0x594aa6=_[_0xe9e5('0x58')](_0x3097da[_0xe9e5('0x59')]);_0x25f69e({'count':_0x594aa6[_0xe9e5('0x19')],'rows':_0x594aa6});});},'OpenchannelQueuesWaitingInteractions':function(_0x27612a){return new Promise(function(_0x13a606,_0x36533b){var _0x21e830=_['values'](_0x3097da['openchannelQueuesWaitingInteractions']);_0x13a606({'count':_0x21e830[_0xe9e5('0x19')],'rows':_0x21e830});});},'SmsQueuesWaitingInteractions':function(_0x2d8270){return new Promise(function(_0x31a2e7,_0x1b108d){var _0x1e946e=_[_0xe9e5('0x58')](_0x3097da[_0xe9e5('0x5a')]);_0x31a2e7({'count':_0x1e946e[_0xe9e5('0x19')],'rows':_0x1e946e});});},'FaxQueuesWaitingInteractions':function(_0x1c7d37){return new Promise(function(_0x4174ce,_0x8c3bcb){var _0x4ff996=_[_0xe9e5('0x58')](_0x3097da[_0xe9e5('0x5b')]);_0x4174ce({'count':_0x4ff996['length'],'rows':_0x4ff996});});},'WhatsappQueuesWaitingInteractions':function(_0x52b81e){return new Promise(function(_0x2a1817,_0x2a66c8){var _0x45dc85=_[_0xe9e5('0x58')](_0x3097da[_0xe9e5('0x5c')]);_0x2a1817({'count':_0x45dc85['length'],'rows':_0x45dc85});});}};var _0x5f3f03=jayson['server'](_0xd07ceb)[_0xe9e5('0x5d')]();_0x5f3f03['on']('error',function(_0xdf975e){logger[_0xe9e5('0x35')](JSON[_0xe9e5('0x5e')](_0xdf975e));return _0x2787c3(_0xdf975e);});_0x5f3f03[_0xe9e5('0x12')](0x232c,_0xe9e5('0x5f'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x5c901a('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index b14eea0..4bebbf0 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 _0x2fc7=['[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','then','indexOf','true'];(function(_0x175600,_0x317530){var _0x234437=function(_0x2bbb12){while(--_0x2bbb12){_0x175600['push'](_0x175600['shift']());}};_0x234437(++_0x317530);}(_0x2fc7,0x13b));var _0x72fc=function(_0x593353,_0xfce05e){_0x593353=_0x593353-0x0;var _0x45cb94=_0x2fc7[_0x593353];return _0x45cb94;};'use strict';var util=require(_0x72fc('0x0'));var BPromise=require(_0x72fc('0x1'));var jayson=require(_0x72fc('0x2'));var _=require(_0x72fc('0x3'));var logger=require(_0x72fc('0x4'))(_0x72fc('0x5'));var client=jayson['client'][_0x72fc('0x6')]({'port':0x232a});function request(_0x5c240e,_0xed2faa){return new BPromise(function(_0x2c69f7,_0x30992f){return client[_0x72fc('0x7')](_0x5c240e,_0xed2faa)['then'](function(_0x529fc6){if(_0x529fc6[_0x72fc('0x8')]){return _0x30992f(_0x529fc6[_0x72fc('0x8')][_0x72fc('0x9')]);}else{return _0x2c69f7(_0x529fc6[_0x72fc('0xa')]);}})[_0x72fc('0xb')](function(_0x3d959e){return _0x30992f(_0x3d959e);});});}exports[_0x72fc('0xc')]=function(_0x107761,_0x5e9d8d,_0x151f5e){return function(_0x4fe675){if(_0x151f5e[_0x72fc('0xd')]&&!_0x151f5e[_0x72fc('0xd')][_0x107761]){logger[_0x72fc('0xe')](_0x72fc('0xf'),_0x107761);return _0x4fe675[_0x72fc('0x10')]();}var _0x5d6bcf=[];for(var _0x5f009a=0x0;_0x5f009a<_0x5e9d8d[_0x72fc('0x11')];_0x5f009a+=0x1){_0x5d6bcf[_0x72fc('0x12')](request(_0x72fc('0x13'),{'command':util[_0x72fc('0x14')](_0x72fc('0x15'),_0x5e9d8d[_0x5f009a])})[_0x72fc('0x16')](function(_0x488e33){return _0x488e33&&_0x488e33[_0x72fc('0x9')]&&_0x488e33[_0x72fc('0x9')][_0x72fc('0x17')](_0x72fc('0x18'))>=0x0?!![]:![];})['catch'](function(_0x507eb4){logger[_0x72fc('0x8')](_0x72fc('0x19'),_0x107761,_0x5e9d8d[_0x5f009a]);}));}BPromise[_0x72fc('0x1a')](_0x5d6bcf)[_0x72fc('0x16')](function(_0x38d8ea){var _0x2e20c3=_[_0x72fc('0x1b')](_0x38d8ea);logger['info'](_0x72fc('0x1c'),_0x107761,_0x5e9d8d[_0x72fc('0x1d')](_0x72fc('0x1e')),_0x2e20c3);_0x4fe675[_0x72fc('0x1f')](_0x2e20c3);})[_0x72fc('0xb')](function(_0x4f830d){console[_0x72fc('0x20')](_0x4f830d);logger[_0x72fc('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x107761,_0x5e9d8d['join']('\x20|\x20'),_0x4f830d[_0x72fc('0x21')]);_0x4fe675[_0x72fc('0x10')]();});};}; \ No newline at end of file +var _0xa6eb=['true','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stop','util','bluebird','jayson/promise','lodash','client','http','then','error','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','format','iftime\x20%s','message'];(function(_0x2bf466,_0x4929a5){var _0x856885=function(_0x102ef1){while(--_0x102ef1){_0x2bf466['push'](_0x2bf466['shift']());}};_0x856885(++_0x4929a5);}(_0xa6eb,0x1a7));var _0xba6e=function(_0xae6a8e,_0x368c36){_0xae6a8e=_0xae6a8e-0x0;var _0x35b63c=_0xa6eb[_0xae6a8e];return _0x35b63c;};'use strict';var util=require(_0xba6e('0x0'));var BPromise=require(_0xba6e('0x1'));var jayson=require(_0xba6e('0x2'));var _=require(_0xba6e('0x3'));var logger=require('../../../config/logger')('routing');var client=jayson[_0xba6e('0x4')][_0xba6e('0x5')]({'port':0x232a});function request(_0x58b1a7,_0x259d67){return new BPromise(function(_0xab7ed6,_0x326187){return client['request'](_0x58b1a7,_0x259d67)[_0xba6e('0x6')](function(_0x507dbd){if(_0x507dbd[_0xba6e('0x7')]){return _0x326187(_0x507dbd['error']['message']);}else{return _0xab7ed6(_0x507dbd['result']);}})[_0xba6e('0x8')](function(_0x2efdf7){return _0x326187(_0x2efdf7);});});}exports[_0xba6e('0x9')]=function(_0x57d3a2,_0x1c916a,_0x4feb05){return function(_0x36d167){if(_0x4feb05[_0xba6e('0xa')]&&!_0x4feb05[_0xba6e('0xa')][_0x57d3a2]){logger[_0xba6e('0xb')](_0xba6e('0xc'),_0x57d3a2);return _0x36d167['stop']();}var _0x2eb5cc=[];for(var _0x3c9538=0x0;_0x3c9538<_0x1c916a[_0xba6e('0xd')];_0x3c9538+=0x1){_0x2eb5cc[_0xba6e('0xe')](request(_0xba6e('0xf'),{'command':util[_0xba6e('0x10')](_0xba6e('0x11'),_0x1c916a[_0x3c9538])})[_0xba6e('0x6')](function(_0x14a400){return _0x14a400&&_0x14a400[_0xba6e('0x12')]&&_0x14a400['message']['indexOf'](_0xba6e('0x13'))>=0x0?!![]:![];})[_0xba6e('0x8')](function(_0x5bae7f){logger[_0xba6e('0x7')]('[%s][INTERVAL]\x20%s',_0x57d3a2,_0x1c916a[_0x3c9538]);}));}BPromise['all'](_0x2eb5cc)['then'](function(_0x190f57){var _0x3d6077=_[_0xba6e('0x14')](_0x190f57);logger[_0xba6e('0xb')](_0xba6e('0x15'),_0x57d3a2,_0x1c916a[_0xba6e('0x16')](_0xba6e('0x17')),_0x3d6077);_0x36d167[_0xba6e('0x18')](_0x3d6077);})[_0xba6e('0x8')](function(_0x318b1b){console['log'](_0x318b1b);logger[_0xba6e('0x7')](_0xba6e('0x15'),_0x57d3a2,_0x1c916a[_0xba6e('0x16')](_0xba6e('0x17')),_0x318b1b['stack']);_0x36d167[_0xba6e('0x19')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index ea8c364..8f67ca6 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 _0xd404=['channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','reason','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','abandoned','agentconnect','info','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','agentcompleteAt','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','secondtransfererlinkedid','transfertargetuniqueid','calleridname','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','diffTime','agent','complete','[%s][agents][hangup]','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd404,0x15b));var _0x4d40=function(_0x160c49,_0x639006){_0x160c49=_0x160c49-0x0;var _0x25459a=_0xd404[_0x160c49];return _0x25459a;};'use strict';var _=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0xb6576c,_0x2322e5){utils['info'](util[_0x4d40('0x2')](_0x4d40('0x3'),_0xb6576c[_0x4d40('0x4')],_0xb6576c[_0x4d40('0x5')],_0xb6576c[_0x4d40('0x6')],_0xb6576c[_0x4d40('0x7')],_0xb6576c[_0x4d40('0x8')],_0xb6576c[_0x4d40('0x9')],_0xb6576c[_0x4d40('0xa')],_0xb6576c['lastevent']));if(_0xb6576c[_0x4d40('0x6')]){utils[_0x4d40('0xb')](_0xb6576c['queue'])[_0x4d40('0xc')](function(_0x5e31bc){if(_0x5e31bc){_0xb6576c['type']=_0x5e31bc[_0x4d40('0xd')];_0xb6576c[_0x4d40('0xe')]=_0xb6576c[_0x4d40('0xf')]?_0x5e31bc[_0x4d40('0x10')]:![];_0xb6576c[_0x4d40('0x11')]=_0xb6576c[_0x4d40('0xe')]?_0x5e31bc[_0x4d40('0x12')]:0x0;}utils[_0x4d40('0x13')](_0x4d40('0x14'),_0xb6576c);});}else{utils[_0x4d40('0x13')](_0x4d40('0x14'),_0xb6576c);}if(_0x2322e5){delete transfers[_0xb6576c[_0x4d40('0x4')]];}else{delete agents[_0xb6576c[_0x4d40('0x15')]];}}exports[_0x4d40('0x16')]=function(_0x5162f9){try{utils[_0x4d40('0x17')](util[_0x4d40('0x2')](_0x4d40('0x18'),_0x5162f9[_0x4d40('0x4')]),_0x5162f9);agents[_0x5162f9[_0x4d40('0x15')]]=_0x5162f9;agents[_0x5162f9['destuniqueid']][_0x4d40('0x19')]=utils[_0x4d40('0x1a')]();agents[_0x5162f9[_0x4d40('0x15')]][_0x4d40('0x1b')]=_0x4d40('0x1c');agents[_0x5162f9[_0x4d40('0x15')]][_0x4d40('0xa')]=null;agents[_0x5162f9[_0x4d40('0x15')]][_0x4d40('0x1d')]=null;utils['info'](util['format'](_0x4d40('0x1e'),_0x5162f9[_0x4d40('0x4')],agents[_0x5162f9['destuniqueid']][_0x4d40('0x7')],_0x5162f9[_0x4d40('0x15')]));}catch(_0x4eec1d){utils[_0x4d40('0x1f')](util['format'](_0x4d40('0x18'),_0x5162f9[_0x4d40('0x4')]),_0x4eec1d);}};exports['agentringnoanswer']=function(_0x57c997){try{if(!_[_0x4d40('0x20')](agents[_0x57c997[_0x4d40('0x15')]])){utils['debug'](util[_0x4d40('0x2')](_0x4d40('0x21'),_0x57c997[_0x4d40('0x4')]),_0x57c997);utils['info'](util[_0x4d40('0x2')](_0x4d40('0x22'),_0x57c997[_0x4d40('0x4')],agents[_0x57c997['destuniqueid']]['membername'],_0x57c997[_0x4d40('0x15')]));agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x23')]=!![];agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x24')]=utils['now']();agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x1b')]='timeout';agents[_0x57c997['destuniqueid']][_0x4d40('0x25')]=_0x4d40('0x26');agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x27')]=_0x57c997[_0x4d40('0x28')]?parseInt(_0x57c997[_0x4d40('0x28')])/0x3e8:0x0;agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x29')]=0x0;unanswered[_0x4d40('0x2a')](_0x57c997[_0x4d40('0x15')]);}}catch(_0x1c0fcf){utils['error'](util['format']('[%s][agents][agentringnoanswer]',_0x57c997[_0x4d40('0x4')]),_0x1c0fcf);}};exports[_0x4d40('0x2b')]=function(_0x1ac240){try{_[_0x4d40('0x2c')](agents,function(_0x598ca9,_0x18e601){if(_0x598ca9[_0x4d40('0x4')]==_0x1ac240[_0x4d40('0x4')]&&!_['includes'](unanswered,_0x598ca9[_0x4d40('0x15')])){utils[_0x4d40('0x17')](util[_0x4d40('0x2')](_0x4d40('0x2d'),_0x1ac240[_0x4d40('0x4')]),_0x1ac240);utils['info'](util[_0x4d40('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x1ac240[_0x4d40('0x4')],_0x598ca9[_0x4d40('0x7')],_0x598ca9[_0x4d40('0x15')]));_0x598ca9[_0x4d40('0x23')]=!![];_0x598ca9['agentringnoanswerAt']=utils['now']();_0x598ca9[_0x4d40('0x1b')]=_0x4d40('0x2e');_0x598ca9[_0x4d40('0x25')]=_0x4d40('0x2e');_0x598ca9['holdtime']=_0x1ac240[_0x4d40('0x27')];_0x598ca9['talktime']=0x0;writeDB(_0x598ca9);}});}catch(_0x2fde16){utils[_0x4d40('0x1f')](util[_0x4d40('0x2')](_0x4d40('0x2d'),_0x1ac240[_0x4d40('0x4')]),_0x2fde16);}};exports[_0x4d40('0x2f')]=function(_0x1d1ba9){try{if(agents[_0x1d1ba9[_0x4d40('0x15')]]){utils[_0x4d40('0x17')](util[_0x4d40('0x2')]('[%s][agents][agentconnect]',_0x1d1ba9[_0x4d40('0x4')]),_0x1d1ba9);utils[_0x4d40('0x30')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x1d1ba9['uniqueid'],agents[_0x1d1ba9[_0x4d40('0x15')]][_0x4d40('0x7')],_0x1d1ba9['destuniqueid']));agents[_0x1d1ba9[_0x4d40('0x15')]][_0x4d40('0x31')]=utils[_0x4d40('0x1a')]();agents[_0x1d1ba9[_0x4d40('0x15')]][_0x4d40('0xa')]=_0x1d1ba9['connectedlinenum'];agents[_0x1d1ba9[_0x4d40('0x15')]][_0x4d40('0x1d')]=_0x1d1ba9['connectedlinename'];agents[_0x1d1ba9['destuniqueid']][_0x4d40('0x27')]=_0x1d1ba9[_0x4d40('0x28')];agents[_0x1d1ba9['destuniqueid']][_0x4d40('0x1b')]=_0x4d40('0x32');_['forIn'](agents,function(_0x1e8427,_0x1a9586){if(_0x1e8427['destuniqueid']!=_0x1d1ba9[_0x4d40('0x15')]&&_0x1e8427[_0x4d40('0x4')]==_0x1d1ba9['uniqueid']){_0x1e8427[_0x4d40('0x29')]=0x0;_0x1e8427['holdtime']=_0x1d1ba9[_0x4d40('0x28')];_0x1e8427[_0x4d40('0x23')]=!![];_0x1e8427[_0x4d40('0x24')]=utils[_0x4d40('0x1a')]();_0x1e8427[_0x4d40('0x1b')]=_0x4d40('0x33');_0x1e8427[_0x4d40('0x25')]=_0x4d40('0x33');_0x1e8427[_0x4d40('0x34')]=_0x1d1ba9['destuniqueid'];_0x1e8427[_0x4d40('0x35')]=_0x1d1ba9[_0x4d40('0x7')];writeDB(_0x1e8427);}});}}catch(_0x1c2fa8){utils[_0x4d40('0x1f')](util[_0x4d40('0x2')]('[%s][agents][agentconnect]',_0x1d1ba9[_0x4d40('0x4')]),_0x1c2fa8);}};exports['agentcomplete']=function(_0x2e7f75){try{if(!_[_0x4d40('0x20')](agents[_0x2e7f75[_0x4d40('0x15')]])){utils[_0x4d40('0x17')](util['format'](_0x4d40('0x36'),_0x2e7f75[_0x4d40('0x4')]),_0x2e7f75);utils['info'](util[_0x4d40('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2e7f75[_0x4d40('0x4')],agents[_0x2e7f75[_0x4d40('0x15')]][_0x4d40('0x7')],_0x2e7f75[_0x4d40('0x15')]));agents[_0x2e7f75['destuniqueid']][_0x4d40('0xf')]=!![];agents[_0x2e7f75['destuniqueid']][_0x4d40('0x37')]=utils[_0x4d40('0x1a')]();agents[_0x2e7f75[_0x4d40('0x15')]][_0x4d40('0x29')]=utils['diffTime'](agents[_0x2e7f75[_0x4d40('0x15')]][_0x4d40('0x37')],agents[_0x2e7f75[_0x4d40('0x15')]][_0x4d40('0x31')]);agents[_0x2e7f75['destuniqueid']][_0x4d40('0x25')]=_0x2e7f75[_0x4d40('0x25')];agents[_0x2e7f75['destuniqueid']][_0x4d40('0x1b')]='complete';writeDB(agents[_0x2e7f75[_0x4d40('0x15')]]);}}catch(_0x1777e8){utils[_0x4d40('0x1f')](util[_0x4d40('0x2')](_0x4d40('0x36'),_0x2e7f75[_0x4d40('0x4')]),_0x1777e8);}};exports[_0x4d40('0x38')]=function(_0x37b6bf){try{if(!_[_0x4d40('0x20')](agents[_0x37b6bf['transfereruniqueid']])){utils[_0x4d40('0x17')](util[_0x4d40('0x2')](_0x4d40('0x39'),_0x37b6bf[_0x4d40('0x4')]),_0x37b6bf);utils[_0x4d40('0x30')](util['format'](_0x4d40('0x3a'),_0x37b6bf[_0x4d40('0x4')],agents[_0x37b6bf['transfereruniqueid']][_0x4d40('0x7')],agents[_0x37b6bf['transfereruniqueid']][_0x4d40('0x4')]));agents[_0x37b6bf[_0x4d40('0x3b')]][_0x4d40('0x3c')]=!![];agents[_0x37b6bf['transfereruniqueid']][_0x4d40('0x3d')]=_0x4d40('0x3e');agents[_0x37b6bf[_0x4d40('0x3b')]][_0x4d40('0x3f')]=_0x37b6bf[_0x4d40('0x40')];agents[_0x37b6bf['transfereruniqueid']][_0x4d40('0x41')]=agents[_0x37b6bf[_0x4d40('0x3b')]]['uniqueid'];}}catch(_0x1000f4){utils['error'](util[_0x4d40('0x2')]('[%s][agents][blindtransfer]',_0x37b6bf[_0x4d40('0x4')]),_0x1000f4);}};exports[_0x4d40('0x42')]=function(_0x539df4){try{utils[_0x4d40('0x17')](util[_0x4d40('0x2')](_0x4d40('0x43'),_0x539df4[_0x4d40('0x44')]),_0x539df4);if(_0x539df4[_0x4d40('0x44')]==_0x539df4[_0x4d40('0x45')]){if(!_[_0x4d40('0x20')](agents[_0x539df4[_0x4d40('0x46')]])){utils[_0x4d40('0x30')](util[_0x4d40('0x2')](_0x4d40('0x47'),_0x539df4[_0x4d40('0x44')],agents[_0x539df4[_0x4d40('0x46')]][_0x4d40('0x7')]));agents[_0x539df4[_0x4d40('0x46')]][_0x4d40('0x3c')]=!![];agents[_0x539df4[_0x4d40('0x46')]][_0x4d40('0x3d')]=_0x4d40('0x48');agents[_0x539df4['secondtransfereruniqueid']][_0x4d40('0x3f')]=_0x539df4[_0x4d40('0x49')];agents[_0x539df4['secondtransfereruniqueid']]['transferuniqueid']=_0x539df4[_0x4d40('0x44')];}if(_0x539df4[_0x4d40('0x4a')]&&agents[_0x539df4['transfereeuniqueid']]){agents[_0x539df4['transfereeuniqueid']][_0x4d40('0x4b')]=0x1;transfers[_0x539df4['transfereeuniqueid']]=_[_0x4d40('0x4c')](agents[_0x539df4['transfereeuniqueid']]);transfers[_0x539df4[_0x4d40('0x4a')]][_0x4d40('0x9')]=agents[_0x539df4[_0x4d40('0x46')]][_0x4d40('0x9')];transfers[_0x539df4[_0x4d40('0x4a')]]['calleridname']=agents[_0x539df4['secondtransfereruniqueid']]['calleridname'];transfers[_0x539df4[_0x4d40('0x4a')]][_0x4d40('0x19')]=utils[_0x4d40('0x1a')]();transfers[_0x539df4[_0x4d40('0x4a')]][_0x4d40('0x31')]=utils['now']();transfers[_0x539df4[_0x4d40('0x4a')]]['holdtime']=0x0;transfers[_0x539df4[_0x4d40('0x4a')]][_0x4d40('0x4b')]=0x2;}}else if(_0x539df4[_0x4d40('0x46')]==_0x539df4[_0x4d40('0x4d')]){if(!_[_0x4d40('0x20')](agents[_0x539df4[_0x4d40('0x44')]])){utils['info'](util['format'](_0x4d40('0x47'),_0x539df4[_0x4d40('0x44')],agents[_0x539df4[_0x4d40('0x44')]][_0x4d40('0x7')]));agents[_0x539df4[_0x4d40('0x44')]][_0x4d40('0x3c')]=!![];agents[_0x539df4[_0x4d40('0x44')]][_0x4d40('0x3d')]='ATTENDED';agents[_0x539df4[_0x4d40('0x44')]]['transferexten']=_0x539df4['secondtransfererexten'];agents[_0x539df4['origtransfereruniqueid']][_0x4d40('0x41')]=_0x539df4[_0x4d40('0x46')];}if(_0x539df4[_0x4d40('0x4e')]&&agents[_0x539df4[_0x4d40('0x4e')]]){agents[_0x539df4['transfertargetuniqueid']][_0x4d40('0x4b')]=0x1;transfers[_0x539df4[_0x4d40('0x4e')]]=_[_0x4d40('0x4c')](agents[_0x539df4[_0x4d40('0x4e')]]);transfers[_0x539df4[_0x4d40('0x4e')]]['calleridnum']=agents[_0x539df4['origtransfereruniqueid']][_0x4d40('0x9')];transfers[_0x539df4['transfertargetuniqueid']][_0x4d40('0x4f')]=agents[_0x539df4[_0x4d40('0x44')]][_0x4d40('0x4f')];transfers[_0x539df4['transfertargetuniqueid']]['agentcalledAt']=utils[_0x4d40('0x1a')]();transfers[_0x539df4['transfertargetuniqueid']][_0x4d40('0x31')]=utils[_0x4d40('0x1a')]();transfers[_0x539df4['transfertargetuniqueid']][_0x4d40('0x27')]=0x0;transfers[_0x539df4[_0x4d40('0x4e')]][_0x4d40('0x4b')]=0x2;}}}catch(_0x3bce3d){utils[_0x4d40('0x1f')](util[_0x4d40('0x2')]('[%s][agents][attendedtransfer]',_0x539df4['origtransfereruniqueid']),_0x3bce3d);}};exports['hangup']=function(_0x13872b){try{utils[_0x4d40('0x17')](util[_0x4d40('0x2')]('[%s][agents][hangup]',_0x13872b[_0x4d40('0x4')]),_0x13872b);if(agents[_0x13872b[_0x4d40('0x4')]]&&agents[_0x13872b['uniqueid']]['reason']===_0x4d40('0x26')){if(_0x13872b[_0x4d40('0x50')]==='21'){agents[_0x13872b['uniqueid']][_0x4d40('0x25')]=_0x4d40('0x51');agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x1b')]=_0x4d40('0x51');}utils[_0x4d40('0x30')](util['format'](_0x4d40('0x52'),_0x13872b['uniqueid'],agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x7')],agents[_0x13872b['uniqueid']][_0x4d40('0x25')],agents[_0x13872b[_0x4d40('0x4')]]['lastevent']));writeDB(agents[_0x13872b[_0x4d40('0x4')]]);var _0x7df23=unanswered['indexOf'](_0x13872b[_0x4d40('0x4')]);if(_0x7df23>-0x1){unanswered[_0x4d40('0x53')](_0x7df23,0x1);}}if(transfers[_0x13872b[_0x4d40('0x4')]]){transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0xf')]=!![];transfers[_0x13872b['uniqueid']][_0x4d40('0x37')]=utils[_0x4d40('0x1a')]();transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x29')]=utils[_0x4d40('0x54')](transfers[_0x13872b[_0x4d40('0x4')]]['agentcompleteAt'],transfers[_0x13872b[_0x4d40('0x4')]]['agentconnectAt']);transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x25')]=_0x4d40('0x55');transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x1b')]='complete';utils[_0x4d40('0x30')](util[_0x4d40('0x2')](_0x4d40('0x52'),_0x13872b[_0x4d40('0x4')],transfers[_0x13872b['uniqueid']][_0x4d40('0x7')],transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x25')],transfers[_0x13872b[_0x4d40('0x4')]]['lastevent']));writeDB(transfers[_0x13872b[_0x4d40('0x4')]],!![]);}if(agents[_0x13872b['uniqueid']]&&agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x31')]){agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0xf')]=!![];agents[_0x13872b['uniqueid']]['agentcompleteAt']=utils[_0x4d40('0x1a')]();agents[_0x13872b[_0x4d40('0x4')]]['talktime']=utils[_0x4d40('0x54')](agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x37')],agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x31')]);agents[_0x13872b['uniqueid']][_0x4d40('0x25')]=agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x3c')]?_0x4d40('0x3c'):_0x4d40('0x55');agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x1b')]=_0x4d40('0x56');utils[_0x4d40('0x30')](util[_0x4d40('0x2')](_0x4d40('0x52'),_0x13872b['uniqueid'],agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x7')],agents[_0x13872b['uniqueid']][_0x4d40('0x25')],agents[_0x13872b[_0x4d40('0x4')]]['lastevent']));writeDB(agents[_0x13872b['uniqueid']]);}}catch(_0x33b8f3){utils[_0x4d40('0x1f')](util['format'](_0x4d40('0x57'),_0x13872b[_0x4d40('0x4')]),_0x33b8f3);}}; \ No newline at end of file +var _0x7072=['acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','format','[%s][agents][agentcalled]','now','connectedlinename','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','holdtime','ringtime','talktime','push','error','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','reason','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfer','ATTENDED','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','util','./utils','info','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x7072,0x138));var _0x2707=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x7072[_0x51020b];return _0x371e47;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var utils=require(_0x2707('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x127e9c,_0x1bbc92){utils[_0x2707('0x2')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x127e9c[_0x2707('0x3')],_0x127e9c['channel'],_0x127e9c[_0x2707('0x4')],_0x127e9c[_0x2707('0x5')],_0x127e9c[_0x2707('0x6')],_0x127e9c[_0x2707('0x7')],_0x127e9c[_0x2707('0x8')],_0x127e9c[_0x2707('0x9')]));if(_0x127e9c[_0x2707('0x4')]){utils[_0x2707('0xa')](_0x127e9c[_0x2707('0x4')])[_0x2707('0xb')](function(_0x51ffc4){if(_0x51ffc4){_0x127e9c['type']=_0x51ffc4[_0x2707('0xc')];_0x127e9c[_0x2707('0xd')]=_0x127e9c[_0x2707('0xe')]?_0x51ffc4[_0x2707('0xf')]:![];_0x127e9c[_0x2707('0x10')]=_0x127e9c[_0x2707('0xd')]?_0x51ffc4[_0x2707('0x11')]:0x0;}utils[_0x2707('0x12')](_0x2707('0x13'),_0x127e9c);});}else{utils[_0x2707('0x12')](_0x2707('0x13'),_0x127e9c);}if(_0x1bbc92){delete transfers[_0x127e9c[_0x2707('0x3')]];}else{delete agents[_0x127e9c[_0x2707('0x14')]];}}exports['agentcalled']=function(_0x44c1d7){try{utils['debug'](util[_0x2707('0x15')](_0x2707('0x16'),_0x44c1d7[_0x2707('0x3')]),_0x44c1d7);agents[_0x44c1d7[_0x2707('0x14')]]=_0x44c1d7;agents[_0x44c1d7[_0x2707('0x14')]]['agentcalledAt']=utils[_0x2707('0x17')]();agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x9')]='called';agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x8')]=null;agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x18')]=null;utils[_0x2707('0x2')](util[_0x2707('0x15')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x44c1d7[_0x2707('0x3')],agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x5')],_0x44c1d7['destuniqueid']));}catch(_0x529936){utils['error'](util[_0x2707('0x15')](_0x2707('0x16'),_0x44c1d7[_0x2707('0x3')]),_0x529936);}};exports[_0x2707('0x19')]=function(_0x1a0e1a){try{if(!_[_0x2707('0x1a')](agents[_0x1a0e1a[_0x2707('0x14')]])){utils[_0x2707('0x1b')](util[_0x2707('0x15')](_0x2707('0x1c'),_0x1a0e1a[_0x2707('0x3')]),_0x1a0e1a);utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x1d'),_0x1a0e1a['uniqueid'],agents[_0x1a0e1a[_0x2707('0x14')]][_0x2707('0x5')],_0x1a0e1a[_0x2707('0x14')]));agents[_0x1a0e1a[_0x2707('0x14')]][_0x2707('0x19')]=!![];agents[_0x1a0e1a[_0x2707('0x14')]]['agentringnoanswerAt']=utils[_0x2707('0x17')]();agents[_0x1a0e1a[_0x2707('0x14')]][_0x2707('0x9')]=_0x2707('0x1e');agents[_0x1a0e1a[_0x2707('0x14')]]['reason']=_0x2707('0x1e');agents[_0x1a0e1a['destuniqueid']][_0x2707('0x1f')]=_0x1a0e1a[_0x2707('0x20')]?parseInt(_0x1a0e1a[_0x2707('0x20')])/0x3e8:0x0;agents[_0x1a0e1a['destuniqueid']][_0x2707('0x21')]=0x0;unanswered[_0x2707('0x22')](_0x1a0e1a[_0x2707('0x14')]);}}catch(_0x529be8){utils[_0x2707('0x23')](util[_0x2707('0x15')]('[%s][agents][agentringnoanswer]',_0x1a0e1a[_0x2707('0x3')]),_0x529be8);}};exports['queuecallerabandon']=function(_0x5aaffb){try{_[_0x2707('0x24')](agents,function(_0x4e0c93,_0x2a0d24){if(_0x4e0c93[_0x2707('0x3')]==_0x5aaffb[_0x2707('0x3')]&&!_[_0x2707('0x25')](unanswered,_0x4e0c93['destuniqueid'])){utils[_0x2707('0x1b')](util[_0x2707('0x15')](_0x2707('0x26'),_0x5aaffb[_0x2707('0x3')]),_0x5aaffb);utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x27'),_0x5aaffb[_0x2707('0x3')],_0x4e0c93[_0x2707('0x5')],_0x4e0c93['destuniqueid']));_0x4e0c93[_0x2707('0x19')]=!![];_0x4e0c93[_0x2707('0x28')]=utils['now']();_0x4e0c93['lastevent']='abandoned';_0x4e0c93['reason']='abandoned';_0x4e0c93[_0x2707('0x1f')]=_0x5aaffb['holdtime'];_0x4e0c93['talktime']=0x0;writeDB(_0x4e0c93);}});}catch(_0x4558bb){utils[_0x2707('0x23')](util['format'](_0x2707('0x26'),_0x5aaffb[_0x2707('0x3')]),_0x4558bb);}};exports['agentconnect']=function(_0x5e6b51){try{if(agents[_0x5e6b51[_0x2707('0x14')]]){utils[_0x2707('0x1b')](util['format']('[%s][agents][agentconnect]',_0x5e6b51[_0x2707('0x3')]),_0x5e6b51);utils[_0x2707('0x2')](util['format'](_0x2707('0x29'),_0x5e6b51[_0x2707('0x3')],agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x5')],_0x5e6b51[_0x2707('0x14')]));agents[_0x5e6b51[_0x2707('0x14')]]['agentconnectAt']=utils[_0x2707('0x17')]();agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x8')]=_0x5e6b51[_0x2707('0x8')];agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x18')]=_0x5e6b51[_0x2707('0x18')];agents[_0x5e6b51['destuniqueid']][_0x2707('0x1f')]=_0x5e6b51[_0x2707('0x20')];agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x9')]=_0x2707('0x2a');_[_0x2707('0x24')](agents,function(_0x3ed513,_0x39d9f6){if(_0x3ed513[_0x2707('0x14')]!=_0x5e6b51[_0x2707('0x14')]&&_0x3ed513[_0x2707('0x3')]==_0x5e6b51[_0x2707('0x3')]){_0x3ed513[_0x2707('0x21')]=0x0;_0x3ed513[_0x2707('0x1f')]=_0x5e6b51[_0x2707('0x20')];_0x3ed513[_0x2707('0x19')]=!![];_0x3ed513['agentringnoanswerAt']=utils[_0x2707('0x17')]();_0x3ed513[_0x2707('0x9')]='answered_elsewhere';_0x3ed513[_0x2707('0x2b')]='answered_elsewhere';_0x3ed513[_0x2707('0x2c')]=_0x5e6b51[_0x2707('0x14')];_0x3ed513[_0x2707('0x2d')]=_0x5e6b51[_0x2707('0x5')];writeDB(_0x3ed513);}});}}catch(_0x13e1c0){utils[_0x2707('0x23')](util[_0x2707('0x15')]('[%s][agents][agentconnect]',_0x5e6b51[_0x2707('0x3')]),_0x13e1c0);}};exports[_0x2707('0xe')]=function(_0x4c8dbf){try{if(!_[_0x2707('0x1a')](agents[_0x4c8dbf[_0x2707('0x14')]])){utils[_0x2707('0x1b')](util['format']('[%s][agents][agentcomplete]',_0x4c8dbf[_0x2707('0x3')]),_0x4c8dbf);utils[_0x2707('0x2')](util['format'](_0x2707('0x2e'),_0x4c8dbf['uniqueid'],agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x5')],_0x4c8dbf[_0x2707('0x14')]));agents[_0x4c8dbf[_0x2707('0x14')]]['agentcomplete']=!![];agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x2f')]=utils[_0x2707('0x17')]();agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x21')]=utils[_0x2707('0x30')](agents[_0x4c8dbf[_0x2707('0x14')]]['agentcompleteAt'],agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x31')]);agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x2b')]=_0x4c8dbf[_0x2707('0x2b')];agents[_0x4c8dbf['destuniqueid']][_0x2707('0x9')]='complete';writeDB(agents[_0x4c8dbf[_0x2707('0x14')]]);}}catch(_0x6ada76){utils['error'](util[_0x2707('0x15')](_0x2707('0x32'),_0x4c8dbf[_0x2707('0x3')]),_0x6ada76);}};exports['blindtransfer']=function(_0x1a8034){try{if(!_['isNil'](agents[_0x1a8034[_0x2707('0x33')]])){utils[_0x2707('0x1b')](util['format'](_0x2707('0x34'),_0x1a8034[_0x2707('0x3')]),_0x1a8034);utils[_0x2707('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1a8034[_0x2707('0x3')],agents[_0x1a8034[_0x2707('0x33')]][_0x2707('0x5')],agents[_0x1a8034[_0x2707('0x33')]][_0x2707('0x3')]));agents[_0x1a8034['transfereruniqueid']]['transfer']=!![];agents[_0x1a8034['transfereruniqueid']][_0x2707('0x35')]=_0x2707('0x36');agents[_0x1a8034[_0x2707('0x33')]][_0x2707('0x37')]=_0x1a8034[_0x2707('0x38')];agents[_0x1a8034['transfereruniqueid']][_0x2707('0x39')]=agents[_0x1a8034[_0x2707('0x33')]]['uniqueid'];}}catch(_0x482ed1){utils[_0x2707('0x23')](util[_0x2707('0x15')](_0x2707('0x34'),_0x1a8034['uniqueid']),_0x482ed1);}};exports[_0x2707('0x3a')]=function(_0x40a1a8){try{utils[_0x2707('0x1b')](util[_0x2707('0x15')]('[%s][agents][attendedtransfer]',_0x40a1a8[_0x2707('0x3b')]),_0x40a1a8);if(_0x40a1a8[_0x2707('0x3b')]==_0x40a1a8[_0x2707('0x3c')]){if(!_[_0x2707('0x1a')](agents[_0x40a1a8[_0x2707('0x3d')]])){utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x3e'),_0x40a1a8[_0x2707('0x3b')],agents[_0x40a1a8[_0x2707('0x3d')]]['membername']));agents[_0x40a1a8[_0x2707('0x3d')]]['transfer']=!![];agents[_0x40a1a8['secondtransfereruniqueid']][_0x2707('0x35')]='ATTENDED';agents[_0x40a1a8['secondtransfereruniqueid']][_0x2707('0x37')]=_0x40a1a8[_0x2707('0x3f')];agents[_0x40a1a8[_0x2707('0x3d')]][_0x2707('0x39')]=_0x40a1a8[_0x2707('0x3b')];}if(_0x40a1a8[_0x2707('0x40')]&&agents[_0x40a1a8[_0x2707('0x40')]]){agents[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x41')]=0x1;transfers[_0x40a1a8[_0x2707('0x40')]]=_[_0x2707('0x42')](agents[_0x40a1a8['transfereeuniqueid']]);transfers[_0x40a1a8['transfereeuniqueid']]['calleridnum']=agents[_0x40a1a8[_0x2707('0x3d')]][_0x2707('0x7')];transfers[_0x40a1a8[_0x2707('0x40')]]['calleridname']=agents[_0x40a1a8['secondtransfereruniqueid']][_0x2707('0x43')];transfers[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x44')]=utils[_0x2707('0x17')]();transfers[_0x40a1a8[_0x2707('0x40')]]['agentconnectAt']=utils['now']();transfers[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x1f')]=0x0;transfers[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x41')]=0x2;}}else if(_0x40a1a8[_0x2707('0x3d')]==_0x40a1a8[_0x2707('0x45')]){if(!_[_0x2707('0x1a')](agents[_0x40a1a8[_0x2707('0x3b')]])){utils[_0x2707('0x2')](util['format'](_0x2707('0x3e'),_0x40a1a8[_0x2707('0x3b')],agents[_0x40a1a8[_0x2707('0x3b')]][_0x2707('0x5')]));agents[_0x40a1a8[_0x2707('0x3b')]][_0x2707('0x46')]=!![];agents[_0x40a1a8['origtransfereruniqueid']]['transfertype']=_0x2707('0x47');agents[_0x40a1a8[_0x2707('0x3b')]]['transferexten']=_0x40a1a8['secondtransfererexten'];agents[_0x40a1a8['origtransfereruniqueid']]['transferuniqueid']=_0x40a1a8[_0x2707('0x3d')];}if(_0x40a1a8[_0x2707('0x48')]&&agents[_0x40a1a8['transfertargetuniqueid']]){agents[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x41')]=0x1;transfers[_0x40a1a8[_0x2707('0x48')]]=_['clone'](agents[_0x40a1a8['transfertargetuniqueid']]);transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x7')]=agents[_0x40a1a8[_0x2707('0x3b')]][_0x2707('0x7')];transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x43')]=agents[_0x40a1a8[_0x2707('0x3b')]]['calleridname'];transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x44')]=utils[_0x2707('0x17')]();transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x31')]=utils[_0x2707('0x17')]();transfers[_0x40a1a8['transfertargetuniqueid']][_0x2707('0x1f')]=0x0;transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x41')]=0x2;}}}catch(_0x142606){utils[_0x2707('0x23')](util[_0x2707('0x15')]('[%s][agents][attendedtransfer]',_0x40a1a8['origtransfereruniqueid']),_0x142606);}};exports[_0x2707('0x49')]=function(_0x2b0df0){try{utils[_0x2707('0x1b')](util[_0x2707('0x15')](_0x2707('0x4a'),_0x2b0df0[_0x2707('0x3')]),_0x2b0df0);if(agents[_0x2b0df0['uniqueid']]&&agents[_0x2b0df0['uniqueid']][_0x2707('0x2b')]==='timeout'){if(_0x2b0df0[_0x2707('0x4b')]==='21'){agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')]=_0x2707('0x4c');agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x9')]='rejected';}utils[_0x2707('0x2')](util['format'](_0x2707('0x4d'),_0x2b0df0[_0x2707('0x3')],agents[_0x2b0df0['uniqueid']][_0x2707('0x5')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x9')]));writeDB(agents[_0x2b0df0['uniqueid']]);var _0x3bfec3=unanswered[_0x2707('0x4e')](_0x2b0df0[_0x2707('0x3')]);if(_0x3bfec3>-0x1){unanswered[_0x2707('0x4f')](_0x3bfec3,0x1);}}if(transfers[_0x2b0df0[_0x2707('0x3')]]){transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0xe')]=!![];transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2f')]=utils[_0x2707('0x17')]();transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x21')]=utils[_0x2707('0x30')](transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2f')],transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x31')]);transfers[_0x2b0df0[_0x2707('0x3')]]['reason']=_0x2707('0x50');transfers[_0x2b0df0['uniqueid']]['lastevent']=_0x2707('0x51');utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x4d'),_0x2b0df0[_0x2707('0x3')],transfers[_0x2b0df0[_0x2707('0x3')]]['membername'],transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')],transfers[_0x2b0df0[_0x2707('0x3')]]['lastevent']));writeDB(transfers[_0x2b0df0[_0x2707('0x3')]],!![]);}if(agents[_0x2b0df0[_0x2707('0x3')]]&&agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x31')]){agents[_0x2b0df0['uniqueid']][_0x2707('0xe')]=!![];agents[_0x2b0df0['uniqueid']][_0x2707('0x2f')]=utils[_0x2707('0x17')]();agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x21')]=utils[_0x2707('0x30')](agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2f')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x31')]);agents[_0x2b0df0['uniqueid']][_0x2707('0x2b')]=agents[_0x2b0df0['uniqueid']][_0x2707('0x46')]?_0x2707('0x46'):_0x2707('0x50');agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x9')]=_0x2707('0x51');utils['info'](util['format'](_0x2707('0x4d'),_0x2b0df0['uniqueid'],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x5')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')],agents[_0x2b0df0['uniqueid']][_0x2707('0x9')]));writeDB(agents[_0x2b0df0[_0x2707('0x3')]]);}}catch(_0x17b7b7){utils['error'](util[_0x2707('0x15')](_0x2707('0x4a'),_0x2b0df0[_0x2707('0x3')]),_0x17b7b7);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index c229185..6e2530d 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 _0xc891=['gotoif','[%s][calls][newexten]','lodash','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','format','[%s][calls][newchannel]','linkedid','channel','info','context','exten','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','isNil','systemanswertime','now','transfer','destinationchannel','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','source','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','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','hangup','noop','execif'];(function(_0xca1f0e,_0x2713d5){var _0x35e4ef=function(_0x44c40f){while(--_0x44c40f){_0xca1f0e['push'](_0xca1f0e['shift']());}};_0x35e4ef(++_0x2713d5);}(_0xc891,0x152));var _0x1c89=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xc891[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x1c89('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0x1c89('0x1'));var dispositions=['NO\x20ANSWER',_0x1c89('0x2'),_0x1c89('0x2'),_0x1c89('0x3'),'NO\x20ANSWER',_0x1c89('0x3'),_0x1c89('0x4'),_0x1c89('0x5'),_0x1c89('0x2'),'FAILED',_0x1c89('0x2')];var channels={};function writeDB(_0x30aa4d){var _0x4cbacb;if(transfers[_0x1c89('0x6')][_0x30aa4d[_0x1c89('0x7')]]){_0x4cbacb=_0x30aa4d['uniqueid'];_0x30aa4d[_0x1c89('0x7')]=transfers['blinds'][_0x30aa4d[_0x1c89('0x7')]]['transfereeuniqueid'];}utils['info'](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x30aa4d[_0x1c89('0x7')],_0x30aa4d['channel'],_0x30aa4d[_0x1c89('0x8')],_0x30aa4d[_0x1c89('0x9')],_0x30aa4d[_0x1c89('0xa')],_0x30aa4d[_0x1c89('0xb')],_0x30aa4d[_0x1c89('0xc')],_0x30aa4d[_0x1c89('0xd')]));if(_0x30aa4d[_0x1c89('0xe')]){utils[_0x1c89('0xf')](_0x30aa4d['accountcode'])[_0x1c89('0x10')](function(_0x514e4d){if(_0x514e4d){_0x30aa4d[_0x1c89('0x11')]=_0x514e4d['id'];}utils[_0x1c89('0x12')](_0x1c89('0x13'),_0x30aa4d);});}else{utils['request'](_0x1c89('0x13'),_0x30aa4d);}if(channels[_0x30aa4d[_0x1c89('0x7')]]){delete channels[_0x30aa4d[_0x1c89('0x7')]];}else if(_0x4cbacb&&channels[_0x4cbacb]){if(!transfers['blinds'][_0x4cbacb][_0x1c89('0x14')])delete transfers[_0x1c89('0x6')][_0x4cbacb];delete channels[_0x4cbacb];}}exports[_0x1c89('0x15')]=function(_0x671fb8){try{utils[_0x1c89('0x16')](util[_0x1c89('0x17')](_0x1c89('0x18'),_0x671fb8[_0x1c89('0x7')]),_0x671fb8);if(_0x671fb8[_0x1c89('0x7')]==_0x671fb8[_0x1c89('0x19')]&&_0x671fb8[_0x1c89('0x1a')]!='OutgoingSpoolFailed'){utils[_0x1c89('0x1b')](util[_0x1c89('0x17')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x671fb8[_0x1c89('0x7')],_0x671fb8[_0x1c89('0x1c')],_0x671fb8[_0x1c89('0x1d')]));channels[_0x671fb8[_0x1c89('0x7')]]={'uniqueid':_0x671fb8['uniqueid'],'accountcode':_0x671fb8['accountcode'],'source':_0x671fb8[_0x1c89('0xb')],'destination':_0x671fb8[_0x1c89('0x1d')],'destinationcontext':_0x671fb8[_0x1c89('0x1c')],'channel':_0x671fb8[_0x1c89('0x1a')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x1c89('0x3'),'amaflags':_0x1c89('0x1e')};}}catch(_0x4fbd33){utils[_0x1c89('0x1f')](util[_0x1c89('0x17')](_0x1c89('0x18'),_0x671fb8['uniqueid']),_0x4fbd33);}};exports[_0x1c89('0x20')]=function(_0x3f8957){try{utils[_0x1c89('0x16')](util['format'](_0x1c89('0x21'),_0x3f8957['uniqueid']),_0x3f8957);if(!_['isNil'](channels[_0x3f8957[_0x1c89('0x7')]])&&_0x3f8957[_0x1c89('0x22')]==0x6){utils['info'](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x3f8957[_0x1c89('0x7')],_0x3f8957['context'],_0x3f8957['channel']));if(_[_0x1c89('0x23')](channels[_0x3f8957['uniqueid']][_0x1c89('0x24')])){channels[_0x3f8957['uniqueid']]['systemanswertime']=utils[_0x1c89('0x25')]();}}else if(!_[_0x1c89('0x23')](channels[_0x3f8957[_0x1c89('0x19')]])&&_0x3f8957['channelstate']==0x6&&_0x3f8957[_0x1c89('0x1c')]!=_0x1c89('0x26')){utils['info'](util[_0x1c89('0x17')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x3f8957[_0x1c89('0x7')],_0x3f8957[_0x1c89('0x19')],_0x3f8957[_0x1c89('0x1c')],_0x3f8957[_0x1c89('0x1a')]));channels[_0x3f8957[_0x1c89('0x19')]][_0x1c89('0xe')]=_0x3f8957[_0x1c89('0xe')];channels[_0x3f8957[_0x1c89('0x19')]][_0x1c89('0x27')]=_0x3f8957[_0x1c89('0x1a')];if(_['isNil'](channels[_0x3f8957[_0x1c89('0x19')]]['answertime'])){channels[_0x3f8957['linkedid']][_0x1c89('0x28')]=utils[_0x1c89('0x25')]();}channels[_0x3f8957[_0x1c89('0x19')]][_0x1c89('0x29')]=dispositions[_[_0x1c89('0x2a')](_0x3f8957[_0x1c89('0x22')])]||_0x1c89('0x4');}}catch(_0x51be1f){utils[_0x1c89('0x1f')](util[_0x1c89('0x17')](_0x1c89('0x21'),_0x3f8957['uniqueid']),_0x51be1f);}};exports['hangup']=function(_0x5bf65f){try{if(!_['isNil'](channels[_0x5bf65f['uniqueid']])){utils[_0x1c89('0x16')](util[_0x1c89('0x17')](_0x1c89('0x2b'),_0x5bf65f[_0x1c89('0x7')]),_0x5bf65f);if(_[_0x1c89('0x23')](channels[_0x5bf65f[_0x1c89('0x7')]][_0x1c89('0x2c')])){channels[_0x5bf65f['uniqueid']][_0x1c89('0x2c')]=_0x5bf65f[_0x1c89('0x2d')]+'\x20<'+_0x5bf65f['calleridnum']+'>';}utils[_0x1c89('0x1b')](util[_0x1c89('0x17')](_0x1c89('0x2e'),_0x5bf65f[_0x1c89('0x7')],channels[_0x5bf65f[_0x1c89('0x7')]]['callerid'],_0x5bf65f[_0x1c89('0x2f')]));channels[_0x5bf65f[_0x1c89('0x7')]][_0x1c89('0x30')]=utils['now']();channels[_0x5bf65f[_0x1c89('0x7')]]['duration']=utils[_0x1c89('0x31')](channels[_0x5bf65f['uniqueid']][_0x1c89('0x30')],channels[_0x5bf65f[_0x1c89('0x7')]][_0x1c89('0x32')]);channels[_0x5bf65f[_0x1c89('0x7')]][_0x1c89('0x33')]=channels[_0x5bf65f[_0x1c89('0x7')]][_0x1c89('0x28')]?utils[_0x1c89('0x31')](channels[_0x5bf65f[_0x1c89('0x7')]]['endtime'],channels[_0x5bf65f[_0x1c89('0x7')]][_0x1c89('0x28')]):0x0;writeDB(channels[_0x5bf65f[_0x1c89('0x7')]]);}}catch(_0x1dc884){utils['error'](util[_0x1c89('0x17')](_0x1c89('0x2b'),_0x5bf65f[_0x1c89('0x7')]),_0x1dc884);}};exports['attendedtransfer']=function(_0x502d5e){try{if(!_[_0x1c89('0x23')](channels[_0x502d5e[_0x1c89('0x34')]])){utils['debug'](util[_0x1c89('0x17')](_0x1c89('0x35'),_0x502d5e[_0x1c89('0x36')]),_0x502d5e);if(channels[_0x502d5e[_0x1c89('0x34')]][_0x1c89('0x1a')]==_0x502d5e[_0x1c89('0x37')]){utils[_0x1c89('0x1b')](util['format'](_0x1c89('0x38'),_0x502d5e['origtransfereruniqueid'],_0x502d5e['localtwolinkedid'],_0x502d5e[_0x1c89('0x39')]));channels[_0x502d5e[_0x1c89('0x34')]][_0x1c89('0x27')]=_0x502d5e[_0x1c89('0x39')];channels[_0x502d5e[_0x1c89('0x34')]][_0x1c89('0x3a')]=_0x1c89('0x3b');}else if(channels[_0x502d5e[_0x1c89('0x34')]][_0x1c89('0x1a')]=_0x502d5e[_0x1c89('0x3c')]){utils[_0x1c89('0x1b')](util[_0x1c89('0x17')](_0x1c89('0x38'),_0x502d5e[_0x1c89('0x36')],_0x502d5e[_0x1c89('0x34')],_0x502d5e[_0x1c89('0x3d')]));channels[_0x502d5e['localtwolinkedid']][_0x1c89('0x27')]=_0x502d5e['origtransfererchannel'];channels[_0x502d5e['localtwolinkedid']][_0x1c89('0x3a')]='_attended';}}}catch(_0x5be98e){utils[_0x1c89('0x1f')](util[_0x1c89('0x17')](_0x1c89('0x35'),_0x502d5e['origtransfereruniqueid']),_0x5be98e);}};exports[_0x1c89('0x3e')]=function(_0x5d1ce5){try{if(!_[_0x1c89('0x23')](channels[_0x5d1ce5['uniqueid']])){utils[_0x1c89('0x16')](util['format'](_0x1c89('0x3f'),_0x5d1ce5[_0x1c89('0x7')]),_0x5d1ce5);channels[_0x5d1ce5[_0x1c89('0x7')]]['musiconholdstartAt']=utils[_0x1c89('0x25')]();utils[_0x1c89('0x1b')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x5d1ce5[_0x1c89('0x7')],channels[_0x5d1ce5[_0x1c89('0x7')]][_0x1c89('0x40')]));}}catch(_0x3cc93e){utils[_0x1c89('0x1f')](util[_0x1c89('0x17')](_0x1c89('0x3f'),_0x5d1ce5[_0x1c89('0x7')]),_0x3cc93e);}};exports[_0x1c89('0x41')]=function(_0x2dcfc4){try{if(!_[_0x1c89('0x23')](channels[_0x2dcfc4[_0x1c89('0x7')]])){utils[_0x1c89('0x16')](util[_0x1c89('0x17')](_0x1c89('0x42'),_0x2dcfc4[_0x1c89('0x7')]),_0x2dcfc4);if(!_[_0x1c89('0x23')](channels[_0x2dcfc4[_0x1c89('0x7')]][_0x1c89('0x40')])){channels[_0x2dcfc4[_0x1c89('0x7')]]['mohtime']+=utils[_0x1c89('0x31')](utils[_0x1c89('0x25')](),channels[_0x2dcfc4[_0x1c89('0x7')]][_0x1c89('0x40')]);utils[_0x1c89('0x1b')](util[_0x1c89('0x17')](_0x1c89('0x43'),_0x2dcfc4[_0x1c89('0x7')],channels[_0x2dcfc4['uniqueid']][_0x1c89('0x44')]));delete channels[_0x2dcfc4[_0x1c89('0x7')]][_0x1c89('0x40')];}}}catch(_0x5d1c58){utils[_0x1c89('0x1f')](util[_0x1c89('0x17')](_0x1c89('0x42'),_0x2dcfc4['uniqueid']),_0x5d1c58);}};exports[_0x1c89('0x45')]=function(_0x3367d3){try{if(!_['isNil'](channels[_0x3367d3['uniqueid']])){utils['debug'](util[_0x1c89('0x17')](_0x1c89('0x46'),_0x3367d3[_0x1c89('0x7')]),_0x3367d3);if(!_[_0x1c89('0x23')](_0x3367d3[_0x1c89('0x47')][_0x1c89('0x48')])){utils[_0x1c89('0x1b')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x3367d3[_0x1c89('0x7')],_0x3367d3[_0x1c89('0x49')]));channels[_0x3367d3[_0x1c89('0x7')]][_0x1c89('0x4a')]=_0x3367d3[_0x1c89('0x49')];}if(!_[_0x1c89('0x23')](_0x3367d3[_0x1c89('0x47')][_0x1c89('0x4b')])){utils[_0x1c89('0x1b')](util[_0x1c89('0x17')](_0x1c89('0x4c'),_0x3367d3['uniqueid'],_0x3367d3[_0x1c89('0x49')]));channels[_0x3367d3[_0x1c89('0x7')]][_0x1c89('0x4d')]=_0x3367d3[_0x1c89('0x49')];channels[_0x3367d3[_0x1c89('0x7')]][_0x1c89('0x2c')]='\x22'+_0x3367d3['value']+_0x1c89('0x4e')+_0x3367d3[_0x1c89('0x49')]+'>';}if(!_[_0x1c89('0x23')](_0x3367d3[_0x1c89('0x47')][_0x1c89('0x4f')])||!_['isNil'](_0x3367d3[_0x1c89('0x47')][_0x1c89('0x50')])){utils[_0x1c89('0x1b')](util[_0x1c89('0x17')](_0x1c89('0x51'),_0x3367d3[_0x1c89('0x7')],!_[_0x1c89('0x23')](_0x3367d3[_0x1c89('0x47')][_0x1c89('0x4f')])?'xmd-callerid-preview':_0x1c89('0x50'),_0x3367d3[_0x1c89('0x49')]));channels[_0x3367d3[_0x1c89('0x7')]][_0x1c89('0x2c')]=_0x3367d3['value'];}if(!_[_0x1c89('0x23')](_0x3367d3['variable'][_0x1c89('0x52')])||!_['isNil'](_0x3367d3[_0x1c89('0x47')][_0x1c89('0x53')])){utils[_0x1c89('0x1b')](util[_0x1c89('0x17')](_0x1c89('0x51'),_0x3367d3[_0x1c89('0x7')],!_[_0x1c89('0x23')](_0x3367d3[_0x1c89('0x47')][_0x1c89('0x52')])?_0x1c89('0x52'):_0x1c89('0x53'),_0x3367d3[_0x1c89('0x49')]));channels[_0x3367d3[_0x1c89('0x7')]][_0x1c89('0x54')]=_0x1c89('0x55');channels[_0x3367d3[_0x1c89('0x7')]][_0x1c89('0x56')]=_0x3367d3[_0x1c89('0x49')];channels[_0x3367d3['uniqueid']][_0x1c89('0x8')]=!![];}if(!_['isNil'](_0x3367d3[_0x1c89('0x47')][_0x1c89('0x57')])){utils[_0x1c89('0x1b')](util[_0x1c89('0x17')](_0x1c89('0x58'),_0x3367d3[_0x1c89('0x7')],_0x3367d3['value']));channels[_0x3367d3[_0x1c89('0x7')]][_0x1c89('0x59')]=_0x3367d3[_0x1c89('0x49')];}if(!_[_0x1c89('0x23')](_0x3367d3[_0x1c89('0x47')][_0x1c89('0x5a')])){utils[_0x1c89('0x1b')](util[_0x1c89('0x17')](_0x1c89('0x5b'),_0x3367d3[_0x1c89('0x7')],_0x3367d3[_0x1c89('0x49')]));channels[_0x3367d3[_0x1c89('0x7')]][_0x1c89('0x5c')]=_0x3367d3[_0x1c89('0x49')];}if(!_['isNil'](_0x3367d3[_0x1c89('0x47')][_0x1c89('0x5d')])){utils['info'](util[_0x1c89('0x17')](_0x1c89('0x5e'),_0x3367d3[_0x1c89('0x7')],_0x3367d3['value']));channels[_0x3367d3[_0x1c89('0x7')]]['routeid']=_0x3367d3[_0x1c89('0x49')];}if(!_[_0x1c89('0x23')](_0x3367d3['variable'][_0x1c89('0x5f')])){utils['info'](util[_0x1c89('0x17')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x3367d3[_0x1c89('0x7')],_0x3367d3[_0x1c89('0x49')]));channels[_0x3367d3[_0x1c89('0x7')]][_0x1c89('0x5f')]=_0x3367d3[_0x1c89('0x49')];}}}catch(_0x5acc6d){utils[_0x1c89('0x1f')](util[_0x1c89('0x17')](_0x1c89('0x46'),_0x3367d3[_0x1c89('0x7')]),_0x5acc6d);}};exports[_0x1c89('0x60')]=function(_0x553c0e){try{if(!_['isNil'](channels[_0x553c0e['uniqueid']])){utils[_0x1c89('0x16')](util['format']('[%s][calls][newexten]',_0x553c0e['uniqueid']),_0x553c0e);utils['info'](util[_0x1c89('0x17')](_0x1c89('0x61'),_0x553c0e[_0x1c89('0x7')],_0x553c0e[_0x1c89('0x62')],_0x553c0e[_0x1c89('0x63')]));if(_0x553c0e[_0x1c89('0x62')]['toLowerCase']()==_0x1c89('0x64')&&_[_0x1c89('0x65')](_0x553c0e[_0x1c89('0x63')][_0x1c89('0x66')](),_0x1c89('0x67'))){var _0x44de16=_0x553c0e[_0x1c89('0x63')][_0x1c89('0x68')]('=');var _0x1cf445=_0x44de16[0x0][_0x1c89('0x69')](_0x44de16[0x0][_0x1c89('0x6a')]('(')+0x1,_0x44de16[0x0][_0x1c89('0x6a')](')'));var _0x252963=_0x44de16[0x1];channels[_0x553c0e[_0x1c89('0x7')]][_0x1cf445]=_0x252963;}if(!_['includes']([_0x1c89('0x6b'),_0x1c89('0x6c'),_0x1c89('0x6d'),_0x1c89('0x64'),_0x1c89('0x6e')],_0x553c0e[_0x1c89('0x62')][_0x1c89('0x66')]())){channels[_0x553c0e[_0x1c89('0x7')]][_0x1c89('0x54')]=_0x553c0e[_0x1c89('0x62')];channels[_0x553c0e[_0x1c89('0x7')]][_0x1c89('0x56')]=_0x553c0e['appdata'];}}}catch(_0x5a1567){utils['error'](util[_0x1c89('0x17')](_0x1c89('0x6f'),_0x553c0e[_0x1c89('0x7')]),_0x5a1567);}}; \ No newline at end of file +var _0xc76e=['[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','lastapplication','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','toLowerCase','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','ANSWERED','FAILED','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','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','transfer','destinationchannel','answertime','disposition','toNumber','hangup','callerid','calleridname','endtime','duration','starttime','billableseconds','diffTime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart'];(function(_0x1081bf,_0x29b118){var _0x558c04=function(_0x3e51e9){while(--_0x3e51e9){_0x1081bf['push'](_0x1081bf['shift']());}};_0x558c04(++_0x29b118);}(_0xc76e,0x10c));var _0xec76=function(_0x4d312c,_0x3ba08c){_0x4d312c=_0x4d312c-0x0;var _0x417992=_0xc76e[_0x4d312c];return _0x417992;};'use strict';var _=require(_0xec76('0x0'));var util=require(_0xec76('0x1'));var utils=require(_0xec76('0x2'));var transfers=require(_0xec76('0x3'));var dispositions=[_0xec76('0x4'),'FAILED','FAILED',_0xec76('0x4'),_0xec76('0x4'),'NO\x20ANSWER',_0xec76('0x5'),'BUSY',_0xec76('0x6'),_0xec76('0x6'),_0xec76('0x6')];var channels={};function writeDB(_0xfe33e0){var _0x2a8b9e;if(transfers[_0xec76('0x7')][_0xfe33e0[_0xec76('0x8')]]){_0x2a8b9e=_0xfe33e0[_0xec76('0x8')];_0xfe33e0[_0xec76('0x8')]=transfers['blinds'][_0xfe33e0[_0xec76('0x8')]][_0xec76('0x9')];}utils['info'](util[_0xec76('0xa')](_0xec76('0xb'),_0xfe33e0['uniqueid'],_0xfe33e0[_0xec76('0xc')],_0xfe33e0[_0xec76('0xd')],_0xfe33e0[_0xec76('0xe')],_0xfe33e0[_0xec76('0xf')],_0xfe33e0[_0xec76('0x10')],_0xfe33e0[_0xec76('0x11')],_0xfe33e0[_0xec76('0x12')]));if(_0xfe33e0[_0xec76('0x13')]){utils[_0xec76('0x14')](_0xfe33e0[_0xec76('0x13')])[_0xec76('0x15')](function(_0xec7def){if(_0xec7def){_0xfe33e0[_0xec76('0x16')]=_0xec7def['id'];}utils[_0xec76('0x17')](_0xec76('0x18'),_0xfe33e0);});}else{utils[_0xec76('0x17')]('CreateVoiceCallReport',_0xfe33e0);}if(channels[_0xfe33e0[_0xec76('0x8')]]){delete channels[_0xfe33e0['uniqueid']];}else if(_0x2a8b9e&&channels[_0x2a8b9e]){if(!transfers[_0xec76('0x7')][_0x2a8b9e][_0xec76('0x19')])delete transfers[_0xec76('0x7')][_0x2a8b9e];delete channels[_0x2a8b9e];}}exports[_0xec76('0x1a')]=function(_0x38be5e){try{utils[_0xec76('0x1b')](util['format']('[%s][calls][newchannel]',_0x38be5e[_0xec76('0x8')]),_0x38be5e);if(_0x38be5e[_0xec76('0x8')]==_0x38be5e[_0xec76('0x1c')]&&_0x38be5e[_0xec76('0xc')]!=_0xec76('0x1d')){utils[_0xec76('0x1e')](util[_0xec76('0xa')](_0xec76('0x1f'),_0x38be5e[_0xec76('0x8')],_0x38be5e[_0xec76('0x20')],_0x38be5e[_0xec76('0x21')]));channels[_0x38be5e[_0xec76('0x8')]]={'uniqueid':_0x38be5e['uniqueid'],'accountcode':_0x38be5e[_0xec76('0x13')],'source':_0x38be5e[_0xec76('0x10')],'destination':_0x38be5e[_0xec76('0x21')],'destinationcontext':_0x38be5e[_0xec76('0x20')],'channel':_0x38be5e[_0xec76('0xc')],'starttime':utils[_0xec76('0x22')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xec76('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x5324f7){utils[_0xec76('0x23')](util['format'](_0xec76('0x24'),_0x38be5e[_0xec76('0x8')]),_0x5324f7);}};exports[_0xec76('0x25')]=function(_0x2fe9ff){try{utils[_0xec76('0x1b')](util['format'](_0xec76('0x26'),_0x2fe9ff['uniqueid']),_0x2fe9ff);if(!_['isNil'](channels[_0x2fe9ff['uniqueid']])&&_0x2fe9ff[_0xec76('0x27')]==0x6){utils[_0xec76('0x1e')](util['format'](_0xec76('0x28'),_0x2fe9ff[_0xec76('0x8')],_0x2fe9ff[_0xec76('0x20')],_0x2fe9ff[_0xec76('0xc')]));if(_[_0xec76('0x29')](channels[_0x2fe9ff[_0xec76('0x8')]][_0xec76('0x2a')])){channels[_0x2fe9ff[_0xec76('0x8')]][_0xec76('0x2a')]=utils['now']();}}else if(!_[_0xec76('0x29')](channels[_0x2fe9ff[_0xec76('0x1c')]])&&_0x2fe9ff['channelstate']==0x6&&_0x2fe9ff[_0xec76('0x20')]!=_0xec76('0x2b')){utils[_0xec76('0x1e')](util[_0xec76('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2fe9ff['uniqueid'],_0x2fe9ff[_0xec76('0x1c')],_0x2fe9ff[_0xec76('0x20')],_0x2fe9ff[_0xec76('0xc')]));channels[_0x2fe9ff[_0xec76('0x1c')]][_0xec76('0x13')]=_0x2fe9ff[_0xec76('0x13')];channels[_0x2fe9ff[_0xec76('0x1c')]][_0xec76('0x2c')]=_0x2fe9ff[_0xec76('0xc')];if(_[_0xec76('0x29')](channels[_0x2fe9ff[_0xec76('0x1c')]][_0xec76('0x2d')])){channels[_0x2fe9ff[_0xec76('0x1c')]][_0xec76('0x2d')]=utils[_0xec76('0x22')]();}channels[_0x2fe9ff[_0xec76('0x1c')]][_0xec76('0x2e')]=dispositions[_[_0xec76('0x2f')](_0x2fe9ff['channelstate'])]||_0xec76('0x5');}}catch(_0x30a212){utils[_0xec76('0x23')](util[_0xec76('0xa')](_0xec76('0x26'),_0x2fe9ff[_0xec76('0x8')]),_0x30a212);}};exports[_0xec76('0x30')]=function(_0xccff8b){try{if(!_['isNil'](channels[_0xccff8b[_0xec76('0x8')]])){utils[_0xec76('0x1b')](util['format']('[%s][calls][hangup]',_0xccff8b['uniqueid']),_0xccff8b);if(_[_0xec76('0x29')](channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x31')])){channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x31')]=_0xccff8b[_0xec76('0x32')]+'\x20<'+_0xccff8b[_0xec76('0x10')]+'>';}utils[_0xec76('0x1e')](util[_0xec76('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0xccff8b['uniqueid'],channels[_0xccff8b[_0xec76('0x8')]]['callerid'],_0xccff8b['cause-txt']));channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x33')]=utils[_0xec76('0x22')]();channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x34')]=utils['diffTime'](channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x33')],channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x35')]);channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x36')]=channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x2d')]?utils[_0xec76('0x37')](channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x33')],channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x2d')]):0x0;writeDB(channels[_0xccff8b[_0xec76('0x8')]]);}}catch(_0x1eb42a){utils['error'](util[_0xec76('0xa')](_0xec76('0x38'),_0xccff8b[_0xec76('0x8')]),_0x1eb42a);}};exports[_0xec76('0x39')]=function(_0x36911f){try{if(!_['isNil'](channels[_0x36911f[_0xec76('0x3a')]])){utils[_0xec76('0x1b')](util[_0xec76('0xa')]('[%s][calls][attendedtransfer]',_0x36911f['origtransfereruniqueid']),_0x36911f);if(channels[_0x36911f[_0xec76('0x3a')]][_0xec76('0xc')]==_0x36911f['transfereechannel']){utils[_0xec76('0x1e')](util['format'](_0xec76('0x3b'),_0x36911f[_0xec76('0x3c')],_0x36911f[_0xec76('0x3a')],_0x36911f[_0xec76('0x3d')]));channels[_0x36911f[_0xec76('0x3a')]][_0xec76('0x2c')]=_0x36911f[_0xec76('0x3d')];channels[_0x36911f[_0xec76('0x3a')]][_0xec76('0x3e')]=_0xec76('0x3f');}else if(channels[_0x36911f[_0xec76('0x3a')]][_0xec76('0xc')]=_0x36911f[_0xec76('0x40')]){utils[_0xec76('0x1e')](util[_0xec76('0xa')](_0xec76('0x3b'),_0x36911f[_0xec76('0x3c')],_0x36911f[_0xec76('0x3a')],_0x36911f['origtransfererchannel']));channels[_0x36911f[_0xec76('0x3a')]]['destinationchannel']=_0x36911f[_0xec76('0x41')];channels[_0x36911f[_0xec76('0x3a')]][_0xec76('0x3e')]=_0xec76('0x3f');}}}catch(_0x8fb197){utils[_0xec76('0x23')](util['format'](_0xec76('0x42'),_0x36911f['origtransfereruniqueid']),_0x8fb197);}};exports[_0xec76('0x43')]=function(_0x3afa00){try{if(!_['isNil'](channels[_0x3afa00['uniqueid']])){utils[_0xec76('0x1b')](util[_0xec76('0xa')](_0xec76('0x44'),_0x3afa00['uniqueid']),_0x3afa00);channels[_0x3afa00[_0xec76('0x8')]]['musiconholdstartAt']=utils[_0xec76('0x22')]();utils['info'](util[_0xec76('0xa')](_0xec76('0x45'),_0x3afa00['uniqueid'],channels[_0x3afa00[_0xec76('0x8')]][_0xec76('0x46')]));}}catch(_0x5784a0){utils['error'](util[_0xec76('0xa')](_0xec76('0x44'),_0x3afa00[_0xec76('0x8')]),_0x5784a0);}};exports[_0xec76('0x47')]=function(_0x51d35d){try{if(!_[_0xec76('0x29')](channels[_0x51d35d[_0xec76('0x8')]])){utils[_0xec76('0x1b')](util[_0xec76('0xa')](_0xec76('0x48'),_0x51d35d[_0xec76('0x8')]),_0x51d35d);if(!_[_0xec76('0x29')](channels[_0x51d35d['uniqueid']][_0xec76('0x46')])){channels[_0x51d35d[_0xec76('0x8')]]['mohtime']+=utils[_0xec76('0x37')](utils['now'](),channels[_0x51d35d['uniqueid']][_0xec76('0x46')]);utils[_0xec76('0x1e')](util[_0xec76('0xa')](_0xec76('0x49'),_0x51d35d['uniqueid'],channels[_0x51d35d[_0xec76('0x8')]][_0xec76('0x4a')]));delete channels[_0x51d35d[_0xec76('0x8')]][_0xec76('0x46')];}}}catch(_0x3bdd53){utils[_0xec76('0x23')](util[_0xec76('0xa')]('[%s][calls][musiconholdstop]',_0x51d35d['uniqueid']),_0x3bdd53);}};exports[_0xec76('0x4b')]=function(_0x558991){try{if(!_[_0xec76('0x29')](channels[_0x558991['uniqueid']])){utils[_0xec76('0x1b')](util[_0xec76('0xa')](_0xec76('0x4c'),_0x558991[_0xec76('0x8')]),_0x558991);if(!_[_0xec76('0x29')](_0x558991[_0xec76('0x4d')][_0xec76('0x4e')])){utils['info'](util[_0xec76('0xa')](_0xec76('0x4f'),_0x558991[_0xec76('0x8')],_0x558991[_0xec76('0x50')]));channels[_0x558991['uniqueid']][_0xec76('0x51')]=_0x558991[_0xec76('0x50')];}if(!_[_0xec76('0x29')](_0x558991[_0xec76('0x4d')][_0xec76('0x52')])){utils['info'](util[_0xec76('0xa')](_0xec76('0x53'),_0x558991['uniqueid'],_0x558991[_0xec76('0x50')]));channels[_0x558991[_0xec76('0x8')]][_0xec76('0x54')]=_0x558991['value'];channels[_0x558991['uniqueid']][_0xec76('0x31')]='\x22'+_0x558991[_0xec76('0x50')]+'\x22\x20<'+_0x558991[_0xec76('0x50')]+'>';}if(!_['isNil'](_0x558991[_0xec76('0x4d')][_0xec76('0x55')])||!_['isNil'](_0x558991[_0xec76('0x4d')][_0xec76('0x56')])){utils[_0xec76('0x1e')](util[_0xec76('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x558991[_0xec76('0x8')],!_[_0xec76('0x29')](_0x558991['variable'][_0xec76('0x55')])?_0xec76('0x55'):'xmd-callerid',_0x558991[_0xec76('0x50')]));channels[_0x558991[_0xec76('0x8')]][_0xec76('0x31')]=_0x558991[_0xec76('0x50')];}if(!_[_0xec76('0x29')](_0x558991['variable']['xmd-queue'])||!_[_0xec76('0x29')](_0x558991['variable']['xmcs-queue'])){utils[_0xec76('0x1e')](util[_0xec76('0xa')](_0xec76('0x57'),_0x558991[_0xec76('0x8')],!_[_0xec76('0x29')](_0x558991[_0xec76('0x4d')]['xmd-queue'])?'xmd-queue':_0xec76('0x58'),_0x558991[_0xec76('0x50')]));channels[_0x558991[_0xec76('0x8')]][_0xec76('0x59')]='Queue';channels[_0x558991[_0xec76('0x8')]][_0xec76('0x5a')]=_0x558991[_0xec76('0x50')];channels[_0x558991['uniqueid']]['queue']=!![];}if(!_['isNil'](_0x558991[_0xec76('0x4d')]['xmd-contactid'])){utils[_0xec76('0x1e')](util['format'](_0xec76('0x5b'),_0x558991[_0xec76('0x8')],_0x558991[_0xec76('0x50')]));channels[_0x558991[_0xec76('0x8')]]['ContactId']=_0x558991['value'];}if(!_[_0xec76('0x29')](_0x558991['variable'][_0xec76('0x5c')])){utils[_0xec76('0x1e')](util[_0xec76('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x558991[_0xec76('0x8')],_0x558991[_0xec76('0x50')]));channels[_0x558991['uniqueid']][_0xec76('0x5d')]=_0x558991[_0xec76('0x50')];}if(!_[_0xec76('0x29')](_0x558991['variable'][_0xec76('0x5e')])){utils[_0xec76('0x1e')](util[_0xec76('0xa')](_0xec76('0x5f'),_0x558991[_0xec76('0x8')],_0x558991['value']));channels[_0x558991[_0xec76('0x8')]]['routeid']=_0x558991[_0xec76('0x50')];}if(!_[_0xec76('0x29')](_0x558991[_0xec76('0x4d')][_0xec76('0x60')])){utils[_0xec76('0x1e')](util['format'](_0xec76('0x61'),_0x558991[_0xec76('0x8')],_0x558991['value']));channels[_0x558991[_0xec76('0x8')]][_0xec76('0x60')]=_0x558991['value'];}}}catch(_0x45ec5f){utils['error'](util['format'](_0xec76('0x4c'),_0x558991[_0xec76('0x8')]),_0x45ec5f);}};exports[_0xec76('0x62')]=function(_0x5e6f8c){try{if(!_[_0xec76('0x29')](channels[_0x5e6f8c['uniqueid']])){utils[_0xec76('0x1b')](util['format']('[%s][calls][newexten]',_0x5e6f8c[_0xec76('0x8')]),_0x5e6f8c);utils['info'](util[_0xec76('0xa')](_0xec76('0x63'),_0x5e6f8c[_0xec76('0x8')],_0x5e6f8c[_0xec76('0x64')],_0x5e6f8c[_0xec76('0x65')]));if(_0x5e6f8c[_0xec76('0x64')]['toLowerCase']()==_0xec76('0x66')&&_[_0xec76('0x67')](_0x5e6f8c['appdata']['toLowerCase'](),_0xec76('0x68'))){var _0x2c0274=_0x5e6f8c['appdata'][_0xec76('0x69')]('=');var _0x2dae20=_0x2c0274[0x0][_0xec76('0x6a')](_0x2c0274[0x0][_0xec76('0x6b')]('(')+0x1,_0x2c0274[0x0][_0xec76('0x6b')](')'));var _0x2b27b0=_0x2c0274[0x1];channels[_0x5e6f8c['uniqueid']][_0x2dae20]=_0x2b27b0;}if(!_[_0xec76('0x6c')]([_0xec76('0x30'),_0xec76('0x6d'),'execif',_0xec76('0x66'),'gotoif'],_0x5e6f8c[_0xec76('0x64')][_0xec76('0x6e')]())){channels[_0x5e6f8c[_0xec76('0x8')]][_0xec76('0x59')]=_0x5e6f8c[_0xec76('0x64')];channels[_0x5e6f8c[_0xec76('0x8')]][_0xec76('0x5a')]=_0x5e6f8c[_0xec76('0x65')];}}}catch(_0x368e31){utils['error'](util['format'](_0xec76('0x6f'),_0x5e6f8c[_0xec76('0x8')]),_0x368e31);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 6441ea9..f0d51d8 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 _0xbdf9=['managerevent','./utils','info','[core]\x20connected','[core]\x20shutdown','[core]\x20fullybooted','error','close'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0xbdf9,0x129));var _0x9bdf=function(_0x4d82e1,_0x5ac72b){_0x4d82e1=_0x4d82e1-0x0;var _0x5f3bd9=_0xbdf9[_0x4d82e1];return _0x5f3bd9;};'use strict';var utils=require(_0x9bdf('0x0'));exports['connect']=function(){utils[_0x9bdf('0x1')](_0x9bdf('0x2'));};exports['shutdown']=function(){utils['info'](_0x9bdf('0x3'));};exports['fullybooted']=function(){utils[_0x9bdf('0x1')](_0x9bdf('0x4'));};exports[_0x9bdf('0x5')]=function(_0x2b7ec0){utils[_0x9bdf('0x5')]('[core]\x20error',_0x2b7ec0);};exports[_0x9bdf('0x6')]=function(){utils['info']('[core]\x20close');};exports[_0x9bdf('0x7')]=function(_0x37e23a){}; \ No newline at end of file +var _0x1b00=['managerevent','./utils','info','shutdown','[core]\x20shutdown','fullybooted','error','close','[core]\x20close'];(function(_0x1428d9,_0xded63c){var _0x438019=function(_0x31c37d){while(--_0x31c37d){_0x1428d9['push'](_0x1428d9['shift']());}};_0x438019(++_0xded63c);}(_0x1b00,0xc7));var _0x01b0=function(_0x3a34b3,_0xee2de0){_0x3a34b3=_0x3a34b3-0x0;var _0x4af690=_0x1b00[_0x3a34b3];return _0x4af690;};'use strict';var utils=require(_0x01b0('0x0'));exports['connect']=function(){utils[_0x01b0('0x1')]('[core]\x20connected');};exports[_0x01b0('0x2')]=function(){utils[_0x01b0('0x1')](_0x01b0('0x3'));};exports[_0x01b0('0x4')]=function(){utils[_0x01b0('0x1')]('[core]\x20fullybooted');};exports['error']=function(_0x2017c7){utils[_0x01b0('0x5')]('[core]\x20error',_0x2017c7);};exports[_0x01b0('0x6')]=function(){utils[_0x01b0('0x1')](_0x01b0('0x7'));};exports[_0x01b0('0x8')]=function(_0x6325f2){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index dc612d3..da5530a 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 _0x9be9=['value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','dialstatus','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','complete','duration','diffTime','holdtime','endtime','billableseconds','lodash','./utils','info','uniqueid','channel','connectedlinenum','request','CreateVoiceDialReport','debug','format','[%s][dials][newexten]','appdata','application','toLowerCase','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid'];(function(_0x1e2191,_0x16c5ca){var _0x4c0c38=function(_0x3f9425){while(--_0x3f9425){_0x1e2191['push'](_0x1e2191['shift']());}};_0x4c0c38(++_0x16c5ca);}(_0x9be9,0x161));var _0x99be=function(_0x4e1556,_0x392321){_0x4e1556=_0x4e1556-0x0;var _0x3a5e96=_0x9be9[_0x4e1556];return _0x3a5e96;};'use strict';var _=require(_0x99be('0x0'));var util=require('util');var utils=require(_0x99be('0x1'));var dials={};function writeDB(_0x3c8074){utils[_0x99be('0x2')](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x3c8074[_0x99be('0x3')],_0x3c8074[_0x99be('0x4')],_0x3c8074['dialstring'],_0x3c8074['calleridnum'],_0x3c8074[_0x99be('0x5')],_0x3c8074['dialstatus']));utils[_0x99be('0x6')](_0x99be('0x7'),_0x3c8074);delete dials[_0x3c8074[_0x99be('0x3')]];}exports['newexten']=function(_0x5c0dae){try{utils[_0x99be('0x8')](util[_0x99be('0x9')](_0x99be('0xa'),_0x5c0dae[_0x99be('0x3')]),_0x5c0dae);utils[_0x99be('0x2')](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x5c0dae[_0x99be('0x3')],_0x5c0dae['application'],_0x5c0dae[_0x99be('0xb')]));if(_0x5c0dae[_0x99be('0xc')][_0x99be('0xd')]()=='set'&&_[_0x99be('0xe')](_0x5c0dae[_0x99be('0xb')][_0x99be('0xd')](),_0x99be('0xf'))){var _0x243c19=_0x5c0dae[_0x99be('0xb')][_0x99be('0x10')]('=');dials[_0x5c0dae[_0x99be('0x3')]]={'routeId':_0x243c19[0x1]};}}catch(_0x1ae9fc){utils[_0x99be('0x11')](util[_0x99be('0x9')](_0x99be('0xa'),_0x5c0dae['uniqueid']),_0x1ae9fc);}};exports[_0x99be('0x12')]=function(_0x296d0a){try{utils[_0x99be('0x8')](util[_0x99be('0x9')](_0x99be('0x13'),_0x296d0a[_0x99be('0x3')]),_0x296d0a);if(!_[_0x99be('0x14')](_0x296d0a[_0x99be('0x15')][_0x99be('0x16')])){utils['info'](util[_0x99be('0x9')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x296d0a['uniqueid'],_0x296d0a[_0x99be('0x17')]));dials[_0x296d0a['uniqueid']]={'routeId':_0x296d0a[_0x99be('0x17')]};}}catch(_0x4f23cb){utils[_0x99be('0x11')](util[_0x99be('0x9')]('[%s][dials][varset]',_0x296d0a['uniqueid']),_0x4f23cb);}};exports[_0x99be('0x18')]=function(_0x4cb582){try{if(!_[_0x99be('0x14')](dials[_0x4cb582[_0x99be('0x3')]])){utils[_0x99be('0x8')](util['format'](_0x99be('0x19'),_0x4cb582['uniqueid']),_0x4cb582);dials[_0x4cb582[_0x99be('0x3')]]=_[_0x99be('0x1a')](dials[_0x4cb582['uniqueid']],_0x4cb582);dials[_0x4cb582[_0x99be('0x3')]][_0x99be('0x1b')]=utils[_0x99be('0x1c')]();dials[_0x4cb582[_0x99be('0x3')]][_0x99be('0x1d')]=_0x99be('0x1e');utils['info'](util[_0x99be('0x9')](_0x99be('0x1f'),_0x4cb582[_0x99be('0x3')],dials[_0x4cb582[_0x99be('0x3')]][_0x99be('0x1b')]));}}catch(_0x38f7e5){utils['error'](util['format']('[%s][dials][dialbegin]',_0x4cb582[_0x99be('0x3')]),_0x38f7e5);}};exports[_0x99be('0x20')]=function(_0x325b06){try{if(!_[_0x99be('0x14')](dials[_0x325b06[_0x99be('0x3')]])){utils[_0x99be('0x8')](util[_0x99be('0x9')]('[%s][dials][dialend]',_0x325b06[_0x99be('0x3')]),_0x325b06);dials[_0x325b06[_0x99be('0x3')]]['dialstatus']=_0x325b06[_0x99be('0x21')];if(_0x325b06[_0x99be('0x21')]=='ANSWER'){dials[_0x325b06['uniqueid']]=_[_0x99be('0x1a')](dials[_0x325b06['uniqueid']],_0x325b06);dials[_0x325b06[_0x99be('0x3')]][_0x99be('0x22')]=utils[_0x99be('0x1c')]();dials[_0x325b06['uniqueid']][_0x99be('0x1d')]=_0x99be('0x23');utils[_0x99be('0x2')](util[_0x99be('0x9')](_0x99be('0x24'),_0x325b06[_0x99be('0x3')],_0x325b06[_0x99be('0x21')],dials[_0x325b06[_0x99be('0x3')]][_0x99be('0x22')]));}else{utils[_0x99be('0x2')](util['format'](_0x99be('0x25'),_0x325b06['uniqueid'],_0x325b06[_0x99be('0x21')]));}}}catch(_0x53baad){utils[_0x99be('0x11')](util[_0x99be('0x9')](_0x99be('0x26'),_0x325b06[_0x99be('0x3')]),_0x53baad);}};exports['hangup']=function(_0x1ee4e8){try{if(!_['isNil'](dials[_0x1ee4e8[_0x99be('0x3')]])){utils['debug'](util[_0x99be('0x9')](_0x99be('0x27'),_0x1ee4e8['uniqueid']),_0x1ee4e8);utils[_0x99be('0x2')](util['format'](_0x99be('0x28'),_0x1ee4e8[_0x99be('0x3')],_0x1ee4e8['calleridnum'],_0x1ee4e8['calleridname'],_0x1ee4e8['cause-txt']));dials[_0x1ee4e8[_0x99be('0x3')]]=_[_0x99be('0x1a')](dials[_0x1ee4e8[_0x99be('0x3')]],{'endtime':utils[_0x99be('0x1c')](),'lastevent':_0x99be('0x29')});dials[_0x1ee4e8['uniqueid']][_0x99be('0x2a')]=utils[_0x99be('0x2b')](dials[_0x1ee4e8[_0x99be('0x3')]]['endtime'],dials[_0x1ee4e8['uniqueid']][_0x99be('0x1b')]);dials[_0x1ee4e8['uniqueid']][_0x99be('0x2c')]=utils[_0x99be('0x2b')](dials[_0x1ee4e8[_0x99be('0x3')]][_0x99be('0x22')]||dials[_0x1ee4e8[_0x99be('0x3')]][_0x99be('0x2d')],dials[_0x1ee4e8[_0x99be('0x3')]]['starttime']);dials[_0x1ee4e8[_0x99be('0x3')]][_0x99be('0x2e')]=dials[_0x1ee4e8[_0x99be('0x3')]][_0x99be('0x22')]?utils['diffTime'](dials[_0x1ee4e8[_0x99be('0x3')]][_0x99be('0x2d')],dials[_0x1ee4e8[_0x99be('0x3')]]['answertime']):0x0;writeDB(dials[_0x1ee4e8['uniqueid']]);}}catch(_0x4e136e){utils[_0x99be('0x11')](util[_0x99be('0x9')]('[%s][dials][hangup]',_0x1ee4e8['uniqueid']),_0x4e136e);}}; \ No newline at end of file +var _0x065a=['starttime','now','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','diffTime','endtime','holdtime','billableseconds','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','split','error','[%s][dials][varset]','variable','outboundrouteid','value','dialbegin','isNil','[%s][dials][dialbegin]','assign'];(function(_0x1cf679,_0x59de1b){var _0x5686cc=function(_0x1dea67){while(--_0x1dea67){_0x1cf679['push'](_0x1cf679['shift']());}};_0x5686cc(++_0x59de1b);}(_0x065a,0x6e));var _0xa065=function(_0x15104e,_0xad02a3){_0x15104e=_0x15104e-0x0;var _0x51d208=_0x065a[_0x15104e];return _0x51d208;};'use strict';var _=require(_0xa065('0x0'));var util=require('util');var utils=require(_0xa065('0x1'));var dials={};function writeDB(_0x225308){utils[_0xa065('0x2')](util[_0xa065('0x3')](_0xa065('0x4'),_0x225308[_0xa065('0x5')],_0x225308[_0xa065('0x6')],_0x225308['dialstring'],_0x225308[_0xa065('0x7')],_0x225308[_0xa065('0x8')],_0x225308[_0xa065('0x9')]));utils['request']('CreateVoiceDialReport',_0x225308);delete dials[_0x225308['uniqueid']];}exports[_0xa065('0xa')]=function(_0x49d84d){try{utils[_0xa065('0xb')](util[_0xa065('0x3')](_0xa065('0xc'),_0x49d84d[_0xa065('0x5')]),_0x49d84d);utils[_0xa065('0x2')](util['format'](_0xa065('0xd'),_0x49d84d[_0xa065('0x5')],_0x49d84d[_0xa065('0xe')],_0x49d84d[_0xa065('0xf')]));if(_0x49d84d['application']['toLowerCase']()=='set'&&_[_0xa065('0x10')](_0x49d84d[_0xa065('0xf')][_0xa065('0x11')](),'cdr(routeid)')){var _0xb8ec35=_0x49d84d['appdata'][_0xa065('0x12')]('=');dials[_0x49d84d['uniqueid']]={'routeId':_0xb8ec35[0x1]};}}catch(_0x4efc86){utils[_0xa065('0x13')](util[_0xa065('0x3')]('[%s][dials][newexten]',_0x49d84d['uniqueid']),_0x4efc86);}};exports['varset']=function(_0xae0b2a){try{utils[_0xa065('0xb')](util[_0xa065('0x3')](_0xa065('0x14'),_0xae0b2a[_0xa065('0x5')]),_0xae0b2a);if(!_['isNil'](_0xae0b2a[_0xa065('0x15')][_0xa065('0x16')])){utils[_0xa065('0x2')](util[_0xa065('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0xae0b2a[_0xa065('0x5')],_0xae0b2a['value']));dials[_0xae0b2a[_0xa065('0x5')]]={'routeId':_0xae0b2a[_0xa065('0x17')]};}}catch(_0x27de57){utils[_0xa065('0x13')](util[_0xa065('0x3')]('[%s][dials][varset]',_0xae0b2a[_0xa065('0x5')]),_0x27de57);}};exports[_0xa065('0x18')]=function(_0x53db33){try{if(!_[_0xa065('0x19')](dials[_0x53db33[_0xa065('0x5')]])){utils['debug'](util[_0xa065('0x3')](_0xa065('0x1a'),_0x53db33[_0xa065('0x5')]),_0x53db33);dials[_0x53db33[_0xa065('0x5')]]=_[_0xa065('0x1b')](dials[_0x53db33[_0xa065('0x5')]],_0x53db33);dials[_0x53db33[_0xa065('0x5')]][_0xa065('0x1c')]=utils[_0xa065('0x1d')]();dials[_0x53db33['uniqueid']]['lastevent']='called';utils['info'](util[_0xa065('0x3')](_0xa065('0x1e'),_0x53db33['uniqueid'],dials[_0x53db33[_0xa065('0x5')]][_0xa065('0x1c')]));}}catch(_0x939f41){utils[_0xa065('0x13')](util[_0xa065('0x3')](_0xa065('0x1a'),_0x53db33[_0xa065('0x5')]),_0x939f41);}};exports[_0xa065('0x1f')]=function(_0x32451d){try{if(!_[_0xa065('0x19')](dials[_0x32451d[_0xa065('0x5')]])){utils[_0xa065('0xb')](util['format'](_0xa065('0x20'),_0x32451d[_0xa065('0x5')]),_0x32451d);dials[_0x32451d[_0xa065('0x5')]][_0xa065('0x9')]=_0x32451d['dialstatus'];if(_0x32451d['dialstatus']=='ANSWER'){dials[_0x32451d[_0xa065('0x5')]]=_[_0xa065('0x1b')](dials[_0x32451d[_0xa065('0x5')]],_0x32451d);dials[_0x32451d[_0xa065('0x5')]]['answertime']=utils[_0xa065('0x1d')]();dials[_0x32451d[_0xa065('0x5')]][_0xa065('0x21')]=_0xa065('0x22');utils[_0xa065('0x2')](util['format'](_0xa065('0x23'),_0x32451d[_0xa065('0x5')],_0x32451d[_0xa065('0x9')],dials[_0x32451d[_0xa065('0x5')]][_0xa065('0x24')]));}else{utils['info'](util['format']('[%s][dials][dialend]\x20dialstatus:%s',_0x32451d['uniqueid'],_0x32451d['dialstatus']));}}}catch(_0x592e6e){utils[_0xa065('0x13')](util[_0xa065('0x3')](_0xa065('0x20'),_0x32451d[_0xa065('0x5')]),_0x592e6e);}};exports[_0xa065('0x25')]=function(_0x5c168f){try{if(!_['isNil'](dials[_0x5c168f[_0xa065('0x5')]])){utils['debug'](util[_0xa065('0x3')](_0xa065('0x26'),_0x5c168f[_0xa065('0x5')]),_0x5c168f);utils[_0xa065('0x2')](util['format'](_0xa065('0x27'),_0x5c168f[_0xa065('0x5')],_0x5c168f[_0xa065('0x7')],_0x5c168f[_0xa065('0x28')],_0x5c168f['cause-txt']));dials[_0x5c168f['uniqueid']]=_[_0xa065('0x1b')](dials[_0x5c168f[_0xa065('0x5')]],{'endtime':utils[_0xa065('0x1d')](),'lastevent':_0xa065('0x29')});dials[_0x5c168f['uniqueid']]['duration']=utils[_0xa065('0x2a')](dials[_0x5c168f[_0xa065('0x5')]][_0xa065('0x2b')],dials[_0x5c168f[_0xa065('0x5')]]['starttime']);dials[_0x5c168f[_0xa065('0x5')]][_0xa065('0x2c')]=utils[_0xa065('0x2a')](dials[_0x5c168f[_0xa065('0x5')]]['answertime']||dials[_0x5c168f[_0xa065('0x5')]]['endtime'],dials[_0x5c168f['uniqueid']][_0xa065('0x1c')]);dials[_0x5c168f[_0xa065('0x5')]][_0xa065('0x2d')]=dials[_0x5c168f[_0xa065('0x5')]][_0xa065('0x24')]?utils[_0xa065('0x2a')](dials[_0x5c168f[_0xa065('0x5')]][_0xa065('0x2b')],dials[_0x5c168f['uniqueid']][_0xa065('0x24')]):0x0;writeDB(dials[_0x5c168f['uniqueid']]);}}catch(_0x3c8135){utils[_0xa065('0x13')](util['format'](_0xa065('0x26'),_0x5c168f[_0xa065('0x5')]),_0x3c8135);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 6155ded..6662063 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 _0x9ea3=['info','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','device','devicestatechange','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','[%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]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr','disabled','env','production','asterisk','port','username','password','keepConnected'];(function(_0x13eec6,_0x170127){var _0x585c24=function(_0x3052df){while(--_0x3052df){_0x13eec6['push'](_0x13eec6['shift']());}};_0x585c24(++_0x170127);}(_0x9ea3,0xc9));var _0x39ea=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9ea3[_0x4a9fb1];return _0x348672;};var AsteriskManager=require(_0x39ea('0x0'));var config=require(_0x39ea('0x1'));var utils=require('./utils');var util=require(_0x39ea('0x2'));var isXDREnabled=config[_0x39ea('0x3')]&&config['xdr'][_0x39ea('0x4')]?!config[_0x39ea('0x3')]['disabled']:!![];var isProduction=config[_0x39ea('0x5')]===_0x39ea('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0x39ea('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x39ea('0x7')][_0x39ea('0x8')],config[_0x39ea('0x7')]['ip'],config[_0x39ea('0x7')][_0x39ea('0x9')],config[_0x39ea('0x7')][_0x39ea('0xa')],!![]);ami[_0x39ea('0xb')]();if(!isXDREnabled){utils[_0x39ea('0xc')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x39ea('0xc')](_0x39ea('0xd'));}else{var agents=require('./agents.controller');var calls=require(_0x39ea('0xe'));var queues=require(_0x39ea('0xf'));var recordings=require(_0x39ea('0x10'));var members=require(_0x39ea('0x11'));var dials=require(_0x39ea('0x12'));var transfers=require(_0x39ea('0x13'));var core=require(_0x39ea('0x14'));ami['on'](_0x39ea('0x15'),core['connect']);ami['on'](_0x39ea('0x16'),core[_0x39ea('0x16')]);ami['on'](_0x39ea('0x17'),core[_0x39ea('0x17')]);ami['on'](_0x39ea('0x18'),core[_0x39ea('0x18')]);ami['on'](_0x39ea('0x19'),core[_0x39ea('0x19')]);ami['on'](_0x39ea('0x1a'),core['managerevent']);ami['on']('devicestatechange',function(_0x394d21){try{utils[_0x39ea('0x1b')](util[_0x39ea('0x1c')](_0x39ea('0x1d'),_0x394d21[_0x39ea('0x1e')]),_0x394d21);members[_0x39ea('0x1f')](_0x394d21);}catch(_0x409b98){utils[_0x39ea('0x18')](util[_0x39ea('0x1c')](_0x39ea('0x1d'),_0x394d21[_0x39ea('0x1e')]),_0x409b98);}});ami['on'](_0x39ea('0x20'),function(_0x45e134){try{utils[_0x39ea('0x1b')](util[_0x39ea('0x1c')](_0x39ea('0x21'),_0x45e134[_0x39ea('0x22')]),_0x45e134);agents[_0x39ea('0x20')](_0x45e134);}catch(_0x505fe1){utils['error'](util[_0x39ea('0x1c')](_0x39ea('0x21'),_0x45e134[_0x39ea('0x22')]),_0x505fe1);}});ami['on'](_0x39ea('0x23'),function(_0x59a1ac){try{utils[_0x39ea('0x1b')](util[_0x39ea('0x1c')]('[%s][index][agentringnoanswer]',_0x59a1ac[_0x39ea('0x22')]),_0x59a1ac);agents[_0x39ea('0x23')](_0x59a1ac);}catch(_0x5e61e5){utils['error'](util[_0x39ea('0x1c')]('[%s][index][agentringnoanswer]',_0x59a1ac[_0x39ea('0x22')]),_0x5e61e5);}});ami['on']('agentconnect',function(_0x4e9ae6){try{utils['debug'](util[_0x39ea('0x1c')](_0x39ea('0x24'),_0x4e9ae6[_0x39ea('0x22')]),_0x4e9ae6);agents[_0x39ea('0x25')](_0x4e9ae6);queues[_0x39ea('0x25')](_0x4e9ae6);}catch(_0x38d142){utils[_0x39ea('0x18')](util['format'](_0x39ea('0x24'),_0x4e9ae6[_0x39ea('0x22')]),_0x38d142);}});ami['on'](_0x39ea('0x26'),function(_0x1742da){try{utils[_0x39ea('0x1b')](util['format'](_0x39ea('0x27'),_0x1742da[_0x39ea('0x22')]),_0x1742da);agents['agentcomplete'](_0x1742da);queues[_0x39ea('0x26')](_0x1742da);members['agentcomplete'](_0x1742da);}catch(_0x2f3ad2){utils['error'](util[_0x39ea('0x1c')](_0x39ea('0x27'),_0x1742da[_0x39ea('0x22')]),_0x2f3ad2);}});ami['on']('queuecallerabandon',function(_0x22e1cf){try{utils['debug'](util['format'](_0x39ea('0x28'),_0x22e1cf[_0x39ea('0x22')]),_0x22e1cf);agents['queuecallerabandon'](_0x22e1cf);queues['queuecallerabandon'](_0x22e1cf);}catch(_0xf7af97){utils['error'](util['format'](_0x39ea('0x28'),_0x22e1cf[_0x39ea('0x22')]),_0xf7af97);}});ami['on'](_0x39ea('0x29'),function(_0x43d227){try{utils['debug'](util[_0x39ea('0x1c')](_0x39ea('0x2a'),_0x43d227[_0x39ea('0x22')]),_0x43d227);queues['queuecallerjoin'](_0x43d227);recordings[_0x39ea('0x29')](_0x43d227);}catch(_0x1a2b47){utils[_0x39ea('0x18')](util[_0x39ea('0x1c')](_0x39ea('0x2a'),_0x43d227[_0x39ea('0x22')]),_0x1a2b47);}});ami['on'](_0x39ea('0x2b'),function(_0x4f614b){try{utils['debug'](util['format'](_0x39ea('0x2c'),_0x4f614b['uniqueid']),_0x4f614b);queues['queuecallerleave'](_0x4f614b);}catch(_0xe8a4f1){utils[_0x39ea('0x18')](util[_0x39ea('0x1c')]('[%s][index][queuecallerleave]',_0x4f614b['uniqueid']),_0xe8a4f1);}});ami['on'](_0x39ea('0x2d'),function(_0x4ba2d1){try{utils[_0x39ea('0x1b')](util[_0x39ea('0x1c')]('[%s][index][musiconholdstart]',_0x4ba2d1['uniqueid']),_0x4ba2d1);queues[_0x39ea('0x2d')](_0x4ba2d1);calls[_0x39ea('0x2d')](_0x4ba2d1);}catch(_0x35be18){utils[_0x39ea('0x18')](util[_0x39ea('0x1c')](_0x39ea('0x2e'),_0x4ba2d1[_0x39ea('0x22')]),_0x35be18);}});ami['on'](_0x39ea('0x2f'),function(_0x203d41){try{utils[_0x39ea('0x1b')](util[_0x39ea('0x1c')]('[%s][index][musiconholdstop]',_0x203d41[_0x39ea('0x22')]),_0x203d41);queues['musiconholdstop'](_0x203d41);calls[_0x39ea('0x2f')](_0x203d41);}catch(_0x3d5a7a){utils[_0x39ea('0x18')](util['format'](_0x39ea('0x30'),_0x203d41['uniqueid']),_0x3d5a7a);}});ami['on'](_0x39ea('0x31'),function(_0x599d76){try{utils[_0x39ea('0x1b')](util[_0x39ea('0x1c')]('[%s][index][newstate]',_0x599d76[_0x39ea('0x22')]),_0x599d76);calls[_0x39ea('0x31')](_0x599d76);recordings[_0x39ea('0x31')](_0x599d76);}catch(_0xc38c23){utils['error'](util[_0x39ea('0x1c')](_0x39ea('0x32'),_0x599d76[_0x39ea('0x22')]),_0xc38c23);}});ami['on'](_0x39ea('0x33'),function(_0x219156){try{utils['debug'](util[_0x39ea('0x1c')](_0x39ea('0x34'),_0x219156[_0x39ea('0x22')]),_0x219156);calls[_0x39ea('0x33')](_0x219156);recordings[_0x39ea('0x33')](_0x219156);dials[_0x39ea('0x33')](_0x219156);agents[_0x39ea('0x33')](_0x219156);queues['hangup'](_0x219156);}catch(_0x5d248c){utils[_0x39ea('0x18')](util[_0x39ea('0x1c')](_0x39ea('0x34'),_0x219156[_0x39ea('0x22')]),_0x5d248c);}});ami['on'](_0x39ea('0x35'),function(_0x2f6a22){try{utils[_0x39ea('0x1b')](util[_0x39ea('0x1c')](_0x39ea('0x36'),_0x2f6a22['uniqueid']),_0x2f6a22);members['cdr'](_0x2f6a22);}catch(_0x31999f){utils[_0x39ea('0x18')](util['format']('[%s][index][cdr]',_0x2f6a22[_0x39ea('0x22')]),_0x31999f);}});ami['on'](_0x39ea('0x37'),function(_0x2bff45){try{utils[_0x39ea('0x1b')](util[_0x39ea('0x1c')](_0x39ea('0x38'),_0x2bff45[_0x39ea('0x22')]),_0x2bff45);queues[_0x39ea('0x37')](_0x2bff45);agents['blindtransfer'](_0x2bff45);transfers['blindtransfer'](_0x2bff45);recordings[_0x39ea('0x37')](_0x2bff45);}catch(_0x3bcf53){utils[_0x39ea('0x18')](util['format']('[%s][index][blindtransfer]',_0x2bff45[_0x39ea('0x22')]),_0x3bcf53);}});ami['on'](_0x39ea('0x39'),function(_0x38b18f){try{utils[_0x39ea('0x1b')](util[_0x39ea('0x1c')]('[%s][index][attendedtransfer]',_0x38b18f[_0x39ea('0x3a')]),_0x38b18f);queues['attendedtransfer'](_0x38b18f);transfers[_0x39ea('0x39')](_0x38b18f);agents['attendedtransfer'](_0x38b18f);calls[_0x39ea('0x39')](_0x38b18f);}catch(_0x378708){utils[_0x39ea('0x18')](util[_0x39ea('0x1c')](_0x39ea('0x3b'),_0x38b18f[_0x39ea('0x3a')]),_0x378708);}});ami['on'](_0x39ea('0x3c'),function(_0x2f18cf){try{utils[_0x39ea('0x1b')](util[_0x39ea('0x1c')](_0x39ea('0x3d'),_0x2f18cf[_0x39ea('0x22')]),_0x2f18cf);queues[_0x39ea('0x3c')](_0x2f18cf);recordings[_0x39ea('0x3c')](_0x2f18cf);calls[_0x39ea('0x3c')](_0x2f18cf);dials['varset'](_0x2f18cf);}catch(_0x45411e){utils[_0x39ea('0x18')](util[_0x39ea('0x1c')](_0x39ea('0x3d'),_0x2f18cf[_0x39ea('0x22')]),_0x45411e);}});ami['on'](_0x39ea('0x3e'),function(_0x4e1550){try{utils[_0x39ea('0x1b')](util[_0x39ea('0x1c')]('[%s][index][newexten]',_0x4e1550[_0x39ea('0x22')]),_0x4e1550);calls[_0x39ea('0x3e')](_0x4e1550);recordings[_0x39ea('0x3e')](_0x4e1550);dials['newexten'](_0x4e1550);}catch(_0x3f78c1){utils[_0x39ea('0x18')](util[_0x39ea('0x1c')](_0x39ea('0x3f'),_0x4e1550[_0x39ea('0x22')]),_0x3f78c1);}});ami['on'](_0x39ea('0x40'),function(_0x833d0b){try{utils[_0x39ea('0x1b')](util['format'](_0x39ea('0x41'),_0x833d0b['uniqueid']),_0x833d0b);calls[_0x39ea('0x40')](_0x833d0b);recordings[_0x39ea('0x40')](_0x833d0b);}catch(_0x4973e5){utils[_0x39ea('0x18')](util[_0x39ea('0x1c')]('[%s][index][newchannel]',_0x833d0b[_0x39ea('0x22')]),_0x4973e5);}});ami['on'](_0x39ea('0x42'),function(_0x3b7d79){try{utils['debug'](util[_0x39ea('0x1c')](_0x39ea('0x43'),_0x3b7d79[_0x39ea('0x22')]),_0x3b7d79);dials[_0x39ea('0x42')](_0x3b7d79);}catch(_0xddba2d){utils['error'](util[_0x39ea('0x1c')](_0x39ea('0x44'),_0x3b7d79[_0x39ea('0x22')]),_0xddba2d);}});ami['on'](_0x39ea('0x45'),function(_0x58261c){try{utils[_0x39ea('0x1b')](util[_0x39ea('0x1c')](_0x39ea('0x46'),_0x58261c[_0x39ea('0x22')]),_0x58261c);dials[_0x39ea('0x45')](_0x58261c);}catch(_0x6cf4a1){utils['error'](util[_0x39ea('0x1c')](_0x39ea('0x46'),_0x58261c[_0x39ea('0x22')]),_0x6cf4a1);}});} \ No newline at end of file +var _0x5777=['[%s][index][queuecallerleave]','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]','[%s][index][attendedtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','port','asterisk','username','password','keepConnected','info','./agents.controller','./recordings.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin'];(function(_0x5601e7,_0x222e1e){var _0x474523=function(_0x4e370f){while(--_0x4e370f){_0x5601e7['push'](_0x5601e7['shift']());}};_0x474523(++_0x222e1e);}(_0x5777,0x1f0));var _0x7577=function(_0x213b18,_0x7daf7b){_0x213b18=_0x213b18-0x0;var _0x103da5=_0x5777[_0x213b18];return _0x103da5;};var AsteriskManager=require(_0x7577('0x0'));var config=require(_0x7577('0x1'));var utils=require(_0x7577('0x2'));var util=require(_0x7577('0x3'));var isXDREnabled=config[_0x7577('0x4')]&&config[_0x7577('0x4')][_0x7577('0x5')]?!config[_0x7577('0x4')]['disabled']:!![];var isProduction=config[_0x7577('0x6')]===_0x7577('0x7')||![];var isLocalAsterisk=config['xdr']&&config['xdr'][_0x7577('0x8')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x7577('0x9')],config[_0x7577('0xa')]['ip'],config[_0x7577('0xa')][_0x7577('0xb')],config[_0x7577('0xa')][_0x7577('0xc')],!![]);ami[_0x7577('0xd')]();if(!isXDREnabled){utils[_0x7577('0xe')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x7577('0xe')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x7577('0xf'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x7577('0x10'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x7577('0x11'));var core=require('./core.controller');ami['on'](_0x7577('0x12'),core[_0x7577('0x12')]);ami['on'](_0x7577('0x13'),core[_0x7577('0x13')]);ami['on'](_0x7577('0x14'),core[_0x7577('0x14')]);ami['on'](_0x7577('0x15'),core[_0x7577('0x15')]);ami['on']('close',core[_0x7577('0x16')]);ami['on']('managerevent',core[_0x7577('0x17')]);ami['on'](_0x7577('0x18'),function(_0x42f706){try{utils[_0x7577('0x19')](util[_0x7577('0x1a')](_0x7577('0x1b'),_0x42f706[_0x7577('0x1c')]),_0x42f706);members[_0x7577('0x18')](_0x42f706);}catch(_0x304422){utils[_0x7577('0x15')](util['format'](_0x7577('0x1b'),_0x42f706[_0x7577('0x1c')]),_0x304422);}});ami['on']('agentcalled',function(_0x579ed3){try{utils[_0x7577('0x19')](util['format'](_0x7577('0x1d'),_0x579ed3[_0x7577('0x1e')]),_0x579ed3);agents[_0x7577('0x1f')](_0x579ed3);}catch(_0x19287a){utils[_0x7577('0x15')](util[_0x7577('0x1a')](_0x7577('0x1d'),_0x579ed3[_0x7577('0x1e')]),_0x19287a);}});ami['on'](_0x7577('0x20'),function(_0x16ad59){try{utils[_0x7577('0x19')](util[_0x7577('0x1a')](_0x7577('0x21'),_0x16ad59['uniqueid']),_0x16ad59);agents[_0x7577('0x20')](_0x16ad59);}catch(_0x33eb01){utils['error'](util[_0x7577('0x1a')](_0x7577('0x21'),_0x16ad59[_0x7577('0x1e')]),_0x33eb01);}});ami['on'](_0x7577('0x22'),function(_0x153e4e){try{utils[_0x7577('0x19')](util['format']('[%s][index][agentconnect]',_0x153e4e['uniqueid']),_0x153e4e);agents[_0x7577('0x22')](_0x153e4e);queues['agentconnect'](_0x153e4e);}catch(_0x6d8291){utils[_0x7577('0x15')](util['format']('[%s][index][agentconnect]',_0x153e4e[_0x7577('0x1e')]),_0x6d8291);}});ami['on']('agentcomplete',function(_0x43f085){try{utils[_0x7577('0x19')](util[_0x7577('0x1a')](_0x7577('0x23'),_0x43f085[_0x7577('0x1e')]),_0x43f085);agents[_0x7577('0x24')](_0x43f085);queues[_0x7577('0x24')](_0x43f085);members[_0x7577('0x24')](_0x43f085);}catch(_0x147e4a){utils[_0x7577('0x15')](util['format'](_0x7577('0x23'),_0x43f085[_0x7577('0x1e')]),_0x147e4a);}});ami['on'](_0x7577('0x25'),function(_0x77a335){try{utils[_0x7577('0x19')](util[_0x7577('0x1a')]('[%s][index][queuecallerabandon]',_0x77a335[_0x7577('0x1e')]),_0x77a335);agents['queuecallerabandon'](_0x77a335);queues[_0x7577('0x25')](_0x77a335);}catch(_0x337168){utils[_0x7577('0x15')](util[_0x7577('0x1a')]('[%s][index][queuecallerabandon]',_0x77a335['uniqueid']),_0x337168);}});ami['on']('queuecallerjoin',function(_0x4dbb31){try{utils[_0x7577('0x19')](util[_0x7577('0x1a')](_0x7577('0x26'),_0x4dbb31['uniqueid']),_0x4dbb31);queues[_0x7577('0x27')](_0x4dbb31);recordings['queuecallerjoin'](_0x4dbb31);}catch(_0x48e46f){utils[_0x7577('0x15')](util[_0x7577('0x1a')]('[%s][index][queuecallerjoin]',_0x4dbb31[_0x7577('0x1e')]),_0x48e46f);}});ami['on']('queuecallerleave',function(_0x1f9980){try{utils[_0x7577('0x19')](util[_0x7577('0x1a')](_0x7577('0x28'),_0x1f9980[_0x7577('0x1e')]),_0x1f9980);queues[_0x7577('0x29')](_0x1f9980);}catch(_0x443f45){utils['error'](util[_0x7577('0x1a')](_0x7577('0x28'),_0x1f9980['uniqueid']),_0x443f45);}});ami['on'](_0x7577('0x2a'),function(_0xefeaf0){try{utils[_0x7577('0x19')](util['format'](_0x7577('0x2b'),_0xefeaf0['uniqueid']),_0xefeaf0);queues[_0x7577('0x2a')](_0xefeaf0);calls[_0x7577('0x2a')](_0xefeaf0);}catch(_0x2484df){utils[_0x7577('0x15')](util[_0x7577('0x1a')](_0x7577('0x2b'),_0xefeaf0[_0x7577('0x1e')]),_0x2484df);}});ami['on'](_0x7577('0x2c'),function(_0x36ab8f){try{utils[_0x7577('0x19')](util['format']('[%s][index][musiconholdstop]',_0x36ab8f[_0x7577('0x1e')]),_0x36ab8f);queues['musiconholdstop'](_0x36ab8f);calls[_0x7577('0x2c')](_0x36ab8f);}catch(_0x23a193){utils[_0x7577('0x15')](util[_0x7577('0x1a')](_0x7577('0x2d'),_0x36ab8f['uniqueid']),_0x23a193);}});ami['on'](_0x7577('0x2e'),function(_0x355536){try{utils['debug'](util[_0x7577('0x1a')](_0x7577('0x2f'),_0x355536[_0x7577('0x1e')]),_0x355536);calls[_0x7577('0x2e')](_0x355536);recordings[_0x7577('0x2e')](_0x355536);}catch(_0x39bc59){utils['error'](util[_0x7577('0x1a')]('[%s][index][newstate]',_0x355536[_0x7577('0x1e')]),_0x39bc59);}});ami['on'](_0x7577('0x30'),function(_0x557cc3){try{utils['debug'](util[_0x7577('0x1a')]('[%s][index][hangup]',_0x557cc3[_0x7577('0x1e')]),_0x557cc3);calls[_0x7577('0x30')](_0x557cc3);recordings[_0x7577('0x30')](_0x557cc3);dials[_0x7577('0x30')](_0x557cc3);agents[_0x7577('0x30')](_0x557cc3);queues[_0x7577('0x30')](_0x557cc3);}catch(_0x43fce1){utils[_0x7577('0x15')](util['format'](_0x7577('0x31'),_0x557cc3[_0x7577('0x1e')]),_0x43fce1);}});ami['on'](_0x7577('0x32'),function(_0x2262e2){try{utils['debug'](util[_0x7577('0x1a')](_0x7577('0x33'),_0x2262e2[_0x7577('0x1e')]),_0x2262e2);members[_0x7577('0x32')](_0x2262e2);}catch(_0x5e10df){utils[_0x7577('0x15')](util[_0x7577('0x1a')](_0x7577('0x33'),_0x2262e2[_0x7577('0x1e')]),_0x5e10df);}});ami['on'](_0x7577('0x34'),function(_0x4f0a90){try{utils['debug'](util[_0x7577('0x1a')](_0x7577('0x35'),_0x4f0a90[_0x7577('0x1e')]),_0x4f0a90);queues[_0x7577('0x34')](_0x4f0a90);agents['blindtransfer'](_0x4f0a90);transfers[_0x7577('0x34')](_0x4f0a90);recordings[_0x7577('0x34')](_0x4f0a90);}catch(_0x2607e9){utils[_0x7577('0x15')](util['format']('[%s][index][blindtransfer]',_0x4f0a90[_0x7577('0x1e')]),_0x2607e9);}});ami['on']('attendedtransfer',function(_0x1384ad){try{utils[_0x7577('0x19')](util[_0x7577('0x1a')](_0x7577('0x36'),_0x1384ad['origtransfereruniqueid']),_0x1384ad);queues[_0x7577('0x37')](_0x1384ad);transfers['attendedtransfer'](_0x1384ad);agents['attendedtransfer'](_0x1384ad);calls[_0x7577('0x37')](_0x1384ad);}catch(_0x42ee27){utils['error'](util[_0x7577('0x1a')](_0x7577('0x36'),_0x1384ad[_0x7577('0x38')]),_0x42ee27);}});ami['on'](_0x7577('0x39'),function(_0x1523da){try{utils['debug'](util[_0x7577('0x1a')](_0x7577('0x3a'),_0x1523da['uniqueid']),_0x1523da);queues[_0x7577('0x39')](_0x1523da);recordings[_0x7577('0x39')](_0x1523da);calls['varset'](_0x1523da);dials['varset'](_0x1523da);}catch(_0x394a6a){utils[_0x7577('0x15')](util['format'](_0x7577('0x3a'),_0x1523da[_0x7577('0x1e')]),_0x394a6a);}});ami['on'](_0x7577('0x3b'),function(_0x101446){try{utils[_0x7577('0x19')](util[_0x7577('0x1a')](_0x7577('0x3c'),_0x101446['uniqueid']),_0x101446);calls['newexten'](_0x101446);recordings[_0x7577('0x3b')](_0x101446);dials[_0x7577('0x3b')](_0x101446);}catch(_0x129baf){utils[_0x7577('0x15')](util[_0x7577('0x1a')](_0x7577('0x3c'),_0x101446['uniqueid']),_0x129baf);}});ami['on']('newchannel',function(_0x95a13a){try{utils[_0x7577('0x19')](util[_0x7577('0x1a')](_0x7577('0x3d'),_0x95a13a[_0x7577('0x1e')]),_0x95a13a);calls[_0x7577('0x3e')](_0x95a13a);recordings[_0x7577('0x3e')](_0x95a13a);}catch(_0x14586b){utils[_0x7577('0x15')](util[_0x7577('0x1a')]('[%s][index][newchannel]',_0x95a13a[_0x7577('0x1e')]),_0x14586b);}});ami['on'](_0x7577('0x3f'),function(_0x4af1a2){try{utils['debug'](util[_0x7577('0x1a')](_0x7577('0x40'),_0x4af1a2[_0x7577('0x1e')]),_0x4af1a2);dials[_0x7577('0x3f')](_0x4af1a2);}catch(_0x1f58da){utils[_0x7577('0x15')](util[_0x7577('0x1a')](_0x7577('0x41'),_0x4af1a2[_0x7577('0x1e')]),_0x1f58da);}});ami['on'](_0x7577('0x42'),function(_0x29c44e){try{utils[_0x7577('0x19')](util['format']('[%s][index][dialend]',_0x29c44e[_0x7577('0x1e')]),_0x29c44e);dials[_0x7577('0x42')](_0x29c44e);}catch(_0xc49333){utils['error'](util['format']('[%s][index][dialend]',_0x29c44e[_0x7577('0x1e')]),_0xc49333);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 6ba0ab6..ced1e40 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 _0x9ef8=['uniqueid','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','duration','exitAt','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','channel','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','data2','membername','type','interface','getUserByInterface','then','internal','request','getUserByName','split','name','catch','error','[%s][members][writeDB]','some','devicestatechange','debug','[%s][members][devicestatechange]','device'];(function(_0x5d0108,_0x44adee){var _0x53e2e8=function(_0x2da537){while(--_0x2da537){_0x5d0108['push'](_0x5d0108['shift']());}};_0x53e2e8(++_0x44adee);}(_0x9ef8,0x17f));var _0x89ef=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0x9ef8[_0x154940];return _0x401409;};'use strict';var _=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var utils=require('./utils');var members={};var exclude=[_0x89ef('0x2'),_0x89ef('0x3')];function writeDB(_0x6ad29a){utils['info'](util[_0x89ef('0x4')](_0x89ef('0x5'),_0x6ad29a['uniqueid'],_0x6ad29a['interface'],_0x6ad29a['channel'],_0x6ad29a[_0x89ef('0x6')],_0x6ad29a[_0x89ef('0x7')],_0x6ad29a[_0x89ef('0x8')]));if(_0x6ad29a[_0x89ef('0x9')]){utils[_0x89ef('0xa')](_0x6ad29a[_0x89ef('0x9')])[_0x89ef('0xb')](function(_0x3d204a){if(_0x3d204a){_0x6ad29a[_0x89ef('0x7')]=_0x3d204a['name'];_0x6ad29a[_0x89ef('0xc')]=_0x3d204a[_0x89ef('0xc')];utils[_0x89ef('0xd')]('CreateMemberReport',_0x6ad29a);}else{utils[_0x89ef('0xe')](_0x6ad29a[_0x89ef('0x9')][_0x89ef('0xf')]('/')[0x1])[_0x89ef('0xb')](function(_0x2f1376){if(_0x2f1376){_0x6ad29a['membername']=_0x2f1376[_0x89ef('0x10')];_0x6ad29a['internal']=_0x2f1376[_0x89ef('0xc')];utils[_0x89ef('0xd')]('CreateMemberReport',_0x6ad29a);}});}})[_0x89ef('0x11')](function(_0x269192){utils[_0x89ef('0x12')](util[_0x89ef('0x4')](_0x89ef('0x13'),_0x6ad29a['uniqueid']),_0x269192);});}delete members[_0x6ad29a[_0x89ef('0x9')]];}function startsWith(_0x4b73a4,_0x4fc5b4){return _[_0x89ef('0x14')](_0x4b73a4,function(_0x1a89b7){return _['startsWith'](_0x4fc5b4,_0x1a89b7);});}exports[_0x89ef('0x15')]=function(_0x490877){try{utils[_0x89ef('0x16')](util['format'](_0x89ef('0x17'),members[_0x490877[_0x89ef('0x18')]]?members[_0x490877[_0x89ef('0x18')]][_0x89ef('0x19')]:_0x490877['device']),_0x490877);utils[_0x89ef('0x1a')](util[_0x89ef('0x4')](_0x89ef('0x1b'),members[_0x490877[_0x89ef('0x18')]]?members[_0x490877[_0x89ef('0x18')]][_0x89ef('0x19')]:_0x490877[_0x89ef('0x18')],_0x490877[_0x89ef('0x1c')],_0x490877[_0x89ef('0x18')]));switch(_0x490877[_0x89ef('0x1c')]){case _0x89ef('0x1d'):case _0x89ef('0x1e'):if(!startsWith(exclude,_0x490877[_0x89ef('0x18')])){members[_0x490877[_0x89ef('0x18')]]={'channel':_0x89ef('0x1f'),'interface':_0x490877[_0x89ef('0x18')],'type':_0x89ef('0x20'),'enterAt':utils['now'](),'role':'agent'};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x490877[_0x89ef('0x18')]])){members[_0x490877[_0x89ef('0x18')]]['exitAt']=utils['now']();members[_0x490877[_0x89ef('0x18')]][_0x89ef('0x21')]=utils['diffTime'](members[_0x490877['device']][_0x89ef('0x22')],members[_0x490877[_0x89ef('0x18')]][_0x89ef('0x23')]);if(members[_0x490877[_0x89ef('0x18')]][_0x89ef('0x19')]){writeDB(members[_0x490877[_0x89ef('0x18')]]);}}break;default:break;}}catch(_0x2ebaff){utils['error'](util[_0x89ef('0x4')](_0x89ef('0x17'),members[_0x490877[_0x89ef('0x18')]]?members[_0x490877[_0x89ef('0x18')]]['uniqueid']:_0x490877['device']),_0x2ebaff);}};exports[_0x89ef('0x24')]=function(_0x24cabf){try{if(!_[_0x89ef('0x25')](members[_0x24cabf['interface']])){utils[_0x89ef('0x16')](util[_0x89ef('0x4')]('[%s][members][agentcomplete]',_0x24cabf[_0x89ef('0x19')]),_0x24cabf);utils[_0x89ef('0x1a')](util[_0x89ef('0x4')](_0x89ef('0x26'),_0x24cabf['uniqueid'],_0x24cabf[_0x89ef('0x9')],_0x24cabf[_0x89ef('0x27')]));members[_0x24cabf['interface']]=_[_0x89ef('0x28')](members[_0x24cabf[_0x89ef('0x9')]],{'data4':_0x24cabf[_0x89ef('0x27')],'uniqueid':_0x24cabf['uniqueid']});}}catch(_0xd46ed1){utils[_0x89ef('0x12')](util[_0x89ef('0x4')](_0x89ef('0x29'),_0x24cabf[_0x89ef('0x19')]),_0xd46ed1);}};exports[_0x89ef('0x2a')]=function(_0x184567){try{utils[_0x89ef('0x16')](util[_0x89ef('0x4')](_0x89ef('0x2b'),_0x184567[_0x89ef('0x19')]),_0x184567);if(_0x184567[_0x89ef('0x2c')]){var _0x43c5f1=_0x184567[_0x89ef('0x2c')][_0x89ef('0xf')]('-')[0x0];if(!_[_0x89ef('0x25')](members[_0x43c5f1])){members[_0x43c5f1]=_['assign'](members[_0x43c5f1],{'data1':members[_0x43c5f1]['data1']||_0x184567[_0x89ef('0x8')],'data2':members[_0x43c5f1][_0x89ef('0x6')]||_0x184567[_0x89ef('0x2d')],'data3':members[_0x43c5f1][_0x89ef('0x2e')]||_0x184567[_0x89ef('0x2f')],'uniqueid':members[_0x43c5f1]['uniqueid']||_0x184567[_0x89ef('0x19')]});utils['info'](util[_0x89ef('0x4')](_0x89ef('0x30'),_0x184567[_0x89ef('0x19')],members[_0x43c5f1][_0x89ef('0x31')],members[_0x43c5f1][_0x89ef('0x6')],members[_0x43c5f1][_0x89ef('0x2e')]));if(members[_0x43c5f1][_0x89ef('0x22')]){writeDB(members[_0x43c5f1]);}}}if(_0x184567[_0x89ef('0x32')]){var _0x57c6d6=_0x184567['destinationchannel'][_0x89ef('0xf')]('-')[0x0];if(!_[_0x89ef('0x25')](members[_0x57c6d6])){members[_0x57c6d6]=_[_0x89ef('0x28')](members[_0x57c6d6],{'data1':members[_0x57c6d6]['data1']||_0x184567[_0x89ef('0x8')],'data2':members[_0x57c6d6][_0x89ef('0x6')]||_0x184567[_0x89ef('0x2d')],'data3':members[_0x57c6d6][_0x89ef('0x2e')]||_0x184567['destination'],'uniqueid':members[_0x57c6d6][_0x89ef('0x19')]||_0x184567[_0x89ef('0x19')]});utils[_0x89ef('0x1a')](util[_0x89ef('0x4')](_0x89ef('0x30'),_0x184567[_0x89ef('0x19')],members[_0x57c6d6][_0x89ef('0x31')],members[_0x57c6d6]['data2'],members[_0x57c6d6]['data3']));if(members[_0x57c6d6][_0x89ef('0x22')]){writeDB(members[_0x57c6d6]);}}}}catch(_0x3cfa30){utils[_0x89ef('0x12')](util['format'](_0x89ef('0x2b'),_0x184567['uniqueid']),_0x3cfa30);}}; \ No newline at end of file +var _0x04a8=['getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','[%s][members][writeDB]','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','exitAt','diffTime','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]','queue','assign','data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','lodash','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x04a8,0x153));var _0x804a=function(_0x3570f3,_0x33269c){_0x3570f3=_0x3570f3-0x0;var _0x5c18be=_0x04a8[_0x3570f3];return _0x5c18be;};'use strict';var _=require(_0x804a('0x0'));var util=require('util');var utils=require(_0x804a('0x1'));var members={};var exclude=[_0x804a('0x2'),_0x804a('0x3')];function writeDB(_0x28a60b){utils['info'](util[_0x804a('0x4')](_0x804a('0x5'),_0x28a60b[_0x804a('0x6')],_0x28a60b[_0x804a('0x7')],_0x28a60b[_0x804a('0x8')],_0x28a60b[_0x804a('0x9')],_0x28a60b[_0x804a('0xa')],_0x28a60b['type']));if(_0x28a60b[_0x804a('0x7')]){utils[_0x804a('0xb')](_0x28a60b[_0x804a('0x7')])[_0x804a('0xc')](function(_0x306b38){if(_0x306b38){_0x28a60b[_0x804a('0xa')]=_0x306b38[_0x804a('0xd')];_0x28a60b[_0x804a('0xe')]=_0x306b38[_0x804a('0xe')];utils[_0x804a('0xf')](_0x804a('0x10'),_0x28a60b);}else{utils[_0x804a('0x11')](_0x28a60b[_0x804a('0x7')][_0x804a('0x12')]('/')[0x1])['then'](function(_0x2264aa){if(_0x2264aa){_0x28a60b[_0x804a('0xa')]=_0x2264aa[_0x804a('0xd')];_0x28a60b[_0x804a('0xe')]=_0x2264aa[_0x804a('0xe')];utils[_0x804a('0xf')](_0x804a('0x10'),_0x28a60b);}});}})['catch'](function(_0x2f2e37){utils[_0x804a('0x13')](util[_0x804a('0x4')](_0x804a('0x14'),_0x28a60b['uniqueid']),_0x2f2e37);});}delete members[_0x28a60b[_0x804a('0x7')]];}function startsWith(_0x5170c2,_0x5e8f6b){return _['some'](_0x5170c2,function(_0x60531d){return _[_0x804a('0x15')](_0x5e8f6b,_0x60531d);});}exports[_0x804a('0x16')]=function(_0x4823cc){try{utils[_0x804a('0x17')](util['format'](_0x804a('0x18'),members[_0x4823cc[_0x804a('0x19')]]?members[_0x4823cc[_0x804a('0x19')]][_0x804a('0x6')]:_0x4823cc[_0x804a('0x19')]),_0x4823cc);utils[_0x804a('0x1a')](util['format'](_0x804a('0x1b'),members[_0x4823cc[_0x804a('0x19')]]?members[_0x4823cc[_0x804a('0x19')]][_0x804a('0x6')]:_0x4823cc[_0x804a('0x19')],_0x4823cc[_0x804a('0x1c')],_0x4823cc[_0x804a('0x19')]));switch(_0x4823cc[_0x804a('0x1c')]){case _0x804a('0x1d'):case _0x804a('0x1e'):if(!startsWith(exclude,_0x4823cc['device'])){members[_0x4823cc[_0x804a('0x19')]]={'channel':_0x804a('0x1f'),'interface':_0x4823cc['device'],'type':_0x804a('0x20'),'enterAt':utils[_0x804a('0x21')](),'role':'agent'};}break;case _0x804a('0x22'):if(!_['isNil'](members[_0x4823cc['device']])){members[_0x4823cc[_0x804a('0x19')]][_0x804a('0x23')]=utils[_0x804a('0x21')]();members[_0x4823cc[_0x804a('0x19')]]['duration']=utils[_0x804a('0x24')](members[_0x4823cc['device']][_0x804a('0x23')],members[_0x4823cc['device']][_0x804a('0x25')]);if(members[_0x4823cc[_0x804a('0x19')]][_0x804a('0x6')]){writeDB(members[_0x4823cc[_0x804a('0x19')]]);}}break;default:break;}}catch(_0x38d14f){utils[_0x804a('0x13')](util[_0x804a('0x4')](_0x804a('0x18'),members[_0x4823cc[_0x804a('0x19')]]?members[_0x4823cc[_0x804a('0x19')]][_0x804a('0x6')]:_0x4823cc['device']),_0x38d14f);}};exports[_0x804a('0x26')]=function(_0x4eb0c4){try{if(!_[_0x804a('0x27')](members[_0x4eb0c4[_0x804a('0x7')]])){utils[_0x804a('0x17')](util['format'](_0x804a('0x28'),_0x4eb0c4['uniqueid']),_0x4eb0c4);utils[_0x804a('0x1a')](util[_0x804a('0x4')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x4eb0c4['uniqueid'],_0x4eb0c4[_0x804a('0x7')],_0x4eb0c4[_0x804a('0x29')]));members[_0x4eb0c4[_0x804a('0x7')]]=_[_0x804a('0x2a')](members[_0x4eb0c4['interface']],{'data4':_0x4eb0c4[_0x804a('0x29')],'uniqueid':_0x4eb0c4['uniqueid']});}}catch(_0x377dbc){utils[_0x804a('0x13')](util[_0x804a('0x4')](_0x804a('0x28'),_0x4eb0c4['uniqueid']),_0x377dbc);}};exports['cdr']=function(_0x50ab64){try{utils[_0x804a('0x17')](util[_0x804a('0x4')]('[%s][members][cdr]',_0x50ab64[_0x804a('0x6')]),_0x50ab64);if(_0x50ab64['channel']){var _0x5e96d0=_0x50ab64[_0x804a('0x8')][_0x804a('0x12')]('-')[0x0];if(!_[_0x804a('0x27')](members[_0x5e96d0])){members[_0x5e96d0]=_['assign'](members[_0x5e96d0],{'data1':members[_0x5e96d0][_0x804a('0x2b')]||_0x50ab64[_0x804a('0x2c')],'data2':members[_0x5e96d0][_0x804a('0x9')]||_0x50ab64[_0x804a('0x2d')],'data3':members[_0x5e96d0][_0x804a('0x2e')]||_0x50ab64[_0x804a('0x2f')],'uniqueid':members[_0x5e96d0][_0x804a('0x6')]||_0x50ab64[_0x804a('0x6')]});utils[_0x804a('0x1a')](util['format'](_0x804a('0x30'),_0x50ab64[_0x804a('0x6')],members[_0x5e96d0]['data1'],members[_0x5e96d0][_0x804a('0x9')],members[_0x5e96d0][_0x804a('0x2e')]));if(members[_0x5e96d0][_0x804a('0x23')]){writeDB(members[_0x5e96d0]);}}}if(_0x50ab64['destinationchannel']){var _0x6a123e=_0x50ab64['destinationchannel'][_0x804a('0x12')]('-')[0x0];if(!_[_0x804a('0x27')](members[_0x6a123e])){members[_0x6a123e]=_['assign'](members[_0x6a123e],{'data1':members[_0x6a123e][_0x804a('0x2b')]||_0x50ab64[_0x804a('0x2c')],'data2':members[_0x6a123e][_0x804a('0x9')]||_0x50ab64['source'],'data3':members[_0x6a123e][_0x804a('0x2e')]||_0x50ab64[_0x804a('0x2f')],'uniqueid':members[_0x6a123e][_0x804a('0x6')]||_0x50ab64['uniqueid']});utils[_0x804a('0x1a')](util[_0x804a('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x50ab64[_0x804a('0x6')],members[_0x6a123e][_0x804a('0x2b')],members[_0x6a123e][_0x804a('0x9')],members[_0x6a123e][_0x804a('0x2e')]));if(members[_0x6a123e][_0x804a('0x23')]){writeDB(members[_0x6a123e]);}}}}catch(_0x5ec750){utils[_0x804a('0x13')](util[_0x804a('0x4')](_0x804a('0x31'),_0x50ab64[_0x804a('0x6')]),_0x5ec750);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 131463e..8d868a1 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 _0x89e9=['variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexit','queuecallerexitAt','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','position','count','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','[%s][queues][queuecallerjoin]','info','assign','now','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','varset','debug','isNil'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x89e9,0x118));var _0x989e=function(_0x181845,_0x3f9fcb){_0x181845=_0x181845-0x0;var _0x19f33d=_0x89e9[_0x181845];return _0x19f33d;};'use strict';var _=require('lodash');var util=require(_0x989e('0x0'));var utils=require(_0x989e('0x1'));var queues={};function writeDB(_0x512990){utils['info'](util[_0x989e('0x2')](_0x989e('0x3'),_0x512990[_0x989e('0x4')],_0x512990[_0x989e('0x5')],_0x512990[_0x989e('0x6')],_0x512990['lastAssignedTo'],_0x512990[_0x989e('0x7')],_0x512990[_0x989e('0x8')],_0x512990['queuecallerexitreason']));if(_0x512990[_0x989e('0x6')]){utils[_0x989e('0x9')](_0x512990[_0x989e('0x6')])[_0x989e('0xa')](function(_0x12ed25){if(_0x12ed25){_0x512990[_0x989e('0xb')]=_0x12ed25['type'];}utils[_0x989e('0xc')]('CreateVoiceQueueReport',_0x512990);});}else{utils['request'](_0x989e('0xd'),_0x512990);}if(_0x512990[_0x989e('0xe')]){delete queues[_0x512990[_0x989e('0xe')]];}else{delete queues[_0x512990[_0x989e('0x4')]];}}exports['queuecallerjoin']=function(_0x50669d){try{utils['debug'](util[_0x989e('0x2')](_0x989e('0xf'),_0x50669d[_0x989e('0x4')]),_0x50669d);utils[_0x989e('0x10')](util[_0x989e('0x2')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x50669d[_0x989e('0x4')],_0x50669d[_0x989e('0x6')],_0x50669d['position']));queues[_0x50669d['uniqueid']]=_[_0x989e('0x11')](_0x50669d,{'originalposition':_0x50669d['position'],'queuecallerjoinAt':utils[_0x989e('0x12')](),'mohtime':0x0});}catch(_0x3767b7){utils['error'](util[_0x989e('0x2')](_0x989e('0xf'),_0x50669d[_0x989e('0x4')]),_0x3767b7);}};exports[_0x989e('0x13')]=function(_0x116af5){try{if(!_['isNil'](queues[_0x116af5[_0x989e('0x4')]])){utils['debug'](util['format'](_0x989e('0x14'),_0x116af5[_0x989e('0x4')]),_0x116af5);if(queues[_0x116af5[_0x989e('0x4')]][_0x989e('0x15')]){if(!queues[_0x116af5[_0x989e('0x4')]][_0x989e('0x16')]&&!queues[_0x116af5[_0x989e('0x4')]]['queuecallerexit']){queues[_0x116af5['uniqueid']][_0x989e('0x17')]=!![];queues[_0x116af5[_0x989e('0x4')]][_0x989e('0x18')]=utils['now']();queues[_0x116af5['uniqueid']][_0x989e('0x19')]=_0x989e('0x1a');}utils[_0x989e('0x10')](util[_0x989e('0x2')](_0x989e('0x1b'),_0x116af5[_0x989e('0x4')],queues[_0x116af5['uniqueid']][_0x989e('0x1c')],queues[_0x116af5[_0x989e('0x4')]][_0x989e('0x19')]));writeDB(queues[_0x116af5[_0x989e('0x4')]]);}else if(queues[_0x116af5[_0x989e('0x4')]][_0x989e('0xe')]){utils[_0x989e('0x10')](util[_0x989e('0x2')](_0x989e('0x1d'),_0x116af5[_0x989e('0x4')],queues[_0x116af5[_0x989e('0x4')]][_0x989e('0x1c')],queues[_0x116af5[_0x989e('0x4')]][_0x989e('0xe')]));queues[queues[_0x116af5[_0x989e('0x4')]][_0x989e('0xe')]]=queues[_0x116af5[_0x989e('0x4')]];queues[queues[_0x116af5[_0x989e('0x4')]]['transfereduniqueid']][_0x989e('0x1e')]=0x2;delete queues[_0x116af5[_0x989e('0x4')]];}}}catch(_0x29f16b){utils[_0x989e('0x1f')](util['format'](_0x989e('0x14'),_0x116af5[_0x989e('0x4')]),_0x29f16b);}};exports[_0x989e('0x20')]=function(_0x2e43ff){try{utils[_0x989e('0x21')](util[_0x989e('0x2')]('[%s][queues][varset]',_0x2e43ff[_0x989e('0x4')]),_0x2e43ff);if(!_[_0x989e('0x22')](_0x2e43ff[_0x989e('0x23')][_0x989e('0x24')])&&_0x2e43ff[_0x989e('0x25')][_0x989e('0x26')]()!==_0x989e('0x27')){if(!_[_0x989e('0x22')](queues[_0x2e43ff[_0x989e('0x4')]])){queues[_0x2e43ff[_0x989e('0x4')]][_0x989e('0x16')]=![];queues[_0x2e43ff['uniqueid']]['queuecallerabandonAt']=null;queues[_0x2e43ff[_0x989e('0x4')]][_0x989e('0x28')]=!![];queues[_0x2e43ff['uniqueid']][_0x989e('0x29')]=utils[_0x989e('0x12')]();queues[_0x2e43ff[_0x989e('0x4')]][_0x989e('0x19')]=_0x2e43ff[_0x989e('0x25')]['toUpperCase']();utils['info'](util[_0x989e('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x2e43ff[_0x989e('0x4')],queues[_0x2e43ff[_0x989e('0x4')]]['name'],_0x2e43ff['value'],queues[_0x2e43ff[_0x989e('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x2e43ff[_0x989e('0x4')]]);}}else if(!_['isNil'](_0x2e43ff['variable']['queueposition'])){if(!_[_0x989e('0x22')](queues[_0x2e43ff[_0x989e('0x4')]])&&!queues[_0x2e43ff[_0x989e('0x4')]][_0x989e('0x16')]){queues[_0x2e43ff['uniqueid']][_0x989e('0x16')]=![];queues[_0x2e43ff[_0x989e('0x4')]][_0x989e('0x2a')]=null;queues[_0x2e43ff['uniqueid']]['queuecallerexit']=!![];queues[_0x2e43ff[_0x989e('0x4')]]['queuecallerexitAt']=utils[_0x989e('0x12')]();queues[_0x2e43ff[_0x989e('0x4')]]['queuecallerexitreason']=_0x989e('0x2b');utils[_0x989e('0x10')](util[_0x989e('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x2e43ff[_0x989e('0x4')],queues[_0x2e43ff[_0x989e('0x4')]]['name'],_0x2e43ff[_0x989e('0x25')],queues[_0x2e43ff[_0x989e('0x4')]][_0x989e('0x19')]));}}}catch(_0x5669cf){utils[_0x989e('0x1f')](util[_0x989e('0x2')](_0x989e('0x2c'),_0x2e43ff[_0x989e('0x4')]),_0x5669cf);}};exports[_0x989e('0x16')]=function(_0x1dc059){try{if(!_[_0x989e('0x22')](queues[_0x1dc059[_0x989e('0x4')]])){utils[_0x989e('0x21')](util[_0x989e('0x2')](_0x989e('0x2d'),_0x1dc059[_0x989e('0x4')]),_0x1dc059);queues[_0x1dc059[_0x989e('0x4')]][_0x989e('0x28')]=![];queues[_0x1dc059[_0x989e('0x4')]][_0x989e('0x29')]=null;queues[_0x1dc059[_0x989e('0x4')]][_0x989e('0x16')]=!![];queues[_0x1dc059[_0x989e('0x4')]][_0x989e('0x2a')]=utils[_0x989e('0x12')]();queues[_0x1dc059['uniqueid']][_0x989e('0x19')]=_0x989e('0x2e');utils[_0x989e('0x10')](util[_0x989e('0x2')](_0x989e('0x2f'),_0x1dc059[_0x989e('0x4')],queues[_0x1dc059['uniqueid']]['name'],queues[_0x1dc059[_0x989e('0x4')]][_0x989e('0x19')]));}}catch(_0x462531){utils[_0x989e('0x1f')](util[_0x989e('0x2')]('[%s][queues][queuecallerabandon]',_0x1dc059['uniqueid']),_0x462531);}};exports[_0x989e('0x30')]=function(_0x34bbbf){try{if(!_[_0x989e('0x22')](queues[_0x34bbbf[_0x989e('0x4')]])){utils['debug'](util[_0x989e('0x2')](_0x989e('0x31'),_0x34bbbf[_0x989e('0x4')]),_0x34bbbf);utils[_0x989e('0x10')](util[_0x989e('0x2')](_0x989e('0x32'),_0x34bbbf[_0x989e('0x4')],queues[_0x34bbbf[_0x989e('0x4')]][_0x989e('0x1c')],_0x34bbbf[_0x989e('0x33')],_0x34bbbf[_0x989e('0x34')]));queues[_0x34bbbf[_0x989e('0x4')]][_0x989e('0x30')]=!![];queues[_0x34bbbf['uniqueid']][_0x989e('0x15')]=utils[_0x989e('0x12')]();queues[_0x34bbbf[_0x989e('0x4')]][_0x989e('0x35')]=utils[_0x989e('0x36')](queues[_0x34bbbf['uniqueid']][_0x989e('0x15')],queues[_0x34bbbf[_0x989e('0x4')]][_0x989e('0x37')]);queues[_0x34bbbf[_0x989e('0x4')]][_0x989e('0x38')]=_0x34bbbf[_0x989e('0x38')];queues[_0x34bbbf[_0x989e('0x4')]][_0x989e('0x39')]=_0x34bbbf[_0x989e('0x39')];queues[_0x34bbbf['uniqueid']][_0x989e('0x33')]=_0x34bbbf[_0x989e('0x33')];queues[_0x34bbbf[_0x989e('0x4')]][_0x989e('0x34')]=_0x34bbbf[_0x989e('0x34')];}}catch(_0x27fbcc){utils[_0x989e('0x1f')](util[_0x989e('0x2')](_0x989e('0x31'),_0x34bbbf[_0x989e('0x4')]),_0x27fbcc);}};exports[_0x989e('0x3a')]=function(_0x4c7ecd){try{if(!_[_0x989e('0x22')](queues[_0x4c7ecd['uniqueid']])){utils['debug'](util[_0x989e('0x2')](_0x989e('0x3b'),_0x4c7ecd[_0x989e('0x4')]),_0x4c7ecd);utils['info'](util[_0x989e('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x4c7ecd[_0x989e('0x4')],queues[_0x4c7ecd[_0x989e('0x4')]]['name'],_0x4c7ecd['membername'],_0x4c7ecd[_0x989e('0x3c')]));queues[_0x4c7ecd[_0x989e('0x4')]][_0x989e('0x16')]=![];queues[_0x4c7ecd['uniqueid']][_0x989e('0x16')]=![];queues[_0x4c7ecd['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4c7ecd[_0x989e('0x4')]][_0x989e('0x28')]=![];queues[_0x4c7ecd[_0x989e('0x4')]]['queuecallerexitreason']=null;queues[_0x4c7ecd[_0x989e('0x4')]][_0x989e('0x29')]=null;queues[_0x4c7ecd[_0x989e('0x4')]][_0x989e('0x3d')]=!![];queues[_0x4c7ecd[_0x989e('0x4')]][_0x989e('0x8')]=_0x4c7ecd[_0x989e('0x3c')];queues[_0x4c7ecd['uniqueid']]['lastAssignedTo']=_0x4c7ecd[_0x989e('0x3e')];}}catch(_0x20b8ce){utils[_0x989e('0x1f')](util[_0x989e('0x2')](_0x989e('0x3b'),_0x4c7ecd[_0x989e('0x4')]),_0x20b8ce);}};exports[_0x989e('0x3f')]=function(_0x584e62){try{if(!_['isNil'](queues[_0x584e62['uniqueid']])){if(queues[_0x584e62[_0x989e('0x4')]][_0x989e('0x15')]){utils[_0x989e('0x21')](util[_0x989e('0x2')](_0x989e('0x40'),_0x584e62[_0x989e('0x4')]),_0x584e62);queues[_0x584e62[_0x989e('0x4')]][_0x989e('0x16')]=![];queues[_0x584e62[_0x989e('0x4')]]['queuecallerabandon']=![];queues[_0x584e62[_0x989e('0x4')]][_0x989e('0x2a')]=null;queues[_0x584e62['uniqueid']]['queuecallerexit']=![];queues[_0x584e62['uniqueid']][_0x989e('0x29')]=null;queues[_0x584e62['uniqueid']][_0x989e('0x3d')]=!![];queues[_0x584e62[_0x989e('0x4')]]['lastAssignedTo']=_0x584e62[_0x989e('0x3e')];queues[_0x584e62[_0x989e('0x4')]][_0x989e('0x17')]=!![];queues[_0x584e62[_0x989e('0x4')]][_0x989e('0x18')]=utils[_0x989e('0x12')]();if(_0x584e62['reason']=='transfer'){if(!queues[_0x584e62[_0x989e('0x4')]][_0x989e('0x41')]){queues[_0x584e62[_0x989e('0x4')]]['queuecallerexitreason']=_0x989e('0x42');}}else{queues[_0x584e62[_0x989e('0x4')]]['queuecallerexitreason']=_0x989e('0x43')+_0x584e62[_0x989e('0x44')][_0x989e('0x26')]();}utils['info'](util['format'](_0x989e('0x45'),_0x584e62['uniqueid'],queues[_0x584e62[_0x989e('0x4')]][_0x989e('0x1c')],_0x584e62['membername'],queues[_0x584e62[_0x989e('0x4')]][_0x989e('0x19')]));writeDB(queues[_0x584e62[_0x989e('0x4')]]);}}}catch(_0x33c61e){utils[_0x989e('0x1f')](util[_0x989e('0x2')](_0x989e('0x40'),_0x584e62[_0x989e('0x4')]),_0x33c61e);}};exports[_0x989e('0x46')]=function(_0x19ce99){try{if(!_[_0x989e('0x22')](queues[_0x19ce99[_0x989e('0x47')]])){utils[_0x989e('0x21')](util[_0x989e('0x2')](_0x989e('0x48'),_0x19ce99[_0x989e('0x4')]),_0x19ce99);queues[_0x19ce99[_0x989e('0x47')]][_0x989e('0x41')]=!![];queues[_0x19ce99['transfereeuniqueid']][_0x989e('0x49')]=_0x989e('0x4a');queues[_0x19ce99['transfereeuniqueid']][_0x989e('0x4b')]=_0x19ce99[_0x989e('0x4c')];queues[_0x19ce99[_0x989e('0x47')]][_0x989e('0x4d')]=_0x19ce99[_0x989e('0x47')];queues[_0x19ce99['transfereeuniqueid']][_0x989e('0x19')]=_0x989e('0x4e');utils[_0x989e('0x10')](util[_0x989e('0x2')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x19ce99[_0x989e('0x4')],queues[_0x19ce99[_0x989e('0x47')]][_0x989e('0x1c')],_0x19ce99['transfereeuniqueid'],_0x19ce99[_0x989e('0x4c')]));}}catch(_0x4d1236){utils['error'](util['format']('[%s][queues][blindtransfer]',_0x19ce99[_0x989e('0x4')]),_0x4d1236);}};exports[_0x989e('0x4f')]=function(_0x9383eb){try{utils['debug'](util[_0x989e('0x2')](_0x989e('0x50'),_0x9383eb[_0x989e('0x51')]),_0x9383eb);if(_0x9383eb[_0x989e('0x51')]==_0x9383eb[_0x989e('0x52')]){if(!_[_0x989e('0x22')](queues[_0x9383eb[_0x989e('0x53')]])){utils[_0x989e('0x10')](util['format'](_0x989e('0x54'),_0x9383eb[_0x989e('0x51')],queues[_0x9383eb[_0x989e('0x53')]][_0x989e('0x1c')],_0x9383eb[_0x989e('0x55')]));queues[_0x9383eb[_0x989e('0x53')]][_0x989e('0x41')]=!![];queues[_0x9383eb['secondtransfererlinkedid']][_0x989e('0x49')]=_0x989e('0x56');queues[_0x9383eb['secondtransfererlinkedid']][_0x989e('0x4b')]=_0x9383eb[_0x989e('0x55')];queues[_0x9383eb[_0x989e('0x53')]]['transferuniqueid']=_0x9383eb[_0x989e('0x51')];queues[_0x9383eb[_0x989e('0x53')]]['queuecallerexitreason']=_0x989e('0x57');}if(!_[_0x989e('0x22')](queues[_0x9383eb['origtransfererlinkedid']])){if(_0x9383eb[_0x989e('0x58')]&&queues[_0x9383eb[_0x989e('0x58')]]){queues[_0x9383eb['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x9383eb[_0x989e('0x47')]]=_[_0x989e('0x59')](queues[_0x9383eb[_0x989e('0x58')]]);queues[_0x9383eb[_0x989e('0x47')]][_0x989e('0xe')]=_0x9383eb[_0x989e('0x5a')];queues[_0x9383eb[_0x989e('0x47')]][_0x989e('0x1e')]=0x2;queues[_0x9383eb[_0x989e('0x47')]][_0x989e('0x7')]=queues[_0x9383eb[_0x989e('0x53')]][_0x989e('0x7')];queues[_0x9383eb[_0x989e('0x47')]][_0x989e('0x5b')]=queues[_0x9383eb[_0x989e('0x53')]][_0x989e('0x5b')];queues[_0x9383eb[_0x989e('0x47')]][_0x989e('0x37')]=utils[_0x989e('0x12')]();queues[_0x9383eb[_0x989e('0x47')]][_0x989e('0x15')]=utils['now']();queues[_0x9383eb[_0x989e('0x47')]][_0x989e('0x35')]=0x0;queues[_0x9383eb[_0x989e('0x47')]][_0x989e('0x5c')]=0x0;utils[_0x989e('0x10')](util[_0x989e('0x2')](_0x989e('0x5d'),_0x9383eb['origtransfereruniqueid'],queues[_0x9383eb[_0x989e('0x47')]]['name'],queues[_0x9383eb[_0x989e('0x47')]]['calleridnum'],queues[_0x9383eb['transfereeuniqueid']][_0x989e('0x5b')]));}else{utils[_0x989e('0x10')](util[_0x989e('0x2')](_0x989e('0x5e'),_0x9383eb[_0x989e('0x51')],queues[_0x9383eb[_0x989e('0x52')]][_0x989e('0x1c')],_0x9383eb[_0x989e('0x53')]));queues[_0x9383eb['origtransfererlinkedid']][_0x989e('0xe')]=_0x9383eb[_0x989e('0x53')];}}}else if(_0x9383eb['secondtransfereruniqueid']==_0x9383eb[_0x989e('0x53')]){if(!_[_0x989e('0x22')](queues[_0x9383eb[_0x989e('0x52')]])){utils[_0x989e('0x10')](util[_0x989e('0x2')](_0x989e('0x5f'),_0x9383eb[_0x989e('0x51')],queues[_0x9383eb['origtransfererlinkedid']][_0x989e('0x1c')],_0x9383eb[_0x989e('0x60')],_0x9383eb['secondtransfererexten']));queues[_0x9383eb[_0x989e('0x52')]][_0x989e('0x41')]=!![];queues[_0x9383eb[_0x989e('0x52')]]['transfertype']=_0x989e('0x56');queues[_0x9383eb['origtransfererlinkedid']]['transferexten']=_0x9383eb['secondtransfererexten'];queues[_0x9383eb['origtransfererlinkedid']][_0x989e('0x4d')]=_0x9383eb[_0x989e('0x60')];queues[_0x9383eb[_0x989e('0x52')]]['queuecallerexitreason']=_0x989e('0x57');}if(!_[_0x989e('0x22')](queues[_0x9383eb[_0x989e('0x53')]])){if(_0x9383eb[_0x989e('0x61')]&&queues[_0x9383eb['transfertargetlinkedid']]){queues[_0x9383eb[_0x989e('0x61')]]['queuecallerenterreason']=0x1;queues[_0x9383eb[_0x989e('0x5a')]]=_[_0x989e('0x59')](queues[_0x9383eb[_0x989e('0x61')]]);queues[_0x9383eb['transfertargetuniqueid']][_0x989e('0xe')]=_0x9383eb[_0x989e('0x5a')];queues[_0x9383eb[_0x989e('0x5a')]][_0x989e('0x1e')]=0x2;queues[_0x9383eb[_0x989e('0x5a')]][_0x989e('0x7')]=queues[_0x9383eb[_0x989e('0x52')]]['calleridnum'];queues[_0x9383eb[_0x989e('0x5a')]][_0x989e('0x5b')]=queues[_0x9383eb[_0x989e('0x52')]][_0x989e('0x5b')];queues[_0x9383eb['transfertargetuniqueid']][_0x989e('0x37')]=utils[_0x989e('0x12')]();queues[_0x9383eb[_0x989e('0x5a')]][_0x989e('0x15')]=utils[_0x989e('0x12')]();queues[_0x9383eb[_0x989e('0x5a')]][_0x989e('0x35')]=0x0;queues[_0x9383eb[_0x989e('0x5a')]][_0x989e('0x5c')]=0x0;utils[_0x989e('0x10')](util[_0x989e('0x2')](_0x989e('0x62'),_0x9383eb[_0x989e('0x51')],queues[_0x9383eb[_0x989e('0x5a')]][_0x989e('0x1c')],queues[_0x9383eb[_0x989e('0x5a')]][_0x989e('0xe')],queues[_0x9383eb[_0x989e('0x5a')]][_0x989e('0x7')],queues[_0x9383eb[_0x989e('0x5a')]]['calleridname']));}else{utils[_0x989e('0x10')](util[_0x989e('0x2')](_0x989e('0x5e'),_0x9383eb['origtransfereruniqueid'],queues[_0x9383eb[_0x989e('0x53')]][_0x989e('0x1c')],_0x9383eb[_0x989e('0x52')]));queues[_0x9383eb[_0x989e('0x53')]]['transfereduniqueid']=_0x9383eb['origtransfererlinkedid'];}}}}catch(_0x46b2b7){utils[_0x989e('0x1f')](util[_0x989e('0x2')]('[%s][queues][attendedtransfer]',_0x9383eb['origtransfereruniqueid']),_0x46b2b7);}};exports[_0x989e('0x63')]=function(_0x45ea54){try{if(!_[_0x989e('0x22')](queues[_0x45ea54[_0x989e('0x4')]])){utils[_0x989e('0x21')](util[_0x989e('0x2')](_0x989e('0x64'),_0x45ea54[_0x989e('0x4')]),_0x45ea54);queues[_0x45ea54[_0x989e('0x4')]][_0x989e('0x65')]=utils[_0x989e('0x12')]();utils[_0x989e('0x10')](util[_0x989e('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x45ea54[_0x989e('0x4')],queues[_0x45ea54[_0x989e('0x4')]][_0x989e('0x1c')],queues[_0x45ea54[_0x989e('0x4')]]['musiconholdstartAt']));}}catch(_0x49d8a7){utils[_0x989e('0x1f')](util[_0x989e('0x2')](_0x989e('0x64'),_0x45ea54[_0x989e('0x4')]),_0x49d8a7);}};exports[_0x989e('0x66')]=function(_0x3b1223){try{if(!_[_0x989e('0x22')](queues[_0x3b1223['uniqueid']])){if(!_[_0x989e('0x22')](queues[_0x3b1223[_0x989e('0x4')]]['musiconholdstartAt'])){utils[_0x989e('0x21')](util[_0x989e('0x2')](_0x989e('0x67'),_0x3b1223[_0x989e('0x4')]),_0x3b1223);queues[_0x3b1223[_0x989e('0x4')]]['mohtime']+=utils['diffTime'](utils[_0x989e('0x12')](),queues[_0x3b1223['uniqueid']][_0x989e('0x65')]);utils[_0x989e('0x10')](util[_0x989e('0x2')](_0x989e('0x68'),_0x3b1223[_0x989e('0x4')],queues[_0x3b1223[_0x989e('0x4')]][_0x989e('0x1c')],queues[_0x3b1223[_0x989e('0x4')]][_0x989e('0x5c')]));delete queues[_0x3b1223[_0x989e('0x4')]][_0x989e('0x65')];}}}catch(_0x3ee43a){utils[_0x989e('0x1f')](util['format'](_0x989e('0x67'),_0x3b1223['uniqueid']),_0x3ee43a);}}; \ No newline at end of file +var _0x6360=['[%s][queues][queuecallerjoin]','info','position','now','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','error','varset','[%s][queues][varset]','isNil','queuestatus','value','queuecallerabandonAt','queuecallerexit','toUpperCase','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','queuecallerexitAt','destaccountcode','membername','[%s][queues][agentcomplete]','assigned','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','transferuniqueid','transfertargetlinkedid','[%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','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug'];(function(_0x3ecf95,_0x559a2c){var _0x3f1e72=function(_0x4160c0){while(--_0x4160c0){_0x3ecf95['push'](_0x3ecf95['shift']());}};_0x3f1e72(++_0x559a2c);}(_0x6360,0x1d3));var _0x0636=function(_0x51929a,_0x30b2e7){_0x51929a=_0x51929a-0x0;var _0x4b064e=_0x6360[_0x51929a];return _0x4b064e;};'use strict';var _=require(_0x0636('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x30e3e0){utils['info'](util[_0x0636('0x1')](_0x0636('0x2'),_0x30e3e0[_0x0636('0x3')],_0x30e3e0[_0x0636('0x4')],_0x30e3e0[_0x0636('0x5')],_0x30e3e0[_0x0636('0x6')],_0x30e3e0[_0x0636('0x7')],_0x30e3e0[_0x0636('0x8')],_0x30e3e0[_0x0636('0x9')]));if(_0x30e3e0[_0x0636('0x5')]){utils[_0x0636('0xa')](_0x30e3e0[_0x0636('0x5')])[_0x0636('0xb')](function(_0x2348b7){if(_0x2348b7){_0x30e3e0[_0x0636('0xc')]=_0x2348b7[_0x0636('0xc')];}utils[_0x0636('0xd')](_0x0636('0xe'),_0x30e3e0);});}else{utils['request'](_0x0636('0xe'),_0x30e3e0);}if(_0x30e3e0[_0x0636('0xf')]){delete queues[_0x30e3e0[_0x0636('0xf')]];}else{delete queues[_0x30e3e0[_0x0636('0x3')]];}}exports[_0x0636('0x10')]=function(_0x10c580){try{utils[_0x0636('0x11')](util[_0x0636('0x1')](_0x0636('0x12'),_0x10c580[_0x0636('0x3')]),_0x10c580);utils[_0x0636('0x13')](util[_0x0636('0x1')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x10c580[_0x0636('0x3')],_0x10c580[_0x0636('0x5')],_0x10c580[_0x0636('0x14')]));queues[_0x10c580['uniqueid']]=_['assign'](_0x10c580,{'originalposition':_0x10c580[_0x0636('0x14')],'queuecallerjoinAt':utils[_0x0636('0x15')](),'mohtime':0x0});}catch(_0x51e52f){utils['error'](util['format'](_0x0636('0x12'),_0x10c580[_0x0636('0x3')]),_0x51e52f);}};exports['hangup']=function(_0x5d9781){try{if(!_['isNil'](queues[_0x5d9781[_0x0636('0x3')]])){utils[_0x0636('0x11')](util[_0x0636('0x1')](_0x0636('0x16'),_0x5d9781[_0x0636('0x3')]),_0x5d9781);if(queues[_0x5d9781[_0x0636('0x3')]][_0x0636('0x17')]){if(!queues[_0x5d9781[_0x0636('0x3')]][_0x0636('0x18')]&&!queues[_0x5d9781[_0x0636('0x3')]]['queuecallerexit']){queues[_0x5d9781[_0x0636('0x3')]][_0x0636('0x19')]=!![];queues[_0x5d9781[_0x0636('0x3')]][_0x0636('0x1a')]=utils[_0x0636('0x15')]();queues[_0x5d9781[_0x0636('0x3')]][_0x0636('0x9')]=_0x0636('0x1b');}utils[_0x0636('0x13')](util[_0x0636('0x1')](_0x0636('0x1c'),_0x5d9781['uniqueid'],queues[_0x5d9781[_0x0636('0x3')]][_0x0636('0x1d')],queues[_0x5d9781['uniqueid']][_0x0636('0x9')]));writeDB(queues[_0x5d9781['uniqueid']]);}else if(queues[_0x5d9781['uniqueid']][_0x0636('0xf')]){utils[_0x0636('0x13')](util[_0x0636('0x1')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x5d9781[_0x0636('0x3')],queues[_0x5d9781['uniqueid']][_0x0636('0x1d')],queues[_0x5d9781['uniqueid']][_0x0636('0xf')]));queues[queues[_0x5d9781[_0x0636('0x3')]]['transfereduniqueid']]=queues[_0x5d9781[_0x0636('0x3')]];queues[queues[_0x5d9781[_0x0636('0x3')]][_0x0636('0xf')]][_0x0636('0x1e')]=0x2;delete queues[_0x5d9781[_0x0636('0x3')]];}}}catch(_0x20d249){utils[_0x0636('0x1f')](util[_0x0636('0x1')]('[%s][queues][hangup]',_0x5d9781[_0x0636('0x3')]),_0x20d249);}};exports[_0x0636('0x20')]=function(_0x40e6b8){try{utils['debug'](util[_0x0636('0x1')](_0x0636('0x21'),_0x40e6b8['uniqueid']),_0x40e6b8);if(!_[_0x0636('0x22')](_0x40e6b8['variable'][_0x0636('0x23')])&&_0x40e6b8[_0x0636('0x24')]['toUpperCase']()!=='CONTINUE'){if(!_[_0x0636('0x22')](queues[_0x40e6b8[_0x0636('0x3')]])){queues[_0x40e6b8[_0x0636('0x3')]][_0x0636('0x18')]=![];queues[_0x40e6b8[_0x0636('0x3')]][_0x0636('0x25')]=null;queues[_0x40e6b8[_0x0636('0x3')]][_0x0636('0x26')]=!![];queues[_0x40e6b8[_0x0636('0x3')]]['queuecallerexitAt']=utils[_0x0636('0x15')]();queues[_0x40e6b8[_0x0636('0x3')]][_0x0636('0x9')]=_0x40e6b8[_0x0636('0x24')][_0x0636('0x27')]();utils[_0x0636('0x13')](util[_0x0636('0x1')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x40e6b8[_0x0636('0x3')],queues[_0x40e6b8[_0x0636('0x3')]][_0x0636('0x1d')],_0x40e6b8[_0x0636('0x24')],queues[_0x40e6b8[_0x0636('0x3')]][_0x0636('0x9')]));writeDB(queues[_0x40e6b8[_0x0636('0x3')]]);}}else if(!_[_0x0636('0x22')](_0x40e6b8['variable']['queueposition'])){if(!_[_0x0636('0x22')](queues[_0x40e6b8[_0x0636('0x3')]])&&!queues[_0x40e6b8['uniqueid']][_0x0636('0x18')]){queues[_0x40e6b8[_0x0636('0x3')]][_0x0636('0x18')]=![];queues[_0x40e6b8[_0x0636('0x3')]]['queuecallerabandonAt']=null;queues[_0x40e6b8[_0x0636('0x3')]][_0x0636('0x26')]=!![];queues[_0x40e6b8[_0x0636('0x3')]]['queuecallerexitAt']=utils['now']();queues[_0x40e6b8[_0x0636('0x3')]][_0x0636('0x9')]=_0x0636('0x28');utils[_0x0636('0x13')](util[_0x0636('0x1')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x40e6b8[_0x0636('0x3')],queues[_0x40e6b8[_0x0636('0x3')]][_0x0636('0x1d')],_0x40e6b8[_0x0636('0x24')],queues[_0x40e6b8['uniqueid']][_0x0636('0x9')]));}}}catch(_0x51b0b6){utils['error'](util[_0x0636('0x1')]('[%s][queues][varset]',_0x40e6b8['uniqueid']),_0x51b0b6);}};exports[_0x0636('0x18')]=function(_0x6ee936){try{if(!_[_0x0636('0x22')](queues[_0x6ee936['uniqueid']])){utils[_0x0636('0x11')](util[_0x0636('0x1')](_0x0636('0x29'),_0x6ee936[_0x0636('0x3')]),_0x6ee936);queues[_0x6ee936[_0x0636('0x3')]][_0x0636('0x26')]=![];queues[_0x6ee936[_0x0636('0x3')]]['queuecallerexitAt']=null;queues[_0x6ee936[_0x0636('0x3')]][_0x0636('0x18')]=!![];queues[_0x6ee936[_0x0636('0x3')]][_0x0636('0x25')]=utils[_0x0636('0x15')]();queues[_0x6ee936[_0x0636('0x3')]][_0x0636('0x9')]=_0x0636('0x2a');utils[_0x0636('0x13')](util[_0x0636('0x1')](_0x0636('0x2b'),_0x6ee936['uniqueid'],queues[_0x6ee936[_0x0636('0x3')]][_0x0636('0x1d')],queues[_0x6ee936[_0x0636('0x3')]][_0x0636('0x9')]));}}catch(_0x491323){utils[_0x0636('0x1f')](util['format'](_0x0636('0x29'),_0x6ee936[_0x0636('0x3')]),_0x491323);}};exports[_0x0636('0x2c')]=function(_0x342337){try{if(!_[_0x0636('0x22')](queues[_0x342337['uniqueid']])){utils[_0x0636('0x11')](util[_0x0636('0x1')](_0x0636('0x2d'),_0x342337[_0x0636('0x3')]),_0x342337);utils[_0x0636('0x13')](util['format'](_0x0636('0x2e'),_0x342337['uniqueid'],queues[_0x342337[_0x0636('0x3')]][_0x0636('0x1d')],_0x342337['connectedlinenum'],_0x342337[_0x0636('0x2f')]));queues[_0x342337[_0x0636('0x3')]][_0x0636('0x2c')]=!![];queues[_0x342337['uniqueid']][_0x0636('0x17')]=utils[_0x0636('0x15')]();queues[_0x342337[_0x0636('0x3')]][_0x0636('0x30')]=utils[_0x0636('0x31')](queues[_0x342337[_0x0636('0x3')]][_0x0636('0x17')],queues[_0x342337['uniqueid']][_0x0636('0x32')]);queues[_0x342337['uniqueid']][_0x0636('0x14')]=_0x342337[_0x0636('0x14')];queues[_0x342337[_0x0636('0x3')]][_0x0636('0x33')]=_0x342337[_0x0636('0x33')];queues[_0x342337[_0x0636('0x3')]]['connectedlinenum']=_0x342337[_0x0636('0x34')];queues[_0x342337[_0x0636('0x3')]][_0x0636('0x2f')]=_0x342337[_0x0636('0x2f')];}}catch(_0x2da38d){utils[_0x0636('0x1f')](util['format'](_0x0636('0x2d'),_0x342337[_0x0636('0x3')]),_0x2da38d);}};exports['agentconnect']=function(_0x497577){try{if(!_[_0x0636('0x22')](queues[_0x497577[_0x0636('0x3')]])){utils[_0x0636('0x11')](util['format'](_0x0636('0x35'),_0x497577[_0x0636('0x3')]),_0x497577);utils[_0x0636('0x13')](util[_0x0636('0x1')](_0x0636('0x36'),_0x497577['uniqueid'],queues[_0x497577[_0x0636('0x3')]]['name'],_0x497577['membername'],_0x497577['destaccountcode']));queues[_0x497577[_0x0636('0x3')]][_0x0636('0x18')]=![];queues[_0x497577[_0x0636('0x3')]][_0x0636('0x18')]=![];queues[_0x497577[_0x0636('0x3')]][_0x0636('0x25')]=null;queues[_0x497577[_0x0636('0x3')]]['queuecallerexit']=![];queues[_0x497577[_0x0636('0x3')]][_0x0636('0x9')]=null;queues[_0x497577[_0x0636('0x3')]][_0x0636('0x37')]=null;queues[_0x497577[_0x0636('0x3')]]['assigned']=!![];queues[_0x497577[_0x0636('0x3')]][_0x0636('0x8')]=_0x497577[_0x0636('0x38')];queues[_0x497577['uniqueid']]['lastAssignedTo']=_0x497577[_0x0636('0x39')];}}catch(_0x18fc8d){utils[_0x0636('0x1f')](util[_0x0636('0x1')](_0x0636('0x35'),_0x497577[_0x0636('0x3')]),_0x18fc8d);}};exports['agentcomplete']=function(_0x32fdac){try{if(!_[_0x0636('0x22')](queues[_0x32fdac['uniqueid']])){if(queues[_0x32fdac[_0x0636('0x3')]][_0x0636('0x17')]){utils[_0x0636('0x11')](util[_0x0636('0x1')](_0x0636('0x3a'),_0x32fdac[_0x0636('0x3')]),_0x32fdac);queues[_0x32fdac['uniqueid']][_0x0636('0x18')]=![];queues[_0x32fdac[_0x0636('0x3')]][_0x0636('0x18')]=![];queues[_0x32fdac[_0x0636('0x3')]][_0x0636('0x25')]=null;queues[_0x32fdac['uniqueid']][_0x0636('0x26')]=![];queues[_0x32fdac['uniqueid']][_0x0636('0x37')]=null;queues[_0x32fdac['uniqueid']][_0x0636('0x3b')]=!![];queues[_0x32fdac[_0x0636('0x3')]][_0x0636('0x6')]=_0x32fdac[_0x0636('0x39')];queues[_0x32fdac['uniqueid']][_0x0636('0x19')]=!![];queues[_0x32fdac[_0x0636('0x3')]]['queuecallercompleteAt']=utils[_0x0636('0x15')]();if(_0x32fdac['reason']==_0x0636('0x3c')){if(!queues[_0x32fdac[_0x0636('0x3')]][_0x0636('0x3c')]){queues[_0x32fdac[_0x0636('0x3')]][_0x0636('0x9')]=_0x0636('0x3d');}}else{queues[_0x32fdac[_0x0636('0x3')]][_0x0636('0x9')]=_0x0636('0x3e')+_0x32fdac[_0x0636('0x3f')][_0x0636('0x27')]();}utils[_0x0636('0x13')](util[_0x0636('0x1')](_0x0636('0x40'),_0x32fdac[_0x0636('0x3')],queues[_0x32fdac[_0x0636('0x3')]][_0x0636('0x1d')],_0x32fdac[_0x0636('0x39')],queues[_0x32fdac[_0x0636('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x32fdac[_0x0636('0x3')]]);}}}catch(_0x46e7eb){utils[_0x0636('0x1f')](util[_0x0636('0x1')](_0x0636('0x3a'),_0x32fdac['uniqueid']),_0x46e7eb);}};exports[_0x0636('0x41')]=function(_0x264991){try{if(!_[_0x0636('0x22')](queues[_0x264991[_0x0636('0x42')]])){utils[_0x0636('0x11')](util[_0x0636('0x1')](_0x0636('0x43'),_0x264991['uniqueid']),_0x264991);queues[_0x264991[_0x0636('0x42')]][_0x0636('0x3c')]=!![];queues[_0x264991[_0x0636('0x42')]][_0x0636('0x44')]='BLIND';queues[_0x264991[_0x0636('0x42')]][_0x0636('0x45')]=_0x264991[_0x0636('0x46')];queues[_0x264991[_0x0636('0x42')]]['transferuniqueid']=_0x264991[_0x0636('0x42')];queues[_0x264991[_0x0636('0x42')]][_0x0636('0x9')]='BLINDTRANSFER';utils['info'](util[_0x0636('0x1')](_0x0636('0x47'),_0x264991[_0x0636('0x3')],queues[_0x264991[_0x0636('0x42')]][_0x0636('0x1d')],_0x264991['transfereeuniqueid'],_0x264991[_0x0636('0x46')]));}}catch(_0x4f6e80){utils['error'](util['format'](_0x0636('0x43'),_0x264991[_0x0636('0x3')]),_0x4f6e80);}};exports['attendedtransfer']=function(_0x4bbdce){try{utils['debug'](util[_0x0636('0x1')](_0x0636('0x48'),_0x4bbdce[_0x0636('0x49')]),_0x4bbdce);if(_0x4bbdce['origtransfereruniqueid']==_0x4bbdce[_0x0636('0x4a')]){if(!_['isNil'](queues[_0x4bbdce[_0x0636('0x4b')]])){utils[_0x0636('0x13')](util[_0x0636('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4bbdce['origtransfereruniqueid'],queues[_0x4bbdce[_0x0636('0x4b')]]['name'],_0x4bbdce[_0x0636('0x4c')]));queues[_0x4bbdce[_0x0636('0x4b')]][_0x0636('0x3c')]=!![];queues[_0x4bbdce[_0x0636('0x4b')]][_0x0636('0x44')]=_0x0636('0x4d');queues[_0x4bbdce[_0x0636('0x4b')]]['transferexten']=_0x4bbdce[_0x0636('0x4c')];queues[_0x4bbdce[_0x0636('0x4b')]]['transferuniqueid']=_0x4bbdce['origtransfereruniqueid'];queues[_0x4bbdce['secondtransfererlinkedid']]['queuecallerexitreason']=_0x0636('0x4e');}if(!_[_0x0636('0x22')](queues[_0x4bbdce[_0x0636('0x4a')]])){if(_0x4bbdce[_0x0636('0x4f')]&&queues[_0x4bbdce['transfereelinkedid']]){queues[_0x4bbdce['transfereelinkedid']][_0x0636('0x1e')]=0x1;queues[_0x4bbdce[_0x0636('0x42')]]=_[_0x0636('0x50')](queues[_0x4bbdce['transfereelinkedid']]);queues[_0x4bbdce[_0x0636('0x42')]][_0x0636('0xf')]=_0x4bbdce[_0x0636('0x51')];queues[_0x4bbdce[_0x0636('0x42')]][_0x0636('0x1e')]=0x2;queues[_0x4bbdce[_0x0636('0x42')]][_0x0636('0x7')]=queues[_0x4bbdce['secondtransfererlinkedid']][_0x0636('0x7')];queues[_0x4bbdce[_0x0636('0x42')]]['calleridname']=queues[_0x4bbdce[_0x0636('0x4b')]]['calleridname'];queues[_0x4bbdce['transfereeuniqueid']][_0x0636('0x32')]=utils[_0x0636('0x15')]();queues[_0x4bbdce[_0x0636('0x42')]][_0x0636('0x17')]=utils[_0x0636('0x15')]();queues[_0x4bbdce[_0x0636('0x42')]][_0x0636('0x30')]=0x0;queues[_0x4bbdce[_0x0636('0x42')]][_0x0636('0x52')]=0x0;utils[_0x0636('0x13')](util[_0x0636('0x1')](_0x0636('0x53'),_0x4bbdce['origtransfereruniqueid'],queues[_0x4bbdce[_0x0636('0x42')]]['name'],queues[_0x4bbdce[_0x0636('0x42')]]['calleridnum'],queues[_0x4bbdce[_0x0636('0x42')]][_0x0636('0x54')]));}else{utils[_0x0636('0x13')](util[_0x0636('0x1')](_0x0636('0x55'),_0x4bbdce['origtransfereruniqueid'],queues[_0x4bbdce[_0x0636('0x4a')]][_0x0636('0x1d')],_0x4bbdce['secondtransfererlinkedid']));queues[_0x4bbdce[_0x0636('0x4a')]][_0x0636('0xf')]=_0x4bbdce[_0x0636('0x4b')];}}}else if(_0x4bbdce[_0x0636('0x56')]==_0x4bbdce['secondtransfererlinkedid']){if(!_[_0x0636('0x22')](queues[_0x4bbdce[_0x0636('0x4a')]])){utils[_0x0636('0x13')](util[_0x0636('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4bbdce[_0x0636('0x49')],queues[_0x4bbdce['origtransfererlinkedid']][_0x0636('0x1d')],_0x4bbdce[_0x0636('0x56')],_0x4bbdce['secondtransfererexten']));queues[_0x4bbdce[_0x0636('0x4a')]]['transfer']=!![];queues[_0x4bbdce[_0x0636('0x4a')]][_0x0636('0x44')]=_0x0636('0x4d');queues[_0x4bbdce[_0x0636('0x4a')]][_0x0636('0x45')]=_0x4bbdce['secondtransfererexten'];queues[_0x4bbdce['origtransfererlinkedid']][_0x0636('0x57')]=_0x4bbdce['secondtransfereruniqueid'];queues[_0x4bbdce['origtransfererlinkedid']][_0x0636('0x9')]=_0x0636('0x4e');}if(!_[_0x0636('0x22')](queues[_0x4bbdce[_0x0636('0x4b')]])){if(_0x4bbdce[_0x0636('0x58')]&&queues[_0x4bbdce[_0x0636('0x58')]]){queues[_0x4bbdce[_0x0636('0x58')]][_0x0636('0x1e')]=0x1;queues[_0x4bbdce[_0x0636('0x51')]]=_['clone'](queues[_0x4bbdce[_0x0636('0x58')]]);queues[_0x4bbdce[_0x0636('0x51')]][_0x0636('0xf')]=_0x4bbdce[_0x0636('0x51')];queues[_0x4bbdce['transfertargetuniqueid']][_0x0636('0x1e')]=0x2;queues[_0x4bbdce[_0x0636('0x51')]]['calleridnum']=queues[_0x4bbdce['origtransfererlinkedid']][_0x0636('0x7')];queues[_0x4bbdce[_0x0636('0x51')]]['calleridname']=queues[_0x4bbdce['origtransfererlinkedid']][_0x0636('0x54')];queues[_0x4bbdce['transfertargetuniqueid']][_0x0636('0x32')]=utils['now']();queues[_0x4bbdce[_0x0636('0x51')]][_0x0636('0x17')]=utils['now']();queues[_0x4bbdce[_0x0636('0x51')]][_0x0636('0x30')]=0x0;queues[_0x4bbdce[_0x0636('0x51')]]['mohtime']=0x0;utils[_0x0636('0x13')](util['format'](_0x0636('0x59'),_0x4bbdce[_0x0636('0x49')],queues[_0x4bbdce['transfertargetuniqueid']][_0x0636('0x1d')],queues[_0x4bbdce[_0x0636('0x51')]]['transfereduniqueid'],queues[_0x4bbdce[_0x0636('0x51')]][_0x0636('0x7')],queues[_0x4bbdce[_0x0636('0x51')]][_0x0636('0x54')]));}else{utils[_0x0636('0x13')](util['format'](_0x0636('0x55'),_0x4bbdce[_0x0636('0x49')],queues[_0x4bbdce['secondtransfererlinkedid']][_0x0636('0x1d')],_0x4bbdce['origtransfererlinkedid']));queues[_0x4bbdce['secondtransfererlinkedid']][_0x0636('0xf')]=_0x4bbdce[_0x0636('0x4a')];}}}}catch(_0x4389ae){utils[_0x0636('0x1f')](util['format']('[%s][queues][attendedtransfer]',_0x4bbdce[_0x0636('0x49')]),_0x4389ae);}};exports[_0x0636('0x5a')]=function(_0x312e90){try{if(!_[_0x0636('0x22')](queues[_0x312e90['uniqueid']])){utils[_0x0636('0x11')](util['format'](_0x0636('0x5b'),_0x312e90[_0x0636('0x3')]),_0x312e90);queues[_0x312e90['uniqueid']][_0x0636('0x5c')]=utils['now']();utils[_0x0636('0x13')](util[_0x0636('0x1')](_0x0636('0x5d'),_0x312e90[_0x0636('0x3')],queues[_0x312e90[_0x0636('0x3')]][_0x0636('0x1d')],queues[_0x312e90[_0x0636('0x3')]]['musiconholdstartAt']));}}catch(_0x5013da){utils[_0x0636('0x1f')](util['format'](_0x0636('0x5b'),_0x312e90[_0x0636('0x3')]),_0x5013da);}};exports[_0x0636('0x5e')]=function(_0x39cf53){try{if(!_[_0x0636('0x22')](queues[_0x39cf53[_0x0636('0x3')]])){if(!_[_0x0636('0x22')](queues[_0x39cf53['uniqueid']][_0x0636('0x5c')])){utils[_0x0636('0x11')](util[_0x0636('0x1')](_0x0636('0x5f'),_0x39cf53[_0x0636('0x3')]),_0x39cf53);queues[_0x39cf53['uniqueid']]['mohtime']+=utils['diffTime'](utils[_0x0636('0x15')](),queues[_0x39cf53[_0x0636('0x3')]][_0x0636('0x5c')]);utils[_0x0636('0x13')](util[_0x0636('0x1')](_0x0636('0x60'),_0x39cf53[_0x0636('0x3')],queues[_0x39cf53[_0x0636('0x3')]]['name'],queues[_0x39cf53[_0x0636('0x3')]][_0x0636('0x52')]));delete queues[_0x39cf53[_0x0636('0x3')]][_0x0636('0x5c')];}}}catch(_0xa8fe95){utils[_0x0636('0x1f')](util[_0x0636('0x1')](_0x0636('0x5f'),_0x39cf53[_0x0636('0x3')]),_0xa8fe95);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 4bb97a0..3538a3f 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 _0x8742=['[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereruniqueid','recording','util','./utils','./transfers.controller','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','blinds','debug','[%s][recordings][newchannel]','linkedid','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','isNil','channelstate','info','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','appdata','application','set','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]'];(function(_0x3fda08,_0x38e5b8){var _0x4916b1=function(_0x35035a){while(--_0x35035a){_0x3fda08['push'](_0x3fda08['shift']());}};_0x4916b1(++_0x38e5b8);}(_0x8742,0xdd));var _0x2874=function(_0x4c7e3b,_0x2eee73){_0x4c7e3b=_0x4c7e3b-0x0;var _0x1f6a82=_0x8742[_0x4c7e3b];return _0x1f6a82;};'use strict';var _=require('lodash');var util=require(_0x2874('0x0'));var utils=require(_0x2874('0x1'));var transfers=require(_0x2874('0x2'));var recordings={};function writeDB(_0x2d29b5){var _0x43a4b8;utils['info'](util['format'](_0x2874('0x3'),_0x2d29b5[_0x2874('0x4')]));if(transfers['blinds'][_0x2d29b5[_0x2874('0x4')]]){_0x43a4b8=_0x2d29b5[_0x2874('0x4')];_0x2d29b5[_0x2874('0x4')]=transfers['blinds'][_0x2d29b5[_0x2874('0x4')]]['transfereeuniqueid'];}if(_0x2d29b5[_0x2874('0x5')]){utils['getUserByInternal'](_0x2d29b5[_0x2874('0x5')])[_0x2874('0x6')](function(_0x3368bb){if(_0x3368bb){_0x2d29b5[_0x2874('0x7')]=_0x3368bb[_0x2874('0x8')];_0x2d29b5[_0x2874('0x9')]=_0x3368bb['id'];}utils[_0x2874('0xa')](_0x2874('0xb'),_0x2d29b5);});}else{utils[_0x2874('0xa')](_0x2874('0xb'),_0x2d29b5);}if(_0x43a4b8)delete transfers[_0x2874('0xc')][_0x43a4b8];}exports['newchannel']=function(_0x4a90f6){try{utils[_0x2874('0xd')](util['format'](_0x2874('0xe'),_0x4a90f6[_0x2874('0x4')]),_0x4a90f6);if(_0x4a90f6[_0x2874('0x4')]==_0x4a90f6[_0x2874('0xf')]){utils['info'](util[_0x2874('0x10')](_0x2874('0x11'),_0x4a90f6[_0x2874('0x4')],_0x4a90f6[_0x2874('0x12')],_0x4a90f6[_0x2874('0x13')]));recordings[_0x4a90f6[_0x2874('0x4')]]={'uniqueid':_0x4a90f6[_0x2874('0x4')],'accountcode':_0x4a90f6['accountcode'],'exten':_0x4a90f6[_0x2874('0x13')],'context':_0x4a90f6[_0x2874('0x12')],'channel':_0x4a90f6[_0x2874('0x14')],'monitors':[]};}}catch(_0x16d4d1){utils[_0x2874('0x15')](util[_0x2874('0x10')]('[%s][recordings][newchannel]',_0x4a90f6[_0x2874('0x4')]),_0x16d4d1);}};exports[_0x2874('0x16')]=function(_0x54216a){try{utils['debug'](util[_0x2874('0x10')]('[%s][recordings][newstate]',_0x54216a[_0x2874('0x4')]),_0x54216a);if(!_[_0x2874('0x17')](recordings[_0x54216a[_0x2874('0x4')]])&&_0x54216a[_0x2874('0x18')]==0x6){utils[_0x2874('0x19')](util[_0x2874('0x10')](_0x2874('0x1a'),_0x54216a[_0x2874('0x4')],_0x54216a[_0x2874('0x12')],_0x54216a[_0x2874('0x14')]));}else if(!_[_0x2874('0x17')](recordings[_0x54216a['linkedid']])&&_0x54216a[_0x2874('0x18')]==0x6&&_0x54216a['context']!='transfer'){utils['info'](util[_0x2874('0x10')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x54216a[_0x2874('0x4')],_0x54216a[_0x2874('0xf')],_0x54216a['context'],_0x54216a[_0x2874('0x14')]));recordings[_0x54216a[_0x2874('0xf')]][_0x2874('0x5')]=_0x54216a[_0x2874('0x5')];}}catch(_0x580e4e){utils[_0x2874('0x15')](util[_0x2874('0x10')](_0x2874('0x1b'),_0x54216a[_0x2874('0x4')]),_0x580e4e);}};exports[_0x2874('0x1c')]=function(_0x35bb43){try{if(!_[_0x2874('0x17')](_0x35bb43['variable'])&&!_['isNil'](_0x35bb43[_0x2874('0x1d')][_0x2874('0x1e')])){utils[_0x2874('0xd')](util['format']('[%s][recordings][varset]',_0x35bb43[_0x2874('0x4')]),_0x35bb43);utils['info'](util[_0x2874('0x10')](_0x2874('0x1f'),_0x35bb43[_0x2874('0x4')],_0x35bb43[_0x2874('0x1d')],_0x35bb43['value']));if(_[_0x2874('0x20')](_0x35bb43[_0x2874('0x21')],_0x2874('0x22'))){_0x35bb43[_0x2874('0x21')]=_0x35bb43['value']['replace'](_0x2874('0x22'),_0x2874('0x23'));}if(recordings[_0x35bb43[_0x2874('0xf')]]){var _0x41d767=_[_0x2874('0x24')](recordings[_0x35bb43[_0x2874('0xf')]][_0x2874('0x25')],{'value':_0x35bb43[_0x2874('0x21')]});if(_['isNil'](_0x41d767)){recordings[_0x35bb43[_0x2874('0xf')]][_0x2874('0x25')][_0x2874('0x26')]({'value':_0x35bb43[_0x2874('0x21')]});}}}}catch(_0xe152cb){utils[_0x2874('0x15')](util[_0x2874('0x10')](_0x2874('0x27'),_0x35bb43[_0x2874('0x4')]),_0xe152cb);}};exports[_0x2874('0x28')]=function(_0x6c10d5){try{if(!_[_0x2874('0x17')](recordings[_0x6c10d5[_0x2874('0x4')]])){utils[_0x2874('0xd')](util['format']('[%s][recordings][hangup]',_0x6c10d5['uniqueid']),_0x6c10d5);utils[_0x2874('0x19')](util[_0x2874('0x10')](_0x2874('0x29'),_0x6c10d5[_0x2874('0x4')],_0x6c10d5['calleridnum'],_0x6c10d5[_0x2874('0x2a')],_0x6c10d5[_0x2874('0x2b')]));recordings[_0x6c10d5[_0x2874('0x4')]][_0x2874('0x2c')]=_0x6c10d5[_0x2874('0x2c')];recordings[_0x6c10d5[_0x2874('0x4')]]['calleridname']=_0x6c10d5[_0x2874('0x2a')];recordings[_0x6c10d5['uniqueid']]['connectedlinenum']=_0x6c10d5[_0x2874('0x2d')];recordings[_0x6c10d5[_0x2874('0x4')]][_0x2874('0x2e')]=_0x6c10d5[_0x2874('0x2e')];if(recordings[_0x6c10d5[_0x2874('0x4')]][_0x2874('0x2f')]==_0x2874('0x30')&&recordings[_0x6c10d5['uniqueid']][_0x2874('0x5')]){recordings[_0x6c10d5[_0x2874('0x4')]]['connectedlinenum']=recordings[_0x6c10d5[_0x2874('0x4')]][_0x2874('0x5')];recordings[_0x6c10d5[_0x2874('0x4')]][_0x2874('0x2e')]='';}recordings[_0x6c10d5['uniqueid']][_0x2874('0x25')][_0x2874('0x31')](function(_0x2b2172){var _0x5afc94=_['clone'](recordings[_0x6c10d5[_0x2874('0x4')]]);_0x5afc94[_0x2874('0x21')]=_0x2b2172[_0x2874('0x21')];writeDB(_0x5afc94);});delete recordings[_0x6c10d5[_0x2874('0x4')]];}}catch(_0x47faa3){utils[_0x2874('0x15')](util[_0x2874('0x10')](_0x2874('0x32'),_0x6c10d5[_0x2874('0x4')]),_0x47faa3);}};exports[_0x2874('0x33')]=function(_0x4e2e27){try{if(!_['isNil'](recordings[_0x4e2e27[_0x2874('0x4')]])){utils[_0x2874('0xd')](util['format'](_0x2874('0x34'),_0x4e2e27[_0x2874('0x4')]),_0x4e2e27);utils[_0x2874('0x19')](util['format']('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x4e2e27[_0x2874('0x4')],_0x4e2e27['application'],_0x4e2e27[_0x2874('0x35')]));if(_0x4e2e27[_0x2874('0x36')]['toLowerCase']()==_0x2874('0x37')&&_[_0x2874('0x38')](_0x4e2e27[_0x2874('0x35')][_0x2874('0x39')](),_0x2874('0x3a'))){var _0x3169ae=_0x4e2e27[_0x2874('0x35')][_0x2874('0x3b')]('=');var _0x2e2042=_0x3169ae[0x0][_0x2874('0x3c')](_0x3169ae[0x0][_0x2874('0x3d')]('(')+0x1,_0x3169ae[0x0]['lastIndexOf'](')'));var _0x51ad73=_0x3169ae[0x1];recordings[_0x4e2e27['uniqueid']][_0x2e2042]=_0x51ad73;}}}catch(_0x4b4f8f){utils['error'](util[_0x2874('0x10')]('[%s][recordings][newexten]',_0x4e2e27[_0x2874('0x4')]),_0x4b4f8f);}};exports['queuecallerjoin']=function(_0x38e066){try{if(!_[_0x2874('0x17')](recordings[_0x38e066[_0x2874('0x4')]])){utils[_0x2874('0xd')](util['format']('[%s][recordings][queuecallerjoin]',_0x38e066[_0x2874('0x4')]),_0x38e066);utils[_0x2874('0x19')](util['format'](_0x2874('0x3e'),_0x38e066[_0x2874('0x4')],_0x38e066[_0x2874('0x3f')]));recordings[_0x38e066[_0x2874('0x4')]][_0x2874('0x3f')]=_0x38e066[_0x2874('0x3f')];}}catch(_0x3c61f8){utils[_0x2874('0x15')](util[_0x2874('0x10')](_0x2874('0x40'),_0x38e066[_0x2874('0x4')]),_0x3c61f8);}};exports[_0x2874('0x41')]=function(_0x2ab60a){try{utils[_0x2874('0xd')](util[_0x2874('0x10')](_0x2874('0x42'),_0x2ab60a[_0x2874('0x4')]),_0x2ab60a);utils[_0x2874('0x19')](util[_0x2874('0x10')](_0x2874('0x43'),_0x2ab60a[_0x2874('0x4')],_0x2ab60a[_0x2874('0x44')],_0x2ab60a[_0x2874('0x45')],_0x2ab60a['transfereecalleridnum'],_0x2ab60a['transfereecalleridname']));if(recordings[_0x2ab60a[_0x2874('0x46')]]&&transfers['blinds'][_0x2ab60a[_0x2874('0x46')]]){transfers[_0x2874('0xc')][_0x2ab60a[_0x2874('0x46')]][_0x2874('0x47')]=!![];}}catch(_0x17b3bf){utils[_0x2874('0x15')](util[_0x2874('0x10')](_0x2874('0x42'),_0x2ab60a['uniqueid']),_0x17b3bf);}}; \ No newline at end of file +var _0xbf7f=['[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','getUserByInternal','accountcode','then','membername','name','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]'];(function(_0x2edbb7,_0x15eb27){var _0x335468=function(_0x4033b7){while(--_0x4033b7){_0x2edbb7['push'](_0x2edbb7['shift']());}};_0x335468(++_0x15eb27);}(_0xbf7f,0x1ce));var _0xfbf7=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xbf7f[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xfbf7('0x0'));var util=require(_0xfbf7('0x1'));var utils=require(_0xfbf7('0x2'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x2a72bc){var _0x797f32;utils[_0xfbf7('0x3')](util[_0xfbf7('0x4')](_0xfbf7('0x5'),_0x2a72bc[_0xfbf7('0x6')]));if(transfers[_0xfbf7('0x7')][_0x2a72bc[_0xfbf7('0x6')]]){_0x797f32=_0x2a72bc['uniqueid'];_0x2a72bc[_0xfbf7('0x6')]=transfers[_0xfbf7('0x7')][_0x2a72bc[_0xfbf7('0x6')]][_0xfbf7('0x8')];}if(_0x2a72bc['accountcode']){utils[_0xfbf7('0x9')](_0x2a72bc[_0xfbf7('0xa')])[_0xfbf7('0xb')](function(_0x5dfb96){if(_0x5dfb96){_0x2a72bc[_0xfbf7('0xc')]=_0x5dfb96[_0xfbf7('0xd')];_0x2a72bc[_0xfbf7('0xe')]=_0x5dfb96['id'];}utils['request'](_0xfbf7('0xf'),_0x2a72bc);});}else{utils[_0xfbf7('0x10')](_0xfbf7('0xf'),_0x2a72bc);}if(_0x797f32)delete transfers['blinds'][_0x797f32];}exports[_0xfbf7('0x11')]=function(_0x3f6b74){try{utils[_0xfbf7('0x12')](util[_0xfbf7('0x4')](_0xfbf7('0x13'),_0x3f6b74[_0xfbf7('0x6')]),_0x3f6b74);if(_0x3f6b74[_0xfbf7('0x6')]==_0x3f6b74['linkedid']){utils[_0xfbf7('0x3')](util['format'](_0xfbf7('0x14'),_0x3f6b74['uniqueid'],_0x3f6b74[_0xfbf7('0x15')],_0x3f6b74['exten']));recordings[_0x3f6b74[_0xfbf7('0x6')]]={'uniqueid':_0x3f6b74[_0xfbf7('0x6')],'accountcode':_0x3f6b74[_0xfbf7('0xa')],'exten':_0x3f6b74[_0xfbf7('0x16')],'context':_0x3f6b74[_0xfbf7('0x15')],'channel':_0x3f6b74[_0xfbf7('0x17')],'monitors':[]};}}catch(_0x22abd1){utils[_0xfbf7('0x18')](util[_0xfbf7('0x4')](_0xfbf7('0x13'),_0x3f6b74[_0xfbf7('0x6')]),_0x22abd1);}};exports[_0xfbf7('0x19')]=function(_0x3bdcb5){try{utils['debug'](util['format'](_0xfbf7('0x1a'),_0x3bdcb5[_0xfbf7('0x6')]),_0x3bdcb5);if(!_[_0xfbf7('0x1b')](recordings[_0x3bdcb5['uniqueid']])&&_0x3bdcb5[_0xfbf7('0x1c')]==0x6){utils[_0xfbf7('0x3')](util['format'](_0xfbf7('0x1d'),_0x3bdcb5[_0xfbf7('0x6')],_0x3bdcb5[_0xfbf7('0x15')],_0x3bdcb5[_0xfbf7('0x17')]));}else if(!_[_0xfbf7('0x1b')](recordings[_0x3bdcb5[_0xfbf7('0x1e')]])&&_0x3bdcb5[_0xfbf7('0x1c')]==0x6&&_0x3bdcb5[_0xfbf7('0x15')]!=_0xfbf7('0x1f')){utils[_0xfbf7('0x3')](util[_0xfbf7('0x4')](_0xfbf7('0x20'),_0x3bdcb5[_0xfbf7('0x6')],_0x3bdcb5['linkedid'],_0x3bdcb5['context'],_0x3bdcb5['channel']));recordings[_0x3bdcb5[_0xfbf7('0x1e')]][_0xfbf7('0xa')]=_0x3bdcb5[_0xfbf7('0xa')];}}catch(_0x4b586d){utils[_0xfbf7('0x18')](util[_0xfbf7('0x4')](_0xfbf7('0x1a'),_0x3bdcb5[_0xfbf7('0x6')]),_0x4b586d);}};exports['varset']=function(_0x666cd9){try{if(!_[_0xfbf7('0x1b')](_0x666cd9[_0xfbf7('0x21')])&&!_[_0xfbf7('0x1b')](_0x666cd9['variable']['mixmonitor_filename'])){utils[_0xfbf7('0x12')](util[_0xfbf7('0x4')](_0xfbf7('0x22'),_0x666cd9[_0xfbf7('0x6')]),_0x666cd9);utils[_0xfbf7('0x3')](util['format'](_0xfbf7('0x23'),_0x666cd9['uniqueid'],_0x666cd9['variable'],_0x666cd9[_0xfbf7('0x24')]));if(_[_0xfbf7('0x25')](_0x666cd9['value'],'.wav49')){_0x666cd9[_0xfbf7('0x24')]=_0x666cd9[_0xfbf7('0x24')][_0xfbf7('0x26')](_0xfbf7('0x27'),'.WAV');}if(recordings[_0x666cd9[_0xfbf7('0x1e')]]){var _0x22de65=_['find'](recordings[_0x666cd9[_0xfbf7('0x1e')]][_0xfbf7('0x28')],{'value':_0x666cd9[_0xfbf7('0x24')]});if(_['isNil'](_0x22de65)){recordings[_0x666cd9[_0xfbf7('0x1e')]]['monitors'][_0xfbf7('0x29')]({'value':_0x666cd9[_0xfbf7('0x24')]});}}}}catch(_0x2bcca9){utils['error'](util[_0xfbf7('0x4')](_0xfbf7('0x22'),_0x666cd9[_0xfbf7('0x6')]),_0x2bcca9);}};exports[_0xfbf7('0x2a')]=function(_0x201b89){try{if(!_[_0xfbf7('0x1b')](recordings[_0x201b89[_0xfbf7('0x6')]])){utils[_0xfbf7('0x12')](util['format'](_0xfbf7('0x2b'),_0x201b89[_0xfbf7('0x6')]),_0x201b89);utils[_0xfbf7('0x3')](util[_0xfbf7('0x4')](_0xfbf7('0x2c'),_0x201b89[_0xfbf7('0x6')],_0x201b89[_0xfbf7('0x2d')],_0x201b89[_0xfbf7('0x2e')],_0x201b89['cause-txt']));recordings[_0x201b89[_0xfbf7('0x6')]][_0xfbf7('0x2d')]=_0x201b89[_0xfbf7('0x2d')];recordings[_0x201b89[_0xfbf7('0x6')]][_0xfbf7('0x2e')]=_0x201b89['calleridname'];recordings[_0x201b89[_0xfbf7('0x6')]]['connectedlinenum']=_0x201b89[_0xfbf7('0x2f')];recordings[_0x201b89[_0xfbf7('0x6')]][_0xfbf7('0x30')]=_0x201b89[_0xfbf7('0x30')];if(recordings[_0x201b89[_0xfbf7('0x6')]][_0xfbf7('0x31')]==_0xfbf7('0x32')&&recordings[_0x201b89[_0xfbf7('0x6')]][_0xfbf7('0xa')]){recordings[_0x201b89[_0xfbf7('0x6')]]['connectedlinenum']=recordings[_0x201b89[_0xfbf7('0x6')]][_0xfbf7('0xa')];recordings[_0x201b89[_0xfbf7('0x6')]][_0xfbf7('0x30')]='';}recordings[_0x201b89[_0xfbf7('0x6')]][_0xfbf7('0x28')]['forEach'](function(_0xa90167){var _0x463573=_[_0xfbf7('0x33')](recordings[_0x201b89[_0xfbf7('0x6')]]);_0x463573[_0xfbf7('0x24')]=_0xa90167[_0xfbf7('0x24')];writeDB(_0x463573);});delete recordings[_0x201b89[_0xfbf7('0x6')]];}}catch(_0x1da1c4){utils[_0xfbf7('0x18')](util['format'](_0xfbf7('0x2b'),_0x201b89['uniqueid']),_0x1da1c4);}};exports[_0xfbf7('0x34')]=function(_0x30dd10){try{if(!_[_0xfbf7('0x1b')](recordings[_0x30dd10[_0xfbf7('0x6')]])){utils[_0xfbf7('0x12')](util[_0xfbf7('0x4')](_0xfbf7('0x35'),_0x30dd10[_0xfbf7('0x6')]),_0x30dd10);utils['info'](util[_0xfbf7('0x4')](_0xfbf7('0x36'),_0x30dd10[_0xfbf7('0x6')],_0x30dd10[_0xfbf7('0x37')],_0x30dd10[_0xfbf7('0x38')]));if(_0x30dd10['application'][_0xfbf7('0x39')]()==_0xfbf7('0x3a')&&_[_0xfbf7('0x3b')](_0x30dd10[_0xfbf7('0x38')][_0xfbf7('0x39')](),_0xfbf7('0x3c'))){var _0x221454=_0x30dd10[_0xfbf7('0x38')][_0xfbf7('0x3d')]('=');var _0x3eb688=_0x221454[0x0]['substring'](_0x221454[0x0][_0xfbf7('0x3e')]('(')+0x1,_0x221454[0x0][_0xfbf7('0x3e')](')'));var _0x335bf9=_0x221454[0x1];recordings[_0x30dd10[_0xfbf7('0x6')]][_0x3eb688]=_0x335bf9;}}}catch(_0x3c3715){utils[_0xfbf7('0x18')](util['format'](_0xfbf7('0x35'),_0x30dd10[_0xfbf7('0x6')]),_0x3c3715);}};exports['queuecallerjoin']=function(_0x33ff46){try{if(!_[_0xfbf7('0x1b')](recordings[_0x33ff46[_0xfbf7('0x6')]])){utils[_0xfbf7('0x12')](util[_0xfbf7('0x4')]('[%s][recordings][queuecallerjoin]',_0x33ff46[_0xfbf7('0x6')]),_0x33ff46);utils[_0xfbf7('0x3')](util[_0xfbf7('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x33ff46[_0xfbf7('0x6')],_0x33ff46[_0xfbf7('0x3f')]));recordings[_0x33ff46[_0xfbf7('0x6')]][_0xfbf7('0x3f')]=_0x33ff46[_0xfbf7('0x3f')];}}catch(_0x5c220d){utils[_0xfbf7('0x18')](util[_0xfbf7('0x4')](_0xfbf7('0x40'),_0x33ff46[_0xfbf7('0x6')]),_0x5c220d);}};exports[_0xfbf7('0x41')]=function(_0xe1eefe){try{utils[_0xfbf7('0x12')](util[_0xfbf7('0x4')](_0xfbf7('0x42'),_0xe1eefe[_0xfbf7('0x6')]),_0xe1eefe);utils['info'](util[_0xfbf7('0x4')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xe1eefe[_0xfbf7('0x6')],_0xe1eefe['transferercalleridnum'],_0xe1eefe[_0xfbf7('0x43')],_0xe1eefe[_0xfbf7('0x44')],_0xe1eefe[_0xfbf7('0x45')]));if(recordings[_0xe1eefe[_0xfbf7('0x46')]]&&transfers[_0xfbf7('0x7')][_0xe1eefe[_0xfbf7('0x46')]]){transfers[_0xfbf7('0x7')][_0xe1eefe[_0xfbf7('0x46')]]['recording']=!![];}}catch(_0x128ce0){utils[_0xfbf7('0x18')](util['format']('[%s][recordings][blindtransfer]',_0xe1eefe[_0xfbf7('0x6')]),_0x128ce0);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 3d2ab42..83e6c58 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 _0x95c6=['format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','type','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','util'];(function(_0x3e4a43,_0x3890b6){var _0x3b335f=function(_0xaa66cc){while(--_0xaa66cc){_0x3e4a43['push'](_0x3e4a43['shift']());}};_0x3b335f(++_0x3890b6);}(_0x95c6,0x9f));var _0x695c=function(_0x340d1f,_0xc33126){_0x340d1f=_0x340d1f-0x0;var _0x2b2199=_0x95c6[_0x340d1f];return _0x2b2199;};'use strict';var _=require('lodash');var util=require(_0x695c('0x0'));var utils=require('./utils');function writeDB(_0xcd59a8){utils['info'](util[_0x695c('0x1')](_0x695c('0x2'),_0xcd59a8['type']===_0x695c('0x3')?_0xcd59a8[_0x695c('0x4')]:_0xcd59a8[_0x695c('0x5')],_0xcd59a8[_0x695c('0x6')]));utils['request'](_0x695c('0x7'),_0xcd59a8);}exports[_0x695c('0x8')]={};exports[_0x695c('0x9')]=function(_0x2403fc){try{utils[_0x695c('0xa')](util[_0x695c('0x1')](_0x695c('0xb'),_0x2403fc[_0x695c('0x5')]),_0x2403fc);utils[_0x695c('0xc')](util[_0x695c('0x1')](_0x695c('0xd'),_0x2403fc['uniqueid'],_0x2403fc[_0x695c('0xe')],_0x2403fc[_0x695c('0xf')],_0x2403fc['transfereecalleridnum'],_0x2403fc[_0x695c('0x10')]));_0x2403fc['type']=_0x695c('0x11');exports[_0x695c('0x8')][_0x2403fc[_0x695c('0x12')]]=_0x2403fc;writeDB(_0x2403fc);}catch(_0x3e363c){utils[_0x695c('0x13')](util[_0x695c('0x1')]('[%s][transfers][blindtransfer]',_0x2403fc[_0x695c('0x5')]),_0x3e363c);}};exports[_0x695c('0x14')]=function(_0x448429){try{utils[_0x695c('0xa')](util[_0x695c('0x1')](_0x695c('0x15'),_0x448429[_0x695c('0x4')]),_0x448429);utils[_0x695c('0xc')](util[_0x695c('0x1')](_0x695c('0x16'),_0x448429['origtransfereruniqueid'],_0x448429[_0x695c('0x17')],_0x448429[_0x695c('0x18')],_0x448429[_0x695c('0x19')],_0x448429[_0x695c('0x1a')]));_0x448429=_[_0x695c('0x1b')](_0x448429,{'transfererchannel':_0x448429[_0x695c('0x1c')],'transferercalleridnum':_0x448429[_0x695c('0x17')],'transferercalleridname':_0x448429[_0x695c('0x18')],'transfererconnectedlinenum':_0x448429[_0x695c('0x1d')],'transfererconnectedlinename':_0x448429['secondtransfererconnectedlinename'],'transfereraccountcode':_0x448429[_0x695c('0x1e')],'transferercontext':_0x448429[_0x695c('0x1f')],'transfererexten':_0x448429[_0x695c('0x20')],'transfererlinkedid':_0x448429['origtransfererlinkedid'],'context':_0x448429['origtransferercontext'],'extension':_0x448429[_0x695c('0x21')],'type':_0x695c('0x3')});if(_['isNil'](_0x448429[_0x695c('0x22')])){_0x448429=_['assign'](_0x448429,{'transfereechannel':_0x448429[_0x695c('0x23')],'transfereecalleridnum':_0x448429[_0x695c('0x19')],'transfereecalleridname':_0x448429[_0x695c('0x1a')],'transfereeconnectedlinenum':_0x448429[_0x695c('0x24')],'transfereeconnectedlinename':_0x448429[_0x695c('0x25')],'transfereeaccountcode':_0x448429['transfertargetaccountcode'],'transfereecontext':_0x448429[_0x695c('0x26')],'transfereeexten':_0x448429[_0x695c('0x27')],'transfereelinkedid':_0x448429['transfertargetlinkedid']});}writeDB(_0x448429);}catch(_0x345537){utils['error'](util[_0x695c('0x1')](_0x695c('0x15'),_0x448429[_0x695c('0x4')]),_0x345537);}}; \ No newline at end of file +var _0x18ce=['isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','info','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x18ce,0xb6));var _0xe18c=function(_0x489700,_0x1ea4c8){_0x489700=_0x489700-0x0;var _0xd84800=_0x18ce[_0x489700];return _0xd84800;};'use strict';var _=require(_0xe18c('0x0'));var util=require(_0xe18c('0x1'));var utils=require(_0xe18c('0x2'));function writeDB(_0x185bcc){utils['info'](util[_0xe18c('0x3')](_0xe18c('0x4'),_0x185bcc['type']===_0xe18c('0x5')?_0x185bcc['origtransfereruniqueid']:_0x185bcc[_0xe18c('0x6')],_0x185bcc['type']));utils[_0xe18c('0x7')](_0xe18c('0x8'),_0x185bcc);}exports[_0xe18c('0x9')]={};exports[_0xe18c('0xa')]=function(_0x28df08){try{utils['debug'](util[_0xe18c('0x3')](_0xe18c('0xb'),_0x28df08['uniqueid']),_0x28df08);utils[_0xe18c('0xc')](util[_0xe18c('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x28df08[_0xe18c('0x6')],_0x28df08[_0xe18c('0xd')],_0x28df08[_0xe18c('0xe')],_0x28df08[_0xe18c('0xf')],_0x28df08[_0xe18c('0x10')]));_0x28df08['type']=_0xe18c('0x11');exports[_0xe18c('0x9')][_0x28df08[_0xe18c('0x12')]]=_0x28df08;writeDB(_0x28df08);}catch(_0x51b724){utils[_0xe18c('0x13')](util[_0xe18c('0x3')](_0xe18c('0xb'),_0x28df08[_0xe18c('0x6')]),_0x51b724);}};exports[_0xe18c('0x14')]=function(_0x883643){try{utils['debug'](util[_0xe18c('0x3')]('[%s][transfers][attendedtransfer]',_0x883643[_0xe18c('0x15')]),_0x883643);utils[_0xe18c('0xc')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x883643[_0xe18c('0x15')],_0x883643[_0xe18c('0x16')],_0x883643[_0xe18c('0x17')],_0x883643[_0xe18c('0x18')],_0x883643[_0xe18c('0x19')]));_0x883643=_[_0xe18c('0x1a')](_0x883643,{'transfererchannel':_0x883643['origtransfererchannel'],'transferercalleridnum':_0x883643[_0xe18c('0x16')],'transferercalleridname':_0x883643[_0xe18c('0x17')],'transfererconnectedlinenum':_0x883643['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x883643[_0xe18c('0x1b')],'transfereraccountcode':_0x883643[_0xe18c('0x1c')],'transferercontext':_0x883643['secondtransferercontext'],'transfererexten':_0x883643[_0xe18c('0x1d')],'transfererlinkedid':_0x883643[_0xe18c('0x1e')],'context':_0x883643[_0xe18c('0x1f')],'extension':_0x883643[_0xe18c('0x20')],'type':'attended'});if(_[_0xe18c('0x21')](_0x883643[_0xe18c('0x22')])){_0x883643=_[_0xe18c('0x1a')](_0x883643,{'transfereechannel':_0x883643[_0xe18c('0x23')],'transfereecalleridnum':_0x883643['transfertargetcalleridnum'],'transfereecalleridname':_0x883643[_0xe18c('0x19')],'transfereeconnectedlinenum':_0x883643[_0xe18c('0x24')],'transfereeconnectedlinename':_0x883643[_0xe18c('0x25')],'transfereeaccountcode':_0x883643[_0xe18c('0x26')],'transfereecontext':_0x883643[_0xe18c('0x27')],'transfereeexten':_0x883643[_0xe18c('0x28')],'transfereelinkedid':_0x883643[_0xe18c('0x29')]});}writeDB(_0x883643);}catch(_0x262744){utils[_0xe18c('0x13')](util[_0xe18c('0x3')](_0xe18c('0x2a'),_0x883643[_0xe18c('0x15')]),_0x262744);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 701eeb2..ec9adc9 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 _0x6033=['../../config/logger','info','inspect','debug','error','then','[utils][request]\x20name:%s','request','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','catch','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','isAfter','isBefore','jayson/promise','util','client'];(function(_0x1cd88e,_0x2b4d6a){var _0x510769=function(_0x3f9468){while(--_0x3f9468){_0x1cd88e['push'](_0x1cd88e['shift']());}};_0x510769(++_0x2b4d6a);}(_0x6033,0x177));var _0x3603=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6033[_0x502c7d];return _0x30b7ed;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x3603('0x0'));var moment=require('moment');var util=require(_0x3603('0x1'));var client=jayson[_0x3603('0x2')]['http']({'port':0x2329});var logger=require(_0x3603('0x3'))('xdr');exports[_0x3603('0x4')]=function(_0x3356fe,_0x3421e2){logger[_0x3603('0x4')](_0x3356fe,_0x3421e2?util[_0x3603('0x5')](_0x3421e2,{'showHidden':![],'depth':null}):'');};exports[_0x3603('0x6')]=function(_0x499eac,_0x166b62){logger[_0x3603('0x6')](_0x499eac,_0x166b62?util[_0x3603('0x5')](_0x166b62,{'showHidden':![],'depth':null}):'');};exports[_0x3603('0x7')]=function(_0x2a97a2,_0x32c0d5){logger[_0x3603('0x7')](_0x2a97a2,_0x32c0d5?util[_0x3603('0x5')](_0x32c0d5,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x29edec,_0x469c8e){return client['request'](_0x29edec,{'body':_0x469c8e})[_0x3603('0x8')](function(_0x34897e){logger[_0x3603('0x6')](_0x3603('0x9'),_0x29edec,_0x34897e?util[_0x3603('0x5')](_0x34897e,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x411ae5){logger[_0x3603('0x7')](_0x3603('0x9'),_0x29edec,_0x411ae5?util[_0x3603('0x5')](_0x411ae5,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3d8afc){return client[_0x3603('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x3603('0xb'),_0x3603('0xc'),_0x3603('0xd')],'where':_0x3d8afc,'limit':0x1}})[_0x3603('0x8')](function(_0x2eaefc){logger['debug'](_0x3603('0xe'),JSON[_0x3603('0xf')](_0x3d8afc),_0x2eaefc?util[_0x3603('0x5')](_0x2eaefc,{'showHidden':![],'depth':null}):'');return _0x2eaefc[_0x3603('0x10')][_0x3603('0x11')]?_0x2eaefc['result'][0x0]:null;});}exports[_0x3603('0x12')]=function(_0xe97f4a){return new BPromise(function(_0x558e23,_0x2fd380){if(_0xe97f4a){return getUser({'internal':_0xe97f4a})[_0x3603('0x8')](function(_0x75fd45){logger[_0x3603('0x4')](_0x3603('0x13'),_0xe97f4a,_0x75fd45?'found':_0x3603('0x14'));return _0x558e23(_0x75fd45);})[_0x3603('0x15')](function(_0x1ba8f4){logger[_0x3603('0x7')](_0x3603('0x16'),_0x1ba8f4?util[_0x3603('0x5')](_0x1ba8f4,{'showHidden':![],'depth':null}):'');return _0x558e23(null);});}return _0x558e23(null);});};exports['getUserByInterface']=function(_0x79c45a){return new BPromise(function(_0x272317,_0xba772d){if(_0x79c45a){return getUser({'interface':_0x79c45a})[_0x3603('0x8')](function(_0x38494e){logger['info'](_0x3603('0x17'),_0x79c45a,_0x38494e?_0x3603('0x18'):_0x3603('0x14'));return _0x272317(_0x38494e);})[_0x3603('0x15')](function(_0x210285){logger[_0x3603('0x7')](_0x3603('0x19'),_0x210285?util[_0x3603('0x5')](_0x210285,{'showHidden':![],'depth':null}):'');return _0x272317(null);});}return _0x272317(null);});};exports['getUserByName']=function(_0x577161){return new BPromise(function(_0x978f67,_0x537647){if(_0x577161){return getUser({'name':_0x577161})['then'](function(_0x505d66){logger['info'](_0x3603('0x1a'),_0x577161,_0x505d66?_0x3603('0x18'):_0x3603('0x14'));return _0x978f67(_0x505d66);})['catch'](function(_0x45dafa){logger[_0x3603('0x7')](_0x3603('0x1b'),_0x45dafa?util[_0x3603('0x5')](_0x45dafa,{'showHidden':![],'depth':null}):'');return _0x978f67(null);});}return _0x978f67(null);});};exports[_0x3603('0x1c')]=function(_0x17f62d){return new BPromise(function(_0x3138ad,_0x1fdb83){if(_0x17f62d){return client[_0x3603('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name','type','acw','acwTimeout'],'where':{'name':_0x17f62d},'limit':0x1}})[_0x3603('0x8')](function(_0x42b2f6){logger[_0x3603('0x6')](_0x3603('0x1d'),_0x17f62d,_0x42b2f6?util['inspect'](_0x42b2f6,{'showHidden':![],'depth':null}):'');logger[_0x3603('0x4')](_0x3603('0x1e'),_0x17f62d,_0x42b2f6?'found':_0x3603('0x14'));return _0x3138ad(_0x42b2f6[_0x3603('0x10')][_0x3603('0x11')]?_0x42b2f6[_0x3603('0x10')][0x0]:null);})[_0x3603('0x15')](function(_0x19487e){logger['error'](_0x3603('0x1f'),_0x19487e?util[_0x3603('0x5')](_0x19487e,{'showHidden':![],'depth':null}):'');return _0x3138ad(null);});}return _0x3138ad(null);});};exports[_0x3603('0x20')]=function(_0x13f8dd,_0x3e5b5b){return moment(_0x13f8dd)[_0x3603('0x21')](_0x3e5b5b,_0x3603('0x22'))[_0x3603('0x23')](_0x3603('0x24'));};exports['subtractTime']=function(_0x31eea4,_0x1348eb){return moment(_0x31eea4)['subtract'](_0x1348eb,'seconds')[_0x3603('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x3603('0x25')]=function(_0x3c9112,_0x12cfc1){return moment(_0x3c9112)[_0x3603('0x26')](moment(_0x12cfc1),'seconds');};exports[_0x3603('0x27')]=function(_0x28d88c,_0x2bbc01){return parseInt(_0x28d88c,0xa)+parseInt(_0x2bbc01,0xa);};exports['now']=function(){return moment()[_0x3603('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x48222f,_0x59181f){if(_0x59181f){return moment(_0x48222f)[_0x3603('0x28')](_0x59181f);}return!![];};exports['isBefore']=function(_0x2dd0ab,_0x4a24e6){if(_0x4a24e6){return moment(_0x2dd0ab)[_0x3603('0x29')](_0x4a24e6);}else if(_0x2dd0ab){return!![];}return![];}; \ No newline at end of file +var _0x017e=['debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','isAfter','isBefore','bluebird','moment','client','http','../../config/logger','xdr','info','inspect'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x017e,0x10c));var _0xe017=function(_0x42c903,_0x5c81bc){_0x42c903=_0x42c903-0x0;var _0xcfd717=_0x017e[_0x42c903];return _0xcfd717;};'use strict';var BPromise=require(_0xe017('0x0'));var jayson=require('jayson/promise');var moment=require(_0xe017('0x1'));var util=require('util');var client=jayson[_0xe017('0x2')][_0xe017('0x3')]({'port':0x2329});var logger=require(_0xe017('0x4'))(_0xe017('0x5'));exports[_0xe017('0x6')]=function(_0x578220,_0xcabd23){logger['info'](_0x578220,_0xcabd23?util[_0xe017('0x7')](_0xcabd23,{'showHidden':![],'depth':null}):'');};exports[_0xe017('0x8')]=function(_0x43217c,_0x2ca04c){logger['debug'](_0x43217c,_0x2ca04c?util[_0xe017('0x7')](_0x2ca04c,{'showHidden':![],'depth':null}):'');};exports[_0xe017('0x9')]=function(_0xada3f9,_0x43fd80){logger[_0xe017('0x9')](_0xada3f9,_0x43fd80?util[_0xe017('0x7')](_0x43fd80,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0xab9130,_0x2b39fe){return client[_0xe017('0xa')](_0xab9130,{'body':_0x2b39fe})[_0xe017('0xb')](function(_0x884ba7){logger['debug'](_0xe017('0xc'),_0xab9130,_0x884ba7?util[_0xe017('0x7')](_0x884ba7,{'showHidden':![],'depth':null}):'');})[_0xe017('0xd')](function(_0x45de1e){logger[_0xe017('0x9')]('[utils][request]\x20name:%s',_0xab9130,_0x45de1e?util[_0xe017('0x7')](_0x45de1e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x403474){return client[_0xe017('0xa')](_0xe017('0xe'),{'options':{'raw':!![],'attributes':['id',_0xe017('0xf'),_0xe017('0x10'),_0xe017('0x11')],'where':_0x403474,'limit':0x1}})[_0xe017('0xb')](function(_0x2d2a0d){logger[_0xe017('0x8')](_0xe017('0x12'),JSON['stringify'](_0x403474),_0x2d2a0d?util['inspect'](_0x2d2a0d,{'showHidden':![],'depth':null}):'');return _0x2d2a0d[_0xe017('0x13')]['length']?_0x2d2a0d[_0xe017('0x13')][0x0]:null;});}exports['getUserByInternal']=function(_0x3ca603){return new BPromise(function(_0x3d7859,_0x10a54f){if(_0x3ca603){return getUser({'internal':_0x3ca603})[_0xe017('0xb')](function(_0x3aa40b){logger['info'](_0xe017('0x14'),_0x3ca603,_0x3aa40b?_0xe017('0x15'):_0xe017('0x16'));return _0x3d7859(_0x3aa40b);})[_0xe017('0xd')](function(_0x5f598a){logger[_0xe017('0x9')](_0xe017('0x17'),_0x5f598a?util[_0xe017('0x7')](_0x5f598a,{'showHidden':![],'depth':null}):'');return _0x3d7859(null);});}return _0x3d7859(null);});};exports[_0xe017('0x18')]=function(_0x114c87){return new BPromise(function(_0x3335c6,_0x5a45e3){if(_0x114c87){return getUser({'interface':_0x114c87})[_0xe017('0xb')](function(_0x1026eb){logger[_0xe017('0x6')](_0xe017('0x19'),_0x114c87,_0x1026eb?'found':_0xe017('0x16'));return _0x3335c6(_0x1026eb);})['catch'](function(_0x19599a){logger[_0xe017('0x9')]('[utils][getUserByInterface]',_0x19599a?util[_0xe017('0x7')](_0x19599a,{'showHidden':![],'depth':null}):'');return _0x3335c6(null);});}return _0x3335c6(null);});};exports[_0xe017('0x1a')]=function(_0x485d19){return new BPromise(function(_0x4dcb34,_0x114049){if(_0x485d19){return getUser({'name':_0x485d19})[_0xe017('0xb')](function(_0x24d839){logger['info'](_0xe017('0x1b'),_0x485d19,_0x24d839?_0xe017('0x15'):_0xe017('0x16'));return _0x4dcb34(_0x24d839);})[_0xe017('0xd')](function(_0x2c66d6){logger[_0xe017('0x9')](_0xe017('0x1c'),_0x2c66d6?util['inspect'](_0x2c66d6,{'showHidden':![],'depth':null}):'');return _0x4dcb34(null);});}return _0x4dcb34(null);});};exports[_0xe017('0x1d')]=function(_0x3857de){return new BPromise(function(_0x37527e,_0x13b9e7){if(_0x3857de){return client[_0xe017('0xa')](_0xe017('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xe017('0x10'),_0xe017('0x1f'),_0xe017('0x20'),_0xe017('0x21')],'where':{'name':_0x3857de},'limit':0x1}})[_0xe017('0xb')](function(_0x2ffd1c){logger['debug'](_0xe017('0x22'),_0x3857de,_0x2ffd1c?util[_0xe017('0x7')](_0x2ffd1c,{'showHidden':![],'depth':null}):'');logger[_0xe017('0x6')](_0xe017('0x23'),_0x3857de,_0x2ffd1c?_0xe017('0x15'):_0xe017('0x16'));return _0x37527e(_0x2ffd1c['result']['length']?_0x2ffd1c['result'][0x0]:null);})[_0xe017('0xd')](function(_0x21a4ab){logger[_0xe017('0x9')]('[utils][getVoiceQueueByName]',_0x21a4ab?util[_0xe017('0x7')](_0x21a4ab,{'showHidden':![],'depth':null}):'');return _0x37527e(null);});}return _0x37527e(null);});};exports['addTime']=function(_0x90cbd4,_0x48af24){return moment(_0x90cbd4)['add'](_0x48af24,_0xe017('0x24'))[_0xe017('0x25')](_0xe017('0x26'));};exports[_0xe017('0x27')]=function(_0x5bfa1f,_0x2baf1c){return moment(_0x5bfa1f)[_0xe017('0x28')](_0x2baf1c,'seconds')['format'](_0xe017('0x26'));};exports[_0xe017('0x29')]=function(_0x321d09,_0x4dd17f){return moment(_0x321d09)[_0xe017('0x2a')](moment(_0x4dd17f),_0xe017('0x24'));};exports[_0xe017('0x2b')]=function(_0x11bd32,_0x13fa4f){return parseInt(_0x11bd32,0xa)+parseInt(_0x13fa4f,0xa);};exports['now']=function(){return moment()['format'](_0xe017('0x26'));};exports[_0xe017('0x2c')]=function(_0x353d3e,_0x49f4d8){if(_0x49f4d8){return moment(_0x353d3e)['isAfter'](_0x49f4d8);}return!![];};exports['isBefore']=function(_0x2488ea,_0x5628c4){if(_0x5628c4){return moment(_0x2488ea)[_0xe017('0x2d')](_0x5628c4);}else if(_0x2488ea){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 72279c1..e9df831 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9dc=['timestamp','catch','error','set','client-side-logger','use','logger','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','responseTime','other','agent_name','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','maskSensitiveData','join','log','xcally','client','role','ensureDir','then','user','data'];(function(_0x7a319d,_0x235959){var _0x5c6b4e=function(_0x2e5b17){while(--_0x2e5b17){_0x7a319d['push'](_0x7a319d['shift']());}};_0x5c6b4e(++_0x235959);}(_0xd9dc,0x1f2));var _0xcd9d=function(_0x4d3187,_0x267c51){_0x4d3187=_0x4d3187-0x0;var _0x107906=_0xd9dc[_0x4d3187];return _0x107906;};var fs=require(_0xcd9d('0x0'));var _=require(_0xcd9d('0x1'));var ewinston=require(_0xcd9d('0x2'));var path=require(_0xcd9d('0x3'));var util=require(_0xcd9d('0x4'));var fileLogger=require(_0xcd9d('0x5'))[_0xcd9d('0x6')];var safeTemplate=require(_0xcd9d('0x7'))[_0xcd9d('0x8')];var maskSensitiveData=require('./mask-sensitive-data')[_0xcd9d('0x9')];function ClientSideLogger(){function _0x368e29(_0x1f6c67){var _0x284873=path[_0xcd9d('0xa')]('/var',_0xcd9d('0xb'),_0xcd9d('0xc'));var _0x3b1d1a=path[_0xcd9d('0xa')](_0xcd9d('0xd'),_0x1f6c67[_0xcd9d('0xe')]+'-'+_0x1f6c67['name']);return fs[_0xcd9d('0xf')](path['join'](_0x284873,_0x3b1d1a))[_0xcd9d('0x10')](function(){var _0x123376=fileLogger('client',path[_0xcd9d('0xa')](_0x284873,_0x3b1d1a));return _0x123376;})['catch'](function(_0x2647f0){throw _0x2647f0;});}this['log']=function(_0x3ce4e3,_0x3c1717,_0x40e67a,_0xeaa41d){return _0x368e29(_0x3ce4e3[_0xcd9d('0x11')])[_0xcd9d('0x10')](function(_0x5e26a5){var _0x5ed1b3=_0x5e26a5[_0x3c1717];return _0x5ed1b3;})[_0xcd9d('0x10')](function(_0x139d77){var _0xb9024d=_0x3ce4e3[_0xcd9d('0x11')]?_0x3ce4e3['user']['id']:'no-user';var _0x51ef9e=_0xeaa41d[_0xcd9d('0x12')];var _0x2002ae=_0xeaa41d[_0xcd9d('0x13')];var _0x95501=new Date(Number(_0x2002ae));return _0x139d77(_0xb9024d,_0x95501,_0x40e67a,_0x51ef9e);})[_0xcd9d('0x14')](function(_0x350c57){fileLogger('client')[_0xcd9d('0x15')](_0x350c57);});};}function setupLoggers(_0x18f8dc){return new Promise(function(_0x2f31ee){var _0x44a6e9=new ClientSideLogger();var _0x20b5ac=fileLogger('api');var _0xe25933=fileLogger('auth');_0x18f8dc[_0xcd9d('0x16')](_0xcd9d('0x17'),_0x44a6e9);_0x18f8dc[_0xcd9d('0x18')](ewinston[_0xcd9d('0x19')]({'winstonInstance':_0x20b5ac,'meta':![],'statusLevels':!![],'msg':function(_0x6e37e3,_0x18de47){var _0x538b90='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xcd9d('0x1a')](_0x6e37e3[_0xcd9d('0x1b')])){_0x538b90+=_0xcd9d('0x1c');var _0x456764=_0x6e37e3[_0xcd9d('0x1b')];maskSensitiveData(_0x456764);}return safeTemplate(util[_0xcd9d('0x1d')](_0x538b90,_0x6e37e3[_0xcd9d('0x1e')],_0x6e37e3[_0xcd9d('0x1f')][_0xcd9d('0x20')]?_0x6e37e3[_0xcd9d('0x1f')][_0xcd9d('0x20')]:_0x6e37e3['connection'][_0xcd9d('0x21')]||_0x6e37e3['ip'],_0x6e37e3[_0xcd9d('0x22')],_0x18de47[_0xcd9d('0x23')],_0x18de47['responseTime'],_0x6e37e3['user']?_0x6e37e3['user']['id']:null,_0x6e37e3[_0xcd9d('0x11')]?_0x6e37e3['user'][_0xcd9d('0x24')]:null,_0x6e37e3[_0xcd9d('0x11')]?_0x6e37e3[_0xcd9d('0x11')][_0xcd9d('0xe')]:null,_0x456764?util[_0xcd9d('0x25')](_0x456764,![],null):''));}}));_0x18f8dc[_0xcd9d('0x18')](ewinston[_0xcd9d('0x19')]({'winstonInstance':_0xe25933,'meta':![],'statusLevels':!![],'msg':function(_0x78e500,_0x7b1740){var _0x44113c=_0xcd9d('0x26');if(_0x78e500[_0xcd9d('0x1b')]&&_0x78e500[_0xcd9d('0x1b')][_0xcd9d('0x27')]&&_0x78e500[_0xcd9d('0x1b')][_0xcd9d('0x28')]){_0x44113c=_0xcd9d('0x29');}return util['format'](_0x44113c,_0x78e500['method'],_0x78e500['headers'][_0xcd9d('0x20')]?_0x78e500[_0xcd9d('0x1f')][_0xcd9d('0x20')]:_0x78e500[_0xcd9d('0x2a')][_0xcd9d('0x21')]||_0x78e500['ip'],_0x78e500['url'],_0x7b1740[_0xcd9d('0x23')],_0x7b1740[_0xcd9d('0x2b')],_0x78e500[_0xcd9d('0x11')]?_0x78e500[_0xcd9d('0x11')]['id']:null,_0x78e500[_0xcd9d('0x11')]?_0x78e500[_0xcd9d('0x11')][_0xcd9d('0x24')]:null,_0x78e500['user']?_0x78e500[_0xcd9d('0x11')][_0xcd9d('0xe')]:null,_0x78e500['body']&&_0x78e500[_0xcd9d('0x1b')]['device']?_0x78e500[_0xcd9d('0x1b')][_0xcd9d('0x27')]:_0xcd9d('0x2c'),_0x78e500[_0xcd9d('0x1b')]&&_0x78e500[_0xcd9d('0x1b')]['agent_id']?_0x78e500[_0xcd9d('0x1b')][_0xcd9d('0x28')]:'',_0x78e500['body']&&_0x78e500[_0xcd9d('0x1b')]['agent_name']?_0x78e500[_0xcd9d('0x1b')][_0xcd9d('0x2d')]:'');},'ignoreRoute':function(_0x192fe8){var _0x3b34f2=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3b34f2['test'](_0x192fe8[_0xcd9d('0x22')]);}}));return _0x2f31ee();});}exports[_0xcd9d('0x2e')]=setupLoggers; \ No newline at end of file +var _0x0d90=['isEmpty','body','\x20body=%s','format','method','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','agent_id','agent_name','test','fs-extra','lodash','express-winston','path','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','client','role','name','ensureDir','catch','user','then','no-user','data','timestamp','error','api','auth','set','client-side-logger'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0d90,0x1f4));var _0x00d9=function(_0x339959,_0x2a42f5){_0x339959=_0x339959-0x0;var _0x3f5af2=_0x0d90[_0x339959];return _0x3f5af2;};var fs=require(_0x00d9('0x0'));var _=require(_0x00d9('0x1'));var ewinston=require(_0x00d9('0x2'));var path=require(_0x00d9('0x3'));var util=require('util');var fileLogger=require(_0x00d9('0x4'))[_0x00d9('0x5')];var safeTemplate=require(_0x00d9('0x6'))[_0x00d9('0x7')];var maskSensitiveData=require(_0x00d9('0x8'))['maskSensitiveData'];function ClientSideLogger(){function _0x5477f2(_0x590719){var _0x44e591=path[_0x00d9('0x9')](_0x00d9('0xa'),_0x00d9('0xb'),_0x00d9('0xc'));var _0x1624a4=path[_0x00d9('0x9')](_0x00d9('0xd'),_0x590719[_0x00d9('0xe')]+'-'+_0x590719[_0x00d9('0xf')]);return fs[_0x00d9('0x10')](path['join'](_0x44e591,_0x1624a4))['then'](function(){var _0x4402d1=fileLogger(_0x00d9('0xd'),path[_0x00d9('0x9')](_0x44e591,_0x1624a4));return _0x4402d1;})[_0x00d9('0x11')](function(_0x51c2fd){throw _0x51c2fd;});}this['log']=function(_0xbfced7,_0xd875f0,_0x2a590c,_0xf414fa){return _0x5477f2(_0xbfced7[_0x00d9('0x12')])[_0x00d9('0x13')](function(_0x525fb8){var _0x28a8fb=_0x525fb8[_0xd875f0];return _0x28a8fb;})[_0x00d9('0x13')](function(_0x383a94){var _0x3eb7f=_0xbfced7[_0x00d9('0x12')]?_0xbfced7[_0x00d9('0x12')]['id']:_0x00d9('0x14');var _0x2828cd=_0xf414fa[_0x00d9('0x15')];var _0x321392=_0xf414fa[_0x00d9('0x16')];var _0x3868f9=new Date(Number(_0x321392));return _0x383a94(_0x3eb7f,_0x3868f9,_0x2a590c,_0x2828cd);})[_0x00d9('0x11')](function(_0x524122){fileLogger(_0x00d9('0xd'))[_0x00d9('0x17')](_0x524122);});};}function setupLoggers(_0x49e1f2){return new Promise(function(_0x24cd76){var _0x1ddd1a=new ClientSideLogger();var _0x28144d=fileLogger(_0x00d9('0x18'));var _0x50e877=fileLogger(_0x00d9('0x19'));_0x49e1f2[_0x00d9('0x1a')](_0x00d9('0x1b'),_0x1ddd1a);_0x49e1f2['use'](ewinston['logger']({'winstonInstance':_0x28144d,'meta':![],'statusLevels':!![],'msg':function(_0x1c98f4,_0x537054){var _0x163d59='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x00d9('0x1c')](_0x1c98f4[_0x00d9('0x1d')])){_0x163d59+=_0x00d9('0x1e');var _0x48892e=_0x1c98f4[_0x00d9('0x1d')];maskSensitiveData(_0x48892e);}return safeTemplate(util[_0x00d9('0x1f')](_0x163d59,_0x1c98f4[_0x00d9('0x20')],_0x1c98f4['headers'][_0x00d9('0x21')]?_0x1c98f4['headers']['x-forwarded-for']:_0x1c98f4[_0x00d9('0x22')][_0x00d9('0x23')]||_0x1c98f4['ip'],_0x1c98f4[_0x00d9('0x24')],_0x537054[_0x00d9('0x25')],_0x537054[_0x00d9('0x26')],_0x1c98f4[_0x00d9('0x12')]?_0x1c98f4[_0x00d9('0x12')]['id']:null,_0x1c98f4[_0x00d9('0x12')]?_0x1c98f4[_0x00d9('0x12')][_0x00d9('0xf')]:null,_0x1c98f4[_0x00d9('0x12')]?_0x1c98f4[_0x00d9('0x12')][_0x00d9('0xe')]:null,_0x48892e?util[_0x00d9('0x27')](_0x48892e,![],null):''));}}));_0x49e1f2[_0x00d9('0x28')](ewinston[_0x00d9('0x29')]({'winstonInstance':_0x50e877,'meta':![],'statusLevels':!![],'msg':function(_0x1b1b62,_0xd617d1){var _0x4cc05c=_0x00d9('0x2a');if(_0x1b1b62[_0x00d9('0x1d')]&&_0x1b1b62['body'][_0x00d9('0x2b')]&&_0x1b1b62[_0x00d9('0x1d')]['agent_id']){_0x4cc05c=_0x00d9('0x2c');}return util[_0x00d9('0x1f')](_0x4cc05c,_0x1b1b62['method'],_0x1b1b62['headers']['x-forwarded-for']?_0x1b1b62['headers'][_0x00d9('0x21')]:_0x1b1b62[_0x00d9('0x22')][_0x00d9('0x23')]||_0x1b1b62['ip'],_0x1b1b62[_0x00d9('0x24')],_0xd617d1[_0x00d9('0x25')],_0xd617d1[_0x00d9('0x26')],_0x1b1b62[_0x00d9('0x12')]?_0x1b1b62[_0x00d9('0x12')]['id']:null,_0x1b1b62[_0x00d9('0x12')]?_0x1b1b62[_0x00d9('0x12')][_0x00d9('0xf')]:null,_0x1b1b62[_0x00d9('0x12')]?_0x1b1b62[_0x00d9('0x12')][_0x00d9('0xe')]:null,_0x1b1b62['body']&&_0x1b1b62[_0x00d9('0x1d')]['device']?_0x1b1b62['body'][_0x00d9('0x2b')]:'other',_0x1b1b62[_0x00d9('0x1d')]&&_0x1b1b62[_0x00d9('0x1d')][_0x00d9('0x2d')]?_0x1b1b62[_0x00d9('0x1d')]['agent_id']:'',_0x1b1b62[_0x00d9('0x1d')]&&_0x1b1b62[_0x00d9('0x1d')][_0x00d9('0x2e')]?_0x1b1b62[_0x00d9('0x1d')][_0x00d9('0x2e')]:'');},'ignoreRoute':function(_0x2c53eb){var _0x4312ab=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4312ab[_0x00d9('0x2f')](_0x2c53eb[_0x00d9('0x24')]);}}));return _0x24cd76();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index f0c8ad2..eb3d2f4 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd732=['meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','Logger','warn','transports','%s-%s','error','Console','consoleLogger','fileLogger','path','util','moment','../config/environment','debugLevel','toLowerCase','red','bold\x20yellow','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','addColors','/var/log/xcally','join','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','keys'];(function(_0x2e35e5,_0x2b2325){var _0x265b31=function(_0x274d52){while(--_0x274d52){_0x2e35e5['push'](_0x2e35e5['shift']());}};_0x265b31(++_0x2b2325);}(_0xd732,0x110));var _0x2d73=function(_0x45c182,_0x3a76f1){_0x45c182=_0x45c182-0x0;var _0x2f41ad=_0xd732[_0x45c182];return _0x2f41ad;};'use strict';var path=require(_0x2d73('0x0'));var util=require(_0x2d73('0x1'));var moment=require(_0x2d73('0x2'));var winston=require('winston');var config=require(_0x2d73('0x3'));var debugLevel=config[_0x2d73('0x4')]?config[_0x2d73('0x4')][_0x2d73('0x5')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x2d73('0x6'),'warn':_0x2d73('0x7'),'info':'white','print':_0x2d73('0x8'),'success':_0x2d73('0x9'),'http':_0x2d73('0xa'),'verbose':_0x2d73('0xb'),'debug':_0x2d73('0xc'),'silly':'bold\x20cyan'};winston[_0x2d73('0xd')](XC_LOG_COLORS);function getLogFileName(_0x20c2b8,_0x31c743,_0xbc6ec5){var _0xd736b0=_0x20c2b8||_0x2d73('0xe');return path[_0x2d73('0xf')](_0xd736b0,util['format']('%s-%s.log',_0x31c743,_0xbc6ec5));}function formatter(_0x3475a0,_0x35e586){_0x35e586[_0x2d73('0x10')]=_0x35e586[_0x2d73('0x10')][_0x2d73('0x11')](/@@{/g,_0x2d73('0x12'))[_0x2d73('0x11')](/}@@/g,_0x2d73('0x13'))[_0x2d73('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x2d73('0x14')](_0x2d73('0x15'),moment()[_0x2d73('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),_0x35e586[_0x2d73('0x16')]['toUpperCase'](),_0x3475a0,_0x35e586[_0x2d73('0x10')]);}function fileFormat(_0x92d07d,_0x2d9b90){_0x2d9b90[_0x2d73('0x10')]=_0x2d9b90['message']['replace'](/@@{/g,'{{{')[_0x2d73('0x11')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x2d73('0x11')](/}@/g,'}}');var _0x125a04=_0x2d9b90['meta']&&Object[_0x2d73('0x17')](_0x2d9b90[_0x2d73('0x18')])[_0x2d73('0x19')]?'\x0a\x09'+JSON['stringify'](_0x2d9b90['meta']):'';return util[_0x2d73('0x14')](_0x2d73('0x1a'),moment()['format'](_0x2d73('0x1b')),_0x2d9b90['level'][_0x2d73('0x1c')](),_0x92d07d,_0x2d9b90[_0x2d73('0x10')],_0x125a04);}function consoleLogger(){var _0x3d66e4=new winston[(_0x2d73('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':_0x2d73('0x1e'),'json':![],'formatter':function(_0x242543){return formatter('',_0x242543);}})]});return _0x3d66e4;}function fileLogger(_0x1c2834,_0x42363b){var _0x26b68f=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2d73('0x1f'))]['File']({'name':util[_0x2d73('0x14')](_0x2d73('0x20'),_0x1c2834,'error'),'filename':getLogFileName(_0x42363b,_0x1c2834,'error'),'level':_0x2d73('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2bcace){return fileFormat(_0x1c2834,_0x2bcace);}}),new winston[(_0x2d73('0x1f'))]['File']({'name':util[_0x2d73('0x14')]('%s-%s',_0x1c2834,debugLevel),'filename':getLogFileName(_0x42363b,_0x1c2834,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x429854){return fileFormat(_0x1c2834,_0x429854);}}),new winston[(_0x2d73('0x1f'))][(_0x2d73('0x22'))]({'level':'warn','json':![],'formatter':function(_0x4d43f7){return fileFormat(_0x1c2834,_0x4d43f7);}})]});return _0x26b68f;}exports[_0x2d73('0x23')]=consoleLogger;exports[_0x2d73('0x24')]=fileLogger; \ No newline at end of file +var _0xba95=['/var/log/xcally','join','format','%s-%s.log','message','{{{','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','}}}','keys','stringify','meta','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','path','util','moment','../config/environment','debugLevel','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta','addColors'];(function(_0x3721bb,_0x457bee){var _0x5ea14c=function(_0x26b820){while(--_0x26b820){_0x3721bb['push'](_0x3721bb['shift']());}};_0x5ea14c(++_0x457bee);}(_0xba95,0x123));var _0x5ba9=function(_0x3e9894,_0x1797b1){_0x3e9894=_0x3e9894-0x0;var _0xaba32f=_0xba95[_0x3e9894];return _0xaba32f;};'use strict';var path=require(_0x5ba9('0x0'));var util=require(_0x5ba9('0x1'));var moment=require(_0x5ba9('0x2'));var winston=require('winston');var config=require(_0x5ba9('0x3'));var debugLevel=config[_0x5ba9('0x4')]?config['debugLevel']['toLowerCase']():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x5ba9('0x5'),'error':_0x5ba9('0x6'),'warn':_0x5ba9('0x7'),'info':_0x5ba9('0x8'),'print':_0x5ba9('0x9'),'success':_0x5ba9('0xa'),'http':'gray','verbose':_0x5ba9('0xb'),'debug':'bold\x20blue','silly':'bold\x20cyan'};winston[_0x5ba9('0xc')](XC_LOG_COLORS);function getLogFileName(_0x2c3bd6,_0x34330f,_0x23fd06){var _0x27494b=_0x2c3bd6||_0x5ba9('0xd');return path[_0x5ba9('0xe')](_0x27494b,util[_0x5ba9('0xf')](_0x5ba9('0x10'),_0x34330f,_0x23fd06));}function formatter(_0x112b2e,_0x32bed8){_0x32bed8[_0x5ba9('0x11')]=_0x32bed8[_0x5ba9('0x11')]['replace'](/@@{/g,_0x5ba9('0x12'))['replace'](/}@@/g,'}}}')[_0x5ba9('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x5ba9('0xf')](_0x5ba9('0x14'),moment()['format'](_0x5ba9('0x15')),_0x32bed8[_0x5ba9('0x16')][_0x5ba9('0x17')](),_0x112b2e,_0x32bed8[_0x5ba9('0x11')]);}function fileFormat(_0x1a6c39,_0x95661d){_0x95661d['message']=_0x95661d['message'][_0x5ba9('0x13')](/@@{/g,'{{{')[_0x5ba9('0x13')](/}@@/g,_0x5ba9('0x18'))[_0x5ba9('0x13')](/@{/g,'{{')[_0x5ba9('0x13')](/}@/g,'}}');var _0x19695c=_0x95661d['meta']&&Object[_0x5ba9('0x19')](_0x95661d['meta'])['length']?'\x0a\x09'+JSON[_0x5ba9('0x1a')](_0x95661d[_0x5ba9('0x1b')]):'';return util[_0x5ba9('0xf')](_0x5ba9('0x1c'),moment()[_0x5ba9('0xf')](_0x5ba9('0x15')),_0x95661d[_0x5ba9('0x16')][_0x5ba9('0x17')](),_0x1a6c39,_0x95661d[_0x5ba9('0x11')],_0x19695c);}function consoleLogger(){var _0x1353d2=new winston[(_0x5ba9('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5ba9('0x1e'))][(_0x5ba9('0x1f'))]({'level':_0x5ba9('0x20'),'json':![],'formatter':function(_0x209671){return formatter('',_0x209671);}})]});return _0x1353d2;}function fileLogger(_0x258f74,_0x158c72){var _0x4499b6=new winston[(_0x5ba9('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x5ba9('0x21'))]({'name':util[_0x5ba9('0xf')](_0x5ba9('0x22'),_0x258f74,'error'),'filename':getLogFileName(_0x158c72,_0x258f74,_0x5ba9('0x23')),'level':_0x5ba9('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3291d7){return fileFormat(_0x258f74,_0x3291d7);}}),new winston[(_0x5ba9('0x1e'))]['File']({'name':util[_0x5ba9('0xf')](_0x5ba9('0x22'),_0x258f74,debugLevel),'filename':getLogFileName(_0x158c72,_0x258f74,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4b76f9){return fileFormat(_0x258f74,_0x4b76f9);}}),new winston[(_0x5ba9('0x1e'))][(_0x5ba9('0x1f'))]({'level':_0x5ba9('0x20'),'json':![],'formatter':function(_0x522c4c){return fileFormat(_0x258f74,_0x522c4c);}})]});return _0x4499b6;}exports[_0x5ba9('0x24')]=consoleLogger;exports[_0x5ba9('0x25')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index e0ebf7e..3ea1af1 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66fa=['calleridnum','vidaooApiKey','privateKey','secretaccesskey','key','user','localstationid','oldPassword','isPlainObject','length','isString','replace','includes','exports','maskSensitiveData','lodash','username','newPassword','apiKey','firstName','lastName','street','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','authToken','calleridname'];(function(_0x2fb3b8,_0x3da41b){var _0x4d3319=function(_0x541e07){while(--_0x541e07){_0x2fb3b8['push'](_0x2fb3b8['shift']());}};_0x4d3319(++_0x3da41b);}(_0x66fa,0x117));var _0xa66f=function(_0xc8f1d4,_0x31dff6){_0xc8f1d4=_0xc8f1d4-0x0;var _0x2d3174=_0x66fa[_0xc8f1d4];return _0x2d3174;};var _=require(_0xa66f('0x0'));var sensitiveFields=[_0xa66f('0x1'),'password',_0xa66f('0x2'),_0xa66f('0x3'),_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8'),'fax','email',_0xa66f('0x9'),_0xa66f('0xa'),_0xa66f('0xb'),_0xa66f('0xc'),_0xa66f('0xd'),'tenantId',_0xa66f('0xe'),'channelSecret',_0xa66f('0xf'),'accessTokenSecret',_0xa66f('0x10'),'consumerKey','consumerSecret','membername',_0xa66f('0x11'),_0xa66f('0x12'),'exten',_0xa66f('0x13'),'clientEmail',_0xa66f('0x14'),'accesskeyid',_0xa66f('0x15'),_0xa66f('0x16'),_0xa66f('0x17'),'pass','accountSid',_0xa66f('0x18'),'dsn','secret','registry',_0xa66f('0x19')];function maskSensitiveData(_0x452c37){const _0x267129=/(?!^)[\s\S](?!$)/g;if(_[_0xa66f('0x1a')](_0x452c37)){for(const _0xd348f9 in _0x452c37){if(_['isArray'](_0x452c37[_0xd348f9])){for(let _0x5510dc=0x0;_0x5510dc<_0x452c37[_0xd348f9][_0xa66f('0x1b')];_0x5510dc++){maskSensitiveData(_0x452c37[_0xd348f9][_0x5510dc]);}}else if(_[_0xa66f('0x1a')](_0x452c37[_0xd348f9])){maskSensitiveData(_0x452c37[_0xd348f9]);}else if(_[_0xa66f('0x1c')](_0x452c37[_0xd348f9])){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](/{{{/g,'@@{')[_0xa66f('0x1d')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa66f('0x1d')](/}}/g,'}@');if(_[_0xa66f('0x1e')](sensitiveFields,_0xd348f9)){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](_0x267129,'*');}}}}}module[_0xa66f('0x1f')][_0xa66f('0x20')]=maskSensitiveData; \ No newline at end of file +var _0x14a0=['membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isArray','length','isPlainObject','isString','replace','@@{','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','code','accessKey','tenantId','accessToken'];(function(_0x509b39,_0x253035){var _0xdfd75f=function(_0xf75c4d){while(--_0xf75c4d){_0x509b39['push'](_0x509b39['shift']());}};_0xdfd75f(++_0x253035);}(_0x14a0,0x8e));var _0x014a=function(_0x5537a0,_0x509bad){_0x5537a0=_0x5537a0-0x0;var _0x44f566=_0x14a0[_0x5537a0];return _0x44f566;};var _=require('lodash');var sensitiveFields=[_0x014a('0x0'),_0x014a('0x1'),_0x014a('0x2'),_0x014a('0x3'),_0x014a('0x4'),_0x014a('0x5'),_0x014a('0x6'),'phone','mobile',_0x014a('0x7'),_0x014a('0x8'),_0x014a('0x9'),'clientSecret','securityToken',_0x014a('0xa'),_0x014a('0xb'),_0x014a('0xc'),'token','channelSecret',_0x014a('0xd'),'accessTokenSecret','authToken','consumerKey','consumerSecret',_0x014a('0xe'),'calleridname',_0x014a('0xf'),_0x014a('0x10'),'vidaooApiKey',_0x014a('0x11'),_0x014a('0x12'),_0x014a('0x13'),_0x014a('0x14'),_0x014a('0x15'),_0x014a('0x16'),_0x014a('0x17'),_0x014a('0x18'),_0x014a('0x19'),_0x014a('0x1a'),_0x014a('0x1b'),_0x014a('0x1c'),'oldPassword'];function maskSensitiveData(_0x130d13){const _0x3cf92f=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x130d13)){for(const _0x3a836f in _0x130d13){if(_[_0x014a('0x1d')](_0x130d13[_0x3a836f])){for(let _0x59a4ea=0x0;_0x59a4ea<_0x130d13[_0x3a836f][_0x014a('0x1e')];_0x59a4ea++){maskSensitiveData(_0x130d13[_0x3a836f][_0x59a4ea]);}}else if(_[_0x014a('0x1f')](_0x130d13[_0x3a836f])){maskSensitiveData(_0x130d13[_0x3a836f]);}else if(_[_0x014a('0x20')](_0x130d13[_0x3a836f])){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](/{{{/g,_0x014a('0x22'))[_0x014a('0x21')](/}}}/g,_0x014a('0x23'))[_0x014a('0x21')](/{{/g,'@{')[_0x014a('0x21')](/}}/g,'}@');if(_[_0x014a('0x24')](sensitiveFields,_0x3a836f)){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](_0x3cf92f,'*');}}}}}module[_0x014a('0x25')][_0x014a('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 09299a8..2e70cb6 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3423=['isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','\x20}\x20}','string','replace'];(function(_0x18e3bb,_0x5a0e9a){var _0xe0b9a6=function(_0x374517){while(--_0x374517){_0x18e3bb['push'](_0x18e3bb['shift']());}};_0xe0b9a6(++_0x5a0e9a);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4a04c7){return _0x4a04c7==='{{'?_0x3342('0x0'):_0x3342('0x1');}function safeTemplate(_0x3477de){var _0x3b763d=_0x3477de;if(typeof _0x3477de===_0x3342('0x2')){_0x3b763d=_0x3477de[_0x3342('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3342('0x4')](_0x3477de)){_0x3b763d=_0x3477de[_0x3342('0x5')](function(_0x3075f8){return safeTemplate(_0x3075f8);});}else if(_[_0x3342('0x6')](_0x3477de)){_0x3b763d=Object[_0x3342('0x7')](_0x3477de)[_0x3342('0x8')](function(_0x29c40c,_0x420d4b){_0x29c40c[_0x420d4b]=safeTemplate(_0x3477de[_0x420d4b]);return _0x29c40c;},{});}return _0x3b763d;}module[_0x3342('0x9')][_0x3342('0xa')]=safeTemplate; \ No newline at end of file +var _0x1a85=['{\x20{\x20','\x20}\x20}','replace','isArray','map','isPlainObject','reduce','exports'];(function(_0x209a3e,_0x53d8c5){var _0x98fffa=function(_0x5e3e03){while(--_0x5e3e03){_0x209a3e['push'](_0x209a3e['shift']());}};_0x98fffa(++_0x53d8c5);}(_0x1a85,0x178));var _0x51a8=function(_0x2ac992,_0x37c877){_0x2ac992=_0x2ac992-0x0;var _0x223c9d=_0x1a85[_0x2ac992];return _0x223c9d;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x54a0db){return _0x54a0db==='{{'?_0x51a8('0x0'):_0x51a8('0x1');}function safeTemplate(_0x43e22a){var _0x498466=_0x43e22a;if(typeof _0x43e22a==='string'){_0x498466=_0x43e22a[_0x51a8('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x51a8('0x3')](_0x43e22a)){_0x498466=_0x43e22a[_0x51a8('0x4')](function(_0x48a21b){return safeTemplate(_0x48a21b);});}else if(_[_0x51a8('0x5')](_0x43e22a)){_0x498466=Object['keys'](_0x43e22a)[_0x51a8('0x6')](function(_0x5cf430,_0x331117){_0x5cf430[_0x331117]=safeTemplate(_0x43e22a[_0x331117]);return _0x5cf430;},{});}return _0x498466;}module[_0x51a8('0x7')]['safeTemplate']=safeTemplate; \ No newline at end of file